@readmagic/workmate 0.0.30 → 0.0.31

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 (215) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-B03NZZuQ.js → AddWorkspaceDirectory-C07tZJZN.js} +1 -1
  2. package/dist/chunks/{AgentsMdExternalIncludesDialog-CIyefOzT.js → AgentsMdExternalIncludesDialog-6_bT7l-8.js} +1 -1
  3. package/dist/chunks/AgentsMdExternalIncludesDialog-BbSA-E68.js +1 -0
  4. package/dist/chunks/{App-WBysAL0_.js → App--Nvun0sE.js} +1 -1
  5. package/dist/chunks/{BackgroundTasksDialog-CvvrjBoq.js → BackgroundTasksDialog-DTWNv4Gc.js} +1 -1
  6. package/dist/chunks/{BypassPermissionsModeDialog-DdVbMyla.js → BypassPermissionsModeDialog-CJ6U9Vb2.js} +1 -1
  7. package/dist/chunks/{CustomSelect-iSG1rbWU.js → CustomSelect-uOjgHk8D.js} +1 -1
  8. package/dist/chunks/{DiffDialog-DSb46fzB.js → DiffDialog-CTFLCtYp.js} +1 -1
  9. package/dist/chunks/Doctor-Bd0k7Jo7.js +1 -0
  10. package/dist/chunks/{Doctor-dR71Dg_D.js → Doctor-CgZxiFf3.js} +1 -1
  11. package/dist/chunks/{ExitFlow-BiBi5Sqk.js → ExitFlow-DGqwlF8J.js} +1 -1
  12. package/dist/chunks/{InvalidConfigDialog-7MkDSXXj.js → InvalidConfigDialog-8ZJmSDBO.js} +1 -1
  13. package/dist/chunks/{InvalidSettingsDialog-D8Ves3Th.js → InvalidSettingsDialog-B7czkYPj.js} +1 -1
  14. package/dist/chunks/{KeybindingProviderSetup-DJSFdVYv.js → KeybindingProviderSetup-C8rq4fwQ.js} +1 -1
  15. package/dist/chunks/{MCPConnectionManager-BZxRMdGO.js → MCPConnectionManager-DbPzbRdc.js} +1 -1
  16. package/dist/chunks/{MCPToolListView-H_Kvvelz.js → MCPToolListView-BsO2uWCL.js} +1 -1
  17. package/dist/chunks/{McpParsingWarnings-D2xvaog9.js → McpParsingWarnings-BIpQ_Dle.js} +1 -1
  18. package/dist/chunks/{MessageSelector-DQgIgPij.js → MessageSelector-DuCpdn-Q.js} +1 -1
  19. package/dist/chunks/{Messages-DyQCr-od.js → Messages-SKlSLbVo.js} +1 -1
  20. package/dist/chunks/{Onboarding-DFufTPIY.js → Onboarding-CLEqdl35.js} +1 -1
  21. package/dist/chunks/{PromptInputFooterSuggestions-B9JRcHHE.js → PromptInputFooterSuggestions-cu1KF4_b.js} +1 -1
  22. package/dist/chunks/{PromptInputHelpMenu-DcGXK5lt.js → PromptInputHelpMenu-MH_gVGmN.js} +1 -1
  23. package/dist/chunks/{ProviderSetup-DJ_Z1BSe.js → ProviderSetup-zjQQUmDr.js} +1 -1
  24. package/dist/chunks/{QueryEngine-BQ5PSqKV.js → QueryEngine-Cb2ncWE6.js} +1 -1
  25. package/dist/chunks/REPL-CWbLkb3q.js +124 -0
  26. package/dist/chunks/REPL-D1bn80_0.js +1 -0
  27. package/dist/chunks/{ResumeConversation-exTLviBY.js → ResumeConversation-DRcIMHTE.js} +1 -1
  28. package/dist/chunks/SearchExtraToolsTool-B6Qlr08G.js +1 -0
  29. package/dist/chunks/{Settings-nM6-cXh0.js → Settings-B-EscJrZ.js} +2 -2
  30. package/dist/chunks/{Spinner-ChT4lOOg.js → Spinner-ByYcKk2V.js} +1 -1
  31. package/dist/chunks/{TextInput-CanSwT9J.js → TextInput-eYxBj_1-.js} +1 -1
  32. package/dist/chunks/{ThemePicker-CXzPiSy0.js → ThemePicker-BqeGU99Q.js} +1 -1
  33. package/dist/chunks/{TrustDialog-D0fJ-YIw.js → TrustDialog-DYZ0i7rH.js} +1 -1
  34. package/dist/chunks/{ValidationErrorsList-29bQ0l-Q.js → ValidationErrorsList-Cw-sjz1h.js} +1 -1
  35. package/dist/chunks/{_baseEach-DPcnudh_.js → _baseEach-BQ2jM5Sg.js} +1 -1
  36. package/dist/chunks/{add-dir-DbNz1SeY.js → add-dir-3q2C-Kfj.js} +1 -1
  37. package/dist/chunks/{agentDisplay-Bif3eE1e.js → agentDisplay-C18dbK7V.js} +1 -1
  38. package/dist/chunks/{agents-CbsNbPbp.js → agents--BKL-glS.js} +1 -1
  39. package/dist/chunks/{agents-yvC-VikU.js → agents-B_Ik_9lY.js} +1 -1
  40. package/dist/chunks/{allErrors-Bv1e8fra.js → allErrors-CJOE7EGx.js} +1 -1
  41. package/dist/chunks/{appleTerminalBackup-Ct9hf1QQ.js → appleTerminalBackup-j8nI5uNK.js} +1 -1
  42. package/dist/chunks/backgroundHousekeeping-COON_jRA.js +1 -0
  43. package/dist/chunks/{backgroundHousekeeping-C75FgxW1.js → backgroundHousekeeping-FPn2H48W.js} +1 -1
  44. package/dist/chunks/{banner-D5m9LUjl.js → banner-BsO6K4Ve.js} +1 -1
  45. package/dist/chunks/{branch-DOQ3yNds.js → branch-7SdIl7ZG.js} +1 -1
  46. package/dist/chunks/{btw-DUjuwyMH.js → btw-BhVWw00h.js} +1 -1
  47. package/dist/chunks/{caches-BKAPMXp9.js → caches-DaOhyHsb.js} +1 -1
  48. package/dist/chunks/caches-DgNr-KX3.js +1 -0
  49. package/dist/chunks/{channel-C8JmEI06.js → channel-BNS35qVl.js} +1 -1
  50. package/dist/chunks/{channel-TEYwDITo.js → channel-DWDK9jut.js} +1 -1
  51. package/dist/chunks/{clear-BFlTcvMt.js → clear-B5WkPxlz.js} +1 -1
  52. package/dist/chunks/commands-DJe5bkNw.js +1 -0
  53. package/dist/chunks/{compact-CyR7Sbo1.js → compact-DriVPdmX.js} +1 -1
  54. package/dist/chunks/{config-Bjwat4P6.js → config-CMtnYZR9.js} +1 -1
  55. package/dist/chunks/config-CgzzjTUe.js +1 -0
  56. package/dist/chunks/config-FEF6EcWp.js +1 -0
  57. package/dist/chunks/{context-Cm_gyngQ.js → context-CXi66Ghx.js} +1 -1
  58. package/dist/chunks/{context-noninteractive-BDmFfPRt.js → context-noninteractive-BRoUkLxt.js} +1 -1
  59. package/dist/chunks/context-noninteractive-Bupgkyt9.js +1 -0
  60. package/dist/chunks/conversation-CCV0BYD_.js +1 -0
  61. package/dist/chunks/{conversation-CYZKYlWc.js → conversation-DrEE7olO.js} +1 -1
  62. package/dist/chunks/{conversationRecovery-BUqpxLl-.js → conversationRecovery-CZzxsT_R.js} +1 -1
  63. package/dist/chunks/{crossProjectResume-BCa2l0KZ.js → crossProjectResume-CbXDWdHE.js} +1 -1
  64. package/dist/chunks/{diff-BEvpLh_b.js → diff-CH8kHqwX.js} +1 -1
  65. package/dist/chunks/doctor-HV7-zZgq.js +1 -0
  66. package/dist/chunks/{entry-JGyBs1p5.js → entry-CyH0Rkjq.js} +1 -1
  67. package/dist/chunks/{exit-DU2KGyDk.js → exit-zYpIKg68.js} +1 -1
  68. package/dist/chunks/{extraUsage-cZx2XLx4.js → extraUsage-Dp_LtcKE.js} +1 -1
  69. package/dist/chunks/extractMemories-1_fkJtc-.js +1 -0
  70. package/dist/chunks/fast-Bi-RRDlf.js +1 -0
  71. package/dist/chunks/{fast-DUJq6-QE.js → fast-DnP_x58e.js} +1 -1
  72. package/dist/chunks/{fetchModelList-Dn8OahtV.js → fetchModelList-BctZn47N.js} +1 -1
  73. package/dist/chunks/fetchModelList-Dfyy0Yds.js +1 -0
  74. package/dist/chunks/{fileSuggestions-XLnnVLwx.js → fileSuggestions-CoYWpIJB.js} +1 -1
  75. package/dist/chunks/{gemini-qzPNGqOX.js → gemini-CyZAw1Wg.js} +1 -1
  76. package/dist/chunks/{generateSessionName-CA-cc58H.js → generateSessionName-CJ13ZLWG.js} +1 -1
  77. package/dist/chunks/{goal-x9Pkx5nv.js → goal-CiuF90SO.js} +1 -1
  78. package/dist/chunks/{grok-36CpLjsq.js → grok-B4R78Wy4.js} +1 -1
  79. package/dist/chunks/{help-DwfAEV0X.js → help-CQ8yZg8_.js} +1 -1
  80. package/dist/chunks/hooks-Cj3t3ItG.js +1 -0
  81. package/dist/chunks/{hooks-DBmA-DWx.js → hooks-DgsxCW0L.js} +1 -1
  82. package/dist/chunks/{install-DF4ep6nb.js → install-W_2JVR8Y.js} +1 -1
  83. package/dist/chunks/{instrumentation-BAbhrE3f.js → instrumentation-Yk5dlvD_.js} +3 -3
  84. package/dist/chunks/{job-CFWKIjNl.js → job-CAbdQPkT.js} +1 -1
  85. package/dist/chunks/{launchLocalMemory-Cf8l-1fz.js → launchLocalMemory-C-KuYLDQ.js} +1 -1
  86. package/dist/chunks/{launchOnboarding-8CDef-v1.js → launchOnboarding-2-AEYja0.js} +1 -1
  87. package/dist/chunks/{loadAgentsDir-DnHL_5cU.js → loadAgentsDir-CgDTTnMX.js} +468 -468
  88. package/dist/chunks/loadAgentsDir-jBY44wEO.js +1 -0
  89. package/dist/chunks/{loadPluginHooks-BuunKr9m.js → loadPluginHooks-CWkivYx4.js} +1 -1
  90. package/dist/chunks/localSearch-B3aRqi3q.js +1 -0
  91. package/dist/chunks/{localSearch-LFCzV7VE.js → localSearch-BhygSl0K.js} +1 -1
  92. package/dist/chunks/{logoUtils-B8MIA7c5.js → logoUtils-rZbHAggC.js} +1 -1
  93. package/dist/chunks/{magicDocs-BoxJusTI.js → magicDocs-430IH4o3.js} +1 -1
  94. package/dist/chunks/{main-B9ciFYnO.js → main-DuS6HbbE.js} +6 -6
  95. package/dist/chunks/managedEnv-BV6T_PdC.js +1 -0
  96. package/dist/chunks/{managedEnv-B0mj-wgE.js → managedEnv-O3Xqe_lk.js} +1 -1
  97. package/dist/chunks/{mcp-CHlAZvpV.js → mcp-BoJ9rdef.js} +1 -1
  98. package/dist/chunks/{mcp-DVKuOqvY.js → mcp-C2GF6Gp7.js} +1 -1
  99. package/dist/chunks/{mcp-B3Ewo-_h.js → mcp-XaHs-eh9.js} +1 -1
  100. package/dist/chunks/{memory-Cr0d-s7U.js → memory-D0vG6luI.js} +1 -1
  101. package/dist/chunks/{mode-DBNBDbVP.js → mode-4ZXGLC71.js} +1 -1
  102. package/dist/chunks/{model-C9ANf1-R.js → model-BidsdFhX.js} +1 -1
  103. package/dist/chunks/{model-B2r1Ms0g.js → model-CcgVXT3w.js} +1 -1
  104. package/dist/chunks/{modelOptions-B4BWYms0.js → modelOptions-Bw53Jebp.js} +1 -1
  105. package/dist/chunks/{nativeInstaller-BDJxBAPV.js → nativeInstaller-BczAzL96.js} +1 -1
  106. package/dist/chunks/{notifications-BV-VeXyJ.js → notifications-B3v1XAdd.js} +1 -1
  107. package/dist/chunks/{onChangeAppState-BGWWkhBg.js → onChangeAppState-wASLrUas.js} +1 -1
  108. package/dist/chunks/{openai-BL_IWBTr.js → openai-CvSNI6b2.js} +1 -1
  109. package/dist/chunks/{overlayContext-DGUFuee9.js → overlayContext-0wuZMXWl.js} +1 -1
  110. package/dist/chunks/{partition-B2VCm4vu.js → partition-CGKLltyv.js} +1 -1
  111. package/dist/chunks/{permissions-Bkj1UB1h.js → permissions-DawwDdur.js} +1 -1
  112. package/dist/chunks/{pidLock-CawSx6hb.js → pidLock-TOlSC34M.js} +2 -2
  113. package/dist/chunks/{plan-D7Ki5ADu.js → plan-D_vIEUQa.js} +1 -1
  114. package/dist/chunks/{plugin-D7I6VZjh.js → plugin-CDWB3AFL.js} +1 -1
  115. package/dist/chunks/{pluginAutoupdate-Cr3jw-ky.js → pluginAutoupdate-CPzXHVsX.js} +1 -1
  116. package/dist/chunks/{pluginBlocklist-JG_kJSSK.js → pluginBlocklist-Bu6GP9_C.js} +1 -1
  117. package/dist/chunks/{pluginCliCommands-BWIBBFJf.js → pluginCliCommands-CNpseXZD.js} +1 -1
  118. package/dist/chunks/{pluginFlagging-yFcXMVin.js → pluginFlagging-1MM3zuMP.js} +1 -1
  119. package/dist/chunks/{pluginOperations-6QXjdPOb.js → pluginOperations-qT-GGKNu.js} +1 -1
  120. package/dist/chunks/pluginStartupCheck-CCDpCchC.js +1 -0
  121. package/dist/chunks/{pluginStartupCheck-CkjyJ4RS.js → pluginStartupCheck-DXPIrR7f.js} +1 -1
  122. package/dist/chunks/{plugins-CMDfjFp-.js → plugins-Bbbvm9KH.js} +1 -1
  123. package/dist/chunks/{print-B6x_8O9w.js → print-Db7IDW_T.js} +2 -2
  124. package/dist/chunks/{processBashCommand-D0BBcBHY.js → processBashCommand-DtEP1Js2.js} +1 -1
  125. package/dist/chunks/{processSlashCommand-BvjNuNyP.js → processSlashCommand-BIIOr3n4.js} +1 -1
  126. package/dist/chunks/{projectOnboardingState-ofkjp9FJ.js → projectOnboardingState-DqGLXSM_.js} +1 -1
  127. package/dist/chunks/prompt-CCP82QoX.js +1 -0
  128. package/dist/chunks/{prompt-DDlkyIzV.js → prompt-CduUPV0s.js} +1 -1
  129. package/dist/chunks/prompt-DmWyLDH6.js +1 -0
  130. package/dist/chunks/{protocolHandler-Bjmx7OmF.js → protocolHandler-DrGjosKa.js} +1 -1
  131. package/dist/chunks/{reconciler-CHbint0C.js → reconciler-DQxjz0OK.js} +1 -1
  132. package/dist/chunks/{refresh-yut9uEfd.js → refresh-BmkkYKno.js} +1 -1
  133. package/dist/chunks/{reject-CrNfit3M.js → reject-DYsU8jkO.js} +1 -1
  134. package/dist/chunks/{reload-plugins-labKy5Eh.js → reload-plugins-CmHAxvlA.js} +1 -1
  135. package/dist/chunks/{rename-c8tElppw.js → rename-BrGuvkvC.js} +1 -1
  136. package/dist/chunks/{resume-C8xif2lo.js → resume-COSo0ATp.js} +1 -1
  137. package/dist/chunks/{runtimeObserver-vmPplAGH.js → runtimeObserver-CoNTwrJ3.js} +1 -1
  138. package/dist/chunks/{runtimeObserver-DuJ8mRfr.js → runtimeObserver-Dpi40Nfi.js} +2 -2
  139. package/dist/chunks/sandbox-adapter-D0bQ6nsv.js +1 -0
  140. package/dist/chunks/{sandbox-toggle-USHaZHD7.js → sandbox-toggle-CrjErH9V.js} +1 -1
  141. package/dist/chunks/searchExtraTools-_Fo0KDnz.js +1 -0
  142. package/dist/chunks/{select-BpiKdirZ.js → select-BNeFiLNP.js} +1 -1
  143. package/dist/chunks/sessionFileAccessHooks-BCBV26Ut.js +1 -0
  144. package/dist/chunks/{sessionObserver-sO6PF7mV.js → sessionObserver-CAvR0MCN.js} +1 -1
  145. package/dist/chunks/sessionObserver-QbHl_0Dr.js +1 -0
  146. package/dist/chunks/sessionStorage-CscAodvT.js +1 -0
  147. package/dist/chunks/{sessionTracing-Bz89tYh5.js → sessionTracing-rMBtalMz.js} +1 -1
  148. package/dist/chunks/{setup-B-FejaeH.js → setup-X5QOX_BW.js} +2 -2
  149. package/dist/chunks/{shadowedRuleDetection-BI6Xz0pY.js → shadowedRuleDetection-BucAPuXp.js} +1 -1
  150. package/dist/chunks/{sideQuestion-BEpCuv_7.js → sideQuestion-B1W_L7NR.js} +1 -1
  151. package/dist/chunks/{sinks-BvOPODnl.js → sinks-Bqzavjot.js} +1 -1
  152. package/dist/chunks/sinks-ofVW99nt.js +1 -0
  153. package/dist/chunks/{skillChangeDetector-D-fxaAMH.js → skillChangeDetector-jKxXTp4F.js} +1 -1
  154. package/dist/chunks/{skillGapStore-A1FCr8Mf.js → skillGapStore-CQVCxlWd.js} +2 -2
  155. package/dist/chunks/{skillLifecycle-CTVa34xO.js → skillLifecycle-GGpX7H8W.js} +2 -2
  156. package/dist/chunks/{skillSearchPanel-CjekGkrw.js → skillSearchPanel-DDM0zZ_r.js} +2 -2
  157. package/dist/chunks/{skills-110JHHbj.js → skills-Bmdrtecu.js} +1 -1
  158. package/dist/chunks/status-CFpCBQX1.js +1 -0
  159. package/dist/chunks/{statusNoticeHelpers-C5BRU3lw.js → statusNoticeHelpers-DRJcaVdx.js} +1 -1
  160. package/dist/chunks/switcher-BCr3vwnq.js +1 -0
  161. package/dist/chunks/{switcher-nLHGsxLw.js → switcher-CqGz0hjQ.js} +1 -1
  162. package/dist/chunks/{tasks-CjYr59Ak.js → tasks-CNQUkXoq.js} +1 -1
  163. package/dist/chunks/{templateJobs-ECX0rRRp.js → templateJobs-CYArZLti.js} +1 -1
  164. package/dist/chunks/{terminalSetup-AptBNs_i.js → terminalSetup-QvvwfSGV.js} +1 -1
  165. package/dist/chunks/{terminalSetup-CKO6eWhS.js → terminalSetup-h_TPZN2E.js} +1 -1
  166. package/dist/chunks/{theme-BCSx9irC.js → theme-DVkXXIPx.js} +1 -1
  167. package/dist/chunks/{tipRegistry-CnQB3TaA.js → tipRegistry-DzOyYhJT.js} +1 -1
  168. package/dist/chunks/{toolEventObserver-Bqtypnkk.js → toolEventObserver-BAkhiG0F.js} +1 -1
  169. package/dist/chunks/{toolPool-B1sXN7SK.js → toolPool-D_7Onp-c.js} +1 -1
  170. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-DegJrysj.js → useExitOnCtrlCDWithKeybindings-z3RiW9jT.js} +1 -1
  171. package/dist/chunks/useMainLoopModel-DMB41HoQ.js +1 -0
  172. package/dist/chunks/{useManagePlugins-BW2Zj_jf.js → useManagePlugins-DSRLHKH5.js} +1 -1
  173. package/dist/chunks/{useMergedTools-CTm1AU9b.js → useMergedTools-C7wh5W03.js} +1 -1
  174. package/dist/chunks/{useSearchInput-DrY4BZKy.js → useSearchInput-r534PKo1.js} +1 -1
  175. package/dist/chunks/{useSettingsErrors-2uIAF6H8.js → useSettingsErrors-DL_ai-el.js} +1 -1
  176. package/dist/chunks/{util-BUgUtaUV.js → util-DombpJHQ.js} +1 -1
  177. package/dist/chunks/{validatePlugin-BGB8T9Mb.js → validatePlugin-DU3C7Mvb.js} +1 -1
  178. package/dist/chunks/vim-BX8ljWbJ.js +1 -0
  179. package/dist/chunks/worktree-CjnMMjR6.js +1 -0
  180. package/dist/cli.js +1 -1
  181. package/package.json +1 -1
  182. package/dist/chunks/AgentsMdExternalIncludesDialog-45Ize2zR.js +0 -1
  183. package/dist/chunks/Doctor--yF3SBsD.js +0 -1
  184. package/dist/chunks/REPL-CjoJCy0g.js +0 -124
  185. package/dist/chunks/REPL-DGieTVDl.js +0 -1
  186. package/dist/chunks/SearchExtraToolsTool-BBhWAuoA.js +0 -1
  187. package/dist/chunks/backgroundHousekeeping-d0qpqWHe.js +0 -1
  188. package/dist/chunks/caches-he4NeZSK.js +0 -1
  189. package/dist/chunks/commands-BoGtXPAA.js +0 -1
  190. package/dist/chunks/config-B-hDBSL8.js +0 -1
  191. package/dist/chunks/config-DubkVeOw.js +0 -1
  192. package/dist/chunks/context-noninteractive-CmOFpwwP.js +0 -1
  193. package/dist/chunks/conversation-B7YCvyCD.js +0 -1
  194. package/dist/chunks/doctor-DYKr9Reu.js +0 -1
  195. package/dist/chunks/extractMemories-4wbv-mTc.js +0 -1
  196. package/dist/chunks/fast-BALHWqpd.js +0 -1
  197. package/dist/chunks/fetchModelList-OZ2sLDEx.js +0 -1
  198. package/dist/chunks/hooks-BofA8GeO.js +0 -1
  199. package/dist/chunks/loadAgentsDir-C-qRJlXH.js +0 -1
  200. package/dist/chunks/localSearch-BulDBrBk.js +0 -1
  201. package/dist/chunks/managedEnv-BFpXdDI8.js +0 -1
  202. package/dist/chunks/pluginStartupCheck-B-nYb61N.js +0 -1
  203. package/dist/chunks/prompt-Cpu4meqR.js +0 -1
  204. package/dist/chunks/prompt-HO8Docca.js +0 -1
  205. package/dist/chunks/sandbox-adapter-BKnsdtVj.js +0 -1
  206. package/dist/chunks/searchExtraTools-DV5iZPdw.js +0 -1
  207. package/dist/chunks/sessionFileAccessHooks-nq8C34WL.js +0 -1
  208. package/dist/chunks/sessionObserver-CKp3uqPg.js +0 -1
  209. package/dist/chunks/sessionStorage-CuQf4d1y.js +0 -1
  210. package/dist/chunks/sinks-DLALCllz.js +0 -1
  211. package/dist/chunks/status-D_b3UMke.js +0 -1
  212. package/dist/chunks/switcher-BFzvv7KT.js +0 -1
  213. package/dist/chunks/useMainLoopModel-CPnigpM1.js +0 -1
  214. package/dist/chunks/vim-DdxGarvY.js +0 -1
  215. package/dist/chunks/worktree-DBZ7f9Lk.js +0 -1
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{D as n,Gt as r,I as i,P as a,T as o,ai as s,t as c,x as l}from"./src-BX54x08P.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{FC as d,Hh as f,MC as p,NC as m,PC as h,TC as g,Vh as _,_d as v,gd as y,rb as b}from"./loadAgentsDir-DnHL_5cU.js";import{at as x,f as S,g as C,it as w}from"./model-C9ANf1-R.js";import{n as T,t as E}from"./useExitOnCtrlCDWithKeybindings-DegJrysj.js";import{t as D}from"./select-BpiKdirZ.js";import{n as O,r as k,t as A}from"./modelOptions-B4BWYms0.js";import{t as j}from"./CustomSelect-iSG1rbWU.js";import{n as M,t as N}from"./fetchModelList-Dn8OahtV.js";function P({initial:e,sessionModel:t,onSelect:s,onCancel:c,isStandaloneCommand:u,showFastModeNotice:p,headerText:_}){let v=T(),b=e===null?L:e,[x,S]=(0,F.useState)(b),E=f(e=>d()?e.fastMode:!1),[k,j]=(0,F.useState)(()=>new Set(w(b)?[b.replace(/\[1m\]/i,``)]:[])),M=(0,F.useCallback)(()=>{if(!x||x===L)return;let e=x.replace(/\[1m\]/i,``);j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[x]),P=(0,F.useMemo)(()=>O(E??!1),[E]),[R,z]=(0,F.useState)(null),[B,V]=(0,F.useState)(!1);(0,F.useEffect)(()=>{let e=!1;return V(!1),N().then(t=>{if(!e){if(!t||t.length===0){z(null),V(!0);return}z(t)}}).catch(()=>{e||V(!0)}),()=>{e=!0}},[]);let H=(0,F.useMemo)(()=>R?A(R,E??!1):null,[R,E]),U=R===null&&!B,W=(0,F.useMemo)(()=>{let t=H??P;return e!==null&&!t.some(t=>t.value===e)?[...t,{value:e,label:C(e),description:`Current model`}]:t},[H,P,e]),G=(0,F.useMemo)(()=>W.map(e=>({...e,value:e.value===null?L:e.value})),[W]),K=(0,F.useMemo)(()=>G.some(e=>e.value===b)?b:G[0]?.value??void 0,[G,b]),q=Math.min(10,G.length),J=Math.max(0,G.length-q),Y=G.find(e=>e.value===x)?.label,X=x!==void 0&&x!==L&&k.has(x.replace(/\[1m\]/i,``)),Z=(0,F.useCallback)(e=>{S(e)},[]);r({"modelPicker:toggle1M":()=>M()},{context:`ModelPicker`});function Q(e){if(e===L){s(null);return}let t=e.replace(/\[1m\]/i,``);s(k.has(t)?`${t}[1m]`:t)}let $=(0,I.jsxs)(i,{flexDirection:`column`,children:[(0,I.jsxs)(i,{flexDirection:`column`,children:[(0,I.jsxs)(i,{marginBottom:1,flexDirection:`column`,children:[(0,I.jsx)(a,{color:`remember`,bold:!0,children:`Select model`}),(0,I.jsx)(a,{dimColor:!0,children:_??`Choose a model for this and future sessions. Use Space to toggle 1M context.`}),t&&(0,I.jsxs)(a,{dimColor:!0,children:[`Currently using `,C(t),` for this session (set by plan mode). Selecting a model will undo this.`]})]}),(0,I.jsxs)(i,{flexDirection:`column`,marginBottom:1,children:[(0,I.jsx)(i,{flexDirection:`column`,children:(0,I.jsx)(D,{defaultValue:b,defaultFocusValue:K,options:G,onChange:Q,onFocus:Z,onCancel:c??(()=>{}),visibleOptionCount:q})}),J>0&&(0,I.jsx)(i,{paddingLeft:3,children:(0,I.jsxs)(a,{dimColor:!0,children:[`and `,J,` more…`]})}),U&&(0,I.jsx)(i,{paddingLeft:3,children:(0,I.jsx)(a,{dimColor:!0,children:`正在从 API 拉取可用模型列表…`})}),B&&R===null&&(0,I.jsx)(i,{paddingLeft:3,children:(0,I.jsx)(a,{dimColor:!0,children:`API 拉取失败,使用内置列表`})})]}),(0,I.jsx)(i,{marginBottom:1,flexDirection:`column`,children:X?(0,I.jsxs)(a,{dimColor:!0,children:[`1M context on`,(0,I.jsx)(a,{color:`subtle`,children:` · Space to toggle`})]}):(0,I.jsxs)(a,{color:`subtle`,children:[`1M context off`,Y?` for ${Y}`:``,(0,I.jsx)(a,{color:`subtle`,children:` · Space to toggle`})]})}),d()?p?(0,I.jsx)(i,{marginBottom:1,children:(0,I.jsxs)(a,{dimColor:!0,children:[`Fast mode is `,(0,I.jsx)(a,{bold:!0,children:`ON`}),` and available with `,g,` only (/fast). Switching to other models turn off fast mode.`]})}):m()&&!h()?(0,I.jsx)(i,{marginBottom:1,children:(0,I.jsxs)(a,{dimColor:!0,children:[`Use `,(0,I.jsx)(a,{bold:!0,children:`/fast`}),` to turn on Fast mode (`,g,` only).`]})}):null:null]}),u&&(0,I.jsx)(a,{dimColor:!0,italic:!0,children:v.pending?(0,I.jsxs)(I.Fragment,{children:[`Press `,v.keyName,` again to exit`]}):(0,I.jsxs)(o,{children:[(0,I.jsx)(n,{shortcut:`Enter`,action:`confirm`}),(0,I.jsx)(y,{action:`select:cancel`,context:`Select`,fallback:`Esc`,description:`exit`})]})})]});return u?(0,I.jsx)(l,{color:`permission`,children:$}):$}var F,I,L,R=e((()=>{F=t(s(),1),x(),E(),p(),c(),b(),_(),S(),k(),M(),v(),j(),I=u(),L=`__NO_PREFERENCE__`}));function z(e,t,n){return!1}var B=e((()=>{}));export{R as i,z as n,P as r,B as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{D as n,Gt as r,I as i,P as a,T as o,ai as s,t as c,x as l}from"./src-BX54x08P.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{FC as d,Hh as f,MC as p,NC as m,PC as h,TC as g,Vh as _,_d as v,gd as y,rb as b}from"./loadAgentsDir-CgDTTnMX.js";import{at as x,f as S,g as C,it as w}from"./model-BidsdFhX.js";import{n as T,t as E}from"./useExitOnCtrlCDWithKeybindings-z3RiW9jT.js";import{t as D}from"./select-BNeFiLNP.js";import{n as O,r as k,t as A}from"./modelOptions-Bw53Jebp.js";import{t as j}from"./CustomSelect-uOjgHk8D.js";import{n as M,t as N}from"./fetchModelList-BctZn47N.js";function P({initial:e,sessionModel:t,onSelect:s,onCancel:c,isStandaloneCommand:u,showFastModeNotice:p,headerText:_}){let v=T(),b=e===null?L:e,[x,S]=(0,F.useState)(b),E=f(e=>d()?e.fastMode:!1),[k,j]=(0,F.useState)(()=>new Set(w(b)?[b.replace(/\[1m\]/i,``)]:[])),M=(0,F.useCallback)(()=>{if(!x||x===L)return;let e=x.replace(/\[1m\]/i,``);j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[x]),P=(0,F.useMemo)(()=>O(E??!1),[E]),[R,z]=(0,F.useState)(null),[B,V]=(0,F.useState)(!1);(0,F.useEffect)(()=>{let e=!1;return V(!1),N().then(t=>{if(!e){if(!t||t.length===0){z(null),V(!0);return}z(t)}}).catch(()=>{e||V(!0)}),()=>{e=!0}},[]);let H=(0,F.useMemo)(()=>R?A(R,E??!1):null,[R,E]),U=R===null&&!B,W=(0,F.useMemo)(()=>{let t=H??P;return e!==null&&!t.some(t=>t.value===e)?[...t,{value:e,label:C(e),description:`Current model`}]:t},[H,P,e]),G=(0,F.useMemo)(()=>W.map(e=>({...e,value:e.value===null?L:e.value})),[W]),K=(0,F.useMemo)(()=>G.some(e=>e.value===b)?b:G[0]?.value??void 0,[G,b]),q=Math.min(10,G.length),J=Math.max(0,G.length-q),Y=G.find(e=>e.value===x)?.label,X=x!==void 0&&x!==L&&k.has(x.replace(/\[1m\]/i,``)),Z=(0,F.useCallback)(e=>{S(e)},[]);r({"modelPicker:toggle1M":()=>M()},{context:`ModelPicker`});function Q(e){if(e===L){s(null);return}let t=e.replace(/\[1m\]/i,``);s(k.has(t)?`${t}[1m]`:t)}let $=(0,I.jsxs)(i,{flexDirection:`column`,children:[(0,I.jsxs)(i,{flexDirection:`column`,children:[(0,I.jsxs)(i,{marginBottom:1,flexDirection:`column`,children:[(0,I.jsx)(a,{color:`remember`,bold:!0,children:`Select model`}),(0,I.jsx)(a,{dimColor:!0,children:_??`Choose a model for this and future sessions. Use Space to toggle 1M context.`}),t&&(0,I.jsxs)(a,{dimColor:!0,children:[`Currently using `,C(t),` for this session (set by plan mode). Selecting a model will undo this.`]})]}),(0,I.jsxs)(i,{flexDirection:`column`,marginBottom:1,children:[(0,I.jsx)(i,{flexDirection:`column`,children:(0,I.jsx)(D,{defaultValue:b,defaultFocusValue:K,options:G,onChange:Q,onFocus:Z,onCancel:c??(()=>{}),visibleOptionCount:q})}),J>0&&(0,I.jsx)(i,{paddingLeft:3,children:(0,I.jsxs)(a,{dimColor:!0,children:[`and `,J,` more…`]})}),U&&(0,I.jsx)(i,{paddingLeft:3,children:(0,I.jsx)(a,{dimColor:!0,children:`正在从 API 拉取可用模型列表…`})}),B&&R===null&&(0,I.jsx)(i,{paddingLeft:3,children:(0,I.jsx)(a,{dimColor:!0,children:`API 拉取失败,使用内置列表`})})]}),(0,I.jsx)(i,{marginBottom:1,flexDirection:`column`,children:X?(0,I.jsxs)(a,{dimColor:!0,children:[`1M context on`,(0,I.jsx)(a,{color:`subtle`,children:` · Space to toggle`})]}):(0,I.jsxs)(a,{color:`subtle`,children:[`1M context off`,Y?` for ${Y}`:``,(0,I.jsx)(a,{color:`subtle`,children:` · Space to toggle`})]})}),d()?p?(0,I.jsx)(i,{marginBottom:1,children:(0,I.jsxs)(a,{dimColor:!0,children:[`Fast mode is `,(0,I.jsx)(a,{bold:!0,children:`ON`}),` and available with `,g,` only (/fast). Switching to other models turn off fast mode.`]})}):m()&&!h()?(0,I.jsx)(i,{marginBottom:1,children:(0,I.jsxs)(a,{dimColor:!0,children:[`Use `,(0,I.jsx)(a,{bold:!0,children:`/fast`}),` to turn on Fast mode (`,g,` only).`]})}):null:null]}),u&&(0,I.jsx)(a,{dimColor:!0,italic:!0,children:v.pending?(0,I.jsxs)(I.Fragment,{children:[`Press `,v.keyName,` again to exit`]}):(0,I.jsxs)(o,{children:[(0,I.jsx)(n,{shortcut:`Enter`,action:`confirm`}),(0,I.jsx)(y,{action:`select:cancel`,context:`Select`,fallback:`Esc`,description:`exit`})]})})]});return u?(0,I.jsx)(l,{color:`permission`,children:$}):$}var F,I,L,R=e((()=>{F=t(s(),1),x(),E(),p(),c(),b(),_(),S(),k(),M(),v(),j(),I=u(),L=`__NO_PREFERENCE__`}));function z(e,t,n){return!1}var B=e((()=>{}));export{R as i,z as n,P as r,B as t};
@@ -0,0 +1 @@
1
+ import{dc as e,fc as t,pc as n,uc as r}from"./loadAgentsDir-CgDTTnMX.js";n();export{r as drainPendingExtraction,e as executeExtractMemories,t as initExtractMemories};
@@ -0,0 +1 @@
1
+ import{n as e,r as t,t as n}from"./fast-DnP_x58e.js";t();export{n as FastModePicker,e as call};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as n,I as r,Lt as i,P as a,ai as o,di as s,fi as c,j as l,t as u,y as d}from"./src-BX54x08P.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{Gt as p,m,y as h}from"./settings-CA-5Px85.js";import{AC as g,DC as _,EC as v,FC as y,Hh as b,IC as x,MC as S,OC as C,TC as w,VC as T,Vh as E,Wh as D,by as O,rb as k,vy as A,yy as j}from"./loadAgentsDir-DnHL_5cU.js";import{d as M,o as N}from"./config-Bjwat4P6.js";import{n as P}from"./analytics-COpjZpvd.js";import{_ as F,l as I}from"./startupProfiler-C_xcIvEA.js";import{n as L,t as R}from"./systemTheme-Ceakddth.js";function z({cooldown:e}){return e?(0,V.jsx)(a,{color:`promptBorder`,dimColor:!0,children:`↯`}):(0,V.jsx)(a,{color:`fastMode`,children:`↯`})}function B(e=!0,t=!1){if(!e)return`↯`;let n=L(N().theme);return t?s.dim(l(`promptBorder`,n)(`↯`)):l(`fastMode`,n)(`↯`)}var V,H=e((()=>{c(),p(),u(),M(),R(),V=f()}));function U(e,t){v(),h(`userSettings`,{fastMode:e?!0:void 0}),t(e?e=>{let t=!x(e.mainLoopModel);return{...e,...t?{mainLoopModel:_(),mainLoopModelForSession:null}:{},fastMode:!0}}:e=>({...e,fastMode:!1}))}function W({onDone:e,unavailableReason:t}){let o=b(e=>e.mainLoopModel),s=b(e=>e.fastMode),c=D(),[l,u]=(0,q.useState)(s??!1),f=C(),p=f.status===`cooldown`,m=t!==null,h=A(j(!0));function g(){m||(U(l,c),l?e(`${B(l)} Fast mode ON${x(o)?``:` · model set to ${w}`} · ${h}`):(c(e=>({...e,fastMode:!1})),e(`Fast mode OFF`)))}function _(){if(m){s&&U(!1,c),e(`Fast mode OFF`,{display:`system`});return}e(s?`${B()} Kept Fast mode ON`:`Kept Fast mode OFF`,{display:`system`})}function v(){m||u(e=>!e)}return n({"confirm:yes":g,"confirm:nextField":v,"confirm:next":v,"confirm:previous":v,"confirm:cycleMode":v,"confirm:toggle":v},{context:`Confirmation`}),(0,J.jsxs)(d,{title:(0,J.jsxs)(a,{children:[(0,J.jsx)(z,{cooldown:p}),` Fast mode (research preview)`]}),subtitle:`High-speed mode for ${w}. Billed as extra usage at a premium rate. Separate rate limits apply.`,onCancel:_,color:`fastMode`,inputGuide:e=>e.pending?(0,J.jsxs)(a,{children:[`Press `,e.keyName,` again to exit`]}):m?(0,J.jsx)(a,{children:`Esc to cancel`}):(0,J.jsx)(a,{children:`Tab to toggle · Enter to confirm · Esc to cancel`}),children:[t?(0,J.jsx)(r,{marginLeft:2,children:(0,J.jsx)(a,{color:`error`,children:t})}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(r,{flexDirection:`column`,gap:0,marginLeft:2,children:(0,J.jsxs)(r,{flexDirection:`row`,gap:2,children:[(0,J.jsx)(a,{bold:!0,children:`Fast mode`}),(0,J.jsx)(a,{color:l?`fastMode`:void 0,bold:l,children:l?`ON `:`OFF`}),(0,J.jsx)(a,{dimColor:!0,children:h})]})}),p&&f.status===`cooldown`&&(0,J.jsx)(r,{marginLeft:2,children:(0,J.jsxs)(a,{color:`warning`,children:[f.reason===`overloaded`?`Fast mode overloaded and is temporarily unavailable`:`You've hit your fast limit`,` · resets in `,I(f.resetAt-Date.now(),{hideTrailingZeros:!0})]})})]}),(0,J.jsxs)(a,{dimColor:!0,children:[`Learn more:`,` `,(0,J.jsx)(i,{url:`https://code.workmate.com/docs/en/fast-mode`,children:`https://code.workmate.com/docs/en/fast-mode`})]})]})}async function G(e,t,n){let r=g();if(r)return`Fast mode unavailable: ${r}`;let{mainLoopModel:i}=t();return U(e,n),e?`${B(!0)} Fast mode ON${x(i)?``:` · model set to ${w}`} · ${A(j(!0))}`:`Fast mode OFF`}async function K(e,t,n){if(!y())return null;await T();let r=n?.trim().toLowerCase();if(r===`on`||r===`off`)return e(await G(r===`on`,t.getAppState,t.setAppState)),null;let i=g();return(0,J.jsx)(W,{onDone:e,unavailableReason:i})}var q,J,Y=e((()=>{q=t(o(),1),u(),H(),k(),P(),E(),S(),F(),O(),m(),J=f()}));export{H as a,B as i,K as n,Y as r,W as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as n,I as r,Lt as i,P as a,ai as o,di as s,fi as c,j as l,t as u,y as d}from"./src-BX54x08P.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{Gt as p,m,y as h}from"./settings-CA-5Px85.js";import{AC as g,DC as _,EC as v,FC as y,Hh as b,IC as x,MC as S,OC as C,TC as w,VC as T,Vh as E,Wh as D,by as O,rb as k,vy as A,yy as j}from"./loadAgentsDir-CgDTTnMX.js";import{d as M,o as N}from"./config-CMtnYZR9.js";import{n as P}from"./analytics-COpjZpvd.js";import{_ as F,l as I}from"./startupProfiler-C_xcIvEA.js";import{n as L,t as R}from"./systemTheme-Ceakddth.js";function z({cooldown:e}){return e?(0,V.jsx)(a,{color:`promptBorder`,dimColor:!0,children:`↯`}):(0,V.jsx)(a,{color:`fastMode`,children:`↯`})}function B(e=!0,t=!1){if(!e)return`↯`;let n=L(N().theme);return t?s.dim(l(`promptBorder`,n)(`↯`)):l(`fastMode`,n)(`↯`)}var V,H=e((()=>{c(),p(),u(),M(),R(),V=f()}));function U(e,t){v(),h(`userSettings`,{fastMode:e?!0:void 0}),t(e?e=>{let t=!x(e.mainLoopModel);return{...e,...t?{mainLoopModel:_(),mainLoopModelForSession:null}:{},fastMode:!0}}:e=>({...e,fastMode:!1}))}function W({onDone:e,unavailableReason:t}){let o=b(e=>e.mainLoopModel),s=b(e=>e.fastMode),c=D(),[l,u]=(0,q.useState)(s??!1),f=C(),p=f.status===`cooldown`,m=t!==null,h=A(j(!0));function g(){m||(U(l,c),l?e(`${B(l)} Fast mode ON${x(o)?``:` · model set to ${w}`} · ${h}`):(c(e=>({...e,fastMode:!1})),e(`Fast mode OFF`)))}function _(){if(m){s&&U(!1,c),e(`Fast mode OFF`,{display:`system`});return}e(s?`${B()} Kept Fast mode ON`:`Kept Fast mode OFF`,{display:`system`})}function v(){m||u(e=>!e)}return n({"confirm:yes":g,"confirm:nextField":v,"confirm:next":v,"confirm:previous":v,"confirm:cycleMode":v,"confirm:toggle":v},{context:`Confirmation`}),(0,J.jsxs)(d,{title:(0,J.jsxs)(a,{children:[(0,J.jsx)(z,{cooldown:p}),` Fast mode (research preview)`]}),subtitle:`High-speed mode for ${w}. Billed as extra usage at a premium rate. Separate rate limits apply.`,onCancel:_,color:`fastMode`,inputGuide:e=>e.pending?(0,J.jsxs)(a,{children:[`Press `,e.keyName,` again to exit`]}):m?(0,J.jsx)(a,{children:`Esc to cancel`}):(0,J.jsx)(a,{children:`Tab to toggle · Enter to confirm · Esc to cancel`}),children:[t?(0,J.jsx)(r,{marginLeft:2,children:(0,J.jsx)(a,{color:`error`,children:t})}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(r,{flexDirection:`column`,gap:0,marginLeft:2,children:(0,J.jsxs)(r,{flexDirection:`row`,gap:2,children:[(0,J.jsx)(a,{bold:!0,children:`Fast mode`}),(0,J.jsx)(a,{color:l?`fastMode`:void 0,bold:l,children:l?`ON `:`OFF`}),(0,J.jsx)(a,{dimColor:!0,children:h})]})}),p&&f.status===`cooldown`&&(0,J.jsx)(r,{marginLeft:2,children:(0,J.jsxs)(a,{color:`warning`,children:[f.reason===`overloaded`?`Fast mode overloaded and is temporarily unavailable`:`You've hit your fast limit`,` · resets in `,I(f.resetAt-Date.now(),{hideTrailingZeros:!0})]})})]}),(0,J.jsxs)(a,{dimColor:!0,children:[`Learn more:`,` `,(0,J.jsx)(i,{url:`https://code.workmate.com/docs/en/fast-mode`,children:`https://code.workmate.com/docs/en/fast-mode`})]})]})}async function G(e,t,n){let r=g();if(r)return`Fast mode unavailable: ${r}`;let{mainLoopModel:i}=t();return U(e,n),e?`${B(!0)} Fast mode ON${x(i)?``:` · model set to ${w}`} · ${A(j(!0))}`:`Fast mode OFF`}async function K(e,t,n){if(!y())return null;await T();let r=n?.trim().toLowerCase();if(r===`on`||r===`off`)return e(await G(r===`on`,t.getAppState,t.setAppState)),null;let i=g();return(0,J.jsx)(W,{onDone:e,unavailableReason:i})}var q,J,Y=e((()=>{q=t(o(),1),u(),H(),k(),P(),E(),S(),F(),O(),m(),J=f()}));export{H as a,B as i,K as n,Y as r,W as t};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Qr as t,Xr as n}from"./settings-CA-5Px85.js";import{c as r,i}from"./debug-NBJH_NxR.js";import{Mt as a,Pt as o,W as s,dt as c,q as l,ut as u}from"./model-C9ANf1-R.js";import{n as d,r as f}from"./client-q_uGYC2E.js";async function p(){let e=a();try{switch(e){case`firstParty`:{let e=await u({maxRetries:1}),t=[];for await(let n of e.models.list())t.push({value:n.id,label:n.display_name??n.id,description:n.id});return t.length>0?t:null}case`openai`:{let e=d({maxRetries:1}),t=[];for await(let n of e.models.list())t.push({value:n.id,label:n.id,description:`via openai-compat`});return t.length>0?t:null}case`grok`:{let{getGrokClient:e}=await import(`./client-y_U1O4mI.js`),t=e({maxRetries:1}),n=[];for await(let e of t.models.list())n.push({value:e.id,label:e.id,description:`via grok`});return n.length>0?n:null}case`bedrock`:{let e=(await s()).map(e=>({value:e,label:e,description:`Bedrock inference profile`}));return e.length>0?e:null}case`gemini`:case`vertex`:case`foundry`:return null}}catch(t){return r(`[fetchModelList] ${e} failed: ${t instanceof Error?t.message:`unknown`}`),null}return null}var m,h,g=e((()=>{c(),f(),i(),n(),l(),o(),m=300*1e3,h=t(p,m)}));export{g as n,h as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Qr as t,Xr as n}from"./settings-CA-5Px85.js";import{c as r,i}from"./debug-NBJH_NxR.js";import{Mt as a,Pt as o,W as s,dt as c,q as l,ut as u}from"./model-BidsdFhX.js";import{n as d,r as f}from"./client-q_uGYC2E.js";async function p(){let e=a();try{switch(e){case`firstParty`:{let e=await u({maxRetries:1}),t=[];for await(let n of e.models.list())t.push({value:n.id,label:n.display_name??n.id,description:n.id});return t.length>0?t:null}case`openai`:{let e=d({maxRetries:1}),t=[];for await(let n of e.models.list())t.push({value:n.id,label:n.id,description:`via openai-compat`});return t.length>0?t:null}case`grok`:{let{getGrokClient:e}=await import(`./client-y_U1O4mI.js`),t=e({maxRetries:1}),n=[];for await(let e of t.models.list())n.push({value:e.id,label:e.id,description:`via grok`});return n.length>0?n:null}case`bedrock`:{let e=(await s()).map(e=>({value:e,label:e,description:`Bedrock inference profile`}));return e.length>0?e:null}case`gemini`:case`vertex`:case`foundry`:return null}}catch(t){return r(`[fetchModelList] ${e} failed: ${t instanceof Error?t.message:`unknown`}`),null}return null}var m,h,g=e((()=>{c(),f(),i(),n(),l(),o(),m=300*1e3,h=t(p,m)}));export{g as n,h as t};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./fetchModelList-BctZn47N.js";e();export{t as fetchAvailableModels};
@@ -1,3 +1,3 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{m as i}from"./zod-CuNujUwx.js";import{Br as a,Jr as o,dr as s,m as c,pr as l,qr as u,t as d}from"./settings-CA-5Px85.js";import{Gn as f,Kn as p}from"./state-CXY-q5gr.js";import{Bt as m,Pt as h,_ as g,g as _,gn as v,p as ee}from"./loadAgentsDir-DnHL_5cU.js";import{n as y,t as b}from"./cwd-DrEEb4f5.js";import{I as x,M as te,c as S,f as ne,i as re,u as ie}from"./debug-NBJH_NxR.js";import{d as ae,o as oe}from"./config-Bjwat4P6.js";import{o as se,s as C}from"./log-D98mO6yJ.js";import{i as ce,n as le}from"./execFileNoThrow-7Ys9mO27.js";import{n as ue}from"./analytics-COpjZpvd.js";import{a as de,s as fe}from"./ripgrep-CnK9qx1e.js";import*as w from"path";import{statSync as pe}from"fs";function me(e,t,n){if(t===0)return n?D:0;let r=e.charCodeAt(t-1);return he(r)?be:ge(r)&&_e(e.charCodeAt(t))?xe:0}function he(e){return e===47||e===92||e===45||e===95||e===46||e===32}function ge(e){return e>=97&&e<=122}function _e(e){return e>=65&&e<=90}function T(){return new Promise(e=>setImmediate(e))}function ve(e,t){let n=new Set;for(let r of e){let e=r.length;for(let t=0;t<r.length;t++){let n=r.charCodeAt(t);if(n===47||n===92){e=t;break}}let i=r.slice(0,e);if(i.length>0&&(n.add(i),n.size>=t))break}let r=Array.from(n);return r.sort((e,t)=>{let n=e.length-t.length;return n===0?e<t?-1:+(e>t):n}),r.slice(0,t).map(e=>({path:e,score:0}))}var ye,be,xe,E,D,O,k,A,j,M,N,Se=e((()=>{n(),ye=16,be=8,xe=6,E=4,D=8,O=3,k=1,A=100,j=64,M=new Int32Array(j),N=class{constructor(){r(this,`paths`,[]),r(this,`lowerPaths`,[]),r(this,`charBits`,new Int32Array),r(this,`pathLens`,new Uint16Array),r(this,`topLevelCache`,null),r(this,`readyCount`,0)}loadFromFileList(e){let t=new Set,n=[];for(let r of e)r.length>0&&!t.has(r)&&(t.add(r),n.push(r));this.buildIndex(n)}loadFromFileListAsync(e){let t=()=>{};return{queryable:new Promise(e=>{t=e}),done:this.buildAsync(e,t)}}async buildAsync(e,t){let n=new Set,r=[],i=performance.now();for(let t=0;t<e.length;t++){let a=e[t];a.length>0&&!n.has(a)&&(n.add(a),r.push(a)),(t&255)==255&&performance.now()-i>4&&(await T(),i=performance.now())}this.resetArrays(r),i=performance.now();let a=!0;for(let e=0;e<r.length;e++)this.indexPath(e),(e&255)==255&&performance.now()-i>4&&(this.readyCount=e+1,a&&(t(),a=!1),await T(),i=performance.now());this.readyCount=r.length,t()}buildIndex(e){this.resetArrays(e);for(let t=0;t<e.length;t++)this.indexPath(t);this.readyCount=e.length}resetArrays(e){let t=e.length;this.paths=e,this.lowerPaths=Array(t),this.charBits=new Int32Array(t),this.pathLens=new Uint16Array(t),this.readyCount=0,this.topLevelCache=ve(e,A)}indexPath(e){let t=this.paths[e].toLowerCase();this.lowerPaths[e]=t;let n=t.length;this.pathLens[e]=n;let r=0;for(let e=0;e<n;e++){let n=t.charCodeAt(e);n>=97&&n<=122&&(r|=1<<n-97)}this.charBits[e]=r}search(e,t){if(t<=0)return[];if(e.length===0)return this.topLevelCache?this.topLevelCache.slice(0,t):[];let n=e!==e.toLowerCase(),r=n?e:e.toLowerCase(),i=Math.min(r.length,j),a=Array(i),o=0;for(let e=0;e<i;e++){let t=r.charAt(e);a[e]=t;let n=t.charCodeAt(0);n>=97&&n<=122&&(o|=1<<n-97)}let s=i*24+D+32,c=[],l=-1/0,{paths:u,lowerPaths:d,charBits:f,pathLens:p,readyCount:m}=this;for(let e=0;e<m;e++){if((f[e]&o)!==o)continue;let r=n?u[e]:d[e],m=a[0],h=0,g=[],_=r.indexOf(m);if(_===-1)continue;g[h++]=_;for(let e=_+1;e<r.length;e++){if(r.charCodeAt(e)!==m.charCodeAt(0))continue;let t=r.charCodeAt(e-1);(t===47||t===92||t===45||t===95||t===46||t===32)&&(g[h++]=e)}let v=u[e],ee=p[e],y=Math.max(0,32-(ee>>2)),b=-1/0;for(let e=0;e<h;e++){M[0]=g[e];let n=0,o=0,u=M[0],d=!0;for(let e=1;e<i;e++){let t=r.indexOf(a[e],u+1);if(t===-1){d=!1;break}M[e]=t;let i=t-u-1;i===0?o+=E:n+=O+i*k,u=t}if(!d||c.length===t&&s+o-n+y<=l)continue;let f=i*ye+o-n;f+=me(v,M[0],!0);for(let e=1;e<i;e++)f+=me(v,M[e],!1);f+=y,f>b&&(b=f)}if(b===-1/0)continue;let x=b;if(c.length<t)c.push({path:v,fuzzScore:x}),c.length===t&&(c.sort((e,t)=>e.fuzzScore-t.fuzzScore),l=c[0].fuzzScore);else if(x>l){let e=0,t=c.length;for(;e<t;){let n=e+t>>1;c[n].fuzzScore<x?e=n+1:t=n}c.splice(e,0,{path:v,fuzzScore:x}),c.shift(),l=c[0].fuzzScore}}c.sort((e,t)=>t.fuzzScore-e.fuzzScore);let h=c.length,g=Math.max(h,1),_=Array(h);for(let e=0;e<h;e++){let t=c[e].path,n=e/g;_[e]={path:t,score:t.includes(`test`)?Math.min(n*1.05,1):n}}return _}}}));function P(){return z||(z=new N),z}function Ce(){z=null,B=null,H++,U=null,W=[],G=[],K=[],V.clear(),q=null,J=null,Y=0,X=null,Z=null,Q=null}function F(e){let t=e.length,n=Math.max(1,Math.floor(t/500)),r=-2128831035;for(let i=0;i<t;i+=n){let t=e[i];for(let e=0;e<t.length;e++)r=(r^t.charCodeAt(e))*16777619|0;r=r*16777619|0}if(t>0){let n=e[t-1];for(let e=0;e<n.length;e++)r=(r^n.charCodeAt(e))*16777619|0}return`${t}:${(r>>>0).toString(16)}`}function we(){let e=a(b());if(!e)return null;try{return pe(w.join(e,`.git`,`index`)).mtimeMs}catch{return null}}function I(e,t,n){return n===t?e:e.map(e=>{let r=w.join(t,e);return w.relative(n,r)})}async function Te(e){if(e.length===0||!z||W.length===0)return;let t=await Oe(e),n=[...W,...G,...K,...e,...t],r=F(n);if(r===Q){S(`[FileIndex] skipped index rebuild — merged paths unchanged`);return}await z.loadFromFileListAsync(n).done,Q=r,S(`[FileIndex] rebuilt index with ${W.length} tracked + ${e.length} untracked files`)}async function Ee(e,t){let n=`${e}:${t}`;if(J===n)return q;let r=ie(),i=[`.ignore`,`.rgignore`],a=[...new Set([e,t])],o=(0,ze.default)(),s=!1,c=a.flatMap(e=>i.map(t=>w.join(e,t))),l=await Promise.all(c.map(e=>r.readFile(e,{encoding:`utf8`}).catch(()=>null)));for(let[e,t]of l.entries())t!==null&&(o.add(t),s=!0,S(`[FileIndex] loaded ignore patterns from ${c[e]}`));let u=s?o:null;return q=u,J=n,u}async function De(e,t){let n=Date.now();S(`[FileIndex] getFilesUsingGit called`);let r=b(),i=a(r);if(!i)return S(`[FileIndex] not a git repo, returning null`),null;try{let a=Date.now(),o=await le(u(),[`-c`,`core.quotepath=false`,`ls-files`,`--recurse-submodules`],{timeout:5e3,abortSignal:e,cwd:i});if(S(`[FileIndex] git ls-files (tracked) took ${Date.now()-a}ms`),o.code!==0)return S(`[FileIndex] git ls-files failed (code=${o.code}, stderr=${o.stderr}), falling back to ripgrep`),null;let s=I(o.stdout.trim().split(`
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{m as i}from"./zod-CuNujUwx.js";import{Br as a,Jr as o,dr as s,m as c,pr as l,qr as u,t as d}from"./settings-CA-5Px85.js";import{Gn as f,Kn as p}from"./state-CXY-q5gr.js";import{Bt as m,Pt as h,_ as g,g as _,gn as v,p as ee}from"./loadAgentsDir-CgDTTnMX.js";import{n as y,t as b}from"./cwd-DrEEb4f5.js";import{I as x,M as te,c as S,f as ne,i as re,u as ie}from"./debug-NBJH_NxR.js";import{d as ae,o as oe}from"./config-CMtnYZR9.js";import{o as se,s as C}from"./log-D98mO6yJ.js";import{i as ce,n as le}from"./execFileNoThrow-7Ys9mO27.js";import{n as ue}from"./analytics-COpjZpvd.js";import{a as de,s as fe}from"./ripgrep-CnK9qx1e.js";import*as w from"path";import{statSync as pe}from"fs";function me(e,t,n){if(t===0)return n?D:0;let r=e.charCodeAt(t-1);return he(r)?be:ge(r)&&_e(e.charCodeAt(t))?xe:0}function he(e){return e===47||e===92||e===45||e===95||e===46||e===32}function ge(e){return e>=97&&e<=122}function _e(e){return e>=65&&e<=90}function T(){return new Promise(e=>setImmediate(e))}function ve(e,t){let n=new Set;for(let r of e){let e=r.length;for(let t=0;t<r.length;t++){let n=r.charCodeAt(t);if(n===47||n===92){e=t;break}}let i=r.slice(0,e);if(i.length>0&&(n.add(i),n.size>=t))break}let r=Array.from(n);return r.sort((e,t)=>{let n=e.length-t.length;return n===0?e<t?-1:+(e>t):n}),r.slice(0,t).map(e=>({path:e,score:0}))}var ye,be,xe,E,D,O,k,A,j,M,N,Se=e((()=>{n(),ye=16,be=8,xe=6,E=4,D=8,O=3,k=1,A=100,j=64,M=new Int32Array(j),N=class{constructor(){r(this,`paths`,[]),r(this,`lowerPaths`,[]),r(this,`charBits`,new Int32Array),r(this,`pathLens`,new Uint16Array),r(this,`topLevelCache`,null),r(this,`readyCount`,0)}loadFromFileListAsync(e){let t=()=>{};return{queryable:new Promise(e=>{t=e}),done:this.buildAsync(e,t)}}async buildAsync(e,t){let n=new Set,r=[],i=performance.now();for(let t=0;t<e.length;t++){let a=e[t];a.length>0&&!n.has(a)&&(n.add(a),r.push(a)),(t&255)==255&&performance.now()-i>4&&(await T(),i=performance.now())}this.resetArrays(r),i=performance.now();let a=!0;for(let e=0;e<r.length;e++)this.indexPath(e),(e&255)==255&&performance.now()-i>4&&(this.readyCount=e+1,a&&(t(),a=!1),await T(),i=performance.now());this.readyCount=r.length,t()}resetArrays(e){let t=e.length;this.paths=e,this.lowerPaths=Array(t),this.charBits=new Int32Array(t),this.pathLens=new Uint16Array(t),this.readyCount=0,this.topLevelCache=ve(e,A)}indexPath(e){let t=this.paths[e].toLowerCase();this.lowerPaths[e]=t;let n=t.length;this.pathLens[e]=n;let r=0;for(let e=0;e<n;e++){let n=t.charCodeAt(e);n>=97&&n<=122&&(r|=1<<n-97)}this.charBits[e]=r}search(e,t){if(t<=0)return[];if(e.length===0)return this.topLevelCache?this.topLevelCache.slice(0,t):[];let n=e!==e.toLowerCase(),r=n?e:e.toLowerCase(),i=Math.min(r.length,j),a=Array(i),o=0;for(let e=0;e<i;e++){let t=r.charAt(e);a[e]=t;let n=t.charCodeAt(0);n>=97&&n<=122&&(o|=1<<n-97)}let s=i*24+D+32,c=[],l=-1/0,{paths:u,lowerPaths:d,charBits:f,pathLens:p,readyCount:m}=this;for(let e=0;e<m;e++){if((f[e]&o)!==o)continue;let r=n?u[e]:d[e],m=a[0],h=0,g=[],_=r.indexOf(m);if(_===-1)continue;g[h++]=_;for(let e=_+1;e<r.length;e++){if(r.charCodeAt(e)!==m.charCodeAt(0))continue;let t=r.charCodeAt(e-1);(t===47||t===92||t===45||t===95||t===46||t===32)&&(g[h++]=e)}let v=u[e],ee=p[e],y=Math.max(0,32-(ee>>2)),b=-1/0;for(let e=0;e<h;e++){M[0]=g[e];let n=0,o=0,u=M[0],d=!0;for(let e=1;e<i;e++){let t=r.indexOf(a[e],u+1);if(t===-1){d=!1;break}M[e]=t;let i=t-u-1;i===0?o+=E:n+=O+i*k,u=t}if(!d||c.length===t&&s+o-n+y<=l)continue;let f=i*ye+o-n;f+=me(v,M[0],!0);for(let e=1;e<i;e++)f+=me(v,M[e],!1);f+=y,f>b&&(b=f)}if(b===-1/0)continue;let x=b;if(c.length<t)c.push({path:v,fuzzScore:x}),c.length===t&&(c.sort((e,t)=>e.fuzzScore-t.fuzzScore),l=c[0].fuzzScore);else if(x>l){let e=0,t=c.length;for(;e<t;){let n=e+t>>1;c[n].fuzzScore<x?e=n+1:t=n}c.splice(e,0,{path:v,fuzzScore:x}),c.shift(),l=c[0].fuzzScore}}c.sort((e,t)=>t.fuzzScore-e.fuzzScore);let h=c.length,g=Math.max(h,1),_=Array(h);for(let e=0;e<h;e++){let t=c[e].path,n=e/g;_[e]={path:t,score:t.includes(`test`)?Math.min(n*1.05,1):n}}return _}}}));function P(){return z||(z=new N),z}function Ce(){z=null,B=null,H++,U=null,W=[],G=[],K=[],V.clear(),q=null,J=null,Y=0,X=null,Z=null,Q=null}function F(e){let t=e.length,n=Math.max(1,Math.floor(t/500)),r=-2128831035;for(let i=0;i<t;i+=n){let t=e[i];for(let e=0;e<t.length;e++)r=(r^t.charCodeAt(e))*16777619|0;r=r*16777619|0}if(t>0){let n=e[t-1];for(let e=0;e<n.length;e++)r=(r^n.charCodeAt(e))*16777619|0}return`${t}:${(r>>>0).toString(16)}`}function we(){let e=a(b());if(!e)return null;try{return pe(w.join(e,`.git`,`index`)).mtimeMs}catch{return null}}function I(e,t,n){return n===t?e:e.map(e=>{let r=w.join(t,e);return w.relative(n,r)})}async function Te(e){if(e.length===0||!z||W.length===0)return;let t=await Oe(e),n=[...W,...G,...K,...e,...t],r=F(n);if(r===Q){S(`[FileIndex] skipped index rebuild — merged paths unchanged`);return}await z.loadFromFileListAsync(n).done,Q=r,S(`[FileIndex] rebuilt index with ${W.length} tracked + ${e.length} untracked files`)}async function Ee(e,t){let n=`${e}:${t}`;if(J===n)return q;let r=ie(),i=[`.ignore`,`.rgignore`],a=[...new Set([e,t])],o=(0,ze.default)(),s=!1,c=a.flatMap(e=>i.map(t=>w.join(e,t))),l=await Promise.all(c.map(e=>r.readFile(e,{encoding:`utf8`}).catch(()=>null)));for(let[e,t]of l.entries())t!==null&&(o.add(t),s=!0,S(`[FileIndex] loaded ignore patterns from ${c[e]}`));let u=s?o:null;return q=u,J=n,u}async function De(e,t){let n=Date.now();S(`[FileIndex] getFilesUsingGit called`);let r=b(),i=a(r);if(!i)return S(`[FileIndex] not a git repo, returning null`),null;try{let a=Date.now(),o=await le(u(),[`-c`,`core.quotepath=false`,`ls-files`,`--recurse-submodules`],{timeout:5e3,abortSignal:e,cwd:i});if(S(`[FileIndex] git ls-files (tracked) took ${Date.now()-a}ms`),o.code!==0)return S(`[FileIndex] git ls-files failed (code=${o.code}, stderr=${o.stderr}), falling back to ripgrep`),null;let s=I(o.stdout.trim().split(`
2
2
  `).filter(Boolean),i,r),c=await Ee(i,r);if(c){let e=s.length;s=c.filter(s),S(`[FileIndex] applied ignore patterns: ${e} -> ${s.length} files`)}W=s;let l=Date.now()-n;if(S(`[FileIndex] git ls-files: ${s.length} tracked files in ${l}ms`),s.length,s.length,!U){let e=t?[`-c`,`core.quotepath=false`,`ls-files`,`--others`,`--exclude-standard`]:[`-c`,`core.quotepath=false`,`ls-files`,`--others`],n=H;U=le(u(),e,{timeout:1e4,cwd:i}).then(async e=>{if(n===H&&e.code===0){let t=I(e.stdout.trim().split(`
3
3
  `).filter(Boolean),i,r),n=await Ee(i,r);if(n&&t.length>0){let e=t.length;t=n.filter(t),S(`[FileIndex] applied ignore patterns to untracked: ${e} -> ${t.length} files`)}S(`[FileIndex] background untracked fetch: ${t.length} files`),Te(t)}}).catch(e=>{S(`[FileIndex] background untracked fetch failed: ${e}`)}).finally(()=>{U=null})}return s}catch(e){return S(`[FileIndex] git ls-files error: ${te(e)}`),null}}async function Oe(e){let t=new Set,n=performance.now();for(let r=0;r<e.length;r++)ke(e,r,r+1,t),(r&255)==255&&performance.now()-n>4&&(await T(),n=performance.now());return[...t].map(e=>e+w.sep)}function ke(e,t,n,r){for(let i=t;i<n;i++){let t=w.dirname(e[i]);for(;t!==`.`&&!r.has(t);){let e=w.dirname(t);if(e===t)break;r.add(t),t=e}}}async function Ae(e){return(await Promise.all(ee.map(t=>g(t,e)))).flatMap(e=>e.map(e=>e.filePath))}async function je(e,t){S(`[FileIndex] getProjectFiles called, respectGitignore=${t}`);let n=await De(e,t);if(n!==null)return S(`[FileIndex] using git ls-files result (${n.length} files)`),n;S(`[FileIndex] git ls-files returned null, falling back to ripgrep`);let r=Date.now(),i=[`--files`,`--follow`,`--hidden`,`--glob`,`!.git/`,`--glob`,`!.svn/`,`--glob`,`!.hg/`,`--glob`,`!.bzr/`,`--glob`,`!.jj/`,`--glob`,`!.sl/`];t||i.push(`--no-ignore-vcs`);let a=(await fe(i,`.`,e)).map(e=>w.relative(b(),e)),o=Date.now()-r;return S(`[FileIndex] ripgrep: ${a.length} files in ${o}ms`),a.length,a}async function Me(){let e=AbortSignal.timeout(1e4),t=P();try{let n=d(),r=oe(),i=n.respectGitignore??r.respectGitignore??!0,a=b(),[o,s]=await Promise.all([je(e,i),Ae(a)]);G=s;let c=[...o,...s],l=await Oe(c);K=l;let u=[...l,...c],f=F(u);f===Z?S(`[FileIndex] skipped index rebuild — tracked paths unchanged`):(await t.loadFromFileListAsync(u).done,Z=f,Q=null)}catch(e){C(e)}return t}function Ne(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;return e.substring(0,r)}function Pe(e){if(e.length===0)return``;let t=e.map(e=>e.displayText),n=t[0];for(let e=1;e<t.length;e++){let r=t[e];if(n=Ne(n,r),n===``)return``}return n}function L(e,t){return{id:`file-${e}`,displayText:e,metadata:t===void 0?void 0:{score:t}}}function Fe(e,t){return e.search(t,$).map(e=>L(e.path,e.score))}function R(){if(B)return;let e=we();if(z&&!(e!==null&&e!==X)&&Date.now()-Y<Ve)return;let t=H,n=Date.now();P(),B=Me().then(r=>t===H?(B=null,V.emit(),X=e,Y=Date.now(),S(`[FileIndex] cache refresh completed in ${Date.now()-n}ms`),r):r).catch(e=>(S(`[FileIndex] Cache refresh failed: ${te(e)}`),C(e),t===H&&(B=null),P()))}async function Ie(){let e=ie(),t=b();try{return(await e.readdir(t)).map(e=>{let n=w.join(t,e.name),r=w.relative(t,n);return e.isDirectory()?r+w.sep:r})}catch(e){return C(e),[]}}async function Le(e,t=!1){if(!e&&!t)return[];if(d().fileSuggestion?.type===`command`)return(await m({...h(),query:e})).slice(0,$).map(L);if(e===``||e===`.`||e===`./`){let e=await Ie();return R(),e.slice(0,$).map(L)}let n=Date.now();try{let t=B!==null;R();let r=e,i=`.${w.sep}`;e.startsWith(i)&&(r=e.substring(2)),r.startsWith(`~`)&&(r=s(r));let a=z?Fe(z,r):[],o=Date.now()-n;return S(`[FileIndex] generateFileSuggestions: ${a.length} results in ${o}ms (${t?`partial`:`full`} index)`),a.length,e.length,a}catch(e){return C(e),[]}}function Re(e,t,n,r,i,a){let o=typeof e==`string`?e:e.displayText;i(t.substring(0,r)+o+t.substring(r+n.length)),a(r+o.length)}var ze,z,B,V,Be,H,U,W,G,K,q,J,Y,X,Z,Q,$,Ve,He=e((()=>{ze=t(i(),1),_(),Se(),ue(),ae(),y(),re(),x(),ce(),ne(),o(),v(),se(),l(),de(),c(),p(),z=null,B=null,V=f(),Be=V.subscribe,H=0,U=null,W=[],G=[],K=[],q=null,J=null,Y=0,X=null,Z=null,Q=null,$=15,Ve=5e3}));export{He as a,Le as i,Ce as n,Be as o,Pe as r,R as s,Re as t};
@@ -1,2 +1,2 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{FS as t,HS as n,Kx as r,LS as i,MS as a,PS as o,SS as s,Xi as c,at as l,fa as u,nt as d,ua as f,zS as p}from"./loadAgentsDir-DnHL_5cU.js";import{I as m,M as h,c as g,i as _}from"./debug-NBJH_NxR.js";import{c as v,i as y}from"./proxy-MzIsnPd7.js";import{randomUUID as b}from"crypto";function x(e){let t=[],n=0,r=/\r?\n\r?\n/g;r.lastIndex=n;let i;for(;(i=r.exec(e))!==null;){let r=i.index,a=e.slice(n,r);if(n=r+i[0].length,!a.trim())continue;let o={};for(let e of a.split(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{FS as t,HS as n,Kx as r,LS as i,MS as a,PS as o,SS as s,Xi as c,at as l,fa as u,nt as d,ua as f,zS as p}from"./loadAgentsDir-CgDTTnMX.js";import{I as m,M as h,c as g,i as _}from"./debug-NBJH_NxR.js";import{c as v,i as y}from"./proxy-MzIsnPd7.js";import{randomUUID as b}from"crypto";function x(e){let t=[],n=0,r=/\r?\n\r?\n/g;r.lastIndex=n;let i;for(;(i=r.exec(e))!==null;){let r=i.index,a=e.slice(n,r);if(n=r+i[0].length,!a.trim())continue;let o={};for(let e of a.split(`
2
2
  `)){let t=e[e.length-1]===`\r`?e.slice(0,-1):e;if(t.startsWith(`:`))continue;let n=t.indexOf(`:`);if(n===-1)continue;let r=t.slice(0,n),i=t[n+1]===` `?t.slice(n+2):t.slice(n+1);r===`data`&&(o.data=o.data?`${o.data}\n${i}`:i)}o.data&&t.push(o)}return{frames:t,remaining:e.slice(n)}}function S(){return(process.env.GEMINI_BASE_URL||T).replace(/\/+$/,``)}function C(e){let t=e.replace(/^\/+/,``);return t.startsWith(`models/`)?t:`models/${t}`}async function*w(e){let t=await(e.fetchOverride??fetch)(`${S()}/${C(e.model)}:streamGenerateContent?alt=sse`,{method:`POST`,headers:{"Content-Type":`application/json`,"x-goog-api-key":process.env.GEMINI_API_KEY||``},body:JSON.stringify(e.body),signal:e.signal,...y({forAnthropicAPI:!1})});if(!t.ok){let e=await t.text();throw Error(`Gemini API request failed (${t.status} ${t.statusText}): ${e||`empty response body`}`)}if(!t.body)throw Error(`Gemini API returned no response body`);let n=t.body.getReader(),r=new TextDecoder,i=``;try{for(;;){let{done:e,value:t}=await n.read();if(e)break;i+=r.decode(t,E);let{frames:a,remaining:o}=x(i);i=o;for(let e of a)if(!(!e.data||e.data===`[DONE]`))try{yield JSON.parse(e.data)}catch(e){throw Error(`Failed to parse Gemini SSE payload: ${h(e)}`)}}i+=r.decode();let{frames:e}=x(i);for(let t of e)if(!(!t.data||t.data===`[DONE]`))try{yield JSON.parse(t.data)}catch(e){throw Error(`Failed to parse trailing Gemini SSE payload: ${h(e)}`)}}finally{n.releaseLock()}}var T,E,D=e((()=>{m(),v(),T=`https://generativelanguage.googleapis.com/v1beta`,E={stream:!0}}));async function*O(e,s,c,d,m,h){try{let r=n(m.model),_=u(e,c),v=(await Promise.all(c.map(e=>l(e,{getToolPermissionContext:m.getToolPermissionContext,tools:c,agents:m.agents,allowedAgentTypes:m.allowedAgentTypes,model:m.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),{contents:y,systemInstruction:x}=i(_,s),S=t(v),C=o(m.toolChoice),T=w({model:r,signal:d,fetchOverride:m.fetchOverride,body:{contents:y,...x&&{systemInstruction:x},...S.length>0&&{tools:S},...C&&{toolConfig:{functionCallingConfig:C}},generationConfig:{...m.temperatureOverride!==void 0&&{temperature:m.temperatureOverride},...h.type!==`disabled`&&{thinkingConfig:{includeThoughts:!0,...h.type===`enabled`&&{thinkingBudget:h.budgetTokens}}}}}});g(`[Gemini] Calling model=${r}, messages=${y.length}, tools=${S.length}`);let E=a(T,r),D={},O=null,k=0,A=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,k=Date.now()-A;break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?D[t]={...n,input:``}:n.type===`text`?D[t]={...n,text:``}:n.type===`thinking`?D[t]={...n,thinking:``,signature:``}:D[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=D[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.type===`thinking`?r.signature=n.signature:r[p]=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:f([t],c,m.agentId)},requestId:void 0,type:`assistant`,uuid:b(),timestamp:new Date().toISOString()};break}case`message_delta`:case`message_stop`:break}yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:k}:void 0}}}catch(e){let t=e instanceof Error?e.message:String(e);g(`[Gemini] Error: ${t}`,{level:`error`}),yield r({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{d(),_(),c(),D(),s()}))();export{O as queryModelGemini};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{bn as t,vn as n}from"./settings-CA-5Px85.js";import{$ as r,Lx as i,Q as a,Xi as o,qS as s,ry as c}from"./loadAgentsDir-DnHL_5cU.js";import{I as l,M as u,c as d,i as f}from"./debug-NBJH_NxR.js";import{r as p,t as m}from"./sessionTitle-k4wpUS5l.js";async function h(e,n){let a=m(e);if(!a)return null;try{let e=await r({systemPrompt:s([`Generate a short kebab-case name (2-4 words) that captures the main topic of this conversation. Use lowercase words separated by hyphens. Examples: "fix-login-bug", "add-auth-feature", "refactor-api-client", "debug-test-failures". Return JSON with a "name" field.`]),userPrompt:a,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{name:{type:`string`}},required:[`name`],additionalProperties:!1}},signal:n,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),o=t(Array.isArray(e.message.content)?i(e.message.content):e.message.content);return o&&typeof o==`object`&&`name`in o&&typeof o.name==`string`?o.name:null}catch(e){return d(`generateSessionName failed: ${u(e)}`,{level:`error`}),null}}var g=e((()=>{a(),f(),l(),n(),o(),p(),c()}));export{g as n,h as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{bn as t,vn as n}from"./settings-CA-5Px85.js";import{$ as r,Lx as i,Q as a,Xi as o,qS as s,ry as c}from"./loadAgentsDir-CgDTTnMX.js";import{I as l,M as u,c as d,i as f}from"./debug-NBJH_NxR.js";import{r as p,t as m}from"./sessionTitle-k4wpUS5l.js";async function h(e,n){let a=m(e);if(!a)return null;try{let e=await r({systemPrompt:s([`Generate a short kebab-case name (2-4 words) that captures the main topic of this conversation. Use lowercase words separated by hyphens. Examples: "fix-login-bug", "add-auth-feature", "refactor-api-client", "debug-test-failures". Return JSON with a "name" field.`]),userPrompt:a,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{name:{type:`string`}},required:[`name`],additionalProperties:!1}},signal:n,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),o=t(Array.isArray(e.message.content)?i(e.message.content):e.message.content);return o&&typeof o==`object`&&`name`in o&&typeof o.name==`string`?o.name:null}catch(e){return d(`generateSessionName failed: ${u(e)}`,{level:`error`}),null}}var g=e((()=>{a(),f(),l(),n(),o(),p(),c()}));export{g as n,h as t};
@@ -1,3 +1,3 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,t as r}from"./src-BX54x08P.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{Lv as a,Mv as o,al as s,cl as c,dl as l,fl as u,gl as d,hl as f,il as p,ll as m,ml as h,nl as g,ol as _,rl as v,sl as y,tl as b}from"./loadAgentsDir-DnHL_5cU.js";import{t as x}from"./select-BpiKdirZ.js";import{t as S}from"./CustomSelect-iSG1rbWU.js";import{n as C,t as w}from"./PermissionDialog-DjCRuzSm.js";function T({currentGoal:e,newObjective:r,onConfirm:i,onCancel:a}){function o(e){e===`yes`?i():a()}let s=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`;return(0,E.jsx)(w,{color:`warning`,title:`Replace active goal?`,children:(0,E.jsxs)(t,{flexDirection:`column`,marginTop:1,paddingX:1,children:[(0,E.jsx)(n,{children:`A goal is already in progress. Replacing it will reset all progress and counters.`}),(0,E.jsxs)(t,{marginTop:1,flexDirection:`column`,children:[(0,E.jsx)(n,{dimColor:!0,children:`Current goal:`}),(0,E.jsxs)(n,{children:[(0,E.jsx)(n,{dimColor:!0,children:`· Objective: `}),e.objective]}),(0,E.jsxs)(n,{children:[(0,E.jsx)(n,{dimColor:!0,children:`· Status: `}),c(e.status)]}),(0,E.jsxs)(n,{children:[(0,E.jsx)(n,{dimColor:!0,children:`· Time: `}),y(e)]}),(0,E.jsxs)(n,{children:[(0,E.jsx)(n,{dimColor:!0,children:`· Tokens: `}),s]})]}),(0,E.jsxs)(t,{marginTop:1,flexDirection:`column`,children:[(0,E.jsx)(n,{dimColor:!0,children:`New objective:`}),(0,E.jsx)(n,{children:r})]}),(0,E.jsx)(t,{marginTop:1,children:(0,E.jsx)(x,{options:[{label:`Yes, replace the goal`,value:`yes`},{label:`No, keep the current goal`,value:`no`}],onChange:o,onCancel:a})})]})})}var E,D=e((()=>{r(),S(),C(),u(),E=i()}));function O(e){let t=e.split(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,t as r}from"./src-BX54x08P.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{Lv as a,Mv as o,al as s,cl as c,dl as l,fl as u,gl as d,hl as f,il as p,ll as m,ml as h,nl as g,ol as _,rl as v,sl as y,tl as b}from"./loadAgentsDir-CgDTTnMX.js";import{t as x}from"./select-BNeFiLNP.js";import{t as S}from"./CustomSelect-uOjgHk8D.js";import{n as C,t as w}from"./PermissionDialog-DjCRuzSm.js";function T({currentGoal:e,newObjective:r,onConfirm:i,onCancel:a}){function o(e){e===`yes`?i():a()}let s=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`;return(0,E.jsx)(w,{color:`warning`,title:`Replace active goal?`,children:(0,E.jsxs)(t,{flexDirection:`column`,marginTop:1,paddingX:1,children:[(0,E.jsx)(n,{children:`A goal is already in progress. Replacing it will reset all progress and counters.`}),(0,E.jsxs)(t,{marginTop:1,flexDirection:`column`,children:[(0,E.jsx)(n,{dimColor:!0,children:`Current goal:`}),(0,E.jsxs)(n,{children:[(0,E.jsx)(n,{dimColor:!0,children:`· Objective: `}),e.objective]}),(0,E.jsxs)(n,{children:[(0,E.jsx)(n,{dimColor:!0,children:`· Status: `}),c(e.status)]}),(0,E.jsxs)(n,{children:[(0,E.jsx)(n,{dimColor:!0,children:`· Time: `}),y(e)]}),(0,E.jsxs)(n,{children:[(0,E.jsx)(n,{dimColor:!0,children:`· Tokens: `}),s]})]}),(0,E.jsxs)(t,{marginTop:1,flexDirection:`column`,children:[(0,E.jsx)(n,{dimColor:!0,children:`New objective:`}),(0,E.jsx)(n,{children:r})]}),(0,E.jsx)(t,{marginTop:1,children:(0,E.jsx)(x,{options:[{label:`Yes, replace the goal`,value:`yes`},{label:`No, keep the current goal`,value:`no`}],onChange:o,onCancel:a})})]})})}var E,D=e((()=>{r(),S(),C(),u(),E=i()}));function O(e){let t=e.split(`
2
2
  `)[0]??e;return t.length<=F?t:`${t.slice(0,F)}…`}function k(){a(e=>e.origin===`goal-continuation`||e.origin===`goal-budget-limit`)}function A(){let e=m();if(!e)return"No active goal. Set one with `/goal <objective>`.";let t=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`,n=[`Goal: ${e.objective}`,`Status: ${c(e.status)}`,`Time: ${y(e)}`,`Tokens: ${t}`,`Continuation turns: ${e.turnsExecuted}`];return e.status===`max_turns`&&n.push("Hint: Max continuation turns reached (150). Run `/goal continue` to reset and continue."),n.join(`
3
3
  `)}function j(e){return d(e),l(),g(),`Goal set.`}async function M(e,t,n){let r=n.trim();if(!r||r.toLowerCase()===`status`)return e(A(),{display:`system`}),null;let i=r.toLowerCase();if(i===`clear`){let t=p();return t&&(v(),k()),e(t?`Goal cleared.`:`No active goal to clear.`,{display:`system`}),null}if(i===`pause`){let t=h();return t&&(g(),k()),e(t?`Goal paused.`:`No active goal to pause.`,{display:`system`}),null}if(i===`resume`){if(m()?.status===`max_turns`)return e("Goal reached max continuation turns (150). Run `/goal continue` to reset turn counter and continue.",{display:`system`}),null;let t=f();return t&&g(),e(t?`Goal resumed.`:`No paused goal to resume.`,{display:`system`,shouldQuery:!!t}),null}if(i===`continue`){let t=_();return t&&g(),e(t?`Goal continuation counter reset (0/150). Continuing...`:`Current goal is not in max-turns state.`,{display:`system`,shouldQuery:!!t}),null}if(i===`complete`){let t=s();return t&&(g(),k()),e(t?`Goal marked complete.`:`No active goal to complete.`,{display:`system`}),null}if(r.length>P)return e(`Goal objective is too long (${r.length} chars; limit ${P}). Save the detailed instructions to a file and reference it from a shorter objective.`,{display:`system`}),null;let a=m();return a&&a.status!==`complete`?(0,N.jsx)(T,{currentGoal:a,newObjective:r,onConfirm:()=>{k(),e(j(r),{display:`system`,shouldQuery:!0,displayArgs:O(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]})},onCancel:()=>{e(`Kept the current goal. New objective discarded.`,{display:`system`})}}):(e(j(r),{display:`system`,shouldQuery:!0,displayArgs:O(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]}),null)}var N,P,F;e((()=>{u(),b(),o(),D(),N=i(),P=4e3,F=80}))();export{M as call};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{CS as t,ES as n,Kx as r,OS as i,SS as a,TS as o,WS as s,Xi as c,_y as l,at as u,by as d,fa as f,ly as p,nt as m,py as h,ua as g}from"./loadAgentsDir-DnHL_5cU.js";import{c as _,i as v}from"./debug-NBJH_NxR.js";import{n as y,t as b}from"./client-D3QmHVeI.js";import{n as x,t as S}from"./openaiShared-G2-w4gJt.js";import{randomUUID as C}from"crypto";async function*w(e,a,c,d,m){try{let r=s(m.model),h=f(e,c),v=(await Promise.all(c.map(e=>u(e,{getToolPermissionContext:m.getToolPermissionContext,tools:c,agents:m.agents,allowedAgentTypes:m.allowedAgentTypes,model:m.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),y=i(h,a),S=n(v),w=o(m.toolChoice),T=b({maxRetries:0,fetchOverride:m.fetchOverride,source:m.querySource});_(`[Grok] Calling model=${r}, messages=${y.length}, tools=${S.length}`);let E=t(await T.chat.completions.create({model:r,messages:y,...S.length>0&&{tools:S,...w&&{tool_choice:w}},stream:!0,stream_options:{include_usage:!0},...m.temperatureOverride!==void 0&&{temperature:m.temperatureOverride}},{signal:d}),r),D={},O=null,k={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0},A=0,j=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,A=Date.now()-j,e.message.usage&&(k=x(k,e.message.usage));break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?D[t]={...n,input:``}:n.type===`text`?D[t]={...n,text:``}:n.type===`thinking`?D[t]={...n,thinking:``,signature:``}:D[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=D[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.signature=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:g([t],c,m.agentId)},requestId:void 0,type:`assistant`,uuid:C(),timestamp:new Date().toISOString()};break}case`message_delta`:{let t=e.usage;t&&(k=x(k,t));break}case`message_stop`:break}e.type===`message_stop`&&k.input_tokens+k.output_tokens>0&&p(l(r,k),k,m.model),yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:A}:void 0}}}catch(e){let t=e instanceof Error?e.message:String(e);_(`[Grok] Error: ${t}`,{level:`error`}),yield r({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{y(),S(),a(),c(),m(),v(),h(),d()}))();export{w as queryModelGrok};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{CS as t,ES as n,Kx as r,OS as i,SS as a,TS as o,WS as s,Xi as c,_y as l,at as u,by as d,fa as f,ly as p,nt as m,py as h,ua as g}from"./loadAgentsDir-CgDTTnMX.js";import{c as _,i as v}from"./debug-NBJH_NxR.js";import{n as y,t as b}from"./client-D3QmHVeI.js";import{n as x,t as S}from"./openaiShared-G2-w4gJt.js";import{randomUUID as C}from"crypto";async function*w(e,a,c,d,m){try{let r=s(m.model),h=f(e,c),v=(await Promise.all(c.map(e=>u(e,{getToolPermissionContext:m.getToolPermissionContext,tools:c,agents:m.agents,allowedAgentTypes:m.allowedAgentTypes,model:m.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),y=i(h,a),S=n(v),w=o(m.toolChoice),T=b({maxRetries:0,fetchOverride:m.fetchOverride,source:m.querySource});_(`[Grok] Calling model=${r}, messages=${y.length}, tools=${S.length}`);let E=t(await T.chat.completions.create({model:r,messages:y,...S.length>0&&{tools:S,...w&&{tool_choice:w}},stream:!0,stream_options:{include_usage:!0},...m.temperatureOverride!==void 0&&{temperature:m.temperatureOverride}},{signal:d}),r),D={},O=null,k={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0},A=0,j=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,A=Date.now()-j,e.message.usage&&(k=x(k,e.message.usage));break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?D[t]={...n,input:``}:n.type===`text`?D[t]={...n,text:``}:n.type===`thinking`?D[t]={...n,thinking:``,signature:``}:D[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=D[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.signature=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:g([t],c,m.agentId)},requestId:void 0,type:`assistant`,uuid:C(),timestamp:new Date().toISOString()};break}case`message_delta`:{let t=e.usage;t&&(k=x(k,t));break}case`message_stop`:break}e.type===`message_stop`&&k.input_tokens+k.output_tokens>0&&p(l(r,k),k,m.model),yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:A}:void 0}}}catch(e){let t=e instanceof Error?e.message:String(e);_(`[Grok] Error: ${t}`,{level:`error`}),yield r({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{y(),S(),a(),c(),m(),v(),h(),d()}))();export{w as queryModelGrok};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,Wt as a,a as o,ai as s,n as c,ot as l,r as u,t as d,x as f}from"./src-BX54x08P.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{Ci as m,Di as h,Pi as g,ab as _,ib as v,lb as y,rb as b}from"./loadAgentsDir-DnHL_5cU.js";import{v as x,y as S}from"./startupProfiler-C_xcIvEA.js";import{n as C,t as w}from"./useExitOnCtrlCDWithKeybindings-DegJrysj.js";import{n as T,t as E}from"./select-BpiKdirZ.js";import{n as D,r as O}from"./modalContext-sU2lfR08.js";import{n as k,t as A}from"./PromptInputHelpMenu-DcGXK5lt.js";function j({commands:e,maxHeight:t,columns:r,title:a,onCancel:s,emptyMessage:c}){let{headerFocused:l,focusHeader:u}=o(),d=Math.max(1,r-10),f=Math.max(1,Math.floor((t-10)/2)),p=(0,M.useMemo)(()=>{let t=new Set;return e.filter(e=>t.has(e.name)?!1:(t.add(e.name),!0)).sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({label:`/${e.name}`,value:e.name,description:S(h(e),d,!0)}))},[e,d]);return(0,N.jsx)(n,{flexDirection:`column`,paddingY:1,children:e.length===0&&c?(0,N.jsx)(i,{dimColor:!0,children:c}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(i,{children:a}),(0,N.jsx)(n,{marginTop:1,children:(0,N.jsx)(E,{options:p,visibleOptionCount:f,onCancel:s,disableSelection:!0,hideIndexes:!0,layout:`compact-vertical`,onUpFromFirstItem:u,isDisabled:l})})]})})}var M,N,P=e((()=>{M=t(s(),1),g(),x(),d(),T(),N=p()}));function F(){return(0,I.jsxs)(n,{flexDirection:`column`,paddingY:1,gap:1,children:[(0,I.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,I.jsx)(i,{bold:!0,children:`Getting started`}),(0,I.jsxs)(n,{flexDirection:`column`,children:[(0,I.jsxs)(i,{children:[(0,I.jsx)(i,{bold:!0,children:`1. `}),(0,I.jsx)(i,{children:`Ask a question or describe a task — Work Mate will explore your code and respond.`})]}),(0,I.jsxs)(i,{children:[(0,I.jsx)(i,{bold:!0,children:`2. `}),(0,I.jsx)(i,{children:`When Work Mate wants to edit files or run commands, you review and approve each action.`})]}),(0,I.jsxs)(i,{children:[(0,I.jsx)(i,{bold:!0,children:`3. `}),(0,I.jsx)(i,{children:`Type `}),(0,I.jsx)(i,{bold:!0,children:`/help`}),(0,I.jsx)(i,{children:` for commands, or `}),(0,I.jsx)(i,{bold:!0,children:`?`}),(0,I.jsx)(i,{children:` for shortcuts.`})]})]})]}),(0,I.jsxs)(n,{flexDirection:`column`,children:[(0,I.jsx)(n,{children:(0,I.jsx)(i,{bold:!0,children:`Shortcuts`})}),(0,I.jsx)(A,{gap:2,fixedWidth:!0})]})]})}var I,L=e((()=>{d(),k(),I=p()}));function R({onClose:e,commands:t}){let{rows:o,columns:s}=l(),d=Math.floor(o/2),p=O(),h=()=>e(`Help dialog dismissed`,{display:`system`});a(`help:dismiss`,h,{context:`Help`});let g=C(h),v=_(`help:dismiss`,`Help`,`esc`),y=m(),b=t.filter(e=>y.has(e.name)&&!e.isHidden),x=t.filter(e=>!y.has(e.name)&&!e.isHidden),S=[(0,z.jsx)(c,{title:`general`,children:(0,z.jsx)(F,{})},`general`)];return S.push((0,z.jsx)(c,{title:`commands`,children:(0,z.jsx)(j,{commands:b,maxHeight:d,columns:s,title:`Browse default commands:`,onCancel:h})},`commands`)),S.push((0,z.jsx)(c,{title:`custom-commands`,children:(0,z.jsx)(j,{commands:x,maxHeight:d,columns:s,title:`Browse custom commands:`,emptyMessage:`No custom commands found`,onCancel:h})},`custom`)),(0,z.jsx)(n,{flexDirection:`column`,height:p?void 0:d,children:(0,z.jsxs)(f,{color:`professionalBlue`,children:[(0,z.jsx)(u,{title:`Work Mate v0.0.30`,color:`professionalBlue`,defaultTab:`general`,children:S}),(0,z.jsx)(n,{marginTop:1,children:(0,z.jsxs)(i,{children:[`For more help: `,(0,z.jsx)(r,{url:`https://code.workmate.com/docs/en/overview`})]})}),(0,z.jsx)(n,{marginTop:1,children:(0,z.jsx)(i,{dimColor:!0,children:g.pending?(0,z.jsxs)(z.Fragment,{children:[`Press `,g.keyName,` again to exit`]}):(0,z.jsxs)(i,{italic:!0,children:[v,` to cancel`]})})})]})})}var z,B=e((()=>{w(),v(),g(),D(),y(),d(),b(),P(),L(),z=p()})),V,H;e((()=>{B(),V=p(),H=async(e,{options:{commands:t}})=>(0,V.jsx)(R,{commands:t,onClose:e})}))();export{H as call};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,Wt as a,a as o,ai as s,n as c,ot as l,r as u,t as d,x as f}from"./src-BX54x08P.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{Ci as m,Di as h,Pi as g,ab as _,ib as v,lb as y,rb as b}from"./loadAgentsDir-CgDTTnMX.js";import{v as x,y as S}from"./startupProfiler-C_xcIvEA.js";import{n as C,t as w}from"./useExitOnCtrlCDWithKeybindings-z3RiW9jT.js";import{n as T,t as E}from"./select-BNeFiLNP.js";import{n as D,r as O}from"./modalContext-sU2lfR08.js";import{n as k,t as A}from"./PromptInputHelpMenu-MH_gVGmN.js";function j({commands:e,maxHeight:t,columns:r,title:a,onCancel:s,emptyMessage:c}){let{headerFocused:l,focusHeader:u}=o(),d=Math.max(1,r-10),f=Math.max(1,Math.floor((t-10)/2)),p=(0,M.useMemo)(()=>{let t=new Set;return e.filter(e=>t.has(e.name)?!1:(t.add(e.name),!0)).sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({label:`/${e.name}`,value:e.name,description:S(h(e),d,!0)}))},[e,d]);return(0,N.jsx)(n,{flexDirection:`column`,paddingY:1,children:e.length===0&&c?(0,N.jsx)(i,{dimColor:!0,children:c}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(i,{children:a}),(0,N.jsx)(n,{marginTop:1,children:(0,N.jsx)(E,{options:p,visibleOptionCount:f,onCancel:s,disableSelection:!0,hideIndexes:!0,layout:`compact-vertical`,onUpFromFirstItem:u,isDisabled:l})})]})})}var M,N,P=e((()=>{M=t(s(),1),g(),x(),d(),T(),N=p()}));function F(){return(0,I.jsxs)(n,{flexDirection:`column`,paddingY:1,gap:1,children:[(0,I.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,I.jsx)(i,{bold:!0,children:`Getting started`}),(0,I.jsxs)(n,{flexDirection:`column`,children:[(0,I.jsxs)(i,{children:[(0,I.jsx)(i,{bold:!0,children:`1. `}),(0,I.jsx)(i,{children:`Ask a question or describe a task — Work Mate will explore your code and respond.`})]}),(0,I.jsxs)(i,{children:[(0,I.jsx)(i,{bold:!0,children:`2. `}),(0,I.jsx)(i,{children:`When Work Mate wants to edit files or run commands, you review and approve each action.`})]}),(0,I.jsxs)(i,{children:[(0,I.jsx)(i,{bold:!0,children:`3. `}),(0,I.jsx)(i,{children:`Type `}),(0,I.jsx)(i,{bold:!0,children:`/help`}),(0,I.jsx)(i,{children:` for commands, or `}),(0,I.jsx)(i,{bold:!0,children:`?`}),(0,I.jsx)(i,{children:` for shortcuts.`})]})]})]}),(0,I.jsxs)(n,{flexDirection:`column`,children:[(0,I.jsx)(n,{children:(0,I.jsx)(i,{bold:!0,children:`Shortcuts`})}),(0,I.jsx)(A,{gap:2,fixedWidth:!0})]})]})}var I,L=e((()=>{d(),k(),I=p()}));function R({onClose:e,commands:t}){let{rows:o,columns:s}=l(),d=Math.floor(o/2),p=O(),h=()=>e(`Help dialog dismissed`,{display:`system`});a(`help:dismiss`,h,{context:`Help`});let g=C(h),v=_(`help:dismiss`,`Help`,`esc`),y=m(),b=t.filter(e=>y.has(e.name)&&!e.isHidden),x=t.filter(e=>!y.has(e.name)&&!e.isHidden),S=[(0,z.jsx)(c,{title:`general`,children:(0,z.jsx)(F,{})},`general`)];return S.push((0,z.jsx)(c,{title:`commands`,children:(0,z.jsx)(j,{commands:b,maxHeight:d,columns:s,title:`Browse default commands:`,onCancel:h})},`commands`)),S.push((0,z.jsx)(c,{title:`custom-commands`,children:(0,z.jsx)(j,{commands:x,maxHeight:d,columns:s,title:`Browse custom commands:`,emptyMessage:`No custom commands found`,onCancel:h})},`custom`)),(0,z.jsx)(n,{flexDirection:`column`,height:p?void 0:d,children:(0,z.jsxs)(f,{color:`professionalBlue`,children:[(0,z.jsx)(u,{title:`Work Mate v0.0.31`,color:`professionalBlue`,defaultTab:`general`,children:S}),(0,z.jsx)(n,{marginTop:1,children:(0,z.jsxs)(i,{children:[`For more help: `,(0,z.jsx)(r,{url:`https://code.workmate.com/docs/en/overview`})]})}),(0,z.jsx)(n,{marginTop:1,children:(0,z.jsx)(i,{dimColor:!0,children:g.pending?(0,z.jsxs)(z.Fragment,{children:[`Press `,g.keyName,` again to exit`]}):(0,z.jsxs)(i,{italic:!0,children:[v,` to cancel`]})})})]})})}var z,B=e((()=>{w(),v(),g(),D(),y(),d(),b(),P(),L(),z=p()})),V,H;e((()=>{B(),V=p(),H=async(e,{options:{commands:t}})=>(0,V.jsx)(R,{commands:t,onClose:e})}))();export{H as call};
