@readmagic/workmate 0.0.24 → 0.0.26

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 (436) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-mS8iUoWY.js +1 -0
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-BHBkysy0.js +1 -0
  3. package/dist/chunks/AgentsMdExternalIncludesDialog-DuStmCjj.js +1 -0
  4. package/dist/chunks/App-D--vtCyq.js +1 -0
  5. package/dist/chunks/BackgroundTasksDialog-mcDuiNGs.js +2 -0
  6. package/dist/chunks/BypassPermissionsModeDialog-DyqI98d2.js +1 -0
  7. package/dist/chunks/CustomSelect-CpMbxYbt.js +1 -0
  8. package/dist/chunks/DiffDialog-BQAU2pJx.js +6 -0
  9. package/dist/chunks/Doctor-BU69VQzw.js +1 -0
  10. package/dist/chunks/Doctor-DJOMbSDE.js +3 -0
  11. package/dist/chunks/ExitFlow-xBOnvhiW.js +2 -0
  12. package/dist/chunks/InvalidConfigDialog-NiuhcaG5.js +1 -0
  13. package/dist/chunks/{InvalidSettingsDialog-iwh8H52b.js → InvalidSettingsDialog-DrromC1I.js} +1 -1
  14. package/dist/chunks/KeybindingProviderSetup-CSUkJHTT.js +1 -0
  15. package/dist/chunks/MCPConnectionManager-Bn1PDn3R.js +1 -0
  16. package/dist/chunks/MCPToolListView-BRxjOaOL.js +1 -0
  17. package/dist/chunks/McpParsingWarnings-BYG2yqjO.js +1 -0
  18. package/dist/chunks/MessageSelector-B7xAQqZI.js +3 -0
  19. package/dist/chunks/Messages-CxMsfjOa.js +10 -0
  20. package/dist/chunks/Onboarding-CkATe87e.js +1 -0
  21. package/dist/chunks/{PermissionDialog-BaibiQae.js → PermissionDialog-tEMMa5-a.js} +1 -1
  22. package/dist/chunks/{PressEnterToContinue-DZc_s_pE.js → PressEnterToContinue-CPOaYnym.js} +1 -1
  23. package/dist/chunks/PromptInputFooterSuggestions-CwqAsTI2.js +1 -0
  24. package/dist/chunks/PromptInputHelpMenu-krq-hiFO.js +1 -0
  25. package/dist/chunks/{ProviderSetup-BCSPsvfv.js → ProviderSetup-J6Ty-Wj8.js} +1 -1
  26. package/dist/chunks/QueryEngine-Mdi_kUaL.js +1 -0
  27. package/dist/chunks/REPL-BgzQtSFF.js +1 -0
  28. package/dist/chunks/REPL-rirm6s_7.js +124 -0
  29. package/dist/chunks/ResumeConversation-Cmsbo5m7.js +1 -0
  30. package/dist/chunks/{SearchBox-C9xxQzh1.js → SearchBox-DQBLKyzJ.js} +1 -1
  31. package/dist/chunks/SearchExtraToolsTool-D1-7C04z.js +1 -0
  32. package/dist/chunks/{SelectMulti-BQRHed-d.js → SelectMulti-BpAjjhsn.js} +1 -1
  33. package/dist/chunks/Settings-B6DImvca.js +2 -0
  34. package/dist/chunks/Spinner-DhhSOFcN.js +1 -0
  35. package/dist/chunks/{SpinnerGlyph-CmkRUvHe.js → SpinnerGlyph-CmVXC-_9.js} +1 -1
  36. package/dist/chunks/TextInput-BboKIug2.js +22 -0
  37. package/dist/chunks/ThemePicker-DTpXbEY0.js +1 -0
  38. package/dist/chunks/TrustDialog-CZ8JpySm.js +1 -0
  39. package/dist/chunks/{ValidationErrorsList-DgNzJQUP.js → ValidationErrorsList-C_gDQfm1.js} +1 -1
  40. package/dist/chunks/_baseEach-DGbaIpJA.js +1 -0
  41. package/dist/chunks/_baseSlice-D67_NpZ1.js +1 -0
  42. package/dist/chunks/add-dir-B576wzi9.js +1 -0
  43. package/dist/chunks/{agentDisplay-M4pfwbMC.js → agentDisplay-ZuFoBZYu.js} +1 -1
  44. package/dist/chunks/{agents-DddX7lLX.js → agents-Dy4_hDic.js} +1 -1
  45. package/dist/chunks/agents-HIOBiw4w.js +101 -0
  46. package/dist/chunks/allErrors-CxPNR2WN.js +1 -0
  47. package/dist/chunks/analytics-COpjZpvd.js +1 -0
  48. package/dist/chunks/appleTerminalBackup-C9kjzdM9.js +1 -0
  49. package/dist/chunks/backgroundHousekeeping-PyLNnGdw.js +1 -0
  50. package/dist/chunks/backgroundHousekeeping-ZCMPmQuU.js +1 -0
  51. package/dist/chunks/banner-DqFectPg.js +2 -0
  52. package/dist/chunks/branch-B_BL5N9N.js +2 -0
  53. package/dist/chunks/{break-cache-BMXqFTeS.js → break-cache-DL95nKZl.js} +2 -2
  54. package/dist/chunks/btw-Y44ctueB.js +1 -0
  55. package/dist/chunks/bundledMode-BxyD5cqq.js +1 -0
  56. package/dist/chunks/caches-5xZ4dSXt.js +1 -0
  57. package/dist/chunks/caches-Be9saXxV.js +1 -0
  58. package/dist/chunks/{claudeDesktop-D8ml2767.js → claudeDesktop-g8eUUY2E.js} +1 -1
  59. package/dist/chunks/{clear-B8ZtFPOK.js → clear-DtTkA707.js} +1 -1
  60. package/dist/chunks/{client-CpTCeWba.js → client-Bw_L3lSc.js} +1 -1
  61. package/dist/chunks/{client-4iqhC8xq.js → client-aJ2Nr_sh.js} +1 -1
  62. package/dist/chunks/client-mnUISv_N.js +1 -0
  63. package/dist/chunks/client-wPqIdEVm.js +1 -0
  64. package/dist/chunks/commands-wfE12a4L.js +1 -0
  65. package/dist/chunks/compact-CvNOtu7J.js +2 -0
  66. package/dist/chunks/config-D3K87Mm1.js +3 -0
  67. package/dist/chunks/config-DTga6Ku8.js +1 -0
  68. package/dist/chunks/config-DtmqWusU.js +1 -0
  69. package/dist/chunks/context-Opu4E8dL.js +1 -0
  70. package/dist/chunks/{context-noninteractive-C7wrRZnM.js → context-noninteractive-B1V2Mp26.js} +5 -5
  71. package/dist/chunks/context-noninteractive-eIlneYiL.js +1 -0
  72. package/dist/chunks/conversation-CG_z7TLE.js +1 -0
  73. package/dist/chunks/conversation-CHesBfFZ.js +1 -0
  74. package/dist/chunks/conversationRecovery-OhitW-7g.js +1 -0
  75. package/dist/chunks/crossProjectResume-mmYx8PrZ.js +40 -0
  76. package/dist/chunks/cwd-BH2f3u0o.js +1 -0
  77. package/dist/chunks/cwd-DrEEb4f5.js +1 -0
  78. package/dist/chunks/debug-kBjDaVkQ.js +39 -0
  79. package/dist/chunks/{detectRepository-CfX8Lc0A.js → detectRepository-M6K2wc7h.js} +1 -1
  80. package/dist/chunks/{diff-DdpHThJ7.js → diff-Cv7tX2-P.js} +1 -1
  81. package/dist/chunks/{directoryCompletion-D_Rtg-4j.js → directoryCompletion-BHyjyKAM.js} +1 -1
  82. package/dist/chunks/doctor-DeBG5SL5.js +1 -0
  83. package/dist/chunks/entry-CbhyIWgj.js +13 -0
  84. package/dist/chunks/envUtils-DZ_SvEVz.js +1 -0
  85. package/dist/chunks/{esm-CGx9qY3q.js → esm-DUH16IqH.js} +1 -1
  86. package/dist/chunks/execAsync-D6SA-YsV.js +1 -0
  87. package/dist/chunks/execFileNoThrow-BfZFnCGa.js +1 -0
  88. package/dist/chunks/execa-CBhG1doD.js +34 -0
  89. package/dist/chunks/exit-OKEV_ddw.js +1 -0
  90. package/dist/chunks/extraUsage-BlRL3yeb.js +1 -0
  91. package/dist/chunks/extractMemories-jnsv-_n_.js +1 -0
  92. package/dist/chunks/fast-4I_qPJCd.js +1 -0
  93. package/dist/chunks/fast-DiolM1M7.js +1 -0
  94. package/dist/chunks/fetchModelList-BRFTQim4.js +1 -0
  95. package/dist/chunks/fetchModelList-qPKAuu4m.js +1 -0
  96. package/dist/chunks/fileSuggestions-iWVXvvLB.js +3 -0
  97. package/dist/chunks/firstPartyEventLogger-CN9UOmEC.js +1 -0
  98. package/dist/chunks/firstPartyEventLogger-RR5rvDtk.js +1 -0
  99. package/dist/chunks/{fpsMetrics-wxj9GAsd.js → fpsMetrics-Ixd0J4CH.js} +1 -1
  100. package/dist/chunks/{gemini-C_ApXgwc.js → gemini-BfVyavwQ.js} +2 -2
  101. package/dist/chunks/generateSessionName-CGaTTXCA.js +1 -0
  102. package/dist/chunks/genericProcessUtils-CVtQOTO2.js +12 -0
  103. package/dist/chunks/getMachineId-bsd-DTYGimUN.js +1 -0
  104. package/dist/chunks/getMachineId-darwin-DqIFUVvd.js +2 -0
  105. package/dist/chunks/getMachineId-linux-CnCTmdzd.js +1 -0
  106. package/dist/chunks/getMachineId-unsupported-Cx21ssu1.js +1 -0
  107. package/dist/chunks/getMachineId-win-vZhex7KX.js +1 -0
  108. package/dist/chunks/goal-BidR-GFa.js +3 -0
  109. package/dist/chunks/grok-DLcuI-U7.js +1 -0
  110. package/dist/chunks/help-CZuvYhXj.js +1 -0
  111. package/dist/chunks/history-BxPGftQw.js +1 -0
  112. package/dist/chunks/hooks-Bg9WIjZQ.js +1 -0
  113. package/dist/chunks/{hooks-DR3IYPJ3.js → hooks-ehqfAM5F.js} +2 -2
  114. package/dist/chunks/install-ACGY0vhM.js +1 -0
  115. package/dist/chunks/instrumentation-B9bfF2mA.js +21 -0
  116. package/dist/chunks/{job-YhJQWgE0.js → job-Coztdn6A.js} +1 -1
  117. package/dist/chunks/keybindings-DwSdLpaE.js +1 -0
  118. package/dist/chunks/launchLocalMemory-DRzfpIOB.js +3 -0
  119. package/dist/chunks/launchOnboarding-D2zFCJf-.js +8 -0
  120. package/dist/chunks/{loadAgentsDir-B0Anodo0.js → loadAgentsDir-DR5PVAc3.js} +590 -594
  121. package/dist/chunks/loadAgentsDir-DqAbnpB-.js +1 -0
  122. package/dist/chunks/{loadPluginHooks-BSwCtQ6T.js → loadPluginHooks-BiQgGfUJ.js} +1 -1
  123. package/dist/chunks/{loader-CICGtLp2.js → loader-6MqzNGmV.js} +1 -1
  124. package/dist/chunks/{localSearch-BxLYi6w_.js → localSearch-CzkxDuOR.js} +1 -1
  125. package/dist/chunks/localSearch-DW3JT2MA.js +1 -0
  126. package/dist/chunks/lockfile-D_9vif6E.js +1 -0
  127. package/dist/chunks/{log-D2TIwHBV.js → log-DWZny1vM.js} +1 -1
  128. package/dist/chunks/logoUtils-DR5T0pr3.js +1 -0
  129. package/dist/chunks/{magicDocs-Bkz7ZcmL.js → magicDocs-BwBxjfLo.js} +2 -2
  130. package/dist/chunks/main-Ryi27wYq.js +345 -0
  131. package/dist/chunks/managedEnv-DCEJh3z3.js +1 -0
  132. package/dist/chunks/managedEnv-Do9fgLpk.js +1 -0
  133. package/dist/chunks/managedEnvConstants-CWcT7nYr.js +1 -0
  134. package/dist/chunks/mcp-BCpnF6wD.js +1 -0
  135. package/dist/chunks/mcp-CJ6SDJEK.js +6 -0
  136. package/dist/chunks/mcp-CZBTxbhu.js +2 -0
  137. package/dist/chunks/memory-BQO6Y0ak.js +1 -0
  138. package/dist/chunks/{modalContext-DDZdU1J8.js → modalContext-CBE8xuck.js} +1 -1
  139. package/dist/chunks/mode-wq70cR44.js +2 -0
  140. package/dist/chunks/model-D42epddJ.js +1 -0
  141. package/dist/chunks/model-DVk9-2dk.js +1 -0
  142. package/dist/chunks/modelOptions-beLgXORr.js +1 -0
  143. package/dist/chunks/nativeInstaller-ChGSz1lb.js +1 -0
  144. package/dist/chunks/{notifications-Bc6k-Ozy.js → notifications-dGBuNvFj.js} +1 -1
  145. package/dist/chunks/onChangeAppState-B4K-rSaF.js +1 -0
  146. package/dist/chunks/open-Cyrr4E5x.js +1 -0
  147. package/dist/chunks/openai-DAwnAV9K.js +2 -0
  148. package/dist/chunks/overlayContext-B6i_6y_0.js +1 -0
  149. package/dist/chunks/{panel-CVS4SK_E.js → panel-C0CF3noE.js} +1 -1
  150. package/dist/chunks/parser-BZt0VFd_.js +1 -0
  151. package/dist/chunks/{parser-Cg6hSCmn.js → parser-DThLwgdM.js} +1 -1
  152. package/dist/chunks/partition-BRQHofxD.js +1 -0
  153. package/dist/chunks/{pasteStore-P0zP-ch0.js → pasteStore-BmehVo5j.js} +1 -1
  154. package/dist/chunks/permissions-DkfWKN-B.js +3 -0
  155. package/dist/chunks/pidLock-YvAaIrIY.js +3 -0
  156. package/dist/chunks/plan-B6U3ioer.js +1 -0
  157. package/dist/chunks/platform-Vl9IynC3.js +2 -0
  158. package/dist/chunks/plugin-CTA2_-F7.js +17 -0
  159. package/dist/chunks/{pluginAutoupdate-ennb9k8_.js → pluginAutoupdate-Dy5W3HWE.js} +1 -1
  160. package/dist/chunks/{pluginBlocklist-9OrNEh--.js → pluginBlocklist-DAoUENwc.js} +1 -1
  161. package/dist/chunks/pluginCliCommands-CaHnj0C_.js +1 -0
  162. package/dist/chunks/{pluginFlagging-js_-WmYj.js → pluginFlagging-BCj9LJP3.js} +1 -1
  163. package/dist/chunks/pluginOperations-ClXNOOG6.js +2 -0
  164. package/dist/chunks/pluginStartupCheck-CiwMKGjx.js +1 -0
  165. package/dist/chunks/{pluginStartupCheck-SRXOyqr7.js → pluginStartupCheck-U8_xk25t.js} +1 -1
  166. package/dist/chunks/plugins-D7zyI9c4.js +4 -0
  167. package/dist/chunks/{poller-CpLBoB-N.js → poller-BeyVwHAf.js} +1 -1
  168. package/dist/chunks/poorMode-DtzWNhsY.js +1 -0
  169. package/dist/chunks/poorMode-Ocff_UT1.js +1 -0
  170. package/dist/chunks/print-BzljdXem.js +13 -0
  171. package/dist/chunks/processBashCommand-RUkmyAl4.js +1 -0
  172. package/dist/chunks/processSlashCommand-DRLO-jNV.js +5 -0
  173. package/dist/chunks/{projectContext-5fmRr6Sd.js → projectContext-COeHKDrk.js} +1 -1
  174. package/dist/chunks/{projectContext-DhtjLv3k.js → projectContext-QN5U3Ggr.js} +1 -1
  175. package/dist/chunks/{projectOnboardingState-B5YATuc6.js → projectOnboardingState-KqcpRXls.js} +1 -1
  176. package/dist/chunks/{prompt-CJ1l3XXk.js → prompt-CTByhpUI.js} +21 -21
  177. package/dist/chunks/prompt-DTpfW6yP.js +1 -0
  178. package/dist/chunks/prompt-D__eHY_5.js +1 -0
  179. package/dist/chunks/promptEditor-CpUFgGzc.js +4 -0
  180. package/dist/chunks/protocolHandler-BQSLVGnG.js +13 -0
  181. package/dist/chunks/{proxy-CDBfZjO7.js → proxy-BtWuysHM.js} +2 -2
  182. package/dist/chunks/reconciler-D6BUq8WB.js +1 -0
  183. package/dist/chunks/refresh-B4pqFp12.js +1 -0
  184. package/dist/chunks/reject-C6IvUvBt.js +1 -0
  185. package/dist/chunks/{reload-plugins-CQZFQLWP.js → reload-plugins-DXQqk7q6.js} +1 -1
  186. package/dist/chunks/rename-D4XBmTBI.js +1 -0
  187. package/dist/chunks/{renderOptions-DV0dn0IW.js → renderOptions-DkP98P_d.js} +1 -1
  188. package/dist/chunks/resume-DzIev0JI.js +2 -0
  189. package/dist/chunks/ripgrep-CYP26Fhg.js +1 -0
  190. package/dist/chunks/ripgrep-D1f1pbCz.js +5 -0
  191. package/dist/chunks/{runtimeObserver-PJ1o8GRA.js → runtimeObserver-BPqlbu0B.js} +4 -4
  192. package/dist/chunks/{runtimeObserver-DEuR8z0f.js → runtimeObserver-BUHs3qjs.js} +1 -1
  193. package/dist/chunks/sandbox-adapter-CumL75tU.js +1 -0
  194. package/dist/chunks/sandbox-toggle-CTtET6Xq.js +1 -0
  195. package/dist/chunks/searchExtraTools-BMCU2zEf.js +1 -0
  196. package/dist/chunks/select-FrwoTzuc.js +1 -0
  197. package/dist/chunks/sessionFileAccessHooks-WO8WTdT9.js +1 -0
  198. package/dist/chunks/{sessionObserver-BtKjvteq.js → sessionObserver-B6xzxckA.js} +2 -2
  199. package/dist/chunks/sessionObserver-CBrM4opL.js +1 -0
  200. package/dist/chunks/sessionStorage-C1EAxDWG.js +1 -0
  201. package/dist/chunks/sessionTracing-UFK96PxT.js +11 -0
  202. package/dist/chunks/settings-BK6gCko-.js +1 -0
  203. package/dist/chunks/settings-YIDksG5Z.js +24 -0
  204. package/dist/chunks/setup-BBvZyrfz.js +3 -0
  205. package/dist/chunks/{shadowedRuleDetection-Bg_aIc5Z.js → shadowedRuleDetection-D6R2OeoH.js} +1 -1
  206. package/dist/chunks/{sideQuestion-D49GsfH7.js → sideQuestion-5jcbOMsR.js} +3 -3
  207. package/dist/chunks/sinks-B-kFqjjd.js +1 -0
  208. package/dist/chunks/sinks-DB_D4lmu.js +1 -0
  209. package/dist/chunks/skillChangeDetector-103-nEle.js +1 -0
  210. package/dist/chunks/{skillGapStore-CcFoHNLl.js → skillGapStore-DOz1KCqo.js} +2 -2
  211. package/dist/chunks/{skillLifecycle-Bnz_4wE5.js → skillLifecycle-D9NkIwFQ.js} +2 -2
  212. package/dist/chunks/{skillSearchPanel-C_5yUhqn.js → skillSearchPanel-DFiSZaJ4.js} +4 -4
  213. package/dist/chunks/skills-DgeLr52a.js +1 -0
  214. package/dist/chunks/sleep-BbWr_FL1.js +1 -0
  215. package/dist/chunks/{src-CiJCsqUl.js → src-C8gyNm5a.js} +1 -1
  216. package/dist/chunks/{src-9vmGsuSI.js → src-Cy5_qH26.js} +1 -1
  217. package/dist/chunks/src-Db7K3F_i.js +3 -0
  218. package/dist/chunks/{src-DL3w8VPk.js → src-WZ94ZKI3.js} +4 -4
  219. package/dist/chunks/startupProfiler-DIM_Ihyp.js +3 -0
  220. package/dist/chunks/startupProfiler-FpGsKWYk.js +1 -0
  221. package/dist/chunks/{state-B4jiUise.js → state-CXY-q5gr.js} +1 -1
  222. package/dist/chunks/state-DXt6rahM.js +1 -0
  223. package/dist/chunks/{staticRender-BVWx0IM1.js → staticRender-RHUIg5ln.js} +1 -1
  224. package/dist/chunks/status-CKLecQZV.js +1 -0
  225. package/dist/chunks/statusNoticeHelpers-DI45AH-c.js +1 -0
  226. package/dist/chunks/stringUtils-D_xPrwGQ.js +4 -0
  227. package/dist/chunks/switcher-D2Z2ZNQ0.js +1 -0
  228. package/dist/chunks/switcher-DhZCaAun.js +1 -0
  229. package/dist/chunks/{tasks-DdcUQEeD.js → tasks-6suPhqsK.js} +1 -1
  230. package/dist/chunks/{templateJobs-C8qsPrLj.js → templateJobs-BKVEWCsb.js} +1 -1
  231. package/dist/chunks/{terminalSetup-qc2PlvOm.js → terminalSetup-7PUR4hfo.js} +1 -1
  232. package/dist/chunks/{terminalSetup-B_10N_gE.js → terminalSetup-Cqy5_PhJ.js} +4 -4
  233. package/dist/chunks/{theme-f1h2QI8J.js → theme-B-HG2PUs.js} +1 -1
  234. package/dist/chunks/tipRegistry-BR_lSGRw.js +2 -0
  235. package/dist/chunks/{toolEventObserver-7QP38x4t.js → toolEventObserver-BY3QVnr6.js} +1 -1
  236. package/dist/chunks/toolPool-BcwIF8Q_.js +1 -0
  237. package/dist/chunks/{types-Dx7P7JLQ.js → types-CD25a50S.js} +16 -16
  238. package/dist/chunks/udsClient-CCxgLiZy.js +1 -0
  239. package/dist/chunks/urlHandler-BNsQKqba.js +1 -0
  240. package/dist/chunks/{use-select-navigation-hWL5VHnL.js → use-select-navigation-CW5alA9r.js} +1 -1
  241. package/dist/chunks/{useDoublePress-C9xxQzh1.js → useDoublePress-DQBLKyzJ.js} +1 -1
  242. package/dist/chunks/useExitOnCtrlCDWithKeybindings-BgJrnuDl.js +1 -0
  243. package/dist/chunks/useMainLoopModel-BVgJo4hN.js +1 -0
  244. package/dist/chunks/useManagePlugins-CrWjzESW.js +1 -0
  245. package/dist/chunks/useMergedTools-r6GQq5mI.js +1 -0
  246. package/dist/chunks/useSearchInput-BITV_Txn.js +1 -0
  247. package/dist/chunks/useSettingsErrors-CO0fTNzn.js +1 -0
  248. package/dist/chunks/util-_zo3I1y8.js +1 -0
  249. package/dist/chunks/validatePlugin-DFGdRhA-.js +1 -0
  250. package/dist/chunks/vim-qgMS88ss.js +1 -0
  251. package/dist/chunks/worktree-CR_M6Qfy.js +1 -0
  252. package/dist/cli.js +1 -1
  253. package/package.json +1 -12
  254. package/scripts/postinstall.cjs +16 -16
  255. package/dist/chunks/AddWorkspaceDirectory-Ch8IcWXO.js +0 -1
  256. package/dist/chunks/AgentsMdExternalIncludesDialog-Cyia0s4g.js +0 -1
  257. package/dist/chunks/AgentsMdExternalIncludesDialog-LjI_H_Au.js +0 -1
  258. package/dist/chunks/App-BOqh_1tN.js +0 -1
  259. package/dist/chunks/BackgroundTasksDialog-CSEuuoq9.js +0 -2
  260. package/dist/chunks/BypassPermissionsModeDialog-CwfCwUr9.js +0 -1
  261. package/dist/chunks/CustomSelect-wmZ9jz0W.js +0 -1
  262. package/dist/chunks/DiffDialog-BpXIEWiE.js +0 -6
  263. package/dist/chunks/Doctor-CMpr7tdf.js +0 -1
  264. package/dist/chunks/Doctor-DqW6j3_B.js +0 -3
  265. package/dist/chunks/ExitFlow-DacaBTlk.js +0 -2
  266. package/dist/chunks/Grove-CNqYPWI6.js +0 -11
  267. package/dist/chunks/InvalidConfigDialog-0TMJItCC.js +0 -1
  268. package/dist/chunks/KeybindingProviderSetup-D49HHTXD.js +0 -1
  269. package/dist/chunks/MCPConnectionManager-Cie77ZAK.js +0 -1
  270. package/dist/chunks/MCPToolListView-B4ehtkXd.js +0 -1
  271. package/dist/chunks/McpParsingWarnings-Bff66RtJ.js +0 -1
  272. package/dist/chunks/MessageSelector-Dpd6Iywp.js +0 -3
  273. package/dist/chunks/Messages-DN7M3oS_.js +0 -10
  274. package/dist/chunks/Onboarding-CQmE3rUf.js +0 -1
  275. package/dist/chunks/PromptInputFooterSuggestions-HI6HH3TP.js +0 -1
  276. package/dist/chunks/PromptInputHelpMenu-3QNUC2Cg.js +0 -1
  277. package/dist/chunks/QueryEngine-DdLWvJv6.js +0 -1
  278. package/dist/chunks/REPL-BqO9KcK_.js +0 -124
  279. package/dist/chunks/REPL-CmZmypfF.js +0 -1
  280. package/dist/chunks/ResumeConversation-DBqX7gva.js +0 -1
  281. package/dist/chunks/SearchExtraToolsTool-BsSoILFj.js +0 -1
  282. package/dist/chunks/Settings-B-7yBewS.js +0 -3
  283. package/dist/chunks/Spinner-ByQXTvAA.js +0 -1
  284. package/dist/chunks/TextInput-B8ruWRf2.js +0 -22
  285. package/dist/chunks/ThemePicker-BQErFFW1.js +0 -1
  286. package/dist/chunks/TrustDialog-BIhz6AZE.js +0 -1
  287. package/dist/chunks/_baseEach-CsIRoaTH.js +0 -1
  288. package/dist/chunks/add-dir-CrUDs19x.js +0 -1
  289. package/dist/chunks/agents-CGaCQeLw.js +0 -101
  290. package/dist/chunks/allErrors-BF73lon8.js +0 -1
  291. package/dist/chunks/analytics-DJobLaWP.js +0 -1
  292. package/dist/chunks/appleTerminalBackup-BArZWB21.js +0 -1
  293. package/dist/chunks/backgroundHousekeeping-Bq3LMsVR.js +0 -17
  294. package/dist/chunks/backgroundHousekeeping-Cl3Ox7Qh.js +0 -1
  295. package/dist/chunks/banner-Cu2-XUek.js +0 -2
  296. package/dist/chunks/branch-Yg_taNlT.js +0 -2
  297. package/dist/chunks/btw-udbprVvu.js +0 -1
  298. package/dist/chunks/caches-ChjIEcdd.js +0 -1
  299. package/dist/chunks/caches-DLJ6urv-.js +0 -1
  300. package/dist/chunks/client-BiqbIkwr.js +0 -1
  301. package/dist/chunks/client-CZ8nyVh5.js +0 -1
  302. package/dist/chunks/commands-CVCpJo7M.js +0 -1
  303. package/dist/chunks/compact-izk6RKHQ.js +0 -2
  304. package/dist/chunks/config-C-Y2qtB2.js +0 -3
  305. package/dist/chunks/config-CFqpXMFX.js +0 -1
  306. package/dist/chunks/config-DD8fCYXn.js +0 -1
  307. package/dist/chunks/context-BbVm4SWK.js +0 -1
  308. package/dist/chunks/context-noninteractive-x0HAzWhc.js +0 -1
  309. package/dist/chunks/conversation-DouVzO0K.js +0 -1
  310. package/dist/chunks/conversation-DrVkifKy.js +0 -1
  311. package/dist/chunks/conversationRecovery-DliPBo_z.js +0 -1
  312. package/dist/chunks/crossProjectResume-DxMy05_P.js +0 -40
  313. package/dist/chunks/cwd-Dc3NV7s8.js +0 -1
  314. package/dist/chunks/cwd-Pa83R95t.js +0 -1
  315. package/dist/chunks/datadog-Cu3s7P48.js +0 -1
  316. package/dist/chunks/debug-Bglx1aTu.js +0 -39
  317. package/dist/chunks/doctor-D_kV_D_l.js +0 -1
  318. package/dist/chunks/entry-Bxseqbi_.js +0 -13
  319. package/dist/chunks/envUtils-DfkgIdYf.js +0 -1
  320. package/dist/chunks/esm-BXTZz3av.js +0 -1
  321. package/dist/chunks/execAsync-Bv2yxuGe.js +0 -1
  322. package/dist/chunks/execFileNoThrow-BTachNBI.js +0 -34
  323. package/dist/chunks/exit-C_R_FgzR.js +0 -1
  324. package/dist/chunks/extraUsage-xMuDiNKh.js +0 -1
  325. package/dist/chunks/extractMemories-D4Dl1itt.js +0 -1
  326. package/dist/chunks/fast-DH-C5IZs.js +0 -1
  327. package/dist/chunks/fast-bopOPrtf.js +0 -1
  328. package/dist/chunks/fetchModelList-DC4VQpqa.js +0 -1
  329. package/dist/chunks/fetchModelList-FE8tzTDc.js +0 -1
  330. package/dist/chunks/fileSuggestions-C-9unnoJ.js +0 -3
  331. package/dist/chunks/firstPartyEventLogger-QmjjQmgt.js +0 -3
  332. package/dist/chunks/firstPartyEventLogger-lFeqhtfh.js +0 -1
  333. package/dist/chunks/generateSessionName-CQ03xlYI.js +0 -1
  334. package/dist/chunks/genericProcessUtils-DwQFuna9.js +0 -23
  335. package/dist/chunks/getMachineId-bsd-Cut1kHoA.js +0 -1
  336. package/dist/chunks/getMachineId-darwin-CsRhaP3y.js +0 -2
  337. package/dist/chunks/getMachineId-linux-Bd7UBNRQ.js +0 -1
  338. package/dist/chunks/getMachineId-unsupported-vFGP8E_8.js +0 -1
  339. package/dist/chunks/getMachineId-win-DamF2CH_.js +0 -1
  340. package/dist/chunks/goal-CdL29Y8C.js +0 -3
  341. package/dist/chunks/grok-C6WAslUT.js +0 -1
  342. package/dist/chunks/grove-O6qp7ITR.js +0 -1
  343. package/dist/chunks/help-DxanITNN.js +0 -1
  344. package/dist/chunks/history-BMycjPTT.js +0 -1
  345. package/dist/chunks/hooks-D9ApLkBp.js +0 -1
  346. package/dist/chunks/install-0D9u2dZw.js +0 -1
  347. package/dist/chunks/instrumentation-BFiGwntt.js +0 -21
  348. package/dist/chunks/keybindings-DZrF9iNd.js +0 -1
  349. package/dist/chunks/launchLocalMemory-DhJ56KDc.js +0 -3
  350. package/dist/chunks/launchOnboarding-DmMoZwv5.js +0 -8
  351. package/dist/chunks/loadAgentsDir-BbUR6pqH.js +0 -1
  352. package/dist/chunks/localSearch-zfn7jgrh.js +0 -1
  353. package/dist/chunks/logoUtils-CRxTutvr.js +0 -1
  354. package/dist/chunks/main-9ksgUUY_.js +0 -345
  355. package/dist/chunks/managedEnv-BEqrGqn1.js +0 -1
  356. package/dist/chunks/managedEnv-OPlzUPbJ.js +0 -1
  357. package/dist/chunks/managedEnvConstants-BPwL2aWI.js +0 -1
  358. package/dist/chunks/mcp-ChF12reQ.js +0 -1
  359. package/dist/chunks/mcp-DoEl5uah.js +0 -2
  360. package/dist/chunks/mcp-hp9qqjAy.js +0 -6
  361. package/dist/chunks/memory-Qv-wGNQ5.js +0 -1
  362. package/dist/chunks/mode-bFXPCR2P.js +0 -2
  363. package/dist/chunks/model-6lkW4o2c.js +0 -1
  364. package/dist/chunks/model-BvQFFOf8.js +0 -1
  365. package/dist/chunks/modelOptions-BBvF3wHK.js +0 -1
  366. package/dist/chunks/nativeInstaller-CdjmE9Zy.js +0 -1
  367. package/dist/chunks/onChangeAppState-DLjZ1x95.js +0 -1
  368. package/dist/chunks/open-BtQHzzL9.js +0 -1
  369. package/dist/chunks/openai-D46QvESE.js +0 -2
  370. package/dist/chunks/overlayContext-8--_fbvY.js +0 -1
  371. package/dist/chunks/parser-CG5RuOCK.js +0 -1
  372. package/dist/chunks/partition-DznN4XZH.js +0 -1
  373. package/dist/chunks/permissions-DmGFViHI.js +0 -3
  374. package/dist/chunks/pidLock-Cm4sW35f.js +0 -3
  375. package/dist/chunks/plan-CzGBz_87.js +0 -1
  376. package/dist/chunks/platform-BacQ6ACS.js +0 -2
  377. package/dist/chunks/plugin-CluR79xX.js +0 -17
  378. package/dist/chunks/pluginCliCommands-CJv5uhOG.js +0 -1
  379. package/dist/chunks/pluginOperations-CcUSHAIa.js +0 -2
  380. package/dist/chunks/pluginStartupCheck-CRBUO9gP.js +0 -1
  381. package/dist/chunks/plugins-IwwaCDba.js +0 -4
  382. package/dist/chunks/poorMode-B0QGV6Ci.js +0 -1
  383. package/dist/chunks/poorMode-G-pnu6NM.js +0 -1
  384. package/dist/chunks/print-CgszM1ea.js +0 -13
  385. package/dist/chunks/processBashCommand-D098WsqY.js +0 -1
  386. package/dist/chunks/processSlashCommand-DOQFjJ88.js +0 -5
  387. package/dist/chunks/prompt-BKPmDAuL.js +0 -1
  388. package/dist/chunks/prompt-CgOklk7z.js +0 -1
  389. package/dist/chunks/promptEditor-DoGHJN_W.js +0 -4
  390. package/dist/chunks/protocolHandler-DjQALaU2.js +0 -13
  391. package/dist/chunks/reconciler-ykkSPR-i.js +0 -1
  392. package/dist/chunks/refresh-Dn_I1R4v.js +0 -1
  393. package/dist/chunks/registerProtocol-CAsDme_E.js +0 -1
  394. package/dist/chunks/reject-DtcCfuZV.js +0 -1
  395. package/dist/chunks/rename-DyEfsZiq.js +0 -1
  396. package/dist/chunks/resume-BcXEDUqZ.js +0 -2
  397. package/dist/chunks/ripgrep-DLs8MraF.js +0 -1
  398. package/dist/chunks/ripgrep-Dl3y5r4m.js +0 -5
  399. package/dist/chunks/sandbox-adapter-DfB9kgQD.js +0 -1
  400. package/dist/chunks/sandbox-toggle-D9GDUsTl.js +0 -1
  401. package/dist/chunks/searchExtraTools-D4gMMQv0.js +0 -1
  402. package/dist/chunks/select-DIxfl_VN.js +0 -1
  403. package/dist/chunks/sessionFileAccessHooks-lbgHnVvi.js +0 -1
  404. package/dist/chunks/sessionObserver-D6qzEdGJ.js +0 -1
  405. package/dist/chunks/sessionStorage-C_7gow_z.js +0 -1
  406. package/dist/chunks/sessionTracing-CtbeAD0s.js +0 -11
  407. package/dist/chunks/settings-B2jvL8Dp.js +0 -24
  408. package/dist/chunks/settings-CisDe8DB.js +0 -1
  409. package/dist/chunks/setup-qecdf-ES.js +0 -3
  410. package/dist/chunks/sinks-C-lP7uyO.js +0 -1
  411. package/dist/chunks/sinks-De-B1lPQ.js +0 -1
  412. package/dist/chunks/skillChangeDetector-DkOJoNhT.js +0 -1
  413. package/dist/chunks/skills-BE5scC-g.js +0 -1
  414. package/dist/chunks/src-CHw1lvBc.js +0 -3
  415. package/dist/chunks/startupProfiler-BH0FoI66.js +0 -1
  416. package/dist/chunks/startupProfiler-CJdr3SxP.js +0 -3
  417. package/dist/chunks/state-BhOKSFi5.js +0 -1
  418. package/dist/chunks/status-Dw09WZLd.js +0 -1
  419. package/dist/chunks/statusNoticeHelpers-BRQpUIlH.js +0 -1
  420. package/dist/chunks/stringUtils-C718f5ey.js +0 -4
  421. package/dist/chunks/switcher-CgZVah7U.js +0 -1
  422. package/dist/chunks/switcher-DZwUo5Ed.js +0 -1
  423. package/dist/chunks/tipRegistry-B71o4qWr.js +0 -2
  424. package/dist/chunks/toolPool-V-7Yv0GA.js +0 -1
  425. package/dist/chunks/udsClient-cQz6nJ_T.js +0 -1
  426. package/dist/chunks/urlHandler-DLz3FZm1.js +0 -1
  427. package/dist/chunks/useExitOnCtrlCDWithKeybindings-BKwzUpgb.js +0 -1
  428. package/dist/chunks/useMainLoopModel-DxvV70Ru.js +0 -1
  429. package/dist/chunks/useManagePlugins-BXLXazrR.js +0 -1
  430. package/dist/chunks/useMergedTools-CCgnBJzO.js +0 -1
  431. package/dist/chunks/useSearchInput-CzopttqC.js +0 -1
  432. package/dist/chunks/useSettingsErrors-SFPWfxsA.js +0 -1
  433. package/dist/chunks/util-Cbb3S6SX.js +0 -1
  434. package/dist/chunks/validatePlugin-BMSoeb_b.js +0 -1
  435. package/dist/chunks/vim-CoRp9lY1.js +0 -1
  436. package/dist/chunks/worktree-Vm-SNY5x.js +0 -1
