@readmagic/workmate 0.0.17 → 0.0.19

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 (385) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-YAhnVwyN.js → AddWorkspaceDirectory-9FcHMKgX.js} +1 -1
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-Bny8WDwC.js +1 -0
  3. package/dist/chunks/{AgentsMdExternalIncludesDialog-Ba4GYFl3.js → AgentsMdExternalIncludesDialog-DLnj3JQO.js} +1 -1
  4. package/dist/chunks/{App-mri25OrC.js → App-NkBqbDbC.js} +1 -1
  5. package/dist/chunks/ApproveApiKey-BKzkEkW-.js +1 -0
  6. package/dist/chunks/{ApproveApiKey-DCw6d7dm.js → ApproveApiKey-rgB6AsYD.js} +1 -1
  7. package/dist/chunks/BackgroundTasksDialog-CcViruUO.js +2 -0
  8. package/dist/chunks/{BypassPermissionsModeDialog-B5QBJTB4.js → BypassPermissionsModeDialog-D254L98G.js} +1 -1
  9. package/dist/chunks/{DiffDialog-Bd-DcTsK.js → DiffDialog-6Srcz3NW.js} +2 -2
  10. package/dist/chunks/Doctor-DYEdLRxR.js +1 -0
  11. package/dist/chunks/Doctor-DiNxlXfC.js +3 -0
  12. package/dist/chunks/ExitFlow-Bt2De110.js +2 -0
  13. package/dist/chunks/{Grove-CClEZT2e.js → Grove-DC4jyxeB.js} +1 -1
  14. package/dist/chunks/{HybridTransport-DyEuslQB.js → HybridTransport-DArmWb1V.js} +1 -1
  15. package/dist/chunks/{InvalidConfigDialog-Wyrk_cXR.js → InvalidConfigDialog-DFiB0Kzc.js} +1 -1
  16. package/dist/chunks/{InvalidSettingsDialog-Cr9fmSyh.js → InvalidSettingsDialog-BHNo2__T.js} +1 -1
  17. package/dist/chunks/MCPConnectionManager-CdpO2Tj9.js +1 -0
  18. package/dist/chunks/MCPToolListView-Ch4jOk_x.js +1 -0
  19. package/dist/chunks/{McpParsingWarnings-BF4np2Y3.js → McpParsingWarnings-D4UQ8Q2e.js} +1 -1
  20. package/dist/chunks/MessageSelector-BgsrdJur.js +3 -0
  21. package/dist/chunks/Messages-DB1pmDY_.js +10 -0
  22. package/dist/chunks/{Onboarding-BAJXV7Ay.js → Onboarding-BnjdTwci.js} +1 -1
  23. package/dist/chunks/{PromptInputFooterSuggestions-Cm4WN3qd.js → PromptInputFooterSuggestions-Chg9U-BC.js} +1 -1
  24. package/dist/chunks/{PromptInputHelpMenu-ESj8sOpK.js → PromptInputHelpMenu-C0ZSo12s.js} +1 -1
  25. package/dist/chunks/QueryEngine-bKlupZpA.js +1 -0
  26. package/dist/chunks/REPL-Cg8UXYpX.js +128 -0
  27. package/dist/chunks/REPL-yzvMFfaU.js +1 -0
  28. package/dist/chunks/RemoteSessionManager-CRWOHvKf.js +2 -0
  29. package/dist/chunks/{ResumeConversation-NSVT3gn7.js → ResumeConversation-Ld7tYLKO.js} +1 -1
  30. package/dist/chunks/{SSETransport-CDGMGrxN.js → SSETransport-pPrlSZNF.js} +1 -1
  31. package/dist/chunks/SearchExtraToolsTool-CdgQlm--.js +1 -0
  32. package/dist/chunks/Settings-CsOlPcIW.js +2 -0
  33. package/dist/chunks/{TeleportProgress-8cS6aHVO.js → TeleportProgress-Di-PMey7.js} +1 -1
  34. package/dist/chunks/{TeleportRepoMismatchDialog-B0epkMgp.js → TeleportRepoMismatchDialog-CDv1cbo-.js} +1 -1
  35. package/dist/chunks/{TeleportResumeWrapper-Bb14JeEk.js → TeleportResumeWrapper-Bmf13tGU.js} +1 -1
  36. package/dist/chunks/{ThemePicker-CnX8faYA.js → ThemePicker-B3AO3_jA.js} +1 -1
  37. package/dist/chunks/{TrustDialog-6wJF3W6K.js → TrustDialog-C0aiR_LU.js} +1 -1
  38. package/dist/chunks/{ValidationErrorsList-Cuq6W2yc.js → ValidationErrorsList-BfZ5gcIv.js} +1 -1
  39. package/dist/chunks/add-dir-w1Ay3861.js +1 -0
  40. package/dist/chunks/{agentDisplay-QqGqcHGz.js → agentDisplay-D01ZlnVX.js} +1 -1
  41. package/dist/chunks/agents-B_hUgPnR.js +101 -0
  42. package/dist/chunks/{agents-DFPEienW.js → agents-Bxenhf8S.js} +1 -1
  43. package/dist/chunks/allErrors-C_iHQOlK.js +1 -0
  44. package/dist/chunks/{api-B3Wnozaf.js → api-C5ULzZny.js} +1 -1
  45. package/dist/chunks/api-CB3e0De0.js +1 -0
  46. package/dist/chunks/auth-CsYEYXBO.js +1 -0
  47. package/dist/chunks/auth-CubXYcRl.js +1 -0
  48. package/dist/chunks/{auth-CQGJitIV.js → auth-DvcZHXGk.js} +1 -1
  49. package/dist/chunks/backgroundHousekeeping-BGKR5cdA.js +17 -0
  50. package/dist/chunks/backgroundHousekeeping-CykbtljP.js +1 -0
  51. package/dist/chunks/{banner-HfMnBd03.js → banner-BkUdig-T.js} +1 -1
  52. package/dist/chunks/{bg-DltfF1_K.js → bg-tGgpwpYx.js} +2 -2
  53. package/dist/chunks/branch-CqQxCSHG.js +2 -0
  54. package/dist/chunks/{break-cache-Cd1yQ-0h.js → break-cache-CcwOjTKt.js} +3 -3
  55. package/dist/chunks/bridgeConfig-Cp2x_wtE.js +1 -0
  56. package/dist/chunks/{bridgeConfig-B3mR0kJ0.js → bridgeConfig-MxsnEEPx.js} +1 -1
  57. package/dist/chunks/{bridgeMessaging-wZ5EKxW_.js → bridgeMessaging-Bx5pkkkx.js} +1 -1
  58. package/dist/chunks/bridgePointer-DfTOjgtX.js +1 -0
  59. package/dist/chunks/bridgeStatusUtil-B9EcQksI.js +1 -0
  60. package/dist/chunks/btw-DeznoRrw.js +1 -0
  61. package/dist/chunks/caches-BiVRgePi.js +1 -0
  62. package/dist/chunks/caches-CGzKSWiP.js +1 -0
  63. package/dist/chunks/{capacityWake-LRiPhPeM.js → capacityWake-BpP6c7x3.js} +1 -1
  64. package/dist/chunks/{ccrClient-EisctZbc.js → ccrClient-CimQTd0b.js} +1 -1
  65. package/dist/chunks/{claudeDesktop-CB3UCt7U.js → claudeDesktop-DPc_SaVn.js} +1 -1
  66. package/dist/chunks/{clear-BjtPf2Jb.js → clear-KvoD-lFN.js} +1 -1
  67. package/dist/chunks/{cliLaunch-xIVvtPZy.js → cliLaunch-DDtwAolw.js} +1 -1
  68. package/dist/chunks/{client-DNEVh6Wu.js → client-9uHzAmFH.js} +1 -1
  69. package/dist/chunks/client-BVal_QII.js +1 -0
  70. package/dist/chunks/{client-Bb2eZnuq.js → client-C_jBL1yC.js} +1 -1
  71. package/dist/chunks/client-CmnPWgLq.js +1 -0
  72. package/dist/chunks/client-Dd7CKMRX.js +1 -0
  73. package/dist/chunks/commands-CrzVgHxp.js +1 -0
  74. package/dist/chunks/{compact-w8AhLkr6.js → compact-Dgzve3dI.js} +2 -2
  75. package/dist/chunks/{config-BSkuQZNf.js → config-DRy1I12M.js} +2 -2
  76. package/dist/chunks/config-Df8jooTW.js +1 -0
  77. package/dist/chunks/{config-D78R57VA.js → config-e0Goy478.js} +1 -1
  78. package/dist/chunks/{context-Btn2JU2y.js → context-Dz-bbYCw.js} +1 -1
  79. package/dist/chunks/{context-noninteractive-044464Vs.js → context-noninteractive-ApbVPU86.js} +5 -5
  80. package/dist/chunks/context-noninteractive-m4O3VtG7.js +1 -0
  81. package/dist/chunks/conversation-BYBX07j8.js +1 -0
  82. package/dist/chunks/conversation-CJ-d0O-U.js +1 -0
  83. package/dist/chunks/{createSSHSession-C0KSI0fJ.js → createSSHSession-DOz_Ox1_.js} +1 -1
  84. package/dist/chunks/createSession-C_-ZEQT5.js +1 -0
  85. package/dist/chunks/{createSession-8ScCWTKb.js → createSession-yR87Rhiv.js} +1 -1
  86. package/dist/chunks/crossProjectResume-DNnZo3gU.js +40 -0
  87. package/dist/chunks/cwd-DLK3znO7.js +1 -0
  88. package/dist/chunks/cwd-Nh5IZNKO.js +1 -0
  89. package/dist/chunks/{datadog-BqINRWAW.js → datadog-DBgIEaEd.js} +1 -1
  90. package/dist/chunks/{debug-BQj6h99Q.js → debug-D58GQBDG.js} +1 -1
  91. package/dist/chunks/{debugUtils-B86DM1Sp.js → debugUtils-DXBRbwCE.js} +1 -1
  92. package/dist/chunks/{detached--wGwkuHX.js → detached-Biz-xhu0.js} +1 -1
  93. package/dist/chunks/{detectRepository-Qy3zKoyn.js → detectRepository-CDOJ-M7h.js} +1 -1
  94. package/dist/chunks/detectRepository-Cv9-k6dg.js +1 -0
  95. package/dist/chunks/{diff-CcrSQNvQ.js → diff-qOom_T1G.js} +1 -1
  96. package/dist/chunks/{directoryCompletion-i2oWpaUe.js → directoryCompletion-BDGcGDuv.js} +1 -1
  97. package/dist/chunks/doctor-CflXjqVK.js +1 -0
  98. package/dist/chunks/{entry-oVZ7Z59B.js → entry-EmOA7oWN.js} +4 -4
  99. package/dist/chunks/{esm-BZciQG9N.js → esm-DBMVQDVv.js} +1 -1
  100. package/dist/chunks/{execFileNoThrow-DYm1GeGn.js → execFileNoThrow-Bmb5HEFz.js} +1 -1
  101. package/dist/chunks/{execSyncWrapper-CqvQqke-.js → execSyncWrapper-C3ZFV9od.js} +1 -1
  102. package/dist/chunks/{exit-jikLI2Zh.js → exit-DDrAFCzE.js} +1 -1
  103. package/dist/chunks/{extraUsage-BT3in1Aj.js → extraUsage-DylXI7Fc.js} +1 -1
  104. package/dist/chunks/extractMemories-B_8wZpXA.js +1 -0
  105. package/dist/chunks/fast-4ajfJv-M.js +1 -0
  106. package/dist/chunks/{fast-CKhtBOx7.js → fast-BCkhj9Dq.js} +1 -1
  107. package/dist/chunks/{fetchModelList-DmaMgpa2.js → fetchModelList-BbjuFHQT.js} +1 -1
  108. package/dist/chunks/fetchModelList-V8_e2O1N.js +1 -0
  109. package/dist/chunks/{fileSuggestions-BfG3sbET.js → fileSuggestions-Ct7vKEpR.js} +2 -2
  110. package/dist/chunks/{firstPartyEventLogger-Q3fMF0BR.js → firstPartyEventLogger-CxUuXQhL.js} +2 -2
  111. package/dist/chunks/firstPartyEventLogger-YQm0DoVu.js +1 -0
  112. package/dist/chunks/flushGate-BZe_QwEz.js +1 -0
  113. package/dist/chunks/{gemini-L8Gj2B4H.js → gemini-8sSwOtEf.js} +1 -1
  114. package/dist/chunks/{generateSessionName-cAL5T7pG.js → generateSessionName-vT1khubt.js} +1 -1
  115. package/dist/chunks/{genericProcessUtils-Bbcbi11g.js → genericProcessUtils-6E7fB1dI.js} +1 -1
  116. package/dist/chunks/{git-DplvjXEY.js → git-By_J4XJL.js} +1 -1
  117. package/dist/chunks/git-zJCasBa6.js +1 -0
  118. package/dist/chunks/githubRepoPathMapping-CzgPGOHQ.js +1 -0
  119. package/dist/chunks/{goal-D-x2WXm7.js → goal-CznQA1n1.js} +1 -1
  120. package/dist/chunks/{grok-DtypRM4d.js → grok-cEzUsG-s.js} +1 -1
  121. package/dist/chunks/{grove-CSivzrhe.js → grove--HtQL4QZ.js} +1 -1
  122. package/dist/chunks/{help-DKZhC0lL.js → help-B6A_kDQA.js} +1 -1
  123. package/dist/chunks/hooks-CJY5Vfy6.js +1 -0
  124. package/dist/chunks/{hooks-D_afUDcs.js → hooks-CN5hLrhi.js} +2 -2
  125. package/dist/chunks/initReplBridge-BJhmlcVt.js +1 -0
  126. package/dist/chunks/install-DUOtI2Hq.js +1 -0
  127. package/dist/chunks/{instrumentation-IljwxX0V.js → instrumentation-DpgB3GFx.js} +4 -4
  128. package/dist/chunks/{job-N25KhSUu.js → job-DDoX1iFe.js} +1 -1
  129. package/dist/chunks/{jwtUtils-YCoZL0FW.js → jwtUtils-C_LG1txt.js} +1 -1
  130. package/dist/chunks/keybindings-BGTuYfk-.js +1 -0
  131. package/dist/chunks/{launchLocalMemory-DJsuNLIf.js → launchLocalMemory-CoWeLNeP.js} +1 -1
  132. package/dist/chunks/{launchOnboarding-CVvuxeH-.js → launchOnboarding-CTIBGSLV.js} +1 -1
  133. package/dist/chunks/{external-CEp-aPkt.js → lazySchema-DULtBUCI.js} +1 -1
  134. package/dist/chunks/{loadAgentsDir-CbtNPJV3.js → loadAgentsDir-DXOkUcW3.js} +587 -597
  135. package/dist/chunks/loadAgentsDir-Dxz1vp3F.js +1 -0
  136. package/dist/chunks/{loadPluginHooks-BxkDBFd6.js → loadPluginHooks-DrNVtTBq.js} +1 -1
  137. package/dist/chunks/loader-C33o_5kS.js +1 -0
  138. package/dist/chunks/localSearch-CCs5fOd_.js +1 -0
  139. package/dist/chunks/{localSearch-B5mTHBwK.js → localSearch-DnT21UkF.js} +1 -1
  140. package/dist/chunks/{log-BlJ7CcKG.js → log-CZ7ploQm.js} +1 -1
  141. package/dist/chunks/{logoV2Utils-D5nRpirL.js → logoUtils-YwL3izJt.js} +1 -1
  142. package/dist/chunks/{magicDocs-C9aIo4Oe.js → magicDocs-rxv0rR8E.js} +2 -2
  143. package/dist/chunks/{main-DeUt_aE2.js → main-BOvY4O6D.js} +30 -30
  144. package/dist/chunks/{main-Zh18lf2J.js → main-Blm02_Js.js} +2 -2
  145. package/dist/chunks/managedEnv-CpgCYISH.js +1 -0
  146. package/dist/chunks/managedEnv-CrnBYTtQ.js +1 -0
  147. package/dist/chunks/{mappers-Del1KoA7.js → mappers-DYtq2XVS.js} +1 -1
  148. package/dist/chunks/mcp-BPvcoKDY.js +1 -0
  149. package/dist/chunks/mcp-BfqsHRx0.js +2 -0
  150. package/dist/chunks/mcp-BoU3TNFs.js +6 -0
  151. package/dist/chunks/{memoize-_2f7NWDv.js → memoize-CumjjK2Q.js} +1 -1
  152. package/dist/chunks/memory-BPKRdkBb.js +1 -0
  153. package/dist/chunks/{mode-DPbrxU32.js → mode-CXpXux2s.js} +1 -1
  154. package/dist/chunks/model-CxPYKiW1.js +1 -0
  155. package/dist/chunks/model-Cxx3suBa.js +1 -0
  156. package/dist/chunks/model-aEJ54cMA.js +1 -0
  157. package/dist/chunks/{modelOptions-SMq3one0.js → modelOptions-BqBHEyiR.js} +1 -1
  158. package/dist/chunks/{nativeInstaller-DTJ4clp-.js → nativeInstaller-CaXwRpoR.js} +1 -1
  159. package/dist/chunks/omit-DZUxsClb.js +1 -0
  160. package/dist/chunks/onChangeAppState-qHXqufwy.js +1 -0
  161. package/dist/chunks/{openai-D9KvLMrj.js → openai-_FQ9EhuR.js} +2 -2
  162. package/dist/chunks/{panel-Bg_0PHE6.js → panel-CVd1dzYl.js} +1 -1
  163. package/dist/chunks/parser-Cq9X7HMP.js +1 -0
  164. package/dist/chunks/{parser-a2S_eFyE.js → parser-eVu-cTRs.js} +1 -1
  165. package/dist/chunks/partition-BgwHlPsO.js +1 -0
  166. package/dist/chunks/permissions-Dv5d5Nu3.js +3 -0
  167. package/dist/chunks/pidLock-CEhbTkBE.js +3 -0
  168. package/dist/chunks/{plan-dG2H4eQl.js → plan-DVPBW5OS.js} +1 -1
  169. package/dist/chunks/{platform-DVeTi9mp.js → platform-DMQxcm4K.js} +1 -1
  170. package/dist/chunks/plugin-Bh2eBwLW.js +17 -0
  171. package/dist/chunks/{pluginAutoupdate-B9W_vxOG.js → pluginAutoupdate-C2YbEHrP.js} +1 -1
  172. package/dist/chunks/{pluginBlocklist-BvdBsnJG.js → pluginBlocklist-B2NAKaB9.js} +1 -1
  173. package/dist/chunks/{pluginCliCommands-NKIgFTUF.js → pluginCliCommands-Cw5TrYYb.js} +1 -1
  174. package/dist/chunks/{pluginFlagging-C0PtAJEg.js → pluginFlagging-BDTgCYuC.js} +1 -1
  175. package/dist/chunks/pluginOperations-BBwGEdfC.js +2 -0
  176. package/dist/chunks/pluginStartupCheck-CHx379_R.js +1 -0
  177. package/dist/chunks/{pluginStartupCheck-p0njap1l.js → pluginStartupCheck-DhhMk3dA.js} +1 -1
  178. package/dist/chunks/{plugins-B9WBqOAW.js → plugins-r0h93GT_.js} +4 -4
  179. package/dist/chunks/pollConfig-2nFzv6Hy.js +1 -0
  180. package/dist/chunks/poorMode-BTIe8W_H.js +1 -0
  181. package/dist/chunks/poorMode-CKQfWf3S.js +1 -0
  182. package/dist/chunks/print-CDzhHi2F.js +14 -0
  183. package/dist/chunks/processBashCommand-DmdCAWOR.js +1 -0
  184. package/dist/chunks/processSlashCommand-B43TkiaI.js +5 -0
  185. package/dist/chunks/prompt-C50mDqWv.js +1 -0
  186. package/dist/chunks/{prompt-BRGC5U9Y.js → prompt-DEioJrx_.js} +17 -17
  187. package/dist/chunks/prompt-WGH9CcXh.js +1 -0
  188. package/dist/chunks/{promptEditor-CRIw6vJS.js → promptEditor-eJzbtNn4.js} +1 -1
  189. package/dist/chunks/{protocolHandler--eQQuSyx.js → protocolHandler-C-CFTcUJ.js} +1 -1
  190. package/dist/chunks/{proxy-C0j74LqT.js → proxy-BhIc7-mj.js} +1 -1
  191. package/dist/chunks/reconciler-DZP4dJJG.js +1 -0
  192. package/dist/chunks/refresh-vaY-Sr80.js +1 -0
  193. package/dist/chunks/{registerProtocol-DrWIX3Lb.js → registerProtocol-Xsq4ldwg.js} +1 -1
  194. package/dist/chunks/{reload-plugins-Cl6wvT6V.js → reload-plugins-m9CzoIxu.js} +1 -1
  195. package/dist/chunks/{remoteBridgeCore-DnFZoXaw.js → remoteBridgeCore-C4vSr1gp.js} +1 -1
  196. package/dist/chunks/remoteManagedSettings-6RAHPt_g.js +1 -0
  197. package/dist/chunks/{rename-CdzxOzN5.js → rename-DmauGVBX.js} +1 -1
  198. package/dist/chunks/{renderOptions-CkqTbz6d.js → renderOptions-D-aQZbzS.js} +1 -1
  199. package/dist/chunks/resume-ut_pBrLN.js +2 -0
  200. package/dist/chunks/{ripgrep-DsLUmulz.js → ripgrep-C3jtZL7k.js} +1 -1
  201. package/dist/chunks/ripgrep-CBUbn6Po.js +1 -0
  202. package/dist/chunks/{runtimeObserver-Dov-m2dl.js → runtimeObserver-C2vjqtCE.js} +2 -2
  203. package/dist/chunks/{runtimeObserver-CwtRE2cj.js → runtimeObserver-CSroopId.js} +1 -1
  204. package/dist/chunks/sandbox-adapter-CL0qdcxn.js +1 -0
  205. package/dist/chunks/{sandbox-toggle-DWCrG9zV.js → sandbox-toggle-BJKd1ZYk.js} +1 -1
  206. package/dist/chunks/searchExtraTools-ByWuNCGo.js +1 -0
  207. package/dist/chunks/{session-L5191BSn.js → session-DTin6hOR.js} +1 -1
  208. package/dist/chunks/sessionFileAccessHooks-DorzHolr.js +1 -0
  209. package/dist/chunks/sessionObserver-Dy6NFlzL.js +1 -0
  210. package/dist/chunks/{sessionObserver-DpY0DOjI.js → sessionObserver-iAJLH92a.js} +1 -1
  211. package/dist/chunks/{sessionState-BlbRQ3Y6.js → sessionState-DAcub-HK.js} +2 -2
  212. package/dist/chunks/sessionStorage-DItJMkwx.js +1 -0
  213. package/dist/chunks/{sessionTracing-DqVx8aFD.js → sessionTracing-Dvi520eN.js} +1 -1
  214. package/dist/chunks/{settings-CvhsRFaT.js → settings-3xZ0fsvE.js} +5 -5
  215. package/dist/chunks/settings-Crx1cI1u.js +1 -0
  216. package/dist/chunks/settingsSync-aHn3p-6J.js +1 -0
  217. package/dist/chunks/setup-CK3ybjjM.js +3 -0
  218. package/dist/chunks/{shadowedRuleDetection-Gerk3t93.js → shadowedRuleDetection-BL7dEv-u.js} +1 -1
  219. package/dist/chunks/{shellQuote-D3Ocv_U-.js → shellQuote-Ddgr1vif.js} +1 -1
  220. package/dist/chunks/{sideQuestion-RndkXExy.js → sideQuestion-Ct87yvOR.js} +1 -1
  221. package/dist/chunks/{sinks-CfzgqLH5.js → sinks-Bmn3li0M.js} +1 -1
  222. package/dist/chunks/sinks-QQ_6Op7q.js +1 -0
  223. package/dist/chunks/skillChangeDetector-Bco3UoeW.js +1 -0
  224. package/dist/chunks/{skillGapStore-CLxhWLyq.js → skillGapStore-MtlRyYmT.js} +2 -2
  225. package/dist/chunks/{skillLifecycle-CSNX2qOH.js → skillLifecycle-Drs6gEv9.js} +2 -2
  226. package/dist/chunks/{skillSearchPanel-CsQDjy_E.js → skillSearchPanel-DkvmjNaw.js} +3 -3
  227. package/dist/chunks/{skills-DM9ACPW-.js → skills-axToWEo0.js} +1 -1
  228. package/dist/chunks/{startupProfiler-2sjXZkIP.js → startupProfiler-CbzxVmbv.js} +1 -1
  229. package/dist/chunks/startupProfiler-uHetQush.js +1 -0
  230. package/dist/chunks/state-BStOuCh4.js +1 -0
  231. package/dist/chunks/{state-BPFYBqm1.js → state-D5D6QpTX.js} +1 -1
  232. package/dist/chunks/{stats-Dq-5qizS.js → stats-Ce15gc3E.js} +1 -1
  233. package/dist/chunks/status-3uevwSMo.js +1 -0
  234. package/dist/chunks/{status-C5v7KsX4.js → status-CGp4uRlH.js} +2 -2
  235. package/dist/chunks/{statusNoticeHelpers-BY_8pK19.js → statusNoticeHelpers-BrN_2q7H.js} +1 -1
  236. package/dist/chunks/{stringUtils-BjnclTLB.js → stringUtils-CKD8qDqx.js} +1 -1
  237. package/dist/chunks/switcher-99gm2vpe.js +1 -0
  238. package/dist/chunks/switcher-DJDxjLPQ.js +1 -0
  239. package/dist/chunks/syncCache-B3OVvp8K.js +1 -0
  240. package/dist/chunks/{tasks-qVyXOLBf.js → tasks-t5zT_D32.js} +1 -1
  241. package/dist/chunks/{teleport-Deq_ecN9.js → teleport-CvX_nUjQ.js} +1 -1
  242. package/dist/chunks/{templateJobs-CntPyct-.js → templateJobs-Bm8bovHx.js} +1 -1
  243. package/dist/chunks/{terminalSetup-DDvQ0K5e.js → terminalSetup-7PdC4fV5.js} +1 -1
  244. package/dist/chunks/{terminalSetup-JJiXmszo.js → terminalSetup-kWdZRKWq.js} +1 -1
  245. package/dist/chunks/{theme-DVWYzSct.js → theme-DzaSXOpQ.js} +1 -1
  246. package/dist/chunks/{tmux-g0cQ0Buz.js → tmux-CpGd0Aca.js} +1 -1
  247. package/dist/chunks/{toolEventObserver-BZn8ZJB5.js → toolEventObserver-C_nHI27x.js} +1 -1
  248. package/dist/chunks/toolPool-CgKK0K8f.js +1 -0
  249. package/dist/chunks/{trustedDevice-CdLAZK6m.js → trustedDevice-Bb7O8_tj.js} +1 -1
  250. package/dist/chunks/trustedDevice-C2gnF9Lc.js +1 -0
  251. package/dist/chunks/{types-BomO8WUz.js → types-APu4OCXJ.js} +2 -2
  252. package/dist/chunks/{udsClient-DSvRPCvR.js → udsClient-U7MEfYj7.js} +1 -1
  253. package/dist/chunks/{upstreamproxy-DYoLvdM9.js → upstreamproxy-CTOuotLO.js} +1 -1
  254. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-YSWYVWk6.js → useExitOnCtrlCDWithKeybindings-D0uqGxGw.js} +1 -1
  255. package/dist/chunks/useMainLoopModel-BGPOmBkl.js +1 -0
  256. package/dist/chunks/useManagePlugins-ITVFO9dz.js +1 -0
  257. package/dist/chunks/{useMergedTools-B4qRVJ8b.js → useMergedTools-rQ19rFvH.js} +1 -1
  258. package/dist/chunks/{useSearchInput-DfUNYhqC.js → useSearchInput-CXTa-leH.js} +1 -1
  259. package/dist/chunks/useSettingsErrors-Xc6RYjYF.js +1 -0
  260. package/dist/chunks/{userAgent-CNPTS7ix.js → userAgent-CJ5Rp9kc.js} +1 -1
  261. package/dist/chunks/{util-6aJHnBQ_.js → util-CD3ar4of.js} +1 -1
  262. package/dist/chunks/validatePlugin-CxrlCKc1.js +1 -0
  263. package/dist/chunks/{vim-s-wmybpU.js → vim-BagKUX4j.js} +1 -1
  264. package/dist/chunks/{which-BR8YVCCW.js → which-BxQ1hpjp.js} +1 -1
  265. package/dist/chunks/{windowsPaths-BmXyrasP.js → windowsPaths-BdhjMYTm.js} +1 -1
  266. package/dist/chunks/windowsPaths-DtGZ83kH.js +1 -0
  267. package/dist/chunks/{workSecret-BUd8cQ6-.js → workSecret-CaM2yIJD.js} +1 -1
  268. package/dist/chunks/{workerRegistry-BwJ54Lzk.js → workerRegistry-BGJtgrko.js} +2 -2
  269. package/dist/chunks/worktree-CanG5GhE.js +1 -0
  270. package/dist/cli.js +1 -1
  271. package/package.json +1 -1
  272. package/dist/chunks/AgentsMdExternalIncludesDialog--D4BeNAN.js +0 -1
  273. package/dist/chunks/ApproveApiKey-lv4Sg0RR.js +0 -1
  274. package/dist/chunks/BackgroundTasksDialog-CZND8e_Z.js +0 -2
  275. package/dist/chunks/Doctor-C9t7udHN.js +0 -3
  276. package/dist/chunks/Doctor-V-JLC4e3.js +0 -1
  277. package/dist/chunks/ExitFlow-CShdrKmr.js +0 -2
  278. package/dist/chunks/MCPConnectionManager-BnUw0nYN.js +0 -1
  279. package/dist/chunks/MCPToolListView-CY2EezWF.js +0 -1
  280. package/dist/chunks/MessageSelector-Dtt2Sf65.js +0 -3
  281. package/dist/chunks/Messages-D5Uuapmf.js +0 -10
  282. package/dist/chunks/QueryEngine-B79JLwG4.js +0 -1
  283. package/dist/chunks/REPL-B7evbhvN.js +0 -1
  284. package/dist/chunks/REPL-cAXdORs2.js +0 -128
  285. package/dist/chunks/RemoteSessionManager-C5pAD0Lh.js +0 -2
  286. package/dist/chunks/SearchExtraToolsTool-CddjJcAH.js +0 -1
  287. package/dist/chunks/Settings-_b5Yxt_9.js +0 -2
  288. package/dist/chunks/add-dir-LLAv-rGS.js +0 -1
  289. package/dist/chunks/agents-C8wRUTNV.js +0 -101
  290. package/dist/chunks/allErrors-DUYYPpdH.js +0 -1
  291. package/dist/chunks/api-BAT--5sp.js +0 -1
  292. package/dist/chunks/auth-DaJXqwN5.js +0 -1
  293. package/dist/chunks/auth-DkhPycBL.js +0 -1
  294. package/dist/chunks/backgroundHousekeeping-Bjb_Jc7L.js +0 -17
  295. package/dist/chunks/backgroundHousekeeping-V-dg2j2E.js +0 -1
  296. package/dist/chunks/branch-BWq5ynjm.js +0 -2
  297. package/dist/chunks/bridgeConfig-D31i4BRi.js +0 -1
  298. package/dist/chunks/bridgePointer-CiHy2tTN.js +0 -1
  299. package/dist/chunks/bridgeStatusUtil-mvVQSVN-.js +0 -1
  300. package/dist/chunks/btw-XNgXHnNr.js +0 -1
  301. package/dist/chunks/caches-ByLjTvdy.js +0 -1
  302. package/dist/chunks/caches-ckqJ4Qso.js +0 -1
  303. package/dist/chunks/client-Bl43xcRk.js +0 -1
  304. package/dist/chunks/client-Pap_HyZZ.js +0 -1
  305. package/dist/chunks/client-zhozU2ws.js +0 -1
  306. package/dist/chunks/commands-BDhn7EPO.js +0 -1
  307. package/dist/chunks/config-CbAvTdZ7.js +0 -1
  308. package/dist/chunks/context-noninteractive-ulRLlYg5.js +0 -1
  309. package/dist/chunks/conversation-D08lU377.js +0 -1
  310. package/dist/chunks/conversation-a82khZ_n.js +0 -1
  311. package/dist/chunks/createSession-CnlPXXkA.js +0 -1
  312. package/dist/chunks/crossProjectResume-BCN462Wa.js +0 -40
  313. package/dist/chunks/cwd-Besi3Os3.js +0 -1
  314. package/dist/chunks/cwd-DpqwaYHw.js +0 -1
  315. package/dist/chunks/detectRepository-tRUoPOKy.js +0 -1
  316. package/dist/chunks/doctor-DRFDBrH1.js +0 -1
  317. package/dist/chunks/extractMemories-BsQU2bVO.js +0 -1
  318. package/dist/chunks/fast-B9vVL3sY.js +0 -1
  319. package/dist/chunks/fetchModelList-BeL40TyR.js +0 -1
  320. package/dist/chunks/firstPartyEventLogger-6GwZ6VLr.js +0 -1
  321. package/dist/chunks/flushGate-COa_KO98.js +0 -1
  322. package/dist/chunks/git-BaSq69E7.js +0 -1
  323. package/dist/chunks/githubRepoPathMapping-Px3_GeD1.js +0 -1
  324. package/dist/chunks/hooks-DvVuNKRx.js +0 -1
  325. package/dist/chunks/initReplBridge-sTaq4a0K.js +0 -1
  326. package/dist/chunks/install-BWe3Jz4M.js +0 -1
  327. package/dist/chunks/keybindings-DLEorhlY.js +0 -1
  328. package/dist/chunks/lazySchema-B4D4qJVE.js +0 -1
  329. package/dist/chunks/loadAgentsDir-D0gl_H2S.js +0 -1
  330. package/dist/chunks/localSearch-D3UrYUre.js +0 -1
  331. package/dist/chunks/managedEnv-ADMKY7-G.js +0 -1
  332. package/dist/chunks/managedEnv-CDxyrUw1.js +0 -1
  333. package/dist/chunks/mcp-Bh3MNBIj.js +0 -6
  334. package/dist/chunks/mcp-D7vMhEOV.js +0 -2
  335. package/dist/chunks/mcp-nnBVM5Lt.js +0 -1
  336. package/dist/chunks/memory-DtqQhHu8.js +0 -1
  337. package/dist/chunks/model-B50j-O5v.js +0 -1
  338. package/dist/chunks/model-DLG1nrnf.js +0 -1
  339. package/dist/chunks/model-DlLO7TSx.js +0 -1
  340. package/dist/chunks/omit-CMldTqqy.js +0 -1
  341. package/dist/chunks/onChangeAppState-EAnsmOuo.js +0 -1
  342. package/dist/chunks/parser-x-w3ikxt.js +0 -1
  343. package/dist/chunks/partition-B8Y4jvjW.js +0 -1
  344. package/dist/chunks/permissions-cDtIZRM1.js +0 -3
  345. package/dist/chunks/pidLock-Br3_YNi_.js +0 -3
  346. package/dist/chunks/plugin-CzQHuIlP.js +0 -17
  347. package/dist/chunks/pluginOperations-wUUdFpu9.js +0 -2
  348. package/dist/chunks/pluginStartupCheck-hDT6pEAd.js +0 -1
  349. package/dist/chunks/pollConfig-BgpfHQPJ.js +0 -1
  350. package/dist/chunks/poorMode-DD88nPJ4.js +0 -1
  351. package/dist/chunks/poorMode-wm2WkPF0.js +0 -1
  352. package/dist/chunks/print-G3DgPTxy.js +0 -14
  353. package/dist/chunks/processBashCommand-zLWgCRws.js +0 -1
  354. package/dist/chunks/processSlashCommand-BHBnHBjj.js +0 -5
  355. package/dist/chunks/prompt-Ct3Ryb3C.js +0 -1
  356. package/dist/chunks/prompt-TZJKyomz.js +0 -1
  357. package/dist/chunks/reconciler-DiU1RvGD.js +0 -1
  358. package/dist/chunks/refresh-DEXe3Lmx.js +0 -1
  359. package/dist/chunks/remoteManagedSettings-BboLJ46D.js +0 -1
  360. package/dist/chunks/resume-DgFXYWTN.js +0 -2
  361. package/dist/chunks/ripgrep-Di-2j8Ws.js +0 -1
  362. package/dist/chunks/sandbox-adapter-CtEngx-6.js +0 -1
  363. package/dist/chunks/searchExtraTools-zFMN5MqY.js +0 -1
  364. package/dist/chunks/sessionFileAccessHooks-C2VjT-PU.js +0 -1
  365. package/dist/chunks/sessionObserver-BuhXr3FP.js +0 -1
  366. package/dist/chunks/sessionStorage-CiYSwyY3.js +0 -1
  367. package/dist/chunks/settings-BgHApyGL.js +0 -1
  368. package/dist/chunks/settingsSync-BhlegQAU.js +0 -1
  369. package/dist/chunks/setup-DvnKMqDy.js +0 -3
  370. package/dist/chunks/sinks-Cf4vx9UX.js +0 -1
  371. package/dist/chunks/skillChangeDetector-BQx4xe_b.js +0 -1
  372. package/dist/chunks/startupProfiler-B2fyaBEa.js +0 -1
  373. package/dist/chunks/state-CsdHk8n-.js +0 -1
  374. package/dist/chunks/status-C3z0CSBw.js +0 -1
  375. package/dist/chunks/switcher-C9VsM-ip.js +0 -1
  376. package/dist/chunks/switcher-CnBKuiNp.js +0 -1
  377. package/dist/chunks/syncCache-Dff4hbz4.js +0 -1
  378. package/dist/chunks/toolPool-Dzp1ob3I.js +0 -1
  379. package/dist/chunks/trustedDevice-1Q4FTNyX.js +0 -1
  380. package/dist/chunks/useMainLoopModel-C1JRp4zE.js +0 -1
  381. package/dist/chunks/useManagePlugins-DfuI4Nhd.js +0 -1
  382. package/dist/chunks/useSettingsErrors-Bls74ocI.js +0 -1
  383. package/dist/chunks/validatePlugin-BajM6yNf.js +0 -1
  384. package/dist/chunks/windowsPaths-BybjGW7e.js +0 -1
  385. package/dist/chunks/worktree-BFP10vim.js +0 -1
