@readmagic/workmate 0.0.14 → 0.0.16

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 (312) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-DAtfMH4o.js +1 -0
  2. package/dist/chunks/{AgentsMdExternalIncludesDialog-D58Vn3SK.js → AgentsMdExternalIncludesDialog-BTYgjY5c.js} +1 -1
  3. package/dist/chunks/AgentsMdExternalIncludesDialog-C6VH6JG6.js +1 -0
  4. package/dist/chunks/{App-CeC-2dzL.js → App-HF0bvxi_.js} +1 -1
  5. package/dist/chunks/ApproveApiKey-B7mKgSqY.js +1 -0
  6. package/dist/chunks/{ApproveApiKey-DFpddLyp.js → ApproveApiKey-BBFLw2B7.js} +1 -1
  7. package/dist/chunks/{BackgroundTasksDialog-9ruzl1jm.js → BackgroundTasksDialog-Coc0ecUd.js} +1 -1
  8. package/dist/chunks/BypassPermissionsModeDialog--Gx9ARd4.js +1 -0
  9. package/dist/chunks/{DiffDialog-LTdtTqsC.js → DiffDialog-tlINuFS1.js} +1 -1
  10. package/dist/chunks/Doctor-BJf49FWX.js +1 -0
  11. package/dist/chunks/{Doctor-Yvrzcrvx.js → Doctor-Wh7z6CnF.js} +2 -2
  12. package/dist/chunks/ExitFlow-B1zHTqQt.js +2 -0
  13. package/dist/chunks/Grove-1Kf7xxIV.js +11 -0
  14. package/dist/chunks/{HybridTransport-CEWG9ZRi.js → HybridTransport-DWqWUZCH.js} +1 -1
  15. package/dist/chunks/{InvalidConfigDialog-Ue3kJUPJ.js → InvalidConfigDialog-OZPFQSnC.js} +1 -1
  16. package/dist/chunks/{InvalidSettingsDialog-BO2AOTVf.js → InvalidSettingsDialog-BNCm-eyC.js} +1 -1
  17. package/dist/chunks/MCPConnectionManager-7H84oi5n.js +1 -0
  18. package/dist/chunks/MCPToolListView-CVgtg3Iq.js +1 -0
  19. package/dist/chunks/{McpParsingWarnings-BsCDFWci.js → McpParsingWarnings-CN8f449l.js} +1 -1
  20. package/dist/chunks/{MessageSelector-DY5K0NHd.js → MessageSelector-B9j6zZ5w.js} +1 -1
  21. package/dist/chunks/Messages-yz1m39eI.js +10 -0
  22. package/dist/chunks/{Onboarding-w0-VVsDz.js → Onboarding-bFbgae8m.js} +1 -1
  23. package/dist/chunks/{PromptInputFooterSuggestions-OEXx0Abp.js → PromptInputFooterSuggestions-CE_yVun1.js} +1 -1
  24. package/dist/chunks/PromptInputHelpMenu-TPWuGwAy.js +1 -0
  25. package/dist/chunks/QueryEngine-CRobcENE.js +1 -0
  26. package/dist/chunks/REPL-BhCC0JP6.js +1 -0
  27. package/dist/chunks/REPL-C33mMf_q.js +128 -0
  28. package/dist/chunks/RemoteSessionManager-BjVD918g.js +2 -0
  29. package/dist/chunks/{ResumeConversation-BbNrpSFB.js → ResumeConversation-CXd8d8po.js} +1 -1
  30. package/dist/chunks/{SSETransport-CLiI2qnD.js → SSETransport-BSilVN9e.js} +1 -1
  31. package/dist/chunks/SearchExtraToolsTool-DoiCI2uJ.js +1 -0
  32. package/dist/chunks/Settings-ClcLl0C1.js +2 -0
  33. package/dist/chunks/{TeleportProgress-IB--CbqZ.js → TeleportProgress-DonJUoPc.js} +1 -1
  34. package/dist/chunks/{TeleportRepoMismatchDialog-KjdlS_gA.js → TeleportRepoMismatchDialog-ByOuSVVz.js} +1 -1
  35. package/dist/chunks/TeleportResumeWrapper-BBtELwF1.js +1 -0
  36. package/dist/chunks/{ThemePicker-BrD_T7xF.js → ThemePicker-1QQJFOEv.js} +1 -1
  37. package/dist/chunks/{TrustDialog-L0rvvpit.js → TrustDialog-DwJ9L_u4.js} +1 -1
  38. package/dist/chunks/{ValidationErrorsList-QZvtUrAy.js → ValidationErrorsList-Cuq6W2yc.js} +1 -1
  39. package/dist/chunks/{add-dir-CpWXReCi.js → add-dir-DOKdPFT2.js} +1 -1
  40. package/dist/chunks/{agentDisplay-CrQvGkTT.js → agentDisplay-TX1bh-lX.js} +1 -1
  41. package/dist/chunks/{agents-C99yMsVF.js → agents-C58tRxpi.js} +1 -1
  42. package/dist/chunks/agents-CbRjX9Pj.js +101 -0
  43. package/dist/chunks/{allErrors-uyOMiF9U.js → allErrors-DRiW7i6Y.js} +1 -1
  44. package/dist/chunks/api-C8uOHD-v.js +1 -0
  45. package/dist/chunks/{api-C5I2xwgd.js → api-CazVavfB.js} +1 -1
  46. package/dist/chunks/auth-BL238vgr.js +1 -0
  47. package/dist/chunks/auth-CfrCl9BZ.js +10 -0
  48. package/dist/chunks/auth-D3GkU6d7.js +1 -0
  49. package/dist/chunks/{backgroundHousekeeping-CjD8bACB.js → backgroundHousekeeping-CPLlaWcV.js} +2 -2
  50. package/dist/chunks/backgroundHousekeeping-Du2tN2WE.js +1 -0
  51. package/dist/chunks/{branch-BOWBZo5K.js → branch-pAa0oBaj.js} +1 -1
  52. package/dist/chunks/{bridgeConfig-CgAVrQfz.js → bridgeConfig-DnFfCpGd.js} +1 -1
  53. package/dist/chunks/bridgeConfig-joBqeK0j.js +1 -0
  54. package/dist/chunks/{bridgeMessaging-cOFtbkf_.js → bridgeMessaging-B_hnuUHb.js} +1 -1
  55. package/dist/chunks/bridgeStatusUtil-Dwz4YHNA.js +1 -0
  56. package/dist/chunks/{btw-B0UmiVKl.js → btw-CkVkYeRr.js} +1 -1
  57. package/dist/chunks/{caches-wN3JyvNE.js → caches-BLQUkrIG.js} +1 -1
  58. package/dist/chunks/caches-DsFl83sh.js +1 -0
  59. package/dist/chunks/{ccrClient-wtUIz75R.js → ccrClient-AfdUbWzY.js} +1 -1
  60. package/dist/chunks/claudeDesktop-CB3UCt7U.js +1 -0
  61. package/dist/chunks/{clear-CNzBoL7O.js → clear-Ac3qYi_-.js} +1 -1
  62. package/dist/chunks/client-BX0r6K3I.js +1 -0
  63. package/dist/chunks/client-Bb2eZnuq.js +1 -0
  64. package/dist/chunks/client-DNEVh6Wu.js +1 -0
  65. package/dist/chunks/client-Pap_HyZZ.js +1 -0
  66. package/dist/chunks/client-zhozU2ws.js +1 -0
  67. package/dist/chunks/commands-BKLsl6gK.js +1 -0
  68. package/dist/chunks/{compact-Bj8mdDYN.js → compact-CXuDr5qM.js} +1 -1
  69. package/dist/chunks/{config-BkbL2e5Q.js → config-BSkuQZNf.js} +1 -1
  70. package/dist/chunks/{config-WMxn2jLl.js → config-D78R57VA.js} +1 -1
  71. package/dist/chunks/config-DrY1SvhQ.js +1 -0
  72. package/dist/chunks/{context-DB1Ar85E.js → context-C2plOqH4.js} +1 -1
  73. package/dist/chunks/context-noninteractive-DpVlZ-wP.js +1 -0
  74. package/dist/chunks/{context-noninteractive-CqnJTDcI.js → context-noninteractive-fVQtwEkw.js} +1 -1
  75. package/dist/chunks/conversation-C0yysXds.js +1 -0
  76. package/dist/chunks/{conversation-DOgBzrm0.js → conversation-DQpS6nvg.js} +1 -1
  77. package/dist/chunks/{createSSHSession-Cf2tOgK_.js → createSSHSession-CfyFuJMH.js} +1 -1
  78. package/dist/chunks/createSession-CmBawnsh.js +1 -0
  79. package/dist/chunks/{createSession-DD5YaQKM.js → createSession-qk9C66lK.js} +1 -1
  80. package/dist/chunks/{crossProjectResume-CkiPQYYE.js → crossProjectResume-DY1ZBO5P.js} +1 -1
  81. package/dist/chunks/{datadog-DcLf1QpG.js → datadog-Cr0VKbct.js} +1 -1
  82. package/dist/chunks/{diff-dfXWiuLA.js → diff-BNjcCXDr.js} +1 -1
  83. package/dist/chunks/{directoryCompletion-BtlRKLzw.js → directoryCompletion-i2oWpaUe.js} +1 -1
  84. package/dist/chunks/doctor-BkCtT7H1.js +1 -0
  85. package/dist/chunks/{entry-wISucmYc.js → entry-o9IZPS4g.js} +3 -3
  86. package/dist/chunks/{esm-CrJVXrKW.js → esm-BI3tFLyy.js} +1 -1
  87. package/dist/chunks/exit-Dlyj7nY8.js +1 -0
  88. package/dist/chunks/extraUsage-5Ueiyw6W.js +1 -0
  89. package/dist/chunks/extractMemories-DnTBWFOW.js +1 -0
  90. package/dist/chunks/fast-B3fRp1xO.js +1 -0
  91. package/dist/chunks/fast-ClOKONyD.js +1 -0
  92. package/dist/chunks/fetchModelList-B8KG79EK.js +1 -0
  93. package/dist/chunks/fetchModelList-gh_jFYai.js +1 -0
  94. package/dist/chunks/{fileSuggestions-Dy2BUZzd.js → fileSuggestions-DK7W8kLF.js} +1 -1
  95. package/dist/chunks/{firstPartyEventLogger-D4yuDP-n.js → firstPartyEventLogger-BMnXb9cv.js} +2 -2
  96. package/dist/chunks/firstPartyEventLogger-YYOb8aIo.js +1 -0
  97. package/dist/chunks/{flushGate-B6ecrC4j.js → flushGate-n4kK6H1U.js} +1 -1
  98. package/dist/chunks/{gemini-BC-BxZmj.js → gemini-C8-QHnsC.js} +1 -1
  99. package/dist/chunks/{generateSessionName-JTR8nPYD.js → generateSessionName-C8DnAVaa.js} +1 -1
  100. package/dist/chunks/{githubRepoPathMapping-Bk4FZrng.js → githubRepoPathMapping-Px3_GeD1.js} +1 -1
  101. package/dist/chunks/{goal-B09SOyra.js → goal-DMmzlZOF.js} +1 -1
  102. package/dist/chunks/grok-LLjpAwP_.js +1 -0
  103. package/dist/chunks/{grove-DsAIY-rZ.js → grove-CQBCzeHf.js} +1 -1
  104. package/dist/chunks/help-JH7WzjZP.js +1 -0
  105. package/dist/chunks/hooks-COhKt_pF.js +1 -0
  106. package/dist/chunks/{hooks-BI4NY5IC.js → hooks-DD2jpRfx.js} +7 -7
  107. package/dist/chunks/initReplBridge-BDaN0hpY.js +1 -0
  108. package/dist/chunks/install-CD4or0vj.js +1 -0
  109. package/dist/chunks/{instrumentation-5cSwEKaF.js → instrumentation-n-otwpYf.js} +4 -4
  110. package/dist/chunks/{job-rW1mEYtm.js → job-B-pEWgXI.js} +1 -1
  111. package/dist/chunks/keybindings-qed9q9tx.js +1 -0
  112. package/dist/chunks/{launchLocalMemory-CPucX8Xj.js → launchLocalMemory-cBovdGMT.js} +1 -1
  113. package/dist/chunks/{launchOnboarding--GCJWeeS.js → launchOnboarding-B__wtt7p.js} +1 -1
  114. package/dist/chunks/{loadAgentsDir-JrGMJN05.js → loadAgentsDir-PPiD2Mfq.js} +574 -574
  115. package/dist/chunks/loadAgentsDir-qvqrTVuS.js +1 -0
  116. package/dist/chunks/{loadPluginHooks-C4zrlV0u.js → loadPluginHooks-DUCuU3_8.js} +1 -1
  117. package/dist/chunks/localSearch-CDk_stXJ.js +1 -0
  118. package/dist/chunks/{localSearch-C-stDP9C.js → localSearch-Cvs9WfoX.js} +1 -1
  119. package/dist/chunks/{logoV2Utils-J2Sqfube.js → logoV2Utils-Bkj74dtY.js} +1 -1
  120. package/dist/chunks/{magicDocs-Dpe3YhyL.js → magicDocs-3U6peChg.js} +2 -2
  121. package/dist/chunks/main-DkjxhBIC.js +356 -0
  122. package/dist/chunks/{managedEnv-C8SisyLk.js → managedEnv-BUrzwaD3.js} +1 -1
  123. package/dist/chunks/managedEnv-XOUMOtEF.js +1 -0
  124. package/dist/chunks/{mappers-CMJorgSL.js → mappers-ZGgwqDOK.js} +1 -1
  125. package/dist/chunks/mcp-COZxwgJZ.js +6 -0
  126. package/dist/chunks/{mcp-SuAh71Ht.js → mcp-CdyNeNzh.js} +1 -1
  127. package/dist/chunks/{mcp-_tBxhPV-.js → mcp-CysOyBIn.js} +1 -1
  128. package/dist/chunks/{memory-DK8bOrUr.js → memory-B5h2TTSS.js} +1 -1
  129. package/dist/chunks/{mode-BhfhEpnW.js → mode-D3yY1fdK.js} +1 -1
  130. package/dist/chunks/model-Bz4JHoU0.js +1 -0
  131. package/dist/chunks/model-g6XBcNAG.js +1 -0
  132. package/dist/chunks/model-sviY1inu.js +1 -0
  133. package/dist/chunks/modelOptions-DYQqTLPi.js +1 -0
  134. package/dist/chunks/{nativeInstaller-xxyUjXbl.js → nativeInstaller-N1xiUpCP.js} +1 -1
  135. package/dist/chunks/{omit-od_CYp5o.js → omit-BOILu8jW.js} +1 -1
  136. package/dist/chunks/{onChangeAppState-CqTb0yEa.js → onChangeAppState-COFFZAXb.js} +1 -1
  137. package/dist/chunks/{openai-qW8mATAs.js → openai-BHM5kEFo.js} +2 -2
  138. package/dist/chunks/openai-CR3CcjCE.js +17 -0
  139. package/dist/chunks/{partition-CYoWXLNU.js → partition-C1SFDk_L.js} +1 -1
  140. package/dist/chunks/{permissions--iKUbWBw.js → permissions-uy_NFbfy.js} +3 -3
  141. package/dist/chunks/{pidLock-BR4hzYgp.js → pidLock-DuMVSwnN.js} +2 -2
  142. package/dist/chunks/{plan-DiHCGXhM.js → plan-DF9YSB5M.js} +1 -1
  143. package/dist/chunks/{plugin-BeC4D7XF.js → plugin-GRPzqgTr.js} +1 -1
  144. package/dist/chunks/{pluginAutoupdate-Bj-CrFuO.js → pluginAutoupdate-AMD-FvKB.js} +1 -1
  145. package/dist/chunks/{pluginBlocklist-DzOs-RS1.js → pluginBlocklist-DNxkAxH6.js} +1 -1
  146. package/dist/chunks/{pluginCliCommands-DwIGn58t.js → pluginCliCommands-BFoR1ZXx.js} +1 -1
  147. package/dist/chunks/{pluginFlagging-BzuymJuf.js → pluginFlagging-CW2IZWSI.js} +1 -1
  148. package/dist/chunks/{pluginOperations-CP1v-nu0.js → pluginOperations-DlWE0idP.js} +1 -1
  149. package/dist/chunks/{pluginStartupCheck-BUeBiYVq.js → pluginStartupCheck-AQGV0DCS.js} +1 -1
  150. package/dist/chunks/pluginStartupCheck-DWpquqxx.js +1 -0
  151. package/dist/chunks/{plugins-D1N31THW.js → plugins-CwUSTE4E.js} +1 -1
  152. package/dist/chunks/poorMode-DD88nPJ4.js +1 -0
  153. package/dist/chunks/{poorMode-D4L_-yWS.js → poorMode-wm2WkPF0.js} +1 -1
  154. package/dist/chunks/print-9wR_ijrL.js +14 -0
  155. package/dist/chunks/{processBashCommand-BGCIqxc9.js → processBashCommand-Deqwq1IE.js} +1 -1
  156. package/dist/chunks/{processSlashCommand-qR_j1DE8.js → processSlashCommand-U9LJ4Keq.js} +2 -2
  157. package/dist/chunks/prompt-BBeDQXIs.js +1 -0
  158. package/dist/chunks/{prompt-DnPppVz8.js → prompt-CQmEvnKN.js} +1 -1
  159. package/dist/chunks/prompt-CXhdqgB7.js +1 -0
  160. package/dist/chunks/{promptEditor-Cilc9N3L.js → promptEditor-Bf72KNF-.js} +1 -1
  161. package/dist/chunks/{protocolHandler-DdbiucQa.js → protocolHandler--eQQuSyx.js} +1 -1
  162. package/dist/chunks/{reconciler-Bte4gdP-.js → reconciler-Css9bs07.js} +1 -1
  163. package/dist/chunks/{refresh-MiZ0acBm.js → refresh-B87z39Zs.js} +1 -1
  164. package/dist/chunks/{registerProtocol-Bpte9dly.js → registerProtocol-DrWIX3Lb.js} +1 -1
  165. package/dist/chunks/{reload-plugins-GdqFZblC.js → reload-plugins-BpmUIkfm.js} +1 -1
  166. package/dist/chunks/{remoteBridgeCore-CAl3_H-O.js → remoteBridgeCore-BCLIIygk.js} +1 -1
  167. package/dist/chunks/{remoteManagedSettings-BcLJLEr7.js → remoteManagedSettings-Ahgn2e80.js} +1 -1
  168. package/dist/chunks/{rename-BDo5qIK0.js → rename-BUt3PliQ.js} +1 -1
  169. package/dist/chunks/{resume-Bbweh2hA.js → resume-uZI9p_FE.js} +1 -1
  170. package/dist/chunks/ripgrep-Di-2j8Ws.js +1 -0
  171. package/dist/chunks/{ripgrep-X5m4gJ-3.js → ripgrep-DsLUmulz.js} +1 -1
  172. package/dist/chunks/{runtimeObserver-CxXxUcrm.js → runtimeObserver-AKOWfdZ_.js} +1 -1
  173. package/dist/chunks/{runtimeObserver-Hjbo43xj.js → runtimeObserver-By59MZKJ.js} +2 -2
  174. package/dist/chunks/sandbox-adapter-D4Uho1vF.js +1 -0
  175. package/dist/chunks/sandbox-toggle-BdvylnWS.js +1 -0
  176. package/dist/chunks/searchExtraTools-BHMkqGBf.js +1 -0
  177. package/dist/chunks/{session-CkuTMD_4.js → session-Tm2-rzBY.js} +1 -1
  178. package/dist/chunks/sessionFileAccessHooks-BaWZ8sqn.js +1 -0
  179. package/dist/chunks/{sessionObserver-CvQ6oyoj.js → sessionObserver-BAr8AWeL.js} +1 -1
  180. package/dist/chunks/sessionObserver-KB1UL_n2.js +1 -0
  181. package/dist/chunks/{sessionState-C2REgUrs.js → sessionState-BTFowSpR.js} +2 -2
  182. package/dist/chunks/sessionStorage-D6nlmaI-.js +1 -0
  183. package/dist/chunks/{sessionTitle-2IWcNB8H.js → sessionTitle-SCqmSDYM.js} +1 -1
  184. package/dist/chunks/{sessionTracing-Bm7hQKHA.js → sessionTracing-CvY4udYI.js} +1 -1
  185. package/dist/chunks/settings-BgHApyGL.js +1 -0
  186. package/dist/chunks/{settings-aUygByiZ.js → settings-CvhsRFaT.js} +1 -1
  187. package/dist/chunks/{settingsSync-DgzCU1BZ.js → settingsSync-nxeaGM2-.js} +1 -1
  188. package/dist/chunks/setup-D4FPeBnM.js +3 -0
  189. package/dist/chunks/{shadowedRuleDetection-CWCQ5dZ0.js → shadowedRuleDetection-Co8m1q1D.js} +1 -1
  190. package/dist/chunks/{sideQuestion-BoW-xYkh.js → sideQuestion-4TJYn-Az.js} +1 -1
  191. package/dist/chunks/{sinks-ZHKfs6gv.js → sinks-Bb2i50kz.js} +1 -1
  192. package/dist/chunks/sinks-D1opmy_x.js +1 -0
  193. package/dist/chunks/skillChangeDetector-BU9AFG0i.js +1 -0
  194. package/dist/chunks/{skillGapStore-CCNeSjIb.js → skillGapStore-BcVP3ZUb.js} +2 -2
  195. package/dist/chunks/{skillLifecycle-wU4JDNYQ.js → skillLifecycle-CG2XmS8f.js} +2 -2
  196. package/dist/chunks/{skillSearchPanel-Cxr1QQn4.js → skillSearchPanel-DOJmUBXB.js} +4 -4
  197. package/dist/chunks/{skills-BghnKnNo.js → skills-DIgCWvzX.js} +1 -1
  198. package/dist/chunks/{stats-unp6R0Ah.js → stats-Dq-5qizS.js} +1 -1
  199. package/dist/chunks/status-Ber2xOXc.js +2 -0
  200. package/dist/chunks/status-CVcXPoOZ.js +1 -0
  201. package/dist/chunks/{statusNoticeHelpers-Dm1aiibR.js → statusNoticeHelpers-CYkrPUpN.js} +1 -1
  202. package/dist/chunks/{switcher-BUNSEJ-7.js → switcher-BIP3rbQn.js} +1 -1
  203. package/dist/chunks/switcher-zbG6T9dN.js +1 -0
  204. package/dist/chunks/syncCache-AMQMQ_HR.js +1 -0
  205. package/dist/chunks/{tasks-BjFot03S.js → tasks-BKERIO4G.js} +1 -1
  206. package/dist/chunks/{teleport-Dj2Kvbmx.js → teleport-DOXbf2sQ.js} +1 -1
  207. package/dist/chunks/{templateJobs-CY7GNRo5.js → templateJobs-dg2F45ZJ.js} +1 -1
  208. package/dist/chunks/{terminalSetup-Ty8T8ePM.js → terminalSetup-DDvQ0K5e.js} +1 -1
  209. package/dist/chunks/{terminalSetup-CpMNk6dc.js → terminalSetup-JJiXmszo.js} +1 -1
  210. package/dist/chunks/{theme-c6grxWNn.js → theme-BGxytGjA.js} +1 -1
  211. package/dist/chunks/{toolEventObserver-D7WbjgFR.js → toolEventObserver-CJhg_p3P.js} +1 -1
  212. package/dist/chunks/toolPool-C0d7Bznl.js +1 -0
  213. package/dist/chunks/{trustedDevice-BF78PNK8.js → trustedDevice-BtXHXu-T.js} +1 -1
  214. package/dist/chunks/trustedDevice-hw3iq84W.js +1 -0
  215. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-qLfN0tc-.js → useExitOnCtrlCDWithKeybindings-C9orgrub.js} +1 -1
  216. package/dist/chunks/useMainLoopModel-BigVcn2T.js +1 -0
  217. package/dist/chunks/{useManagePlugins-E0Qzj-ws.js → useManagePlugins-Bt-DYAnX.js} +1 -1
  218. package/dist/chunks/{useMergedTools-B7iYaNwM.js → useMergedTools-CZeQBdky.js} +1 -1
  219. package/dist/chunks/{useSearchInput-CsxiM9i0.js → useSearchInput-DdKrVHJS.js} +1 -1
  220. package/dist/chunks/{useSettingsErrors-DdVTahNa.js → useSettingsErrors-BR9Wws7D.js} +1 -1
  221. package/dist/chunks/{userAgent-BggRZ-ZE.js → userAgent-DUt0q-Vl.js} +1 -1
  222. package/dist/chunks/{util-Xdy1nOjj.js → util-h-Hmdke_.js} +1 -1
  223. package/dist/chunks/validatePlugin-mWVKNtJa.js +1 -0
  224. package/dist/chunks/{vim-cFcxfuac.js → vim-s-wmybpU.js} +1 -1
  225. package/dist/chunks/{workerRegistry-GrD7IAVQ.js → workerRegistry-dlfqtySm.js} +2 -2
  226. package/dist/chunks/worktree-IxcFe7g-.js +1 -0
  227. package/dist/cli.js +1 -1
  228. package/package.json +1 -1
  229. package/dist/chunks/AddWorkspaceDirectory-m2d3nOQJ.js +0 -1
  230. package/dist/chunks/AgentsMdExternalIncludesDialog-BRXGkHO4.js +0 -1
  231. package/dist/chunks/ApproveApiKey-NXTWIAMj.js +0 -1
  232. package/dist/chunks/BypassPermissionsModeDialog-C4QGpcBT.js +0 -1
  233. package/dist/chunks/Doctor-DmiDH-lg.js +0 -1
  234. package/dist/chunks/ExitFlow-DH0L3tyY.js +0 -2
  235. package/dist/chunks/Grove-BhhnrFX9.js +0 -11
  236. package/dist/chunks/MCPConnectionManager-Ciy9y9VV.js +0 -1
  237. package/dist/chunks/MCPToolListView-Ddmu2UcL.js +0 -1
  238. package/dist/chunks/Messages-LD6ZO301.js +0 -10
  239. package/dist/chunks/PromptInputHelpMenu-DyaUsvNx.js +0 -1
  240. package/dist/chunks/QueryEngine-sH-KjJIq.js +0 -1
  241. package/dist/chunks/REPL-BMH_RItw.js +0 -128
  242. package/dist/chunks/REPL-DkPd3vk5.js +0 -1
  243. package/dist/chunks/RemoteSessionManager-DJhrR1dz.js +0 -2
  244. package/dist/chunks/SearchExtraToolsTool-DupzA6Vm.js +0 -1
  245. package/dist/chunks/Settings-B1EI5LOU.js +0 -2
  246. package/dist/chunks/TeleportResumeWrapper-DnHTI39O.js +0 -1
  247. package/dist/chunks/agents-BYQO6DbG.js +0 -101
  248. package/dist/chunks/api-j0iE1mkR.js +0 -1
  249. package/dist/chunks/auth-BYCRa_mb.js +0 -10
  250. package/dist/chunks/auth-C9FUZzpW.js +0 -1
  251. package/dist/chunks/auth-DwPrlTHv.js +0 -1
  252. package/dist/chunks/backgroundHousekeeping-BxcVB3By.js +0 -1
  253. package/dist/chunks/bridgeConfig-Bxs5dqjH.js +0 -1
  254. package/dist/chunks/bridgeStatusUtil-BQF0AJDO.js +0 -1
  255. package/dist/chunks/caches-C9--b9a7.js +0 -1
  256. package/dist/chunks/claudeDesktop-DPIJpc1V.js +0 -1
  257. package/dist/chunks/client-B7WkO81L.js +0 -17
  258. package/dist/chunks/client-BCzhAEd0.js +0 -1
  259. package/dist/chunks/client-Dr9AYB-r.js +0 -1
  260. package/dist/chunks/commands-DTB0Qzd5.js +0 -1
  261. package/dist/chunks/config-B1kYcRIP.js +0 -1
  262. package/dist/chunks/context-noninteractive-Bno2Xsmp.js +0 -1
  263. package/dist/chunks/conversation-hNXWaswI.js +0 -1
  264. package/dist/chunks/createSession-BZx-2UIB.js +0 -1
  265. package/dist/chunks/doctor-aKE2bG5C.js +0 -1
  266. package/dist/chunks/exit-pjN4EJHV.js +0 -1
  267. package/dist/chunks/extraUsage-CwDhpClH.js +0 -1
  268. package/dist/chunks/extractMemories-WmPLOLUT.js +0 -1
  269. package/dist/chunks/fast-BVABmasw.js +0 -1
  270. package/dist/chunks/fast-Cuj3bfFm.js +0 -1
  271. package/dist/chunks/firstPartyEventLogger-CabA8fu0.js +0 -1
  272. package/dist/chunks/grok-BBo3jGfP.js +0 -1
  273. package/dist/chunks/help-CELr6oJZ.js +0 -1
  274. package/dist/chunks/hooks-9rkDD2iw.js +0 -1
  275. package/dist/chunks/initReplBridge-BYrL6ou1.js +0 -1
  276. package/dist/chunks/install-Dn3_M1Ui.js +0 -1
  277. package/dist/chunks/keybindings-B5kUoxvg.js +0 -1
  278. package/dist/chunks/loadAgentsDir-D-a1uUb5.js +0 -1
  279. package/dist/chunks/localSearch-hOERAH9v.js +0 -1
  280. package/dist/chunks/main-C_PDzJdv.js +0 -356
  281. package/dist/chunks/managedEnv-AEhH_HUs.js +0 -1
  282. package/dist/chunks/mcp-B2mJmWKt.js +0 -6
  283. package/dist/chunks/model-BCM7RpVk.js +0 -1
  284. package/dist/chunks/model-BWR43D3c.js +0 -1
  285. package/dist/chunks/model-CmDF8O9G.js +0 -1
  286. package/dist/chunks/modelOptions-DEQat7lU.js +0 -1
  287. package/dist/chunks/pluginStartupCheck-BGN6Je6d.js +0 -1
  288. package/dist/chunks/poorMode-XDBnxTiF.js +0 -1
  289. package/dist/chunks/print-DaJi1wF_.js +0 -14
  290. package/dist/chunks/prompt-B0gADAvI.js +0 -1
  291. package/dist/chunks/prompt-DqyEtC_I2.js +0 -1
  292. package/dist/chunks/ripgrep-DrpZ79Pp.js +0 -1
  293. package/dist/chunks/sandbox-adapter-DQ_fJSIo.js +0 -1
  294. package/dist/chunks/sandbox-toggle-DmNSThQK.js +0 -1
  295. package/dist/chunks/searchExtraTools-C7b2x2p_.js +0 -1
  296. package/dist/chunks/sessionFileAccessHooks-CQvGAbvL.js +0 -1
  297. package/dist/chunks/sessionObserver-BoQY7nOa.js +0 -1
  298. package/dist/chunks/sessionStorage-BeaEgnaa.js +0 -1
  299. package/dist/chunks/settings-Da6ax5aI.js +0 -1
  300. package/dist/chunks/setup-CvaG4nl5.js +0 -3
  301. package/dist/chunks/sinks-B_ehGpvp.js +0 -1
  302. package/dist/chunks/skillChangeDetector-C-HWR_8v.js +0 -1
  303. package/dist/chunks/status-BraYBx4N.js +0 -2
  304. package/dist/chunks/status-DwyWiaVc.js +0 -1
  305. package/dist/chunks/switcher-DDUnWU_4.js +0 -1
  306. package/dist/chunks/syncCache-1s9xV8WV.js +0 -1
  307. package/dist/chunks/toolPool-O5nkEFb1.js +0 -1
  308. package/dist/chunks/trustedDevice-D_z7bAQh.js +0 -1
  309. package/dist/chunks/updateCCB-ts7Joyve.js +0 -5
  310. package/dist/chunks/useMainLoopModel-DkjG_ikT.js +0 -1
  311. package/dist/chunks/validatePlugin-Be5aSSnP.js +0 -1
  312. package/dist/chunks/worktree-V7xiUAtl.js +0 -1
