@readmagic/workmate 0.0.21 → 0.0.23

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 (493) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-OgcBcK5A.js +1 -0
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-CDNd5-7E.js +1 -0
  3. package/dist/chunks/AgentsMdExternalIncludesDialog-CNEifEyV.js +1 -0
  4. package/dist/chunks/App-B-3tPQ3k.js +1 -0
  5. package/dist/chunks/BackgroundTasksDialog-COuhHcey.js +2 -0
  6. package/dist/chunks/BypassPermissionsModeDialog-bJek4siJ.js +1 -0
  7. package/dist/chunks/CustomSelect-DoeEXOIP.js +1 -0
  8. package/dist/chunks/DiffDialog-B3X9FMpO.js +6 -0
  9. package/dist/chunks/Doctor-6PXyjIi6.js +3 -0
  10. package/dist/chunks/Doctor-DNgkgYhB.js +1 -0
  11. package/dist/chunks/ExitFlow-DgAZp_8U.js +2 -0
  12. package/dist/chunks/Grove-CHatOzcE.js +11 -0
  13. package/dist/chunks/InvalidConfigDialog-DXL92MN9.js +1 -0
  14. package/dist/chunks/InvalidSettingsDialog-Dtmpzeps.js +1 -0
  15. package/dist/chunks/KeybindingProviderSetup-DA37QUFs.js +1 -0
  16. package/dist/chunks/MCPConnectionManager-thZd-xA_.js +1 -0
  17. package/dist/chunks/MCPToolListView-CpY-YJg4.js +1 -0
  18. package/dist/chunks/{McpParsingWarnings-6ENzOklf.js → McpParsingWarnings-JvChf3xr.js} +1 -1
  19. package/dist/chunks/MessageSelector-C0_iw7SI.js +3 -0
  20. package/dist/chunks/Messages-K4DDsDP9.js +10 -0
  21. package/dist/chunks/Onboarding-C1UdzM-1.js +1 -0
  22. package/dist/chunks/{PromptInputFooterSuggestions-Blzgj5yW.js → PromptInputFooterSuggestions-AyLog8p7.js} +1 -1
  23. package/dist/chunks/PromptInputHelpMenu-oyic20ip.js +1 -0
  24. package/dist/chunks/ProviderSetup-XcBHjUnd.js +1 -0
  25. package/dist/chunks/QueryEngine-DYxBjJ4i.js +1 -0
  26. package/dist/chunks/REPL-CQBJRrT0.js +124 -0
  27. package/dist/chunks/REPL-CrVuMQY2.js +1 -0
  28. package/dist/chunks/ResumeConversation-Dl8H9Gfy.js +1 -0
  29. package/dist/chunks/SearchExtraToolsTool-lv7VE50N.js +1 -0
  30. package/dist/chunks/SelectMulti-Bc6l11_K.js +1 -0
  31. package/dist/chunks/Settings-TGp3fPrS.js +3 -0
  32. package/dist/chunks/Spinner-zYPFVFHN.js +1 -0
  33. package/dist/chunks/SpinnerGlyph-CmkRUvHe.js +1 -0
  34. package/dist/chunks/TextInput-CD9iau2k.js +22 -0
  35. package/dist/chunks/ThemePicker-0F0hZYPX.js +1 -0
  36. package/dist/chunks/TrustDialog-C76YiMKz.js +1 -0
  37. package/dist/chunks/{ValidationErrorsList-2QWIs_6h.js → ValidationErrorsList-DgNzJQUP.js} +1 -1
  38. package/dist/chunks/_baseEach-4ff-vRlp.js +1 -0
  39. package/dist/chunks/add-dir-JMsRLGfx.js +1 -0
  40. package/dist/chunks/{agentDisplay-1Y-N-gqz.js → agentDisplay-BReJUBWg.js} +1 -1
  41. package/dist/chunks/agents-9qQ8I6zW.js +101 -0
  42. package/dist/chunks/{agents-CvW8XjoJ.js → agents-B3x8yJ_r.js} +1 -1
  43. package/dist/chunks/allErrors-DfWylHSw.js +1 -0
  44. package/dist/chunks/appleTerminalBackup-BArZWB21.js +1 -0
  45. package/dist/chunks/backgroundHousekeeping-BGxHB_OX.js +1 -0
  46. package/dist/chunks/backgroundHousekeeping-CVNIhQg8.js +17 -0
  47. package/dist/chunks/banner-Cu2-XUek.js +2 -0
  48. package/dist/chunks/{bedrockClient-DxE_mHFI.js → bedrockClient-CfiDN-kF.js} +2 -2
  49. package/dist/chunks/branch-C4TsMEkx.js +2 -0
  50. package/dist/chunks/{break-cache-BZ_UMtEL.js → break-cache-BMXqFTeS.js} +2 -2
  51. package/dist/chunks/btw-Dn1eYFAz.js +1 -0
  52. package/dist/chunks/caches-BGzKwpnc.js +1 -0
  53. package/dist/chunks/caches-DArHxBgL.js +1 -0
  54. package/dist/chunks/claudeDesktop-D8ml2767.js +1 -0
  55. package/dist/chunks/{clear-D2KRoibg.js → clear-Bdhb6b39.js} +1 -1
  56. package/dist/chunks/{client-C_jBL1yC.js → client-4iqhC8xq.js} +1 -1
  57. package/dist/chunks/client-BiqbIkwr.js +1 -0
  58. package/dist/chunks/client-CZ8nyVh5.js +1 -0
  59. package/dist/chunks/client-CpTCeWba.js +1 -0
  60. package/dist/chunks/commands-QepeBbFn.js +1 -0
  61. package/dist/chunks/compact-Bu9BUpxV.js +2 -0
  62. package/dist/chunks/config-C-Y2qtB2.js +3 -0
  63. package/dist/chunks/config-D58C3_Lu.js +1 -0
  64. package/dist/chunks/config-DD8fCYXn.js +1 -0
  65. package/dist/chunks/{context-Db9tH1VF.js → context-CY_yfdYa.js} +1 -1
  66. package/dist/chunks/context-noninteractive-BDDi3NLF.js +1 -0
  67. package/dist/chunks/{context-noninteractive-CacA9VlT.js → context-noninteractive-Dd4xIoP1.js} +10 -10
  68. package/dist/chunks/conversation-B0wxBwzv.js +1 -0
  69. package/dist/chunks/conversation-DUu9qBnq.js +1 -0
  70. package/dist/chunks/conversationRecovery-2ft8sCPE.js +1 -0
  71. package/dist/chunks/crossProjectResume-6boHMUBx.js +40 -0
  72. package/dist/chunks/cwd-Dc3NV7s8.js +1 -0
  73. package/dist/chunks/cwd-Pa83R95t.js +1 -0
  74. package/dist/chunks/{datadog-BuElf2EQ.js → datadog-BPuGcxxC.js} +1 -1
  75. package/dist/chunks/{debug-D58GQBDG.js → debug-Bglx1aTu.js} +5 -5
  76. package/dist/chunks/detectRepository-CfX8Lc0A.js +1 -0
  77. package/dist/chunks/{diff-yA6v_dpP.js → diff-BOAElpfQ.js} +1 -1
  78. package/dist/chunks/directoryCompletion-D_Rtg-4j.js +1 -0
  79. package/dist/chunks/dist-es-B3-7VFf2.js +1 -0
  80. package/dist/chunks/dist-es-B7j_mv242.js +1 -0
  81. package/dist/chunks/dist-es-BSKD_hOQ.js +1 -0
  82. package/dist/chunks/dist-es-BSRN-2nA.js +9 -0
  83. package/dist/chunks/{dist-es-yHGBqhBe.js → dist-es-BXXmyhQ2.js} +1 -1
  84. package/dist/chunks/{dist-es-C3reqy7X.js → dist-es-BaQndfvh2.js} +1 -1
  85. package/dist/chunks/dist-es-CzTYn7xo.js +1 -0
  86. package/dist/chunks/dist-es-DSkyibcN.js +1 -0
  87. package/dist/chunks/{dist-es-BOPBJQo3.js → dist-es-_UNJQniz.js} +1 -1
  88. package/dist/chunks/dist-es-hwK6468D.js +1 -0
  89. package/dist/chunks/dist-es-ovsdbtwh.js +1 -0
  90. package/dist/chunks/doctor-CkLzqAMd.js +1 -0
  91. package/dist/chunks/entry-TNOoyy7_.js +13 -0
  92. package/dist/chunks/{envUtils-DcaKZlRU.js → envUtils-DfkgIdYf.js} +1 -1
  93. package/dist/chunks/esm-eTAUP-La.js +1 -0
  94. package/dist/chunks/{execFileNoThrow-B_KRY4cT.js → execFileNoThrow-BTachNBI.js} +1 -1
  95. package/dist/chunks/exit-DXApFJIP.js +1 -0
  96. package/dist/chunks/extraUsage-CmQaLPV1.js +1 -0
  97. package/dist/chunks/extractMemories-xP63mv6R.js +1 -0
  98. package/dist/chunks/fast-C5nQH8rm.js +1 -0
  99. package/dist/chunks/fast-eGx2IxD7.js +1 -0
  100. package/dist/chunks/fetchModelList-CxLsVNsu.js +1 -0
  101. package/dist/chunks/fetchModelList-D24lRIgR.js +1 -0
  102. package/dist/chunks/fileSuggestions-DHxdwq28.js +3 -0
  103. package/dist/chunks/firstPartyEventLogger-BVAogAX8.js +1 -0
  104. package/dist/chunks/firstPartyEventLogger-M6UMli2c.js +3 -0
  105. package/dist/chunks/gemini-D_ORb_L6.js +2 -0
  106. package/dist/chunks/generateSessionName-BQoDduyA.js +1 -0
  107. package/dist/chunks/{genericProcessUtils-Cnyun_Wr.js → genericProcessUtils-DwQFuna9.js} +1 -1
  108. package/dist/chunks/goal-D7c2mSds.js +3 -0
  109. package/dist/chunks/grok-B2-ZbUiR.js +1 -0
  110. package/dist/chunks/grove-O6qp7ITR.js +1 -0
  111. package/dist/chunks/help-CZJdRviD.js +1 -0
  112. package/dist/chunks/history-CQiUERTL.js +1 -0
  113. package/dist/chunks/hooks-BNuUlMzL.js +1 -0
  114. package/dist/chunks/{hooks-BDgToO1Z.js → hooks-DIvN6gdv.js} +3 -3
  115. package/dist/chunks/install-T_CV1Slu.js +1 -0
  116. package/dist/chunks/instrumentation-BjqUZ383.js +21 -0
  117. package/dist/chunks/{job-DYMfSglZ.js → job-R6c4-3c8.js} +1 -1
  118. package/dist/chunks/keybindings-CLRaiL_Z.js +1 -0
  119. package/dist/chunks/launchLocalMemory-DrbKrwXc.js +3 -0
  120. package/dist/chunks/{launchOnboarding-BeNf51Ig.js → launchOnboarding-tqsMD8ni.js} +1 -1
  121. package/dist/chunks/loadAgentsDir-CcmY8zCj.js +1 -0
  122. package/dist/chunks/loadAgentsDir-DlPbtIsS.js +3349 -0
  123. package/dist/chunks/loadPluginHooks-C_msxVIc.js +1 -0
  124. package/dist/chunks/{loader-C33o_5kS.js → loader-CICGtLp2.js} +1 -1
  125. package/dist/chunks/{localSearch-DLz5IGGu.js → localSearch-CK-sFzPm.js} +1 -1
  126. package/dist/chunks/localSearch-DrUj0B-d.js +1 -0
  127. package/dist/chunks/log-D2TIwHBV.js +1 -0
  128. package/dist/chunks/logoUtils-x2pHV-Nl.js +1 -0
  129. package/dist/chunks/{magicDocs-DmPNMnNY.js → magicDocs-BEF8D3if.js} +3 -3
  130. package/dist/chunks/main-kOVUGxOS.js +345 -0
  131. package/dist/chunks/managedEnv-BEqrGqn1.js +1 -0
  132. package/dist/chunks/managedEnv-OPlzUPbJ.js +1 -0
  133. package/dist/chunks/mcp-BNd29r6p.js +6 -0
  134. package/dist/chunks/mcp-D0wAJrRT.js +1 -0
  135. package/dist/chunks/mcp-mgOlm1cY.js +2 -0
  136. package/dist/chunks/memory-DDLk9_LJ.js +1 -0
  137. package/dist/chunks/mode-CcNsWgK3.js +2 -0
  138. package/dist/chunks/model-BwBG0V1u.js +1 -0
  139. package/dist/chunks/model-DzCP4K-9.js +1 -0
  140. package/dist/chunks/modelOptions-DRaG3bo0.js +1 -0
  141. package/dist/chunks/nativeInstaller-C3pVPqrZ.js +1 -0
  142. package/dist/chunks/notifications-4wP1Tx9Y.js +1 -0
  143. package/dist/chunks/onChangeAppState-BlaoFbYF.js +1 -0
  144. package/dist/chunks/openai-CDN71NdX.js +2 -0
  145. package/dist/chunks/overlayContext-BT2Lq8ei.js +1 -0
  146. package/dist/chunks/{panel-Cm23FDVt.js → panel-CVS4SK_E.js} +1 -1
  147. package/dist/chunks/parser-CG5RuOCK.js +1 -0
  148. package/dist/chunks/{parser-eVu-cTRs.js → parser-Cg6hSCmn.js} +1 -1
  149. package/dist/chunks/partition-CIl_ORUT.js +1 -0
  150. package/dist/chunks/pasteStore-P0zP-ch0.js +1 -0
  151. package/dist/chunks/permissions-zSNOZSwr.js +3 -0
  152. package/dist/chunks/pidLock-BTqO-h7Y.js +3 -0
  153. package/dist/chunks/{plan-s228H7IU.js → plan-Bs6em6lk.js} +1 -1
  154. package/dist/chunks/{platform-DMQxcm4K.js → platform-BacQ6ACS.js} +1 -1
  155. package/dist/chunks/plugin-DDDxjBa0.js +17 -0
  156. package/dist/chunks/pluginAutoupdate-8qugAFhb.js +1 -0
  157. package/dist/chunks/pluginBlocklist-q01ackCf.js +1 -0
  158. package/dist/chunks/pluginCliCommands-DXZfCZsv.js +1 -0
  159. package/dist/chunks/{pluginFlagging-BSLuTk3M.js → pluginFlagging-BG2MHCQJ.js} +1 -1
  160. package/dist/chunks/pluginOperations-hXYLrzM2.js +2 -0
  161. package/dist/chunks/{pluginStartupCheck-xQbHZ5gf.js → pluginStartupCheck-DTMa6TgL.js} +1 -1
  162. package/dist/chunks/pluginStartupCheck-HS1ZceZa.js +1 -0
  163. package/dist/chunks/plugins-COoGBYk6.js +4 -0
  164. package/dist/chunks/{poorMode-Bt_A2arj.js → poorMode-B0QGV6Ci.js} +1 -1
  165. package/dist/chunks/poorMode-G-pnu6NM.js +1 -0
  166. package/dist/chunks/print-BASybEtO.js +13 -0
  167. package/dist/chunks/processBashCommand-DDi_Pymt.js +1 -0
  168. package/dist/chunks/processSlashCommand-Cq9kaoSF.js +5 -0
  169. package/dist/chunks/{projectContext-Bw3o5BrN.js → projectContext-5fmRr6Sd.js} +1 -1
  170. package/dist/chunks/{projectContext-BN2ZWzOG.js → projectContext-DhtjLv3k.js} +1 -1
  171. package/dist/chunks/projectOnboardingState-B5YATuc6.js +1 -0
  172. package/dist/chunks/prompt-CHobfCB1.js +1 -0
  173. package/dist/chunks/prompt-CMm6RHHc.js +1 -0
  174. package/dist/chunks/{prompt-BNNE5tsG.js → prompt-mM79EGnT.js} +3 -3
  175. package/dist/chunks/promptEditor-DLGN_eLu.js +4 -0
  176. package/dist/chunks/{protocolHandler-DukQ6b4Q.js → protocolHandler-DjQALaU2.js} +2 -2
  177. package/dist/chunks/{proxy-BhIc7-mj.js → proxy-CDBfZjO7.js} +2 -2
  178. package/dist/chunks/reconciler-CeXqh95g.js +1 -0
  179. package/dist/chunks/refresh-Ce2yk28a.js +1 -0
  180. package/dist/chunks/registerProtocol-CAsDme_E.js +1 -0
  181. package/dist/chunks/reject-Bld5E-bn.js +1 -0
  182. package/dist/chunks/reload-plugins-C42xSB5l.js +1 -0
  183. package/dist/chunks/rename-CtBghpxZ.js +1 -0
  184. package/dist/chunks/{renderOptions-D-aQZbzS.js → renderOptions-DV0dn0IW.js} +1 -1
  185. package/dist/chunks/resume-BWkaTDqd.js +2 -0
  186. package/dist/chunks/ripgrep-DLs8MraF.js +1 -0
  187. package/dist/chunks/ripgrep-Dl3y5r4m.js +5 -0
  188. package/dist/chunks/{runtimeObserver-DS1PK6We.js → runtimeObserver-1wQO8HSZ.js} +1 -1
  189. package/dist/chunks/{runtimeObserver-CsZw5XBt.js → runtimeObserver-XQrOux41.js} +4 -4
  190. package/dist/chunks/sandbox-adapter-8GO6eJxw.js +1 -0
  191. package/dist/chunks/sandbox-toggle-Dir9Polo.js +1 -0
  192. package/dist/chunks/searchExtraTools-BhDq8DTJ.js +1 -0
  193. package/dist/chunks/select-Bxf5-5sI.js +1 -0
  194. package/dist/chunks/sessionFileAccessHooks-CozocHQE.js +1 -0
  195. package/dist/chunks/sessionObserver-DGEQM4cO.js +1 -0
  196. package/dist/chunks/{sessionObserver-N7fORFdL.js → sessionObserver-DS4G6mb9.js} +2 -2
  197. package/dist/chunks/sessionStorage-BcAscOGE.js +1 -0
  198. package/dist/chunks/sessionTracing-BoDDYLxW.js +11 -0
  199. package/dist/chunks/settings-B2jvL8Dp.js +24 -0
  200. package/dist/chunks/settings-CisDe8DB.js +1 -0
  201. package/dist/chunks/setup-BRypY6iT.js +3 -0
  202. package/dist/chunks/{shadowedRuleDetection-DEo1hvGi.js → shadowedRuleDetection-BRxZjobz.js} +1 -1
  203. package/dist/chunks/{sideQuestion-C11KgNGL.js → sideQuestion-DLJxyrlp.js} +3 -3
  204. package/dist/chunks/sinks-CGdKmq_8.js +1 -0
  205. package/dist/chunks/sinks-Cz2HfgMU.js +1 -0
  206. package/dist/chunks/skillChangeDetector-xviGstqm.js +1 -0
  207. package/dist/chunks/{skillGapStore-H4MkUFUY.js → skillGapStore-CKN_d3pO.js} +2 -2
  208. package/dist/chunks/{skillLifecycle-ADUTDK7D.js → skillLifecycle-BMY2JGGG.js} +2 -2
  209. package/dist/chunks/{skillSearchPanel-PpfVDMGR.js → skillSearchPanel-D9trHULQ.js} +4 -4
  210. package/dist/chunks/skills-CX_AvwLG.js +1 -0
  211. package/dist/chunks/startupProfiler-BH0FoI66.js +1 -0
  212. package/dist/chunks/startupProfiler-CJdr3SxP.js +3 -0
  213. package/dist/chunks/state-B4jiUise.js +1 -0
  214. package/dist/chunks/state-BhOKSFi5.js +1 -0
  215. package/dist/chunks/status-Daaak6Bo.js +1 -0
  216. package/dist/chunks/statusNoticeHelpers-vFVgIYuw.js +1 -0
  217. package/dist/chunks/stringUtils-C718f5ey.js +4 -0
  218. package/dist/chunks/sts-ei3CGBNu.js +1 -0
  219. package/dist/chunks/switcher-BpgmH4AI.js +1 -0
  220. package/dist/chunks/{switcher-DWfKi17X.js → switcher-CAajZeNL.js} +1 -1
  221. package/dist/chunks/{tasks-BwSsj2vI.js → tasks-BWNQr2d3.js} +1 -1
  222. package/dist/chunks/tempfile-CHO5wXsV.js +1 -0
  223. package/dist/chunks/{templateJobs-fiKuu4DK.js → templateJobs-gUET39Ho.js} +1 -1
  224. package/dist/chunks/terminalSetup-B_10N_gE.js +32 -0
  225. package/dist/chunks/{terminalSetup-Cte5a4hM.js → terminalSetup-qc2PlvOm.js} +1 -1
  226. package/dist/chunks/{theme-CAoGjf2D.js → theme-B7fKI6E5.js} +1 -1
  227. package/dist/chunks/tipRegistry-DamZr34w.js +2 -0
  228. package/dist/chunks/{toolEventObserver-Cq_ZV7x9.js → toolEventObserver-BL06sDI4.js} +1 -1
  229. package/dist/chunks/toolPool-CX5wDBi1.js +1 -0
  230. package/dist/chunks/types-Dx7P7JLQ.js +81 -0
  231. package/dist/chunks/udsClient-cQz6nJ_T.js +1 -0
  232. package/dist/chunks/use-select-navigation-BiUJdWai.js +1 -0
  233. package/dist/chunks/useDoublePress-C9xxQzh1.js +1 -0
  234. package/dist/chunks/useExitOnCtrlCDWithKeybindings-C9BYG8Bo.js +1 -0
  235. package/dist/chunks/useMainLoopModel-DwjSVzzO.js +1 -0
  236. package/dist/chunks/useManagePlugins-BqfIVa6E.js +1 -0
  237. package/dist/chunks/useMergedTools-Bw8FchX8.js +1 -0
  238. package/dist/chunks/useSearchInput-B25K1RnK.js +1 -0
  239. package/dist/chunks/useSettingsErrors-DYQ44kX4.js +1 -0
  240. package/dist/chunks/util-CtlC2dsN.js +1 -0
  241. package/dist/chunks/validatePlugin-D6tFo87L.js +1 -0
  242. package/dist/chunks/vim-CoRp9lY1.js +1 -0
  243. package/dist/chunks/worktree-B8apCnVe.js +1 -0
  244. package/dist/cli.js +1 -1
  245. package/package.json +1 -5
  246. package/dist/chunks/AddWorkspaceDirectory-DgAxYgBY.js +0 -1
  247. package/dist/chunks/AgentsMdExternalIncludesDialog-DGMRVexR.js +0 -1
  248. package/dist/chunks/AgentsMdExternalIncludesDialog-Dp6CwZyI.js +0 -1
  249. package/dist/chunks/App-VWyPd524.js +0 -1
  250. package/dist/chunks/ApproveApiKey-Bolw0sPs.js +0 -1
  251. package/dist/chunks/ApproveApiKey-CyNPMd6g.js +0 -1
  252. package/dist/chunks/BackgroundTasksDialog-DxagIOOw.js +0 -2
  253. package/dist/chunks/BypassPermissionsModeDialog-OS2S66zQ.js +0 -1
  254. package/dist/chunks/DiffDialog-CMtml9iw.js +0 -6
  255. package/dist/chunks/Doctor-Bk9P37mU.js +0 -1
  256. package/dist/chunks/Doctor-D9F3tKsr.js +0 -3
  257. package/dist/chunks/ExitFlow-DhRv5JPj.js +0 -2
  258. package/dist/chunks/Grove-Bbh8PpH0.js +0 -11
  259. package/dist/chunks/HybridTransport-P1vEUwhv.js +0 -2
  260. package/dist/chunks/InvalidConfigDialog-xAYpE-20.js +0 -1
  261. package/dist/chunks/InvalidSettingsDialog-CXFSISy3.js +0 -1
  262. package/dist/chunks/MCPConnectionManager-CoId-C__.js +0 -1
  263. package/dist/chunks/MCPToolListView-BQkQ-hyF.js +0 -1
  264. package/dist/chunks/MessageSelector-BvRVrfg6.js +0 -3
  265. package/dist/chunks/Messages-Cykztq1O.js +0 -10
  266. package/dist/chunks/Onboarding-CfeRwPNQ.js +0 -1
  267. package/dist/chunks/PromptInputHelpMenu-Ckp0k8E3.js +0 -1
  268. package/dist/chunks/QueryEngine-DduzztIG.js +0 -1
  269. package/dist/chunks/REPL-B8e5UU3H.js +0 -128
  270. package/dist/chunks/REPL-C4mbOhyL.js +0 -1
  271. package/dist/chunks/RemoteSessionManager-BPESC6Wu.js +0 -2
  272. package/dist/chunks/ResumeConversation-DG1sLryB.js +0 -1
  273. package/dist/chunks/SSETransport-CDNP2PlK.js +0 -2
  274. package/dist/chunks/SearchExtraToolsTool-vK2PP628.js +0 -1
  275. package/dist/chunks/Settings-B7n_dfP-.js +0 -2
  276. package/dist/chunks/TeleportProgress-QL3ibQfK.js +0 -1
  277. package/dist/chunks/TeleportRepoMismatchDialog-f-xl7biD.js +0 -1
  278. package/dist/chunks/TeleportResumeWrapper-DzVcrFuP.js +0 -1
  279. package/dist/chunks/ThemePicker-CIFKZza0.js +0 -1
  280. package/dist/chunks/TrustDialog-C0HEwZPk.js +0 -1
  281. package/dist/chunks/add-dir-DmEhPnvj.js +0 -1
  282. package/dist/chunks/agents-D96ng5I9.js +0 -101
  283. package/dist/chunks/allErrors-CT2dbBF3.js +0 -1
  284. package/dist/chunks/api-DTyrmy1O.js +0 -1
  285. package/dist/chunks/api-DumFOErN.js +0 -1
  286. package/dist/chunks/auth-CZ4EsFWF.js +0 -10
  287. package/dist/chunks/auth-QvonHoG9.js +0 -1
  288. package/dist/chunks/auth-jV5THRH8.js +0 -1
  289. package/dist/chunks/backgroundHousekeeping-C72oPgfD.js +0 -17
  290. package/dist/chunks/backgroundHousekeeping-D9PScHES.js +0 -1
  291. package/dist/chunks/banner-ChT5Ri7Q.js +0 -2
  292. package/dist/chunks/bg-qG2osBbP.js +0 -9
  293. package/dist/chunks/branch-K8X6jx0i.js +0 -2
  294. package/dist/chunks/bridgeConfig-C-bI-slm.js +0 -1
  295. package/dist/chunks/bridgeConfig-_xpxhGB5.js +0 -1
  296. package/dist/chunks/bridgeMessaging-DSJlYarJ.js +0 -1
  297. package/dist/chunks/bridgePointer-DfTOjgtX.js +0 -1
  298. package/dist/chunks/bridgeStatusUtil-DaEq5c69.js +0 -1
  299. package/dist/chunks/btw-BNs5OX7x.js +0 -1
  300. package/dist/chunks/bundledMode--fG1S62b.js +0 -1
  301. package/dist/chunks/caches-CC5NHwAz.js +0 -1
  302. package/dist/chunks/caches-nHxJWXgO.js +0 -1
  303. package/dist/chunks/capacityWake-BpP6c7x3.js +0 -3
  304. package/dist/chunks/ccrClient-JnhF5b3z.js +0 -1
  305. package/dist/chunks/claudeDesktop-DPc_SaVn.js +0 -1
  306. package/dist/chunks/cliLaunch-DDtwAolw.js +0 -1
  307. package/dist/chunks/client-9uHzAmFH.js +0 -1
  308. package/dist/chunks/client-BVal_QII.js +0 -1
  309. package/dist/chunks/client-BtTkq0YS.js +0 -1
  310. package/dist/chunks/client-Dd7CKMRX.js +0 -1
  311. package/dist/chunks/commands-C_rYjyQZ.js +0 -1
  312. package/dist/chunks/compact-Cqd6vKpn.js +0 -2
  313. package/dist/chunks/config-Be0BkAAr.js +0 -1
  314. package/dist/chunks/config-DUTgj3js.js +0 -3
  315. package/dist/chunks/config-DoEDgAfv.js +0 -1
  316. package/dist/chunks/context-noninteractive-D9tJYwi7.js +0 -1
  317. package/dist/chunks/controlMessageCompat-IFu4Gc1y.js +0 -1
  318. package/dist/chunks/conversation-DWfE4KGH.js +0 -1
  319. package/dist/chunks/conversation-Tvo4EDpQ.js +0 -1
  320. package/dist/chunks/createSSHSession-BQ83MMtr.js +0 -5
  321. package/dist/chunks/createSession-CqHnHhCR.js +0 -1
  322. package/dist/chunks/createSession-DqTtBycR.js +0 -1
  323. package/dist/chunks/crossProjectResume-DIXtiODF.js +0 -40
  324. package/dist/chunks/cwd-DLK3znO7.js +0 -1
  325. package/dist/chunks/cwd-Nh5IZNKO.js +0 -1
  326. package/dist/chunks/debugUtils-DXBRbwCE.js +0 -1
  327. package/dist/chunks/detached-Biz-xhu0.js +0 -4
  328. package/dist/chunks/detectRepository-DUJBh5s2.js +0 -1
  329. package/dist/chunks/detectRepository-pRAVv8SH.js +0 -1
  330. package/dist/chunks/directoryCompletion-CuA3_YIT.js +0 -1
  331. package/dist/chunks/dist-es-5t7v8oaj.js +0 -1
  332. package/dist/chunks/dist-es-BIjDeceU.js +0 -1
  333. package/dist/chunks/dist-es-C-OjW2Ao.js +0 -1
  334. package/dist/chunks/dist-es-CEk66gUu.js +0 -1
  335. package/dist/chunks/dist-es-CIULjvtA2.js +0 -1
  336. package/dist/chunks/dist-es-CMtO44xC.js +0 -1
  337. package/dist/chunks/dist-es-CYPVg66r.js +0 -9
  338. package/dist/chunks/dist-es-D1Y8zSMI.js +0 -1
  339. package/dist/chunks/dist-es-Gt_DpXlP.js +0 -1
  340. package/dist/chunks/dist-es-kj-F5A132.js +0 -1
  341. package/dist/chunks/doctor-eNAm6OiS.js +0 -1
  342. package/dist/chunks/entry-DidpiR-D.js +0 -13
  343. package/dist/chunks/esm-BCUC71kt.js +0 -1
  344. package/dist/chunks/execSyncWrapper-C3ZFV9od.js +0 -1
  345. package/dist/chunks/exit-DywUeiYd.js +0 -1
  346. package/dist/chunks/extraUsage-DiAirtuk.js +0 -1
  347. package/dist/chunks/extractMemories-_xiTnX95.js +0 -1
  348. package/dist/chunks/fast-DCXZACT9.js +0 -1
  349. package/dist/chunks/fast-Qo4WVqiW.js +0 -1
  350. package/dist/chunks/fetchModelList-fQDsmR3E.js +0 -1
  351. package/dist/chunks/fetchModelList-woVzIVde.js +0 -1
  352. package/dist/chunks/fileSuggestions-CRx1D6uk.js +0 -3
  353. package/dist/chunks/firstPartyEventLogger-B261Wksn.js +0 -3
  354. package/dist/chunks/firstPartyEventLogger-DtFTeHy-.js +0 -1
  355. package/dist/chunks/flushGate-BA8dSr0i.js +0 -1
  356. package/dist/chunks/gemini-BXAyy1JN.js +0 -1
  357. package/dist/chunks/generateSessionName-Cwmk2N3F.js +0 -1
  358. package/dist/chunks/git-Wid-XppW.js +0 -5
  359. package/dist/chunks/git-hO-TMvXc.js +0 -1
  360. package/dist/chunks/githubRepoPathMapping-OV8U1VFK.js +0 -1
  361. package/dist/chunks/goal-C9clrwEH.js +0 -3
  362. package/dist/chunks/grok-CjeCecsZ.js +0 -1
  363. package/dist/chunks/grove-DqTnK9nn.js +0 -7
  364. package/dist/chunks/hash-Tu-My5Vp.js +0 -1
  365. package/dist/chunks/help-Bb6LdzXK.js +0 -1
  366. package/dist/chunks/hooks-BX2s7aoL.js +0 -1
  367. package/dist/chunks/initReplBridge-D7cuY_os.js +0 -1
  368. package/dist/chunks/install-eCA8UACi.js +0 -1
  369. package/dist/chunks/instrumentation-BaRKojJh.js +0 -21
  370. package/dist/chunks/jwtUtils-JE2okZ70.js +0 -1
  371. package/dist/chunks/keybindings-iBqc1KHL.js +0 -1
  372. package/dist/chunks/launchLocalMemory-IZPGEzMk.js +0 -3
  373. package/dist/chunks/lazySchema-DULtBUCI.js +0 -65
  374. package/dist/chunks/lib-BlVGipXx.js +0 -14
  375. package/dist/chunks/loadAgentsDir-Bpke9CtB.js +0 -1
  376. package/dist/chunks/loadAgentsDir-C96o6gCj.js +0 -3422
  377. package/dist/chunks/loadPluginHooks-0nGlugZ4.js +0 -1
  378. package/dist/chunks/localSearch-dodgnjGn.js +0 -1
  379. package/dist/chunks/log-CZ7ploQm.js +0 -1
  380. package/dist/chunks/logoUtils-Cg_6QV1Z.js +0 -1
  381. package/dist/chunks/main-7ssnA9Yb.js +0 -31
  382. package/dist/chunks/main-BEv6MqMX.js +0 -356
  383. package/dist/chunks/managedEnv-CHYvwXBH.js +0 -1
  384. package/dist/chunks/managedEnv-CbjOQmEe.js +0 -1
  385. package/dist/chunks/mappers-D8VLUZ2N.js +0 -1
  386. package/dist/chunks/mcp-BUn3yqsT.js +0 -1
  387. package/dist/chunks/mcp-BskLq9iP.js +0 -2
  388. package/dist/chunks/mcp-C-0DMaXx.js +0 -6
  389. package/dist/chunks/memoize-CumjjK2Q.js +0 -1
  390. package/dist/chunks/memory-vDkJM58W.js +0 -1
  391. package/dist/chunks/mode-Dbh21H2Y.js +0 -2
  392. package/dist/chunks/model-BaMclMXn.js +0 -1
  393. package/dist/chunks/model-atn3_JBi.js +0 -1
  394. package/dist/chunks/model-vS1Iewyq.js +0 -1
  395. package/dist/chunks/modelOptions-Cw1ThINb.js +0 -1
  396. package/dist/chunks/nativeInstaller-CfZ5uNTh.js +0 -1
  397. package/dist/chunks/oauth-D38aRTUb.js +0 -1
  398. package/dist/chunks/oauth-U649LV5H.js +0 -1
  399. package/dist/chunks/omit-B7eQ9q0x.js +0 -1
  400. package/dist/chunks/onChangeAppState-kEAt8nxV.js +0 -1
  401. package/dist/chunks/openai-wh8AX5iz.js +0 -10
  402. package/dist/chunks/parser-Cq9X7HMP.js +0 -1
  403. package/dist/chunks/partition-CENvOfiS.js +0 -1
  404. package/dist/chunks/permissions-ChuIx-d4.js +0 -3
  405. package/dist/chunks/pidLock-C1hmh3YQ.js +0 -3
  406. package/dist/chunks/plugin-DVBEWwMP.js +0 -17
  407. package/dist/chunks/pluginAutoupdate-aLXhSUVD.js +0 -1
  408. package/dist/chunks/pluginBlocklist-BprCv0En.js +0 -1
  409. package/dist/chunks/pluginCliCommands-WzzqR1Sr.js +0 -1
  410. package/dist/chunks/pluginOperations-Ca9Lup5G.js +0 -2
  411. package/dist/chunks/pluginStartupCheck-DdtxcNwH.js +0 -1
  412. package/dist/chunks/plugins-DdIaXpNb.js +0 -4
  413. package/dist/chunks/pollConfig-2nFzv6Hy.js +0 -1
  414. package/dist/chunks/poorMode-ZIq2oz7q.js +0 -1
  415. package/dist/chunks/print-vxrRE1O2.js +0 -14
  416. package/dist/chunks/processBashCommand-ISucgwpi.js +0 -1
  417. package/dist/chunks/processSlashCommand-BnpXO_fI.js +0 -5
  418. package/dist/chunks/prompt-2AA5W7EH.js +0 -1
  419. package/dist/chunks/prompt-AXiS2LoO.js +0 -1
  420. package/dist/chunks/promptEditor-DT6egmcb.js +0 -4
  421. package/dist/chunks/rcDebugLog-DSchf3Hs.js +0 -1
  422. package/dist/chunks/reconciler-D3zyJCnV.js +0 -1
  423. package/dist/chunks/refresh-BSG0t4cf.js +0 -1
  424. package/dist/chunks/registerProtocol-BOEYaX-X.js +0 -1
  425. package/dist/chunks/reload-plugins-BFMRhbv8.js +0 -1
  426. package/dist/chunks/remoteBridgeCore-D5OwvmAz.js +0 -1
  427. package/dist/chunks/remoteManagedSettings-DyGVvvcW.js +0 -1
  428. package/dist/chunks/rename-BrEwj3Xw.js +0 -1
  429. package/dist/chunks/resume-DR5JbICs.js +0 -2
  430. package/dist/chunks/ripgrep-Dt4a91S5.js +0 -5
  431. package/dist/chunks/ripgrep-KTOU5s9J.js +0 -1
  432. package/dist/chunks/sandbox-adapter-BqDyWcol.js +0 -1
  433. package/dist/chunks/sandbox-toggle-B9f_0NQI.js +0 -1
  434. package/dist/chunks/searchExtraTools-2pIT2C8u.js +0 -1
  435. package/dist/chunks/session-wkRTfdo8.js +0 -2
  436. package/dist/chunks/sessionFileAccessHooks-DV22q9JO.js +0 -1
  437. package/dist/chunks/sessionIdCompat-Dgp6PW_1.js +0 -1
  438. package/dist/chunks/sessionObserver-BLJg0qm_.js +0 -1
  439. package/dist/chunks/sessionState-8jutEorw.js +0 -11
  440. package/dist/chunks/sessionStorage-DRV7IhZF.js +0 -1
  441. package/dist/chunks/sessionStoragePortable-x0Yn02-G.js +0 -3
  442. package/dist/chunks/sessionTracing-fIp8g04N.js +0 -11
  443. package/dist/chunks/settings-BowI3jp-.js +0 -19
  444. package/dist/chunks/settings-CHn0gJCG.js +0 -1
  445. package/dist/chunks/settingsSync-DF4JgSNc.js +0 -1
  446. package/dist/chunks/setup-UiEO9i7F.js +0 -3
  447. package/dist/chunks/shellQuote-Ddgr1vif.js +0 -4
  448. package/dist/chunks/sinks-DnLqRPEC.js +0 -1
  449. package/dist/chunks/sinks-mGBiINp8.js +0 -1
  450. package/dist/chunks/skillChangeDetector-Dc6YZXJE.js +0 -1
  451. package/dist/chunks/skills-DKtN17ch.js +0 -1
  452. package/dist/chunks/startupProfiler-B90b5vuq.js +0 -3
  453. package/dist/chunks/startupProfiler-DG2TN5R_.js +0 -1
  454. package/dist/chunks/state-BStOuCh4.js +0 -1
  455. package/dist/chunks/state-D5D6QpTX.js +0 -1
  456. package/dist/chunks/stats-D4LEtkrw.js +0 -1
  457. package/dist/chunks/status-0ZBx6Ls0.js +0 -2
  458. package/dist/chunks/status-BUJ4-omB.js +0 -1
  459. package/dist/chunks/statusNoticeHelpers-BrpQWj0l.js +0 -1
  460. package/dist/chunks/stringUtils-D7oJIyY2.js +0 -4
  461. package/dist/chunks/sts-C2Gf2WYN.js +0 -1
  462. package/dist/chunks/subprocessEnv-CNBOhlDV.js +0 -1
  463. package/dist/chunks/subprocessEnv-DtBCqQIo.js +0 -1
  464. package/dist/chunks/switcher-D7Ey5uIi.js +0 -1
  465. package/dist/chunks/syncCache-DUhciJLz.js +0 -1
  466. package/dist/chunks/teleport-DwZMevmQ.js +0 -1
  467. package/dist/chunks/terminalSetup-a7-BNS4T.js +0 -32
  468. package/dist/chunks/tmux-DA06aewY.js +0 -1
  469. package/dist/chunks/toolPool-mdsxlKWR.js +0 -1
  470. package/dist/chunks/trustedDevice-C1m--Yjw.js +0 -1
  471. package/dist/chunks/trustedDevice-CeDIk_ln.js +0 -1
  472. package/dist/chunks/types-APu4OCXJ.js +0 -17
  473. package/dist/chunks/udsClient-BcwsY0XE.js +0 -1
  474. package/dist/chunks/upstreamproxy-CTOuotLO.js +0 -10
  475. package/dist/chunks/useExitOnCtrlCDWithKeybindings-L5idX6Kz.js +0 -1
  476. package/dist/chunks/useMainLoopModel-VXeS2EC6.js +0 -1
  477. package/dist/chunks/useManagePlugins-CAXp5CfH.js +0 -1
  478. package/dist/chunks/useMergedTools-DYXrPTIA.js +0 -1
  479. package/dist/chunks/useSearchInput-Bxl4wGcZ.js +0 -1
  480. package/dist/chunks/useSettingsErrors-sbjsaT7k.js +0 -1
  481. package/dist/chunks/userAgent-NbKd-hN7.js +0 -1
  482. package/dist/chunks/util-DU63xTwZ.js +0 -1
  483. package/dist/chunks/validatePlugin-DQ_9OCpP.js +0 -1
  484. package/dist/chunks/vim-xruiCyUd.js +0 -1
  485. package/dist/chunks/which-B8rchd8P.js +0 -1
  486. package/dist/chunks/windowsPaths-BdhjMYTm.js +0 -1
  487. package/dist/chunks/windowsPaths-DtGZ83kH.js +0 -1
  488. package/dist/chunks/workSecret-CaM2yIJD.js +0 -1
  489. package/dist/chunks/workerRegistry-BBgquE8F.js +0 -2
  490. package/dist/chunks/worktree-C28I8mFB.js +0 -1
  491. /package/dist/chunks/{dist-es-Cgsa8pb82.js → dist-es-Cgsa8pb8.js} +0 -0
  492. /package/dist/chunks/{dist-es-Cwru7c2B2.js → dist-es-Cwru7c2B.js} +0 -0
  493. /package/dist/chunks/{dist-es-DXIR5NLi2.js → dist-es-DXIR5NLi.js} +0 -0
