@readmagic/workmate 0.0.2 → 0.0.3

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 (490) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-BgNp7glC.js → AddWorkspaceDirectory-mANiG0xj.js} +1 -1
  2. package/dist/chunks/{App-Coboqa8H.js → App-aUVaOLeo.js} +1 -1
  3. package/dist/chunks/{ApproveApiKey-CYpBbj0k.js → ApproveApiKey-36iUE5CW.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-DPdcp1CQ.js +1 -0
  5. package/dist/chunks/{AssistantSessionChooser-DxKsTdqj.js → AssistantSessionChooser-BLcvdkgb.js} +1 -1
  6. package/dist/chunks/BackgroundTasksDialog-DyjVt81B.js +2 -0
  7. package/dist/chunks/{BypassPermissionsModeDialog-Cx3QGFz-.js → BypassPermissionsModeDialog-CTlpvTuz.js} +1 -1
  8. package/dist/chunks/{ClaudeMdExternalIncludesDialog-BAK9fxwg.js → ClaudeMdExternalIncludesDialog-5pipE8m8.js} +1 -1
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-Dn7Le--z.js +1 -0
  10. package/dist/chunks/ConsoleOAuthFlow-BDr1Vx5K.js +1 -0
  11. package/dist/chunks/{DesktopHandoff-BsHgLlTy.js → DesktopHandoff-Blg1TVut.js} +1 -1
  12. package/dist/chunks/{DiffDialog-BgTW2Znv.js → DiffDialog-CUEpuocY.js} +2 -2
  13. package/dist/chunks/Doctor-B540I-gq.js +1 -0
  14. package/dist/chunks/Doctor-DlE1Mbb9.js +3 -0
  15. package/dist/chunks/ExitFlow-DCIhnP5h.js +2 -0
  16. package/dist/chunks/Feedback-CDTqPqsM.js +2 -0
  17. package/dist/chunks/{Grove-Dsi4yU08.js → Grove-D9lSG_Lh.js} +1 -1
  18. package/dist/chunks/Grove-DLYXL8hv.js +1 -0
  19. package/dist/chunks/{HybridTransport-8qA64lCx.js → HybridTransport-8j0AviF6.js} +4 -4
  20. package/dist/chunks/{InvalidConfigDialog-CAZ1z5WG.js → InvalidConfigDialog-I3t-0nU3.js} +1 -1
  21. package/dist/chunks/{InvalidSettingsDialog-D82Qk_MR.js → InvalidSettingsDialog-BnthOxGT.js} +1 -1
  22. package/dist/chunks/MCPConnectionManager-zdocEDgk.js +1 -0
  23. package/dist/chunks/{McpParsingWarnings-8ZueNqAd.js → McpParsingWarnings-D0XvLirX.js} +1 -1
  24. package/dist/chunks/MessageSelector-BBhCstBa.js +3 -0
  25. package/dist/chunks/Messages-Dv2VrytX.js +11 -0
  26. package/dist/chunks/{Onboarding-CUztnbbv.js → Onboarding-B1WRpoBI.js} +1 -1
  27. package/dist/chunks/{OverageCreditUpsell-DSgrZvMv.js → OverageCreditUpsell-BSmgq089.js} +1 -1
  28. package/dist/chunks/PluginSettings-DN9rpwc_.js +17 -0
  29. package/dist/chunks/{PromptInputFooterSuggestions-IaihWay3.js → PromptInputFooterSuggestions-3rjz6zhK.js} +1 -1
  30. package/dist/chunks/{PromptInputHelpMenu-okS2rQ4k.js → PromptInputHelpMenu-DgDJHZqC.js} +1 -1
  31. package/dist/chunks/QueryEngine-BnaHDZVZ.js +1 -0
  32. package/dist/chunks/REPL-B3RbzeV7.js +1 -0
  33. package/dist/chunks/{REPL-Dto012J0.js → REPL-CA8FEO7J.js} +44 -44
  34. package/dist/chunks/{RemoteCallout-C_UIYnuT.js → RemoteCallout-BFzCx_Pn.js} +1 -1
  35. package/dist/chunks/{RemoteSessionManager-CuSSHAXN.js → RemoteSessionManager-BhUrtejX.js} +2 -2
  36. package/dist/chunks/ResumeConversation-BseKUFRI.js +1 -0
  37. package/dist/chunks/{SSETransport-Chj_yfPv.js → SSETransport-DGIytG74.js} +3 -3
  38. package/dist/chunks/SearchExtraToolsTool-h6OunbMd.js +1 -0
  39. package/dist/chunks/Settings-BvhG1XoW.js +2 -0
  40. package/dist/chunks/{TeleportProgress-DP1a8jit.js → TeleportProgress-Bens06DU.js} +1 -1
  41. package/dist/chunks/{TeleportRepoMismatchDialog-B6sTwXuZ.js → TeleportRepoMismatchDialog-BtLBCZUe.js} +1 -1
  42. package/dist/chunks/{TeleportResumeWrapper-CKUuRQSG.js → TeleportResumeWrapper-t50LfWyN.js} +1 -1
  43. package/dist/chunks/{ThemePicker-Dyq1YVhb.js → ThemePicker-BTfuZZ7E.js} +1 -1
  44. package/dist/chunks/TrustDialog-CgE_pYUK.js +1 -0
  45. package/dist/chunks/{ValidationErrorsList-DUNh4BNa.js → ValidationErrorsList-Bl68E-2-.js} +1 -1
  46. package/dist/chunks/{WelcomeV2-TPbOXGrO.js → WelcomeV2-C93xQYAF.js} +1 -1
  47. package/dist/chunks/{add-dir-Bf_5tCeR.js → add-dir-C3IhJYVH.js} +1 -1
  48. package/dist/chunks/{agentDisplay-CCeYiAta.js → agentDisplay-Cju-aXCx.js} +1 -1
  49. package/dist/chunks/{agents-Bt72Gz1v.js → agents-Bhg0CtXR.js} +7 -7
  50. package/dist/chunks/{agents-T8xHY5Wk.js → agents-Du3FQ82k.js} +1 -1
  51. package/dist/chunks/{allErrors-CDWTJcMw.js → allErrors-DJYCAtab.js} +1 -1
  52. package/dist/chunks/{ant-DRF-v5bA.js → ant-CVvy4SuO.js} +1 -1
  53. package/dist/chunks/api-CI8HXREw.js +1 -0
  54. package/dist/chunks/api-gJBnC8z3.js +1 -0
  55. package/dist/chunks/asciicast-BsWpcxrc.js +1 -0
  56. package/dist/chunks/{asciicast-CQJlNTae.js → asciicast-CbAjUHT_.js} +4 -4
  57. package/dist/chunks/{assistant-z1ojxEET.js → assistant-C_SkUDk_.js} +1 -1
  58. package/dist/chunks/auth-B9V3i5oZ.js +1 -0
  59. package/dist/chunks/auth-CgEABs3i.js +15 -0
  60. package/dist/chunks/auth-fSFfSKy_.js +1 -0
  61. package/dist/chunks/{autoMode-DW_H3i37.js → autoMode-CZyb-mMY.js} +5 -5
  62. package/dist/chunks/{autonomy-46hnmyAi.js → autonomy-BpINX4jw.js} +1 -1
  63. package/dist/chunks/{autonomy-OxhciwYa.js → autonomy-DJZ25xZp.js} +7 -7
  64. package/dist/chunks/{autonomyPanel-CTEjq0Bd.js → autonomyPanel-ssoiIOx5.js} +1 -1
  65. package/dist/chunks/{backgroundHousekeeping-Cpxq4krt.js → backgroundHousekeeping-BHncba6e.js} +3 -3
  66. package/dist/chunks/backgroundHousekeeping-QK8iEXoI.js +1 -0
  67. package/dist/chunks/{banner-BVkLvJiB.js → banner-CWkrK10u.js} +1 -1
  68. package/dist/chunks/bg-B0iMGM9C.js +1 -0
  69. package/dist/chunks/{bg-zWGqkcST.js → bg-WnYN5ifx.js} +2 -2
  70. package/dist/chunks/{branch-DJzijRGm.js → branch-BXo5z2al.js} +1 -1
  71. package/dist/chunks/{bridge-Dpr2AWpc.js → bridge-CbKc1HeD.js} +2 -2
  72. package/dist/chunks/bridgeConfig-CLHy-BiF.js +1 -0
  73. package/dist/chunks/{bridgeConfig-DDF3teRE.js → bridgeConfig-DbqUHe0H.js} +1 -1
  74. package/dist/chunks/bridgeEnabled-BWSUZ7Xg.js +1 -0
  75. package/dist/chunks/{bridgeEnabled-D4JDZd0y.js → bridgeEnabled-CM3SaumJ.js} +1 -1
  76. package/dist/chunks/bridgeMain-BESKzpm0.js +1 -0
  77. package/dist/chunks/bridgeMain-CzhBVCsN.js +68 -0
  78. package/dist/chunks/bridgeMessaging-lfa_v3oi.js +1 -0
  79. package/dist/chunks/bridgePointer-MqLe5Asm.js +1 -0
  80. package/dist/chunks/{browser-BKiu1max.js → browser-BmZuQom6.js} +1 -1
  81. package/dist/chunks/{btw-DG9CCeq4.js → btw-Cp0whJaJ.js} +1 -1
  82. package/dist/chunks/{caches-BB5_91gU.js → caches-CmW7idg5.js} +2 -2
  83. package/dist/chunks/caches-CpqTC0Lb.js +1 -0
  84. package/dist/chunks/ccrClient-BPXmxWHw.js +1 -0
  85. package/dist/chunks/{claudeDesktop-9xfIgkzE.js → claudeDesktop-Cx31Ugjp.js} +1 -1
  86. package/dist/chunks/{clear-ueMvDelv.js → clear-DjGPxX7T.js} +1 -1
  87. package/dist/chunks/{cliLaunch-BJ9o-rIV.js → cliLaunch-BkPAatcs.js} +1 -1
  88. package/dist/chunks/client-DPUvQ6Rf.js +1 -0
  89. package/dist/chunks/{color-B0-MIfsq.js → color-DYYBN52b.js} +1 -1
  90. package/dist/chunks/commands-D7l3P1k9.js +1 -0
  91. package/dist/chunks/commitAttribution-B7NUPJ8E.js +1 -0
  92. package/dist/chunks/{commitAttribution-DKun9CeU.js → commitAttribution-Bmzgtqc6.js} +2 -2
  93. package/dist/chunks/compact-D6xqZN4Q.js +2 -0
  94. package/dist/chunks/{completionCache-CdHCuiqq.js → completionCache-MN3_MqK8.js} +2 -2
  95. package/dist/chunks/completionCache-c4aiyZ_f.js +1 -0
  96. package/dist/chunks/config-DiT2Z8dY.js +3 -0
  97. package/dist/chunks/config-huQaTcNb.js +1 -0
  98. package/dist/chunks/config-qLaiAn7z.js +1 -0
  99. package/dist/chunks/{context-DBswG0EY.js → context-Bh_iUj76.js} +1 -1
  100. package/dist/chunks/context-noninteractive-CNot6jbs.js +1 -0
  101. package/dist/chunks/{context-noninteractive-CTvyNimw.js → context-noninteractive-Cb3EM2Oz.js} +2 -2
  102. package/dist/chunks/conversation-CSpwF3Ha.js +1 -0
  103. package/dist/chunks/conversation-CvCQta8e.js +1 -0
  104. package/dist/chunks/{createSSHSession-BdO35H6o.js → createSSHSession-B0s839mX.js} +5 -5
  105. package/dist/chunks/createSession-GNSNbUbN.js +1 -0
  106. package/dist/chunks/{createSession-Br1g8qSD.js → createSession-VMTMXOHu.js} +1 -1
  107. package/dist/chunks/crossProjectResume-DGpgCUfk.js +40 -0
  108. package/dist/chunks/{daemon-BQiSFjc-.js → daemon-YtZbMQtn.js} +1 -1
  109. package/dist/chunks/datadog-D9rlcN12.js +1 -0
  110. package/dist/chunks/{debug-DiuXEmUq.js → debug-BrXObCdR.js} +1 -1
  111. package/dist/chunks/{debugUtils-3YYWvb3H.js → debugUtils-NO5KtXqi.js} +1 -1
  112. package/dist/chunks/{desktop-W7SA8BFk.js → desktop-DidI-4N5.js} +1 -1
  113. package/dist/chunks/{detached-Cv9gAylK.js → detached-TYk4hMFj.js} +1 -1
  114. package/dist/chunks/{detectRepository-B1PMTLAU.js → detectRepository-BPr0VWNO.js} +1 -1
  115. package/dist/chunks/detectRepository-BTPgN89l.js +1 -0
  116. package/dist/chunks/{diff-CMtRjFUb.js → diff-CZg5qL2n.js} +1 -1
  117. package/dist/chunks/{directoryCompletion-CeV63gvu.js → directoryCompletion-CW2ckkQg.js} +1 -1
  118. package/dist/chunks/doctor-CKUXGCri.js +1 -0
  119. package/dist/chunks/{effort-BAlVDBHq.js → effort-BcvNemuq.js} +2 -2
  120. package/dist/chunks/{entry-DLqeVq5C.js → entry-dA1UCfC0.js} +4 -4
  121. package/dist/chunks/envLessBridgeConfig-BFjJ8Kt4.js +1 -0
  122. package/dist/chunks/envLessBridgeConfig-bei51W3H.js +1 -0
  123. package/dist/chunks/esm-DjGYYlQe.js +1 -0
  124. package/dist/chunks/{execFileNoThrow-DResQRvR.js → execFileNoThrow-D244NytW.js} +1 -1
  125. package/dist/chunks/execSyncWrapper-CCMQShK-.js +1 -0
  126. package/dist/chunks/exit-COMnVxzw.js +1 -0
  127. package/dist/chunks/extra-usage-BTv_OwGN.js +1 -0
  128. package/dist/chunks/extra-usage-By33zGLT.js +1 -0
  129. package/dist/chunks/{extra-usage-core-Dh4rVUI-.js → extra-usage-core-RZMzaH0L.js} +1 -1
  130. package/dist/chunks/{extra-usage-noninteractive-D4Ya5KPm.js → extra-usage-noninteractive-BB-BQ3kh.js} +1 -1
  131. package/dist/chunks/{extraUsage-DtWi8E78.js → extraUsage-CTn9FWSk.js} +1 -1
  132. package/dist/chunks/extractMemories-CXGZGe0h.js +1 -0
  133. package/dist/chunks/fast-BXzdzzXU.js +1 -0
  134. package/dist/chunks/{fast-DkUxqWhE.js → fast-CNXgsvnE.js} +1 -1
  135. package/dist/chunks/{feedback-Cn7Sbqxa.js → feedback-DeJ2gvw2.js} +1 -1
  136. package/dist/chunks/{file-BZriE-XU.js → file-DcZWPH2V.js} +5 -5
  137. package/dist/chunks/firstPartyEventLogger-CQdJn3LV.js +5 -0
  138. package/dist/chunks/firstPartyEventLogger-CdLshdJY.js +1 -0
  139. package/dist/chunks/{flushGate-ebqQZF1t.js → flushGate-CJ73xcaK.js} +1 -1
  140. package/dist/chunks/gemini-Cn9bMXwP.js +1 -0
  141. package/dist/chunks/generateRecap-BO9kzRon.js +1 -0
  142. package/dist/chunks/{generateSessionName-DEAw5x_h.js → generateSessionName-CGpL6ATy.js} +1 -1
  143. package/dist/chunks/{genericProcessUtils-DO7Fy0RJ.js → genericProcessUtils-CdQTApYX.js} +1 -1
  144. package/dist/chunks/git-CbcnOf0E.js +1 -0
  145. package/dist/chunks/git-Do0wJvux.js +6 -0
  146. package/dist/chunks/{githubRepoPathMapping-Tt-LdYFZ.js → githubRepoPathMapping-C4umZ1oC.js} +1 -1
  147. package/dist/chunks/{goal-DCaI1NPN.js → goal-C8Qzl7_i.js} +3 -3
  148. package/dist/chunks/{grok-CKlngG3b.js → grok-CDT9P_BL.js} +1 -1
  149. package/dist/chunks/{grove-DSWe6psK.js → grove-BGXzEyH9.js} +2 -2
  150. package/dist/chunks/{heapdump-OVbV05On.js → heapdump-CFHvdSZv.js} +5 -5
  151. package/dist/chunks/{help-CRtX5VX9.js → help-DUZ7Y7Em.js} +1 -1
  152. package/dist/chunks/{hooks-tpf90xd5.js → hooks-RHwUCXcT.js} +2 -2
  153. package/dist/chunks/hooks-fZ1r0jUF.js +1 -0
  154. package/dist/chunks/{hostGuard-t7QfbijF.js → hostGuard-C5xydXZI.js} +1 -1
  155. package/dist/chunks/inboundAttachments-Cfl4_n0S.js +1 -0
  156. package/dist/chunks/inboundAttachments-YMxf4fmR.js +1 -0
  157. package/dist/chunks/initReplBridge-GH3-LHF4.js +1 -0
  158. package/dist/chunks/install-OkuNmjmB.js +1 -0
  159. package/dist/chunks/{instrumentation--Sx0y1Gk.js → instrumentation-hrXeo-G4.js} +6 -6
  160. package/dist/chunks/{job-D7B35Usp.js → job-DjmIpwJl.js} +1 -1
  161. package/dist/chunks/jwtUtils-DE2GPUcx.js +1 -0
  162. package/dist/chunks/keybindings-B8U17bhs.js +2 -0
  163. package/dist/chunks/{language-8Rnu_qxl.js → language-BA5WprZv.js} +1 -1
  164. package/dist/chunks/language-BbaOTWm3.js +1 -0
  165. package/dist/chunks/{launchAgentsPlatform-CNPkOVzu.js → launchAgentsPlatform-DnxH2SAn.js} +1 -1
  166. package/dist/chunks/{launchLocalMemory-BxmDhENs.js → launchLocalMemory-CgXtGng1.js} +2 -2
  167. package/dist/chunks/{launchLocalVault-DQlTGA-g.js → launchLocalVault-Bs6Km3Ua.js} +3 -3
  168. package/dist/chunks/{launchMemoryStores-EYAwxI8i.js → launchMemoryStores-DxVAIJuB.js} +1 -1
  169. package/dist/chunks/{launchOnboarding-CTu5Zf4E.js → launchOnboarding-Cn0t_o2k.js} +1 -1
  170. package/dist/chunks/{launchSchedule-CeHHSvO7.js → launchSchedule-Chwr3Nzd.js} +1 -1
  171. package/dist/chunks/{launchSkillStore-Bqh2Fru2.js → launchSkillStore-6zxJfWVU.js} +1 -1
  172. package/dist/chunks/{launchTeleport-Crc3XVZX.js → launchTeleport-Ba_Hj13c.js} +1 -1
  173. package/dist/chunks/{launchVault-BHLgpth_.js → launchVault-hGVrHy33.js} +1 -1
  174. package/dist/chunks/{v4-jw6qOKwQ.js → lazySchema-DcIJE_0i.js} +1 -1
  175. package/dist/chunks/loadAgentsDir-BHOyHxwz.js +1 -0
  176. package/dist/chunks/{loadAgentsDir-ZQwvbURI.js → loadAgentsDir-DrDu5yYy.js} +685 -683
  177. package/dist/chunks/loadPluginHooks-s7bvGtns.js +1 -0
  178. package/dist/chunks/localSearch-CebU5BA9.js +1 -0
  179. package/dist/chunks/{localSearch-H0LchlTi.js → localSearch-_bQhk9W6.js} +1 -1
  180. package/dist/chunks/{log-Duzb4o6h.js → log-BMCygSzM.js} +1 -1
  181. package/dist/chunks/{logoV2Utils-5lcUu53m.js → logoV2Utils-CoC4nheD.js} +1 -1
  182. package/dist/chunks/{magicDocs-D1FIPmYg.js → magicDocs-kMjYpjCA.js} +3 -3
  183. package/dist/chunks/{main-B8XtFN2P.js → main-C_rVSWfm.js} +78 -78
  184. package/dist/chunks/{main-CR7cXdgy.js → main-D862LI_d.js} +2 -2
  185. package/dist/chunks/{mappers-DKU4RgE3.js → mappers-D0CNXG32.js} +1 -1
  186. package/dist/chunks/mcp-1ZuFesM9.js +2 -0
  187. package/dist/chunks/mcp-CKvGBEjz.js +1 -0
  188. package/dist/chunks/mcp-DtxIl6aN.js +6 -0
  189. package/dist/chunks/{memoize-DgMjqLtn.js → memoize-B0zhbT8Z.js} +1 -1
  190. package/dist/chunks/{memory-D-Q62bJ7.js → memory-DE2jtkd_.js} +1 -1
  191. package/dist/chunks/{mode-DFZgqKBd.js → mode-B4WIxCMW.js} +2 -2
  192. package/dist/chunks/model-C4RHNhDQ.js +1 -0
  193. package/dist/chunks/model-fi472PRc.js +1 -0
  194. package/dist/chunks/{model-fDWtIRVr.js → model-j9GNZDFr.js} +1 -1
  195. package/dist/chunks/nativeInstaller-DktvrWRd.js +1 -0
  196. package/dist/chunks/{onChangeAppState-DaQ0R9Tw.js → onChangeAppState-CGVeNkt7.js} +1 -1
  197. package/dist/chunks/{openai-DNS0-ivj.js → openai-BSVjSJiF.js} +3 -3
  198. package/dist/chunks/{overageCreditGrant-qHN3tnp2.js → overageCreditGrant-BVxlYgeU.js} +1 -1
  199. package/dist/chunks/{panelCall-BvKpHquo.js → panelCall-Cp6fpQeL.js} +1 -1
  200. package/dist/chunks/parser-Bf6iasPV.js +1 -0
  201. package/dist/chunks/{parser-TYEkLFgh.js → parser-DFwaTGf7.js} +1 -1
  202. package/dist/chunks/{partition-Cv11dD5P.js → partition-RjCtgt9J.js} +1 -1
  203. package/dist/chunks/{passes-DQdM2Ssq.js → passes-ByTLy6pj.js} +1 -1
  204. package/dist/chunks/{path-Cu_AKqg6.js → path-D5U-tm91.js} +1 -1
  205. package/dist/chunks/permissions-B3df_htx.js +3 -0
  206. package/dist/chunks/pidLock-CdNZ0Wfg.js +3 -0
  207. package/dist/chunks/{pipeTransport-7GIO6GCA.js → pipeTransport-CqCnc-Ys.js} +1 -1
  208. package/dist/chunks/{plan-D8dQDl8W.js → plan-BxTA-b4l.js} +1 -1
  209. package/dist/chunks/{platform-B5dCGT8t.js → platform-BrYefG_2.js} +1 -1
  210. package/dist/chunks/{plugin-w8MqsKHn.js → plugin-DOpl5e1t.js} +1 -1
  211. package/dist/chunks/{pluginAutoupdate-7FFHzSRz.js → pluginAutoupdate-L09CQ-ph.js} +1 -1
  212. package/dist/chunks/pluginBlocklist-B32eWmzn.js +1 -0
  213. package/dist/chunks/pluginCliCommands-CDMWnO3d.js +1 -0
  214. package/dist/chunks/{pluginFlagging-_WUQP3Lq.js → pluginFlagging-3FQGvIfq.js} +1 -1
  215. package/dist/chunks/pluginOperations-ClzXYNQe.js +2 -0
  216. package/dist/chunks/{pluginStartupCheck-BelpzwZI.js → pluginStartupCheck-BNd2QNzZ.js} +1 -1
  217. package/dist/chunks/pluginStartupCheck-RiZxW-WU.js +1 -0
  218. package/dist/chunks/plugins-CcDG95Bs.js +4 -0
  219. package/dist/chunks/policyLimits-Bwi9VqDF.js +1 -0
  220. package/dist/chunks/pollConfig-DH2oCtFS.js +1 -0
  221. package/dist/chunks/{poor-D3T_8wwf.js → poor-DekfGNT7.js} +1 -1
  222. package/dist/chunks/poorMode-AE4WNYZo.js +1 -0
  223. package/dist/chunks/{poorMode-BqyVuBu-.js → poorMode-CtcqaiwD.js} +1 -1
  224. package/dist/chunks/print-Cc_QOSPF.js +23 -0
  225. package/dist/chunks/{privacy-settings-D5zxu4Aa.js → privacy-settings-ChNsgGUs.js} +1 -1
  226. package/dist/chunks/processBashCommand-Bx6_oZoE.js +1 -0
  227. package/dist/chunks/processSlashCommand-AltWgIFt.js +5 -0
  228. package/dist/chunks/prompt-C0nU0VK3.js +139 -0
  229. package/dist/chunks/prompt-CYx145pp.js +1 -0
  230. package/dist/chunks/prompt-DH3lKFag.js +1 -0
  231. package/dist/chunks/{promptEditor-D6HzjcMS.js → promptEditor-Cumef6hJ.js} +2 -2
  232. package/dist/chunks/{protocolHandler-BXlx1N7v.js → protocolHandler-z2zxAtB1.js} +4 -4
  233. package/dist/chunks/{proxy-CHnxhNZI.js → proxy-CRN7jYIi.js} +3 -3
  234. package/dist/chunks/{rate-limit-options-1hc-RyNR.js → rate-limit-options-VL7S3SCx.js} +1 -1
  235. package/dist/chunks/rcDebugLog-2-1XSyFV.js +11 -0
  236. package/dist/chunks/reconciler-DHRE_gV2.js +4 -0
  237. package/dist/chunks/{referral-Cu9bEOFE.js → referral-DrebVwqx.js} +1 -1
  238. package/dist/chunks/{refresh-vJbxW4a1.js → refresh-pFezssA8.js} +1 -1
  239. package/dist/chunks/{registerProtocol-B_XbLDQO.js → registerProtocol-CukLQuxJ.js} +3 -3
  240. package/dist/chunks/{release-notes-CavWoMQR.js → release-notes-D7vrFNXp.js} +1 -1
  241. package/dist/chunks/{releaseNotes-Di6OaHF7.js → releaseNotes-CDx2P0fb.js} +2 -2
  242. package/dist/chunks/{reload-plugins-ofeLn07p.js → reload-plugins-CltHfg-l.js} +1 -1
  243. package/dist/chunks/{remote-env-dXzHAuD6.js → remote-env-SvvSuP0J.js} +1 -1
  244. package/dist/chunks/remoteBridgeCore-BOeljn2c.js +1 -0
  245. package/dist/chunks/remoteManagedSettings-CaY_ZH8r.js +1 -0
  246. package/dist/chunks/{rename-CtjP0lop.js → rename-CbqrCCBO.js} +1 -1
  247. package/dist/chunks/{renderOptions-DOXmueQV.js → renderOptions-BUJB9nAm.js} +1 -1
  248. package/dist/chunks/{resume-C5h5JvY1.js → resume-DockJaY9.js} +2 -2
  249. package/dist/chunks/{ripgrep-BN_g-F7X.js → ripgrep-BXmXjAzA.js} +1 -1
  250. package/dist/chunks/ripgrep-BfIpz5uC.js +1 -0
  251. package/dist/chunks/{runtimeObserver-DOZFrqJu.js → runtimeObserver-DSUuYKfs.js} +1 -1
  252. package/dist/chunks/{runtimeObserver-B93v1AxE.js → runtimeObserver-XufSllVw.js} +4 -4
  253. package/dist/chunks/sandbox-adapter-CEZnHq0U.js +1 -0
  254. package/dist/chunks/{sandbox-toggle-TiLGFwaZ.js → sandbox-toggle-CZI5fuK3.js} +1 -1
  255. package/dist/chunks/searchExtraTools-iQfI39wB.js +1 -0
  256. package/dist/chunks/{session-v9tKHhU9.js → session-B-Z3DU9o.js} +2 -2
  257. package/dist/chunks/{sessionDiscovery-4byQKOnc.js → sessionDiscovery-C3pMZkBM.js} +1 -1
  258. package/dist/chunks/sessionFileAccessHooks-DyrZmoA7.js +1 -0
  259. package/dist/chunks/sessionMemory-CqRpgwtU.js +1 -0
  260. package/dist/chunks/sessionMemory-D_HQmhj7.js +1 -0
  261. package/dist/chunks/sessionMemoryUtils-CZOIKrn0.js +1 -0
  262. package/dist/chunks/sessionObserver-B400YG3s.js +1 -0
  263. package/dist/chunks/{sessionObserver-OgY9BUP4.js → sessionObserver-B_09FQKV.js} +1 -1
  264. package/dist/chunks/sessionStorage-DRnvtrpU.js +1 -0
  265. package/dist/chunks/sessionTitle-CmLWNFuX.js +14 -0
  266. package/dist/chunks/{sessionTracing-BBxhPccY.js → sessionTracing-lArOaj9u.js} +3 -3
  267. package/dist/chunks/settings-DfWP5y6X.js +19 -0
  268. package/dist/chunks/settingsSync-BlDk6rsM.js +1 -0
  269. package/dist/chunks/setup-DdbmxSZh.js +3 -0
  270. package/dist/chunks/{shadowedRuleDetection-DDSOFi1W.js → shadowedRuleDetection-E2wF1UjU.js} +1 -1
  271. package/dist/chunks/{shellQuote-yXoC_y5m.js → shellQuote-DkSy9MYE.js} +1 -1
  272. package/dist/chunks/{sideQuestion-CAiA6jAf.js → sideQuestion-BjHCLSR9.js} +1 -1
  273. package/dist/chunks/sinks-Cb--pqr-.js +2 -0
  274. package/dist/chunks/sinks-DbwDBd-E.js +1 -0
  275. package/dist/chunks/{skill-learning-Dx1o4mMo.js → skill-learning-B0dyBT1_.js} +1 -1
  276. package/dist/chunks/skillChangeDetector-DQof8SUY.js +1 -0
  277. package/dist/chunks/{skillGapStore-Zvqiyxds.js → skillGapStore-75ZYlfwi.js} +2 -2
  278. package/dist/chunks/{skillGapStore-BV_6qzxU.js → skillGapStore-D2fqmnKx.js} +1 -1
  279. package/dist/chunks/{skillGenerator-jJQDphQ8.js → skillGenerator-CwXUfM4Y.js} +2 -2
  280. package/dist/chunks/{skillLearning-BTT3_yGc.js → skillLearning-CB-5fdMl.js} +1 -1
  281. package/dist/chunks/skillLearning-CSY5R5Jn.js +1 -0
  282. package/dist/chunks/{skillPanel-OW2M6SZr.js → skillPanel-Bum7xpgo.js} +3 -3
  283. package/dist/chunks/{skillSearchPanel-C0Y56c5N.js → skillSearchPanel-LSPwZIOw.js} +4 -4
  284. package/dist/chunks/{skills-BFsyLP33.js → skills-G8WBeffd.js} +1 -1
  285. package/dist/chunks/startupProfiler-DIWVcO4e.js +1 -0
  286. package/dist/chunks/{startupProfiler-BquH_Yqm.js → startupProfiler-xa3NmN7Z.js} +2 -2
  287. package/dist/chunks/{stats-CrPmPT8f.js → stats-DmFubHpI.js} +1 -1
  288. package/dist/chunks/{status-DHJbK4pV.js → status-ClSsvm1N.js} +2 -2
  289. package/dist/chunks/{status-BO5J2MAe.js → status-i5beKggW.js} +1 -1
  290. package/dist/chunks/{statusNoticeHelpers-CqeUBySi.js → statusNoticeHelpers-BK-54uGY.js} +1 -1
  291. package/dist/chunks/{stickers-BLFmyHZV.js → stickers-D5teCKMN.js} +1 -1
  292. package/dist/chunks/{stringUtils-D_g2L6A4.js → stringUtils-DGLPkqJ4.js} +1 -1
  293. package/dist/chunks/{tag-M2AEtXjW.js → tag-DYYq4H_i.js} +2 -2
  294. package/dist/chunks/{tasks-CoOs_Qkj.js → tasks-BySzm_YJ.js} +1 -1
  295. package/dist/chunks/teleport-dxtBcM01.js +1 -0
  296. package/dist/chunks/{templateJobs-Cl50Qw0s.js → templateJobs-CT5VxeRr.js} +1 -1
  297. package/dist/chunks/terminalSetup-BNs9nLbT.js +33 -0
  298. package/dist/chunks/{terminalSetup-Bdh9K31U.js → terminalSetup-RDKg8dVa.js} +1 -1
  299. package/dist/chunks/{theme-DgCIr0jU.js → theme-CVTVsRwt.js} +1 -1
  300. package/dist/chunks/thinkback-B-GpXG9U.js +1 -0
  301. package/dist/chunks/{thinkback-ERCQ86CR.js → thinkback-CXsRbDYN.js} +1 -1
  302. package/dist/chunks/thinkback-play-BhfCaIye.js +1 -0
  303. package/dist/chunks/{tmux-ZZk68JBq.js → tmux-BY7IdQ1f.js} +1 -1
  304. package/dist/chunks/{toolEventObserver-9XCQXiMx.js → toolEventObserver--4fqXxQZ.js} +1 -1
  305. package/dist/chunks/{toolEventObserver-9-5Ne25Z.js → toolEventObserver-DdhPsAs1.js} +1 -1
  306. package/dist/chunks/toolPool-DvHECcbN.js +1 -0
  307. package/dist/chunks/trustedDevice-DvpN4J1F.js +1 -0
  308. package/dist/chunks/trustedDevice-e6iF1X7C.js +1 -0
  309. package/dist/chunks/{types-Cnorfsss.js → types-C-MRCL8J.js} +3 -3
  310. package/dist/chunks/udsClient-BuCtv7dN.js +1 -0
  311. package/dist/chunks/{ultrareviewCommand-BMBHepdu.js → ultrareviewCommand-i3PfFKly.js} +2 -2
  312. package/dist/chunks/undercover-CPvoDtJ1.js +1 -0
  313. package/dist/chunks/{undercover-DDgIKbO5.js → undercover-Q24TWRw0.js} +1 -1
  314. package/dist/chunks/{up-D6bNw_tT.js → up-BHkC97_C.js} +1 -1
  315. package/dist/chunks/updateCCB-CEXA6dax.js +11 -0
  316. package/dist/chunks/{upgrade-BN20nsCH.js → upgrade-7OrBbrzS.js} +1 -1
  317. package/dist/chunks/upgrade-uR7SIVtx.js +1 -0
  318. package/dist/chunks/upload-B-lNHpWe.js +1 -0
  319. package/dist/chunks/{upstreamproxy-os5rw0Vg.js → upstreamproxy-DyR_eXO8.js} +4 -4
  320. package/dist/chunks/usage-7jOeIVv9.js +1 -0
  321. package/dist/chunks/{usage-D_sqm8us.js → usage-CZdPfUqP.js} +1 -1
  322. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-vzUoPY51.js → useExitOnCtrlCDWithKeybindings-CzFtdlnD.js} +1 -1
  323. package/dist/chunks/useMainLoopModel-DegH12LZ.js +1 -0
  324. package/dist/chunks/useManagePlugins-BkK1zydO.js +1 -0
  325. package/dist/chunks/{useMergedTools-Bb4XbC9d.js → useMergedTools-DMGRA1ga.js} +1 -1
  326. package/dist/chunks/{useSearchInput-B1UOjxAI.js → useSearchInput-D5VU9IDU.js} +1 -1
  327. package/dist/chunks/{useSettingsErrors-BLbvu4--.js → useSettingsErrors-B5PSF1va.js} +1 -1
  328. package/dist/chunks/{util-CxlfALM4.js → util-CNa1ib_4.js} +1 -1
  329. package/dist/chunks/validatePlugin-Dw-RGCrm.js +1 -0
  330. package/dist/chunks/{vim-DLWBHwVM.js → vim-C0KTnJJs.js} +1 -1
  331. package/dist/chunks/{which-sEFQXpaX.js → which-CKQnSouy.js} +1 -1
  332. package/dist/chunks/windowsPaths-9pEkw0oV.js +1 -0
  333. package/dist/chunks/windowsPaths-DtapVxOo.js +1 -0
  334. package/dist/chunks/{workSecret-DvniZR71.js → workSecret-CNWiR2uQ.js} +1 -1
  335. package/dist/chunks/{workerRegistry-CFnGtb3L.js → workerRegistry-B2QD2sKq.js} +1 -1
  336. package/dist/chunks/worktree-D38cJ23W.js +1 -0
  337. package/dist/cli.js +1 -1
  338. package/package.json +4 -5
  339. package/dist/chunks/ApproveApiKey-CQsQdQBC.js +0 -1
  340. package/dist/chunks/BackgroundTasksDialog-AiVi-1pI.js +0 -2
  341. package/dist/chunks/ClaudeMdExternalIncludesDialog-DUu6iRJk.js +0 -1
  342. package/dist/chunks/ConsoleOAuthFlow-DVTPwR5I.js +0 -1
  343. package/dist/chunks/Doctor-BXhz8eUa.js +0 -3
  344. package/dist/chunks/Doctor-D75dsEyb.js +0 -1
  345. package/dist/chunks/ExitFlow-B1XNACQP.js +0 -2
  346. package/dist/chunks/Feedback-Cvz80lAn.js +0 -2
  347. package/dist/chunks/Grove-B7hhBvFw.js +0 -1
  348. package/dist/chunks/MCPConnectionManager-BLfKm4H2.js +0 -1
  349. package/dist/chunks/MessageSelector-DmKtBYX9.js +0 -3
  350. package/dist/chunks/Messages-CaFdI1kk.js +0 -11
  351. package/dist/chunks/PluginSettings-0FSNch8O.js +0 -17
  352. package/dist/chunks/QueryEngine-WYDWzQuY.js +0 -1
  353. package/dist/chunks/REPL-vV_jzAVx.js +0 -1
  354. package/dist/chunks/ResumeConversation-g_JyOWbl.js +0 -1
  355. package/dist/chunks/SearchExtraToolsTool-Daedym7_.js +0 -1
  356. package/dist/chunks/Settings-DUXA-qac.js +0 -2
  357. package/dist/chunks/TrustDialog-CdZS9t-T.js +0 -1
  358. package/dist/chunks/ajv-5vMo9UcX.js +0 -8
  359. package/dist/chunks/api-CLLIHLpn.js +0 -1
  360. package/dist/chunks/api-DMpNA1s8.js +0 -1
  361. package/dist/chunks/asciicast-BIr75_x9.js +0 -1
  362. package/dist/chunks/auth-Ce0jllLf.js +0 -1
  363. package/dist/chunks/auth-DV3P8Qup.js +0 -1
  364. package/dist/chunks/auth-DpFfHy1W.js +0 -15
  365. package/dist/chunks/backgroundHousekeeping-BycL9lOe.js +0 -1
  366. package/dist/chunks/bg-H849G7Sc.js +0 -1
  367. package/dist/chunks/bridgeConfig-CcANVX0P.js +0 -1
  368. package/dist/chunks/bridgeEnabled-Cn-u7P4_.js +0 -1
  369. package/dist/chunks/bridgeMain-CtgVyLjI.js +0 -68
  370. package/dist/chunks/bridgeMain-Dh0gWRVo.js +0 -1
  371. package/dist/chunks/bridgeMessaging-CRG6HqUb.js +0 -1
  372. package/dist/chunks/bridgePointer-Cug5fQ3e.js +0 -1
  373. package/dist/chunks/caches-C3NINY3K.js +0 -1
  374. package/dist/chunks/ccrClient-CRXGlUCe.js +0 -1
  375. package/dist/chunks/client-AnWHs0gW.js +0 -1
  376. package/dist/chunks/commands-DsKH3ogN.js +0 -1
  377. package/dist/chunks/commitAttribution-D7NrwLhc.js +0 -1
  378. package/dist/chunks/compact-BhWCO-oD.js +0 -2
  379. package/dist/chunks/completionCache-C9zlWBRz.js +0 -1
  380. package/dist/chunks/config-662VDD70.js +0 -3
  381. package/dist/chunks/config-CUN8YbOa.js +0 -1
  382. package/dist/chunks/config-DklnhNx1.js +0 -1
  383. package/dist/chunks/config-Wk3svGdH.js +0 -1
  384. package/dist/chunks/context-noninteractive-C3dICmA9.js +0 -1
  385. package/dist/chunks/conversation-CooSju3g.js +0 -1
  386. package/dist/chunks/conversation-DLLIOKYV.js +0 -1
  387. package/dist/chunks/createSession-CVG8SiEm.js +0 -1
  388. package/dist/chunks/crossProjectResume-DiKJb83I.js +0 -40
  389. package/dist/chunks/datadog-BE6D_6m0.js +0 -1
  390. package/dist/chunks/datadog-C69i7cfI.js +0 -1
  391. package/dist/chunks/debug-8kgDrUfj.js +0 -1
  392. package/dist/chunks/detectRepository-_Kj817Vi.js +0 -1
  393. package/dist/chunks/doctor-DEz8BHAz.js +0 -1
  394. package/dist/chunks/envLessBridgeConfig-3kCrKZl7.js +0 -1
  395. package/dist/chunks/envLessBridgeConfig-BfgXw47_.js +0 -1
  396. package/dist/chunks/esm-C8Zkk1Ux.js +0 -1
  397. package/dist/chunks/execSyncWrapper-CWxMek26.js +0 -1
  398. package/dist/chunks/exit-cyepwuyy.js +0 -1
  399. package/dist/chunks/extra-usage-DlFeNGQD.js +0 -1
  400. package/dist/chunks/extra-usage-nRFfBiXh.js +0 -1
  401. package/dist/chunks/extractMemories-BqN8fWZ5.js +0 -1
  402. package/dist/chunks/fast-NvqW2-t1.js +0 -1
  403. package/dist/chunks/firstPartyEventLogger-AhXYSrkP.js +0 -1
  404. package/dist/chunks/firstPartyEventLogger-BQYrBdvD.js +0 -5
  405. package/dist/chunks/gemini-Sr_00TsL.js +0 -1
  406. package/dist/chunks/generateRecap-5d4l_ODy.js +0 -1
  407. package/dist/chunks/git-Cc1jAz6r.js +0 -1
  408. package/dist/chunks/git-Cgc8X5l2.js +0 -6
  409. package/dist/chunks/hooks-DvtnNoYE.js +0 -1
  410. package/dist/chunks/inboundAttachments-BZ6MKpxd.js +0 -1
  411. package/dist/chunks/inboundAttachments-D5Ux2kCl.js +0 -1
  412. package/dist/chunks/initReplBridge-CjuO6in6.js +0 -1
  413. package/dist/chunks/install-DqpM2brU.js +0 -1
  414. package/dist/chunks/jwtUtils-CqXPjf-a.js +0 -1
  415. package/dist/chunks/keybindings-JvAmBpLt.js +0 -2
  416. package/dist/chunks/language-DaxZe0Xw.js +0 -1
  417. package/dist/chunks/lazySchema-uxlVVNM1.js +0 -1
  418. package/dist/chunks/loadAgentsDir-D7npVvsj.js +0 -1
  419. package/dist/chunks/loadPluginHooks-CaKvZVZI.js +0 -1
  420. package/dist/chunks/localSearch-BU5oulbF.js +0 -1
  421. package/dist/chunks/mcp-B06Mqsur.js +0 -6
  422. package/dist/chunks/mcp-C0AjA07u.js +0 -1
  423. package/dist/chunks/mcp-ghioDl7W.js +0 -2
  424. package/dist/chunks/metadata-CIx5CsoY.js +0 -1
  425. package/dist/chunks/model-BgrLt7P7.js +0 -1
  426. package/dist/chunks/model-aVc5c3Lz.js +0 -1
  427. package/dist/chunks/nativeInstaller-DKe1pWoL.js +0 -1
  428. package/dist/chunks/parser-Bj3gOqFv.js +0 -1
  429. package/dist/chunks/permissions-DB_2mmCl.js +0 -3
  430. package/dist/chunks/pidLock-DchmaAK6.js +0 -3
  431. package/dist/chunks/pluginBlocklist-Cw_l-yal.js +0 -1
  432. package/dist/chunks/pluginCliCommands-BtYWRxhS.js +0 -1
  433. package/dist/chunks/pluginOperations-BOkST1qE.js +0 -2
  434. package/dist/chunks/pluginStartupCheck-XBLJZZys.js +0 -1
  435. package/dist/chunks/plugins-6px6K1fh.js +0 -4
  436. package/dist/chunks/policyLimits-C07tQ0Wr.js +0 -1
  437. package/dist/chunks/pollConfig-C2Ac8WMU.js +0 -1
  438. package/dist/chunks/poorMode-BdBDiOFD.js +0 -1
  439. package/dist/chunks/print-DcQSuK0v.js +0 -23
  440. package/dist/chunks/processBashCommand-CEqA4QZi.js +0 -1
  441. package/dist/chunks/processSlashCommand-DMpFk59M.js +0 -5
  442. package/dist/chunks/prompt-CKvoqUC3.js +0 -1
  443. package/dist/chunks/prompt-aXZPR3q8.js +0 -1
  444. package/dist/chunks/prompt-wys9CwDo.js +0 -132
  445. package/dist/chunks/rcDebugLog-CivJaJ3V.js +0 -11
  446. package/dist/chunks/reconciler-BKX4jh34.js +0 -4
  447. package/dist/chunks/remoteBridgeCore-CmwkjiTK.js +0 -1
  448. package/dist/chunks/remoteManagedSettings-Co-CxR67.js +0 -1
  449. package/dist/chunks/ripgrep-hOjrgpMp.js +0 -1
  450. package/dist/chunks/sandbox-adapter-CO5GuywY.js +0 -1
  451. package/dist/chunks/searchExtraTools-CXZJU2Kv.js +0 -1
  452. package/dist/chunks/sessionFileAccessHooks-BUyIQVzL.js +0 -1
  453. package/dist/chunks/sessionMemory-ZsxCLHYd.js +0 -1
  454. package/dist/chunks/sessionMemory-e6YpTUhW.js +0 -1
  455. package/dist/chunks/sessionMemoryUtils-BD_dqyYB.js +0 -1
  456. package/dist/chunks/sessionObserver-DNItJztR.js +0 -1
  457. package/dist/chunks/sessionStorage-xvxpRETp.js +0 -1
  458. package/dist/chunks/sessionTitle-Bph6GO4F.js +0 -14
  459. package/dist/chunks/settings-BhvhCpVh.js +0 -19
  460. package/dist/chunks/settingsSync-D2B5K4BT.js +0 -1
  461. package/dist/chunks/setup-CEnNEK6Z.js +0 -3
  462. package/dist/chunks/sink-CyKOf5TT.js +0 -1
  463. package/dist/chunks/sink-DxPJ4khU.js +0 -1
  464. package/dist/chunks/sinks-BNo3DvxO.js +0 -2
  465. package/dist/chunks/sinks-CHgtwDha.js +0 -1
  466. package/dist/chunks/skillChangeDetector-BRBCwQ2w.js +0 -1
  467. package/dist/chunks/skillLearning-BH7EAU1m.js +0 -1
  468. package/dist/chunks/src-xRRBgNzF.js +0 -25
  469. package/dist/chunks/startupProfiler-CYCH-qos.js +0 -1
  470. package/dist/chunks/stdio-4S7b8Uhx.js +0 -1
  471. package/dist/chunks/stdio-W_Kokrkh.js +0 -3
  472. package/dist/chunks/teleport-DjIgQeBB.js +0 -1
  473. package/dist/chunks/terminalSetup-nvS3KCDG.js +0 -33
  474. package/dist/chunks/thinkback-BSv_fvbV.js +0 -1
  475. package/dist/chunks/thinkback-play-DNB0IWYt.js +0 -1
  476. package/dist/chunks/toolPool-uQKZRMKg.js +0 -1
  477. package/dist/chunks/trustedDevice-0ej6e3nx.js +0 -1
  478. package/dist/chunks/trustedDevice-nqhuw4tp.js +0 -1
  479. package/dist/chunks/udsClient-CiFj4M_h.js +0 -1
  480. package/dist/chunks/undercover-6UUO38fQ.js +0 -1
  481. package/dist/chunks/updateCCB-B-OlpLjA.js +0 -11
  482. package/dist/chunks/upgrade-DYqlCH80.js +0 -1
  483. package/dist/chunks/upload-BQGByiXE.js +0 -1
  484. package/dist/chunks/usage-DolSCKGi.js +0 -1
  485. package/dist/chunks/useMainLoopModel-cZd8EKo5.js +0 -1
  486. package/dist/chunks/useManagePlugins-DgGZBvXV.js +0 -1
  487. package/dist/chunks/validatePlugin-n8a4W_jI.js +0 -1
  488. package/dist/chunks/windowsPaths-BLevJOlm.js +0 -1
  489. package/dist/chunks/windowsPaths-N_YmYY6k.js +0 -1
  490. package/dist/chunks/worktree-Dr_WzlXs.js +0 -1
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Al as t,Ml as n,So as r,To as i,zo as a}from"./loadAgentsDir-ZQwvbURI.js";import{P as o,U as s}from"./rcDebugLog-CivJaJ3V.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 i=await n({promptMessages:[r({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{Al as t,Ml as n,So as r,To as i,zo as a}from"./loadAgentsDir-DrDu5yYy.js";import{P as o,U as s}from"./rcDebugLog-2-1XSyFV.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 i=await n({promptMessages:[r({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
@@ -0,0 +1,2 @@
1
+ import{n as e,t}from"./axios-DaWTGg7G.js";import{en as n,ht as r}from"./state-ix0xIunV.js";import{S as i,a,at as o,d as s,l as c,nt as l,ot as u,p as d,rt as f,w as p}from"./debug-BrXObCdR.js";import{o as m,r as h,t as g,v as _,y as v}from"./log-BMCygSzM.js";import{a as y,n as b,t as x}from"./analytics-BotDBGh0.js";import{a as S,n as C,o as w}from"./firstPartyEventLogger-CQdJn3LV.js";import{r as T,t as E}from"./datadog-D9rlcN12.js";import{dirname as D,join as O}from"path";t(),n(),u(),v(),l(),a(),d(),m(),i();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=o(e);return{write(e){t.write(p(e)+`
2
+ `)},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{s().appendFileSync(e,t)}catch{s().mkdirSync(n),s().appendFileSync(e,t)}},flushIntervalMs:1e3,maxBufferSize:50}),N.set(e,t),f(async()=>t?.dispose())}return t}function F(e,t){if(process.env.USER_TYPE!==`ant`)return;let n={timestamp:new Date().toISOString(),...t,cwd:s().cwd(),userType:process.env.USER_TYPE,sessionId:r(),version:`0.0.3`};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(`,`)}] `}c(`${t.name}: ${r}${n}`,{level:`error`}),F(A(),{error:`${r}${n}`})}function R(e,t){c(`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:s().cwd()};P(n).write(i)}function z(e,t){c(`MCP server "${e}": ${t}`);let n=j(e),i={debug:t,timestamp:new Date().toISOString(),sessionId:r(),cwd:s().cwd()};P(n).write(i)}function B(){g({logError:L,logMCPError:R,logMCPDebug:z,getErrorsPath:A,getMCPLogsPath:j}),c(`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-Cb--pqr-.js";export{e as initSinks};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{c as r,d as i,f as a}from"./skillGenerator-jJQDphQ8.js";import{d as o,g as s,h as c,l,m as u,p as d,x as f}from"./runtimeObserver-B93v1AxE.js";import{o as p,r as m}from"./observationStore-DzCdXq8U.js";import{o as h,s as g}from"./projectContext-D9MDwJUF.js";import{t as _}from"./sessionObserver-OgY9BUP4.js";import{i as v,r as y}from"./skillGapStore-Zvqiyxds.js";import{t as b}from"./skillLearning-BTT3_yGc.js";import{join as x}from"node:path";function S(e,t){let n=e.find(e=>e.startsWith(`${t}=`));if(n)return n.slice(t.length+1)||void 0;let r=e.indexOf(t);if(r>=0&&e[r+1]&&!e[r+1].startsWith(`--`))return e[r+1]}function C(e,t,n){let r=S(e,t);if(r===void 0)return n;let i=Number(r);return Number.isFinite(i)?i:n}var w;e((()=>{n(),b(),w=async e=>{let n=e.trim().split(/\s+/).filter(Boolean),b=n[0]??`status`,w=g(process.cwd()),T=process.env.CLAUDE_SKILL_LEARNING_HOME,E={project:w,rootDir:T};switch(b){case`status`:{let[e,t]=await Promise.all([p(E),d(E)]);return{type:`text`,value:[`Skill Learning status for ${w.projectName} (${w.projectId})`,`Observations: ${e.length}`,`Instincts: ${t.length}`].join(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{c as r,d as i,f as a}from"./skillGenerator-CwXUfM4Y.js";import{d as o,g as s,h as c,l,m as u,p as d,x as f}from"./runtimeObserver-XufSllVw.js";import{o as p,r as m}from"./observationStore-DzCdXq8U.js";import{o as h,s as g}from"./projectContext-D9MDwJUF.js";import{t as _}from"./sessionObserver-B_09FQKV.js";import{i as v,r as y}from"./skillGapStore-75ZYlfwi.js";import{t as b}from"./skillLearning-CB-5fdMl.js";import{join as x}from"node:path";function S(e,t){let n=e.find(e=>e.startsWith(`${t}=`));if(n)return n.slice(t.length+1)||void 0;let r=e.indexOf(t);if(r>=0&&e[r+1]&&!e[r+1].startsWith(`--`))return e[r+1]}function C(e,t,n){let r=S(e,t);if(r===void 0)return n;let i=Number(r);return Number.isFinite(i)?i:n}var w;e((()=>{n(),b(),w=async e=>{let n=e.trim().split(/\s+/).filter(Boolean),b=n[0]??`status`,w=g(process.cwd()),T=process.env.CLAUDE_SKILL_LEARNING_HOME,E={project:w,rootDir:T};switch(b){case`status`:{let[e,t]=await Promise.all([p(E),d(E)]);return{type:`text`,value:[`Skill Learning status for ${w.projectName} (${w.projectId})`,`Observations: ${e.length}`,`Instincts: ${t.length}`].join(`
2
2
  `)}}case`ingest`:{let e=n[1];if(!e)return{type:`text`,value:`Usage: /skill-learning ingest <transcript.jsonl> [--min-session-length=<n>]`};let t=C(n,`--min-session-length`,10),r=await m(e,E);if(r.length<t)return{type:`text`,value:`Session too short for learning (${r.length} < min=${t}). Skipping instinct extraction.`};let i=_(r),a=[];for(let e of i)a.push(await s(e,E));return{type:`text`,value:`Ingested ${r.length} observations and saved ${a.length} instincts.`}}case`evolve`:{let e=n.includes(`--generate`),o=f(await d(E),{cwd:process.cwd()}),s=[];if(e)for(let e of o){let n=a(e,await i(e,[x(process.cwd(),`.claude`,`skills`),x(t(),`skills`)])),o=await r(n);s.push(`${n.type}: ${o.activePath??o.archivedPath??o.deletedPath??`no active write`}`)}return{type:`text`,value:e?`Generated ${s.length} learned skill(s):\n${s.join(`
3
3
  `)}`:`Found ${o.length} skill candidate(s). Use --generate to write them.`}}case`export`:{let e=n[1]??`skill-learning-instincts.json`,t=S(n,`--scope`),r=C(n,`--min-conf`,void 0),i=S(n,`--domain`),a=e=>e.filter(e=>!(t&&e.scope!==t||r!==void 0&&e.confidence<r||i&&e.domain!==i)),s=await d(E),c=a(s);if(c.length!==s.length){await o(e,E);let{writeFile:t}=await import(`node:fs/promises`);await t(e,`${JSON.stringify(c,null,2)}\n`)}else await o(e,E);let l=[`Exported ${c.length} instincts to ${e}`];if(t||r!==void 0||i){let e=[];t&&e.push(`scope=${t}`),r!==void 0&&e.push(`min-conf=${r}`),i&&e.push(`domain=${i}`),l.push(`(filters: ${e.join(`, `)})`)}return{type:`text`,value:l.join(` `)}}case`import`:{let e=n[1];if(!e)return{type:`text`,value:`Usage: /skill-learning import <instincts.json> [--scope=<scope>] [--min-conf=<n>] [--domain=<d>] [--dry-run]`};let t=S(n,`--scope`),r=C(n,`--min-conf`,void 0),i=S(n,`--domain`),a=n.includes(`--dry-run`),{readFile:o}=await import(`node:fs/promises`),c=JSON.parse(await o(e,`utf8`)),l=c.filter(e=>!(t&&e.scope!==t||r!==void 0&&e.confidence<r||i&&e.domain!==i));if(a)return{type:`text`,value:`Dry run: would import ${l.length}/${c.length} instincts.`};for(let e of l)await s(e,E);return{type:`text`,value:`Imported ${l.length}/${c.length} instincts.`}}case`prune`:{let e=n.indexOf(`--max-age`);return{type:`text`,value:`Pruned ${(await u(e>=0&&n[e+1]?Number(n[e+1]):30,E)).length} pending instincts.`}}case`promote`:{let e=n[1];if(!e){let e=await v(w,T),t=l(await d(E));return{type:`text`,value:[`Promotion candidates for ${w.projectName} (${w.projectId}):`,`Pending gaps: ${e.filter(e=>e.status===`pending`).length}`,`Global-eligible instincts (>=2 projects, avg confidence >=0.8): ${t.length}`,``,`Usage:`,` /skill-learning promote gap <gap-key> # pending gap -> draft`,` /skill-learning promote instinct <instinct-id> # project instinct -> global`].join(`
4
4
  `)}}if(e===`gap`){let e=n[2];if(!e)return{type:`text`,value:`Usage: /skill-learning promote gap <gap-key>`};let t=await y(e,w,T);return t?{type:`text`,value:`Promoted gap ${e} to status=${t.status} (draft=${t.draft?.skillPath??`none`}).`}:{type:`text`,value:`No gap found for key "${e}".`}}if(e===`instinct`){let e=n[2];if(!e)return{type:`text`,value:`Usage: /skill-learning promote instinct <instinct-id>`};let t=(await d(E)).find(t=>t.id===e);return t?t.scope===`global`?{type:`text`,value:`Instinct ${e} is already global.`}:(await c({...t,scope:`global`},{scope:`global`,rootDir:T}),{type:`text`,value:`Promoted instinct ${e} to global scope.`}):{type:`text`,value:`No project-scoped instinct found for id "${e}".`}}return{type:`text`,value:`Usage: /skill-learning promote [gap <gap-key>|instinct <instinct-id>]`}}case`projects`:{let e=h();if(e.length===0)return{type:`text`,value:`No known project scopes yet.`};let t=[`Known project scopes:`];for(let n of e){let e={project:n,rootDir:T},[r,i]=await Promise.all([d(e),p(e)]);t.push(`- ${n.projectName} (${n.projectId}) — instincts: ${r.length}, observations: ${i.length}, lastSeen: ${n.lastSeenAt}`)}return{type:`text`,value:t.join(`
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Sr as t,Un as n,Wn as r,X as i,Zn as a,en as o,h as s,ht as c,vr as ee,xr as l}from"./state-ix0xIunV.js";import{Ac as te,Bi as ne,CC as re,Ci as u,Cp as ie,Ct as d,DD as ae,Db as oe,Dp as se,ED as f,Ep as ce,Et as le,Gp as p,HC as ue,Il as de,It as fe,Jn as pe,MC as me,Mt as m,NC as he,PE as h,Qi as ge,SC as _e,Tp as g,UC as ve,Vi as ye,Vl as be,Wp as _,bi as v,fi as y,gb as b,gn as x,hb as S,jr as C,kb as w,kc as T,nd as E,op as D,pi as O,rd as k,sp as A,ti as j,yn as M,zE as N}from"./loadAgentsDir-DrDu5yYy.js";import{n as xe,t as P}from"./cwd-CYmmnQVS.js";import{a as F,d as Se,l as I,nt as Ce,p as we,rt as Te}from"./debug-BrXObCdR.js";import{n as Ee,r as L}from"./analytics-BotDBGh0.js";import{C as De,_ as Oe}from"./model-fi472PRc.js";import{Nt as ke}from"./prompt-C0nU0VK3.js";import{f as Ae,l as je,t as Me}from"./commitAttribution-Bmzgtqc6.js";import{n as R,r as Ne}from"./systemPromptSections-DN0HGVye.js";import{r as Pe}from"./asciicast-CbAjUHT_.js";import*as z from"path";import{dirname as Fe}from"path";o(),Ne(),D(),ke(),ve(),N(),je(),de(),xe(),F(),w(),Oe(),b(),_(),C(),me(),re(),le();function Ie(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||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 Le(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&oe(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),e.attributionSnapshots&&e.attributionSnapshots.length>0&&Me(e.attributionSnapshots,e=>{t(t=>({...t,attribution:e}))}),!he()&&e.messages&&e.messages.length>0){let n=Ie(e.messages);if(n.length>0){let e=c();t(t=>({...t,todos:{...t.todos,[e]:n}}))}}}function Re(e){if(e.attributionSnapshots&&e.attributionSnapshots.length>0)return Ae(e.attributionSnapshots)}function B(e,t){if(!(!e&&!t))return{name:e??``,color:t==="default"?void 0:t}}function V(e,t,a){if(t)return{agentDefinition:t,agentType:void 0};if(!e)return r(void 0),{agentDefinition:void 0,agentType:void 0};let o=a.activeAgents.find(t=>t.agentType===e);return o?(r(o.agentType),!i()&&o.model&&o.model!==`inherit`&&n(De(o.model)),{agentDefinition:o,agentType:o.agentType}):(I(`Resumed session had agent "${e}" but it is no longer available. Using default behavior.`),r(void 0),{agentDefinition:void 0,agentType:void 0})}function H(e){let t=d();if(t){u(t);return}if(e){try{process.chdir(e.worktreePath)}catch{u(null);return}p(e.worktreePath),a(P()),m(e),h(),R(),S.cache.clear?.()}}function ze(){let e=d();if(e){m(null),h(),R(),S.cache.clear?.();try{process.chdir(e.originalCwd)}catch{return}p(e.originalCwd),a(P())}}async function Be(t,n,r){if(n.forkSession)t.contentReplacements?.length&&await j(t.contentReplacements);else{let e=n.sessionIdOverride??t.sessionId;e&&(ee(ue(e),n.transcriptPath?Fe(n.transcriptPath):null),await Pe(),await y(),A(e))}if(O(n.forkSession?{...t,worktreeSession:void 0}:t),t.goal){let{hydrateGoalFromTranscript:r}=(k(),e(E)),i=new Map,a=n.sessionIdOverride??t.sessionId??c();i.set(a,t.goal),r(i,a)}n.forkSession||(H(t.worktreeSession),pe());let{agentDefinition:i,agentType:a}=V(t.agentSetting,r.mainThreadAgentDefinition,r.agentDefinitions);v(`normal`);let o=n.includeAttribution?Re(t):void 0,s=B(t.agentName,t.agentColor);be(t.agentName);let l=r.agentDefinitions;return{messages:t.messages,fileHistorySnapshots:t.fileHistorySnapshots,contentReplacements:t.contentReplacements,agentName:t.agentName,agentColor:t.agentColor==="default"?void 0:t.agentColor,restoredAgentDef:i,initialState:{...r.initialState,...a&&{agent:a},...o&&{attribution:o},...s&&{standaloneAgentContext:s},agentDefinitions:l}}}ae(),o(),ge(),Ee(),ce(),T(),Ce(),F(),we(),M(),t();var Ve=1e3,He=500,Ue=300,We=2e3,Ge=typeof Bun<`u`,U=null,W=null,G=new Set,K=!1,q=!1,J=!1,Y=null,X=l(),Z=null;async function Ke(){if(K||q)return;K=!0,J||(J=!0,se(()=>{ne(),X.emit()}));let e=await Je();e.length!==0&&(I(`Watching for changes in skill/command directories: ${e.join(`, `)}...`),U=f.watch(e,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:Z?.stabilityThreshold??Ve,pollInterval:Z?.pollInterval??He},ignored:(e,t)=>t&&!t.isFile()&&!t.isDirectory()?!0:e.split(z.sep).some(e=>e===`.git`),ignorePermissionErrors:!0,usePolling:Ge,interval:Z?.chokidarInterval??We,atomic:!0}),U.on(`add`,$),U.on(`change`,$),U.on(`unlink`,$),Y=Te(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 qe=X.subscribe;async function Je(){let e=Se(),t=[],n=g(`userSettings`,`skills`);if(n)try{await e.stat(n),t.push(n)}catch{}let r=g(`userSettings`,`commands`);if(r)try{await e.stat(r),t.push(r)}catch{}let i=g(`projectSettings`,`skills`);if(i)try{let n=z.resolve(i);await e.stat(n),t.push(n)}catch{}let a=g(`projectSettings`,`commands`);if(a)try{let n=z.resolve(a);await e.stat(n),t.push(n)}catch{}for(let n of s()){let r=z.join(n,`.claude`,`skills`);try{await e.stat(r),t.push(r)}catch{}}return t}function $(e){I(`Detected skill change: ${e}`),L(`tengu_skill_file_changed`,{source:`chokidar`}),Ye(e)}function Ye(e){G.add(e),W&&clearTimeout(W),W=setTimeout(async()=>{W=null;let e=[...G];if(G.clear(),x(await fe(`skills`,e[0]))){I(`ConfigChange hook blocked skill reload (${e.length} paths)`);return}ie(),ye(),te(),X.emit()},Z?.reloadDebounce??Ue)}async function Xe(e){U&&(await U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),K=!1,q=!1,Z=e??null}var Ze={initialize:Ke,dispose:Q,subscribe:qe,resetForTesting:Xe};export{V as a,Be as i,B as n,Le as o,ze as r,H as s,Ze as t};
@@ -1,5 +1,5 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,r as n}from"./instinctParser-Dt-lqnDe.js";import{i as r,o as i,s as a}from"./skillGenerator-jJQDphQ8.js";import{a as o,n as s,s as c}from"./projectContext-D9MDwJUF.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??c(e.cwd),r=await A(n,e.rootDir),i=F(t),a=new Date().toISOString(),o=r.gaps[i],s={key:i,prompt:t,count:(o?.count??0)+1,draftHits:o?.draftHits??0,draftHitSessions:o?.draftHitSessions??[],status:o?.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:o?.createdAt??a,updatedAt:a,draft:o?.draft,active:o?.active};return s.status===`rejected`?(r.gaps[i]=s,await N(n,r,e.rootDir),s):(!s.draft&&C(s)&&(s.draft=await T(s,n),s.status=`draft`,await z()),s.draft&&!s.active&&w(s)&&(s.active=await E(s,n),s.status=`active`,await z()),r.gaps[i]=s,await N(n,r,e.rootDir),s)}async function v(e=c(),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=c(),n){let r=await A(t,n);for(let t of Object.values(r.gaps))if(t.draft?.skillPath===e)return t.key}async function b(e,t=c(),n,r=`unknown-session`){let i=await A(t,n),a=i.gaps[e];if(!a||!a.draft||a.active)return a;let o=a.draftHitSessions??[];if(o.includes(r))return a;let s=new Date().toISOString(),l={...a,draftHits:a.draftHits+1,draftHitSessions:[...o,r],updatedAt:s};return w(l)&&(l.active=await E(l,t),l.status=`active`,await z()),i.gaps[e]=l,await N(t,i,n),l}async function x(e,t=c(),n){let r=await A(t,n),i=r.gaps[e];if(!i)return;if(i.status===`rejected`||i.draft)return i;let a={...i,draft:await T(i,t),status:`draft`,updatedAt:new Date().toISOString()};return r.gaps[e]=a,await N(t,r,n),await z(),a}async function S(e,t=c(),n){let r=await A(t,n),i=r.gaps[e];if(!i)return;let a={...i,status:`rejected`,updatedAt:new Date().toISOString()};return r.gaps[e]=a,await N(t,r,n),a}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`),i=u(t.projectRoot??t.cwd,`.claude`,`skills`,`.drafts`),o=r([n],{cwd:t.projectRoot??t.cwd,outputRoot:i,scope:`project`,name:`draft-${I(e.prompt)}`,description:`Draft learned skill candidate. Promote after repeated evidence or explicit user correction.`}),s=u(o.outputPath,`SKILL.md`);return d(s)||await a({...o,content:o.content+`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,r as n}from"./instinctParser-Dt-lqnDe.js";import{i as r,o as i,s as a}from"./skillGenerator-CwXUfM4Y.js";import{a as o,n as s,s as c}from"./projectContext-D9MDwJUF.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??c(e.cwd),r=await A(n,e.rootDir),i=F(t),a=new Date().toISOString(),o=r.gaps[i],s={key:i,prompt:t,count:(o?.count??0)+1,draftHits:o?.draftHits??0,draftHitSessions:o?.draftHitSessions??[],status:o?.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:o?.createdAt??a,updatedAt:a,draft:o?.draft,active:o?.active};return s.status===`rejected`?(r.gaps[i]=s,await N(n,r,e.rootDir),s):(!s.draft&&C(s)&&(s.draft=await T(s,n),s.status=`draft`,await z()),s.draft&&!s.active&&w(s)&&(s.active=await E(s,n),s.status=`active`,await z()),r.gaps[i]=s,await N(n,r,e.rootDir),s)}async function v(e=c(),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=c(),n){let r=await A(t,n);for(let t of Object.values(r.gaps))if(t.draft?.skillPath===e)return t.key}async function b(e,t=c(),n,r=`unknown-session`){let i=await A(t,n),a=i.gaps[e];if(!a||!a.draft||a.active)return a;let o=a.draftHitSessions??[];if(o.includes(r))return a;let s=new Date().toISOString(),l={...a,draftHits:a.draftHits+1,draftHitSessions:[...o,r],updatedAt:s};return w(l)&&(l.active=await E(l,t),l.status=`active`,await z()),i.gaps[e]=l,await N(t,i,n),l}async function x(e,t=c(),n){let r=await A(t,n),i=r.gaps[e];if(!i)return;if(i.status===`rejected`||i.draft)return i;let a={...i,draft:await T(i,t),status:`draft`,updatedAt:new Date().toISOString()};return r.gaps[e]=a,await N(t,r,n),await z(),a}async function S(e,t=c(),n){let r=await A(t,n),i=r.gaps[e];if(!i)return;let a={...i,status:`rejected`,updatedAt:new Date().toISOString()};return r.gaps[e]=a,await N(t,r,n),a}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`),i=u(t.projectRoot??t.cwd,`.claude`,`skills`,`.drafts`),o=r([n],{cwd:t.projectRoot??t.cwd,outputRoot:i,scope:`project`,name:`draft-${I(e.prompt)}`,description:`Draft learned skill candidate. Promote after repeated evidence or explicit user correction.`}),s=u(o.outputPath,`SKILL.md`);return d(s)||await a({...o,content:o.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:o.name,skillPath:s}}async function E(e,t){let n=r([D(e,`active`)],{cwd:t.projectRoot??t.cwd,scope:`project`,name:I(e.prompt),description:O(e.prompt)}),i=u(n.outputPath,`SKILL.md`);return d(i)||await a(n),{type:`active`,name:n.name,skillPath:i}}function D(e,t){return n({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):s(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-DsKH3ogN.js`);e()}catch{}}var B,V,H,U=e((()=>{t(),o(),i(),B=2,V=4,H=2}));export{b as a,w as c,v as i,C as l,U as n,_ as o,x as r,S as s,y as t};
5
+ `}),{type:`draft`,name:o.name,skillPath:s}}async function E(e,t){let n=r([D(e,`active`)],{cwd:t.projectRoot??t.cwd,scope:`project`,name:I(e.prompt),description:O(e.prompt)}),i=u(n.outputPath,`SKILL.md`);return d(i)||await a(n),{type:`active`,name:n.name,skillPath:i}}function D(e,t){return n({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):s(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-D7l3P1k9.js`);e()}catch{}}var B,V,H,U=e((()=>{t(),o(),i(),B=2,V=4,H=2}));export{b as a,w as c,v as i,C as l,U as n,_ as o,x as r,S as s,y as t};
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./skillGapStore-Zvqiyxds.js";i();export{c as findGapKeyByDraftPath,o as promoteGapToDraft,n as readSkillGaps,e as recordDraftHit,a as recordSkillGap,s as rejectSkillGap,t as shouldPromoteToActive,r as shouldPromoteToDraft};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./skillGapStore-75ZYlfwi.js";i();export{c as findGapKeyByDraftPath,o as promoteGapToDraft,n as readSkillGaps,e as recordDraftHit,a as recordSkillGap,s as rejectSkillGap,t as shouldPromoteToActive,r as shouldPromoteToDraft};
@@ -1,7 +1,7 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{o as r,t as i}from"./localSearch-H0LchlTi.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 ee,rm as m,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 _(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(te(e)&&r.add(e),r.size>=5)break;if(r.size>=5)break}let i=v([n,...r].join(`-`));return y(i)?`${n}-learned-pattern`:i}function v(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,64).replace(/-$/g,``)||`learned-skill`}function y(e){return x.has(e)}function te(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`])}));async function C(e,t,n){let r=n.length>0&&typeof n[0]==`string`?await w(e,n):n,i=L(`${t.name} ${t.description} ${t.content}`);return r.map(e=>({skill:e,score:R(i,L(`${e.name} ${e.description} ${e.content}`))})).filter(e=>e.score>=.18).sort((e,t)=>t.score-e.score).map(e=>e.skill)}async function ne(e,t){return C(`skill`,e,t)}async function w(e,t){if(e===`skill`)return D(t);let n=[];for(let e of t)u(e)&&await P(e,n);return n}function T(e,t,n={}){let r=t.find(e=>j(e));if(n.allowHardDelete&&r)return{type:`delete`,targetSkill:r,reason:`Existing skill is low quality, unreferenced, and safe to delete.`,confirmed:!0};let i=t[0];if(!i)return{type:`create`,draft:e,reason:`No overlapping active skill found.`};let a=R(L(`${e.name} ${e.description} ${e.content}`),L(`${i.name} ${i.description} ${i.content}`));return a>=.72&&e.confidence>=.75&&ae(e,i)?{type:`replace`,targetSkill:i,draft:e,reason:`New learned skill has high overlap (${a.toFixed(2)}) and higher confidence.`}:a>=.35?{type:`merge`,targetSkill:i,patch:ie(e),reason:`Existing skill overlaps with the learned pattern (${a.toFixed(2)}).`}:{type:`create`,draft:e,reason:`Overlap is too low to merge.`}}async function E(e,t={}){switch(e.type){case`create`:return{activePath:await W(e.draft)};case`merge`:return I(e.targetSkill)?{activePath:await re(e.targetSkill,e.patch)}:(process.stderr.write(`[skill-learning] skip user-authored skill: ${e.targetSkill.path}\n`),{});case`replace`:{if(!I(e.targetSkill))return process.stderr.write(`[skill-learning] skip user-authored skill: ${e.targetSkill.path}\n`),{};let n=e.draft.outputPath;if(e.hardDelete){let{deletedPath:r,manifestPath:i,tombstonePath:a}=await k(e.targetSkill,e.reason,{newSkill:e.draft.name,newPath:n},{...t,allowHardDelete:!0});return{activePath:await W(e.draft),deletedPath:r,manifestPath:i,tombstonePath:a}}let{archivedPath:r,manifestPath:i}=await O(e.targetSkill,e.reason,{newSkill:e.draft.name,newPath:n},t);return{activePath:await W(e.draft),archivedPath:r,manifestPath:i}}case`archive`:return await O(e.targetSkill,e.reason,void 0,t);case`delete`:return await k(e.targetSkill,e.reason,void 0,{...t,allowHardDelete:t.allowHardDelete&&e.confirmed!==!1})}}async function D(e){let t=[];for(let n of e)u(n)&&await N(n,t);return t}async function O(e,t,n,r={}){let a=c(e.path),o=r.archiveRoot??l(c(a),`.archive`),u=l(o,`${s(a)}-${M(r.now)}`);await d(o,{recursive:!0}),await ee(a,u);let f=await A(r.manifestRoot??u,{oldSkill:e.name,oldPath:e.path,newSkill:n?.newSkill,newPath:n?.newPath,action:`archive`,reason:t,replacedAt:(r.now??new Date).toISOString(),recoverable:!0});return i(),{archivedPath:u,manifestPath:f}}async function k(e,t,n,r={}){if(!r.allowHardDelete)throw Error(`Hard delete requires allowHardDelete=true`);let a=c(e.path),o=u(e.path)?await f(e.path,`utf8`):``,s=r.manifestRoot??l(c(a),`.tombstones`),d=await A(s,{oldSkill:e.name,oldPath:e.path,newSkill:n?.newSkill,newPath:n?.newPath,action:`delete`,reason:t,replacedAt:(r.now??new Date).toISOString(),recoverable:!1}),p=l(s,`${e.name}-${M(r.now)}.tombstone.json`);return await h(p,`${JSON.stringify({deletedSkill:e.name,oldPath:e.path,content:o},null,2)}\n`,`utf8`),await m(a,{recursive:!0,force:!0}),i(),{deletedPath:e.path,manifestPath:d,tombstonePath:p}}async function A(e,t){await d(e,{recursive:!0});let n=l(e,`replacement-manifest.json`);return await h(n,`${JSON.stringify(t,null,2)}\n`,`utf8`),n}async function re(e,t){let n=l(c(e.path),`learned-skill.patch.md`);return await h(n,t,`utf8`),i(),n}function ie(e){return[`# Learned Skill Merge Patch`,``,`Target learned skill: ${e.name}`,`Confidence: ${e.confidence}`,``,`## Suggested additions`,``,e.content].join(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{o as r,t as i}from"./localSearch-_bQhk9W6.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 ee,rm as m,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 _(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(te(e)&&r.add(e),r.size>=5)break;if(r.size>=5)break}let i=v([n,...r].join(`-`));return y(i)?`${n}-learned-pattern`:i}function v(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,64).replace(/-$/g,``)||`learned-skill`}function y(e){return x.has(e)}function te(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`])}));async function C(e,t,n){let r=n.length>0&&typeof n[0]==`string`?await w(e,n):n,i=L(`${t.name} ${t.description} ${t.content}`);return r.map(e=>({skill:e,score:R(i,L(`${e.name} ${e.description} ${e.content}`))})).filter(e=>e.score>=.18).sort((e,t)=>t.score-e.score).map(e=>e.skill)}async function ne(e,t){return C(`skill`,e,t)}async function w(e,t){if(e===`skill`)return D(t);let n=[];for(let e of t)u(e)&&await P(e,n);return n}function T(e,t,n={}){let r=t.find(e=>j(e));if(n.allowHardDelete&&r)return{type:`delete`,targetSkill:r,reason:`Existing skill is low quality, unreferenced, and safe to delete.`,confirmed:!0};let i=t[0];if(!i)return{type:`create`,draft:e,reason:`No overlapping active skill found.`};let a=R(L(`${e.name} ${e.description} ${e.content}`),L(`${i.name} ${i.description} ${i.content}`));return a>=.72&&e.confidence>=.75&&ae(e,i)?{type:`replace`,targetSkill:i,draft:e,reason:`New learned skill has high overlap (${a.toFixed(2)}) and higher confidence.`}:a>=.35?{type:`merge`,targetSkill:i,patch:ie(e),reason:`Existing skill overlaps with the learned pattern (${a.toFixed(2)}).`}:{type:`create`,draft:e,reason:`Overlap is too low to merge.`}}async function E(e,t={}){switch(e.type){case`create`:return{activePath:await W(e.draft)};case`merge`:return I(e.targetSkill)?{activePath:await re(e.targetSkill,e.patch)}:(process.stderr.write(`[skill-learning] skip user-authored skill: ${e.targetSkill.path}\n`),{});case`replace`:{if(!I(e.targetSkill))return process.stderr.write(`[skill-learning] skip user-authored skill: ${e.targetSkill.path}\n`),{};let n=e.draft.outputPath;if(e.hardDelete){let{deletedPath:r,manifestPath:i,tombstonePath:a}=await k(e.targetSkill,e.reason,{newSkill:e.draft.name,newPath:n},{...t,allowHardDelete:!0});return{activePath:await W(e.draft),deletedPath:r,manifestPath:i,tombstonePath:a}}let{archivedPath:r,manifestPath:i}=await O(e.targetSkill,e.reason,{newSkill:e.draft.name,newPath:n},t);return{activePath:await W(e.draft),archivedPath:r,manifestPath:i}}case`archive`:return await O(e.targetSkill,e.reason,void 0,t);case`delete`:return await k(e.targetSkill,e.reason,void 0,{...t,allowHardDelete:t.allowHardDelete&&e.confirmed!==!1})}}async function D(e){let t=[];for(let n of e)u(n)&&await N(n,t);return t}async function O(e,t,n,r={}){let a=c(e.path),o=r.archiveRoot??l(c(a),`.archive`),u=l(o,`${s(a)}-${M(r.now)}`);await d(o,{recursive:!0}),await ee(a,u);let f=await A(r.manifestRoot??u,{oldSkill:e.name,oldPath:e.path,newSkill:n?.newSkill,newPath:n?.newPath,action:`archive`,reason:t,replacedAt:(r.now??new Date).toISOString(),recoverable:!0});return i(),{archivedPath:u,manifestPath:f}}async function k(e,t,n,r={}){if(!r.allowHardDelete)throw Error(`Hard delete requires allowHardDelete=true`);let a=c(e.path),o=u(e.path)?await f(e.path,`utf8`):``,s=r.manifestRoot??l(c(a),`.tombstones`),d=await A(s,{oldSkill:e.name,oldPath:e.path,newSkill:n?.newSkill,newPath:n?.newPath,action:`delete`,reason:t,replacedAt:(r.now??new Date).toISOString(),recoverable:!1}),p=l(s,`${e.name}-${M(r.now)}.tombstone.json`);return await h(p,`${JSON.stringify({deletedSkill:e.name,oldPath:e.path,content:o},null,2)}\n`,`utf8`),await m(a,{recursive:!0,force:!0}),i(),{deletedPath:e.path,manifestPath:d,tombstonePath:p}}async function A(e,t){await d(e,{recursive:!0});let n=l(e,`replacement-manifest.json`);return await h(n,`${JSON.stringify(t,null,2)}\n`,`utf8`),n}async function re(e,t){let n=l(c(e.path),`learned-skill.patch.md`);return await h(n,t,`utf8`),i(),n}function ie(e){return[`# Learned Skill Merge Patch`,``,`Target learned skill: ${e.name}`,`Confidence: ${e.confidence}`,``,`## Suggested additions`,``,e.content].join(`
2
2
  `)}function ae(e,t){if(t.status===`superseded`||t.status===`archived`)return!0;let n=e.confidence-(t.confidence??.5),r=e.content.length-t.content.length;return n>=.15||r>160}function j(e){return e.safeToDelete===!0&&(e.referencedBy?.length??0)===0&&e.quality===`low`}function M(e=new Date){return e.toISOString().replace(/[:.]/g,`-`)}async function N(e,t){let n=await p(e,{withFileTypes:!0});for(let r of n){let n=l(e,r.name);if(r.isDirectory()){if(r.name===`.archive`)continue;await N(n,t);continue}if(r.isFile()&&r.name===`SKILL.md`){let e=await f(n,`utf8`);t.push({name:F(e,`name`)??s(c(n)),description:F(e,`description`)??``,path:n,content:e})}}}async function P(e,t){let n=await p(e,{withFileTypes:!0});for(let r of n){let n=l(e,r.name);if(r.isDirectory()){if(r.name===`.archive`)continue;await P(n,t);continue}if(r.isFile()&&r.name.endsWith(`.md`)){let e=await f(n,`utf8`);t.push({name:F(e,`name`)??r.name.replace(/\.md$/,``),description:F(e,`description`)??``,path:n,content:e})}}}function F(e,t){let n=e.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(n)return n[1].match(RegExp(`^${t}:\\s*"?([^"\\n]+)"?`,`m`))?.[1]?.trim()}function I(e){return F(e.content,`origin`)===`skill-learning`}function L(e){return new Set(e.toLowerCase().split(/[^a-z0-9]+/).filter(e=>e.length>2))}function R(e,t){if(e.size===0||t.size===0)return 0;let n=0;for(let r of e)t.has(r)&&n++;return n/Math.min(e.size,t.size)}function z(e,t){return R(L(`${e.name} ${e.description} ${e.content}`),L(`${t.name} ${t.description} ${t.content}`))}var B=e((()=>{r(),$()}));function V(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?v(t.name):K(e),i=e.reduce((e,t)=>e+t.confidence,0)/e.length,a=t?.description??q(e),o=G(r,n,t),s=J({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 H(e,t,n){let r=V(e,t),i=await C(`skill`,r,n);for(let t of i){let n=z(r,t);if(n>=.8)return{action:`append-evidence`,target:t,overlap:n,appendedPath:await U(t,e)}}return{action:`create`,draft:r}}async function U(e,t){let n=await f(e.path,`utf8`).catch(()=>e.content);if(Buffer.byteLength(n,`utf8`)>=Q)return e.path;let r=t.flatMap(e=>e.evidence.map(e=>`- ${e}`)),a=r.slice(0,X);a.length<r.length&&a.push(`- [... ${r.length-a.length} more evidence entries omitted]`);let o=[``,`## Learned evidence (${new Date().toISOString()})`,``,...a,``].join(`
