@readmagic/workmate 0.0.8 → 0.0.9

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 (501) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-qFZy3FOD.js +1 -0
  2. package/dist/chunks/App-DW4elk6E.js +1 -0
  3. package/dist/chunks/ApproveApiKey-D05WywHU.js +1 -0
  4. package/dist/chunks/ApproveApiKey-DHAbdwkC.js +1 -0
  5. package/dist/chunks/BackgroundTasksDialog-QgFwoaaC.js +2 -0
  6. package/dist/chunks/BypassPermissionsModeDialog-BuRFF1fQ.js +1 -0
  7. package/dist/chunks/ClaudeMdExternalIncludesDialog-CDrArsSX.js +1 -0
  8. package/dist/chunks/ClaudeMdExternalIncludesDialog-DpecRCAt.js +1 -0
  9. package/dist/chunks/ConsoleOAuthFlow-D1MYL1dJ.js +1 -0
  10. package/dist/chunks/DiffDialog-BIcwpgSr.js +6 -0
  11. package/dist/chunks/Doctor-D160J8Ad.js +3 -0
  12. package/dist/chunks/Doctor-VhJi2cmL.js +1 -0
  13. package/dist/chunks/ExitFlow-CoWHhKHJ.js +2 -0
  14. package/dist/chunks/Grove-BmirUB6V.js +11 -0
  15. package/dist/chunks/{HybridTransport-BJPOG2wl.js → HybridTransport-BVmSUHf0.js} +1 -1
  16. package/dist/chunks/InvalidConfigDialog-WRywkKeS.js +1 -0
  17. package/dist/chunks/InvalidSettingsDialog-C4n3A72C.js +1 -0
  18. package/dist/chunks/MCPConnectionManager-DPFe4hPh.js +1 -0
  19. package/dist/chunks/MCPToolListView-BPmE0C2o.js +1 -0
  20. package/dist/chunks/McpParsingWarnings-CH4yyMAL.js +1 -0
  21. package/dist/chunks/MessageSelector-kOn2GaU-.js +3 -0
  22. package/dist/chunks/Messages-4EnHFeh1.js +11 -0
  23. package/dist/chunks/Onboarding-BboWs1pp.js +1 -0
  24. package/dist/chunks/{PermissionDialog-0ya1CU5k.js → PermissionDialog-Cb3z8OUP.js} +1 -1
  25. package/dist/chunks/{PressEnterToContinue-Dl9Hg9Mf.js → PressEnterToContinue-Dq0Imo9c.js} +1 -1
  26. package/dist/chunks/PromptInputFooterSuggestions-BpC9COmh.js +1 -0
  27. package/dist/chunks/PromptInputHelpMenu-BvcAzbSi.js +1 -0
  28. package/dist/chunks/QueryEngine-J6ElcO16.js +1 -0
  29. package/dist/chunks/REPL-DBjbAJsm.js +133 -0
  30. package/dist/chunks/REPL-oBemMXvp.js +1 -0
  31. package/dist/chunks/RemoteSessionManager-CoIyFKKa.js +2 -0
  32. package/dist/chunks/ResumeConversation-wBG8OD9P.js +1 -0
  33. package/dist/chunks/{SSETransport-CrwbKuVt.js → SSETransport-1KBBUikF.js} +1 -1
  34. package/dist/chunks/{SearchBox-vfLXEPed.js → SearchBox-C9vUA4IM.js} +1 -1
  35. package/dist/chunks/SearchExtraToolsTool-BugrzImr.js +1 -0
  36. package/dist/chunks/Settings-DptKuJE7.js +2 -0
  37. package/dist/chunks/TeleportProgress-BmgPAZAi.js +1 -0
  38. package/dist/chunks/TeleportRepoMismatchDialog-sgxNOeM_.js +1 -0
  39. package/dist/chunks/TeleportResumeWrapper-GptvrUdv.js +1 -0
  40. package/dist/chunks/ThemePicker-gAMqqD1P.js +1 -0
  41. package/dist/chunks/{TrustDialog-BukWGvHZ.js → TrustDialog-CWt-4Evl.js} +1 -1
  42. package/dist/chunks/{ValidationErrorsList-DokTJQwi.js → ValidationErrorsList-De3kzHtz.js} +1 -1
  43. package/dist/chunks/{WelcomeV2-Ci9VwPYh.js → WelcomeV2-BWF-cJOu.js} +1 -1
  44. package/dist/chunks/add-dir-DBVT1cEK.js +1 -0
  45. package/dist/chunks/{agentDisplay-DBQYOaOh.js → agentDisplay-5gnCQwUY.js} +1 -1
  46. package/dist/chunks/{agents-HlKk68Qc.js → agents-Bz1MLp4A.js} +1 -1
  47. package/dist/chunks/agents-CnwTOlqO.js +103 -0
  48. package/dist/chunks/allErrors-DYw_q14e.js +1 -0
  49. package/dist/chunks/analytics-DJobLaWP.js +1 -0
  50. package/dist/chunks/api-DXDXTFGa.js +1 -0
  51. package/dist/chunks/{api-CF5IVtj0.js → api-DzccRM_z.js} +1 -1
  52. package/dist/chunks/auth-Cjnyy10u.js +15 -0
  53. package/dist/chunks/auth-CnLb6RWc.js +1 -0
  54. package/dist/chunks/auth-D-SGHS0K.js +1 -0
  55. package/dist/chunks/{autoMode-Cr0AhS1G.js → autoMode-CQ5nqP9c.js} +4 -4
  56. package/dist/chunks/{autonomy-ARUQt-Lu.js → autonomy-CPUCe-YU.js} +1 -1
  57. package/dist/chunks/autonomy-dSJl0hN1.js +15 -0
  58. package/dist/chunks/{autonomyPanel-BQK9MoeB.js → autonomyPanel-Ccr9ilei.js} +1 -1
  59. package/dist/chunks/backgroundHousekeeping--cs5crp7.js +17 -0
  60. package/dist/chunks/backgroundHousekeeping-CcbHitKC.js +1 -0
  61. package/dist/chunks/{banner-Ca7rki2V.js → banner-BJZNMppT.js} +1 -1
  62. package/dist/chunks/bg-DWloqGwk.js +1 -0
  63. package/dist/chunks/{bg-DxRHF1yn.js → bg-w3Vlsm3Y.js} +2 -2
  64. package/dist/chunks/branch-CG0AKS1J.js +3 -0
  65. package/dist/chunks/{break-cache-BKvoMOZx.js → break-cache-DXV0brco.js} +2 -2
  66. package/dist/chunks/bridgeConfig-Dmc1ZDev.js +1 -0
  67. package/dist/chunks/{bridgeConfig-jDEva6Eh.js → bridgeConfig-vORehbGG.js} +1 -1
  68. package/dist/chunks/{bridgeMessaging-YqYdl6ej.js → bridgeMessaging-DlczTV9X.js} +1 -1
  69. package/dist/chunks/{bridgePointer-DIM0sj0x.js → bridgePointer-D4W9GpWw.js} +1 -1
  70. package/dist/chunks/btw-DDUC_t0w.js +1 -0
  71. package/dist/chunks/caches-1IFb6_M_.js +1 -0
  72. package/dist/chunks/caches-CB8MHqy2.js +1 -0
  73. package/dist/chunks/{capacityWake-CKOiRELo.js → capacityWake-L7b1mMft.js} +1 -1
  74. package/dist/chunks/{ccrClient-BC2q3k44.js → ccrClient-CG6HTv_n.js} +1 -1
  75. package/dist/chunks/{claudeDesktop-DQXL5bGm.js → claudeDesktop-CAmnheYx.js} +1 -1
  76. package/dist/chunks/{clear-1etSJhdg.js → clear-DdWexxbM.js} +1 -1
  77. package/dist/chunks/{cliLaunch-CQjLYRzM.js → cliLaunch-BWWOgBFh.js} +1 -1
  78. package/dist/chunks/{client-DQwf_b9o.js → client-CoXtVRzi.js} +1 -1
  79. package/dist/chunks/client-Crrwkw7g.js +1 -0
  80. package/dist/chunks/client-D8hKghba.js +1 -0
  81. package/dist/chunks/color-Cuq0c6xy.js +1 -0
  82. package/dist/chunks/commands-D3sESsTp.js +1 -0
  83. package/dist/chunks/compact-DIpwuBDq.js +2 -0
  84. package/dist/chunks/config-CVvUNkj2.js +1 -0
  85. package/dist/chunks/config-D4G8_MqJ.js +3 -0
  86. package/dist/chunks/config-q9D4hFiK.js +1 -0
  87. package/dist/chunks/context-BWcfhhDj.js +1 -0
  88. package/dist/chunks/context-noninteractive-Bwt9A3XD.js +1 -0
  89. package/dist/chunks/{context-noninteractive-Ct_ttQfP.js → context-noninteractive-c7jGVWHQ.js} +2 -2
  90. package/dist/chunks/conversation-Bjo_8kia.js +1 -0
  91. package/dist/chunks/conversation-DrHZIQX2.js +1 -0
  92. package/dist/chunks/{createSSHSession-BmHXA2me.js → createSSHSession-DP7B8yvb.js} +1 -1
  93. package/dist/chunks/{createSession-C4rukWkv.js → createSession-CPo6GBSb.js} +1 -1
  94. package/dist/chunks/createSession-DnykRoia.js +1 -0
  95. package/dist/chunks/crossProjectResume-D2A-qjgP.js +40 -0
  96. package/dist/chunks/cwd--q1ONL7P.js +1 -0
  97. package/dist/chunks/{cwd-C5ce-7WB.js → cwd-L4wygFqJ.js} +1 -1
  98. package/dist/chunks/{daemon-ZtpTZWgQ.js → daemon-D2vFIVOz.js} +1 -1
  99. package/dist/chunks/datadog-DrmHyl3_.js +1 -0
  100. package/dist/chunks/{debug-RZ4NuXyS.js → debug-BdqxZ7rV.js} +4 -4
  101. package/dist/chunks/{debugUtils-D30M1cbN.js → debugUtils-CezNYZ-4.js} +1 -1
  102. package/dist/chunks/{detached-jrVP11oU.js → detached-CkPpYMJj.js} +1 -1
  103. package/dist/chunks/detectRepository-DA1Q_Skc.js +1 -0
  104. package/dist/chunks/{detectRepository-CFiHe6Rv.js → detectRepository-DvxoaPlk.js} +1 -1
  105. package/dist/chunks/{diff-BKiK3xHv.js → diff-DHzz9WAp.js} +1 -1
  106. package/dist/chunks/directoryCompletion-D5AvL7TF.js +1 -0
  107. package/dist/chunks/doctor-PWqB46xd.js +1 -0
  108. package/dist/chunks/entry-4JtoJONR.js +14 -0
  109. package/dist/chunks/envUtils-BDhHQY0-.js +1 -0
  110. package/dist/chunks/{esm-BLPbfHQd.js → esm-DcIr7tVd.js} +1 -1
  111. package/dist/chunks/{execFileNoThrow-CCX-JY8h.js → execFileNoThrow-5SylUnAI.js} +1 -1
  112. package/dist/chunks/{execSyncWrapper-dhRSYGFW.js → execSyncWrapper-DKuxVTaf.js} +1 -1
  113. package/dist/chunks/exit-OW9g7b9A.js +1 -0
  114. package/dist/chunks/extraUsage-Dt5mw35U.js +1 -0
  115. package/dist/chunks/extractMemories-1VlmCGwa.js +1 -0
  116. package/dist/chunks/fast-ClYQcEv5.js +1 -0
  117. package/dist/chunks/fast-CrvLdpy3.js +1 -0
  118. package/dist/chunks/fileSuggestions-fNxREjpe.js +3 -0
  119. package/dist/chunks/firstPartyEventLogger-BBXEQUf0.js +1 -0
  120. package/dist/chunks/firstPartyEventLogger-DhEPWcit.js +5 -0
  121. package/dist/chunks/{flushGate-Cnsu4HET.js → flushGate-ch-Tvwjj.js} +1 -1
  122. package/dist/chunks/{fpsMetrics-Cf_hdtiJ.js → fpsMetrics-DffAomdg.js} +1 -1
  123. package/dist/chunks/{gemini-Cudre91e.js → gemini-fZ0VPU2A.js} +1 -1
  124. package/dist/chunks/generateRecap-BIBVlB__.js +1 -0
  125. package/dist/chunks/generateSessionName-nZj_VvKZ.js +1 -0
  126. package/dist/chunks/{genericProcessUtils-DVfMHhfy.js → genericProcessUtils-BmDSLcMf.js} +1 -1
  127. package/dist/chunks/{git-BerW9bId.js → git-B9uvt96d.js} +1 -1
  128. package/dist/chunks/git-BfS5Hk4S.js +1 -0
  129. package/dist/chunks/githubRepoPathMapping-Cqx3pSfc.js +1 -0
  130. package/dist/chunks/goal-IasZVqKh.js +3 -0
  131. package/dist/chunks/grok-Dk3LyzMa.js +1 -0
  132. package/dist/chunks/grove-BE4fQ6tG.js +7 -0
  133. package/dist/chunks/help-D2-v9Ug9.js +1 -0
  134. package/dist/chunks/{hooks-BZJTWD07.js → hooks-BrKy5XWQ.js} +2 -2
  135. package/dist/chunks/hooks-DGd02IKF.js +1 -0
  136. package/dist/chunks/initReplBridge-RhCAlmHE.js +1 -0
  137. package/dist/chunks/{install-BI---dv0.js → install-CVGZ55wV.js} +1 -1
  138. package/dist/chunks/{instrumentation-CcWzhGfE.js → instrumentation-BmWotlxR.js} +4 -4
  139. package/dist/chunks/{job-B0ftcqPF.js → job-DEXxW_Zo.js} +1 -1
  140. package/dist/chunks/{jwtUtils-C0cE-1Ey.js → jwtUtils-C9sdGhvT.js} +1 -1
  141. package/dist/chunks/keybindings-BRdSOSUD.js +2 -0
  142. package/dist/chunks/language-C0cIpKE2.js +1 -0
  143. package/dist/chunks/{language-s-dLbdVz.js → language-CxThoWRC.js} +1 -1
  144. package/dist/chunks/launchLocalMemory-CLSSVFoj.js +3 -0
  145. package/dist/chunks/launchOnboarding-BkJfKviO.js +8 -0
  146. package/dist/chunks/loadAgentsDir-8UprzS4w.js +1 -0
  147. package/dist/chunks/{loadAgentsDir-ByO8eJqU.js → loadAgentsDir-CKSb56Gp.js} +673 -759
  148. package/dist/chunks/loadPluginHooks-LbaURHVH.js +1 -0
  149. package/dist/chunks/{localSearch-CHHCH16D.js → localSearch-CPOnyi8I.js} +1 -1
  150. package/dist/chunks/localSearch-DNjbr4S9.js +1 -0
  151. package/dist/chunks/{log-CZ0zYP_c.js → log-CTFl4qpD.js} +1 -1
  152. package/dist/chunks/logoV2Utils-we1sfJvf.js +1 -0
  153. package/dist/chunks/{magicDocs-C5i5ruuU.js → magicDocs-DmKlTQvK.js} +3 -3
  154. package/dist/chunks/main-BIiwW4mM.js +605 -0
  155. package/dist/chunks/{main-BLD4QAQg.js → main-ClXu1ilx.js} +2 -2
  156. package/dist/chunks/{managedEnv-C-9XSN14.js → managedEnv-Cl7YbYzf.js} +1 -1
  157. package/dist/chunks/managedEnv-CpiiQx_v.js +1 -0
  158. package/dist/chunks/{mappers-CHRFic5q.js → mappers-xQC-Z4-h.js} +1 -1
  159. package/dist/chunks/mcp-B_m1XBDt.js +6 -0
  160. package/dist/chunks/mcp-BiyfH9Sd.js +1 -0
  161. package/dist/chunks/mcp-BjlaPUWX.js +2 -0
  162. package/dist/chunks/{memoize-B8hfb1JN.js → memoize-FJv2HV1u.js} +1 -1
  163. package/dist/chunks/memory-LN8f_p2b.js +1 -0
  164. package/dist/chunks/{modalContext-DFjKLCB6.js → modalContext-CUThy6Ph.js} +1 -1
  165. package/dist/chunks/mode-lYTs0XHs.js +2 -0
  166. package/dist/chunks/model-C2e73CJD.js +1 -0
  167. package/dist/chunks/model-CvmS-Esk.js +1 -0
  168. package/dist/chunks/model-DJ8mFfuR.js +1 -0
  169. package/dist/chunks/modelOptions-efCGKnXT.js +1 -0
  170. package/dist/chunks/nativeInstaller-DQIFwdat.js +1 -0
  171. package/dist/chunks/oauth-BN2I0_jl.js +1 -0
  172. package/dist/chunks/oauth-C9VBDB0Y.js +1 -0
  173. package/dist/chunks/omit-CLPZGevl.js +1 -0
  174. package/dist/chunks/onChangeAppState-DhBO34OK.js +1 -0
  175. package/dist/chunks/{openai-DPH6rXOZ.js → openai-DJLYqiRl.js} +2 -2
  176. package/dist/chunks/{panel-mD094ALT.js → panel-q0_iT9cg.js} +1 -1
  177. package/dist/chunks/panelCall-sum-3zvi.js +1 -0
  178. package/dist/chunks/parser-BcdhBGx0.js +1 -0
  179. package/dist/chunks/{parser-dbHRgXb8.js → parser-BdCj2GrE.js} +1 -1
  180. package/dist/chunks/partition-CpfoVrg1.js +1 -0
  181. package/dist/chunks/permissions-DTb9wkAP.js +3 -0
  182. package/dist/chunks/pidLock-BR5M6RQw.js +3 -0
  183. package/dist/chunks/{pipeTransport-DVOKR4c_.js → pipeTransport-B3TIkTAp.js} +1 -1
  184. package/dist/chunks/plan-BeoIjNPv.js +1 -0
  185. package/dist/chunks/{platform-DCXXznJg.js → platform-D6IMiyqT.js} +1 -1
  186. package/dist/chunks/plugin-D_dHjTud.js +17 -0
  187. package/dist/chunks/pluginAutoupdate-BHKlOOXI.js +1 -0
  188. package/dist/chunks/pluginBlocklist-D93Hd1GF.js +1 -0
  189. package/dist/chunks/pluginCliCommands-vv0wNt4O.js +1 -0
  190. package/dist/chunks/{pluginFlagging-pBxSselw.js → pluginFlagging-CxuRF2Vc.js} +1 -1
  191. package/dist/chunks/pluginOperations-BTq4AjYB.js +2 -0
  192. package/dist/chunks/{pluginStartupCheck-Di4LjHXf.js → pluginStartupCheck-B6leNWq9.js} +1 -1
  193. package/dist/chunks/pluginStartupCheck-DBOCHUHQ.js +1 -0
  194. package/dist/chunks/plugins-pmipe7kE.js +4 -0
  195. package/dist/chunks/{poorMode-CYXmr_mU.js → poorMode-BxsyllUK.js} +1 -1
  196. package/dist/chunks/poorMode-iV1NwC5L.js +1 -0
  197. package/dist/chunks/print-CAUvczBM.js +23 -0
  198. package/dist/chunks/processBashCommand-CdeQg_c6.js +1 -0
  199. package/dist/chunks/processSlashCommand-CbkshIC6.js +5 -0
  200. package/dist/chunks/{projectContext-D9MDwJUF.js → projectContext-CIxul6vA.js} +1 -1
  201. package/dist/chunks/{projectContext-BaDZBAoK.js → projectContext-RUMJB798.js} +1 -1
  202. package/dist/chunks/prompt-CybUvG8G.js +139 -0
  203. package/dist/chunks/prompt-RBn4JdEg.js +1 -0
  204. package/dist/chunks/prompt-Rb8zXlDo.js +1 -0
  205. package/dist/chunks/promptEditor-0Ug93P2I.js +4 -0
  206. package/dist/chunks/{protocolHandler-RNKkhq91.js → protocolHandler-ClfbHTjI.js} +1 -1
  207. package/dist/chunks/{proxy-BmtEnJ02.js → proxy-Blq4W6Ox.js} +1 -1
  208. package/dist/chunks/reconciler-Drq3HSkj.js +4 -0
  209. package/dist/chunks/refresh-D8TLHO_T.js +1 -0
  210. package/dist/chunks/{registerProtocol-DoKqmqu2.js → registerProtocol-3_ozAuDK.js} +1 -1
  211. package/dist/chunks/reload-plugins-Dn1ibOiI.js +1 -0
  212. package/dist/chunks/{remoteBridgeCore-Cddqv2WW.js → remoteBridgeCore-Dpg6Se9C.js} +1 -1
  213. package/dist/chunks/remoteManagedSettings-CCrq-qL-.js +1 -0
  214. package/dist/chunks/rename-CKsSc7Z3.js +1 -0
  215. package/dist/chunks/{renderOptions-ChLwxtVu.js → renderOptions-CLcco6fc.js} +1 -1
  216. package/dist/chunks/replBridgeHandle-DNC797_T.js +1 -0
  217. package/dist/chunks/resume-B1a5gLVR.js +2 -0
  218. package/dist/chunks/ripgrep-BisRODQ2.js +1 -0
  219. package/dist/chunks/{ripgrep-gaT9Njwi.js → ripgrep-DkL2S7-I.js} +1 -1
  220. package/dist/chunks/{runtimeObserver-CsIwinzh.js → runtimeObserver-B0xfyLiA.js} +1 -1
  221. package/dist/chunks/{runtimeObserver-Dbxxw4ls.js → runtimeObserver-DonWCJOx.js} +4 -4
  222. package/dist/chunks/sandbox-adapter-BnBOSkKJ.js +1 -0
  223. package/dist/chunks/sandbox-toggle-CSdnHWp-.js +1 -0
  224. package/dist/chunks/searchExtraTools-DbgfnQkH.js +1 -0
  225. package/dist/chunks/session-BbQlh2S5.js +2 -0
  226. package/dist/chunks/sessionFileAccessHooks-Xfr1NiXG.js +1 -0
  227. package/dist/chunks/sessionMemory-7UOFdp29.js +1 -0
  228. package/dist/chunks/sessionMemory-fAzgAS7Q.js +1 -0
  229. package/dist/chunks/sessionMemoryUtils-DVjFw5Bd.js +1 -0
  230. package/dist/chunks/sessionObserver-Cl26OdaW.js +1 -0
  231. package/dist/chunks/{sessionObserver-DoYc0ZOP.js → sessionObserver-XV6N0XER.js} +2 -2
  232. package/dist/chunks/{sessionState-CjNY991n.js → sessionState-BvECKycx.js} +1 -1
  233. package/dist/chunks/sessionStorage-DSj9yZkl.js +1 -0
  234. package/dist/chunks/{sessionStoragePortable-Cx6JQ5Ye.js → sessionStoragePortable-JZnGwqUM.js} +1 -1
  235. package/dist/chunks/sessionTitle-E1FvsKM9.js +14 -0
  236. package/dist/chunks/sessionTracing-ClGQ08jM.js +11 -0
  237. package/dist/chunks/settings-B-R9ZJNY.js +1 -0
  238. package/dist/chunks/settings-Xbq6AaD-.js +20 -0
  239. package/dist/chunks/settingsSync-NCN0a4sc.js +1 -0
  240. package/dist/chunks/setup-uZ0dSekt.js +3 -0
  241. package/dist/chunks/shadowedRuleDetection-B9iSx6mB.js +1 -0
  242. package/dist/chunks/{shellQuote-BUVKMu_P.js → shellQuote-Bth6IZgX.js} +1 -1
  243. package/dist/chunks/{sideQuestion-C780iYwd.js → sideQuestion-D2dPToW8.js} +3 -3
  244. package/dist/chunks/sinks-C7q46rvE.js +2 -0
  245. package/dist/chunks/sinks-D3bXeHlQ.js +1 -0
  246. package/dist/chunks/skillChangeDetector-C1EJ7rUL.js +1 -0
  247. package/dist/chunks/{skillGapStore-Dc1arohs.js → skillGapStore-DylpOKJ6.js} +2 -2
  248. package/dist/chunks/{skillLifecycle-DP6mY1Kp.js → skillLifecycle-GK-8eyyn.js} +2 -2
  249. package/dist/chunks/{skillSearchPanel-CpLTImaL.js → skillSearchPanel-mpaC62y4.js} +4 -4
  250. package/dist/chunks/skills-t6krW8GZ.js +1 -0
  251. package/dist/chunks/{src-CDCSSo0U2.js → src-P_wYS_NJ2.js} +1 -1
  252. package/dist/chunks/{src-CST_jFnT.js → src-r6ZFgWPx2.js} +1 -1
  253. package/dist/chunks/startupProfiler-BaiXZ9tr.js +1 -0
  254. package/dist/chunks/{startupProfiler-DCn_NxMH.js → startupProfiler-jeId9f2i.js} +2 -2
  255. package/dist/chunks/state-B4HwLt8i.js +1 -0
  256. package/dist/chunks/{state-Cn_m2NOf.js → state-BAGmpVBn.js} +1 -1
  257. package/dist/chunks/state-Bs5xweDL.js +1 -0
  258. package/dist/chunks/{staticRender-BIxpgNUq.js → staticRender-DrU6eWoq.js} +1 -1
  259. package/dist/chunks/{stats-Duk7_xjQ.js → stats-BJBhl-Lc.js} +1 -1
  260. package/dist/chunks/{status-peiVB_2j.js → status-BtsnKNVY.js} +1 -1
  261. package/dist/chunks/status-nZQEar7T.js +2 -0
  262. package/dist/chunks/{statusNoticeHelpers-B5U5c9PE.js → statusNoticeHelpers-DMqRGFOh.js} +1 -1
  263. package/dist/chunks/{stringUtils-B6FudhoZ.js → stringUtils-CbS6OkmE.js} +1 -1
  264. package/dist/chunks/subprocessEnv-CZkA9Cdp.js +1 -0
  265. package/dist/chunks/{subprocessEnv-vrwzMgKn.js → subprocessEnv-Ci8VV_bi.js} +1 -1
  266. package/dist/chunks/{switcher-BAMqSX7Z.js → switcher-77h2J5HC.js} +1 -1
  267. package/dist/chunks/switcher-B2CYzCC_.js +1 -0
  268. package/dist/chunks/{syncCache-Zl9kZRRl.js → syncCache-By_-buUC.js} +1 -1
  269. package/dist/chunks/tasks-BNrdmF9p.js +1 -0
  270. package/dist/chunks/teleport-mdnhIZBj.js +1 -0
  271. package/dist/chunks/{templateJobs-DR5fKFiO.js → templateJobs-Dkv4I9c1.js} +1 -1
  272. package/dist/chunks/{terminalSetup-DgRBt-JJ.js → terminalSetup-DQopnSPR.js} +1 -1
  273. package/dist/chunks/terminalSetup-DTGm1Eo2.js +33 -0
  274. package/dist/chunks/{theme-Bz6esfST.js → theme-BjpBVRf5.js} +1 -1
  275. package/dist/chunks/{tmux-DSU9tYIo.js → tmux-CMRiI6CD.js} +1 -1
  276. package/dist/chunks/{toolEventObserver-BSekCkM2.js → toolEventObserver-D-sNBvOe.js} +1 -1
  277. package/dist/chunks/toolPool-Di30gn_Y.js +1 -0
  278. package/dist/chunks/trustedDevice-CupLMpO8.js +1 -0
  279. package/dist/chunks/{trustedDevice-B0x9X0fb.js → trustedDevice-j1u2TG5U.js} +1 -1
  280. package/dist/chunks/{types-D7_37tP2.js → types-DWRxAH0E.js} +1 -1
  281. package/dist/chunks/{udsClient-CHoMMH28.js → udsClient-Cm3HqYUu.js} +1 -1
  282. package/dist/chunks/{updateCCB-D_kGQKPT.js → updateCCB-BlUAU2Vp.js} +8 -8
  283. package/dist/chunks/{upstreamproxy-Hmq-n8fw.js → upstreamproxy-DDVMwoRi.js} +1 -1
  284. package/dist/chunks/useExitOnCtrlCDWithKeybindings-D2FvHieH.js +1 -0
  285. package/dist/chunks/useMainLoopModel-ylPQNj7Z.js +1 -0
  286. package/dist/chunks/useManagePlugins-BbWJNLe8.js +1 -0
  287. package/dist/chunks/useMergedTools-B-Z9XQ6U.js +1 -0
  288. package/dist/chunks/useSearchInput-C6d6nt9S.js +1 -0
  289. package/dist/chunks/useSettingsErrors-DKh4rkGi.js +1 -0
  290. package/dist/chunks/{userAgent-BxTG7IMk.js → userAgent-Ng_TTjWr.js} +1 -1
  291. package/dist/chunks/util-D-X8i5Z2.js +1 -0
  292. package/dist/chunks/validatePlugin-DSw08u76.js +1 -0
  293. package/dist/chunks/vim-3mUqsEJm.js +1 -0
  294. package/dist/chunks/{which-CHLNJmtJ.js → which-DznMOwny.js} +1 -1
  295. package/dist/chunks/windowsPaths-1mgenSWa.js +1 -0
  296. package/dist/chunks/{windowsPaths-o62uq6LF.js → windowsPaths-BVztIhXM.js} +1 -1
  297. package/dist/chunks/{workSecret-DG9shvG0.js → workSecret-DtiFreRl.js} +1 -1
  298. package/dist/chunks/workerRegistry-DdOYjLm3.js +6 -0
  299. package/dist/chunks/worktree-BX1ULzrw.js +1 -0
  300. package/dist/cli.js +1 -1
  301. package/package.json +1 -1
  302. package/dist/chunks/AddWorkspaceDirectory-CwLtQld4.js +0 -1
  303. package/dist/chunks/App-Ba52HvYC.js +0 -1
  304. package/dist/chunks/ApproveApiKey-CEIfuUh0.js +0 -1
  305. package/dist/chunks/ApproveApiKey-D2MLQu2P.js +0 -1
  306. package/dist/chunks/BackgroundTasksDialog-IGDrkbWl.js +0 -2
  307. package/dist/chunks/BypassPermissionsModeDialog-GYhq--JR.js +0 -1
  308. package/dist/chunks/ClaudeMdExternalIncludesDialog-C-CTa-95.js +0 -1
  309. package/dist/chunks/ClaudeMdExternalIncludesDialog-Catv6BCJ.js +0 -1
  310. package/dist/chunks/ConsoleOAuthFlow-BeQXqUtX.js +0 -1
  311. package/dist/chunks/DiffDialog-AC5DSJrq.js +0 -6
  312. package/dist/chunks/Doctor-B9Rxsoy0.js +0 -1
  313. package/dist/chunks/Doctor-lhUBhEy5.js +0 -3
  314. package/dist/chunks/ExitFlow-Cu8SoQHs.js +0 -2
  315. package/dist/chunks/Grove-Bc4CofEj.js +0 -11
  316. package/dist/chunks/InvalidConfigDialog-BI13il58.js +0 -1
  317. package/dist/chunks/InvalidSettingsDialog-CtOheV1K.js +0 -1
  318. package/dist/chunks/MCPConnectionManager-ao-P3xSA.js +0 -1
  319. package/dist/chunks/MCPToolListView-dkofcJs4.js +0 -1
  320. package/dist/chunks/McpParsingWarnings-BS4JoR5l.js +0 -1
  321. package/dist/chunks/MessageSelector-B88b2ypw.js +0 -3
  322. package/dist/chunks/Messages-BPeI7lLV.js +0 -11
  323. package/dist/chunks/Onboarding-c2fQ8Io_.js +0 -1
  324. package/dist/chunks/PromptInputFooterSuggestions-D1cH9sDX.js +0 -1
  325. package/dist/chunks/PromptInputHelpMenu-DDD5WuK0.js +0 -1
  326. package/dist/chunks/QueryEngine-Cv_meCam.js +0 -1
  327. package/dist/chunks/REPL-BXhAQOXb.js +0 -139
  328. package/dist/chunks/REPL-YqjLnr3A.js +0 -1
  329. package/dist/chunks/RemoteSessionManager-CT7T8BaR.js +0 -2
  330. package/dist/chunks/ResumeConversation-CIZCjms9.js +0 -1
  331. package/dist/chunks/SearchExtraToolsTool-Dx6093yw.js +0 -1
  332. package/dist/chunks/Settings-CyUm0AtU.js +0 -2
  333. package/dist/chunks/TeleportProgress-C3qyp5zy.js +0 -1
  334. package/dist/chunks/TeleportRepoMismatchDialog-BV--nyYn.js +0 -1
  335. package/dist/chunks/TeleportResumeWrapper-Blo2cZg-.js +0 -1
  336. package/dist/chunks/ThemePicker-EQ6hPUeI.js +0 -1
  337. package/dist/chunks/add-dir-DPQV0qml.js +0 -1
  338. package/dist/chunks/agents-DmybpgDN.js +0 -103
  339. package/dist/chunks/allErrors-BPn_2TrB.js +0 -1
  340. package/dist/chunks/analytics-CkYUHW_U.js +0 -1
  341. package/dist/chunks/ant-DjdvlLOo.js +0 -1
  342. package/dist/chunks/api-AMgj1zf_.js +0 -1
  343. package/dist/chunks/asciicast-BJNYO5sh.js +0 -4
  344. package/dist/chunks/asciicast-CH6hdK0a.js +0 -1
  345. package/dist/chunks/auth-CNjDn1VY.js +0 -15
  346. package/dist/chunks/auth-CZzP483s.js +0 -1
  347. package/dist/chunks/auth-DDSBm_Yj.js +0 -1
  348. package/dist/chunks/autonomy-D4xZLOdJ.js +0 -15
  349. package/dist/chunks/backgroundHousekeeping--eBgphcg.js +0 -17
  350. package/dist/chunks/backgroundHousekeeping-VV1V_Y2Z.js +0 -1
  351. package/dist/chunks/bg-BK_9J6F6.js +0 -1
  352. package/dist/chunks/branch-BYq0zpzT.js +0 -3
  353. package/dist/chunks/bridgeConfig-C82un7rJ.js +0 -1
  354. package/dist/chunks/btw-CUV3nRrE.js +0 -1
  355. package/dist/chunks/caches-BZ59_En6.js +0 -1
  356. package/dist/chunks/caches-Cg-HtWKG.js +0 -1
  357. package/dist/chunks/client-DQXvVKND.js +0 -1
  358. package/dist/chunks/client-DkgC-mFB.js +0 -1
  359. package/dist/chunks/color-CBsNbt1s.js +0 -1
  360. package/dist/chunks/commands-qM5z_Uld.js +0 -1
  361. package/dist/chunks/compact-BclJiRJe.js +0 -2
  362. package/dist/chunks/completionCache-BMHAktkM.js +0 -1
  363. package/dist/chunks/config-CE058cvr.js +0 -3
  364. package/dist/chunks/config-D81avYye.js +0 -1
  365. package/dist/chunks/config-DpOOllGk.js +0 -1
  366. package/dist/chunks/context-noninteractive-DJb8H_hN.js +0 -1
  367. package/dist/chunks/context-sR9fJmXE.js +0 -1
  368. package/dist/chunks/conversation-D48Kt3ar.js +0 -1
  369. package/dist/chunks/conversation-fOFTa7k5.js +0 -1
  370. package/dist/chunks/createSession-CSwlW2T2.js +0 -1
  371. package/dist/chunks/crossProjectResume-lDFB2ZcY.js +0 -40
  372. package/dist/chunks/cwd-5Xr-Qka6.js +0 -1
  373. package/dist/chunks/datadog-BJn5ECIu.js +0 -1
  374. package/dist/chunks/detectRepository-DqQvyj_a.js +0 -1
  375. package/dist/chunks/directoryCompletion-BagQcynj.js +0 -1
  376. package/dist/chunks/doctor-BEHYm34V.js +0 -1
  377. package/dist/chunks/entry-BzL1MFQG.js +0 -14
  378. package/dist/chunks/envUtils-DSxRz_kt.js +0 -1
  379. package/dist/chunks/eventLoopStallDetector-Cg_RXU1q.js +0 -1
  380. package/dist/chunks/exit-DE2YiAhQ.js +0 -1
  381. package/dist/chunks/extraUsage-Dw7AXiH7.js +0 -1
  382. package/dist/chunks/extractMemories-DxTUMiv3.js +0 -1
  383. package/dist/chunks/fast-CHmMkIpE.js +0 -1
  384. package/dist/chunks/fast-uQASHWqR.js +0 -1
  385. package/dist/chunks/fileSuggestions-Dyu2kQtE.js +0 -3
  386. package/dist/chunks/firstPartyEventLogger-D5ohKbIe.js +0 -5
  387. package/dist/chunks/firstPartyEventLogger-LsNY6yOt.js +0 -1
  388. package/dist/chunks/generateRecap-CiFxXlmH.js +0 -1
  389. package/dist/chunks/generateSessionName-DitoBxJT.js +0 -1
  390. package/dist/chunks/git-D6dOU2mT.js +0 -1
  391. package/dist/chunks/githubRepoPathMapping-DGr0kJ8D.js +0 -1
  392. package/dist/chunks/goal-DuUayfDg.js +0 -3
  393. package/dist/chunks/grok-tRbmZzEh.js +0 -1
  394. package/dist/chunks/grove-Cv19v6Sv.js +0 -7
  395. package/dist/chunks/help-DkqxbFDM.js +0 -1
  396. package/dist/chunks/hooks-CsP42iOp.js +0 -1
  397. package/dist/chunks/initReplBridge-DdsSWVqN.js +0 -1
  398. package/dist/chunks/keybindings-DZU3vwo3.js +0 -2
  399. package/dist/chunks/language-DHhXLb_Y.js +0 -1
  400. package/dist/chunks/launchLocalMemory-twLxpPvg.js +0 -3
  401. package/dist/chunks/launchOnboarding-BWz2XSb9.js +0 -8
  402. package/dist/chunks/lib-rQZENxQg.js +0 -8
  403. package/dist/chunks/loadAgentsDir-CMNFLt7R.js +0 -1
  404. package/dist/chunks/loadPluginHooks-BPnxcgrL.js +0 -1
  405. package/dist/chunks/localSearch-DzQODFap.js +0 -1
  406. package/dist/chunks/logoV2Utils-CGUJ-5gY.js +0 -1
  407. package/dist/chunks/main-D4Uk-WUs.js +0 -862
  408. package/dist/chunks/managedEnv-DLVRBaA9.js +0 -1
  409. package/dist/chunks/mcp-BMVdGknC.js +0 -1
  410. package/dist/chunks/mcp-COS5RJFS.js +0 -6
  411. package/dist/chunks/mcp-tGsOW1GN.js +0 -2
  412. package/dist/chunks/memory-DR6poqeH.js +0 -1
  413. package/dist/chunks/mode-QV-NW1Wd.js +0 -2
  414. package/dist/chunks/model-BF_4ebyl.js +0 -1
  415. package/dist/chunks/model-BNU_ulDJ.js +0 -1
  416. package/dist/chunks/model-CwO-g1RW.js +0 -1
  417. package/dist/chunks/nativeInstaller-B-lNJjM-.js +0 -1
  418. package/dist/chunks/oauth-BqJqV-2M.js +0 -1
  419. package/dist/chunks/oauth-C8X_p8Gc.js +0 -1
  420. package/dist/chunks/omit-DZCEXri5.js +0 -1
  421. package/dist/chunks/onChangeAppState-BmfM5g-D.js +0 -1
  422. package/dist/chunks/p-map-B1EeBuI8.js +0 -1
  423. package/dist/chunks/p-map-HKDr3iDo.js +0 -1
  424. package/dist/chunks/panelCall-SbffM7G4.js +0 -1
  425. package/dist/chunks/parser-DrBC8nWp.js +0 -1
  426. package/dist/chunks/partition-DKuAFJkc.js +0 -1
  427. package/dist/chunks/path-Cv9QMBAX.js +0 -1
  428. package/dist/chunks/permissions-ey-bfanE.js +0 -3
  429. package/dist/chunks/pidLock-DJnS_38v.js +0 -3
  430. package/dist/chunks/plan-Brg9XnRr.js +0 -1
  431. package/dist/chunks/plugin-CRwa39Y1.js +0 -17
  432. package/dist/chunks/pluginAutoupdate-D0LIP7cy.js +0 -1
  433. package/dist/chunks/pluginBlocklist-PwHHD3nj.js +0 -1
  434. package/dist/chunks/pluginCliCommands-BJM5Bdpf.js +0 -1
  435. package/dist/chunks/pluginOperations-C7p_Qr2r.js +0 -2
  436. package/dist/chunks/pluginStartupCheck-C0HqhG6D.js +0 -1
  437. package/dist/chunks/plugins-DUKNjLq6.js +0 -4
  438. package/dist/chunks/poorMode-CejPNCp-.js +0 -1
  439. package/dist/chunks/print-gyTOCJzk.js +0 -23
  440. package/dist/chunks/processBashCommand-Cze9vCm6.js +0 -1
  441. package/dist/chunks/processSlashCommand-BRajh1v7.js +0 -5
  442. package/dist/chunks/prompt-B7joRiqj.js +0 -139
  443. package/dist/chunks/prompt-DqSMh2x9.js +0 -1
  444. package/dist/chunks/prompt-Eysh8Et_.js +0 -1
  445. package/dist/chunks/promptEditor-R_acDAgI.js +0 -4
  446. package/dist/chunks/reconciler-BfkO6X2X.js +0 -4
  447. package/dist/chunks/refresh-C1X3sptR.js +0 -1
  448. package/dist/chunks/reload-plugins-C0osFcNh.js +0 -1
  449. package/dist/chunks/remoteManagedSettings-B1mnRDmA.js +0 -1
  450. package/dist/chunks/rename-B3tf-YiD.js +0 -1
  451. package/dist/chunks/replBridgeHandle-CNwNIijW.js +0 -1
  452. package/dist/chunks/resume-Be1G_GBL.js +0 -2
  453. package/dist/chunks/ripgrep-C2PhTJDh.js +0 -1
  454. package/dist/chunks/rollback-BPWRKlIZ.js +0 -11
  455. package/dist/chunks/sandbox-adapter-C6GBuJPB.js +0 -1
  456. package/dist/chunks/sandbox-toggle-jEySONTW.js +0 -1
  457. package/dist/chunks/sdkHeapDumpMonitor-WdXUV7DV.js +0 -1
  458. package/dist/chunks/searchExtraTools-C_UTryh_.js +0 -1
  459. package/dist/chunks/session-DDI1Eb2x.js +0 -2
  460. package/dist/chunks/sessionDataUploader-CaCjwsA2.js +0 -1
  461. package/dist/chunks/sessionFileAccessHooks-DfJ7Htfl.js +0 -1
  462. package/dist/chunks/sessionMemory-CQBxPkTQ.js +0 -1
  463. package/dist/chunks/sessionMemory-s0ALUHvc.js +0 -1
  464. package/dist/chunks/sessionMemoryUtils-xt7dTHGC.js +0 -1
  465. package/dist/chunks/sessionObserver-C2sYqWL3.js +0 -1
  466. package/dist/chunks/sessionStorage-DqsY-7pi.js +0 -1
  467. package/dist/chunks/sessionTitle-B0OYf5nM.js +0 -14
  468. package/dist/chunks/sessionTracing-CwsXt_uA.js +0 -11
  469. package/dist/chunks/settings-BWtOA9A7.js +0 -1
  470. package/dist/chunks/settings-hQDLwPVj.js +0 -20
  471. package/dist/chunks/settingsSync-DdFagwHV.js +0 -1
  472. package/dist/chunks/setup-DzC22EkN.js +0 -3
  473. package/dist/chunks/shadowedRuleDetection-C86PTj1m.js +0 -1
  474. package/dist/chunks/sinks-5G_xhc1Q.js +0 -1
  475. package/dist/chunks/sinks-Cftq7Es0.js +0 -2
  476. package/dist/chunks/skillChangeDetector-plLveEbf.js +0 -1
  477. package/dist/chunks/skills-zGYaYfFV.js +0 -1
  478. package/dist/chunks/startupProfiler-JbpAkfNE.js +0 -1
  479. package/dist/chunks/state-C2OSZkV1.js +0 -1
  480. package/dist/chunks/state-DU9lRJ9x.js +0 -1
  481. package/dist/chunks/status-CFw-FpZM.js +0 -2
  482. package/dist/chunks/subprocessEnv-BSQSomcK.js +0 -1
  483. package/dist/chunks/switcher-hgBgVzLb.js +0 -1
  484. package/dist/chunks/tasks-BxpyRhmD.js +0 -1
  485. package/dist/chunks/teleport-CwxeD5vL.js +0 -1
  486. package/dist/chunks/terminalSetup-DlaFWI81.js +0 -33
  487. package/dist/chunks/toolPool-B7SIoDw5.js +0 -1
  488. package/dist/chunks/trustedDevice-CjHQtVkO.js +0 -1
  489. package/dist/chunks/up-B8wBSpLg.js +0 -12
  490. package/dist/chunks/useExitOnCtrlCDWithKeybindings-Cce612uS.js +0 -1
  491. package/dist/chunks/useMainLoopModel-BICP6_Fi.js +0 -1
  492. package/dist/chunks/useManagePlugins-DtbY_vPL.js +0 -1
  493. package/dist/chunks/useMergedTools-Ckx2IEhF.js +0 -1
  494. package/dist/chunks/useSearchInput-BAgljZUl.js +0 -1
  495. package/dist/chunks/useSettingsErrors-CAJR_wpd.js +0 -1
  496. package/dist/chunks/util-DDtmyq_r.js +0 -1
  497. package/dist/chunks/validatePlugin-AHl-g4ct.js +0 -1
  498. package/dist/chunks/vim-kg-mRVbu.js +0 -1
  499. package/dist/chunks/windowsPaths-Pmx8LDR6.js +0 -1
  500. package/dist/chunks/workerRegistry-C7H_lsQX.js +0 -6
  501. package/dist/chunks/worktree-O2p-mJdF.js +0 -1
