@readmagic/workmate 0.0.28 → 0.0.30

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 (305) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-Bmgh8VS3.js → AddWorkspaceDirectory-B03NZZuQ.js} +1 -1
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-45Ize2zR.js +1 -0
  3. package/dist/chunks/{AgentsMdExternalIncludesDialog-BJfHqScU.js → AgentsMdExternalIncludesDialog-CIyefOzT.js} +1 -1
  4. package/dist/chunks/App-WBysAL0_.js +1 -0
  5. package/dist/chunks/{BackgroundTasksDialog-WkoL4g5Q.js → BackgroundTasksDialog-CvvrjBoq.js} +2 -2
  6. package/dist/chunks/{BypassPermissionsModeDialog-BT9yl0Qt.js → BypassPermissionsModeDialog-DdVbMyla.js} +1 -1
  7. package/dist/chunks/{CustomSelect-t4wXuXWH.js → CustomSelect-iSG1rbWU.js} +1 -1
  8. package/dist/chunks/{DiffDialog-CXZxnb7Y.js → DiffDialog-DSb46fzB.js} +5 -5
  9. package/dist/chunks/Doctor--yF3SBsD.js +1 -0
  10. package/dist/chunks/Doctor-dR71Dg_D.js +3 -0
  11. package/dist/chunks/ExitFlow-BiBi5Sqk.js +2 -0
  12. package/dist/chunks/{InvalidConfigDialog-riLYEaUP.js → InvalidConfigDialog-7MkDSXXj.js} +1 -1
  13. package/dist/chunks/{InvalidSettingsDialog-BGXl3V1A.js → InvalidSettingsDialog-D8Ves3Th.js} +1 -1
  14. package/dist/chunks/{KeybindingProviderSetup-syiDgtpB.js → KeybindingProviderSetup-DJSFdVYv.js} +1 -1
  15. package/dist/chunks/MCPConnectionManager-BZxRMdGO.js +1 -0
  16. package/dist/chunks/MCPToolListView-H_Kvvelz.js +1 -0
  17. package/dist/chunks/{McpParsingWarnings-Czze2JPd.js → McpParsingWarnings-D2xvaog9.js} +1 -1
  18. package/dist/chunks/MessageSelector-DQgIgPij.js +3 -0
  19. package/dist/chunks/Messages-DyQCr-od.js +10 -0
  20. package/dist/chunks/{Onboarding-CD_Uv5h9.js → Onboarding-DFufTPIY.js} +1 -1
  21. package/dist/chunks/{PromptInputFooterSuggestions-CHXJsTtQ.js → PromptInputFooterSuggestions-B9JRcHHE.js} +1 -1
  22. package/dist/chunks/{PromptInputHelpMenu-BZIVCV7V.js → PromptInputHelpMenu-DcGXK5lt.js} +1 -1
  23. package/dist/chunks/{ProviderSetup-CwMvjmjh.js → ProviderSetup-DJ_Z1BSe.js} +1 -1
  24. package/dist/chunks/QueryEngine-BQ5PSqKV.js +1 -0
  25. package/dist/chunks/{REPL-CtFtb35A.js → REPL-CjoJCy0g.js} +24 -24
  26. package/dist/chunks/REPL-DGieTVDl.js +1 -0
  27. package/dist/chunks/ResumeConversation-exTLviBY.js +1 -0
  28. package/dist/chunks/SearchExtraToolsTool-BBhWAuoA.js +1 -0
  29. package/dist/chunks/Settings-nM6-cXh0.js +2 -0
  30. package/dist/chunks/Spinner-ChT4lOOg.js +1 -0
  31. package/dist/chunks/{SpinnerGlyph-BR_SiV9L.js → SpinnerGlyph-4aVLQdJf.js} +1 -1
  32. package/dist/chunks/{TextInput-ou7ZhpVY.js → TextInput-CanSwT9J.js} +5 -5
  33. package/dist/chunks/{ThemePicker-CVFWqSc7.js → ThemePicker-CXzPiSy0.js} +1 -1
  34. package/dist/chunks/{TrustDialog-CGXv_LF4.js → TrustDialog-D0fJ-YIw.js} +1 -1
  35. package/dist/chunks/{ValidationErrorsList-CKeHoN2Z.js → ValidationErrorsList-29bQ0l-Q.js} +1 -1
  36. package/dist/chunks/{_baseEach-BYhqv77g.js → _baseEach-DPcnudh_.js} +1 -1
  37. package/dist/chunks/{add-dir-BSizpuef.js → add-dir-DbNz1SeY.js} +1 -1
  38. package/dist/chunks/{agentDisplay-JKfYFD1m.js → agentDisplay-Bif3eE1e.js} +1 -1
  39. package/dist/chunks/{agents-BDTCH6YB.js → agents-CbsNbPbp.js} +1 -1
  40. package/dist/chunks/{agents-MEaV8P2G.js → agents-yvC-VikU.js} +6 -6
  41. package/dist/chunks/allErrors-Bv1e8fra.js +1 -0
  42. package/dist/chunks/{appleTerminalBackup-CN8kS74J.js → appleTerminalBackup-Ct9hf1QQ.js} +1 -1
  43. package/dist/chunks/{backgroundHousekeeping-CsXlkIg3.js → backgroundHousekeeping-C75FgxW1.js} +1 -1
  44. package/dist/chunks/backgroundHousekeeping-d0qpqWHe.js +1 -0
  45. package/dist/chunks/banner-D5m9LUjl.js +2 -0
  46. package/dist/chunks/{branch-BllXcYwS.js → branch-DOQ3yNds.js} +2 -2
  47. package/dist/chunks/bridgeControl-DMUu37uO.js +2 -0
  48. package/dist/chunks/{btw-DzaRBa6o.js → btw-DUjuwyMH.js} +1 -1
  49. package/dist/chunks/{bundledMode-D9omqD3L.js → bundledMode-Dqe4pz0a.js} +1 -1
  50. package/dist/chunks/caches-BKAPMXp9.js +1 -0
  51. package/dist/chunks/caches-he4NeZSK.js +1 -0
  52. package/dist/chunks/channel-C8JmEI06.js +2 -0
  53. package/dist/chunks/{channel-Gw6skpUh.js → channel-TEYwDITo.js} +1 -1
  54. package/dist/chunks/{clear-CDQs9_5P.js → clear-BFlTcvMt.js} +1 -1
  55. package/dist/chunks/{client-pA7fKk0-.js → client-D3QmHVeI.js} +1 -1
  56. package/dist/chunks/client-dTKhXxBT.js +1 -0
  57. package/dist/chunks/{client-2w-g5kMx.js → client-q_uGYC2E.js} +1 -1
  58. package/dist/chunks/client-y_U1O4mI.js +1 -0
  59. package/dist/chunks/commands-BoGtXPAA.js +1 -0
  60. package/dist/chunks/compact-CyR7Sbo1.js +2 -0
  61. package/dist/chunks/config-B-hDBSL8.js +1 -0
  62. package/dist/chunks/config-Bjwat4P6.js +3 -0
  63. package/dist/chunks/config-DubkVeOw.js +1 -0
  64. package/dist/chunks/{context-TkdzCK3Y.js → context-Cm_gyngQ.js} +1 -1
  65. package/dist/chunks/{context-noninteractive-BcBo64vo.js → context-noninteractive-BDmFfPRt.js} +2 -2
  66. package/dist/chunks/context-noninteractive-CmOFpwwP.js +1 -0
  67. package/dist/chunks/conversation-B7YCvyCD.js +1 -0
  68. package/dist/chunks/conversation-CYZKYlWc.js +1 -0
  69. package/dist/chunks/{conversationRecovery-_hWC7JBO.js → conversationRecovery-BUqpxLl-.js} +1 -1
  70. package/dist/chunks/crossProjectResume-BCa2l0KZ.js +40 -0
  71. package/dist/chunks/{debug-2pVES-2G.js → debug-NBJH_NxR.js} +2 -2
  72. package/dist/chunks/{detectRepository--luIRv5H.js → detectRepository-Bu0he_XM.js} +1 -1
  73. package/dist/chunks/{diff-BzVUPO4Z.js → diff-BEvpLh_b.js} +1 -1
  74. package/dist/chunks/{directoryCompletion-BC0qRmrz.js → directoryCompletion-CwKPuwrS.js} +1 -1
  75. package/dist/chunks/doctor-DYKr9Reu.js +1 -0
  76. package/dist/chunks/{entry-333L52Lo.js → entry-JGyBs1p5.js} +3 -3
  77. package/dist/chunks/{execFileNoThrow-DXSEj8ZO.js → execFileNoThrow-7Ys9mO27.js} +1 -1
  78. package/dist/chunks/exit-DU2KGyDk.js +1 -0
  79. package/dist/chunks/{extraUsage-CmgRR-zH.js → extraUsage-cZx2XLx4.js} +1 -1
  80. package/dist/chunks/extractMemories-4wbv-mTc.js +1 -0
  81. package/dist/chunks/fast-BALHWqpd.js +1 -0
  82. package/dist/chunks/{fast-D7oNjaZ3.js → fast-DUJq6-QE.js} +1 -1
  83. package/dist/chunks/{fetchModelList-Cv1vWIpC.js → fetchModelList-Dn8OahtV.js} +1 -1
  84. package/dist/chunks/fetchModelList-OZ2sLDEx.js +1 -0
  85. package/dist/chunks/{fileSuggestions-DF3HTRKr.js → fileSuggestions-XLnnVLwx.js} +3 -3
  86. package/dist/chunks/{gemini-ou7_YyXc.js → gemini-qzPNGqOX.js} +2 -2
  87. package/dist/chunks/{generateSessionName-CeN9EZNY.js → generateSessionName-CA-cc58H.js} +1 -1
  88. package/dist/chunks/{genericProcessUtils-GqURdVAv.js → genericProcessUtils-XwqvFxyn.js} +1 -1
  89. package/dist/chunks/{goal-CCxo4Wyf.js → goal-x9Pkx5nv.js} +3 -3
  90. package/dist/chunks/{grok-BMmUcNbI.js → grok-36CpLjsq.js} +1 -1
  91. package/dist/chunks/{help-CYtogTZk.js → help-DwfAEV0X.js} +1 -1
  92. package/dist/chunks/{history-CUrqO9rV.js → history-PZLMYab7.js} +1 -1
  93. package/dist/chunks/hooks-BofA8GeO.js +1 -0
  94. package/dist/chunks/{hooks-ByVkvodY.js → hooks-DBmA-DWx.js} +2 -2
  95. package/dist/chunks/{install-DIxyfdXG.js → install-DF4ep6nb.js} +1 -1
  96. package/dist/chunks/{instrumentation-BmHivmxs.js → instrumentation-BAbhrE3f.js} +3 -3
  97. package/dist/chunks/{job-D534P26R.js → job-CFWKIjNl.js} +1 -1
  98. package/dist/chunks/{keybindings-CxgQqQJe.js → keybindings-CkiE_uBG.js} +1 -1
  99. package/dist/chunks/{launchLocalMemory-CWXLb3KF.js → launchLocalMemory-Cf8l-1fz.js} +2 -2
  100. package/dist/chunks/{launchOnboarding-CocPmwzz.js → launchOnboarding-8CDef-v1.js} +1 -1
  101. package/dist/chunks/loadAgentsDir-C-qRJlXH.js +1 -0
  102. package/dist/chunks/{loadAgentsDir-bmpKLPdG.js → loadAgentsDir-DnHL_5cU.js} +358 -358
  103. package/dist/chunks/loadPluginHooks-BuunKr9m.js +1 -0
  104. package/dist/chunks/{loader-BMAtuwRa.js → loader-DsEdsMHv.js} +1 -1
  105. package/dist/chunks/localSearch-BulDBrBk.js +1 -0
  106. package/dist/chunks/{localSearch-Da8cVYoI.js → localSearch-LFCzV7VE.js} +1 -1
  107. package/dist/chunks/{log-L1kqxa_P.js → log-D98mO6yJ.js} +1 -1
  108. package/dist/chunks/{logoUtils-qNuBc2nI.js → logoUtils-B8MIA7c5.js} +1 -1
  109. package/dist/chunks/{magicDocs-BsEiBLQl.js → magicDocs-BoxJusTI.js} +2 -2
  110. package/dist/chunks/{main-B31aPMPP.js → main-B9ciFYnO.js} +22 -22
  111. package/dist/chunks/{managedEnv-EZ2IirNa.js → managedEnv-B0mj-wgE.js} +1 -1
  112. package/dist/chunks/managedEnv-BFpXdDI8.js +1 -0
  113. package/dist/chunks/mcp-B3Ewo-_h.js +1 -0
  114. package/dist/chunks/mcp-CHlAZvpV.js +2 -0
  115. package/dist/chunks/{mcp-Dd8TBfQQ.js → mcp-DVKuOqvY.js} +3 -3
  116. package/dist/chunks/memory-Cr0d-s7U.js +1 -0
  117. package/dist/chunks/{mode-SM8doWgC.js → mode-DBNBDbVP.js} +2 -2
  118. package/dist/chunks/model-B2r1Ms0g.js +1 -0
  119. package/dist/chunks/model-C9ANf1-R.js +1 -0
  120. package/dist/chunks/{modelOptions-BQL4gbNk.js → modelOptions-B4BWYms0.js} +1 -1
  121. package/dist/chunks/{nativeInstaller-DMkZdsof.js → nativeInstaller-BDJxBAPV.js} +1 -1
  122. package/dist/chunks/{notifications-BwS1XsnZ.js → notifications-BV-VeXyJ.js} +1 -1
  123. package/dist/chunks/{onChangeAppState-C9cYQJPF.js → onChangeAppState-BGWWkhBg.js} +1 -1
  124. package/dist/chunks/openai-BL_IWBTr.js +2 -0
  125. package/dist/chunks/{overlayContext-C5WPACKC.js → overlayContext-DGUFuee9.js} +1 -1
  126. package/dist/chunks/{parser-CTnaXFVJ.js → parser-D2kggQDp.js} +1 -1
  127. package/dist/chunks/parser-DZUcp40d.js +1 -0
  128. package/dist/chunks/{partition-CKgWl7p4.js → partition-B2VCm4vu.js} +1 -1
  129. package/dist/chunks/{pasteStore-njJCBMKr.js → pasteStore-2RafnH7M.js} +1 -1
  130. package/dist/chunks/permissions-Bkj1UB1h.js +3 -0
  131. package/dist/chunks/{pidLock-CqkC3-nD.js → pidLock-CawSx6hb.js} +2 -2
  132. package/dist/chunks/{plan-Ce6wfjjI.js → plan-D7Ki5ADu.js} +1 -1
  133. package/dist/chunks/plugin-D7I6VZjh.js +17 -0
  134. package/dist/chunks/{pluginAutoupdate-ByokIVEs.js → pluginAutoupdate-Cr3jw-ky.js} +1 -1
  135. package/dist/chunks/pluginBlocklist-JG_kJSSK.js +1 -0
  136. package/dist/chunks/pluginCliCommands-BWIBBFJf.js +1 -0
  137. package/dist/chunks/{pluginFlagging-B2ZX5_oB.js → pluginFlagging-yFcXMVin.js} +1 -1
  138. package/dist/chunks/pluginOperations-6QXjdPOb.js +2 -0
  139. package/dist/chunks/pluginStartupCheck-B-nYb61N.js +1 -0
  140. package/dist/chunks/{pluginStartupCheck-QG0d95dE.js → pluginStartupCheck-CkjyJ4RS.js} +1 -1
  141. package/dist/chunks/plugins-CMDfjFp-.js +4 -0
  142. package/dist/chunks/{poorMode-CG2JNTD0.js → poorMode-BvypUTur.js} +1 -1
  143. package/dist/chunks/poorMode-CP6359Sz.js +1 -0
  144. package/dist/chunks/print-B6x_8O9w.js +13 -0
  145. package/dist/chunks/process-CewWh77C.js +1 -0
  146. package/dist/chunks/process-De2crvt4.js +1 -0
  147. package/dist/chunks/processBashCommand-D0BBcBHY.js +1 -0
  148. package/dist/chunks/processSlashCommand-BvjNuNyP.js +5 -0
  149. package/dist/chunks/{projectOnboardingState-D-_ijZnG.js → projectOnboardingState-ofkjp9FJ.js} +1 -1
  150. package/dist/chunks/prompt-Cpu4meqR.js +1 -0
  151. package/dist/chunks/{prompt-BnDapYGL.js → prompt-DDlkyIzV.js} +3 -3
  152. package/dist/chunks/prompt-HO8Docca.js +1 -0
  153. package/dist/chunks/{promptEditor-14TB3MYt.js → promptEditor-CyMqa_av.js} +1 -1
  154. package/dist/chunks/{protocolHandler-CJO3CRYW.js → protocolHandler-Bjmx7OmF.js} +1 -1
  155. package/dist/chunks/{proxy--_NfbJhm.js → proxy-MzIsnPd7.js} +1 -1
  156. package/dist/chunks/{reconciler-C_HKsocm.js → reconciler-CHbint0C.js} +1 -1
  157. package/dist/chunks/refresh-yut9uEfd.js +1 -0
  158. package/dist/chunks/{reject-Tug1RmkE.js → reject-CrNfit3M.js} +1 -1
  159. package/dist/chunks/{reload-plugins-CL9LWzpq.js → reload-plugins-labKy5Eh.js} +1 -1
  160. package/dist/chunks/rename-c8tElppw.js +1 -0
  161. package/dist/chunks/{renderOptions-B0RFpjRI.js → renderOptions-B3DyIbF6.js} +1 -1
  162. package/dist/chunks/{resume-BZ42SpS2.js → resume-C8xif2lo.js} +2 -2
  163. package/dist/chunks/ripgrep-CIIzTaSI.js +1 -0
  164. package/dist/chunks/{ripgrep-67m14ImZ.js → ripgrep-CnK9qx1e.js} +1 -1
  165. package/dist/chunks/{runtimeObserver-DT5P2_XL.js → runtimeObserver-DuJ8mRfr.js} +4 -4
  166. package/dist/chunks/{runtimeObserver-BLq2guVy.js → runtimeObserver-vmPplAGH.js} +1 -1
  167. package/dist/chunks/sandbox-adapter-BKnsdtVj.js +1 -0
  168. package/dist/chunks/{sandbox-toggle-DghmaJhK.js → sandbox-toggle-USHaZHD7.js} +1 -1
  169. package/dist/chunks/searchExtraTools-DV5iZPdw.js +1 -0
  170. package/dist/chunks/{select-CaxQ-BVq.js → select-BpiKdirZ.js} +1 -1
  171. package/dist/chunks/sessionFileAccessHooks-nq8C34WL.js +1 -0
  172. package/dist/chunks/sessionObserver-CKp3uqPg.js +1 -0
  173. package/dist/chunks/{sessionObserver-DBoZUvWL.js → sessionObserver-sO6PF7mV.js} +1 -1
  174. package/dist/chunks/sessionStorage-CuQf4d1y.js +1 -0
  175. package/dist/chunks/{sessionTracing-5a7HDF4e.js → sessionTracing-Bz89tYh5.js} +1 -1
  176. package/dist/chunks/settings-B3WqnPDo.js +1 -0
  177. package/dist/chunks/{settings-D4M13toi.js → settings-CA-5Px85.js} +2 -2
  178. package/dist/chunks/setup-B-FejaeH.js +3 -0
  179. package/dist/chunks/{shadowedRuleDetection-L3tnySui.js → shadowedRuleDetection-BI6Xz0pY.js} +1 -1
  180. package/dist/chunks/{sideQuestion-BJTVma-5.js → sideQuestion-BEpCuv_7.js} +3 -3
  181. package/dist/chunks/{sinks-CV0SWuZW.js → sinks-BvOPODnl.js} +1 -1
  182. package/dist/chunks/sinks-DLALCllz.js +1 -0
  183. package/dist/chunks/skillChangeDetector-D-fxaAMH.js +1 -0
  184. package/dist/chunks/{skillGapStore-Cposc03e.js → skillGapStore-A1FCr8Mf.js} +2 -2
  185. package/dist/chunks/{skillLifecycle-RXQp0JU7.js → skillLifecycle-CTVa34xO.js} +2 -2
  186. package/dist/chunks/{skillSearchPanel-B2pjskqk.js → skillSearchPanel-CjekGkrw.js} +4 -4
  187. package/dist/chunks/{skills-D2ZjMtv4.js → skills-110JHHbj.js} +1 -1
  188. package/dist/chunks/{sleep-xKMbXTJe.js → sleep-BGewNhNx.js} +1 -1
  189. package/dist/chunks/{startupProfiler-B9Qv2QGH.js → startupProfiler-C_xcIvEA.js} +1 -1
  190. package/dist/chunks/startupProfiler-uueg2S43.js +1 -0
  191. package/dist/chunks/status-D_b3UMke.js +1 -0
  192. package/dist/chunks/statusNoticeHelpers-C5BRU3lw.js +1 -0
  193. package/dist/chunks/{stringUtils-Cs6E5f-B.js → stringUtils-CtJhTszO.js} +1 -1
  194. package/dist/chunks/switcher-BFzvv7KT.js +1 -0
  195. package/dist/chunks/{switcher-rep86o4_.js → switcher-nLHGsxLw.js} +1 -1
  196. package/dist/chunks/{tasks-B4coTfrq.js → tasks-CjYr59Ak.js} +1 -1
  197. package/dist/chunks/{templateJobs-C5ukh6H3.js → templateJobs-ECX0rRRp.js} +1 -1
  198. package/dist/chunks/{terminalSetup-CaGbEVjB.js → terminalSetup-AptBNs_i.js} +1 -1
  199. package/dist/chunks/{terminalSetup-xe_P98fY.js → terminalSetup-CKO6eWhS.js} +1 -1
  200. package/dist/chunks/{theme-7RmvErYJ.js → theme-BCSx9irC.js} +1 -1
  201. package/dist/chunks/tipRegistry-CnQB3TaA.js +2 -0
  202. package/dist/chunks/{toolEventObserver-Dzwzi5Vi.js → toolEventObserver-Bqtypnkk.js} +1 -1
  203. package/dist/chunks/toolPool-B1sXN7SK.js +1 -0
  204. package/dist/chunks/{udsClient-CWeoNrm3.js → udsClient-COYqIvvr.js} +1 -1
  205. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-BT0nexZw.js → useExitOnCtrlCDWithKeybindings-DegJrysj.js} +1 -1
  206. package/dist/chunks/useMainLoopModel-CPnigpM1.js +1 -0
  207. package/dist/chunks/useManagePlugins-BW2Zj_jf.js +1 -0
  208. package/dist/chunks/useMergedTools-CTm1AU9b.js +1 -0
  209. package/dist/chunks/{useSearchInput-j12K4wEo.js → useSearchInput-DrY4BZKy.js} +1 -1
  210. package/dist/chunks/useSettingsErrors-2uIAF6H8.js +1 -0
  211. package/dist/chunks/{util-CCEK8oze.js → util-BUgUtaUV.js} +1 -1
  212. package/dist/chunks/validatePlugin-BGB8T9Mb.js +1 -0
  213. package/dist/chunks/{vim-BlO9V5_5.js → vim-DdxGarvY.js} +1 -1
  214. package/dist/chunks/worktree-DBZ7f9Lk.js +1 -0
  215. package/dist/cli.js +1 -1
  216. package/package.json +1 -1
  217. package/dist/chunks/AgentsMdExternalIncludesDialog-BjbUilCE.js +0 -1
  218. package/dist/chunks/App-COdpsR2w.js +0 -1
  219. package/dist/chunks/Doctor-B6isid5K.js +0 -1
  220. package/dist/chunks/Doctor-COj-tZBc.js +0 -3
  221. package/dist/chunks/ExitFlow-CcMYH5iI.js +0 -2
  222. package/dist/chunks/MCPConnectionManager-C7RmKzJh.js +0 -1
  223. package/dist/chunks/MCPToolListView-CewNLJus.js +0 -1
  224. package/dist/chunks/MessageSelector-Kc6JlnDX.js +0 -3
  225. package/dist/chunks/Messages-BvFYO4Zn.js +0 -10
  226. package/dist/chunks/QueryEngine-DAwfp_ht.js +0 -1
  227. package/dist/chunks/REPL-tFT1FGQF.js +0 -1
  228. package/dist/chunks/ResumeConversation-CERzSBvg.js +0 -1
  229. package/dist/chunks/SearchExtraToolsTool-ndh4aEwQ.js +0 -1
  230. package/dist/chunks/Settings-CPaqWNdP.js +0 -2
  231. package/dist/chunks/Spinner-C0qHjfIY.js +0 -1
  232. package/dist/chunks/allErrors-Dhnf6rqg.js +0 -1
  233. package/dist/chunks/backgroundHousekeeping-Bu-zRFCx.js +0 -1
  234. package/dist/chunks/banner-BKOzHotb.js +0 -2
  235. package/dist/chunks/bridgeControl-aDnUrYZR.js +0 -2
  236. package/dist/chunks/caches-CMF-MmR-.js +0 -1
  237. package/dist/chunks/caches-CW5YnYNS.js +0 -1
  238. package/dist/chunks/channel-DVx21qde.js +0 -1
  239. package/dist/chunks/client-B0ngS4Uu.js +0 -1
  240. package/dist/chunks/client-BP4DOH3K.js +0 -1
  241. package/dist/chunks/commands-CfYMwgP7.js +0 -1
  242. package/dist/chunks/compact-6F2tuItE.js +0 -2
  243. package/dist/chunks/config-BDkzWBnL.js +0 -1
  244. package/dist/chunks/config-Bio2EjUK.js +0 -3
  245. package/dist/chunks/config-C_AEhZrn.js +0 -1
  246. package/dist/chunks/context-noninteractive-oFcnY1Er.js +0 -1
  247. package/dist/chunks/conversation-CYZyg1U1.js +0 -1
  248. package/dist/chunks/conversation-DXzlRhNw.js +0 -1
  249. package/dist/chunks/crossProjectResume-CCo3iZrB.js +0 -40
  250. package/dist/chunks/doctor-B4jQbGQr.js +0 -1
  251. package/dist/chunks/exit-D5DYnRvR.js +0 -1
  252. package/dist/chunks/extractMemories-CVUrBFMj.js +0 -1
  253. package/dist/chunks/fast-CRhW9zha.js +0 -1
  254. package/dist/chunks/fetchModelList-DIa1HwAJ.js +0 -1
  255. package/dist/chunks/hooks-CBGUcyCs.js +0 -1
  256. package/dist/chunks/loadAgentsDir-Zw648oQO.js +0 -1
  257. package/dist/chunks/loadPluginHooks-BIfM53-_.js +0 -1
  258. package/dist/chunks/localSearch-Dbj8cXyO.js +0 -1
  259. package/dist/chunks/managedEnv-DCGLDTP_.js +0 -1
  260. package/dist/chunks/mcp-BMeWtYCx.js +0 -2
  261. package/dist/chunks/mcp-CYbesbfl.js +0 -1
  262. package/dist/chunks/memory-DtQQGyPS.js +0 -1
  263. package/dist/chunks/model-C2r-PaR4.js +0 -1
  264. package/dist/chunks/model-Dd3x121y.js +0 -1
  265. package/dist/chunks/openai-Bea4I2Od.js +0 -2
  266. package/dist/chunks/parser-Diihup2V.js +0 -1
  267. package/dist/chunks/permissions-Dv_PCfY0.js +0 -3
  268. package/dist/chunks/plugin-aK4tDrVg.js +0 -17
  269. package/dist/chunks/pluginBlocklist-ByRQaVPu.js +0 -1
  270. package/dist/chunks/pluginCliCommands-Dyk4HYHs.js +0 -1
  271. package/dist/chunks/pluginOperations-BCvJvfOC.js +0 -2
  272. package/dist/chunks/pluginStartupCheck-o_TC7wIt.js +0 -1
  273. package/dist/chunks/plugins-DzsTDNWJ.js +0 -4
  274. package/dist/chunks/poorMode-eMIFCAC_.js +0 -1
  275. package/dist/chunks/print-dUT7E1g9.js +0 -13
  276. package/dist/chunks/process-CNfq37LF.js +0 -1
  277. package/dist/chunks/process-gEbdy6uY.js +0 -1
  278. package/dist/chunks/processBashCommand-DtGCgTkF.js +0 -1
  279. package/dist/chunks/processSlashCommand-wXblpK2C.js +0 -5
  280. package/dist/chunks/prompt-BdH2zk0S.js +0 -1
  281. package/dist/chunks/prompt-D0TFER0A.js +0 -1
  282. package/dist/chunks/refresh-Cm4jZzLa.js +0 -1
  283. package/dist/chunks/rename-OfKJSazJ.js +0 -1
  284. package/dist/chunks/ripgrep-DB7KB8RZ.js +0 -1
  285. package/dist/chunks/sandbox-adapter-982rx2cm.js +0 -1
  286. package/dist/chunks/searchExtraTools-B4N1bpy0.js +0 -1
  287. package/dist/chunks/sessionFileAccessHooks-BqQ58T7e.js +0 -1
  288. package/dist/chunks/sessionObserver-qYpA90El.js +0 -1
  289. package/dist/chunks/sessionStorage-CC0v4zMs.js +0 -1
  290. package/dist/chunks/settings-Dfit5gGT.js +0 -1
  291. package/dist/chunks/setup-DVLnIlse.js +0 -3
  292. package/dist/chunks/sinks-C9NdbjLo.js +0 -1
  293. package/dist/chunks/skillChangeDetector-DlodgOyC.js +0 -1
  294. package/dist/chunks/startupProfiler-DWcM4QBl.js +0 -1
  295. package/dist/chunks/status-BcSkj9nE.js +0 -1
  296. package/dist/chunks/statusNoticeHelpers-DsrqBOQt.js +0 -1
  297. package/dist/chunks/switcher-BietN6il.js +0 -1
  298. package/dist/chunks/tipRegistry-BYpJZIjR.js +0 -2
  299. package/dist/chunks/toolPool-BGfiNj6h.js +0 -1
  300. package/dist/chunks/useMainLoopModel-QuE7VkgX.js +0 -1
  301. package/dist/chunks/useManagePlugins-pGaGzsEg.js +0 -1
  302. package/dist/chunks/useMergedTools-BLsIT3R_.js +0 -1
  303. package/dist/chunks/useSettingsErrors-C8VIzdws.js +0 -1
  304. package/dist/chunks/validatePlugin-CTVnWx9H.js +0 -1
  305. package/dist/chunks/worktree-BWL0vR4o.js +0 -1