@@ -0,0 +1 @@
1
+ import{Yt as e,cn as t,gn as n}from"./loadAgentsDir-CgDTTnMX.js";n();export{e as executeSessionEndHooks,t as getSessionEndHookTimeoutMs};
@@ -1,4 +1,4 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./memoize-BK3gG5ob.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{I as o,Lt as s,P as c,Wt as l,ai as u,t as d,y as f}from"./src-BX54x08P.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{d as m,m as h,s as g}from"./settings-CA-5Px85.js";import{Pt as _,tt as v}from"./state-CXY-q5gr.js";import{Cd as y,Dd as b,Ed as x,Hh as S,Jh as C,Oc as w,Od as T,Td as E,Uh as D,Vh as O,kc as k,kd as A,qh as ee,rb as te,wd as ne}from"./loadAgentsDir-DnHL_5cU.js";import{n as j}from"./analytics-COpjZpvd.js";import{l as M,o as N}from"./stringUtils-CtJhTszO.js";import{n as P,t as F}from"./select-BpiKdirZ.js";function re(e,t){let n={PreToolUse:{},PostToolUse:{},PostToolUseFailure:{},PermissionDenied:{},Notification:{},UserPromptSubmit:{},SessionStart:{},SessionEnd:{},Stop:{},StopFailure:{},SubagentStart:{},SubagentStop:{},PreCompact:{},PostCompact:{},PermissionRequest:{},Setup:{},TeammateIdle:{},TaskCreated:{},TaskCompleted:{},Elicitation:{},ElicitationResult:{},ConfigChange:{},WorktreeCreate:{},WorktreeRemove:{},InstructionsLoaded:{},CwdChanged:{},FileChanged:{}},r=L(t);y(e).forEach(e=>{let t=n[e.event];if(t){let n=r[e.event].matcherMetadata===void 0?``:e.matcher||``;t[n]||(t[n]=[]),t[n].push(e)}});let i=v();if(i)for(let[e,t]of Object.entries(i)){let r=e,i=n[r];if(i)for(let e of t??[]){let t=e.matcher||``;if(`pluginRoot`in e){i[t]??(i[t]=[]);for(let n of e.hooks)i[t].push({event:r,config:n,matcher:e.matcher,source:`pluginHook`,pluginName:e.pluginId})}}}return n}function ie(e,t){return A(Object.keys(e[t]||{}),e,t)}function ae(e,t,n){let r=n??``;return e[t]?.[r]??[]}function I(e,t){return L(t)[e].matcherMetadata}var L,R=e((()=>{r(),_(),T(),L=n(e=>({PreToolUse:{summary:`Before tool execution`,description:`Input to command is JSON of tool call arguments.
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./memoize-BK3gG5ob.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{I as o,Lt as s,P as c,Wt as l,ai as u,t as d,y as f}from"./src-BX54x08P.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{d as m,m as h,s as g}from"./settings-CA-5Px85.js";import{Pt as _,tt as v}from"./state-CXY-q5gr.js";import{Cd as y,Dd as b,Ed as x,Hh as S,Jh as C,Oc as w,Od as T,Td as E,Uh as D,Vh as O,kc as k,kd as A,qh as ee,rb as te,wd as ne}from"./loadAgentsDir-CgDTTnMX.js";import{n as j}from"./analytics-COpjZpvd.js";import{l as M,o as N}from"./stringUtils-CtJhTszO.js";import{n as P,t as F}from"./select-BNeFiLNP.js";function re(e,t){let n={PreToolUse:{},PostToolUse:{},PostToolUseFailure:{},PermissionDenied:{},Notification:{},UserPromptSubmit:{},SessionStart:{},SessionEnd:{},Stop:{},StopFailure:{},SubagentStart:{},SubagentStop:{},PreCompact:{},PostCompact:{},PermissionRequest:{},Setup:{},TeammateIdle:{},TaskCreated:{},TaskCompleted:{},Elicitation:{},ElicitationResult:{},ConfigChange:{},WorktreeCreate:{},WorktreeRemove:{},InstructionsLoaded:{},CwdChanged:{},FileChanged:{}},r=L(t);y(e).forEach(e=>{let t=n[e.event];if(t){let n=r[e.event].matcherMetadata===void 0?``:e.matcher||``;t[n]||(t[n]=[]),t[n].push(e)}});let i=v();if(i)for(let[e,t]of Object.entries(i)){let r=e,i=n[r];if(i)for(let e of t??[]){let t=e.matcher||``;if(`pluginRoot`in e){i[t]??(i[t]=[]);for(let n of e.hooks)i[t].push({event:r,config:n,matcher:e.matcher,source:`pluginHook`,pluginName:e.pluginId})}}}return n}function ie(e,t){return A(Object.keys(e[t]||{}),e,t)}function ae(e,t,n){let r=n??``;return e[t]?.[r]??[]}function I(e,t){return L(t)[e].matcherMetadata}var L,R=e((()=>{r(),_(),T(),L=n(e=>({PreToolUse:{summary:`Before tool execution`,description:`Input to command is JSON of tool call arguments.
2
2
  Exit code 0 - stdout/stderr not shown
