@readmagic/workmate 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (513) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-BSLHrjbt.js → AddWorkspaceDirectory-mANiG0xj.js} +1 -1
  2. package/dist/chunks/{App-DY5O6IKw.js → App-aUVaOLeo.js} +1 -1
  3. package/dist/chunks/{ApproveApiKey-BEzfC6r3.js → ApproveApiKey-36iUE5CW.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-DPdcp1CQ.js +1 -0
  5. package/dist/chunks/{AssistantSessionChooser-Ce3PraaD.js → AssistantSessionChooser-BLcvdkgb.js} +1 -1
  6. package/dist/chunks/BackgroundTasksDialog-DyjVt81B.js +2 -0
  7. package/dist/chunks/{BypassPermissionsModeDialog-B68V1bCq.js → BypassPermissionsModeDialog-CTlpvTuz.js} +1 -1
  8. package/dist/chunks/{ClaudeMdExternalIncludesDialog-CTWhpIm8.js → ClaudeMdExternalIncludesDialog-5pipE8m8.js} +1 -1
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-Dn7Le--z.js +1 -0
  10. package/dist/chunks/ConsoleOAuthFlow-BDr1Vx5K.js +1 -0
  11. package/dist/chunks/{DesktopHandoff-BRbU4is4.js → DesktopHandoff-Blg1TVut.js} +1 -1
  12. package/dist/chunks/{DiffDialog-CBluIK-x.js → DiffDialog-CUEpuocY.js} +2 -2
  13. package/dist/chunks/Doctor-B540I-gq.js +1 -0
  14. package/dist/chunks/Doctor-DlE1Mbb9.js +3 -0
  15. package/dist/chunks/ExitFlow-DCIhnP5h.js +2 -0
  16. package/dist/chunks/Feedback-CDTqPqsM.js +2 -0
  17. package/dist/chunks/{Grove--kttLxvs.js → Grove-D9lSG_Lh.js} +1 -1
  18. package/dist/chunks/Grove-DLYXL8hv.js +1 -0
  19. package/dist/chunks/{HybridTransport-BgV5_7Az.js → HybridTransport-8j0AviF6.js} +4 -4
  20. package/dist/chunks/{InvalidConfigDialog-DCGwXW_p.js → InvalidConfigDialog-I3t-0nU3.js} +1 -1
  21. package/dist/chunks/{InvalidSettingsDialog-jTwsdXWr.js → InvalidSettingsDialog-BnthOxGT.js} +1 -1
  22. package/dist/chunks/MCPConnectionManager-zdocEDgk.js +1 -0
  23. package/dist/chunks/{McpParsingWarnings-WQrWJeWP.js → McpParsingWarnings-D0XvLirX.js} +1 -1
  24. package/dist/chunks/MessageSelector-BBhCstBa.js +3 -0
  25. package/dist/chunks/Messages-Dv2VrytX.js +11 -0
  26. package/dist/chunks/{Onboarding-BoIVNCgc.js → Onboarding-B1WRpoBI.js} +1 -1
  27. package/dist/chunks/{OverageCreditUpsell-1FCN8bH3.js → OverageCreditUpsell-BSmgq089.js} +1 -1
  28. package/dist/chunks/PluginSettings-DN9rpwc_.js +17 -0
  29. package/dist/chunks/{PromptInputFooterSuggestions-CrGST0Cq.js → PromptInputFooterSuggestions-3rjz6zhK.js} +1 -1
  30. package/dist/chunks/{PromptInputHelpMenu-B2TDpbpw.js → PromptInputHelpMenu-DgDJHZqC.js} +1 -1
  31. package/dist/chunks/QueryEngine-BnaHDZVZ.js +1 -0
  32. package/dist/chunks/REPL-B3RbzeV7.js +1 -0
  33. package/dist/chunks/{REPL-BV4WyYMg.js → REPL-CA8FEO7J.js} +44 -44
  34. package/dist/chunks/{RemoteCallout-DS_EV6Fh.js → RemoteCallout-BFzCx_Pn.js} +1 -1
  35. package/dist/chunks/RemoteSessionManager-BhUrtejX.js +2 -0
  36. package/dist/chunks/ResumeConversation-BseKUFRI.js +1 -0
  37. package/dist/chunks/{SSETransport-BXiEBMpb.js → SSETransport-DGIytG74.js} +3 -3
  38. package/dist/chunks/SearchExtraToolsTool-h6OunbMd.js +1 -0
  39. package/dist/chunks/Settings-BvhG1XoW.js +2 -0
  40. package/dist/chunks/{TeleportProgress-CcDzMC5L.js → TeleportProgress-Bens06DU.js} +1 -1
  41. package/dist/chunks/{TeleportRepoMismatchDialog-DZbxl4sD.js → TeleportRepoMismatchDialog-BtLBCZUe.js} +1 -1
  42. package/dist/chunks/{TeleportResumeWrapper-EowJO5nm.js → TeleportResumeWrapper-t50LfWyN.js} +1 -1
  43. package/dist/chunks/{ThemePicker-BYbChJpu.js → ThemePicker-BTfuZZ7E.js} +1 -1
  44. package/dist/chunks/TrustDialog-CgE_pYUK.js +1 -0
  45. package/dist/chunks/{ValidationErrorsList-Cx-hoRwG.js → ValidationErrorsList-Bl68E-2-.js} +1 -1
  46. package/dist/chunks/WelcomeV2-C93xQYAF.js +1 -0
  47. package/dist/chunks/{add-dir-CWt69NAZ.js → add-dir-C3IhJYVH.js} +1 -1
  48. package/dist/chunks/{agentDisplay-CQ4mZWFH.js → agentDisplay-Cju-aXCx.js} +1 -1
  49. package/dist/chunks/{agents-D4clhuCl.js → agents-Bhg0CtXR.js} +7 -7
  50. package/dist/chunks/{agents-C6jzKOit.js → agents-Du3FQ82k.js} +1 -1
  51. package/dist/chunks/{allErrors-HMPqE0jK.js → allErrors-DJYCAtab.js} +1 -1
  52. package/dist/chunks/{ant-9Z5bppVC.js → ant-CVvy4SuO.js} +1 -1
  53. package/dist/chunks/api-CI8HXREw.js +1 -0
  54. package/dist/chunks/api-gJBnC8z3.js +1 -0
  55. package/dist/chunks/asciicast-BsWpcxrc.js +1 -0
  56. package/dist/chunks/{asciicast-n-BBfgDq.js → asciicast-CbAjUHT_.js} +4 -4
  57. package/dist/chunks/{assistant-BA9_Mo9U.js → assistant-C83quuNj.js} +1 -1
  58. package/dist/chunks/{assistant-BiNOSla3.js → assistant-C_SkUDk_.js} +1 -1
  59. package/dist/chunks/assistant-z2o4-UJe.js +1 -0
  60. package/dist/chunks/auth-B9V3i5oZ.js +1 -0
  61. package/dist/chunks/auth-CgEABs3i.js +15 -0
  62. package/dist/chunks/auth-fSFfSKy_.js +1 -0
  63. package/dist/chunks/{autoMode-Db4QrgFr.js → autoMode-CZyb-mMY.js} +7 -7
  64. package/dist/chunks/{autonomy-BkAMA7du.js → autonomy-BpINX4jw.js} +1 -1
  65. package/dist/chunks/{autonomy-D4Vy-RPQ.js → autonomy-DJZ25xZp.js} +7 -7
  66. package/dist/chunks/{autonomyPanel-EjfO8jvg.js → autonomyPanel-ssoiIOx5.js} +1 -1
  67. package/dist/chunks/{backgroundHousekeeping-hDDE8mJC.js → backgroundHousekeeping-BHncba6e.js} +3 -3
  68. package/dist/chunks/backgroundHousekeeping-QK8iEXoI.js +1 -0
  69. package/dist/chunks/{banner-hD6wZygx.js → banner-CWkrK10u.js} +1 -1
  70. package/dist/chunks/bg-B0iMGM9C.js +1 -0
  71. package/dist/chunks/{bg-DQ0Q3Qv-.js → bg-WnYN5ifx.js} +2 -2
  72. package/dist/chunks/{branch-CeQ9IyZk.js → branch-BXo5z2al.js} +1 -1
  73. package/dist/chunks/{break-cache-Bd0clV2N.js → break-cache-BQfgkNAo.js} +2 -2
  74. package/dist/chunks/{bridge-yerAiaK2.js → bridge-CbKc1HeD.js} +2 -2
  75. package/dist/chunks/bridgeConfig-CLHy-BiF.js +1 -0
  76. package/dist/chunks/{bridgeConfig-CCtXe8ak.js → bridgeConfig-DbqUHe0H.js} +1 -1
  77. package/dist/chunks/bridgeEnabled-BWSUZ7Xg.js +1 -0
  78. package/dist/chunks/{bridgeEnabled--F-6TUi4.js → bridgeEnabled-CM3SaumJ.js} +1 -1
  79. package/dist/chunks/bridgeMain-BESKzpm0.js +1 -0
  80. package/dist/chunks/bridgeMain-CzhBVCsN.js +68 -0
  81. package/dist/chunks/bridgeMessaging-lfa_v3oi.js +1 -0
  82. package/dist/chunks/bridgePointer-MqLe5Asm.js +1 -0
  83. package/dist/chunks/{browser-Bd7GeBH1.js → browser-BmZuQom6.js} +1 -1
  84. package/dist/chunks/{btw-CVGRmL9a.js → btw-Cp0whJaJ.js} +1 -1
  85. package/dist/chunks/{caches-BtmAri4e.js → caches-CmW7idg5.js} +2 -2
  86. package/dist/chunks/caches-CpqTC0Lb.js +1 -0
  87. package/dist/chunks/ccrClient-BPXmxWHw.js +1 -0
  88. package/dist/chunks/{claudeDesktop-aUMx06RK.js → claudeDesktop-Cx31Ugjp.js} +1 -1
  89. package/dist/chunks/{clear-C6nRzIQE.js → clear-DjGPxX7T.js} +1 -1
  90. package/dist/chunks/{cliLaunch-2AUoMnqx.js → cliLaunch-BkPAatcs.js} +1 -1
  91. package/dist/chunks/client-DPUvQ6Rf.js +1 -0
  92. package/dist/chunks/{color-DXI_4ibU.js → color-DYYBN52b.js} +1 -1
  93. package/dist/chunks/commands-D7l3P1k9.js +1 -0
  94. package/dist/chunks/commitAttribution-B7NUPJ8E.js +1 -0
  95. package/dist/chunks/{commitAttribution-Cm40fdNU.js → commitAttribution-Bmzgtqc6.js} +2 -2
  96. package/dist/chunks/compact-D6xqZN4Q.js +2 -0
  97. package/dist/chunks/{completionCache-BQaLkB4d.js → completionCache-MN3_MqK8.js} +2 -2
  98. package/dist/chunks/completionCache-c4aiyZ_f.js +1 -0
  99. package/dist/chunks/config-DiT2Z8dY.js +3 -0
  100. package/dist/chunks/config-huQaTcNb.js +1 -0
  101. package/dist/chunks/config-qLaiAn7z.js +1 -0
  102. package/dist/chunks/{context-C_cKrBUn.js → context-Bh_iUj76.js} +1 -1
  103. package/dist/chunks/context-noninteractive-CNot6jbs.js +1 -0
  104. package/dist/chunks/{context-noninteractive-DnH6Q9Lu.js → context-noninteractive-Cb3EM2Oz.js} +2 -2
  105. package/dist/chunks/conversation-CSpwF3Ha.js +1 -0
  106. package/dist/chunks/conversation-CvCQta8e.js +1 -0
  107. package/dist/chunks/{createSSHSession--bWmmIk9.js → createSSHSession-B0s839mX.js} +5 -5
  108. package/dist/chunks/createSession-GNSNbUbN.js +1 -0
  109. package/dist/chunks/{createSession-DIr4sUp6.js → createSession-VMTMXOHu.js} +1 -1
  110. package/dist/chunks/crossProjectResume-DGpgCUfk.js +40 -0
  111. package/dist/chunks/cwd--nvsx73T.js +1 -0
  112. package/dist/chunks/{cwd-BuJhkTrc.js → cwd-CYmmnQVS.js} +1 -1
  113. package/dist/chunks/{daemon-B9lBPdBJ.js → daemon-YtZbMQtn.js} +1 -1
  114. package/dist/chunks/datadog-D9rlcN12.js +1 -0
  115. package/dist/chunks/{debug-IKW-jE7K.js → debug-BrXObCdR.js} +2 -2
  116. package/dist/chunks/{debugUtils-D2981c0Z.js → debugUtils-NO5KtXqi.js} +1 -1
  117. package/dist/chunks/{desktop-B5cvrcOQ.js → desktop-DidI-4N5.js} +1 -1
  118. package/dist/chunks/{detached-rfIUyc-B.js → detached-TYk4hMFj.js} +1 -1
  119. package/dist/chunks/{detectRepository-ReZ0Fz8Z.js → detectRepository-BPr0VWNO.js} +1 -1
  120. package/dist/chunks/detectRepository-BTPgN89l.js +1 -0
  121. package/dist/chunks/{diff-cXAp9cNN.js → diff-CZg5qL2n.js} +1 -1
  122. package/dist/chunks/{directoryCompletion-DBM2o5kx.js → directoryCompletion-CW2ckkQg.js} +1 -1
  123. package/dist/chunks/doctor-CKUXGCri.js +1 -0
  124. package/dist/chunks/{effort-Br8KKHdx.js → effort-BcvNemuq.js} +2 -2
  125. package/dist/chunks/entry-dA1UCfC0.js +14 -0
  126. package/dist/chunks/envLessBridgeConfig-BFjJ8Kt4.js +1 -0
  127. package/dist/chunks/envLessBridgeConfig-bei51W3H.js +1 -0
  128. package/dist/chunks/esm-DjGYYlQe.js +1 -0
  129. package/dist/chunks/{execFileNoThrow-COKYqVQj.js → execFileNoThrow-D244NytW.js} +1 -1
  130. package/dist/chunks/execSyncWrapper-CCMQShK-.js +1 -0
  131. package/dist/chunks/exit-COMnVxzw.js +1 -0
  132. package/dist/chunks/extra-usage-BTv_OwGN.js +1 -0
  133. package/dist/chunks/extra-usage-By33zGLT.js +1 -0
  134. package/dist/chunks/{extra-usage-core-CdL1ltqq.js → extra-usage-core-RZMzaH0L.js} +1 -1
  135. package/dist/chunks/{extra-usage-noninteractive-DxxRI0Yx.js → extra-usage-noninteractive-BB-BQ3kh.js} +1 -1
  136. package/dist/chunks/{extraUsage-BYZdi44Y.js → extraUsage-CTn9FWSk.js} +1 -1
  137. package/dist/chunks/extractMemories-CXGZGe0h.js +1 -0
  138. package/dist/chunks/fast-BXzdzzXU.js +1 -0
  139. package/dist/chunks/{fast-DKqiojzf.js → fast-CNXgsvnE.js} +1 -1
  140. package/dist/chunks/{feedback-yB19xph5.js → feedback-DeJ2gvw2.js} +1 -1
  141. package/dist/chunks/{file-D1cN3LMK.js → file-DcZWPH2V.js} +5 -5
  142. package/dist/chunks/{files-DAzGtmzz.js → files-Cz1-PK3r.js} +1 -1
  143. package/dist/chunks/firstPartyEventLogger-CQdJn3LV.js +5 -0
  144. package/dist/chunks/firstPartyEventLogger-CdLshdJY.js +1 -0
  145. package/dist/chunks/{flushGate-ZFr8yv7F.js → flushGate-CJ73xcaK.js} +1 -1
  146. package/dist/chunks/gemini-Cn9bMXwP.js +1 -0
  147. package/dist/chunks/generateRecap-BO9kzRon.js +1 -0
  148. package/dist/chunks/{generateSessionName-48veu5dv.js → generateSessionName-CGpL6ATy.js} +1 -1
  149. package/dist/chunks/{genericProcessUtils-F1Qcb1sO.js → genericProcessUtils-CdQTApYX.js} +1 -1
  150. package/dist/chunks/git-CbcnOf0E.js +1 -0
  151. package/dist/chunks/git-Do0wJvux.js +6 -0
  152. package/dist/chunks/{githubRepoPathMapping-BlR0BphY.js → githubRepoPathMapping-C4umZ1oC.js} +1 -1
  153. package/dist/chunks/{goal-Bn8Kz2Dp.js → goal-C8Qzl7_i.js} +3 -3
  154. package/dist/chunks/{grok-DhnO_KDC.js → grok-CDT9P_BL.js} +1 -1
  155. package/dist/chunks/{grove-DotW04-v.js → grove-BGXzEyH9.js} +2 -2
  156. package/dist/chunks/{heapdump-DkZSKNbp.js → heapdump-CFHvdSZv.js} +5 -5
  157. package/dist/chunks/{help-DU_BcZtU.js → help-DUZ7Y7Em.js} +1 -1
  158. package/dist/chunks/{hooks-BTMWE5Qx.js → hooks-RHwUCXcT.js} +2 -2
  159. package/dist/chunks/hooks-fZ1r0jUF.js +1 -0
  160. package/dist/chunks/{hostGuard-Dh296c6q.js → hostGuard-C5xydXZI.js} +1 -1
  161. package/dist/chunks/inboundAttachments-Cfl4_n0S.js +1 -0
  162. package/dist/chunks/inboundAttachments-YMxf4fmR.js +1 -0
  163. package/dist/chunks/initReplBridge-GH3-LHF4.js +1 -0
  164. package/dist/chunks/install-OkuNmjmB.js +1 -0
  165. package/dist/chunks/{instrumentation-H0XRS1yG.js → instrumentation-hrXeo-G4.js} +6 -6
  166. package/dist/chunks/{job-DKtLkF8V.js → job-DjmIpwJl.js} +1 -1
  167. package/dist/chunks/jwtUtils-DE2GPUcx.js +1 -0
  168. package/dist/chunks/keybindings-B8U17bhs.js +2 -0
  169. package/dist/chunks/{language-BuRSO2sR.js → language-BA5WprZv.js} +1 -1
  170. package/dist/chunks/language-BbaOTWm3.js +1 -0
  171. package/dist/chunks/{launchAgentsPlatform-BQyPdrHp.js → launchAgentsPlatform-DnxH2SAn.js} +1 -1
  172. package/dist/chunks/{launchLocalMemory-CWHAj7CX.js → launchLocalMemory-CgXtGng1.js} +2 -2
  173. package/dist/chunks/{launchLocalVault-D8iJdtsP.js → launchLocalVault-Bs6Km3Ua.js} +3 -3
  174. package/dist/chunks/{launchMemoryStores-W7jWG2uH.js → launchMemoryStores-DxVAIJuB.js} +1 -1
  175. package/dist/chunks/{launchOnboarding-q__LaLy1.js → launchOnboarding-Cn0t_o2k.js} +1 -1
  176. package/dist/chunks/{launchSchedule-BWi9F5vh.js → launchSchedule-Chwr3Nzd.js} +1 -1
  177. package/dist/chunks/{launchSkillStore-4wd4MQBc.js → launchSkillStore-6zxJfWVU.js} +1 -1
  178. package/dist/chunks/{launchTeleport-BlCf2QM_.js → launchTeleport-Ba_Hj13c.js} +1 -1
  179. package/dist/chunks/{launchVault-C7u7LZV7.js → launchVault-hGVrHy33.js} +1 -1
  180. package/dist/chunks/{v4-jw6qOKwQ.js → lazySchema-DcIJE_0i.js} +1 -1
  181. package/dist/chunks/loadAgentsDir-BHOyHxwz.js +1 -0
  182. package/dist/chunks/{loadAgentsDir-nzr38hai.js → loadAgentsDir-DrDu5yYy.js} +691 -689
  183. package/dist/chunks/loadPluginHooks-s7bvGtns.js +1 -0
  184. package/dist/chunks/localSearch-CebU5BA9.js +1 -0
  185. package/dist/chunks/{localSearch-B-L_ldos.js → localSearch-_bQhk9W6.js} +1 -1
  186. package/dist/chunks/{log-B3eB4EFv.js → log-BMCygSzM.js} +1 -1
  187. package/dist/chunks/{logoV2Utils-RQ160dI2.js → logoV2Utils-CoC4nheD.js} +1 -1
  188. package/dist/chunks/{magicDocs-BqZ0GewA.js → magicDocs-kMjYpjCA.js} +3 -3
  189. package/dist/chunks/main-C_rVSWfm.js +859 -0
  190. package/dist/chunks/{main-DeFMhaFE.js → main-D862LI_d.js} +3 -3
  191. package/dist/chunks/{mappers-CWykjGfP.js → mappers-D0CNXG32.js} +1 -1
  192. package/dist/chunks/mcp-1ZuFesM9.js +2 -0
  193. package/dist/chunks/mcp-CKvGBEjz.js +1 -0
  194. package/dist/chunks/mcp-DtxIl6aN.js +6 -0
  195. package/dist/chunks/{memoize-BO31Ws9Q.js → memoize-B0zhbT8Z.js} +1 -1
  196. package/dist/chunks/{memory-DcpPpYN0.js → memory-DE2jtkd_.js} +1 -1
  197. package/dist/chunks/{mode-BkViT_0o.js → mode-B4WIxCMW.js} +2 -2
  198. package/dist/chunks/model-C4RHNhDQ.js +1 -0
  199. package/dist/chunks/model-fi472PRc.js +1 -0
  200. package/dist/chunks/{model-CZktWw6o.js → model-j9GNZDFr.js} +1 -1
  201. package/dist/chunks/nativeInstaller-DktvrWRd.js +1 -0
  202. package/dist/chunks/{onChangeAppState-DwGVi-BC.js → onChangeAppState-CGVeNkt7.js} +1 -1
  203. package/dist/chunks/{openai-B2wxZDQx.js → openai-BSVjSJiF.js} +3 -3
  204. package/dist/chunks/{overageCreditGrant-CjK49axw.js → overageCreditGrant-BVxlYgeU.js} +1 -1
  205. package/dist/chunks/{panel-R4ue6pSW.js → panel-Be-OxtqL.js} +1 -1
  206. package/dist/chunks/{panel-B-nrcHpm.js → panel-CrTPqXCv.js} +1 -1
  207. package/dist/chunks/{panelCall-I_fbgub5.js → panelCall-Cp6fpQeL.js} +1 -1
  208. package/dist/chunks/parser-Bf6iasPV.js +1 -0
  209. package/dist/chunks/{parser-CQrasoUB.js → parser-DFwaTGf7.js} +1 -1
  210. package/dist/chunks/{partition-CxRF7T-f.js → partition-RjCtgt9J.js} +1 -1
  211. package/dist/chunks/{passes-U_h-hNu-.js → passes-ByTLy6pj.js} +1 -1
  212. package/dist/chunks/{path-BCSE0S-c.js → path-D5U-tm91.js} +1 -1
  213. package/dist/chunks/permissions-B3df_htx.js +3 -0
  214. package/dist/chunks/pidLock-CdNZ0Wfg.js +3 -0
  215. package/dist/chunks/{pipeTransport-D3Qx9v1V.js → pipeTransport-CqCnc-Ys.js} +1 -1
  216. package/dist/chunks/{plan-BAhStVci.js → plan-BxTA-b4l.js} +1 -1
  217. package/dist/chunks/{platform-EtecGacO.js → platform-BrYefG_2.js} +1 -1
  218. package/dist/chunks/{plugin-D9huNnv6.js → plugin-DOpl5e1t.js} +1 -1
  219. package/dist/chunks/{pluginAutoupdate-BfmyxR5g.js → pluginAutoupdate-L09CQ-ph.js} +1 -1
  220. package/dist/chunks/pluginBlocklist-B32eWmzn.js +1 -0
  221. package/dist/chunks/pluginCliCommands-CDMWnO3d.js +1 -0
  222. package/dist/chunks/{pluginFlagging-BVy7Xv_0.js → pluginFlagging-3FQGvIfq.js} +1 -1
  223. package/dist/chunks/pluginOperations-ClzXYNQe.js +2 -0
  224. package/dist/chunks/{pluginStartupCheck-w24D-wwk.js → pluginStartupCheck-BNd2QNzZ.js} +1 -1
  225. package/dist/chunks/pluginStartupCheck-RiZxW-WU.js +1 -0
  226. package/dist/chunks/plugins-CcDG95Bs.js +4 -0
  227. package/dist/chunks/policyLimits-Bwi9VqDF.js +1 -0
  228. package/dist/chunks/pollConfig-DH2oCtFS.js +1 -0
  229. package/dist/chunks/{poor-CfbMKZNJ.js → poor-DekfGNT7.js} +1 -1
  230. package/dist/chunks/poorMode-AE4WNYZo.js +1 -0
  231. package/dist/chunks/{poorMode-Bsw2V-V_.js → poorMode-CtcqaiwD.js} +1 -1
  232. package/dist/chunks/print-Cc_QOSPF.js +23 -0
  233. package/dist/chunks/{privacy-settings-DeGoBRrZ.js → privacy-settings-ChNsgGUs.js} +1 -1
  234. package/dist/chunks/processBashCommand-Bx6_oZoE.js +1 -0
  235. package/dist/chunks/processSlashCommand-AltWgIFt.js +5 -0
  236. package/dist/chunks/prompt-C0nU0VK3.js +139 -0
  237. package/dist/chunks/prompt-CYx145pp.js +1 -0
  238. package/dist/chunks/prompt-DH3lKFag.js +1 -0
  239. package/dist/chunks/{promptEditor-foiayhdY.js → promptEditor-Cumef6hJ.js} +2 -2
  240. package/dist/chunks/{protocolHandler-BsiB1oW_.js → protocolHandler-z2zxAtB1.js} +4 -4
  241. package/dist/chunks/{proxy-Cn2YwITp.js → proxy-CRN7jYIi.js} +3 -3
  242. package/dist/chunks/{rate-limit-options-DTJPDcTr.js → rate-limit-options-VL7S3SCx.js} +1 -1
  243. package/dist/chunks/rcDebugLog-2-1XSyFV.js +11 -0
  244. package/dist/chunks/reconciler-DHRE_gV2.js +4 -0
  245. package/dist/chunks/{referral-DP_GshTS.js → referral-DrebVwqx.js} +1 -1
  246. package/dist/chunks/refresh-pFezssA8.js +1 -0
  247. package/dist/chunks/{registerProtocol-CjxlFsKw.js → registerProtocol-CukLQuxJ.js} +5 -5
  248. package/dist/chunks/{release-notes-BxgK8zWO.js → release-notes-D7vrFNXp.js} +1 -1
  249. package/dist/chunks/{releaseNotes-CbSktIJW.js → releaseNotes-CDx2P0fb.js} +2 -2
  250. package/dist/chunks/{reload-plugins-CDu6yU5-.js → reload-plugins-CltHfg-l.js} +1 -1
  251. package/dist/chunks/{remote-env-B4HnhISc.js → remote-env-SvvSuP0J.js} +1 -1
  252. package/dist/chunks/remoteBridgeCore-BOeljn2c.js +1 -0
  253. package/dist/chunks/remoteManagedSettings-CaY_ZH8r.js +1 -0
  254. package/dist/chunks/{rename-DlbMb24l.js → rename-CbqrCCBO.js} +1 -1
  255. package/dist/chunks/{renderOptions-5kWQpVr2.js → renderOptions-BUJB9nAm.js} +1 -1
  256. package/dist/chunks/{resume-BB5iBogS.js → resume-DockJaY9.js} +2 -2
  257. package/dist/chunks/{ripgrep-BvDwiKJ3.js → ripgrep-BXmXjAzA.js} +1 -1
  258. package/dist/chunks/ripgrep-BfIpz5uC.js +1 -0
  259. package/dist/chunks/{runtimeObserver-BNH2WGE3.js → runtimeObserver-DSUuYKfs.js} +1 -1
  260. package/dist/chunks/{runtimeObserver-Ci-5gvYg.js → runtimeObserver-XufSllVw.js} +4 -4
  261. package/dist/chunks/sandbox-adapter-CEZnHq0U.js +1 -0
  262. package/dist/chunks/{sandbox-toggle-B2Yk4y2V.js → sandbox-toggle-CZI5fuK3.js} +1 -1
  263. package/dist/chunks/searchExtraTools-iQfI39wB.js +1 -0
  264. package/dist/chunks/{session-Bmx7L3Mt.js → session-B-Z3DU9o.js} +2 -2
  265. package/dist/chunks/{sessionDiscovery-DcEAr5vJ.js → sessionDiscovery-C3pMZkBM.js} +1 -1
  266. package/dist/chunks/sessionFileAccessHooks-DyrZmoA7.js +1 -0
  267. package/dist/chunks/sessionMemory-CqRpgwtU.js +1 -0
  268. package/dist/chunks/sessionMemory-D_HQmhj7.js +1 -0
  269. package/dist/chunks/sessionMemoryUtils-CZOIKrn0.js +1 -0
  270. package/dist/chunks/sessionObserver-B400YG3s.js +1 -0
  271. package/dist/chunks/{sessionObserver-DQwHsDrM.js → sessionObserver-B_09FQKV.js} +1 -1
  272. package/dist/chunks/sessionStorage-DRnvtrpU.js +1 -0
  273. package/dist/chunks/sessionTitle-CmLWNFuX.js +14 -0
  274. package/dist/chunks/{sessionTracing-BuLsL6qA.js → sessionTracing-lArOaj9u.js} +3 -3
  275. package/dist/chunks/settings-DfWP5y6X.js +19 -0
  276. package/dist/chunks/settingsSync-BlDk6rsM.js +1 -0
  277. package/dist/chunks/setup-DdbmxSZh.js +3 -0
  278. package/dist/chunks/{shadowedRuleDetection-7Z8ezTKF.js → shadowedRuleDetection-E2wF1UjU.js} +1 -1
  279. package/dist/chunks/{shellQuote-fB02N16J.js → shellQuote-DkSy9MYE.js} +1 -1
  280. package/dist/chunks/{sideQuestion-CYdNATPW.js → sideQuestion-BjHCLSR9.js} +1 -1
  281. package/dist/chunks/sinks-Cb--pqr-.js +2 -0
  282. package/dist/chunks/sinks-DbwDBd-E.js +1 -0
  283. package/dist/chunks/{skill-learning-E8tQed-Q.js → skill-learning-B0dyBT1_.js} +1 -1
  284. package/dist/chunks/skillChangeDetector-DQof8SUY.js +1 -0
  285. package/dist/chunks/{skillGapStore-CjJrxxjk.js → skillGapStore-75ZYlfwi.js} +2 -2
  286. package/dist/chunks/{skillGapStore-B5rl12bV.js → skillGapStore-D2fqmnKx.js} +1 -1
  287. package/dist/chunks/{skillGenerator-BDR_z3-X.js → skillGenerator-CwXUfM4Y.js} +2 -2
  288. package/dist/chunks/{skillLearning-BQtfFE0g.js → skillLearning-CB-5fdMl.js} +1 -1
  289. package/dist/chunks/skillLearning-CSY5R5Jn.js +1 -0
  290. package/dist/chunks/{skillPanel-yR8Oi-mO.js → skillPanel-Bum7xpgo.js} +3 -3
  291. package/dist/chunks/{skillSearchPanel-DUQQUCUS.js → skillSearchPanel-LSPwZIOw.js} +6 -6
  292. package/dist/chunks/{skills-NAZQ3j-t.js → skills-G8WBeffd.js} +1 -1
  293. package/dist/chunks/startupProfiler-DIWVcO4e.js +1 -0
  294. package/dist/chunks/{startupProfiler-DxRQteII.js → startupProfiler-xa3NmN7Z.js} +2 -2
  295. package/dist/chunks/state-BOa-3Av3.js +1 -0
  296. package/dist/chunks/{state-4KQ3kaqz.js → state-ix0xIunV.js} +1 -1
  297. package/dist/chunks/{stats-h4yu84Q-.js → stats-DmFubHpI.js} +1 -1
  298. package/dist/chunks/{status-is_Bg_IB.js → status-ClSsvm1N.js} +2 -2
  299. package/dist/chunks/{status-BbdeubJG.js → status-i5beKggW.js} +1 -1
  300. package/dist/chunks/{statusNoticeHelpers-CQ7CUugR.js → statusNoticeHelpers-BK-54uGY.js} +1 -1
  301. package/dist/chunks/{stickers-qJoNhPk4.js → stickers-D5teCKMN.js} +1 -1
  302. package/dist/chunks/{stringUtils-CvXbHQRH.js → stringUtils-DGLPkqJ4.js} +1 -1
  303. package/dist/chunks/systemPromptSections-CR_AoPIX.js +1 -0
  304. package/dist/chunks/{systemPromptSections-CgpggIYX.js → systemPromptSections-DN0HGVye.js} +1 -1
  305. package/dist/chunks/{tag-i3HZ4lhj.js → tag-DYYq4H_i.js} +2 -2
  306. package/dist/chunks/{tasks-HzsYNTZ1.js → tasks-BySzm_YJ.js} +1 -1
  307. package/dist/chunks/teleport-dxtBcM01.js +1 -0
  308. package/dist/chunks/{templateJobs-CIv_ysje.js → templateJobs-CT5VxeRr.js} +1 -1
  309. package/dist/chunks/terminalSetup-BNs9nLbT.js +33 -0
  310. package/dist/chunks/{terminalSetup-CxniwSF-.js → terminalSetup-RDKg8dVa.js} +1 -1
  311. package/dist/chunks/{theme-BKIHX_Dx.js → theme-CVTVsRwt.js} +1 -1
  312. package/dist/chunks/thinkback-B-GpXG9U.js +1 -0
  313. package/dist/chunks/thinkback-CXsRbDYN.js +1 -0
  314. package/dist/chunks/thinkback-play-BhfCaIye.js +1 -0
  315. package/dist/chunks/{tmux-CbsW-VDJ.js → tmux-BY7IdQ1f.js} +1 -1
  316. package/dist/chunks/{toolEventObserver-B1xvyKdE.js → toolEventObserver--4fqXxQZ.js} +1 -1
  317. package/dist/chunks/{toolEventObserver-8FQtxeVv.js → toolEventObserver-DdhPsAs1.js} +1 -1
  318. package/dist/chunks/toolPool-DvHECcbN.js +1 -0
  319. package/dist/chunks/trustedDevice-DvpN4J1F.js +1 -0
  320. package/dist/chunks/trustedDevice-e6iF1X7C.js +1 -0
  321. package/dist/chunks/{tui-fTa_pzdA.js → tui-C2yuCuOU.js} +3 -3
  322. package/dist/chunks/{types-a7X-tJpJ.js → types-C-MRCL8J.js} +3 -3
  323. package/dist/chunks/udsClient-BuCtv7dN.js +1 -0
  324. package/dist/chunks/{ultrareviewCommand-DCFRZsKp.js → ultrareviewCommand-i3PfFKly.js} +2 -2
  325. package/dist/chunks/undercover-CPvoDtJ1.js +1 -0
  326. package/dist/chunks/{undercover-CsLPQb-a.js → undercover-Q24TWRw0.js} +3 -3
  327. package/dist/chunks/{up-dO5BcPaq.js → up-BHkC97_C.js} +1 -1
  328. package/dist/chunks/updateCCB-CEXA6dax.js +11 -0
  329. package/dist/chunks/{upgrade-kpttjebY.js → upgrade-7OrBbrzS.js} +1 -1
  330. package/dist/chunks/upgrade-uR7SIVtx.js +1 -0
  331. package/dist/chunks/upload-B-lNHpWe.js +1 -0
  332. package/dist/chunks/{upstreamproxy-CvcjNY7J.js → upstreamproxy-DyR_eXO8.js} +4 -4
  333. package/dist/chunks/usage-7jOeIVv9.js +1 -0
  334. package/dist/chunks/{usage-CJ5w0907.js → usage-CZdPfUqP.js} +1 -1
  335. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-yAroCqu4.js → useExitOnCtrlCDWithKeybindings-CzFtdlnD.js} +1 -1
  336. package/dist/chunks/useMainLoopModel-DegH12LZ.js +1 -0
  337. package/dist/chunks/useManagePlugins-BkK1zydO.js +1 -0
  338. package/dist/chunks/{useMergedTools-CZJffsmf.js → useMergedTools-DMGRA1ga.js} +1 -1
  339. package/dist/chunks/{useSearchInput-C-CqUK6w.js → useSearchInput-D5VU9IDU.js} +1 -1
  340. package/dist/chunks/{useSettingsErrors-BWlJCgYF.js → useSettingsErrors-B5PSF1va.js} +1 -1
  341. package/dist/chunks/{util-DJV0joAW.js → util-CNa1ib_4.js} +1 -1
  342. package/dist/chunks/validatePlugin-Dw-RGCrm.js +1 -0
  343. package/dist/chunks/{vim-n8-UT5w-.js → vim-C0KTnJJs.js} +1 -1
  344. package/dist/chunks/{which-BBCjXfI2.js → which-CKQnSouy.js} +1 -1
  345. package/dist/chunks/windowsPaths-9pEkw0oV.js +1 -0
  346. package/dist/chunks/windowsPaths-DtapVxOo.js +1 -0
  347. package/dist/chunks/{workSecret-C_lv0dRh.js → workSecret-CNWiR2uQ.js} +1 -1
  348. package/dist/chunks/{workerRegistry-BdHi7_sN.js → workerRegistry-B2QD2sKq.js} +1 -1
  349. package/dist/chunks/worktree-D38cJ23W.js +1 -0
  350. package/dist/cli.js +1 -1
  351. package/package.json +4 -5
  352. package/dist/chunks/ApproveApiKey-DfAPwDix.js +0 -1
  353. package/dist/chunks/BackgroundTasksDialog-Dvhcgahe.js +0 -2
  354. package/dist/chunks/ClaudeMdExternalIncludesDialog-BV7HHcgL.js +0 -1
  355. package/dist/chunks/ConsoleOAuthFlow-CU5fCPKq.js +0 -1
  356. package/dist/chunks/Doctor-B0CRtxi2.js +0 -1
  357. package/dist/chunks/Doctor-WxNv49HC.js +0 -3
  358. package/dist/chunks/ExitFlow-CRPgptCN.js +0 -2
  359. package/dist/chunks/Feedback-CEtzaLr3.js +0 -2
  360. package/dist/chunks/Grove-CelgLWH4.js +0 -1
  361. package/dist/chunks/MCPConnectionManager-BX0LMz9J.js +0 -1
  362. package/dist/chunks/MessageSelector-_UZB8cGb.js +0 -3
  363. package/dist/chunks/Messages-jCoW_1Rr.js +0 -11
  364. package/dist/chunks/PluginSettings-BD9JLV9-.js +0 -17
  365. package/dist/chunks/QueryEngine-D2HUnwmU.js +0 -1
  366. package/dist/chunks/REPL-DcpN3MRC.js +0 -1
  367. package/dist/chunks/RemoteSessionManager-Tx1N2uVL.js +0 -2
  368. package/dist/chunks/ResumeConversation-Cw3vP4G8.js +0 -1
  369. package/dist/chunks/SearchExtraToolsTool-D3VOFq9R.js +0 -1
  370. package/dist/chunks/Settings-ns6mRsDc.js +0 -2
  371. package/dist/chunks/TrustDialog-DA3YTk_k.js +0 -1
  372. package/dist/chunks/WelcomeV2-BTfttGcv.js +0 -1
  373. package/dist/chunks/ajv-5vMo9UcX.js +0 -8
  374. package/dist/chunks/api-L2IgleTV.js +0 -1
  375. package/dist/chunks/api-TgV7fl9V.js +0 -1
  376. package/dist/chunks/asciicast-DYbkzGCN.js +0 -1
  377. package/dist/chunks/assistant-YvbVKjVh.js +0 -1
  378. package/dist/chunks/auth-CEig4Gxp.js +0 -1
  379. package/dist/chunks/auth-CbGDlhyO.js +0 -1
  380. package/dist/chunks/auth-DHyCIxCk.js +0 -15
  381. package/dist/chunks/backgroundHousekeeping-BNEKWHhH.js +0 -1
  382. package/dist/chunks/bg-BzG63WOm.js +0 -1
  383. package/dist/chunks/bridgeConfig-D5dB38xD.js +0 -1
  384. package/dist/chunks/bridgeEnabled-DKX8-T_H.js +0 -1
  385. package/dist/chunks/bridgeMain--R1HFbOv.js +0 -68
  386. package/dist/chunks/bridgeMain-d06JByZn.js +0 -1
  387. package/dist/chunks/bridgeMessaging-CqbLTDcx.js +0 -1
  388. package/dist/chunks/bridgePointer-W_jdQ8zf.js +0 -1
  389. package/dist/chunks/caches-BuTIAOtY.js +0 -1
  390. package/dist/chunks/ccrClient-HqMi5Kfu.js +0 -1
  391. package/dist/chunks/client-BeET1hnC.js +0 -1
  392. package/dist/chunks/commands-VjcG4qFq.js +0 -1
  393. package/dist/chunks/commitAttribution-Lb3qUlAR.js +0 -1
  394. package/dist/chunks/compact-DPTVpJ4D.js +0 -2
  395. package/dist/chunks/completionCache-CW8lKIgy.js +0 -1
  396. package/dist/chunks/config-0cRberzR.js +0 -1
  397. package/dist/chunks/config-BrxKpHpR.js +0 -1
  398. package/dist/chunks/config-C7YHKCPV.js +0 -3
  399. package/dist/chunks/config-CLmFk-5V.js +0 -1
  400. package/dist/chunks/context-noninteractive-rUZ3ydmJ.js +0 -1
  401. package/dist/chunks/conversation-GJxfkr6M.js +0 -1
  402. package/dist/chunks/conversation-oK3aFzqO.js +0 -1
  403. package/dist/chunks/createSession-DM4acqaC.js +0 -1
  404. package/dist/chunks/crossProjectResume-DKrtjTpm.js +0 -40
  405. package/dist/chunks/cwd-D-tY2NKc.js +0 -1
  406. package/dist/chunks/datadog-ByS7LGGa.js +0 -1
  407. package/dist/chunks/datadog-DNCsyfSO.js +0 -1
  408. package/dist/chunks/debug-DzZUT2Wv.js +0 -1
  409. package/dist/chunks/detectRepository-6nw-Aw3v.js +0 -1
  410. package/dist/chunks/doctor-CTMHXZvQ.js +0 -1
  411. package/dist/chunks/entry-4lIRMrLI.js +0 -14
  412. package/dist/chunks/envLessBridgeConfig-CGuIxFzJ.js +0 -1
  413. package/dist/chunks/envLessBridgeConfig-D_Jg4fJy.js +0 -1
  414. package/dist/chunks/esm-C8Zkk1Ux.js +0 -1
  415. package/dist/chunks/execSyncWrapper-DZJ3tNWF.js +0 -1
  416. package/dist/chunks/exit-Z9oWrqE4.js +0 -1
  417. package/dist/chunks/extra-usage-BS4aVOt5.js +0 -1
  418. package/dist/chunks/extra-usage-DtAIhW74.js +0 -1
  419. package/dist/chunks/extractMemories-C4f9JWuI.js +0 -1
  420. package/dist/chunks/fast-B0OB4x7K.js +0 -1
  421. package/dist/chunks/firstPartyEventLogger-CdUpe6Lh.js +0 -1
  422. package/dist/chunks/firstPartyEventLogger-hU-LPkje.js +0 -5
  423. package/dist/chunks/gemini-DqAv8_GY.js +0 -1
  424. package/dist/chunks/generateRecap-lO2PDlx8.js +0 -1
  425. package/dist/chunks/git-BE_FiJZp.js +0 -1
  426. package/dist/chunks/git-tyaWOgRL.js +0 -6
  427. package/dist/chunks/hooks-DONAb_nq.js +0 -1
  428. package/dist/chunks/inboundAttachments-BcEgi49j.js +0 -1
  429. package/dist/chunks/inboundAttachments-DVs3_m48.js +0 -1
  430. package/dist/chunks/initReplBridge-D0Xec8S-.js +0 -1
  431. package/dist/chunks/install-BkfXeXpv.js +0 -1
  432. package/dist/chunks/jwtUtils-C-ojmb8W.js +0 -1
  433. package/dist/chunks/keybindings-ez51eHHp.js +0 -2
  434. package/dist/chunks/language-Da4KNbjm.js +0 -1
  435. package/dist/chunks/lazySchema-uxlVVNM1.js +0 -1
  436. package/dist/chunks/loadAgentsDir-Dgd-fzNt.js +0 -1
  437. package/dist/chunks/loadPluginHooks-z1-zvBLw.js +0 -1
  438. package/dist/chunks/localSearch-D-FprOMr.js +0 -1
  439. package/dist/chunks/main-y7LJ5qUc.js +0 -1243
  440. package/dist/chunks/mcp-CSFPAfaW.js +0 -2
  441. package/dist/chunks/mcp-DBwT4pa9.js +0 -6
  442. package/dist/chunks/mcp-DvZTaHZE.js +0 -1
  443. package/dist/chunks/metadata-BRLJvh61.js +0 -1
  444. package/dist/chunks/model--z4Di9QO.js +0 -1
  445. package/dist/chunks/model-DfFA3qMO.js +0 -1
  446. package/dist/chunks/nativeInstaller-GcIk7G2Y.js +0 -1
  447. package/dist/chunks/parser-BlM_Fk4J.js +0 -1
  448. package/dist/chunks/permissions-B8epy16o.js +0 -3
  449. package/dist/chunks/pidLock-CBJDnBG_.js +0 -3
  450. package/dist/chunks/pluginBlocklist-03sZaZa6.js +0 -1
  451. package/dist/chunks/pluginCliCommands-P2Ndi1r1.js +0 -1
  452. package/dist/chunks/pluginOperations-Cz37qcjF.js +0 -2
  453. package/dist/chunks/pluginStartupCheck-BqUwHcMD.js +0 -1
  454. package/dist/chunks/plugins-B0hiIN4q.js +0 -4
  455. package/dist/chunks/policyLimits-Dem-XJ_h.js +0 -1
  456. package/dist/chunks/pollConfig-C2Ac8WMU.js +0 -1
  457. package/dist/chunks/poorMode-jvImnkty.js +0 -1
  458. package/dist/chunks/print-ozjC0Mhg.js +0 -23
  459. package/dist/chunks/processBashCommand-loWZ8MSE.js +0 -1
  460. package/dist/chunks/processSlashCommand-BdouajZb.js +0 -5
  461. package/dist/chunks/prompt-Bef63FhB.js +0 -132
  462. package/dist/chunks/prompt-C7wd1H_i.js +0 -1
  463. package/dist/chunks/prompt-DIoNqZvO.js +0 -1
  464. package/dist/chunks/rcDebugLog-BUuD-X1D.js +0 -11
  465. package/dist/chunks/reconciler-DqXTmV3J.js +0 -4
  466. package/dist/chunks/refresh-CNzXPAFw.js +0 -1
  467. package/dist/chunks/remoteBridgeCore-D-wG5jau.js +0 -1
  468. package/dist/chunks/remoteManagedSettings-B7gt0VAX.js +0 -1
  469. package/dist/chunks/ripgrep-BQgJ02F9.js +0 -1
  470. package/dist/chunks/sandbox-adapter-Coe1GDAE.js +0 -1
  471. package/dist/chunks/searchExtraTools-BnWZ9roi.js +0 -1
  472. package/dist/chunks/sessionFileAccessHooks-BhdOmW9o.js +0 -1
  473. package/dist/chunks/sessionMemory-Bsg2unYX.js +0 -1
  474. package/dist/chunks/sessionMemory-CIbCojm-.js +0 -1
  475. package/dist/chunks/sessionMemoryUtils-Cjb57wtC.js +0 -1
  476. package/dist/chunks/sessionObserver-CRU1qWnP.js +0 -1
  477. package/dist/chunks/sessionStorage-BxDN8qRc.js +0 -1
  478. package/dist/chunks/sessionTitle-B8jcexkQ.js +0 -14
  479. package/dist/chunks/settings-5PQdphqC.js +0 -19
  480. package/dist/chunks/settingsSync-BDeuErb5.js +0 -1
  481. package/dist/chunks/setup-BKEnSLR9.js +0 -3
  482. package/dist/chunks/sink-DjKoYMsA.js +0 -1
  483. package/dist/chunks/sink-iYxWapbU.js +0 -1
  484. package/dist/chunks/sinks-GryGVRT8.js +0 -2
  485. package/dist/chunks/sinks-jfaIjsRJ.js +0 -1
  486. package/dist/chunks/skillChangeDetector-A8SAuyo9.js +0 -1
  487. package/dist/chunks/skillLearning-C8ihdryM.js +0 -1
  488. package/dist/chunks/src-xRRBgNzF.js +0 -25
  489. package/dist/chunks/startupProfiler-B0m6crkd.js +0 -1
  490. package/dist/chunks/state-53JDbNQM.js +0 -1
  491. package/dist/chunks/stdio-4S7b8Uhx.js +0 -1
  492. package/dist/chunks/stdio-W_Kokrkh.js +0 -3
  493. package/dist/chunks/systemPromptSections-IePG5K8r.js +0 -1
  494. package/dist/chunks/teleport-hN3cAbYC.js +0 -1
  495. package/dist/chunks/terminalSetup-C0PF87iu.js +0 -33
  496. package/dist/chunks/thinkback-BA4cMz4D.js +0 -1
  497. package/dist/chunks/thinkback-mT-8FIT-.js +0 -1
  498. package/dist/chunks/thinkback-play-Cfk49mvF.js +0 -1
  499. package/dist/chunks/toolPool-CHVDZqh7.js +0 -1
  500. package/dist/chunks/trustedDevice-BYCh1ff7.js +0 -1
  501. package/dist/chunks/trustedDevice-DnIWErCt.js +0 -1
  502. package/dist/chunks/udsClient-Cg9bBD0p.js +0 -1
  503. package/dist/chunks/undercover-B-kKUWtK.js +0 -1
  504. package/dist/chunks/updateCCB-CfUnkOLT.js +0 -11
  505. package/dist/chunks/upgrade-CngUwvY4.js +0 -1
  506. package/dist/chunks/upload-DDhQqV8n.js +0 -1
  507. package/dist/chunks/usage-eZRwLa77.js +0 -1
  508. package/dist/chunks/useMainLoopModel-BNFW-g8E.js +0 -1
  509. package/dist/chunks/useManagePlugins-CTtPaQRP.js +0 -1
  510. package/dist/chunks/validatePlugin-CRmpIGLV.js +0 -1
  511. package/dist/chunks/windowsPaths-D6T_3XaU.js +0 -1
  512. package/dist/chunks/windowsPaths-DUKTzBck.js +0 -1
  513. package/dist/chunks/worktree-YDeHMlHZ.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{en as p,ht as m,z as ee}from"./state-4KQ3kaqz.js";import{n as te,t as ne}from"./cwd-BuJhkTrc.js";import{E as h,J as re,K as ie,O as g,U as ae,l as _,p as v,z as y}from"./debug-IKW-jE7K.js";import{Xt as oe,Zt as se}from"./settings-5PQdphqC.js";import{c as ce,f as le,g as b,n as ue}from"./config-C7YHKCPV.js";import{c as de,o as fe}from"./execFileNoThrow-COKYqVQj.js";import{o as pe,s as x}from"./log-B3eB4EFv.js";import{a as me,i as he,o as ge}from"./platform-EtecGacO.js";import{l as _e,s as ve}from"./types-a7X-tJpJ.js";import{a as ye,n as be}from"./analytics-BotDBGh0.js";import{i as S,n as xe}from"./startupProfiler-DxRQteII.js";import{Bt as Se,It as Ce,Kt as we,Mt as C,Pt as Te,Ur as Ee,Vt as w,Wr as De,er as Oe,ir as ke,kt as Ae,lr as je,ur as Me,vn as Ne,yn as Pe}from"./model-DfFA3qMO.js";import{d as Fe,i as Ie,s as T}from"./metadata-BRLJvh61.js";import{n as Le,t as Re}from"./config-CLmFk-5V.js";import{_ as ze,c as Be,n as Ve,o as He,t as Ue,v as We,w as E}from"./esm-C8Zkk1Ux.js";import*as D from"path";import{randomUUID as O}from"crypto";import{appendFile as Ge,mkdir as k,readdir as Ke,unlink as A,writeFile as qe}from"fs/promises";async function Je(){j===null&&!M&&(M=Ze(),j=await M,M=null,N.cache.clear?.())}function Ye(){j=null,M=null,N.cache.clear?.(),P.cache.clear?.()}function Xe(){if(j!==null)return j;let e=C();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 Ze(){let e=C();if(e?.emailAddress)return e.emailAddress;if(process.env.USER_TYPE===`ant`)return process.env.COO_CREATOR?`${process.env.COO_CREATOR}@anthropic.com`:P()}var j,M,N,P,F=e((()=>{de(),n(),p(),w(),b(),te(),se(),a(),j=null,M=null,N=t(e=>{let t=le(),n=ce(),i,a,o;if(e&&(i=Ce()??void 0,a=Te()??void 0,i&&n.claudeCodeFirstTokenDate)){let e=new Date(n.claudeCodeFirstTokenDate).getTime();isNaN(e)||(o=e)}let s=C(),c=s?.organizationUuid,l=s?.accountUuid;return{deviceId:t,sessionId:m(),email:Xe(),appVersion:`0.0.1`,platform:oe(),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}}}}),P=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 Qe(){return{seconds:0,nanos:0}}function I(e){return e!=null}var L,$e=e((()=>{L={fromJSON(e){return{seconds:I(e.seconds)?globalThis.Number(e.seconds):0,nanos:I(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=Qe();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}}}));function et(){return{account_id:0,organization_uuid:``,account_uuid:``}}function R(e){return e!=null}var z,tt=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=et();return t.account_id=e.account_id??0,t.organization_uuid=e.organization_uuid??``,t.account_uuid=e.account_uuid??``,t}}}));function nt(){return{actor_id:``,repository_id:``,repository_owner_id:``}}function rt(){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 it(){return{slack_team_id:``,is_enterprise_install:!1,trigger:``,creation_method:``}}function at(){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 ot(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):ot(L.fromJSON(e))}function V(e){return e!=null}var H,U,W,G,st=e((()=>{$e(),tt(),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=nt();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=rt();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=it();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=at();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 D.join(i(),`telemetry`)}function ct(e){if(!d.isAxiosError(e))return y(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,lt=e((()=>{We(),f(),p(),st(),w(),b(),_(),a(),ae(),ke(),ve(),pe(),Ne(),h(),Me(),Ee(),be(),T(),o(),q=O(),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 D.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 A(e)}catch{}else await k(K(),{recursive:!0}),await qe(e,t.map(e=>g(e)).join(`
2
- `)+`
3
- `,`utf8`)}catch(e){x(e)}}async appendEventsToFile(e,t){if(t.length!==0)try{await k(K(),{recursive:!0}),await Ge(e,t.map(e=>g(e)).join(`
4
- `)+`
5
- `,`utf8`)}catch(e){x(e)}}async deleteFile(e){try{await A(e)}catch{}}async retryPreviousBatches(){try{let e=`${J}${m()}.`,t;try{t=(await Ke(K())).filter(t=>t.startsWith(e)&&t.endsWith(`.json`)).filter(e=>!e.includes(q))}catch(e){if(ie(e))return;throw e}for(let e of t){let t=D.join(K(),e);this.retryFileInBackground(t)}}catch(e){x(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:E.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:E.SUCCESS});return}let r=this.transformLogsToEvents(n).events;if(r.length===0){t({code:E.SUCCESS});return}if(this.attempts>=this.maxAttempts){t({code:E.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:E.FAILED,error:Error(`Failed to export ${i.length} events${e}`)});return}this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying&&this.retryFailedEvents(),t({code:E.SUCCESS})}catch(e){process.env.USER_TYPE===`ant`&&v(`1P event logging export failed: ${y(e)}`),x(e),t({code:E.FAILED,error:re(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=ct(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 Pe(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}`;x(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":je(),"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&&we()){let e=Ae();Se()?e&&De(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`}:Oe(),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: ${g(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(g({transform_error:`core_metadata attribute is missing`})).toString(`base64`)})});continue}let s=Fe(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(g(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 ut(e){return!1}var dt=e((()=>{}));function ft(){return{}}function pt(e){let t=ft()[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 mt(){if($)try{await $.shutdown(),process.env.USER_TYPE===`ant`&&v(`1P event logging: final shutdown complete`)}catch{}}function X(){return!Le()}async function ht(e,t,n={}){try{let r=await Ie({model:n.model,betas:n.betas}),i={event_name:t,event_id:O(),core_metadata:r,user_metadata:N(!0),event_metadata:n},a=le();a&&(i.user_id=a),process.env.USER_TYPE===`ant`&&v(`[ANT-ONLY] 1P event: ${t} ${g(n,null,0)}`),e.emit({body:t,attributes:i})}catch(e){process.env.USER_TYPE===`ant`&&x(e)}}function gt(e,t={}){X()&&(!Q||ut(`firstParty`)||ht(Q,e,t))}function _t(){if(S(`1p_event_logging_start`),!X()){process.env.USER_TYPE===`ant`&&v(`1P event logging not enabled`);return}S(`1p_event_after_config`);let e=parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||vt.toString(),10),t=yt,n=Z,r=he(),i={[l]:`claude-code`,[c]:`0.0.1`};if(r===`wsl`){let e=me();e&&(i[`wsl.version`]=e)}$=new He({resource:ze(i),processors:[new Ve(new Y({maxBatchSize:t,isKilled:()=>ut(`firstParty`)}),{scheduledDelayMillis:e,maxExportBatchSize:t,maxQueueSize:n})]}),Q=$.getLogger(`com.anthropic.claude_code.events`,`0.0.1`)}var vt,yt,Z,Q,$,bt=e((()=>{Be(),Ue(),u(),b(),_(),pe(),ge(),h(),xe(),F(),Re(),lt(),T(),dt(),vt=1e4,yt=200,Z=8192,Q=null,$=null}));export{gt as a,P as c,Ye as d,X as i,Je as l,bt as n,pt as o,_t as r,mt as s,ft as t,F as u};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Jo as t,Ko as n,at as r,ct as i,fo as a,zo as o}from"./loadAgentsDir-nzr38hai.js";import{U as s,l as c,p as l,z as u}from"./debug-IKW-jE7K.js";import{a as d,l as f}from"./proxy-Cn2YwITp.js";import{$ as p,J as m,K as h,P as g,Y as _,Z as v,nt as y}from"./rcDebugLog-BUuD-X1D.js";import{n as b,r as x}from"./SSETransport-BXiEBMpb.js";import{randomUUID as S}from"crypto";function C(){return(process.env.GEMINI_BASE_URL||E).replace(/\/+$/,``)}function w(e){let t=e.replace(/^\/+/,``);return t.startsWith(`models/`)?t:`models/${t}`}async function*T(e){let t=await(e.fetchOverride??fetch)(`${C()}/${w(e.model)}:streamGenerateContent?alt=sse`,{method:`POST`,headers:{"Content-Type":`application/json`,"x-goog-api-key":process.env.GEMINI_API_KEY||``},body:JSON.stringify(e.body),signal:e.signal,...d({forAnthropicAPI:!1})});if(!t.ok){let e=await t.text();throw Error(`Gemini API request failed (${t.status} ${t.statusText}): ${e||`empty response body`}`)}if(!t.body)throw Error(`Gemini API returned no response body`);let n=t.body.getReader(),r=new TextDecoder,i=``;try{for(;;){let{done:e,value:t}=await n.read();if(e)break;i+=r.decode(t,D);let{frames:a,remaining:o}=x(i);i=o;for(let e of a)if(!(!e.data||e.data===`[DONE]`))try{yield JSON.parse(e.data)}catch(e){throw Error(`Failed to parse Gemini SSE payload: ${u(e)}`)}}i+=r.decode();let{frames:e}=x(i);for(let t of e)if(!(!t.data||t.data===`[DONE]`))try{yield JSON.parse(t.data)}catch(e){throw Error(`Failed to parse trailing Gemini SSE payload: ${u(e)}`)}}finally{n.releaseLock()}}var E,D,O=e((()=>{b(),s(),f(),E=`https://generativelanguage.googleapis.com/v1beta`,D={stream:!0}}));async function*k(e,r,o,s,c,u){try{let a=y(c.model),d=t(e,o),f=(await Promise.all(o.map(e=>i(e,{getToolPermissionContext:c.getToolPermissionContext,tools:o,agents:c.agents,allowedAgentTypes:c.allowedAgentTypes,model:c.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),{contents:g,systemInstruction:b}=v(d,r),x=_(f),C=m(c.toolChoice),w=T({model:a,signal:s,fetchOverride:c.fetchOverride,body:{contents:g,...b&&{systemInstruction:b},...x.length>0&&{tools:x},...C&&{toolConfig:{functionCallingConfig:C}},generationConfig:{...c.temperatureOverride!==void 0&&{temperature:c.temperatureOverride},...u.type!==`disabled`&&{thinkingConfig:{includeThoughts:!0,...u.type===`enabled`&&{thinkingBudget:u.budgetTokens}}}}}});l(`[Gemini] Calling model=${a}, messages=${g.length}, tools=${x.length}`);let E=h(w,a),D={},O=null,k=0,A=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,k=Date.now()-A;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.type===`thinking`?r.signature=n.signature:r[p]=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:n([t],o,c.agentId)},requestId:void 0,type:`assistant`,uuid:S(),timestamp:new Date().toISOString()};break}case`message_delta`:case`message_stop`:break}yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:k}:void 0}}}catch(e){let t=e instanceof Error?e.message:String(e);l(`[Gemini] Error: ${t}`,{level:`error`}),yield a({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{r(),c(),o(),O(),g()}))();export{k as queryModelGemini};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Al as t,Do as n,Ml as r,So as i,kl as a,zo as o}from"./loadAgentsDir-nzr38hai.js";import{Y as s,l as c,nt as l,p as u}from"./debug-IKW-jE7K.js";async function d(){try{let{getResolvedLanguage:e}=await import(`./language-Da4KNbjm.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 r({promptMessages:[i({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 l||e.aborted||o.signal.aborted?{kind:`aborted`}:(u(`[recap] generation failed: ${t}`),{kind:`failed`})}}var p,m;e((()=>{s(),c(),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{_ as e,a as t,i as n,p as r,r as i}from"./git-tyaWOgRL.js";e();export{i as findGitRoot,n as getBranch,t as getDefaultBranch,r as getRemoteUrl};
@@ -1,6 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{br as a,en as o}from"./state-4KQ3kaqz.js";import{n as s,t as c}from"./cwd-BuJhkTrc.js";import{E as ee,O as te,_ as l,h as u,l as ne,ot as re,st as ie}from"./debug-IKW-jE7K.js";import{r as ae,t as d}from"./execFileNoThrow-COKYqVQj.js";import{o as oe}from"./log-B3eB4EFv.js";import{n as f,t as se}from"./memoize-BO31Ws9Q.js";import{r as ce,t as le}from"./which-BBCjXfI2.js";import{basename as ue,dirname as p,join as m,resolve as h,sep as de}from"path";import{readFileSync as g,realpathSync as _,statSync as v,unwatchFile as y,watchFile as fe}from"fs";import{createHash as pe}from"crypto";import{readFile as b,readdir as me,stat as he}from"fs/promises";function x(e,t,n){let r=ge();if(!r)return;let i={timestamp:new Date().toISOString(),level:e,event:t,data:n??{}},a=u(),o=te(i)+`
2
- `;try{a.appendFileSync(r,o)}catch{try{a.mkdirSync(p(r)),a.appendFileSync(r,o)}catch{}}}function ge(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}async function _e(e,t,n){let r=Date.now();x(`info`,`${e}_started`);try{let i=await t(),a=n?n(i):{};return x(`info`,`${e}_completed`,{duration_ms:Date.now()-r,...a}),i}catch(t){throw x(`error`,`${e}_failed`,{duration_ms:Date.now()-r}),t}}var S=e((()=>{l(),ee()}));async function C(e,t,n,r){try{return ve(await b(m(e,`config`),`utf-8`),t,n,r)}catch{return null}}function ve(e,t,n,r){let i=e.split(`
3
- `),a=t.toLowerCase(),o=r.toLowerCase(),s=!1;for(let e of i){let t=e.trim();if(t.length===0||t[0]===`#`||t[0]===`;`)continue;if(t[0]===`[`){s=Se(t,a,n);continue}if(!s)continue;let r=ye(t);if(r&&r.key.toLowerCase()===o)return r.value}return null}function ye(e){let t=0;for(;t<e.length&&Ce(e[t]);)t++;if(t===0)return null;let n=e.slice(0,t);for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;if(t>=e.length||e[t]!==`=`)return null;for(t++;t<e.length&&(e[t]===` `||e[t]===` `);)t++;return{key:n,value:be(e,t)}}function be(e,t){let n=``,r=!1,i=t;for(;i<e.length;){let t=e[i];if(!r&&(t===`#`||t===`;`))break;if(t===`"`){r=!r,i++;continue}if(t===`\\`&&i+1<e.length){let t=e[i+1];if(r){switch(t){case`n`:n+=`
4
- `;break;case`t`:n+=` `;break;case`b`:n+=`\b`;break;case`"`:n+=`"`;break;case`\\`:n+=`\\`;break;default:n+=t;break}i+=2;continue}if(t===`\\`){n+=`\\`,i+=2;continue}}n+=t,i++}return r||(n=xe(n)),n}function xe(e){let t=e.length;for(;t>0&&(e[t-1]===` `||e[t-1]===` `);)t--;return e.slice(0,t)}function Se(e,t,n){let r=1;for(;r<e.length&&e[r]!==`]`&&e[r]!==` `&&e[r]!==` `&&e[r]!==`"`;)r++;if(e.slice(1,r).toLowerCase()!==t)return!1;if(n===null)return r<e.length&&e[r]===`]`;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r>=e.length||e[r]!==`"`)return!1;r++;let i=``;for(;r<e.length&&e[r]!==`"`;){if(e[r]===`\\`&&r+1<e.length){let t=e[r+1];if(t===`\\`||t===`"`){i+=t,r+=2;continue}i+=t,r+=2;continue}i+=e[r],r++}return r>=e.length||e[r]!==`"`||(r++,r>=e.length||e[r]!==`]`)?!1:i===n}function Ce(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`-`}var w=e((()=>{}));function we(){M.clear()}async function T(e){let t=h(e??c()),n=M.get(t);if(n!==void 0)return n;let r=B(t);if(!r)return M.set(t,null),null;let i=m(r,`.git`);try{if((await he(i)).isFile()){let e=(await b(i,`utf-8`)).trim();if(e.startsWith(`gitdir:`)){let n=h(r,e.slice(7).trim());return M.set(t,n),n}}return M.set(t,i),i}catch{return M.set(t,null),null}}function E(e){return!(!e||e.startsWith(`-`)||e.startsWith(`/`)||e.includes(`..`)||e.split(`/`).some(e=>e===`.`||e===``)||!/^[a-zA-Z0-9/._+@-]+$/.test(e))}function D(e){return/^[0-9a-f]{40}$/.test(e)||/^[0-9a-f]{64}$/.test(e)}async function O(e){try{let t=(await b(m(e,`HEAD`),`utf-8`)).trim();if(t.startsWith(`ref:`)){let n=t.slice(4).trim();if(n.startsWith(`refs/heads/`)){let e=n.slice(11);return E(e)?{type:`branch`,name:e}:null}if(!E(n))return null;let r=await k(e,n);return r?{type:`detached`,sha:r}:{type:`detached`,sha:``}}return D(t)?{type:`detached`,sha:t}:null}catch{return null}}async function k(e,t){let n=await A(e,t);if(n)return n;let r=await j(e);return r&&r!==e?A(r,t):null}async function A(e,t){try{let n=(await b(m(e,t),`utf-8`)).trim();if(n.startsWith(`ref:`)){let t=n.slice(4).trim();return E(t)?k(e,t):null}return D(n)?n:null}catch{}try{let n=await b(m(e,`packed-refs`),`utf-8`);for(let e of n.split(`
5
- `)){if(e.startsWith(`#`)||e.startsWith(`^`))continue;let n=e.indexOf(` `);if(n!==-1&&e.slice(n+1)===t){let t=e.slice(0,n);return D(t)?t:null}}}catch{}return null}async function j(e){try{return h(e,(await b(m(e,`commondir`),`utf-8`)).trim())}catch{return null}}async function Te(e,t,n){try{let r=(await b(m(e,t),`utf-8`)).trim();if(r.startsWith(`ref:`)){let e=r.slice(4).trim();if(e.startsWith(n)){let t=e.slice(n.length);return E(t)?t:null}}}catch{}return null}async function Ee(){let e=await T();if(!e)return`HEAD`;let t=await O(e);return t&&t.type===`branch`?t.name:`HEAD`}async function De(){let e=await T();if(!e)return``;let t=await O(e);return t?t.type===`branch`?await k(e,`refs/heads/${t.name}`)??``:t.sha:``}async function Oe(){let e=await T();if(!e)return null;let t=await C(e,`remote`,`origin`,`url`);if(t)return t;let n=await j(e);return n&&n!==e?C(n,`remote`,`origin`,`url`):null}async function ke(){let e=await T();if(!e)return`main`;let t=await j(e)??e,n=await Te(t,`refs/remotes/origin/HEAD`,`refs/remotes/origin/`);if(n)return n;for(let e of[`main`,`master`])if(await k(t,`refs/remotes/origin/${e}`))return e;return`main`}function Ae(){return F.get(`branch`,Ee)}function je(){return F.get(`head`,De)}function Me(){return F.get(`remoteUrl`,Oe)}function Ne(){return F.get(`defaultBranch`,ke)}async function Pe(e){let t=await T(e);if(!t)return null;let n=await O(t);return n?n.type===`branch`?k(t,`refs/heads/${n.name}`):n.sha:null}async function Fe(e){let t;try{let n=(await b(m(e,`.git`),`utf-8`)).trim();if(!n.startsWith(`gitdir:`))return null;t=h(e,n.slice(7).trim())}catch{return null}let n=await O(t);return n?n.type===`branch`?k(t,`refs/heads/${n.name}`):n.sha:null}async function Ie(e){let t=await T(e);if(!t)return null;let n=await C(t,`remote`,`origin`,`url`);if(n)return n;let r=await j(t);return r&&r!==t?C(r,`remote`,`origin`,`url`):null}async function Le(){try{let e=await T();return e?(await me(m(await j(e)??e,`worktrees`))).length+1:0}catch{return 1}}var M,N,P,F,I=e((()=>{o(),re(),s(),$(),w(),r(),M=new Map,N=1e3,P=class{constructor(){i(this,`gitDir`,null),i(this,`commonDir`,null),i(this,`initialized`,!1),i(this,`initPromise`,null),i(this,`watchedPaths`,[]),i(this,`branchRefPath`,null),i(this,`cache`,new Map)}async ensureStarted(){if(!this.initialized)return this.initPromise||(this.initPromise=this.start()),this.initPromise}async start(){this.gitDir=await T(),this.initialized=!0,this.gitDir&&(this.commonDir=await j(this.gitDir),this.watchPath(m(this.gitDir,`HEAD`),()=>{this.onHeadChanged()}),this.watchPath(m(this.commonDir??this.gitDir,`config`),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),ie(async()=>{this.stopWatching()}))}watchPath(e,t){this.watchedPaths.push(e),fe(e,{interval:N},t)}async watchCurrentBranchRef(){if(!this.gitDir)return;let e=await O(this.gitDir),t=this.commonDir??this.gitDir,n=e?.type===`branch`?m(t,`refs`,`heads`,e.name):null;n!==this.branchRefPath&&(this.branchRefPath&&(y(this.branchRefPath),this.watchedPaths=this.watchedPaths.filter(e=>e!==this.branchRefPath)),this.branchRefPath=n,n&&this.watchPath(n,()=>{this.invalidate()}))}async onHeadChanged(){this.invalidate(),await a(),await this.watchCurrentBranchRef()}invalidate(){for(let e of this.cache.values())e.dirty=!0}stopWatching(){for(let e of this.watchedPaths)y(e);this.watchedPaths=[],this.branchRefPath=null}async get(e,t){await this.ensureStarted();let n=this.cache.get(e);if(n&&!n.dirty)return n.value;n&&(n.dirty=!1);let r=await t(),i=this.cache.get(e);return i&&!i.dirty&&(i.value=r),i||this.cache.set(e,{value:r,dirty:!1,compute:t}),r}reset(){this.stopWatching(),this.cache.clear(),this.initialized=!1,this.initPromise=null,this.gitDir=null,this.commonDir=null}},F=new P}));function Re(){function e(e){let t=z(e);return t===R?null:t}return e.cache=z.cache,e}function ze(){function e(e){let t=B(e);return t?V(t):null}return e.cache=V.cache,e}function Be(e){return T(e)}function L(e){let t=e.trim();if(!t)return null;let n=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(n&&n[1]&&n[2])return`${n[1]}/${n[2]}`.toLowerCase();let r=t.match(/^(?:https?|ssh):\/\/(?:[^@]+@)?([^/]+)\/(.+?)(?:\.git)?$/);if(r&&r[1]&&r[2]){let e=r[1],t=r[2];if(Ue(e)&&t.startsWith(`git/`)){let e=t.slice(4),n=e.split(`/`);return n.length>=3&&n[0].includes(`.`)?e.toLowerCase():`github.com/${e}`.toLowerCase()}return`${e}/${t}`.toLowerCase()}return null}async function Ve(){let e=await J();if(!e)return null;let t=L(e);return t?pe(`sha256`).update(t).digest(`hex`).substring(0,16):null}async function He(){try{let[e,t,n,r,i,a]=await Promise.all([K(),q(),J(),Y(),X(),Q()]);return{commitHash:e,branchName:t,remoteUrl:n,isHeadOnRemote:r,isClean:i,worktreeCount:a}}catch{return null}}function Ue(e){let t=e.split(`:`)[0]??``;return t===`localhost`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}function We(){let e=u(),t=c(),n=m(t,`.git`);try{let t=e.statSync(n);if(t.isFile())return!1;if(t.isDirectory()){let t=m(n,`HEAD`);try{if(e.statSync(t).isFile())return!1}catch{}}}catch{}try{if(e.statSync(m(t,`HEAD`)).isFile())return!0}catch{}try{if(e.statSync(m(t,`objects`)).isDirectory())return!0}catch{}try{if(e.statSync(m(t,`refs`)).isDirectory())return!0}catch{}return!1}var R,z,B,V,H,U,W,G,K,q,Ge,J,Y,X,Z,Q,Ke,$=e((()=>{n(),s(),ne(),S(),ae(),l(),I(),oe(),se(),le(),R=Symbol(`git-root-not-found`),z=f(e=>{let t=Date.now();x(`info`,`find_git_root_started`);let n=h(e),r=n.substring(0,n.indexOf(de)+1)||de,i=0;for(;n!==r;){try{let e=m(n,`.git`);i++;let r=v(e);if(r.isDirectory()||r.isFile())return x(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),n.normalize(`NFC`)}catch{}let e=p(n);if(e===n)break;n=e}try{let e=m(r,`.git`);i++;let n=v(e);if(n.isDirectory()||n.isFile())return x(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),r.normalize(`NFC`)}catch{}return x(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!1}),R},e=>e,50),B=Re(),V=f(e=>{try{let t=g(m(e,`.git`),`utf-8`).trim();if(!t.startsWith(`gitdir:`))return e;let n=h(e,t.slice(7).trim()),r=h(n,g(m(n,`commondir`),`utf-8`).trim());return h(p(n))!==m(r,`worktrees`)||_(g(m(n,`gitdir`),`utf-8`).trim())!==m(_(e),`.git`)?e:ue(r)===`.git`?p(r).normalize(`NFC`):r.normalize(`NFC`)}catch{return e}},e=>e,50),H=ze(),U=t(()=>ce(`git`)||`git`),W=t(async()=>{let e=Date.now();x(`info`,`is_git_check_started`);let t=B(c())!==null;return x(`info`,`is_git_check_completed`,{duration_ms:Date.now()-e,is_git:t}),t}),G=async e=>B(e)!==null,K=async()=>je(),q=async()=>Ae(),Ge=async()=>Ne(),J=async()=>Me(),Y=async()=>{let{code:e}=await d(U(),[`rev-parse`,`@{u}`],{preserveOutputOnError:!1});return e===0},X=async e=>{let t=[`--no-optional-locks`,`status`,`--porcelain`];e?.ignoreUntracked&&t.push(`-uno`);let{stdout:n}=await d(U(),t,{preserveOutputOnError:!1});return n.trim().length===0},Z=async()=>{let{stdout:e}=await d(U(),[`--no-optional-locks`,`status`,`--porcelain`],{preserveOutputOnError:!1}),t=[],n=[];return e.trim().split(`
6
- `).filter(e=>e.length>0).forEach(e=>{let r=e.substring(0,2),i=e.substring(2).trim();r===`??`?n.push(i):i&&t.push(i)}),{tracked:t,untracked:n}},Q=async()=>Le(),Ke=async e=>{try{let t=e||`Claude Code auto-stash - ${new Date().toISOString()}`,{untracked:n}=await Z();if(n.length>0){let{code:e}=await d(U(),[`add`,...n],{preserveOutputOnError:!1});if(e!==0)return!1}let{code:r}=await d(U(),[`stash`,`push`,`--message`,t],{preserveOutputOnError:!1});return r===0}catch{return!1}}}));export{C as A,Pe as C,T as D,Fe as E,x as M,_e as N,k as O,j as S,I as T,$ as _,Ge as a,Ke as b,He as c,W as d,Y as f,U as g,Q as h,q as i,S as j,w as k,K as l,Ve as m,H as n,Z as o,J as p,B as r,Be as s,G as t,X as u,We as v,Ie as w,we as x,L as y};
@@ -1 +0,0 @@
1
- import{Zt as e,dn as t,vn as n,yn as r}from"./loadAgentsDir-nzr38hai.js";r();export{e as executeSessionEndHooks,t as getSessionEndHookTimeoutMs,n as hasWorktreeCreateHook};
@@ -1 +0,0 @@
1
- import{r as e}from"./inboundAttachments-DVs3_m48.js";export{e as resolveAndPrepend};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./envUtils-DSxRz_kt.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{A as i,p as a,t as o,w as s}from"./v4-jw6qOKwQ.js";import{en as c,ht as l}from"./state-4KQ3kaqz.js";import{l as u,p as d}from"./debug-IKW-jE7K.js";import{n as f,t as p}from"./lazySchema-uxlVVNM1.js";import{a as m,n as h,t as g}from"./bridgeConfig-CCtXe8ak.js";import{basename as _,join as v}from"path";import{randomUUID as y}from"crypto";import{mkdir as b,writeFile as x}from"fs/promises";r(),o(),c(),u(),t(),p(),m();var S=3e4;function C(e){d(`[bridge:inbound-attach] ${e}`)}var w=f(()=>s({file_uuid:i(),file_name:i()})),T=f(()=>a(w()));function E(e){if(typeof e!=`object`||!e||!(`file_attachments`in e))return[];let t=T().safeParse(e.file_attachments);return t.success?t.data:[]}function D(e){return _(e).replace(/[^a-zA-Z0-9._-]/g,`_`)||`attachment`}function O(){return v(e(),`uploads`,l())}async function k(e){let t=g();if(!t){C(`skip: no oauth token`);return}let r;try{let i=`${h()}/api/oauth/files/${encodeURIComponent(e.file_uuid)}/content`,a=await n.get(i,{headers:{Authorization:`Bearer ${t}`},responseType:`arraybuffer`,timeout:S,validateStatus:()=>!0});if(a.status!==200){C(`fetch ${e.file_uuid} failed: status=${a.status}`);return}r=Buffer.from(a.data)}catch(t){C(`fetch ${e.file_uuid} threw: ${t}`);return}let i=D(e.file_name),a=(e.file_uuid.slice(0,8)||y().slice(0,8)).replace(/[^a-zA-Z0-9_-]/g,`_`),o=O(),s=v(o,`${a}-${i}`);try{await b(o,{recursive:!0}),await x(s,r)}catch(e){C(`write ${s} failed: ${e}`);return}return C(`resolved ${e.file_uuid} → ${s} (${r.length} bytes)`),s}async function A(e){if(e.length===0)return``;C(`resolving ${e.length} attachment(s)`);let t=(await Promise.all(e.map(k))).filter(e=>e!==void 0);return t.length===0?``:t.map(e=>`@"${e}"`).join(` `)+` `}function j(e,t){if(!t)return e;if(typeof e==`string`)return t+e;let n=e.findLastIndex(e=>e.type===`text`);if(n!==-1){let r=e[n];if(r.type===`text`)return[...e.slice(0,n),{...r,text:t+r.text},...e.slice(n+1)]}return[...e,{type:`text`,text:t.trimEnd()}]}async function M(e,t){let n=E(e);return n.length===0?t:j(t,await A(n))}export{A as i,j as n,M as r,E as t};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n,u as r}from"./envUtils-DSxRz_kt.js";import{en as i,ht as a,nt as o}from"./state-4KQ3kaqz.js";import{Aa as s,Ao as c,Bl as l,Da as u,Ea as d,Fa as f,Fy as p,Il as m,Ma as h,Na as ee,Oa as g,Oo as _,Pa as te,Py as v,Ta as y,Ua as b,Uo as x,Va as S,Ya as ne,ja as C,jr as re,ka as w,mr as ie,zo as T}from"./loadAgentsDir-nzr38hai.js";import{U as ae,l as oe,ot as E,p as D,st as se,z as O}from"./debug-IKW-jE7K.js";import{b as ce,c as le,g as ue}from"./config-C7YHKCPV.js";import{M as k,_ as de,i as A,j as fe,p as pe}from"./git-tyaWOgRL.js";import{g as me,m as j}from"./log-B3eB4EFv.js";import{n as he,r as M}from"./analytics-BotDBGh0.js";import{Hr as N,Lt as P,Ur as F,Vt as ge,ht as _e,kt as I,vn as L,yn as R}from"./model-DfFA3qMO.js";import{O as z,_ as ve,d as ye,k as be,n as B,t as V}from"./rcDebugLog-BUuD-X1D.js";import{a as H,c as U,d as xe,f as Se,o as W,r as G,s as K,u as q}from"./debugUtils-D2981c0Z.js";import{a as Ce,i as J,n as we,o as Y,t as X}from"./bridgeConfig-CCtXe8ak.js";import{a as Z,o as Q,r as Te,s as Ee,t as De}from"./bridgeEnabled--F-6TUi4.js";import{i as Oe,t as ke}from"./assistant-BA9_Mo9U.js";import{t as Ae}from"./capacityWake-CV_x9H8j.js";import{n as je,t as Me}from"./pollConfig-C2Ac8WMU.js";import{i as Ne}from"./trustedDevice-BYCh1ff7.js";import{a as Pe,n as Fe,r as Ie,t as Le}from"./workSecret-C_lv0dRh.js";import{a as Re,i as $,n as ze,t as Be}from"./createSession-DIr4sUp6.js";import{i as Ve,n as He}from"./envLessBridgeConfig-D_Jg4fJy.js";import{n as Ue,o as We}from"./mappers-CWykjGfP.js";import{n as Ge,r as Ke,t as qe}from"./sessionTitle-B8jcexkQ.js";import{a as Je,i as Ye,n as Xe,o as Ze,r as Qe,t as $e}from"./bridgeMessaging-CqbLTDcx.js";import{t as et}from"./HybridTransport-BgV5_7Az.js";import{n as tt,r as nt,t as rt}from"./flushGate-ZFr8yv7F.js";import{hostname as it}from"os";import{randomUUID as at}from"crypto";i(),j(),de(),ue(),F(),ge(),Ce(),p(),Te(),T(),S(),re(),$(),Ve(),Ue(),Ke(),h(),oe(),V(),fe(),he(),E(),U(),m(),z(),ye(),n(),W(),ae(),L(),d();var ot=2e3,st=6e4,ct=900*1e3,lt=0;async function ut(e){let{dir:n,machineName:i,branch:a,gitRepoUrl:o,title:s,baseUrl:c,sessionIngressUrl:d,workerType:f,getAccessToken:p,createSession:m,archiveSession:h,getCurrentTitle:ee=()=>s,toSDKMessages:_=()=>{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:te,getPollIntervalConfig:v=()=>je,initialHistoryCap:b=200,initialMessages:x,previouslyFlushedUUIDs:S,onInboundMessage:ne,onPermissionResponse:re,onInterrupt:ie,onSetModel:T,onSetMaxThinkingTokens:ae,onSetPermissionMode:oe,onStateChange:E,onUserMessage:ce,perpetual:le,initialSSESequenceNum:ue=0}=e,de=++lt,{writeBridgePointer:A,clearBridgePointer:fe,readBridgePointer:pe}=await import(`./bridgePointer-W_jdQ8zf.js`),me=le?await pe(n):null,j=me?.source===`repl`?me:null;D(`[bridge:repl] initBridgeCore #${de} starting (initialMessages=${x?.length??0}${j?` perpetual prior=env:${j.environmentId}`:``})`);let he=C({baseUrl:c,getAccessToken:p,runnerVersion:`0.0.1`,onDebug:D,onAuth401:te,getTrustedDeviceToken:Ne}),N=process.env.USER_TYPE===`ant`?w(he):he,P={dir:n,machineName:i,branch:a,gitRepoUrl:o,maxSessions:1,spawnMode:`single-session`,verbose:!1,sandbox:!1,bridgeId:at(),workerType:f,environmentId:at(),reuseEnvironmentId:j?.environmentId,apiBaseUrl:c,sessionIngressUrl:d},F,ge;try{let e=await N.registerBridgeEnvironment(P);F=e.environment_id,ge=e.environment_secret}catch(e){return K(`registration_failed`,`[bridge:repl] Environment registration failed: ${O(e)}`),j&&await fe(n),E?.(`failed`,O(e)),null}D(`[bridge:repl] Environment registered: ${F}`),k(`info`,`bridge_repl_env_registered`),M(`tengu_bridge_repl_env_registered`,{});async function _e(e,t){if(F!==e)return D(`[bridge:repl] Env mismatch (requested ${e}, got ${F}) — cannot reconnect in place`),!1;let n=Se(t),r=n===t?[t]:[t,n];for(let e of r)try{return await N.reconnectSession(F,e),D(`[bridge:repl] Reconnected session ${e} in place on env ${F}`),!0}catch(t){D(`[bridge:repl] reconnectSession(${e}) failed: ${O(t)}`)}return D(`[bridge:repl] reconnectSession exhausted — falling through to fresh session`),!1}let I=j?await _e(j.environmentId,j.sessionId):!1;j&&!I&&await fe(n);let L;if(I&&j){if(L=j.sessionId,D(`[bridge:repl] Perpetual session reused: ${L}`),x&&S)for(let e of x)S.add(e.uuid)}else{let e=await m({environmentId:F,title:s,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});if(!e)return D(`[bridge:repl] Session creation failed, deregistering environment`),M(`tengu_bridge_repl_session_failed`,{}),await N.deregisterEnvironment(F).catch(()=>{}),E?.(`failed`,`Session creation failed`),null;L=e,D(`[bridge:repl] Session created: ${L}`)}await A(n,{sessionId:L,environmentId:F,source:`repl`}),k(`info`,`bridge_repl_session_created`),M(`tengu_bridge_repl_started`,{has_initial_messages:!!(x&&x.length>0),inProtectedNamespace:r()});let R=new Set;if(x)for(let e of x)R.add(e.uuid);let z=new $e(2e3);for(let e of R)z.add(e);let ye=new $e(2e3),V=new AbortController,H=null;ve(e=>{V.signal.aborted||H?.reportMetadata(e)},{replayCurrent:!0});let U=0,W=I?ue:0,G=null,q=null,Ce=Ae(V.signal),J=Ce.wake,we=Ce.signal,Y=new rt,X=!ce,Z=0,Q=null;async function Te(){if(Q)return Q;Q=Ee();try{return await Q}finally{Q=null}}async function Ee(){if(Z++,B(`doReconnect: attempt=${Z}/3 envId=${F} sessionId=${L} workId=${G}`),U++,D(`[bridge:repl] Reconnecting after env lost (attempt ${Z}/3)`),Z>3)return D(`[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(J(),Y.drop(),G){let e=G;if(await N.stopWork(F,e,!1).catch(()=>{}),G!==e)return D(`[bridge:repl] Poll loop recovered during stopWork await — deferring to it`),Z=0,!0;G=null,q=null}if(V.signal.aborted)return D(`[bridge:repl] Reconnect aborted by teardown`),!1;let e=F;P.reuseEnvironmentId=e;try{let e=await N.registerBridgeEnvironment(P);F=e.environment_id,ge=e.environment_secret}catch(e){return P.reuseEnvironmentId=void 0,D(`[bridge:repl] Environment re-registration failed: ${O(e)}`),!1}if(P.reuseEnvironmentId=void 0,D(`[bridge:repl] Re-registered: requested=${e} got=${F}`),V.signal.aborted)return D(`[bridge:repl] Reconnect aborted after env registration, cleaning up`),await N.deregisterEnvironment(F).catch(()=>{}),!1;if(H!==null)return D(`[bridge:repl] Poll loop recovered during registerBridgeEnvironment await — deferring to it`),Z=0,!0;if(await _e(e,L))return M(`tengu_bridge_repl_reconnected_in_place`,{}),Z=0,!0;if(F!==e&&M(`tengu_bridge_repl_env_expired_fresh_session`,{}),await h(L),V.signal.aborted)return D(`[bridge:repl] Reconnect aborted after archive, cleaning up`),await N.deregisterEnvironment(F).catch(()=>{}),!1;let t=ee(),r=await m({environmentId:F,title:t,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});return r?V.signal.aborted?(D(`[bridge:repl] Reconnect aborted after session creation, cleaning up`),await h(r),!1):(L=r,l(xe(r)).catch(()=>{}),W=0,ye.clear(),X=!ce,D(`[bridge:repl] Re-created session: ${L}`),await A(n,{sessionId:L,environmentId:F,source:`repl`}),S?.clear(),Z=0,!0):(D(`[bridge:repl] Session creation failed during reconnection`),!1)}function De(){return p()}function Oe(){let e=Y.end();if(e.length===0)return;if(!H){D(`[bridge:repl] Cannot drain ${e.length} pending message(s): no transport`);return}for(let t of e)z.add(t.uuid);let t=_(e).map(e=>({...e,session_id:L}));D(`[bridge:repl] Drained ${e.length} pending message(s) after flush`),H.writeBatch(t)}let ke=null;function Me(){ke?.()}function Ie(e){if(B(`handleTransportPermanentClose: code=${e} transport=${H?`exists`:`null`} pollAborted=${V.signal.aborted}`),D(`[bridge:repl] Transport permanently closed: code=${e}`),M(`tengu_bridge_repl_ws_closed`,{code:e}),H){let e=H.getLastSequenceNum();e>W&&(W=e),H=null}J();let t=Y.drop();if(t>0&&D(`[bridge:repl] Dropping ${t} pending message(s) on transport close (code=${e})`,{level:`warn`}),e===1e3){E?.(`failed`,`session ended`),V.abort(),Me();return}E?.(`reconnecting`,`Remote Control connection lost (code ${e})`),D(`[bridge:repl] Transport reconnect budget exhausted (code=${e}), attempting env reconnect`),Te().then(t=>{t||V.signal.aborted||(D(`[bridge:repl] reconnectEnvironmentWithSession resolved false — tearing down`),M(`tengu_bridge_repl_reconnect_failed`,{close_code:e}),E?.(`failed`,`reconnection failed`),Me())})}let Re;process.env.USER_TYPE===`ant`&&process.platform!==`win32`&&(Re=()=>{D(`[bridge:repl] SIGUSR2 received — forcing doReconnect() for testing`),Te()},process.on(`SIGUSR2`,Re));let $=null;process.env.USER_TYPE===`ant`&&g({fireClose:e=>{if(!$){D(`[bridge:debug] fireClose: no transport wired yet`);return}D(`[bridge:debug] fireClose(${e}) — injecting`),$(e)},forceReconnect:()=>{D(`[bridge:debug] forceReconnect — injecting`),Te()},injectFault:u,wakePollLoop:J,describe:()=>`env=${F} session=${L} transport=${H?.getStateLabel()??`null`} workId=${G??`null`}`}),dt({api:N,getCredentials:()=>({environmentId:F,environmentSecret:ge}),signal:V.signal,getPollIntervalConfig:v,onStateChange:E,getWsState:()=>H?.getStateLabel()??`null`,isAtCapacity:()=>H!==null,capacitySignal:we,onFatalError:Me,getHeartbeatInfo:()=>!G||!q?null:{environmentId:F,workId:G,sessionToken:q},onHeartbeatFatal:e=>{if(D(`[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&&N.stopWork(F,G,!1).catch(e=>{D(`[bridge:repl] stopWork after heartbeat fatal: ${O(e)}`)}),G=null,q=null,J(),E?.(`reconnecting`,`Work item lease expired, fetching fresh token`)},async onEnvironmentLost(){return await Te()?{environmentId:F,environmentSecret:ge}:null},onWorkReceived:(e,r,i,a)=>{if(H?.isConnectedStatus()&&D(`[bridge:repl] Work received while transport connected, replacing with fresh token (workId=${i})`),D(`[bridge:repl] Work received: workId=${i} workSessionId=${e} currentSessionId=${L} match=${Pe(e,L)}`),A(n,{sessionId:L,environmentId:F,source:`repl`}),!Pe(e,L)){D(`[bridge:repl] Rejecting foreign session: expected=${L} got=${e}`);return}G=i,q=r;let o=a||t(process.env.CLAUDE_BRIDGE_USE_CCR_V2),s;if(!o){if(s=De(),!s){D(`[bridge:repl] No OAuth token available for session ingress, skipping work`);return}be(s)}if(M(`tengu_bridge_repl_work_received`,{}),H){let e=H;H=null;let t=e.getLastSequenceNum();t>W&&(W=t),e.close()}Y.deactivate();let l=e=>Ye(e,{transport:H,sessionId:L,onInterrupt:ie,onSetModel:T,onSetMaxThinkingTokens:ae,onSetPermissionMode:oe}),u=!1,f=e=>{H=e,e.setOnConnect(()=>{if(H===e){if(D(`[bridge:repl] Ingress transport connected`),M(`tengu_bridge_repl_ws_connected`,{}),!o){let e=De();e&&be(e)}if(He=!1,!u&&x&&x.length>0){u=!0;let t=b,n=x.filter(e=>Je(e)&&!S?.has(e.uuid)),r=t>0&&n.length>t?n.slice(-t):n;r.length<n.length&&(D(`[bridge:repl] Capped initial flush: ${n.length} -> ${r.length} (cap=${t})`),M(`tengu_bridge_repl_history_capped`,{eligible_count:n.length,capped_count:r.length}));let i=_(r);if(i.length>0){D(`[bridge:repl] Flushing ${i.length} initial message(s) via transport`);let t=i.map(e=>({...e,session_id:L})),n=e.droppedBatchCount;e.writeBatch(t).then(()=>{if(e.droppedBatchCount>n){D(`[bridge:repl] Initial flush dropped ${e.droppedBatchCount-n} batch(es) — not marking ${i.length} UUID(s) as flushed`);return}if(S)for(let e of i)e.uuid&&S.add(e.uuid)}).catch(e=>D(`[bridge:repl] Initial flush failed: ${e}`)).finally(()=>{H===e&&(Oe(),E?.(`connected`))})}else Oe(),E?.(`connected`)}else Y.active||E?.(`connected`)}}),e.setOnData(e=>{try{let t=JSON.parse(e);B(`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{B(`ingress (non-JSON): ${String(e).slice(0,200)}`)}Qe(e,z,ye,ne,re,l)}),$=Ie,e.setOnClose(t=>{H===e&&(B(`transport onClose: code=${t} connected=${e.isConnectedStatus()} state=${e.getStateLabel()} seq=${e.getLastSequenceNum()}`),Ie(t))}),!u&&x&&x.length>0&&Y.start(),e.connect()};if(U++,o){let t=Le(c,e),n=U;D(`[bridge:repl] CCR v2: sessionUrl=${t} session=${e} gen=${n}`),nt({sessionUrl:t,ingressToken:r,sessionId:e,initialSequenceNum:W}).then(e=>{if(V.signal.aborted){e.close();return}if(n!==U){D(`[bridge:repl] CCR v2: discarding stale handshake gen=${n} current=${U}`),e.close();return}f(e)},e=>{D(`[bridge:repl] CCR v2: createV2ReplTransport failed: ${O(e)}`,{level:`error`}),M(`tengu_bridge_repl_ccr_v2_init_failed`,{}),n===U&&(G&&(N.stopWork(F,G,!1).catch(e=>{D(`[bridge:repl] stopWork after v2 init failure: ${O(e)}`)}),G=null,q=null),J())})}else{let t=Fe(d,e);D(`[bridge:repl] Ingress URL: ${t}`),D(`[bridge:repl] Creating HybridTransport: session=${e}`);let n=s??``;f(tt(new et(new URL(t),{Authorization:`Bearer ${n}`,"anthropic-version":`2023-06-01`},e,()=>({Authorization:`Bearer ${De()??n}`,"anthropic-version":`2023-06-01`}),{maxConsecutiveFailures:50,isBridge:!0,onBatchDropped:()=>{E?.(`reconnecting`,`Lost sync with Remote Control — events could not be delivered`),J()}})))}}});let ze=le?setInterval(()=>{Q||A(n,{sessionId:L,environmentId:F,source:`repl`})},60*6e4):null;ze?.unref?.();let Be=v().session_keepalive_interval_v2_ms,Ve=Be>0?setInterval(()=>{H&&(D(`[bridge:repl] keep_alive sent`),H.write({type:`keep_alive`}).catch(e=>{D(`[bridge:repl] keep_alive write failed: ${O(e)}`)}))},Be):null;Ve?.unref?.();let He=!1;ke=async()=>{if(He){D(`[bridge:repl] Teardown already in progress, skipping duplicate call env=${F} session=${L}`);return}He=!0;let e=Date.now();if(D(`[bridge:repl] Teardown starting: env=${F} session=${L} workId=${G??`none`} transportState=${H?.getStateLabel()??`null`}`),ze!==null&&clearInterval(ze),Ve!==null&&clearInterval(Ve),Re&&process.off(`SIGUSR2`,Re),process.env.USER_TYPE===`ant`&&(y(),$=null),V.abort(),D(`[bridge:repl] Teardown: poll loop aborted`),H){let e=H.getLastSequenceNum();e>W&&(W=e)}if(le){H=null,Y.drop(),await A(n,{sessionId:L,environmentId:F,source:`repl`}),D(`[bridge:repl] Teardown (perpetual): leaving env=${F} session=${L} alive on server, duration=${Date.now()-e}ms`);return}let t=H;if(H=null,Y.drop(),t){let e={...Ze(L),session_id:L};t.write(e)}let r=G?N.stopWork(F,G,!0).then(()=>{D(`[bridge:repl] Teardown: stopWork completed`)}).catch(e=>{D(`[bridge:repl] Teardown stopWork failed: ${O(e)}`)}):Promise.resolve();await Promise.all([r,h(L)]),t?.close(),D(`[bridge:repl] Teardown: transport closed`),await N.deregisterEnvironment(F).catch(e=>{D(`[bridge:repl] Teardown deregister failed: ${O(e)}`)}),await fe(n),D(`[bridge:repl] Teardown complete: env=${F} duration=${Date.now()-e}ms`)};let Ue=se(()=>ke?.());return D(`[bridge:repl] Ready: env=${F} session=${L}`),E?.(`ready`),{get bridgeSessionId(){return L},get environmentId(){return F},getSSESequenceNum(){let e=H?.getLastSequenceNum()??0;return Math.max(W,e)},sessionIngressUrl:d,writeMessages(e){let t=e.filter(e=>Je(e)&&!R.has(e.uuid)&&!z.has(e.uuid));if(t.length===0)return;if(!X)for(let e of t){let t=Xe(e);if(t!==void 0&&ce?.(t,L)){X=!0;break}}if(Y.enqueue(...t)){D(`[bridge:repl] Queued ${t.length} message(s) during initial flush`);return}if(!H){let e=t.map(e=>e.type).join(`,`);D(`[bridge:repl] Transport not configured, dropping ${t.length} message(s) [${e}] for session=${L}`,{level:`warn`});return}for(let e of t)z.add(e.uuid);D(`[bridge:repl] Sending ${t.length} message(s) via transport`);let n=_(t).map(e=>({...e,session_id:L}));H.writeBatch(n)},writeSdkMessages(e){let t=e.filter(e=>!e.uuid||!z.has(e.uuid));if(t.length===0)return;if(!H){D(`[bridge:repl] Transport not configured, dropping ${t.length} SDK message(s) for session=${L}`,{level:`warn`});return}for(let e of t)e.uuid&&z.add(e.uuid);let n=t.map(e=>({...e,session_id:L}));H.writeBatch(n)},sendControlRequest(e){if(!H){D(`[bridge:repl] Transport not configured, skipping control_request`);return}let t={...e,session_id:L};H.write(t),D(`[bridge:repl] Sent control_request request_id=${e.request_id}`)},sendControlResponse(e){if(!H){D(`[bridge:repl] Transport not configured, skipping control_response`);return}let t={...e,session_id:L};H.write(t),D(`[bridge:repl] Sent control_response`)},sendControlCancelRequest(e){if(!H){D(`[bridge:repl] Transport not configured, skipping control_cancel_request`);return}let t={type:`control_cancel_request`,request_id:e,session_id:L};H.write(t),D(`[bridge:repl] Sent control_cancel_request request_id=${e}`)},sendResult(){if(!H){D(`[bridge:repl] sendResult: skipping, transport not configured session=${L}`);return}H.reportState(`idle`);let e={...Ze(L),session_id:L};H.write(e),D(`[bridge:repl] Sent result for session=${L}`)},async teardown(){Ue(),await ke?.(),D(`[bridge:repl] Torn down`),M(`tengu_bridge_repl_teardown`,{})}}}async function dt({api:e,getCredentials:t,signal:n,onStateChange:r,onWorkReceived:i,onEnvironmentLost:a,getWsState:o,isAtCapacity:c,capacitySignal:l,onFatalError:u,getPollIntervalConfig:d=()=>je,getHeartbeatInfo:p,onHeartbeatFatal:m}){D(`[bridge:repl] Starting work poll loop for env=${t().environmentId}`);let h=0,g=null,_=null,v=0,y=!1;for(;!n.aborted;){let{environmentId:b,environmentSecret:x}=t(),S=d();try{let t=await e.pollForWork(b,x,n,S.reclaim_older_than_ms);if(v=0,h>0&&(D(`[bridge:repl] Poll recovered after ${h} consecutive error(s)`),h=0,g=null,_=null,r?.(`ready`)),!t){let t=y;if(y=!1,c?.()&&l&&!t){let t=S.poll_interval_ms_at_capacity;if(S.non_exclusive_heartbeat_interval_ms>0&&p){M(`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&&c()&&(r===null||Date.now()<r);){let t=d();if(t.non_exclusive_heartbeat_interval_ms<=0)break;let n=p();if(!n)break;let r=l();try{await e.heartbeatWork(n.environmentId,n.workId,n.sessionToken)}catch(e){if(D(`[bridge:repl:heartbeat] Failed: ${O(e)}`),e instanceof s){r.cleanup(),M(`tengu_bridge_heartbeat_error`,{status:e.status,error_type:e.status===401||e.status===403?`auth_failed`:`fatal`}),m?(m(e),D(`[bridge:repl:heartbeat] Fatal (status=${e.status}), work state cleared — fast-polling for re-dispatch`)):i=!0;break}}a++,await R(t.non_exclusive_heartbeat_interval_ms,r.signal),r.cleanup()}let o=i?`error`:n.aborted?`shutdown`:c()?r!==null&&Date.now()>=r?`poll_due`:`config_disabled`:`capacity_changed`;if(M(`tengu_bridge_heartbeat_mode_exited`,{reason:o,heartbeat_cycles:a}),!i){o===`poll_due`&&D(`[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=l(),t=Date.now();await R(r,e.signal),e.cleanup();let n=Date.now()-t-r;n>6e4&&(D(`[bridge:repl] At-capacity sleep overran by ${Math.round(n/1e3)}s — process suspension detected, forcing one fast-poll cycle`),M(`tengu_bridge_repl_suspension_detected`,{overrun_ms:n}),y=!0)}}else await R(S.poll_interval_ms_not_at_capacity,n);continue}let a;try{a=Ie(t.secret)}catch(n){D(`[bridge:repl] Failed to decode work secret: ${O(n)}`),M(`tengu_bridge_repl_work_secret_failed`,{}),await e.stopWork(b,t.id,!1).catch(()=>{});continue}D(`[bridge:repl] Acknowledging workId=${t.id}`);try{await e.acknowledgeWork(b,t.id,a.session_ingress_token)}catch(e){D(`[bridge:repl] Acknowledge failed workId=${t.id}: ${O(e)}`)}if(t.data.type===`healthcheck`){D(`[bridge:repl] Healthcheck received`);continue}if(t.data.type===`session`){let e=t.data.id;try{f(e,`session_id`)}catch{D(`[bridge:repl] Invalid session_id in work: ${e}`);continue}i(e,a.session_ingress_token,t.id,a.use_code_sessions===!0),D(`[bridge:repl] Work accepted, continuing poll loop`)}}catch(i){if(n.aborted)break;if(i instanceof s&&i.status===404&&a){let e=t().environmentId;if(b!==e){D(`[bridge:repl] Stale poll error for old env=${b}, current env=${e} — skipping onEnvironmentLost`),h=0,g=null;continue}if(v++,D(`[bridge:repl] Environment deleted, attempting re-registration (attempt ${v}/3)`),M(`tengu_bridge_repl_env_lost`,{attempt:v}),v>3){D(`[bridge:repl] Environment re-registration limit reached (3), giving up`),r?.(`failed`,`Environment deleted and re-registration limit reached`),u?.();break}r?.(`reconnecting`,`environment lost, recreating session`);let i=await a();if(n.aborted)break;if(i){h=0,g=null,r?.(`ready`),D(`[bridge:repl] Re-registered environment: ${i.environmentId}`);continue}r?.(`failed`,`Environment deleted and re-registration failed`),u?.();break}if(i instanceof s){let e=ee(i.errorType),t=te(i);D(`[bridge:repl] Fatal poll error: ${i.message} (status=${i.status}, type=${i.errorType??`unknown`})${t?` (suppressed)`:``}`),M(`tengu_bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),k(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),u?.();break}let c=Date.now();_!==null&&c-_>6e4*2&&(D(`[bridge:repl] Detected system sleep (${Math.round((c-_)/1e3)}s gap), resetting poll error budget`),k(`info`,`bridge_repl_poll_sleep_detected`,{gapMs:c-_}),h=0,g=null),_=c,h++,g===null&&(g=c);let l=c-g,f=H(i),m=G(i),y=o?.()??`unknown`;if(D(`[bridge:repl] Poll error (attempt ${h}, elapsed ${Math.round(l/1e3)}s, ws=${y}): ${m}`),M(`tengu_bridge_repl_poll_error`,{status:f,consecutiveErrors:h,elapsedMs:l}),h===1&&r?.(`reconnecting`,m),l>=9e5){D(`[bridge:repl] Poll failures exceeded ${ct/1e3}s (${h} errors), giving up`),k(`info`,`bridge_repl_poll_give_up`),M(`tengu_bridge_repl_poll_give_up`,{consecutiveErrors:h,elapsedMs:l,lastStatus:f}),r?.(`failed`,`connection to server lost`);break}let x=Math.min(ot*2**(h-1),st);if(d().non_exclusive_heartbeat_interval_ms>0){let t=p?.();if(t)try{await e.heartbeatWork(t.environmentId,t.workId,t.sessionToken)}catch{}}await R(x,n)}}D(`[bridge:repl] Work poll loop ended (aborted=${n.aborted}) env=${t().environmentId}`)}oe(),ae(),W(),U();async function ft(t){let{onInboundMessage:n,onPermissionResponse:r,onInterrupt:i,onSetModel:s,onSetMaxThinkingTokens:l,onSetPermissionMode:u,onStateChange:d,initialMessages:f,getMessages:p,previouslyFlushedUUIDs:m,initialName:h,perpetual:ee,outboundOnly:g,tags:te}=t??{};if(q(Q),!await Z())return K(`not_enabled`,`[bridge:repl] Skipping: bridge not enabled`),null;if(!X())return K(`no_oauth`,`[bridge:repl] Skipping: no OAuth tokens`),d?.(`failed`,`/login`),null;if(await ne(),!b(`allow_remote_control`))return K(`policy_denied`,`[bridge:repl] Skipping: allow_remote_control policy not allowed`),d?.(`failed`,`disabled by your organization's policy`),null;if(!J()){let e=le();if(e.bridgeOauthDeadExpiresAt!=null&&(e.bridgeOauthDeadFailCount??0)>=3&&I()?.expiresAt===e.bridgeOauthDeadExpiresAt)return D(`[bridge:repl] Skipping: cross-process backoff (dead token seen ${e.bridgeOauthDeadFailCount} times)`),null;await _e();let t=I();if(t&&t.expiresAt!==null&&t.expiresAt<=Date.now()){K(`oauth_expired_unrefreshable`,`[bridge:repl] Skipping: OAuth token expired and refresh failed (re-login required)`),d?.(`failed`,`/login`);let e=t.expiresAt;return ce(t=>({...t,bridgeOauthDeadExpiresAt:e,bridgeOauthDeadFailCount:t.bridgeOauthDeadExpiresAt===e?(t.bridgeOauthDeadFailCount??0)+1:1})),null}}let y=we(),S=`remote-control-${v()}`,C=!1,re=!1;if(h)S=h,C=!0,re=!0;else{let e=a(),t=e?ie(e):void 0;if(t)S=t,C=!0,re=!0;else if(f&&f.length>0)for(let e=f.length-1;e>=0;e--){let t=f[e];if(t.type!==`user`||t.isMeta||t.toolUseResult||t.isCompactSummary||t.origin&&t.origin.kind!==`human`||x(t))continue;let n=_(t.message.content);if(!n)continue;let r=mt(n);if(r){S=r,C=!0;break}}}let w=0,T,ae=0,oe=(e,t,n)=>{C=!0,S=e,D(`[bridge:repl] derived title from message ${n}: ${e}`),Re(t,e,{baseUrl:y,getAccessToken:X}).catch(()=>{})},E=(e,t)=>{let n=++ae,r=w;Ge(e,AbortSignal.timeout(15e3)).then(e=>{e&&n===ae&&T===t&&!ie(a())&&oe(e,t,r)})},se=(e,t)=>{if(re||ie(a()))return!0;if(T!==void 0&&T!==t&&(w=0),T=t,w++,w===1&&!C){let n=mt(e);n&&oe(n,t,w),E(e,t)}else if(w===3){let n=p?.(),r=n?qe(c(n)):e;E(r,t)}return w>=3},ue=Y()?`self-hosted`:await N();if(!ue)return K(`no_org_uuid`,`[bridge:repl] Skipping: no org UUID`),d?.(`failed`,`/login`),null;if(Ee()&&!ee){let e=await He();if(e)return K(`version_too_old`,`[bridge:repl] Skipping: ${e}`,!0),d?.(`failed`,"run `claude update` to upgrade"),null;D(`[bridge:repl] Using env-less bridge path (tengu_bridge_repl_v2)`);let{initEnvLessBridgeCore:t}=await import(`./remoteBridgeCore-D-wG5jau.js`);return t({baseUrl:y,orgUUID:ue,title:S,getAccessToken:X,onAuth401:P,toSDKMessages:We,initialHistoryCap:200,initialMessages:f,onInboundMessage:n,onUserMessage:se,onPermissionResponse:r,onInterrupt:i,onSetModel:s,onSetMaxThinkingTokens:l,onSetPermissionMode:u,onStateChange:d,outboundOnly:g,tags:te})}let k=De();if(k)return K(`version_too_old`,`[bridge:repl] Skipping: ${k}`),d?.(`failed`,"run `claude update` to upgrade"),null;let de=await A(),fe=await pe(),me=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||y,j=`claude_code`;{let{isAssistantMode:t}=(Oe(),e(ke));t()&&(j=`claude_code_assistant`)}return ut({dir:o(),machineName:it(),branch:de,gitRepoUrl:fe,title:S,baseUrl:y,sessionIngressUrl:me,workerType:j,getAccessToken:X,createSession:e=>ze({...e,events:[],baseUrl:y,getAccessToken:X}),archiveSession:e=>Be(e,{baseUrl:y,getAccessToken:X,timeoutMs:1500}).catch(e=>{D(`[bridge:repl] archiveBridgeSession threw: ${O(e)}`,{level:`error`})}),getCurrentTitle:()=>ie(a())??S,onUserMessage:se,toSDKMessages:We,onAuth401:P,getPollIntervalConfig:Me,initialHistoryCap:200,initialMessages:f,previouslyFlushedUUIDs:m,onInboundMessage:n,onPermissionResponse:r,onInterrupt:i,onSetModel:s,onSetMaxThinkingTokens:l,onSetPermissionMode:u,onStateChange:d,perpetual:ee})}var pt=50;function mt(e){let t=me(e),n=(/^(.*?[.!?])\s/.exec(t)?.[1]??t).replace(/\s+/g,` `).trim();if(n)return n.length>pt?n.slice(0,pt-1)+`…`:n}export{ft as initReplBridge};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,kn as i,s as a,t as o}from"./src-CDCSSo0U2.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{U as c,l,p as u,z as d}from"./debug-IKW-jE7K.js";import{Jt as f,Zt as p,g as m,n as h,y as g}from"./settings-5PQdphqC.js";import{n as _,r as v}from"./analytics-BotDBGh0.js";import{a as y,n as b,r as x,s as S,t as C}from"./nativeInstaller-GcIk7G2Y.js";import{join as w}from"node:path";import{homedir as T}from"node:os";var E=e(r(),1);_(),o(),l(),p(),c(),C(),m();var D=s();function O(){let e=f.platform===`win32`,t=T();return e?w(t,`.local`,`bin`,`claude.exe`).replace(/\//g,`\\`):`~/.local/bin/claude`}function k({messages:e}){return e.length===0?null:(0,D.jsxs)(t,{flexDirection:`column`,gap:0,marginBottom:1,children:[(0,D.jsx)(t,{children:(0,D.jsxs)(n,{color:`warning`,children:[(0,D.jsx)(a,{status:`warning`,withSpace:!0}),`Setup notes:`]})}),e.map((e,r)=>(0,D.jsx)(t,{marginLeft:2,children:(0,D.jsxs)(n,{dimColor:!0,children:[`• `,e]})},r))]})}function A({onDone:e,force:r,target:i}){let[o,s]=(0,E.useState)({type:`checking`});return(0,E.useEffect)(()=>{async function e(){try{u(`Install: Starting installation process (force=${r}, target=${i})`);let e=i||h()?.autoUpdatesChannel||`latest`;s({type:`installing`,version:e}),u(`Install: Calling installLatest(channelOrVersion=${e}, forceReinstall=${r})`);let t=await S(e,r);if(u(`Install: installLatest returned version=${t.latestVersion}, wasUpdated=${t.wasUpdated}, lockFailed=${t.lockFailed}`),t.lockFailed)throw Error(`Could not install - another process is currently installing Claude. Please try again in a moment.`);t.latestVersion||u(`Install: Failed to retrieve version information during install`,{level:`error`}),t.wasUpdated||u(`Install: Already up to date`),s({type:`setting-up`});let n=await b(!0);u(`Install: Setup launcher completed with ${n.length} messages`),n.length>0&&n.forEach(e=>u(`Install: Setup message: ${e.message}`)),u(`Install: Cleaning up npm installations after successful install`);let{removed:a,errors:o,warnings:c}=await x();a>0&&u(`Cleaned up ${a} npm installation(s)`),o.length>0&&u(`Cleanup errors: ${o.join(`, `)}`);let l=await y();l.length>0&&u(`Shell alias cleanup: ${l.map(e=>e.message).join(`; `)}`),v(`tengu_claude_install_command`,{has_version:+!!t.latestVersion,forced:+!!r}),(i===`latest`||i===`stable`)&&(g(`userSettings`,{autoUpdatesChannel:i}),u(`Install: Saved autoUpdatesChannel=${i} to user settings`));let d=[...c,...l.map(e=>e.message)];n.length>0?(s({type:`set-up`,messages:n.map(e=>e.message)}),setTimeout(s,2e3,{type:`success`,version:t.latestVersion||`current`,setupMessages:[...n.map(e=>e.message),...d]})):(u(`Install: Shell PATH already configured`),s({type:`success`,version:t.latestVersion||`current`,setupMessages:d.length>0?d:void 0}))}catch(e){u(`Install command failed: ${e}`,{level:`error`}),s({type:`error`,message:d(e)})}}e()},[r,i]),(0,E.useEffect)(()=>{o.type===`success`?setTimeout(e,2e3,`Claude Code installation completed successfully`,{display:`system`}):o.type===`error`&&setTimeout(e,3e3,`Claude Code installation failed`,{display:`system`})},[o,e]),(0,D.jsxs)(t,{flexDirection:`column`,marginTop:1,children:[o.type===`checking`&&(0,D.jsx)(n,{color:`claude`,children:`Checking installation status...`}),o.type===`cleaning-npm`&&(0,D.jsx)(n,{color:`warning`,children:`Cleaning up old npm installations...`}),o.type===`installing`&&(0,D.jsxs)(n,{color:`claude`,children:[`Installing Claude Code native build `,o.version,`...`]}),o.type===`setting-up`&&(0,D.jsx)(n,{color:`claude`,children:`Setting up launcher and shell integration...`}),o.type===`set-up`&&(0,D.jsx)(k,{messages:o.messages}),o.type===`success`&&(0,D.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,D.jsxs)(t,{children:[(0,D.jsx)(a,{status:`success`,withSpace:!0}),(0,D.jsx)(n,{color:`success`,bold:!0,children:`Claude Code successfully installed!`})]}),(0,D.jsxs)(t,{marginLeft:2,flexDirection:`column`,gap:1,children:[o.version!==`current`&&(0,D.jsxs)(t,{children:[(0,D.jsx)(n,{dimColor:!0,children:`Version: `}),(0,D.jsx)(n,{color:`claude`,children:o.version})]}),(0,D.jsxs)(t,{children:[(0,D.jsx)(n,{dimColor:!0,children:`Location: `}),(0,D.jsx)(n,{color:`text`,children:O()})]})]}),(0,D.jsx)(t,{marginLeft:2,flexDirection:`column`,gap:1,children:(0,D.jsxs)(t,{marginTop:1,children:[(0,D.jsx)(n,{dimColor:!0,children:`Next: Run `}),(0,D.jsx)(n,{color:`claude`,bold:!0,children:`claude --help`}),(0,D.jsx)(n,{dimColor:!0,children:` to get started`})]})}),o.setupMessages&&(0,D.jsx)(k,{messages:o.setupMessages})]}),o.type===`error`&&(0,D.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,D.jsxs)(t,{children:[(0,D.jsx)(a,{status:`error`,withSpace:!0}),(0,D.jsx)(n,{color:`error`,children:`Installation failed`})]}),(0,D.jsx)(n,{color:`error`,children:o.message}),(0,D.jsx)(t,{marginTop:1,children:(0,D.jsx)(n,{dimColor:!0,children:`Try running with --force to override checks`})})]})]})}var j={type:`local-jsx`,name:`install`,description:`Install Claude Code native build`,argumentHint:`[options]`,async call(e,t,n){let r=n.includes(`--force`),a=n.filter(e=>!e.startsWith(`--`))[0],{unmount:o}=await i((0,D.jsx)(A,{onDone:(t,n)=>{o(),e(t,n)},force:r,target:a}))}};export{j as install};
@@ -1 +0,0 @@
1
- import{D as e,E as t,U as n,l as r,p as i,z as a}from"./debug-IKW-jE7K.js";import{M as o,j as s}from"./git-tyaWOgRL.js";import{n as c,r as l}from"./analytics-BotDBGh0.js";c(),r(),s(),n(),t();function u(e){if(e<6e4)return`${Math.round(e/1e3)}s`;let t=Math.floor(e/6e4),n=Math.round(e%6e4/1e3);return n>0?`${t}m ${n}s`:`${t}m`}function d(t){let n=(t.startsWith(`sk-ant-si-`)?t.slice(10):t).split(`.`);if(n.length!==3||!n[1])return null;try{return e(Buffer.from(n[1],`base64url`).toString(`utf8`))}catch{return null}}function f(e){let t=d(e);return typeof t==`object`&&t&&`exp`in t&&typeof t.exp==`number`?t.exp:null}var p=300*1e3,m=1800*1e3,h=3,g=6e4;function _({getAccessToken:e,onRefresh:t,label:n,refreshBufferMs:r=p}){let s=new Map,c=new Map,d=new Map;function _(e){let t=(d.get(e)??0)+1;return d.set(e,t),t}function v(e,t){let a=f(t);if(!a){i(`[${n}:token] Could not decode JWT expiry for sessionId=${e}, token prefix=${t.slice(0,15)}…, keeping existing timer`);return}let o=s.get(e);o&&clearTimeout(o);let c=_(e),l=new Date(a*1e3).toISOString(),d=a*1e3-Date.now()-r;if(d<=0){i(`[${n}:token] Token for sessionId=${e} expires=${l} (past or within buffer), refreshing immediately`),b(e,c);return}i(`[${n}:token] Scheduled token refresh for sessionId=${e} in ${u(d)} (expires=${l}, buffer=${r/1e3}s)`);let p=setTimeout(b,d,e,c);s.set(e,p)}function y(e,t){let a=s.get(e);a&&clearTimeout(a);let o=_(e),c=Math.max(t*1e3-r,3e4);i(`[${n}:token] Scheduled token refresh for sessionId=${e} in ${u(c)} (expires_in=${t}s, buffer=${r/1e3}s)`);let l=setTimeout(b,c,e,o);s.set(e,l)}async function b(r,f){let p;try{p=await e()}catch(e){i(`[${n}:token] getAccessToken threw for sessionId=${r}: ${a(e)}`,{level:`error`})}if(d.get(r)!==f){i(`[${n}:token] doRefresh for sessionId=${r} stale (gen ${f} vs ${d.get(r)}), skipping`);return}if(!p){let e=(c.get(r)??0)+1;if(c.set(r,e),i(`[${n}:token] No OAuth token available for refresh, sessionId=${r} (failure ${e}/${h})`,{level:`error`}),o(`error`,`bridge_token_refresh_no_oauth`),e<h){let e=setTimeout(b,g,r,f);s.set(r,e)}return}c.delete(r),i(`[${n}:token] Refreshing token for sessionId=${r}: new token prefix=${p.slice(0,15)}…`),l(`tengu_bridge_token_refreshed`,{}),t(r,p);let _=setTimeout(b,m,r,f);s.set(r,_),i(`[${n}:token] Scheduled follow-up refresh for sessionId=${r} in ${u(m)}`)}function x(e){_(e);let t=s.get(e);t&&(clearTimeout(t),s.delete(e)),c.delete(e)}function S(){for(let e of d.keys())_(e);for(let e of s.values())clearTimeout(e);s.clear(),c.clear()}return{schedule:v,scheduleFromExpiresIn:y,cancel:x,cancelAll:S}}export{f as n,_ as t};
@@ -1,2 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Xx as t,Yx as n,Zx as r,aS as i,eS as a,iS as o,nS as s,rS as c}from"./loadAgentsDir-nzr38hai.js";import{B as l,E as u,O as d,U as f}from"./debug-IKW-jE7K.js";import{r as p,t as m}from"./promptEditor-foiayhdY.js";import{dirname as h}from"path";import{mkdir as g,writeFile as _}from"fs/promises";function v(e){let t=new Set(a.map(e=>c(e.key)));return e.map(e=>{let n={};for(let[r,i]of Object.entries(e.bindings))t.has(c(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(),i(),s()}));async function x(){if(!r())return{type:`text`,value:`Keybinding customization is not enabled. This feature is currently in preview.`};let e=n(),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 i=await m(e);return i.error?{type:`text`,value:`${t?`Opened`:`Created`} ${e}. Could not open in editor: ${i.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-BuRSO2sR.js";e();export{t as getResolvedLanguage};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";function t(e){let t;return()=>t??(t=e())}var n=e((()=>{}));export{t as n,n as t};
@@ -1 +0,0 @@
1
- import{o as e,t}from"./loadAgentsDir-nzr38hai.js";e();export{t as clearAgentDefinitionsCache};
@@ -1 +0,0 @@
1
- import{vy as e,xy as t,yy as n}from"./loadAgentsDir-nzr38hai.js";e();export{n as loadPluginHooks,t as setupPluginHookHotReload};
@@ -1 +0,0 @@
1
- import{a as e,c as t,o as n,t as r}from"./localSearch-B-L_ldos.js";n();export{r as clearSkillIndexCache,e as getSkillIndex,t as searchSkills};