3
3
  `),s=n.endsWith(`
4
- `)?n+o:`${n}\n${o}`,c=Buffer.byteLength(s,`utf8`)>Q?s.slice(0,Q):s;return await h(e.path,c,`utf8`),i(),e.path}async function W(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-DsKH3ogN.js`);e()}catch{}return t}function G(e,n,r){return r?.outputRoot?l(r.outputRoot,e):n===`project`?l(r?.cwd??process.cwd(),`.claude`,`skills`,e):l(r?.globalSkillsDir??l(t(),`skills`),e)}function K(e){return _(e)}function q(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 J(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(`, `)}]`,`---`,``,`# ${oe(t)}`,``,`## Trigger`,``,i.map(e=>`- ${e.trigger}`).join(`
4
+ `)?n+o:`${n}\n${o}`,c=Buffer.byteLength(s,`utf8`)>Q?s.slice(0,Q):s;return await h(e.path,c,`utf8`),i(),e.path}async function W(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-D7l3P1k9.js`);e()}catch{}return t}function G(e,n,r){return r?.outputRoot?l(r.outputRoot,e):n===`project`?l(r?.cwd??process.cwd(),`.claude`,`skills`,e):l(r?.globalSkillsDir??l(t(),`skills`),e)}function K(e){return _(e)}function q(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 J(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(`, `)}]`,`---`,``,`# ${oe(t)}`,``,`## Trigger`,``,i.map(e=>`- ${e.trigger}`).join(`
5
5
  `),``,`## Action`,``,i.map(e=>`- ${e.action}`).join(`
