@readmagic/workmate 0.0.4 → 0.0.5

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 (402) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-BTC7FPqM.js → AddWorkspaceDirectory-DJRkEz7o.js} +1 -1
  2. package/dist/chunks/{App-DOm71vtY.js → App-iJu5qyiF.js} +1 -1
  3. package/dist/chunks/ApproveApiKey-CKfn7U1R.js +1 -0
  4. package/dist/chunks/{ApproveApiKey-9YQzwrrC.js → ApproveApiKey-CRejTHUw.js} +1 -1
  5. package/dist/chunks/{AssistantSessionChooser-CnYfFWrx.js → AssistantSessionChooser-CBLQ1v-J.js} +1 -1
  6. package/dist/chunks/BackgroundTasksDialog-CyoLEYWH.js +2 -0
  7. package/dist/chunks/{BypassPermissionsModeDialog-DAq-qbqC.js → BypassPermissionsModeDialog-D1FCKVOi.js} +1 -1
  8. package/dist/chunks/{ClaudeMdExternalIncludesDialog-CyvidoR3.js → ClaudeMdExternalIncludesDialog-CI0yF6sZ.js} +1 -1
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-TypH-X8e.js +1 -0
  10. package/dist/chunks/ConsoleOAuthFlow-wGQuFt41.js +1 -0
  11. package/dist/chunks/{DesktopHandoff-gRvy-WlW.js → DesktopHandoff-D1rrMxeP.js} +1 -1
  12. package/dist/chunks/{DiffDialog-CdfVTgOx.js → DiffDialog-BKcfKx7O.js} +2 -2
  13. package/dist/chunks/Doctor-CcJUwSQn.js +1 -0
  14. package/dist/chunks/Doctor-Yco1McrL.js +3 -0
  15. package/dist/chunks/ExitFlow-D3csukbB.js +2 -0
  16. package/dist/chunks/{Feedback-gGpjUC_F.js → Feedback-bEUtrHia.js} +2 -2
  17. package/dist/chunks/Grove-DPkIjqg8.js +1 -0
  18. package/dist/chunks/{Grove-CD769Wvw.js → Grove-Dsd7F39b.js} +1 -1
  19. package/dist/chunks/{HybridTransport-kN1jmg26.js → HybridTransport-9fTBC2Pv.js} +1 -1
  20. package/dist/chunks/{InvalidConfigDialog-BpJub73a.js → InvalidConfigDialog-9M-1nfZ6.js} +1 -1
  21. package/dist/chunks/{InvalidSettingsDialog-DzOp3Ihx.js → InvalidSettingsDialog-B2F6pryH.js} +1 -1
  22. package/dist/chunks/MCPConnectionManager-MWpKjeZT.js +1 -0
  23. package/dist/chunks/{McpParsingWarnings-Cc6FWyU4.js → McpParsingWarnings-BPBb7Npe.js} +1 -1
  24. package/dist/chunks/MessageSelector-DsQmqFt2.js +3 -0
  25. package/dist/chunks/Messages-B3sGRx5A.js +11 -0
  26. package/dist/chunks/{Onboarding-D00lTweB.js → Onboarding-cHcnsBGp.js} +1 -1
  27. package/dist/chunks/{OverageCreditUpsell-B-Bf_-UX.js → OverageCreditUpsell-CWCD_RpM.js} +1 -1
  28. package/dist/chunks/PluginSettings-B0jbwB2M.js +17 -0
  29. package/dist/chunks/{PromptInputFooterSuggestions-MwS_cExV.js → PromptInputFooterSuggestions-D5sAO6y-.js} +1 -1
  30. package/dist/chunks/{PromptInputHelpMenu-V2dEpzhC.js → PromptInputHelpMenu-n6hAdsto.js} +1 -1
  31. package/dist/chunks/QueryEngine-cwdsr4dr.js +1 -0
  32. package/dist/chunks/REPL-CJzScgbZ.js +142 -0
  33. package/dist/chunks/REPL-DlBJIPCw.js +1 -0
  34. package/dist/chunks/{RemoteCallout-ChCjmgw1.js → RemoteCallout-CiA4rCEs.js} +1 -1
  35. package/dist/chunks/RemoteSessionManager-zdHfmvfj.js +2 -0
  36. package/dist/chunks/ResumeConversation-Rxwd6HAJ.js +1 -0
  37. package/dist/chunks/{SSETransport-h43pQVlJ.js → SSETransport-BPbhCa2f.js} +3 -3
  38. package/dist/chunks/SearchExtraToolsTool-VP87ErGx.js +1 -0
  39. package/dist/chunks/Settings-CxI_KHUj.js +2 -0
  40. package/dist/chunks/{TeleportProgress-QtJrXSCX.js → TeleportProgress-DrulEQ7z.js} +1 -1
  41. package/dist/chunks/{TeleportRepoMismatchDialog-D-HVj-A6.js → TeleportRepoMismatchDialog-D3FOLr0P.js} +1 -1
  42. package/dist/chunks/{TeleportResumeWrapper-C6sbzJsJ.js → TeleportResumeWrapper-DI5iRFND.js} +1 -1
  43. package/dist/chunks/{ThemePicker-CqPCp5Hs.js → ThemePicker-CQ7dfFtv.js} +1 -1
  44. package/dist/chunks/{TrustDialog-CeVwxDlZ.js → TrustDialog-CnVKrdxQ.js} +1 -1
  45. package/dist/chunks/{ValidationErrorsList-Bl68E-2-.js → ValidationErrorsList-CPYeuppg.js} +1 -1
  46. package/dist/chunks/{WelcomeV2-DNiXQ5ES.js → WelcomeV2-C-UXdIng.js} +1 -1
  47. package/dist/chunks/{add-dir-V3xjklnJ.js → add-dir-xTz4COgn.js} +1 -1
  48. package/dist/chunks/{agentDisplay-BuiwcrQi.js → agentDisplay-BuSReYxu.js} +1 -1
  49. package/dist/chunks/{agents-ZY6IaVE7.js → agents-CiLlKN2I.js} +1 -1
  50. package/dist/chunks/agents-Du9KYHqN.js +103 -0
  51. package/dist/chunks/allErrors-P3utlEeA.js +1 -0
  52. package/dist/chunks/{ant-D66LZCap.js → ant-CBIfqmAb.js} +1 -1
  53. package/dist/chunks/api-B-5jqiMg.js +1 -0
  54. package/dist/chunks/api-BiwZmmsh.js +1 -0
  55. package/dist/chunks/{assistant-CYF7ch7C.js → assistant-XOnU01yl.js} +1 -1
  56. package/dist/chunks/auth-BQa4kzQo.js +1 -0
  57. package/dist/chunks/auth-DT2yxy94.js +15 -0
  58. package/dist/chunks/auth-UAJhZNmZ.js +1 -0
  59. package/dist/chunks/{autoMode-TysBQkU_.js → autoMode-CEMflt3g.js} +1 -1
  60. package/dist/chunks/{autonomy-CNEbT-t_.js → autonomy-Cg5zweUa.js} +7 -7
  61. package/dist/chunks/{autonomy-k3QPea5z.js → autonomy-_N8aDaA8.js} +1 -1
  62. package/dist/chunks/{autonomyPanel-DiztRblF.js → autonomyPanel-I4yCy3Fr.js} +1 -1
  63. package/dist/chunks/backgroundHousekeeping-BUUZ7Csq.js +1 -0
  64. package/dist/chunks/backgroundHousekeeping-DhF2lrQ9.js +17 -0
  65. package/dist/chunks/{branch-_NBgDfrK.js → branch-BIX-pyHp.js} +1 -1
  66. package/dist/chunks/{bridge-DpmFl8p8.js → bridge-CYskzVt8.js} +2 -2
  67. package/dist/chunks/{bridgeConfig-DMBOO3gW.js → bridgeConfig-5p_w4s5r.js} +1 -1
  68. package/dist/chunks/bridgeConfig-DWEqKbXk.js +1 -0
  69. package/dist/chunks/bridgeEnabled-CjVCMwnq.js +1 -0
  70. package/dist/chunks/bridgeEnabled-DhFrLTbG.js +1 -0
  71. package/dist/chunks/bridgeMain-6lollTtZ.js +1 -0
  72. package/dist/chunks/bridgeMain-BX2AkLPs.js +68 -0
  73. package/dist/chunks/{bridgeMessaging-N5zlzCCr.js → bridgeMessaging-B5Lbzr8e.js} +1 -1
  74. package/dist/chunks/{btw-BFRje_Zi.js → btw-CWWFO7u8.js} +1 -1
  75. package/dist/chunks/caches-C46fa77L.js +1 -0
  76. package/dist/chunks/{caches-CcfPJ4_A.js → caches-DPqPIogk.js} +2 -2
  77. package/dist/chunks/{ccrClient-q2JCVCU2.js → ccrClient-CTLnU9Y1.js} +1 -1
  78. package/dist/chunks/{clear-CxY7W5Wt.js → clear-DCAgZwc4.js} +1 -1
  79. package/dist/chunks/client-Bup0Sgcn.js +1 -0
  80. package/dist/chunks/{color-DOWhfjnA.js → color-CmJGInHL.js} +1 -1
  81. package/dist/chunks/commands-BdB1eFvP.js +1 -0
  82. package/dist/chunks/{commitAttribution-CLbEIaRJ.js → commitAttribution-CGZr7XNO.js} +2 -2
  83. package/dist/chunks/commitAttribution-D6J3NuhB.js +1 -0
  84. package/dist/chunks/compact-C6-lMHgn.js +2 -0
  85. package/dist/chunks/{config-DiT2Z8dY.js → config-3m_9zSrj.js} +1 -1
  86. package/dist/chunks/config-Bxt1UH1T.js +1 -0
  87. package/dist/chunks/config-CjjXZfNi.js +1 -0
  88. package/dist/chunks/{context-B2OvKo2t.js → context-C9V4GF0n.js} +1 -1
  89. package/dist/chunks/{context-noninteractive-BuGxX3YL.js → context-noninteractive-BmC4o5xo.js} +2 -2
  90. package/dist/chunks/context-noninteractive-DvGo1l7b.js +1 -0
  91. package/dist/chunks/conversation-CH9ouFai.js +1 -0
  92. package/dist/chunks/conversation-CYqqk0o7.js +1 -0
  93. package/dist/chunks/{createSSHSession-C-c7I5iJ.js → createSSHSession-BL6j0AU5.js} +1 -1
  94. package/dist/chunks/createSession-DUfOAeyE.js +1 -0
  95. package/dist/chunks/{createSession-D_fIDqgc.js → createSession-D_sgO1Xy.js} +1 -1
  96. package/dist/chunks/crossProjectResume-D5hTOfnE.js +40 -0
  97. package/dist/chunks/{datadog-Ed8emSFA.js → datadog-UkGdjL8-.js} +1 -1
  98. package/dist/chunks/{desktop-D_ofPlyi.js → desktop-HbYKh-VK.js} +1 -1
  99. package/dist/chunks/{diff-CUAgBDu1.js → diff-nTV17iWX.js} +1 -1
  100. package/dist/chunks/doctor-7fgVhEKL.js +1 -0
  101. package/dist/chunks/{entry-Bh0gPOAo.js → entry-CCFI6-gM.js} +3 -3
  102. package/dist/chunks/envLessBridgeConfig-B2HYnEKo.js +1 -0
  103. package/dist/chunks/{envLessBridgeConfig-DJHZAlU-.js → envLessBridgeConfig-DXd10GXD.js} +1 -1
  104. package/dist/chunks/{esm-B62dCLgf.js → esm-CGoYrggU.js} +1 -1
  105. package/dist/chunks/exit-ropaQiOr.js +1 -0
  106. package/dist/chunks/extra-usage-CLhv1Z4g.js +1 -0
  107. package/dist/chunks/{extra-usage-core-B6ga8Rni.js → extra-usage-core-DLYHAInT.js} +1 -1
  108. package/dist/chunks/{extra-usage-CjaHpu8y.js → extra-usage-g2Pw4zt_.js} +1 -1
  109. package/dist/chunks/{extra-usage-noninteractive-Dc9AndId.js → extra-usage-noninteractive-D8iszH3c.js} +1 -1
  110. package/dist/chunks/extraUsage-C2Ylufhj.js +1 -0
  111. package/dist/chunks/extractMemories-B2IAvbXM.js +1 -0
  112. package/dist/chunks/{fast-CW_NsL0x.js → fast-Dx2fTmWr.js} +1 -1
  113. package/dist/chunks/fast-_G6zcFye.js +1 -0
  114. package/dist/chunks/{feedback-BpRorTAC.js → feedback-DCQ4pJ3v.js} +1 -1
  115. package/dist/chunks/{firstPartyEventLogger-CuUiNdj8.js → firstPartyEventLogger-BNGPPBNP.js} +2 -2
  116. package/dist/chunks/firstPartyEventLogger-C9LzVy6y.js +1 -0
  117. package/dist/chunks/{flushGate-BltVae97.js → flushGate-XaheIZZT.js} +1 -1
  118. package/dist/chunks/{gemini-YyIxfveQ.js → gemini-BCCLHK3K.js} +1 -1
  119. package/dist/chunks/{generateRecap-tx4wLIkI.js → generateRecap-BhvbixY2.js} +1 -1
  120. package/dist/chunks/{generateSessionName-BkDigIN8.js → generateSessionName-CN1oh7Fa.js} +1 -1
  121. package/dist/chunks/{githubRepoPathMapping-C4umZ1oC.js → githubRepoPathMapping-B4AM8luI.js} +1 -1
  122. package/dist/chunks/{goal-DZrD4puM.js → goal-Bp6fyGqo.js} +3 -3
  123. package/dist/chunks/{grok-BZf7W_hL.js → grok-ax26ju8y.js} +1 -1
  124. package/dist/chunks/{grove-CFBPplP6.js → grove-DrBVaZSN.js} +2 -2
  125. package/dist/chunks/{heapdump-DWc3Z2NO.js → heapdump-JseysNDr.js} +1 -1
  126. package/dist/chunks/{help-pap9jNUJ.js → help-DR9hKneR.js} +1 -1
  127. package/dist/chunks/hooks-BUJLxdFJ.js +1 -0
  128. package/dist/chunks/{hooks-Bmat0L6A.js → hooks-C5n23H1E.js} +2 -2
  129. package/dist/chunks/inboundAttachments-C0nMTtCi.js +1 -0
  130. package/dist/chunks/{inboundAttachments-DkfNHtF9.js → inboundAttachments-Cp8XvLMZ.js} +1 -1
  131. package/dist/chunks/initReplBridge-DJs28ZkI.js +1 -0
  132. package/dist/chunks/{install-D4jmHjmk.js → install-C7qTB0V5.js} +1 -1
  133. package/dist/chunks/{instrumentation-Nqgm1SMw.js → instrumentation-CLZttr_u.js} +4 -4
  134. package/dist/chunks/{job-CT9bcgPb.js → job-BhiazwPH.js} +1 -1
  135. package/dist/chunks/keybindings-CkL8BzUt.js +2 -0
  136. package/dist/chunks/{language-BA5WprZv.js → language-DIw2871r.js} +1 -1
  137. package/dist/chunks/language-DfOAuDFc.js +1 -0
  138. package/dist/chunks/launchAgentsPlatform-j-mWpwW1.js +1 -0
  139. package/dist/chunks/{launchLocalMemory-CRMqifzn.js → launchLocalMemory-DmoXp0Xo.js} +2 -2
  140. package/dist/chunks/{launchLocalVault-DlKX_oDE.js → launchLocalVault-1uKe0HjA.js} +3 -3
  141. package/dist/chunks/launchMemoryStores-SxDKjHJ3.js +1 -0
  142. package/dist/chunks/{launchOnboarding-DTdUA_wE.js → launchOnboarding-CTtpnXcs.js} +1 -1
  143. package/dist/chunks/launchSchedule-BDVnGhaL.js +1 -0
  144. package/dist/chunks/launchSkillStore-SmMLxp4K.js +1 -0
  145. package/dist/chunks/{launchTeleport-CXFRPVMR.js → launchTeleport-B472ZSGz.js} +3 -3
  146. package/dist/chunks/launchVault-CsyBgxle.js +1 -0
  147. package/dist/chunks/{loadAgentsDir-BURvZNN6.js → loadAgentsDir-Clu7Uk6a.js} +629 -629
  148. package/dist/chunks/loadAgentsDir-DTbJJff-.js +1 -0
  149. package/dist/chunks/loadPluginHooks-Cvd5VdjQ.js +1 -0
  150. package/dist/chunks/localSearch-DKv8PRLD.js +1 -0
  151. package/dist/chunks/{localSearch-D2Rs8wQP.js → localSearch-iA6JTk19.js} +1 -1
  152. package/dist/chunks/{logoV2Utils-DN9nzdX-.js → logoV2Utils-YHBJLIrC.js} +1 -1
  153. package/dist/chunks/{magicDocs-DIeTcwAA.js → magicDocs-Bf1fqnHN.js} +3 -3
  154. package/dist/chunks/{main-CI54PZrG.js → main-gtV_TqXP.js} +84 -84
  155. package/dist/chunks/{mappers-Q_Z3Kjo-.js → mappers-C8lYERPX.js} +1 -1
  156. package/dist/chunks/{mcp-RvwPC7FB.js → mcp-CNuhEGP6.js} +4 -4
  157. package/dist/chunks/mcp-Ci0OPVrR.js +1 -0
  158. package/dist/chunks/mcp-CwIYauZl.js +2 -0
  159. package/dist/chunks/memory-DCGqfQ1U.js +1 -0
  160. package/dist/chunks/{mode-Jl_Boaym.js → mode-DO6g7nkX.js} +2 -2
  161. package/dist/chunks/model-BQF64tZx.js +1 -0
  162. package/dist/chunks/model-DLXL0CNu.js +1 -0
  163. package/dist/chunks/model-DvrvG6BB.js +1 -0
  164. package/dist/chunks/{nativeInstaller-8arnRiUO.js → nativeInstaller-OPuO2sm_.js} +1 -1
  165. package/dist/chunks/{onChangeAppState-DBantDJ6.js → onChangeAppState-CHhRDkM7.js} +1 -1
  166. package/dist/chunks/openai-HOebt-8k.js +10 -0
  167. package/dist/chunks/{overageCreditGrant-CN_sVURL.js → overageCreditGrant-Bi1CTBAx.js} +1 -1
  168. package/dist/chunks/{panelCall-CPKC6VR5.js → panelCall-D0eURklm.js} +1 -1
  169. package/dist/chunks/{partition-CW0BJ881.js → partition-C8RSL3SQ.js} +1 -1
  170. package/dist/chunks/{passes-DOm9ukdK.js → passes-BJci5SM_.js} +1 -1
  171. package/dist/chunks/permissions-JU9CGHgI.js +3 -0
  172. package/dist/chunks/{pidLock-C69HNTTb.js → pidLock-Bd2e6xuT.js} +2 -2
  173. package/dist/chunks/{plan-B0rEs32a.js → plan-D4gMsK7i.js} +1 -1
  174. package/dist/chunks/{plugin-BSEMgcGu.js → plugin-CwCo5Kik.js} +1 -1
  175. package/dist/chunks/{pluginAutoupdate-CTByPD8J.js → pluginAutoupdate-CO-n9bqe.js} +1 -1
  176. package/dist/chunks/{pluginBlocklist-mogKaK0p.js → pluginBlocklist-5qbaTRbV.js} +1 -1
  177. package/dist/chunks/pluginCliCommands-I-lsw_us.js +1 -0
  178. package/dist/chunks/{pluginFlagging-mHNff1t9.js → pluginFlagging-DNPBbJZo.js} +1 -1
  179. package/dist/chunks/{pluginOperations-JEedVzfS.js → pluginOperations-Cz6eQ0Vu.js} +2 -2
  180. package/dist/chunks/pluginStartupCheck-CoW7073W.js +1 -0
  181. package/dist/chunks/{pluginStartupCheck-RscVZDi4.js → pluginStartupCheck-DJ9fslCK.js} +1 -1
  182. package/dist/chunks/plugins-CzJIuPfb.js +4 -0
  183. package/dist/chunks/policyLimits-BkjgMQD0.js +1 -0
  184. package/dist/chunks/{poor-DekfGNT7.js → poor-Dha9p9RF.js} +1 -1
  185. package/dist/chunks/{poorMode-CtcqaiwD.js → poorMode-1NLYiS3Y.js} +1 -1
  186. package/dist/chunks/poorMode-qlxqU8Hm.js +1 -0
  187. package/dist/chunks/print-BL4EUT5Z.js +23 -0
  188. package/dist/chunks/{privacy-settings-CwJ1H8Ua.js → privacy-settings-6ZWxR4Qt.js} +1 -1
  189. package/dist/chunks/processBashCommand-BZs9wggV.js +1 -0
  190. package/dist/chunks/processSlashCommand-D8lKLNzM.js +5 -0
  191. package/dist/chunks/{prompt-DNDgGM9q.js → prompt-Bg_1U0gO.js} +1 -1
  192. package/dist/chunks/prompt-CN7gBNKS.js +1 -0
  193. package/dist/chunks/prompt-D-zHhqp8.js +1 -0
  194. package/dist/chunks/{promptEditor-DMJyosKj.js → promptEditor-BhYDmwdS.js} +2 -2
  195. package/dist/chunks/{protocolHandler-z2zxAtB1.js → protocolHandler-Dnb7lITm.js} +1 -1
  196. package/dist/chunks/rate-limit-options-DVzT3eWH.js +1 -0
  197. package/dist/chunks/{rcDebugLog-DoL1FpGJ.js → rcDebugLog-VKwMl0yg.js} +1 -1
  198. package/dist/chunks/reconciler-BdRXZTJf.js +4 -0
  199. package/dist/chunks/{referral-UKJv23_5.js → referral-BlrMpBAV.js} +1 -1
  200. package/dist/chunks/{refresh-ul_i5R1a.js → refresh-jwqnoK2h.js} +1 -1
  201. package/dist/chunks/{registerProtocol-CukLQuxJ.js → registerProtocol-CuKZAiCc.js} +1 -1
  202. package/dist/chunks/{release-notes-CGv_6MMt.js → release-notes-BgP8u7NE.js} +1 -1
  203. package/dist/chunks/{releaseNotes-BKZNuDLD.js → releaseNotes-CunqVlbU.js} +2 -2
  204. package/dist/chunks/{reload-plugins-2W11dpLQ.js → reload-plugins-CD9TzvFm.js} +1 -1
  205. package/dist/chunks/{remote-env-D9xsoBfx.js → remote-env-QaP_W_sv.js} +1 -1
  206. package/dist/chunks/{remoteBridgeCore-asY9JAXU.js → remoteBridgeCore-9-HVMo63.js} +1 -1
  207. package/dist/chunks/{remoteManagedSettings-Bxo3bv1U.js → remoteManagedSettings-jZ6u8ZBT.js} +1 -1
  208. package/dist/chunks/{rename-CHsHMWpO.js → rename-29qxHf8W.js} +1 -1
  209. package/dist/chunks/{resume-NduOaghx.js → resume-D-SpOy_1.js} +2 -2
  210. package/dist/chunks/{runtimeObserver-Bo80nWQf.js → runtimeObserver-DOEcrylu.js} +1 -1
  211. package/dist/chunks/{runtimeObserver-BXbjibFk.js → runtimeObserver-Dm3LIUMp.js} +3 -3
  212. package/dist/chunks/sandbox-adapter-LzTcKwBp.js +1 -0
  213. package/dist/chunks/{sandbox-toggle-C-WCDRN4.js → sandbox-toggle-B61AeBor.js} +1 -1
  214. package/dist/chunks/searchExtraTools-CbJJQqzH.js +1 -0
  215. package/dist/chunks/{session-pDd13-wE.js → session-RwJCIIcs.js} +2 -2
  216. package/dist/chunks/{sessionDiscovery-CSUnpsCy.js → sessionDiscovery-dkFeWcA3.js} +1 -1
  217. package/dist/chunks/sessionFileAccessHooks-B_nNW0zE.js +1 -0
  218. package/dist/chunks/sessionMemory-C4JAUZ6V.js +1 -0
  219. package/dist/chunks/sessionMemory-btARBn8H.js +1 -0
  220. package/dist/chunks/sessionMemoryUtils-BlqAy8oR.js +1 -0
  221. package/dist/chunks/{sessionObserver-Ur7PqKl_.js → sessionObserver-CSOYgsvH.js} +1 -1
  222. package/dist/chunks/sessionObserver-DMvWci8-.js +1 -0
  223. package/dist/chunks/sessionStorage-Diyuvt20.js +1 -0
  224. package/dist/chunks/{sessionTitle-pWMaI79N.js → sessionTitle-CLOlPZ_M.js} +1 -1
  225. package/dist/chunks/{sessionTracing-CCPRzOvy.js → sessionTracing-D8wr9j4X.js} +1 -1
  226. package/dist/chunks/{settings-DfWP5y6X.js → settings-Dlp5JTa_.js} +1 -1
  227. package/dist/chunks/settingsSync-QWA0VZSu.js +1 -0
  228. package/dist/chunks/setup-UI9uv2-K.js +3 -0
  229. package/dist/chunks/{shadowedRuleDetection-Chi3afMR.js → shadowedRuleDetection-CXsmUY2o.js} +1 -1
  230. package/dist/chunks/{sideQuestion-D03MXdE2.js → sideQuestion-CHpOVzY5.js} +1 -1
  231. package/dist/chunks/{sinks-B4_pw0Gb.js → sinks-1hFrW9HK.js} +2 -2
  232. package/dist/chunks/sinks-CXq8-7Qn.js +1 -0
  233. package/dist/chunks/{skill-learning-7ZQF5JvA.js → skill-learning-Ck17rwH8.js} +1 -1
  234. package/dist/chunks/skillChangeDetector-s0F9Yf9a.js +1 -0
  235. package/dist/chunks/{skillGapStore-BND2Lq0Z.js → skillGapStore-BJ1h2LVr.js} +1 -1
  236. package/dist/chunks/{skillGapStore-z3LP64O-.js → skillGapStore-DyqNKuNy.js} +2 -2
  237. package/dist/chunks/{skillGenerator-DaNb-yKH.js → skillGenerator-BT8NGzXT.js} +2 -2
  238. package/dist/chunks/skillLearning-1ZfYIzfL.js +1 -0
  239. package/dist/chunks/{skillLearning-rMX1bSBa.js → skillLearning-Cn9Uw0Kd.js} +1 -1
  240. package/dist/chunks/{skillPanel-q7GPSQ6_.js → skillPanel-N0GoWjIi.js} +3 -3
  241. package/dist/chunks/{skillSearchPanel-oj8gy1ZL.js → skillSearchPanel-CTwtgTzy.js} +3 -3
  242. package/dist/chunks/{skills-QqbeFP0s.js → skills-Bv3lH-aA.js} +1 -1
  243. package/dist/chunks/{stats-DmFubHpI.js → stats-C1Ff6w4i.js} +1 -1
  244. package/dist/chunks/{status-DW3Z_7xa.js → status-DyXiBa0m.js} +2 -2
  245. package/dist/chunks/{status-BEIsLmfj.js → status-FD7HVYS7.js} +1 -1
  246. package/dist/chunks/{statusNoticeHelpers-CaHS8xig.js → statusNoticeHelpers-kTp9Rdk6.js} +1 -1
  247. package/dist/chunks/{tag-CRg93Die.js → tag-RzOSA5T0.js} +2 -2
  248. package/dist/chunks/{tasks-BEohK1ij.js → tasks-eJrOcdhB.js} +1 -1
  249. package/dist/chunks/teleport-ABA-hdmP.js +1 -0
  250. package/dist/chunks/{templateJobs-DYP1fjYU.js → templateJobs-BnOBSFtq.js} +1 -1
  251. package/dist/chunks/{terminalSetup-RDKg8dVa.js → terminalSetup-BfvmoJaK.js} +1 -1
  252. package/dist/chunks/{terminalSetup-BNs9nLbT.js → terminalSetup-D_P5iZmq.js} +1 -1
  253. package/dist/chunks/{theme-kNL4kl_3.js → theme-S0kVMVt4.js} +1 -1
  254. package/dist/chunks/thinkback-C6gV2LpU.js +1 -0
  255. package/dist/chunks/thinkback-HyW_R_88.js +1 -0
  256. package/dist/chunks/{thinkback-play-BpWMqbgJ.js → thinkback-play-H6md4czq.js} +1 -1
  257. package/dist/chunks/{toolEventObserver-ar5NDa0M.js → toolEventObserver--Z6jENks.js} +1 -1
  258. package/dist/chunks/{toolEventObserver-C98uraqD.js → toolEventObserver-BAFzvePj.js} +1 -1
  259. package/dist/chunks/toolPool-CR61XXm3.js +1 -0
  260. package/dist/chunks/trustedDevice-DUrFWupL.js +1 -0
  261. package/dist/chunks/{trustedDevice-BBKUhCCL.js → trustedDevice-Dn4rXbxT.js} +1 -1
  262. package/dist/chunks/types-Bh9S_JG5.js +3 -0
  263. package/dist/chunks/types-DHkZVzJe.js +1 -0
  264. package/dist/chunks/{ultrareviewCommand-yXlFsMnv.js → ultrareviewCommand-mYDTBCFD.js} +2 -2
  265. package/dist/chunks/{undercover-BTIRVF1t.js → undercover-CdapzvNH.js} +1 -1
  266. package/dist/chunks/undercover-k3JoOKAb.js +1 -0
  267. package/dist/chunks/{updateCCB-B2xAJ4Nr.js → updateCCB-DPShheOr.js} +1 -1
  268. package/dist/chunks/upgrade-BOeakAP6.js +1 -0
  269. package/dist/chunks/upgrade-D7iGU0PQ.js +1 -0
  270. package/dist/chunks/{upload-BWVIHmMB.js → upload-BXQsDtLW.js} +1 -1
  271. package/dist/chunks/usage-DbRdMJog.js +1 -0
  272. package/dist/chunks/usage-iNQzY960.js +1 -0
  273. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-CV4GZ-sq.js → useExitOnCtrlCDWithKeybindings-CntByfTQ.js} +1 -1
  274. package/dist/chunks/useMainLoopModel-DHkRIgNs.js +1 -0
  275. package/dist/chunks/useManagePlugins-B8HD0RUh.js +1 -0
  276. package/dist/chunks/{useMergedTools-CRLWSGDl.js → useMergedTools-DfchLQZC.js} +1 -1
  277. package/dist/chunks/{useSearchInput-BzGq4t7t.js → useSearchInput-H-8hJeFD.js} +1 -1
  278. package/dist/chunks/useSettingsErrors-BF5i5Xju.js +1 -0
  279. package/dist/chunks/{util-BnReK81E.js → util-CoicMvOv.js} +1 -1
  280. package/dist/chunks/validatePlugin-z2fcngf8.js +1 -0
  281. package/dist/chunks/{vim-C0KTnJJs.js → vim-DdvQlLDm.js} +1 -1
  282. package/dist/chunks/{workerRegistry-CUXbNyL9.js → workerRegistry-CzqQwCHC.js} +1 -1
  283. package/dist/chunks/worktree-DMhP5T0p.js +1 -0
  284. package/dist/cli.js +1 -1
  285. package/package.json +1 -1
  286. package/dist/chunks/ApproveApiKey-LPrZMlgU.js +0 -1
  287. package/dist/chunks/BackgroundTasksDialog-D_UHm7xo.js +0 -2
  288. package/dist/chunks/ClaudeMdExternalIncludesDialog--w2zWWEn.js +0 -1
  289. package/dist/chunks/ConsoleOAuthFlow-BXdC6j3_.js +0 -1
  290. package/dist/chunks/Doctor-BuiYwjAS.js +0 -1
  291. package/dist/chunks/Doctor-DKlHJBXq.js +0 -3
  292. package/dist/chunks/ExitFlow-rExuBL3w.js +0 -2
  293. package/dist/chunks/Grove-ENfM8hC6.js +0 -1
  294. package/dist/chunks/MCPConnectionManager-CaBvO7NB.js +0 -1
  295. package/dist/chunks/MessageSelector-DOB1S2-O.js +0 -3
  296. package/dist/chunks/Messages-Clihwd2F.js +0 -11
  297. package/dist/chunks/PluginSettings-DUxj_oAg.js +0 -17
  298. package/dist/chunks/QueryEngine-BLcPQYq_.js +0 -1
  299. package/dist/chunks/REPL-B_E07dnf.js +0 -142
  300. package/dist/chunks/REPL-BhURgntS.js +0 -1
  301. package/dist/chunks/RemoteSessionManager-B43isWQs.js +0 -2
  302. package/dist/chunks/ResumeConversation-DaQ9n8_C.js +0 -1
  303. package/dist/chunks/SearchExtraToolsTool-DSq7beKs.js +0 -1
  304. package/dist/chunks/Settings-CNsaWv8g.js +0 -2
  305. package/dist/chunks/agents-D7um1IXM.js +0 -103
  306. package/dist/chunks/allErrors-CHVdQ3fT.js +0 -1
  307. package/dist/chunks/api-C-rOQY-l.js +0 -1
  308. package/dist/chunks/api-Dmn7DUgU.js +0 -1
  309. package/dist/chunks/auth-C4Rvit2q.js +0 -1
  310. package/dist/chunks/auth-Cj7EX1eG.js +0 -1
  311. package/dist/chunks/auth-DAxGNCIR.js +0 -15
  312. package/dist/chunks/backgroundHousekeeping-C9m4tiFi.js +0 -17
  313. package/dist/chunks/backgroundHousekeeping-DQjzXBe0.js +0 -1
  314. package/dist/chunks/bridgeConfig-DsI5d0s7.js +0 -1
  315. package/dist/chunks/bridgeEnabled-DZzlF2d8.js +0 -1
  316. package/dist/chunks/bridgeEnabled-FjPuA7zx.js +0 -1
  317. package/dist/chunks/bridgeMain-BppY0KW3.js +0 -68
  318. package/dist/chunks/bridgeMain-BrY4tkF6.js +0 -1
  319. package/dist/chunks/caches-BBLH8G1I.js +0 -1
  320. package/dist/chunks/client-CtVu3BLD.js +0 -1
  321. package/dist/chunks/commands-BWw1sQeH.js +0 -1
  322. package/dist/chunks/commitAttribution-DIT_s0vY.js +0 -1
  323. package/dist/chunks/compact-CaOnQVkH.js +0 -2
  324. package/dist/chunks/config-DmPGzNmi.js +0 -1
  325. package/dist/chunks/config-HHTwEsWp.js +0 -1
  326. package/dist/chunks/context-noninteractive-BilCSCV1.js +0 -1
  327. package/dist/chunks/conversation-BWXf3un9.js +0 -1
  328. package/dist/chunks/conversation-awh8AwwL.js +0 -1
  329. package/dist/chunks/createSession-Hvpx3Le7.js +0 -1
  330. package/dist/chunks/crossProjectResume-_XjvSXA3.js +0 -40
  331. package/dist/chunks/doctor-CkdQ7Fv7.js +0 -1
  332. package/dist/chunks/effort-DCgooYMY.js +0 -9
  333. package/dist/chunks/envLessBridgeConfig-sxodu0xO.js +0 -1
  334. package/dist/chunks/exit-CFJR3NfE.js +0 -1
  335. package/dist/chunks/extra-usage-D1Y-3OWQ.js +0 -1
  336. package/dist/chunks/extraUsage-2DwLEr26.js +0 -1
  337. package/dist/chunks/extractMemories-C3qrwpu2.js +0 -1
  338. package/dist/chunks/fast-D3CPmUX4.js +0 -1
  339. package/dist/chunks/firstPartyEventLogger-DPUQnc6J.js +0 -1
  340. package/dist/chunks/hooks-cCAzfabs.js +0 -1
  341. package/dist/chunks/inboundAttachments-DZgSqDwY.js +0 -1
  342. package/dist/chunks/initReplBridge-myzllvlk.js +0 -1
  343. package/dist/chunks/keybindings-DETOn3qJ.js +0 -2
  344. package/dist/chunks/language-BbaOTWm3.js +0 -1
  345. package/dist/chunks/launchAgentsPlatform-CuRQgd2Q.js +0 -1
  346. package/dist/chunks/launchMemoryStores-CN0ecWpP.js +0 -1
  347. package/dist/chunks/launchSchedule-psiSLmTA.js +0 -1
  348. package/dist/chunks/launchSkillStore-CQQ00Ads.js +0 -1
  349. package/dist/chunks/launchVault-Dn6jq0Rc.js +0 -1
  350. package/dist/chunks/loadAgentsDir-Db9UTm45.js +0 -1
  351. package/dist/chunks/loadPluginHooks-C9A9oS-w.js +0 -1
  352. package/dist/chunks/localSearch-hBh1ATr2.js +0 -1
  353. package/dist/chunks/mcp-CtbhGaLC.js +0 -2
  354. package/dist/chunks/mcp-DMacvhqZ.js +0 -1
  355. package/dist/chunks/memory-BPN8gW7n.js +0 -1
  356. package/dist/chunks/model-BIVmcl_N.js +0 -1
  357. package/dist/chunks/model-CWBwPvTH.js +0 -1
  358. package/dist/chunks/model-DlVpqR0P.js +0 -1
  359. package/dist/chunks/openai-yin1iDG8.js +0 -10
  360. package/dist/chunks/permissions-CxDJ__l6.js +0 -3
  361. package/dist/chunks/pluginCliCommands-DQQ7C7kk.js +0 -1
  362. package/dist/chunks/pluginStartupCheck-D7ts2V3p.js +0 -1
  363. package/dist/chunks/plugins-Cr03lISA.js +0 -4
  364. package/dist/chunks/policyLimits-DWtLyJ4n.js +0 -1
  365. package/dist/chunks/poorMode-AE4WNYZo.js +0 -1
  366. package/dist/chunks/print-CZUmAzmt.js +0 -23
  367. package/dist/chunks/processBashCommand-aKNneP2u.js +0 -1
  368. package/dist/chunks/processSlashCommand-BcPnWNxZ.js +0 -5
  369. package/dist/chunks/prompt-CIyhCdkE.js +0 -1
  370. package/dist/chunks/prompt-DRhjinu2.js +0 -1
  371. package/dist/chunks/rate-limit-options--Y3oF1g0.js +0 -1
  372. package/dist/chunks/reconciler-CJcSh6xo.js +0 -4
  373. package/dist/chunks/sandbox-adapter-DDfVl_2V.js +0 -1
  374. package/dist/chunks/searchExtraTools-BHWzsbNO.js +0 -1
  375. package/dist/chunks/sessionFileAccessHooks-BZvxeufx.js +0 -1
  376. package/dist/chunks/sessionMemory-CAmpw2yb.js +0 -1
  377. package/dist/chunks/sessionMemory-DT0IkiA1.js +0 -1
  378. package/dist/chunks/sessionMemoryUtils-B4kGNH4j.js +0 -1
  379. package/dist/chunks/sessionObserver-oIkwTidC.js +0 -1
  380. package/dist/chunks/sessionStorage-DqARUj0K.js +0 -1
  381. package/dist/chunks/settingsSync-D_4P3Esd.js +0 -1
  382. package/dist/chunks/setup-JHvhWKh9.js +0 -3
  383. package/dist/chunks/sinks-Cro1Y8C2.js +0 -1
  384. package/dist/chunks/skillChangeDetector-uCaYrerZ.js +0 -1
  385. package/dist/chunks/skillLearning-GZxYPlyl.js +0 -1
  386. package/dist/chunks/teleport-4Srg5vcP.js +0 -1
  387. package/dist/chunks/thinkback-gV-sKkMM.js +0 -1
  388. package/dist/chunks/thinkback-hc5eJ9ul.js +0 -1
  389. package/dist/chunks/toolPool-CNYKDRq5.js +0 -1
  390. package/dist/chunks/trustedDevice-0dehm9qz.js +0 -1
  391. package/dist/chunks/types-BUyOCzUt.js +0 -1
  392. package/dist/chunks/types-Czs-_G1S.js +0 -3
  393. package/dist/chunks/undercover-CG_269xD.js +0 -1
  394. package/dist/chunks/upgrade-J7lKLkD2.js +0 -1
  395. package/dist/chunks/upgrade-yNl7EO4e.js +0 -1
  396. package/dist/chunks/usage-B2PbCUMi.js +0 -1
  397. package/dist/chunks/usage-Ck8Cu45g.js +0 -1
  398. package/dist/chunks/useMainLoopModel-CO4yBjRM.js +0 -1
  399. package/dist/chunks/useManagePlugins-BzFKIDrD.js +0 -1
  400. package/dist/chunks/useSettingsErrors-CSemUjj1.js +0 -1
  401. package/dist/chunks/validatePlugin-D6sPqea1.js +0 -1
  402. package/dist/chunks/worktree-89ttIVxH.js +0 -1