@@ -0,0 +1 @@
1
+ import{i as e,o as t}from"./envUtils-DZ_SvEVz.js";import{I as n,M as r,S as i,c as a,i as o,x as s,z as c}from"./debug-kBjDaVkQ.js";import{o as l}from"./log-DWZny1vM.js";import{i as u,r as d}from"./genericProcessUtils-CVtQOTO2.js";import"os";import{join as f}from"path";import"crypto";import{readFile as p,readdir as m}from"fs/promises";import"node:string_decoder";t(),o(),d(),n(),s(),n(),l(),s(),t(),o(),n(),s();function h(){return f(e(),`sessions`)}async function g(){let e=h(),t;try{t=await m(e)}catch(e){return c(e)||a(`[udsClient] readdir failed: ${r(e)}`),[]}let n=[];for(let r of t){if(!/^\d+\.json$/.test(r))continue;let t=parseInt(r.slice(0,-5),10);if(u(t))try{let a=i(await p(f(e,r),`utf8`));n.push({pid:t,sessionId:a.sessionId,cwd:a.cwd,startedAt:a.startedAt,kind:a.kind,name:a.name,messagingSocketPath:a.messagingSocketPath,entrypoint:a.entrypoint,bridgeSessionId:a.bridgeSessionId,alive:!0})}catch{}}return n}export{g as listAllLiveSessions};
@@ -0,0 +1 @@
1
+ async function e(e){return t()}function t(){for(let e of[`WORKMATE_URL_EVENT`,`WORKMATE_DEEP_LINK_URL`,`WORKMATE_URL`]){let t=process.env[e];if(n(t))return t}return process.argv.find(n)??null}function n(e){return typeof e==`string`&&e.length<=2048&&(e.startsWith(`claude-cli://`)||e.startsWith(`claude://`))}export{e as waitForUrlEvent};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{Iu as i,Lu as a,mb as o,md as s,pd as c}from"./loadAgentsDir-B0Anodo0.js";import{Bt as l,Gt as u,I as d,Lt as f,P as p,T as m,Wt as h,_ as g,ai as _,hn as v,t as y}from"./src-DL3w8VPk.js";import{t as b}from"./jsx-runtime-Bb4Xn-E0.js";import{D as x,O as S,n as C,t as w}from"./TextInput-B8ruWRf2.js";import{isDeepStrictEqual as T}from"util";import{pathToFileURL as E}from"url";function D({imageId:e,backgroundColor:t,isSelected:n=!1}){let r=i(e),a=`[Image #${e}]`;if(r&&l()){let e=E(r).href;return(0,O.jsx)(f,{url:e,fallback:(0,O.jsx)(p,{backgroundColor:t,inverse:n,children:a}),children:(0,O.jsx)(p,{backgroundColor:t,inverse:n,bold:n,children:a})})}return(0,O.jsx)(p,{backgroundColor:t,inverse:n,children:a})}var O,k=e((()=>{y(),a(),O=b()}));function A({isFocused:e,isSelected:t,children:n,description:r,shouldShowDownArrow:i,shouldShowUpArrow:a,declareCursor:o}){return(0,j.jsx)(g,{isFocused:e,isSelected:t,description:r,showScrollDown:i,showScrollUp:a,styled:!1,declareCursor:o,children:n})}var j,M=e((()=>{y(),j=b()}));function N({option:e,isFocused:t,isSelected:n,shouldShowDownArrow:r,shouldShowUpArrow:i,maxIndexWidth:a,index:o,inputValue:s,onInputChange:l,onSubmit:f,onExit:g,layout:_,children:y,showLabel:b=!1,onOpenEditor:S,resetCursorOnUpdate:C=!1,onImagePaste:T,pastedContents:E,onRemoveImage:O,imagesSelected:k,selectedImageIndex:j=0,onImagesSelectedChange:M,onSelectedImageIndexChange:N}){let I=E?Object.values(E).filter(e=>e.type===`image`):[],L=b||e.showLabelWithValue===!0,[R,z]=(0,P.useState)(s.length),B=(0,P.useRef)(!1);(0,P.useEffect)(()=>{C&&t&&(B.current?B.current=!1:z(s.length))},[C,t,s]),h(`chat:externalEditor`,()=>{S?.(s,l)},{context:`Chat`,isActive:t&&!!S}),h(`chat:imagePaste`,()=>{T&&x().then(e=>{e&&T(e.base64,e.mediaType,void 0,e.dimensions)})},{context:`Chat`,isActive:t&&!!T}),h(`attachments:remove`,()=>{I.length>0&&O&&O(I.at(-1).id)},{context:`Attachments`,isActive:t&&!k&&s===``&&I.length>0&&!!O}),u({"attachments:next":()=>{I.length>1&&N?.((j+1)%I.length)},"attachments:previous":()=>{I.length>1&&N?.((j-1+I.length)%I.length)},"attachments:remove":()=>{let e=I[j];e&&O&&(O(e.id),I.length<=1?M?.(!1):N?.(Math.min(j,I.length-2)))},"attachments:exit":()=>{M?.(!1)}},{context:`Attachments`,isActive:t&&!!k}),v((e,t)=>{t.upArrow&&M?.(!1)},{isActive:t&&!!k}),(0,P.useEffect)(()=>{!t&&k&&M?.(!1)},[t,k,M]);let V=_===`expanded`?a+3:a+4;return(0,F.jsxs)(d,{flexDirection:`column`,flexShrink:0,children:[(0,F.jsx)(A,{isFocused:t,isSelected:n,shouldShowDownArrow:r,shouldShowUpArrow:i,declareCursor:!1,children:(0,F.jsxs)(d,{flexDirection:`row`,flexShrink:_===`compact`?0:void 0,children:[(0,F.jsx)(p,{dimColor:!0,children:`${o}.`.padEnd(a+2)}),y,L?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(p,{color:t?`suggestion`:void 0,children:e.label}),t?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(p,{color:`suggestion`,children:e.labelValueSeparator??`, `}),(0,F.jsx)(w,{value:s,onChange:t=>{B.current=!0,l(t),e.onChange(t)},onSubmit:f,onExit:g,placeholder:e.placeholder,focus:!k,showCursor:!0,multiline:!0,cursorOffset:R,onChangeCursorOffset:z,columns:80,onImagePaste:T,onPaste:t=>{B.current=!0;let n=s.slice(0,R),r=s.slice(R),i=n+t+r;l(i),e.onChange(i),z(n.length+t.length)}})]}):s&&(0,F.jsxs)(p,{children:[e.labelValueSeparator??`, `,s]})]}):t?(0,F.jsx)(w,{value:s,onChange:t=>{B.current=!0,l(t),e.onChange(t)},onSubmit:f,onExit:g,placeholder:e.placeholder||(typeof e.label==`string`?e.label:void 0),focus:!k,showCursor:!0,multiline:!0,cursorOffset:R,onChangeCursorOffset:z,columns:80,onImagePaste:T,onPaste:t=>{B.current=!0;let n=s.slice(0,R),r=s.slice(R),i=n+t+r;l(i),e.onChange(i),z(n.length+t.length)}}):(0,F.jsx)(p,{color:s?void 0:`inactive`,children:s||e.placeholder||e.label})]})}),e.description&&(0,F.jsx)(d,{paddingLeft:V,children:(0,F.jsx)(p,{dimColor:e.dimDescription!==!1,color:n?`success`:t?`suggestion`:void 0,children:e.description})}),I.length>0&&(0,F.jsxs)(d,{flexDirection:`row`,gap:1,paddingLeft:V,children:[I.map((e,t)=>(0,F.jsx)(D,{imageId:e.id,isSelected:!!k&&t===j},e.id)),(0,F.jsx)(d,{flexGrow:1,justifyContent:`flex-start`,flexDirection:`row`,children:(0,F.jsx)(p,{dimColor:!0,children:k?(0,F.jsxs)(m,{children:[I.length>1&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(c,{action:`attachments:next`,context:`Attachments`,fallback:`→`,description:`next`}),(0,F.jsx)(c,{action:`attachments:previous`,context:`Attachments`,fallback:`←`,description:`prev`})]}),(0,F.jsx)(c,{action:`attachments:remove`,context:`Attachments`,fallback:`backspace`,description:`remove`}),(0,F.jsx)(c,{action:`attachments:exit`,context:`Attachments`,fallback:`esc`,description:`cancel`})]}):t?`(↓ to select)`:null})})]}),_===`expanded`&&(0,F.jsx)(p,{children:` `})]})}var P,F,I=e((()=>{P=t(_(),1),y(),o(),S(),k(),s(),C(),M(),F=b()})),L,R=e((()=>{n(),L=class extends Map{constructor(e){let t=[],n,i,a,o=0;for(let r of e){let e={label:r.label,value:r.value,description:r.description,previous:a,next:void 0,index:o};a&&(a.next=e),n||(n=e),i=e,t.push([r.value,e]),o++,a=e}super(t),r(this,`first`,void 0),r(this,`last`,void 0),this.first=n,this.last=i}}}));function z({visibleOptionCount:e=5,options:t,initialFocusValue:n,onFocus:r,focusValue:i}){let[a,o]=(0,B.useReducer)(V,{visibleOptionCount:e,options:t,initialFocusValue:i||n},H),s=(0,B.useRef)(r);s.current=r;let[c,l]=(0,B.useState)(t);t!==c&&!T(t,c)&&(o({type:`reset`,state:H({visibleOptionCount:e,options:t,initialFocusValue:i??a.focusedValue??n,currentViewport:{visibleFromIndex:a.visibleFromIndex,visibleToIndex:a.visibleToIndex}})}),l(t));let u=(0,B.useCallback)(()=>{o({type:`focus-next-option`})},[]),d=(0,B.useCallback)(()=>{o({type:`focus-previous-option`})},[]),f=(0,B.useCallback)(()=>{o({type:`focus-next-page`})},[]),p=(0,B.useCallback)(()=>{o({type:`focus-previous-page`})},[]),m=(0,B.useCallback)(e=>{e!==void 0&&o({type:`set-focus`,value:e})},[]),h=(0,B.useMemo)(()=>t.map((e,t)=>({...e,index:t})).slice(a.visibleFromIndex,a.visibleToIndex),[t,a.visibleFromIndex,a.visibleToIndex]),g=(0,B.useMemo)(()=>{if(a.focusedValue!==void 0)return t.some(e=>e.value===a.focusedValue)?a.focusedValue:t[0]?.value},[a.focusedValue,t]),_=(0,B.useMemo)(()=>t.find(e=>e.value===g)?.type===`input`,[g,t]);return(0,B.useEffect)(()=>{g!==void 0&&s.current?.(g)},[g]),(0,B.useEffect)(()=>{i!==void 0&&o({type:`set-focus`,value:i})},[i]),{focusedValue:g,focusedIndex:(0,B.useMemo)(()=>{if(g===void 0)return 0;let e=t.findIndex(e=>e.value===g);return e>=0?e+1:0},[g,t]),visibleFromIndex:a.visibleFromIndex,visibleToIndex:a.visibleToIndex,visibleOptions:h,isInInput:_??!1,focusNextOption:u,focusPreviousOption:d,focusNextPage:f,focusPreviousPage:p,focusOption:m,options:t}}var B,V,H,U=e((()=>{B=t(_(),1),R(),V=(e,t)=>{switch(t.type){case`focus-next-option`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=t.next||e.optionMap.first;if(!n)return e;if(!t.next&&n===e.optionMap.first)return{...e,focusedValue:n.value,visibleFromIndex:0,visibleToIndex:e.visibleOptionCount};if(!(n.index>=e.visibleToIndex))return{...e,focusedValue:n.value};let r=Math.min(e.optionMap.size,e.visibleToIndex+1),i=r-e.visibleOptionCount;return{...e,focusedValue:n.value,visibleFromIndex:i,visibleToIndex:r}}case`focus-previous-option`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=t.previous||e.optionMap.last;if(!n)return e;if(!t.previous&&n===e.optionMap.last){let t=e.optionMap.size,r=Math.max(0,t-e.visibleOptionCount);return{...e,focusedValue:n.value,visibleFromIndex:r,visibleToIndex:t}}if(!(n.index<=e.visibleFromIndex))return{...e,focusedValue:n.value};let r=Math.max(0,e.visibleFromIndex-1),i=r+e.visibleOptionCount;return{...e,focusedValue:n.value,visibleFromIndex:r,visibleToIndex:i}}case`focus-next-page`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=Math.min(e.optionMap.size-1,t.index+e.visibleOptionCount),r=e.optionMap.first;for(;r&&r.index<n&&r.next;)r=r.next;if(!r)return e;let i=Math.min(e.optionMap.size,r.index+1),a=Math.max(0,i-e.visibleOptionCount);return{...e,focusedValue:r.value,visibleFromIndex:a,visibleToIndex:i}}case`focus-previous-page`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=Math.max(0,t.index-e.visibleOptionCount),r=e.optionMap.first;for(;r&&r.index<n&&r.next;)r=r.next;if(!r)return e;let i=Math.max(0,r.index),a=Math.min(e.optionMap.size,i+e.visibleOptionCount);return{...e,focusedValue:r.value,visibleFromIndex:i,visibleToIndex:a}}case`reset`:return t.state;case`set-focus`:{if(e.focusedValue===t.value)return e;let n=e.optionMap.get(t.value);if(!n)return e;if(n.index>=e.visibleFromIndex&&n.index<e.visibleToIndex)return{...e,focusedValue:t.value};let r,i;return n.index<e.visibleFromIndex?(r=n.index,i=Math.min(e.optionMap.size,r+e.visibleOptionCount)):(i=Math.min(e.optionMap.size,n.index+1),r=Math.max(0,i-e.visibleOptionCount)),{...e,focusedValue:t.value,visibleFromIndex:r,visibleToIndex:i}}}},H=({visibleOptionCount:e,options:t,initialFocusValue:n,currentViewport:r})=>{let i=typeof e==`number`?Math.min(e,t.length):t.length,a=new L(t),o=n!==void 0&&a.get(n),s=o?n:a.first?.value,c=0,l=i;if(o){let e=o.index;r?e>=r.visibleFromIndex&&e<r.visibleToIndex?(c=r.visibleFromIndex,l=Math.min(a.size,r.visibleToIndex)):e<r.visibleFromIndex?(c=e,l=Math.min(a.size,c+i)):(l=Math.min(a.size,e+1),c=Math.max(0,l-i)):e>=i&&(l=Math.min(a.size,e+1),c=Math.max(0,l-i)),c=Math.max(0,Math.min(c,a.size-1)),l=Math.min(a.size,Math.max(i,l))}return{optionMap:a,visibleOptionCount:i,focusedValue:s,visibleFromIndex:c,visibleToIndex:l}}}));export{A as a,I as i,z as n,M as o,N as r,U as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{Bt as i,Gt as a,I as o,Lt as s,P as c,T as l,Wt as u,_ as d,ai as f,hn as p,t as m}from"./src-WZ94ZKI3.js";import{t as h}from"./jsx-runtime-Bb4Xn-E0.js";import{Lu as g,Ru as _,hd as v,md as y,tb as b}from"./loadAgentsDir-DR5PVAc3.js";import{D as x,O as S,n as C,t as w}from"./TextInput-BboKIug2.js";import{isDeepStrictEqual as T}from"util";import{pathToFileURL as E}from"url";function D({imageId:e,backgroundColor:t,isSelected:n=!1}){let r=g(e),a=`[Image #${e}]`;if(r&&i()){let e=E(r).href;return(0,O.jsx)(s,{url:e,fallback:(0,O.jsx)(c,{backgroundColor:t,inverse:n,children:a}),children:(0,O.jsx)(c,{backgroundColor:t,inverse:n,bold:n,children:a})})}return(0,O.jsx)(c,{backgroundColor:t,inverse:n,children:a})}var O,k=e((()=>{m(),_(),O=h()}));function A({isFocused:e,isSelected:t,children:n,description:r,shouldShowDownArrow:i,shouldShowUpArrow:a,declareCursor:o}){return(0,j.jsx)(d,{isFocused:e,isSelected:t,description:r,showScrollDown:i,showScrollUp:a,styled:!1,declareCursor:o,children:n})}var j,M=e((()=>{m(),j=h()}));function N({option:e,isFocused:t,isSelected:n,shouldShowDownArrow:r,shouldShowUpArrow:i,maxIndexWidth:s,index:d,inputValue:f,onInputChange:m,onSubmit:h,onExit:g,layout:_,children:v,showLabel:b=!1,onOpenEditor:S,resetCursorOnUpdate:C=!1,onImagePaste:T,pastedContents:E,onRemoveImage:O,imagesSelected:k,selectedImageIndex:j=0,onImagesSelectedChange:M,onSelectedImageIndexChange:N}){let I=E?Object.values(E).filter(e=>e.type===`image`):[],L=b||e.showLabelWithValue===!0,[R,z]=(0,P.useState)(f.length),B=(0,P.useRef)(!1);(0,P.useEffect)(()=>{C&&t&&(B.current?B.current=!1:z(f.length))},[C,t,f]),u(`chat:externalEditor`,()=>{S?.(f,m)},{context:`Chat`,isActive:t&&!!S}),u(`chat:imagePaste`,()=>{T&&x().then(e=>{e&&T(e.base64,e.mediaType,void 0,e.dimensions)})},{context:`Chat`,isActive:t&&!!T}),u(`attachments:remove`,()=>{I.length>0&&O&&O(I.at(-1).id)},{context:`Attachments`,isActive:t&&!k&&f===``&&I.length>0&&!!O}),a({"attachments:next":()=>{I.length>1&&N?.((j+1)%I.length)},"attachments:previous":()=>{I.length>1&&N?.((j-1+I.length)%I.length)},"attachments:remove":()=>{let e=I[j];e&&O&&(O(e.id),I.length<=1?M?.(!1):N?.(Math.min(j,I.length-2)))},"attachments:exit":()=>{M?.(!1)}},{context:`Attachments`,isActive:t&&!!k}),p((e,t)=>{t.upArrow&&M?.(!1)},{isActive:t&&!!k}),(0,P.useEffect)(()=>{!t&&k&&M?.(!1)},[t,k,M]);let V=_===`expanded`?s+3:s+4;return(0,F.jsxs)(o,{flexDirection:`column`,flexShrink:0,children:[(0,F.jsx)(A,{isFocused:t,isSelected:n,shouldShowDownArrow:r,shouldShowUpArrow:i,declareCursor:!1,children:(0,F.jsxs)(o,{flexDirection:`row`,flexShrink:_===`compact`?0:void 0,children:[(0,F.jsx)(c,{dimColor:!0,children:`${d}.`.padEnd(s+2)}),v,L?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(c,{color:t?`suggestion`:void 0,children:e.label}),t?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(c,{color:`suggestion`,children:e.labelValueSeparator??`, `}),(0,F.jsx)(w,{value:f,onChange:t=>{B.current=!0,m(t),e.onChange(t)},onSubmit:h,onExit:g,placeholder:e.placeholder,focus:!k,showCursor:!0,multiline:!0,cursorOffset:R,onChangeCursorOffset:z,columns:80,onImagePaste:T,onPaste:t=>{B.current=!0;let n=f.slice(0,R),r=f.slice(R),i=n+t+r;m(i),e.onChange(i),z(n.length+t.length)}})]}):f&&(0,F.jsxs)(c,{children:[e.labelValueSeparator??`, `,f]})]}):t?(0,F.jsx)(w,{value:f,onChange:t=>{B.current=!0,m(t),e.onChange(t)},onSubmit:h,onExit:g,placeholder:e.placeholder||(typeof e.label==`string`?e.label:void 0),focus:!k,showCursor:!0,multiline:!0,cursorOffset:R,onChangeCursorOffset:z,columns:80,onImagePaste:T,onPaste:t=>{B.current=!0;let n=f.slice(0,R),r=f.slice(R),i=n+t+r;m(i),e.onChange(i),z(n.length+t.length)}}):(0,F.jsx)(c,{color:f?void 0:`inactive`,children:f||e.placeholder||e.label})]})}),e.description&&(0,F.jsx)(o,{paddingLeft:V,children:(0,F.jsx)(c,{dimColor:e.dimDescription!==!1,color:n?`success`:t?`suggestion`:void 0,children:e.description})}),I.length>0&&(0,F.jsxs)(o,{flexDirection:`row`,gap:1,paddingLeft:V,children:[I.map((e,t)=>(0,F.jsx)(D,{imageId:e.id,isSelected:!!k&&t===j},e.id)),(0,F.jsx)(o,{flexGrow:1,justifyContent:`flex-start`,flexDirection:`row`,children:(0,F.jsx)(c,{dimColor:!0,children:k?(0,F.jsxs)(l,{children:[I.length>1&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(y,{action:`attachments:next`,context:`Attachments`,fallback:`→`,description:`next`}),(0,F.jsx)(y,{action:`attachments:previous`,context:`Attachments`,fallback:`←`,description:`prev`})]}),(0,F.jsx)(y,{action:`attachments:remove`,context:`Attachments`,fallback:`backspace`,description:`remove`}),(0,F.jsx)(y,{action:`attachments:exit`,context:`Attachments`,fallback:`esc`,description:`cancel`})]}):t?`(↓ to select)`:null})})]}),_===`expanded`&&(0,F.jsx)(c,{children:` `})]})}var P,F,I=e((()=>{P=t(f(),1),m(),b(),S(),k(),v(),C(),M(),F=h()})),L,R=e((()=>{n(),L=class extends Map{constructor(e){let t=[],n,i,a,o=0;for(let r of e){let e={label:r.label,value:r.value,description:r.description,previous:a,next:void 0,index:o};a&&(a.next=e),n||(n=e),i=e,t.push([r.value,e]),o++,a=e}super(t),r(this,`first`,void 0),r(this,`last`,void 0),this.first=n,this.last=i}}}));function z({visibleOptionCount:e=5,options:t,initialFocusValue:n,onFocus:r,focusValue:i}){let[a,o]=(0,B.useReducer)(V,{visibleOptionCount:e,options:t,initialFocusValue:i||n},H),s=(0,B.useRef)(r);s.current=r;let[c,l]=(0,B.useState)(t);t!==c&&!T(t,c)&&(o({type:`reset`,state:H({visibleOptionCount:e,options:t,initialFocusValue:i??a.focusedValue??n,currentViewport:{visibleFromIndex:a.visibleFromIndex,visibleToIndex:a.visibleToIndex}})}),l(t));let u=(0,B.useCallback)(()=>{o({type:`focus-next-option`})},[]),d=(0,B.useCallback)(()=>{o({type:`focus-previous-option`})},[]),f=(0,B.useCallback)(()=>{o({type:`focus-next-page`})},[]),p=(0,B.useCallback)(()=>{o({type:`focus-previous-page`})},[]),m=(0,B.useCallback)(e=>{e!==void 0&&o({type:`set-focus`,value:e})},[]),h=(0,B.useMemo)(()=>t.map((e,t)=>({...e,index:t})).slice(a.visibleFromIndex,a.visibleToIndex),[t,a.visibleFromIndex,a.visibleToIndex]),g=(0,B.useMemo)(()=>{if(a.focusedValue!==void 0)return t.some(e=>e.value===a.focusedValue)?a.focusedValue:t[0]?.value},[a.focusedValue,t]),_=(0,B.useMemo)(()=>t.find(e=>e.value===g)?.type===`input`,[g,t]);return(0,B.useEffect)(()=>{g!==void 0&&s.current?.(g)},[g]),(0,B.useEffect)(()=>{i!==void 0&&o({type:`set-focus`,value:i})},[i]),{focusedValue:g,focusedIndex:(0,B.useMemo)(()=>{if(g===void 0)return 0;let e=t.findIndex(e=>e.value===g);return e>=0?e+1:0},[g,t]),visibleFromIndex:a.visibleFromIndex,visibleToIndex:a.visibleToIndex,visibleOptions:h,isInInput:_??!1,focusNextOption:u,focusPreviousOption:d,focusNextPage:f,focusPreviousPage:p,focusOption:m,options:t}}var B,V,H,U=e((()=>{B=t(f(),1),R(),V=(e,t)=>{switch(t.type){case`focus-next-option`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=t.next||e.optionMap.first;if(!n)return e;if(!t.next&&n===e.optionMap.first)return{...e,focusedValue:n.value,visibleFromIndex:0,visibleToIndex:e.visibleOptionCount};if(!(n.index>=e.visibleToIndex))return{...e,focusedValue:n.value};let r=Math.min(e.optionMap.size,e.visibleToIndex+1),i=r-e.visibleOptionCount;return{...e,focusedValue:n.value,visibleFromIndex:i,visibleToIndex:r}}case`focus-previous-option`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=t.previous||e.optionMap.last;if(!n)return e;if(!t.previous&&n===e.optionMap.last){let t=e.optionMap.size,r=Math.max(0,t-e.visibleOptionCount);return{...e,focusedValue:n.value,visibleFromIndex:r,visibleToIndex:t}}if(!(n.index<=e.visibleFromIndex))return{...e,focusedValue:n.value};let r=Math.max(0,e.visibleFromIndex-1),i=r+e.visibleOptionCount;return{...e,focusedValue:n.value,visibleFromIndex:r,visibleToIndex:i}}case`focus-next-page`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=Math.min(e.optionMap.size-1,t.index+e.visibleOptionCount),r=e.optionMap.first;for(;r&&r.index<n&&r.next;)r=r.next;if(!r)return e;let i=Math.min(e.optionMap.size,r.index+1),a=Math.max(0,i-e.visibleOptionCount);return{...e,focusedValue:r.value,visibleFromIndex:a,visibleToIndex:i}}case`focus-previous-page`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=Math.max(0,t.index-e.visibleOptionCount),r=e.optionMap.first;for(;r&&r.index<n&&r.next;)r=r.next;if(!r)return e;let i=Math.max(0,r.index),a=Math.min(e.optionMap.size,i+e.visibleOptionCount);return{...e,focusedValue:r.value,visibleFromIndex:i,visibleToIndex:a}}case`reset`:return t.state;case`set-focus`:{if(e.focusedValue===t.value)return e;let n=e.optionMap.get(t.value);if(!n)return e;if(n.index>=e.visibleFromIndex&&n.index<e.visibleToIndex)return{...e,focusedValue:t.value};let r,i;return n.index<e.visibleFromIndex?(r=n.index,i=Math.min(e.optionMap.size,r+e.visibleOptionCount)):(i=Math.min(e.optionMap.size,n.index+1),r=Math.max(0,i-e.visibleOptionCount)),{...e,focusedValue:t.value,visibleFromIndex:r,visibleToIndex:i}}}},H=({visibleOptionCount:e,options:t,initialFocusValue:n,currentViewport:r})=>{let i=typeof e==`number`?Math.min(e,t.length):t.length,a=new L(t),o=n!==void 0&&a.get(n),s=o?n:a.first?.value,c=0,l=i;if(o){let e=o.index;r?e>=r.visibleFromIndex&&e<r.visibleToIndex?(c=r.visibleFromIndex,l=Math.min(a.size,r.visibleToIndex)):e<r.visibleFromIndex?(c=e,l=Math.min(a.size,c+i)):(l=Math.min(a.size,e+1),c=Math.max(0,l-i)):e>=i&&(l=Math.min(a.size,e+1),c=Math.max(0,l-i)),c=Math.max(0,Math.min(c,a.size-1)),l=Math.min(a.size,Math.max(i,l))}return{optionMap:a,visibleOptionCount:i,focusedValue:s,visibleFromIndex:c,visibleToIndex:l}}}));export{A as a,I as i,z as n,M as o,N as r,U as t};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./src-DL3w8VPk.js";var n=e((()=>{t()}));export{n as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./src-WZ94ZKI3.js";var n=e((()=>{t()}));export{n as t};
@@ -0,0 +1 @@
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as n,ai as r,et as i,t as a,vt as o}from"./src-WZ94ZKI3.js";import{tb as s}from"./loadAgentsDir-DR5PVAc3.js";import{t as c}from"./useDoublePress-DQBLKyzJ.js";function l(e,t,n,r=!0){let{exit:a}=o(),[s,c]=(0,u.useState)({pending:!1,keyName:null}),l=(0,u.useMemo)(()=>n??a,[n,a]),d=i(e=>c({pending:e,keyName:`Ctrl-C`}),l),f=i(e=>c({pending:e,keyName:`Ctrl-D`}),l),p=(0,u.useCallback)(()=>{t?.()||d()},[d,t]),m=(0,u.useCallback)(()=>{f()},[f]);return e((0,u.useMemo)(()=>({"app:interrupt":p,"app:exit":m}),[p,m]),{context:`Global`,isActive:r}),s}var u,d=e((()=>{u=t(r(),1),a(),c()}));function f(e,t,r){return l(n,t,e,r)}var p=e((()=>{s(),d()}));export{f as n,p as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bh as t,zh as n}from"./loadAgentsDir-DR5PVAc3.js";import{f as r,i,v as a}from"./model-D42epddJ.js";function o(){let e=t(e=>e.mainLoopModel);return a(t(e=>e.mainLoopModelForSession)??e??i())}var s=e((()=>{n(),r()}));export{o as n,s as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t}from"./src-WZ94ZKI3.js";import{Bh as n,Fa as r,Go as i,Hh as a,Hm as o,Km as s,Ko as c,Pa as l,Wm as u,Xo as d,Zo as f,_f as p,c_ as m,qm as h,s_ as g,vf as _,zh as v}from"./loadAgentsDir-DR5PVAc3.js";import{I as y,V as b,c as x,i as S}from"./debug-kBjDaVkQ.js";import{Bn as C,Kr as w,qr as T,zn as E}from"./settings-YIDksG5Z.js";import{o as D,s as O}from"./log-DWZny1vM.js";import{n as k}from"./analytics-COpjZpvd.js";import{n as A,t as j}from"./notifications-dGBuNvFj.js";import{n as M,r as N}from"./pluginFlagging-BCj9LJP3.js";import{t as P}from"./pluginBlocklist-DAoUENwc.js";var F=e(t(),1);j(),k(),o(),v(),C(),S(),w(),y(),D(),d(),c(),g(),s(),p(),N(),l();function I({enabled:e=!0}={}){let t=a(),o=n(e=>e.plugins.needsRefresh),{addNotification:s}=A(),c=(0,F.useCallback)(async()=>{try{let{enabled:e,disabled:n,errors:a}=await r();await P();let o=M();Object.keys(o).length>0&&s({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let c=[],l=[];try{c=await i()}catch(e){let t=e instanceof Error?e.message:String(e);a.push({type:`generic-error`,source:`plugin-commands`,error:`Failed to load plugin commands: ${t}`})}try{l=await f()}catch(e){let t=e instanceof Error?e.message:String(e);a.push({type:`generic-error`,source:`plugin-agents`,error:`Failed to load plugin agents: ${t}`})}try{await m()}catch(e){let t=e instanceof Error?e.message:String(e);a.push({type:`generic-error`,source:`plugin-hooks`,error:`Failed to load plugin hooks: ${t}`})}let d=(await Promise.all(e.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await _(e,a);return t&&(e.mcpServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0),p=(await Promise.all(e.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await h(e,a);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);u(),t(t=>{let r=t.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),i=new Set(a.map(e=>e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`)),o=[...r.filter(e=>{let t=e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`;return!i.has(t)}),...a];return{...t,plugins:{...t.plugins,enabled:e,disabled:n,commands:c,errors:o}}}),x(`Loaded plugins - Enabled: ${e.length}, Disabled: ${n.length}, Commands: ${c.length}, Agents: ${l.length}, Errors: ${a.length}`);let g=e.reduce((e,t)=>t.hooksConfig?e+Object.values(t.hooksConfig).reduce((e,t)=>e+(t?.reduce((e,t)=>e+t.hooks.length,0)??0),0):e,0);return{enabled_count:e.length,disabled_count:n.length,inline_count:E(e,e=>e.source.endsWith(`@inline`)),marketplace_count:E(e,e=>!e.source.endsWith(`@inline`)),error_count:a.length,skill_count:c.length,agent_count:l.length,hook_count:g,mcp_count:d,lsp_count:p}}catch(e){let n=b(e);return O(n),x(`Error loading plugins: ${e}`),t(e=>{let t=e.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r={type:`generic-error`,source:`plugin-system`,error:n.message};return{...e,plugins:{...e.plugins,enabled:[],disabled:[],commands:[],errors:[...t,r]}}}),{enabled_count:0,disabled_count:0,inline_count:0,marketplace_count:0,error_count:1,skill_count:0,agent_count:0,hook_count:0,mcp_count:0,lsp_count:0,load_failed:!0,ant_enabled_names:void 0}}},[t,s]);(0,F.useEffect)(()=>{e&&c().then(e=>{let{ant_enabled_names:t,...n}=e,r={...n,has_custom_plugin_cache_dir:!!process.env.WORKMATE_PLUGIN_CACHE_DIR};({...r,...t!==void 0&&{enabled_names:t}}),T(`info`,`tengu_plugins_loaded`,r)})},[c,e]),(0,F.useEffect)(()=>{!e||!o||s({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,o,s])}export{I as t};
@@ -0,0 +1 @@
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as n}from"./src-WZ94ZKI3.js";import{Cc as r,Dc as i}from"./loadAgentsDir-DR5PVAc3.js";import{n as a,t as o}from"./toolPool-BcwIF8Q_.js";function s(e,t,n){return(0,c.useMemo)(()=>a(e,r(n,t),n.mode),[e,t,n,!1,!1])}var c,l=e((()=>{c=t(n(),1),i(),o()}));export{s as n,l as t};
@@ -0,0 +1 @@
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Vn as n,ai as r,hn as i,ot as a,t as o}from"./src-WZ94ZKI3.js";import{sb as s}from"./loadAgentsDir-DR5PVAc3.js";import{_ as c,b as l,d as u,g as d,h as f,l as p,u as m,v as h,y as g}from"./TextInput-BboKIug2.js";function _(e){return!!(e.ctrl&&(e.key===`k`||e.key===`u`||e.key===`w`)||e.meta&&e.key===`backspace`)}function v(e){return(e.ctrl||e.meta)&&e.key===`y`}function y({isActive:e,onExit:t,onCancel:r,onExitUp:o,columns:s,passthroughCtrlKeys:u=[],initialQuery:y=``,backspaceExitsOnEmpty:S=!0}){let{columns:C}=a(),w=s??C,[T,E]=(0,b.useState)(y),[D,O]=(0,b.useState)(y.length),k=(0,b.useCallback)(e=>{E(e),O(e.length)},[]),A=n=>{if(!e)return;let i=p.fromText(T,w,D);if(!(n.ctrl&&u.includes(n.key.toLowerCase()))){if(_(n)||c(),v(n)||h(),n.key===`return`||n.key===`down`){n.preventDefault(),t();return}if(n.key===`up`){n.preventDefault(),o&&o();return}if(n.key===`escape`){n.preventDefault(),r?r():T.length>0?(E(``),O(0)):t();return}if(n.key===`backspace`){if(n.preventDefault(),n.meta){let{cursor:e,killed:t}=i.deleteWordBefore();f(t,`prepend`),E(e.text),O(e.offset);return}if(T.length===0){S&&(r??t)();return}let e=i.backspace();E(e.text),O(e.offset);return}if(n.key===`delete`){n.preventDefault();let e=i.del();E(e.text),O(e.offset);return}if(n.key===`left`&&(n.ctrl||n.meta||n.fn)){n.preventDefault();let e=i.prevWord();O(e.offset);return}if(n.key===`right`&&(n.ctrl||n.meta||n.fn)){n.preventDefault();let e=i.nextWord();O(e.offset);return}if(n.key===`left`){n.preventDefault();let e=i.left();O(e.offset);return}if(n.key===`right`){n.preventDefault();let e=i.right();O(e.offset);return}if(n.key===`home`){n.preventDefault(),O(0);return}if(n.key===`end`){n.preventDefault(),O(T.length);return}if(n.ctrl){switch(n.preventDefault(),n.key.toLowerCase()){case`a`:O(0);return;case`e`:O(T.length);return;case`b`:O(i.left().offset);return;case`f`:O(i.right().offset);return;case`d`:{if(T.length===0){(r??t)();return}let e=i.del();E(e.text),O(e.offset);return}case`h`:{if(T.length===0){S&&(r??t)();return}let e=i.backspace();E(e.text),O(e.offset);return}case`k`:{let{cursor:e,killed:t}=i.deleteToLineEnd();f(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=i.deleteToLineStart();f(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=i.deleteWordBefore();f(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=m();if(e.length>0){let t=i.offset,n=i.insert(e);d(t,e.length),E(n.text),O(n.offset)}return}case`g`:case`c`:if(r){r();return}}return}if(n.meta){switch(n.preventDefault(),n.key.toLowerCase()){case`b`:O(i.prevWord().offset);return;case`f`:O(i.nextWord().offset);return;case`d`:{let e=i.deleteWordAfter();E(e.text),O(e.offset);return}case`y`:{let e=l();if(e){let{text:t,start:n,length:r}=e,i=T.slice(0,n),a=T.slice(n+r),o=i+t+a,s=n+t.length;g(t.length),E(o),O(s)}return}}return}if(n.key!==`tab`&&n.key.length>=1&&!x.has(n.key)){n.preventDefault();let e=i.insert(n.key);E(e.text),O(e.offset)}}};return i((e,t,r)=>{A(new n(r.keypress))},{isActive:e}),{query:T,setQuery:k,cursorOffset:D,handleKeyDown:A}}var b,x,S=e((()=>{b=t(r(),1),o(),u(),s(),x=new Set([`pageup`,`pagedown`,`insert`,`wheelup`,`wheeldown`,`mouse`,`f1`,`f2`,`f3`,`f4`,`f5`,`f6`,`f7`,`f8`,`f9`,`f10`,`f11`,`f12`])}));export{y as n,S as t};
@@ -0,0 +1 @@
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as n}from"./src-WZ94ZKI3.js";import{Gh as r,Kh as i}from"./loadAgentsDir-DR5PVAc3.js";import{n as a,t as o}from"./notifications-dGBuNvFj.js";import{n as s,t as c}from"./allErrors-CxPNR2WN.js";function l(){let{addNotification:e,removeNotification:t}=a(),[n,r]=(0,u.useState)(()=>{let{errors:e}=c();return e});return i((0,u.useCallback)(()=>{let{errors:e}=c();r(e)},[])),(0,u.useEffect)(()=>{if(n.length>0){let t=`Found ${n.length} settings ${n.length===1?`issue`:`issues`} · /doctor for details`;e({key:d,text:t,color:`warning`,priority:`high`,timeoutMs:6e4})}else t(d)},[n,e,t]),n}var u,d,f=e((()=>{u=t(n(),1),o(),s(),r(),d=`settings-errors`}));export{l as n,f as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t}from"./src-WZ94ZKI3.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{Lh as r,zh as i}from"./loadAgentsDir-DR5PVAc3.js";import{n as a}from"./analytics-COpjZpvd.js";import{t as o}from"./KeybindingProviderSetup-CSUkJHTT.js";import{t as s}from"./useManagePlugins-CrWjzESW.js";import{n as c,t as l}from"./MCPConnectionManager-Bn1PDn3R.js";import{cwd as u}from"process";var d=e(t(),1);a(),c(),i();var f=n(),p=d.lazy(()=>import(`./Doctor-BU69VQzw.js`).then(e=>({default:e.Doctor})));function m({onDone:e}){return s(),(0,f.jsx)(d.Suspense,{fallback:null,children:(0,f.jsx)(p,{onDone:e})})}async function h(e){await new Promise(t=>{e.render((0,f.jsx)(r,{children:(0,f.jsx)(o,{children:(0,f.jsx)(l,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1,children:(0,f.jsx)(m,{onDone:()=>{t()}})})})}))}),e.unmount(),process.exit(0)}async function g(e,t){let{setup:n}=await import(`./setup-BBvZyrfz.js`);await n(u(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-ACGY0vhM.js`);await new Promise(n=>{let i=[];e&&i.push(e),t.force&&i.push(`--force`),r.call(e=>{n(),process.exit(+!!e.includes(`failed`))},{},i)})}export{h as doctorHandler,g as installHandler};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{N as r,b as i}from"./types-CD25a50S.js";import{_w as a,bw as o,cx as s,gx as c,hx as l,lx as u,mx as d,vw as ee,xw as f}from"./loadAgentsDir-DR5PVAc3.js";import{C as p,I as m,M as h,N as g,R as _,S as v,c as y,f as b,i as te,u as x,x as S}from"./debug-kBjDaVkQ.js";import{dt as C,gt as w,ht as T,mt as ne,pt as re}from"./settings-YIDksG5Z.js";import{o as ie,s as E}from"./log-DWZny1vM.js";import{homedir as ae}from"os";import*as D from"path";import{join as oe,resolve as se}from"path";import{randomBytes as O}from"crypto";import{readFile as k,readdir as A,rename as j,stat as M,unlink as N,writeFile as P}from"fs/promises";function F(){return oe(s(),H)}async function I(){let e=F();try{let t=v(await k(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return y(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==V)return y(`Install counts cache version mismatch (got ${n.version}, expected ${V})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return y(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(y(`Install counts cache has invalid fetchedAt timestamp`),null):n.counts.every(e=>typeof e==`object`&&!!e&&typeof e.plugin==`string`&&typeof e.unique_installs==`number`)?Date.now()-r>W?(y(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(y(`Install counts cache has malformed entries`),null)}catch(e){return g(e)!==`ENOENT`&&y(`Failed to load install counts cache: ${h(e)}`),null}}async function L(e){let t=F(),n=`${t}.${O(8).toString(`hex`)}.tmp`;try{let r=s();await x().mkdir(r),await P(n,p(e,null,2),{encoding:`utf-8`,mode:384}),await j(n,t),y(`Install counts cache saved successfully`)}catch(e){E(e);try{await N(n)}catch{}}}async function R(){y(`Fetching install counts from ${U}`);let e=performance.now();try{let n=await t.get(U,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return c(`install_counts`,U,`success`,performance.now()-e),n.data.plugins}catch(t){throw c(`install_counts`,U,`failure`,performance.now()-e,d(t)),t}}async function z(){let e=await I();if(e){y(`Using cached install counts`),c(`install_counts`,U,`cache_hit`,0);let t=new Map;for(let n of e.counts)t.set(n.plugin,n.unique_installs);return t}try{let e=await R();await L({version:V,fetchedAt:new Date().toISOString(),counts:e});let t=new Map;for(let n of e)t.set(n.plugin,n.unique_installs);return t}catch(e){return E(e),y(`Failed to fetch install counts: ${h(e)}`),null}}function B(e){if(e<1e3)return String(e);if(e<1e6){let t=(e/1e3).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}K`:`${t}K`}let t=(e/1e6).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}M`:`${t}M`}var V,H,U,W,G=e((()=>{n(),te(),m(),b(),ie(),S(),l(),u(),V=1,H=`install-counts-cache.json`,U=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,W=1440*60*1e3}));async function K(e){let t=e.trim(),n=x(),r=t.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(r?.[1]){let e=r[1],t=r[3];return t?{source:`git`,url:e,ref:t}:{source:`git`,url:e}}if(t.startsWith(`http://`)||t.startsWith(`https://`)){let e=t.match(/^([^#]+)(#(.+))?$/),n=e?.[1]||t,r=e?.[3];if(n.endsWith(`.git`)||n.includes(`/_git/`))return r?{source:`git`,url:n,ref:r}:{source:`git`,url:n};let i;try{i=new URL(n)}catch{return{source:`url`,url:n}}if((i.hostname===`github.com`||i.hostname===`www.github.com`)&&i.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let e=n.endsWith(`.git`)?n:`${n}.git`;return r?{source:`git`,url:e,ref:r}:{source:`git`,url:e}}return{source:`url`,url:n}}let i=process.platform===`win32`&&(t.startsWith(`.\\`)||t.startsWith(`..\\`)||/^[a-zA-Z]:[/\\]/.test(t));if(t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)||t.startsWith(`~`)||i){let e=se(t.startsWith(`~`)?t.replace(/^~/,ae()):t),r;try{r=await n.stat(e)}catch(t){let n=g(t);return{error:n===`ENOENT`?`Path does not exist: ${e}`:`Cannot access path: ${e} (${n??t})`}}return r.isFile()?e.endsWith(`.json`)?{source:`file`,path:e}:{error:`File path must point to a .json file (marketplace.json), but got: ${e}`}:r.isDirectory()?{source:`directory`,path:e}:{error:`Path is neither a file nor a directory: ${e}`}}if(t.includes(`/`)&&!t.startsWith(`@`)){if(t.includes(`:`))return null;let e=t.match(/^([^#@]+)(?:[#@](.+))?$/),n=e?.[1]||t,r=e?.[2];return r?{source:`github`,repo:n,ref:r}:{source:`github`,repo:n}}return null}var ce=e((()=>{m(),b()}));function le(e){let t=D.basename(e),n=D.basename(D.dirname(e));return t===`plugin.json`?`plugin`:t===`marketplace.json`?`marketplace`:n===`.claude-plugin`?`plugin`:`unknown`}function q(e){return e.issues.map(e=>({path:e.path.join(`.`)||`root`,message:e.message,code:e.code}))}function J(e,t,n,r){e.includes(`..`)&&n.push({path:t,message:r?`Path contains "..": ${e}. ${r}`:`Path contains ".." which could be a path traversal attempt: ${e}`})}function ue(e){let t=e.replace(/^(\.\.\/)+/,``);return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${t===e?`./plugins/my-plugin`:`./${t}`}" instead of "${e}".`}async function Y(e){let t=[],n=[],r=D.resolve(e),i;try{i=await k(r,{encoding:`utf-8`})}catch(e){let t=g(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${h(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=v(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${h(e)}`}],warnings:[],filePath:r,fileType:`plugin`}}if(a&&typeof a==`object`){let e=a;e.commands&&(Array.isArray(e.commands)?e.commands:[e.commands]).forEach((e,n)=>{typeof e==`string`&&J(e,`commands[${n}]`,t)}),e.agents&&(Array.isArray(e.agents)?e.agents:[e.agents]).forEach((e,n)=>{typeof e==`string`&&J(e,`agents[${n}]`,t)}),e.skills&&(Array.isArray(e.skills)?e.skills:[e.skills]).forEach((e,n)=>{typeof e==`string`&&J(e,`skills[${n}]`,t)})}let o=a;if(typeof a==`object`&&a){let e=a,t=Object.keys(e).filter(e=>$.has(e));if(t.length>0){let r={...e};for(let e of t)delete r[e],n.push({path:e,message:`Field '${e}' belongs in the marketplace entry (marketplace.json), not plugin.json. It's harmless here but unused — Work Mate ignores it at load time.`});o=r}}let s=re().strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Work Mate accepts it, but the Claude.ai marketplace sync requires kebab-case (lowercase letters, digits, and hyphens only, e.g., "my-plugin").`}),e.version||n.push({path:`version`,message:`No version specified. Consider adding a version following semver (e.g., "1.0.0")`}),e.description||n.push({path:`description`,message:`No description provided. Adding a description helps users understand what your plugin does`}),e.author||n.push({path:`author`,message:`No author information provided. Consider adding author details for plugin attribution`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`plugin`}}async function X(e){let t=[],n=[],i=D.resolve(e),a;try{a=await k(i,{encoding:`utf-8`})}catch(e){let t=g(e),n;return n=t===`ENOENT`?`File not found: ${i}`:t===`EISDIR`?`Path is not a file: ${i}`:`Failed to read file: ${h(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:i,fileType:`marketplace`}}let o;try{o=v(a)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${h(e)}`}],warnings:[],filePath:i,fileType:`marketplace`}}if(o&&typeof o==`object`){let e=o;Array.isArray(e.plugins)&&e.plugins.forEach((e,n)=>{if(e&&typeof e==`object`&&`source`in e){let r=e.source;typeof r==`string`&&J(r,`plugins[${n}].source`,t,ue(r)),r&&typeof r==`object`&&`path`in r&&typeof r.path==`string`&&J(r.path,`plugins[${n}].source.path`,t)}})}let s=T().extend({plugins:r(ne().strict())}).strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;if((!e.plugins||e.plugins.length===0)&&n.push({path:`plugins`,message:`Marketplace has no plugins defined`}),e.plugins){e.plugins.forEach((n,r)=>{e.plugins.filter(e=>e.name===n.name).length>1&&t.push({path:`plugins[${r}].name`,message:`Duplicate plugin name "${n.name}" found in marketplace`})});let r=D.dirname(i),a=D.basename(r)===`.claude-plugin`?D.dirname(r):r;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=D.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=v(await k(e,{encoding:`utf-8`}));typeof t.version==`string`&&(i=t.version)}catch{continue}i&&i!==r.version&&n.push({path:`plugins[${t}].version`,message:`Entry declares version "${r.version}" but ${r.source}/.claude-plugin/plugin.json says "${i}". At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. Update this entry to "${i}" to match.`})}}e.metadata?.description||n.push({path:`metadata.description`,message:`No marketplace description provided. Adding a description helps users understand what this marketplace offers`})}return{success:t.length===0,errors:t,warnings:n,filePath:i,fileType:`marketplace`}}function de(e,t,n){let r=[],i=[],o=t.match(a);if(!o)return i.push({path:`frontmatter`,message:`No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata.`}),{success:!0,errors:r,warnings:i,filePath:e,fileType:n};let s=o[1]||``,c;try{c=f(s)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${h(t)}. At runtime this ${n} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n}}if(typeof c!=`object`||!c||Array.isArray(c))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(c)?`an array`:c===null?`null`:typeof c}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let l=c;if(l.description!==void 0){let e=l.description;typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`&&e!==null&&r.push({path:`description`,message:`description must be a string, got ${Array.isArray(e)?`array`:typeof e}. At runtime this value is dropped.`})}else i.push({path:`description`,message:`No description in frontmatter. A description helps users and Work Mate understand when to use this ${n}.`});l.name!==void 0&&l.name!==null&&typeof l.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof l.name}.`});let u=l[`allowed-tools`];u!=null&&(typeof u!=`string`&&!Array.isArray(u)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof u}.`}):Array.isArray(u)&&u.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let d=l.shell;if(d!=null)if(typeof d!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof d}.`});else{let e=d.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${d}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await k(e,{encoding:`utf-8`})}catch(t){return g(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${h(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=v(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${h(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=C().safeParse(n);return r.success?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:q(r.error),warnings:[],filePath:e,fileType:`hooks`}}async function Q(e,t){let n;try{n=await A(e,{withFileTypes:!0})}catch(e){let t=g(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>D.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=D.join(e,t.name);t.isDirectory()?r.push(...await Q(n,!1)):t.isFile()&&t.name.toLowerCase().endsWith(`.md`)&&r.push(n)}return r}async function fe(e){let t=[],n=[[`skill`,D.join(e,`skills`)],[`agent`,D.join(e,`agents`)],[`command`,D.join(e,`commands`)]];for(let[e,r]of n){let n=await Q(r,e===`skill`);for(let r of n){let n;try{n=await k(r,{encoding:`utf-8`})}catch(n){if(_(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${h(n)}`}],warnings:[],filePath:r,fileType:e});continue}let i=de(r,n,e);(i.errors.length>0||i.warnings.length>0)&&t.push(i)}}let r=await Z(D.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=D.resolve(e),n=null;try{n=await M(t)}catch(e){if(!_(e))throw e}if(n?.isDirectory()){let e=await X(D.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(D.join(t,`.claude-plugin`,`plugin.json`));return n.errors[0]?.code===`ENOENT`?{success:!1,errors:[{path:`directory`,message:`No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json`}],warnings:[],filePath:t,fileType:`plugin`}:n}switch(le(e)){case`plugin`:return Y(e);case`marketplace`:return X(e);case`unknown`:try{let n=v(await k(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(g(e)===`ENOENT`)return{success:!1,errors:[{path:`file`,message:`File not found: ${t}`}],warnings:[],filePath:t,fileType:`plugin`}}return Y(e)}}var $,me=e((()=>{i(),m(),ee(),S(),o(),w(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{K as a,G as c,ce as i,pe as n,B as o,fe as r,z as s,me as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,h as n,o as r}from"./config-D3K87Mm1.js";import{n as i}from"./analytics-COpjZpvd.js";var a;e((()=>{i(),t(),a=async()=>{let e=r().editorMode||`normal`;e===`emacs`&&(e=`normal`);let t=e===`normal`?`vim`:`normal`;return n(e=>({...e,editorMode:t})),{type:`text`,value:`Editor mode set to ${t}. ${t===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{a as call};
@@ -0,0 +1 @@
1
+ import{St as e,_t as t}from"./loadAgentsDir-DR5PVAc3.js";e();export{t as execIntoTmuxWorktree};
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- import{l as e,o as t}from"./chunks/envUtils-DfkgIdYf.js";var n=globalThis.performance,r=new Map,i=new Map;function a(){return n.now()}function o(e){return r.set(e,a()),{name:e,entryType:`mark`,startTime:r.get(e),duration:0}}function s(e,t,n){let o,s;if(typeof t==`string`){let e=r.get(t),i=n?r.get(n):a();o=e??a(),s=(i??a())-o}else t&&typeof t==`object`?(o=t.start??0,s=(t.end??a())-o):(o=0,s=a());i.set(e,{name:e,startTime:o,duration:s})}function c(e){return e===`mark`?[...r.entries()].map(([e,t])=>({name:e,entryType:`mark`,startTime:t,duration:0})):e===`measure`?[...i.values()].map(e=>({name:e.name,entryType:`measure`,startTime:e.startTime,duration:e.duration})):[]}function l(e,t){return c(t??`mark`).concat(t===void 0?c(`measure`):[]).filter(t=>t.name===e)}function u(e){e===void 0?r.clear():r.delete(e)}function d(e){e===void 0?i.clear():i.delete(e)}var f={now:a,mark:o,measure:s,getEntriesByType:c,getEntriesByName:l,clearMarks:u,clearMeasures:d,clearResourceTimings:(()=>{}),setResourceTimingBufferSize:(()=>{}),markResourceTiming:(()=>{}),get timeOrigin(){return n.timeOrigin},get onresourcetimingbufferfull(){return n.onresourcetimingbufferfull},set onresourcetimingbufferfull(e){},toJSON(){return n.toJSON()}};function p(){globalThis.__performanceShimInstalled||(globalThis.__performanceShimInstalled=!0,globalThis.performance=f)}if(p(),t(),globalThis.MACRO===void 0&&(globalThis.MACRO={VERSION:process.env.CLAUDE_CODE_VERSION||`2.1.888`,BUILD_TIME:new Date().toISOString(),FEEDBACK_CHANNEL:``,ISSUES_EXPLAINER:``,NATIVE_PACKAGE_URL:``,PACKAGE_URL:``,VERSION_CHANGELOG:``}),e(process.env.CLAUDE_CODE_FORCE_INTERACTIVE)){for(let e of[process.stdin,process.stdout,process.stderr])if(!e.isTTY)try{Object.defineProperty(e,"isTTY",{value:!0,configurable:!0})}catch{}}process.env.COREPACK_ENABLE_AUTO_PIN=`0`;async function m(){let e=process.argv.slice(2);if(e.length===1&&(e[0]===`--version`||e[0]===`-v`||e[0]===`-V`)){console.log(`0.0.24 (Work Mate)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-BH0FoI66.js`);if(t(`cli_entry`),process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-Bxseqbi_.js`);await e();return}if(e[0]===`job`){t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-C8qsPrLj.js`);await n(e.slice(1)),process.exit(0)}if(e[0]===`new`||e[0]===`list`||e[0]===`reply`){console.error(`[deprecated] Use: claude job ${e[0]} ${e.slice(1).join(` `)}`.trim()),t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-C8qsPrLj.js`);await n(e),process.exit(0)}if((e.includes(`--tmux`)||e.includes(`--tmux=classic`))&&(e.includes(`-w`)||e.includes(`--worktree`)||e.some(e=>e.startsWith(`--worktree=`)))){t(`cli_tmux_worktree_fast_path`);let{enableConfigs:n}=await import(`./chunks/config-DD8fCYXn.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-D68iEHpC.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-Vm-SNY5x.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CNfq37LF.js`);e(n.error)}}}e.includes(`--bare`)&&(process.env.CLAUDE_CODE_SIMPLE=`1`);let{startCapturingEarlyInput:n}=await import(`./chunks/earlyInput-BEjRkAtH.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-9ksgUUY_.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
2
+ import{l as e,o as t}from"./chunks/envUtils-DZ_SvEVz.js";var n=globalThis.performance,r=new Map,i=new Map;function a(){return n.now()}function o(e){return r.set(e,a()),{name:e,entryType:`mark`,startTime:r.get(e),duration:0}}function s(e,t,n){let o,s;if(typeof t==`string`){let e=r.get(t),i=n?r.get(n):a();o=e??a(),s=(i??a())-o}else t&&typeof t==`object`?(o=t.start??0,s=(t.end??a())-o):(o=0,s=a());i.set(e,{name:e,startTime:o,duration:s})}function c(e){return e===`mark`?[...r.entries()].map(([e,t])=>({name:e,entryType:`mark`,startTime:t,duration:0})):e===`measure`?[...i.values()].map(e=>({name:e.name,entryType:`measure`,startTime:e.startTime,duration:e.duration})):[]}function l(e,t){return c(t??`mark`).concat(t===void 0?c(`measure`):[]).filter(t=>t.name===e)}function u(e){e===void 0?r.clear():r.delete(e)}function d(e){e===void 0?i.clear():i.delete(e)}var f={now:a,mark:o,measure:s,getEntriesByType:c,getEntriesByName:l,clearMarks:u,clearMeasures:d,clearResourceTimings:(()=>{}),setResourceTimingBufferSize:(()=>{}),markResourceTiming:(()=>{}),get timeOrigin(){return n.timeOrigin},get onresourcetimingbufferfull(){return n.onresourcetimingbufferfull},set onresourcetimingbufferfull(e){},toJSON(){return n.toJSON()}};function p(){globalThis.__performanceShimInstalled||(globalThis.__performanceShimInstalled=!0,globalThis.performance=f)}if(p(),t(),globalThis.MACRO===void 0&&(globalThis.MACRO={VERSION:process.env.WORKMATE_VERSION||`2.1.888`,BUILD_TIME:new Date().toISOString(),FEEDBACK_CHANNEL:``,ISSUES_EXPLAINER:``,NATIVE_PACKAGE_URL:``,PACKAGE_URL:``,VERSION_CHANGELOG:``}),e(process.env.WORKMATE_FORCE_INTERACTIVE)){for(let e of[process.stdin,process.stdout,process.stderr])if(!e.isTTY)try{Object.defineProperty(e,"isTTY",{value:!0,configurable:!0})}catch{}}process.env.COREPACK_ENABLE_AUTO_PIN=`0`;async function m(){let e=process.argv.slice(2);if(e.length===1&&(e[0]===`--version`||e[0]===`-v`||e[0]===`-V`)){console.log(`0.0.26 (Work Mate)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-FpGsKWYk.js`);if(t(`cli_entry`),process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-CbhyIWgj.js`);await e();return}if(e[0]===`job`){t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-BKVEWCsb.js`);await n(e.slice(1)),process.exit(0)}if(e[0]===`new`||e[0]===`list`||e[0]===`reply`){console.error(`[deprecated] Use: claude job ${e[0]} ${e.slice(1).join(` `)}`.trim()),t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-BKVEWCsb.js`);await n(e),process.exit(0)}if((e.includes(`--tmux`)||e.includes(`--tmux=classic`))&&(e.includes(`-w`)||e.includes(`--worktree`)||e.some(e=>e.startsWith(`--worktree=`)))){t(`cli_tmux_worktree_fast_path`);let{enableConfigs:n}=await import(`./chunks/config-DtmqWusU.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-D68iEHpC.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-CR_M6Qfy.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CNfq37LF.js`);e(n.error)}}}e.includes(`--bare`)&&(process.env.WORKMATE_SIMPLE=`1`);let{startCapturingEarlyInput:n}=await import(`./chunks/earlyInput-BEjRkAtH.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-Ryi27wYq.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readmagic/workmate",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "description": "workMate",
5
5
  "type": "module",
6
6
  "author": "Frandy",
@@ -105,7 +105,6 @@
105
105
  "@smithy/core": "^3.23.15",
106
106
  "@smithy/node-http-handler": "^4.5.3",
107
107
  "@types/bun": "^1.3.12",
108
- "@types/cacache": "^20.0.1",
109
108
  "@types/lodash-es": "^4.17.12",
110
109
  "@types/node": "^25.6.0",
111
110
  "@types/picomatch": "^4.0.3",
@@ -117,30 +116,23 @@
117
116
  "@types/stack-utils": "^2.0.3",
118
117
  "@types/ws": "^8.18.1",
119
118
  "ajv": "^8.18.0",
120
- "auto-bind": "^5.0.1",
121
119
  "axios": "^1.15.2",
122
- "bidi-js": "^1.0.3",
123
- "cacache": "^20.0.4",
124
120
  "chalk": "^5.6.2",
125
121
  "chokidar": "^5.0.0",
126
- "cli-boxes": "^4.0.1",
127
122
  "cli-highlight": "^2.1.11",
128
123
  "code-excerpt": "^4.0.0",
129
124
  "color-diff-napi": "workspace:*",
130
125
  "diff": "^8.0.4",
131
- "emoji-regex": "^10.6.0",
132
126
  "env-paths": "^4.0.0",
133
127
  "execa": "^9.6.1",
134
128
  "fflate": "^0.8.2",
135
129
  "figures": "^6.1.0",
136
130
  "fuse.js": "^7.3.0",
137
- "get-east-asian-width": "^1.5.0",
138
131
  "google-auth-library": "^10.6.2",
139
132
  "https-proxy-agent": "^8.0.0",
140
133
  "husky": "^9.1.7",
141
134
  "ignore": "^7.0.5",
142
135
  "image-processor-napi": "workspace:*",
143
- "indent-string": "^5.0.0",
144
136
  "jsonc-parser": "^3.3.1",
145
137
  "knip": "^6.4.1",
146
138
  "lodash-es": "^4.18.1",
@@ -161,7 +153,6 @@
161
153
  "signal-exit": "^4.1.0",
162
154
  "stack-utils": "^2.0.6",
163
155
  "strip-ansi": "^7.2.0",
164
- "supports-hyperlinks": "^4.4.0",
165
156
  "tree-kill": "^1.2.2",
166
157
  "typescript": "^6.0.3",
167
158
  "undici": "^7.25.0",
@@ -170,8 +161,6 @@
170
161
  "vscode-jsonrpc": "^8.2.1",
171
162
  "vscode-languageserver-protocol": "^3.17.5",
172
163
  "vscode-languageserver-types": "^3.17.5",
173
- "wrap-ansi": "^10.0.0",
174
- "xss": "^1.0.15",
175
164
  "yaml": "^2.8.3",
176
165
  "zod": "^4.3.6"
177
166
  },
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Postinstall scriptruns automatically after `bun install` or `npm install`.
3
+ * Postinstall 脚本 `bun install` `npm install` 后自动运行。
4
4
  *
5
- * Downloads ripgrep binary (idempotent, skips if exists).
6
- * Works in dev mode (src/ exists), published mode (dist/ exists), with bun or node.
5
+ * 下载 ripgrep 二进制(幂等,已存在则跳过)。
6
+ * 同时支持 dev 模式(src/ 存在)、发布模式(dist/ 存在),bun node 均可。
7
7
  *
8
- * Usage:
8
+ * 用法:
9
9
  * node scripts/postinstall.js
10
10
  * node scripts/postinstall.js --force
11
11
  * bun run scripts/postinstall.js
@@ -26,14 +26,14 @@ const { setDefaultResultOrder } = require('node:dns')
26
26
  const path = require('path')
27
27
  const os = require('os')
28
28
 
29
- // Prefer IPv4 first — Bun on Windows sometimes fails GitHub over broken IPv6 paths.
29
+ // 优先使用 IPv4 — Bun Windows 上有时因 IPv6 路径损坏而无法访问 GitHub
30
30
  try {
31
31
  setDefaultResultOrder('ipv4first')
32
32
  } catch {
33
33
  /* ignore */
34
34
  }
35
35
 
36
- // --- Config ---
36
+ // --- 配置 ---
37
37
 
38
38
  const RG_VERSION = '15.0.1'
39
39
  const DEFAULT_RELEASE_BASE = `https://github.com/microsoft/ripgrep-prebuilt/releases/download/v${RG_VERSION}`
@@ -45,7 +45,7 @@ const RELEASE_BASE = (
45
45
  const scriptDir = path.dirname(__filename)
46
46
  const projectRoot = path.resolve(scriptDir, '..')
47
47
 
48
- // --- Platform mapping ---
48
+ // --- 平台映射 ---
49
49
 
50
50
  function getPlatformMapping() {
51
51
  const arch = process.arch
@@ -91,7 +91,7 @@ function detectMusl() {
91
91
  }
92
92
  }
93
93
 
94
- // --- Paths ---
94
+ // --- 路径 ---
95
95
 
96
96
  function getVendorDir() {
97
97
  if (existsSync(path.join(projectRoot, 'src'))) {
@@ -107,7 +107,7 @@ function getBinaryPath() {
107
107
  return path.resolve(dir, subdir, binary)
108
108
  }
109
109
 
110
- // --- Download helpers ---
110
+ // --- 下载辅助 ---
111
111
 
112
112
  function proxyEnvSet() {
113
113
  const v = s => (s ?? '').trim()
@@ -150,14 +150,14 @@ function tryCurlDownload(url, dest) {
150
150
 
151
151
  async function fetchRelease(url) {
152
152
  if (proxyEnvSet()) {
153
- // Dynamic require so it works in node without bundling issues
153
+ // 动态 require 以避免打包问题,在 node 中也能用
154
154
  const undici = require('undici')
155
155
  return await undici.fetch(url, {
156
156
  redirect: 'follow',
157
157
  dispatcher: new undici.EnvHttpProxyAgent(),
158
158
  })
159
159
  }
160
- // Node 18+ has global fetch, Bun has it too
160
+ // Node 18+ 有全局 fetchBun 也有
161
161
  return await fetch(url, { redirect: 'follow' })
162
162
  }
163
163
 
@@ -199,7 +199,7 @@ async function downloadUrlToBufferWithFallback(url) {
199
199
  throw firstError
200
200
  }
201
201
 
202
- // --- Extract ---
202
+ // --- 解压 ---
203
203
 
204
204
  function findZipEntryKey(files, want) {
205
205
  return Object.keys(files).find(k => {
@@ -210,7 +210,7 @@ function findZipEntryKey(files, want) {
210
210
 
211
211
  async function extractZip(buffer, binaryPath, extractedBinary) {
212
212
  const binaryDir = path.dirname(binaryPath)
213
- // Try fflate first (bundled dep)
213
+ // 先用 fflate(内置依赖)
214
214
  let fflateError
215
215
  try {
216
216
  const { unzipSync } = require('fflate')
@@ -225,7 +225,7 @@ async function extractZip(buffer, binaryPath, extractedBinary) {
225
225
  fflateError = e
226
226
  }
227
227
 
228
- // Fallback: PowerShell Expand-Archive or unzip CLI
228
+ // 回退:PowerShell Expand-Archive unzip CLI
229
229
  const tmpDir = path.join(binaryDir, '.tmp-download')
230
230
  rmSync(tmpDir, { recursive: true, force: true })
231
231
  mkdirSync(tmpDir, { recursive: true })
@@ -304,7 +304,7 @@ async function extractTarGz(buffer, binaryPath, extractedBinary, assetName) {
304
304
  }
305
305
  }
306
306
 
307
- // --- Main ---
307
+ // --- 主逻辑 ---
308
308
 
309
309
  async function downloadAndExtract() {
310
310
  const { target, ext } = getPlatformMapping()
@@ -384,6 +384,6 @@ main().catch(error => {
384
384
  console.error(
385
385
  `[postinstall] You can install ripgrep manually: https://github.com/BurntSushi/ripgrep#installation`,
386
386
  )
387
- // Never exit with error code — postinstall must not break install
387
+ // 永不返回错误码 — postinstall 不能破坏安装
388
388
  process.exit(0)
389
389
  })
@@ -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{F as i,N as a,P as o,mb as s,md as c,pd as l}from"./loadAgentsDir-B0Anodo0.js";import{D as u,I as d,P as f,T as p,Wt as m,ai as h,t as g,vn as _,y as v,yn as y}from"./src-DL3w8VPk.js";import{t as b}from"./jsx-runtime-Bb4Xn-E0.js";import{n as x,t as S}from"./TextInput-B8ruWRf2.js";import{n as C,t as w}from"./select-DIxfl_VN.js";import{r as T,t as E}from"./directoryCompletion-D_Rtg-4j.js";import{r as D,t as O}from"./PromptInputFooterSuggestions-HI6HH3TP.js";function k(){return(0,P.jsx)(f,{dimColor:!0,children:`Work Mate will be able to read files in this directory and make edits when auto-accept edits is on.`})}function A({path:e}){return(0,P.jsxs)(d,{flexDirection:`column`,paddingX:2,gap:1,children:[(0,P.jsx)(f,{color:`permission`,children:e}),(0,P.jsx)(k,{})]})}function j({value:e,onChange:t,onSubmit:n,error:i,suggestions:a,selectedSuggestion:o}){return(0,P.jsxs)(d,{flexDirection:`column`,children:[(0,P.jsx)(f,{children:`Enter the path to the directory:`}),(0,P.jsx)(d,{borderDimColor:!0,borderStyle:`round`,marginY:1,paddingLeft:1,children:(0,P.jsx)(S,{showCursor:!0,placeholder:`Directory path${r.ellipsis}`,value:e,onChange:t,onSubmit:n,columns:80,cursorOffset:e.length,onChangeCursorOffset:()=>{}})}),a.length>0&&(0,P.jsx)(d,{marginBottom:1,children:(0,P.jsx)(O,{suggestions:a,selectedSuggestion:o})}),i&&(0,P.jsx)(f,{color:`error`,children:i})]})}function M({onAddDirectory:e,onCancel:t,permissionContext:n,directoryPath:r}){let[o,s]=(0,N.useState)(``),[c,h]=(0,N.useState)(null),[g,_]=(0,N.useState)([]),[b,x]=(0,N.useState)(0),S=(0,N.useMemo)(()=>F,[]),C=y((0,N.useCallback)(async e=>{if(!e){_([]),x(0);return}let t=await E(e);_(t),x(0)},[]),100);(0,N.useEffect)(()=>{C(o)},[o,C]);let T=(0,N.useCallback)(e=>{let t=`${e.id}/`;s(t),h(null)},[]),D=(0,N.useCallback)(async t=>{let r=await i(t,n);r.resultType===`success`?e(r.absolutePath,!1):h(a(r))},[n,e]);m(`confirm:no`,t,{context:`Settings`});let O=(0,N.useCallback)(e=>{if(g.length>0){if(e.key===`tab`){e.preventDefault();let t=g[b];t&&T(t);return}if(e.key===`return`){e.preventDefault();let t=g[b];t&&D(`${t.id}/`);return}if(e.key===`up`||e.ctrl&&e.key===`p`){e.preventDefault(),x(e=>e<=0?g.length-1:e-1);return}if(e.key===`down`||e.ctrl&&e.key===`n`){e.preventDefault(),x(e=>e>=g.length-1?0:e+1);return}}},[g,b,T,D]),M=(0,N.useCallback)(n=>{if(r)switch(n){case`yes-session`:e(r,!1);break;case`yes-remember`:e(r,!0);break;case`no`:t();break}},[r,e,t]);return(0,P.jsx)(d,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:O,children:(0,P.jsx)(v,{title:`Add directory to workspace`,onCancel:t,color:`permission`,isCancelActive:!1,inputGuide:r?void 0:e=>e.pending?(0,P.jsxs)(f,{children:[`Press `,e.keyName,` again to exit`]}):(0,P.jsxs)(p,{children:[(0,P.jsx)(u,{shortcut:`Tab`,action:`complete`}),(0,P.jsx)(u,{shortcut:`Enter`,action:`add`}),(0,P.jsx)(l,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]}),children:r?(0,P.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,P.jsx)(A,{path:r}),(0,P.jsx)(w,{options:S,onChange:M,onCancel:()=>M(`no`)})]}):(0,P.jsxs)(d,{flexDirection:`column`,gap:1,marginX:2,children:[(0,P.jsx)(k,{}),(0,P.jsx)(j,{value:o,onChange:s,onSubmit:D,error:c,suggestions:g,selectedSuggestion:b})]})})})}var N,P,F,I=e((()=>{n(),N=t(h(),1),_(),o(),x(),g(),s(),T(),c(),C(),D(),P=b(),F=[{value:`yes-session`,label:`Yes, for this session`},{value:`yes-remember`,label:`Yes, and remember this directory`},{value:`no`,label:`No`}]}));export{I as n,M as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./AgentsMdExternalIncludesDialog-LjI_H_Au.js";e();export{t as AgentsMdExternalIncludesDialog};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,ai as a,t as o,y as s}from"./src-DL3w8VPk.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{g as l,p as u}from"./config-C-Y2qtB2.js";import{n as d,r as f}from"./analytics-DJobLaWP.js";import{t as p}from"./select-DIxfl_VN.js";import{t as m}from"./CustomSelect-wmZ9jz0W.js";function h({onDone:e,isStandaloneDialog:t,externalIncludes:a}){g.useEffect(()=>{f(`tengu_claude_md_includes_dialog_shown`,{})},[]);let o=(0,g.useCallback)(t=>{t===`no`?(f(`tengu_claude_md_external_includes_dialog_declined`,{}),l(e=>({...e,hasAgentsMdExternalIncludesApproved:!1,hasAgentsMdExternalIncludesWarningShown:!0}))):(f(`tengu_claude_md_external_includes_dialog_accepted`,{}),l(e=>({...e,hasAgentsMdExternalIncludesApproved:!0,hasAgentsMdExternalIncludesWarningShown:!0}))),e()},[e]);return(0,_.jsxs)(s,{title:`Allow external AGENTS.md file imports?`,color:`warning`,onCancel:(0,g.useCallback)(()=>{o(`no`)},[o]),hideBorder:!t,hideInputGuide:!t,children:[(0,_.jsx)(i,{children:`This project's AGENTS.md imports files outside the current working directory. Never allow this for third-party repositories.`}),a&&a.length>0&&(0,_.jsxs)(n,{flexDirection:`column`,children:[(0,_.jsx)(i,{dimColor:!0,children:`External imports:`}),a.map((e,t)=>(0,_.jsxs)(i,{dimColor:!0,children:[` `,e.path]},t))]}),(0,_.jsxs)(i,{dimColor:!0,children:[`Important: Only use Work Mate with files you trust. Accessing untrusted files may pose security risks`,` `,(0,_.jsx)(r,{url:`https://code.workmate.com/docs/en/security`}),` `]}),(0,_.jsx)(p,{options:[{label:`Yes, allow external imports`,value:`yes`},{label:`No, disable external imports`,value:`no`}],onChange:e=>o(e)})]})}var g,_,v=e((()=>{g=t(a(),1),d(),o(),u(),m(),_=c()}));export{v as n,h as t};
@@ -1 +0,0 @@
1
- import{Ip as e,Pp as t}from"./loadAgentsDir-B0Anodo0.js";import{R as n,t as r}from"./src-DL3w8VPk.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{_ as a,p as o,s}from"./config-C-Y2qtB2.js";import{t as c}from"./fpsMetrics-wxj9GAsd.js";import{n as l,t as u}from"./onChangeAppState-DLjZ1x95.js";e(),r(),o();var d=i();function f({getFpsMetrics:e,stats:r,initialState:i,children:o}){return(0,d.jsx)(c,{getFpsMetrics:e,children:(0,d.jsx)(l,{store:r,children:(0,d.jsx)(t,{initialState:i,onChangeAppState:u,children:(0,d.jsx)(n,{initialState:s().theme,onThemeSave:e=>a(t=>({...t,theme:e})),children:o})})})})}export{f as App};
@@ -1,2 +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{Dn as i,Ec as a,Hl as o,Ip as s,Ju as c,Jx as l,Lp as u,Tc as d,Tn as f,Ul as p,Vl as m,Wl as h,Yi as g,Yu as _,bb as v,dm as ee,ds as te,fs as y,gb as ne,gu as b,hb as x,hu as S,mb as C,mm as w,zp as re}from"./loadAgentsDir-B0Anodo0.js";import{D as T,Gt as E,H as D,I as O,P as k,T as A,ai as j,ot as M,t as N,y as P}from"./src-DL3w8VPk.js";import{t as F}from"./jsx-runtime-Bb4Xn-E0.js";import{_ as ie,f as ae}from"./debug-Bglx1aTu.js";import{Hn as oe,Un as se,Vn as ce}from"./settings-B2jvL8Dp.js";import{l as I,o as le}from"./stringUtils-C718f5ey.js";import{S as ue,_ as L,f as de,l as R,u as fe,y as z}from"./startupProfiler-CJdr3SxP.js";import{_n as pe,gn as me,vn as he}from"./prompt-CJ1l3XXk.js";import{i as ge,t as _e}from"./overlayContext-8--_fbvY.js";function B(e,t,n=1e3,r=0,i){let a=()=>R(Math.max(0,(i??Date.now())-e-r));return(0,V.useSyncExternalStore)((0,V.useCallback)(e=>{if(!t)return()=>{};let r=setInterval(e,n);return()=>clearInterval(r)},[t,n]),a,a)}var V,H=e((()=>{V=t(j(),1),L()}));function ve(e,t,n){let r=me(t,e.toolName);if(!r)return e.toolName;try{let t=r.inputSchema.safeParse(e.input),i=t.success?t.data:{},a=r.userFacingName(i);if(!a)return e.toolName;let o=r.renderToolUseMessage(i,{theme:n,verbose:!1});return o?(0,ye.jsxs)(k,{children:[a,`(`,o,`)`]}):a}catch{return e.toolName}}var ye,be=e((()=>{N(),he(),ye=F()}));function xe(e,t){let{isIdle:n,awaitingApproval:i,hasError:a,shutdownRequested:o}=t??{};return a?r.cross:i?r.questionMarkPrefix:o?r.warning:e===`running`?n?r.ellipsis:r.play:e===`completed`?r.tick:e===`failed`||e===`killed`?r.cross:r.bullet}function Se(e,t){let{isIdle:n,awaitingApproval:r,hasError:i,shutdownRequested:a}=t??{};return i?`error`:r||a?`warning`:n?`background`:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:`background`}function Ce(e,t){if(!t)return!1;let n=!1;for(let t of Object.values(e))if(b(t))return n=!0,!1;return n}var we=e((()=>{n(),S()}));function Te({agent:e,onDone:t,onKillAgent:n,onBack:r}){let[i]=D(),a=(0,Ee.useMemo)(()=>d(pe()),[]),o=B(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);E({"confirm:yes":t},{context:`Confirmation`});let s=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},u=l(e.prompt,`plan`),f=e.prompt.length>300?`${e.prompt.substring(0,297)}…`:e.prompt,p=e.result?.totalTokens??e.progress?.tokenCount,m=e.result?.totalToolUseCount??e.progress?.toolUseCount;return(0,U.jsx)(O,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:s,children:(0,U.jsx)(P,{title:(0,U.jsxs)(k,{children:[e.selectedAgent?.agentType??`agent`,` › `,e.description||`Async agent`]}),subtitle:(0,U.jsxs)(k,{children:[e.status!==`running`&&(0,U.jsxs)(k,{color:Se(e.status),children:[xe(e.status),` `,e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,U.jsxs)(k,{dimColor:!0,children:[o,p!==void 0&&p>0&&(0,U.jsxs)(U.Fragment,{children:[` · `,de(p),` tokens`]}),m!==void 0&&m>0&&(0,U.jsxs)(U.Fragment,{children:[` `,`· `,m,` `,m===1?`tool`:`tools`]})]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,U.jsxs)(k,{children:[`Press `,t.keyName,` again to exit`]}):(0,U.jsxs)(A,{children:[r&&(0,U.jsx)(T,{shortcut:`←`,action:`go back`}),(0,U.jsx)(T,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,U.jsx)(T,{shortcut:`x`,action:`stop`})]}),children:(0,U.jsxs)(O,{flexDirection:`column`,children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,U.jsxs)(O,{flexDirection:`column`,children:[(0,U.jsx)(k,{bold:!0,dimColor:!0,children:`Progress`}),e.progress.recentActivities.map((t,n)=>(0,U.jsxs)(k,{dimColor:n<e.progress.recentActivities.length-1,wrap:`truncate-end`,children:[n===e.progress.recentActivities.length-1?`› `:` `,ve(t,a,i)]},n))]}),u?(0,U.jsx)(O,{marginTop:1,children:(0,U.jsx)(c,{addMargin:!1,planContent:u})}):(0,U.jsxs)(O,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(k,{bold:!0,dimColor:!0,children:`Prompt`}),(0,U.jsx)(k,{wrap:`wrap`,children:f})]}),e.status===`failed`&&e.error&&(0,U.jsxs)(O,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(k,{bold:!0,color:`error`,children:`Error`}),(0,U.jsx)(k,{color:`error`,wrap:`wrap`,children:e.error})]})]})})})}var Ee,U,De=e((()=>{Ee=t(j(),1),H(),N(),C(),he(),a(),L(),g(),_(),be(),we(),U=F()}));function W({status:e,label:t,suffix:n}){return(0,G.jsxs)(k,{color:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:void 0,dimColor:!0,children:[`(`,t??e,n,`)`]})}function Oe({shell:e}){switch(e.status){case`completed`:return(0,G.jsx)(W,{status:`completed`,label:`done`});case`failed`:return(0,G.jsx)(W,{status:`failed`,label:`error`});case`killed`:return(0,G.jsx)(W,{status:`killed`,label:`stopped`});case`running`:case`pending`:return(0,G.jsx)(W,{status:`running`})}}var G,ke=e((()=>{N(),G=F()}));function Ae({task:e,maxActivityWidth:t}){let n=t??40;switch(e.type){case`local_bash`:return(0,K.jsxs)(k,{children:[z(e.command,n,!0),` `,(0,K.jsx)(Oe,{shell:e})]});case`local_agent`:return(0,K.jsxs)(k,{children:[z(e.description,n,!0),` `,(0,K.jsx)(W,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]});case`local_workflow`:{let t=e;return(0,K.jsxs)(k,{children:[z(t.workflowName??e.summary??e.description,n,!0),` `,(0,K.jsx)(W,{status:e.status,label:e.status===`running`?`${t.agentCount} ${I(t.agentCount,`agent`)}`:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}case`dream`:{let t=e.filesTouched.length,n=e.phase===`updating`&&t>0?`${t} ${I(t,`file`)}`:`${e.sessionsReviewing} ${I(e.sessionsReviewing,`session`)}`;return(0,K.jsxs)(k,{children:[e.description,` `,(0,K.jsxs)(k,{dimColor:!0,children:[`· `,e.phase,` · `,n]}),` `,(0,K.jsx)(W,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}}}var K,je=e((()=>{N(),L(),le(),ke(),K=F()}));function Me({task:e,onDone:t,onBack:n,onKill:r}){let i=B(e.startTime,e.status===`running`,1e3,0);E({"confirm:yes":t},{context:`Confirmation`});let a=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&n?(i.preventDefault(),n()):i.key===`x`&&e.status===`running`&&r&&(i.preventDefault(),r())},o=e.turns.filter(e=>e.text!==``),s=o.slice(-6),c=o.length-s.length;return(0,q.jsx)(O,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:a,children:(0,q.jsx)(P,{title:`Memory consolidation`,subtitle:(0,q.jsxs)(k,{dimColor:!0,children:[i,` · reviewing `,e.sessionsReviewing,` `,I(e.sessionsReviewing,`session`),e.filesTouched.length>0&&(0,q.jsxs)(q.Fragment,{children:[` `,`· `,e.filesTouched.length,` `,I(e.filesTouched.length,`file`),` touched`]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,q.jsxs)(k,{children:[`Press `,t.keyName,` again to exit`]}):(0,q.jsxs)(A,{children:[n&&(0,q.jsx)(T,{shortcut:`←`,action:`go back`}),(0,q.jsx)(T,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&r&&(0,q.jsx)(T,{shortcut:`x`,action:`stop`})]}),children:(0,q.jsxs)(O,{flexDirection:`column`,gap:1,children:[(0,q.jsxs)(k,{children:[(0,q.jsx)(k,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,q.jsx)(k,{color:`background`,children:`running`}):e.status===`completed`?(0,q.jsx)(k,{color:`success`,children:e.status}):(0,q.jsx)(k,{color:`error`,children:e.status})]}),s.length===0?(0,q.jsx)(k,{dimColor:!0,children:e.status===`running`?`Starting…`:`(no text output)`}):(0,q.jsxs)(q.Fragment,{children:[c>0&&(0,q.jsxs)(k,{dimColor:!0,children:[`(`,c,` earlier `,I(c,`turn`),`)`]}),s.map((e,t)=>(0,q.jsxs)(O,{flexDirection:`column`,children:[(0,q.jsx)(k,{wrap:`wrap`,children:e.text}),e.toolUseCount>0&&(0,q.jsxs)(k,{dimColor:!0,children:[` `,`(`,e.toolUseCount,` `,I(e.toolUseCount,`tool`),`)`]})]},t))]})]})})})}var q,Ne=e((()=>{H(),N(),C(),le(),q=F()}));async function Pe(e){let t=f(e.id);try{let e=await ie(t,Le);return{content:e.content,bytesTotal:e.bytesTotal}}catch{return{content:``,bytesTotal:0}}}function Fe({shell:e,onDone:t,onKillShell:n,onBack:r}){let{columns:i}=M(),[a,o]=(0,J.useState)(()=>Pe(e)),s=(0,J.useDeferredValue)(a);(0,J.useEffect)(()=>{if(e.status!==`running`)return;let t=setInterval((e,t)=>e(Pe(t)),1e3,o,e);return()=>clearInterval(t)},[e.id,e.status]);let c=()=>t(`Shell details dismissed`,{display:`system`});E({"confirm:yes":c},{context:`Confirmation`});let l=i=>{i.key===` `?(i.preventDefault(),t(`Shell details dismissed`,{display:`system`})):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},u=ue(e.command,280);return(0,Y.jsx)(O,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:l,children:(0,Y.jsxs)(P,{title:`Shell details`,onCancel:c,color:`background`,inputGuide:t=>t.pending?(0,Y.jsxs)(k,{children:[`Press `,t.keyName,` again to exit`]}):(0,Y.jsxs)(A,{children:[r&&(0,Y.jsx)(T,{shortcut:`←`,action:`go back`}),(0,Y.jsx)(T,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,Y.jsx)(T,{shortcut:`x`,action:`stop`})]}),children:[(0,Y.jsxs)(O,{flexDirection:`column`,children:[(0,Y.jsxs)(k,{children:[(0,Y.jsx)(k,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,Y.jsxs)(k,{color:`background`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):e.status===`completed`?(0,Y.jsxs)(k,{color:`success`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):(0,Y.jsxs)(k,{color:`error`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]})]}),(0,Y.jsxs)(k,{children:[(0,Y.jsx)(k,{bold:!0,children:`Runtime:`}),` `,R((e.endTime??Date.now())-e.startTime)]}),(0,Y.jsxs)(k,{wrap:`wrap`,children:[(0,Y.jsx)(k,{bold:!0,children:`Command:`}),` `,u]})]}),(0,Y.jsxs)(O,{flexDirection:`column`,children:[(0,Y.jsx)(k,{bold:!0,children:`Output:`}),(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(k,{dimColor:!0,children:`Loading output…`}),children:(0,Y.jsx)(Ie,{outputPromise:s,columns:i})})]})]})})}function Ie({outputPromise:e,columns:t}){let{content:n,bytesTotal:r}=(0,J.use)(e);if(!n)return(0,Y.jsx)(k,{dimColor:!0,children:`No output available`});let i=[],a=n.length;for(let e=0;e<10&&a>0;e++){let e=n.lastIndexOf(`
2
- `,a-1);i.push(e+1),a=e}i.reverse();let o=r>n.length,s=[];for(let e=0;e<i.length;e++){let t=i[e],r=e<i.length-1?i[e+1]-1:n.length,a=n.slice(t,r);a&&s.push(a)}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(O,{borderStyle:`round`,paddingX:1,flexDirection:`column`,height:12,maxWidth:t-6,children:s.map((e,t)=>(0,Y.jsx)(k,{wrap:`truncate-end`,children:e},t))}),(0,Y.jsxs)(k,{dimColor:!0,italic:!0,children:[`Showing ${s.length} lines`,o?` of ${fe(r)}`:``]})]})}var J,Y,Le,Re=e((()=>{J=t(j(),1),v(),N(),C(),L(),ae(),i(),Y=F(),Le=8192}));function ze(e,t){return Object.values(e??{}).filter(b).filter(e=>!(e.type===`local_agent`&&e.id===t))}function Be({onDone:e,toolUseContext:t,initialDetailTaskId:n}){let r=u(e=>e.tasks),i=u(e=>e.foregroundedTaskId),a=re(),o=ne(`chat:killAgents`,`Chat`,`ctrl+x ctrl+k`),s=r,c=(0,Z.useRef)(!1),[l,d]=(0,Z.useState)(()=>{if(n)return c.current=!0,{mode:`detail`,itemId:n};let e=ze(s,i);return e.length===1?(c.current=!0,{mode:`detail`,itemId:e[0].id}):{mode:`list`}}),[f,m]=(0,Z.useState)(0);ge(`background-tasks-dialog`);let{bashTasks:h,agentTasks:g,workflowTasks:_,dreamTasks:v,allSelectableItems:y}=(0,Z.useMemo)(()=>{let e=Object.values(s??{}).filter(b).map(Ve).sort((e,t)=>{let n=e.status,r=t.status;if(n===`running`&&r!==`running`)return-1;if(n!==`running`&&r===`running`)return 1;let i=`task`in e?e.task.startTime:0;return(`task`in t?t.task.startTime:0)-i}),t=e.filter(e=>e.type===`local_bash`),n=e.filter(e=>e.type===`local_agent`&&e.id!==i),r=e.filter(e=>e.type===`local_workflow`),a=e.filter(e=>e.type===`dream`);return{bashTasks:t,agentTasks:n,workflowTasks:r,dreamTasks:a,allSelectableItems:[...t,...n,...r,...a]}},[s,i]),x=y[f]??null;E({"confirm:previous":()=>m(e=>Math.max(0,e-1)),"confirm:next":()=>m(e=>Math.min(y.length-1,e+1)),"confirm:yes":()=>{let e=y[f];e&&d({mode:`detail`,itemId:e.id})}},{context:`Confirmation`,isActive:l.mode===`list`});let S=t=>{if(l.mode!==`list`)return;if(t.key===`left`){t.preventDefault(),e(`Background tasks dialog dismissed`,{display:`system`});return}let n=y[f];n&&t.key===`x`&&(t.preventDefault(),n.type===`local_bash`&&n.status===`running`?C(n.id):n.type===`local_agent`&&n.status===`running`?w(n.id):n.type===`local_workflow`&&n.status===`running`?$(n.id,a):n.type===`dream`&&n.status===`running`&&D(n.id))};async function C(e){await ee.kill(e,a)}async function w(e){await te.kill(e,a)}async function D(e){await p.kill(e,a)}let j=(0,Z.useEffectEvent)(e);(0,Z.useEffect)(()=>{if(l.mode!==`list`){let e=s?.[l.itemId];(!e||e.type!==`local_workflow`&&!b(e))&&(c.current?j(`Background tasks dialog dismissed`,{display:`system`}):d({mode:`list`}))}let e=y.length;f>=e&&e>0&&m(e-1)},[l,s,f,y,j]);let M=()=>{c.current&&y.length<=1?e(`Background tasks dialog dismissed`,{display:`system`}):(c.current=!1,d({mode:`list`}))};if(l.mode!==`list`&&s){let t=s[l.itemId];if(!t)return null;switch(t.type){case`local_bash`:return(0,Q.jsx)(Fe,{shell:t,onDone:e,onKillShell:()=>void C(t.id),onBack:M},`shell-${t.id}`);case`local_agent`:return(0,Q.jsx)(Te,{agent:t,onDone:e,onKillAgent:()=>void w(t.id),onBack:M},`agent-${t.id}`);case`local_workflow`:{let e=t.status===`running`?()=>$(t.id,a):void 0;return(0,Q.jsx)(O,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:t=>{t.key===`left`?(t.preventDefault(),M()):t.key===`x`&&e&&(t.preventDefault(),e())},children:(0,Q.jsx)(P,{title:t.workflowName,subtitle:(0,Q.jsxs)(k,{dimColor:!0,children:[t.status,t.summary?` · ${t.summary}`:``]}),onCancel:M,inputGuide:()=>(0,Q.jsxs)(A,{children:[(0,Q.jsx)(T,{shortcut:`←`,action:`go back`}),(0,Q.jsx)(T,{shortcut:`Esc`,action:`close`}),e&&(0,Q.jsx)(T,{shortcut:`x`,action:`stop`})]}),children:t.status===`failed`&&t.error?(0,Q.jsxs)(k,{color:`error`,children:[`失败原因:`,t.error]}):null})},`workflow-${t.id}`)}case`dream`:return(0,Q.jsx)(Me,{task:t,onDone:()=>e(`Background tasks dialog dismissed`,{display:`system`}),onBack:M,onKill:t.status===`running`?()=>void D(t.id):void 0},`dream-${t.id}`)}}let N=ce(h,e=>e.status===`running`),F=ce(g,e=>e.status===`running`),ie=se([...N>0?[(0,Q.jsxs)(k,{children:[N,` `,N===1?`active shell`:`active shells`]},`shells`)]:[],...F>0?[(0,Q.jsxs)(k,{children:[F,` `,F===1?`active agent`:`active agents`]},`agents`)]:[]],e=>(0,Q.jsx)(k,{children:` · `},`separator-${e}`)),ae=[(0,Q.jsx)(T,{shortcut:`↑/↓`,action:`select`},`upDown`),(0,Q.jsx)(T,{shortcut:`Enter`,action:`view`},`enter`),...(x?.type===`local_bash`||x?.type===`local_agent`||x?.type===`local_workflow`||x?.type===`dream`)&&x.status===`running`?[(0,Q.jsx)(T,{shortcut:`x`,action:`stop`},`kill`)]:[],...g.some(e=>e.status===`running`)?[(0,Q.jsx)(T,{shortcut:o,action:`stop all agents`},`kill-all`)]:[],(0,Q.jsx)(T,{shortcut:`←/Esc`,action:`close`},`esc`)],oe=()=>e(`Background tasks dialog dismissed`,{display:`system`});function I(e){return e.pending?(0,Q.jsxs)(k,{children:[`Press `,e.keyName,` again to exit`]}):(0,Q.jsx)(A,{children:ae})}return(0,Q.jsx)(O,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:S,children:(0,Q.jsx)(P,{title:`Background tasks`,subtitle:ie,onCancel:oe,color:`background`,inputGuide:I,children:y.length===0?(0,Q.jsx)(k,{dimColor:!0,children:`No tasks currently running`}):(0,Q.jsxs)(O,{flexDirection:`column`,children:[h.length>0&&(0,Q.jsxs)(O,{flexDirection:`column`,children:[g.length>0&&(0,Q.jsxs)(k,{dimColor:!0,children:[(0,Q.jsxs)(k,{bold:!0,children:[` `,`Shells`]}),` (`,h.length,`)`]}),(0,Q.jsx)(O,{flexDirection:`column`,children:h.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===x?.id},e.id))})]}),g.length>0&&(0,Q.jsxs)(O,{flexDirection:`column`,marginTop:+(h.length>0),children:[(0,Q.jsxs)(k,{dimColor:!0,children:[(0,Q.jsxs)(k,{bold:!0,children:[` `,`Local agents`]}),` (`,g.length,`)`]}),(0,Q.jsx)(O,{flexDirection:`column`,children:g.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===x?.id},e.id))})]}),_.length>0&&(0,Q.jsxs)(O,{flexDirection:`column`,marginTop:+(h.length>0||g.length>0),children:[(0,Q.jsxs)(k,{dimColor:!0,children:[(0,Q.jsxs)(k,{bold:!0,children:[` `,`Workflows`]}),` (`,_.length,`)`]}),(0,Q.jsx)(O,{flexDirection:`column`,children:_.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===x?.id},e.id))})]}),v.length>0&&(0,Q.jsx)(O,{flexDirection:`column`,marginTop:+(h.length>0||g.length>0||_.length>0),children:(0,Q.jsx)(O,{flexDirection:`column`,children:v.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===x?.id},e.id))})})]})})})}function Ve(e){switch(e.type){case`local_bash`:return{id:e.id,type:`local_bash`,label:e.command,status:e.status,task:e};case`local_agent`:return{id:e.id,type:`local_agent`,label:e.description,status:e.status,task:e};case`local_workflow`:return{id:e.id,type:`local_workflow`,label:e.summary??e.description,status:e.status,task:e};case`dream`:return{id:e.id,type:`dream`,label:e.description,status:e.status,task:e}}}function X({item:e,isSelected:t}){let{columns:n}=M(),i=Math.max(30,n-26);return(0,Q.jsxs)(O,{flexDirection:`row`,children:[(0,Q.jsx)(k,{children:t?`${r.pointer} `:` `}),(0,Q.jsx)(k,{color:t?`suggestion`:void 0,children:(0,Q.jsx)(Ae,{task:e.task,maxActivityWidth:i})})]})}var Z,Q,$,He=e((()=>{n(),Z=t(j(),1),v(),s(),h(),y(),w(),S(),oe(),_e(),N(),C(),x(),De(),je(),Ne(),Re(),m(),Q=F(),$=o}));export{H as a,Ce as i,He as n,B as o,we as r,Be as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{_i as t,gi as n}from"./loadAgentsDir-B0Anodo0.js";import{I as r,Lt as i,P as a,ai as o,kt as s,t as c,y as l}from"./src-DL3w8VPk.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{b as d,h as f}from"./settings-B2jvL8Dp.js";import{n as p,r as m}from"./analytics-DJobLaWP.js";import{t as h}from"./select-DIxfl_VN.js";import{t as g}from"./CustomSelect-wmZ9jz0W.js";var _=e(o(),1);p(),c(),t(),f(),g();var v=u();function y({onAccept:e}){let[t,o]=_.useState(null);_.useEffect(()=>{if(t!==null){let e=t,r=setTimeout(()=>n(e));return()=>clearTimeout(r)}},[t]),_.useEffect(()=>{m(`tengu_bypass_permissions_mode_dialog_shown`,{})},[]);function c(t){switch(t){case`accept`:m(`tengu_bypass_permissions_mode_dialog_accept`,{}),d(`userSettings`,{skipDangerousModePermissionPrompt:!0}),e();break;case`decline`:o(1);break}}let u=(0,_.useCallback)(()=>{o(0)},[]);return t===null?(0,v.jsxs)(l,{title:`WARNING: Work Mate running in Bypass Permissions mode`,color:`error`,onCancel:u,children:[(0,v.jsxs)(r,{flexDirection:`column`,gap:1,children:[(0,v.jsxs)(a,{children:[`In Bypass Permissions mode, Work Mate will not ask for your approval before running potentially dangerous commands.`,(0,v.jsx)(s,{}),`This mode should only be used in a sandboxed container/VM that has restricted internet access and can easily be restored if damaged.`]}),(0,v.jsx)(a,{children:`By proceeding, you accept all responsibility for actions taken while running in Bypass Permissions mode.`}),(0,v.jsx)(i,{url:`https://code.workmate.com/docs/en/security`})]}),(0,v.jsx)(h,{options:[{label:`No, exit`,value:`decline`},{label:`Yes, I accept`,value:`accept`}],onChange:e=>c(e)})]}):null}export{y as BypassPermissionsModeDialog};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t}from"./SelectMulti-BQRHed-d.js";import{n}from"./select-DIxfl_VN.js";var r=e((()=>{t(),n()}));export{r as t};
@@ -1,6 +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{bb as i,gb as a,hb as o,mb as s,vp as c,yp as l}from"./loadAgentsDir-B0Anodo0.js";import{C as u,Gt as d,I as f,P as p,T as m,ai as h,ot as g,t as _,y as ee}from"./src-DL3w8VPk.js";import{t as v}from"./jsx-runtime-Bb4Xn-E0.js";import{n as y,t as b}from"./cwd-Pa83R95t.js";import{Ir as x,Lr as S,Mr as C,jn as w,jr as T,wn as E}from"./settings-B2jvL8Dp.js";import{i as D,t as O}from"./execFileNoThrow-BTachNBI.js";import{l as k,o as A}from"./stringUtils-C718f5ey.js";import{_ as te,x as ne}from"./startupProfiler-CJdr3SxP.js";import{i as re,t as ie}from"./overlayContext-8--_fbvY.js";import{r as ae}from"./detectRepository-CfX8Lc0A.js";import{join as oe,resolve as j}from"path";import{access as M}from"fs/promises";async function se(){if(!await C()||await P())return null;let{stdout:e,code:t}=await O(x(),[`--no-optional-locks`,`diff`,`HEAD`,`--shortstat`],{timeout:F,preserveOutputOnError:!1});if(t===0){let t=de(e);if(t&&t.filesCount>z)return{stats:t,perFileStats:new Map,hunks:new Map}}let{stdout:n,code:r}=await O(x(),[`--no-optional-locks`,`diff`,`HEAD`,`--numstat`],{timeout:F,preserveOutputOnError:!1});if(r!==0)return null;let{stats:i,perFileStats:a}=le(n),o=I-a.size;if(o>0){let e=await ue(o);if(e){i.filesCount+=e.size;for(let[t,n]of e)a.set(t,n)}}return{stats:i,perFileStats:a,hunks:new Map}}async function ce(){if(!await C()||await P())return new Map;let{stdout:e,code:t}=await O(x(),[`--no-optional-locks`,`diff`,`HEAD`],{timeout:F,preserveOutputOnError:!1});return t===0?N(e):new Map}function le(e){let t=e.trim().split(`
2
- `).filter(Boolean),n=0,r=0,i=0,a=new Map;for(let e of t){let t=e.split(` `);if(t.length<3)continue;i++;let o=t[0],s=t[1],c=t.slice(2).join(` `),l=o===`-`||s===`-`,u=l?0:parseInt(o??`0`,10)||0,d=l?0:parseInt(s??`0`,10)||0;n+=u,r+=d,a.size<I&&a.set(c,{added:u,removed:d,isBinary:l})}return{stats:{filesCount:i,linesAdded:n,linesRemoved:r},perFileStats:a}}function N(e){let t=new Map;if(!e.trim())return t;let n=e.split(/^diff --git /m).filter(Boolean);for(let e of n){if(t.size>=I)break;if(e.length>L)continue;let n=e.split(`
3
- `),r=n[0]?.match(/^a\/(.+?) b\/(.+)$/);if(!r)continue;let i=r[2]??r[1]??``,a=[],o=null,s=0;for(let e=1;e<n.length;e++){let t=n[e]??``,r=t.match(/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);if(r){o&&a.push(o),o={oldStart:parseInt(r[1]??`0`,10),oldLines:parseInt(r[2]??`1`,10),newStart:parseInt(r[3]??`0`,10),newLines:parseInt(r[4]??`1`,10),lines:[]};continue}if(!(t.startsWith(`index `)||t.startsWith(`---`)||t.startsWith(`+++`)||t.startsWith(`new file`)||t.startsWith(`deleted file`)||t.startsWith(`old mode`)||t.startsWith(`new mode`)||t.startsWith(`Binary files`))&&o&&(t.startsWith(`+`)||t.startsWith(`-`)||t.startsWith(` `)||t===``)){if(s>=R)continue;o.lines.push(`${t}`),s++}}o&&a.push(o),a.length>0&&t.set(i,a)}return t}async function P(){let e=await T(b());return e?(await Promise.all([`MERGE_HEAD`,`REBASE_HEAD`,`CHERRY_PICK_HEAD`,`REVERT_HEAD`].map(t=>M(oe(e,t)).then(()=>!0).catch(()=>!1)))).some(Boolean):!1}async function ue(e){let{stdout:t,code:n}=await O(x(),[`--no-optional-locks`,`ls-files`,`--others`,`--exclude-standard`],{timeout:F,preserveOutputOnError:!1});if(n!==0||!t.trim())return null;let r=t.trim().split(`
4
- `).filter(Boolean);if(r.length===0)return null;let i=new Map;for(let t of r.slice(0,e))i.set(t,{added:0,removed:0,isBinary:!1,isUntracked:!0});return i}function de(e){let t=e.match(/(\d+)\s+files?\s+changed(?:,\s+(\d+)\s+insertions?\(\+\))?(?:,\s+(\d+)\s+deletions?\(-\))?/);return t?{filesCount:parseInt(t[1]??`0`,10),linesAdded:parseInt(t[2]??`0`,10),linesRemoved:parseInt(t[3]??`0`,10)}:null}var F,I,L,R,z,B=e((()=>{y(),ae(),D(),E(),S(),F=5e3,I=50,L=1e6,R=400,z=500}));function V(){let[e,t]=(0,H.useState)(null),[n,r]=(0,H.useState)(new Map),[i,a]=(0,H.useState)(!0);return(0,H.useEffect)(()=>{let e=!1;async function n(){try{let[n,i]=await Promise.all([se(),ce()]);e||(t(n),r(i),a(!1))}catch{e||(t(null),r(new Map),a(!1))}}return n(),()=>{e=!0}},[]),(0,H.useMemo)(()=>{if(!e)return{stats:null,files:[],hunks:new Map,loading:i};let{stats:t,perFileStats:r}=e,a=[];for(let[e,t]of r){let r=n.get(e),i=t.isUntracked??!1,o=!t.isBinary&&!i&&!r,s=t.added+t.removed,c=!o&&!t.isBinary&&s>U;a.push({path:e,linesAdded:t.added,linesRemoved:t.removed,isBinary:t.isBinary,isLargeFile:o,isTruncated:c,isUntracked:i})}return a.sort((e,t)=>e.path.localeCompare(t.path)),{stats:t,files:a,hunks:n,loading:!1}},[e,n,i])}var H,U,fe=e((()=>{H=t(h(),1),B(),U=400}));function W(e){if(!e||typeof e!=`object`)return!1;let t=e,n=typeof t.filePath==`string`,r=Array.isArray(t.structuredPatch)&&t.structuredPatch.length>0,i=t.type===`create`&&typeof t.content==`string`;return n&&(r||i)}function pe(e){return`type`in e&&(e.type===`create`||e.type===`update`)}function me(e){let t=0,n=0;for(let r of e)for(let e of r.lines)e.startsWith(`+`)?t++:e.startsWith(`-`)&&n++;return{added:t,removed:n}}function he(e){if(e.type!==`user`)return``;let t=e.message.content,n=typeof t==`string`?t:``;return n.length<=30?n:`${n.slice(0,29)}…`}function G(e){let t=0,n=0;for(let r of e.files.values())t+=r.linesAdded,n+=r.linesRemoved;e.stats={filesChanged:e.files.size,linesAdded:t,linesRemoved:n}}function ge(e){let t=(0,K.useRef)({completedTurns:[],currentTurn:null,lastProcessedIndex:0,lastTurnIndex:0});return(0,K.useMemo)(()=>{let n=t.current;e.length<n.lastProcessedIndex&&(n.completedTurns=[],n.currentTurn=null,n.lastProcessedIndex=0,n.lastTurnIndex=0);for(let t=n.lastProcessedIndex;t<e.length;t++){let r=e[t];if(r?.type===`user`){if(!(r.toolUseResult||Array.isArray(r.message.content)&&r.message.content[0]?.type===`tool_result`)&&!r.isMeta)n.currentTurn&&n.currentTurn.files.size>0&&(G(n.currentTurn),n.completedTurns.push(n.currentTurn)),n.lastTurnIndex++,n.currentTurn={turnIndex:n.lastTurnIndex,userPromptPreview:he(r),timestamp:r.timestamp,files:new Map,stats:{filesChanged:0,linesAdded:0,linesRemoved:0}};else if(n.currentTurn&&r.toolUseResult){let e=r.toolUseResult;if(W(e)){let{filePath:t,structuredPatch:r}=e,i=`type`in e&&e.type===`create`,a=n.currentTurn.files.get(t);if(a||(a={filePath:t,hunks:[],isNewFile:i,linesAdded:0,linesRemoved:0},n.currentTurn.files.set(t,a)),i&&r.length===0&&pe(e)){let t=e.content.split(`
5
- `),n={oldStart:0,oldLines:0,newStart:1,newLines:t.length,lines:t.map(e=>`+${e}`)};a.hunks.push(n),a.linesAdded+=t.length}else{a.hunks.push(...r);let{added:e,removed:t}=me(r);a.linesAdded+=e,a.linesRemoved+=t}i&&(a.isNewFile=!0)}}}}n.lastProcessedIndex=e.length;let r=[...n.completedTurns];return n.currentTurn&&n.currentTurn.files.size>0&&(G(n.currentTurn),r.push(n.currentTurn)),r.reverse()},[e])}var K,_e=e((()=>{K=t(h(),1)}));function ve({filePath:e,hunks:t,isLargeFile:n,isBinary:r,isTruncated:i,isUntracked:a}){let{columns:o}=g(),{firstLine:s,fileContent:l}=(0,q.useMemo)(()=>{if(!e)return{firstLine:null,fileContent:void 0};let t=w(j(b(),e));return{firstLine:t?.split(`
6
- `)[0]??null,fileContent:t??void 0}},[e]);return a?(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(f,{children:[(0,J.jsx)(p,{bold:!0,children:e}),(0,J.jsx)(p,{dimColor:!0,children:` (untracked)`})]}),(0,J.jsx)(u,{padding:4}),(0,J.jsxs)(f,{flexDirection:`column`,children:[(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`New file not yet staged.`}),(0,J.jsxs)(p,{dimColor:!0,italic:!0,children:["Run `git add ",e,"` to see line counts."]})]})]}):r?(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(f,{children:(0,J.jsx)(p,{bold:!0,children:e})}),(0,J.jsx)(u,{padding:4}),(0,J.jsx)(f,{flexDirection:`column`,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`Binary file - cannot display diff`})})]}):n?(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(f,{children:(0,J.jsx)(p,{bold:!0,children:e})}),(0,J.jsx)(u,{padding:4}),(0,J.jsx)(f,{flexDirection:`column`,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`Large file - diff exceeds 1 MB limit`})})]}):(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(f,{children:[(0,J.jsx)(p,{bold:!0,children:e}),i&&(0,J.jsx)(p,{dimColor:!0,children:` (truncated)`})]}),(0,J.jsx)(u,{padding:4}),(0,J.jsx)(f,{flexDirection:`column`,children:t.length===0?(0,J.jsx)(p,{dimColor:!0,children:`No diff content`}):t.map((t,n)=>(0,J.jsx)(c,{patch:t,filePath:e,firstLine:s,fileContent:l,dim:!1,width:o-2-2},n))}),i&&(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`… diff truncated (exceeded 400 line limit)`})]})}var q,J,ye=e((()=>{q=t(h(),1),i(),_(),y(),E(),l(),J=v()}));function be({files:e,selectedIndex:t}){let{columns:n}=g(),{startIndex:r,endIndex:i}=(0,Y.useMemo)(()=>{if(e.length===0||e.length<=Z)return{startIndex:0,endIndex:e.length};let n=Math.max(0,t-Math.floor(Z/2)),r=n+Z;return r>e.length&&(r=e.length,n=Math.max(0,r-Z)),{startIndex:n,endIndex:r}},[e.length,t]);if(e.length===0)return(0,X.jsx)(p,{dimColor:!0,children:`No changed files`});let a=e.slice(r,i),o=r>0,s=i<e.length,c=e.length>Z,l=Math.max(20,n-16-3-4);return(0,X.jsxs)(f,{flexDirection:`column`,children:[c&&(0,X.jsx)(p,{dimColor:!0,children:o?` ↑ ${r} more ${k(r,`file`)}`:` `}),a.map((e,n)=>(0,X.jsx)(xe,{file:e,isSelected:r+n===t,maxPathWidth:l},e.path)),c&&(0,X.jsx)(p,{dimColor:!0,children:s?` ↓ ${e.length-i} more ${k(e.length-i,`file`)}`:` `})]})}function xe({file:e,isSelected:t,maxPathWidth:n}){let i=ne(e.path,n),a=`${t?`${r.pointer} `:` `}${i}`;return(0,X.jsxs)(f,{flexDirection:`row`,children:[(0,X.jsx)(p,{bold:t,color:t?`background`:void 0,inverse:t,children:a}),(0,X.jsx)(f,{flexGrow:1}),(0,X.jsx)(Se,{file:e,isSelected:t})]})}function Se({file:e,isSelected:t}){return e.isUntracked?(0,X.jsx)(p,{dimColor:!t,italic:!0,children:`untracked`}):e.isBinary?(0,X.jsx)(p,{dimColor:!t,italic:!0,children:`Binary file`}):e.isLargeFile?(0,X.jsx)(p,{dimColor:!t,italic:!0,children:`Large file modified`}):(0,X.jsxs)(p,{children:[e.linesAdded>0&&(0,X.jsxs)(p,{color:`diffAddedWord`,bold:t,children:[`+`,e.linesAdded]}),e.linesAdded>0&&e.linesRemoved>0&&` `,e.linesRemoved>0&&(0,X.jsxs)(p,{color:`diffRemovedWord`,bold:t,children:[`-`,e.linesRemoved]}),e.isTruncated&&(0,X.jsx)(p,{dimColor:!t,children:` (truncated)`})]})}var Y,X,Z,Ce=e((()=>{n(),Y=t(h(),1),i(),_(),te(),A(),X=v(),Z=5}));function we(e){let t=Array.from(e.files.values()).map(e=>({path:e.filePath,linesAdded:e.linesAdded,linesRemoved:e.linesRemoved,isBinary:!1,isLargeFile:!1,isTruncated:!1,isNewFile:e.isNewFile})).sort((e,t)=>e.path.localeCompare(t.path)),n=new Map;for(let t of e.files.values())n.set(t.filePath,t.hunks);return{stats:{filesCount:e.stats.filesChanged,linesAdded:e.stats.linesAdded,linesRemoved:e.stats.linesRemoved},files:t,hunks:n,loading:!1}}function Te({messages:e,onDone:t}){let n=V(),r=ge(e),[i,o]=(0,Q.useState)(`list`),[s,c]=(0,Q.useState)(0),[l,u]=(0,Q.useState)(0),h=(0,Q.useMemo)(()=>[{type:`current`},...r.map(e=>({type:`turn`,turn:e}))],[r]),g=h[l],_=g?.type===`turn`?g.turn:null,v=(0,Q.useMemo)(()=>_?we(_):n,[_,n]),y=v.files[s],b=(0,Q.useMemo)(()=>y&&v.hunks.get(y.path)||[],[y,v.hunks]);(0,Q.useEffect)(()=>{l>=h.length&&u(Math.max(0,h.length-1))},[h.length,l]);let x=(0,Q.useRef)(l);(0,Q.useEffect)(()=>{x.current!==l&&(c(0),x.current=l)},[l]),re(`diff-dialog`),d({"diff:previousSource":()=>{i===`detail`?o(`list`):i===`list`&&h.length>1&&u(e=>Math.max(0,e-1))},"diff:nextSource":()=>{i===`list`&&h.length>1&&u(e=>Math.min(h.length-1,e+1))},"diff:back":()=>{i===`detail`&&o(`list`)},"diff:viewDetails":()=>{i===`list`&&y&&o(`detail`)},"diff:previousFile":()=>{i===`list`&&c(e=>Math.max(0,e-1))},"diff:nextFile":()=>{i===`list`&&c(e=>Math.min(v.files.length-1,e+1))}},{context:`DiffDialog`});let S=v.stats?(0,$.jsxs)(p,{dimColor:!0,children:[v.stats.filesCount,` `,k(v.stats.filesCount,`file`),` changed`,v.stats.linesAdded>0&&(0,$.jsxs)(p,{color:`diffAddedWord`,children:[` +`,v.stats.linesAdded]}),v.stats.linesRemoved>0&&(0,$.jsxs)(p,{color:`diffRemovedWord`,children:[` -`,v.stats.linesRemoved]})]}):null,C=_?`Turn ${_.turnIndex}`:`Uncommitted changes`,w=_?_.userPromptPreview?`"${_.userPromptPreview}"`:``:`(git diff HEAD)`,T=h.length>1?(0,$.jsxs)(f,{children:[l>0&&(0,$.jsx)(p,{dimColor:!0,children:`◀ `}),h.map((e,t)=>{let n=t===l,r=e.type===`current`?`Current`:`T${e.turn.turnIndex}`;return(0,$.jsxs)(p,{dimColor:!n,bold:n,children:[t>0?` · `:``,r]},t)}),l<h.length-1&&(0,$.jsx)(p,{dimColor:!0,children:` ▶`})]}):null,E=a(`diff:dismiss`,`DiffDialog`,`esc`),D=v.loading?`Loading diff…`:_?`No file changes in this turn`:v.stats&&v.stats.filesCount>0&&v.files.length===0?`Too many files to display details`:`Working tree is clean`,O=(0,$.jsxs)(p,{children:[C,w&&(0,$.jsxs)(p,{dimColor:!0,children:[` `,w]})]});function A(){i===`detail`?o(`list`):t(`Diff dialog dismissed`,{display:`system`})}return(0,$.jsxs)(ee,{title:O,onCancel:A,color:`background`,inputGuide:e=>e.pending?(0,$.jsxs)(p,{children:[`Press `,e.keyName,` again to exit`]}):i===`list`?(0,$.jsxs)(m,{children:[h.length>1&&(0,$.jsx)(p,{children:`←/→ source`}),(0,$.jsx)(p,{children:`↑/↓ select`}),(0,$.jsx)(p,{children:`Enter view`}),(0,$.jsxs)(p,{children:[E,` close`]})]}):(0,$.jsxs)(m,{children:[(0,$.jsx)(p,{children:`← back`}),(0,$.jsxs)(p,{children:[E,` close`]})]}),children:[T,S,v.files.length===0?(0,$.jsx)(f,{marginTop:1,children:(0,$.jsx)(p,{dimColor:!0,children:D})}):i===`list`?(0,$.jsx)(f,{flexDirection:`column`,marginTop:1,children:(0,$.jsx)(be,{files:v.files,selectedIndex:s})}):(0,$.jsx)(f,{flexDirection:`column`,marginTop:1,children:(0,$.jsx)(ve,{filePath:y?.path||``,hunks:b,isLargeFile:y?.isLargeFile,isBinary:y?.isBinary,isTruncated:y?.isTruncated,isUntracked:y?.isUntracked})})]})}var Q,$;e((()=>{Q=t(h(),1),ie(),fe(),_e(),_(),s(),o(),A(),ye(),Ce(),$=v()}))();export{Te as DiffDialog};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./Doctor-DqW6j3_B.js";e();export{t as Doctor};
@@ -1,3 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{i as n,o as r}from"./envUtils-DfkgIdYf.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{$b as o,Dh as s,Dl as c,Eh as l,Ip as u,Ji as d,Kx as f,Lp as p,Ol as ee,Qb as m,Xb as te,Yb as ne,Zb as h,__ as g,aw as _,cw as v,gC as y,g_ as b,iw as x,kl as S,mb as re,ow as ie,p_ as C,qi as ae,qx as w,yC as T,y_ as oe}from"./loadAgentsDir-B0Anodo0.js";import{Gt as se,I as E,P as D,ai as ce,t as O,x as k}from"./src-DL3w8VPk.js";import{t as A}from"./jsx-runtime-Bb4Xn-E0.js";import{It as j,J as M}from"./state-B4jiUise.js";import{R as N,V as P,kn as F,wn as I}from"./settings-B2jvL8Dp.js";import{l as L,o as R}from"./stringUtils-C718f5ey.js";import{_t as z,bt as B,d as V,o as H}from"./model-BvQFFOf8.js";import{n as U,t as W}from"./ValidationErrorsList-DgNzJQUP.js";import{n as G,t as le}from"./useExitOnCtrlCDWithKeybindings-BKwzUpgb.js";import{f as ue,g as de,h as fe,i as pe,n as me,o as he,p as ge,r as _e}from"./pidLock-Cm4sW35f.js";import{n as ve,t as ye}from"./McpParsingWarnings-Bff66RtJ.js";import{n as be,t as xe}from"./PressEnterToContinue-DZc_s_pE.js";import{n as Se,t as Ce}from"./useSettingsErrors-SFPWfxsA.js";import{n as we,t as Te}from"./shadowedRuleDetection-Bg_aIc5Z.js";import{n as Ee,r as De,t as K}from"./statusNoticeHelpers-BRQpUIlH.js";import{join as q}from"path";function Oe(){if(!v())return null;let e=x();if(e.length===0)return null;let t=e.filter(e=>e.severity===`error`),n=e.filter(e=>e.severity===`warning`);return(0,J.jsxs)(E,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,J.jsx)(D,{bold:!0,color:t.length>0?`error`:`warning`,children:`Keybinding Configuration Issues`}),(0,J.jsxs)(E,{children:[(0,J.jsx)(D,{dimColor:!0,children:`Location: `}),(0,J.jsx)(D,{dimColor:!0,children:_()})]}),(0,J.jsxs)(E,{marginLeft:1,flexDirection:`column`,marginTop:1,children:[t.map((e,t)=>(0,J.jsxs)(E,{flexDirection:`column`,children:[(0,J.jsxs)(E,{children:[(0,J.jsx)(D,{dimColor:!0,children:`└ `}),(0,J.jsx)(D,{color:`error`,children:`[Error]`}),(0,J.jsxs)(D,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(E,{marginLeft:3,children:(0,J.jsxs)(D,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`error-${t}`)),n.map((e,t)=>(0,J.jsxs)(E,{flexDirection:`column`,children:[(0,J.jsxs)(E,{children:[(0,J.jsx)(D,{dimColor:!0,children:`└ `}),(0,J.jsx)(D,{color:`warning`,children:`[Warning]`}),(0,J.jsxs)(D,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(E,{marginLeft:3,children:(0,J.jsxs)(D,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`warning-${t}`))]})]})}var J,ke=e((()=>{O(),ie(),J=A()}));function Ae(){if(!y.isSupportedPlatform()||!y.isSandboxEnabledInSettings())return null;let e=y.checkDependencies(),t=e.errors.length>0,n=e.warnings.length>0;return!t&&!n?null:(0,Y.jsxs)(E,{flexDirection:`column`,children:[(0,Y.jsx)(D,{bold:!0,children:`Sandbox`}),(0,Y.jsxs)(D,{children:[`└ Status: `,(0,Y.jsx)(D,{color:t?`error`:`warning`,children:t?`Missing dependencies`:`Available (with warnings)`})]}),e.errors.map((e,t)=>(0,Y.jsxs)(D,{color:`error`,children:[`└ `,e]},t)),e.warnings.map((e,t)=>(0,Y.jsxs)(D,{color:`warning`,children:[`└ `,e]},t)),t&&(0,Y.jsx)(D,{dimColor:!0,children:`└ Run /sandbox for install instructions`})]})}var Y,je=e((()=>{O(),T(),Y=A()}));async function Me(){let e=b(await g());if(e.length===0)return null;let t=e.sort((e,t)=>t.content.length-e.content.length).map(e=>`${e.path}: ${e.content.length.toLocaleString()} chars`);return{type:`agentsmd_files`,severity:`warning`,message:e.length===1?`Large AGENTS.md file detected (${e[0].content.length.toLocaleString()} chars > ${C.toLocaleString()})`:`${e.length} large AGENTS.md files detected (each > ${C.toLocaleString()} chars)`,details:t,currentValue:e.length,threshold:C}}async function Ne(e){if(!e)return null;let t=Ee(e);if(t<=15e3)return null;let n=e.activeAgents.filter(e=>e.source!==`built-in`).map(e=>{let t=`${e.agentType}: ${e.whenToUse}`;return{name:e.agentType,tokens:d(t)}}).sort((e,t)=>t.tokens-e.tokens),r=n.slice(0,5).map(e=>`${e.name}: ~${e.tokens.toLocaleString()} tokens`);return n.length>5&&r.push(`(${n.length-5} more custom agents)`),{type:`agent_descriptions`,severity:`warning`,message:`Large agent descriptions (~${t.toLocaleString()} tokens > ${K.toLocaleString()})`,details:r,currentValue:t,threshold:K}}async function X(e,t,n){let r=e.filter(e=>e.isMcp);if(r.length===0)return null;try{let{mcpToolTokens:r,mcpToolDetails:i}=await l(e,t,n,H());if(r<=Z)return null;let a=new Map;for(let e of i){let t=e.name.split(`__`)[1]||`unknown`,n=a.get(t)||{count:0,tokens:0};a.set(t,{count:n.count+1,tokens:n.tokens+e.tokens})}let o=Array.from(a.entries()).sort((e,t)=>t[1].tokens-e[1].tokens),s=o.slice(0,5).map(([e,t])=>`${e}: ${t.count} tools (~${t.tokens.toLocaleString()} tokens)`);return o.length>5&&s.push(`(${o.length-5} more servers)`),{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${r.toLocaleString()} tokens > ${Z.toLocaleString()})`,details:s,currentValue:r,threshold:Z}}catch{let e=r.reduce((e,t)=>e+d(((t.name?.length||0)+t.description.length).toString()),0);return e<=Z?null:{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${e.toLocaleString()} tokens estimated > ${Z.toLocaleString()})`,details:[`${r.length} MCP tools detected (token count estimated)`],currentValue:e,threshold:Z}}}async function Pe(e){let t=Te(await e(),{sandboxAutoAllowEnabled:y.isSandboxingEnabled()&&y.isAutoAllowBashIfSandboxedEnabled()});if(t.length===0)return null;let n=t.flatMap(e=>[`${P(e.rule.ruleValue)}: ${e.reason}`,` Fix: ${e.fix}`]);return{type:`unreachable_rules`,severity:`warning`,message:`${t.length} ${L(t.length,`unreachable permission rule`)} detected`,details:n,currentValue:t.length,threshold:0}}async function Fe(e,t,n){let[r,i,a,o]=await Promise.all([Me(),Ne(t),X(e,n,t),Pe(n)]);return{agentsMdWarning:r,agentWarning:i,mcpWarning:a,unreachableRulesWarning:o}}var Z,Ie=e((()=>{ae(),s(),oe(),V(),N(),we(),T(),De(),R(),Z=25e3}));function Le({onDone:e}){let t=p(e=>e.agentDefinitions),r=p(e=>e.mcp.tools),i=p(e=>e.toolPermissionContext),s=p(e=>e.plugins.errors);G();let l=(0,Q.useMemo)(()=>r||[],[r]),[u,d]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(null),b=Se().filter(e=>e.mcpErrorMetadata===void 0),x=(0,Q.useMemo)(()=>[{name:`BASH_MAX_OUTPUT_LENGTH`,default:ne,upperLimit:te},{name:`TASK_MAX_OUTPUT_LENGTH`,default:c,upperLimit:ee},{name:`CLAUDE_CODE_MAX_OUTPUT_TOKENS`,...z(`claude-opus-4-7`)}].map(e=>{let t=process.env[e.name],n=o(e.name,t,e.default,e.upperLimit);return{name:e.name,...n}}).filter(e=>e.status!==`valid`),[]);(0,Q.useEffect)(()=>{fe().then(d),(async()=>{let e=q(n(),`agents`),r=q(M(),`.workmate`,`agents`),{activeAgents:a,allAgents:o,failedFiles:s}=t,[c,u]=await Promise.all([F(e),F(r)]),d={activeAgents:a.map(e=>({agentType:e.agentType,source:e.source})),userAgentsDir:e,projectAgentsDir:r,userDirExists:c,projectDirExists:u,failedFiles:s};h(d);let f=await Fe(l,{activeAgents:a,allAgents:o,failedFiles:s},async()=>i);if(_(f),he()){let e=q(ue(),`claude`,`locks`),t=me(e),n=_e(e);y({enabled:!0,locks:n,locksDir:e,staleLocksCleaned:t})}else y({enabled:!1,locks:[],locksDir:``,staleLocksCleaned:0})})()},[i,l,t]);let S=(0,Q.useCallback)(()=>{e(`Work Mate diagnostics dismissed`,{display:`system`})},[e]);return se({"confirm:yes":S,"confirm:no":S},{context:`Confirmation`}),u?(0,$.jsxs)(k,{children:[(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Diagnostics`}),(0,$.jsxs)(D,{children:[`└ Currently running: `,u.installationType,` (`,u.version,`)`]}),u.packageManager&&(0,$.jsxs)(D,{children:[`└ Package manager: `,u.packageManager]}),(0,$.jsxs)(D,{children:[`└ Path: `,u.installationPath]}),(0,$.jsxs)(D,{children:[`└ Invoked: `,u.invokedBinary]}),(0,$.jsxs)(D,{children:[`└ Config install method: `,u.configInstallMethod]}),(0,$.jsxs)(D,{children:[`└ Search: `,u.ripgrepStatus.working?`OK`:`Not working`,` (`,u.ripgrepStatus.mode===`embedded`?`bundled`:u.ripgrepStatus.mode===`builtin`?`vendor`:u.ripgrepStatus.systemPath||`system`,`)`]}),u.ripgrepStatus.note&&(0,$.jsxs)(D,{color:`warning`,children:[`└ Note: `,u.ripgrepStatus.note]}),u.recommendation&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(D,{}),(0,$.jsxs)(D,{color:`warning`,children:[`Recommendation: `,u.recommendation.split(`
2
- `)[0]]}),(0,$.jsx)(D,{dimColor:!0,children:u.recommendation.split(`
3
- `)[1]})]}),u.multipleInstallations.length>1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(D,{}),(0,$.jsx)(D,{color:`warning`,children:`Warning: Multiple installations found`}),u.multipleInstallations.map((e,t)=>(0,$.jsxs)(D,{children:[`└ `,e.type,` at `,e.path]},t))]}),u.warnings.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(D,{}),u.warnings.map((e,t)=>(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsxs)(D,{color:`warning`,children:[`Warning: `,e.issue]}),(0,$.jsxs)(D,{children:[`Fix: `,e.fix]})]},t))]}),b.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,$.jsx)(D,{bold:!0,children:`Invalid Settings`}),(0,$.jsx)(W,{errors:b})]})]}),(0,$.jsx)(Ae,{}),(0,$.jsx)(ye,{}),(0,$.jsx)(Oe,{}),x.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Environment Variables`}),x.map((e,t)=>(0,$.jsxs)(D,{children:[`└ `,e.name,`:`,` `,(0,$.jsx)(D,{color:e.status===`capped`?`warning`:`error`,children:e.message})]},t))]}),v?.enabled&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Version Locks`}),v.staleLocksCleaned>0&&(0,$.jsxs)(D,{dimColor:!0,children:[`└ Cleaned `,v.staleLocksCleaned,` stale lock(s)`]}),v.locks.length===0?(0,$.jsx)(D,{dimColor:!0,children:`└ No active version locks`}):v.locks.map((e,t)=>(0,$.jsxs)(D,{children:[`└ `,e.version,`: PID `,e.pid,` `,e.isProcessRunning?(0,$.jsx)(D,{children:`(running)`}):(0,$.jsx)(D,{color:`warning`,children:`(stale)`})]},t))]}),m?.failedFiles&&m.failedFiles.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,color:`error`,children:`Agent Parse Errors`}),(0,$.jsxs)(D,{color:`error`,children:[`└ Failed to parse `,m.failedFiles.length,` agent file(s):`]}),m.failedFiles.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e.path,`: `,e.error]},t))]}),s.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,color:`error`,children:`Plugin Errors`}),(0,$.jsxs)(D,{color:`error`,children:[`└ `,s.length,` plugin error(s) detected:`]}),s.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e.source||`unknown`,`plugin`in e&&e.plugin?` [${e.plugin}]`:``,`: `,f(e)]},t))]}),g?.unreachableRulesWarning&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,color:`warning`,children:`Unreachable Permission Rules`}),(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,g.unreachableRulesWarning.message]})]}),g.unreachableRulesWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]}),g&&(g.agentsMdWarning||g.agentWarning||g.mcpWarning)&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Context Usage Warnings`}),g.agentsMdWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,g.agentsMdWarning.message]})]}),(0,$.jsxs)(D,{children:[` `,`└ Files:`]}),g.agentsMdWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]}),g.agentWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,g.agentWarning.message]})]}),(0,$.jsxs)(D,{children:[` `,`└ Top contributors:`]}),g.agentWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]}),g.mcpWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,g.mcpWarning.message]})]}),(0,$.jsxs)(D,{children:[` `,`└ MCP servers:`]}),g.mcpWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]})]}),(0,$.jsx)(E,{children:(0,$.jsx)(xe,{})})]}):(0,$.jsx)(k,{children:(0,$.jsx)(D,{dimColor:!0,children:`Checking installation status…`})})}var Q,$,Re=e((()=>{i(),Q=t(ce(),1),ke(),ve(),B(),r(),j(),O(),be(),je(),U(),Ce(),le(),re(),u(),w(),Ie(),de(),m(),I(),pe(),h(),S(),ge(),$=A()}));export{Re as n,Le as t};
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{AC as r,Aw as i,Ct as a,Nb as o,Pb as s,_i as c,_r as l,dt as u,hi as d,jC as f,kw as p,li as m,vt as h,wt as g,xt as _}from"./loadAgentsDir-B0Anodo0.js";import{I as v,P as y,ai as b,t as x,y as S}from"./src-DL3w8VPk.js";import{t as C}from"./jsx-runtime-Bb4Xn-E0.js";import{c as w,i as T}from"./debug-Bglx1aTu.js";import{i as E,t as D}from"./execFileNoThrow-BTachNBI.js";import{n as O,r as k}from"./analytics-DJobLaWP.js";import{n as A,t as j}from"./select-DIxfl_VN.js";import{r as M,t as N}from"./Spinner-ByQXTvAA.js";function P(){(l(),e(m)).saveWorktreeState(null)}function F({onDone:e,onCancel:t}){let[n,r]=(0,I.useState)(`loading`),[i,o]=(0,I.useState)([]),[c,l]=(0,I.useState)(0),[d,f]=(0,I.useState)(),m=h();if((0,I.useEffect)(()=>{async function e(){let e=[],t=await D(`git`,[`status`,`--porcelain`]);if(t.stdout&&(e=t.stdout.split(`
2
- `).filter(e=>e.trim()!==``),o(e)),m){let{stdout:t}=await D(`git`,[`rev-list`,`--count`,`${m.originalHeadCommit}..HEAD`]),n=parseInt(t.trim(),10)||0;if(l(n),e.length===0&&n===0){r(`removing`),u().then(()=>{process.chdir(m.originalCwd),s(m.originalCwd),P(),p.cache.clear?.(),f(`Worktree removed (no changes)`)}).catch(e=>{w(`Failed to clean up worktree: ${e}`,{level:`error`}),f(`Worktree cleanup failed, exiting anyway`)}).then(()=>{r(`done`)});return}else r(`asking`)}}e()},[m]),(0,I.useEffect)(()=>{n===`done`&&e(d)},[n,e,d]),!m)return e(`No active worktree session found`,{display:`system`}),null;if(n===`loading`||n===`done`)return null;async function _(e){if(!m)return;let t=!!m.tmuxSessionName;if(e===`keep`||e===`keep-with-tmux`)r(`keeping`),k(`tengu_worktree_kept`,{commits:c,changed_files:i.length}),await a(),process.chdir(m.originalCwd),s(m.originalCwd),P(),p.cache.clear?.(),f(t?`Worktree kept. Your work is saved at ${m.worktreePath} on branch ${m.worktreeBranch}. Reattach to tmux session with: tmux attach -t ${m.tmuxSessionName}`:`Worktree kept. Your work is saved at ${m.worktreePath} on branch ${m.worktreeBranch}`),r(`done`);else if(e===`keep-kill-tmux`)r(`keeping`),k(`tengu_worktree_kept`,{commits:c,changed_files:i.length}),m.tmuxSessionName&&await g(m.tmuxSessionName),await a(),process.chdir(m.originalCwd),s(m.originalCwd),P(),p.cache.clear?.(),f(`Worktree kept at ${m.worktreePath} on branch ${m.worktreeBranch}. Tmux session terminated.`),r(`done`);else if(e===`remove`||e===`remove-with-tmux`){r(`removing`),k(`tengu_worktree_removed`,{commits:c,changed_files:i.length}),m.tmuxSessionName&&await g(m.tmuxSessionName);try{await u(),process.chdir(m.originalCwd),s(m.originalCwd),P(),p.cache.clear?.()}catch(e){w(`Failed to clean up worktree: ${e}`,{level:`error`}),f(`Worktree cleanup failed, exiting anyway`),r(`done`);return}let e=t?` Tmux session terminated.`:``;c>0&&i.length>0?f(`Worktree removed. ${c} ${c===1?`commit`:`commits`} and uncommitted changes were discarded.${e}`):c>0?f(`Worktree removed. ${c} ${c===1?`commit`:`commits`} on ${m.worktreeBranch} ${c===1?`was`:`were`} discarded.${e}`):i.length>0?f(`Worktree removed. Uncommitted changes were discarded.${e}`):f(`Worktree removed.${e}`),r(`done`)}}if(n===`keeping`)return(0,L.jsxs)(v,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(N,{}),(0,L.jsx)(y,{children:`Keeping worktree…`})]});if(n===`removing`)return(0,L.jsxs)(v,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(N,{}),(0,L.jsx)(y,{children:`Removing worktree…`})]});let b=m.worktreeBranch,x=i.length>0,C=c>0,T=``;T=x&&C?`You have ${i.length} uncommitted ${i.length===1?`file`:`files`} and ${c} ${c===1?`commit`:`commits`} on ${b}. All will be lost if you remove.`:x?`You have ${i.length} uncommitted ${i.length===1?`file`:`files`}. These will be lost if you remove the worktree.`:C?`You have ${c} ${c===1?`commit`:`commits`} on ${b}. The branch will be deleted if you remove the worktree.`:`You are working in a worktree. Keep it to continue working there, or remove it to clean up.`;function E(){if(t){t();return}_(`keep`)}let O=x||C?`All changes and commits will be lost.`:`Clean up the worktree directory.`,A=!!m.tmuxSessionName,M=A?[{label:`Keep worktree and tmux session`,value:`keep-with-tmux`,description:`Stays at ${m.worktreePath}. Reattach with: tmux attach -t ${m.tmuxSessionName}`},{label:`Keep worktree, kill tmux session`,value:`keep-kill-tmux`,description:`Keeps worktree at ${m.worktreePath}, terminates tmux session.`},{label:`Remove worktree and tmux session`,value:`remove-with-tmux`,description:O}]:[{label:`Keep worktree`,value:`keep`,description:`Stays at ${m.worktreePath}`},{label:`Remove worktree`,value:`remove`,description:O}];return(0,L.jsx)(S,{title:`Exiting worktree session`,subtitle:T,onCancel:E,children:(0,L.jsx)(j,{defaultFocusValue:A?`keep-with-tmux`:`keep`,options:M,onChange:_})})}var I,L,R=t((()=>{I=n(b(),1),O(),T(),x(),E(),i(),o(),_(),A(),M(),L=C()}));function z(){return f(H)??`Goodbye!`}function B({showWorktree:e,onDone:t,onCancel:n}){async function r(e){t(e??z()),await d(0,`prompt_input_exit`)}return e?(0,V.jsx)(F,{onDone:r,onCancel:n}):null}var V,H,U=t((()=>{r(),c(),R(),V=C(),H=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}));export{U as n,B as t};
@@ -1,11 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{D as t,I as n,Lt as r,P as i,T as a,ai as o,t as s,y as c}from"./src-DL3w8VPk.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{n as u,r as d}from"./analytics-DJobLaWP.js";import{t as f}from"./select-DIxfl_VN.js";import{i as p,r as m,s as h,t as g}from"./grove-O6qp7ITR.js";import{t as _}from"./CustomSelect-wmZ9jz0W.js";var v=e(o(),1);u(),s(),_();var y=l(),b=` _____________
2
- | \\ \\
3
- | NEW TERMS \\__\\
4
- | |
5
- | ---------- |
6
- | ---------- |
7
- | ---------- |
8
- | ---------- |
9
- | ---------- |
10
- | |
11
- |______________|`;function x(){return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(i,{children:[`An update to our Consumer Terms and Privacy Policy will take effect on `,(0,y.jsx)(i,{bold:!0,children:`October 8, 2025`}),`. You can accept the updated terms today.`]}),(0,y.jsxs)(n,{flexDirection:`column`,children:[(0,y.jsx)(i,{children:`What's changing?`}),(0,y.jsx)(n,{paddingLeft:1,children:(0,y.jsxs)(i,{children:[(0,y.jsx)(i,{children:`· `}),(0,y.jsx)(i,{bold:!0,children:`You can help improve Work Mate `}),(0,y.jsxs)(i,{children:[`— Allow the use of your chats and coding sessions to train and improve Claude AI models. Change anytime in your Privacy Settings (`,(0,y.jsx)(r,{url:`https://claude.ai/settings/data-privacy-controls`}),`).`]})]})}),(0,y.jsx)(n,{paddingLeft:1,children:(0,y.jsxs)(i,{children:[(0,y.jsx)(i,{children:`· `}),(0,y.jsx)(i,{bold:!0,children:`Updates to data retention `}),(0,y.jsx)(i,{children:`— To help us improve our AI models and safety protections, we're extending data retention to 5 years.`})]})})]}),(0,y.jsxs)(i,{children:[`Learn more (`,(0,y.jsx)(r,{url:`https://www.anthropic.com/news/updates-to-our-consumer-terms`}),`) or read the updated Consumer Terms (`,(0,y.jsx)(r,{url:`https://anthropic.com/legal/terms`}),`) and Privacy Policy (`,(0,y.jsx)(r,{url:`https://anthropic.com/legal/privacy`}),`)`]})]})}function S(){return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(i,{children:`We've updated our Consumer Terms and Privacy Policy.`}),(0,y.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,y.jsx)(i,{children:`What's changing?`}),(0,y.jsxs)(n,{flexDirection:`column`,children:[(0,y.jsx)(i,{bold:!0,children:`Help improve Work Mate`}),(0,y.jsx)(i,{children:`Allow the use of your chats and coding sessions to train and improve Claude AI models. You can change this anytime in Privacy Settings`}),(0,y.jsx)(r,{url:`https://claude.ai/settings/data-privacy-controls`})]}),(0,y.jsxs)(n,{flexDirection:`column`,children:[(0,y.jsx)(i,{bold:!0,children:`How this affects data retention`}),(0,y.jsx)(i,{children:`Turning ON the improve Work Mate setting extends data retention from 30 days to 5 years. Turning it OFF keeps the default 30-day data retention. Delete data anytime.`})]})]}),(0,y.jsxs)(i,{children:[`Learn more (`,(0,y.jsx)(r,{url:`https://www.anthropic.com/news/updates-to-our-consumer-terms`}),`) or read the updated Consumer Terms (`,(0,y.jsx)(r,{url:`https://anthropic.com/legal/terms`}),`) and Privacy Policy (`,(0,y.jsx)(r,{url:`https://anthropic.com/legal/privacy`}),`)`]})]})}function C({showIfAlreadyViewed:e,location:r,onDone:o}){let[s,l]=(0,v.useState)(null),[u,_]=(0,v.useState)(null);if((0,v.useEffect)(()=>{async function t(){let[t,n]=await Promise.all([p(),m()]),i=n.success?n.data:null;_(i);let a=g(t,n,e);if(l(a),!a){o(`skip_rendering`);return}d(`tengu_grove_policy_viewed`,{location:r,dismissable:i?.notice_is_grace_period})}t()},[e,r,o]),s===null||!s)return null;async function C(e){switch(e){case`accept_opt_in`:await h(!0),d(`tengu_grove_policy_submitted`,{state:!0,dismissable:u?.notice_is_grace_period});break;case`accept_opt_out`:await h(!1),d(`tengu_grove_policy_submitted`,{state:!1,dismissable:u?.notice_is_grace_period});break;case`defer`:d(`tengu_grove_policy_dismissed`,{state:!0});break;case`escape`:d(`tengu_grove_policy_escaped`,{});break}o(e)}let w=u?.domain_excluded?[{label:`Accept terms · Help improve Work Mate: OFF (for emails with your domain)`,value:`accept_opt_out`}]:[{label:`Accept terms · Help improve Work Mate: ON`,value:`accept_opt_in`},{label:`Accept terms · Help improve Work Mate: OFF`,value:`accept_opt_out`}];function T(){if(u?.notice_is_grace_period){C(`defer`);return}C(`escape`)}return(0,y.jsxs)(c,{title:`Updates to Consumer Terms and Policies`,color:`professionalBlue`,onCancel:T,inputGuide:e=>e.pending?(0,y.jsxs)(i,{children:[`Press `,e.keyName,` again to exit`]}):(0,y.jsxs)(a,{children:[(0,y.jsx)(t,{shortcut:`Enter`,action:`confirm`}),(0,y.jsx)(t,{shortcut:`Esc`,action:`cancel`})]}),children:[(0,y.jsxs)(n,{flexDirection:`row`,children:[(0,y.jsx)(n,{flexDirection:`column`,gap:1,flexGrow:1,children:u?.notice_is_grace_period?(0,y.jsx)(x,{}):(0,y.jsx)(S,{})}),(0,y.jsx)(n,{flexShrink:0,children:(0,y.jsx)(i,{color:`professionalBlue`,children:b})})]}),(0,y.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,y.jsxs)(n,{flexDirection:`column`,children:[(0,y.jsx)(i,{bold:!0,children:`Please select how you'd like to continue`}),(0,y.jsx)(i,{children:`Your choice takes effect immediately upon confirmation.`})]}),(0,y.jsx)(f,{options:[...w,...u?.notice_is_grace_period?[{label:`Not now`,value:`defer`}]:[]],onChange:e=>C(e),onCancel:T})]})]})}export{C as GroveDialog};
@@ -1 +0,0 @@
1
- import{Ip as e,Pp as t}from"./loadAgentsDir-B0Anodo0.js";import{I as n,P as r,kn as i,t as a,y as o}from"./src-DL3w8VPk.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{C as c,T as l,x as u}from"./debug-Bglx1aTu.js";import{t as d}from"./KeybindingProviderSetup-D49HHTXD.js";import{t as f}from"./select-DIxfl_VN.js";import{t as p}from"./CustomSelect-wmZ9jz0W.js";import{t as m}from"./renderOptions-DV0dn0IW.js";a(),e(),u(),p();var h=s();function g({filePath:e,errorDescription:t,onExit:i,onReset:a}){return(0,h.jsxs)(o,{title:`Configuration Error`,color:`error`,onCancel:i,children:[(0,h.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,h.jsxs)(r,{children:[`The configuration file at `,(0,h.jsx)(r,{bold:!0,children:e}),` contains invalid JSON.`]}),(0,h.jsx)(r,{children:t})]}),(0,h.jsxs)(n,{flexDirection:`column`,children:[(0,h.jsx)(r,{bold:!0,children:`Choose an option:`}),(0,h.jsx)(f,{options:[{label:`Exit and fix manually`,value:`exit`},{label:`Reset with default configuration`,value:`reset`}],onChange:e=>{e===`exit`?i():a()},onCancel:i})]})]})}var _=`dark`;async function v({error:e}){let n={...m(!1),theme:_};await new Promise(async r=>{let{unmount:a}=await i((0,h.jsx)(t,{children:(0,h.jsx)(d,{children:(0,h.jsx)(g,{filePath:e.filePath,errorDescription:e.message,onExit:()=>{a(),r(),process.exit(1)},onReset:()=>{l(e.filePath,c(e.defaultConfig,null,2),{flush:!1,encoding:`utf8`}),a(),r(),process.exit(0)}})})}),n)})}export{v as showInvalidConfigDialog};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{lw as t,ow as n,sw as r,uw as i}from"./loadAgentsDir-B0Anodo0.js";import{Vt as a,ai as o,t as s}from"./src-DL3w8VPk.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{c as l,i as u}from"./debug-Bglx1aTu.js";import{Hn as d,Vn as f}from"./settings-B2jvL8Dp.js";import{l as p,o as m}from"./stringUtils-C718f5ey.js";import{n as h,t as g}from"./notifications-Bc6k-Ozy.js";var _=e(o(),1);g(),d(),u(),m(),s(),n();var v=c();function y({children:e}){let{addNotification:n,removeNotification:o}=h();return(0,v.jsx)(a,{loadBindings:t,subscribeToChanges:i,initWatcher:r,onWarnings:(0,_.useCallback)((e,t)=>{let r=`keybinding-config-warning`;if(e.length===0){o(r);return}let i=f(e,e=>e.severity===`error`),a=f(e,e=>e.severity===`warning`),s;s=i>0&&a>0?`Found ${i} keybinding ${p(i,`error`)} and ${a} ${p(a,`warning`)}`:i>0?`Found ${i} keybinding ${p(i,`error`)}`:`Found ${a} keybinding ${p(a,`warning`)}`,s+=` · /doctor for details`,n({key:r,text:s,color:i>0?`error`:`warning`,priority:i>0?`immediate`:`high`,timeoutMs:6e4})},[n,o]),onDebugLog:l,children:e})}export{y as t};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{$_ as n,By as r,Dv as i,Ev as a,Fy as o,Ip as s,Iy as c,J_ as l,K_ as u,Lp as d,Mv as f,Ov as p,Q_ as m,Qv as ee,Rp as te,X_ as h,Y_ as g,Zv as ne,gv as _,lv as v,rv as y,tv as b,zp as re,zy as x}from"./loadAgentsDir-B0Anodo0.js";import{ai as S}from"./src-DL3w8VPk.js";import{t as C}from"./jsx-runtime-Bb4Xn-E0.js";import{It as w,st as ie}from"./state-B4jiUise.js";import{I as T,M as E,c as D,i as O}from"./debug-Bglx1aTu.js";import{rt as k,tt as A}from"./settings-B2jvL8Dp.js";import{c as j,l as M,o as ae}from"./log-D2TIwHBV.js";import{n as N,r as P}from"./analytics-DJobLaWP.js";import{o as F,t as I}from"./localSearch-BxLYi6w_.js";import{i as L,n as R,r as z,t as B}from"./reject-DtcCfuZV.js";import{n as V,t as H}from"./notifications-Bc6k-Ozy.js";function U(e){let t=`plugin`in e?e.plugin:`no-plugin`;return`${e.type}:${e.source}:${t}`}function W(e,t){t.length!==0&&e(e=>{let n=new Set(e.plugins.errors.map(e=>U(e))),r=t.filter(e=>!n.has(U(e)));return r.length===0?e:{...e,plugins:{...e.plugins,errors:[...e.plugins.errors,...r]}}})}function G(e,t=!1){let n=te(),r=d(e=>e.mcp.pluginReconnectKey),i=re(),s=(0,q.useRef)(new Map),{addNotification:ne}=V(),_=(0,q.useRef)([]),S=(0,q.useRef)(null),C=(0,q.useCallback)(()=>{S.current=null;let e=_.current;e.length!==0&&(_.current=[],i(t=>{let n=t.mcp;for(let t of e){let{tools:e,commands:r,resources:i,...a}=t,o=a.type===`disabled`||a.type===`failed`?e??[]:e,s=a.type===`disabled`||a.type===`failed`?r??[]:r,c=a.type===`disabled`||a.type===`failed`?i??[]:i,l=A(a.name),u=n.clients.findIndex(e=>e.name===a.name)===-1?[...n.clients,a]:n.clients.map(e=>e.name===a.name?a:e),d=o===void 0?n.tools:[...R(n.tools,e=>e.name?.startsWith(l)),...o],f=s===void 0?n.commands:[...R(n.commands,e=>y(e,a.name)),...s],p=c===void 0?n.resources:{...n.resources,...c.length>0?{[a.name]:c}:L(n.resources,a.name)};n={...n,clients:u,tools:d,commands:f,resources:p}}return{...t,mcp:n}}))},[i]),w=(0,q.useCallback)(e=>{_.current.push(e),S.current===null&&(S.current=setTimeout(C,16))},[C]),T=(0,q.useCallback)(({client:e,tools:t,commands:n,resources:r})=>{switch(w({...e,tools:t,commands:n,resources:r}),e.type){case`connected`:ee(e.client,e.name,i),e.client.onclose=()=>{let t=e.config.type??`stdio`;if(u(e.name,e.config).catch(()=>{D(`Failed to invalidate the server cache: ${e.name}`)}),p(e.name)){j(e.name,`Server is disabled, skipping automatic reconnection`);return}if(t!==`stdio`&&t!==`sdk`){let n=K(t);j(e.name,`${n} transport closed/disconnected, attempting automatic reconnection`);let r=s.current.get(e.name);r&&(clearTimeout(r),s.current.delete(e.name)),(async()=>{for(let t=1;t<=J;t++){if(p(e.name)){j(e.name,`Server disabled during reconnection, stopping retry`),s.current.delete(e.name);return}w({...e,type:`pending`,reconnectAttempt:t,maxReconnectAttempts:J});let r=Date.now();try{let i=await b(e.name,e.config),a=Date.now()-r;if(i.client.type===`connected`){j(e.name,`${n} reconnection successful after ${a}ms (attempt ${t})`),s.current.delete(e.name),T(i);return}if(j(e.name,`${n} reconnection attempt ${t} completed with status: ${i.client.type}`),t===J){j(e.name,`Max reconnection attempts (${J}) reached, giving up`),s.current.delete(e.name),T(i);return}}catch(i){let a=Date.now()-r;if(M(e.name,`${n} reconnection attempt ${t} failed after ${a}ms: ${i}`),t===J){j(e.name,`Max reconnection attempts (${J}) reached, giving up`),s.current.delete(e.name),w({...e,type:`failed`});return}}let i=Math.min(Y*2**(t-1),X);j(e.name,`Scheduling reconnection attempt ${t+1} in ${i}ms`),await new Promise(t=>{let n=setTimeout(t,i);s.current.set(e.name,n)})}})()}else w({...e,type:`failed`})},e.capabilities?.tools?.listChanged&&e.client.setNotificationHandler(x,async()=>{j(e.name,`Received tools/list_changed notification, refreshing tools`);try{let t=h.cache.get(e.name);h.cache.delete(e.name);let n=await h(e),r=n.length;t?t.then(e=>{P(`tengu_mcp_list_changed`,{type:`tools`,previousCount:e.length,newCount:r})},()=>{P(`tengu_mcp_list_changed`,{type:`tools`,newCount:r})}):P(`tengu_mcp_list_changed`,{type:`tools`,newCount:r}),w({...e,tools:n})}catch(t){M(e.name,`Failed to refresh tools after list_changed notification: ${E(t)}`)}}),e.capabilities?.prompts?.listChanged&&e.client.setNotificationHandler(o,async()=>{j(e.name,`Received prompts/list_changed notification, refreshing prompts`),P(`tengu_mcp_list_changed`,{type:`prompts`});try{l.cache.delete(e.name);let[t,n]=await Promise.all([l(e),Promise.resolve([])]);w({...e,commands:[...t,...n]}),I()}catch(t){M(e.name,`Failed to refresh prompts after list_changed notification: ${E(t)}`)}}),e.capabilities?.resources?.listChanged&&e.client.setNotificationHandler(c,async()=>{j(e.name,`Received resources/list_changed notification, refreshing resources`),P(`tengu_mcp_list_changed`,{type:`resources`});try{g.cache.delete(e.name);{let t=await g(e);w({...e,resources:t})}}catch(t){M(e.name,`Failed to refresh resources after list_changed notification: ${E(t)}`)}});break;case`needs-auth`:case`failed`:case`pending`:case`disabled`:break}},[w]),O=ie();return(0,q.useEffect)(()=>{async function n(){let{servers:n,errors:r}=t?{servers:{},errors:[]}:await a(e),o={...n,...e};W(i,r),i(e=>{let{stale:t,...n}=v(e.mcp,o);for(let e of t){let t=s.current.get(e.name);t&&(clearTimeout(t),s.current.delete(e.name)),e.type===`connected`&&(e.client.onclose=void 0,u(e.name,e.config).catch(()=>{}))}let r=new Set(n.clients.map(e=>e.name)),i=Object.entries(o).filter(([e])=>!r.has(e)).map(([e,t])=>({name:e,type:p(e)?`disabled`:`pending`,config:t}));return i.length===0&&t.length===0?e:{...e,mcp:{...e.mcp,...n,clients:[...n.clients,...i]}}})}n().catch(e=>{M(`useManageMCPConnections`,`Failed to initialize servers as pending: ${E(e)}`)})},[t,e,i,O,r]),(0,q.useEffect)(()=>{let n=!1;async function r(){let r=Promise.resolve({}),{servers:o,errors:s}=t?{servers:{},errors:[]}:await a(e,r);if(n)return;W(i,s);let c={...o,...e},l=Object.fromEntries(Object.entries(c).filter(([e])=>!p(e)));m(T,l).catch(e=>{M(`useManageMcpConnections`,`Failed to get MCP resources: ${E(e)}`)});let u={},d={...c,...u},f={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0};for(let[e,t]of Object.entries(d))t.scope===`enterprise`?f.enterprise++:t.scope===`user`?f.global++:t.scope===`project`?f.project++:t.scope===`local`?f.user++:t.scope===`dynamic`?f.plugin++:t.scope===`claudeai`&&f.claudeai++;P(`tengu_mcp_servers`,{...f})}return r(),()=>{n=!0}},[t,e,T,i,O,r]),(0,q.useEffect)(()=>{let e=s.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear(),S.current!==null&&(clearTimeout(S.current),S.current=null,C())}},[C]),{reconnectMcpServer:(0,q.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);let r=s.current.get(e);r&&(clearTimeout(r),s.current.delete(e));let i=await b(e,t.config);return T(i),i},[n,T]),toggleMcpServer:(0,q.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);if(t.type!==`disabled`){let n=s.current.get(e);n&&(clearTimeout(n),s.current.delete(e)),f(e,!1),t.type===`connected`&&await u(e,t.config),w({name:e,type:`disabled`,config:t.config})}else{f(e,!0),w({name:e,type:`pending`,config:t.config});let n=await b(e,t.config);T(n)}},[n,w,T])}}function K(e){switch(e){case`http`:return`HTTP`;case`ws`:case`ws-ide`:return`WebSocket`;default:return`SSE`}}var q,J,Y,X,oe=e((()=>{q=t(S(),1),w(),n(),F(),r(),z(),B(),N(),i(),O(),H(),s(),T(),ae(),ne(),k(),_(),J=5,Y=1e3,X=3e4}));function se(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpReconnect must be used within MCPConnectionManager`);return e.reconnectMcpServer}function ce(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpToggleEnabled must be used within MCPConnectionManager`);return e.toggleMcpServer}function le({children:e,dynamicMcpConfig:t,isStrictMcpConfig:n}){let{reconnectMcpServer:r,toggleMcpServer:i}=G(t,n),a=(0,Z.useMemo)(()=>({reconnectMcpServer:r,toggleMcpServer:i}),[r,i]);return(0,Q.jsx)($.Provider,{value:a,children:e})}var Z,Q,$,ue=e((()=>{Z=t(S(),1),oe(),Q=C(),$=(0,Z.createContext)(null)}));export{ce as i,ue as n,se as r,le as t};