@readmagic/workmate 0.0.22 → 0.0.24

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 (395) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-DWgTWJ7R.js → AddWorkspaceDirectory-Ch8IcWXO.js} +1 -1
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-Cyia0s4g.js +1 -0
  3. package/dist/chunks/{AgentsMdExternalIncludesDialog-s0Orgord.js → AgentsMdExternalIncludesDialog-LjI_H_Au.js} +1 -1
  4. package/dist/chunks/App-BOqh_1tN.js +1 -0
  5. package/dist/chunks/BackgroundTasksDialog-CSEuuoq9.js +2 -0
  6. package/dist/chunks/{BypassPermissionsModeDialog-D2Gesf-u.js → BypassPermissionsModeDialog-CwfCwUr9.js} +1 -1
  7. package/dist/chunks/CustomSelect-wmZ9jz0W.js +1 -0
  8. package/dist/chunks/{DiffDialog-v2IiYyi3.js → DiffDialog-BpXIEWiE.js} +5 -5
  9. package/dist/chunks/Doctor-CMpr7tdf.js +1 -0
  10. package/dist/chunks/Doctor-DqW6j3_B.js +3 -0
  11. package/dist/chunks/{ExitFlow-BasHk1mk.js → ExitFlow-DacaBTlk.js} +2 -2
  12. package/dist/chunks/Grove-CNqYPWI6.js +11 -0
  13. package/dist/chunks/{InvalidConfigDialog-DYVQK5js.js → InvalidConfigDialog-0TMJItCC.js} +1 -1
  14. package/dist/chunks/{InvalidSettingsDialog-Dg6OiStR.js → InvalidSettingsDialog-iwh8H52b.js} +1 -1
  15. package/dist/chunks/{KeybindingProviderSetup-Bn1jzN5F.js → KeybindingProviderSetup-D49HHTXD.js} +1 -1
  16. package/dist/chunks/MCPConnectionManager-Cie77ZAK.js +1 -0
  17. package/dist/chunks/MCPToolListView-B4ehtkXd.js +1 -0
  18. package/dist/chunks/{McpParsingWarnings-DZejAh8b.js → McpParsingWarnings-Bff66RtJ.js} +1 -1
  19. package/dist/chunks/MessageSelector-Dpd6Iywp.js +3 -0
  20. package/dist/chunks/Messages-DN7M3oS_.js +10 -0
  21. package/dist/chunks/Onboarding-CQmE3rUf.js +1 -0
  22. package/dist/chunks/{PromptInputFooterSuggestions-lkr_A5jQ.js → PromptInputFooterSuggestions-HI6HH3TP.js} +1 -1
  23. package/dist/chunks/{PromptInputHelpMenu-DaQKKyM5.js → PromptInputHelpMenu-3QNUC2Cg.js} +1 -1
  24. package/dist/chunks/ProviderSetup-BCSPsvfv.js +1 -0
  25. package/dist/chunks/QueryEngine-DdLWvJv6.js +1 -0
  26. package/dist/chunks/REPL-BqO9KcK_.js +124 -0
  27. package/dist/chunks/REPL-CmZmypfF.js +1 -0
  28. package/dist/chunks/ResumeConversation-DBqX7gva.js +1 -0
  29. package/dist/chunks/SearchExtraToolsTool-BsSoILFj.js +1 -0
  30. package/dist/chunks/{SelectMulti-CNE06VAN.js → SelectMulti-BQRHed-d.js} +1 -1
  31. package/dist/chunks/Settings-B-7yBewS.js +3 -0
  32. package/dist/chunks/Spinner-ByQXTvAA.js +1 -0
  33. package/dist/chunks/{SpinnerGlyph-A6G-gloN.js → SpinnerGlyph-CmkRUvHe.js} +1 -1
  34. package/dist/chunks/{TextInput-7uqPhq9T.js → TextInput-B8ruWRf2.js} +5 -5
  35. package/dist/chunks/{ThemePicker-DT9zVy-0.js → ThemePicker-BQErFFW1.js} +1 -1
  36. package/dist/chunks/TrustDialog-BIhz6AZE.js +1 -0
  37. package/dist/chunks/{ValidationErrorsList-BLtP647v.js → ValidationErrorsList-DgNzJQUP.js} +1 -1
  38. package/dist/chunks/_baseEach-CsIRoaTH.js +1 -0
  39. package/dist/chunks/add-dir-CrUDs19x.js +1 -0
  40. package/dist/chunks/{agentDisplay-vLQHFrmq.js → agentDisplay-M4pfwbMC.js} +1 -1
  41. package/dist/chunks/agents-CGaCQeLw.js +101 -0
  42. package/dist/chunks/{agents-DLz0kfsr.js → agents-DddX7lLX.js} +1 -1
  43. package/dist/chunks/allErrors-BF73lon8.js +1 -0
  44. package/dist/chunks/{appleTerminalBackup-BYKdf3of.js → appleTerminalBackup-BArZWB21.js} +1 -1
  45. package/dist/chunks/backgroundHousekeeping-Bq3LMsVR.js +17 -0
  46. package/dist/chunks/backgroundHousekeeping-Cl3Ox7Qh.js +1 -0
  47. package/dist/chunks/banner-Cu2-XUek.js +2 -0
  48. package/dist/chunks/{bedrockClient-DxE_mHFI.js → bedrockClient-CfiDN-kF.js} +2 -2
  49. package/dist/chunks/branch-Yg_taNlT.js +2 -0
  50. package/dist/chunks/{break-cache-BL2gnDLX.js → break-cache-BMXqFTeS.js} +2 -2
  51. package/dist/chunks/btw-udbprVvu.js +1 -0
  52. package/dist/chunks/caches-ChjIEcdd.js +1 -0
  53. package/dist/chunks/caches-DLJ6urv-.js +1 -0
  54. package/dist/chunks/{claudeDesktop-D3PEgx3U.js → claudeDesktop-D8ml2767.js} +1 -1
  55. package/dist/chunks/{clear-CXfhVRp8.js → clear-B8ZtFPOK.js} +1 -1
  56. package/dist/chunks/{client-DdenNfkQ.js → client-4iqhC8xq.js} +1 -1
  57. package/dist/chunks/client-BiqbIkwr.js +1 -0
  58. package/dist/chunks/client-CZ8nyVh5.js +1 -0
  59. package/dist/chunks/{client-DvhWKIOx.js → client-CpTCeWba.js} +1 -1
  60. package/dist/chunks/commands-CVCpJo7M.js +1 -0
  61. package/dist/chunks/compact-izk6RKHQ.js +2 -0
  62. package/dist/chunks/config-C-Y2qtB2.js +3 -0
  63. package/dist/chunks/config-CFqpXMFX.js +1 -0
  64. package/dist/chunks/config-DD8fCYXn.js +1 -0
  65. package/dist/chunks/{context-3s9wtn4L.js → context-BbVm4SWK.js} +1 -1
  66. package/dist/chunks/{context-noninteractive-CJhUu_4y.js → context-noninteractive-C7wrRZnM.js} +5 -5
  67. package/dist/chunks/context-noninteractive-x0HAzWhc.js +1 -0
  68. package/dist/chunks/conversation-DouVzO0K.js +1 -0
  69. package/dist/chunks/conversation-DrVkifKy.js +1 -0
  70. package/dist/chunks/conversationRecovery-DliPBo_z.js +1 -0
  71. package/dist/chunks/crossProjectResume-DxMy05_P.js +40 -0
  72. package/dist/chunks/cwd-Dc3NV7s8.js +1 -0
  73. package/dist/chunks/cwd-Pa83R95t.js +1 -0
  74. package/dist/chunks/{datadog-v_mXWncN.js → datadog-Cu3s7P48.js} +1 -1
  75. package/dist/chunks/{debug-8DCufdSp.js → debug-Bglx1aTu.js} +5 -5
  76. package/dist/chunks/{detectRepository-DfX8xXw2.js → detectRepository-CfX8Lc0A.js} +1 -1
  77. package/dist/chunks/{diff-DJSt7QO6.js → diff-DdpHThJ7.js} +1 -1
  78. package/dist/chunks/{directoryCompletion-CT6YVeg7.js → directoryCompletion-D_Rtg-4j.js} +1 -1
  79. package/dist/chunks/dist-es-B3-7VFf2.js +1 -0
  80. package/dist/chunks/dist-es-B7j_mv242.js +1 -0
  81. package/dist/chunks/dist-es-BSKD_hOQ.js +1 -0
  82. package/dist/chunks/dist-es-BSRN-2nA.js +9 -0
  83. package/dist/chunks/{dist-es-yHGBqhBe.js → dist-es-BXXmyhQ2.js} +1 -1
  84. package/dist/chunks/{dist-es-C3reqy7X.js → dist-es-BaQndfvh2.js} +1 -1
  85. package/dist/chunks/dist-es-CzTYn7xo.js +1 -0
  86. package/dist/chunks/dist-es-DSkyibcN.js +1 -0
  87. package/dist/chunks/{dist-es-BOPBJQo3.js → dist-es-_UNJQniz.js} +1 -1
  88. package/dist/chunks/dist-es-hwK6468D.js +1 -0
  89. package/dist/chunks/dist-es-ovsdbtwh.js +1 -0
  90. package/dist/chunks/doctor-D_kV_D_l.js +1 -0
  91. package/dist/chunks/{entry-ex0-RyYV.js → entry-Bxseqbi_.js} +4 -4
  92. package/dist/chunks/{envUtils-DcaKZlRU.js → envUtils-DfkgIdYf.js} +1 -1
  93. package/dist/chunks/esm-BXTZz3av.js +1 -0
  94. package/dist/chunks/{execFileNoThrow-BsfuytkN.js → execFileNoThrow-BTachNBI.js} +1 -1
  95. package/dist/chunks/exit-C_R_FgzR.js +1 -0
  96. package/dist/chunks/extraUsage-xMuDiNKh.js +1 -0
  97. package/dist/chunks/extractMemories-D4Dl1itt.js +1 -0
  98. package/dist/chunks/fast-DH-C5IZs.js +1 -0
  99. package/dist/chunks/fast-bopOPrtf.js +1 -0
  100. package/dist/chunks/fetchModelList-DC4VQpqa.js +1 -0
  101. package/dist/chunks/fetchModelList-FE8tzTDc.js +1 -0
  102. package/dist/chunks/{fileSuggestions-B-SLfb-o.js → fileSuggestions-C-9unnoJ.js} +2 -2
  103. package/dist/chunks/firstPartyEventLogger-QmjjQmgt.js +3 -0
  104. package/dist/chunks/firstPartyEventLogger-lFeqhtfh.js +1 -0
  105. package/dist/chunks/{gemini-BC9kHhwe.js → gemini-C_ApXgwc.js} +2 -2
  106. package/dist/chunks/generateSessionName-CQ03xlYI.js +1 -0
  107. package/dist/chunks/{genericProcessUtils-BYi0OefF.js → genericProcessUtils-DwQFuna9.js} +1 -1
  108. package/dist/chunks/goal-CdL29Y8C.js +3 -0
  109. package/dist/chunks/grok-C6WAslUT.js +1 -0
  110. package/dist/chunks/grove-O6qp7ITR.js +1 -0
  111. package/dist/chunks/{help-CK90i4hE.js → help-DxanITNN.js} +1 -1
  112. package/dist/chunks/history-BMycjPTT.js +1 -0
  113. package/dist/chunks/hooks-D9ApLkBp.js +1 -0
  114. package/dist/chunks/{hooks-BRFDg9DV.js → hooks-DR3IYPJ3.js} +3 -3
  115. package/dist/chunks/{install-ZMll-dAa.js → install-0D9u2dZw.js} +1 -1
  116. package/dist/chunks/instrumentation-BFiGwntt.js +21 -0
  117. package/dist/chunks/{job-G_ukhLc4.js → job-YhJQWgE0.js} +1 -1
  118. package/dist/chunks/keybindings-DZrF9iNd.js +1 -0
  119. package/dist/chunks/{launchLocalMemory-BcRlXLm6.js → launchLocalMemory-DhJ56KDc.js} +2 -2
  120. package/dist/chunks/launchOnboarding-DmMoZwv5.js +8 -0
  121. package/dist/chunks/{loadAgentsDir-C1LkW7gl.js → loadAgentsDir-B0Anodo0.js} +540 -543
  122. package/dist/chunks/loadAgentsDir-BbUR6pqH.js +1 -0
  123. package/dist/chunks/loadPluginHooks-BSwCtQ6T.js +1 -0
  124. package/dist/chunks/{loader-C61fB6vU.js → loader-CICGtLp2.js} +1 -1
  125. package/dist/chunks/{localSearch-DFo_WTMm.js → localSearch-BxLYi6w_.js} +1 -1
  126. package/dist/chunks/localSearch-zfn7jgrh.js +1 -0
  127. package/dist/chunks/{log-DaILwWJa.js → log-D2TIwHBV.js} +1 -1
  128. package/dist/chunks/logoUtils-CRxTutvr.js +1 -0
  129. package/dist/chunks/{magicDocs-DYc9TFmI.js → magicDocs-Bkz7ZcmL.js} +3 -3
  130. package/dist/chunks/main-9ksgUUY_.js +345 -0
  131. package/dist/chunks/managedEnv-BEqrGqn1.js +1 -0
  132. package/dist/chunks/managedEnv-OPlzUPbJ.js +1 -0
  133. package/dist/chunks/mcp-ChF12reQ.js +1 -0
  134. package/dist/chunks/mcp-DoEl5uah.js +2 -0
  135. package/dist/chunks/mcp-hp9qqjAy.js +6 -0
  136. package/dist/chunks/memory-Qv-wGNQ5.js +1 -0
  137. package/dist/chunks/{mode-Pan-Q2c4.js → mode-bFXPCR2P.js} +2 -2
  138. package/dist/chunks/model-6lkW4o2c.js +1 -0
  139. package/dist/chunks/model-BvQFFOf8.js +1 -0
  140. package/dist/chunks/modelOptions-BBvF3wHK.js +1 -0
  141. package/dist/chunks/nativeInstaller-CdjmE9Zy.js +1 -0
  142. package/dist/chunks/notifications-Bc6k-Ozy.js +1 -0
  143. package/dist/chunks/onChangeAppState-DLjZ1x95.js +1 -0
  144. package/dist/chunks/openai-D46QvESE.js +2 -0
  145. package/dist/chunks/{overlayContext-CMV7nYR9.js → overlayContext-8--_fbvY.js} +1 -1
  146. package/dist/chunks/{panel-D9fGQgln.js → panel-CVS4SK_E.js} +1 -1
  147. package/dist/chunks/parser-CG5RuOCK.js +1 -0
  148. package/dist/chunks/{parser-D8slvrJP.js → parser-Cg6hSCmn.js} +1 -1
  149. package/dist/chunks/partition-DznN4XZH.js +1 -0
  150. package/dist/chunks/{pasteStore-DNV1M5Xd.js → pasteStore-P0zP-ch0.js} +1 -1
  151. package/dist/chunks/permissions-DmGFViHI.js +3 -0
  152. package/dist/chunks/pidLock-Cm4sW35f.js +3 -0
  153. package/dist/chunks/{plan-CQLnPLuE.js → plan-CzGBz_87.js} +1 -1
  154. package/dist/chunks/{platform-Dzff1WWw.js → platform-BacQ6ACS.js} +1 -1
  155. package/dist/chunks/plugin-CluR79xX.js +17 -0
  156. package/dist/chunks/{pluginAutoupdate-BJaAqwTH.js → pluginAutoupdate-ennb9k8_.js} +1 -1
  157. package/dist/chunks/pluginBlocklist-9OrNEh--.js +1 -0
  158. package/dist/chunks/pluginCliCommands-CJv5uhOG.js +1 -0
  159. package/dist/chunks/{pluginFlagging-DQP8tBi2.js → pluginFlagging-js_-WmYj.js} +1 -1
  160. package/dist/chunks/pluginOperations-CcUSHAIa.js +2 -0
  161. package/dist/chunks/pluginStartupCheck-CRBUO9gP.js +1 -0
  162. package/dist/chunks/{pluginStartupCheck-CfRvCrFg.js → pluginStartupCheck-SRXOyqr7.js} +1 -1
  163. package/dist/chunks/plugins-IwwaCDba.js +4 -0
  164. package/dist/chunks/{poorMode-J5SYJvoY.js → poorMode-B0QGV6Ci.js} +1 -1
  165. package/dist/chunks/poorMode-G-pnu6NM.js +1 -0
  166. package/dist/chunks/print-CgszM1ea.js +13 -0
  167. package/dist/chunks/processBashCommand-D098WsqY.js +1 -0
  168. package/dist/chunks/processSlashCommand-DOQFjJ88.js +5 -0
  169. package/dist/chunks/{projectContext-Bw3o5BrN.js → projectContext-5fmRr6Sd.js} +1 -1
  170. package/dist/chunks/{projectContext-BN2ZWzOG.js → projectContext-DhtjLv3k.js} +1 -1
  171. package/dist/chunks/{projectOnboardingState-CJycxw5P.js → projectOnboardingState-B5YATuc6.js} +1 -1
  172. package/dist/chunks/prompt-BKPmDAuL.js +1 -0
  173. package/dist/chunks/{prompt-BGqgPgCU.js → prompt-CJ1l3XXk.js} +1 -1
  174. package/dist/chunks/prompt-CgOklk7z.js +1 -0
  175. package/dist/chunks/{promptEditor-CmQ9p4oe.js → promptEditor-DoGHJN_W.js} +1 -1
  176. package/dist/chunks/{protocolHandler-CJo9-PfZ.js → protocolHandler-DjQALaU2.js} +1 -1
  177. package/dist/chunks/{proxy-CB17QimU.js → proxy-CDBfZjO7.js} +2 -2
  178. package/dist/chunks/reconciler-ykkSPR-i.js +1 -0
  179. package/dist/chunks/refresh-Dn_I1R4v.js +1 -0
  180. package/dist/chunks/{registerProtocol-CLIpzVwF.js → registerProtocol-CAsDme_E.js} +1 -1
  181. package/dist/chunks/reject-DtcCfuZV.js +1 -0
  182. package/dist/chunks/{reload-plugins-DjugL8jH.js → reload-plugins-CQZFQLWP.js} +1 -1
  183. package/dist/chunks/rename-DyEfsZiq.js +1 -0
  184. package/dist/chunks/{renderOptions-Zqfm2U1y.js → renderOptions-DV0dn0IW.js} +1 -1
  185. package/dist/chunks/resume-BcXEDUqZ.js +2 -0
  186. package/dist/chunks/ripgrep-DLs8MraF.js +1 -0
  187. package/dist/chunks/{ripgrep-BuzOTf1S.js → ripgrep-Dl3y5r4m.js} +1 -1
  188. package/dist/chunks/{runtimeObserver-CK_iZ6OB.js → runtimeObserver-DEuR8z0f.js} +1 -1
  189. package/dist/chunks/{runtimeObserver-CpP0L9T9.js → runtimeObserver-PJ1o8GRA.js} +4 -4
  190. package/dist/chunks/sandbox-adapter-DfB9kgQD.js +1 -0
  191. package/dist/chunks/{sandbox-toggle-KOHYvbQT.js → sandbox-toggle-D9GDUsTl.js} +1 -1
  192. package/dist/chunks/searchExtraTools-D4gMMQv0.js +1 -0
  193. package/dist/chunks/{select-C_KXmqbI.js → select-DIxfl_VN.js} +1 -1
  194. package/dist/chunks/sessionFileAccessHooks-lbgHnVvi.js +1 -0
  195. package/dist/chunks/{sessionObserver-WOYv2n7C.js → sessionObserver-BtKjvteq.js} +2 -2
  196. package/dist/chunks/sessionObserver-D6qzEdGJ.js +1 -0
  197. package/dist/chunks/sessionStorage-C_7gow_z.js +1 -0
  198. package/dist/chunks/sessionTracing-CtbeAD0s.js +11 -0
  199. package/dist/chunks/settings-B2jvL8Dp.js +24 -0
  200. package/dist/chunks/settings-CisDe8DB.js +1 -0
  201. package/dist/chunks/setup-qecdf-ES.js +3 -0
  202. package/dist/chunks/{shadowedRuleDetection-Df-kZ_pK.js → shadowedRuleDetection-Bg_aIc5Z.js} +1 -1
  203. package/dist/chunks/{sideQuestion-CMB8hfgX.js → sideQuestion-D49GsfH7.js} +3 -3
  204. package/dist/chunks/sinks-C-lP7uyO.js +1 -0
  205. package/dist/chunks/sinks-De-B1lPQ.js +1 -0
  206. package/dist/chunks/skillChangeDetector-DkOJoNhT.js +1 -0
  207. package/dist/chunks/{skillGapStore-CfmlO6pb.js → skillGapStore-CcFoHNLl.js} +2 -2
  208. package/dist/chunks/{skillLifecycle-BQ2LMfMx.js → skillLifecycle-Bnz_4wE5.js} +2 -2
  209. package/dist/chunks/{skillSearchPanel-BwYuwLFs.js → skillSearchPanel-C_5yUhqn.js} +2 -2
  210. package/dist/chunks/{skills-BVHPQma0.js → skills-BE5scC-g.js} +1 -1
  211. package/dist/chunks/startupProfiler-BH0FoI66.js +1 -0
  212. package/dist/chunks/{startupProfiler-DTs9w9EN.js → startupProfiler-CJdr3SxP.js} +2 -2
  213. package/dist/chunks/state-B4jiUise.js +1 -0
  214. package/dist/chunks/state-BhOKSFi5.js +1 -0
  215. package/dist/chunks/status-Dw09WZLd.js +1 -0
  216. package/dist/chunks/statusNoticeHelpers-BRQpUIlH.js +1 -0
  217. package/dist/chunks/{stringUtils-BQm3OfeJ.js → stringUtils-C718f5ey.js} +1 -1
  218. package/dist/chunks/sts-ei3CGBNu.js +1 -0
  219. package/dist/chunks/switcher-CgZVah7U.js +1 -0
  220. package/dist/chunks/{switcher-Bq1Ct_Sn.js → switcher-DZwUo5Ed.js} +1 -1
  221. package/dist/chunks/{tasks-0c8Uy04D.js → tasks-DdcUQEeD.js} +1 -1
  222. package/dist/chunks/{templateJobs-BdFzE9XG.js → templateJobs-C8qsPrLj.js} +1 -1
  223. package/dist/chunks/{terminalSetup-Cf_r6pwK.js → terminalSetup-B_10N_gE.js} +3 -3
  224. package/dist/chunks/{terminalSetup-D7J6bxcn.js → terminalSetup-qc2PlvOm.js} +1 -1
  225. package/dist/chunks/{theme-Bby4fssR.js → theme-f1h2QI8J.js} +1 -1
  226. package/dist/chunks/tipRegistry-B71o4qWr.js +2 -0
  227. package/dist/chunks/{toolEventObserver-CzFZUIsM.js → toolEventObserver-7QP38x4t.js} +1 -1
  228. package/dist/chunks/toolPool-V-7Yv0GA.js +1 -0
  229. package/dist/chunks/{types-zk5Ltv5q.js → types-Dx7P7JLQ.js} +2 -2
  230. package/dist/chunks/udsClient-cQz6nJ_T.js +1 -0
  231. package/dist/chunks/{use-select-navigation-DMaC_3iw.js → use-select-navigation-hWL5VHnL.js} +1 -1
  232. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-CjW3gUOt.js → useExitOnCtrlCDWithKeybindings-BKwzUpgb.js} +1 -1
  233. package/dist/chunks/useMainLoopModel-DxvV70Ru.js +1 -0
  234. package/dist/chunks/useManagePlugins-BXLXazrR.js +1 -0
  235. package/dist/chunks/useMergedTools-CCgnBJzO.js +1 -0
  236. package/dist/chunks/{useSearchInput-C2JuUW3g.js → useSearchInput-CzopttqC.js} +1 -1
  237. package/dist/chunks/useSettingsErrors-SFPWfxsA.js +1 -0
  238. package/dist/chunks/{util-Bq5l7FF5.js → util-Cbb3S6SX.js} +1 -1
  239. package/dist/chunks/validatePlugin-BMSoeb_b.js +1 -0
  240. package/dist/chunks/vim-CoRp9lY1.js +1 -0
  241. package/dist/chunks/worktree-Vm-SNY5x.js +1 -0
  242. package/dist/cli.js +1 -1
  243. package/package.json +1 -5
  244. package/dist/chunks/AgentsMdExternalIncludesDialog-DCvgQ6n3.js +0 -1
  245. package/dist/chunks/App-BcEI6U5j.js +0 -1
  246. package/dist/chunks/ApproveApiKey-DegdTXZl.js +0 -1
  247. package/dist/chunks/ApproveApiKey-_VXIMSwY.js +0 -1
  248. package/dist/chunks/BackgroundTasksDialog-CjBt1L0p.js +0 -2
  249. package/dist/chunks/CustomSelect-B46Eh0gU.js +0 -1
  250. package/dist/chunks/Doctor-BP0Rqraa.js +0 -1
  251. package/dist/chunks/Doctor-By_y3C2V.js +0 -3
  252. package/dist/chunks/Grove-C3mhgshv.js +0 -11
  253. package/dist/chunks/MCPConnectionManager-ChN4Ayjk.js +0 -1
  254. package/dist/chunks/MCPToolListView-DLSrQHDc.js +0 -1
  255. package/dist/chunks/MessageSelector-CdDlJE48.js +0 -3
  256. package/dist/chunks/Messages-DuL_r1Or.js +0 -10
  257. package/dist/chunks/Onboarding-CE2GNA-h.js +0 -1
  258. package/dist/chunks/QueryEngine-DNNy1UCD.js +0 -1
  259. package/dist/chunks/REPL-CEhW-C41.js +0 -1
  260. package/dist/chunks/REPL-CkSL4C_8.js +0 -124
  261. package/dist/chunks/ResumeConversation-BMCO_3X7.js +0 -1
  262. package/dist/chunks/SearchExtraToolsTool-DSy_jDhf.js +0 -1
  263. package/dist/chunks/Settings-mDykHLok.js +0 -2
  264. package/dist/chunks/Spinner-DwsJJUtn.js +0 -1
  265. package/dist/chunks/TrustDialog-G4jM9IfM.js +0 -1
  266. package/dist/chunks/add-dir-7RfQAC3h.js +0 -1
  267. package/dist/chunks/agents-BNg_skSm.js +0 -101
  268. package/dist/chunks/allErrors-DaztSMrw.js +0 -1
  269. package/dist/chunks/auth-BTB00dq5.js +0 -10
  270. package/dist/chunks/auth-Bbc0Ny8i.js +0 -1
  271. package/dist/chunks/backgroundHousekeeping-DYz83_8C.js +0 -1
  272. package/dist/chunks/backgroundHousekeeping-bEZtlJSf.js +0 -17
  273. package/dist/chunks/banner-mqZEluky.js +0 -2
  274. package/dist/chunks/branch-exFKkymg.js +0 -2
  275. package/dist/chunks/btw-3l78DYET.js +0 -1
  276. package/dist/chunks/caches-6Nx6tsk9.js +0 -1
  277. package/dist/chunks/caches-ouaWB9bY.js +0 -1
  278. package/dist/chunks/client-C01Bnxxv.js +0 -1
  279. package/dist/chunks/client-DYRgRQsr.js +0 -1
  280. package/dist/chunks/commands-BoxOw75F.js +0 -1
  281. package/dist/chunks/compact-BOYr105K.js +0 -2
  282. package/dist/chunks/config-BddEvZZl.js +0 -3
  283. package/dist/chunks/config-GEv9hUzz.js +0 -1
  284. package/dist/chunks/config-kw4xg7Nk.js +0 -1
  285. package/dist/chunks/context-noninteractive-DFvoZ2L9.js +0 -1
  286. package/dist/chunks/conversation-CoGharlH.js +0 -1
  287. package/dist/chunks/conversation-MxEVm54C.js +0 -1
  288. package/dist/chunks/conversationRecovery-Da_8uldZ.js +0 -1
  289. package/dist/chunks/crossProjectResume-CzPCHq_K.js +0 -40
  290. package/dist/chunks/cwd-BcO6WHKo.js +0 -1
  291. package/dist/chunks/cwd-CDUelriw.js +0 -1
  292. package/dist/chunks/dist-es-5t7v8oaj.js +0 -1
  293. package/dist/chunks/dist-es-BIjDeceU.js +0 -1
  294. package/dist/chunks/dist-es-C-OjW2Ao.js +0 -1
  295. package/dist/chunks/dist-es-CEk66gUu.js +0 -1
  296. package/dist/chunks/dist-es-CIULjvtA2.js +0 -1
  297. package/dist/chunks/dist-es-CMtO44xC.js +0 -1
  298. package/dist/chunks/dist-es-CYPVg66r.js +0 -9
  299. package/dist/chunks/dist-es-D1Y8zSMI.js +0 -1
  300. package/dist/chunks/dist-es-Gt_DpXlP.js +0 -1
  301. package/dist/chunks/dist-es-kj-F5A132.js +0 -1
  302. package/dist/chunks/doctor-DWvioSU9.js +0 -1
  303. package/dist/chunks/esm-BQY8jJNR.js +0 -1
  304. package/dist/chunks/exit-BxC_ZEtO.js +0 -1
  305. package/dist/chunks/extraUsage-DYm33Occ.js +0 -1
  306. package/dist/chunks/extractMemories-CzN3Ax2B.js +0 -1
  307. package/dist/chunks/fast-DqUpl_Lr.js +0 -1
  308. package/dist/chunks/fast-NUdUyAaM.js +0 -1
  309. package/dist/chunks/fetchModelList-CqsTAWEN.js +0 -1
  310. package/dist/chunks/fetchModelList-DBMHE6Ng.js +0 -1
  311. package/dist/chunks/firstPartyEventLogger-C0q45h_4.js +0 -3
  312. package/dist/chunks/firstPartyEventLogger-CP8hCBDj.js +0 -1
  313. package/dist/chunks/generateSessionName-ChvKBVxB.js +0 -1
  314. package/dist/chunks/goal-ByyimpVU.js +0 -3
  315. package/dist/chunks/grok-DenjixMl.js +0 -1
  316. package/dist/chunks/grove-Dq8QbQ9o.js +0 -7
  317. package/dist/chunks/history-CNQNd6hT.js +0 -1
  318. package/dist/chunks/hooks-BaYwmkxD.js +0 -1
  319. package/dist/chunks/instrumentation-BwVyvRfY.js +0 -21
  320. package/dist/chunks/keybindings-wNxBzDVQ.js +0 -1
  321. package/dist/chunks/launchOnboarding-CDjQ64RO.js +0 -8
  322. package/dist/chunks/loadAgentsDir-DKXap_Om.js +0 -1
  323. package/dist/chunks/loadPluginHooks-DtmHtEiS.js +0 -1
  324. package/dist/chunks/localSearch-BB9x5C2N.js +0 -1
  325. package/dist/chunks/logoUtils-Dj_2SWmO.js +0 -1
  326. package/dist/chunks/main-BRg8L_aw.js +0 -346
  327. package/dist/chunks/managedEnv-DsqAYOJ4.js +0 -1
  328. package/dist/chunks/managedEnv-lybrMred.js +0 -1
  329. package/dist/chunks/mcp-Bsw3cMiJ.js +0 -6
  330. package/dist/chunks/mcp-DDdud6Y7.js +0 -1
  331. package/dist/chunks/mcp-DbgTDUt7.js +0 -2
  332. package/dist/chunks/memory-CzwTzihf.js +0 -1
  333. package/dist/chunks/model-BYfmXKHf.js +0 -1
  334. package/dist/chunks/model-BwBE0Pt5.js +0 -1
  335. package/dist/chunks/modelOptions-DvNBapgG.js +0 -1
  336. package/dist/chunks/nativeInstaller-DnSNJWIi.js +0 -1
  337. package/dist/chunks/notifications-B0DTaYoy.js +0 -1
  338. package/dist/chunks/omit-Dl1Us_PY.js +0 -1
  339. package/dist/chunks/onChangeAppState-4KOJMN82.js +0 -1
  340. package/dist/chunks/openai-C_6C1_0N.js +0 -10
  341. package/dist/chunks/parser-BKAVMTyD.js +0 -1
  342. package/dist/chunks/partition-B504IgAa.js +0 -1
  343. package/dist/chunks/permissions-CLFMhdRk.js +0 -3
  344. package/dist/chunks/pidLock-D9do1Afy.js +0 -3
  345. package/dist/chunks/plugin-BYdF7uob.js +0 -17
  346. package/dist/chunks/pluginBlocklist-DKKmOnWM.js +0 -1
  347. package/dist/chunks/pluginCliCommands-z8TtJMKH.js +0 -1
  348. package/dist/chunks/pluginOperations-BcfJCDco.js +0 -2
  349. package/dist/chunks/pluginStartupCheck-Cq4PvULa.js +0 -1
  350. package/dist/chunks/plugins-CTM8jpOw.js +0 -4
  351. package/dist/chunks/policyLimits-a7ix6GnU.js +0 -1
  352. package/dist/chunks/poorMode-C11JEH3d.js +0 -1
  353. package/dist/chunks/print-u6MzL5Cr.js +0 -13
  354. package/dist/chunks/processBashCommand-DIwrI2QC.js +0 -1
  355. package/dist/chunks/processSlashCommand-B-Gujpxm.js +0 -5
  356. package/dist/chunks/prompt-BPJDGlx5.js +0 -1
  357. package/dist/chunks/prompt-DEdZzkEz.js +0 -1
  358. package/dist/chunks/reconciler-DSKLuOS7.js +0 -1
  359. package/dist/chunks/refresh-BbZFCNpn.js +0 -1
  360. package/dist/chunks/rename-DOtCOtEr.js +0 -1
  361. package/dist/chunks/resume-BB4T4WIV.js +0 -2
  362. package/dist/chunks/ripgrep-CZ2CqaHb.js +0 -1
  363. package/dist/chunks/sandbox-adapter-DhJJ6WOV.js +0 -1
  364. package/dist/chunks/searchExtraTools-CdJghGkj.js +0 -1
  365. package/dist/chunks/sessionFileAccessHooks-D7KbWFp7.js +0 -1
  366. package/dist/chunks/sessionObserver-DB-sLv-X.js +0 -1
  367. package/dist/chunks/sessionStorage-sgOAbDn7.js +0 -1
  368. package/dist/chunks/sessionTracing-yBre24PH.js +0 -11
  369. package/dist/chunks/settings-C-KNkvsM.js +0 -1
  370. package/dist/chunks/settings-DKN4xSpQ.js +0 -24
  371. package/dist/chunks/setup-CN_Pk7AR.js +0 -3
  372. package/dist/chunks/sinks-BS17vtN0.js +0 -1
  373. package/dist/chunks/sinks-D1EjkHb4.js +0 -1
  374. package/dist/chunks/skillChangeDetector-CBKuGuEi.js +0 -1
  375. package/dist/chunks/startupProfiler-B_U4QDtf.js +0 -1
  376. package/dist/chunks/state-BowF111d.js +0 -1
  377. package/dist/chunks/state-CGuyDES7.js +0 -1
  378. package/dist/chunks/status-BurdTfyz.js +0 -2
  379. package/dist/chunks/status-DMq1An5h.js +0 -1
  380. package/dist/chunks/statusNoticeHelpers-X75JNlx5.js +0 -1
  381. package/dist/chunks/sts-C2Gf2WYN.js +0 -1
  382. package/dist/chunks/switcher-DGD4ORVf.js +0 -1
  383. package/dist/chunks/tipRegistry-CyRXWWTz.js +0 -2
  384. package/dist/chunks/toolPool-CnrZcprA.js +0 -1
  385. package/dist/chunks/udsClient-ftP0yIpe.js +0 -1
  386. package/dist/chunks/useMainLoopModel-DWscpA9I.js +0 -1
  387. package/dist/chunks/useManagePlugins-CYXVcql2.js +0 -1
  388. package/dist/chunks/useMergedTools-DarmnCEw.js +0 -1
  389. package/dist/chunks/useSettingsErrors-DutJBiKZ.js +0 -1
  390. package/dist/chunks/validatePlugin-DIdEydz_.js +0 -1
  391. package/dist/chunks/vim-D8prM2IH.js +0 -1
  392. package/dist/chunks/worktree-Caqt2WRZ.js +0 -1
  393. /package/dist/chunks/{dist-es-Cgsa8pb82.js → dist-es-Cgsa8pb8.js} +0 -0
  394. /package/dist/chunks/{dist-es-Cwru7c2B2.js → dist-es-Cwru7c2B.js} +0 -0
  395. /package/dist/chunks/{dist-es-DXIR5NLi2.js → dist-es-DXIR5NLi.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./classPrivateFieldSet2-D4U5K-I3.js";import{n as f,t as p}from"./classPrivateMethodInitSpec-BXQD0Vh4.js";import{C as m,v as h,x as g,y as ee}from"./debug-8DCufdSp.js";import{o as _,s as te}from"./log-DaILwWJa.js";import{open as v,readFile as ne,stat as y}from"fs/promises";import{channel as b,tracingChannel as re}from"node:diagnostics_channel";function x(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}function S(e){return e&&Object.assign(le,e),le}var ie,ae,oe,se,ce,le,ue=e((()=>{ae=Object.freeze({status:`aborted`}),oe=Symbol(`zod_brand`),se=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ce=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},(ie=globalThis).__zod_globalConfig??(ie.__zod_globalConfig={}),le=globalThis.__zod_globalConfig})),de=t({BIGINT_FORMAT_RANGES:()=>ht,Class:()=>gt,NUMBER_FORMAT_RANGES:()=>mt,aborted:()=>qe,allowsEval:()=>ut,assert:()=>ge,assertEqual:()=>fe,assertIs:()=>me,assertNever:()=>he,assertNotEqual:()=>pe,assignProp:()=>we,base64ToUint8Array:()=>nt,base64urlToUint8Array:()=>it,cached:()=>ye,captureStackTrace:()=>lt,cleanEnum:()=>tt,cleanRegex:()=>xe,clone:()=>Le,cloneDef:()=>Ee,createTransparentProxy:()=>Re,defineLazy:()=>w,esc:()=>Ae,escapeRegex:()=>Ie,explicitlyAborted:()=>Je,extend:()=>He,finalizeIssue:()=>Ze,floatSafeRemainder:()=>Se,getElementAtPath:()=>De,getEnumValues:()=>_e,getLengthableOrigin:()=>$e,getParsedType:()=>dt,getSizableOrigin:()=>Qe,hexToUint8Array:()=>ot,isObject:()=>Me,isPlainObject:()=>Ne,issue:()=>et,joinValues:()=>C,jsonStringifyReplacer:()=>ve,merge:()=>We,mergeDefs:()=>Te,normalizeParams:()=>T,nullish:()=>be,numKeys:()=>Fe,objectClone:()=>Ce,omit:()=>Ve,optionalKeys:()=>ze,parsedType:()=>D,partial:()=>Ge,pick:()=>Be,prefixIssues:()=>Ye,primitiveTypes:()=>pt,promiseAllObject:()=>Oe,propertyKeyTypes:()=>ft,randomString:()=>ke,required:()=>Ke,safeExtend:()=>Ue,shallowClone:()=>Pe,slugify:()=>je,stringifyPrimitive:()=>E,uint8ArrayToBase64:()=>rt,uint8ArrayToBase64url:()=>at,uint8ArrayToHex:()=>st,unwrapMessage:()=>Xe});function fe(e){return e}function pe(e){return e}function me(e){}function he(e){throw Error(`Unexpected value in exhaustive check`)}function ge(e){}function _e(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function C(e,t=`|`){return e.map(e=>E(e)).join(t)}function ve(e,t){return typeof t==`bigint`?t.toString():t}function ye(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function be(e){return e==null}function xe(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Se(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function w(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ct)return r===void 0&&(r=ct,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ce(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function we(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Te(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ee(e){return Te(e._zod.def)}function De(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function Oe(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function ke(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function Ae(e){return JSON.stringify(e)}function je(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}function Me(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ne(e){if(Me(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Me(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Pe(e){return Ne(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Fe(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function Ie(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Le(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function T(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Re(e){let t;return new Proxy({},{get(n,r,i){return t??(t=e()),Reflect.get(t,r,i)},set(n,r,i,a){return t??(t=e()),Reflect.set(t,r,i,a)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??(t=e()),Reflect.defineProperty(t,r,i)}})}function E(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ze(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function Be(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Le(e,Te(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return we(this,`shape`,e),e},checks:[]}))}function Ve(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Le(e,Te(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return we(this,`shape`,r),r},checks:[]}))}function He(e,t){if(!Ne(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Le(e,Te(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return we(this,`shape`,n),n}}))}function Ue(e,t){if(!Ne(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Le(e,Te(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return we(this,`shape`,n),n}}))}function We(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return Le(e,Te(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return we(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ge(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Le(t,Te(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return we(this,`shape`,i),i},checks:[]}))}function Ke(e,t,n){return Le(t,Te(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return we(this,`shape`,i),i}}))}function qe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Je(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Ye(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Xe(e){return typeof e==`string`?e:e?.message}function Ze(e,t,n){let r=e.message?e.message:Xe(e.inst?._zod.def?.error?.(e))??Xe(t?.error?.(e))??Xe(n.customError?.(e))??Xe(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??(s.path=[]),s.message=r,t?.reportInput&&(s.input=o),s}function Qe(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function $e(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function D(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function et(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function tt(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function nt(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function rt(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function it(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return nt(t+`=`.repeat((4-t.length%4)%4))}function at(e){return rt(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function ot(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function st(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var ct,lt,ut,dt,ft,pt,mt,ht,gt,O=e((()=>{ue(),ct=Symbol(`evaluating`),lt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{},ut=ye(()=>{if(le.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),dt=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},ft=new Set([`string`,`number`,`symbol`]),pt=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]),mt={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ht={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]},gt=class{constructor(...e){}}}));function _t(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function vt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}function yt(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},[...i,...s.path]));else if(s.code===`invalid_key`)r({issues:s.issues},[...i,...s.path]);else if(s.code===`invalid_element`)r({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??(r.properties={}),(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??(r.items=[]),(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}};return r(e),n}function bt(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function xt(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${bt(e.path)}`);return t.join(`
1
+ import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./classPrivateFieldSet2-D4U5K-I3.js";import{n as f,t as p}from"./classPrivateMethodInitSpec-BXQD0Vh4.js";import{C as m,v as h,x as g,y as ee}from"./debug-Bglx1aTu.js";import{o as _,s as te}from"./log-D2TIwHBV.js";import{open as v,readFile as ne,stat as y}from"fs/promises";import{channel as b,tracingChannel as re}from"node:diagnostics_channel";function x(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}function S(e){return e&&Object.assign(le,e),le}var ie,ae,oe,se,ce,le,ue=e((()=>{ae=Object.freeze({status:`aborted`}),oe=Symbol(`zod_brand`),se=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ce=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},(ie=globalThis).__zod_globalConfig??(ie.__zod_globalConfig={}),le=globalThis.__zod_globalConfig})),de=t({BIGINT_FORMAT_RANGES:()=>ht,Class:()=>gt,NUMBER_FORMAT_RANGES:()=>mt,aborted:()=>qe,allowsEval:()=>ut,assert:()=>ge,assertEqual:()=>fe,assertIs:()=>me,assertNever:()=>he,assertNotEqual:()=>pe,assignProp:()=>we,base64ToUint8Array:()=>nt,base64urlToUint8Array:()=>it,cached:()=>ye,captureStackTrace:()=>lt,cleanEnum:()=>tt,cleanRegex:()=>xe,clone:()=>Le,cloneDef:()=>Ee,createTransparentProxy:()=>Re,defineLazy:()=>w,esc:()=>Ae,escapeRegex:()=>Ie,explicitlyAborted:()=>Je,extend:()=>He,finalizeIssue:()=>Ze,floatSafeRemainder:()=>Se,getElementAtPath:()=>De,getEnumValues:()=>_e,getLengthableOrigin:()=>$e,getParsedType:()=>dt,getSizableOrigin:()=>Qe,hexToUint8Array:()=>ot,isObject:()=>Me,isPlainObject:()=>Ne,issue:()=>et,joinValues:()=>C,jsonStringifyReplacer:()=>ve,merge:()=>We,mergeDefs:()=>Te,normalizeParams:()=>T,nullish:()=>be,numKeys:()=>Fe,objectClone:()=>Ce,omit:()=>Ve,optionalKeys:()=>ze,parsedType:()=>D,partial:()=>Ge,pick:()=>Be,prefixIssues:()=>Ye,primitiveTypes:()=>pt,promiseAllObject:()=>Oe,propertyKeyTypes:()=>ft,randomString:()=>ke,required:()=>Ke,safeExtend:()=>Ue,shallowClone:()=>Pe,slugify:()=>je,stringifyPrimitive:()=>E,uint8ArrayToBase64:()=>rt,uint8ArrayToBase64url:()=>at,uint8ArrayToHex:()=>st,unwrapMessage:()=>Xe});function fe(e){return e}function pe(e){return e}function me(e){}function he(e){throw Error(`Unexpected value in exhaustive check`)}function ge(e){}function _e(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function C(e,t=`|`){return e.map(e=>E(e)).join(t)}function ve(e,t){return typeof t==`bigint`?t.toString():t}function ye(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function be(e){return e==null}function xe(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Se(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function w(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ct)return r===void 0&&(r=ct,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ce(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function we(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Te(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ee(e){return Te(e._zod.def)}function De(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function Oe(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function ke(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function Ae(e){return JSON.stringify(e)}function je(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}function Me(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ne(e){if(Me(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Me(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Pe(e){return Ne(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Fe(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function Ie(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Le(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function T(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Re(e){let t;return new Proxy({},{get(n,r,i){return t??(t=e()),Reflect.get(t,r,i)},set(n,r,i,a){return t??(t=e()),Reflect.set(t,r,i,a)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??(t=e()),Reflect.defineProperty(t,r,i)}})}function E(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ze(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function Be(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Le(e,Te(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return we(this,`shape`,e),e},checks:[]}))}function Ve(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Le(e,Te(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return we(this,`shape`,r),r},checks:[]}))}function He(e,t){if(!Ne(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Le(e,Te(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return we(this,`shape`,n),n}}))}function Ue(e,t){if(!Ne(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Le(e,Te(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return we(this,`shape`,n),n}}))}function We(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return Le(e,Te(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return we(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ge(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Le(t,Te(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return we(this,`shape`,i),i},checks:[]}))}function Ke(e,t,n){return Le(t,Te(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return we(this,`shape`,i),i}}))}function qe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Je(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Ye(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Xe(e){return typeof e==`string`?e:e?.message}function Ze(e,t,n){let r=e.message?e.message:Xe(e.inst?._zod.def?.error?.(e))??Xe(t?.error?.(e))??Xe(n.customError?.(e))??Xe(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??(s.path=[]),s.message=r,t?.reportInput&&(s.input=o),s}function Qe(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function $e(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function D(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function et(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function tt(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function nt(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function rt(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function it(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return nt(t+`=`.repeat((4-t.length%4)%4))}function at(e){return rt(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function ot(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function st(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var ct,lt,ut,dt,ft,pt,mt,ht,gt,O=e((()=>{ue(),ct=Symbol(`evaluating`),lt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{},ut=ye(()=>{if(le.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),dt=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},ft=new Set([`string`,`number`,`symbol`]),pt=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]),mt={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ht={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]},gt=class{constructor(...e){}}}));function _t(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function vt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}function yt(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},[...i,...s.path]));else if(s.code===`invalid_key`)r({issues:s.issues},[...i,...s.path]);else if(s.code===`invalid_element`)r({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??(r.properties={}),(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??(r.items=[]),(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}};return r(e),n}function bt(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function xt(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${bt(e.path)}`);return t.join(`
2
2
  `)}var St,Ct,k,wt=e((()=>{ue(),O(),St=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ve,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ct=x(`$ZodError`,St),k=x(`$ZodError`,St,{Parent:Error})})),Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt=e((()=>{ue(),wt(),O(),Tt=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new se;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Ze(e,a,S())));throw lt(t,i?.callee),t}return o.value},Et=Tt(k),Dt=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Ze(e,a,S())));throw lt(t,i?.callee),t}return o.value},Ot=Dt(k),kt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new se;return a.issues.length?{success:!1,error:new(e??Ct)(a.issues.map(e=>Ze(e,i,S())))}:{success:!0,data:a.value}},At=kt(k),jt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Ze(e,i,S())))}:{success:!0,data:a.value}},Mt=jt(k),Nt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Tt(e)(t,n,i)},Pt=Nt(k),Ft=e=>(t,n,r)=>Tt(e)(t,n,r),It=Ft(k),Lt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Dt(e)(t,n,i)},Rt=Lt(k),zt=e=>async(t,n,r)=>Dt(e)(t,n,r),Bt=zt(k),Vt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return kt(e)(t,n,i)},Ht=Vt(k),Ut=e=>(t,n,r)=>kt(e)(t,n,r),Wt=Ut(k),Gt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return jt(e)(t,n,i)},Kt=Gt(k),qt=e=>async(t,n,r)=>jt(e)(t,n,r),Jt=qt(k)})),Xt=t({base64:()=>kn,base64url:()=>An,bigint:()=>Rn,boolean:()=>Vn,browserEmail:()=>Sn,cidrv4:()=>Dn,cidrv6:()=>On,cuid:()=>rn,cuid2:()=>an,date:()=>In,datetime:()=>en,domain:()=>Mn,duration:()=>un,e164:()=>Pn,email:()=>_n,emoji:()=>Zt,extendedDuration:()=>dn,guid:()=>fn,hex:()=>Kn,hostname:()=>jn,html5Email:()=>vn,httpProtocol:()=>Nn,idnEmail:()=>xn,integer:()=>zn,ipv4:()=>wn,ipv6:()=>Tn,ksuid:()=>cn,lowercase:()=>Wn,mac:()=>En,md5_base64:()=>Jn,md5_base64url:()=>Yn,md5_hex:()=>qn,nanoid:()=>ln,null:()=>Hn,number:()=>Bn,rfc5322Email:()=>yn,sha1_base64:()=>Zn,sha1_base64url:()=>Qn,sha1_hex:()=>Xn,sha256_base64:()=>er,sha256_base64url:()=>tr,sha256_hex:()=>$n,sha384_base64:()=>rr,sha384_base64url:()=>ir,sha384_hex:()=>nr,sha512_base64:()=>or,sha512_base64url:()=>sr,sha512_hex:()=>ar,string:()=>Ln,time:()=>$t,ulid:()=>on,undefined:()=>Un,unicodeEmail:()=>bn,uppercase:()=>Gn,uuid:()=>pn,uuid4:()=>mn,uuid6:()=>hn,uuid7:()=>gn,xid:()=>sn});function Zt(){return new RegExp(Cn,`u`)}function Qt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function $t(e){return RegExp(`^${Qt(e)}$`)}function en(e){let t=Qt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Fn}T(?:${r})$`)}function tn(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function nn(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var rn,an,on,sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,cr=e((()=>{O(),rn=/^[cC][0-9a-z]{6,}$/,an=/^[0-9a-z]+$/,on=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,sn=/^[0-9a-vA-V]{20}$/,cn=/^[A-Za-z0-9]{27}$/,ln=/^[a-zA-Z0-9_-]{21}$/,un=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,fn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,pn=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,mn=pn(4),hn=pn(6),gn=pn(7),_n=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,vn=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,yn=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,bn=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,xn=bn,Sn=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Cn=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,wn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Tn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,En=e=>{let t=Ie(e??`:`);return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Dn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,On=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,kn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,An=/^[A-Za-z0-9_-]*$/,jn=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Mn=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Nn=/^https?$/,Pn=/^\+[1-9]\d{6,14}$/,Fn=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,In=RegExp(`^${Fn}$`),Ln=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Rn=/^-?\d+n?$/,zn=/^-?\d+$/,Bn=/^-?\d+(?:\.\d+)?$/,Vn=/^(?:true|false)$/i,Hn=/^null$/i,Un=/^undefined$/i,Wn=/^[^A-Z]*$/,Gn=/^[^a-z]*$/,Kn=/^[0-9a-fA-F]*$/,qn=/^[0-9a-fA-F]{32}$/,Jn=tn(22,`==`),Yn=nn(22),Xn=/^[0-9a-fA-F]{40}$/,Zn=tn(27,`=`),Qn=nn(27),$n=/^[0-9a-fA-F]{64}$/,er=tn(43,`=`),tr=nn(43),nr=/^[0-9a-fA-F]{96}$/,rr=tn(64,``),ir=nn(64),ar=/^[0-9a-fA-F]{128}$/,or=tn(86,`==`),sr=nn(86)}));function lr(e,t,n){e.issues.length&&t.issues.push(...Ye(n,e.issues))}var A,ur,dr,fr,pr,mr,hr,gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr=e((()=>{ue(),cr(),O(),A=x(`$ZodCheck`,(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ur={number:`number`,bigint:`bigint`,object:`date`},dr=x(`$ZodCheckLessThan`,(e,t)=>{A.init(e,t);let n=ur[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fr=x(`$ZodCheckGreaterThan`,(e,t)=>{A.init(e,t);let n=ur[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),pr=x(`$ZodCheckMultipleOf`,(e,t)=>{A.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Se(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),mr=x(`$ZodCheckNumberFormat`,(e,t)=>{A.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=mt[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=zn)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),hr=x(`$ZodCheckBigIntFormat`,(e,t)=>{A.init(e,t);let[n,r]=ht[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),gr=x(`$ZodCheckMaxSize`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!be(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:Qe(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),_r=x(`$ZodCheckMinSize`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!be(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:Qe(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),vr=x(`$ZodCheckSizeEquals`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!be(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:Qe(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),yr=x(`$ZodCheckMaxLength`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!be(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=$e(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),br=x(`$ZodCheckMinLength`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!be(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=$e(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),xr=x(`$ZodCheckLengthEquals`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!be(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=$e(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Sr=x(`$ZodCheckStringFormat`,(e,t)=>{var n,r;A.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Cr=x(`$ZodCheckRegex`,(e,t)=>{Sr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),wr=x(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??(t.pattern=Wn),Sr.init(e,t)}),Tr=x(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??(t.pattern=Gn),Sr.init(e,t)}),Er=x(`$ZodCheckIncludes`,(e,t)=>{A.init(e,t);let n=Ie(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Dr=x(`$ZodCheckStartsWith`,(e,t)=>{A.init(e,t);let n=RegExp(`^${Ie(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Or=x(`$ZodCheckEndsWith`,(e,t)=>{A.init(e,t);let n=RegExp(`.*${Ie(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),kr=x(`$ZodCheckProperty`,(e,t)=>{A.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>lr(n,e,t.property));lr(n,e,t.property)}}),Ar=x(`$ZodCheckMimeType`,(e,t)=>{A.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),jr=x(`$ZodCheckOverwrite`,(e,t)=>{A.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})})),Nr,Pr=e((()=>{Nr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
3
3
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
4
4
  `))}}})),Fr,Ir=e((()=>{Fr={major:4,minor:4,patch:3}}));function Lr(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}function Rr(e){if(!An.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Lr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}function zr(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}function Br(e,t,n){e.issues.length&&t.issues.push(...Ye(n,e.issues)),t.value[n]=e.value}function Vr(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Ye(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Hr(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=ze(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Ur(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Vr(e,n,i,t,u,d))):Vr(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}function Wr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!qe(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Ze(e,r,S())))}),t)}function Gr(e,t,n,r){let i=e.filter(e=>e.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Ze(e,r,S())))}):t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:[],inclusive:!1}),t)}function Kr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ne(e)&&Ne(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Kr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Kr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function qr(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??(i=n);for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),qe(e))return e;let o=Kr(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}function Jr(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function Yr(e,t,n){e.issues.length&&t.issues.push(...Ye(n,e.issues)),t.value[n]=e.value}function Xr(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...Ye(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}function Zr(e,t,n,r,i,a,o){e.issues.length&&(ft.has(typeof r)?n.issues.push(...Ye(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:a,issues:e.issues.map(e=>Ze(e,o,S()))})),t.issues.length&&(ft.has(typeof r)?n.issues.push(...Ye(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>Ze(e,o,S()))})),n.value.set(e.value,t.value)}function Qr(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function $r(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}function ei(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function ti(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function ni(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}function ri(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>ii(e,r,t.out,n)):ii(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>ii(e,r,t.in,n)):ii(e,r,t.in,n)}}function ii(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}function ai(e){return e.value=Object.freeze(e.value),e}function oi(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(et(e))}}var j,si,M,ci,li,ui,di,fi,pi,mi,hi,gi,_i,vi,yi,bi,xi,Si,Ci,wi,Ti,Ei,Di,Oi,ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta=e((()=>{Mr(),ue(),Pr(),Yt(),cr(),O(),Ir(),j=x(`$ZodType`,(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fr;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=qe(e),i;for(let a of t){if(a._zod.def.when){if(Je(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new se;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||(r=qe(e,t)))});else{if(e.issues.length===t)continue;r||(r=qe(e,t))}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(qe(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new se;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new se;return o.then(e=>t(e,r,a))}return t(o,r,a)}}w(e,`~standard`,()=>({validate:t=>{try{let n=At(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Mt(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),si=x(`$ZodString`,(e,t)=>{j.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ln(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),M=x(`$ZodStringFormat`,(e,t)=>{Sr.init(e,t),si.init(e,t)}),ci=x(`$ZodGUID`,(e,t)=>{t.pattern??(t.pattern=fn),M.init(e,t)}),li=x(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=pn(e))}else t.pattern??(t.pattern=pn());M.init(e,t)}),ui=x(`$ZodEmail`,(e,t)=>{t.pattern??(t.pattern=_n),M.init(e,t)}),di=x(`$ZodURL`,(e,t)=>{M.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Nn.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),fi=x(`$ZodEmoji`,(e,t)=>{t.pattern??(t.pattern=Zt()),M.init(e,t)}),pi=x(`$ZodNanoID`,(e,t)=>{t.pattern??(t.pattern=ln),M.init(e,t)}),mi=x(`$ZodCUID`,(e,t)=>{t.pattern??(t.pattern=rn),M.init(e,t)}),hi=x(`$ZodCUID2`,(e,t)=>{t.pattern??(t.pattern=an),M.init(e,t)}),gi=x(`$ZodULID`,(e,t)=>{t.pattern??(t.pattern=on),M.init(e,t)}),_i=x(`$ZodXID`,(e,t)=>{t.pattern??(t.pattern=sn),M.init(e,t)}),vi=x(`$ZodKSUID`,(e,t)=>{t.pattern??(t.pattern=cn),M.init(e,t)}),yi=x(`$ZodISODateTime`,(e,t)=>{t.pattern??(t.pattern=en(t)),M.init(e,t)}),bi=x(`$ZodISODate`,(e,t)=>{t.pattern??(t.pattern=In),M.init(e,t)}),xi=x(`$ZodISOTime`,(e,t)=>{t.pattern??(t.pattern=$t(t)),M.init(e,t)}),Si=x(`$ZodISODuration`,(e,t)=>{t.pattern??(t.pattern=un),M.init(e,t)}),Ci=x(`$ZodIPv4`,(e,t)=>{t.pattern??(t.pattern=wn),M.init(e,t),e._zod.bag.format=`ipv4`}),wi=x(`$ZodIPv6`,(e,t)=>{t.pattern??(t.pattern=Tn),M.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Ti=x(`$ZodMAC`,(e,t)=>{t.pattern??(t.pattern=En(t.delimiter)),M.init(e,t),e._zod.bag.format=`mac`}),Ei=x(`$ZodCIDRv4`,(e,t)=>{t.pattern??(t.pattern=Dn),M.init(e,t)}),Di=x(`$ZodCIDRv6`,(e,t)=>{t.pattern??(t.pattern=On),M.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}}),Oi=x(`$ZodBase64`,(e,t)=>{t.pattern??(t.pattern=kn),M.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Lr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),ki=x(`$ZodBase64URL`,(e,t)=>{t.pattern??(t.pattern=An),M.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Rr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Ai=x(`$ZodE164`,(e,t)=>{t.pattern??(t.pattern=Pn),M.init(e,t)}),ji=x(`$ZodJWT`,(e,t)=>{M.init(e,t),e._zod.check=n=>{zr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Mi=x(`$ZodCustomStringFormat`,(e,t)=>{M.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Ni=x(`$ZodNumber`,(e,t)=>{j.init(e,t),e._zod.pattern=e._zod.bag.pattern??Bn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Pi=x(`$ZodNumberFormat`,(e,t)=>{mr.init(e,t),Ni.init(e,t)}),Fi=x(`$ZodBoolean`,(e,t)=>{j.init(e,t),e._zod.pattern=Vn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Ii=x(`$ZodBigInt`,(e,t)=>{j.init(e,t),e._zod.pattern=Rn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),Li=x(`$ZodBigIntFormat`,(e,t)=>{hr.init(e,t),Ii.init(e,t)}),Ri=x(`$ZodSymbol`,(e,t)=>{j.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),zi=x(`$ZodUndefined`,(e,t)=>{j.init(e,t),e._zod.pattern=Un,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Bi=x(`$ZodNull`,(e,t)=>{j.init(e,t),e._zod.pattern=Hn,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Vi=x(`$ZodAny`,(e,t)=>{j.init(e,t),e._zod.parse=e=>e}),Hi=x(`$ZodUnknown`,(e,t)=>{j.init(e,t),e._zod.parse=e=>e}),Ui=x(`$ZodNever`,(e,t)=>{j.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),Wi=x(`$ZodVoid`,(e,t)=>{j.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),Gi=x(`$ZodDate`,(e,t)=>{j.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}}),Ki=x(`$ZodArray`,(e,t)=>{j.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Br(t,n,e))):Br(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}}),qi=x(`$ZodObject`,(e,t)=>{if(j.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=ye(()=>Hr(t));w(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Me,i=t.catchall,a;e._zod.parse=(t,o)=>{a??(a=n.value);let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Vr(n,t,e,s,r,i))):Vr(a,t,e,s,r,i)}return i?Ur(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Ji=x(`$ZodObjectJIT`,(e,t)=>{qi.init(e,t);let n=e._zod.parse,r=ye(()=>Hr(t)),i=e=>{let t=new Nr([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Ae(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Ae(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
@@ -78,4 +78,4 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
78
78
  `}function h_(e,t){return`\r
79
79
  `.indexOf(e.charAt(t))!==-1}var g_=e((()=>{a_(),u_()}));function __(e,t=[],n=S_.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return b_(e,{onObjectBegin:()=>{let e={};o(e),a.push(i),i=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{i=a.pop()},onArrayBegin:()=>{let e=[];o(e),a.push(i),i=e,r=null},onArrayEnd:()=>{i=a.pop()},onLiteralValue:o,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n),i[0]}function v_(e,t=[],n=S_.DEFAULT){let r={type:`array`,offset:-1,length:-1,children:[],parent:void 0};function i(e){r.type===`property`&&(r.length=e-r.offset,r=r.parent)}function a(e){return r.children.push(e),e}b_(e,{onObjectBegin:e=>{r=a({type:`object`,offset:e,length:-1,parent:r,children:[]})},onObjectProperty:(e,t,n)=>{r=a({type:`property`,offset:t,length:-1,parent:r,children:[]}),r.children.push({type:`string`,value:e,offset:t,length:n,parent:r})},onObjectEnd:(e,t)=>{i(e+t),r.length=e+t-r.offset,r=r.parent,i(e+t)},onArrayBegin:(e,t)=>{r=a({type:`array`,offset:e,length:-1,parent:r,children:[]})},onArrayEnd:(e,t)=>{r.length=e+t-r.offset,r=r.parent,i(e+t)},onLiteralValue:(e,t,n)=>{a({type:x_(e),offset:t,length:n,parent:r,value:e}),i(t+n)},onSeparator:(e,t,n)=>{r.type===`property`&&(e===`:`?r.colonOffset=t:e===`,`&&i(t))},onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n);let o=r.children[0];return o&&delete o.parent,o}function y_(e,t){if(!e)return;let n=e;for(let e of t)if(typeof e==`string`){if(n.type!==`object`||!Array.isArray(n.children))return;let t=!1;for(let r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&r.children.length===2){n=r.children[1],t=!0;break}if(!t)return}else{let t=e;if(n.type!==`array`||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n}function b_(e,t,n=S_.DEFAULT){let r=e_(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),ee=s(t.onSeparator),_=o(t.onComment),te=s(t.onError),v=n&&n.disallowComments,ne=n&&n.allowTrailingComma;function y(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:b(14);break;case 5:b(15);break;case 3:b(13);break;case 1:v||b(11);break;case 2:b(12);break;case 6:b(16);break}switch(e){case 12:case 13:v?b(10):_();break;case 16:b(1);break;case 15:case 14:break;default:return e}}}function b(e,t=[],n=[]){if(te(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){y();break}else if(n.indexOf(e)!==-1)break;e=y()}}}function re(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),y(),!0}function x(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(b(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return y(),!0}function S(){return r.getToken()===10?(re(!1),r.getToken()===6?(ee(`:`),y(),oe()||b(4,[],[2,5])):b(5,[],[2,5]),i.pop(),!0):(b(3,[],[2,5]),!1)}function ie(){d(),y();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||b(4,[],[]),ee(`,`),y(),r.getToken()===2&&ne)break}else e&&b(6,[],[]);S()||b(4,[],[2,5]),e=!0}return p(),r.getToken()===2?y():b(7,[2],[]),!0}function ae(){m(),y();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||b(4,[],[]),ee(`,`),y(),r.getToken()===4&&ne)break}else t&&b(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,oe()||b(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?y():b(8,[4],[]),!0}function oe(){switch(r.getToken()){case 3:return ae();case 1:return ie();case 10:return re(!0);default:return x()}}return y(),r.getToken()===17?n.allowEmptyContent?!0:(b(4,[],[]),!1):oe()?(r.getToken()!==17&&b(9,[],[]),!0):(b(4,[],[]),!1)}function x_(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`;case`object`:return e?Array.isArray(e)?`array`:`object`:`null`;default:return`null`}}var S_,C_=e((()=>{a_(),(function(e){e.DEFAULT={allowTrailingComma:!1}})(S_||(S_={}))}));function w_(e,t,n,r){let i=t.slice(),a=v_(e,[]),o,s;for(;i.length>0&&(s=i.pop(),o=y_(a,i),o===void 0&&n!==void 0);)n=typeof s==`string`?{[s]:n}:[n];if(!o){if(n===void 0)throw Error(`Can not delete in empty document`);return T_(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}else if(o.type===`object`&&typeof s==`string`&&Array.isArray(o.children)){let t=y_(o,[s]);if(t!==void 0)if(n===void 0){if(!t.parent)throw Error(`Malformed AST`);let n=o.children.indexOf(t.parent),i,a=t.parent.offset+t.parent.length;if(n>0){let e=o.children[n-1];i=e.offset+e.length}else i=o.offset+1,o.children.length>1&&(a=o.children[1].offset);return T_(e,{offset:i,length:a-i,content:``},r)}else return T_(e,{offset:t.offset,length:t.length,content:JSON.stringify(n)},r);else{if(n===void 0)return[];let t=`${JSON.stringify(s)}: ${JSON.stringify(n)}`,i=r.getInsertionIndex?r.getInsertionIndex(o.children.map(e=>e.children[0].value)):o.children.length,a;if(i>0){let e=o.children[i-1];a={offset:e.offset+e.length,length:0,content:`,`+t}}else a=o.children.length===0?{offset:o.offset+1,length:0,content:t}:{offset:o.offset+1,length:0,content:t+`,`};return T_(e,a,r)}}else if(o.type===`array`&&typeof s==`number`&&Array.isArray(o.children)){let t=s;if(t===-1){let t=`${JSON.stringify(n)}`,i;if(o.children.length===0)i={offset:o.offset+1,length:0,content:t};else{let e=o.children[o.children.length-1];i={offset:e.offset+e.length,length:0,content:`,`+t}}return T_(e,i,r)}else if(n===void 0&&o.children.length>=0){let t=s,n=o.children[t],i;if(o.children.length===1)i={offset:o.offset+1,length:o.length-2,content:``};else if(o.children.length-1===t){let e=o.children[t-1],n=e.offset+e.length;i={offset:n,length:o.offset+o.length-2-n,content:``}}else i={offset:n.offset,length:o.children[t+1].offset-n.offset,content:``};return T_(e,i,r)}else if(n!==void 0){let t,i=`${JSON.stringify(n)}`;if(!r.isArrayInsertion&&o.children.length>s){let e=o.children[s];t={offset:e.offset,length:e.length,content:i}}else if(o.children.length===0||s===0)t={offset:o.offset+1,length:0,content:o.children.length===0?i:i+`,`};else{let e=s>o.children.length?o.children.length:s,n=o.children[e-1];t={offset:n.offset+n.length,length:0,content:`,`+i}}return T_(e,t,r)}else throw Error(`Can not ${n===void 0?`remove`:r.isArrayInsertion?`insert`:`modify`} Array index ${t} as length is not sufficient`)}else throw Error(`Can not add ${typeof s==`number`?`property`:`index`} to parent of type ${o.type}`)}function T_(e,t,n){if(!n.formattingOptions)return[t];let r=E_(e,t),i=t.offset,a=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;i>0&&!h_(r,i-1);)i--;for(;a<r.length&&!h_(r,a);)a++}let o=d_(r,{offset:i,length:a-i},{...n.formattingOptions,keepLines:!1});for(let e=o.length-1;e>=0;e--){let t=o[e];r=E_(r,t),i=Math.min(i,t.offset),a=Math.max(a,t.offset+t.length),a+=t.content.length-t.length}let s=e.length-(r.length-a)-i;return[{offset:i,length:s,content:r.substring(i,a)}]}function E_(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}var D_=e((()=>{g_(),C_()}));function O_(e,t,n,r){return w_(e,t,n,r)}function k_(e,t){let n=t.slice(0).sort((e,t)=>{let n=e.offset-t.offset;return n===0?e.length-t.length:n}),r=e.length;for(let t=n.length-1;t>=0;t--){let i=n[t];if(i.offset+i.length<=r)e=E_(e,i);else throw Error(`Overlapping edit`);r=i.offset}return e}var A_,j_,M_,N_,P_=e((()=>{g_(),D_(),a_(),C_(),(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(A_||(A_={})),(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(j_||(j_={})),M_=__,(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(N_||(N_={}))}));function F_(e){return e.startsWith(I_)?e.slice(1):e}var I_,L_=e((()=>{I_=``}));function R_(e,t){try{return{ok:!0,value:JSON.parse(F_(e))}}catch(e){return t&&te(e),{ok:!1}}}function z_(e){if(!e)return null;try{return M_(F_(e))}catch(e){return te(e),null}}function B_(e){let t=Y_,n=e.length,r=t(e);if(!r.error||r.done||r.read>=n)return r.values;let i=r.values,a=r.read;for(;a<n;){let r=typeof e==`string`?e.indexOf(`
80
80
  `,a):e.indexOf(10,a);if(r===-1)break;a=r+1;let o=t(e,a);if(o.values.length>0&&(i=i.concat(o.values)),!o.error||o.done||o.read>=n)break;a=o.read}return i}function V_(e){let t=e.length,n=0;e[0]===239&&e[1]===187&&e[2]===191&&(n=3);let r=[];for(;n<t;){let i=e.indexOf(10,n);i===-1&&(i=t);let a=e.toString(`utf8`,n,i).trim();if(n=i+1,a)try{r.push(JSON.parse(a))}catch{}}return r}function H_(e){let t=F_(e),n=t.length,r=0,i=[];for(;r<n;){let e=t.indexOf(`
81
- `,r);e===-1&&(e=n);let a=t.substring(r,e).trim();if(r=e+1,a)try{i.push(JSON.parse(a))}catch{}}return i}function U_(e){return Y_?B_(e):typeof e==`string`?H_(e):V_(e)}async function W_(e){try{var t=h();let{size:n}=await y(e);if(n<=X_)return U_(await ne(e));let r=t.a(await v(e,`r`)),i=Buffer.allocUnsafe(X_),a=0,o=n-X_;for(;a<X_;){let{bytesRead:e}=await r.read(i,a,X_-a,o+a);if(e===0)break;a+=e}let s=i.indexOf(10);return s!==-1&&s<a-1?U_(i.subarray(s+1,a)):U_(i.subarray(0,a))}catch(e){t.e=e}finally{await t.d()}}function G_(e,t){try{if(!e||e.trim()===``)return m([t],null,4);let n=F_(e),r=M_(n);if(Array.isArray(r)){let e=r.length,i=O_(n,e===0?[0]:[e],t,{formattingOptions:{insertSpaces:!0,tabSize:4},isArrayInsertion:!0});return!i||i.length===0?m([...r,t],null,4):k_(n,i)}else return m([t],null,4)}catch(e){return te(e),m([t],null,4)}}var K_,q_,J_,Y_,X_,Z_=e((()=>{P_(),L_(),_(),$g(),g(),ee(),K_=8*1024,q_=Qg(R_,e=>e,50),J_=Object.assign(function(e,t=!0){if(!e)return null;let n=e.length>K_?R_(e,t):q_(e,t);return n.ok?n.value:null},{cache:q_.cache}),Y_=(()=>{if(typeof Bun>`u`)return!1;let e=Bun.JSONL;return e?.parseChunk?e.parseChunk:!1})(),X_=100*1024*1024}));function Q_(e){let t;return()=>t??(t=e())}var $_=e((()=>{})),ev,tv,nv,rv,iv,av,ov,sv,cv,lv,uv,dv,fv,pv=e((()=>{Wh(),$_(),ev=Q_(()=>Ep([`local`,`user`,`project`,`dynamic`,`enterprise`,`claudeai`,`managed`])),tv=Q_(()=>pp({type:Op(`stdio`).optional(),command:L().min(1,`Command cannot be empty`),args:dp(L()).default([]),env:xp(L(),L()).optional()})),nv=Q_(()=>$f()),rv=Q_(()=>pp({clientId:L().optional(),callbackPort:qf().int().positive().optional(),authServerMetadataUrl:L().url().startsWith(`https://`,{message:`authServerMetadataUrl must use https://`}).optional(),xaa:nv().optional()})),iv=Q_(()=>pp({type:Op(`sse`),url:L(),headers:xp(L(),L()).optional(),headersHelper:L().optional(),oauth:rv().optional()})),av=Q_(()=>pp({type:Op(`sse-ide`),url:L(),ideName:L(),ideRunningInWindows:$f().optional()})),ov=Q_(()=>pp({type:Op(`ws-ide`),url:L(),ideName:L(),authToken:L().optional(),ideRunningInWindows:$f().optional()})),sv=Q_(()=>pp({type:Op(`http`),url:L(),headers:xp(L(),L()).optional(),headersHelper:L().optional(),oauth:rv().optional()})),cv=Q_(()=>pp({type:Op(`ws`),url:L(),headers:xp(L(),L()).optional(),headersHelper:L().optional()})),lv=Q_(()=>pp({type:Op(`sdk`),name:L()})),uv=Q_(()=>pp({type:Op(`claudeai-proxy`),url:L(),id:L()})),dv=Q_(()=>gp([tv(),iv(),av(),ov(),sv(),cv(),lv(),uv()])),fv=Q_(()=>pp({mcpServers:xp(L(),dv())}))}));export{sp as $,Ep as A,Kp as B,Bh as C,Nh as D,Ph as E,$f as F,pp as G,hp as H,Xp as I,tm as J,jp as K,vp as L,ip as M,op as N,Ch as O,dp as P,gp as Q,bh as R,Uh as S,Rh as T,cp as U,Op as V,qf as W,mp as X,xp as Y,L as Z,Qg as _,pv as a,Vd as at,Xg as b,G_ as c,Yt as ct,W_ as d,ue as dt,Tf as et,J_ as f,$g as g,F_ as h,tv as i,$d as it,ap as j,Th as k,Z_ as l,At as lt,L_ as m,fv as n,nf as nt,$_ as o,Fd as ot,z_ as p,Sp as q,dv as r,Gd as rt,Q_ as s,qu as st,ev as t,tf as tt,U_ as u,ae as ut,Zg as v,Fh as w,Wh as x,Yg as y,yp as z};
81
+ `,r);e===-1&&(e=n);let a=t.substring(r,e).trim();if(r=e+1,a)try{i.push(JSON.parse(a))}catch{}}return i}function U_(e){return Y_?B_(e):typeof e==`string`?H_(e):V_(e)}async function W_(e){try{var t=h();let{size:n}=await y(e);if(n<=X_)return U_(await ne(e));let r=t.a(await v(e,`r`)),i=Buffer.allocUnsafe(X_),a=0,o=n-X_;for(;a<X_;){let{bytesRead:e}=await r.read(i,a,X_-a,o+a);if(e===0)break;a+=e}let s=i.indexOf(10);return s!==-1&&s<a-1?U_(i.subarray(s+1,a)):U_(i.subarray(0,a))}catch(e){t.e=e}finally{await t.d()}}function G_(e,t){try{if(!e||e.trim()===``)return m([t],null,4);let n=F_(e),r=M_(n);if(Array.isArray(r)){let e=r.length,i=O_(n,e===0?[0]:[e],t,{formattingOptions:{insertSpaces:!0,tabSize:4},isArrayInsertion:!0});return!i||i.length===0?m([...r,t],null,4):k_(n,i)}else return m([t],null,4)}catch(e){return te(e),m([t],null,4)}}var K_,q_,J_,Y_,X_,Z_=e((()=>{P_(),L_(),_(),$g(),g(),ee(),K_=8*1024,q_=Qg(R_,e=>e,50),J_=Object.assign(function(e,t=!0){if(!e)return null;let n=e.length>K_?R_(e,t):q_(e,t);return n.ok?n.value:null},{cache:q_.cache}),Y_=(()=>{if(typeof Bun>`u`)return!1;let e=Bun.JSONL;return e?.parseChunk?e.parseChunk:!1})(),X_=100*1024*1024}));function Q_(e){let t;return()=>t??(t=e())}var $_=e((()=>{})),ev,tv,nv,rv,iv,av,ov,sv,cv,lv,uv,dv=e((()=>{Wh(),$_(),ev=Q_(()=>Ep([`local`,`user`,`project`,`dynamic`,`enterprise`,`claudeai`,`managed`])),tv=Q_(()=>pp({type:Op(`stdio`).optional(),command:L().min(1,`Command cannot be empty`),args:dp(L()).default([]),env:xp(L(),L()).optional()})),nv=Q_(()=>pp({type:Op(`sse`),url:L(),headers:xp(L(),L()).optional(),headersHelper:L().optional()})),rv=Q_(()=>pp({type:Op(`sse-ide`),url:L(),ideName:L(),ideRunningInWindows:$f().optional()})),iv=Q_(()=>pp({type:Op(`ws-ide`),url:L(),ideName:L(),authToken:L().optional(),ideRunningInWindows:$f().optional()})),av=Q_(()=>pp({type:Op(`http`),url:L(),headers:xp(L(),L()).optional(),headersHelper:L().optional()})),ov=Q_(()=>pp({type:Op(`ws`),url:L(),headers:xp(L(),L()).optional(),headersHelper:L().optional()})),sv=Q_(()=>pp({type:Op(`sdk`),name:L()})),cv=Q_(()=>pp({type:Op(`claudeai-proxy`),url:L(),id:L()})),lv=Q_(()=>gp([tv(),nv(),rv(),iv(),av(),ov(),sv(),cv()])),uv=Q_(()=>pp({mcpServers:xp(L(),lv())}))}));export{sp as $,Ep as A,Kp as B,Bh as C,Nh as D,Ph as E,$f as F,pp as G,hp as H,Xp as I,tm as J,jp as K,vp as L,ip as M,op as N,Ch as O,dp as P,gp as Q,bh as R,Uh as S,Rh as T,cp as U,Op as V,qf as W,mp as X,xp as Y,L as Z,Qg as _,dv as a,Vd as at,Xg as b,G_ as c,Yt as ct,W_ as d,ue as dt,Tf as et,J_ as f,$g as g,F_ as h,tv as i,$d as it,ap as j,Th as k,Z_ as l,At as lt,L_ as m,uv as n,nf as nt,$_ as o,Fd as ot,z_ as p,Sp as q,lv as r,Gd as rt,Q_ as s,qu as st,ev as t,tf as tt,U_ as u,ae as ut,Zg as v,Fh as w,Wh as x,Yg as y,yp as z};
@@ -0,0 +1 @@
1
+ import{i as e,o as t}from"./envUtils-DfkgIdYf.js";import{I as n,M as r,S as i,c as a,i as o,x as s,z as c}from"./debug-Bglx1aTu.js";import{o as l}from"./log-D2TIwHBV.js";import{a as u,i as d}from"./genericProcessUtils-DwQFuna9.js";import"os";import{join as f}from"path";import"crypto";import{readFile as p,readdir as m}from"fs/promises";import"net";import"node:string_decoder";t(),o(),d(),n(),s(),n(),l(),s(),t(),o(),n(),s();function h(){return f(e(),`sessions`)}async function g(){let e=h(),t;try{t=await m(e)}catch(e){return c(e)||a(`[udsClient] readdir failed: ${r(e)}`),[]}let n=[];for(let r of t){if(!/^\d+\.json$/.test(r))continue;let t=parseInt(r.slice(0,-5),10);if(u(t))try{let a=i(await p(f(e,r),`utf8`));n.push({pid:t,sessionId:a.sessionId,cwd:a.cwd,startedAt:a.startedAt,kind:a.kind,name:a.name,messagingSocketPath:a.messagingSocketPath,entrypoint:a.entrypoint,bridgeSessionId:a.bridgeSessionId,alive:!0})}catch{}}return n}export{g as listAllLiveSessions};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{Au as i,Ub as a,ad as o,id as s,ju as c}from"./loadAgentsDir-C1LkW7gl.js";import{Bt as l,Gt as u,I as d,Lt as f,P as p,T as m,Wt as h,_ as g,ai as _,hn as v,t as y}from"./src-DL3w8VPk.js";import{t as b}from"./jsx-runtime-Bb4Xn-E0.js";import{D as x,O as S,n as C,t as w}from"./TextInput-7uqPhq9T.js";import{isDeepStrictEqual as T}from"util";import{pathToFileURL as E}from"url";function D({imageId:e,backgroundColor:t,isSelected:n=!1}){let r=i(e),a=`[Image #${e}]`;if(r&&l()){let e=E(r).href;return(0,O.jsx)(f,{url:e,fallback:(0,O.jsx)(p,{backgroundColor:t,inverse:n,children:a}),children:(0,O.jsx)(p,{backgroundColor:t,inverse:n,bold:n,children:a})})}return(0,O.jsx)(p,{backgroundColor:t,inverse:n,children:a})}var O,k=e((()=>{y(),c(),O=b()}));function A({isFocused:e,isSelected:t,children:n,description:r,shouldShowDownArrow:i,shouldShowUpArrow:a,declareCursor:o}){return(0,j.jsx)(g,{isFocused:e,isSelected:t,description:r,showScrollDown:i,showScrollUp:a,styled:!1,declareCursor:o,children:n})}var j,M=e((()=>{y(),j=b()}));function N({option:e,isFocused:t,isSelected:n,shouldShowDownArrow:r,shouldShowUpArrow:i,maxIndexWidth:a,index:o,inputValue:c,onInputChange:l,onSubmit:f,onExit:g,layout:_,children:y,showLabel:b=!1,onOpenEditor:S,resetCursorOnUpdate:C=!1,onImagePaste:T,pastedContents:E,onRemoveImage:O,imagesSelected:k,selectedImageIndex:j=0,onImagesSelectedChange:M,onSelectedImageIndexChange:N}){let I=E?Object.values(E).filter(e=>e.type===`image`):[],L=b||e.showLabelWithValue===!0,[R,z]=(0,P.useState)(c.length),B=(0,P.useRef)(!1);(0,P.useEffect)(()=>{C&&t&&(B.current?B.current=!1:z(c.length))},[C,t,c]),h(`chat:externalEditor`,()=>{S?.(c,l)},{context:`Chat`,isActive:t&&!!S}),h(`chat:imagePaste`,()=>{T&&x().then(e=>{e&&T(e.base64,e.mediaType,void 0,e.dimensions)})},{context:`Chat`,isActive:t&&!!T}),h(`attachments:remove`,()=>{I.length>0&&O&&O(I.at(-1).id)},{context:`Attachments`,isActive:t&&!k&&c===``&&I.length>0&&!!O}),u({"attachments:next":()=>{I.length>1&&N?.((j+1)%I.length)},"attachments:previous":()=>{I.length>1&&N?.((j-1+I.length)%I.length)},"attachments:remove":()=>{let e=I[j];e&&O&&(O(e.id),I.length<=1?M?.(!1):N?.(Math.min(j,I.length-2)))},"attachments:exit":()=>{M?.(!1)}},{context:`Attachments`,isActive:t&&!!k}),v((e,t)=>{t.upArrow&&M?.(!1)},{isActive:t&&!!k}),(0,P.useEffect)(()=>{!t&&k&&M?.(!1)},[t,k,M]);let V=_===`expanded`?a+3:a+4;return(0,F.jsxs)(d,{flexDirection:`column`,flexShrink:0,children:[(0,F.jsx)(A,{isFocused:t,isSelected:n,shouldShowDownArrow:r,shouldShowUpArrow:i,declareCursor:!1,children:(0,F.jsxs)(d,{flexDirection:`row`,flexShrink:_===`compact`?0:void 0,children:[(0,F.jsx)(p,{dimColor:!0,children:`${o}.`.padEnd(a+2)}),y,L?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(p,{color:t?`suggestion`:void 0,children:e.label}),t?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(p,{color:`suggestion`,children:e.labelValueSeparator??`, `}),(0,F.jsx)(w,{value:c,onChange:t=>{B.current=!0,l(t),e.onChange(t)},onSubmit:f,onExit:g,placeholder:e.placeholder,focus:!k,showCursor:!0,multiline:!0,cursorOffset:R,onChangeCursorOffset:z,columns:80,onImagePaste:T,onPaste:t=>{B.current=!0;let n=c.slice(0,R),r=c.slice(R),i=n+t+r;l(i),e.onChange(i),z(n.length+t.length)}})]}):c&&(0,F.jsxs)(p,{children:[e.labelValueSeparator??`, `,c]})]}):t?(0,F.jsx)(w,{value:c,onChange:t=>{B.current=!0,l(t),e.onChange(t)},onSubmit:f,onExit:g,placeholder:e.placeholder||(typeof e.label==`string`?e.label:void 0),focus:!k,showCursor:!0,multiline:!0,cursorOffset:R,onChangeCursorOffset:z,columns:80,onImagePaste:T,onPaste:t=>{B.current=!0;let n=c.slice(0,R),r=c.slice(R),i=n+t+r;l(i),e.onChange(i),z(n.length+t.length)}}):(0,F.jsx)(p,{color:c?void 0:`inactive`,children:c||e.placeholder||e.label})]})}),e.description&&(0,F.jsx)(d,{paddingLeft:V,children:(0,F.jsx)(p,{dimColor:e.dimDescription!==!1,color:n?`success`:t?`suggestion`:void 0,children:e.description})}),I.length>0&&(0,F.jsxs)(d,{flexDirection:`row`,gap:1,paddingLeft:V,children:[I.map((e,t)=>(0,F.jsx)(D,{imageId:e.id,isSelected:!!k&&t===j},e.id)),(0,F.jsx)(d,{flexGrow:1,justifyContent:`flex-start`,flexDirection:`row`,children:(0,F.jsx)(p,{dimColor:!0,children:k?(0,F.jsxs)(m,{children:[I.length>1&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(s,{action:`attachments:next`,context:`Attachments`,fallback:`→`,description:`next`}),(0,F.jsx)(s,{action:`attachments:previous`,context:`Attachments`,fallback:`←`,description:`prev`})]}),(0,F.jsx)(s,{action:`attachments:remove`,context:`Attachments`,fallback:`backspace`,description:`remove`}),(0,F.jsx)(s,{action:`attachments:exit`,context:`Attachments`,fallback:`esc`,description:`cancel`})]}):t?`(↓ to select)`:null})})]}),_===`expanded`&&(0,F.jsx)(p,{children:` `})]})}var P,F,I=e((()=>{P=t(_(),1),y(),a(),S(),k(),o(),C(),M(),F=b()})),L,R=e((()=>{n(),L=class extends Map{constructor(e){let t=[],n,i,a,o=0;for(let r of e){let e={label:r.label,value:r.value,description:r.description,previous:a,next:void 0,index:o};a&&(a.next=e),n||(n=e),i=e,t.push([r.value,e]),o++,a=e}super(t),r(this,`first`,void 0),r(this,`last`,void 0),this.first=n,this.last=i}}}));function z({visibleOptionCount:e=5,options:t,initialFocusValue:n,onFocus:r,focusValue:i}){let[a,o]=(0,B.useReducer)(V,{visibleOptionCount:e,options:t,initialFocusValue:i||n},H),s=(0,B.useRef)(r);s.current=r;let[c,l]=(0,B.useState)(t);t!==c&&!T(t,c)&&(o({type:`reset`,state:H({visibleOptionCount:e,options:t,initialFocusValue:i??a.focusedValue??n,currentViewport:{visibleFromIndex:a.visibleFromIndex,visibleToIndex:a.visibleToIndex}})}),l(t));let u=(0,B.useCallback)(()=>{o({type:`focus-next-option`})},[]),d=(0,B.useCallback)(()=>{o({type:`focus-previous-option`})},[]),f=(0,B.useCallback)(()=>{o({type:`focus-next-page`})},[]),p=(0,B.useCallback)(()=>{o({type:`focus-previous-page`})},[]),m=(0,B.useCallback)(e=>{e!==void 0&&o({type:`set-focus`,value:e})},[]),h=(0,B.useMemo)(()=>t.map((e,t)=>({...e,index:t})).slice(a.visibleFromIndex,a.visibleToIndex),[t,a.visibleFromIndex,a.visibleToIndex]),g=(0,B.useMemo)(()=>{if(a.focusedValue!==void 0)return t.some(e=>e.value===a.focusedValue)?a.focusedValue:t[0]?.value},[a.focusedValue,t]),_=(0,B.useMemo)(()=>t.find(e=>e.value===g)?.type===`input`,[g,t]);return(0,B.useEffect)(()=>{g!==void 0&&s.current?.(g)},[g]),(0,B.useEffect)(()=>{i!==void 0&&o({type:`set-focus`,value:i})},[i]),{focusedValue:g,focusedIndex:(0,B.useMemo)(()=>{if(g===void 0)return 0;let e=t.findIndex(e=>e.value===g);return e>=0?e+1:0},[g,t]),visibleFromIndex:a.visibleFromIndex,visibleToIndex:a.visibleToIndex,visibleOptions:h,isInInput:_??!1,focusNextOption:u,focusPreviousOption:d,focusNextPage:f,focusPreviousPage:p,focusOption:m,options:t}}var B,V,H,U=e((()=>{B=t(_(),1),R(),V=(e,t)=>{switch(t.type){case`focus-next-option`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=t.next||e.optionMap.first;if(!n)return e;if(!t.next&&n===e.optionMap.first)return{...e,focusedValue:n.value,visibleFromIndex:0,visibleToIndex:e.visibleOptionCount};if(!(n.index>=e.visibleToIndex))return{...e,focusedValue:n.value};let r=Math.min(e.optionMap.size,e.visibleToIndex+1),i=r-e.visibleOptionCount;return{...e,focusedValue:n.value,visibleFromIndex:i,visibleToIndex:r}}case`focus-previous-option`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=t.previous||e.optionMap.last;if(!n)return e;if(!t.previous&&n===e.optionMap.last){let t=e.optionMap.size,r=Math.max(0,t-e.visibleOptionCount);return{...e,focusedValue:n.value,visibleFromIndex:r,visibleToIndex:t}}if(!(n.index<=e.visibleFromIndex))return{...e,focusedValue:n.value};let r=Math.max(0,e.visibleFromIndex-1),i=r+e.visibleOptionCount;return{...e,focusedValue:n.value,visibleFromIndex:r,visibleToIndex:i}}case`focus-next-page`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=Math.min(e.optionMap.size-1,t.index+e.visibleOptionCount),r=e.optionMap.first;for(;r&&r.index<n&&r.next;)r=r.next;if(!r)return e;let i=Math.min(e.optionMap.size,r.index+1),a=Math.max(0,i-e.visibleOptionCount);return{...e,focusedValue:r.value,visibleFromIndex:a,visibleToIndex:i}}case`focus-previous-page`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=Math.max(0,t.index-e.visibleOptionCount),r=e.optionMap.first;for(;r&&r.index<n&&r.next;)r=r.next;if(!r)return e;let i=Math.max(0,r.index),a=Math.min(e.optionMap.size,i+e.visibleOptionCount);return{...e,focusedValue:r.value,visibleFromIndex:i,visibleToIndex:a}}case`reset`:return t.state;case`set-focus`:{if(e.focusedValue===t.value)return e;let n=e.optionMap.get(t.value);if(!n)return e;if(n.index>=e.visibleFromIndex&&n.index<e.visibleToIndex)return{...e,focusedValue:t.value};let r,i;return n.index<e.visibleFromIndex?(r=n.index,i=Math.min(e.optionMap.size,r+e.visibleOptionCount)):(i=Math.min(e.optionMap.size,n.index+1),r=Math.max(0,i-e.visibleOptionCount)),{...e,focusedValue:t.value,visibleFromIndex:r,visibleToIndex:i}}}},H=({visibleOptionCount:e,options:t,initialFocusValue:n,currentViewport:r})=>{let i=typeof e==`number`?Math.min(e,t.length):t.length,a=new L(t),o=n!==void 0&&a.get(n),s=o?n:a.first?.value,c=0,l=i;if(o){let e=o.index;r?e>=r.visibleFromIndex&&e<r.visibleToIndex?(c=r.visibleFromIndex,l=Math.min(a.size,r.visibleToIndex)):e<r.visibleFromIndex?(c=e,l=Math.min(a.size,c+i)):(l=Math.min(a.size,e+1),c=Math.max(0,l-i)):e>=i&&(l=Math.min(a.size,e+1),c=Math.max(0,l-i)),c=Math.max(0,Math.min(c,a.size-1)),l=Math.min(a.size,Math.max(i,l))}return{optionMap:a,visibleOptionCount:i,focusedValue:s,visibleFromIndex:c,visibleToIndex:l}}}));export{A as a,I as i,z as n,M as o,N as r,U as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{Iu as i,Lu as a,mb as o,md as s,pd as c}from"./loadAgentsDir-B0Anodo0.js";import{Bt as l,Gt as u,I as d,Lt as f,P as p,T as m,Wt as h,_ as g,ai as _,hn as v,t as y}from"./src-DL3w8VPk.js";import{t as b}from"./jsx-runtime-Bb4Xn-E0.js";import{D as x,O as S,n as C,t as w}from"./TextInput-B8ruWRf2.js";import{isDeepStrictEqual as T}from"util";import{pathToFileURL as E}from"url";function D({imageId:e,backgroundColor:t,isSelected:n=!1}){let r=i(e),a=`[Image #${e}]`;if(r&&l()){let e=E(r).href;return(0,O.jsx)(f,{url:e,fallback:(0,O.jsx)(p,{backgroundColor:t,inverse:n,children:a}),children:(0,O.jsx)(p,{backgroundColor:t,inverse:n,bold:n,children:a})})}return(0,O.jsx)(p,{backgroundColor:t,inverse:n,children:a})}var O,k=e((()=>{y(),a(),O=b()}));function A({isFocused:e,isSelected:t,children:n,description:r,shouldShowDownArrow:i,shouldShowUpArrow:a,declareCursor:o}){return(0,j.jsx)(g,{isFocused:e,isSelected:t,description:r,showScrollDown:i,showScrollUp:a,styled:!1,declareCursor:o,children:n})}var j,M=e((()=>{y(),j=b()}));function N({option:e,isFocused:t,isSelected:n,shouldShowDownArrow:r,shouldShowUpArrow:i,maxIndexWidth:a,index:o,inputValue:s,onInputChange:l,onSubmit:f,onExit:g,layout:_,children:y,showLabel:b=!1,onOpenEditor:S,resetCursorOnUpdate:C=!1,onImagePaste:T,pastedContents:E,onRemoveImage:O,imagesSelected:k,selectedImageIndex:j=0,onImagesSelectedChange:M,onSelectedImageIndexChange:N}){let I=E?Object.values(E).filter(e=>e.type===`image`):[],L=b||e.showLabelWithValue===!0,[R,z]=(0,P.useState)(s.length),B=(0,P.useRef)(!1);(0,P.useEffect)(()=>{C&&t&&(B.current?B.current=!1:z(s.length))},[C,t,s]),h(`chat:externalEditor`,()=>{S?.(s,l)},{context:`Chat`,isActive:t&&!!S}),h(`chat:imagePaste`,()=>{T&&x().then(e=>{e&&T(e.base64,e.mediaType,void 0,e.dimensions)})},{context:`Chat`,isActive:t&&!!T}),h(`attachments:remove`,()=>{I.length>0&&O&&O(I.at(-1).id)},{context:`Attachments`,isActive:t&&!k&&s===``&&I.length>0&&!!O}),u({"attachments:next":()=>{I.length>1&&N?.((j+1)%I.length)},"attachments:previous":()=>{I.length>1&&N?.((j-1+I.length)%I.length)},"attachments:remove":()=>{let e=I[j];e&&O&&(O(e.id),I.length<=1?M?.(!1):N?.(Math.min(j,I.length-2)))},"attachments:exit":()=>{M?.(!1)}},{context:`Attachments`,isActive:t&&!!k}),v((e,t)=>{t.upArrow&&M?.(!1)},{isActive:t&&!!k}),(0,P.useEffect)(()=>{!t&&k&&M?.(!1)},[t,k,M]);let V=_===`expanded`?a+3:a+4;return(0,F.jsxs)(d,{flexDirection:`column`,flexShrink:0,children:[(0,F.jsx)(A,{isFocused:t,isSelected:n,shouldShowDownArrow:r,shouldShowUpArrow:i,declareCursor:!1,children:(0,F.jsxs)(d,{flexDirection:`row`,flexShrink:_===`compact`?0:void 0,children:[(0,F.jsx)(p,{dimColor:!0,children:`${o}.`.padEnd(a+2)}),y,L?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(p,{color:t?`suggestion`:void 0,children:e.label}),t?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(p,{color:`suggestion`,children:e.labelValueSeparator??`, `}),(0,F.jsx)(w,{value:s,onChange:t=>{B.current=!0,l(t),e.onChange(t)},onSubmit:f,onExit:g,placeholder:e.placeholder,focus:!k,showCursor:!0,multiline:!0,cursorOffset:R,onChangeCursorOffset:z,columns:80,onImagePaste:T,onPaste:t=>{B.current=!0;let n=s.slice(0,R),r=s.slice(R),i=n+t+r;l(i),e.onChange(i),z(n.length+t.length)}})]}):s&&(0,F.jsxs)(p,{children:[e.labelValueSeparator??`, `,s]})]}):t?(0,F.jsx)(w,{value:s,onChange:t=>{B.current=!0,l(t),e.onChange(t)},onSubmit:f,onExit:g,placeholder:e.placeholder||(typeof e.label==`string`?e.label:void 0),focus:!k,showCursor:!0,multiline:!0,cursorOffset:R,onChangeCursorOffset:z,columns:80,onImagePaste:T,onPaste:t=>{B.current=!0;let n=s.slice(0,R),r=s.slice(R),i=n+t+r;l(i),e.onChange(i),z(n.length+t.length)}}):(0,F.jsx)(p,{color:s?void 0:`inactive`,children:s||e.placeholder||e.label})]})}),e.description&&(0,F.jsx)(d,{paddingLeft:V,children:(0,F.jsx)(p,{dimColor:e.dimDescription!==!1,color:n?`success`:t?`suggestion`:void 0,children:e.description})}),I.length>0&&(0,F.jsxs)(d,{flexDirection:`row`,gap:1,paddingLeft:V,children:[I.map((e,t)=>(0,F.jsx)(D,{imageId:e.id,isSelected:!!k&&t===j},e.id)),(0,F.jsx)(d,{flexGrow:1,justifyContent:`flex-start`,flexDirection:`row`,children:(0,F.jsx)(p,{dimColor:!0,children:k?(0,F.jsxs)(m,{children:[I.length>1&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(c,{action:`attachments:next`,context:`Attachments`,fallback:`→`,description:`next`}),(0,F.jsx)(c,{action:`attachments:previous`,context:`Attachments`,fallback:`←`,description:`prev`})]}),(0,F.jsx)(c,{action:`attachments:remove`,context:`Attachments`,fallback:`backspace`,description:`remove`}),(0,F.jsx)(c,{action:`attachments:exit`,context:`Attachments`,fallback:`esc`,description:`cancel`})]}):t?`(↓ to select)`:null})})]}),_===`expanded`&&(0,F.jsx)(p,{children:` `})]})}var P,F,I=e((()=>{P=t(_(),1),y(),o(),S(),k(),s(),C(),M(),F=b()})),L,R=e((()=>{n(),L=class extends Map{constructor(e){let t=[],n,i,a,o=0;for(let r of e){let e={label:r.label,value:r.value,description:r.description,previous:a,next:void 0,index:o};a&&(a.next=e),n||(n=e),i=e,t.push([r.value,e]),o++,a=e}super(t),r(this,`first`,void 0),r(this,`last`,void 0),this.first=n,this.last=i}}}));function z({visibleOptionCount:e=5,options:t,initialFocusValue:n,onFocus:r,focusValue:i}){let[a,o]=(0,B.useReducer)(V,{visibleOptionCount:e,options:t,initialFocusValue:i||n},H),s=(0,B.useRef)(r);s.current=r;let[c,l]=(0,B.useState)(t);t!==c&&!T(t,c)&&(o({type:`reset`,state:H({visibleOptionCount:e,options:t,initialFocusValue:i??a.focusedValue??n,currentViewport:{visibleFromIndex:a.visibleFromIndex,visibleToIndex:a.visibleToIndex}})}),l(t));let u=(0,B.useCallback)(()=>{o({type:`focus-next-option`})},[]),d=(0,B.useCallback)(()=>{o({type:`focus-previous-option`})},[]),f=(0,B.useCallback)(()=>{o({type:`focus-next-page`})},[]),p=(0,B.useCallback)(()=>{o({type:`focus-previous-page`})},[]),m=(0,B.useCallback)(e=>{e!==void 0&&o({type:`set-focus`,value:e})},[]),h=(0,B.useMemo)(()=>t.map((e,t)=>({...e,index:t})).slice(a.visibleFromIndex,a.visibleToIndex),[t,a.visibleFromIndex,a.visibleToIndex]),g=(0,B.useMemo)(()=>{if(a.focusedValue!==void 0)return t.some(e=>e.value===a.focusedValue)?a.focusedValue:t[0]?.value},[a.focusedValue,t]),_=(0,B.useMemo)(()=>t.find(e=>e.value===g)?.type===`input`,[g,t]);return(0,B.useEffect)(()=>{g!==void 0&&s.current?.(g)},[g]),(0,B.useEffect)(()=>{i!==void 0&&o({type:`set-focus`,value:i})},[i]),{focusedValue:g,focusedIndex:(0,B.useMemo)(()=>{if(g===void 0)return 0;let e=t.findIndex(e=>e.value===g);return e>=0?e+1:0},[g,t]),visibleFromIndex:a.visibleFromIndex,visibleToIndex:a.visibleToIndex,visibleOptions:h,isInInput:_??!1,focusNextOption:u,focusPreviousOption:d,focusNextPage:f,focusPreviousPage:p,focusOption:m,options:t}}var B,V,H,U=e((()=>{B=t(_(),1),R(),V=(e,t)=>{switch(t.type){case`focus-next-option`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=t.next||e.optionMap.first;if(!n)return e;if(!t.next&&n===e.optionMap.first)return{...e,focusedValue:n.value,visibleFromIndex:0,visibleToIndex:e.visibleOptionCount};if(!(n.index>=e.visibleToIndex))return{...e,focusedValue:n.value};let r=Math.min(e.optionMap.size,e.visibleToIndex+1),i=r-e.visibleOptionCount;return{...e,focusedValue:n.value,visibleFromIndex:i,visibleToIndex:r}}case`focus-previous-option`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=t.previous||e.optionMap.last;if(!n)return e;if(!t.previous&&n===e.optionMap.last){let t=e.optionMap.size,r=Math.max(0,t-e.visibleOptionCount);return{...e,focusedValue:n.value,visibleFromIndex:r,visibleToIndex:t}}if(!(n.index<=e.visibleFromIndex))return{...e,focusedValue:n.value};let r=Math.max(0,e.visibleFromIndex-1),i=r+e.visibleOptionCount;return{...e,focusedValue:n.value,visibleFromIndex:r,visibleToIndex:i}}case`focus-next-page`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=Math.min(e.optionMap.size-1,t.index+e.visibleOptionCount),r=e.optionMap.first;for(;r&&r.index<n&&r.next;)r=r.next;if(!r)return e;let i=Math.min(e.optionMap.size,r.index+1),a=Math.max(0,i-e.visibleOptionCount);return{...e,focusedValue:r.value,visibleFromIndex:a,visibleToIndex:i}}case`focus-previous-page`:{if(e.focusedValue===void 0)return e;let t=e.optionMap.get(e.focusedValue);if(!t)return e;let n=Math.max(0,t.index-e.visibleOptionCount),r=e.optionMap.first;for(;r&&r.index<n&&r.next;)r=r.next;if(!r)return e;let i=Math.max(0,r.index),a=Math.min(e.optionMap.size,i+e.visibleOptionCount);return{...e,focusedValue:r.value,visibleFromIndex:i,visibleToIndex:a}}case`reset`:return t.state;case`set-focus`:{if(e.focusedValue===t.value)return e;let n=e.optionMap.get(t.value);if(!n)return e;if(n.index>=e.visibleFromIndex&&n.index<e.visibleToIndex)return{...e,focusedValue:t.value};let r,i;return n.index<e.visibleFromIndex?(r=n.index,i=Math.min(e.optionMap.size,r+e.visibleOptionCount)):(i=Math.min(e.optionMap.size,n.index+1),r=Math.max(0,i-e.visibleOptionCount)),{...e,focusedValue:t.value,visibleFromIndex:r,visibleToIndex:i}}}},H=({visibleOptionCount:e,options:t,initialFocusValue:n,currentViewport:r})=>{let i=typeof e==`number`?Math.min(e,t.length):t.length,a=new L(t),o=n!==void 0&&a.get(n),s=o?n:a.first?.value,c=0,l=i;if(o){let e=o.index;r?e>=r.visibleFromIndex&&e<r.visibleToIndex?(c=r.visibleFromIndex,l=Math.min(a.size,r.visibleToIndex)):e<r.visibleFromIndex?(c=e,l=Math.min(a.size,c+i)):(l=Math.min(a.size,e+1),c=Math.max(0,l-i)):e>=i&&(l=Math.min(a.size,e+1),c=Math.max(0,l-i)),c=Math.max(0,Math.min(c,a.size-1)),l=Math.min(a.size,Math.max(i,l))}return{optionMap:a,visibleOptionCount:i,focusedValue:s,visibleFromIndex:c,visibleToIndex:l}}}));export{A as a,I as i,z as n,M as o,N as r,U as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ub as n}from"./loadAgentsDir-C1LkW7gl.js";import{Gt as r,ai as i,et as a,t as o,vt as s}from"./src-DL3w8VPk.js";import{t as c}from"./useDoublePress-C9xxQzh1.js";function l(e,t,n,r=!0){let{exit:i}=s(),[o,c]=(0,u.useState)({pending:!1,keyName:null}),l=(0,u.useMemo)(()=>n??i,[n,i]),d=a(e=>c({pending:e,keyName:`Ctrl-C`}),l),f=a(e=>c({pending:e,keyName:`Ctrl-D`}),l),p=(0,u.useCallback)(()=>{t?.()||d()},[d,t]),m=(0,u.useCallback)(()=>{f()},[f]);return e((0,u.useMemo)(()=>({"app:interrupt":p,"app:exit":m}),[p,m]),{context:`Global`,isActive:r}),o}var u,d=e((()=>{u=t(i(),1),o(),c()}));function f(e,t,n){return l(r,t,e,n)}var p=e((()=>{n(),d()}));export{f as n,p as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{mb as n}from"./loadAgentsDir-B0Anodo0.js";import{Gt as r,ai as i,et as a,t as o,vt as s}from"./src-DL3w8VPk.js";import{t as c}from"./useDoublePress-C9xxQzh1.js";function l(e,t,n,r=!0){let{exit:i}=s(),[o,c]=(0,u.useState)({pending:!1,keyName:null}),l=(0,u.useMemo)(()=>n??i,[n,i]),d=a(e=>c({pending:e,keyName:`Ctrl-C`}),l),f=a(e=>c({pending:e,keyName:`Ctrl-D`}),l),p=(0,u.useCallback)(()=>{t?.()||d()},[d,t]),m=(0,u.useCallback)(()=>{f()},[f]);return e((0,u.useMemo)(()=>({"app:interrupt":p,"app:exit":m}),[p,m]),{context:`Global`,isActive:r}),o}var u,d=e((()=>{u=t(i(),1),o(),c()}));function f(e,t,n){return l(r,t,e,n)}var p=e((()=>{n(),d()}));export{f as n,p as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ip as t,Lp as n}from"./loadAgentsDir-B0Anodo0.js";import{_ as r,d as i,r as a}from"./model-BvQFFOf8.js";function o(){let e=n(e=>e.mainLoopModel);return r(n(e=>e.mainLoopModelForSession)??e??a())}var s=e((()=>{t(),i()}));export{o as n,s as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Fa as t,Fv as n,Go as r,Ia as i,Ip as a,Lp as o,Pv as s,Wo as c,Xo as l,Yo as u,ah as d,ap as f,ep as p,ih as m,ip as h,np as g,zp as _}from"./loadAgentsDir-B0Anodo0.js";import{ai as v}from"./src-DL3w8VPk.js";import{I as y,V as b,c as x,i as S}from"./debug-Bglx1aTu.js";import{Hn as C,Vn as w,Xr as T,Yr as E}from"./settings-B2jvL8Dp.js";import{o as D,s as O}from"./log-D2TIwHBV.js";import{n as k,r as A}from"./analytics-DJobLaWP.js";import{n as j,t as M}from"./notifications-Bc6k-Ozy.js";import{n as N,r as P}from"./pluginFlagging-js_-WmYj.js";import{t as F}from"./pluginBlocklist-9OrNEh--.js";var I=e(v(),1);M(),k(),p(),a(),C(),S(),E(),y(),D(),u(),r(),m(),h(),s(),P(),t();function L({enabled:e=!0}={}){let t=_(),r=o(e=>e.plugins.needsRefresh),{addNotification:a}=j(),s=(0,I.useCallback)(async()=>{try{let{enabled:e,disabled:r,errors:o}=await i();await F();let s=N();Object.keys(s).length>0&&a({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let u=[],p=[];try{u=await c()}catch(e){let t=e instanceof Error?e.message:String(e);o.push({type:`generic-error`,source:`plugin-commands`,error:`Failed to load plugin commands: ${t}`})}try{p=await l()}catch(e){let t=e instanceof Error?e.message:String(e);o.push({type:`generic-error`,source:`plugin-agents`,error:`Failed to load plugin agents: ${t}`})}try{await d()}catch(e){let t=e instanceof Error?e.message:String(e);o.push({type:`generic-error`,source:`plugin-hooks`,error:`Failed to load plugin hooks: ${t}`})}let m=(await Promise.all(e.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await n(e,o);return t&&(e.mcpServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0),h=(await Promise.all(e.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await f(e,o);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);g(),t(t=>{let n=t.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),i=new Set(o.map(e=>e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`)),a=[...n.filter(e=>{let t=e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`;return!i.has(t)}),...o];return{...t,plugins:{...t.plugins,enabled:e,disabled:r,commands:u,errors:a}}}),x(`Loaded plugins - Enabled: ${e.length}, Disabled: ${r.length}, Commands: ${u.length}, Agents: ${p.length}, Errors: ${o.length}`);let _=e.reduce((e,t)=>t.hooksConfig?e+Object.values(t.hooksConfig).reduce((e,t)=>e+(t?.reduce((e,t)=>e+t.hooks.length,0)??0),0):e,0);return{enabled_count:e.length,disabled_count:r.length,inline_count:w(e,e=>e.source.endsWith(`@inline`)),marketplace_count:w(e,e=>!e.source.endsWith(`@inline`)),error_count:o.length,skill_count:u.length,agent_count:p.length,hook_count:_,mcp_count:m,lsp_count:h}}catch(e){let n=b(e);return O(n),x(`Error loading plugins: ${e}`),t(e=>{let t=e.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r={type:`generic-error`,source:`plugin-system`,error:n.message};return{...e,plugins:{...e.plugins,enabled:[],disabled:[],commands:[],errors:[...t,r]}}}),{enabled_count:0,disabled_count:0,inline_count:0,marketplace_count:0,error_count:1,skill_count:0,agent_count:0,hook_count:0,mcp_count:0,lsp_count:0,load_failed:!0,ant_enabled_names:void 0}}},[t,a]);(0,I.useEffect)(()=>{e&&s().then(e=>{let{ant_enabled_names:t,...n}=e,r={...n,has_custom_plugin_cache_dir:!!process.env.CLAUDE_CODE_PLUGIN_CACHE_DIR};A(`tengu_plugins_loaded`,{...r,...t!==void 0&&{enabled_names:t}}),T(`info`,`tengu_plugins_loaded`,r)})},[s,e]),(0,I.useEffect)(()=>{!e||!r||a({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,r,a])}export{L as t};
@@ -0,0 +1 @@
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ec as n,Sc as r}from"./loadAgentsDir-B0Anodo0.js";import{ai as i}from"./src-DL3w8VPk.js";import{n as a,t as o}from"./toolPool-V-7Yv0GA.js";function s(e,t,n){return(0,c.useMemo)(()=>a(e,r(n,t),n.mode),[e,t,n,!1,!1])}var c,l=e((()=>{c=t(i(),1),n(),o()}));export{s as n,l as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Yb as n}from"./loadAgentsDir-C1LkW7gl.js";import{Vn as r,ai as i,hn as a,ot as o,t as s}from"./src-DL3w8VPk.js";import{_ as c,b as l,d as u,g as d,h as f,l as p,u as m,v as h,y as g}from"./TextInput-7uqPhq9T.js";function _(e){return!!(e.ctrl&&(e.key===`k`||e.key===`u`||e.key===`w`)||e.meta&&e.key===`backspace`)}function v(e){return(e.ctrl||e.meta)&&e.key===`y`}function y({isActive:e,onExit:t,onCancel:n,onExitUp:i,columns:s,passthroughCtrlKeys:u=[],initialQuery:y=``,backspaceExitsOnEmpty:S=!0}){let{columns:C}=o(),w=s??C,[T,E]=(0,b.useState)(y),[D,O]=(0,b.useState)(y.length),k=(0,b.useCallback)(e=>{E(e),O(e.length)},[]),A=r=>{if(!e)return;let a=p.fromText(T,w,D);if(!(r.ctrl&&u.includes(r.key.toLowerCase()))){if(_(r)||c(),v(r)||h(),r.key===`return`||r.key===`down`){r.preventDefault(),t();return}if(r.key===`up`){r.preventDefault(),i&&i();return}if(r.key===`escape`){r.preventDefault(),n?n():T.length>0?(E(``),O(0)):t();return}if(r.key===`backspace`){if(r.preventDefault(),r.meta){let{cursor:e,killed:t}=a.deleteWordBefore();f(t,`prepend`),E(e.text),O(e.offset);return}if(T.length===0){S&&(n??t)();return}let e=a.backspace();E(e.text),O(e.offset);return}if(r.key===`delete`){r.preventDefault();let e=a.del();E(e.text),O(e.offset);return}if(r.key===`left`&&(r.ctrl||r.meta||r.fn)){r.preventDefault();let e=a.prevWord();O(e.offset);return}if(r.key===`right`&&(r.ctrl||r.meta||r.fn)){r.preventDefault();let e=a.nextWord();O(e.offset);return}if(r.key===`left`){r.preventDefault();let e=a.left();O(e.offset);return}if(r.key===`right`){r.preventDefault();let e=a.right();O(e.offset);return}if(r.key===`home`){r.preventDefault(),O(0);return}if(r.key===`end`){r.preventDefault(),O(T.length);return}if(r.ctrl){switch(r.preventDefault(),r.key.toLowerCase()){case`a`:O(0);return;case`e`:O(T.length);return;case`b`:O(a.left().offset);return;case`f`:O(a.right().offset);return;case`d`:{if(T.length===0){(n??t)();return}let e=a.del();E(e.text),O(e.offset);return}case`h`:{if(T.length===0){S&&(n??t)();return}let e=a.backspace();E(e.text),O(e.offset);return}case`k`:{let{cursor:e,killed:t}=a.deleteToLineEnd();f(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=a.deleteToLineStart();f(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=a.deleteWordBefore();f(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=m();if(e.length>0){let t=a.offset,n=a.insert(e);d(t,e.length),E(n.text),O(n.offset)}return}case`g`:case`c`:if(n){n();return}}return}if(r.meta){switch(r.preventDefault(),r.key.toLowerCase()){case`b`:O(a.prevWord().offset);return;case`f`:O(a.nextWord().offset);return;case`d`:{let e=a.deleteWordAfter();E(e.text),O(e.offset);return}case`y`:{let e=l();if(e){let{text:t,start:n,length:r}=e,i=T.slice(0,n),a=T.slice(n+r),o=i+t+a,s=n+t.length;g(t.length),E(o),O(s)}return}}return}if(r.key!==`tab`&&r.key.length>=1&&!x.has(r.key)){r.preventDefault();let e=a.insert(r.key);E(e.text),O(e.offset)}}};return a((e,t,n)=>{A(new r(n.keypress))},{isActive:e}),{query:T,setQuery:k,cursorOffset:D,handleKeyDown:A}}var b,x,S=e((()=>{b=t(i(),1),s(),u(),n(),x=new Set([`pageup`,`pagedown`,`insert`,`wheelup`,`wheeldown`,`mouse`,`f1`,`f2`,`f3`,`f4`,`f5`,`f6`,`f7`,`f8`,`f9`,`f10`,`f11`,`f12`])}));export{y as n,S as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{bb as n}from"./loadAgentsDir-B0Anodo0.js";import{Vn as r,ai as i,hn as a,ot as o,t as s}from"./src-DL3w8VPk.js";import{_ as c,b as l,d as u,g as d,h as f,l as p,u as m,v as h,y as g}from"./TextInput-B8ruWRf2.js";function _(e){return!!(e.ctrl&&(e.key===`k`||e.key===`u`||e.key===`w`)||e.meta&&e.key===`backspace`)}function v(e){return(e.ctrl||e.meta)&&e.key===`y`}function y({isActive:e,onExit:t,onCancel:n,onExitUp:i,columns:s,passthroughCtrlKeys:u=[],initialQuery:y=``,backspaceExitsOnEmpty:S=!0}){let{columns:C}=o(),w=s??C,[T,E]=(0,b.useState)(y),[D,O]=(0,b.useState)(y.length),k=(0,b.useCallback)(e=>{E(e),O(e.length)},[]),A=r=>{if(!e)return;let a=p.fromText(T,w,D);if(!(r.ctrl&&u.includes(r.key.toLowerCase()))){if(_(r)||c(),v(r)||h(),r.key===`return`||r.key===`down`){r.preventDefault(),t();return}if(r.key===`up`){r.preventDefault(),i&&i();return}if(r.key===`escape`){r.preventDefault(),n?n():T.length>0?(E(``),O(0)):t();return}if(r.key===`backspace`){if(r.preventDefault(),r.meta){let{cursor:e,killed:t}=a.deleteWordBefore();f(t,`prepend`),E(e.text),O(e.offset);return}if(T.length===0){S&&(n??t)();return}let e=a.backspace();E(e.text),O(e.offset);return}if(r.key===`delete`){r.preventDefault();let e=a.del();E(e.text),O(e.offset);return}if(r.key===`left`&&(r.ctrl||r.meta||r.fn)){r.preventDefault();let e=a.prevWord();O(e.offset);return}if(r.key===`right`&&(r.ctrl||r.meta||r.fn)){r.preventDefault();let e=a.nextWord();O(e.offset);return}if(r.key===`left`){r.preventDefault();let e=a.left();O(e.offset);return}if(r.key===`right`){r.preventDefault();let e=a.right();O(e.offset);return}if(r.key===`home`){r.preventDefault(),O(0);return}if(r.key===`end`){r.preventDefault(),O(T.length);return}if(r.ctrl){switch(r.preventDefault(),r.key.toLowerCase()){case`a`:O(0);return;case`e`:O(T.length);return;case`b`:O(a.left().offset);return;case`f`:O(a.right().offset);return;case`d`:{if(T.length===0){(n??t)();return}let e=a.del();E(e.text),O(e.offset);return}case`h`:{if(T.length===0){S&&(n??t)();return}let e=a.backspace();E(e.text),O(e.offset);return}case`k`:{let{cursor:e,killed:t}=a.deleteToLineEnd();f(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=a.deleteToLineStart();f(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=a.deleteWordBefore();f(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=m();if(e.length>0){let t=a.offset,n=a.insert(e);d(t,e.length),E(n.text),O(n.offset)}return}case`g`:case`c`:if(n){n();return}}return}if(r.meta){switch(r.preventDefault(),r.key.toLowerCase()){case`b`:O(a.prevWord().offset);return;case`f`:O(a.nextWord().offset);return;case`d`:{let e=a.deleteWordAfter();E(e.text),O(e.offset);return}case`y`:{let e=l();if(e){let{text:t,start:n,length:r}=e,i=T.slice(0,n),a=T.slice(n+r),o=i+t+a,s=n+t.length;g(t.length),E(o),O(s)}return}}return}if(r.key!==`tab`&&r.key.length>=1&&!x.has(r.key)){r.preventDefault();let e=a.insert(r.key);E(e.text),O(e.offset)}}};return a((e,t,n)=>{A(new r(n.keypress))},{isActive:e}),{query:T,setQuery:k,cursorOffset:D,handleKeyDown:A}}var b,x,S=e((()=>{b=t(i(),1),s(),u(),n(),x=new Set([`pageup`,`pagedown`,`insert`,`wheelup`,`wheeldown`,`mouse`,`f1`,`f2`,`f3`,`f4`,`f5`,`f6`,`f7`,`f8`,`f9`,`f10`,`f11`,`f12`])}));export{y as n,S as t};
@@ -0,0 +1 @@
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Hp as n,Up as r}from"./loadAgentsDir-B0Anodo0.js";import{ai as i}from"./src-DL3w8VPk.js";import{n as a,t as o}from"./notifications-Bc6k-Ozy.js";import{n as s,t as c}from"./allErrors-BF73lon8.js";function l(){let{addNotification:e,removeNotification:t}=a(),[n,i]=(0,u.useState)(()=>{let{errors:e}=c();return e});return r((0,u.useCallback)(()=>{let{errors:e}=c();i(e)},[])),(0,u.useEffect)(()=>{if(n.length>0){let t=`Found ${n.length} settings ${n.length===1?`issue`:`issues`} · /doctor for details`;e({key:d,text:t,color:`warning`,priority:`high`,timeoutMs:6e4})}else t(d)},[n,e,t]),n}var u,d,f=e((()=>{u=t(i(),1),o(),s(),n(),d=`settings-errors`}));export{l as n,f as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Dp as t,Tp as n}from"./loadAgentsDir-C1LkW7gl.js";import{ai as r}from"./src-DL3w8VPk.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{n as a,r as o}from"./analytics-DJobLaWP.js";import{t as s}from"./KeybindingProviderSetup-Bn1jzN5F.js";import{t as c}from"./useManagePlugins-CYXVcql2.js";import{n as l,t as u}from"./MCPConnectionManager-ChN4Ayjk.js";import{cwd as d}from"process";var f=e(r(),1);a(),l(),t();var p=i(),m=f.lazy(()=>import(`./Doctor-BP0Rqraa.js`).then(e=>({default:e.Doctor})));function h({onDone:e}){return c(),(0,p.jsx)(f.Suspense,{fallback:null,children:(0,p.jsx)(m,{onDone:e})})}async function g(e){o(`tengu_doctor_command`,{}),await new Promise(t=>{e.render((0,p.jsx)(n,{children:(0,p.jsx)(s,{children:(0,p.jsx)(u,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1,children:(0,p.jsx)(h,{onDone:()=>{t()}})})})}))}),e.unmount(),process.exit(0)}async function _(e,t){let{setup:n}=await import(`./setup-CN_Pk7AR.js`);await n(d(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-ZMll-dAa.js`);await new Promise(n=>{let i=[];e&&i.push(e),t.force&&i.push(`--force`),r.call(e=>{n(),process.exit(+!!e.includes(`failed`))},{},i)})}export{g as doctorHandler,_ as installHandler};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ip as t,Pp as n}from"./loadAgentsDir-B0Anodo0.js";import{ai as r}from"./src-DL3w8VPk.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{n as a,r as o}from"./analytics-DJobLaWP.js";import{t as s}from"./KeybindingProviderSetup-D49HHTXD.js";import{t as c}from"./useManagePlugins-BXLXazrR.js";import{n as l,t as u}from"./MCPConnectionManager-Cie77ZAK.js";import{cwd as d}from"process";var f=e(r(),1);a(),l(),t();var p=i(),m=f.lazy(()=>import(`./Doctor-CMpr7tdf.js`).then(e=>({default:e.Doctor})));function h({onDone:e}){return c(),(0,p.jsx)(f.Suspense,{fallback:null,children:(0,p.jsx)(m,{onDone:e})})}async function g(e){o(`tengu_doctor_command`,{}),await new Promise(t=>{e.render((0,p.jsx)(n,{children:(0,p.jsx)(s,{children:(0,p.jsx)(u,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1,children:(0,p.jsx)(h,{onDone:()=>{t()}})})})}))}),e.unmount(),process.exit(0)}async function _(e,t){let{setup:n}=await import(`./setup-qecdf-ES.js`);await n(d(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-0D9u2dZw.js`);await new Promise(n=>{let i=[];e&&i.push(e),t.force&&i.push(`--force`),r.call(e=>{n(),process.exit(+!!e.includes(`failed`))},{},i)})}export{g as doctorHandler,_ as installHandler};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{Ax as r,Bw as i,Cx as a,Hw as o,Ox as s,Sx as c,Uw as ee,kx as l,zw as u}from"./loadAgentsDir-B0Anodo0.js";import{P as d,x as te}from"./types-Dx7P7JLQ.js";import{C as f,I as p,M as m,N as h,R as g,S as _,c as v,f as y,i as b,u as x,x as S}from"./debug-Bglx1aTu.js";import{_t as C,ft as ne,gt as w,ht as re,mt as ie}from"./settings-B2jvL8Dp.js";import{o as ae,s as T}from"./log-D2TIwHBV.js";import{homedir as oe}from"os";import*as E from"path";import{join as se,resolve as D}from"path";import{randomBytes as O}from"crypto";import{readFile as k,readdir as A,rename as j,stat as M,unlink as N,writeFile as P}from"fs/promises";function F(){return se(c(),H)}async function I(){let e=F();try{let t=_(await k(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return v(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==V)return v(`Install counts cache version mismatch (got ${n.version}, expected ${V})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return v(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(v(`Install counts cache has invalid fetchedAt timestamp`),null):n.counts.every(e=>typeof e==`object`&&!!e&&typeof e.plugin==`string`&&typeof e.unique_installs==`number`)?Date.now()-r>W?(v(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(v(`Install counts cache has malformed entries`),null)}catch(e){return h(e)!==`ENOENT`&&v(`Failed to load install counts cache: ${m(e)}`),null}}async function L(e){let t=F(),n=`${t}.${O(8).toString(`hex`)}.tmp`;try{let r=c();await x().mkdir(r),await P(n,f(e,null,2),{encoding:`utf-8`,mode:384}),await j(n,t),v(`Install counts cache saved successfully`)}catch(e){T(e);try{await N(n)}catch{}}}async function R(){v(`Fetching install counts from ${U}`);let e=performance.now();try{let n=await t.get(U,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return r(`install_counts`,U,`success`,performance.now()-e),n.data.plugins}catch(t){throw r(`install_counts`,U,`failure`,performance.now()-e,s(t)),t}}async function z(){let e=await I();if(e){v(`Using cached install counts`),r(`install_counts`,U,`cache_hit`,0);let t=new Map;for(let n of e.counts)t.set(n.plugin,n.unique_installs);return t}try{let e=await R();await L({version:V,fetchedAt:new Date().toISOString(),counts:e});let t=new Map;for(let n of e)t.set(n.plugin,n.unique_installs);return t}catch(e){return T(e),v(`Failed to fetch install counts: ${m(e)}`),null}}function B(e){if(e<1e3)return String(e);if(e<1e6){let t=(e/1e3).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}K`:`${t}K`}let t=(e/1e6).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}M`:`${t}M`}var V,H,U,W,G=e((()=>{n(),b(),p(),y(),ae(),S(),l(),a(),V=1,H=`install-counts-cache.json`,U=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,W=1440*60*1e3}));async function K(e){let t=e.trim(),n=x(),r=t.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(r?.[1]){let e=r[1],t=r[3];return t?{source:`git`,url:e,ref:t}:{source:`git`,url:e}}if(t.startsWith(`http://`)||t.startsWith(`https://`)){let e=t.match(/^([^#]+)(#(.+))?$/),n=e?.[1]||t,r=e?.[3];if(n.endsWith(`.git`)||n.includes(`/_git/`))return r?{source:`git`,url:n,ref:r}:{source:`git`,url:n};let i;try{i=new URL(n)}catch{return{source:`url`,url:n}}if((i.hostname===`github.com`||i.hostname===`www.github.com`)&&i.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let e=n.endsWith(`.git`)?n:`${n}.git`;return r?{source:`git`,url:e,ref:r}:{source:`git`,url:e}}return{source:`url`,url:n}}let i=process.platform===`win32`&&(t.startsWith(`.\\`)||t.startsWith(`..\\`)||/^[a-zA-Z]:[/\\]/.test(t));if(t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)||t.startsWith(`~`)||i){let e=D(t.startsWith(`~`)?t.replace(/^~/,oe()):t),r;try{r=await n.stat(e)}catch(t){let n=h(t);return{error:n===`ENOENT`?`Path does not exist: ${e}`:`Cannot access path: ${e} (${n??t})`}}return r.isFile()?e.endsWith(`.json`)?{source:`file`,path:e}:{error:`File path must point to a .json file (marketplace.json), but got: ${e}`}:r.isDirectory()?{source:`directory`,path:e}:{error:`Path is neither a file nor a directory: ${e}`}}if(t.includes(`/`)&&!t.startsWith(`@`)){if(t.includes(`:`))return null;let e=t.match(/^([^#@]+)(?:[#@](.+))?$/),n=e?.[1]||t,r=e?.[2];return r?{source:`github`,repo:n,ref:r}:{source:`github`,repo:n}}return null}var ce=e((()=>{p(),y()}));function le(e){let t=E.basename(e),n=E.basename(E.dirname(e));return t===`plugin.json`?`plugin`:t===`marketplace.json`?`marketplace`:n===`.claude-plugin`?`plugin`:`unknown`}function q(e){return e.issues.map(e=>({path:e.path.join(`.`)||`root`,message:e.message,code:e.code}))}function J(e,t,n,r){e.includes(`..`)&&n.push({path:t,message:r?`Path contains "..": ${e}. ${r}`:`Path contains ".." which could be a path traversal attempt: ${e}`})}function ue(e){let t=e.replace(/^(\.\.\/)+/,``);return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${t===e?`./plugins/my-plugin`:`./${t}`}" instead of "${e}".`}async function Y(e){let t=[],n=[],r=E.resolve(e),i;try{i=await k(r,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${m(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=_(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(e)}`}],warnings:[],filePath:r,fileType:`plugin`}}if(a&&typeof a==`object`){let e=a;e.commands&&(Array.isArray(e.commands)?e.commands:[e.commands]).forEach((e,n)=>{typeof e==`string`&&J(e,`commands[${n}]`,t)}),e.agents&&(Array.isArray(e.agents)?e.agents:[e.agents]).forEach((e,n)=>{typeof e==`string`&&J(e,`agents[${n}]`,t)}),e.skills&&(Array.isArray(e.skills)?e.skills:[e.skills]).forEach((e,n)=>{typeof e==`string`&&J(e,`skills[${n}]`,t)})}let o=a;if(typeof a==`object`&&a){let e=a,t=Object.keys(e).filter(e=>$.has(e));if(t.length>0){let r={...e};for(let e of t)delete r[e],n.push({path:e,message:`Field '${e}' belongs in the marketplace entry (marketplace.json), not plugin.json. It's harmless here but unused — Work Mate ignores it at load time.`});o=r}}let s=ie().strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Work Mate accepts it, but the Claude.ai marketplace sync requires kebab-case (lowercase letters, digits, and hyphens only, e.g., "my-plugin").`}),e.version||n.push({path:`version`,message:`No version specified. Consider adding a version following semver (e.g., "1.0.0")`}),e.description||n.push({path:`description`,message:`No description provided. Adding a description helps users understand what your plugin does`}),e.author||n.push({path:`author`,message:`No author information provided. Consider adding author details for plugin attribution`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`plugin`}}async function X(e){let t=[],n=[],r=E.resolve(e),i;try{i=await k(r,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${m(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`marketplace`}}let a;try{a=_(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(e)}`}],warnings:[],filePath:r,fileType:`marketplace`}}if(a&&typeof a==`object`){let e=a;Array.isArray(e.plugins)&&e.plugins.forEach((e,n)=>{if(e&&typeof e==`object`&&`source`in e){let r=e.source;typeof r==`string`&&J(r,`plugins[${n}].source`,t,ue(r)),r&&typeof r==`object`&&`path`in r&&typeof r.path==`string`&&J(r.path,`plugins[${n}].source.path`,t)}})}let o=w().extend({plugins:d(re().strict())}).strict().safeParse(a);if(o.success||t.push(...q(o.error)),o.success){let e=o.data;if((!e.plugins||e.plugins.length===0)&&n.push({path:`plugins`,message:`Marketplace has no plugins defined`}),e.plugins){e.plugins.forEach((n,r)=>{e.plugins.filter(e=>e.name===n.name).length>1&&t.push({path:`plugins[${r}].name`,message:`Duplicate plugin name "${n.name}" found in marketplace`})});let i=E.dirname(r),a=E.basename(i)===`.claude-plugin`?E.dirname(i):i;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=E.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=_(await k(e,{encoding:`utf-8`}));typeof t.version==`string`&&(i=t.version)}catch{continue}i&&i!==r.version&&n.push({path:`plugins[${t}].version`,message:`Entry declares version "${r.version}" but ${r.source}/.claude-plugin/plugin.json says "${i}". At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. Update this entry to "${i}" to match.`})}}e.metadata?.description||n.push({path:`metadata.description`,message:`No marketplace description provided. Adding a description helps users understand what this marketplace offers`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`marketplace`}}function de(e,t,n){let r=[],i=[],a=t.match(u);if(!a)return i.push({path:`frontmatter`,message:`No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata.`}),{success:!0,errors:r,warnings:i,filePath:e,fileType:n};let o=a[1]||``,s;try{s=ee(o)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${m(t)}. At runtime this ${n} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n}}if(typeof s!=`object`||!s||Array.isArray(s))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(s)?`an array`:s===null?`null`:typeof s}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let c=s;if(c.description!==void 0){let e=c.description;typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`&&e!==null&&r.push({path:`description`,message:`description must be a string, got ${Array.isArray(e)?`array`:typeof e}. At runtime this value is dropped.`})}else i.push({path:`description`,message:`No description in frontmatter. A description helps users and Work Mate understand when to use this ${n}.`});c.name!==void 0&&c.name!==null&&typeof c.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof c.name}.`});let l=c[`allowed-tools`];l!=null&&(typeof l!=`string`&&!Array.isArray(l)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof l}.`}):Array.isArray(l)&&l.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let d=c.shell;if(d!=null)if(typeof d!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof d}.`});else{let e=d.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${d}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await k(e,{encoding:`utf-8`})}catch(t){return h(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${m(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=_(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=ne().safeParse(n);return r.success?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:q(r.error),warnings:[],filePath:e,fileType:`hooks`}}async function Q(e,t){let n;try{n=await A(e,{withFileTypes:!0})}catch(e){let t=h(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>E.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=E.join(e,t.name);t.isDirectory()?r.push(...await Q(n,!1)):t.isFile()&&t.name.toLowerCase().endsWith(`.md`)&&r.push(n)}return r}async function fe(e){let t=[],n=[[`skill`,E.join(e,`skills`)],[`agent`,E.join(e,`agents`)],[`command`,E.join(e,`commands`)]];for(let[e,r]of n){let n=await Q(r,e===`skill`);for(let r of n){let n;try{n=await k(r,{encoding:`utf-8`})}catch(n){if(g(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${m(n)}`}],warnings:[],filePath:r,fileType:e});continue}let i=de(r,n,e);(i.errors.length>0||i.warnings.length>0)&&t.push(i)}}let r=await Z(E.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=E.resolve(e),n=null;try{n=await M(t)}catch(e){if(!g(e))throw e}if(n?.isDirectory()){let e=await X(E.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(E.join(t,`.claude-plugin`,`plugin.json`));return n.errors[0]?.code===`ENOENT`?{success:!1,errors:[{path:`directory`,message:`No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json`}],warnings:[],filePath:t,fileType:`plugin`}:n}switch(le(e)){case`plugin`:return Y(e);case`marketplace`:return X(e);case`unknown`:try{let n=_(await k(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(h(e)===`ENOENT`)return{success:!1,errors:[{path:`file`,message:`File not found: ${t}`}],warnings:[],filePath:t,fileType:`plugin`}}return Y(e)}}var $,me=e((()=>{te(),p(),i(),S(),o(),C(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{K as a,G as c,ce as i,pe as n,B as o,fe as r,z as s,me as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{_ as t,p as n,s as r}from"./config-C-Y2qtB2.js";import{n as i,r as a}from"./analytics-DJobLaWP.js";var o;e((()=>{i(),n(),o=async()=>{let e=r().editorMode||`normal`;e===`emacs`&&(e=`normal`);let n=e===`normal`?`vim`:`normal`;return t(e=>({...e,editorMode:n})),a(`tengu_editor_mode_changed`,{mode:n,source:`command`}),{type:`text`,value:`Editor mode set to ${n}. ${n===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{o as call};
@@ -0,0 +1 @@
1
+ import{gt as e,xt as t}from"./loadAgentsDir-B0Anodo0.js";t();export{e as execIntoTmuxWorktree};
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- import{l as e,o as t}from"./chunks/envUtils-DcaKZlRU.js";var n=globalThis.performance,r=new Map,i=new Map;function a(){return n.now()}function o(e){return r.set(e,a()),{name:e,entryType:`mark`,startTime:r.get(e),duration:0}}function s(e,t,n){let o,s;if(typeof t==`string`){let e=r.get(t),i=n?r.get(n):a();o=e??a(),s=(i??a())-o}else t&&typeof t==`object`?(o=t.start??0,s=(t.end??a())-o):(o=0,s=a());i.set(e,{name:e,startTime:o,duration:s})}function c(e){return e===`mark`?[...r.entries()].map(([e,t])=>({name:e,entryType:`mark`,startTime:t,duration:0})):e===`measure`?[...i.values()].map(e=>({name:e.name,entryType:`measure`,startTime:e.startTime,duration:e.duration})):[]}function l(e,t){return c(t??`mark`).concat(t===void 0?c(`measure`):[]).filter(t=>t.name===e)}function u(e){e===void 0?r.clear():r.delete(e)}function d(e){e===void 0?i.clear():i.delete(e)}var f={now:a,mark:o,measure:s,getEntriesByType:c,getEntriesByName:l,clearMarks:u,clearMeasures:d,clearResourceTimings:(()=>{}),setResourceTimingBufferSize:(()=>{}),markResourceTiming:(()=>{}),get timeOrigin(){return n.timeOrigin},get onresourcetimingbufferfull(){return n.onresourcetimingbufferfull},set onresourcetimingbufferfull(e){},toJSON(){return n.toJSON()}};function p(){globalThis.__performanceShimInstalled||(globalThis.__performanceShimInstalled=!0,globalThis.performance=f)}if(p(),t(),globalThis.MACRO===void 0&&(globalThis.MACRO={VERSION:process.env.CLAUDE_CODE_VERSION||`2.1.888`,BUILD_TIME:new Date().toISOString(),FEEDBACK_CHANNEL:``,ISSUES_EXPLAINER:``,NATIVE_PACKAGE_URL:``,PACKAGE_URL:``,VERSION_CHANGELOG:``}),e(process.env.CLAUDE_CODE_FORCE_INTERACTIVE)){for(let e of[process.stdin,process.stdout,process.stderr])if(!e.isTTY)try{Object.defineProperty(e,"isTTY",{value:!0,configurable:!0})}catch{}}process.env.COREPACK_ENABLE_AUTO_PIN=`0`;async function m(){let e=process.argv.slice(2);if(e.length===1&&(e[0]===`--version`||e[0]===`-v`||e[0]===`-V`)){console.log(`0.0.22 (Work Mate)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-B_U4QDtf.js`);if(t(`cli_entry`),process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-ex0-RyYV.js`);await e();return}if(e[0]===`job`){t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-BdFzE9XG.js`);await n(e.slice(1)),process.exit(0)}if(e[0]===`new`||e[0]===`list`||e[0]===`reply`){console.error(`[deprecated] Use: claude job ${e[0]} ${e.slice(1).join(` `)}`.trim()),t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-BdFzE9XG.js`);await n(e),process.exit(0)}if((e.includes(`--tmux`)||e.includes(`--tmux=classic`))&&(e.includes(`-w`)||e.includes(`--worktree`)||e.some(e=>e.startsWith(`--worktree=`)))){t(`cli_tmux_worktree_fast_path`);let{enableConfigs:n}=await import(`./chunks/config-kw4xg7Nk.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-D68iEHpC.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-Caqt2WRZ.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CNfq37LF.js`);e(n.error)}}}e.includes(`--bare`)&&(process.env.CLAUDE_CODE_SIMPLE=`1`);let{startCapturingEarlyInput:n}=await import(`./chunks/earlyInput-BEjRkAtH.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-BRg8L_aw.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
2
+ import{l as e,o as t}from"./chunks/envUtils-DfkgIdYf.js";var n=globalThis.performance,r=new Map,i=new Map;function a(){return n.now()}function o(e){return r.set(e,a()),{name:e,entryType:`mark`,startTime:r.get(e),duration:0}}function s(e,t,n){let o,s;if(typeof t==`string`){let e=r.get(t),i=n?r.get(n):a();o=e??a(),s=(i??a())-o}else t&&typeof t==`object`?(o=t.start??0,s=(t.end??a())-o):(o=0,s=a());i.set(e,{name:e,startTime:o,duration:s})}function c(e){return e===`mark`?[...r.entries()].map(([e,t])=>({name:e,entryType:`mark`,startTime:t,duration:0})):e===`measure`?[...i.values()].map(e=>({name:e.name,entryType:`measure`,startTime:e.startTime,duration:e.duration})):[]}function l(e,t){return c(t??`mark`).concat(t===void 0?c(`measure`):[]).filter(t=>t.name===e)}function u(e){e===void 0?r.clear():r.delete(e)}function d(e){e===void 0?i.clear():i.delete(e)}var f={now:a,mark:o,measure:s,getEntriesByType:c,getEntriesByName:l,clearMarks:u,clearMeasures:d,clearResourceTimings:(()=>{}),setResourceTimingBufferSize:(()=>{}),markResourceTiming:(()=>{}),get timeOrigin(){return n.timeOrigin},get onresourcetimingbufferfull(){return n.onresourcetimingbufferfull},set onresourcetimingbufferfull(e){},toJSON(){return n.toJSON()}};function p(){globalThis.__performanceShimInstalled||(globalThis.__performanceShimInstalled=!0,globalThis.performance=f)}if(p(),t(),globalThis.MACRO===void 0&&(globalThis.MACRO={VERSION:process.env.CLAUDE_CODE_VERSION||`2.1.888`,BUILD_TIME:new Date().toISOString(),FEEDBACK_CHANNEL:``,ISSUES_EXPLAINER:``,NATIVE_PACKAGE_URL:``,PACKAGE_URL:``,VERSION_CHANGELOG:``}),e(process.env.CLAUDE_CODE_FORCE_INTERACTIVE)){for(let e of[process.stdin,process.stdout,process.stderr])if(!e.isTTY)try{Object.defineProperty(e,"isTTY",{value:!0,configurable:!0})}catch{}}process.env.COREPACK_ENABLE_AUTO_PIN=`0`;async function m(){let e=process.argv.slice(2);if(e.length===1&&(e[0]===`--version`||e[0]===`-v`||e[0]===`-V`)){console.log(`0.0.24 (Work Mate)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-BH0FoI66.js`);if(t(`cli_entry`),process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-Bxseqbi_.js`);await e();return}if(e[0]===`job`){t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-C8qsPrLj.js`);await n(e.slice(1)),process.exit(0)}if(e[0]===`new`||e[0]===`list`||e[0]===`reply`){console.error(`[deprecated] Use: claude job ${e[0]} ${e.slice(1).join(` `)}`.trim()),t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-C8qsPrLj.js`);await n(e),process.exit(0)}if((e.includes(`--tmux`)||e.includes(`--tmux=classic`))&&(e.includes(`-w`)||e.includes(`--worktree`)||e.some(e=>e.startsWith(`--worktree=`)))){t(`cli_tmux_worktree_fast_path`);let{enableConfigs:n}=await import(`./chunks/config-DD8fCYXn.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-D68iEHpC.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-Vm-SNY5x.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CNfq37LF.js`);e(n.error)}}}e.includes(`--bare`)&&(process.env.CLAUDE_CODE_SIMPLE=`1`);let{startCapturingEarlyInput:n}=await import(`./chunks/earlyInput-BEjRkAtH.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-9ksgUUY_.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readmagic/workmate",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "description": "workMate",
5
5
  "type": "module",
6
6
  "author": "Frandy",
@@ -83,9 +83,7 @@
83
83
  "@anthropic/ink": "workspace:*",
84
84
  "@aws-sdk/client-bedrock": "^3.1037.0",
85
85
  "@aws-sdk/client-bedrock-runtime": "^3.1037.0",
86
- "@aws-sdk/client-sts": "^3.1037.0",
87
86
  "@aws-sdk/credential-provider-node": "^3.972.36",
88
- "@aws-sdk/credential-providers": "^3.1037.0",
89
87
  "@azure/identity": "^4.13.1",
90
88
  "@biomejs/biome": "^2.4.12",
91
89
  "@commander-js/extra-typings": "^14.0.0",
@@ -113,7 +111,6 @@
113
111
  "@types/picomatch": "^4.0.3",
114
112
  "@types/plist": "^3.0.5",
115
113
  "@types/proper-lockfile": "^4.1.4",
116
- "@types/qrcode": "^1.5.6",
117
114
  "@types/react": "^19.2.14",
118
115
  "@types/react-reconciler": "^0.33.0",
119
116
  "@types/semver": "^7.7.1",
@@ -154,7 +151,6 @@
154
151
  "picomatch": "^4.0.4",
155
152
  "plist": "^3.1.0",
156
153
  "proper-lockfile": "^4.1.2",
157
- "qrcode": "^1.5.4",
158
154
  "react": "^19.2.5",
159
155
  "react-compiler-runtime": "^1.0.0",
160
156
  "react-reconciler": "^0.33.0",
@@ -1 +0,0 @@
1
- import{n as e,t}from"./AgentsMdExternalIncludesDialog-s0Orgord.js";e();export{t as AgentsMdExternalIncludesDialog};
@@ -1 +0,0 @@
1
- import{Dp as e,Tp as t}from"./loadAgentsDir-C1LkW7gl.js";import{R as n,t as r}from"./src-DL3w8VPk.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{c as a,m as o,v as s}from"./config-BddEvZZl.js";import{t as c}from"./fpsMetrics-wxj9GAsd.js";import{n as l,t as u}from"./onChangeAppState-4KOJMN82.js";e(),r(),o();var d=i();function f({getFpsMetrics:e,stats:r,initialState:i,children:o}){return(0,d.jsx)(c,{getFpsMetrics:e,children:(0,d.jsx)(l,{store:r,children:(0,d.jsx)(t,{initialState:i,onChangeAppState:u,children:(0,d.jsx)(n,{initialState:a().theme,onThemeSave:e=>s(t=>({...t,theme:e})),children:o})})})})}export{f as App};
@@ -1 +0,0 @@
1
- import{t as e}from"./ApproveApiKey-_VXIMSwY.js";export{e as ApproveApiKey};
@@ -1 +0,0 @@
1
- import{P as e,t,y as n}from"./src-DL3w8VPk.js";import{t as r}from"./jsx-runtime-Bb4Xn-E0.js";import{m as i,v as a}from"./config-BddEvZZl.js";import{t as o}from"./select-C_KXmqbI.js";import{t as s}from"./CustomSelect-B46Eh0gU.js";t(),i(),s();var c=r();function l({customApiKeyTruncated:t,onDone:r}){function i(e){switch(e){case`yes`:a(e=>({...e,customApiKeyResponses:{...e.customApiKeyResponses,approved:[...e.customApiKeyResponses?.approved??[],t]}})),r(!0);break;case`no`:a(e=>({...e,customApiKeyResponses:{...e.customApiKeyResponses,rejected:[...e.customApiKeyResponses?.rejected??[],t]}})),r(!1);break}}return(0,c.jsxs)(n,{title:`Detected a custom API key in your environment`,color:`warning`,onCancel:()=>i(`no`),children:[(0,c.jsxs)(e,{children:[(0,c.jsx)(e,{bold:!0,children:`ANTHROPIC_API_KEY`}),(0,c.jsxs)(e,{children:[`: sk-ant-...`,t]})]}),(0,c.jsx)(e,{children:`Do you want to use this API key?`}),(0,c.jsx)(o,{defaultValue:`no`,defaultFocusValue:`no`,options:[{label:`Yes`,value:`yes`},{label:(0,c.jsxs)(e,{children:[`No (`,(0,c.jsx)(e,{bold:!0,children:`recommended`}),`)`]}),value:`no`}],onChange:e=>i(e),onCancel:()=>i(`no`)})]})}export{l as t};
@@ -1,2 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{Ap as i,Bl as a,CS as o,Cc as s,Dp as c,En as l,Gb as u,Hu as d,On as f,Op as p,Rl as m,Sc as h,Ub as g,Uu as _,Vl as v,Wb as y,Yb as b,Zi as x,am as S,fu as C,ms as w,nm as ee,ps as te,pu as T,zl as E}from"./loadAgentsDir-C1LkW7gl.js";import{D,Gt as O,H as ne,I as k,P as A,T as j,ai as M,ot as N,t as P,y as F}from"./src-DL3w8VPk.js";import{t as I}from"./jsx-runtime-Bb4Xn-E0.js";import{_ as re,f as ie}from"./debug-8DCufdSp.js";import{Jn as ae,Yn as oe,qn as se}from"./settings-DKN4xSpQ.js";import{l as L,o as ce}from"./stringUtils-BQm3OfeJ.js";import{S as le,_ as R,f as ue,l as de,u as fe,y as z}from"./startupProfiler-DTs9w9EN.js";import{_n as pe,gn as me,vn as he}from"./prompt-BGqgPgCU.js";import{i as ge,t as _e}from"./overlayContext-CMV7nYR9.js";function B(e,t,n=1e3,r=0,i){let a=()=>de(Math.max(0,(i??Date.now())-e-r));return(0,V.useSyncExternalStore)((0,V.useCallback)(e=>{if(!t)return()=>{};let r=setInterval(e,n);return()=>clearInterval(r)},[t,n]),a,a)}var V,H=e((()=>{V=t(M(),1),R()}));function ve(e,t,n){let r=me(t,e.toolName);if(!r)return e.toolName;try{let t=r.inputSchema.safeParse(e.input),i=t.success?t.data:{},a=r.userFacingName(i);if(!a)return e.toolName;let o=r.renderToolUseMessage(i,{theme:n,verbose:!1});return o?(0,ye.jsxs)(A,{children:[a,`(`,o,`)`]}):a}catch{return e.toolName}}var ye,be=e((()=>{P(),he(),ye=I()}));function xe(e,t){let{isIdle:n,awaitingApproval:i,hasError:a,shutdownRequested:o}=t??{};return a?r.cross:i?r.questionMarkPrefix:o?r.warning:e===`running`?n?r.ellipsis:r.play:e===`completed`?r.tick:e===`failed`||e===`killed`?r.cross:r.bullet}function Se(e,t){let{isIdle:n,awaitingApproval:r,hasError:i,shutdownRequested:a}=t??{};return i?`error`:r||a?`warning`:n?`background`:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:`background`}function Ce(e,t){if(!t)return!1;let n=!1;for(let t of Object.values(e))if(T(t))return n=!0,!1;return n}var we=e((()=>{n(),C()}));function Te({agent:e,onDone:t,onKillAgent:n,onBack:r}){let[i]=ne(),a=(0,Ee.useMemo)(()=>h(pe()),[]),s=B(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);O({"confirm:yes":t},{context:`Confirmation`});let c=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},l=o(e.prompt,`plan`),u=e.prompt.length>300?`${e.prompt.substring(0,297)}…`:e.prompt,f=e.result?.totalTokens??e.progress?.tokenCount,p=e.result?.totalToolUseCount??e.progress?.toolUseCount;return(0,U.jsx)(k,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:c,children:(0,U.jsx)(F,{title:(0,U.jsxs)(A,{children:[e.selectedAgent?.agentType??`agent`,` › `,e.description||`Async agent`]}),subtitle:(0,U.jsxs)(A,{children:[e.status!==`running`&&(0,U.jsxs)(A,{color:Se(e.status),children:[xe(e.status),` `,e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,U.jsxs)(A,{dimColor:!0,children:[s,f!==void 0&&f>0&&(0,U.jsxs)(U.Fragment,{children:[` · `,ue(f),` tokens`]}),p!==void 0&&p>0&&(0,U.jsxs)(U.Fragment,{children:[` `,`· `,p,` `,p===1?`tool`:`tools`]})]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,U.jsxs)(A,{children:[`Press `,t.keyName,` again to exit`]}):(0,U.jsxs)(j,{children:[r&&(0,U.jsx)(D,{shortcut:`←`,action:`go back`}),(0,U.jsx)(D,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,U.jsx)(D,{shortcut:`x`,action:`stop`})]}),children:(0,U.jsxs)(k,{flexDirection:`column`,children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,U.jsxs)(k,{flexDirection:`column`,children:[(0,U.jsx)(A,{bold:!0,dimColor:!0,children:`Progress`}),e.progress.recentActivities.map((t,n)=>(0,U.jsxs)(A,{dimColor:n<e.progress.recentActivities.length-1,wrap:`truncate-end`,children:[n===e.progress.recentActivities.length-1?`› `:` `,ve(t,a,i)]},n))]}),l?(0,U.jsx)(k,{marginTop:1,children:(0,U.jsx)(d,{addMargin:!1,planContent:l})}):(0,U.jsxs)(k,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(A,{bold:!0,dimColor:!0,children:`Prompt`}),(0,U.jsx)(A,{wrap:`wrap`,children:u})]}),e.status===`failed`&&e.error&&(0,U.jsxs)(k,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(A,{bold:!0,color:`error`,children:`Error`}),(0,U.jsx)(A,{color:`error`,wrap:`wrap`,children:e.error})]})]})})})}var Ee,U,De=e((()=>{Ee=t(M(),1),H(),P(),g(),he(),s(),R(),x(),_(),be(),we(),U=I()}));function W({status:e,label:t,suffix:n}){return(0,G.jsxs)(A,{color:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:void 0,dimColor:!0,children:[`(`,t??e,n,`)`]})}function Oe({shell:e}){switch(e.status){case`completed`:return(0,G.jsx)(W,{status:`completed`,label:`done`});case`failed`:return(0,G.jsx)(W,{status:`failed`,label:`error`});case`killed`:return(0,G.jsx)(W,{status:`killed`,label:`stopped`});case`running`:case`pending`:return(0,G.jsx)(W,{status:`running`})}}var G,ke=e((()=>{P(),G=I()}));function Ae({task:e,maxActivityWidth:t}){let n=t??40;switch(e.type){case`local_bash`:return(0,K.jsxs)(A,{children:[z(e.command,n,!0),` `,(0,K.jsx)(Oe,{shell:e})]});case`local_agent`:return(0,K.jsxs)(A,{children:[z(e.description,n,!0),` `,(0,K.jsx)(W,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]});case`local_workflow`:{let t=e;return(0,K.jsxs)(A,{children:[z(t.workflowName??e.summary??e.description,n,!0),` `,(0,K.jsx)(W,{status:e.status,label:e.status===`running`?`${t.agentCount} ${L(t.agentCount,`agent`)}`:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}case`dream`:{let t=e.filesTouched.length,n=e.phase===`updating`&&t>0?`${t} ${L(t,`file`)}`:`${e.sessionsReviewing} ${L(e.sessionsReviewing,`session`)}`;return(0,K.jsxs)(A,{children:[e.description,` `,(0,K.jsxs)(A,{dimColor:!0,children:[`· `,e.phase,` · `,n]}),` `,(0,K.jsx)(W,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}}}var K,je=e((()=>{P(),R(),ce(),ke(),K=I()}));function Me({task:e,onDone:t,onBack:n,onKill:r}){let i=B(e.startTime,e.status===`running`,1e3,0);O({"confirm:yes":t},{context:`Confirmation`});let a=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&n?(i.preventDefault(),n()):i.key===`x`&&e.status===`running`&&r&&(i.preventDefault(),r())},o=e.turns.filter(e=>e.text!==``),s=o.slice(-6),c=o.length-s.length;return(0,q.jsx)(k,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:a,children:(0,q.jsx)(F,{title:`Memory consolidation`,subtitle:(0,q.jsxs)(A,{dimColor:!0,children:[i,` · reviewing `,e.sessionsReviewing,` `,L(e.sessionsReviewing,`session`),e.filesTouched.length>0&&(0,q.jsxs)(q.Fragment,{children:[` `,`· `,e.filesTouched.length,` `,L(e.filesTouched.length,`file`),` touched`]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,q.jsxs)(A,{children:[`Press `,t.keyName,` again to exit`]}):(0,q.jsxs)(j,{children:[n&&(0,q.jsx)(D,{shortcut:`←`,action:`go back`}),(0,q.jsx)(D,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&r&&(0,q.jsx)(D,{shortcut:`x`,action:`stop`})]}),children:(0,q.jsxs)(k,{flexDirection:`column`,gap:1,children:[(0,q.jsxs)(A,{children:[(0,q.jsx)(A,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,q.jsx)(A,{color:`background`,children:`running`}):e.status===`completed`?(0,q.jsx)(A,{color:`success`,children:e.status}):(0,q.jsx)(A,{color:`error`,children:e.status})]}),s.length===0?(0,q.jsx)(A,{dimColor:!0,children:e.status===`running`?`Starting…`:`(no text output)`}):(0,q.jsxs)(q.Fragment,{children:[c>0&&(0,q.jsxs)(A,{dimColor:!0,children:[`(`,c,` earlier `,L(c,`turn`),`)`]}),s.map((e,t)=>(0,q.jsxs)(k,{flexDirection:`column`,children:[(0,q.jsx)(A,{wrap:`wrap`,children:e.text}),e.toolUseCount>0&&(0,q.jsxs)(A,{dimColor:!0,children:[` `,`(`,e.toolUseCount,` `,L(e.toolUseCount,`tool`),`)`]})]},t))]})]})})})}var q,Ne=e((()=>{H(),P(),g(),ce(),q=I()}));async function Pe(e){let t=l(e.id);try{let e=await re(t,Le);return{content:e.content,bytesTotal:e.bytesTotal}}catch{return{content:``,bytesTotal:0}}}function Fe({shell:e,onDone:t,onKillShell:n,onBack:r}){let{columns:i}=N(),[a,o]=(0,J.useState)(()=>Pe(e)),s=(0,J.useDeferredValue)(a);(0,J.useEffect)(()=>{if(e.status!==`running`)return;let t=setInterval((e,t)=>e(Pe(t)),1e3,o,e);return()=>clearInterval(t)},[e.id,e.status]);let c=()=>t(`Shell details dismissed`,{display:`system`});O({"confirm:yes":c},{context:`Confirmation`});let l=i=>{i.key===` `?(i.preventDefault(),t(`Shell details dismissed`,{display:`system`})):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},u=le(e.command,280);return(0,Y.jsx)(k,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:l,children:(0,Y.jsxs)(F,{title:`Shell details`,onCancel:c,color:`background`,inputGuide:t=>t.pending?(0,Y.jsxs)(A,{children:[`Press `,t.keyName,` again to exit`]}):(0,Y.jsxs)(j,{children:[r&&(0,Y.jsx)(D,{shortcut:`←`,action:`go back`}),(0,Y.jsx)(D,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,Y.jsx)(D,{shortcut:`x`,action:`stop`})]}),children:[(0,Y.jsxs)(k,{flexDirection:`column`,children:[(0,Y.jsxs)(A,{children:[(0,Y.jsx)(A,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,Y.jsxs)(A,{color:`background`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):e.status===`completed`?(0,Y.jsxs)(A,{color:`success`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):(0,Y.jsxs)(A,{color:`error`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]})]}),(0,Y.jsxs)(A,{children:[(0,Y.jsx)(A,{bold:!0,children:`Runtime:`}),` `,de((e.endTime??Date.now())-e.startTime)]}),(0,Y.jsxs)(A,{wrap:`wrap`,children:[(0,Y.jsx)(A,{bold:!0,children:`Command:`}),` `,u]})]}),(0,Y.jsxs)(k,{flexDirection:`column`,children:[(0,Y.jsx)(A,{bold:!0,children:`Output:`}),(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(A,{dimColor:!0,children:`Loading output…`}),children:(0,Y.jsx)(Ie,{outputPromise:s,columns:i})})]})]})})}function Ie({outputPromise:e,columns:t}){let{content:n,bytesTotal:r}=(0,J.use)(e);if(!n)return(0,Y.jsx)(A,{dimColor:!0,children:`No output available`});let i=[],a=n.length;for(let e=0;e<10&&a>0;e++){let e=n.lastIndexOf(`
2
- `,a-1);i.push(e+1),a=e}i.reverse();let o=r>n.length,s=[];for(let e=0;e<i.length;e++){let t=i[e],r=e<i.length-1?i[e+1]-1:n.length,a=n.slice(t,r);a&&s.push(a)}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(k,{borderStyle:`round`,paddingX:1,flexDirection:`column`,height:12,maxWidth:t-6,children:s.map((e,t)=>(0,Y.jsx)(A,{wrap:`truncate-end`,children:e},t))}),(0,Y.jsxs)(A,{dimColor:!0,italic:!0,children:[`Showing ${s.length} lines`,o?` of ${fe(r)}`:``]})]})}var J,Y,Le,Re=e((()=>{J=t(M(),1),b(),P(),g(),R(),ie(),f(),Y=I(),Le=8192}));function ze(e,t){return Object.values(e??{}).filter(T).filter(e=>!(e.type===`local_agent`&&e.id===t))}function Be({onDone:e,toolUseContext:t,initialDetailTaskId:n}){let r=p(e=>e.tasks),o=p(e=>e.foregroundedTaskId),s=i(),c=u(`chat:killAgents`,`Chat`,`ctrl+x ctrl+k`),l=r,d=(0,Z.useRef)(!1),[f,m]=(0,Z.useState)(()=>{if(n)return d.current=!0,{mode:`detail`,itemId:n};let e=ze(l,o);return e.length===1?(d.current=!0,{mode:`detail`,itemId:e[0].id}):{mode:`list`}}),[h,g]=(0,Z.useState)(0);ge(`background-tasks-dialog`);let{bashTasks:_,agentTasks:v,workflowTasks:y,dreamTasks:b,allSelectableItems:x}=(0,Z.useMemo)(()=>{let e=Object.values(l??{}).filter(T).map(Ve).sort((e,t)=>{let n=e.status,r=t.status;if(n===`running`&&r!==`running`)return-1;if(n!==`running`&&r===`running`)return 1;let i=`task`in e?e.task.startTime:0;return(`task`in t?t.task.startTime:0)-i}),t=e.filter(e=>e.type===`local_bash`),n=e.filter(e=>e.type===`local_agent`&&e.id!==o),r=e.filter(e=>e.type===`local_workflow`),i=e.filter(e=>e.type===`dream`);return{bashTasks:t,agentTasks:n,workflowTasks:r,dreamTasks:i,allSelectableItems:[...t,...n,...r,...i]}},[l,o]),S=x[h]??null;O({"confirm:previous":()=>g(e=>Math.max(0,e-1)),"confirm:next":()=>g(e=>Math.min(x.length-1,e+1)),"confirm:yes":()=>{let e=x[h];e&&m({mode:`detail`,itemId:e.id})}},{context:`Confirmation`,isActive:f.mode===`list`});let C=t=>{if(f.mode!==`list`)return;if(t.key===`left`){t.preventDefault(),e(`Background tasks dialog dismissed`,{display:`system`});return}let n=x[h];n&&t.key===`x`&&(t.preventDefault(),n.type===`local_bash`&&n.status===`running`?w(n.id):n.type===`local_agent`&&n.status===`running`?E(n.id):n.type===`local_workflow`&&n.status===`running`?$(n.id,s):n.type===`dream`&&n.status===`running`&&ne(n.id))};async function w(e){await ee.kill(e,s)}async function E(e){await te.kill(e,s)}async function ne(e){await a.kill(e,s)}let M=(0,Z.useEffectEvent)(e);(0,Z.useEffect)(()=>{if(f.mode!==`list`){let e=l?.[f.itemId];(!e||e.type!==`local_workflow`&&!T(e))&&(d.current?M(`Background tasks dialog dismissed`,{display:`system`}):m({mode:`list`}))}let e=x.length;h>=e&&e>0&&g(e-1)},[f,l,h,x,M]);let N=()=>{d.current&&x.length<=1?e(`Background tasks dialog dismissed`,{display:`system`}):(d.current=!1,m({mode:`list`}))};if(f.mode!==`list`&&l){let t=l[f.itemId];if(!t)return null;switch(t.type){case`local_bash`:return(0,Q.jsx)(Fe,{shell:t,onDone:e,onKillShell:()=>void w(t.id),onBack:N},`shell-${t.id}`);case`local_agent`:return(0,Q.jsx)(Te,{agent:t,onDone:e,onKillAgent:()=>void E(t.id),onBack:N},`agent-${t.id}`);case`local_workflow`:{let e=t.status===`running`?()=>$(t.id,s):void 0;return(0,Q.jsx)(k,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:t=>{t.key===`left`?(t.preventDefault(),N()):t.key===`x`&&e&&(t.preventDefault(),e())},children:(0,Q.jsx)(F,{title:t.workflowName,subtitle:(0,Q.jsxs)(A,{dimColor:!0,children:[t.status,t.summary?` · ${t.summary}`:``]}),onCancel:N,inputGuide:()=>(0,Q.jsxs)(j,{children:[(0,Q.jsx)(D,{shortcut:`←`,action:`go back`}),(0,Q.jsx)(D,{shortcut:`Esc`,action:`close`}),e&&(0,Q.jsx)(D,{shortcut:`x`,action:`stop`})]}),children:t.status===`failed`&&t.error?(0,Q.jsxs)(A,{color:`error`,children:[`失败原因:`,t.error]}):null})},`workflow-${t.id}`)}case`dream`:return(0,Q.jsx)(Me,{task:t,onDone:()=>e(`Background tasks dialog dismissed`,{display:`system`}),onBack:N,onKill:t.status===`running`?()=>void ne(t.id):void 0},`dream-${t.id}`)}}let P=se(_,e=>e.status===`running`),I=se(v,e=>e.status===`running`),re=oe([...P>0?[(0,Q.jsxs)(A,{children:[P,` `,P===1?`active shell`:`active shells`]},`shells`)]:[],...I>0?[(0,Q.jsxs)(A,{children:[I,` `,I===1?`active agent`:`active agents`]},`agents`)]:[]],e=>(0,Q.jsx)(A,{children:` · `},`separator-${e}`)),ie=[(0,Q.jsx)(D,{shortcut:`↑/↓`,action:`select`},`upDown`),(0,Q.jsx)(D,{shortcut:`Enter`,action:`view`},`enter`),...(S?.type===`local_bash`||S?.type===`local_agent`||S?.type===`local_workflow`||S?.type===`dream`)&&S.status===`running`?[(0,Q.jsx)(D,{shortcut:`x`,action:`stop`},`kill`)]:[],...v.some(e=>e.status===`running`)?[(0,Q.jsx)(D,{shortcut:c,action:`stop all agents`},`kill-all`)]:[],(0,Q.jsx)(D,{shortcut:`←/Esc`,action:`close`},`esc`)],ae=()=>e(`Background tasks dialog dismissed`,{display:`system`});function L(e){return e.pending?(0,Q.jsxs)(A,{children:[`Press `,e.keyName,` again to exit`]}):(0,Q.jsx)(j,{children:ie})}return(0,Q.jsx)(k,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:C,children:(0,Q.jsx)(F,{title:`Background tasks`,subtitle:re,onCancel:ae,color:`background`,inputGuide:L,children:x.length===0?(0,Q.jsx)(A,{dimColor:!0,children:`No tasks currently running`}):(0,Q.jsxs)(k,{flexDirection:`column`,children:[_.length>0&&(0,Q.jsxs)(k,{flexDirection:`column`,children:[v.length>0&&(0,Q.jsxs)(A,{dimColor:!0,children:[(0,Q.jsxs)(A,{bold:!0,children:[` `,`Shells`]}),` (`,_.length,`)`]}),(0,Q.jsx)(k,{flexDirection:`column`,children:_.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===S?.id},e.id))})]}),v.length>0&&(0,Q.jsxs)(k,{flexDirection:`column`,marginTop:+(_.length>0),children:[(0,Q.jsxs)(A,{dimColor:!0,children:[(0,Q.jsxs)(A,{bold:!0,children:[` `,`Local agents`]}),` (`,v.length,`)`]}),(0,Q.jsx)(k,{flexDirection:`column`,children:v.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===S?.id},e.id))})]}),y.length>0&&(0,Q.jsxs)(k,{flexDirection:`column`,marginTop:+(_.length>0||v.length>0),children:[(0,Q.jsxs)(A,{dimColor:!0,children:[(0,Q.jsxs)(A,{bold:!0,children:[` `,`Workflows`]}),` (`,y.length,`)`]}),(0,Q.jsx)(k,{flexDirection:`column`,children:y.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===S?.id},e.id))})]}),b.length>0&&(0,Q.jsx)(k,{flexDirection:`column`,marginTop:+(_.length>0||v.length>0||y.length>0),children:(0,Q.jsx)(k,{flexDirection:`column`,children:b.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===S?.id},e.id))})})]})})})}function Ve(e){switch(e.type){case`local_bash`:return{id:e.id,type:`local_bash`,label:e.command,status:e.status,task:e};case`local_agent`:return{id:e.id,type:`local_agent`,label:e.description,status:e.status,task:e};case`local_workflow`:return{id:e.id,type:`local_workflow`,label:e.summary??e.description,status:e.status,task:e};case`dream`:return{id:e.id,type:`dream`,label:e.description,status:e.status,task:e}}}function X({item:e,isSelected:t}){let{columns:n}=N(),i=Math.max(30,n-26);return(0,Q.jsxs)(k,{flexDirection:`row`,children:[(0,Q.jsx)(A,{children:t?`${r.pointer} `:` `}),(0,Q.jsx)(A,{color:t?`suggestion`:void 0,children:(0,Q.jsx)(Ae,{task:e.task,maxActivityWidth:i})})]})}var Z,Q,$,He=e((()=>{n(),Z=t(M(),1),b(),c(),v(),w(),S(),C(),ae(),_e(),P(),g(),y(),De(),je(),Ne(),Re(),m(),Q=I(),$=E}));export{H as a,Ce as i,He as n,B as o,we as r,Be as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t}from"./SelectMulti-CNE06VAN.js";import{n}from"./select-C_KXmqbI.js";var r=e((()=>{t(),n()}));export{r as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./Doctor-By_y3C2V.js";e();export{t as Doctor};
@@ -1,3 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{i as n,o as r}from"./envUtils-DcaKZlRU.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{Bw as o,C_ as s,Dp as c,Dx as l,El as u,Ex as d,Iw as f,KC as p,Lw as m,Op as h,Ox as g,Rw as _,SS as v,Tl as ee,Tx as te,Ub as y,Xi as b,YC as x,Yi as S,__ as C,_h as w,b_ as T,vh as ne,wl as re,wx as ie,xS as ae,x_ as oe}from"./loadAgentsDir-C1LkW7gl.js";import{Gt as se,I as E,P as D,ai as ce,t as O,x as k}from"./src-DL3w8VPk.js";import{t as A}from"./jsx-runtime-Bb4Xn-E0.js";import{Z as j,zt as M}from"./state-BowF111d.js";import{An as N,Fn as P,R as F,V as I}from"./settings-DKN4xSpQ.js";import{l as L,o as R}from"./stringUtils-BQm3OfeJ.js";import{f as z,gn as B,pn as V,s as H}from"./model-BwBE0Pt5.js";import{n as U,t as W}from"./ValidationErrorsList-BLtP647v.js";import{f as G,g as le,h as ue,i as de,n as fe,o as pe,p as me,r as he}from"./pidLock-D9do1Afy.js";import{n as ge,t as _e}from"./useExitOnCtrlCDWithKeybindings-CjW3gUOt.js";import{n as ve,t as ye}from"./McpParsingWarnings-DZejAh8b.js";import{n as be,t as xe}from"./PressEnterToContinue-DZc_s_pE.js";import{n as Se,t as Ce}from"./useSettingsErrors-DutJBiKZ.js";import{n as we,t as Te}from"./shadowedRuleDetection-Df-kZ_pK.js";import{n as Ee,r as De,t as K}from"./statusNoticeHelpers-X75JNlx5.js";import{join as q}from"path";function Oe(){if(!o())return null;let e=f();if(e.length===0)return null;let t=e.filter(e=>e.severity===`error`),n=e.filter(e=>e.severity===`warning`);return(0,J.jsxs)(E,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,J.jsx)(D,{bold:!0,color:t.length>0?`error`:`warning`,children:`Keybinding Configuration Issues`}),(0,J.jsxs)(E,{children:[(0,J.jsx)(D,{dimColor:!0,children:`Location: `}),(0,J.jsx)(D,{dimColor:!0,children:m()})]}),(0,J.jsxs)(E,{marginLeft:1,flexDirection:`column`,marginTop:1,children:[t.map((e,t)=>(0,J.jsxs)(E,{flexDirection:`column`,children:[(0,J.jsxs)(E,{children:[(0,J.jsx)(D,{dimColor:!0,children:`└ `}),(0,J.jsx)(D,{color:`error`,children:`[Error]`}),(0,J.jsxs)(D,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(E,{marginLeft:3,children:(0,J.jsxs)(D,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`error-${t}`)),n.map((e,t)=>(0,J.jsxs)(E,{flexDirection:`column`,children:[(0,J.jsxs)(E,{children:[(0,J.jsx)(D,{dimColor:!0,children:`└ `}),(0,J.jsx)(D,{color:`warning`,children:`[Warning]`}),(0,J.jsxs)(D,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(E,{marginLeft:3,children:(0,J.jsxs)(D,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`warning-${t}`))]})]})}var J,ke=e((()=>{O(),_(),J=A()}));function Ae(){if(!p.isSupportedPlatform()||!p.isSandboxEnabledInSettings())return null;let e=p.checkDependencies(),t=e.errors.length>0,n=e.warnings.length>0;return!t&&!n?null:(0,Y.jsxs)(E,{flexDirection:`column`,children:[(0,Y.jsx)(D,{bold:!0,children:`Sandbox`}),(0,Y.jsxs)(D,{children:[`└ Status: `,(0,Y.jsx)(D,{color:t?`error`:`warning`,children:t?`Missing dependencies`:`Available (with warnings)`})]}),e.errors.map((e,t)=>(0,Y.jsxs)(D,{color:`error`,children:[`└ `,e]},t)),e.warnings.map((e,t)=>(0,Y.jsxs)(D,{color:`warning`,children:[`└ `,e]},t)),t&&(0,Y.jsx)(D,{dimColor:!0,children:`└ Run /sandbox for install instructions`})]})}var Y,je=e((()=>{O(),x(),Y=A()}));async function Me(){let e=T(await oe());if(e.length===0)return null;let t=e.sort((e,t)=>t.content.length-e.content.length).map(e=>`${e.path}: ${e.content.length.toLocaleString()} chars`);return{type:`agentsmd_files`,severity:`warning`,message:e.length===1?`Large AGENTS.md file detected (${e[0].content.length.toLocaleString()} chars > ${C.toLocaleString()})`:`${e.length} large AGENTS.md files detected (each > ${C.toLocaleString()} chars)`,details:t,currentValue:e.length,threshold:C}}async function Ne(e){if(!e)return null;let t=Ee(e);if(t<=15e3)return null;let n=e.activeAgents.filter(e=>e.source!==`built-in`).map(e=>{let t=`${e.agentType}: ${e.whenToUse}`;return{name:e.agentType,tokens:b(t)}}).sort((e,t)=>t.tokens-e.tokens),r=n.slice(0,5).map(e=>`${e.name}: ~${e.tokens.toLocaleString()} tokens`);return n.length>5&&r.push(`(${n.length-5} more custom agents)`),{type:`agent_descriptions`,severity:`warning`,message:`Large agent descriptions (~${t.toLocaleString()} tokens > ${K.toLocaleString()})`,details:r,currentValue:t,threshold:K}}async function X(e,t,n){let r=e.filter(e=>e.isMcp);if(r.length===0)return null;try{let{mcpToolTokens:r,mcpToolDetails:i}=await w(e,t,n,H());if(r<=Z)return null;let a=new Map;for(let e of i){let t=e.name.split(`__`)[1]||`unknown`,n=a.get(t)||{count:0,tokens:0};a.set(t,{count:n.count+1,tokens:n.tokens+e.tokens})}let o=Array.from(a.entries()).sort((e,t)=>t[1].tokens-e[1].tokens),s=o.slice(0,5).map(([e,t])=>`${e}: ${t.count} tools (~${t.tokens.toLocaleString()} tokens)`);return o.length>5&&s.push(`(${o.length-5} more servers)`),{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${r.toLocaleString()} tokens > ${Z.toLocaleString()})`,details:s,currentValue:r,threshold:Z}}catch{let e=r.reduce((e,t)=>e+b(((t.name?.length||0)+t.description.length).toString()),0);return e<=Z?null:{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${e.toLocaleString()} tokens estimated > ${Z.toLocaleString()})`,details:[`${r.length} MCP tools detected (token count estimated)`],currentValue:e,threshold:Z}}}async function Pe(e){let t=Te(await e(),{sandboxAutoAllowEnabled:p.isSandboxingEnabled()&&p.isAutoAllowBashIfSandboxedEnabled()});if(t.length===0)return null;let n=t.flatMap(e=>[`${I(e.rule.ruleValue)}: ${e.reason}`,` Fix: ${e.fix}`]);return{type:`unreachable_rules`,severity:`warning`,message:`${t.length} ${L(t.length,`unreachable permission rule`)} detected`,details:n,currentValue:t.length,threshold:0}}async function Fe(e,t,n){let[r,i,a,o]=await Promise.all([Me(),Ne(t),X(e,n,t),Pe(n)]);return{agentsMdWarning:r,agentWarning:i,mcpWarning:a,unreachableRulesWarning:o}}var Z,Ie=e((()=>{S(),ne(),s(),z(),F(),we(),x(),De(),R(),Z=25e3}));function Le({onDone:e}){let t=h(e=>e.agentDefinitions),r=h(e=>e.mcp.tools),i=h(e=>e.toolPermissionContext),o=h(e=>e.plugins.errors);ge();let s=(0,Q.useMemo)(()=>r||[],[r]),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(null),[m,_]=(0,Q.useState)(null),v=Se().filter(e=>e.mcpErrorMetadata===void 0),y=(0,Q.useMemo)(()=>[{name:`BASH_MAX_OUTPUT_LENGTH`,default:ie,upperLimit:te},{name:`TASK_MAX_OUTPUT_LENGTH`,default:re,upperLimit:ee},{name:`CLAUDE_CODE_MAX_OUTPUT_TOKENS`,...V(`claude-opus-4-7`)}].map(e=>{let t=process.env[e.name],n=g(e.name,t,e.default,e.upperLimit);return{name:e.name,...n}}).filter(e=>e.status!==`valid`),[]);(0,Q.useEffect)(()=>{ue().then(l),(async()=>{let e=q(n(),`agents`),r=q(j(),`.workmate`,`agents`),{activeAgents:a,allAgents:o,failedFiles:c}=t,[l,u]=await Promise.all([P(e),P(r)]),f={activeAgents:a.map(e=>({agentType:e.agentType,source:e.source})),userAgentsDir:e,projectAgentsDir:r,userDirExists:l,projectDirExists:u,failedFiles:c};d(f);let m=await Fe(s,{activeAgents:a,allAgents:o,failedFiles:c},async()=>i);if(p(m),pe()){let e=q(G(),`claude`,`locks`),t=fe(e),n=he(e);_({enabled:!0,locks:n,locksDir:e,staleLocksCleaned:t})}else _({enabled:!1,locks:[],locksDir:``,staleLocksCleaned:0})})()},[i,s,t]);let b=(0,Q.useCallback)(()=>{e(`Work Mate diagnostics dismissed`,{display:`system`})},[e]);return se({"confirm:yes":b,"confirm:no":b},{context:`Confirmation`}),c?(0,$.jsxs)(k,{children:[(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Diagnostics`}),(0,$.jsxs)(D,{children:[`└ Currently running: `,c.installationType,` (`,c.version,`)`]}),c.packageManager&&(0,$.jsxs)(D,{children:[`└ Package manager: `,c.packageManager]}),(0,$.jsxs)(D,{children:[`└ Path: `,c.installationPath]}),(0,$.jsxs)(D,{children:[`└ Invoked: `,c.invokedBinary]}),(0,$.jsxs)(D,{children:[`└ Config install method: `,c.configInstallMethod]}),(0,$.jsxs)(D,{children:[`└ Search: `,c.ripgrepStatus.working?`OK`:`Not working`,` (`,c.ripgrepStatus.mode===`embedded`?`bundled`:c.ripgrepStatus.mode===`builtin`?`vendor`:c.ripgrepStatus.systemPath||`system`,`)`]}),c.ripgrepStatus.note&&(0,$.jsxs)(D,{color:`warning`,children:[`└ Note: `,c.ripgrepStatus.note]}),c.recommendation&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(D,{}),(0,$.jsxs)(D,{color:`warning`,children:[`Recommendation: `,c.recommendation.split(`
2
- `)[0]]}),(0,$.jsx)(D,{dimColor:!0,children:c.recommendation.split(`
3
- `)[1]})]}),c.multipleInstallations.length>1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(D,{}),(0,$.jsx)(D,{color:`warning`,children:`Warning: Multiple installations found`}),c.multipleInstallations.map((e,t)=>(0,$.jsxs)(D,{children:[`└ `,e.type,` at `,e.path]},t))]}),c.warnings.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(D,{}),c.warnings.map((e,t)=>(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsxs)(D,{color:`warning`,children:[`Warning: `,e.issue]}),(0,$.jsxs)(D,{children:[`Fix: `,e.fix]})]},t))]}),v.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,$.jsx)(D,{bold:!0,children:`Invalid Settings`}),(0,$.jsx)(W,{errors:v})]})]}),(0,$.jsx)(Ae,{}),(0,$.jsx)(ye,{}),(0,$.jsx)(Oe,{}),y.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Environment Variables`}),y.map((e,t)=>(0,$.jsxs)(D,{children:[`└ `,e.name,`:`,` `,(0,$.jsx)(D,{color:e.status===`capped`?`warning`:`error`,children:e.message})]},t))]}),m?.enabled&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Version Locks`}),m.staleLocksCleaned>0&&(0,$.jsxs)(D,{dimColor:!0,children:[`└ Cleaned `,m.staleLocksCleaned,` stale lock(s)`]}),m.locks.length===0?(0,$.jsx)(D,{dimColor:!0,children:`└ No active version locks`}):m.locks.map((e,t)=>(0,$.jsxs)(D,{children:[`└ `,e.version,`: PID `,e.pid,` `,e.isProcessRunning?(0,$.jsx)(D,{children:`(running)`}):(0,$.jsx)(D,{color:`warning`,children:`(stale)`})]},t))]}),u?.failedFiles&&u.failedFiles.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,color:`error`,children:`Agent Parse Errors`}),(0,$.jsxs)(D,{color:`error`,children:[`└ Failed to parse `,u.failedFiles.length,` agent file(s):`]}),u.failedFiles.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e.path,`: `,e.error]},t))]}),o.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,color:`error`,children:`Plugin Errors`}),(0,$.jsxs)(D,{color:`error`,children:[`└ `,o.length,` plugin error(s) detected:`]}),o.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e.source||`unknown`,`plugin`in e&&e.plugin?` [${e.plugin}]`:``,`: `,ae(e)]},t))]}),f?.unreachableRulesWarning&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,color:`warning`,children:`Unreachable Permission Rules`}),(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,f.unreachableRulesWarning.message]})]}),f.unreachableRulesWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]}),f&&(f.agentsMdWarning||f.agentWarning||f.mcpWarning)&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Context Usage Warnings`}),f.agentsMdWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,f.agentsMdWarning.message]})]}),(0,$.jsxs)(D,{children:[` `,`└ Files:`]}),f.agentsMdWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]}),f.agentWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,f.agentWarning.message]})]}),(0,$.jsxs)(D,{children:[` `,`└ Top contributors:`]}),f.agentWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]}),f.mcpWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,f.mcpWarning.message]})]}),(0,$.jsxs)(D,{children:[` `,`└ MCP servers:`]}),f.mcpWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]})]}),(0,$.jsx)(E,{children:(0,$.jsx)(xe,{})})]}):(0,$.jsx)(k,{children:(0,$.jsx)(D,{dimColor:!0,children:`Checking installation status…`})})}var Q,$,Re=e((()=>{i(),Q=t(ce(),1),ke(),ve(),B(),r(),M(),O(),be(),je(),U(),Ce(),_e(),y(),c(),v(),Ie(),le(),l(),N(),de(),d(),u(),me(),$=A()}));export{Re as n,Le as t};
@@ -1,11 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{D as t,I as n,Lt as r,P as i,T as a,ai as o,t as s,y as c}from"./src-DL3w8VPk.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{n as u,r as d}from"./analytics-DJobLaWP.js";import{i as f,o as p,r as m,s as h,t as g}from"./grove-Dq8QbQ9o.js";import{t as _}from"./select-C_KXmqbI.js";import{t as v}from"./CustomSelect-B46Eh0gU.js";var y=e(o(),1);u(),s(),v();var b=l(),x=` _____________
2
- | \\ \\
3
- | NEW TERMS \\__\\
4
- | |
5
- | ---------- |
6
- | ---------- |
7
- | ---------- |
8
- | ---------- |
9
- | ---------- |
10
- | |
11
- |______________|`;function S(){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(i,{children:[`An update to our Consumer Terms and Privacy Policy will take effect on `,(0,b.jsx)(i,{bold:!0,children:`October 8, 2025`}),`. You can accept the updated terms today.`]}),(0,b.jsxs)(n,{flexDirection:`column`,children:[(0,b.jsx)(i,{children:`What's changing?`}),(0,b.jsx)(n,{paddingLeft:1,children:(0,b.jsxs)(i,{children:[(0,b.jsx)(i,{children:`· `}),(0,b.jsx)(i,{bold:!0,children:`You can help improve Work Mate `}),(0,b.jsxs)(i,{children:[`— Allow the use of your chats and coding sessions to train and improve Claude AI models. Change anytime in your Privacy Settings (`,(0,b.jsx)(r,{url:`https://claude.ai/settings/data-privacy-controls`}),`).`]})]})}),(0,b.jsx)(n,{paddingLeft:1,children:(0,b.jsxs)(i,{children:[(0,b.jsx)(i,{children:`· `}),(0,b.jsx)(i,{bold:!0,children:`Updates to data retention `}),(0,b.jsx)(i,{children:`— To help us improve our AI models and safety protections, we're extending data retention to 5 years.`})]})})]}),(0,b.jsxs)(i,{children:[`Learn more (`,(0,b.jsx)(r,{url:`https://www.anthropic.com/news/updates-to-our-consumer-terms`}),`) or read the updated Consumer Terms (`,(0,b.jsx)(r,{url:`https://anthropic.com/legal/terms`}),`) and Privacy Policy (`,(0,b.jsx)(r,{url:`https://anthropic.com/legal/privacy`}),`)`]})]})}function C(){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(i,{children:`We've updated our Consumer Terms and Privacy Policy.`}),(0,b.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,b.jsx)(i,{children:`What's changing?`}),(0,b.jsxs)(n,{flexDirection:`column`,children:[(0,b.jsx)(i,{bold:!0,children:`Help improve Work Mate`}),(0,b.jsx)(i,{children:`Allow the use of your chats and coding sessions to train and improve Claude AI models. You can change this anytime in Privacy Settings`}),(0,b.jsx)(r,{url:`https://claude.ai/settings/data-privacy-controls`})]}),(0,b.jsxs)(n,{flexDirection:`column`,children:[(0,b.jsx)(i,{bold:!0,children:`How this affects data retention`}),(0,b.jsx)(i,{children:`Turning ON the improve Work Mate setting extends data retention from 30 days to 5 years. Turning it OFF keeps the default 30-day data retention. Delete data anytime.`})]})]}),(0,b.jsxs)(i,{children:[`Learn more (`,(0,b.jsx)(r,{url:`https://www.anthropic.com/news/updates-to-our-consumer-terms`}),`) or read the updated Consumer Terms (`,(0,b.jsx)(r,{url:`https://anthropic.com/legal/terms`}),`) and Privacy Policy (`,(0,b.jsx)(r,{url:`https://anthropic.com/legal/privacy`}),`)`]})]})}function w({showIfAlreadyViewed:e,location:r,onDone:o}){let[s,l]=(0,y.useState)(null),[u,v]=(0,y.useState)(null);if((0,y.useEffect)(()=>{async function t(){let[t,n]=await Promise.all([f(),m()]),i=n.success?n.data:null;v(i);let a=g(t,n,e);if(l(a),!a){o(`skip_rendering`);return}p(),d(`tengu_grove_policy_viewed`,{location:r,dismissable:i?.notice_is_grace_period})}t()},[e,r,o]),s===null||!s)return null;async function w(e){switch(e){case`accept_opt_in`:await h(!0),d(`tengu_grove_policy_submitted`,{state:!0,dismissable:u?.notice_is_grace_period});break;case`accept_opt_out`:await h(!1),d(`tengu_grove_policy_submitted`,{state:!1,dismissable:u?.notice_is_grace_period});break;case`defer`:d(`tengu_grove_policy_dismissed`,{state:!0});break;case`escape`:d(`tengu_grove_policy_escaped`,{});break}o(e)}let T=u?.domain_excluded?[{label:`Accept terms · Help improve Work Mate: OFF (for emails with your domain)`,value:`accept_opt_out`}]:[{label:`Accept terms · Help improve Work Mate: ON`,value:`accept_opt_in`},{label:`Accept terms · Help improve Work Mate: OFF`,value:`accept_opt_out`}];function E(){if(u?.notice_is_grace_period){w(`defer`);return}w(`escape`)}return(0,b.jsxs)(c,{title:`Updates to Consumer Terms and Policies`,color:`professionalBlue`,onCancel:E,inputGuide:e=>e.pending?(0,b.jsxs)(i,{children:[`Press `,e.keyName,` again to exit`]}):(0,b.jsxs)(a,{children:[(0,b.jsx)(t,{shortcut:`Enter`,action:`confirm`}),(0,b.jsx)(t,{shortcut:`Esc`,action:`cancel`})]}),children:[(0,b.jsxs)(n,{flexDirection:`row`,children:[(0,b.jsx)(n,{flexDirection:`column`,gap:1,flexGrow:1,children:u?.notice_is_grace_period?(0,b.jsx)(S,{}):(0,b.jsx)(C,{})}),(0,b.jsx)(n,{flexShrink:0,children:(0,b.jsx)(i,{color:`professionalBlue`,children:x})})]}),(0,b.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,b.jsxs)(n,{flexDirection:`column`,children:[(0,b.jsx)(i,{bold:!0,children:`Please select how you'd like to continue`}),(0,b.jsx)(i,{children:`Your choice takes effect immediately upon confirmation.`})]}),(0,b.jsx)(_,{options:[...T,...u?.notice_is_grace_period?[{label:`Not now`,value:`defer`}]:[]],onChange:e=>w(e),onCancel:E})]})]})}export{w as GroveDialog};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{$_ as n,Ap as r,Dp as i,Hv as a,Iv as o,Op as s,Q_ as c,X_ as l,Yv as u,_y as d,av as f,cv as p,cw as m,cy as h,db as ee,ev as g,ey as te,hb as ne,hy as re,kp as ie,lw as _,ly as v,mb as y,my as b,nv as x,ny as ae,py as S,rv as C,sv as w,sy as T,ty as E,ub as D}from"./loadAgentsDir-C1LkW7gl.js";import{ai as O}from"./src-DL3w8VPk.js";import{t as k}from"./jsx-runtime-Bb4Xn-E0.js";import{ut as oe,zt as A}from"./state-BowF111d.js";import{L as j,N as M,c as se,i as ce}from"./debug-8DCufdSp.js";import{rt as N,tt as P}from"./settings-DKN4xSpQ.js";import{c as F,l as I,o as L}from"./log-DaILwWJa.js";import{n as R,r as z}from"./analytics-DJobLaWP.js";import{o as B,t as V}from"./localSearch-DFo_WTMm.js";import{n as H,t as U}from"./omit-Dl1Us_PY.js";import{n as W,t as le}from"./notifications-B0DTaYoy.js";function G(e){let t=`plugin`in e?e.plugin:`no-plugin`;return`${e.type}:${e.source}:${t}`}function K(e,t){t.length!==0&&e(e=>{let n=new Set(e.plugins.errors.map(e=>G(e))),r=t.filter(e=>!n.has(G(e)));return r.length===0?e:{...e,plugins:{...e.plugins,errors:[...e.plugins.errors,...r]}}})}function ue(e,t=!1){let i=ie(),u=s(e=>e.authVersion),d=s(e=>e.mcp.pluginReconnectKey),m=r(),h=(0,q.useRef)(new Map),{addNotification:ne}=W(),C=(0,q.useRef)([]),w=(0,q.useRef)(null),O=(0,q.useCallback)(()=>{w.current=null;let e=C.current;e.length!==0&&(C.current=[],m(t=>{let n=t.mcp;for(let t of e){let{tools:e,commands:r,resources:i,...a}=t,s=a.type===`disabled`||a.type===`failed`?e??[]:e,c=a.type===`disabled`||a.type===`failed`?r??[]:r,l=a.type===`disabled`||a.type===`failed`?i??[]:i,u=P(a.name),d=n.clients.findIndex(e=>e.name===a.name)===-1?[...n.clients,a]:n.clients.map(e=>e.name===a.name?a:e),f=s===void 0?n.tools:[..._(n.tools,e=>e.name?.startsWith(u)),...s],p=c===void 0?n.commands:[..._(n.commands,e=>o(e,a.name)),...c],m=l===void 0?n.resources:{...n.resources,...l.length>0?{[a.name]:l}:H(n.resources,a.name)};n={...n,clients:d,tools:f,commands:p,resources:m}}return{...t,mcp:n}}))},[m]),k=(0,q.useCallback)(e=>{C.current.push(e),w.current===null&&(w.current=setTimeout(O,16))},[O]),A=(0,q.useCallback)(({client:e,tools:t,commands:r,resources:i})=>{switch(k({...e,tools:t,commands:r,resources:i}),e.type){case`connected`:p(e.client,e.name,m),e.client.onclose=()=>{let t=e.config.type??`stdio`;if(l(e.name,e.config).catch(()=>{se(`Failed to invalidate the server cache: ${e.name}`)}),v(e.name)){F(e.name,`Server is disabled, skipping automatic reconnection`);return}if(t!==`stdio`&&t!==`sdk`){let n=de(t);F(e.name,`${n} transport closed/disconnected, attempting automatic reconnection`);let r=h.current.get(e.name);r&&(clearTimeout(r),h.current.delete(e.name)),(async()=>{for(let t=1;t<=J;t++){if(v(e.name)){F(e.name,`Server disabled during reconnection, stopping retry`),h.current.delete(e.name);return}k({...e,type:`pending`,reconnectAttempt:t,maxReconnectAttempts:J});let r=Date.now();try{let i=await f(e.name,e.config),a=Date.now()-r;if(i.client.type===`connected`){F(e.name,`${n} reconnection successful after ${a}ms (attempt ${t})`),h.current.delete(e.name),A(i);return}if(F(e.name,`${n} reconnection attempt ${t} completed with status: ${i.client.type}`),t===J){F(e.name,`Max reconnection attempts (${J}) reached, giving up`),h.current.delete(e.name),A(i);return}}catch(i){let a=Date.now()-r;if(I(e.name,`${n} reconnection attempt ${t} failed after ${a}ms: ${i}`),t===J){F(e.name,`Max reconnection attempts (${J}) reached, giving up`),h.current.delete(e.name),k({...e,type:`failed`});return}}let i=Math.min(Y*2**(t-1),X);F(e.name,`Scheduling reconnection attempt ${t+1} in ${i}ms`),await new Promise(t=>{let n=setTimeout(t,i);h.current.set(e.name,n)})}})()}else k({...e,type:`failed`})},e.capabilities?.tools?.listChanged&&e.client.setNotificationHandler(y,async()=>{F(e.name,`Received tools/list_changed notification, refreshing tools`);try{let t=g.cache.get(e.name);g.cache.delete(e.name);let n=await g(e),r=n.length;t?t.then(e=>{z(`tengu_mcp_list_changed`,{type:`tools`,previousCount:e.length,newCount:r})},()=>{z(`tengu_mcp_list_changed`,{type:`tools`,newCount:r})}):z(`tengu_mcp_list_changed`,{type:`tools`,newCount:r}),k({...e,tools:n})}catch(t){I(e.name,`Failed to refresh tools after list_changed notification: ${M(t)}`)}}),e.capabilities?.prompts?.listChanged&&e.client.setNotificationHandler(D,async()=>{F(e.name,`Received prompts/list_changed notification, refreshing prompts`),z(`tengu_mcp_list_changed`,{type:`prompts`});try{c.cache.delete(e.name);let[t,n]=await Promise.all([c(e),Promise.resolve([])]);k({...e,commands:[...t,...n]}),V()}catch(t){I(e.name,`Failed to refresh prompts after list_changed notification: ${M(t)}`)}}),e.capabilities?.resources?.listChanged&&e.client.setNotificationHandler(ee,async()=>{F(e.name,`Received resources/list_changed notification, refreshing resources`),z(`tengu_mcp_list_changed`,{type:`resources`});try{n.cache.delete(e.name);{let t=await n(e);k({...e,resources:t})}}catch(t){I(e.name,`Failed to refresh resources after list_changed notification: ${M(t)}`)}});break;case`needs-auth`:case`failed`:case`pending`:case`disabled`:break}},[k]),j=oe();return(0,q.useEffect)(()=>{async function n(){let{servers:n,errors:r}=t?{servers:{},errors:[]}:await T(e),i={...n,...e};K(m,r),m(e=>{let{stale:t,...n}=a(e.mcp,i);for(let e of t){let t=h.current.get(e.name);t&&(clearTimeout(t),h.current.delete(e.name)),e.type===`connected`&&(e.client.onclose=void 0,l(e.name,e.config).catch(()=>{}))}let r=new Set(n.clients.map(e=>e.name)),o=Object.entries(i).filter(([e])=>!r.has(e)).map(([e,t])=>({name:e,type:v(e)?`disabled`:`pending`,config:t}));return o.length===0&&t.length===0?e:{...e,mcp:{...e.mcp,...n,clients:[...n.clients,...o]}}})}n().catch(e=>{I(`useManageMCPConnections`,`Failed to initialize servers as pending: ${M(e)}`)})},[t,e,m,j,d]),(0,q.useEffect)(()=>{let n=!1;async function r(){let r;t||E()?r=Promise.resolve({}):(b(),r=re());let{servers:i,errors:a}=t?{servers:{},errors:[]}:await T(e,r);if(n)return;K(m,a);let o={...i,...e},s=Object.fromEntries(Object.entries(o).filter(([e])=>!v(e)));x(A,s).catch(e=>{I(`useManageMcpConnections`,`Failed to get MCP resources: ${M(e)}`)});let c={};if(!t){if(c=ae(await r).allowed,n)return;if(Object.keys(c).length>0){let{servers:e}=te(c,o);c=e}if(Object.keys(c).length>0){m(e=>{let t=new Set(e.mcp.clients.map(e=>e.name)),n=Object.entries(c).filter(([e])=>!t.has(e)).map(([e,t])=>({name:e,type:v(e)?`disabled`:`pending`,config:t}));return n.length===0?e:{...e,mcp:{...e.mcp,clients:[...e.mcp.clients,...n]}}});let e=Object.fromEntries(Object.entries(c).filter(([e])=>!v(e)));x(A,e).catch(e=>{I(`useManageMcpConnections`,`Failed to get claude.ai MCP resources: ${M(e)}`)})}}let l={...o,...c},u={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0};for(let[e,t]of Object.entries(l))t.scope===`enterprise`?u.enterprise++:t.scope===`user`?u.global++:t.scope===`project`?u.project++:t.scope===`local`?u.user++:t.scope===`dynamic`?u.plugin++:t.scope===`claudeai`&&u.claudeai++;z(`tengu_mcp_servers`,{...u})}return r(),()=>{n=!0}},[t,e,A,m,u,j,d]),(0,q.useEffect)(()=>{let e=h.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear(),w.current!==null&&(clearTimeout(w.current),w.current=null,O())}},[O]),{reconnectMcpServer:(0,q.useCallback)(async e=>{let t=i.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);let n=h.current.get(e);n&&(clearTimeout(n),h.current.delete(e));let r=await f(e,t.config);return A(r),r},[i,A]),toggleMcpServer:(0,q.useCallback)(async e=>{let t=i.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);if(t.type!==`disabled`){let n=h.current.get(e);n&&(clearTimeout(n),h.current.delete(e)),S(e,!1),t.type===`connected`&&await l(e,t.config),k({name:e,type:`disabled`,config:t.config})}else{S(e,!0),k({name:e,type:`pending`,config:t.config});let n=await f(e,t.config);A(n)}},[i,k,A])}}function de(e){switch(e){case`http`:return`HTTP`;case`ws`:case`ws-ide`:return`WebSocket`;default:return`SSE`}}var q,J,Y,X,fe=e((()=>{q=t(O(),1),A(),C(),B(),ne(),U(),m(),R(),h(),ce(),le(),i(),j(),L(),w(),d(),N(),u(),J=5,Y=1e3,X=3e4}));function pe(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpReconnect must be used within MCPConnectionManager`);return e.reconnectMcpServer}function me(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpToggleEnabled must be used within MCPConnectionManager`);return e.toggleMcpServer}function he({children:e,dynamicMcpConfig:t,isStrictMcpConfig:n}){let{reconnectMcpServer:r,toggleMcpServer:i}=ue(t,n),a=(0,Z.useMemo)(()=>({reconnectMcpServer:r,toggleMcpServer:i}),[r,i]);return(0,Q.jsx)($.Provider,{value:a,children:e})}var Z,Q,$,ge=e((()=>{Z=t(O(),1),fe(),Q=k(),$=(0,Z.createContext)(null)}));export{me as i,ge as n,pe as r,he as t};