6
6
  `),``,`## Evidence`,``,i.flatMap(e=>e.evidence.map(e=>`- ${e}`)).slice(0,Z).join(`
7
7
  `),``].join(`
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./featureCheck-HslM03dr.js";import{b as n,m as r,o as i}from"./skillGenerator-jJQDphQ8.js";import{S as a,T as o,f as s,i as c,k as l,u}from"./runtimeObserver-B93v1AxE.js";import{i as d}from"./observationStore-DzCdXq8U.js";import{a as f}from"./projectContext-D9MDwJUF.js";import{a as p,c as m,d as h,i as g}from"./sessionObserver-OgY9BUP4.js";import{n as _}from"./toolEventObserver-9-5Ne25Z.js";import{n as v}from"./skillGapStore-Zvqiyxds.js";var y=e((()=>{t(),a(),n(),s(),d(),u(),f(),c(),h(),p(),l(),o(),_(),g(),v(),i(),r(),m()}));export{y as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./featureCheck-HslM03dr.js";import{b as n,m as r,o as i}from"./skillGenerator-CwXUfM4Y.js";import{S as a,T as o,f as s,i as c,k as l,u}from"./runtimeObserver-XufSllVw.js";import{i as d}from"./observationStore-DzCdXq8U.js";import{a as f}from"./projectContext-D9MDwJUF.js";import{a as p,c as m,d as h,i as g}from"./sessionObserver-B_09FQKV.js";import{n as _}from"./toolEventObserver-DdhPsAs1.js";import{n as v}from"./skillGapStore-75ZYlfwi.js";var y=e((()=>{t(),a(),n(),s(),d(),u(),f(),c(),h(),p(),l(),o(),_(),g(),v(),i(),r(),m()}));export{y as t};
@@ -0,0 +1 @@
1
+ import"./featureCheck-HslM03dr.js";import"./instinctParser-Dt-lqnDe.js";import"./skillGenerator-CwXUfM4Y.js";import{p as e}from"./runtimeObserver-XufSllVw.js";import{o as t}from"./observationStore-DzCdXq8U.js";import{s as n}from"./projectContext-D9MDwJUF.js";import"./sessionObserver-B_09FQKV.js";import"./toolEventObserver-DdhPsAs1.js";import"./skillGapStore-75ZYlfwi.js";import{t as r}from"./skillLearning-CB-5fdMl.js";r();export{e as loadInstincts,t as readObservations,n as resolveProjectContext};
@@ -1,7 +1,7 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,fi as i,hn as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Bb as l,Lb as u}from"./loadAgentsDir-ZQwvbURI.js";import{r as d,t as f}from"./featureCheck-HslM03dr.js";async function p(){let{readObservations:e,loadInstincts:t,resolveProjectContext:n}=await import(`./skillLearning-BH7EAU1m.js`),r=n(process.cwd()),[i,a]=await Promise.all([e({project:r}),t({project:r})]);return[`Skill Learning status for ${r.projectName} (${r.projectId})`,`Observations: ${i.length}`,`Instincts: ${a.length}`,``,`Skill Learning: ${d()?`enabled`:`disabled`}`].join(`
2
- `)}async function m(){let e=[];d()?e.push(`Skill Learning: already enabled`):(process.env.SKILL_LEARNING_ENABLED=`1`,e.push(`Skill Learning: enabled (SKILL_LEARNING_ENABLED=1)`));try{let{initSkillLearning:t}=await import(`./runtimeObserver-DOZFrqJu.js`);t(),e.push(`Runtime observer: initialized`)}catch{e.push(`Runtime observer: init skipped (not available)`)}return e.join(`
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,fi as i,hn as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{wx as l,xx as u}from"./loadAgentsDir-DrDu5yYy.js";import{r as d,t as f}from"./featureCheck-HslM03dr.js";async function p(){let{readObservations:e,loadInstincts:t,resolveProjectContext:n}=await import(`./skillLearning-CSY5R5Jn.js`),r=n(process.cwd()),[i,a]=await Promise.all([e({project:r}),t({project:r})]);return[`Skill Learning status for ${r.projectName} (${r.projectId})`,`Observations: ${i.length}`,`Instincts: ${a.length}`,``,`Skill Learning: ${d()?`enabled`:`disabled`}`].join(`
2
+ `)}async function m(){let e=[];d()?e.push(`Skill Learning: already enabled`):(process.env.SKILL_LEARNING_ENABLED=`1`,e.push(`Skill Learning: enabled (SKILL_LEARNING_ENABLED=1)`));try{let{initSkillLearning:t}=await import(`./runtimeObserver-DSUuYKfs.js`);t(),e.push(`Runtime observer: initialized`)}catch{e.push(`Runtime observer: init skipped (not available)`)}return e.join(`
3
3
  `)}async function h(){let e=[];return d()?(process.env.SKILL_LEARNING_ENABLED=`0`,process.env.CLAUDE_SKILL_LEARNING_DISABLE=`1`,e.push(`Skill Learning: disabled (SKILL_LEARNING_ENABLED=0)`)):e.push(`Skill Learning: already disabled`),e.join(`
4
- `)}function g({onDone:e}){l(`skill-panel`);let[t,i]=(0,v.useState)(0),o=(0,v.useMemo)(()=>[{label:`Status`,description:`Show skill learning status for current project`,run:p},{label:`Start`,description:`Enable skill learning for this session`,run:m},{label:`Stop`,description:`Disable skill learning for this session`,run:h},{label:`About`,description:`Detailed description of skill learning features`,run:()=>Promise.resolve(x)}],[]),c=()=>{let n=o[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return a((e,t)=>{if(t.upArrow){i(e=>Math.max(0,e-1));return}if(t.downArrow){i(e=>Math.min(o.length-1,e+1));return}t.return&&c()}),(0,y.jsx)(s,{title:`Skill Learning`,subtitle:`${o.length} actions`,onCancel:()=>e(`Skill panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,y.jsxs)(n,{flexDirection:`column`,children:[o.map((e,i)=>(0,y.jsxs)(n,{flexDirection:`row`,children:[(0,y.jsx)(r,{children:`${i===t?`›`:` `} ${e.label}`.padEnd(b)}),(0,y.jsx)(r,{dimColor:!0,children:e.description})]},e.label)),(0,y.jsx)(n,{marginTop:1,children:(0,y.jsx)(r,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function _(e,t,n){let r=n?.trim()??``;if(r===`start`)return e(await m(),{display:`system`}),null;if(r===`stop`)return e(await h(),{display:`system`}),null;if(r===`about`)return e(x,{display:`system`}),null;if(r===`status`)return e(await p(),{display:`system`}),null;if(r){let{call:t}=await import(`./skill-learning-Dx1o4mMo.js`),n=await t(r,{});return n&&typeof n==`object`&&`value`in n&&e(n.value,{display:`system`}),null}return(0,y.jsx)(g,{onDone:e})}var v,y,b,x;e((()=>{v=t(i(),1),o(),u(),f(),y=c(),b=28,x=`# Skill Learning (自动学习)
4
+ `)}function g({onDone:e}){l(`skill-panel`);let[t,i]=(0,v.useState)(0),o=(0,v.useMemo)(()=>[{label:`Status`,description:`Show skill learning status for current project`,run:p},{label:`Start`,description:`Enable skill learning for this session`,run:m},{label:`Stop`,description:`Disable skill learning for this session`,run:h},{label:`About`,description:`Detailed description of skill learning features`,run:()=>Promise.resolve(x)}],[]),c=()=>{let n=o[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return a((e,t)=>{if(t.upArrow){i(e=>Math.max(0,e-1));return}if(t.downArrow){i(e=>Math.min(o.length-1,e+1));return}t.return&&c()}),(0,y.jsx)(s,{title:`Skill Learning`,subtitle:`${o.length} actions`,onCancel:()=>e(`Skill panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,y.jsxs)(n,{flexDirection:`column`,children:[o.map((e,i)=>(0,y.jsxs)(n,{flexDirection:`row`,children:[(0,y.jsx)(r,{children:`${i===t?`›`:` `} ${e.label}`.padEnd(b)}),(0,y.jsx)(r,{dimColor:!0,children:e.description})]},e.label)),(0,y.jsx)(n,{marginTop:1,children:(0,y.jsx)(r,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function _(e,t,n){let r=n?.trim()??``;if(r===`start`)return e(await m(),{display:`system`}),null;if(r===`stop`)return e(await h(),{display:`system`}),null;if(r===`about`)return e(x,{display:`system`}),null;if(r===`status`)return e(await p(),{display:`system`}),null;if(r){let{call:t}=await import(`./skill-learning-B0dyBT1_.js`),n=await t(r,{});return n&&typeof n==`object`&&`value`in n&&e(n.value,{display:`system`}),null}return(0,y.jsx)(g,{onDone:e})}var v,y,b,x;e((()=>{v=t(i(),1),o(),u(),f(),y=c(),b=28,x=`# Skill Learning (自动学习)
5
5
 
6
6
  Skill Learning 是一个闭环学习系统,通过观察用户的操作模式自动提取直觉(instinct),
7
7
  并在达到阈值后生成可复用的 skill 文件、agent 和 command。
@@ -1,6 +1,6 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,fi as i,hn as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Bb as l,Dm as u,Lb as d,Om as f}from"./loadAgentsDir-ZQwvbURI.js";function p(){return[`Skill Search (自动技能匹配)`,`Status: ${f()?`enabled`:`disabled`}`,``,`When enabled, relevant skills are automatically matched and`,`injected into conversation context each turn.`].join(`
2
- `)}async function m(){if(f()&&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-BU5oulbF.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 f()?(process.env.SKILL_SEARCH_ENABLED=`0`,`Skill Search: disabled (SKILL_SEARCH_ENABLED=0)`):`Skill Search: already disabled`}function g({onDone:e}){l(`skill-search-panel`);let[t,i]=(0,v.useState)(0),o=(0,v.useMemo)(()=>[{label:`Status`,description:`Show whether automatic skill matching is active`,run:()=>Promise.resolve(p())},{label:`Start`,description:`Enable automatic skill matching for this session`,run:m},{label:`Stop`,description:`Disable automatic skill matching for this session`,run:h},{label:`About`,description:`How automatic skill matching works`,run:()=>Promise.resolve(x)}],[]),c=()=>{let n=o[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return a((e,t)=>{if(t.upArrow){i(e=>Math.max(0,e-1));return}if(t.downArrow){i(e=>Math.min(o.length-1,e+1));return}t.return&&c()}),(0,y.jsx)(s,{title:`Skill Search`,subtitle:`${o.length} actions`,onCancel:()=>e(`Skill search panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,y.jsxs)(n,{flexDirection:`column`,children:[o.map((e,i)=>(0,y.jsxs)(n,{flexDirection:`row`,children:[(0,y.jsx)(r,{children:`${i===t?`›`:` `} ${e.label}`.padEnd(b)}),(0,y.jsx)(r,{dimColor:!0,children:e.description})]},e.label)),(0,y.jsx)(n,{marginTop:1,children:(0,y.jsx)(r,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function _(e,t,n){let r=n?.trim()??``;return r===`start`?(e(await m(),{display:`system`}),null):r===`stop`?(e(await h(),{display:`system`}),null):r===`about`?(e(x,{display:`system`}),null):r===`status`?(e(p(),{display:`system`}),null):(0,y.jsx)(g,{onDone:e})}var v,y,b,x;e((()=>{v=t(i(),1),o(),d(),u(),y=c(),b=28,x=`# Skill Search (自动技能匹配)
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,fi as i,hn as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Dm as l,Om as u,wx as d,xx as f}from"./loadAgentsDir-DrDu5yYy.js";function p(){return[`Skill Search (自动技能匹配)`,`Status: ${u()?`enabled`:`disabled`}`,``,`When enabled, relevant skills are automatically matched and`,`injected into conversation context each turn.`].join(`
2
+ `)}async function m(){if(u()&&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-CebU5BA9.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 u()?(process.env.SKILL_SEARCH_ENABLED=`0`,`Skill Search: disabled (SKILL_SEARCH_ENABLED=0)`):`Skill Search: already disabled`}function g({onDone:e}){d(`skill-search-panel`);let[t,i]=(0,v.useState)(0),o=(0,v.useMemo)(()=>[{label:`Status`,description:`Show whether automatic skill matching is active`,run:()=>Promise.resolve(p())},{label:`Start`,description:`Enable automatic skill matching for this session`,run:m},{label:`Stop`,description:`Disable automatic skill matching for this session`,run:h},{label:`About`,description:`How automatic skill matching works`,run:()=>Promise.resolve(x)}],[]),c=()=>{let n=o[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return a((e,t)=>{if(t.upArrow){i(e=>Math.max(0,e-1));return}if(t.downArrow){i(e=>Math.min(o.length-1,e+1));return}t.return&&c()}),(0,y.jsx)(s,{title:`Skill Search`,subtitle:`${o.length} actions`,onCancel:()=>e(`Skill search panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,y.jsxs)(n,{flexDirection:`column`,children:[o.map((e,i)=>(0,y.jsxs)(n,{flexDirection:`row`,children:[(0,y.jsx)(r,{children:`${i===t?`›`:` `} ${e.label}`.padEnd(b)}),(0,y.jsx)(r,{dimColor:!0,children:e.description})]},e.label)),(0,y.jsx)(n,{marginTop:1,children:(0,y.jsx)(r,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function _(e,t,n){let r=n?.trim()??``;return r===`start`?(e(await m(),{display:`system`}),null):r===`stop`?(e(await h(),{display:`system`}),null):r===`about`?(e(x,{display:`system`}),null):r===`status`?(e(p(),{display:`system`}),null):(0,y.jsx)(g,{onDone:e})}var v,y,b,x;e((()=>{v=t(i(),1),o(),f(),l(),y=c(),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
- 当前状态: ${f()?`已启用`:`未启用`}
20
+ 当前状态: ${u()?`已启用`:`未启用`}
21
21
  `}))();export{_ as call};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,fi as i,h as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Ep as l,Hb as u,Qi as d,Vb as f,ca as p,wp as m}from"./loadAgentsDir-ZQwvbURI.js";import{dn as h,ln as g}from"./settings-BhvhCpVh.js";import{b as _,y as v}from"./startupProfiler-BquH_Yqm.js";import{l as y,o as b}from"./stringUtils-D_g2L6A4.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,o]=(0,T.useState)(``),c=(0,T.useMemo)(()=>t.filter(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`commands_DEPRECATED`||e.loadedFrom===`plugin`||e.loadedFrom===`mcp`)),[t]),l=(0,T.useMemo)(()=>x(c.map(e=>({...e,name:p(e),description:e.description??``})),i),[c,i]),u=(0,T.useMemo)(()=>{let e={policySettings:[],userSettings:[],projectSettings:[],localSettings:[],flagSettings:[],plugin:[],mcp:[]};for(let t of l){let n=t.source;n in e&&e[n].push(t)}for(let t of Object.values(e))t.sort((e,t)=>p(e).localeCompare(p(t)));return e},[l]),d=()=>{e(`Skills dialog dismissed`,{display:`system`})};if(c.length===0)return(0,E.jsxs)(s,{title:`Skills`,subtitle:`No skills found`,onCancel:d,hideInputGuide:!0,children:[(0,E.jsx)(r,{dimColor:!0,children:`Create skills in .claude/skills/ or ~/.claude/skills/`}),(0,E.jsx)(r,{dimColor:!0,italic:!0,children:(0,E.jsx)(f,{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 i=`~${v(m(e))}`,a=e.source===`plugin`?e.pluginInfo?.pluginManifest.name:void 0,o=h(e.source);return(0,E.jsxs)(n,{children:[(0,E.jsx)(r,{color:t?`suggestion`:void 0,children:p(e)}),o&&(0,E.jsxs)(r,{color:o.color,children:[` [`,o.label,`]`]}),(0,E.jsxs)(r,{dimColor:!0,children:[a?` · ${a}`:``,` · `,C(e.source),` · `,i,` tokens`]})]})};return(0,E.jsx)(a,{title:`Skills`,placeholder:`Type to filter skills…`,items:(0,T.useMemo)(()=>D.flatMap(e=>u[e]),[u]),getKey:e=>`${e.name}-${e.source}`,visibleCount:12,direction:`down`,onQueryChange:o,onSelect:t=>{e(`/${p(t)}`,{display:`user`})},onCancel:d,emptyMessage:e=>e.trim()?`No skills matching "${e.trim()}"`:`No skills found`,matchLabel:i.trim()===``?`${c.length} ${y(c.length,`skill`)}`:`${l.length}/${c.length} ${y(c.length,`skill`)}`,selectAction:`invoke skill`,renderItem:(e,t)=>g(e,t)})}var T,E,D,O=e((()=>{i(),T=t(i(),1),d(),o(),l(),_(),h(),b(),u(),S(),E=c(),D=[`projectSettings`,`localSettings`,`userSettings`,`flagSettings`,`policySettings`,`plugin`,`mcp`]}));async function k(e,t){return(0,A.jsx)(w,{onExit:e,commands:t.options.commands})}var A;e((()=>{i(),O(),A=c()}))();export{k as call};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,fi as i,h as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Ep as l,Ex as u,Qi as d,Tx as f,ca as p,wp as m}from"./loadAgentsDir-DrDu5yYy.js";import{dn as h,ln as g}from"./settings-DfWP5y6X.js";import{b as _,y as v}from"./startupProfiler-xa3NmN7Z.js";import{l as y,o as b}from"./stringUtils-DGLPkqJ4.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,o]=(0,T.useState)(``),c=(0,T.useMemo)(()=>t.filter(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`commands_DEPRECATED`||e.loadedFrom===`plugin`||e.loadedFrom===`mcp`)),[t]),l=(0,T.useMemo)(()=>x(c.map(e=>({...e,name:p(e),description:e.description??``})),i),[c,i]),u=(0,T.useMemo)(()=>{let e={policySettings:[],userSettings:[],projectSettings:[],localSettings:[],flagSettings:[],plugin:[],mcp:[]};for(let t of l){let n=t.source;n in e&&e[n].push(t)}for(let t of Object.values(e))t.sort((e,t)=>p(e).localeCompare(p(t)));return e},[l]),d=()=>{e(`Skills dialog dismissed`,{display:`system`})};if(c.length===0)return(0,E.jsxs)(s,{title:`Skills`,subtitle:`No skills found`,onCancel:d,hideInputGuide:!0,children:[(0,E.jsx)(r,{dimColor:!0,children:`Create skills in .claude/skills/ or ~/.claude/skills/`}),(0,E.jsx)(r,{dimColor:!0,italic:!0,children:(0,E.jsx)(f,{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 i=`~${v(m(e))}`,a=e.source===`plugin`?e.pluginInfo?.pluginManifest.name:void 0,o=h(e.source);return(0,E.jsxs)(n,{children:[(0,E.jsx)(r,{color:t?`suggestion`:void 0,children:p(e)}),o&&(0,E.jsxs)(r,{color:o.color,children:[` [`,o.label,`]`]}),(0,E.jsxs)(r,{dimColor:!0,children:[a?` · ${a}`:``,` · `,C(e.source),` · `,i,` tokens`]})]})};return(0,E.jsx)(a,{title:`Skills`,placeholder:`Type to filter skills…`,items:(0,T.useMemo)(()=>D.flatMap(e=>u[e]),[u]),getKey:e=>`${e.name}-${e.source}`,visibleCount:12,direction:`down`,onQueryChange:o,onSelect:t=>{e(`/${p(t)}`,{display:`user`})},onCancel:d,emptyMessage:e=>e.trim()?`No skills matching "${e.trim()}"`:`No skills found`,matchLabel:i.trim()===``?`${c.length} ${y(c.length,`skill`)}`:`${l.length}/${c.length} ${y(c.length,`skill`)}`,selectAction:`invoke skill`,renderItem:(e,t)=>g(e,t)})}var T,E,D,O=e((()=>{i(),T=t(i(),1),d(),o(),l(),_(),h(),b(),u(),S(),E=c(),D=[`projectSettings`,`localSettings`,`userSettings`,`flagSettings`,`policySettings`,`plugin`,`mcp`]}));async function k(e,t){return(0,A.jsx)(w,{onExit:e,commands:t.options.commands})}var A;e((()=>{i(),O(),A=c()}))();export{k as call};
@@ -0,0 +1 @@
1
+ import{i as e,n as t}from"./startupProfiler-xa3NmN7Z.js";t();export{e as profileCheckpoint};
@@ -1,3 +1,3 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,n,o as r}from"./envUtils-DSxRz_kt.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{Gr as o,t as s}from"./src-CDCSSo0U2.js";import{en as ee,ht as c}from"./state-ix0xIunV.js";import{A as te,E as l,_ as u,h as ne,l as re,p as d}from"./debug-DiuXEmUq.js";import{n as f,r as p}from"./analytics-BotDBGh0.js";import{a as m,n as h,r as g,s as _}from"./intl-cKc-V6Mq.js";import{dirname as ie,join as v}from"path";function y(e,t){if(o(e)<=t)return e;if(t<=0)return`…`;if(t<5)return b(e,t);let n=e.lastIndexOf(`/`),r=n>=0?e.slice(n):e,i=n>=0?e.slice(0,n):``,a=o(r);if(a>=t-1)return x(e,t);let s=t-1-a;return s<=0?x(r,t):S(i,s)+`…`+r}function b(e,t){if(o(e)<=t)return e;if(t<=1)return`…`;let n=0,r=``;for(let{segment:i}of h().segment(e)){let e=o(i);if(n+e>t-1)break;r+=i,n+=e}return r+`…`}function x(e,t){if(o(e)<=t)return e;if(t<=1)return`…`;let n=[...h().segment(e)],r=0,i=n.length;for(let e=n.length-1;e>=0;e--){let a=o(n[e].segment);if(r+a>t-1)break;r+=a,i=e}return`…`+n.slice(i).map(e=>e.segment).join(``)}function S(e,t){if(o(e)<=t)return e;if(t<=0)return``;let n=0,r=``;for(let{segment:i}of h().segment(e)){let e=o(i);if(n+e>t)break;r+=i,n+=e}return r}function C(e,t,n=!1){if(e==null)return``;let r=e;if(n){let n=e.indexOf(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,n,o as r}from"./envUtils-DSxRz_kt.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{Gr as o,t as s}from"./src-CDCSSo0U2.js";import{en as ee,ht as c}from"./state-ix0xIunV.js";import{E as te,S as ne,a as l,d as re,l as u,p as d}from"./debug-BrXObCdR.js";import{n as f,r as p}from"./analytics-BotDBGh0.js";import{a as m,n as h,r as g,s as _}from"./intl-cKc-V6Mq.js";import{dirname as ie,join as v}from"path";function y(e,t){if(o(e)<=t)return e;if(t<=0)return`…`;if(t<5)return b(e,t);let n=e.lastIndexOf(`/`),r=n>=0?e.slice(n):e,i=n>=0?e.slice(0,n):``,a=o(r);if(a>=t-1)return x(e,t);let s=t-1-a;return s<=0?x(r,t):S(i,s)+`…`+r}function b(e,t){if(o(e)<=t)return e;if(t<=1)return`…`;let n=0,r=``;for(let{segment:i}of h().segment(e)){let e=o(i);if(n+e>t-1)break;r+=i,n+=e}return r+`…`}function x(e,t){if(o(e)<=t)return e;if(t<=1)return`…`;let n=[...h().segment(e)],r=0,i=n.length;for(let e=n.length-1;e>=0;e--){let a=o(n[e].segment);if(r+a>t-1)break;r+=a,i=e}return`…`+n.slice(i).map(e=>e.segment).join(``)}function S(e,t){if(o(e)<=t)return e;if(t<=0)return``;let n=0,r=``;for(let{segment:i}of h().segment(e)){let e=o(i);if(n+e>t)break;r+=i,n+=e}return r}function C(e,t,n=!1){if(e==null)return``;let r=e;if(n){let n=e.indexOf(`
2
2
  `);if(n!==-1)return r=e.substring(0,n),o(r)+1>t?b(r,t):`${r}…`}return o(r)<=t?r:b(r,t)}var w=e((()=>{s(),_()}));function T(e){let t=e/1024;if(t<1)return`${e} bytes`;if(t<1024)return`${t.toFixed(1).replace(/\.0$/,``)}KB`;let n=t/1024;return n<1024?`${n.toFixed(1).replace(/\.0$/,``)}MB`:`${(n/1024).toFixed(1).replace(/\.0$/,``)}GB`}function E(e){return`${(e/1e3).toFixed(1)}s`}function D(e,t){if(e<6e4)return e===0?`0s`:e<1?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/1e3).toString()}s`;let n=Math.floor(e/864e5),r=Math.floor(e%864e5/36e5),i=Math.floor(e%36e5/6e4),a=Math.round(e%6e4/1e3);a===60&&(a=0,i++),i===60&&(i=0,r++),r===24&&(r=0,n++);let o=t?.hideTrailingZeros;return t?.mostSignificantOnly?n>0?`${n}d`:r>0?`${r}h`:i>0?`${i}m`:`${a}s`:n>0?o&&r===0&&i===0?`${n}d`:o&&i===0?`${n}d ${r}h`:`${n}d ${r}h ${i}m`:r>0?o&&i===0&&a===0?`${r}h`:o&&a===0?`${r}h ${i}m`:`${r}h ${i}m ${a}s`:i>0?o&&a===0?`${i}m`:`${i}m ${a}s`:`${a}s`}function O(e){return F(e>=1e3).format(e).toLowerCase()}function k(e){return O(e).replace(`.0`,``)}function A(e,t={}){let{style:n=`narrow`,numeric:r=`always`,now:i=new Date}=t,a=e.getTime()-i.getTime(),o=Math.trunc(a/1e3);for(let{unit:e,seconds:t,shortUnit:i}of[{unit:`year`,seconds:31536e3,shortUnit:`y`},{unit:`month`,seconds:2592e3,shortUnit:`mo`},{unit:`week`,seconds:604800,shortUnit:`w`},{unit:`day`,seconds:86400,shortUnit:`d`},{unit:`hour`,seconds:3600,shortUnit:`h`},{unit:`minute`,seconds:60,shortUnit:`m`},{unit:`second`,seconds:1,shortUnit:`s`}])if(Math.abs(o)>=t){let a=Math.trunc(o/t);return n===`narrow`?o<0?`${Math.abs(a)}${i} ago`:`in ${a}${i}`:g(`long`,r).format(a,e)}return n===`narrow`?o<=0?`0s ago`:`in 0s`:g(n,r).format(0,`second`)}function j(e,t={}){let{now:n=new Date,...r}=t;return e>n?A(e,{...r,now:n}):A(e,{...r,numeric:`always`,now:n})}function ae(e){let t=e.fileSize===void 0?`${e.messageCount} messages`:T(e.fileSize),n=[j(e.modified,{style:`short`}),...e.gitBranch?[e.gitBranch]:[],t];return e.tag&&n.push(`#${e.tag}`),e.agentSetting&&n.push(`@${e.agentSetting}`),e.prNumber&&n.push(e.prRepository?`${e.prRepository}#${e.prNumber}`:`#${e.prNumber}`),n.join(` · `)}function M(e,t=!1,n=!0){if(!e)return;let r=new Date(e*1e3),i=new Date,a=r.getMinutes();if((r.getTime()-i.getTime())/(1e3*60*60)>24){let e={month:`short`,day:`numeric`,hour:n?`numeric`:void 0,minute:!n||a===0?void 0:`2-digit`,hour12:n?!0:void 0};return r.getFullYear()!==i.getFullYear()&&(e.year=`numeric`),r.toLocaleString(`en-US`,e).replace(/ ([AP]M)/i,(e,t)=>t.toLowerCase())+(t?` (${m()})`:``)}return r.toLocaleTimeString(`en-US`,{hour:`numeric`,minute:a===0?void 0:`2-digit`,hour12:!0}).replace(/ ([AP]M)/i,(e,t)=>t.toLowerCase())+(t?` (${m()})`:``)}function oe(e,t=!1,n=!0){let r=new Date(e);return`${M(Math.floor(r.getTime()/1e3),t,n)}`}var N,P,F,I=e((()=>{_(),w(),N=null,P=null,F=e=>e?(N||(N=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1,minimumFractionDigits:1})),N):(P||(P=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1,minimumFractionDigits:0})),P)}));function L(){return V}function R(e){return e.toFixed(3)}function z(e,t,n,r,i,a,o=``){let s=r?` | RSS: ${T(r.rss)}, Heap: ${T(r.heapUsed)}`:``;return`[+${R(e).padStart(i)}ms] (+${R(t).padStart(a)}ms) ${n}${o}${s}`}var B,V,H=e((()=>{I(),i(),B=class{constructor(){a(this,`marks`,new Map),a(this,`_origin`,void 0),this._origin=Number(process.hrtime.bigint()/1000n)/1e3}mark(e){this.marks.set(e,this.now())}getEntriesByType(e){if(e!==`mark`)return[];let t=[];for(let[e,n]of this.marks)t.push({name:e,startTime:n,entryType:`mark`});return t}clearMarks(e){e===void 0?this.marks.clear():this.marks.delete(e)}now(){return Number(process.hrtime.bigint()/1000n)/1e3-this._origin}},V=new B}));function U(e){X&&(L().mark(e),J&&Z.push(process.memoryUsage()))}function W(){if(!J)return`Startup profiling not enabled`;let e=L().getEntriesByType(`mark`);if(e.length===0)return`No profiling checkpoints recorded`;let t=[];t.push(`=`.repeat(80)),t.push(`STARTUP PROFILING REPORT`),t.push(`=`.repeat(80)),t.push(``);let n=0;for(let[r,i]of e.entries())t.push(z(i.startTime,i.startTime-n,i.name,Z[r],8,7)),n=i.startTime;let r=e[e.length-1];return t.push(``),t.push(`Total startup time: ${R(r?.startTime??0)}ms`),t.push(`=`.repeat(80)),t.join(`
3
- `)}function G(){if(!$){if($=!0,se(),J){let e=q(),t=ie(e);ne().mkdirSync(t),te(e,W(),{encoding:`utf8`,flush:!0}),d(`Startup profiling report:`),d(W())}L().clearMarks(),Z.length=0}}function K(){return J}function q(){return v(n(),`startup-perf`,`${c()}.txt`)}function se(){if(!Y)return;let e=L().getEntriesByType(`mark`);if(e.length===0)return;let t=new Map;for(let n of e)t.set(n.name,n.startTime);let n={};for(let[e,[r,i]]of Object.entries(Q)){let a=t.get(r),o=t.get(i);a!==void 0&&o!==void 0&&(n[`${e}_ms`]=Math.round(o-a))}n.checkpoint_count=e.length,p(`tengu_startup_perf`,n)}var J,Y,X,Z,Q,$,ce=e((()=>{ee(),f(),re(),r(),u(),H(),l(),J=t(process.env.CLAUDE_CODE_PROFILE_STARTUP),Y=process.env.USER_TYPE===`ant`||Math.random()<.005,X=J||Y,Z=[],Q={import_time:[`cli_entry`,`main_tsx_imports_loaded`],init_time:[`init_function_start`,`init_function_end`],settings_time:[`eagerLoadSettings_start`,`eagerLoadSettings_end`],total_time:[`cli_entry`,`main_after_run`]},X&&U(`profiler_initialized`),$=!1}));export{y as C,S as E,C as S,b as T,M as _,G as a,I as b,L as c,T as d,ae as f,oe as g,j as h,U as i,H as l,A as m,ce as n,R as o,O as p,K as r,z as s,q as t,D as u,E as v,x as w,w as x,k as y};
3
+ `)}function G(){if(!$){if($=!0,se(),J){let e=q(),t=ie(e);re().mkdirSync(t),te(e,W(),{encoding:`utf8`,flush:!0}),u(`Startup profiling report:`),u(W())}L().clearMarks(),Z.length=0}}function K(){return J}function q(){return v(n(),`startup-perf`,`${c()}.txt`)}function se(){if(!Y)return;let e=L().getEntriesByType(`mark`);if(e.length===0)return;let t=new Map;for(let n of e)t.set(n.name,n.startTime);let n={};for(let[e,[r,i]]of Object.entries(Q)){let a=t.get(r),o=t.get(i);a!==void 0&&o!==void 0&&(n[`${e}_ms`]=Math.round(o-a))}n.checkpoint_count=e.length,p(`tengu_startup_perf`,n)}var J,Y,X,Z,Q,$,ce=e((()=>{ee(),f(),l(),r(),d(),H(),ne(),J=t(process.env.CLAUDE_CODE_PROFILE_STARTUP),Y=process.env.USER_TYPE===`ant`||Math.random()<.005,X=J||Y,Z=[],Q={import_time:[`cli_entry`,`main_tsx_imports_loaded`],init_time:[`init_function_start`,`init_function_end`],settings_time:[`eagerLoadSettings_start`,`eagerLoadSettings_end`],total_time:[`cli_entry`,`main_after_run`]},X&&U(`profiler_initialized`),$=!1}));export{y as C,S as E,C as S,b as T,M as _,G as a,I as b,L as c,T as d,ae as f,oe as g,j as h,U as i,H as l,A as m,ce as n,R as o,O as p,K as r,z as s,q as t,D as u,E as v,x as w,w as x,k as y};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{g as r,y as i}from"./config-662VDD70.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{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{g as r,y as i}from"./config-DiT2Z8dY.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,2 +1,2 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n,r,t as i}from"./envUtils-DSxRz_kt.js";import{n as a,t as o}from"./figures-5ThXQEtq.js";import{P as ee,di as s,fi as te,j as c,t as l,ui as u}from"./src-CDCSSo0U2.js";import{t as d}from"./jsx-runtime-Bb4Xn-E0.js";import{$T as f,IE as p,Lg as m,NE as h,Og as g,QT as _,YT as v,jg as y,tE as b,wg as x}from"./loadAgentsDir-ZQwvbURI.js";import{a as S,c as C,dn as w,g as T,on as E,r as D,sn as O}from"./settings-BhvhCpVh.js";import{f as k,l as A}from"./file-BZriE-XU.js";import{b as j,p as M}from"./startupProfiler-BquH_Yqm.js";import{Kt as ne,Vt as N,_ as P,fi as F,i as I,mi as L,x as R,xt as z}from"./model-BgrLt7P7.js";import{h as B,l as V,o as H,p as U}from"./proxy-CHnxhNZI.js";import{d as W,u as G}from"./pidLock-DchmaAK6.js";import{n as K,t as q}from"./nativeInstaller-DKe1pWoL.js";import{n as J,t as Y}from"./allErrors-CDWTJcMw.js";function X(){return process.env.USER_TYPE===`ant`?[{label:`Bash Sandbox`,value:h.isSandboxingEnabled()?`Enabled`:`Disabled`}]:[]}function Z(e,t=null,n){let r=e?.find(e=>e.name===`ide`);if(t){let e=m(t.ideType),i=y(t.ideType)?`plugin`:`extension`;if(t.error)return[{label:`IDE`,value:(0,$.jsxs)(ee,{children:[c(`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=x(r)??`IDE`;return r.type===`connected`?[{label:`IDE`,value:`Connected to ${e} extension`}]:[{label:`IDE`,value:`${c(`error`,n)(o.cross)} Not connected to ${e}`}]}return[]}function re(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(c(`success`,t)(`${r.connected} connected`)),r.needsAuth&&i.push(c(`warning`,t)(`${r.needsAuth} need auth`)),r.pending&&i.push(c(`inactive`,t)(`${r.pending} pending`)),r.failed&&i.push(c(`error`,t)(`${r.failed} failed`)),[{label:`MCP servers`,value:`${i.join(`, `)} ${c(`inactive`,t)(`· /mcp`)}`}]}async function ie(){let e=_(await f()),t=[];return e.forEach(e=>{let n=A(e.path);t.push(`Large ${n} will impact performance (${M(e.content.length)} chars > ${M(v)})`)}),t}function ae(){return[{label:`Setting sources`,value:E().filter(e=>{let t=C(e);return t!==null&&Object.keys(t).length>0}).map(e=>{if(e===`policySettings`){let e=S();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}=D();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 O(e)}).filter(e=>e!==null)}]}async function oe(){return(await K()).map(e=>e.message)}async function se(){let e=await G(),t=[],{errors:n}=Y();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 Q(){let e=z();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 ce(){let e=F(),n=[];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];n.push({label:`API provider`,value:t})}if(e===`firstParty`){let e=process.env.ANTHROPIC_BASE_URL;e&&n.push({label:`Anthropic base URL`,value:e})}else if(e===`bedrock`){let e=process.env.BEDROCK_BASE_URL;e&&n.push({label:`Bedrock base URL`,value:e}),n.push({label:`AWS region`,value:i()}),t(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&n.push({value:`AWS auth skipped`})}else if(e===`vertex`){let e=process.env.VERTEX_BASE_URL;e&&n.push({label:`Vertex base URL`,value:e});let i=process.env.ANTHROPIC_VERTEX_PROJECT_ID;i&&n.push({label:`GCP project`,value:i}),n.push({label:`Default region`,value:r()}),t(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&n.push({value:`GCP auth skipped`})}else if(e===`foundry`){let e=process.env.ANTHROPIC_FOUNDRY_BASE_URL;e&&n.push({label:`Microsoft Foundry base URL`,value:e});let r=process.env.ANTHROPIC_FOUNDRY_RESOURCE;r&&n.push({label:`Microsoft Foundry resource`,value:r}),t(process.env.CLAUDE_CODE_SKIP_FOUNDRY_AUTH)&&n.push({value:`Microsoft Foundry auth skipped`})}else if(e===`gemini`){let e=process.env.GEMINI_BASE_URL||`https://generativelanguage.googleapis.com/v1beta`;n.push({label:`Gemini base URL`,value:e})}else if(e===`grok`){let e=process.env.GROK_BASE_URL;n.push({label:`Grok base URL`,value:e})}else if(e===`openai`){let e=process.env.OPENAI_BASE_URL;n.push({label:`OpenAI base URL`,value:e})}let a=H();a&&n.push({label:`Proxy`,value:a});let o=U();return process.env.NODE_EXTRA_CA_CERTS&&n.push({label:`Additional CA cert(s)`,value:process.env.NODE_EXTRA_CA_CERTS}),o&&(o.cert&&process.env.CLAUDE_CODE_CLIENT_CERT&&n.push({label:`mTLS client cert`,value:process.env.CLAUDE_CODE_CLIENT_CERT}),o.key&&process.env.CLAUDE_CODE_CLIENT_KEY&&n.push({label:`mTLS client key`,value:process.env.CLAUDE_CODE_CLIENT_KEY})),n}function le(e){let t=R(e);if(e===null&&ne()){let e=I();t=`${u.bold(`Default`)} ${e}`}return t}var $,ue=e((()=>{s(),a(),te(),l(),N(),b(),W(),n(),k(),j(),g(),P(),L(),B(),q(),V(),p(),J(),w(),T(),$=d()}));export{se as a,X as c,ue as d,oe as i,ae as l,Q as n,re as o,Z as r,ie as s,ce as t,le as u};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n,r,t as i}from"./envUtils-DSxRz_kt.js";import{n as a,t as o}from"./figures-5ThXQEtq.js";import{P as ee,di as s,fi as te,j as c,t as l,ui as u}from"./src-CDCSSo0U2.js";import{t as d}from"./jsx-runtime-Bb4Xn-E0.js";import{IE as f,LE as p,Lg as m,NE as h,Og as g,_D as _,bD as v,jg as y,wg as b,zE as x}from"./loadAgentsDir-DrDu5yYy.js";import{a as S,c as C,dn as w,g as T,on as E,r as D,sn as O}from"./settings-DfWP5y6X.js";import{f as k,l as A}from"./file-DcZWPH2V.js";import{b as j,p as M}from"./startupProfiler-xa3NmN7Z.js";import{Kt as ne,Vt as N,_ as P,fi as F,i as I,mi as L,x as R,xt as z}from"./model-fi472PRc.js";import{h as B,l as V,o as H,p as U}from"./proxy-CRN7jYIi.js";import{d as W,u as G}from"./pidLock-CdNZ0Wfg.js";import{n as K,t as q}from"./nativeInstaller-DktvrWRd.js";import{n as J,t as Y}from"./allErrors-DJYCAtab.js";function X(){return process.env.USER_TYPE===`ant`?[{label:`Bash Sandbox`,value:_.isSandboxingEnabled()?`Enabled`:`Disabled`}]:[]}function Z(e,t=null,n){let r=e?.find(e=>e.name===`ide`);if(t){let e=m(t.ideType),i=y(t.ideType)?`plugin`:`extension`;if(t.error)return[{label:`IDE`,value:(0,$.jsxs)(ee,{children:[c(`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=b(r)??`IDE`;return r.type===`connected`?[{label:`IDE`,value:`Connected to ${e} extension`}]:[{label:`IDE`,value:`${c(`error`,n)(o.cross)} Not connected to ${e}`}]}return[]}function re(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(c(`success`,t)(`${r.connected} connected`)),r.needsAuth&&i.push(c(`warning`,t)(`${r.needsAuth} need auth`)),r.pending&&i.push(c(`inactive`,t)(`${r.pending} pending`)),r.failed&&i.push(c(`error`,t)(`${r.failed} failed`)),[{label:`MCP servers`,value:`${i.join(`, `)} ${c(`inactive`,t)(`· /mcp`)}`}]}async function ie(){let e=f(await p()),t=[];return e.forEach(e=>{let n=A(e.path);t.push(`Large ${n} will impact performance (${M(e.content.length)} chars > ${M(h)})`)}),t}function ae(){return[{label:`Setting sources`,value:E().filter(e=>{let t=C(e);return t!==null&&Object.keys(t).length>0}).map(e=>{if(e===`policySettings`){let e=S();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}=D();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 O(e)}).filter(e=>e!==null)}]}async function oe(){return(await K()).map(e=>e.message)}async function se(){let e=await G(),t=[],{errors:n}=Y();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 Q(){let e=z();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 ce(){let e=F(),n=[];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];n.push({label:`API provider`,value:t})}if(e===`firstParty`){let e=process.env.ANTHROPIC_BASE_URL;e&&n.push({label:`Anthropic base URL`,value:e})}else if(e===`bedrock`){let e=process.env.BEDROCK_BASE_URL;e&&n.push({label:`Bedrock base URL`,value:e}),n.push({label:`AWS region`,value:i()}),t(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&n.push({value:`AWS auth skipped`})}else if(e===`vertex`){let e=process.env.VERTEX_BASE_URL;e&&n.push({label:`Vertex base URL`,value:e});let i=process.env.ANTHROPIC_VERTEX_PROJECT_ID;i&&n.push({label:`GCP project`,value:i}),n.push({label:`Default region`,value:r()}),t(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&n.push({value:`GCP auth skipped`})}else if(e===`foundry`){let e=process.env.ANTHROPIC_FOUNDRY_BASE_URL;e&&n.push({label:`Microsoft Foundry base URL`,value:e});let r=process.env.ANTHROPIC_FOUNDRY_RESOURCE;r&&n.push({label:`Microsoft Foundry resource`,value:r}),t(process.env.CLAUDE_CODE_SKIP_FOUNDRY_AUTH)&&n.push({value:`Microsoft Foundry auth skipped`})}else if(e===`gemini`){let e=process.env.GEMINI_BASE_URL||`https://generativelanguage.googleapis.com/v1beta`;n.push({label:`Gemini base URL`,value:e})}else if(e===`grok`){let e=process.env.GROK_BASE_URL;n.push({label:`Grok base URL`,value:e})}else if(e===`openai`){let e=process.env.OPENAI_BASE_URL;n.push({label:`OpenAI base URL`,value:e})}let a=H();a&&n.push({label:`Proxy`,value:a});let o=U();return process.env.NODE_EXTRA_CA_CERTS&&n.push({label:`Additional CA cert(s)`,value:process.env.NODE_EXTRA_CA_CERTS}),o&&(o.cert&&process.env.CLAUDE_CODE_CLIENT_CERT&&n.push({label:`mTLS client cert`,value:process.env.CLAUDE_CODE_CLIENT_CERT}),o.key&&process.env.CLAUDE_CODE_CLIENT_KEY&&n.push({label:`mTLS client key`,value:process.env.CLAUDE_CODE_CLIENT_KEY})),n}function le(e){let t=R(e);if(e===null&&ne()){let e=I();t=`${u.bold(`Default`)} ${e}`}return t}var $,ue=e((()=>{s(),a(),te(),l(),N(),x(),W(),n(),k(),j(),g(),P(),L(),B(),q(),V(),v(),J(),w(),T(),$=d()}));export{se as a,X as c,ue as d,oe as i,ae as l,Q as n,re as o,Z as r,ie as s,ce as t,le as u};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{n as r,t as i}from"./Settings-DUXA-qac.js";async function a(e,t){return(0,o.jsx)(i,{onClose:e,context:t,defaultTab:`Status`})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{n as r,t as i}from"./Settings-BvhG1XoW.js";async function a(e,t){return(0,o.jsx)(i,{onClose:e,context:t,defaultTab:`Status`})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Uc as t,Wc as n}from"./loadAgentsDir-ZQwvbURI.js";function r(e){return e?e.activeAgents.filter(e=>e.source!==`built-in`).reduce((e,t)=>e+n(`${t.agentType}: ${t.whenToUse}`),0):0}var i,a=e((()=>{t(),i=15e3}));export{r as n,a as r,i as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Uc as t,Wc as n}from"./loadAgentsDir-DrDu5yYy.js";function r(e){return e?e.activeAgents.filter(e=>e.source!==`built-in`).reduce((e,t)=>e+n(`${t.agentType}: ${t.whenToUse}`),0):0}var i,a=e((()=>{t(),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{n as t,t as n}from"./browser-BKiu1max.js";async function r(){let e=`https://www.stickermule.com/claudecode`;return await t(e)?{type:`text`,value:`Opening sticker page in browser…`}:{type:`text`,value:`Failed to open browser. Visit: ${e}`}}e((()=>{n()}))();export{r as call};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./browser-BmZuQom6.js";async function r(){let e=`https://www.stickermule.com/claudecode`;return await t(e)?{type:`text`,value:`Opening sticker page in browser…`}:{type:`text`,value:`Failed to open browser. Visit: ${e}`}}e((()=>{n()}))();export{r as call};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{r,t as i}from"./which-sEFQXpaX.js";function a(e,t){return{cmd:r(e)??e,args:t}}var o=e((()=>{i()}));function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}function l(e,t,n=t+`s`){return e===1?t:n}function u(e){let t=e.indexOf(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{r,t as i}from"./which-CKQnSouy.js";function a(e,t){return{cmd:r(e)??e,args:t}}var o=e((()=>{i()}));function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}function l(e,t,n=t+`s`){return e===1?t:n}function u(e){let t=e.indexOf(`
2
2
  `);return t===-1?e:e.slice(0,t)}function d(e,t,n=0){let r=0,i=e.indexOf(t,n);for(;i!==-1;)r++,i=e.indexOf(t,i+1);return r}function f(e){return e.replace(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function p(e){return e.replace(/\u3000/g,` `)}function m(e,t=`,`,n=g){let r=`...[truncated]`,i=``;for(let a of e){let e=i?t:``,o=e+a;if(i.length+o.length<=n)i+=o;else{let t=n-i.length-e.length-14;return t>0?i+=e+a.slice(0,t)+r:i+=r,i}}return i}function h(e,t){let n=e.split(`
3
3
  `);return n.length<=t?e:n.slice(0,t).join(`
4
4
  `)+`…`}var g,_,v=e((()=>{t(),g=2**21,_=class{constructor(e=g){n(this,`maxSize`,void 0),n(this,`content`,``),n(this,`isTruncated`,!1),n(this,`totalBytesReceived`,0),this.maxSize=e}append(e){let t=typeof e==`string`?e:e.toString();if(this.totalBytesReceived+=t.length,!(this.isTruncated&&this.content.length>=this.maxSize))if(this.content.length+t.length>this.maxSize){let e=this.maxSize-this.content.length;e>0&&(this.content+=t.slice(0,e)),this.isTruncated=!0}else this.content+=t}toString(){if(!this.isTruncated)return this.content;let e=this.totalBytesReceived-this.maxSize,t=Math.round(e/1024);return this.content+`\n... [output truncated - ${t}KB removed]`}clear(){this.content=``,this.isTruncated=!1,this.totalBytesReceived=0}get length(){return this.content.length}get truncated(){return this.isTruncated}get totalBytes(){return this.totalBytesReceived}}}));export{u as a,p as c,h as d,a as f,s as i,l,c as n,v as o,o as p,d as r,f as s,_ as t,m as u};
@@ -1,4 +1,4 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,di as i,fi as a,t as o,ui as s,y as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{en as u,ht as d}from"./state-ix0xIunV.js";import{Er as f,Nb as p,Pb as m,jr as h,pr as g,xi as _}from"./loadAgentsDir-ZQwvbURI.js";import{D as v,E as y,Y as b}from"./log-Duzb4o6h.js";import{n as x,r as S}from"./analytics-BotDBGh0.js";import{r as C,t as w}from"./sanitization-DV-94a9Z.js";function T({tagName:e,onConfirm:t,onCancel:i}){return(0,A.jsx)(c,{title:`Remove tag?`,subtitle:`Current tag: #${e}`,onCancel:i,color:`warning`,children:(0,A.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,A.jsx)(r,{children:`This will remove the tag from the current session.`}),(0,A.jsx)(p,{onChange:e=>e===`yes`?t():i(),options:[{label:`Yes, remove tag`,value:`yes`},{label:`No, keep tag`,value:`no`}]})]})})}function E({tagName:e,onDone:t}){let[n,r]=k.useState(!1),[i,a]=k.useState(null),o=C(e).trim();return k.useEffect(()=>{let e=d();if(!e){t(`No active session to tag`,{display:`system`});return}if(!o){t(`Tag name cannot be empty`,{display:`system`});return}a(e);let n=g(e);n===o?(S(`tengu_tag_command_remove_prompt`,{}),r(!0)):(S(`tengu_tag_command_add`,{is_replacing:!!n}),(async()=>{let n=f();await _(e,o,n),t(`Tagged session with ${s.cyan(`#${o}`)}`,{display:`system`})})())},[o,t]),n&&i?(0,A.jsx)(T,{tagName:o,onConfirm:async()=>{S(`tengu_tag_command_remove_confirmed`,{});let e=f();await _(i,``,e),t(`Removed tag ${s.cyan(`#${o}`)}`,{display:`system`})},onCancel:()=>{S(`tengu_tag_command_remove_cancelled`,{}),t(`Kept tag ${s.cyan(`#${o}`)}`,{display:`system`})}}):null}function D({onDone:e}){return k.useEffect(()=>{e(`Usage: /tag <tag-name>
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,di as i,fi as a,t as o,ui as s,y as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{en as u,ht as d}from"./state-ix0xIunV.js";import{Er as f,_x as p,jr as m,pr as h,vx as g,xi as _}from"./loadAgentsDir-DrDu5yYy.js";import{D as v,E as y,Y as b}from"./log-BMCygSzM.js";import{n as x,r as S}from"./analytics-BotDBGh0.js";import{r as C,t as w}from"./sanitization-DV-94a9Z.js";function T({tagName:e,onConfirm:t,onCancel:i}){return(0,A.jsx)(c,{title:`Remove tag?`,subtitle:`Current tag: #${e}`,onCancel:i,color:`warning`,children:(0,A.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,A.jsx)(r,{children:`This will remove the tag from the current session.`}),(0,A.jsx)(p,{onChange:e=>e===`yes`?t():i(),options:[{label:`Yes, remove tag`,value:`yes`},{label:`No, keep tag`,value:`no`}]})]})})}function E({tagName:e,onDone:t}){let[n,r]=k.useState(!1),[i,a]=k.useState(null),o=C(e).trim();return k.useEffect(()=>{let e=d();if(!e){t(`No active session to tag`,{display:`system`});return}if(!o){t(`Tag name cannot be empty`,{display:`system`});return}a(e);let n=h(e);n===o?(S(`tengu_tag_command_remove_prompt`,{}),r(!0)):(S(`tengu_tag_command_add`,{is_replacing:!!n}),(async()=>{let n=f();await _(e,o,n),t(`Tagged session with ${s.cyan(`#${o}`)}`,{display:`system`})})())},[o,t]),n&&i?(0,A.jsx)(T,{tagName:o,onConfirm:async()=>{S(`tengu_tag_command_remove_confirmed`,{});let e=f();await _(i,``,e),t(`Removed tag ${s.cyan(`#${o}`)}`,{display:`system`})},onCancel:()=>{S(`tengu_tag_command_remove_cancelled`,{}),t(`Kept tag ${s.cyan(`#${o}`)}`,{display:`system`})}}):null}function D({onDone:e}){return k.useEffect(()=>{e(`Usage: /tag <tag-name>
2
2
 
3
3
  Toggle a searchable tag on the current session.
4
4
  Run the same command again to remove the tag.
@@ -8,4 +8,4 @@ Examples:
8
8
  /tag bugfix # Add tag
9
9
  /tag bugfix # Remove tag (toggle)
10
10
  /tag feature-auth
11
- /tag wip`,{display:`system`})},[e]),null}async function O(e,t,n){return n=n?.trim()||``,v.includes(n)||y.includes(n)||!n?(0,A.jsx)(D,{onDone:e}):(0,A.jsx)(E,{tagName:n,onDone:e})}var k,A;e((()=>{i(),k=t(a(),1),u(),m(),o(),b(),x(),w(),h(),A=l()}))();export{O as call};
11
+ /tag wip`,{display:`system`})},[e]),null}async function O(e,t,n){return n=n?.trim()||``,v.includes(n)||y.includes(n)||!n?(0,A.jsx)(D,{onDone:e}):(0,A.jsx)(E,{tagName:n,onDone:e})}var k,A;e((()=>{i(),k=t(a(),1),u(),g(),o(),b(),x(),w(),m(),A=l()}))();export{O as call};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{n as r,t as i}from"./BackgroundTasksDialog-AiVi-1pI.js";async function a(e,t){return(0,o.jsx)(i,{toolUseContext:t,onDone:e})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{n as r,t as i}from"./BackgroundTasksDialog-DyjVt81B.js";async function a(e,t){return(0,o.jsx)(i,{toolUseContext:t,onDone:e})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
@@ -0,0 +1 @@
1
+ import{Ay as e,Fy as t,Ny as n,Ry as r,jy as i}from"./loadAgentsDir-DrDu5yYy.js";i();export{e as checkOutTeleportedSessionBranch,n as processMessagesForTeleportResume,t as teleportResumeCodeSession,r as validateGitState};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{ID as r,LD as i,g as a,h as o,m as s}from"./loadAgentsDir-ZQwvbURI.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=o(`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 a of r){if(!a.endsWith(`.md`))continue;let r=c(a,`.md`);if(t.has(r))continue;t.add(r);let o=l(n,a);try{let{frontmatter:t,content:n}=i(f(o,`utf-8`),o),a=(typeof t.description==`string`?t.description:``)||s(n,`No description`);e.push({name:r,description:a,filePath:o,frontmatter:t,content:n})}catch{}}}return e}function v(e){return _().find(t=>t.name===e)??null}var y=e((()=>{r(),n(),a()}));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+`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{bO as r,g as i,h as a,m as o,yO as s}from"./loadAgentsDir-DrDu5yYy.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 i;try{i=p(n)}catch{continue}for(let a of i){if(!a.endsWith(`.md`))continue;let i=c(a,`.md`);if(t.has(i))continue;t.add(i);let s=l(n,a);try{let{frontmatter:t,content:n}=r(f(s,`utf-8`),s),a=(typeof t.description==`string`?t.description:``)||o(n,`No description`);e.push({name:i,description:a,filePath:s,frontmatter:t,content:n})}catch{}}}return e}function v(e){return _().find(t=>t.name===e)??null}var y=e((()=>{s(),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+`
2
2
  `,`utf-8`)}catch{m(i,a+`
3
3
  `,`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(`
4
4
  Template Job Commands:
@@ -0,0 +1,33 @@
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,j as a,t as o,ui as s}from"./src-CDCSSo0U2.js";import{n as c,t as l}from"./cwd-CYmmnQVS.js";import{C as u,H as d,S as ee,d as te,p as ne,w as re,z as ie}from"./debug-BrXObCdR.js";import{Jt as f,Zt as ae}from"./settings-DfWP5y6X.js";import{b as p,c as m,g as h,o as g,y as _}from"./config-DiT2Z8dY.js";import{r as v,t as y}from"./execFileNoThrow-D244NytW.js";import{o as b,s as x}from"./log-BMCygSzM.js";import{i as oe,o as se}from"./platform-BrYefG_2.js";import{f as ce,m as le}from"./file-DcZWPH2V.js";import{d as ue,o as S,s as C}from"./types-C-MRCL8J.js";import{r as w,t as de}from"./completionCache-MN3_MqK8.js";import{homedir as T,platform as E}from"os";import{dirname as D,join as O}from"path";import{randomBytes as k}from"crypto";import{copyFile as A,mkdir as j,readFile as M,stat as N,writeFile as P}from"fs/promises";import{pathToFileURL as fe}from"url";function F(){let e=te().existsSync(O(l(),`CLAUDE.md`)),t=le(l());return[{key:`workspace`,text:`Ask Claude to create a new app or clone a repository`,isComplete:!1,isCompletable:!0,isEnabled:t},{key:`claudemd`,text:`Run /init to create a CLAUDE.md file with instructions for Claude`,isComplete:e,isCompletable:!0,isEnabled:!t}]}function I(){return F().filter(({isCompletable:e,isEnabled:t})=>e&&t).every(({isComplete:e})=>e)}function L(){g().hasCompletedProjectOnboarding||I()&&_(e=>({...e,hasCompletedProjectOnboarding:!0}))}function R(){_(e=>({...e,projectOnboardingSeenCount:e.projectOnboardingSeenCount+1}))}var z,B=e((()=>{n(),h(),c(),ce(),ne(),z=t(()=>{let e=g();return e.hasCompletedProjectOnboarding||e.projectOnboardingSeenCount>=4||process.env.IS_DEMO?!1:!I()})}));function pe(e){p(t=>({...t,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:e}))}function V(){p(e=>({...e,appleTerminalSetupInProgress:!1}))}function me(){let e=m();return{inProgress:e.appleTerminalSetupInProgress??!1,backupPath:e.appleTerminalBackupPath||null}}function H(){return O(T(),`Library`,`Preferences`,`com.apple.Terminal.plist`)}async function he(){let e=H(),t=`${e}.bak`;try{let{code:n}=await y(`defaults`,[`export`,`com.apple.Terminal`,e]);if(n!==0)return null;try{await N(e)}catch{return null}return await y(`defaults`,[`export`,`com.apple.Terminal`,t]),pe(t),t}catch(e){return x(e),null}}async function U(){let{inProgress:e,backupPath:t}=me();if(!e)return{status:`no_backup`};if(!t)return V(),{status:`no_backup`};try{await N(t)}catch{return V(),{status:`no_backup`}}try{let{code:e}=await y(`defaults`,[`import`,`com.apple.Terminal`,t]);return e===0?(await y(`killall`,[`cfprefsd`]),V(),{status:`restored`}):{status:`failed`,backupPath:t}}catch(e){return x(Error(`Failed to restore Terminal.app settings with: ${e}`)),V(),{status:`failed`,backupPath:t}}}var W=e((()=>{h(),v(),b()}));function ge(){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 _e(){return!f.terminal||!(f.terminal in $)?null:$[f.terminal]??null}function G(e){return r()?`\x1b]8;;${fe(e).href}\x07${e}\x1b]8;;\x07`:e}function K(){return E()===`darwin`&&f.terminal===`Apple_Terminal`||f.terminal===`vscode`||f.terminal===`cursor`||f.terminal===`windsurf`||f.terminal===`alacritty`||f.terminal===`zed`}async function q(e){let t=``;switch(f.terminal){case`Apple_Terminal`:t=await xe(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 Se(e);break;case`zed`:t=await Ce(e);break;case null:break}return p(e=>[`vscode`,`cursor`,`windsurf`,`alacritty`,`zed`].includes(f.terminal??``)?e.shiftEnterKeyBindingInstalled===!0?e:{...e,shiftEnterKeyBindingInstalled:!0}:f.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled===!0?e:{...e,optionAsMetaKeyInstalled:!0}:e),L(),process.env.USER_TYPE===`ant`&&(t+=await w(e)),t}function ve(){return m().shiftEnterKeyBindingInstalled===!0}function J(){return m().hasUsedBackslashReturn===!0}function ye(){m().hasUsedBackslashReturn||p(e=>({...e,hasUsedBackslashReturn:!0}))}async function be(e,t,n){if(f.terminal&&f.terminal in $)return e(`Shift+Enter is natively supported in ${$[f.terminal]}.
2
+
3
+ No configuration needed. Just use Shift+Enter to add newlines.`),null;if(!K()){let t=f.terminal||`your current terminal`,n=oe(),r=``;return n===`macos`?r=` • macOS: Apple Terminal
4
+ `:n===`windows`&&(r=` • Windows: Windows Terminal
5
+ `),e(`Terminal setup cannot be run from ${t}.
6
+
7
+ This command configures a convenient Shift+Enter shortcut for multi-line prompts.
8
+ ${s.dim(`Note: You can already use backslash (\\\\) + return to add newlines.`)}
9
+
10
+ To set up the shortcut (optional):
11
+ 1. Exit tmux/screen temporarily
12
+ 2. Run /terminal-setup directly in one of these terminals:
13
+ ${r} • IDE: VSCode, Cursor, Windsurf, Zed
14
+ • Other: Alacritty
15
+ 3. Return to tmux/screen - settings will persist
16
+
17
+ ${s.dim(`Note: iTerm2, WezTerm, Ghostty, Kitty, and Warp support Shift+Enter natively.`)}`),null}return e(await q(t.options.theme)),null}async function Y(e=`VSCode`,t){if(ge())return`${a(`warning`,t)(`Cannot install keybindings from a remote ${e} session.`)}${Q}${Q}${e} keybindings must be installed on your local machine, not the remote server.${Q}${Q}To install the Shift+Enter keybinding:${Q}1. Open ${e} on your local machine (not connected to remote)${Q}2. Open the Command Palette (Cmd/Ctrl+Shift+P) → "Preferences: Open Keyboard Shortcuts (JSON)"${Q}3. Add this keybinding (the file must be a JSON array):${Q}${Q}${s.dim(`[
18
+ {
19
+ "key": "shift+enter",
20
+ "command": "workbench.action.terminal.sendSequence",
21
+ "args": { "text": "\\u001b\\r" },
22
+ "when": "terminalFocus"
23
+ }
24
+ ]`)}${Q}`;let n=e===`VSCode`?`Code`:e,r=O(T(),E()===`win32`?O(`AppData`,`Roaming`,n,`User`):E()===`darwin`?O(`Library`,`Application Support`,n,`User`):O(`.config`,n,`User`)),i=O(r,`keybindings.json`);try{await j(r,{recursive:!0});let n=`[]`,o=[],c=!1;try{n=await M(i,{encoding:`utf-8`}),c=!0,o=ue(n)??[]}catch(e){if(!d(e))throw e}if(c){let n=`${i}.${k(4).toString(`hex`)}.bak`;try{await A(i,n)}catch{return`${a(`warning`,t)(`Error backing up existing ${e} terminal keybindings. Bailing out.`)}${Q}${s.dim(`See ${G(i)}`)}${Q}${s.dim(`Backup path: ${G(n)}`)}${Q}`}}return o.find(e=>e.key===`shift+enter`&&e.command===`workbench.action.terminal.sendSequence`&&e.when===`terminalFocus`)?`${a(`warning`,t)(`Found existing ${e} terminal Shift+Enter key binding. Remove it to continue.`)}${Q}${s.dim(`See ${G(i)}`)}${Q}`:(await P(i,S(n,{key:`shift+enter`,command:`workbench.action.terminal.sendSequence`,args:{text:`\x1B\r`},when:`terminalFocus`}),{encoding:`utf-8`}),`${a(`success`,t)(`Installed ${e} terminal Shift+Enter key binding`)}${Q}${s.dim(`See ${G(i)}`)}${Q}`)}catch(t){throw x(t),Error(`Failed to install ${e} terminal Shift+Enter key binding`)}}async function X(e){let{code:t}=await y(`/usr/libexec/PlistBuddy`,[`-c`,`Add :'Window Settings':'${e}':useOptionAsMetaKey bool true`,H()]);if(t!==0){let{code:t}=await y(`/usr/libexec/PlistBuddy`,[`-c`,`Set :'Window Settings':'${e}':useOptionAsMetaKey true`,H()]);if(t!==0)return x(Error(`Failed to enable Option as Meta key for Terminal.app profile: ${e}`)),!1}return!0}async function Z(e){let{code:t}=await y(`/usr/libexec/PlistBuddy`,[`-c`,`Add :'Window Settings':'${e}':Bell bool false`,H()]);if(t!==0){let{code:t}=await y(`/usr/libexec/PlistBuddy`,[`-c`,`Set :'Window Settings':'${e}':Bell false`,H()]);if(t!==0)return x(Error(`Failed to disable audio bell for Terminal.app profile: ${e}`)),!1}return!0}async function xe(e){try{if(!await he())throw Error(`Failed to create backup of Terminal.app preferences, bailing out`);let{stdout:t,code:n}=await y(`defaults`,[`read`,`com.apple.Terminal`,`Default Window Settings`]);if(n!==0||!t.trim())throw Error(`Failed to read default Terminal.app profile`);let{stdout:r,code:i}=await y(`defaults`,[`read`,`com.apple.Terminal`,`Startup Window Settings`]);if(i!==0||!r.trim())throw Error(`Failed to read startup Terminal.app profile`);let o=!1,c=t.trim(),l=await X(c),u=await Z(c);(l||u)&&(o=!0);let d=r.trim();if(d!==c){let e=await X(d),t=await Z(d);(e||t)&&(o=!0)}if(!o)throw Error(`Failed to enable Option as Meta key or disable audio bell for any Terminal.app profile`);return await y(`killall`,[`cfprefsd`]),V(),`${a(`success`,e)(`Configured Terminal.app settings:`)}${Q}${a(`success`,e)(`- Enabled "Use Option as Meta key"`)}${Q}${a(`success`,e)(`- Switched to visual bell`)}${Q}${s.dim(`Option+Enter will now enter a newline.`)}${Q}${s.dim(`You must restart Terminal.app for changes to take effect.`,e)}${Q}`}catch(e){x(e);let t=await U(),n=`Failed to enable Option as Meta key for Terminal.app.`;throw t.status===`restored`?Error(`${n} Your settings have been restored from backup.`):t.status===`failed`?Error(`${n} Restoring from backup failed, try manually with: defaults import com.apple.Terminal ${t.backupPath}`):Error(`${n} No backup was available to restore from.`)}}async function Se(e){let t=[],n=process.env.XDG_CONFIG_HOME;if(n?t.push(O(n,`alacritty`,`alacritty.toml`)):t.push(O(T(),`.config`,`alacritty`,`alacritty.toml`)),E()===`win32`){let e=process.env.APPDATA;e&&t.push(O(e,`alacritty`,`alacritty.toml`))}let r=null,i=``,o=!1;for(let e of t)try{i=await M(e,{encoding:`utf-8`}),r=e,o=!0;break}catch(e){if(!d(e))throw e}if(r||(r=t[0]??null),!r)throw Error(`No valid config path found for Alacritty`);try{if(o){if(i.includes(`mods = "Shift"`)&&i.includes(`key = "Return"`))return`${a(`warning`,e)(`Found existing Alacritty Shift+Enter key binding. Remove it to continue.`)}${Q}${s.dim(`See ${G(r)}`)}${Q}`;let t=k(4).toString(`hex`),n=`${r}.${t}.bak`;try{await A(r,n)}catch{return`${a(`warning`,e)(`Error backing up existing Alacritty config. Bailing out.`)}${Q}${s.dim(`See ${G(r)}`)}${Q}${s.dim(`Backup path: ${G(n)}`)}${Q}`}}else await j(D(r),{recursive:!0});let t=i;return i&&!i.endsWith(`
25
+ `)&&(t+=`
26
+ `),t+=`
27
+ [[keyboard.bindings]]
28
+ key = "Return"
29
+ mods = "Shift"
30
+ chars = "\\u001B\\r"
31
+ `,await P(r,t,{encoding:`utf-8`}),`${a(`success`,e)(`Installed Alacritty Shift+Enter key binding`)}${Q}${a(`success`,e)(`You may need to restart Alacritty for changes to take effect`)}${Q}${s.dim(`See ${G(r)}`)}${Q}`}catch(e){throw x(e),Error(`Failed to install Alacritty Shift+Enter key binding`)}}async function Ce(e){let t=O(T(),`.config`,`zed`),n=O(t,`keymap.json`);try{await j(t,{recursive:!0});let r=`[]`,i=!1;try{r=await M(n,{encoding:`utf-8`}),i=!0}catch(e){if(!d(e))throw e}if(i){if(r.includes(`shift-enter`))return`${a(`warning`,e)(`Found existing Zed Shift+Enter key binding. Remove it to continue.`)}${Q}${s.dim(`See ${G(n)}`)}${Q}`;let t=`${n}.${k(4).toString(`hex`)}.bak`;try{await A(n,t)}catch{return`${a(`warning`,e)(`Error backing up existing Zed keymap. Bailing out.`)}${Q}${s.dim(`See ${G(n)}`)}${Q}${s.dim(`Backup path: ${G(t)}`)}${Q}`}}let o;try{o=u(r),Array.isArray(o)||(o=[])}catch{o=[]}return o.push({context:`Terminal`,bindings:{"shift-enter":[`terminal::SendText`,`\x1B\r`]}}),await P(n,re(o,null,2)+`
32
+ `,{encoding:`utf-8`}),`${a(`success`,e)(`Installed Zed Shift+Enter key binding`)}${Q}${s.dim(`See ${G(n)}`)}${Q}`}catch(e){throw x(e),Error(`Failed to install Zed Shift+Enter key binding`)}}var Q,$,we=e((()=>{i(),o(),B(),W(),de(),h(),ae(),ie(),v(),C(),b(),se(),ee(),Q=`
33
+ `,$={ghostty:`Ghostty`,kitty:`Kitty`,"iTerm.app":`iTerm2`,WezTerm:`WezTerm`,WarpTerminal:`Warp`}}));export{ve as a,K as c,F as d,R as f,z as h,we as i,U as l,L as m,_e as n,ye as o,B as p,J as r,q as s,be as t,W as u};
@@ -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-nvS3KCDG.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-BNs9nLbT.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 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,fi as n,t as r,x as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{n as o,t as s}from"./ThemePicker-Dyq1YVhb.js";function c({onDone:e}){let[,n]=t();return(0,l.jsx)(i,{color:`permission`,children:(0,l.jsx)(s,{onThemeSelect:t=>{n(t),e(`Theme set to ${t}`)},onCancel:()=>{e(`Theme picker dismissed`,{display:`system`})},skipExitHandling:!0})})}var l,u;e((()=>{n(),r(),o(),l=a(),u=async(e,t)=>(0,l.jsx)(c,{onDone:e})}))();export{u as call};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,fi as n,t as r,x as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{n as o,t as s}from"./ThemePicker-BTfuZZ7E.js";function c({onDone:e}){let[,n]=t();return(0,l.jsx)(i,{color:`permission`,children:(0,l.jsx)(s,{onThemeSelect:t=>{n(t),e(`Theme set to ${t}`)},onCancel:()=>{e(`Theme picker dismissed`,{display:`system`})},skipExitHandling:!0})})}var l,u;e((()=>{n(),r(),o(),l=a(),u=async(e,t)=>(0,l.jsx)(c,{onDone:e})}))();export{u as call};
@@ -0,0 +1 @@
1
+ import{n as e,r as t,t as n}from"./thinkback-CXsRbDYN.js";e();export{n as call,t as playAnimation};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,Rn as i,fi as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{$y as l,As as u,Es as d,Fs as f,Gs as p,Hs as m,Is as ee,Nb as te,Pb as h,Vs as g,fs as _,hD as v,lc as y,pD as b,ps as x,tb as ne,uc as S}from"./loadAgentsDir-ZQwvbURI.js";import{G as C,J as w,U as T,l as E,p as D}from"./debug-DiuXEmUq.js";import{c as re,o as ie,r as ae,t as oe}from"./execFileNoThrow-DResQRvR.js";import{o as se,s as O}from"./log-Duzb4o6h.js";import{i as ce,o as k}from"./platform-B5dCGT8t.js";import{_ as A,f as j}from"./file-BZriE-XU.js";import{n as M,r as N}from"./pluginStartupCheck-BelpzwZI.js";import{a as P,s as F}from"./pluginOperations-BOkST1qE.js";import{join as I}from"path";import{readFile as L}from"fs/promises";function R(){return process.env.USER_TYPE===`ant`?q:b}function z(){return process.env.USER_TYPE===`ant`?J:Y}function B(){return`thinkback@${R()}`}async function V(){let{enabled:e}=await x(),t=e.find(e=>e.name===`thinkback`||e.source&&e.source.includes(B()));if(!t)return null;let n=I(t.path,`skills`,X);return await A(n)?n:null}async function H(e){let t=I(e,`year_in_review.js`),n=I(e,`player.js`);try{await L(t)}catch(e){return C(e)?{success:!1,message:`No animation found. Run /think-back first to generate one.`}:(O(e),{success:!1,message:`Could not access animation data: ${w(e).message}`})}try{await L(n)}catch(e){return C(e)?{success:!1,message:`Player script not found. The player.js file is missing from the thinkback skill.`}:(O(e),{success:!1,message:`Could not access player script: ${w(e).message}`})}let r=i.get(process.stdout);if(!r)return{success:!1,message:`Failed to access terminal instance`};r.enterAlternateScreen();try{await ie(`node`,[n],{stdio:`inherit`,cwd:e,reject:!1})}catch{}finally{r.exitAlternateScreen()}let a=I(e,`year_in_review.html`);if(await A(a)){let e=ce();oe(e===`macos`?`open`:e===`windows`?`start`:`xdg-open`,[a])}return{success:!0,message:`Year in review animation complete!`}}function U({onReady:e,onError:t}){let[i,a]=(0,G.useState)({phase:`checking`}),[o,s]=(0,G.useState)(``);if((0,G.useEffect)(()=>{async function n(){try{let t=await m(),n=R(),r=z(),i=B(),o=n in t,c=u(i);if(o?c||(a({phase:`installing-marketplace`}),s(`Updating marketplace…`),D(`Refreshing marketplace ${n}`),await p(n,e=>{s(e)}),ee(),y(),D(`Marketplace ${n} refreshed`)):(a({phase:`installing-marketplace`}),D(`Installing marketplace ${r}`),await f({source:`github`,repo:r},e=>{s(e)}),y(),D(`Marketplace ${n} installed`)),c){let{disabled:e}=await x();if(e.some(e=>e.name===`thinkback`||e.source?.includes(i))){a({phase:`enabling-plugin`}),D(`Enabling plugin ${i}`);let e=await P(i);if(!e.success)throw Error(`Failed to enable plugin: ${e.message}`);y(),D(`Plugin ${i} enabled`)}}else{a({phase:`installing-plugin`}),D(`Installing plugin ${i}`);let e=await N([i]);if(e.failed.length>0){let t=e.failed.map(e=>`${e.name}: ${e.error}`).join(`, `);throw Error(`Failed to install plugin: ${t}`)}y(),D(`Plugin ${i} installed`)}a({phase:`ready`}),e()}catch(e){let n=w(e);O(n),a({phase:`error`,message:n.message}),t(n.message)}}n()},[e,t]),i.phase===`error`)return(0,K.jsx)(n,{flexDirection:`column`,children:(0,K.jsxs)(r,{color:`error`,children:[`Error: `,i.message]})});if(i.phase===`ready`)return null;let c=i.phase===`checking`?`Checking thinkback installation…`:i.phase===`installing-marketplace`?`Installing marketplace…`:i.phase===`enabling-plugin`?`Enabling thinkback plugin…`:`Installing thinkback plugin…`;return(0,K.jsx)(n,{flexDirection:`column`,children:(0,K.jsxs)(n,{children:[(0,K.jsx)(l,{}),(0,K.jsx)(r,{children:o||c})]})})}function W({onDone:e,onAction:t,skillDir:i,hasGenerated:a}){let[o,c]=(0,G.useState)(!1),l=a?[{label:`Play animation`,value:`play`,description:`Watch your year in review`},{label:`Edit content`,value:`edit`,description:`Modify the animation`},{label:`Fix errors`,value:`fix`,description:`Fix validation or rendering issues`},{label:`Regenerate`,value:`regenerate`,description:`Create a new animation from scratch`}]:[{label:`Let's go!`,value:`regenerate`,description:`Generate your personalized animation`}];function u(n){c(!0),n===`play`?H(i).then(()=>{e(void 0,{display:`skip`})}):t(n)}function d(){e(void 0,{display:`skip`})}return o?null:(0,K.jsx)(s,{title:`Think Back on 2025 with Work Mate`,subtitle:`Generate your 2025 Work Mate Think Back (takes a few minutes to run)`,onCancel:d,color:`claude`,children:(0,K.jsxs)(n,{flexDirection:`column`,gap:1,children:[!a&&(0,K.jsxs)(n,{flexDirection:`column`,children:[(0,K.jsx)(r,{children:`Relive your year of coding with Claude.`}),(0,K.jsx)(r,{dimColor:!0,children:`We'll create a personalized ASCII animation celebrating your journey.`})]}),(0,K.jsx)(te,{options:l,onChange:u,visibleOptionCount:5})]})})}function le({onDone:e}){let[t,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(null),[u,d]=(0,G.useState)(null);function f(){i(!0)}let p=(0,G.useCallback)(t=>{o(t),e(`Error with thinkback: ${t}. Try running /plugin to manually install the think-back plugin.`,{display:`system`})},[e]);(0,G.useEffect)(()=>{t&&!s&&!a&&V().then(e=>{e?(D(`Thinkback skill directory: ${e}`),c(e)):p(`Could not find thinkback skill directory`)})},[t,s,a,p]),(0,G.useEffect)(()=>{if(!s)return;let e=I(s,`year_in_review.js`);A(e).then(t=>{D(`Checking for ${e}: ${t?`found`:`not found`}`),d(t)})},[s]);function m(t){e({edit:Z,fix:Q,regenerate:$}[t],{display:`user`,shouldQuery:!0})}return a?(0,K.jsxs)(n,{flexDirection:`column`,children:[(0,K.jsxs)(r,{color:`error`,children:[`Error: `,a]}),(0,K.jsx)(r,{dimColor:!0,children:`Try running /plugin to manually install the think-back plugin.`})]}):t?!s||u===null?(0,K.jsxs)(n,{children:[(0,K.jsx)(l,{}),(0,K.jsx)(r,{children:`Loading thinkback skill…`})]}):(0,K.jsx)(W,{onDone:e,onAction:m,skillDir:s,hasGenerated:u}):(0,K.jsx)(U,{onReady:f,onError:p})}async function ue(e){return(0,K.jsx)(le,{onDone:e})}var G,K,q,J,Y,X,Z,Q,$,de=e((()=>{re(),a(),G=t(a(),1),h(),o(),ne(),F(),E(),T(),ae(),j(),se(),k(),S(),d(),g(),v(),_(),M(),K=c(),q=`claude-code-marketplace`,J=`anthropics/claude-code-marketplace`,Y=`anthropics/claude-plugins-official`,X=`thinkback`,Z=`Use the Skill tool to invoke the "thinkback" skill with mode=edit to modify my existing Work Mate year in review animation. Ask me what I want to change. When the animation is ready, tell the user to run /think-back again to play it.`,Q=`Use the Skill tool to invoke the "thinkback" skill with mode=fix to fix validation or rendering errors in my existing Work Mate year in review animation. Run the validator, identify errors, and fix them. When the animation is ready, tell the user to run /think-back again to play it.`,$=`Use the Skill tool to invoke the "thinkback" skill with mode=regenerate to create a completely new Work Mate year in review animation from scratch. Delete the existing animation and start fresh. When the animation is ready, tell the user to run /think-back again to play it.`}));export{de as n,H as r,ue as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,Rn as i,fi as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{$D as l,As as u,Es as d,Fs as f,Gs as p,Hs as m,Is as ee,Lb as h,Vs as g,ZD as _,_x as v,fs as y,lc as b,ps as x,uc as S,vx as te,zb as C}from"./loadAgentsDir-DrDu5yYy.js";import{V as w,W as T,a as E,l as D,z as ne}from"./debug-BrXObCdR.js";import{c as re,o as ie,r as ae,t as oe}from"./execFileNoThrow-D244NytW.js";import{o as se,s as O}from"./log-BMCygSzM.js";import{i as ce,o as k}from"./platform-BrYefG_2.js";import{_ as A,f as j}from"./file-DcZWPH2V.js";import{n as M,r as N}from"./pluginStartupCheck-BNd2QNzZ.js";import{a as P,s as F}from"./pluginOperations-ClzXYNQe.js";import{join as I}from"path";import{readFile as L}from"fs/promises";function R(){return process.env.USER_TYPE===`ant`?q:_}function z(){return process.env.USER_TYPE===`ant`?J:Y}function B(){return`thinkback@${R()}`}async function V(){let{enabled:e}=await x(),t=e.find(e=>e.name===`thinkback`||e.source&&e.source.includes(B()));if(!t)return null;let n=I(t.path,`skills`,X);return await A(n)?n:null}async function H(e){let t=I(e,`year_in_review.js`),n=I(e,`player.js`);try{await L(t)}catch(e){return w(e)?{success:!1,message:`No animation found. Run /think-back first to generate one.`}:(O(e),{success:!1,message:`Could not access animation data: ${T(e).message}`})}try{await L(n)}catch(e){return w(e)?{success:!1,message:`Player script not found. The player.js file is missing from the thinkback skill.`}:(O(e),{success:!1,message:`Could not access player script: ${T(e).message}`})}let r=i.get(process.stdout);if(!r)return{success:!1,message:`Failed to access terminal instance`};r.enterAlternateScreen();try{await ie(`node`,[n],{stdio:`inherit`,cwd:e,reject:!1})}catch{}finally{r.exitAlternateScreen()}let a=I(e,`year_in_review.html`);if(await A(a)){let e=ce();oe(e===`macos`?`open`:e===`windows`?`start`:`xdg-open`,[a])}return{success:!0,message:`Year in review animation complete!`}}function U({onReady:e,onError:t}){let[i,a]=(0,G.useState)({phase:`checking`}),[o,s]=(0,G.useState)(``);if((0,G.useEffect)(()=>{async function n(){try{let t=await m(),n=R(),r=z(),i=B(),o=n in t,c=u(i);if(o?c||(a({phase:`installing-marketplace`}),s(`Updating marketplace…`),D(`Refreshing marketplace ${n}`),await p(n,e=>{s(e)}),ee(),b(),D(`Marketplace ${n} refreshed`)):(a({phase:`installing-marketplace`}),D(`Installing marketplace ${r}`),await f({source:`github`,repo:r},e=>{s(e)}),b(),D(`Marketplace ${n} installed`)),c){let{disabled:e}=await x();if(e.some(e=>e.name===`thinkback`||e.source?.includes(i))){a({phase:`enabling-plugin`}),D(`Enabling plugin ${i}`);let e=await P(i);if(!e.success)throw Error(`Failed to enable plugin: ${e.message}`);b(),D(`Plugin ${i} enabled`)}}else{a({phase:`installing-plugin`}),D(`Installing plugin ${i}`);let e=await N([i]);if(e.failed.length>0){let t=e.failed.map(e=>`${e.name}: ${e.error}`).join(`, `);throw Error(`Failed to install plugin: ${t}`)}b(),D(`Plugin ${i} installed`)}a({phase:`ready`}),e()}catch(e){let n=T(e);O(n),a({phase:`error`,message:n.message}),t(n.message)}}n()},[e,t]),i.phase===`error`)return(0,K.jsx)(n,{flexDirection:`column`,children:(0,K.jsxs)(r,{color:`error`,children:[`Error: `,i.message]})});if(i.phase===`ready`)return null;let c=i.phase===`checking`?`Checking thinkback installation…`:i.phase===`installing-marketplace`?`Installing marketplace…`:i.phase===`enabling-plugin`?`Enabling thinkback plugin…`:`Installing thinkback plugin…`;return(0,K.jsx)(n,{flexDirection:`column`,children:(0,K.jsxs)(n,{children:[(0,K.jsx)(h,{}),(0,K.jsx)(r,{children:o||c})]})})}function W({onDone:e,onAction:t,skillDir:i,hasGenerated:a}){let[o,c]=(0,G.useState)(!1),l=a?[{label:`Play animation`,value:`play`,description:`Watch your year in review`},{label:`Edit content`,value:`edit`,description:`Modify the animation`},{label:`Fix errors`,value:`fix`,description:`Fix validation or rendering issues`},{label:`Regenerate`,value:`regenerate`,description:`Create a new animation from scratch`}]:[{label:`Let's go!`,value:`regenerate`,description:`Generate your personalized animation`}];function u(n){c(!0),n===`play`?H(i).then(()=>{e(void 0,{display:`skip`})}):t(n)}function d(){e(void 0,{display:`skip`})}return o?null:(0,K.jsx)(s,{title:`Think Back on 2025 with Work Mate`,subtitle:`Generate your 2025 Work Mate Think Back (takes a few minutes to run)`,onCancel:d,color:`claude`,children:(0,K.jsxs)(n,{flexDirection:`column`,gap:1,children:[!a&&(0,K.jsxs)(n,{flexDirection:`column`,children:[(0,K.jsx)(r,{children:`Relive your year of coding with Claude.`}),(0,K.jsx)(r,{dimColor:!0,children:`We'll create a personalized ASCII animation celebrating your journey.`})]}),(0,K.jsx)(v,{options:l,onChange:u,visibleOptionCount:5})]})})}function le({onDone:e}){let[t,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null);function d(){i(!0)}let f=(0,G.useCallback)(t=>{o(t),e(`Error with thinkback: ${t}. Try running /plugin to manually install the think-back plugin.`,{display:`system`})},[e]);(0,G.useEffect)(()=>{t&&!s&&!a&&V().then(e=>{e?(D(`Thinkback skill directory: ${e}`),c(e)):f(`Could not find thinkback skill directory`)})},[t,s,a,f]),(0,G.useEffect)(()=>{if(!s)return;let e=I(s,`year_in_review.js`);A(e).then(t=>{D(`Checking for ${e}: ${t?`found`:`not found`}`),u(t)})},[s]);function p(t){e({edit:Z,fix:Q,regenerate:$}[t],{display:`user`,shouldQuery:!0})}return a?(0,K.jsxs)(n,{flexDirection:`column`,children:[(0,K.jsxs)(r,{color:`error`,children:[`Error: `,a]}),(0,K.jsx)(r,{dimColor:!0,children:`Try running /plugin to manually install the think-back plugin.`})]}):t?!s||l===null?(0,K.jsxs)(n,{children:[(0,K.jsx)(h,{}),(0,K.jsx)(r,{children:`Loading thinkback skill…`})]}):(0,K.jsx)(W,{onDone:e,onAction:p,skillDir:s,hasGenerated:l}):(0,K.jsx)(U,{onReady:d,onError:f})}async function ue(e){return(0,K.jsx)(le,{onDone:e})}var G,K,q,J,Y,X,Z,Q,$,de=e((()=>{re(),a(),G=t(a(),1),te(),o(),C(),F(),E(),ne(),ae(),j(),se(),k(),S(),d(),g(),l(),y(),M(),K=c(),q=`claude-code-marketplace`,J=`anthropics/claude-code-marketplace`,Y=`anthropics/claude-plugins-official`,X=`thinkback`,Z=`Use the Skill tool to invoke the "thinkback" skill with mode=edit to modify my existing Work Mate year in review animation. Ask me what I want to change. When the animation is ready, tell the user to run /think-back again to play it.`,Q=`Use the Skill tool to invoke the "thinkback" skill with mode=fix to fix validation or rendering errors in my existing Work Mate year in review animation. Run the validator, identify errors, and fix them. When the animation is ready, tell the user to run /think-back again to play it.`,$=`Use the Skill tool to invoke the "thinkback" skill with mode=regenerate to create a completely new Work Mate year in review animation from scratch. Delete the existing animation and start fresh. When the animation is ready, tell the user to run /think-back again to play it.`}));export{de as n,H as r,ue as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$D as t,Es as n,Ms as r,ZD as i}from"./loadAgentsDir-DrDu5yYy.js";import{n as a,r as o}from"./thinkback-CXsRbDYN.js";import{join as s}from"path";function c(){return`thinkback@${process.env.USER_TYPE===`ant`?u:i}`}async function l(){let e=r(),t=c(),n=e.plugins[t];if(!n||n.length===0)return{type:`text`,value:`Thinkback plugin not installed. Run /think-back first to install it.`};let i=n[0];return i?.installPath?{type:`text`,value:(await o(s(i.installPath,`skills`,d))).message}:{type:`text`,value:`Thinkback plugin installation path not found.`}}var u,d;e((()=>{n(),t(),a(),u=`claude-code-marketplace`,d=`thinkback`}))();export{l as call};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{r,t as i}from"./execFileNoThrow-DResQRvR.js";import{a,i as o,t as s}from"./cliLaunch-BJ9o-rIV.js";import{spawnSync as c}from"child_process";var l;e((()=>{r(),o(),t(),l=class{constructor(){n(this,`name`,`tmux`),n(this,`supportsInteractiveInput`,!0)}async available(){let{code:e}=await i(`tmux`,[`-V`],{useCwd:!1});return e===0}async start(e){let t=s(e.args,{env:{...e.env,CLAUDE_CODE_SESSION_KIND:`bg`,CLAUDE_CODE_SESSION_NAME:e.sessionName,CLAUDE_CODE_SESSION_LOG:e.logPath,CLAUDE_CODE_TMUX_SESSION:e.sessionName}}),n=a(t);if(c(`tmux`,[`new-session`,`-d`,`-s`,e.sessionName,n],{stdio:`inherit`,env:t.env}).status!==0)throw Error(`Failed to create tmux session.`);return{pid:0,sessionName:e.sessionName,logPath:e.logPath,engineUsed:`tmux`}}async attach(e){if(!e.tmuxSessionName)throw Error(`Session ${e.sessionId} has no tmux session name.`);if(c(`tmux`,[`attach-session`,`-t`,e.tmuxSessionName],{stdio:`inherit`}).status!==0)throw Error(`Failed to attach to tmux session '${e.tmuxSessionName}'.`)}}}))();export{l as TmuxEngine};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{r,t as i}from"./execFileNoThrow-D244NytW.js";import{a,i as o,t as s}from"./cliLaunch-BkPAatcs.js";import{spawnSync as c}from"child_process";var l;e((()=>{r(),o(),t(),l=class{constructor(){n(this,`name`,`tmux`),n(this,`supportsInteractiveInput`,!0)}async available(){let{code:e}=await i(`tmux`,[`-V`],{useCwd:!1});return e===0}async start(e){let t=s(e.args,{env:{...e.env,CLAUDE_CODE_SESSION_KIND:`bg`,CLAUDE_CODE_SESSION_NAME:e.sessionName,CLAUDE_CODE_SESSION_LOG:e.logPath,CLAUDE_CODE_TMUX_SESSION:e.sessionName}}),n=a(t);if(c(`tmux`,[`new-session`,`-d`,`-s`,e.sessionName,n],{stdio:`inherit`,env:t.env}).status!==0)throw Error(`Failed to create tmux session.`);return{pid:0,sessionName:e.sessionName,logPath:e.logPath,engineUsed:`tmux`}}async attach(e){if(!e.tmuxSessionName)throw Error(`Session ${e.sessionId} has no tmux session name.`);if(c(`tmux`,[`attach-session`,`-t`,e.tmuxSessionName],{stdio:`inherit`}).status!==0)throw Error(`Failed to attach to tmux session '${e.tmuxSessionName}'.`)}}}))();export{l as TmuxEngine};
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./toolEventObserver-9-5Ne25Z.js";i();export{c as hasToolHookObservationsForTurn,o as pruneEmittedTurns,n as recordToolComplete,e as recordToolError,a as recordToolStart,s as recordUserCorrection,t as resetToolHookBookkeeping,r as resetToolHookDepsCache,l as runToolCallWithSkillLearningHooks};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./toolEventObserver-DdhPsAs1.js";i();export{c as hasToolHookObservationsForTurn,o as pruneEmittedTurns,n as recordToolComplete,e as recordToolError,a as recordToolStart,s as recordUserCorrection,t as resetToolHookBookkeeping,r as resetToolHookDepsCache,l as runToolCallWithSkillLearningHooks};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,p as n}from"./debug-DiuXEmUq.js";import{o as r,s as i}from"./log-Duzb4o6h.js";import{i as a,t as o}from"./observationStore-DzCdXq8U.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-BaDZBAoK.js`),import(`./featureCheck-CrJeuheQ.js`),import(`./runtimeObserver-DOZFrqJu.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,t,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,t).catch(e=>{n(`skill-learning: recordToolStart error`),i(e)})}catch(e){n(`skill-learning: hook setup error`),i(e)}try{let t=await a();return o&&_(o,e,t,`success`).catch(e=>{n(`skill-learning: recordToolComplete error`),i(e)}),t}catch(t){throw o&&v(o,e,t).catch(e=>{n(`skill-learning: recordToolError error`),i(e)}),t}}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,D=e((()=>{a(),t(),r(),x=500,S=250,C=50,w=25,T=new Map}));export{v as a,d as c,_ as i,m as l,D as n,g as o,c as r,y as s,u as t,h as u};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,l as n}from"./debug-BrXObCdR.js";import{o as r,s as i}from"./log-BMCygSzM.js";import{i as a,t as o}from"./observationStore-DzCdXq8U.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-BaDZBAoK.js`),import(`./featureCheck-CrJeuheQ.js`),import(`./runtimeObserver-DSUuYKfs.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,t,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,t).catch(e=>{n(`skill-learning: recordToolStart error`),i(e)})}catch(e){n(`skill-learning: hook setup error`),i(e)}try{let t=await a();return o&&_(o,e,t,`success`).catch(e=>{n(`skill-learning: recordToolComplete error`),i(e)}),t}catch(t){throw o&&v(o,e,t).catch(e=>{n(`skill-learning: recordToolError error`),i(e)}),t}}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,D=e((()=>{a(),t(),r(),x=500,S=250,C=50,w=25,T=new Map}));export{v as a,d as c,_ as i,m as l,D as n,g as o,c as r,y as s,u as t,h as u};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{MD as t,M_ as n,N_ as r,jD as i}from"./loadAgentsDir-DrDu5yYy.js";import{n as a,t as o}from"./partition-RjCtgt9J.js";function s(e,n,i){let[o,s]=a(t([...e,...n],`name`),r),c=(e,t)=>e.name.localeCompare(t.name);return[...s.sort(c),...o.sort(c)]}var c=e((()=>{o(),i(),n()}));export{s as n,c as t};
@@ -0,0 +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{F as a,S as o,a as s,l as c,w as l,z as u}from"./debug-BrXObCdR.js";import{d,f}from"./log-BMCygSzM.js";import{l as p,u as m}from"./oauth-BqJqV-2M.js";import{Cn as h,Vt as g,pt as _,wn as v}from"./model-fi472PRc.js";import{hostname as y}from"os";i(),n(),m(),s(),u(),d(),v(),o();var b=`tengu_sessions_elevated_auth_enforcement`;function x(){return!1}var S=t(()=>process.env.CLAUDE_TRUSTED_DEVICE_TOKEN||h().read()?.trustedDeviceToken);function C(){if(x())return S()}function w(){S.cache?.clear?.()}function T(){if(!x())return;let e=h();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}=(g(),e(_)),n=t()?.accessToken;if(!n){c(`[trusted-device] No OAuth token, skipping enrollment`);return}let i=h();if(f()){c(`[trusted-device] Essential traffic only, skipping enrollment`);return}let o=p().BASE_API_URL,s;try{s=await r.post(`${o}/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: ${a(e)}`);return}if(s.status!==200&&s.status!==201){c(`[trusted-device] Enrollment failed ${s.status}: ${l(s.data).slice(0,200)}`);return}let u=s.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=${s.data.device_id??`unknown`}`)}catch(e){c(`[trusted-device] Storage write failed: ${a(e)}`)}}catch(e){c(`[trusted-device] Enrollment error: ${a(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-DvpN4J1F.js";export{t as clearTrustedDeviceToken,e as enrollTrustedDevice};