@readmagic/workmate 0.0.19 → 0.0.21

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 (428) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-DgAxYgBY.js +1 -0
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-DGMRVexR.js +1 -0
  3. package/dist/chunks/AgentsMdExternalIncludesDialog-Dp6CwZyI.js +1 -0
  4. package/dist/chunks/App-VWyPd524.js +1 -0
  5. package/dist/chunks/ApproveApiKey-Bolw0sPs.js +1 -0
  6. package/dist/chunks/ApproveApiKey-CyNPMd6g.js +1 -0
  7. package/dist/chunks/BackgroundTasksDialog-DxagIOOw.js +2 -0
  8. package/dist/chunks/BypassPermissionsModeDialog-OS2S66zQ.js +1 -0
  9. package/dist/chunks/{DiffDialog-6Srcz3NW.js → DiffDialog-CMtml9iw.js} +3 -3
  10. package/dist/chunks/Doctor-Bk9P37mU.js +1 -0
  11. package/dist/chunks/Doctor-D9F3tKsr.js +3 -0
  12. package/dist/chunks/ExitFlow-DhRv5JPj.js +2 -0
  13. package/dist/chunks/{Grove-DC4jyxeB.js → Grove-Bbh8PpH0.js} +1 -1
  14. package/dist/chunks/{HybridTransport-DArmWb1V.js → HybridTransport-P1vEUwhv.js} +1 -1
  15. package/dist/chunks/InvalidConfigDialog-xAYpE-20.js +1 -0
  16. package/dist/chunks/InvalidSettingsDialog-CXFSISy3.js +1 -0
  17. package/dist/chunks/MCPConnectionManager-CoId-C__.js +1 -0
  18. package/dist/chunks/MCPToolListView-BQkQ-hyF.js +1 -0
  19. package/dist/chunks/McpParsingWarnings-6ENzOklf.js +1 -0
  20. package/dist/chunks/MessageSelector-BvRVrfg6.js +3 -0
  21. package/dist/chunks/Messages-Cykztq1O.js +10 -0
  22. package/dist/chunks/Onboarding-CfeRwPNQ.js +1 -0
  23. package/dist/chunks/PermissionDialog-BaibiQae.js +1 -0
  24. package/dist/chunks/PressEnterToContinue-DZc_s_pE.js +1 -0
  25. package/dist/chunks/PromptInputFooterSuggestions-Blzgj5yW.js +1 -0
  26. package/dist/chunks/PromptInputHelpMenu-Ckp0k8E3.js +1 -0
  27. package/dist/chunks/QueryEngine-DduzztIG.js +1 -0
  28. package/dist/chunks/REPL-B8e5UU3H.js +128 -0
  29. package/dist/chunks/REPL-C4mbOhyL.js +1 -0
  30. package/dist/chunks/{RemoteSessionManager-CRWOHvKf.js → RemoteSessionManager-BPESC6Wu.js} +2 -2
  31. package/dist/chunks/ResumeConversation-DG1sLryB.js +1 -0
  32. package/dist/chunks/{SSETransport-pPrlSZNF.js → SSETransport-CDNP2PlK.js} +1 -1
  33. package/dist/chunks/{SearchBox-CwwV0W-w.js → SearchBox-C9xxQzh1.js} +1 -1
  34. package/dist/chunks/SearchExtraToolsTool-vK2PP628.js +1 -0
  35. package/dist/chunks/Settings-B7n_dfP-.js +2 -0
  36. package/dist/chunks/TeleportProgress-QL3ibQfK.js +1 -0
  37. package/dist/chunks/TeleportRepoMismatchDialog-f-xl7biD.js +1 -0
  38. package/dist/chunks/TeleportResumeWrapper-DzVcrFuP.js +1 -0
  39. package/dist/chunks/ThemePicker-CIFKZza0.js +1 -0
  40. package/dist/chunks/TrustDialog-C0HEwZPk.js +1 -0
  41. package/dist/chunks/{ValidationErrorsList-BfZ5gcIv.js → ValidationErrorsList-2QWIs_6h.js} +1 -1
  42. package/dist/chunks/add-dir-DmEhPnvj.js +1 -0
  43. package/dist/chunks/{agentDisplay-D01ZlnVX.js → agentDisplay-1Y-N-gqz.js} +1 -1
  44. package/dist/chunks/{agents-Bxenhf8S.js → agents-CvW8XjoJ.js} +1 -1
  45. package/dist/chunks/agents-D96ng5I9.js +101 -0
  46. package/dist/chunks/allErrors-CT2dbBF3.js +1 -0
  47. package/dist/chunks/{api-C5ULzZny.js → api-DTyrmy1O.js} +1 -1
  48. package/dist/chunks/api-DumFOErN.js +1 -0
  49. package/dist/chunks/{auth-DvcZHXGk.js → auth-CZ4EsFWF.js} +1 -1
  50. package/dist/chunks/auth-QvonHoG9.js +1 -0
  51. package/dist/chunks/auth-jV5THRH8.js +1 -0
  52. package/dist/chunks/backgroundHousekeeping-C72oPgfD.js +17 -0
  53. package/dist/chunks/backgroundHousekeeping-D9PScHES.js +1 -0
  54. package/dist/chunks/{banner-BkUdig-T.js → banner-ChT5Ri7Q.js} +1 -1
  55. package/dist/chunks/{bg-tGgpwpYx.js → bg-qG2osBbP.js} +2 -2
  56. package/dist/chunks/{branch-CqQxCSHG.js → branch-K8X6jx0i.js} +1 -1
  57. package/dist/chunks/{break-cache-CcwOjTKt.js → break-cache-BZ_UMtEL.js} +1 -1
  58. package/dist/chunks/{bridgeConfig-MxsnEEPx.js → bridgeConfig-C-bI-slm.js} +1 -1
  59. package/dist/chunks/bridgeConfig-_xpxhGB5.js +1 -0
  60. package/dist/chunks/{bridgeMessaging-Bx5pkkkx.js → bridgeMessaging-DSJlYarJ.js} +1 -1
  61. package/dist/chunks/{bridgeStatusUtil-B9EcQksI.js → bridgeStatusUtil-DaEq5c69.js} +1 -1
  62. package/dist/chunks/btw-BNs5OX7x.js +1 -0
  63. package/dist/chunks/caches-CC5NHwAz.js +1 -0
  64. package/dist/chunks/caches-nHxJWXgO.js +1 -0
  65. package/dist/chunks/{ccrClient-CimQTd0b.js → ccrClient-JnhF5b3z.js} +1 -1
  66. package/dist/chunks/{clear-KvoD-lFN.js → clear-D2KRoibg.js} +1 -1
  67. package/dist/chunks/client-BtTkq0YS.js +1 -0
  68. package/dist/chunks/commands-C_rYjyQZ.js +1 -0
  69. package/dist/chunks/compact-Cqd6vKpn.js +2 -0
  70. package/dist/chunks/config-Be0BkAAr.js +1 -0
  71. package/dist/chunks/{config-DRy1I12M.js → config-DUTgj3js.js} +1 -1
  72. package/dist/chunks/{config-e0Goy478.js → config-DoEDgAfv.js} +1 -1
  73. package/dist/chunks/context-Db9tH1VF.js +1 -0
  74. package/dist/chunks/{context-noninteractive-ApbVPU86.js → context-noninteractive-CacA9VlT.js} +2 -2
  75. package/dist/chunks/context-noninteractive-D9tJYwi7.js +1 -0
  76. package/dist/chunks/conversation-DWfE4KGH.js +1 -0
  77. package/dist/chunks/conversation-Tvo4EDpQ.js +1 -0
  78. package/dist/chunks/convert-legacy-node-http-options-BZnGSjx2.js +1 -0
  79. package/dist/chunks/{createSSHSession-DOz_Ox1_.js → createSSHSession-BQ83MMtr.js} +1 -1
  80. package/dist/chunks/createSession-CqHnHhCR.js +1 -0
  81. package/dist/chunks/{createSession-yR87Rhiv.js → createSession-DqTtBycR.js} +1 -1
  82. package/dist/chunks/crossProjectResume-DIXtiODF.js +40 -0
  83. package/dist/chunks/{datadog-DBgIEaEd.js → datadog-BuElf2EQ.js} +1 -1
  84. package/dist/chunks/detectRepository-DUJBh5s2.js +1 -0
  85. package/dist/chunks/{detectRepository-CDOJ-M7h.js → detectRepository-pRAVv8SH.js} +1 -1
  86. package/dist/chunks/{diff-qOom_T1G.js → diff-yA6v_dpP.js} +1 -1
  87. package/dist/chunks/{directoryCompletion-BDGcGDuv.js → directoryCompletion-CuA3_YIT.js} +1 -1
  88. package/dist/chunks/doctor-eNAm6OiS.js +1 -0
  89. package/dist/chunks/{entry-EmOA7oWN.js → entry-DidpiR-D.js} +5 -5
  90. package/dist/chunks/esm-0CwQE5CJ.js +10 -0
  91. package/dist/chunks/esm-BCUC71kt.js +1 -0
  92. package/dist/chunks/esm-BCmY8V0C.js +1 -0
  93. package/dist/chunks/esm-BUJtY-Rb.js +1 -0
  94. package/dist/chunks/esm-BadZVa27.js +1 -0
  95. package/dist/chunks/esm-BbMeEYcz.js +1 -0
  96. package/dist/chunks/esm-sVMjGuep.js +1 -0
  97. package/dist/chunks/execFileNoThrow-B_KRY4cT.js +34 -0
  98. package/dist/chunks/exit-DywUeiYd.js +1 -0
  99. package/dist/chunks/extraUsage-DiAirtuk.js +1 -0
  100. package/dist/chunks/extractMemories-_xiTnX95.js +1 -0
  101. package/dist/chunks/fast-DCXZACT9.js +1 -0
  102. package/dist/chunks/fast-Qo4WVqiW.js +1 -0
  103. package/dist/chunks/{fetchModelList-BbjuFHQT.js → fetchModelList-fQDsmR3E.js} +1 -1
  104. package/dist/chunks/fetchModelList-woVzIVde.js +1 -0
  105. package/dist/chunks/{fileSuggestions-Ct7vKEpR.js → fileSuggestions-CRx1D6uk.js} +3 -3
  106. package/dist/chunks/firstPartyEventLogger-B261Wksn.js +3 -0
  107. package/dist/chunks/firstPartyEventLogger-DtFTeHy-.js +1 -0
  108. package/dist/chunks/{flushGate-BZe_QwEz.js → flushGate-BA8dSr0i.js} +1 -1
  109. package/dist/chunks/fpsMetrics-wxj9GAsd.js +1 -0
  110. package/dist/chunks/{gemini-8sSwOtEf.js → gemini-BXAyy1JN.js} +1 -1
  111. package/dist/chunks/generateSessionName-Cwmk2N3F.js +1 -0
  112. package/dist/chunks/{genericProcessUtils-6E7fB1dI.js → genericProcessUtils-Cnyun_Wr.js} +3 -3
  113. package/dist/chunks/{git-By_J4XJL.js → git-Wid-XppW.js} +1 -1
  114. package/dist/chunks/git-hO-TMvXc.js +1 -0
  115. package/dist/chunks/{githubRepoPathMapping-CzgPGOHQ.js → githubRepoPathMapping-OV8U1VFK.js} +1 -1
  116. package/dist/chunks/goal-C9clrwEH.js +3 -0
  117. package/dist/chunks/{grok-cEzUsG-s.js → grok-CjeCecsZ.js} +1 -1
  118. package/dist/chunks/{grove--HtQL4QZ.js → grove-DqTnK9nn.js} +2 -2
  119. package/dist/chunks/help-Bb6LdzXK.js +1 -0
  120. package/dist/chunks/{hooks-CN5hLrhi.js → hooks-BDgToO1Z.js} +2 -2
  121. package/dist/chunks/hooks-BX2s7aoL.js +1 -0
  122. package/dist/chunks/{initReplBridge-BJhmlcVt.js → initReplBridge-D7cuY_os.js} +1 -1
  123. package/dist/chunks/install-eCA8UACi.js +1 -0
  124. package/dist/chunks/{instrumentation-DpgB3GFx.js → instrumentation-BaRKojJh.js} +6 -6
  125. package/dist/chunks/{job-DDoX1iFe.js → job-DYMfSglZ.js} +1 -1
  126. package/dist/chunks/{jwtUtils-C_LG1txt.js → jwtUtils-JE2okZ70.js} +1 -1
  127. package/dist/chunks/keybindings-iBqc1KHL.js +1 -0
  128. package/dist/chunks/launchLocalMemory-IZPGEzMk.js +3 -0
  129. package/dist/chunks/launchOnboarding-BeNf51Ig.js +8 -0
  130. package/dist/chunks/loadAgentsDir-Bpke9CtB.js +1 -0
  131. package/dist/chunks/{loadAgentsDir-DXOkUcW3.js → loadAgentsDir-C96o6gCj.js} +601 -626
  132. package/dist/chunks/loadPluginHooks-0nGlugZ4.js +1 -0
  133. package/dist/chunks/{localSearch-DnT21UkF.js → localSearch-DLz5IGGu.js} +1 -1
  134. package/dist/chunks/localSearch-dodgnjGn.js +1 -0
  135. package/dist/chunks/logoUtils-Cg_6QV1Z.js +1 -0
  136. package/dist/chunks/{magicDocs-rxv0rR8E.js → magicDocs-DmPNMnNY.js} +2 -2
  137. package/dist/chunks/{main-Blm02_Js.js → main-7ssnA9Yb.js} +2 -2
  138. package/dist/chunks/{main-BOvY4O6D.js → main-BEv6MqMX.js} +34 -34
  139. package/dist/chunks/{managedEnv-CpgCYISH.js → managedEnv-CHYvwXBH.js} +1 -1
  140. package/dist/chunks/managedEnv-CbjOQmEe.js +1 -0
  141. package/dist/chunks/mappers-D8VLUZ2N.js +1 -0
  142. package/dist/chunks/mcp-BUn3yqsT.js +1 -0
  143. package/dist/chunks/mcp-BskLq9iP.js +2 -0
  144. package/dist/chunks/mcp-C-0DMaXx.js +6 -0
  145. package/dist/chunks/memory-vDkJM58W.js +1 -0
  146. package/dist/chunks/modalContext-DDZdU1J8.js +1 -0
  147. package/dist/chunks/mode-Dbh21H2Y.js +2 -0
  148. package/dist/chunks/model-BaMclMXn.js +1 -0
  149. package/dist/chunks/model-atn3_JBi.js +1 -0
  150. package/dist/chunks/model-vS1Iewyq.js +1 -0
  151. package/dist/chunks/{modelOptions-BqBHEyiR.js → modelOptions-Cw1ThINb.js} +1 -1
  152. package/dist/chunks/{src-l6_O0K-a.js → modifiersNative-BYHdmWw1.js} +1 -1
  153. package/dist/chunks/modifiersNative-D7nm70eq.js +1 -0
  154. package/dist/chunks/nativeInstaller-CfZ5uNTh.js +1 -0
  155. package/dist/chunks/omit-B7eQ9q0x.js +1 -0
  156. package/dist/chunks/{onChangeAppState-qHXqufwy.js → onChangeAppState-kEAt8nxV.js} +1 -1
  157. package/dist/chunks/{openai-_FQ9EhuR.js → openai-wh8AX5iz.js} +3 -3
  158. package/dist/chunks/panel-Cm23FDVt.js +1 -0
  159. package/dist/chunks/{partition-BgwHlPsO.js → partition-CENvOfiS.js} +1 -1
  160. package/dist/chunks/permissions-ChuIx-d4.js +3 -0
  161. package/dist/chunks/{pidLock-CEhbTkBE.js → pidLock-C1hmh3YQ.js} +2 -2
  162. package/dist/chunks/plan-s228H7IU.js +1 -0
  163. package/dist/chunks/plugin-DVBEWwMP.js +17 -0
  164. package/dist/chunks/{pluginAutoupdate-C2YbEHrP.js → pluginAutoupdate-aLXhSUVD.js} +1 -1
  165. package/dist/chunks/pluginBlocklist-BprCv0En.js +1 -0
  166. package/dist/chunks/pluginCliCommands-WzzqR1Sr.js +1 -0
  167. package/dist/chunks/{pluginFlagging-BDTgCYuC.js → pluginFlagging-BSLuTk3M.js} +1 -1
  168. package/dist/chunks/pluginOperations-Ca9Lup5G.js +2 -0
  169. package/dist/chunks/pluginStartupCheck-DdtxcNwH.js +1 -0
  170. package/dist/chunks/{pluginStartupCheck-DhhMk3dA.js → pluginStartupCheck-xQbHZ5gf.js} +1 -1
  171. package/dist/chunks/plugins-DdIaXpNb.js +4 -0
  172. package/dist/chunks/{poorMode-CKQfWf3S.js → poorMode-Bt_A2arj.js} +1 -1
  173. package/dist/chunks/poorMode-ZIq2oz7q.js +1 -0
  174. package/dist/chunks/print-vxrRE1O2.js +14 -0
  175. package/dist/chunks/processBashCommand-ISucgwpi.js +1 -0
  176. package/dist/chunks/processSlashCommand-BnpXO_fI.js +5 -0
  177. package/dist/chunks/prompt-2AA5W7EH.js +1 -0
  178. package/dist/chunks/prompt-AXiS2LoO.js +1 -0
  179. package/dist/chunks/{prompt-DEioJrx_.js → prompt-BNNE5tsG.js} +1 -1
  180. package/dist/chunks/promptEditor-DT6egmcb.js +4 -0
  181. package/dist/chunks/{protocolHandler-C-CFTcUJ.js → protocolHandler-DukQ6b4Q.js} +2 -2
  182. package/dist/chunks/{reconciler-DZP4dJJG.js → reconciler-D3zyJCnV.js} +1 -1
  183. package/dist/chunks/refresh-BSG0t4cf.js +1 -0
  184. package/dist/chunks/registerProtocol-BOEYaX-X.js +1 -0
  185. package/dist/chunks/{reload-plugins-m9CzoIxu.js → reload-plugins-BFMRhbv8.js} +1 -1
  186. package/dist/chunks/{remoteBridgeCore-C4vSr1gp.js → remoteBridgeCore-D5OwvmAz.js} +1 -1
  187. package/dist/chunks/{remoteManagedSettings-6RAHPt_g.js → remoteManagedSettings-DyGVvvcW.js} +1 -1
  188. package/dist/chunks/rename-BrEwj3Xw.js +1 -0
  189. package/dist/chunks/resume-DR5JbICs.js +2 -0
  190. package/dist/chunks/{ripgrep-C3jtZL7k.js → ripgrep-Dt4a91S5.js} +1 -1
  191. package/dist/chunks/ripgrep-KTOU5s9J.js +1 -0
  192. package/dist/chunks/{runtimeObserver-C2vjqtCE.js → runtimeObserver-CsZw5XBt.js} +2 -2
  193. package/dist/chunks/{runtimeObserver-CSroopId.js → runtimeObserver-DS1PK6We.js} +1 -1
  194. package/dist/chunks/sandbox-adapter-BqDyWcol.js +1 -0
  195. package/dist/chunks/sandbox-toggle-B9f_0NQI.js +1 -0
  196. package/dist/chunks/sanitization-DV-94a9Z.js +1 -0
  197. package/dist/chunks/searchExtraTools-2pIT2C8u.js +1 -0
  198. package/dist/chunks/session-wkRTfdo8.js +2 -0
  199. package/dist/chunks/sessionFileAccessHooks-DV22q9JO.js +1 -0
  200. package/dist/chunks/sessionObserver-BLJg0qm_.js +1 -0
  201. package/dist/chunks/{sessionObserver-iAJLH92a.js → sessionObserver-N7fORFdL.js} +2 -2
  202. package/dist/chunks/{sessionState-DAcub-HK.js → sessionState-8jutEorw.js} +1 -1
  203. package/dist/chunks/sessionStorage-DRV7IhZF.js +1 -0
  204. package/dist/chunks/sessionTracing-fIp8g04N.js +11 -0
  205. package/dist/chunks/{settings-3xZ0fsvE.js → settings-BowI3jp-.js} +2 -2
  206. package/dist/chunks/settings-CHn0gJCG.js +1 -0
  207. package/dist/chunks/settingsSync-DF4JgSNc.js +1 -0
  208. package/dist/chunks/setup-UiEO9i7F.js +3 -0
  209. package/dist/chunks/{shadowedRuleDetection-BL7dEv-u.js → shadowedRuleDetection-DEo1hvGi.js} +1 -1
  210. package/dist/chunks/{sideQuestion-Ct87yvOR.js → sideQuestion-C11KgNGL.js} +3 -3
  211. package/dist/chunks/sinks-DnLqRPEC.js +1 -0
  212. package/dist/chunks/{sinks-Bmn3li0M.js → sinks-mGBiINp8.js} +1 -1
  213. package/dist/chunks/skillChangeDetector-Dc6YZXJE.js +1 -0
  214. package/dist/chunks/{skillGapStore-MtlRyYmT.js → skillGapStore-H4MkUFUY.js} +2 -2
  215. package/dist/chunks/{skillLifecycle-Drs6gEv9.js → skillLifecycle-ADUTDK7D.js} +2 -2
  216. package/dist/chunks/{skillSearchPanel-DkvmjNaw.js → skillSearchPanel-PpfVDMGR.js} +2 -2
  217. package/dist/chunks/skills-DKtN17ch.js +1 -0
  218. package/dist/chunks/src-9vmGsuSI.js +1 -0
  219. package/dist/chunks/{src-CgZmCiiH.js → src-BacxF9BD.js} +2 -2
  220. package/dist/chunks/{startupProfiler-CbzxVmbv.js → startupProfiler-B90b5vuq.js} +1 -1
  221. package/dist/chunks/startupProfiler-DG2TN5R_.js +1 -0
  222. package/dist/chunks/staticRender-BVWx0IM1.js +1 -0
  223. package/dist/chunks/stats-D4LEtkrw.js +1 -0
  224. package/dist/chunks/status-0ZBx6Ls0.js +2 -0
  225. package/dist/chunks/status-BUJ4-omB.js +1 -0
  226. package/dist/chunks/{statusNoticeHelpers-BrN_2q7H.js → statusNoticeHelpers-BrpQWj0l.js} +1 -1
  227. package/dist/chunks/{stringUtils-CKD8qDqx.js → stringUtils-D7oJIyY2.js} +1 -1
  228. package/dist/chunks/switcher-D7Ey5uIi.js +1 -0
  229. package/dist/chunks/{switcher-99gm2vpe.js → switcher-DWfKi17X.js} +1 -1
  230. package/dist/chunks/{syncCache-B3OVvp8K.js → syncCache-DUhciJLz.js} +1 -1
  231. package/dist/chunks/{tasks-t5zT_D32.js → tasks-BwSsj2vI.js} +1 -1
  232. package/dist/chunks/teleport-DwZMevmQ.js +1 -0
  233. package/dist/chunks/{templateJobs-Bm8bovHx.js → templateJobs-fiKuu4DK.js} +1 -1
  234. package/dist/chunks/{terminalSetup-7PdC4fV5.js → terminalSetup-Cte5a4hM.js} +1 -1
  235. package/dist/chunks/{terminalSetup-kWdZRKWq.js → terminalSetup-a7-BNS4T.js} +1 -1
  236. package/dist/chunks/theme-CAoGjf2D.js +1 -0
  237. package/dist/chunks/{tmux-CpGd0Aca.js → tmux-DA06aewY.js} +1 -1
  238. package/dist/chunks/{toolEventObserver-C_nHI27x.js → toolEventObserver-Cq_ZV7x9.js} +1 -1
  239. package/dist/chunks/toolPool-mdsxlKWR.js +1 -0
  240. package/dist/chunks/{trustedDevice-Bb7O8_tj.js → trustedDevice-C1m--Yjw.js} +1 -1
  241. package/dist/chunks/trustedDevice-CeDIk_ln.js +1 -0
  242. package/dist/chunks/{udsClient-U7MEfYj7.js → udsClient-BcwsY0XE.js} +1 -1
  243. package/dist/chunks/useExitOnCtrlCDWithKeybindings-L5idX6Kz.js +1 -0
  244. package/dist/chunks/useMainLoopModel-VXeS2EC6.js +1 -0
  245. package/dist/chunks/useManagePlugins-CAXp5CfH.js +1 -0
  246. package/dist/chunks/useMergedTools-DYXrPTIA.js +1 -0
  247. package/dist/chunks/useSearchInput-Bxl4wGcZ.js +1 -0
  248. package/dist/chunks/useSettingsErrors-sbjsaT7k.js +1 -0
  249. package/dist/chunks/{userAgent-CJ5Rp9kc.js → userAgent-NbKd-hN7.js} +1 -1
  250. package/dist/chunks/util-DU63xTwZ.js +1 -0
  251. package/dist/chunks/validatePlugin-DQ_9OCpP.js +1 -0
  252. package/dist/chunks/{vim-BagKUX4j.js → vim-xruiCyUd.js} +1 -1
  253. package/dist/chunks/which-B8rchd8P.js +1 -0
  254. package/dist/chunks/{workerRegistry-BGJtgrko.js → workerRegistry-BBgquE8F.js} +2 -2
  255. package/dist/chunks/worktree-C28I8mFB.js +1 -0
  256. package/dist/cli.js +1 -1
  257. package/package.json +3 -25
  258. package/dist/chunks/AddWorkspaceDirectory-9FcHMKgX.js +0 -1
  259. package/dist/chunks/AgentsMdExternalIncludesDialog-Bny8WDwC.js +0 -1
  260. package/dist/chunks/AgentsMdExternalIncludesDialog-DLnj3JQO.js +0 -1
  261. package/dist/chunks/App-NkBqbDbC.js +0 -1
  262. package/dist/chunks/ApproveApiKey-BKzkEkW-.js +0 -1
  263. package/dist/chunks/ApproveApiKey-rgB6AsYD.js +0 -1
  264. package/dist/chunks/BackgroundTasksDialog-CcViruUO.js +0 -2
  265. package/dist/chunks/BypassPermissionsModeDialog-D254L98G.js +0 -1
  266. package/dist/chunks/Doctor-DYEdLRxR.js +0 -1
  267. package/dist/chunks/Doctor-DiNxlXfC.js +0 -3
  268. package/dist/chunks/ExitFlow-Bt2De110.js +0 -2
  269. package/dist/chunks/InvalidConfigDialog-DFiB0Kzc.js +0 -1
  270. package/dist/chunks/InvalidSettingsDialog-BHNo2__T.js +0 -1
  271. package/dist/chunks/MCPConnectionManager-CdpO2Tj9.js +0 -1
  272. package/dist/chunks/MCPToolListView-Ch4jOk_x.js +0 -1
  273. package/dist/chunks/McpParsingWarnings-D4UQ8Q2e.js +0 -1
  274. package/dist/chunks/MessageSelector-BgsrdJur.js +0 -3
  275. package/dist/chunks/Messages-DB1pmDY_.js +0 -10
  276. package/dist/chunks/Onboarding-BnjdTwci.js +0 -1
  277. package/dist/chunks/PermissionDialog-BPhvs5xH.js +0 -1
  278. package/dist/chunks/PressEnterToContinue-Dwoh6CaW.js +0 -1
  279. package/dist/chunks/PromptInputFooterSuggestions-Chg9U-BC.js +0 -1
  280. package/dist/chunks/PromptInputHelpMenu-C0ZSo12s.js +0 -1
  281. package/dist/chunks/QueryEngine-bKlupZpA.js +0 -1
  282. package/dist/chunks/REPL-Cg8UXYpX.js +0 -128
  283. package/dist/chunks/REPL-yzvMFfaU.js +0 -1
  284. package/dist/chunks/ResumeConversation-Ld7tYLKO.js +0 -1
  285. package/dist/chunks/SearchExtraToolsTool-CdgQlm--.js +0 -1
  286. package/dist/chunks/Settings-CsOlPcIW.js +0 -2
  287. package/dist/chunks/TeleportProgress-Di-PMey7.js +0 -1
  288. package/dist/chunks/TeleportRepoMismatchDialog-CDv1cbo-.js +0 -1
  289. package/dist/chunks/TeleportResumeWrapper-Bmf13tGU.js +0 -1
  290. package/dist/chunks/ThemePicker-B3AO3_jA.js +0 -1
  291. package/dist/chunks/TrustDialog-C0aiR_LU.js +0 -1
  292. package/dist/chunks/add-dir-w1Ay3861.js +0 -1
  293. package/dist/chunks/agents-B_hUgPnR.js +0 -101
  294. package/dist/chunks/allErrors-C_iHQOlK.js +0 -1
  295. package/dist/chunks/api-CB3e0De0.js +0 -1
  296. package/dist/chunks/attributionHooks-C0aXyx9L.js +0 -1
  297. package/dist/chunks/auth-CsYEYXBO.js +0 -1
  298. package/dist/chunks/auth-CubXYcRl.js +0 -1
  299. package/dist/chunks/backgroundHousekeeping-BGKR5cdA.js +0 -17
  300. package/dist/chunks/backgroundHousekeeping-CykbtljP.js +0 -1
  301. package/dist/chunks/bridgeConfig-Cp2x_wtE.js +0 -1
  302. package/dist/chunks/btw-DeznoRrw.js +0 -1
  303. package/dist/chunks/caches-BiVRgePi.js +0 -1
  304. package/dist/chunks/caches-CGzKSWiP.js +0 -1
  305. package/dist/chunks/client-CmnPWgLq.js +0 -1
  306. package/dist/chunks/commands-CrzVgHxp.js +0 -1
  307. package/dist/chunks/compact-Dgzve3dI.js +0 -2
  308. package/dist/chunks/config-Df8jooTW.js +0 -1
  309. package/dist/chunks/context-Dz-bbYCw.js +0 -1
  310. package/dist/chunks/context-noninteractive-m4O3VtG7.js +0 -1
  311. package/dist/chunks/conversation-BYBX07j8.js +0 -1
  312. package/dist/chunks/conversation-CJ-d0O-U.js +0 -1
  313. package/dist/chunks/createSession-C_-ZEQT5.js +0 -1
  314. package/dist/chunks/crossProjectResume-DNnZo3gU.js +0 -40
  315. package/dist/chunks/detectRepository-Cv9-k6dg.js +0 -1
  316. package/dist/chunks/doctor-CflXjqVK.js +0 -1
  317. package/dist/chunks/esm-BYnFh4pG.js +0 -1
  318. package/dist/chunks/esm-Bx6rTxIs.js +0 -1
  319. package/dist/chunks/esm-C367Cyo-.js +0 -1
  320. package/dist/chunks/esm-CXM9jqO_.js +0 -1
  321. package/dist/chunks/esm-CXczu_-W.js +0 -1
  322. package/dist/chunks/esm-CXt5K8Xt.js +0 -1
  323. package/dist/chunks/esm-Cb-L4oAk.js +0 -1
  324. package/dist/chunks/esm-DBMVQDVv.js +0 -1
  325. package/dist/chunks/esm-DhRjocaU.js +0 -1
  326. package/dist/chunks/esm-DklLYEuz.js +0 -1
  327. package/dist/chunks/esm-IYgGg4wR.js +0 -1
  328. package/dist/chunks/esm-lyfry1WB.js +0 -10
  329. package/dist/chunks/execFileNoThrow-Bmb5HEFz.js +0 -34
  330. package/dist/chunks/exit-DDrAFCzE.js +0 -1
  331. package/dist/chunks/extraUsage-DylXI7Fc.js +0 -1
  332. package/dist/chunks/extractMemories-B_8wZpXA.js +0 -1
  333. package/dist/chunks/fast-4ajfJv-M.js +0 -1
  334. package/dist/chunks/fast-BCkhj9Dq.js +0 -1
  335. package/dist/chunks/fetchModelList-V8_e2O1N.js +0 -1
  336. package/dist/chunks/firstPartyEventLogger-CxUuXQhL.js +0 -3
  337. package/dist/chunks/firstPartyEventLogger-YQm0DoVu.js +0 -1
  338. package/dist/chunks/fpsMetrics-Dk_pnSHJ.js +0 -1
  339. package/dist/chunks/generateSessionName-vT1khubt.js +0 -1
  340. package/dist/chunks/git-zJCasBa6.js +0 -1
  341. package/dist/chunks/goal-CznQA1n1.js +0 -3
  342. package/dist/chunks/help-B6A_kDQA.js +0 -1
  343. package/dist/chunks/hooks-CJY5Vfy6.js +0 -1
  344. package/dist/chunks/install-DUOtI2Hq.js +0 -1
  345. package/dist/chunks/keybindings-BGTuYfk-.js +0 -1
  346. package/dist/chunks/launchLocalMemory-CoWeLNeP.js +0 -3
  347. package/dist/chunks/launchOnboarding-CTIBGSLV.js +0 -8
  348. package/dist/chunks/loadAgentsDir-Dxz1vp3F.js +0 -1
  349. package/dist/chunks/loadPluginHooks-DrNVtTBq.js +0 -1
  350. package/dist/chunks/localSearch-CCs5fOd_.js +0 -1
  351. package/dist/chunks/logoUtils-YwL3izJt.js +0 -1
  352. package/dist/chunks/managedEnv-CrnBYTtQ.js +0 -1
  353. package/dist/chunks/mappers-DYtq2XVS.js +0 -1
  354. package/dist/chunks/mcp-BPvcoKDY.js +0 -1
  355. package/dist/chunks/mcp-BfqsHRx0.js +0 -2
  356. package/dist/chunks/mcp-BoU3TNFs.js +0 -6
  357. package/dist/chunks/memory-BPKRdkBb.js +0 -1
  358. package/dist/chunks/modalContext-wY9CeN4G.js +0 -1
  359. package/dist/chunks/mode-CXpXux2s.js +0 -2
  360. package/dist/chunks/model-CxPYKiW1.js +0 -1
  361. package/dist/chunks/model-Cxx3suBa.js +0 -1
  362. package/dist/chunks/model-aEJ54cMA.js +0 -1
  363. package/dist/chunks/nativeInstaller-CaXwRpoR.js +0 -1
  364. package/dist/chunks/omit-DZUxsClb.js +0 -1
  365. package/dist/chunks/panel-CVd1dzYl.js +0 -1
  366. package/dist/chunks/permissions-Dv5d5Nu3.js +0 -3
  367. package/dist/chunks/plan-DVPBW5OS.js +0 -1
  368. package/dist/chunks/plugin-Bh2eBwLW.js +0 -17
  369. package/dist/chunks/pluginBlocklist-B2NAKaB9.js +0 -1
  370. package/dist/chunks/pluginCliCommands-Cw5TrYYb.js +0 -1
  371. package/dist/chunks/pluginOperations-BBwGEdfC.js +0 -2
  372. package/dist/chunks/pluginStartupCheck-CHx379_R.js +0 -1
  373. package/dist/chunks/plugins-r0h93GT_.js +0 -4
  374. package/dist/chunks/poorMode-BTIe8W_H.js +0 -1
  375. package/dist/chunks/postCommitAttribution-DoSP9wZD.js +0 -1
  376. package/dist/chunks/print-CDzhHi2F.js +0 -14
  377. package/dist/chunks/processBashCommand-DmdCAWOR.js +0 -1
  378. package/dist/chunks/processSlashCommand-B43TkiaI.js +0 -5
  379. package/dist/chunks/prompt-C50mDqWv.js +0 -1
  380. package/dist/chunks/prompt-WGH9CcXh.js +0 -1
  381. package/dist/chunks/promptEditor-eJzbtNn4.js +0 -4
  382. package/dist/chunks/refresh-vaY-Sr80.js +0 -1
  383. package/dist/chunks/registerProtocol-Xsq4ldwg.js +0 -1
  384. package/dist/chunks/rename-DmauGVBX.js +0 -1
  385. package/dist/chunks/resume-ut_pBrLN.js +0 -2
  386. package/dist/chunks/ripgrep-CBUbn6Po.js +0 -1
  387. package/dist/chunks/sandbox-adapter-CL0qdcxn.js +0 -1
  388. package/dist/chunks/sandbox-toggle-BJKd1ZYk.js +0 -1
  389. package/dist/chunks/searchExtraTools-ByWuNCGo.js +0 -1
  390. package/dist/chunks/session-DTin6hOR.js +0 -2
  391. package/dist/chunks/sessionFileAccessHooks-DorzHolr.js +0 -1
  392. package/dist/chunks/sessionObserver-Dy6NFlzL.js +0 -1
  393. package/dist/chunks/sessionStorage-DItJMkwx.js +0 -1
  394. package/dist/chunks/sessionTracing-Dvi520eN.js +0 -11
  395. package/dist/chunks/settings-Crx1cI1u.js +0 -1
  396. package/dist/chunks/settingsSync-aHn3p-6J.js +0 -1
  397. package/dist/chunks/setup-CK3ybjjM.js +0 -3
  398. package/dist/chunks/sinks-QQ_6Op7q.js +0 -1
  399. package/dist/chunks/skillChangeDetector-Bco3UoeW.js +0 -1
  400. package/dist/chunks/skills-axToWEo0.js +0 -1
  401. package/dist/chunks/src-D3yIF9I42.js +0 -1
  402. package/dist/chunks/src-DPUAq5Ty.js +0 -1
  403. package/dist/chunks/src-DQOX_xI1.js +0 -1
  404. package/dist/chunks/src-Dt5IJd3C.js +0 -1
  405. package/dist/chunks/src-Dvp6-vB7.js +0 -19
  406. package/dist/chunks/src-PM8NIIu_.js +0 -1
  407. package/dist/chunks/startupProfiler-uHetQush.js +0 -1
  408. package/dist/chunks/staticRender-D9AbnQFr.js +0 -1
  409. package/dist/chunks/stats-Ce15gc3E.js +0 -1
  410. package/dist/chunks/status-3uevwSMo.js +0 -1
  411. package/dist/chunks/status-CGp4uRlH.js +0 -2
  412. package/dist/chunks/switcher-DJDxjLPQ.js +0 -1
  413. package/dist/chunks/teleport-CvX_nUjQ.js +0 -1
  414. package/dist/chunks/theme-DzaSXOpQ.js +0 -1
  415. package/dist/chunks/toolPool-CgKK0K8f.js +0 -1
  416. package/dist/chunks/trustedDevice-C2gnF9Lc.js +0 -1
  417. package/dist/chunks/useExitOnCtrlCDWithKeybindings-D0uqGxGw.js +0 -1
  418. package/dist/chunks/useMainLoopModel-BGPOmBkl.js +0 -1
  419. package/dist/chunks/useManagePlugins-ITVFO9dz.js +0 -1
  420. package/dist/chunks/useMergedTools-rQ19rFvH.js +0 -1
  421. package/dist/chunks/useSearchInput-CXTa-leH.js +0 -1
  422. package/dist/chunks/useSettingsErrors-Xc6RYjYF.js +0 -1
  423. package/dist/chunks/util-CD3ar4of.js +0 -1
  424. package/dist/chunks/validatePlugin-CxrlCKc1.js +0 -1
  425. package/dist/chunks/which-BxQ1hpjp.js +0 -1
  426. package/dist/chunks/worktree-CanG5GhE.js +0 -1
  427. /package/dist/chunks/{src-DL3w8VPk2.js → src-DL3w8VPk.js} +0 -0
  428. /package/dist/chunks/{src-DLz3FZm1.js → urlHandler-DLz3FZm1.js} +0 -0
