@readmagic/workmate 0.0.3 → 0.0.4

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 (322) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-mANiG0xj.js → AddWorkspaceDirectory-BTC7FPqM.js} +1 -1
  2. package/dist/chunks/{App-aUVaOLeo.js → App-DOm71vtY.js} +1 -1
  3. package/dist/chunks/{ApproveApiKey-36iUE5CW.js → ApproveApiKey-9YQzwrrC.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-LPrZMlgU.js +1 -0
  5. package/dist/chunks/{AssistantSessionChooser-BLcvdkgb.js → AssistantSessionChooser-CnYfFWrx.js} +1 -1
  6. package/dist/chunks/{BackgroundTasksDialog-DyjVt81B.js → BackgroundTasksDialog-D_UHm7xo.js} +1 -1
  7. package/dist/chunks/{BypassPermissionsModeDialog-CTlpvTuz.js → BypassPermissionsModeDialog-DAq-qbqC.js} +1 -1
  8. package/dist/chunks/ClaudeMdExternalIncludesDialog--w2zWWEn.js +1 -0
  9. package/dist/chunks/{ClaudeMdExternalIncludesDialog-5pipE8m8.js → ClaudeMdExternalIncludesDialog-CyvidoR3.js} +1 -1
  10. package/dist/chunks/ConsoleOAuthFlow-BXdC6j3_.js +1 -0
  11. package/dist/chunks/{DesktopHandoff-Blg1TVut.js → DesktopHandoff-gRvy-WlW.js} +1 -1
  12. package/dist/chunks/{DiffDialog-CUEpuocY.js → DiffDialog-CdfVTgOx.js} +1 -1
  13. package/dist/chunks/Doctor-BuiYwjAS.js +1 -0
  14. package/dist/chunks/{Doctor-DlE1Mbb9.js → Doctor-DKlHJBXq.js} +1 -1
  15. package/dist/chunks/{ExitFlow-DCIhnP5h.js → ExitFlow-rExuBL3w.js} +1 -1
  16. package/dist/chunks/{Feedback-CDTqPqsM.js → Feedback-gGpjUC_F.js} +1 -1
  17. package/dist/chunks/{Grove-D9lSG_Lh.js → Grove-CD769Wvw.js} +1 -1
  18. package/dist/chunks/Grove-ENfM8hC6.js +1 -0
  19. package/dist/chunks/{HybridTransport-8j0AviF6.js → HybridTransport-kN1jmg26.js} +1 -1
  20. package/dist/chunks/{InvalidConfigDialog-I3t-0nU3.js → InvalidConfigDialog-BpJub73a.js} +1 -1
  21. package/dist/chunks/{InvalidSettingsDialog-BnthOxGT.js → InvalidSettingsDialog-DzOp3Ihx.js} +1 -1
  22. package/dist/chunks/{MCPConnectionManager-zdocEDgk.js → MCPConnectionManager-CaBvO7NB.js} +1 -1
  23. package/dist/chunks/{McpParsingWarnings-D0XvLirX.js → McpParsingWarnings-Cc6FWyU4.js} +1 -1
  24. package/dist/chunks/{MessageSelector-BBhCstBa.js → MessageSelector-DOB1S2-O.js} +1 -1
  25. package/dist/chunks/{Messages-Dv2VrytX.js → Messages-Clihwd2F.js} +2 -2
  26. package/dist/chunks/{Onboarding-B1WRpoBI.js → Onboarding-D00lTweB.js} +1 -1
  27. package/dist/chunks/{OverageCreditUpsell-BSmgq089.js → OverageCreditUpsell-B-Bf_-UX.js} +1 -1
  28. package/dist/chunks/{PluginSettings-DN9rpwc_.js → PluginSettings-DUxj_oAg.js} +1 -1
  29. package/dist/chunks/{PromptInputFooterSuggestions-3rjz6zhK.js → PromptInputFooterSuggestions-MwS_cExV.js} +1 -1
  30. package/dist/chunks/{PromptInputHelpMenu-DgDJHZqC.js → PromptInputHelpMenu-V2dEpzhC.js} +1 -1
  31. package/dist/chunks/{QueryEngine-BnaHDZVZ.js → QueryEngine-BLcPQYq_.js} +1 -1
  32. package/dist/chunks/{REPL-CA8FEO7J.js → REPL-B_E07dnf.js} +6 -6
  33. package/dist/chunks/REPL-BhURgntS.js +1 -0
  34. package/dist/chunks/{RemoteCallout-BFzCx_Pn.js → RemoteCallout-ChCjmgw1.js} +1 -1
  35. package/dist/chunks/{RemoteSessionManager-BhUrtejX.js → RemoteSessionManager-B43isWQs.js} +1 -1
  36. package/dist/chunks/{ResumeConversation-BseKUFRI.js → ResumeConversation-DaQ9n8_C.js} +1 -1
  37. package/dist/chunks/{SSETransport-DGIytG74.js → SSETransport-h43pQVlJ.js} +1 -1
  38. package/dist/chunks/SearchExtraToolsTool-DSq7beKs.js +1 -0
  39. package/dist/chunks/{Settings-BvhG1XoW.js → Settings-CNsaWv8g.js} +2 -2
  40. package/dist/chunks/{TeleportProgress-Bens06DU.js → TeleportProgress-QtJrXSCX.js} +1 -1
  41. package/dist/chunks/{TeleportRepoMismatchDialog-BtLBCZUe.js → TeleportRepoMismatchDialog-D-HVj-A6.js} +1 -1
  42. package/dist/chunks/{TeleportResumeWrapper-t50LfWyN.js → TeleportResumeWrapper-C6sbzJsJ.js} +1 -1
  43. package/dist/chunks/{ThemePicker-BTfuZZ7E.js → ThemePicker-CqPCp5Hs.js} +1 -1
  44. package/dist/chunks/{TrustDialog-CgE_pYUK.js → TrustDialog-CeVwxDlZ.js} +1 -1
  45. package/dist/chunks/{WelcomeV2-C93xQYAF.js → WelcomeV2-DNiXQ5ES.js} +1 -1
  46. package/dist/chunks/{add-dir-C3IhJYVH.js → add-dir-V3xjklnJ.js} +1 -1
  47. package/dist/chunks/{agentDisplay-Cju-aXCx.js → agentDisplay-BuiwcrQi.js} +1 -1
  48. package/dist/chunks/{agents-Bhg0CtXR.js → agents-D7um1IXM.js} +1 -1
  49. package/dist/chunks/{agents-Du3FQ82k.js → agents-ZY6IaVE7.js} +1 -1
  50. package/dist/chunks/{allErrors-DJYCAtab.js → allErrors-CHVdQ3fT.js} +1 -1
  51. package/dist/chunks/{ant-CVvy4SuO.js → ant-D66LZCap.js} +1 -1
  52. package/dist/chunks/{api-gJBnC8z3.js → api-C-rOQY-l.js} +1 -1
  53. package/dist/chunks/api-Dmn7DUgU.js +1 -0
  54. package/dist/chunks/{assistant-C_SkUDk_.js → assistant-CYF7ch7C.js} +1 -1
  55. package/dist/chunks/auth-C4Rvit2q.js +1 -0
  56. package/dist/chunks/auth-Cj7EX1eG.js +1 -0
  57. package/dist/chunks/{auth-CgEABs3i.js → auth-DAxGNCIR.js} +1 -1
  58. package/dist/chunks/{autoMode-CZyb-mMY.js → autoMode-TysBQkU_.js} +1 -1
  59. package/dist/chunks/{autonomy-DJZ25xZp.js → autonomy-CNEbT-t_.js} +1 -1
  60. package/dist/chunks/{autonomy-BpINX4jw.js → autonomy-k3QPea5z.js} +1 -1
  61. package/dist/chunks/{autonomyPanel-ssoiIOx5.js → autonomyPanel-DiztRblF.js} +1 -1
  62. package/dist/chunks/{backgroundHousekeeping-BHncba6e.js → backgroundHousekeeping-C9m4tiFi.js} +2 -2
  63. package/dist/chunks/backgroundHousekeeping-DQjzXBe0.js +1 -0
  64. package/dist/chunks/{branch-BXo5z2al.js → branch-_NBgDfrK.js} +1 -1
  65. package/dist/chunks/{bridge-CbKc1HeD.js → bridge-DpmFl8p8.js} +2 -2
  66. package/dist/chunks/{bridgeConfig-DbqUHe0H.js → bridgeConfig-DMBOO3gW.js} +1 -1
  67. package/dist/chunks/bridgeConfig-DsI5d0s7.js +1 -0
  68. package/dist/chunks/bridgeEnabled-DZzlF2d8.js +1 -0
  69. package/dist/chunks/{bridgeEnabled-CM3SaumJ.js → bridgeEnabled-FjPuA7zx.js} +1 -1
  70. package/dist/chunks/{bridgeMain-CzhBVCsN.js → bridgeMain-BppY0KW3.js} +6 -6
  71. package/dist/chunks/bridgeMain-BrY4tkF6.js +1 -0
  72. package/dist/chunks/{bridgeMessaging-lfa_v3oi.js → bridgeMessaging-N5zlzCCr.js} +1 -1
  73. package/dist/chunks/{btw-Cp0whJaJ.js → btw-BFRje_Zi.js} +1 -1
  74. package/dist/chunks/caches-BBLH8G1I.js +1 -0
  75. package/dist/chunks/{caches-CmW7idg5.js → caches-CcfPJ4_A.js} +2 -2
  76. package/dist/chunks/{ccrClient-BPXmxWHw.js → ccrClient-q2JCVCU2.js} +1 -1
  77. package/dist/chunks/{clear-DjGPxX7T.js → clear-CxY7W5Wt.js} +1 -1
  78. package/dist/chunks/client-CtVu3BLD.js +1 -0
  79. package/dist/chunks/{color-DYYBN52b.js → color-DOWhfjnA.js} +1 -1
  80. package/dist/chunks/commands-BWw1sQeH.js +1 -0
  81. package/dist/chunks/{commitAttribution-Bmzgtqc6.js → commitAttribution-CLbEIaRJ.js} +1 -1
  82. package/dist/chunks/commitAttribution-DIT_s0vY.js +1 -0
  83. package/dist/chunks/{compact-D6xqZN4Q.js → compact-CaOnQVkH.js} +1 -1
  84. package/dist/chunks/config-DmPGzNmi.js +1 -0
  85. package/dist/chunks/{config-huQaTcNb.js → config-HHTwEsWp.js} +1 -1
  86. package/dist/chunks/{context-Bh_iUj76.js → context-B2OvKo2t.js} +1 -1
  87. package/dist/chunks/context-noninteractive-BilCSCV1.js +1 -0
  88. package/dist/chunks/{context-noninteractive-Cb3EM2Oz.js → context-noninteractive-BuGxX3YL.js} +1 -1
  89. package/dist/chunks/conversation-BWXf3un9.js +1 -0
  90. package/dist/chunks/{conversation-CvCQta8e.js → conversation-awh8AwwL.js} +1 -1
  91. package/dist/chunks/{createSSHSession-B0s839mX.js → createSSHSession-C-c7I5iJ.js} +1 -1
  92. package/dist/chunks/{createSession-VMTMXOHu.js → createSession-D_fIDqgc.js} +1 -1
  93. package/dist/chunks/createSession-Hvpx3Le7.js +1 -0
  94. package/dist/chunks/{crossProjectResume-DGpgCUfk.js → crossProjectResume-_XjvSXA3.js} +1 -1
  95. package/dist/chunks/{datadog-D9rlcN12.js → datadog-Ed8emSFA.js} +1 -1
  96. package/dist/chunks/{desktop-DidI-4N5.js → desktop-D_ofPlyi.js} +1 -1
  97. package/dist/chunks/{diff-CZg5qL2n.js → diff-CUAgBDu1.js} +1 -1
  98. package/dist/chunks/doctor-CkdQ7Fv7.js +1 -0
  99. package/dist/chunks/{effort-BcvNemuq.js → effort-DCgooYMY.js} +1 -1
  100. package/dist/chunks/{entry-dA1UCfC0.js → entry-Bh0gPOAo.js} +1 -1
  101. package/dist/chunks/{envLessBridgeConfig-BFjJ8Kt4.js → envLessBridgeConfig-DJHZAlU-.js} +1 -1
  102. package/dist/chunks/envLessBridgeConfig-sxodu0xO.js +1 -0
  103. package/dist/chunks/{esm-DjGYYlQe.js → esm-B62dCLgf.js} +1 -1
  104. package/dist/chunks/{exit-COMnVxzw.js → exit-CFJR3NfE.js} +1 -1
  105. package/dist/chunks/{extra-usage-BTv_OwGN.js → extra-usage-CjaHpu8y.js} +1 -1
  106. package/dist/chunks/extra-usage-D1Y-3OWQ.js +1 -0
  107. package/dist/chunks/{extra-usage-core-RZMzaH0L.js → extra-usage-core-B6ga8Rni.js} +1 -1
  108. package/dist/chunks/{extra-usage-noninteractive-BB-BQ3kh.js → extra-usage-noninteractive-Dc9AndId.js} +1 -1
  109. package/dist/chunks/{extraUsage-CTn9FWSk.js → extraUsage-2DwLEr26.js} +1 -1
  110. package/dist/chunks/extractMemories-C3qrwpu2.js +1 -0
  111. package/dist/chunks/{fast-CNXgsvnE.js → fast-CW_NsL0x.js} +1 -1
  112. package/dist/chunks/fast-D3CPmUX4.js +1 -0
  113. package/dist/chunks/{feedback-DeJ2gvw2.js → feedback-BpRorTAC.js} +1 -1
  114. package/dist/chunks/{firstPartyEventLogger-CQdJn3LV.js → firstPartyEventLogger-CuUiNdj8.js} +2 -2
  115. package/dist/chunks/firstPartyEventLogger-DPUQnc6J.js +1 -0
  116. package/dist/chunks/{flushGate-CJ73xcaK.js → flushGate-BltVae97.js} +1 -1
  117. package/dist/chunks/{gemini-Cn9bMXwP.js → gemini-YyIxfveQ.js} +1 -1
  118. package/dist/chunks/{generateRecap-BO9kzRon.js → generateRecap-tx4wLIkI.js} +1 -1
  119. package/dist/chunks/{generateSessionName-CGpL6ATy.js → generateSessionName-BkDigIN8.js} +1 -1
  120. package/dist/chunks/{goal-C8Qzl7_i.js → goal-DZrD4puM.js} +1 -1
  121. package/dist/chunks/{grok-CDT9P_BL.js → grok-BZf7W_hL.js} +1 -1
  122. package/dist/chunks/{grove-BGXzEyH9.js → grove-CFBPplP6.js} +1 -1
  123. package/dist/chunks/{heapdump-CFHvdSZv.js → heapdump-DWc3Z2NO.js} +1 -1
  124. package/dist/chunks/{help-DUZ7Y7Em.js → help-pap9jNUJ.js} +1 -1
  125. package/dist/chunks/{hooks-RHwUCXcT.js → hooks-Bmat0L6A.js} +1 -1
  126. package/dist/chunks/hooks-cCAzfabs.js +1 -0
  127. package/dist/chunks/inboundAttachments-DZgSqDwY.js +1 -0
  128. package/dist/chunks/{inboundAttachments-Cfl4_n0S.js → inboundAttachments-DkfNHtF9.js} +1 -1
  129. package/dist/chunks/{initReplBridge-GH3-LHF4.js → initReplBridge-myzllvlk.js} +1 -1
  130. package/dist/chunks/{install-OkuNmjmB.js → install-D4jmHjmk.js} +1 -1
  131. package/dist/chunks/{instrumentation-hrXeo-G4.js → instrumentation-Nqgm1SMw.js} +3 -3
  132. package/dist/chunks/{job-DjmIpwJl.js → job-CT9bcgPb.js} +1 -1
  133. package/dist/chunks/{keybindings-B8U17bhs.js → keybindings-DETOn3qJ.js} +1 -1
  134. package/dist/chunks/{launchAgentsPlatform-DnxH2SAn.js → launchAgentsPlatform-CuRQgd2Q.js} +1 -1
  135. package/dist/chunks/{launchLocalMemory-CgXtGng1.js → launchLocalMemory-CRMqifzn.js} +1 -1
  136. package/dist/chunks/{launchLocalVault-Bs6Km3Ua.js → launchLocalVault-DlKX_oDE.js} +1 -1
  137. package/dist/chunks/{launchMemoryStores-DxVAIJuB.js → launchMemoryStores-CN0ecWpP.js} +1 -1
  138. package/dist/chunks/{launchOnboarding-Cn0t_o2k.js → launchOnboarding-DTdUA_wE.js} +1 -1
  139. package/dist/chunks/{launchSchedule-Chwr3Nzd.js → launchSchedule-psiSLmTA.js} +1 -1
  140. package/dist/chunks/{launchSkillStore-6zxJfWVU.js → launchSkillStore-CQQ00Ads.js} +1 -1
  141. package/dist/chunks/{launchTeleport-Ba_Hj13c.js → launchTeleport-CXFRPVMR.js} +1 -1
  142. package/dist/chunks/{launchVault-hGVrHy33.js → launchVault-Dn6jq0Rc.js} +1 -1
  143. package/dist/chunks/{loadAgentsDir-DrDu5yYy.js → loadAgentsDir-BURvZNN6.js} +38 -38
  144. package/dist/chunks/loadAgentsDir-Db9UTm45.js +1 -0
  145. package/dist/chunks/{loadPluginHooks-s7bvGtns.js → loadPluginHooks-C9A9oS-w.js} +1 -1
  146. package/dist/chunks/{localSearch-_bQhk9W6.js → localSearch-D2Rs8wQP.js} +1 -1
  147. package/dist/chunks/localSearch-hBh1ATr2.js +1 -0
  148. package/dist/chunks/{logoV2Utils-CoC4nheD.js → logoV2Utils-DN9nzdX-.js} +1 -1
  149. package/dist/chunks/{magicDocs-kMjYpjCA.js → magicDocs-DIeTcwAA.js} +1 -1
  150. package/dist/chunks/{main-C_rVSWfm.js → main-CI54PZrG.js} +14 -14
  151. package/dist/chunks/{mappers-D0CNXG32.js → mappers-Q_Z3Kjo-.js} +1 -1
  152. package/dist/chunks/{mcp-1ZuFesM9.js → mcp-CtbhGaLC.js} +1 -1
  153. package/dist/chunks/{mcp-CKvGBEjz.js → mcp-DMacvhqZ.js} +1 -1
  154. package/dist/chunks/{mcp-DtxIl6aN.js → mcp-RvwPC7FB.js} +2 -2
  155. package/dist/chunks/{memory-DE2jtkd_.js → memory-BPN8gW7n.js} +1 -1
  156. package/dist/chunks/{mode-B4WIxCMW.js → mode-Jl_Boaym.js} +1 -1
  157. package/dist/chunks/{model-fi472PRc.js → model-BIVmcl_N.js} +1 -1
  158. package/dist/chunks/{model-j9GNZDFr.js → model-CWBwPvTH.js} +1 -1
  159. package/dist/chunks/model-DlVpqR0P.js +1 -0
  160. package/dist/chunks/{nativeInstaller-DktvrWRd.js → nativeInstaller-8arnRiUO.js} +1 -1
  161. package/dist/chunks/{onChangeAppState-CGVeNkt7.js → onChangeAppState-DBantDJ6.js} +1 -1
  162. package/dist/chunks/{openai-BSVjSJiF.js → openai-yin1iDG8.js} +1 -1
  163. package/dist/chunks/{overageCreditGrant-BVxlYgeU.js → overageCreditGrant-CN_sVURL.js} +1 -1
  164. package/dist/chunks/{panelCall-Cp6fpQeL.js → panelCall-CPKC6VR5.js} +1 -1
  165. package/dist/chunks/{partition-RjCtgt9J.js → partition-CW0BJ881.js} +1 -1
  166. package/dist/chunks/{passes-ByTLy6pj.js → passes-DOm9ukdK.js} +1 -1
  167. package/dist/chunks/{permissions-B3df_htx.js → permissions-CxDJ__l6.js} +1 -1
  168. package/dist/chunks/{pidLock-CdNZ0Wfg.js → pidLock-C69HNTTb.js} +2 -2
  169. package/dist/chunks/{plan-BxTA-b4l.js → plan-B0rEs32a.js} +1 -1
  170. package/dist/chunks/{plugin-DOpl5e1t.js → plugin-BSEMgcGu.js} +1 -1
  171. package/dist/chunks/{pluginAutoupdate-L09CQ-ph.js → pluginAutoupdate-CTByPD8J.js} +1 -1
  172. package/dist/chunks/{pluginBlocklist-B32eWmzn.js → pluginBlocklist-mogKaK0p.js} +1 -1
  173. package/dist/chunks/{pluginCliCommands-CDMWnO3d.js → pluginCliCommands-DQQ7C7kk.js} +1 -1
  174. package/dist/chunks/{pluginFlagging-3FQGvIfq.js → pluginFlagging-mHNff1t9.js} +1 -1
  175. package/dist/chunks/{pluginOperations-ClzXYNQe.js → pluginOperations-JEedVzfS.js} +1 -1
  176. package/dist/chunks/pluginStartupCheck-D7ts2V3p.js +1 -0
  177. package/dist/chunks/{pluginStartupCheck-BNd2QNzZ.js → pluginStartupCheck-RscVZDi4.js} +1 -1
  178. package/dist/chunks/{plugins-CcDG95Bs.js → plugins-Cr03lISA.js} +1 -1
  179. package/dist/chunks/policyLimits-DWtLyJ4n.js +1 -0
  180. package/dist/chunks/{print-Cc_QOSPF.js → print-CZUmAzmt.js} +4 -4
  181. package/dist/chunks/{privacy-settings-ChNsgGUs.js → privacy-settings-CwJ1H8Ua.js} +1 -1
  182. package/dist/chunks/{processBashCommand-Bx6_oZoE.js → processBashCommand-aKNneP2u.js} +1 -1
  183. package/dist/chunks/{processSlashCommand-AltWgIFt.js → processSlashCommand-BcPnWNxZ.js} +1 -1
  184. package/dist/chunks/prompt-CIyhCdkE.js +1 -0
  185. package/dist/chunks/{prompt-C0nU0VK3.js → prompt-DNDgGM9q.js} +1 -1
  186. package/dist/chunks/prompt-DRhjinu2.js +1 -0
  187. package/dist/chunks/{promptEditor-Cumef6hJ.js → promptEditor-DMJyosKj.js} +1 -1
  188. package/dist/chunks/{rate-limit-options-VL7S3SCx.js → rate-limit-options--Y3oF1g0.js} +1 -1
  189. package/dist/chunks/{rcDebugLog-2-1XSyFV.js → rcDebugLog-DoL1FpGJ.js} +1 -1
  190. package/dist/chunks/{reconciler-DHRE_gV2.js → reconciler-CJcSh6xo.js} +1 -1
  191. package/dist/chunks/{referral-DrebVwqx.js → referral-UKJv23_5.js} +1 -1
  192. package/dist/chunks/{refresh-pFezssA8.js → refresh-ul_i5R1a.js} +1 -1
  193. package/dist/chunks/{release-notes-D7vrFNXp.js → release-notes-CGv_6MMt.js} +1 -1
  194. package/dist/chunks/{releaseNotes-CDx2P0fb.js → releaseNotes-BKZNuDLD.js} +1 -1
  195. package/dist/chunks/{reload-plugins-CltHfg-l.js → reload-plugins-2W11dpLQ.js} +1 -1
  196. package/dist/chunks/{remote-env-SvvSuP0J.js → remote-env-D9xsoBfx.js} +1 -1
  197. package/dist/chunks/{remoteBridgeCore-BOeljn2c.js → remoteBridgeCore-asY9JAXU.js} +1 -1
  198. package/dist/chunks/{remoteManagedSettings-CaY_ZH8r.js → remoteManagedSettings-Bxo3bv1U.js} +1 -1
  199. package/dist/chunks/{rename-CbqrCCBO.js → rename-CHsHMWpO.js} +1 -1
  200. package/dist/chunks/{resume-DockJaY9.js → resume-NduOaghx.js} +1 -1
  201. package/dist/chunks/{runtimeObserver-XufSllVw.js → runtimeObserver-BXbjibFk.js} +2 -2
  202. package/dist/chunks/{runtimeObserver-DSUuYKfs.js → runtimeObserver-Bo80nWQf.js} +1 -1
  203. package/dist/chunks/sandbox-adapter-DDfVl_2V.js +1 -0
  204. package/dist/chunks/{sandbox-toggle-CZI5fuK3.js → sandbox-toggle-C-WCDRN4.js} +1 -1
  205. package/dist/chunks/searchExtraTools-BHWzsbNO.js +1 -0
  206. package/dist/chunks/{session-B-Z3DU9o.js → session-pDd13-wE.js} +1 -1
  207. package/dist/chunks/{sessionDiscovery-C3pMZkBM.js → sessionDiscovery-CSUnpsCy.js} +1 -1
  208. package/dist/chunks/sessionFileAccessHooks-BZvxeufx.js +1 -0
  209. package/dist/chunks/{sessionMemory-CqRpgwtU.js → sessionMemory-CAmpw2yb.js} +1 -1
  210. package/dist/chunks/sessionMemory-DT0IkiA1.js +1 -0
  211. package/dist/chunks/sessionMemoryUtils-B4kGNH4j.js +1 -0
  212. package/dist/chunks/{sessionObserver-B_09FQKV.js → sessionObserver-Ur7PqKl_.js} +1 -1
  213. package/dist/chunks/sessionObserver-oIkwTidC.js +1 -0
  214. package/dist/chunks/sessionStorage-DqARUj0K.js +1 -0
  215. package/dist/chunks/{sessionTitle-CmLWNFuX.js → sessionTitle-pWMaI79N.js} +1 -1
  216. package/dist/chunks/{sessionTracing-lArOaj9u.js → sessionTracing-CCPRzOvy.js} +1 -1
  217. package/dist/chunks/{settingsSync-BlDk6rsM.js → settingsSync-D_4P3Esd.js} +1 -1
  218. package/dist/chunks/{setup-DdbmxSZh.js → setup-JHvhWKh9.js} +2 -2
  219. package/dist/chunks/{shadowedRuleDetection-E2wF1UjU.js → shadowedRuleDetection-Chi3afMR.js} +1 -1
  220. package/dist/chunks/{sideQuestion-BjHCLSR9.js → sideQuestion-D03MXdE2.js} +1 -1
  221. package/dist/chunks/{sinks-Cb--pqr-.js → sinks-B4_pw0Gb.js} +2 -2
  222. package/dist/chunks/sinks-Cro1Y8C2.js +1 -0
  223. package/dist/chunks/{skill-learning-B0dyBT1_.js → skill-learning-7ZQF5JvA.js} +1 -1
  224. package/dist/chunks/{skillChangeDetector-DQof8SUY.js → skillChangeDetector-uCaYrerZ.js} +1 -1
  225. package/dist/chunks/{skillGapStore-D2fqmnKx.js → skillGapStore-BND2Lq0Z.js} +1 -1
  226. package/dist/chunks/{skillGapStore-75ZYlfwi.js → skillGapStore-z3LP64O-.js} +2 -2
  227. package/dist/chunks/{skillGenerator-CwXUfM4Y.js → skillGenerator-DaNb-yKH.js} +2 -2
  228. package/dist/chunks/skillLearning-GZxYPlyl.js +1 -0
  229. package/dist/chunks/{skillLearning-CB-5fdMl.js → skillLearning-rMX1bSBa.js} +1 -1
  230. package/dist/chunks/{skillPanel-Bum7xpgo.js → skillPanel-q7GPSQ6_.js} +3 -3
  231. package/dist/chunks/{skillSearchPanel-LSPwZIOw.js → skillSearchPanel-oj8gy1ZL.js} +2 -2
  232. package/dist/chunks/{skills-G8WBeffd.js → skills-QqbeFP0s.js} +1 -1
  233. package/dist/chunks/{status-i5beKggW.js → status-BEIsLmfj.js} +1 -1
  234. package/dist/chunks/{status-ClSsvm1N.js → status-DW3Z_7xa.js} +1 -1
  235. package/dist/chunks/{statusNoticeHelpers-BK-54uGY.js → statusNoticeHelpers-CaHS8xig.js} +1 -1
  236. package/dist/chunks/{tag-DYYq4H_i.js → tag-CRg93Die.js} +1 -1
  237. package/dist/chunks/{tasks-BySzm_YJ.js → tasks-BEohK1ij.js} +1 -1
  238. package/dist/chunks/{teleport-dxtBcM01.js → teleport-4Srg5vcP.js} +1 -1
  239. package/dist/chunks/{templateJobs-CT5VxeRr.js → templateJobs-DYP1fjYU.js} +1 -1
  240. package/dist/chunks/{theme-CVTVsRwt.js → theme-kNL4kl_3.js} +1 -1
  241. package/dist/chunks/{thinkback-CXsRbDYN.js → thinkback-gV-sKkMM.js} +1 -1
  242. package/dist/chunks/thinkback-hc5eJ9ul.js +1 -0
  243. package/dist/chunks/{thinkback-play-BhfCaIye.js → thinkback-play-BpWMqbgJ.js} +1 -1
  244. package/dist/chunks/{toolEventObserver-DdhPsAs1.js → toolEventObserver-C98uraqD.js} +1 -1
  245. package/dist/chunks/{toolEventObserver--4fqXxQZ.js → toolEventObserver-ar5NDa0M.js} +1 -1
  246. package/dist/chunks/{toolPool-DvHECcbN.js → toolPool-CNYKDRq5.js} +1 -1
  247. package/dist/chunks/trustedDevice-0dehm9qz.js +1 -0
  248. package/dist/chunks/{trustedDevice-DvpN4J1F.js → trustedDevice-BBKUhCCL.js} +1 -1
  249. package/dist/chunks/{ultrareviewCommand-i3PfFKly.js → ultrareviewCommand-yXlFsMnv.js} +1 -1
  250. package/dist/chunks/{undercover-Q24TWRw0.js → undercover-BTIRVF1t.js} +1 -1
  251. package/dist/chunks/undercover-CG_269xD.js +1 -0
  252. package/dist/chunks/{updateCCB-CEXA6dax.js → updateCCB-B2xAJ4Nr.js} +1 -1
  253. package/dist/chunks/upgrade-J7lKLkD2.js +1 -0
  254. package/dist/chunks/{upgrade-7OrBbrzS.js → upgrade-yNl7EO4e.js} +1 -1
  255. package/dist/chunks/{upload-B-lNHpWe.js → upload-BWVIHmMB.js} +1 -1
  256. package/dist/chunks/{usage-CZdPfUqP.js → usage-B2PbCUMi.js} +1 -1
  257. package/dist/chunks/usage-Ck8Cu45g.js +1 -0
  258. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-CzFtdlnD.js → useExitOnCtrlCDWithKeybindings-CV4GZ-sq.js} +1 -1
  259. package/dist/chunks/useMainLoopModel-CO4yBjRM.js +1 -0
  260. package/dist/chunks/{useManagePlugins-BkK1zydO.js → useManagePlugins-BzFKIDrD.js} +1 -1
  261. package/dist/chunks/{useMergedTools-DMGRA1ga.js → useMergedTools-CRLWSGDl.js} +1 -1
  262. package/dist/chunks/{useSearchInput-D5VU9IDU.js → useSearchInput-BzGq4t7t.js} +1 -1
  263. package/dist/chunks/{useSettingsErrors-B5PSF1va.js → useSettingsErrors-CSemUjj1.js} +1 -1
  264. package/dist/chunks/{util-CNa1ib_4.js → util-BnReK81E.js} +1 -1
  265. package/dist/chunks/{validatePlugin-Dw-RGCrm.js → validatePlugin-D6sPqea1.js} +1 -1
  266. package/dist/chunks/{workerRegistry-B2QD2sKq.js → workerRegistry-CUXbNyL9.js} +1 -1
  267. package/dist/chunks/worktree-89ttIVxH.js +1 -0
  268. package/dist/cli.js +1 -1
  269. package/package.json +2 -6
  270. package/dist/chunks/ApproveApiKey-DPdcp1CQ.js +0 -1
  271. package/dist/chunks/ClaudeMdExternalIncludesDialog-Dn7Le--z.js +0 -1
  272. package/dist/chunks/ConsoleOAuthFlow-BDr1Vx5K.js +0 -1
  273. package/dist/chunks/Doctor-B540I-gq.js +0 -1
  274. package/dist/chunks/Grove-DLYXL8hv.js +0 -1
  275. package/dist/chunks/REPL-B3RbzeV7.js +0 -1
  276. package/dist/chunks/SearchExtraToolsTool-h6OunbMd.js +0 -1
  277. package/dist/chunks/api-CI8HXREw.js +0 -1
  278. package/dist/chunks/auth-B9V3i5oZ.js +0 -1
  279. package/dist/chunks/auth-fSFfSKy_.js +0 -1
  280. package/dist/chunks/backgroundHousekeeping-QK8iEXoI.js +0 -1
  281. package/dist/chunks/bridgeConfig-CLHy-BiF.js +0 -1
  282. package/dist/chunks/bridgeEnabled-BWSUZ7Xg.js +0 -1
  283. package/dist/chunks/bridgeMain-BESKzpm0.js +0 -1
  284. package/dist/chunks/caches-CpqTC0Lb.js +0 -1
  285. package/dist/chunks/client-DPUvQ6Rf.js +0 -1
  286. package/dist/chunks/commands-D7l3P1k9.js +0 -1
  287. package/dist/chunks/commitAttribution-B7NUPJ8E.js +0 -1
  288. package/dist/chunks/config-qLaiAn7z.js +0 -1
  289. package/dist/chunks/context-noninteractive-CNot6jbs.js +0 -1
  290. package/dist/chunks/conversation-CSpwF3Ha.js +0 -1
  291. package/dist/chunks/createSession-GNSNbUbN.js +0 -1
  292. package/dist/chunks/doctor-CKUXGCri.js +0 -1
  293. package/dist/chunks/envLessBridgeConfig-bei51W3H.js +0 -1
  294. package/dist/chunks/extra-usage-By33zGLT.js +0 -1
  295. package/dist/chunks/extractMemories-CXGZGe0h.js +0 -1
  296. package/dist/chunks/fast-BXzdzzXU.js +0 -1
  297. package/dist/chunks/firstPartyEventLogger-CdLshdJY.js +0 -1
  298. package/dist/chunks/hooks-fZ1r0jUF.js +0 -1
  299. package/dist/chunks/inboundAttachments-YMxf4fmR.js +0 -1
  300. package/dist/chunks/loadAgentsDir-BHOyHxwz.js +0 -1
  301. package/dist/chunks/localSearch-CebU5BA9.js +0 -1
  302. package/dist/chunks/model-C4RHNhDQ.js +0 -1
  303. package/dist/chunks/pluginStartupCheck-RiZxW-WU.js +0 -1
  304. package/dist/chunks/policyLimits-Bwi9VqDF.js +0 -1
  305. package/dist/chunks/prompt-CYx145pp.js +0 -1
  306. package/dist/chunks/prompt-DH3lKFag.js +0 -1
  307. package/dist/chunks/sandbox-adapter-CEZnHq0U.js +0 -1
  308. package/dist/chunks/searchExtraTools-iQfI39wB.js +0 -1
  309. package/dist/chunks/sessionFileAccessHooks-DyrZmoA7.js +0 -1
  310. package/dist/chunks/sessionMemory-D_HQmhj7.js +0 -1
  311. package/dist/chunks/sessionMemoryUtils-CZOIKrn0.js +0 -1
  312. package/dist/chunks/sessionObserver-B400YG3s.js +0 -1
  313. package/dist/chunks/sessionStorage-DRnvtrpU.js +0 -1
  314. package/dist/chunks/sinks-DbwDBd-E.js +0 -1
  315. package/dist/chunks/skillLearning-CSY5R5Jn.js +0 -1
  316. package/dist/chunks/thinkback-B-GpXG9U.js +0 -1
  317. package/dist/chunks/trustedDevice-e6iF1X7C.js +0 -1
  318. package/dist/chunks/undercover-CPvoDtJ1.js +0 -1
  319. package/dist/chunks/upgrade-uR7SIVtx.js +0 -1
  320. package/dist/chunks/usage-7jOeIVv9.js +0 -1
  321. package/dist/chunks/useMainLoopModel-DegH12LZ.js +0 -1
  322. package/dist/chunks/worktree-D38cJ23W.js +0 -1
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{B as r,en as i}from"./state-ix0xIunV.js";import{AE as a,Al as o,Bc as s,DE as c,Dl as l,El as u,Fn as d,In as f,Jw as p,Ln as m,Lo as h,Ml as g,So as _,TE as ee,Vc as te,YT as ne,_E as v,aE as y,cl as b,dE as re,fE as ie,fl as x,gE as ae,hE as S,jE as oe,kE as se,lE as ce,lt as le,mE as C,ml as ue,pE as de,pl as w,qw as T,sE as E,sl as D,uE as O,ut as k,vE as A,wE as j,yE as M,zo as N}from"./loadAgentsDir-DrDu5yYy.js";import{F as P,I as F,d as I,p as L,z as R}from"./debug-BrXObCdR.js";import{_n as z,gn as B}from"./settings-DfWP5y6X.js";import{n as V,r as H}from"./analytics-BotDBGh0.js";import{Ci as fe,Si as pe}from"./model-fi472PRc.js";import{fn as U,hn as me}from"./prompt-C0nU0VK3.js";import{st as he}from"./rcDebugLog-2-1XSyFV.js";import{writeFile as W}from"fs/promises";function ge(){return!1}function _e(){return{}}function ve(e,t){let n=0,r=t==null;for(let i of e){if(!r){i.uuid===t&&(r=!0);continue}if(i.type===`assistant`){let e=i.message.content;Array.isArray(e)&&(n+=B(e,e=>e.type===`tool_use`))}}return n}function G(e){let t=c(e);if(!de()){if(!O(t))return!1;ae()}let n=re(t),r=ve(e,X)>=ce(),i=h(e);if(n&&r||n&&!i){let t=e[e.length-1];return t?.uuid&&(X=t.uuid),!0}return!1}async function K(e){let t=I(),n=d();await t.mkdir(n,{mode:448});let r=f();try{await W(r,``,{encoding:`utf-8`,mode:384,flag:`wx`}),await W(r,await ue(),{encoding:`utf-8`,mode:384})}catch(e){if(F(e)!==`EEXIST`)throw e}e.readFileState.delete(r);let i=await s.call({file_path:r},e),a=``,o=i.data;return o.type===`text`&&(a=o.file.content),H(`tengu_session_memory_file_read`,{content_length:a.length}),{memoryPath:r,currentMemory:a}}function ye(){if(r())return;let e=b();process.env.USER_TYPE===`ant`&&H(`tengu_session_memory_init`,{auto_compact_enabled:e}),e&&p($)}async function q(e,t){if(e.length===0)return{success:!1,error:`No messages to summarize`};S();try{let n=l(t),{memoryPath:r,currentMemory:i}=await K(n),o=await x(i,r),{tools:s,mainLoopModel:u}=t.options,[d,f,p]=await Promise.all([le(s,u),a(),se()]),m=he(d);return await g({promptMessages:[_({content:o})],cacheSafeParams:{systemPrompt:m,userContext:f,systemContext:p,toolUseContext:n,forkContextMessages:e},canUseTool:J(r),querySource:`session_memory`,forkLabel:`session_memory_manual`,overrides:{readFileState:n.readFileState}}),H(`tengu_session_memory_manual_extraction`,{}),v(c(e)),Y(e),{success:!0,memoryPath:r}}catch(e){return{success:!1,error:P(e)}}finally{C()}}function J(e){return async(t,n)=>{if(t.name===`Edit`&&typeof n==`object`&&n&&`file_path`in n){let t=n.file_path;if(typeof t==`string`&&t===e)return{behavior:`allow`,updatedInput:n}}return{behavior:`deny`,message:`only ${U} on ${e} is allowed`,decisionReason:{type:`other`,reason:`only ${U} on ${e} is allowed`}}}}function Y(e){if(!h(e)){let t=e[e.length-1];t?.uuid&&A(t.uuid)}}var X,Z,Q,$,be=e((()=>{n(),i(),k(),oe(),me(),te(),z(),o(),L(),T(),N(),m(),pe(),ne(),ee(),V(),D(),w(),ie(),R(),Z=t(()=>{let e=_e();M({minimumMessageTokensToInit:e.minimumMessageTokensToInit&&e.minimumMessageTokensToInit>0?e.minimumMessageTokensToInit:y.minimumMessageTokensToInit,minimumTokensBetweenUpdate:e.minimumTokensBetweenUpdate&&e.minimumTokensBetweenUpdate>0?e.minimumTokensBetweenUpdate:y.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:e.toolCallsBetweenUpdates&&e.toolCallsBetweenUpdates>0?e.toolCallsBetweenUpdates:y.toolCallsBetweenUpdates})}),Q=!1,$=fe(async function(e){let{messages:t,toolUseContext:n,querySource:r}=e;if(r!==`repl_main_thread`)return;{let{isPoorModeActive:e}=await import(`./poorMode-AE4WNYZo.js`);if(e())return}if(!ge()){process.env.USER_TYPE===`ant`&&!Q&&(Q=!0,H(`tengu_session_memory_gate_disabled`,{}));return}if(Z(),!G(t))return;S();let i=l(n),{memoryPath:a,currentMemory:o}=await K(i);await g({promptMessages:[_({content:await x(o,a)})],cacheSafeParams:u(e),canUseTool:J(a),querySource:`session_memory`,forkLabel:`session_memory`,overrides:{readFileState:i.readFileState}});let s=t[t.length-1],d=s?j(s):void 0,f=E();H(`tengu_session_memory_extraction`,{input_tokens:d?.input_tokens,output_tokens:d?.output_tokens,cache_read_input_tokens:d?.cache_read_input_tokens??void 0,cache_creation_input_tokens:d?.cache_creation_input_tokens??void 0,config_min_message_tokens_to_init:f.minimumMessageTokensToInit,config_min_tokens_between_update:f.minimumTokensBetweenUpdate,config_tool_calls_between_updates:f.toolCallsBetweenUpdates}),v(c(t)),Y(t),C()})}));export{G as a,q as i,ye as n,be as r,J as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{B as r,en as i}from"./state-ix0xIunV.js";import{AE as a,Al as o,Bc as s,DE as c,Dl as l,El as u,Fn as d,In as f,Jw as p,Ln as m,Lo as h,Ml as g,So as _,TE as ee,Vc as te,YT as ne,_E as v,aE as y,cl as b,dE as re,fE as ie,fl as x,gE as ae,hE as S,jE as oe,kE as se,lE as ce,lt as le,mE as C,ml as ue,pE as de,pl as w,qw as T,sE as E,sl as D,uE as O,ut as k,vE as A,wE as j,yE as M,zo as N}from"./loadAgentsDir-BURvZNN6.js";import{F as P,I as F,d as I,p as L,z as R}from"./debug-BrXObCdR.js";import{_n as z,gn as B}from"./settings-DfWP5y6X.js";import{n as V,r as H}from"./analytics-BotDBGh0.js";import{Ci as fe,Si as pe}from"./model-BIVmcl_N.js";import{fn as U,hn as me}from"./prompt-DNDgGM9q.js";import{st as he}from"./rcDebugLog-DoL1FpGJ.js";import{writeFile as W}from"fs/promises";function ge(){return!1}function _e(){return{}}function ve(e,t){let n=0,r=t==null;for(let i of e){if(!r){i.uuid===t&&(r=!0);continue}if(i.type===`assistant`){let e=i.message.content;Array.isArray(e)&&(n+=B(e,e=>e.type===`tool_use`))}}return n}function G(e){let t=c(e);if(!de()){if(!O(t))return!1;ae()}let n=re(t),r=ve(e,X)>=ce(),i=h(e);if(n&&r||n&&!i){let t=e[e.length-1];return t?.uuid&&(X=t.uuid),!0}return!1}async function K(e){let t=I(),n=d();await t.mkdir(n,{mode:448});let r=f();try{await W(r,``,{encoding:`utf-8`,mode:384,flag:`wx`}),await W(r,await ue(),{encoding:`utf-8`,mode:384})}catch(e){if(F(e)!==`EEXIST`)throw e}e.readFileState.delete(r);let i=await s.call({file_path:r},e),a=``,o=i.data;return o.type===`text`&&(a=o.file.content),H(`tengu_session_memory_file_read`,{content_length:a.length}),{memoryPath:r,currentMemory:a}}function ye(){if(r())return;let e=b();process.env.USER_TYPE===`ant`&&H(`tengu_session_memory_init`,{auto_compact_enabled:e}),e&&p($)}async function q(e,t){if(e.length===0)return{success:!1,error:`No messages to summarize`};S();try{let n=l(t),{memoryPath:r,currentMemory:i}=await K(n),o=await x(i,r),{tools:s,mainLoopModel:u}=t.options,[d,f,p]=await Promise.all([le(s,u),a(),se()]),m=he(d);return await g({promptMessages:[_({content:o})],cacheSafeParams:{systemPrompt:m,userContext:f,systemContext:p,toolUseContext:n,forkContextMessages:e},canUseTool:J(r),querySource:`session_memory`,forkLabel:`session_memory_manual`,overrides:{readFileState:n.readFileState}}),H(`tengu_session_memory_manual_extraction`,{}),v(c(e)),Y(e),{success:!0,memoryPath:r}}catch(e){return{success:!1,error:P(e)}}finally{C()}}function J(e){return async(t,n)=>{if(t.name===`Edit`&&typeof n==`object`&&n&&`file_path`in n){let t=n.file_path;if(typeof t==`string`&&t===e)return{behavior:`allow`,updatedInput:n}}return{behavior:`deny`,message:`only ${U} on ${e} is allowed`,decisionReason:{type:`other`,reason:`only ${U} on ${e} is allowed`}}}}function Y(e){if(!h(e)){let t=e[e.length-1];t?.uuid&&A(t.uuid)}}var X,Z,Q,$,be=e((()=>{n(),i(),k(),oe(),me(),te(),z(),o(),L(),T(),N(),m(),pe(),ne(),ee(),V(),D(),w(),ie(),R(),Z=t(()=>{let e=_e();M({minimumMessageTokensToInit:e.minimumMessageTokensToInit&&e.minimumMessageTokensToInit>0?e.minimumMessageTokensToInit:y.minimumMessageTokensToInit,minimumTokensBetweenUpdate:e.minimumTokensBetweenUpdate&&e.minimumTokensBetweenUpdate>0?e.minimumTokensBetweenUpdate:y.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:e.toolCallsBetweenUpdates&&e.toolCallsBetweenUpdates>0?e.toolCallsBetweenUpdates:y.toolCallsBetweenUpdates})}),Q=!1,$=fe(async function(e){let{messages:t,toolUseContext:n,querySource:r}=e;if(r!==`repl_main_thread`)return;{let{isPoorModeActive:e}=await import(`./poorMode-AE4WNYZo.js`);if(e())return}if(!ge()){process.env.USER_TYPE===`ant`&&!Q&&(Q=!0,H(`tengu_session_memory_gate_disabled`,{}));return}if(Z(),!G(t))return;S();let i=l(n),{memoryPath:a,currentMemory:o}=await K(i);await g({promptMessages:[_({content:await x(o,a)})],cacheSafeParams:u(e),canUseTool:J(a),querySource:`session_memory`,forkLabel:`session_memory`,overrides:{readFileState:i.readFileState}});let s=t[t.length-1],d=s?j(s):void 0,f=E();H(`tengu_session_memory_extraction`,{input_tokens:d?.input_tokens,output_tokens:d?.output_tokens,cache_read_input_tokens:d?.cache_read_input_tokens??void 0,cache_creation_input_tokens:d?.cache_creation_input_tokens??void 0,config_min_message_tokens_to_init:f.minimumMessageTokensToInit,config_min_tokens_between_update:f.minimumTokensBetweenUpdate,config_tool_calls_between_updates:f.toolCallsBetweenUpdates}),v(c(t)),Y(t),C()})}));export{G as a,q as i,ye as n,be as r,J as t};
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./sessionMemory-CAmpw2yb.js";t();export{e as manuallyExtractSessionMemory};
@@ -0,0 +1 @@
1
+ import{cE as e,fE as t}from"./loadAgentsDir-BURvZNN6.js";t();export{e as getSessionMemoryContent};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{YT as t,et as n,tt as r}from"./loadAgentsDir-DrDu5yYy.js";import{st as i}from"./rcDebugLog-2-1XSyFV.js";import{i as a,l as o,r as s,t as c,u as l}from"./instinctParser-Dt-lqnDe.js";function u(e){g.set(e.name,e),_||(_=e.name)}function d(e){if(!g.has(e))throw Error(`Observer backend "${e}" is not registered`);_=e}function f(){let e=_?g.get(_):void 0;if(!e)throw Error(`No observer backend is active — register one before analyzing observations`);return e}async function p(e,t){return Promise.resolve(f().analyze(e,t))}function m(){let e=process.env.SKILL_LEARNING_OBSERVER_BACKEND?.trim();return e&&g.has(e)?e:void 0}function h(){let e=m();return e&&d(e),f()}var g,_,v=e((()=>{g=new Map})),y,b=e((()=>{y=[`workflow`,`testing`,`debugging`,`code-style`,`security`,`git`,`project`]}));async function x(e,t){if(e.length===0)return[];if(Date.now()<L)return S(e,t);let n=e.slice(-30),a=C(n),s=P(o().llm.timeoutMs),c;try{let e=await r({systemPrompt:i([R]),userPrompt:a,signal:s,options:{querySource:`skill_learning_observer`,enablePromptCaching:!0,agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[]}});I=0,c=T(e.message?.content)}catch{return I++,I>=o().llm.failureThreshold&&(L=Date.now()+o().llm.circuitCooldownMs),S(e,t)}let l=E(c,t,n);return l.length===0?(I++,I>=o().llm.failureThreshold&&(L=Date.now()+o().llm.circuitCooldownMs),S(e,t)):l}async function S(e,t){try{let{heuristicObserverBackend:n}=await import(`./sessionObserver-B400YG3s.js`),r=n.analyze(e,t);return Array.isArray(r)?r:await r}catch{return[]}}function C(e){return`Observations (chronological, newest last):\n${e.map((e,t)=>ee(e,t)).join(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{YT as t,et as n,tt as r}from"./loadAgentsDir-BURvZNN6.js";import{st as i}from"./rcDebugLog-DoL1FpGJ.js";import{i as a,l as o,r as s,t as c,u as l}from"./instinctParser-Dt-lqnDe.js";function u(e){g.set(e.name,e),_||(_=e.name)}function d(e){if(!g.has(e))throw Error(`Observer backend "${e}" is not registered`);_=e}function f(){let e=_?g.get(_):void 0;if(!e)throw Error(`No observer backend is active — register one before analyzing observations`);return e}async function p(e,t){return Promise.resolve(f().analyze(e,t))}function m(){let e=process.env.SKILL_LEARNING_OBSERVER_BACKEND?.trim();return e&&g.has(e)?e:void 0}function h(){let e=m();return e&&d(e),f()}var g,_,v=e((()=>{g=new Map})),y,b=e((()=>{y=[`workflow`,`testing`,`debugging`,`code-style`,`security`,`git`,`project`]}));async function x(e,t){if(e.length===0)return[];if(Date.now()<L)return S(e,t);let n=e.slice(-30),a=C(n),s=P(o().llm.timeoutMs),c;try{let e=await r({systemPrompt:i([R]),userPrompt:a,signal:s,options:{querySource:`skill_learning_observer`,enablePromptCaching:!0,agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[]}});I=0,c=T(e.message?.content)}catch{return I++,I>=o().llm.failureThreshold&&(L=Date.now()+o().llm.circuitCooldownMs),S(e,t)}let l=E(c,t,n);return l.length===0?(I++,I>=o().llm.failureThreshold&&(L=Date.now()+o().llm.circuitCooldownMs),S(e,t)):l}async function S(e,t){try{let{heuristicObserverBackend:n}=await import(`./sessionObserver-oIkwTidC.js`),r=n.analyze(e,t);return Array.isArray(r)?r:await r}catch{return[]}}function C(e){return`Observations (chronological, newest last):\n${e.map((e,t)=>ee(e,t)).join(`
2
2
  `)}\n\nExtract up to ${F} atomic instincts. JSON array only.`}function ee(e,t){let n=[`#${t+1}`,`event=${e.event}`];return e.toolName&&n.push(`tool=${e.toolName}`),e.outcome&&n.push(`outcome=${e.outcome}`),e.messageText&&n.push(`text=${JSON.stringify(w(e.messageText,200))}`),e.toolInput&&n.push(`in=${JSON.stringify(w(e.toolInput,120))}`),e.toolOutput&&n.push(`out=${JSON.stringify(w(e.toolOutput,120))}`),n.join(` | `)}function w(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function T(e){if(!Array.isArray(e))return``;let t=[];for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;e.type===`text`&&typeof e.text==`string`&&t.push(e.text)}return t.join(``).trim()}function E(e,t,n){let r=D(e);if(!r)return[];let i;try{i=JSON.parse(r)}catch{return[]}if(!Array.isArray(i))return[];let a=n.map(e=>e.id),o=[];for(let e of i.slice(0,F)){let n=O(e,t,a);n&&o.push(n)}return o}function D(e){if(!e)return;let t=e.indexOf(`[`),n=e.lastIndexOf(`]`);if(!(t<0||n<=t))return e.slice(t,n+1)}function O(e,t,n){if(!e||typeof e!=`object`)return;let r=e,i=k(r.trigger,80),a=k(r.action,120);if(!i||!a)return;let o=N(r.evidence);if(o.length!==0)return{trigger:i,action:a,confidence:A(r.confidence),domain:j(r.domain),source:`session-observation`,scope:M(r.scope),projectId:t?.project?.projectId,projectName:t?.project?.projectName,evidence:o,observationIds:n}}function k(e,t){if(typeof e!=`string`)return;let n=e.trim();if(n)return n.length>t?n.slice(0,t):n}function A(e){return typeof e!=`number`||!Number.isFinite(e)?.5:e<0?0:e>1?1:e}function j(e){return typeof e==`string`&&y.includes(e)?e:`project`}function M(e){return e===`global`?`global`:`project`}function N(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();if(e&&(t.push(e.length>200?`${e.slice(0,200)}…`:e),t.length===3))break}return t}function P(e){return AbortSignal.timeout(e)}var F,I,L,R,z,B=e((()=>{n(),t(),l(),b(),F=3,I=0,L=0,R=`You analyse a short sequence of observations from a coding-assistant session (user messages, tool invocations with outcomes, assistant messages) and extract atomic, reusable "instincts" — behavioural patterns that would help the assistant act correctly in future similar situations.
3
3
 
4
4
  Respond with ONLY a JSON array (no prose, no code fences, no commentary). Each item must match this schema:
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./sessionObserver-Ur7PqKl_.js";e();export{t as heuristicObserverBackend};
@@ -0,0 +1 @@
1
+ import{Rr as e,jr as t,si as n}from"./loadAgentsDir-BURvZNN6.js";t();export{e as linkSessionToPR,n as recordTranscript};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{E as t,M as n,n as r,r as i,t as a}from"./lazySchema-DcIJE_0i.js";import{en as o,z as s}from"./state-ix0xIunV.js";import{To as c,YT as l,et as u,tt as d,zo as f}from"./loadAgentsDir-DrDu5yYy.js";import{a as p,l as m}from"./debug-BrXObCdR.js";import{s as h,u as g}from"./types-C-MRCL8J.js";import{n as _,r as v}from"./analytics-BotDBGh0.js";import{st as y}from"./rcDebugLog-2-1XSyFV.js";function b(e){let t=[];for(let n of e){if(n.type!==`user`&&n.type!==`assistant`||`isMeta`in n&&n.isMeta||`origin`in n&&n.origin&&n.origin.kind!==`human`)continue;let e=n.message.content;if(typeof e==`string`)t.push(e);else if(Array.isArray(e))for(let n of e)`type`in n&&n.type===`text`&&`text`in n&&t.push(n.text)}let n=t.join(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{E as t,M as n,n as r,r as i,t as a}from"./lazySchema-DcIJE_0i.js";import{en as o,z as s}from"./state-ix0xIunV.js";import{To as c,YT as l,et as u,tt as d,zo as f}from"./loadAgentsDir-BURvZNN6.js";import{a as p,l as m}from"./debug-BrXObCdR.js";import{s as h,u as g}from"./types-C-MRCL8J.js";import{n as _,r as v}from"./analytics-BotDBGh0.js";import{st as y}from"./rcDebugLog-DoL1FpGJ.js";function b(e){let t=[];for(let n of e){if(n.type!==`user`&&n.type!==`assistant`||`isMeta`in n&&n.isMeta||`origin`in n&&n.origin&&n.origin.kind!==`human`)continue;let e=n.message.content;if(typeof e==`string`)t.push(e);else if(Array.isArray(e))for(let n of e)`type`in n&&n.type===`text`&&`text`in n&&t.push(n.text)}let n=t.join(`
2
2
  `);return n.length>S?n.slice(-1e3):n}async function x(e,t){let n=e.trim();if(!n)return null;try{let e=c((await d({systemPrompt:y([C]),userPrompt:n,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{title:{type:`string`}},required:[`title`],additionalProperties:!1}},signal:t,options:{querySource:`generate_session_title`,agents:[],isNonInteractiveSession:s(),hasAppendSystemPrompt:!1,mcpTools:[]}})).message.content),r=w().safeParse(g(e)),i=r.success&&r.data.title.trim()||null;return v(`tengu_session_title_generated`,{success:i!==null}),i}catch(e){return m(`generateSessionTitle failed: ${e}`,{level:`error`}),v(`tengu_session_title_generated`,{success:!1}),null}}var S,C,w,T=e((()=>{i(),o(),_(),u(),p(),h(),a(),f(),l(),S=1e3,C=`Generate a concise, sentence-case title (3-7 words) that captures the main topic or goal of this coding session. The title should be clear enough that the user recognizes the session in a list. Use sentence case: capitalize only the first word and proper nouns.
3
3
 
4
4
  Return JSON with a single "title" field.
@@ -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{i as r,l as i,n as a}from"./esm-lWlUmoUA.js";import{A as o,en as s,ht as c,lt as l,z as u}from"./state-ix0xIunV.js";import{C as d,S as f,a as p,l as m,w as h,z as ee}from"./debug-BrXObCdR.js";import{f as g,g as te}from"./config-DiT2Z8dY.js";import{i as ne,t as re}from"./hash-Tu-My5Vp.js";import{Mt as ie,Vt as ae}from"./model-fi472PRc.js";import{et as oe,ft as se,rt as ce,ut as le}from"./esm-DjGYYlQe.js";import"path";import"fs";import{createHash as ue}from"crypto";import"fs/promises";import{AsyncLocalStorage as de}from"async_hooks";function fe(e){let t=BigInt(58),n=Array(v).fill(_[0]),r=v-1,i=e;for(;i>0n;){let e=Number(i%t);n[r]=_[e],i/=t,r--}return n.join(``)}function pe(e){let t=e.replace(/-/g,``);if(t.length!==32)throw Error(`Invalid UUID hex length: ${t.length}`);return BigInt(`0x`+t)}function me(e,t){let n=pe(t);return`${e}_${he}${fe(n)}`}var _,he,v,ge=e((()=>{_=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,he=`01`,v=22}));function y(e){let n=_e[e],r=process.env[e];return r===void 0?n:t(r)}function b(){let e=g(),t=c(),n={"user.id":e};y(`OTEL_METRICS_INCLUDE_SESSION_ID`)&&(n[`session.id`]=t),y(`OTEL_METRICS_INCLUDE_VERSION`)&&(n[`app.version`]=`0.0.3`);let r=ie();if(r){let e=r.organizationUuid,t=r.emailAddress,i=r.accountUuid;e&&(n[`organization.id`]=e),t&&(n[`user.email`]=t),i&&y(`OTEL_METRICS_INCLUDE_ACCOUNT_UUID`)&&(n[`user.account_uuid`]=i,n[`user.account_id`]=process.env.CLAUDE_CODE_ACCOUNT_TAGGED_ID||me(`user`,i))}return le.terminal&&(n[`terminal.type`]=le.terminal),n}var _e,x=e((()=>{s(),ae(),te(),se(),n(),ge(),_e={OTEL_METRICS_INCLUDE_SESSION_ID:!0,OTEL_METRICS_INCLUDE_VERSION:!1,OTEL_METRICS_INCLUDE_ACCOUNT_UUID:!0}}));function ve(){return t(process.env.OTEL_LOG_USER_PROMPTS)}function ye(e){return ve()?e:`<REDACTED>`}async function S(e,t={}){let n=o();if(!n){C||(C=!0,m(`[3P telemetry] Event dropped (no event logger initialized): ${e}`,{level:`warn`}));return}let r={...b(),"event.name":e,"event.timestamp":new Date().toISOString(),"event.sequence":be++},i=l();i&&(r[`prompt.id`]=i);let a=process.env.CLAUDE_CODE_WORKSPACE_HOST_PATHS;a&&(r[`workspace.host_paths`]=a.split(`|`));for(let[e,n]of Object.entries(t))n!==void 0&&(r[e]=n);n.emit({body:`claude_code.${e}`,attributes:r})}var be,C,xe=e((()=>{s(),p(),n(),x(),be=0,C=!1}));function Se(e){return Math.abs(re(e))||1}function Ce(e){let t=L.get(e);return t===void 0?(I++,L.set(e,I),I):t}function w(){let e=c(),t=`main`,n=M.get(e);if(n)return n;let r={agentId:e,agentName:t,parentAgentId:void 0,processId:1,threadId:Se(t)};return M.set(e,r),N++,r}function T(){return(Date.now()-P)*1e3}function E(){return`span_${++F}`}function we(){let e=process.env.CLAUDE_CODE_PERFETTO_TRACE;m(`[Perfetto] initializePerfettoTracing called, env value: ${e}`)}function Te(e){O&&(k.push({name:`process_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{name:e.agentName}}),k.push({name:`thread_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:e.threadId,args:{name:e.agentName}}),e.parentAgentId&&k.push({name:`parent_agent`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{parent_agent_id:e.parentAgentId}}))}function D(){return O}function Ee(e,t,n){if(!O)return;let r={agentId:e,agentName:t,parentAgentId:n,processId:Ce(e),threadId:Se(t)};M.set(e,r),N++,Te(r)}function De(e){O&&(M.delete(e),L.delete(e))}function Oe(e){if(!O)return``;let t=E(),n=w();return j.set(t,{name:`API Call`,category:`api`,startTime:T(),agentInfo:n,args:{model:e.model,prompt_tokens:e.promptTokens,message_id:e.messageId,is_speculative:e.isSpeculative??!1,query_source:e.querySource}}),A.push({name:`API Call`,cat:`api`,ph:`B`,ts:j.get(t).startTime,pid:n.processId,tid:n.threadId,args:j.get(t).args}),t}function ke(e,t){if(!O||!e)return;let n=j.get(e);if(!n)return;let r=T(),i=r-n.startTime,a=t.promptTokens??n.args.prompt_tokens,o=t.ttftMs,s=t.ttltMs,c=t.outputTokens,l=t.cacheReadTokens,u=o!==void 0&&a!==void 0&&o>0?Math.round(a/(o/1e3)*100)/100:void 0,d=s!==void 0&&o!==void 0?s-o:void 0,f=d!==void 0&&c!==void 0&&d>0?Math.round(c/(d/1e3)*100)/100:void 0,p=l!==void 0&&a!==void 0&&a>0?Math.round(l/a*1e4)/100:void 0,m=t.requestSetupMs,h=t.attemptStartTimes,ee={...n.args,ttft_ms:o,ttlt_ms:s,prompt_tokens:a,output_tokens:c,cache_read_tokens:l,cache_creation_tokens:t.cacheCreationTokens,message_id:t.messageId??n.args.message_id,success:t.success??!0,error:t.error,duration_ms:i/1e3,request_setup_ms:m,itps:u,otps:f,cache_hit_rate_pct:p},g=m!==void 0&&m>0?m*1e3:0;if(g>0){let e=n.startTime+g;if(A.push({name:`Request Setup`,cat:`api,setup`,ph:`B`,ts:n.startTime,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{request_setup_ms:m,attempt_count:h?.length??1}}),h&&h.length>1){let e=h[0];for(let t=0;t<h.length-1;t++){let r=n.startTime+(h[t]-e)*1e3,i=n.startTime+(h[t+1]-e)*1e3;A.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`B`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{attempt:t+1}}),A.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`E`,ts:i,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}}A.push({name:`Request Setup`,cat:`api,setup`,ph:`E`,ts:e,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}if(o!==void 0){let e=n.startTime+g,t=e+o*1e3;A.push({name:`First Token`,cat:`api,ttft`,ph:`B`,ts:e,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{ttft_ms:o,prompt_tokens:a,itps:u,cache_hit_rate_pct:p}}),A.push({name:`First Token`,cat:`api,ttft`,ph:`E`,ts:t,pid:n.agentInfo.processId,tid:n.agentInfo.threadId});let r=s===void 0?void 0:s-o-g/1e3;r!==void 0&&r>0&&(A.push({name:`Sampling`,cat:`api,sampling`,ph:`B`,ts:t,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{sampling_ms:r,output_tokens:c,otps:f}}),A.push({name:`Sampling`,cat:`api,sampling`,ph:`E`,ts:t+r*1e3,pid:n.agentInfo.processId,tid:n.agentInfo.threadId}))}A.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:ee}),j.delete(e)}function Ae(e,t){if(!O)return``;let n=E(),r=w();return j.set(n,{name:`Tool: ${e}`,category:`tool`,startTime:T(),agentInfo:r,args:{tool_name:e,...t}}),A.push({name:`Tool: ${e}`,cat:`tool`,ph:`B`,ts:j.get(n).startTime,pid:r.processId,tid:r.threadId,args:j.get(n).args}),n}function je(e,t){if(!O||!e)return;let n=j.get(e);if(!n)return;let r=T(),i=r-n.startTime,a={...n.args,success:t?.success??!0,error:t?.error,result_tokens:t?.resultTokens,duration_ms:i/1e3};A.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),j.delete(e)}function Me(e){if(!O)return``;let t=E(),n=w();return j.set(t,{name:`Waiting for User Input`,category:`user_input`,startTime:T(),agentInfo:n,args:{context:e}}),A.push({name:`Waiting for User Input`,cat:`user_input`,ph:`B`,ts:j.get(t).startTime,pid:n.processId,tid:n.threadId,args:j.get(t).args}),t}function Ne(e,t){if(!O||!e)return;let n=j.get(e);if(!n)return;let r=T(),i=r-n.startTime,a={...n.args,decision:t?.decision,source:t?.source,duration_ms:i/1e3};A.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),j.delete(e)}function Pe(e){if(!O)return``;let t=E(),n=w();return j.set(t,{name:`Interaction`,category:`interaction`,startTime:T(),agentInfo:n,args:{user_prompt_length:e?.length}}),A.push({name:`Interaction`,cat:`interaction`,ph:`B`,ts:j.get(t).startTime,pid:n.processId,tid:n.threadId,args:j.get(t).args}),t}function Fe(e){if(!O||!e)return;let t=j.get(e);if(!t)return;let n=T(),r=n-t.startTime;A.push({name:t.name,cat:t.category,ph:`E`,ts:n,pid:t.agentInfo.processId,tid:t.agentInfo.threadId,args:{...t.args,duration_ms:r/1e3}}),j.delete(e)}var O,k,A,j,M,N,P,F,I,L,Ie=e((()=>{s(),p(),n(),ee(),ne(),f(),O=!1,k=[],A=[],j=new Map,M=new Map,N=0,P=0,F=0,I=1,L=new Map}));function Le(){H.clear(),U.clear()}function R(){return t(process.env.ENABLE_BETA_TRACING_DETAILED)&&process.env.BETA_TRACING_ENDPOINT&&(process.env.USER_TYPE===`ant`||u())||!1}function z(e,t=Ke){return e.length<=t?{content:e,truncated:!1}:{content:e.slice(0,t)+`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DSxRz_kt.js";import{i as r,l as i,n as a}from"./esm-lWlUmoUA.js";import{A as o,en as s,ht as c,lt as l,z as u}from"./state-ix0xIunV.js";import{C as d,S as f,a as p,l as m,w as h,z as ee}from"./debug-BrXObCdR.js";import{f as g,g as te}from"./config-DiT2Z8dY.js";import{i as ne,t as re}from"./hash-Tu-My5Vp.js";import{Mt as ie,Vt as ae}from"./model-BIVmcl_N.js";import{et as oe,ft as se,rt as ce,ut as le}from"./esm-B62dCLgf.js";import"path";import"fs";import{createHash as ue}from"crypto";import"fs/promises";import{AsyncLocalStorage as de}from"async_hooks";function fe(e){let t=BigInt(58),n=Array(v).fill(_[0]),r=v-1,i=e;for(;i>0n;){let e=Number(i%t);n[r]=_[e],i/=t,r--}return n.join(``)}function pe(e){let t=e.replace(/-/g,``);if(t.length!==32)throw Error(`Invalid UUID hex length: ${t.length}`);return BigInt(`0x`+t)}function me(e,t){let n=pe(t);return`${e}_${he}${fe(n)}`}var _,he,v,ge=e((()=>{_=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,he=`01`,v=22}));function y(e){let n=_e[e],r=process.env[e];return r===void 0?n:t(r)}function b(){let e=g(),t=c(),n={"user.id":e};y(`OTEL_METRICS_INCLUDE_SESSION_ID`)&&(n[`session.id`]=t),y(`OTEL_METRICS_INCLUDE_VERSION`)&&(n[`app.version`]=`0.0.4`);let r=ie();if(r){let e=r.organizationUuid,t=r.emailAddress,i=r.accountUuid;e&&(n[`organization.id`]=e),t&&(n[`user.email`]=t),i&&y(`OTEL_METRICS_INCLUDE_ACCOUNT_UUID`)&&(n[`user.account_uuid`]=i,n[`user.account_id`]=process.env.CLAUDE_CODE_ACCOUNT_TAGGED_ID||me(`user`,i))}return le.terminal&&(n[`terminal.type`]=le.terminal),n}var _e,x=e((()=>{s(),ae(),te(),se(),n(),ge(),_e={OTEL_METRICS_INCLUDE_SESSION_ID:!0,OTEL_METRICS_INCLUDE_VERSION:!1,OTEL_METRICS_INCLUDE_ACCOUNT_UUID:!0}}));function ve(){return t(process.env.OTEL_LOG_USER_PROMPTS)}function ye(e){return ve()?e:`<REDACTED>`}async function S(e,t={}){let n=o();if(!n){C||(C=!0,m(`[3P telemetry] Event dropped (no event logger initialized): ${e}`,{level:`warn`}));return}let r={...b(),"event.name":e,"event.timestamp":new Date().toISOString(),"event.sequence":be++},i=l();i&&(r[`prompt.id`]=i);let a=process.env.CLAUDE_CODE_WORKSPACE_HOST_PATHS;a&&(r[`workspace.host_paths`]=a.split(`|`));for(let[e,n]of Object.entries(t))n!==void 0&&(r[e]=n);n.emit({body:`claude_code.${e}`,attributes:r})}var be,C,xe=e((()=>{s(),p(),n(),x(),be=0,C=!1}));function Se(e){return Math.abs(re(e))||1}function Ce(e){let t=L.get(e);return t===void 0?(I++,L.set(e,I),I):t}function w(){let e=c(),t=`main`,n=M.get(e);if(n)return n;let r={agentId:e,agentName:t,parentAgentId:void 0,processId:1,threadId:Se(t)};return M.set(e,r),N++,r}function T(){return(Date.now()-P)*1e3}function E(){return`span_${++F}`}function we(){let e=process.env.CLAUDE_CODE_PERFETTO_TRACE;m(`[Perfetto] initializePerfettoTracing called, env value: ${e}`)}function Te(e){O&&(k.push({name:`process_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{name:e.agentName}}),k.push({name:`thread_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:e.threadId,args:{name:e.agentName}}),e.parentAgentId&&k.push({name:`parent_agent`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{parent_agent_id:e.parentAgentId}}))}function D(){return O}function Ee(e,t,n){if(!O)return;let r={agentId:e,agentName:t,parentAgentId:n,processId:Ce(e),threadId:Se(t)};M.set(e,r),N++,Te(r)}function De(e){O&&(M.delete(e),L.delete(e))}function Oe(e){if(!O)return``;let t=E(),n=w();return j.set(t,{name:`API Call`,category:`api`,startTime:T(),agentInfo:n,args:{model:e.model,prompt_tokens:e.promptTokens,message_id:e.messageId,is_speculative:e.isSpeculative??!1,query_source:e.querySource}}),A.push({name:`API Call`,cat:`api`,ph:`B`,ts:j.get(t).startTime,pid:n.processId,tid:n.threadId,args:j.get(t).args}),t}function ke(e,t){if(!O||!e)return;let n=j.get(e);if(!n)return;let r=T(),i=r-n.startTime,a=t.promptTokens??n.args.prompt_tokens,o=t.ttftMs,s=t.ttltMs,c=t.outputTokens,l=t.cacheReadTokens,u=o!==void 0&&a!==void 0&&o>0?Math.round(a/(o/1e3)*100)/100:void 0,d=s!==void 0&&o!==void 0?s-o:void 0,f=d!==void 0&&c!==void 0&&d>0?Math.round(c/(d/1e3)*100)/100:void 0,p=l!==void 0&&a!==void 0&&a>0?Math.round(l/a*1e4)/100:void 0,m=t.requestSetupMs,h=t.attemptStartTimes,ee={...n.args,ttft_ms:o,ttlt_ms:s,prompt_tokens:a,output_tokens:c,cache_read_tokens:l,cache_creation_tokens:t.cacheCreationTokens,message_id:t.messageId??n.args.message_id,success:t.success??!0,error:t.error,duration_ms:i/1e3,request_setup_ms:m,itps:u,otps:f,cache_hit_rate_pct:p},g=m!==void 0&&m>0?m*1e3:0;if(g>0){let e=n.startTime+g;if(A.push({name:`Request Setup`,cat:`api,setup`,ph:`B`,ts:n.startTime,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{request_setup_ms:m,attempt_count:h?.length??1}}),h&&h.length>1){let e=h[0];for(let t=0;t<h.length-1;t++){let r=n.startTime+(h[t]-e)*1e3,i=n.startTime+(h[t+1]-e)*1e3;A.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`B`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{attempt:t+1}}),A.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`E`,ts:i,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}}A.push({name:`Request Setup`,cat:`api,setup`,ph:`E`,ts:e,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}if(o!==void 0){let e=n.startTime+g,t=e+o*1e3;A.push({name:`First Token`,cat:`api,ttft`,ph:`B`,ts:e,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{ttft_ms:o,prompt_tokens:a,itps:u,cache_hit_rate_pct:p}}),A.push({name:`First Token`,cat:`api,ttft`,ph:`E`,ts:t,pid:n.agentInfo.processId,tid:n.agentInfo.threadId});let r=s===void 0?void 0:s-o-g/1e3;r!==void 0&&r>0&&(A.push({name:`Sampling`,cat:`api,sampling`,ph:`B`,ts:t,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{sampling_ms:r,output_tokens:c,otps:f}}),A.push({name:`Sampling`,cat:`api,sampling`,ph:`E`,ts:t+r*1e3,pid:n.agentInfo.processId,tid:n.agentInfo.threadId}))}A.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:ee}),j.delete(e)}function Ae(e,t){if(!O)return``;let n=E(),r=w();return j.set(n,{name:`Tool: ${e}`,category:`tool`,startTime:T(),agentInfo:r,args:{tool_name:e,...t}}),A.push({name:`Tool: ${e}`,cat:`tool`,ph:`B`,ts:j.get(n).startTime,pid:r.processId,tid:r.threadId,args:j.get(n).args}),n}function je(e,t){if(!O||!e)return;let n=j.get(e);if(!n)return;let r=T(),i=r-n.startTime,a={...n.args,success:t?.success??!0,error:t?.error,result_tokens:t?.resultTokens,duration_ms:i/1e3};A.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),j.delete(e)}function Me(e){if(!O)return``;let t=E(),n=w();return j.set(t,{name:`Waiting for User Input`,category:`user_input`,startTime:T(),agentInfo:n,args:{context:e}}),A.push({name:`Waiting for User Input`,cat:`user_input`,ph:`B`,ts:j.get(t).startTime,pid:n.processId,tid:n.threadId,args:j.get(t).args}),t}function Ne(e,t){if(!O||!e)return;let n=j.get(e);if(!n)return;let r=T(),i=r-n.startTime,a={...n.args,decision:t?.decision,source:t?.source,duration_ms:i/1e3};A.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),j.delete(e)}function Pe(e){if(!O)return``;let t=E(),n=w();return j.set(t,{name:`Interaction`,category:`interaction`,startTime:T(),agentInfo:n,args:{user_prompt_length:e?.length}}),A.push({name:`Interaction`,cat:`interaction`,ph:`B`,ts:j.get(t).startTime,pid:n.processId,tid:n.threadId,args:j.get(t).args}),t}function Fe(e){if(!O||!e)return;let t=j.get(e);if(!t)return;let n=T(),r=n-t.startTime;A.push({name:t.name,cat:t.category,ph:`E`,ts:n,pid:t.agentInfo.processId,tid:t.agentInfo.threadId,args:{...t.args,duration_ms:r/1e3}}),j.delete(e)}var O,k,A,j,M,N,P,F,I,L,Ie=e((()=>{s(),p(),n(),ee(),ne(),f(),O=!1,k=[],A=[],j=new Map,M=new Map,N=0,P=0,F=0,I=1,L=new Map}));function Le(){H.clear(),U.clear()}function R(){return t(process.env.ENABLE_BETA_TRACING_DETAILED)&&process.env.BETA_TRACING_ENDPOINT&&(process.env.USER_TYPE===`ant`||u())||!1}function z(e,t=Ke){return e.length<=t?{content:e,truncated:!1}:{content:e.slice(0,t)+`
2
2
 
3
3
  [TRUNCATED - Content exceeds 60KB limit]`,truncated:!0}}function B(e){return ue(`sha256`).update(e).digest(`hex`).slice(0,12)}function Re(e){return`sp_${B(e)}`}function ze(e){return`msg_${B(h(e.message.content))}`}function V(e){let t=e.trim().match(qe);return t&&t[1]?t[1].trim():null}function Be(e){let t=[],n=[];for(let r of e){let e=r.message.content;if(typeof e==`string`){let r=V(e);r?n.push(r):t.push(`[USER]\n${e}`)}else if(Array.isArray(e)){for(let r of e)if(r.type===`text`){let e=V(r.text);e?n.push(e):t.push(`[USER]\n${r.text}`)}else if(r.type===`tool_result`){let e=typeof r.content==`string`?r.content:h(r.content),i=V(e);i?n.push(i):t.push(`[TOOL RESULT: ${r.tool_use_id}]\n${e}`)}}}return{contextParts:t,systemReminders:n}}function Ve(e,t){if(!R())return;let{content:n,truncated:r}=z(`[USER PROMPT]\n${t}`);e.setAttributes({new_context:n,...r&&{new_context_truncated:!0,new_context_original_length:t.length}})}function He(e,t,n){if(R()){if(t?.systemPrompt){let n=Re(t.systemPrompt),r=t.systemPrompt.slice(0,500);if(e.setAttribute(`system_prompt_hash`,n),e.setAttribute(`system_prompt_preview`,r),e.setAttribute(`system_prompt_length`,t.systemPrompt.length),!H.has(n)){H.add(n);let{content:e,truncated:r}=z(t.systemPrompt);S(`system_prompt`,{system_prompt_hash:n,system_prompt:e,system_prompt_length:String(t.systemPrompt.length),...r&&{system_prompt_truncated:`true`}})}}if(t?.tools)try{let n=d(t.tools).map(e=>{let t=h(e),n=B(t);return{name:typeof e.name==`string`?e.name:`unknown`,hash:n,json:t}});e.setAttribute(`tools`,h(n.map(({name:e,hash:t})=>({name:e,hash:t})))),e.setAttribute(`tools_count`,n.length);for(let{name:e,hash:t,json:r}of n)if(!H.has(`tool_${t}`)){H.add(`tool_${t}`);let{content:n,truncated:i}=z(r);S(`tool`,{tool_name:ce(e),tool_hash:t,tool:n,...i&&{tool_truncated:`true`}})}}catch{e.setAttribute(`tools_parse_error`,!0)}if(n&&n.length>0&&t?.querySource){let r=t.querySource,i=U.get(r),a=0;if(i)for(let e=0;e<n.length;e++){let t=n[e];if(t&&ze(t)===i){a=e+1;break}}let o=n.slice(a).filter(e=>e.type===`user`);if(o.length>0){let{contextParts:t,systemReminders:i}=Be(o);if(t.length>0){let n=t.join(`
4
4
 
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A as t,E as n,M as r,T as i,n as a,r as o,t as s}from"./lazySchema-DcIJE_0i.js";import{en as c}from"./state-ix0xIunV.js";import{Za as l,zE as u}from"./loadAgentsDir-DrDu5yYy.js";import{z as d}from"./debug-BrXObCdR.js";import{g as f}from"./settings-DfWP5y6X.js";import{g as p}from"./config-DiT2Z8dY.js";import{_ as m,j as h}from"./git-Do0wJvux.js";import{u as g}from"./oauth-BqJqV-2M.js";import{Vt as _,mi as v}from"./model-fi472PRc.js";import"path";import"fs/promises";var y,b=e((()=>{o(),s(),y=a(()=>n({entries:t(r(),r())})),a(()=>n({userId:r(),version:i(),lastModified:r(),checksum:r(),content:y()}))})),x=e((()=>{c(),g(),_(),u(),p(),h(),d(),m(),v(),f(),l(),b()}));export{x as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A as t,E as n,M as r,T as i,n as a,r as o,t as s}from"./lazySchema-DcIJE_0i.js";import{en as c}from"./state-ix0xIunV.js";import{Za as l,zE as u}from"./loadAgentsDir-BURvZNN6.js";import{z as d}from"./debug-BrXObCdR.js";import{g as f}from"./settings-DfWP5y6X.js";import{g as p}from"./config-DiT2Z8dY.js";import{_ as m,j as h}from"./git-Do0wJvux.js";import{u as g}from"./oauth-BqJqV-2M.js";import{Vt as _,mi as v}from"./model-BIVmcl_N.js";import"path";import"fs/promises";var y,b=e((()=>{o(),s(),y=a(()=>n({entries:t(r(),r())})),a(()=>n({userId:r(),version:i(),lastModified:r(),checksum:r(),content:y()}))})),x=e((()=>{c(),g(),_(),u(),p(),h(),d(),m(),v(),f(),l(),b()}));export{x as t};
@@ -1,3 +1,3 @@
1
- import{l as e,o as t,s as n}from"./envUtils-DSxRz_kt.js";import{di as r,ui as i}from"./src-CDCSSo0U2.js";import{$n as a,Zn as ee,en as o,ht as s,ot as c,vr as l,z as u}from"./state-ix0xIunV.js";import{$S as d,Ci as f,Et as p,Gp as m,HC as h,PE as g,Pt as _,Qi as v,St as y,UC as b,Wp as x,bt as te,eC as S,gb as ne,jr as C,mb as w,ob as T,qi as E,sb as D,tC as O,vn as k,yn as A,yt as j,zE as M}from"./loadAgentsDir-DrDu5yYy.js";import{n as N,t as P}from"./cwd-CYmmnQVS.js";import{F,z as I}from"./debug-BrXObCdR.js";import{Jt as L,Zt as R}from"./settings-DfWP5y6X.js";import{c as z,g as B,o as V}from"./config-DiT2Z8dY.js";import{M as H,_ as U,d as W,j as G,n as K,r as re}from"./git-Do0wJvux.js";import{o as q,s as J}from"./log-BMCygSzM.js";import{n as Y,r as X}from"./analytics-BotDBGh0.js";import{i as Z,n as ie}from"./startupProfiler-xa3NmN7Z.js";import{Vt as ae,in as oe}from"./model-fi472PRc.js";import{ft as se,ut as Q}from"./esm-DjGYYlQe.js";import{l as ce,u as le}from"./terminalSetup-BNs9nLbT.js";import{c as ue,n as de}from"./releaseNotes-CDx2P0fb.js";import{s as fe,u as pe}from"./logoV2Utils-CoC4nheD.js";import{c as $,t as me}from"./nativeInstaller-DktvrWRd.js";import{i as he,r as ge}from"./runtimeObserver-XufSllVw.js";import{n as _e,r as ve}from"./sessionMemory-CqRpgwtU.js";import{t as ye}from"./sinks-Cb--pqr-.js";r(),Y(),N(),ue(),x(),o(),v(),ve(),he(),b(),le(),ae(),M(),B(),G(),R(),se(),t(),I(),U(),T(),S(),A(),q(),pe(),me(),ne(),C(),ie(),p();async function be(t,r,o,p,v,b,x,S,ne){H(`info`,`setup_started`);let C=process.version.match(/^v(\d+)\./)?.[1];if((!C||parseInt(C,10)<18)&&(console.error(i.bold.red(`Error: Work Mate requires Node.js version 18 or higher.`)),process.exit(1)),x&&l(h(x)),n(),!u())try{let e=await ce();e.status===`restored`?console.log(i.yellow(`Detected an interrupted Terminal.app setup. Your original settings have been restored. You may need to restart Terminal.app for the changes to take effect.`)):e.status===`failed`&&console.error(i.red(`Failed to restore Terminal.app settings. Please manually restore your original settings with: defaults import com.apple.Terminal ${e.backupPath}.`))}catch(e){J(e)}m(t);let T=Date.now();if(d(),H(`info`,`setup_hooks_captured`,{duration_ms:Date.now()-T}),D(t),p){let e=k(),n=await W();!e&&!n&&(process.stderr.write(i.red(`Error: Can only use --worktree in a git repository, but ${i.bold(t)} is not a git repository. Configure a WorktreeCreate hook in settings.json to use --worktree with other VCS systems.\n`)),process.exit(1));let r=S?`pr-${S}`:v??w(),o;if(n){let e=K(P());e||(process.stderr.write(i.red(`Error: Could not determine the main git repository root.
2
- `)),process.exit(1)),e!==(re(P())??P())&&(H(`info`,`worktree_resolved_to_main_repo`),process.chdir(e),m(e)),o=b?y(e,_(r)):void 0}else o=b?y(P(),_(r)):void 0;let c;try{c=await te(s(),r,o,S?{prNumber:S}:void 0)}catch(e){process.stderr.write(i.red(`Error creating worktree: ${F(e)}\n`)),process.exit(1)}if(X(`tengu_worktree_created`,{tmux_enabled:b}),b&&o){let e=await j(o,c.worktreePath);e.created?console.log(i.green(`Created tmux session: ${i.bold(o)}\nTo attach: ${i.bold(`tmux attach -t ${o}`)}`)):console.error(i.yellow(`Warning: Failed to create tmux session: ${e.error}`))}process.chdir(c.worktreePath),m(c.worktreePath),ee(P()),a(P()),f(c),g(),O()}H(`info`,`setup_background_jobs_starting`),n()||(_e(),ge()),$(),H(`info`,`setup_background_jobs_launched`),Z(`setup_before_prefetch`),H(`info`,`setup_prefetch_starting`);let A=u()&&e(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL)||n();if(A||E(c()),import(`./loadPluginHooks-s7bvGtns.js`).then(e=>{A||(e.loadPluginHooks(),e.setupPluginHookHotReload())}),n()||(process.env.USER_TYPE===`ant`&&import(`./commitAttribution-B7NUPJ8E.js`).then(async e=>{if(await e.isInternalModelRepo()){let{clearSystemPromptSections:e}=await import(`./systemPromptSections-CR_AoPIX.js`);e()}}),setImmediate(()=>{import(`./attributionHooks-CUAoGkU6.js`).then(({registerAttributionHooks:e})=>{e()})}),import(`./sessionFileAccessHooks-DyrZmoA7.js`).then(e=>e.registerSessionFileAccessHooks())),ye(),X(`tengu_started`,{}),oe(u()),Z(`setup_after_prefetch`),!n()){let{hasReleaseNotes:e}=await de(z().lastReleaseNotesSeen);e&&await fe()}if(r===`bypassPermissions`||o){if(process.platform!==`win32`&&typeof process.getuid==`function`&&process.getuid()===0&&process.env.IS_SANDBOX!==`1`&&!e(process.env.CLAUDE_CODE_BUBBLEWRAP))if(process.stdin.isTTY){console.error(i.bold.red(`WARNING: Running as root/sudo with bypass permissions mode is dangerous.`)),console.error(i.yellow(`Bypass mode skips ALL permission checks. Combined with root, any command (rm -rf /, chmod, dd) executes without review.`));let e=(await import(`readline`)).createInterface({input:process.stdin,output:process.stdout}),t=await new Promise(t=>{e.question(`
1
+ import{l as e,o as t,s as n}from"./envUtils-DSxRz_kt.js";import{di as r,ui as i}from"./src-CDCSSo0U2.js";import{$n as a,Zn as ee,en as o,ht as s,ot as c,vr as l,z as u}from"./state-ix0xIunV.js";import{$S as d,Ci as f,Et as p,Gp as m,HC as h,PE as g,Pt as _,Qi as v,St as y,UC as b,Wp as x,bt as te,eC as S,gb as ne,jr as C,mb as w,ob as T,qi as E,sb as D,tC as O,vn as k,yn as A,yt as j,zE as M}from"./loadAgentsDir-BURvZNN6.js";import{n as N,t as P}from"./cwd-CYmmnQVS.js";import{F,z as I}from"./debug-BrXObCdR.js";import{Jt as L,Zt as R}from"./settings-DfWP5y6X.js";import{c as z,g as B,o as V}from"./config-DiT2Z8dY.js";import{M as H,_ as U,d as W,j as G,n as K,r as re}from"./git-Do0wJvux.js";import{o as q,s as J}from"./log-BMCygSzM.js";import{n as Y,r as X}from"./analytics-BotDBGh0.js";import{i as Z,n as ie}from"./startupProfiler-xa3NmN7Z.js";import{Vt as ae,in as oe}from"./model-BIVmcl_N.js";import{ft as se,ut as Q}from"./esm-B62dCLgf.js";import{l as ce,u as le}from"./terminalSetup-BNs9nLbT.js";import{c as ue,n as de}from"./releaseNotes-BKZNuDLD.js";import{s as fe,u as pe}from"./logoV2Utils-DN9nzdX-.js";import{c as $,t as me}from"./nativeInstaller-8arnRiUO.js";import{i as he,r as ge}from"./runtimeObserver-BXbjibFk.js";import{n as _e,r as ve}from"./sessionMemory-CAmpw2yb.js";import{t as ye}from"./sinks-B4_pw0Gb.js";r(),Y(),N(),ue(),x(),o(),v(),ve(),he(),b(),le(),ae(),M(),B(),G(),R(),se(),t(),I(),U(),T(),S(),A(),q(),pe(),me(),ne(),C(),ie(),p();async function be(t,r,o,p,v,b,x,S,ne){H(`info`,`setup_started`);let C=process.version.match(/^v(\d+)\./)?.[1];if((!C||parseInt(C,10)<18)&&(console.error(i.bold.red(`Error: Work Mate requires Node.js version 18 or higher.`)),process.exit(1)),x&&l(h(x)),n(),!u())try{let e=await ce();e.status===`restored`?console.log(i.yellow(`Detected an interrupted Terminal.app setup. Your original settings have been restored. You may need to restart Terminal.app for the changes to take effect.`)):e.status===`failed`&&console.error(i.red(`Failed to restore Terminal.app settings. Please manually restore your original settings with: defaults import com.apple.Terminal ${e.backupPath}.`))}catch(e){J(e)}m(t);let T=Date.now();if(d(),H(`info`,`setup_hooks_captured`,{duration_ms:Date.now()-T}),D(t),p){let e=k(),n=await W();!e&&!n&&(process.stderr.write(i.red(`Error: Can only use --worktree in a git repository, but ${i.bold(t)} is not a git repository. Configure a WorktreeCreate hook in settings.json to use --worktree with other VCS systems.\n`)),process.exit(1));let r=S?`pr-${S}`:v??w(),o;if(n){let e=K(P());e||(process.stderr.write(i.red(`Error: Could not determine the main git repository root.
2
+ `)),process.exit(1)),e!==(re(P())??P())&&(H(`info`,`worktree_resolved_to_main_repo`),process.chdir(e),m(e)),o=b?y(e,_(r)):void 0}else o=b?y(P(),_(r)):void 0;let c;try{c=await te(s(),r,o,S?{prNumber:S}:void 0)}catch(e){process.stderr.write(i.red(`Error creating worktree: ${F(e)}\n`)),process.exit(1)}if(X(`tengu_worktree_created`,{tmux_enabled:b}),b&&o){let e=await j(o,c.worktreePath);e.created?console.log(i.green(`Created tmux session: ${i.bold(o)}\nTo attach: ${i.bold(`tmux attach -t ${o}`)}`)):console.error(i.yellow(`Warning: Failed to create tmux session: ${e.error}`))}process.chdir(c.worktreePath),m(c.worktreePath),ee(P()),a(P()),f(c),g(),O()}H(`info`,`setup_background_jobs_starting`),n()||(_e(),ge()),$(),H(`info`,`setup_background_jobs_launched`),Z(`setup_before_prefetch`),H(`info`,`setup_prefetch_starting`);let A=u()&&e(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL)||n();if(A||E(c()),import(`./loadPluginHooks-C9A9oS-w.js`).then(e=>{A||(e.loadPluginHooks(),e.setupPluginHookHotReload())}),n()||(process.env.USER_TYPE===`ant`&&import(`./commitAttribution-DIT_s0vY.js`).then(async e=>{if(await e.isInternalModelRepo()){let{clearSystemPromptSections:e}=await import(`./systemPromptSections-CR_AoPIX.js`);e()}}),setImmediate(()=>{import(`./attributionHooks-CUAoGkU6.js`).then(({registerAttributionHooks:e})=>{e()})}),import(`./sessionFileAccessHooks-BZvxeufx.js`).then(e=>e.registerSessionFileAccessHooks())),ye(),X(`tengu_started`,{}),oe(u()),Z(`setup_after_prefetch`),!n()){let{hasReleaseNotes:e}=await de(z().lastReleaseNotesSeen);e&&await fe()}if(r===`bypassPermissions`||o){if(process.platform!==`win32`&&typeof process.getuid==`function`&&process.getuid()===0&&process.env.IS_SANDBOX!==`1`&&!e(process.env.CLAUDE_CODE_BUBBLEWRAP))if(process.stdin.isTTY){console.error(i.bold.red(`WARNING: Running as root/sudo with bypass permissions mode is dangerous.`)),console.error(i.yellow(`Bypass mode skips ALL permission checks. Combined with root, any command (rm -rf /, chmod, dd) executes without review.`));let e=(await import(`readline`)).createInterface({input:process.stdin,output:process.stdout}),t=await new Promise(t=>{e.question(`
3
3
  I understand the risks. Continue? [y/N] `,t)});e.close(),t.trim().toLowerCase()!==`y`&&(console.error(`Aborted.`),process.exit(1))}else console.error(`--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons`),process.exit(1);if(process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`claude-desktop`){let[e,t]=await Promise.all([Q.getIsDocker(),L.hasInternetAccess()]),n=Q.getIsBubblewrapSandbox(),r=process.env.IS_SANDBOX===`1`;(!(e||n||r)||t)&&(console.error(`--dangerously-skip-permissions can only be used in Docker/sandbox containers with no internet access but got Docker: ${e}, Bubblewrap: ${n}, IS_SANDBOX: ${r}, hasInternet: ${t}`),process.exit(1))}}let M=V();M.lastCost!==void 0&&M.lastDuration!==void 0&&X(`tengu_exit`,{last_session_cost:M.lastCost,last_session_api_duration:M.lastAPIDuration,last_session_tool_duration:M.lastToolDuration,last_session_duration:M.lastDuration,last_session_lines_added:M.lastLinesAdded,last_session_lines_removed:M.lastLinesRemoved,last_session_total_input_tokens:M.lastTotalInputTokens,last_session_total_output_tokens:M.lastTotalOutputTokens,last_session_total_cache_creation_input_tokens:M.lastTotalCacheCreationInputTokens,last_session_total_cache_read_input_tokens:M.lastTotalCacheReadInputTokens,last_session_fps_average:M.lastFpsAverage,last_session_fps_low_1_pct:M.lastFpsLow1Pct,last_session_id:M.lastSessionId,...M.lastSessionMetrics})}export{be as setup};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{G as t,H as n,K as r,U as i,V as a}from"./loadAgentsDir-DrDu5yYy.js";import{bn as o}from"./prompt-C0nU0VK3.js";function s(e){return e===`projectSettings`||e===`policySettings`||e===`command`}function c(e){return r(e)}function l(e,t,n){let r=c(t.source),i=c(n.source),a=t.ruleValue.toolName;return e===`deny`?`Remove the "${a}" deny rule from ${r}, or remove the specific allow rule from ${i}`:`Remove the "${a}" ask rule from ${r}, or remove the specific allow rule from ${i}`}function u(e,t,n){let{toolName:r,ruleContent:i}=e.ruleValue;if(i===void 0)return{shadowed:!1};let a=t.find(e=>e.ruleValue.toolName===r&&e.ruleValue.ruleContent===void 0);return!a||r===`Bash`&&n.sandboxAutoAllowEnabled&&!s(a.source)?{shadowed:!1}:{shadowed:!0,shadowedBy:a,shadowType:`ask`}}function d(e,t){let{toolName:n,ruleContent:r}=e.ruleValue;if(r===void 0)return{shadowed:!1};let i=t.find(e=>e.ruleValue.toolName===n&&e.ruleValue.ruleContent===void 0);return i?{shadowed:!0,shadowedBy:i,shadowType:`deny`}:{shadowed:!1}}function f(e,t){let r=[],o=a(e),s=n(e),f=i(e);for(let e of o){let n=d(e,f);if(n.shadowed){let t=c(n.shadowedBy.source);r.push({rule:e,reason:`Blocked by "${n.shadowedBy.ruleValue.toolName}" deny rule (from ${t})`,shadowedBy:n.shadowedBy,shadowType:`deny`,fix:l(`deny`,n.shadowedBy,e)});continue}let i=u(e,s,t);if(i.shadowed){let t=c(i.shadowedBy.source);r.push({rule:e,reason:`Shadowed by "${i.shadowedBy.ruleValue.toolName}" ask rule (from ${t})`,shadowedBy:i.shadowedBy,shadowType:`ask`,fix:l(`ask`,i.shadowedBy,e)})}}return r}var p=e((()=>{o(),t()}));export{p as n,f as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{G as t,H as n,K as r,U as i,V as a}from"./loadAgentsDir-BURvZNN6.js";import{bn as o}from"./prompt-DNDgGM9q.js";function s(e){return e===`projectSettings`||e===`policySettings`||e===`command`}function c(e){return r(e)}function l(e,t,n){let r=c(t.source),i=c(n.source),a=t.ruleValue.toolName;return e===`deny`?`Remove the "${a}" deny rule from ${r}, or remove the specific allow rule from ${i}`:`Remove the "${a}" ask rule from ${r}, or remove the specific allow rule from ${i}`}function u(e,t,n){let{toolName:r,ruleContent:i}=e.ruleValue;if(i===void 0)return{shadowed:!1};let a=t.find(e=>e.ruleValue.toolName===r&&e.ruleValue.ruleContent===void 0);return!a||r===`Bash`&&n.sandboxAutoAllowEnabled&&!s(a.source)?{shadowed:!1}:{shadowed:!0,shadowedBy:a,shadowType:`ask`}}function d(e,t){let{toolName:n,ruleContent:r}=e.ruleValue;if(r===void 0)return{shadowed:!1};let i=t.find(e=>e.ruleValue.toolName===n&&e.ruleValue.ruleContent===void 0);return i?{shadowed:!0,shadowedBy:i,shadowType:`deny`}:{shadowed:!1}}function f(e,t){let r=[],o=a(e),s=n(e),f=i(e);for(let e of o){let n=d(e,f);if(n.shadowed){let t=c(n.shadowedBy.source);r.push({rule:e,reason:`Blocked by "${n.shadowedBy.ruleValue.toolName}" deny rule (from ${t})`,shadowedBy:n.shadowedBy,shadowType:`deny`,fix:l(`deny`,n.shadowedBy,e)});continue}let i=u(e,s,t);if(i.shadowed){let t=c(i.shadowedBy.source);r.push({rule:e,reason:`Shadowed by "${i.shadowedBy.ruleValue.toolName}" ask rule (from ${t})`,shadowedBy:i.shadowedBy,shadowType:`ask`,fix:l(`ask`,i.shadowedBy,e)})}}return r}var p=e((()=>{o(),t()}));export{p as n,f as t};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Al as t,Ml as n,So as r,To as i,zo as a}from"./loadAgentsDir-DrDu5yYy.js";import{P as o,U as s}from"./rcDebugLog-2-1XSyFV.js";function c(e){let t=[],n=e.matchAll(d);for(let e of n)e.index!==void 0&&t.push({word:e[0],start:e.index,end:e.index+e[0].length});return t}async function l({question:e,cacheSafeParams:t}){let i=await n({promptMessages:[r({content:`<system-reminder>This is a side question from the user. You must answer this question directly in a single response.
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Al as t,Ml as n,So as r,To as i,zo as a}from"./loadAgentsDir-BURvZNN6.js";import{P as o,U as s}from"./rcDebugLog-DoL1FpGJ.js";function c(e){let t=[],n=e.matchAll(d);for(let e of n)e.index!==void 0&&t.push({word:e[0],start:e.index,end:e.index+e[0].length});return t}async function l({question:e,cacheSafeParams:t}){let i=await n({promptMessages:[r({content:`<system-reminder>This is a side question from the user. You must answer this question directly in a single response.
2
2
 
3
3
  IMPORTANT CONTEXT:
4
4
  - You are a separate, lightweight agent spawned to answer this one question
@@ -1,2 +1,2 @@
1
- import{n as e,t}from"./axios-DaWTGg7G.js";import{en as n,ht as r}from"./state-ix0xIunV.js";import{S as i,a,at as o,d as s,l as c,nt as l,ot as u,p as d,rt as f,w as p}from"./debug-BrXObCdR.js";import{o as m,r as h,t as g,v as _,y as v}from"./log-BMCygSzM.js";import{a as y,n as b,t as x}from"./analytics-BotDBGh0.js";import{a as S,n as C,o as w}from"./firstPartyEventLogger-CQdJn3LV.js";import{r as T,t as E}from"./datadog-D9rlcN12.js";import{dirname as D,join as O}from"path";t(),n(),u(),v(),l(),a(),d(),m(),i();var k=h(new Date);function A(){return O(_.errors(),k+`.jsonl`)}function j(e){return O(_.mcpLogs(e),k+`.jsonl`)}function M(e){let t=o(e);return{write(e){t.write(p(e)+`
2
- `)},flush:t.flush,dispose:t.dispose}}var N=new Map;function P(e){let t=N.get(e);if(!t){let n=D(e);t=M({writeFn:t=>{try{s().appendFileSync(e,t)}catch{s().mkdirSync(n),s().appendFileSync(e,t)}},flushIntervalMs:1e3,maxBufferSize:50}),N.set(e,t),f(async()=>t?.dispose())}return t}function F(e,t){if(process.env.USER_TYPE!==`ant`)return;let n={timestamp:new Date().toISOString(),...t,cwd:s().cwd(),userType:process.env.USER_TYPE,sessionId:r(),version:`0.0.3`};P(e).write(n)}function I(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e;if(typeof t.message==`string`)return t.message;if(typeof t.error==`object`&&t.error&&`message`in t.error&&typeof t.error.message==`string`)return t.error.message}}function L(t){let n=t.stack||t.message,r=``;if(e.isAxiosError(t)&&t.config?.url){let e=[`url=${t.config.url}`];t.response?.status!==void 0&&e.push(`status=${t.response.status}`);let n=I(t.response?.data);n&&e.push(`body=${n}`),r=`[${e.join(`,`)}] `}c(`${t.name}: ${r}${n}`,{level:`error`}),F(A(),{error:`${r}${n}`})}function R(e,t){c(`MCP server "${e}" ${t}`,{level:`error`});let n=j(e),i={error:t instanceof Error?t.stack||t.message:String(t),timestamp:new Date().toISOString(),sessionId:r(),cwd:s().cwd()};P(n).write(i)}function z(e,t){c(`MCP server "${e}": ${t}`);let n=j(e),i={debug:t,timestamp:new Date().toISOString(),sessionId:r(),cwd:s().cwd()};P(n).write(i)}function B(){g({logError:L,logMCPError:R,logMCPDebug:z,getErrorsPath:A,getMCPLogsPath:j}),c(`Error log sink initialized`)}E(),C(),b();function V(){return!1}function H(e,t){let n=w(e);if(n===0)return;let r=n===null?t:{...t,sample_rate:n};V()&&T(e,y(r)),S(e,r)}function U(e,t){return H(e,t),Promise.resolve()}function W(){x({logEvent:H,logEventAsync:U})}function G(){B(),W()}export{G as t};
1
+ import{n as e,t}from"./axios-DaWTGg7G.js";import{en as n,ht as r}from"./state-ix0xIunV.js";import{S as i,a,at as o,d as s,l as c,nt as l,ot as u,p as d,rt as f,w as p}from"./debug-BrXObCdR.js";import{o as m,r as h,t as g,v as _,y as v}from"./log-BMCygSzM.js";import{a as y,n as b,t as x}from"./analytics-BotDBGh0.js";import{a as S,n as C,o as w}from"./firstPartyEventLogger-CuUiNdj8.js";import{r as T,t as E}from"./datadog-Ed8emSFA.js";import{dirname as D,join as O}from"path";t(),n(),u(),v(),l(),a(),d(),m(),i();var k=h(new Date);function A(){return O(_.errors(),k+`.jsonl`)}function j(e){return O(_.mcpLogs(e),k+`.jsonl`)}function M(e){let t=o(e);return{write(e){t.write(p(e)+`
2
+ `)},flush:t.flush,dispose:t.dispose}}var N=new Map;function P(e){let t=N.get(e);if(!t){let n=D(e);t=M({writeFn:t=>{try{s().appendFileSync(e,t)}catch{s().mkdirSync(n),s().appendFileSync(e,t)}},flushIntervalMs:1e3,maxBufferSize:50}),N.set(e,t),f(async()=>t?.dispose())}return t}function F(e,t){if(process.env.USER_TYPE!==`ant`)return;let n={timestamp:new Date().toISOString(),...t,cwd:s().cwd(),userType:process.env.USER_TYPE,sessionId:r(),version:`0.0.4`};P(e).write(n)}function I(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e;if(typeof t.message==`string`)return t.message;if(typeof t.error==`object`&&t.error&&`message`in t.error&&typeof t.error.message==`string`)return t.error.message}}function L(t){let n=t.stack||t.message,r=``;if(e.isAxiosError(t)&&t.config?.url){let e=[`url=${t.config.url}`];t.response?.status!==void 0&&e.push(`status=${t.response.status}`);let n=I(t.response?.data);n&&e.push(`body=${n}`),r=`[${e.join(`,`)}] `}c(`${t.name}: ${r}${n}`,{level:`error`}),F(A(),{error:`${r}${n}`})}function R(e,t){c(`MCP server "${e}" ${t}`,{level:`error`});let n=j(e),i={error:t instanceof Error?t.stack||t.message:String(t),timestamp:new Date().toISOString(),sessionId:r(),cwd:s().cwd()};P(n).write(i)}function z(e,t){c(`MCP server "${e}": ${t}`);let n=j(e),i={debug:t,timestamp:new Date().toISOString(),sessionId:r(),cwd:s().cwd()};P(n).write(i)}function B(){g({logError:L,logMCPError:R,logMCPDebug:z,getErrorsPath:A,getMCPLogsPath:j}),c(`Error log sink initialized`)}E(),C(),b();function V(){return!1}function H(e,t){let n=w(e);if(n===0)return;let r=n===null?t:{...t,sample_rate:n};V()&&T(e,y(r)),S(e,r)}function U(e,t){return H(e,t),Promise.resolve()}function W(){x({logEvent:H,logEventAsync:U})}function G(){B(),W()}export{G as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./sinks-B4_pw0Gb.js";export{e as initSinks};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{c as r,d as i,f as a}from"./skillGenerator-CwXUfM4Y.js";import{d as o,g as s,h as c,l,m as u,p as d,x as f}from"./runtimeObserver-XufSllVw.js";import{o as p,r as m}from"./observationStore-DzCdXq8U.js";import{o as h,s as g}from"./projectContext-D9MDwJUF.js";import{t as _}from"./sessionObserver-B_09FQKV.js";import{i as v,r as y}from"./skillGapStore-75ZYlfwi.js";import{t as b}from"./skillLearning-CB-5fdMl.js";import{join as x}from"node:path";function S(e,t){let n=e.find(e=>e.startsWith(`${t}=`));if(n)return n.slice(t.length+1)||void 0;let r=e.indexOf(t);if(r>=0&&e[r+1]&&!e[r+1].startsWith(`--`))return e[r+1]}function C(e,t,n){let r=S(e,t);if(r===void 0)return n;let i=Number(r);return Number.isFinite(i)?i:n}var w;e((()=>{n(),b(),w=async e=>{let n=e.trim().split(/\s+/).filter(Boolean),b=n[0]??`status`,w=g(process.cwd()),T=process.env.CLAUDE_SKILL_LEARNING_HOME,E={project:w,rootDir:T};switch(b){case`status`:{let[e,t]=await Promise.all([p(E),d(E)]);return{type:`text`,value:[`Skill Learning status for ${w.projectName} (${w.projectId})`,`Observations: ${e.length}`,`Instincts: ${t.length}`].join(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{c as r,d as i,f as a}from"./skillGenerator-DaNb-yKH.js";import{d as o,g as s,h as c,l,m as u,p as d,x as f}from"./runtimeObserver-BXbjibFk.js";import{o as p,r as m}from"./observationStore-DzCdXq8U.js";import{o as h,s as g}from"./projectContext-D9MDwJUF.js";import{t as _}from"./sessionObserver-Ur7PqKl_.js";import{i as v,r as y}from"./skillGapStore-z3LP64O-.js";import{t as b}from"./skillLearning-rMX1bSBa.js";import{join as x}from"node:path";function S(e,t){let n=e.find(e=>e.startsWith(`${t}=`));if(n)return n.slice(t.length+1)||void 0;let r=e.indexOf(t);if(r>=0&&e[r+1]&&!e[r+1].startsWith(`--`))return e[r+1]}function C(e,t,n){let r=S(e,t);if(r===void 0)return n;let i=Number(r);return Number.isFinite(i)?i:n}var w;e((()=>{n(),b(),w=async e=>{let n=e.trim().split(/\s+/).filter(Boolean),b=n[0]??`status`,w=g(process.cwd()),T=process.env.CLAUDE_SKILL_LEARNING_HOME,E={project:w,rootDir:T};switch(b){case`status`:{let[e,t]=await Promise.all([p(E),d(E)]);return{type:`text`,value:[`Skill Learning status for ${w.projectName} (${w.projectId})`,`Observations: ${e.length}`,`Instincts: ${t.length}`].join(`
2
2
  `)}}case`ingest`:{let e=n[1];if(!e)return{type:`text`,value:`Usage: /skill-learning ingest <transcript.jsonl> [--min-session-length=<n>]`};let t=C(n,`--min-session-length`,10),r=await m(e,E);if(r.length<t)return{type:`text`,value:`Session too short for learning (${r.length} < min=${t}). Skipping instinct extraction.`};let i=_(r),a=[];for(let e of i)a.push(await s(e,E));return{type:`text`,value:`Ingested ${r.length} observations and saved ${a.length} instincts.`}}case`evolve`:{let e=n.includes(`--generate`),o=f(await d(E),{cwd:process.cwd()}),s=[];if(e)for(let e of o){let n=a(e,await i(e,[x(process.cwd(),`.claude`,`skills`),x(t(),`skills`)])),o=await r(n);s.push(`${n.type}: ${o.activePath??o.archivedPath??o.deletedPath??`no active write`}`)}return{type:`text`,value:e?`Generated ${s.length} learned skill(s):\n${s.join(`
3
3
  `)}`:`Found ${o.length} skill candidate(s). Use --generate to write them.`}}case`export`:{let e=n[1]??`skill-learning-instincts.json`,t=S(n,`--scope`),r=C(n,`--min-conf`,void 0),i=S(n,`--domain`),a=e=>e.filter(e=>!(t&&e.scope!==t||r!==void 0&&e.confidence<r||i&&e.domain!==i)),s=await d(E),c=a(s);if(c.length!==s.length){await o(e,E);let{writeFile:t}=await import(`node:fs/promises`);await t(e,`${JSON.stringify(c,null,2)}\n`)}else await o(e,E);let l=[`Exported ${c.length} instincts to ${e}`];if(t||r!==void 0||i){let e=[];t&&e.push(`scope=${t}`),r!==void 0&&e.push(`min-conf=${r}`),i&&e.push(`domain=${i}`),l.push(`(filters: ${e.join(`, `)})`)}return{type:`text`,value:l.join(` `)}}case`import`:{let e=n[1];if(!e)return{type:`text`,value:`Usage: /skill-learning import <instincts.json> [--scope=<scope>] [--min-conf=<n>] [--domain=<d>] [--dry-run]`};let t=S(n,`--scope`),r=C(n,`--min-conf`,void 0),i=S(n,`--domain`),a=n.includes(`--dry-run`),{readFile:o}=await import(`node:fs/promises`),c=JSON.parse(await o(e,`utf8`)),l=c.filter(e=>!(t&&e.scope!==t||r!==void 0&&e.confidence<r||i&&e.domain!==i));if(a)return{type:`text`,value:`Dry run: would import ${l.length}/${c.length} instincts.`};for(let e of l)await s(e,E);return{type:`text`,value:`Imported ${l.length}/${c.length} instincts.`}}case`prune`:{let e=n.indexOf(`--max-age`);return{type:`text`,value:`Pruned ${(await u(e>=0&&n[e+1]?Number(n[e+1]):30,E)).length} pending instincts.`}}case`promote`:{let e=n[1];if(!e){let e=await v(w,T),t=l(await d(E));return{type:`text`,value:[`Promotion candidates for ${w.projectName} (${w.projectId}):`,`Pending gaps: ${e.filter(e=>e.status===`pending`).length}`,`Global-eligible instincts (>=2 projects, avg confidence >=0.8): ${t.length}`,``,`Usage:`,` /skill-learning promote gap <gap-key> # pending gap -> draft`,` /skill-learning promote instinct <instinct-id> # project instinct -> global`].join(`
4
4
  `)}}if(e===`gap`){let e=n[2];if(!e)return{type:`text`,value:`Usage: /skill-learning promote gap <gap-key>`};let t=await y(e,w,T);return t?{type:`text`,value:`Promoted gap ${e} to status=${t.status} (draft=${t.draft?.skillPath??`none`}).`}:{type:`text`,value:`No gap found for key "${e}".`}}if(e===`instinct`){let e=n[2];if(!e)return{type:`text`,value:`Usage: /skill-learning promote instinct <instinct-id>`};let t=(await d(E)).find(t=>t.id===e);return t?t.scope===`global`?{type:`text`,value:`Instinct ${e} is already global.`}:(await c({...t,scope:`global`},{scope:`global`,rootDir:T}),{type:`text`,value:`Promoted instinct ${e} to global scope.`}):{type:`text`,value:`No project-scoped instinct found for id "${e}".`}}return{type:`text`,value:`Usage: /skill-learning promote [gap <gap-key>|instinct <instinct-id>]`}}case`projects`:{let e=h();if(e.length===0)return{type:`text`,value:`No known project scopes yet.`};let t=[`Known project scopes:`];for(let n of e){let e={project:n,rootDir:T},[r,i]=await Promise.all([d(e),p(e)]);t.push(`- ${n.projectName} (${n.projectId}) — instincts: ${r.length}, observations: ${i.length}, lastSeen: ${n.lastSeenAt}`)}return{type:`text`,value:t.join(`
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Sr as t,Un as n,Wn as r,X as i,Zn as a,en as o,h as s,ht as c,vr as ee,xr as l}from"./state-ix0xIunV.js";import{Ac as te,Bi as ne,CC as re,Ci as u,Cp as ie,Ct as d,DD as ae,Db as oe,Dp as se,ED as f,Ep as ce,Et as le,Gp as p,HC as ue,Il as de,It as fe,Jn as pe,MC as me,Mt as m,NC as he,PE as h,Qi as ge,SC as _e,Tp as g,UC as ve,Vi as ye,Vl as be,Wp as _,bi as v,fi as y,gb as b,gn as x,hb as S,jr as C,kb as w,kc as T,nd as E,op as D,pi as O,rd as k,sp as A,ti as j,yn as M,zE as N}from"./loadAgentsDir-DrDu5yYy.js";import{n as xe,t as P}from"./cwd-CYmmnQVS.js";import{a as F,d as Se,l as I,nt as Ce,p as we,rt as Te}from"./debug-BrXObCdR.js";import{n as Ee,r as L}from"./analytics-BotDBGh0.js";import{C as De,_ as Oe}from"./model-fi472PRc.js";import{Nt as ke}from"./prompt-C0nU0VK3.js";import{f as Ae,l as je,t as Me}from"./commitAttribution-Bmzgtqc6.js";import{n as R,r as Ne}from"./systemPromptSections-DN0HGVye.js";import{r as Pe}from"./asciicast-CbAjUHT_.js";import*as z from"path";import{dirname as Fe}from"path";o(),Ne(),D(),ke(),ve(),N(),je(),de(),xe(),F(),w(),Oe(),b(),_(),C(),me(),re(),le();function Ie(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.type!==`assistant`)continue;let r=n.message.content.find(e=>e.type===`tool_use`&&e.name===`TodoWrite`);if(!r||r.type!==`tool_use`)continue;let i=r.input;if(typeof i!=`object`||!i)return[];let a=_e().safeParse(i.todos);return a.success?a.data:[]}return[]}function Le(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&oe(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),e.attributionSnapshots&&e.attributionSnapshots.length>0&&Me(e.attributionSnapshots,e=>{t(t=>({...t,attribution:e}))}),!he()&&e.messages&&e.messages.length>0){let n=Ie(e.messages);if(n.length>0){let e=c();t(t=>({...t,todos:{...t.todos,[e]:n}}))}}}function Re(e){if(e.attributionSnapshots&&e.attributionSnapshots.length>0)return Ae(e.attributionSnapshots)}function B(e,t){if(!(!e&&!t))return{name:e??``,color:t==="default"?void 0:t}}function V(e,t,a){if(t)return{agentDefinition:t,agentType:void 0};if(!e)return r(void 0),{agentDefinition:void 0,agentType:void 0};let o=a.activeAgents.find(t=>t.agentType===e);return o?(r(o.agentType),!i()&&o.model&&o.model!==`inherit`&&n(De(o.model)),{agentDefinition:o,agentType:o.agentType}):(I(`Resumed session had agent "${e}" but it is no longer available. Using default behavior.`),r(void 0),{agentDefinition:void 0,agentType:void 0})}function H(e){let t=d();if(t){u(t);return}if(e){try{process.chdir(e.worktreePath)}catch{u(null);return}p(e.worktreePath),a(P()),m(e),h(),R(),S.cache.clear?.()}}function ze(){let e=d();if(e){m(null),h(),R(),S.cache.clear?.();try{process.chdir(e.originalCwd)}catch{return}p(e.originalCwd),a(P())}}async function Be(t,n,r){if(n.forkSession)t.contentReplacements?.length&&await j(t.contentReplacements);else{let e=n.sessionIdOverride??t.sessionId;e&&(ee(ue(e),n.transcriptPath?Fe(n.transcriptPath):null),await Pe(),await y(),A(e))}if(O(n.forkSession?{...t,worktreeSession:void 0}:t),t.goal){let{hydrateGoalFromTranscript:r}=(k(),e(E)),i=new Map,a=n.sessionIdOverride??t.sessionId??c();i.set(a,t.goal),r(i,a)}n.forkSession||(H(t.worktreeSession),pe());let{agentDefinition:i,agentType:a}=V(t.agentSetting,r.mainThreadAgentDefinition,r.agentDefinitions);v(`normal`);let o=n.includeAttribution?Re(t):void 0,s=B(t.agentName,t.agentColor);be(t.agentName);let l=r.agentDefinitions;return{messages:t.messages,fileHistorySnapshots:t.fileHistorySnapshots,contentReplacements:t.contentReplacements,agentName:t.agentName,agentColor:t.agentColor==="default"?void 0:t.agentColor,restoredAgentDef:i,initialState:{...r.initialState,...a&&{agent:a},...o&&{attribution:o},...s&&{standaloneAgentContext:s},agentDefinitions:l}}}ae(),o(),ge(),Ee(),ce(),T(),Ce(),F(),we(),M(),t();var Ve=1e3,He=500,Ue=300,We=2e3,Ge=typeof Bun<`u`,U=null,W=null,G=new Set,K=!1,q=!1,J=!1,Y=null,X=l(),Z=null;async function Ke(){if(K||q)return;K=!0,J||(J=!0,se(()=>{ne(),X.emit()}));let e=await Je();e.length!==0&&(I(`Watching for changes in skill/command directories: ${e.join(`, `)}...`),U=f.watch(e,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:Z?.stabilityThreshold??Ve,pollInterval:Z?.pollInterval??He},ignored:(e,t)=>t&&!t.isFile()&&!t.isDirectory()?!0:e.split(z.sep).some(e=>e===`.git`),ignorePermissionErrors:!0,usePolling:Ge,interval:Z?.chokidarInterval??We,atomic:!0}),U.on(`add`,$),U.on(`change`,$),U.on(`unlink`,$),Y=Te(async()=>{await Q()}))}function Q(){q=!0,Y&&(Y(),Y=null);let e=Promise.resolve();return U&&(e=U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),e}var qe=X.subscribe;async function Je(){let e=Se(),t=[],n=g(`userSettings`,`skills`);if(n)try{await e.stat(n),t.push(n)}catch{}let r=g(`userSettings`,`commands`);if(r)try{await e.stat(r),t.push(r)}catch{}let i=g(`projectSettings`,`skills`);if(i)try{let n=z.resolve(i);await e.stat(n),t.push(n)}catch{}let a=g(`projectSettings`,`commands`);if(a)try{let n=z.resolve(a);await e.stat(n),t.push(n)}catch{}for(let n of s()){let r=z.join(n,`.claude`,`skills`);try{await e.stat(r),t.push(r)}catch{}}return t}function $(e){I(`Detected skill change: ${e}`),L(`tengu_skill_file_changed`,{source:`chokidar`}),Ye(e)}function Ye(e){G.add(e),W&&clearTimeout(W),W=setTimeout(async()=>{W=null;let e=[...G];if(G.clear(),x(await fe(`skills`,e[0]))){I(`ConfigChange hook blocked skill reload (${e.length} paths)`);return}ie(),ye(),te(),X.emit()},Z?.reloadDebounce??Ue)}async function Xe(e){U&&(await U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),K=!1,q=!1,Z=e??null}var Ze={initialize:Ke,dispose:Q,subscribe:qe,resetForTesting:Xe};export{V as a,Be as i,B as n,Le as o,ze as r,H as s,Ze as t};
1
+ import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Sr as t,Un as n,Wn as r,X as i,Zn as a,en as o,h as s,ht as c,vr as ee,xr as l}from"./state-ix0xIunV.js";import{Ac as te,Bi as ne,CC as re,Ci as u,Cp as ie,Ct as d,DD as ae,Db as oe,Dp as se,ED as f,Ep as ce,Et as le,Gp as p,HC as ue,Il as de,It as fe,Jn as pe,MC as me,Mt as m,NC as he,PE as h,Qi as ge,SC as _e,Tp as g,UC as ve,Vi as ye,Vl as be,Wp as _,bi as v,fi as y,gb as b,gn as x,hb as S,jr as C,kb as w,kc as T,nd as E,op as D,pi as O,rd as k,sp as A,ti as j,yn as M,zE as N}from"./loadAgentsDir-BURvZNN6.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-BIVmcl_N.js";import{Nt as ke}from"./prompt-DNDgGM9q.js";import{f as Ae,l as je,t as Me}from"./commitAttribution-CLbEIaRJ.js";import{n as R,r as Ne}from"./systemPromptSections-DN0HGVye.js";import{r as Pe}from"./asciicast-CbAjUHT_.js";import*as z from"path";import{dirname as Fe}from"path";o(),Ne(),D(),ke(),ve(),N(),je(),de(),xe(),F(),w(),Oe(),b(),_(),C(),me(),re(),le();function Ie(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.type!==`assistant`)continue;let r=n.message.content.find(e=>e.type===`tool_use`&&e.name===`TodoWrite`);if(!r||r.type!==`tool_use`)continue;let i=r.input;if(typeof i!=`object`||!i)return[];let a=_e().safeParse(i.todos);return a.success?a.data:[]}return[]}function Le(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&oe(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),e.attributionSnapshots&&e.attributionSnapshots.length>0&&Me(e.attributionSnapshots,e=>{t(t=>({...t,attribution:e}))}),!he()&&e.messages&&e.messages.length>0){let n=Ie(e.messages);if(n.length>0){let e=c();t(t=>({...t,todos:{...t.todos,[e]:n}}))}}}function Re(e){if(e.attributionSnapshots&&e.attributionSnapshots.length>0)return Ae(e.attributionSnapshots)}function B(e,t){if(!(!e&&!t))return{name:e??``,color:t==="default"?void 0:t}}function V(e,t,a){if(t)return{agentDefinition:t,agentType:void 0};if(!e)return r(void 0),{agentDefinition:void 0,agentType:void 0};let o=a.activeAgents.find(t=>t.agentType===e);return o?(r(o.agentType),!i()&&o.model&&o.model!==`inherit`&&n(De(o.model)),{agentDefinition:o,agentType:o.agentType}):(I(`Resumed session had agent "${e}" but it is no longer available. Using default behavior.`),r(void 0),{agentDefinition:void 0,agentType:void 0})}function H(e){let t=d();if(t){u(t);return}if(e){try{process.chdir(e.worktreePath)}catch{u(null);return}p(e.worktreePath),a(P()),m(e),h(),R(),S.cache.clear?.()}}function ze(){let e=d();if(e){m(null),h(),R(),S.cache.clear?.();try{process.chdir(e.originalCwd)}catch{return}p(e.originalCwd),a(P())}}async function Be(t,n,r){if(n.forkSession)t.contentReplacements?.length&&await j(t.contentReplacements);else{let e=n.sessionIdOverride??t.sessionId;e&&(ee(ue(e),n.transcriptPath?Fe(n.transcriptPath):null),await Pe(),await y(),A(e))}if(O(n.forkSession?{...t,worktreeSession:void 0}:t),t.goal){let{hydrateGoalFromTranscript:r}=(k(),e(E)),i=new Map,a=n.sessionIdOverride??t.sessionId??c();i.set(a,t.goal),r(i,a)}n.forkSession||(H(t.worktreeSession),pe());let{agentDefinition:i,agentType:a}=V(t.agentSetting,r.mainThreadAgentDefinition,r.agentDefinitions);v(`normal`);let o=n.includeAttribution?Re(t):void 0,s=B(t.agentName,t.agentColor);be(t.agentName);let l=r.agentDefinitions;return{messages:t.messages,fileHistorySnapshots:t.fileHistorySnapshots,contentReplacements:t.contentReplacements,agentName:t.agentName,agentColor:t.agentColor==="default"?void 0:t.agentColor,restoredAgentDef:i,initialState:{...r.initialState,...a&&{agent:a},...o&&{attribution:o},...s&&{standaloneAgentContext:s},agentDefinitions:l}}}ae(),o(),ge(),Ee(),ce(),T(),Ce(),F(),we(),M(),t();var Ve=1e3,He=500,Ue=300,We=2e3,Ge=typeof Bun<`u`,U=null,W=null,G=new Set,K=!1,q=!1,J=!1,Y=null,X=l(),Z=null;async function Ke(){if(K||q)return;K=!0,J||(J=!0,se(()=>{ne(),X.emit()}));let e=await Je();e.length!==0&&(I(`Watching for changes in skill/command directories: ${e.join(`, `)}...`),U=f.watch(e,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:Z?.stabilityThreshold??Ve,pollInterval:Z?.pollInterval??He},ignored:(e,t)=>t&&!t.isFile()&&!t.isDirectory()?!0:e.split(z.sep).some(e=>e===`.git`),ignorePermissionErrors:!0,usePolling:Ge,interval:Z?.chokidarInterval??We,atomic:!0}),U.on(`add`,$),U.on(`change`,$),U.on(`unlink`,$),Y=Te(async()=>{await Q()}))}function Q(){q=!0,Y&&(Y(),Y=null);let e=Promise.resolve();return U&&(e=U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),e}var qe=X.subscribe;async function Je(){let e=Se(),t=[],n=g(`userSettings`,`skills`);if(n)try{await e.stat(n),t.push(n)}catch{}let r=g(`userSettings`,`commands`);if(r)try{await e.stat(r),t.push(r)}catch{}let i=g(`projectSettings`,`skills`);if(i)try{let n=z.resolve(i);await e.stat(n),t.push(n)}catch{}let a=g(`projectSettings`,`commands`);if(a)try{let n=z.resolve(a);await e.stat(n),t.push(n)}catch{}for(let n of s()){let r=z.join(n,`.claude`,`skills`);try{await e.stat(r),t.push(r)}catch{}}return t}function $(e){I(`Detected skill change: ${e}`),L(`tengu_skill_file_changed`,{source:`chokidar`}),Ye(e)}function Ye(e){G.add(e),W&&clearTimeout(W),W=setTimeout(async()=>{W=null;let e=[...G];if(G.clear(),x(await fe(`skills`,e[0]))){I(`ConfigChange hook blocked skill reload (${e.length} paths)`);return}ie(),ye(),te(),X.emit()},Z?.reloadDebounce??Ue)}async function Xe(e){U&&(await U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),K=!1,q=!1,Z=e??null}var Ze={initialize:Ke,dispose:Q,subscribe:qe,resetForTesting:Xe};export{V as a,Be as i,B as n,Le as o,ze as r,H as s,Ze as t};
@@ -1 +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-75ZYlfwi.js";i();export{c as findGapKeyByDraftPath,o as promoteGapToDraft,n as readSkillGaps,e as recordDraftHit,a as recordSkillGap,s as rejectSkillGap,t as shouldPromoteToActive,r as shouldPromoteToDraft};
1
+ 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,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-CwXUfM4Y.js";import{a as o,n as s,s as c}from"./projectContext-D9MDwJUF.js";import{dirname as l,join as u}from"node:path";import{existsSync as d}from"node:fs";import{createHash as f}from"node:crypto";import{mkdir as p,readFile as m,rename as h,writeFile as g}from"node:fs/promises";async function _(e){let t=e.prompt.trim();if(!t)throw Error(`Cannot record an empty skill gap`);let n=e.project??c(e.cwd),r=await A(n,e.rootDir),i=F(t),a=new Date().toISOString(),o=r.gaps[i],s={key:i,prompt:t,count:(o?.count??0)+1,draftHits:o?.draftHits??0,draftHitSessions:o?.draftHitSessions??[],status:o?.status??`pending`,sessionId:e.sessionId??`unknown-session`,cwd:e.cwd??n.cwd,projectId:n.projectId,projectName:n.projectName,recommendations:(e.recommendations??[]).slice(0,5).map(e=>({name:e.name,description:e.description,score:e.score})),createdAt:o?.createdAt??a,updatedAt:a,draft:o?.draft,active:o?.active};return s.status===`rejected`?(r.gaps[i]=s,await N(n,r,e.rootDir),s):(!s.draft&&C(s)&&(s.draft=await T(s,n),s.status=`draft`,await z()),s.draft&&!s.active&&w(s)&&(s.active=await E(s,n),s.status=`active`,await z()),r.gaps[i]=s,await N(n,r,e.rootDir),s)}async function v(e=c(),t){let n=await A(e,t);return Object.values(n.gaps).sort((e,t)=>e.key.localeCompare(t.key))}async function y(e,t=c(),n){let r=await A(t,n);for(let t of Object.values(r.gaps))if(t.draft?.skillPath===e)return t.key}async function b(e,t=c(),n,r=`unknown-session`){let i=await A(t,n),a=i.gaps[e];if(!a||!a.draft||a.active)return a;let o=a.draftHitSessions??[];if(o.includes(r))return a;let s=new Date().toISOString(),l={...a,draftHits:a.draftHits+1,draftHitSessions:[...o,r],updatedAt:s};return w(l)&&(l.active=await E(l,t),l.status=`active`,await z()),i.gaps[e]=l,await N(t,i,n),l}async function x(e,t=c(),n){let r=await A(t,n),i=r.gaps[e];if(!i)return;if(i.status===`rejected`||i.draft)return i;let a={...i,draft:await T(i,t),status:`draft`,updatedAt:new Date().toISOString()};return r.gaps[e]=a,await N(t,r,n),await z(),a}async function S(e,t=c(),n){let r=await A(t,n),i=r.gaps[e];if(!i)return;let a={...i,status:`rejected`,updatedAt:new Date().toISOString()};return r.gaps[e]=a,await N(t,r,n),a}function C(e){return e.count>=B}function w(e){return e.draft?e.count>=V||e.draftHits>=H:!1}async function T(e,t){let n=D(e,`pending`),i=u(t.projectRoot??t.cwd,`.claude`,`skills`,`.drafts`),o=r([n],{cwd:t.projectRoot??t.cwd,outputRoot:i,scope:`project`,name:`draft-${I(e.prompt)}`,description:`Draft learned skill candidate. Promote after repeated evidence or explicit user correction.`}),s=u(o.outputPath,`SKILL.md`);return d(s)||await a({...o,content:o.content+`
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+`
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-D7l3P1k9.js`);e()}catch{}}var B,V,H,U=e((()=>{t(),o(),i(),B=2,V=4,H=2}));export{b as a,w as c,v as i,C as l,U as n,_ as o,x as r,S as s,y as t};
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};
@@ -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-_bQhk9W6.js";import{l as a,u as o}from"./instinctParser-Dt-lqnDe.js";import{basename as s,dirname as c,join as l}from"node:path";import{existsSync as u}from"node:fs";import{mkdir as d,readFile as f,readdir as p,rename as ee,rm as m,writeFile as h}from"node:fs/promises";function g(e){return e.length!==0&&e.reduce((e,t)=>e+t.confidence,0)/e.length>=a().minConfidence}function _(e){let t=e[0]?.domain??`project`,n=b[t],r=new Set;for(let t of e){for(let e of`${t.trigger} ${t.action}`.toLowerCase().split(/[^a-z0-9]+/))if(te(e)&&r.add(e),r.size>=5)break;if(r.size>=5)break}let i=v([n,...r].join(`-`));return y(i)?`${n}-learned-pattern`:i}function v(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,64).replace(/-$/g,``)||`learned-skill`}function y(e){return x.has(e)}function te(e){return e.length>2&&![`when`,`with`,`this`,`that`,`user`,`project`,`prefer`,`avoid`,`use`,`using`,`the`,`and`,`for`].includes(e)}var b,x,S=e((()=>{o(),b={workflow:`workflow`,testing:`testing`,debugging:`debugging`,"code-style":`style`,security:`security`,git:`git`,project:`project`},x=new Set([`learned-skill`,`better-skill`,`new-skill`,`project-skill`,`workflow-skill`])}));async function C(e,t,n){let r=n.length>0&&typeof n[0]==`string`?await w(e,n):n,i=L(`${t.name} ${t.description} ${t.content}`);return r.map(e=>({skill:e,score:R(i,L(`${e.name} ${e.description} ${e.content}`))})).filter(e=>e.score>=.18).sort((e,t)=>t.score-e.score).map(e=>e.skill)}async function ne(e,t){return C(`skill`,e,t)}async function w(e,t){if(e===`skill`)return D(t);let n=[];for(let e of t)u(e)&&await P(e,n);return n}function T(e,t,n={}){let r=t.find(e=>j(e));if(n.allowHardDelete&&r)return{type:`delete`,targetSkill:r,reason:`Existing skill is low quality, unreferenced, and safe to delete.`,confirmed:!0};let i=t[0];if(!i)return{type:`create`,draft:e,reason:`No overlapping active skill found.`};let a=R(L(`${e.name} ${e.description} ${e.content}`),L(`${i.name} ${i.description} ${i.content}`));return a>=.72&&e.confidence>=.75&&ae(e,i)?{type:`replace`,targetSkill:i,draft:e,reason:`New learned skill has high overlap (${a.toFixed(2)}) and higher confidence.`}:a>=.35?{type:`merge`,targetSkill:i,patch:ie(e),reason:`Existing skill overlaps with the learned pattern (${a.toFixed(2)}).`}:{type:`create`,draft:e,reason:`Overlap is too low to merge.`}}async function E(e,t={}){switch(e.type){case`create`:return{activePath:await W(e.draft)};case`merge`:return I(e.targetSkill)?{activePath:await re(e.targetSkill,e.patch)}:(process.stderr.write(`[skill-learning] skip user-authored skill: ${e.targetSkill.path}\n`),{});case`replace`:{if(!I(e.targetSkill))return process.stderr.write(`[skill-learning] skip user-authored skill: ${e.targetSkill.path}\n`),{};let n=e.draft.outputPath;if(e.hardDelete){let{deletedPath:r,manifestPath:i,tombstonePath:a}=await k(e.targetSkill,e.reason,{newSkill:e.draft.name,newPath:n},{...t,allowHardDelete:!0});return{activePath:await W(e.draft),deletedPath:r,manifestPath:i,tombstonePath:a}}let{archivedPath:r,manifestPath:i}=await O(e.targetSkill,e.reason,{newSkill:e.draft.name,newPath:n},t);return{activePath:await W(e.draft),archivedPath:r,manifestPath:i}}case`archive`:return await O(e.targetSkill,e.reason,void 0,t);case`delete`:return await k(e.targetSkill,e.reason,void 0,{...t,allowHardDelete:t.allowHardDelete&&e.confirmed!==!1})}}async function D(e){let t=[];for(let n of e)u(n)&&await N(n,t);return t}async function O(e,t,n,r={}){let a=c(e.path),o=r.archiveRoot??l(c(a),`.archive`),u=l(o,`${s(a)}-${M(r.now)}`);await d(o,{recursive:!0}),await ee(a,u);let f=await A(r.manifestRoot??u,{oldSkill:e.name,oldPath:e.path,newSkill:n?.newSkill,newPath:n?.newPath,action:`archive`,reason:t,replacedAt:(r.now??new Date).toISOString(),recoverable:!0});return i(),{archivedPath:u,manifestPath:f}}async function k(e,t,n,r={}){if(!r.allowHardDelete)throw Error(`Hard delete requires allowHardDelete=true`);let a=c(e.path),o=u(e.path)?await f(e.path,`utf8`):``,s=r.manifestRoot??l(c(a),`.tombstones`),d=await A(s,{oldSkill:e.name,oldPath:e.path,newSkill:n?.newSkill,newPath:n?.newPath,action:`delete`,reason:t,replacedAt:(r.now??new Date).toISOString(),recoverable:!1}),p=l(s,`${e.name}-${M(r.now)}.tombstone.json`);return await h(p,`${JSON.stringify({deletedSkill:e.name,oldPath:e.path,content:o},null,2)}\n`,`utf8`),await m(a,{recursive:!0,force:!0}),i(),{deletedPath:e.path,manifestPath:d,tombstonePath:p}}async function A(e,t){await d(e,{recursive:!0});let n=l(e,`replacement-manifest.json`);return await h(n,`${JSON.stringify(t,null,2)}\n`,`utf8`),n}async function re(e,t){let n=l(c(e.path),`learned-skill.patch.md`);return await h(n,t,`utf8`),i(),n}function ie(e){return[`# Learned Skill Merge Patch`,``,`Target learned skill: ${e.name}`,`Confidence: ${e.confidence}`,``,`## Suggested additions`,``,e.content].join(`
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(`
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-D7l3P1k9.js`);e()}catch{}return t}function G(e,n,r){return r?.outputRoot?l(r.outputRoot,e):n===`project`?l(r?.cwd??process.cwd(),`.claude`,`skills`,e):l(r?.globalSkillsDir??l(t(),`skills`),e)}function K(e){return _(e)}function q(e){let t=(e[0]?.action??`Apply a learned project pattern`).replace(/\s+/g,` `).slice(0,120);return t.length>0?t:`Apply learned project patterns`}function J(e){let{name:t,description:n,confidence:r,instincts:i}=e;return[`---`,`name: ${t}`,`description: ${JSON.stringify(n)}`,`origin: skill-learning`,`confidence: ${Number(r.toFixed(2))}`,`evolved_from: [${i.map(e=>JSON.stringify(e.id)).join(`, `)}]`,`---`,``,`# ${oe(t)}`,``,`## Trigger`,``,i.map(e=>`- ${e.trigger}`).join(`
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(`
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-DaNb-yKH.js";import{p as e}from"./runtimeObserver-BXbjibFk.js";import{o as t}from"./observationStore-DzCdXq8U.js";import{s as n}from"./projectContext-D9MDwJUF.js";import"./sessionObserver-Ur7PqKl_.js";import"./toolEventObserver-C98uraqD.js";import"./skillGapStore-z3LP64O-.js";import{t as r}from"./skillLearning-rMX1bSBa.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-CwXUfM4Y.js";import{S as a,T as o,f as s,i as c,k as l,u}from"./runtimeObserver-XufSllVw.js";import{i as d}from"./observationStore-DzCdXq8U.js";import{a as f}from"./projectContext-D9MDwJUF.js";import{a as p,c as m,d as h,i as g}from"./sessionObserver-B_09FQKV.js";import{n as _}from"./toolEventObserver-DdhPsAs1.js";import{n as v}from"./skillGapStore-75ZYlfwi.js";var y=e((()=>{t(),a(),n(),s(),d(),u(),f(),c(),h(),p(),l(),o(),_(),g(),v(),i(),r(),m()}));export{y as t};
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,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-DrDu5yYy.js";import{r as d,t as f}from"./featureCheck-HslM03dr.js";async function p(){let{readObservations:e,loadInstincts:t,resolveProjectContext:n}=await import(`./skillLearning-CSY5R5Jn.js`),r=n(process.cwd()),[i,a]=await Promise.all([e({project:r}),t({project:r})]);return[`Skill Learning status for ${r.projectName} (${r.projectId})`,`Observations: ${i.length}`,`Instincts: ${a.length}`,``,`Skill Learning: ${d()?`enabled`:`disabled`}`].join(`
2
- `)}async function m(){let e=[];d()?e.push(`Skill Learning: already enabled`):(process.env.SKILL_LEARNING_ENABLED=`1`,e.push(`Skill Learning: enabled (SKILL_LEARNING_ENABLED=1)`));try{let{initSkillLearning:t}=await import(`./runtimeObserver-DSUuYKfs.js`);t(),e.push(`Runtime observer: initialized`)}catch{e.push(`Runtime observer: init skipped (not available)`)}return e.join(`
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(`
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-B0dyBT1_.js`),n=await t(r,{});return n&&typeof n==`object`&&`value`in n&&e(n.value,{display:`system`}),null}return(0,y.jsx)(g,{onDone:e})}var v,y,b,x;e((()=>{v=t(i(),1),o(),u(),f(),y=c(),b=28,x=`# Skill Learning (自动学习)
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 (自动学习)
5
5
 
6
6
  Skill Learning 是一个闭环学习系统,通过观察用户的操作模式自动提取直觉(instinct),
7
7
  并在达到阈值后生成可复用的 skill 文件、agent 和 command。
@@ -1,5 +1,5 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,fi as i,hn as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Dm as l,Om as u,wx as d,xx as f}from"./loadAgentsDir-DrDu5yYy.js";function p(){return[`Skill Search (自动技能匹配)`,`Status: ${u()?`enabled`:`disabled`}`,``,`When enabled, relevant skills are automatically matched and`,`injected into conversation context each turn.`].join(`
2
- `)}async function m(){if(u()&&process.env.SKILL_SEARCH_ENABLED!==`0`)return`Skill Search: already enabled`;process.env.SKILL_SEARCH_ENABLED=`1`;let e=[`Skill Search: enabled (SKILL_SEARCH_ENABLED=1)`];try{let{clearSkillIndexCache:t}=await import(`./localSearch-CebU5BA9.js`);t(),e.push(`Skill index cache: cleared (will rebuild on next search)`)}catch{e.push(`Skill index cache: clear skipped`)}return e.join(`
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
3
  `)}async function h(){return u()?(process.env.SKILL_SEARCH_ENABLED=`0`,`Skill Search: disabled (SKILL_SEARCH_ENABLED=0)`):`Skill Search: already disabled`}function g({onDone:e}){d(`skill-search-panel`);let[t,i]=(0,v.useState)(0),o=(0,v.useMemo)(()=>[{label:`Status`,description:`Show whether automatic skill matching is active`,run:()=>Promise.resolve(p())},{label:`Start`,description:`Enable automatic skill matching for this session`,run:m},{label:`Stop`,description:`Disable automatic skill matching for this session`,run:h},{label:`About`,description:`How automatic skill matching works`,run:()=>Promise.resolve(x)}],[]),c=()=>{let n=o[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return a((e,t)=>{if(t.upArrow){i(e=>Math.max(0,e-1));return}if(t.downArrow){i(e=>Math.min(o.length-1,e+1));return}t.return&&c()}),(0,y.jsx)(s,{title:`Skill Search`,subtitle:`${o.length} actions`,onCancel:()=>e(`Skill search panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,y.jsxs)(n,{flexDirection:`column`,children:[o.map((e,i)=>(0,y.jsxs)(n,{flexDirection:`row`,children:[(0,y.jsx)(r,{children:`${i===t?`›`:` `} ${e.label}`.padEnd(b)}),(0,y.jsx)(r,{dimColor:!0,children:e.description})]},e.label)),(0,y.jsx)(n,{marginTop:1,children:(0,y.jsx)(r,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function _(e,t,n){let r=n?.trim()??``;return r===`start`?(e(await m(),{display:`system`}),null):r===`stop`?(e(await h(),{display:`system`}),null):r===`about`?(e(x,{display:`system`}),null):r===`status`?(e(p(),{display:`system`}),null):(0,y.jsx)(g,{onDone:e})}var v,y,b,x;e((()=>{v=t(i(),1),o(),f(),l(),y=c(),b=28,x=`# Skill Search (自动技能匹配)
4
4
 
5
5
  Skill Search 控制对话中的自动技能匹配功能。
@@ -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-DrDu5yYy.js";import{dn as h,ln as g}from"./settings-DfWP5y6X.js";import{b as _,y as v}from"./startupProfiler-xa3NmN7Z.js";import{l as y,o as b}from"./stringUtils-DGLPkqJ4.js";function x(e,t){let n=t.trim();if(n===``)return e.slice();let r=n.toLowerCase().split(/\s+/);return e.filter(e=>{let t=`${e.name} ${e.description}`.toLowerCase();return r.every(e=>t.includes(e))})}var S=e((()=>{}));function C(e){return e===`plugin`?`plugin`:e===`mcp`?`mcp`:g(e)}function w({onExit:e,commands:t}){let[i,o]=(0,T.useState)(``),c=(0,T.useMemo)(()=>t.filter(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`commands_DEPRECATED`||e.loadedFrom===`plugin`||e.loadedFrom===`mcp`)),[t]),l=(0,T.useMemo)(()=>x(c.map(e=>({...e,name:p(e),description:e.description??``})),i),[c,i]),u=(0,T.useMemo)(()=>{let e={policySettings:[],userSettings:[],projectSettings:[],localSettings:[],flagSettings:[],plugin:[],mcp:[]};for(let t of l){let n=t.source;n in e&&e[n].push(t)}for(let t of Object.values(e))t.sort((e,t)=>p(e).localeCompare(p(t)));return e},[l]),d=()=>{e(`Skills dialog dismissed`,{display:`system`})};if(c.length===0)return(0,E.jsxs)(s,{title:`Skills`,subtitle:`No skills found`,onCancel:d,hideInputGuide:!0,children:[(0,E.jsx)(r,{dimColor:!0,children:`Create skills in .claude/skills/ or ~/.claude/skills/`}),(0,E.jsx)(r,{dimColor:!0,italic:!0,children:(0,E.jsx)(f,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`close`})})]});let h=e=>{switch(e){case`projectSettings`:case`localSettings`:return{label:`local`,color:`yellow`};case`userSettings`:return{label:`global`,color:`cyan`};case`policySettings`:return{label:`managed`,color:`magenta`};default:return}},g=(e,t)=>{let i=`~${v(m(e))}`,a=e.source===`plugin`?e.pluginInfo?.pluginManifest.name:void 0,o=h(e.source);return(0,E.jsxs)(n,{children:[(0,E.jsx)(r,{color:t?`suggestion`:void 0,children:p(e)}),o&&(0,E.jsxs)(r,{color:o.color,children:[` [`,o.label,`]`]}),(0,E.jsxs)(r,{dimColor:!0,children:[a?` · ${a}`:``,` · `,C(e.source),` · `,i,` tokens`]})]})};return(0,E.jsx)(a,{title:`Skills`,placeholder:`Type to filter skills…`,items:(0,T.useMemo)(()=>D.flatMap(e=>u[e]),[u]),getKey:e=>`${e.name}-${e.source}`,visibleCount:12,direction:`down`,onQueryChange:o,onSelect:t=>{e(`/${p(t)}`,{display:`user`})},onCancel:d,emptyMessage:e=>e.trim()?`No skills matching "${e.trim()}"`:`No skills found`,matchLabel:i.trim()===``?`${c.length} ${y(c.length,`skill`)}`:`${l.length}/${c.length} ${y(c.length,`skill`)}`,selectAction:`invoke skill`,renderItem:(e,t)=>g(e,t)})}var T,E,D,O=e((()=>{i(),T=t(i(),1),d(),o(),l(),_(),h(),b(),u(),S(),E=c(),D=[`projectSettings`,`localSettings`,`userSettings`,`flagSettings`,`policySettings`,`plugin`,`mcp`]}));async function k(e,t){return(0,A.jsx)(w,{onExit:e,commands:t.options.commands})}var A;e((()=>{i(),O(),A=c()}))();export{k as call};
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 +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-BvhG1XoW.js";async function a(e,t){return(0,o.jsx)(i,{onClose:e,context:t,defaultTab:`Status`})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
1
+ 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,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-DrDu5yYy.js";import{a as S,c as C,dn as w,g as T,on as E,r as D,sn as O}from"./settings-DfWP5y6X.js";import{f as k,l as A}from"./file-DcZWPH2V.js";import{b as j,p as M}from"./startupProfiler-xa3NmN7Z.js";import{Kt as ne,Vt as N,_ as P,fi as F,i as I,mi as L,x as R,xt as z}from"./model-fi472PRc.js";import{h as B,l as V,o as H,p as U}from"./proxy-CRN7jYIi.js";import{d as W,u as G}from"./pidLock-CdNZ0Wfg.js";import{n as K,t as q}from"./nativeInstaller-DktvrWRd.js";import{n as J,t as Y}from"./allErrors-DJYCAtab.js";function X(){return process.env.USER_TYPE===`ant`?[{label:`Bash Sandbox`,value:_.isSandboxingEnabled()?`Enabled`:`Disabled`}]:[]}function Z(e,t=null,n){let r=e?.find(e=>e.name===`ide`);if(t){let e=m(t.ideType),i=y(t.ideType)?`plugin`:`extension`;if(t.error)return[{label:`IDE`,value:(0,$.jsxs)(ee,{children:[c(`error`,n)(o.cross),` Error installing `,e,` `,i,`:`,` `,t.error,`
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
2
  `,`Please restart your IDE and try again.`]})}];if(t.installed)return r&&r.type===`connected`?t.installedVersion===r.serverInfo?.version?[{label:`IDE`,value:`Connected to ${e} ${i} version ${t.installedVersion}`}]:[{label:`IDE`,value:`Connected to ${e} ${i} version ${t.installedVersion} (server version: ${r.serverInfo?.version})`}]:[{label:`IDE`,value:`Installed ${e} ${i}`}]}else if(r){let e=b(r)??`IDE`;return r.type===`connected`?[{label:`IDE`,value:`Connected to ${e} extension`}]:[{label:`IDE`,value:`${c(`error`,n)(o.cross)} Not connected to ${e}`}]}return[]}function re(e=[],t){let n=e.filter(e=>e.name!==`ide`);if(!n.length)return[];let r={connected:0,pending:0,needsAuth:0,failed:0};for(let e of n)e.type===`connected`?r.connected++:e.type===`pending`?r.pending++:e.type===`needs-auth`?r.needsAuth++:r.failed++;let i=[];return r.connected&&i.push(c(`success`,t)(`${r.connected} connected`)),r.needsAuth&&i.push(c(`warning`,t)(`${r.needsAuth} need auth`)),r.pending&&i.push(c(`inactive`,t)(`${r.pending} pending`)),r.failed&&i.push(c(`error`,t)(`${r.failed} failed`)),[{label:`MCP servers`,value:`${i.join(`, `)} ${c(`inactive`,t)(`· /mcp`)}`}]}async function ie(){let e=f(await p()),t=[];return e.forEach(e=>{let n=A(e.path);t.push(`Large ${n} will impact performance (${M(e.content.length)} chars > ${M(h)})`)}),t}function ae(){return[{label:`Setting sources`,value:E().filter(e=>{let t=C(e);return t!==null&&Object.keys(t).length>0}).map(e=>{if(e===`policySettings`){let e=S();if(e===null)return null;switch(e){case`remote`:return`Enterprise managed settings (remote)`;case`plist`:return`Enterprise managed settings (plist)`;case`hklm`:return`Enterprise managed settings (HKLM)`;case`file`:{let{hasBase:e,hasDropIns:t}=D();return e&&t?`Enterprise managed settings (file + drop-ins)`:t?`Enterprise managed settings (drop-ins)`:`Enterprise managed settings (file)`}case`hkcu`:return`Enterprise managed settings (HKCU)`}}return O(e)}).filter(e=>e!==null)}]}async function oe(){return(await K()).map(e=>e.message)}async function se(){let e=await G(),t=[],{errors:n}=Y();if(n.length>0){let e=Array.from(new Set(n.map(e=>e.file))).join(`, `);t.push(`Found invalid settings files: ${e}. They will be ignored.`)}return e.warnings.forEach(e=>{t.push(e.issue)}),e.hasUpdatePermissions===!1&&t.push(`No write permissions for auto-updates (requires sudo)`),t}function Q(){let e=z();if(!e)return[];let t=[];return e.subscription&&t.push({label:`Login method`,value:`${e.subscription} Account`}),e.tokenSource&&t.push({label:`Auth token`,value:e.tokenSource}),e.apiKeySource&&t.push({label:`API key`,value:e.apiKeySource}),e.organization&&!process.env.IS_DEMO&&t.push({label:`Organization`,value:e.organization}),e.email&&!process.env.IS_DEMO&&t.push({label:`Email`,value:e.email}),t}function ce(){let e=F(),n=[];if(e!==`firstParty`){let t={bedrock:`AWS Bedrock`,vertex:`Google Vertex AI`,foundry:`Microsoft Foundry`,gemini:`Gemini API`,grok:`Grok API`,openai:`OpenAI API`}[e];n.push({label:`API provider`,value:t})}if(e===`firstParty`){let e=process.env.ANTHROPIC_BASE_URL;e&&n.push({label:`Anthropic base URL`,value:e})}else if(e===`bedrock`){let e=process.env.BEDROCK_BASE_URL;e&&n.push({label:`Bedrock base URL`,value:e}),n.push({label:`AWS region`,value:i()}),t(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&n.push({value:`AWS auth skipped`})}else if(e===`vertex`){let e=process.env.VERTEX_BASE_URL;e&&n.push({label:`Vertex base URL`,value:e});let i=process.env.ANTHROPIC_VERTEX_PROJECT_ID;i&&n.push({label:`GCP project`,value:i}),n.push({label:`Default region`,value:r()}),t(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&n.push({value:`GCP auth skipped`})}else if(e===`foundry`){let e=process.env.ANTHROPIC_FOUNDRY_BASE_URL;e&&n.push({label:`Microsoft Foundry base URL`,value:e});let r=process.env.ANTHROPIC_FOUNDRY_RESOURCE;r&&n.push({label:`Microsoft Foundry resource`,value:r}),t(process.env.CLAUDE_CODE_SKIP_FOUNDRY_AUTH)&&n.push({value:`Microsoft Foundry auth skipped`})}else if(e===`gemini`){let e=process.env.GEMINI_BASE_URL||`https://generativelanguage.googleapis.com/v1beta`;n.push({label:`Gemini base URL`,value:e})}else if(e===`grok`){let e=process.env.GROK_BASE_URL;n.push({label:`Grok base URL`,value:e})}else if(e===`openai`){let e=process.env.OPENAI_BASE_URL;n.push({label:`OpenAI base URL`,value:e})}let a=H();a&&n.push({label:`Proxy`,value:a});let o=U();return process.env.NODE_EXTRA_CA_CERTS&&n.push({label:`Additional CA cert(s)`,value:process.env.NODE_EXTRA_CA_CERTS}),o&&(o.cert&&process.env.CLAUDE_CODE_CLIENT_CERT&&n.push({label:`mTLS client cert`,value:process.env.CLAUDE_CODE_CLIENT_CERT}),o.key&&process.env.CLAUDE_CODE_CLIENT_KEY&&n.push({label:`mTLS client key`,value:process.env.CLAUDE_CODE_CLIENT_KEY})),n}function le(e){let t=R(e);if(e===null&&ne()){let e=I();t=`${u.bold(`Default`)} ${e}`}return t}var $,ue=e((()=>{s(),a(),te(),l(),N(),x(),W(),n(),k(),j(),g(),P(),L(),B(),q(),V(),v(),J(),w(),T(),$=d()}));export{se as a,X as c,ue as d,oe as i,ae as l,Q as n,re as o,Z as r,ie as s,ce as t,le as u};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Uc as t,Wc as n}from"./loadAgentsDir-DrDu5yYy.js";function r(e){return e?e.activeAgents.filter(e=>e.source!==`built-in`).reduce((e,t)=>e+n(`${t.agentType}: ${t.whenToUse}`),0):0}var i,a=e((()=>{t(),i=15e3}));export{r as n,a as r,i as t};
1
+ 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,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-DrDu5yYy.js";import{D as v,E as y,Y as b}from"./log-BMCygSzM.js";import{n as x,r as S}from"./analytics-BotDBGh0.js";import{r as C,t as w}from"./sanitization-DV-94a9Z.js";function T({tagName:e,onConfirm:t,onCancel:i}){return(0,A.jsx)(c,{title:`Remove tag?`,subtitle:`Current tag: #${e}`,onCancel:i,color:`warning`,children:(0,A.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,A.jsx)(r,{children:`This will remove the tag from the current session.`}),(0,A.jsx)(p,{onChange:e=>e===`yes`?t():i(),options:[{label:`Yes, remove tag`,value:`yes`},{label:`No, keep tag`,value:`no`}]})]})})}function E({tagName:e,onDone:t}){let[n,r]=k.useState(!1),[i,a]=k.useState(null),o=C(e).trim();return k.useEffect(()=>{let e=d();if(!e){t(`No active session to tag`,{display:`system`});return}if(!o){t(`Tag name cannot be empty`,{display:`system`});return}a(e);let n=h(e);n===o?(S(`tengu_tag_command_remove_prompt`,{}),r(!0)):(S(`tengu_tag_command_add`,{is_replacing:!!n}),(async()=>{let n=f();await _(e,o,n),t(`Tagged session with ${s.cyan(`#${o}`)}`,{display:`system`})})())},[o,t]),n&&i?(0,A.jsx)(T,{tagName:o,onConfirm:async()=>{S(`tengu_tag_command_remove_confirmed`,{});let e=f();await _(i,``,e),t(`Removed tag ${s.cyan(`#${o}`)}`,{display:`system`})},onCancel:()=>{S(`tengu_tag_command_remove_cancelled`,{}),t(`Kept tag ${s.cyan(`#${o}`)}`,{display:`system`})}}):null}function D({onDone:e}){return k.useEffect(()=>{e(`Usage: /tag <tag-name>
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>
2
2
 
3
3
  Toggle a searchable tag on the current session.
4
4
  Run the same command again to remove the tag.
@@ -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-DyjVt81B.js";async function a(e,t){return(0,o.jsx)(i,{toolUseContext:t,onDone:e})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
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 +1 @@
1
- import{Ay as e,Fy as t,Ny as n,Ry as r,jy as i}from"./loadAgentsDir-DrDu5yYy.js";i();export{e as checkOutTeleportedSessionBranch,n as processMessagesForTeleportResume,t as teleportResumeCodeSession,r as validateGitState};
1
+ import{Ay as e,Fy as t,Ny as n,Ry as r,jy as i}from"./loadAgentsDir-BURvZNN6.js";i();export{e as checkOutTeleportedSessionBranch,n as processMessagesForTeleportResume,t as teleportResumeCodeSession,r as validateGitState};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{bO as r,g as i,h as a,m as o,yO as s}from"./loadAgentsDir-DrDu5yYy.js";import{basename as c,join as l}from"path";import{appendFileSync as u,mkdirSync as d,readFileSync as f,readdirSync as p,writeFileSync as m}from"fs";import{randomUUID as h}from"crypto";function g(){let e=a(`templates`,process.cwd()),n=l(t(),`templates`);try{return p(n),[...e,n]}catch{return e}}function _(){let e=[],t=new Set;for(let n of g()){let i;try{i=p(n)}catch{continue}for(let a of i){if(!a.endsWith(`.md`))continue;let i=c(a,`.md`);if(t.has(i))continue;t.add(i);let s=l(n,a);try{let{frontmatter:t,content:n}=r(f(s,`utf-8`),s),a=(typeof t.description==`string`?t.description:``)||o(n,`No description`);e.push({name:i,description:a,filePath:s,frontmatter:t,content:n})}catch{}}}return e}function v(e){return _().find(t=>t.name===e)??null}var y=e((()=>{s(),n(),i()}));function b(){return l(t(),`jobs`)}function x(e){return l(b(),e)}function S(e,t,n,r,i){let a=x(e);d(a,{recursive:!0});let o=new Date().toISOString(),s={jobId:e,templateName:t,createdAt:o,updatedAt:o,status:`created`,args:i};return m(l(a,`state.json`),JSON.stringify(s,null,2),`utf-8`),m(l(a,`template.md`),n,`utf-8`),m(l(a,`input.txt`),r,`utf-8`),a}function C(e){try{let t=f(l(x(e),`state.json`),`utf-8`),n=JSON.parse(t);if(typeof n!=`object`||!n)return null;let r=n;return typeof r.jobId!=`string`||typeof r.status!=`string`?null:r}catch{return null}}function w(e,t){let n=x(e),r=C(e);if(!r)return!1;let i=l(n,`replies.jsonl`),a=JSON.stringify({text:t,timestamp:new Date().toISOString()});try{u(i,a+`
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+`
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{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,fi as n,t as r,x as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{n as o,t as s}from"./ThemePicker-BTfuZZ7E.js";function c({onDone:e}){let[,n]=t();return(0,l.jsx)(i,{color:`permission`,children:(0,l.jsx)(s,{onThemeSelect:t=>{n(t),e(`Theme set to ${t}`)},onCancel:()=>{e(`Theme picker dismissed`,{display:`system`})},skipExitHandling:!0})})}var l,u;e((()=>{n(),r(),o(),l=a(),u=async(e,t)=>(0,l.jsx)(c,{onDone:e})}))();export{u as call};
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 +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,Fs as f,Gs as p,Hs as m,Is as ee,Lb as h,Vs as g,ZD as _,_x as v,fs as y,lc as b,ps as x,uc as S,vx as te,zb as C}from"./loadAgentsDir-DrDu5yYy.js";import{V as w,W as T,a as E,l as D,z as ne}from"./debug-BrXObCdR.js";import{c as re,o as ie,r as ae,t as oe}from"./execFileNoThrow-D244NytW.js";import{o as se,s as O}from"./log-BMCygSzM.js";import{i as ce,o as k}from"./platform-BrYefG_2.js";import{_ as A,f as j}from"./file-DcZWPH2V.js";import{n as M,r as N}from"./pluginStartupCheck-BNd2QNzZ.js";import{a as P,s as F}from"./pluginOperations-ClzXYNQe.js";import{join as I}from"path";import{readFile as L}from"fs/promises";function R(){return process.env.USER_TYPE===`ant`?q:_}function z(){return process.env.USER_TYPE===`ant`?J:Y}function B(){return`thinkback@${R()}`}async function V(){let{enabled:e}=await x(),t=e.find(e=>e.name===`thinkback`||e.source&&e.source.includes(B()));if(!t)return null;let n=I(t.path,`skills`,X);return await A(n)?n:null}async function H(e){let t=I(e,`year_in_review.js`),n=I(e,`player.js`);try{await L(t)}catch(e){return w(e)?{success:!1,message:`No animation found. Run /think-back first to generate one.`}:(O(e),{success:!1,message:`Could not access animation data: ${T(e).message}`})}try{await L(n)}catch(e){return w(e)?{success:!1,message:`Player script not found. The player.js file is missing from the thinkback skill.`}:(O(e),{success:!1,message:`Could not access player script: ${T(e).message}`})}let r=i.get(process.stdout);if(!r)return{success:!1,message:`Failed to access terminal instance`};r.enterAlternateScreen();try{await ie(`node`,[n],{stdio:`inherit`,cwd:e,reject:!1})}catch{}finally{r.exitAlternateScreen()}let a=I(e,`year_in_review.html`);if(await A(a)){let e=ce();oe(e===`macos`?`open`:e===`windows`?`start`:`xdg-open`,[a])}return{success:!0,message:`Year in review animation complete!`}}function U({onReady:e,onError:t}){let[i,a]=(0,G.useState)({phase:`checking`}),[o,s]=(0,G.useState)(``);if((0,G.useEffect)(()=>{async function n(){try{let t=await m(),n=R(),r=z(),i=B(),o=n in t,c=u(i);if(o?c||(a({phase:`installing-marketplace`}),s(`Updating marketplace…`),D(`Refreshing marketplace ${n}`),await p(n,e=>{s(e)}),ee(),b(),D(`Marketplace ${n} refreshed`)):(a({phase:`installing-marketplace`}),D(`Installing marketplace ${r}`),await f({source:`github`,repo:r},e=>{s(e)}),b(),D(`Marketplace ${n} installed`)),c){let{disabled:e}=await x();if(e.some(e=>e.name===`thinkback`||e.source?.includes(i))){a({phase:`enabling-plugin`}),D(`Enabling plugin ${i}`);let e=await P(i);if(!e.success)throw Error(`Failed to enable plugin: ${e.message}`);b(),D(`Plugin ${i} enabled`)}}else{a({phase:`installing-plugin`}),D(`Installing plugin ${i}`);let e=await N([i]);if(e.failed.length>0){let t=e.failed.map(e=>`${e.name}: ${e.error}`).join(`, `);throw Error(`Failed to install plugin: ${t}`)}b(),D(`Plugin ${i} installed`)}a({phase:`ready`}),e()}catch(e){let n=T(e);O(n),a({phase:`error`,message:n.message}),t(n.message)}}n()},[e,t]),i.phase===`error`)return(0,K.jsx)(n,{flexDirection:`column`,children:(0,K.jsxs)(r,{color:`error`,children:[`Error: `,i.message]})});if(i.phase===`ready`)return null;let c=i.phase===`checking`?`Checking thinkback installation…`:i.phase===`installing-marketplace`?`Installing marketplace…`:i.phase===`enabling-plugin`?`Enabling thinkback plugin…`:`Installing thinkback plugin…`;return(0,K.jsx)(n,{flexDirection:`column`,children:(0,K.jsxs)(n,{children:[(0,K.jsx)(h,{}),(0,K.jsx)(r,{children:o||c})]})})}function W({onDone:e,onAction:t,skillDir:i,hasGenerated:a}){let[o,c]=(0,G.useState)(!1),l=a?[{label:`Play animation`,value:`play`,description:`Watch your year in review`},{label:`Edit content`,value:`edit`,description:`Modify the animation`},{label:`Fix errors`,value:`fix`,description:`Fix validation or rendering issues`},{label:`Regenerate`,value:`regenerate`,description:`Create a new animation from scratch`}]:[{label:`Let's go!`,value:`regenerate`,description:`Generate your personalized animation`}];function u(n){c(!0),n===`play`?H(i).then(()=>{e(void 0,{display:`skip`})}):t(n)}function d(){e(void 0,{display:`skip`})}return o?null:(0,K.jsx)(s,{title:`Think Back on 2025 with Work Mate`,subtitle:`Generate your 2025 Work Mate Think Back (takes a few minutes to run)`,onCancel:d,color:`claude`,children:(0,K.jsxs)(n,{flexDirection:`column`,gap:1,children:[!a&&(0,K.jsxs)(n,{flexDirection:`column`,children:[(0,K.jsx)(r,{children:`Relive your year of coding with Claude.`}),(0,K.jsx)(r,{dimColor:!0,children:`We'll create a personalized ASCII animation celebrating your journey.`})]}),(0,K.jsx)(v,{options:l,onChange:u,visibleOptionCount:5})]})})}function le({onDone:e}){let[t,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null);function d(){i(!0)}let f=(0,G.useCallback)(t=>{o(t),e(`Error with thinkback: ${t}. Try running /plugin to manually install the think-back plugin.`,{display:`system`})},[e]);(0,G.useEffect)(()=>{t&&!s&&!a&&V().then(e=>{e?(D(`Thinkback skill directory: ${e}`),c(e)):f(`Could not find thinkback skill directory`)})},[t,s,a,f]),(0,G.useEffect)(()=>{if(!s)return;let e=I(s,`year_in_review.js`);A(e).then(t=>{D(`Checking for ${e}: ${t?`found`:`not found`}`),u(t)})},[s]);function p(t){e({edit:Z,fix:Q,regenerate:$}[t],{display:`user`,shouldQuery:!0})}return a?(0,K.jsxs)(n,{flexDirection:`column`,children:[(0,K.jsxs)(r,{color:`error`,children:[`Error: `,a]}),(0,K.jsx)(r,{dimColor:!0,children:`Try running /plugin to manually install the think-back plugin.`})]}):t?!s||l===null?(0,K.jsxs)(n,{children:[(0,K.jsx)(h,{}),(0,K.jsx)(r,{children:`Loading thinkback skill…`})]}):(0,K.jsx)(W,{onDone:e,onAction:p,skillDir:s,hasGenerated:l}):(0,K.jsx)(U,{onReady:d,onError:f})}async function ue(e){return(0,K.jsx)(le,{onDone:e})}var G,K,q,J,Y,X,Z,Q,$,de=e((()=>{re(),a(),G=t(a(),1),te(),o(),C(),F(),E(),ne(),ae(),j(),se(),k(),S(),d(),g(),l(),y(),M(),K=c(),q=`claude-code-marketplace`,J=`anthropics/claude-code-marketplace`,Y=`anthropics/claude-plugins-official`,X=`thinkback`,Z=`Use the Skill tool to invoke the "thinkback" skill with mode=edit to modify my existing Work Mate year in review animation. Ask me what I want to change. When the animation is ready, tell the user to run /think-back again to play it.`,Q=`Use the Skill tool to invoke the "thinkback" skill with mode=fix to fix validation or rendering errors in my existing Work Mate year in review animation. Run the validator, identify errors, and fix them. When the animation is ready, tell the user to run /think-back again to play it.`,$=`Use the Skill tool to invoke the "thinkback" skill with mode=regenerate to create a completely new Work Mate year in review animation from scratch. Delete the existing animation and start fresh. When the animation is ready, tell the user to run /think-back again to play it.`}));export{de as n,H as r,ue as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,Rn as i,fi as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{$D as l,As as u,Es as d,Fs as f,Gs as p,Hs as m,Is as ee,Lb as h,Vs as g,ZD as _,_x as v,fs as y,lc as b,ps as x,uc as S,vx as te,zb as C}from"./loadAgentsDir-BURvZNN6.js";import{V as w,W as T,a as E,l as D,z as ne}from"./debug-BrXObCdR.js";import{c as re,o as ie,r as ae,t as oe}from"./execFileNoThrow-D244NytW.js";import{o as se,s as O}from"./log-BMCygSzM.js";import{i as ce,o as k}from"./platform-BrYefG_2.js";import{_ as A,f as j}from"./file-DcZWPH2V.js";import{n as M,r as N}from"./pluginStartupCheck-RscVZDi4.js";import{a as P,s as F}from"./pluginOperations-JEedVzfS.js";import{join as I}from"path";import{readFile as L}from"fs/promises";function R(){return process.env.USER_TYPE===`ant`?q:_}function z(){return process.env.USER_TYPE===`ant`?J:Y}function B(){return`thinkback@${R()}`}async function V(){let{enabled:e}=await x(),t=e.find(e=>e.name===`thinkback`||e.source&&e.source.includes(B()));if(!t)return null;let n=I(t.path,`skills`,X);return await A(n)?n:null}async function H(e){let t=I(e,`year_in_review.js`),n=I(e,`player.js`);try{await L(t)}catch(e){return w(e)?{success:!1,message:`No animation found. Run /think-back first to generate one.`}:(O(e),{success:!1,message:`Could not access animation data: ${T(e).message}`})}try{await L(n)}catch(e){return w(e)?{success:!1,message:`Player script not found. The player.js file is missing from the thinkback skill.`}:(O(e),{success:!1,message:`Could not access player script: ${T(e).message}`})}let r=i.get(process.stdout);if(!r)return{success:!1,message:`Failed to access terminal instance`};r.enterAlternateScreen();try{await ie(`node`,[n],{stdio:`inherit`,cwd:e,reject:!1})}catch{}finally{r.exitAlternateScreen()}let a=I(e,`year_in_review.html`);if(await A(a)){let e=ce();oe(e===`macos`?`open`:e===`windows`?`start`:`xdg-open`,[a])}return{success:!0,message:`Year in review animation complete!`}}function U({onReady:e,onError:t}){let[i,a]=(0,G.useState)({phase:`checking`}),[o,s]=(0,G.useState)(``);if((0,G.useEffect)(()=>{async function n(){try{let t=await m(),n=R(),r=z(),i=B(),o=n in t,c=u(i);if(o?c||(a({phase:`installing-marketplace`}),s(`Updating marketplace…`),D(`Refreshing marketplace ${n}`),await p(n,e=>{s(e)}),ee(),b(),D(`Marketplace ${n} refreshed`)):(a({phase:`installing-marketplace`}),D(`Installing marketplace ${r}`),await f({source:`github`,repo:r},e=>{s(e)}),b(),D(`Marketplace ${n} installed`)),c){let{disabled:e}=await x();if(e.some(e=>e.name===`thinkback`||e.source?.includes(i))){a({phase:`enabling-plugin`}),D(`Enabling plugin ${i}`);let e=await P(i);if(!e.success)throw Error(`Failed to enable plugin: ${e.message}`);b(),D(`Plugin ${i} enabled`)}}else{a({phase:`installing-plugin`}),D(`Installing plugin ${i}`);let e=await N([i]);if(e.failed.length>0){let t=e.failed.map(e=>`${e.name}: ${e.error}`).join(`, `);throw Error(`Failed to install plugin: ${t}`)}b(),D(`Plugin ${i} installed`)}a({phase:`ready`}),e()}catch(e){let n=T(e);O(n),a({phase:`error`,message:n.message}),t(n.message)}}n()},[e,t]),i.phase===`error`)return(0,K.jsx)(n,{flexDirection:`column`,children:(0,K.jsxs)(r,{color:`error`,children:[`Error: `,i.message]})});if(i.phase===`ready`)return null;let c=i.phase===`checking`?`Checking thinkback installation…`:i.phase===`installing-marketplace`?`Installing marketplace…`:i.phase===`enabling-plugin`?`Enabling thinkback plugin…`:`Installing thinkback plugin…`;return(0,K.jsx)(n,{flexDirection:`column`,children:(0,K.jsxs)(n,{children:[(0,K.jsx)(h,{}),(0,K.jsx)(r,{children:o||c})]})})}function W({onDone:e,onAction:t,skillDir:i,hasGenerated:a}){let[o,c]=(0,G.useState)(!1),l=a?[{label:`Play animation`,value:`play`,description:`Watch your year in review`},{label:`Edit content`,value:`edit`,description:`Modify the animation`},{label:`Fix errors`,value:`fix`,description:`Fix validation or rendering issues`},{label:`Regenerate`,value:`regenerate`,description:`Create a new animation from scratch`}]:[{label:`Let's go!`,value:`regenerate`,description:`Generate your personalized animation`}];function u(n){c(!0),n===`play`?H(i).then(()=>{e(void 0,{display:`skip`})}):t(n)}function d(){e(void 0,{display:`skip`})}return o?null:(0,K.jsx)(s,{title:`Think Back on 2025 with Work Mate`,subtitle:`Generate your 2025 Work Mate Think Back (takes a few minutes to run)`,onCancel:d,color:`claude`,children:(0,K.jsxs)(n,{flexDirection:`column`,gap:1,children:[!a&&(0,K.jsxs)(n,{flexDirection:`column`,children:[(0,K.jsx)(r,{children:`Relive your year of coding with Claude.`}),(0,K.jsx)(r,{dimColor:!0,children:`We'll create a personalized ASCII animation celebrating your journey.`})]}),(0,K.jsx)(v,{options:l,onChange:u,visibleOptionCount:5})]})})}function le({onDone:e}){let[t,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null);function d(){i(!0)}let f=(0,G.useCallback)(t=>{o(t),e(`Error with thinkback: ${t}. Try running /plugin to manually install the think-back plugin.`,{display:`system`})},[e]);(0,G.useEffect)(()=>{t&&!s&&!a&&V().then(e=>{e?(D(`Thinkback skill directory: ${e}`),c(e)):f(`Could not find thinkback skill directory`)})},[t,s,a,f]),(0,G.useEffect)(()=>{if(!s)return;let e=I(s,`year_in_review.js`);A(e).then(t=>{D(`Checking for ${e}: ${t?`found`:`not found`}`),u(t)})},[s]);function p(t){e({edit:Z,fix:Q,regenerate:$}[t],{display:`user`,shouldQuery:!0})}return a?(0,K.jsxs)(n,{flexDirection:`column`,children:[(0,K.jsxs)(r,{color:`error`,children:[`Error: `,a]}),(0,K.jsx)(r,{dimColor:!0,children:`Try running /plugin to manually install the think-back plugin.`})]}):t?!s||l===null?(0,K.jsxs)(n,{children:[(0,K.jsx)(h,{}),(0,K.jsx)(r,{children:`Loading thinkback skill…`})]}):(0,K.jsx)(W,{onDone:e,onAction:p,skillDir:s,hasGenerated:l}):(0,K.jsx)(U,{onReady:d,onError:f})}async function ue(e){return(0,K.jsx)(le,{onDone:e})}var G,K,q,J,Y,X,Z,Q,$,de=e((()=>{re(),a(),G=t(a(),1),te(),o(),C(),F(),E(),ne(),ae(),j(),se(),k(),S(),d(),g(),l(),y(),M(),K=c(),q=`claude-code-marketplace`,J=`anthropics/claude-code-marketplace`,Y=`anthropics/claude-plugins-official`,X=`thinkback`,Z=`Use the Skill tool to invoke the "thinkback" skill with mode=edit to modify my existing Work Mate year in review animation. Ask me what I want to change. When the animation is ready, tell the user to run /think-back again to play it.`,Q=`Use the Skill tool to invoke the "thinkback" skill with mode=fix to fix validation or rendering errors in my existing Work Mate year in review animation. Run the validator, identify errors, and fix them. When the animation is ready, tell the user to run /think-back again to play it.`,$=`Use the Skill tool to invoke the "thinkback" skill with mode=regenerate to create a completely new Work Mate year in review animation from scratch. Delete the existing animation and start fresh. When the animation is ready, tell the user to run /think-back again to play it.`}));export{de as n,H as r,ue as t};
@@ -0,0 +1 @@
1
+ import{n as e,r as t,t as n}from"./thinkback-gV-sKkMM.js";e();export{n as call,t as playAnimation};
@@ -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-DrDu5yYy.js";import{n as a,r as o}from"./thinkback-CXsRbDYN.js";import{join as s}from"path";function c(){return`thinkback@${process.env.USER_TYPE===`ant`?u:i}`}async function l(){let e=r(),t=c(),n=e.plugins[t];if(!n||n.length===0)return{type:`text`,value:`Thinkback plugin not installed. Run /think-back first to install it.`};let i=n[0];return i?.installPath?{type:`text`,value:(await o(s(i.installPath,`skills`,d))).message}:{type:`text`,value:`Thinkback plugin installation path not found.`}}var u,d;e((()=>{n(),t(),a(),u=`claude-code-marketplace`,d=`thinkback`}))();export{l as call};
1
+ 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 +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-DSUuYKfs.js`)]).then(([e,t,n])=>({resolveProjectContext:e.resolveProjectContext,isSkillLearningEnabled:t.isSkillLearningEnabled,RUNTIME_SESSION_ID:n.RUNTIME_SESSION_ID,getRuntimeTurn:n.getRuntimeTurn}))),E}function m(){E=void 0}async function h(e,t,r,a){let o;try{let{resolveProjectContext:s,isSkillLearningEnabled:c,RUNTIME_SESSION_ID:l,getRuntimeTurn:u}=await p();if(!c())return a();let d=s(process.cwd());o={sessionId:r.sessionId??l,turn:r.turn??u(),projectId:d.projectId,projectName:d.projectName,cwd:d.cwd,project:d},g(o,e,t).catch(e=>{n(`skill-learning: recordToolStart error`),i(e)})}catch(e){n(`skill-learning: hook setup error`),i(e)}try{let t=await a();return o&&_(o,e,t,`success`).catch(e=>{n(`skill-learning: recordToolComplete error`),i(e)}),t}catch(t){throw o&&v(o,e,t).catch(e=>{n(`skill-learning: recordToolError error`),i(e)}),t}}async function g(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_start`,toolName:t,toolInput:b(n)},{project:e.project})}async function _(e,t,n,r=`success`){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:r},{project:e.project})}async function v(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:`failure`},{project:e.project})}async function y(e,t){return l(e.sessionId,e.turn),o({...f(e),event:`user_message`,messageText:t},{project:e.project})}function b(e){if(e!=null){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}}var x,S,C,w,T,E,D=e((()=>{a(),t(),r(),x=500,S=250,C=50,w=25,T=new Map}));export{v as a,d as c,_ as i,m as l,D as n,g as o,c as r,y as s,u as t,h as u};
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 +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-DdhPsAs1.js";i();export{c as hasToolHookObservationsForTurn,o as pruneEmittedTurns,n as recordToolComplete,e as recordToolError,a as recordToolStart,s as recordUserCorrection,t as resetToolHookBookkeeping,r as resetToolHookDepsCache,l as runToolCallWithSkillLearningHooks};
1
+ 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};