@readmagic/workmate 0.0.28 → 0.0.29

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 (240) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-Bmgh8VS3.js → AddWorkspaceDirectory-C0lrhffT.js} +1 -1
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-DIahWLha.js +1 -0
  3. package/dist/chunks/{AgentsMdExternalIncludesDialog-BJfHqScU.js → AgentsMdExternalIncludesDialog-Dmjjx4ql.js} +1 -1
  4. package/dist/chunks/App-COz7knHS.js +1 -0
  5. package/dist/chunks/{BackgroundTasksDialog-WkoL4g5Q.js → BackgroundTasksDialog-5IkCQ8lN.js} +2 -2
  6. package/dist/chunks/{BypassPermissionsModeDialog-BT9yl0Qt.js → BypassPermissionsModeDialog-g1FMGfQF.js} +1 -1
  7. package/dist/chunks/{CustomSelect-t4wXuXWH.js → CustomSelect-BsEd2To5.js} +1 -1
  8. package/dist/chunks/{DiffDialog-CXZxnb7Y.js → DiffDialog-Cwf8CdxZ.js} +5 -5
  9. package/dist/chunks/Doctor-CcLoI7tF.js +1 -0
  10. package/dist/chunks/Doctor-GmT5aeAc.js +3 -0
  11. package/dist/chunks/ExitFlow-DPgUFqeC.js +2 -0
  12. package/dist/chunks/{InvalidConfigDialog-riLYEaUP.js → InvalidConfigDialog-Di6HZYDV.js} +1 -1
  13. package/dist/chunks/{InvalidSettingsDialog-BGXl3V1A.js → InvalidSettingsDialog-BHL-MERJ.js} +1 -1
  14. package/dist/chunks/{KeybindingProviderSetup-syiDgtpB.js → KeybindingProviderSetup-eE3o0bfp.js} +1 -1
  15. package/dist/chunks/MCPConnectionManager-D-qpUJLV.js +1 -0
  16. package/dist/chunks/MCPToolListView-DtHRw4jQ.js +1 -0
  17. package/dist/chunks/{McpParsingWarnings-Czze2JPd.js → McpParsingWarnings-ByyErvR3.js} +1 -1
  18. package/dist/chunks/MessageSelector-CFz30wBL.js +3 -0
  19. package/dist/chunks/Messages-CfY-Oj3M.js +10 -0
  20. package/dist/chunks/{Onboarding-CD_Uv5h9.js → Onboarding-BfWLRx3n.js} +1 -1
  21. package/dist/chunks/{PromptInputFooterSuggestions-CHXJsTtQ.js → PromptInputFooterSuggestions-BRyJj7XR.js} +1 -1
  22. package/dist/chunks/{PromptInputHelpMenu-BZIVCV7V.js → PromptInputHelpMenu-DLuRCXVS.js} +1 -1
  23. package/dist/chunks/{ProviderSetup-CwMvjmjh.js → ProviderSetup-CKZGG2B9.js} +1 -1
  24. package/dist/chunks/QueryEngine-B27MOtBA.js +1 -0
  25. package/dist/chunks/{REPL-CtFtb35A.js → REPL-DMRD5wSN.js} +23 -23
  26. package/dist/chunks/REPL-gzolQvzu.js +1 -0
  27. package/dist/chunks/ResumeConversation-7eURPHmQ.js +1 -0
  28. package/dist/chunks/SearchExtraToolsTool-BINZTstr.js +1 -0
  29. package/dist/chunks/Settings-4TNYpfUs.js +2 -0
  30. package/dist/chunks/Spinner-BgjmQLjw.js +1 -0
  31. package/dist/chunks/{TextInput-ou7ZhpVY.js → TextInput-BVEWdRz9.js} +5 -5
  32. package/dist/chunks/{ThemePicker-CVFWqSc7.js → ThemePicker-th2jdUjh.js} +1 -1
  33. package/dist/chunks/{TrustDialog-CGXv_LF4.js → TrustDialog-YsYqHyRR.js} +1 -1
  34. package/dist/chunks/{_baseEach-BYhqv77g.js → _baseEach-Bz5fQbIq.js} +1 -1
  35. package/dist/chunks/{add-dir-BSizpuef.js → add-dir-BsO6l8Ue.js} +1 -1
  36. package/dist/chunks/{agentDisplay-JKfYFD1m.js → agentDisplay-ChkgiTIH.js} +1 -1
  37. package/dist/chunks/{agents-MEaV8P2G.js → agents-BV1nan6b.js} +6 -6
  38. package/dist/chunks/{agents-BDTCH6YB.js → agents-DqEB6iwV.js} +1 -1
  39. package/dist/chunks/allErrors-CkdguCDv.js +1 -0
  40. package/dist/chunks/{backgroundHousekeeping-CsXlkIg3.js → backgroundHousekeeping-1VsWy8xd.js} +1 -1
  41. package/dist/chunks/backgroundHousekeeping-pMtrl4K2.js +1 -0
  42. package/dist/chunks/{branch-BllXcYwS.js → branch-CTIHtpwz.js} +2 -2
  43. package/dist/chunks/{bridgeControl-aDnUrYZR.js → bridgeControl-C8xaGuwO.js} +1 -1
  44. package/dist/chunks/{btw-DzaRBa6o.js → btw-BA39Zrhm.js} +1 -1
  45. package/dist/chunks/caches-DHZHqVhf.js +1 -0
  46. package/dist/chunks/caches-fqs-Y-kW.js +1 -0
  47. package/dist/chunks/channel-B5FkNSZ3.js +1 -0
  48. package/dist/chunks/{channel-Gw6skpUh.js → channel-C5yKM1wf.js} +1 -1
  49. package/dist/chunks/{clear-CDQs9_5P.js → clear-BmlaYYrD.js} +1 -1
  50. package/dist/chunks/commands-EUcHifS4.js +1 -0
  51. package/dist/chunks/compact-D3uePeI7.js +2 -0
  52. package/dist/chunks/config-GgGdlJ9h.js +1 -0
  53. package/dist/chunks/{context-TkdzCK3Y.js → context-CBEWyVpE.js} +1 -1
  54. package/dist/chunks/{context-noninteractive-BcBo64vo.js → context-noninteractive-B03nuxfN.js} +2 -2
  55. package/dist/chunks/context-noninteractive-BLCyyyGL.js +1 -0
  56. package/dist/chunks/conversation-BFL0rEIx.js +1 -0
  57. package/dist/chunks/conversation-D-ker4RO.js +1 -0
  58. package/dist/chunks/{conversationRecovery-_hWC7JBO.js → conversationRecovery-Bt84CYO6.js} +1 -1
  59. package/dist/chunks/crossProjectResume-DwlYY6lV.js +40 -0
  60. package/dist/chunks/{diff-BzVUPO4Z.js → diff-CewYzu3Y.js} +1 -1
  61. package/dist/chunks/doctor-CrQ0UfG2.js +1 -0
  62. package/dist/chunks/{entry-333L52Lo.js → entry-DdVUdGWV.js} +3 -3
  63. package/dist/chunks/exit-QwCo2aJo.js +1 -0
  64. package/dist/chunks/{extraUsage-CmgRR-zH.js → extraUsage-Cu0aV35i.js} +1 -1
  65. package/dist/chunks/extractMemories-DHlbRc5g.js +1 -0
  66. package/dist/chunks/{fast-D7oNjaZ3.js → fast-BlhpCQ2f.js} +1 -1
  67. package/dist/chunks/fast-C3JeBy3A.js +1 -0
  68. package/dist/chunks/{fetchModelList-Cv1vWIpC.js → fetchModelList-DjFCMjVN.js} +1 -1
  69. package/dist/chunks/fetchModelList-L2XarfAj.js +1 -0
  70. package/dist/chunks/{fileSuggestions-DF3HTRKr.js → fileSuggestions-BRwKV_KA.js} +2 -2
  71. package/dist/chunks/{gemini-ou7_YyXc.js → gemini-I-M5_sUA.js} +2 -2
  72. package/dist/chunks/{generateSessionName-CeN9EZNY.js → generateSessionName-CJ0sh6HD.js} +1 -1
  73. package/dist/chunks/{goal-CCxo4Wyf.js → goal-DIrBBT5J.js} +3 -3
  74. package/dist/chunks/{grok-BMmUcNbI.js → grok-ZLjJN6b9.js} +1 -1
  75. package/dist/chunks/{help-CYtogTZk.js → help-CDMjVOl6.js} +1 -1
  76. package/dist/chunks/{hooks-ByVkvodY.js → hooks-BNKCE023.js} +2 -2
  77. package/dist/chunks/hooks-ERYtmuNW.js +1 -0
  78. package/dist/chunks/{install-DIxyfdXG.js → install-xlfTw1j6.js} +1 -1
  79. package/dist/chunks/{instrumentation-BmHivmxs.js → instrumentation-DSt0UvGn.js} +3 -3
  80. package/dist/chunks/{job-D534P26R.js → job-BVElGsu0.js} +1 -1
  81. package/dist/chunks/{launchLocalMemory-CWXLb3KF.js → launchLocalMemory-DUkJCKmd.js} +2 -2
  82. package/dist/chunks/{launchOnboarding-CocPmwzz.js → launchOnboarding-BvD-E_jC.js} +1 -1
  83. package/dist/chunks/loadAgentsDir-BImZsKrh.js +1 -0
  84. package/dist/chunks/{loadAgentsDir-bmpKLPdG.js → loadAgentsDir-BfLCckVj.js} +22 -22
  85. package/dist/chunks/loadPluginHooks-BPwWtBzO.js +1 -0
  86. package/dist/chunks/{localSearch-Da8cVYoI.js → localSearch-BHG8sp8p.js} +1 -1
  87. package/dist/chunks/localSearch-D3rvcRRC.js +1 -0
  88. package/dist/chunks/{logoUtils-qNuBc2nI.js → logoUtils-BsNLv-qi.js} +1 -1
  89. package/dist/chunks/{magicDocs-BsEiBLQl.js → magicDocs-Bue9vxzY.js} +2 -2
  90. package/dist/chunks/{main-B31aPMPP.js → main-U71X4Thd.js} +22 -22
  91. package/dist/chunks/{mcp-Dd8TBfQQ.js → mcp-C4CxCMwJ.js} +3 -3
  92. package/dist/chunks/mcp-D9HFARDy.js +1 -0
  93. package/dist/chunks/mcp-De3QGKvT.js +2 -0
  94. package/dist/chunks/memory-DVRdJFfI.js +1 -0
  95. package/dist/chunks/{mode-SM8doWgC.js → mode-Bd5w-RBX.js} +2 -2
  96. package/dist/chunks/{model-C2r-PaR4.js → model-BCIcUhrc.js} +1 -1
  97. package/dist/chunks/{model-Dd3x121y.js → model-BIf2i1is.js} +1 -1
  98. package/dist/chunks/{modelOptions-BQL4gbNk.js → modelOptions-COIU5U3w.js} +1 -1
  99. package/dist/chunks/{nativeInstaller-DMkZdsof.js → nativeInstaller-CGSNzGNn.js} +1 -1
  100. package/dist/chunks/{notifications-BwS1XsnZ.js → notifications-B5gzCmPC.js} +1 -1
  101. package/dist/chunks/{onChangeAppState-C9cYQJPF.js → onChangeAppState-NWwSE-I4.js} +1 -1
  102. package/dist/chunks/{openai-Bea4I2Od.js → openai-CyJ3m4dI.js} +2 -2
  103. package/dist/chunks/{overlayContext-C5WPACKC.js → overlayContext-DYrGDe63.js} +1 -1
  104. package/dist/chunks/{partition-CKgWl7p4.js → partition-BavNaw1S.js} +1 -1
  105. package/dist/chunks/permissions-CLYcBXIu.js +3 -0
  106. package/dist/chunks/{pidLock-CqkC3-nD.js → pidLock-Bao7SU6Z.js} +2 -2
  107. package/dist/chunks/{plan-Ce6wfjjI.js → plan-Dwj_ZX8G.js} +1 -1
  108. package/dist/chunks/plugin-Cscvf8st.js +17 -0
  109. package/dist/chunks/{pluginAutoupdate-ByokIVEs.js → pluginAutoupdate-D5XyiZrP.js} +1 -1
  110. package/dist/chunks/pluginBlocklist-CpkjXXKQ.js +1 -0
  111. package/dist/chunks/pluginCliCommands-DmLsxs1M.js +1 -0
  112. package/dist/chunks/{pluginFlagging-B2ZX5_oB.js → pluginFlagging-CRuX6sHR.js} +1 -1
  113. package/dist/chunks/pluginOperations-orq3bOCp.js +2 -0
  114. package/dist/chunks/{pluginStartupCheck-QG0d95dE.js → pluginStartupCheck-DGDl1WOZ.js} +1 -1
  115. package/dist/chunks/pluginStartupCheck-GHO77nmg.js +1 -0
  116. package/dist/chunks/plugins-Cq5c-Qs1.js +4 -0
  117. package/dist/chunks/{print-dUT7E1g9.js → print-zo7Z--Ll.js} +9 -9
  118. package/dist/chunks/processBashCommand-C7oVqf0B.js +1 -0
  119. package/dist/chunks/processSlashCommand-CPQB5_0w.js +5 -0
  120. package/dist/chunks/prompt-CAzFDybL.js +1 -0
  121. package/dist/chunks/prompt-Cm8SKZXY.js +1 -0
  122. package/dist/chunks/{prompt-BnDapYGL.js → prompt-DaYH88Oe.js} +1 -1
  123. package/dist/chunks/{reconciler-C_HKsocm.js → reconciler-B5Kr4do0.js} +1 -1
  124. package/dist/chunks/refresh-DurNMJeS.js +1 -0
  125. package/dist/chunks/{reject-Tug1RmkE.js → reject-CzjtO3fU.js} +1 -1
  126. package/dist/chunks/{reload-plugins-CL9LWzpq.js → reload-plugins-C38i_Eb3.js} +1 -1
  127. package/dist/chunks/rename-BV-3ZpFx.js +1 -0
  128. package/dist/chunks/{resume-BZ42SpS2.js → resume-CUzQIor4.js} +2 -2
  129. package/dist/chunks/{runtimeObserver-DT5P2_XL.js → runtimeObserver-BKoQ5IEO.js} +4 -4
  130. package/dist/chunks/{runtimeObserver-BLq2guVy.js → runtimeObserver-Ess1Cn8Y.js} +1 -1
  131. package/dist/chunks/sandbox-adapter-ClRO21Ci.js +1 -0
  132. package/dist/chunks/{sandbox-toggle-DghmaJhK.js → sandbox-toggle-Bp6Xpjh3.js} +1 -1
  133. package/dist/chunks/searchExtraTools-CV_fkuD6.js +1 -0
  134. package/dist/chunks/{select-CaxQ-BVq.js → select-Bm29ymsI.js} +1 -1
  135. package/dist/chunks/sessionFileAccessHooks-B5kAD4ol.js +1 -0
  136. package/dist/chunks/{sessionObserver-DBoZUvWL.js → sessionObserver-CBlzrJt1.js} +1 -1
  137. package/dist/chunks/sessionObserver-CayxkuxO.js +1 -0
  138. package/dist/chunks/sessionStorage-vLxCo1Mh.js +1 -0
  139. package/dist/chunks/{sessionTracing-5a7HDF4e.js → sessionTracing-TDsq54Uc.js} +1 -1
  140. package/dist/chunks/setup-BbyfyeQk.js +3 -0
  141. package/dist/chunks/{shadowedRuleDetection-L3tnySui.js → shadowedRuleDetection-BG3jtA9Y.js} +1 -1
  142. package/dist/chunks/{sideQuestion-BJTVma-5.js → sideQuestion-C8GNVo4R.js} +3 -3
  143. package/dist/chunks/{sinks-CV0SWuZW.js → sinks-BafJR6Fw.js} +1 -1
  144. package/dist/chunks/sinks-CHtjg7sn.js +1 -0
  145. package/dist/chunks/skillChangeDetector-CY17weG4.js +1 -0
  146. package/dist/chunks/{skillGapStore-Cposc03e.js → skillGapStore-Cl4J1WoZ.js} +2 -2
  147. package/dist/chunks/{skillLifecycle-RXQp0JU7.js → skillLifecycle-DdfeUHBf.js} +2 -2
  148. package/dist/chunks/{skillSearchPanel-B2pjskqk.js → skillSearchPanel-DtQYF9gN.js} +4 -4
  149. package/dist/chunks/{skills-D2ZjMtv4.js → skills-Fd12LJal.js} +1 -1
  150. package/dist/chunks/status-CGEMRiPI.js +1 -0
  151. package/dist/chunks/statusNoticeHelpers-D0tonVy0.js +1 -0
  152. package/dist/chunks/{switcher-rep86o4_.js → switcher-BCq9Az_q.js} +1 -1
  153. package/dist/chunks/switcher-DQMr6Anx.js +1 -0
  154. package/dist/chunks/{tasks-B4coTfrq.js → tasks-DQmkY_xD.js} +1 -1
  155. package/dist/chunks/{templateJobs-C5ukh6H3.js → templateJobs-CEDUbFAY.js} +1 -1
  156. package/dist/chunks/{theme-7RmvErYJ.js → theme-DQjJ4R0o.js} +1 -1
  157. package/dist/chunks/tipRegistry-BwxZ_G0j.js +2 -0
  158. package/dist/chunks/{toolEventObserver-Dzwzi5Vi.js → toolEventObserver-DdZ30on9.js} +1 -1
  159. package/dist/chunks/toolPool-CWIXwdX7.js +1 -0
  160. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-BT0nexZw.js → useExitOnCtrlCDWithKeybindings-ClrtNKJ6.js} +1 -1
  161. package/dist/chunks/useMainLoopModel-CULw8pB_.js +1 -0
  162. package/dist/chunks/{useManagePlugins-pGaGzsEg.js → useManagePlugins-CmsPSHor.js} +1 -1
  163. package/dist/chunks/useMergedTools-C8PxReh0.js +1 -0
  164. package/dist/chunks/{useSearchInput-j12K4wEo.js → useSearchInput-BZhTzjgN.js} +1 -1
  165. package/dist/chunks/useSettingsErrors-GWIxCYyd.js +1 -0
  166. package/dist/chunks/{util-CCEK8oze.js → util-Bih2g-pV.js} +1 -1
  167. package/dist/chunks/validatePlugin-BwcC_Wbr.js +1 -0
  168. package/dist/chunks/worktree-BB9lFWBB.js +1 -0
  169. package/dist/cli.js +1 -1
  170. package/package.json +1 -1
  171. package/dist/chunks/AgentsMdExternalIncludesDialog-BjbUilCE.js +0 -1
  172. package/dist/chunks/App-COdpsR2w.js +0 -1
  173. package/dist/chunks/Doctor-B6isid5K.js +0 -1
  174. package/dist/chunks/Doctor-COj-tZBc.js +0 -3
  175. package/dist/chunks/ExitFlow-CcMYH5iI.js +0 -2
  176. package/dist/chunks/MCPConnectionManager-C7RmKzJh.js +0 -1
  177. package/dist/chunks/MCPToolListView-CewNLJus.js +0 -1
  178. package/dist/chunks/MessageSelector-Kc6JlnDX.js +0 -3
  179. package/dist/chunks/Messages-BvFYO4Zn.js +0 -10
  180. package/dist/chunks/QueryEngine-DAwfp_ht.js +0 -1
  181. package/dist/chunks/REPL-tFT1FGQF.js +0 -1
  182. package/dist/chunks/ResumeConversation-CERzSBvg.js +0 -1
  183. package/dist/chunks/SearchExtraToolsTool-ndh4aEwQ.js +0 -1
  184. package/dist/chunks/Settings-CPaqWNdP.js +0 -2
  185. package/dist/chunks/Spinner-C0qHjfIY.js +0 -1
  186. package/dist/chunks/allErrors-Dhnf6rqg.js +0 -1
  187. package/dist/chunks/backgroundHousekeeping-Bu-zRFCx.js +0 -1
  188. package/dist/chunks/caches-CMF-MmR-.js +0 -1
  189. package/dist/chunks/caches-CW5YnYNS.js +0 -1
  190. package/dist/chunks/channel-DVx21qde.js +0 -1
  191. package/dist/chunks/commands-CfYMwgP7.js +0 -1
  192. package/dist/chunks/compact-6F2tuItE.js +0 -2
  193. package/dist/chunks/config-BDkzWBnL.js +0 -1
  194. package/dist/chunks/context-noninteractive-oFcnY1Er.js +0 -1
  195. package/dist/chunks/conversation-CYZyg1U1.js +0 -1
  196. package/dist/chunks/conversation-DXzlRhNw.js +0 -1
  197. package/dist/chunks/crossProjectResume-CCo3iZrB.js +0 -40
  198. package/dist/chunks/doctor-B4jQbGQr.js +0 -1
  199. package/dist/chunks/exit-D5DYnRvR.js +0 -1
  200. package/dist/chunks/extractMemories-CVUrBFMj.js +0 -1
  201. package/dist/chunks/fast-CRhW9zha.js +0 -1
  202. package/dist/chunks/fetchModelList-DIa1HwAJ.js +0 -1
  203. package/dist/chunks/hooks-CBGUcyCs.js +0 -1
  204. package/dist/chunks/loadAgentsDir-Zw648oQO.js +0 -1
  205. package/dist/chunks/loadPluginHooks-BIfM53-_.js +0 -1
  206. package/dist/chunks/localSearch-Dbj8cXyO.js +0 -1
  207. package/dist/chunks/mcp-BMeWtYCx.js +0 -2
  208. package/dist/chunks/mcp-CYbesbfl.js +0 -1
  209. package/dist/chunks/memory-DtQQGyPS.js +0 -1
  210. package/dist/chunks/permissions-Dv_PCfY0.js +0 -3
  211. package/dist/chunks/plugin-aK4tDrVg.js +0 -17
  212. package/dist/chunks/pluginBlocklist-ByRQaVPu.js +0 -1
  213. package/dist/chunks/pluginCliCommands-Dyk4HYHs.js +0 -1
  214. package/dist/chunks/pluginOperations-BCvJvfOC.js +0 -2
  215. package/dist/chunks/pluginStartupCheck-o_TC7wIt.js +0 -1
  216. package/dist/chunks/plugins-DzsTDNWJ.js +0 -4
  217. package/dist/chunks/processBashCommand-DtGCgTkF.js +0 -1
  218. package/dist/chunks/processSlashCommand-wXblpK2C.js +0 -5
  219. package/dist/chunks/prompt-BdH2zk0S.js +0 -1
  220. package/dist/chunks/prompt-D0TFER0A.js +0 -1
  221. package/dist/chunks/refresh-Cm4jZzLa.js +0 -1
  222. package/dist/chunks/rename-OfKJSazJ.js +0 -1
  223. package/dist/chunks/sandbox-adapter-982rx2cm.js +0 -1
  224. package/dist/chunks/searchExtraTools-B4N1bpy0.js +0 -1
  225. package/dist/chunks/sessionFileAccessHooks-BqQ58T7e.js +0 -1
  226. package/dist/chunks/sessionObserver-qYpA90El.js +0 -1
  227. package/dist/chunks/sessionStorage-CC0v4zMs.js +0 -1
  228. package/dist/chunks/setup-DVLnIlse.js +0 -3
  229. package/dist/chunks/sinks-C9NdbjLo.js +0 -1
  230. package/dist/chunks/skillChangeDetector-DlodgOyC.js +0 -1
  231. package/dist/chunks/status-BcSkj9nE.js +0 -1
  232. package/dist/chunks/statusNoticeHelpers-DsrqBOQt.js +0 -1
  233. package/dist/chunks/switcher-BietN6il.js +0 -1
  234. package/dist/chunks/tipRegistry-BYpJZIjR.js +0 -2
  235. package/dist/chunks/toolPool-BGfiNj6h.js +0 -1
  236. package/dist/chunks/useMainLoopModel-QuE7VkgX.js +0 -1
  237. package/dist/chunks/useMergedTools-BLsIT3R_.js +0 -1
  238. package/dist/chunks/useSettingsErrors-C8VIzdws.js +0 -1
  239. package/dist/chunks/validatePlugin-CTVnWx9H.js +0 -1
  240. package/dist/chunks/worktree-BWL0vR4o.js +0 -1
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as t,H as n,I as r,Lt as i,P as a,ai as o,kt as s,t as c}from"./src-BX54x08P.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{Xt as u,qt as d}from"./settings-D4M13toi.js";import{tb as f}from"./loadAgentsDir-bmpKLPdG.js";import{n as p}from"./analytics-COpjZpvd.js";import{n as m,t as h}from"./useExitOnCtrlCDWithKeybindings-BT0nexZw.js";import{n as g,t as _}from"./select-CaxQ-BVq.js";import{c as v,i as y,s as b}from"./terminalSetup-xe_P98fY.js";import{r as x}from"./Spinner-C0qHjfIY.js";import{n as S,t as C}from"./ThemePicker-CVFWqSc7.js";import{n as w,t as T}from"./PressEnterToContinue-DE1RxMX_.js";var E=e(o(),1),D=l();p(),u(),f(),h(),y(),c(),c(),x(),g(),c();var O=58;function k(){let[e]=n(),t=`Welcome to Work Mate`;return d.terminal===`Apple_Terminal`?(0,D.jsx)(A,{theme:e,welcomeMessage:t}):[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,D.jsxs)(r,{width:O,flexDirection:`column`,children:[(0,D.jsxs)(a,{children:[(0,D.jsxs)(a,{color:`workmateBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,D.jsxs)(a,{dimColor:!0,children:[`v`,`0.0.28`,` `]})]}),(0,D.jsx)(a,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,D.jsx)(a,{children:` ░░░░░░ `}),(0,D.jsx)(a,{children:` ░░░ ░░░░░░░░░░ `}),(0,D.jsx)(a,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,D.jsx)(a,{children:` `})]}):(0,D.jsxs)(r,{width:O,flexDirection:`column`,children:[(0,D.jsxs)(a,{children:[(0,D.jsxs)(a,{color:`workmateBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,D.jsxs)(a,{dimColor:!0,children:[`v`,`0.0.28`,` `]})]}),(0,D.jsx)(a,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,D.jsx)(a,{children:` * █████▓▓░ `}),(0,D.jsx)(a,{children:` * ███▓░ ░░ `}),(0,D.jsx)(a,{children:` ░░░░░░ ███▓░ `}),(0,D.jsx)(a,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,D.jsxs)(a,{children:[(0,D.jsx)(a,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,D.jsx)(a,{bold:!0,children:`*`}),(0,D.jsx)(a,{children:` ██▓░░ ▓ `})]}),(0,D.jsx)(a,{children:` ░▓▓███▓▓░ `}),(0,D.jsx)(a,{dimColor:!0,children:` * ░░░░ `}),(0,D.jsx)(a,{dimColor:!0,children:` ░░░░░░░░ `}),(0,D.jsx)(a,{dimColor:!0,children:` * ░░░░░░░░░░░░░░░░ `}),(0,D.jsx)(a,{dimColor:!0,children:` * `})]})}function A({theme:e,welcomeMessage:t}){return[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,D.jsxs)(r,{width:O,flexDirection:`column`,children:[(0,D.jsxs)(a,{children:[(0,D.jsxs)(a,{color:`workmateBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,D.jsxs)(a,{dimColor:!0,children:[`v`,`0.0.28`,` `]})]}),(0,D.jsx)(a,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,D.jsx)(a,{children:` ░░░░░░ `}),(0,D.jsx)(a,{children:` ░░░ ░░░░░░░░░░ `}),(0,D.jsx)(a,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,D.jsx)(a,{children:` `})]}):(0,D.jsxs)(r,{width:O,flexDirection:`column`,children:[(0,D.jsxs)(a,{children:[(0,D.jsxs)(a,{color:`workmateBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,D.jsxs)(a,{dimColor:!0,children:[`v`,`0.0.28`,` `]})]}),(0,D.jsx)(a,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,D.jsx)(a,{children:` * █████▓▓░ `}),(0,D.jsx)(a,{children:` * ███▓░ ░░ `}),(0,D.jsx)(a,{children:` ░░░░░░ ███▓░ `}),(0,D.jsx)(a,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,D.jsxs)(a,{children:[(0,D.jsx)(a,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,D.jsx)(a,{bold:!0,children:`*`}),(0,D.jsx)(a,{children:` ██▓░░ ▓ `})]}),(0,D.jsx)(a,{children:` ░▓▓███▓▓░ `}),(0,D.jsx)(a,{dimColor:!0,children:` * ░░░░ `}),(0,D.jsx)(a,{dimColor:!0,children:` ░░░░░░░░ `}),(0,D.jsx)(a,{dimColor:!0,children:` ░░░░░░░░░░░░░░░░ `})]})}S(),w(),c();var j=(0,E.createContext)({marker:``});function M({children:e}){let{marker:t}=(0,E.useContext)(j);return(0,D.jsxs)(r,{gap:1,children:[(0,D.jsx)(a,{dimColor:!0,children:t}),(0,D.jsx)(r,{flexDirection:`column`,children:e})]})}c();var N=(0,E.createContext)({marker:``});function P({children:e}){let{marker:t}=(0,E.useContext)(N),n=0;for(let t of E.Children.toArray(e))!(0,E.isValidElement)(t)||t.type!==M||n++;let i=String(n).length;return(0,D.jsx)(r,{flexDirection:`column`,children:E.Children.map(e,(e,n)=>{if(!(0,E.isValidElement)(e)||e.type!==M)return e;let r=`${String(n+1).padStart(i)}.`,a=`${t}${r}`;return(0,D.jsx)(N.Provider,{value:{marker:a},children:(0,D.jsx)(j.Provider,{value:{marker:a},children:e})})})})}P.Item=M;var F=P;c(),u();function I({onDone:e}){let[o,c]=(0,E.useState)(0),[l,u]=n();(0,E.useEffect)(()=>{},[]);function f(){if(o<x.length-1){let e=o+1;c(e),x[e]?.id}else e()}function p(e){u(e),f()}let h=m(),g=(0,D.jsx)(r,{marginX:1,children:(0,D.jsx)(C,{onThemeSelect:p,showIntroText:!0,helpText:`To change this later, run /theme`,hideEscToCancel:!0,skipExitHandling:!0})}),y=(0,D.jsxs)(r,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,D.jsx)(a,{bold:!0,children:`Before you start, keep in mind:`}),(0,D.jsx)(r,{flexDirection:`column`,width:70,children:(0,D.jsxs)(F,{children:[(0,D.jsxs)(F.Item,{children:[(0,D.jsx)(a,{children:`Always review changes before accepting`}),(0,D.jsxs)(a,{dimColor:!0,wrap:`wrap`,children:[`Work Mate can make mistakes — especially when running commands`,(0,D.jsx)(s,{}),`or editing files. You stay in control of every action.`,(0,D.jsx)(s,{})]})]}),(0,D.jsxs)(F.Item,{children:[(0,D.jsx)(a,{children:`Only use Work Mate on projects you trust`}),(0,D.jsxs)(a,{dimColor:!0,wrap:`wrap`,children:[`Untrusted code could contain prompt injection attacks.`,(0,D.jsx)(s,{}),(0,D.jsx)(i,{url:`https://code.workmate.com/docs/en/security`})]})]})]})}),(0,D.jsx)(T,{})]}),x=[];x.push({id:`theme`,component:g}),x.push({id:`security`,component:y}),v()&&x.push({id:`terminal-setup`,component:(0,D.jsxs)(r,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,D.jsx)(a,{bold:!0,children:`Use Work Mate's terminal setup?`}),(0,D.jsxs)(r,{flexDirection:`column`,width:70,gap:1,children:[(0,D.jsxs)(a,{children:[`For the optimal coding experience, enable the recommended settings`,(0,D.jsx)(s,{}),`for your terminal:`,` `,d.terminal===`Apple_Terminal`?`Option+Enter for newlines and visual bell`:`Shift+Enter for newlines`]}),(0,D.jsx)(_,{options:[{label:`Yes, use recommended settings`,value:`install`},{label:`No, maybe later with /terminal-setup`,value:`no`}],onChange:e=>{e===`install`?b(l).catch(()=>{}).finally(f):f()},onCancel:()=>f()}),(0,D.jsx)(a,{dimColor:!0,children:h.pending?(0,D.jsxs)(D.Fragment,{children:[`Press `,h.keyName,` again to exit`]}):(0,D.jsx)(D.Fragment,{children:`Enter to confirm · Esc to skip`})})]})]})});let S=x[o],w=(0,E.useCallback)(()=>{o===x.length-1?e():f()},[o,x.length,e]),O=(0,E.useCallback)(()=>{f()},[o,x.length,e]);return t({"confirm:yes":w},{context:`Confirmation`,isActive:S?.id===`security`}),t({"confirm:no":O},{context:`Confirmation`,isActive:S?.id===`terminal-setup`}),(0,D.jsxs)(r,{flexDirection:`column`,children:[(0,D.jsx)(k,{}),(0,D.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[S?.component,h.pending&&(0,D.jsx)(r,{padding:1,children:(0,D.jsxs)(a,{dimColor:!0,children:[`Press `,h.keyName,` again to exit`]})})]})]})}export{I as Onboarding};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as t,H as n,I as r,Lt as i,P as a,ai as o,kt as s,t as c}from"./src-BX54x08P.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{Xt as u,qt as d}from"./settings-D4M13toi.js";import{rb as f}from"./loadAgentsDir-BfLCckVj.js";import{n as p}from"./analytics-COpjZpvd.js";import{n as m,t as h}from"./useExitOnCtrlCDWithKeybindings-ClrtNKJ6.js";import{n as g,t as _}from"./select-Bm29ymsI.js";import{c as v,i as y,s as b}from"./terminalSetup-xe_P98fY.js";import{r as x}from"./Spinner-BgjmQLjw.js";import{n as S,t as C}from"./ThemePicker-th2jdUjh.js";import{n as w,t as T}from"./PressEnterToContinue-DE1RxMX_.js";var E=e(o(),1),D=l();p(),u(),f(),h(),y(),c(),c(),x(),g(),c();var O=58;function k(){let[e]=n(),t=`Welcome to Work Mate`;return d.terminal===`Apple_Terminal`?(0,D.jsx)(A,{theme:e,welcomeMessage:t}):[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,D.jsxs)(r,{width:O,flexDirection:`column`,children:[(0,D.jsxs)(a,{children:[(0,D.jsxs)(a,{color:`workmateBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,D.jsxs)(a,{dimColor:!0,children:[`v`,`0.0.29`,` `]})]}),(0,D.jsx)(a,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,D.jsx)(a,{children:` ░░░░░░ `}),(0,D.jsx)(a,{children:` ░░░ ░░░░░░░░░░ `}),(0,D.jsx)(a,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,D.jsx)(a,{children:` `})]}):(0,D.jsxs)(r,{width:O,flexDirection:`column`,children:[(0,D.jsxs)(a,{children:[(0,D.jsxs)(a,{color:`workmateBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,D.jsxs)(a,{dimColor:!0,children:[`v`,`0.0.29`,` `]})]}),(0,D.jsx)(a,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,D.jsx)(a,{children:` * █████▓▓░ `}),(0,D.jsx)(a,{children:` * ███▓░ ░░ `}),(0,D.jsx)(a,{children:` ░░░░░░ ███▓░ `}),(0,D.jsx)(a,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,D.jsxs)(a,{children:[(0,D.jsx)(a,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,D.jsx)(a,{bold:!0,children:`*`}),(0,D.jsx)(a,{children:` ██▓░░ ▓ `})]}),(0,D.jsx)(a,{children:` ░▓▓███▓▓░ `}),(0,D.jsx)(a,{dimColor:!0,children:` * ░░░░ `}),(0,D.jsx)(a,{dimColor:!0,children:` ░░░░░░░░ `}),(0,D.jsx)(a,{dimColor:!0,children:` * ░░░░░░░░░░░░░░░░ `}),(0,D.jsx)(a,{dimColor:!0,children:` * `})]})}function A({theme:e,welcomeMessage:t}){return[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,D.jsxs)(r,{width:O,flexDirection:`column`,children:[(0,D.jsxs)(a,{children:[(0,D.jsxs)(a,{color:`workmateBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,D.jsxs)(a,{dimColor:!0,children:[`v`,`0.0.29`,` `]})]}),(0,D.jsx)(a,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,D.jsx)(a,{children:` ░░░░░░ `}),(0,D.jsx)(a,{children:` ░░░ ░░░░░░░░░░ `}),(0,D.jsx)(a,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,D.jsx)(a,{children:` `})]}):(0,D.jsxs)(r,{width:O,flexDirection:`column`,children:[(0,D.jsxs)(a,{children:[(0,D.jsxs)(a,{color:`workmateBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,D.jsxs)(a,{dimColor:!0,children:[`v`,`0.0.29`,` `]})]}),(0,D.jsx)(a,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,D.jsx)(a,{children:` * █████▓▓░ `}),(0,D.jsx)(a,{children:` * ███▓░ ░░ `}),(0,D.jsx)(a,{children:` ░░░░░░ ███▓░ `}),(0,D.jsx)(a,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,D.jsxs)(a,{children:[(0,D.jsx)(a,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,D.jsx)(a,{bold:!0,children:`*`}),(0,D.jsx)(a,{children:` ██▓░░ ▓ `})]}),(0,D.jsx)(a,{children:` ░▓▓███▓▓░ `}),(0,D.jsx)(a,{dimColor:!0,children:` * ░░░░ `}),(0,D.jsx)(a,{dimColor:!0,children:` ░░░░░░░░ `}),(0,D.jsx)(a,{dimColor:!0,children:` ░░░░░░░░░░░░░░░░ `})]})}S(),w(),c();var j=(0,E.createContext)({marker:``});function M({children:e}){let{marker:t}=(0,E.useContext)(j);return(0,D.jsxs)(r,{gap:1,children:[(0,D.jsx)(a,{dimColor:!0,children:t}),(0,D.jsx)(r,{flexDirection:`column`,children:e})]})}c();var N=(0,E.createContext)({marker:``});function P({children:e}){let{marker:t}=(0,E.useContext)(N),n=0;for(let t of E.Children.toArray(e))!(0,E.isValidElement)(t)||t.type!==M||n++;let i=String(n).length;return(0,D.jsx)(r,{flexDirection:`column`,children:E.Children.map(e,(e,n)=>{if(!(0,E.isValidElement)(e)||e.type!==M)return e;let r=`${String(n+1).padStart(i)}.`,a=`${t}${r}`;return(0,D.jsx)(N.Provider,{value:{marker:a},children:(0,D.jsx)(j.Provider,{value:{marker:a},children:e})})})})}P.Item=M;var F=P;c(),u();function I({onDone:e}){let[o,c]=(0,E.useState)(0),[l,u]=n();(0,E.useEffect)(()=>{},[]);function f(){if(o<x.length-1){let e=o+1;c(e),x[e]?.id}else e()}function p(e){u(e),f()}let h=m(),g=(0,D.jsx)(r,{marginX:1,children:(0,D.jsx)(C,{onThemeSelect:p,showIntroText:!0,helpText:`To change this later, run /theme`,hideEscToCancel:!0,skipExitHandling:!0})}),y=(0,D.jsxs)(r,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,D.jsx)(a,{bold:!0,children:`Before you start, keep in mind:`}),(0,D.jsx)(r,{flexDirection:`column`,width:70,children:(0,D.jsxs)(F,{children:[(0,D.jsxs)(F.Item,{children:[(0,D.jsx)(a,{children:`Always review changes before accepting`}),(0,D.jsxs)(a,{dimColor:!0,wrap:`wrap`,children:[`Work Mate can make mistakes — especially when running commands`,(0,D.jsx)(s,{}),`or editing files. You stay in control of every action.`,(0,D.jsx)(s,{})]})]}),(0,D.jsxs)(F.Item,{children:[(0,D.jsx)(a,{children:`Only use Work Mate on projects you trust`}),(0,D.jsxs)(a,{dimColor:!0,wrap:`wrap`,children:[`Untrusted code could contain prompt injection attacks.`,(0,D.jsx)(s,{}),(0,D.jsx)(i,{url:`https://code.workmate.com/docs/en/security`})]})]})]})}),(0,D.jsx)(T,{})]}),x=[];x.push({id:`theme`,component:g}),x.push({id:`security`,component:y}),v()&&x.push({id:`terminal-setup`,component:(0,D.jsxs)(r,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,D.jsx)(a,{bold:!0,children:`Use Work Mate's terminal setup?`}),(0,D.jsxs)(r,{flexDirection:`column`,width:70,gap:1,children:[(0,D.jsxs)(a,{children:[`For the optimal coding experience, enable the recommended settings`,(0,D.jsx)(s,{}),`for your terminal:`,` `,d.terminal===`Apple_Terminal`?`Option+Enter for newlines and visual bell`:`Shift+Enter for newlines`]}),(0,D.jsx)(_,{options:[{label:`Yes, use recommended settings`,value:`install`},{label:`No, maybe later with /terminal-setup`,value:`no`}],onChange:e=>{e===`install`?b(l).catch(()=>{}).finally(f):f()},onCancel:()=>f()}),(0,D.jsx)(a,{dimColor:!0,children:h.pending?(0,D.jsxs)(D.Fragment,{children:[`Press `,h.keyName,` again to exit`]}):(0,D.jsx)(D.Fragment,{children:`Enter to confirm · Esc to skip`})})]})]})});let S=x[o],w=(0,E.useCallback)(()=>{o===x.length-1?e():f()},[o,x.length,e]),O=(0,E.useCallback)(()=>{f()},[o,x.length,e]);return t({"confirm:yes":w},{context:`Confirmation`,isActive:S?.id===`security`}),t({"confirm:no":O},{context:`Confirmation`,isActive:S?.id===`terminal-setup`}),(0,D.jsxs)(r,{flexDirection:`column`,children:[(0,D.jsx)(k,{}),(0,D.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[S?.component,h.pending&&(0,D.jsx)(r,{padding:1,children:(0,D.jsxs)(a,{dimColor:!0,children:[`Press `,h.keyName,` again to exit`]})})]})]})}export{I as Onboarding};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gr as n,I as r,P as i,ai as a,ot as o,t as s}from"./src-BX54x08P.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{sb as l}from"./loadAgentsDir-bmpKLPdG.js";import{S as u,_ as d,b as f}from"./startupProfiler-B9Qv2QGH.js";function p(e){return e.startsWith(`file-`)?`+`:e.startsWith(`mcp-resource-`)?`◇`:e.startsWith(`agent-`)?`*`:`+`}function m(e){return e.startsWith(`file-`)||e.startsWith(`mcp-resource-`)||e.startsWith(`agent-`)}function h({suggestions:e,selectedSuggestion:t,maxColumnWidth:i,overlay:a}){let{rows:s}=o(),c=a?5:Math.min(6,Math.max(1,s-3));if(e.length===0)return null;let l=i??Math.max(...e.map(e=>n(e.displayText)))+5,u=Math.max(0,Math.min(t-Math.floor(c/2),e.length-c)),d=Math.min(u+c,e.length),f=e.slice(u,d);return(0,_.jsx)(r,{flexDirection:`column`,justifyContent:a?void 0:`flex-end`,children:f.map(n=>(0,_.jsx)(v,{item:n,maxColumnWidth:l,isSelected:n.id===e[t]?.id},n.id))})}var g,_,v,y,b=e((()=>{g=t(a(),1),l(),s(),d(),_=c(),v=(0,g.memo)(function({item:e,maxColumnWidth:t,isSelected:r}){let a=o().columns;if(m(e.id)){let t=p(e.id),o=r?`suggestion`:void 0,s=!r,c=e.id.startsWith(`file-`),l=e.id.startsWith(`mcp-resource-`),d=e.description?3:0,m;if(c){let t=e.description?Math.min(20,n(e.description)):0,r=a-2-4-d-t;m=f(e.displayText,r)}else m=l?u(e.displayText,30):e.displayText;let h=a-2-n(m)-d-4,g;if(e.description){let n=Math.max(0,h),r=u(e.description.replace(/\s+/g,` `),n);g=`${t} ${m} – ${r}`}else g=`${t} ${m}`;return(0,_.jsx)(i,{color:o,dimColor:s,wrap:`truncate`,children:g})}let s=Math.floor(a*.4),c=Math.min(t??n(e.displayText)+5,s),l=e.color||(r?`suggestion`:void 0),d=!r,h=e.displayText;n(h)>c-2&&(h=u(h,c-2));let g=h+` `.repeat(Math.max(0,c-n(h))),v=e.tag?`[${e.tag}] `:``,y=n(v),b=Math.max(0,a-c-y-4),x=e.description?u(e.description.replace(/\s+/g,` `),b):``;return(0,_.jsxs)(i,{wrap:`truncate`,children:[(0,_.jsx)(i,{color:l,dimColor:d,children:g}),v?(0,_.jsx)(i,{color:e.tag===`local`?`ansi:yellow`:void 0,dimColor:e.tag!==`local`,children:v}):null,(0,_.jsx)(i,{color:r?`suggestion`:void 0,dimColor:!r,children:x})]})}),y=(0,g.memo)(h)}));export{y as n,b as r,h as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gr as n,I as r,P as i,ai as a,ot as o,t as s}from"./src-BX54x08P.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{lb as l}from"./loadAgentsDir-BfLCckVj.js";import{S as u,_ as d,b as f}from"./startupProfiler-B9Qv2QGH.js";function p(e){return e.startsWith(`file-`)?`+`:e.startsWith(`mcp-resource-`)?`◇`:e.startsWith(`agent-`)?`*`:`+`}function m(e){return e.startsWith(`file-`)||e.startsWith(`mcp-resource-`)||e.startsWith(`agent-`)}function h({suggestions:e,selectedSuggestion:t,maxColumnWidth:i,overlay:a}){let{rows:s}=o(),c=a?5:Math.min(6,Math.max(1,s-3));if(e.length===0)return null;let l=i??Math.max(...e.map(e=>n(e.displayText)))+5,u=Math.max(0,Math.min(t-Math.floor(c/2),e.length-c)),d=Math.min(u+c,e.length),f=e.slice(u,d);return(0,_.jsx)(r,{flexDirection:`column`,justifyContent:a?void 0:`flex-end`,children:f.map(n=>(0,_.jsx)(v,{item:n,maxColumnWidth:l,isSelected:n.id===e[t]?.id},n.id))})}var g,_,v,y,b=e((()=>{g=t(a(),1),l(),s(),d(),_=c(),v=(0,g.memo)(function({item:e,maxColumnWidth:t,isSelected:r}){let a=o().columns;if(m(e.id)){let t=p(e.id),o=r?`suggestion`:void 0,s=!r,c=e.id.startsWith(`file-`),l=e.id.startsWith(`mcp-resource-`),d=e.description?3:0,m;if(c){let t=e.description?Math.min(20,n(e.description)):0,r=a-2-4-d-t;m=f(e.displayText,r)}else m=l?u(e.displayText,30):e.displayText;let h=a-2-n(m)-d-4,g;if(e.description){let n=Math.max(0,h),r=u(e.description.replace(/\s+/g,` `),n);g=`${t} ${m} – ${r}`}else g=`${t} ${m}`;return(0,_.jsx)(i,{color:o,dimColor:s,wrap:`truncate`,children:g})}let s=Math.floor(a*.4),c=Math.min(t??n(e.displayText)+5,s),l=e.color||(r?`suggestion`:void 0),d=!r,h=e.displayText;n(h)>c-2&&(h=u(h,c-2));let g=h+` `.repeat(Math.max(0,c-n(h))),v=e.tag?`[${e.tag}] `:``,y=n(v),b=Math.max(0,a-c-y-4),x=e.description?u(e.description.replace(/\s+/g,` `),b):``;return(0,_.jsxs)(i,{wrap:`truncate`,children:[(0,_.jsx)(i,{color:l,dimColor:d,children:g}),v?(0,_.jsx)(i,{color:e.tag===`local`?`ansi:yellow`:void 0,dimColor:e.tag!==`local`,children:v}):null,(0,_.jsx)(i,{color:r?`suggestion`:void 0,dimColor:!r,children:x})]})}),y=(0,g.memo)(h)}));export{y as n,b as r,h as t};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,t as r}from"./src-BX54x08P.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{Xt as a,qt as o}from"./settings-D4M13toi.js";import{AC as s,NC as c,jC as l,nb as u,rb as d}from"./loadAgentsDir-bmpKLPdG.js";import{d as f,o as p}from"./config-Bio2EjUK.js";import{i as m,o as h}from"./bundledMode-D9omqD3L.js";import{a as g,s as _}from"./sleep-xKMbXTJe.js";import{a as v,i as y,r as b}from"./terminalSetup-xe_P98fY.js";function x(){return p().editorMode===`vim`}function S(){return o.terminal===`Apple_Terminal`&&process.platform===`darwin`||v()?`shift + ⏎ for newline`:b()?`\\⏎ for newline`:`backslash (\\) + return (⏎) for newline`}function C(e,t){return t.ctrl||t.meta||t.escape||t.return||t.tab||t.backspace||t.delete||t.upArrow||t.downArrow||t.leftArrow||t.rightArrow||t.pageUp||t.pageDown||t.home||t.end?!1:e.length>0&&!/^\s/.test(e)&&!e.startsWith(`\x1B`)}var w=e((()=>{y(),f(),a()}));function T(e){return e.replace(/\+/g,` + `)}function E(e){let{dimColor:r,fixedWidth:i,gap:a,paddingX:o}=e,s=T(d(`app:toggleTranscript`,`Global`,`ctrl+o`)),u=T(d(`app:toggleTodos`,`Global`,`ctrl+t`)),f=T(d(`chat:undo`,`Chat`,`ctrl+_`)),p=T(d(`chat:stash`,`Chat`,`ctrl+s`)),h=T(d(`chat:cycleMode`,`Chat`,`shift+tab`)),g=T(d(`chat:modelPicker`,`Chat`,`alt+p`)),v=T(d(`chat:fastMode`,`Chat`,`alt+o`)),y=T(d(`chat:externalEditor`,`Chat`,`ctrl+g`));T(d(`app:toggleTerminal`,`Global`,`meta+j`));let b=T(d(`chat:imagePaste`,`Chat`,`ctrl+v`));return(0,D.jsxs)(t,{paddingX:o,flexDirection:`row`,gap:a,children:[(0,D.jsxs)(t,{flexDirection:`column`,width:i?24:void 0,children:[(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`! for bash mode`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`/ for commands`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`@ for file paths`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`& for background`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`/btw for side question`})})]}),(0,D.jsxs)(t,{flexDirection:`column`,width:i?35:void 0,children:[(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`double tap esc to clear input`})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[h,` to auto-accept edits`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[s,` for verbose output`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[u,` to toggle tasks`]})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:S()})})]}),(0,D.jsxs)(t,{flexDirection:`column`,children:[(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[f,` to undo`]})}),m()!==`windows`&&(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`ctrl + z to suspend`})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[b,` to paste images`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[g,` to switch model`]})}),c()&&l()&&(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[v,` to toggle fast mode`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[p,` to stash prompt`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[y,` to edit in $EDITOR`]})}),_()&&(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`/keybindings to customize`})})]})]})}var D,O=e((()=>{r(),h(),g(),u(),s(),w(),D=i()}));export{x as a,C as i,O as n,w as r,E as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,t as r}from"./src-BX54x08P.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{Xt as a,qt as o}from"./settings-D4M13toi.js";import{FC as s,MC as c,NC as l,ab as u,ib as d}from"./loadAgentsDir-BfLCckVj.js";import{d as f,o as p}from"./config-Bio2EjUK.js";import{i as m,o as h}from"./bundledMode-D9omqD3L.js";import{a as g,s as _}from"./sleep-xKMbXTJe.js";import{a as v,i as y,r as b}from"./terminalSetup-xe_P98fY.js";function x(){return p().editorMode===`vim`}function S(){return o.terminal===`Apple_Terminal`&&process.platform===`darwin`||v()?`shift + ⏎ for newline`:b()?`\\⏎ for newline`:`backslash (\\) + return (⏎) for newline`}function C(e,t){return t.ctrl||t.meta||t.escape||t.return||t.tab||t.backspace||t.delete||t.upArrow||t.downArrow||t.leftArrow||t.rightArrow||t.pageUp||t.pageDown||t.home||t.end?!1:e.length>0&&!/^\s/.test(e)&&!e.startsWith(`\x1B`)}var w=e((()=>{y(),f(),a()}));function T(e){return e.replace(/\+/g,` + `)}function E(e){let{dimColor:r,fixedWidth:i,gap:a,paddingX:o}=e,c=T(u(`app:toggleTranscript`,`Global`,`ctrl+o`)),d=T(u(`app:toggleTodos`,`Global`,`ctrl+t`)),f=T(u(`chat:undo`,`Chat`,`ctrl+_`)),p=T(u(`chat:stash`,`Chat`,`ctrl+s`)),h=T(u(`chat:cycleMode`,`Chat`,`shift+tab`)),g=T(u(`chat:modelPicker`,`Chat`,`alt+p`)),v=T(u(`chat:fastMode`,`Chat`,`alt+o`)),y=T(u(`chat:externalEditor`,`Chat`,`ctrl+g`));T(u(`app:toggleTerminal`,`Global`,`meta+j`));let b=T(u(`chat:imagePaste`,`Chat`,`ctrl+v`));return(0,D.jsxs)(t,{paddingX:o,flexDirection:`row`,gap:a,children:[(0,D.jsxs)(t,{flexDirection:`column`,width:i?24:void 0,children:[(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`! for bash mode`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`/ for commands`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`@ for file paths`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`& for background`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`/btw for side question`})})]}),(0,D.jsxs)(t,{flexDirection:`column`,width:i?35:void 0,children:[(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`double tap esc to clear input`})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[h,` to auto-accept edits`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[c,` for verbose output`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[d,` to toggle tasks`]})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:S()})})]}),(0,D.jsxs)(t,{flexDirection:`column`,children:[(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[f,` to undo`]})}),m()!==`windows`&&(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`ctrl + z to suspend`})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[b,` to paste images`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[g,` to switch model`]})}),s()&&l()&&(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[v,` to toggle fast mode`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[p,` to stash prompt`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[y,` to edit in $EDITOR`]})}),_()&&(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`/keybindings to customize`})})]})]})}var D,O=e((()=>{r(),h(),g(),d(),c(),w(),D=i()}));export{x as a,C as i,O as n,w as r,E as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,ai as r,kt as i,t as a}from"./src-BX54x08P.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{i as s,n as c}from"./loader-BMAtuwRa.js";import{r as l,t as u}from"./switcher-rep86o4_.js";import{n as d,t as f}from"./useExitOnCtrlCDWithKeybindings-BT0nexZw.js";import{t as p}from"./select-CaxQ-BVq.js";import{t as m}from"./CustomSelect-t4wXuXWH.js";var h=e(r(),1);a(),f(),c(),l(),m();var g=o(),_=[{key:`id`,label:`Provider id (kebab-case)`,placeholder:`my-provider`},{key:`baseUrl`,label:`Base URL`,placeholder:`https://api.example.com/v1`},{key:`apiKey`,label:`API Key`,placeholder:`sk-...`},{key:`model`,label:`Default model`,placeholder:`gpt-4o-mini`}],v=[{value:`save-openai`,label:`Save as OpenAI-compat (Chat Completions API)`},{value:`save-anthropic`,label:`Save as Anthropic-compat (Messages API)`},{value:`skip`,label:`Skip — configure later with /provider add`}];function y(e){return e===`save-openai`||e===`save-anthropic`||e===`skip`}function b(e){if(!e.id)return`Provider id is required.`;if(!/^[a-z0-9-]+$/.test(e.id))return`Provider id must be kebab-case (lowercase letters, digits, hyphens).`;if(!e.baseUrl)return`Base URL is required.`;try{new URL(e.baseUrl)}catch{return`Base URL must be a valid URL.`}return e.apiKey?null:`API Key is required.`}function x({onDone:e}){let r=(0,h.useRef)({id:``,baseUrl:``,apiKey:``,model:``}),[a,o]=(0,h.useState)(null),c=d();async function l(t){if(t===`skip`){e();return}let n=t===`save-openai`?`openai-compat`:`anthropic-compat`,i=b(r.current);if(i){o(i);return}let a={id:r.current.id,kind:n,baseUrl:r.current.baseUrl,apiKey:r.current.apiKey,defaultModel:r.current.model||`gpt-4o-mini`};try{s([a]),await u(a.id)}catch(e){let t=e instanceof Error?e.message:String(e);o(`Failed to save provider: ${t}`);return}e()}function f(e){o(null),y(e)&&l(e)}let m=[..._.map(e=>({type:`input`,label:e.label,value:e.key,placeholder:e.placeholder,allowEmptySubmitToCancel:!0,onChange:t=>{r.current[e.key]=t}})),...v.map(e=>({type:`text`,label:e.label,value:e.value}))];return(0,g.jsxs)(t,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,g.jsx)(n,{bold:!0,color:`permission`,children:`Configure an API provider`}),(0,g.jsx)(t,{flexDirection:`column`,width:70,children:(0,g.jsxs)(n,{dimColor:!0,wrap:`wrap`,children:[`No provider is configured yet — `,(0,g.jsx)(n,{children:`~/.workmate/providers.json`}),` was not found.`,(0,g.jsx)(i,{}),`Fill in the fields below to point Work Mate at any OpenAI- or Anthropic-compatible`,(0,g.jsx)(i,{}),`endpoint. Type to edit a focused field, ↑/↓ to move between rows, Enter to trigger`,(0,g.jsx)(i,{}),`the highlighted action.`]})}),(0,g.jsx)(p,{options:m,onChange:f,onCancel:()=>e(),visibleOptionCount:m.length}),a&&(0,g.jsx)(n,{color:`error`,wrap:`wrap`,children:a}),c.pending&&(0,g.jsxs)(n,{dimColor:!0,children:[`Press `,c.keyName,` again to exit`]})]})}export{x as ProviderSetup};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,ai as r,kt as i,t as a}from"./src-BX54x08P.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{i as s,n as c}from"./loader-BMAtuwRa.js";import{r as l,t as u}from"./switcher-BCq9Az_q.js";import{n as d,t as f}from"./useExitOnCtrlCDWithKeybindings-ClrtNKJ6.js";import{t as p}from"./select-Bm29ymsI.js";import{t as m}from"./CustomSelect-BsEd2To5.js";var h=e(r(),1);a(),f(),c(),l(),m();var g=o(),_=[{key:`id`,label:`Provider id (kebab-case)`,placeholder:`my-provider`},{key:`baseUrl`,label:`Base URL`,placeholder:`https://api.example.com/v1`},{key:`apiKey`,label:`API Key`,placeholder:`sk-...`},{key:`model`,label:`Default model`,placeholder:`gpt-4o-mini`}],v=[{value:`save-openai`,label:`Save as OpenAI-compat (Chat Completions API)`},{value:`save-anthropic`,label:`Save as Anthropic-compat (Messages API)`},{value:`skip`,label:`Skip — configure later with /provider add`}];function y(e){return e===`save-openai`||e===`save-anthropic`||e===`skip`}function b(e){if(!e.id)return`Provider id is required.`;if(!/^[a-z0-9-]+$/.test(e.id))return`Provider id must be kebab-case (lowercase letters, digits, hyphens).`;if(!e.baseUrl)return`Base URL is required.`;try{new URL(e.baseUrl)}catch{return`Base URL must be a valid URL.`}return e.apiKey?null:`API Key is required.`}function x({onDone:e}){let r=(0,h.useRef)({id:``,baseUrl:``,apiKey:``,model:``}),[a,o]=(0,h.useState)(null),c=d();async function l(t){if(t===`skip`){e();return}let n=t===`save-openai`?`openai-compat`:`anthropic-compat`,i=b(r.current);if(i){o(i);return}let a={id:r.current.id,kind:n,baseUrl:r.current.baseUrl,apiKey:r.current.apiKey,defaultModel:r.current.model||`gpt-4o-mini`};try{s([a]),await u(a.id)}catch(e){let t=e instanceof Error?e.message:String(e);o(`Failed to save provider: ${t}`);return}e()}function f(e){o(null),y(e)&&l(e)}let m=[..._.map(e=>({type:`input`,label:e.label,value:e.key,placeholder:e.placeholder,allowEmptySubmitToCancel:!0,onChange:t=>{r.current[e.key]=t}})),...v.map(e=>({type:`text`,label:e.label,value:e.value}))];return(0,g.jsxs)(t,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,g.jsx)(n,{bold:!0,color:`permission`,children:`Configure an API provider`}),(0,g.jsx)(t,{flexDirection:`column`,width:70,children:(0,g.jsxs)(n,{dimColor:!0,wrap:`wrap`,children:[`No provider is configured yet — `,(0,g.jsx)(n,{children:`~/.workmate/providers.json`}),` was not found.`,(0,g.jsx)(i,{}),`Fill in the fields below to point Work Mate at any OpenAI- or Anthropic-compatible`,(0,g.jsx)(i,{}),`endpoint. Type to edit a focused field, ↑/↓ to move between rows, Enter to trigger`,(0,g.jsx)(i,{}),`the highlighted action.`]})}),(0,g.jsx)(p,{options:m,onChange:f,onCancel:()=>e(),visibleOptionCount:m.length}),a&&(0,g.jsx)(n,{color:`error`,wrap:`wrap`,children:a}),c.pending&&(0,g.jsxs)(n,{dimColor:!0,children:[`Press `,c.keyName,` again to exit`]})]})}export{x as ProviderSetup};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n,s as r}from"./envUtils-QyzA_cFM.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{Kr as o,qr as s}from"./src-BX54x08P.js";import{X as c,d as l,m as u,q as d}from"./settings-D4M13toi.js";import{Ft as ee,K as f,Pt as p,at as m,ft as h,gt as g,rt as _}from"./state-CXY-q5gr.js";import{Aa as te,Cb as ne,Ds as v,Es as re,Gv as y,Hv as b,I_ as x,Ia as S,Kr as C,L_ as w,MC as T,Mi as ie,Pi as E,Q as D,Qn as O,R_ as ae,Ra as oe,SS as k,Sb as se,Ts as ce,Up as A,Vp as j,Vv as M,Xi as le,Xs as ue,Xu as de,YS as fe,Ys as N,Z as pe,_n as P,_v as F,_w as I,bC as me,ct as he,gv as ge,hS as _e,ig as ve,kC as L,lt as ye,ma as be,py as xe,qS as Se,qu as R,qv as z,qx as Ce,ry as B,sg as V,tg as we,tt as Te,uw as H,vn as Ee,vr as De,vw as Oe,ws as ke,yC as Ae}from"./loadAgentsDir-BfLCckVj.js";import{n as U,t as je}from"./cwd-DrEEb4f5.js";import{C as Me,S as Ne,d as W,o as Pe}from"./config-Bio2EjUK.js";import{i as Fe,o as Ie,q as Le}from"./log-L1kqxa_P.js";import{f as G,s as Re,v as ze}from"./model-BIf2i1is.js";import{at as K,bn as Be,nt as Ve,vn as He}from"./prompt-DaYH88Oe.js";import{n as Ue,o as We,r as q}from"./MessageSelector-CFz30wBL.js";import{n as Ge,t as J}from"./systemTheme-Ceakddth.js";import{randomUUID as Y}from"crypto";n(),i(),o(),p(),U(),Ie(),u(),Me(),He(),W(),I(),T(),Ae(),k(),xe(),K(),z(),F(),V(),A(),N(),S(),le(),E(),De(),P(),D(),ye(),ae(),b(),G(),B(),R();async function Ke({tools:e,mainLoopModel:t,additionalWorkingDirectories:n,mcpClients:r,customSystemPrompt:i}){let[a,o,s]=await Promise.all([i===void 0?he(e,t,n,r):Promise.resolve([]),w(),i===void 0?x():Promise.resolve({})]);return{defaultSystemPrompt:a,userContext:o,systemContext:s}}async function qe({tools:e,commands:t,mcpClients:n,messages:r,readFileState:i,getAppState:a,setAppState:o,customSystemPrompt:s,appendSystemPrompt:c,thinkingConfig:l,agents:u}){let d=Re(),ee=a(),{defaultSystemPrompt:f,userContext:p,systemContext:m}=await Ke({tools:e,mainLoopModel:d,additionalWorkingDirectories:Array.from(ee.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:n,customSystemPrompt:s}),h=Se([...s===void 0?f:[s],...c?[c]:[]]),g=r.at(-1),_=g?.type===`assistant`&&g.message.stop_reason===null?r.slice(0,-1):r;return{systemPrompt:h,userContext:p,systemContext:m,toolUseContext:{options:{commands:t,debug:!1,mainLoopModel:d,tools:e,verbose:!1,thinkingConfig:l??(de()===!1?{type:`disabled`}:{type:`adaptive`}),mcpClients:n,mcpResources:{},isNonInteractiveSession:!0,agentDefinitions:{activeAgents:u,allAgents:[]},customSystemPrompt:s,appendSystemPrompt:c},abortController:M(),readFileState:i,getAppState:a,setAppState:o,messages:_,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}},forkContextMessages:_}}c(),se(),te(),J(),H();function X(e){return e.flatMap(e=>{if(!e)return[];switch(e.type){case`assistant`:return[{type:`assistant`,message:e.message,uuid:e.uuid,requestId:void 0,timestamp:new Date().toISOString()}];case`user`:return[{type:`user`,message:e.message,uuid:e.uuid??Y(),timestamp:e.timestamp??new Date().toISOString(),isMeta:e.isSynthetic}];default:return[]}})}function Je(e){let t=e.preservedSegment;return{trigger:e.trigger,pre_tokens:e.preTokens,...t&&{preserved_segment:{head_uuid:t.headUuid,anchor_uuid:t.anchorUuid,tail_uuid:t.tailUuid}}}}function Ye(e,t){let n=Ce({content:s(e).replace(/<local-command-stdout>([\s\S]*?)<\/local-command-stdout>/,`$1`).replace(/<local-command-stderr>([\s\S]*?)<\/local-command-stderr>/,`$1`).trim()});return{type:`assistant`,content:n.message?.content,message:n.message,parent_tool_use_id:null,session_id:m(),uuid:t}}function Z(e){if(e)return{type:`rate_limit`,status:e.status,...e.resetsAt!==void 0&&{resetsAt:e.resetsAt},...e.rateLimitType!==void 0&&{rateLimitType:e.rateLimitType},...e.utilization!==void 0&&{utilization:e.utilization},...e.overageStatus!==void 0&&{overageStatus:e.overageStatus},...e.overageResetsAt!==void 0&&{overageResetsAt:e.overageResetsAt},...e.overageDisabledReason!==void 0&&{overageDisabledReason:e.overageDisabledReason},...e.isUsingOverage!==void 0&&{isUsingOverage:e.isUsingOverage},...e.surpassedThreshold!==void 0&&{surpassedThreshold:e.surpassedThreshold}}}p();function Xe(e){return e===`Agent`?d:e}function Ze(e){let t=l()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:je(),session_id:m(),tools:e.tools.map(e=>Xe(e.name)),mcp_servers:e.mcpClients.map(e=>({name:e.name,status:e.type})),model:e.model,permissionMode:e.permissionMode,slash_commands:e.commands.filter(e=>e.userInvocable!==!1).map(e=>e.name),apiKeySource:process.env.ANTHROPIC_API_KEY?`ANTHROPIC_API_KEY`:`none`,betas:_(),claude_code_version:`0.0.29`,output_style:t,agents:e.agents.map(e=>e.agentType),skills:e.skills.filter(e=>e.userInvocable!==!1).map(e=>e.name),plugins:e.plugins.map(e=>({name:e.name,path:e.path,source:e.source})),uuid:Y()};return n.fast_mode_state=L(e.model,e.fastMode),n}p(),o(),Le(),b(),U(),T(),le(),G(),B(),R(),ce();var Qe=()=>{try{return q(),e(Ue)}catch{return null}},Q=class{constructor(e){a(this,`config`,void 0),a(this,`mutableMessages`,void 0),a(this,`abortController`,void 0),a(this,`permissionDenials`,void 0),a(this,`totalUsage`,void 0),a(this,`hasHandledOrphanedPermission`,!1),a(this,`readFileState`,void 0),a(this,`discoveredSkillNames`,new Set),a(this,`loadedNestedMemoryPaths`,new Set),this.config=e,this.mutableMessages=e.initialMessages??[],this.abortController=e.abortController??M(),this.permissionDenials=[],this.readFileState=e.readFileCache,this.totalUsage=fe}async*submitMessage(e,n){let{cwd:i,commands:a,tools:o,mcpClients:c,verbose:l=!1,thinkingConfig:u,maxTurns:d,maxBudgetUsd:p,taskBudget:_,canUseTool:te,customSystemPrompt:y,appendSystemPrompt:b,userSpecifiedModel:x,fallbackModel:S,jsonSchema:w,getAppState:T,setAppState:E,replayUserMessages:D=!1,includePartialMessages:ae=!1,agents:k=[],setSDKStatus:se,orphanedPermission:ce}=this.config;this.discoveredSkillNames.clear(),this.permissionDenials=[],ne(i);let A=!ee(),M=Date.now(),le=async(e,t,n,r,i,a)=>{let o=await te(e,t,n,r,i,a);return o.behavior!==`allow`&&this.permissionDenials.push({type:`permission_denial`,tool_name:Xe(e.name),tool_use_id:i,tool_input:t}),o},N=T(),P=x?ze(x):Re(),F=u||(de()===!1?{type:`disabled`}:{type:`adaptive`});j(`before_getSystemPrompt`);let I=typeof y==`string`?y:void 0,{defaultSystemPrompt:he,userContext:ye,systemContext:xe}=await Ke({tools:o,mainLoopModel:P,additionalWorkingDirectories:Array.from(N.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:c,customSystemPrompt:I});j(`after_getSystemPrompt`);let R={...ye},z=I!==void 0&&Ne()?await Oe():null,Ce=Se([...I===void 0?he:[I],...z?[z]:[],...b?[b]:[]]),B=o.some(e=>Be(e,Ve));w&&B&&Ee(E,m());let V={messages:this.mutableMessages,setMessages:e=>{this.mutableMessages=e(this.mutableMessages)},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:o,verbose:l,mainLoopModel:P,thinkingConfig:F,mcpClients:c,mcpResources:{},isNonInteractiveSession:!0,customSystemPrompt:y,appendSystemPrompt:b,agentDefinitions:{activeAgents:k,allAgents:[]},theme:Ge(Pe().theme),maxBudgetUsd:p},getAppState:T,setAppState:E,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:e=>{E(t=>{let n=e(t.fileHistory);return n===t.fileHistory?t:{...t,fileHistory:n}})},updateAttributionState:e=>{E(t=>{let n=e(t.attribution);return n===t.attribution?t:{...t,attribution:n}})},setSDKStatus:se};if(ce&&!this.hasHandledOrphanedPermission){this.hasHandledOrphanedPermission=!0;for await(let e of ke(ce,o,this.mutableMessages,V))yield e}let{messages:H,shouldQuery:De,allowedTools:Ae,model:U,resultText:Me}=await We({input:e,mode:`prompt`,setToolJSX:()=>{},context:{...V,messages:this.mutableMessages},messages:this.mutableMessages,uuid:n?.uuid,isMeta:n?.isMeta,querySource:`sdk`});this.mutableMessages.push(...H);let W=[...this.mutableMessages];if(A&&H.length>0){let e=C(W);r()||(await e,(t(process.env.WORKMATE_EAGER_FLUSH)||t(process.env.WORKMATE_IS_COWORK))&&await O())}let Ie=Qe(),Le=H.filter(e=>e.type===`user`&&!e.isMeta&&!e.toolUseResult&&(Ie?.selectableUserMessagesFilter(e)??!0)||e.type===`system`&&e.subtype===`compact_boundary`),G=D?Le:[];E(e=>({...e,toolPermissionContext:{...e.toolPermissionContext,alwaysAllowRules:{...e.toolPermissionContext.alwaysAllowRules,command:Ae}}}));let K=U??P;V={messages:W,setMessages:()=>{},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:o,verbose:l,mainLoopModel:K,thinkingConfig:F,mcpClients:c,mcpResources:{},isNonInteractiveSession:!0,customSystemPrompt:y,appendSystemPrompt:b,theme:Ge(Pe().theme),agentDefinitions:{activeAgents:k,allAgents:[]},maxBudgetUsd:p},getAppState:T,setAppState:E,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:V.updateFileHistoryState,updateAttributionState:V.updateAttributionState,setSDKStatus:se},j(`before_skills_plugins`);let[He,{enabled:Ue}]=await Promise.all([ie(je()),oe()]);if(j(`after_skills_plugins`),yield Ze({tools:o,mcpClients:c,model:K,permissionMode:N.toolPermissionContext.mode,commands:a,agents:k,skills:He,plugins:Ue,fastMode:N.fastMode}),j(`system_message_yielded`),!De){for(let e of H)if(e.type===`user`&&typeof e.message.content==`string`&&(e.message.content.includes(`<local-command-stdout>`)||e.message.content.includes(`<local-command-stderr>`)||e.isCompactSummary)&&(yield{type:`user`,message:{...e.message,content:s(e.message.content)},session_id:m(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!e.isCompactSummary,isSynthetic:e.isMeta||e.isVisibleInTranscriptOnly}),e.type===`system`&&e.subtype===`local_command`&&typeof e.content==`string`&&(e.content.includes(`<local-command-stdout>`)||e.content.includes(`<local-command-stderr>`))&&(yield Ye(e.content,e.uuid)),e.type===`system`&&e.subtype===`compact_boundary`){let t=e;yield{type:`system`,subtype:`compact_boundary`,session_id:m(),uuid:e.uuid,compact_metadata:Je(t.compactMetadata)}}A&&(await C(W),(t(process.env.WORKMATE_EAGER_FLUSH)||t(process.env.WORKMATE_IS_COWORK))&&await O()),yield{type:`result`,subtype:`success`,is_error:!1,duration_ms:Date.now()-M,duration_api_ms:h(),num_turns:W.length-1,result:Me??``,stop_reason:null,session_id:m(),total_cost_usd:g(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:L(K,N.fastMode),uuid:Y()};return}if(we()&&A){let e=Qe()?.selectableUserMessagesFilter??(e=>!0);H.filter(e).forEach(e=>{ve(e=>{E(t=>({...t,fileHistory:e(t.fileHistory)}))},e.uuid)})}let q=fe,J=1,qe=!1,X,Z=null,Q=Fe().at(-1),$e=w?be(this.mutableMessages,Ve):0;for await(let e of ue({messages:W,systemPrompt:Ce,userContext:R,systemContext:xe,canUseTool:le,toolUseContext:V,fallbackModel:S,querySource:`sdk`,maxTurns:d,taskBudget:_})){if(e.type===`assistant`||e.type===`user`||e.type===`system`&&e.subtype===`compact_boundary`){if(A&&e.type===`system`&&e.subtype===`compact_boundary`){let t=e.compactMetadata?.preservedSegment?.tailUuid;if(t){let e=this.mutableMessages.findLastIndex(e=>e.uuid===t);e!==-1&&await C(this.mutableMessages.slice(0,e+1))}}if(W.push(e),A&&(e.type===`assistant`?C(W):await C(W)),!qe&&G.length>0){qe=!0;for(let e of G)e.type===`user`&&(yield{type:`user`,message:e.message,session_id:m(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!0})}}switch(e.type===`user`&&J++,e.type){case`tombstone`:break;case`assistant`:{let t=e,n=t.message?.stop_reason;n!=null&&(Z=n),this.mutableMessages.push(t),yield*v(t);break}case`progress`:{let t=e;this.mutableMessages.push(t),A&&(W.push(t),C(W)),yield*v(t);break}case`user`:{let t=e;this.mutableMessages.push(t),yield*v(t);break}case`stream_event`:{let t=e.event;if(t.type===`message_start`){q=fe;let e=t.message;q=Te(q,e.usage)}if(t.type===`message_delta`){q=Te(q,t.usage);let e=t.delta;e.stop_reason!=null&&(Z=e.stop_reason)}t.type===`message_stop`&&(this.totalUsage=pe(this.totalUsage,q)),ae&&(yield{type:`stream_event`,event:t,session_id:m(),parent_tool_use_id:null,uuid:Y()});break}case`attachment`:{let n=e;this.mutableMessages.push(n),A&&(W.push(n),C(W));let r=n.attachment;if(r.type===`structured_output`)X=r.data;else if(r.type===`max_turns_reached`){A&&(t(process.env.WORKMATE_EAGER_FLUSH)||t(process.env.WORKMATE_IS_COWORK))&&await O(),yield{type:`result`,subtype:`error_max_turns`,duration_ms:Date.now()-M,duration_api_ms:h(),is_error:!0,num_turns:r.turnCount,stop_reason:Z,session_id:m(),total_cost_usd:g(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:L(K,N.fastMode),uuid:Y(),errors:[`Reached maximum number of turns (${r.maxTurns})`]};return}else D&&r.type===`queued_command`&&(yield{type:`user`,message:{role:`user`,content:r.prompt},session_id:m(),parent_tool_use_id:null,uuid:r.source_uuid||n.uuid,timestamp:n.timestamp,isReplay:!0});break}case`stream_request_start`:break;case`system`:{let t=e,n=this.config.snipReplay?.(t,this.mutableMessages);if(n!==void 0){n.executed&&(this.mutableMessages.length=0,this.mutableMessages.push(...n.messages));break}if(this.mutableMessages.push(t),t.subtype===`compact_boundary`&&t.compactMetadata){let e=t,n=this.mutableMessages.length-1;n>0&&this.mutableMessages.splice(0,n);let r=W.length-1;r>0&&W.splice(0,r),yield{type:`system`,subtype:`compact_boundary`,session_id:m(),uuid:t.uuid,compact_metadata:Je(e.compactMetadata)}}if(t.subtype===`api_error`){let e=t;yield{type:`system`,subtype:`api_retry`,attempt:e.retryAttempt,max_retries:e.maxRetries,retry_delay_ms:e.retryInMs,error_status:e.error.status??null,error:ge(e.error),session_id:m(),uuid:t.uuid}}break}case`tool_use_summary`:{let t=e;yield{type:`tool_use_summary`,summary:t.summary,preceding_tool_use_ids:t.precedingToolUseIds,session_id:m(),uuid:t.uuid};break}}if(p!==void 0&&g()>=p){A&&(t(process.env.WORKMATE_EAGER_FLUSH)||t(process.env.WORKMATE_IS_COWORK))&&await O(),yield{type:`result`,subtype:`error_max_budget_usd`,duration_ms:Date.now()-M,duration_api_ms:h(),is_error:!0,num_turns:J,stop_reason:Z,session_id:m(),total_cost_usd:g(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:L(K,N.fastMode),uuid:Y(),errors:[`Reached maximum budget ($${p}). Increase the limit with --max-budget-usd or start a new session.`]};return}if(e.type===`user`&&w){let e=be(this.mutableMessages,Ve)-$e,n=parseInt(process.env.MAX_STRUCTURED_OUTPUT_RETRIES||`5`,10);if(e>=n){A&&(t(process.env.WORKMATE_EAGER_FLUSH)||t(process.env.WORKMATE_IS_COWORK))&&await O(),yield{type:`result`,subtype:`error_max_structured_output_retries`,duration_ms:Date.now()-M,duration_api_ms:h(),is_error:!0,num_turns:J,stop_reason:Z,session_id:m(),total_cost_usd:g(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:L(K,N.fastMode),uuid:Y(),errors:[`Failed to provide valid structured output after ${n} attempts`]};return}}}let $=W.findLast(e=>e.type===`assistant`||e.type===`user`),et=$?.type??`undefined`,tt=$?.type===`assistant`?me($.message.content)?.type??`none`:`n/a`;if(A&&(t(process.env.WORKMATE_EAGER_FLUSH)||t(process.env.WORKMATE_IS_COWORK))&&await O(),!re($,Z)){yield{type:`result`,subtype:`error_during_execution`,duration_ms:Date.now()-M,duration_api_ms:h(),is_error:!0,num_turns:J,stop_reason:Z,session_id:m(),total_cost_usd:g(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:L(K,N.fastMode),uuid:Y(),errors:(()=>{let e=Fe(),t=Q?e.lastIndexOf(Q)+1:0;return[`[ede_diagnostic] result_type=${et} last_content_type=${tt} stop_reason=${Z}`,...e.slice(t).map(e=>e.error)]})()};return}let nt=``,rt=!1;if($.type===`assistant`){let e=me($.message.content);e?.type===`text`&&!_e.has(e.text)&&(nt=e.text),rt=!!$.isApiErrorMessage}yield{type:`result`,subtype:`success`,is_error:rt,duration_ms:Date.now()-M,duration_api_ms:h(),num_turns:J,result:nt,stop_reason:Z,session_id:m(),total_cost_usd:g(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,structured_output:X,fast_mode_state:L(K,N.fastMode),uuid:Y()}}interrupt(){this.abortController.abort()}resetAbortController(){this.abortController=M()}getAbortSignal(){return this.abortController.signal}getMessages(){return this.mutableMessages}getReadFileState(){return this.readFileState}getSessionId(){return m()}setModel(e){this.config.userSpecifiedModel=e}};async function*$e({commands:e,prompt:t,promptUuid:n,isMeta:r,cwd:i,tools:a,mcpClients:o,verbose:s=!1,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:d,canUseTool:ee,mutableMessages:f=[],getReadFileCache:p,setReadFileCache:m,customSystemPrompt:h,appendSystemPrompt:g,userSpecifiedModel:_,fallbackModel:te,jsonSchema:ne,getAppState:v,setAppState:re,abortController:b,replayUserMessages:x=!1,includePartialMessages:S=!1,handleElicitation:C,agents:w=[],setSDKStatus:T,orphanedPermission:ie}){let E=new Q({cwd:i,tools:a,commands:e,mcpClients:o,agents:w??[],canUseTool:ee,getAppState:v,setAppState:re,initialMessages:f,readFileCache:y(p()),customSystemPrompt:h,appendSystemPrompt:g,userSpecifiedModel:_,fallbackModel:te,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:d,jsonSchema:ne,verbose:s,handleElicitation:C,replayUserMessages:x,includePartialMessages:S,setSDKStatus:T,abortController:b,orphanedPermission:ie});try{yield*E.submitMessage(t,{uuid:n,isMeta:r})}finally{m(E.getReadFileState())}}export{qe as a,Z as i,$e as n,X as r,Q as t};