@@ -14,6 +14,6 @@ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,i as n,n as r,r
14
14
  - Takes a task_id parameter identifying the task to stop
15
15
  - Returns a success or failure status
16
16
  - Use this tool when you need to terminate a long-running task
17
- `}));function q(e){return Cs[e]??e}function gs(e){let t=[];for(let[n,r]of Object.entries(Cs))r===e&&t.push(n);return t}function _s(e){return e.replace(/\\/g,`\\\\`).replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)}function vs(e){return e.replace(/\\\(/g,`(`).replace(/\\\)/g,`)`).replace(/\\\\/g,`\\`)}function ys(e){let t=xs(e,`(`);if(t===-1)return{toolName:q(e)};let n=Ss(e,`)`);if(n===-1||n<=t||n!==e.length-1)return{toolName:q(e)};let r=e.substring(0,t),i=e.substring(t+1,n);if(!r)return{toolName:q(e)};if(i===``||i===`*`)return{toolName:q(r)};let a=vs(i);return{toolName:q(r),ruleContent:a}}function bs(e){if(!e.ruleContent)return e.toolName;let t=_s(e.ruleContent);return`${e.toolName}(${t})`}function xs(e,t){for(let n=0;n<e.length;n++)if(e[n]===t){let t=0,r=n-1;for(;r>=0&&e[r]===`\\`;)t++,r--;if(t%2==0)return n}return-1}function Ss(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]===t){let t=0,r=n-1;for(;r>=0&&e[r]===`\\`;)t++,r--;if(t%2==0)return n}return-1}var Cs,ws=e((()=>{us(),fs(),hs(),Cs={Task:os,KillShell:ps,AgentOutputTool:ds,BashOutputTool:ds}}));function Ts(e){return Os.filePatternTools.includes(e)}function Es(e){return Os.bashPrefixTools.includes(e)}function Ds(e){return Os.customValidation[e]}var Os,ks=e((()=>{Os={filePatternTools:[`Read`,`Write`,`Edit`,`Glob`,`NotebookRead`,`NotebookEdit`],bashPrefixTools:[`Bash`],customValidation:{WebSearch:e=>e.includes(`*`)||e.includes(`?`)?{valid:!1,error:`WebSearch does not support wildcards`,suggestion:`Use exact search terms without * or ?`,examples:[`WebSearch(claude ai)`,`WebSearch(typescript tutorial)`]}:{valid:!0},WebFetch:e=>e.includes(`://`)||e.startsWith(`http`)?{valid:!1,error:`WebFetch permissions use domain format, not URLs`,suggestion:`Use "domain:hostname" format`,examples:[`WebFetch(domain:example.com)`,`WebFetch(domain:github.com)`]}:e.startsWith(`domain:`)?{valid:!0}:{valid:!1,error:`WebFetch permissions must use "domain:" prefix`,suggestion:`Use "domain:hostname" format`,examples:[`WebFetch(domain:example.com)`,`WebFetch(domain:*.google.com)`]}}}}));function As(e,t){let n=0,r=t-1;for(;r>=0&&e[r]===`\\`;)n++,r--;return n%2!=0}function js(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&!As(e,r)&&n++;return n}function Ms(e){for(let t=0;t<e.length-1;t++)if(e[t]===`(`&&e[t+1]===`)`&&!As(e,t))return!0;return!1}function Ns(e,t){if(!e||e.trim()===``)return{valid:!1,error:`Permission rule cannot be empty`};if(js(e,`(`)!==js(e,`)`))return{valid:!1,error:`Mismatched parentheses`,suggestion:`Ensure all opening parentheses have matching closing parentheses`};if(Ms(e)){let t=e.substring(0,e.indexOf(`(`));return t?{valid:!1,error:`Empty parentheses`,suggestion:`Either specify a pattern or use just "${t}" without parentheses`,examples:[`${t}`,`${t}(some-pattern)`]}:{valid:!1,error:`Empty parentheses with no tool name`,suggestion:`Specify a tool name before the parentheses`}}let n=ys(e),r=$o(n.toolName);if(r)return n.ruleContent!==void 0||js(e,`(`)>0?{valid:!1,error:`MCP rules do not support patterns in parentheses`,suggestion:`Use "${n.toolName}" without parentheses, or use "mcp__${r.serverName}__*" for all tools`,examples:[`mcp__${r.serverName}`,`mcp__${r.serverName}__*`,r.toolName&&r.toolName!==`*`?`mcp__${r.serverName}__${r.toolName}`:void 0].filter(Boolean)}:{valid:!0};if(!n.toolName||n.toolName.length===0)return{valid:!1,error:`Tool name cannot be empty`};if(n.toolName[0]!==n.toolName[0]?.toUpperCase())return{valid:!1,error:`Tool names must start with uppercase`,suggestion:`Use "${Ut(String(n.toolName))}"`};let i=Ds(n.toolName);if(i&&n.ruleContent!==void 0){let e=i(n.ruleContent);if(!e.valid)return e}if(Es(n.toolName)&&n.ruleContent!==void 0){let e=n.ruleContent;if(e.includes(`:*`)&&!e.endsWith(`:*`))return{valid:!1,error:`The :* pattern must be at the end`,suggestion:`Move :* to the end for prefix matching, or use * for wildcard matching`,examples:[`Bash(npm run:*) - prefix matching (legacy)`,`Bash(npm run *) - wildcard matching`]};if(e===`:*`)return{valid:!1,error:`Prefix cannot be empty before :*`,suggestion:`Specify a command prefix before :*`,examples:[`Bash(npm:*)`,`Bash(git:*)`]}}if(Ts(n.toolName)&&n.ruleContent!==void 0){let e=n.ruleContent;if(e.includes(`:*`))return{valid:!1,error:`The ":*" syntax is only for Bash prefix rules`,suggestion:`Use glob patterns like "*" or "**" for file matching`,examples:[`${n.toolName}(*.ts) - matches .ts files`,`${n.toolName}(src/**) - matches all files in src`,`${n.toolName}(**/*.test.ts) - matches test files`]};if(e.includes(`*`)&&!e.match(/^\*|\*$|\*\*|\/\*|\*\.|\*\)/)&&!e.includes(`**`))return{valid:!1,error:`Wildcard placement might be incorrect`,suggestion:`Wildcards are typically used at path boundaries`,examples:[`${n.toolName}(*.js) - all .js files`,`${n.toolName}(src/*) - all files directly in src`,`${n.toolName}(src/**) - all files recursively in src`]}}return{valid:!0}}var Ps,Fs=e((()=>{T(),as(),E(),ws(),Wt(),ks(),Ps=w(()=>h().superRefine((e,t)=>{let n=Ns(e);if(!n.valid){let r=n.error;n.suggestion&&(r+=`. ${n.suggestion}`),n.examples&&n.examples.length>0&&(r+=`. Examples: ${n.examples.join(`, `)}`),t.addIssue({code:he.custom,message:r,params:{received:e}})}}))}));function Is(e){return`serverName`in e&&e.serverName!==void 0}function Ls(e){return`serverCommand`in e&&e.serverCommand!==void 0}function Rs(e){return`serverUrl`in e&&e.serverUrl!==void 0}var zs,Bs,Vs,Hs,Us,Ws,J,Gs=e((()=>{T(),sa(),ne(),E(),za(),Yo(),Yi(),Fs(),$a(),si(),zs=w(()=>_(h(),me())),Bs=w(()=>C({allow:S(Ps()).optional().describe(`List of permission rules for allowed operations`),deny:S(Ps()).optional().describe(`List of permission rules for denied operations`),ask:S(Ps()).optional().describe(`List of permission rules that should always prompt for confirmation`),defaultMode:b(Ea).optional().describe(`Default permission mode when Work Mate needs access`),disableBypassPermissionsMode:b([`disable`]).optional().describe(`Disable the ability to bypass permission prompts`),disableAutoMode:b([`disable`]).optional().describe(`Disable auto mode`),additionalDirectories:S(h()).optional().describe(`Additional directories to include in the permission scope`)}).passthrough()),Vs=w(()=>C({source:Po().describe(`Where to fetch the marketplace from`),installLocation:h().optional().describe(`Local cache path where marketplace manifest is stored (auto-generated if not provided)`),autoUpdate:x().optional().describe(`Whether to automatically update this marketplace and its installed plugins on startup`)})),Hs=w(()=>C({serverName:h().regex(/^[a-zA-Z0-9_-]+$/,`Server name can only contain letters, numbers, hyphens, and underscores`).optional().describe(`Name of the MCP server that users are allowed to configure`),serverCommand:S(h()).min(1,`Server command must have at least one element (the command)`).optional().describe(`Command array [command, ...args] to match exactly for allowed stdio servers`),serverUrl:h().optional().describe(`URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers`)}).refine(e=>ai([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:`Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"`})),Us=w(()=>C({serverName:h().regex(/^[a-zA-Z0-9_-]+$/,`Server name can only contain letters, numbers, hyphens, and underscores`).optional().describe(`Name of the MCP server that is explicitly blocked`),serverCommand:S(h()).min(1,`Server command must have at least one element (the command)`).optional().describe(`Command array [command, ...args] to match exactly for blocked stdio servers`),serverUrl:h().optional().describe(`URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers`)}).refine(e=>ai([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:`Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"`})),Ws=[`skills`,`agents`,`hooks`,`mcp`],J=w(()=>C({$schema:v(Ji).optional().describe(`JSON Schema reference for Work Mate settings`),apiKeyHelper:h().optional().describe(`Path to a script that outputs authentication values`),awsCredentialExport:h().optional().describe(`Path to a script that exports AWS credentials`),awsAuthRefresh:h().optional().describe(`Path to a script that refreshes AWS authentication`),gcpAuthRefresh:h().optional().describe(`Command to refresh GCP authentication (e.g., gcloud auth application-default login)`),...m(process.env.CLAUDE_CODE_ENABLE_XAA)?{xaaIdp:C({issuer:h().url().describe(`IdP issuer URL for OIDC discovery`),clientId:h().describe(`Work Mate's client_id registered at the IdP`),callbackPort:g().int().positive().optional().describe(`Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.`)}).optional().describe(`XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.`)}:{},fileSuggestion:C({type:v(`command`),command:h()}).optional().describe(`Custom file suggestion configuration for @ mentions`),respectGitignore:x().optional().describe(`Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected.`),cleanupPeriodDays:g().nonnegative().int().optional().describe(`Number of days to retain chat transcripts (default: 30). Setting to 0 disables session persistence entirely: no transcripts are written and existing transcripts are deleted at startup.`),env:zs().optional().describe(`Environment variables to set for Work Mate sessions`),attribution:C({commit:h().optional().describe(`Attribution text for git commits, including any trailers. Empty string hides attribution.`),pr:h().optional().describe(`Attribution text for pull request descriptions. Empty string hides attribution.`)}).optional().describe(`Customize attribution text for commits and PRs. Each field defaults to the standard Work Mate attribution if not set.`),includeCoAuthoredBy:x().optional().describe(`Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)`),includeGitInstructions:x().optional().describe(`Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)`),permissions:Bs().optional().describe(`Tool usage permissions configuration`),modelType:b([`anthropic`,`openai`,`gemini`,`grok`]).optional().describe(`API provider type. "anthropic" uses the first-party API (default), "openai" uses the OpenAI Chat Completions API, "gemini" uses the Gemini API, and "grok" uses the xAI Grok API (OpenAI-compatible). When set to "openai", configure OPENAI_API_KEY, OPENAI_BASE_URL, and OPENAI_MODEL. When set to "gemini", configure GEMINI_API_KEY and optional GEMINI_BASE_URL. When set to "grok", configure GROK_API_KEY (or XAI_API_KEY), optional GROK_BASE_URL, GROK_MODEL, and GROK_MODEL_MAP.`),activeProviderId:h().optional().describe(`Currently active API provider id (set by /provider use <id>). Authoritative source for the active-provider marker in /provider list.`),model:h().optional().describe(`Override the default model used by Work Mate`),availableModels:S(h()).optional().describe(`Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.`),modelOverrides:_(h(),h()).optional().describe(`Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.`),enableAllProjectMcpServers:x().optional().describe(`Whether to automatically approve all MCP servers in the project`),enabledMcpjsonServers:S(h()).optional().describe(`List of approved MCP servers from .mcp.json`),disabledMcpjsonServers:S(h()).optional().describe(`List of rejected MCP servers from .mcp.json`),allowedMcpServers:S(Hs()).optional().describe(`Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied.`),deniedMcpServers:S(Us()).optional().describe(`Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied.`),hooks:H().optional().describe(`Custom commands to run before/after tool executions`),worktree:C({symlinkDirectories:S(h()).optional().describe(`Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"`),sparsePaths:S(h()).optional().describe(`Directories to include when creating worktrees, via git sparse-checkout (cone mode). Dramatically faster in large monorepos — only the listed paths are written to disk.`)}).optional().describe(`Git worktree configuration for --worktree flag.`),disableAllHooks:x().optional().describe(`Disable all hooks and statusLine execution`),defaultShell:b([`bash`,`powershell`]).optional().describe(`Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip).`),allowManagedHooksOnly:x().optional().describe(`When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored.`),allowedHttpHookUrls:S(h()).optional().describe(`Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).`),httpHookAllowedEnvVars:S(h()).optional().describe(`Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers).`),allowManagedPermissionRulesOnly:x().optional().describe(`When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored.`),allowManagedMcpServersOnly:x().optional().describe(`When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies.`),strictPluginOnlyCustomization:ce(e=>Array.isArray(e)?e.filter(e=>Ws.includes(e)):e,y([x(),S(b(Ws))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.workmate/{surface}/, .workmate/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. Composes with strictKnownMarketplaces for end-to-end admin control — plugins gated by marketplace allowlist, everything else blocked here.'),statusLine:C({type:v(`command`),command:h(),padding:g().optional(),refreshInterval:g().optional()}).optional().describe(`Custom status line display configuration`),statusLineEnabled:x().optional().describe(`Whether to render the fork built-in status line (model + ctx + 5h/7d limits + cost + cache pill). Toggled with /statusline.`),enabledPlugins:_(h(),y([S(h()),x(),de()])).optional().describe(`Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints.`),extraKnownMarketplaces:_(h(),Vs()).check(e=>{for(let[t,n]of Object.entries(e.value))n.source.source===`settings`&&n.source.name!==t&&e.issues.push({code:`custom`,input:n.source.name,path:[t,`source`,`name`],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${t}" but source.name "${n.source.name}")`})}).optional().describe(`Additional marketplaces to make available for this repository. Typically used in repository .workmate/settings.json to ensure team members have required plugin sources.`),strictKnownMarketplaces:S(Po()).optional().describe(`Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. Note: this is a policy gate only — it does NOT register marketplaces. To pre-register allowed marketplaces for users, also set extraKnownMarketplaces.`),blockedMarketplaces:S(Po()).optional().describe(`Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem.`),forceLoginMethod:b([`claudeai`,`console`]).optional().describe(`Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing`),forceLoginOrgUUID:h().optional().describe(`Organization UUID to use for OAuth login`),otelHeadersHelper:h().optional().describe(`Path to a script that outputs OpenTelemetry headers`),outputStyle:h().optional().describe(`Controls the output style for assistant responses`),language:h().optional().describe(`Preferred language for Claude responses (e.g., "japanese", "spanish")`),skipWebFetchPreflight:x().optional().describe(`Skip the WebFetch blocklist check for enterprise environments with restrictive security policies`),webSearchAdapter:b([`api`,`bing`,`brave`,`exa`,`tavily`]).optional().describe(`Web search backend adapter. "tavily" uses Tavily Search API (default), "api" uses Anthropic server-side search, "bing" scrapes Bing HTML, "brave" uses Brave Search API, "exa" uses Exa AI.`),webFetchAdapter:b([`tavily`,`http`]).optional().describe(`Web fetch backend. "tavily" uses Tavily Extract API which returns Markdown directly (default), "http" fetches the URL directly via HTTP.`),tavilyEndpointUrl:h().optional().describe(`Custom Tavily API endpoint URL. Defaults to https://tavily.readmagic.workmate.win. Used by both WebSearch and WebFetch when tavily adapter is selected.`),braveApiKey:h().optional().describe(`Brave Search API key. Required when using the brave web search adapter.`),webFetchHttpTimeoutMs:g().int().positive().optional().describe(`HTTP timeout in milliseconds for the HTTP direct web fetch backend. Defaults to 60000 (60s).`),exaApiKey:h().optional().describe(`Exa AI API key. Required when using the exa web search adapter.`),exaEndpointUrl:h().optional().describe(`Custom Exa AI MCP endpoint URL. Defaults to https://mcp.exa.ai/mcp.`),sandbox:oa().optional(),feedbackSurveyRate:g().min(0).max(1).optional().describe(`Probability (0–1) that the session quality survey appears when eligible. 0.05 is a reasonable starting point.`),spinnerTipsEnabled:x().optional().describe(`Whether to show tips in the spinner`),spinnerVerbs:C({mode:b([`append`,`replace`]),verbs:S(h())}).optional().describe(`Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.`),spinnerTipsOverride:C({excludeDefault:x().optional(),tips:S(h())}).optional().describe(`Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false).`),syntaxHighlightingDisabled:x().optional().describe(`Whether to disable syntax highlighting in diffs`),terminalTitleFromRename:x().optional().describe(`Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles.`),alwaysThinkingEnabled:x().optional().describe(`When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models.`),advisorModel:h().optional().describe(`Advisor model for the server-side advisor tool.`),fastMode:x().optional().describe(`When true, fast mode is enabled. When absent or false, fast mode is off.`),fastModePerSessionOptIn:x().optional().describe(`When true, fast mode does not persist across sessions. Each session starts with fast mode off.`),promptSuggestionEnabled:x().optional().describe(`When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled.`),poorMode:x().optional().describe(`When true, poor mode is active — extract_memories and prompt_suggestion are disabled to save tokens.`),showClearContextOnPlanAccept:x().optional().describe(`When true, the plan-approval dialog offers a "clear context" option. Defaults to false.`),agent:h().optional().describe(`Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model.`),companyAnnouncements:S(h()).optional().describe(`Company announcements to display at startup (one will be randomly selected if multiple are provided)`),pluginConfigs:_(h(),C({mcpServers:_(h(),_(h(),y([h(),g(),x(),S(h())]))).optional().describe(`User configuration values for MCP servers keyed by server name`),options:_(h(),y([h(),g(),x(),S(h())])).optional().describe(`Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.`)})).optional().describe(`Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)`),remote:C({defaultEnvironmentId:h().optional().describe(`Default environment ID to use for remote sessions`)}).optional().describe(`Remote session configuration`),autoUpdatesChannel:b([`latest`,`stable`]).optional().describe(`Release channel for auto-updates (latest or stable)`),disableDeepLinkRegistration:b([`disable`]).optional().describe(`Prevent claude-cli:// protocol handler registration with the OS`),minimumVersion:h().optional().describe(`Minimum version to stay on - prevents downgrades when switching to stable channel`),plansDirectory:h().optional().describe(`Custom directory for plan files, relative to project root. If not set, defaults to ~/.workmate/plans/`),minSleepDurationMs:g().nonnegative().int().optional().describe(`Minimum duration in milliseconds that the Sleep tool must sleep for. Useful for throttling proactive tick frequency.`),maxSleepDurationMs:g().int().min(-1).optional().describe(`Maximum duration in milliseconds that the Sleep tool can sleep for. Set to -1 for indefinite sleep (waits for user input). Useful for limiting idle time in remote/managed environments.`),channelsEnabled:x().optional().describe(`Teams/Enterprise opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). Default off. Set true to allow; users then select servers via --channels.`),allowedChannelPlugins:S(C({marketplace:h(),plugin:h()})).optional().describe(`Teams/Enterprise allowlist of channel plugins. When set, replaces the default allowlist — admins decide which plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true.`),prefersReducedMotion:x().optional().describe(`Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)`),autoMemoryEnabled:x().optional().describe(`Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory.`),autoMemoryDirectory:h().optional().describe(`Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .workmate/settings.json) for security. When unset, defaults to ~/.workmate/projects/<sanitized-cwd>/memory/.`),autoDreamEnabled:x().optional().describe(`Enable background memory consolidation (auto-dream). When set, overrides the server-side default.`),showThinkingSummaries:x().optional().describe(`Show thinking summaries in the transcript view (ctrl+o). Default: false.`),skipDangerousModePermissionPrompt:x().optional().describe(`Whether the user has accepted the bypass permissions mode dialog`),skipAutoPermissionPrompt:x().optional().describe(`Whether the user has accepted the auto mode opt-in dialog`),useAutoModeDuringPlan:x().optional().describe(`Whether plan mode uses auto mode semantics when auto mode is available (default: true)`),autoMode:C({allow:S(h()).optional().describe(`Rules for the auto mode classifier allow section`),soft_deny:S(h()).optional().describe(`Rules for the auto mode classifier deny section`),environment:S(h()).optional().describe(`Entries for the auto mode classifier environment section`)}).optional().describe(`Auto mode classifier prompt customization`),disableAutoMode:b([`disable`]).optional().describe(`Disable auto mode`),sshConfigs:S(C({id:h().describe(`Unique identifier for this SSH config. Used to match configs across settings sources.`),name:h().describe(`Display name for the SSH connection`),sshHost:h().describe(`SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config`),sshPort:g().int().optional().describe(`SSH port (default: 22)`),sshIdentityFile:h().optional().describe(`Path to SSH identity file (private key)`),startDirectory:h().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh <config> [dir]`.")})).optional().describe(`SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members.`),agentsMdExcludes:S(h()).optional().describe(`Glob patterns or absolute paths of AGENTS.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/AGENTS.md", "**/code/AGENTS.md", "**/some-dir/.workmate/rules/**"`),cacheThreshold:g().int().min(0).max(100).optional().describe(`Prompt cache hit rate threshold (0-100). Warnings shown when cache hit rate falls below this percentage. Default: 80.`),cacheWarningEnabled:x().optional().describe(`Whether to show cache hit rate warnings in the message flow when the rate falls below cacheThreshold. Default: true.`),pluginTrustMessage:h().optional().describe(`Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").`),workspaceApiKey:h().optional().describe(`Workspace API key (sk-ant-api03-*) saved via /login UI. Stored in plaintext — keep this file gitignored and restrict its permissions. ANTHROPIC_API_KEY environment variable takes precedence when both are set.`)}).passthrough())}));function Ks(){return ot(se(J(),{unrepresentable:`any`}),null,2)}var qs=e((()=>{T(),mt(),Gs()}));function Js(e){let t=Ys.find(t=>t.matches(e));if(!t)return null;let n={...t.tip};if(e.code===`invalid_value`&&e.enumValues&&!n.suggestion&&(n.suggestion=`Valid values: ${e.enumValues.map(e=>`"${e}"`).join(`, `)}`),!n.docLink&&e.path){let t=e.path.split(`.`)[0];t&&(n.docLink=Xs[t])}return n}var Y,Ys,Xs,Zs=e((()=>{Y=`https://code.workmate.com/docs/en`,Ys=[{matches:e=>e.path===`permissions.defaultMode`&&e.code===`invalid_value`,tip:{suggestion:`Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)`,docLink:`${Y}/iam#permission-modes`}},{matches:e=>e.path===`apiKeyHelper`&&e.code===`invalid_type`,tip:{suggestion:`Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"`}},{matches:e=>e.path===`cleanupPeriodDays`&&e.code===`too_small`&&e.expected===`0`,tip:{suggestion:`Must be 0 or greater. Set a positive number for days to retain transcripts (default is 30). Setting 0 disables session persistence entirely: no transcripts are written and existing transcripts are deleted at startup.`}},{matches:e=>e.path.startsWith(`env.`)&&e.code===`invalid_type`,tip:{suggestion:`Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"`,docLink:`${Y}/settings#environment-variables`}},{matches:e=>(e.path===`permissions.allow`||e.path===`permissions.deny`)&&e.code===`invalid_type`&&e.expected===`array`,tip:{suggestion:`Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.`}},{matches:e=>e.path.includes(`hooks`)&&e.code===`invalid_type`,tip:{suggestion:`Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}`}},{matches:e=>e.code===`invalid_type`&&e.expected===`boolean`,tip:{suggestion:`Use true or false without quotes. Example: "includeCoAuthoredBy": true`}},{matches:e=>e.code===`unrecognized_keys`,tip:{suggestion:`Check for typos or refer to the documentation for valid fields`,docLink:`${Y}/settings`}},{matches:e=>e.code===`invalid_value`&&e.enumValues!==void 0,tip:{suggestion:void 0}},{matches:e=>e.code===`invalid_type`&&e.expected===`object`&&e.received===null&&e.path===``,tip:{suggestion:`Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error.`}},{matches:e=>e.path===`permissions.additionalDirectories`&&e.code===`invalid_type`,tip:{suggestion:`Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command`,docLink:`${Y}/iam#working-directories`}}],Xs={permissions:`${Y}/iam#configuring-permissions`,env:`${Y}/settings#environment-variables`,hooks:`${Y}/hooks`}}));function Qs(e){return e.code===`invalid_type`}function $s(e){return e.code===`invalid_value`}function ec(e){return e.code===`unrecognized_keys`}function tc(e){return e.code===`too_small`}function nc(e){return e===null?`null`:e===void 0?`undefined`:Array.isArray(e)?`array`:typeof e}function rc(e){let t=e.match(/received (\w+)/);return t?t[1]:void 0}function ic(e,t){return e.issues.map(e=>{let n=e.path.map(String).join(`.`),r=e.message,i,a,o,s,c;if($s(e))a=e.values.map(e=>String(e)),o=a.join(` | `),s=void 0,c=void 0;else if(Qs(e)){o=e.expected;let t=rc(e.message);s=t??nc(e.input),c=t??nc(e.input)}else tc(e)?o=String(e.minimum):e.code===`custom`&&`params`in e&&(s=e.params.received,c=s);let ee=Js({path:n,code:e.code,expected:o,received:s,enumValues:a,message:e.message,value:s});if($s(e))i=a?.map(e=>`"${e}"`).join(`, `),r=`Invalid value. Expected one of: ${i}`;else if(Qs(e)){let t=rc(e.message)??nc(e.input);r=e.expected===`object`&&t===`null`&&n===``?`Invalid or malformed JSON`:`Expected ${e.expected}, but received ${t}`}else if(ec(e)){let t=e.keys.join(`, `);r=`Unrecognized ${Ht(e.keys.length,`field`)}: ${t}`}else tc(e)&&(r=`Number must be greater than or equal to ${e.minimum}`,i=String(e.minimum));return{file:t,path:n,message:r,expected:i,invalidValue:c,suggestion:ee?.suggestion,docLink:ee?.docLink}})}function ac(e){try{let t=lt(e),n=J().strict().safeParse(t);return n.success?{isValid:!0}:{isValid:!1,error:`Settings validation failed:
17
+ `}));function q(e){return Cs[e]??e}function gs(e){let t=[];for(let[n,r]of Object.entries(Cs))r===e&&t.push(n);return t}function _s(e){return e.replace(/\\/g,`\\\\`).replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)}function vs(e){return e.replace(/\\\(/g,`(`).replace(/\\\)/g,`)`).replace(/\\\\/g,`\\`)}function ys(e){let t=xs(e,`(`);if(t===-1)return{toolName:q(e)};let n=Ss(e,`)`);if(n===-1||n<=t||n!==e.length-1)return{toolName:q(e)};let r=e.substring(0,t),i=e.substring(t+1,n);if(!r)return{toolName:q(e)};if(i===``||i===`*`)return{toolName:q(r)};let a=vs(i);return{toolName:q(r),ruleContent:a}}function bs(e){if(!e.ruleContent)return e.toolName;let t=_s(e.ruleContent);return`${e.toolName}(${t})`}function xs(e,t){for(let n=0;n<e.length;n++)if(e[n]===t){let t=0,r=n-1;for(;r>=0&&e[r]===`\\`;)t++,r--;if(t%2==0)return n}return-1}function Ss(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]===t){let t=0,r=n-1;for(;r>=0&&e[r]===`\\`;)t++,r--;if(t%2==0)return n}return-1}var Cs,ws=e((()=>{us(),fs(),hs(),Cs={Task:os,KillShell:ps,AgentOutputTool:ds,BashOutputTool:ds}}));function Ts(e){return Os.filePatternTools.includes(e)}function Es(e){return Os.bashPrefixTools.includes(e)}function Ds(e){return Os.customValidation[e]}var Os,ks=e((()=>{Os={filePatternTools:[`Read`,`Write`,`Edit`,`Glob`,`NotebookRead`,`NotebookEdit`],bashPrefixTools:[`Bash`],customValidation:{WebSearch:e=>e.includes(`*`)||e.includes(`?`)?{valid:!1,error:`WebSearch does not support wildcards`,suggestion:`Use exact search terms without * or ?`,examples:[`WebSearch(claude ai)`,`WebSearch(typescript tutorial)`]}:{valid:!0},WebFetch:e=>e.includes(`://`)||e.startsWith(`http`)?{valid:!1,error:`WebFetch permissions use domain format, not URLs`,suggestion:`Use "domain:hostname" format`,examples:[`WebFetch(domain:example.com)`,`WebFetch(domain:github.com)`]}:e.startsWith(`domain:`)?{valid:!0}:{valid:!1,error:`WebFetch permissions must use "domain:" prefix`,suggestion:`Use "domain:hostname" format`,examples:[`WebFetch(domain:example.com)`,`WebFetch(domain:*.google.com)`]}}}}));function As(e,t){let n=0,r=t-1;for(;r>=0&&e[r]===`\\`;)n++,r--;return n%2!=0}function js(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&!As(e,r)&&n++;return n}function Ms(e){for(let t=0;t<e.length-1;t++)if(e[t]===`(`&&e[t+1]===`)`&&!As(e,t))return!0;return!1}function Ns(e,t){if(!e||e.trim()===``)return{valid:!1,error:`Permission rule cannot be empty`};if(js(e,`(`)!==js(e,`)`))return{valid:!1,error:`Mismatched parentheses`,suggestion:`Ensure all opening parentheses have matching closing parentheses`};if(Ms(e)){let t=e.substring(0,e.indexOf(`(`));return t?{valid:!1,error:`Empty parentheses`,suggestion:`Either specify a pattern or use just "${t}" without parentheses`,examples:[`${t}`,`${t}(some-pattern)`]}:{valid:!1,error:`Empty parentheses with no tool name`,suggestion:`Specify a tool name before the parentheses`}}let n=ys(e),r=$o(n.toolName);if(r)return n.ruleContent!==void 0||js(e,`(`)>0?{valid:!1,error:`MCP rules do not support patterns in parentheses`,suggestion:`Use "${n.toolName}" without parentheses, or use "mcp__${r.serverName}__*" for all tools`,examples:[`mcp__${r.serverName}`,`mcp__${r.serverName}__*`,r.toolName&&r.toolName!==`*`?`mcp__${r.serverName}__${r.toolName}`:void 0].filter(Boolean)}:{valid:!0};if(!n.toolName||n.toolName.length===0)return{valid:!1,error:`Tool name cannot be empty`};if(n.toolName[0]!==n.toolName[0]?.toUpperCase())return{valid:!1,error:`Tool names must start with uppercase`,suggestion:`Use "${Ut(String(n.toolName))}"`};let i=Ds(n.toolName);if(i&&n.ruleContent!==void 0){let e=i(n.ruleContent);if(!e.valid)return e}if(Es(n.toolName)&&n.ruleContent!==void 0){let e=n.ruleContent;if(e.includes(`:*`)&&!e.endsWith(`:*`))return{valid:!1,error:`The :* pattern must be at the end`,suggestion:`Move :* to the end for prefix matching, or use * for wildcard matching`,examples:[`Bash(npm run:*) - prefix matching (legacy)`,`Bash(npm run *) - wildcard matching`]};if(e===`:*`)return{valid:!1,error:`Prefix cannot be empty before :*`,suggestion:`Specify a command prefix before :*`,examples:[`Bash(npm:*)`,`Bash(git:*)`]}}if(Ts(n.toolName)&&n.ruleContent!==void 0){let e=n.ruleContent;if(e.includes(`:*`))return{valid:!1,error:`The ":*" syntax is only for Bash prefix rules`,suggestion:`Use glob patterns like "*" or "**" for file matching`,examples:[`${n.toolName}(*.ts) - matches .ts files`,`${n.toolName}(src/**) - matches all files in src`,`${n.toolName}(**/*.test.ts) - matches test files`]};if(e.includes(`*`)&&!e.match(/^\*|\*$|\*\*|\/\*|\*\.|\*\)/)&&!e.includes(`**`))return{valid:!1,error:`Wildcard placement might be incorrect`,suggestion:`Wildcards are typically used at path boundaries`,examples:[`${n.toolName}(*.js) - all .js files`,`${n.toolName}(src/*) - all files directly in src`,`${n.toolName}(src/**) - all files recursively in src`]}}return{valid:!0}}var Ps,Fs=e((()=>{T(),as(),E(),ws(),Wt(),ks(),Ps=w(()=>h().superRefine((e,t)=>{let n=Ns(e);if(!n.valid){let r=n.error;n.suggestion&&(r+=`. ${n.suggestion}`),n.examples&&n.examples.length>0&&(r+=`. Examples: ${n.examples.join(`, `)}`),t.addIssue({code:he.custom,message:r,params:{received:e}})}}))}));function Is(e){return`serverName`in e&&e.serverName!==void 0}function Ls(e){return`serverCommand`in e&&e.serverCommand!==void 0}function Rs(e){return`serverUrl`in e&&e.serverUrl!==void 0}var zs,Bs,Vs,Hs,Us,Ws,J,Gs=e((()=>{T(),sa(),ne(),E(),za(),Yo(),Yi(),Fs(),$a(),si(),zs=w(()=>_(h(),me())),Bs=w(()=>C({allow:S(Ps()).optional().describe(`List of permission rules for allowed operations`),deny:S(Ps()).optional().describe(`List of permission rules for denied operations`),ask:S(Ps()).optional().describe(`List of permission rules that should always prompt for confirmation`),defaultMode:b(Ea).optional().describe(`Default permission mode when Work Mate needs access`),disableBypassPermissionsMode:b([`disable`]).optional().describe(`Disable the ability to bypass permission prompts`),disableAutoMode:b([`disable`]).optional().describe(`Disable auto mode`),additionalDirectories:S(h()).optional().describe(`Additional directories to include in the permission scope`)}).passthrough()),Vs=w(()=>C({source:Po().describe(`Where to fetch the marketplace from`),installLocation:h().optional().describe(`Local cache path where marketplace manifest is stored (auto-generated if not provided)`),autoUpdate:x().optional().describe(`Whether to automatically update this marketplace and its installed plugins on startup`)})),Hs=w(()=>C({serverName:h().regex(/^[a-zA-Z0-9_-]+$/,`Server name can only contain letters, numbers, hyphens, and underscores`).optional().describe(`Name of the MCP server that users are allowed to configure`),serverCommand:S(h()).min(1,`Server command must have at least one element (the command)`).optional().describe(`Command array [command, ...args] to match exactly for allowed stdio servers`),serverUrl:h().optional().describe(`URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers`)}).refine(e=>ai([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:`Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"`})),Us=w(()=>C({serverName:h().regex(/^[a-zA-Z0-9_-]+$/,`Server name can only contain letters, numbers, hyphens, and underscores`).optional().describe(`Name of the MCP server that is explicitly blocked`),serverCommand:S(h()).min(1,`Server command must have at least one element (the command)`).optional().describe(`Command array [command, ...args] to match exactly for blocked stdio servers`),serverUrl:h().optional().describe(`URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers`)}).refine(e=>ai([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:`Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"`})),Ws=[`skills`,`agents`,`hooks`,`mcp`],J=w(()=>C({$schema:v(Ji).optional().describe(`JSON Schema reference for Work Mate settings`),apiKeyHelper:h().optional().describe(`Path to a script that outputs authentication values`),awsCredentialExport:h().optional().describe(`Path to a script that exports AWS credentials`),awsAuthRefresh:h().optional().describe(`Path to a script that refreshes AWS authentication`),gcpAuthRefresh:h().optional().describe(`Command to refresh GCP authentication (e.g., gcloud auth application-default login)`),...m(process.env.CLAUDE_CODE_ENABLE_XAA)?{xaaIdp:C({issuer:h().url().describe(`IdP issuer URL for OIDC discovery`),clientId:h().describe(`Work Mate's client_id registered at the IdP`),callbackPort:g().int().positive().optional().describe(`Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.`)}).optional().describe(`XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.`)}:{},fileSuggestion:C({type:v(`command`),command:h()}).optional().describe(`Custom file suggestion configuration for @ mentions`),respectGitignore:x().optional().describe(`Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected.`),cleanupPeriodDays:g().nonnegative().int().optional().describe(`Number of days to retain chat transcripts (default: 30). Setting to 0 disables session persistence entirely: no transcripts are written and existing transcripts are deleted at startup.`),env:zs().optional().describe(`Environment variables to set for Work Mate sessions`),attribution:C({commit:h().optional().describe(`Attribution text for git commits, including any trailers. Empty string hides attribution.`),pr:h().optional().describe(`Attribution text for pull request descriptions. Empty string hides attribution.`)}).optional().describe(`Customize attribution text for commits and PRs. Each field defaults to the standard Work Mate attribution if not set.`),includeCoAuthoredBy:x().optional().describe(`Deprecated: Use attribution instead. Whether to include Work Mate's co-authored by attribution in commits and PRs (defaults to true)`),includeGitInstructions:x().optional().describe(`Include built-in commit and PR workflow instructions in Work Mate's system prompt (default: true)`),permissions:Bs().optional().describe(`Tool usage permissions configuration`),modelType:b([`anthropic`,`openai`,`gemini`,`grok`]).optional().describe(`API provider type. "anthropic" uses the first-party API (default), "openai" uses the OpenAI Chat Completions API, "gemini" uses the Gemini API, and "grok" uses the xAI Grok API (OpenAI-compatible). When set to "openai", configure OPENAI_API_KEY, OPENAI_BASE_URL, and OPENAI_MODEL. When set to "gemini", configure GEMINI_API_KEY and optional GEMINI_BASE_URL. When set to "grok", configure GROK_API_KEY (or XAI_API_KEY), optional GROK_BASE_URL, GROK_MODEL, and GROK_MODEL_MAP.`),activeProviderId:h().optional().describe(`Currently active API provider id (set by /provider use <id>). Authoritative source for the active-provider marker in /provider list.`),model:h().optional().describe(`Override the default model used by Work Mate`),availableModels:S(h()).optional().describe(`Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.`),modelOverrides:_(h(),h()).optional().describe(`Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.`),enableAllProjectMcpServers:x().optional().describe(`Whether to automatically approve all MCP servers in the project`),enabledMcpjsonServers:S(h()).optional().describe(`List of approved MCP servers from .mcp.json`),disabledMcpjsonServers:S(h()).optional().describe(`List of rejected MCP servers from .mcp.json`),allowedMcpServers:S(Hs()).optional().describe(`Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied.`),deniedMcpServers:S(Us()).optional().describe(`Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied.`),hooks:H().optional().describe(`Custom commands to run before/after tool executions`),worktree:C({symlinkDirectories:S(h()).optional().describe(`Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"`),sparsePaths:S(h()).optional().describe(`Directories to include when creating worktrees, via git sparse-checkout (cone mode). Dramatically faster in large monorepos — only the listed paths are written to disk.`)}).optional().describe(`Git worktree configuration for --worktree flag.`),disableAllHooks:x().optional().describe(`Disable all hooks and statusLine execution`),defaultShell:b([`bash`,`powershell`]).optional().describe(`Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip).`),allowManagedHooksOnly:x().optional().describe(`When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored.`),allowedHttpHookUrls:S(h()).optional().describe(`Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).`),httpHookAllowedEnvVars:S(h()).optional().describe(`Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers).`),allowManagedPermissionRulesOnly:x().optional().describe(`When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored.`),allowManagedMcpServersOnly:x().optional().describe(`When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies.`),strictPluginOnlyCustomization:ce(e=>Array.isArray(e)?e.filter(e=>Ws.includes(e)):e,y([x(),S(b(Ws))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.workmate/{surface}/, .workmate/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. Composes with strictKnownMarketplaces for end-to-end admin control — plugins gated by marketplace allowlist, everything else blocked here.'),statusLine:C({type:v(`command`),command:h(),padding:g().optional(),refreshInterval:g().optional()}).optional().describe(`Custom status line display configuration`),statusLineEnabled:x().optional().describe(`Whether to render the fork built-in status line (model + ctx + 5h/7d limits + cost + cache pill). Toggled with /statusline.`),enabledPlugins:_(h(),y([S(h()),x(),de()])).optional().describe(`Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints.`),extraKnownMarketplaces:_(h(),Vs()).check(e=>{for(let[t,n]of Object.entries(e.value))n.source.source===`settings`&&n.source.name!==t&&e.issues.push({code:`custom`,input:n.source.name,path:[t,`source`,`name`],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${t}" but source.name "${n.source.name}")`})}).optional().describe(`Additional marketplaces to make available for this repository. Typically used in repository .workmate/settings.json to ensure team members have required plugin sources.`),strictKnownMarketplaces:S(Po()).optional().describe(`Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. Note: this is a policy gate only — it does NOT register marketplaces. To pre-register allowed marketplaces for users, also set extraKnownMarketplaces.`),blockedMarketplaces:S(Po()).optional().describe(`Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem.`),forceLoginMethod:b([`claudeai`,`console`]).optional().describe(`Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing`),forceLoginOrgUUID:h().optional().describe(`Organization UUID to use for OAuth login`),otelHeadersHelper:h().optional().describe(`Path to a script that outputs OpenTelemetry headers`),outputStyle:h().optional().describe(`Controls the output style for assistant responses`),language:h().optional().describe(`Preferred language for Work Mate responses (e.g., "japanese", "spanish")`),skipWebFetchPreflight:x().optional().describe(`Skip the WebFetch blocklist check for enterprise environments with restrictive security policies`),webSearchAdapter:b([`api`,`bing`,`brave`,`exa`,`tavily`]).optional().describe(`Web search backend adapter. "tavily" uses Tavily Search API (default), "api" uses Anthropic server-side search, "bing" scrapes Bing HTML, "brave" uses Brave Search API, "exa" uses Exa AI.`),webFetchAdapter:b([`tavily`,`http`]).optional().describe(`Web fetch backend. "tavily" uses Tavily Extract API which returns Markdown directly (default), "http" fetches the URL directly via HTTP.`),tavilyEndpointUrl:h().optional().describe(`Custom Tavily API endpoint URL. Defaults to https://tavily.readmagic.workmate.win. Used by both WebSearch and WebFetch when tavily adapter is selected.`),braveApiKey:h().optional().describe(`Brave Search API key. Required when using the brave web search adapter.`),webFetchHttpTimeoutMs:g().int().positive().optional().describe(`HTTP timeout in milliseconds for the HTTP direct web fetch backend. Defaults to 60000 (60s).`),exaApiKey:h().optional().describe(`Exa AI API key. Required when using the exa web search adapter.`),exaEndpointUrl:h().optional().describe(`Custom Exa AI MCP endpoint URL. Defaults to https://mcp.exa.ai/mcp.`),sandbox:oa().optional(),feedbackSurveyRate:g().min(0).max(1).optional().describe(`Probability (0–1) that the session quality survey appears when eligible. 0.05 is a reasonable starting point.`),spinnerTipsEnabled:x().optional().describe(`Whether to show tips in the spinner`),spinnerVerbs:C({mode:b([`append`,`replace`]),verbs:S(h())}).optional().describe(`Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.`),spinnerTipsOverride:C({excludeDefault:x().optional(),tips:S(h())}).optional().describe(`Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false).`),syntaxHighlightingDisabled:x().optional().describe(`Whether to disable syntax highlighting in diffs`),terminalTitleFromRename:x().optional().describe(`Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles.`),alwaysThinkingEnabled:x().optional().describe(`When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models.`),advisorModel:h().optional().describe(`Advisor model for the server-side advisor tool.`),fastMode:x().optional().describe(`When true, fast mode is enabled. When absent or false, fast mode is off.`),fastModePerSessionOptIn:x().optional().describe(`When true, fast mode does not persist across sessions. Each session starts with fast mode off.`),promptSuggestionEnabled:x().optional().describe(`When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled.`),poorMode:x().optional().describe(`When true, poor mode is active — extract_memories and prompt_suggestion are disabled to save tokens.`),showClearContextOnPlanAccept:x().optional().describe(`When true, the plan-approval dialog offers a "clear context" option. Defaults to false.`),agent:h().optional().describe(`Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model.`),companyAnnouncements:S(h()).optional().describe(`Company announcements to display at startup (one will be randomly selected if multiple are provided)`),pluginConfigs:_(h(),C({mcpServers:_(h(),_(h(),y([h(),g(),x(),S(h())]))).optional().describe(`User configuration values for MCP servers keyed by server name`),options:_(h(),y([h(),g(),x(),S(h())])).optional().describe(`Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.`)})).optional().describe(`Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)`),remote:C({defaultEnvironmentId:h().optional().describe(`Default environment ID to use for remote sessions`)}).optional().describe(`Remote session configuration`),autoUpdatesChannel:b([`latest`,`stable`]).optional().describe(`Release channel for auto-updates (latest or stable)`),disableDeepLinkRegistration:b([`disable`]).optional().describe(`Prevent claude-cli:// protocol handler registration with the OS`),minimumVersion:h().optional().describe(`Minimum version to stay on - prevents downgrades when switching to stable channel`),plansDirectory:h().optional().describe(`Custom directory for plan files, relative to project root. If not set, defaults to ~/.workmate/plans/`),minSleepDurationMs:g().nonnegative().int().optional().describe(`Minimum duration in milliseconds that the Sleep tool must sleep for. Useful for throttling proactive tick frequency.`),maxSleepDurationMs:g().int().min(-1).optional().describe(`Maximum duration in milliseconds that the Sleep tool can sleep for. Set to -1 for indefinite sleep (waits for user input). Useful for limiting idle time in remote/managed environments.`),channelsEnabled:x().optional().describe(`Teams/Enterprise opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). Default off. Set true to allow; users then select servers via --channels.`),allowedChannelPlugins:S(C({marketplace:h(),plugin:h()})).optional().describe(`Teams/Enterprise allowlist of channel plugins. When set, replaces the default allowlist — admins decide which plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true.`),prefersReducedMotion:x().optional().describe(`Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)`),autoMemoryEnabled:x().optional().describe(`Enable auto-memory for this project. When false, Work Mate will not read from or write to the auto-memory directory.`),autoMemoryDirectory:h().optional().describe(`Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .workmate/settings.json) for security. When unset, defaults to ~/.workmate/projects/<sanitized-cwd>/memory/.`),autoDreamEnabled:x().optional().describe(`Enable background memory consolidation (auto-dream). When set, overrides the server-side default.`),showThinkingSummaries:x().optional().describe(`Show thinking summaries in the transcript view (ctrl+o). Default: false.`),skipDangerousModePermissionPrompt:x().optional().describe(`Whether the user has accepted the bypass permissions mode dialog`),skipAutoPermissionPrompt:x().optional().describe(`Whether the user has accepted the auto mode opt-in dialog`),useAutoModeDuringPlan:x().optional().describe(`Whether plan mode uses auto mode semantics when auto mode is available (default: true)`),autoMode:C({allow:S(h()).optional().describe(`Rules for the auto mode classifier allow section`),soft_deny:S(h()).optional().describe(`Rules for the auto mode classifier deny section`),environment:S(h()).optional().describe(`Entries for the auto mode classifier environment section`)}).optional().describe(`Auto mode classifier prompt customization`),disableAutoMode:b([`disable`]).optional().describe(`Disable auto mode`),sshConfigs:S(C({id:h().describe(`Unique identifier for this SSH config. Used to match configs across settings sources.`),name:h().describe(`Display name for the SSH connection`),sshHost:h().describe(`SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config`),sshPort:g().int().optional().describe(`SSH port (default: 22)`),sshIdentityFile:h().optional().describe(`Path to SSH identity file (private key)`),startDirectory:h().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh <config> [dir]`.")})).optional().describe(`SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members.`),agentsMdExcludes:S(h()).optional().describe(`Glob patterns or absolute paths of AGENTS.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/AGENTS.md", "**/code/AGENTS.md", "**/some-dir/.workmate/rules/**"`),cacheThreshold:g().int().min(0).max(100).optional().describe(`Prompt cache hit rate threshold (0-100). Warnings shown when cache hit rate falls below this percentage. Default: 80.`),cacheWarningEnabled:x().optional().describe(`Whether to show cache hit rate warnings in the message flow when the rate falls below cacheThreshold. Default: true.`),pluginTrustMessage:h().optional().describe(`Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").`),workspaceApiKey:h().optional().describe(`Workspace API key (sk-ant-api03-*) saved via /login UI. Stored in plaintext — keep this file gitignored and restrict its permissions. ANTHROPIC_API_KEY environment variable takes precedence when both are set.`)}).passthrough())}));function Ks(){return ot(se(J(),{unrepresentable:`any`}),null,2)}var qs=e((()=>{T(),mt(),Gs()}));function Js(e){let t=Ys.find(t=>t.matches(e));if(!t)return null;let n={...t.tip};if(e.code===`invalid_value`&&e.enumValues&&!n.suggestion&&(n.suggestion=`Valid values: ${e.enumValues.map(e=>`"${e}"`).join(`, `)}`),!n.docLink&&e.path){let t=e.path.split(`.`)[0];t&&(n.docLink=Xs[t])}return n}var Y,Ys,Xs,Zs=e((()=>{Y=`https://code.workmate.com/docs/en`,Ys=[{matches:e=>e.path===`permissions.defaultMode`&&e.code===`invalid_value`,tip:{suggestion:`Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)`,docLink:`${Y}/iam#permission-modes`}},{matches:e=>e.path===`apiKeyHelper`&&e.code===`invalid_type`,tip:{suggestion:`Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"`}},{matches:e=>e.path===`cleanupPeriodDays`&&e.code===`too_small`&&e.expected===`0`,tip:{suggestion:`Must be 0 or greater. Set a positive number for days to retain transcripts (default is 30). Setting 0 disables session persistence entirely: no transcripts are written and existing transcripts are deleted at startup.`}},{matches:e=>e.path.startsWith(`env.`)&&e.code===`invalid_type`,tip:{suggestion:`Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"`,docLink:`${Y}/settings#environment-variables`}},{matches:e=>(e.path===`permissions.allow`||e.path===`permissions.deny`)&&e.code===`invalid_type`&&e.expected===`array`,tip:{suggestion:`Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.`}},{matches:e=>e.path.includes(`hooks`)&&e.code===`invalid_type`,tip:{suggestion:`Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}`}},{matches:e=>e.code===`invalid_type`&&e.expected===`boolean`,tip:{suggestion:`Use true or false without quotes. Example: "includeCoAuthoredBy": true`}},{matches:e=>e.code===`unrecognized_keys`,tip:{suggestion:`Check for typos or refer to the documentation for valid fields`,docLink:`${Y}/settings`}},{matches:e=>e.code===`invalid_value`&&e.enumValues!==void 0,tip:{suggestion:void 0}},{matches:e=>e.code===`invalid_type`&&e.expected===`object`&&e.received===null&&e.path===``,tip:{suggestion:`Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error.`}},{matches:e=>e.path===`permissions.additionalDirectories`&&e.code===`invalid_type`,tip:{suggestion:`Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command`,docLink:`${Y}/iam#working-directories`}}],Xs={permissions:`${Y}/iam#configuring-permissions`,env:`${Y}/settings#environment-variables`,hooks:`${Y}/hooks`}}));function Qs(e){return e.code===`invalid_type`}function $s(e){return e.code===`invalid_value`}function ec(e){return e.code===`unrecognized_keys`}function tc(e){return e.code===`too_small`}function nc(e){return e===null?`null`:e===void 0?`undefined`:Array.isArray(e)?`array`:typeof e}function rc(e){let t=e.match(/received (\w+)/);return t?t[1]:void 0}function ic(e,t){return e.issues.map(e=>{let n=e.path.map(String).join(`.`),r=e.message,i,a,o,s,c;if($s(e))a=e.values.map(e=>String(e)),o=a.join(` | `),s=void 0,c=void 0;else if(Qs(e)){o=e.expected;let t=rc(e.message);s=t??nc(e.input),c=t??nc(e.input)}else tc(e)?o=String(e.minimum):e.code===`custom`&&`params`in e&&(s=e.params.received,c=s);let ee=Js({path:n,code:e.code,expected:o,received:s,enumValues:a,message:e.message,value:s});if($s(e))i=a?.map(e=>`"${e}"`).join(`, `),r=`Invalid value. Expected one of: ${i}`;else if(Qs(e)){let t=rc(e.message)??nc(e.input);r=e.expected===`object`&&t===`null`&&n===``?`Invalid or malformed JSON`:`Expected ${e.expected}, but received ${t}`}else if(ec(e)){let t=e.keys.join(`, `);r=`Unrecognized ${Ht(e.keys.length,`field`)}: ${t}`}else tc(e)&&(r=`Number must be greater than or equal to ${e.minimum}`,i=String(e.minimum));return{file:t,path:n,message:r,expected:i,invalidValue:c,suggestion:ee?.suggestion,docLink:ee?.docLink}})}function ac(e){try{let t=lt(e),n=J().strict().safeParse(t);return n.success?{isValid:!0}:{isValid:!1,error:`Settings validation failed:
18
18
  `+ic(n.error,`settings`).map(e=>`- ${e.path}: ${e.message}`).join(`