@@ -1,5 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$_ as t,Ap as n,B as r,Bb as i,Cm as a,Ds as o,Dv as s,E as c,Ea as l,Fc as u,Fw as d,GC as f,Ga as p,Gw as m,Ha as h,Ic as g,Ii as _,KC as v,La as y,Li as b,Mp as x,Np as S,Nw as C,Of as w,Pw as T,Ra as ee,Sa as E,Sf as D,Sm as O,Tf as k,Ti as A,Ts as j,Uh as M,V as N,WC as te,Wh as ne,Ww as re,Xp as ie,Xv as ae,Yp as oe,Zv as se,b as ce,bf as le,c_ as ue,ha as P,ji as de,jp as fe,kf as pe,ki as me,kp as he,lc as ge,qa as F,ry as I,sc as L,tv as _e,u_ as ve,uc as ye,va as R,wm as be,ws as xe,wv as Se,xa as Ce,xf as we,ya as Te,zb as Ee,zi as z}from"./loadAgentsDir-CbtNPJV3.js";import{Gn as De,Wt as Oe,pt as ke,t as Ae}from"./state-BPFYBqm1.js";import{E as je,R as Me,c as B,f as Ne,i as V,k as H,u as Pe}from"./debug-BQj6h99Q.js";import{Dt as Fe,Ot as Ie}from"./settings-CvhsRFaT.js";import{T as U,o as Le,q as Re,s as W,w as G}from"./log-BlJ7CcKG.js";import{n as ze,r as K}from"./analytics-DJobLaWP.js";import{Xr as Be,Zr as Ve,dn as He,fn as Ue}from"./model-DlLO7TSx.js";import{ct as We,ot as Ge}from"./esm-BZciQG9N.js";import{E as Ke,T as qe,w as Je}from"./sessionTracing-DqVx8aFD.js";import{randomUUID as q}from"crypto";function Ye(e,t,n,r,i){let a=0;for(let o of Ie){let s=n[o];if(s)for(let n of s)for(let s of n.hooks){let c=s.once?()=>{B(`Removing one-shot hook for event ${o} in skill '${r}'`),S(e,t,o,s)}:void 0;fe(e,t,o,n.matcher||``,s,c,i),a++}}a>0&&B(`Registered ${a} hooks from skill '${r}'`)}var Xe=e((()=>{Fe(),V(),x()}));function Ze(e){let t=e.trim();if(!t.startsWith(`/`))return null;let n=t.slice(1).split(` `);if(!n[0])return null;let r=n[0],i=!1,a=1;n.length>1&&n[1]===`(MCP)`&&(r=`${r} (MCP)`,i=!0,a=2);let o=n.slice(a).join(` `);return{commandName:r,args:o,isMcp:i}}var Qe=e((()=>{}));function $e(){return!1}function J(){if(!$e())throw Error(`ToolUseContext.options.allowBackgroundForkedSlashCommands is test-only and cannot be enabled outside NODE_ENV=test.`)}async function et(e,t,r,i,o,s,c){let l=oe(),u=e.pluginInfo?d(e.pluginInfo.repository).marketplace:void 0;K(`tengu_slash_command_forked`,{command_name:e.name,invocation_trigger:`user-slash`,...e.pluginInfo&&{_PROTO_plugin_name:e.pluginInfo.pluginManifest.name,...u&&{_PROTO_marketplace_name:u},...D(e.pluginInfo)}});let{skillContent:f,modifiedGetAppState:m,baseAgent:h,promptMessages:g}=await ye(e,t,r);B(`Executing forked slash command /${e.name} with agent ${h.agentType}`);let _=r.options.allowBackgroundForkedSlashCommands===!0;if(_&&J(),_){let t=Ee(),i=z(e),o=Be(),u=e=>se({value:e,mode:`prompt`,priority:`later`,isMeta:!0,skipSlashCommands:!0,workload:o}),d=async()=>{if(!c?.runId)return;let e=await O({runId:c.runId,rootDir:c.rootDir,priority:`later`,workload:o});for(let t of e)ae(t)},f=async e=>{c?.runId&&await a({runId:c.runId,rootDir:c.rootDir,error:e instanceof Error?e.message:String(e)})};return(async()=>{let a=Date.now()+$;for(;Date.now()<a&&r.getAppState().mcp.clients.some(e=>e.type===`pending`);)await Ue(Q);let o=r.options.refreshTools?.()??r.options.tools,c=[];for await(let i of n({agentDefinition:h,promptMessages:g,toolUseContext:{...r,getAppState:m,abortController:t},canUseTool:s,isAsync:!0,querySource:`agent:custom`,model:e.model,availableTools:o,override:{agentId:l}}))c.push(i);let f=L(c,`Command completed`);B(`Background forked command /${i} completed (agent ${l})`),u(`<scheduled-task-result command="/${i}">\n${f}\n</scheduled-task-result>`);try{await d()}catch(e){W(e)}})().catch(async e=>{W(e),u(`<scheduled-task-result command="/${i}" status="failed">\n${e instanceof Error?e.message:String(e)}\n</scheduled-task-result>`),await f(e)}),{messages:[],shouldQuery:!1,command:e,deferAutonomyCompletion:!!c?.runId}}let v=[],y=[],b=`forked-command-${e.name}`,x=0,S=e=>(x++,{type:`progress`,data:{message:e,type:`agent_progress`,prompt:f,agentId:l},parentToolUseID:b,toolUseID:`${b}-${x}`,timestamp:new Date().toISOString(),uuid:q()}),C=()=>{o({jsx:pe(y,{tools:r.options.tools,verbose:!1}),shouldHidePromptInput:!1,shouldContinueAnimation:!0,showSpinner:!0})};C();try{for await(let t of n({agentDefinition:h,promptMessages:g,toolUseContext:{...r,getAppState:m},canUseTool:s,isAsync:!1,querySource:`agent:custom`,model:e.model,availableTools:r.options.tools})){v.push(t);let e=p([t]);if(t.type===`assistant`){let n=Se(t);n>0&&r.setResponseLength(e=>e+n);let i=e[0];i&&i.type===`assistant`&&(y.push(S(t)),C())}if(t.type===`user`){let t=e[0];t&&t.type===`user`&&(y.push(S(t)),C())}}}finally{o(null)}let w=L(v,`Command completed`);return B(`Forked slash command /${e.name} completed with agent ${l}`),{messages:[E({content:F({inputString:`/${z(e)} ${t}`.trim(),precedingInputBlocks:i})}),E({content:`<local-command-stdout>\n${w}\n</local-command-stdout>`})],shouldQuery:!1,command:e,resultText:w}}function tt(e){return!/[^a-zA-Z0-9:\-_]/.test(e)}async function nt(e,t,n,r,i,a,o,s,c,l){let u=Ze(e);if(!u){K(`tengu_input_slash_missing`,{});let e="Commands are in the form `/command [args]`";return{messages:[R(),...r,E({content:F({inputString:e,precedingInputBlocks:t})})],shouldQuery:!1,resultText:e}}let{commandName:f,args:p,isMcp:m}=u,g=m?`mcp`:A().has(f)?f:`custom`;if(!_(f,i.options.commands)){let n=!1;try{await Pe().stat(`/${f}`),n=!0}catch{}if(tt(f)&&!n){K(`tengu_input_slash_invalid`,{input:f});let e=`Unknown skill: ${f}`;return{messages:[R(),...r,E({content:F({inputString:e,precedingInputBlocks:t})}),...p?[Te(`Args from unknown skill: ${p}`,`warning`)]:[]],shouldQuery:!1,resultText:e}}let i=q();return De(i),K(`tengu_input_prompt`,{}),qe(`user_prompt`,{prompt_length:String(e.length),prompt:Ke(e),"prompt.id":i}),{messages:[E({content:F({inputString:e,precedingInputBlocks:t}),uuid:o}),...r],shouldQuery:!0}}let{messages:v,shouldQuery:y,allowedTools:b,model:x,command:S,resultText:C,nextInput:w,submitNextInput:O,deferAutonomyCompletion:k}=await rt(f,p,a,i,t,n,s,c,o,l);if(v.length===0){let e={input:g};if(S.type===`prompt`&&S.pluginInfo){let{pluginManifest:t,repository:n}=S.pluginInfo,{marketplace:r}=d(n),i=T(r);e._PROTO_plugin_name=t.name,r&&(e._PROTO_marketplace_name=r),e.plugin_repository=i?n:`third-party`,e.plugin_name=i?t.name:`third-party`,i&&t.version&&(e.plugin_version=t.version),Object.assign(e,D(S.pluginInfo))}return K(`tengu_input_command`,{...e,invocation_trigger:`user-slash`}),{messages:[],shouldQuery:!1,model:x,nextInput:w,submitNextInput:O,deferAutonomyCompletion:k}}if(v.length===2&&v[1].type===`user`&&typeof v[1].message.content==`string`&&v[1].message.content.startsWith(`Unknown command:`))return e.startsWith(`/var`)||e.startsWith(`/tmp`)||e.startsWith(`/private`)||K(`tengu_input_slash_invalid`,{input:f}),{messages:[R(),...v],shouldQuery:y,allowedTools:b,model:x};let j={input:g};if(S.type===`prompt`&&S.pluginInfo){let{pluginManifest:e,repository:t}=S.pluginInfo,{marketplace:n}=d(t),r=T(n);j._PROTO_plugin_name=e.name,n&&(j._PROTO_marketplace_name=n),j.plugin_repository=r?t:`third-party`,j.plugin_name=r?e.name:`third-party`,r&&e.version&&(j.plugin_version=e.version),Object.assign(j,D(S.pluginInfo))}K(`tengu_input_command`,{...j,invocation_trigger:`user-slash`});let M=v.length>0&&v[0]&&ee(v[0]);return{messages:y||v.every(h)||M?v:[R(),...v],shouldQuery:y,allowedTools:b,model:x,resultText:C,nextInput:w,submitNextInput:O,deferAutonomyCompletion:k}}async function rt(e,t,n,i,a,o,s,c,l,u){let d=de(e,i.options.commands);if(d.type===`prompt`&&d.userInvocable!==!1&&we(e),d.userInvocable===!1)return{messages:[E({content:F({inputString:`/${e}`,precedingInputBlocks:a})}),E({content:`This skill can only be invoked by Work Mate, not directly by users. Ask Work Mate to use the "${e}" skill for you.`})],shouldQuery:!1,command:d};try{switch(d.type){case`local-jsx`:return new Promise(e=>{let r=!1,o=(n,i)=>{if(r=!0,i?.display===`skip`){e({messages:[],shouldQuery:!1,command:d,nextInput:i?.nextInput,submitNextInput:i?.submitNextInput});return}let o=(i?.metaMessages??[]).map(e=>E({content:e,isMeta:!0})),s=ne()&&typeof n==`string`&&n.endsWith(` dismissed`),c=i?.displayArgs??t;e({messages:i?.display===`system`?s?o:[P(Y(d,c)),P(`<local-command-stdout>${n}</local-command-stdout>`),...o]:[E({content:F({inputString:Y(d,c),precedingInputBlocks:a})}),E(n?{content:`<local-command-stdout>${n}</local-command-stdout>`}:{content:`<local-command-stdout>${re}</local-command-stdout>`}),...o],shouldQuery:i?.shouldQuery??!1,command:d,nextInput:i?.nextInput,submitNextInput:i?.submitNextInput})};d.load().then(e=>e.call(o,{...i,canUseTool:c},t)).then(t=>{if(t!=null){if(i.options.isNonInteractiveSession){e({messages:[],shouldQuery:!1,command:d});return}r||n({jsx:t,shouldHidePromptInput:!0,showSpinner:!1,isLocalJSXCommand:!0,isImmediate:d.immediate===!0})}}).catch(t=>{W(t),!r&&(r=!0,n({jsx:null,shouldHidePromptInput:!1,clearLocalJSX:!0}),e({messages:[],shouldQuery:!1,command:d}))})});case`local`:{let e=E({content:F({inputString:Y(d,d.isSensitive&&t.trim()?`***`:t),precedingInputBlocks:a})});try{let n=R(),r=await(await d.load()).call(t,i);if(r.type===`skip`)return{messages:[],shouldQuery:!1,command:d};if(r.type===`compact`){let t=[n,e,...r.displayText?[E({content:`<local-command-stdout>${r.displayText}</local-command-stdout>`,timestamp:new Date(Date.now()+100).toISOString()})]:[]],i={...r.compactionResult,messagesToKeep:[...r.compactionResult.messagesToKeep??[],...t]};return _e(),{messages:ue(i),shouldQuery:!1,command:d}}return{messages:[e,P(`<local-command-stdout>${r.value}</local-command-stdout>`)],shouldQuery:!1,command:d,resultText:r.value}}catch(t){return W(t),{messages:[e,P(`<local-command-stderr>${String(t)}</local-command-stderr>`)],shouldQuery:!1,command:d}}}case`prompt`:try{return d.context===`fork`?await et(d,t,i,a,n,c??r,u):await Z(d,t,i,a,o,l)}catch(e){return e instanceof je?{messages:[E({content:F({inputString:Y(d,t),precedingInputBlocks:a})}),Ce({toolUse:!1})],shouldQuery:!1,command:d}:{messages:[E({content:F({inputString:Y(d,t),precedingInputBlocks:a})}),E({content:`<local-command-stderr>${String(e)}</local-command-stderr>`})],shouldQuery:!1,command:d}}}}catch(e){if(e instanceof H)return{messages:[E({content:F({inputString:e.message,precedingInputBlocks:a})})],shouldQuery:!1,command:d};throw e}}function Y(e,t){return l(z(e),t)}function X(e,t=`loading`){return[`<${G}>${e}</${G}>`,`<${U}>${e}</${U}>`,`<skill-format>true</skill-format>`].join(`
2
- `)}function it(e,t){return[`<${G}>${e}</${G}>`,`<${U}>/${e}</${U}>`,t?`<command-args>${t}</command-args>`:null].filter(Boolean).join(`
3
- `)}function at(e,t){return e.userInvocable===!1&&(e.loadedFrom===`skills`||e.loadedFrom===`plugin`||e.loadedFrom===`mcp`)?X(e.name,e.progressMessage):it(e.name,t)}async function ot(e,t,n,r,i=[]){let a=me(e,n);if(!a)throw new H(`Unknown command: ${e}`);if(a.type!==`prompt`)throw Error(`Unexpected ${a.type} command. Expected 'prompt' command. Use /${e} directly in the main conversation.`);return Z(a,t,r,[],i)}async function Z(e,t,n,r=[],i=[],a){let o=await e.getPromptForCommand(t,n),s=!f(`hooks`)||v(e.source);if(e.hooks&&s){let t=ke();Ye(n.setAppState,t,e.hooks,e.name,e.type===`prompt`?e.skillRoot:void 0)}let l=e.source?`${e.source}:${e.name}`:e.name,u=o.filter(e=>e.type===`text`).map(e=>e.text).join(`
4
-
5
- `);Ae(e.name,l,u,Ge()?.agentId??null);let d=at(e,t),p=c(e.allowedTools??[]),m=i.length>0||r.length>0?[...i,...r,...o]:o,h=await g(j(o.filter(e=>e.type===`text`).map(e=>e.text).join(` `),n,null,[],n.messages,`repl_main_thread`,{skipSkillDiscovery:!0}));return{messages:[E({content:d,uuid:a}),E({content:m,isMeta:!0}),...h,xe({type:`command_permissions`,allowedTools:p,model:e.model})],shouldQuery:!0,allowedTools:p,model:e.model,command:e}}var Q,$;e((()=>{Oe(),b(),m(),Re(),ze(),ve(),t(),he(),w(),i(),We(),o(),V(),Me(),ge(),Ne(),M(),u(),Xe(),Le(),I(),y(),ce(),N(),C(),te(),Qe(),He(),le(),Je(),k(),s(),ie(),be(),Ve(),Q=200,$=1e4}))();export{X as formatSkillLoadingMetadata,ot as processPromptSlashCommand,nt as processSlashCommand};
@@ -1 +0,0 @@
1
- import{cw as e,mw as t}from"./loadAgentsDir-CbtNPJV3.js";t();export{e as clearPromptCache};
@@ -1 +0,0 @@
1
- import{i as e,r as t}from"./prompt-BRGC5U9Y.js";t();export{e as isDeferredTool};
@@ -1 +0,0 @@
1
- import{Ao as e,Io as t,Lo as n,Mo as r}from"./loadAgentsDir-CbtNPJV3.js";import{Wt as i,et as a}from"./state-BPFYBqm1.js";import{P as o,R as s,c,i as l}from"./debug-BQj6h99Q.js";import{kn as u,vt as d,wn as f,yt as p}from"./settings-CvhsRFaT.js";import{m,n as h}from"./git-DplvjXEY.js";import{o as g,s as _}from"./log-BlJ7CcKG.js";import{$n as v,Qn as y}from"./model-DlLO7TSx.js";import{isAbsolute as b,resolve as x}from"path";y(),i(),l(),s(),f(),m(),g(),t(),d();function S(e,t,n){let r=[],i=[],a=[];for(let[o,s]of Object.entries(e)){let e=t[o],c=w(s.source,n?.projectRoot);e?s.sourceIsFallback||v(c,e.source)?a.push(o):i.push({name:o,declaredSource:c,materializedSource:e.source}):r.push(o)}return{missing:r,sourceChanged:i,upToDate:a}}async function C(t){let i=r();if(Object.keys(i).length===0)return{installed:[],updated:[],failed:[],upToDate:[],skipped:[]};let s;try{s=await n()}catch(e){_(e),s={}}let l=S(i,s,{projectRoot:a()}),d=[...l.missing.map(e=>({name:e,source:w(i[e].source),action:`install`})),...l.sourceChanged.map(({name:e,declaredSource:t})=>({name:e,source:t,action:`update`}))],f=[],m=[];for(let e of d){if(t?.skip?.(e.name,e.source)){f.push(e.name);continue}if(e.action===`update`&&p(e.source)&&!await u(e.source.path)){c(`[reconcile] '${e.name}' declared path does not exist; keeping materialized entry`),f.push(e.name);continue}m.push(e)}if(m.length===0)return{installed:[],updated:[],failed:[],upToDate:l.upToDate,skipped:f};c(`[reconcile] ${m.length} marketplace(s): ${m.map(e=>`${e.name}(${e.action})`).join(`, `)}`);let h=[],g=[],v=[];for(let n=0;n<m.length;n++){let{name:r,source:i,action:a}=m[n];t?.onProgress?.({type:`installing`,name:r,action:a,index:n+1,total:m.length});try{let n=await e(i);a===`install`?h.push(r):g.push(r),t?.onProgress?.({type:`installed`,name:r,alreadyMaterialized:n.alreadyMaterialized})}catch(e){let n=o(e);v.push({name:r,error:n}),t?.onProgress?.({type:`failed`,name:r,error:n}),_(e)}}return{installed:h,updated:g,failed:v,upToDate:l.upToDate,skipped:f}}function w(e,t){if((e.source===`directory`||e.source===`file`)&&!b(e.path)){let n=t??a(),r=h(n);return{...e,path:x(r??n,e.path)}}return e}export{C as n,S as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Jx as t,_h as n,_s as r,as as i,b_ as a,bh as o,ch as s,co as c,hh as l,i as u,is as d,lo as f,o as p,qx as m,uh as h,vs as g,x_ as _,yh as v}from"./loadAgentsDir-CbtNPJV3.js";import{Wt as y,et as b}from"./state-BPFYBqm1.js";import{P as x,R as S,c as C,i as w}from"./debug-BQj6h99Q.js";import{o as T,s as E}from"./log-BlJ7CcKG.js";async function D(e){C(`refreshActivePlugins: clearing all plugin caches`),d(),s();let i=await f(),[a,c]=await Promise.all([r(),u(b())]),{enabled:l,disabled:p,errors:m}=i,[h,g]=await Promise.all([Promise.all(l.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let n=await t(e,m);return n&&(e.mcpServers=n),n?Object.keys(n).length:0})),Promise.all(l.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await o(e,m);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))]),v=h.reduce((e,t)=>e+t,0),y=g.reduce((e,t)=>e+t,0);e(e=>({...e,plugins:{...e.plugins,enabled:l,disabled:p,commands:a,errors:O(e.plugins.errors,m),needsRefresh:!1},agentDefinitions:c,mcp:{...e.mcp,pluginReconnectKey:e.mcp.pluginReconnectKey+1}})),n();let S=!1;try{await _()}catch(e){S=!0,E(e),C(`refreshActivePlugins: loadPluginHooks failed: ${x(e)}`)}let w=l.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 C(`refreshActivePlugins: ${l.length} enabled, ${a.length} commands, ${c.allAgents.length} agents, ${w} hooks, ${v} MCP, ${y} LSP`),{enabled_count:l.length,disabled_count:p.length,command_count:a.length,agent_count:c.allAgents.length,hook_count:w,mcp_count:v,lsp_count:y,error_count:m.length+ +!!S,agentDefinitions:c,pluginCommands:a}}function O(e,t){let n=e.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r=new Set(t.map(k));return[...n.filter(e=>!r.has(k(e))),...t]}function k(e){return e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`}var A=e((()=>{y(),l(),p(),w(),S(),T(),i(),g(),a(),v(),m(),h(),c()}));export{D as n,A as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./axios-DaWTGg7G.js";import{Av as n,dT as r,jv as i,uT as a}from"./loadAgentsDir-CbtNPJV3.js";import{A as o,M as s,O as c,w as l}from"./external-CEp-aPkt.js";import{n as ee,r as te,t as u}from"./lazySchema-B4D4qJVE.js";import{C as d,F as f,N as p,R as m,c as h,i as g,nt as ne,tt as re,x as ie}from"./debug-BQj6h99Q.js";import{Hn as _,Kn as v,N as y,P as b,Un as x,Vn as S}from"./settings-CvhsRFaT.js";import{l as C,s as w,u as T}from"./oauth-D38aRTUb.js";import{Pt as E,St as D,ct as O,dn as k,fn as A,gt as j}from"./model-DlLO7TSx.js";import{n as M,t as N}from"./userAgent-CNPTS7ix.js";import{n as P,r as F,t as I}from"./syncCache-Dff4hbz4.js";import{createHash as L}from"crypto";import{open as R,unlink as z}from"fs/promises";t(),te(),re(),m(),ie(),g(),u(),T(),b(),M(),k(),E(),a(),i();async function B(e,t){return`no_check_needed`}function V(e){return!0}x(),I();var H=ee(()=>l({uuid:o(),checksum:o(),settings:c(o(),s())})),ae=1e4,U=5,W=3600*1e3,G=null,K=null,q=null,J=3e4;function oe(){K||P()&&(K=new Promise(e=>{q=e,setTimeout(()=>{q&&(h(`Remote settings: Loading promise timed out, resolving anyway`),q(),q=null)},J)}))}function se(){return`${C().BASE_API_URL}/api/claude_code/settings`}function Y(e){if(Array.isArray(e))return e.map(Y);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e).sort())t[n]=Y(e[n]);return t}return e}function ce(e){let t=d(Y(e));return`sha256:${L(`sha256`).update(t).digest(`hex`)}`}function le(){return P()}async function ue(){K&&await K}function de(){try{let{key:e}=j({skipRetrievingKeyFromApiKeyHelper:!0});if(e)return{headers:{"x-api-key":e}}}catch{}let e=D();return e?.accessToken?{headers:{Authorization:`Bearer ${e.accessToken}`,"anthropic-beta":w}}:{headers:{},error:`No authentication available`}}async function fe(e){let t=null;for(let r=1;r<=6;r++){if(t=await pe(e),t.success||t.skipRetry||r>U)return t;let i=n(r);h(`Remote settings: Retry ${r}/${U} after ${i}ms`),await A(i)}return t}async function pe(t){try{await O();let n=de();if(n.error)return{success:!1,error:`Authentication required for remote settings`,skipRetry:!0};let r=se(),i={...n.headers,"User-Agent":N()};t&&(i[`If-None-Match`]=`"${t}"`);let a=await e.get(r,{headers:i,timeout:ae,validateStatus:e=>e===200||e===204||e===304||e===404});if(a.status===304)return h(`Remote settings: Using cached settings (304)`),{success:!0,settings:null,checksum:t};if(a.status===204||a.status===404)return h(`Remote settings: No settings found (${a.status})`),{success:!0,settings:{},checksum:void 0};let o=H().safeParse(a.data);if(!o.success)return h(`Remote settings: Invalid response format - ${o.error.message}`),{success:!1,error:`Invalid remote settings format`};let s=y().safeParse(o.data.settings);return s.success?(h(`Remote settings: Fetched successfully`),{success:!0,settings:s.data,checksum:o.data.checksum}):(h(`Remote settings: Settings validation failed - ${s.error.message}`),{success:!1,error:`Invalid settings structure`})}catch(e){let{kind:t,status:n,message:r}=p(e);if(n===404)return{success:!0,settings:{},checksum:``};switch(t){case`auth`:return{success:!1,error:`Not authorized for remote settings`,skipRetry:!0};case`timeout`:return{success:!1,error:`Remote settings request timeout`};case`network`:return{success:!1,error:`Cannot connect to server`};default:return{success:!1,error:r}}}}async function me(e){try{let t=_(),n=await R(t,`w`,384);try{await n.writeFile(d(e,null,2),{encoding:`utf-8`}),await n.datasync()}finally{await n.close()}h(`Remote settings: Saved to ${t}`)}catch(e){h(`Remote settings: Failed to save - ${e instanceof Error?e.message:`unknown error`}`)}}async function X(){$(),F(),K=null,q=null;try{await z(_())}catch{}}async function Z(){if(!P())return null;let e=S(),t=e?ce(e):void 0;try{let n=await fe(t);if(!n.success)return e?(h(`Remote settings: Using stale cache after fetch failure`),v(e),e):null;if(n.settings===null&&e)return h(`Remote settings: Cache still valid (304 Not Modified)`),v(e),e;let r=n.settings||{};if(Object.keys(r).length>0)return V(await B(e,r))?(v(r),await me(r),h(`Remote settings: Applied new settings successfully`),r):(h(`Remote settings: User rejected new settings, using cached settings`),e);v(r);try{await z(_()),h(`Remote settings: Deleted cached file (404 response)`)}catch(e){f(e)!==`ENOENT`&&h(`Remote settings: Failed to delete cached file - ${e instanceof Error?e.message:`unknown error`}`)}return r}catch{return e?(h(`Remote settings: Using stale cache after error`),v(e),e):null}}async function Q(){P()&&!K&&(K=new Promise(e=>{q=e})),S()&&q&&(q(),q=null);try{let e=await Z();P()&&_e(),e!==null&&r.notifyChange(`policySettings`)}finally{q&&(q(),q=null)}}async function he(){if(await X(),!P()){r.notifyChange(`policySettings`);return}await Z(),h(`Remote settings: Refreshed after auth change`),r.notifyChange(`policySettings`)}async function ge(){if(!P())return;let e=S(),t=e?d(e):null;try{await Z();let e=S();(e?d(e):null)!==t&&(h(`Remote settings: Changed during background poll`),r.notifyChange(`policySettings`))}catch{}}function _e(){G===null&&P()&&(G=setInterval(()=>{ge()},W),G.unref(),ne(async()=>$()))}function $(){G!==null&&(clearInterval(G),G=null)}export{he as a,Q as i,oe as n,ue as o,le as r,X 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{Ar as i,Ci as a,Fr as o,Mu as s,Nr as c,Pu as l,Si as u,Sr as d,Xp as f,Zp as p,ar as m,br as h,fi as g,fr as _,iC as v,rC as y,wr as b,xC as x}from"./loadAgentsDir-CbtNPJV3.js";import{I as S,P as C,ai as w,di as T,dr as E,fi as D,ot as O,t as k}from"./src-DL3w8VPk2.js";import{t as A}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as j,et as M,pt as N}from"./state-BPFYBqm1.js";import{o as P,s as F}from"./log-BlJ7CcKG.js";import{n as I,r as L}from"./modalContext-wY9CeN4G.js";import{a as R,i as z,n as B,o as V,r as H,t as U}from"./crossProjectResume-BCN462Wa.js";function W(e){switch(e.resultType){case`sessionNotFound`:return`Session ${T.bold(e.arg)} was not found. Run ${T.bold(`/resume`)} without arguments to browse all sessions.`;case`multipleMatches`:return`Found ${e.count} sessions matching ${T.bold(e.arg)}. Run ${T.bold(`/resume`)} to pick one from the list.`}}function G({message:e,args:t,onDone:n}){return J.useEffect(()=>{let e=setTimeout(n,0);return()=>clearTimeout(e)},[n]),(0,Y.jsxs)(S,{flexDirection:`column`,children:[(0,Y.jsxs)(C,{dimColor:!0,children:[r.pointer,` /resume `,t]}),(0,Y.jsx)(y,{children:(0,Y.jsx)(C,{children:e})})]})}function K({onDone:e,onResume:t}){let[n,r]=J.useState([]),[a,l]=J.useState([]),[d,f]=J.useState(!0),[m,h]=J.useState(!1),[g,v]=J.useState(!1),{rows:y}=O(),x=L(),w=J.useCallback(async(t,n)=>{f(!0);try{let a=q(t?await i():await o(n),N());if(a.length===0){e(`No conversations found to resume`);return}r(a)}catch{e(`Failed to load conversations`)}finally{f(!1)}},[e]);J.useEffect(()=>{async function e(){let e=await u(M());l(e),w(!1,e)}e()},[w]);let T=J.useCallback(()=>{let e=!g;v(e),w(e,a)},[g,w,a]);async function D(n){let r=p(_(n));if(!r){e(`Failed to resume conversation`);return}let i=b(n)?await c(n):n,a=U(i,g);if(a.isCrossProject){if(a.isSameRepoWorktree){h(!0),t(r,i,`slash_command_picker`);return}let n=await E(a.command);n&&process.stdout.write(n),e([``,`This conversation is from a different directory.`,``,`To resume, run:`,` ${a.command}`,``,`(Command copied to clipboard)`,``].join(`
2
- `),{display:`user`});return}h(!0),t(r,i,`slash_command_picker`)}function k(){e(`Resume cancelled`,{display:`system`})}return d?(0,Y.jsxs)(S,{children:[(0,Y.jsx)(s,{}),(0,Y.jsx)(C,{children:` Loading conversations…`})]}):m?(0,Y.jsxs)(S,{children:[(0,Y.jsx)(s,{}),(0,Y.jsx)(C,{children:` Resuming conversation…`})]}):(0,Y.jsx)(R,{logs:n,maxHeight:x?Math.floor(y/2):y-2,onCancel:k,onSelect:D,onLogsChanged:()=>w(g,a),showAllProjects:g,onToggleAllProjects:T,onAgenticSearch:H})}function q(e,t){return e.filter(e=>!e.isSidechain&&_(e)!==t)}var J,Y,X;e((()=>{D(),n(),J=t(w(),1),j(),V(),v(),l(),I(),x(),k(),z(),B(),a(),P(),h(),f(),Y=A(),X=async(e,t,n)=>{let r=async(n,r,i)=>{try{await t.resume?.(n,r,i),e(void 0,{display:`skip`})}catch(t){F(t),e(`Failed to resume: ${t.message}`)}},i=n?.trim();if(!i)return(0,Y.jsx)(K,{onDone:e,onResume:r},Date.now());let a=await o(await u(M()));if(a.length===0){let t=`No conversations found to resume.`;return(0,Y.jsx)(G,{message:t,args:i,onDone:()=>e(t)})}let s=p(i);if(s){let e=a.filter(e=>_(e)===s).sort((e,t)=>t.modified.getTime()-e.modified.getTime());if(e.length>0){let t=e[0];return r(s,b(t)?await c(t):t,`slash_command_session_id`),null}let t=await m(s);if(t)return r(s,t,`slash_command_session_id`),null}if(d()){let t=await g(i,{exact:!0});if(t.length===1){let e=t[0],n=_(e);if(n)return r(n,b(e)?await c(e):e,`slash_command_title`),null}if(t.length>1){let n=W({resultType:`multipleMatches`,arg:i,count:t.length});return(0,Y.jsx)(G,{message:n,args:i,onDone:()=>e(n)})}}let l=W({resultType:`sessionNotFound`,arg:i});return(0,Y.jsx)(G,{message:l,args:i,onDone:()=>e(l)})}}))();export{X as call,q as filterResumableSessions};
@@ -1 +0,0 @@
1
- import{a as e,i as t}from"./ripgrep-DsLUmulz.js";e();export{t as getRipgrepStatus};
@@ -1 +0,0 @@
1
- import{oT as e,rT as t}from"./loadAgentsDir-CbtNPJV3.js";e();export{t as SandboxManager};
@@ -1 +0,0 @@
1
- import{F_ as e,N_ as t}from"./loadAgentsDir-CbtNPJV3.js";t();export{e as isSearchExtraToolsEnabled};
@@ -1 +0,0 @@
1
- import{nh as e,rh as t}from"./loadAgentsDir-CbtNPJV3.js";e();export{t as registerSessionFileAccessHooks};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./sessionObserver-DpY0DOjI.js";t();export{e as heuristicObserverBackend};
@@ -1 +0,0 @@
1
- import{Dr as e,Xr as t,br as n}from"./loadAgentsDir-CbtNPJV3.js";n();export{e as linkSessionToPR,t as recordTranscript};
@@ -1 +0,0 @@
1
- import{c as e,g as t,x as n}from"./settings-CvhsRFaT.js";t();export{e as getSettingsForSource,n as updateSettingsForSource};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ky as t,jv as n}from"./loadAgentsDir-CbtNPJV3.js";import{A as r,C as i,O as a,w as o}from"./external-CEp-aPkt.js";import{n as s,r as c,t as l}from"./lazySchema-B4D4qJVE.js";import{Wt as u}from"./state-BPFYBqm1.js";import{R as d}from"./debug-BQj6h99Q.js";import{g as f}from"./settings-CvhsRFaT.js";import{h as p}from"./config-BSkuQZNf.js";import{O as m,m as h}from"./git-DplvjXEY.js";import{u as g}from"./oauth-D38aRTUb.js";import{Pt as _,ti as v}from"./model-DlLO7TSx.js";import"path";import"fs/promises";var y,b=e((()=>{c(),l(),y=s(()=>o({entries:a(r(),r())})),s(()=>o({userId:r(),version:i(),lastModified:r(),checksum:r(),content:y()}))})),x=e((()=>{u(),g(),_(),t(),p(),m(),d(),h(),v(),f(),n(),b()}));export{x as t};
@@ -1,3 +0,0 @@
1
- import{n as e,t}from"./memoize-BK3gG5ob.js";import{l as n,o as r,s as i}from"./envUtils-DcaKZlRU.js";import{$S as a,At as o,Dm as s,Dv as c,Em as l,Ev as u,FC as d,Fa as f,HC as p,Ig as ee,Ky as m,La as h,Lg as g,Li as te,Mi as ne,Mm as re,Mn as ie,Nm as ae,Nn as oe,PC as _,QT as se,RC as ce,Sa as le,St as ue,UC as de,VC as fe,Vy as pe,Y_ as me,_v as he,ac as ge,br as v,by as y,cm as b,cv as x,dc as S,di as C,dv as w,eC as T,eE as E,fv as D,gt as O,gv as k,hn as A,ht as j,hv as M,jm as N,jn as P,kv as F,lc as I,lm as L,lv as _e,mn as ve,mv as ye,oc as be,ot as xe,pv as Se,sv as R,uv as Ce,vt as z,vv as we,yv as Te,zC as Ee}from"./loadAgentsDir-CbtNPJV3.js";import{di as B,fi as De}from"./src-DL3w8VPk2.js";import{B as Oe,Bn as ke,Hn as Ae,Wt as V,it as je,or as Me,pt as Ne,z as H}from"./state-BPFYBqm1.js";import{n as Pe,t as U}from"./cwd-Besi3Os3.js";import{F as Fe,P as Ie,R as W,f as G,u as Le}from"./debug-BQj6h99Q.js";import{Kt as Re,Ln as ze,Rn as Be,Yt as Ve}from"./settings-CvhsRFaT.js";import{h as He,o as Ue}from"./config-BSkuQZNf.js";import{O as We,k as K,l as Ge,m as Ke,n as qe,r as Je}from"./git-DplvjXEY.js";import{o as Ye,s as Xe}from"./log-BlJ7CcKG.js";import{n as q,r as J}from"./analytics-DJobLaWP.js";import{n as Ze,r as Y}from"./startupProfiler-2sjXZkIP.js";import{Jr as Qe,Pt as $e,Yr as et,Zt as tt}from"./model-DlLO7TSx.js";import{dn as X,mn as nt}from"./prompt-BRGC5U9Y.js";import{h as rt,l as it,p as at,u as ot}from"./terminalSetup-JJiXmszo.js";import{ft as st,ut as Z}from"./esm-BZciQG9N.js";import{c as ct,t as lt}from"./nativeInstaller-DTJ4clp-.js";import{l as ut,s as dt}from"./logoV2Utils-D5nRpirL.js";import{i as ft,r as pt}from"./runtimeObserver-Dov-m2dl.js";import{t as mt}from"./sinks-CfzgqLH5.js";import{writeFile as Q}from"fs/promises";r(),De(),Pe(),We(),Ye(),Ke(),Ve(),He(),$e(),E(),p(),ce(),_(),g(),te(),v(),A(),t(),V(),xe(),me(),nt(),T(),Be(),I(),G(),b(),h(),oe(),Qe(),y(),c(),q(),l(),re(),D(),W();function ht(){return!1}function gt(){return{}}var $;function _t(e,t){let n=0,r=t==null;for(let i of e){if(!r){i.uuid===t&&(r=!0);continue}if(i.type===`assistant`){let e=i.message.content;Array.isArray(e)&&(n+=ze(e,e=>e.type===`tool_use`))}}return n}function vt(e){let t=F(e);if(!Se()){if(!Ce(t))return!1;k()}let n=w(t),r=_t(e,$)>=_e(),i=f(e);if(n&&r||n&&!i){let t=e[e.length-1];return t?.uuid&&($=t.uuid),!0}return!1}async function yt(e){let t=Le(),n=P();await t.mkdir(n,{mode:448});let r=ie();try{await Q(r,``,{encoding:`utf-8`,mode:384,flag:`wx`}),await Q(r,await ae(),{encoding:`utf-8`,mode:384})}catch(e){if(Fe(e)!==`EEXIST`)throw e}e.readFileState.delete(r);let i=await a.call({file_path:r},e),o=``,s=i.data;return s.type===`text`&&(o=s.file.content),J(`tengu_session_memory_file_read`,{content_length:o.length}),{memoryPath:r,currentMemory:o}}var bt=e(()=>{let e=gt();Te({minimumMessageTokensToInit:e.minimumMessageTokensToInit&&e.minimumMessageTokensToInit>0?e.minimumMessageTokensToInit:R.minimumMessageTokensToInit,minimumTokensBetweenUpdate:e.minimumTokensBetweenUpdate&&e.minimumTokensBetweenUpdate>0?e.minimumTokensBetweenUpdate:R.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:e.toolCallsBetweenUpdates&&e.toolCallsBetweenUpdates>0?e.toolCallsBetweenUpdates:R.toolCallsBetweenUpdates})}),xt=et(async e=>{let{messages:t,toolUseContext:n,querySource:r}=e;if(r!==`repl_main_thread`||!ht()||(bt(),!vt(t)))return;M();let i=be(n),{memoryPath:a,currentMemory:o}=await yt(i);await S({promptMessages:[le({content:await N(o,a)})],cacheSafeParams:ge(e),canUseTool:Ct(a),querySource:`session_memory`,forkLabel:`session_memory`,overrides:{readFileState:i.readFileState}});let s=t[t.length-1],c=s?u(s):void 0,l=x();J(`tengu_session_memory_extraction`,{input_tokens:c?.input_tokens,output_tokens:c?.output_tokens,cache_read_input_tokens:c?.cache_read_input_tokens??void 0,cache_creation_input_tokens:c?.cache_creation_input_tokens??void 0,config_min_message_tokens_to_init:l.minimumMessageTokensToInit,config_min_tokens_between_update:l.minimumTokensBetweenUpdate,config_tool_calls_between_updates:l.toolCallsBetweenUpdates}),he(F(t)),wt(t),ye()});function St(){Oe()||s()&&L(xt)}function Ct(e){return async(t,n)=>{if(t.name===`Edit`&&typeof n==`object`&&n&&`file_path`in n){let t=n.file_path;if(typeof t==`string`&&t===e)return{behavior:`allow`,updatedInput:n}}return{behavior:`deny`,message:`only ${X} on ${e} is allowed`,decisionReason:{type:`other`,reason:`only ${X} on ${e} is allowed`}}}}function wt(e){if(!f(e)){let t=e[e.length-1];t?.uuid&&we(t.uuid)}}q(),V(),ft(),ot(),m(),st(),W(),ut(),lt(),at(),Ze(),ue();async function Tt(e,t,r,a,s,c,l,u,f){K(`info`,`setup_started`);let p=process.version.match(/^v(\d+)\./)?.[1];if((!p||parseInt(p,10)<18)&&(console.error(B.bold.red(`Error: Work Mate requires Node.js version 18 or higher.`)),process.exit(1)),l&&Me(ee(l)),!H())try{let e=await it();e.status===`restored`?console.log(B.yellow(`Detected an interrupted Terminal.app setup. Your original settings have been restored. You may need to restart Terminal.app for the changes to take effect.`)):e.status===`failed`&&console.error(B.red(`Failed to restore Terminal.app settings. Please manually restore your original settings with: defaults import com.apple.Terminal ${e.backupPath}.`))}catch(e){Xe(e)}d(e);let m=Date.now();if(fe(),K(`info`,`setup_hooks_captured`,{duration_ms:Date.now()-m}),Ee(e),a){let t=ve(),n=await Ge();!t&&!n&&(process.stderr.write(B.red(`Error: Can only use --worktree in a git repository, but ${B.bold(e)} is not a git repository. Configure a WorktreeCreate hook in settings.json to use --worktree with other VCS systems.\n`)),process.exit(1));let r=u?`pr-${u}`:s??se(),i;if(n){let e=qe(U());e||(process.stderr.write(B.red(`Error: Could not determine the main git repository root.
2
- `)),process.exit(1)),e!==(Je(U())??U())&&(K(`info`,`worktree_resolved_to_main_repo`),process.chdir(e),d(e)),i=c?z(e,o(r)):void 0}else i=c?z(U(),o(r)):void 0;let a;try{a=await O(Ne(),r,i,u?{prNumber:u}:void 0)}catch(e){process.stderr.write(B.red(`Error creating worktree: ${Ie(e)}\n`)),process.exit(1)}if(J(`tengu_worktree_created`,{tmux_enabled:c}),c&&i){let e=await j(i,a.worktreePath);e.created?console.log(B.green(`Created tmux session: ${B.bold(i)}\nTo attach: ${B.bold(`tmux attach -t ${i}`)}`)):console.error(B.yellow(`Warning: Failed to create tmux session: ${e.error}`))}process.chdir(a.worktreePath),d(a.worktreePath),ke(U()),Ae(U()),C(a),pe(),de()}K(`info`,`setup_background_jobs_starting`),i()||(St(),pt()),ct(),K(`info`,`setup_background_jobs_launched`),Y(`setup_before_prefetch`),K(`info`,`setup_prefetch_starting`);let h=H()&&n(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL)||i();if(h||ne(je()),import(`./loadPluginHooks-BxkDBFd6.js`).then(e=>{h||(e.loadPluginHooks(),e.setupPluginHookHotReload())}),i()||import(`./sessionFileAccessHooks-C2VjT-PU.js`).then(e=>e.registerSessionFileAccessHooks()),mt(),J(`tengu_started`,{}),tt(H()),Y(`setup_after_prefetch`),!i()&&rt()&&await dt(),t===`bypassPermissions`||r){if(process.platform!==`win32`&&typeof process.getuid==`function`&&process.getuid()===0&&process.env.IS_SANDBOX!==`1`&&!n(process.env.CLAUDE_CODE_BUBBLEWRAP))if(process.stdin.isTTY){console.error(B.bold.red(`WARNING: Running as root/sudo with bypass permissions mode is dangerous.`)),console.error(B.yellow(`Bypass mode skips ALL permission checks. Combined with root, any command (rm -rf /, chmod, dd) executes without review.`));let e=(await import(`readline`)).createInterface({input:process.stdin,output:process.stdout}),t=await new Promise(t=>{e.question(`
3
- I understand the risks. Continue? [y/N] `,t)});e.close(),t.trim().toLowerCase()!==`y`&&(console.error(`Aborted.`),process.exit(1))}else console.error(`--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons`),process.exit(1);if(process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`claude-desktop`){let[e,t]=await Promise.all([Z.getIsDocker(),Re.hasInternetAccess()]),n=Z.getIsBubblewrapSandbox(),r=process.env.IS_SANDBOX===`1`;(!(e||n||r)||t)&&(console.error(`--dangerously-skip-permissions can only be used in Docker/sandbox containers with no internet access but got Docker: ${e}, Bubblewrap: ${n}, IS_SANDBOX: ${r}, hasInternet: ${t}`),process.exit(1))}}let g=Ue();g.lastCost!==void 0&&g.lastDuration!==void 0&&J(`tengu_exit`,{last_session_cost:g.lastCost,last_session_api_duration:g.lastAPIDuration,last_session_tool_duration:g.lastToolDuration,last_session_duration:g.lastDuration,last_session_lines_added:g.lastLinesAdded,last_session_lines_removed:g.lastLinesRemoved,last_session_total_input_tokens:g.lastTotalInputTokens,last_session_total_output_tokens:g.lastTotalOutputTokens,last_session_total_cache_creation_input_tokens:g.lastTotalCacheCreationInputTokens,last_session_total_cache_read_input_tokens:g.lastTotalCacheReadInputTokens,last_session_fps_average:g.lastFpsAverage,last_session_fps_low_1_pct:g.lastFpsLow1Pct,last_session_id:g.lastSessionId,...g.lastSessionMetrics})}export{Tt as setup};
@@ -1 +0,0 @@
1
- import{t as e}from"./sinks-CfzgqLH5.js";export{e as initSinks};
@@ -1 +0,0 @@
1
- import{$T as e,Di as t,Ds as n,Ei as r,FC as i,GT as a,Ig as ee,KT as o,Ky as te,Lg as ne,Li as s,Nt as re,Ny as ie,Os as ae,Ot as c,PC as l,Py as oe,QS as se,Rn as u,St as d,Th as f,Vy as p,Wr as m,Xi as ce,Yi as h,ZS as le,Zi as ue,a_ as de,bc as fe,bg as pe,br as me,ci as he,di as g,eE as ge,eh as _e,fn as ve,hc as _,hn as v,i_ as y,ni as b,qi as x,th as S,ti as C,vg as w,yt as T}from"./loadAgentsDir-CbtNPJV3.js";import{Bn as E,J as D,Mn as O,Nn as k,Wt as A,h as j,lr as M,or as N,pt as P,ur as F}from"./state-BPFYBqm1.js";import{n as ye,t as I}from"./cwd-Besi3Os3.js";import{c as L,f as be,i as R,nt as xe,tt as Se,u as Ce}from"./debug-BQj6h99Q.js";import{n as we,r as Te}from"./analytics-DJobLaWP.js";import{C as Ee,_ as De}from"./model-DlLO7TSx.js";import{Gt as Oe}from"./prompt-BRGC5U9Y.js";import*as z from"path";import{dirname as ke}from"path";A(),de(),ie(),Oe(),ne(),te(),f(),_(),ye(),R(),pe(),De(),ge(),l(),me(),le(),S(),d();function Ae(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.type!==`assistant`)continue;let r=n.message.content.find(e=>e.type===`tool_use`&&e.name===`TodoWrite`);if(r?.type!==`tool_use`)continue;let i=r.input;if(typeof i!=`object`||!i)return[];let a=_e().safeParse(i.todos);return a.success?a.data:[]}return[]}function je(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&w(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),!se()&&e.messages&&e.messages.length>0){let n=Ae(e.messages);if(n.length>0){let e=P();t(t=>({...t,todos:{...t.todos,[e]:n}}))}}}function B(e,t){if(!(!e&&!t))return{name:e??``,color:t==="default"?void 0:t}}function V(e,t,n){if(t)return{agentDefinition:t,agentType:void 0};if(!e)return k(void 0),{agentDefinition:void 0,agentType:void 0};let r=n.activeAgents.find(t=>t.agentType===e);return r?(k(r.agentType),!D()&&r.model&&r.model!==`inherit`&&O(Ee(r.model)),{agentDefinition:r,agentType:r.agentType}):(L(`Resumed session had agent "${e}" but it is no longer available. Using default behavior.`),k(void 0),{agentDefinition:void 0,agentType:void 0})}function H(t){let n=T();if(n){g(n);return}if(t){try{process.chdir(t.worktreePath)}catch{g(null);return}i(t.worktreePath),E(I()),c(t),p(),y(),e.cache.clear?.()}}function Me(){let t=T();if(t){c(null),p(),y(),e.cache.clear?.();try{process.chdir(t.originalCwd)}catch{return}i(t.originalCwd),E(I())}}async function Ne(e,t,n){if(t.forkSession)e.contentReplacements?.length&&await m(e.contentReplacements);else{let n=t.sessionIdOverride??e.sessionId;n&&(N(ee(n),t.transcriptPath?ke(t.transcriptPath):null),await C(),oe(n))}b(t.forkSession?{...e,worktreeSession:void 0}:e),t.forkSession||(H(e.worktreeSession),u());let{agentDefinition:r,agentType:i}=V(e.agentSetting,n.mainThreadAgentDefinition,n.agentDefinitions);he(`normal`),t.includeAttribution;let a=B(e.agentName,e.agentColor);fe(e.agentName);let o=n.agentDefinitions;return{messages:e.messages,fileHistorySnapshots:e.fileHistorySnapshots,contentReplacements:e.contentReplacements,agentName:e.agentName,agentColor:e.agentColor==="default"?void 0:e.agentColor,restoredAgentDef:r,initialState:{...n.initialState,...i&&{agent:i},...a&&{standaloneAgentContext:a},agentDefinitions:o}}}o(),A(),s(),we(),ce(),n(),Se(),R(),be(),v(),F();var Pe=1e3,Fe=500,Ie=300,Le=2e3,Re=typeof Bun<`u`,U=null,W=null,G=new Set,K=!1,q=!1,J=!1,Y=null,X=M(),Z=null;async function ze(){if(K||q)return;K=!0,J||(J=!0,ue(()=>{r(),X.emit()}));let e=await Ve();e.length!==0&&(L(`Watching for changes in skill/command directories: ${e.join(`, `)}...`),U=a.watch(e,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:Z?.stabilityThreshold??Pe,pollInterval:Z?.pollInterval??Fe},ignored:(e,t)=>t&&!t.isFile()&&!t.isDirectory()?!0:e.split(z.sep).some(e=>e===`.git`),ignorePermissionErrors:!0,usePolling:Re,interval:Z?.chokidarInterval??Le,atomic:!0}),U.on(`add`,$),U.on(`change`,$),U.on(`unlink`,$),Y=xe(async()=>{await Q()}))}function Q(){q=!0,Y&&(Y(),Y=null);let e=Promise.resolve();return U&&(e=U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),e}var Be=X.subscribe;async function Ve(){let e=Ce(),t=[],n=h(`userSettings`,`skills`);if(n)try{await e.stat(n),t.push(n)}catch{}let r=h(`userSettings`,`commands`);if(r)try{await e.stat(r),t.push(r)}catch{}let i=h(`projectSettings`,`skills`);if(i)try{let n=z.resolve(i);await e.stat(n),t.push(n)}catch{}let a=h(`projectSettings`,`commands`);if(a)try{let n=z.resolve(a);await e.stat(n),t.push(n)}catch{}for(let n of j()){let r=z.join(n,`.workmate`,`skills`);try{await e.stat(r),t.push(r)}catch{}}return t}function $(e){L(`Detected skill change: ${e}`),Te(`tengu_skill_file_changed`,{source:`chokidar`}),He(e)}function He(e){G.add(e),W&&clearTimeout(W),W=setTimeout(async()=>{W=null;let e=[...G];if(G.clear(),ve(await re(`skills`,e[0]))){L(`ConfigChange hook blocked skill reload (${e.length} paths)`);return}x(),t(),ae(),X.emit()},Z?.reloadDebounce??Ie)}async function Ue(e){U&&(await U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),K=!1,q=!1,Z=e??null}var We={initialize:ze,dispose:Q,subscribe:Be,resetForTesting:Ue};export{V as a,Ne as i,B as n,je as o,Me as r,H as s,We as t};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./startupProfiler-2sjXZkIP.js";e();export{t as profileCheckpoint};
@@ -1 +0,0 @@
1
- import{Bn as e,Wt as t,dn as n,pt as r,t as i}from"./state-BPFYBqm1.js";t();export{i as addInvokedSkill,r as getSessionId,n as setCwdState,e as setOriginalCwd};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Settings-_b5Yxt_9.js";async function i(e,t){return(0,a.jsx)(r,{onClose:e,context:t,defaultTab:`Status`})}var a;e((()=>{n(),a=t()}))();export{i as call};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./switcher-CnBKuiNp.js";e();export{t as restoreActiveProvider};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DcaKZlRU.js";import{A as r,l as i,n as a,p as o,w as s}from"./external-CEp-aPkt.js";import{o as c,s as l}from"./log-BlJ7CcKG.js";import{dirname as u,join as d}from"path";import{existsSync as f,readFileSync as p,renameSync as m,unlinkSync as h,writeFileSync as g}from"fs";import{randomBytes as _}from"node:crypto";var v=e((()=>{a(),a()})),y,b,x,S=e((()=>{v(),y=i([`openai-compat`,`anthropic-compat`]),b=s({id:r().min(1).regex(/^[a-z0-9-]+$/,`id must be kebab-case`),kind:y,baseUrl:r().url(),apiKey:r().min(1).optional(),apiKeyEnv:r().min(1).optional(),defaultModel:r().min(1).default(`gpt-4o-mini`)}).refine(e=>!!e.apiKey||!!e.apiKeyEnv,`either apiKey or apiKeyEnv is required`),x=o(b)}));function C(){return d(t(),`providers.json`)}function w(){k=null}function T(){if(k!==null)return k;let e=E();return k=e.providers,e.providers}function E(){let e=C();if(!f(e))return{providers:[]};let t;try{t=p(e,`utf-8`)}catch(t){let n=`loadProviders: failed to read ${e}: ${t instanceof Error?t.message:String(t)}`;return l(Error(n)),{providers:[],error:n}}if(!t.trim())return{providers:[]};let n;try{n=JSON.parse(t)}catch{let t=`loadProviders: ${e} is not valid JSON. Ignoring.`;return l(Error(t)),{providers:[],error:t}}let r=x.safeParse(n);if(!r.success){let t=`loadProviders: ${e} failed schema validation: ${r.error.message}. Ignoring.`;return l(Error(t)),{providers:[],error:t}}return{providers:r.data}}function D(e,t){return(t??T()).find(t=>t.id===e)}function O(e){let t=C(),n=d(u(t),`.providers-${_(8).toString(`hex`)}.tmp`);try{g(n,JSON.stringify(e,null,2),`utf-8`),m(n,t)}catch(e){try{h(n)}catch{}throw e}return w(),e}var k,A=e((()=>{c(),n(),S(),k=null}));function j(e){if(e.apiKey)return e.apiKey;if(e.apiKeyEnv)return process.env[e.apiKeyEnv]}function M(e,t){let n=t??T(),r=D(e,n);if(!r){let t=n.map(e=>e.id).join(`, `);throw Error(`switchProvider: provider "${e}" not found. Available: ${t}`)}let i=r.kind===`anthropic-compat`?{ANTHROPIC_BASE_URL:r.baseUrl,ANTHROPIC_MODEL:r.defaultModel}:{CLAUDE_CODE_USE_OPENAI:`1`,OPENAI_BASE_URL:r.baseUrl,OPENAI_MODEL:r.defaultModel},a=[];if(r.kind===`openai-compat`){let e=process.env.CLAUDE_CODE_USE_OPENAI===`1`||!!process.env.OPENAI_API_KEY,t=!!process.env.ANTHROPIC_API_KEY;e&&t&&a.push(`Both ANTHROPIC_API_KEY and OpenAI-compat mode are set. ANTHROPIC_API_KEY is for workspace endpoints (/v1/agents, /v1/vaults). OpenAI-compat mode routes /v1/messages to a third-party provider. These are separate planes — verify this is intentional.`)}return!r.apiKey&&!r.apiKeyEnv?a.push(`Provider "${r.id}" has neither apiKey nor apiKeyEnv configured. Edit ~/.workmate/providers.json to add one.`):!r.apiKey&&r.apiKeyEnv&&!process.env[r.apiKeyEnv]&&a.push(`${r.apiKeyEnv} is not set in the current environment. Set it before starting Work Mate: export ${r.apiKeyEnv}=<your-api-key>`),{env:i,warnings:a,provider:r}}function N(e){return e.kind===`anthropic-compat`?`ANTHROPIC_API_KEY`:`OPENAI_API_KEY`}async function P(e,t){delete process.env.CLAUDE_CODE_USE_BEDROCK,delete process.env.CLAUDE_CODE_USE_VERTEX,delete process.env.CLAUDE_CODE_USE_FOUNDRY,delete process.env.CLAUDE_CODE_USE_GEMINI,delete process.env.CLAUDE_CODE_USE_GROK,e.kind===`anthropic-compat`?(delete process.env.CLAUDE_CODE_USE_OPENAI,delete process.env.OPENAI_BASE_URL,delete process.env.OPENAI_API_KEY,delete process.env.OPENAI_MODEL):(delete process.env.ANTHROPIC_BASE_URL,delete process.env.ANTHROPIC_API_KEY,delete process.env.ANTHROPIC_MODEL);let n=e.kind===`anthropic-compat`?{ANTHROPIC_BASE_URL:e.baseUrl,ANTHROPIC_API_KEY:t??``,ANTHROPIC_MODEL:e.defaultModel}:{CLAUDE_CODE_USE_OPENAI:`1`,OPENAI_BASE_URL:e.baseUrl,OPENAI_API_KEY:t??``,OPENAI_MODEL:e.defaultModel},{clearOpenAIClientCache:r}=await import(`./client-zhozU2ws.js`);r();let{fetchAvailableModels:i}=await import(`./fetchModelList-BeL40TyR.js`);i.cache.clear();let{applyConfigEnvironmentVariables:a}=await import(`./managedEnv-ADMKY7-G.js`);a(),Object.assign(process.env,n)}async function F(e,t){let{provider:n,warnings:r}=M(e,t),i=j(n),a=N(n);i||r.push(`No API key available for provider "${n.id}" — ${a} will be empty. Set ${n.apiKeyEnv??`an env var`} or add an apiKey field in ~/.workmate/providers.json.`),await P(n,i);let{updateSettingsForSource:o}=await import(`./settings-BgHApyGL.js`);return o(`userSettings`,{activeProviderId:n.id,modelType:n.kind===`anthropic-compat`?`anthropic`:`openai`}),{provider:n,warnings:r}}async function I(){let{getSettingsForSource:e}=await import(`./settings-BgHApyGL.js`),t=e(`userSettings`)?.activeProviderId;if(!t)return null;let n=D(t);if(!n)return null;let r=[],i=j(n);if(!i){let e=N(n);r.push(`No API key available for provider "${n.id}" — ${e} will be empty. Set ${n.apiKeyEnv??`an env var`} or add an apiKey field in ~/.workmate/providers.json.`)}return await P(n,i),{provider:n,warnings:r}}var L=e((()=>{A()}));export{A as a,v as c,M as i,L as n,T as o,I as r,O as s,F as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Gn as t,Un as n,Wn as r}from"./settings-CvhsRFaT.js";import{u as i}from"./oauth-D38aRTUb.js";import{$r as a,Pt as o,St as s,gt as c,ni as l,ti as u}from"./model-DlLO7TSx.js";function d(){p=void 0,r()}function f(){if(p!==void 0)return p;if(a()!==`firstParty`||!l()||process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`)return p=t(!1);let e=s();if(e?.accessToken&&e.subscriptionType===null||e?.accessToken&&e.scopes?.includes(`user:inference`)&&(e.subscriptionType===`enterprise`||e.subscriptionType===`team`))return p=t(!0);try{let{key:e}=c({skipRetrievingKeyFromApiKeyHelper:!0});if(e)return p=t(!0)}catch{}return p=t(!1)}var p,m=e((()=>{i(),o(),u(),n()}));export{f as n,d as r,m as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Cx as t,gT as n,hT as r,wx as i}from"./loadAgentsDir-CbtNPJV3.js";import{n as a,t as o}from"./partition-B8Y4jvjW.js";function s(e,t,r){let[o,s]=a(n([...e,...t],`name`),i),c=(e,t)=>e.name.localeCompare(t.name);return[...s.sort(c),...o.sort(c)]}var c=e((()=>{o(),r(),t()}));export{s as n,c as t};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./trustedDevice-CdLAZK6m.js";export{t as clearTrustedDeviceToken,e as enrollTrustedDevice};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Xh as t,Zh as n}from"./loadAgentsDir-CbtNPJV3.js";import{C as r,_ as i,s as a}from"./model-DlLO7TSx.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};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$h as t,Cs as n,Jx as r,Ss as i,Xd as a,Xh as o,Yd as s,Zh as c,_h as l,_s as u,b_ as d,bh as f,co as p,hh as m,lo as h,qx as g,vs as _,x_ as v,yh as y}from"./loadAgentsDir-CbtNPJV3.js";import{ai as b}from"./src-DL3w8VPk2.js";import{R as x,U as S,c as C,i as w}from"./debug-BQj6h99Q.js";import{Ln as T,Rn as E}from"./settings-CvhsRFaT.js";import{O as D,k as O}from"./git-DplvjXEY.js";import{o as k,s as A}from"./log-BlJ7CcKG.js";import{n as j,r as M}from"./analytics-DJobLaWP.js";import{n as N,r as P}from"./pluginFlagging-C0PtAJEg.js";import{t as F}from"./pluginBlocklist-BvdBsnJG.js";var I=e(b(),1);s(),j(),m(),o(),E(),w(),D(),x(),k(),i(),_(),d(),y(),g(),P(),p();function L({enabled:e=!0}={}){let i=t(),o=c(e=>e.plugins.needsRefresh),{addNotification:s}=a(),d=(0,I.useCallback)(async()=>{try{let{enabled:e,disabled:t,errors:a}=await h();await F();let o=N();Object.keys(o).length>0&&s({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let c=[],d=[];try{c=await u()}catch(e){let t=e instanceof Error?e.message:String(e);a.push({type:`generic-error`,source:`plugin-commands`,error:`Failed to load plugin commands: ${t}`})}try{d=await n()}catch(e){let t=e instanceof Error?e.message:String(e);a.push({type:`generic-error`,source:`plugin-agents`,error:`Failed to load plugin agents: ${t}`})}try{await v()}catch(e){let t=e instanceof Error?e.message:String(e);a.push({type:`generic-error`,source:`plugin-hooks`,error:`Failed to load plugin hooks: ${t}`})}let p=(await Promise.all(e.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await r(e,a);return t&&(e.mcpServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0),m=(await Promise.all(e.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await f(e,a);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);l(),i(n=>{let r=n.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),i=new Set(a.map(e=>e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`)),o=[...r.filter(e=>{let t=e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`;return!i.has(t)}),...a];return{...n,plugins:{...n.plugins,enabled:e,disabled:t,commands:c,errors:o}}}),C(`Loaded plugins - Enabled: ${e.length}, Disabled: ${t.length}, Commands: ${c.length}, Agents: ${d.length}, Errors: ${a.length}`);let g=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:t.length,inline_count:T(e,e=>e.source.endsWith(`@inline`)),marketplace_count:T(e,e=>!e.source.endsWith(`@inline`)),error_count:a.length,skill_count:c.length,agent_count:d.length,hook_count:g,mcp_count:p,lsp_count:m}}catch(e){let t=S(e);return A(t),C(`Error loading plugins: ${e}`),i(e=>{let n=e.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r={type:`generic-error`,source:`plugin-system`,error:t.message};return{...e,plugins:{...e.plugins,enabled:[],disabled:[],commands:[],errors:[...n,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}}},[i,s]);(0,I.useEffect)(()=>{e&&d().then(e=>{let{ant_enabled_names:t,...n}=e,r={...n,has_custom_plugin_cache_dir:!!process.env.CLAUDE_CODE_PLUGIN_CACHE_DIR};M(`tengu_plugins_loaded`,{...r,...t!==void 0&&{enabled_names:t}}),O(`info`,`tengu_plugins_loaded`,r)})},[d,e]),(0,I.useEffect)(()=>{!e||!o||s({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,o,s])}export{L as t};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Xd as n,Yd as r,ng as i,rg as a}from"./loadAgentsDir-CbtNPJV3.js";import{ai as o}from"./src-DL3w8VPk2.js";import{B as s,Wt as c}from"./state-BPFYBqm1.js";import{n as l,t as u}from"./allErrors-DUYYPpdH.js";function d(){let{addNotification:e,removeNotification:t}=n(),[r,i]=(0,f.useState)(()=>{let{errors:e}=u();return e});return a((0,f.useCallback)(()=>{let{errors:e}=u();i(e)},[])),(0,f.useEffect)(()=>{if(!s())if(r.length>0){let t=`Found ${r.length} settings ${r.length===1?`issue`:`issues`} · /doctor for details`;e({key:p,text:t,color:`warning`,priority:`high`,timeoutMs:6e4})}else t(p)},[r,e,t]),r}var f,p,m=e((()=>{f=t(o(),1),r(),c(),l(),i(),p=`settings-errors`}));export{d as n,m as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{Ew as r,Tw as i,dE as a,fE as o,hE as s,mE as c,vw as l,ww as u,yw as d}from"./loadAgentsDir-CbtNPJV3.js";import{p as f}from"./external-CEp-aPkt.js";import{r as ee}from"./lazySchema-B4D4qJVE.js";import{B as p,C as m,F as h,P as g,R as _,S as v,c as y,f as b,i as te,u as x,x as S}from"./debug-BQj6h99Q.js";import{_t as C,gt as w,ht as T,pt as E,vt as D}from"./settings-CvhsRFaT.js";import{o as ne,s as O}from"./log-BlJ7CcKG.js";import{homedir as re}from"os";import*as k from"path";import{join as ie,resolve as ae}from"path";import{randomBytes as oe}from"crypto";import{readFile as A,readdir as j,rename as M,stat as N,unlink as P,writeFile as F}from"fs/promises";function I(){return ie(l(),U)}async function L(){let e=I();try{let t=v(await A(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return y(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==H)return y(`Install counts cache version mismatch (got ${n.version}, expected ${H})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return y(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(y(`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>G?(y(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(y(`Install counts cache has malformed entries`),null)}catch(e){return h(e)!==`ENOENT`&&y(`Failed to load install counts cache: ${g(e)}`),null}}async function R(e){let t=I(),n=`${t}.${oe(8).toString(`hex`)}.tmp`;try{let r=l();await x().mkdir(r),await F(n,m(e,null,2),{encoding:`utf-8`,mode:384}),await M(n,t),y(`Install counts cache saved successfully`)}catch(e){O(e);try{await P(n)}catch{}}}async function z(){y(`Fetching install counts from ${W}`);let e=performance.now();try{let n=await t.get(W,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return r(`install_counts`,W,`success`,performance.now()-e),n.data.plugins}catch(t){throw r(`install_counts`,W,`failure`,performance.now()-e,u(t)),t}}async function B(){let e=await L();if(e){y(`Using cached install counts`),r(`install_counts`,W,`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 z();await R({version:H,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 O(e),y(`Failed to fetch install counts: ${g(e)}`),null}}function V(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 H,U,W,G,K=e((()=>{n(),te(),_(),b(),ne(),S(),i(),d(),H=1,U=`install-counts-cache.json`,W=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,G=1440*60*1e3}));async function se(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=ae(t.startsWith(`~`)?t.replace(/^~/,re()):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((()=>{_(),b()}));function le(e){let t=k.basename(e),n=k.basename(k.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=k.resolve(e),i;try{i=await A(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: ${g(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=v(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${g(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=T().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=k.resolve(e),i;try{i=await A(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: ${g(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`marketplace`}}let a;try{a=v(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${g(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=C().extend({plugins:f(w().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=k.dirname(r),a=k.basename(i)===`.claude-plugin`?k.dirname(i):i;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=k.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=v(await A(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=[],o=t.match(a);if(!o)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 c=o[1]||``,l;try{l=s(c)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${g(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 l!=`object`||!l||Array.isArray(l))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(l)?`an array`:l===null?`null`:typeof l}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let u=l;if(u.description!==void 0){let e=u.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}.`});u.name!==void 0&&u.name!==null&&typeof u.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof u.name}.`});let d=u[`allowed-tools`];d!=null&&(typeof d!=`string`&&!Array.isArray(d)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof d}.`}):Array.isArray(d)&&d.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let f=u.shell;if(f!=null)if(typeof f!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof f}.`});else{let e=f.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${f}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await A(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: ${g(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=v(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${g(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=E().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 j(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=>k.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=k.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`,k.join(e,`skills`)],[`agent`,k.join(e,`agents`)],[`command`,k.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 A(r,{encoding:`utf-8`})}catch(n){if(p(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${g(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(k.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=k.resolve(e),n=null;try{n=await N(t)}catch(e){if(!p(e))throw e}if(n?.isDirectory()){let e=await X(k.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(k.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=v(await A(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((()=>{ee(),_(),o(),S(),c(),D(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{se as a,K as c,ce as i,pe as n,V as o,fe as r,B as s,me as t};
@@ -1 +0,0 @@
1
- import{i as e,o as t}from"./windowsPaths-BmXyrasP.js";e();export{t as setShellIfWindows};
@@ -1 +0,0 @@
1
- import{St as e,_t as t}from"./loadAgentsDir-CbtNPJV3.js";e();export{t as execIntoTmuxWorktree};