3
3
  Exit code 2 - show stderr to model and block tool call
4
4
  Other exit codes - show stderr to user only but continue with tool call`,matcherMetadata:{fieldToMatch:`tool_name`,values:e}},PostToolUse:{summary:`After tool execution`,description:`Input to command is JSON with fields "inputs" (tool call arguments) and "response" (tool call response).
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,ai as r,kn as i,s as a,t as o}from"./src-BX54x08P.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{Xt as c,m as l,qt as u,t as d,y as f}from"./settings-CA-5Px85.js";import{I as p,M as m,c as h,i as g}from"./debug-NBJH_NxR.js";import{n as _}from"./analytics-COpjZpvd.js";import{a as v,n as y,r as b,s as x,t as S}from"./nativeInstaller-BDJxBAPV.js";import{join as C}from"node:path";import{homedir as w}from"node:os";var T=e(r(),1);_(),o(),g(),c(),p(),S(),l();var E=s();function D(){let e=u.platform===`win32`,t=w();return e?C(t,`.local`,`bin`,`claude.exe`).replace(/\//g,`\\`):`~/.local/bin/claude`}function O({messages:e}){return e.length===0?null:(0,E.jsxs)(t,{flexDirection:`column`,gap:0,marginBottom:1,children:[(0,E.jsx)(t,{children:(0,E.jsxs)(n,{color:`warning`,children:[(0,E.jsx)(a,{status:`warning`,withSpace:!0}),`Setup notes:`]})}),e.map((e,r)=>(0,E.jsx)(t,{marginLeft:2,children:(0,E.jsxs)(n,{dimColor:!0,children:[`• `,e]})},r))]})}function k({onDone:e,force:r,target:i}){let[o,s]=(0,T.useState)({type:`checking`});return(0,T.useEffect)(()=>{async function e(){try{h(`Install: Starting installation process (force=${r}, target=${i})`);let e=i||d()?.autoUpdatesChannel||`latest`;s({type:`installing`,version:e}),h(`Install: Calling installLatest(channelOrVersion=${e}, forceReinstall=${r})`);let t=await x(e,r);if(h(`Install: installLatest returned version=${t.latestVersion}, wasUpdated=${t.wasUpdated}, lockFailed=${t.lockFailed}`),t.lockFailed)throw Error(`Could not install - another process is currently installing Work Mate. Please try again in a moment.`);t.latestVersion||h(`Install: Failed to retrieve version information during install`,{level:`error`}),t.wasUpdated||h(`Install: Already up to date`),s({type:`setting-up`});let n=await y(!0);h(`Install: Setup launcher completed with ${n.length} messages`),n.length>0&&n.forEach(e=>h(`Install: Setup message: ${e.message}`)),h(`Install: Cleaning up npm installations after successful install`);let{removed:a,errors:o,warnings:c}=await b();a>0&&h(`Cleaned up ${a} npm installation(s)`),o.length>0&&h(`Cleanup errors: ${o.join(`, `)}`);let l=await v();l.length>0&&h(`Shell alias cleanup: ${l.map(e=>e.message).join(`; `)}`),+!!t.latestVersion,(i===`latest`||i===`stable`)&&(f(`userSettings`,{autoUpdatesChannel:i}),h(`Install: Saved autoUpdatesChannel=${i} to user settings`));let u=[...c,...l.map(e=>e.message)];n.length>0?(s({type:`set-up`,messages:n.map(e=>e.message)}),setTimeout(s,2e3,{type:`success`,version:t.latestVersion||`current`,setupMessages:[...n.map(e=>e.message),...u]})):(h(`Install: Shell PATH already configured`),s({type:`success`,version:t.latestVersion||`current`,setupMessages:u.length>0?u:void 0}))}catch(e){h(`Install command failed: ${e}`,{level:`error`}),s({type:`error`,message:m(e)})}}e()},[r,i]),(0,T.useEffect)(()=>{o.type===`success`?setTimeout(e,2e3,`Work Mate installation completed successfully`,{display:`system`}):o.type===`error`&&setTimeout(e,3e3,`Work Mate installation failed`,{display:`system`})},[o,e]),(0,E.jsxs)(t,{flexDirection:`column`,marginTop:1,children:[o.type===`checking`&&(0,E.jsx)(n,{color:`claude`,children:`Checking installation status...`}),o.type===`cleaning-npm`&&(0,E.jsx)(n,{color:`warning`,children:`Cleaning up old npm installations...`}),o.type===`installing`&&(0,E.jsxs)(n,{color:`claude`,children:[`Installing Work Mate native build `,o.version,`...`]}),o.type===`setting-up`&&(0,E.jsx)(n,{color:`claude`,children:`Setting up launcher and shell integration...`}),o.type===`set-up`&&(0,E.jsx)(O,{messages:o.messages}),o.type===`success`&&(0,E.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,E.jsxs)(t,{children:[(0,E.jsx)(a,{status:`success`,withSpace:!0}),(0,E.jsx)(n,{color:`success`,bold:!0,children:`Work Mate successfully installed!`})]}),(0,E.jsxs)(t,{marginLeft:2,flexDirection:`column`,gap:1,children:[o.version!==`current`&&(0,E.jsxs)(t,{children:[(0,E.jsx)(n,{dimColor:!0,children:`Version: `}),(0,E.jsx)(n,{color:`claude`,children:o.version})]}),(0,E.jsxs)(t,{children:[(0,E.jsx)(n,{dimColor:!0,children:`Location: `}),(0,E.jsx)(n,{color:`text`,children:D()})]})]}),(0,E.jsx)(t,{marginLeft:2,flexDirection:`column`,gap:1,children:(0,E.jsxs)(t,{marginTop:1,children:[(0,E.jsx)(n,{dimColor:!0,children:`Next: Run `}),(0,E.jsx)(n,{color:`claude`,bold:!0,children:`claude --help`}),(0,E.jsx)(n,{dimColor:!0,children:` to get started`})]})}),o.setupMessages&&(0,E.jsx)(O,{messages:o.setupMessages})]}),o.type===`error`&&(0,E.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,E.jsxs)(t,{children:[(0,E.jsx)(a,{status:`error`,withSpace:!0}),(0,E.jsx)(n,{color:`error`,children:`Installation failed`})]}),(0,E.jsx)(n,{color:`error`,children:o.message}),(0,E.jsx)(t,{marginTop:1,children:(0,E.jsx)(n,{dimColor:!0,children:`Try running with --force to override checks`})})]})]})}var A={type:`local-jsx`,name:`install`,description:`安装 Work Mate 原生构建`,argumentHint:`[options]`,async call(e,t,n){let r=n.includes(`--force`),a=n.filter(e=>!e.startsWith(`--`))[0],{unmount:o}=await i((0,E.jsx)(k,{onDone:(t,n)=>{o(),e(t,n)},force:r,target:a}))}};export{A as install};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,ai as r,kn as i,s as a,t as o}from"./src-BX54x08P.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{Xt as c,m as l,qt as u,t as d,y as f}from"./settings-CA-5Px85.js";import{I as p,M as m,c as h,i as g}from"./debug-NBJH_NxR.js";import{n as _}from"./analytics-COpjZpvd.js";import{a as v,n as y,r as b,s as x,t as S}from"./nativeInstaller-BczAzL96.js";import{join as C}from"node:path";import{homedir as w}from"node:os";var T=e(r(),1);_(),o(),g(),c(),p(),S(),l();var E=s();function D(){let e=u.platform===`win32`,t=w();return e?C(t,`.local`,`bin`,`claude.exe`).replace(/\//g,`\\`):`~/.local/bin/claude`}function O({messages:e}){return e.length===0?null:(0,E.jsxs)(t,{flexDirection:`column`,gap:0,marginBottom:1,children:[(0,E.jsx)(t,{children:(0,E.jsxs)(n,{color:`warning`,children:[(0,E.jsx)(a,{status:`warning`,withSpace:!0}),`Setup notes:`]})}),e.map((e,r)=>(0,E.jsx)(t,{marginLeft:2,children:(0,E.jsxs)(n,{dimColor:!0,children:[`• `,e]})},r))]})}function k({onDone:e,force:r,target:i}){let[o,s]=(0,T.useState)({type:`checking`});return(0,T.useEffect)(()=>{async function e(){try{h(`Install: Starting installation process (force=${r}, target=${i})`);let e=i||d()?.autoUpdatesChannel||`latest`;s({type:`installing`,version:e}),h(`Install: Calling installLatest(channelOrVersion=${e}, forceReinstall=${r})`);let t=await x(e,r);if(h(`Install: installLatest returned version=${t.latestVersion}, wasUpdated=${t.wasUpdated}, lockFailed=${t.lockFailed}`),t.lockFailed)throw Error(`Could not install - another process is currently installing Work Mate. Please try again in a moment.`);t.latestVersion||h(`Install: Failed to retrieve version information during install`,{level:`error`}),t.wasUpdated||h(`Install: Already up to date`),s({type:`setting-up`});let n=await y(!0);h(`Install: Setup launcher completed with ${n.length} messages`),n.length>0&&n.forEach(e=>h(`Install: Setup message: ${e.message}`)),h(`Install: Cleaning up npm installations after successful install`);let{removed:a,errors:o,warnings:c}=await b();a>0&&h(`Cleaned up ${a} npm installation(s)`),o.length>0&&h(`Cleanup errors: ${o.join(`, `)}`);let l=await v();l.length>0&&h(`Shell alias cleanup: ${l.map(e=>e.message).join(`; `)}`),+!!t.latestVersion,(i===`latest`||i===`stable`)&&(f(`userSettings`,{autoUpdatesChannel:i}),h(`Install: Saved autoUpdatesChannel=${i} to user settings`));let u=[...c,...l.map(e=>e.message)];n.length>0?(s({type:`set-up`,messages:n.map(e=>e.message)}),setTimeout(s,2e3,{type:`success`,version:t.latestVersion||`current`,setupMessages:[...n.map(e=>e.message),...u]})):(h(`Install: Shell PATH already configured`),s({type:`success`,version:t.latestVersion||`current`,setupMessages:u.length>0?u:void 0}))}catch(e){h(`Install command failed: ${e}`,{level:`error`}),s({type:`error`,message:m(e)})}}e()},[r,i]),(0,T.useEffect)(()=>{o.type===`success`?setTimeout(e,2e3,`Work Mate installation completed successfully`,{display:`system`}):o.type===`error`&&setTimeout(e,3e3,`Work Mate installation failed`,{display:`system`})},[o,e]),(0,E.jsxs)(t,{flexDirection:`column`,marginTop:1,children:[o.type===`checking`&&(0,E.jsx)(n,{color:`claude`,children:`Checking installation status...`}),o.type===`cleaning-npm`&&(0,E.jsx)(n,{color:`warning`,children:`Cleaning up old npm installations...`}),o.type===`installing`&&(0,E.jsxs)(n,{color:`claude`,children:[`Installing Work Mate native build `,o.version,`...`]}),o.type===`setting-up`&&(0,E.jsx)(n,{color:`claude`,children:`Setting up launcher and shell integration...`}),o.type===`set-up`&&(0,E.jsx)(O,{messages:o.messages}),o.type===`success`&&(0,E.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,E.jsxs)(t,{children:[(0,E.jsx)(a,{status:`success`,withSpace:!0}),(0,E.jsx)(n,{color:`success`,bold:!0,children:`Work Mate successfully installed!`})]}),(0,E.jsxs)(t,{marginLeft:2,flexDirection:`column`,gap:1,children:[o.version!==`current`&&(0,E.jsxs)(t,{children:[(0,E.jsx)(n,{dimColor:!0,children:`Version: `}),(0,E.jsx)(n,{color:`claude`,children:o.version})]}),(0,E.jsxs)(t,{children:[(0,E.jsx)(n,{dimColor:!0,children:`Location: `}),(0,E.jsx)(n,{color:`text`,children:D()})]})]}),(0,E.jsx)(t,{marginLeft:2,flexDirection:`column`,gap:1,children:(0,E.jsxs)(t,{marginTop:1,children:[(0,E.jsx)(n,{dimColor:!0,children:`Next: Run `}),(0,E.jsx)(n,{color:`claude`,bold:!0,children:`claude --help`}),(0,E.jsx)(n,{dimColor:!0,children:` to get started`})]})}),o.setupMessages&&(0,E.jsx)(O,{messages:o.setupMessages})]}),o.type===`error`&&(0,E.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,E.jsxs)(t,{children:[(0,E.jsx)(a,{status:`error`,withSpace:!0}),(0,E.jsx)(n,{color:`error`,children:`Installation failed`})]}),(0,E.jsx)(n,{color:`error`,children:o.message}),(0,E.jsx)(t,{marginTop:1,children:(0,E.jsx)(n,{dimColor:!0,children:`Try running with --force to override checks`})})]})]})}var A={type:`local-jsx`,name:`install`,description:`安装 Work Mate 原生构建`,argumentHint:`[options]`,async call(e,t,n){let r=n.includes(`--force`),a=n.filter(e=>!e.startsWith(`--`))[0],{unmount:o}=await i((0,E.jsx)(k,{onDone:(t,n)=>{o(),e(t,n)},force:r,target:a}))}};export{A as install};