@@ -1 +0,0 @@
1
- import{o as e}from"./envUtils-DcaKZlRU.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{P as r,R as i,S as a,c as o,i as s,x as c}from"./debug-D58GQBDG.js";import{B as l,F as u,H as d,I as f,O as p,b as m,g as h,m as g,q as _}from"./log-CZ7ploQm.js";import{n as v,r as y}from"./analytics-DJobLaWP.js";import{T as b,et as x}from"./sessionState-8jutEorw.js";import{n as S,t as C}from"./rcDebugLog-DSchf3Hs.js";import{t as w}from"./controlMessageCompat-IFu4Gc1y.js";import{randomUUID as T}from"crypto";e();async function E(){return!1}function D(){return!1}function O(){return!0}function k(){return null}v(),b(),s(),C(),g(),i(),c(),_(),t();function A(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`}function j(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`control_response`&&`response`in e}function M(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`control_request`&&`request_id`in e&&`request`in e}function N(e){return(e.type===`user`||e.type===`assistant`)&&e.isVirtual?!1:e.type===`user`||e.type===`assistant`||e.type===`system`&&e.subtype===`local_command`}function P(e){if(e.type!==`user`||e.isMeta||e.toolUseResult||e.isCompactSummary||e.origin&&e.origin.kind!==`human`)return;let t=e.message.content,n;if(typeof t==`string`)n=t;else for(let e of t??[])if(e.type===`text`){n=e.text;break}if(n)return h(n)||void 0}var F=`system-reminder`,I=/\s*<([a-z][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>\s*/gy,L=new Set([m,p,u,f,l,d]);function R(e){let t=e.message?.content;return typeof t==`string`?t:Array.isArray(t)?t.filter(e=>!!e&&typeof e==`object`&&e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(``):``}function z(e){let t=e.trim();if(!t)return null;I.lastIndex=0;let n=[];for(;I.lastIndex<t.length;){let e=I.exec(t);if(!e)return null;n.push(e[1])}return n.length>0?n:null}function B(e){if(e.type!==`user`||e.isVisibleInTranscriptOnly)return!1;if(e.toolUseResult!==void 0||!e.isMeta)return!0;let t=z(R(e));return!t||t.some(e=>e!==`local-command-caveat`&&e!==F&&L.has(e))}function V(e){return e.some(B)}function H(e,t,n,i,s,c){try{let r=w(a(e));if(j(r)){o(`[bridge:repl] Ingress message type=control_response`),s?.(r);return}if(M(r)){o(`[bridge:repl] Inbound control_request subtype=${r.request.subtype}`),c?.(r);return}if(!A(r))return;let l=`uuid`in r&&typeof r.uuid==`string`?r.uuid:void 0;if(l&&t.has(l)){o(`[bridge:repl] Ignoring echo: type=${r.type} uuid=${l}`);return}if(l&&n.has(l)){o(`[bridge:repl] Ignoring re-delivered inbound: type=${r.type} uuid=${l}`);return}o(`[bridge:repl] Ingress message type=${r.type}${l?` uuid=${l}`:``}`),r.type===`user`?(l&&n.add(l),y(`tengu_bridge_message_received`,{is_repl:!0}),i?.(r)):o(`[bridge:repl] Ignoring non-user inbound message: type=${r.type}`)}catch(e){o(`[bridge:repl] Failed to parse ingress message: ${r(e)}`)}}var U=`This session is outbound-only. Enable Remote Control locally to allow inbound control.`;function W(e,t){let{transport:n,sessionId:r,outboundOnly:i,onInterrupt:a,onSetModel:s,onSetMaxThinkingTokens:c,onSetPermissionMode:l}=t;if(!n){o(`[bridge:repl] Cannot respond to control_request: transport not configured`);return}let u,d=e.request;if(i&&d.subtype!==`initialize`){u={type:`control_response`,response:{subtype:`error`,request_id:e.request_id,error:U}};let t={...u,session_id:r};n.write(t),o(`[bridge:repl] Rejected ${d.subtype} (outbound-only) request_id=${e.request_id}`);return}switch(d.subtype){case`initialize`:u={type:`control_response`,response:{subtype:`success`,request_id:e.request_id,response:{commands:[],output_style:`normal`,available_output_styles:[`normal`],models:[],account:{},pid:process.pid}}};break;case`set_model`:s?.(d.model),u={type:`control_response`,response:{subtype:`success`,request_id:e.request_id}};break;case`set_max_thinking_tokens`:c?.(d.max_thinking_tokens??null),u={type:`control_response`,response:{subtype:`success`,request_id:e.request_id}};break;case`set_permission_mode`:{let t=l?.(d.mode)??{ok:!1,error:`set_permission_mode is not supported in this context (onSetPermissionMode callback not registered)`};u=t.ok?{type:`control_response`,response:{subtype:`success`,request_id:e.request_id}}:{type:`control_response`,response:{subtype:`error`,request_id:e.request_id,error:t.error}};break}case`interrupt`:a?.(),u={type:`control_response`,response:{subtype:`success`,request_id:e.request_id}};break;default:u={type:`control_response`,response:{subtype:`error`,request_id:e.request_id,error:`REPL bridge does not handle control_request subtype: ${d.subtype}`}}}let f={...u,session_id:r};n.write(f),S(`control_response: subtype=${d.subtype} request_id=${e.request_id} result=${u.response.subtype}`),o(`[bridge:repl] Sent control_response for ${d.subtype} request_id=${e.request_id} result=${u.response.subtype}`)}function G(e){return{type:`result_success`,subtype:`success`,duration_ms:0,duration_api_ms:0,is_error:!1,num_turns:0,result:``,stop_reason:null,total_cost_usd:0,usage:{...x},modelUsage:{},permission_denials:[],session_id:e,uuid:T()}}var K=class{constructor(e){n(this,`capacity`,void 0),n(this,`ring`,void 0),n(this,`set`,new Set),n(this,`writeIdx`,0),this.capacity=e,this.ring=Array(e)}add(e){if(this.set.has(e))return;let t=this.ring[this.writeIdx];t!==void 0&&this.set.delete(t),this.ring[this.writeIdx]=e,this.set.add(e),this.writeIdx=(this.writeIdx+1)%this.capacity}has(e){return this.set.has(e)}clear(){this.set.clear(),this.ring.fill(void 0),this.writeIdx=0}};export{N as a,V as c,O as d,D as f,W as i,k as l,P as n,G as o,H as r,B as s,K as t,E as u};
@@ -1 +0,0 @@
1
- import{D as e,N as t,f as n,n as r,r as i,t as a}from"./lazySchema-DULtBUCI.js";import{B as o,C as s,R as c,S as l,c as u,i as d,x as f}from"./debug-D58GQBDG.js";import{c as p,l as m,m as h}from"./sessionStoragePortable-x0Yn02-G.js";import{dirname as g,join as _}from"path";import{mkdir as v,readFile as y,stat as b,unlink as x,writeFile as S}from"fs/promises";i(),d(),c(),a(),m(),f();var C=r(()=>e({sessionId:t(),environmentId:t(),source:n([`standalone`,`repl`])}));function w(e){return _(p(),h(e),`bridge-pointer.json`)}async function T(e,t){let n=w(e);try{await v(g(n),{recursive:!0}),await S(n,s(t),`utf8`),u(`[bridge:pointer] wrote ${n}`)}catch(e){u(`[bridge:pointer] write failed: ${e}`,{level:`warn`})}}async function E(e){let t=w(e),n,r;try{r=(await b(t)).mtimeMs,n=await y(t,`utf8`)}catch{return null}let i=C().safeParse(O(n));if(!i.success)return u(`[bridge:pointer] invalid schema, clearing: ${t}`),await D(e),null;let a=Math.max(0,Date.now()-r);return a>144e5?(u(`[bridge:pointer] stale (>4h mtime), clearing: ${t}`),await D(e),null):{...i.data,ageMs:a}}async function D(e){let t=w(e);try{await x(t),u(`[bridge:pointer] cleared ${t}`)}catch(e){o(e)||u(`[bridge:pointer] clear failed: ${e}`,{level:`warn`})}}function O(e){try{return l(e)}catch{return null}}export{D as clearBridgePointer,E as readBridgePointer,T as writeBridgePointer};
@@ -1 +0,0 @@
1
- import{Ix as e,Px as t}from"./loadAgentsDir-C96o6gCj.js";import{v as n}from"./startupProfiler-B90b5vuq.js";import{a as r,n as i,o as a}from"./bridgeConfig-C-bI-slm.js";e(),r(),n();function o(e,n){return`${a()?i():t(void 0,n)}/code?bridge=${e}`}function s({error:e,connected:t,sessionActive:n,reconnecting:r}){return e?{label:`Remote Control failed`,color:`error`}:r?{label:`Remote Control reconnecting`,color:`warning`}:n||t?{label:`Remote Control active`,color:`success`}:{label:`Remote Control connecting…`,color:`warning`}}function c(e){return`Code everywhere with the Work Mate app or ${e}`}function l(e){return`Continue coding in the Work Mate app or ${e}`}var u=`Something went wrong, please try again`;export{s as a,c as i,l as n,o as r,u as t};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{$f as n,C_ as r,GS as i,Ls as a,Rs as o,S_ as s,Yv as c,Zf as l,at as u,ea as d,fu as f,lb as p,ot as m,pu as h,ub as g,vw as _,w_ as v}from"./loadAgentsDir-C96o6gCj.js";import{I as y,P as b,ai as x,bn as S,ot as C,t as w,vn as T,xt as E}from"./src-DL3w8VPk.js";import{t as D}from"./jsx-runtime-Bb4Xn-E0.js";import{P as O,R as k}from"./debug-D58GQBDG.js";import{Ut as A}from"./settings-BowI3jp-.js";import{h as j,y as M}from"./config-DUTgj3js.js";import{Q as N}from"./sessionState-8jutEorw.js";import{n as P,r as F}from"./sideQuestion-C11KgNGL.js";import{i as I,n as L}from"./modalContext-DDZdU1J8.js";function R({question:e,context:t,onDone:n}){let[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(null),[s,c]=(0,H.useState)(0),u=(0,H.useRef)(null),{rows:d}=I(C());S(()=>c(e=>e+1),r||a?null:80);function m(e){if(e.key===`escape`||e.key===`return`||e.key===` `||e.ctrl&&(e.key===`c`||e.key===`d`)){e.preventDefault(),n(void 0,{display:`skip`});return}(e.key===`up`||e.ctrl&&e.key===`p`)&&(e.preventDefault(),u.current?.scrollBy(-3)),(e.key===`down`||e.ctrl&&e.key===`n`)&&(e.preventDefault(),u.current?.scrollBy(K))}(0,H.useEffect)(()=>{let n=p();async function r(){try{let r=await F({question:e,cacheSafeParams:await B(t)});n.signal.aborted||(r.response?i(r.response):o(`No response received`))}catch(e){n.signal.aborted||o(O(e)||`Failed to get response`)}}return r(),()=>{n.abort()}},[e,t]);let h=Math.max(5,d-W-G);return(0,U.jsxs)(y,{flexDirection:`column`,paddingLeft:2,marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:m,children:[(0,U.jsxs)(y,{children:[(0,U.jsxs)(b,{color:`warning`,bold:!0,children:[`/btw`,` `]}),(0,U.jsx)(b,{dimColor:!0,children:e})]}),(0,U.jsx)(y,{marginTop:1,marginLeft:2,maxHeight:h,children:(0,U.jsx)(E,{ref:u,flexDirection:`column`,flexGrow:1,children:a?(0,U.jsx)(b,{color:`error`,children:a}):r?(0,U.jsx)(l,{children:r}):(0,U.jsxs)(y,{children:[(0,U.jsx)(f,{frame:s,messageColor:`warning`}),(0,U.jsx)(b,{color:`warning`,children:`Answering...`})]})})}),(r||a)&&(0,U.jsx)(y,{marginTop:1,children:(0,U.jsxs)(b,{dimColor:!0,children:[`↑`,`/`,`↓`,` to scroll · Space, Enter, or Escape to dismiss`]})})]})}function z(e){let t=e.at(-1);return t?.type===`assistant`&&t.message.stop_reason===null?e.slice(0,-1):e}async function B(e){let t=_(z(e.messages)),n=a();if(n)return{systemPrompt:n.systemPrompt,userContext:n.userContext,systemContext:n.systemContext,toolUseContext:e,forkContextMessages:t};let[i,o,c]=await Promise.all([u(e.options.tools,e.options.mainLoopModel,[],e.options.mcpClients),r(),s()]);return{systemPrompt:N(i),userContext:o,systemContext:c,toolUseContext:e,forkContextMessages:t}}async function V(e,t,n){let r=n?.trim();return r?(M(e=>({...e,btwUseCount:e.btwUseCount+1})),(0,U.jsx)(R,{question:r,context:t,onDone:e})):(e(`Usage: /btw <your question>`,{display:`system`}),null)}var H,U,W,G,K;e((()=>{H=t(x(),1),T(),n(),h(),A(),m(),L(),v(),i(),w(),g(),j(),k(),o(),d(),P(),c(),U=D(),W=5,G=6,K=3}))();export{V as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";function t(){return process.versions.bun!==void 0}function n(){return typeof Bun<`u`&&Array.isArray(Bun.embeddedFiles)&&Bun.embeddedFiles.length>0}var r=e((()=>{}));export{n,t as r,r as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{C_ as t,D_ as n,Di as r,E_ as i,G as a,Ki as o,Li as s,Mp as c,Of as l,S_ as u,Sy as d,T_ as f,Xi as p,Xm as m,Y_ as h,Z_ as g,Zm as _,dm as v,kf as y,lm as b,ns as x,nu as S,oC as C,q as w,rs as T,sC as E,tu as D,w_ as O,x_ as k,xy as A}from"./loadAgentsDir-C96o6gCj.js";import{Dn as j,Ut as M,l as N}from"./state-D5D6QpTX.js";import{S as P,v as F}from"./git-Wid-XppW.js";import{i as I,t as L}from"./detectRepository-pRAVv8SH.js";import{a as R,n as z}from"./fileSuggestions-CRx1D6uk.js";import{r as B,t as V}from"./magicDocs-DmPNMnNY.js";function H(e=new Set){let n=e.size>0;t.cache.clear?.(),u.cache.clear?.(),k.cache.clear?.(),i.cache.clear?.(),z(),r(),n||g(),f(null),j(null),v(),T(),d(`session_start`),l(),D(),L(),a(),N(e),F(),o(),_(),V(),C(),import(`./SearchExtraToolsTool-vK2PP628.js`).then(({clearSearchExtraToolsDescriptionCache:e})=>e()),import(`./loadAgentsDir-Bpke9CtB.js`).then(({clearAgentDefinitionsCache:e})=>e()),import(`./prompt-AXiS2LoO.js`).then(({clearPromptCache:e})=>e())}var U=e((()=>{M(),s(),n(),O(),R(),c(),h(),S(),b(),m(),B(),p(),x(),w(),A(),I(),P(),y(),E()}));export{U as n,H as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./caches-CC5NHwAz.js";e();export{t as clearSessionCaches};
@@ -1,3 +0,0 @@
1
- import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{i,o as a,t as o}from"./debugUtils-DXBRbwCE.js";import{n as s,t as c}from"./rcDebugLog-DSchf3Hs.js";r(),a(),c();var l=1440*60*1e3,u=`Remote Control requires authentication.`,d=`Error: You must be logged in to use Remote Control.
2
-
3
- Remote Control requires authentication.`;e();var f=`environments-2025-11-01`,p=/^[a-zA-Z0-9_-]+$/;function m(e,t){if(!e||!p.test(e))throw Error(`Invalid ${t}: contains unsafe characters`);return e}var h=class extends Error{constructor(e,n,r){super(e),t(this,`status`,void 0),t(this,`errorType`,void 0),this.name=`BridgeFatalError`,this.status=n,this.errorType=r}};function g(e){function t(t){e.onDebug?.(t)}let r=0;function i(t){let n={Authorization:`Bearer ${t}`,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`,"anthropic-beta":f,"x-environment-runner-version":e.runnerVersion},r=e.getTrustedDeviceToken?.();return r&&(n[`X-Trusted-Device-Token`]=r),n}function a(){let t=e.getAccessToken();if(!t)throw Error(u);return t}async function c(n,r){let i=a(),o=await n(i);if(o.status!==401)return o;if(!e.onAuth401)return t(`[bridge:api] ${r}: 401 received, no refresh handler`),o;if(t(`[bridge:api] ${r}: 401 received, attempting token refresh`),await e.onAuth401(i)){t(`[bridge:api] ${r}: Token refreshed, retrying request`);let e=await n(a());if(e.status!==401)return e;t(`[bridge:api] ${r}: Retry after refresh also got 401`)}else t(`[bridge:api] ${r}: Token refresh failed`);return o}return{async registerBridgeEnvironment(r){t(`[bridge:api] POST /v1/environments/bridge bridgeId=${r.bridgeId}`);let a=await c(t=>n.post(`${e.baseUrl}/v1/environments/bridge`,{machine_name:r.machineName,directory:r.dir,branch:r.branch,git_repo_url:r.gitRepoUrl,max_sessions:r.maxSessions,metadata:{worker_type:r.workerType},...r.reuseEnvironmentId&&{environment_id:r.reuseEnvironmentId}},{headers:i(t),timeout:15e3,validateStatus:e=>e<500}),`Registration`);return _(a.status,a.data,`Registration`),t(`[bridge:api] POST /v1/environments/bridge -> ${a.status} environment_id=${a.data.environment_id}`),t(`[bridge:api] >>> ${o({machine_name:r.machineName,directory:r.dir,branch:r.branch,git_repo_url:r.gitRepoUrl,max_sessions:r.maxSessions,metadata:{worker_type:r.workerType}})}`),t(`[bridge:api] <<< ${o(a.data)}`),a.data},async pollForWork(a,c,l,u){m(a,`environmentId`);let d=r;r=0;let f=await n.get(`${e.baseUrl}/v1/environments/${a}/work/poll`,{headers:i(c),params:u===void 0?void 0:{reclaim_older_than_ms:u},timeout:1e4,signal:l,validateStatus:e=>e<500});return _(f.status,f.data,`Poll`),s(`poll response: status=${f.status} hasData=${!!f.data} url=${e.baseUrl}`),f.data?(t(`[bridge:api] GET .../work/poll -> ${f.status} workId=${f.data.id} type=${f.data.data?.type}${f.data.data?.id?` sessionId=${f.data.data.id}`:``}`),t(`[bridge:api] <<< ${o(f.data)}`),f.data):(r=d+1,(r===1||r%100==0)&&t(`[bridge:api] GET .../work/poll -> ${f.status} (no work, ${r} consecutive empty polls)`),null)},async acknowledgeWork(r,a,o){m(r,`environmentId`),m(a,`workId`),t(`[bridge:api] POST .../work/${a}/ack`);let s=await n.post(`${e.baseUrl}/v1/environments/${r}/work/${a}/ack`,{},{headers:i(o),timeout:1e4,validateStatus:e=>e<500});_(s.status,s.data,`Acknowledge`),t(`[bridge:api] POST .../work/${a}/ack -> ${s.status}`)},async stopWork(r,a,o){m(r,`environmentId`),m(a,`workId`),t(`[bridge:api] POST .../work/${a}/stop force=${o}`);let s=await c(t=>n.post(`${e.baseUrl}/v1/environments/${r}/work/${a}/stop`,{force:o},{headers:i(t),timeout:1e4,validateStatus:e=>e<500}),`StopWork`);_(s.status,s.data,`StopWork`),t(`[bridge:api] POST .../work/${a}/stop -> ${s.status}`)},async deregisterEnvironment(r){m(r,`environmentId`),t(`[bridge:api] DELETE /v1/environments/bridge/${r}`);let a=await c(t=>n.delete(`${e.baseUrl}/v1/environments/bridge/${r}`,{headers:i(t),timeout:1e4,validateStatus:e=>e<500}),`Deregister`);_(a.status,a.data,`Deregister`),t(`[bridge:api] DELETE /v1/environments/bridge/${r} -> ${a.status}`)},async archiveSession(r){m(r,`sessionId`),t(`[bridge:api] POST /v1/sessions/${r}/archive`);let a=await c(t=>n.post(`${e.baseUrl}/v1/sessions/${r}/archive`,{},{headers:i(t),timeout:1e4,validateStatus:e=>e<500}),`ArchiveSession`);if(a.status===409){t(`[bridge:api] POST /v1/sessions/${r}/archive -> 409 (already archived)`);return}_(a.status,a.data,`ArchiveSession`),t(`[bridge:api] POST /v1/sessions/${r}/archive -> ${a.status}`)},async reconnectSession(r,a){m(r,`environmentId`),m(a,`sessionId`),t(`[bridge:api] POST /v1/environments/${r}/bridge/reconnect session_id=${a}`);let o=await c(t=>n.post(`${e.baseUrl}/v1/environments/${r}/bridge/reconnect`,{session_id:a},{headers:i(t),timeout:1e4,validateStatus:e=>e<500}),`ReconnectSession`);_(o.status,o.data,`ReconnectSession`),t(`[bridge:api] POST .../bridge/reconnect -> ${o.status}`)},async heartbeatWork(r,a,o){m(r,`environmentId`),m(a,`workId`),t(`[bridge:api] POST .../work/${a}/heartbeat`);let s=await n.post(`${e.baseUrl}/v1/environments/${r}/work/${a}/heartbeat`,{},{headers:i(o),timeout:1e4,validateStatus:e=>e<500});return _(s.status,s.data,`Heartbeat`),t(`[bridge:api] POST .../work/${a}/heartbeat -> ${s.status} lease_extended=${s.data.lease_extended} state=${s.data.state}`),s.data},async sendPermissionResponseEvent(r,a,s){m(r,`sessionId`),t(`[bridge:api] POST /v1/sessions/${r}/events type=${a.type}`);let c=await n.post(`${e.baseUrl}/v1/sessions/${r}/events`,{events:[a]},{headers:i(s),timeout:1e4,validateStatus:e=>e<500});_(c.status,c.data,`SendPermissionResponseEvent`),t(`[bridge:api] POST /v1/sessions/${r}/events -> ${c.status}`),t(`[bridge:api] >>> ${o({events:[a]})}`),t(`[bridge:api] <<< ${o(c.data)}`)}}}function _(e,t,n){if(e===200||e===204)return;let r=i(t),a=b(t);switch(e){case 401:throw new h(`${n}: Authentication failed (401)${r?`: ${r}`:``}. ${u}`,401,a);case 403:throw new h(v(a)?"Remote Control session has expired. Please restart with `claude remote-control` or /remote-control.":`${n}: Access denied (403)${r?`: ${r}`:``}. Check your organization permissions.`,403,a);case 404:throw new h(r??`${n}: Not found (404). Remote Control may not be available for this organization.`,404,a);case 410:throw new h(r??"Remote Control session has expired. Please restart with `claude remote-control` or /remote-control.",410,a??`environment_expired`);case 429:throw Error(`${n}: Rate limited (429). Polling too frequently.`);default:throw Error(`${n}: Failed with status ${e}${r?`: ${r}`:``}`)}}function v(e){return e?e.includes(`expired`)||e.includes(`lifetime`):!1}function y(e){return e.status===403?e.message.includes(`external_poll_sessions`)||e.message.includes(`environments:manage`):!1}function b(e){if(e&&typeof e==`object`&&`error`in e&&e.error&&typeof e.error==`object`&&`type`in e.error&&typeof e.error.type==`string`)return e.error.type}function x(e){let t=new AbortController;function n(){t.abort(),t=new AbortController}function r(){let n=new AbortController,r=()=>n.abort();if(e.aborted||t.signal.aborted)return n.abort(),{signal:n.signal,cleanup:()=>{}};e.addEventListener(`abort`,r,{once:!0});let i=t.signal;return i.addEventListener(`abort`,r,{once:!0}),{signal:n.signal,cleanup:()=>{e.removeEventListener(`abort`,r),i.removeEventListener(`abort`,r)}}}return{signal:r,wake:n}}export{y as a,l as c,v as i,h as n,m as o,g as r,d as s,x as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{C as n,F as r,P as i,R as a,c as o,i as s,x as c}from"./debug-D58GQBDG.js";import{O as l,k as u}from"./git-Wid-XppW.js";import{dn as d,fn as f}from"./model-BaMclMXn.js";import{l as p,r as m}from"./proxy-BhIc7-mj.js";import{n as h,t as g}from"./userAgent-NbKd-hN7.js";import{C as _,S as v,f as y,g as b,u as x,x as S}from"./sessionState-8jutEorw.js";import{n as C}from"./jwtUtils-JE2okZ70.js";import{randomUUID as w}from"crypto";a(),s(),l(),p(),h(),d(),_(),x(),c(),e();var T=class extends Error{constructor(e,n){super(e),t(this,`retryAfterMs`,void 0),this.retryAfterMs=n}},E=class{constructor(e){t(this,`pending`,[]),t(this,`pendingAtClose`,0),t(this,`draining`,!1),t(this,`closed`,!1),t(this,`backpressureResolvers`,[]),t(this,`sleepResolve`,null),t(this,`flushResolvers`,[]),t(this,`droppedBatches`,0),t(this,`config`,void 0),this.config=e}get droppedBatchCount(){return this.droppedBatches}get pendingCount(){return this.closed?this.pendingAtClose:this.pending.length}async enqueue(e){if(this.closed)return;let t=Array.isArray(e)?e:[e];if(t.length!==0){for(;this.pending.length+t.length>this.config.maxQueueSize&&!this.closed;)await new Promise(e=>{this.backpressureResolvers.push(e)});this.closed||(this.pending.push(...t),this.drain())}}flush(){return this.pending.length===0&&!this.draining?Promise.resolve():(this.drain(),new Promise(e=>{this.flushResolvers.push(e)}))}close(){if(!this.closed){this.closed=!0,this.pendingAtClose=this.pending.length,this.pending=[],this.sleepResolve?.(),this.sleepResolve=null;for(let e of this.backpressureResolvers)e();this.backpressureResolvers=[];for(let e of this.flushResolvers)e();this.flushResolvers=[]}}async drain(){if(this.draining||this.closed)return;this.draining=!0;let e=0;try{for(;this.pending.length>0&&!this.closed;){let t=this.takeBatch();if(t.length!==0){try{await this.config.send(t),e=0}catch(n){if(e++,this.config.maxConsecutiveFailures!==void 0&&e>=this.config.maxConsecutiveFailures){this.droppedBatches++,this.config.onBatchDropped?.(t.length,e),e=0,this.releaseBackpressure();continue}this.pending=t.concat(this.pending);let r=n instanceof T?n.retryAfterMs:void 0;await this.sleep(this.retryDelay(e,r));continue}this.releaseBackpressure()}}}finally{if(this.draining=!1,this.pending.length===0){for(let e of this.flushResolvers)e();this.flushResolvers=[]}}}takeBatch(){let{maxBatchSize:e,maxBatchBytes:t}=this.config;if(t===void 0)return this.pending.splice(0,e);let r=0,i=0;for(;i<this.pending.length&&i<e;){let e;try{e=Buffer.byteLength(n(this.pending[i]))}catch{this.pending.splice(i,1);continue}if(i>0&&r+e>t)break;r+=e,i++}return this.pending.splice(0,i)}retryDelay(e,t){let n=Math.random()*this.config.jitterMs;return t===void 0?Math.min(this.config.baseDelayMs*2**(e-1),this.config.maxDelayMs)+n:Math.max(this.config.baseDelayMs,Math.min(t,this.config.maxDelayMs))+n}releaseBackpressure(){let e=this.backpressureResolvers;this.backpressureResolvers=[];for(let t of e)t()}sleep(e){return new Promise(t=>{this.sleepResolve=t,setTimeout((e,t)=>{e.sleepResolve=null,t()},e,this,t)})}};e();var D=class{constructor(e){t(this,`inflight`,null),t(this,`pending`,null),t(this,`closed`,!1),t(this,`config`,void 0),this.config=e}enqueue(e){this.closed||(this.pending=this.pending?O(this.pending,e):e,this.drain())}close(){this.closed=!0,this.pending=null}async drain(){if(this.inflight||this.closed||!this.pending)return;let e=this.pending;this.pending=null,this.inflight=this.sendWithRetry(e).then(()=>{this.inflight=null,this.pending&&!this.closed&&this.drain()})}async sendWithRetry(e){let t=e,n=0;for(;!this.closed;){if(await this.config.send(t))return;n++,await f(this.retryDelay(n)),this.pending&&!this.closed&&(t=O(t,this.pending),this.pending=null)}}retryDelay(e){return Math.min(this.config.baseDelayMs*2**(e-1),this.config.maxDelayMs)+Math.random()*this.config.jitterMs}};function O(e,t){let n={...e};for(let[e,r]of Object.entries(t))(e===`external_metadata`||e===`internal_metadata`)&&n[e]&&typeof n[e]==`object`&&typeof r==`object`&&r?n[e]={...n[e],...r}:n[e]=r;return n}d(),e();var k=2e4,A=100;function j(){return!0}var M=class extends Error{constructor(e){super(`CCRClient init failed: ${e}`),t(this,`reason`,void 0),this.reason=e}},N=10;function P(){return{byMessage:new Map,scopeToMessage:new Map}}function F(e){return`${e.session_id}:${e.parent_tool_use_id??``}`}function I(e,t){let n=[],r=new Map;for(let i of e){let e=i.event;switch(e.type){case`message_start`:{let r=e.message.id,a=t.scopeToMessage.get(F(i));a&&t.byMessage.delete(a),t.scopeToMessage.set(F(i),r),t.byMessage.set(r,[]),n.push(i);break}case`content_block_delta`:{let a=e.delta;if(a.type!==`text_delta`){n.push(i);break}let o=t.scopeToMessage.get(F(i)),s=o?t.byMessage.get(o):void 0;if(!s){n.push(i);break}let c=e.index,l=s[c]??(s[c]=[]);l.push(a.text);let u=r.get(l);if(u){u.event.delta={type:`text_delta`,text:l.join(``)};break}let d={type:`stream_event`,uuid:i.uuid,session_id:i.session_id,parent_tool_use_id:i.parent_tool_use_id,event:{type:`content_block_delta`,index:c,delta:{type:`text_delta`,text:l.join(``)}}};r.set(l,d),n.push(d);break}default:n.push(i)}}return n}function L(e,t){e.byMessage.delete(t.message.id);let n=F(t);e.scopeToMessage.get(n)===t.message.id&&e.scopeToMessage.delete(n)}var R=class{constructor(e,n,r){if(t(this,`workerEpoch`,0),t(this,`heartbeatIntervalMs`,void 0),t(this,`heartbeatJitterFraction`,void 0),t(this,`heartbeatTimer`,null),t(this,`heartbeatInFlight`,!1),t(this,`closed`,!1),t(this,`consecutiveAuthFailures`,0),t(this,`currentState`,null),t(this,`sessionBaseUrl`,void 0),t(this,`sessionId`,void 0),t(this,`http`,m({keepAlive:!0})),t(this,`streamEventBuffer`,[]),t(this,`streamEventTimer`,null),t(this,`streamTextAccumulator`,P()),t(this,`workerState`,void 0),t(this,`eventUploader`,void 0),t(this,`internalEventUploader`,void 0),t(this,`deliveryUploader`,void 0),t(this,`onEpochMismatch`,void 0),t(this,`getAuthHeaders`,void 0),this.onEpochMismatch=r?.onEpochMismatch??(()=>{process.exit(1)}),this.heartbeatIntervalMs=r?.heartbeatIntervalMs??k,this.heartbeatJitterFraction=r?.heartbeatJitterFraction??0,this.getAuthHeaders=r?.getAuthHeaders??S,n.protocol!==`http:`&&n.protocol!==`https:`)throw Error(`CCRClient: Expected http(s) URL, got ${n.protocol}`);let i=n.pathname.replace(/\/$/,``);this.sessionBaseUrl=`${n.protocol}//${n.host}${i}`,this.sessionId=i.split(`/`).pop()||``,this.workerState=new D({send:e=>this.request(`put`,`/worker`,{worker_epoch:this.workerEpoch,...e},`PUT worker`).then(e=>e.ok),baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.eventUploader=new E({maxBatchSize:100,maxBatchBytes:10*1024*1024,maxQueueSize:1e5,send:async e=>{let t=await this.request(`post`,`/worker/events`,{worker_epoch:this.workerEpoch,events:e},`client events`);if(!t.ok)throw new T(`client event POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.internalEventUploader=new E({maxBatchSize:100,maxBatchBytes:10*1024*1024,maxQueueSize:200,send:async e=>{let t=await this.request(`post`,`/worker/internal-events`,{worker_epoch:this.workerEpoch,events:e},`internal events`);if(!t.ok)throw new T(`internal event POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.deliveryUploader=new E({maxBatchSize:64,maxQueueSize:64,send:async e=>{let t=await this.request(`post`,`/worker/events/delivery`,{worker_epoch:this.workerEpoch,updates:e.map(e=>({event_id:e.eventId,status:e.status}))},`delivery batch`);if(!t.ok)throw new T(`delivery POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),e.setOnEvent(e=>{this.reportDelivery(e.event_id,`received`)})}async initialize(e){let t=Date.now();if(Object.keys(this.getAuthHeaders()).length===0)throw new M(`no_auth_headers`);if(e===void 0){let t=process.env.CLAUDE_CODE_WORKER_EPOCH;e=t?parseInt(t,10):NaN}if(isNaN(e))throw new M(`missing_epoch`);this.workerEpoch=e;let n=this.getWorkerState();if(!(await this.request(`put`,`/worker`,{worker_status:`idle`,worker_epoch:this.workerEpoch,external_metadata:{pending_action:null,task_summary:null,automation_state:null}},`PUT worker (init)`)).ok)throw new M(`worker_register_failed`);this.currentState=`idle`,this.startHeartbeat(),y(()=>{this.writeEvent({type:`keep_alive`})}),o(`CCRClient: initialized, epoch=${this.workerEpoch}`),u(`info`,`cli_worker_lifecycle_initialized`,{epoch:this.workerEpoch,duration_ms:Date.now()-t});let{metadata:r,durationMs:i}=await n;return this.closed||u(`info`,`cli_worker_state_restored`,{duration_ms:i,had_state:r!==null}),r}async getWorkerState(){let e=Date.now(),t=this.getAuthHeaders();return Object.keys(t).length===0?{metadata:null,durationMs:0}:{metadata:(await this.getWithRetry(`${this.sessionBaseUrl}/worker`,t,`worker_state`))?.worker?.external_metadata??null,durationMs:Date.now()-e}}async request(e,t,n,a,{timeout:s=1e4}={}){let c=this.getAuthHeaders();if(Object.keys(c).length===0)return{ok:!1};try{let r=await this.http[e](`${this.sessionBaseUrl}${t}`,n,{headers:{...c,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`,"User-Agent":g()},validateStatus:j,timeout:s});if(r.status>=200&&r.status<300)return this.consecutiveAuthFailures=0,{ok:!0};if(r.status===409&&this.handleEpochMismatch(),r.status===401||r.status===403){let e=v(),t=e?C(e):null;t!==null&&t*1e3<Date.now()&&(o(`CCRClient: session_token expired (exp=${new Date(t*1e3).toISOString()}) — no refresh was delivered, exiting`,{level:`error`}),u(`error`,`cli_worker_token_expired_no_refresh`),this.onEpochMismatch()),this.consecutiveAuthFailures++,this.consecutiveAuthFailures>=N&&(o(`CCRClient: ${this.consecutiveAuthFailures} consecutive auth failures with a valid-looking token — server-side auth unrecoverable, exiting`,{level:`error`}),u(`error`,`cli_worker_auth_failures_exhausted`),this.onEpochMismatch())}if(o(`CCRClient: ${a} returned ${r.status}`,{level:`warn`}),u(`warn`,`cli_worker_request_failed`,{method:e,path:t,status:r.status}),r.status===429){let e=r.headers?.[`retry-after`],t=typeof e==`string`?parseInt(e,10):NaN;if(!isNaN(t)&&t>=0)return{ok:!1,retryAfterMs:t*1e3}}return{ok:!1}}catch(n){return o(`CCRClient: ${a} failed: ${i(n)}`,{level:`warn`}),u(`warn`,`cli_worker_request_error`,{method:e,path:t,error_code:r(n)}),{ok:!1}}}reportState(e,t){e===this.currentState&&!t||(this.currentState=e,this.workerState.enqueue({worker_status:e,requires_action_details:t?{tool_name:t.tool_name,action_description:t.action_description,request_id:t.request_id}:null}))}reportMetadata(e){this.workerState.enqueue({external_metadata:e})}handleEpochMismatch(){o(`CCRClient: Epoch mismatch (409), shutting down`,{level:`error`}),u(`error`,`cli_worker_epoch_mismatch`),this.onEpochMismatch()}startHeartbeat(){this.stopHeartbeat();let e=()=>{let e=this.heartbeatIntervalMs*this.heartbeatJitterFraction*(2*Math.random()-1);this.heartbeatTimer=setTimeout(t,this.heartbeatIntervalMs+e)},t=()=>{this.sendHeartbeat(),this.heartbeatTimer!==null&&e()};e()}stopHeartbeat(){this.heartbeatTimer&&(clearTimeout(this.heartbeatTimer),this.heartbeatTimer=null)}async sendHeartbeat(){if(!this.heartbeatInFlight){this.heartbeatInFlight=!0;try{(await this.request(`post`,`/worker/heartbeat`,{session_id:this.sessionId,worker_epoch:this.workerEpoch},`Heartbeat`,{timeout:5e3})).ok&&o(`CCRClient: Heartbeat sent`)}finally{this.heartbeatInFlight=!1}}}async writeEvent(e){if(e.type===`stream_event`){this.streamEventBuffer.push(e),this.streamEventTimer||(this.streamEventTimer=setTimeout(()=>void this.flushStreamEventBuffer(),A));return}await this.flushStreamEventBuffer(),e.type===`assistant`&&L(this.streamTextAccumulator,e),await this.eventUploader.enqueue(this.toClientEvent(e))}toClientEvent(e){let t=e;return{payload:{...t,uuid:typeof t.uuid==`string`?t.uuid:w()}}}async flushStreamEventBuffer(){if(this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer.length===0)return;let e=this.streamEventBuffer;this.streamEventBuffer=[];let t=I(e,this.streamTextAccumulator);await this.eventUploader.enqueue(t.map(e=>({payload:e,ephemeral:!0})))}async writeInternalEvent(e,t,{isCompaction:n=!1,agentId:r}={}){let i={payload:{type:e,...t,uuid:typeof t.uuid==`string`?t.uuid:w()},...n&&{is_compaction:!0},...r&&{agent_id:r}};await this.internalEventUploader.enqueue(i)}flushInternalEvents(){return this.internalEventUploader.flush()}async flush(){return await this.flushStreamEventBuffer(),this.eventUploader.flush()}async readInternalEvents(){return this.paginatedGet(`/worker/internal-events`,{},`internal_events`)}async readSubagentInternalEvents(){return this.paginatedGet(`/worker/internal-events`,{subagents:`true`},`subagent_events`)}async paginatedGet(e,t,n){let r=this.getAuthHeaders();if(Object.keys(r).length===0)return null;let i=[],a;do{let o=new URL(`${this.sessionBaseUrl}${e}`);for(let[e,n]of Object.entries(t))o.searchParams.set(e,n);a&&o.searchParams.set(`cursor`,a);let s=await this.getWithRetry(o.toString(),r,n);if(!s)return null;i.push(...s.data??[]),a=s.next_cursor}while(a);return o(`CCRClient: Read ${i.length} internal events from ${e}${t.subagents?` (subagents)`:``}`),i}async getWithRetry(e,t,n){for(let n=1;n<=10;n++){let r;try{r=await this.http.get(e,{headers:{...t,"anthropic-version":`2023-06-01`,"User-Agent":g()},validateStatus:j,timeout:3e4})}catch(t){o(`CCRClient: GET ${e} failed (attempt ${n}/10): ${i(t)}`,{level:`warn`}),n<10&&await f(Math.min(500*2**(n-1),3e4)+Math.random()*500);continue}if(r.status>=200&&r.status<300)return r.data;r.status===409&&this.handleEpochMismatch(),o(`CCRClient: GET ${e} returned ${r.status} (attempt ${n}/10)`,{level:`warn`}),n<10&&await f(Math.min(500*2**(n-1),3e4)+Math.random()*500)}return o(`CCRClient: GET retries exhausted`,{level:`error`}),u(`error`,`cli_worker_get_retries_exhausted`,{context:n}),null}reportDelivery(e,t){this.deliveryUploader.enqueue({eventId:e,status:t})}getWorkerEpoch(){return this.workerEpoch}get internalEventsPending(){return this.internalEventUploader.pendingCount}close(){this.closed=!0,this.stopHeartbeat(),b(),this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer=[],this.streamTextAccumulator.byMessage.clear(),this.streamTextAccumulator.scopeToMessage.clear(),this.workerState.close(),this.eventUploader.close(),this.internalEventUploader.close(),this.deliveryUploader.close()}};export{M as n,E as r,R as t};
@@ -1 +0,0 @@
1
- import{F as e,R as t}from"./debug-D58GQBDG.js";import{o as n,s as r}from"./log-CZ7ploQm.js";import{i,o as a,t as o}from"./platform-DMQxcm4K.js";import{a as s,i as c,s as l,u}from"./types-APu4OCXJ.js";import{homedir as d}from"os";import{join as f}from"path";import{readFile as p,readdir as m,stat as h}from"fs/promises";s(),t(),l(),n(),a();async function g(){let e=i();if(!o.includes(e))throw Error(`Unsupported platform: ${e} - Work Mate Desktop integration only works on macOS and WSL.`);if(e===`macos`)return f(d(),`Library`,`Application Support`,`Work Mate`,`claude_desktop_config.json`);let t=process.env.USERPROFILE?process.env.USERPROFILE.replace(/\\/g,`/`):null;if(t){let e=`/mnt/c${t.replace(/^[A-Z]:/,``)}/AppData/Roaming/Work Mate/claude_desktop_config.json`;try{return await h(e),e}catch{}}try{let e=`/mnt/c/Users`;try{let t=await m(e,{withFileTypes:!0});for(let n of t){if(n.name===`Public`||n.name===`Default`||n.name===`Default User`||n.name===`All Users`)continue;let t=f(e,n.name,`AppData`,`Roaming`,`Work Mate`,`claude_desktop_config.json`);try{return await h(t),t}catch{}}}catch{}}catch(e){r(e)}throw Error(`Could not find Work Mate Desktop config file in Windows. Make sure Work Mate Desktop is installed on Windows.`)}async function _(){if(!o.includes(i()))throw Error(`Unsupported platform - Work Mate Desktop integration only works on macOS and WSL.`);try{let t=await g(),n;try{n=await p(t,{encoding:`utf8`})}catch(t){if(e(t)===`ENOENT`)return{};throw t}let r=u(n);if(!r||typeof r!=`object`)return{};let i=r.mcpServers;if(!i||typeof i!=`object`)return{};let a={};for(let[e,t]of Object.entries(i)){if(!t||typeof t!=`object`)continue;let n=c().safeParse(t);n.success&&(a[e]=n.data)}return a}catch(e){return r(e),{}}}export{_ as readClaudeDesktopMcpServers};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./bundledMode--fG1S62b.js";import{i as n,r}from"./shellQuote-Ddgr1vif.js";import{spawn as i}from"child_process";t(),r();function a(t){let n=[];for(let r=0;r<t.length;r++){let i=t[r];if(i===`-d`||i.startsWith(`-d `)||i.startsWith(`-d `)){n.push(i),i===`-d`&&r+1<t.length&&n.push(t[++r]);continue}if(i.startsWith(`-d`)&&i.includes(`:`)){n.push(i);continue}if(i===`--feature`){n.push(i),r+1<t.length&&n.push(t[++r]);continue}if(/^--inspect(-brk)?(=|$)/.test(i)){n.push(i);continue}if(i.startsWith(`--`)&&!i.includes(`=`)&&r+1<t.length){if(e())continue;n.push(i),n.push(t[++r]);continue}i.startsWith(`-`)&&!e()&&n.push(i)}return n}var o=Object.freeze(a(process.execArgv)),s=process.argv[1],c=process.execPath,l=process.platform===`win32`;function u(t,n){let r=n?.env??process.env,i=e()||!s?[...o,...t]:[...o,s,...t],a={...r};return l&&(process.env.CLAUDE_CODE_GIT_BASH_PATH&&!a.CLAUDE_CODE_GIT_BASH_PATH&&(a.CLAUDE_CODE_GIT_BASH_PATH=process.env.CLAUDE_CODE_GIT_BASH_PATH),process.env.SHELL&&!a.SHELL&&(a.SHELL=process.env.SHELL)),{execPath:c,args:i,env:a,windowsHide:l}}function d(e,t){return i(e.execPath,e.args,{...t,env:{...e.env,...t.env},windowsHide:e.windowsHide})}function f(e){return n([e.execPath,...e.args])}function p(){return o}function m(){return s}export{d as a,f as i,p as n,m as r,u as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,l as n}from"./proxy-BhIc7-mj.js";import{n as r,t as i}from"./openai-CR3CcjCE.js";function a(e){if(s)return s;let n=new r({apiKey:process.env.GROK_API_KEY||process.env.XAI_API_KEY||``,baseURL:process.env.GROK_BASE_URL||o,maxRetries:e?.maxRetries??0,timeout:parseInt(process.env.API_TIMEOUT_MS||`600000`,10),dangerouslyAllowBrowser:!0,fetchOptions:t({forAnthropicAPI:!1}),...e?.fetchOverride&&{fetch:e.fetchOverride}});return e?.fetchOverride||(s=n),n}var o,s,c=e((()=>{i(),n(),o=`https://api.x.ai/v1`,s=null}));export{c as n,a as t};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./client-C_jBL1yC.js";e();export{t as clearOpenAIClientCache};
@@ -1 +0,0 @@
1
- import{Dr as e,Or as t}from"./model-BaMclMXn.js";t();export{e as getOrganizationUUID};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./client-9uHzAmFH.js";e();export{t as getGrokClient};
@@ -1 +0,0 @@
1
- import{Di as e,Li as t,Mi as n}from"./loadAgentsDir-C96o6gCj.js";t();export{e as clearCommandsCache,n as getCommands};
@@ -1,2 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{C_ as t,Fg as n,Ig as r,Kf as i,M_ as a,N_ as o,O_ as s,Rg as c,S_ as l,US as u,V_ as d,WS as f,X_ as p,Y_ as m,am as h,at as g,b_ as _,dm as v,ea as y,hn as b,k_ as x,lm as S,ot as C,q_ as w,qf as T,rm as E,vw as D,w_ as O,y_ as k,zg as A}from"./loadAgentsDir-C96o6gCj.js";import{di as j,fi as M}from"./src-DL3w8VPk.js";import{Kt as N,Ut as P}from"./state-D5D6QpTX.js";import{L as F,R as I}from"./debug-D58GQBDG.js";import{o as L,s as R}from"./log-CZ7ploQm.js";function z(e,t){let n=i(`tip`),r=u(`app:toggleTranscript`,`Global`,`ctrl+o`),a=[...e.options.verbose?[]:[`(${r} to see full summary)`],...t?[t]:[],...n?[n]:[]];return j.dim(`Compacted ${a.join(`
2
- `)}`)}async function B(e,n){let r=e.getAppState(),i=await g(e.options.tools,e.options.mainLoopModel,Array.from(r.toolPermissionContext.additionalWorkingDirectories.keys()),e.options.mcpClients),a=k({mainThreadAgentDefinition:void 0,toolUseContext:e,customSystemPrompt:e.options.customSystemPrompt,defaultSystemPrompt:i,appendSystemPrompt:e.options.appendSystemPrompt}),[o,s]=await Promise.all([t(),l()]);return{systemPrompt:a,userContext:o,systemContext:s,toolUseContext:e,forkContextMessages:n}}var V;e((()=>{M(),P(),C(),O(),f(),m(),A(),a(),s(),S(),E(),d(),I(),b(),L(),y(),T(),_(),V=async(e,i)=>{let{abortController:a}=i,{messages:s}=i;if(s=D(s),s.length===0)throw Error(`No messages to compact`);let l=e.trim();try{if(!l){let e=await h(s,i.agentId);if(e)return t.cache.clear?.(),v(),p(i.options.querySource??`compact`,i.agentId),N(),o(),{type:`compact`,compactionResult:e,displayText:z(i)}}let e=(await x(s,i)).messages,n=await c(e,i,await B(i,e),!1,l,!1);return w(void 0),o(),t.cache.clear?.(),v(),{type:`compact`,compactionResult:n,displayText:z(i,n.userDisplayMessage)}}catch(e){throw a.signal.aborted?Error(`Compaction canceled.`):F(e,`Not enough messages to compact. Send a few more messages first, then try again.`)?Error(r):F(e,`Compaction interrupted · This may be due to network issues — please try again.`)?Error(n):(R(e),Error(`Error during compaction: ${e}`))}}}))();export{V as call};
@@ -1 +0,0 @@
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-B7n_dfP-.js";var i,a;e((()=>{n(),i=t(),a=async(e,t)=>(0,i.jsx)(r,{onClose:e,context:t,defaultTab:`Config`})}))();export{a as call};
@@ -1,3 +0,0 @@
1
- import{i as e,n as t,t as n}from"./rolldown-runtime-DaDcL9Zw.js";import{n as r,t as i}from"./isObject-C6qM3WEW.js";import{n as a,t as o}from"./memoize-BK3gG5ob.js";import{c as s,i as c,l,o as u}from"./envUtils-DcaKZlRU.js";import{t as d}from"./graceful-fs-DDVg0cja.js";import{$ as f,Ar as p,Dr as m,Er as h,Nr as g,Or as _,Pr as v,Si as ee,Sr as te,Tr as ne,Ut as re,_i as ie,ai as ae,di as oe,fi as se,ht as ce,kr as le,mi as ue,oi as de,pi as fe,rt as pe,vi as me,xi as he,xr as ge}from"./state-D5D6QpTX.js";import{n as _e,t as ve}from"./cwd-Nh5IZNKO.js";import{C as y,F as b,O as x,R as ye,S as be,c as S,f as xe,i as Se,nt as Ce,tt as we,u as C,x as Te}from"./debug-D58GQBDG.js";import{Cn as Ee,Cr as De,Dr as Oe,Er as ke,Jt as Ae,Pn as je,Sr as Me,Yt as Ne,Zt as Pe,_r as Fe,cr as w,gr as Ie,h as Le,qt as T,s as E,sr as Re,t as ze}from"./settings-BowI3jp-.js";import{O as Be,k as Ve,m as He,n as Ue}from"./git-Wid-XppW.js";import{d as We,o as Ge,s as Ke,u as qe}from"./log-CZ7ploQm.js";import{m as Je}from"./sessionStoragePortable-x0Yn02-G.js";import{f as Ye,p as Xe,s as Ze,u as Qe}from"./types-APu4OCXJ.js";import{n as $e,r as D}from"./analytics-DJobLaWP.js";import{homedir as et}from"os";import{basename as O,dirname as k,isAbsolute as tt,join as A,normalize as j,resolve as nt,sep as rt}from"path";import{unwatchFile as it,watchFile as at}from"fs";import{randomBytes as ot}from"crypto";var M,st=t((()=>{ee(),Fe(),se(),fe(),M=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)he(t,oe(e)),e=Ie(e);return t}:ue}));function ct(e){return ie(e,De,M)}var lt=t((()=>{me(),st(),Me()}));function ut(){let e=process.env.CLAUDE_CODE_DISABLE_AUTO_MEMORY;if(l(e))return!1;if(s(e))return!0;if(l(process.env.CLAUDE_CODE_SIMPLE)||l(process.env.CLAUDE_CODE_REMOTE)&&!process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR)return!1;let t=ze();return t.autoMemoryEnabled===void 0||t.autoMemoryEnabled}function dt(){return!1}function ft(){return process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR?process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR:c()}function pt(e,t){if(!e)return;let n=e;if(t&&(n.startsWith(`~/`)||n.startsWith(`~\\`))){let e=n.slice(2),t=j(e||`.`);if(t===`.`||t===`..`)return;n=A(et(),e)}let r=j(n).replace(/[/\\]+$/,``);if(!(!tt(r)||r.length<3||/^[A-Za-z]:$/.test(r)||r.startsWith(`\\\\`)||r.startsWith(`//`)||r.includes(`\0`)))return(r+rt).normalize(`NFC`)}function mt(){return pt(process.env.CLAUDE_COWORK_MEMORY_PATH_OVERRIDE,!1)}function ht(){return pt(E(`policySettings`)?.autoMemoryDirectory??E(`flagSettings`)?.autoMemoryDirectory??E(`localSettings`)?.autoMemoryDirectory??E(`userSettings`)?.autoMemoryDirectory,!0)}function gt(){return mt()!==void 0}function _t(){return Ue(pe())??pe()}function vt(){return A(N(),xt)}function yt(e){return j(e).startsWith(N())}var bt,xt,N,St=t((()=>{o(),re(),u(),He(),Re(),Le(),bt=`memory`,xt=`MEMORY.md`,N=a(()=>(mt()??ht())||(A(A(ft(),`projects`),Je(_t()),bt)+rt).normalize(`NFC`),()=>pe())}));function Ct(e,t,n,i){if(!r(e))return e;t=le(t,e);for(var a=-1,o=t.length,s=o-1,c=e;c!=null&&++a<o;){var l=_(t[a]),u=n;if(l===`__proto__`||l===`constructor`||l===`prototype`)return e;if(a!=s){var d=c[l];u=i?i(d,l,c):void 0,u===void 0&&(u=r(d)?d:de(t[a+1])?[]:{})}ke(c,l,u),c=c[l]}return e}var wt=t((()=>{Oe(),p(),ae(),i(),m()}));function Tt(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=ne(e,o);n(s,o)&&Ct(a,le(o,e),s)}return a}var Et=t((()=>{h(),wt(),p()}));function P(e,t){if(e==null)return{};var n=g(ct(e),function(e){return[e]});return t=ge(t),Tt(e,n,function(e,n){return t(e,n[0])})}var Dt=t((()=>{v(),te(),Et(),lt()})),Ot=n(((e,t)=>{function n(e,t){typeof t==`boolean`&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error(`RetryOperation timeout occurred`)),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),n=this._timeouts.shift();else return!1;var r=this,i=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n);return this._options.unref&&i.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log(`Using RetryOperation.try() is deprecated`),this.attempt(e)},n.prototype.start=function(e){console.log(`Using RetryOperation.start() is deprecated`),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var i=this._errors[r],a=i.message,o=(e[a]||0)+1;e[a]=o,o>=n&&(t=i,n=o)}return t}})),kt=n((e=>{var t=Ot();e.operation=function(n){return new t(e.timeouts(n),{forever:n&&n.forever,unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);for(var r=[],i=0;i<t.retries;i++)r.push(this.createTimeout(i,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(i,t)),r.sort(function(e,t){return e-t}),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*t.minTimeout*t.factor**+e);return r=Math.min(r,t.maxTimeout),r},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var i in r=[],t)typeof t[i]==`function`&&r.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];t[o]=function(r){var i=e.operation(n),a=Array.prototype.slice.call(arguments,1),o=a.pop();a.push(function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),o.apply(this,arguments))}),i.attempt(function(){r.apply(t,a)})}.bind(t,s),t[o].options=n}}})),At=n(((e,t)=>{t.exports=kt()})),jt=n(((e,t)=>{t.exports=[`SIGABRT`,`SIGALRM`,`SIGHUP`,`SIGINT`,`SIGTERM`],process.platform!==`win32`&&t.exports.push(`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&t.exports.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`,`SIGUNUSED`)})),Mt=n(((t,n)=>{var r=global.process,i=function(e){return e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`};if(!i(r))n.exports=function(){return function(){}};else{var a=e(`assert`),o=jt(),s=/^win/i.test(r.platform),c=e(`events`);typeof c!=`function`&&(c=c.EventEmitter);var l;r.__signal_exit_emitter__?l=r.__signal_exit_emitter__:(l=r.__signal_exit_emitter__=new c,l.count=0,l.emitted={}),l.infinite||(l.setMaxListeners(1/0),l.infinite=!0),n.exports=function(e,t){if(!i(global.process))return function(){};a.equal(typeof e,`function`,`a callback must be provided for exit handler`),p===!1&&m();var n=`exit`;return t&&t.alwaysLast&&(n=`afterexit`),l.on(n,e),function(){l.removeListener(n,e),l.listeners(`exit`).length===0&&l.listeners(`afterexit`).length===0&&u()}};var u=function(){!p||!i(global.process)||(p=!1,o.forEach(function(e){try{r.removeListener(e,f[e])}catch{}}),r.emit=_,r.reallyExit=h,--l.count)};n.exports.unload=u;var d=function(e,t,n){l.emitted[e]||(l.emitted[e]=!0,l.emit(e,t,n))},f={};o.forEach(function(e){f[e]=function(){i(global.process)&&r.listeners(e).length===l.count&&(u(),d(`exit`,null,e),d(`afterexit`,null,e),s&&e===`SIGHUP`&&(e=`SIGINT`),r.kill(r.pid,e))}}),n.exports.signals=function(){return o};var p=!1,m=function(){p||!i(global.process)||(p=!0,l.count+=1,o=o.filter(function(e){try{return r.on(e,f[e]),!0}catch{return!1}}),r.emit=v,r.reallyExit=g)};n.exports.load=m;var h=r.reallyExit,g=function(e){i(global.process)&&(r.exitCode=e||0,d(`exit`,r.exitCode,null),d(`afterexit`,r.exitCode,null),h.call(r,r.exitCode))},_=r.emit,v=function(e,t){if(e===`exit`&&i(global.process)){t!==void 0&&(r.exitCode=t);var n=_.apply(this,arguments);return d(`exit`,r.exitCode,null),d(`afterexit`,r.exitCode,null),n}else return _.apply(this,arguments)}}})),Nt=n(((e,t)=>{var n=Symbol();function r(e,t,r){let i=t[n];if(i)return t.stat(e,(e,t)=>{if(e)return r(e);r(null,t.mtime,i)});let a=new Date(Math.ceil(Date.now()/1e3)*1e3+5);t.utimes(e,a,a,i=>{if(i)return r(i);t.stat(e,(e,i)=>{if(e)return r(e);let a=i.mtime.getTime()%1e3==0?`s`:`ms`;Object.defineProperty(t,n,{value:a}),r(null,i.mtime,a)})})}function i(e){let t=Date.now();return e===`s`&&(t=Math.ceil(t/1e3)*1e3),new Date(t)}t.exports.probe=r,t.exports.getMtime=i})),Pt=n(((t,n)=>{var r=e(`path`),i=d(),a=At(),o=Mt(),s=Nt(),c={};function l(e,t){return t.lockfilePath||`${e}.lock`}function u(e,t,n){if(!t.realpath)return n(null,r.resolve(e));t.fs.realpath(e,n)}function f(e,t,n){let r=l(e,t);t.fs.mkdir(r,i=>{if(!i)return s.probe(r,t.fs,(e,i,a)=>{if(e)return t.fs.rmdir(r,()=>{}),n(e);n(null,i,a)});if(i.code!==`EEXIST`)return n(i);if(t.stale<=0)return n(Object.assign(Error(`Lock file is already being held`),{code:`ELOCKED`,file:e}));t.fs.stat(r,(r,i)=>{if(r)return r.code===`ENOENT`?f(e,{...t,stale:0},n):n(r);if(!p(i,t))return n(Object.assign(Error(`Lock file is already being held`),{code:`ELOCKED`,file:e}));m(e,t,r=>{if(r)return n(r);f(e,{...t,stale:0},n)})})})}function p(e,t){return e.mtime.getTime()<Date.now()-t.stale}function m(e,t,n){t.fs.rmdir(l(e,t),e=>{if(e&&e.code!==`ENOENT`)return n(e);n()})}function h(e,t){let n=c[e];n.updateTimeout||(n.updateDelay=n.updateDelay||t.update,n.updateTimeout=setTimeout(()=>{n.updateTimeout=null,t.fs.stat(n.lockfilePath,(r,i)=>{let a=n.lastUpdate+t.stale<Date.now();if(r)return r.code===`ENOENT`||a?g(e,n,Object.assign(r,{code:`ECOMPROMISED`})):(n.updateDelay=1e3,h(e,t));if(n.mtime.getTime()!==i.mtime.getTime())return g(e,n,Object.assign(Error(`Unable to update lock within the stale threshold`),{code:`ECOMPROMISED`}));let o=s.getMtime(n.mtimePrecision);t.fs.utimes(n.lockfilePath,o,o,r=>{let i=n.lastUpdate+t.stale<Date.now();if(!n.released){if(r)return r.code===`ENOENT`||i?g(e,n,Object.assign(r,{code:`ECOMPROMISED`})):(n.updateDelay=1e3,h(e,t));n.mtime=o,n.lastUpdate=Date.now(),n.updateDelay=null,h(e,t)}})})},n.updateDelay),n.updateTimeout.unref&&n.updateTimeout.unref())}function g(e,t,n){t.released=!0,t.updateTimeout&&clearTimeout(t.updateTimeout),c[e]===t&&delete c[e],t.options.onCompromised(n)}function _(e,t,n){t={stale:1e4,update:null,realpath:!0,retries:0,fs:i,onCompromised:e=>{throw e},...t},t.retries=t.retries||0,t.retries=typeof t.retries==`number`?{retries:t.retries}:t.retries,t.stale=Math.max(t.stale||0,2e3),t.update=t.update==null?t.stale/2:t.update||0,t.update=Math.max(Math.min(t.update,t.stale/2),1e3),u(e,t,(e,r)=>{if(e)return n(e);let i=a.operation(t.retries);i.attempt(()=>{f(r,t,(e,a,o)=>{if(i.retry(e))return;if(e)return n(i.mainError());let s=c[r]={lockfilePath:l(r,t),mtime:a,mtimePrecision:o,options:t,lastUpdate:Date.now()};h(r,t),n(null,e=>{if(s.released)return e&&e(Object.assign(Error(`Lock is already released`),{code:`ERELEASED`}));v(r,{...t,realpath:!1},e)})})})})}function v(e,t,n){t={fs:i,realpath:!0,...t},u(e,t,(e,r)=>{if(e)return n(e);let i=c[r];if(!i)return n(Object.assign(Error(`Lock is not acquired/owned by you`),{code:`ENOTACQUIRED`}));i.updateTimeout&&clearTimeout(i.updateTimeout),i.released=!0,delete c[r],m(r,t,n)})}function ee(e,t,n){t={stale:1e4,realpath:!0,fs:i,...t},t.stale=Math.max(t.stale||0,2e3),u(e,t,(e,r)=>{if(e)return n(e);t.fs.stat(l(r,t),(e,r)=>e?e.code===`ENOENT`?n(null,!1):n(e):n(null,!p(r,t)))})}function te(){return c}o(()=>{for(let e in c){let t=c[e].options;try{t.fs.rmdirSync(l(e,t))}catch{}}}),n.exports.lock=_,n.exports.unlock=v,n.exports.check=ee,n.exports.getLocks=te})),Ft=n(((e,t)=>{var n=d();function r(e){let t=[`mkdir`,`realpath`,`stat`,`rmdir`,`utimes`],n={...e};return t.forEach(t=>{n[t]=(...n)=>{let r=n.pop(),i;try{i=e[`${t}Sync`](...n)}catch(e){return r(e)}r(null,i)}}),n}function i(e){return(...t)=>new Promise((n,r)=>{t.push((e,t)=>{e?r(e):n(t)}),e(...t)})}function a(e){return(...t)=>{let n,r;if(t.push((e,t)=>{n=e,r=t}),e(...t),n)throw n;return r}}function o(e){if(e={...e},e.fs=r(e.fs||n),typeof e.retries==`number`&&e.retries>0||e.retries&&typeof e.retries.retries==`number`&&e.retries.retries>0)throw Object.assign(Error(`Cannot use retries with the sync api`),{code:`ESYNC`});return e}t.exports={toPromise:i,toSync:a,toSyncOptions:o}})),It=n(((e,t)=>{var n=Pt(),{toPromise:r,toSync:i,toSyncOptions:a}=Ft();async function o(e,t){return r(await r(n.lock)(e,t))}function s(e,t){return i(i(n.lock)(e,a(t)))}function c(e,t){return r(n.unlock)(e,t)}function l(e,t){return i(n.unlock)(e,a(t))}function u(e,t){return r(n.check)(e,t)}function d(e,t){return i(n.check)(e,a(t))}t.exports=o,t.exports.lock=o,t.exports.unlock=c,t.exports.lockSync=s,t.exports.unlockSync=l,t.exports.check=u,t.exports.checkSync=d}));function F(){return I||(I=It()),I}function Lt(e,t){return F().lock(e,t)}function Rt(e,t){return F().lockSync(e,t)}function zt(e,t){return F().check(e,t)}var I,Bt=t((()=>{}));function L(){return{numStartups:0,installMethod:void 0,autoUpdates:void 0,theme:`dark`,preferredNotifChannel:`auto`,verbose:!1,editorMode:`normal`,autoCompactEnabled:!0,showTurnDuration:!0,hasSeenTasksHint:!1,hasUsedStash:!1,hasUsedBackgroundTask:!1,queuedCommandUpHintCount:0,diffTool:`auto`,customApiKeyResponses:{approved:[],rejected:[]},env:{},tipsHistory:{},memoryUsageCount:0,promptQueueUseCount:0,btwUseCount:0,todoFeatureEnabled:!0,showExpandedTodos:!1,messageIdleNotifThresholdMs:6e4,autoConnectIde:!1,autoInstallIdeExtension:!0,fileCheckpointingEnabled:!0,terminalProgressBarEnabled:!0,cachedStatsigGates:{},cachedDynamicConfigs:{},respectGitignore:!0}}function Vt(){return dn||(dn=Ht())}function Ht(){if(ce())return!0;let e=H(),t=$();if(e.projects?.[t]?.hasTrustDialogAccepted)return!0;let n=w(ve());for(;;){if(e.projects?.[n]?.hasTrustDialogAccepted)return!0;let t=w(nt(n,`..`));if(t===n)break;n=t}return!1}function R(e){let t=q.config;if(!t)return!1;let n=t.oauthAccount!==void 0&&e.oauthAccount===void 0,r=t.hasCompletedOnboarding===!0&&e.hasCompletedOnboarding!==!0;return n||r}function z(e){let t=null;try{Yt(T(),L,n=>{let r=e(n);return r===n?n:(t={...r,projects:Wt(n.projects)},t)})&&t&&V(t)}catch(n){S(`Failed to save config with lock: ${n}`,{level:`error`});let r=U(T(),L);if(R(r)){S(`saveGlobalConfig fallback: re-read config is missing auth that cache has; refusing to write. See GH #3117.`,{level:`error`}),D(`tengu_config_auth_loss_prevented`,{});return}let i=e(r);if(i===r)return;t={...i,projects:Wt(r.projects)},Jt(T(),t,K),V(t)}}function Ut(){let e=Y+X;e>0&&D(`tengu_config_cache_stats`,{cache_hits:Y,cache_misses:X,hit_rate:Y/e}),Y=0,X=0}function B(e){if(e.installMethod!==void 0)return e;let t=e,n=`unknown`,r=e.autoUpdates??!0;switch(t.autoUpdaterStatus){case`migrated`:n=`local`;break;case`installed`:n=`native`;break;case`disabled`:r=!1;break;case`enabled`:case`no_permissions`:case`not_configured`:n=`global`;break;case void 0:break}return{...e,installMethod:n,autoUpdates:r}}function Wt(e){if(!e)return e;let t={},n=!1;for(let[r,i]of Object.entries(e)){let e=i;if(e.history!==void 0){n=!0;let{history:i,...a}=e;t[r]=a}else t[r]=i}return n?t:e}function Gt(){if(Z)return;Z=!0;let e=T();at(e,{interval:pn,persistent:!1},t=>{t.mtimeMs<=q.mtime||C().readFile(e,{encoding:`utf-8`}).then(e=>{if(t.mtimeMs<=q.mtime)return;let n=Qe(Xe(e));typeof n!=`object`||!n||(q={config:B({...L(),...n}),mtime:t.mtimeMs},J={mtime:t.mtimeMs,size:t.size})}).catch(()=>{})}),Ce(async()=>{it(e),Z=!1})}function V(e){q={config:e,mtime:Date.now()},J=null}function H(){if(q.config)return Y++,q.config;X++;try{let e=null;try{e=C().statSync(T())}catch{}let t=B(U(T(),L));return q={config:t,mtime:e?.mtimeMs??Date.now()},J=e?{mtime:e.mtimeMs,size:e.size}:null,Gt(),t}catch{return B(U(T(),L))}}function Kt(){let e=H().remoteControlAtStartup;return e!==void 0&&e}function qt(e){let t=H();return t.customApiKeyResponses?.approved?.includes(e)?`approved`:t.customApiKeyResponses?.rejected?.includes(e)?`rejected`:`new`}function Jt(e,t,n){let r=k(e);C().mkdirSync(r),je(e,y(P(t,(e,t)=>y(e)!==y(n[t])),null,2),{encoding:`utf-8`,mode:384}),e===T()&&fn++}function Yt(e,t,n){let r=t(),i=k(e),a=C();a.mkdirSync(i);let o;try{let i=`${e}.lock`,s=Date.now();o=Rt(e,{lockfilePath:i,onCompromised:e=>{S(`Config lock compromised: ${e}`,{level:`error`})}});let c=Date.now()-s;if(c>100&&(S(`Lock acquisition took longer than expected - another Work Mate instance may be running`),D(`tengu_config_lock_contention`,{lock_time_ms:c})),J&&e===T())try{let t=a.statSync(e);(t.mtimeMs!==J.mtime||t.size!==J.size)&&D(`tengu_config_stale_write`,{read_mtime:J.mtime,write_mtime:t.mtimeMs,read_size:J.size,write_size:t.size})}catch(e){if(b(e)!==`ENOENT`)throw e}let l=U(e,t);if(e===T()&&R(l))return S(`saveConfigWithLock: re-read config is missing auth that cache has; refusing to write to avoid wiping ~/.workmate.json. See GH #3117.`,{level:`error`}),D(`tengu_config_auth_loss_prevented`,{}),!1;let u=n(l);if(u===l)return!1;let d=P(u,(e,t)=>y(e)!==y(r[t]));try{let t=O(e),n=Zt();try{a.mkdirSync(n)}catch(e){if(b(e)!==`EEXIST`)throw e}let r=a.readdirStringSync(n).filter(e=>e.startsWith(`${t}.backup.`)).sort().reverse(),i=r[0],o=i?Number(i.split(`.backup.`).pop()):0,s=Number.isNaN(o)||Date.now()-o>=6e4;if(s){let r=A(n,`${t}.backup.${Date.now()}`);a.copyFileSync(e,r)}let c=s?a.readdirStringSync(n).filter(e=>e.startsWith(`${t}.backup.`)).sort().reverse():r;for(let e of c.slice(5))try{a.unlinkSync(A(n,e))}catch{}}catch(e){b(e)!==`ENOENT`&&S(`Failed to backup config: ${e}`,{level:`error`})}return je(e,y(d,null,2),{encoding:`utf-8`,mode:384}),e===T()&&fn++,!0}finally{o&&o()}}function Xt(){if(Q)return;let e=Date.now();Ve(`info`,`enable_configs_started`),Q=!0,U(T(),L,!0),Ve(`info`,`enable_configs_completed`,{duration_ms:Date.now()-e})}function Zt(){return A(c(),`backups`)}function Qt(e){let t=C(),n=O(e),r=Zt();try{let e=t.readdirStringSync(r).filter(e=>e.startsWith(`${n}.backup.`)).sort().at(-1);if(e)return A(r,e)}catch{}let i=k(e);try{let r=t.readdirStringSync(i).filter(e=>e.startsWith(`${n}.backup.`)).sort().at(-1);if(r)return A(i,r);let a=`${e}.backup`;try{return t.statSync(a),a}catch{}}catch{}return null}function U(e,t,n){if(!Q)throw Error(`Config accessed before allowed.`);let r=C();try{let n=r.readFileSync(e,{encoding:`utf-8`});try{let e=be(Xe(n));return{...t(),...e}}catch(n){throw new x(n instanceof Error?n.message:String(n),e,t())}}catch(i){if(b(i)===`ENOENT`){let n=Qt(e);return n&&process.stderr.write(`\nWork Mate configuration file not found at: ${e}\nA backup file exists at: ${n}\nYou can manually restore it by running: cp "${n}" "${e}"\n\n`),t()}if(i instanceof x&&n)throw i;if(i instanceof x){if(S(`Config file corrupted, resetting to defaults: ${i.message}`,{level:`error`}),!W){W=!0;try{Ke(i);let t=!1;try{r.statSync(`${e}.backup`),t=!0}catch{}D(`tengu_config_parse_error`,{has_backup:t})}finally{W=!1}}process.stderr.write(`\nWork Mate configuration file at ${e} is corrupted: ${i.message}\n`);let t=O(e),n=Zt();try{r.mkdirSync(n)}catch(e){if(b(e)!==`EEXIST`)throw e}let a=r.readdirStringSync(n).filter(e=>e.startsWith(`${t}.corrupted.`)),o,s=!1,c=r.readFileSync(e,{encoding:`utf-8`});for(let e of a)try{if(c===r.readFileSync(A(n,e),{encoding:`utf-8`})){s=!0;break}}catch{}if(!s){o=A(n,`${t}.corrupted.${Date.now()}`);try{r.copyFileSync(e,o),S(`Corrupted config backed up to: ${o}`,{level:`error`})}catch{}}let l=Qt(e);o?process.stderr.write(`The corrupted file has been backed up to: ${o}\n`):s&&process.stderr.write(`The corrupted file has already been backed up.
2
- `),l?process.stderr.write(`A backup file exists at: ${l}\nYou can manually restore it by running: cp "${l}" "${e}"\n\n`):process.stderr.write(`
3
- `)}return t()}}function $t(){let e=$(),t=H();if(!t.projects)return G;let n=t.projects[e]??G;return typeof n.allowedTools==`string`&&(n.allowedTools=Qe(n.allowedTools)??[]),n}function en(e){let t=$(),n=null;try{Yt(T(),L,r=>{let i=r.projects?.[t]??G,a=e(i);return a===i?r:(n={...r,projects:{...r.projects,[t]:a}},n)})&&n&&V(n)}catch(r){S(`Failed to save config with lock: ${r}`,{level:`error`});let i=U(T(),L);if(R(i)){S(`saveCurrentProjectConfig fallback: re-read config is missing auth that cache has; refusing to write. See GH #3117.`,{level:`error`}),D(`tengu_config_auth_loss_prevented`,{});return}let a=i.projects?.[t]??G,o=e(a);if(o===a)return;n={...i,projects:{...i.projects,[t]:o}},Jt(T(),n,K),V(n)}}function tn(){return an()!==null}function nn(){return tn()&&!l(process.env.FORCE_AUTOUPDATE_PLUGINS)}function rn(e){switch(e.type){case`development`:return`development build`;case`env`:return`${e.envVar} set`;case`config`:return`config`}}function an(){if(!l(process.env.ENABLE_AUTOUPDATER))return{type:`config`};if(l(process.env.DISABLE_AUTOUPDATER))return{type:`env`,envVar:`DISABLE_AUTOUPDATER`};let e=qe();if(e)return{type:`env`,envVar:e};let t=H();return t.autoUpdates===!1&&(t.installMethod!==`native`||t.autoUpdatesProtectedForNative!==!0)?{type:`config`}:null}function on(){let e=H();if(e.userID)return e.userID;let t=ot(32).toString(`hex`);return z(e=>({...e,userID:t})),t}function sn(){if(!H().firstStartTime){let e=new Date().toISOString();z(t=>({...t,firstStartTime:t.firstStartTime??e}))}}function cn(e){let t=f();switch(e){case`User`:return A(c(),`AGENTS.md`);case`Local`:return A(t,`AGENTS.local.md`);case`Project`:return A(t,`AGENTS.md`);case`Managed`:return A(Ne(),`AGENTS.md`);case`AutoMem`:return vt();default:return A(c(),`AGENTS.md`)}}function ln(){return A(Ne(),`.workmate`,`rules`)}function un(){return A(c(),`rules`)}var W,G,K,dn,q,J,Y,X,fn,pn,Z,Q,$,mn=t((()=>{o(),Dt(),re(),St(),$e(),_e(),we(),Se(),Be(),Ae(),u(),ye(),Ee(),xe(),He(),Ze(),Ye(),Bt(),Ge(),Re(),We(),Pe(),Te(),W=!1,G={allowedTools:[],mcpContextUris:[],mcpServers:{},enabledMcpjsonServers:[],disabledMcpjsonServers:[],hasTrustDialogAccepted:!1,projectOnboardingSeenCount:0,hasAgentsMdExternalIncludesApproved:!1,hasAgentsMdExternalIncludesWarningShown:!1},K=L(),dn=!1,{...K},{...G},q={config:null,mtime:0},J=null,Y=0,X=0,fn=0,Ce(async()=>{Ut()}),pn=1e3,Z=!1,Q=!1,$=a(()=>{let e=f();return w(Ue(e)||nt(e))})}));export{ft as A,Lt as C,wt as D,Ct as E,dt as F,ct as I,lt as L,St as M,yt as N,vt as O,ut as P,M as R,Bt as S,P as T,sn as _,an as a,nn as b,H as c,on as d,$ as f,tn as g,mn as h,rn as i,gt as j,N as k,ln as l,un as m,Vt as n,$t as o,Kt as p,Xt as r,qt as s,K as t,cn as u,en as v,Dt as w,zt as x,z as y,st as z};
@@ -1 +0,0 @@
1
- import{c as e,h as t,n,o as r,r as i,v as a,y as o}from"./config-DUTgj3js.js";t();export{n as checkHasTrustDialogAccepted,i as enableConfigs,r as getCurrentProjectConfig,e as getGlobalConfig,a as saveCurrentProjectConfig,o as saveGlobalConfig};
@@ -1 +0,0 @@
1
- import{n as e,r as t,t as n}from"./context-noninteractive-CacA9VlT.js";t();export{n as call,e as collectContextData};
@@ -1 +0,0 @@
1
- function e(e){if(typeof e!=`object`||!e)return e;let t=e;if(`requestId`in t&&!(`request_id`in t)&&(t.request_id=t.requestId,delete t.requestId),`response`in t&&t.response!==null&&typeof t.response==`object`){let e=t.response;`requestId`in e&&!(`request_id`in e)&&(e.request_id=e.requestId,delete e.requestId)}return e}export{e as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./conversation-Tvo4EDpQ.js";e();export{t as clearConversation};
@@ -1 +0,0 @@
1
- import{a as e,n as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Dn as n,Kn as r,On as i,Qm as a,St as o,Tn as s,Ug as c,Wg as l,Ws as u,XT as d,aC as f,br as p,di as m,eh as h,fg as g,fs as _,hn as v,iC as y,mi as b,og as x,ps as S,qt as C,rE as w,sg as T,sn as E,ti as D,tr as O,ug as k,yt as A}from"./loadAgentsDir-C96o6gCj.js";import{$ as j,$t as M,Cn as N,En as P,Ut as F,W as I,Zt as L,wn as R}from"./state-D5D6QpTX.js";import{o as z,s as B}from"./log-CZ7ploQm.js";import{n as V,r as H}from"./analytics-DJobLaWP.js";import{at as U,ut as W}from"./sessionState-8jutEorw.js";import{n as G,t as K}from"./caches-CC5NHwAz.js";import{randomUUID as q}from"crypto";function J(){return Y}var Y,X=t((()=>{u(),Y=null}));function Z(){let e=J();if(!e)return;e.markTranscriptReset?.();let t={type:`status`,subtype:`status`,status:`conversation_cleared`,message:`conversation_cleared`,uuid:q()};e.writeSdkMessages([t])}async function Q({setMessages:t,readFileState:i,discoveredSkillNames:o,loadedNestedMemoryPaths:c,getAppState:u,setAppState:h,setConversationId:g}){let _=E();await C(`clear`,{getAppState:u,setAppState:h,signal:AbortSignal.timeout(_),timeoutMs:_});let v=I();v&&H(`tengu_cache_eviction_hint`,{scope:`conversation_clear`,last_request_id:v});let y=new Set,x=[],w=e=>`isBackgrounded`in e&&e.isBackgrounded===!1;if(u)for(let e of Object.values(u().tasks))w(e)||S(e)&&(y.add(e.agentId),x.push(e));t(()=>[]),Z();let{setContextBlocked:F}=(U(),e(W));F(!1),g&&g(q()),K(y),N(null),R(null),P(null),M(),f(j()),i.clear(),o?.clear(),c?.clear(),h&&h(e=>{let t={};for(let[n,r]of Object.entries(e.tasks)){if(!w(r)){t[n]=r;continue}try{r.status===`running`&&(T(r)&&(r.shellCommand?.kill(),r.shellCommand?.cleanup(),r.cleanupTimeoutId&&clearTimeout(r.cleanupTimeoutId)),`abortController`in r&&r.abortController?.abort(),`unregisterCleanup`in r&&r.unregisterCleanup?.())}catch(e){B(e)}s(n)}return{...e,tasks:t,attribution:a(),standaloneAgentContext:void 0,fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:e.mcp.pluginReconnectKey}}}),d(),r(),L({setCurrentAsParent:!0}),await D();for(let e of x)e.status===`running`&&n(e.id,O(k(e.agentId)));let{saveMode:z}=(p(),e(b));z(`normal`);let V=A();V&&m(V);let G=await l(`clear`);G.length>0&&t(()=>G)}var $=t((()=>{X(),F(),V(),_(),x(),g(),h(),v(),z(),w(),y(),c(),p(),i(),o(),G()}));export{$ as n,Q as t};
@@ -1,5 +0,0 @@
1
- import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{C as n,S as r,c as i,i as a,x as o}from"./debug-D58GQBDG.js";import{l as s,u as c}from"./oauth-D38aRTUb.js";import{Pt as l,St as u}from"./model-BaMclMXn.js";import{t as d}from"./cliLaunch-DDtwAolw.js";import{resolve as f}from"path";import{existsSync as p,unlinkSync as m}from"fs";import{randomUUID as h}from"crypto";a(),o(),e();function g(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`}var _=2e3,v=15e3,y=3,b=class{constructor(e,n){t(this,`proc`,void 0),t(this,`options`,void 0),t(this,`connected`,!1),t(this,`disconnected`,!1),t(this,`readLoopAbort`,null),t(this,`reconnectAttempt`,0),t(this,`maxReconnectAttempts`,void 0),t(this,`userInitiatedDisconnect`,!1),t(this,`reconnecting`,!1),this.proc=e,this.options=n,this.maxReconnectAttempts=n.maxReconnectAttempts??y}connect(){this.connected||(this.readLoopAbort=new AbortController,this.startReadLoop(),this.monitorExit(),this.connected=!0,this.options.onConnected())}async startReadLoop(){let e=this.proc.stdout;if(!e){this.options.onError(Error(`SSH process stdout is not available`));return}let t=e.getReader(),n=new TextDecoder,r=``;try{for(;!this.disconnected;){let{done:e,value:i}=await t.read();if(e)break;r+=n.decode(i,{stream:!0});let a=r.split(`
2
- `);r=a.pop()??``;for(let e of a){let t=e.trim();t&&this.processLine(t)}}}catch(e){this.disconnected||this.options.onError(e instanceof Error?e:Error(String(e)))}finally{t.releaseLock(),!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()}}monitorExit(){if(this.proc.exitCode!==null){this.userInitiatedDisconnect||this.handleProcessExit();return}this.proc.exited.then(()=>{!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()}).catch(()=>{!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()})}async handleProcessExit(){if(!(this.disconnected||this.reconnecting)){if(this.connected=!1,!this.options.reconnect){this.disconnected=!0,this.options.onDisconnected();return}if(this.reconnectAttempt>=this.maxReconnectAttempts){this.disconnected=!0,this.options.onDisconnected();return}this.reconnecting=!0;try{await this.attemptReconnect()}finally{this.reconnecting=!1}}}async attemptReconnect(){let e=this.options.reconnect;for(;this.reconnectAttempt<this.maxReconnectAttempts;){this.reconnectAttempt++,this.options.onReconnecting(this.reconnectAttempt,this.maxReconnectAttempts);let t=Math.min(_*2**(this.reconnectAttempt-1),v);if(await new Promise(e=>setTimeout(e,t)),this.userInitiatedDisconnect)return;try{let t=await e();this.proc=t,this.reconnectAttempt=0,this.connected=!0,this.startReadLoop(),this.monitorExit(),this.options.onConnected();return}catch(e){i(`[SSH] reconnect attempt ${this.reconnectAttempt} failed: ${e instanceof Error?e.message:String(e)}`)}}this.disconnected=!0,this.options.onDisconnected()}processLine(e){let t;try{t=r(e)}catch{return}if(!g(t))return;let n=t;if(n.type===`control_request`){let e=n;e.request.subtype===`can_use_tool`?this.options.onPermissionRequest(e.request,e.request_id):(i(`[SSH] Unsupported control request subtype: ${e.request.subtype}`),this.sendErrorResponse(e.request_id,`Unsupported control request subtype: ${e.request.subtype}`));return}n.type!==`control_response`&&n.type!==`keep_alive`&&n.type!==`control_cancel_request`&&n.type!==`streamlined_text`&&n.type!==`streamlined_tool_use_summary`&&!(n.type===`system`&&n.subtype===`post_turn_summary`)&&this.options.onMessage(n)}writeToStdin(e){try{let t=this.proc.stdin;if(!t||typeof t==`number`||this.disconnected)return!1;let n=new TextEncoder().encode(`${e}\n`);return t.write(n),t.flush?.(),!0}catch{return!1}}async sendMessage(e){let t=n({type:`user`,message:{role:`user`,content:e},parent_tool_use_id:null,session_id:``});return this.writeToStdin(t)}sendInterrupt(){let e=n({type:`control_request`,request_id:crypto.randomUUID(),request:{subtype:`interrupt`}});this.writeToStdin(e)}respondToPermissionRequest(e,t){let r=n({type:`control_response`,response:{subtype:`success`,request_id:e,response:{behavior:t.behavior,...t.behavior===`allow`?{updatedInput:t.updatedInput}:{message:t.message}}}});this.writeToStdin(r)}sendErrorResponse(e,t){let r=n({type:`control_response`,response:{subtype:`error`,request_id:e,error:t}});this.writeToStdin(r)}disconnect(){if(!this.disconnected){this.userInitiatedDisconnect=!0,this.disconnected=!0,this.connected=!1,this.readLoopAbort?.abort();try{let e=this.proc.stdin;e&&typeof e!=`number`&&e.end?.()}catch{}try{this.proc.kill()}catch{}}}isConnected(){return this.connected&&!this.disconnected}};l(),c(),a();var x=process.platform===`win32`;function S(){let e=process.env.ANTHROPIC_API_KEY;if(e)return{"x-api-key":e};let t=u();return t?.accessToken?{Authorization:`Bearer ${t.accessToken}`}:{}}function C(){return process.env.ANTHROPIC_BASE_URL||s().BASE_API_URL}async function w(e,t){if(t&&e.headers.get(`x-auth-nonce`)!==t)return new Response(`Forbidden`,{status:403});let n=C(),r=new URL(e.url),a=`${n}${r.pathname}${r.search}`,o=S();if(Object.keys(o).length===0)return new Response(JSON.stringify({error:`No API credentials available on local machine`}),{status:401,headers:{"content-type":`application/json`}});let s=new Headers(e.headers);for(let[e,t]of Object.entries(o))s.set(e,t);s.delete(`host`),s.delete(`x-auth-nonce`),i(`[SSHAuthProxy] ${e.method} ${r.pathname} -> ${a}`);try{let t=await fetch(a,{method:e.method,headers:s,body:e.body,duplex:`half`}),n=new Headers(t.headers);return n.delete(`content-encoding`),n.delete(`content-length`),new Response(t.body,{status:t.status,statusText:t.statusText,headers:n})}catch(e){let t=e instanceof Error?e.message:String(e);return i(`[SSHAuthProxy] upstream error: ${t}`),new Response(JSON.stringify({error:`Proxy upstream error: ${t}`}),{status:502,headers:{"content-type":`application/json`}})}}async function T(){let e=h();return x?D(e):E(e)}async function E(e){let t=`/tmp/claude-ssh-auth-${e}.sock`,n=Bun.serve({unix:t,fetch:e=>w(e,null)});return i(`[SSHAuthProxy] listening on unix:${t}`),{proxy:{stop(){n.stop(!0);try{m(t)}catch{}}},localAddress:t,authEnv:{ANTHROPIC_AUTH_SOCKET:t}}}async function D(e){let t=h(),n=Bun.serve({port:0,hostname:`127.0.0.1`,fetch:e=>w(e,t)}),r=n.port;return i(`[SSHAuthProxy] listening on TCP 127.0.0.1:${r} (nonce-protected)`),{proxy:{stop(){n.stop(!0)}},localAddress:`127.0.0.1:${r}`,authEnv:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${r}`,ANTHROPIC_AUTH_NONCE:t}}}a();var O=15e3,k=class extends Error{constructor(e){super(e),this.name=`SSHProbeError`}};async function A(e,t){t?.(`Probing remote host…`);let n=Bun.spawn([`ssh`,`-o`,`BatchMode=yes`,`-o`,`ConnectTimeout=10`,e,`CLAUDE_BIN=$(test -x "$HOME/.local/bin/claude" && echo "$HOME/.local/bin/claude" || command -v claude 2>/dev/null); echo "$CLAUDE_BIN"; $CLAUDE_BIN --version 2>/dev/null; uname -sm; pwd`],{stdin:`ignore`,stdout:`pipe`,stderr:`pipe`}),r=await Promise.race([n.exited,new Promise((e,t)=>setTimeout(()=>t(new k(`SSH probe timed out after ${O/1e3}s`)),O))]),a=await new Response(n.stdout).text(),o=await new Response(n.stderr).text();if(r!==0)throw new k(`SSH probe failed: ${o.trim()||`exit code ${r}`}`);let s=a.split(`
3
- `).map(e=>e.trim()).filter(Boolean);i(`[SSHProbe] raw lines: ${JSON.stringify(s)}`);let c=s.findIndex(e=>/^(Linux|Darwin)\s/.test(e));if(c===-1)throw new k(`Could not detect remote platform (uname output missing)`);let l=c>=2&&s[c-2]||null,u=c>=1&&s[c-1]||null,d=u&&/^\d+\.\d+/.test(u)?u:null,f=l?.startsWith(`/`)??!1,p=s[c+1]||`/`,[m,h]=s[c].split(/\s+/),g=m===`Darwin`?`darwin`:`linux`,_=h===`aarch64`||h===`arm64`?`arm64`:`x64`;return t?.(`Detected ${g}/${_}`),{hasBinary:f&&d!==null,remoteVersion:d,remotePlatform:g,remoteArch:_,defaultCwd:p,binaryPath:f?l:null}}a();var j=6e4,M=`~/.local/bin`,N=`claude-code-cli.js`,P=`claude`;async function F(e,t,n=j){let r=Bun.spawn([`ssh`,`-o`,`ConnectTimeout=10`,e,t],{stdout:`pipe`,stderr:`pipe`}),i=setTimeout(()=>r.kill(),n);try{let[e,t]=await Promise.all([new Response(r.stdout).text(),new Response(r.stderr).text()]),n=await r.exited;return{stdout:e.trim(),stderr:t.trim(),exitCode:n}}finally{clearTimeout(i)}}function I(){let e=f(import.meta.dir,`../..`),t=f(e,`dist/cli.js`);if(p(t))return t;let n=f(e,`src/entrypoints/cli.tsx`);if(p(n))return n;throw Error("Cannot find local CLI binary to deploy. Run `bun run build` first.")}async function L(e){let{host:t,remotePlatform:n,remoteArch:r,localVersion:a,onProgress:o}=e;if(n!==`linux`&&n!==`darwin`)throw Error(`Remote platform "${n}" is not supported. Only linux and darwin are supported.`);i(`[SSHDeploy] deploying to ${t} (${n}/${r}, v${a})`);let s=I();i(`[SSHDeploy] local binary: ${s}`),o?.(`Creating remote directory...`);let c=await F(t,`mkdir -p ${M}`);if(c.exitCode!==0)throw Error(`Failed to create remote directory: ${c.stderr}`);o?.(`Uploading binary...`);let l=`${M}/${N}`,u=Bun.spawn([`scp`,`-o`,`ConnectTimeout=10`,s,`${t}:${l}`],{stdout:`pipe`,stderr:`pipe`}),d=setTimeout(()=>u.kill(),j),f=await new Response(u.stderr).text(),p=await u.exited;if(clearTimeout(d),p!==0)throw Error(`SCP upload failed (exit ${p}): ${f.trim()}`);o?.(`Installing wrapper script...`);let m=await F(t,[`cat > ${M}/${P} << 'WRAPPER'`,`#!/bin/sh`,`exec bun ${M}/${N} "$@"`,`WRAPPER`,`chmod +x ${M}/${P}`].join(`
4
- `));if(m.exitCode!==0)throw Error(`Failed to install wrapper script: ${m.stderr}`);o?.(`Verifying installation...`);let h=await F(t,`${M}/${P} --version`);if(h.exitCode!==0)throw Error(`Binary deployed but verification failed (exit ${h.exitCode}): ${h.stderr}`);return i(`[SSHDeploy] deployed successfully, remote version: ${h.stdout}`),o?.(`Deployed v${h.stdout}`),`${M}/${P}`}a(),o();var R=3e4,z=20,B=class extends Error{constructor(e){super(e),this.name=`SSHSessionError`}};async function V(e,t){let{host:n,localVersion:r,extraCliArgs:a,remoteBin:o}=e,s=t?.onProgress,c,l=`/`;if(o){s?.(`Using custom remote binary, skipping probe/deploy…`),c=o,i(`[SSH] custom remoteBin: ${o}`);try{let e=Bun.spawn([`ssh`,`-o`,`BatchMode=yes`,`-o`,`ConnectTimeout=5`,n,`pwd`],{stdin:`ignore`,stdout:`pipe`,stderr:`ignore`});await e.exited;let t=(await new Response(e.stdout).text()).trim();t.startsWith(`/`)&&(l=t)}catch{}}else{let e=await A(n,s);i(`[SSH] probe result: ${JSON.stringify(e)}`),l=e.defaultCwd,c=e.binaryPath??`~/.local/bin/claude`,(!e.hasBinary||e.remoteVersion!==r)&&(s?.(e.hasBinary?`Updating remote binary (${e.remoteVersion} → ${r})…`:`Deploying binary to remote…`),c=await L({host:n,remotePlatform:e.remotePlatform,remoteArch:e.remoteArch,localVersion:r,onProgress:s}))}let{proxy:u,localAddress:d,authEnv:f}=await T();i(`[SSH] auth proxy listening on ${d}`);let p=h().slice(0,8),m=process.platform===`win32`,g=[];for(let[e,t]of Object.entries(f))g.push(`${e}=${t}`);g.push(c,`--output-format`,`stream-json`,`--input-format`,`stream-json`,`--verbose`,`-p`),e.cwd&&g.push(`--cwd`,e.cwd),e.permissionMode&&g.push(`--permission-mode`,e.permissionMode),e.dangerouslySkipPermissions&&g.push(`--dangerously-skip-permissions`),g.push(...a);let _=[`ssh`];if(m){let e=d.split(`:`)[1],t=1e4+Math.floor(Math.random()*5e4);_.push(`-R`,`${t}:127.0.0.1:${e}`);let n=g.findIndex(e=>e.startsWith(`ANTHROPIC_BASE_URL=`));n!==-1&&(g[n]=`ANTHROPIC_BASE_URL=http://127.0.0.1:${t}`)}else{let e=`/tmp/claude-ssh-auth-${p}.sock`;_.push(`-R`,`${e}:${d}`),_.push(`-o`,`StreamLocalBindUnlink=yes`);let t=g.indexOf(`ANTHROPIC_AUTH_SOCKET=${f.ANTHROPIC_AUTH_SOCKET}`);t!==-1&&(g[t]=`ANTHROPIC_AUTH_SOCKET=${e}`)}_.push(n,g.join(` `)),s?.(`Starting remote session…`),i(`[SSH] spawning: ${_.join(` `)}`);let v;try{v=Bun.spawn(_,{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`})}catch(e){throw u.stop(),new B(`Failed to spawn SSH process: ${e instanceof Error?e.message:String(e)}`)}let y=[];W(v,y);let x;if(o){let t=await Promise.race([v.exited.then(e=>e),new Promise(e=>setTimeout(()=>e(null),3e3))]);if(t!==null){u.stop();let e=y.join(``).trim();throw new B(`Remote process exited immediately (code ${t})${e?`: ${e}`:``}`)}x=e.cwd||l||`/`}else try{x=await U(v,e.cwd||l)}catch(e){throw u.stop(),v.kill(),e}i(`[SSH] remote session initialized, remoteCwd=${x}`);let S=v,C=async()=>{i(`[SSH] reconnect: re-spawning SSH process with --continue`);let e=[..._],t=e.length-1,n=e[t];n.includes(`--continue`)||(e[t]=n.replace(/ -p(?:\s|$)/,` -p --continue `));let r=Bun.spawn(e,{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`}),a=[];return W(r,a),await U(r,x),S=r,y.length=0,y.push(...a),r};return{remoteCwd:x,get proc(){return S},proxy:u,createManager(e){return new b(S,{...e,reconnect:C})},getStderrTail(){return y.slice(-20).join(``)}}}async function H(e){let{proxy:t,authEnv:n}=await T(),r=[`--output-format`,`stream-json`,`--input-format`,`stream-json`,`-p`];e.cwd&&r.push(`--cwd`,e.cwd),e.permissionMode&&r.push(`--permission-mode`,e.permissionMode),e.dangerouslySkipPermissions&&r.push(`--dangerously-skip-permissions`);let a=d(r),o;try{o=Bun.spawn([a.execPath,...a.args],{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`,env:{...a.env,...n}})}catch(e){throw t.stop(),new B(`Failed to spawn local CLI process: ${e instanceof Error?e.message:String(e)}`)}i(`[SSH] local session spawned, waiting for init message...`);let s=[];W(o,s);let c;try{c=await U(o,e.cwd)}catch(e){throw t.stop(),o.kill(),e}i(`[SSH] local session initialized, remoteCwd=${c}`);let l=o,u=async()=>{i(`[SSH] local reconnect: re-spawning CLI with --continue`);let e=[...r];e.includes(`--continue`)||e.push(`--continue`);let t=d(e),a=Bun.spawn([t.execPath,...t.args],{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`,env:{...t.env,...n}}),o=[];return W(a,o),await U(a,c),l=a,s.length=0,s.push(...o),a};return{remoteCwd:c,get proc(){return l},proxy:t,createManager(e){return new b(l,{...e,reconnect:u})},getStderrTail(){return s.slice(-20).join(``)}}}async function U(e,t){let n=e.stdout;if(!n)throw new B(`Child process stdout is not readable`);let i=n.getReader(),a=new TextDecoder,o=``,s=Date.now()+R;try{for(;Date.now()<s;){let e=s-Date.now(),n=await Promise.race([i.read(),new Promise((t,n)=>setTimeout(()=>n(new B(`Remote CLI did not initialize within 30 seconds. Check SSH connectivity and remote binary.`)),e))]);if(n.done)throw new B(`Child process exited before sending init message`);o+=a.decode(n.value,{stream:!0});let c=o.split(`
5
- `);o=c.pop()??``;for(let e of c){let n=e.trim();if(n)try{let e=r(n);if(e.type===`system`&&e.subtype===`init`)return i.releaseLock(),e.cwd||t||process.cwd()}catch{}}}}catch(e){throw i.releaseLock(),e instanceof B?e:new B(`Error reading init message: ${e instanceof Error?e.message:String(e)}`)}throw i.releaseLock(),new B(`Remote CLI did not initialize within 30 seconds. Check SSH connectivity and remote binary.`)}function W(e,t){let n=e.stderr;if(!n)return;let r=n.getReader(),i=new TextDecoder;(async()=>{try{for(;;){let{done:e,value:n}=await r.read();if(e)break;t.push(i.decode(n,{stream:!0})),t.length>z*2&&t.splice(0,t.length-z)}}catch{}})()}export{B as SSHSessionError,H as createLocalSSHSession,V as createSSHSession};
@@ -1 +0,0 @@
1
- import{a as e,i as t,n,r}from"./createSession-DqTtBycR.js";t();export{n as createBridgeSession,r as getBridgeSession,e as updateBridgeSessionTitle};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{P as t,R as n,c as r,i}from"./debug-D58GQBDG.js";import{i as a,t as o}from"./sessionIdCompat-Dgp6PW_1.js";import{i as s,o as c}from"./debugUtils-DXBRbwCE.js";async function l({environmentId:e,title:n,events:i,gitRepoUrl:a,branch:o,signal:c,baseUrl:l,getAccessToken:u,permissionMode:d}){let{getClaudeAIOAuthTokens:f}=await import(`./auth-jV5THRH8.js`),{getOrganizationUUID:p}=await import(`./client-BtTkq0YS.js`),{getOauthConfig:m}=await import(`./oauth-U649LV5H.js`),{getOAuthHeaders:h}=await import(`./api-DumFOErN.js`),{parseGitHubRepository:g}=await import(`./detectRepository-DUJBh5s2.js`),{getDefaultBranch:_}=await import(`./git-hO-TMvXc.js`),{getMainLoopModel:v}=await import(`./model-atn3_JBi.js`),{default:y}=await import(`./axios-BHBm_hhU.js`),{isSelfHostedBridge:b}=await import(`./bridgeConfig-_xpxhGB5.js`),x=u?.()??f()?.accessToken;if(!x)return r(`[bridge] No access token for session creation`),null;let S=b()?`self-hosted`:await p();if(!S)return r(`[bridge] No org UUID for session creation`),null;let C=null,w=null;if(a){let{parseGitRemote:e}=await import(`./detectRepository-DUJBh5s2.js`),t=e(a);if(t){let{host:e,owner:n,name:r}=t,i=o||await _()||void 0;C={type:`git_repository`,url:`https://${e}/${n}/${r}`,revision:i},w={type:`git_repository`,git_info:{type:`github`,repo:`${n}/${r}`,branches:[`claude/${o||`task`}`]}}}else{let e=g(a);if(e){let[t,n]=e.split(`/`);if(t&&n){let e=o||await _()||void 0;C={type:`git_repository`,url:`https://github.com/${t}/${n}`,revision:e},w={type:`git_repository`,git_info:{type:`github`,repo:`${t}/${n}`,branches:[`claude/${o||`task`}`]}}}}}}let T={...n!==void 0&&{title:n},events:i,session_context:{sources:C?[C]:[],outcomes:w?[w]:[],model:v()},environment_id:e,source:`remote-control`,...d&&{permission_mode:d}},E={...h(x),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":S},D=`${l??m().BASE_API_URL}/v1/sessions`,O;try{O=await y.post(D,T,{headers:E,signal:c,validateStatus:e=>e<500})}catch(e){return r(`[bridge] Session creation request failed: ${t(e)}`),null}if(!(O.status===200||O.status===201)){let e=s(O.data);return r(`[bridge] Session creation failed with status ${O.status}${e?`: ${e}`:``}`),null}let k=O.data;return!k||typeof k!=`object`||!(`id`in k)||typeof k.id!=`string`?(r(`[bridge] No session ID in response`),null):k.id}async function u(e,n){let{getClaudeAIOAuthTokens:i}=await import(`./auth-jV5THRH8.js`),{getOrganizationUUID:a}=await import(`./client-BtTkq0YS.js`),{getOauthConfig:o}=await import(`./oauth-U649LV5H.js`),{getOAuthHeaders:c}=await import(`./api-DumFOErN.js`),{default:l}=await import(`./axios-BHBm_hhU.js`),{isSelfHostedBridge:u}=await import(`./bridgeConfig-_xpxhGB5.js`),d=n?.getAccessToken?.()??i()?.accessToken;if(!d)return r(`[bridge] No access token for session fetch`),null;let f=u()?`self-hosted`:await a();if(!f)return r(`[bridge] No org UUID for session fetch`),null;let p={...c(d),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":f},m=`${n?.baseUrl??o().BASE_API_URL}/v1/sessions/${e}`;r(`[bridge] Fetching session ${e}`);let h;try{h=await l.get(m,{headers:p,timeout:1e4,validateStatus:e=>e<500})}catch(e){return r(`[bridge] Session fetch request failed: ${t(e)}`),null}if(h.status!==200){let e=s(h.data);return r(`[bridge] Session fetch failed with status ${h.status}${e?`: ${e}`:``}`),null}return h.data}async function d(e,t){let{getClaudeAIOAuthTokens:n}=await import(`./auth-jV5THRH8.js`),{getOrganizationUUID:i}=await import(`./client-BtTkq0YS.js`),{getOauthConfig:a}=await import(`./oauth-U649LV5H.js`),{getOAuthHeaders:o}=await import(`./api-DumFOErN.js`),{default:c}=await import(`./axios-BHBm_hhU.js`),{isSelfHostedBridge:l}=await import(`./bridgeConfig-_xpxhGB5.js`),u=t?.getAccessToken?.()??n()?.accessToken;if(!u){r(`[bridge] No access token for session archive`);return}let d=l()?`self-hosted`:await i();if(!d){r(`[bridge] No org UUID for session archive`);return}let f={...o(u),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":d},p=`${t?.baseUrl??a().BASE_API_URL}/v1/sessions/${e}/archive`;r(`[bridge] Archiving session ${e}`);let m=await c.post(p,{},{headers:f,timeout:t?.timeoutMs??1e4,validateStatus:e=>e<500});if(m.status===200)r(`[bridge] Session ${e} archived successfully`);else{let e=s(m.data);r(`[bridge] Session archive failed with status ${m.status}${e?`: ${e}`:``}`)}}async function f(e,n,i){let{getClaudeAIOAuthTokens:o}=await import(`./auth-jV5THRH8.js`),{getOrganizationUUID:c}=await import(`./client-BtTkq0YS.js`),{getOauthConfig:l}=await import(`./oauth-U649LV5H.js`),{getOAuthHeaders:u}=await import(`./api-DumFOErN.js`),{default:d}=await import(`./axios-BHBm_hhU.js`),{isSelfHostedBridge:f}=await import(`./bridgeConfig-_xpxhGB5.js`),p=i?.getAccessToken?.()??o()?.accessToken;if(!p){r(`[bridge] No access token for session title update`);return}let m=f()?`self-hosted`:await c();if(!m){r(`[bridge] No org UUID for session title update`);return}let h={...u(p),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":m},g=a(e),_=`${i?.baseUrl??l().BASE_API_URL}/v1/sessions/${g}`;r(`[bridge] Updating session title: ${g} → ${n}`);try{let e=await d.patch(_,{title:n},{headers:h,timeout:1e4,validateStatus:e=>e<500});if(e.status===200)r(`[bridge] Session title updated successfully`);else{let t=s(e.data);r(`[bridge] Session title update failed with status ${e.status}${t?`: ${t}`:``}`)}}catch(e){r(`[bridge] Session title update request failed: ${t(e)}`)}}var p=e((()=>{i(),n(),c(),o()}));export{f as a,p as i,l as n,u as r,d as t};
@@ -1,40 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ci as n,Du as r,GS as i,Lu as a,Nr as o,Ou as s,Qw as c,Ru as l,Sc as u,Si as d,Sr as f,Zw as p,_u as ee,bc as m,br as h,fr as g,ir as te,lu as ne,np as _,oi as v,rp as re,su as ie,vu as ae,wr as y,zS as oe}from"./loadAgentsDir-C96o6gCj.js";import{C as se,D as b,Gr as x,H as ce,I as S,P as C,T as w,Wt as le,Xn as ue,ai as T,di as E,fi as de,hn as fe,k as pe,oi as me,ot as he,p as D,t as ge}from"./src-DL3w8VPk.js";import{t as O}from"./jsx-runtime-Bb4Xn-E0.js";import{$ as _e,Ut as ve,ft as ye}from"./state-D5D6QpTX.js";import{S as be,c as k,i as xe,x as Se}from"./debug-D58GQBDG.js";import{In as A,Ln as Ce}from"./settings-BowI3jp-.js";import{i as we,m as Te}from"./git-Wid-XppW.js";import{a as j,o as Ee,s as De}from"./log-CZ7ploQm.js";import{n as Oe,r as M}from"./analytics-DJobLaWP.js";import{C as N,d as ke,m as Ae,v as je}from"./startupProfiler-B90b5vuq.js";import{_ as P,h as F}from"./model-BaMclMXn.js";import{i as Me,r as Ne}from"./shellQuote-Ddgr1vif.js";import{n as Pe,t as Fe}from"./useExitOnCtrlCDWithKeybindings-L5idX6Kz.js";import{t as Ie}from"./SearchBox-C9xxQzh1.js";import{n as Le,t as Re}from"./useSearchInput-Bxl4wGcZ.js";import{n as I,t as ze}from"./Messages-Cykztq1O.js";function Be({log:e,onExit:t,onSelect:n}){let[r,i]=L.useState(null);L.useEffect(()=>{i(null),y(e)&&o(e).then(i)},[e]);let a=y(e)&&r===null,s=r??e,c=g(s)||``,l=m();return le(`confirm:no`,t,{context:`Confirmation`}),le(`confirm:yes`,(0,L.useCallback)(()=>{n(r??e)},[n,r,e]),{context:`Confirmation`}),a?(0,R.jsxs)(S,{flexDirection:`column`,padding:1,children:[(0,R.jsx)(D,{message:`Loading session…`}),(0,R.jsx)(C,{dimColor:!0,children:(0,R.jsx)(w,{children:(0,R.jsx)(_,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})})})]}):(0,R.jsxs)(S,{flexDirection:`column`,children:[(0,R.jsx)(ze,{messages:s.messages,tools:l,commands:[],verbose:!0,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:c,screen:`transcript`,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1}),(0,R.jsxs)(S,{flexShrink:0,flexDirection:`column`,borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:`single`,paddingLeft:2,children:[(0,R.jsxs)(C,{children:[Ae(s.modified),` · `,s.messageCount,` messages`,s.gitBranch?` · ${s.gitBranch}`:``]}),(0,R.jsx)(C,{dimColor:!0,children:(0,R.jsxs)(w,{children:[(0,R.jsx)(b,{shortcut:`Enter`,action:`resume`}),(0,R.jsx)(_,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]})]})}var L,R,Ve=e((()=>{L=t(T(),1),ge(),oe(),u(),je(),h(),re(),I(),R=O()}));function z(e,t){if(e===V)return 5;let n=x(e),r=t?Math.min(n,t-H-U):n;return Math.max(0,r)+H+U}function He(e,t){let n=t-H-U;return x(e)<=n?e:n<=1?e.charAt(0):N(e,n)}function Ue({tabs:e,selectedIndex:t,availableWidth:n,showAllProjects:r=!1}){let i=r?`Resume (All Projects)`:`Resume`,a=i.length+1,o=Math.max(Je,G),s=n-a-o-2,c=Math.max(0,Math.min(t,e.length-1)),l=Math.max(20,Math.floor(s/2)),u=e.map(e=>z(e,l)),d=0,f=e.length;if(u.reduce((e,t,n)=>e+t+ +(n<u.length-1),0)>s){let t=s-qe,n=u[c]??0;for(d=c,f=c+1;d>0||f<e.length;){let r=d>0,i=f<e.length;if(r){let e=(u[d-1]??0)+1;if(n+e<=t){d--,n+=e;continue}}if(i){let e=(u[f]??0)+1;if(n+e<=t){f++,n+=e;continue}}break}}let p=d,ee=e.length-f,m=e.slice(d,f),h=m.map((e,t)=>d+t);return(0,B.jsxs)(S,{flexDirection:`row`,gap:1,children:[(0,B.jsx)(C,{color:`suggestion`,children:i}),p>0&&(0,B.jsxs)(C,{dimColor:!0,children:[W,p]}),m.map((e,t)=>{let n=h[t]===c,r=e===V?e:`#${He(e,l-H)}`;return(0,B.jsxs)(C,{backgroundColor:n?`suggestion`:void 0,color:n?`inverseText`:void 0,bold:n,children:[` `,r,` `]},e)}),ee>0?(0,B.jsxs)(C,{dimColor:!0,children:[We,ee,Ge]}):(0,B.jsx)(C,{dimColor:!0,children:Ke})]})}var B,V,H,U,W,We,Ge,Ke,qe,Je,G,K=e((()=>{ge(),je(),B=O(),V=`All`,H=2,U=1,W=`← `,We=`→`,Ge=` (tab to cycle)`,Ke=`(tab to cycle)`,qe=5,Je=18,G=14}));function Ye({nodes:e,onSelect:t,onCancel:n,onFocus:i,focusNodeId:a,visibleOptionCount:o,layout:s=`expanded`,isDisabled:c=!1,hideIndexes:l=!1,isNodeExpanded:u,onExpand:d,onCollapse:f,getParentPrefix:p,getChildPrefix:ee,onUpFromFirstItem:m}){let[h,g]=q.useState(new Set),te=q.useRef(!1),ne=q.useRef(null),_=q.useCallback(e=>u?u(e):h.has(e),[u,h]),v=q.useMemo(()=>{let t=[];function n(e,r,i){let a=!!e.children&&e.children.length>0,o=_(e.id);if(t.push({node:e,depth:r,isExpanded:o,hasChildren:a,parentId:i}),a&&o&&e.children)for(let t of e.children)n(t,r+1,e.id)}for(let t of e)n(t,0);return t},[e,_]),re=q.useCallback(e=>e?`▼ `:`▶ `,[]),ie=q.useCallback(e=>` ▸ `,[]),ae=p??re,y=ee??ie,oe=q.useCallback(e=>{let t=``;return e.hasChildren?t=ae(e.isExpanded):e.depth>0&&(t=y(e.depth)),t+e.node.label},[ae,y]),se=q.useMemo(()=>v.map(e=>({label:oe(e),description:e.node.description,dimDescription:e.node.dimDescription??!0,value:e.node.id})),[v,oe]),b=q.useMemo(()=>{let e=new Map;return v.forEach(t=>e.set(t.node.id,t.node)),e},[v]),x=q.useCallback(e=>v.find(t=>t.node.id===e),[v]),ce=q.useCallback((e,t)=>{x(e)?.hasChildren&&(t?d?d(e):g(t=>new Set(t).add(e)):f?f(e):g(t=>{let n=new Set(t);return n.delete(e),n}))},[x,d,f]);return(0,Xe.jsx)(S,{tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(!a||c)return;let t=x(a);if(t){if(e.key===`right`&&t.hasChildren)e.preventDefault(),ce(a,!0);else if(e.key===`left`){if(t.hasChildren&&t.isExpanded)e.preventDefault(),ce(a,!1);else if(t.parentId!==void 0&&(e.preventDefault(),te.current=!0,ce(t.parentId,!1),i)){let e=b.get(t.parentId);e&&i(e)}}}},children:(0,Xe.jsx)(r,{options:se,onChange:q.useCallback(e=>{let n=b.get(e);n&&t(n)},[b,t]),onFocus:q.useCallback(e=>{if(te.current){te.current=!1;return}if(ne.current!==e&&(ne.current=e,i)){let t=b.get(e);t&&i(t)}},[i,b]),onCancel:n,defaultFocusValue:a,visibleOptionCount:o,layout:s,isDisabled:c,hideIndexes:l,onUpFromFirstItem:m})})}var q,Xe,Ze=e((()=>{q=t(T(),1),ge(),s(),Xe=O()}));function Qe(e,t){return N(e.replace(/\s+/g,` `).trim(),t)}function $e({before:e,match:t,after:n},r){return E.dim(e)+r(t)+E.dim(n)}function et(e,t,n){let r=e.toLowerCase().indexOf(t.toLowerCase());if(r===-1)return null;let i=r+t.length,a=Math.max(0,r-n),o=Math.min(e.length,i+n),s=e.slice(a,r),c=e.slice(r,i),l=e.slice(i,o);return{before:(a>0?`…`:``)+s.replace(/\s+/g,` `).trimStart(),match:c.trim(),after:l.replace(/\s+/g,` `).trimEnd()+(o<e.length?`…`:``)}}function tt(e,t,n){let{isGroupHeader:r=!1,isChild:i=!1,forkCount:a=0}=n||{},o=r&&a>0?ct:i?lt:0,s=r&&a>0?` (+${a} other ${a===1?`session`:`sessions`})`:``,c=e.isSidechain?` (sidechain)`:``,l=t-o-c.length-s.length;return`${Qe(j(e),l)}${c}${s}`}function nt(e,t){let{isChild:n=!1,showProjectPath:r=!1}=t||{},i=n?` `:``,a=ke(e),o=r&&e.projectPath?` · ${e.projectPath}`:``;return i+a+o}function rt({logs:e,maxHeight:t=1/0,forceWidth:n,onCancel:i,onSelect:o,onLogsChanged:s,onLoadMore:c,initialSearchQuery:l,showAllProjects:u=!1,onToggleAllProjects:p,onAgenticSearch:m}){let h=he(),ne=n===void 0?h.columns:n,re=Pe(i),ae=ue(),y=f(),[oe]=ce(),x=ee(oe),T=J.useMemo(()=>e=>me(e,x.warning),[x.warning]),[E,de]=J.useState(null),[D,ge]=J.useState(!1),[O,ve]=J.useState(!1),[be,k]=J.useState(!1),xe=J.useMemo(()=>_e(),[]),[Se,A]=J.useState(``),[Ce,Te]=J.useState(0),[Ee,De]=J.useState(new Set),[Oe,N]=J.useState(null),[Ae,je]=J.useState(1),[P,F]=J.useState(`list`),[Me,Ne]=J.useState(null),Fe=J.useRef(null),[Ie,Re]=J.useState(0),[I,ze]=J.useState({status:`idle`}),[L,R]=J.useState(!1),Ve=J.useRef(null),{query:z,setQuery:He,cursorOffset:B}=Le({isActive:P===`search`&&I.status!==`searching`,onExit:()=>{F(`list`),M(`tengu_session_search_toggled`,{enabled:!1})},onExitUp:()=>{F(`list`),M(`tengu_session_search_toggled`,{enabled:!1})},passthroughCtrlKeys:[`n`],initialQuery:l||``}),V=J.useDeferredValue(z),[H,U]=J.useState(``);J.useEffect(()=>{if(!V){U(``);return}let e=setTimeout(U,300,V);return()=>clearTimeout(e)},[V]);let[W,We]=J.useState(null),[Ge,Ke]=J.useState(!1);J.useEffect(()=>{we().then(e=>de(e)),d(xe).then(e=>{k(e.length>1)})},[xe]);let qe=J.useMemo(()=>new Map(e.map(e=>[e,at(e)])),[e]),Je=J.useMemo(()=>null,[e,qe,!1]),G=J.useMemo(()=>st(e),[e]),K=G.length>0,q=J.useMemo(()=>K?[`All`,...G]:[],[K,G]),Xe=q.length>0&&Ie<q.length?Ie:0,Ze=q[Xe],rt=Ze===`All`?void 0:Ze,it=+!!K,ct=J.useMemo(()=>{let t=e;return y&&(t=e.filter(e=>{let t=ye(),n=g(e);return!!(t&&n===t||e.customTitle||te(e.messages)||e.firstPrompt||e.customTitle)})),rt!==void 0&&(t=t.filter(e=>e.tag===rt)),D&&E&&(t=t.filter(e=>e.gitBranch===E)),be&&!O&&(t=t.filter(e=>e.projectPath===xe)),t},[e,y,rt,D,E,be,O,xe]),lt=J.useMemo(()=>{if(!z)return ct;let e=z.toLowerCase();return ct.filter(t=>{let n=j(t).toLowerCase(),r=(t.gitBranch||``).toLowerCase(),i=(t.tag||``).toLowerCase(),a=t.prNumber?`pr #${t.prNumber} ${t.prRepository||``}`.toLowerCase():``;return n.includes(e)||r.includes(e)||i.includes(e)||a.includes(e)})},[ct,z]);J.useEffect(()=>{},[V,H,!1]),J.useEffect(()=>{We(null),Ke(!1)},[H,Je,!1]);let{filteredLogs:ut,snippets:X}=J.useMemo(()=>{let e=new Map,t=lt;if(W&&H&&W.query===H){for(let t of W.results)if(t.searchableText){let n=et(t.searchableText,H,dt);n&&e.set(t.log,n)}let n=new Set(t.map(e=>e.messages[0]?.uuid)),r=W.results.map(e=>e.log).filter(e=>!n.has(e.messages[0]?.uuid));t=[...t,...r]}return{filteredLogs:t,snippets:e}},[lt,W,H]),Z=J.useMemo(()=>I.status===`results`&&I.results.length>0?I.results:ut,[I,ut]),Q=Math.max(30,ne-4),ft=J.useMemo(()=>{if(!y)return[];let e=ot(Z);return Array.from(e.entries()).map(([e,t])=>{let n=t[0],r=Z.indexOf(n),i=X.get(n),a=i?$e(i,T):null;if(t.length===1){let t=nt(n,{showProjectPath:u});return{id:`log:${e}:0`,value:{log:n,indexInFiltered:r},label:tt(n,Q),description:a?`${t}\n ${a}`:t,dimDescription:!0}}let o=t.length-1,s=t.slice(1).map((t,n)=>{let r=Z.indexOf(t),i=X.get(t),a=i?$e(i,T):null,o=nt(t,{isChild:!0,showProjectPath:u});return{id:`log:${e}:${n+1}`,value:{log:t,indexInFiltered:r},label:tt(t,Q,{isChild:!0}),description:a?`${o}\n ${a}`:o,dimDescription:!0}}),c=nt(n,{showProjectPath:u});return{id:`group:${e}`,value:{log:n,indexInFiltered:r},label:tt(n,Q,{isGroupHeader:!0,forkCount:o}),description:a?`${c}\n ${a}`:c,dimDescription:!0,children:s}})},[y,Z,Q,u,X,T]),pt=J.useMemo(()=>y?[]:Z.map((e,t)=>{let n=Qe(j(e)+(e.isSidechain?` (sidechain)`:``),Q),r=ke(e),i=u&&e.projectPath?` · ${e.projectPath}`:``,a=X.get(e),o=a?$e(a,T):null;return{label:n,description:o?`${r}${i}\n ${o}`:r+i,dimDescription:!0,value:t.toString()}}),[y,Z,T,Q,u,X]),$=Oe?.value.log??null,mt=()=>{if(!y||!$)return``;let e=g($);if(!e)return``;let t=Z.filter(t=>g(t)===e);if(!(t.length>1))return``;let n=Ee.has(e);return t.indexOf($)>0||n?`← to collapse`:`→ to expand`},ht=J.useCallback(async()=>{let e=$?g($):void 0;if(!$||!e){F(`list`),A(``);return}Se.trim()&&(await v(e,Se.trim(),$.fullPath),y&&s&&s()),F(`list`),A(``)},[$,Se,s,y]),gt=J.useCallback(()=>{F(`list`),M(`tengu_session_search_toggled`,{enabled:!1})},[]),_t=J.useCallback(()=>{F(`search`),M(`tengu_session_search_toggled`,{enabled:!0})},[]),vt=J.useCallback(async()=>{if(!z.trim()||!m||!0)return;Ve.current?.abort();let t=new AbortController;Ve.current=t,ze({status:`searching`}),M(`tengu_agentic_search_started`,{query_length:z.length});try{let n=await m(z,e,t.signal);if(t.signal.aborted)return;ze({status:`results`,results:n,query:z}),M(`tengu_agentic_search_completed`,{query_length:z.length,results_count:n.length})}catch(e){if(t.signal.aborted)return;ze({status:`error`,message:e instanceof Error?e.message:`Search failed`}),M(`tengu_agentic_search_error`,{query_length:z.length})}},[z,m,!1,e]);J.useEffect(()=>{I.status!==`idle`&&I.status!==`searching`&&(I.status===`results`&&I.query!==z||I.status===`error`)&&ze({status:`idle`})},[z,I]),J.useEffect(()=>()=>{Ve.current?.abort()},[]);let yt=J.useRef(I.status);J.useEffect(()=>{let e=yt.current;if(yt.current=I.status,e===`searching`&&I.status===`results`){if(y&&ft.length>0)N(ft[0]);else if(!y&&Z.length>0){let e=Z[0];N({id:`0`,value:{log:e,indexInFiltered:0},label:``})}}},[I.status,y,ft,Z]);let bt=J.useCallback(e=>{let t=parseInt(e,10),n=Z[t];!n||Fe.current===t.toString()||(Fe.current=t.toString(),N({id:t.toString(),value:{log:n,indexInFiltered:t},label:``}),je(t+1))},[Z]),xt=J.useCallback(e=>{N(e);let t=Z.findIndex(t=>g(t)===g(e.value.log));t>=0&&je(t+1)},[Z]);le(`confirm:no`,()=>{Ve.current?.abort(),ze({status:`idle`}),M(`tengu_agentic_search_cancelled`,{})},{context:`Confirmation`,isActive:P!==`preview`&&I.status===`searching`}),le(`confirm:no`,()=>{F(`list`),A(``)},{context:`Settings`,isActive:P===`rename`&&I.status!==`searching`}),le(`confirm:no`,()=>{He(``),R(!1),i?.()},{context:`Confirmation`,isActive:P!==`preview`&&P!==`rename`&&P!==`search`&&L&&I.status!==`searching`}),fe((e,t)=>{if(P!==`preview`&&I.status!==`searching`&&P!==`rename`)if(P===`search`)e.toLowerCase()===`n`&&t.ctrl?gt():(t.return||t.downArrow)&&z.trim();else{if(L){if(t.return){vt(),R(!1);return}else if(t.downArrow){R(!1);return}else if(t.upArrow){F(`search`),R(!1);return}}if(K&&t.tab){let e=t.shift?-1:1;Re(t=>{let n=((t<q.length?t:0)+q.length+e)%q.length,r=q[n];return M(`tengu_session_tag_filter_changed`,{is_all:r===`All`,tag_count:G.length}),n});return}let n=!t.ctrl&&!t.meta,r=e.toLowerCase();if(r===`a`&&t.ctrl&&p)p(),M(`tengu_session_all_projects_toggled`,{enabled:!u});else if(r===`b`&&t.ctrl){let e=!D;ge(e),M(`tengu_session_branch_filter_toggled`,{enabled:e})}else if(r===`w`&&t.ctrl&&be){let e=!O;ve(e),M(`tengu_session_worktree_filter_toggled`,{enabled:e})}else r===`/`&&n?(F(`search`),M(`tengu_session_search_toggled`,{enabled:!0})):r===`r`&&t.ctrl&&$?(F(`rename`),A(``),M(`tengu_session_rename_started`,{})):r===`v`&&t.ctrl&&$?(Ne($),F(`preview`),M(`tengu_session_preview_opened`,{messageCount:$.messageCount})):$&&n&&e.length>0&&!/^\s+$/.test(e)&&(F(`search`),He(e),M(`tengu_session_search_toggled`,{enabled:!0}))}},{isActive:!0});let St=[];D&&E&&St.push(E),be&&!O&&St.push(`current worktree`);let Ct=8+ +(St.length>0&&P!==`search`)+it,wt=Math.max(1,Math.floor((t-Ct-2)/3));return J.useEffect(()=>{if(!c)return;let e=wt*2;Ae+e>=Z.length&&c(wt*3)},[Ae,wt,Z.length,c]),e.length===0?null:P===`preview`&&Me&&y?(0,Y.jsx)(Be,{log:Me,onExit:()=>{F(`list`),Ne(null)},onSelect:o}):(0,Y.jsxs)(S,{flexDirection:`column`,height:t-1,children:[(0,Y.jsx)(S,{flexShrink:0,children:(0,Y.jsx)(se,{color:`suggestion`})}),(0,Y.jsx)(S,{flexShrink:0,children:(0,Y.jsx)(C,{children:` `})}),K?(0,Y.jsx)(Ue,{tabs:q,selectedIndex:Xe,availableWidth:ne,showAllProjects:u}):(0,Y.jsx)(S,{flexShrink:0,children:(0,Y.jsxs)(C,{bold:!0,color:`suggestion`,children:[`Resume Session`,P===`list`&&Z.length>wt&&(0,Y.jsxs)(C,{dimColor:!0,children:[` `,`(`,Ae,` of `,Z.length,`)`]})]})}),(0,Y.jsx)(pe,{query:z,isFocused:P===`search`,isTerminalFocused:ae,cursorOffset:B}),St.length>0&&P!==`search`&&(0,Y.jsx)(S,{flexShrink:0,paddingLeft:2,children:(0,Y.jsx)(C,{dimColor:!0,children:(0,Y.jsx)(w,{children:St})})}),(0,Y.jsx)(S,{flexShrink:0,children:(0,Y.jsx)(C,{children:` `})}),I.status===`searching`&&(0,Y.jsxs)(S,{paddingLeft:1,flexShrink:0,children:[(0,Y.jsx)(ie,{}),(0,Y.jsx)(C,{children:` Searching…`})]}),I.status===`results`&&I.results.length>0&&(0,Y.jsx)(S,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(C,{dimColor:!0,italic:!0,children:`Work Mate found these results:`})}),I.status===`results`&&I.results.length===0&&ut.length===0&&(0,Y.jsx)(S,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(C,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),I.status===`error`&&ut.length===0&&(0,Y.jsx)(S,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(C,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),!!z.trim()&&m&&!1,I.status===`searching`?null:P===`rename`&&$?(0,Y.jsxs)(S,{paddingLeft:2,flexDirection:`column`,children:[(0,Y.jsx)(C,{bold:!0,children:`Rename session:`}),(0,Y.jsx)(S,{paddingTop:1,children:(0,Y.jsx)(a,{value:Se,onChange:A,onSubmit:ht,placeholder:j($,`Enter new session name`),columns:ne,cursorOffset:Ce,onChangeCursorOffset:Te,showCursor:!0})})]}):y?(0,Y.jsx)(Ye,{nodes:ft,onSelect:e=>{o(e.value.log)},onFocus:xt,onCancel:i,focusNodeId:Oe?.id,visibleOptionCount:wt,layout:`expanded`,isDisabled:P===`search`||L,hideIndexes:!1,isNodeExpanded:e=>{if(P===`search`||D)return!0;let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;return t?Ee.has(t):!1},onExpand:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&(De(e=>new Set(e).add(t)),M(`tengu_session_group_expanded`,{}))},onCollapse:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&De(e=>{let n=new Set(e);return n.delete(t),n})},onUpFromFirstItem:_t}):(0,Y.jsx)(r,{options:pt,onChange:e=>{let t=Z[parseInt(e,10)];t&&o(t)},visibleOptionCount:wt,onCancel:i,onFocus:bt,defaultFocusValue:Oe?.id.toString(),layout:`expanded`,isDisabled:P===`search`||L,onUpFromFirstItem:_t}),(0,Y.jsx)(S,{paddingLeft:2,children:re.pending?(0,Y.jsxs)(C,{dimColor:!0,children:[`Press `,re.keyName,` again to exit`]}):P===`rename`?(0,Y.jsx)(C,{dimColor:!0,children:(0,Y.jsxs)(w,{children:[(0,Y.jsx)(b,{shortcut:`Enter`,action:`save`}),(0,Y.jsx)(_,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):I.status===`searching`?(0,Y.jsx)(C,{dimColor:!0,children:(0,Y.jsxs)(w,{children:[(0,Y.jsx)(C,{children:`Searching with Work Mate…`}),(0,Y.jsx)(_,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):L?(0,Y.jsx)(C,{dimColor:!0,children:(0,Y.jsxs)(w,{children:[(0,Y.jsx)(b,{shortcut:`Enter`,action:`search`}),(0,Y.jsx)(b,{shortcut:`↓`,action:`skip`}),(0,Y.jsx)(_,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):P===`search`?(0,Y.jsx)(C,{dimColor:!0,children:(0,Y.jsxs)(w,{children:[(0,Y.jsx)(C,{children:`Type to Search`}),(0,Y.jsx)(b,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(_,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`clear`})]})}):(0,Y.jsx)(C,{dimColor:!0,children:(0,Y.jsxs)(w,{children:[p&&(0,Y.jsx)(b,{shortcut:`Ctrl+A`,action:`show ${u?`current dir`:`all projects`}`}),E&&(0,Y.jsx)(b,{shortcut:`Ctrl+B`,action:`toggle branch`}),be&&(0,Y.jsx)(b,{shortcut:`Ctrl+W`,action:`show ${O?`current worktree`:`all worktrees`}`}),(0,Y.jsx)(b,{shortcut:`Ctrl+V`,action:`preview`}),(0,Y.jsx)(b,{shortcut:`Ctrl+R`,action:`rename`}),(0,Y.jsx)(C,{children:`Type to search`}),(0,Y.jsx)(_,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`}),mt()&&(0,Y.jsx)(C,{children:mt()})]})})})]})}function it(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function at(e){let t=(e.messages.length<=ut?e.messages:[...e.messages.slice(0,X),...e.messages.slice(-1e3)]).map(it).filter(Boolean).join(` `),n=`${[e.customTitle,e.summary,e.firstPrompt,e.gitBranch,e.tag,e.prNumber?`PR #${e.prNumber}`:void 0,e.prRepository].filter(Boolean).join(` `)} ${t}`.trim();return n.length>Z?n.slice(0,Z):n}function ot(e){let t=new Map;for(let n of e){let e=g(n);if(e){let r=t.get(e);r?r.push(n):t.set(e,[n])}}return t.forEach(e=>e.sort((e,t)=>new Date(t.modified).getTime()-new Date(e.modified).getTime())),t}function st(e){let t=new Set;for(let n of e)n.tag&&t.add(n.tag);return Array.from(t).sort((e,t)=>e.localeCompare(t))}var J,Y,ct,lt,ut,X,Z,dt,Q=e((()=>{de(),J=t(T(),1),ve(),Fe(),Re(),i(),ge(),oe(),Oe(),je(),n(),Te(),Ee(),h(),ae(),re(),s(),Ie(),Ve(),ne(),K(),l(),Ze(),Y=O(),ct=2,lt=4,ut=2e3,X=1e3,Z=5e4,dt=50}));function ft(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function pt(e){if(e.length===0)return``;let t=(e.length<=gt?e:[...e.slice(0,gt/2),...e.slice(-100/2)]).map(ft).filter(Boolean).join(` `).replace(/\s+/g,` `).trim();return t.length>ht?`${t.slice(0,ht)}…`:t}function $(e,t){return!!(j(e).toLowerCase().includes(t)||e.customTitle?.toLowerCase().includes(t)||e.tag?.toLowerCase().includes(t)||e.gitBranch?.toLowerCase().includes(t)||e.summary?.toLowerCase().includes(t)||e.firstPrompt?.toLowerCase().includes(t)||e.messages&&e.messages.length>0&&pt(e.messages).toLowerCase().includes(t))}async function mt(e,t,n){if(!e.trim()||t.length===0)return[];let r=e.toLowerCase(),i=t.filter(e=>$(e,r)),a;if(i.length>=_t)a=i.slice(0,_t);else{let e=t.filter(e=>!$(e,r)),n=_t-i.length;a=[...i,...e.slice(0,n)]}k(`Agentic search: ${a.length}/${t.length} logs, query="${e}", matching: ${i.length}, with messages: ${A(a,e=>e.messages?.length>0)}`);let s=a.map(async e=>{if(y(e))try{return await o(e)}catch(t){return De(t),e}return e}),l=await Promise.all(s);k(`Agentic search: loaded ${A(l,e=>e.messages?.length>0)}/${a.length} logs with transcripts`);let u=`Sessions:
2
- ${l.map((e,t)=>{let n=[`${t}:`],r=j(e);if(n.push(r),e.customTitle&&e.customTitle!==r&&n.push(`[custom title: ${e.customTitle}]`),e.tag&&n.push(`[tag: ${e.tag}]`),e.gitBranch&&n.push(`[branch: ${e.gitBranch}]`),e.summary&&n.push(`- Summary: ${e.summary}`),e.firstPrompt&&e.firstPrompt!==`No prompt`&&n.push(`- First message: ${e.firstPrompt.slice(0,300)}`),e.messages&&e.messages.length>0){let t=pt(e.messages);t&&n.push(`- Transcript: ${t}`)}return n.join(` `)}).join(`
3
- `)}
4
-
5
- Search query: "${e}"
6
-
7
- Find the sessions that are most relevant to this query.`;k(`Agentic search prompt (first 500 chars): ${u.slice(0,500)}...`);try{let e=F();k(`Agentic search using model: ${e}`);let t=(await c({model:e,system:vt,messages:[{role:`user`,content:u}],signal:n,querySource:`session_search`})).content.find(e=>e.type===`text`);if(t?.type!==`text`)return k(`No text content in agentic search response`),[];k(`Agentic search response: ${t.text}`);let r=t.text.match(/\{[\s\S]*\}/);if(!r)return k(`Could not find JSON in agentic search response`),[];let i=(be(r[0]).relevant_indices||[]).filter(e=>e>=0&&e<l.length).map(e=>l[e]);return k(`Agentic search found ${i.length} relevant sessions`),i}catch(e){return De(e),k(`Agentic search error: ${e}`),[]}}var ht,gt,_t,vt,yt=e((()=>{Ce(),xe(),Ee(),P(),h(),p(),Se(),ht=2e3,gt=100,_t=100,vt=`Your goal is to find relevant sessions based on a user's search query.
8
-
9
- You will be given a list of sessions with their metadata and a search query. Identify which sessions are most relevant to the query.
10
-
11
- Each session may include:
12
- - Title (display name or custom title)
13
- - Tag (user-assigned category, shown as [tag: name] - users tag sessions with /tag command to categorize them)
14
- - Branch (git branch name, shown as [branch: name])
15
- - Summary (AI-generated summary)
16
- - First message (beginning of the conversation)
17
- - Transcript (excerpt of conversation content)
18
-
19
- IMPORTANT: Tags are user-assigned labels that indicate the session's topic or category. If the query matches a tag exactly or partially, those sessions should be highly prioritized.
20
-
21
- For each session, consider (in order of priority):
22
- 1. Exact tag matches (highest priority - user explicitly categorized this session)
23
- 2. Partial tag matches or tag-related terms
24
- 3. Title matches (custom titles or first message content)
25
- 4. Branch name matches
26
- 5. Summary and transcript content matches
27
- 6. Semantic similarity and related concepts
28
-
29
- CRITICAL: Be VERY inclusive in your matching. Include sessions that:
30
- - Contain the query term anywhere in any field
31
- - Are semantically related to the query (e.g., "testing" matches sessions about "tests", "unit tests", "QA", etc.)
32
- - Discuss topics that could be related to the query
33
- - Have transcripts that mention the concept even in passing
34
-
35
- When in doubt, INCLUDE the session. It's better to return too many results than too few. The user can easily scan through results, but missing relevant sessions is frustrating.
36
-
37
- Return sessions ordered by relevance (most relevant first). If truly no sessions have ANY connection to the query, return an empty array - but this should be rare.
38
-
39
- Respond with ONLY the JSON object, no markdown formatting:
40
- {"relevant_indices": [2, 5, 0]}`}));function bt(e,t){let n=_e();if(!t||!e.projectPath||e.projectPath===n)return{isCrossProject:!1};let r=g(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${Me([e.projectPath])} && claude --resume ${r}`,projectPath:e.projectPath}}var xt=e((()=>{ve(),Ne(),h()}));export{rt as a,yt as i,xt as n,Q as o,mt as r,bt as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./cwd-Nh5IZNKO.js";e();export{t as getCwd};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$ as t,D as n,Ut as r}from"./state-D5D6QpTX.js";import{AsyncLocalStorage as i}from"async_hooks";function a(e,t){return c.run(e,t)}function o(){return c.getStore()??n()}function s(){try{return o()}catch{return t()}}var c,l=e((()=>{r(),c=new i}));export{a as i,l as n,o as r,s as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{C as t,P as n,R as r,c as i,i as a,x as o}from"./debug-D58GQBDG.js";import{n as s,r as c}from"./analytics-DJobLaWP.js";function l(e){return e.replace(_,(e,t,n)=>n.length<v?`"${t}":"[REDACTED]"`:`"${t}":"${`${n.slice(0,8)}...${n.slice(-4)}`}"`)}function u(e){let t=e.replace(/\n/g,`\\n`);return t.length<=g?t:`${t.slice(0,g)}... (${t.length} chars)`}function d(e){let n=l(typeof e==`string`?e:t(e));return n.length<=g?n:`${n.slice(0,g)}... (${n.length} chars)`}function f(e){let t=n(e);if(e&&typeof e==`object`&&`response`in e){let n=e.response;if(n?.data&&typeof n.data==`object`){let e=n.data,r=typeof e.message==`string`?e.message:typeof e.error==`object`&&e.error&&`message`in e.error&&typeof e.error.message==`string`?e.error.message:void 0;if(r)return`${t}: ${r}`}}return t}function p(e){if(e&&typeof e==`object`&&`response`in e&&e.response&&typeof e.response.status==`number`)return e.response.status}function m(e){if(!(!e||typeof e!=`object`)){if(`message`in e&&typeof e.message==`string`)return e.message;if(`error`in e&&e.error!==null&&typeof e.error==`object`&&`message`in e.error&&typeof e.error.message==`string`)return e.error.message}}function h(e,t,n){t&&i(t),c(`tengu_bridge_repl_skipped`,{reason:e,...n!==void 0&&{v2:n}})}var g,_,v,y=e((()=>{s(),a(),r(),o(),g=2e3,_=RegExp(`"(${[`session_ingress_token`,`environment_secret`,`access_token`,`secret`,`token`].join(`|`)})"\\s*:\\s*"([^"]*)"`,`g`),v=16}));export{p as a,m as i,u as n,y as o,f as r,h as s,d as t};
@@ -1,4 +0,0 @@
1
- import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{a as n,t as r}from"./cliLaunch-DDtwAolw.js";import{dirname as i}from"path";import{closeSync as a,createReadStream as o,mkdirSync as s,openSync as c,readSync as l,statSync as u,unwatchFile as d,watchFile as f}from"fs";import{createInterface as p}from"readline";async function m(e){let t=0;try{if(t=u(e).size,t>0){let n=p({input:o(e,{start:0,end:t-1})});for await(let e of n)process.stdout.write(`${e}\n`)}}catch{}return console.log(`
2
- [tail] Watching for new output... (Ctrl+C to detach)
3
- `),new Promise(n=>{let r=()=>{d(e),process.removeListener(`SIGINT`,r),console.log(`
4
- [tail] Detached from session.`),n()};process.on(`SIGINT`,r),f(e,{interval:300},()=>{try{let n=u(e);if(n.size<=t)return;let r=c(e,`r`);try{let e=Buffer.alloc(n.size-t);l(r,e,0,e.length,t),process.stdout.write(e),t=n.size}finally{a(r)}}catch{}})})}e();var h=class{constructor(){t(this,`name`,`detached`),t(this,`supportsInteractiveInput`,!1)}async available(){return!0}async start(e){s(i(e.logPath),{recursive:!0});let t=c(e.logPath,`a`),o=n(r(e.args,{env:{...e.env,CLAUDE_CODE_SESSION_KIND:`bg`,CLAUDE_CODE_SESSION_NAME:e.sessionName,CLAUDE_CODE_SESSION_LOG:e.logPath}}),{detached:!0,stdio:[`ignore`,t,t],cwd:e.cwd});return o.unref(),a(t),{pid:o.pid??0,sessionName:e.sessionName,logPath:e.logPath,engineUsed:`detached`}}async attach(e){if(!e.logPath)throw Error(`Session ${e.sessionId} has no log path.`);await m(e.logPath)}};export{h as DetachedEngine};
@@ -1 +0,0 @@
1
- import{a as e,i as t,o as n}from"./detectRepository-pRAVv8SH.js";t();export{e as parseGitHubRepository,n as parseGitRemote};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./cwd-Nh5IZNKO.js";import{c as r,i}from"./debug-D58GQBDG.js";import{m as a,u as o}from"./git-Wid-XppW.js";function s(){p.clear()}async function c(){let e=await l();return!e||e.host!==`github.com`?null:`${e.owner}/${e.name}`}async function l(){let e=n();if(p.has(e))return p.get(e)??null;try{let t=await o();if(r(`Git remote URL: ${t}`),!t)return r(`No git remote URL found`),p.set(e,null),null;let n=u(t);return r(`Parsed repository: ${n?`${n.host}/${n.owner}/${n.name}`:null} from URL: ${t}`),p.set(e,n),n}catch(t){return r(`Error detecting repository: ${t}`),p.set(e,null),null}}function u(e){let t=e.trim(),n=t.match(/^git@([^:]+):([^/]+)\/([^/]+?)(?:\.git)?$/);if(n?.[1]&&n[2]&&n[3])return f(n[1])?{host:n[1],owner:n[2],name:n[3]}:null;let r=t.match(/^(https?|ssh|git):\/\/(?:[^@]+@)?([^/:]+(?::\d+)?)\/([^/]+)\/([^/]+?)(?:\.git)?$/);if(r?.[1]&&r[2]&&r[3]&&r[4]){let e=r[1],t=r[2],n=t.split(`:`)[0]??``;return f(n)?{host:e===`https`||e===`http`?t:n,owner:r[3],name:r[4]}:null}return null}function d(e){let t=e.trim(),n=u(t);if(n)return n.host===`github.com`?`${n.owner}/${n.name}`:null;if(!t.includes(`://`)&&!t.includes(`@`)&&t.includes(`/`)){let e=t.split(`/`);if(e.length===2&&e[0]&&e[1]){let t=e[1].replace(/\.git$/,``);return`${e[0]}/${t}`}}return r(`Could not parse repository from: ${t}`),null}function f(e){if(!e.includes(`.`))return!1;let t=e.split(`.`).pop();return t?/^[a-zA-Z]+$/.test(t):!1}var p,m=e((()=>{t(),i(),a(),p=new Map}));export{d as a,m as i,c as n,u as o,l as r,s as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./cwd-Nh5IZNKO.js";import{f as r,u as i}from"./debug-D58GQBDG.js";import{ar as a,sr as o}from"./settings-BowI3jp-.js";import{o as s,s as c}from"./log-CZ7ploQm.js";import{a as l,i as u}from"./memoize-CumjjK2Q.js";import{basename as d,dirname as f,join as p,sep as m}from"path";function h(e,t){if(!e)return{directory:t||n(),prefix:``};let r=a(e,t);return e.endsWith(`/`)||e.endsWith(m)?{directory:r,prefix:``}:{directory:f(r),prefix:d(e)}}async function g(e){let t=C.get(e);if(t)return t;try{let t=(await i().readdir(e)).filter(e=>e.isDirectory()&&!e.name.startsWith(`.`)).map(t=>({name:t.name,path:p(e,t.name),type:`directory`})).slice(0,100);return C.set(e,t),t}catch(e){return c(e),[]}}async function _(e,t={}){let{basePath:r=n(),maxResults:i=10}=t,{directory:a,prefix:o}=h(e,r),s=await g(a),c=o.toLowerCase();return s.filter(e=>e.name.toLowerCase().startsWith(c)).slice(0,i).map(e=>({id:e.path,displayText:`${e.name}/`,description:`directory`,metadata:{type:`directory`}}))}function v(e){return e.startsWith(`~/`)||e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`)||e===`~`||e===`.`||e===`..`}async function y(e,t=!1){let n=`${e}:${t}`,r=w.get(n);if(r)return r;try{let r=(await i().readdir(e)).filter(e=>t||!e.name.startsWith(`.`)).map(t=>({name:t.name,path:p(e,t.name),type:t.isDirectory()?`directory`:`file`})).sort((e,t)=>e.type===`directory`&&t.type!==`directory`?-1:e.type!==`directory`&&t.type===`directory`?1:e.name.localeCompare(t.name)).slice(0,100);return w.set(n,r),r}catch(e){return c(e),[]}}async function b(e,t={}){let{basePath:r=n(),maxResults:i=10,includeFiles:a=!0,includeHidden:o=!1}=t,{directory:s,prefix:c}=h(e,r),l=await y(s,o),u=c.toLowerCase(),d=l.filter(e=>!a&&e.type===`file`?!1:e.name.toLowerCase().startsWith(u)).slice(0,i),f=e.includes(`/`)||e.includes(m),p=``;if(f){let t=e.lastIndexOf(`/`),n=e.lastIndexOf(m),r=Math.max(t,n);p=e.substring(0,r+1)}return(p.startsWith(`./`)||p.startsWith(`.${m}`))&&(p=p.slice(2)),d.map(e=>{let t=p+e.name;return{id:t,displayText:e.type===`directory`?`${t}/`:t,metadata:{type:e.type}}})}var x,S,C,w,T=e((()=>{l(),t(),r(),s(),o(),x=500,S=300*1e3,C=new u({max:x,ttl:S}),w=new u({max:x,ttl:S})}));export{v as i,b as n,T as r,_ as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./dist-es-C3reqy7X.js";t();export{e as fromTokenFile};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{d as r,f as i,l as a}from"./protocols-CCsohXid.js";var o,s=e((()=>{o={CrtSignerV4:null}}));function c(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,expiration:e.expiration}}function l(e,t){let n=e.credentialProvider;e.credentialProvider=()=>(e.credentialProvider=n,Promise.resolve(t))}var u,d,f,p=e((()=>{a(),u=`X-Amz-S3session-Token`,d=u.toLowerCase(),f=class extends i{async signWithCredentials(e,t,n){let r=c(t);e.headers[d]=t.sessionToken;let i=this;return l(i,r),i.signRequest(e,n??{})}async presignWithCredentials(e,t,n){let r=c(t);return delete e.headers[d],e.headers[u]=t.sessionToken,e.query=e.query??{},e.query[u]=t.sessionToken,l(this,r),this.presign(e,n)}}})),m,h=e((()=>{a(),s(),p(),t(),m=class{static sigv4aDependency(){return typeof o.CrtSignerV4==`function`?`crt`:typeof r.SignatureV4a==`function`?`js`:`none`}constructor(e){n(this,`sigv4aSigner`,void 0),n(this,`sigv4Signer`,void 0),n(this,`signerOptions`,void 0),this.sigv4Signer=new f(e),this.signerOptions=e}async sign(e,t={}){return t.signingRegion===`*`?this.getSigv4aSigner().sign(e,t):this.sigv4Signer.sign(e,t)}async signWithCredentials(e,t,n={}){if(n.signingRegion===`*`){let r=this.getSigv4aSigner(),i=o.CrtSignerV4;if(i&&r instanceof i)return r.signWithCredentials(e,t,n);throw Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.signWithCredentials(e,t,n)}async presign(e,t={}){if(t.signingRegion===`*`){let n=this.getSigv4aSigner(),r=o.CrtSignerV4;if(r&&n instanceof r)return n.presign(e,t);throw Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.presign(e,t)}async presignWithCredentials(e,t,n={}){if(n.signingRegion===`*`)throw Error(`Method presignWithCredentials is not supported for [signingRegion=*].`);return this.sigv4Signer.presignWithCredentials(e,t,n)}getSigv4aSigner(){if(!this.sigv4aSigner){let e=o.CrtSignerV4,t=r.SignatureV4a;if(this.signerOptions.runtime===`node`){if(!e&&!t)throw Error(`Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);if(e&&typeof e==`function`)this.sigv4aSigner=new e({...this.signerOptions,signingAlgorithm:1});else if(t&&typeof t==`function`)this.sigv4aSigner=new t({...this.signerOptions});else throw Error(`Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}else{if(!t||typeof t!=`function`)throw Error(`JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a`);this.sigv4aSigner=new t({...this.signerOptions})}}return this.sigv4aSigner}}})),g=e((()=>{h(),s(),p()}));export{m as n,h as r,g as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{C as r,D as i,E as a,F as o,I as ee,K as s,L as c,M as l,O as u,P as te,U as ne,V as re,X as ie,Y as ae,_ as oe,d as se,et as ce,g as le,i as ue,j as de,k as fe,l as pe,mt as me,n as he,nt as ge,ot as _e,p as ve,q as d,rt as ye,s as be,st as xe,t as f,vt as Se,x as Ce,y as we,z as Te}from"./client-DvAL7lY8.js";import{B as Ee,D as De,H as Oe,M as ke,O as Ae,Y as je,c as Me,o as Ne,t as p,u as Pe}from"./protocols-CnYQjBlj.js";import{B as Fe,H as Ie,L as Le,c as Re,d as ze,r as m,z as Be}from"./serde-f76bObzR.js";import{a as Ve,d as He,l as Ue,m as h,o as We,r as Ge,s as Ke,t as g}from"./config-BSXLgwpD.js";import{C as qe,c as _,f as Je,t as v,v as Ye}from"./dist-es-BF6bR-Ik.js";import{n as Xe,t as Ze}from"./checksum-DgbnMdM-.js";import{C as Qe,_ as $e,c as et,g as tt,m as nt,n as rt,o as y,t as it,x as at}from"./protocols-CCsohXid.js";import{i as ot,t as st}from"./dist-es-CYPVg66r.js";import{a as ct,t as lt}from"./dist-es-Bfr4TzQe.js";import{n as ut,t as dt}from"./dist-es-BIjDeceU.js";var b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,I,L,ft,pt,mt,ht=e((()=>{o(),b=`ref`,x=-1,S=!0,C=`isSet`,w=`PartitionResult`,T=`booleanEquals`,E=`stringEquals`,D=`getAttr`,O=`us-east-1`,k=`sigv4`,A=`sts`,j=`https://sts.{Region}.{PartitionResult#dnsSuffix}`,M={[b]:`Endpoint`},N={[b]:`Region`},P={[b]:w},F={},I=[N],L={conditions:[[C,[M]],[C,I],[`aws.partition`,I,w],[T,[{[b]:`UseFIPS`},S]],[T,[{[b]:`UseDualStack`},S]],[E,[N,`aws-global`]],[T,[{[b]:`UseGlobalEndpoint`},S]],[E,[N,`eu-central-1`]],[T,[{fn:D,argv:[P,`supportsDualStack`]},S]],[T,[{fn:D,argv:[P,`supportsFIPS`]},S]],[E,[N,`ap-south-1`]],[E,[N,`eu-north-1`]],[E,[N,`eu-west-1`]],[E,[N,`eu-west-2`]],[E,[N,`eu-west-3`]],[E,[N,`sa-east-1`]],[E,[N,O]],[E,[N,`us-east-2`]],[E,[N,`us-west-2`]],[E,[N,`us-west-1`]],[E,[N,`ca-central-1`]],[E,[N,`ap-southeast-1`]],[E,[N,`ap-northeast-1`]],[E,[N,`ap-southeast-2`]],[E,[{fn:D,argv:[P,`name`]},`aws-us-gov`]]],results:[[x],[`https://sts.amazonaws.com`,{authSchemes:[{name:k,signingName:A,signingRegion:O}]}],[j,{authSchemes:[{name:k,signingName:A,signingRegion:`{Region}`}]}],[x,`Invalid Configuration: FIPS and custom endpoint are not supported`],[x,`Invalid Configuration: Dualstack and custom endpoint are not supported`],[M,F],[`https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,F],[x,`FIPS and DualStack are enabled, but this partition does not support one or both`],[`https://sts.{Region}.amazonaws.com`,F],[`https://sts-fips.{Region}.{PartitionResult#dnsSuffix}`,F],[x,`FIPS is enabled but this partition does not support FIPS`],[`https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}`,F],[x,`DualStack is enabled but this partition does not support DualStack`],[j,F],[x,`Invalid Configuration: Missing Region`]]},ft=2,pt=new Int32Array([-1,1,-1,0,30,3,1,4,100000014,2,5,100000014,3,25,6,4,24,7,5,100000001,8,6,9,100000013,7,100000001,10,10,100000001,11,11,100000001,12,12,100000001,13,13,100000001,14,14,100000001,15,15,100000001,16,16,100000001,17,17,100000001,18,18,100000001,19,19,100000001,20,20,100000001,21,21,100000001,22,22,100000001,23,23,100000001,100000002,8,100000011,100000012,4,28,26,9,27,100000010,24,100000008,100000009,8,29,100000007,9,100000006,100000007,3,100000003,31,4,100000004,100000005]),mt=ne.from(pt,ft,L.conditions,L.results)})),gt,R,_t=e((()=>{f(),o(),ht(),gt=new re({size:50,params:[`Endpoint`,`Region`,`UseDualStack`,`UseFIPS`,`UseGlobalEndpoint`]}),R=(e,t={})=>gt.get(e,()=>c(mt,{endpointParams:e,logger:t.logger})),Te.aws=be}));function vt(e){return{schemeId:`aws.auth#sigv4`,signingProperties:{name:`sts`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function z(e){return{schemeId:`aws.auth#sigv4a`,signingProperties:{name:`sts`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function B(e){return{schemeId:`smithy.api#noAuth`}}var yt,bt,xt,St,Ct,wt,Tt,Et=e((()=>{y(),dt(),d(),o(),_t(),yt=e=>async(t,n,r)=>{if(!r)throw Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");let i=await e(t,n,r),a=je(n)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!a)throw Error(`getEndpointParameterInstructions() is not defined on '${n.commandName}'`);let o=await s(r,{getEndpointParameterInstructions:a},t);return Object.assign(i,o)},bt=async(e,t,n)=>({operation:je(t).operation,region:await Oe(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),xt=yt(bt),St=(e,t,n)=>r=>{let i=e(r).properties?.authSchemes;if(!i)return t(r);let a=[];for(let e of i){let{name:t,properties:o={},...ee}=e,s=t.toLowerCase();t!==s&&console.warn(`HttpAuthScheme has been normalized with lowercasing: '${t}' to '${s}'`);let c;if(s===`sigv4a`){c=`aws.auth#sigv4a`;let e=i.find(e=>{let t=e.name.toLowerCase();return t!==`sigv4a`&&t.startsWith(`sigv4`)});if(ut.sigv4aDependency()===`none`&&e)continue}else if(s.startsWith(`sigv4`))c=`aws.auth#sigv4`;else throw Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${s}'`);let l=n[c];if(!l)throw Error(`Could not find HttpAuthOption create function for '${c}'`);let u=l(r);u.schemeId=c,u.signingProperties={...u.signingProperties||{},...ee,...o},a.push(u)}return a},Ct=e=>{let t=[];switch(e.operation){case`AssumeRoleWithSAML`:t.push(B(e)),t.push(z(e));break;case`AssumeRoleWithWebIdentity`:t.push(B(e)),t.push(z(e));break;default:t.push(vt(e)),t.push(z(e))}return t},wt=St(R,Ct,{"aws.auth#sigv4":vt,"aws.auth#sigv4a":z,"smithy.api#noAuth":B}),Tt=e=>{let t=tt(et(e));return Object.assign(t,{authSchemePreference:Oe(e.authSchemePreference??[])})}})),Dt,Ot,kt=e((()=>{Dt=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,defaultSigningName:`sts`}),Ot={UseGlobalEndpoint:{type:`builtInParams`,name:`useGlobalEndpoint`},UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}})),At,jt,Mt,V,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt=e((()=>{At=`@aws-sdk/client-sts`,jt=`AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native`,Mt=`3.1085.0`,V={build:`concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs`,"build:cjs":`node ../../scripts/compilation/inline`,"build:es":`premove dist-es && tsc -p tsconfig.es.json`,"build:include:deps":`yarn g:turbo run build -F="$npm_package_name"`,"build:types":`premove dist-types && tsc -p tsconfig.types.json`,"build:types:downlevel":`downlevel-dts dist-types dist-types/ts3.4`,clean:`premove dist-cjs dist-es dist-types`,"extract:docs":`api-extractor run --local`,"generate:client":`node ../../scripts/generate-clients/single-service`,test:`yarn g:vitest run --passWithNoTests`,"test:watch":`yarn g:vitest watch --passWithNoTests`,"test:integration":`yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts`,"test:integration:watch":`yarn g:vitest watch --passWithNoTests -c vitest.config.integ.mts`,"test:e2e":`yarn g:vitest run -c vitest.config.e2e.mts`,"test:e2e:watch":`yarn g:vitest watch -c vitest.config.e2e.mts`,"test:index":`tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs`},Nt=`./dist-cjs/index.js`,Pt=`./dist-types/index.d.ts`,Ft=`./dist-es/index.js`,It={"@aws-sdk/core":`^3.975.1`,"@aws-sdk/credential-provider-node":`^3.972.66`,"@aws-sdk/signature-v4-multi-region":`^3.996.39`,"@aws-sdk/types":`^3.974.0`,"@smithy/core":`^3.29.2`,"@smithy/fetch-http-handler":`^5.6.4`,"@smithy/node-http-handler":`^4.9.4`,"@smithy/types":`^4.16.0`,tslib:`^2.6.2`},Lt={"@smithy/snapshot-testing":`^2.2.7`,"@tsconfig/node20":`20.1.8`,"@types/node":`^20.14.8`,concurrently:`7.0.0`,"downlevel-dts":`0.10.1`,premove:`4.0.0`,typescript:`~5.8.3`,vitest:`^4.0.17`},Rt={node:`>=20.0.0`},zt={"<4.5":{"dist-types/*":[`dist-types/ts3.4/*`]}},Bt=[`dist-*/**`],Vt={name:`AWS SDK for JavaScript Team`,url:`https://aws.amazon.com/sdk-for-javascript/`},Ht=`Apache-2.0`,Ut={"./dist-es/runtimeConfig":`./dist-es/runtimeConfig.browser`},Wt=`https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts`,Gt={type:`git`,url:`https://github.com/aws/aws-sdk-js-v3.git`,directory:`clients/client-sts`},Kt={name:At,description:jt,version:Mt,scripts:V,main:Nt,types:Pt,module:Ft,sideEffects:!1,dependencies:It,devDependencies:Lt,engines:Rt,typesVersions:zt,files:Bt,author:Vt,license:Ht,browser:Ut,"react-native":{"./dist-es/runtimeConfig":`./dist-es/runtimeConfig.native`},homepage:Wt,repository:Gt}})),H,U=e((()=>{d(),H=class e extends xe{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn=e((()=>{U(),t(),Jt=class e extends H{constructor(t){super({name:`ExpiredTokenException`,$fault:`client`,...t}),n(this,`name`,`ExpiredTokenException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},Yt=class e extends H{constructor(t){super({name:`MalformedPolicyDocumentException`,$fault:`client`,...t}),n(this,`name`,`MalformedPolicyDocumentException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},Xt=class e extends H{constructor(t){super({name:`PackedPolicyTooLargeException`,$fault:`client`,...t}),n(this,`name`,`PackedPolicyTooLargeException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},Zt=class e extends H{constructor(t){super({name:`RegionDisabledException`,$fault:`client`,...t}),n(this,`name`,`RegionDisabledException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},Qt=class e extends H{constructor(t){super({name:`IDPRejectedClaimException`,$fault:`client`,...t}),n(this,`name`,`IDPRejectedClaimException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},$t=class e extends H{constructor(t){super({name:`InvalidIdentityTokenException`,$fault:`client`,...t}),n(this,`name`,`InvalidIdentityTokenException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},en=class e extends H{constructor(t){super({name:`IDPCommunicationErrorException`,$fault:`client`,...t}),n(this,`name`,`IDPCommunicationErrorException`),n(this,`$fault`,`client`),n(this,`$retryable`,{}),Object.setPrototypeOf(this,e.prototype)}},tn=class e extends H{constructor(t){super({name:`InvalidAuthorizationMessageException`,$fault:`client`,...t}),n(this,`name`,`InvalidAuthorizationMessageException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},nn=class e extends H{constructor(t){super({name:`ExpiredTradeInTokenException`,$fault:`client`,...t}),n(this,`name`,`ExpiredTradeInTokenException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},rn=class e extends H{constructor(t){super({name:`JWTPayloadSizeExceededException`,$fault:`client`,...t}),n(this,`name`,`JWTPayloadSizeExceededException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},an=class e extends H{constructor(t){super({name:`OutboundWebIdentityFederationDisabledException`,$fault:`client`,...t}),n(this,`name`,`OutboundWebIdentityFederationDisabledException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}},on=class e extends H{constructor(t){super({name:`SessionDurationEscalationException`,$fault:`client`,...t}),n(this,`name`,`SessionDurationEscalationException`),n(this,`$fault`,`client`),Object.setPrototypeOf(this,e.prototype)}}})),cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,W,G,K,q,J,Y,X,Z,En,Q,Dn,On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,$=e((()=>{De(),sn(),U(),cn=`Arn`,ln=`Account`,un=`ExpiredTokenException`,dn=`ExpiredTradeInTokenException`,fn=`GetCallerIdentity`,pn=`GetCallerIdentityRequest`,mn=`GetCallerIdentityResponse`,hn=`InvalidAuthorizationMessageException`,gn=`IDPCommunicationErrorException`,_n=`IDPRejectedClaimException`,vn=`InvalidIdentityTokenException`,yn=`JWTPayloadSizeExceededException`,bn=`MalformedPolicyDocumentException`,xn=`OutboundWebIdentityFederationDisabledException`,Sn=`PackedPolicyTooLargeException`,Cn=`RegionDisabledException`,wn=`SessionDurationEscalationException`,Tn=`UserId`,W=`awsQueryError`,G=`client`,K=`error`,q=`httpError`,J=`message`,Y=`smithy.ts.sdk.synthetic.com.amazonaws.sts`,X=`com.amazonaws.sts`,Z=Ae.for(Y),En=[-3,Y,`STSServiceException`,0,[],[]],Z.registerError(En,H),Q=Ae.for(X),Dn=[-3,X,un,{[W]:[`ExpiredTokenException`,400],[K]:G,[q]:400},[J],[0]],Q.registerError(Dn,Jt),On=[-3,X,dn,{[W]:[`ExpiredTradeInTokenException`,400],[K]:G,[q]:400},[J],[0]],Q.registerError(On,nn),kn=[-3,X,gn,{[W]:[`IDPCommunicationError`,400],[K]:G,[q]:400},[J],[0]],Q.registerError(kn,en),An=[-3,X,_n,{[W]:[`IDPRejectedClaim`,403],[K]:G,[q]:403},[J],[0]],Q.registerError(An,Qt),jn=[-3,X,hn,{[W]:[`InvalidAuthorizationMessageException`,400],[K]:G,[q]:400},[J],[0]],Q.registerError(jn,tn),Mn=[-3,X,vn,{[W]:[`InvalidIdentityToken`,400],[K]:G,[q]:400},[J],[0]],Q.registerError(Mn,$t),Nn=[-3,X,yn,{[W]:[`JWTPayloadSizeExceededException`,400],[K]:G,[q]:400},[J],[0]],Q.registerError(Nn,rn),Pn=[-3,X,bn,{[W]:[`MalformedPolicyDocument`,400],[K]:G,[q]:400},[J],[0]],Q.registerError(Pn,Yt),Fn=[-3,X,xn,{[W]:[`OutboundWebIdentityFederationDisabledException`,403],[K]:G,[q]:403},[J],[0]],Q.registerError(Fn,an),In=[-3,X,Sn,{[W]:[`PackedPolicyTooLarge`,400],[K]:G,[q]:400},[J],[0]],Q.registerError(In,Xt),Ln=[-3,X,Cn,{[W]:[`RegionDisabledException`,403],[K]:G,[q]:403},[J],[0]],Q.registerError(Ln,Zt),Rn=[-3,X,wn,{[W]:[`SessionDurationEscalationException`,403],[K]:G,[q]:403},[J],[0]],Q.registerError(Rn,on),zn=[Z,Q],Bn=[3,X,pn,0,[],[]],Vn=[3,X,mn,0,[Tn,ln,cn],[0,0,0]],Hn=[9,X,fn,0,()=>Bn,()=>Vn]})),Un,Wn=e((()=>{y(),it(),dt(),v(),Ze(),d(),p(),m(),Et(),_t(),$(),Un=e=>({apiVersion:`2011-06-15`,base64Decoder:e?.base64Decoder??Ie,base64Encoder:e?.base64Encoder??Be,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??R,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??wt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4`),signer:new Qe},{schemeId:`aws.auth#sigv4a`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4a`),signer:new at},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new _}],logger:e?.logger??new ie,protocol:e?.protocol??rt,protocolSettings:e?.protocolSettings??{defaultNamespace:`com.amazonaws.sts`,errorTypeRegistries:zn,xmlNamespace:`https://sts.amazonaws.com/doc/2011-06-15/`,version:`2011-06-15`,serviceTarget:`AWSSecurityTokenServiceV20110615`},serviceId:e?.serviceId??`STS`,sha256:e?.sha256??Xe,signerConstructor:e?.signerConstructor??ut,urlParser:e?.urlParser??Ee,utf8Decoder:e?.utf8Decoder??Fe,utf8Encoder:e?.utf8Encoder??Le})})),Gn,Kn=e((()=>{qt(),f(),y(),st(),v(),d(),g(),i(),m(),lt(),Wn(),Gn=e=>{ye(process.version);let t=Ge(e),n=()=>t().then(_e),r=Un(e);Se(process.version);let i={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:`node`,defaultsMode:t,authSchemePreference:e?.authSchemePreference??h($e,i),bodyLengthChecker:e?.bodyLengthChecker??ze,credentialDefaultProvider:e?.credentialDefaultProvider??ot,defaultUserAgentProvider:e?.defaultUserAgentProvider??se({serviceId:r.serviceId,clientVersion:Kt.version}),httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4`)||(async e=>await ot(e?.__config||{})()),signer:new Qe},{schemeId:`aws.auth#sigv4a`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4a`),signer:new at},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new _}],maxAttempts:e?.maxAttempts??h(u,e),region:e?.region??h(Ke,{...We,...i}),requestHandler:ct.create(e?.requestHandler??n),retryMode:e?.retryMode??h({...fe,default:async()=>(await n()).retryMode||l},e),sigv4aSigningRegionSet:e?.sigv4aSigningRegionSet??h(nt,i),streamCollector:e?.streamCollector??Re,useDualstackEndpoint:e?.useDualstackEndpoint??h(He,i),useFipsEndpoint:e?.useFipsEndpoint??h(Ue,i),userAgentAppId:e?.userAgentAppId??h(pe,i)}}})),qn,Jn,Yn=e((()=>{qn=e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){let n=t.findIndex(t=>t.schemeId===e.schemeId);n===-1?t.push(e):t.splice(n,1,e)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider(){return n},setCredentials(e){r=e},credentials(){return r}}},Jn=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()})})),Xn,Zn=e((()=>{f(),d(),p(),Yn(),Xn=(e,t)=>{let n=Object.assign(he(e),ce(e),Me(e),qn(e));return t.forEach(e=>e.configure(n)),Object.assign(e,ue(n),ge(n),Pe(n),Jn(n))}})),Qn,$n=e((()=>{f(),v(),d(),g(),o(),p(),i(),De(),Et(),kt(),Kn(),Zn(),t(),Qn=class extends me{constructor(...[e]){let t=Gn(e||{});super(t),n(this,`config`,void 0),this.initConfig=t;let i=Xn(Tt(ee(r(Ve(de(le(Dt(t))))))),e?.extensions||[]);this.config=i,this.middlewareStack.use(ke(this.config)),this.middlewareStack.use(ve(this.config)),this.middlewareStack.use(a(this.config)),this.middlewareStack.use(Ne(this.config)),this.middlewareStack.use(Ce(this.config)),this.middlewareStack.use(we(this.config)),this.middlewareStack.use(oe(this.config)),this.middlewareStack.use(qe(this.config,{httpAuthSchemeParametersProvider:xt,identityProviderConfigProvider:async e=>new Je({"aws.auth#sigv4":e.credentials,"aws.auth#sigv4a":e.credentials})})),this.middlewareStack.use(Ye(this.config))}destroy(){super.destroy()}}})),er,tr,nr,rr=e((()=>{d(),o(),kt(),er=ae(Ot,`AWSSecurityTokenServiceV20110615`,`STSClient`,te),tr={},nr=(e,t,n,r)=>[]})),ir=e((()=>{})),ar=e((()=>{})),or=e((()=>{})),sr=e((()=>{})),cr=e((()=>{})),lr=e((()=>{})),ur,dr=e((()=>{rr(),$(),ur=class extends er(tr,nr,`GetCallerIdentity`,Hn){}})),fr=e((()=>{})),pr=e((()=>{})),mr=e((()=>{})),hr=e((()=>{})),gr=e((()=>{})),_r=e((()=>{ir(),ar(),or(),sr(),cr(),lr(),dr(),fr(),pr(),mr(),hr()})),vr=e((()=>{})),yr=e((()=>{}));e((()=>{$n(),gr(),_r(),$(),sn(),vr(),yr(),U()}))();export{ur as GetCallerIdentityCommand,Qn as STSClient};
@@ -1 +0,0 @@
1
- import{i as e,n as t,r as n,t as r}from"./dist-es-CYPVg66r.js";r();export{t as credentialsTreatedAsExpired,n as credentialsWillNeedRefresh,e as defaultProvider};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,t as n}from"./dist-es-CYPVg66r.js";import"./dist-es-Cd_AeqMK.js";import{n as r,t as i}from"./dist-es-CMtO44xC.js";var a=e((()=>{})),o=e((()=>{})),s=e((()=>{})),c=e((()=>{})),l=e((()=>{})),u,d=e((()=>{i(),u=(e={})=>r({...e})})),f=e((()=>{})),p=e((()=>{})),m,h=e((()=>{n(),m=(e={})=>t({...e})})),g=e((()=>{})),_=e((()=>{})),v=e((()=>{})),y=e((()=>{})),b=e((()=>{}));e((()=>{a(),o(),s(),c(),l(),d(),f(),p(),h(),g(),_(),v(),y(),b()}))();export{u as fromIni,m as fromNodeProviderChain};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{_t as t,t as n}from"./client-DvAL7lY8.js";import{L as r,N as i,k as a,t as o,v as s}from"./config-BSXLgwpD.js";var c,l,u=e((()=>{n(),o(),c=(e,t,n)=>{let a={EcsContainer:async e=>{let{fromHttp:t}=await import(`./dist-es-Byxccz_-.js`),{fromContainerMetadata:r}=await import(`./dist-es-Cwru7c2B2.js`);return n?.debug(`@aws-sdk/credential-provider-ini - credential_source is EcsContainer`),async()=>i(t(e??{}),r(e))().then(l)},Ec2InstanceMetadata:async e=>{n?.debug(`@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata`);let{fromInstanceMetadata:t}=await import(`./dist-es-Cwru7c2B2.js`);return async()=>t(e)().then(l)},Environment:async e=>{n?.debug(`@aws-sdk/credential-provider-ini - credential_source is Environment`);let{fromEnv:t}=await import(`./dist-es-D1wHe_zh.js`);return async()=>t(e)().then(l)}};if(e in a)return a[e];throw new r(`Unsupported credential source in profile ${t}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:n})},l=e=>t(e,`CREDENTIALS_PROFILE_NAMED_PROVIDER`,`p`)})),d,f,p,m,h,g=e((()=>{n(),o(),u(),d=(e,{profile:t=`default`,logger:n}={})=>!!e&&typeof e==`object`&&typeof e.role_arn==`string`&&[`undefined`,`string`].indexOf(typeof e.role_session_name)>-1&&[`undefined`,`string`].indexOf(typeof e.external_id)>-1&&[`undefined`,`string`].indexOf(typeof e.mfa_serial)>-1&&(f(e,{profile:t,logger:n})||p(e,{profile:t,logger:n})),f=(e,{profile:t,logger:n})=>{let r=typeof e.source_profile==`string`&&e.credential_source===void 0;return r&&n?.debug?.(` ${t} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`),r},p=(e,{profile:t,logger:n})=>{let r=typeof e.credential_source==`string`&&e.source_profile===void 0;return r&&n?.debug?.(` ${t} isCredentialSourceProfile credential_source=${e.credential_source}`),r},m=async(e,n,i,o,s={},l)=>{i.logger?.debug(`@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)`);let u=n[e],{source_profile:d,region:f}=u;if(!i.roleAssumer){let{getDefaultRoleAssumer:e}=await import(`./sts-C2Gf2WYN.js`);i.roleAssumer=e({...i.clientConfig,credentialProviderLogger:i.logger,parentClientConfig:{...o,...i?.parentClientConfig,region:f??i?.parentClientConfig?.region??o?.region}},i.clientPlugins)}if(d&&d in s)throw new r(`Detected a cycle attempting to resolve credentials for profile ${a(i)}. Profiles visited: `+Object.keys(s).join(`, `),{logger:i.logger});i.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${d?`source_profile=[${d}]`:`profile=[${e}]`}`);let p=d?l(d,n,i,o,{...s,[d]:!0},h(n[d]??{})):(await c(u.credential_source,e,i.logger)(i))();if(h(u))return p.then(e=>t(e,`CREDENTIALS_PROFILE_SOURCE_PROFILE`,`o`));{let n={RoleArn:u.role_arn,RoleSessionName:u.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:u.external_id,DurationSeconds:parseInt(u.duration_seconds||`3600`,10)},{mfa_serial:a}=u;if(a){if(!i.mfaCodeProvider)throw new r(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:i.logger,tryNextLink:!1});n.SerialNumber=a,n.TokenCode=await i.mfaCodeProvider(a)}let o=await p;return i.roleAssumer(o,n).then(e=>t(e,`CREDENTIALS_PROFILE_SOURCE_PROFILE`,`o`))}},h=e=>!e.role_arn&&!!e.credential_source})),_,v,y=e((()=>{n(),_=e=>!!(e&&e.login_session),v=async(e,n,r)=>{let{fromLoginCredentials:i}=await import(`./dist-es-DKFm0FJ7.js`);return t(await i({...n,profile:e})({callerClientConfig:r}),`CREDENTIALS_PROFILE_LOGIN`,`AC`)}})),b,x,S=e((()=>{n(),b=e=>!!e&&typeof e==`object`&&typeof e.credential_process==`string`,x=async(e,n)=>{let{fromProcess:r}=await import(`./dist-es-DXIR5NLi2.js`);return t(await r({...e,profile:n})(),`CREDENTIALS_PROFILE_PROCESS`,`v`)}})),C,w,T=e((()=>{n(),C=async(e,n,r={},i)=>{let{fromSSO:a}=await import(`./dist-es-kj-F5A132.js`);return a({profile:e,logger:r.logger,parentClientConfig:r.parentClientConfig,clientConfig:r.clientConfig})({callerClientConfig:i}).then(e=>n.sso_session?t(e,`CREDENTIALS_PROFILE_SSO`,`r`):t(e,`CREDENTIALS_PROFILE_SSO_LEGACY`,`t`))},w=e=>e&&(typeof e.sso_start_url==`string`||typeof e.sso_account_id==`string`||typeof e.sso_session==`string`||typeof e.sso_region==`string`||typeof e.sso_role_name==`string`)})),E,D,O=e((()=>{n(),E=e=>!!e&&typeof e==`object`&&typeof e.aws_access_key_id==`string`&&typeof e.aws_secret_access_key==`string`&&[`undefined`,`string`].indexOf(typeof e.aws_session_token)>-1&&[`undefined`,`string`].indexOf(typeof e.aws_account_id)>-1,D=async(e,n)=>(n?.logger?.debug(`@aws-sdk/credential-provider-ini - resolveStaticCredentials`),t({accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token,...e.aws_credential_scope&&{credentialScope:e.aws_credential_scope},...e.aws_account_id&&{accountId:e.aws_account_id}},`CREDENTIALS_PROFILE`,`n`))})),k,A,j=e((()=>{n(),k=e=>!!e&&typeof e==`object`&&typeof e.web_identity_token_file==`string`&&typeof e.role_arn==`string`&&[`undefined`,`string`].indexOf(typeof e.role_session_name)>-1,A=async(e,n,r)=>{let{fromTokenFile:i}=await import(`./dist-es-5t7v8oaj.js`);return t(await i({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:n.roleAssumerWithWebIdentity,logger:n.logger,parentClientConfig:n.parentClientConfig})({callerClientConfig:r}),`CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN`,`q`)}})),M,N=e((()=>{o(),g(),y(),S(),T(),O(),j(),M=async(e,t,n,i,a={},o=!1)=>{let s=t[e];if(Object.keys(a).length>0&&E(s))return D(s,n);if(o||d(s,{profile:e,logger:n.logger}))return m(e,t,n,i,a,M);if(E(s))return D(s,n);if(k(s))return A(s,n,i);if(b(s))return x(n,e);if(w(s))return await C(e,s,n,i);if(_(s))return v(e,n,i);throw new r(`Could not resolve credentials using profile: [${e}] in configuration/credentials file(s).`,{logger:n.logger})}})),P,F=e((()=>{o(),N(),P=(e={})=>async({callerClientConfig:t}={})=>{e.logger?.debug(`@aws-sdk/credential-provider-ini - fromIni`);let n=await s(e);return M(a({profile:e.profile??t?.profile}),n,e,t)}})),I=e((()=>{F()}));export{P as n,F as r,I as t};
@@ -1,9 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{L as t,N as n,t as r}from"./config-BSXLgwpD.js";import{c as i,t as a}from"./dist-es-DelBIxNM.js";var o,s=e((()=>{r(),o=async e=>{let{ENV_CMDS_FULL_URI:r,ENV_CMDS_RELATIVE_URI:i,fromContainerMetadata:a,fromInstanceMetadata:o}=await import(`./dist-es-Cwru7c2B2.js`);if(process.env[i]||process.env[r]){e.logger?.debug(`@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata`);let{fromHttp:t}=await import(`./dist-es-Byxccz_-.js`);return n(t(e),a(e))}return process.env.AWS_EC2_METADATA_DISABLED&&process.env.AWS_EC2_METADATA_DISABLED!==`false`?async()=>{throw new t(`EC2 Instance Metadata Service access disabled`,{logger:e.logger})}:(e.logger?.debug(`@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata`),o(e))}}));function c(e,t){let n=l(e),r,i,a,o,s=async e=>{if(e?.forceRefresh)return o||(o=n(e).then(e=>{a=e}).finally(()=>{o=void 0})),await o,a;if(a?.expiration&&a?.expiration?.getTime()<Date.now()&&(a=void 0),r)await r;else if(!a||t?.(a))if(a)i||(i=n(e).then(e=>{a=e}).finally(()=>{i=void 0}));else return r=n(e).then(e=>{a=e}).finally(()=>{r=void 0}),s(e);return a};return s}var l,u=e((()=>{l=e=>async t=>{let n;for(let r of e)try{return await r(t)}catch(e){if(n=e,e?.tryNextLink)continue;throw e}throw n}})),d,f,p,m,h=e((()=>{a(),r(),s(),u(),d=!1,f=(e={})=>c([async()=>{if(e.profile??process.env.AWS_PROFILE)throw process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY&&(d||((e.logger?.warn&&e.logger?.constructor?.name!==`NoOpLogger`?e.logger.warn.bind(e.logger):console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
2
- Multiple credential sources detected:
3
- Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
4
- This SDK will proceed with the AWS_PROFILE value.
5
-
6
- However, a future version may change this behavior to prefer the ENV static credentials.
7
- Please ensure that your environment only sets either the AWS_PROFILE or the
8
- AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
9
- `),d=!0)),new t(`AWS_PROFILE is set, skipping fromEnv provider.`,{logger:e.logger,tryNextLink:!0});return e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv`),i(e)()},async n=>{e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::fromSSO`);let{ssoStartUrl:r,ssoAccountId:i,ssoRegion:a,ssoRoleName:o,ssoSession:s}=e;if(!r&&!i&&!a&&!o&&!s)throw new t(`Skipping SSO provider in default chain (inputs do not include SSO fields).`,{logger:e.logger});let{fromSSO:c}=await import(`./dist-es-kj-F5A132.js`);return c(e)(n)},async t=>{e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::fromIni`);let{fromIni:n}=await import(`./dist-es-D1Y8zSMI.js`);return n(e)(t)},async t=>{e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::fromProcess`);let{fromProcess:n}=await import(`./dist-es-DXIR5NLi2.js`);return n(e)(t)},async t=>{e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile`);let{fromTokenFile:n}=await import(`./dist-es-5t7v8oaj.js`);return n(e)(t)},async()=>(e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::remoteProvider`),(await o(e))()),async()=>{throw new t(`Could not load credentials from any providers`,{tryNextLink:!1,logger:e.logger})}],m),p=e=>e?.expiration!==void 0,m=e=>e?.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5})),g=e((()=>{h()}));export{h as a,f as i,m as n,p as r,g as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./dist-es-CMtO44xC.js";t();export{e as fromIni};
@@ -1 +0,0 @@
1
- import"./client-DvAL7lY8.js";import{_ as e,f as t,t as n}from"./dist-es-BOPBJQo3.js";n();export{e as BedrockRuntimeClient,t as CountTokensCommand};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./dist-es-Cgsa8pb82.js";t();export{e as fromSSO};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Doctor-D9F3tKsr.js";var i,a;e((()=>{n(),i=t(),a=(e,t,n)=>Promise.resolve((0,i.jsx)(r,{onDone:e}))}))();export{a as call};