@@ -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,Cb as re,Ci as u,Cp as ie,Ct as d,Dp as ae,Ep as oe,Et as se,Gp as f,IE as p,Il as ce,It as le,Jn as ue,Mt as m,OC as de,OD as fe,Qi as pe,RC as me,Tb as he,Tp as h,VE as ge,Vi as _e,Vl as ve,Wp as ye,bi as be,db as g,fb as _,fi as v,gn as y,jr as b,kC as x,kD as S,kc as C,nd as w,op as T,pi as E,rd as D,sp as O,ti as k,vC as A,yC as j,yn as M,zC as N}from"./loadAgentsDir-Clu7Uk6a.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-BQF64tZx.js";import{Nt as ke}from"./prompt-Bg_1U0gO.js";import{f as Ae,l as je,t as Me}from"./commitAttribution-CGZr7XNO.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(),T(),ke(),N(),ge(),je(),ce(),xe(),F(),he(),Oe(),_(),ye(),b(),de(),j(),se();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=A().safeParse(i.todos);return a.success?a.data:[]}return[]}function Le(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&re(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),e.attributionSnapshots&&e.attributionSnapshots.length>0&&Me(e.attributionSnapshots,e=>{t(t=>({...t,attribution:e}))}),!x()&&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}f(e.worktreePath),a(P()),m(e),p(),R(),g.cache.clear?.()}}function ze(){let e=d();if(e){m(null),p(),R(),g.cache.clear?.();try{process.chdir(e.originalCwd)}catch{return}f(e.originalCwd),a(P())}}async function Be(t,n,r){if(n.forkSession)t.contentReplacements?.length&&await k(t.contentReplacements);else{let e=n.sessionIdOverride??t.sessionId;e&&(ee(me(e),n.transcriptPath?Fe(n.transcriptPath):null),await Pe(),await v(),O(e))}if(E(n.forkSession?{...t,worktreeSession:void 0}:t),t.goal){let{hydrateGoalFromTranscript:r}=(D(),e(w)),i=new Map,a=n.sessionIdOverride??t.sessionId??c();i.set(a,t.goal),r(i,a)}n.forkSession||(H(t.worktreeSession),ue());let{agentDefinition:i,agentType:a}=V(t.agentSetting,r.mainThreadAgentDefinition,r.agentDefinitions);be(`normal`);let o=n.includeAttribution?Re(t):void 0,s=B(t.agentName,t.agentColor);ve(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}}}S(),o(),pe(),Ee(),oe(),C(),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,ae(()=>{ne(),X.emit()}));let e=await Je();e.length!==0&&(I(`Watching for changes in skill/command directories: ${e.join(`, `)}...`),U=fe.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=h(`userSettings`,`skills`);if(n)try{await e.stat(n),t.push(n)}catch{}let r=h(`userSettings`,`commands`);if(r)try{await e.stat(r),t.push(r)}catch{}let i=h(`projectSettings`,`skills`);if(i)try{let n=z.resolve(i);await e.stat(n),t.push(n)}catch{}let a=h(`projectSettings`,`commands`);if(a)try{let n=z.resolve(a);await e.stat(n),t.push(n)}catch{}for(let n of 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(),y(await le(`skills`,e[0]))){I(`ConfigChange hook blocked skill reload (${e.length} paths)`);return}ie(),_e(),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 +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-z3LP64O-.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-DyqNKuNy.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,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-DaNb-yKH.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-BT8NGzXT.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-BWw1sQeH.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-BdB1eFvP.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,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-D2Rs8wQP.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-iA6JTk19.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-BWw1sQeH.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-BdB1eFvP.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(`
@@ -0,0 +1 @@
1
+ import"./featureCheck-HslM03dr.js";import"./instinctParser-Dt-lqnDe.js";import"./skillGenerator-BT8NGzXT.js";import{p as e}from"./runtimeObserver-Dm3LIUMp.js";import{o as t}from"./observationStore-DzCdXq8U.js";import{s as n}from"./projectContext-D9MDwJUF.js";import"./sessionObserver-CSOYgsvH.js";import"./toolEventObserver-BAFzvePj.js";import"./skillGapStore-DyqNKuNy.js";import{t as r}from"./skillLearning-Cn9Uw0Kd.js";r();export{e as loadInstincts,t as readObservations,n as resolveProjectContext};
@@ -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-DaNb-yKH.js";import{S as a,T as o,f as s,i as c,k as l,u}from"./runtimeObserver-BXbjibFk.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-Ur7PqKl_.js";import{n as _}from"./toolEventObserver-C98uraqD.js";import{n as v}from"./skillGapStore-z3LP64O-.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-BT8NGzXT.js";import{S as a,T as o,f as s,i as c,k as l,u}from"./runtimeObserver-Dm3LIUMp.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-CSOYgsvH.js";import{n as _}from"./toolEventObserver-BAFzvePj.js";import{n as v}from"./skillGapStore-DyqNKuNy.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,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{wx as l,xx as u}from"./loadAgentsDir-BURvZNN6.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-GZxYPlyl.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-Bo80nWQf.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{_x as l,bx as u}from"./loadAgentsDir-Clu7Uk6a.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-1ZfYIzfL.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-DOEcrylu.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-7ZQF5JvA.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}){u(`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-Ck17rwH8.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(),l(),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{Dm as l,Om as u,wx as d,xx as f}from"./loadAgentsDir-BURvZNN6.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-hBh1ATr2.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 (自动技能匹配)
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,_x as d,bx as f}from"./loadAgentsDir-Clu7Uk6a.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-DKv8PRLD.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}){f(`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(),l(),y=c(),b=28,x=`# Skill Search (自动技能匹配)
4
4
 
5
5
  Skill Search 控制对话中的自动技能匹配功能。
6
6
 
@@ -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,Ex as u,Qi as d,Tx as f,ca as p,wp as m}from"./loadAgentsDir-BURvZNN6.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};
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,Qi as u,Sx as d,ca as f,wp as p,xx as m}from"./loadAgentsDir-Clu7Uk6a.js";import{dn as h,ln as g}from"./settings-Dlp5JTa_.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:f(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)=>f(e).localeCompare(f(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)(m,{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(p(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:f(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(`/${f(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),u(),o(),l(),_(),h(),b(),d(),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 +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-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
+ 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-3m_9zSrj.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{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-BURvZNN6.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-BIVmcl_N.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-C69HNTTb.js";import{n as K,t as q}from"./nativeInstaller-8arnRiUO.js";import{n as J,t as Y}from"./allErrors-CHVdQ3fT.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
+ 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{Ag as f,Dg as p,FE as m,Fg as h,RE as g,SD as _,VE as v,wg as y,yD as b,zE as x}from"./loadAgentsDir-Clu7Uk6a.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-Dlp5JTa_.js";import{f as k,l as A}from"./file-DcZWPH2V.js";import{b as j,p as M}from"./startupProfiler-xa3NmN7Z.js";import{Bt as ne,Gt as N,Si as P,_ as F,bt as I,i as L,wi as R,x as z}from"./model-BQF64tZx.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-Bd2e6xuT.js";import{n as K,t as q}from"./nativeInstaller-OPuO2sm_.js";import{n as J,t as Y}from"./allErrors-P3utlEeA.js";function X(){return process.env.USER_TYPE===`ant`?[{label:`Bash Sandbox`,value:b.isSandboxingEnabled()?`Enabled`:`Disabled`}]:[]}function Z(e,t=null,n){let r=e?.find(e=>e.name===`ide`);if(t){let e=h(t.ideType),i=f(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=y(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=g(await x()),t=[];return e.forEach(e=>{let n=A(e.path);t.push(`Large ${n} will impact performance (${M(e.content.length)} chars > ${M(m)})`)}),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=I();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=P(),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=z(e);if(e===null&&N()){let e=L();t=`${u.bold(`Default`)} ${e}`}return t}var $,ue=e((()=>{s(),a(),te(),l(),ne(),v(),W(),n(),k(),j(),p(),F(),R(),B(),q(),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-CNsaWv8g.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-CxI_KHUj.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-BURvZNN6.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-Clu7Uk6a.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,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,_x as p,jr as m,pr as h,vx as g,xi as _}from"./loadAgentsDir-BURvZNN6.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>
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,jr as p,mx as m,pr as h,px as g,xi as _}from"./loadAgentsDir-Clu7Uk6a.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)(g,{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(),g(),o(),b(),x(),w(),m(),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(),m(),o(),b(),x(),w(),p(),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-D_UHm7xo.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-CyoLEYWH.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{Dy as e,Ey as t,Py as n,jy as r,ky as i}from"./loadAgentsDir-Clu7Uk6a.js";e();export{t as checkOutTeleportedSessionBranch,i as processMessagesForTeleportResume,r as teleportResumeCodeSession,n 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{bO as r,g as i,h as a,m as o,yO as s}from"./loadAgentsDir-BURvZNN6.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+`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{TO as r,g as i,h as a,m as o,wO as s}from"./loadAgentsDir-Clu7Uk6a.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:
@@ -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-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
+ 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-D_P5iZmq.js";n();export{s as call,r as getNativeCSIuTerminalDisplayName,a as hasUsedBackslashReturn,e as isShiftEnterKeyBindingInstalled,i as markBackslashReturnUsed,o as setupTerminal,t as shouldOfferTerminalSetup};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{Bt as r,di as i,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]}.
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-Dlp5JTa_.js";import{b as p,c as m,g as h,o as g,y as _}from"./config-3m_9zSrj.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
2
 
3
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
4
  `:n===`windows`&&(r=` • Windows: Windows Terminal
@@ -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-CqPCp5Hs.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-CQ7dfFtv.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-HyW_R_88.js";e();export{n as call,t as playAnimation};
@@ -0,0 +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{$D as l,As as u,Es as d,Fb as f,Fs as p,Gs as m,Hs as ee,Is as te,Nb as h,Vs as g,fs as _,lc as v,mx as y,ps as b,px as x,tO as S,uc as ne}from"./loadAgentsDir-Clu7Uk6a.js";import{V as C,W as w,a as T,l as E,z as D}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-DJ9fslCK.js";import{a as P,s as F}from"./pluginOperations-Cz6eQ0Vu.js";import{join as I}from"path";import{readFile as L}from"fs/promises";function R(){return process.env.USER_TYPE===`ant`?q:l}function z(){return process.env.USER_TYPE===`ant`?J:Y}function B(){return`thinkback@${R()}`}async function V(){let{enabled:e}=await b(),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 ee(),n=R(),r=z(),i=B(),o=n in t,c=u(i);if(o?c||(a({phase:`installing-marketplace`}),s(`Updating marketplace…`),E(`Refreshing marketplace ${n}`),await m(n,e=>{s(e)}),te(),v(),E(`Marketplace ${n} refreshed`)):(a({phase:`installing-marketplace`}),E(`Installing marketplace ${r}`),await p({source:`github`,repo:r},e=>{s(e)}),v(),E(`Marketplace ${n} installed`)),c){let{disabled:e}=await b();if(e.some(e=>e.name===`thinkback`||e.source?.includes(i))){a({phase:`enabling-plugin`}),E(`Enabling plugin ${i}`);let e=await P(i);if(!e.success)throw Error(`Failed to enable plugin: ${e.message}`);v(),E(`Plugin ${i} enabled`)}}else{a({phase:`installing-plugin`}),E(`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}`)}v(),E(`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)(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)(x,{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?(E(`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=>{E(`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),y(),o(),f(),F(),T(),D(),ae(),j(),se(),k(),ne(),d(),g(),S(),_(),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 +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-BURvZNN6.js";import{n as a,r as o}from"./thinkback-gV-sKkMM.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
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$D as t,Es as n,Ms as r,tO as i}from"./loadAgentsDir-Clu7Uk6a.js";import{n as a,r as o}from"./thinkback-HyW_R_88.js";import{join as s}from"path";function c(){return`thinkback@${process.env.USER_TYPE===`ant`?u:t}`}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(),i(),a(),u=`claude-code-marketplace`,d=`thinkback`}))();export{l as call};
@@ -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-C98uraqD.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-BAFzvePj.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{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-Bo80nWQf.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-DOEcrylu.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{ND as t,O_ as n,PD as r,k_ as i}from"./loadAgentsDir-Clu7Uk6a.js";import{n as a,t as o}from"./partition-C8RSL3SQ.js";function s(e,t,n){let[o,s]=a(r([...e,...t],`name`),i),c=(e,t)=>e.name.localeCompare(t.name);return[...s.sort(c),...o.sort(c)]}var c=e((()=>{o(),t(),n()}));export{s as n,c as t};
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./trustedDevice-Dn4rXbxT.js";export{t as clearTrustedDeviceToken,e as enrollTrustedDevice};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{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-BIVmcl_N.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};
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{Bt as h,Cn as g,Sn as _,ft as v}from"./model-BQF64tZx.js";import{hostname as y}from"os";i(),n(),m(),s(),u(),d(),g(),o();var b=`tengu_sessions_elevated_auth_enforcement`;function x(){return!1}var S=t(()=>process.env.CLAUDE_TRUSTED_DEVICE_TOKEN||_().read()?.trustedDeviceToken);function C(){if(x())return S()}function w(){S.cache?.clear?.()}function T(){if(!x())return;let e=_();try{let t=e.read();t?.trustedDeviceToken&&(delete t.trustedDeviceToken,e.update(t))}catch{}S.cache?.clear?.()}async function E(){try{if(!await!1){c(`[trusted-device] Gate ${b} is off, skipping enrollment`);return}if(process.env.CLAUDE_TRUSTED_DEVICE_TOKEN){c(`[trusted-device] CLAUDE_TRUSTED_DEVICE_TOKEN env var is set, skipping enrollment (env var takes precedence)`);return}let{getClaudeAIOAuthTokens:t}=(h(),e(v)),n=t()?.accessToken;if(!n){c(`[trusted-device] No OAuth token, skipping enrollment`);return}let i=_();if(f()){c(`[trusted-device] Essential traffic only, skipping enrollment`);return}let 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,3 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";var t,n,r,i,a=e((()=>{t=1440*60*1e3,n=`Remote Control requires authentication.`,r=`Error: You must be logged in to use Remote Control.
2
+
3
+ Remote Control requires authentication.`,i=`Remote Control disconnected.`}));export{a,i,n,t as r,r as t};
@@ -0,0 +1 @@
1
+ import{a as e,t}from"./types-Bh9S_JG5.js";e();export{t as BRIDGE_LOGIN_ERROR};
@@ -1,3 +1,3 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{I as i,P as a,fi as o,t as s,y as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{Cy as u,Dy as d,Ey as f,Iy as p,Ty as m,_x as h,jy as g,vx as ee,wy as _}from"./loadAgentsDir-BURvZNN6.js";import{a as v,l as y}from"./debug-BrXObCdR.js";import{_ as b,a as x,g as S}from"./git-Do0wJvux.js";import{r as te,t as C}from"./execFileNoThrow-D244NytW.js";import{n as w,r as T}from"./analytics-BotDBGh0.js";import{l as E,u as D}from"./oauth-BqJqV-2M.js";import{Kt as O,Vt as k,Yt as A,nn as j}from"./model-BIVmcl_N.js";import{i as M,r as N}from"./detectRepository-BPr0VWNO.js";import{a as P,l as F,o as I}from"./api-C-rOQY-l.js";import{n as L,t as R}from"./usage-B2PbCUMi.js";async function z(){if(!O())return null;try{let{accessToken:e,orgUUID:t}=await F();return(await n.get(`${E().BASE_API_URL}/v1/ultrareview/quota`,{headers:{...P(e),"x-organization-uuid":t},timeout:5e3})).data}catch(e){return y(`fetchUltrareviewQuota failed: ${e}`),null}}var B=e((()=>{r(),D(),k(),v(),I()}));function V(){W=!0}async function H(){if(j()||A())return{kind:`proceed`,billingNote:``};let[e,t]=await Promise.all([z(),R().catch(()=>null)]);if(!e)return{kind:`proceed`,billingNote:``};if(e.reviews_remaining>0)return{kind:`proceed`,billingNote:` This is free ultrareview ${e.reviews_used+1} of ${e.reviews_limit}.`};if(!t)return{kind:`proceed`,billingNote:``};let n=t.extra_usage;if(!n?.is_enabled)return T(`tengu_review_overage_not_enabled`,{}),{kind:`not-enabled`};let r=n.monthly_limit,i=n.used_credits??0,a=r==null?1/0:r-i;return a<10?(T(`tengu_review_overage_low_balance`,{available:a}),{kind:`low-balance`,available:a}):W?{kind:`proceed`,billingNote:` This review bills as Extra Usage.`}:(T(`tengu_review_overage_dialog_shown`,{}),{kind:`needs-confirm`})}async function U(e,t,n){let r=await u();if(!r.eligible){let e=r.errors.filter(e=>e.type!==`no_remote_environment`);if(e.length>0)return T(`tengu_review_remote_precondition_failed`,{precondition_errors:e.map(e=>e.type).join(`,`)}),[{type:`text`,text:`Ultrareview cannot launch:\n${e.map(_).join(`
2
- `)}`}]}let i=n??``,a=e.trim(),o=/^\d+$/.test(a),s=`env_011111111111111111111113`,c={BUGHUNTER_DRY_RUN:`1`,BUGHUNTER_FLEET_SIZE:`5`,BUGHUNTER_MAX_DURATION:`10`,BUGHUNTER_AGENT_TIMEOUT:`600`,BUGHUNTER_TOTAL_WALLCLOCK:`22`,...process.env.BUGHUNTER_DEV_BUNDLE_B64&&{BUGHUNTER_DEV_BUNDLE_B64:process.env.BUGHUNTER_DEV_BUNDLE_B64}},l,f,h;if(o){let e=await N();if(!e||e.host!==`github.com`)return T(`tengu_review_remote_precondition_failed`,{}),null;l=await p({initialMessage:null,description:`ultrareview: ${e.owner}/${e.name}#${a}`,signal:t.abortController.signal,branchName:`refs/pull/${a}/head`,environmentId:s,environmentVariables:{BUGHUNTER_PR_NUMBER:a,BUGHUNTER_REPOSITORY:`${e.owner}/${e.name}`,...c}}),f=`/ultrareview ${a}`,h=`${e.owner}/${e.name}#${a}`}else{let e=await x()||`main`,{stdout:n,code:r}=await C(S(),[`merge-base`,e,`HEAD`],{preserveOutputOnError:!1}),i=n.trim();if(r!==0||!i)return T(`tengu_review_remote_precondition_failed`,{}),[{type:`text`,text:`Could not find merge-base with ${e}. Make sure you're in a git repo with a ${e} branch.`}];let{stdout:a,code:o}=await C(S(),[`diff`,`--shortstat`,i],{preserveOutputOnError:!1});if(o===0&&!a.trim())return T(`tengu_review_remote_precondition_failed`,{}),[{type:`text`,text:`No changes against the ${e} fork point. Make some commits or stage files first.`}];if(l=await p({initialMessage:null,description:`ultrareview: ${e}`,signal:t.abortController.signal,useBundle:!0,environmentId:s,environmentVariables:{BUGHUNTER_BASE_BRANCH:i,...c}}),!l)return T(`tengu_review_remote_teleport_failed`,{}),[{type:`text`,text:"Repo is too large. Push a PR and use `/ultrareview <PR#>` instead."}];f=`/ultrareview`,h=e}if(!l)return T(`tengu_review_remote_teleport_failed`,{}),null;d({remoteTaskType:`ultrareview`,session:l,command:f,context:t,isRemoteReview:!0}),T(`tengu_review_remote_launched`,{});let g=m(l.id);return[{type:`text`,text:`Ultrareview launched for ${h} (~10–20 min, runs in the cloud). Track: ${g}${i} Findings arrive via task-notification. Briefly acknowledge the launch to the user without repeating the target or URL — both are already visible in the tool output above.`}]}var W,G=e((()=>{w(),B(),L(),f(),k(),M(),te(),b(),g(),W=!1}));function K({onProceed:e,onCancel:t}){let[n,r]=(0,q.useState)(!1),o=(0,q.useRef)(new AbortController),s=(0,q.useCallback)(n=>{n===`proceed`?(r(!0),e(o.current.signal).catch(()=>r(!1))):t()},[e,t]),l=(0,q.useCallback)(()=>{o.current.abort(),t()},[t]);return(0,J.jsx)(c,{title:`Ultrareview billing`,onCancel:l,color:`background`,children:(0,J.jsxs)(i,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(a,{children:`Your free ultrareviews for this organization are used. Further reviews bill as Extra Usage (pay-per-use).`}),n?(0,J.jsx)(a,{color:`background`,children:`Launching…`}):(0,J.jsx)(h,{options:[{label:`Proceed with Extra Usage billing`,value:`proceed`},{label:`Cancel`,value:`cancel`}],onChange:s,onCancel:l})]})})}var q,J,Y=e((()=>{q=t(o(),1),ee(),s(),J=l()}));function X(e){return e.map(e=>e.type===`text`?e.text:``).filter(Boolean).join(`
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{I as i,P as a,fi as o,t as s,y as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{Cy as u,Dy as d,My as f,Sy as p,by as ee,mx as m,px as h,xy as g,yy as _}from"./loadAgentsDir-Clu7Uk6a.js";import{a as v,l as y}from"./debug-BrXObCdR.js";import{_ as b,a as x,g as S}from"./git-Do0wJvux.js";import{r as te,t as C}from"./execFileNoThrow-D244NytW.js";import{n as w,r as T}from"./analytics-BotDBGh0.js";import{l as E,u as D}from"./oauth-BqJqV-2M.js";import{Bt as O,Gt as k,Jt as A,tn as j}from"./model-BQF64tZx.js";import{i as M,r as N}from"./detectRepository-BPr0VWNO.js";import{a as P,l as F,o as I}from"./api-B-5jqiMg.js";import{n as L,t as R}from"./usage-iNQzY960.js";async function z(){if(!k())return null;try{let{accessToken:e,orgUUID:t}=await F();return(await n.get(`${E().BASE_API_URL}/v1/ultrareview/quota`,{headers:{...P(e),"x-organization-uuid":t},timeout:5e3})).data}catch(e){return y(`fetchUltrareviewQuota failed: ${e}`),null}}var B=e((()=>{r(),D(),O(),v(),I()}));function V(){W=!0}async function H(){if(j()||A())return{kind:`proceed`,billingNote:``};let[e,t]=await Promise.all([z(),R().catch(()=>null)]);if(!e)return{kind:`proceed`,billingNote:``};if(e.reviews_remaining>0)return{kind:`proceed`,billingNote:` This is free ultrareview ${e.reviews_used+1} of ${e.reviews_limit}.`};if(!t)return{kind:`proceed`,billingNote:``};let n=t.extra_usage;if(!n?.is_enabled)return T(`tengu_review_overage_not_enabled`,{}),{kind:`not-enabled`};let r=n.monthly_limit,i=n.used_credits??0,a=r==null?1/0:r-i;return a<10?(T(`tengu_review_overage_low_balance`,{available:a}),{kind:`low-balance`,available:a}):W?{kind:`proceed`,billingNote:` This review bills as Extra Usage.`}:(T(`tengu_review_overage_dialog_shown`,{}),{kind:`needs-confirm`})}async function U(e,t,n){let r=await _();if(!r.eligible){let e=r.errors.filter(e=>e.type!==`no_remote_environment`);if(e.length>0)return T(`tengu_review_remote_precondition_failed`,{precondition_errors:e.map(e=>e.type).join(`,`)}),[{type:`text`,text:`Ultrareview cannot launch:\n${e.map(ee).join(`
2
+ `)}`}]}let i=n??``,a=e.trim(),o=/^\d+$/.test(a),s=`env_011111111111111111111113`,c={BUGHUNTER_DRY_RUN:`1`,BUGHUNTER_FLEET_SIZE:`5`,BUGHUNTER_MAX_DURATION:`10`,BUGHUNTER_AGENT_TIMEOUT:`600`,BUGHUNTER_TOTAL_WALLCLOCK:`22`,...process.env.BUGHUNTER_DEV_BUNDLE_B64&&{BUGHUNTER_DEV_BUNDLE_B64:process.env.BUGHUNTER_DEV_BUNDLE_B64}},l,d,p;if(o){let e=await N();if(!e||e.host!==`github.com`)return T(`tengu_review_remote_precondition_failed`,{}),null;l=await f({initialMessage:null,description:`ultrareview: ${e.owner}/${e.name}#${a}`,signal:t.abortController.signal,branchName:`refs/pull/${a}/head`,environmentId:s,environmentVariables:{BUGHUNTER_PR_NUMBER:a,BUGHUNTER_REPOSITORY:`${e.owner}/${e.name}`,...c}}),d=`/ultrareview ${a}`,p=`${e.owner}/${e.name}#${a}`}else{let e=await x()||`main`,{stdout:n,code:r}=await C(S(),[`merge-base`,e,`HEAD`],{preserveOutputOnError:!1}),i=n.trim();if(r!==0||!i)return T(`tengu_review_remote_precondition_failed`,{}),[{type:`text`,text:`Could not find merge-base with ${e}. Make sure you're in a git repo with a ${e} branch.`}];let{stdout:a,code:o}=await C(S(),[`diff`,`--shortstat`,i],{preserveOutputOnError:!1});if(o===0&&!a.trim())return T(`tengu_review_remote_precondition_failed`,{}),[{type:`text`,text:`No changes against the ${e} fork point. Make some commits or stage files first.`}];if(l=await f({initialMessage:null,description:`ultrareview: ${e}`,signal:t.abortController.signal,useBundle:!0,environmentId:s,environmentVariables:{BUGHUNTER_BASE_BRANCH:i,...c}}),!l)return T(`tengu_review_remote_teleport_failed`,{}),[{type:`text`,text:"Repo is too large. Push a PR and use `/ultrareview <PR#>` instead."}];d=`/ultrareview`,p=e}if(!l)return T(`tengu_review_remote_teleport_failed`,{}),null;u({remoteTaskType:`ultrareview`,session:l,command:d,context:t,isRemoteReview:!0}),T(`tengu_review_remote_launched`,{});let m=g(l.id);return[{type:`text`,text:`Ultrareview launched for ${p} (~10–20 min, runs in the cloud). Track: ${m}${i} Findings arrive via task-notification. Briefly acknowledge the launch to the user without repeating the target or URL — both are already visible in the tool output above.`}]}var W,G=e((()=>{w(),B(),L(),p(),O(),M(),te(),b(),d(),W=!1}));function K({onProceed:e,onCancel:t}){let[n,r]=(0,q.useState)(!1),o=(0,q.useRef)(new AbortController),s=(0,q.useCallback)(n=>{n===`proceed`?(r(!0),e(o.current.signal).catch(()=>r(!1))):t()},[e,t]),l=(0,q.useCallback)(()=>{o.current.abort(),t()},[t]);return(0,J.jsx)(c,{title:`Ultrareview billing`,onCancel:l,color:`background`,children:(0,J.jsxs)(i,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(a,{children:`Your free ultrareviews for this organization are used. Further reviews bill as Extra Usage (pay-per-use).`}),n?(0,J.jsx)(a,{color:`background`,children:`Launching…`}):(0,J.jsx)(h,{options:[{label:`Proceed with Extra Usage billing`,value:`proceed`},{label:`Cancel`,value:`cancel`}],onChange:s,onCancel:l})]})})}var q,J,Y=e((()=>{q=t(o(),1),m(),s(),J=l()}));function X(e){return e.map(e=>e.type===`text`?e.text:``).filter(Boolean).join(`
3
3
  `)}async function Z(e,t,n,r,i){let a=await U(e,t,r);i?.aborted||(a?n(X(a),{shouldQuery:!0}):n(`Ultrareview failed to launch the remote session. Check that this is a GitHub repo and try again.`,{display:`system`}))}var Q,$;e((()=>{G(),Y(),Q=l(),$=async(e,t,n)=>{let r=await H();return r.kind===`not-enabled`?(e(`Free ultrareviews used. Enable Extra Usage at https://claude.ai/settings/billing to continue.`,{display:`system`}),null):r.kind===`low-balance`?(e(`Balance too low to launch ultrareview ($${r.available.toFixed(2)} available, $10 minimum). Top up at https://claude.ai/settings/billing`,{display:`system`}),null):r.kind===`needs-confirm`?(0,Q.jsx)(K,{onProceed:async r=>{await Z(n,t,e,` This review bills as Extra Usage.`,r),r.aborted||V()},onCancel:()=>e(`Ultrareview cancelled.`,{display:`system`})}):(await Z(n,t,e,r.billingNote),null)}}))();export{$ as call};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DSxRz_kt.js";import{c as r,g as i}from"./config-DiT2Z8dY.js";import{l as a,s as o}from"./commitAttribution-CLbEIaRJ.js";function s(){return process.env.USER_TYPE===`ant`?t(process.env.CLAUDE_CODE_UNDERCOVER)?!0:o()!==`internal`:!1}function c(){return process.env.USER_TYPE===`ant`?`## UNDERCOVER MODE — CRITICAL
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DSxRz_kt.js";import{c as r,g as i}from"./config-3m_9zSrj.js";import{l as a,s as o}from"./commitAttribution-CGZr7XNO.js";function s(){return process.env.USER_TYPE===`ant`?t(process.env.CLAUDE_CODE_UNDERCOVER)?!0:o()!==`internal`:!1}function c(){return process.env.USER_TYPE===`ant`?`## UNDERCOVER MODE — CRITICAL
2
2
 
3
3
  You are operating UNDERCOVER in a PUBLIC/OPEN-SOURCE repository. Your commit
4
4
  messages, PR titles, and PR bodies MUST NOT contain ANY Anthropic-internal
@@ -0,0 +1 @@
1
+ import{i as e,n as t}from"./undercover-CdapzvNH.js";t();export{e as shouldShowUndercoverAutoNotice};
@@ -1,4 +1,4 @@
1
- import{di as e,ui as t}from"./src-CDCSSo0U2.js";import{fC as n,uC as r}from"./loadAgentsDir-BURvZNN6.js";import{a as i,l as a}from"./debug-BrXObCdR.js";import{n as o,o as s}from"./process-gEbdy6uY.js";import{n as c,r as l}from"./execFileNoThrow-D244NytW.js";import{l as u,u as d}from"./ripgrep-BXmXjAzA.js";import{join as f}from"node:path";import{execSync as p}from"node:child_process";import{existsSync as m,readFileSync as h}from"node:fs";import{homedir as g}from"node:os";e(),i(),d(),l(),n(),o();var _=`@readmagic/workmate`;function v(){try{let e=f(u,`..`,`package.json`);if(m(e)){let t=JSON.parse(h(e,`utf-8`));if(t.version)return t.version}}catch{}return`0.0.4`}function y(e){try{return p(`which ${e} 2>/dev/null`,{stdio:`pipe`}),!0}catch{return!1}}function b(){return!!(process.execPath.includes(`bun`)||m(f(f(g(),`.bun`,`install`,`global`),`node_modules`,_)))}async function x(){let e=await c(`npm`,[`view`,`${_}@latest`,`version`,`--prefer-online`],{abortSignal:AbortSignal.timeout(1e4),cwd:g()});return e.code===0?e.stdout.trim():(a(`npm view failed: ${e.stderr}`),null)}function S(e,t){let n=e=>e.replace(/^\D/,``).split(`.`).map(Number),r=n(e),i=n(t);for(let e=0;e<3;e++){if((r[e]??0)>(i[e]??0))return!0;if((r[e]??0)<(i[e]??0))return!1}return!0}async function C(){let e=v();s(`Current version: ${e}\n`);let n=y(`bun`),i=b()&&n?`bun`:`npm`;s(`Package manager: ${i}\n`),s(`Checking for updates...
1
+ import{di as e,ui as t}from"./src-CDCSSo0U2.js";import{cC as n,oC as r}from"./loadAgentsDir-Clu7Uk6a.js";import{a as i,l as a}from"./debug-BrXObCdR.js";import{n as o,o as s}from"./process-gEbdy6uY.js";import{n as c,r as l}from"./execFileNoThrow-D244NytW.js";import{l as u,u as d}from"./ripgrep-BXmXjAzA.js";import{join as f}from"node:path";import{execSync as p}from"node:child_process";import{existsSync as m,readFileSync as h}from"node:fs";import{homedir as g}from"node:os";e(),i(),d(),l(),n(),o();var _=`@readmagic/workmate`;function v(){try{let e=f(u,`..`,`package.json`);if(m(e)){let t=JSON.parse(h(e,`utf-8`));if(t.version)return t.version}}catch{}return`0.0.5`}function y(e){try{return p(`which ${e} 2>/dev/null`,{stdio:`pipe`}),!0}catch{return!1}}function b(){return!!(process.execPath.includes(`bun`)||m(f(f(g(),`.bun`,`install`,`global`),`node_modules`,_)))}async function x(){let e=await c(`npm`,[`view`,`${_}@latest`,`version`,`--prefer-online`],{abortSignal:AbortSignal.timeout(1e4),cwd:g()});return e.code===0?e.stdout.trim():(a(`npm view failed: ${e.stderr}`),null)}function S(e,t){let n=e=>e.replace(/^\D/,``).split(`.`).map(Number),r=n(e),i=n(t);for(let e=0;e<3;e++){if((r[e]??0)>(i[e]??0))return!0;if((r[e]??0)<(i[e]??0))return!1}return!0}async function C(){let e=v();s(`Current version: ${e}\n`);let n=y(`bun`),i=b()&&n?`bun`:`npm`;s(`Package manager: ${i}\n`),s(`Checking for updates...
2
2
  `);let a=await x();if(!a){process.stderr.write(t.red(`Failed to check for updates`)+`
3
3
  `),process.stderr.write(`Unable to fetch latest version from npm registry.
4
4
  `),await r(1);return}if(a===e||S(e,a)){s(t.green(`ccb is up to date (${e})`)+`
@@ -0,0 +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{Mx as r,Nx as i}from"./loadAgentsDir-Clu7Uk6a.js";import{o as a,s as o}from"./log-BMCygSzM.js";import{Bt as s,Gt as c,Kr as l,Ot as u,qr as d}from"./model-BQF64tZx.js";import{n as f,t as p}from"./browser-BmZuQom6.js";async function m(e,t){try{if(c()){let t=u(),n=!1;if(t?.subscriptionType&&t?.rateLimitTier)n=t.subscriptionType===`max`&&t.rateLimitTier===`default_claude_max_20x`;else if(t?.accessToken){let e=await l(t.accessToken);n=e?.organization?.organization_type===`claude_max`&&e?.organization?.rate_limit_tier===`default_claude_max_20x`}if(n)return setTimeout(e,0,`You are already on the highest Max subscription plan. For additional usage, switch to an API usage-billed account.`),null}return await f(`https://claude.ai/upgrade/max`),(0,h.jsx)(r,{onDone:()=>{t.onChangeAPIKey(),e(`Login successful`)}})}catch(t){o(t),setTimeout(e,0,`Failed to open browser. Please visit https://claude.ai/upgrade/max to upgrade.`)}return null}var h,g=e((()=>{t(),d(),s(),p(),a(),i(),h=n()}));export{g as n,m as t};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./upgrade-BOeakAP6.js";e();export{t as call};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{E as r,M as i,n as a,r as o,t as s}from"./lazySchema-DcIJE_0i.js";import{S as c,a as l,l as u,w as d}from"./debug-BrXObCdR.js";import{l as f,u as p}from"./oauth-BqJqV-2M.js";import{a as m,r as h,t as g}from"./bridgeConfig-DMBOO3gW.js";import{basename as _,extname as v}from"path";import{randomUUID as y}from"crypto";import{readFile as b}from"fs/promises";function x(e){let t=v(e).toLowerCase();return D[t]??`application/octet-stream`}function S(e){u(`[brief:upload] ${e}`)}function C(){return h()??process.env.ANTHROPIC_BASE_URL??f().BASE_API_URL}async function w(e,n,r){{if(!r.replBridgeEnabled)return;if(n>T){S(`skip ${e}: ${n} bytes exceeds ${T} limit`);return}let i=g();if(!i){S(`skip: no oauth token`);return}let a;try{a=await b(e)}catch(t){S(`read failed for ${e}: ${t}`);return}let o=`${C()}/api/oauth/file_upload`,s=_(e),c=x(s),l=`----FormBoundary${y()}`,u=Buffer.concat([Buffer.from(`--${l}\r\nContent-Disposition: form-data; name="file"; filename="${s}"\r\nContent-Type: ${c}\r\n\r\n`),a,Buffer.from(`\r\n--${l}--\r\n`)]);try{let a=await t.post(o,u,{headers:{Authorization:`Bearer ${i}`,"Content-Type":`multipart/form-data; boundary=${l}`,"Content-Length":u.length.toString()},timeout:E,signal:r.signal,validateStatus:()=>!0});if(a.status!==201){S(`upload failed for ${e}: status=${a.status} body=${d(a.data).slice(0,200)}`);return}let s=O().safeParse(a.data);if(!s.success){S(`unexpected response shape for ${e}: ${s.error.message}`);return}return S(`uploaded ${e} → ${s.data.file_uuid} (${n} bytes)`),s.data.file_uuid}catch(t){S(`upload threw for ${e}: ${t}`);return}}}var T,E,D,O;e((()=>{n(),o(),m(),p(),l(),s(),c(),T=30*1024*1024,E=3e4,D={".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".webp":`image/webp`},O=a(()=>r({file_uuid:i()}))}))();export{w as uploadBriefAttachment};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{E as r,M as i,n as a,r as o,t as s}from"./lazySchema-DcIJE_0i.js";import{S as c,a as l,l as u,w as d}from"./debug-BrXObCdR.js";import{l as f,u as p}from"./oauth-BqJqV-2M.js";import{a as m,r as h,t as g}from"./bridgeConfig-5p_w4s5r.js";import{basename as _,extname as v}from"path";import{randomUUID as y}from"crypto";import{readFile as b}from"fs/promises";function x(e){let t=v(e).toLowerCase();return D[t]??`application/octet-stream`}function S(e){u(`[brief:upload] ${e}`)}function C(){return h()??process.env.ANTHROPIC_BASE_URL??f().BASE_API_URL}async function w(e,n,r){{if(!r.replBridgeEnabled)return;if(n>T){S(`skip ${e}: ${n} bytes exceeds ${T} limit`);return}let i=g();if(!i){S(`skip: no oauth token`);return}let a;try{a=await b(e)}catch(t){S(`read failed for ${e}: ${t}`);return}let o=`${C()}/api/oauth/file_upload`,s=_(e),c=x(s),l=`----FormBoundary${y()}`,u=Buffer.concat([Buffer.from(`--${l}\r\nContent-Disposition: form-data; name="file"; filename="${s}"\r\nContent-Type: ${c}\r\n\r\n`),a,Buffer.from(`\r\n--${l}--\r\n`)]);try{let a=await t.post(o,u,{headers:{Authorization:`Bearer ${i}`,"Content-Type":`multipart/form-data; boundary=${l}`,"Content-Length":u.length.toString()},timeout:E,signal:r.signal,validateStatus:()=>!0});if(a.status!==201){S(`upload failed for ${e}: status=${a.status} body=${d(a.data).slice(0,200)}`);return}let s=O().safeParse(a.data);if(!s.success){S(`unexpected response shape for ${e}: ${s.error.message}`);return}return S(`uploaded ${e} → ${s.data.file_uuid} (${n} bytes)`),s.data.file_uuid}catch(t){S(`upload threw for ${e}: ${t}`);return}}}var T,E,D,O;e((()=>{n(),o(),m(),p(),l(),s(),c(),T=30*1024*1024,E=3e4,D={".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".webp":`image/webp`},O=a(()=>r({file_uuid:i()}))}))();export{w as uploadBriefAttachment};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Settings-CxI_KHUj.js";var i,a;e((()=>{n(),i=t(),a=async(e,t)=>(0,i.jsx)(r,{onClose:e,context:t,defaultTab:`Usage`})}))();export{a as call};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{l as r,u as i}from"./oauth-BqJqV-2M.js";import{$n as a,Bt as o,Gt as s,Ot as c,Rr as l,ar as u,or as d,rr as f,zr as p,zt as m}from"./model-BQF64tZx.js";async function h(){if(!s()||!m())return{};let e=c();if(e&&p(e.expiresAt))return null;let n=a();if(n.error)throw Error(`Auth error: ${n.error}`);let i={"Content-Type":`application/json`,"User-Agent":u(),...n.headers},o=`${r().BASE_API_URL}/api/oauth/usage`;return(await t.get(o,{headers:i,timeout:5e3})).data}var g=e((()=>{n(),i(),o(),f(),d(),l()}));export{g as n,h as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as n,et as r,fi as i,t as a,vt as o}from"./src-CDCSSo0U2.js";import{l as s,u as c}from"./referral-UKJv23_5.js";function l(e,t,n,i=!0){let{exit:a}=o(),[s,c]=(0,u.useState)({pending:!1,keyName:null}),l=(0,u.useMemo)(()=>n??a,[n,a]),d=r(e=>c({pending:e,keyName:`Ctrl-C`}),l),f=r(e=>c({pending:e,keyName:`Ctrl-D`}),l),p=(0,u.useCallback)(()=>{t?.()||d()},[d,t]),m=(0,u.useCallback)(()=>{f()},[f]);return e((0,u.useMemo)(()=>({"app:interrupt":p,"app:exit":m}),[p,m]),{context:`Global`,isActive:i}),s}var u,d=e((()=>{u=t(i(),1),a(),s()}));function f(e,t,r){return l(n,t,e,r)}var p=e((()=>{c(),d()}));export{f as n,p as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as n,et as r,fi as i,t as a,vt as o}from"./src-CDCSSo0U2.js";import{l as s,u as c}from"./referral-BlrMpBAV.js";function l(e,t,n,i=!0){let{exit:a}=o(),[s,c]=(0,u.useState)({pending:!1,keyName:null}),l=(0,u.useMemo)(()=>n??a,[n,a]),d=r(e=>c({pending:e,keyName:`Ctrl-C`}),l),f=r(e=>c({pending:e,keyName:`Ctrl-D`}),l),p=(0,u.useCallback)(()=>{t?.()||d()},[d,t]),m=(0,u.useCallback)(()=>{f()},[f]);return e((0,u.useMemo)(()=>({"app:interrupt":p,"app:exit":m}),[p,m]),{context:`Global`,isActive:i}),s}var u,d=e((()=>{u=t(i(),1),a(),s()}));function f(e,t,r){return l(n,t,e,r)}var p=e((()=>{c(),d()}));export{f as n,p as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{US as t,WS as n}from"./loadAgentsDir-Clu7Uk6a.js";import{C as r,_ as i,s as a}from"./model-BQF64tZx.js";function o(){let e=n(e=>e.mainLoopModel);return r(n(e=>e.mainLoopModelForSession)??e??a())}var s=e((()=>{t(),i()}));export{o as n,s as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{$_ as n,$y as r,BS as i,Cc as a,KS as o,Q_ as s,Qy as c,Sc as l,Sm as u,Tc as d,US as f,VS as p,WS as m,_m as h,fs as g,ps as _,wc as v,xm as y,ym as b}from"./loadAgentsDir-Clu7Uk6a.js";import{W as x,a as S,l as C,z as w}from"./debug-BrXObCdR.js";import{_n as T,gn as E}from"./settings-Dlp5JTa_.js";import{M as D,j as O}from"./git-Do0wJvux.js";import{o as k,s as A}from"./log-BMCygSzM.js";import{n as j,r as M}from"./analytics-BotDBGh0.js";import{n as N,r as P}from"./pluginFlagging-DNPBbJZo.js";import{t as F}from"./pluginBlocklist-5qbaTRbV.js";var I=e(t(),1);i(),j(),h(),f(),T(),S(),O(),w(),k(),v(),a(),c(),y(),s(),P(),g();function L({enabled:e=!0}={}){let t=o(),i=m(e=>e.plugins.needsRefresh),{addNotification:a}=p(),s=(0,I.useCallback)(async()=>{try{let{enabled:e,disabled:i,errors:o}=await _();await F();let s=N();Object.keys(s).length>0&&a({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let c=[],f=[];try{c=await l()}catch(e){let t=e instanceof Error?e.message:String(e);o.push({type:`generic-error`,source:`plugin-commands`,error:`Failed to load plugin commands: ${t}`})}try{f=await d()}catch(e){let t=e instanceof Error?e.message:String(e);o.push({type:`generic-error`,source:`plugin-agents`,error:`Failed to load plugin agents: ${t}`})}try{await r()}catch(e){let t=e instanceof Error?e.message:String(e);o.push({type:`generic-error`,source:`plugin-hooks`,error:`Failed to load plugin hooks: ${t}`})}let p=(await Promise.all(e.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await n(e,o);return t&&(e.mcpServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0),m=(await Promise.all(e.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await u(e,o);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);b(),t(t=>{let n=t.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r=new Set(o.map(e=>e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`)),a=[...n.filter(e=>{let t=e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`;return!r.has(t)}),...o];return{...t,plugins:{...t.plugins,enabled:e,disabled:i,commands:c,errors:a}}}),C(`Loaded plugins - Enabled: ${e.length}, Disabled: ${i.length}, Commands: ${c.length}, Agents: ${f.length}, Errors: ${o.length}`);let h=e.reduce((e,t)=>t.hooksConfig?e+Object.values(t.hooksConfig).reduce((e,t)=>e+(t?.reduce((e,t)=>e+t.hooks.length,0)??0),0):e,0);return{enabled_count:e.length,disabled_count:i.length,inline_count:E(e,e=>e.source.endsWith(`@inline`)),marketplace_count:E(e,e=>!e.source.endsWith(`@inline`)),error_count:o.length,skill_count:c.length,agent_count:f.length,hook_count:h,mcp_count:p,lsp_count:m,ant_enabled_names:process.env.USER_TYPE===`ant`&&e.length>0?e.map(e=>e.name).sort().join(`,`):void 0}}catch(e){let n=x(e);return A(n),C(`Error loading plugins: ${e}`),t(e=>{let t=e.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r={type:`generic-error`,source:`plugin-system`,error:n.message};return{...e,plugins:{...e.plugins,enabled:[],disabled:[],commands:[],errors:[...t,r]}}}),{enabled_count:0,disabled_count:0,inline_count:0,marketplace_count:0,error_count:1,skill_count:0,agent_count:0,hook_count:0,mcp_count:0,lsp_count:0,load_failed:!0,ant_enabled_names:void 0}}},[t,a]);(0,I.useEffect)(()=>{e&&s().then(e=>{let{ant_enabled_names:t,...n}=e,r={...n,has_custom_plugin_cache_dir:!!process.env.CLAUDE_CODE_PLUGIN_CACHE_DIR};M(`tengu_plugins_loaded`,{...r,...t!==void 0&&{enabled_names:t}}),D(`info`,`tengu_plugins_loaded`,r)})},[s,e]),(0,I.useEffect)(()=>{!e||!i||a({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,i,a])}export{L as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as n}from"./src-CDCSSo0U2.js";import{Ku as r,Xu as i}from"./loadAgentsDir-BURvZNN6.js";import{n as a,t as o}from"./toolPool-CNYKDRq5.js";function s(e,t,n){return(0,c.useMemo)(()=>a(e,r(n,t),n.mode),[e,t,n,!1,!1])}var c,l=e((()=>{c=t(n(),1),i(),o()}));export{s as n,l as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as n}from"./src-CDCSSo0U2.js";import{Ku as r,Xu as i}from"./loadAgentsDir-Clu7Uk6a.js";import{n as a,t as o}from"./toolPool-CR61XXm3.js";function s(e,t,n){return(0,c.useMemo)(()=>a(e,r(n,t),n.mode),[e,t,n,!1,!1])}var c,l=e((()=>{c=t(n(),1),i(),o()}));export{s as n,l as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Vn as n,fi as r,hn as i,ot as a,t as o}from"./src-CDCSSo0U2.js";import{Qx as s,Xx as c,Zx as l,aS as u,iS as d,lC as f,nS as p,oS as m,rS as h,sS as g}from"./loadAgentsDir-BURvZNN6.js";function _(e){return!!(e.ctrl&&(e.key===`k`||e.key===`u`||e.key===`w`)||e.meta&&e.key===`backspace`)}function v(e){return(e.ctrl||e.meta)&&e.key===`y`}function y({isActive:e,onExit:t,onCancel:r,onExitUp:o,columns:s,passthroughCtrlKeys:f=[],initialQuery:y=``,backspaceExitsOnEmpty:S=!0}){let{columns:C}=a(),w=s??C,[T,E]=(0,b.useState)(y),[D,O]=(0,b.useState)(y.length),k=(0,b.useCallback)(e=>{E(e),O(e.length)},[]),A=n=>{if(!e)return;let i=c.fromText(T,w,D);if(!(n.ctrl&&f.includes(n.key.toLowerCase()))){if(_(n)||d(),v(n)||u(),n.key===`return`||n.key===`down`){n.preventDefault(),t();return}if(n.key===`up`){n.preventDefault(),o&&o();return}if(n.key===`escape`){n.preventDefault(),r?r():T.length>0?(E(``),O(0)):t();return}if(n.key===`backspace`){if(n.preventDefault(),n.meta){let{cursor:e,killed:t}=i.deleteWordBefore();p(t,`prepend`),E(e.text),O(e.offset);return}if(T.length===0){S&&(r??t)();return}let e=i.backspace();E(e.text),O(e.offset);return}if(n.key===`delete`){n.preventDefault();let e=i.del();E(e.text),O(e.offset);return}if(n.key===`left`&&(n.ctrl||n.meta||n.fn)){n.preventDefault();let e=i.prevWord();O(e.offset);return}if(n.key===`right`&&(n.ctrl||n.meta||n.fn)){n.preventDefault();let e=i.nextWord();O(e.offset);return}if(n.key===`left`){n.preventDefault();let e=i.left();O(e.offset);return}if(n.key===`right`){n.preventDefault();let e=i.right();O(e.offset);return}if(n.key===`home`){n.preventDefault(),O(0);return}if(n.key===`end`){n.preventDefault(),O(T.length);return}if(n.ctrl){switch(n.preventDefault(),n.key.toLowerCase()){case`a`:O(0);return;case`e`:O(T.length);return;case`b`:O(i.left().offset);return;case`f`:O(i.right().offset);return;case`d`:{if(T.length===0){(r??t)();return}let e=i.del();E(e.text),O(e.offset);return}case`h`:{if(T.length===0){S&&(r??t)();return}let e=i.backspace();E(e.text),O(e.offset);return}case`k`:{let{cursor:e,killed:t}=i.deleteToLineEnd();p(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=i.deleteToLineStart();p(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=i.deleteWordBefore();p(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=l();if(e.length>0){let t=i.offset,n=i.insert(e);h(t,e.length),E(n.text),O(n.offset)}return}case`g`:case`c`:if(r){r();return}}return}if(n.meta){switch(n.preventDefault(),n.key.toLowerCase()){case`b`:O(i.prevWord().offset);return;case`f`:O(i.nextWord().offset);return;case`d`:{let e=i.deleteWordAfter();E(e.text),O(e.offset);return}case`y`:{let e=g();if(e){let{text:t,start:n,length:r}=e,i=T.slice(0,n),a=T.slice(n+r),o=i+t+a,s=n+t.length;m(t.length),E(o),O(s)}return}}return}if(n.key!==`tab`&&n.key.length>=1&&!x.has(n.key)){n.preventDefault();let e=i.insert(n.key);E(e.text),O(e.offset)}}};return i((e,t,r)=>{A(new n(r.keypress))},{isActive:e}),{query:T,setQuery:k,cursorOffset:D,handleKeyDown:A}}var b,x,S=e((()=>{b=t(r(),1),o(),s(),f(),x=new Set([`pageup`,`pagedown`,`insert`,`wheelup`,`wheeldown`,`mouse`,`f1`,`f2`,`f3`,`f4`,`f5`,`f6`,`f7`,`f8`,`f9`,`f10`,`f11`,`f12`])}));export{y as n,S as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Vn as n,fi as r,hn as i,ot as a,t as o}from"./src-CDCSSo0U2.js";import{$x as s,Jx as c,Kx as l,Qx as u,aC as d,eS as f,nS as p,qx as m,rS as h,tS as g}from"./loadAgentsDir-Clu7Uk6a.js";function _(e){return!!(e.ctrl&&(e.key===`k`||e.key===`u`||e.key===`w`)||e.meta&&e.key===`backspace`)}function v(e){return(e.ctrl||e.meta)&&e.key===`y`}function y({isActive:e,onExit:t,onCancel:r,onExitUp:o,columns:c,passthroughCtrlKeys:d=[],initialQuery:y=``,backspaceExitsOnEmpty:S=!0}){let{columns:C}=a(),w=c??C,[T,E]=(0,b.useState)(y),[D,O]=(0,b.useState)(y.length),k=(0,b.useCallback)(e=>{E(e),O(e.length)},[]),A=n=>{if(!e)return;let i=l.fromText(T,w,D);if(!(n.ctrl&&d.includes(n.key.toLowerCase()))){if(_(n)||f(),v(n)||g(),n.key===`return`||n.key===`down`){n.preventDefault(),t();return}if(n.key===`up`){n.preventDefault(),o&&o();return}if(n.key===`escape`){n.preventDefault(),r?r():T.length>0?(E(``),O(0)):t();return}if(n.key===`backspace`){if(n.preventDefault(),n.meta){let{cursor:e,killed:t}=i.deleteWordBefore();u(t,`prepend`),E(e.text),O(e.offset);return}if(T.length===0){S&&(r??t)();return}let e=i.backspace();E(e.text),O(e.offset);return}if(n.key===`delete`){n.preventDefault();let e=i.del();E(e.text),O(e.offset);return}if(n.key===`left`&&(n.ctrl||n.meta||n.fn)){n.preventDefault();let e=i.prevWord();O(e.offset);return}if(n.key===`right`&&(n.ctrl||n.meta||n.fn)){n.preventDefault();let e=i.nextWord();O(e.offset);return}if(n.key===`left`){n.preventDefault();let e=i.left();O(e.offset);return}if(n.key===`right`){n.preventDefault();let e=i.right();O(e.offset);return}if(n.key===`home`){n.preventDefault(),O(0);return}if(n.key===`end`){n.preventDefault(),O(T.length);return}if(n.ctrl){switch(n.preventDefault(),n.key.toLowerCase()){case`a`:O(0);return;case`e`:O(T.length);return;case`b`:O(i.left().offset);return;case`f`:O(i.right().offset);return;case`d`:{if(T.length===0){(r??t)();return}let e=i.del();E(e.text),O(e.offset);return}case`h`:{if(T.length===0){S&&(r??t)();return}let e=i.backspace();E(e.text),O(e.offset);return}case`k`:{let{cursor:e,killed:t}=i.deleteToLineEnd();u(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=i.deleteToLineStart();u(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=i.deleteWordBefore();u(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=m();if(e.length>0){let t=i.offset,n=i.insert(e);s(t,e.length),E(n.text),O(n.offset)}return}case`g`:case`c`:if(r){r();return}}return}if(n.meta){switch(n.preventDefault(),n.key.toLowerCase()){case`b`:O(i.prevWord().offset);return;case`f`:O(i.nextWord().offset);return;case`d`:{let e=i.deleteWordAfter();E(e.text),O(e.offset);return}case`y`:{let e=h();if(e){let{text:t,start:n,length:r}=e,i=T.slice(0,n),a=T.slice(n+r),o=i+t+a,s=n+t.length;p(t.length),E(o),O(s)}return}}return}if(n.key!==`tab`&&n.key.length>=1&&!x.has(n.key)){n.preventDefault();let e=i.insert(n.key);E(e.text),O(e.offset)}}};return i((e,t,r)=>{A(new n(r.keypress))},{isActive:e}),{query:T,setQuery:k,cursorOffset:D,handleKeyDown:A}}var b,x,S=e((()=>{b=t(r(),1),o(),c(),d(),x=new Set([`pageup`,`pagedown`,`insert`,`wheelup`,`wheeldown`,`mouse`,`f1`,`f2`,`f3`,`f4`,`f5`,`f6`,`f7`,`f8`,`f9`,`f10`,`f11`,`f12`])}));export{y as n,S as t};
@@ -0,0 +1 @@
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as n}from"./src-CDCSSo0U2.js";import{B as r,en as i}from"./state-ix0xIunV.js";import{BS as a,VS as o,nC as s,tC as c}from"./loadAgentsDir-Clu7Uk6a.js";import{n as l,t as u}from"./allErrors-P3utlEeA.js";function d(){let{addNotification:e,removeNotification:t}=o(),[n,i]=(0,f.useState)(()=>{let{errors:e}=u();return e});return s((0,f.useCallback)(()=>{let{errors:e}=u();i(e)},[])),(0,f.useEffect)(()=>{if(!r())if(n.length>0){let t=`Found ${n.length} settings ${n.length===1?`issue`:`issues`} · /doctor for details`;e({key:p,text:t,color:`warning`,priority:`high`,timeoutMs:6e4})}else t(p)},[n,e,t]),n}var f,p,m=e((()=>{f=t(n(),1),a(),i(),l(),c(),p=`settings-errors`}));export{d as n,m as t};