@@ -1 +0,0 @@
1
- import{t as e}from"./REPL-Cg8UXYpX.js";export{e as REPL};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$h as t,Ig as n,Ir as r,Lg as i,Mu as a,Ny as o,Pu as s,Py as ee,Rn as c,Sr as te,Tu as ne,Wr as re,Xh as l,Yn as u,Zh as d,bc as f,br as p,gC as m,hc as h,jr as ie,ni as ae,ti as oe,uC as g,wu as _}from"./loadAgentsDir-DXOkUcW3.js";import{I as v,P as y,Wt as b,ai as x,dr as S,ot as C,t as w}from"./src-DL3w8VPk2.js";import{t as T}from"./jsx-runtime-Bb4Xn-E0.js";import{Ut as E,ar as se}from"./state-D5D6QpTX.js";import{o as D,s as O}from"./log-CZ7ploQm.js";import{n as k,r as A}from"./analytics-DJobLaWP.js";import{a as ce,n as le,s as ue}from"./skillChangeDetector-Bco3UoeW.js";import{t as de}from"./REPL-Cg8UXYpX.js";import{a as fe,i as j,n as M,o as N,r as P,t as F}from"./crossProjectResume-DNnZo3gU.js";import{dirname as I}from"path";var L=e(x(),1);m(),E(),N(),s(),o(),w(),g(),k(),l(),i(),j(),h(),_(),M(),D(),p();var R=T();function z(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 B({commands:e,worktreePaths:i,initialTools:o,mcpClients:s,dynamicMcpConfig:l,debug:p,mainThreadAgentDefinition:m,autoConnectIdeFlag:h,strictMcpConfig:g=!1,systemPrompt:_,appendSystemPrompt:b,initialSearchQuery:x,disableSlashCommands:w=!1,forkSession:T,taskListId:E,filterByPr:D,thinkingConfig:k,onTurnComplete:j}){let{rows:M}=C(),N=d(e=>e.agentDefinitions),B=t(),[H,U]=L.useState([]),[me,W]=L.useState(!0),[he,ge]=L.useState(!1),[G,_e]=L.useState(!1),[K,ve]=L.useState(null),[q,J]=L.useState(null),Y=L.useRef(null),X=L.useRef(0),Z=L.useMemo(()=>{let e=H.filter(e=>!e.isSidechain);if(D!==void 0){if(D===!0)e=e.filter(e=>e.prNumber!==void 0);else if(typeof D==`number`)e=e.filter(e=>e.prNumber===D);else if(typeof D==`string`){let t=z(D);t!==null&&(e=e.filter(e=>e.prNumber===t))}}return e},[H,D]),ye=te();L.useEffect(()=>{r(i).then(e=>{Y.current=e,X.current=e.logs.length,U(e.logs),W(!1)}).catch(e=>{O(e),W(!1)})},[i]);let Q=L.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||u(t.allStatLogs,t.nextIndex,e).then(n=>{if(t.nextIndex=n.nextIndex,n.logs.length>0){let e=X.current;n.logs.forEach((t,n)=>{t.value=e+n}),U(e=>e.concat(n.logs)),X.current+=n.logs.length}else t.nextIndex<t.allStatLogs.length&&Q(e)})},[]),$=L.useCallback(e=>{W(!0),(e?ie():r(i)).then(e=>{Y.current=e,X.current=e.logs.length,U(e.logs)}).catch(e=>{O(e)}).finally(()=>{W(!1)})},[i]),be=L.useCallback(()=>{let e=!G;_e(e),$(e)},[G,$]);function xe(){process.exit(1)}async function Se(e){ge(!0);let t=performance.now(),r=F(e,G);if(r.isCrossProject&&!r.isSameRepoWorktree){let e=r.command,t=await S(e);t&&process.stdout.write(t),J(e);return}try{let r=await ne(e,void 0);if(!r)throw Error(`Failed to load conversation`);r.sessionId&&!T?(se(n(r.sessionId),e.fullPath?I(e.fullPath):null),await oe(),ee(r.sessionId)):T&&r.contentReplacements?.length&&await re(r.contentReplacements);let{agentDefinition:i}=ce(r.agentSetting,m,N);B(e=>({...e,agent:i?.agentType}));let a=le(r.agentName,r.agentColor);a&&B(e=>({...e,standaloneAgentContext:a})),f(r.agentName),ae(T?{...r,worktreeSession:void 0}:r),T||(ue(r.worktreeSession),r.sessionId&&c()),A(`tengu_session_resumed`,{entrypoint:`picker`,success:!0,resume_duration_ms:Math.round(performance.now()-t)}),U([]),ve({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 A(`tengu_session_resumed`,{entrypoint:`picker`,success:!1}),O(e),e}}return q?(0,R.jsx)(pe,{command:q}):K?(0,R.jsx)(de,{debug:p,commands:e,initialTools:o,initialMessages:K.messages,initialFileHistorySnapshots:K.fileHistorySnapshots,initialContentReplacements:K.contentReplacements,initialAgentName:K.agentName,initialAgentColor:K.agentColor,mcpClients:s,dynamicMcpConfig:l,strictMcpConfig:g,systemPrompt:_,appendSystemPrompt:b,mainThreadAgentDefinition:K.mainThreadAgentDefinition,autoConnectIdeFlag:h,disableSlashCommands:w,taskListId:E,thinkingConfig:k,onTurnComplete:j}):me?(0,R.jsxs)(v,{children:[(0,R.jsx)(a,{}),(0,R.jsx)(y,{children:` Loading conversations…`})]}):he?(0,R.jsxs)(v,{children:[(0,R.jsx)(a,{}),(0,R.jsx)(y,{children:` Resuming conversation…`})]}):Z.length===0?(0,R.jsx)(V,{}):(0,R.jsx)(fe,{logs:Z,maxHeight:M,onCancel:xe,onSelect:Se,onLogsChanged:ye?()=>$(G):void 0,onLoadMore:Q,initialSearchQuery:x,showAllProjects:G,onToggleAllProjects:be,onAgenticSearch:P})}function V(){return b(`app:interrupt`,()=>{process.exit(1)},{context:`Global`}),(0,R.jsxs)(v,{flexDirection:`column`,children:[(0,R.jsx)(y,{children:`No conversations found to resume.`}),(0,R.jsx)(y,{dimColor:!0,children:`Press Ctrl+C to exit and start a new conversation.`})]})}function pe({command:e}){return L.useEffect(()=>{let e=setTimeout(()=>{process.exit(0)},100);return()=>clearTimeout(e)},[]),(0,R.jsxs)(v,{flexDirection:`column`,gap:1,children:[(0,R.jsx)(y,{children:`This conversation is from a different directory.`}),(0,R.jsxs)(v,{flexDirection:`column`,children:[(0,R.jsx)(y,{children:`To resume, run:`}),(0,R.jsxs)(y,{children:[` `,e]})]}),(0,R.jsx)(y,{dimColor:!0,children:`(Command copied to clipboard)`})]})}export{B as ResumeConversation};
@@ -1 +0,0 @@
1
- import{E_ as e,T_ as t}from"./loadAgentsDir-DXOkUcW3.js";e();export{t as clearSearchExtraToolsDescriptionCache};
@@ -1,2 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{d as n,l as r,o as i}from"./envUtils-DcaKZlRU.js";import{n as a,t as o}from"./figures-5ThXQEtq.js";import{$h as ee,$u as te,Dp as s,Gy as ne,Hy as re,Ky as c,Op as ie,Qh as ae,Qu as oe,Uh as se,Wh as ce,Wy as le,Xh as l,Zh as u,Zu as d,b as f,br as p,cd as m,eo as h,gC as g,j as ue,ld as de,no as _,ob as fe,rr as pe,sb as me,to as v,uC as he,ub as ge}from"./loadAgentsDir-DXOkUcW3.js";import{D as y,Gt as _e,H as ve,I as b,P as x,T as S,U as ye,Wt as be,Xn as xe,a as Se,ai as C,di as w,fi as T,k as Ce,n as we,ot as Te,r as E,t as D,x as O,y as Ee}from"./src-DL3w8VPk2.js";import{t as k}from"./jsx-runtime-Bb4Xn-E0.js";import{Ut as De,ft as Oe}from"./state-D5D6QpTX.js";import{n as ke,t as A}from"./cwd-Nh5IZNKO.js";import{Ft as Ae,Nt as je,Pt as Me,Rt as Ne,b as j,h as M,jt as Pe,s as Fe,t as Ie,zt as Le}from"./settings-3xZ0fsvE.js";import{a as Re,c as N,h as ze,i as Be,o as Ve,y as P}from"./config-DRy1I12M.js";import{o as He,s as Ue}from"./log-CZ7ploQm.js";import{n as We,r as F}from"./analytics-DJobLaWP.js";import{B as Ge,J as I,Q as Ke,V as qe,Y as Je,Z as Ye,_ as Xe,b as Ze,hr as Qe,mr as L,x as $e,z as et}from"./model-Cxx3suBa.js";import{a as tt,c as nt,d as rt,i as it,l as at,n as ot,o as R,r as st,s as ct,t as z,u as B}from"./status-CGp4uRlH.js";import{n as V,t as lt}from"./useExitOnCtrlCDWithKeybindings-D0uqGxGw.js";import{i as ut,n as dt,r as ft}from"./modalContext-wY9CeN4G.js";import{n as pt,t as mt}from"./ThemePicker-B3AO3_jA.js";import{i as ht,n as gt,r as _t,t as vt}from"./extraUsage-DylXI7Fc.js";import{n as yt,t as bt}from"./AgentsMdExternalIncludesDialog-DLnj3JQO.js";import{t as H}from"./SearchBox-CwwV0W-w.js";import{n as xt,t as St}from"./useSearchInput-CXTa-leH.js";function Ct(){let e=Oe();return[{label:`Version`,value:`0.0.19`},{label:`Session name`,value:pe(e)??(0,K.jsx)(x,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:A()},...ot(),...z()]}function wt({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:B(e)},...st(t.clients,r.options.ideInstallationStatus,n),...R(t.clients,n),...nt(),...at()]}async function U(){return[...await it(),...await tt(),...await ct()]}function Tt({value:e}){return Array.isArray(e)?(0,K.jsx)(b,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,K.jsxs)(x,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,K.jsx)(x,{children:e}):e}function Et({context:e,diagnosticsPromise:t}){let n=u(e=>e.mainLoopModel),r=u(e=>e.mcp),[i]=ve(),a=W.useMemo(()=>[Ct(),wt({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=ft()?1:void 0;return(0,K.jsxs)(b,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(b,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(b,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(b,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(x,{bold:!0,children:[e,`:`]}),(0,K.jsx)(Tt,{value:t})]},n))},t)),(0,K.jsx)(G.Suspense,{fallback:null,children:(0,K.jsx)(Dt,{promise:t})})]}),(0,K.jsx)(x,{dimColor:!0,children:(0,K.jsx)(s,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Dt({promise:e}){let t=(0,G.use)(e);return t.length===0?null:(0,K.jsxs)(b,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(x,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(b,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,K.jsx)(x,{color:`error`,children:o.warning}),typeof e==`string`?(0,K.jsx)(x,{wrap:`wrap`,children:e}):e]},t))]})}var W,G,K,Ot=e((()=>{a(),W=t(C(),1),G=t(C(),1),De(),dt(),D(),l(),ke(),p(),rt(),ie(),K=k()}));function kt({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,At.jsxs)(Ee,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,At.jsxs)(x,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,At.jsx)(x,{dimColor:!0,children:`How would you like to handle this?`}),(0,At.jsx)(oe,{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 At,jt=e((()=>{D(),d(),At=k()}));function Mt(e){return Object.entries(e).map(([e,t])=>({label:t?.name??Ft,value:e,description:t?.description??It}))}function Nt({initialStyle:e,onComplete:t,onCancel:n,isStandaloneCommand:r}){let[i,a]=(0,Pt.useState)([]),[o,ee]=(0,Pt.useState)(!0);(0,Pt.useEffect)(()=>{v(A()).then(e=>{let t=Mt(e);a(t),ee(!1)}).catch(()=>{let e=Mt(h);a(e),ee(!1)})},[]);let te=(0,Pt.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(Ee,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(b,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(b,{marginTop:1,children:(0,q.jsx)(x,{dimColor:!0,children:`This changes how Work Mate communicates with you`})}),o?(0,q.jsx)(x,{dimColor:!0,children:`Loading output styles…`}):(0,q.jsx)(oe,{options:i,onChange:te,visibleOptionCount:10,defaultValue:e})]})})}var Pt,q,Ft,It,Lt=e((()=>{Pt=t(C(),1),_(),D(),ke(),te(),q=k(),Ft=`Default`,It=`Work Mate completes coding tasks efficiently and provides concise responses`}));function Rt({initialLanguage:e,onComplete:t,onCancel:n}){let[r,i]=(0,zt.useState)(e),[a,ee]=(0,zt.useState)((e??``).length);be(`confirm:no`,n,{context:`Settings`});function te(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(b,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(x,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(b,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(x,{children:o.pointer}),(0,J.jsx)(m,{value:r??``,onChange:i,onSubmit:te,focus:!0,showCursor:!0,placeholder:`e.g., Japanese, 日本語, Español${o.ellipsis}`,columns:60,cursorOffset:a,onChangeCursorOffset:ee})]}),(0,J.jsx)(x,{dimColor:!0,children:`Leave empty for default (English)`})]})}var zt,J,Bt=e((()=>{a(),zt=t(C(),1),D(),he(),de(),J=k()}));function Vt({onClose:e,context:t,setTabsHidden:i,onIsSearchModeChange:a,contentHeight:te}){let{headerFocused:c,focusHeader:ie}=Se(),se=ft(),[,l]=ve(),d=ye(),[f,p]=(0,X.useState)(N()),m=Y.useRef(N()),[h,g]=(0,X.useState)(Ie()),de=Y.useRef(Ie()),[_,pe]=(0,X.useState)(h?.outputStyle||`default`),me=Y.useRef(_),[v,he]=(0,X.useState)(h?.language),C=Y.useRef(v),[T,we]=(0,X.useState)(0),[E,D]=(0,X.useState)(0),[O,k]=(0,X.useState)(!1),De=xe(),{rows:Oe}=Te(),ke=te??Math.min(Math.floor(Oe*.8),30),A=Math.max(5,ke-10),M=u(e=>e.mainLoopModel),Pe=u(e=>e.verbose),ze=u(e=>e.thinkingEnabled),He=u(e=>Ye()?e.fastMode:!1);u(e=>e.promptSuggestionEnabled);let We=Me(h?.permissions?.defaultMode??`default`),I=ee(),[Xe,L]=(0,X.useState)({}),tt=Y.useRef(ze),[nt]=(0,X.useState)(()=>Fe(`localSettings`)),[rt]=(0,X.useState)(()=>Fe(`userSettings`)),it=Y.useRef(d),at=ae(),[ot]=(0,X.useState)(()=>{let e=at.getState();return{mainLoopModel:e.mainLoopModel,mainLoopModelForSession:e.mainLoopModelForSession,verbose:e.verbose,thinkingEnabled:e.thinkingEnabled,fastMode:e.fastMode,promptSuggestionEnabled:e.promptSuggestionEnabled,replBridgeEnabled:e.replBridgeEnabled,replBridgeOutboundOnly:e.replBridgeOutboundOnly,settings:e.settings}}),R=Y.useRef(!1),[st,ct]=(0,X.useState)(!1),[z,B]=(0,X.useState)(null),{query:V,setQuery:lt,cursorOffset:ut}=xt({isActive:O&&z===null&&!c,onExit:()=>k(!1),onExitUp:ie,passthroughCtrlKeys:[`c`,`d`]}),dt=O&&!c;Y.useEffect(()=>{a?.(dt)},[dt,a]);let pt=fe(t.options.mcpClients),ht=!r(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),vt=Y.use(le(!0)),yt=ne(vt),H=Re();function St(e){F(`tengu_config_model_changed`,{from_model:M,to_model:e}),I(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),L(t=>{let n=$e(e)+(gt(e,!1,Ze())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function Ct(e){P(t=>({...t,verbose:e})),p({...N(),verbose:e}),I(t=>({...t,verbose:e})),L(t=>{if(`verbose`in t){let{verbose:e,...n}=t;return n}return{...t,verbose:e}})}let wt=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:f.autoCompactEnabled,type:`boolean`,onChange(e){P(t=>({...t,autoCompactEnabled:e})),p({...N(),autoCompactEnabled:e}),F(`tengu_auto_compact_setting_changed`,{enabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:h?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){j(`localSettings`,{spinnerTipsEnabled:e}),g(t=>({...t,spinnerTipsEnabled:e})),F(`tengu_tips_setting_changed`,{enabled:e})}},{id:`cacheWarningEnabled`,label:`Cache warnings`,value:h?.cacheWarningEnabled??!0,type:`boolean`,onChange(e){j(`localSettings`,{cacheWarningEnabled:e}),g(t=>({...t,cacheWarningEnabled:e})),F(`tengu_cache_warning_setting_changed`,{enabled:e})}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:h?.prefersReducedMotion??!1,type:`boolean`,onChange(e){j(`localSettings`,{prefersReducedMotion:e}),g(t=>({...t,prefersReducedMotion:e})),I(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}})),F(`tengu_reduce_motion_setting_changed`,{enabled:e})}},{id:`thinkingEnabled`,label:`Thinking mode`,value:ze??!0,type:`boolean`,onChange(e){I(t=>({...t,thinkingEnabled:e})),j(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1}),F(`tengu_thinking_toggled`,{enabled:e})}},...Ye()&&Je()?[{id:`fastMode`,label:`Fast mode (${et} only)`,value:!!He,type:`boolean`,onChange(e){Ge(),j(`userSettings`,{fastMode:e?!0:void 0}),e?(I(e=>({...e,mainLoopModel:qe(),mainLoopModelForSession:null,fastMode:!0})),L(e=>({...e,model:qe(),"Fast mode":`ON`}))):(I(e=>({...e,fastMode:!1})),L(e=>({...e,"Fast mode":`OFF`})))}}]:[],...ht?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:f.fileCheckpointingEnabled,type:`boolean`,onChange(e){P(t=>({...t,fileCheckpointingEnabled:e})),p({...N(),fileCheckpointingEnabled:e}),F(`tengu_file_history_snapshots_setting_changed`,{enabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Pe,type:`boolean`,onChange:Ct},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:f.terminalProgressBarEnabled,type:`boolean`,onChange(e){P(t=>({...t,terminalProgressBarEnabled:e})),p({...N(),terminalProgressBarEnabled:e}),F(`tengu_terminal_progress_bar_setting_changed`,{enabled:e})}},{id:`showTurnDuration`,label:`Show turn duration`,value:f.showTurnDuration,type:`boolean`,onChange(e){P(t=>({...t,showTurnDuration:e})),p({...N(),showTurnDuration:e}),F(`tengu_show_turn_duration_setting_changed`,{enabled:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:We,options:(()=>{let e=[`default`,`plan`];return[...e,...Le.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=Me(e),n=t===`auto`?t:je(t)?Ne(t):t,r=j(`userSettings`,{permissions:{...h?.permissions,defaultMode:n}});if(r.error){Ue(r.error);return}g(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),L(t=>({...t,defaultPermissionMode:e})),F(`tengu_config_changed`,{setting:`defaultPermissionMode`,value:e})}},{id:`respectGitignore`,label:`Respect .gitignore in file picker`,value:f.respectGitignore,type:`boolean`,onChange(e){P(t=>({...t,respectGitignore:e})),p({...N(),respectGitignore:e}),F(`tengu_respect_gitignore_setting_changed`,{enabled:e})}},...ce()?[{id:`copyOnSelect`,label:`Copy on select`,value:f.copyOnSelect??!0,type:`boolean`,onChange(e){P(t=>({...t,copyOnSelect:e})),p({...N(),copyOnSelect:e}),F(`tengu_config_changed`,{setting:`copyOnSelect`,value:String(e)})}}]:[],H?{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:`disabled`,type:`managedEnum`,onChange(){}}:{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:h?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:d,type:`managedEnum`,onChange:l},{id:`notifChannel`,label:`Notifications`,value:f.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){P(t=>({...t,preferredNotifChannel:e})),p({...N(),preferredNotifChannel:e})}},{id:`outputStyle`,label:`Output style`,value:_,type:`managedEnum`,onChange:()=>{}},{id:`language`,label:`Language`,value:v??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:f.editorMode===`emacs`?`normal`:f.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){P(t=>({...t,editorMode:e})),p({...N(),editorMode:e}),F(`tengu_editor_mode_changed`,{mode:e,source:`config_panel`})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:f.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){P(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),p({...N(),prStatusFooterEnabled:e}),F(`tengu_pr_status_footer_setting_changed`,{enabled:e})}},{id:`model`,label:`Model`,value:M===null?`Default (recommended)`:M,type:`managedEnum`,onChange:St},...pt?[{id:`diffTool`,label:`Diff tool`,value:f.diffTool??`auto`,options:[`terminal`,`auto`],type:`enum`,onChange(e){P(t=>({...t,diffTool:e})),p({...N(),diffTool:e}),F(`tengu_diff_tool_changed`,{tool:e,source:`config_panel`})}}]:[],...ge()?[]:[{id:`autoConnectIde`,label:`Auto-connect to IDE (external terminal)`,value:f.autoConnectIde??!1,type:`boolean`,onChange(e){P(t=>({...t,autoConnectIde:e})),p({...N(),autoConnectIde:e}),F(`tengu_auto_connect_ide_changed`,{enabled:e,source:`config_panel`})}}],...ge()?[{id:`autoInstallIdeExtension`,label:`Auto-install IDE extension`,value:f.autoInstallIdeExtension??!0,type:`boolean`,onChange(e){P(t=>({...t,autoInstallIdeExtension:e})),p({...N(),autoInstallIdeExtension:e}),F(`tengu_auto_install_ide_extension_changed`,{enabled:e,source:`config_panel`})}}]:[],...yt?[{id:`showExternalIncludesDialog`,label:`External AGENTS.md includes`,value:Ve().hasAgentsMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[],...process.env.ANTHROPIC_API_KEY&&!n()?[{id:`apiKey`,label:(0,Z.jsxs)(x,{children:[`Use custom API key: `,(0,Z.jsx)(x,{bold:!0,children:Qe(process.env.ANTHROPIC_API_KEY)})]}),searchText:`Use custom API key`,value:!!(process.env.ANTHROPIC_API_KEY&&f.customApiKeyResponses?.approved?.includes(Qe(process.env.ANTHROPIC_API_KEY))),type:`boolean`,onChange(e){P(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=Qe(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}),p(N())}}]:[]],U=Y.useMemo(()=>{if(!V)return wt;let e=V.toLowerCase();return wt.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[wt,V]);Y.useEffect(()=>{if(T>=U.length){let e=Math.max(0,U.length-1);we(e),D(Math.max(0,e-A+1));return}D(e=>T<e?T:T>=e+A?T-A+1:e)},[U.length,T,A]);let Tt=(0,X.useCallback)(e=>{D(t=>e<t?e:e>=t+A?e-A+1:t)},[A]),Et=(0,X.useCallback)(()=>{if(z!==null)return;let t=Object.entries(Xe).map(([e,t])=>(F(`tengu_config_changed`,{key:e,value:t}),`Set ${e} to ${w.bold(t)}`)),r=n()?void 0:process.env.ANTHROPIC_API_KEY,i=!!(r&&m.current.customApiKeyResponses?.approved?.includes(Qe(r))),a=!!(r&&f.customApiKeyResponses?.approved?.includes(Qe(r)));if(i!==a&&(t.push(`${a?`Enabled`:`Disabled`} custom API key`),F(`tengu_config_changed`,{key:`env.ANTHROPIC_API_KEY`,value:a})),f.theme!==m.current.theme&&t.push(`Set theme to ${w.bold(f.theme)}`),f.preferredNotifChannel!==m.current.preferredNotifChannel&&t.push(`Set notifications to ${w.bold(f.preferredNotifChannel)}`),_!==me.current&&t.push(`Set output style to ${w.bold(_)}`),v!==C.current&&t.push(`Set response language to ${w.bold(v??`Default (English)`)}`),f.editorMode!==m.current.editorMode&&t.push(`Set editor mode to ${w.bold(f.editorMode||`emacs`)}`),f.diffTool!==m.current.diffTool&&t.push(`Set diff tool to ${w.bold(f.diffTool)}`),f.autoConnectIde!==m.current.autoConnectIde&&t.push(`${f.autoConnectIde?`Enabled`:`Disabled`} auto-connect to IDE`),f.autoInstallIdeExtension!==m.current.autoInstallIdeExtension&&t.push(`${f.autoInstallIdeExtension?`Enabled`:`Disabled`} auto-install IDE extension`),f.autoCompactEnabled!==m.current.autoCompactEnabled&&t.push(`${f.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),f.respectGitignore!==m.current.respectGitignore&&t.push(`${f.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),f.copyOnSelect!==m.current.copyOnSelect&&t.push(`${f.copyOnSelect?`Enabled`:`Disabled`} copy on select`),f.terminalProgressBarEnabled!==m.current.terminalProgressBarEnabled&&t.push(`${f.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),f.showStatusInTerminalTab!==m.current.showStatusInTerminalTab&&t.push(`${f.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),f.showTurnDuration!==m.current.showTurnDuration&&t.push(`${f.showTurnDuration?`Enabled`:`Disabled`} turn duration`),f.remoteControlAtStartup!==m.current.remoteControlAtStartup){let e=f.remoteControlAtStartup===void 0?`Reset Remote Control to default`:`${f.remoteControlAtStartup?`Enabled`:`Disabled`} Remote Control for all sessions`;t.push(e)}h?.autoUpdatesChannel!==de.current?.autoUpdatesChannel&&t.push(`Set auto-update channel to ${w.bold(h?.autoUpdatesChannel??`latest`)}`),t.length>0?e(t.join(`
2
- `)):e(`Config dialog dismissed`,{display:`system`})},[z,Xe,f,M,_,v,h?.autoUpdatesChannel,Ye()?h?.fastMode:void 0,e]),Dt=(0,X.useCallback)(()=>{d!==it.current&&l(it.current),P(()=>m.current);let e=nt;j(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=rt;j(`userSettings`,{alwaysThinkingEnabled:t?.alwaysThinkingEnabled,fastMode:t?.fastMode,promptSuggestionEnabled:t?.promptSuggestionEnabled,autoUpdatesChannel:t?.autoUpdatesChannel,minimumVersion:t?.minimumVersion,language:t?.language,syntaxHighlightingDisabled:t?.syntaxHighlightingDisabled,permissions:t?.permissions===void 0?void 0:{...t.permissions,defaultMode:t.permissions.defaultMode}});let n=ot;I(e=>({...e,mainLoopModel:n.mainLoopModel,mainLoopModelForSession:n.mainLoopModelForSession,verbose:n.verbose,thinkingEnabled:n.thinkingEnabled,fastMode:n.fastMode,promptSuggestionEnabled:n.promptSuggestionEnabled,replBridgeEnabled:n.replBridgeEnabled,replBridgeOutboundOnly:n.replBridgeOutboundOnly,settings:n.settings,toolPermissionContext:ue(e.toolPermissionContext)}))},[d,l,nt,rt,ot,I]);be(`confirm:no`,(0,X.useCallback)(()=>{z===null&&(R.current&&Dt(),e(`Config dialog dismissed`,{display:`system`}))},[z,Dt,e]),{context:`Settings`,isActive:z===null&&!O&&!c}),be(`settings:close`,Et,{context:`Settings`,isActive:z===null&&!O&&!c});let W=(0,X.useCallback)(()=>{let e=U[T];if(e?.onChange){if(e.type===`boolean`){R.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===tt.current?ct(!1):t.messages.some(e=>e.type===`assistant`)&&ct(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:B(`Theme`),i(!0);return;case`model`:B(`Model`),i(!0);return;case`showExternalIncludesDialog`:B(`ExternalIncludes`),i(!0);return;case`outputStyle`:B(`OutputStyle`),i(!0);return;case`language`:B(`Language`),i(!0);return}if(e.id===`autoUpdatesChannel`){if(H){B(`EnableAutoUpdates`),i(!0);return}(h?.autoUpdatesChannel??`latest`)===`latest`?(B(`ChannelDowngrade`),i(!0)):(R.current=!0,j(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),g(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})),F(`tengu_autoupdate_channel_changed`,{channel:`latest`}));return}if(e.type===`enum`){R.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[H,U,T,h?.autoUpdatesChannel,i]),G=e=>{ct(!1);let t=Math.max(0,Math.min(U.length-1,T+e));we(t),Tt(t)};return _e({"select:previous":()=>{T===0?(ct(!1),k(!0),D(0)):G(-1)},"select:next":()=>G(1),"scroll:lineUp":()=>G(-1),"scroll:lineDown":()=>G(1),"select:accept":W,"select:previousValue":()=>W(),"select:nextValue":()=>W(),"settings:search":()=>{k(!0),lt(``)}},{context:`Settings`,isActive:z===null&&!O&&!c}),(0,Z.jsx)(b,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(z===null&&!c){if(O){if(e.key===`escape`){e.preventDefault(),V.length>0?lt(``):k(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),k(!1),we(0),D(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),W();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),k(!0),lt(e.key))}},[z,c,O,V,lt,W]),children:z===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(mt,{onThemeSelect:e=>{R.current=!0,l(e),B(null),i(!1)},onCancel:()=>{B(null),i(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(b,{children:(0,Z.jsx)(x,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(y,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(s,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):z===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_t,{initial:M,onSelect:e=>{R.current=!0,St(e),B(null),i(!1)},onCancel:()=>{B(null),i(!1)},showFastModeNotice:Ye()?He&&Ke(M)&&Je():!1}),(0,Z.jsx)(x,{dimColor:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(y,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(s,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):z===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(bt,{onDone:()=>{B(null),i(!1)},externalIncludes:re(vt)}),(0,Z.jsx)(x,{dimColor:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(y,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(s,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):z===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Nt,{initialStyle:_,onComplete:e=>{R.current=!0,pe(e??`default`),B(null),i(!1),j(`localSettings`,{outputStyle:e}),F(`tengu_output_style_changed`,{style:e??`default`,source:`config_panel`,settings_source:`localSettings`})},onCancel:()=>{B(null),i(!1)}}),(0,Z.jsx)(x,{dimColor:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(y,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(s,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):z===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Rt,{initialLanguage:v,onComplete:e=>{R.current=!0,he(e),B(null),i(!1),j(`userSettings`,{language:e}),F(`tengu_language_changed`,{language:e??`default`,source:`config_panel`})},onCancel:()=>{B(null),i(!1)}}),(0,Z.jsx)(x,{dimColor:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(y,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(s,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):z===`EnableAutoUpdates`?(0,Z.jsx)(Ee,{title:`Enable Auto-Updates`,onCancel:()=>{B(null),i(!1)},hideBorder:!0,hideInputGuide:!0,children:H?.type===`config`?(0,Z.jsx)(oe,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{R.current=!0,B(null),i(!1),P(e=>({...e,autoUpdates:!0})),p({...N(),autoUpdates:!0}),j(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),g(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0})),F(`tengu_autoupdate_enabled`,{channel:e})}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(x,{children:H?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),H?.type===`env`&&(0,Z.jsxs)(x,{dimColor:!0,children:[`Unset `,H.envVar,` to re-enable auto-updates.`]})]})}):z===`ChannelDowngrade`?(0,Z.jsx)(kt,{currentVersion:`0.0.19`,onChoice:e=>{if(B(null),i(!1),e===`cancel`)return;R.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.19`),j(`userSettings`,t),g(e=>({...e,...t})),F(`tengu_autoupdate_channel_changed`,{channel:`stable`,minimum_version_set:e===`stay`})}}):(0,Z.jsxs)(b,{flexDirection:`column`,gap:1,marginY:se?void 0:1,children:[(0,Z.jsx)(Ce,{query:V,isFocused:O&&!c,isTerminalFocused:De,cursorOffset:ut,placeholder:`Search settings…`}),(0,Z.jsx)(b,{flexDirection:`column`,children:U.length===0?(0,Z.jsxs)(x,{dimColor:!0,italic:!0,children:[`No settings match "`,V,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[E>0&&(0,Z.jsxs)(x,{dimColor:!0,children:[o.arrowUp,` `,E,` more above`]}),U.slice(E,E+A).map((e,t)=>{let n=E+t===T&&!c&&!O;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(b,{width:`100%`,children:[(0,Z.jsx)(b,{width:44,children:(0,Z.jsxs)(x,{color:n?`suggestion`:void 0,children:[n?o.pointer:` `,` `,e.label]})}),(0,Z.jsx)(b,{flexGrow:1,children:e.type===`boolean`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(x,{color:n?`suggestion`:void 0,children:e.value.toString()}),st&&e.id===`thinkingEnabled`&&(0,Z.jsxs)(x,{color:`warning`,children:[` `,`Changing thinking mode mid-conversation will increase latency and may reduce quality.`]})]}):e.id===`theme`?(0,Z.jsx)(x,{color:n?`suggestion`:void 0,children:Ut[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(x,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(Ht,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(x,{color:n?`suggestion`:void 0,children:Ae(e.value)}):e.id===`autoUpdatesChannel`&&H?(0,Z.jsxs)(b,{flexDirection:`column`,children:[(0,Z.jsx)(x,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(x,{dimColor:!0,children:[`(`,Be(H),`)`]})]}):(0,Z.jsx)(x,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),E+A<U.length&&(0,Z.jsxs)(x,{dimColor:!0,children:[o.arrowDown,` `,U.length-E-A,` more below`]})]})}),c?(0,Z.jsx)(x,{dimColor:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(y,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(y,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(s,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):O?(0,Z.jsx)(x,{dimColor:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(x,{children:`Type to filter`}),(0,Z.jsx)(y,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(y,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(s,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(x,{dimColor:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(s,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(s,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(s,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(s,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]})})}function Ht({value:e}){switch(e){case`auto`:return`Auto`;case`iterm2`:return(0,Z.jsxs)(x,{children:[`iTerm2 `,(0,Z.jsx)(x,{dimColor:!0,children:`(OSC 9)`})]});case`terminal_bell`:return(0,Z.jsxs)(x,{children:[`Terminal Bell `,(0,Z.jsx)(x,{dimColor:!0,children:`(\\a)`})]});case`kitty`:return(0,Z.jsxs)(x,{children:[`Kitty `,(0,Z.jsx)(x,{dimColor:!0,children:`(OSC 99)`})]});case`ghostty`:return(0,Z.jsxs)(x,{children:[`Ghostty `,(0,Z.jsx)(x,{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,Ut,Wt=e((()=>{D(),Y=t(C(),1),X=t(C(),1),he(),a(),ze(),L(),T(),Pe(),f(),He(),We(),pt(),l(),ht(),Xe(),vt(),yt(),jt(),d(),Lt(),Bt(),c(),ie(),dt(),H(),me(),M(),_(),i(),St(),g(),I(),se(),Z=k(),Ut={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 Gt({onClose:e,context:t,defaultTab:n}){let[r,i]=(0,Q.useState)(n),[a,o]=(0,Q.useState)(!1),[ee,te]=(0,Q.useState)(!1),s=ft(),{rows:ne}=ut(Te()),re=s?ne+1:Math.max(15,Math.min(Math.floor(ne*.8),30)),[c]=(0,Q.useState)(()=>U().catch(()=>[]));return V(),be(`confirm:no`,()=>{a||e(`Status dialog dismissed`,{display:`system`})},{context:`Settings`,isActive:!a&&!(r===`Config`&&ee)}),(0,$.jsx)(O,{color:`permission`,children:(0,$.jsx)(E,{color:`permission`,selectedTab:r,onTabChange:i,hidden:a,initialHeaderFocused:n!==`Config`,contentHeight:a||s?void 0:re,children:[(0,$.jsx)(we,{title:`Status`,children:(0,$.jsx)(Et,{context:t,diagnosticsPromise:c})},`status`),(0,$.jsx)(we,{title:`Config`,children:(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(Vt,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:te,contentHeight:re})})},`config`)]})})}var Q,$,Kt=e((()=>{Q=t(C(),1),he(),lt(),g(),dt(),D(),Ot(),Wt(),$=k()}));export{Kt as n,Gt as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{Xh as r,Yh as i,cu as a,du as o,lu as s,pu as c}from"./loadAgentsDir-DXOkUcW3.js";import{I as l,P as u,ai as d,mt as f,t as p}from"./src-DL3w8VPk2.js";import{t as m}from"./jsx-runtime-Bb4Xn-E0.js";t();var h=e(d(),1);p(),r(),s();var g=m(),_=[`◐`,`◓`,`◑`,`◒`],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[r,i]=f(100),a=Math.floor(i/100)%_.length,o=v.findIndex(t=>t.key===e);return(0,g.jsxs)(l,{ref:r,flexDirection:`column`,paddingX:1,paddingY:1,children:[(0,g.jsx)(l,{marginBottom:1,children:(0,g.jsxs)(u,{bold:!0,color:`claude`,children:[_[a],` Teleporting session…`]})}),t&&(0,g.jsx)(l,{marginBottom:1,children:(0,g.jsx)(u,{dimColor:!0,children:t})}),(0,g.jsx)(l,{flexDirection:`column`,marginLeft:2,children:v.map((e,t)=>{let r=t<o,i=t===o,s=t>o,c,d;return r?(c=n.tick,d=`green`):i?(c=_[a],d=`claude`):(c=n.circle,d=void 0),(0,g.jsxs)(l,{flexDirection:`row`,children:[(0,g.jsx)(l,{width:2,children:(0,g.jsx)(u,{color:d,dimColor:s,children:c})}),(0,g.jsx)(u,{dimColor:s,bold:i,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)(i,{children:(0,g.jsx)(r,{})}));let s=await c(t,n);n(`checking_out`);let{branchName:l,branchError:u}=await a(s.branch);return{messages:o(s.log,u),branchName:l}}export{b as teleportWithProgress};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Mu as t,Pu as n,Qu as r,Zu as i}from"./loadAgentsDir-DXOkUcW3.js";import{I as a,P as o,ai as s,t as c,y as l}from"./src-DL3w8VPk2.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{Cn as d,bn as f}from"./settings-3xZ0fsvE.js";import{a as p,r as m}from"./githubRepoPathMapping-CzgPGOHQ.js";var h=e(s(),1);c(),d(),i(),n();var g=u();function _({targetRepo:e,initialPaths:n,onSelectPath:i,onCancel:s}){let[c,u]=(0,h.useState)(n),[d,_]=(0,h.useState)(null),[v,y]=(0,h.useState)(!1),b=(0,h.useCallback)(async t=>{if(t===`cancel`){s();return}if(y(!0),_(null),await p(t,e)){i(t);return}m(e,t);let n=c.filter(e=>e!==t);u(n),y(!1),_(`${f(t)} no longer contains the correct repository. Select another path.`)},[e,c,i,s]),x=[...c.map(e=>({label:(0,g.jsxs)(o,{children:[`Use `,(0,g.jsx)(o,{bold:!0,children:f(e)})]}),value:e})),{label:`Cancel`,value:`cancel`}];return(0,g.jsx)(l,{title:`Teleport to Repo`,onCancel:s,color:`background`,children:c.length>0?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(a,{flexDirection:`column`,gap:1,children:[d&&(0,g.jsx)(o,{color:`error`,children:d}),(0,g.jsxs)(o,{children:[`Open Work Mate in `,(0,g.jsx)(o,{bold:!0,children:e}),`:`]})]}),v?(0,g.jsxs)(a,{children:[(0,g.jsx)(t,{}),(0,g.jsx)(o,{children:` Validating repository…`})]}):(0,g.jsx)(r,{options:x,onChange:e=>void b(e)})]}):(0,g.jsxs)(a,{flexDirection:`column`,gap:1,children:[d&&(0,g.jsx)(o,{color:`error`,children:d}),(0,g.jsxs)(o,{dimColor:!0,children:[`Run claude --teleport from a checkout of `,e]})]})})}export{_ as TeleportRepoMismatchDialog};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Au as t,Dp as n,Mu as r,Op as i,Pu as a,Qu as o,Zu as s,dC as c,fC as l,gC as u,ju as d,lu as f,pu as p,uC as m}from"./loadAgentsDir-DXOkUcW3.js";import{D as h,I as g,P as _,T as v,Wt as y,ai as b,hn as x,ot as S,t as C}from"./src-DL3w8VPk2.js";import{t as w}from"./jsx-runtime-Bb4Xn-E0.js";import{Ut as T,tr as E}from"./state-D5D6QpTX.js";import{M as D,P as O,R as k,c as A,i as j}from"./debug-D58GQBDG.js";import{n as M,r as N}from"./analytics-DJobLaWP.js";import{p as P,v as F}from"./startupProfiler-CbzxVmbv.js";import{i as I,n as L}from"./detectRepository-CDOJ-M7h.js";import{n as R,o as z}from"./api-C5ULzZny.js";var B=e(b(),1);T(),M(),k(),f();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),N(`tengu_teleport_resume_session`,{source:e,session_id:t.id});try{let e=await p(t.id);return E({sessionId:t.id}),n(!1),e}catch(e){let t={message:e instanceof D?e.message:O(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)},[])}}u(),z(),C(),m(),c(),j(),I(),F(),i(),s(),a(),d();var H=w(),U=`Updated`,W=` `;function G({onSelect:e,onCancel:i,isEmbedded:a=!1}){let{rows:s}=S(),[c,u]=(0,B.useState)([]),[d,f]=(0,B.useState)(null),[p,m]=(0,B.useState)(!0),[b,C]=(0,B.useState)(null),[w,T]=(0,B.useState)(!1),[E,D]=(0,B.useState)(!1),[O,k]=(0,B.useState)(1),j=l(`confirm:no`,`Confirmation`,`Esc`),M=(0,B.useCallback)(async()=>{try{m(!0),C(null);let e=await L();f(e),A(`Current repository: ${e||`not detected`}`);let t=await R(),n=t;e&&(n=t.filter(t=>t.repo?`${t.repo.owner.login}/${t.repo.name}`===e:!1),A(`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()});u(r)}catch(e){let t=e instanceof Error?e.message:String(e);A(`Error loading code sessions: ${t}`),C(K(t))}finally{m(!1),T(!1)}},[]),N=()=>{T(!0),M()};y(`confirm:no`,i,{context:`Confirmation`}),x((e,t)=>{if(t.ctrl&&e===`c`){i();return}if(t.ctrl&&e===`r`&&b){N();return}if(b!==null&&t.return){i();return}});let F=(0,B.useCallback)(()=>{D(!0),M()},[D,M]);if(!E)return(0,H.jsx)(t,{onComplete:F});if(p)return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(g,{flexDirection:`row`,children:[(0,H.jsx)(r,{}),(0,H.jsx)(_,{bold:!0,children:`Loading Work Mate sessions…`})]}),(0,H.jsx)(_,{dimColor:!0,children:w?`Retrying…`:`Fetching your Work Mate sessions…`})]});if(b)return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsx)(_,{bold:!0,color:`error`,children:`Error loading Work Mate sessions`}),q(b),(0,H.jsxs)(_,{dimColor:!0,children:[`Press `,(0,H.jsx)(_,{bold:!0,children:`Ctrl+R`}),` to retry · Press `,(0,H.jsx)(_,{bold:!0,children:j}),` to cancel`]})]});if(c.length===0)return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(_,{bold:!0,children:[`No Work Mate sessions found`,d&&(0,H.jsxs)(_,{children:[` for `,d]})]}),(0,H.jsx)(g,{marginTop:1,children:(0,H.jsxs)(_,{dimColor:!0,children:[`Press `,(0,H.jsx)(_,{bold:!0,children:j}),` to cancel`]})})]});let I=c.map(e=>({...e,timeString:P(new Date(e.updated_at))})),z=Math.max(7,...I.map(e=>e.timeString.length)),V=I.map(({timeString:e,title:t,id:n})=>({label:`${e.padEnd(z,` `)} ${t}`,value:n})),G=Math.max(1,a?Math.min(c.length,5,s-6-7):Math.min(c.length,s-1-7));return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,height:G+7,children:[(0,H.jsxs)(_,{bold:!0,children:[`Select a session to resume`,c.length>G&&(0,H.jsxs)(_,{dimColor:!0,children:[` `,`(`,O,` of `,c.length,`)`]}),d&&(0,H.jsxs)(_,{dimColor:!0,children:[` (`,d,`)`]}),`:`]}),(0,H.jsxs)(g,{flexDirection:`column`,marginTop:1,flexGrow:1,children:[(0,H.jsx)(g,{marginLeft:2,children:(0,H.jsxs)(_,{bold:!0,children:[U.padEnd(z,` `),W,`Session Title`]})}),(0,H.jsx)(o,{visibleOptionCount:G,options:V,onChange:t=>{let n=c.find(e=>e.id===t);n&&e(n)},onFocus:e=>{let t=V.findIndex(t=>t.value===e);t>=0&&k(t+1)}})]}),(0,H.jsx)(g,{flexDirection:`row`,children:(0,H.jsx)(_,{dimColor:!0,children:(0,H.jsxs)(v,{children:[(0,H.jsx)(h,{shortcut:`↑/↓`,action:`select`}),(0,H.jsx)(h,{shortcut:`Enter`,action:`confirm`}),(0,H.jsx)(n,{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)(g,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(_,{dimColor:!0,children:`Check your internet connection`})});case`auth`:return(0,H.jsx)(g,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(_,{dimColor:!0,children:`Teleport requires a Work Mate account`})});case`api`:return(0,H.jsx)(g,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(_,{dimColor:!0,children:`Sorry, Work Mate encountered an error`})});case`other`:return(0,H.jsx)(g,{marginY:1,flexDirection:`row`,children:(0,H.jsx)(_,{dimColor:!0,children:`Sorry, Work Mate encountered an error`})})}}M(),C(),m(),a();function J({onComplete:e,onCancel:t,onError:n,isEmbedded:i=!1,source:a}){let{resumeSession:o,isResuming:s,error:c,selectedSession:l}=V(a);(0,B.useEffect)(()=>{N(`tengu_teleport_started`,{source:a})},[a]);let u=async t=>{let r=await o(t);r?e(r):c&&n&&n(c.message,c.formattedMessage)},d=()=>{N(`tengu_teleport_cancelled`,{}),t()};return y(`app:interrupt`,d,{context:`Global`,isActive:!!c&&!n}),s&&l?(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(g,{flexDirection:`row`,children:[(0,H.jsx)(r,{}),(0,H.jsx)(_,{bold:!0,children:`Resuming session…`})]}),(0,H.jsxs)(_,{dimColor:!0,children:[`Loading "`,l.title,`"…`]})]}):c&&!n?(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsx)(_,{bold:!0,color:`error`,children:`Failed to resume session`}),(0,H.jsx)(_,{dimColor:!0,children:c.message}),(0,H.jsx)(g,{marginTop:1,children:(0,H.jsxs)(_,{dimColor:!0,children:[`Press `,(0,H.jsx)(_,{bold:!0,children:`Esc`}),` to cancel`]})})]}):(0,H.jsx)(G,{onSelect:u,onCancel:d,isEmbedded:i})}export{J as TeleportResumeWrapper};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$d as t,$h as n,Lh as r,Nh as i,Ph as a,Qu as o,Rh as s,Xh as c,Zd as l,Zh as u,Zu as d,dC as f,fC as p,gC as m,pC as h,uC as g,zh as _}from"./loadAgentsDir-DXOkUcW3.js";import{D as v,H as y,I as b,P as x,T as S,U as C,V as w,Wt as T,Xt as E,ot as D,t as O}from"./src-DL3w8VPk2.js";import{t as k}from"./jsx-runtime-Bb4Xn-E0.js";import{b as A,h as j}from"./settings-3xZ0fsvE.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-D0uqGxGw.js";function P({onThemeSelect:e,showIntroText:t=!1,helpText:a=``,showHelpTextBelow:c=!1,hideEscToCancel:d=!1,skipExitHandling:f=!1,onCancel:m}){let[h]=y(),g=C(),{columns:_}=D(),O=r(),k=O===null?s(h):null,{setPreviewTheme:j,savePreview:N,cancelPreview:P}=w(),I=u(e=>e.settings.syntaxHighlightingDisabled)??!1,L=n();E(`ThemePicker`);let R=p(`theme:toggleSyntaxHighlighting`,`ThemePicker`,`ctrl+t`);T(`theme:toggleSyntaxHighlighting`,()=>{if(O===null){let e=!I;A(`userSettings`,{syntaxHighlightingDisabled:e}),L(t=>({...t,settings:{...t.settings,syntaxHighlightingDisabled:e}}))}},{context:`ThemePicker`});let z=M(f?()=>{}: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,F.jsxs)(b,{flexDirection:`column`,gap:1,children:[(0,F.jsxs)(b,{flexDirection:`column`,gap:1,children:[t?(0,F.jsx)(x,{children:`Let's get started.`}):(0,F.jsx)(x,{bold:!0,color:`permission`,children:`Theme`}),(0,F.jsxs)(b,{flexDirection:`column`,children:[(0,F.jsx)(x,{bold:!0,children:`Choose the text style that looks best with your terminal`}),a&&!c&&(0,F.jsx)(x,{dimColor:!0,children:a})]}),(0,F.jsx)(o,{options:B,onFocus:e=>{j(e)},onChange:t=>{N(),e(t)},onCancel:f?()=>{P(),m?.()}:async()=>{P(),await l(0)},visibleOptionCount:B.length,defaultValue:g,defaultFocusValue:g})]}),(0,F.jsxs)(b,{flexDirection:`column`,width:`100%`,children:[(0,F.jsx)(b,{flexDirection:`column`,borderTop:!0,borderBottom:!0,borderLeft:!1,borderRight:!1,borderStyle:`dashed`,borderColor:`subtle`,children:(0,F.jsx)(i,{patch:{oldStart:1,newStart:1,oldLines:3,newLines:3,lines:[` function greet() {`,`- console.log("Hello, World!");`,`+ console.log("Hello, Work Mate!");`,` }`]},dim:!1,filePath:`demo.js`,firstLine:null,width:_})}),(0,F.jsxs)(x,{dimColor:!0,children:[` `,O===`env`?`Syntax highlighting disabled (via CLAUDE_CODE_SYNTAX_HIGHLIGHT=${process.env.CLAUDE_CODE_SYNTAX_HIGHLIGHT})`:I?`Syntax highlighting disabled (${R} to enable)`:k?`Syntax theme: ${k.theme}${k.source?` (from ${k.source})`:``} (${R} to disable)`:`Syntax highlighting enabled (${R} to disable)`]})]})]});return t?V:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(b,{flexDirection:`column`,children:V}),(0,F.jsxs)(b,{marginTop:1,children:[c&&a&&(0,F.jsx)(b,{marginLeft:3,children:(0,F.jsx)(x,{dimColor:!0,children:a})}),!d&&(0,F.jsx)(b,{children:(0,F.jsx)(x,{dimColor:!0,italic:!0,children:z.pending?(0,F.jsxs)(F.Fragment,{children:[`Press `,z.keyName,` again to exit`]}):(0,F.jsxs)(S,{children:[(0,F.jsx)(v,{shortcut:`Enter`,action:`select`}),(0,F.jsx)(v,{shortcut:`Esc`,action:`cancel`})]})})})]})]})}var F,I=e((()=>{N(),m(),O(),h(),g(),f(),c(),t(),j(),d(),_(),a(),F=k()}));export{I as n,P as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$d as t,Ox as n,Qd as r,Qu as i,Xg as a,Yg as o,Zu as s,jx as c,uC as l}from"./loadAgentsDir-DXOkUcW3.js";import{I as u,P as d,Wt as f,ai as p,t as m}from"./src-DL3w8VPk2.js";import{t as h}from"./jsx-runtime-Bb4Xn-E0.js";import{Qn as g,Ut as _}from"./state-D5D6QpTX.js";import{n as v,t as y}from"./cwd-Nh5IZNKO.js";import{f as b,u as x}from"./debug-D58GQBDG.js";import{h as S,s as C}from"./settings-3xZ0fsvE.js";import{h as w,n as T,v as E}from"./config-DRy1I12M.js";import{n as D,r as O}from"./analytics-DJobLaWP.js";import{in as k}from"./prompt-DEioJrx_.js";import{n as A,t as j}from"./managedEnvConstants-BPwL2aWI.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-D0uqGxGw.js";import{n as P,t as F}from"./PermissionDialog-BPhvs5xH.js";import{homedir as I}from"os";var L=e(p(),1),R=h();m(),_(),v(),b(),D(),w(),l(),c(),t(),s(),N(),P(),S(),k(),A(),a();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(`.workmate/settings.json`),z(C(`localSettings`))&&e.push(`.workmate/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(o(`projectSettings`))&&e.push(`.workmate/settings.json`),V(o(`localSettings`))&&e.push(`.workmate/settings.local.json`),e}function U(e){return!!e?.otelHeadersHelper}function W(){let e=[];return U(C(`projectSettings`))&&e.push(`.workmate/settings.json`),U(C(`localSettings`))&&e.push(`.workmate/settings.local.json`),e}function G(e){return!!e?.apiKeyHelper}function K(){let e=[];return G(C(`projectSettings`))&&e.push(`.workmate/settings.json`),G(C(`localSettings`))&&e.push(`.workmate/settings.local.json`),e}function q(e){return!!(e?.awsAuthRefresh||e?.awsCredentialExport)}function J(){let e=[];return q(C(`projectSettings`))&&e.push(`.workmate/settings.json`),q(C(`localSettings`))&&e.push(`.workmate/settings.local.json`),e}function Y(e){return!!e?.gcpAuthRefresh}function X(){let e=[];return Y(C(`projectSettings`))&&e.push(`.workmate/settings.json`),Y(C(`localSettings`))&&e.push(`.workmate/settings.local.json`),e}function Z(e){return e?.env?Object.keys(e.env).some(e=>!j.has(e.toUpperCase())):!1}function Q(){let e=[];return Z(C(`projectSettings`))&&e.push(`.workmate/settings.json`),Z(C(`localSettings`))&&e.push(`.workmate/settings.local.json`),e}k();function $({onDone:e,commands:t}){let{servers:a}=n(`project`),o=Object.keys(a).length>0,s=B().length>0,c=H(),l=K().length>0,p=J().length>0,m=X().length>0,h=W().length>0,_=Q().length>0,v=t?.some(e=>e.type===`prompt`&&e.loadedFrom===`commands_DEPRECATED`&&(e.source===`projectSettings`||e.source===`localSettings`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,b=t?.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=c.length>0||v||b,C=T(),[w,D]=L.useState(null);L.useEffect(()=>{if(w!==null){let e=w,t=setTimeout(()=>r(e));return()=>clearTimeout(t)}},[w]),L.useEffect(()=>{O(`tengu_trust_dialog_shown`,{isHomeDir:I()===y(),hasMcpServers:o,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:l,hasAwsCommands:p,hasGcpCommands:m,hasOtelHeadersHelper:h,hasDangerousEnvVars:_})},[o,s,S,l,p,m,h,_]);function k(t){if(t===`exit`){D(1);return}let n=I()===y();O(`tengu_trust_dialog_accept`,{isHomeDir:n,hasMcpServers:o,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:l,hasAwsCommands:p,hasGcpCommands:m,hasOtelHeadersHelper:h,hasDangerousEnvVars:_}),n?g(!0):E(e=>({...e,hasTrustDialogAccepted:!0})),e()}let A=M(()=>D(1));return f(`confirm:no`,()=>{D(0)},{context:`Confirmation`}),w===null?C?(setTimeout(e),null):(0,R.jsx)(F,{color:`warning`,titleColor:`warning`,title:`Accessing workspace:`,children:(0,R.jsxs)(u,{flexDirection:`column`,gap:1,paddingTop:1,children:[(0,R.jsx)(d,{bold:!0,children:x().cwd()}),(0,R.jsx)(d,{children:`Is this a project you trust? (Your own code, a well-known open source project, or work from your team).`}),(0,R.jsx)(d,{children:`Once trusted, Work Mate can read, edit, and run commands in this folder.`}),(0,R.jsx)(i,{options:[{label:`Yes, I trust this folder`,value:`enable_all`},{label:`No, exit`,value:`exit`}],onChange:e=>k(e),onCancel:()=>k(`exit`)}),(0,R.jsx)(d,{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 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{$S as i,F as a,Gg as o,Hg as s,Kg as c,N as l,P as u,QS as d,Qw as f,tT as p}from"./loadAgentsDir-DXOkUcW3.js";import{I as m,P as h,ai as g,di as _,fi as v,t as y}from"./src-DL3w8VPk2.js";import{t as b}from"./jsx-runtime-Bb4Xn-E0.js";import{Ut as x,h as S,rn as C}from"./state-D5D6QpTX.js";import{n as w,t as T}from"./AddWorkspaceDirectory-9FcHMKgX.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)(m,{flexDirection:`column`,children:[(0,k.jsxs)(h,{dimColor:!0,children:[r.pointer,` /add-dir `,t]}),(0,k.jsx)(d,{children:(0,k.jsx)(h,{children:e})})]})}async function D(e,t,n){let r=(n??``).trim(),i=t.getAppState(),o=async(n,r=!1)=>{let i={type:`addDirectories`,directories:[n],destination:r?`localSettings`:`session`},a=s(t.getAppState().toolPermissionContext,i);t.setAppState(e=>({...e,toolPermissionContext:a}));let o=S();o.includes(n)||C([...o,n]),f.refreshConfig();let l;if(r)try{c(i),l=`Added ${_.bold(n)} as a working directory and saved to local settings`}catch(e){l=`Added ${_.bold(n)} as a working directory. Failed to save to local settings: ${e instanceof Error?e.message:`Unknown error`}`}else l=`Added ${_.bold(n)} as a working directory for this session`;e(`${l} ${_.dim(`· /permissions to manage`)}`)};if(!r)return(0,k.jsx)(T,{permissionContext:i.toolPermissionContext,onAddDirectory:o,onCancel:()=>{e(`Did not add a working directory.`)}});let u=await a(r,i.toolPermissionContext);if(u.resultType!==`success`){let t=l(u);return(0,k.jsx)(E,{message:t,args:n??``,onDone:()=>e(t)})}return(0,k.jsx)(T,{directoryPath:u.absolutePath,permissionContext:i.toolPermissionContext,onAddDirectory:o,onCancel:()=>{e(`Did not add ${_.bold(u.absolutePath)} as a working directory.`)}})}var O,k;e((()=>{v(),n(),O=t(g(),1),x(),i(),w(),y(),o(),p(),u(),k=b()}))();export{D as call};
@@ -1,101 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{i as n,o as r}from"./envUtils-DcaKZlRU.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{$h as o,$m as s,$p as c,$u as l,CT as u,Dp as d,Fb as f,Gl as p,Gp as m,Hp as h,Ib as g,JS as _,J_ as v,Jf as ee,Jp as y,Ka as b,Kc as te,Kl as ne,Kp as re,La as ie,Lb as ae,Mu as oe,Op as x,Pb as se,Pu as ce,Q as le,Ql as ue,Qm as de,Qp as fe,Qu as pe,ST as me,Sa as he,Sp as ge,Um as _e,Up as ve,Vp as ye,Wl as be,Wm as xe,Wp as Se,X as Ce,Xf as we,Xh as Te,YS as Ee,Y_ as De,Yf as Oe,Zh as ke,Zl as Ae,ah as je,by as Me,c as Ne,cd as Pe,dh as Fe,fh as Ie,iS as Le,ih as Re,l as ze,ld as Be,nE as Ve,o as He,oh as Ue,qc as We,qf as Ge,ql as Ke,qp as qe,r as Je,rE as Ye,rS as Xe,rt as Ze,s as Qe,sh as $e,t as et,tE as tt,tm as nt,tt as rt,uC as S,vx as it,wp as at,yx as ot}from"./loadAgentsDir-DXOkUcW3.js";import{C as st,D as C,I as w,P as T,T as E,Wt as D,ai as O,di as ct,fi as lt,t as k,y as ut}from"./src-DL3w8VPk2.js";import{t as A}from"./jsx-runtime-Bb4Xn-E0.js";import{n as dt,t as ft}from"./cwd-Nh5IZNKO.js";import{F as pt,R as mt,S as ht,U as gt,W as _t,Z as vt,x as yt}from"./debug-D58GQBDG.js";import{In as bt,Ln as xt,Yt as St,Z as Ct,Zt as wt,cn as Tt,it as Et,on as Dt,q as Ot,rt as kt}from"./settings-3xZ0fsvE.js";import{M as At,P as jt}from"./config-DRy1I12M.js";import{o as Mt,s as Nt}from"./log-CZ7ploQm.js";import{n as Pt,r as Ft}from"./analytics-DJobLaWP.js";import{C as It,v as Lt}from"./startupProfiler-CbzxVmbv.js";import{l as Rt,n as zt,o as Bt}from"./stringUtils-CKD8qDqx.js";import{_n as Vt,vn as Ht}from"./prompt-DEioJrx_.js";import{Q as Ut}from"./sessionState-DAcub-HK.js";import{a as Wt,i as Gt,n as Kt,o as qt,r as Jt,t as Yt}from"./agentDisplay-D01ZlnVX.js";import{n as Xt,t as Zt}from"./useExitOnCtrlCDWithKeybindings-D0uqGxGw.js";import{n as Qt,t as $t}from"./useMergedTools-rQ19rFvH.js";import{n as en,r as tn,t as nn}from"./promptEditor-eJzbtNn4.js";import{n as rn,t as an}from"./useMainLoopModel-BGPOmBkl.js";import{join as j}from"path";import{mkdir as on,open as sn,unlink as cn}from"fs/promises";var M,ln=e((()=>{M={FOLDER_NAME:`.workmate`,AGENTS_DIR:`agents`}}));function un(e,t,n,r,i,a,o){return`---
2
- name: ${e}
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}`:``}${i?`\ncolor: ${i}`:``}${o?`\nmemory: ${o}`:``}
4
- ---
5
-
6
- ${r}
7
- `}function dn(e){switch(e){case`flagSettings`:throw Error(`Cannot get directory path for ${e} agents`);case`userSettings`:return j(n(),M.AGENTS_DIR);case`projectSettings`:return j(ft(),M.FOLDER_NAME,M.AGENTS_DIR);case`policySettings`:return j(St(),M.FOLDER_NAME,M.AGENTS_DIR);case`localSettings`:return j(ft(),M.FOLDER_NAME,M.AGENTS_DIR)}}function fn(e){switch(e){case`projectSettings`:return j(`.`,M.FOLDER_NAME,M.AGENTS_DIR);default:return dn(e)}}function pn(e){return j(dn(e.source),`${e.agentType}.md`)}function mn(e){if(e.source===`built-in`)return`Built-in`;if(e.source===`plugin`)throw Error(`Cannot get file path for plugin agents`);return j(dn(e.source),`${e.filename||e.agentType}.md`)}function hn(e){return e.source===`built-in`?`Built-in`:j(fn(e.source),`${e.agentType}.md`)}function gn(e){return Qe(e)?`Built-in`:ze(e)?`Plugin: ${e.plugin||`Unknown`}`:e.source===`flagSettings`?`CLI argument`:j(fn(e.source),`${e.filename||e.agentType}.md`)}async function _n(e){let t=dn(e);return await on(t,{recursive:!0}),t}async function vn(e,t,n,r,i,a=!0,o,s,c){if(e===`built-in`)throw Error(`Cannot save built-in agents`);await _n(e);let l=pn({source:e,agentType:t}),u=un(t,n,r,i,o,s,c);try{await xn(l,u,a?`wx`:`w`)}catch(e){throw pt(e)===`EEXIST`?Error(`Agent file already exists: ${l}`):e}}async function yn(e,t,n,r,i,a,o){if(e.source===`built-in`)throw Error(`Cannot update built-in agents`);await xn(mn(e),un(e.agentType,t,n,r,i,a,o))}async function bn(e){if(e.source===`built-in`)throw Error(`Cannot delete built-in agents`);let t=mn(e);try{await cn(t)}catch(e){if(pt(e)!==`ENOENT`)throw e}}async function xn(e,t,n=`w`){let r=await sn(e,n);try{await r.writeFile(t,{encoding:`utf-8`}),await r.datasync()}finally{await r.close()}}var Sn=e((()=>{wt(),He(),dt(),r(),mt(),ln()}));function Cn({agent:e,tools:t,onBack:n}){let r=ve(e,t,!1),i=gn(e),o=re(e.agentType);D(`confirm:no`,n,{context:`Confirmation`});let s=e=>{e.key===`return`&&(e.preventDefault(),n())};function c(){return r.hasWildcard?(0,N.jsx)(T,{children:`All tools`}):!e.tools||e.tools.length===0?(0,N.jsx)(T,{children:`None`}):(0,N.jsxs)(N.Fragment,{children:[r.validTools.length>0&&(0,N.jsx)(T,{children:r.validTools.join(`, `)}),r.invalidTools.length>0&&(0,N.jsxs)(T,{color:`warning`,children:[a.warning,` Unrecognized: `,r.invalidTools.join(`, `)]})]})}return(0,N.jsxs)(w,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,N.jsx)(T,{dimColor:!0,children:i}),(0,N.jsxs)(w,{flexDirection:`column`,children:[(0,N.jsxs)(T,{children:[(0,N.jsx)(T,{bold:!0,children:`Description`}),` (tells Work Mate when to use this agent):`]}),(0,N.jsx)(w,{marginLeft:2,children:(0,N.jsx)(T,{children:e.whenToUse})})]}),(0,N.jsxs)(w,{children:[(0,N.jsxs)(T,{children:[(0,N.jsx)(T,{bold:!0,children:`Tools`}),`:`,` `]}),c()]}),(0,N.jsxs)(T,{children:[(0,N.jsx)(T,{bold:!0,children:`Model`}),`: `,fe(e.model)]}),e.permissionMode&&(0,N.jsxs)(T,{children:[(0,N.jsx)(T,{bold:!0,children:`Permission mode`}),`: `,e.permissionMode]}),e.memory&&(0,N.jsxs)(T,{children:[(0,N.jsx)(T,{bold:!0,children:`Memory`}),`: `,tt(e.memory)]}),e.hooks&&Object.keys(e.hooks).length>0&&(0,N.jsxs)(T,{children:[(0,N.jsx)(T,{bold:!0,children:`Hooks`}),`: `,Object.keys(e.hooks).join(`, `)]}),e.skills&&e.skills.length>0&&(0,N.jsxs)(T,{children:[(0,N.jsx)(T,{bold:!0,children:`Skills`}),`:`,` `,e.skills.length>10?`${e.skills.length} skills`:e.skills.join(`, `)]}),o&&(0,N.jsx)(w,{children:(0,N.jsxs)(T,{children:[(0,N.jsx)(T,{bold:!0,children:`Color`}),`:`,` `,(0,N.jsxs)(T,{backgroundColor:o,color:`inverseText`,children:[` `,e.agentType,` `]})]})}),!Qe(e)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(w,{children:(0,N.jsxs)(T,{children:[(0,N.jsx)(T,{bold:!0,children:`System prompt`}),`:`]})}),(0,N.jsx)(w,{marginLeft:2,marginRight:2,children:(0,N.jsx)(ge,{children:e.getSystemPrompt()})})]})]})}var N,wn=e((()=>{i(),k(),S(),qe(),Ve(),h(),He(),nt(),at(),Sn(),N=A()}));function Tn({agentName:e,currentColor:t=`automatic`,onConfirm:n}){let[r,i]=(0,En.useState)(Math.max(0,Dn.indexOf(t))),o=e=>{if(e.key===`up`)e.preventDefault(),i(e=>e>0?e-1:Dn.length-1);else if(e.key===`down`)e.preventDefault(),i(e=>e<Dn.length-1?e+1:0);else if(e.key===`return`){e.preventDefault();let t=Dn[r];n(t===`automatic`?void 0:t)}},s=Dn[r];return(0,P.jsxs)(w,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:o,children:[(0,P.jsx)(w,{flexDirection:`column`,children:Dn.map((e,t)=>{let n=t===r;return(0,P.jsxs)(w,{flexDirection:`row`,gap:1,children:[(0,P.jsx)(T,{color:n?`suggestion`:void 0,children:n?a.pointer:` `}),e===`automatic`?(0,P.jsx)(T,{bold:n,children:`Automatic color`}):(0,P.jsxs)(w,{gap:1,children:[(0,P.jsx)(T,{backgroundColor:m[e],color:`inverseText`,children:` `}),(0,P.jsx)(T,{bold:n,children:zt(e)})]})]},e)})}),(0,P.jsxs)(w,{marginTop:1,children:[(0,P.jsx)(T,{children:`Preview: `}),s===void 0||s===`automatic`?(0,P.jsxs)(T,{inverse:!0,bold:!0,children:[` `,`@`,e,` `]}):(0,P.jsxs)(T,{backgroundColor:m[s],color:`inverseText`,bold:!0,children:[` `,`@`,e,` `]})]})]})}var En,P,Dn,On=e((()=>{i(),En=t(O(),1),k(),qe(),Bt(),P=A(),Dn=[`automatic`,...Se]}));function kn({initialModel:e,onComplete:t,onCancel:n}){let r=An.useMemo(()=>{let t=c();return e&&!t.some(t=>t.value===e)?[{value:e,label:e,description:`Current model (custom ID)`},...t]:t},[e]);return(0,jn.jsxs)(w,{flexDirection:`column`,children:[(0,jn.jsx)(w,{marginBottom:1,children:(0,jn.jsx)(T,{dimColor:!0,children:`Model determines the agent's reasoning capabilities and speed.`})}),(0,jn.jsx)(pe,{options:r,defaultValue:e??`sonnet`,onChange:t,onCancel:()=>n?n():t(void 0)})]})}var An,jn,Mn=e((()=>{An=t(O(),1),k(),nt(),l(),jn=A()}));function Nn(){return{READ_ONLY:{name:`Read-only tools`,toolNames:new Set([Re.name,Ue.name,be.name,_.name,de.name,Ae.name,ne.name,Xe.name,g.name])},EDIT:{name:`Edit tools`,toolNames:new Set([Oe.name,Fe.name,Ge.name])},EXECUTION:{name:`Execution tools`,toolNames:new Set([_e.name])},MCP:{name:`MCP tools`,toolNames:new Set,isMcp:!0},OTHER:{name:`Other tools`,toolNames:new Set}}}function Pn(e){let t=new Map;return e.forEach(e=>{if(ot(e)){let n=Et(e.name);if(n?.serverName){let r=t.get(n.serverName)||[];r.push(e),t.set(n.serverName,r)}}}),Array.from(t.entries()).map(([e,t])=>({serverName:e,tools:t})).sort((e,t)=>e.serverName.localeCompare(t.serverName))}function Fn({tools:e,initialTools:t,onComplete:n,onCancel:r}){let i=(0,F.useMemo)(()=>ye({tools:e,isBuiltIn:!1,isAsync:!1}),[e]),[o,s]=(0,F.useState)(!t||t.includes(`*`)?i.map(e=>e.name):t),[c,l]=(0,F.useState)(0),[u,d]=(0,F.useState)(!1),f=(0,F.useMemo)(()=>{let e=new Set(i.map(e=>e.name));return o.filter(t=>e.has(t))},[o,i]),p=new Set(f),m=f.length===i.length&&i.length>0,h=e=>{e&&s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},g=(e,t)=>{s(n=>{if(t){let t=e.filter(e=>!n.includes(e));return[...n,...t]}else return n.filter(t=>!e.includes(t))})},_=()=>{let e=i.map(e=>e.name);n(f.length===e.length&&e.every(e=>f.includes(e))?void 0:f)},v=(0,F.useMemo)(()=>{let e=Nn(),t={readOnly:[],edit:[],execution:[],mcp:[],other:[]};return i.forEach(n=>{ot(n)?t.mcp.push(n):e.READ_ONLY.toolNames.has(n.name)?t.readOnly.push(n):e.EDIT.toolNames.has(n.name)?t.edit.push(n):e.EXECUTION.toolNames.has(n.name)?t.execution.push(n):n.name!==`Agent`&&t.other.push(n)}),t},[i]),ee=e=>{let t=bt(e,e=>p.has(e.name))<e.length;return()=>{let n=e.map(e=>e.name);g(n,t)}},y=[];y.push({id:`continue`,label:`Continue`,action:_,isContinue:!0}),y.push({id:`bucket-all`,label:`${m?a.checkboxOn:a.checkboxOff} All tools`,action:()=>{let e=i.map(e=>e.name);g(e,!m)}});let b=Nn();[{id:`bucket-readonly`,name:b.READ_ONLY.name,tools:v.readOnly},{id:`bucket-edit`,name:b.EDIT.name,tools:v.edit},{id:`bucket-execution`,name:b.EXECUTION.name,tools:v.execution},{id:`bucket-mcp`,name:b.MCP.name,tools:v.mcp},{id:`bucket-other`,name:b.OTHER.name,tools:v.other}].forEach(({id:e,name:t,tools:n})=>{if(n.length===0)return;let r=bt(n,e=>p.has(e.name))===n.length;y.push({id:e,label:`${r?a.checkboxOn:a.checkboxOff} ${t}`,action:ee(n)})});let te=y.length;y.push({id:`toggle-individual`,label:u?`Hide advanced options`:`Show advanced options`,action:()=>{d(!u),u&&c>te&&l(te)},isToggle:!0});let ne=(0,F.useMemo)(()=>Pn(i),[i]);return u&&(ne.length>0&&(y.push({id:`mcp-servers-header`,label:`MCP Servers:`,action:()=>{},isHeader:!0}),ne.forEach(({serverName:e,tools:t})=>{let n=bt(t,e=>p.has(e.name))===t.length;y.push({id:`mcp-server-${e}`,label:`${n?a.checkboxOn:a.checkboxOff} ${e} (${t.length} ${Rt(t.length,`tool`)})`,action:()=>{let e=t.map(e=>e.name);g(e,!n)}})}),y.push({id:`tools-header`,label:`Individual Tools:`,action:()=>{},isHeader:!0})),i.forEach(e=>{let t=e.name;if(e.name.startsWith(`mcp__`)){let n=Et(e.name);t=n?`${n.toolName} (${n.serverName})`:e.name}y.push({id:`tool-${e.name}`,label:`${p.has(e.name)?a.checkboxOn:a.checkboxOff} ${t}`,action:()=>h(e.name)})})),D(`confirm:no`,(0,F.useCallback)(()=>{r?r():n(t)},[r,n,t]),{context:`Confirmation`}),(0,I.jsxs)(w,{flexDirection:`column`,marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(e.key===`return`){e.preventDefault();let t=y[c];t&&!t.isHeader&&t.action()}else if(e.key===`up`){e.preventDefault();let t=c-1;for(;t>0&&y[t]?.isHeader;)t--;l(Math.max(0,t))}else if(e.key===`down`){e.preventDefault();let t=c+1;for(;t<y.length-1&&y[t]?.isHeader;)t++;l(Math.min(y.length-1,t))}},children:[(0,I.jsxs)(T,{color:c===0?`suggestion`:void 0,bold:c===0,children:[c===0?`${a.pointer} `:` `,`[ Continue ]`]}),(0,I.jsx)(st,{width:40}),y.slice(1).map((e,t)=>{let n=t+1===c,r=e.isToggle,i=e.isHeader;return(0,I.jsxs)(F.Fragment,{children:[r&&(0,I.jsx)(st,{width:40}),i&&t>0&&(0,I.jsx)(w,{marginTop:1}),(0,I.jsxs)(T,{color:i?void 0:n?`suggestion`:void 0,dimColor:i,bold:r&&n,children:[i?``:n?`${a.pointer} `:` `,r?`[ ${e.label} ]`:e.label]})]},e.id)}),(0,I.jsx)(w,{marginTop:1,flexDirection:`column`,children:(0,I.jsx)(T,{dimColor:!0,children:m?`All tools selected`:`${p.size} of ${i.length} tools selected`})})]})}var F,I,In=e((()=>{i(),F=t(O(),1),kt(),it(),h(),Ct(),xe(),p(),we(),Ee(),Ie(),je(),$e(),Le(),ee(),ae(),Ke(),ue(),s(),k(),S(),xt(),Bt(),I=A()}));function Ln(e){return e===`all`?`Agents`:e===`built-in`?`Built-in agents`:e===`plugin`?`Plugin agents`:me(Dt(e))}var Rn=e((()=>{u(),Tt()}));function zn({agent:e,tools:t,onSaved:n,onBack:r}){let i=o(),[s,c]=(0,L.useState)(`menu`),[l,u]=(0,L.useState)(0),[d,f]=(0,L.useState)(null),[p,m]=(0,L.useState)(e.color),h=(0,L.useCallback)(async()=>{let t=await nn(mn(e));t.error?f(t.error):n(`Opened ${e.agentType} in editor. If you made edits, restart to load the latest version.`)},[e,n]),g=(0,L.useCallback)(async(t={})=>{let{tools:r,color:a,model:o}=t,s=a??p,c=r!==void 0,l=o!==void 0,u=s!==e.color;if(!c&&!l&&!u)return!1;try{return!Ne(e)&&!ze(e)?!1:(await yn(e,e.whenToUse,r??e.tools,e.getSystemPrompt(),s,o??e.model),u&&s&&y(e.agentType,s),i(t=>{let n=t.agentDefinitions.allAgents.map(t=>t.agentType===e.agentType?{...t,tools:r??t.tools,color:s,model:o??t.model}:t);return{...t,agentDefinitions:{...t.agentDefinitions,activeAgents:Je(n),allAgents:n}}}),n(`Updated agent: ${ct.bold(e.agentType)}`),!0)}catch(e){return f(e instanceof Error?e.message:`Failed to save agent`),!1}},[e,p,n,i]),_=(0,L.useMemo)(()=>[{label:`Open in editor`,action:h},{label:`Edit tools`,action:()=>c(`edit-tools`)},{label:`Edit model`,action:()=>c(`edit-model`)},{label:`Edit color`,action:()=>c(`edit-color`)}],[h]),v=(0,L.useCallback)(()=>{f(null),s===`menu`?r():c(`menu`)},[s,r]),ee=(0,L.useCallback)(e=>{if(e.key===`up`)e.preventDefault(),u(e=>Math.max(0,e-1));else if(e.key===`down`)e.preventDefault(),u(e=>Math.min(_.length-1,e+1));else if(e.key===`return`){e.preventDefault();let t=_[l];t&&t.action()}},[_,l]);D(`confirm:no`,v,{context:`Confirmation`});let b=()=>(0,R.jsxs)(w,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:ee,children:[(0,R.jsxs)(T,{dimColor:!0,children:[`Source: `,Ln(e.source)]}),(0,R.jsx)(w,{marginTop:1,flexDirection:`column`,children:_.map((e,t)=>(0,R.jsxs)(T,{color:t===l?`suggestion`:void 0,children:[t===l?`${a.pointer} `:` `,e.label]},e.label))}),d&&(0,R.jsx)(w,{marginTop:1,children:(0,R.jsx)(T,{color:`error`,children:d})})]});switch(s){case`menu`:return b();case`edit-tools`:return(0,R.jsx)(Fn,{tools:t,initialTools:e.tools,onComplete:async e=>{c(`menu`),await g({tools:e})}});case`edit-color`:return(0,R.jsx)(Tn,{agentName:e.agentType,currentColor:p||e.color||`automatic`,onConfirm:async e=>{m(e),c(`menu`),await g({color:e})}});case`edit-model`:return(0,R.jsx)(kn,{initialModel:e.model,onComplete:async e=>{c(`menu`),await g({model:e})}});default:return null}}var L,R,Bn=e((()=>{lt(),i(),L=t(O(),1),Te(),k(),S(),qe(),He(),tn(),Sn(),On(),Mn(),In(),Rn(),R=A()}));function Vn({instructions:e=`Press ↑↓ to navigate · Enter to select · Esc to go back`}){let t=Xt();return(0,Hn.jsx)(w,{marginLeft:2,children:(0,Hn.jsx)(T,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var Hn,Un=e((()=>{Zt(),k(),Hn=A()}));function Wn({source:e,agents:t,onBack:n,onSelect:r,onCreateNew:i,changes:o}){let[s,c]=Gn.useState(null),[l,u]=Gn.useState(!0),d=Gn.useMemo(()=>[...t].sort(Kt),[t]),f=e=>({isOverridden:!!e.overriddenBy,overriddenBy:e.overriddenBy||null}),p=()=>(0,z.jsxs)(w,{children:[(0,z.jsx)(T,{color:l?`suggestion`:void 0,children:l?`${a.pointer} `:` `}),(0,z.jsx)(T,{color:l?`suggestion`:void 0,children:`Create new agent`})]}),m=e=>{let t=e.source===`built-in`,n=!t&&!l&&s?.agentType===e.agentType&&s?.source===e.source,{isOverridden:r,overriddenBy:i}=f(e),o=t||r,c=!t&&n?`suggestion`:void 0,u=Wt(e);return(0,z.jsxs)(w,{children:[(0,z.jsx)(T,{dimColor:o&&!n,color:c,children:t?``:n?`${a.pointer} `:` `}),(0,z.jsx)(T,{dimColor:o&&!n,color:c,children:e.agentType}),u&&(0,z.jsxs)(T,{dimColor:!0,color:c,children:[` · `,u]}),e.memory&&(0,z.jsxs)(T,{dimColor:!0,color:c,children:[` · `,e.memory,` memory`]}),i&&(0,z.jsxs)(T,{dimColor:!n,color:n?`warning`:void 0,children:[` `,a.warning,` shadowed by `,Jt(i)]})]},`${e.agentType}-${e.source}`)},h=Gn.useMemo(()=>{let t=d.filter(e=>e.source!==`built-in`);return e===`all`?Yt.filter(e=>e.source!==`built-in`).flatMap(({source:e})=>t.filter(t=>t.source===e)):t},[d,e]);Gn.useEffect(()=>{!s&&!l&&h.length>0&&(i?u(!0):c(h[0]||null))},[h,s,l,i]);let g=e=>{if(e.key===`return`){e.preventDefault(),l&&i?i():s&&r(s);return}if(e.key!==`up`&&e.key!==`down`)return;e.preventDefault();let t=!!i,n=h.length+ +!!t;if(n===0)return;let a=0;if(!l&&s){let e=h.findIndex(e=>e.agentType===s.agentType&&e.source===s.source);e>=0&&(a=t?e+1:e)}let o=e.key===`up`?a===0?n-1:a-1:a===n-1?0:a+1;if(t&&o===0)u(!0),c(null);else{let e=t?o-1:o,n=h[e];n&&(u(!1),c(n))}},_=(e=`Built-in (always available):`)=>{let t=d.filter(e=>e.source===`built-in`);return(0,z.jsxs)(w,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,z.jsx)(T,{bold:!0,dimColor:!0,children:e}),t.map(m)]})},v=(e,t)=>{if(!t.length)return null;let n=t[0]?.baseDir;return(0,z.jsxs)(w,{flexDirection:`column`,marginBottom:1,children:[(0,z.jsxs)(w,{paddingLeft:2,children:[(0,z.jsx)(T,{bold:!0,dimColor:!0,children:e}),n&&(0,z.jsxs)(T,{dimColor:!0,children:[` (`,n,`)`]})]}),t.map(e=>m(e))]})},ee=Ln(e),y=d.filter(e=>e.source===`built-in`);return!d.length||e!==`built-in`&&!d.some(e=>e.source!==`built-in`)?(0,z.jsx)(ut,{title:ee,subtitle:`No agents found`,onCancel:n,hideInputGuide:!0,children:(0,z.jsxs)(w,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:g,children:[i&&(0,z.jsx)(w,{children:p()}),(0,z.jsx)(T,{dimColor:!0,children:`No agents found. Create specialized subagents that Work Mate can delegate to.`}),(0,z.jsx)(T,{dimColor:!0,children:`Each subagent has its own context window, custom system prompt, and specific tools.`}),(0,z.jsx)(T,{dimColor:!0,children:`Try creating: Code Reviewer, Code Simplifier, Security Reviewer, Tech Lead, or UX Reviewer.`}),e!==`built-in`&&d.some(e=>e.source===`built-in`)&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(st,{}),_()]})]})}):(0,z.jsxs)(ut,{title:ee,subtitle:`${bt(d,e=>!e.overriddenBy)} agents`,onCancel:n,hideInputGuide:!0,children:[o&&o.length>0&&(0,z.jsx)(w,{marginTop:1,children:(0,z.jsx)(T,{dimColor:!0,children:o[o.length-1]})}),(0,z.jsxs)(w,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:g,children:[i&&(0,z.jsx)(w,{marginBottom:1,children:p()}),e===`all`?(0,z.jsxs)(z.Fragment,{children:[Yt.filter(e=>e.source!==`built-in`).map(({label:e,source:t})=>(0,z.jsx)(Gn.Fragment,{children:v(e,d.filter(e=>e.source===t))},t)),y.length>0&&(0,z.jsxs)(w,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,z.jsxs)(T,{dimColor:!0,children:[(0,z.jsx)(T,{bold:!0,children:`Built-in agents`}),` (always available)`]}),y.map(m)]})]}):e===`built-in`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(T,{dimColor:!0,italic:!0,children:`Built-in agents are provided by default and cannot be modified.`}),(0,z.jsx)(w,{marginTop:1,flexDirection:`column`,children:d.map(e=>m(e))})]}):(0,z.jsxs)(z.Fragment,{children:[d.filter(e=>e.source!==`built-in`).map(e=>m(e)),d.some(e=>e.source===`built-in`)&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(st,{}),_()]})]})]})]})}var Gn,z,Kn=e((()=>{i(),Gn=t(O(),1),k(),Gt(),xt(),Rn(),z=A()}));function qn({steps:e,initialData:t={},onComplete:n,onCancel:r,children:i,title:a,showStepCounter:o=!0}){let[s,c]=(0,B.useState)(0),[l,u]=(0,B.useState)(t),[d,f]=(0,B.useState)(!1),[p,m]=(0,B.useState)([]);Xt(),(0,B.useEffect)(()=>{d&&(m([]),n(l))},[d,l,n]);let h=(0,B.useCallback)(()=>{s<e.length-1?(p.length>0&&m(e=>[...e,s]),c(e=>e+1)):f(!0)},[s,e.length,p]),g=(0,B.useCallback)(()=>{if(p.length>0){let e=p[p.length-1];e!==void 0&&(m(e=>e.slice(0,-1)),c(e))}else s>0?c(e=>e-1):r&&r()},[s,p,r]),_=(0,B.useCallback)(t=>{t>=0&&t<e.length&&(m(e=>[...e,s]),c(t))},[s,e.length]),v=(0,B.useCallback)(()=>{m([]),r&&r()},[r]),ee=(0,B.useCallback)(e=>{u(t=>({...t,...e}))},[]),y=(0,B.useMemo)(()=>({currentStepIndex:s,totalSteps:e.length,wizardData:l,setWizardData:u,updateWizardData:ee,goNext:h,goBack:g,goToStep:_,cancel:v,title:a,showStepCounter:o}),[s,e.length,l,ee,h,g,_,v,a,o]),b=e[s];return!b||d?null:(0,Jn.jsx)(Yn.Provider,{value:y,children:i||(0,Jn.jsx)(b,{})})}var B,Jn,Yn,Xn=e((()=>{B=t(O(),1),Zt(),Jn=A(),Yn=(0,B.createContext)(null)}));function V(){let e=(0,Zn.useContext)(Yn);if(!e)throw Error(`useWizard must be used within a WizardProvider`);return e}var Zn,Qn=e((()=>{Zn=t(O(),1),Xn()}));function $n({instructions:e=(0,er.jsxs)(E,{children:[(0,er.jsx)(C,{shortcut:`↑↓`,action:`navigate`}),(0,er.jsx)(C,{shortcut:`Enter`,action:`select`}),(0,er.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})}){let t=Xt();return(0,er.jsx)(w,{marginLeft:3,marginTop:1,children:(0,er.jsx)(T,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var er,tr=e((()=>{Zt(),k(),x(),er=A()}));function H({title:e,color:t=`suggestion`,children:n,subtitle:r,footerText:i}){let{currentStepIndex:a,totalSteps:o,title:s,showStepCounter:c,goBack:l}=V();return(0,nr.jsxs)(nr.Fragment,{children:[(0,nr.jsx)(ut,{title:`${e||s||`Wizard`}${c===!1?``:` (${a+1}/${o})`}`,subtitle:r,onCancel:l,color:t,hideInputGuide:!0,isCancelActive:!1,children:n}),(0,nr.jsx)($n,{instructions:i})]})}var nr,U=e((()=>{k(),Qn(),tr(),nr=A()})),W=e((()=>{Qn(),U(),tr(),Xn()}));function rr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=V();return D(`confirm:no`,t,{context:`Confirmation`}),(0,ir.jsx)(H,{subtitle:`Choose background color`,footerText:(0,ir.jsxs)(E,{children:[(0,ir.jsx)(C,{shortcut:`↑↓`,action:`navigate`}),(0,ir.jsx)(C,{shortcut:`Enter`,action:`select`}),(0,ir.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,ir.jsx)(w,{children:(0,ir.jsx)(Tn,{agentName:r.agentType||`agent`,currentColor:`automatic`,onConfirm:t=>{n({selectedColor:t,finalAgent:{agentType:r.agentType,whenToUse:r.whenToUse,getSystemPrompt:()=>r.systemPrompt,tools:r.selectedTools,...r.selectedModel?{model:r.selectedModel}:{},...t?{color:t}:{},source:r.location}}),e()}})})})}var ir,ar=e((()=>{k(),S(),x(),W(),U(),On(),ir=A()}));function or(e){return e?/^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$/.test(e)?e.length<3?`Agent type must be at least 3 characters long`:e.length>50?`Agent type must be less than 50 characters`:null:`Agent type must start and end with alphanumeric characters and contain only letters, numbers, and hyphens`:`Agent type is required`}function sr(e,t,n){let r=[],i=[];if(!e.agentType)r.push(`Agent type is required`);else{let t=or(e.agentType);t&&r.push(t);let i=n.find(t=>t.agentType===e.agentType&&t.source!==e.source);i&&r.push(`Agent type "${e.agentType}" already exists in ${Ln(i.source)}`)}if(e.whenToUse?e.whenToUse.length<10?i.push(`Description should be more descriptive (at least 10 characters)`):e.whenToUse.length>5e3&&i.push(`Description is very long (over 5000 characters)`):r.push(`Description (description) is required`),e.tools!==void 0&&!Array.isArray(e.tools))r.push(`Tools must be an array`);else{e.tools===void 0?i.push(`Agent has access to all tools`):e.tools.length===0&&i.push(`No tools selected - agent will have very limited capabilities`);let n=ve(e,t,!1);n.invalidTools.length>0&&r.push(`Invalid tools: ${n.invalidTools.join(`, `)}`)}let a=e.getSystemPrompt();return a?a.length<20?r.push(`System prompt is too short (minimum 20 characters)`):a.length>1e4&&i.push(`System prompt is very long (over 10,000 characters)`):r.push(`System prompt is required`),{isValid:r.length===0,errors:r,warnings:i}}var cr=e((()=>{h(),Rn()}));function lr({tools:e,existingAgents:t,onSave:n,onSaveAndEdit:r,error:i}){let{goBack:a,wizardData:o}=V();D(`confirm:no`,a,{context:`Confirmation`});let s=e=>{e.key===`s`||e.key===`return`?(e.preventDefault(),n()):e.key===`e`&&(e.preventDefault(),r())},c=o.finalAgent,l=sr(c,e,t),u=It(c.getSystemPrompt(),240),f=It(c.whenToUse,240),p=e=>e===void 0?`All tools`:e.length===0?`None`:e.length===1?e[0]||`None`:e.length===2?e.join(` and `):`${e.slice(0,-1).join(`, `)}, and ${e[e.length-1]}`,m=jt()?(0,G.jsxs)(T,{children:[(0,G.jsx)(T,{bold:!0,children:`Memory`}),`: `,tt(c.memory)]}):null;return(0,G.jsx)(H,{subtitle:`Confirm and save`,footerText:(0,G.jsxs)(E,{children:[(0,G.jsx)(C,{shortcut:`s/Enter`,action:`save`}),(0,G.jsx)(C,{shortcut:`e`,action:`edit in your editor`}),(0,G.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,G.jsxs)(w,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,G.jsxs)(T,{children:[(0,G.jsx)(T,{bold:!0,children:`Name`}),`: `,c.agentType]}),(0,G.jsxs)(T,{children:[(0,G.jsx)(T,{bold:!0,children:`Location`}),`:`,` `,hn({source:o.location,agentType:c.agentType})]}),(0,G.jsxs)(T,{children:[(0,G.jsx)(T,{bold:!0,children:`Tools`}),`: `,p(c.tools)]}),(0,G.jsxs)(T,{children:[(0,G.jsx)(T,{bold:!0,children:`Model`}),`: `,fe(c.model)]}),m,(0,G.jsx)(w,{marginTop:1,children:(0,G.jsxs)(T,{children:[(0,G.jsx)(T,{bold:!0,children:`Description`}),` (tells Work Mate when to use this agent):`]})}),(0,G.jsx)(w,{marginLeft:2,marginTop:1,children:(0,G.jsx)(T,{children:f})}),(0,G.jsx)(w,{marginTop:1,children:(0,G.jsxs)(T,{children:[(0,G.jsx)(T,{bold:!0,children:`System prompt`}),`:`]})}),(0,G.jsx)(w,{marginLeft:2,marginTop:1,children:(0,G.jsx)(T,{children:u})}),l.warnings.length>0&&(0,G.jsxs)(w,{marginTop:1,flexDirection:`column`,children:[(0,G.jsx)(T,{color:`warning`,children:`Warnings:`}),l.warnings.map((e,t)=>(0,G.jsxs)(T,{dimColor:!0,children:[` `,`• `,e]},t))]}),l.errors.length>0&&(0,G.jsxs)(w,{marginTop:1,flexDirection:`column`,children:[(0,G.jsx)(T,{color:`error`,children:`Errors:`}),l.errors.map((e,t)=>(0,G.jsxs)(T,{color:`error`,children:[` `,`• `,e]},t))]}),i&&(0,G.jsx)(w,{marginTop:1,children:(0,G.jsx)(T,{color:`error`,children:i})}),(0,G.jsx)(w,{marginTop:2,children:(0,G.jsxs)(T,{color:`success`,children:[`Press `,(0,G.jsx)(T,{bold:!0,children:`s`}),` or `,(0,G.jsx)(T,{bold:!0,children:`Enter`}),` to save, `,(0,G.jsx)(T,{bold:!0,children:`e`}),` to save and edit`]})})]})})}var G,ur=e((()=>{k(),S(),At(),Ve(),Lt(),nt(),x(),W(),U(),Sn(),cr(),G=A()}));function dr({tools:e,existingAgents:t,onComplete:n}){let{wizardData:r}=V(),[i,a]=(0,fr.useState)(null),s=o(),c=(0,fr.useCallback)(async e=>{if(r?.finalAgent)try{await vn(r.location,r.finalAgent.agentType,r.finalAgent.whenToUse,r.finalAgent.tools,r.finalAgent.getSystemPrompt(),!0,r.finalAgent.color,r.finalAgent.model,r.finalAgent.memory),s(e=>{if(!r.finalAgent)return e;let t=e.agentDefinitions.allAgents.concat(r.finalAgent);return{...e,agentDefinitions:{...e.agentDefinitions,activeAgents:Je(t),allAgents:t}}}),et(),e&&await nn(pn({source:r.location,agentType:r.finalAgent.agentType})),Ft(`tengu_agent_created`,{agent_type:r.finalAgent.agentType,generation_method:r.wasGenerated?`generated`:`manual`,source:r.location,tool_count:r.finalAgent.tools?.length??`all`,has_custom_model:!!r.finalAgent.model,has_custom_color:!!r.finalAgent.color,has_memory:!!r.finalAgent.memory,memory_scope:r.finalAgent.memory??`none`,...e?{opened_in_editor:!0}:{}}),n(e?`Created agent: ${ct.bold(r.finalAgent.agentType)} and opened in editor. If you made edits, restart to load the latest version.`:`Created agent: ${ct.bold(r.finalAgent.agentType)}`)}catch(e){a(e instanceof Error?e.message:`Failed to save agent`)}},[r,n,s]);return(0,pr.jsx)(lr,{tools:e,existingAgents:t,onSave:(0,fr.useCallback)(()=>c(!1),[c]),onSaveAndEdit:(0,fr.useCallback)(()=>c(!0),[c]),error:i})}var fr,pr,mr=e((()=>{lt(),fr=t(O(),1),Pt(),Te(),He(),tn(),W(),Sn(),ur(),pr=A()}));function hr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=V(),[i,a]=(0,gr.useState)(r.whenToUse||``),[o,s]=(0,gr.useState)(i.length),[c,l]=(0,gr.useState)(null);return D(`confirm:no`,t,{context:`Settings`}),D(`chat:externalEditor`,(0,gr.useCallback)(async()=>{let e=await en(i);e.content!==null&&(a(e.content),s(e.content.length))},[i]),{context:`Chat`}),(0,K.jsx)(H,{subtitle:`Description (tell Work Mate when to use this agent)`,footerText:(0,K.jsxs)(E,{children:[(0,K.jsx)(C,{shortcut:`Type`,action:`enter text`}),(0,K.jsx)(C,{shortcut:`Enter`,action:`continue`}),(0,K.jsx)(d,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,K.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,K.jsxs)(w,{flexDirection:`column`,children:[(0,K.jsx)(T,{children:`When should Work Mate use this agent?`}),(0,K.jsx)(w,{marginTop:1,children:(0,K.jsx)(Pe,{value:i,onChange:a,onSubmit:t=>{let r=t.trim();if(!r){l(`Description is required`);return}l(null),n({whenToUse:r}),e()},placeholder:`e.g., use this agent after you're done writing code...`,columns:80,cursorOffset:o,onChangeCursorOffset:s,focus:!0,showCursor:!0})}),c&&(0,K.jsx)(w,{marginTop:1,children:(0,K.jsx)(T,{color:`error`,children:c})})]})})}var gr,K,_r=e((()=>{gr=t(O(),1),k(),S(),tn(),x(),Be(),W(),U(),K=A()}));async function vr(e,t,n,r){let i=he({content:`Create an agent configuration based on this request: "${e}".${n.length>0?`\n\nIMPORTANT: The following identifiers already exist and must NOT be used: ${n.join(`, `)}`:``}
8
- Return ONLY the JSON object, no other text.`}),a=await v(),o=Ze([i],a),s=jt()?yr+br:yr,c=await le({messages:b(o),systemPrompt:Ut([s]),thinkingConfig:{type:`disabled`},tools:[],signal:r,options:{getToolPermissionContext:async()=>Vt(),model:t,toolChoice:void 0,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,querySource:`agent_creation`,mcpTools:[]}}),l=(Array.isArray(c.message.content)?c.message.content:[]).filter(e=>e.type===`text`).map(e=>e.text).join(`
9
- `),u;try{u=ht(l.trim())}catch{let e=l.match(/\{[\s\S]*\}/);if(!e)throw Error(`No JSON object found in response`);u=ht(e[0])}if(!u.identifier||!u.whenToUse||!u.systemPrompt)throw Error(`Invalid agent configuration generated`);return Ft(`tengu_agent_definition_generated`,{agent_identifier:u.identifier}),{identifier:u.identifier,whenToUse:u.whenToUse,systemPrompt:u.systemPrompt}}var yr,br,xr=e((()=>{De(),Ce(),Ht(),Ct(),rt(),ie(),At(),Pt(),yt(),Me(),yr=`You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.
10
-
11
- **Important Context**: You may have access to project-specific instructions from AGENTS.md files and other context that may include coding standards, project structure, and custom requirements. Consider this context when creating agents to ensure they align with the project's established patterns and practices.
12
-
13
- When a user describes what they want an agent to do, you will:
14
-
15
- 1. **Extract Core Intent**: Identify the fundamental purpose, key responsibilities, and success criteria for the agent. Look for both explicit requirements and implicit needs. Consider any project-specific context from AGENTS.md files. For agents that are meant to review code, you should assume that the user is asking to review recently written code and not the whole codebase, unless the user has explicitly instructed you otherwise.
16
-
17
- 2. **Design Expert Persona**: Create a compelling expert identity that embodies deep domain knowledge relevant to the task. The persona should inspire confidence and guide the agent's decision-making approach.
18
-
19
- 3. **Architect Comprehensive Instructions**: Develop a system prompt that:
20
- - Establishes clear behavioral boundaries and operational parameters
21
- - Provides specific methodologies and best practices for task execution
22
- - Anticipates edge cases and provides guidance for handling them
23
- - Incorporates any specific requirements or preferences mentioned by the user
24
- - Defines output format expectations when relevant
25
- - Aligns with project-specific coding standards and patterns from AGENTS.md
26
-
27
- 4. **Optimize for Performance**: Include:
28
- - Decision-making frameworks appropriate to the domain
29
- - Quality control mechanisms and self-verification steps
30
- - Efficient workflow patterns
31
- - Clear escalation or fallback strategies
32
-
33
- 5. **Create Identifier**: Design a concise, descriptive identifier that:
34
- - Uses lowercase letters, numbers, and hyphens only
35
- - Is typically 2-4 words joined by hyphens
36
- - Clearly indicates the agent's primary function
37
- - Is memorable and easy to type
38
- - Avoids generic terms like "helper" or "assistant"
39
-
40
- 6 **Example agent descriptions**:
41
- - in the 'whenToUse' field of the JSON object, you should include examples of when this agent should be used.
42
- - examples should be of the form:
43
- - <example>
44
- Context: The user is creating a test-runner agent that should be called after a logical chunk of code is written.
45
- user: "Please write a function that checks if a number is prime"
46
- assistant: "Here is the relevant function: "
47
- <function call omitted for brevity only for this example>
48
- <commentary>
49
- Since a significant piece of code was written, use the ${Ot} tool to launch the test-runner agent to run the tests.
50
- </commentary>
51
- assistant: "Now let me use the test-runner agent to run the tests"
52
- </example>
53
- - <example>
54
- Context: User is creating an agent to respond to the word "hello" with a friendly jok.
55
- user: "Hello"
56
- assistant: "I'm going to use the ${Ot} tool to launch the greeting-responder agent to respond with a friendly joke"
57
- <commentary>
58
- Since the user is greeting, use the greeting-responder agent to respond with a friendly joke.
59
- </commentary>
60
- </example>
61
- - If the user mentioned or implied that the agent should be used proactively, you should include examples of this.
62
- - NOTE: Ensure that in the examples, you are making the assistant use the Agent tool and not simply respond directly to the task.
63
-
64
- Your output must be a valid JSON object with exactly these fields:
65
- {
66
- "identifier": "A unique, descriptive identifier using lowercase letters, numbers, and hyphens (e.g., 'test-runner', 'api-docs-writer', 'code-formatter')",
67
- "whenToUse": "A precise, actionable description starting with 'Use this agent when...' that clearly defines the triggering conditions and use cases. Ensure you include examples as described above.",
68
- "systemPrompt": "The complete system prompt that will govern the agent's behavior, written in second person ('You are...', 'You will...') and structured for maximum clarity and effectiveness"
69
- }
70
-
71
- Key principles for your system prompts:
72
- - Be specific rather than generic - avoid vague instructions
73
- - Include concrete examples when they would clarify behavior
74
- - Balance comprehensiveness with clarity - every instruction should add value
75
- - Ensure the agent has enough context to handle variations of the core task
76
- - Make the agent proactive in seeking clarification when needed
77
- - Build in quality assurance and self-correction mechanisms
78
-
79
- Remember: The agents you create should be autonomous experts capable of handling their designated tasks with minimal additional guidance. Your system prompts are their complete operational manual.
80
- `,br=`
81
-
82
- 7. **Agent Memory Instructions**: If the user mentions "memory", "remember", "learn", "persist", or similar concepts, OR if the agent would benefit from building up knowledge across conversations (e.g., code reviewers learning patterns, architects learning codebase structure, etc.), include domain-specific memory update instructions in the systemPrompt.
83
-
84
- Add a section like this to the systemPrompt, tailored to the agent's specific domain:
85
-
86
- "**Update your agent memory** as you discover [domain-specific items]. This builds up institutional knowledge across conversations. Write concise notes about what you found and where.
87
-
88
- Examples of what to record:
89
- - [domain-specific item 1]
90
- - [domain-specific item 2]
91
- - [domain-specific item 3]"
92
-
93
- Examples of domain-specific memory instructions:
94
- - For a code-reviewer: "Update your agent memory as you discover code patterns, style conventions, common issues, and architectural decisions in this codebase."
95
- - For a test-runner: "Update your agent memory as you discover test patterns, common failure modes, flaky tests, and testing best practices."
96
- - For an architect: "Update your agent memory as you discover codepaths, library locations, key architectural decisions, and component relationships."
97
- - For a documentation writer: "Update your agent memory as you discover documentation patterns, API structures, and terminology conventions."
98
-
99
- The memory instructions should be specific to what the agent would naturally learn while performing its core tasks.
100
- `}));function Sr(){let{updateWizardData:e,goBack:t,goToStep:n,wizardData:r}=V(),[i,a]=(0,q.useState)(r.generationPrompt||``),[o,s]=(0,q.useState)(!1),[c,l]=(0,q.useState)(null),[u,f]=(0,q.useState)(i.length),p=rn(),m=(0,q.useRef)(null);D(`confirm:no`,(0,q.useCallback)(()=>{m.current&&(m.current.abort(),m.current=null,s(!1),l(`Generation cancelled`))},[]),{context:`Settings`,isActive:o}),D(`chat:externalEditor`,(0,q.useCallback)(async()=>{let e=await en(i);e.content!==null&&(a(e.content),f(e.content.length))},[i]),{context:`Chat`,isActive:!o}),D(`confirm:no`,(0,q.useCallback)(()=>{e({generationPrompt:``,agentType:``,systemPrompt:``,whenToUse:``,generatedAgent:void 0,wasGenerated:!1}),a(``),l(null),t()},[e,t]),{context:`Settings`,isActive:!o});let h=async()=>{let t=i.trim();if(!t){l(`Please describe what the agent should do`);return}l(null),s(!0),e({generationPrompt:t,isGenerating:!0});let r=se();m.current=r;try{let i=await vr(t,p,[],r.signal);e({agentType:i.identifier,whenToUse:i.whenToUse,systemPrompt:i.systemPrompt,generatedAgent:i,isGenerating:!1,wasGenerated:!0}),n(6)}catch(t){t instanceof vt||t instanceof Error&&!t.message.includes(`No assistant message found`)&&l(t.message||`Failed to generate agent`),e({isGenerating:!1})}finally{s(!1),m.current=null}},g=`Describe what this agent should do and when it should be used (be comprehensive for best results)`;return o?(0,J.jsx)(H,{subtitle:g,footerText:(0,J.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`}),children:(0,J.jsxs)(w,{flexDirection:`row`,alignItems:`center`,children:[(0,J.jsx)(oe,{}),(0,J.jsx)(T,{color:`suggestion`,children:` Generating agent from description...`})]})}):(0,J.jsx)(H,{subtitle:g,footerText:(0,J.jsxs)(E,{children:[(0,J.jsx)(d,{action:`confirm:yes`,context:`Confirmation`,fallback:`Enter`,description:`submit`}),(0,J.jsx)(d,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,J.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,J.jsxs)(w,{flexDirection:`column`,children:[c&&(0,J.jsx)(w,{marginBottom:1,children:(0,J.jsx)(T,{color:`error`,children:c})}),(0,J.jsx)(Pe,{value:i,onChange:a,onSubmit:h,placeholder:`e.g., Help me write unit tests for my code...`,columns:80,cursorOffset:u,onChangeCursorOffset:f,focus:!0,showCursor:!0})]})})}var q,J,Cr=e((()=>{_t(),q=t(O(),1),an(),k(),S(),f(),tn(),x(),ce(),Be(),W(),U(),xr(),J=A()}));function wr(){let{goNext:e,updateWizardData:t,cancel:n}=V();return(0,Y.jsx)(H,{subtitle:`Choose location`,footerText:(0,Y.jsxs)(E,{children:[(0,Y.jsx)(C,{shortcut:`↑↓`,action:`navigate`}),(0,Y.jsx)(C,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,Y.jsx)(w,{children:(0,Y.jsx)(pe,{options:[{label:`Project (.workmate/agents/)`,value:`projectSettings`},{label:`Personal (~/.workmate/agents/)`,value:`userSettings`}],onChange:n=>{t({location:n}),e()},onCancel:()=>n()},`location-select`)})})}var Y,Tr=e((()=>{k(),x(),l(),W(),U(),Y=A()}));function Er(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=V();D(`confirm:no`,t,{context:`Confirmation`});let i=r.location===`userSettings`?[{label:`User scope (~/.workmate/agent-memory/) (Recommended)`,value:`user`},{label:`None (no persistent memory)`,value:`none`},{label:`Project scope (.workmate/agent-memory/)`,value:`project`},{label:`Local scope (.workmate/agent-memory-local/)`,value:`local`}]:[{label:`Project scope (.workmate/agent-memory/) (Recommended)`,value:`project`},{label:`None (no persistent memory)`,value:`none`},{label:`User scope (~/.workmate/agent-memory/)`,value:`user`},{label:`Local scope (.workmate/agent-memory-local/)`,value:`local`}];return(0,X.jsx)(H,{subtitle:`Configure agent memory`,footerText:(0,X.jsxs)(E,{children:[(0,X.jsx)(C,{shortcut:`↑↓`,action:`navigate`}),(0,X.jsx)(C,{shortcut:`Enter`,action:`select`}),(0,X.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,X.jsx)(w,{children:(0,X.jsx)(pe,{options:i,onChange:t=>{let i=t===`none`?void 0:t,a=r.finalAgent?.agentType;n({selectedMemory:i,finalAgent:r.finalAgent?{...r.finalAgent,memory:i,getSystemPrompt:jt()&&i&&a?()=>`${r.systemPrompt}\n\n${Ye(a,i)}`:()=>r.systemPrompt}:void 0}),e()},onCancel:t},`memory-select`)})})}var X,Dr=e((()=>{k(),S(),At(),Ve(),x(),l(),W(),U(),X=A()}));function Or(){let{goNext:e,goBack:t,updateWizardData:n,goToStep:r}=V();return(0,kr.jsx)(H,{subtitle:`Creation method`,footerText:(0,kr.jsxs)(E,{children:[(0,kr.jsx)(C,{shortcut:`↑↓`,action:`navigate`}),(0,kr.jsx)(C,{shortcut:`Enter`,action:`select`}),(0,kr.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,kr.jsx)(w,{children:(0,kr.jsx)(pe,{options:[{label:`Generate with Work Mate (recommended)`,value:`generate`},{label:`Manual configuration`,value:`manual`}],onChange:t=>{let i=t;n({method:i,wasGenerated:i===`generate`}),i===`generate`?e():r(3)},onCancel:()=>t()},`method-select`)})})}var kr,Ar=e((()=>{k(),x(),l(),W(),U(),kr=A()}));function jr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=V();return(0,Mr.jsx)(H,{subtitle:`Select model`,footerText:(0,Mr.jsxs)(E,{children:[(0,Mr.jsx)(C,{shortcut:`↑↓`,action:`navigate`}),(0,Mr.jsx)(C,{shortcut:`Enter`,action:`select`}),(0,Mr.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Mr.jsx)(kn,{initialModel:r.selectedModel,onComplete:t=>{n({selectedModel:t}),e()},onCancel:t})})}var Mr,Nr=e((()=>{x(),k(),W(),U(),Mn(),Mr=A()}));function Pr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=V(),[i,a]=(0,Fr.useState)(r.systemPrompt||``),[o,s]=(0,Fr.useState)(i.length),[c,l]=(0,Fr.useState)(null);return D(`confirm:no`,t,{context:`Settings`}),D(`chat:externalEditor`,(0,Fr.useCallback)(async()=>{let e=await en(i);e.content!==null&&(a(e.content),s(e.content.length))},[i]),{context:`Chat`}),(0,Z.jsx)(H,{subtitle:`System prompt`,footerText:(0,Z.jsxs)(E,{children:[(0,Z.jsx)(C,{shortcut:`Type`,action:`enter text`}),(0,Z.jsx)(C,{shortcut:`Enter`,action:`continue`}),(0,Z.jsx)(d,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Z.jsxs)(w,{flexDirection:`column`,children:[(0,Z.jsx)(T,{children:`Enter the system prompt for your agent:`}),(0,Z.jsx)(T,{dimColor:!0,children:`Be comprehensive for best results`}),(0,Z.jsx)(w,{marginTop:1,children:(0,Z.jsx)(Pe,{value:i,onChange:a,onSubmit:()=>{let t=i.trim();if(!t){l(`System prompt is required`);return}l(null),n({systemPrompt:t}),e()},placeholder:`You are a helpful code reviewer who...`,columns:80,cursorOffset:o,onChangeCursorOffset:s,focus:!0,showCursor:!0})}),c&&(0,Z.jsx)(w,{marginTop:1,children:(0,Z.jsx)(T,{color:`error`,children:c})})]})})}var Fr,Z,Ir=e((()=>{Fr=t(O(),1),k(),S(),tn(),x(),Be(),W(),U(),Z=A()}));function Lr({tools:e}){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=V(),a=e=>{r({selectedTools:e}),t()},o=i.selectedTools;return(0,Rr.jsx)(H,{subtitle:`Select tools`,footerText:(0,Rr.jsxs)(E,{children:[(0,Rr.jsx)(C,{shortcut:`Enter`,action:`toggle selection`}),(0,Rr.jsx)(C,{shortcut:`↑↓`,action:`navigate`}),(0,Rr.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Rr.jsx)(Fn,{tools:e,initialTools:o,onComplete:a,onCancel:n})})}var Rr,zr=e((()=>{k(),x(),W(),U(),In(),Rr=A()}));function Br(e){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=V(),[a,o]=(0,Vr.useState)(i.agentType||``),[s,c]=(0,Vr.useState)(null),[l,u]=(0,Vr.useState)(a.length);return D(`confirm:no`,n,{context:`Settings`}),(0,Q.jsx)(H,{subtitle:`Agent type (identifier)`,footerText:(0,Q.jsxs)(E,{children:[(0,Q.jsx)(C,{shortcut:`Type`,action:`enter text`}),(0,Q.jsx)(C,{shortcut:`Enter`,action:`continue`}),(0,Q.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Q.jsxs)(w,{flexDirection:`column`,children:[(0,Q.jsx)(T,{children:`Enter a unique identifier for your agent:`}),(0,Q.jsx)(w,{marginTop:1,children:(0,Q.jsx)(Pe,{value:a,onChange:o,onSubmit:e=>{let n=e.trim(),i=or(n);if(i){c(i);return}c(null),r({agentType:n}),t()},placeholder:`e.g., test-runner, tech-lead, etc`,columns:60,cursorOffset:l,onChangeCursorOffset:u,focus:!0,showCursor:!0})}),s&&(0,Q.jsx)(w,{marginTop:1,children:(0,Q.jsx)(T,{color:`error`,children:s})})]})})}var Vr,Q,Hr=e((()=>{Vr=t(O(),1),k(),S(),x(),Be(),W(),U(),cr(),Q=A()}));function Ur({tools:e,existingAgents:t,onComplete:n,onCancel:r}){return(0,Wr.jsx)(qn,{steps:[wr,Or,Sr,()=>(0,Wr.jsx)(Br,{existingAgents:t}),Pr,hr,()=>(0,Wr.jsx)(Lr,{tools:e}),jr,rr,...jt()?[Er]:[],()=>(0,Wr.jsx)(dr,{tools:e,existingAgents:t,onComplete:n})],initialData:{},onComplete:()=>{},onCancel:r,title:`Create new agent`,showStepCounter:!1})}var Wr,Gr=e((()=>{At(),W(),ar(),mr(),_r(),Cr(),Tr(),Dr(),Ar(),Nr(),Ir(),zr(),Hr(),Wr=A()}));function Kr({tools:e,onExit:t}){let[n,r]=(0,qr.useState)({mode:`list-agents`,source:`all`}),i=ke(e=>e.agentDefinitions),a=ke(e=>e.mcp.tools),s=ke(e=>e.toolPermissionContext),c=o(),{allAgents:l,activeAgents:u}=i,[d,f]=(0,qr.useState)([]),p=Qt(e,a,s);Xt();let m=(0,qr.useMemo)(()=>({"built-in":l.filter(e=>e.source===`built-in`),userSettings:l.filter(e=>e.source===`userSettings`),projectSettings:l.filter(e=>e.source===`projectSettings`),policySettings:l.filter(e=>e.source===`policySettings`),localSettings:l.filter(e=>e.source===`localSettings`),flagSettings:l.filter(e=>e.source===`flagSettings`),plugin:l.filter(e=>e.source===`plugin`),all:l}),[l]),h=(0,qr.useCallback)(e=>{f(t=>[...t,e]),r({mode:`list-agents`,source:`all`})},[]),g=(0,qr.useCallback)(async e=>{try{await bn(e),c(t=>{let n=t.agentDefinitions.allAgents.filter(t=>!(t.agentType===e.agentType&&t.source===e.source));return{...t,agentDefinitions:{...t.agentDefinitions,allAgents:n,activeAgents:Je(n)}}}),f(t=>[...t,`Deleted agent: ${ct.bold(e.agentType)}`]),r({mode:`list-agents`,source:`all`})}catch(e){Nt(gt(e))}},[c]);switch(n.mode){case`list-agents`:{let e=qt(n.source===`all`?[...m[`built-in`],...m.userSettings,...m.projectSettings,...m.localSettings,...m.policySettings,...m.flagSettings,...m.plugin]:m[n.source],u);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Wn,{source:n.source,agents:e,onBack:()=>{t((d.length>0?`Agent changes:\n${d.join(`
101
- `)}`:void 0)??`Agents dialog dismissed`,{display:d.length===0?`system`:void 0})},onSelect:e=>r({mode:`agent-menu`,agent:e,previousMode:n}),onCreateNew:()=>r({mode:`create-agent`}),changes:d}),(0,$.jsx)(Vn,{})]})}case`create-agent`:return(0,$.jsx)(Ur,{tools:p,existingAgents:u,onComplete:h,onCancel:()=>r({mode:`list-agents`,source:`all`})});case`agent-menu`:{let e=l.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent,t=[{label:`View agent`,value:`view`},...e.source!==`built-in`&&e.source!==`plugin`&&e.source!==`flagSettings`?[{label:`Edit agent`,value:`edit`},{label:`Delete agent`,value:`delete`}]:[],{label:`Back`,value:`back`}];return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ut,{title:n.agent.agentType,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsxs)(w,{flexDirection:`column`,children:[(0,$.jsx)(pe,{options:t,onChange:t=>{switch(t){case`view`:r({mode:`view-agent`,agent:e,previousMode:n.previousMode});break;case`edit`:r({mode:`edit-agent`,agent:e,previousMode:n});break;case`delete`:r({mode:`delete-confirm`,agent:e,previousMode:n});break;case`back`:r(n.previousMode);break}},onCancel:()=>r(n.previousMode)}),d.length>0&&(0,$.jsx)(w,{marginTop:1,children:(0,$.jsx)(T,{dimColor:!0,children:d[d.length-1]})})]})}),(0,$.jsx)(Vn,{})]})}case`view-agent`:{let e=l.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ut,{title:e.agentType,onCancel:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode}),hideInputGuide:!0,children:(0,$.jsx)(Cn,{agent:e,tools:p,allAgents:l,onBack:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode})})}),(0,$.jsx)(Vn,{instructions:`Press Enter or Esc to go back`})]})}case`delete-confirm`:return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(ut,{title:`Delete agent`,onCancel:()=>{`previousMode`in n&&r(n.previousMode)},color:`error`,children:[(0,$.jsxs)(T,{children:[`Are you sure you want to delete the agent `,(0,$.jsx)(T,{bold:!0,children:n.agent.agentType}),`?`]}),(0,$.jsx)(w,{marginTop:1,children:(0,$.jsxs)(T,{dimColor:!0,children:[`Source: `,n.agent.source]})}),(0,$.jsx)(w,{marginTop:1,children:(0,$.jsx)(pe,{options:[{label:`Yes, delete`,value:`yes`},{label:`No, cancel`,value:`no`}],onChange:e=>{e===`yes`?g(n.agent):`previousMode`in n&&r(n.previousMode)},onCancel:()=>{`previousMode`in n&&r(n.previousMode)}})})]}),(0,$.jsx)(Vn,{instructions:`Press ↑↓ to navigate, Enter to select, Esc to cancel`})]});case`edit-agent`:{let e=l.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ut,{title:`Edit agent: ${e.agentType}`,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsx)(zn,{agent:e,tools:p,onSaved:e=>{h(e),r(n.previousMode)},onBack:()=>r(n.previousMode)})}),(0,$.jsx)(Vn,{})]})}default:return null}}var qr,$,Jr=e((()=>{lt(),qr=t(O(),1),Zt(),$t(),k(),Te(),Gt(),He(),mt(),Mt(),l(),wn(),Bn(),Un(),Kn(),Sn(),Gr(),$=A()}));async function Yr(e,t){let n=t.getAppState().toolPermissionContext;return(0,Xr.jsx)(Kr,{tools:te(n),onExit:e})}var Xr;e((()=>{Jr(),We(),Xr=A()}))();export{Yr as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ox as t,jx as n}from"./loadAgentsDir-DXOkUcW3.js";import{h as r,l as i}from"./settings-3xZ0fsvE.js";function a(){let e=i(),n=[`user`,`project`,`local`].flatMap(e=>t(e).errors);return{settings:e.settings,errors:[...e.errors,...n]}}var o=e((()=>{n(),r()}));export{o as n,a as t};
@@ -1 +0,0 @@
1
- import{a as e,o as t}from"./api-C5ULzZny.js";t();export{e as getOAuthHeaders};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";var t;e((()=>{t=()=>{}}))();export{t as clearAttributionCaches};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./auth-DvcZHXGk.js";export{t as authLogin,e as authStatus};
@@ -1 +0,0 @@
1
- import{At as e,Pt as t,St as n,ct as r,pt as i}from"./model-Cxx3suBa.js";t();export{r as checkAndRefreshOAuthTokenIfNeeded,i as clearOAuthTokenCache,n as getClaudeAIOAuthTokens,e as handleOAuth401Error};
@@ -1,17 +0,0 @@
1
- import{i as e,o as t}from"./envUtils-DcaKZlRU.js";import{Bd as n,Cc as r,Fb as i,La as a,Pb as o,Q as s,Qf as c,SC as l,Sa as ee,St as u,Ta as d,X as f,bC as te,br as ne,by as p,cm as m,dt as h,ep as g,lr as _,wa as v,wc as re,zd as ie}from"./loadAgentsDir-DXOkUcW3.js";import{L as y,U as b,Ut as x}from"./state-D5D6QpTX.js";import{n as ae,t as oe}from"./cwd-Nh5IZNKO.js";import{R as S,U as C,c as w,f as T,i as E,u as D,x as O}from"./debug-D58GQBDG.js";import{d as k,h as A,v as j}from"./settings-3xZ0fsvE.js";import{S as M}from"./config-DRy1I12M.js";import{o as N,s as P,v as F,y as I}from"./log-CZ7ploQm.js";import{n as L,r as R}from"./analytics-DJobLaWP.js";import{_ as z,h as B}from"./model-Cxx3suBa.js";import{_n as V,vn as H}from"./prompt-DEioJrx_.js";import{Q as U}from"./sessionState-DAcub-HK.js";import{i as W,t as G}from"./nativeInstaller-CaXwRpoR.js";import{n as se,t as K}from"./allErrors-C_iHQOlK.js";import{r as ce}from"./magicDocs-rxv0rR8E.js";import{n as le,t as ue}from"./pluginAutoupdate-C2YbEHrP.js";import{n as de}from"./registerProtocol-Xsq4ldwg.js";import"os";import{join as q}from"path";import"crypto";t(),x(),ae(),O(),T(),E(),I(),A(),H(),z(),re(),ne(),ce(),f(),N(),S(),a(),p(),f(),i(),S(),N(),a(),p(),m();async function fe(e,t){if(!e)return;let{join:n}=await import(`path`),r=await import(`fs/promises`),i=n(oe(),`.workmate`,`skills`,e,`SKILL.md`),a;try{a=await r.readFile(i,`utf-8`)}catch{P(Error(`Failed to read skill file for improvement: ${i}`));return}let c=t.map(e=>`- ${e.section}: ${e.change}`).join(`
2
- `),l=B(),u=await s({messages:[ee({content:`You are editing a skill definition file. Apply the following improvements to the skill.
3
-
4
- <current_skill_file>
5
- ${a}
6
- </current_skill_file>
7
-
8
- <improvements>
9
- ${c}
10
- </improvements>
11
-
12
- Rules:
13
- - Integrate the improvements naturally into the existing structure
14
- - Preserve frontmatter (--- block) exactly as-is
15
- - Preserve the overall format and style
16
- - Do not remove existing content unless an improvement explicitly replaces it
17
- - Output the complete updated file inside <updated_file> tags`})],systemPrompt:U([`You edit skill definition files to incorporate user preferences. Output only the updated file content.`]),thinkingConfig:{type:`disabled`},tools:[],signal:o().signal,options:{getToolPermissionContext:async()=>V(),model:l,toolChoice:void 0,isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,temperatureOverride:0,agents:[],querySource:`skill_improvement_apply`,mcpTools:[]}}),f=v(d(Array.isArray(u.message.content)?u.message.content:[]).trim(),`updated_file`);if(!f){P(Error(`Skill improvement apply: no updated_file tag in response`));return}try{await r.writeFile(i,f,`utf-8`)}catch(e){P(C(e))}}L(),g(),M(),N(),G(),n(),se(),l(),u();var pe=30;function J(){let e=((k()||{}).cleanupPeriodDays??pe)*24*60*60*1e3;return new Date(Date.now()-e)}function me(e,t){return{messages:e.messages+t.messages,errors:e.errors+t.errors}}function he(e){let t=e.split(`.`)[0].replace(/T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z/,`T$1:$2:$3.$4Z`);return new Date(t)}async function Y(e,t,n){let r={messages:0,errors:0};try{let i=await D().readdir(e);for(let a of i)try{he(a.name)<t&&(await D().unlink(q(e,a.name)),n?r.messages++:r.errors++)}catch(e){P(e)}}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&P(e)}return r}async function ge(){let e=D(),t=J(),n=F.errors(),r=F.baseLogs(),i=await Y(n,t,!1);try{let n;try{n=await e.readdir(r)}catch{return i}let a=n.filter(e=>e.isDirectory()&&e.name.startsWith(`mcp-logs-`)).map(e=>q(r,e.name));for(let n of a)i=me(i,await Y(n,t,!0)),await Z(n,e)}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&P(e)}return i}async function X(e,t,n){return(await n.stat(e)).mtime<t?(await n.unlink(e),!0):!1}async function Z(e,t){try{await t.rmdir(e)}catch{}}async function _e(){let e=J(),t={messages:0,errors:0},n=_(),r=D(),i;try{i=await r.readdir(n)}catch{return t}for(let a of i){if(!a.isDirectory())continue;let i=q(n,a.name),o;try{o=await r.readdir(i)}catch{t.errors++;continue}for(let n of o)if(n.isFile()){if(!n.name.endsWith(`.jsonl`)&&!n.name.endsWith(`.cast`))continue;try{await X(q(i,n.name),e,r)&&t.messages++}catch{t.errors++}}else if(n.isDirectory()){let a=q(i,n.name),o=q(a,te),s;try{s=await r.readdir(o)}catch{await Z(a,r);continue}for(let n of s)if(n.isFile())try{await X(q(o,n.name),e,r)&&t.messages++}catch{t.errors++}else if(n.isDirectory()){let i=q(o,n.name),a;try{a=await r.readdir(i)}catch{continue}for(let n of a)if(n.isFile())try{await X(q(i,n.name),e,r)&&t.messages++}catch{t.errors++}await Z(i,r)}await Z(o,r),await Z(a,r)}await Z(i,r)}return t}async function Q(e,t,n=!0){let r=J(),i={messages:0,errors:0},a=D(),o;try{o=await a.readdir(e)}catch{return i}for(let n of o)if(!(!n.isFile()||!n.name.endsWith(t)))try{await X(q(e,n.name),r,a)&&i.messages++}catch{i.errors++}return n&&await Z(e,a),i}function ve(){return Q(q(e(),`plans`),`.md`)}async function ye(){let t=J(),n={messages:0,errors:0},r=D();try{let i=q(e(),`file-history`),a;try{a=await r.readdir(i)}catch{return n}let o=a.filter(e=>e.isDirectory()).map(e=>q(i,e.name));await Promise.all(o.map(async e=>{try{(await r.stat(e)).mtime<t&&(await r.rm(e,{recursive:!0,force:!0}),n.messages++)}catch{n.errors++}})),await Z(i,r)}catch(e){P(e)}return n}async function be(){let t=J(),n={messages:0,errors:0},r=D();try{let i=q(e(),`session-env`),a;try{a=await r.readdir(i)}catch{return n}let o=a.filter(e=>e.isDirectory()).map(e=>q(i,e.name));for(let e of o)try{(await r.stat(e)).mtime<t&&(await r.rm(e,{recursive:!0,force:!0}),n.messages++)}catch{n.errors++}await Z(i,r)}catch(e){P(e)}return n}async function xe(){let t=J(),n={messages:0,errors:0},r=D(),i=q(e(),`debug`),a;try{a=await r.readdir(i)}catch{return n}for(let e of a)if(!(!e.isFile()||!e.name.endsWith(`.txt`)||e.name===`latest`))try{await X(q(i,e.name),t,r)&&n.messages++}catch{n.errors++}return n}async function Se(){let{errors:e}=K();if(e.length>0&&j(`cleanupPeriodDays`)){w(`Skipping cleanup: settings have validation errors but cleanupPeriodDays was explicitly set. Fix settings errors to enable cleanup.`);return}await ge(),await _e(),await ve(),await ye(),await be(),await xe(),await c(),await ie(J());let t=await h(J());t>0&&R(`tengu_worktree_cleanup`,{removed:t})}x(),G(),le();var $=600*1e3;function Ce(){import(`./extractMemories-B_8wZpXA.js`).then(({initExtractMemories:e})=>{e()}).catch(()=>{}),r(),ue(),y()&&de();let e=!0;async function t(){if(y()&&b()>Date.now()-1e3*60){setTimeout(t,$).unref();return}if(e&&(e=!1,await Se()),y()&&b()>Date.now()-1e3*60){setTimeout(t,$).unref();return}await W()}setTimeout(t,$).unref()}export{fe as n,Ce as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./backgroundHousekeeping-BGKR5cdA.js";export{e as startBackgroundHousekeeping};
@@ -1 +0,0 @@
1
- import{a as e,n as t,o as n,t as r}from"./bridgeConfig-MxsnEEPx.js";e();export{r as getBridgeAccessToken,t as getBridgeBaseUrl,n as isSelfHostedBridge};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Fb as n,J_ as r,La as i,Lu as a,Pb as o,Ru as s,Sp as c,Y_ as l,at as u,by as d,cc as f,gC as p,ka as m,lc as h,ot as g,q_ as _,wp as v}from"./loadAgentsDir-DXOkUcW3.js";import{I as y,P as b,ai as x,bn as S,ot as C,t as w,vn as T,xt as E}from"./src-DL3w8VPk2.js";import{t as D}from"./jsx-runtime-Bb4Xn-E0.js";import{P as O,R as k}from"./debug-D58GQBDG.js";import{Ut as A}from"./settings-3xZ0fsvE.js";import{h as j,y as M}from"./config-DRy1I12M.js";import{Q as N}from"./sessionState-DAcub-HK.js";import{n as P,r as F}from"./sideQuestion-Ct87yvOR.js";import{i as I,n as L}from"./modalContext-wY9CeN4G.js";function R({question:e,context:t,onDone:n}){let[r,i]=(0,H.useState)(null),[s,l]=(0,H.useState)(null),[u,d]=(0,H.useState)(0),f=(0,H.useRef)(null),{rows:p}=I(C());S(()=>d(e=>e+1),r||s?null:80);function m(e){if(e.key===`escape`||e.key===`return`||e.key===` `||e.ctrl&&(e.key===`c`||e.key===`d`)){e.preventDefault(),n(void 0,{display:`skip`});return}(e.key===`up`||e.ctrl&&e.key===`p`)&&(e.preventDefault(),f.current?.scrollBy(-3)),(e.key===`down`||e.ctrl&&e.key===`n`)&&(e.preventDefault(),f.current?.scrollBy(K))}(0,H.useEffect)(()=>{let n=o();async function r(){try{let r=await F({question:e,cacheSafeParams:await B(t)});n.signal.aborted||(r.response?i(r.response):l(`No response received`))}catch(e){n.signal.aborted||l(O(e)||`Failed to get response`)}}return r(),()=>{n.abort()}},[e,t]);let h=Math.max(5,p-W-G);return(0,U.jsxs)(y,{flexDirection:`column`,paddingLeft:2,marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:m,children:[(0,U.jsxs)(y,{children:[(0,U.jsxs)(b,{color:`warning`,bold:!0,children:[`/btw`,` `]}),(0,U.jsx)(b,{dimColor:!0,children:e})]}),(0,U.jsx)(y,{marginTop:1,marginLeft:2,maxHeight:h,children:(0,U.jsx)(E,{ref:f,flexDirection:`column`,flexGrow:1,children:s?(0,U.jsx)(b,{color:`error`,children:s}):r?(0,U.jsx)(c,{children:r}):(0,U.jsxs)(y,{children:[(0,U.jsx)(a,{frame:u,messageColor:`warning`}),(0,U.jsx)(b,{color:`warning`,children:`Answering...`})]})})}),(r||s)&&(0,U.jsx)(y,{marginTop:1,children:(0,U.jsxs)(b,{dimColor:!0,children:[`↑`,`/`,`↓`,` to scroll · Space, Enter, or Escape to dismiss`]})})]})}function z(e){let t=e.at(-1);return t?.type===`assistant`&&t.message.stop_reason===null?e.slice(0,-1):e}async function B(e){let t=m(z(e.messages)),n=f();if(n)return{systemPrompt:n.systemPrompt,userContext:n.userContext,systemContext:n.systemContext,toolUseContext:e,forkContextMessages:t};let[i,a,o]=await Promise.all([u(e.options.tools,e.options.mainLoopModel,[],e.options.mcpClients),r(),_()]);return{systemPrompt:N(i),userContext:a,systemContext:o,toolUseContext:e,forkContextMessages:t}}async function V(e,t,n){let r=n?.trim();return r?(M(e=>({...e,btwUseCount:e.btwUseCount+1})),(0,U.jsx)(R,{question:r,context:t,onDone:e})):(e(`Usage: /btw <your question>`,{display:`system`}),null)}var H,U,W,G,K;e((()=>{H=t(x(),1),T(),v(),s(),A(),g(),L(),l(),p(),w(),n(),j(),k(),h(),i(),P(),d(),U=D(),W=5,G=6,K=3}))();export{V as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$f as t,Di as n,Ds as r,Du as i,Eu as a,G as o,Im as s,J_ as c,K_ as l,Ki as u,Ky as d,Li as f,MC as p,Os as m,Pm as h,Q_ as g,Sh as _,Sv as v,X_ as y,Xi as b,Y_ as x,Z_ as S,bv as C,ep as w,jC as T,q as E,q_ as D,qy as O,rm as k,xh as A}from"./loadAgentsDir-DXOkUcW3.js";import{Dn as j,Ut as M,l as N}from"./state-D5D6QpTX.js";import{S as P,v as F}from"./git-By_J4XJL.js";import{i as I,t as L}from"./detectRepository-CDOJ-M7h.js";import{a as R,n as z}from"./fileSuggestions-Ct7vKEpR.js";import{r as B,t as V}from"./magicDocs-rxv0rR8E.js";function H(e=new Set){let r=e.size>0;c.cache.clear?.(),D.cache.clear?.(),l.cache.clear?.(),S.cache.clear?.(),z(),n(),r||v(),y(null),j(null),s(),m(),O(`session_start`),t(),a(),import(`./attributionHooks-C0aXyx9L.js`).then(({clearAttributionCaches:e})=>e()),L(),o(),N(e),F(),u(),_(),V(),T(),import(`./SearchExtraToolsTool-CdgQlm--.js`).then(({clearSearchExtraToolsDescriptionCache:e})=>e()),import(`./loadAgentsDir-Dxz1vp3F.js`).then(({clearAgentDefinitionsCache:e})=>e()),import(`./prompt-C50mDqWv.js`).then(({clearPromptCache:e})=>e())}var U=e((()=>{M(),f(),g(),x(),R(),k(),C(),i(),h(),A(),B(),b(),r(),E(),d(),I(),P(),w(),p()}));export{U as n,H as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./caches-BiVRgePi.js";e();export{t as clearSessionCaches};
@@ -1 +0,0 @@
1
- import{Dr as e,Or as t}from"./model-Cxx3suBa.js";t();export{e as getOrganizationUUID};
@@ -1 +0,0 @@
1
- import{Di as e,Li as t,Mi as n}from"./loadAgentsDir-DXOkUcW3.js";t();export{e as clearCommandsCache,n as getCommands};
@@ -1,2 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$_ as t,Am as n,G_ as r,Im as i,J_ as a,La as o,Om as s,Pm as c,W_ as l,Y_ as u,_p as d,at as f,bv as p,ev as m,fv as h,hC as g,hn as _,iv as v,ka as y,l_ as b,mC as x,o_ as S,ot as C,q_ as w,rv as T,s_ as E,u_ as D,vp as O,vv as k,xv as A}from"./loadAgentsDir-DXOkUcW3.js";import{di as j,fi as M}from"./src-DL3w8VPk2.js";import{Kt as N,Ut as P}from"./state-D5D6QpTX.js";import{L as F,R as I}from"./debug-D58GQBDG.js";import{o as L,s as R}from"./log-CZ7ploQm.js";function z(e,t){let n=d(`tip`),r=x(`app:toggleTranscript`,`Global`,`ctrl+o`),i=[...e.options.verbose?[]:[`(${r} to see full summary)`],...t?[t]:[],...n?[n]:[]];return j.dim(`Compacted ${i.join(`
2
- `)}`)}async function B(e,t){let n=e.getAppState(),r=await f(e.options.tools,e.options.mainLoopModel,Array.from(n.toolPermissionContext.additionalWorkingDirectories.keys()),e.options.mcpClients),i=l({mainThreadAgentDefinition:void 0,toolUseContext:e,customSystemPrompt:e.options.customSystemPrompt,defaultSystemPrompt:r,appendSystemPrompt:e.options.appendSystemPrompt}),[o,s]=await Promise.all([a(),w()]);return{systemPrompt:i,userContext:o,systemContext:s,toolUseContext:e,forkContextMessages:t}}var V;e((()=>{M(),P(),C(),u(),g(),p(),D(),T(),t(),c(),s(),h(),I(),_(),L(),o(),O(),r(),V=async(e,t)=>{let{abortController:r}=t,{messages:o}=t;if(o=y(o),o.length===0)throw Error(`No messages to compact`);let s=e.trim();try{if(!s){let e=await n(o,t.agentId);if(e)return a.cache.clear?.(),i(),A(t.options.querySource??`compact`,t.agentId),N(),v(),{type:`compact`,compactionResult:e,displayText:z(t)}}let e=(await m(o,t)).messages,r=await b(e,t,await B(t,e),!1,s,!1);return k(void 0),v(),a.cache.clear?.(),i(),{type:`compact`,compactionResult:r,displayText:z(t,r.userDisplayMessage)}}catch(e){throw r.signal.aborted?Error(`Compaction canceled.`):F(e,`Not enough messages to compact. Send a few more messages first, then try again.`)?Error(E):F(e,`Compaction interrupted · This may be due to network issues — please try again.`)?Error(S):(R(e),Error(`Error during compaction: ${e}`))}}}))();export{V as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Settings-CsOlPcIW.js";var i,a;e((()=>{n(),i=t(),a=async(e,t)=>(0,i.jsx)(r,{onClose:e,context:t,defaultTab:`Config`})}))();export{a as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{$_ as r,La as i,U_ as a,V_ as o,ev as s,ka as c}from"./loadAgentsDir-DXOkUcW3.js";import{I as l,P as u,s as d,t as f}from"./src-DL3w8VPk2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{Cn as m,bn as h,cn as g,sn as _}from"./settings-3xZ0fsvE.js";import{_ as v,v as y}from"./startupProfiler-CbzxVmbv.js";import{Et as b,Ot as x,Yt as S,in as C,rn as w,tn as T}from"./prompt-DEioJrx_.js";import{n as E,t as D}from"./staticRender-D9AbnQFr.js";function O(e){let t=[];return k(e,t),A(e,t),M(e,t),N(e,t),ee(e,t),t.sort((e,t)=>e.severity===t.severity?(t.savingsTokens??0)-(e.savingsTokens??0):e.severity===`warning`?-1:1),t}function k(e,t){e.percentage>=L&&t.push({severity:`warning`,title:`Context is ${e.percentage}% full`,detail:e.isAutoCompactEnabled?`Autocompact will trigger soon, which discards older messages. Use /compact now to control what gets kept.`:`Autocompact is disabled. Use /compact to free space, or enable autocompact in /config.`})}function A(e,t){if(e.messageBreakdown)for(let n of e.messageBreakdown.toolCallsByType){let r=n.callTokens+n.resultTokens,i=r/e.rawMaxTokens*100;if(i<P||r<F)continue;let a=j(n.name,r,i);a&&t.push(a)}}function j(e,t,n){let r=v(t);switch(e){case w:return{severity:`warning`,title:`Bash results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Pipe output through head, tail, or grep to reduce result size. Avoid cat on large files — use Read with offset/limit instead.`,savingsTokens:Math.floor(t*.5)};case S:return{severity:`info`,title:`Read results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Use offset and limit parameters to read only the sections you need. Avoid re-reading entire files when you only need a few lines.`,savingsTokens:Math.floor(t*.3)};case b:return{severity:`info`,title:`Grep results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Add more specific patterns or use the glob or type parameter to narrow file types. Consider Glob for file discovery instead of Grep.`,savingsTokens:Math.floor(t*.3)};default:return n>=20?{severity:`info`,title:`${e} using ${r} tokens (${n.toFixed(0)}%)`,detail:`This tool is consuming a significant portion of context.`,savingsTokens:Math.floor(t*.2)}:null}}function M(e,t){if(!e.messageBreakdown)return;let n=e.messageBreakdown.toolCallsByType.find(e=>e.name===S);if(!n)return;let r=n.callTokens+n.resultTokens,i=r/e.rawMaxTokens*100,a=n.resultTokens/e.rawMaxTokens*100;i>=P&&r>=F||a>=I&&n.resultTokens>=F&&t.push({severity:`info`,title:`File reads using ${v(n.resultTokens)} tokens (${a.toFixed(0)}%)`,detail:`If you are re-reading files, consider referencing earlier reads. Use offset/limit for large files.`,savingsTokens:Math.floor(n.resultTokens*.3)})}function N(e,t){let n=e.memoryFiles.reduce((e,t)=>e+t.tokens,0),r=n/e.rawMaxTokens*100;if(r>=R&&n>=z){let i=[...e.memoryFiles].sort((e,t)=>t.tokens-e.tokens).slice(0,3).map(e=>`${h(e.path)} (${v(e.tokens)})`).join(`, `);t.push({severity:`info`,title:`Memory files using ${v(n)} tokens (${r.toFixed(0)}%)`,detail:`Largest: ${i}. Use /memory to review and prune stale entries.`,savingsTokens:Math.floor(n*.3)})}}function ee(e,t){!e.isAutoCompactEnabled&&e.percentage>=50&&e.percentage<L&&t.push({severity:`info`,title:`Autocompact is disabled`,detail:`Without autocompact, you will hit context limits and lose the conversation. Enable it in /config or use /compact manually.`})}var P,F,I,L,R,z,B=e((()=>{C(),T(),x(),m(),y(),P=15,F=1e4,I=5,L=80,R=5,z=5e3}));function V({suggestions:e}){return e.length===0?null:(0,H.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,H.jsx)(u,{bold:!0,children:`Suggestions`}),e.map((e,t)=>(0,H.jsxs)(l,{flexDirection:`column`,marginTop:t===0?0:1,children:[(0,H.jsxs)(l,{children:[(0,H.jsx)(d,{status:e.severity,withSpace:!0}),(0,H.jsx)(u,{bold:!0,children:e.title}),e.savingsTokens?(0,H.jsxs)(u,{dimColor:!0,children:[` `,n.arrowRight,` save ~`,v(e.savingsTokens)]}):null]}),(0,H.jsx)(l,{marginLeft:2,children:(0,H.jsx)(u,{dimColor:!0,children:e.detail})})]},t))]})}var H,U=e((()=>{t(),f(),y(),H=p()}));function W(){return null}function G(e){let t=new Map;for(let n of e){let e=_(n.source),r=t.get(e)||[];r.push(n),t.set(e,r)}for(let[e,n]of t.entries())t.set(e,n.sort((e,t)=>t.tokens-e.tokens));let n=new Map;for(let e of Y){let r=t.get(e);r&&n.set(e,r)}return n}function K({data:e}){let{categories:t,totalTokens:n,rawMaxTokens:r,percentage:i,gridRows:a,model:o,memoryFiles:s,mcpTools:c,deferredBuiltinTools:d=[],agents:f,skills:p,cacheHitRate:m,cacheThreshold:g}=e,_=t.filter(e=>e.tokens>0&&e.name!==`Free space`&&e.name!==J&&!e.isDeferred),y=t.some(e=>e.isDeferred&&e.name.includes(`MCP`)),b=t.find(e=>e.name===J);return(0,q.jsxs)(l,{flexDirection:`column`,paddingLeft:1,children:[(0,q.jsx)(u,{bold:!0,children:`Context Usage`}),(0,q.jsxs)(l,{flexDirection:`row`,gap:2,children:[(0,q.jsx)(l,{flexDirection:`column`,flexShrink:0,children:a.map((e,t)=>(0,q.jsx)(l,{flexDirection:`row`,marginLeft:-1,children:e.map((e,t)=>e.categoryName===`Free space`?(0,q.jsx)(u,{dimColor:!0,children:`⛶ `},t):e.categoryName===J?(0,q.jsx)(u,{color:e.color,children:`⛝ `},t):(0,q.jsx)(u,{color:e.color,children:e.squareFullness>=.7?`⛁ `:`⛀ `},t))},t))}),(0,q.jsxs)(l,{flexDirection:`column`,gap:0,flexShrink:0,children:[(0,q.jsxs)(u,{dimColor:!0,children:[o,` · `,v(n),`/`,v(r),` tokens (`,i,`%)`]}),(0,q.jsx)(W,{}),m!==void 0&&g!==void 0&&(0,q.jsxs)(u,{color:m<g?`warning`:void 0,children:[`Cache hit rate: `,m.toFixed(0),`%`,m<g?` (below ${g}% threshold)`:``]}),(0,q.jsx)(u,{children:` `}),(0,q.jsx)(u,{dimColor:!0,italic:!0,children:`Estimated usage by category`}),_.map((e,t)=>{let n=v(e.tokens),i=e.isDeferred?`N/A`:`${(e.tokens/r*100).toFixed(1)}%`,a=e.name===J,o=e.name,s=e.isDeferred?` `:a?`⛝`:`⛁`;return(0,q.jsxs)(l,{children:[(0,q.jsx)(u,{color:e.color,children:s}),(0,q.jsxs)(u,{children:[` `,o,`: `]}),(0,q.jsxs)(u,{dimColor:!0,children:[n,` tokens (`,i,`)`]})]},t)}),(t.find(e=>e.name===`Free space`)?.tokens??0)>0&&(0,q.jsxs)(l,{children:[(0,q.jsx)(u,{dimColor:!0,children:`⛶`}),(0,q.jsx)(u,{children:` Free space: `}),(0,q.jsxs)(u,{dimColor:!0,children:[v(t.find(e=>e.name===`Free space`)?.tokens||0),` (`,((t.find(e=>e.name===`Free space`)?.tokens||0)/r*100).toFixed(1),`%)`]})]}),b&&b.tokens>0&&(0,q.jsxs)(l,{children:[(0,q.jsx)(u,{color:b.color,children:`⛝`}),(0,q.jsxs)(u,{dimColor:!0,children:[` `,b.name,`: `]}),(0,q.jsxs)(u,{dimColor:!0,children:[v(b.tokens),` tokens (`,(b.tokens/r*100).toFixed(1),`%)`]})]})]})]}),(0,q.jsxs)(l,{flexDirection:`column`,marginLeft:-1,children:[c.length>0&&(0,q.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,q.jsxs)(l,{children:[(0,q.jsx)(u,{bold:!0,children:`MCP tools`}),(0,q.jsxs)(u,{dimColor:!0,children:[` · /mcp`,y?` (loaded on-demand)`:``]})]}),c.some(e=>e.isLoaded)&&(0,q.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,q.jsx)(u,{dimColor:!0,children:`Loaded`}),c.filter(e=>e.isLoaded).map((e,t)=>(0,q.jsxs)(l,{children:[(0,q.jsxs)(u,{children:[`└ `,e.name,`: `]}),(0,q.jsxs)(u,{dimColor:!0,children:[v(e.tokens),` tokens`]})]},t))]}),y&&c.some(e=>!e.isLoaded)&&(0,q.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,q.jsx)(u,{dimColor:!0,children:`Available`}),c.filter(e=>!e.isLoaded).map((e,t)=>(0,q.jsx)(l,{children:(0,q.jsxs)(u,{dimColor:!0,children:[`└ `,e.name]})},t))]}),!y&&c.map((e,t)=>(0,q.jsxs)(l,{children:[(0,q.jsxs)(u,{children:[`└ `,e.name,`: `]}),(0,q.jsxs)(u,{dimColor:!0,children:[v(e.tokens),` tokens`]})]},t))]}),f.length>0&&(0,q.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,q.jsxs)(l,{children:[(0,q.jsx)(u,{bold:!0,children:`Custom agents`}),(0,q.jsx)(u,{dimColor:!0,children:` · /agents`})]}),Array.from(G(f).entries()).map(([e,t])=>(0,q.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,q.jsx)(u,{dimColor:!0,children:e}),t.map((e,t)=>(0,q.jsxs)(l,{children:[(0,q.jsxs)(u,{children:[`└ `,e.agentType,`: `]}),(0,q.jsxs)(u,{dimColor:!0,children:[v(e.tokens),` tokens`]})]},t))]},e))]}),s.length>0&&(0,q.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,q.jsxs)(l,{children:[(0,q.jsx)(u,{bold:!0,children:`Memory files`}),(0,q.jsx)(u,{dimColor:!0,children:` · /memory`})]}),s.map((e,t)=>(0,q.jsxs)(l,{children:[(0,q.jsxs)(u,{children:[`└ `,h(e.path),`: `]}),(0,q.jsxs)(u,{dimColor:!0,children:[v(e.tokens),` tokens`]})]},t))]}),p&&p.tokens>0&&(0,q.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,q.jsxs)(l,{children:[(0,q.jsx)(u,{bold:!0,children:`Skills`}),(0,q.jsx)(u,{dimColor:!0,children:` · /skills`})]}),Array.from(G(p.skillFrontmatter).entries()).map(([e,t])=>(0,q.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,q.jsx)(u,{dimColor:!0,children:e}),t.map((e,t)=>(0,q.jsxs)(l,{children:[(0,q.jsxs)(u,{children:[`└ `,e.name,`: `]}),(0,q.jsxs)(u,{dimColor:!0,children:[v(e.tokens),` tokens`]})]},t))]},e))]})]}),(0,q.jsx)(V,{suggestions:O(e)})]})}var q,J,Y,X=e((()=>{f(),B(),m(),y(),g(),U(),q=p(),J=`Autocompact buffer`,Y=[`Project`,`User`,`Managed`,`Plugin`,`Built-in`]}));function Z(e){return c(e)}async function Q(e,t){let{messages:n,getAppState:r,options:{mainLoopModel:i,tools:a}}=t,c=Z(n),{messages:l}=await s(c),u=process.stdout.columns||80,d=r();return e(await E((0,$.jsx)(K,{data:await o(l,i,async()=>d.toolPermissionContext,a,d.agentDefinitions,u,t,void 0,c)}))),null}var $;e((()=>{X(),r(),a(),i(),D(),$=p()}))();export{Q as call};
@@ -1 +0,0 @@
1
- import{n as e,r as t,t as n}from"./context-noninteractive-ApbVPU86.js";t();export{n as call,e as collectContextData};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./conversation-CJ-d0O-U.js";e();export{t as clearConversation};
@@ -1 +0,0 @@
1
- import{a as e,n as t}from"./rolldown-runtime-DaDcL9Zw.js";import{AC as n,Ch as r,Dn as i,Fg as a,HT as o,Kn as s,Lg as c,Ls as l,Mg as u,On as d,Rs as f,St as p,Th as m,Tn as h,YT as g,br as _,di as v,h_ as y,hc as b,hn as x,jg as S,kC as C,m_ as w,mi as T,qt as E,sn as D,ti as O,tr as k,yt as A}from"./loadAgentsDir-DXOkUcW3.js";import{$ as j,$t as M,Cn as N,En as P,Ut as F,W as I,Zt as L,wn as R}from"./state-D5D6QpTX.js";import{o as z,s as B}from"./log-CZ7ploQm.js";import{n as V,r as H}from"./analytics-DJobLaWP.js";import{at as U,ut as W}from"./sessionState-DAcub-HK.js";import{n as G,t as K}from"./caches-BiVRgePi.js";import{randomUUID as q}from"crypto";function J(){return Y}var Y,X=t((()=>{b(),Y=null}));function Z(){let e=J();if(!e)return;e.markTranscriptReset?.();let t={type:`status`,subtype:`status`,status:`conversation_cleared`,message:`conversation_cleared`,uuid:q()};e.writeSdkMessages([t])}async function Q({setMessages:t,readFileState:c,discoveredSkillNames:l,loadedNestedMemoryPaths:d,getAppState:p,setAppState:m,setConversationId:g}){let b=D();await E(`clear`,{getAppState:p,setAppState:m,signal:AbortSignal.timeout(b),timeoutMs:b});let x=I();x&&H(`tengu_cache_eviction_hint`,{scope:`conversation_clear`,last_request_id:x});let S=new Set,C=[],w=e=>`isBackgrounded`in e&&e.isBackgrounded===!1;if(p)for(let e of Object.values(p().tasks))w(e)||f(e)&&(S.add(e.agentId),C.push(e));t(()=>[]),Z();let{setContextBlocked:F}=(U(),e(W));F(!1),g&&g(q()),K(S),N(null),R(null),P(null),M(),n(j()),c.clear(),l?.clear(),d?.clear(),m&&m(e=>{let t={};for(let[n,r]of Object.entries(e.tasks)){if(!w(r)){t[n]=r;continue}try{r.status===`running`&&(u(r)&&(r.shellCommand?.kill(),r.shellCommand?.cleanup(),r.cleanupTimeoutId&&clearTimeout(r.cleanupTimeoutId)),`abortController`in r&&r.abortController?.abort(),`unregisterCleanup`in r&&r.unregisterCleanup?.())}catch(e){B(e)}h(n)}return{...e,tasks:t,attribution:r(),standaloneAgentContext:void 0,fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:e.mcp.pluginReconnectKey}}}),o(),s(),L({setCurrentAsParent:!0}),await O();for(let e of C)e.status===`running`&&i(e.id,k(a(e.agentId)));let{saveMode:z}=(_(),e(T));z(`normal`);let V=A();V&&v(V);let G=await y(`clear`);G.length>0&&t(()=>G)}var $=t((()=>{X(),F(),V(),l(),S(),c(),m(),x(),z(),g(),C(),w(),_(),d(),p(),G()}));export{$ as n,Q as t};
@@ -1 +0,0 @@
1
- import{a as e,i as t,n,r}from"./createSession-yR87Rhiv.js";t();export{n as createBridgeSession,r as getBridgeSession,e as updateBridgeSessionTitle};