@@ -1,40 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{C as n,D as r,Gr as i,H as a,I as o,P as s,T as c,Wt as l,Xn as u,ai as d,di as f,fi as p,hn as m,k as ee,oi as te,ot as ne,p as h,t as g}from"./src-BX54x08P.js";import{t as _}from"./jsx-runtime-Bb4Xn-E0.js";import{$n as v,Br as re,Qn as y,qr as ie}from"./settings-D4M13toi.js";import{Pt as b,at as ae,q as oe}from"./state-CXY-q5gr.js";import{Dc as x,Or as se,Tb as S,Tc as ce,bi as le,br as C,ei as ue,gr as w,hd as de,lr as T,md as E,sb as D,tb as fe,tr as pe,vS as O,vr as me,wb as he,yS as k,yi as ge}from"./loadAgentsDir-bmpKLPdG.js";import{S as _e,c as A,i as ve,x as j}from"./debug-2pVES-2G.js";import{a as M,o as ye,s as be}from"./log-L1kqxa_P.js";import{n as xe}from"./analytics-COpjZpvd.js";import{S as Se,_ as N,d as Ce,p as we}from"./startupProfiler-B9Qv2QGH.js";import{f as Te,u as Ee}from"./model-Dd3x121y.js";import{n as De,t as P}from"./useExitOnCtrlCDWithKeybindings-BT0nexZw.js";import{n as F,t as Oe}from"./TextInput-ou7ZhpVY.js";import{n as ke,t as Ae}from"./select-CaxQ-BVq.js";import{r as je,t as Me}from"./Spinner-C0qHjfIY.js";import{l as Ne,u as Pe}from"./SpinnerGlyph-BR_SiV9L.js";import{t as Fe}from"./SearchBox-zA5QwIpO.js";import{n as Ie,t as Le}from"./useSearchInput-j12K4wEo.js";import{n as I,t as L}from"./Messages-BvFYO4Zn.js";function Re({log:e,onExit:t,onSelect:n}){let[i,a]=R.useState(null);R.useEffect(()=>{a(null),C(e)&&se(e).then(a)},[e]);let u=C(e)&&i===null,d=i??e,f=T(d)||``,p=ce();return l(`confirm:no`,t,{context:`Confirmation`}),l(`confirm:yes`,(0,R.useCallback)(()=>{n(i??e)},[n,i,e]),{context:`Confirmation`}),u?(0,z.jsxs)(o,{flexDirection:`column`,padding:1,children:[(0,z.jsx)(h,{message:`Loading session…`}),(0,z.jsx)(s,{dimColor:!0,children:(0,z.jsx)(c,{children:(0,z.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})})})]}):(0,z.jsxs)(o,{flexDirection:`column`,children:[(0,z.jsx)(L,{messages:d.messages,tools:p,commands:[],verbose:!0,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:f,screen:`transcript`,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1}),(0,z.jsxs)(o,{flexShrink:0,flexDirection:`column`,borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:`single`,paddingLeft:2,children:[(0,z.jsxs)(s,{children:[we(d.modified),` · `,d.messageCount,` messages`,d.gitBranch?` · ${d.gitBranch}`:``]}),(0,z.jsx)(s,{dimColor:!0,children:(0,z.jsxs)(c,{children:[(0,z.jsx)(r,{shortcut:`Enter`,action:`resume`}),(0,z.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]})]})}var R,z,ze=e((()=>{R=t(d(),1),g(),fe(),x(),N(),w(),de(),I(),z=_()}));function B(e,t){if(e===H)return 5;let n=i(e),r=t?Math.min(n,t-U-W):n;return Math.max(0,r)+U+W}function Be(e,t){let n=t-U-W;return i(e)<=n?e:n<=1?e.charAt(0):Se(e,n)}function Ve({tabs:e,selectedIndex:t,availableWidth:n,showAllProjects:r=!1}){let i=r?`Resume (All Projects)`:`Resume`,a=i.length+1,c=Math.max(Ke,K),l=n-a-c-2,u=Math.max(0,Math.min(t,e.length-1)),d=Math.max(20,Math.floor(l/2)),f=e.map(e=>B(e,d)),p=0,m=e.length;if(f.reduce((e,t,n)=>e+t+ +(n<f.length-1),0)>l){let t=l-Ge,n=f[u]??0;for(p=u,m=u+1;p>0||m<e.length;){let r=p>0,i=m<e.length;if(r){let e=(f[p-1]??0)+1;if(n+e<=t){p--,n+=e;continue}}if(i){let e=(f[m]??0)+1;if(n+e<=t){m++,n+=e;continue}}break}}let ee=p,te=e.length-m,ne=e.slice(p,m),h=ne.map((e,t)=>p+t);return(0,V.jsxs)(o,{flexDirection:`row`,gap:1,children:[(0,V.jsx)(s,{color:`suggestion`,children:i}),ee>0&&(0,V.jsxs)(s,{dimColor:!0,children:[G,ee]}),ne.map((e,t)=>{let n=h[t]===u,r=e===H?e:`#${Be(e,d-U)}`;return(0,V.jsxs)(s,{backgroundColor:n?`suggestion`:void 0,color:n?`inverseText`:void 0,bold:n,children:[` `,r,` `]},e)}),te>0?(0,V.jsxs)(s,{dimColor:!0,children:[He,te,Ue]}):(0,V.jsx)(s,{dimColor:!0,children:We})]})}var V,H,U,W,G,He,Ue,We,Ge,Ke,K,qe=e((()=>{g(),N(),V=_(),H=`All`,U=2,W=1,G=`← `,He=`→`,Ue=` (tab to cycle)`,We=`(tab to cycle)`,Ge=5,Ke=18,K=14}));function Je({nodes:e,onSelect:t,onCancel:n,onFocus:r,focusNodeId:i,visibleOptionCount:a,layout:s=`expanded`,isDisabled:c=!1,hideIndexes:l=!1,isNodeExpanded:u,onExpand:d,onCollapse:f,getParentPrefix:p,getChildPrefix:m,onUpFromFirstItem:ee}){let[te,ne]=q.useState(new Set),h=q.useRef(!1),g=q.useRef(null),_=q.useCallback(e=>u?u(e):te.has(e),[u,te]),v=q.useMemo(()=>{let t=[];function n(e,r,i){let a=!!e.children&&e.children.length>0,o=_(e.id);if(t.push({node:e,depth:r,isExpanded:o,hasChildren:a,parentId:i}),a&&o&&e.children)for(let t of e.children)n(t,r+1,e.id)}for(let t of e)n(t,0);return t},[e,_]),re=q.useCallback(e=>e?`▼ `:`▶ `,[]),y=q.useCallback(e=>` ▸ `,[]),ie=p??re,b=m??y,ae=q.useCallback(e=>{let t=``;return e.hasChildren?t=ie(e.isExpanded):e.depth>0&&(t=b(e.depth)),t+e.node.label},[ie,b]),oe=q.useMemo(()=>v.map(e=>({label:ae(e),description:e.node.description,dimDescription:e.node.dimDescription??!0,value:e.node.id})),[v,ae]),x=q.useMemo(()=>{let e=new Map;return v.forEach(t=>e.set(t.node.id,t.node)),e},[v]),se=q.useCallback(e=>v.find(t=>t.node.id===e),[v]),S=q.useCallback((e,t)=>{se(e)?.hasChildren&&(t?d?d(e):ne(t=>new Set(t).add(e)):f?f(e):ne(t=>{let n=new Set(t);return n.delete(e),n}))},[se,d,f]);return(0,Ye.jsx)(o,{tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(!i||c)return;let t=se(i);if(t){if(e.key===`right`&&t.hasChildren)e.preventDefault(),S(i,!0);else if(e.key===`left`){if(t.hasChildren&&t.isExpanded)e.preventDefault(),S(i,!1);else if(t.parentId!==void 0&&(e.preventDefault(),h.current=!0,S(t.parentId,!1),r)){let e=x.get(t.parentId);e&&r(e)}}}},children:(0,Ye.jsx)(Ae,{options:oe,onChange:q.useCallback(e=>{let n=x.get(e);n&&t(n)},[x,t]),onFocus:q.useCallback(e=>{if(h.current){h.current=!1;return}if(g.current!==e&&(g.current=e,r)){let t=x.get(e);t&&r(t)}},[r,x]),onCancel:n,defaultFocusValue:i,visibleOptionCount:a,layout:s,isDisabled:c,hideIndexes:l,onUpFromFirstItem:ee})})}var q,Ye,Xe=e((()=>{q=t(d(),1),g(),ke(),Ye=_()}));function Ze(e,t){return Se(e.replace(/\s+/g,` `).trim(),t)}function Qe({before:e,match:t,after:n},r){return f.dim(e)+r(t)+f.dim(n)}function $e(e,t,n){let r=e.toLowerCase().indexOf(t.toLowerCase());if(r===-1)return null;let i=r+t.length,a=Math.max(0,r-n),o=Math.min(e.length,i+n),s=e.slice(a,r),c=e.slice(r,i),l=e.slice(i,o);return{before:(a>0?`…`:``)+s.replace(/\s+/g,` `).trimStart(),match:c.trim(),after:l.replace(/\s+/g,` `).trimEnd()+(o<e.length?`…`:``)}}function et(e,t,n){let{isGroupHeader:r=!1,isChild:i=!1,forkCount:a=0}=n||{},o=r&&a>0?st:i?ct:0,s=r&&a>0?` (+${a} other ${a===1?`session`:`sessions`})`:``,c=e.isSidechain?` (sidechain)`:``,l=t-o-c.length-s.length;return`${Ze(M(e),l)}${c}${s}`}function tt(e,t){let{isChild:n=!1,showProjectPath:r=!1}=t||{},i=n?` `:``,a=Ce(e),o=r&&e.projectPath?` · ${e.projectPath}`:``;return i+a+o}function nt({logs:e,maxHeight:t=1/0,forceWidth:i,onCancel:d,onSelect:f,onLogsChanged:p,onLoadMore:h,initialSearchQuery:g,showAllProjects:_=!1,onToggleAllProjects:v,onAgenticSearch:y}){let ie=ne(),b=i===void 0?ie.columns:i,x=De(d),se=u(),S=me(),[ce]=a(),le=Ne(ce),C=J.useMemo(()=>e=>te(e,le.warning),[le.warning]),[w,de]=J.useState(null),[D,fe]=J.useState(!1),[O,he]=J.useState(!1),[k,_e]=J.useState(!1),A=J.useMemo(()=>oe(),[]),[ve,j]=J.useState(``),[ye,be]=J.useState(0),[xe,Se]=J.useState(new Set),[N,we]=J.useState(null),[Te,Ee]=J.useState(1),[P,F]=J.useState(`list`),[ke,je]=J.useState(null),Pe=J.useRef(null),[Fe,Le]=J.useState(0),[I,L]=J.useState({status:`idle`}),[R,z]=J.useState(!1),ze=J.useRef(null),{query:B,setQuery:Be,cursorOffset:V}=Ie({isActive:P===`search`&&I.status!==`searching`,onExit:()=>{F(`list`)},onExitUp:()=>{F(`list`)},passthroughCtrlKeys:[`n`],initialQuery:g||``}),H=J.useDeferredValue(B),[U,W]=J.useState(``);J.useEffect(()=>{if(!H){W(``);return}let e=setTimeout(W,300,H);return()=>clearTimeout(e)},[H]);let[G,He]=J.useState(null),[Ue,We]=J.useState(!1);J.useEffect(()=>{re().then(e=>de(e)),ge(A).then(e=>{_e(e.length>1)})},[A]);let Ge=J.useMemo(()=>new Map(e.map(e=>[e,it(e)])),[e]),Ke=J.useMemo(()=>null,[e,Ge,!1]),K=J.useMemo(()=>ot(e),[e]),qe=K.length>0,q=J.useMemo(()=>qe?[`All`,...K]:[],[qe,K]),Ye=q.length>0&&Fe<q.length?Fe:0,Xe=q[Ye],nt=Xe===`All`?void 0:Xe,rt=+!!qe,st=J.useMemo(()=>{let t=e;return S&&(t=e.filter(e=>{let t=ae(),n=T(e);return!!(t&&n===t||e.customTitle||pe(e.messages)||e.firstPrompt||e.customTitle)})),nt!==void 0&&(t=t.filter(e=>e.tag===nt)),D&&w&&(t=t.filter(e=>e.gitBranch===w)),k&&!O&&(t=t.filter(e=>e.projectPath===A)),t},[e,S,nt,D,w,k,O,A]),ct=J.useMemo(()=>{if(!B)return st;let e=B.toLowerCase();return st.filter(t=>{let n=M(t).toLowerCase(),r=(t.gitBranch||``).toLowerCase(),i=(t.tag||``).toLowerCase(),a=t.prNumber?`pr #${t.prNumber} ${t.prRepository||``}`.toLowerCase():``;return n.includes(e)||r.includes(e)||i.includes(e)||a.includes(e)})},[st,B]);J.useEffect(()=>{},[H,U,!1]),J.useEffect(()=>{He(null),We(!1)},[U,Ke,!1]);let{filteredLogs:lt,snippets:X}=J.useMemo(()=>{let e=new Map,t=ct;if(G&&U&&G.query===U){for(let t of G.results)if(t.searchableText){let n=$e(t.searchableText,U,ut);n&&e.set(t.log,n)}let n=new Set(t.map(e=>e.messages[0]?.uuid)),r=G.results.map(e=>e.log).filter(e=>!n.has(e.messages[0]?.uuid));t=[...t,...r]}return{filteredLogs:t,snippets:e}},[ct,G,U]),Z=J.useMemo(()=>I.status===`results`&&I.results.length>0?I.results:lt,[I,lt]),Q=Math.max(30,b-4),dt=J.useMemo(()=>{if(!S)return[];let e=at(Z);return Array.from(e.entries()).map(([e,t])=>{let n=t[0],r=Z.indexOf(n),i=X.get(n),a=i?Qe(i,C):null;if(t.length===1){let t=tt(n,{showProjectPath:_});return{id:`log:${e}:0`,value:{log:n,indexInFiltered:r},label:et(n,Q),description:a?`${t}\n ${a}`:t,dimDescription:!0}}let o=t.length-1,s=t.slice(1).map((t,n)=>{let r=Z.indexOf(t),i=X.get(t),a=i?Qe(i,C):null,o=tt(t,{isChild:!0,showProjectPath:_});return{id:`log:${e}:${n+1}`,value:{log:t,indexInFiltered:r},label:et(t,Q,{isChild:!0}),description:a?`${o}\n ${a}`:o,dimDescription:!0}}),c=tt(n,{showProjectPath:_});return{id:`group:${e}`,value:{log:n,indexInFiltered:r},label:et(n,Q,{isGroupHeader:!0,forkCount:o}),description:a?`${c}\n ${a}`:c,dimDescription:!0,children:s}})},[S,Z,Q,_,X,C]),ft=J.useMemo(()=>S?[]:Z.map((e,t)=>{let n=Ze(M(e)+(e.isSidechain?` (sidechain)`:``),Q),r=Ce(e),i=_&&e.projectPath?` · ${e.projectPath}`:``,a=X.get(e),o=a?Qe(a,C):null;return{label:n,description:o?`${r}${i}\n ${o}`:r+i,dimDescription:!0,value:t.toString()}}),[S,Z,C,Q,_,X]),$=N?.value.log??null,pt=()=>{if(!S||!$)return``;let e=T($);if(!e)return``;let t=Z.filter(t=>T(t)===e);if(!(t.length>1))return``;let n=xe.has(e);return t.indexOf($)>0||n?`← to collapse`:`→ to expand`},mt=J.useCallback(async()=>{let e=$?T($):void 0;if(!$||!e){F(`list`),j(``);return}ve.trim()&&(await ue(e,ve.trim(),$.fullPath),S&&p&&p()),F(`list`),j(``)},[$,ve,p,S]),ht=J.useCallback(()=>{F(`list`)},[]),gt=J.useCallback(()=>{F(`search`)},[]),_t=J.useCallback(async()=>{if(!B.trim()||!y||!0)return;ze.current?.abort();let t=new AbortController;ze.current=t,L({status:`searching`}),B.length;try{let n=await y(B,e,t.signal);if(t.signal.aborted)return;L({status:`results`,results:n,query:B}),B.length,n.length}catch(e){if(t.signal.aborted)return;L({status:`error`,message:e instanceof Error?e.message:`Search failed`}),B.length}},[B,y,!1,e]);J.useEffect(()=>{I.status!==`idle`&&I.status!==`searching`&&(I.status===`results`&&I.query!==B||I.status===`error`)&&L({status:`idle`})},[B,I]),J.useEffect(()=>()=>{ze.current?.abort()},[]);let vt=J.useRef(I.status);J.useEffect(()=>{let e=vt.current;if(vt.current=I.status,e===`searching`&&I.status===`results`){if(S&&dt.length>0)we(dt[0]);else if(!S&&Z.length>0){let e=Z[0];we({id:`0`,value:{log:e,indexInFiltered:0},label:``})}}},[I.status,S,dt,Z]);let yt=J.useCallback(e=>{let t=parseInt(e,10),n=Z[t];!n||Pe.current===t.toString()||(Pe.current=t.toString(),we({id:t.toString(),value:{log:n,indexInFiltered:t},label:``}),Ee(t+1))},[Z]),bt=J.useCallback(e=>{we(e);let t=Z.findIndex(t=>T(t)===T(e.value.log));t>=0&&Ee(t+1)},[Z]);l(`confirm:no`,()=>{ze.current?.abort(),L({status:`idle`})},{context:`Confirmation`,isActive:P!==`preview`&&I.status===`searching`}),l(`confirm:no`,()=>{F(`list`),j(``)},{context:`Settings`,isActive:P===`rename`&&I.status!==`searching`}),l(`confirm:no`,()=>{Be(``),z(!1),d?.()},{context:`Confirmation`,isActive:P!==`preview`&&P!==`rename`&&P!==`search`&&R&&I.status!==`searching`}),m((e,t)=>{if(P!==`preview`&&I.status!==`searching`&&P!==`rename`)if(P===`search`)e.toLowerCase()===`n`&&t.ctrl?ht():(t.return||t.downArrow)&&B.trim();else{if(R){if(t.return){_t(),z(!1);return}else if(t.downArrow){z(!1);return}else if(t.upArrow){F(`search`),z(!1);return}}if(qe&&t.tab){let e=t.shift?-1:1;Le(t=>{let n=((t<q.length?t:0)+q.length+e)%q.length;return q[n],K.length,n});return}let n=!t.ctrl&&!t.meta,r=e.toLowerCase();r===`a`&&t.ctrl&&v?v():r===`b`&&t.ctrl?fe(!D):r===`w`&&t.ctrl&&k?he(!O):r===`/`&&n?F(`search`):r===`r`&&t.ctrl&&$?(F(`rename`),j(``)):r===`v`&&t.ctrl&&$?(je($),F(`preview`),$.messageCount):$&&n&&e.length>0&&!/^\s+$/.test(e)&&(F(`search`),Be(e))}},{isActive:!0});let xt=[];D&&w&&xt.push(w),k&&!O&&xt.push(`current worktree`);let St=8+ +(xt.length>0&&P!==`search`)+rt,Ct=Math.max(1,Math.floor((t-St-2)/3));return J.useEffect(()=>{if(!h)return;let e=Ct*2;Te+e>=Z.length&&h(Ct*3)},[Te,Ct,Z.length,h]),e.length===0?null:P===`preview`&&ke&&S?(0,Y.jsx)(Re,{log:ke,onExit:()=>{F(`list`),je(null)},onSelect:f}):(0,Y.jsxs)(o,{flexDirection:`column`,height:t-1,children:[(0,Y.jsx)(o,{flexShrink:0,children:(0,Y.jsx)(n,{color:`suggestion`})}),(0,Y.jsx)(o,{flexShrink:0,children:(0,Y.jsx)(s,{children:` `})}),qe?(0,Y.jsx)(Ve,{tabs:q,selectedIndex:Ye,availableWidth:b,showAllProjects:_}):(0,Y.jsx)(o,{flexShrink:0,children:(0,Y.jsxs)(s,{bold:!0,color:`suggestion`,children:[`Resume Session`,P===`list`&&Z.length>Ct&&(0,Y.jsxs)(s,{dimColor:!0,children:[` `,`(`,Te,` of `,Z.length,`)`]})]})}),(0,Y.jsx)(ee,{query:B,isFocused:P===`search`,isTerminalFocused:se,cursorOffset:V}),xt.length>0&&P!==`search`&&(0,Y.jsx)(o,{flexShrink:0,paddingLeft:2,children:(0,Y.jsx)(s,{dimColor:!0,children:(0,Y.jsx)(c,{children:xt})})}),(0,Y.jsx)(o,{flexShrink:0,children:(0,Y.jsx)(s,{children:` `})}),I.status===`searching`&&(0,Y.jsxs)(o,{paddingLeft:1,flexShrink:0,children:[(0,Y.jsx)(Me,{}),(0,Y.jsx)(s,{children:` Searching…`})]}),I.status===`results`&&I.results.length>0&&(0,Y.jsx)(o,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(s,{dimColor:!0,italic:!0,children:`Work Mate found these results:`})}),I.status===`results`&&I.results.length===0&&lt.length===0&&(0,Y.jsx)(o,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(s,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),I.status===`error`&&lt.length===0&&(0,Y.jsx)(o,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(s,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),!!B.trim()&&y&&!1,I.status===`searching`?null:P===`rename`&&$?(0,Y.jsxs)(o,{paddingLeft:2,flexDirection:`column`,children:[(0,Y.jsx)(s,{bold:!0,children:`Rename session:`}),(0,Y.jsx)(o,{paddingTop:1,children:(0,Y.jsx)(Oe,{value:ve,onChange:j,onSubmit:mt,placeholder:M($,`Enter new session name`),columns:b,cursorOffset:ye,onChangeCursorOffset:be,showCursor:!0})})]}):S?(0,Y.jsx)(Je,{nodes:dt,onSelect:e=>{f(e.value.log)},onFocus:bt,onCancel:d,focusNodeId:N?.id,visibleOptionCount:Ct,layout:`expanded`,isDisabled:P===`search`||R,hideIndexes:!1,isNodeExpanded:e=>{if(P===`search`||D)return!0;let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;return t?xe.has(t):!1},onExpand:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&Se(e=>new Set(e).add(t))},onCollapse:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&Se(e=>{let n=new Set(e);return n.delete(t),n})},onUpFromFirstItem:gt}):(0,Y.jsx)(Ae,{options:ft,onChange:e=>{let t=Z[parseInt(e,10)];t&&f(t)},visibleOptionCount:Ct,onCancel:d,onFocus:yt,defaultFocusValue:N?.id.toString(),layout:`expanded`,isDisabled:P===`search`||R,onUpFromFirstItem:gt}),(0,Y.jsx)(o,{paddingLeft:2,children:x.pending?(0,Y.jsxs)(s,{dimColor:!0,children:[`Press `,x.keyName,` again to exit`]}):P===`rename`?(0,Y.jsx)(s,{dimColor:!0,children:(0,Y.jsxs)(c,{children:[(0,Y.jsx)(r,{shortcut:`Enter`,action:`save`}),(0,Y.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):I.status===`searching`?(0,Y.jsx)(s,{dimColor:!0,children:(0,Y.jsxs)(c,{children:[(0,Y.jsx)(s,{children:`Searching with Work Mate…`}),(0,Y.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):R?(0,Y.jsx)(s,{dimColor:!0,children:(0,Y.jsxs)(c,{children:[(0,Y.jsx)(r,{shortcut:`Enter`,action:`search`}),(0,Y.jsx)(r,{shortcut:`↓`,action:`skip`}),(0,Y.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):P===`search`?(0,Y.jsx)(s,{dimColor:!0,children:(0,Y.jsxs)(c,{children:[(0,Y.jsx)(s,{children:`Type to Search`}),(0,Y.jsx)(r,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`clear`})]})}):(0,Y.jsx)(s,{dimColor:!0,children:(0,Y.jsxs)(c,{children:[v&&(0,Y.jsx)(r,{shortcut:`Ctrl+A`,action:`show ${_?`current dir`:`all projects`}`}),w&&(0,Y.jsx)(r,{shortcut:`Ctrl+B`,action:`toggle branch`}),k&&(0,Y.jsx)(r,{shortcut:`Ctrl+W`,action:`show ${O?`current worktree`:`all worktrees`}`}),(0,Y.jsx)(r,{shortcut:`Ctrl+V`,action:`preview`}),(0,Y.jsx)(r,{shortcut:`Ctrl+R`,action:`rename`}),(0,Y.jsx)(s,{children:`Type to search`}),(0,Y.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`}),pt()&&(0,Y.jsx)(s,{children:pt()})]})})})]})}function rt(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function it(e){let t=(e.messages.length<=lt?e.messages:[...e.messages.slice(0,X),...e.messages.slice(-1e3)]).map(rt).filter(Boolean).join(` `),n=`${[e.customTitle,e.summary,e.firstPrompt,e.gitBranch,e.tag,e.prNumber?`PR #${e.prNumber}`:void 0,e.prRepository].filter(Boolean).join(` `)} ${t}`.trim();return n.length>Z?n.slice(0,Z):n}function at(e){let t=new Map;for(let n of e){let e=T(n);if(e){let r=t.get(e);r?r.push(n):t.set(e,[n])}}return t.forEach(e=>e.sort((e,t)=>new Date(t.modified).getTime()-new Date(e.modified).getTime())),t}function ot(e){let t=new Set;for(let n of e)n.tag&&t.add(n.tag);return Array.from(t).sort((e,t)=>e.localeCompare(t))}var J,Y,st,ct,lt,X,Z,ut,Q=e((()=>{p(),J=t(d(),1),b(),P(),Le(),D(),g(),fe(),xe(),N(),le(),ie(),ye(),w(),Pe(),de(),ke(),Fe(),ze(),je(),qe(),F(),Xe(),Y=_(),st=2,ct=4,lt=2e3,X=1e3,Z=5e4,ut=50}));function dt(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function ft(e){if(e.length===0)return``;let t=(e.length<=ht?e:[...e.slice(0,ht/2),...e.slice(-100/2)]).map(dt).filter(Boolean).join(` `).replace(/\s+/g,` `).trim();return t.length>mt?`${t.slice(0,mt)}…`:t}function $(e,t){return!!(M(e).toLowerCase().includes(t)||e.customTitle?.toLowerCase().includes(t)||e.tag?.toLowerCase().includes(t)||e.gitBranch?.toLowerCase().includes(t)||e.summary?.toLowerCase().includes(t)||e.firstPrompt?.toLowerCase().includes(t)||e.messages&&e.messages.length>0&&ft(e.messages).toLowerCase().includes(t))}async function pt(e,t,n){if(!e.trim()||t.length===0)return[];let r=e.toLowerCase(),i=t.filter(e=>$(e,r)),a;if(i.length>=gt)a=i.slice(0,gt);else{let e=t.filter(e=>!$(e,r)),n=gt-i.length;a=[...i,...e.slice(0,n)]}A(`Agentic search: ${a.length}/${t.length} logs, query="${e}", matching: ${i.length}, with messages: ${y(a,e=>e.messages?.length>0)}`);let o=a.map(async e=>{if(C(e))try{return await se(e)}catch(t){return be(t),e}return e}),s=await Promise.all(o);A(`Agentic search: loaded ${y(s,e=>e.messages?.length>0)}/${a.length} logs with transcripts`);let c=`Sessions:
2
- ${s.map((e,t)=>{let n=[`${t}:`],r=M(e);if(n.push(r),e.customTitle&&e.customTitle!==r&&n.push(`[custom title: ${e.customTitle}]`),e.tag&&n.push(`[tag: ${e.tag}]`),e.gitBranch&&n.push(`[branch: ${e.gitBranch}]`),e.summary&&n.push(`- Summary: ${e.summary}`),e.firstPrompt&&e.firstPrompt!==`No prompt`&&n.push(`- First message: ${e.firstPrompt.slice(0,300)}`),e.messages&&e.messages.length>0){let t=ft(e.messages);t&&n.push(`- Transcript: ${t}`)}return n.join(` `)}).join(`
3
- `)}
4
-
5
- Search query: "${e}"
6
-
7
- Find the sessions that are most relevant to this query.`;A(`Agentic search prompt (first 500 chars): ${c.slice(0,500)}...`);try{let e=Ee();A(`Agentic search using model: ${e}`);let t=(await k({model:e,system:_t,messages:[{role:`user`,content:c}],signal:n,querySource:`session_search`})).content.find(e=>e.type===`text`);if(t?.type!==`text`)return A(`No text content in agentic search response`),[];A(`Agentic search response: ${t.text}`);let r=t.text.match(/\{[\s\S]*\}/);if(!r)return A(`Could not find JSON in agentic search response`),[];let i=(_e(r[0]).relevant_indices||[]).filter(e=>e>=0&&e<s.length).map(e=>s[e]);return A(`Agentic search found ${i.length} relevant sessions`),i}catch(e){return be(e),A(`Agentic search error: ${e}`),[]}}var mt,ht,gt,_t,vt=e((()=>{v(),ve(),ye(),Te(),w(),O(),j(),mt=2e3,ht=100,gt=100,_t=`Your goal is to find relevant sessions based on a user's search query.
8
-
9
- You will be given a list of sessions with their metadata and a search query. Identify which sessions are most relevant to the query.
10
-
11
- Each session may include:
12
- - Title (display name or custom title)
13
- - Tag (user-assigned category, shown as [tag: name] - users tag sessions with /tag command to categorize them)
14
- - Branch (git branch name, shown as [branch: name])
15
- - Summary (AI-generated summary)
16
- - First message (beginning of the conversation)
17
- - Transcript (excerpt of conversation content)
18
-
19
- IMPORTANT: Tags are user-assigned labels that indicate the session's topic or category. If the query matches a tag exactly or partially, those sessions should be highly prioritized.
20
-
21
- For each session, consider (in order of priority):
22
- 1. Exact tag matches (highest priority - user explicitly categorized this session)
23
- 2. Partial tag matches or tag-related terms
24
- 3. Title matches (custom titles or first message content)
25
- 4. Branch name matches
26
- 5. Summary and transcript content matches
27
- 6. Semantic similarity and related concepts
28
-
29
- CRITICAL: Be VERY inclusive in your matching. Include sessions that:
30
- - Contain the query term anywhere in any field
31
- - Are semantically related to the query (e.g., "testing" matches sessions about "tests", "unit tests", "QA", etc.)
32
- - Discuss topics that could be related to the query
33
- - Have transcripts that mention the concept even in passing
34
-
35
- When in doubt, INCLUDE the session. It's better to return too many results than too few. The user can easily scan through results, but missing relevant sessions is frustrating.
36
-
37
- Return sessions ordered by relevance (most relevant first). If truly no sessions have ANY connection to the query, return an empty array - but this should be rare.
38
-
39
- Respond with ONLY the JSON object, no markdown formatting:
40
- {"relevant_indices": [2, 5, 0]}`}));function yt(e,t){let n=oe();if(!t||!e.projectPath||e.projectPath===n)return{isCrossProject:!1};let r=T(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${S([e.projectPath])} && claude --resume ${r}`,projectPath:e.projectPath}}var bt=e((()=>{b(),he(),w()}));export{nt as a,vt as i,bt as n,Q as o,pt as r,yt as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Doctor-COj-tZBc.js";var i,a;e((()=>{n(),i=t(),a=(e,t,n)=>Promise.resolve((0,i.jsx)(r,{onDone:e}))}))();export{a as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{St as n,Xs as r,Zs as i,gi as a,mC as o,mi as s,pC as c,yt as l}from"./loadAgentsDir-bmpKLPdG.js";import{n as u,t as d}from"./ExitFlow-CcMYH5iI.js";import{spawnSync as f}from"child_process";function p(){return o(g)??`Goodbye!`}async function m(e){if(i())return e(),f(`tmux`,[`detach-client`],{stdio:`ignore`}),null;let t=l()!==null;return t?(0,h.jsx)(d,{showWorktree:t,onDone:e,onCancel:()=>e()}):(e(p()),await s(0,`prompt_input_exit`),null)}var h,g;e((()=>{c(),u(),r(),a(),n(),h=t(),g=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}))();export{m as call};
@@ -1 +0,0 @@
1
- import{cc as e,dc as t,lc as n,uc as r}from"./loadAgentsDir-bmpKLPdG.js";t();export{e as drainPendingExtraction,n as executeExtractMemories,r as initExtractMemories};
@@ -1 +0,0 @@
1
- import{n as e,r as t,t as n}from"./fast-D7oNjaZ3.js";t();export{n as FastModePicker,e as call};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./fetchModelList-Cv1vWIpC.js";e();export{t as fetchAvailableModels};
@@ -1 +0,0 @@
1
- import{mn as e,on as t,qt as n}from"./loadAgentsDir-bmpKLPdG.js";e();export{n as executeSessionEndHooks,t as getSessionEndHookTimeoutMs};
@@ -1 +0,0 @@
1
- import{o as e,t}from"./loadAgentsDir-bmpKLPdG.js";e();export{t as clearAgentDefinitionsCache};
@@ -1 +0,0 @@
1
- import{c_ as e,s_ as t,u_ as n}from"./loadAgentsDir-bmpKLPdG.js";t();export{e as loadPluginHooks,n as setupPluginHookHotReload};
@@ -1 +0,0 @@
1
- import{a as e,o as t,s as n,t as r}from"./localSearch-Da8cVYoI.js";t();export{r as clearSkillIndexCache,e as getSkillIndex,n as searchSkills};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./managedEnv-EZ2IirNa.js";e();export{t as applyConfigEnvironmentVariables};
@@ -1,2 +0,0 @@
1
- import{$f as e,Af as t,B as n,Bf as r,Bv as i,D_ as a,Dc as o,Ds as s,E_ as c,Ec as l,Ff as u,Gv as d,Gx as f,Hf as p,If as m,Jf as h,Ji as g,Kf as _,Lf as v,Mf as ee,Nf as te,Os as ne,Pf as y,Qf as b,Rf as x,Uf as S,V as C,Vf as w,Wf as T,Wv as E,Xf as D,Yf as O,Zf as k,ap as A,bb as j,bl as M,cp as N,dp as P,ep as F,fp as I,jf as L,kf as re,lp as R,np as z,op as B,tp as V,up as H,xb as U,xl as W,zf as G,zv as K}from"./loadAgentsDir-bmpKLPdG.js";import{C as q,x as J}from"./debug-2pVES-2G.js";import{o as Y,s as X}from"./log-L1kqxa_P.js";import{f as Z,s as ie}from"./model-Dd3x121y.js";import{_n as Q,gn as ae,vn as oe}from"./prompt-BnDapYGL.js";import $ from"node:process";H(),x(),m(),N();var se=class{constructor(e){this._server=e}requestStream(e,t,n){return this._server.requestStream(e,t,n)}createMessageStream(e,t){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw Error(`Client does not support sampling tools capability.`);if(e.messages.length>0){let t=e.messages[e.messages.length-1],n=Array.isArray(t.content)?t.content:[t.content],r=n.some(e=>e.type===`tool_result`),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],o=a.some(e=>e.type===`tool_use`);if(r){if(n.some(e=>e.type!==`tool_result`))throw Error(`The last message must contain only tool_result content if any is present`);if(!o)throw Error(`tool_result blocks are not matching any tool_use from the previous message`)}if(o){let e=new Set(a.filter(e=>e.type===`tool_use`).map(e=>e.id)),t=new Set(n.filter(e=>e.type===`tool_result`).map(e=>e.toolUseId));if(e.size!==t.size||![...e].every(e=>t.has(e)))throw Error(`ids of tool_result blocks and tool_use blocks from previous message do not match`)}}return this.requestStream({method:`sampling/createMessage`,params:e},p,t)}elicitInputStream(e,t){let n=this._server.getClientCapabilities(),r=e.mode??`form`;switch(r){case`url`:if(!n?.elicitation?.url)throw Error(`Client does not support url elicitation.`);break;case`form`:if(!n?.elicitation?.form)throw Error(`Client does not support form elicitation.`);break}let i=r===`form`&&e.mode===void 0?{...e,mode:`form`}:e;return this.requestStream({method:`elicitation/create`,params:i},_,t)}async getTask(e,t){return this._server.getTask({taskId:e},t)}async getTaskResult(e,t,n){return this._server.getTaskResult({taskId:e},t,n)}async listTasks(e,t){return this._server.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._server.cancelTask({taskId:e},t)}};N(),y();var ce=class extends v{constructor(e,t){super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(V.options.map((e,t)=>[e,t])),this.isMessageIgnored=(e,t)=>{let n=this._loggingLevels.get(t);return n?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(n):!1},this._capabilities=t?.capabilities??{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new u,this.setRequestHandler(D,e=>this._oninitialize(e)),this.setNotificationHandler(k,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(B,async(e,t)=>{let n=t.sessionId||t.requestInfo?.headers[`mcp-session-id`]||void 0,{level:r}=e.params,i=V.safeParse(r);return i.success&&this._loggingLevels.set(n,i.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new se(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after connecting to transport`);this._capabilities=G(this._capabilities,e)}setRequestHandler(e,t){let n=R(e)?.method;if(!n)throw Error(`Schema is missing a method literal`);let i;if(P(n)){let e=n;i=e._zod?.def?.value??e.value}else{let e=n;i=e._def?.value??e.value}if(typeof i!=`string`)throw Error(`Schema method literal must be a string`);return i===`tools/call`?super.setRequestHandler(e,async(e,n)=>{let i=I(r,e);if(!i.success){let e=i.error instanceof Error?i.error.message:String(i.error);throw new z(O.InvalidParams,`Invalid tools/call request: ${e}`)}let{params:a}=i.data,o=await Promise.resolve(t(e,n));if(a.task){let e=I(T,o);if(!e.success){let t=e.error instanceof Error?e.error.message:String(e.error);throw new z(O.InvalidParams,`Invalid task creation result: ${t}`)}return e.data}let s=I(w,o);if(!s.success){let e=s.error instanceof Error?s.error.message:String(s.error);throw new z(O.InvalidParams,`Invalid tools/call result: ${e}`)}return s.data}):super.setRequestHandler(e,t)}assertCapabilityForMethod(e){switch(e){case`sampling/createMessage`:if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case`elicitation/create`:if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case`roots/list`:if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`);break;case`ping`:break}}assertNotificationCapability(e){switch(e){case`notifications/message`:if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case`notifications/resources/updated`:case`notifications/resources/list_changed`:if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case`notifications/tools/list_changed`:if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case`notifications/prompts/list_changed`:if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case`notifications/elicitation/complete`:if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`);break;case`notifications/cancelled`:break;case`notifications/progress`:break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case`completion/complete`:if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case`logging/setLevel`:if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case`prompts/get`:case`prompts/list`:if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case`resources/list`:case`resources/templates/list`:case`resources/read`:if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case`tasks/get`:case`tasks/list`:case`tasks/result`:case`tasks/cancel`:if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`);break;case`ping`:case`initialize`:break}}assertTaskCapability(e){ee(this._clientCapabilities?.tasks?.requests,e,`Client`)}assertTaskHandlerCapability(e){this._capabilities&&te(this._capabilities.tasks?.requests,e,`Server`)}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:A.includes(t)?t:b,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:`ping`},h)}async createMessage(e,t){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw Error(`Client does not support sampling tools capability.`);if(e.messages.length>0){let t=e.messages[e.messages.length-1],n=Array.isArray(t.content)?t.content:[t.content],r=n.some(e=>e.type===`tool_result`),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],o=a.some(e=>e.type===`tool_use`);if(r){if(n.some(e=>e.type!==`tool_result`))throw Error(`The last message must contain only tool_result content if any is present`);if(!o)throw Error(`tool_result blocks are not matching any tool_use from the previous message`)}if(o){let e=new Set(a.filter(e=>e.type===`tool_use`).map(e=>e.id)),t=new Set(n.filter(e=>e.type===`tool_result`).map(e=>e.toolUseId));if(e.size!==t.size||![...e].every(e=>t.has(e)))throw Error(`ids of tool_result blocks and tool_use blocks from previous message do not match`)}}return e.tools?this.request({method:`sampling/createMessage`,params:e},S,t):this.request({method:`sampling/createMessage`,params:e},p,t)}async elicitInput(e,t){switch(e.mode??`form`){case`url`:{if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support url elicitation.`);let n=e;return this.request({method:`elicitation/create`,params:n},_,t)}case`form`:{if(!this._clientCapabilities?.elicitation?.form)throw Error(`Client does not support form elicitation.`);let n=e.mode===`form`?e:{...e,mode:`form`},r=await this.request({method:`elicitation/create`,params:n},_,t);if(r.action===`accept`&&r.content&&n.requestedSchema)try{let e=this._jsonSchemaValidator.getValidator(n.requestedSchema)(r.content);if(!e.valid)throw new z(O.InvalidParams,`Elicitation response content does not match requested schema: ${e.errorMessage}`)}catch(e){throw e instanceof z?e:new z(O.InternalError,`Error validating elicitation response: ${e instanceof Error?e.message:String(e)}`)}return r}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for notifications/elicitation/complete)`);return()=>this.notification({method:`notifications/elicitation/complete`,params:{elicitationId:e}},t)}async listRoots(t,n){return this.request({method:`roots/list`,params:t},e,n)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:`notifications/message`,params:e})}async sendResourceUpdated(e){return this.notification({method:`notifications/resources/updated`,params:e})}async sendResourceListChanged(){return this.notification({method:`notifications/resources/list_changed`})}async sendToolListChanged(){return this.notification({method:`notifications/tools/list_changed`})}async sendPromptListChanged(){return this.notification({method:`notifications/prompts/list_changed`})}};t();var le=class{constructor(e=$.stdin,t=$.stdout){this._stdin=e,this._stdout=t,this._readBuffer=new re,this._started=!1,this._ondata=e=>{this._readBuffer.append(e),this.processReadBuffer()},this._onerror=e=>{this.onerror?.(e)}}async start(){if(this._started)throw Error(`StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.`);this._started=!0,this._stdin.on(`data`,this._ondata),this._stdin.on(`error`,this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off(`data`,this._ondata),this._stdin.off(`error`,this._onerror),this._stdin.listenerCount(`data`)===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(t=>{let n=L(e);this._stdout.write(n)?t():this._stdout.once(`drain`,t)})}};N(),ne(),oe(),o(),i(),d(),Y(),g(),Z(),C(),j(),J(),W(),c();var ue=[];async function de(e,t,i){let o=E(100);U(e);let c=new ce({name:`workmate/tengu`,version:`0.0.28`},{capabilities:{tools:{}}});c.setRequestHandler(F,async()=>{let e=Q(),t=l(e);return{tools:await Promise.all(t.map(async n=>{let r;if(n.outputSchema){let e=a(n.outputSchema);typeof e==`object`&&e&&`type`in e&&e.type===`object`&&(r=e)}return{...n,description:await n.prompt({getToolPermissionContext:async()=>e,tools:t,agents:[]}),inputSchema:a(n.inputSchema),outputSchema:r}}))}}),c.setRequestHandler(r,async({params:{name:e,arguments:r}})=>{let a=l(Q()),c=ae(a,e);if(!c)throw Error(`Tool ${e} not found`);let u={abortController:K(),options:{commands:ue,tools:a,mainLoopModel:ie(),thinkingConfig:{type:`disabled`},mcpClients:[],mcpResources:{},isNonInteractiveSession:!0,debug:t,verbose:i,agentDefinitions:{activeAgents:[],allAgents:[]}},getAppState:()=>s(),setAppState:()=>{},messages:[],readFileState:o,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}};try{if(!c.isEnabled())throw Error(`Tool ${e} is not enabled`);let t=await c.validateInput?.(r??{},u);if(t&&!t.result)throw Error(`Tool ${e} input is invalid: ${`message`in t?t.message:String(t)}`);let i=await c.call(r??{},u,n,f({content:[]}));return{content:[{type:`text`,text:typeof i==`string`?i:q(i.data)}]}}catch(e){return X(e),{isError:!0,content:[{type:`text`,text:(e instanceof Error?M(e):[String(e)]).filter(Boolean).join(`
2
- `).trim()||`Error`}]}}});async function u(){let e=new le;await c.connect(e)}return await u()}export{de as startMCPServer};
@@ -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{D as i,Gt as a,H as o,I as s,Lt as c,P as l,T as u,ai as d,j as f,t as p,y as m}from"./src-BX54x08P.js";import{t as h}from"./jsx-runtime-Bb4Xn-E0.js";import{$d as g,Bh as _,Jd as v,Vd as y,Vh as b,Xd as x,hd as S,md as C,tb as w,zh as T}from"./loadAgentsDir-bmpKLPdG.js";import{a as ee,i as E}from"./debug-2pVES-2G.js";import{l as te,n as D,o as O}from"./stringUtils-Cs6E5f-B.js";import{i as k,n as A,r as j}from"./MCPConnectionManager-C7RmKzJh.js";import{t as ne}from"./select-CaxQ-BVq.js";import{r as M,t as re}from"./Spinner-C0qHjfIY.js";import{t as ie}from"./CustomSelect-t4wXuXWH.js";import{n as ae,t as N}from"./McpParsingWarnings-Czze2JPd.js";import{a as P,c as oe,i as se,n as ce,o as le,r as ue,s as F,t as I}from"./MCPToolListView-CewNLJus.js";function L({agentServer:e,onCancel:t}){let[n]=o();return(0,R.jsxs)(m,{title:`${D(String(e.name))} MCP Server`,subtitle:`agent-only`,onCancel:t,inputGuide:e=>e.pending?(0,R.jsxs)(l,{children:[`Press `,e.keyName,` again to exit`]}):(0,R.jsxs)(u,{children:[(0,R.jsx)(i,{shortcut:`↑↓`,action:`navigate`}),(0,R.jsx)(i,{shortcut:`Enter`,action:`confirm`}),(0,R.jsx)(C,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:[(0,R.jsxs)(s,{flexDirection:`column`,gap:0,children:[(0,R.jsxs)(s,{children:[(0,R.jsx)(l,{bold:!0,children:`Type: `}),(0,R.jsx)(l,{dimColor:!0,children:e.transport})]}),e.url&&(0,R.jsxs)(s,{children:[(0,R.jsx)(l,{bold:!0,children:`URL: `}),(0,R.jsx)(l,{dimColor:!0,children:e.url})]}),e.command&&(0,R.jsxs)(s,{children:[(0,R.jsx)(l,{bold:!0,children:`Command: `}),(0,R.jsx)(l,{dimColor:!0,children:e.command})]}),(0,R.jsxs)(s,{children:[(0,R.jsx)(l,{bold:!0,children:`Used by: `}),(0,R.jsx)(l,{dimColor:!0,children:e.sourceAgents.join(`, `)})]}),(0,R.jsxs)(s,{marginTop:1,children:[(0,R.jsx)(l,{bold:!0,children:`Status: `}),(0,R.jsxs)(l,{children:[f(`inactive`,n)(r.radioOff),` not connected (agent-only)`]})]})]}),(0,R.jsx)(s,{children:(0,R.jsx)(l,{dimColor:!0,children:`This server connects only when running the agent.`})}),(0,R.jsx)(s,{children:(0,R.jsx)(ne,{options:[{label:`Back`,value:`back`}],onChange:e=>{e===`back`&&t()},onCancel:t})})]})}var R,z=e((()=>{n(),p(),O(),S(),ie(),R=h()}));function B(e){switch(e){case`project`:return{label:`Project MCPs`,path:y(e)};case`user`:return{label:`User MCPs`,path:y(e)};case`local`:return{label:`Local MCPs`,path:y(e)};case`enterprise`:return{label:`Enterprise MCPs`};case`dynamic`:return{label:`Built-in MCPs`,path:`always available`};default:return{label:e}}}function V(e){let t=new Map;for(let n of e){let e=n.scope;t.has(e)||t.set(e,[]),t.get(e).push(n)}for(let[,e]of t)e.sort((e,t)=>e.name.localeCompare(t.name));return t}function H({servers:e,agentServers:t=[],onSelectServer:n,onSelectAgentServer:d,onComplete:p}){let[h]=o(),[g,_]=(0,U.useState)(0),v=U.useMemo(()=>V(e.filter(e=>e.client.config.type!==`claudeai-proxy`)),[e]),y=U.useMemo(()=>e.filter(e=>e.client.config.type===`claudeai-proxy`).sort((e,t)=>e.name.localeCompare(t.name)),[e]),b=U.useMemo(()=>(v.get(`dynamic`)??[]).sort((e,t)=>e.name.localeCompare(t.name)),[v]),x=B(`dynamic`),S=U.useMemo(()=>{let e=[];for(let t of G){let n=v.get(t)??[];for(let t of n)e.push({type:`server`,server:t})}for(let t of y)e.push({type:`server`,server:t});for(let n of t)e.push({type:`agent-server`,agentServer:n});for(let t of b)e.push({type:`server`,server:t});return e},[v,y,t,b]),w=(0,U.useCallback)(()=>{p(`MCP dialog dismissed`,{display:`system`})},[p]);a({"confirm:previous":()=>_(e=>e===0?S.length-1:e-1),"confirm:next":()=>_(e=>e===S.length-1?0:e+1),"confirm:yes":(0,U.useCallback)(()=>{let e=S[g];e&&(e.type===`server`?n(e.server):e.type===`agent-server`&&d&&d(e.agentServer))},[S,g,n,d]),"confirm:no":w},{context:`Confirmation`});let T=e=>S.findIndex(t=>t.type===`server`&&t.server===e),E=e=>S.findIndex(t=>t.type===`agent-server`&&t.agentServer===e),D=ee(),O=e.some(e=>e.client.type===`failed`);if(e.length===0&&t.length===0)return null;let k=e=>{let t=T(e),n=g===t,i=``,a=``;if(e.client.type===`disabled`)i=f(`inactive`,h)(r.radioOff),a=`disabled`;else if(e.client.type===`connected`)i=f(`success`,h)(r.tick),a=`connected`;else if(e.client.type===`pending`){i=f(`inactive`,h)(r.radioOff);let{reconnectAttempt:t,maxReconnectAttempts:n}=e.client;a=t&&n?`reconnecting (${t}/${n})…`:`connecting…`}else e.client.type===`needs-auth`?(i=f(`warning`,h)(r.triangleUpOutline),a=`needs authentication`):(i=f(`error`,h)(r.cross),a=`failed`);return(0,W.jsxs)(s,{children:[(0,W.jsx)(l,{color:n?`suggestion`:void 0,children:n?`${r.pointer} `:` `}),(0,W.jsx)(l,{color:n?`suggestion`:void 0,children:e.name}),(0,W.jsxs)(l,{dimColor:!n,children:[` · `,i,` `]}),(0,W.jsx)(l,{dimColor:!n,children:a})]},`${e.name}-${t}`)},A=e=>{let t=E(e),n=g===t,i=e.needsAuth?f(`warning`,h)(r.triangleUpOutline):f(`inactive`,h)(r.radioOff),a=e.needsAuth?`may need auth`:`agent-only`;return(0,W.jsxs)(s,{children:[(0,W.jsx)(l,{color:n?`suggestion`:void 0,children:n?`${r.pointer} `:` `}),(0,W.jsx)(l,{color:n?`suggestion`:void 0,children:e.name}),(0,W.jsxs)(l,{dimColor:!n,children:[` · `,i,` `]}),(0,W.jsx)(l,{dimColor:!n,children:a})]},`agent-${e.name}-${t}`)},j=e.length+t.length;return(0,W.jsxs)(s,{flexDirection:`column`,children:[(0,W.jsx)(N,{}),(0,W.jsx)(m,{title:`Manage MCP servers`,subtitle:`${j} ${te(j,`server`)}`,onCancel:w,hideInputGuide:!0,children:(0,W.jsxs)(s,{flexDirection:`column`,children:[G.map(e=>{let t=v.get(e);if(!t||t.length===0)return null;let n=B(e);return(0,W.jsxs)(s,{flexDirection:`column`,marginBottom:1,children:[(0,W.jsxs)(s,{paddingLeft:2,children:[(0,W.jsx)(l,{bold:!0,children:n.label}),n.path&&(0,W.jsxs)(l,{dimColor:!0,children:[` (`,n.path,`)`]})]}),t.map(e=>k(e))]},e)}),y.length>0&&(0,W.jsxs)(s,{flexDirection:`column`,marginBottom:1,children:[(0,W.jsx)(s,{paddingLeft:2,children:(0,W.jsx)(l,{bold:!0,children:`claude.ai`})}),y.map(e=>k(e))]}),t.length>0&&(0,W.jsxs)(s,{flexDirection:`column`,marginBottom:1,children:[(0,W.jsx)(s,{paddingLeft:2,children:(0,W.jsx)(l,{bold:!0,children:`Agent MCPs`})}),[...new Set(t.flatMap(e=>e.sourceAgents))].map(e=>(0,W.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,W.jsx)(s,{paddingLeft:2,children:(0,W.jsxs)(l,{dimColor:!0,children:[`@`,e]})}),t.filter(t=>t.sourceAgents.includes(e)).map(e=>A(e))]},e))]}),b.length>0&&(0,W.jsxs)(s,{flexDirection:`column`,marginBottom:1,children:[(0,W.jsxs)(s,{paddingLeft:2,children:[(0,W.jsx)(l,{bold:!0,children:x.label}),x.path&&(0,W.jsxs)(l,{dimColor:!0,children:[` (`,x.path,`)`]})]}),b.map(e=>k(e))]}),(0,W.jsxs)(s,{flexDirection:`column`,children:[O&&(0,W.jsx)(l,{dimColor:!0,children:D?`※ Error logs shown inline with --debug`:`※ Run claude --debug to see error logs`}),(0,W.jsxs)(l,{dimColor:!0,children:[(0,W.jsx)(c,{url:`https://code.workmate.com/docs/en/mcp`,children:`https://code.workmate.com/docs/en/mcp`}),` for help`]})]})]})}),(0,W.jsx)(s,{paddingX:1,children:(0,W.jsx)(l,{dimColor:!0,italic:!0,children:(0,W.jsxs)(u,{children:[(0,W.jsx)(i,{shortcut:`↑↓`,action:`navigate`}),(0,W.jsx)(i,{shortcut:`Enter`,action:`confirm`}),(0,W.jsx)(C,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]})}var U,W,G,de=e((()=>{n(),U=t(d(),1),p(),w(),g(),E(),O(),S(),ae(),W=h(),G=[`project`,`local`,`user`,`enterprise`]}));function K({onComplete:e}){let t=_(e=>e.mcp),n=_(e=>e.agentDefinitions),r=t.clients,[i,a]=q.useState({type:`list`}),[o,s]=q.useState([]),c=(0,q.useMemo)(()=>v(n.allAgents),[n.allAgents]),l=q.useMemo(()=>r.filter(e=>e.name!==`ide`).sort((e,t)=>e.name.localeCompare(t.name)),[r]);switch(q.useEffect(()=>{let e=!1;async function n(){let n=await Promise.all(l.map(async e=>{let n=e.config.scope,r=e.config.type===`sse`,i=e.config.type===`http`,a=e.config.type===`claudeai-proxy`,o;(r||i)&&(o=e.type===`connected`&&x(t.tools,e.name).length>0);let s={name:e.name,client:e,scope:n};return a?{...s,transport:`claudeai-proxy`,isAuthenticated:!1,config:e.config}:r?{...s,transport:`sse`,isAuthenticated:o,config:e.config}:i?{...s,transport:`http`,isAuthenticated:o,config:e.config}:{...s,transport:`stdio`,config:e.config}}));e||s(n)}return n(),()=>{e=!0}},[l,t.tools]),(0,q.useEffect)(()=>{o.length===0&&l.length>0||o.length===0&&c.length===0&&e("No MCP servers configured. Please run /doctor if this is unexpected. Otherwise, run `claude mcp --help` or visit https://code.workmate.com/docs/en/mcp to learn more.")},[o.length,l.length,c.length,e]),i.type){case`list`:return(0,J.jsx)(H,{servers:o,agentServers:c,onSelectServer:e=>a({type:`server-menu`,server:e}),onSelectAgentServer:e=>a({type:`agent-server-menu`,agentServer:e}),onComplete:e,defaultTab:i.defaultTab});case`server-menu`:{let n=x(t.tools,i.server.name),r=i.server.transport===`claudeai-proxy`?`claude.ai`:`Work Mate`;return i.server.transport===`stdio`?(0,J.jsx)(P,{server:i.server,serverToolsCount:n.length,onViewTools:()=>a({type:`server-tools`,server:i.server}),onCancel:()=>a({type:`list`,defaultTab:r}),onComplete:e}):(0,J.jsx)(F,{server:i.server,serverToolsCount:n.length,onViewTools:()=>a({type:`server-tools`,server:i.server}),onCancel:()=>a({type:`list`,defaultTab:r}),onComplete:e})}case`server-tools`:return(0,J.jsx)(I,{server:i.server,onSelectTool:(e,t)=>a({type:`server-tool-detail`,server:i.server,toolIndex:t}),onBack:()=>a({type:`server-menu`,server:i.server})});case`server-tool-detail`:{let e=x(t.tools,i.server.name)[i.toolIndex];return e?(0,J.jsx)(ue,{tool:e,server:i.server,onBack:()=>a({type:`server-tools`,server:i.server})}):(a({type:`server-tools`,server:i.server}),null)}case`agent-server-menu`:return(0,J.jsx)(L,{agentServer:i.agentServer,onCancel:()=>a({type:`list`,defaultTab:`Agents`}),onComplete:e})}}var q,J,fe=e((()=>{q=t(d(),1),g(),T(),z(),de(),oe(),le(),se(),ce(),J=h()})),pe=e((()=>{fe()}));function me({serverName:e,onComplete:t}){let[n]=o(),i=b(),a=j(),[c,u]=(0,Y.useState)(!0),[d,p]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{async function n(){try{if(!i.getState().mcp.clients.find(t=>t.name===e)){p(`MCP server "${e}" not found`),u(!1),t(`MCP server "${e}" not found`);return}switch((await a(e)).client.type){case`connected`:u(!1),t(`Successfully reconnected to ${e}`);break;case`needs-auth`:p(`${e} requires authentication`),u(!1),t(`${e} requires authentication.`);break;case`pending`:case`failed`:case`disabled`:p(`Failed to reconnect to ${e}`),u(!1),t(`Failed to reconnect to ${e}`);break}}catch(e){let n=e instanceof Error?e.message:String(e);p(n),u(!1),t(`Error: ${n}`)}}n()},[e,a,i,t]),c?(0,X.jsxs)(s,{flexDirection:`column`,gap:1,padding:1,children:[(0,X.jsxs)(l,{color:`text`,children:[`Reconnecting to `,(0,X.jsx)(l,{bold:!0,children:e})]}),(0,X.jsxs)(s,{children:[(0,X.jsx)(re,{}),(0,X.jsx)(l,{children:` Establishing connection to MCP server`})]})]}):d?(0,X.jsxs)(s,{flexDirection:`column`,gap:1,padding:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsxs)(l,{children:[f(`error`,n)(r.cross),` `]}),(0,X.jsxs)(l,{color:`error`,children:[`Failed to reconnect to `,e]})]}),(0,X.jsxs)(l,{dimColor:!0,children:[`Error: `,d]})]}):null}var Y,X,Z=e((()=>{n(),Y=t(d(),1),p(),A(),T(),M(),X=h()}));function he({action:e,target:t,onComplete:n}){let r=_(e=>e.mcp.clients),i=k(),a=(0,Q.useRef)(!1);return(0,Q.useEffect)(()=>{if(a.current)return;a.current=!0;let o=e===`enable`,s=r.filter(e=>e.name!==`ide`),c=t===`all`?s.filter(e=>o?e.type===`disabled`:e.type!==`disabled`):s.filter(e=>e.name===t);if(c.length===0){n(t===`all`?`All MCP servers are already ${o?`enabled`:`disabled`}`:`MCP server "${t}" not found`);return}for(let e of c)i(e.name);n(t===`all`?`${o?`Enabled`:`Disabled`} ${c.length} MCP server(s)`:`MCP server "${t}" ${o?`enabled`:`disabled`}`)},[e,t,r,i,n]),null}async function ge(e,t,n){if(n){let t=n.trim().split(/\s+/);if(t[0]===`no-redirect`)return(0,$.jsx)(K,{onComplete:e});if(t[0]===`reconnect`&&t[1])return(0,$.jsx)(me,{serverName:t.slice(1).join(` `),onComplete:e});if(t[0]===`enable`||t[0]===`disable`)return(0,$.jsx)(he,{action:t[0],target:t.length>1?t.slice(1).join(` `):`all`,onComplete:e})}return(0,$.jsx)(K,{onComplete:e})}var Q,$;e((()=>{Q=t(d(),1),pe(),Z(),A(),T(),$=h()}))();export{ge as call};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{i as n,o as r}from"./envUtils-QyzA_cFM.js";import{I as i,Lt as a,P as o,Wt as s,_ as c,ai as l,di as ee,fi as u,t as d,y as f}from"./src-BX54x08P.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{In as m,Nn as te,m as h,qr as g,y as _,zr as v}from"./settings-D4M13toi.js";import{Pt as y,q as b}from"./state-CXY-q5gr.js";import{Bh as x,Dy as S,Kl as C,dw as w,fc as T,ky as E,pc as ne,pw as D,ql as re,tb as O,wy as k,xu as ie,yu as A,zh as j}from"./loadAgentsDir-bmpKLPdG.js";import{n as M,t as N}from"./cwd-DrEEb4f5.js";import{I as P,N as F}from"./debug-2pVES-2G.js";import{C as I,T as L,b as ae}from"./config-Bio2EjUK.js";import{o as R,s as oe}from"./log-L1kqxa_P.js";import{n as se}from"./analytics-COpjZpvd.js";import{_ as ce,p as z}from"./startupProfiler-B9Qv2QGH.js";import{n as B,t as V}from"./useExitOnCtrlCDWithKeybindings-BT0nexZw.js";import{t as H}from"./select-CaxQ-BVq.js";import{r as U,t as W}from"./promptEditor-14TB3MYt.js";import{t as le}from"./CustomSelect-t4wXuXWH.js";import{homedir as ue}from"os";import{join as G,relative as de}from"path";import{mkdir as K,writeFile as fe}from"fs/promises";function pe(e){return v(e)!==null}var me=e((()=>{g()}));function he({onSelect:e,onCancel:t}){let r=(0,q.use)(S()),a=G(n(),`AGENTS.md`),l=G(b(),`AGENTS.md`),u=r.some(e=>e.path===a),d=r.some(e=>e.path===l),f=[...r.filter(e=>e.type!==`AutoMem`).map(e=>({...e,exists:!0})),...u?[]:[{path:a,type:`User`,content:``,exists:!1}],...d?[]:[{path:l,type:`Project`,content:``,exists:!1}]],p=new Map,m=f.map(e=>{let t=te(e.path),n=e.exists?``:` (new)`,r=e.parent?(p.get(e.parent)??0)+1:0;p.set(e.path,r);let i=r>0?` `.repeat(r-1):``,o;o=e.type===`User`&&!e.isNested&&e.path===a?`User memory`:e.type===`Project`&&!e.isNested&&e.path===l?`Project memory`:r>0?`${i}L ${t}${n}`:`${t}`;let s,c=pe(b());return s=e.type===`User`&&!e.isNested?`Saved in ~/.workmate/AGENTS.md`:e.type===`Project`&&!e.isNested&&e.path===l?`${c?`Checked in at`:`Saved in`} ./AGENTS.md`:e.parent?`@-imported`:e.isNested?`dynamically loaded`:``,{label:o,value:e.path,description:s}}),h=[],g=x(e=>e.agentDefinitions);if(L()){h.push({label:`Open auto-memory folder`,value:`${X}${ae()}`,description:``});for(let e of g.activeAgents)if(e.memory){let t=w(e.agentType,e.memory);h.push({label:`Open ${ee.bold(e.agentType)} agent memory`,value:`${X}${t}`,description:`${e.memory} scope`})}}m.push(...h);let v=Y&&m.some(e=>e.value===Y)?Y:m[0]?.value||``,[y,C]=(0,q.useState)(L),[T,E]=(0,q.useState)(ne),[D]=(0,q.useState)(L),O=x(e=>Object.values(e.tasks).some(e=>e.type===`dream`&&e.status===`running`)),[k,A]=(0,q.useState)(null);(0,q.useEffect)(()=>{D&&re().then(A)},[D,O]);let j=O?`running`:k===null?``:k===0?`never`:`last ran ${z(new Date(k))}`,[M,N]=(0,q.useState)(null),P=M!==null,F=+!!D;function I(){let e=!y;_(`userSettings`,{autoMemoryEnabled:e}),C(e)}function R(){let e=!T;_(`userSettings`,{autoDreamEnabled:e}),E(e)}return B(),s(`confirm:no`,t,{context:`Confirmation`}),s(`confirm:yes`,()=>{M===0?I():M===1&&R()},{context:`Confirmation`,isActive:P}),s(`select:next`,()=>{N(e=>e!==null&&e<F?e+1:null)},{context:`Select`,isActive:P}),s(`select:previous`,()=>{N(e=>e!==null&&e>0?e-1:e)},{context:`Select`,isActive:P}),(0,J.jsxs)(i,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(i,{flexDirection:`column`,marginBottom:1,children:[(0,J.jsx)(c,{isFocused:M===0,children:(0,J.jsxs)(o,{children:[`Auto-memory: `,y?`on`:`off`]})}),D&&(0,J.jsx)(c,{isFocused:M===1,styled:!1,children:(0,J.jsxs)(o,{color:M===1?`suggestion`:void 0,children:[`Auto-dream: `,T?`on`:`off`,j&&(0,J.jsxs)(o,{dimColor:!0,children:[` · `,j]}),!O&&T&&(0,J.jsx)(o,{dimColor:!0,children:` · /dream to run`})]})})]}),(0,J.jsx)(H,{defaultFocusValue:v,options:m,isDisabled:P,onChange:t=>{if(t.startsWith(X)){let e=t.slice(15);K(e,{recursive:!0}).catch(()=>{}).then(()=>ie(e));return}Y=t,e(t)},onCancel:t,onUpFromFirstItem:()=>N(F)})]})}var q,J,Y,X,ge=e((()=>{u(),q=t(l(),1),y(),V(),d(),O(),I(),se(),T(),C(),j(),D(),A(),E(),r(),m(),ce(),me(),h(),le(),J=p(),X=`__open_folder__`}));function _e(e){let t=ue(),n=N(),r=e.startsWith(t)?`~${e.slice(t.length)}`:null,i=e.startsWith(n)?`./${de(n,e)}`:null;return r&&i?r.length<=i.length?r:i:r||i||e}var ve=e((()=>{d(),M(),p()}));function ye({onDone:e}){let t=async t=>{try{t.includes(n())&&await K(n(),{recursive:!0});try{await fe(t,``,{encoding:`utf8`,flag:`wx`})}catch(e){if(F(e)!==`EEXIST`)throw e}await W(t);let r=`default`,i=``;process.env.VISUAL?(r=`$VISUAL`,i=process.env.VISUAL):process.env.EDITOR&&(r=`$EDITOR`,i=process.env.EDITOR);let a=r==="default"?``:`Using ${r}="${i}".`,o=a?`> ${a} To change editor, set $EDITOR or $VISUAL environment variable.`:`> To use a different editor, set the $EDITOR or $VISUAL environment variable.`;e(`Opened memory file at ${_e(t)}\n\n${o}`,{display:`system`})}catch(t){oe(t),e(`Error opening memory file: ${t}`)}},r=()=>{e(`Cancelled memory editing`,{display:`system`})};return(0,Q.jsx)(f,{title:`Memory`,onCancel:r,color:`remember`,children:(0,Q.jsxs)(i,{flexDirection:`column`,children:[(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(he,{onSelect:t,onCancel:r})}),(0,Q.jsx)(i,{marginTop:1,children:(0,Q.jsxs)(o,{dimColor:!0,children:[`Learn more: `,(0,Q.jsx)(a,{url:`https://code.workmate.com/docs/en/memory`})]})})]})})}var Z,Q,$;e((()=>{Z=t(l(),1),d(),ge(),ve(),E(),r(),P(),R(),U(),Q=p(),$=async e=>(k(),await S(),(0,Q.jsx)(ye,{onDone:e}))}))();export{$ as call};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as n,di as r,fi as i}from"./src-BX54x08P.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{AC as o,Bh as s,Hh as c,NC as l,PC as u,_S as d,ad as f,gS as p,id as m,jC as h,rd as g,wC as _,zh as v}from"./loadAgentsDir-bmpKLPdG.js";import{A as y,k as b,q as x}from"./log-L1kqxa_P.js";import{n as S}from"./analytics-COpjZpvd.js";import{C,E as w,T,f as E,h as D,i as O,w as k,y as A}from"./model-Dd3x121y.js";import{i as j,r as M}from"./switcher-rep86o4_.js";import{i as N,n as P,r as F,t as I}from"./extraUsage-CmgRR-zH.js";function L({onDone:e}){let t=s(e=>e.mainLoopModel),n=s(e=>e.mainLoopModelForSession),i=s(e=>e.fastMode),a=c();function o(){let n=U(t);e(`Kept model as ${r.bold(n)}`,{display:`system`})}async function d(t){a(e=>({...e,mainLoopModel:t,mainLoopModelForSession:null}));let n=`Set model to ${r.bold(U(t))}`,o;if(l()&&(_(),!u(t)&&i?(a(e=>({...e,fastMode:!1})),o=!1):u(t)&&h()&&i&&(n+=` · Fast mode ON`,o=!0)),P(t,o===!0,D())&&(n+=` · Billed as extra usage`),o===!1&&(n+=` · Fast mode OFF`),t){let e=await j(t);e.kind===`updated`&&(n+=` · Provider "${e.providerId}" default model updated`)}e(n)}return(0,G.jsx)(F,{initial:t,sessionModel:n,onSelect:d,onCancel:o,isStandaloneCommand:!0,showFastModeNotice:l()&&i&&u(t)&&h()})}function R({args:e,onDone:t}){let n=s(e=>e.fastMode),i=c(),a=e==="default"?null:e;return W.useEffect(()=>{async function e(){if(a&&!k(a)){t(`Model '${a}' is not available. Your organization restricts model selection.`,{display:`system`});return}if(a&&B(a)){t(`Opus 4.7 with 1M context is not available for your account. Learn more: https://code.workmate.com/docs/en/model-config#extended-context-with-1m`,{display:`system`});return}if(a&&V(a)){t(`Sonnet 4.6 with 1M context is not available for your account. Learn more: https://code.workmate.com/docs/en/model-config#extended-context-with-1m`,{display:`system`});return}if(!a){o(null);return}if(z(a)){await o(a);return}try{let{valid:e,error:n}=await d(a);e?await o(a):t(n||`Model '${a}' not found`,{display:`system`})}catch(e){t(`Failed to validate model: ${e.message}`,{display:`system`})}}async function o(e){i(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null}));let a=`Set model to ${r.bold(U(e))}`,o;if(l()&&(_(),!u(e)&&n?(i(e=>({...e,fastMode:!1})),o=!1):u(e)&&n&&(a+=` · Fast mode ON`,o=!0)),P(e,o===!0,D())&&(a+=` · Billed as extra usage`),o===!1&&(a+=` · Fast mode OFF`),e){let t=await j(e);t.kind===`updated`&&(a+=` · Provider "${t.providerId}" default model updated`)}t(a)}e()},[a,t,i]),null}function z(e){return T.includes(e.toLowerCase().trim())}function B(e){let t=e.toLowerCase();return!g()&&!D()&&t.includes(`opus`)&&t.includes(`[1m]`)}function V(e){let t=e.toLowerCase();return!m()&&(t.includes(`sonnet[1m]`)||t.includes(`sonnet-4-6[1m]`))}function H({onDone:e}){let t=s(e=>e.mainLoopModel),n=s(e=>e.mainLoopModelForSession),i=U(t);return e(n?`Current model: ${r.bold(U(n))} (session override from plan mode)\nBase model: ${i}`:`Current model: ${i}`),null}function U(e){let t=A(e??O());return e===null?`${t} (default)`:t}var W,G,K;e((()=>{i(),W=t(n(),1),N(),x(),S(),v(),I(),o(),w(),f(),E(),C(),p(),M(),G=a(),K=async(e,t,n)=>{if(n=n?.trim()||``,y.includes(n))return(0,G.jsx)(H,{onDone:e});if(b.includes(n)){e(`Run /model to open the model selection menu, or /model [modelName] to set the model.`,{display:`system`});return}return n?(0,G.jsx)(R,{args:n,onDone:e}):(0,G.jsx)(L,{onDone:e})}}))();export{K as call};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./memoize-BK3gG5ob.js";import{i,l as a,o,r as ee,t as s}from"./envUtils-QyzA_cFM.js";import{$t as c,Ni as te,Wi as ne,bn as l,d as u,ea as d,en as f,m as p,oa as re,t as m,ta as ie,vn as ae}from"./settings-D4M13toi.js";import{G as h,Pt as oe,Sn as se,U as ce,at as le,vr as ue,yr as de}from"./state-CXY-q5gr.js";import{C as fe,H as pe,U as me,c as g,i as he,o as _,x as ge}from"./debug-2pVES-2G.js";import{d as _e,o as ve}from"./config-Bio2EjUK.js";import{d as ye,f as be,o as xe,s as v}from"./log-L1kqxa_P.js";import{n as Se,o as Ce}from"./stringUtils-Cs6E5f-B.js";import{c as we,i as Te,r as Ee}from"./proxy--_NfbJhm.js";import{join as De}from"path";import{readFileSync as Oe}from"fs";import{randomUUID as ke}from"crypto";import{mkdir as Ae,writeFile as je}from"fs/promises";import{AsyncLocalStorage as Me}from"async_hooks";function y(e=m()){let t=e.modelType;return t===`openai`?`openai`:t===`gemini`?`gemini`:t===`grok`?`grok`:a(process.env.WORKMATE_USE_BEDROCK)?`bedrock`:a(process.env.WORKMATE_USE_VERTEX)?`vertex`:a(process.env.WORKMATE_USE_FOUNDRY)?`foundry`:a(process.env.WORKMATE_USE_OPENAI)?`openai`:a(process.env.WORKMATE_USE_GEMINI)?`gemini`:a(process.env.WORKMATE_USE_GROK)?`grok`:`firstParty`}function Ne(){return y()}function b(){let e=process.env.ANTHROPIC_BASE_URL;if(!e)return!0;try{return new URL(e).host===`api.anthropic.com`}catch{return!1}}var x=e((()=>{p(),o()}));function Pe(){return Ie.getStore()?.workload}function Fe(e,t){return Ie.run({workload:e},t)}var Ie,Le=e((()=>{Ie=new Me})),S,C,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye=e((()=>{S=`workmate-20250219`,C=`interleaved-thinking-2025-05-14`,Re=`context-1m-2025-08-07`,ze=`context-management-2025-06-27`,Be=`structured-outputs-2025-12-15`,Ve=`tool-search-tool-2025-10-19`,He=`task-budgets-2026-03-13`,Ue=`prompt-caching-scope-2026-01-05`,We=`fast-mode-2026-02-01`,Ge=`redact-thinking-2026-02-12`,Ke=`advisor-tool-2026-03-01`,qe=new Set([C,Re,Ve]),Je=new Set([S,C,ze])}));function Xe(e,t){return ue(e,t)}var Ze=e((()=>{de()}));function Qe(){let e=process.env.CLAUDE_AGENT_SDK_VERSION?`, agent-sdk/${process.env.CLAUDE_AGENT_SDK_VERSION}`:``,t=process.env.CLAUDE_AGENT_SDK_CLIENT_APP?`, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`:``,n=Pe(),r=n?`, workload/${n}`:``;return`claude-cli/0.0.28 (external, ${process.env.WORKMATE_ENTRYPOINT??`cli`}${e}${t}${r})`}function $e(){let e=[];return process.env.WORKMATE_ENTRYPOINT&&e.push(process.env.WORKMATE_ENTRYPOINT),process.env.CLAUDE_AGENT_SDK_VERSION&&e.push(`agent-sdk/${process.env.CLAUDE_AGENT_SDK_VERSION}`),process.env.CLAUDE_AGENT_SDK_CLIENT_APP&&e.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`),`workmate/0.0.28${e.length>0?` (${e.join(`, `)})`:``}`}var et=e((()=>{Le()}));function w(){return{error:(e,...t)=>console.error(`[SDK ERROR]`,e,...t),warn:(e,...t)=>console.error(`[SDK WARN]`,e,...t),info:(e,...t)=>console.error(`[SDK INFO]`,e,...t),debug:(e,...t)=>console.error(`[SDK DEBUG]`,e,...t)}}async function tt({apiKey:e,maxRetries:n,model:r,fetchOverride:i,source:o}){let c=process.env.WORKMATE_CONTAINER_ID,te=process.env.WORKMATE_REMOTE_SESSION_ID,ne=process.env.CLAUDE_AGENT_SDK_CLIENT_APP,l=nt(),u={"x-app":`cli`,"User-Agent":Qe(),"X-Work-Mate-Session-Id":le(),...l,...c?{"x-claude-remote-container-id":c}:{},...te?{"x-claude-remote-session-id":te}:{},...ne?{"x-client-app":ne}:{},...process.env.ANTHROPIC_AUTH_NONCE?{"x-auth-nonce":process.env.ANTHROPIC_AUTH_NONCE}:{}};g(`[API:request] Creating client, ANTHROPIC_CUSTOM_HEADERS present: ${!!process.env.ANTHROPIC_CUSTOM_HEADERS}, has Authorization header: ${!!l.Authorization}`),a(process.env.WORKMATE_ADDITIONAL_PROTECTION)&&(u[`x-anthropic-additional-protection`]=`true`);let d=rt(i,o),f={defaultHeaders:u,maxRetries:n,timeout:parseInt(process.env.API_TIMEOUT_MS||`600000`,10),dangerouslyAllowBrowser:!0,fetchOptions:Te({forAnthropicAPI:!0}),...d&&{fetch:d}};if(a(process.env.WORKMATE_USE_BEDROCK)){let{BedrockClient:e}=await import(`./bedrockClient-CfiDN-kF.js`),t=r===sn()&&process.env.ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION?process.env.ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:s(),n={...f,awsRegion:t,...a(process.env.WORKMATE_SKIP_BEDROCK_AUTH)&&{skipAuth:!0},..._()&&{logger:w()}};return process.env.AWS_BEARER_TOKEN_BEDROCK&&(n.skipAuth=!0,n.defaultHeaders={...n.defaultHeaders,Authorization:`Bearer ${process.env.AWS_BEARER_TOKEN_BEDROCK}`}),new e(n)}if(a(process.env.WORKMATE_USE_FOUNDRY)){let{AnthropicFoundry:e}=await import(`./foundry-sdk-BdeF2aBu.js`),t;if(!process.env.ANTHROPIC_FOUNDRY_API_KEY)if(a(process.env.WORKMATE_SKIP_FOUNDRY_AUTH))t=()=>Promise.resolve(``);else{let{DefaultAzureCredential:e,getBearerTokenProvider:n}=await import(`./esm-DUH16IqH.js`);t=n(new e,`https://cognitiveservices.azure.com/.default`)}return new e({...f,...t&&{azureADTokenProvider:t},..._()&&{logger:w()}})}if(a(process.env.WORKMATE_USE_VERTEX)){let[{AnthropicVertex:e},{GoogleAuth:n}]=await Promise.all([import(`./vertex-sdk-DjXcZ2J7.js`),import(`./src-C8gyNm5a.js`).then(e=>t(e.default,1))]),i=process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project,o=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials,s=a(process.env.WORKMATE_SKIP_VERTEX_AUTH)?{getClient:()=>({getRequestHeaders:()=>({})})}:new n({scopes:[`https://www.googleapis.com/auth/cloud-platform`],...i||o?{}:{projectId:process.env.ANTHROPIC_VERTEX_PROJECT_ID}});return new e({...f,region:ee(r),googleAuth:s,..._()&&{logger:w()}})}return new me({...e?{apiKey:e}:{},...f,..._()&&{logger:w()}})}function nt(){let e={},t=process.env.ANTHROPIC_CUSTOM_HEADERS;if(!t)return e;let n=t.split(/\n|\r\n/);for(let t of n){if(!t.trim())continue;let n=t.indexOf(`:`);if(n===-1)continue;let r=t.slice(0,n).trim(),i=t.slice(n+1).trim();r&&(e[r]=i)}return e}function rt(e,t){let n=e??globalThis.fetch,r=y()===`firstParty`&&b();return(e,i)=>{let a=new Headers(i?.headers);r&&!a.has(`x-client-request-id`)&&a.set(T,ke());try{let n=e instanceof Request?e.url:String(e),r=a.get(T);g(`[API REQUEST] ${new URL(n).pathname}${r?` ${T}=${r}`:``} source=${t??`unknown`}`)}catch{}return n(e,{...i,headers:a})}}var T,it=e((()=>{pe(),et(),$(),x(),we(),oe(),he(),o(),T=`x-client-request-id`}));function at(){return De(i(),`cache`)}function ot(){return De(at(),`model-capabilities.json`)}function st(){return!(y()!==`firstParty`||!b())}function ct(e){return[...e].sort((e,t)=>t.id.length-e.id.length||e.id.localeCompare(t.id))}function lt(e){if(!st())return;let t=E(ot());if(!t||t.length===0)return;let n=e.toLowerCase();return t.find(e=>e.id.toLowerCase()===n)||t.find(e=>n.includes(e.id.toLowerCase()))}async function ut(){if(st()&&!be())try{let e=await tt({maxRetries:1}),t=[];for await(let n of e.models.list()){let e=dt().safeParse(n);e.success&&t.push(e.data)}if(t.length===0)return;let n=ot(),r=ct(t);if(Xe(E(n),r)){g(`[modelCapabilities] cache unchanged, skipping write`);return}await Ae(at(),{recursive:!0}),await je(n,fe({models:r,timestamp:Date.now()}),{encoding:`utf-8`,mode:384}),E.cache.delete(n),g(`[modelCapabilities] cached ${r.length} models`)}catch(e){g(`[modelCapabilities] fetch failed: ${e instanceof Error?e.message:`unknown`}`)}}var dt,ft,E,pt=e((()=>{Ze(),r(),te(),it(),he(),o(),ae(),c(),ye(),ge(),x(),dt=f(()=>ie({id:re(),max_input_tokens:d().optional(),max_tokens:d().optional()}).strip()),ft=f(()=>ie({models:ne(dt()),timestamp:d()})),E=n(e=>{try{let t=Oe(e,`utf-8`),n=ft().safeParse(l(t,!1));return n.success?n.data.models:null}catch{return null}},e=>e)}));function D(){return a(process.env.WORKMATE_DISABLE_1M_CONTEXT)}function O(e){return!D()&&/\[1m\]/i.test(e)}function mt(e){if(D())return!1;let t=Z(e);return t.includes(`claude-sonnet-4`)||t.includes(`opus-4-6`)||t.includes(`opus-4-7`)}function ht(e,t){if(O(e))return 1e6;let n=lt(e);return n?.max_input_tokens&&n.max_input_tokens>=1e5?n.max_input_tokens>2e5&&D()?bt:n.max_input_tokens:t?.includes(`context-1m-2025-08-07`)&&mt(e)||gt(e)?1e6:bt}function gt(e){return D()||O(e)||!Z(e).includes(`sonnet-4-6`)?!1:ve().clientDataCache?.coral_reef_sonnet===`true`}function _t(e,t){if(!e)return{used:null,remaining:null};let n=e.input_tokens+e.cache_creation_input_tokens+e.cache_read_input_tokens;if(n===0)return{used:null,remaining:null};let r=Math.round(n/t*100),i=Math.min(100,Math.max(0,r));return{used:i,remaining:100-i}}function vt(e){let t,n,r=Z(e);r.includes(`opus-4-7`)||r.includes(`opus-4-6`)?(t=64e3,n=128e3):r.includes(`sonnet-4-6`)?(t=32e3,n=128e3):r.includes(`opus-4-5`)||r.includes(`sonnet-4`)||r.includes(`haiku-4`)?(t=32e3,n=64e3):r.includes(`opus-4-1`)||r.includes(`opus-4`)?(t=32e3,n=32e3):r.includes(`claude-3-opus`)?(t=4096,n=4096):r.includes(`claude-3-sonnet`)?(t=8192,n=8192):r.includes(`claude-3-haiku`)?(t=4096,n=4096):r.includes(`3-5-sonnet`)||r.includes(`3-5-haiku`)?(t=8192,n=8192):r.includes(`3-7-sonnet`)?(t=32e3,n=64e3):(t=St,n=Ct);let i=lt(e);return i?.max_tokens&&i.max_tokens>=4096&&(n=i.max_tokens,t=Math.min(t,n)),{default:t,upperLimit:n}}function yt(e){return vt(e).upperLimit-1}var bt,xt,St,Ct,wt,Tt=e((()=>{Ye(),_e(),o(),$(),pt(),bt=2e5,xt=2e4,St=32e3,Ct=64e3,wt=8e3}));function Et(e){let t=[],n=!1;async function r(){if(!n&&t.length!==0){for(n=!0;t.length>0;){let{args:n,resolve:r,reject:i,context:a}=t.shift();try{r(await e.apply(a,n))}catch(e){i(e)}}n=!1,t.length>0&&r()}}return function(...e){return new Promise((n,i)=>{t.push({args:e,resolve:n,reject:i,context:this}),r()})}}var Dt=e((()=>{}));function Ot(e,t){return e.find(e=>e.includes(t))??null}async function kt(){let{BedrockClient:e}=await import(`./dist-es-BXXmyhQ2.js`),t=s(),n=a(process.env.WORKMATE_SKIP_BEDROCK_AUTH);return new e({region:t,...process.env.ANTHROPIC_BEDROCK_BASE_URL&&{endpoint:process.env.ANTHROPIC_BEDROCK_BASE_URL},...await Ee(),...n&&{requestHandler:new(await(import(`./dist-es-C7vygWzp.js`))).NodeHttpHandler,httpAuthSchemes:[{schemeId:`smithy.api#noAuth`,identityProvider:()=>async()=>({}),signer:new(await(import(`./dist-es-gUzZ_7Vf.js`))).NoAuthSigner}],httpAuthSchemeProvider:()=>[{schemeId:`smithy.api#noAuth`}]}})}async function At(){let{BedrockRuntimeClient:e}=await import(`./dist-es-CzTYn7xo.js`),t=s(),n=a(process.env.WORKMATE_SKIP_BEDROCK_AUTH);return new e({region:t,...process.env.ANTHROPIC_BEDROCK_BASE_URL&&{endpoint:process.env.ANTHROPIC_BEDROCK_BASE_URL},...await Ee(),...n&&{requestHandler:new(await(import(`./dist-es-C7vygWzp.js`))).NodeHttpHandler,httpAuthSchemes:[{schemeId:`smithy.api#noAuth`,identityProvider:()=>async()=>({}),signer:new(await(import(`./dist-es-gUzZ_7Vf.js`))).NoAuthSigner}],httpAuthSchemeProvider:()=>[{schemeId:`smithy.api#noAuth`}]}})}function jt(e){return e.startsWith(`anthropic.`)}function Mt(e){if(!e.startsWith(`arn:`))return e;let t=e.lastIndexOf(`/`);return t===-1?e:e.substring(t+1)}function Nt(e){let t=Mt(e);for(let e of It)if(t.startsWith(`${e}.anthropic.`))return e}function Pt(e,t){let n=Nt(e);return n?e.replace(`${n}.`,`${t}.`):jt(e)?`${t}.${e}`:e}var k,Ft,It,Lt=e((()=>{r(),o(),xe(),we(),k=n(async()=>{let[e,{ListInferenceProfilesCommand:t}]=await Promise.all([kt(),import(`./dist-es-BXXmyhQ2.js`)]),n=[],r;try{do{let i=new t({...r&&{nextToken:r},typeEquals:`SYSTEM_DEFINED`}),a=await e.send(i);a.inferenceProfileSummaries&&n.push(...a.inferenceProfileSummaries),r=a.nextToken}while(r);return n.filter(e=>e.inferenceProfileId?.includes(`anthropic`)).map(e=>e.inferenceProfileId).filter(Boolean)}catch(e){throw v(e),e}}),Ft=n(async e=>{try{let[t,{GetInferenceProfileCommand:n}]=await Promise.all([kt(),import(`./dist-es-BXXmyhQ2.js`)]),r=new n({inferenceProfileIdentifier:e}),i=await t.send(r);if(!i.models||i.models.length===0)return null;let a=i.models[0];if(!a?.modelArn)return null;let o=a.modelArn.lastIndexOf(`/`);return o>=0?a.modelArn.substring(o+1):a.modelArn}catch(e){return v(e),null}}),It=[`us`,`eu`,`apac`,`global`]})),A,j,M,N,P,F,I,L,R,z,Rt,B,V,zt,Bt=e((()=>{A={firstParty:`claude-3-7-sonnet-20250219`,bedrock:`us.anthropic.claude-3-7-sonnet-20250219-v1:0`,vertex:`claude-3-7-sonnet@20250219`,foundry:`claude-3-7-sonnet`,openai:`claude-3-7-sonnet-20250219`,gemini:`claude-3-7-sonnet-20250219`,grok:`claude-3-7-sonnet-20250219`},j={firstParty:`claude-3-5-sonnet-20241022`,bedrock:`anthropic.claude-3-5-sonnet-20241022-v2:0`,vertex:`claude-3-5-sonnet-v2@20241022`,foundry:`claude-3-5-sonnet`,openai:`claude-3-5-sonnet-20241022`,gemini:`claude-3-5-sonnet-20241022`,grok:`claude-3-5-sonnet-20241022`},M={firstParty:`claude-3-5-haiku-20241022`,bedrock:`us.anthropic.claude-3-5-haiku-20241022-v1:0`,vertex:`claude-3-5-haiku@20241022`,foundry:`claude-3-5-haiku`,openai:`claude-3-5-haiku-20241022`,gemini:`claude-3-5-haiku-20241022`,grok:`claude-3-5-haiku-20241022`},N={firstParty:`claude-haiku-4-5-20251001`,bedrock:`us.anthropic.claude-haiku-4-5-20251001-v1:0`,vertex:`claude-haiku-4-5@20251001`,foundry:`claude-haiku-4-5`,openai:`claude-haiku-4-5-20251001`,gemini:`claude-haiku-4-5-20251001`,grok:`claude-haiku-4-5-20251001`},P={firstParty:`claude-sonnet-4-20250514`,bedrock:`us.anthropic.claude-sonnet-4-20250514-v1:0`,vertex:`claude-sonnet-4@20250514`,foundry:`claude-sonnet-4`,openai:`claude-sonnet-4-20250514`,gemini:`claude-sonnet-4-20250514`,grok:`claude-sonnet-4-20250514`},F={firstParty:`claude-sonnet-4-5-20250929`,bedrock:`us.anthropic.claude-sonnet-4-5-20250929-v1:0`,vertex:`claude-sonnet-4-5@20250929`,foundry:`claude-sonnet-4-5`,openai:`claude-sonnet-4-5-20250929`,gemini:`claude-sonnet-4-5-20250929`,grok:`claude-sonnet-4-5-20250929`},I={firstParty:`claude-opus-4-20250514`,bedrock:`us.anthropic.claude-opus-4-20250514-v1:0`,vertex:`claude-opus-4@20250514`,foundry:`claude-opus-4`,openai:`claude-opus-4-20250514`,gemini:`claude-opus-4-20250514`,grok:`claude-opus-4-20250514`},L={firstParty:`claude-opus-4-1-20250805`,bedrock:`us.anthropic.claude-opus-4-1-20250805-v1:0`,vertex:`claude-opus-4-1@20250805`,foundry:`claude-opus-4-1`,openai:`claude-opus-4-1-20250805`,gemini:`claude-opus-4-1-20250805`,grok:`claude-opus-4-1-20250805`},R={firstParty:`claude-opus-4-5-20251101`,bedrock:`us.anthropic.claude-opus-4-5-20251101-v1:0`,vertex:`claude-opus-4-5@20251101`,foundry:`claude-opus-4-5`,openai:`claude-opus-4-5-20251101`,gemini:`claude-opus-4-5-20251101`,grok:`claude-opus-4-5-20251101`},z={firstParty:`claude-opus-4-6`,bedrock:`us.anthropic.claude-opus-4-6-v1`,vertex:`claude-opus-4-6`,foundry:`claude-opus-4-6`,openai:`claude-opus-4-6`,gemini:`claude-opus-4-6`,grok:`claude-opus-4-6`},Rt={firstParty:`claude-opus-4-7`,bedrock:`us.anthropic.claude-opus-4-7-v1`,vertex:`claude-opus-4-7`,foundry:`claude-opus-4-7`,openai:`claude-opus-4-7`,gemini:`claude-opus-4-7`,grok:`claude-opus-4-7`},B={firstParty:`claude-sonnet-4-6`,bedrock:`us.anthropic.claude-sonnet-4-6`,vertex:`claude-sonnet-4-6`,foundry:`claude-sonnet-4-6`,openai:`claude-sonnet-4-6`,gemini:`claude-sonnet-4-6`,grok:`claude-sonnet-4-6`},V={haiku35:M,haiku45:N,sonnet35:j,sonnet37:A,sonnet40:P,sonnet45:F,sonnet46:B,opus40:I,opus41:L,opus45:R,opus46:z,opus47:Rt},Object.values(V).map(e=>e.firstParty),zt=Object.fromEntries(Object.entries(V).map(([e,t])=>[t.firstParty,e]))}));function H(e){let t={};for(let n of W)t[n]=V[n][e];return t}async function Vt(){let e=H(`bedrock`),t;try{t=await k()}catch(t){return v(t),e}if(!t?.length)return e;let n={};for(let r of W){let i=V[r].firstParty;n[r]=Ot(t,i)||e[r]}return n}function Ht(e){let t=m().modelOverrides;if(!t)return e;let n={...e};for(let[e,r]of Object.entries(t)){let t=zt[e];t&&r&&(n[t]=r)}return n}function Ut(e){let t;try{t=m().modelOverrides}catch{return e}if(!t)return e;for(let[n,r]of Object.entries(t))if(r===e)return n;return e}function Wt(){if(h()===null){if(y()!==`bedrock`){se(H(y()));return}Kt()}}function U(){let e=h();return e===null?(Wt(),Ht(H(y()))):Ht(e)}async function Gt(){if(h()===null){if(y()!==`bedrock`){se(H(y()));return}await Kt()}}var W,Kt,qt=e((()=>{oe(),xe(),Dt(),p(),Lt(),Bt(),x(),W=Object.keys(V),Kt=Et(async()=>{if(h()===null)try{se(await Vt())}catch(e){v(e)}})}));function G(e){return Jt.includes(e)}function K(e){return Yt.includes(e)}var Jt,Yt,Xt=e((()=>{Jt=[`sonnet`,`opus`,`haiku`,`best`,`sonnet[1m]`,`opus[1m]`,`opusplan`],Yt=[`sonnet`,`opus`,`haiku`]}));function Zt(e,t){return e.includes(t)?!0:G(e)?Q(e).toLowerCase().includes(t):!1}function Qt(e,t){return e.startsWith(t)?e.length===t.length||e[t.length]===`-`:!1}function $t(e,t){let n=G(e)?Q(e).toLowerCase():e;return!!(Qt(n,t)||!t.startsWith(`claude-`)&&Qt(n,`claude-${t}`))}function en(e,t){for(let n of t){if(K(n))continue;let t=n.indexOf(e);if(t===-1)continue;let r=t+e.length;if(r===n.length||n[r]===`-`)return!0}return!1}function tn(e){let{availableModels:t}=u()||{};if(!t)return!0;if(t.length===0)return!1;let n=Ut(e).trim().toLowerCase(),r=t.map(e=>e.trim().toLowerCase());if(r.includes(n)&&(!K(n)||!en(n,r)))return!0;for(let e of r)if(K(e)&&!en(e,r)&&Zt(n,e))return!0;if(G(n)){let e=Q(n).toLowerCase();if(r.includes(e))return!0}for(let e of r)if(!K(e)&&G(e)&&Q(e).toLowerCase()===n)return!0;for(let e of r)if(!K(e)&&!G(e)&&$t(n,e))return!0;return!1}var nn=e((()=>{p(),Xt(),$(),qt()}));function q(){return process.env.OPENAI_AUTH_MODE===`chatgpt`}var rn,an,on=e((()=>{rn=`gpt-5.5`,an=`gpt-5.4-mini`}));function sn(){let e=y();return e===`openai`&&q()?process.env.OPENAI_SMALL_FAST_MODEL??`gpt-5.4-mini`:e===`openai`&&process.env.OPENAI_SMALL_FAST_MODEL?process.env.OPENAI_SMALL_FAST_MODEL:e===`gemini`&&process.env.GEMINI_SMALL_FAST_MODEL?process.env.GEMINI_SMALL_FAST_MODEL:process.env.ANTHROPIC_SMALL_FAST_MODEL||fn()}function cn(e){return e===U().opus40||e===U().opus41||e===U().opus45||e===U().opus46||e===U().opus47}function J(){let e,t=ce();if(t!==void 0)e=t;else{let t=u()||{};e=process.env.ANTHROPIC_MODEL||t.model||void 0}if(!(e&&!tn(e)))return e}function ln(){let e=J();return e==null?hn():Q(e)}function un(){return Y()}function dn(){let e=y();if(e===`openai`)return process.env.OPENAI_MODEL;if(e===`gemini`)return process.env.GEMINI_MODEL;if(e===`grok`)return process.env.GROK_MODEL}function Y(){let e=y();return e===`openai`&&q()?rn:e===`openai`&&process.env.OPENAI_DEFAULT_OPUS_MODEL?process.env.OPENAI_DEFAULT_OPUS_MODEL:e===`gemini`&&process.env.GEMINI_DEFAULT_OPUS_MODEL?process.env.GEMINI_DEFAULT_OPUS_MODEL:process.env.ANTHROPIC_DEFAULT_OPUS_MODEL?process.env.ANTHROPIC_DEFAULT_OPUS_MODEL:dn()||U().opus47}function X(){let e=y();return e===`openai`&&q()?rn:e===`openai`&&process.env.OPENAI_DEFAULT_SONNET_MODEL?process.env.OPENAI_DEFAULT_SONNET_MODEL:e===`gemini`&&process.env.GEMINI_DEFAULT_SONNET_MODEL?process.env.GEMINI_DEFAULT_SONNET_MODEL:process.env.ANTHROPIC_DEFAULT_SONNET_MODEL?process.env.ANTHROPIC_DEFAULT_SONNET_MODEL:dn()||(e===`firstParty`?U().sonnet46:U().sonnet45)}function fn(){let e=y();return e===`openai`&&q()?an:e===`openai`&&process.env.OPENAI_DEFAULT_HAIKU_MODEL?process.env.OPENAI_DEFAULT_HAIKU_MODEL:e===`gemini`&&process.env.GEMINI_DEFAULT_HAIKU_MODEL?process.env.GEMINI_DEFAULT_HAIKU_MODEL:process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL?process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL:dn()||U().haiku45}function pn(e){let{permissionMode:t,mainLoopModel:n,exceeds200kTokens:r=!1}=e;return J()===`opusplan`&&t===`plan`&&!r?Y():J()===`haiku`&&t===`plan`?X():n}function mn(){return X()}function hn(){return Q(mn())}function gn(e){if(e=e.toLowerCase(),e.includes(`claude-opus-4-7`))return`claude-opus-4-7`;if(e.includes(`claude-opus-4-6`))return`claude-opus-4-6`;if(e.includes(`claude-opus-4-5`))return`claude-opus-4-5`;if(e.includes(`claude-opus-4-1`))return`claude-opus-4-1`;if(e.includes(`claude-opus-4`))return`claude-opus-4`;if(e.includes(`claude-sonnet-4-6`))return`claude-sonnet-4-6`;if(e.includes(`claude-sonnet-4-5`))return`claude-sonnet-4-5`;if(e.includes(`claude-sonnet-4`))return`claude-sonnet-4`;if(e.includes(`claude-haiku-4-5`))return`claude-haiku-4-5`;if(e.includes(`claude-3-7-sonnet`))return`claude-3-7-sonnet`;if(e.includes(`claude-3-5-sonnet`))return`claude-3-5-sonnet`;if(e.includes(`claude-3-5-haiku`))return`claude-3-5-haiku`;if(e.includes(`claude-3-opus`))return`claude-3-opus`;if(e.includes(`claude-3-sonnet`))return`claude-3-sonnet`;if(e.includes(`claude-3-haiku`))return`claude-3-haiku`;let t=e.match(/(claude-(\d+-\d+-)?\w+)/);return t?.[1]?t[1]:e}function Z(e){return gn(Ut(e))}function _n(e){return e===`opusplan`?`Opus 4.7 in plan mode, else Sonnet 4.6`:xn(Q(e))}function vn(){return!(D()||y()!==`firstParty`||!b())}function yn(e){return e===`opusplan`?`Opus Plan`:G(e)?Se(e):xn(e)}function bn(e){switch(e){case U().opus47:return`Opus 4.7`;case`${U().opus47}[1m]`:return`Opus 4.7 (1M context)`;case U().opus46:return`Opus 4.6`;case`${U().opus46}[1m]`:return`Opus 4.6 (1M context)`;case U().opus45:return`Opus 4.5`;case U().opus41:return`Opus 4.1`;case U().opus40:return`Opus 4`;case`${U().sonnet46}[1m]`:return`Sonnet 4.6 (1M context)`;case U().sonnet46:return`Sonnet 4.6`;case`${U().sonnet45}[1m]`:return`Sonnet 4.5 (1M context)`;case U().sonnet45:return`Sonnet 4.5`;case U().sonnet40:return`Sonnet 4`;case`${U().sonnet40}[1m]`:return`Sonnet 4 (1M context)`;case U().sonnet37:return`Sonnet 3.7`;case U().sonnet35:return`Sonnet 3.5`;case U().haiku45:return`Haiku 4.5`;case U().haiku35:return`Haiku 3.5`;default:return null}}function xn(e){return bn(e)||e}function Q(e){let t=e.trim(),n=t.toLowerCase(),r=O(n),i=r?n.replace(/\[1m]$/i,``).trim():n;if(G(i))switch(i){case`opusplan`:return X()+(r?`[1m]`:``);case`sonnet`:return X()+(r?`[1m]`:``);case`haiku`:return fn()+(r?`[1m]`:``);case`opus`:return Y()+(r?`[1m]`:``);case`best`:return un();default:}return y()===`firstParty`&&Cn(i)&&wn()?Y()+(r?`[1m]`:``):r?`${t.replace(/\[1m\]$/i,``).trim()}[1m]`:t}function Sn(e,t){return O(e)||!O(t)?e:mt(Q(e))?`${e}[1m]`:e}function Cn(e){return On.includes(e)}function wn(){return!a(process.env.WORKMATE_DISABLE_LEGACY_MODEL_REMAP)}function Tn(e){if(e===null)return`Default (${hn()})`;let t=Q(e);return e===t?t:`${e} (${t})`}function En(e){if(y()===`foundry`)return;let t=e.toLowerCase().includes(`[1m]`),n=Z(e);if(n.includes(`claude-opus-4-7`))return t?`Opus 4.7 (with 1M context)`:`Opus 4.7`;if(n.includes(`claude-opus-4-6`))return t?`Opus 4.6 (with 1M context)`:`Opus 4.6`;if(n.includes(`claude-opus-4-5`))return`Opus 4.5`;if(n.includes(`claude-opus-4-1`))return`Opus 4.1`;if(n.includes(`claude-opus-4`))return`Opus 4`;if(n.includes(`claude-sonnet-4-6`))return t?`Sonnet 4.6 (with 1M context)`:`Sonnet 4.6`;if(n.includes(`claude-sonnet-4-5`))return t?`Sonnet 4.5 (with 1M context)`:`Sonnet 4.5`;if(n.includes(`claude-sonnet-4`))return t?`Sonnet 4 (with 1M context)`:`Sonnet 4`;if(n.includes(`claude-3-7-sonnet`))return`Work Mate 3.7 Sonnet`;if(n.includes(`claude-3-5-sonnet`))return`Work Mate 3.5 Sonnet`;if(n.includes(`claude-haiku-4-5`))return`Haiku 4.5`;if(n.includes(`claude-3-5-haiku`))return`Work Mate 3.5 Haiku`}function Dn(e){return e.replace(/\[(1|2)m\]/gi,``)}var On,$=e((()=>{oe(),Tt(),o(),qt(),p(),x(),nn(),Xt(),Ce(),on(),On=[`claude-opus-4-20250514`,`claude-opus-4-1-20250805`,`claude-opus-4-0`,`claude-opus-4-1`]}));export{_t as $,M as A,Le as At,P as B,nn as C,Ge as Ct,Gt as D,S as Dt,Xt as E,Je as Et,R as F,b as Ft,Nt as G,Pt as H,z as I,jt as J,Ft as K,I as L,A as M,y as Mt,N,Ne as Nt,U as O,Ye as Ot,L as P,x as Pt,xt as Q,F as R,Sn as S,Ue as St,Jt as T,He as Tt,At as U,Bt as V,k as W,Et as X,Dt as Y,wt as Z,Dn as _,qe as _t,Y as a,Tt as at,xn as b,We as bt,En as c,ut as ct,J as d,it as dt,ht as et,$ as f,$e as ft,Tn as g,Ke as gt,vn as h,Xe as ht,mn as i,O as it,j,Fe as jt,qt as k,Pe as kt,pn as l,T as lt,cn as m,Ze as mt,Z as n,vt as nt,X as o,D as ot,wn as p,et as pt,Lt as q,hn as r,gt as rt,ln as s,pt as st,gn as t,yt as tt,sn as u,tt as ut,Q as v,Re as vt,tn as w,Be as wt,yn as x,C as xt,_n as y,ze as yt,B as z};
@@ -1,2 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,l as n,o as r}from"./envUtils-QyzA_cFM.js";import{$x as i,CS as a,ES as o,Ji as s,S_ as c,WS as l,Wx as u,bS as d,b_ as f,ca as p,dy as m,et as h,hy as g,rt as _,sy as v,ua as y,vy as b,wS as x,xS as S,x_ as C}from"./loadAgentsDir-bmpKLPdG.js";import{c as w,i as T}from"./debug-2pVES-2G.js";import{at as E,nt as D}from"./model-Dd3x121y.js";import{_n as O,bn as k,i as A,r as j,t as M,vn as N}from"./prompt-BnDapYGL.js";import{n as P,r as F}from"./client-2w-g5kMx.js";import{n as I,t as L}from"./openaiShared-G2-w4gJt.js";import{randomUUID as R}from"crypto";function z(e){if(t(process.env.OPENAI_ENABLE_THINKING))return!1;if(n(process.env.OPENAI_ENABLE_THINKING))return!0;let r=e.toLowerCase();return r.includes(`deepseek`)||r.includes(`mimo`)}function B(e,t){return t??(process.env.OPENAI_MAX_TOKENS&&parseInt(process.env.OPENAI_MAX_TOKENS,10)||void 0)??(process.env.WORKMATE_MAX_OUTPUT_TOKENS&&parseInt(process.env.WORKMATE_MAX_OUTPUT_TOKENS,10)||void 0)??e}function V(e){let{model:t,messages:n,tools:r,toolChoice:i,enableThinking:a,maxTokens:o,temperatureOverride:s}=e;return{model:t,messages:n,max_tokens:o,...r.length>0&&{tools:r,...i&&{tool_choice:i}},stream:!0,stream_options:{include_usage:!0},...a&&{thinking:{type:`enabled`},enable_thinking:!0,chat_template_kwargs:{thinking:!0,enable_thinking:!0}},...!a&&s!==void 0&&{temperature:s}}}var H=e((()=>{r()}));function U(e,t,n,r){if(!r||C())return e;let a=t.filter(e=>n.has(e.name)).map(M).sort().join(`
2
- `);return a?[i({content:`<available-deferred-tools>\n${a}\n</available-deferred-tools>`,isMeta:!0}),...e]:e}function W(e){return e.type===`assistant`||e.type===`user`}function G(e){let{partialMessage:t,contentBlocks:n,tools:r,agentId:i,usage:a,stopReason:o,maxTokens:s}=e,c=[],l=Object.keys(n).sort((e,t)=>Number(e)-Number(t)).map(e=>n[Number(e)]).filter(Boolean);return l.length>0&&t&&c.push({message:{...t,content:p(l,r,i),usage:a,stop_reason:o,stop_sequence:null},requestId:void 0,type:`assistant`,uuid:R(),timestamp:new Date().toISOString()}),o===`max_tokens`&&c.push(u({content:`Output truncated: response exceeded the ${s} token limit. Set OPENAI_MAX_TOKENS or WORKMATE_MAX_OUTPUT_TOKENS to override.`,apiError:`max_output_tokens`,error:`max_output_tokens`})),c}async function*K(e,t,n,r,i){try{let s=l(i.model),u=y(e,n),d=await c(i.model,n,i.getToolPermissionContext||(async()=>O()),i.agents||[],i.querySource),f=new Set;if(d)for(let e of n)A(e)&&f.add(e.name);let p=n;d&&f.size>0&&(p=n.filter(e=>!!(!f.has(e.name)||k(e,`SearchExtraTools`))));let m=(await Promise.all(p.map(e=>_(e,{getToolPermissionContext:i.getToolPermissionContext,tools:n,agents:i.agents,allowedAgentTypes:i.allowedAgentTypes,model:i.model,deferLoading:d&&f.has(e.name)})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),h=z(s),b=o(U(u.filter(W),n,f,d),t,{enableThinking:h}),C=x(m),T=a(i.toolChoice);if(d){let e=p.filter(e=>f.has(e.name)).length;w(`[OpenAI] Tool search enabled: ${e}/${f.size} deferred tools included, total tools=${C.length}`)}else w(`[OpenAI] Tool search disabled, total tools=${C.length}`);let{upperLimit:E}=D(s),j=B(E,i.maxOutputTokensOverride);w(`[OpenAI] Calling model=${s}, messages=${b.length}, tools=${C.length}, thinking=${h}`);let M=S(await P({maxRetries:0,fetchOverride:i.fetchOverride,source:i.querySource}).chat.completions.create(V({model:s,messages:b,tools:C,toolChoice:T,enableThinking:h,maxTokens:j,temperatureOverride:i.temperatureOverride}),{signal:r}),s),N={},F=null,L=null,R={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0},H=0,K=Date.now();for await(let e of M){switch(e.type){case`message_start`:F=e.message,H=Date.now()-K,e.message.usage&&(R={...R,...e.message.usage});break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?N[t]={...n,input:``}:n.type===`text`?N[t]={...n,text:``}:n.type===`thinking`?N[t]={...n,thinking:``,signature:``}:N[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=N[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.signature=n.signature);break}case`content_block_stop`:break;case`message_delta`:{let t=e.usage;t&&(R=I(R,t)),e.delta.stop_reason!=null&&(L=e.delta.stop_reason);break}case`message_stop`:if(F){for(let e of G({partialMessage:F,contentBlocks:N,tools:n,agentId:i.agentId,usage:R,stopReason:L,maxTokens:j}))yield e;F=null}R.input_tokens+R.output_tokens>0&&v(g(s,R),R,i.model);break}yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:H}:void 0}}if(F)for(let e of G({partialMessage:F,contentBlocks:N,tools:n,agentId:i.agentId,usage:R,stopReason:L,maxTokens:j}))yield e}catch(e){let t=e instanceof Error?e.message:String(e);w(`[OpenAI] Error: ${t}`,{level:`error`}),yield u({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{F(),L(),d(),s(),h(),N(),T(),m(),b(),H(),E(),f(),j()}))();export{K as queryModelOpenAI};
@@ -1 +0,0 @@
1
- import{i as e,r as t}from"./parser-CTnaXFVJ.js";t();export{e as parseCommand};
@@ -1,3 +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{I as i,P as a,Wt as o,Xn as s,a as c,ai as l,di as u,fi as d,hn as f,k as p,kt as m,n as h,o as ee,ot as g,r as te,s as ne,t as _,x as re,y as v}from"./src-BX54x08P.js";import{t as y}from"./jsx-runtime-Bb4Xn-E0.js";import{B as b,L as x,a as S,cn as C,m as w,mn as T,z as E}from"./settings-D4M13toi.js";import{Pt as D,q as O}from"./state-CXY-q5gr.js";import{Bh as ie,H as k,Hh as ae,I as oe,Ji as A,Jx as j,L as se,Mg as M,Ng as ce,R as le,V as ue,_m as N,aC as P,gm as F,kg as de,sC as fe,sb as I,tb as L,z as pe,zh as R}from"./loadAgentsDir-bmpKLPdG.js";import{C as z,x as me}from"./debug-2pVES-2G.js";import{l as B,o as he}from"./stringUtils-Cs6E5f-B.js";import{n as ge,t as _e}from"./useExitOnCtrlCDWithKeybindings-BT0nexZw.js";import{n as ve,t as ye}from"./TextInput-ou7ZhpVY.js";import{n as V,t as H}from"./select-CaxQ-BVq.js";import{n as be,t as xe}from"./AddWorkspaceDirectory-Bmgh8VS3.js";import{t as Se}from"./SearchBox-zA5QwIpO.js";import{n as Ce,t as we}from"./useSearchInput-j12K4wEo.js";import{n as Te,t as Ee}from"./shadowedRuleDetection-L3tnySui.js";function De(){return U}var U,Oe=e((()=>{U=[]}));function ke({ruleValue:e}){switch(e.toolName){case F.name:return e.ruleContent?e.ruleContent.endsWith(`:*`)?(0,W.jsxs)(a,{dimColor:!0,children:[`Any Bash command starting with `,(0,W.jsx)(a,{bold:!0,children:e.ruleContent.slice(0,-2)})]}):(0,W.jsxs)(a,{dimColor:!0,children:[`The Bash command `,(0,W.jsx)(a,{bold:!0,children:e.ruleContent})]}):(0,W.jsx)(a,{dimColor:!0,children:`Any Bash command`});default:return e.ruleContent?null:(0,W.jsxs)(a,{dimColor:!0,children:[`Any use of the `,(0,W.jsx)(a,{bold:!0,children:e.toolName}),` tool`]})}}var W,Ae=e((()=>{_(),N(),W=y()}));function je(e){switch(e){case`localSettings`:return{label:`Project settings (local)`,description:`Saved in ${S(`localSettings`)}`,value:e};case`projectSettings`:return{label:`Project settings`,description:`Checked in at ${S(`projectSettings`)}`,value:e};case`userSettings`:return{label:`User settings`,description:`Saved in at ~/.workmate/settings.json`,value:e}}}function Me({onAddRules:e,onCancel:t,ruleValues:n,ruleBehavior:r,initialContext:o,setToolPermissionContext:s}){let c=C.map(je),l=(0,Ne.useCallback)(i=>{if(i===`cancel`){t();return}else if(C.includes(i)){let t=i,a=de(o,{type:`addRules`,rules:n,behavior:r,destination:t});ce({type:`addRules`,rules:n,behavior:r,destination:t}),s(a);let c=n.map(e=>({ruleValue:e,ruleBehavior:r,source:t})),l=Ee(a,{sandboxAutoAllowEnabled:P.isSandboxingEnabled()&&P.isAutoAllowBashIfSandboxedEnabled()}).filter(e=>n.some(t=>t.toolName===e.rule.ruleValue.toolName&&t.ruleContent===e.rule.ruleValue.ruleContent));e(c,l.length>0?l:void 0)}},[e,t,n,r,o,s]);return(0,G.jsxs)(v,{title:`Add ${r} permission ${B(n.length,`rule`)}`,onCancel:t,color:`permission`,children:[(0,G.jsx)(i,{flexDirection:`column`,paddingX:2,children:n.map(e=>(0,G.jsxs)(i,{flexDirection:`column`,children:[(0,G.jsx)(a,{bold:!0,children:b(e)}),(0,G.jsx)(ke,{ruleValue:e})]},b(e)))}),(0,G.jsxs)(i,{flexDirection:`column`,marginY:1,children:[(0,G.jsx)(a,{children:n.length===1?`Where should this rule be saved?`:`Where should these rules be saved?`}),(0,G.jsx)(H,{options:c,onChange:l})]})]})}var Ne,G,Pe=e((()=>{Ne=t(l(),1),V(),_(),M(),x(),Te(),fe(),T(),w(),he(),Ae(),G=y()}));function Fe({onCancel:e,onSubmit:t,ruleBehavior:n}){let[s,c]=(0,Ie.useState)(``),[l,u]=(0,Ie.useState)(0),d=ge();o(`confirm:no`,e,{context:`Settings`});let{columns:f}=g(),p=f-6;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(i,{flexDirection:`column`,gap:1,borderStyle:`round`,paddingLeft:1,paddingRight:1,borderColor:`permission`,children:[(0,K.jsxs)(a,{bold:!0,color:`permission`,children:[`Add `,n,` permission rule`]}),(0,K.jsxs)(i,{flexDirection:`column`,children:[(0,K.jsxs)(a,{children:[`Permission rules are a tool name, optionally followed by a specifier in parentheses.`,(0,K.jsx)(m,{}),`e.g., `,(0,K.jsx)(a,{bold:!0,children:b({toolName:F.name})}),(0,K.jsx)(a,{bold:!1,children:` or `}),(0,K.jsx)(a,{bold:!0,children:b({toolName:F.name,ruleContent:`ls:*`})})]}),(0,K.jsx)(i,{borderDimColor:!0,borderStyle:`round`,marginY:1,paddingLeft:1,children:(0,K.jsx)(ye,{showCursor:!0,value:s,onChange:c,onSubmit:e=>{let r=e.trim();r.length!==0&&t(E(r),n)},placeholder:`Enter permission rule${r.ellipsis}`,columns:p,cursorOffset:l,onChangeCursorOffset:u})})]})]}),(0,K.jsx)(i,{marginLeft:3,children:d.pending?(0,K.jsxs)(a,{dimColor:!0,children:[`Press `,d.keyName,` again to exit`]}):(0,K.jsx)(a,{dimColor:!0,children:`Enter to submit · Esc to cancel`})})]})}var Ie,K,Le=e((()=>{n(),Ie=t(l(),1),ve(),_e(),I(),_(),L(),N(),x(),K=y()}));function Re({onHeaderFocusChange:e,onStateChange:t}){let{headerFocused:n,focusHeader:r}=c();(0,q.useEffect)(()=>{e?.(n)},[n,e]);let[o]=(0,q.useState)(()=>De()),[s,l]=(0,q.useState)(()=>new Set),[u,d]=(0,q.useState)(()=>new Set),[p,m]=(0,q.useState)(0);(0,q.useEffect)(()=>{t({approved:s,retry:u,denials:o})},[s,u,o,t]);let h=(0,q.useCallback)(e=>{let t=Number(e);l(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),ee=(0,q.useCallback)(e=>{m(Number(e))},[]);if(f((e,t)=>{e===`r`&&(d(e=>{let t=new Set(e);return t.has(p)?t.delete(p):t.add(p),t}),l(e=>{if(e.has(p))return e;let t=new Set(e);return t.add(p),t}))},{isActive:o.length>0}),o.length===0)return(0,J.jsx)(a,{dimColor:!0,children:`No recent denials. Commands denied by the auto mode classifier will appear here.`});let g=o.map((e,t)=>{let n=s.has(t),r=u.has(t)?` (retry)`:``;return{label:(0,J.jsxs)(a,{children:[(0,J.jsx)(ne,{status:n?`success`:`error`,withSpace:!0}),e.display,(0,J.jsx)(a,{dimColor:!0,children:r})]}),value:String(t)}});return(0,J.jsxs)(i,{flexDirection:`column`,children:[(0,J.jsx)(a,{children:`Commands recently denied by the auto mode classifier.`}),(0,J.jsx)(i,{marginTop:1,children:(0,J.jsx)(H,{options:g,onChange:h,onFocus:ee,visibleOptionCount:Math.min(10,g.length),isDisabled:n,onUpFromFirstItem:r})})]})}var q,J,ze=e((()=>{q=t(l(),1),_(),Oe(),V(),J=y()}));function Be({directoryPath:e,onRemove:t,onCancel:n,permissionContext:r,setPermissionContext:o}){let s=(0,Ve.useCallback)(()=>{o(de(r,{type:`removeDirectories`,directories:[e],destination:`session`})),t()},[e,r,o,t]),c=(0,Ve.useCallback)(e=>{e===`yes`?s():n()},[s,n]);return(0,Y.jsxs)(v,{title:`Remove directory from workspace?`,onCancel:n,color:`error`,children:[(0,Y.jsx)(i,{marginX:2,flexDirection:`column`,children:(0,Y.jsx)(a,{bold:!0,children:e})}),(0,Y.jsx)(a,{children:`Work Mate will no longer have access to files in this directory.`}),(0,Y.jsx)(H,{onChange:c,onCancel:n,options:[{label:`Yes`,value:`yes`},{label:`No`,value:`no`}]})]})}var Ve,Y,He=e((()=>{Ve=t(l(),1),V(),_(),M(),Y=y()}));function Ue({onExit:e,toolPermissionContext:t,onRequestAddDirectory:n,onRequestRemoveDirectory:o,onHeaderFocusChange:s}){let{headerFocused:l,focusHeader:u}=c();(0,X.useEffect)(()=>{s?.(l)},[l,s]);let d=We.useMemo(()=>Array.from(t.additionalWorkingDirectories.keys()).map(e=>({path:e,isCurrent:!1,isDeletable:!0})),[t.additionalWorkingDirectories]),f=(0,X.useCallback)(e=>{if(e===`add-directory`){n();return}let t=d.find(t=>t.path===e);t?.isDeletable&&o(t.path)},[d,n,o]),p=(0,X.useCallback)(()=>e(`Workspace dialog dismissed`,{display:`system`}),[e]),m=We.useMemo(()=>{let e=d.map(e=>({label:e.path,value:e.path}));return e.push({label:`Add directory${r.ellipsis}`,value:`add-directory`}),e},[d]);return(0,Z.jsxs)(i,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(i,{flexDirection:`row`,marginTop:1,marginLeft:2,gap:1,children:[(0,Z.jsx)(a,{children:`- ${O()}`}),(0,Z.jsx)(a,{dimColor:!0,children:`(Original working directory)`})]}),(0,Z.jsx)(H,{options:m,onChange:f,onCancel:p,visibleOptionCount:Math.min(10,m.length),onUpFromFirstItem:u,isDisabled:l})]})}var We,X,Z,Ge=e((()=>{n(),We=t(l(),1),X=t(l(),1),D(),V(),_(),Z=y()}));function Ke({rule:e}){return(0,$.jsx)(a,{dimColor:!0,children:`From ${k(e.source)}`})}function qe(e){switch(e){case`allow`:return`allowed`;case`deny`:return`denied`;case`ask`:return`ask`}}function Je({rule:e,onDelete:t,onCancel:n}){let r=ge();o(`confirm:no`,n,{context:`Confirmation`});let s=(0,$.jsxs)(i,{flexDirection:`column`,marginX:2,children:[(0,$.jsx)(a,{bold:!0,children:b(e.ruleValue)}),(0,$.jsx)(ke,{ruleValue:e.ruleValue}),(0,$.jsx)(Ke,{rule:e})]}),c=(0,$.jsx)(i,{marginLeft:3,children:r.pending?(0,$.jsxs)(a,{dimColor:!0,children:[`Press `,r.keyName,` again to exit`]}):(0,$.jsx)(a,{dimColor:!0,children:`Esc to cancel`})});return e.source===`policySettings`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(i,{flexDirection:`column`,gap:1,borderStyle:`round`,paddingLeft:1,paddingRight:1,borderColor:`permission`,children:[(0,$.jsx)(a,{bold:!0,color:`permission`,children:`Rule details`}),s,(0,$.jsxs)(a,{italic:!0,children:[`This rule is configured by managed settings and cannot be modified.`,`
2
- `,`Contact your system administrator for more information.`]})]}),c]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(i,{flexDirection:`column`,gap:1,borderStyle:`round`,paddingLeft:1,paddingRight:1,borderColor:`error`,children:[(0,$.jsxs)(a,{bold:!0,color:`error`,children:[`Delete `,qe(e.ruleBehavior),` tool?`]}),s,(0,$.jsx)(a,{children:`Are you sure you want to delete this permission rule?`}),(0,$.jsx)(H,{onChange:e=>e===`yes`?t():n(),onCancel:n,options:[{label:`Yes`,value:`yes`},{label:`No`,value:`no`}]})]}),c]})}function Ye(e){let{options:t,searchQuery:n,isSearchMode:r,isFocused:a,onSelect:o,onCancel:s,lastFocusedRuleKey:l,cursorOffset:u,onHeaderFocusChange:d}=e,f=ee(),{headerFocused:m,focusHeader:h,blurHeader:g}=c();return(0,Q.useEffect)(()=>{r&&m&&g()},[r,m,g]),(0,Q.useEffect)(()=>{d?.(m)},[m,d]),(0,$.jsxs)(i,{flexDirection:`column`,children:[(0,$.jsx)(i,{marginBottom:1,flexDirection:`column`,children:(0,$.jsx)(p,{query:n,isFocused:r&&!m,isTerminalFocused:a,width:f,cursorOffset:u})}),(0,$.jsx)(H,{options:t,onChange:o,onCancel:s,visibleOptionCount:Math.min(10,t.length),isDisabled:r||m,defaultFocusValue:l,onUpFromFirstItem:h})]})}function Xe({tab:e,getRulesOptions:t,handleToolSelect:n,...r}){return(0,$.jsxs)(i,{flexDirection:`column`,flexShrink:e===`allow`?0:void 0,children:[(0,$.jsx)(a,{children:{allow:`Work Mate won't ask before using allowed tools.`,ask:`Work Mate will always ask for confirmation before using these tools.`,deny:`Work Mate will always reject requests to use denied tools.`}[e]}),(0,$.jsx)(Ye,{options:t(e,r.searchQuery).options,onSelect:t=>n(t,e),...r})]})}function Ze({onExit:e,initialTab:t,onRetryDenials:n}){let c=De().length>0,l=t??(c?`recent`:`allow`),[d,f]=(0,Q.useState)([]),p=ie(e=>e.toolPermissionContext),m=ae(),ee=s(),g=(0,Q.useRef)({approved:new Set,retry:new Set,denials:[]}),ne=(0,Q.useCallback)(e=>{g.current=e},[]),[_,v]=(0,Q.useState)(),[y,x]=(0,Q.useState)(),[S,C]=(0,Q.useState)(null),[w,T]=(0,Q.useState)(null),[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(null),[A,j]=(0,Q.useState)(!1),[M,ue]=(0,Q.useState)(!0),N=(0,Q.useCallback)(e=>{ue(e)},[]),P=(0,Q.useMemo)(()=>{let e=new Map;return se(p).forEach(t=>{e.set(z(t),t)}),e},[p]),F=(0,Q.useMemo)(()=>{let e=new Map;return pe(p).forEach(t=>{e.set(z(t),t)}),e},[p]),fe=(0,Q.useMemo)(()=>{let e=new Map;return le(p).forEach(t=>{e.set(z(t),t)}),e},[p]),I=(0,Q.useCallback)((e,t=``)=>{let n=(()=>{switch(e){case`allow`:return P;case`deny`:return F;case`ask`:return fe;case`workspace`:case`recent`:return new Map}})(),i=[];e!==`workspace`&&e!==`recent`&&!t&&i.push({label:`Add a new rule${r.ellipsis}`,value:`add-new-rule`});let a=Array.from(n.keys()).sort((e,t)=>{let r=n.get(e),i=n.get(t);if(r&&i){let e=b(r.ruleValue).toLowerCase(),t=b(i.ruleValue).toLowerCase();return e.localeCompare(t)}return 0}),o=t.toLowerCase();for(let e of a){let r=n.get(e);if(r){let n=b(r.ruleValue);if(t&&!n.toLowerCase().includes(o))continue;i.push({label:n,value:e})}}return{options:i,rulesByKey:n}},[P,F,fe]),L=ge(),R=!_&&!S&&!w&&!E&&!O,{query:me,setQuery:B,cursorOffset:he}=Ce({isActive:R&&A,onExit:()=>{j(!1)}}),_e=(0,Q.useCallback)(e=>{R&&(A||e.ctrl||e.meta||(e.key===`/`?(e.preventDefault(),j(!0),B(``)):e.key.length===1&&e.key!==`j`&&e.key!==`k`&&e.key!==`m`&&e.key!==`i`&&e.key!==`r`&&e.key!==` `&&(e.preventDefault(),j(!0),B(e.key))))},[R,A,B]),ve=(0,Q.useCallback)((e,t)=>{let{rulesByKey:n}=I(t);if(e===`add-new-rule`){C(t);return}else{v(n.get(e));return}},[I]),ye=(0,Q.useCallback)(()=>{C(null)},[]),V=(0,Q.useCallback)((e,t)=>{T({ruleValue:e,ruleBehavior:t}),C(null)},[]),H=(0,Q.useCallback)((e,t)=>{T(null);for(let t of e)f(e=>[...e,`Added ${t.ruleBehavior} rule ${u.bold(b(t.ruleValue))}`]);if(t&&t.length>0)for(let e of t){let t=e.shadowType===`deny`?`blocked`:`shadowed`;f(n=>[...n,u.yellow(`${r.warning} Warning: ${b(e.rule.ruleValue)} is ${t}`),u.dim(` ${e.reason}`),u.dim(` Fix: ${e.fix}`)])}},[]),be=(0,Q.useCallback)(()=>{T(null)},[]),Se=(0,Q.useCallback)(()=>D(!0),[]),we=(0,Q.useCallback)(e=>k(e),[]),Te=(0,Q.useCallback)(()=>{let t=g.current,r=e=>Array.from(e).map(e=>t.denials[e]).filter(e=>e!==void 0),i=r(t.retry);if(i.length>0){let t=i.map(e=>e.display);n?.(t),e(void 0,{shouldQuery:!0,metaMessages:[`Permission granted for: ${t.join(`, `)}. You may now retry ${t.length===1?`this command`:`these commands`} if you would like.`]});return}let a=r(t.approved);a.length>0||d.length>0?e([...a.length>0?[`Approved ${a.map(e=>u.bold(e.display)).join(`, `)}`]:[],...d].join(`
3
- `)):e(`Permissions dialog dismissed`,{display:`system`})},[d,e,n]);o(`confirm:no`,Te,{context:`Settings`,isActive:R&&!A});let Ee=()=>{if(!_)return;let{options:e}=I(_.ruleBehavior),t=z(_),n=e.filter(e=>e.value!==`add-new-rule`).map(e=>e.value),r=n.indexOf(t),i;r!==-1&&(r<n.length-1?i=n[r+1]:r>0&&(i=n[r-1])),x(i),oe({rule:_,initialContext:p,setToolPermissionContext(e){m(t=>({...t,toolPermissionContext:e}))}}),f(e=>[...e,`Deleted ${_.ruleBehavior} rule ${u.bold(b(_.ruleValue))}`]),v(void 0)};if(_)return(0,$.jsx)(Je,{rule:_,onDelete:Ee,onCancel:()=>v(void 0)});if(S&&S!==`workspace`&&S!==`recent`)return(0,$.jsx)(Fe,{onCancel:ye,onSubmit:V,ruleBehavior:S});if(w)return(0,$.jsx)(Me,{onAddRules:H,onCancel:be,ruleValues:[w.ruleValue],ruleBehavior:w.ruleBehavior,initialContext:p,setToolPermissionContext:e=>{m(t=>({...t,toolPermissionContext:e}))}});if(E)return(0,$.jsx)(xe,{onAddDirectory:(e,t)=>{let n={type:`addDirectories`,directories:[e],destination:t?`localSettings`:`session`},r=de(p,n);m(e=>({...e,toolPermissionContext:r})),t&&ce(n),f(n=>[...n,`Added directory ${u.bold(e)} to workspace${t?` and saved to local settings`:` for this session`}`]),D(!1)},onCancel:()=>D(!1),permissionContext:p});if(O)return(0,$.jsx)(Be,{directoryPath:O,onRemove:()=>{f(e=>[...e,`Removed directory ${u.bold(O)} from workspace`]),k(null)},onCancel:()=>k(null),permissionContext:p,setPermissionContext:e=>{m(t=>({...t,toolPermissionContext:e}))}});let U={searchQuery:me,isSearchMode:A,isFocused:ee,onCancel:Te,lastFocusedRuleKey:y,cursorOffset:he,getRulesOptions:I,handleToolSelect:ve,onHeaderFocusChange:N};return(0,$.jsx)(i,{flexDirection:`column`,onKeyDown:_e,children:(0,$.jsxs)(re,{color:`permission`,children:[(0,$.jsxs)(te,{title:`Permissions:`,color:`permission`,defaultTab:l,hidden:!!_||!!S||!!w||E||!!O,initialHeaderFocused:!c,navFromContent:!A,children:[(0,$.jsx)(h,{id:`recent`,title:`Recently denied`,children:(0,$.jsx)(Re,{onHeaderFocusChange:N,onStateChange:ne})}),(0,$.jsx)(h,{id:`allow`,title:`Allow`,children:(0,$.jsx)(Xe,{tab:`allow`,...U})}),(0,$.jsx)(h,{id:`ask`,title:`Ask`,children:(0,$.jsx)(Xe,{tab:`ask`,...U})}),(0,$.jsx)(h,{id:`deny`,title:`Deny`,children:(0,$.jsx)(Xe,{tab:`deny`,...U})}),(0,$.jsx)(h,{id:`workspace`,title:`Workspace`,children:(0,$.jsxs)(i,{flexDirection:`column`,children:[(0,$.jsx)(a,{children:`Work Mate can read files in the workspace, and make edits when auto-accept edits is on.`}),(0,$.jsx)(Ue,{onExit:e,toolPermissionContext:p,onRequestAddDirectory:Se,onRequestRemoveDirectory:we,onHeaderFocusChange:N})]})})]}),(0,$.jsx)(i,{marginTop:1,paddingLeft:1,children:(0,$.jsx)(a,{dimColor:!0,children:L.pending?(0,$.jsxs)($.Fragment,{children:[`Press `,L.keyName,` again to exit`]}):M?(0,$.jsx)($.Fragment,{children:`←/→ tab switch · ↓ return · Esc cancel`}):A?(0,$.jsx)($.Fragment,{children:`Type to filter · Enter/↓ select · ↑ tabs · Esc clear`}):c&&l===`recent`?(0,$.jsx)($.Fragment,{children:`Enter approve · r retry · ↑↓ navigate · ←/→ switch · Esc cancel`}):(0,$.jsx)($.Fragment,{children:`↑↓ navigate · Enter select · Type to search · ←/→ switch · Esc cancel`})})})]})})}var Q,$,Qe=e((()=>{d(),n(),Q=t(l(),1),R(),M(),V(),_e(),we(),_(),L(),Oe(),x(),ue(),me(),Se(),Pe(),be(),Ae(),Le(),ze(),He(),Ge(),$=y()})),$e,et;e((()=>{Qe(),A(),$e=y(),et=async(e,t)=>(0,$e.jsx)(Ze,{onExit:e,onRetryDenials:e=>{t.setMessages(t=>[...t,j(e)])}})}))();export{et as call};