@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
@@ -0,0 +1,33 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{Bt as r,di as i,j as a,t as o,ui as s}from"./src-CDCSSo0U2.js";import{n as c,t as l}from"./cwd-CYmmnQVS.js";import{C as u,H as d,S as ee,d as te,p as ne,w as re,z as ie}from"./debug-BrXObCdR.js";import{Jt as f,Zt as ae}from"./settings-DfWP5y6X.js";import{b as p,c as m,g as h,o as g,y as _}from"./config-DiT2Z8dY.js";import{r as v,t as y}from"./execFileNoThrow-D244NytW.js";import{o as b,s as x}from"./log-BMCygSzM.js";import{i as oe,o as se}from"./platform-BrYefG_2.js";import{f as ce,m as le}from"./file-DcZWPH2V.js";import{d as ue,o as S,s as C}from"./types-C-MRCL8J.js";import{r as w,t as de}from"./completionCache-MN3_MqK8.js";import{homedir as T,platform as E}from"os";import{dirname as D,join as O}from"path";import{randomBytes as k}from"crypto";import{copyFile as A,mkdir as j,readFile as M,stat as N,writeFile as P}from"fs/promises";import{pathToFileURL as fe}from"url";function F(){let e=te().existsSync(O(l(),`CLAUDE.md`)),t=le(l());return[{key:`workspace`,text:`Ask Claude to create a new app or clone a repository`,isComplete:!1,isCompletable:!0,isEnabled:t},{key:`claudemd`,text:`Run /init to create a CLAUDE.md file with instructions for Claude`,isComplete:e,isCompletable:!0,isEnabled:!t}]}function I(){return F().filter(({isCompletable:e,isEnabled:t})=>e&&t).every(({isComplete:e})=>e)}function L(){g().hasCompletedProjectOnboarding||I()&&_(e=>({...e,hasCompletedProjectOnboarding:!0}))}function R(){_(e=>({...e,projectOnboardingSeenCount:e.projectOnboardingSeenCount+1}))}var z,B=e((()=>{n(),h(),c(),ce(),ne(),z=t(()=>{let e=g();return e.hasCompletedProjectOnboarding||e.projectOnboardingSeenCount>=4||process.env.IS_DEMO?!1:!I()})}));function pe(e){p(t=>({...t,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:e}))}function V(){p(e=>({...e,appleTerminalSetupInProgress:!1}))}function me(){let e=m();return{inProgress:e.appleTerminalSetupInProgress??!1,backupPath:e.appleTerminalBackupPath||null}}function H(){return O(T(),`Library`,`Preferences`,`com.apple.Terminal.plist`)}async function he(){let e=H(),t=`${e}.bak`;try{let{code:n}=await y(`defaults`,[`export`,`com.apple.Terminal`,e]);if(n!==0)return null;try{await N(e)}catch{return null}return await y(`defaults`,[`export`,`com.apple.Terminal`,t]),pe(t),t}catch(e){return x(e),null}}async function U(){let{inProgress:e,backupPath:t}=me();if(!e)return{status:`no_backup`};if(!t)return V(),{status:`no_backup`};try{await N(t)}catch{return V(),{status:`no_backup`}}try{let{code:e}=await y(`defaults`,[`import`,`com.apple.Terminal`,t]);return e===0?(await y(`killall`,[`cfprefsd`]),V(),{status:`restored`}):{status:`failed`,backupPath:t}}catch(e){return x(Error(`Failed to restore Terminal.app settings with: ${e}`)),V(),{status:`failed`,backupPath:t}}}var W=e((()=>{h(),v(),b()}));function ge(){let e=process.env.VSCODE_GIT_ASKPASS_MAIN??``,t=process.env.PATH??``;return e.includes(`.vscode-server`)||e.includes(`.cursor-server`)||e.includes(`.windsurf-server`)||t.includes(`.vscode-server`)||t.includes(`.cursor-server`)||t.includes(`.windsurf-server`)}function _e(){return!f.terminal||!(f.terminal in $)?null:$[f.terminal]??null}function G(e){return r()?`\x1b]8;;${fe(e).href}\x07${e}\x1b]8;;\x07`:e}function K(){return E()===`darwin`&&f.terminal===`Apple_Terminal`||f.terminal===`vscode`||f.terminal===`cursor`||f.terminal===`windsurf`||f.terminal===`alacritty`||f.terminal===`zed`}async function q(e){let t=``;switch(f.terminal){case`Apple_Terminal`:t=await xe(e);break;case`vscode`:t=await Y(`VSCode`,e);break;case`cursor`:t=await Y(`Cursor`,e);break;case`windsurf`:t=await Y(`Windsurf`,e);break;case`alacritty`:t=await Se(e);break;case`zed`:t=await Ce(e);break;case null:break}return p(e=>[`vscode`,`cursor`,`windsurf`,`alacritty`,`zed`].includes(f.terminal??``)?e.shiftEnterKeyBindingInstalled===!0?e:{...e,shiftEnterKeyBindingInstalled:!0}:f.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled===!0?e:{...e,optionAsMetaKeyInstalled:!0}:e),L(),process.env.USER_TYPE===`ant`&&(t+=await w(e)),t}function ve(){return m().shiftEnterKeyBindingInstalled===!0}function J(){return m().hasUsedBackslashReturn===!0}function ye(){m().hasUsedBackslashReturn||p(e=>({...e,hasUsedBackslashReturn:!0}))}async function be(e,t,n){if(f.terminal&&f.terminal in $)return e(`Shift+Enter is natively supported in ${$[f.terminal]}.
2
+
3
+ No configuration needed. Just use Shift+Enter to add newlines.`),null;if(!K()){let t=f.terminal||`your current terminal`,n=oe(),r=``;return n===`macos`?r=` • macOS: Apple Terminal
4
+ `:n===`windows`&&(r=` • Windows: Windows Terminal
5
+ `),e(`Terminal setup cannot be run from ${t}.
6
+
7
+ This command configures a convenient Shift+Enter shortcut for multi-line prompts.
8
+ ${s.dim(`Note: You can already use backslash (\\\\) + return to add newlines.`)}
9
+
10
+ To set up the shortcut (optional):
11
+ 1. Exit tmux/screen temporarily
12
+ 2. Run /terminal-setup directly in one of these terminals:
13
+ ${r} • IDE: VSCode, Cursor, Windsurf, Zed
14
+ • Other: Alacritty
15
+ 3. Return to tmux/screen - settings will persist
16
+
17
+ ${s.dim(`Note: iTerm2, WezTerm, Ghostty, Kitty, and Warp support Shift+Enter natively.`)}`),null}return e(await q(t.options.theme)),null}async function Y(e=`VSCode`,t){if(ge())return`${a(`warning`,t)(`Cannot install keybindings from a remote ${e} session.`)}${Q}${Q}${e} keybindings must be installed on your local machine, not the remote server.${Q}${Q}To install the Shift+Enter keybinding:${Q}1. Open ${e} on your local machine (not connected to remote)${Q}2. Open the Command Palette (Cmd/Ctrl+Shift+P) → "Preferences: Open Keyboard Shortcuts (JSON)"${Q}3. Add this keybinding (the file must be a JSON array):${Q}${Q}${s.dim(`[
18
+ {
19
+ "key": "shift+enter",
20
+ "command": "workbench.action.terminal.sendSequence",
21
+ "args": { "text": "\\u001b\\r" },
22
+ "when": "terminalFocus"
23
+ }
24
+ ]`)}${Q}`;let n=e===`VSCode`?`Code`:e,r=O(T(),E()===`win32`?O(`AppData`,`Roaming`,n,`User`):E()===`darwin`?O(`Library`,`Application Support`,n,`User`):O(`.config`,n,`User`)),i=O(r,`keybindings.json`);try{await j(r,{recursive:!0});let n=`[]`,o=[],c=!1;try{n=await M(i,{encoding:`utf-8`}),c=!0,o=ue(n)??[]}catch(e){if(!d(e))throw e}if(c){let n=`${i}.${k(4).toString(`hex`)}.bak`;try{await A(i,n)}catch{return`${a(`warning`,t)(`Error backing up existing ${e} terminal keybindings. Bailing out.`)}${Q}${s.dim(`See ${G(i)}`)}${Q}${s.dim(`Backup path: ${G(n)}`)}${Q}`}}return o.find(e=>e.key===`shift+enter`&&e.command===`workbench.action.terminal.sendSequence`&&e.when===`terminalFocus`)?`${a(`warning`,t)(`Found existing ${e} terminal Shift+Enter key binding. Remove it to continue.`)}${Q}${s.dim(`See ${G(i)}`)}${Q}`:(await P(i,S(n,{key:`shift+enter`,command:`workbench.action.terminal.sendSequence`,args:{text:`\x1B\r`},when:`terminalFocus`}),{encoding:`utf-8`}),`${a(`success`,t)(`Installed ${e} terminal Shift+Enter key binding`)}${Q}${s.dim(`See ${G(i)}`)}${Q}`)}catch(t){throw x(t),Error(`Failed to install ${e} terminal Shift+Enter key binding`)}}async function X(e){let{code:t}=await y(`/usr/libexec/PlistBuddy`,[`-c`,`Add :'Window Settings':'${e}':useOptionAsMetaKey bool true`,H()]);if(t!==0){let{code:t}=await y(`/usr/libexec/PlistBuddy`,[`-c`,`Set :'Window Settings':'${e}':useOptionAsMetaKey true`,H()]);if(t!==0)return x(Error(`Failed to enable Option as Meta key for Terminal.app profile: ${e}`)),!1}return!0}async function Z(e){let{code:t}=await y(`/usr/libexec/PlistBuddy`,[`-c`,`Add :'Window Settings':'${e}':Bell bool false`,H()]);if(t!==0){let{code:t}=await y(`/usr/libexec/PlistBuddy`,[`-c`,`Set :'Window Settings':'${e}':Bell false`,H()]);if(t!==0)return x(Error(`Failed to disable audio bell for Terminal.app profile: ${e}`)),!1}return!0}async function xe(e){try{if(!await he())throw Error(`Failed to create backup of Terminal.app preferences, bailing out`);let{stdout:t,code:n}=await y(`defaults`,[`read`,`com.apple.Terminal`,`Default Window Settings`]);if(n!==0||!t.trim())throw Error(`Failed to read default Terminal.app profile`);let{stdout:r,code:i}=await y(`defaults`,[`read`,`com.apple.Terminal`,`Startup Window Settings`]);if(i!==0||!r.trim())throw Error(`Failed to read startup Terminal.app profile`);let o=!1,c=t.trim(),l=await X(c),u=await Z(c);(l||u)&&(o=!0);let d=r.trim();if(d!==c){let e=await X(d),t=await Z(d);(e||t)&&(o=!0)}if(!o)throw Error(`Failed to enable Option as Meta key or disable audio bell for any Terminal.app profile`);return await y(`killall`,[`cfprefsd`]),V(),`${a(`success`,e)(`Configured Terminal.app settings:`)}${Q}${a(`success`,e)(`- Enabled "Use Option as Meta key"`)}${Q}${a(`success`,e)(`- Switched to visual bell`)}${Q}${s.dim(`Option+Enter will now enter a newline.`)}${Q}${s.dim(`You must restart Terminal.app for changes to take effect.`,e)}${Q}`}catch(e){x(e);let t=await U(),n=`Failed to enable Option as Meta key for Terminal.app.`;throw t.status===`restored`?Error(`${n} Your settings have been restored from backup.`):t.status===`failed`?Error(`${n} Restoring from backup failed, try manually with: defaults import com.apple.Terminal ${t.backupPath}`):Error(`${n} No backup was available to restore from.`)}}async function Se(e){let t=[],n=process.env.XDG_CONFIG_HOME;if(n?t.push(O(n,`alacritty`,`alacritty.toml`)):t.push(O(T(),`.config`,`alacritty`,`alacritty.toml`)),E()===`win32`){let e=process.env.APPDATA;e&&t.push(O(e,`alacritty`,`alacritty.toml`))}let r=null,i=``,o=!1;for(let e of t)try{i=await M(e,{encoding:`utf-8`}),r=e,o=!0;break}catch(e){if(!d(e))throw e}if(r||(r=t[0]??null),!r)throw Error(`No valid config path found for Alacritty`);try{if(o){if(i.includes(`mods = "Shift"`)&&i.includes(`key = "Return"`))return`${a(`warning`,e)(`Found existing Alacritty Shift+Enter key binding. Remove it to continue.`)}${Q}${s.dim(`See ${G(r)}`)}${Q}`;let t=k(4).toString(`hex`),n=`${r}.${t}.bak`;try{await A(r,n)}catch{return`${a(`warning`,e)(`Error backing up existing Alacritty config. Bailing out.`)}${Q}${s.dim(`See ${G(r)}`)}${Q}${s.dim(`Backup path: ${G(n)}`)}${Q}`}}else await j(D(r),{recursive:!0});let t=i;return i&&!i.endsWith(`
25
+ `)&&(t+=`
26
+ `),t+=`
27
+ [[keyboard.bindings]]
28
+ key = "Return"
29
+ mods = "Shift"
30
+ chars = "\\u001B\\r"
31
+ `,await P(r,t,{encoding:`utf-8`}),`${a(`success`,e)(`Installed Alacritty Shift+Enter key binding`)}${Q}${a(`success`,e)(`You may need to restart Alacritty for changes to take effect`)}${Q}${s.dim(`See ${G(r)}`)}${Q}`}catch(e){throw x(e),Error(`Failed to install Alacritty Shift+Enter key binding`)}}async function Ce(e){let t=O(T(),`.config`,`zed`),n=O(t,`keymap.json`);try{await j(t,{recursive:!0});let r=`[]`,i=!1;try{r=await M(n,{encoding:`utf-8`}),i=!0}catch(e){if(!d(e))throw e}if(i){if(r.includes(`shift-enter`))return`${a(`warning`,e)(`Found existing Zed Shift+Enter key binding. Remove it to continue.`)}${Q}${s.dim(`See ${G(n)}`)}${Q}`;let t=`${n}.${k(4).toString(`hex`)}.bak`;try{await A(n,t)}catch{return`${a(`warning`,e)(`Error backing up existing Zed keymap. Bailing out.`)}${Q}${s.dim(`See ${G(n)}`)}${Q}${s.dim(`Backup path: ${G(t)}`)}${Q}`}}let o;try{o=u(r),Array.isArray(o)||(o=[])}catch{o=[]}return o.push({context:`Terminal`,bindings:{"shift-enter":[`terminal::SendText`,`\x1B\r`]}}),await P(n,re(o,null,2)+`
32
+ `,{encoding:`utf-8`}),`${a(`success`,e)(`Installed Zed Shift+Enter key binding`)}${Q}${s.dim(`See ${G(n)}`)}${Q}`}catch(e){throw x(e),Error(`Failed to install Zed Shift+Enter key binding`)}}var Q,$,we=e((()=>{i(),o(),B(),W(),de(),h(),ae(),ie(),v(),C(),b(),se(),ee(),Q=`
33
+ `,$={ghostty:`Ghostty`,kitty:`Kitty`,"iTerm.app":`iTerm2`,WezTerm:`WezTerm`,WarpTerminal:`Warp`}}));export{ve as a,K as c,F as d,R as f,z as h,we as i,U as l,L as m,_e as n,ye as o,B as p,J as r,q as s,be as t,W as u};
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./terminalSetup-C0PF87iu.js";n();export{s as call,r as getNativeCSIuTerminalDisplayName,a as hasUsedBackslashReturn,e as isShiftEnterKeyBindingInstalled,i as markBackslashReturnUsed,o as setupTerminal,t as shouldOfferTerminalSetup};
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./terminalSetup-BNs9nLbT.js";n();export{s as call,r as getNativeCSIuTerminalDisplayName,a as hasUsedBackslashReturn,e as isShiftEnterKeyBindingInstalled,i as markBackslashReturnUsed,o as setupTerminal,t as shouldOfferTerminalSetup};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,fi as n,t as r,x as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{n as o,t as s}from"./ThemePicker-BYbChJpu.js";function c({onDone:e}){let[,n]=t();return(0,l.jsx)(i,{color:`permission`,children:(0,l.jsx)(s,{onThemeSelect:t=>{n(t),e(`Theme set to ${t}`)},onCancel:()=>{e(`Theme picker dismissed`,{display:`system`})},skipExitHandling:!0})})}var l,u;e((()=>{n(),r(),o(),l=a(),u=async(e,t)=>(0,l.jsx)(c,{onDone:e})}))();export{u as call};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,fi as n,t as r,x as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{n as o,t as s}from"./ThemePicker-BTfuZZ7E.js";function c({onDone:e}){let[,n]=t();return(0,l.jsx)(i,{color:`permission`,children:(0,l.jsx)(s,{onThemeSelect:t=>{n(t),e(`Theme set to ${t}`)},onCancel:()=>{e(`Theme picker dismissed`,{display:`system`})},skipExitHandling:!0})})}var l,u;e((()=>{n(),r(),o(),l=a(),u=async(e,t)=>(0,l.jsx)(c,{onDone:e})}))();export{u as call};
@@ -0,0 +1 @@
1
+ import{n as e,r as t,t as n}from"./thinkback-CXsRbDYN.js";e();export{n as call,t as playAnimation};
@@ -0,0 +1 @@
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,Rn as i,fi as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{$D as l,As as u,Es as d,Fs as f,Gs as p,Hs as m,Is as ee,Lb as h,Vs as g,ZD as _,_x as v,fs as y,lc as b,ps as x,uc as S,vx as te,zb as C}from"./loadAgentsDir-DrDu5yYy.js";import{V as w,W as T,a as E,l as D,z as ne}from"./debug-BrXObCdR.js";import{c as re,o as ie,r as ae,t as oe}from"./execFileNoThrow-D244NytW.js";import{o as se,s as O}from"./log-BMCygSzM.js";import{i as ce,o as k}from"./platform-BrYefG_2.js";import{_ as A,f as j}from"./file-DcZWPH2V.js";import{n as M,r as N}from"./pluginStartupCheck-BNd2QNzZ.js";import{a as P,s as F}from"./pluginOperations-ClzXYNQe.js";import{join as I}from"path";import{readFile as L}from"fs/promises";function R(){return process.env.USER_TYPE===`ant`?q:_}function z(){return process.env.USER_TYPE===`ant`?J:Y}function B(){return`thinkback@${R()}`}async function V(){let{enabled:e}=await x(),t=e.find(e=>e.name===`thinkback`||e.source&&e.source.includes(B()));if(!t)return null;let n=I(t.path,`skills`,X);return await A(n)?n:null}async function H(e){let t=I(e,`year_in_review.js`),n=I(e,`player.js`);try{await L(t)}catch(e){return w(e)?{success:!1,message:`No animation found. Run /think-back first to generate one.`}:(O(e),{success:!1,message:`Could not access animation data: ${T(e).message}`})}try{await L(n)}catch(e){return w(e)?{success:!1,message:`Player script not found. The player.js file is missing from the thinkback skill.`}:(O(e),{success:!1,message:`Could not access player script: ${T(e).message}`})}let r=i.get(process.stdout);if(!r)return{success:!1,message:`Failed to access terminal instance`};r.enterAlternateScreen();try{await ie(`node`,[n],{stdio:`inherit`,cwd:e,reject:!1})}catch{}finally{r.exitAlternateScreen()}let a=I(e,`year_in_review.html`);if(await A(a)){let e=ce();oe(e===`macos`?`open`:e===`windows`?`start`:`xdg-open`,[a])}return{success:!0,message:`Year in review animation complete!`}}function U({onReady:e,onError:t}){let[i,a]=(0,G.useState)({phase:`checking`}),[o,s]=(0,G.useState)(``);if((0,G.useEffect)(()=>{async function n(){try{let t=await m(),n=R(),r=z(),i=B(),o=n in t,c=u(i);if(o?c||(a({phase:`installing-marketplace`}),s(`Updating marketplace…`),D(`Refreshing marketplace ${n}`),await p(n,e=>{s(e)}),ee(),b(),D(`Marketplace ${n} refreshed`)):(a({phase:`installing-marketplace`}),D(`Installing marketplace ${r}`),await f({source:`github`,repo:r},e=>{s(e)}),b(),D(`Marketplace ${n} installed`)),c){let{disabled:e}=await x();if(e.some(e=>e.name===`thinkback`||e.source?.includes(i))){a({phase:`enabling-plugin`}),D(`Enabling plugin ${i}`);let e=await P(i);if(!e.success)throw Error(`Failed to enable plugin: ${e.message}`);b(),D(`Plugin ${i} enabled`)}}else{a({phase:`installing-plugin`}),D(`Installing plugin ${i}`);let e=await N([i]);if(e.failed.length>0){let t=e.failed.map(e=>`${e.name}: ${e.error}`).join(`, `);throw Error(`Failed to install plugin: ${t}`)}b(),D(`Plugin ${i} installed`)}a({phase:`ready`}),e()}catch(e){let n=T(e);O(n),a({phase:`error`,message:n.message}),t(n.message)}}n()},[e,t]),i.phase===`error`)return(0,K.jsx)(n,{flexDirection:`column`,children:(0,K.jsxs)(r,{color:`error`,children:[`Error: `,i.message]})});if(i.phase===`ready`)return null;let c=i.phase===`checking`?`Checking thinkback installation…`:i.phase===`installing-marketplace`?`Installing marketplace…`:i.phase===`enabling-plugin`?`Enabling thinkback plugin…`:`Installing thinkback plugin…`;return(0,K.jsx)(n,{flexDirection:`column`,children:(0,K.jsxs)(n,{children:[(0,K.jsx)(h,{}),(0,K.jsx)(r,{children:o||c})]})})}function W({onDone:e,onAction:t,skillDir:i,hasGenerated:a}){let[o,c]=(0,G.useState)(!1),l=a?[{label:`Play animation`,value:`play`,description:`Watch your year in review`},{label:`Edit content`,value:`edit`,description:`Modify the animation`},{label:`Fix errors`,value:`fix`,description:`Fix validation or rendering issues`},{label:`Regenerate`,value:`regenerate`,description:`Create a new animation from scratch`}]:[{label:`Let's go!`,value:`regenerate`,description:`Generate your personalized animation`}];function u(n){c(!0),n===`play`?H(i).then(()=>{e(void 0,{display:`skip`})}):t(n)}function d(){e(void 0,{display:`skip`})}return o?null:(0,K.jsx)(s,{title:`Think Back on 2025 with Work Mate`,subtitle:`Generate your 2025 Work Mate Think Back (takes a few minutes to run)`,onCancel:d,color:`claude`,children:(0,K.jsxs)(n,{flexDirection:`column`,gap:1,children:[!a&&(0,K.jsxs)(n,{flexDirection:`column`,children:[(0,K.jsx)(r,{children:`Relive your year of coding with Claude.`}),(0,K.jsx)(r,{dimColor:!0,children:`We'll create a personalized ASCII animation celebrating your journey.`})]}),(0,K.jsx)(v,{options:l,onChange:u,visibleOptionCount:5})]})})}function le({onDone:e}){let[t,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null);function d(){i(!0)}let f=(0,G.useCallback)(t=>{o(t),e(`Error with thinkback: ${t}. Try running /plugin to manually install the think-back plugin.`,{display:`system`})},[e]);(0,G.useEffect)(()=>{t&&!s&&!a&&V().then(e=>{e?(D(`Thinkback skill directory: ${e}`),c(e)):f(`Could not find thinkback skill directory`)})},[t,s,a,f]),(0,G.useEffect)(()=>{if(!s)return;let e=I(s,`year_in_review.js`);A(e).then(t=>{D(`Checking for ${e}: ${t?`found`:`not found`}`),u(t)})},[s]);function p(t){e({edit:Z,fix:Q,regenerate:$}[t],{display:`user`,shouldQuery:!0})}return a?(0,K.jsxs)(n,{flexDirection:`column`,children:[(0,K.jsxs)(r,{color:`error`,children:[`Error: `,a]}),(0,K.jsx)(r,{dimColor:!0,children:`Try running /plugin to manually install the think-back plugin.`})]}):t?!s||l===null?(0,K.jsxs)(n,{children:[(0,K.jsx)(h,{}),(0,K.jsx)(r,{children:`Loading thinkback skill…`})]}):(0,K.jsx)(W,{onDone:e,onAction:p,skillDir:s,hasGenerated:l}):(0,K.jsx)(U,{onReady:d,onError:f})}async function ue(e){return(0,K.jsx)(le,{onDone:e})}var G,K,q,J,Y,X,Z,Q,$,de=e((()=>{re(),a(),G=t(a(),1),te(),o(),C(),F(),E(),ne(),ae(),j(),se(),k(),S(),d(),g(),l(),y(),M(),K=c(),q=`claude-code-marketplace`,J=`anthropics/claude-code-marketplace`,Y=`anthropics/claude-plugins-official`,X=`thinkback`,Z=`Use the Skill tool to invoke the "thinkback" skill with mode=edit to modify my existing Work Mate year in review animation. Ask me what I want to change. When the animation is ready, tell the user to run /think-back again to play it.`,Q=`Use the Skill tool to invoke the "thinkback" skill with mode=fix to fix validation or rendering errors in my existing Work Mate year in review animation. Run the validator, identify errors, and fix them. When the animation is ready, tell the user to run /think-back again to play it.`,$=`Use the Skill tool to invoke the "thinkback" skill with mode=regenerate to create a completely new Work Mate year in review animation from scratch. Delete the existing animation and start fresh. When the animation is ready, tell the user to run /think-back again to play it.`}));export{de as n,H as r,ue as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$D as t,Es as n,Ms as r,ZD as i}from"./loadAgentsDir-DrDu5yYy.js";import{n as a,r as o}from"./thinkback-CXsRbDYN.js";import{join as s}from"path";function c(){return`thinkback@${process.env.USER_TYPE===`ant`?u:i}`}async function l(){let e=r(),t=c(),n=e.plugins[t];if(!n||n.length===0)return{type:`text`,value:`Thinkback plugin not installed. Run /think-back first to install it.`};let i=n[0];return i?.installPath?{type:`text`,value:(await o(s(i.installPath,`skills`,d))).message}:{type:`text`,value:`Thinkback plugin installation path not found.`}}var u,d;e((()=>{n(),t(),a(),u=`claude-code-marketplace`,d=`thinkback`}))();export{l as call};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{r,t as i}from"./execFileNoThrow-COKYqVQj.js";import{a,i as o,t as s}from"./cliLaunch-2AUoMnqx.js";import{spawnSync as c}from"child_process";var l;e((()=>{r(),o(),t(),l=class{constructor(){n(this,`name`,`tmux`),n(this,`supportsInteractiveInput`,!0)}async available(){let{code:e}=await i(`tmux`,[`-V`],{useCwd:!1});return e===0}async start(e){let t=s(e.args,{env:{...e.env,CLAUDE_CODE_SESSION_KIND:`bg`,CLAUDE_CODE_SESSION_NAME:e.sessionName,CLAUDE_CODE_SESSION_LOG:e.logPath,CLAUDE_CODE_TMUX_SESSION:e.sessionName}}),n=a(t);if(c(`tmux`,[`new-session`,`-d`,`-s`,e.sessionName,n],{stdio:`inherit`,env:t.env}).status!==0)throw Error(`Failed to create tmux session.`);return{pid:0,sessionName:e.sessionName,logPath:e.logPath,engineUsed:`tmux`}}async attach(e){if(!e.tmuxSessionName)throw Error(`Session ${e.sessionId} has no tmux session name.`);if(c(`tmux`,[`attach-session`,`-t`,e.tmuxSessionName],{stdio:`inherit`}).status!==0)throw Error(`Failed to attach to tmux session '${e.tmuxSessionName}'.`)}}}))();export{l as TmuxEngine};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{r,t as i}from"./execFileNoThrow-D244NytW.js";import{a,i as o,t as s}from"./cliLaunch-BkPAatcs.js";import{spawnSync as c}from"child_process";var l;e((()=>{r(),o(),t(),l=class{constructor(){n(this,`name`,`tmux`),n(this,`supportsInteractiveInput`,!0)}async available(){let{code:e}=await i(`tmux`,[`-V`],{useCwd:!1});return e===0}async start(e){let t=s(e.args,{env:{...e.env,CLAUDE_CODE_SESSION_KIND:`bg`,CLAUDE_CODE_SESSION_NAME:e.sessionName,CLAUDE_CODE_SESSION_LOG:e.logPath,CLAUDE_CODE_TMUX_SESSION:e.sessionName}}),n=a(t);if(c(`tmux`,[`new-session`,`-d`,`-s`,e.sessionName,n],{stdio:`inherit`,env:t.env}).status!==0)throw Error(`Failed to create tmux session.`);return{pid:0,sessionName:e.sessionName,logPath:e.logPath,engineUsed:`tmux`}}async attach(e){if(!e.tmuxSessionName)throw Error(`Session ${e.sessionId} has no tmux session name.`);if(c(`tmux`,[`attach-session`,`-t`,e.tmuxSessionName],{stdio:`inherit`}).status!==0)throw Error(`Failed to attach to tmux session '${e.tmuxSessionName}'.`)}}}))();export{l as TmuxEngine};
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./toolEventObserver-8FQtxeVv.js";i();export{c as hasToolHookObservationsForTurn,o as pruneEmittedTurns,n as recordToolComplete,e as recordToolError,a as recordToolStart,s as recordUserCorrection,t as resetToolHookBookkeeping,r as resetToolHookDepsCache,l as runToolCallWithSkillLearningHooks};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./toolEventObserver-DdhPsAs1.js";i();export{c as hasToolHookObservationsForTurn,o as pruneEmittedTurns,n as recordToolComplete,e as recordToolError,a as recordToolStart,s as recordUserCorrection,t as resetToolHookBookkeeping,r as resetToolHookDepsCache,l as runToolCallWithSkillLearningHooks};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,p as n}from"./debug-IKW-jE7K.js";import{o as r,s as i}from"./log-B3eB4EFv.js";import{i as a,t as o}from"./observationStore-DzCdXq8U.js";import{randomUUID as s}from"node:crypto";function c(){for(let[e,t]of T)if(t.size>x){let e=t.values(),n=t.size-S;for(let r=0;r<n;r++){let n=e.next();if(n.done)break;t.delete(n.value)}}if(T.size>C){let e=T.size-w,t=0;for(let n of T.keys()){if(t>=e)break;T.delete(n),t++}}}function l(e,t){let n=T.get(e)??new Set;n.add(t),T.delete(e),T.set(e,n),c()}function u(e,t){return T.get(e)?.has(t)??!1}function d(){T.clear()}function f(e){return{id:s(),sessionId:e.sessionId,projectId:e.projectId,projectName:e.projectName,cwd:e.cwd,timestamp:new Date().toISOString(),source:`tool-hook`,turn:e.turn}}function p(){return E||(E=Promise.all([import(`./projectContext-BaDZBAoK.js`),import(`./featureCheck-CrJeuheQ.js`),import(`./runtimeObserver-BNH2WGE3.js`)]).then(([e,t,n])=>({resolveProjectContext:e.resolveProjectContext,isSkillLearningEnabled:t.isSkillLearningEnabled,RUNTIME_SESSION_ID:n.RUNTIME_SESSION_ID,getRuntimeTurn:n.getRuntimeTurn}))),E}function m(){E=void 0}async function h(e,t,r,a){let o;try{let{resolveProjectContext:s,isSkillLearningEnabled:c,RUNTIME_SESSION_ID:l,getRuntimeTurn:u}=await p();if(!c())return a();let d=s(process.cwd());o={sessionId:r.sessionId??l,turn:r.turn??u(),projectId:d.projectId,projectName:d.projectName,cwd:d.cwd,project:d},g(o,e,t).catch(e=>{n(`skill-learning: recordToolStart error`),i(e)})}catch(e){n(`skill-learning: hook setup error`),i(e)}try{let t=await a();return o&&_(o,e,t,`success`).catch(e=>{n(`skill-learning: recordToolComplete error`),i(e)}),t}catch(t){throw o&&v(o,e,t).catch(e=>{n(`skill-learning: recordToolError error`),i(e)}),t}}async function g(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_start`,toolName:t,toolInput:b(n)},{project:e.project})}async function _(e,t,n,r=`success`){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:r},{project:e.project})}async function v(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:`failure`},{project:e.project})}async function y(e,t){return l(e.sessionId,e.turn),o({...f(e),event:`user_message`,messageText:t},{project:e.project})}function b(e){if(e!=null){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}}var x,S,C,w,T,E,D=e((()=>{a(),t(),r(),x=500,S=250,C=50,w=25,T=new Map}));export{v as a,d as c,_ as i,m as l,D as n,g as o,c as r,y as s,u as t,h as u};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,l as n}from"./debug-BrXObCdR.js";import{o as r,s as i}from"./log-BMCygSzM.js";import{i as a,t as o}from"./observationStore-DzCdXq8U.js";import{randomUUID as s}from"node:crypto";function c(){for(let[e,t]of T)if(t.size>x){let e=t.values(),n=t.size-S;for(let r=0;r<n;r++){let n=e.next();if(n.done)break;t.delete(n.value)}}if(T.size>C){let e=T.size-w,t=0;for(let n of T.keys()){if(t>=e)break;T.delete(n),t++}}}function l(e,t){let n=T.get(e)??new Set;n.add(t),T.delete(e),T.set(e,n),c()}function u(e,t){return T.get(e)?.has(t)??!1}function d(){T.clear()}function f(e){return{id:s(),sessionId:e.sessionId,projectId:e.projectId,projectName:e.projectName,cwd:e.cwd,timestamp:new Date().toISOString(),source:`tool-hook`,turn:e.turn}}function p(){return E||(E=Promise.all([import(`./projectContext-BaDZBAoK.js`),import(`./featureCheck-CrJeuheQ.js`),import(`./runtimeObserver-DSUuYKfs.js`)]).then(([e,t,n])=>({resolveProjectContext:e.resolveProjectContext,isSkillLearningEnabled:t.isSkillLearningEnabled,RUNTIME_SESSION_ID:n.RUNTIME_SESSION_ID,getRuntimeTurn:n.getRuntimeTurn}))),E}function m(){E=void 0}async function h(e,t,r,a){let o;try{let{resolveProjectContext:s,isSkillLearningEnabled:c,RUNTIME_SESSION_ID:l,getRuntimeTurn:u}=await p();if(!c())return a();let d=s(process.cwd());o={sessionId:r.sessionId??l,turn:r.turn??u(),projectId:d.projectId,projectName:d.projectName,cwd:d.cwd,project:d},g(o,e,t).catch(e=>{n(`skill-learning: recordToolStart error`),i(e)})}catch(e){n(`skill-learning: hook setup error`),i(e)}try{let t=await a();return o&&_(o,e,t,`success`).catch(e=>{n(`skill-learning: recordToolComplete error`),i(e)}),t}catch(t){throw o&&v(o,e,t).catch(e=>{n(`skill-learning: recordToolError error`),i(e)}),t}}async function g(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_start`,toolName:t,toolInput:b(n)},{project:e.project})}async function _(e,t,n,r=`success`){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:r},{project:e.project})}async function v(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:`failure`},{project:e.project})}async function y(e,t){return l(e.sessionId,e.turn),o({...f(e),event:`user_message`,messageText:t},{project:e.project})}function b(e){if(e!=null){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}}var x,S,C,w,T,E,D=e((()=>{a(),t(),r(),x=500,S=250,C=50,w=25,T=new Map}));export{v as a,d as c,_ as i,m as l,D as n,g as o,c as r,y as s,u as t,h as u};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{MD as t,M_ as n,N_ as r,jD as i}from"./loadAgentsDir-DrDu5yYy.js";import{n as a,t as o}from"./partition-RjCtgt9J.js";function s(e,n,i){let[o,s]=a(t([...e,...n],`name`),r),c=(e,t)=>e.name.localeCompare(t.name);return[...s.sort(c),...o.sort(c)]}var c=e((()=>{o(),i(),n()}));export{s as n,c as t};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{F as a,S as o,a as s,l as c,w as l,z as u}from"./debug-BrXObCdR.js";import{d,f}from"./log-BMCygSzM.js";import{l as p,u as m}from"./oauth-BqJqV-2M.js";import{Cn as h,Vt as g,pt as _,wn as v}from"./model-fi472PRc.js";import{hostname as y}from"os";i(),n(),m(),s(),u(),d(),v(),o();var b=`tengu_sessions_elevated_auth_enforcement`;function x(){return!1}var S=t(()=>process.env.CLAUDE_TRUSTED_DEVICE_TOKEN||h().read()?.trustedDeviceToken);function C(){if(x())return S()}function w(){S.cache?.clear?.()}function T(){if(!x())return;let e=h();try{let t=e.read();t?.trustedDeviceToken&&(delete t.trustedDeviceToken,e.update(t))}catch{}S.cache?.clear?.()}async function E(){try{if(!await!1){c(`[trusted-device] Gate ${b} is off, skipping enrollment`);return}if(process.env.CLAUDE_TRUSTED_DEVICE_TOKEN){c(`[trusted-device] CLAUDE_TRUSTED_DEVICE_TOKEN env var is set, skipping enrollment (env var takes precedence)`);return}let{getClaudeAIOAuthTokens:t}=(g(),e(_)),n=t()?.accessToken;if(!n){c(`[trusted-device] No OAuth token, skipping enrollment`);return}let i=h();if(f()){c(`[trusted-device] Essential traffic only, skipping enrollment`);return}let o=p().BASE_API_URL,s;try{s=await r.post(`${o}/api/auth/trusted_devices`,{display_name:`Work Mate on ${y()} · ${process.platform}`},{headers:{Authorization:`Bearer ${n}`,"Content-Type":`application/json`},timeout:1e4,validateStatus:e=>e<500})}catch(e){c(`[trusted-device] Enrollment request failed: ${a(e)}`);return}if(s.status!==200&&s.status!==201){c(`[trusted-device] Enrollment failed ${s.status}: ${l(s.data).slice(0,200)}`);return}let u=s.data?.device_token;if(!u||typeof u!=`string`){c(`[trusted-device] Enrollment response missing device_token field`);return}try{let e=i.read();if(!e){c(`[trusted-device] Cannot read storage, skipping token persist`);return}e.trustedDeviceToken=u;let t=i.update(e);if(!t.success){c(`[trusted-device] Failed to persist token: ${t.warning??`unknown`}`);return}S.cache?.clear?.(),c(`[trusted-device] Enrolled device_id=${s.data.device_id??`unknown`}`)}catch(e){c(`[trusted-device] Storage write failed: ${a(e)}`)}}catch(e){c(`[trusted-device] Enrollment error: ${a(e)}`)}}export{C as i,w as n,E as r,T as t};
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./trustedDevice-DvpN4J1F.js";export{t as clearTrustedDeviceToken,e as enrollTrustedDevice};
@@ -1,6 +1,6 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{en as r,z as i}from"./state-4KQ3kaqz.js";import{join as a}from"node:path";import{existsSync as o,mkdirSync as s,unlinkSync as c,writeFileSync as l}from"node:fs";function u(){return a(t(),`.tui-mode`)}function d(){return o(u())}function f(){let e=u();return s(t(),{recursive:!0}),l(e,new Date().toISOString(),`utf8`),{type:`text`,value:[`## TUI mode enabled`,``,`Marker written: \`${e}\``,``,`Flicker-free alternate-screen rendering will be active on the next`,`session start. Add this to your shell profile to make it permanent:`,``,` [ -f "$HOME/.claude/.tui-mode" ] && export CLAUDE_CODE_NO_FLICKER=1`,``,"To disable: `/tui off`"].join(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{en as r,z as i}from"./state-ix0xIunV.js";import{join as a}from"node:path";import{existsSync as o,mkdirSync as s,unlinkSync as c,writeFileSync as l}from"node:fs";function u(){return a(t(),`.tui-mode`)}function d(){return o(u())}function f(){let e=u();return s(t(),{recursive:!0}),l(e,new Date().toISOString(),`utf8`),{type:`text`,value:[`## TUI mode enabled`,``,`Marker written: \`${e}\``,``,`Flicker-free alternate-screen rendering will be active on the next`,`session start. Add this to your shell profile to make it permanent:`,``,` [ -f "$HOME/.claude/.tui-mode" ] && export CLAUDE_CODE_NO_FLICKER=1`,``,"To disable: `/tui off`"].join(`
2
2
  `)}}function p(){let e=u();return o(e)?(c(e),{type:`text`,value:[`## TUI mode disabled`,``,`Marker removed: \`${e}\``,``,`Standard (non-alternate-screen) rendering will be used on the next`,`session start.`,``,"To re-enable: `/tui on`"].join(`
3
3
  `)}):{type:`text`,value:`TUI mode was not active.`}}async function m(e){let t=e.trim().toLowerCase();if(t===`status`){let e=d(),t=u(),n=process.env.CLAUDE_CODE_NO_FLICKER,r;return r=n===`1`||n===`true`?`CLAUDE_CODE_NO_FLICKER=1 (forced on via env var)`:n===`0`||n===`false`?`CLAUDE_CODE_NO_FLICKER=0 (forced off via env var)`:`CLAUDE_CODE_NO_FLICKER not set`,{type:`text`,value:[`## TUI Mode Status`,``,` Marker file: ${e?`present`:`absent`} (\`${t}\`)`,` Mode: ${e?`enabled`:`disabled`}`,` Env var: ${r}`,``,`Note: changes take effect on the next session start.`].join(`
4
4
  `)}}return t===`on`?f():t===`off`?p():t===``||t===`toggle`?d()?p():f():{type:`text`,value:[`Unknown subcommand: "${t}"`,``,h].join(`
5
- `)}}var h,g,_,v=e((()=>{r(),n(),h=[`Usage: /tui [subcommand]`,``,` (no args) Toggle flicker-free TUI mode (alternate screen buffer)`,` on Enable TUI mode`,` off Disable TUI mode`,` status Show current TUI mode state`,``,`TUI mode uses the ANSI alternate screen buffer (\\x1b[?1049h) so the`,`Claude Code UI occupies a clean full-screen area with no scroll-back`,`flicker. The setting is stored in ~/.claude/.tui-mode and takes effect`,`on the next session start.`,``,`Shell-profile integration (auto-enable on every start):`,` [ -f "$HOME/.claude/.tui-mode" ] && export CLAUDE_CODE_NO_FLICKER=1`,``,`Environment override:`,` CLAUDE_CODE_NO_FLICKER=1 force on (overrides marker)`,` CLAUDE_CODE_NO_FLICKER=0 force off (overrides marker)`].join(`
6
- `),g={type:`local-jsx`,name:`tui`,description:`Manage flicker-free TUI mode. Open actions or run: status, on, off, toggle`,isHidden:!1,isEnabled:()=>!i(),argumentHint:`[status|on|off|toggle]`,bridgeSafe:!0,getBridgeInvocationError:e=>e.trim()?void 0:`Use /tui status/on/off/toggle over Remote Control.`,load:()=>import(`./panel-R4ue6pSW.js`)},_={type:`local`,name:`tui`,description:`Toggle flicker-free TUI mode (alternate screen buffer). Subcommands: on, off, status`,isHidden:!1,isEnabled:()=>i(),supportsNonInteractive:!0,bridgeSafe:!0,load:async()=>({call:m})}}));export{_ as i,v as n,g as r,m as t};
5
+ `)}}var h,g,_,v=e((()=>{r(),n(),h=[`Usage: /tui [subcommand]`,``,` (no args) Toggle flicker-free TUI mode (alternate screen buffer)`,` on Enable TUI mode`,` off Disable TUI mode`,` status Show current TUI mode state`,``,`TUI mode uses the ANSI alternate screen buffer (\\x1b[?1049h) so the`,`Work Mate UI occupies a clean full-screen area with no scroll-back`,`flicker. The setting is stored in ~/.claude/.tui-mode and takes effect`,`on the next session start.`,``,`Shell-profile integration (auto-enable on every start):`,` [ -f "$HOME/.claude/.tui-mode" ] && export CLAUDE_CODE_NO_FLICKER=1`,``,`Environment override:`,` CLAUDE_CODE_NO_FLICKER=1 force on (overrides marker)`,` CLAUDE_CODE_NO_FLICKER=0 force off (overrides marker)`].join(`
6
+ `),g={type:`local-jsx`,name:`tui`,description:`Manage flicker-free TUI mode. Open actions or run: status, on, off, toggle`,isHidden:!1,isEnabled:()=>!i(),argumentHint:`[status|on|off|toggle]`,bridgeSafe:!0,getBridgeInvocationError:e=>e.trim()?void 0:`Use /tui status/on/off/toggle over Remote Control.`,load:()=>import(`./panel-Be-OxtqL.js`)},_={type:`local`,name:`tui`,description:`Toggle flicker-free TUI mode (alternate screen buffer). Subcommands: on, off, status`,isHidden:!1,isEnabled:()=>i(),supportsNonInteractive:!0,bridgeSafe:!0,load:async()=>({call:m})}}));export{_ as i,v as n,g as r,m as t};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A as t,C as n,O as r,b as i,j as a,l as o,m as s,p as c,t as l,w as u}from"./v4-jw6qOKwQ.js";import{C as d,E as f,O as p,w as m}from"./debug-IKW-jE7K.js";import{o as h,s as g}from"./log-B3eB4EFv.js";import{n as _,t as v}from"./memoize-BO31Ws9Q.js";import{n as y,t as b}from"./lazySchema-uxlVVNM1.js";import{open as x,readFile as S,stat as C}from"fs/promises";function w(e){return e.startsWith(T)?e.slice(1):e}var T,E=e((()=>{T=``}));function D(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&A(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&A(e.charCodeAt(r)))for(r++;r<e.length&&A(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&A(e.charCodeAt(r))){for(r++;r<e.length&&A(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A as t,E as n,M as r,N as i,S as a,T as o,d as s,g as c,h as l,n as u,r as d,t as f}from"./lazySchema-DcIJE_0i.js";import{S as p,b as m,w as h,y as g}from"./debug-BrXObCdR.js";import{o as _,s as v}from"./log-BMCygSzM.js";import{n as y,t as b}from"./memoize-B0zhbT8Z.js";import{open as x,readFile as S,stat as C}from"fs/promises";function w(e){return e.startsWith(T)?e.slice(1):e}var T,E=e((()=>{T=``}));function D(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&A(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&A(e.charCodeAt(r)))for(r++;r<e.length&&A(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&A(e.charCodeAt(r))){for(r++;r<e.length&&A(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
2
2
  `;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(k(a)){t+=e.substring(i,r),d=2;break}else d=6;r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(O(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(O(t));return o=15}if(k(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
3
3
  `),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!k(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,k(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!A(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(O(e)||k(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function O(e){return e===32||e===9}function k(e){return e===10||e===13}function A(e){return e>=48&&e<=57}var ee,j=e((()=>{(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(ee||(ee={}))})),M,N,P,F,te=e((()=>{M=Array(20).fill(0).map((e,t)=>` `.repeat(t)),N=200,P={" ":{"\n":Array(N).fill(0).map((e,t)=>`
4
4
  `+` `.repeat(t)),"\r":Array(N).fill(0).map((e,t)=>`\r`+` `.repeat(t)),"\r\n":Array(N).fill(0).map((e,t)=>`\r
@@ -12,6 +12,6 @@ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A as t,C as n,O as r,b
12
12
  `)return`
13
13
  `}return e&&e.eol||`
14
14
  `}function L(e,t){return`\r
15
- `.indexOf(e.charAt(t))!==-1}var ae=e((()=>{j(),te()}));function oe(e,t=[],n=R.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return le(e,{onObjectBegin:()=>{let e={};o(e),a.push(i),i=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{i=a.pop()},onArrayBegin:()=>{let e=[];o(e),a.push(i),i=e,r=null},onArrayEnd:()=>{i=a.pop()},onLiteralValue:o,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n),i[0]}function se(e,t=[],n=R.DEFAULT){let r={type:`array`,offset:-1,length:-1,children:[],parent:void 0};function i(e){r.type===`property`&&(r.length=e-r.offset,r=r.parent)}function a(e){return r.children.push(e),e}le(e,{onObjectBegin:e=>{r=a({type:`object`,offset:e,length:-1,parent:r,children:[]})},onObjectProperty:(e,t,n)=>{r=a({type:`property`,offset:t,length:-1,parent:r,children:[]}),r.children.push({type:`string`,value:e,offset:t,length:n,parent:r})},onObjectEnd:(e,t)=>{i(e+t),r.length=e+t-r.offset,r=r.parent,i(e+t)},onArrayBegin:(e,t)=>{r=a({type:`array`,offset:e,length:-1,parent:r,children:[]})},onArrayEnd:(e,t)=>{r.length=e+t-r.offset,r=r.parent,i(e+t)},onLiteralValue:(e,t,n)=>{a({type:ue(e),offset:t,length:n,parent:r,value:e}),i(t+n)},onSeparator:(e,t,n)=>{r.type===`property`&&(e===`:`?r.colonOffset=t:e===`,`&&i(t))},onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n);let o=r.children[0];return o&&delete o.parent,o}function ce(e,t){if(!e)return;let n=e;for(let e of t)if(typeof e==`string`){if(n.type!==`object`||!Array.isArray(n.children))return;let t=!1;for(let r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&r.children.length===2){n=r.children[1],t=!0;break}if(!t)return}else{let t=e;if(n.type!==`array`||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n}function le(e,t,n=R.DEFAULT){let r=D(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16);break}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}else if(n.indexOf(e)!==-1)break;e=S()}}}function w(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function T(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function E(){return r.getToken()===10?(w(!1),r.getToken()===6?(_(`:`),S(),A()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function O(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);E()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function k(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,A()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function A(){switch(r.getToken()){case 3:return k();case 1:return O();case 10:return w(!0);default:return T()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):A()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}function ue(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`;case`object`:return e?Array.isArray(e)?`array`:`object`:`null`;default:return`null`}}var R,z=e((()=>{j(),(function(e){e.DEFAULT={allowTrailingComma:!1}})(R||(R={}))}));function de(e,t,n,r){let i=t.slice(),a=se(e,[]),o,s;for(;i.length>0&&(s=i.pop(),o=ce(a,i),o===void 0&&n!==void 0);)n=typeof s==`string`?{[s]:n}:[n];if(!o){if(n===void 0)throw Error(`Can not delete in empty document`);return B(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}else if(o.type===`object`&&typeof s==`string`&&Array.isArray(o.children)){let t=ce(o,[s]);if(t!==void 0)if(n===void 0){if(!t.parent)throw Error(`Malformed AST`);let n=o.children.indexOf(t.parent),i,a=t.parent.offset+t.parent.length;if(n>0){let e=o.children[n-1];i=e.offset+e.length}else i=o.offset+1,o.children.length>1&&(a=o.children[1].offset);return B(e,{offset:i,length:a-i,content:``},r)}else return B(e,{offset:t.offset,length:t.length,content:JSON.stringify(n)},r);else{if(n===void 0)return[];let t=`${JSON.stringify(s)}: ${JSON.stringify(n)}`,i=r.getInsertionIndex?r.getInsertionIndex(o.children.map(e=>e.children[0].value)):o.children.length,a;if(i>0){let e=o.children[i-1];a={offset:e.offset+e.length,length:0,content:`,`+t}}else a=o.children.length===0?{offset:o.offset+1,length:0,content:t}:{offset:o.offset+1,length:0,content:t+`,`};return B(e,a,r)}}else if(o.type===`array`&&typeof s==`number`&&Array.isArray(o.children)){let t=s;if(t===-1){let t=`${JSON.stringify(n)}`,i;if(o.children.length===0)i={offset:o.offset+1,length:0,content:t};else{let e=o.children[o.children.length-1];i={offset:e.offset+e.length,length:0,content:`,`+t}}return B(e,i,r)}else if(n===void 0&&o.children.length>=0){let t=s,n=o.children[t],i;if(o.children.length===1)i={offset:o.offset+1,length:o.length-2,content:``};else if(o.children.length-1===t){let e=o.children[t-1],n=e.offset+e.length;i={offset:n,length:o.offset+o.length-2-n,content:``}}else i={offset:n.offset,length:o.children[t+1].offset-n.offset,content:``};return B(e,i,r)}else if(n!==void 0){let t,i=`${JSON.stringify(n)}`;if(!r.isArrayInsertion&&o.children.length>s){let e=o.children[s];t={offset:e.offset,length:e.length,content:i}}else if(o.children.length===0||s===0)t={offset:o.offset+1,length:0,content:o.children.length===0?i:i+`,`};else{let e=s>o.children.length?o.children.length:s,n=o.children[e-1];t={offset:n.offset+n.length,length:0,content:`,`+i}}return B(e,t,r)}else throw Error(`Can not ${n===void 0?`remove`:r.isArrayInsertion?`insert`:`modify`} Array index ${t} as length is not sufficient`)}else throw Error(`Can not add ${typeof s==`number`?`property`:`index`} to parent of type ${o.type}`)}function B(e,t,n){if(!n.formattingOptions)return[t];let r=V(e,t),i=t.offset,a=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;i>0&&!L(r,i-1);)i--;for(;a<r.length&&!L(r,a);)a++}let o=ne(r,{offset:i,length:a-i},{...n.formattingOptions,keepLines:!1});for(let e=o.length-1;e>=0;e--){let t=o[e];r=V(r,t),i=Math.min(i,t.offset),a=Math.max(a,t.offset+t.length),a+=t.content.length-t.length}let s=e.length-(r.length-a)-i;return[{offset:i,length:s,content:r.substring(i,a)}]}function V(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}var fe=e((()=>{ae(),z()}));function pe(e,t,n,r){return de(e,t,n,r)}function me(e,t){let n=t.slice(0).sort((e,t)=>{let n=e.offset-t.offset;return n===0?e.length-t.length:n}),r=e.length;for(let t=n.length-1;t>=0;t--){let i=n[t];if(i.offset+i.length<=r)e=V(e,i);else throw Error(`Overlapping edit`);r=i.offset}return e}var H,U,W,G,he=e((()=>{ae(),fe(),j(),z(),(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(H||(H={})),(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(U||(U={})),W=oe,(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(G||(G={}))}));function ge(e,t){try{return{ok:!0,value:JSON.parse(w(e))}}catch(e){return t&&g(e),{ok:!1}}}function _e(e){if(!e)return null;try{return W(w(e))}catch(e){return g(e),null}}function ve(e){let t=J,n=e.length,r=t(e);if(!r.error||r.done||r.read>=n)return r.values;let i=r.values,a=r.read;for(;a<n;){let r=typeof e==`string`?e.indexOf(`
15
+ `.indexOf(e.charAt(t))!==-1}var ae=e((()=>{j(),te()}));function oe(e,t=[],n=R.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return le(e,{onObjectBegin:()=>{let e={};o(e),a.push(i),i=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{i=a.pop()},onArrayBegin:()=>{let e=[];o(e),a.push(i),i=e,r=null},onArrayEnd:()=>{i=a.pop()},onLiteralValue:o,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n),i[0]}function se(e,t=[],n=R.DEFAULT){let r={type:`array`,offset:-1,length:-1,children:[],parent:void 0};function i(e){r.type===`property`&&(r.length=e-r.offset,r=r.parent)}function a(e){return r.children.push(e),e}le(e,{onObjectBegin:e=>{r=a({type:`object`,offset:e,length:-1,parent:r,children:[]})},onObjectProperty:(e,t,n)=>{r=a({type:`property`,offset:t,length:-1,parent:r,children:[]}),r.children.push({type:`string`,value:e,offset:t,length:n,parent:r})},onObjectEnd:(e,t)=>{i(e+t),r.length=e+t-r.offset,r=r.parent,i(e+t)},onArrayBegin:(e,t)=>{r=a({type:`array`,offset:e,length:-1,parent:r,children:[]})},onArrayEnd:(e,t)=>{r.length=e+t-r.offset,r=r.parent,i(e+t)},onLiteralValue:(e,t,n)=>{a({type:ue(e),offset:t,length:n,parent:r,value:e}),i(t+n)},onSeparator:(e,t,n)=>{r.type===`property`&&(e===`:`?r.colonOffset=t:e===`,`&&i(t))},onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n);let o=r.children[0];return o&&delete o.parent,o}function ce(e,t){if(!e)return;let n=e;for(let e of t)if(typeof e==`string`){if(n.type!==`object`||!Array.isArray(n.children))return;let t=!1;for(let r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&r.children.length===2){n=r.children[1],t=!0;break}if(!t)return}else{let t=e;if(n.type!==`array`||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n}function le(e,t,n=R.DEFAULT){let r=D(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16);break}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}else if(n.indexOf(e)!==-1)break;e=S()}}}function w(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function T(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function E(){return r.getToken()===10?(w(!1),r.getToken()===6?(_(`:`),S(),A()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function O(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);E()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function k(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,A()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function A(){switch(r.getToken()){case 3:return k();case 1:return O();case 10:return w(!0);default:return T()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):A()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}function ue(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`;case`object`:return e?Array.isArray(e)?`array`:`object`:`null`;default:return`null`}}var R,z=e((()=>{j(),(function(e){e.DEFAULT={allowTrailingComma:!1}})(R||(R={}))}));function de(e,t,n,r){let i=t.slice(),a=se(e,[]),o,s;for(;i.length>0&&(s=i.pop(),o=ce(a,i),o===void 0&&n!==void 0);)n=typeof s==`string`?{[s]:n}:[n];if(!o){if(n===void 0)throw Error(`Can not delete in empty document`);return B(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}else if(o.type===`object`&&typeof s==`string`&&Array.isArray(o.children)){let t=ce(o,[s]);if(t!==void 0)if(n===void 0){if(!t.parent)throw Error(`Malformed AST`);let n=o.children.indexOf(t.parent),i,a=t.parent.offset+t.parent.length;if(n>0){let e=o.children[n-1];i=e.offset+e.length}else i=o.offset+1,o.children.length>1&&(a=o.children[1].offset);return B(e,{offset:i,length:a-i,content:``},r)}else return B(e,{offset:t.offset,length:t.length,content:JSON.stringify(n)},r);else{if(n===void 0)return[];let t=`${JSON.stringify(s)}: ${JSON.stringify(n)}`,i=r.getInsertionIndex?r.getInsertionIndex(o.children.map(e=>e.children[0].value)):o.children.length,a;if(i>0){let e=o.children[i-1];a={offset:e.offset+e.length,length:0,content:`,`+t}}else a=o.children.length===0?{offset:o.offset+1,length:0,content:t}:{offset:o.offset+1,length:0,content:t+`,`};return B(e,a,r)}}else if(o.type===`array`&&typeof s==`number`&&Array.isArray(o.children)){let t=s;if(t===-1){let t=`${JSON.stringify(n)}`,i;if(o.children.length===0)i={offset:o.offset+1,length:0,content:t};else{let e=o.children[o.children.length-1];i={offset:e.offset+e.length,length:0,content:`,`+t}}return B(e,i,r)}else if(n===void 0&&o.children.length>=0){let t=s,n=o.children[t],i;if(o.children.length===1)i={offset:o.offset+1,length:o.length-2,content:``};else if(o.children.length-1===t){let e=o.children[t-1],n=e.offset+e.length;i={offset:n,length:o.offset+o.length-2-n,content:``}}else i={offset:n.offset,length:o.children[t+1].offset-n.offset,content:``};return B(e,i,r)}else if(n!==void 0){let t,i=`${JSON.stringify(n)}`;if(!r.isArrayInsertion&&o.children.length>s){let e=o.children[s];t={offset:e.offset,length:e.length,content:i}}else if(o.children.length===0||s===0)t={offset:o.offset+1,length:0,content:o.children.length===0?i:i+`,`};else{let e=s>o.children.length?o.children.length:s,n=o.children[e-1];t={offset:n.offset+n.length,length:0,content:`,`+i}}return B(e,t,r)}else throw Error(`Can not ${n===void 0?`remove`:r.isArrayInsertion?`insert`:`modify`} Array index ${t} as length is not sufficient`)}else throw Error(`Can not add ${typeof s==`number`?`property`:`index`} to parent of type ${o.type}`)}function B(e,t,n){if(!n.formattingOptions)return[t];let r=V(e,t),i=t.offset,a=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;i>0&&!L(r,i-1);)i--;for(;a<r.length&&!L(r,a);)a++}let o=ne(r,{offset:i,length:a-i},{...n.formattingOptions,keepLines:!1});for(let e=o.length-1;e>=0;e--){let t=o[e];r=V(r,t),i=Math.min(i,t.offset),a=Math.max(a,t.offset+t.length),a+=t.content.length-t.length}let s=e.length-(r.length-a)-i;return[{offset:i,length:s,content:r.substring(i,a)}]}function V(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}var fe=e((()=>{ae(),z()}));function pe(e,t,n,r){return de(e,t,n,r)}function me(e,t){let n=t.slice(0).sort((e,t)=>{let n=e.offset-t.offset;return n===0?e.length-t.length:n}),r=e.length;for(let t=n.length-1;t>=0;t--){let i=n[t];if(i.offset+i.length<=r)e=V(e,i);else throw Error(`Overlapping edit`);r=i.offset}return e}var H,U,W,G,he=e((()=>{ae(),fe(),j(),z(),(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(H||(H={})),(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(U||(U={})),W=oe,(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(G||(G={}))}));function ge(e,t){try{return{ok:!0,value:JSON.parse(w(e))}}catch(e){return t&&v(e),{ok:!1}}}function _e(e){if(!e)return null;try{return W(w(e))}catch(e){return v(e),null}}function ve(e){let t=J,n=e.length,r=t(e);if(!r.error||r.done||r.read>=n)return r.values;let i=r.values,a=r.read;for(;a<n;){let r=typeof e==`string`?e.indexOf(`
16
16
  `,a):e.indexOf(10,a);if(r===-1)break;a=r+1;let o=t(e,a);if(o.values.length>0&&(i=i.concat(o.values)),!o.error||o.done||o.read>=n)break;a=o.read}return i}function ye(e){let t=e.length,n=0;e[0]===239&&e[1]===187&&e[2]===191&&(n=3);let r=[];for(;n<t;){let i=e.indexOf(10,n);i===-1&&(i=t);let a=e.toString(`utf8`,n,i).trim();if(n=i+1,a)try{r.push(JSON.parse(a))}catch{}}return r}function be(e){let t=w(e),n=t.length,r=0,i=[];for(;r<n;){let e=t.indexOf(`
17
- `,r);e===-1&&(e=n);let a=t.substring(r,e).trim();if(r=e+1,a)try{i.push(JSON.parse(a))}catch{}}return i}function K(e){return J?ve(e):typeof e==`string`?be(e):ye(e)}async function xe(e){try{var t=d();let{size:n}=await C(e);if(n<=Y)return K(await S(e));let r=t.a(await x(e,`r`)),i=Buffer.allocUnsafe(Y),a=0,o=n-Y;for(;a<Y;){let{bytesRead:e}=await r.read(i,a,Y-a,o+a);if(e===0)break;a+=e}let s=i.indexOf(10);return s!==-1&&s<a-1?K(i.subarray(s+1,a)):K(i.subarray(0,a))}catch(e){t.e=e}finally{await t.d()}}function Se(e,t){try{if(!e||e.trim()===``)return p([t],null,4);let n=w(e),r=W(n);if(Array.isArray(r)){let e=r.length,i=pe(n,e===0?[0]:[e],t,{formattingOptions:{insertSpaces:!0,tabSize:4},isArrayInsertion:!0});return!i||i.length===0?p([...r,t],null,4):me(n,i)}else return p([t],null,4)}catch(e){return g(e),p([t],null,4)}}var Ce,q,we,J,Y,Te=e((()=>{he(),E(),h(),v(),f(),m(),Ce=8*1024,q=_(ge,e=>e,50),we=Object.assign(function(e,t=!0){if(!e)return null;let n=e.length>Ce?ge(e,t):q(e,t);return n.ok?n.value:null},{cache:q.cache}),J=(()=>{if(typeof Bun>`u`)return!1;let e=Bun.JSONL;return e?.parseChunk?e.parseChunk:!1})(),Y=100*1024*1024})),Ee,X,De,Z,Oe,ke,Ae,je,Q,Me,Ne,$,Pe,Fe=e((()=>{l(),b(),Ee=y(()=>o([`local`,`user`,`project`,`dynamic`,`enterprise`,`claudeai`,`managed`])),y(()=>o([`stdio`,`sse`,`sse-ide`,`http`,`ws`,`sdk`,`claudeai-proxy`])),X=y(()=>u({type:i(`stdio`).optional(),command:t().min(1,`Command cannot be empty`),args:c(t()).default([]),env:r(t(),t()).optional()})),De=y(()=>s()),Z=y(()=>u({clientId:t().optional(),callbackPort:n().int().positive().optional(),authServerMetadataUrl:t().url().startsWith(`https://`,{message:`authServerMetadataUrl must use https://`}).optional(),xaa:De().optional()})),Oe=y(()=>u({type:i(`sse`),url:t(),headers:r(t(),t()).optional(),headersHelper:t().optional(),oauth:Z().optional()})),ke=y(()=>u({type:i(`sse-ide`),url:t(),ideName:t(),ideRunningInWindows:s().optional()})),Ae=y(()=>u({type:i(`ws-ide`),url:t(),ideName:t(),authToken:t().optional(),ideRunningInWindows:s().optional()})),je=y(()=>u({type:i(`http`),url:t(),headers:r(t(),t()).optional(),headersHelper:t().optional(),oauth:Z().optional()})),Q=y(()=>u({type:i(`ws`),url:t(),headers:r(t(),t()).optional(),headersHelper:t().optional()})),Me=y(()=>u({type:i(`sdk`),name:t()})),Ne=y(()=>u({type:i(`claudeai-proxy`),url:t(),id:t()})),$=y(()=>a([X(),Oe(),ke(),Ae(),je(),Q(),Me(),Ne()])),Pe=y(()=>u({mcpServers:r(t(),$())}))}));export{Fe as a,K as c,_e as d,E as f,X as i,xe as l,Pe as n,Se as o,w as p,$ as r,Te as s,Ee as t,we as u};
17
+ `,r);e===-1&&(e=n);let a=t.substring(r,e).trim();if(r=e+1,a)try{i.push(JSON.parse(a))}catch{}}return i}function K(e){return J?ve(e):typeof e==`string`?be(e):ye(e)}async function xe(e){try{var t=g();let{size:n}=await C(e);if(n<=Y)return K(await S(e));let r=t.a(await x(e,`r`)),i=Buffer.allocUnsafe(Y),a=0,o=n-Y;for(;a<Y;){let{bytesRead:e}=await r.read(i,a,Y-a,o+a);if(e===0)break;a+=e}let s=i.indexOf(10);return s!==-1&&s<a-1?K(i.subarray(s+1,a)):K(i.subarray(0,a))}catch(e){t.e=e}finally{await t.d()}}function Se(e,t){try{if(!e||e.trim()===``)return h([t],null,4);let n=w(e),r=W(n);if(Array.isArray(r)){let e=r.length,i=pe(n,e===0?[0]:[e],t,{formattingOptions:{insertSpaces:!0,tabSize:4},isArrayInsertion:!0});return!i||i.length===0?h([...r,t],null,4):me(n,i)}else return h([t],null,4)}catch(e){return v(e),h([t],null,4)}}var Ce,q,we,J,Y,Te=e((()=>{he(),E(),_(),b(),p(),m(),Ce=8*1024,q=y(ge,e=>e,50),we=Object.assign(function(e,t=!0){if(!e)return null;let n=e.length>Ce?ge(e,t):q(e,t);return n.ok?n.value:null},{cache:q.cache}),J=(()=>{if(typeof Bun>`u`)return!1;let e=Bun.JSONL;return e?.parseChunk?e.parseChunk:!1})(),Y=100*1024*1024})),Ee,X,De,Z,Oe,ke,Ae,je,Q,Me,Ne,$,Pe,Fe=e((()=>{d(),f(),Ee=u(()=>s([`local`,`user`,`project`,`dynamic`,`enterprise`,`claudeai`,`managed`])),u(()=>s([`stdio`,`sse`,`sse-ide`,`http`,`ws`,`sdk`,`claudeai-proxy`])),X=u(()=>n({type:a(`stdio`).optional(),command:r().min(1,`Command cannot be empty`),args:l(r()).default([]),env:t(r(),r()).optional()})),De=u(()=>c()),Z=u(()=>n({clientId:r().optional(),callbackPort:o().int().positive().optional(),authServerMetadataUrl:r().url().startsWith(`https://`,{message:`authServerMetadataUrl must use https://`}).optional(),xaa:De().optional()})),Oe=u(()=>n({type:a(`sse`),url:r(),headers:t(r(),r()).optional(),headersHelper:r().optional(),oauth:Z().optional()})),ke=u(()=>n({type:a(`sse-ide`),url:r(),ideName:r(),ideRunningInWindows:c().optional()})),Ae=u(()=>n({type:a(`ws-ide`),url:r(),ideName:r(),authToken:r().optional(),ideRunningInWindows:c().optional()})),je=u(()=>n({type:a(`http`),url:r(),headers:t(r(),r()).optional(),headersHelper:r().optional(),oauth:Z().optional()})),Q=u(()=>n({type:a(`ws`),url:r(),headers:t(r(),r()).optional(),headersHelper:r().optional()})),Me=u(()=>n({type:a(`sdk`),name:r()})),Ne=u(()=>n({type:a(`claudeai-proxy`),url:r(),id:r()})),$=u(()=>i([X(),Oe(),ke(),Ae(),je(),Q(),Me(),Ne()])),Pe=u(()=>n({mcpServers:t(r(),$())}))}));export{Fe as a,K as c,_e as d,E as f,X as i,xe as l,Pe as n,Se as o,w as p,$ as r,Te as s,Ee as t,we as u};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{C as r,F as i,H as a,S as o,a as s,l as c,z as l}from"./debug-BrXObCdR.js";import{o as u}from"./log-BMCygSzM.js";import{a as d,i as f}from"./genericProcessUtils-CdQTApYX.js";import"os";import{join as p}from"path";import"crypto";import{readFile as m,readdir as h}from"fs/promises";import"net";import"node:string_decoder";var g=e((()=>{l(),o()})),_=e((()=>{s(),l(),n(),g(),u(),o()}));function v(){return p(t(),`sessions`)}async function y(){let e=v(),t;try{t=await h(e)}catch(e){return a(e)||c(`[udsClient] readdir failed: ${i(e)}`),[]}let n=[];for(let i of t){if(!/^\d+\.json$/.test(i))continue;let t=parseInt(i.slice(0,-5),10);if(d(t))try{let a=r(await m(p(e,i),`utf8`));n.push({pid:t,sessionId:a.sessionId,cwd:a.cwd,startedAt:a.startedAt,kind:a.kind,name:a.name,messagingSocketPath:a.messagingSocketPath,entrypoint:a.entrypoint,bridgeSessionId:a.bridgeSessionId,alive:!0})}catch{}}return n}e((()=>{n(),s(),l(),f(),o(),_(),g()}))();export{y as listAllLiveSessions};
@@ -1,3 +1,3 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{I as i,P as a,fi as o,t as s,y as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{Bv as u,Hv as d,Nb as f,Pb as p,Qv as m,Uv as ee,Vv as h,qv as g,zv as _}from"./loadAgentsDir-nzr38hai.js";import{l as v,p as y}from"./debug-IKW-jE7K.js";import{_ as b,a as x,g as S}from"./git-tyaWOgRL.js";import{r as te,t as C}from"./execFileNoThrow-COKYqVQj.js";import{n as w,r as T}from"./analytics-BotDBGh0.js";import{l as E,u as D}from"./oauth-BqJqV-2M.js";import{Kt as O,Vt as k,Yt as A,nn as j}from"./model-DfFA3qMO.js";import{i as M,r as N}from"./detectRepository-ReZ0Fz8Z.js";import{a as P,l as F,o as I}from"./api-TgV7fl9V.js";import{n as L,t as R}from"./usage-CJ5w0907.js";async function z(){if(!O())return null;try{let{accessToken:e,orgUUID:t}=await F();return(await n.get(`${E().BASE_API_URL}/v1/ultrareview/quota`,{headers:{...P(e),"x-organization-uuid":t},timeout:5e3})).data}catch(e){return y(`fetchUltrareviewQuota failed: ${e}`),null}}var B=e((()=>{r(),D(),k(),v(),I()}));function V(){W=!0}async function H(){if(j()||A())return{kind:`proceed`,billingNote:``};let[e,t]=await Promise.all([z(),R().catch(()=>null)]);if(!e)return{kind:`proceed`,billingNote:``};if(e.reviews_remaining>0)return{kind:`proceed`,billingNote:` This is free ultrareview ${e.reviews_used+1} of ${e.reviews_limit}.`};if(!t)return{kind:`proceed`,billingNote:``};let n=t.extra_usage;if(!n?.is_enabled)return T(`tengu_review_overage_not_enabled`,{}),{kind:`not-enabled`};let r=n.monthly_limit,i=n.used_credits??0,a=r==null?1/0:r-i;return a<10?(T(`tengu_review_overage_low_balance`,{available:a}),{kind:`low-balance`,available:a}):W?{kind:`proceed`,billingNote:` This review bills as Extra Usage.`}:(T(`tengu_review_overage_dialog_shown`,{}),{kind:`needs-confirm`})}async function U(e,t,n){let r=await _();if(!r.eligible){let e=r.errors.filter(e=>e.type!==`no_remote_environment`);if(e.length>0)return T(`tengu_review_remote_precondition_failed`,{precondition_errors:e.map(e=>e.type).join(`,`)}),[{type:`text`,text:`Ultrareview cannot launch:\n${e.map(u).join(`
2
- `)}`}]}let i=n??``,a=e.trim(),o=/^\d+$/.test(a),s=`env_011111111111111111111113`,c={BUGHUNTER_DRY_RUN:`1`,BUGHUNTER_FLEET_SIZE:`5`,BUGHUNTER_MAX_DURATION:`10`,BUGHUNTER_AGENT_TIMEOUT:`600`,BUGHUNTER_TOTAL_WALLCLOCK:`22`,...process.env.BUGHUNTER_DEV_BUNDLE_B64&&{BUGHUNTER_DEV_BUNDLE_B64:process.env.BUGHUNTER_DEV_BUNDLE_B64}},l,d,f;if(o){let e=await N();if(!e||e.host!==`github.com`)return T(`tengu_review_remote_precondition_failed`,{}),null;l=await m({initialMessage:null,description:`ultrareview: ${e.owner}/${e.name}#${a}`,signal:t.abortController.signal,branchName:`refs/pull/${a}/head`,environmentId:s,environmentVariables:{BUGHUNTER_PR_NUMBER:a,BUGHUNTER_REPOSITORY:`${e.owner}/${e.name}`,...c}}),d=`/ultrareview ${a}`,f=`${e.owner}/${e.name}#${a}`}else{let e=await x()||`main`,{stdout:n,code:r}=await C(S(),[`merge-base`,e,`HEAD`],{preserveOutputOnError:!1}),i=n.trim();if(r!==0||!i)return T(`tengu_review_remote_precondition_failed`,{}),[{type:`text`,text:`Could not find merge-base with ${e}. Make sure you're in a git repo with a ${e} branch.`}];let{stdout:a,code:o}=await C(S(),[`diff`,`--shortstat`,i],{preserveOutputOnError:!1});if(o===0&&!a.trim())return T(`tengu_review_remote_precondition_failed`,{}),[{type:`text`,text:`No changes against the ${e} fork point. Make some commits or stage files first.`}];if(l=await m({initialMessage:null,description:`ultrareview: ${e}`,signal:t.abortController.signal,useBundle:!0,environmentId:s,environmentVariables:{BUGHUNTER_BASE_BRANCH:i,...c}}),!l)return T(`tengu_review_remote_teleport_failed`,{}),[{type:`text`,text:"Repo is too large. Push a PR and use `/ultrareview <PR#>` instead."}];d=`/ultrareview`,f=e}if(!l)return T(`tengu_review_remote_teleport_failed`,{}),null;ee({remoteTaskType:`ultrareview`,session:l,command:d,context:t,isRemoteReview:!0}),T(`tengu_review_remote_launched`,{});let p=h(l.id);return[{type:`text`,text:`Ultrareview launched for ${f} (~10–20 min, runs in the cloud). Track: ${p}${i} Findings arrive via task-notification. Briefly acknowledge the launch to the user without repeating the target or URL — both are already visible in the tool output above.`}]}var W,G=e((()=>{w(),B(),L(),d(),k(),M(),te(),b(),g(),W=!1}));function K({onProceed:e,onCancel:t}){let[n,r]=(0,q.useState)(!1),o=(0,q.useRef)(new AbortController),s=(0,q.useCallback)(n=>{n===`proceed`?(r(!0),e(o.current.signal).catch(()=>r(!1))):t()},[e,t]),l=(0,q.useCallback)(()=>{o.current.abort(),t()},[t]);return(0,J.jsx)(c,{title:`Ultrareview billing`,onCancel:l,color:`background`,children:(0,J.jsxs)(i,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(a,{children:`Your free ultrareviews for this organization are used. Further reviews bill as Extra Usage (pay-per-use).`}),n?(0,J.jsx)(a,{color:`background`,children:`Launching…`}):(0,J.jsx)(f,{options:[{label:`Proceed with Extra Usage billing`,value:`proceed`},{label:`Cancel`,value:`cancel`}],onChange:s,onCancel:l})]})})}var q,J,Y=e((()=>{q=t(o(),1),p(),s(),J=l()}));function X(e){return e.map(e=>e.type===`text`?e.text:``).filter(Boolean).join(`
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{I as i,P as a,fi as o,t as s,y as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{Cy as u,Dy as d,Ey as f,Iy as p,Ty as m,_x as h,jy as g,vx as ee,wy as _}from"./loadAgentsDir-DrDu5yYy.js";import{a as v,l as y}from"./debug-BrXObCdR.js";import{_ as b,a as x,g as S}from"./git-Do0wJvux.js";import{r as te,t as C}from"./execFileNoThrow-D244NytW.js";import{n as w,r as T}from"./analytics-BotDBGh0.js";import{l as E,u as D}from"./oauth-BqJqV-2M.js";import{Kt as O,Vt as k,Yt as A,nn as j}from"./model-fi472PRc.js";import{i as M,r as N}from"./detectRepository-BPr0VWNO.js";import{a as P,l as F,o as I}from"./api-gJBnC8z3.js";import{n as L,t as R}from"./usage-CZdPfUqP.js";async function z(){if(!O())return null;try{let{accessToken:e,orgUUID:t}=await F();return(await n.get(`${E().BASE_API_URL}/v1/ultrareview/quota`,{headers:{...P(e),"x-organization-uuid":t},timeout:5e3})).data}catch(e){return y(`fetchUltrareviewQuota failed: ${e}`),null}}var B=e((()=>{r(),D(),k(),v(),I()}));function V(){W=!0}async function H(){if(j()||A())return{kind:`proceed`,billingNote:``};let[e,t]=await Promise.all([z(),R().catch(()=>null)]);if(!e)return{kind:`proceed`,billingNote:``};if(e.reviews_remaining>0)return{kind:`proceed`,billingNote:` This is free ultrareview ${e.reviews_used+1} of ${e.reviews_limit}.`};if(!t)return{kind:`proceed`,billingNote:``};let n=t.extra_usage;if(!n?.is_enabled)return T(`tengu_review_overage_not_enabled`,{}),{kind:`not-enabled`};let r=n.monthly_limit,i=n.used_credits??0,a=r==null?1/0:r-i;return a<10?(T(`tengu_review_overage_low_balance`,{available:a}),{kind:`low-balance`,available:a}):W?{kind:`proceed`,billingNote:` This review bills as Extra Usage.`}:(T(`tengu_review_overage_dialog_shown`,{}),{kind:`needs-confirm`})}async function U(e,t,n){let r=await u();if(!r.eligible){let e=r.errors.filter(e=>e.type!==`no_remote_environment`);if(e.length>0)return T(`tengu_review_remote_precondition_failed`,{precondition_errors:e.map(e=>e.type).join(`,`)}),[{type:`text`,text:`Ultrareview cannot launch:\n${e.map(_).join(`
2
+ `)}`}]}let i=n??``,a=e.trim(),o=/^\d+$/.test(a),s=`env_011111111111111111111113`,c={BUGHUNTER_DRY_RUN:`1`,BUGHUNTER_FLEET_SIZE:`5`,BUGHUNTER_MAX_DURATION:`10`,BUGHUNTER_AGENT_TIMEOUT:`600`,BUGHUNTER_TOTAL_WALLCLOCK:`22`,...process.env.BUGHUNTER_DEV_BUNDLE_B64&&{BUGHUNTER_DEV_BUNDLE_B64:process.env.BUGHUNTER_DEV_BUNDLE_B64}},l,f,h;if(o){let e=await N();if(!e||e.host!==`github.com`)return T(`tengu_review_remote_precondition_failed`,{}),null;l=await p({initialMessage:null,description:`ultrareview: ${e.owner}/${e.name}#${a}`,signal:t.abortController.signal,branchName:`refs/pull/${a}/head`,environmentId:s,environmentVariables:{BUGHUNTER_PR_NUMBER:a,BUGHUNTER_REPOSITORY:`${e.owner}/${e.name}`,...c}}),f=`/ultrareview ${a}`,h=`${e.owner}/${e.name}#${a}`}else{let e=await x()||`main`,{stdout:n,code:r}=await C(S(),[`merge-base`,e,`HEAD`],{preserveOutputOnError:!1}),i=n.trim();if(r!==0||!i)return T(`tengu_review_remote_precondition_failed`,{}),[{type:`text`,text:`Could not find merge-base with ${e}. Make sure you're in a git repo with a ${e} branch.`}];let{stdout:a,code:o}=await C(S(),[`diff`,`--shortstat`,i],{preserveOutputOnError:!1});if(o===0&&!a.trim())return T(`tengu_review_remote_precondition_failed`,{}),[{type:`text`,text:`No changes against the ${e} fork point. Make some commits or stage files first.`}];if(l=await p({initialMessage:null,description:`ultrareview: ${e}`,signal:t.abortController.signal,useBundle:!0,environmentId:s,environmentVariables:{BUGHUNTER_BASE_BRANCH:i,...c}}),!l)return T(`tengu_review_remote_teleport_failed`,{}),[{type:`text`,text:"Repo is too large. Push a PR and use `/ultrareview <PR#>` instead."}];f=`/ultrareview`,h=e}if(!l)return T(`tengu_review_remote_teleport_failed`,{}),null;d({remoteTaskType:`ultrareview`,session:l,command:f,context:t,isRemoteReview:!0}),T(`tengu_review_remote_launched`,{});let g=m(l.id);return[{type:`text`,text:`Ultrareview launched for ${h} (~10–20 min, runs in the cloud). Track: ${g}${i} Findings arrive via task-notification. Briefly acknowledge the launch to the user without repeating the target or URL — both are already visible in the tool output above.`}]}var W,G=e((()=>{w(),B(),L(),f(),k(),M(),te(),b(),g(),W=!1}));function K({onProceed:e,onCancel:t}){let[n,r]=(0,q.useState)(!1),o=(0,q.useRef)(new AbortController),s=(0,q.useCallback)(n=>{n===`proceed`?(r(!0),e(o.current.signal).catch(()=>r(!1))):t()},[e,t]),l=(0,q.useCallback)(()=>{o.current.abort(),t()},[t]);return(0,J.jsx)(c,{title:`Ultrareview billing`,onCancel:l,color:`background`,children:(0,J.jsxs)(i,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(a,{children:`Your free ultrareviews for this organization are used. Further reviews bill as Extra Usage (pay-per-use).`}),n?(0,J.jsx)(a,{color:`background`,children:`Launching…`}):(0,J.jsx)(h,{options:[{label:`Proceed with Extra Usage billing`,value:`proceed`},{label:`Cancel`,value:`cancel`}],onChange:s,onCancel:l})]})})}var q,J,Y=e((()=>{q=t(o(),1),ee(),s(),J=l()}));function X(e){return e.map(e=>e.type===`text`?e.text:``).filter(Boolean).join(`
3
3
  `)}async function Z(e,t,n,r,i){let a=await U(e,t,r);i?.aborted||(a?n(X(a),{shouldQuery:!0}):n(`Ultrareview failed to launch the remote session. Check that this is a GitHub repo and try again.`,{display:`system`}))}var Q,$;e((()=>{G(),Y(),Q=l(),$=async(e,t,n)=>{let r=await H();return r.kind===`not-enabled`?(e(`Free ultrareviews used. Enable Extra Usage at https://claude.ai/settings/billing to continue.`,{display:`system`}),null):r.kind===`low-balance`?(e(`Balance too low to launch ultrareview ($${r.available.toFixed(2)} available, $10 minimum). Top up at https://claude.ai/settings/billing`,{display:`system`}),null):r.kind===`needs-confirm`?(0,Q.jsx)(K,{onProceed:async r=>{await Z(n,t,e,` This review bills as Extra Usage.`,r),r.aborted||V()},onCancel:()=>e(`Ultrareview cancelled.`,{display:`system`})}):(await Z(n,t,e,r.billingNote),null)}}))();export{$ as call};
@@ -0,0 +1 @@
1
+ import{i as e,n as t}from"./undercover-Q24TWRw0.js";t();export{e as shouldShowUndercoverAutoNotice};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DSxRz_kt.js";import{c as r,g as i}from"./config-C7YHKCPV.js";import{l as a,s as o}from"./commitAttribution-Cm40fdNU.js";function s(){return process.env.USER_TYPE===`ant`?t(process.env.CLAUDE_CODE_UNDERCOVER)?!0:o()!==`internal`:!1}function c(){return process.env.USER_TYPE===`ant`?`## UNDERCOVER MODE — CRITICAL
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DSxRz_kt.js";import{c as r,g as i}from"./config-DiT2Z8dY.js";import{l as a,s as o}from"./commitAttribution-Bmzgtqc6.js";function s(){return process.env.USER_TYPE===`ant`?t(process.env.CLAUDE_CODE_UNDERCOVER)?!0:o()!==`internal`:!1}function c(){return process.env.USER_TYPE===`ant`?`## UNDERCOVER MODE — CRITICAL
2
2
 
3
3
  You are operating UNDERCOVER in a PUBLIC/OPEN-SOURCE repository. Your commit
4
4
  messages, PR titles, and PR bodies MUST NOT contain ANY Anthropic-internal
@@ -9,7 +9,7 @@ NEVER include in commit messages or PR descriptions:
9
9
  - Unreleased model version numbers (e.g., sonnet-4-8)
10
10
  - Internal repo or project names (e.g., claude-cli-internal, anthropics/…)
11
11
  - Internal tooling, Slack channels, or short links (e.g., go/cc, #claude-code-…)
12
- - The phrase "Claude Code" or any mention that you are an AI
12
+ - The phrase "Work Mate" or any mention that you are an AI
13
13
  - Any hint of what model or version you are
14
14
  - Co-Authored-By lines or any other attribution
15
15
 
@@ -25,7 +25,7 @@ BAD (never write these):
25
25
  - "Fix bug found while testing with Claude Capybara"
26
26
  - "1-shotted by claude-opus-4-6"
27
27
  - "1-shotted by claude-opus-4-7"
28
- - "Generated with Claude Code"
28
+ - "Generated with Work Mate"
29
29
  - "Co-Authored-By: Claude Opus 4.6 <…>"
30
30
  - "Co-Authored-By: Claude Opus 4.7 <…>"
31
31
  `:``}function l(){return process.env.USER_TYPE===`ant`&&!(t(process.env.CLAUDE_CODE_UNDERCOVER)||!s()||r().hasSeenUndercoverAutoNotice)}var u=e((()=>{a(),i(),n()}));export{l as i,u as n,s as r,c as t};
@@ -1,4 +1,4 @@
1
- import{_ as e,r as t}from"./git-tyaWOgRL.js";import{join as n}from"path";import{readFileSync as r}from"fs";import{spawnSync as i}from"child_process";e();async function a(){let e=process.cwd(),a=t(e),s=a?[a,e]:[e],c=null;for(let e of s){let t=n(e,`CLAUDE.md`);try{if(c=o(r(t,`utf-8`)),c){console.log(`Found "# claude up" in ${t}`);break}}catch{}}if(!c){console.log(`No "# claude up" section found in CLAUDE.md.
1
+ import{_ as e,r as t}from"./git-Do0wJvux.js";import{join as n}from"path";import{readFileSync as r}from"fs";import{spawnSync as i}from"child_process";e();async function a(){let e=process.cwd(),a=t(e),s=a?[a,e]:[e],c=null;for(let e of s){let t=n(e,`CLAUDE.md`);try{if(c=o(r(t,`utf-8`)),c){console.log(`Found "# claude up" in ${t}`);break}}catch{}}if(!c){console.log(`No "# claude up" section found in CLAUDE.md.
2
2
  Add a section like:
3
3
 
4
4
  # claude up
@@ -0,0 +1,11 @@
1
+ import{di as e,ui as t}from"./src-CDCSSo0U2.js";import{fC as n,uC as r}from"./loadAgentsDir-DrDu5yYy.js";import{a as i,l as a}from"./debug-BrXObCdR.js";import{n as o,o as s}from"./process-gEbdy6uY.js";import{n as c,r as l}from"./execFileNoThrow-D244NytW.js";import{l as u,u as d}from"./ripgrep-BXmXjAzA.js";import{join as f}from"node:path";import{execSync as p}from"node:child_process";import{existsSync as m,readFileSync as h}from"node:fs";import{homedir as g}from"node:os";e(),i(),d(),l(),n(),o();var _=`@readmagic/workmate`;function v(){try{let e=f(u,`..`,`package.json`);if(m(e)){let t=JSON.parse(h(e,`utf-8`));if(t.version)return t.version}}catch{}return`0.0.3`}function y(e){try{return p(`which ${e} 2>/dev/null`,{stdio:`pipe`}),!0}catch{return!1}}function b(){return!!(process.execPath.includes(`bun`)||m(f(f(g(),`.bun`,`install`,`global`),`node_modules`,_)))}async function x(){let e=await c(`npm`,[`view`,`${_}@latest`,`version`,`--prefer-online`],{abortSignal:AbortSignal.timeout(1e4),cwd:g()});return e.code===0?e.stdout.trim():(a(`npm view failed: ${e.stderr}`),null)}function S(e,t){let n=e=>e.replace(/^\D/,``).split(`.`).map(Number),r=n(e),i=n(t);for(let e=0;e<3;e++){if((r[e]??0)>(i[e]??0))return!0;if((r[e]??0)<(i[e]??0))return!1}return!0}async function C(){let e=v();s(`Current version: ${e}\n`);let n=y(`bun`),i=b()&&n?`bun`:`npm`;s(`Package manager: ${i}\n`),s(`Checking for updates...
2
+ `);let a=await x();if(!a){process.stderr.write(t.red(`Failed to check for updates`)+`
3
+ `),process.stderr.write(`Unable to fetch latest version from npm registry.
4
+ `),await r(1);return}if(a===e||S(e,a)){s(t.green(`ccb is up to date (${e})`)+`
5
+ `),await r(0);return}s(`New version available: ${a} (current: ${e})\n`),s(`Installing update via ${i}...\n`);try{p(i===`bun`?`bun install -g ${_}@latest`:`npm install -g ${_}@latest`,{stdio:`inherit`,cwd:g(),timeout:12e4}),s(t.green(`Successfully updated from ${e} to ${a}`)+`
6
+ `)}catch(e){process.stderr.write(t.red(`Update failed`)+`
7
+ `),process.stderr.write(`${e}\n`),process.stderr.write(`
8
+ `),process.stderr.write(`Try manually updating with:
9
+ `),i===`bun`?process.stderr.write(t.bold(` bun install -g ${_}@latest`)+`
10
+ `):process.stderr.write(t.bold(` npm install -g ${_}@latest`)+`
11
+ `),await r(1)}await r(0)}export{C as updateCCB};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{$b as r,Qb as i}from"./loadAgentsDir-nzr38hai.js";import{o as a,s as o}from"./log-B3eB4EFv.js";import{Kt as s,Qr as c,Vt as l,Zr as u,kt as d}from"./model-DfFA3qMO.js";import{n as f,t as p}from"./browser-Bd7GeBH1.js";async function m(e,t){try{if(s()){let t=d(),n=!1;if(t?.subscriptionType&&t?.rateLimitTier)n=t.subscriptionType===`max`&&t.rateLimitTier===`default_claude_max_20x`;else if(t?.accessToken){let e=await u(t.accessToken);n=e?.organization?.organization_type===`claude_max`&&e?.organization?.rate_limit_tier===`default_claude_max_20x`}if(n)return setTimeout(e,0,`You are already on the highest Max subscription plan. For additional usage, run /login to switch to an API usage-billed account.`),null}return await f(`https://claude.ai/upgrade/max`),(0,h.jsx)(i,{onDone:()=>{t.onChangeAPIKey(),e(`Login successful`)}})}catch(t){o(t),setTimeout(e,0,`Failed to open browser. Please visit https://claude.ai/upgrade/max to upgrade.`)}return null}var h,g=e((()=>{t(),c(),l(),p(),a(),r(),h=n()}));export{g as n,m as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{Ix as r,Lx as i}from"./loadAgentsDir-DrDu5yYy.js";import{o as a,s as o}from"./log-BMCygSzM.js";import{Kt as s,Qr as c,Vt as l,Zr as u,kt as d}from"./model-fi472PRc.js";import{n as f,t as p}from"./browser-BmZuQom6.js";async function m(e,t){try{if(s()){let t=d(),n=!1;if(t?.subscriptionType&&t?.rateLimitTier)n=t.subscriptionType===`max`&&t.rateLimitTier===`default_claude_max_20x`;else if(t?.accessToken){let e=await u(t.accessToken);n=e?.organization?.organization_type===`claude_max`&&e?.organization?.rate_limit_tier===`default_claude_max_20x`}if(n)return setTimeout(e,0,`You are already on the highest Max subscription plan. For additional usage, run /login to switch to an API usage-billed account.`),null}return await f(`https://claude.ai/upgrade/max`),(0,h.jsx)(r,{onDone:()=>{t.onChangeAPIKey(),e(`Login successful`)}})}catch(t){o(t),setTimeout(e,0,`Failed to open browser. Please visit https://claude.ai/upgrade/max to upgrade.`)}return null}var h,g=e((()=>{t(),c(),l(),p(),a(),i(),h=n()}));export{g as n,m as t};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./upgrade-7OrBbrzS.js";e();export{t as call};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{E as r,M as i,n as a,r as o,t as s}from"./lazySchema-DcIJE_0i.js";import{S as c,a as l,l as u,w as d}from"./debug-BrXObCdR.js";import{l as f,u as p}from"./oauth-BqJqV-2M.js";import{a as m,r as h,t as g}from"./bridgeConfig-DbqUHe0H.js";import{basename as _,extname as v}from"path";import{randomUUID as y}from"crypto";import{readFile as b}from"fs/promises";function x(e){let t=v(e).toLowerCase();return D[t]??`application/octet-stream`}function S(e){u(`[brief:upload] ${e}`)}function C(){return h()??process.env.ANTHROPIC_BASE_URL??f().BASE_API_URL}async function w(e,n,r){{if(!r.replBridgeEnabled)return;if(n>T){S(`skip ${e}: ${n} bytes exceeds ${T} limit`);return}let i=g();if(!i){S(`skip: no oauth token`);return}let a;try{a=await b(e)}catch(t){S(`read failed for ${e}: ${t}`);return}let o=`${C()}/api/oauth/file_upload`,s=_(e),c=x(s),l=`----FormBoundary${y()}`,u=Buffer.concat([Buffer.from(`--${l}\r\nContent-Disposition: form-data; name="file"; filename="${s}"\r\nContent-Type: ${c}\r\n\r\n`),a,Buffer.from(`\r\n--${l}--\r\n`)]);try{let a=await t.post(o,u,{headers:{Authorization:`Bearer ${i}`,"Content-Type":`multipart/form-data; boundary=${l}`,"Content-Length":u.length.toString()},timeout:E,signal:r.signal,validateStatus:()=>!0});if(a.status!==201){S(`upload failed for ${e}: status=${a.status} body=${d(a.data).slice(0,200)}`);return}let s=O().safeParse(a.data);if(!s.success){S(`unexpected response shape for ${e}: ${s.error.message}`);return}return S(`uploaded ${e} → ${s.data.file_uuid} (${n} bytes)`),s.data.file_uuid}catch(t){S(`upload threw for ${e}: ${t}`);return}}}var T,E,D,O;e((()=>{n(),o(),m(),p(),l(),s(),c(),T=30*1024*1024,E=3e4,D={".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".webp":`image/webp`},O=a(()=>r({file_uuid:i()}))}))();export{w as uploadBriefAttachment};
@@ -1,11 +1,11 @@
1
- import{i as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DSxRz_kt.js";import{G as r,U as i,l as a,ot as o,p as s,st as c}from"./debug-IKW-jE7K.js";import{c as l,h as u,l as d,m as f,s as p}from"./proxy-Cn2YwITp.js";import{homedir as m}from"os";import{join as h}from"path";import{mkdir as g,readFile as _,unlink as v,writeFile as y}from"fs/promises";import{createServer as b}from"node:net";n(),o(),i(),a(),u(),d();var x,S=512*1024,C=3e4;function w(e){let t=e.length,n=[],r=t;for(;r>127;)n.push(r&127|128),r>>>=7;n.push(r);let i=new Uint8Array(1+n.length+t);return i[0]=10,i.set(n,1),i.set(e,1+n.length),i}function T(e){if(e.length===0)return new Uint8Array;if(e[0]!==10)return null;let t=0,n=0,r=1;for(;r<e.length;){let i=e[r];if(t|=(i&127)<<n,r++,!(i&128))break;if(n+=7,n>28)return null}return r+t>e.length?null:e.subarray(r,r+t)}function E(){return{connectBuf:Buffer.alloc(0),pending:[],wsOpen:!1,established:!1,closed:!1}}async function D(e){let t=`Basic `+Buffer.from(`${e.sessionId}:${e.token}`).toString(`base64`),n=`Bearer ${e.token}`,r=typeof Bun<`u`?O(e.wsUrl,t,n):await k(e.wsUrl,t,n);return s(`[upstreamproxy] relay listening on 127.0.0.1:${r.port}`),r}function O(e,t,n){let r=Bun.listen({hostname:`127.0.0.1`,port:0,socket:{open(e){e.data={...E(),writeBuf:[]}},data(r,i){let a=r.data;A({write:e=>{let t=typeof e==`string`?Buffer.from(e,`utf8`):e;if(a.writeBuf.length>0){a.writeBuf.push(t);return}let n=r.write(t);n<t.length&&a.writeBuf.push(t.subarray(n))},end:()=>r.end()},a,i,e,t,n)},drain(e){let t=e.data;for(;t.writeBuf.length>0;){let n=t.writeBuf[0],r=e.write(n);if(r<n.length){t.writeBuf[0]=n.subarray(r);return}t.writeBuf.shift()}},close(e){P(e.data)},error(e,t){s(`[upstreamproxy] client socket error: ${t.message}`),P(e.data)}}});return{port:r.port,stop:()=>r.stop(!0)}}async function k(e,t,n){x=(await import(`./wrapper-K8ZapJVu.js`)).default;let r=new WeakMap,i=b(i=>{let a=E();r.set(i,a);let o={write:e=>{i.write(typeof e==`string`?e:Buffer.from(e))},end:()=>i.end()};i.on(`data`,r=>A(o,a,r,e,t,n)),i.on(`close`,()=>P(r.get(i))),i.on(`error`,e=>{s(`[upstreamproxy] client socket error: ${e.message}`),P(r.get(i))})});return new Promise((e,t)=>{i.once(`error`,t),i.listen(0,`127.0.0.1`,()=>{let n=i.address();if(n===null||typeof n==`string`){t(Error(`upstreamproxy: server has no TCP address`));return}e({port:n.port,stop:()=>i.close()})})})}function A(e,t,n,r,i,a){if(!t.ws){t.connectBuf=Buffer.concat([t.connectBuf,n]);let o=t.connectBuf.indexOf(`\r
1
+ import{i as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DSxRz_kt.js";import{V as r,a as i,l as a,nt as o,rt as s,z as c}from"./debug-BrXObCdR.js";import{c as l,h as u,l as d,m as f,s as p}from"./proxy-CRN7jYIi.js";import{homedir as m}from"os";import{join as h}from"path";import{mkdir as g,readFile as _,unlink as v,writeFile as y}from"fs/promises";import{createServer as b}from"node:net";n(),o(),c(),i(),u(),d();var x,S=512*1024,C=3e4;function w(e){let t=e.length,n=[],r=t;for(;r>127;)n.push(r&127|128),r>>>=7;n.push(r);let i=new Uint8Array(1+n.length+t);return i[0]=10,i.set(n,1),i.set(e,1+n.length),i}function T(e){if(e.length===0)return new Uint8Array;if(e[0]!==10)return null;let t=0,n=0,r=1;for(;r<e.length;){let i=e[r];if(t|=(i&127)<<n,r++,!(i&128))break;if(n+=7,n>28)return null}return r+t>e.length?null:e.subarray(r,r+t)}function E(){return{connectBuf:Buffer.alloc(0),pending:[],wsOpen:!1,established:!1,closed:!1}}async function D(e){let t=`Basic `+Buffer.from(`${e.sessionId}:${e.token}`).toString(`base64`),n=`Bearer ${e.token}`,r=typeof Bun<`u`?O(e.wsUrl,t,n):await k(e.wsUrl,t,n);return a(`[upstreamproxy] relay listening on 127.0.0.1:${r.port}`),r}function O(e,t,n){let r=Bun.listen({hostname:`127.0.0.1`,port:0,socket:{open(e){e.data={...E(),writeBuf:[]}},data(r,i){let a=r.data;A({write:e=>{let t=typeof e==`string`?Buffer.from(e,`utf8`):e;if(a.writeBuf.length>0){a.writeBuf.push(t);return}let n=r.write(t);n<t.length&&a.writeBuf.push(t.subarray(n))},end:()=>r.end()},a,i,e,t,n)},drain(e){let t=e.data;for(;t.writeBuf.length>0;){let n=t.writeBuf[0],r=e.write(n);if(r<n.length){t.writeBuf[0]=n.subarray(r);return}t.writeBuf.shift()}},close(e){P(e.data)},error(e,t){a(`[upstreamproxy] client socket error: ${t.message}`),P(e.data)}}});return{port:r.port,stop:()=>r.stop(!0)}}async function k(e,t,n){x=(await import(`./wrapper-K8ZapJVu.js`)).default;let r=new WeakMap,i=b(i=>{let o=E();r.set(i,o);let s={write:e=>{i.write(typeof e==`string`?e:Buffer.from(e))},end:()=>i.end()};i.on(`data`,r=>A(s,o,r,e,t,n)),i.on(`close`,()=>P(r.get(i))),i.on(`error`,e=>{a(`[upstreamproxy] client socket error: ${e.message}`),P(r.get(i))})});return new Promise((e,t)=>{i.once(`error`,t),i.listen(0,`127.0.0.1`,()=>{let n=i.address();if(n===null||typeof n==`string`){t(Error(`upstreamproxy: server has no TCP address`));return}e({port:n.port,stop:()=>i.close()})})})}function A(e,t,n,r,i,a){if(!t.ws){t.connectBuf=Buffer.concat([t.connectBuf,n]);let o=t.connectBuf.indexOf(`\r
2
2
  \r
3
3
  `);if(o===-1){t.connectBuf.length>8192&&(e.write(`HTTP/1.1 400 Bad Request\r
4
4
  \r
5
5
  `),e.end());return}let s=t.connectBuf.subarray(0,o).toString(`utf8`).split(`\r
6
6
  `)[0]??``;if(!s.match(/^CONNECT\s+(\S+)\s+HTTP\/1\.[01]$/i)){e.write(`HTTP/1.1 405 Method Not Allowed\r
7
7
  \r
8
- `),e.end();return}let c=t.connectBuf.subarray(o+4);c.length>0&&t.pending.push(Buffer.from(c)),t.connectBuf=Buffer.alloc(0),j(e,t,s,r,i,a);return}if(!t.wsOpen){t.pending.push(Buffer.from(n));return}N(t.ws,n)}function j(e,t,n,r,i,a){let o={"Content-Type":`application/proto`,Authorization:a},c;c=x?new x(r,{headers:o,agent:p(r),...f()}):new globalThis.WebSocket(r,{headers:o,proxy:l(r),tls:f()||void 0}),c.binaryType=`arraybuffer`,t.ws=c,c.onopen=()=>{let e=`${n}\r\nProxy-Authorization: ${i}\r\n\r\n`;c.send(w(new Uint8Array(Buffer.from(e,`utf8`)))),t.wsOpen=!0;for(let e of t.pending)N(c,e);t.pending=[],t.pinger=setInterval(M,C,c)},c.onmessage=n=>{let r=T(n.data instanceof ArrayBuffer?new Uint8Array(n.data):new Uint8Array(Buffer.from(n.data)));r&&r.length>0&&(t.established=!0,e.write(r))},c.onerror=n=>{s(`[upstreamproxy] ws error: ${`message`in n?String(n.message):`websocket error`}`),!t.closed&&(t.closed=!0,t.established||e.write(`HTTP/1.1 502 Bad Gateway\r
8
+ `),e.end();return}let c=t.connectBuf.subarray(o+4);c.length>0&&t.pending.push(Buffer.from(c)),t.connectBuf=Buffer.alloc(0),j(e,t,s,r,i,a);return}if(!t.wsOpen){t.pending.push(Buffer.from(n));return}N(t.ws,n)}function j(e,t,n,r,i,o){let s={"Content-Type":`application/proto`,Authorization:o},c;c=x?new x(r,{headers:s,agent:p(r),...f()}):new globalThis.WebSocket(r,{headers:s,proxy:l(r),tls:f()||void 0}),c.binaryType=`arraybuffer`,t.ws=c,c.onopen=()=>{let e=`${n}\r\nProxy-Authorization: ${i}\r\n\r\n`;c.send(w(new Uint8Array(Buffer.from(e,`utf8`)))),t.wsOpen=!0;for(let e of t.pending)N(c,e);t.pending=[],t.pinger=setInterval(M,C,c)},c.onmessage=n=>{let r=T(n.data instanceof ArrayBuffer?new Uint8Array(n.data):new Uint8Array(Buffer.from(n.data)));r&&r.length>0&&(t.established=!0,e.write(r))},c.onerror=n=>{a(`[upstreamproxy] ws error: ${`message`in n?String(n.message):`websocket error`}`),!t.closed&&(t.closed=!0,t.established||e.write(`HTTP/1.1 502 Bad Gateway\r
9
9
  \r
10
- `),e.end(),P(t))},c.onclose=()=>{t.closed||(t.closed=!0,e.end(),P(t))}}function M(e){e.readyState===WebSocket.OPEN&&e.send(w(new Uint8Array))}function N(e,t){if(e.readyState===WebSocket.OPEN)for(let n=0;n<t.length;n+=S){let r=new Uint8Array(t.subarray(n,n+S));e.send(w(r))}}function P(e){if(e){if(e.pinger&&clearInterval(e.pinger),e.ws&&e.ws.readyState<=WebSocket.OPEN)try{e.ws.close()}catch{}e.ws=void 0}}a();var F=`/etc/ssl/certs/ca-certificates.crt`,I=[`localhost`,`127.0.0.1`,`::1`,`169.254.0.0/16`,`10.0.0.0/8`,`172.16.0.0/12`,`192.168.0.0/16`,`anthropic.com`,`.anthropic.com`,`*.anthropic.com`,`github.com`,`api.github.com`,`*.github.com`,`*.githubusercontent.com`,`registry.npmjs.org`,`pypi.org`,`files.pythonhosted.org`,`index.crates.io`,`proxy.golang.org`].join(`,`),L={enabled:!1};async function R(e){if(!t(process.env.CLAUDE_CODE_REMOTE)||!t(process.env.CCR_UPSTREAM_PROXY_ENABLED))return L;let n=process.env.CLAUDE_CODE_REMOTE_SESSION_ID;if(!n)return s(`[upstreamproxy] CLAUDE_CODE_REMOTE_SESSION_ID unset; proxy disabled`,{level:`warn`}),L;let r=e?.tokenPath??`/run/ccr/session_token`,i=await B(r);if(!i)return s(`[upstreamproxy] no session token file; proxy disabled`),L;V();let a=e?.ccrBaseUrl??process.env.ANTHROPIC_BASE_URL??`https://api.anthropic.com`,o=e?.caBundlePath??h(m(),`.ccr`,`ca-bundle.crt`);if(!await H(a,e?.systemCaPath??F,o))return L;try{let e=await D({wsUrl:a.replace(/^http/,`ws`)+`/v1/code/upstreamproxy/ws`,sessionId:n,token:i});c(async()=>e.stop()),L={enabled:!0,port:e.port,caBundlePath:o},s(`[upstreamproxy] enabled on 127.0.0.1:${e.port}`),await v(r).catch(()=>{s(`[upstreamproxy] token file unlink failed`,{level:`warn`})})}catch(e){s(`[upstreamproxy] relay start failed: ${e instanceof Error?e.message:String(e)}; proxy disabled`,{level:`warn`})}return L}function z(){if(!L.enabled||!L.port||!L.caBundlePath){if(process.env.HTTPS_PROXY&&process.env.SSL_CERT_FILE){let e={};for(let t of[`HTTPS_PROXY`,`https_proxy`,`NO_PROXY`,`no_proxy`,`SSL_CERT_FILE`,`NODE_EXTRA_CA_CERTS`,`REQUESTS_CA_BUNDLE`,`CURL_CA_BUNDLE`])process.env[t]&&(e[t]=process.env[t]);return e}return{}}let e=`http://127.0.0.1:${L.port}`;return{HTTPS_PROXY:e,https_proxy:e,NO_PROXY:I,no_proxy:I,SSL_CERT_FILE:L.caBundlePath,NODE_EXTRA_CA_CERTS:L.caBundlePath,REQUESTS_CA_BUNDLE:L.caBundlePath,CURL_CA_BUNDLE:L.caBundlePath}}async function B(e){try{return(await _(e,`utf8`)).trim()||null}catch(e){return r(e)||s(`[upstreamproxy] token read failed: ${e instanceof Error?e.message:String(e)}`,{level:`warn`}),null}}function V(){if(!(process.platform!==`linux`||typeof Bun>`u`))try{e(`bun:ffi`).dlopen(`libc.so.6`,{prctl:{args:[`int`,`u64`,`u64`,`u64`,`u64`],returns:`int`}}).symbols.prctl(4,0n,0n,0n,0n)!==0&&s(`[upstreamproxy] prctl(PR_SET_DUMPABLE,0) returned nonzero`,{level:`warn`})}catch(e){s(`[upstreamproxy] prctl unavailable: ${e instanceof Error?e.message:String(e)}`,{level:`warn`})}}async function H(e,t,n){try{let r=await fetch(`${e}/v1/code/upstreamproxy/ca-cert`,{signal:AbortSignal.timeout(5e3)});if(!r.ok)return s(`[upstreamproxy] ca-cert fetch ${r.status}; proxy disabled`,{level:`warn`}),!1;let i=await r.text(),a=await _(t,`utf8`).catch(()=>``);return await g(h(n,`..`),{recursive:!0}),await y(n,a+`
11
- `+i,`utf8`),!0}catch(e){return s(`[upstreamproxy] ca-cert download failed: ${e instanceof Error?e.message:String(e)}; proxy disabled`,{level:`warn`}),!1}}export{z as getUpstreamProxyEnv,R as initUpstreamProxy};
10
+ `),e.end(),P(t))},c.onclose=()=>{t.closed||(t.closed=!0,e.end(),P(t))}}function M(e){e.readyState===WebSocket.OPEN&&e.send(w(new Uint8Array))}function N(e,t){if(e.readyState===WebSocket.OPEN)for(let n=0;n<t.length;n+=S){let r=new Uint8Array(t.subarray(n,n+S));e.send(w(r))}}function P(e){if(e){if(e.pinger&&clearInterval(e.pinger),e.ws&&e.ws.readyState<=WebSocket.OPEN)try{e.ws.close()}catch{}e.ws=void 0}}i();var F=`/etc/ssl/certs/ca-certificates.crt`,I=[`localhost`,`127.0.0.1`,`::1`,`169.254.0.0/16`,`10.0.0.0/8`,`172.16.0.0/12`,`192.168.0.0/16`,`anthropic.com`,`.anthropic.com`,`*.anthropic.com`,`github.com`,`api.github.com`,`*.github.com`,`*.githubusercontent.com`,`registry.npmjs.org`,`pypi.org`,`files.pythonhosted.org`,`index.crates.io`,`proxy.golang.org`].join(`,`),L={enabled:!1};async function R(e){if(!t(process.env.CLAUDE_CODE_REMOTE)||!t(process.env.CCR_UPSTREAM_PROXY_ENABLED))return L;let n=process.env.CLAUDE_CODE_REMOTE_SESSION_ID;if(!n)return a(`[upstreamproxy] CLAUDE_CODE_REMOTE_SESSION_ID unset; proxy disabled`,{level:`warn`}),L;let r=e?.tokenPath??`/run/ccr/session_token`,i=await B(r);if(!i)return a(`[upstreamproxy] no session token file; proxy disabled`),L;V();let o=e?.ccrBaseUrl??process.env.ANTHROPIC_BASE_URL??`https://api.anthropic.com`,c=e?.caBundlePath??h(m(),`.ccr`,`ca-bundle.crt`);if(!await H(o,e?.systemCaPath??F,c))return L;try{let e=await D({wsUrl:o.replace(/^http/,`ws`)+`/v1/code/upstreamproxy/ws`,sessionId:n,token:i});s(async()=>e.stop()),L={enabled:!0,port:e.port,caBundlePath:c},a(`[upstreamproxy] enabled on 127.0.0.1:${e.port}`),await v(r).catch(()=>{a(`[upstreamproxy] token file unlink failed`,{level:`warn`})})}catch(e){a(`[upstreamproxy] relay start failed: ${e instanceof Error?e.message:String(e)}; proxy disabled`,{level:`warn`})}return L}function z(){if(!L.enabled||!L.port||!L.caBundlePath){if(process.env.HTTPS_PROXY&&process.env.SSL_CERT_FILE){let e={};for(let t of[`HTTPS_PROXY`,`https_proxy`,`NO_PROXY`,`no_proxy`,`SSL_CERT_FILE`,`NODE_EXTRA_CA_CERTS`,`REQUESTS_CA_BUNDLE`,`CURL_CA_BUNDLE`])process.env[t]&&(e[t]=process.env[t]);return e}return{}}let e=`http://127.0.0.1:${L.port}`;return{HTTPS_PROXY:e,https_proxy:e,NO_PROXY:I,no_proxy:I,SSL_CERT_FILE:L.caBundlePath,NODE_EXTRA_CA_CERTS:L.caBundlePath,REQUESTS_CA_BUNDLE:L.caBundlePath,CURL_CA_BUNDLE:L.caBundlePath}}async function B(e){try{return(await _(e,`utf8`)).trim()||null}catch(e){return r(e)||a(`[upstreamproxy] token read failed: ${e instanceof Error?e.message:String(e)}`,{level:`warn`}),null}}function V(){if(!(process.platform!==`linux`||typeof Bun>`u`))try{e(`bun:ffi`).dlopen(`libc.so.6`,{prctl:{args:[`int`,`u64`,`u64`,`u64`,`u64`],returns:`int`}}).symbols.prctl(4,0n,0n,0n,0n)!==0&&a(`[upstreamproxy] prctl(PR_SET_DUMPABLE,0) returned nonzero`,{level:`warn`})}catch(e){a(`[upstreamproxy] prctl unavailable: ${e instanceof Error?e.message:String(e)}`,{level:`warn`})}}async function H(e,t,n){try{let r=await fetch(`${e}/v1/code/upstreamproxy/ca-cert`,{signal:AbortSignal.timeout(5e3)});if(!r.ok)return a(`[upstreamproxy] ca-cert fetch ${r.status}; proxy disabled`,{level:`warn`}),!1;let i=await r.text(),o=await _(t,`utf8`).catch(()=>``);return await g(h(n,`..`),{recursive:!0}),await y(n,o+`
11
+ `+i,`utf8`),!0}catch(e){return a(`[upstreamproxy] ca-cert download failed: ${e instanceof Error?e.message:String(e)}; proxy disabled`,{level:`warn`}),!1}}export{z as getUpstreamProxyEnv,R as initUpstreamProxy};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Settings-BvhG1XoW.js";var i,a;e((()=>{n(),i=t(),a=async(e,t)=>(0,i.jsx)(r,{onClose:e,context:t,defaultTab:`Usage`})}))();export{a as call};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{l as r,u as i}from"./oauth-BqJqV-2M.js";import{Bt as a,Kt as o,Ur as s,Vt as c,Wr as l,er as u,ir as d,kt as f,lr as p,ur as m}from"./model-DfFA3qMO.js";async function h(){if(!o()||!a())return{};let e=f();if(e&&l(e.expiresAt))return null;let n=u();if(n.error)throw Error(`Auth error: ${n.error}`);let i={"Content-Type":`application/json`,"User-Agent":p(),...n.headers},s=`${r().BASE_API_URL}/api/oauth/usage`;return(await t.get(s,{headers:i,timeout:5e3})).data}var g=e((()=>{n(),i(),c(),d(),m(),s()}));export{g as n,h as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{l as r,u as i}from"./oauth-BqJqV-2M.js";import{Bt as a,Kt as o,Ur as s,Vt as c,Wr as l,er as u,ir as d,kt as f,lr as p,ur as m}from"./model-fi472PRc.js";async function h(){if(!o()||!a())return{};let e=f();if(e&&l(e.expiresAt))return null;let n=u();if(n.error)throw Error(`Auth error: ${n.error}`);let i={"Content-Type":`application/json`,"User-Agent":p(),...n.headers},s=`${r().BASE_API_URL}/api/oauth/usage`;return(await t.get(s,{headers:i,timeout:5e3})).data}var g=e((()=>{n(),i(),c(),d(),m(),s()}));export{g as n,h as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as n,et as r,fi as i,t as a,vt as o}from"./src-CDCSSo0U2.js";import{l as s,u as c}from"./referral-DP_GshTS.js";function l(e,t,n,i=!0){let{exit:a}=o(),[s,c]=(0,u.useState)({pending:!1,keyName:null}),l=(0,u.useMemo)(()=>n??a,[n,a]),d=r(e=>c({pending:e,keyName:`Ctrl-C`}),l),f=r(e=>c({pending:e,keyName:`Ctrl-D`}),l),p=(0,u.useCallback)(()=>{t?.()||d()},[d,t]),m=(0,u.useCallback)(()=>{f()},[f]);return e((0,u.useMemo)(()=>({"app:interrupt":p,"app:exit":m}),[p,m]),{context:`Global`,isActive:i}),s}var u,d=e((()=>{u=t(i(),1),a(),s()}));function f(e,t,r){return l(n,t,e,r)}var p=e((()=>{c(),d()}));export{f as n,p as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as n,et as r,fi as i,t as a,vt as o}from"./src-CDCSSo0U2.js";import{l as s,u as c}from"./referral-DrebVwqx.js";function l(e,t,n,i=!0){let{exit:a}=o(),[s,c]=(0,u.useState)({pending:!1,keyName:null}),l=(0,u.useMemo)(()=>n??a,[n,a]),d=r(e=>c({pending:e,keyName:`Ctrl-C`}),l),f=r(e=>c({pending:e,keyName:`Ctrl-D`}),l),p=(0,u.useCallback)(()=>{t?.()||d()},[d,t]),m=(0,u.useCallback)(()=>{f()},[f]);return e((0,u.useMemo)(()=>({"app:interrupt":p,"app:exit":m}),[p,m]),{context:`Global`,isActive:i}),s}var u,d=e((()=>{u=t(i(),1),a(),s()}));function f(e,t,r){return l(n,t,e,r)}var p=e((()=>{c(),d()}));export{f as n,p as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{JS as t,qS as n}from"./loadAgentsDir-DrDu5yYy.js";import{C as r,_ as i,s as a}from"./model-fi472PRc.js";function o(){let e=t(e=>e.mainLoopModel);return r(t(e=>e.mainLoopModelForSession)??e??a())}var s=e((()=>{n(),i()}));export{o as n,s as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{Cc as n,GS as r,JS as i,Sc as a,Sm as o,Tc as s,WS as c,XS as l,_m as u,fs as d,nb as f,nv as p,ps as m,qS as h,rb as g,rv as _,wc as v,xm as y,ym as b}from"./loadAgentsDir-DrDu5yYy.js";import{W as x,a as S,l as C,z as w}from"./debug-BrXObCdR.js";import{_n as T,gn as E}from"./settings-DfWP5y6X.js";import{M as D,j as O}from"./git-Do0wJvux.js";import{o as k,s as A}from"./log-BMCygSzM.js";import{n as j,r as M}from"./analytics-BotDBGh0.js";import{n as N,r as P}from"./pluginFlagging-3FQGvIfq.js";import{t as F}from"./pluginBlocklist-B32eWmzn.js";var I=e(t(),1);c(),j(),u(),h(),T(),S(),O(),w(),k(),v(),n(),f(),y(),p(),P(),d();function L({enabled:e=!0}={}){let t=l(),n=i(e=>e.plugins.needsRefresh),{addNotification:c}=r(),u=(0,I.useCallback)(async()=>{try{let{enabled:e,disabled:n,errors:r}=await m();await F();let i=N();Object.keys(i).length>0&&c({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let l=[],u=[];try{l=await a()}catch(e){let t=e instanceof Error?e.message:String(e);r.push({type:`generic-error`,source:`plugin-commands`,error:`Failed to load plugin commands: ${t}`})}try{u=await s()}catch(e){let t=e instanceof Error?e.message:String(e);r.push({type:`generic-error`,source:`plugin-agents`,error:`Failed to load plugin agents: ${t}`})}try{await g()}catch(e){let t=e instanceof Error?e.message:String(e);r.push({type:`generic-error`,source:`plugin-hooks`,error:`Failed to load plugin hooks: ${t}`})}let d=(await Promise.all(e.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await _(e,r);return t&&(e.mcpServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0),f=(await Promise.all(e.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await o(e,r);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);b(),t(t=>{let i=t.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),a=new Set(r.map(e=>e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`)),o=[...i.filter(e=>{let t=e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`;return!a.has(t)}),...r];return{...t,plugins:{...t.plugins,enabled:e,disabled:n,commands:l,errors:o}}}),C(`Loaded plugins - Enabled: ${e.length}, Disabled: ${n.length}, Commands: ${l.length}, Agents: ${u.length}, Errors: ${r.length}`);let p=e.reduce((e,t)=>t.hooksConfig?e+Object.values(t.hooksConfig).reduce((e,t)=>e+(t?.reduce((e,t)=>e+t.hooks.length,0)??0),0):e,0);return{enabled_count:e.length,disabled_count:n.length,inline_count:E(e,e=>e.source.endsWith(`@inline`)),marketplace_count:E(e,e=>!e.source.endsWith(`@inline`)),error_count:r.length,skill_count:l.length,agent_count:u.length,hook_count:p,mcp_count:d,lsp_count:f,ant_enabled_names:process.env.USER_TYPE===`ant`&&e.length>0?e.map(e=>e.name).sort().join(`,`):void 0}}catch(e){let n=x(e);return A(n),C(`Error loading plugins: ${e}`),t(e=>{let t=e.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r={type:`generic-error`,source:`plugin-system`,error:n.message};return{...e,plugins:{...e.plugins,enabled:[],disabled:[],commands:[],errors:[...t,r]}}}),{enabled_count:0,disabled_count:0,inline_count:0,marketplace_count:0,error_count:1,skill_count:0,agent_count:0,hook_count:0,mcp_count:0,lsp_count:0,load_failed:!0,ant_enabled_names:void 0}}},[t,c]);(0,I.useEffect)(()=>{e&&u().then(e=>{let{ant_enabled_names:t,...n}=e,r={...n,has_custom_plugin_cache_dir:!!process.env.CLAUDE_CODE_PLUGIN_CACHE_DIR};M(`tengu_plugins_loaded`,{...r,...t!==void 0&&{enabled_names:t}}),D(`info`,`tengu_plugins_loaded`,r)})},[u,e]),(0,I.useEffect)(()=>{!e||!n||c({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,n,c])}export{L as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as n}from"./src-CDCSSo0U2.js";import{Ku as r,Xu as i}from"./loadAgentsDir-nzr38hai.js";import{n as a,t as o}from"./toolPool-CHVDZqh7.js";function s(e,t,n){return(0,c.useMemo)(()=>a(e,r(n,t),n.mode),[e,t,n,!1,!1])}var c,l=e((()=>{c=t(n(),1),i(),o()}));export{s as n,l as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as n}from"./src-CDCSSo0U2.js";import{Ku as r,Xu as i}from"./loadAgentsDir-DrDu5yYy.js";import{n as a,t as o}from"./toolPool-DvHECcbN.js";function s(e,t,n){return(0,c.useMemo)(()=>a(e,r(n,t),n.mode),[e,t,n,!1,!1])}var c,l=e((()=>{c=t(n(),1),i(),o()}));export{s as n,l as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Vn as n,fi as r,hn as i,ot as a,t as o}from"./src-CDCSSo0U2.js";import{Cx as s,Sx as c,TS as l,bx as u,fx as d,mx as f,px as p,vx as m,xx as h,yx as g}from"./loadAgentsDir-nzr38hai.js";function _(e){return!!(e.ctrl&&(e.key===`k`||e.key===`u`||e.key===`w`)||e.meta&&e.key===`backspace`)}function v(e){return(e.ctrl||e.meta)&&e.key===`y`}function y({isActive:e,onExit:t,onCancel:r,onExitUp:o,columns:l,passthroughCtrlKeys:f=[],initialQuery:y=``,backspaceExitsOnEmpty:S=!0}){let{columns:C}=a(),w=l??C,[T,E]=(0,b.useState)(y),[D,O]=(0,b.useState)(y.length),k=(0,b.useCallback)(e=>{E(e),O(e.length)},[]),A=n=>{if(!e)return;let i=d.fromText(T,w,D);if(!(n.ctrl&&f.includes(n.key.toLowerCase()))){if(_(n)||u(),v(n)||h(),n.key===`return`||n.key===`down`){n.preventDefault(),t();return}if(n.key===`up`){n.preventDefault(),o&&o();return}if(n.key===`escape`){n.preventDefault(),r?r():T.length>0?(E(``),O(0)):t();return}if(n.key===`backspace`){if(n.preventDefault(),n.meta){let{cursor:e,killed:t}=i.deleteWordBefore();m(t,`prepend`),E(e.text),O(e.offset);return}if(T.length===0){S&&(r??t)();return}let e=i.backspace();E(e.text),O(e.offset);return}if(n.key===`delete`){n.preventDefault();let e=i.del();E(e.text),O(e.offset);return}if(n.key===`left`&&(n.ctrl||n.meta||n.fn)){n.preventDefault();let e=i.prevWord();O(e.offset);return}if(n.key===`right`&&(n.ctrl||n.meta||n.fn)){n.preventDefault();let e=i.nextWord();O(e.offset);return}if(n.key===`left`){n.preventDefault();let e=i.left();O(e.offset);return}if(n.key===`right`){n.preventDefault();let e=i.right();O(e.offset);return}if(n.key===`home`){n.preventDefault(),O(0);return}if(n.key===`end`){n.preventDefault(),O(T.length);return}if(n.ctrl){switch(n.preventDefault(),n.key.toLowerCase()){case`a`:O(0);return;case`e`:O(T.length);return;case`b`:O(i.left().offset);return;case`f`:O(i.right().offset);return;case`d`:{if(T.length===0){(r??t)();return}let e=i.del();E(e.text),O(e.offset);return}case`h`:{if(T.length===0){S&&(r??t)();return}let e=i.backspace();E(e.text),O(e.offset);return}case`k`:{let{cursor:e,killed:t}=i.deleteToLineEnd();m(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=i.deleteToLineStart();m(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=i.deleteWordBefore();m(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=p();if(e.length>0){let t=i.offset,n=i.insert(e);g(t,e.length),E(n.text),O(n.offset)}return}case`g`:case`c`:if(r){r();return}}return}if(n.meta){switch(n.preventDefault(),n.key.toLowerCase()){case`b`:O(i.prevWord().offset);return;case`f`:O(i.nextWord().offset);return;case`d`:{let e=i.deleteWordAfter();E(e.text),O(e.offset);return}case`y`:{let e=s();if(e){let{text:t,start:n,length:r}=e,i=T.slice(0,n),a=T.slice(n+r),o=i+t+a,s=n+t.length;c(t.length),E(o),O(s)}return}}return}if(n.key!==`tab`&&n.key.length>=1&&!x.has(n.key)){n.preventDefault();let e=i.insert(n.key);E(e.text),O(e.offset)}}};return i((e,t,r)=>{A(new n(r.keypress))},{isActive:e}),{query:T,setQuery:k,cursorOffset:D,handleKeyDown:A}}var b,x,S=e((()=>{b=t(r(),1),o(),f(),l(),x=new Set([`pageup`,`pagedown`,`insert`,`wheelup`,`wheeldown`,`mouse`,`f1`,`f2`,`f3`,`f4`,`f5`,`f6`,`f7`,`f8`,`f9`,`f10`,`f11`,`f12`])}));export{y as n,S as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Vn as n,fi as r,hn as i,ot as a,t as o}from"./src-CDCSSo0U2.js";import{Qx as s,Xx as c,Zx as l,aS as u,iS as d,lC as f,nS as p,oS as m,rS as h,sS as g}from"./loadAgentsDir-DrDu5yYy.js";function _(e){return!!(e.ctrl&&(e.key===`k`||e.key===`u`||e.key===`w`)||e.meta&&e.key===`backspace`)}function v(e){return(e.ctrl||e.meta)&&e.key===`y`}function y({isActive:e,onExit:t,onCancel:r,onExitUp:o,columns:s,passthroughCtrlKeys:f=[],initialQuery:y=``,backspaceExitsOnEmpty:S=!0}){let{columns:C}=a(),w=s??C,[T,E]=(0,b.useState)(y),[D,O]=(0,b.useState)(y.length),k=(0,b.useCallback)(e=>{E(e),O(e.length)},[]),A=n=>{if(!e)return;let i=c.fromText(T,w,D);if(!(n.ctrl&&f.includes(n.key.toLowerCase()))){if(_(n)||d(),v(n)||u(),n.key===`return`||n.key===`down`){n.preventDefault(),t();return}if(n.key===`up`){n.preventDefault(),o&&o();return}if(n.key===`escape`){n.preventDefault(),r?r():T.length>0?(E(``),O(0)):t();return}if(n.key===`backspace`){if(n.preventDefault(),n.meta){let{cursor:e,killed:t}=i.deleteWordBefore();p(t,`prepend`),E(e.text),O(e.offset);return}if(T.length===0){S&&(r??t)();return}let e=i.backspace();E(e.text),O(e.offset);return}if(n.key===`delete`){n.preventDefault();let e=i.del();E(e.text),O(e.offset);return}if(n.key===`left`&&(n.ctrl||n.meta||n.fn)){n.preventDefault();let e=i.prevWord();O(e.offset);return}if(n.key===`right`&&(n.ctrl||n.meta||n.fn)){n.preventDefault();let e=i.nextWord();O(e.offset);return}if(n.key===`left`){n.preventDefault();let e=i.left();O(e.offset);return}if(n.key===`right`){n.preventDefault();let e=i.right();O(e.offset);return}if(n.key===`home`){n.preventDefault(),O(0);return}if(n.key===`end`){n.preventDefault(),O(T.length);return}if(n.ctrl){switch(n.preventDefault(),n.key.toLowerCase()){case`a`:O(0);return;case`e`:O(T.length);return;case`b`:O(i.left().offset);return;case`f`:O(i.right().offset);return;case`d`:{if(T.length===0){(r??t)();return}let e=i.del();E(e.text),O(e.offset);return}case`h`:{if(T.length===0){S&&(r??t)();return}let e=i.backspace();E(e.text),O(e.offset);return}case`k`:{let{cursor:e,killed:t}=i.deleteToLineEnd();p(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=i.deleteToLineStart();p(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=i.deleteWordBefore();p(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=l();if(e.length>0){let t=i.offset,n=i.insert(e);h(t,e.length),E(n.text),O(n.offset)}return}case`g`:case`c`:if(r){r();return}}return}if(n.meta){switch(n.preventDefault(),n.key.toLowerCase()){case`b`:O(i.prevWord().offset);return;case`f`:O(i.nextWord().offset);return;case`d`:{let e=i.deleteWordAfter();E(e.text),O(e.offset);return}case`y`:{let e=g();if(e){let{text:t,start:n,length:r}=e,i=T.slice(0,n),a=T.slice(n+r),o=i+t+a,s=n+t.length;m(t.length),E(o),O(s)}return}}return}if(n.key!==`tab`&&n.key.length>=1&&!x.has(n.key)){n.preventDefault();let e=i.insert(n.key);E(e.text),O(e.offset)}}};return i((e,t,r)=>{A(new n(r.keypress))},{isActive:e}),{query:T,setQuery:k,cursorOffset:D,handleKeyDown:A}}var b,x,S=e((()=>{b=t(r(),1),o(),s(),f(),x=new Set([`pageup`,`pagedown`,`insert`,`wheelup`,`wheeldown`,`mouse`,`f1`,`f2`,`f3`,`f4`,`f5`,`f6`,`f7`,`f8`,`f9`,`f10`,`f11`,`f12`])}));export{y as n,S as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as n}from"./src-CDCSSo0U2.js";import{B as r,en as i}from"./state-4KQ3kaqz.js";import{SS as a,oS as o,sS as s,xS as c}from"./loadAgentsDir-nzr38hai.js";import{n as l,t as u}from"./allErrors-HMPqE0jK.js";function d(){let{addNotification:e,removeNotification:t}=s(),[n,i]=(0,f.useState)(()=>{let{errors:e}=u();return e});return a((0,f.useCallback)(()=>{let{errors:e}=u();i(e)},[])),(0,f.useEffect)(()=>{if(!r())if(n.length>0){let t=`Found ${n.length} settings ${n.length===1?`issue`:`issues`} · /doctor for details`;e({key:p,text:t,color:`warning`,priority:`high`,timeoutMs:6e4})}else t(p)},[n,e,t]),n}var f,p,m=e((()=>{f=t(n(),1),o(),i(),l(),c(),p=`settings-errors`}));export{d as n,m as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as n}from"./src-CDCSSo0U2.js";import{B as r,en as i}from"./state-ix0xIunV.js";import{GS as a,WS as o,aC as s,oC as c}from"./loadAgentsDir-DrDu5yYy.js";import{n as l,t as u}from"./allErrors-DJYCAtab.js";function d(){let{addNotification:e,removeNotification:t}=a(),[n,i]=(0,f.useState)(()=>{let{errors:e}=u();return e});return c((0,f.useCallback)(()=>{let{errors:e}=u();i(e)},[])),(0,f.useEffect)(()=>{if(!r())if(n.length>0){let t=`Found ${n.length} settings ${n.length===1?`issue`:`issues`} · /doctor for details`;e({key:p,text:t,color:`warning`,priority:`high`,timeoutMs:6e4})}else t(p)},[n,e,t]),n}var f,p,m=e((()=>{f=t(n(),1),o(),i(),l(),s(),p=`settings-errors`}));export{d as n,m as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{Jy as o,Yy as s,cS as c,lS as l}from"./loadAgentsDir-nzr38hai.js";import{n as u,r as d}from"./analytics-BotDBGh0.js";import{Ut as f,Vt as p}from"./model-DfFA3qMO.js";import{t as m}from"./WelcomeV2-BTfttGcv.js";import{t as h}from"./useManagePlugins-CTtPaQRP.js";import{n as g,t as _}from"./MCPConnectionManager-BX0LMz9J.js";import{n as v}from"./onChangeAppState-DwGVi-BC.js";import{cwd as y}from"process";var b=e(r(),1);i(),s(),u(),g(),l(),p();var x=a();async function S(e){d(`tengu_setup_token_command`,{});let r=!f(),{ConsoleOAuthFlow:i}=await import(`./ConsoleOAuthFlow-CU5fCPKq.js`);await new Promise(a=>{e.render((0,x.jsx)(c,{onChangeAppState:v,children:(0,x.jsx)(o,{children:(0,x.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,x.jsx)(m,{}),r&&(0,x.jsxs)(t,{flexDirection:`column`,children:[(0,x.jsx)(n,{color:`warning`,children:`Warning: You already have authentication configured via environment variable or API key helper.`}),(0,x.jsx)(n,{color:`warning`,children:`The setup-token command will create a new OAuth token which you can use instead.`})]}),(0,x.jsx)(i,{onDone:()=>{a()}})]})})}))}),e.unmount(),process.exit(0)}var C=b.lazy(()=>import(`./Doctor-B0CRtxi2.js`).then(e=>({default:e.Doctor})));function w({onDone:e}){return h(),(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(C,{onDone:e})})}async function T(e){d(`tengu_doctor_command`,{}),await new Promise(t=>{e.render((0,x.jsx)(c,{children:(0,x.jsx)(o,{children:(0,x.jsx)(_,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1,children:(0,x.jsx)(w,{onDone:()=>{t()}})})})}))}),e.unmount(),process.exit(0)}async function E(e,t){let{setup:n}=await import(`./setup-BKEnSLR9.js`);await n(y(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-BkfXeXpv.js`);await new Promise(n=>{let i=[];e&&i.push(e),t.force&&i.push(`--force`),r.call(e=>{n(),process.exit(+!!e.includes(`failed`))},{},i)})}export{T as doctorHandler,E as installHandler,S as setupTokenHandler};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{KS as o,Mb as s,Nb as c,qS as l}from"./loadAgentsDir-DrDu5yYy.js";import{n as u,r as d}from"./analytics-BotDBGh0.js";import{Ut as f,Vt as p}from"./model-fi472PRc.js";import{t as m}from"./WelcomeV2-C93xQYAF.js";import{t as h}from"./useManagePlugins-BkK1zydO.js";import{n as g,t as _}from"./MCPConnectionManager-zdocEDgk.js";import{n as v}from"./onChangeAppState-CGVeNkt7.js";import{cwd as y}from"process";var b=e(r(),1);i(),c(),u(),g(),l(),p();var x=a();async function S(e){d(`tengu_setup_token_command`,{});let r=!f(),{ConsoleOAuthFlow:i}=await import(`./ConsoleOAuthFlow-BDr1Vx5K.js`);await new Promise(a=>{e.render((0,x.jsx)(o,{onChangeAppState:v,children:(0,x.jsx)(s,{children:(0,x.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,x.jsx)(m,{}),r&&(0,x.jsxs)(t,{flexDirection:`column`,children:[(0,x.jsx)(n,{color:`warning`,children:`Warning: You already have authentication configured via environment variable or API key helper.`}),(0,x.jsx)(n,{color:`warning`,children:`The setup-token command will create a new OAuth token which you can use instead.`})]}),(0,x.jsx)(i,{onDone:()=>{a()}})]})})}))}),e.unmount(),process.exit(0)}var C=b.lazy(()=>import(`./Doctor-B540I-gq.js`).then(e=>({default:e.Doctor})));function w({onDone:e}){return h(),(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(C,{onDone:e})})}async function T(e){d(`tengu_doctor_command`,{}),await new Promise(t=>{e.render((0,x.jsx)(o,{children:(0,x.jsx)(s,{children:(0,x.jsx)(_,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1,children:(0,x.jsx)(w,{onDone:()=>{t()}})})})}))}),e.unmount(),process.exit(0)}async function E(e,t){let{setup:n}=await import(`./setup-DdbmxSZh.js`);await n(y(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-OkuNmjmB.js`);await new Promise(n=>{let i=[];e&&i.push(e),t.force&&i.push(`--force`),r.call(e=>{n(),process.exit(+!!e.includes(`failed`))},{},i)})}export{T as doctorHandler,E as installHandler,S as setupTokenHandler};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{h as r,r as i}from"./lazySchema-DcIJE_0i.js";import{JD as a,SO as o,XD as s,YD as c,hD as l,mD as u,vO as ee,xO as d,yO as f}from"./loadAgentsDir-DrDu5yYy.js";import{C as p,F as m,I as h,S as g,V as _,a as te,d as v,l as y,p as b,w as x,z as S}from"./debug-BrXObCdR.js";import{St as C,_t as w,bt as T,xt as ne,yt as re}from"./settings-DfWP5y6X.js";import{o as ie,s as E}from"./log-BMCygSzM.js";import{homedir as ae}from"os";import*as D from"path";import{join as oe,resolve as se}from"path";import{randomBytes as O}from"crypto";import{readFile as k,readdir as A,rename as j,stat as M,unlink as N,writeFile as P}from"fs/promises";function F(){return oe(u(),H)}async function I(){let e=F();try{let t=p(await k(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return y(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==V)return y(`Install counts cache version mismatch (got ${n.version}, expected ${V})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return y(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(y(`Install counts cache has invalid fetchedAt timestamp`),null):n.counts.every(e=>typeof e==`object`&&!!e&&typeof e.plugin==`string`&&typeof e.unique_installs==`number`)?Date.now()-r>W?(y(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(y(`Install counts cache has malformed entries`),null)}catch(e){return h(e)!==`ENOENT`&&y(`Failed to load install counts cache: ${m(e)}`),null}}async function L(e){let t=F(),n=`${t}.${O(8).toString(`hex`)}.tmp`;try{let r=u();await v().mkdir(r),await P(n,x(e,null,2),{encoding:`utf-8`,mode:384}),await j(n,t),y(`Install counts cache saved successfully`)}catch(e){E(e);try{await N(n)}catch{}}}async function R(){y(`Fetching install counts from ${U}`);let e=performance.now();try{let n=await t.get(U,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return s(`install_counts`,U,`success`,performance.now()-e),n.data.plugins}catch(t){throw s(`install_counts`,U,`failure`,performance.now()-e,a(t)),t}}async function z(){let e=await I();if(e){y(`Using cached install counts`),s(`install_counts`,U,`cache_hit`,0);let t=new Map;for(let n of e.counts)t.set(n.plugin,n.unique_installs);return t}try{let e=await R();await L({version:V,fetchedAt:new Date().toISOString(),counts:e});let t=new Map;for(let n of e)t.set(n.plugin,n.unique_installs);return t}catch(e){return E(e),y(`Failed to fetch install counts: ${m(e)}`),null}}function B(e){if(e<1e3)return String(e);if(e<1e6){let t=(e/1e3).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}K`:`${t}K`}let t=(e/1e6).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}M`:`${t}M`}var V,H,U,W,G=e((()=>{n(),te(),S(),b(),ie(),g(),c(),l(),V=1,H=`install-counts-cache.json`,U=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,W=1440*60*1e3}));async function K(e){let t=e.trim(),n=v(),r=t.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(r?.[1]){let e=r[1],t=r[3];return t?{source:`git`,url:e,ref:t}:{source:`git`,url:e}}if(t.startsWith(`http://`)||t.startsWith(`https://`)){let e=t.match(/^([^#]+)(#(.+))?$/),n=e?.[1]||t,r=e?.[3];if(n.endsWith(`.git`)||n.includes(`/_git/`))return r?{source:`git`,url:n,ref:r}:{source:`git`,url:n};let i;try{i=new URL(n)}catch{return{source:`url`,url:n}}if((i.hostname===`github.com`||i.hostname===`www.github.com`)&&i.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let e=n.endsWith(`.git`)?n:`${n}.git`;return r?{source:`git`,url:e,ref:r}:{source:`git`,url:e}}return{source:`url`,url:n}}let i=process.platform===`win32`&&(t.startsWith(`.\\`)||t.startsWith(`..\\`)||/^[a-zA-Z]:[/\\]/.test(t));if(t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)||t.startsWith(`~`)||i){let e=se(t.startsWith(`~`)?t.replace(/^~/,ae()):t),r;try{r=await n.stat(e)}catch(t){let n=h(t);return{error:n===`ENOENT`?`Path does not exist: ${e}`:`Cannot access path: ${e} (${n??t})`}}return r.isFile()?e.endsWith(`.json`)?{source:`file`,path:e}:{error:`File path must point to a .json file (marketplace.json), but got: ${e}`}:r.isDirectory()?{source:`directory`,path:e}:{error:`Path is neither a file nor a directory: ${e}`}}if(t.includes(`/`)&&!t.startsWith(`@`)){if(t.includes(`:`))return null;let e=t.match(/^([^#@]+)(?:[#@](.+))?$/),n=e?.[1]||t,r=e?.[2];return r?{source:`github`,repo:n,ref:r}:{source:`github`,repo:n}}return null}var ce=e((()=>{S(),b()}));function le(e){let t=D.basename(e),n=D.basename(D.dirname(e));return t===`plugin.json`?`plugin`:t===`marketplace.json`?`marketplace`:n===`.claude-plugin`?`plugin`:`unknown`}function q(e){return e.issues.map(e=>({path:e.path.join(`.`)||`root`,message:e.message,code:e.code}))}function J(e,t,n,r){e.includes(`..`)&&n.push({path:t,message:r?`Path contains "..": ${e}. ${r}`:`Path contains ".." which could be a path traversal attempt: ${e}`})}function ue(e){let t=e.replace(/^(\.\.\/)+/,``);return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${t===e?`./plugins/my-plugin`:`./${t}`}" instead of "${e}".`}async function Y(e){let t=[],n=[],r=D.resolve(e),i;try{i=await k(r,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${m(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=p(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(e)}`}],warnings:[],filePath:r,fileType:`plugin`}}if(a&&typeof a==`object`){let e=a;e.commands&&(Array.isArray(e.commands)?e.commands:[e.commands]).forEach((e,n)=>{typeof e==`string`&&J(e,`commands[${n}]`,t)}),e.agents&&(Array.isArray(e.agents)?e.agents:[e.agents]).forEach((e,n)=>{typeof e==`string`&&J(e,`agents[${n}]`,t)}),e.skills&&(Array.isArray(e.skills)?e.skills:[e.skills]).forEach((e,n)=>{typeof e==`string`&&J(e,`skills[${n}]`,t)})}let o=a;if(typeof a==`object`&&a){let e=a,t=Object.keys(e).filter(e=>$.has(e));if(t.length>0){let r={...e};for(let e of t)delete r[e],n.push({path:e,message:`Field '${e}' belongs in the marketplace entry (marketplace.json), not plugin.json. It's harmless here but unused — Work Mate ignores it at load time.`});o=r}}let s=re().strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Work Mate accepts it, but the Claude.ai marketplace sync requires kebab-case (lowercase letters, digits, and hyphens only, e.g., "my-plugin").`}),e.version||n.push({path:`version`,message:`No version specified. Consider adding a version following semver (e.g., "1.0.0")`}),e.description||n.push({path:`description`,message:`No description provided. Adding a description helps users understand what your plugin does`}),e.author||n.push({path:`author`,message:`No author information provided. Consider adding author details for plugin attribution`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`plugin`}}async function X(e){let t=[],n=[],i=D.resolve(e),a;try{a=await k(i,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${i}`:t===`EISDIR`?`Path is not a file: ${i}`:`Failed to read file: ${m(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:i,fileType:`marketplace`}}let o;try{o=p(a)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(e)}`}],warnings:[],filePath:i,fileType:`marketplace`}}if(o&&typeof o==`object`){let e=o;Array.isArray(e.plugins)&&e.plugins.forEach((e,n)=>{if(e&&typeof e==`object`&&`source`in e){let r=e.source;typeof r==`string`&&J(r,`plugins[${n}].source`,t,ue(r)),r&&typeof r==`object`&&`path`in r&&typeof r.path==`string`&&J(r.path,`plugins[${n}].source.path`,t)}})}let s=ne().extend({plugins:r(T().strict())}).strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;if((!e.plugins||e.plugins.length===0)&&n.push({path:`plugins`,message:`Marketplace has no plugins defined`}),e.plugins){e.plugins.forEach((n,r)=>{e.plugins.filter(e=>e.name===n.name).length>1&&t.push({path:`plugins[${r}].name`,message:`Duplicate plugin name "${n.name}" found in marketplace`})});let r=D.dirname(i),a=D.basename(r)===`.claude-plugin`?D.dirname(r):r;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=D.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=p(await k(e,{encoding:`utf-8`}));typeof t.version==`string`&&(i=t.version)}catch{continue}i&&i!==r.version&&n.push({path:`plugins[${t}].version`,message:`Entry declares version "${r.version}" but ${r.source}/.claude-plugin/plugin.json says "${i}". At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. Update this entry to "${i}" to match.`})}}e.metadata?.description||n.push({path:`metadata.description`,message:`No marketplace description provided. Adding a description helps users understand what this marketplace offers`})}return{success:t.length===0,errors:t,warnings:n,filePath:i,fileType:`marketplace`}}function de(e,t,n){let r=[],i=[],a=t.match(ee);if(!a)return i.push({path:`frontmatter`,message:`No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata.`}),{success:!0,errors:r,warnings:i,filePath:e,fileType:n};let s=a[1]||``,c;try{c=o(s)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${m(t)}. At runtime this ${n} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n}}if(typeof c!=`object`||!c||Array.isArray(c))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(c)?`an array`:c===null?`null`:typeof c}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let l=c;if(l.description!==void 0){let e=l.description;typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`&&e!==null&&r.push({path:`description`,message:`description must be a string, got ${Array.isArray(e)?`array`:typeof e}. At runtime this value is dropped.`})}else i.push({path:`description`,message:`No description in frontmatter. A description helps users and Claude understand when to use this ${n}.`});l.name!==void 0&&l.name!==null&&typeof l.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof l.name}.`});let u=l[`allowed-tools`];u!=null&&(typeof u!=`string`&&!Array.isArray(u)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof u}.`}):Array.isArray(u)&&u.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let d=l.shell;if(d!=null)if(typeof d!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof d}.`});else{let e=d.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${d}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await k(e,{encoding:`utf-8`})}catch(t){return h(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${m(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=p(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=w().safeParse(n);return r.success?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:q(r.error),warnings:[],filePath:e,fileType:`hooks`}}async function Q(e,t){let n;try{n=await A(e,{withFileTypes:!0})}catch(e){let t=h(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>D.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=D.join(e,t.name);t.isDirectory()?r.push(...await Q(n,!1)):t.isFile()&&t.name.toLowerCase().endsWith(`.md`)&&r.push(n)}return r}async function fe(e){let t=[],n=[[`skill`,D.join(e,`skills`)],[`agent`,D.join(e,`agents`)],[`command`,D.join(e,`commands`)]];for(let[e,r]of n){let n=await Q(r,e===`skill`);for(let r of n){let n;try{n=await k(r,{encoding:`utf-8`})}catch(n){if(_(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${m(n)}`}],warnings:[],filePath:r,fileType:e});continue}let i=de(r,n,e);(i.errors.length>0||i.warnings.length>0)&&t.push(i)}}let r=await Z(D.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=D.resolve(e),n=null;try{n=await M(t)}catch(e){if(!_(e))throw e}if(n?.isDirectory()){let e=await X(D.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(D.join(t,`.claude-plugin`,`plugin.json`));return n.errors[0]?.code===`ENOENT`?{success:!1,errors:[{path:`directory`,message:`No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json`}],warnings:[],filePath:t,fileType:`plugin`}:n}switch(le(e)){case`plugin`:return Y(e);case`marketplace`:return X(e);case`unknown`:try{let n=p(await k(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(h(e)===`ENOENT`)return{success:!1,errors:[{path:`file`,message:`File not found: ${t}`}],warnings:[],filePath:t,fileType:`plugin`}}return Y(e)}}var $,me=e((()=>{i(),S(),f(),g(),d(),C(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{K as a,G as c,ce as i,pe as n,B as o,fe as r,z as s,me as t};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{b as t,c as n,g as r}from"./config-C7YHKCPV.js";import{n as i,r as a}from"./analytics-BotDBGh0.js";var o;e((()=>{i(),r(),o=async()=>{let e=n().editorMode||`normal`;e===`emacs`&&(e=`normal`);let r=e===`normal`?`vim`:`normal`;return t(e=>({...e,editorMode:r})),a(`tengu_editor_mode_changed`,{mode:r,source:`command`}),{type:`text`,value:`Editor mode set to ${r}. ${r===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{o as call};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{b as t,c as n,g as r}from"./config-DiT2Z8dY.js";import{n as i,r as a}from"./analytics-BotDBGh0.js";var o;e((()=>{i(),r(),o=async()=>{let e=n().editorMode||`normal`;e===`emacs`&&(e=`normal`);let r=e===`normal`?`vim`:`normal`;return t(e=>({...e,editorMode:r})),a(`tengu_editor_mode_changed`,{mode:r,source:`command`}),{type:`text`,value:`Editor mode set to ${r}. ${r===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{o as call};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,o as n}from"./execFileNoThrow-COKYqVQj.js";import{n as r,t as i}from"./execSyncWrapper-DZJ3tNWF.js";async function a(e){if(process.platform===`win32`){let t=await n(`where.exe ${e}`,{shell:!0,stderr:`ignore`,reject:!1});return t.exitCode!==0||!t.stdout?null:t.stdout.trim().split(/\r?\n/)[0]||null}let t=await n(`which ${e}`,{shell:!0,stderr:`ignore`,reject:!1});return t.exitCode!==0||!t.stdout?null:t.stdout.trim()}function o(e){if(process.platform===`win32`)try{return i(`where.exe ${e}`,{encoding:`utf-8`,stdio:[`ignore`,`pipe`,`ignore`]}).toString().trim().split(/\r?\n/)[0]||null}catch{return null}try{return i(`which ${e}`,{encoding:`utf-8`,stdio:[`ignore`,`pipe`,`ignore`]}).toString().trim()||null}catch{return null}}var s,c,l,u=e((()=>{t(),r(),s=typeof Bun<`u`&&typeof Bun.which==`function`?Bun.which:null,c=s?async e=>s(e):a,l=s??o}));export{c as n,l as r,u as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,o as n}from"./execFileNoThrow-D244NytW.js";import{n as r,t as i}from"./execSyncWrapper-CCMQShK-.js";async function a(e){if(process.platform===`win32`){let t=await n(`where.exe ${e}`,{shell:!0,stderr:`ignore`,reject:!1});return t.exitCode!==0||!t.stdout?null:t.stdout.trim().split(/\r?\n/)[0]||null}let t=await n(`which ${e}`,{shell:!0,stderr:`ignore`,reject:!1});return t.exitCode!==0||!t.stdout?null:t.stdout.trim()}function o(e){if(process.platform===`win32`)try{return i(`where.exe ${e}`,{encoding:`utf-8`,stdio:[`ignore`,`pipe`,`ignore`]}).toString().trim().split(/\r?\n/)[0]||null}catch{return null}try{return i(`which ${e}`,{encoding:`utf-8`,stdio:[`ignore`,`pipe`,`ignore`]}).toString().trim()||null}catch{return null}}var s,c,l,u=e((()=>{t(),r(),s=typeof Bun<`u`&&typeof Bun.which==`function`?Bun.which:null,c=s?async e=>s(e):a,l=s??o}));export{c as n,l as r,u as t};
@@ -0,0 +1 @@
1
+ import{i as e,o as t}from"./windowsPaths-DtapVxOo.js";e();export{t as setShellIfWindows};
@@ -0,0 +1 @@
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"./cwd-CYmmnQVS.js";import{a,l as o}from"./debug-BrXObCdR.js";import{n as s,t as c}from"./memoize-B0zhbT8Z.js";import{n as l,t as u}from"./execSyncWrapper-CCMQShK-.js";import{i as d,o as f}from"./platform-BrYefG_2.js";import{existsSync as p}from"fs";import*as m from"path/win32";function h(){if(d()===`windows`){let e=y();process.env.SHELL=e,process.env.CLAUDE_CODE_GIT_BASH_PATH=e,o(`Using bash path: "${e}"`)}}function g(e,t){let n=[`C:\\Program Files\\Git\\bin\\bash.exe`,`C:\\Program Files\\Git\\usr\\bin\\bash.exe`,`C:\\Program Files (x86)\\Git\\bin\\bash.exe`,`C:\\Program Files (x86)\\Git\\usr\\bin\\bash.exe`];t&&n.push(`${t}\\scoop\\apps\\git\\current\\usr\\bin\\bash.exe`);for(let t of n)if(e(t))return t;return null}function _(e,t){if(e===`git`){for(let e of[`C:\\Program Files\\Git\\cmd\\git.exe`,`C:\\Program Files (x86)\\Git\\cmd\\git.exe`])if(t.checkExists(e))return e}try{let n=t.execCommand(`where.exe ${e}`).split(/\r?\n/).map(e=>e.trim()).filter(Boolean),r=m.resolve(t.cwdFn()).toLowerCase();for(let e of n){let t=m.resolve(e).toLowerCase(),n=m.dirname(t).toLowerCase(),i=m.relative(r,n);if(i===``||!i.startsWith(`..`)&&!m.isAbsolute(i)){o(`Skipping potentially malicious executable in current directory: ${e}`);continue}return e}return null}catch{return null}}function v(e=b){let t=e.envOverride??process.env.CLAUDE_CODE_GIT_BASH_PATH;if(t)return e.checkExists(t)?t:null;let n=_(`bash`,e);if(n&&e.checkExists(n))return n;let r=_(`git`,e);if(r){let t=[m.join(r,`..`,`..`,`bin`,`bash.exe`),m.join(r,`..`,`..`,`usr`,`bin`,`bash.exe`),m.join(r,`..`,`bash.exe`)];for(let n of t)if(e.checkExists(n))return n}return g(e.checkExists,e.userProfile)}function y(){let e=x();if(e!==null)return e;let t=process.env.CLAUDE_CODE_GIT_BASH_PATH;console.error(t?`Work Mate was unable to find CLAUDE_CODE_GIT_BASH_PATH path "${t}"`:`Work Mate on Windows requires git-bash (https://git-scm.com/downloads/win). If installed but not in PATH, set environment variable pointing to your bash.exe, similar to: CLAUDE_CODE_GIT_BASH_PATH=C:\\Program Files\\Git\\bin\\bash.exe`),process.exit(1)}var b,x,S,C,w=e((()=>{n(),r(),a(),l(),c(),f(),b={checkExists:p,execCommand:e=>u(e,{stdio:`pipe`,encoding:`utf8`}).trim(),cwdFn:i,userProfile:process.env.USERPROFILE,envOverride:void 0},x=t(()=>v()),S=s(e=>{if(e.startsWith(`\\\\`))return e.replace(/\\/g,`/`);let t=e.match(/^([A-Za-z]):[/\\]/);return t?`/`+t[1].toLowerCase()+e.slice(2).replace(/\\/g,`/`):e.replace(/\\/g,`/`)},e=>e,500),C=s(e=>{if(e.startsWith(`//`))return e.replace(/\//g,`\\`);let t=e.match(/^\/cygdrive\/([A-Za-z])(\/|$)/);if(t){let n=t[1].toUpperCase(),r=e.slice((`/cygdrive/`+t[1]).length);return n+`:`+(r||`\\`).replace(/\//g,`\\`)}let n=e.match(/^\/([A-Za-z])(\/|$)/);if(n){let t=n[1].toUpperCase(),r=e.slice(2);return t+`:`+(r||`\\`).replace(/\//g,`\\`)}return e.replace(/\//g,`\\`)},e=>e,500)}));export{C as a,w as i,x as n,h as o,v as r,S as s,y as t};