@@ -1,5 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{l as r,n as i,o as a}from"./envUtils-DSxRz_kt.js";import{n as o,t as s}from"./defineProperty-C-QyHrDq.js";import{T as c,w as l,y as u}from"./esm-Cb-L4oAk.js";import{n as d,t as f}from"./axios-DaWTGg7G.js";import{$t as p,mt as m,z as ee}from"./state-C2OSZkV1.js";import{n as te,t as ne}from"./cwd-C5ce-7WB.js";import{F as h,H as re,S as g,W as ie,a as _,l as v,w as y,z as ae}from"./debug-RZ4NuXyS.js";import{Jt as oe,qt as se}from"./settings-hQDLwPVj.js";import{c as ce,f as le,g as b,n as ue}from"./config-CE058cvr.js";import{c as de,o as fe}from"./execFileNoThrow-CCX-JY8h.js";import{d as pe,o as x,p as S,s as C}from"./log-CZ0zYP_c.js";import{a as me,i as he,o as ge}from"./platform-DCXXznJg.js";import{l as _e,s as ve}from"./types-D7_37tP2.js";import{i as ye,n as be}from"./analytics-CkYUHW_U.js";import{i as w,n as xe}from"./startupProfiler-DCn_NxMH.js";import{$n as Se,Bt as T,Fr as Ce,Ft as we,Gt as Te,Ir as Ee,Nt as De,Ot as Oe,_n as ke,jt as E,nr as Ae,vn as je,zt as Me}from"./model-CwO-g1RW.js";import{n as Ne,t as Pe}from"./userAgent-BxTG7IMk.js";import{Z as Fe,_ as Ie,c as Le,et as D,it as Re,n as ze,o as Be,t as Ve,v as He,w as O}from"./esm-BLPbfHQd.js";import*as k from"path";import{randomUUID as Ue}from"crypto";import{appendFile as We,mkdir as A,readdir as Ge,unlink as Ke,writeFile as qe}from"fs/promises";function j(){return r(process.env.CLAUDE_CODE_USE_BEDROCK)||r(process.env.CLAUDE_CODE_USE_VERTEX)||r(process.env.CLAUDE_CODE_USE_FOUNDRY)||S()}function Je(){return S()}var M=e((()=>{a(),pe()}));async function Ye(){N===null&&!P&&(P=Qe(),N=await P,P=null,F.cache.clear?.())}function Xe(){N=null,P=null,F.cache.clear?.(),I.cache.clear?.()}function Ze(){if(N!==null)return N;let e=E();if(e?.emailAddress)return e.emailAddress;if(process.env.USER_TYPE===`ant`&&process.env.COO_CREATOR)return`${process.env.COO_CREATOR}@anthropic.com`}async function Qe(){let e=E();if(e?.emailAddress)return e.emailAddress;if(process.env.USER_TYPE===`ant`)return process.env.COO_CREATOR?`${process.env.COO_CREATOR}@anthropic.com`:I()}var N,P,F,I,$e=e((()=>{de(),n(),p(),T(),b(),te(),oe(),a(),N=null,P=null,F=t(e=>{let t=le(),n=ce(),i,a,o;if(e&&(i=we()??void 0,a=De()??void 0,i&&n.claudeCodeFirstTokenDate)){let e=new Date(n.claudeCodeFirstTokenDate).getTime();isNaN(e)||(o=e)}let s=E(),c=s?.organizationUuid,l=s?.accountUuid;return{deviceId:t,sessionId:m(),email:Ze(),appVersion:`0.0.8`,platform:se(),organizationUuid:c,accountUuid:l,userType:process.env.USER_TYPE,subscriptionType:i,rateLimitTier:a,firstTokenTime:o,...r(process.env.GITHUB_ACTIONS)&&{githubActionsMetadata:{actor:process.env.GITHUB_ACTOR,actorId:process.env.GITHUB_ACTOR_ID,repository:process.env.GITHUB_REPOSITORY,repositoryId:process.env.GITHUB_REPOSITORY_ID,repositoryOwner:process.env.GITHUB_REPOSITORY_OWNER,repositoryOwnerId:process.env.GITHUB_REPOSITORY_OWNER_ID}}}}),I=t(async()=>{let e=await fe(`git config --get user.email`,{shell:!0,reject:!1,cwd:ne()});return e.exitCode===0&&e.stdout?e.stdout.trim():void 0})}));function et(){return{seconds:0,nanos:0}}function tt(e){return e!=null}var L,nt=e((()=>{L={fromJSON(e){return{seconds:tt(e.seconds)?globalThis.Number(e.seconds):0,nanos:tt(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},create(e){return L.fromPartial(e??{})},fromPartial(e){let t=et();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}}}));function rt(){return{account_id:0,organization_uuid:``,account_uuid:``}}function R(e){return e!=null}var z,it=e((()=>{z={fromJSON(e){return{account_id:R(e.account_id)?globalThis.Number(e.account_id):0,organization_uuid:R(e.organization_uuid)?globalThis.String(e.organization_uuid):``,account_uuid:R(e.account_uuid)?globalThis.String(e.account_uuid):``}},toJSON(e){let t={};return e.account_id!==void 0&&(t.account_id=Math.round(e.account_id)),e.organization_uuid!==void 0&&(t.organization_uuid=e.organization_uuid),e.account_uuid!==void 0&&(t.account_uuid=e.account_uuid),t},create(e){return z.fromPartial(e??{})},fromPartial(e){let t=rt();return t.account_id=e.account_id??0,t.organization_uuid=e.organization_uuid??``,t.account_uuid=e.account_uuid??``,t}}}));function at(){return{actor_id:``,repository_id:``,repository_owner_id:``}}function ot(){return{platform:``,node_version:``,terminal:``,package_managers:``,runtimes:``,is_running_with_bun:!1,is_ci:!1,is_claubbit:!1,is_github_action:!1,is_claude_code_action:!1,is_claude_ai_auth:!1,version:``,github_event_name:``,github_actions_runner_environment:``,github_actions_runner_os:``,github_action_ref:``,wsl_version:``,github_actions_metadata:void 0,arch:``,is_claude_code_remote:!1,remote_environment_type:``,claude_code_container_id:``,claude_code_remote_session_id:``,tags:[],deployment_environment:``,is_conductor:!1,version_base:``,coworker_type:``,build_time:``,is_local_agent_mode:!1,linux_distro_id:``,linux_distro_version:``,linux_kernel:``,vcs:``,platform_raw:``}}function st(){return{slack_team_id:``,is_enterprise_install:!1,trigger:``,creation_method:``}}function ct(){return{event_name:``,client_timestamp:void 0,model:``,session_id:``,user_type:``,betas:``,env:void 0,entrypoint:``,agent_sdk_version:``,is_interactive:!1,client_type:``,process:``,additional_metadata:``,auth:void 0,server_timestamp:void 0,event_id:``,device_id:``,swe_bench_run_id:``,swe_bench_instance_id:``,swe_bench_task_id:``,email:``,agent_id:``,parent_session_id:``,agent_type:``,slack:void 0,team_name:``,skill_name:``,plugin_name:``,marketplace_name:``}}function lt(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function B(e){return e instanceof globalThis.Date?e:typeof e==`string`?new globalThis.Date(e):lt(L.fromJSON(e))}function V(e){return e!=null}var H,U,W,G,ut=e((()=>{nt(),it(),H={fromJSON(e){return{actor_id:V(e.actor_id)?globalThis.String(e.actor_id):``,repository_id:V(e.repository_id)?globalThis.String(e.repository_id):``,repository_owner_id:V(e.repository_owner_id)?globalThis.String(e.repository_owner_id):``}},toJSON(e){let t={};return e.actor_id!==void 0&&(t.actor_id=e.actor_id),e.repository_id!==void 0&&(t.repository_id=e.repository_id),e.repository_owner_id!==void 0&&(t.repository_owner_id=e.repository_owner_id),t},create(e){return H.fromPartial(e??{})},fromPartial(e){let t=at();return t.actor_id=e.actor_id??``,t.repository_id=e.repository_id??``,t.repository_owner_id=e.repository_owner_id??``,t}},U={fromJSON(e){return{platform:V(e.platform)?globalThis.String(e.platform):``,node_version:V(e.node_version)?globalThis.String(e.node_version):``,terminal:V(e.terminal)?globalThis.String(e.terminal):``,package_managers:V(e.package_managers)?globalThis.String(e.package_managers):``,runtimes:V(e.runtimes)?globalThis.String(e.runtimes):``,is_running_with_bun:V(e.is_running_with_bun)?globalThis.Boolean(e.is_running_with_bun):!1,is_ci:V(e.is_ci)?globalThis.Boolean(e.is_ci):!1,is_claubbit:V(e.is_claubbit)?globalThis.Boolean(e.is_claubbit):!1,is_github_action:V(e.is_github_action)?globalThis.Boolean(e.is_github_action):!1,is_claude_code_action:V(e.is_claude_code_action)?globalThis.Boolean(e.is_claude_code_action):!1,is_claude_ai_auth:V(e.is_claude_ai_auth)?globalThis.Boolean(e.is_claude_ai_auth):!1,version:V(e.version)?globalThis.String(e.version):``,github_event_name:V(e.github_event_name)?globalThis.String(e.github_event_name):``,github_actions_runner_environment:V(e.github_actions_runner_environment)?globalThis.String(e.github_actions_runner_environment):``,github_actions_runner_os:V(e.github_actions_runner_os)?globalThis.String(e.github_actions_runner_os):``,github_action_ref:V(e.github_action_ref)?globalThis.String(e.github_action_ref):``,wsl_version:V(e.wsl_version)?globalThis.String(e.wsl_version):``,github_actions_metadata:V(e.github_actions_metadata)?H.fromJSON(e.github_actions_metadata):void 0,arch:V(e.arch)?globalThis.String(e.arch):``,is_claude_code_remote:V(e.is_claude_code_remote)?globalThis.Boolean(e.is_claude_code_remote):!1,remote_environment_type:V(e.remote_environment_type)?globalThis.String(e.remote_environment_type):``,claude_code_container_id:V(e.claude_code_container_id)?globalThis.String(e.claude_code_container_id):``,claude_code_remote_session_id:V(e.claude_code_remote_session_id)?globalThis.String(e.claude_code_remote_session_id):``,tags:globalThis.Array.isArray(e?.tags)?e.tags.map(e=>globalThis.String(e)):[],deployment_environment:V(e.deployment_environment)?globalThis.String(e.deployment_environment):``,is_conductor:V(e.is_conductor)?globalThis.Boolean(e.is_conductor):!1,version_base:V(e.version_base)?globalThis.String(e.version_base):``,coworker_type:V(e.coworker_type)?globalThis.String(e.coworker_type):``,build_time:V(e.build_time)?globalThis.String(e.build_time):``,is_local_agent_mode:V(e.is_local_agent_mode)?globalThis.Boolean(e.is_local_agent_mode):!1,linux_distro_id:V(e.linux_distro_id)?globalThis.String(e.linux_distro_id):``,linux_distro_version:V(e.linux_distro_version)?globalThis.String(e.linux_distro_version):``,linux_kernel:V(e.linux_kernel)?globalThis.String(e.linux_kernel):``,vcs:V(e.vcs)?globalThis.String(e.vcs):``,platform_raw:V(e.platform_raw)?globalThis.String(e.platform_raw):``}},toJSON(e){let t={};return e.platform!==void 0&&(t.platform=e.platform),e.node_version!==void 0&&(t.node_version=e.node_version),e.terminal!==void 0&&(t.terminal=e.terminal),e.package_managers!==void 0&&(t.package_managers=e.package_managers),e.runtimes!==void 0&&(t.runtimes=e.runtimes),e.is_running_with_bun!==void 0&&(t.is_running_with_bun=e.is_running_with_bun),e.is_ci!==void 0&&(t.is_ci=e.is_ci),e.is_claubbit!==void 0&&(t.is_claubbit=e.is_claubbit),e.is_github_action!==void 0&&(t.is_github_action=e.is_github_action),e.is_claude_code_action!==void 0&&(t.is_claude_code_action=e.is_claude_code_action),e.is_claude_ai_auth!==void 0&&(t.is_claude_ai_auth=e.is_claude_ai_auth),e.version!==void 0&&(t.version=e.version),e.github_event_name!==void 0&&(t.github_event_name=e.github_event_name),e.github_actions_runner_environment!==void 0&&(t.github_actions_runner_environment=e.github_actions_runner_environment),e.github_actions_runner_os!==void 0&&(t.github_actions_runner_os=e.github_actions_runner_os),e.github_action_ref!==void 0&&(t.github_action_ref=e.github_action_ref),e.wsl_version!==void 0&&(t.wsl_version=e.wsl_version),e.github_actions_metadata!==void 0&&(t.github_actions_metadata=H.toJSON(e.github_actions_metadata)),e.arch!==void 0&&(t.arch=e.arch),e.is_claude_code_remote!==void 0&&(t.is_claude_code_remote=e.is_claude_code_remote),e.remote_environment_type!==void 0&&(t.remote_environment_type=e.remote_environment_type),e.claude_code_container_id!==void 0&&(t.claude_code_container_id=e.claude_code_container_id),e.claude_code_remote_session_id!==void 0&&(t.claude_code_remote_session_id=e.claude_code_remote_session_id),e.tags?.length&&(t.tags=e.tags),e.deployment_environment!==void 0&&(t.deployment_environment=e.deployment_environment),e.is_conductor!==void 0&&(t.is_conductor=e.is_conductor),e.version_base!==void 0&&(t.version_base=e.version_base),e.coworker_type!==void 0&&(t.coworker_type=e.coworker_type),e.build_time!==void 0&&(t.build_time=e.build_time),e.is_local_agent_mode!==void 0&&(t.is_local_agent_mode=e.is_local_agent_mode),e.linux_distro_id!==void 0&&(t.linux_distro_id=e.linux_distro_id),e.linux_distro_version!==void 0&&(t.linux_distro_version=e.linux_distro_version),e.linux_kernel!==void 0&&(t.linux_kernel=e.linux_kernel),e.vcs!==void 0&&(t.vcs=e.vcs),e.platform_raw!==void 0&&(t.platform_raw=e.platform_raw),t},create(e){return U.fromPartial(e??{})},fromPartial(e){let t=ot();return t.platform=e.platform??``,t.node_version=e.node_version??``,t.terminal=e.terminal??``,t.package_managers=e.package_managers??``,t.runtimes=e.runtimes??``,t.is_running_with_bun=e.is_running_with_bun??!1,t.is_ci=e.is_ci??!1,t.is_claubbit=e.is_claubbit??!1,t.is_github_action=e.is_github_action??!1,t.is_claude_code_action=e.is_claude_code_action??!1,t.is_claude_ai_auth=e.is_claude_ai_auth??!1,t.version=e.version??``,t.github_event_name=e.github_event_name??``,t.github_actions_runner_environment=e.github_actions_runner_environment??``,t.github_actions_runner_os=e.github_actions_runner_os??``,t.github_action_ref=e.github_action_ref??``,t.wsl_version=e.wsl_version??``,t.github_actions_metadata=e.github_actions_metadata!==void 0&&e.github_actions_metadata!==null?H.fromPartial(e.github_actions_metadata):void 0,t.arch=e.arch??``,t.is_claude_code_remote=e.is_claude_code_remote??!1,t.remote_environment_type=e.remote_environment_type??``,t.claude_code_container_id=e.claude_code_container_id??``,t.claude_code_remote_session_id=e.claude_code_remote_session_id??``,t.tags=e.tags?.map(e=>e)||[],t.deployment_environment=e.deployment_environment??``,t.is_conductor=e.is_conductor??!1,t.version_base=e.version_base??``,t.coworker_type=e.coworker_type??``,t.build_time=e.build_time??``,t.is_local_agent_mode=e.is_local_agent_mode??!1,t.linux_distro_id=e.linux_distro_id??``,t.linux_distro_version=e.linux_distro_version??``,t.linux_kernel=e.linux_kernel??``,t.vcs=e.vcs??``,t.platform_raw=e.platform_raw??``,t}},W={fromJSON(e){return{slack_team_id:V(e.slack_team_id)?globalThis.String(e.slack_team_id):``,is_enterprise_install:V(e.is_enterprise_install)?globalThis.Boolean(e.is_enterprise_install):!1,trigger:V(e.trigger)?globalThis.String(e.trigger):``,creation_method:V(e.creation_method)?globalThis.String(e.creation_method):``}},toJSON(e){let t={};return e.slack_team_id!==void 0&&(t.slack_team_id=e.slack_team_id),e.is_enterprise_install!==void 0&&(t.is_enterprise_install=e.is_enterprise_install),e.trigger!==void 0&&(t.trigger=e.trigger),e.creation_method!==void 0&&(t.creation_method=e.creation_method),t},create(e){return W.fromPartial(e??{})},fromPartial(e){let t=st();return t.slack_team_id=e.slack_team_id??``,t.is_enterprise_install=e.is_enterprise_install??!1,t.trigger=e.trigger??``,t.creation_method=e.creation_method??``,t}},G={fromJSON(e){return{event_name:V(e.event_name)?globalThis.String(e.event_name):``,client_timestamp:V(e.client_timestamp)?B(e.client_timestamp):void 0,model:V(e.model)?globalThis.String(e.model):``,session_id:V(e.session_id)?globalThis.String(e.session_id):``,user_type:V(e.user_type)?globalThis.String(e.user_type):``,betas:V(e.betas)?globalThis.String(e.betas):``,env:V(e.env)?U.fromJSON(e.env):void 0,entrypoint:V(e.entrypoint)?globalThis.String(e.entrypoint):``,agent_sdk_version:V(e.agent_sdk_version)?globalThis.String(e.agent_sdk_version):``,is_interactive:V(e.is_interactive)?globalThis.Boolean(e.is_interactive):!1,client_type:V(e.client_type)?globalThis.String(e.client_type):``,process:V(e.process)?globalThis.String(e.process):``,additional_metadata:V(e.additional_metadata)?globalThis.String(e.additional_metadata):``,auth:V(e.auth)?z.fromJSON(e.auth):void 0,server_timestamp:V(e.server_timestamp)?B(e.server_timestamp):void 0,event_id:V(e.event_id)?globalThis.String(e.event_id):``,device_id:V(e.device_id)?globalThis.String(e.device_id):``,swe_bench_run_id:V(e.swe_bench_run_id)?globalThis.String(e.swe_bench_run_id):``,swe_bench_instance_id:V(e.swe_bench_instance_id)?globalThis.String(e.swe_bench_instance_id):``,swe_bench_task_id:V(e.swe_bench_task_id)?globalThis.String(e.swe_bench_task_id):``,email:V(e.email)?globalThis.String(e.email):``,agent_id:V(e.agent_id)?globalThis.String(e.agent_id):``,parent_session_id:V(e.parent_session_id)?globalThis.String(e.parent_session_id):``,agent_type:V(e.agent_type)?globalThis.String(e.agent_type):``,slack:V(e.slack)?W.fromJSON(e.slack):void 0,team_name:V(e.team_name)?globalThis.String(e.team_name):``,skill_name:V(e.skill_name)?globalThis.String(e.skill_name):``,plugin_name:V(e.plugin_name)?globalThis.String(e.plugin_name):``,marketplace_name:V(e.marketplace_name)?globalThis.String(e.marketplace_name):``}},toJSON(e){let t={};return e.event_name!==void 0&&(t.event_name=e.event_name),e.client_timestamp!==void 0&&(t.client_timestamp=e.client_timestamp.toISOString()),e.model!==void 0&&(t.model=e.model),e.session_id!==void 0&&(t.session_id=e.session_id),e.user_type!==void 0&&(t.user_type=e.user_type),e.betas!==void 0&&(t.betas=e.betas),e.env!==void 0&&(t.env=U.toJSON(e.env)),e.entrypoint!==void 0&&(t.entrypoint=e.entrypoint),e.agent_sdk_version!==void 0&&(t.agent_sdk_version=e.agent_sdk_version),e.is_interactive!==void 0&&(t.is_interactive=e.is_interactive),e.client_type!==void 0&&(t.client_type=e.client_type),e.process!==void 0&&(t.process=e.process),e.additional_metadata!==void 0&&(t.additional_metadata=e.additional_metadata),e.auth!==void 0&&(t.auth=z.toJSON(e.auth)),e.server_timestamp!==void 0&&(t.server_timestamp=e.server_timestamp.toISOString()),e.event_id!==void 0&&(t.event_id=e.event_id),e.device_id!==void 0&&(t.device_id=e.device_id),e.swe_bench_run_id!==void 0&&(t.swe_bench_run_id=e.swe_bench_run_id),e.swe_bench_instance_id!==void 0&&(t.swe_bench_instance_id=e.swe_bench_instance_id),e.swe_bench_task_id!==void 0&&(t.swe_bench_task_id=e.swe_bench_task_id),e.email!==void 0&&(t.email=e.email),e.agent_id!==void 0&&(t.agent_id=e.agent_id),e.parent_session_id!==void 0&&(t.parent_session_id=e.parent_session_id),e.agent_type!==void 0&&(t.agent_type=e.agent_type),e.slack!==void 0&&(t.slack=W.toJSON(e.slack)),e.team_name!==void 0&&(t.team_name=e.team_name),e.skill_name!==void 0&&(t.skill_name=e.skill_name),e.plugin_name!==void 0&&(t.plugin_name=e.plugin_name),e.marketplace_name!==void 0&&(t.marketplace_name=e.marketplace_name),t},create(e){return G.fromPartial(e??{})},fromPartial(e){let t=ct();return t.event_name=e.event_name??``,t.client_timestamp=e.client_timestamp??void 0,t.model=e.model??``,t.session_id=e.session_id??``,t.user_type=e.user_type??``,t.betas=e.betas??``,t.env=e.env!==void 0&&e.env!==null?U.fromPartial(e.env):void 0,t.entrypoint=e.entrypoint??``,t.agent_sdk_version=e.agent_sdk_version??``,t.is_interactive=e.is_interactive??!1,t.client_type=e.client_type??``,t.process=e.process??``,t.additional_metadata=e.additional_metadata??``,t.auth=e.auth!==void 0&&e.auth!==null?z.fromPartial(e.auth):void 0,t.server_timestamp=e.server_timestamp??void 0,t.event_id=e.event_id??``,t.device_id=e.device_id??``,t.swe_bench_run_id=e.swe_bench_run_id??``,t.swe_bench_instance_id=e.swe_bench_instance_id??``,t.swe_bench_task_id=e.swe_bench_task_id??``,t.email=e.email??``,t.agent_id=e.agent_id??``,t.parent_session_id=e.parent_session_id??``,t.agent_type=e.agent_type??``,t.slack=e.slack!==void 0&&e.slack!==null?W.fromPartial(e.slack):void 0,t.team_name=e.team_name??``,t.skill_name=e.skill_name??``,t.plugin_name=e.plugin_name??``,t.marketplace_name=e.marketplace_name??``,t}}}));function K(){return k.join(i(),`telemetry`)}function dt(e){if(!d.isAxiosError(e))return h(e);let t=[],n=e.response?.headers?.[`request-id`];return n&&t.push(`request-id=${n}`),e.response?.status&&t.push(`status=${e.response.status}`),e.code&&t.push(`code=${e.code}`),e.message&&t.push(e.message),t.join(`, `)}var q,J,Y,ft=e((()=>{He(),f(),p(),ut(),T(),b(),_(),a(),ae(),Ae(),ve(),x(),ke(),g(),Ne(),Ce(),be(),D(),o(),q=Ue(),J=`1p_failed_events.`,Y=class{constructor(e={}){s(this,`endpoint`,void 0),s(this,`timeout`,void 0),s(this,`maxBatchSize`,void 0),s(this,`skipAuth`,void 0),s(this,`batchDelayMs`,void 0),s(this,`baseBackoffDelayMs`,void 0),s(this,`maxBackoffDelayMs`,void 0),s(this,`maxAttempts`,void 0),s(this,`isKilled`,void 0),s(this,`pendingExports`,[]),s(this,`isShutdown`,!1),s(this,`schedule`,void 0),s(this,`cancelBackoff`,null),s(this,`attempts`,0),s(this,`isRetrying`,!1),s(this,`lastExportErrorContext`,void 0);let t=e.baseUrl||(process.env.ANTHROPIC_BASE_URL===`https://api-staging.anthropic.com`?`https://api-staging.anthropic.com`:`https://api.anthropic.com`);this.endpoint=`${t}${e.path||`/api/event_logging/batch`}`,this.timeout=e.timeout||1e4,this.maxBatchSize=e.maxBatchSize||200,this.skipAuth=e.skipAuth??!1,this.batchDelayMs=e.batchDelayMs||100,this.baseBackoffDelayMs=e.baseBackoffDelayMs||500,this.maxBackoffDelayMs=e.maxBackoffDelayMs||3e4,this.maxAttempts=e.maxAttempts??8,this.isKilled=e.isKilled??(()=>!1),this.schedule=e.schedule??((e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)}),this.retryPreviousBatches()}async getQueuedEventCount(){return(await this.loadEventsFromCurrentBatch()).length}getCurrentBatchFilePath(){return k.join(K(),`${J}${m()}.${q}.json`)}async loadEventsFromFile(e){try{return await _e(e)}catch{return[]}}async loadEventsFromCurrentBatch(){return this.loadEventsFromFile(this.getCurrentBatchFilePath())}async saveEventsToFile(e,t){try{if(t.length===0)try{await Ke(e)}catch{}else await A(K(),{recursive:!0}),await qe(e,t.map(e=>y(e)).join(`
2
- `)+`
3
- `,`utf8`)}catch(e){C(e)}}async appendEventsToFile(e,t){if(t.length!==0)try{await A(K(),{recursive:!0}),await We(e,t.map(e=>y(e)).join(`
4
- `)+`
5
- `,`utf8`)}catch(e){C(e)}}async deleteFile(e){try{await Ke(e)}catch{}}async retryPreviousBatches(){try{let e=`${J}${m()}.`,t;try{t=(await Ge(K())).filter(t=>t.startsWith(e)&&t.endsWith(`.json`)).filter(e=>!e.includes(q))}catch(e){if(re(e))return;throw e}for(let e of t){let t=k.join(K(),e);this.retryFileInBackground(t)}}catch(e){C(e)}}async retryFileInBackground(e){if(this.attempts>=this.maxAttempts){await this.deleteFile(e);return}let t=await this.loadEventsFromFile(e);if(t.length===0){await this.deleteFile(e);return}process.env.USER_TYPE===`ant`&&v(`1P event logging: retrying ${t.length} events from previous batch`);let n=await this.sendEventsInBatches(t);n.length===0?(await this.deleteFile(e),process.env.USER_TYPE===`ant`&&v(`1P event logging: previous batch retry succeeded`)):(await this.saveEventsToFile(e,n),process.env.USER_TYPE===`ant`&&v(`1P event logging: previous batch retry failed, ${n.length} events remain`))}async export(e,t){if(this.isShutdown){process.env.USER_TYPE===`ant`&&v(`1P event logging export failed: Exporter has been shutdown`),t({code:O.FAILED,error:Error(`Exporter has been shutdown`)});return}let n=this.doExport(e,t);this.pendingExports.push(n),n.finally(()=>{let e=this.pendingExports.indexOf(n);e>-1&&this.pendingExports.splice(e,1)})}async doExport(e,t){try{let n=e.filter(e=>e.instrumentationScope?.name===`com.anthropic.claude_code.events`);if(n.length===0){t({code:O.SUCCESS});return}let r=this.transformLogsToEvents(n).events;if(r.length===0){t({code:O.SUCCESS});return}if(this.attempts>=this.maxAttempts){t({code:O.FAILED,error:Error(`Dropped ${r.length} events: max attempts (${this.maxAttempts}) reached`)});return}let i=await this.sendEventsInBatches(r);if(this.attempts++,i.length>0){await this.queueFailedEvents(i),this.scheduleBackoffRetry();let e=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``;t({code:O.FAILED,error:Error(`Failed to export ${i.length} events${e}`)});return}this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying&&this.retryFailedEvents(),t({code:O.SUCCESS})}catch(e){process.env.USER_TYPE===`ant`&&v(`1P event logging export failed: ${h(e)}`),C(e),t({code:O.FAILED,error:ie(e)})}}async sendEventsInBatches(e){let t=[];for(let n=0;n<e.length;n+=this.maxBatchSize)t.push(e.slice(n,n+this.maxBatchSize));process.env.USER_TYPE===`ant`&&v(`1P event logging: exporting ${e.length} events in ${t.length} batch(es)`);let n=[],r;for(let e=0;e<t.length;e++){let i=t[e];try{await this.sendBatchWithRetry({events:i})}catch(i){r=dt(i);for(let r=e;r<t.length;r++)n.push(...t[r]);if(process.env.USER_TYPE===`ant`){let n=t.length-1-e;v(`1P event logging: batch ${e+1}/${t.length} failed (${r}); short-circuiting ${n} remaining batch(es)`)}break}e<t.length-1&&this.batchDelayMs>0&&await je(this.batchDelayMs)}return n.length>0&&r&&(this.lastExportErrorContext=r),n}async queueFailedEvents(e){let t=this.getCurrentBatchFilePath();await this.appendEventsToFile(t,e);let n=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``,r=`1P event logging: ${e.length} events failed to export${n}`;C(Error(r))}scheduleBackoffRetry(){if(this.cancelBackoff||this.isRetrying||this.isShutdown)return;let e=Math.min(this.baseBackoffDelayMs*this.attempts*this.attempts,this.maxBackoffDelayMs);process.env.USER_TYPE===`ant`&&v(`1P event logging: scheduling backoff retry in ${e}ms (attempt ${this.attempts})`),this.cancelBackoff=this.schedule(async()=>{this.cancelBackoff=null,await this.retryFailedEvents()},e)}async retryFailedEvents(){let e=this.getCurrentBatchFilePath();for(;!this.isShutdown;){let t=await this.loadEventsFromFile(e);if(t.length===0)break;if(this.attempts>=this.maxAttempts){process.env.USER_TYPE===`ant`&&v(`1P event logging: max attempts (${this.maxAttempts}) reached, dropping ${t.length} events`),await this.deleteFile(e),this.resetBackoff();return}this.isRetrying=!0,await this.deleteFile(e),process.env.USER_TYPE===`ant`&&v(`1P event logging: retrying ${t.length} failed events (attempt ${this.attempts+1})`);let n=await this.sendEventsInBatches(t);if(this.attempts++,this.isRetrying=!1,n.length>0){await this.saveEventsToFile(e,n),this.scheduleBackoffRetry();return}this.resetBackoff(),process.env.USER_TYPE===`ant`&&v(`1P event logging: backoff retry succeeded`)}}resetBackoff(){this.attempts=0,this.cancelBackoff&&(this.cancelBackoff(),this.cancelBackoff=null)}async sendBatchWithRetry(e){if(this.isKilled())throw Error(`firstParty sink killswitch active`);let t={"Content-Type":`application/json`,"User-Agent":Pe(),"x-service-name":`claude-code`},n=ue()||ee();process.env.USER_TYPE===`ant`&&!n&&v(`1P event logging: Trust not accepted`);let r=this.skipAuth||!n;if(!r&&Te()){let e=Oe();Me()?e&&Ee(e.expiresAt)&&(r=!0,process.env.USER_TYPE===`ant`&&v(`1P event logging: OAuth token expired, skipping auth to avoid 401`)):r=!0}let i=r?{headers:{},error:`trust not established or Oauth token expired`}:Se(),a=!i.error;!a&&process.env.USER_TYPE===`ant`&&v(`1P event logging: auth not available, sending without auth`);let o=a?{...t,...i.headers}:t;try{let t=await d.post(this.endpoint,e,{timeout:this.timeout,headers:o});this.logSuccess(e.events.length,a,t.data);return}catch(n){if(a&&d.isAxiosError(n)&&n.response?.status===401){process.env.USER_TYPE===`ant`&&v(`1P event logging: 401 auth error, retrying without auth`);let n=await d.post(this.endpoint,e,{timeout:this.timeout,headers:t});this.logSuccess(e.events.length,!1,n.data);return}throw n}}logSuccess(e,t,n){process.env.USER_TYPE===`ant`&&(v(`1P event logging: ${e} events exported successfully${t?` (with auth)`:` (without auth)`}`),v(`API Response: ${y(n,null,2)}`))}hrTimeToDate(e){let[t,n]=e;return new Date(t*1e3+n/1e6)}transformLogsToEvents(e){let t=[];for(let n of e){let e=n.attributes||{},r=e.event_name||n.body||`unknown`,i=e.core_metadata,a=e.user_metadata,o=e.event_metadata||{};if(!i){process.env.USER_TYPE===`ant`&&v(`1P event logging: core_metadata missing for event ${r}`),t.push({event_type:`ClaudeCodeInternalEvent`,event_data:G.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),session_id:m(),additional_metadata:Buffer.from(y({transform_error:`core_metadata attribute is missing`})).toString(`base64`)})});continue}let s=Re(i,a,o),{_PROTO_skill_name:c,_PROTO_plugin_name:l,_PROTO_marketplace_name:u,...d}=s.additional,f=ye(d);t.push({event_type:`ClaudeCodeInternalEvent`,event_data:G.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),device_id:e.user_id,email:a?.email,auth:s.auth,...s.core,env:s.env,process:s.process,skill_name:typeof c==`string`?c:void 0,plugin_name:typeof l==`string`?l:void 0,marketplace_name:typeof u==`string`?u:void 0,additional_metadata:Object.keys(f).length>0?Buffer.from(y(f)).toString(`base64`):void 0})})}return{events:t}}async shutdown(){this.isShutdown=!0,this.resetBackoff(),await this.forceFlush(),process.env.USER_TYPE===`ant`&&v(`1P event logging exporter shutdown complete`)}async forceFlush(){await Promise.all(this.pendingExports),process.env.USER_TYPE===`ant`&&v(`1P event logging exporter flush complete`)}}}));function pt(e){return!1}var mt=e((()=>{}));function ht(){return{}}function gt(e){let t=ht()[e];if(!t)return null;let n=t.sample_rate;return typeof n!=`number`||n<0||n>1||n>=1?null:n<=0?0:Math.random()<n?n:0}async function _t(){if($)try{await $.shutdown(),process.env.USER_TYPE===`ant`&&v(`1P event logging: final shutdown complete`)}catch{}}function X(){return!j()}async function vt(e,t,n={}){try{let r=await Fe({model:n.model,betas:n.betas}),i={event_name:t,event_id:Ue(),core_metadata:r,user_metadata:F(!0),event_metadata:n},a=le();a&&(i.user_id=a),process.env.USER_TYPE===`ant`&&v(`[ANT-ONLY] 1P event: ${t} ${y(n,null,0)}`),e.emit({body:t,attributes:i})}catch(e){process.env.USER_TYPE===`ant`&&C(e)}}function yt(e,t={}){X()&&(!Q||pt(`firstParty`)||vt(Q,e,t))}function bt(){if(w(`1p_event_logging_start`),!X()){process.env.USER_TYPE===`ant`&&v(`1P event logging not enabled`);return}w(`1p_event_after_config`);let e=parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||Z.toString(),10),t=xt,n=St,r=he(),i={[l]:`claude-code`,[c]:`0.0.8`};if(r===`wsl`){let e=me();e&&(i[`wsl.version`]=e)}$=new Be({resource:Ie(i),processors:[new ze(new Y({maxBatchSize:t,isKilled:()=>pt(`firstParty`)}),{scheduledDelayMillis:e,maxExportBatchSize:t,maxQueueSize:n})]}),Q=$.getLogger(`com.anthropic.claude_code.events`,`0.0.8`)}var Z,xt,St,Q,$,Ct=e((()=>{Le(),Ve(),u(),b(),_(),x(),ge(),g(),xe(),$e(),M(),ft(),D(),mt(),Z=1e4,xt=200,St=8192,Q=null,$=null}));export{yt as a,I as c,Xe as d,M as f,X as i,Ye as l,Je as m,Ct as n,gt as o,j as p,bt as r,_t as s,ht as t,$e as u};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./firstPartyEventLogger-D5ohKbIe.js";e();export{t as initialize1PEventLogging};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ec as t,Ha as n,La as r,Oc as i,Tc as a,eo as o}from"./loadAgentsDir-ByO8eJqU.js";import{G as s,Q as c,a as l,l as u}from"./debug-RZ4NuXyS.js";async function d(){try{let{getResolvedLanguage:e}=await import(`./language-DHhXLb_Y.js`);return e()===`zh`?m:p}catch{return p}}async function f(e){let t=a();if(!t)return u(`[recap] no CacheSafeParams saved, skipping`),{kind:`no-turn`};let o=new AbortController;e.addEventListener(`abort`,()=>o.abort(),{once:!0});try{let{messages:a}=await i({promptMessages:[r({content:await d()})],cacheSafeParams:t,canUseTool:async()=>({behavior:`deny`,message:`Recap cannot use tools`,decisionReason:{type:`other`,reason:`away_summary`}}),overrides:{abortController:o},querySource:`away_summary`,forkLabel:`away_summary`,maxTurns:1,skipCacheWrite:!0,skipTranscript:!0});if(e.aborted)return{kind:`aborted`};let s=a.find(e=>e.type===`assistant`&&e.isApiErrorMessage);if(s)return{kind:`api-error`,text:n(s)??``};let c=a.filter(e=>e.type===`assistant`&&!e.isApiErrorMessage).pop();if(!c)return{kind:`failed`};let l=n(c);return!l||l.trim().length===0?{kind:`failed`}:{kind:`ok`,text:l.trim()}}catch(t){return t instanceof c||e.aborted||o.signal.aborted?{kind:`aborted`}:(u(`[recap] generation failed: ${t}`),{kind:`failed`})}}var p,m;e((()=>{s(),l(),t(),o(),p=`The user stepped away and is coming back. Recap in under 40 words, 1-2 plain sentences, no markdown. Lead with the overall goal and current task, then the one next action. Skip root-cause narrative, fix internals, secondary to-dos, and em-dash tangents.`,m=`用户离开后回来了。用中文写 1-2 句话,不超过 60 字,无 markdown。先说明高层目标和当前任务,再说明下一步操作。跳过根因分析和次要待办。`}))();export{f as generateRecap};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ba as t,Yg as n,eo as r,et as i,tt as a}from"./loadAgentsDir-ByO8eJqU.js";import{F as o,a as s,l as c,z as l}from"./debug-RZ4NuXyS.js";import{s as u,u as d}from"./types-D7_37tP2.js";import{gt as f}from"./sessionState-CjNY991n.js";import{r as p,t as m}from"./sessionTitle-B0OYf5nM.js";async function h(e,n){let r=m(e);if(!r)return null;try{let e=await a({systemPrompt:f([`Generate a short kebab-case name (2-4 words) that captures the main topic of this conversation. Use lowercase words separated by hyphens. Examples: "fix-login-bug", "add-auth-feature", "refactor-api-client", "debug-test-failures". Return JSON with a "name" field.`]),userPrompt:r,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{name:{type:`string`}},required:[`name`],additionalProperties:!1}},signal:n,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),i=d(Array.isArray(e.message.content)?t(e.message.content):e.message.content);return i&&typeof i==`object`&&`name`in i&&typeof i.name==`string`?i.name:null}catch(e){return c(`generateSessionName failed: ${o(e)}`,{level:`error`}),null}}var g=e((()=>{i(),s(),l(),u(),r(),p(),n()}));export{g as n,h as t};
@@ -1 +0,0 @@
1
- import{a as e,i as t,m as n,r,u as i}from"./git-BerW9bId.js";n();export{r as findGitRoot,t as getBranch,e as getDefaultBranch,i as getRemoteUrl};
@@ -1 +0,0 @@
1
- import{$t as e,tt as t}from"./state-C2OSZkV1.js";import{a as n,l as r}from"./debug-RZ4NuXyS.js";import{Cn as i,On as a}from"./settings-hQDLwPVj.js";import{b as o,c as s,g as c}from"./config-CE058cvr.js";import{S as l,m as u,r as d,x as f}from"./git-BerW9bId.js";import{a as p,i as m,n as h}from"./detectRepository-CFiHe6Rv.js";import{realpath as g}from"fs/promises";e(),c(),n(),m(),i(),l(),u();async function _(){try{let e=await h();if(!e){r(`Not in a GitHub repository, skipping path mapping update`);return}let n=t(),i=d(n)??n,a;try{a=(await g(i)).normalize(`NFC`)}catch{a=i}let c=e.toLowerCase(),l=s().githubRepoPaths?.[c]??[];if(l[0]===a){r(`Path ${a} already tracked for repo ${c}`);return}let u=l.filter(e=>e!==a),f=[a,...u];o(e=>({...e,githubRepoPaths:{...e.githubRepoPaths,[c]:f}})),r(`Added ${a} to tracked paths for repo ${c}`)}catch(e){r(`Error updating repo path mapping: ${e}`)}}function v(e){let t=s(),n=e.toLowerCase();return t.githubRepoPaths?.[n]??[]}async function y(e){let t=await Promise.all(e.map(a));return e.filter((e,n)=>t[n])}async function b(e,t){try{let n=await f(e);if(!n)return!1;let r=p(n);return r?r.toLowerCase()===t.toLowerCase():!1}catch{return!1}}function x(e,t){let n=s(),i=e.toLowerCase(),a=n.githubRepoPaths?.[i]??[],c=a.filter(e=>e!==t);if(c.length===a.length)return;let l={...n.githubRepoPaths};c.length===0?delete l[i]:l[i]=c,o(e=>({...e,githubRepoPaths:l})),r(`Removed ${t} from tracked paths for repo ${i}`)}export{b as a,_ as i,v as n,x as r,y as t};
@@ -1,3 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{Cl as o,Ex as s,Rp as c,Sl as l,Sx as u,Tx as d,Wb as f,Yb as p,_x as m,gx as h,hx as g,mx as _,vx as v,wl as y,wx as b,xx as x,yx as S,zp as C}from"./loadAgentsDir-ByO8eJqU.js";import{n as w,t as T}from"./PermissionDialog-0ya1CU5k.js";function E({currentGoal:e,newObjective:r,onConfirm:i,onCancel:a}){function o(e){e===`yes`?i():a()}let s=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`;return(0,D.jsx)(T,{color:`warning`,title:`Replace active goal?`,children:(0,D.jsxs)(t,{flexDirection:`column`,marginTop:1,paddingX:1,children:[(0,D.jsx)(n,{children:`A goal is already in progress. Replacing it will reset all progress and counters.`}),(0,D.jsxs)(t,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(n,{dimColor:!0,children:`Current goal:`}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Objective: `}),e.objective]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Status: `}),v(e.status)]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Time: `}),m(e)]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Tokens: `}),s]})]}),(0,D.jsxs)(t,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(n,{dimColor:!0,children:`New objective:`}),(0,D.jsx)(n,{children:r})]}),(0,D.jsx)(t,{marginTop:1,children:(0,D.jsx)(C,{options:[{label:`Yes, replace the goal`,value:`yes`},{label:`No, keep the current goal`,value:`no`}],onChange:o,onCancel:a})})]})})}var D,O=e((()=>{r(),i(),c(),w(),u(),D=a()}));function k(e){let t=e.split(`
2
- `)[0]??e;return t.length<=I?t:t.slice(0,I)+`…`}function A(){p(e=>e.origin===`goal-continuation`||e.origin===`goal-budget-limit`)}function j(){let e=S();if(!e)return"No active goal. Set one with `/goal <objective>`.";let t=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`,n=[`Goal: ${e.objective}`,`Status: ${v(e.status)}`,`Time: ${m(e)}`,`Tokens: ${t}`,`Continuation turns: ${e.turnsExecuted}`];return e.status===`max_turns`&&n.push("Hint: Max continuation turns reached (150). Run `/goal continue` to reset and continue."),n.join(`
3
- `)}function M(e){return s(e),x(),o(),`Goal set.`}async function N(e,t,n){let r=n.trim();if(!r||r.toLowerCase()===`status`)return e(j(),{display:`system`}),null;let i=r.toLowerCase();if(i===`clear`){let t=_();return t&&(y(),A()),e(t?`Goal cleared.`:`No active goal to clear.`,{display:`system`}),null}if(i===`pause`){let t=b();return t&&(o(),A()),e(t?`Goal paused.`:`No active goal to pause.`,{display:`system`}),null}if(i===`resume`){if(S()?.status===`max_turns`)return e("Goal reached max continuation turns (150). Run `/goal continue` to reset turn counter and continue.",{display:`system`}),null;let t=d();return t&&o(),e(t?`Goal resumed.`:`No paused goal to resume.`,{display:`system`,shouldQuery:!!t}),null}if(i===`continue`){let t=h();return t&&o(),e(t?`Goal continuation counter reset (0/150). Continuing...`:`Current goal is not in max-turns state.`,{display:`system`,shouldQuery:!!t}),null}if(i===`complete`){let t=g();return t&&(o(),A()),e(t?`Goal marked complete.`:`No active goal to complete.`,{display:`system`}),null}if(r.length>F)return e(`Goal objective is too long (${r.length} chars; limit ${F}). Save the detailed instructions to a file and reference it from a shorter objective.`,{display:`system`}),null;let a=S();return a&&a.status!==`complete`?(0,P.jsx)(E,{currentGoal:a,newObjective:r,onConfirm:()=>{A(),e(M(r),{display:`system`,shouldQuery:!0,displayArgs:k(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]})},onCancel:()=>{e(`Kept the current goal. New objective discarded.`,{display:`system`})}}):(e(M(r),{display:`system`,shouldQuery:!0,displayArgs:k(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]}),null)}var P,F,I;e((()=>{r(),u(),l(),f(),O(),P=a(),F=4e3,I=80}))();export{N as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Oa as t,Sf as n,at as r,ct as i,dx as a,eo as o,lo as s,so as c,sx as l,xf as u}from"./loadAgentsDir-ByO8eJqU.js";import{a as d,l as f}from"./debug-RZ4NuXyS.js";import{V as p,W as m}from"./model-CwO-g1RW.js";import{K as h,U as g,W as _,Y as v,pt as y,q as b}from"./sessionState-CjNY991n.js";import{n as x,t as S}from"./openaiShared-G2-w4gJt.js";import{randomUUID as C}from"crypto";async function*w(e,n,r,a,o){try{let t=y(o.model),d=s(e,r),m=(await Promise.all(r.map(e=>i(e,{getToolPermissionContext:o.getToolPermissionContext,tools:r,agents:o.agents,allowedAgentTypes:o.allowedAgentTypes,model:o.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),g=v(d,n),S=b(m),w=h(o.toolChoice),T=u({maxRetries:0,fetchOverride:o.fetchOverride,source:o.querySource});f(`[Grok] Calling model=${t}, messages=${g.length}, tools=${S.length}`);let E=_(await T.chat.completions.create({model:t,messages:g,...S.length>0&&{tools:S,...w&&{tool_choice:w}},stream:!0,stream_options:{include_usage:!0},...o.temperatureOverride!==void 0&&{temperature:o.temperatureOverride}},{signal:a}),t),D={},O=null,k={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0},A=0,j=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,A=Date.now()-j,e.message.usage&&(k=x(k,e.message.usage));break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?D[t]={...n,input:``}:n.type===`text`?D[t]={...n,text:``}:n.type===`thinking`?D[t]={...n,thinking:``,signature:``}:D[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=D[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.signature=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:c([t],r,o.agentId)},requestId:void 0,type:`assistant`,uuid:C(),timestamp:new Date().toISOString()};break}case`message_delta`:{let t=e.usage;t&&(k=x(k,t));break}case`message_stop`:break}e.type===`message_stop`&&k.input_tokens+k.output_tokens>0&&l(p(t,k),k,o.model),yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:A}:void 0}}}catch(e){let n=e instanceof Error?e.message:String(e);f(`[Grok] Error: ${n}`,{level:`error`}),yield t({content:`API Error: ${n}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{n(),S(),g(),o(),r(),d(),a(),m()}))();export{w as queryModelGrok};
@@ -1,7 +0,0 @@
1
- import{n as e,t}from"./memoize-BK3gG5ob.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{Jm as i,Km as a}from"./loadAgentsDir-ByO8eJqU.js";import{a as o,l as s}from"./debug-RZ4NuXyS.js";import{b as c,c as l,g as u}from"./config-CE058cvr.js";import{a as d,n as f}from"./process-gEbdy6uY.js";import{d as p,f as m,o as h,s as g}from"./log-CZ0zYP_c.js";import{n as _,r as v}from"./analytics-CkYUHW_U.js";import{l as y,u as b}from"./oauth-BqJqV-2M.js";import{$n as x,Bt as S,Kt as C,jt as w,nr as T,rr as E,tr as D}from"./model-CwO-g1RW.js";import{n as O,t as k}from"./userAgent-BxTG7IMk.js";r(),t(),_(),S(),o(),i(),p(),f(),b(),u(),T(),h(),O();var A=1440*60*1e3,j=e(async()=>{if(m())return{success:!1};try{return{success:!0,data:(await E(()=>{let e=x();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return n.get(`${y().BASE_API_URL}/api/oauth/account/settings`,{headers:{...e.headers,"User-Agent":k()}})})).data}}catch(e){return g(e),j.cache.clear?.(),{success:!1}}});async function M(){try{await E(()=>{let e=x();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return n.post(`${y().BASE_API_URL}/api/oauth/account/grove_notice_viewed`,{},{headers:{...e.headers,"User-Agent":k()}})}),j.cache.clear?.()}catch(e){g(e)}}async function N(e){try{await E(()=>{let t=x();if(t.error)throw Error(`Failed to get auth headers: ${t.error}`);return n.patch(`${y().BASE_API_URL}/api/oauth/account/settings`,{grove_enabled:e},{headers:{...t.headers,"User-Agent":k()}})}),j.cache.clear?.()}catch(e){g(e)}}async function P(){if(!C())return!1;let e=w()?.accountUuid;if(!e)return!1;let t=l().groveConfigCache?.[e];return t?Date.now()-t.timestamp>A?(s(`Grove: Cache stale, returning cached data and refreshing in background`),F(e),t.grove_enabled):(s(`Grove: Using fresh cached config`),t.grove_enabled):(s(`Grove: No cache, fetching config in background (dialog skipped this session)`),F(e),!1)}async function F(e){try{let t=await I();if(!t.success)return;let n=t.data.grove_enabled,r=l().groveConfigCache?.[e];if(r?.grove_enabled===n&&Date.now()-r.timestamp<=A)return;c(t=>({...t,groveConfigCache:{...t.groveConfigCache,[e]:{grove_enabled:n,timestamp:Date.now()}}}))}catch(e){s(`Grove: Failed to fetch and store config: ${e}`)}}var I=e(async()=>{if(m())return{success:!1};try{let{grove_enabled:e,domain_excluded:t,notice_is_grace_period:r,notice_reminder_frequency:i}=(await E(()=>{let e=x();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return n.get(`${y().BASE_API_URL}/api/claude_code_grove`,{headers:{...e.headers,"User-Agent":D()},timeout:3e3})})).data;return{success:!0,data:{grove_enabled:e,domain_excluded:t??!1,notice_is_grace_period:r??!0,notice_reminder_frequency:i}}}catch(e){return s(`Failed to fetch Grove notice config: ${e}`),{success:!1}}});function L(e,t,n){if(!e.success||!t.success)return!1;let r=e.data,i=t.data;if(r.grove_enabled!==null)return!1;if(n||!i.notice_is_grace_period)return!0;let a=i.notice_reminder_frequency;return a!==null&&r.grove_notice_viewed_at?Math.floor((Date.now()-new Date(r.grove_notice_viewed_at).getTime())/(1e3*60*60*24))>=a:r.grove_notice_viewed_at==null}async function R(){let[e,t]=await Promise.all([j(),I()]);if(L(e,t,!1)){let e=t.success?t.data:null;v(`tengu_grove_print_viewed`,{dismissable:e?.notice_is_grace_period}),e===null||e.notice_is_grace_period?(d(`
2
- An update to our Consumer Terms and Privacy Policy will take effect on October 8, 2025. Run \`claude\` to review the updated terms.
3
-
4
- `),await M()):(d(`
5
- [ACTION REQUIRED] An update to our Consumer Terms and Privacy Policy has taken effect on October 8, 2025. You must run \`claude\` to review the updated terms.
6
-
7
- `),await a(1))}}export{P as a,j as i,R as n,M as o,I as r,N as s,L as t};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,Wt as a,a as o,fi as s,n as c,ot as l,r as u,t as d,x as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{Bp as m,Fw as h,Hi as g,Iw as _,Li as v,Pw as y,Yi as b,xw as x,zp as S}from"./loadAgentsDir-ByO8eJqU.js";import{b as C,x as w}from"./startupProfiler-DCn_NxMH.js";import{n as T,t as E}from"./useExitOnCtrlCDWithKeybindings-Cce612uS.js";import{n as D,r as O}from"./modalContext-DFjKLCB6.js";import{n as k,t as A}from"./PromptInputHelpMenu-DDD5WuK0.js";function j({commands:e,maxHeight:t,columns:r,title:a,onCancel:s,emptyMessage:c}){let{headerFocused:l,focusHeader:u}=o(),d=Math.max(1,r-10),f=Math.max(1,Math.floor((t-10)/2)),p=(0,M.useMemo)(()=>{let t=new Set;return e.filter(e=>t.has(e.name)?!1:(t.add(e.name),!0)).sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({label:`/${e.name}`,value:e.name,description:w(g(e),d,!0)}))},[e,d]);return(0,N.jsx)(n,{flexDirection:`column`,paddingY:1,children:e.length===0&&c?(0,N.jsx)(i,{dimColor:!0,children:c}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(i,{children:a}),(0,N.jsx)(n,{marginTop:1,children:(0,N.jsx)(S,{options:p,visibleOptionCount:f,onCancel:s,disableSelection:!0,hideIndexes:!0,layout:`compact-vertical`,onUpFromFirstItem:u,isDisabled:l})})]})})}var M,N,P=e((()=>{s(),M=t(s(),1),b(),C(),d(),m(),N=p()}));function F(){return(0,I.jsxs)(n,{flexDirection:`column`,paddingY:1,gap:1,children:[(0,I.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,I.jsx)(i,{bold:!0,children:`Getting started`}),(0,I.jsxs)(n,{flexDirection:`column`,children:[(0,I.jsxs)(i,{children:[(0,I.jsx)(i,{bold:!0,children:`1. `}),(0,I.jsx)(i,{children:`Ask a question or describe a task — Claude will explore your code and respond.`})]}),(0,I.jsxs)(i,{children:[(0,I.jsx)(i,{bold:!0,children:`2. `}),(0,I.jsx)(i,{children:`When Claude wants to edit files or run commands, you review and approve each action.`})]}),(0,I.jsxs)(i,{children:[(0,I.jsx)(i,{bold:!0,children:`3. `}),(0,I.jsx)(i,{children:`Type `}),(0,I.jsx)(i,{bold:!0,children:`/commit`}),(0,I.jsx)(i,{children:` to commit changes, `}),(0,I.jsx)(i,{bold:!0,children:`/help`}),(0,I.jsx)(i,{children:` for commands, or `}),(0,I.jsx)(i,{bold:!0,children:`?`}),(0,I.jsx)(i,{children:` for shortcuts.`})]})]})]}),(0,I.jsxs)(n,{flexDirection:`column`,children:[(0,I.jsx)(n,{children:(0,I.jsx)(i,{bold:!0,children:`Shortcuts`})}),(0,I.jsx)(A,{gap:2,fixedWidth:!0})]})]})}var I,L=e((()=>{s(),d(),k(),I=p()}));function R({onClose:e,commands:t}){let{rows:o,columns:s}=l(),d=Math.floor(o/2),p=O(),m=()=>e(`Help dialog dismissed`,{display:`system`});a(`help:dismiss`,m,{context:`Help`});let h=T(m),g=_(`help:dismiss`,`Help`,`esc`),y=v(),b=t.filter(e=>y.has(e.name)&&!e.isHidden),x=t.filter(e=>!y.has(e.name)&&!e.isHidden),S=[(0,z.jsx)(c,{title:`general`,children:(0,z.jsx)(F,{})},`general`)];return S.push((0,z.jsx)(c,{title:`commands`,children:(0,z.jsx)(j,{commands:b,maxHeight:d,columns:s,title:`Browse default commands:`,onCancel:m})},`commands`)),S.push((0,z.jsx)(c,{title:`custom-commands`,children:(0,z.jsx)(j,{commands:x,maxHeight:d,columns:s,title:`Browse custom commands:`,emptyMessage:`No custom commands found`,onCancel:m})},`custom`)),(0,z.jsx)(n,{flexDirection:`column`,height:p?void 0:d,children:(0,z.jsxs)(f,{color:`professionalBlue`,children:[(0,z.jsx)(u,{title:process.env.USER_TYPE===`ant`?`/help`:`Work Mate v0.0.8`,color:`professionalBlue`,defaultTab:`general`,children:S}),(0,z.jsx)(n,{marginTop:1,children:(0,z.jsxs)(i,{children:[`For more help: `,(0,z.jsx)(r,{url:`https://code.claude.com/docs/en/overview`})]})}),(0,z.jsx)(n,{marginTop:1,children:(0,z.jsx)(i,{dimColor:!0,children:h.pending?(0,z.jsxs)(z.Fragment,{children:[`Press `,h.keyName,` again to exit`]}):(0,z.jsxs)(i,{italic:!0,children:[g,` to cancel`]})})})]})})}var z,B=e((()=>{s(),E(),h(),b(),D(),x(),d(),y(),P(),L(),z=p()})),V,H;e((()=>{B(),V=p(),H=async(e,{options:{commands:t}})=>(0,V.jsx)(R,{commands:t,onClose:e})}))();export{H as call};
@@ -1 +0,0 @@
1
- import{Zt as e,dn as t,vn as n,yn as r}from"./loadAgentsDir-ByO8eJqU.js";r();export{e as executeSessionEndHooks,t as getSessionEndHookTimeoutMs,n as hasWorktreeCreateHook};
@@ -1 +0,0 @@
1
- import{l as e,o as t,u as n}from"./envUtils-DSxRz_kt.js";import{$t as r,mt as i,tt as a}from"./state-C2OSZkV1.js";import{GT as o,Ga as s,Ic as c,KT as l,Mc as u,Ua as d,ah as f,eo as p,io as m,jr as h,lh as g,mr as _,rh as v}from"./loadAgentsDir-ByO8eJqU.js";import{F as y,a as b,l as x,nt as S,rt as ee,z as C}from"./debug-RZ4NuXyS.js";import{b as te,c as ne,g as re}from"./config-CE058cvr.js";import{O as w,i as ie,k as T,m as E,u as D}from"./git-BerW9bId.js";import{g as O,m as k}from"./log-CZ0zYP_c.js";import{n as A,r as j}from"./analytics-CkYUHW_U.js";import{Bt as ae,Fr as M,It as N,Ot as oe,Pr as se,_n as P,mt as ce,vn as F}from"./model-CwO-g1RW.js";import{a as le,i as ue,r as I,t as L}from"./sessionIdCompat-DMayYBrf.js";import{I as R,L as de,c as fe,d as pe,h as me,m as z,n as he,p as B,u as ge}from"./sessionState-CjNY991n.js";import{a as V,i as H,n as U,o as W,t as G}from"./bridgeConfig-jDEva6Eh.js";import{a as K,o as _e,r as q,s as J}from"./debugUtils-D30M1cbN.js";import{a as ve,i as Y,n as ye,t as X}from"./createSession-C4rukWkv.js";import{n as Z,o as Q}from"./mappers-CHRFic5q.js";import{n as be,r as xe,t as Se}from"./sessionTitle-B0OYf5nM.js";import{i as Ce,n as we,r as Te,t as Ee}from"./flushGate-Cnsu4HET.js";import{n as De,t as Oe}from"./pollConfig-BgpfHQPJ.js";import{n as ke,t as Ae}from"./rcDebugLog-CARUIORE.js";import{a as je,i as Me,n as $,o as Ne,r as Pe,t as Fe}from"./capacityWake-CKOiRELo.js";import{a as Ie,i as Le,n as Re,o as ze,r as Be,t as Ve}from"./bridgeMessaging-YqYdl6ej.js";import{a as He,n as Ue,r as We,t as Ge}from"./workSecret-DG9shvG0.js";import{i as Ke}from"./trustedDevice-B0x9X0fb.js";import{t as qe}from"./HybridTransport-BJPOG2wl.js";import{hostname as Je}from"os";import{randomUUID as Ye}from"crypto";t(),r(),S(),C(),w(),k(),E(),A(),re(),M(),P(),ae(),L(),l(),R(),v(),V(),pe(),he(),u(),p(),h(),_e(),Y(),Z(),xe(),Ae(),b();var Xe=[];function Ze(){Xe.length=0}function Qe(e){function t(e){let t=Xe.findIndex(t=>t.method===e);if(t===-1)return null;let n=Xe[t];return n.count--,n.count<=0&&Xe.splice(t,1),n}function n(e,t){throw x(`[bridge:debug] Injecting ${e.kind} fault into ${t}: status=${e.status} errorType=${e.errorType??`none`}`),e.kind===`fatal`?new $(`[injected] ${t} ${e.status}`,e.status,e.errorType):Error(`[injected transient] ${t} ${e.status}`)}return{...e,async pollForWork(r,i,a,o){let s=t(`pollForWork`);return s&&n(s,`Poll`),e.pollForWork(r,i,a,o)},async registerBridgeEnvironment(r){let i=t(`registerBridgeEnvironment`);return i&&n(i,`Registration`),e.registerBridgeEnvironment(r)},async reconnectSession(r,i){let a=t(`reconnectSession`);return a&&n(a,`ReconnectSession`),e.reconnectSession(r,i)},async heartbeatWork(r,i,a){let o=t(`heartbeatWork`);return o&&n(o,`Heartbeat`),e.heartbeatWork(r,i,a)}}}b();var $e=2e3,et=6e4,tt=900*1e3,nt=0;async function rt(t){let{dir:r,machineName:i,branch:a,gitRepoUrl:o,title:s,baseUrl:l,sessionIngressUrl:u,workerType:d,getAccessToken:f,createSession:p,archiveSession:m,getCurrentTitle:h=()=>s,toSDKMessages:g=()=>{throw Error(`BridgeCoreParams.toSDKMessages not provided. Pass it if you use writeMessages() or initialMessages — daemon callers that only use writeSdkMessages() never hit this path.`)},onAuth401:_,getPollIntervalConfig:v=()=>De,initialHistoryCap:b=200,initialMessages:S,previouslyFlushedUUIDs:C,onInboundMessage:te,onPermissionResponse:ne,onInterrupt:re,onSetModel:w,onSetMaxThinkingTokens:ie,onSetPermissionMode:E,onStateChange:D,onUserMessage:O,perpetual:k,initialSSESequenceNum:A=0}=t,ae=++nt,{writeBridgePointer:M,clearBridgePointer:N,readBridgePointer:oe}=await import(`./bridgePointer-DIM0sj0x.js`),se=k?await oe(r):null,P=se?.source===`repl`?se:null;x(`[bridge:repl] initBridgeCore #${ae} starting (initialMessages=${S?.length??0}${P?` perpetual prior=env:${P.environmentId}`:``})`);let ce=Pe({baseUrl:l,getAccessToken:f,runnerVersion:`0.0.8`,onDebug:x,onAuth401:_,getTrustedDeviceToken:Ke}),F=process.env.USER_TYPE===`ant`?Qe(ce):ce,I={dir:r,machineName:i,branch:a,gitRepoUrl:o,maxSessions:1,spawnMode:`single-session`,verbose:!1,sandbox:!1,bridgeId:Ye(),workerType:d,environmentId:Ye(),reuseEnvironmentId:P?.environmentId,apiBaseUrl:l,sessionIngressUrl:u},L,R;try{let e=await F.registerBridgeEnvironment(I);L=e.environment_id,R=e.environment_secret}catch(e){return J(`registration_failed`,`[bridge:repl] Environment registration failed: ${y(e)}`),P&&await N(r),D?.(`failed`,y(e)),null}x(`[bridge:repl] Environment registered: ${L}`),T(`info`,`bridge_repl_env_registered`),j(`tengu_bridge_repl_env_registered`,{});async function pe(e,t){if(L!==e)return x(`[bridge:repl] Env mismatch (requested ${e}, got ${L}) — cannot reconnect in place`),!1;let n=le(t),r=n===t?[t]:[t,n];for(let e of r)try{return await F.reconnectSession(L,e),x(`[bridge:repl] Reconnected session ${e} in place on env ${L}`),!0}catch(t){x(`[bridge:repl] reconnectSession(${e}) failed: ${y(t)}`)}return x(`[bridge:repl] reconnectSession exhausted — falling through to fresh session`),!1}let me=P?await pe(P.environmentId,P.sessionId):!1;P&&!me&&await N(r);let z;if(me&&P){if(z=P.sessionId,x(`[bridge:repl] Perpetual session reused: ${z}`),S&&C)for(let e of S)C.add(e.uuid)}else{let e=await p({environmentId:L,title:s,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});if(!e)return x(`[bridge:repl] Session creation failed, deregistering environment`),j(`tengu_bridge_repl_session_failed`,{}),await F.deregisterEnvironment(L).catch(()=>{}),D?.(`failed`,`Session creation failed`),null;z=e,x(`[bridge:repl] Session created: ${z}`)}await M(r,{sessionId:z,environmentId:L,source:`repl`}),T(`info`,`bridge_repl_session_created`),j(`tengu_bridge_repl_started`,{has_initial_messages:!!(S&&S.length>0),inProtectedNamespace:n()});let he=new Set;if(S)for(let e of S)he.add(e.uuid);let B=new Ve(2e3);for(let e of he)B.add(e);let ge=new Ve(2e3),V=new AbortController,H=null;fe(e=>{V.signal.aborted||H?.reportMetadata(e)},{replayCurrent:!0});let U=0,W=me?A:0,G=null,K=null,_e=Fe(V.signal),q=_e.wake,ve=_e.signal,Y=new Ee,ye=!O,X=0,Z=null;async function Q(){if(Z)return Z;Z=be();try{return await Z}finally{Z=null}}async function be(){if(X++,ke(`doReconnect: attempt=${X}/3 envId=${L} sessionId=${z} workId=${G}`),U++,x(`[bridge:repl] Reconnecting after env lost (attempt ${X}/3)`),X>3)return x(`[bridge:repl] Environment reconnect limit reached (3), giving up`),!1;if(H){let e=H.getLastSequenceNum();e>W&&(W=e),H.close(),H=null}if(q(),Y.drop(),G){let e=G;if(await F.stopWork(L,e,!1).catch(()=>{}),G!==e)return x(`[bridge:repl] Poll loop recovered during stopWork await — deferring to it`),X=0,!0;G=null,K=null}if(V.signal.aborted)return x(`[bridge:repl] Reconnect aborted by teardown`),!1;let e=L;I.reuseEnvironmentId=e;try{let e=await F.registerBridgeEnvironment(I);L=e.environment_id,R=e.environment_secret}catch(e){return I.reuseEnvironmentId=void 0,x(`[bridge:repl] Environment re-registration failed: ${y(e)}`),!1}if(I.reuseEnvironmentId=void 0,x(`[bridge:repl] Re-registered: requested=${e} got=${L}`),V.signal.aborted)return x(`[bridge:repl] Reconnect aborted after env registration, cleaning up`),await F.deregisterEnvironment(L).catch(()=>{}),!1;if(H!==null)return x(`[bridge:repl] Poll loop recovered during registerBridgeEnvironment await — deferring to it`),X=0,!0;if(await pe(e,z))return j(`tengu_bridge_repl_reconnected_in_place`,{}),X=0,!0;if(L!==e&&j(`tengu_bridge_repl_env_expired_fresh_session`,{}),await m(z),V.signal.aborted)return x(`[bridge:repl] Reconnect aborted after archive, cleaning up`),await F.deregisterEnvironment(L).catch(()=>{}),!1;let t=h(),n=await p({environmentId:L,title:t,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});return n?V.signal.aborted?(x(`[bridge:repl] Reconnect aborted after session creation, cleaning up`),await m(n),!1):(z=n,c(ue(n)).catch(()=>{}),W=0,ge.clear(),ye=!O,x(`[bridge:repl] Re-created session: ${z}`),await M(r,{sessionId:z,environmentId:L,source:`repl`}),C?.clear(),X=0,!0):(x(`[bridge:repl] Session creation failed during reconnection`),!1)}function xe(){return f()}function Se(){let e=Y.end();if(e.length===0)return;if(!H){x(`[bridge:repl] Cannot drain ${e.length} pending message(s): no transport`);return}for(let t of e)B.add(t.uuid);let t=g(e).map(e=>({...e,session_id:z}));x(`[bridge:repl] Drained ${e.length} pending message(s) after flush`),H.writeBatch(t)}let Ce=null;function Oe(){Ce?.()}function Ae(e){if(ke(`handleTransportPermanentClose: code=${e} transport=${H?`exists`:`null`} pollAborted=${V.signal.aborted}`),x(`[bridge:repl] Transport permanently closed: code=${e}`),j(`tengu_bridge_repl_ws_closed`,{code:e}),H){let e=H.getLastSequenceNum();e>W&&(W=e),H=null}q();let t=Y.drop();if(t>0&&x(`[bridge:repl] Dropping ${t} pending message(s) on transport close (code=${e})`,{level:`warn`}),e===1e3){D?.(`failed`,`session ended`),V.abort(),Oe();return}D?.(`reconnecting`,`Remote Control connection lost (code ${e})`),x(`[bridge:repl] Transport reconnect budget exhausted (code=${e}), attempting env reconnect`),Q().then(t=>{t||V.signal.aborted||(x(`[bridge:repl] reconnectEnvironmentWithSession resolved false — tearing down`),j(`tengu_bridge_repl_reconnect_failed`,{close_code:e}),D?.(`failed`,`reconnection failed`),Oe())})}let je;process.env.USER_TYPE===`ant`&&process.platform!==`win32`&&(je=()=>{x(`[bridge:repl] SIGUSR2 received — forcing doReconnect() for testing`),Q()},process.on(`SIGUSR2`,je)),process.env.USER_TYPE,it({api:F,getCredentials:()=>({environmentId:L,environmentSecret:R}),signal:V.signal,getPollIntervalConfig:v,onStateChange:D,getWsState:()=>H?.getStateLabel()??`null`,isAtCapacity:()=>H!==null,capacitySignal:ve,onFatalError:Oe,getHeartbeatInfo:()=>!G||!K?null:{environmentId:L,workId:G,sessionToken:K},onHeartbeatFatal:e=>{if(x(`[bridge:repl] heartbeatWork fatal (status=${e.status}) — tearing down work item for fast re-dispatch`),H){let e=H.getLastSequenceNum();e>W&&(W=e),H.close(),H=null}Y.drop(),G&&F.stopWork(L,G,!1).catch(e=>{x(`[bridge:repl] stopWork after heartbeat fatal: ${y(e)}`)}),G=null,K=null,q(),D?.(`reconnecting`,`Work item lease expired, fetching fresh token`)},async onEnvironmentLost(){return await Q()?{environmentId:L,environmentSecret:R}:null},onWorkReceived:(t,n,i,a)=>{if(H?.isConnectedStatus()&&x(`[bridge:repl] Work received while transport connected, replacing with fresh token (workId=${i})`),x(`[bridge:repl] Work received: workId=${i} workSessionId=${t} currentSessionId=${z} match=${He(t,z)}`),M(r,{sessionId:z,environmentId:L,source:`repl`}),!He(t,z)){x(`[bridge:repl] Rejecting foreign session: expected=${z} got=${t}`);return}G=i,K=n;let o=a||e(process.env.CLAUDE_BRIDGE_USE_CCR_V2),s;if(!o){if(s=xe(),!s){x(`[bridge:repl] No OAuth token available for session ingress, skipping work`);return}de(s)}if(j(`tengu_bridge_repl_work_received`,{}),H){let e=H;H=null;let t=e.getLastSequenceNum();t>W&&(W=t),e.close()}Y.deactivate();let c=e=>Le(e,{transport:H,sessionId:z,onInterrupt:re,onSetModel:w,onSetMaxThinkingTokens:ie,onSetPermissionMode:E}),d=!1,f=e=>{H=e,e.setOnConnect(()=>{if(H===e){if(x(`[bridge:repl] Ingress transport connected`),j(`tengu_bridge_repl_ws_connected`,{}),!o){let e=xe();e&&de(e)}if(We=!1,!d&&S&&S.length>0){d=!0;let t=b,n=S.filter(e=>Ie(e)&&!C?.has(e.uuid)),r=t>0&&n.length>t?n.slice(-t):n;r.length<n.length&&(x(`[bridge:repl] Capped initial flush: ${n.length} -> ${r.length} (cap=${t})`),j(`tengu_bridge_repl_history_capped`,{eligible_count:n.length,capped_count:r.length}));let i=g(r);if(i.length>0){x(`[bridge:repl] Flushing ${i.length} initial message(s) via transport`);let t=i.map(e=>({...e,session_id:z})),n=e.droppedBatchCount;e.writeBatch(t).then(()=>{if(e.droppedBatchCount>n){x(`[bridge:repl] Initial flush dropped ${e.droppedBatchCount-n} batch(es) — not marking ${i.length} UUID(s) as flushed`);return}if(C)for(let e of i)e.uuid&&C.add(e.uuid)}).catch(e=>x(`[bridge:repl] Initial flush failed: ${e}`)).finally(()=>{H===e&&(Se(),D?.(`connected`))})}else Se(),D?.(`connected`)}else Y.active||D?.(`connected`)}}),e.setOnData(e=>{try{let t=JSON.parse(e);ke(`ingress: type=${t.type}${t.type===`control_request`?` subtype=${t.request?.subtype} request_id=${t.request_id}`:``}${t.type===`control_response`?` subtype=${t.response?.subtype} request_id=${t.response?.request_id}`:``}${t.type===`user`?` uuid=${t.uuid}`:``}${t.type===`keep_alive`?``:` len=${e.length}`}`)}catch{ke(`ingress (non-JSON): ${String(e).slice(0,200)}`)}Be(e,B,ge,te,ne,c)}),e.setOnClose(t=>{H===e&&(ke(`transport onClose: code=${t} connected=${e.isConnectedStatus()} state=${e.getStateLabel()} seq=${e.getLastSequenceNum()}`),Ae(t))}),!d&&S&&S.length>0&&Y.start(),e.connect()};if(U++,o){let e=Ge(l,t),r=U;x(`[bridge:repl] CCR v2: sessionUrl=${e} session=${t} gen=${r}`),Te({sessionUrl:e,ingressToken:n,sessionId:t,initialSequenceNum:W}).then(e=>{if(V.signal.aborted){e.close();return}if(r!==U){x(`[bridge:repl] CCR v2: discarding stale handshake gen=${r} current=${U}`),e.close();return}f(e)},e=>{x(`[bridge:repl] CCR v2: createV2ReplTransport failed: ${y(e)}`,{level:`error`}),j(`tengu_bridge_repl_ccr_v2_init_failed`,{}),r===U&&(G&&(F.stopWork(L,G,!1).catch(e=>{x(`[bridge:repl] stopWork after v2 init failure: ${y(e)}`)}),G=null,K=null),q())})}else{let e=Ue(u,t);x(`[bridge:repl] Ingress URL: ${e}`),x(`[bridge:repl] Creating HybridTransport: session=${t}`);let n=s??``;f(we(new qe(new URL(e),{Authorization:`Bearer ${n}`,"anthropic-version":`2023-06-01`},t,()=>({Authorization:`Bearer ${xe()??n}`,"anthropic-version":`2023-06-01`}),{maxConsecutiveFailures:50,isBridge:!0,onBatchDropped:()=>{D?.(`reconnecting`,`Lost sync with Remote Control — events could not be delivered`),q()}})))}}});let Me=k?setInterval(()=>{Z||M(r,{sessionId:z,environmentId:L,source:`repl`})},60*6e4):null;Me?.unref?.();let $=v().session_keepalive_interval_v2_ms,Ne=$>0?setInterval(()=>{H&&(x(`[bridge:repl] keep_alive sent`),H.write({type:`keep_alive`}).catch(e=>{x(`[bridge:repl] keep_alive write failed: ${y(e)}`)}))},$):null;Ne?.unref?.();let We=!1;Ce=async()=>{if(We){x(`[bridge:repl] Teardown already in progress, skipping duplicate call env=${L} session=${z}`);return}We=!0;let e=Date.now();if(x(`[bridge:repl] Teardown starting: env=${L} session=${z} workId=${G??`none`} transportState=${H?.getStateLabel()??`null`}`),Me!==null&&clearInterval(Me),Ne!==null&&clearInterval(Ne),je&&process.off(`SIGUSR2`,je),process.env.USER_TYPE===`ant`&&Ze(),V.abort(),x(`[bridge:repl] Teardown: poll loop aborted`),H){let e=H.getLastSequenceNum();e>W&&(W=e)}if(k){H=null,Y.drop(),await M(r,{sessionId:z,environmentId:L,source:`repl`}),x(`[bridge:repl] Teardown (perpetual): leaving env=${L} session=${z} alive on server, duration=${Date.now()-e}ms`);return}let t=H;if(H=null,Y.drop(),t){let e={...ze(z),session_id:z};t.write(e)}let n=G?F.stopWork(L,G,!0).then(()=>{x(`[bridge:repl] Teardown: stopWork completed`)}).catch(e=>{x(`[bridge:repl] Teardown stopWork failed: ${y(e)}`)}):Promise.resolve();await Promise.all([n,m(z)]),t?.close(),x(`[bridge:repl] Teardown: transport closed`),await F.deregisterEnvironment(L).catch(e=>{x(`[bridge:repl] Teardown deregister failed: ${y(e)}`)}),await N(r),x(`[bridge:repl] Teardown complete: env=${L} duration=${Date.now()-e}ms`)};let Je=ee(()=>Ce?.());return x(`[bridge:repl] Ready: env=${L} session=${z}`),D?.(`ready`),{get bridgeSessionId(){return z},get environmentId(){return L},getSSESequenceNum(){let e=H?.getLastSequenceNum()??0;return Math.max(W,e)},sessionIngressUrl:u,writeMessages(e){let t=e.filter(e=>Ie(e)&&!he.has(e.uuid)&&!B.has(e.uuid));if(t.length===0)return;if(!ye)for(let e of t){let t=Re(e);if(t!==void 0&&O?.(t,z)){ye=!0;break}}if(Y.enqueue(...t)){x(`[bridge:repl] Queued ${t.length} message(s) during initial flush`);return}if(!H){let e=t.map(e=>e.type).join(`,`);x(`[bridge:repl] Transport not configured, dropping ${t.length} message(s) [${e}] for session=${z}`,{level:`warn`});return}for(let e of t)B.add(e.uuid);x(`[bridge:repl] Sending ${t.length} message(s) via transport`);let n=g(t).map(e=>({...e,session_id:z}));H.writeBatch(n)},writeSdkMessages(e){let t=e.filter(e=>!e.uuid||!B.has(e.uuid));if(t.length===0)return;if(!H){x(`[bridge:repl] Transport not configured, dropping ${t.length} SDK message(s) for session=${z}`,{level:`warn`});return}for(let e of t)e.uuid&&B.add(e.uuid);let n=t.map(e=>({...e,session_id:z}));H.writeBatch(n)},sendControlRequest(e){if(!H){x(`[bridge:repl] Transport not configured, skipping control_request`);return}let t={...e,session_id:z};H.write(t),x(`[bridge:repl] Sent control_request request_id=${e.request_id}`)},sendControlResponse(e){if(!H){x(`[bridge:repl] Transport not configured, skipping control_response`);return}let t={...e,session_id:z};H.write(t),x(`[bridge:repl] Sent control_response`)},sendControlCancelRequest(e){if(!H){x(`[bridge:repl] Transport not configured, skipping control_cancel_request`);return}let t={type:`control_cancel_request`,request_id:e,session_id:z};H.write(t),x(`[bridge:repl] Sent control_cancel_request request_id=${e}`)},sendResult(){if(!H){x(`[bridge:repl] sendResult: skipping, transport not configured session=${z}`);return}H.reportState(`idle`);let e={...ze(z),session_id:z};H.write(e),x(`[bridge:repl] Sent result for session=${z}`)},async teardown(){Je(),await Ce?.(),x(`[bridge:repl] Torn down`),j(`tengu_bridge_repl_teardown`,{})}}}async function it({api:e,getCredentials:t,signal:n,onStateChange:r,onWorkReceived:i,onEnvironmentLost:a,getWsState:o,isAtCapacity:s,capacitySignal:c,onFatalError:l,getPollIntervalConfig:u=()=>De,getHeartbeatInfo:d,onHeartbeatFatal:f}){x(`[bridge:repl] Starting work poll loop for env=${t().environmentId}`);let p=0,m=null,h=null,g=0,_=!1;for(;!n.aborted;){let{environmentId:v,environmentSecret:b}=t(),S=u();try{let t=await e.pollForWork(v,b,n,S.reclaim_older_than_ms);if(g=0,p>0&&(x(`[bridge:repl] Poll recovered after ${p} consecutive error(s)`),p=0,m=null,h=null,r?.(`ready`)),!t){let t=_;if(_=!1,s?.()&&c&&!t){let t=S.poll_interval_ms_at_capacity;if(S.non_exclusive_heartbeat_interval_ms>0&&d){j(`tengu_bridge_heartbeat_mode_entered`,{heartbeat_interval_ms:S.non_exclusive_heartbeat_interval_ms});let r=t>0?Date.now()+t:null,i=!1,a=0;for(;!n.aborted&&s()&&(r===null||Date.now()<r);){let t=u();if(t.non_exclusive_heartbeat_interval_ms<=0)break;let n=d();if(!n)break;let r=c();try{await e.heartbeatWork(n.environmentId,n.workId,n.sessionToken)}catch(e){if(x(`[bridge:repl:heartbeat] Failed: ${y(e)}`),e instanceof $){r.cleanup(),j(`tengu_bridge_heartbeat_error`,{status:e.status,error_type:e.status===401||e.status===403?`auth_failed`:`fatal`}),f?(f(e),x(`[bridge:repl:heartbeat] Fatal (status=${e.status}), work state cleared — fast-polling for re-dispatch`)):i=!0;break}}a++,await F(t.non_exclusive_heartbeat_interval_ms,r.signal),r.cleanup()}let o=i?`error`:n.aborted?`shutdown`:s()?r!==null&&Date.now()>=r?`poll_due`:`config_disabled`:`capacity_changed`;if(j(`tengu_bridge_heartbeat_mode_exited`,{reason:o,heartbeat_cycles:a}),!i){o===`poll_due`&&x(`[bridge:repl] Heartbeat poll_due after ${a} cycles — falling through to pollForWork`);continue}}let r=t>0?t:S.non_exclusive_heartbeat_interval_ms;if(r>0){let e=c(),t=Date.now();await F(r,e.signal),e.cleanup();let n=Date.now()-t-r;n>6e4&&(x(`[bridge:repl] At-capacity sleep overran by ${Math.round(n/1e3)}s — process suspension detected, forcing one fast-poll cycle`),j(`tengu_bridge_repl_suspension_detected`,{overrun_ms:n}),_=!0)}}else await F(S.poll_interval_ms_not_at_capacity,n);continue}let a;try{a=We(t.secret)}catch(n){x(`[bridge:repl] Failed to decode work secret: ${y(n)}`),j(`tengu_bridge_repl_work_secret_failed`,{}),await e.stopWork(v,t.id,!1).catch(()=>{});continue}x(`[bridge:repl] Acknowledging workId=${t.id}`);try{await e.acknowledgeWork(v,t.id,a.session_ingress_token)}catch(e){x(`[bridge:repl] Acknowledge failed workId=${t.id}: ${y(e)}`)}if(t.data.type===`healthcheck`){x(`[bridge:repl] Healthcheck received`);continue}if(t.data.type===`session`){let e=t.data.id;try{Ne(e,`session_id`)}catch{x(`[bridge:repl] Invalid session_id in work: ${e}`);continue}i(e,a.session_ingress_token,t.id,a.use_code_sessions===!0),x(`[bridge:repl] Work accepted, continuing poll loop`)}}catch(i){if(n.aborted)break;if(i instanceof $&&i.status===404&&a){let e=t().environmentId;if(v!==e){x(`[bridge:repl] Stale poll error for old env=${v}, current env=${e} — skipping onEnvironmentLost`),p=0,m=null;continue}if(g++,x(`[bridge:repl] Environment deleted, attempting re-registration (attempt ${g}/3)`),j(`tengu_bridge_repl_env_lost`,{attempt:g}),g>3){x(`[bridge:repl] Environment re-registration limit reached (3), giving up`),r?.(`failed`,`Environment deleted and re-registration limit reached`),l?.();break}r?.(`reconnecting`,`environment lost, recreating session`);let i=await a();if(n.aborted)break;if(i){p=0,m=null,r?.(`ready`),x(`[bridge:repl] Re-registered environment: ${i.environmentId}`);continue}r?.(`failed`,`Environment deleted and re-registration failed`),l?.();break}if(i instanceof $){let e=Me(i.errorType),t=je(i);x(`[bridge:repl] Fatal poll error: ${i.message} (status=${i.status}, type=${i.errorType??`unknown`})${t?` (suppressed)`:``}`),j(`tengu_bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),T(e?`info`:`error`,`bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),t||r?.(`failed`,e?`session expired · /remote-control to reconnect`:i.message),l?.();break}let s=Date.now();h!==null&&s-h>6e4*2&&(x(`[bridge:repl] Detected system sleep (${Math.round((s-h)/1e3)}s gap), resetting poll error budget`),T(`info`,`bridge_repl_poll_sleep_detected`,{gapMs:s-h}),p=0,m=null),h=s,p++,m===null&&(m=s);let c=s-m,f=K(i),_=q(i),y=o?.()??`unknown`;if(x(`[bridge:repl] Poll error (attempt ${p}, elapsed ${Math.round(c/1e3)}s, ws=${y}): ${_}`),j(`tengu_bridge_repl_poll_error`,{status:f,consecutiveErrors:p,elapsedMs:c}),p===1&&r?.(`reconnecting`,_),c>=9e5){x(`[bridge:repl] Poll failures exceeded ${tt/1e3}s (${p} errors), giving up`),T(`info`,`bridge_repl_poll_give_up`),j(`tengu_bridge_repl_poll_give_up`,{consecutiveErrors:p,elapsedMs:c,lastStatus:f}),r?.(`failed`,`connection to server lost`);break}let b=Math.min($e*2**(p-1),et);if(u().non_exclusive_heartbeat_interval_ms>0){let t=d?.();if(t)try{await e.heartbeatWork(t.environmentId,t.workId,t.sessionToken)}catch{}}await F(b,n)}}x(`[bridge:repl] Work poll loop ended (aborted=${n.aborted}) env=${t().environmentId}`)}b(),C(),_e(),L();async function at(e){let{onInboundMessage:t,onPermissionResponse:n,onInterrupt:r,onSetModel:c,onSetMaxThinkingTokens:l,onSetPermissionMode:u,onStateChange:p,initialMessages:h,getMessages:v,previouslyFlushedUUIDs:b,initialName:S,perpetual:ee,outboundOnly:C,tags:re}=e??{};if(I(z),!await B())return J(`not_enabled`,`[bridge:repl] Skipping: bridge not enabled`),null;if(!G())return J(`no_oauth`,`[bridge:repl] Skipping: no OAuth tokens`),p?.(`failed`,`authentication required`),null;if(await g(),!f(`allow_remote_control`))return J(`policy_denied`,`[bridge:repl] Skipping: allow_remote_control policy not allowed`),p?.(`failed`,`disabled by your organization's policy`),null;if(!H()){let e=ne();if(e.bridgeOauthDeadExpiresAt!=null&&(e.bridgeOauthDeadFailCount??0)>=3&&oe()?.expiresAt===e.bridgeOauthDeadExpiresAt)return x(`[bridge:repl] Skipping: cross-process backoff (dead token seen ${e.bridgeOauthDeadFailCount} times)`),null;await ce();let t=oe();if(t&&t.expiresAt!==null&&t.expiresAt<=Date.now()){J(`oauth_expired_unrefreshable`,`[bridge:repl] Skipping: OAuth token expired and refresh failed (re-login required)`),p?.(`failed`,`authentication required`);let e=t.expiresAt;return te(t=>({...t,bridgeOauthDeadExpiresAt:e,bridgeOauthDeadFailCount:t.bridgeOauthDeadExpiresAt===e?(t.bridgeOauthDeadFailCount??0)+1:1})),null}}let w=U(),T=`remote-control-${o()}`,E=!1,O=!1;if(S)T=S,E=!0,O=!0;else{let e=i(),t=e?_(e):void 0;if(t)T=t,E=!0,O=!0;else if(h&&h.length>0)for(let e=h.length-1;e>=0;e--){let t=h[e];if(t.type!==`user`||t.isMeta||t.toolUseResult||t.isCompactSummary||t.origin&&t.origin.kind!==`human`||m(t))continue;let n=d(t.message.content);if(!n)continue;let r=st(n);if(r){T=r,E=!0;break}}}let k=0,A,j=0,ae=(e,t,n)=>{E=!0,T=e,x(`[bridge:repl] derived title from message ${n}: ${e}`),ve(t,e,{baseUrl:w,getAccessToken:G}).catch(()=>{})},M=(e,t)=>{let n=++j,r=k;be(e,AbortSignal.timeout(15e3)).then(e=>{e&&n===j&&A===t&&!_(i())&&ae(e,t,r)})},P=(e,t)=>{if(O||_(i()))return!0;if(A!==void 0&&A!==t&&(k=0),A=t,k++,k===1&&!E){let n=st(e);n&&ae(n,t,k),M(e,t)}else if(k===3){let n=v?.(),r=n?Se(s(n)):e;M(r,t)}return k>=3},F=W()?`self-hosted`:await se();if(!F)return J(`no_org_uuid`,`[bridge:repl] Skipping: no org UUID`),p?.(`failed`,`/login`),null;if(me()&&!ee){let e=await Ce();if(e)return J(`version_too_old`,`[bridge:repl] Skipping: ${e}`,!0),p?.(`failed`,"run `claude update` to upgrade"),null;x(`[bridge:repl] Using env-less bridge path (tengu_bridge_repl_v2)`);let{initEnvLessBridgeCore:i}=await import(`./remoteBridgeCore-Cddqv2WW.js`);return i({baseUrl:w,orgUUID:F,title:T,getAccessToken:G,onAuth401:N,toSDKMessages:Q,initialHistoryCap:200,initialMessages:h,onInboundMessage:t,onUserMessage:P,onPermissionResponse:n,onInterrupt:r,onSetModel:c,onSetMaxThinkingTokens:l,onSetPermissionMode:u,onStateChange:p,outboundOnly:C,tags:re})}let le=ge();if(le)return J(`version_too_old`,`[bridge:repl] Skipping: ${le}`),p?.(`failed`,"run `claude update` to upgrade"),null;let ue=await ie(),L=await D(),R=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||w;return rt({dir:a(),machineName:Je(),branch:ue,gitRepoUrl:L,title:T,baseUrl:w,sessionIngressUrl:R,workerType:`claude_code`,getAccessToken:G,createSession:e=>ye({...e,events:[],baseUrl:w,getAccessToken:G}),archiveSession:e=>X(e,{baseUrl:w,getAccessToken:G,timeoutMs:1500}).catch(e=>{x(`[bridge:repl] archiveBridgeSession threw: ${y(e)}`,{level:`error`})}),getCurrentTitle:()=>_(i())??T,onUserMessage:P,toSDKMessages:Q,onAuth401:N,getPollIntervalConfig:Oe,initialHistoryCap:200,initialMessages:h,previouslyFlushedUUIDs:b,onInboundMessage:t,onPermissionResponse:n,onInterrupt:r,onSetModel:c,onSetMaxThinkingTokens:l,onSetPermissionMode:u,onStateChange:p,perpetual:ee})}var ot=50;function st(e){let t=O(e),n=(/^(.*?[.!?])\s/.exec(t)?.[1]??t).replace(/\s+/g,` `).trim();if(n)return n.length>ot?n.slice(0,ot-1)+`…`:n}export{at as initReplBridge};
@@ -1,2 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Hw as t,Jw as n,Kw as r,Uw as i,Vw as a,Xw as o,Yw as s,Zw as c}from"./loadAgentsDir-ByO8eJqU.js";import{I as l,S as u,w as d,z as f}from"./debug-RZ4NuXyS.js";import{r as p,t as m}from"./promptEditor-R_acDAgI.js";import{dirname as h}from"path";import{mkdir as g,writeFile as _}from"fs/promises";function v(e){let t=new Set(r.map(e=>s(e.key)));return e.map(e=>{let n={};for(let[r,i]of Object.entries(e.bindings))t.has(s(r))||(n[r]=i);return{context:e.context,bindings:n}}).filter(e=>Object.keys(e.bindings).length>0)}function y(){return d({$schema:`https://www.schemastore.org/claude-code-keybindings.json`,$docs:`https://code.claude.com/docs/en/keybindings`,bindings:v(o)},null,2)+`
2
- `}var b=e((()=>{u(),c(),n()}));async function x(){if(!i())return{type:`text`,value:`Keybinding customization is not enabled. This feature is currently in preview.`};let e=a(),t=!1;await g(h(e),{recursive:!0});try{await _(e,y(),{encoding:`utf-8`,flag:`wx`})}catch(e){if(l(e)===`EEXIST`)t=!0;else throw e}let n=await m(e);return n.error?{type:`text`,value:`${t?`Opened`:`Created`} ${e}. Could not open in editor: ${n.error}`}:{type:`text`,value:t?`Opened ${e} in your editor.`:`Created ${e} with template. Opened in your editor.`}}e((()=>{t(),b(),f(),p()}))();export{x as call};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./language-s-dLbdVz.js";e();export{t as getResolvedLanguage};
@@ -1,3 +0,0 @@
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{Bl as l,Fl as u,Il as d,Ll as f,Ml as p,Nl as m,Pl as h,Rl as g,Vl as _,im as v,rm as y,zl as b}from"./loadAgentsDir-ByO8eJqU.js";function x(e){return e.mode===`list`?e.stores.length===0?(0,S.jsx)(n,{children:(0,S.jsx)(r,{dimColor:!0,children:`No memory stores found. Use /local-memory create <store> to create one.`})}):(0,S.jsxs)(n,{flexDirection:`column`,children:[(0,S.jsx)(n,{marginBottom:1,children:(0,S.jsxs)(r,{bold:!0,children:[`Local Memory Stores (`,e.stores.length,`)`]})}),e.stores.map(e=>(0,S.jsxs)(n,{children:[(0,S.jsx)(r,{children:` `}),(0,S.jsx)(r,{color:`success`,children:`◆`}),(0,S.jsxs)(r,{children:[` `,e]})]},e))]}):e.mode===`created`?(0,S.jsxs)(n,{children:[(0,S.jsx)(r,{color:`success`,children:`✓`}),(0,S.jsx)(r,{children:` Store created: `}),(0,S.jsx)(r,{bold:!0,children:e.store})]}):e.mode===`stored`?(0,S.jsxs)(n,{children:[(0,S.jsx)(r,{color:`success`,children:`✓`}),(0,S.jsx)(r,{children:` Stored entry `}),(0,S.jsx)(r,{bold:!0,children:e.key}),(0,S.jsx)(r,{children:` in `}),(0,S.jsx)(r,{bold:!0,children:e.store})]}):e.mode===`fetched`?(0,S.jsxs)(n,{flexDirection:`column`,children:[(0,S.jsxs)(n,{marginBottom:1,children:[(0,S.jsx)(r,{bold:!0,children:e.store}),(0,S.jsx)(r,{dimColor:!0,children:`/`}),(0,S.jsx)(r,{bold:!0,children:e.key})]}),(0,S.jsx)(n,{children:(0,S.jsx)(r,{children:e.value})})]}):e.mode===`not-found`?(0,S.jsxs)(n,{children:[(0,S.jsx)(r,{color:`error`,children:`Not found: `}),(0,S.jsx)(r,{bold:!0,children:e.store}),e.key?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(r,{dimColor:!0,children:`/`}),(0,S.jsx)(r,{bold:!0,children:e.key})]}):null]}):e.mode===`entries`?e.keys.length===0?(0,S.jsxs)(n,{children:[(0,S.jsx)(r,{dimColor:!0,children:`No entries in `}),(0,S.jsx)(r,{bold:!0,children:e.store}),(0,S.jsxs)(r,{dimColor:!0,children:[`. Use /local-memory store `,e.store,` <key> <value> to add one.`]})]}):(0,S.jsxs)(n,{flexDirection:`column`,children:[(0,S.jsxs)(n,{marginBottom:1,children:[(0,S.jsx)(r,{bold:!0,children:e.store}),(0,S.jsxs)(r,{dimColor:!0,children:[` (`,e.keys.length,` entries)`]})]}),e.keys.map(e=>(0,S.jsxs)(n,{children:[(0,S.jsx)(r,{children:` `}),(0,S.jsx)(r,{color:`success`,children:`·`}),(0,S.jsxs)(r,{children:[` `,e]})]},e))]}):e.mode===`archived`?(0,S.jsxs)(n,{children:[(0,S.jsx)(r,{color:`success`,children:`✓`}),(0,S.jsx)(r,{children:` Archived store: `}),(0,S.jsx)(r,{bold:!0,children:e.store}),(0,S.jsxs)(r,{dimColor:!0,children:[` (renamed to `,e.store,`.archived)`]})]}):(0,S.jsx)(n,{children:(0,S.jsxs)(r,{color:`error`,children:[`Error: `,e.message]})})}var S,C=e((()=>{i(),o(),S=c()}));function w(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.split(/\s+/),r=n[0];if(r===`list`)return{action:`list`};if(r===`create`){let e=n[1];return e?{action:`create`,store:e}:{action:`invalid`,reason:`create requires a store name. ${T}`}}if(r===`store`){let e=n[1],t=n[2];if(!e)return{action:`invalid`,reason:`store requires a store name. ${T}`};if(!t)return{action:`invalid`,reason:`store requires a key. ${T}`};let r=n.slice(3).join(` `);return r?{action:`store`,store:e,key:t,value:r}:{action:`invalid`,reason:`store requires a value. ${T}`}}if(r===`fetch`){let e=n[1],t=n[2];return e?t?{action:`fetch`,store:e,key:t}:{action:`invalid`,reason:`fetch requires a key. ${T}`}:{action:`invalid`,reason:`fetch requires a store name. ${T}`}}if(r===`entries`){let e=n[1];return e?{action:`entries`,store:e}:{action:`invalid`,reason:`entries requires a store name. ${T}`}}if(r===`archive`){let e=n[1];return e?{action:`archive`,store:e}:{action:`invalid`,reason:`archive requires a store name. ${T}`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${T}`}}var T,E=e((()=>{T=`Usage: /local-memory list | create STORE | store STORE KEY VALUE | fetch STORE KEY | entries STORE | archive STORE`}));function D(e){return async(t,n,r)=>{let i=e.parseArgs(r??``);if(O(i))return t(`Invalid args: ${i.reason}`,{display:`system`}),e.errorView(i.reason);try{let r=await e.dispatch(i,t,n);return r===null?null:k.createElement(e.View,r)}catch(n){let r=n instanceof Error?n.message:String(n);return e.onDispatchError?.(n),t(`${e.commandName} failed: ${r}`,{display:`system`}),e.errorView(r)}}}function O(e){return typeof e==`object`&&!!e&&`action`in e&&e.action===`invalid`}var k,A=e((()=>{k=t(i(),1)}));function j(e){return e.length===0?`No memory stores found.`:[`Local Memory Stores`,...e.map(e=>`- ${e}`)].join(`
2
- `)}function M(e,t){return t.length===0?`No entries in "${e}".`:[`Entries in "${e}"`,...t.map(e=>`- ${e}`)].join(`
3
- `)}function N({onDone:e}){let[t,i]=F.useState({kind:`menu`}),[o,c]=F.useState(0),[l,u]=F.useState(``),[v,x]=F.useState(0),[S,C]=F.useState(null),w=F.useCallback(e=>{i(e),u(``),x(0),C(null)},[]),T=F.useCallback(t=>e(t,{display:`system`}),[e]),E=F.useCallback((e,t,n,r,i={})=>{try{if(e===`list`){T(j(g()));return}if(e===`about`){T(L);return}if(!t){C(`Internal: missing store`);return}if(e===`create`){m(t),T(`Store created: ${t}`);return}if(e===`entries`){let e=f(t);T(M(t,e));return}if(e===`archive`){p(t),T(`Archived store: ${t}`);return}if(e===`fetch`){if(!n){C(`Internal: missing key`);return}let e=h(t,n);if(e===null){T(`Entry not found: ${t}/${n}`);return}T(`Entry fetched: ${t}/${n}\n\n${e}`);return}if(e===`store`){if(!n||r===void 0){C(`Internal: missing key or value`);return}if(!i.confirmedOverwrite&&h(t,n)!==null){w({kind:`confirm-overwrite`,store:t,key:n,value:r});return}b(t,n,r),T(`Stored ${t}/${n} (${r.length} chars)`);return}}catch(e){C(e instanceof Error?e.message:String(e))}},[T,w]);if(a((e,n)=>{if(t.kind!==`menu`)return;if(n.upArrow){c(e=>Math.max(0,e-1));return}if(n.downArrow){c(e=>Math.min(z.length-1,e+1));return}if(n.return){let e=z[o];if(!e)return;if(e.kind===`list`||e.kind===`about`){E(e.kind,void 0,void 0,void 0);return}w({kind:`collect-store`,action:e.kind});return}let r=Number(e);Number.isInteger(r)&&r>=1&&r<=z.length&&c(r-1)},{isActive:t.kind===`menu`}),a((e,n)=>{if(t.kind!==`confirm-archive`&&t.kind!==`confirm-overwrite`)return;if(n.escape){w({kind:`menu`});return}let r=e.toLowerCase();r===`y`||n.return?t.kind===`confirm-archive`?E(`archive`,t.store,void 0,void 0):E(`store`,t.store,t.key,t.value,{confirmedOverwrite:!0}):r===`n`&&w({kind:`menu`})},{isActive:t.kind===`confirm-archive`||t.kind===`confirm-overwrite`}),a((e,n)=>{if(!(t.kind!==`collect-store`&&t.kind!==`collect-key`&&t.kind!==`collect-value`)&&n.escape){if(t.kind===`collect-value`){w({kind:`collect-key`,action:t.action,store:t.store});return}if(t.kind===`collect-key`){w({kind:`collect-store`,action:t.action});return}w({kind:`menu`})}},{isActive:t.kind===`collect-store`||t.kind===`collect-key`||t.kind===`collect-value`}),t.kind===`menu`)return(0,I.jsx)(s,{title:`Local Memory`,subtitle:`${z.length} actions`,onCancel:()=>T(`Local memory panel dismissed`),color:`background`,hideInputGuide:!0,children:(0,I.jsxs)(n,{flexDirection:`column`,children:[z.map((e,t)=>(0,I.jsxs)(n,{flexDirection:`row`,children:[(0,I.jsx)(r,{children:`${t===o?`›`:` `} ${e.label}`.padEnd(R)}),(0,I.jsx)(r,{dimColor:!0,children:e.description})]},e.kind)),(0,I.jsx)(n,{marginTop:1,children:(0,I.jsx)(r,{dimColor:!0,children:`↑/↓ or 1-7 select · Enter run · Esc close`})})]})});if(t.kind===`confirm-archive`)return(0,I.jsx)(s,{title:`Confirm Archive`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,I.jsxs)(n,{flexDirection:`column`,children:[(0,I.jsxs)(r,{children:[`Archive store "`,t.store,`"? This renames it to *.archived.`]}),(0,I.jsx)(n,{marginTop:1,children:(0,I.jsx)(r,{dimColor:!0,children:`y/Enter = archive · n/Esc = cancel`})})]})});if(t.kind===`confirm-overwrite`)return(0,I.jsx)(s,{title:`Confirm Overwrite`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,I.jsxs)(n,{flexDirection:`column`,children:[(0,I.jsxs)(r,{children:[`Entry "`,t.store,`/`,t.key,`" already exists. Overwrite with new value (`,t.value.length,` chars)?`]}),(0,I.jsx)(n,{marginTop:1,children:(0,I.jsx)(r,{dimColor:!0,children:`y/Enter = overwrite · n/Esc = cancel`})})]})});let D=t.kind===`collect-store`?`STORE NAME`:t.kind===`collect-key`?`KEY NAME`:`VALUE`,O=t.kind===`collect-store`?`e.g. my-notes`:t.kind===`collect-key`?`e.g. todo-2026-05-08`:`free text`;return(0,I.jsx)(s,{title:`Local Memory · ${t.kind.replace(`collect-`,``).toUpperCase()}`,onCancel:()=>w({kind:`menu`}),color:`background`,hideInputGuide:!0,children:(0,I.jsxs)(n,{flexDirection:`column`,children:[(0,I.jsx)(n,{children:(0,I.jsx)(r,{dimColor:!0,children:D})}),(0,I.jsxs)(n,{children:[(0,I.jsx)(r,{children:`> `}),(0,I.jsx)(y,{value:l,onChange:e=>{u(e),C(null)},cursorOffset:v,onChangeCursorOffset:x,onSubmit:e=>{let n=e.trim();if(t.kind===`collect-store`){if(!n){C(`Store name required`);return}if(!d(n)){C(`Invalid store name (no /, \\, :, null byte, or leading dot; max 255 chars)`);return}t.action===`create`||t.action===`entries`||t.action===`archive`?t.action===`archive`?w({kind:`confirm-archive`,store:n}):E(t.action,n,void 0,void 0):w({kind:`collect-key`,action:t.action,store:n});return}if(t.kind===`collect-key`){if(!n){C(`Key required`);return}if(!_(n)){C(`Invalid key (allowed: letters/digits/._- only; no leading dot; not a Windows reserved name)`);return}t.action===`fetch`?E(`fetch`,t.store,n,void 0):w({kind:`collect-value`,action:`store`,store:t.store,key:n});return}t.kind===`collect-value`&&E(`store`,t.store,t.key,e)},placeholder:O,columns:70,showCursor:!0})]}),S!==null&&(0,I.jsx)(n,{marginTop:0,children:(0,I.jsxs)(r,{color:`warning`,children:[`✗ `,S]})}),(0,I.jsx)(n,{marginTop:1,children:(0,I.jsx)(r,{dimColor:!0,children:`Enter = next · Esc = back`})})]})})}async function P(e,t){if(e.action===`list`)return t(j(g()),{display:`system`}),null;if(e.action===`create`){let{store:n}=e;return m(n),t(`Store created: ${n}`,{display:`system`}),null}if(e.action===`store`){let{store:n,key:r,value:i}=e;return b(n,r,i),t(`Stored entry "${r}" in store "${n}".`,{display:`system`}),null}if(e.action===`fetch`){let{store:n,key:r}=e,i=h(n,r);return i===null?(t(`Entry not found: ${n}/${r}`,{display:`system`}),null):(t(`Entry fetched: ${n}/${r}\n${i}`,{display:`system`}),null)}if(e.action===`entries`){let{store:n}=e;return t(M(n,f(n)),{display:`system`}),null}if(e.action===`archive`){let{store:n}=e;return p(n),t(`Archived store: ${n}`,{display:`system`}),null}return t(L,{display:`system`}),null}var F,I,L,R,z,B,V;e((()=>{F=t(i(),1),o(),u(),l(),v(),C(),E(),A(),I=c(),L=`Usage: /local-memory list | create STORE | store STORE KEY VALUE | fetch STORE KEY | entries STORE | archive STORE`,R=26,z=[{kind:`list`,label:`List`,description:`Show all stores`},{kind:`create`,label:`Create`,description:`Create a new memory store`},{kind:`store`,label:`Store`,description:`Write an entry: store name + key + value`},{kind:`fetch`,label:`Fetch`,description:`Read an entry by store name + key`},{kind:`entries`,label:`Entries`,description:`List entry keys in a store`},{kind:`archive`,label:`Archive`,description:`Archive a store (rename to *.archived)`},{kind:`about`,label:`About`,description:`Show command syntax`}],B=D({commandName:`local-memory`,parseArgs:e=>{let t=w(e);return t.action===`invalid`?{action:`invalid`,reason:`${L}\n${t.reason}`}:t},dispatch:P,View:x,errorView:e=>F.createElement(x,{mode:`error`,message:e})}),V=async(e,t,n)=>(n??``).trim()===``?(0,I.jsx)(N,{onDone:e}):B(e,t,n)}))();export{V as callLocalMemory};
@@ -1,8 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,I as n,P as r,fi as i,t as a,x as o}from"./src-CDCSSo0U2.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{b as c,c as l,g as u,y as d}from"./config-CE058cvr.js";import{n as f,r as p}from"./analytics-CkYUHW_U.js";import{n as m,t as h}from"./ThemePicker-EQ6hPUeI.js";function g(e){return e}function _(e){let t=e.trim().toLowerCase();return t===``||t===`reset`?{sub:`full`}:x.has(t)?{sub:t}:{sub:`full`,unknownArg:t}}function v({onDone:e}){let[,n]=t();return(0,b.jsx)(o,{color:`permission`,children:(0,b.jsx)(h,{onThemeSelect:t=>{n(t),p(`tengu_onboarding_step`,{stepId:g(`theme`)}),e(`Theme set to ${t}.`)},onCancel:()=>e(`Theme picker dismissed.`),skipExitHandling:!0})})}function y({theme:e,hasCompletedOnboarding:t,lastOnboardingVersion:i}){return(0,b.jsxs)(n,{flexDirection:`column`,paddingLeft:1,children:[(0,b.jsx)(r,{bold:!0,children:`Onboarding status`}),(0,b.jsxs)(r,{children:[`- Theme: `,(0,b.jsx)(r,{bold:!0,children:e})]}),(0,b.jsxs)(r,{children:[`- Onboarding completed:`,` `,(0,b.jsx)(r,{bold:!0,color:t?`success`:`warning`,children:t?`yes`:`no`})]}),(0,b.jsxs)(r,{children:[`- Last onboarding version: `,(0,b.jsx)(r,{bold:!0,children:i})]}),(0,b.jsx)(r,{dimColor:!0,children:`Run /onboarding (no args) to re-run the full flow, or /onboarding theme | trust | model | mcp for a specific step.`})]})}var b,x,S;e((()=>{i(),a(),f(),m(),u(),b=s(),x=new Set([`full`,`theme`,`trust`,`model`,`mcp`,`status`]),S=async(e,t,n)=>{let{sub:r,unknownArg:i}=_(n);if(p(`tengu_onboarding_step`,{stepId:g(`slash_${r}`)}),i!==void 0)return e(`Unknown /onboarding subcommand: \`${i}\`.\nValid: full | theme | trust | model | mcp | status`,{display:`system`}),null;if(r===`theme`)return(0,b.jsx)(v,{onDone:t=>e(t)});if(r===`trust`)return d(e=>({...e,hasTrustDialogAccepted:!1})),e("Workspace trust cleared for the current project. The trust dialog will appear on the next `claude` launch.",{display:`system`}),null;if(r===`model`)return e("Run `/model` to pick the AI model. Onboarding does not own the model picker; this entry exists for discoverability only.",{display:`system`}),null;if(r===`mcp`)return e("MCP server setup:\n - `/mcp` — list configured MCP servers\n - `claude mcp add <name> <command>` — add a server (in your shell)\n - `claude mcp remove <name>` — remove a server\nServers also load from `.mcp.json` in the workspace and from `~/.claude.json` globally.",{display:`system`}),null;if(r===`status`){let e=l();return(0,b.jsx)(y,{theme:e.theme??`(unset)`,hasCompletedOnboarding:e.hasCompletedOnboarding===!0,lastOnboardingVersion:e.lastOnboardingVersion??`(unset)`})}return c(e=>({...e,hasCompletedOnboarding:!1})),e(`Onboarding flag cleared. The full first-run setup (theme, OAuth/API key, security notes, terminal-setup) will run on the next \`claude\` launch.
2
-
3
- For individual steps in this session, use:
4
- /onboarding theme — re-pick theme inline
5
- /onboarding trust — re-confirm workspace trust on next launch
6
- /onboarding model — open /model picker
7
- /onboarding mcp — show MCP setup hints
8
- /onboarding status — show current onboarding state`,{display:`system`}),null}}))();export{S as callOnboarding};