19
19
  `),fullSchema:Ks()}}catch(e){return{isValid:!1,error:`Invalid JSON: ${e instanceof Error?e.message:`Unknown parsing error`}`,fullSchema:Ks()}}}function oc(e,t){if(!e||typeof e!=`object`)return[];let n=e;if(!n.permissions||typeof n.permissions!=`object`)return[];let r=n.permissions,i=[];for(let e of[`allow`,`deny`,`ask`]){let n=r[e];Array.isArray(n)&&(r[e]=n.filter(n=>{if(typeof n!=`string`)return i.push({file:t,path:`permissions.${e}`,message:`Non-string value in ${e} array was removed`,invalidValue:n}),!1;let r=Ns(n,e);if(!r.valid){let a=`Invalid permission rule "${n}" was skipped`;return r.error&&(a+=`: ${r.error}`),r.suggestion&&(a+=`. ${r.suggestion}`),i.push({file:t,path:`permissions.${e}`,message:a,invalidValue:n}),!1}return!0}))}return i}var sc=e((()=>{mt(),Wt(),Fs(),qs(),Gs(),Zs()}));function cc(){let e=``;try{e=qt().username}catch{}let t=[];return e&&t.push({path:`/Library/Managed Preferences/${e}/${lc}.plist`,label:`per-user managed preferences`}),t.push({path:`/Library/Managed Preferences/${lc}.plist`,label:`device-level managed preferences`}),t}var lc,uc,dc,fc,pc,mc,hc,gc=e((()=>{lc=`com.anthropic.claudecode`,uc=`HKLM\\SOFTWARE\\Policies\\ClaudeCode`,dc=`HKCU\\SOFTWARE\\Policies\\ClaudeCode`,fc=`Settings`,pc=`/usr/bin/plutil`,mc=[`-convert`,`json`,`-o`,`-`,`--`],hc=5e3}));function _c(e,t){return new Promise(n=>{dn(e,t,{encoding:`utf-8`,timeout:hc},(e,t)=>{n({stdout:t??``,code:+!!e})})})}function vc(){return(async()=>{if(process.platform===`darwin`){let e=cc(),t=(await Promise.all(e.map(async({path:e,label:t})=>{if(!nn(e))return{stdout:``,label:t,ok:!1};let{stdout:n,code:r}=await _c(pc,[...mc,e]);return{stdout:n,label:t,ok:r===0&&!!n}}))).find(e=>e.ok);return{plistStdouts:t?[{stdout:t.stdout,label:t.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform===`win32`){let[e,t]=await Promise.all([_c(`reg`,[`query`,uc,`/v`,fc]),_c(`reg`,[`query`,dc,`/v`,fc])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:t.code===0?t.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function yc(){xc||(xc=vc())}function bc(){return xc}var xc,Sc=e((()=>{gc(),xc=null}));function Cc(){Fc||(Fc=(async()=>{It(`mdm_load_start`);let e=Date.now(),{mdm:t,hkcu:n}=jc(await(bc()??vc()));Nc=t,Pc=n,It(`mdm_load_end`);let r=Date.now()-e;if(D(`MDM settings load completed in ${r}ms`),Object.keys(t.settings).length>0){D(`MDM settings found: ${Object.keys(t.settings).join(`, `)}`);try{gt(`info`,`mdm_settings_loaded`,{duration_ms:r,key_count:Object.keys(t.settings).length,error_count:t.errors.length})}catch{}}})())}async function wc(){Fc||Cc(),await Fc}function Tc(){return Nc??X}function Ec(){return Pc??X}function Dc(e,t){Nc=e,Pc=t}async function Oc(){return jc(await vc())}function kc(e,t){let n=M(e,!1);if(!n||typeof n!=`object`)return{settings:{},errors:[]};let r=oc(n,t),i=J().safeParse(n);if(!i.success){let e=ic(i.error,t);return{settings:{},errors:[...r,...e]}}return{settings:i.data,errors:r}}function Ac(e,t=`Settings`){let n=e.split(/\r?\n/),r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=RegExp(`^\\s+${r}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,`i`);for(let e of n){let t=e.match(i);if(t?.[1])return t[1].trimEnd()}return null}function jc(e){if(e.plistStdouts&&e.plistStdouts.length>0){let{stdout:t,label:n}=e.plistStdouts[0],r=kc(t,n);if(Object.keys(r.settings).length>0)return{mdm:r,hkcu:X}}if(e.hklmStdout){let t=Ac(e.hklmStdout);if(t){let e=kc(t,`Registry: ${uc}\\${fc}`);if(Object.keys(e.settings).length>0)return{mdm:e,hkcu:X}}}if(Mc())return{mdm:X,hkcu:X};if(e.hkcuStdout){let t=Ac(e.hkcuStdout);if(t){let e=kc(t,`Registry: ${dc}\\${fc}`);return{mdm:X,hkcu:e}}}return{mdm:X,hkcu:X}}function Mc(){try{let e=M(R(P(ta(),`managed-settings.json`)),!1);if(e&&typeof e==`object`&&Object.keys(e).length>0)return!0}catch{}try{let e=na(),t=k().readdirSync(e);for(let n of t)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(`.json`)||n.name.startsWith(`.`)))try{let t=M(R(P(e,n.name)),!1);if(t&&typeof t==`object`&&Object.keys(t).length>0)return!0}catch{}}catch{}return!1}var X,Nc,Pc,Fc,Ic=e((()=>{pt(),ht(),Jr(),O(),Mt(),Ft(),ra(),Gs(),sc(),gc(),Sc(),X=Object.freeze({settings:{},errors:[]}),Nc=null,Pc=null,Fc=null}));function Lc(){return P(ta(),`managed-settings.json`)}function Rc(){let e=[],t={},n=!1,{settings:r,errors:i}=Z(Lc());e.push(...i),r&&Object.keys(r).length>0&&(t=L(t,r,$),n=!0);let a=na();try{let r=k().readdirSync(a).filter(e=>(e.isFile()||e.isSymbolicLink())&&e.name.endsWith(`.json`)&&!e.name.startsWith(`.`)).map(e=>e.name).sort();for(let i of r){let{settings:r,errors:o}=Z(P(a,i));e.push(...o),r&&Object.keys(r).length>0&&(t=L(t,r,$),n=!0)}}catch(e){let t=st(e);t!==`ENOENT`&&t!==`ENOTDIR`&&A(e)}return{settings:n?t:null,errors:e}}function zc(){let{settings:e}=Z(Lc()),t=!!e&&Object.keys(e).length>0,n=!1,r=na();try{n=k().readdirSync(r).some(e=>(e.isFile()||e.isSymbolicLink())&&e.name.endsWith(`.json`)&&!e.name.startsWith(`.`))}catch{}return{hasBase:t,hasDropIns:n}}function Bc(e,t){typeof e==`object`&&e&&`code`in e&&e.code===`ENOENT`?D(`Broken symlink or missing file encountered for settings.json at path: ${t}`):A(e)}function Z(e){let t=Be(e);if(t)return{settings:t.settings?dt(t.settings):null,errors:t.errors};let n=Vc(e);return Qe(e,n),{settings:n.settings?dt(n.settings):null,errors:n.errors}}function Vc(e){try{let{resolvedPath:t}=ft(k(),e),n=R(t);if(n.trim()===``)return{settings:{},errors:[]};let r=M(n,!1),i=oc(r,e),a=J().safeParse(r);if(!a.success){let t=ic(a.error,e);return{settings:null,errors:[...i,...t]}}return{settings:a.data,errors:i}}catch(t){return Bc(t,e),{settings:null,errors:[]}}}function Hc(e){switch(e){case`userSettings`:return F(p());case`policySettings`:case`projectSettings`:case`localSettings`:return F(ze());case`flagSettings`:{let e=Ee();return e?N(F(e)):F(ze())}}}function Uc(){return Ce()||m(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?`cowork_settings.json`:`settings.json`}function Wc(e){switch(e){case`userSettings`:return P(Hc(e),Uc());case`projectSettings`:case`localSettings`:return P(Hc(e),Gc(e));case`policySettings`:return Lc();case`flagSettings`:return Ee()}}function Gc(e){switch(e){case`projectSettings`:return P(`.workmate`,`settings.json`);case`localSettings`:return P(`.workmate`,`settings.local.json`)}}function Q(e){let t=Ke(e);if(t!==void 0)return t;let n=Kc(e);return nt(e,n),n}function Kc(e){if(e===`policySettings`){let e=ei();if(e&&Object.keys(e).length>0)return e;let t=Tc();if(Object.keys(t.settings).length>0)return t.settings;let{settings:n}=Rc();if(n)return n;let r=Ec();return Object.keys(r.settings).length>0?r.settings:null}let t=Wc(e),{settings:n}=t?Z(t):{settings:null};if(e===`flagSettings`){let e=we();if(e){let t=J().safeParse(e);if(t.success)return L(n||{},t.data,$)}}return n}function qc(){let e=ei();if(e&&Object.keys(e).length>0)return`remote`;let t=Tc();if(Object.keys(t.settings).length>0)return j()===`macos`?`plist`:`hklm`;let{settings:n}=Rc();if(n)return`file`;let r=Ec();return Object.keys(r.settings).length>0?`hkcu`:null}function Jc(e,t){if(e===`policySettings`||e===`flagSettings`)return{error:null};let n=Wc(e);if(!n)return{error:null};try{k().mkdirSync(N(n));let r=Kc(e);if(!r){let e=null;try{e=R(n)}catch(e){if(!at(e))throw e}if(e!==null){let t=M(e);if(t===null)return{error:Error(`Invalid JSON syntax in settings file at ${n}`)};t&&typeof t==`object`&&(r=t,D(`Using raw settings from ${n} due to validation failure`))}}let i=L(r||{},t,(e,t,n,r)=>{if(t===void 0&&r&&typeof n==`string`){delete r[n];return}if(Array.isArray(t))return t});Xi(n),Oi(n,`${ot(i,null,2)}\n`),Pe(),e===`localSettings`&&Li(Gc(`localSettings`),ze())}catch(e){let t=Error(`Failed to read raw settings from ${n}: ${e}`);return A(t),{error:t}}return{error:null}}function Yc(e,t){return oi([...e,...t])}function $(e,t){if(Array.isArray(e)&&Array.isArray(t))return Yc(e,t)}function Xc(e){let t=J().strip().parse(e),n=[`permissions`,`sandbox`,`hooks`],r=[],i={permissions:new Set([`allow`,`deny`,`ask`,`defaultMode`,`disableBypassPermissionsMode`,`disableAutoMode`,`additionalDirectories`]),sandbox:new Set([`enabled`,`failIfUnavailable`,`allowUnsandboxedCommands`,`network`,`filesystem`,`ignoreViolations`,`excludedCommands`,`autoAllowBashIfSandboxed`,`enableWeakerNestedSandbox`,`enableWeakerNetworkIsolation`,`ripgrep`]),hooks:new Set([`PreToolUse`,`PostToolUse`,`Notification`,`UserPromptSubmit`,`SessionStart`,`SessionEnd`,`Stop`,`SubagentStop`,`PreCompact`,`PostCompact`,`TeammateIdle`,`TaskCreated`,`TaskCompleted`])};for(let e of Object.keys(t))if(n.includes(e)&&t[e]&&typeof t[e]==`object`){let n=t[e],a=i[e];if(a)for(let t of Object.keys(n))a.has(t)&&r.push(`${e}.${t}`)}else r.push(e);return r.sort()}function Zc(){if(ol)return{settings:{},errors:[]};let e=Date.now();It(`loadSettingsFromDisk_start`),gt(`info`,`settings_load_started`),ol=!0;try{let t=We(),n={};t&&(n=L(n,t,$));let r=[],i=new Set,a=new Set;for(let e of Wi()){if(e===`policySettings`){let e=null,t=[],a=ei();if(a&&Object.keys(a).length>0){let n=J().safeParse(a);n.success?e=n.data:t.push(...ic(n.error,`remote managed settings`))}if(!e){let n=Tc();Object.keys(n.settings).length>0&&(e=n.settings),t.push(...n.errors)}if(!e){let{settings:n,errors:r}=Rc();n&&(e=n),t.push(...r)}if(!e){let n=Ec();Object.keys(n.settings).length>0&&(e=n.settings),t.push(...n.errors)}e&&(n=L(n,e,$));for(let e of t){let t=`${e.file}:${e.path}:${e.message}`;i.has(t)||(i.add(t),r.push(e))}continue}let t=Wc(e);if(t){let e=F(t);if(!a.has(e)){a.add(e);let{settings:o,errors:s}=Z(t);for(let e of s){let t=`${e.file}:${e.path}:${e.message}`;i.has(t)||(i.add(t),r.push(e))}o&&(n=L(n,o,$))}}if(e===`flagSettings`){let e=we();if(e){let t=J().safeParse(e);t.success&&(n=L(n,t.data,$))}}}return gt(`info`,`settings_load_completed`,{duration_ms:Date.now()-e,source_count:a.size,error_count:r.length}),{settings:n,errors:r}}finally{ol=!1}}function Qc(){let{settings:e}=el();return e||{}}function $c(){Pe();let e=[];for(let t of Wi()){let n=Q(t);n&&Object.keys(n).length>0&&e.push({source:t,settings:n})}return{effective:Qc(),sources:e}}function el(){let e=He();if(e!==null)return e;let t=Zc();return It(`loadSettingsFromDisk_end`),tt(t),t}function tl(){return!!(Q(`userSettings`)?.skipDangerousModePermissionPrompt||Q(`localSettings`)?.skipDangerousModePermissionPrompt||Q(`flagSettings`)?.skipDangerousModePermissionPrompt||Q(`policySettings`)?.skipDangerousModePermissionPrompt)}function nl(){return!0}function rl(){return Q(`policySettings`)?.useAutoModeDuringPlan!==!1&&Q(`flagSettings`)?.useAutoModeDuringPlan!==!1&&Q(`userSettings`)?.useAutoModeDuringPlan!==!1&&Q(`localSettings`)?.useAutoModeDuringPlan!==!1}function il(){let e=C({allow:S(h()).optional(),soft_deny:S(h()).optional(),deny:S(h()).optional(),environment:S(h()).optional()}),t=[],n=[],r=[];for(let i of[`userSettings`,`localSettings`,`flagSettings`,`policySettings`]){let a=Q(i);if(!a)continue;let o=e.safeParse(a.autoMode);o.success&&(o.data.allow&&t.push(...o.data.allow),o.data.soft_deny&&n.push(...o.data.soft_deny),o.data.environment&&r.push(...o.data.environment))}if(t.length>0||n.length>0||r.length>0)return{...t.length>0&&{allow:t},...n.length>0&&{soft_deny:n},...r.length>0&&{environment:r}}}function al(e){for(let t of Wi()){if(t===`policySettings`)continue;let n=Wc(t);if(n)try{let{resolvedPath:t}=ft(k(),n),r=R(t);if(!r.trim())continue;let i=M(r,!1);if(i&&typeof i==`object`&&e in i)return!0}catch(e){Bc(e,n)}}return!1}var ol,sl,cl=e((()=>{Wr(),T(),Ae(),ri(),si(),pt(),ht(),ne(),ct(),Pi(),Jr(),O(),Ri(),Mt(),xt(),wt(),mt(),Ft(),Yi(),ea(),ra(),Ic(),Ve(),Gs(),sc(),ol=!1,sl=Qc}));export{ts as $,Er as $n,Qi as $t,sc as A,ji as An,mn as Ar,La as At,q as B,oi as Bn,Ea as Bt,Ec as C,mi as Cn,En as Cr,H as Ct,Dc as D,ki as Dn,hn as Dr,Ga as Dt,Oc as E,Ei as En,yn as Er,Ja as Et,Ls as F,Oi as Fn,ja as Ft,hs as G,Zr as Gn,va as Gt,bs as H,Qr as Hn,xa as Ht,Is as I,hi as In,Pa as It,os as J,Jr as Jn,fa as Jt,ds as K,Yr as Kn,V as Kt,Rs as L,ai as Ln,Fa as Lt,Ws as M,Di as Mn,za as Mt,J as N,Ti as Nn,Na as Nt,Sc as O,Ai as On,_n as Or,Va as Ot,Gs as P,Si as Pn,Oa as Pt,us as Q,Ir as Qn,ra as Qt,gs as R,si as Rn,Ma as Rt,wc as S,pi as Sn,Mn as Sr,no as St,Ic as T,Ci as Tn,vn as Tr,qa as Tt,ms as U,ri as Un,Sa as Ut,ys as V,ei as Vn,Da as Vt,ps as W,Xr as Wn,Ca as Wt,ls as X,qr as Xn,ta as Xt,ss as Y,R as Yn,ba as Yt,cs as Z,Lr as Zn,na as Zt,Rc as _,vi as _n,Fn as _r,zo as _t,qc as a,Hi as an,Yn as ar,$o as at,$ as b,xi as bn,Pn as br,ro as bt,Q as c,Bi as cn,Zn as cr,U as ct,$c as d,Ui as dn,Wn as dr,Jo as dt,Zi as en,wr as er,is as et,sl as f,Ri as fn,Gn as fr,ko as ft,cl as g,wi as gn,Rn as gr,Ro as gt,tl as h,Mi as hn,Ln as hr,No as ht,Xc as i,Wi as in,rr as ir,as as it,ac as j,fi as jn,Ia as jt,yc as k,di as kn,pn as kr,Ha as kt,Hc as l,Yi as ln,Xn as lr,Uo as lt,nl as m,Ni as mn,Bn as mr,K as mt,Qc as n,Ki as nn,or as nr,es as nt,Gc as o,Vi as on,Kn as or,Qo as ot,rl as p,Fi as pn,zn as pr,go as pt,fs as q,Gr as qn,da as qt,zc as r,qi as rn,nr as rr,ns as rt,Wc as s,zi as sn,Jn as sr,Xo as st,il as t,ea as tn,pr as tr,rs as tt,el as u,Gi as un,qn as ur,Ko as ut,Z as v,gi as vn,In as vr,Yo as vt,Tc as w,Pi as wn,Tn as wr,$a as wt,Jc as x,bi as xn,Dn as xr,eo as xt,al as y,_i as yn,Nn as yr,io as yt,ws as z,ii as zn,Aa as zt};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ky as t,jv as n}from"./loadAgentsDir-JrGMJN05.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-aUygByiZ.js";import{h as p}from"./config-BkbL2e5Q.js";import{O as m,m as h}from"./git-DplvjXEY.js";import{u as g}from"./oauth-D38aRTUb.js";import{Bt as _,oi as v}from"./model-CmDF8O9G.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
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ky as t,jv as n}from"./loadAgentsDir-PPiD2Mfq.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-sviY1inu.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};
@@ -0,0 +1,3 @@
1
+ import{n as e,t}from"./memoize-BK3gG5ob.js";import{l as n,o as r,s as i}from"./envUtils-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-PPiD2Mfq.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-sviY1inu.js";import{dn as X,mn as nt}from"./prompt-CQmEvnKN.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-BI3tFLyy.js";import{c as ct,t as lt}from"./nativeInstaller-N1xiUpCP.js";import{l as ut,s as dt}from"./logoV2Utils-Bkj74dtY.js";import{i as ft,r as pt}from"./runtimeObserver-By59MZKJ.js";import{t as mt}from"./sinks-Bb2i50kz.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-DUCuU3_8.js`).then(e=>{h||(e.loadPluginHooks(),e.setupPluginHookHotReload())}),i()||import(`./sessionFileAccessHooks-BaWZ8sqn.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 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,L as n,R as r,V as i,z as a}from"./loadAgentsDir-JrGMJN05.js";import{an as o}from"./prompt-DnPppVz8.js";function s(e){return e===`projectSettings`||e===`policySettings`||e===`command`}function c(e){return t(e)}function l(e,t,n){let r=c(t.source),i=c(n.source),a=t.ruleValue.toolName;return e===`deny`?`Remove the "${a}" deny rule from ${r}, or remove the specific allow rule from ${i}`:`Remove the "${a}" ask rule from ${r}, or remove the specific allow rule from ${i}`}function u(e,t,n){let{toolName:r,ruleContent:i}=e.ruleValue;if(i===void 0)return{shadowed:!1};let a=t.find(e=>e.ruleValue.toolName===r&&e.ruleValue.ruleContent===void 0);return!a||r===`Bash`&&n.sandboxAutoAllowEnabled&&!s(a.source)?{shadowed:!1}:{shadowed:!0,shadowedBy:a,shadowType:`ask`}}function d(e,t){let{toolName:n,ruleContent:r}=e.ruleValue;if(r===void 0)return{shadowed:!1};let i=t.find(e=>e.ruleValue.toolName===n&&e.ruleValue.ruleContent===void 0);return i?{shadowed:!0,shadowedBy:i,shadowType:`deny`}:{shadowed:!1}}function f(e,t){let i=[],o=n(e),s=r(e),f=a(e);for(let e of o){let n=d(e,f);if(n.shadowed){let t=c(n.shadowedBy.source);i.push({rule:e,reason:`Blocked by "${n.shadowedBy.ruleValue.toolName}" deny rule (from ${t})`,shadowedBy:n.shadowedBy,shadowType:`deny`,fix:l(`deny`,n.shadowedBy,e)});continue}let r=u(e,s,t);if(r.shadowed){let t=c(r.shadowedBy.source);i.push({rule:e,reason:`Shadowed by "${r.shadowedBy.ruleValue.toolName}" ask rule (from ${t})`,shadowedBy:r.shadowedBy,shadowType:`ask`,fix:l(`ask`,r.shadowedBy,e)})}}return i}var p=e((()=>{o(),i()}));export{p as n,f as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,L as n,R as r,V as i,z as a}from"./loadAgentsDir-PPiD2Mfq.js";import{an as o}from"./prompt-CQmEvnKN.js";function s(e){return e===`projectSettings`||e===`policySettings`||e===`command`}function c(e){return t(e)}function l(e,t,n){let r=c(t.source),i=c(n.source),a=t.ruleValue.toolName;return e===`deny`?`Remove the "${a}" deny rule from ${r}, or remove the specific allow rule from ${i}`:`Remove the "${a}" ask rule from ${r}, or remove the specific allow rule from ${i}`}function u(e,t,n){let{toolName:r,ruleContent:i}=e.ruleValue;if(i===void 0)return{shadowed:!1};let a=t.find(e=>e.ruleValue.toolName===r&&e.ruleValue.ruleContent===void 0);return!a||r===`Bash`&&n.sandboxAutoAllowEnabled&&!s(a.source)?{shadowed:!1}:{shadowed:!0,shadowedBy:a,shadowType:`ask`}}function d(e,t){let{toolName:n,ruleContent:r}=e.ruleValue;if(r===void 0)return{shadowed:!1};let i=t.find(e=>e.ruleValue.toolName===n&&e.ruleValue.ruleContent===void 0);return i?{shadowed:!0,shadowedBy:i,shadowType:`deny`}:{shadowed:!1}}function f(e,t){let i=[],o=n(e),s=r(e),f=a(e);for(let e of o){let n=d(e,f);if(n.shadowed){let t=c(n.shadowedBy.source);i.push({rule:e,reason:`Blocked by "${n.shadowedBy.ruleValue.toolName}" deny rule (from ${t})`,shadowedBy:n.shadowedBy,shadowType:`deny`,fix:l(`deny`,n.shadowedBy,e)});continue}let r=u(e,s,t);if(r.shadowed){let t=c(r.shadowedBy.source);i.push({rule:e,reason:`Shadowed by "${r.shadowedBy.ruleValue.toolName}" ask rule (from ${t})`,shadowedBy:r.shadowedBy,shadowType:`ask`,fix:l(`ask`,r.shadowedBy,e)})}}return i}var p=e((()=>{o(),i()}));export{p as n,f as t};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{La as t,Sa as n,Ta as r,dc as i,lc as a}from"./loadAgentsDir-JrGMJN05.js";import{P as o,T as s}from"./sessionState-C2REgUrs.js";function c(e){let t=[],n=e.matchAll(d);for(let e of n)e.index!==void 0&&t.push({word:e[0],start:e.index,end:e.index+e[0].length});return t}async function l({question:e,cacheSafeParams:t}){let r=await i({promptMessages:[n({content:`<system-reminder>This is a side question from the user. You must answer this question directly in a single response.
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{La as t,Sa as n,Ta as r,dc as i,lc as a}from"./loadAgentsDir-PPiD2Mfq.js";import{P as o,T as s}from"./sessionState-BTFowSpR.js";function c(e){let t=[],n=e.matchAll(d);for(let e of n)e.index!==void 0&&t.push({word:e[0],start:e.index,end:e.index+e[0].length});return t}async function l({question:e,cacheSafeParams:t}){let r=await i({promptMessages:[n({content:`<system-reminder>This is a side question from the user. You must answer this question directly in a single response.
2
2
 
3
3
  IMPORTANT CONTEXT:
4
4
  - You are a separate, lightweight agent spawned to answer this one question
@@ -1 +1 @@
1
- import{n as e,t}from"./axios-DaWTGg7G.js";import{Wt as n,pt as r}from"./state-BPFYBqm1.js";import{C as i,at as a,c as o,f as s,i as c,it as l,nt as u,tt as d,u as f,x as p}from"./debug-BQj6h99Q.js";import{o as m,r as h,t as g,v as _,y as v}from"./log-BlJ7CcKG.js";import{i as y,n as b,t as x}from"./analytics-DJobLaWP.js";import{a as S,n as C,o as w}from"./firstPartyEventLogger-D4yuDP-n.js";import{r as T,t as E}from"./datadog-DcLf1QpG.js";import{dirname as D,join as O}from"path";t(),n(),a(),v(),d(),c(),s(),m(),p();var k=h(new Date);function A(){return O(_.errors(),`${k}.jsonl`)}function j(e){return O(_.mcpLogs(e),`${k}.jsonl`)}function M(e){let t=l(e);return{write(e){t.write(`${i(e)}\n`)},flush:t.flush,dispose:t.dispose}}var N=new Map;function P(e){let t=N.get(e);if(!t){let n=D(e);t=M({writeFn:t=>{try{f().appendFileSync(e,t)}catch{f().mkdirSync(n),f().appendFileSync(e,t)}},flushIntervalMs:1e3,maxBufferSize:50}),N.set(e,t),u(async()=>t?.dispose())}return t}function F(e,t){let n={timestamp:new Date().toISOString(),...t,cwd:f().cwd(),userType:process.env.USER_TYPE,sessionId:r(),version:`0.0.14`};P(e).write(n)}function I(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e;if(typeof t.message==`string`)return t.message;if(typeof t.error==`object`&&t.error&&`message`in t.error&&typeof t.error.message==`string`)return t.error.message}}function L(t){let n=t.stack||t.message,r=``;if(e.isAxiosError(t)&&t.config?.url){let e=[`url=${t.config.url}`];t.response?.status!==void 0&&e.push(`status=${t.response.status}`);let n=I(t.response?.data);n&&e.push(`body=${n}`),r=`[${e.join(`,`)}] `}o(`${t.name}: ${r}${n}`,{level:`error`}),F(A(),{error:`${r}${n}`})}function R(e,t){o(`MCP server "${e}" ${t}`,{level:`error`});let n=j(e),i={error:t instanceof Error?t.stack||t.message:String(t),timestamp:new Date().toISOString(),sessionId:r(),cwd:f().cwd()};P(n).write(i)}function z(e,t){o(`MCP server "${e}": ${t}`);let n=j(e),i={debug:t,timestamp:new Date().toISOString(),sessionId:r(),cwd:f().cwd()};P(n).write(i)}function B(){g({logError:L,logMCPError:R,logMCPDebug:z,getErrorsPath:A,getMCPLogsPath:j}),o(`Error log sink initialized`)}E(),C(),b();function V(){return!1}function H(e,t){let n=w(e);if(n===0)return;let r=n===null?t:{...t,sample_rate:n};V()&&T(e,y(r)),S(e,r)}function U(e,t){return H(e,t),Promise.resolve()}function W(){x({logEvent:H,logEventAsync:U})}function G(){B(),W()}export{G as t};
1
+ import{n as e,t}from"./axios-DaWTGg7G.js";import{Wt as n,pt as r}from"./state-BPFYBqm1.js";import{C as i,at as a,c as o,f as s,i as c,it as l,nt as u,tt as d,u as f,x as p}from"./debug-BQj6h99Q.js";import{o as m,r as h,t as g,v as _,y as v}from"./log-BlJ7CcKG.js";import{i as y,n as b,t as x}from"./analytics-DJobLaWP.js";import{a as S,n as C,o as w}from"./firstPartyEventLogger-BMnXb9cv.js";import{r as T,t as E}from"./datadog-Cr0VKbct.js";import{dirname as D,join as O}from"path";t(),n(),a(),v(),d(),c(),s(),m(),p();var k=h(new Date);function A(){return O(_.errors(),`${k}.jsonl`)}function j(e){return O(_.mcpLogs(e),`${k}.jsonl`)}function M(e){let t=l(e);return{write(e){t.write(`${i(e)}\n`)},flush:t.flush,dispose:t.dispose}}var N=new Map;function P(e){let t=N.get(e);if(!t){let n=D(e);t=M({writeFn:t=>{try{f().appendFileSync(e,t)}catch{f().mkdirSync(n),f().appendFileSync(e,t)}},flushIntervalMs:1e3,maxBufferSize:50}),N.set(e,t),u(async()=>t?.dispose())}return t}function F(e,t){let n={timestamp:new Date().toISOString(),...t,cwd:f().cwd(),userType:process.env.USER_TYPE,sessionId:r(),version:`0.0.16`};P(e).write(n)}function I(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e;if(typeof t.message==`string`)return t.message;if(typeof t.error==`object`&&t.error&&`message`in t.error&&typeof t.error.message==`string`)return t.error.message}}function L(t){let n=t.stack||t.message,r=``;if(e.isAxiosError(t)&&t.config?.url){let e=[`url=${t.config.url}`];t.response?.status!==void 0&&e.push(`status=${t.response.status}`);let n=I(t.response?.data);n&&e.push(`body=${n}`),r=`[${e.join(`,`)}] `}o(`${t.name}: ${r}${n}`,{level:`error`}),F(A(),{error:`${r}${n}`})}function R(e,t){o(`MCP server "${e}" ${t}`,{level:`error`});let n=j(e),i={error:t instanceof Error?t.stack||t.message:String(t),timestamp:new Date().toISOString(),sessionId:r(),cwd:f().cwd()};P(n).write(i)}function z(e,t){o(`MCP server "${e}": ${t}`);let n=j(e),i={debug:t,timestamp:new Date().toISOString(),sessionId:r(),cwd:f().cwd()};P(n).write(i)}function B(){g({logError:L,logMCPError:R,logMCPDebug:z,getErrorsPath:A,getMCPLogsPath:j}),o(`Error log sink initialized`)}E(),C(),b();function V(){return!1}function H(e,t){let n=w(e);if(n===0)return;let r=n===null?t:{...t,sample_rate:n};V()&&T(e,y(r)),S(e,r)}function U(e,t){return H(e,t),Promise.resolve()}function W(){x({logEvent:H,logEventAsync:U})}function G(){B(),W()}export{G as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./sinks-Bb2i50kz.js";export{e as initSinks};
@@ -0,0 +1 @@
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-PPiD2Mfq.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-sviY1inu.js";import{Gt as Oe}from"./prompt-CQmEvnKN.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,5 +1,5 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,n,s as r}from"./projectContext-BN2ZWzOG.js";import{i,r as a}from"./instinctParser-Dt-lqnDe.js";import{c as o,o as s,s as c}from"./skillLifecycle-wU4JDNYQ.js";import{dirname as l,join as u}from"node:path";import{existsSync as d}from"node:fs";import{createHash as f}from"node:crypto";import{mkdir as p,readFile as m,rename as h,writeFile as g}from"node:fs/promises";async function _(e){let t=e.prompt.trim();if(!t)throw Error(`Cannot record an empty skill gap`);let n=e.project??r(e.cwd),i=await A(n,e.rootDir),a=F(t),o=new Date().toISOString(),s=i.gaps[a],c={key:a,prompt:t,count:(s?.count??0)+1,draftHits:s?.draftHits??0,draftHitSessions:s?.draftHitSessions??[],status:s?.status??`pending`,sessionId:e.sessionId??`unknown-session`,cwd:e.cwd??n.cwd,projectId:n.projectId,projectName:n.projectName,recommendations:(e.recommendations??[]).slice(0,5).map(e=>({name:e.name,description:e.description,score:e.score})),createdAt:s?.createdAt??o,updatedAt:o,draft:s?.draft,active:s?.active};return c.status===`rejected`?(i.gaps[a]=c,await N(n,i,e.rootDir),c):(!c.draft&&C(c)&&(c.draft=await T(c,n),c.status=`draft`,await z()),c.draft&&!c.active&&w(c)&&(c.active=await E(c,n),c.status=`active`,await z()),i.gaps[a]=c,await N(n,i,e.rootDir),c)}async function v(e=r(),t){let n=await A(e,t);return Object.values(n.gaps).sort((e,t)=>e.key.localeCompare(t.key))}async function y(e,t=r(),n){let i=await A(t,n);for(let t of Object.values(i.gaps))if(t.draft?.skillPath===e)return t.key}async function b(e,t=r(),n,i=`unknown-session`){let a=await A(t,n),o=a.gaps[e];if(!o?.draft||o.active)return o;let s=o.draftHitSessions??[];if(s.includes(i))return o;let c=new Date().toISOString(),l={...o,draftHits:o.draftHits+1,draftHitSessions:[...s,i],updatedAt:c};return w(l)&&(l.active=await E(l,t),l.status=`active`,await z()),a.gaps[e]=l,await N(t,a,n),l}async function x(e,t=r(),n){let i=await A(t,n),a=i.gaps[e];if(!a)return;if(a.status===`rejected`||a.draft)return a;let o={...a,draft:await T(a,t),status:`draft`,updatedAt:new Date().toISOString()};return i.gaps[e]=o,await N(t,i,n),await z(),o}async function S(e,t=r(),n){let i=await A(t,n),a=i.gaps[e];if(!a)return;let o={...a,status:`rejected`,updatedAt:new Date().toISOString()};return i.gaps[e]=o,await N(t,i,n),o}function C(e){return e.count>=B}function w(e){return e.draft?e.count>=V||e.draftHits>=H:!1}async function T(e,t){let n=D(e,`pending`),r=u(t.projectRoot??t.cwd,`.workmate`,`skills`,`.drafts`),i=s([n],{cwd:t.projectRoot??t.cwd,outputRoot:r,scope:`project`,name:`draft-${I(e.prompt)}`,description:`Draft learned skill candidate. Promote after repeated evidence or explicit user correction.`}),a=u(i.outputPath,`SKILL.md`);return d(a)||await o({...i,content:i.content+`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,n,s as r}from"./projectContext-BN2ZWzOG.js";import{i,r as a}from"./instinctParser-Dt-lqnDe.js";import{c as o,o as s,s as c}from"./skillLifecycle-CG2XmS8f.js";import{dirname as l,join as u}from"node:path";import{existsSync as d}from"node:fs";import{createHash as f}from"node:crypto";import{mkdir as p,readFile as m,rename as h,writeFile as g}from"node:fs/promises";async function _(e){let t=e.prompt.trim();if(!t)throw Error(`Cannot record an empty skill gap`);let n=e.project??r(e.cwd),i=await A(n,e.rootDir),a=F(t),o=new Date().toISOString(),s=i.gaps[a],c={key:a,prompt:t,count:(s?.count??0)+1,draftHits:s?.draftHits??0,draftHitSessions:s?.draftHitSessions??[],status:s?.status??`pending`,sessionId:e.sessionId??`unknown-session`,cwd:e.cwd??n.cwd,projectId:n.projectId,projectName:n.projectName,recommendations:(e.recommendations??[]).slice(0,5).map(e=>({name:e.name,description:e.description,score:e.score})),createdAt:s?.createdAt??o,updatedAt:o,draft:s?.draft,active:s?.active};return c.status===`rejected`?(i.gaps[a]=c,await N(n,i,e.rootDir),c):(!c.draft&&C(c)&&(c.draft=await T(c,n),c.status=`draft`,await z()),c.draft&&!c.active&&w(c)&&(c.active=await E(c,n),c.status=`active`,await z()),i.gaps[a]=c,await N(n,i,e.rootDir),c)}async function v(e=r(),t){let n=await A(e,t);return Object.values(n.gaps).sort((e,t)=>e.key.localeCompare(t.key))}async function y(e,t=r(),n){let i=await A(t,n);for(let t of Object.values(i.gaps))if(t.draft?.skillPath===e)return t.key}async function b(e,t=r(),n,i=`unknown-session`){let a=await A(t,n),o=a.gaps[e];if(!o?.draft||o.active)return o;let s=o.draftHitSessions??[];if(s.includes(i))return o;let c=new Date().toISOString(),l={...o,draftHits:o.draftHits+1,draftHitSessions:[...s,i],updatedAt:c};return w(l)&&(l.active=await E(l,t),l.status=`active`,await z()),a.gaps[e]=l,await N(t,a,n),l}async function x(e,t=r(),n){let i=await A(t,n),a=i.gaps[e];if(!a)return;if(a.status===`rejected`||a.draft)return a;let o={...a,draft:await T(a,t),status:`draft`,updatedAt:new Date().toISOString()};return i.gaps[e]=o,await N(t,i,n),await z(),o}async function S(e,t=r(),n){let i=await A(t,n),a=i.gaps[e];if(!a)return;let o={...a,status:`rejected`,updatedAt:new Date().toISOString()};return i.gaps[e]=o,await N(t,i,n),o}function C(e){return e.count>=B}function w(e){return e.draft?e.count>=V||e.draftHits>=H:!1}async function T(e,t){let n=D(e,`pending`),r=u(t.projectRoot??t.cwd,`.workmate`,`skills`,`.drafts`),i=s([n],{cwd:t.projectRoot??t.cwd,outputRoot:r,scope:`project`,name:`draft-${I(e.prompt)}`,description:`Draft learned skill candidate. Promote after repeated evidence or explicit user correction.`}),a=u(i.outputPath,`SKILL.md`);return d(a)||await o({...i,content:i.content+`
2
2
  ## Promotion Rule
3
3
 
4
4
  Do not move this draft into active skills until the same gap repeats or the user explicitly confirms this should become reusable.
5
- `}),{type:`draft`,name:i.name,skillPath:a}}async function E(e,t){let n=s([D(e,`active`)],{cwd:t.projectRoot??t.cwd,scope:`project`,name:I(e.prompt),description:O(e.prompt)}),r=u(n.outputPath,`SKILL.md`);return d(r)||await o(n),{type:`active`,name:n.name,skillPath:r}}function D(e,t){return a({trigger:`When the user asks for ${L(e.prompt,120)}`,action:O(e.prompt),confidence:t===`active`?.82:.55,domain:k(e.prompt),source:`session-observation`,scope:`project`,projectId:e.projectId,projectName:e.projectName,evidence:[`Skill gap prompt: ${L(e.prompt,180)}`,`No high-confidence active skill was auto-loaded.`,`Observed ${e.count} time(s).`],status:t})}function O(e){return/feature\s*\(|feature flag|flag_name|stub|no-op|noop|最小实现/i.test(e)?`Audit feature flags by scanning feature() call sites, excluding generated/dependency noise, classifying each candidate as stub, shell, MVP, or thin-toggle, and writing an evidence-backed document.`:/skill|技能|学习|进化|evolve|learning/i.test(e)?`Run skill discovery first; auto-load only high-confidence matching skills; record a skill gap when none match; promote repeated or corrected gaps into learned skills.`:/test|测试|stub|调用链|参数/i.test(e)?`Infer tests from existing files, parameters, exports, and call chains before simplifying mocks or inventing behavior.`:`Reuse the workflow learned from this prompt: ${L(e,180)}.`}function k(e){let t=e.toLowerCase();return/test|测试|stub|fixture|断言/.test(t)?`testing`:/error|bug|fix|失败|错误|修复|debug/.test(t)?`debugging`:/security|安全|漏洞|secret|token/.test(t)?`security`:/git|commit|branch|pr\b/.test(t)?`git`:/style|lint|format|命名|规范/.test(t)?`code-style`:`workflow`}async function A(e,t){let n=P(e,t),r;try{r=await m(n,`utf8`)}catch(e){if(e.code===`ENOENT`)return{version:1,gaps:{}};throw e}try{return j(JSON.parse(r))}catch{let e=`${n}.corrupt-${Date.now()}`;try{await g(e,r,`utf8`)}catch{}return{version:1,gaps:{}}}}function j(e){let t={};for(let[n,r]of Object.entries(e.gaps??{})){let e=r,i=typeof e.draftHits==`number`&&Number.isFinite(e.draftHits)?e.draftHits:0,a=typeof e.count==`number`?e.count:1,o=M(e.status),s=!!e.draft,c=!!e.active,l=o;l===`draft`&&a<B&&!s&&(l=`pending`),l===`active`&&!c&&(l=s?`draft`:`pending`);let u=Array.isArray(e.draftHitSessions)?e.draftHitSessions.filter(e=>typeof e==`string`):[];t[n]={...r,count:a,draftHits:i,draftHitSessions:u,status:l}}return{version:1,gaps:t}}function M(e){return e===`pending`||e===`draft`||e===`active`||e===`rejected`?e:`pending`}async function N(e,t,n){let r=P(e,n);await p(l(r),{recursive:!0});let i=`${r}.tmp-${process.pid}-${Date.now()}`;await g(i,`${JSON.stringify(t,null,2)}\n`,`utf8`),await h(i,r)}function P(e,t){return u(t?e.projectId===`global`?u(t,`global`):u(t,`projects`,e.projectId):n(e.projectId),`skill-gaps.json`)}function F(e){return`${I(e)}-${R(e).slice(0,8)}`}function I(e){let t=e.replaceAll(`技能`,` skill `).replaceAll(`学习`,` learning `).replaceAll(`进化`,` evolution `).replaceAll(`测试`,` testing `).replaceAll(`最小实现`,` minimal implementation `).toLowerCase(),n=new Set([`the`,`and`,`for`,`with`,`this`,`that`,`user`,`about`,`feature`,`flag`,`name`]);return((t.match(/[a-z0-9][a-z0-9_-]{2,}/g)??[]).filter(e=>!n.has(e)).slice(0,5).join(`-`)||`learned-gap`).slice(0,54).replace(/-+$/g,``)}function L(e,t){return e.replace(/\s+/g,` `).trim().slice(0,t)}function R(e){return f(`sha1`).update(e).digest(`hex`)}async function z(){try{let{clearCommandsCache:e}=await import(`./commands-DTB0Qzd5.js`);e()}catch{}}var B,V,H;e((()=>{i(),t(),c(),B=2,V=4,H=2}))();export{y as findGapKeyByDraftPath,x as promoteGapToDraft,v as readSkillGaps,b as recordDraftHit,_ as recordSkillGap,S as rejectSkillGap,w as shouldPromoteToActive,C as shouldPromoteToDraft};
5
+ `}),{type:`draft`,name:i.name,skillPath:a}}async function E(e,t){let n=s([D(e,`active`)],{cwd:t.projectRoot??t.cwd,scope:`project`,name:I(e.prompt),description:O(e.prompt)}),r=u(n.outputPath,`SKILL.md`);return d(r)||await o(n),{type:`active`,name:n.name,skillPath:r}}function D(e,t){return a({trigger:`When the user asks for ${L(e.prompt,120)}`,action:O(e.prompt),confidence:t===`active`?.82:.55,domain:k(e.prompt),source:`session-observation`,scope:`project`,projectId:e.projectId,projectName:e.projectName,evidence:[`Skill gap prompt: ${L(e.prompt,180)}`,`No high-confidence active skill was auto-loaded.`,`Observed ${e.count} time(s).`],status:t})}function O(e){return/feature\s*\(|feature flag|flag_name|stub|no-op|noop|最小实现/i.test(e)?`Audit feature flags by scanning feature() call sites, excluding generated/dependency noise, classifying each candidate as stub, shell, MVP, or thin-toggle, and writing an evidence-backed document.`:/skill|技能|学习|进化|evolve|learning/i.test(e)?`Run skill discovery first; auto-load only high-confidence matching skills; record a skill gap when none match; promote repeated or corrected gaps into learned skills.`:/test|测试|stub|调用链|参数/i.test(e)?`Infer tests from existing files, parameters, exports, and call chains before simplifying mocks or inventing behavior.`:`Reuse the workflow learned from this prompt: ${L(e,180)}.`}function k(e){let t=e.toLowerCase();return/test|测试|stub|fixture|断言/.test(t)?`testing`:/error|bug|fix|失败|错误|修复|debug/.test(t)?`debugging`:/security|安全|漏洞|secret|token/.test(t)?`security`:/git|commit|branch|pr\b/.test(t)?`git`:/style|lint|format|命名|规范/.test(t)?`code-style`:`workflow`}async function A(e,t){let n=P(e,t),r;try{r=await m(n,`utf8`)}catch(e){if(e.code===`ENOENT`)return{version:1,gaps:{}};throw e}try{return j(JSON.parse(r))}catch{let e=`${n}.corrupt-${Date.now()}`;try{await g(e,r,`utf8`)}catch{}return{version:1,gaps:{}}}}function j(e){let t={};for(let[n,r]of Object.entries(e.gaps??{})){let e=r,i=typeof e.draftHits==`number`&&Number.isFinite(e.draftHits)?e.draftHits:0,a=typeof e.count==`number`?e.count:1,o=M(e.status),s=!!e.draft,c=!!e.active,l=o;l===`draft`&&a<B&&!s&&(l=`pending`),l===`active`&&!c&&(l=s?`draft`:`pending`);let u=Array.isArray(e.draftHitSessions)?e.draftHitSessions.filter(e=>typeof e==`string`):[];t[n]={...r,count:a,draftHits:i,draftHitSessions:u,status:l}}return{version:1,gaps:t}}function M(e){return e===`pending`||e===`draft`||e===`active`||e===`rejected`?e:`pending`}async function N(e,t,n){let r=P(e,n);await p(l(r),{recursive:!0});let i=`${r}.tmp-${process.pid}-${Date.now()}`;await g(i,`${JSON.stringify(t,null,2)}\n`,`utf8`),await h(i,r)}function P(e,t){return u(t?e.projectId===`global`?u(t,`global`):u(t,`projects`,e.projectId):n(e.projectId),`skill-gaps.json`)}function F(e){return`${I(e)}-${R(e).slice(0,8)}`}function I(e){let t=e.replaceAll(`技能`,` skill `).replaceAll(`学习`,` learning `).replaceAll(`进化`,` evolution `).replaceAll(`测试`,` testing `).replaceAll(`最小实现`,` minimal implementation `).toLowerCase(),n=new Set([`the`,`and`,`for`,`with`,`this`,`that`,`user`,`about`,`feature`,`flag`,`name`]);return((t.match(/[a-z0-9][a-z0-9_-]{2,}/g)??[]).filter(e=>!n.has(e)).slice(0,5).join(`-`)||`learned-gap`).slice(0,54).replace(/-+$/g,``)}function L(e,t){return e.replace(/\s+/g,` `).trim().slice(0,t)}function R(e){return f(`sha1`).update(e).digest(`hex`)}async function z(){try{let{clearCommandsCache:e}=await import(`./commands-BKLsl6gK.js`);e()}catch{}}var B,V,H;e((()=>{i(),t(),c(),B=2,V=4,H=2}))();export{y as findGapKeyByDraftPath,x as promoteGapToDraft,v as readSkillGaps,b as recordDraftHit,_ as recordSkillGap,S as rejectSkillGap,w as shouldPromoteToActive,C as shouldPromoteToDraft};
@@ -1,6 +1,6 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DcaKZlRU.js";import{o as r,t as i}from"./localSearch-C-stDP9C.js";import{l as a,u as o}from"./instinctParser-Dt-lqnDe.js";import{basename as s,dirname as c,join as l}from"node:path";import{existsSync as u}from"node:fs";import{mkdir as d,readFile as f,readdir as p,rename as m,rm as ee,writeFile as h}from"node:fs/promises";function g(e){return e.length!==0&&e.reduce((e,t)=>e+t.confidence,0)/e.length>=a().minConfidence}function te(e){let t=e[0]?.domain??`project`,n=b[t],r=new Set;for(let t of e){for(let e of`${t.trigger} ${t.action}`.toLowerCase().split(/[^a-z0-9]+/))if(y(e)&&r.add(e),r.size>=5)break;if(r.size>=5)break}let i=_([n,...r].join(`-`));return v(i)?`${n}-learned-pattern`:i}function _(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,64).replace(/-$/g,``)||`learned-skill`}function v(e){return x.has(e)}function y(e){return e.length>2&&![`when`,`with`,`this`,`that`,`user`,`project`,`prefer`,`avoid`,`use`,`using`,`the`,`and`,`for`].includes(e)}var b,x,S=e((()=>{o(),b={workflow:`workflow`,testing:`testing`,debugging:`debugging`,"code-style":`style`,security:`security`,git:`git`,project:`project`},x=new Set([`learned-skill`,`better-skill`,`new-skill`,`project-skill`,`workflow-skill`])}));function C(e,t){if(e.length===0)throw Error(`Cannot generate a skill draft without instincts`);let n=t?.scope??e[0]?.scope??`project`,r=t?.name?_(t.name):E(e),i=e.reduce((e,t)=>e+t.confidence,0)/e.length,a=t?.description??D(e),o=re(r,n,t),s=O({name:r,description:a,confidence:i,instincts:e});return{name:r,description:a,scope:n,sourceInstinctIds:e.map(e=>e.id),confidence:Number(i.toFixed(2)),content:s,outputPath:o}}async function w(e,t,n){let r=C(e,t),i=await P(`skill`,r,n);for(let t of i){let n=ie(r,t);if(n>=.8)return{action:`append-evidence`,target:t,overlap:n,appendedPath:await ne(t,e)}}return{action:`create`,draft:r}}async function ne(e,t){let n=await f(e.path,`utf8`).catch(()=>e.content);if(Buffer.byteLength(n,`utf8`)>=M)return e.path;let r=t.flatMap(e=>e.evidence.map(e=>`- ${e}`)),a=r.slice(0,A);a.length<r.length&&a.push(`- [... ${r.length-a.length} more evidence entries omitted]`);let o=[``,`## Learned evidence (${new Date().toISOString()})`,``,...a,``].join(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DcaKZlRU.js";import{o as r,t as i}from"./localSearch-Cvs9WfoX.js";import{l as a,u as o}from"./instinctParser-Dt-lqnDe.js";import{basename as s,dirname as c,join as l}from"node:path";import{existsSync as u}from"node:fs";import{mkdir as d,readFile as f,readdir as p,rename as m,rm as ee,writeFile as h}from"node:fs/promises";function g(e){return e.length!==0&&e.reduce((e,t)=>e+t.confidence,0)/e.length>=a().minConfidence}function te(e){let t=e[0]?.domain??`project`,n=b[t],r=new Set;for(let t of e){for(let e of`${t.trigger} ${t.action}`.toLowerCase().split(/[^a-z0-9]+/))if(y(e)&&r.add(e),r.size>=5)break;if(r.size>=5)break}let i=_([n,...r].join(`-`));return v(i)?`${n}-learned-pattern`:i}function _(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,64).replace(/-$/g,``)||`learned-skill`}function v(e){return x.has(e)}function y(e){return e.length>2&&![`when`,`with`,`this`,`that`,`user`,`project`,`prefer`,`avoid`,`use`,`using`,`the`,`and`,`for`].includes(e)}var b,x,S=e((()=>{o(),b={workflow:`workflow`,testing:`testing`,debugging:`debugging`,"code-style":`style`,security:`security`,git:`git`,project:`project`},x=new Set([`learned-skill`,`better-skill`,`new-skill`,`project-skill`,`workflow-skill`])}));function C(e,t){if(e.length===0)throw Error(`Cannot generate a skill draft without instincts`);let n=t?.scope??e[0]?.scope??`project`,r=t?.name?_(t.name):E(e),i=e.reduce((e,t)=>e+t.confidence,0)/e.length,a=t?.description??D(e),o=re(r,n,t),s=O({name:r,description:a,confidence:i,instincts:e});return{name:r,description:a,scope:n,sourceInstinctIds:e.map(e=>e.id),confidence:Number(i.toFixed(2)),content:s,outputPath:o}}async function w(e,t,n){let r=C(e,t),i=await P(`skill`,r,n);for(let t of i){let n=ie(r,t);if(n>=.8)return{action:`append-evidence`,target:t,overlap:n,appendedPath:await ne(t,e)}}return{action:`create`,draft:r}}async function ne(e,t){let n=await f(e.path,`utf8`).catch(()=>e.content);if(Buffer.byteLength(n,`utf8`)>=M)return e.path;let r=t.flatMap(e=>e.evidence.map(e=>`- ${e}`)),a=r.slice(0,A);a.length<r.length&&a.push(`- [... ${r.length-a.length} more evidence entries omitted]`);let o=[``,`## Learned evidence (${new Date().toISOString()})`,``,...a,``].join(`
2
2
  `),s=n.endsWith(`
3
- `)?n+o:`${n}\n${o}`,c=Buffer.byteLength(s,`utf8`)>M?s.slice(0,M):s;return await h(e.path,c,`utf8`),i(),e.path}async function T(e){await d(e.outputPath,{recursive:!0});let t=l(e.outputPath,`SKILL.md`);await h(t,e.content,`utf8`),i();try{let{clearCommandsCache:e}=await import(`./commands-DTB0Qzd5.js`);e()}catch{}return t}function re(e,n,r){return r?.outputRoot?l(r.outputRoot,e):n===`project`?l(r?.cwd??process.cwd(),`.workmate`,`skills`,e):l(r?.globalSkillsDir??l(t(),`skills`),e)}function E(e){return te(e)}function D(e){let t=(e[0]?.action??`Apply a learned project pattern`).replace(/\s+/g,` `).slice(0,120);return t.length>0?t:`Apply learned project patterns`}function O(e){let{name:t,description:n,confidence:r,instincts:i}=e;return[`---`,`name: ${t}`,`description: ${JSON.stringify(n)}`,`origin: skill-learning`,`confidence: ${Number(r.toFixed(2))}`,`evolved_from: [${i.map(e=>JSON.stringify(e.id)).join(`, `)}]`,`---`,``,`# ${k(t)}`,``,`## Trigger`,``,i.map(e=>`- ${e.trigger}`).join(`
3
+ `)?n+o:`${n}\n${o}`,c=Buffer.byteLength(s,`utf8`)>M?s.slice(0,M):s;return await h(e.path,c,`utf8`),i(),e.path}async function T(e){await d(e.outputPath,{recursive:!0});let t=l(e.outputPath,`SKILL.md`);await h(t,e.content,`utf8`),i();try{let{clearCommandsCache:e}=await import(`./commands-BKLsl6gK.js`);e()}catch{}return t}function re(e,n,r){return r?.outputRoot?l(r.outputRoot,e):n===`project`?l(r?.cwd??process.cwd(),`.workmate`,`skills`,e):l(r?.globalSkillsDir??l(t(),`skills`),e)}function E(e){return te(e)}function D(e){let t=(e[0]?.action??`Apply a learned project pattern`).replace(/\s+/g,` `).slice(0,120);return t.length>0?t:`Apply learned project patterns`}function O(e){let{name:t,description:n,confidence:r,instincts:i}=e;return[`---`,`name: ${t}`,`description: ${JSON.stringify(n)}`,`origin: skill-learning`,`confidence: ${Number(r.toFixed(2))}`,`evolved_from: [${i.map(e=>JSON.stringify(e.id)).join(`, `)}]`,`---`,``,`# ${k(t)}`,``,`## Trigger`,``,i.map(e=>`- ${e.trigger}`).join(`
4
4
  `),``,`## Action`,``,i.map(e=>`- ${e.action}`).join(`
5
5
  `),``,`## Evidence`,``,i.flatMap(e=>e.evidence.map(e=>`- ${e}`)).slice(0,j).join(`
6
6
  `),``].join(`
@@ -1,6 +1,6 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{NT as n,PT as r,ad as i,nd as a}from"./loadAgentsDir-JrGMJN05.js";import{I as o,P as s,ai as c,hn as l,t as u,y as d}from"./src-DL3w8VPk2.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";function p(){return[`Skill Search (自动技能匹配)`,`Status: ${r()?`enabled`:`disabled`}`,``,`When enabled, relevant skills are automatically matched and`,`injected into conversation context each turn.`].join(`
2
- `)}async function m(){if(r()&&process.env.SKILL_SEARCH_ENABLED!==`0`)return`Skill Search: already enabled`;process.env.SKILL_SEARCH_ENABLED=`1`;let e=[`Skill Search: enabled (SKILL_SEARCH_ENABLED=1)`];try{let{clearSkillIndexCache:t}=await import(`./localSearch-hOERAH9v.js`);t(),e.push(`Skill index cache: cleared (will rebuild on next search)`)}catch{e.push(`Skill index cache: clear skipped`)}return e.join(`
3
- `)}async function h(){return r()?(process.env.SKILL_SEARCH_ENABLED=`0`,`Skill Search: disabled (SKILL_SEARCH_ENABLED=0)`):`Skill Search: already disabled`}function g({onDone:e}){i(`skill-search-panel`);let[t,n]=(0,v.useState)(0),r=(0,v.useMemo)(()=>[{label:`Status`,description:`显示自动 skill 匹配是否已启用`,run:()=>Promise.resolve(p())},{label:`Start`,description:`为本次会话启用自动 skill 匹配`,run:m},{label:`Stop`,description:`为本次会话禁用自动 skill 匹配`,run:h},{label:`About`,description:`自动 skill 匹配的工作原理`,run:()=>Promise.resolve(x)}],[]),a=()=>{let n=r[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return l((e,t)=>{if(t.upArrow){n(e=>Math.max(0,e-1));return}if(t.downArrow){n(e=>Math.min(r.length-1,e+1));return}t.return&&a()}),(0,y.jsx)(d,{title:`Skill Search`,subtitle:`${r.length} actions`,onCancel:()=>e(`Skill search panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,y.jsxs)(o,{flexDirection:`column`,children:[r.map((e,n)=>(0,y.jsxs)(o,{flexDirection:`row`,children:[(0,y.jsx)(s,{children:`${n===t?`›`:` `} ${e.label}`.padEnd(b)}),(0,y.jsx)(s,{dimColor:!0,children:e.description})]},e.label)),(0,y.jsx)(o,{marginTop:1,children:(0,y.jsx)(s,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function _(e,t,n){let r=n?.trim()??``;return r===`start`?(e(await m(),{display:`system`}),null):r===`stop`?(e(await h(),{display:`system`}),null):r===`about`?(e(x,{display:`system`}),null):r===`status`?(e(p(),{display:`system`}),null):(0,y.jsx)(g,{onDone:e})}var v,y,b,x;e((()=>{v=t(c(),1),u(),a(),n(),y=f(),b=28,x=`# Skill Search (自动技能匹配)
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{MT as n,ad as r,jT as i,nd as a}from"./loadAgentsDir-PPiD2Mfq.js";import{I as o,P as s,ai as c,hn as l,t as u,y as d}from"./src-DL3w8VPk2.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";function p(){return[`Skill Search (自动技能匹配)`,`Status: ${n()?`enabled`:`disabled`}`,``,`When enabled, relevant skills are automatically matched and`,`injected into conversation context each turn.`].join(`
2
+ `)}async function m(){if(n()&&process.env.SKILL_SEARCH_ENABLED!==`0`)return`Skill Search: already enabled`;process.env.SKILL_SEARCH_ENABLED=`1`;let e=[`Skill Search: enabled (SKILL_SEARCH_ENABLED=1)`];try{let{clearSkillIndexCache:t}=await import(`./localSearch-CDk_stXJ.js`);t(),e.push(`Skill index cache: cleared (will rebuild on next search)`)}catch{e.push(`Skill index cache: clear skipped`)}return e.join(`
3
+ `)}async function h(){return n()?(process.env.SKILL_SEARCH_ENABLED=`0`,`Skill Search: disabled (SKILL_SEARCH_ENABLED=0)`):`Skill Search: already disabled`}function g({onDone:e}){r(`skill-search-panel`);let[t,n]=(0,v.useState)(0),i=(0,v.useMemo)(()=>[{label:`Status`,description:`显示自动 skill 匹配是否已启用`,run:()=>Promise.resolve(p())},{label:`Start`,description:`为本次会话启用自动 skill 匹配`,run:m},{label:`Stop`,description:`为本次会话禁用自动 skill 匹配`,run:h},{label:`About`,description:`自动 skill 匹配的工作原理`,run:()=>Promise.resolve(x)}],[]),a=()=>{let n=i[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return l((e,t)=>{if(t.upArrow){n(e=>Math.max(0,e-1));return}if(t.downArrow){n(e=>Math.min(i.length-1,e+1));return}t.return&&a()}),(0,y.jsx)(d,{title:`Skill Search`,subtitle:`${i.length} actions`,onCancel:()=>e(`Skill search panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,y.jsxs)(o,{flexDirection:`column`,children:[i.map((e,n)=>(0,y.jsxs)(o,{flexDirection:`row`,children:[(0,y.jsx)(s,{children:`${n===t?`›`:` `} ${e.label}`.padEnd(b)}),(0,y.jsx)(s,{dimColor:!0,children:e.description})]},e.label)),(0,y.jsx)(o,{marginTop:1,children:(0,y.jsx)(s,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function _(e,t,n){let r=n?.trim()??``;return r===`start`?(e(await m(),{display:`system`}),null):r===`stop`?(e(await h(),{display:`system`}),null):r===`about`?(e(x,{display:`system`}),null):r===`status`?(e(p(),{display:`system`}),null):(0,y.jsx)(g,{onDone:e})}var v,y,b,x;e((()=>{v=t(c(),1),u(),a(),i(),y=f(),b=28,x=`# Skill Search (自动技能匹配)
4
4
 
5
5
  Skill Search 控制对话中的自动技能匹配功能。
6
6
 
@@ -17,5 +17,5 @@ Skill Search 控制对话中的自动技能匹配功能。
17
17
  - /skill-search stop — 禁用自动匹配
18
18
  - /skill-search status — 查看当前状态
19
19
 
20
- 当前状态: ${r()?`已启用`:`未启用`}
20
+ 当前状态: ${n()?`已启用`:`未启用`}
21
21
  `}))();export{_ as call};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Dp as n,Ji as r,Li as i,Op as a,Xi as o,zi as s}from"./loadAgentsDir-JrGMJN05.js";import{I as c,P as l,ai as u,h as d,t as f,y as p}from"./src-DL3w8VPk2.js";import{t as m}from"./jsx-runtime-Bb4Xn-E0.js";import{ln as h,sn as g}from"./settings-aUygByiZ.js";import{_,v}from"./startupProfiler-2sjXZkIP.js";import{l as y,o as b}from"./stringUtils-BjnclTLB.js";function x(e,t){let n=t.trim();if(n===``)return e.slice();let r=n.toLowerCase().split(/\s+/);return e.filter(e=>{let t=`${e.name} ${e.description}`.toLowerCase();return r.every(e=>t.includes(e))})}var S=e((()=>{}));function C(e){return e===`plugin`?`plugin`:e===`mcp`?`mcp`:g(e)}function w({onExit:e,commands:t}){let[i,a]=(0,T.useState)(``),o=(0,T.useMemo)(()=>t.filter(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`commands_DEPRECATED`||e.loadedFrom===`plugin`||e.loadedFrom===`mcp`)),[t]),u=(0,T.useMemo)(()=>x(o.map(e=>({...e,name:s(e),description:e.description??``})),i),[o,i]),f=(0,T.useMemo)(()=>{let e={policySettings:[],userSettings:[],projectSettings:[],localSettings:[],flagSettings:[],plugin:[],mcp:[]};for(let t of u){let n=t.source;n in e&&e[n].push(t)}for(let t of Object.values(e))t.sort((e,t)=>s(e).localeCompare(s(t)));return e},[u]),m=()=>{e(`Skills dialog dismissed`,{display:`system`})};if(o.length===0)return(0,E.jsxs)(p,{title:`Skills`,subtitle:`No skills found`,onCancel:m,hideInputGuide:!0,children:[(0,E.jsx)(l,{dimColor:!0,children:`Create skills in .workmate/skills/ or ~/.workmate/skills/`}),(0,E.jsx)(l,{dimColor:!0,italic:!0,children:(0,E.jsx)(n,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`close`})})]});let h=e=>{switch(e){case`projectSettings`:case`localSettings`:return{label:`local`,color:`yellow`};case`userSettings`:return{label:`global`,color:`cyan`};case`policySettings`:return{label:`managed`,color:`magenta`};default:return}},g=(e,t)=>{let n=`~${_(r(e))}`,i=e.source===`plugin`?e.pluginInfo?.pluginManifest.name:void 0,a=h(e.source);return(0,E.jsxs)(c,{children:[(0,E.jsx)(l,{color:t?`suggestion`:void 0,children:s(e)}),a&&(0,E.jsxs)(l,{color:a.color,children:[` [`,a.label,`]`]}),(0,E.jsxs)(l,{dimColor:!0,children:[i?` · ${i}`:``,` · `,C(e.source),` · `,n,` tokens`]})]})};return(0,E.jsx)(d,{title:`Skills`,placeholder:`Type to filter skills…`,items:(0,T.useMemo)(()=>D.flatMap(e=>f[e]),[f]),getKey:e=>`${e.name}-${e.source}`,visibleCount:12,direction:`down`,onQueryChange:a,onSelect:t=>{e(`/${s(t)}`,{display:`user`})},onCancel:m,emptyMessage:e=>e.trim()?`No skills matching "${e.trim()}"`:`No skills found`,matchLabel:i.trim()===``?`${o.length} ${y(o.length,`skill`)}`:`${u.length}/${o.length} ${y(o.length,`skill`)}`,selectAction:`invoke skill`,renderItem:(e,t)=>g(e,t)})}var T,E,D,O=e((()=>{T=t(u(),1),i(),f(),o(),v(),h(),b(),a(),S(),E=m(),D=[`projectSettings`,`localSettings`,`userSettings`,`flagSettings`,`policySettings`,`plugin`,`mcp`]}));async function k(e,t){return(0,A.jsx)(w,{onExit:e,commands:t.options.commands})}var A;e((()=>{O(),A=m()}))();export{k as call};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Dp as n,Ji as r,Li as i,Op as a,Xi as o,zi as s}from"./loadAgentsDir-PPiD2Mfq.js";import{I as c,P as l,ai as u,h as d,t as f,y as p}from"./src-DL3w8VPk2.js";import{t as m}from"./jsx-runtime-Bb4Xn-E0.js";import{ln as h,sn as g}from"./settings-CvhsRFaT.js";import{_,v}from"./startupProfiler-2sjXZkIP.js";import{l as y,o as b}from"./stringUtils-BjnclTLB.js";function x(e,t){let n=t.trim();if(n===``)return e.slice();let r=n.toLowerCase().split(/\s+/);return e.filter(e=>{let t=`${e.name} ${e.description}`.toLowerCase();return r.every(e=>t.includes(e))})}var S=e((()=>{}));function C(e){return e===`plugin`?`plugin`:e===`mcp`?`mcp`:g(e)}function w({onExit:e,commands:t}){let[i,a]=(0,T.useState)(``),o=(0,T.useMemo)(()=>t.filter(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`commands_DEPRECATED`||e.loadedFrom===`plugin`||e.loadedFrom===`mcp`)),[t]),u=(0,T.useMemo)(()=>x(o.map(e=>({...e,name:s(e),description:e.description??``})),i),[o,i]),f=(0,T.useMemo)(()=>{let e={policySettings:[],userSettings:[],projectSettings:[],localSettings:[],flagSettings:[],plugin:[],mcp:[]};for(let t of u){let n=t.source;n in e&&e[n].push(t)}for(let t of Object.values(e))t.sort((e,t)=>s(e).localeCompare(s(t)));return e},[u]),m=()=>{e(`Skills dialog dismissed`,{display:`system`})};if(o.length===0)return(0,E.jsxs)(p,{title:`Skills`,subtitle:`No skills found`,onCancel:m,hideInputGuide:!0,children:[(0,E.jsx)(l,{dimColor:!0,children:`Create skills in .workmate/skills/ or ~/.workmate/skills/`}),(0,E.jsx)(l,{dimColor:!0,italic:!0,children:(0,E.jsx)(n,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`close`})})]});let h=e=>{switch(e){case`projectSettings`:case`localSettings`:return{label:`local`,color:`yellow`};case`userSettings`:return{label:`global`,color:`cyan`};case`policySettings`:return{label:`managed`,color:`magenta`};default:return}},g=(e,t)=>{let n=`~${_(r(e))}`,i=e.source===`plugin`?e.pluginInfo?.pluginManifest.name:void 0,a=h(e.source);return(0,E.jsxs)(c,{children:[(0,E.jsx)(l,{color:t?`suggestion`:void 0,children:s(e)}),a&&(0,E.jsxs)(l,{color:a.color,children:[` [`,a.label,`]`]}),(0,E.jsxs)(l,{dimColor:!0,children:[i?` · ${i}`:``,` · `,C(e.source),` · `,n,` tokens`]})]})};return(0,E.jsx)(d,{title:`Skills`,placeholder:`Type to filter skills…`,items:(0,T.useMemo)(()=>D.flatMap(e=>f[e]),[f]),getKey:e=>`${e.name}-${e.source}`,visibleCount:12,direction:`down`,onQueryChange:a,onSelect:t=>{e(`/${s(t)}`,{display:`user`})},onCancel:m,emptyMessage:e=>e.trim()?`No skills matching "${e.trim()}"`:`No skills found`,matchLabel:i.trim()===``?`${o.length} ${y(o.length,`skill`)}`:`${u.length}/${o.length} ${y(o.length,`skill`)}`,selectAction:`invoke skill`,renderItem:(e,t)=>g(e,t)})}var T,E,D,O=e((()=>{T=t(u(),1),i(),f(),o(),v(),h(),b(),a(),S(),E=m(),D=[`projectSettings`,`localSettings`,`userSettings`,`flagSettings`,`policySettings`,`plugin`,`mcp`]}));async function k(e,t){return(0,A.jsx)(w,{onExit:e,commands:t.options.commands})}var A;e((()=>{O(),A=m()}))();export{k as call};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t}from"./src-DL3w8VPk2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{h as r,v as i}from"./config-BkbL2e5Q.js";var a=e(t(),1);r();var o=n();function s(e,t){let n=t/100*(e.length-1),r=Math.floor(n),i=Math.ceil(n);return r===i?e[r]:e[r]+(e[i]-e[r])*(n-r)}var c=1024;function l(){let e=new Map,t=new Map,n=new Map;return{increment(t,n=1){e.set(t,(e.get(t)??0)+n)},set(t,n){e.set(t,n)},observe(e,n){let r=t.get(e);if(r||(r={reservoir:[],count:0,sum:0,min:n,max:n},t.set(e,r)),r.count++,r.sum+=n,n<r.min&&(r.min=n),n>r.max&&(r.max=n),r.reservoir.length<c)r.reservoir.push(n);else{let e=Math.floor(Math.random()*r.count);e<c&&(r.reservoir[e]=n)}},add(e,t){let r=n.get(e);r||(r=new Set,n.set(e,r)),r.add(t)},getAll(){let r=Object.fromEntries(e);for(let[e,n]of t){if(n.count===0)continue;r[`${e}_count`]=n.count,r[`${e}_min`]=n.min,r[`${e}_max`]=n.max,r[`${e}_avg`]=n.sum/n.count;let t=[...n.reservoir].sort((e,t)=>e-t);r[`${e}_p50`]=s(t,50),r[`${e}_p95`]=s(t,95),r[`${e}_p99`]=s(t,99)}for(let[e,t]of n)r[e]=t.size;return r}}}var u=(0,a.createContext)(null);function d({store:e,children:t}){let n=(0,a.useMemo)(()=>l(),[]),r=e??n;return(0,a.useEffect)(()=>{let e=()=>{let e=r.getAll();Object.keys(e).length>0&&i(t=>({...t,lastSessionMetrics:e}))};return process.on(`exit`,e),()=>{process.off(`exit`,e)}},[r]),(0,o.jsx)(u.Provider,{value:r,children:t})}export{l as n,d as t};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t}from"./src-DL3w8VPk2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{h as r,v as i}from"./config-BSkuQZNf.js";var a=e(t(),1);r();var o=n();function s(e,t){let n=t/100*(e.length-1),r=Math.floor(n),i=Math.ceil(n);return r===i?e[r]:e[r]+(e[i]-e[r])*(n-r)}var c=1024;function l(){let e=new Map,t=new Map,n=new Map;return{increment(t,n=1){e.set(t,(e.get(t)??0)+n)},set(t,n){e.set(t,n)},observe(e,n){let r=t.get(e);if(r||(r={reservoir:[],count:0,sum:0,min:n,max:n},t.set(e,r)),r.count++,r.sum+=n,n<r.min&&(r.min=n),n>r.max&&(r.max=n),r.reservoir.length<c)r.reservoir.push(n);else{let e=Math.floor(Math.random()*r.count);e<c&&(r.reservoir[e]=n)}},add(e,t){let r=n.get(e);r||(r=new Set,n.set(e,r)),r.add(t)},getAll(){let r=Object.fromEntries(e);for(let[e,n]of t){if(n.count===0)continue;r[`${e}_count`]=n.count,r[`${e}_min`]=n.min,r[`${e}_max`]=n.max,r[`${e}_avg`]=n.sum/n.count;let t=[...n.reservoir].sort((e,t)=>e-t);r[`${e}_p50`]=s(t,50),r[`${e}_p95`]=s(t,95),r[`${e}_p99`]=s(t,99)}for(let[e,t]of n)r[e]=t.size;return r}}}var u=(0,a.createContext)(null);function d({store:e,children:t}){let n=(0,a.useMemo)(()=>l(),[]),r=e??n;return(0,a.useEffect)(()=>{let e=()=>{let e=r.getAll();Object.keys(e).length>0&&i(t=>({...t,lastSessionMetrics:e}))};return process.on(`exit`,e),()=>{process.off(`exit`,e)}},[r]),(0,o.jsx)(u.Provider,{value:r,children:t})}export{l as n,d as t};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,n,o as r,t as i}from"./envUtils-DcaKZlRU.js";import{n as a,t as o}from"./figures-5ThXQEtq.js";import{By as s,Ky as c,Uy as l,Wy as ee,_b as u,fb as d,lb as f,ob as p}from"./loadAgentsDir-PPiD2Mfq.js";import{P as m,di as h,fi as g,j as _,t as v}from"./src-DL3w8VPk2.js";import{t as y}from"./jsx-runtime-Bb4Xn-E0.js";import{a as b,an as x,c as S,g as C,in as w,ln as T,r as E,wn as D,xn as O}from"./settings-CvhsRFaT.js";import{f as k,v as A}from"./startupProfiler-2sjXZkIP.js";import{$r as j,Pt as M,_ as N,i as te,mt as P,ti as F,x as I,zt as L}from"./model-sviY1inu.js";import{h as R,l as z,o as B,p as V}from"./proxy-C0j74LqT.js";import{g as H,h as U}from"./pidLock-DuMVSwnN.js";import{n as W,t as G}from"./nativeInstaller-N1xiUpCP.js";import{n as K,t as q}from"./allErrors-DRiW7i6Y.js";function J(){return[]}function Y(e,t=null,n){let r=e?.find(e=>e.name===`ide`);if(t){let e=u(t.ideType),i=d(t.ideType)?`plugin`:`extension`;if(t.error)return[{label:`IDE`,value:(0,$.jsxs)(m,{children:[_(`error`,n)(o.cross),` Error installing `,e,` `,i,`:`,` `,t.error,`
2
+ `,`Please restart your IDE and try again.`]})}];if(t.installed)return r&&r.type===`connected`?t.installedVersion===r.serverInfo?.version?[{label:`IDE`,value:`Connected to ${e} ${i} version ${t.installedVersion}`}]:[{label:`IDE`,value:`Connected to ${e} ${i} version ${t.installedVersion} (server version: ${r.serverInfo?.version})`}]:[{label:`IDE`,value:`Installed ${e} ${i}`}]}else if(r){let e=p(r)??`IDE`;return r.type===`connected`?[{label:`IDE`,value:`Connected to ${e} extension`}]:[{label:`IDE`,value:`${_(`error`,n)(o.cross)} Not connected to ${e}`}]}return[]}function X(e=[],t){let n=e.filter(e=>e.name!==`ide`);if(!n.length)return[];let r={connected:0,pending:0,needsAuth:0,failed:0};for(let e of n)e.type===`connected`?r.connected++:e.type===`pending`?r.pending++:e.type===`needs-auth`?r.needsAuth++:r.failed++;let i=[];return r.connected&&i.push(_(`success`,t)(`${r.connected} connected`)),r.needsAuth&&i.push(_(`warning`,t)(`${r.needsAuth} need auth`)),r.pending&&i.push(_(`inactive`,t)(`${r.pending} pending`)),r.failed&&i.push(_(`error`,t)(`${r.failed} failed`)),[{label:`MCP servers`,value:`${i.join(`, `)} ${_(`inactive`,t)(`· /mcp`)}`}]}async function Z(){let e=l(await ee()),t=[];return e.forEach(e=>{let n=O(e.path);t.push(`Large ${n} will impact performance (${k(e.content.length)} chars > ${k(s)})`)}),t}function Q(){return[{label:`Setting sources`,value:w().filter(e=>{let t=S(e);return t!==null&&Object.keys(t).length>0}).map(e=>{if(e===`policySettings`){let e=b();if(e===null)return null;switch(e){case`remote`:return`Enterprise managed settings (remote)`;case`plist`:return`Enterprise managed settings (plist)`;case`hklm`:return`Enterprise managed settings (HKLM)`;case`file`:{let{hasBase:e,hasDropIns:t}=E();return e&&t?`Enterprise managed settings (file + drop-ins)`:t?`Enterprise managed settings (drop-ins)`:`Enterprise managed settings (file)`}case`hkcu`:return`Enterprise managed settings (HKCU)`}}return x(e)}).filter(e=>e!==null)}]}async function ne(){return(await W()).map(e=>e.message)}async function re(){let e=await U(),t=[],{errors:n}=q();if(n.length>0){let e=Array.from(new Set(n.map(e=>e.file))).join(`, `);t.push(`Found invalid settings files: ${e}. They will be ignored.`)}return e.warnings.forEach(e=>{t.push(e.issue)}),e.hasUpdatePermissions===!1&&t.push(`No write permissions for auto-updates (requires sudo)`),t}function ie(){let e=P();if(!e)return[];let t=[];return e.subscription&&t.push({label:`Login method`,value:`${e.subscription} Account`}),e.tokenSource&&t.push({label:`Auth token`,value:e.tokenSource}),e.apiKeySource&&t.push({label:`API key`,value:e.apiKeySource}),e.organization&&!process.env.IS_DEMO&&t.push({label:`Organization`,value:e.organization}),e.email&&!process.env.IS_DEMO&&t.push({label:`Email`,value:e.email}),t}function ae(){let e=j(),r=[];if(e!==`firstParty`){let t={bedrock:`AWS Bedrock`,vertex:`Google Vertex AI`,foundry:`Microsoft Foundry`,gemini:`Gemini API`,grok:`Grok API`,openai:`OpenAI API`}[e];r.push({label:`API provider`,value:t})}if(e===`firstParty`){let e=process.env.ANTHROPIC_BASE_URL;e&&r.push({label:`API base URL`,value:e})}else if(e===`bedrock`){let e=process.env.BEDROCK_BASE_URL;e&&r.push({label:`Bedrock base URL`,value:e}),r.push({label:`AWS region`,value:i()}),t(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&r.push({value:`AWS auth skipped`})}else if(e===`vertex`){let e=process.env.VERTEX_BASE_URL;e&&r.push({label:`Vertex base URL`,value:e});let i=process.env.ANTHROPIC_VERTEX_PROJECT_ID;i&&r.push({label:`GCP project`,value:i}),r.push({label:`Default region`,value:n()}),t(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&r.push({value:`GCP auth skipped`})}else if(e===`foundry`){let e=process.env.ANTHROPIC_FOUNDRY_BASE_URL;e&&r.push({label:`Microsoft Foundry base URL`,value:e});let n=process.env.ANTHROPIC_FOUNDRY_RESOURCE;n&&r.push({label:`Microsoft Foundry resource`,value:n}),t(process.env.CLAUDE_CODE_SKIP_FOUNDRY_AUTH)&&r.push({value:`Microsoft Foundry auth skipped`})}else if(e===`gemini`){let e=process.env.GEMINI_BASE_URL||`https://generativelanguage.googleapis.com/v1beta`;r.push({label:`Gemini base URL`,value:e})}else if(e===`grok`){let e=process.env.GROK_BASE_URL;r.push({label:`Grok base URL`,value:e})}else if(e===`openai`){let e=process.env.OPENAI_BASE_URL;r.push({label:`OpenAI base URL`,value:e})}let a=B();a&&r.push({label:`Proxy`,value:a});let o=V();return process.env.NODE_EXTRA_CA_CERTS&&r.push({label:`Additional CA cert(s)`,value:process.env.NODE_EXTRA_CA_CERTS}),o&&(o.cert&&process.env.CLAUDE_CODE_CLIENT_CERT&&r.push({label:`mTLS client cert`,value:process.env.CLAUDE_CODE_CLIENT_CERT}),o.key&&process.env.CLAUDE_CODE_CLIENT_KEY&&r.push({label:`mTLS client key`,value:process.env.CLAUDE_CODE_CLIENT_KEY})),r}function oe(e){let t=I(e);if(e===null&&L()){let e=te();t=`${h.bold(`Default`)} ${e}`}return t}var $,se=e((()=>{g(),a(),v(),M(),c(),H(),r(),D(),A(),f(),N(),F(),R(),G(),z(),K(),T(),C(),$=y()}));export{re as a,J as c,se as d,ne as i,Q as l,ie as n,X as o,Y as r,Z as s,ae as t,oe as u};
@@ -0,0 +1 @@
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-ClcLl0C1.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 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$i as t,Qi as n}from"./loadAgentsDir-JrGMJN05.js";function r(e){return e?e.activeAgents.filter(e=>e.source!==`built-in`).reduce((e,n)=>e+t(`${n.agentType}: ${n.whenToUse}`),0):0}var i,a=e((()=>{n(),i=15e3}));export{r as n,a as r,i as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$i as t,Qi as n}from"./loadAgentsDir-PPiD2Mfq.js";function r(e){return e?e.activeAgents.filter(e=>e.source!==`built-in`).reduce((e,n)=>e+t(`${n.agentType}: ${n.whenToUse}`),0):0}var i,a=e((()=>{n(),i=15e3}));export{r as n,a as r,i as t};
@@ -1 +1 @@
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-BCzhAEd0.js`);r();let{applyConfigEnvironmentVariables:i}=await import(`./managedEnv-AEhH_HUs.js`);i(),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-Da6ax5aI.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-Da6ax5aI.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
+ 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-B8KG79EK.js`);i.cache.clear();let{applyConfigEnvironmentVariables:a}=await import(`./managedEnv-XOUMOtEF.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};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./switcher-BIP3rbQn.js";e();export{t as restoreActiveProvider};
@@ -0,0 +1 @@
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-sviY1inu.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 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./BackgroundTasksDialog-9ruzl1jm.js";async function i(e,t){return(0,a.jsx)(r,{toolUseContext:t,onDone:e})}var a;e((()=>{n(),a=t()}))();export{i as call};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./BackgroundTasksDialog-Coc0ecUd.js";async function i(e,t){return(0,a.jsx)(r,{toolUseContext:t,onDone:e})}var a;e((()=>{n(),a=t()}))();export{i as call};
@@ -1 +1 @@
1
- import{cu as e,du as t,gu as n,lu as r,pu as i}from"./loadAgentsDir-JrGMJN05.js";r();export{e as checkOutTeleportedSessionBranch,t as processMessagesForTeleportResume,i as teleportResumeCodeSession,n as validateGitState};
1
+ import{cu as e,du as t,gu as n,lu as r,pu as i}from"./loadAgentsDir-PPiD2Mfq.js";r();export{e as checkOutTeleportedSessionBranch,t as processMessagesForTeleportResume,i as teleportResumeCodeSession,n as validateGitState};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DcaKZlRU.js";import{g as r,h as i,hE as a,m as o,mE as s}from"./loadAgentsDir-JrGMJN05.js";import{basename as c,join as l}from"path";import{appendFileSync as u,mkdirSync as d,readFileSync as f,readdirSync as p,writeFileSync as m}from"fs";import{randomUUID as h}from"crypto";function g(){let e=i(`templates`,process.cwd()),n=l(t(),`templates`);try{return p(n),[...e,n]}catch{return e}}function _(){let e=[],t=new Set;for(let n of g()){let r;try{r=p(n)}catch{continue}for(let i of r){if(!i.endsWith(`.md`))continue;let r=c(i,`.md`);if(t.has(r))continue;t.add(r);let s=l(n,i);try{let{frontmatter:t,content:n}=a(f(s,`utf-8`),s),i=(typeof t.description==`string`?t.description:``)||o(n,`No description`);e.push({name:r,description:i,filePath:s,frontmatter:t,content:n})}catch{}}}return e}function v(e){return _().find(t=>t.name===e)??null}var y=e((()=>{s(),n(),r()}));function b(){return l(t(),`jobs`)}function x(e){return l(b(),e)}function S(e,t,n,r,i){let a=x(e);d(a,{recursive:!0});let o=new Date().toISOString(),s={jobId:e,templateName:t,createdAt:o,updatedAt:o,status:`created`,args:i};return m(l(a,`state.json`),JSON.stringify(s,null,2),`utf-8`),m(l(a,`template.md`),n,`utf-8`),m(l(a,`input.txt`),r,`utf-8`),a}function C(e){try{let t=f(l(x(e),`state.json`),`utf-8`),n=JSON.parse(t);if(typeof n!=`object`||!n)return null;let r=n;return typeof r.jobId!=`string`||typeof r.status!=`string`?null:r}catch{return null}}function w(e,t){let n=x(e),r=C(e);if(!r)return!1;let i=l(n,`replies.jsonl`),a=JSON.stringify({text:t,timestamp:new Date().toISOString()});try{u(i,`${a}\n`,`utf-8`)}catch{m(i,`${a}\n`,`utf-8`)}let o={...r,updatedAt:new Date().toISOString()};return m(l(n,`state.json`),JSON.stringify(o,null,2),`utf-8`),!0}var T=e((()=>{n()}));async function E(e){let t=e[0];switch(t){case`list`:k();break;case`new`:A(e.slice(1));break;case`reply`:j(e.slice(1));break;case`status`:O(e.slice(1));break;default:console.error(`Unknown template command: ${t}`),D(),process.exitCode=1}}function D(){console.log(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DcaKZlRU.js";import{fE as r,g as i,h as a,m as o,pE as s}from"./loadAgentsDir-PPiD2Mfq.js";import{basename as c,join as l}from"path";import{appendFileSync as u,mkdirSync as d,readFileSync as f,readdirSync as p,writeFileSync as m}from"fs";import{randomUUID as h}from"crypto";function g(){let e=a(`templates`,process.cwd()),n=l(t(),`templates`);try{return p(n),[...e,n]}catch{return e}}function _(){let e=[],t=new Set;for(let n of g()){let r;try{r=p(n)}catch{continue}for(let i of r){if(!i.endsWith(`.md`))continue;let r=c(i,`.md`);if(t.has(r))continue;t.add(r);let a=l(n,i);try{let{frontmatter:t,content:n}=s(f(a,`utf-8`),a),i=(typeof t.description==`string`?t.description:``)||o(n,`No description`);e.push({name:r,description:i,filePath:a,frontmatter:t,content:n})}catch{}}}return e}function v(e){return _().find(t=>t.name===e)??null}var y=e((()=>{r(),n(),i()}));function b(){return l(t(),`jobs`)}function x(e){return l(b(),e)}function S(e,t,n,r,i){let a=x(e);d(a,{recursive:!0});let o=new Date().toISOString(),s={jobId:e,templateName:t,createdAt:o,updatedAt:o,status:`created`,args:i};return m(l(a,`state.json`),JSON.stringify(s,null,2),`utf-8`),m(l(a,`template.md`),n,`utf-8`),m(l(a,`input.txt`),r,`utf-8`),a}function C(e){try{let t=f(l(x(e),`state.json`),`utf-8`),n=JSON.parse(t);if(typeof n!=`object`||!n)return null;let r=n;return typeof r.jobId!=`string`||typeof r.status!=`string`?null:r}catch{return null}}function w(e,t){let n=x(e),r=C(e);if(!r)return!1;let i=l(n,`replies.jsonl`),a=JSON.stringify({text:t,timestamp:new Date().toISOString()});try{u(i,`${a}\n`,`utf-8`)}catch{m(i,`${a}\n`,`utf-8`)}let o={...r,updatedAt:new Date().toISOString()};return m(l(n,`state.json`),JSON.stringify(o,null,2),`utf-8`),!0}var T=e((()=>{n()}));async function E(e){let t=e[0];switch(t){case`list`:k();break;case`new`:A(e.slice(1));break;case`reply`:j(e.slice(1));break;case`status`:O(e.slice(1));break;default:console.error(`Unknown template command: ${t}`),D(),process.exitCode=1}}function D(){console.log(`
2
2
  Template Job Commands:
3
3
 
4
4
  claude job list List available templates
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./terminalSetup-CpMNk6dc.js";n();export{s as call,r as getNativeCSIuTerminalDisplayName,a as hasUsedBackslashReturn,e as isShiftEnterKeyBindingInstalled,i as markBackslashReturnUsed,o as setupTerminal,t as shouldOfferTerminalSetup};
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./terminalSetup-JJiXmszo.js";n();export{s as call,r as getNativeCSIuTerminalDisplayName,a as hasUsedBackslashReturn,e as isShiftEnterKeyBindingInstalled,i as markBackslashReturnUsed,o as setupTerminal,t as shouldOfferTerminalSetup};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{Bt as r,di as i,fi as a,j as o,t as s}from"./src-DL3w8VPk2.js";import{n as c,t as l}from"./cwd-Besi3Os3.js";import{C as u,R as d,S as f,V as p,f as ee,u as te,x as ne}from"./debug-BQj6h99Q.js";import{En as m,Kt as h,Yt as g,wn as re}from"./settings-aUygByiZ.js";import{c as _,h as v,o as y,v as b,y as x}from"./config-BkbL2e5Q.js";import{r as S,t as C}from"./execFileNoThrow-DYm1GeGn.js";import{o as w,s as T}from"./log-BlJ7CcKG.js";import{i as ie,o as ae}from"./platform-DVeTi9mp.js";import{d as oe,o as se,s as E}from"./types-BomO8WUz.js";import{homedir as D,platform as O}from"os";import{dirname as ce,join as k}from"path";import{randomBytes as A}from"crypto";import{copyFile as j,mkdir as M,readFile as N,stat as P,writeFile as F}from"fs/promises";import{pathToFileURL as le}from"url";function I(){let e=te().existsSync(k(l(),`AGENTS.md`)),t=m(l());return[{key:`workspace`,text:`Ask Claude to create a new app or clone a repository`,isComplete:!1,isCompletable:!0,isEnabled:t},{key:`agentsmd`,text:`Run /init to create a AGENTS.md file with instructions for Claude`,isComplete:e,isCompletable:!0,isEnabled:!t}]}function L(){return I().filter(({isCompletable:e,isEnabled:t})=>e&&t).every(({isComplete:e})=>e)}function R(){y().hasCompletedProjectOnboarding||L()&&b(e=>({...e,hasCompletedProjectOnboarding:!0}))}function ue(){b(e=>({...e,projectOnboardingSeenCount:e.projectOnboardingSeenCount+1}))}var z,B=e((()=>{n(),v(),c(),re(),ee(),z=t(()=>{let e=y();return e.hasCompletedProjectOnboarding||e.projectOnboardingSeenCount>=4||process.env.IS_DEMO?!1:!L()})}));function V(e){x(t=>({...t,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:e}))}function H(){x(e=>({...e,appleTerminalSetupInProgress:!1}))}function de(){let e=_();return{inProgress:e.appleTerminalSetupInProgress??!1,backupPath:e.appleTerminalBackupPath||null}}function U(){return k(D(),`Library`,`Preferences`,`com.apple.Terminal.plist`)}async function fe(){let e=U(),t=`${e}.bak`;try{let{code:n}=await C(`defaults`,[`export`,`com.apple.Terminal`,e]);if(n!==0)return null;try{await P(e)}catch{return null}return await C(`defaults`,[`export`,`com.apple.Terminal`,t]),V(t),t}catch(e){return T(e),null}}async function W(){let{inProgress:e,backupPath:t}=de();if(!e)return{status:`no_backup`};if(!t)return H(),{status:`no_backup`};try{await P(t)}catch{return H(),{status:`no_backup`}}try{let{code:e}=await C(`defaults`,[`import`,`com.apple.Terminal`,t]);return e===0?(await C(`killall`,[`cfprefsd`]),H(),{status:`restored`}):{status:`failed`,backupPath:t}}catch(e){return T(Error(`Failed to restore Terminal.app settings with: ${e}`)),H(),{status:`failed`,backupPath:t}}}var G=e((()=>{v(),S(),w()}));function pe(){let e=process.env.VSCODE_GIT_ASKPASS_MAIN??``,t=process.env.PATH??``;return e.includes(`.vscode-server`)||e.includes(`.cursor-server`)||e.includes(`.windsurf-server`)||t.includes(`.vscode-server`)||t.includes(`.cursor-server`)||t.includes(`.windsurf-server`)}function me(){return!h.terminal||!(h.terminal in $)?null:$[h.terminal]??null}function K(e){return r()?`\x1b]8;;${le(e).href}\x07${e}\x1b]8;;\x07`:e}function q(){return O()===`darwin`&&h.terminal===`Apple_Terminal`||h.terminal===`vscode`||h.terminal===`cursor`||h.terminal===`windsurf`||h.terminal===`alacritty`||h.terminal===`zed`}async function J(e){let t=``;switch(h.terminal){case`Apple_Terminal`:t=await ye(e);break;case`vscode`:t=await Y(`VSCode`,e);break;case`cursor`:t=await Y(`Cursor`,e);break;case`windsurf`:t=await Y(`Windsurf`,e);break;case`alacritty`:t=await be(e);break;case`zed`:t=await xe(e);break;case null:break}return x(e=>[`vscode`,`cursor`,`windsurf`,`alacritty`,`zed`].includes(h.terminal??``)?e.shiftEnterKeyBindingInstalled===!0?e:{...e,shiftEnterKeyBindingInstalled:!0}:h.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled===!0?e:{...e,optionAsMetaKeyInstalled:!0}:e),R(),t}function he(){return _().shiftEnterKeyBindingInstalled===!0}function ge(){return _().hasUsedBackslashReturn===!0}function _e(){_().hasUsedBackslashReturn||x(e=>({...e,hasUsedBackslashReturn:!0}))}async function ve(e,t,n){if(h.terminal&&h.terminal in $)return e(`Shift+Enter is natively supported in ${$[h.terminal]}.
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{Bt as r,di as i,fi as a,j as o,t as s}from"./src-DL3w8VPk2.js";import{n as c,t as l}from"./cwd-Besi3Os3.js";import{C as u,R as d,S as f,V as p,f as ee,u as te,x as ne}from"./debug-BQj6h99Q.js";import{En as m,Kt as h,Yt as g,wn as re}from"./settings-CvhsRFaT.js";import{c as _,h as v,o as y,v as b,y as x}from"./config-BSkuQZNf.js";import{r as S,t as C}from"./execFileNoThrow-DYm1GeGn.js";import{o as w,s as T}from"./log-BlJ7CcKG.js";import{i as ie,o as ae}from"./platform-DVeTi9mp.js";import{d as oe,o as se,s as E}from"./types-BomO8WUz.js";import{homedir as D,platform as O}from"os";import{dirname as ce,join as k}from"path";import{randomBytes as A}from"crypto";import{copyFile as j,mkdir as M,readFile as N,stat as P,writeFile as F}from"fs/promises";import{pathToFileURL as le}from"url";function I(){let e=te().existsSync(k(l(),`AGENTS.md`)),t=m(l());return[{key:`workspace`,text:`Ask Work Mate to create a new app or clone a repository`,isComplete:!1,isCompletable:!0,isEnabled:t},{key:`agentsmd`,text:`Run /init to create a AGENTS.md file with instructions for Work Mate`,isComplete:e,isCompletable:!0,isEnabled:!t}]}function L(){return I().filter(({isCompletable:e,isEnabled:t})=>e&&t).every(({isComplete:e})=>e)}function R(){y().hasCompletedProjectOnboarding||L()&&b(e=>({...e,hasCompletedProjectOnboarding:!0}))}function ue(){b(e=>({...e,projectOnboardingSeenCount:e.projectOnboardingSeenCount+1}))}var z,B=e((()=>{n(),v(),c(),re(),ee(),z=t(()=>{let e=y();return e.hasCompletedProjectOnboarding||e.projectOnboardingSeenCount>=4||process.env.IS_DEMO?!1:!L()})}));function V(e){x(t=>({...t,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:e}))}function H(){x(e=>({...e,appleTerminalSetupInProgress:!1}))}function de(){let e=_();return{inProgress:e.appleTerminalSetupInProgress??!1,backupPath:e.appleTerminalBackupPath||null}}function U(){return k(D(),`Library`,`Preferences`,`com.apple.Terminal.plist`)}async function fe(){let e=U(),t=`${e}.bak`;try{let{code:n}=await C(`defaults`,[`export`,`com.apple.Terminal`,e]);if(n!==0)return null;try{await P(e)}catch{return null}return await C(`defaults`,[`export`,`com.apple.Terminal`,t]),V(t),t}catch(e){return T(e),null}}async function W(){let{inProgress:e,backupPath:t}=de();if(!e)return{status:`no_backup`};if(!t)return H(),{status:`no_backup`};try{await P(t)}catch{return H(),{status:`no_backup`}}try{let{code:e}=await C(`defaults`,[`import`,`com.apple.Terminal`,t]);return e===0?(await C(`killall`,[`cfprefsd`]),H(),{status:`restored`}):{status:`failed`,backupPath:t}}catch(e){return T(Error(`Failed to restore Terminal.app settings with: ${e}`)),H(),{status:`failed`,backupPath:t}}}var G=e((()=>{v(),S(),w()}));function pe(){let e=process.env.VSCODE_GIT_ASKPASS_MAIN??``,t=process.env.PATH??``;return e.includes(`.vscode-server`)||e.includes(`.cursor-server`)||e.includes(`.windsurf-server`)||t.includes(`.vscode-server`)||t.includes(`.cursor-server`)||t.includes(`.windsurf-server`)}function me(){return!h.terminal||!(h.terminal in $)?null:$[h.terminal]??null}function K(e){return r()?`\x1b]8;;${le(e).href}\x07${e}\x1b]8;;\x07`:e}function q(){return O()===`darwin`&&h.terminal===`Apple_Terminal`||h.terminal===`vscode`||h.terminal===`cursor`||h.terminal===`windsurf`||h.terminal===`alacritty`||h.terminal===`zed`}async function J(e){let t=``;switch(h.terminal){case`Apple_Terminal`:t=await ye(e);break;case`vscode`:t=await Y(`VSCode`,e);break;case`cursor`:t=await Y(`Cursor`,e);break;case`windsurf`:t=await Y(`Windsurf`,e);break;case`alacritty`:t=await be(e);break;case`zed`:t=await xe(e);break;case null:break}return x(e=>[`vscode`,`cursor`,`windsurf`,`alacritty`,`zed`].includes(h.terminal??``)?e.shiftEnterKeyBindingInstalled===!0?e:{...e,shiftEnterKeyBindingInstalled:!0}:h.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled===!0?e:{...e,optionAsMetaKeyInstalled:!0}:e),R(),t}function he(){return _().shiftEnterKeyBindingInstalled===!0}function ge(){return _().hasUsedBackslashReturn===!0}function _e(){_().hasUsedBackslashReturn||x(e=>({...e,hasUsedBackslashReturn:!0}))}async function ve(e,t,n){if(h.terminal&&h.terminal in $)return e(`Shift+Enter is natively supported in ${$[h.terminal]}.
2
2
 
3
3
  No configuration needed. Just use Shift+Enter to add newlines.`),null;if(!q()){let t=h.terminal||`your current terminal`,n=ie(),r=``;return n===`macos`?r=` • macOS: Apple Terminal
4
4
  `:n===`windows`&&(r=` • Windows: Windows Terminal
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,t as n,x as r}from"./src-DL3w8VPk2.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{n as a,t as o}from"./ThemePicker-BrD_T7xF.js";function s({onDone:e}){let[,n]=t();return(0,c.jsx)(r,{color:`permission`,children:(0,c.jsx)(o,{onThemeSelect:t=>{n(t),e(`Theme set to ${t}`)},onCancel:()=>{e(`Theme picker dismissed`,{display:`system`})},skipExitHandling:!0})})}var c,l;e((()=>{n(),a(),c=i(),l=async(e,t)=>(0,c.jsx)(s,{onDone:e})}))();export{l as call};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,t as n,x as r}from"./src-DL3w8VPk2.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{n as a,t as o}from"./ThemePicker-1QQJFOEv.js";function s({onDone:e}){let[,n]=t();return(0,c.jsx)(r,{color:`permission`,children:(0,c.jsx)(o,{onThemeSelect:t=>{n(t),e(`Theme set to ${t}`)},onCancel:()=>{e(`Theme picker dismissed`,{display:`system`})},skipExitHandling:!0})})}var c,l;e((()=>{n(),a(),c=i(),l=async(e,t)=>(0,c.jsx)(s,{onDone:e})}))();export{l as call};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,i as n}from"./debug-BQj6h99Q.js";import{o as r,s as i}from"./log-BlJ7CcKG.js";import{r as a,t as o}from"./observationStore-D0rm3GhP.js";import{randomUUID as s}from"node:crypto";function c(){for(let[e,t]of T)if(t.size>x){let e=t.values(),n=t.size-S;for(let r=0;r<n;r++){let n=e.next();if(n.done)break;t.delete(n.value)}}if(T.size>C){let e=T.size-w,t=0;for(let n of T.keys()){if(t>=e)break;T.delete(n),t++}}}function l(e,t){let n=T.get(e)??new Set;n.add(t),T.delete(e),T.set(e,n),c()}function u(e,t){return T.get(e)?.has(t)??!1}function d(){T.clear()}function f(e){return{id:s(),sessionId:e.sessionId,projectId:e.projectId,projectName:e.projectName,cwd:e.cwd,timestamp:new Date().toISOString(),source:`tool-hook`,turn:e.turn}}function p(){return E||(E=Promise.all([import(`./projectContext-Bw3o5BrN.js`),import(`./featureCheck-JOur3pHb.js`),import(`./runtimeObserver-CxXxUcrm.js`)]).then(([e,t,n])=>({resolveProjectContext:e.resolveProjectContext,isSkillLearningEnabled:t.isSkillLearningEnabled,RUNTIME_SESSION_ID:n.RUNTIME_SESSION_ID,getRuntimeTurn:n.getRuntimeTurn}))),E}function m(){E=void 0}async function h(e,n,r,a){let o;try{let{resolveProjectContext:s,isSkillLearningEnabled:c,RUNTIME_SESSION_ID:l,getRuntimeTurn:u}=await p();if(!c())return a();let d=s(process.cwd());o={sessionId:r.sessionId??l,turn:r.turn??u(),projectId:d.projectId,projectName:d.projectName,cwd:d.cwd,project:d},g(o,e,n).catch(e=>{t(`skill-learning: recordToolStart error`),i(e)})}catch(e){t(`skill-learning: hook setup error`),i(e)}try{let n=await a();return o&&_(o,e,n,`success`).catch(e=>{t(`skill-learning: recordToolComplete error`),i(e)}),n}catch(n){throw o&&v(o,e,n).catch(e=>{t(`skill-learning: recordToolError error`),i(e)}),n}}async function g(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_start`,toolName:t,toolInput:b(n)},{project:e.project})}async function _(e,t,n,r=`success`){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:r},{project:e.project})}async function v(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:`failure`},{project:e.project})}async function y(e,t){return l(e.sessionId,e.turn),o({...f(e),event:`user_message`,messageText:t},{project:e.project})}function b(e){if(e!=null){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}}var x,S,C,w,T,E;e((()=>{a(),n(),r(),x=500,S=250,C=50,w=25,T=new Map}))();export{u as hasToolHookObservationsForTurn,c as pruneEmittedTurns,_ as recordToolComplete,v as recordToolError,g as recordToolStart,y as recordUserCorrection,d as resetToolHookBookkeeping,m as resetToolHookDepsCache,h as runToolCallWithSkillLearningHooks};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,i as n}from"./debug-BQj6h99Q.js";import{o as r,s as i}from"./log-BlJ7CcKG.js";import{r as a,t as o}from"./observationStore-D0rm3GhP.js";import{randomUUID as s}from"node:crypto";function c(){for(let[e,t]of T)if(t.size>x){let e=t.values(),n=t.size-S;for(let r=0;r<n;r++){let n=e.next();if(n.done)break;t.delete(n.value)}}if(T.size>C){let e=T.size-w,t=0;for(let n of T.keys()){if(t>=e)break;T.delete(n),t++}}}function l(e,t){let n=T.get(e)??new Set;n.add(t),T.delete(e),T.set(e,n),c()}function u(e,t){return T.get(e)?.has(t)??!1}function d(){T.clear()}function f(e){return{id:s(),sessionId:e.sessionId,projectId:e.projectId,projectName:e.projectName,cwd:e.cwd,timestamp:new Date().toISOString(),source:`tool-hook`,turn:e.turn}}function p(){return E||(E=Promise.all([import(`./projectContext-Bw3o5BrN.js`),import(`./featureCheck-JOur3pHb.js`),import(`./runtimeObserver-AKOWfdZ_.js`)]).then(([e,t,n])=>({resolveProjectContext:e.resolveProjectContext,isSkillLearningEnabled:t.isSkillLearningEnabled,RUNTIME_SESSION_ID:n.RUNTIME_SESSION_ID,getRuntimeTurn:n.getRuntimeTurn}))),E}function m(){E=void 0}async function h(e,n,r,a){let o;try{let{resolveProjectContext:s,isSkillLearningEnabled:c,RUNTIME_SESSION_ID:l,getRuntimeTurn:u}=await p();if(!c())return a();let d=s(process.cwd());o={sessionId:r.sessionId??l,turn:r.turn??u(),projectId:d.projectId,projectName:d.projectName,cwd:d.cwd,project:d},g(o,e,n).catch(e=>{t(`skill-learning: recordToolStart error`),i(e)})}catch(e){t(`skill-learning: hook setup error`),i(e)}try{let n=await a();return o&&_(o,e,n,`success`).catch(e=>{t(`skill-learning: recordToolComplete error`),i(e)}),n}catch(n){throw o&&v(o,e,n).catch(e=>{t(`skill-learning: recordToolError error`),i(e)}),n}}async function g(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_start`,toolName:t,toolInput:b(n)},{project:e.project})}async function _(e,t,n,r=`success`){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:r},{project:e.project})}async function v(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:`failure`},{project:e.project})}async function y(e,t){return l(e.sessionId,e.turn),o({...f(e),event:`user_message`,messageText:t},{project:e.project})}function b(e){if(e!=null){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}}var x,S,C,w,T,E;e((()=>{a(),n(),r(),x=500,S=250,C=50,w=25,T=new Map}))();export{u as hasToolHookObservationsForTurn,c as pruneEmittedTurns,_ as recordToolComplete,v as recordToolError,g as recordToolStart,y as recordUserCorrection,d as resetToolHookBookkeeping,m as resetToolHookDepsCache,h as runToolCallWithSkillLearningHooks};
@@ -0,0 +1 @@
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-PPiD2Mfq.js";import{n as a,t as o}from"./partition-C1SFDk_L.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 +1 @@
1
- import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{C as a,P as o,R as s,c,i as l,x as u}from"./debug-BQj6h99Q.js";import{d,f}from"./log-BlJ7CcKG.js";import{l as p,u as m}from"./oauth-D38aRTUb.js";import{Bt as h,Cn as g,Sn as _,ft as v}from"./model-CmDF8O9G.js";import{hostname as y}from"os";i(),n(),m(),l(),s(),d(),g(),u();var b=`tengu_sessions_elevated_auth_enforcement`;function x(){return!1}var S=t(()=>process.env.CLAUDE_TRUSTED_DEVICE_TOKEN||_().read()?.trustedDeviceToken);function C(){if(x())return S()}function w(){S.cache?.clear?.()}function T(){if(!x())return;let e=_();try{let t=e.read();t?.trustedDeviceToken&&(delete t.trustedDeviceToken,e.update(t))}catch{}S.cache?.clear?.()}async function E(){try{if(!await!1){c(`[trusted-device] Gate ${b} is off, skipping enrollment`);return}if(process.env.CLAUDE_TRUSTED_DEVICE_TOKEN){c(`[trusted-device] CLAUDE_TRUSTED_DEVICE_TOKEN env var is set, skipping enrollment (env var takes precedence)`);return}let{getClaudeAIOAuthTokens:t}=(h(),e(v)),n=t()?.accessToken;if(!n){c(`[trusted-device] No OAuth token, skipping enrollment`);return}let i=_();if(f()){c(`[trusted-device] Essential traffic only, skipping enrollment`);return}let s=p().BASE_API_URL,l;try{l=await r.post(`${s}/api/auth/trusted_devices`,{display_name:`Work Mate on ${y()} · ${process.platform}`},{headers:{Authorization:`Bearer ${n}`,"Content-Type":`application/json`},timeout:1e4,validateStatus:e=>e<500})}catch(e){c(`[trusted-device] Enrollment request failed: ${o(e)}`);return}if(l.status!==200&&l.status!==201){c(`[trusted-device] Enrollment failed ${l.status}: ${a(l.data).slice(0,200)}`);return}let u=l.data?.device_token;if(!u||typeof u!=`string`){c(`[trusted-device] Enrollment response missing device_token field`);return}try{let e=i.read();if(!e){c(`[trusted-device] Cannot read storage, skipping token persist`);return}e.trustedDeviceToken=u;let t=i.update(e);if(!t.success){c(`[trusted-device] Failed to persist token: ${t.warning??`unknown`}`);return}S.cache?.clear?.(),c(`[trusted-device] Enrolled device_id=${l.data.device_id??`unknown`}`)}catch(e){c(`[trusted-device] Storage write failed: ${o(e)}`)}}catch(e){c(`[trusted-device] Enrollment error: ${o(e)}`)}}export{C as i,w as n,E as r,T as t};
1
+ import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{C as a,P as o,R as s,c,i as l,x as u}from"./debug-BQj6h99Q.js";import{d,f}from"./log-BlJ7CcKG.js";import{l as p,u as m}from"./oauth-D38aRTUb.js";import{Pt as h,_n as g,gn as _,ot as v}from"./model-sviY1inu.js";import{hostname as y}from"os";i(),n(),m(),l(),s(),d(),g(),u();var b=`tengu_sessions_elevated_auth_enforcement`;function x(){return!1}var S=t(()=>process.env.CLAUDE_TRUSTED_DEVICE_TOKEN||_().read()?.trustedDeviceToken);function C(){if(x())return S()}function w(){S.cache?.clear?.()}function T(){if(!x())return;let e=_();try{let t=e.read();t?.trustedDeviceToken&&(delete t.trustedDeviceToken,e.update(t))}catch{}S.cache?.clear?.()}async function E(){try{if(!await!1){c(`[trusted-device] Gate ${b} is off, skipping enrollment`);return}if(process.env.CLAUDE_TRUSTED_DEVICE_TOKEN){c(`[trusted-device] CLAUDE_TRUSTED_DEVICE_TOKEN env var is set, skipping enrollment (env var takes precedence)`);return}let{getClaudeAIOAuthTokens:t}=(h(),e(v)),n=t()?.accessToken;if(!n){c(`[trusted-device] No OAuth token, skipping enrollment`);return}let i=_();if(f()){c(`[trusted-device] Essential traffic only, skipping enrollment`);return}let s=p().BASE_API_URL,l;try{l=await r.post(`${s}/api/auth/trusted_devices`,{display_name:`Work Mate on ${y()} · ${process.platform}`},{headers:{Authorization:`Bearer ${n}`,"Content-Type":`application/json`},timeout:1e4,validateStatus:e=>e<500})}catch(e){c(`[trusted-device] Enrollment request failed: ${o(e)}`);return}if(l.status!==200&&l.status!==201){c(`[trusted-device] Enrollment failed ${l.status}: ${a(l.data).slice(0,200)}`);return}let u=l.data?.device_token;if(!u||typeof u!=`string`){c(`[trusted-device] Enrollment response missing device_token field`);return}try{let e=i.read();if(!e){c(`[trusted-device] Cannot read storage, skipping token persist`);return}e.trustedDeviceToken=u;let t=i.update(e);if(!t.success){c(`[trusted-device] Failed to persist token: ${t.warning??`unknown`}`);return}S.cache?.clear?.(),c(`[trusted-device] Enrolled device_id=${l.data.device_id??`unknown`}`)}catch(e){c(`[trusted-device] Storage write failed: ${o(e)}`)}}catch(e){c(`[trusted-device] Enrollment error: ${o(e)}`)}}export{C as i,w as n,E as r,T as t};
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./trustedDevice-BtXHXu-T.js";export{t as clearTrustedDeviceToken,e as enrollTrustedDevice};