@readmagic/workmate 0.0.26 → 0.0.27

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 (335) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-mS8iUoWY.js → AddWorkspaceDirectory-DqlPtsVK.js} +1 -1
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-CgSethgo.js +1 -0
  3. package/dist/chunks/{AgentsMdExternalIncludesDialog-BHBkysy0.js → AgentsMdExternalIncludesDialog-rJS5l6yk.js} +1 -1
  4. package/dist/chunks/{App-D--vtCyq.js → App-DzRQpRKr.js} +1 -1
  5. package/dist/chunks/BackgroundTasksDialog-CBhSmdz_.js +2 -0
  6. package/dist/chunks/{BypassPermissionsModeDialog-DyqI98d2.js → BypassPermissionsModeDialog-zz-lnmJt.js} +1 -1
  7. package/dist/chunks/CustomSelect-CYmc4vRh.js +1 -0
  8. package/dist/chunks/{DiffDialog-BQAU2pJx.js → DiffDialog-CTUIAcEE.js} +6 -6
  9. package/dist/chunks/{Doctor-DJOMbSDE.js → Doctor-CLOYkPRR.js} +2 -2
  10. package/dist/chunks/Doctor-CiZNe_qx.js +1 -0
  11. package/dist/chunks/{ExitFlow-xBOnvhiW.js → ExitFlow-CATwJC4c.js} +1 -1
  12. package/dist/chunks/{InvalidConfigDialog-NiuhcaG5.js → InvalidConfigDialog-B-9Z58oD.js} +1 -1
  13. package/dist/chunks/{InvalidSettingsDialog-DrromC1I.js → InvalidSettingsDialog-B4EWjbp7.js} +1 -1
  14. package/dist/chunks/KeybindingProviderSetup-Dzg77_Xn.js +1 -0
  15. package/dist/chunks/MCPConnectionManager-CBY8nqdU.js +1 -0
  16. package/dist/chunks/MCPToolListView-C7HT6rrl.js +1 -0
  17. package/dist/chunks/{McpParsingWarnings-BYG2yqjO.js → McpParsingWarnings-Dj_Fu5o-.js} +1 -1
  18. package/dist/chunks/MessageSelector-Dw_ERK_Z.js +3 -0
  19. package/dist/chunks/Messages-RBfRELKn.js +10 -0
  20. package/dist/chunks/Onboarding-BRSXxc2E.js +1 -0
  21. package/dist/chunks/{PermissionDialog-tEMMa5-a.js → PermissionDialog-DjCRuzSm.js} +1 -1
  22. package/dist/chunks/{PressEnterToContinue-CPOaYnym.js → PressEnterToContinue-DE1RxMX_.js} +1 -1
  23. package/dist/chunks/{PromptInputFooterSuggestions-CwqAsTI2.js → PromptInputFooterSuggestions-ChpyD9B7.js} +1 -1
  24. package/dist/chunks/PromptInputHelpMenu-CrTT8MKE.js +1 -0
  25. package/dist/chunks/{ProviderSetup-J6Ty-Wj8.js → ProviderSetup-BEV95bnz.js} +1 -1
  26. package/dist/chunks/QueryEngine-BBBkZWu2.js +1 -0
  27. package/dist/chunks/REPL-BDnZnm__.js +124 -0
  28. package/dist/chunks/REPL-BHk0vZDf.js +1 -0
  29. package/dist/chunks/{ResumeConversation-Cmsbo5m7.js → ResumeConversation-BuSqBrm1.js} +1 -1
  30. package/dist/chunks/{SearchBox-DQBLKyzJ.js → SearchBox-zA5QwIpO.js} +1 -1
  31. package/dist/chunks/SearchExtraToolsTool-CdWB9sO8.js +1 -0
  32. package/dist/chunks/Settings-DYKmPdbd.js +2 -0
  33. package/dist/chunks/Spinner-DOI8qqZi.js +1 -0
  34. package/dist/chunks/SpinnerGlyph-BR_SiV9L.js +1 -0
  35. package/dist/chunks/{TextInput-BboKIug2.js → TextInput-ZKU-x_FD.js} +7 -7
  36. package/dist/chunks/{ThemePicker-DTpXbEY0.js → ThemePicker-B69oDgXN.js} +1 -1
  37. package/dist/chunks/TrustDialog-BSG8Ibh8.js +1 -0
  38. package/dist/chunks/{ValidationErrorsList-C_gDQfm1.js → ValidationErrorsList-BUYHEft4.js} +1 -1
  39. package/dist/chunks/{_baseEach-DGbaIpJA.js → _baseEach-P0u1zIx6.js} +1 -1
  40. package/dist/chunks/{add-dir-B576wzi9.js → add-dir-C8RmmyQK.js} +1 -1
  41. package/dist/chunks/{agentDisplay-ZuFoBZYu.js → agentDisplay-np7CH47m.js} +1 -1
  42. package/dist/chunks/{agents-Dy4_hDic.js → agents-DRQlR5M1.js} +1 -1
  43. package/dist/chunks/agents-DedoH0Q4.js +101 -0
  44. package/dist/chunks/allErrors-DvcU0w0F.js +1 -0
  45. package/dist/chunks/{appleTerminalBackup-C9kjzdM9.js → appleTerminalBackup-Bemd4RXh.js} +1 -1
  46. package/dist/chunks/backgroundHousekeeping-B56nFTzq.js +1 -0
  47. package/dist/chunks/{backgroundHousekeeping-PyLNnGdw.js → backgroundHousekeeping-BtEJ6TeC.js} +1 -1
  48. package/dist/chunks/banner-CuoceXzz.js +2 -0
  49. package/dist/chunks/branch-ClhlS7f8.js +2 -0
  50. package/dist/chunks/{break-cache-DL95nKZl.js → break-cache-B1nuWtD_.js} +2 -2
  51. package/dist/chunks/{btw-Y44ctueB.js → btw-B-FLxlx-.js} +1 -1
  52. package/dist/chunks/bundledMode-D9omqD3L.js +2 -0
  53. package/dist/chunks/caches-D7arwhaa.js +1 -0
  54. package/dist/chunks/caches-Dn8yrJmL.js +1 -0
  55. package/dist/chunks/{clear-DtTkA707.js → clear-BnWv0i65.js} +1 -1
  56. package/dist/chunks/{client-aJ2Nr_sh.js → client-2w-g5kMx.js} +1 -1
  57. package/dist/chunks/client-B0ngS4Uu.js +1 -0
  58. package/dist/chunks/client-BP4DOH3K.js +1 -0
  59. package/dist/chunks/{client-Bw_L3lSc.js → client-pA7fKk0-.js} +1 -1
  60. package/dist/chunks/commands-AcfFLgl5.js +1 -0
  61. package/dist/chunks/{compact-CvNOtu7J.js → compact-Banc-SNk.js} +1 -1
  62. package/dist/chunks/config-BDn2YIjC.js +3 -0
  63. package/dist/chunks/config-BhBcadjZ.js +1 -0
  64. package/dist/chunks/config-Bm5pVdCq.js +1 -0
  65. package/dist/chunks/{context-Opu4E8dL.js → context-BvDBAyJ9.js} +1 -1
  66. package/dist/chunks/context-noninteractive-BK2IDLSS.js +1 -0
  67. package/dist/chunks/{context-noninteractive-B1V2Mp26.js → context-noninteractive-CuHHniJn.js} +9 -9
  68. package/dist/chunks/conversation-B2dX3X4Z.js +1 -0
  69. package/dist/chunks/{conversation-CG_z7TLE.js → conversation-Cjaftrrw.js} +1 -1
  70. package/dist/chunks/conversationRecovery-NL05oJb1.js +1 -0
  71. package/dist/chunks/crossProjectResume-BzltC4NJ.js +40 -0
  72. package/dist/chunks/{debug-kBjDaVkQ.js → debug-2pVES-2G.js} +1 -1
  73. package/dist/chunks/detectRepository--luIRv5H.js +1 -0
  74. package/dist/chunks/{diff-Cv7tX2-P.js → diff--6gQCx_x.js} +1 -1
  75. package/dist/chunks/directoryCompletion-BC0qRmrz.js +1 -0
  76. package/dist/chunks/doctor-CQf8xPZH.js +1 -0
  77. package/dist/chunks/entry-DWYOrkFS.js +13 -0
  78. package/dist/chunks/{envUtils-DZ_SvEVz.js → envUtils-QyzA_cFM.js} +1 -1
  79. package/dist/chunks/{execFileNoThrow-BfZFnCGa.js → execFileNoThrow-DXSEj8ZO.js} +1 -1
  80. package/dist/chunks/{exit-OKEV_ddw.js → exit-uKtXb5U3.js} +1 -1
  81. package/dist/chunks/{extraUsage-BlRL3yeb.js → extraUsage-Dr0YXm1w.js} +1 -1
  82. package/dist/chunks/extractMemories-8yvMGZ1J.js +1 -0
  83. package/dist/chunks/fast-C5-lNCQi.js +1 -0
  84. package/dist/chunks/fast-aNkj6WvB.js +1 -0
  85. package/dist/chunks/fetchModelList-9w1E4Ue8.js +1 -0
  86. package/dist/chunks/fetchModelList-D2quBF6M.js +1 -0
  87. package/dist/chunks/fileSuggestions-BYD78vcF.js +3 -0
  88. package/dist/chunks/{fpsMetrics-Ixd0J4CH.js → fpsMetrics-DIpm2-xw.js} +1 -1
  89. package/dist/chunks/{gemini-BfVyavwQ.js → gemini-BNBptTET.js} +1 -1
  90. package/dist/chunks/generateSessionName-CO2484aJ.js +1 -0
  91. package/dist/chunks/{genericProcessUtils-CVtQOTO2.js → genericProcessUtils-GqURdVAv.js} +1 -1
  92. package/dist/chunks/{goal-BidR-GFa.js → goal-j0wdadwM.js} +1 -1
  93. package/dist/chunks/{grok-DLcuI-U7.js → grok-BpO1ZwK_.js} +1 -1
  94. package/dist/chunks/{help-CZuvYhXj.js → help-DwhA0qQ6.js} +1 -1
  95. package/dist/chunks/{history-BxPGftQw.js → history-CUrqO9rV.js} +1 -1
  96. package/dist/chunks/hooks-B5Wq-KxE.js +1 -0
  97. package/dist/chunks/{hooks-ehqfAM5F.js → hooks-DG4_WdZ2.js} +2 -2
  98. package/dist/chunks/install-BbmCNCuM.js +1 -0
  99. package/dist/chunks/{instrumentation-B9bfF2mA.js → instrumentation-DpPmDyNF.js} +4 -4
  100. package/dist/chunks/{job-Coztdn6A.js → job-GcmX1ALd.js} +1 -1
  101. package/dist/chunks/{keybindings-DwSdLpaE.js → keybindings-CxgQqQJe.js} +1 -1
  102. package/dist/chunks/{launchLocalMemory-DRzfpIOB.js → launchLocalMemory-CDgT5lst.js} +1 -1
  103. package/dist/chunks/{launchOnboarding-D2zFCJf-.js → launchOnboarding-uQ_ux9sS.js} +1 -1
  104. package/dist/chunks/loadAgentsDir-BBbIAiay.js +1 -0
  105. package/dist/chunks/{loadAgentsDir-DR5PVAc3.js → loadAgentsDir-uuZYOgKn.js} +392 -392
  106. package/dist/chunks/{loadPluginHooks-BiQgGfUJ.js → loadPluginHooks-QoVXsBjy.js} +1 -1
  107. package/dist/chunks/loader-BMAtuwRa.js +1 -0
  108. package/dist/chunks/localSearch-D6MhwvnR.js +1 -0
  109. package/dist/chunks/{localSearch-CzkxDuOR.js → localSearch-yVCDrVrf.js} +1 -1
  110. package/dist/chunks/{log-DWZny1vM.js → log-L1kqxa_P.js} +1 -1
  111. package/dist/chunks/{logoUtils-DR5T0pr3.js → logoUtils-B4wCDKs9.js} +1 -1
  112. package/dist/chunks/{magicDocs-BwBxjfLo.js → magicDocs-D53lV8b5.js} +2 -2
  113. package/dist/chunks/{main-Ryi27wYq.js → main-fy_XSXGj.js} +34 -34
  114. package/dist/chunks/{managedEnv-Do9fgLpk.js → managedEnv-B8YWmM4A.js} +1 -1
  115. package/dist/chunks/managedEnv-ulQBH73B.js +1 -0
  116. package/dist/chunks/{managedEnvConstants-CWcT7nYr.js → managedEnvConstants-BPY8yF1A.js} +1 -1
  117. package/dist/chunks/{mcp-BCpnF6wD.js → mcp--LmEVBRg.js} +1 -1
  118. package/dist/chunks/mcp-CZUVaPb3.js +5 -0
  119. package/dist/chunks/{mcp-CZBTxbhu.js → mcp-DCl-Tz-C.js} +1 -1
  120. package/dist/chunks/memory-Bu5ku7y9.js +1 -0
  121. package/dist/chunks/{modalContext-CBE8xuck.js → modalContext-sU2lfR08.js} +1 -1
  122. package/dist/chunks/{mode-wq70cR44.js → mode-Bteqe2QG.js} +1 -1
  123. package/dist/chunks/{model-DVk9-2dk.js → model-CHDU5yqH.js} +1 -1
  124. package/dist/chunks/model-CcHyMyBv.js +1 -0
  125. package/dist/chunks/modelOptions-CJV1R3Jt.js +1 -0
  126. package/dist/chunks/nativeInstaller-CIUYh1aD.js +1 -0
  127. package/dist/chunks/{notifications-dGBuNvFj.js → notifications-GLnjirCl.js} +1 -1
  128. package/dist/chunks/{observationStore-D0rm3GhP.js → observationStore-pnSSxec_.js} +1 -1
  129. package/dist/chunks/{onChangeAppState-B4K-rSaF.js → onChangeAppState-CxGW2d-l.js} +1 -1
  130. package/dist/chunks/{openai-DAwnAV9K.js → openai-BpGQT2Iv.js} +1 -1
  131. package/dist/chunks/{overlayContext-B6i_6y_0.js → overlayContext-7wgLio1O.js} +1 -1
  132. package/dist/chunks/{panel-C0CF3noE.js → panel-DNiXDhBX.js} +1 -1
  133. package/dist/chunks/{parser-DThLwgdM.js → parser-CTnaXFVJ.js} +1 -1
  134. package/dist/chunks/parser-Diihup2V.js +1 -0
  135. package/dist/chunks/{partition-BRQHofxD.js → partition-djFY9gGI.js} +1 -1
  136. package/dist/chunks/{pasteStore-BmehVo5j.js → pasteStore-njJCBMKr.js} +1 -1
  137. package/dist/chunks/permissions-DNedQyLg.js +3 -0
  138. package/dist/chunks/pidLock-CFUBtZck.js +3 -0
  139. package/dist/chunks/{plan-B6U3ioer.js → plan-DI0n7LIV.js} +1 -1
  140. package/dist/chunks/plugin-BQ8gRVYF.js +17 -0
  141. package/dist/chunks/pluginAutoupdate-CNrHb4RJ.js +1 -0
  142. package/dist/chunks/{pluginBlocklist-DAoUENwc.js → pluginBlocklist-CKCsgWdY.js} +1 -1
  143. package/dist/chunks/{pluginCliCommands-CaHnj0C_.js → pluginCliCommands-CACeyIwz.js} +1 -1
  144. package/dist/chunks/{pluginFlagging-BCj9LJP3.js → pluginFlagging-CUvkKGOB.js} +1 -1
  145. package/dist/chunks/pluginOperations-Ca_T-HYn.js +2 -0
  146. package/dist/chunks/pluginStartupCheck-DftTiXct.js +1 -0
  147. package/dist/chunks/pluginStartupCheck-Du9yx2P8.js +1 -0
  148. package/dist/chunks/{plugins-D7zyI9c4.js → plugins-Divl-P-X.js} +1 -1
  149. package/dist/chunks/{poorMode-Ocff_UT1.js → poorMode-CG2JNTD0.js} +1 -1
  150. package/dist/chunks/poorMode-eMIFCAC_.js +1 -0
  151. package/dist/chunks/print-DSHypGJa.js +13 -0
  152. package/dist/chunks/processBashCommand-BLcFmbyG.js +1 -0
  153. package/dist/chunks/processSlashCommand-Caif46Gi.js +5 -0
  154. package/dist/chunks/{projectContext-QN5U3Ggr.js → projectContext-BFfHgAMh.js} +1 -1
  155. package/dist/chunks/{projectContext-COeHKDrk.js → projectContext-DnJHynXv.js} +1 -1
  156. package/dist/chunks/{projectOnboardingState-KqcpRXls.js → projectOnboardingState-nTCycGCD.js} +1 -1
  157. package/dist/chunks/prompt-BZmu5CeK.js +1 -0
  158. package/dist/chunks/{prompt-CTByhpUI.js → prompt-BfXryFt-.js} +8 -8
  159. package/dist/chunks/prompt-Cogr_WZr.js +1 -0
  160. package/dist/chunks/promptEditor-14TB3MYt.js +4 -0
  161. package/dist/chunks/protocolHandler-VigBkAQQ.js +13 -0
  162. package/dist/chunks/{proxy-BtWuysHM.js → proxy--_NfbJhm.js} +1 -1
  163. package/dist/chunks/reconciler-B9XFdL4f.js +1 -0
  164. package/dist/chunks/{refresh-B4pqFp12.js → refresh-CBHbWTGg.js} +1 -1
  165. package/dist/chunks/reject-CBxnwckZ.js +1 -0
  166. package/dist/chunks/{reload-plugins-DXQqk7q6.js → reload-plugins-5eFWrQlL.js} +1 -1
  167. package/dist/chunks/{rename-D4XBmTBI.js → rename-Cw7cMerG.js} +1 -1
  168. package/dist/chunks/{renderOptions-DkP98P_d.js → renderOptions-B0RFpjRI.js} +1 -1
  169. package/dist/chunks/{resume-DzIev0JI.js → resume-U2D0ybfU.js} +1 -1
  170. package/dist/chunks/ripgrep-67m14ImZ.js +5 -0
  171. package/dist/chunks/ripgrep-DB7KB8RZ.js +1 -0
  172. package/dist/chunks/{runtimeObserver-BPqlbu0B.js → runtimeObserver-CWaYMJG8.js} +2 -2
  173. package/dist/chunks/{runtimeObserver-BUHs3qjs.js → runtimeObserver-DOYlxx9H.js} +1 -1
  174. package/dist/chunks/sandbox-adapter-Df7Wpt77.js +1 -0
  175. package/dist/chunks/sandbox-toggle-BtiPyjT3.js +1 -0
  176. package/dist/chunks/searchExtraTools-CbJVb_Zk.js +1 -0
  177. package/dist/chunks/select-BuTJbu_Q.js +1 -0
  178. package/dist/chunks/sessionFileAccessHooks-_mxyfQmn.js +1 -0
  179. package/dist/chunks/sessionObserver-BZVgzp3W.js +1 -0
  180. package/dist/chunks/{sessionObserver-B6xzxckA.js → sessionObserver-cfwD8pV8.js} +1 -1
  181. package/dist/chunks/sessionStorage-SC5RfnUP.js +1 -0
  182. package/dist/chunks/sessionTracing-DsdcOqvc.js +11 -0
  183. package/dist/chunks/settings-D4M13toi.js +104 -0
  184. package/dist/chunks/settings-Dfit5gGT.js +1 -0
  185. package/dist/chunks/setup-DR-KEmxL.js +3 -0
  186. package/dist/chunks/{shadowedRuleDetection-D6R2OeoH.js → shadowedRuleDetection-DiZUDzxU.js} +1 -1
  187. package/dist/chunks/{sideQuestion-5jcbOMsR.js → sideQuestion-CdgUarC2.js} +1 -1
  188. package/dist/chunks/{sinks-B-kFqjjd.js → sinks-Cy3NqVbk.js} +1 -1
  189. package/dist/chunks/sinks-D41OiGE4.js +1 -0
  190. package/dist/chunks/{skillChangeDetector-103-nEle.js → skillChangeDetector-CVFCJcG7.js} +1 -1
  191. package/dist/chunks/{skillGapStore-DOz1KCqo.js → skillGapStore-BJV8ZIB1.js} +2 -2
  192. package/dist/chunks/{skillLifecycle-D9NkIwFQ.js → skillLifecycle-iO_3s9Ff.js} +2 -2
  193. package/dist/chunks/{skillSearchPanel-DFiSZaJ4.js → skillSearchPanel-BL5gXTHU.js} +2 -2
  194. package/dist/chunks/skills-BEp3_RyT.js +1 -0
  195. package/dist/chunks/sleep-xKMbXTJe.js +1 -0
  196. package/dist/chunks/{src-WZ94ZKI3.js → src-BX54x08P.js} +1 -1
  197. package/dist/chunks/{src-Cy5_qH26.js → src-HB5wLari.js} +1 -1
  198. package/dist/chunks/{startupProfiler-DIM_Ihyp.js → startupProfiler-B9Qv2QGH.js} +1 -1
  199. package/dist/chunks/startupProfiler-DWcM4QBl.js +1 -0
  200. package/dist/chunks/{staticRender-RHUIg5ln.js → staticRender-Bt82RvGc.js} +1 -1
  201. package/dist/chunks/status-6JMz8jmM.js +1 -0
  202. package/dist/chunks/{statusNoticeHelpers-DI45AH-c.js → statusNoticeHelpers-BoloSeXY.js} +1 -1
  203. package/dist/chunks/{stringUtils-D_xPrwGQ.js → stringUtils-Cs6E5f-B.js} +1 -1
  204. package/dist/chunks/switcher-95d4TrQH.js +1 -0
  205. package/dist/chunks/{switcher-DhZCaAun.js → switcher-DSt2cVjA.js} +1 -1
  206. package/dist/chunks/{tasks-6suPhqsK.js → tasks-DyBUXnQb.js} +1 -1
  207. package/dist/chunks/{templateJobs-BKVEWCsb.js → templateJobs-BBnReWWj.js} +7 -7
  208. package/dist/chunks/{terminalSetup-7PUR4hfo.js → terminalSetup-CDpFfqqV.js} +1 -1
  209. package/dist/chunks/{terminalSetup-Cqy5_PhJ.js → terminalSetup-DedaY1P7.js} +4 -4
  210. package/dist/chunks/{theme-B-HG2PUs.js → theme-BZOy9Iqh.js} +1 -1
  211. package/dist/chunks/tipRegistry-Cl5sdLRX.js +2 -0
  212. package/dist/chunks/{toolEventObserver-BY3QVnr6.js → toolEventObserver-ClwWmVbH.js} +1 -1
  213. package/dist/chunks/{toolPool-BcwIF8Q_.js → toolPool-DSTbgGmX.js} +1 -1
  214. package/dist/chunks/{udsClient-CCxgLiZy.js → udsClient-CWeoNrm3.js} +1 -1
  215. package/dist/chunks/{useDoublePress-DQBLKyzJ.js → useDoublePress-zA5QwIpO.js} +1 -1
  216. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-BgJrnuDl.js → useExitOnCtrlCDWithKeybindings-ClN4NJnB.js} +1 -1
  217. package/dist/chunks/useMainLoopModel-Bgxpmn2Q.js +1 -0
  218. package/dist/chunks/useManagePlugins-CxHz-gUP.js +1 -0
  219. package/dist/chunks/useMergedTools-BUuWew0-.js +1 -0
  220. package/dist/chunks/{useSearchInput-BITV_Txn.js → useSearchInput-BIQN_-Hm.js} +1 -1
  221. package/dist/chunks/{useSettingsErrors-CO0fTNzn.js → useSettingsErrors-BDJCLei_.js} +1 -1
  222. package/dist/chunks/util-BHr5l6Bx.js +1 -0
  223. package/dist/chunks/validatePlugin-fx1Y8vam.js +1 -0
  224. package/dist/chunks/{vim-qgMS88ss.js → vim-CYjMtnwH.js} +1 -1
  225. package/dist/chunks/worktree-CGu_58ue.js +1 -0
  226. package/dist/cli.js +1 -1
  227. package/package.json +2 -2
  228. package/dist/chunks/AgentsMdExternalIncludesDialog-DuStmCjj.js +0 -1
  229. package/dist/chunks/BackgroundTasksDialog-mcDuiNGs.js +0 -2
  230. package/dist/chunks/CustomSelect-CpMbxYbt.js +0 -1
  231. package/dist/chunks/Doctor-BU69VQzw.js +0 -1
  232. package/dist/chunks/KeybindingProviderSetup-CSUkJHTT.js +0 -1
  233. package/dist/chunks/MCPConnectionManager-Bn1PDn3R.js +0 -1
  234. package/dist/chunks/MCPToolListView-BRxjOaOL.js +0 -1
  235. package/dist/chunks/MessageSelector-B7xAQqZI.js +0 -3
  236. package/dist/chunks/Messages-CxMsfjOa.js +0 -10
  237. package/dist/chunks/Onboarding-CkATe87e.js +0 -1
  238. package/dist/chunks/PromptInputHelpMenu-krq-hiFO.js +0 -1
  239. package/dist/chunks/QueryEngine-Mdi_kUaL.js +0 -1
  240. package/dist/chunks/REPL-BgzQtSFF.js +0 -1
  241. package/dist/chunks/REPL-rirm6s_7.js +0 -124
  242. package/dist/chunks/SearchExtraToolsTool-D1-7C04z.js +0 -1
  243. package/dist/chunks/SelectMulti-BpAjjhsn.js +0 -1
  244. package/dist/chunks/Settings-B6DImvca.js +0 -2
  245. package/dist/chunks/Spinner-DhhSOFcN.js +0 -1
  246. package/dist/chunks/SpinnerGlyph-CmVXC-_9.js +0 -1
  247. package/dist/chunks/TrustDialog-CZ8JpySm.js +0 -1
  248. package/dist/chunks/agents-HIOBiw4w.js +0 -101
  249. package/dist/chunks/allErrors-CxPNR2WN.js +0 -1
  250. package/dist/chunks/backgroundHousekeeping-ZCMPmQuU.js +0 -1
  251. package/dist/chunks/banner-DqFectPg.js +0 -2
  252. package/dist/chunks/branch-B_BL5N9N.js +0 -2
  253. package/dist/chunks/bundledMode-BxyD5cqq.js +0 -1
  254. package/dist/chunks/caches-5xZ4dSXt.js +0 -1
  255. package/dist/chunks/caches-Be9saXxV.js +0 -1
  256. package/dist/chunks/claudeDesktop-g8eUUY2E.js +0 -1
  257. package/dist/chunks/client-mnUISv_N.js +0 -1
  258. package/dist/chunks/client-wPqIdEVm.js +0 -1
  259. package/dist/chunks/commands-wfE12a4L.js +0 -1
  260. package/dist/chunks/config-D3K87Mm1.js +0 -3
  261. package/dist/chunks/config-DTga6Ku8.js +0 -1
  262. package/dist/chunks/config-DtmqWusU.js +0 -1
  263. package/dist/chunks/context-noninteractive-eIlneYiL.js +0 -1
  264. package/dist/chunks/conversation-CHesBfFZ.js +0 -1
  265. package/dist/chunks/conversationRecovery-OhitW-7g.js +0 -1
  266. package/dist/chunks/crossProjectResume-mmYx8PrZ.js +0 -40
  267. package/dist/chunks/detectRepository-M6K2wc7h.js +0 -1
  268. package/dist/chunks/directoryCompletion-BHyjyKAM.js +0 -1
  269. package/dist/chunks/doctor-DeBG5SL5.js +0 -1
  270. package/dist/chunks/entry-CbhyIWgj.js +0 -13
  271. package/dist/chunks/extractMemories-jnsv-_n_.js +0 -1
  272. package/dist/chunks/fast-4I_qPJCd.js +0 -1
  273. package/dist/chunks/fast-DiolM1M7.js +0 -1
  274. package/dist/chunks/fetchModelList-BRFTQim4.js +0 -1
  275. package/dist/chunks/fetchModelList-qPKAuu4m.js +0 -1
  276. package/dist/chunks/fileSuggestions-iWVXvvLB.js +0 -3
  277. package/dist/chunks/generateSessionName-CGaTTXCA.js +0 -1
  278. package/dist/chunks/hooks-Bg9WIjZQ.js +0 -1
  279. package/dist/chunks/install-ACGY0vhM.js +0 -1
  280. package/dist/chunks/loadAgentsDir-DqAbnpB-.js +0 -1
  281. package/dist/chunks/loader-6MqzNGmV.js +0 -1
  282. package/dist/chunks/localSearch-DW3JT2MA.js +0 -1
  283. package/dist/chunks/managedEnv-DCEJh3z3.js +0 -1
  284. package/dist/chunks/mcp-CJ6SDJEK.js +0 -6
  285. package/dist/chunks/memory-BQO6Y0ak.js +0 -1
  286. package/dist/chunks/model-D42epddJ.js +0 -1
  287. package/dist/chunks/modelOptions-beLgXORr.js +0 -1
  288. package/dist/chunks/nativeInstaller-ChGSz1lb.js +0 -1
  289. package/dist/chunks/parser-BZt0VFd_.js +0 -1
  290. package/dist/chunks/permissions-DkfWKN-B.js +0 -3
  291. package/dist/chunks/pidLock-YvAaIrIY.js +0 -3
  292. package/dist/chunks/platform-Vl9IynC3.js +0 -2
  293. package/dist/chunks/plugin-CTA2_-F7.js +0 -17
  294. package/dist/chunks/pluginAutoupdate-Dy5W3HWE.js +0 -1
  295. package/dist/chunks/pluginOperations-ClXNOOG6.js +0 -2
  296. package/dist/chunks/pluginStartupCheck-CiwMKGjx.js +0 -1
  297. package/dist/chunks/pluginStartupCheck-U8_xk25t.js +0 -1
  298. package/dist/chunks/poorMode-DtzWNhsY.js +0 -1
  299. package/dist/chunks/print-BzljdXem.js +0 -13
  300. package/dist/chunks/processBashCommand-RUkmyAl4.js +0 -1
  301. package/dist/chunks/processSlashCommand-DRLO-jNV.js +0 -5
  302. package/dist/chunks/prompt-DTpfW6yP.js +0 -1
  303. package/dist/chunks/prompt-D__eHY_5.js +0 -1
  304. package/dist/chunks/promptEditor-CpUFgGzc.js +0 -4
  305. package/dist/chunks/protocolHandler-BQSLVGnG.js +0 -13
  306. package/dist/chunks/reconciler-D6BUq8WB.js +0 -1
  307. package/dist/chunks/reject-C6IvUvBt.js +0 -1
  308. package/dist/chunks/ripgrep-CYP26Fhg.js +0 -1
  309. package/dist/chunks/ripgrep-D1f1pbCz.js +0 -5
  310. package/dist/chunks/sandbox-adapter-CumL75tU.js +0 -1
  311. package/dist/chunks/sandbox-toggle-CTtET6Xq.js +0 -1
  312. package/dist/chunks/searchExtraTools-BMCU2zEf.js +0 -1
  313. package/dist/chunks/select-FrwoTzuc.js +0 -1
  314. package/dist/chunks/sessionFileAccessHooks-WO8WTdT9.js +0 -1
  315. package/dist/chunks/sessionObserver-CBrM4opL.js +0 -1
  316. package/dist/chunks/sessionStorage-C1EAxDWG.js +0 -1
  317. package/dist/chunks/sessionTracing-UFK96PxT.js +0 -11
  318. package/dist/chunks/settings-BK6gCko-.js +0 -1
  319. package/dist/chunks/settings-YIDksG5Z.js +0 -24
  320. package/dist/chunks/setup-BBvZyrfz.js +0 -3
  321. package/dist/chunks/sinks-DB_D4lmu.js +0 -1
  322. package/dist/chunks/skills-DgeLr52a.js +0 -1
  323. package/dist/chunks/sleep-BbWr_FL1.js +0 -1
  324. package/dist/chunks/startupProfiler-FpGsKWYk.js +0 -1
  325. package/dist/chunks/status-CKLecQZV.js +0 -1
  326. package/dist/chunks/switcher-D2Z2ZNQ0.js +0 -1
  327. package/dist/chunks/tipRegistry-BR_lSGRw.js +0 -2
  328. package/dist/chunks/types-CD25a50S.js +0 -81
  329. package/dist/chunks/use-select-navigation-CW5alA9r.js +0 -1
  330. package/dist/chunks/useMainLoopModel-BVgJo4hN.js +0 -1
  331. package/dist/chunks/useManagePlugins-CrWjzESW.js +0 -1
  332. package/dist/chunks/useMergedTools-r6GQq5mI.js +0 -1
  333. package/dist/chunks/util-_zo3I1y8.js +0 -1
  334. package/dist/chunks/validatePlugin-DFGdRhA-.js +0 -1
  335. package/dist/chunks/worktree-CR_M6Qfy.js +0 -1
@@ -0,0 +1 @@
1
+ import{m as e,s as t,y as n}from"./settings-D4M13toi.js";e();export{t as getSettingsForSource,n as updateSettingsForSource};
@@ -0,0 +1,3 @@
1
+ import{n as e,t}from"./memoize-BK3gG5ob.js";import{l as n,o as r,s as i}from"./envUtils-QyzA_cFM.js";import{di as a,fi as o}from"./src-BX54x08P.js";import{$n as s,Qn as c,Rr as l,Ur as ee,Xt as u,di as d,qr as f,qt as te,ui as p,zr as ne}from"./settings-D4M13toi.js";import{Dn as re,F as m,Hn as h,Pt as g,Tn as ie,X as ae,at as oe}from"./state-CXY-q5gr.js";import{$_ as _,$x as v,Ab as se,An as ce,At as y,Bs as le,By as ue,Cg as de,Db as fe,Di as pe,J_ as b,Ji as x,Ks as S,Lp as C,Mb as w,Mi as T,Ob as E,Q_ as D,Rp as O,St as k,Vs as A,Ws as j,X_ as M,Y_ as N,Z_ as P,ai as F,am as I,av as L,bb as R,cw as z,dv as B,em as me,ev as he,gr as ge,gt as _e,ht as ve,im as ye,iv as be,jb as xe,jn as Se,kn as Ce,ky as we,mn as Te,nv as Ee,om as De,ov as Oe,ow as ke,pn as Ae,pv as V,rv as je,tm as Me,tv as Ne,uv as Pe,vt as H,wg as Fe,wy as Ie,xb as U,ya as W,zy as Le}from"./loadAgentsDir-uuZYOgKn.js";import{n as Re,t as G}from"./cwd-DrEEb4f5.js";import{I as K,M as ze,N as Be,f as Ve,u as He}from"./debug-2pVES-2G.js";import{a as Ue,d as We}from"./config-BDn2YIjC.js";import{o as Ge,s as Ke}from"./log-L1kqxa_P.js";import{n as q}from"./analytics-COpjZpvd.js";import{n as qe,r as J}from"./startupProfiler-B9Qv2QGH.js";import{X as Je,Y as Ye}from"./model-CcHyMyBv.js";import{ln as Y,pn as Xe}from"./prompt-BfXryFt-.js";import{a as Ze,r as Qe}from"./projectOnboardingState-nTCycGCD.js";import{j as $e,k as X}from"./sessionTracing-DsdcOqvc.js";import{i as et,n as tt}from"./appleTerminalBackup-Bemd4RXh.js";import{c as nt,t as rt}from"./nativeInstaller-CIUYh1aD.js";import{l as Z,s as it}from"./logoUtils-B4wCDKs9.js";import{i as at,r as ot}from"./runtimeObserver-CWaYMJG8.js";import{t as st}from"./sinks-Cy3NqVbk.js";import{writeFile as Q}from"fs/promises";r(),o(),g(),Re(),p(),Ge(),f(),u(),We(),z(),xe(),fe(),R(),Fe(),T(),ge(),Te(),t(),Xe(),ue(),s(),j(),Ve(),C(),x(),Se(),Ye(),B(),q(),me(),I(),_(),K();function ct(){return!1}function lt(){return{}}var $;function ut(e,t){let n=0,r=t==null;for(let i of e){if(!r){i.uuid===t&&(r=!0);continue}if(i.type===`assistant`){let e=i.message.content;Array.isArray(e)&&(n+=c(e,e=>e.type===`tool_use`))}}return n}function dt(e){let t=V(e);if(!he()){if(!P(t))return!1;je()}let n=D(t),r=ut(e,$)>=M(),i=W(e);if(n&&r||n&&!i){let t=e[e.length-1];return t?.uuid&&($=t.uuid),!0}return!1}async function ft(e){let t=He(),n=Ce();await t.mkdir(n,{mode:448});let r=ce();try{await Q(r,``,{encoding:`utf-8`,mode:384,flag:`wx`}),await Q(r,await De(),{encoding:`utf-8`,mode:384})}catch(e){if(Be(e)!==`EEXIST`)throw e}e.readFileState.delete(r);let i=await Le.call({file_path:r},e),a=``,o=i.data;return o.type===`text`&&(a=o.file.content),a.length,{memoryPath:r,currentMemory:a}}var pt=e(()=>{let e=lt();Oe({minimumMessageTokensToInit:e.minimumMessageTokensToInit&&e.minimumMessageTokensToInit>0?e.minimumMessageTokensToInit:b.minimumMessageTokensToInit,minimumTokensBetweenUpdate:e.minimumTokensBetweenUpdate&&e.minimumTokensBetweenUpdate>0?e.minimumTokensBetweenUpdate:b.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:e.toolCallsBetweenUpdates&&e.toolCallsBetweenUpdates>0?e.toolCallsBetweenUpdates:b.toolCallsBetweenUpdates})}),mt=Je(async e=>{let{messages:t,toolUseContext:n,querySource:r}=e;if(r!==`repl_main_thread`||!ct()||(pt(),!dt(t)))return;Ee();let i=A(n),{memoryPath:a,currentMemory:o}=await ft(i);await S({promptMessages:[v({content:await ye(o,a)})],cacheSafeParams:le(e),canUseTool:gt(a),querySource:`session_memory`,forkLabel:`session_memory`,overrides:{readFileState:i.readFileState}});let s=t[t.length-1],c=s?Pe(s):void 0,l=N();c?.input_tokens,c?.output_tokens,c?.cache_read_input_tokens,c?.cache_creation_input_tokens,l.minimumMessageTokensToInit,l.minimumTokensBetweenUpdate,l.toolCallsBetweenUpdates,be(V(t)),_t(t),Ne()});function ht(){Me()&&O(mt)}function gt(e){return async(t,n)=>{if(t.name===`Edit`&&typeof n==`object`&&n&&`file_path`in n){let t=n.file_path;if(typeof t==`string`&&t===e)return{behavior:`allow`,updatedInput:n}}return{behavior:`deny`,message:`only ${Y} on ${e} is allowed`,decisionReason:{type:`other`,reason:`only ${Y} on ${e} is allowed`}}}}function _t(e){if(!W(e)){let t=e[e.length-1];t?.uuid&&L(t.uuid)}}q(),at(),et(),we(),$e(),K(),Z(),rt(),Qe(),qe(),k();async function vt(e,t,r,o,s,c,u,f){d(`info`,`setup_started`);let p=process.version.match(/^v(\d+)\./)?.[1];if((!p||parseInt(p,10)<18)&&(console.error(a.bold.red(`Error: Work Mate requires Node.js version 18 or higher.`)),process.exit(1)),u&&h(de(u)),!m())try{let e=await tt();e.status===`restored`?console.log(a.yellow(`Detected an interrupted Terminal.app setup. Your original settings have been restored. You may need to restart Terminal.app for the changes to take effect.`)):e.status===`failed`&&console.error(a.red(`Failed to restore Terminal.app settings. Please manually restore your original settings with: defaults import com.apple.Terminal ${e.backupPath}.`))}catch(e){Ke(e)}U(e);let g=Date.now();if(se(),d(`info`,`setup_hooks_captured`,{duration_ms:Date.now()-g}),E(e),o){let t=Ae(),n=await ee();!t&&!n&&(process.stderr.write(a.red(`Error: Can only use --worktree in a git repository, but ${a.bold(e)} is not a git repository. Configure a WorktreeCreate hook in settings.json to use --worktree with other VCS systems.\n`)),process.exit(1));let r=f?`pr-${f}`:s??ke(),i;if(n){let e=l(G());e||(process.stderr.write(a.red(`Error: Could not determine the main git repository root.
2
+ `)),process.exit(1)),e!==(ne(G())??G())&&(d(`info`,`worktree_resolved_to_main_repo`),process.chdir(e),U(e)),i=c?H(e,y(r)):void 0}else i=c?H(G(),y(r)):void 0;let o;try{o=await _e(oe(),r,i,f?{prNumber:f}:void 0)}catch(e){process.stderr.write(a.red(`Error creating worktree: ${ze(e)}\n`)),process.exit(1)}if(c&&i){let e=await ve(i,o.worktreePath);e.created?console.log(a.green(`Created tmux session: ${a.bold(i)}\nTo attach: ${a.bold(`tmux attach -t ${i}`)}`)):console.error(a.yellow(`Warning: Failed to create tmux session: ${e.error}`))}process.chdir(o.worktreePath),U(o.worktreePath),ie(G()),re(G()),F(o),Ie(),w()}d(`info`,`setup_background_jobs_starting`),i()||(ht(),ot()),nt(),d(`info`,`setup_background_jobs_launched`),J(`setup_before_prefetch`),d(`info`,`setup_prefetch_starting`);let _=m()&&n(process.env.WORKMATE_SYNC_PLUGIN_INSTALL)||i();if(_||pe(ae()),import(`./loadPluginHooks-QoVXsBjy.js`).then(e=>{_||(e.loadPluginHooks(),e.setupPluginHookHotReload())}),i()||import(`./sessionFileAccessHooks-_mxyfQmn.js`).then(e=>e.registerSessionFileAccessHooks()),st(),J(`setup_after_prefetch`),!i()&&Ze()&&await it(),t===`bypassPermissions`||r){if(process.platform!==`win32`&&typeof process.getuid==`function`&&process.getuid()===0&&process.env.IS_SANDBOX!==`1`&&!n(process.env.WORKMATE_BUBBLEWRAP))if(process.stdin.isTTY){console.error(a.bold.red(`WARNING: Running as root/sudo with bypass permissions mode is dangerous.`)),console.error(a.yellow(`Bypass mode skips ALL permission checks. Combined with root, any command (rm -rf /, chmod, dd) executes without review.`));let e=(await import(`readline`)).createInterface({input:process.stdin,output:process.stdout}),t=await new Promise(t=>{e.question(`
3
+ I understand the risks. Continue? [y/N] `,t)});e.close(),t.trim().toLowerCase()!==`y`&&(console.error(`Aborted.`),process.exit(1))}else console.error(`--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons`),process.exit(1);if(process.env.WORKMATE_ENTRYPOINT!==`local-agent`&&process.env.WORKMATE_ENTRYPOINT!==`claude-desktop`){let[e,t]=await Promise.all([X.getIsDocker(),te.hasInternetAccess()]),n=X.getIsBubblewrapSandbox(),r=process.env.IS_SANDBOX===`1`;(!(e||n||r)||t)&&(console.error(`--dangerously-skip-permissions can only be used in Docker/sandbox containers with no internet access but got Docker: ${e}, Bubblewrap: ${n}, IS_SANDBOX: ${r}, hasInternet: ${t}`),process.exit(1))}}let v=Ue();v.lastCost!==void 0&&v.lastDuration!==void 0&&(v.lastCost,v.lastAPIDuration,v.lastToolDuration,v.lastDuration,v.lastLinesAdded,v.lastLinesRemoved,v.lastTotalInputTokens,v.lastTotalOutputTokens,v.lastTotalCacheCreationInputTokens,v.lastTotalCacheReadInputTokens,v.lastFpsAverage,v.lastFpsLow1Pct,v.lastSessionId,{...v.lastSessionMetrics})}export{vt as setup};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,L as n,R as r,V as i,z as a}from"./loadAgentsDir-DR5PVAc3.js";import{in as o}from"./prompt-CTByhpUI.js";function s(e){return e===`projectSettings`||e===`policySettings`||e===`command`}function c(e){return t(e)}function l(e,t,n){let r=c(t.source),i=c(n.source),a=t.ruleValue.toolName;return e===`deny`?`Remove the "${a}" deny rule from ${r}, or remove the specific allow rule from ${i}`:`Remove the "${a}" ask rule from ${r}, or remove the specific allow rule from ${i}`}function u(e,t,n){let{toolName:r,ruleContent:i}=e.ruleValue;if(i===void 0)return{shadowed:!1};let a=t.find(e=>e.ruleValue.toolName===r&&e.ruleValue.ruleContent===void 0);return!a||r===`Bash`&&n.sandboxAutoAllowEnabled&&!s(a.source)?{shadowed:!1}:{shadowed:!0,shadowedBy:a,shadowType:`ask`}}function d(e,t){let{toolName:n,ruleContent:r}=e.ruleValue;if(r===void 0)return{shadowed:!1};let i=t.find(e=>e.ruleValue.toolName===n&&e.ruleValue.ruleContent===void 0);return i?{shadowed:!0,shadowedBy:i,shadowType:`deny`}:{shadowed:!1}}function f(e,t){let i=[],o=n(e),s=r(e),f=a(e);for(let e of o){let n=d(e,f);if(n.shadowed){let t=c(n.shadowedBy.source);i.push({rule:e,reason:`Blocked by "${n.shadowedBy.ruleValue.toolName}" deny rule (from ${t})`,shadowedBy:n.shadowedBy,shadowType:`deny`,fix:l(`deny`,n.shadowedBy,e)});continue}let r=u(e,s,t);if(r.shadowed){let t=c(r.shadowedBy.source);i.push({rule:e,reason:`Shadowed by "${r.shadowedBy.ruleValue.toolName}" ask rule (from ${t})`,shadowedBy:r.shadowedBy,shadowType:`ask`,fix:l(`ask`,r.shadowedBy,e)})}}return i}var p=e((()=>{o(),i()}));export{p as n,f as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,L as n,R as r,V as i,z as a}from"./loadAgentsDir-uuZYOgKn.js";import{in as o}from"./prompt-BfXryFt-.js";function s(e){return e===`projectSettings`||e===`policySettings`||e===`command`}function c(e){return t(e)}function l(e,t,n){let r=c(t.source),i=c(n.source),a=t.ruleValue.toolName;return e===`deny`?`Remove the "${a}" deny rule from ${r}, or remove the specific allow rule from ${i}`:`Remove the "${a}" ask rule from ${r}, or remove the specific allow rule from ${i}`}function u(e,t,n){let{toolName:r,ruleContent:i}=e.ruleValue;if(i===void 0)return{shadowed:!1};let a=t.find(e=>e.ruleValue.toolName===r&&e.ruleValue.ruleContent===void 0);return!a||r===`Bash`&&n.sandboxAutoAllowEnabled&&!s(a.source)?{shadowed:!1}:{shadowed:!0,shadowedBy:a,shadowType:`ask`}}function d(e,t){let{toolName:n,ruleContent:r}=e.ruleValue;if(r===void 0)return{shadowed:!1};let i=t.find(e=>e.ruleValue.toolName===n&&e.ruleValue.ruleContent===void 0);return i?{shadowed:!0,shadowedBy:i,shadowType:`deny`}:{shadowed:!1}}function f(e,t){let i=[],o=n(e),s=r(e),f=a(e);for(let e of o){let n=d(e,f);if(n.shadowed){let t=c(n.shadowedBy.source);i.push({rule:e,reason:`Blocked by "${n.shadowedBy.ruleValue.toolName}" deny rule (from ${t})`,shadowedBy:n.shadowedBy,shadowType:`deny`,fix:l(`deny`,n.shadowedBy,e)});continue}let r=u(e,s,t);if(r.shadowed){let t=c(r.shadowedBy.source);i.push({rule:e,reason:`Shadowed by "${r.shadowedBy.ruleValue.toolName}" ask rule (from ${t})`,shadowedBy:r.shadowedBy,shadowType:`ask`,fix:l(`ask`,r.shadowedBy,e)})}}return i}var p=e((()=>{o(),i()}));export{p as n,f as t};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$x as t,Fx as n,Ji as r,Ks as i,OS as a,Ws as o,bS as s}from"./loadAgentsDir-DR5PVAc3.js";function c(e){let t=[],n=e.matchAll(d);for(let e of n)e.index!==void 0&&t.push({word:e[0],start:e.index,end:e.index+e[0].length});return t}async function l({question:e,cacheSafeParams:n}){let r=await i({promptMessages:[t({content:`<system-reminder>This is a side question from the user. You must answer this question directly in a single response.
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$x as t,Fx as n,Ji as r,Ks as i,OS as a,Ws as o,bS as s}from"./loadAgentsDir-uuZYOgKn.js";function c(e){let t=[],n=e.matchAll(d);for(let e of n)e.index!==void 0&&t.push({word:e[0],start:e.index,end:e.index+e[0].length});return t}async function l({question:e,cacheSafeParams:n}){let r=await i({promptMessages:[t({content:`<system-reminder>This is a side question from the user. You must answer this question directly in a single response.
2
2
 
3
3
  IMPORTANT CONTEXT:
4
4
  - You are a separate, lightweight agent spawned to answer this one question
@@ -1 +1 @@
1
- import{n as e,t}from"./axios-DaWTGg7G.js";import{Pt as n,at as r}from"./state-CXY-q5gr.js";import{$ as i,C as a,c as o,et as s,f as c,i as l,nt as u,rt as d,u as f,x as p}from"./debug-kBjDaVkQ.js";import{_ as m,o as h,r as g,t as _,v}from"./log-DWZny1vM.js";import{n as y}from"./analytics-COpjZpvd.js";import{dirname as b,join as x}from"path";t(),n(),d(),v(),i(),l(),c(),h(),p();var S=g(new Date);function C(){return x(m.errors(),`${S}.jsonl`)}function w(e){return x(m.mcpLogs(e),`${S}.jsonl`)}function T(e){let t=u(e);return{write(e){t.write(`${a(e)}\n`)},flush:t.flush,dispose:t.dispose}}var E=new Map;function D(e){let t=E.get(e);if(!t){let n=b(e);t=T({writeFn:t=>{try{f().appendFileSync(e,t)}catch{f().mkdirSync(n),f().appendFileSync(e,t)}},flushIntervalMs:1e3,maxBufferSize:50}),E.set(e,t),s(async()=>t?.dispose())}return t}function O(e,t){let n={timestamp:new Date().toISOString(),...t,cwd:f().cwd(),userType:process.env.USER_TYPE,sessionId:r(),version:`0.0.26`};D(e).write(n)}function k(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e;if(typeof t.message==`string`)return t.message;if(typeof t.error==`object`&&t.error&&`message`in t.error&&typeof t.error.message==`string`)return t.error.message}}function A(t){let n=t.stack||t.message,r=``;if(e.isAxiosError(t)&&t.config?.url){let e=[`url=${t.config.url}`];t.response?.status!==void 0&&e.push(`status=${t.response.status}`);let n=k(t.response?.data);n&&e.push(`body=${n}`),r=`[${e.join(`,`)}] `}o(`${t.name}: ${r}${n}`,{level:`error`}),O(C(),{error:`${r}${n}`})}function j(e,t){o(`MCP server "${e}" ${t}`,{level:`error`});let n=w(e),i={error:t instanceof Error?t.stack||t.message:String(t),timestamp:new Date().toISOString(),sessionId:r(),cwd:f().cwd()};D(n).write(i)}function M(e,t){o(`MCP server "${e}": ${t}`);let n=w(e),i={debug:t,timestamp:new Date().toISOString(),sessionId:r(),cwd:f().cwd()};D(n).write(i)}function N(){_({logError:A,logMCPError:j,logMCPDebug:M,getErrorsPath:C,getMCPLogsPath:w}),o(`Error log sink initialized`)}y();function P(){N()}export{P as t};
1
+ import{n as e,t}from"./axios-DaWTGg7G.js";import{Pt as n,at as r}from"./state-CXY-q5gr.js";import{$ as i,C as a,c as o,et as s,f as c,i as l,nt as u,rt as d,u as f,x as p}from"./debug-2pVES-2G.js";import{_ as m,o as h,r as g,t as _,v}from"./log-L1kqxa_P.js";import{n as y}from"./analytics-COpjZpvd.js";import{dirname as b,join as x}from"path";t(),n(),d(),v(),i(),l(),c(),h(),p();var S=g(new Date);function C(){return x(m.errors(),`${S}.jsonl`)}function w(e){return x(m.mcpLogs(e),`${S}.jsonl`)}function T(e){let t=u(e);return{write(e){t.write(`${a(e)}\n`)},flush:t.flush,dispose:t.dispose}}var E=new Map;function D(e){let t=E.get(e);if(!t){let n=b(e);t=T({writeFn:t=>{try{f().appendFileSync(e,t)}catch{f().mkdirSync(n),f().appendFileSync(e,t)}},flushIntervalMs:1e3,maxBufferSize:50}),E.set(e,t),s(async()=>t?.dispose())}return t}function O(e,t){let n={timestamp:new Date().toISOString(),...t,cwd:f().cwd(),userType:process.env.USER_TYPE,sessionId:r(),version:`0.0.27`};D(e).write(n)}function k(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e;if(typeof t.message==`string`)return t.message;if(typeof t.error==`object`&&t.error&&`message`in t.error&&typeof t.error.message==`string`)return t.error.message}}function A(t){let n=t.stack||t.message,r=``;if(e.isAxiosError(t)&&t.config?.url){let e=[`url=${t.config.url}`];t.response?.status!==void 0&&e.push(`status=${t.response.status}`);let n=k(t.response?.data);n&&e.push(`body=${n}`),r=`[${e.join(`,`)}] `}o(`${t.name}: ${r}${n}`,{level:`error`}),O(C(),{error:`${r}${n}`})}function j(e,t){o(`MCP server "${e}" ${t}`,{level:`error`});let n=w(e),i={error:t instanceof Error?t.stack||t.message:String(t),timestamp:new Date().toISOString(),sessionId:r(),cwd:f().cwd()};D(n).write(i)}function M(e,t){o(`MCP server "${e}": ${t}`);let n=w(e),i={debug:t,timestamp:new Date().toISOString(),sessionId:r(),cwd:f().cwd()};D(n).write(i)}function N(){_({logError:A,logMCPError:j,logMCPDebug:M,getErrorsPath:C,getMCPLogsPath:w}),o(`Error log sink initialized`)}y();function P(){N()}export{P as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./sinks-Cy3NqVbk.js";export{e as initSinks};
@@ -1 +1 @@
1
- import{Gn as e,Hn as t,Kn as n,Pt as r,Tn as i,U as a,at as o,h as s,vn as c,yn as l}from"./state-CXY-q5gr.js";import{Cg as ee,Ci as te,Dm as ne,Fy as re,Gg as u,Gi as ie,In as ae,Kg as oe,Mi as se,Nt as ce,Om as le,Ot as d,Py as f,Rr as p,Si as m,St as h,Ui as g,Vi as ue,Wi as de,Xr as fe,Xs as pe,Yr as me,ag as he,ai as _,bb as ge,cw as _e,dn as v,dy as y,ec as b,fy as x,gr as S,ky as C,mn as w,ni as T,ns as E,ph as D,rg as O,sw as k,ts as A,wg as j,wy as M,xb as N,yt as P}from"./loadAgentsDir-DR5PVAc3.js";import{n as F,t as I}from"./cwd-DrEEb4f5.js";import{$ as ve,c as L,et as ye,f as be,i as R,u as xe}from"./debug-kBjDaVkQ.js";import{n as z}from"./analytics-COpjZpvd.js";import{f as Se,v as Ce}from"./model-D42epddJ.js";import{Gt as we}from"./prompt-CTByhpUI.js";import{S as Te,x as Ee}from"./sleep-BbWr_FL1.js";import*as B from"path";import{dirname as De}from"path";r(),oe(),y(),we(),j(),C(),D(),pe(),F(),R(),he(),Se(),_e(),ge(),S(),f(),le(),h();function Oe(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.type!==`assistant`)continue;let r=n.message.content.find(e=>e.type===`tool_use`&&e.name===`TodoWrite`);if(r?.type!==`tool_use`)continue;let i=r.input;if(typeof i!=`object`||!i)return[];let a=ne().safeParse(i.todos);return a.success?a.data:[]}return[]}function ke(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&O(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),!re()&&e.messages&&e.messages.length>0){let n=Oe(e.messages);if(n.length>0){let e=o();t(t=>({...t,todos:{...t.todos,[e]:n}}))}}}function V(e,t){if(!(!e&&!t))return{name:e??``,color:t==="default"?void 0:t}}function H(e,t,n){if(t)return{agentDefinition:t,agentType:void 0};if(!e)return l(void 0),{agentDefinition:void 0,agentType:void 0};let r=n.activeAgents.find(t=>t.agentType===e);return r?(l(r.agentType),!a()&&r.model&&r.model!==`inherit`&&c(Ce(r.model)),{agentDefinition:r,agentType:r.agentType}):(L(`Resumed session had agent "${e}" but it is no longer available. Using default behavior.`),l(void 0),{agentDefinition:void 0,agentType:void 0})}function U(e){let t=P();if(t){_(t);return}if(e){try{process.chdir(e.worktreePath)}catch{_(null);return}N(e.worktreePath),i(I()),d(e),M(),u(),k.cache.clear?.()}}function Ae(){let e=P();if(e){d(null),M(),u(),k.cache.clear?.();try{process.chdir(e.originalCwd)}catch{return}N(e.originalCwd),i(I())}}async function je(e,n,r){if(n.forkSession)e.contentReplacements?.length&&await p(e.contentReplacements);else{let r=n.sessionIdOverride??e.sessionId;r&&(t(ee(r),n.transcriptPath?De(n.transcriptPath):null),await me(),x(r))}fe(n.forkSession?{...e,worktreeSession:void 0}:e),n.forkSession||(U(e.worktreeSession),ae());let{agentDefinition:i,agentType:a}=H(e.agentSetting,r.mainThreadAgentDefinition,r.agentDefinitions);T(`normal`),n.includeAttribution;let o=V(e.agentName,e.agentColor);b(e.agentName);let s=r.agentDefinitions;return{messages:e.messages,fileHistorySnapshots:e.fileHistorySnapshots,contentReplacements:e.contentReplacements,agentName:e.agentName,agentColor:e.agentColor==="default"?void 0:e.agentColor,restoredAgentDef:i,initialState:{...r.initialState,...a&&{agent:a},...o&&{standaloneAgentContext:o},agentDefinitions:s}}}Te(),r(),se(),z(),de(),A(),ve(),R(),be(),w(),n();var Me=1e3,Ne=500,Pe=300,Fe=2e3,Ie=typeof Bun<`u`,W=null,G=null,K=new Set,q=!1,J=!1,Y=!1,X=null,Z=e();async function Le(){if(q||J)return;q=!0,Y||(Y=!0,ie(()=>{m(),Z.emit()}));let e=await ze();e.length!==0&&(L(`Watching for changes in skill/command directories: ${e.join(`, `)}...`),W=Ee.watch(e,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:Me,pollInterval:Ne},ignored:(e,t)=>t&&!t.isFile()&&!t.isDirectory()?!0:e.split(B.sep).some(e=>e===`.git`),ignorePermissionErrors:!0,usePolling:Ie,interval:Fe,atomic:!0}),W.on(`add`,$),W.on(`change`,$),W.on(`unlink`,$),X=ye(async()=>{await Q()}))}function Q(){J=!0,X&&(X(),X=null);let e=Promise.resolve();return W&&(e=W.close(),W=null),G&&(clearTimeout(G),G=null),K.clear(),Z.clear(),e}var Re=Z.subscribe;async function ze(){let e=xe(),t=[],n=g(`userSettings`,`skills`);if(n)try{await e.stat(n),t.push(n)}catch{}let r=g(`userSettings`,`commands`);if(r)try{await e.stat(r),t.push(r)}catch{}let i=g(`projectSettings`,`skills`);if(i)try{let n=B.resolve(i);await e.stat(n),t.push(n)}catch{}let a=g(`projectSettings`,`commands`);if(a)try{let n=B.resolve(a);await e.stat(n),t.push(n)}catch{}for(let n of s()){let r=B.join(n,`.workmate`,`skills`);try{await e.stat(r),t.push(r)}catch{}}return t}function $(e){L(`Detected skill change: ${e}`),Be(e)}function Be(e){K.add(e),G&&clearTimeout(G),G=setTimeout(async()=>{G=null;let e=[...K];if(K.clear(),v(await ce(`skills`,e[0]))){L(`ConfigChange hook blocked skill reload (${e.length} paths)`);return}ue(),te(),E(),Z.emit()},Pe)}var Ve={initialize:Le,dispose:Q,subscribe:Re};export{H as a,je as i,V as n,ke as o,Ae as r,U as s,Ve as t};
1
+ import{Gn as e,Hn as t,Kn as n,Pt as r,Tn as i,U as a,at as o,h as s,vn as c,yn as l}from"./state-CXY-q5gr.js";import{Cg as ee,Ci as te,Dm as ne,Fy as re,Gg as u,Gi as ie,In as ae,Kg as oe,Mi as se,Nt as ce,Om as le,Ot as d,Py as f,Rr as p,Si as m,St as h,Ui as g,Vi as ue,Wi as de,Xr as fe,Xs as pe,Yr as me,ag as he,ai as _,bb as ge,cw as _e,dn as v,dy as y,ec as b,fy as x,gr as S,ky as C,mn as w,ni as T,ns as E,ph as D,rg as O,sw as k,ts as A,wg as j,wy as M,xb as N,yt as P}from"./loadAgentsDir-uuZYOgKn.js";import{n as F,t as I}from"./cwd-DrEEb4f5.js";import{$ as ve,c as L,et as ye,f as be,i as R,u as xe}from"./debug-2pVES-2G.js";import{n as z}from"./analytics-COpjZpvd.js";import{f as Se,v as Ce}from"./model-CcHyMyBv.js";import{Gt as we}from"./prompt-BfXryFt-.js";import{S as Te,x as Ee}from"./sleep-xKMbXTJe.js";import*as B from"path";import{dirname as De}from"path";r(),oe(),y(),we(),j(),C(),D(),pe(),F(),R(),he(),Se(),_e(),ge(),S(),f(),le(),h();function Oe(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.type!==`assistant`)continue;let r=n.message.content.find(e=>e.type===`tool_use`&&e.name===`TodoWrite`);if(r?.type!==`tool_use`)continue;let i=r.input;if(typeof i!=`object`||!i)return[];let a=ne().safeParse(i.todos);return a.success?a.data:[]}return[]}function ke(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&O(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),!re()&&e.messages&&e.messages.length>0){let n=Oe(e.messages);if(n.length>0){let e=o();t(t=>({...t,todos:{...t.todos,[e]:n}}))}}}function V(e,t){if(!(!e&&!t))return{name:e??``,color:t==="default"?void 0:t}}function H(e,t,n){if(t)return{agentDefinition:t,agentType:void 0};if(!e)return l(void 0),{agentDefinition:void 0,agentType:void 0};let r=n.activeAgents.find(t=>t.agentType===e);return r?(l(r.agentType),!a()&&r.model&&r.model!==`inherit`&&c(Ce(r.model)),{agentDefinition:r,agentType:r.agentType}):(L(`Resumed session had agent "${e}" but it is no longer available. Using default behavior.`),l(void 0),{agentDefinition:void 0,agentType:void 0})}function U(e){let t=P();if(t){_(t);return}if(e){try{process.chdir(e.worktreePath)}catch{_(null);return}N(e.worktreePath),i(I()),d(e),M(),u(),k.cache.clear?.()}}function Ae(){let e=P();if(e){d(null),M(),u(),k.cache.clear?.();try{process.chdir(e.originalCwd)}catch{return}N(e.originalCwd),i(I())}}async function je(e,n,r){if(n.forkSession)e.contentReplacements?.length&&await p(e.contentReplacements);else{let r=n.sessionIdOverride??e.sessionId;r&&(t(ee(r),n.transcriptPath?De(n.transcriptPath):null),await me(),x(r))}fe(n.forkSession?{...e,worktreeSession:void 0}:e),n.forkSession||(U(e.worktreeSession),ae());let{agentDefinition:i,agentType:a}=H(e.agentSetting,r.mainThreadAgentDefinition,r.agentDefinitions);T(`normal`),n.includeAttribution;let o=V(e.agentName,e.agentColor);b(e.agentName);let s=r.agentDefinitions;return{messages:e.messages,fileHistorySnapshots:e.fileHistorySnapshots,contentReplacements:e.contentReplacements,agentName:e.agentName,agentColor:e.agentColor==="default"?void 0:e.agentColor,restoredAgentDef:i,initialState:{...r.initialState,...a&&{agent:a},...o&&{standaloneAgentContext:o},agentDefinitions:s}}}Te(),r(),se(),z(),de(),A(),ve(),R(),be(),w(),n();var Me=1e3,Ne=500,Pe=300,Fe=2e3,Ie=typeof Bun<`u`,W=null,G=null,K=new Set,q=!1,J=!1,Y=!1,X=null,Z=e();async function Le(){if(q||J)return;q=!0,Y||(Y=!0,ie(()=>{m(),Z.emit()}));let e=await ze();e.length!==0&&(L(`Watching for changes in skill/command directories: ${e.join(`, `)}...`),W=Ee.watch(e,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:Me,pollInterval:Ne},ignored:(e,t)=>t&&!t.isFile()&&!t.isDirectory()?!0:e.split(B.sep).some(e=>e===`.git`),ignorePermissionErrors:!0,usePolling:Ie,interval:Fe,atomic:!0}),W.on(`add`,$),W.on(`change`,$),W.on(`unlink`,$),X=ye(async()=>{await Q()}))}function Q(){J=!0,X&&(X(),X=null);let e=Promise.resolve();return W&&(e=W.close(),W=null),G&&(clearTimeout(G),G=null),K.clear(),Z.clear(),e}var Re=Z.subscribe;async function ze(){let e=xe(),t=[],n=g(`userSettings`,`skills`);if(n)try{await e.stat(n),t.push(n)}catch{}let r=g(`userSettings`,`commands`);if(r)try{await e.stat(r),t.push(r)}catch{}let i=g(`projectSettings`,`skills`);if(i)try{let n=B.resolve(i);await e.stat(n),t.push(n)}catch{}let a=g(`projectSettings`,`commands`);if(a)try{let n=B.resolve(a);await e.stat(n),t.push(n)}catch{}for(let n of s()){let r=B.join(n,`.workmate`,`skills`);try{await e.stat(r),t.push(r)}catch{}}return t}function $(e){L(`Detected skill change: ${e}`),Be(e)}function Be(e){K.add(e),G&&clearTimeout(G),G=setTimeout(async()=>{G=null;let e=[...K];if(K.clear(),v(await ce(`skills`,e[0]))){L(`ConfigChange hook blocked skill reload (${e.length} paths)`);return}ue(),te(),E(),Z.emit()},Pe)}var Ve={initialize:Le,dispose:Q,subscribe:Re};export{H as a,je as i,V as n,ke as o,Ae as r,U as s,Ve as t};
@@ -1,5 +1,5 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,n,s as r}from"./projectContext-QN5U3Ggr.js";import{i,r as a}from"./instinctParser-Dt-lqnDe.js";import{c as o,o as s,s as c}from"./skillLifecycle-D9NkIwFQ.js";import{dirname as l,join as u}from"node:path";import{existsSync as d}from"node:fs";import{createHash as f}from"node:crypto";import{mkdir as p,readFile as m,rename as h,writeFile as g}from"node:fs/promises";async function _(e){let t=e.prompt.trim();if(!t)throw Error(`Cannot record an empty skill gap`);let n=e.project??r(e.cwd),i=await A(n,e.rootDir),a=F(t),o=new Date().toISOString(),s=i.gaps[a],c={key:a,prompt:t,count:(s?.count??0)+1,draftHits:s?.draftHits??0,draftHitSessions:s?.draftHitSessions??[],status:s?.status??`pending`,sessionId:e.sessionId??`unknown-session`,cwd:e.cwd??n.cwd,projectId:n.projectId,projectName:n.projectName,recommendations:(e.recommendations??[]).slice(0,5).map(e=>({name:e.name,description:e.description,score:e.score})),createdAt:s?.createdAt??o,updatedAt:o,draft:s?.draft,active:s?.active};return c.status===`rejected`?(i.gaps[a]=c,await N(n,i,e.rootDir),c):(!c.draft&&C(c)&&(c.draft=await T(c,n),c.status=`draft`,await z()),c.draft&&!c.active&&w(c)&&(c.active=await E(c,n),c.status=`active`,await z()),i.gaps[a]=c,await N(n,i,e.rootDir),c)}async function v(e=r(),t){let n=await A(e,t);return Object.values(n.gaps).sort((e,t)=>e.key.localeCompare(t.key))}async function y(e,t=r(),n){let i=await A(t,n);for(let t of Object.values(i.gaps))if(t.draft?.skillPath===e)return t.key}async function b(e,t=r(),n,i=`unknown-session`){let a=await A(t,n),o=a.gaps[e];if(!o?.draft||o.active)return o;let s=o.draftHitSessions??[];if(s.includes(i))return o;let c=new Date().toISOString(),l={...o,draftHits:o.draftHits+1,draftHitSessions:[...s,i],updatedAt:c};return w(l)&&(l.active=await E(l,t),l.status=`active`,await z()),a.gaps[e]=l,await N(t,a,n),l}async function x(e,t=r(),n){let i=await A(t,n),a=i.gaps[e];if(!a)return;if(a.status===`rejected`||a.draft)return a;let o={...a,draft:await T(a,t),status:`draft`,updatedAt:new Date().toISOString()};return i.gaps[e]=o,await N(t,i,n),await z(),o}async function S(e,t=r(),n){let i=await A(t,n),a=i.gaps[e];if(!a)return;let o={...a,status:`rejected`,updatedAt:new Date().toISOString()};return i.gaps[e]=o,await N(t,i,n),o}function C(e){return e.count>=B}function w(e){return e.draft?e.count>=V||e.draftHits>=H:!1}async function T(e,t){let n=D(e,`pending`),r=u(t.projectRoot??t.cwd,`.workmate`,`skills`,`.drafts`),i=s([n],{cwd:t.projectRoot??t.cwd,outputRoot:r,scope:`project`,name:`draft-${I(e.prompt)}`,description:`Draft learned skill candidate. Promote after repeated evidence or explicit user correction.`}),a=u(i.outputPath,`SKILL.md`);return d(a)||await o({...i,content:i.content+`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,n,s as r}from"./projectContext-BFfHgAMh.js";import{i,r as a}from"./instinctParser-Dt-lqnDe.js";import{c as o,o as s,s as c}from"./skillLifecycle-iO_3s9Ff.js";import{dirname as l,join as u}from"node:path";import{existsSync as d}from"node:fs";import{createHash as f}from"node:crypto";import{mkdir as p,readFile as m,rename as h,writeFile as g}from"node:fs/promises";async function _(e){let t=e.prompt.trim();if(!t)throw Error(`Cannot record an empty skill gap`);let n=e.project??r(e.cwd),i=await A(n,e.rootDir),a=F(t),o=new Date().toISOString(),s=i.gaps[a],c={key:a,prompt:t,count:(s?.count??0)+1,draftHits:s?.draftHits??0,draftHitSessions:s?.draftHitSessions??[],status:s?.status??`pending`,sessionId:e.sessionId??`unknown-session`,cwd:e.cwd??n.cwd,projectId:n.projectId,projectName:n.projectName,recommendations:(e.recommendations??[]).slice(0,5).map(e=>({name:e.name,description:e.description,score:e.score})),createdAt:s?.createdAt??o,updatedAt:o,draft:s?.draft,active:s?.active};return c.status===`rejected`?(i.gaps[a]=c,await N(n,i,e.rootDir),c):(!c.draft&&C(c)&&(c.draft=await T(c,n),c.status=`draft`,await z()),c.draft&&!c.active&&w(c)&&(c.active=await E(c,n),c.status=`active`,await z()),i.gaps[a]=c,await N(n,i,e.rootDir),c)}async function v(e=r(),t){let n=await A(e,t);return Object.values(n.gaps).sort((e,t)=>e.key.localeCompare(t.key))}async function y(e,t=r(),n){let i=await A(t,n);for(let t of Object.values(i.gaps))if(t.draft?.skillPath===e)return t.key}async function b(e,t=r(),n,i=`unknown-session`){let a=await A(t,n),o=a.gaps[e];if(!o?.draft||o.active)return o;let s=o.draftHitSessions??[];if(s.includes(i))return o;let c=new Date().toISOString(),l={...o,draftHits:o.draftHits+1,draftHitSessions:[...s,i],updatedAt:c};return w(l)&&(l.active=await E(l,t),l.status=`active`,await z()),a.gaps[e]=l,await N(t,a,n),l}async function x(e,t=r(),n){let i=await A(t,n),a=i.gaps[e];if(!a)return;if(a.status===`rejected`||a.draft)return a;let o={...a,draft:await T(a,t),status:`draft`,updatedAt:new Date().toISOString()};return i.gaps[e]=o,await N(t,i,n),await z(),o}async function S(e,t=r(),n){let i=await A(t,n),a=i.gaps[e];if(!a)return;let o={...a,status:`rejected`,updatedAt:new Date().toISOString()};return i.gaps[e]=o,await N(t,i,n),o}function C(e){return e.count>=B}function w(e){return e.draft?e.count>=V||e.draftHits>=H:!1}async function T(e,t){let n=D(e,`pending`),r=u(t.projectRoot??t.cwd,`.workmate`,`skills`,`.drafts`),i=s([n],{cwd:t.projectRoot??t.cwd,outputRoot:r,scope:`project`,name:`draft-${I(e.prompt)}`,description:`Draft learned skill candidate. Promote after repeated evidence or explicit user correction.`}),a=u(i.outputPath,`SKILL.md`);return d(a)||await o({...i,content:i.content+`
2
2
  ## Promotion Rule
3
3
 
4
4
  Do not move this draft into active skills until the same gap repeats or the user explicitly confirms this should become reusable.
5
- `}),{type:`draft`,name:i.name,skillPath:a}}async function E(e,t){let n=s([D(e,`active`)],{cwd:t.projectRoot??t.cwd,scope:`project`,name:I(e.prompt),description:O(e.prompt)}),r=u(n.outputPath,`SKILL.md`);return d(r)||await o(n),{type:`active`,name:n.name,skillPath:r}}function D(e,t){return a({trigger:`When the user asks for ${L(e.prompt,120)}`,action:O(e.prompt),confidence:t===`active`?.82:.55,domain:k(e.prompt),source:`session-observation`,scope:`project`,projectId:e.projectId,projectName:e.projectName,evidence:[`Skill gap prompt: ${L(e.prompt,180)}`,`No high-confidence active skill was auto-loaded.`,`Observed ${e.count} time(s).`],status:t})}function O(e){return/feature\s*\(|feature flag|flag_name|stub|no-op|noop|最小实现/i.test(e)?`Audit feature flags by scanning feature() call sites, excluding generated/dependency noise, classifying each candidate as stub, shell, MVP, or thin-toggle, and writing an evidence-backed document.`:/skill|技能|学习|进化|evolve|learning/i.test(e)?`Run skill discovery first; auto-load only high-confidence matching skills; record a skill gap when none match; promote repeated or corrected gaps into learned skills.`:/test|测试|stub|调用链|参数/i.test(e)?`Infer tests from existing files, parameters, exports, and call chains before simplifying mocks or inventing behavior.`:`Reuse the workflow learned from this prompt: ${L(e,180)}.`}function k(e){let t=e.toLowerCase();return/test|测试|stub|fixture|断言/.test(t)?`testing`:/error|bug|fix|失败|错误|修复|debug/.test(t)?`debugging`:/security|安全|漏洞|secret|token/.test(t)?`security`:/git|commit|branch|pr\b/.test(t)?`git`:/style|lint|format|命名|规范/.test(t)?`code-style`:`workflow`}async function A(e,t){let n=P(e,t),r;try{r=await m(n,`utf8`)}catch(e){if(e.code===`ENOENT`)return{version:1,gaps:{}};throw e}try{return j(JSON.parse(r))}catch{let e=`${n}.corrupt-${Date.now()}`;try{await g(e,r,`utf8`)}catch{}return{version:1,gaps:{}}}}function j(e){let t={};for(let[n,r]of Object.entries(e.gaps??{})){let e=r,i=typeof e.draftHits==`number`&&Number.isFinite(e.draftHits)?e.draftHits:0,a=typeof e.count==`number`?e.count:1,o=M(e.status),s=!!e.draft,c=!!e.active,l=o;l===`draft`&&a<B&&!s&&(l=`pending`),l===`active`&&!c&&(l=s?`draft`:`pending`);let u=Array.isArray(e.draftHitSessions)?e.draftHitSessions.filter(e=>typeof e==`string`):[];t[n]={...r,count:a,draftHits:i,draftHitSessions:u,status:l}}return{version:1,gaps:t}}function M(e){return e===`pending`||e===`draft`||e===`active`||e===`rejected`?e:`pending`}async function N(e,t,n){let r=P(e,n);await p(l(r),{recursive:!0});let i=`${r}.tmp-${process.pid}-${Date.now()}`;await g(i,`${JSON.stringify(t,null,2)}\n`,`utf8`),await h(i,r)}function P(e,t){return u(t?e.projectId===`global`?u(t,`global`):u(t,`projects`,e.projectId):n(e.projectId),`skill-gaps.json`)}function F(e){return`${I(e)}-${R(e).slice(0,8)}`}function I(e){let t=e.replaceAll(`技能`,` skill `).replaceAll(`学习`,` learning `).replaceAll(`进化`,` evolution `).replaceAll(`测试`,` testing `).replaceAll(`最小实现`,` minimal implementation `).toLowerCase(),n=new Set([`the`,`and`,`for`,`with`,`this`,`that`,`user`,`about`,`feature`,`flag`,`name`]);return((t.match(/[a-z0-9][a-z0-9_-]{2,}/g)??[]).filter(e=>!n.has(e)).slice(0,5).join(`-`)||`learned-gap`).slice(0,54).replace(/-+$/g,``)}function L(e,t){return e.replace(/\s+/g,` `).trim().slice(0,t)}function R(e){return f(`sha1`).update(e).digest(`hex`)}async function z(){try{let{clearCommandsCache:e}=await import(`./commands-wfE12a4L.js`);e()}catch{}}var B,V,H;e((()=>{i(),t(),c(),B=2,V=4,H=2}))();export{y as findGapKeyByDraftPath,x as promoteGapToDraft,v as readSkillGaps,b as recordDraftHit,_ as recordSkillGap,S as rejectSkillGap,w as shouldPromoteToActive,C as shouldPromoteToDraft};
5
+ `}),{type:`draft`,name:i.name,skillPath:a}}async function E(e,t){let n=s([D(e,`active`)],{cwd:t.projectRoot??t.cwd,scope:`project`,name:I(e.prompt),description:O(e.prompt)}),r=u(n.outputPath,`SKILL.md`);return d(r)||await o(n),{type:`active`,name:n.name,skillPath:r}}function D(e,t){return a({trigger:`When the user asks for ${L(e.prompt,120)}`,action:O(e.prompt),confidence:t===`active`?.82:.55,domain:k(e.prompt),source:`session-observation`,scope:`project`,projectId:e.projectId,projectName:e.projectName,evidence:[`Skill gap prompt: ${L(e.prompt,180)}`,`No high-confidence active skill was auto-loaded.`,`Observed ${e.count} time(s).`],status:t})}function O(e){return/feature\s*\(|feature flag|flag_name|stub|no-op|noop|最小实现/i.test(e)?`Audit feature flags by scanning feature() call sites, excluding generated/dependency noise, classifying each candidate as stub, shell, MVP, or thin-toggle, and writing an evidence-backed document.`:/skill|技能|学习|进化|evolve|learning/i.test(e)?`Run skill discovery first; auto-load only high-confidence matching skills; record a skill gap when none match; promote repeated or corrected gaps into learned skills.`:/test|测试|stub|调用链|参数/i.test(e)?`Infer tests from existing files, parameters, exports, and call chains before simplifying mocks or inventing behavior.`:`Reuse the workflow learned from this prompt: ${L(e,180)}.`}function k(e){let t=e.toLowerCase();return/test|测试|stub|fixture|断言/.test(t)?`testing`:/error|bug|fix|失败|错误|修复|debug/.test(t)?`debugging`:/security|安全|漏洞|secret|token/.test(t)?`security`:/git|commit|branch|pr\b/.test(t)?`git`:/style|lint|format|命名|规范/.test(t)?`code-style`:`workflow`}async function A(e,t){let n=P(e,t),r;try{r=await m(n,`utf8`)}catch(e){if(e.code===`ENOENT`)return{version:1,gaps:{}};throw e}try{return j(JSON.parse(r))}catch{let e=`${n}.corrupt-${Date.now()}`;try{await g(e,r,`utf8`)}catch{}return{version:1,gaps:{}}}}function j(e){let t={};for(let[n,r]of Object.entries(e.gaps??{})){let e=r,i=typeof e.draftHits==`number`&&Number.isFinite(e.draftHits)?e.draftHits:0,a=typeof e.count==`number`?e.count:1,o=M(e.status),s=!!e.draft,c=!!e.active,l=o;l===`draft`&&a<B&&!s&&(l=`pending`),l===`active`&&!c&&(l=s?`draft`:`pending`);let u=Array.isArray(e.draftHitSessions)?e.draftHitSessions.filter(e=>typeof e==`string`):[];t[n]={...r,count:a,draftHits:i,draftHitSessions:u,status:l}}return{version:1,gaps:t}}function M(e){return e===`pending`||e===`draft`||e===`active`||e===`rejected`?e:`pending`}async function N(e,t,n){let r=P(e,n);await p(l(r),{recursive:!0});let i=`${r}.tmp-${process.pid}-${Date.now()}`;await g(i,`${JSON.stringify(t,null,2)}\n`,`utf8`),await h(i,r)}function P(e,t){return u(t?e.projectId===`global`?u(t,`global`):u(t,`projects`,e.projectId):n(e.projectId),`skill-gaps.json`)}function F(e){return`${I(e)}-${R(e).slice(0,8)}`}function I(e){let t=e.replaceAll(`技能`,` skill `).replaceAll(`学习`,` learning `).replaceAll(`进化`,` evolution `).replaceAll(`测试`,` testing `).replaceAll(`最小实现`,` minimal implementation `).toLowerCase(),n=new Set([`the`,`and`,`for`,`with`,`this`,`that`,`user`,`about`,`feature`,`flag`,`name`]);return((t.match(/[a-z0-9][a-z0-9_-]{2,}/g)??[]).filter(e=>!n.has(e)).slice(0,5).join(`-`)||`learned-gap`).slice(0,54).replace(/-+$/g,``)}function L(e,t){return e.replace(/\s+/g,` `).trim().slice(0,t)}function R(e){return f(`sha1`).update(e).digest(`hex`)}async function z(){try{let{clearCommandsCache:e}=await import(`./commands-AcfFLgl5.js`);e()}catch{}}var B,V,H;e((()=>{i(),t(),c(),B=2,V=4,H=2}))();export{y as findGapKeyByDraftPath,x as promoteGapToDraft,v as readSkillGaps,b as recordDraftHit,_ as recordSkillGap,S as rejectSkillGap,w as shouldPromoteToActive,C as shouldPromoteToDraft};
@@ -1,6 +1,6 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DZ_SvEVz.js";import{o as r,t as i}from"./localSearch-CzkxDuOR.js";import{l as a,u as o}from"./instinctParser-Dt-lqnDe.js";import{basename as s,dirname as c,join as l}from"node:path";import{existsSync as u}from"node:fs";import{mkdir as d,readFile as f,readdir as p,rename as m,rm as ee,writeFile as h}from"node:fs/promises";function g(e){return e.length!==0&&e.reduce((e,t)=>e+t.confidence,0)/e.length>=a().minConfidence}function te(e){let t=e[0]?.domain??`project`,n=b[t],r=new Set;for(let t of e){for(let e of`${t.trigger} ${t.action}`.toLowerCase().split(/[^a-z0-9]+/))if(y(e)&&r.add(e),r.size>=5)break;if(r.size>=5)break}let i=_([n,...r].join(`-`));return v(i)?`${n}-learned-pattern`:i}function _(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,64).replace(/-$/g,``)||`learned-skill`}function v(e){return x.has(e)}function y(e){return e.length>2&&![`when`,`with`,`this`,`that`,`user`,`project`,`prefer`,`avoid`,`use`,`using`,`the`,`and`,`for`].includes(e)}var b,x,S=e((()=>{o(),b={workflow:`workflow`,testing:`testing`,debugging:`debugging`,"code-style":`style`,security:`security`,git:`git`,project:`project`},x=new Set([`learned-skill`,`better-skill`,`new-skill`,`project-skill`,`workflow-skill`])}));function C(e,t){if(e.length===0)throw Error(`Cannot generate a skill draft without instincts`);let n=t?.scope??e[0]?.scope??`project`,r=t?.name?_(t.name):E(e),i=e.reduce((e,t)=>e+t.confidence,0)/e.length,a=t?.description??D(e),o=re(r,n,t),s=O({name:r,description:a,confidence:i,instincts:e});return{name:r,description:a,scope:n,sourceInstinctIds:e.map(e=>e.id),confidence:Number(i.toFixed(2)),content:s,outputPath:o}}async function w(e,t,n){let r=C(e,t),i=await P(`skill`,r,n);for(let t of i){let n=ie(r,t);if(n>=.8)return{action:`append-evidence`,target:t,overlap:n,appendedPath:await ne(t,e)}}return{action:`create`,draft:r}}async function ne(e,t){let n=await f(e.path,`utf8`).catch(()=>e.content);if(Buffer.byteLength(n,`utf8`)>=M)return e.path;let r=t.flatMap(e=>e.evidence.map(e=>`- ${e}`)),a=r.slice(0,A);a.length<r.length&&a.push(`- [... ${r.length-a.length} more evidence entries omitted]`);let o=[``,`## Learned evidence (${new Date().toISOString()})`,``,...a,``].join(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-QyzA_cFM.js";import{o as r,t as i}from"./localSearch-yVCDrVrf.js";import{l as a,u as o}from"./instinctParser-Dt-lqnDe.js";import{basename as s,dirname as c,join as l}from"node:path";import{existsSync as u}from"node:fs";import{mkdir as d,readFile as f,readdir as p,rename as m,rm as ee,writeFile as h}from"node:fs/promises";function g(e){return e.length!==0&&e.reduce((e,t)=>e+t.confidence,0)/e.length>=a().minConfidence}function te(e){let t=e[0]?.domain??`project`,n=b[t],r=new Set;for(let t of e){for(let e of`${t.trigger} ${t.action}`.toLowerCase().split(/[^a-z0-9]+/))if(y(e)&&r.add(e),r.size>=5)break;if(r.size>=5)break}let i=_([n,...r].join(`-`));return v(i)?`${n}-learned-pattern`:i}function _(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,64).replace(/-$/g,``)||`learned-skill`}function v(e){return x.has(e)}function y(e){return e.length>2&&![`when`,`with`,`this`,`that`,`user`,`project`,`prefer`,`avoid`,`use`,`using`,`the`,`and`,`for`].includes(e)}var b,x,S=e((()=>{o(),b={workflow:`workflow`,testing:`testing`,debugging:`debugging`,"code-style":`style`,security:`security`,git:`git`,project:`project`},x=new Set([`learned-skill`,`better-skill`,`new-skill`,`project-skill`,`workflow-skill`])}));function C(e,t){if(e.length===0)throw Error(`Cannot generate a skill draft without instincts`);let n=t?.scope??e[0]?.scope??`project`,r=t?.name?_(t.name):E(e),i=e.reduce((e,t)=>e+t.confidence,0)/e.length,a=t?.description??D(e),o=re(r,n,t),s=O({name:r,description:a,confidence:i,instincts:e});return{name:r,description:a,scope:n,sourceInstinctIds:e.map(e=>e.id),confidence:Number(i.toFixed(2)),content:s,outputPath:o}}async function w(e,t,n){let r=C(e,t),i=await P(`skill`,r,n);for(let t of i){let n=ie(r,t);if(n>=.8)return{action:`append-evidence`,target:t,overlap:n,appendedPath:await ne(t,e)}}return{action:`create`,draft:r}}async function ne(e,t){let n=await f(e.path,`utf8`).catch(()=>e.content);if(Buffer.byteLength(n,`utf8`)>=M)return e.path;let r=t.flatMap(e=>e.evidence.map(e=>`- ${e}`)),a=r.slice(0,A);a.length<r.length&&a.push(`- [... ${r.length-a.length} more evidence entries omitted]`);let o=[``,`## Learned evidence (${new Date().toISOString()})`,``,...a,``].join(`
2
2
  `),s=n.endsWith(`
3
- `)?n+o:`${n}\n${o}`,c=Buffer.byteLength(s,`utf8`)>M?s.slice(0,M):s;return await h(e.path,c,`utf8`),i(),e.path}async function T(e){await d(e.outputPath,{recursive:!0});let t=l(e.outputPath,`SKILL.md`);await h(t,e.content,`utf8`),i();try{let{clearCommandsCache:e}=await import(`./commands-wfE12a4L.js`);e()}catch{}return t}function re(e,n,r){return r?.outputRoot?l(r.outputRoot,e):n===`project`?l(r?.cwd??process.cwd(),`.workmate`,`skills`,e):l(r?.globalSkillsDir??l(t(),`skills`),e)}function E(e){return te(e)}function D(e){let t=(e[0]?.action??`Apply a learned project pattern`).replace(/\s+/g,` `).slice(0,120);return t.length>0?t:`Apply learned project patterns`}function O(e){let{name:t,description:n,confidence:r,instincts:i}=e;return[`---`,`name: ${t}`,`description: ${JSON.stringify(n)}`,`origin: skill-learning`,`confidence: ${Number(r.toFixed(2))}`,`evolved_from: [${i.map(e=>JSON.stringify(e.id)).join(`, `)}]`,`---`,``,`# ${k(t)}`,``,`## Trigger`,``,i.map(e=>`- ${e.trigger}`).join(`
3
+ `)?n+o:`${n}\n${o}`,c=Buffer.byteLength(s,`utf8`)>M?s.slice(0,M):s;return await h(e.path,c,`utf8`),i(),e.path}async function T(e){await d(e.outputPath,{recursive:!0});let t=l(e.outputPath,`SKILL.md`);await h(t,e.content,`utf8`),i();try{let{clearCommandsCache:e}=await import(`./commands-AcfFLgl5.js`);e()}catch{}return t}function re(e,n,r){return r?.outputRoot?l(r.outputRoot,e):n===`project`?l(r?.cwd??process.cwd(),`.workmate`,`skills`,e):l(r?.globalSkillsDir??l(t(),`skills`),e)}function E(e){return te(e)}function D(e){let t=(e[0]?.action??`Apply a learned project pattern`).replace(/\s+/g,` `).slice(0,120);return t.length>0?t:`Apply learned project patterns`}function O(e){let{name:t,description:n,confidence:r,instincts:i}=e;return[`---`,`name: ${t}`,`description: ${JSON.stringify(n)}`,`origin: skill-learning`,`confidence: ${Number(r.toFixed(2))}`,`evolved_from: [${i.map(e=>JSON.stringify(e.id)).join(`, `)}]`,`---`,``,`# ${k(t)}`,``,`## Trigger`,``,i.map(e=>`- ${e.trigger}`).join(`
4
4
  `),``,`## Action`,``,i.map(e=>`- ${e.action}`).join(`
5
5
  `),``,`## Evidence`,``,i.flatMap(e=>e.evidence.map(e=>`- ${e}`)).slice(0,j).join(`
6
6
  `),``].join(`
@@ -1,5 +1,5 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,ai as i,hn as a,t as o,y as s}from"./src-WZ94ZKI3.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{SC as l,xC as u}from"./loadAgentsDir-DR5PVAc3.js";import{i as d,t as f}from"./overlayContext-B6i_6y_0.js";function p(){return[`Skill Search (自动技能匹配)`,`Status: ${l()?`enabled`:`disabled`}`,``,`When enabled, relevant skills are automatically matched and`,`injected into conversation context each turn.`].join(`
2
- `)}async function m(){if(l()&&process.env.SKILL_SEARCH_ENABLED!==`0`)return`Skill Search: already enabled`;process.env.SKILL_SEARCH_ENABLED=`1`;let e=[`Skill Search: enabled (SKILL_SEARCH_ENABLED=1)`];try{let{clearSkillIndexCache:t}=await import(`./localSearch-DW3JT2MA.js`);t(),e.push(`Skill index cache: cleared (will rebuild on next search)`)}catch{e.push(`Skill index cache: clear skipped`)}return e.join(`
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,ai as i,hn as a,t as o,y as s}from"./src-BX54x08P.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{SC as l,xC as u}from"./loadAgentsDir-uuZYOgKn.js";import{i as d,t as f}from"./overlayContext-7wgLio1O.js";function p(){return[`Skill Search (自动技能匹配)`,`Status: ${l()?`enabled`:`disabled`}`,``,`When enabled, relevant skills are automatically matched and`,`injected into conversation context each turn.`].join(`
2
+ `)}async function m(){if(l()&&process.env.SKILL_SEARCH_ENABLED!==`0`)return`Skill Search: already enabled`;process.env.SKILL_SEARCH_ENABLED=`1`;let e=[`Skill Search: enabled (SKILL_SEARCH_ENABLED=1)`];try{let{clearSkillIndexCache:t}=await import(`./localSearch-D6MhwvnR.js`);t(),e.push(`Skill index cache: cleared (will rebuild on next search)`)}catch{e.push(`Skill index cache: clear skipped`)}return e.join(`
3
3
  `)}async function h(){return l()?(process.env.SKILL_SEARCH_ENABLED=`0`,`Skill Search: disabled (SKILL_SEARCH_ENABLED=0)`):`Skill Search: already disabled`}function g({onDone:e}){d(`skill-search-panel`);let[t,i]=(0,v.useState)(0),o=(0,v.useMemo)(()=>[{label:`Status`,description:`显示自动 skill 匹配是否已启用`,run:()=>Promise.resolve(p())},{label:`Start`,description:`为本次会话启用自动 skill 匹配`,run:m},{label:`Stop`,description:`为本次会话禁用自动 skill 匹配`,run:h},{label:`About`,description:`自动 skill 匹配的工作原理`,run:()=>Promise.resolve(x)}],[]),c=()=>{let n=o[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return a((e,t)=>{if(t.upArrow){i(e=>Math.max(0,e-1));return}if(t.downArrow){i(e=>Math.min(o.length-1,e+1));return}t.return&&c()}),(0,y.jsx)(s,{title:`Skill Search`,subtitle:`${o.length} actions`,onCancel:()=>e(`Skill search panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,y.jsxs)(n,{flexDirection:`column`,children:[o.map((e,i)=>(0,y.jsxs)(n,{flexDirection:`row`,children:[(0,y.jsx)(r,{children:`${i===t?`›`:` `} ${e.label}`.padEnd(b)}),(0,y.jsx)(r,{dimColor:!0,children:e.description})]},e.label)),(0,y.jsx)(n,{marginTop:1,children:(0,y.jsx)(r,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function _(e,t,n){let r=n?.trim()??``;return r===`start`?(e(await m(),{display:`system`}),null):r===`stop`?(e(await h(),{display:`system`}),null):r===`about`?(e(x,{display:`system`}),null):r===`status`?(e(p(),{display:`system`}),null):(0,y.jsx)(g,{onDone:e})}var v,y,b,x;e((()=>{v=t(i(),1),o(),f(),u(),y=c(),b=28,x=`# Skill Search (自动技能匹配)
4
4
 
5
5
  Skill Search 控制对话中的自动技能匹配功能。
@@ -0,0 +1 @@
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,ai as i,h as a,t as o,y as s}from"./src-BX54x08P.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{fn as l,mn as u}from"./settings-D4M13toi.js";import{Hi as d,Mi as f,Ni as p,Wi as m,hd as h,md as g}from"./loadAgentsDir-uuZYOgKn.js";import{_,g as v}from"./startupProfiler-B9Qv2QGH.js";import{l as y,o as b}from"./stringUtils-Cs6E5f-B.js";function x(e,t){let n=t.trim();if(n===``)return e.slice();let r=n.toLowerCase().split(/\s+/);return e.filter(e=>{let t=`${e.name} ${e.description}`.toLowerCase();return r.every(e=>t.includes(e))})}var S=e((()=>{}));function C(e){return e===`plugin`?`plugin`:e===`mcp`?`mcp`:l(e)}function w({onExit:e,commands:t}){let[i,o]=(0,T.useState)(``),c=(0,T.useMemo)(()=>t.filter(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`commands_DEPRECATED`||e.loadedFrom===`plugin`||e.loadedFrom===`mcp`)),[t]),l=(0,T.useMemo)(()=>x(c.map(e=>({...e,name:p(e),description:e.description??``})),i),[c,i]),u=(0,T.useMemo)(()=>{let e={policySettings:[],userSettings:[],projectSettings:[],localSettings:[],flagSettings:[],plugin:[],mcp:[]};for(let t of l){let n=t.source;n in e&&e[n].push(t)}for(let t of Object.values(e))t.sort((e,t)=>p(e).localeCompare(p(t)));return e},[l]),f=()=>{e(`Skills dialog dismissed`,{display:`system`})};if(c.length===0)return(0,E.jsxs)(s,{title:`Skills`,subtitle:`No skills found`,onCancel:f,hideInputGuide:!0,children:[(0,E.jsx)(r,{dimColor:!0,children:`Create skills in .workmate/skills/ or ~/.workmate/skills/`}),(0,E.jsx)(r,{dimColor:!0,italic:!0,children:(0,E.jsx)(g,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`close`})})]});let m=e=>{switch(e){case`projectSettings`:case`localSettings`:return{label:`local`,color:`yellow`};case`userSettings`:return{label:`global`,color:`cyan`};case`policySettings`:return{label:`managed`,color:`magenta`};default:return}},h=(e,t)=>{let i=`~${v(d(e))}`,a=e.source===`plugin`?e.pluginInfo?.pluginManifest.name:void 0,o=m(e.source);return(0,E.jsxs)(n,{children:[(0,E.jsx)(r,{color:t?`suggestion`:void 0,children:p(e)}),o&&(0,E.jsxs)(r,{color:o.color,children:[` [`,o.label,`]`]}),(0,E.jsxs)(r,{dimColor:!0,children:[a?` · ${a}`:``,` · `,C(e.source),` · `,i,` tokens`]})]})};return(0,E.jsx)(a,{title:`Skills`,placeholder:`Type to filter skills…`,items:(0,T.useMemo)(()=>D.flatMap(e=>u[e]),[u]),getKey:e=>`${e.name}-${e.source}`,visibleCount:12,direction:`down`,onQueryChange:o,onSelect:t=>{e(`/${p(t)}`,{display:`user`})},onCancel:f,emptyMessage:e=>e.trim()?`No skills matching "${e.trim()}"`:`No skills found`,matchLabel:i.trim()===``?`${c.length} ${y(c.length,`skill`)}`:`${l.length}/${c.length} ${y(c.length,`skill`)}`,selectAction:`invoke skill`,renderItem:(e,t)=>h(e,t)})}var T,E,D,O=e((()=>{T=t(i(),1),f(),o(),m(),_(),u(),b(),h(),S(),E=c(),D=[`projectSettings`,`localSettings`,`userSettings`,`flagSettings`,`policySettings`,`plugin`,`mcp`]}));async function k(e,t){return(0,A.jsx)(w,{onExit:e,commands:t.options.commands})}var A;e((()=>{O(),A=c()}))();export{k as call};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-QyzA_cFM.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{t as a}from"./semver-DQo45qGo.js";import{ln as o,rn as s,sn as c,t as l}from"./src-BX54x08P.js";import{Gn as u,Kn as d}from"./state-CXY-q5gr.js";import{$ as ee,I as te,M as f,R as ne,S as re,c as p,et as ie,i as ae,x as oe}from"./debug-2pVES-2G.js";import{i as m,o as se,r as ce,t as le}from"./bundledMode-D9omqD3L.js";import{n as ue}from"./analytics-COpjZpvd.js";import{dirname as de,join as fe}from"path";import*as h from"node:path";import{join as pe,relative as me,resolve as he,sep as ge}from"node:path";import{readFileSync as _e}from"fs";import{stat as ve,unwatchFile as ye,watch as be,watchFile as xe}from"node:fs";import{type as Se}from"node:os";import{readFile as Ce,stat as we}from"fs/promises";import{EventEmitter as Te}from"node:events";import{Readable as Ee}from"node:stream";import{lstat as De,open as Oe,readdir as ke,realpath as g,stat as _}from"node:fs/promises";function Ae(e,t={}){let n=t.entryType||t.type;if(n===`both`&&(n=v.FILE_DIR_TYPE),n&&(t.type=n),!e)throw Error(`readdirp: root argument is required. Usage: readdirp(root, options)`);if(typeof e!=`string`)throw TypeError(`readdirp: root argument must be a string. Usage: readdirp(root, options)`);if(n&&!x.includes(n))throw Error(`readdirp: Invalid type passed. Use one of ${x.join(`, `)}`);return t.root=e,new Ie(t)}var v,y,b,je,x,Me,Ne,Pe,Fe,S,C,Ie,Le=e((()=>{r(),v={FILE_TYPE:`files`,DIR_TYPE:`directories`,FILE_DIR_TYPE:`files_directories`,EVERYTHING_TYPE:`all`},y={root:`.`,fileFilter:e=>!0,directoryFilter:e=>!0,type:v.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096},Object.freeze(y),b=`READDIRP_RECURSIVE_ERROR`,je=new Set([`ENOENT`,`EPERM`,`EACCES`,`ELOOP`,b]),x=[v.DIR_TYPE,v.EVERYTHING_TYPE,v.FILE_DIR_TYPE,v.FILE_TYPE],Me=new Set([v.DIR_TYPE,v.EVERYTHING_TYPE,v.FILE_DIR_TYPE]),Ne=new Set([v.EVERYTHING_TYPE,v.FILE_DIR_TYPE,v.FILE_TYPE]),Pe=e=>je.has(e.code),Fe=process.platform===`win32`,S=e=>!0,C=e=>{if(e===void 0)return S;if(typeof e==`function`)return e;if(typeof e==`string`){let t=e.trim();return e=>e.basename===t}if(Array.isArray(e)){let t=e.map(e=>e.trim());return e=>t.some(t=>e.basename===t)}return S},Ie=class extends Ee{constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark}),i(this,`parents`,void 0),i(this,`reading`,void 0),i(this,`parent`,void 0),i(this,`_stat`,void 0),i(this,`_maxDepth`,void 0),i(this,`_wantsDir`,void 0),i(this,`_wantsFile`,void 0),i(this,`_wantsEverything`,void 0),i(this,`_root`,void 0),i(this,`_isDirent`,void 0),i(this,`_statsProp`,void 0),i(this,`_rdOptions`,void 0),i(this,`_fileFilter`,void 0),i(this,`_directoryFilter`,void 0);let t={...y,...e},{root:n,type:r}=t;this._fileFilter=C(t.fileFilter),this._directoryFilter=C(t.directoryFilter);let a=t.lstat?De:_;Fe?this._stat=e=>a(e,{bigint:!0}):this._stat=a,this._maxDepth=t.depth!=null&&Number.isSafeInteger(t.depth)?t.depth:y.depth,this._wantsDir=r?Me.has(r):!1,this._wantsFile=r?Ne.has(r):!1,this._wantsEverything=r===v.EVERYTHING_TYPE,this._root=he(n),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?`dirent`:`stats`,this._rdOptions={encoding:`utf8`,withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let t=this.parent,n=t&&t.files;if(n&&n.length>0){let{path:r,depth:i}=t,a=n.splice(0,e).map(e=>this._formatEntry(e,r)),o=await Promise.all(a);for(let t of o){if(!t)continue;if(this.destroyed)return;let n=await this._getEntryType(t);n===`directory`&&this._directoryFilter(t)?(i<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,i+1)),this._wantsDir&&(this.push(t),e--)):(n===`file`||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{let e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await ke(e,this._rdOptions)}catch(e){this._onError(e)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n,r=this._isDirent?e.name:e;try{let i=he(pe(t,r));n={path:me(this._root,i),fullPath:i,basename:r},n[this._statsProp]=this._isDirent?e:await this._stat(i)}catch(e){this._onError(e);return}return n}_onError(e){Pe(e)&&!this.destroyed?this.emit(`warn`,e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return``;let t=e[this._statsProp];if(t.isFile())return`file`;if(t.isDirectory())return`directory`;if(t&&t.isSymbolicLink()){let t=e.fullPath;try{let e=await g(t),n=await De(e);if(n.isFile())return`file`;if(n.isDirectory()){let n=e.length;if(t.startsWith(e)&&t.substr(n,1)===ge){let n=Error(`Circular symlink detected: "${t}" points to "${e}"`);return n.code=b,this._onError(n)}return`directory`}}catch(e){return this._onError(e),``}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}}));function Re(e,t,n,r,i){let a=(t,r)=>{n(e),i(t,r,{watchedPath:e}),r&&e!==r&&L(h.resolve(e,r),k,h.join(e,r))};try{return be(e,{persistent:t.persistent},a)}catch(e){r(e);return}}var ze,Be,w,T,E,Ve,He,Ue,We,D,O,Ge,Ke,k,A,j,qe,Je,Ye,M,N,Xe,P,F,I,L,Ze,R,Qe,$e,et=e((()=>{r(),ze=`data`,Be=`close`,w=()=>{},T=process.platform,E=T===`win32`,Ve=T===`darwin`,He=T===`linux`,Ue=T===`freebsd`,We=Se()===`OS400`,D={ALL:`all`,READY:`ready`,ADD:`add`,CHANGE:`change`,ADD_DIR:`addDir`,UNLINK:`unlink`,UNLINK_DIR:`unlinkDir`,RAW:`raw`,ERROR:`error`},O=D,Ge=`watch`,Ke={lstat:De,stat:_},k=`listeners`,A=`errHandlers`,j=`rawEmitters`,qe=[k,A,j],Je=new Set(`3dm.3ds.3g2.3gp.7z.a.aac.adp.afdesign.afphoto.afpub.ai.aif.aiff.alz.ape.apk.appimage.ar.arj.asf.au.avi.bak.baml.bh.bin.bk.bmp.btif.bz2.bzip2.cab.caf.cgm.class.cmx.cpio.cr2.cur.dat.dcm.deb.dex.djvu.dll.dmg.dng.doc.docm.docx.dot.dotm.dra.DS_Store.dsk.dts.dtshd.dvb.dwg.dxf.ecelp4800.ecelp7470.ecelp9600.egg.eol.eot.epub.exe.f4v.fbs.fh.fla.flac.flatpak.fli.flv.fpx.fst.fvt.g3.gh.gif.graffle.gz.gzip.h261.h263.h264.icns.ico.ief.img.ipa.iso.jar.jpeg.jpg.jpgv.jpm.jxr.key.ktx.lha.lib.lvp.lz.lzh.lzma.lzo.m3u.m4a.m4v.mar.mdi.mht.mid.midi.mj2.mka.mkv.mmr.mng.mobi.mov.movie.mp3.mp4.mp4a.mpeg.mpg.mpga.mxu.nef.npx.numbers.nupkg.o.odp.ods.odt.oga.ogg.ogv.otf.ott.pages.pbm.pcx.pdb.pdf.pea.pgm.pic.png.pnm.pot.potm.potx.ppa.ppam.ppm.pps.ppsm.ppsx.ppt.pptm.pptx.psd.pya.pyc.pyo.pyv.qt.rar.ras.raw.resources.rgb.rip.rlc.rmf.rmvb.rpm.rtf.rz.s3m.s7z.scpt.sgi.shar.snap.sil.sketch.slk.smv.snk.so.stl.suo.sub.swf.tar.tbz.tbz2.tga.tgz.thmx.tif.tiff.tlz.ttc.ttf.txz.udf.uvh.uvi.uvm.uvp.uvs.uvu.viv.vob.war.wav.wax.wbmp.wdp.weba.webm.webp.whl.wim.wm.wma.wmv.wmx.woff.woff2.wrm.wvx.xbm.xif.xla.xlam.xls.xlsb.xlsm.xlsx.xlt.xltm.xltx.xm.xmind.xpi.xpm.xwd.xz.z.zip.zipx`.split(`.`)),Ye=e=>Je.has(h.extname(e).slice(1).toLowerCase()),M=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},N=(e,t,n)=>{let r=e[t];r instanceof Set||(e[t]=r=new Set([r])),r.add(n)},Xe=e=>t=>{let n=e[t];n instanceof Set?n.clear():delete e[t]},P=(e,t,n)=>{let r=e[t];r instanceof Set?r.delete(n):r===n&&delete e[t]},F=e=>e instanceof Set?e.size===0:!e,I=new Map,L=(e,t,n,r,i)=>{let a=I.get(e);a&&M(a[t],e=>{e(n,r,i)})},Ze=(e,t,n,r)=>{let{listener:i,errHandler:a,rawEmitter:o}=r,s=I.get(t),c;if(!n.persistent)return c=Re(e,n,i,a,o),c?c.close.bind(c):void 0;if(s)N(s,k,i),N(s,A,a),N(s,j,o);else{if(c=Re(e,n,L.bind(null,t,k),a,L.bind(null,t,j)),!c)return;c.on(O.ERROR,async n=>{let r=L.bind(null,t,A);if(s&&(s.watcherUnusable=!0),E&&n.code===`EPERM`)try{await(await Oe(e,`r`)).close(),r(n)}catch{}else r(n)}),s={listeners:i,errHandlers:a,rawEmitters:o,watcher:c},I.set(t,s)}return()=>{P(s,k,i),P(s,A,a),P(s,j,o),F(s.listeners)&&(s.watcher.close(),I.delete(t),qe.forEach(Xe(s)),s.watcher=void 0,Object.freeze(s))}},R=new Map,Qe=(e,t,n,r)=>{let{listener:i,rawEmitter:a}=r,o=R.get(t),s=o&&o.options;return s&&(s.persistent<n.persistent||s.interval>n.interval)&&(ye(t),o=void 0),o?(N(o,k,i),N(o,j,a)):(o={listeners:i,rawEmitters:a,options:n,watcher:xe(t,n,(n,r)=>{M(o.rawEmitters,e=>{e(O.CHANGE,t,{curr:n,prev:r})});let i=n.mtimeMs;(n.size!==r.size||i>r.mtimeMs||i===0)&&M(o.listeners,t=>t(e,n))})},R.set(t,o)),()=>{P(o,k,i),P(o,j,a),F(o.listeners)&&(R.delete(t),ye(t),o.options=o.watcher=void 0,Object.freeze(o))}},$e=class{constructor(e){i(this,`fsw`,void 0),i(this,`_boundHandleError`,void 0),this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,r=h.dirname(e),i=h.basename(e);this.fsw._getWatchedDir(r).add(i);let a=h.resolve(e),o={persistent:n.persistent};t||(t=w);let s;return n.usePolling?(o.interval=n.interval!==n.binaryInterval&&Ye(i)?n.binaryInterval:n.interval,s=Qe(e,a,o,{listener:t,rawEmitter:this.fsw._emitRaw})):s=Ze(e,a,o,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),s}_handleFile(e,t,n){if(this.fsw.closed)return;let r=h.dirname(e),i=h.basename(e),a=this.fsw._getWatchedDir(r),o=t;if(a.has(i))return;let s=async(t,n)=>{if(this.fsw._throttle(Ge,e,5)){if(!n||n.mtimeMs===0)try{let n=await _(e);if(this.fsw.closed)return;let r=n.atimeMs,i=n.mtimeMs;if((!r||r<=i||i!==o.mtimeMs)&&this.fsw._emit(O.CHANGE,e,n),(Ve||He||Ue)&&o.ino!==n.ino){this.fsw._closeFile(t),o=n;let r=this._watchWithNodeFs(e,s);r&&this.fsw._addPathCloser(t,r)}else o=n}catch{this.fsw._remove(r,i)}else if(a.has(i)){let t=n.atimeMs,r=n.mtimeMs;(!t||t<=r||r!==o.mtimeMs)&&this.fsw._emit(O.CHANGE,e,n),o=n}}},c=this._watchWithNodeFs(e,s);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(O.ADD,e,0))return;this.fsw._emit(O.ADD,e,t)}return c}async _handleSymlink(e,t,n,r){if(this.fsw.closed)return;let i=e.fullPath,a=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let t;try{t=await g(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(r)?this.fsw._symlinkPaths.get(i)!==t&&(this.fsw._symlinkPaths.set(i,t),this.fsw._emit(O.CHANGE,n,e.stats)):(a.add(r),this.fsw._symlinkPaths.set(i,t),this.fsw._emit(O.ADD,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(e,t,n,r,i,a,o){e=h.join(e,``);let s=r?`${e}:${r}`:e;if(o=this.fsw._throttle(`readdir`,s,1e3),!o)return;let c=this.fsw._getWatchedDir(n.path),l=new Set,u=this.fsw._readdirp(e,{fileFilter:e=>n.filterPath(e),directoryFilter:e=>n.filterDir(e)});if(u)return u.on(ze,async o=>{if(this.fsw.closed){u=void 0;return}let s=o.path,d=h.join(e,s);if(l.add(s),!(o.stats.isSymbolicLink()&&await this._handleSymlink(o,e,d,s))){if(this.fsw.closed){u=void 0;return}(s===r||!r&&!c.has(s))&&(this.fsw._incrReadyCount(),d=h.join(i,h.relative(i,d)),this._addToNodeFs(d,t,n,a+1))}}).on(O.ERROR,this._boundHandleError),new Promise((t,s)=>{if(!u)return s();u.once(`end`,()=>{if(this.fsw.closed){u=void 0;return}let s=o?o.clear():!1;t(void 0),c.getChildren().filter(t=>t!==e&&!l.has(t)).forEach(t=>{this.fsw._remove(e,t)}),u=void 0,s&&this._handleRead(e,!1,n,r,i,a,o)})})}async _handleDir(e,t,n,r,i,a,o){let s=this.fsw._getWatchedDir(h.dirname(e)),c=s.has(h.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!i&&!c&&this.fsw._emit(O.ADD_DIR,e,t),s.add(h.basename(e)),this.fsw._getWatchedDir(e);let l,u=this.fsw.options.depth;if((u==null||r<=u)&&!this.fsw._symlinkPaths.has(o)){if(!i&&(await this._handleRead(e,n,a,i,e,r,void 0),this.fsw.closed))return;l=this._watchWithNodeFs(e,(t,n)=>{n&&n.mtimeMs===0||this._handleRead(t,!1,a,i,e,r,void 0)})}return l}async _addToNodeFs(e,t,n,r,i){let a=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return a(),!1;let o=this.fsw._getWatchHelpers(e);n&&(o.filterPath=e=>n.filterPath(e),o.filterDir=e=>n.filterDir(e));try{let n=await Ke[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,n))return a(),!1;let s=this.fsw.options.followSymlinks,c;if(n.isDirectory()){let a=h.resolve(e),l=s?await g(e):e;if(this.fsw.closed||(c=await this._handleDir(o.watchPath,n,t,r,i,o,l),this.fsw.closed))return;a!==l&&l!==void 0&&this.fsw._symlinkPaths.set(a,l)}else if(n.isSymbolicLink()){let i=s?await g(e):e;if(this.fsw.closed)return;let a=h.dirname(o.watchPath);if(this.fsw._getWatchedDir(a).add(o.watchPath),this.fsw._emit(O.ADD,o.watchPath,n),c=await this._handleDir(a,n,t,r,e,o,i),this.fsw.closed)return;i!==void 0&&this.fsw._symlinkPaths.set(h.resolve(e),i)}else c=this._handleFile(o.watchPath,n,t);return a(),c&&this.fsw._addPathCloser(e,c),!1}catch(t){if(this.fsw._handleError(t))return a(),e}}}}));function z(e){return Array.isArray(e)?e:[e]}function tt(e){return typeof e==`function`?e:typeof e==`string`?t=>e===t:e instanceof RegExp?t=>e.test(t):typeof e==`object`&&e?t=>{if(e.path===t)return!0;if(e.recursive){let n=h.relative(e.path,t);return n?!n.startsWith(`..`)&&!h.isAbsolute(n):!1}return!1}:()=>!1}function nt(e){if(typeof e!=`string`)throw Error(`string expected`);e=h.normalize(e),e=e.replace(/\\/g,`/`);let t=!1;return e.startsWith(`//`)&&(t=!0),e=e.replace(H,`/`),t&&(e=`/`+e),e}function rt(e,t,n){let r=nt(t);for(let t=0;t<e.length;t++){let i=e[t];if(i(r,n))return!0}return!1}function it(e,t){if(e==null)throw TypeError(`anymatch: specify first argument`);let n=z(e).map(e=>tt(e));return t==null?(e,t)=>rt(n,e,t):rt(n,t)}function at(e,t={}){let n=new bt(t);return n.add(e),n}var B,ot,V,st,ct,lt,H,ut,dt,U,W,G,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St=e((()=>{Le(),et(),r(),B=`/`,ot=`//`,V=`.`,st=`..`,ct=`string`,lt=/\\/g,H=/\/\//g,ut=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,dt=/^\.[/\\]/,U=e=>typeof e==`object`&&!!e&&!(e instanceof RegExp),W=e=>{let t=z(e).flat();if(!t.every(e=>typeof e===ct))throw TypeError(`Non-string provided as watch path: ${t}`);return t.map(ft)},G=e=>{let t=e.replace(lt,B),n=!1;return t.startsWith(ot)&&(n=!0),t=t.replace(H,B),n&&(t=B+t),t},ft=e=>G(h.normalize(G(e))),pt=(e=``)=>t=>typeof t==`string`?ft(h.isAbsolute(t)?t:h.join(e,t)):t,mt=(e,t)=>h.isAbsolute(e)?e:h.join(t,e),ht=Object.freeze(new Set),gt=class{constructor(e,t){i(this,`path`,void 0),i(this,`_removeWatcher`,void 0),i(this,`items`,void 0),this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==V&&e!==st&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let n=this.path;try{await ke(n)}catch{this._removeWatcher&&this._removeWatcher(h.dirname(n),h.basename(n))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path=``,this._removeWatcher=w,this.items=ht,Object.freeze(this)}},_t=`stat`,vt=`lstat`,yt=class{constructor(e,t,n){i(this,`fsw`,void 0),i(this,`path`,void 0),i(this,`watchPath`,void 0),i(this,`fullWatchPath`,void 0),i(this,`dirParts`,void 0),i(this,`followSymlinks`,void 0),i(this,`statMethod`,void 0),this.fsw=n;let r=e;this.path=e=e.replace(dt,``),this.watchPath=r,this.fullWatchPath=h.resolve(r),this.dirParts=[],this.dirParts.forEach(e=>{e.length>1&&e.pop()}),this.followSymlinks=t,this.statMethod=t?_t:vt}entryPath(e){return h.join(this.watchPath,h.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},bt=class extends Te{constructor(e={}){super(),i(this,`closed`,void 0),i(this,`options`,void 0),i(this,`_closers`,void 0),i(this,`_ignoredPaths`,void 0),i(this,`_throttled`,void 0),i(this,`_streams`,void 0),i(this,`_symlinkPaths`,void 0),i(this,`_watched`,void 0),i(this,`_pendingWrites`,void 0),i(this,`_pendingUnlinks`,void 0),i(this,`_readyCount`,void 0),i(this,`_emitReady`,void 0),i(this,`_closePromise`,void 0),i(this,`_userIgnored`,void 0),i(this,`_readyEmitted`,void 0),i(this,`_emitRaw`,void 0),i(this,`_boundRemove`,void 0),i(this,`_nodeFsHandler`,void 0),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,n={stabilityThreshold:2e3,pollInterval:100},r={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?z(e.ignored):z([]),awaitWriteFinish:t===!0?n:typeof t==`object`&&{...n,...t}};We&&(r.usePolling=!0),r.atomic===void 0&&(r.atomic=!r.usePolling);let a=process.env.CHOKIDAR_USEPOLLING;if(a!==void 0){let e=a.toLowerCase();e===`false`||e===`0`?r.usePolling=!1:e===`true`||e===`1`?r.usePolling=!0:r.usePolling=!!e}let o=process.env.CHOKIDAR_INTERVAL;o&&(r.interval=Number.parseInt(o,10));let s=0;this._emitReady=()=>{s++,s>=this._readyCount&&(this._emitReady=w,this._readyEmitted=!0,process.nextTick(()=>this.emit(D.READY)))},this._emitRaw=(...e)=>this.emit(D.RAW,...e),this._boundRemove=this._remove.bind(this),this.options=r,this._nodeFsHandler=new $e(this),Object.freeze(r)}_addIgnoredPath(e){if(U(e)){for(let t of this._ignoredPaths)if(U(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e==`string`)for(let t of this._ignoredPaths)U(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,t,n){let{cwd:r}=this.options;this.closed=!1,this._closePromise=void 0;let i=W(e);return r&&(i=i.map(e=>mt(e,r))),i.forEach(e=>{this._removeIgnoredPath(e)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async e=>{let r=await this._nodeFsHandler._addToNodeFs(e,!n,void 0,0,t);return r&&this._emitReady(),r})).then(e=>{this.closed||e.forEach(e=>{e&&this.add(h.dirname(e),h.basename(t||e))})}),this}unwatch(e){if(this.closed)return this;let t=W(e),{cwd:n}=this.options;return t.forEach(e=>{!h.isAbsolute(e)&&!this._closers.has(e)&&(n&&(e=h.join(n,e)),e=h.resolve(e)),this._closePath(e),this._addIgnoredPath(e),this._watched.has(e)&&this._addIgnoredPath({path:e,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(t=>{let n=t();n instanceof Promise&&e.push(n)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>void 0):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let r=(this.options.cwd?h.relative(this.options.cwd,n):n)||V;e[r]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(e,...t),e!==D.ERROR&&this.emit(D.ALL,e,...t)}async _emit(e,t,n){if(this.closed)return;let r=this.options;E&&(t=h.normalize(t)),r.cwd&&(t=h.relative(r.cwd,t));let i=[t];n!=null&&i.push(n);let a=r.awaitWriteFinish,o;if(a&&(o=this._pendingWrites.get(t)))return o.lastChange=new Date,this;if(r.atomic){if(e===D.UNLINK)return this._pendingUnlinks.set(t,[e,...i]),setTimeout(()=>{this._pendingUnlinks.forEach((e,t)=>{this.emit(...e),this.emit(D.ALL,...e),this._pendingUnlinks.delete(t)})},typeof r.atomic==`number`?r.atomic:100),this;e===D.ADD&&this._pendingUnlinks.has(t)&&(e=D.CHANGE,this._pendingUnlinks.delete(t))}if(a&&(e===D.ADD||e===D.CHANGE)&&this._readyEmitted)return this._awaitWriteFinish(t,a.stabilityThreshold,e,(t,n)=>{t?(e=D.ERROR,i[0]=t,this.emitWithAll(e,i)):n&&(i.length>1?i[1]=n:i.push(n),this.emitWithAll(e,i))}),this;if(e===D.CHANGE&&!this._throttle(D.CHANGE,t,50))return this;if(r.alwaysStat&&n===void 0&&(e===D.ADD||e===D.ADD_DIR||e===D.CHANGE)){let e=r.cwd?h.join(r.cwd,t):t,n;try{n=await _(e)}catch{}if(!n||this.closed)return;i.push(n)}return this.emitWithAll(e,i),this}_handleError(e){let t=e&&e.code;return e&&t!==`ENOENT`&&t!==`ENOTDIR`&&(!this.options.ignorePermissionErrors||t!==`EPERM`&&t!==`EACCES`)&&this.emit(D.ERROR,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let r=this._throttled.get(e);if(!r)throw Error(`invalid throttle`);let i=r.get(t);if(i)return i.count++,!1;let a,o=()=>{let e=r.get(t),n=e?e.count:0;return r.delete(t),clearTimeout(a),e&&clearTimeout(e.timeoutObject),n};a=setTimeout(o,n);let s={timeoutObject:a,clear:o,count:0};return r.set(t,s),s}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,r){let i=this.options.awaitWriteFinish;if(typeof i!=`object`)return;let a=i.pollInterval,o,s=e;this.options.cwd&&!h.isAbsolute(e)&&(s=h.join(this.options.cwd,e));let c=new Date,l=this._pendingWrites;function u(n){ve(s,(i,s)=>{if(i||!l.has(e)){i&&i.code!==`ENOENT`&&r(i);return}let c=Number(new Date);n&&s.size!==n.size&&(l.get(e).lastChange=c),c-l.get(e).lastChange>=t?(l.delete(e),r(void 0,s)):o=setTimeout(u,a,s)})}l.has(e)||(l.set(e,{lastChange:c,cancelWait:()=>(l.delete(e),clearTimeout(o),n)}),o=setTimeout(u,a))}_isIgnored(e,t){if(this.options.atomic&&ut.test(e))return!0;if(!this._userIgnored){let{cwd:e}=this.options,t=(this.options.ignored||[]).map(pt(e)),n=[...[...this._ignoredPaths].map(pt(e)),...t];this._userIgnored=it(n,void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new yt(e,this.options.followSymlinks,this)}_getWatchedDir(e){let t=h.resolve(e);return this._watched.has(t)||this._watched.set(t,new gt(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,t,n){let r=h.join(e,t),i=h.resolve(r);if(n=n??(this._watched.has(r)||this._watched.has(i)),!this._throttle(`remove`,r,100))return;!n&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(r).getChildren().forEach(e=>this._remove(r,e));let a=this._getWatchedDir(e),o=a.has(t);a.remove(t),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let s=r;if(this.options.cwd&&(s=h.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(s)&&this._pendingWrites.get(s).cancelWait()===D.ADD)return;this._watched.delete(r),this._watched.delete(i);let c=n?D.UNLINK_DIR:D.UNLINK;o&&!this._isIgnored(r)&&this._emit(c,r),this._closePath(r)}_closePath(e){this._closeFile(e);let t=h.dirname(e);this._getWatchedDir(t).remove(h.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(e=>e()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;let n=Ae(e,{type:D.ALL,alwaysStat:!0,lstat:!0,...t,depth:0});return this._streams.add(n),n.once(Be,()=>{n=void 0}),n.once(`end`,()=>{n&&(this._streams.delete(n),n=void 0)}),n}},xt={watch:at,FSWatcher:bt}}));function Ct(){return Dt||(Dt=a()),Dt}function wt(e,t){return typeof Bun<`u`?Bun.semver.order(e,t)===1:Ct().gt(e,t,{loose:!0})}function Tt(e,t){return typeof Bun<`u`?Bun.semver.order(e,t)>=0:Ct().gte(e,t,{loose:!0})}function Et(e,t){return typeof Bun<`u`?Bun.semver.satisfies(e,t):Ct().satisfies(e,t,{loose:!0})}var Dt,Ot=e((()=>{})),kt,At,jt,Mt=e((()=>{Ot(),le(),se(),kt=m()===`windows`?`alt+v`:`ctrl+v`,At=m()!==`windows`||(ce()?Et(process.versions.bun,`>=1.2.23`):Et(process.versions.node,`>=22.17.0 <23.0.0 || >=24.2.0`))?`shift+tab`:`meta+m`,jt=[{context:`Global`,bindings:{"ctrl+c":`app:interrupt`,"ctrl+d":`app:exit`,"ctrl+l":`app:redraw`,"ctrl+t":`app:toggleTodos`,"ctrl+o":`app:toggleTranscript`,"ctrl+shift+o":`app:toggleTeammatePreview`,"ctrl+r":`history:search`}},{context:`Chat`,bindings:{escape:`chat:cancel`,"ctrl+x ctrl+k":`chat:killAgents`,[At]:`chat:cycleMode`,"meta+p":`chat:modelPicker`,"meta+o":`chat:fastMode`,"meta+t":`chat:thinkingToggle`,enter:`chat:submit`,up:`history:previous`,down:`history:next`,"ctrl+_":`chat:undo`,"ctrl+shift+-":`chat:undo`,"ctrl+x ctrl+e":`chat:externalEditor`,"ctrl+g":`chat:externalEditor`,"ctrl+s":`chat:stash`,[kt]:`chat:imagePaste`}},{context:`Autocomplete`,bindings:{tab:`autocomplete:accept`,escape:`autocomplete:dismiss`,up:`autocomplete:previous`,down:`autocomplete:next`}},{context:`Settings`,bindings:{escape:`confirm:no`,up:`select:previous`,down:`select:next`,k:`select:previous`,j:`select:next`,"ctrl+p":`select:previous`,"ctrl+n":`select:next`,left:`select:previousValue`,right:`select:nextValue`,space:`select:accept`,enter:`settings:close`,"/":`settings:search`,r:`settings:retry`}},{context:`Confirmation`,bindings:{enter:`confirm:yes`,escape:`confirm:no`,up:`confirm:previous`,down:`confirm:next`,tab:`confirm:nextField`,space:`confirm:toggle`,"shift+tab":`confirm:cycleMode`,"ctrl+e":`confirm:toggleExplanation`,"ctrl+d":`permission:toggleDebug`}},{context:`FormField`,bindings:{tab:`tabs:next`,"shift+tab":`tabs:previous`,up:`tabs:previous`,down:`tabs:next`}},{context:`Tabs`,bindings:{tab:`tabs:next`,"shift+tab":`tabs:previous`,right:`tabs:next`,left:`tabs:previous`}},{context:`Transcript`,bindings:{"ctrl+e":`transcript:toggleShowAll`,"ctrl+c":`transcript:exit`,escape:`transcript:exit`,q:`transcript:exit`}},{context:`HistorySearch`,bindings:{"ctrl+r":`historySearch:next`,escape:`historySearch:accept`,tab:`historySearch:accept`,"ctrl+c":`historySearch:cancel`,enter:`historySearch:execute`}},{context:`Task`,bindings:{"ctrl+b":`task:background`}},{context:`ThemePicker`,bindings:{"ctrl+t":`theme:toggleSyntaxHighlighting`}},{context:`Scroll`,bindings:{pageup:`scroll:pageUp`,pagedown:`scroll:pageDown`,wheelup:`scroll:lineUp`,wheeldown:`scroll:lineDown`,"ctrl+home":`scroll:top`,"ctrl+end":`scroll:bottom`,"ctrl+shift+c":`selection:copy`,"cmd+c":`selection:copy`}},{context:`Help`,bindings:{escape:`help:dismiss`}},{context:`Attachments`,bindings:{right:`attachments:next`,left:`attachments:previous`,backspace:`attachments:remove`,delete:`attachments:remove`,down:`attachments:exit`,escape:`attachments:exit`}},{context:`Footer`,bindings:{up:`footer:up`,"ctrl+p":`footer:up`,down:`footer:down`,"ctrl+n":`footer:down`,right:`footer:next`,left:`footer:previous`,enter:`footer:openSelected`,escape:`footer:clearSelection`}},{context:`MessageSelector`,bindings:{up:`messageSelector:up`,down:`messageSelector:down`,k:`messageSelector:up`,j:`messageSelector:down`,"ctrl+p":`messageSelector:up`,"ctrl+n":`messageSelector:down`,"ctrl+up":`messageSelector:top`,"shift+up":`messageSelector:top`,"meta+up":`messageSelector:top`,"shift+k":`messageSelector:top`,"ctrl+down":`messageSelector:bottom`,"shift+down":`messageSelector:bottom`,"meta+down":`messageSelector:bottom`,"shift+j":`messageSelector:bottom`,enter:`messageSelector:select`}},{context:`DiffDialog`,bindings:{escape:`diff:dismiss`,left:`diff:previousSource`,right:`diff:nextSource`,up:`diff:previousFile`,down:`diff:nextFile`,enter:`diff:viewDetails`}},{context:`ModelPicker`,bindings:{space:`modelPicker:toggle1M`}},{context:`Select`,bindings:{up:`select:previous`,down:`select:next`,j:`select:next`,k:`select:previous`,"ctrl+n":`select:next`,"ctrl+p":`select:previous`,enter:`select:accept`,escape:`select:cancel`}},{context:`Plugin`,bindings:{space:`plugin:toggle`,i:`plugin:install`}}]})),Nt=e((()=>{l()}));function Pt(){let e=m(),t=[...It,...Lt];return e===`macos`&&t.push(...Rt),t}function K(e){return e.trim().split(/\s+/).map(Ft).join(` `)}function Ft(e){let t=e.split(`+`),n=[],r=``;for(let e of t){let t=e.trim().toLowerCase();[`ctrl`,`control`,`alt`,`opt`,`option`,`meta`,`cmd`,`command`,`shift`].includes(t)?t===`control`?n.push(`ctrl`):t===`option`||t===`opt`?n.push(`alt`):t===`command`||t===`cmd`?n.push(`cmd`):n.push(t):r=t}return n.sort(),[...n,r].join(`+`)}var It,Lt,Rt,zt=e((()=>{se(),It=[{key:`ctrl+c`,reason:`Cannot be rebound - used for interrupt/exit (hardcoded)`,severity:`error`},{key:`ctrl+d`,reason:`Cannot be rebound - used for exit (hardcoded)`,severity:`error`},{key:`ctrl+m`,reason:`Cannot be rebound - identical to Enter in terminals (both send CR)`,severity:`error`}],Lt=[{key:`ctrl+z`,reason:`Unix process suspend (SIGTSTP)`,severity:`warning`},{key:`ctrl+\\`,reason:`Terminal quit signal (SIGQUIT)`,severity:`error`}],Rt=[{key:`cmd+c`,reason:`macOS system copy`,severity:`error`},{key:`cmd+v`,reason:`macOS system paste`,severity:`error`},{key:`cmd+x`,reason:`macOS system cut`,severity:`error`},{key:`cmd+q`,reason:`macOS quit application`,severity:`error`},{key:`cmd+w`,reason:`macOS close window/tab`,severity:`error`},{key:`cmd+tab`,reason:`macOS app switcher`,severity:`error`},{key:`cmd+space`,reason:`macOS Spotlight`,severity:`error`}]}));function Bt(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.context==`string`&&typeof t.bindings==`object`&&t.bindings!==null}function Vt(e){return Array.isArray(e)&&e.every(Bt)}function Ht(e){return Zt.includes(e)}function Ut(e){let t=e.toLowerCase().split(`+`);for(let n of t)if(!n.trim())return{type:`parse_error`,severity:`error`,message:`Empty key part in "${e}"`,key:e,suggestion:`Remove extra "+" characters`};let n=o(e);return!n.key&&!n.ctrl&&!n.alt&&!n.shift&&!n.meta?{type:`parse_error`,severity:`error`,message:`Could not parse keystroke "${e}"`,key:e}:null}function Wt(e,t){let n=[];if(typeof e!=`object`||!e)return n.push({type:`parse_error`,severity:`error`,message:`Keybinding block ${t+1} is not an object`}),n;let r=e,i=r.context,a;if(typeof i==`string`?Ht(i)?a=i:n.push({type:`invalid_context`,severity:`error`,message:`Unknown context "${i}"`,context:i,suggestion:`Valid contexts: ${Zt.join(`, `)}`}):n.push({type:`parse_error`,severity:`error`,message:`Keybinding block ${t+1} missing "context" field`}),typeof r.bindings!=`object`||r.bindings===null)return n.push({type:`parse_error`,severity:`error`,message:`Keybinding block ${t+1} missing "bindings" field`}),n;let o=r.bindings;for(let[e,t]of Object.entries(o)){let r=Ut(e);r&&(r.context=a,n.push(r)),t!==null&&typeof t!=`string`?n.push({type:`invalid_action`,severity:`error`,message:`Invalid action for "${e}": must be a string or null`,key:e,context:a}):typeof t==`string`&&t.startsWith(`command:`)&&(/^command:[a-zA-Z0-9:\-_]+$/.test(t)||n.push({type:`invalid_action`,severity:`warning`,message:`Invalid command binding "${t}" for "${e}": command name may only contain alphanumeric characters, colons, hyphens, and underscores`,key:e,context:a,action:t}),a&&a!==`Chat`&&n.push({type:`invalid_action`,severity:`warning`,message:`Command binding "${t}" must be in "Chat" context, not "${a}"`,key:e,context:a,action:t,suggestion:`Move this binding to a block with "context": "Chat"`}))}return n}function Gt(e){let t=[],n=/"bindings"\s*:\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,r;for(;(r=n.exec(e))!==null;){let n=r[1];if(!n)continue;let i=e.slice(0,r.index).match(/"context"\s*:\s*"([^"]+)"[^{]*$/)?.[1]??`unknown`,a=/"([^"]+)"\s*:/g,o=new Map,s;for(;(s=a.exec(n))!==null;){let e=s[1];if(!e)continue;let n=(o.get(e)??0)+1;o.set(e,n),n===2&&t.push({type:`duplicate`,severity:`warning`,message:`Duplicate key "${e}" in ${i} bindings`,key:e,context:i,suggestion:`This key appears multiple times in the same context. JSON uses the last value, earlier values are ignored.`})}}return t}function Kt(e){let t=[];if(!Array.isArray(e))return t.push({type:`parse_error`,severity:`error`,message:`keybindings.json must contain an array`,suggestion:`Wrap your bindings in [ ]`}),t;for(let n=0;n<e.length;n++)t.push(...Wt(e[n],n));return t}function qt(e){let t=[],n=new Map;for(let r of e){let e=n.get(r.context)??new Map;n.set(r.context,e);for(let[n,i]of Object.entries(r.bindings)){let a=K(n),o=e.get(a);o&&o!==i&&t.push({type:`duplicate`,severity:`warning`,message:`Duplicate binding "${n}" in ${r.context} context`,key:n,context:r.context,action:i??`null (unbind)`,suggestion:`Previously bound to "${o}". Only the last binding will be used.`}),e.set(a,i??`null`)}}return t}function Jt(e){let t=[],n=Pt();for(let r of e){let e=s(r.chord),i=K(e);for(let a of n)K(a.key)===i&&t.push({type:`reserved`,severity:a.severity,message:`"${e}" may not work: ${a.reason}`,key:e,context:r.context,action:r.action??void 0})}return t}function Yt(e){let t=[];for(let n of e)for(let[e,r]of Object.entries(n.bindings)){let i=e.split(` `).map(e=>o(e));t.push({chord:i,action:r,context:n.context})}return t}function Xt(e,t){let n=[];if(n.push(...Kt(e)),Vt(e)){n.push(...qt(e));let t=Yt(e);n.push(...Jt(t))}let r=new Set;return n.filter(e=>{let t=`${e.type}:${e.key}:${e.context}`;return r.has(t)?!1:(r.add(t),!0)})}var Zt,Qt=e((()=>{Nt(),zt(),Zt=[`Global`,`Chat`,`Autocomplete`,`Confirmation`,`Help`,`Transcript`,`HistorySearch`,`Task`,`ThemePicker`,`Settings`,`Tabs`,`Attachments`,`Footer`,`FormField`,`MessageActions`,`MessageSelector`,`DiffDialog`,`ModelPicker`,`Scroll`,`Select`,`Plugin`]}));function q(){return!1}function $t(e){let t=new Date().toISOString().slice(0,10);$!==t&&($=t)}function en(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.context==`string`&&typeof t.bindings==`object`&&t.bindings!==null}function tn(e){return Array.isArray(e)&&e.every(en)}function J(){return fe(t(),`keybindings.json`)}function nn(){return c(jt)}async function rn(){let e=nn();if(!q())return{bindings:e,warnings:[]};let t=J();try{let n=await Ce(t,`utf-8`),r=re(n),i;if(typeof r==`object`&&r&&`bindings`in r)i=r.bindings;else{let t=`keybindings.json must have a "bindings" array`;return p(`[keybindings] Invalid keybindings.json: ${t}`),{bindings:e,warnings:[{type:`parse_error`,severity:`error`,message:t,suggestion:`Use format: { "bindings": [ ... ] }`}]}}if(!tn(i)){let t=Array.isArray(i)?`keybindings.json contains invalid block structure`:`"bindings" must be an array`,n=Array.isArray(i)?`Each block must have "context" (string) and "bindings" (object)`:`Set "bindings" to an array of keybinding blocks`;return p(`[keybindings] Invalid keybindings.json: ${t}`),{bindings:e,warnings:[{type:`parse_error`,severity:`error`,message:t,suggestion:n}]}}let a=c(i);p(`[keybindings] Loaded ${a.length} user bindings from ${t}`);let o=[...e,...a];$t(a.length);let s=[...Gt(n),...Xt(i,o)];return s.length>0&&p(`[keybindings] Found ${s.length} validation issue(s)`),{bindings:o,warnings:s}}catch(n){return ne(n)?{bindings:e,warnings:[]}:(p(`[keybindings] Error loading ${t}: ${f(n)}`),{bindings:e,warnings:[{type:`parse_error`,severity:`error`,message:`Failed to parse keybindings.json: ${f(n)}`}]})}}function an(){return X||on().bindings}function on(){if(X)return{bindings:X,warnings:Z};let e=nn();if(!q())return X=e,Z=[],{bindings:X,warnings:Z};let t=J();try{let n=_e(t,`utf-8`),r=re(n),i;if(typeof r==`object`&&r&&`bindings`in r)i=r.bindings;else return X=e,Z=[{type:`parse_error`,severity:`error`,message:`keybindings.json must have a "bindings" array`,suggestion:`Use format: { "bindings": [ ... ] }`}],{bindings:X,warnings:Z};if(!tn(i)){let t=Array.isArray(i)?`keybindings.json contains invalid block structure`:`"bindings" must be an array`,n=Array.isArray(i)?`Each block must have "context" (string) and "bindings" (object)`:`Set "bindings" to an array of keybinding blocks`;return X=e,Z=[{type:`parse_error`,severity:`error`,message:t,suggestion:n}],{bindings:X,warnings:Z}}let a=c(i);return p(`[keybindings] Loaded ${a.length} user bindings from ${t}`),X=[...e,...a],$t(a.length),Z=[...Gt(n),...Xt(i,X)],Z.length>0&&p(`[keybindings] Found ${Z.length} validation issue(s)`),{bindings:X,warnings:Z}}catch{return X=e,Z=[],{bindings:X,warnings:Z}}}async function sn(){if(mn||hn)return;if(!q()){p(`[keybindings] Skipping file watcher - user customization disabled`);return}let e=J(),t=de(e);try{if(!(await we(t)).isDirectory()){p(`[keybindings] Not watching: ${t} is not a directory`);return}}catch{p(`[keybindings] Not watching: ${t} does not exist`);return}mn=!0,p(`[keybindings] Watching for changes to ${e}`),Y=xt.watch(e,{persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:fn,pollInterval:pn},ignorePermissionErrors:!0,usePolling:!1,atomic:!0}),Y.on(`add`,ln),Y.on(`change`,ln),Y.on(`unlink`,un),ie(async()=>cn())}function cn(){hn=!0,Y&&(Y.close(),Y=null),Q.clear()}async function ln(e){p(`[keybindings] Detected change to ${e}`);try{let e=await rn();X=e.bindings,Z=e.warnings,Q.emit(e)}catch(e){p(`[keybindings] Error reloading: ${f(e)}`)}}function un(e){p(`[keybindings] Detected deletion of ${e}`);let t=nn();X=t,Z=[],Q.emit({bindings:t,warnings:[]})}function dn(){return Z}var fn,pn,Y,mn,hn,X,Z,Q,$,gn,_n=e((()=>{St(),ue(),ee(),ae(),n(),te(),d(),oe(),Mt(),Nt(),Qt(),fn=500,pn=200,Y=null,mn=!1,hn=!1,X=null,Z=[],Q=u(),$=null,gn=Q.subscribe}));function vn(e,t,n){return new Promise((r,i)=>{if(t?.aborted){n?.throwOnAbort||n?.abortError?i(n.abortError?.()??Error(`aborted`)):r();return}let a=setTimeout((e,t,n)=>{e?.removeEventListener(`abort`,t),n()},e,t,o,r);function o(){clearTimeout(a),n?.throwOnAbort||n?.abortError?i(n.abortError?.()??Error(`aborted`)):r()}t?.addEventListener(`abort`,o,{once:!0}),n?.unref&&a.unref()})}var yn=e((()=>{}));export{St as S,Mt as _,_n as a,Ot as b,an as c,Rt as d,It as f,jt as g,K as h,J as i,on as l,zt as m,vn as n,sn as o,Lt as p,dn as r,q as s,yn as t,gn as u,wt as v,xt as x,Tt as y};