@readmagic/workmate 0.0.16 → 0.0.18

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 (339) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-DAtfMH4o.js → AddWorkspaceDirectory-Wa6Q24nu.js} +1 -1
  2. package/dist/chunks/{AgentsMdExternalIncludesDialog-BTYgjY5c.js → AgentsMdExternalIncludesDialog-3I_KlOLv.js} +1 -1
  3. package/dist/chunks/AgentsMdExternalIncludesDialog-h150UBir.js +1 -0
  4. package/dist/chunks/{App-HF0bvxi_.js → App-BgPs1Bu8.js} +1 -1
  5. package/dist/chunks/{ApproveApiKey-BBFLw2B7.js → ApproveApiKey-BxpapUq0.js} +1 -1
  6. package/dist/chunks/ApproveApiKey-DIIIi6U8.js +1 -0
  7. package/dist/chunks/{BackgroundTasksDialog-Coc0ecUd.js → BackgroundTasksDialog-nfRmiGl3.js} +1 -1
  8. package/dist/chunks/{BypassPermissionsModeDialog--Gx9ARd4.js → BypassPermissionsModeDialog-8Cq982M0.js} +1 -1
  9. package/dist/chunks/{DiffDialog-tlINuFS1.js → DiffDialog-DwQTDWYh.js} +1 -1
  10. package/dist/chunks/Doctor-Beo5yEMD.js +1 -0
  11. package/dist/chunks/{Doctor-Wh7z6CnF.js → Doctor-BxXAGr-Z.js} +1 -1
  12. package/dist/chunks/{ExitFlow-B1zHTqQt.js → ExitFlow-CVIuvrHT.js} +1 -1
  13. package/dist/chunks/{Grove-1Kf7xxIV.js → Grove-_QX_wR9C.js} +1 -1
  14. package/dist/chunks/{HybridTransport-DWqWUZCH.js → HybridTransport-BG2VIIBC.js} +1 -1
  15. package/dist/chunks/{InvalidConfigDialog-OZPFQSnC.js → InvalidConfigDialog-BDdMkuaL.js} +1 -1
  16. package/dist/chunks/{InvalidSettingsDialog-BNCm-eyC.js → InvalidSettingsDialog-DSCqbVER.js} +1 -1
  17. package/dist/chunks/{MCPConnectionManager-7H84oi5n.js → MCPConnectionManager-Cer1UawR.js} +1 -1
  18. package/dist/chunks/{MCPToolListView-CVgtg3Iq.js → MCPToolListView-DndNWDr1.js} +1 -1
  19. package/dist/chunks/{McpParsingWarnings-CN8f449l.js → McpParsingWarnings-Cr_n2QR6.js} +1 -1
  20. package/dist/chunks/{MessageSelector-B9j6zZ5w.js → MessageSelector-BfmbAG8E.js} +1 -1
  21. package/dist/chunks/{Messages-yz1m39eI.js → Messages-CUJJ6nHV.js} +1 -1
  22. package/dist/chunks/{Onboarding-bFbgae8m.js → Onboarding-Cz3CfOTl.js} +1 -1
  23. package/dist/chunks/{PromptInputFooterSuggestions-CE_yVun1.js → PromptInputFooterSuggestions-GhA5Qa1I.js} +1 -1
  24. package/dist/chunks/{PromptInputHelpMenu-TPWuGwAy.js → PromptInputHelpMenu-sX_yHORM.js} +1 -1
  25. package/dist/chunks/{QueryEngine-CRobcENE.js → QueryEngine-C6Dx_-U8.js} +1 -1
  26. package/dist/chunks/{REPL-C33mMf_q.js → REPL-BPig-OIh.js} +38 -38
  27. package/dist/chunks/REPL-e5wWV2Sl.js +1 -0
  28. package/dist/chunks/{RemoteSessionManager-BjVD918g.js → RemoteSessionManager-Cax4g0GH.js} +1 -1
  29. package/dist/chunks/{ResumeConversation-CXd8d8po.js → ResumeConversation-e5sISbWn.js} +1 -1
  30. package/dist/chunks/{SSETransport-BSilVN9e.js → SSETransport-BuDKErlN.js} +1 -1
  31. package/dist/chunks/SearchExtraToolsTool-B_z74zwG.js +1 -0
  32. package/dist/chunks/{Settings-ClcLl0C1.js → Settings-B9rxF2wR.js} +2 -2
  33. package/dist/chunks/{TeleportProgress-DonJUoPc.js → TeleportProgress-BUtze4qa.js} +1 -1
  34. package/dist/chunks/{TeleportRepoMismatchDialog-ByOuSVVz.js → TeleportRepoMismatchDialog-Dp7rzrrz.js} +1 -1
  35. package/dist/chunks/{TeleportResumeWrapper-BBtELwF1.js → TeleportResumeWrapper-Ch2osY21.js} +1 -1
  36. package/dist/chunks/{ThemePicker-1QQJFOEv.js → ThemePicker-AA-0hjpq.js} +1 -1
  37. package/dist/chunks/{TrustDialog-DwJ9L_u4.js → TrustDialog-rO5dZ8G-.js} +1 -1
  38. package/dist/chunks/{ValidationErrorsList-Cuq6W2yc.js → ValidationErrorsList-DayOwxq9.js} +1 -1
  39. package/dist/chunks/{add-dir-DOKdPFT2.js → add-dir-Cz33IGht.js} +1 -1
  40. package/dist/chunks/{agentDisplay-TX1bh-lX.js → agentDisplay-nVTmC7tL.js} +1 -1
  41. package/dist/chunks/{agents-C58tRxpi.js → agents-BQwi-6GV.js} +1 -1
  42. package/dist/chunks/{agents-CbRjX9Pj.js → agents-rfuJUSSc.js} +1 -1
  43. package/dist/chunks/{allErrors-DRiW7i6Y.js → allErrors-YIRWFBD9.js} +1 -1
  44. package/dist/chunks/api-CGk-0H2x.js +1 -0
  45. package/dist/chunks/{api-CazVavfB.js → api-DAyhTxgY.js} +1 -1
  46. package/dist/chunks/{auth-CfrCl9BZ.js → auth-BzrroWLq.js} +1 -1
  47. package/dist/chunks/auth-DWWb8STf.js +1 -0
  48. package/dist/chunks/auth-DsqlBO-Q.js +1 -0
  49. package/dist/chunks/{backgroundHousekeeping-CPLlaWcV.js → backgroundHousekeeping-CXv_Pm5h.js} +2 -2
  50. package/dist/chunks/backgroundHousekeeping-Crx3oXIu.js +1 -0
  51. package/dist/chunks/{banner-HfMnBd03.js → banner-BfIcVEUU.js} +1 -1
  52. package/dist/chunks/{bg-DltfF1_K.js → bg-C15c_rMK.js} +2 -2
  53. package/dist/chunks/{branch-pAa0oBaj.js → branch-BEaujq-M.js} +1 -1
  54. package/dist/chunks/{break-cache-Cd1yQ-0h.js → break-cache-XKbOAw-u.js} +2 -2
  55. package/dist/chunks/{bridgeConfig-DnFfCpGd.js → bridgeConfig-Bxkrv8ZL.js} +1 -1
  56. package/dist/chunks/bridgeConfig-Ctl7I_RR.js +1 -0
  57. package/dist/chunks/{bridgeMessaging-B_hnuUHb.js → bridgeMessaging-BcSjIPCZ.js} +1 -1
  58. package/dist/chunks/bridgePointer-CGhOBNMg.js +1 -0
  59. package/dist/chunks/bridgeStatusUtil-DBWBTU31.js +1 -0
  60. package/dist/chunks/{btw-CkVkYeRr.js → btw-8JqSG3o7.js} +1 -1
  61. package/dist/chunks/caches-dnO4Ae_m.js +1 -0
  62. package/dist/chunks/caches-lPzD_yGv.js +1 -0
  63. package/dist/chunks/{capacityWake-LRiPhPeM.js → capacityWake-C24_KT1x.js} +1 -1
  64. package/dist/chunks/{ccrClient-AfdUbWzY.js → ccrClient-CH6PsxJJ.js} +1 -1
  65. package/dist/chunks/{claudeDesktop-CB3UCt7U.js → claudeDesktop-CovdLe-b.js} +1 -1
  66. package/dist/chunks/{clear-Ac3qYi_-.js → clear-D72LxXA6.js} +1 -1
  67. package/dist/chunks/{cliLaunch-xIVvtPZy.js → cliLaunch-DDA65zeR.js} +1 -1
  68. package/dist/chunks/client-BFjMSlp7.js +1 -0
  69. package/dist/chunks/client-Byat5HpG.js +1 -0
  70. package/dist/chunks/client-Dzx24jGZ.js +1 -0
  71. package/dist/chunks/{client-Bb2eZnuq.js → client-eLOYyeES.js} +1 -1
  72. package/dist/chunks/{client-DNEVh6Wu.js → client-o5_awagP.js} +1 -1
  73. package/dist/chunks/commands-D3lQbt9p.js +1 -0
  74. package/dist/chunks/{compact-CXuDr5qM.js → compact--fnu8Zd-.js} +1 -1
  75. package/dist/chunks/{config-D78R57VA.js → config-BlQhL9Bh.js} +1 -1
  76. package/dist/chunks/{config-BSkuQZNf.js → config-BybjRr09.js} +1 -1
  77. package/dist/chunks/config-CPGSP_1Z.js +1 -0
  78. package/dist/chunks/{context-C2plOqH4.js → context-D6PaqwrR.js} +1 -1
  79. package/dist/chunks/context-noninteractive-CwlOID3q.js +1 -0
  80. package/dist/chunks/{context-noninteractive-fVQtwEkw.js → context-noninteractive-CxoMCfR4.js} +1 -1
  81. package/dist/chunks/conversation-BLEWB1BE.js +1 -0
  82. package/dist/chunks/{conversation-DQpS6nvg.js → conversation-Bos7yTIv.js} +1 -1
  83. package/dist/chunks/{createSSHSession-CfyFuJMH.js → createSSHSession-B3FdForb.js} +1 -1
  84. package/dist/chunks/createSession-B4wkDNam.js +1 -0
  85. package/dist/chunks/{createSession-qk9C66lK.js → createSession-C0e_DHsW.js} +1 -1
  86. package/dist/chunks/{crossProjectResume-DY1ZBO5P.js → crossProjectResume-C5QtstD6.js} +1 -1
  87. package/dist/chunks/cwd-BfiQQAqr.js +1 -0
  88. package/dist/chunks/{cwd-Besi3Os3.js → cwd-Dj2ynhWd.js} +1 -1
  89. package/dist/chunks/{datadog-Cr0VKbct.js → datadog-ZxeaKwKd.js} +1 -1
  90. package/dist/chunks/{debug-BQj6h99Q.js → debug-D7OBvqC2.js} +1 -1
  91. package/dist/chunks/{debugUtils-B86DM1Sp.js → debugUtils-B-GMBTBk.js} +1 -1
  92. package/dist/chunks/{detached--wGwkuHX.js → detached-uMuMcLsV.js} +1 -1
  93. package/dist/chunks/{detectRepository-Qy3zKoyn.js → detectRepository-AVEUw4lk.js} +1 -1
  94. package/dist/chunks/detectRepository-CWI2xcdR.js +1 -0
  95. package/dist/chunks/{diff-BNjcCXDr.js → diff-BA2vN7sD.js} +1 -1
  96. package/dist/chunks/{directoryCompletion-i2oWpaUe.js → directoryCompletion-CLcmLin8.js} +1 -1
  97. package/dist/chunks/doctor-BV6zhneX.js +1 -0
  98. package/dist/chunks/{entry-o9IZPS4g.js → entry-cou5DS53.js} +2 -2
  99. package/dist/chunks/{esm-BI3tFLyy.js → esm-D9-9wS1F.js} +1 -1
  100. package/dist/chunks/{execFileNoThrow-DYm1GeGn.js → execFileNoThrow-BHDSgTpZ.js} +1 -1
  101. package/dist/chunks/{execSyncWrapper-CqvQqke-.js → execSyncWrapper-pYxQXqb-.js} +1 -1
  102. package/dist/chunks/{exit-Dlyj7nY8.js → exit-DdZJHhy2.js} +1 -1
  103. package/dist/chunks/{extraUsage-5Ueiyw6W.js → extraUsage-CHnG6JNH.js} +1 -1
  104. package/dist/chunks/extractMemories-DxGHxoNO.js +1 -0
  105. package/dist/chunks/fast-Bf-g-wR6.js +1 -0
  106. package/dist/chunks/{fast-ClOKONyD.js → fast-Bl_0cs9e.js} +1 -1
  107. package/dist/chunks/{fetchModelList-gh_jFYai.js → fetchModelList-CheIBH5f.js} +1 -1
  108. package/dist/chunks/fetchModelList-vk-RMDfG.js +1 -0
  109. package/dist/chunks/{fileSuggestions-DK7W8kLF.js → fileSuggestions-Dl87JhBr.js} +1 -1
  110. package/dist/chunks/{firstPartyEventLogger-BMnXb9cv.js → firstPartyEventLogger-Cw9Bc3on.js} +2 -2
  111. package/dist/chunks/firstPartyEventLogger-DvsZdBy2.js +1 -0
  112. package/dist/chunks/flushGate-BD3Tk3_k.js +1 -0
  113. package/dist/chunks/{gemini-C8-QHnsC.js → gemini-BARUjH_t.js} +1 -1
  114. package/dist/chunks/{generateSessionName-C8DnAVaa.js → generateSessionName-CHaK44K-.js} +1 -1
  115. package/dist/chunks/{genericProcessUtils-Bbcbi11g.js → genericProcessUtils-D5hCZ2ho.js} +1 -1
  116. package/dist/chunks/git-Bujlb5tq.js +1 -0
  117. package/dist/chunks/{git-DplvjXEY.js → git-CNhyfMtb.js} +1 -1
  118. package/dist/chunks/{githubRepoPathMapping-Px3_GeD1.js → githubRepoPathMapping-Dhz4cvw2.js} +1 -1
  119. package/dist/chunks/{goal-DMmzlZOF.js → goal-fTQFogdl.js} +1 -1
  120. package/dist/chunks/{grok-LLjpAwP_.js → grok-D0J4IiCe.js} +1 -1
  121. package/dist/chunks/{grove-CQBCzeHf.js → grove-mDH4wkhM.js} +1 -1
  122. package/dist/chunks/{help-JH7WzjZP.js → help-Dr7st1Yv.js} +1 -1
  123. package/dist/chunks/hooks-C5YSYzSl.js +1 -0
  124. package/dist/chunks/{hooks-DD2jpRfx.js → hooks-DCfpFhl2.js} +1 -1
  125. package/dist/chunks/{initReplBridge-BDaN0hpY.js → initReplBridge-BFYTAFlT.js} +1 -1
  126. package/dist/chunks/{install-CD4or0vj.js → install-CjacxFXg.js} +1 -1
  127. package/dist/chunks/{instrumentation-n-otwpYf.js → instrumentation-DS2S1m1a.js} +3 -3
  128. package/dist/chunks/{job-B-pEWgXI.js → job-Dry-GMc5.js} +1 -1
  129. package/dist/chunks/{jwtUtils-YCoZL0FW.js → jwtUtils-ClCcC8lO.js} +1 -1
  130. package/dist/chunks/{keybindings-qed9q9tx.js → keybindings-D01jzjKu.js} +1 -1
  131. package/dist/chunks/{launchLocalMemory-cBovdGMT.js → launchLocalMemory-_T0oHfh9.js} +1 -1
  132. package/dist/chunks/{launchOnboarding-B__wtt7p.js → launchOnboarding-D4fS6pLc.js} +1 -1
  133. package/dist/chunks/{external-CEp-aPkt.js → lazySchema-DULtBUCI.js} +1 -1
  134. package/dist/chunks/{loadAgentsDir-PPiD2Mfq.js → loadAgentsDir-DnsldjYU.js} +560 -560
  135. package/dist/chunks/loadAgentsDir-xG1HswS_.js +1 -0
  136. package/dist/chunks/{loadPluginHooks-DUCuU3_8.js → loadPluginHooks-CRoYa_il.js} +1 -1
  137. package/dist/chunks/loader-C-PQ3onD.js +1 -0
  138. package/dist/chunks/localSearch-B17Mzd84.js +1 -0
  139. package/dist/chunks/{localSearch-Cvs9WfoX.js → localSearch-nuNjYVKq.js} +1 -1
  140. package/dist/chunks/{log-BlJ7CcKG.js → log-CR0v5KUR.js} +1 -1
  141. package/dist/chunks/{logoV2Utils-Bkj74dtY.js → logoV2Utils-CZwL_VX1.js} +1 -1
  142. package/dist/chunks/{magicDocs-3U6peChg.js → magicDocs-D0rjtxup.js} +1 -1
  143. package/dist/chunks/{main-DkjxhBIC.js → main-C8n_p7yX.js} +11 -11
  144. package/dist/chunks/{main-Zh18lf2J.js → main-DKqCPH3G.js} +2 -2
  145. package/dist/chunks/managedEnv-C7bVtcgA.js +1 -0
  146. package/dist/chunks/managedEnv-d7HliQYg.js +1 -0
  147. package/dist/chunks/{mappers-ZGgwqDOK.js → mappers-BIDALdjB.js} +1 -1
  148. package/dist/chunks/{mcp-CysOyBIn.js → mcp-BcEApfqn.js} +1 -1
  149. package/dist/chunks/{mcp-CdyNeNzh.js → mcp-CBbVcOTy.js} +1 -1
  150. package/dist/chunks/{mcp-COZxwgJZ.js → mcp-DYtfHeRa.js} +3 -3
  151. package/dist/chunks/{memoize-_2f7NWDv.js → memoize-C7xmvAQ0.js} +1 -1
  152. package/dist/chunks/{memory-B5h2TTSS.js → memory-CijapyZk.js} +1 -1
  153. package/dist/chunks/{mode-D3yY1fdK.js → mode-CajUX4Uz.js} +1 -1
  154. package/dist/chunks/model-CyF5u3zH.js +1 -0
  155. package/dist/chunks/model-DaYZWYJe.js +1 -0
  156. package/dist/chunks/model-xI2MbgRj.js +1 -0
  157. package/dist/chunks/{modelOptions-DYQqTLPi.js → modelOptions-Ct80yABl.js} +1 -1
  158. package/dist/chunks/{nativeInstaller-N1xiUpCP.js → nativeInstaller-C6aWHxve.js} +1 -1
  159. package/dist/chunks/{omit-BOILu8jW.js → omit-BhPlISSj.js} +1 -1
  160. package/dist/chunks/{onChangeAppState-COFFZAXb.js → onChangeAppState-BOJd4Yce.js} +1 -1
  161. package/dist/chunks/{openai-BHM5kEFo.js → openai-wsPCDwGL.js} +1 -1
  162. package/dist/chunks/{panel-Bg_0PHE6.js → panel-BKMLX5AR.js} +1 -1
  163. package/dist/chunks/parser-B-QFQfSO.js +1 -0
  164. package/dist/chunks/{parser-a2S_eFyE.js → parser-Dy-RMf4a.js} +1 -1
  165. package/dist/chunks/{partition-C1SFDk_L.js → partition-_qZZlGjS.js} +1 -1
  166. package/dist/chunks/{permissions-uy_NFbfy.js → permissions-CcjGscyg.js} +1 -1
  167. package/dist/chunks/{pidLock-DuMVSwnN.js → pidLock-Cm9FWa4w.js} +2 -2
  168. package/dist/chunks/{plan-DF9YSB5M.js → plan-CTiLy_c4.js} +1 -1
  169. package/dist/chunks/{platform-DVeTi9mp.js → platform-BZm4WVLM.js} +1 -1
  170. package/dist/chunks/{plugin-GRPzqgTr.js → plugin-D7vjs6Hu.js} +1 -1
  171. package/dist/chunks/{pluginAutoupdate-AMD-FvKB.js → pluginAutoupdate-DzK-fXJC.js} +1 -1
  172. package/dist/chunks/{pluginBlocklist-DNxkAxH6.js → pluginBlocklist-B3JVl1h2.js} +1 -1
  173. package/dist/chunks/{pluginCliCommands-BFoR1ZXx.js → pluginCliCommands-CubOvlhc.js} +1 -1
  174. package/dist/chunks/{pluginFlagging-CW2IZWSI.js → pluginFlagging-Dp7W2eL8.js} +1 -1
  175. package/dist/chunks/{pluginOperations-DlWE0idP.js → pluginOperations-BxHoy0pC.js} +1 -1
  176. package/dist/chunks/{pluginStartupCheck-AQGV0DCS.js → pluginStartupCheck-CL24_zVV.js} +1 -1
  177. package/dist/chunks/pluginStartupCheck-CtX6QkdO.js +1 -0
  178. package/dist/chunks/{plugins-CwUSTE4E.js → plugins-DA3lpRU4.js} +1 -1
  179. package/dist/chunks/pollConfig-2nFzv6Hy.js +1 -0
  180. package/dist/chunks/poorMode-DyAWNRRM.js +1 -0
  181. package/dist/chunks/{poorMode-wm2WkPF0.js → poorMode-aMzKXz6G.js} +1 -1
  182. package/dist/chunks/{print-9wR_ijrL.js → print-BrqZ3AgP.js} +5 -5
  183. package/dist/chunks/{processBashCommand-Deqwq1IE.js → processBashCommand-C6mBgRVz.js} +1 -1
  184. package/dist/chunks/{processSlashCommand-U9LJ4Keq.js → processSlashCommand-t0-BVku8.js} +1 -1
  185. package/dist/chunks/prompt-BJ3xYAvE.js +1 -0
  186. package/dist/chunks/{prompt-CQmEvnKN.js → prompt-CzQkcxfg.js} +3 -3
  187. package/dist/chunks/prompt-Di2lNwYp.js +1 -0
  188. package/dist/chunks/{promptEditor-Bf72KNF-.js → promptEditor-C6w1vT5E.js} +1 -1
  189. package/dist/chunks/{protocolHandler--eQQuSyx.js → protocolHandler-B3bQyB6W.js} +1 -1
  190. package/dist/chunks/{proxy-C0j74LqT.js → proxy-DFIxRT0i.js} +1 -1
  191. package/dist/chunks/{reconciler-Css9bs07.js → reconciler-p4lAu9ft.js} +1 -1
  192. package/dist/chunks/{refresh-B87z39Zs.js → refresh-DCQChX5A.js} +1 -1
  193. package/dist/chunks/{registerProtocol-DrWIX3Lb.js → registerProtocol-CrzdmgCD.js} +1 -1
  194. package/dist/chunks/{reload-plugins-BpmUIkfm.js → reload-plugins-BnZzcRcd.js} +1 -1
  195. package/dist/chunks/{remoteBridgeCore-BCLIIygk.js → remoteBridgeCore-DAK9KSWp.js} +1 -1
  196. package/dist/chunks/remoteManagedSettings-DkLfclxa.js +1 -0
  197. package/dist/chunks/{rename-BUt3PliQ.js → rename-OSN3Ua2J.js} +1 -1
  198. package/dist/chunks/{renderOptions-CkqTbz6d.js → renderOptions-XgkOdKCJ.js} +1 -1
  199. package/dist/chunks/{resume-uZI9p_FE.js → resume-K9q5B1li.js} +1 -1
  200. package/dist/chunks/{ripgrep-DsLUmulz.js → ripgrep-C_XuTqp3.js} +1 -1
  201. package/dist/chunks/ripgrep-DLPH9MP9.js +1 -0
  202. package/dist/chunks/{runtimeObserver-AKOWfdZ_.js → runtimeObserver-CuTsWhhF.js} +1 -1
  203. package/dist/chunks/{runtimeObserver-By59MZKJ.js → runtimeObserver-D9sujsqj.js} +2 -2
  204. package/dist/chunks/sandbox-adapter-CRxZBMAP.js +1 -0
  205. package/dist/chunks/{sandbox-toggle-BdvylnWS.js → sandbox-toggle-oasrWfbj.js} +1 -1
  206. package/dist/chunks/searchExtraTools-BAYzzTE8.js +1 -0
  207. package/dist/chunks/{session-Tm2-rzBY.js → session-c46jULDV.js} +1 -1
  208. package/dist/chunks/sessionFileAccessHooks-CwnjOk6S.js +1 -0
  209. package/dist/chunks/{sessionObserver-BAr8AWeL.js → sessionObserver-Cu7vykWp.js} +1 -1
  210. package/dist/chunks/sessionObserver-DNjDoJmy.js +1 -0
  211. package/dist/chunks/{sessionState-BTFowSpR.js → sessionState-B3tFm9SC.js} +1 -1
  212. package/dist/chunks/sessionStorage-CVZ0MUSE.js +1 -0
  213. package/dist/chunks/sessionTitle-k4wpUS5l.js +2 -0
  214. package/dist/chunks/{sessionTracing-CvY4udYI.js → sessionTracing-BRp_Ej-e.js} +1 -1
  215. package/dist/chunks/{settings-CvhsRFaT.js → settings-DUyIag_5.js} +4 -4
  216. package/dist/chunks/settings-DsqFBv6J.js +1 -0
  217. package/dist/chunks/settingsSync-yE43qjMS.js +1 -0
  218. package/dist/chunks/{setup-D4FPeBnM.js → setup-CFOc-hPM.js} +2 -2
  219. package/dist/chunks/{shadowedRuleDetection-Co8m1q1D.js → shadowedRuleDetection-ChoqK1Iq.js} +1 -1
  220. package/dist/chunks/{shellQuote-D3Ocv_U-.js → shellQuote-C-7PluUY.js} +1 -1
  221. package/dist/chunks/{sideQuestion-4TJYn-Az.js → sideQuestion-CkC27Pf3.js} +1 -1
  222. package/dist/chunks/sinks-B64r_OBE.js +1 -0
  223. package/dist/chunks/{sinks-Bb2i50kz.js → sinks-C9qCsi94.js} +1 -1
  224. package/dist/chunks/{skillChangeDetector-BU9AFG0i.js → skillChangeDetector-CLnn22Jo.js} +1 -1
  225. package/dist/chunks/{skillGapStore-BcVP3ZUb.js → skillGapStore-DC8s2Whn.js} +2 -2
  226. package/dist/chunks/{skillLifecycle-CG2XmS8f.js → skillLifecycle-BaqH5lw_.js} +2 -2
  227. package/dist/chunks/{skillSearchPanel-DOJmUBXB.js → skillSearchPanel-Dtvyo2Dk.js} +2 -2
  228. package/dist/chunks/{skills-DIgCWvzX.js → skills-DXW57WeY.js} +1 -1
  229. package/dist/chunks/{startupProfiler-2sjXZkIP.js → startupProfiler-BqUlQEaV.js} +1 -1
  230. package/dist/chunks/startupProfiler-yBU6FaAV.js +1 -0
  231. package/dist/chunks/{state-BPFYBqm1.js → state-B3zvBu4R.js} +1 -1
  232. package/dist/chunks/state-mHtumqEo.js +1 -0
  233. package/dist/chunks/{stats-Dq-5qizS.js → stats-vvwEVnon.js} +1 -1
  234. package/dist/chunks/status--Ql7l0VG.js +1 -0
  235. package/dist/chunks/{status-Ber2xOXc.js → status-g_dhM6Ep.js} +1 -1
  236. package/dist/chunks/{statusNoticeHelpers-CYkrPUpN.js → statusNoticeHelpers-B235FWru.js} +1 -1
  237. package/dist/chunks/{stringUtils-BjnclTLB.js → stringUtils-CGZoOfer.js} +1 -1
  238. package/dist/chunks/switcher-Cb9R9247.js +1 -0
  239. package/dist/chunks/switcher-OAeeTHHt.js +1 -0
  240. package/dist/chunks/{syncCache-AMQMQ_HR.js → syncCache-BiqQEess.js} +1 -1
  241. package/dist/chunks/{tasks-BKERIO4G.js → tasks--7yJk7MD.js} +1 -1
  242. package/dist/chunks/{teleport-DOXbf2sQ.js → teleport-ja50aVy3.js} +1 -1
  243. package/dist/chunks/{templateJobs-dg2F45ZJ.js → templateJobs-DSM3tNDS.js} +1 -1
  244. package/dist/chunks/{terminalSetup-JJiXmszo.js → terminalSetup-BpZXqE_G.js} +1 -1
  245. package/dist/chunks/{terminalSetup-DDvQ0K5e.js → terminalSetup-C735-5lZ.js} +1 -1
  246. package/dist/chunks/{theme-BGxytGjA.js → theme-BX54e0r7.js} +1 -1
  247. package/dist/chunks/{tmux-g0cQ0Buz.js → tmux-BIdWN33b.js} +1 -1
  248. package/dist/chunks/{toolEventObserver-CJhg_p3P.js → toolEventObserver-O6ljakS9.js} +1 -1
  249. package/dist/chunks/{toolPool-C0d7Bznl.js → toolPool-H_kXc8vo.js} +1 -1
  250. package/dist/chunks/trustedDevice-Dm_SY3Ko.js +1 -0
  251. package/dist/chunks/{trustedDevice-BtXHXu-T.js → trustedDevice-Kyid5Fuy.js} +1 -1
  252. package/dist/chunks/{types-BomO8WUz.js → types-DDku8UKF.js} +2 -2
  253. package/dist/chunks/{udsClient-DSvRPCvR.js → udsClient-B2yCKNgT.js} +1 -1
  254. package/dist/chunks/{upstreamproxy-DYoLvdM9.js → upstreamproxy--RTAcgrE.js} +1 -1
  255. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-C9orgrub.js → useExitOnCtrlCDWithKeybindings-BnmDpMkm.js} +1 -1
  256. package/dist/chunks/useMainLoopModel-DG8pghH7.js +1 -0
  257. package/dist/chunks/{useManagePlugins-Bt-DYAnX.js → useManagePlugins-HMHtjIY-.js} +1 -1
  258. package/dist/chunks/{useMergedTools-CZeQBdky.js → useMergedTools-ChLA8dsy.js} +1 -1
  259. package/dist/chunks/{useSearchInput-DdKrVHJS.js → useSearchInput-DqymtQhH.js} +1 -1
  260. package/dist/chunks/{useSettingsErrors-BR9Wws7D.js → useSettingsErrors-Bs9uyzW4.js} +1 -1
  261. package/dist/chunks/{userAgent-DUt0q-Vl.js → userAgent-D8vvjitA.js} +1 -1
  262. package/dist/chunks/{util-h-Hmdke_.js → util-CC-NRn16.js} +1 -1
  263. package/dist/chunks/validatePlugin-yCb8gsVF.js +1 -0
  264. package/dist/chunks/{vim-s-wmybpU.js → vim-CIK2DjfK.js} +1 -1
  265. package/dist/chunks/{which-BR8YVCCW.js → which-3MmqfsNV.js} +1 -1
  266. package/dist/chunks/windowsPaths-Dd_S96Bq.js +1 -0
  267. package/dist/chunks/{windowsPaths-BmXyrasP.js → windowsPaths-x-CxdtFP.js} +1 -1
  268. package/dist/chunks/{workSecret-BUd8cQ6-.js → workSecret-BsolC5S7.js} +1 -1
  269. package/dist/chunks/{workerRegistry-dlfqtySm.js → workerRegistry-DE4Ghp-n.js} +2 -2
  270. package/dist/chunks/worktree-D-CgffvU.js +1 -0
  271. package/dist/cli.js +1 -1
  272. package/package.json +1 -1
  273. package/dist/chunks/AgentsMdExternalIncludesDialog-C6VH6JG6.js +0 -1
  274. package/dist/chunks/ApproveApiKey-B7mKgSqY.js +0 -1
  275. package/dist/chunks/Doctor-BJf49FWX.js +0 -1
  276. package/dist/chunks/REPL-BhCC0JP6.js +0 -1
  277. package/dist/chunks/SearchExtraToolsTool-DoiCI2uJ.js +0 -1
  278. package/dist/chunks/api-C8uOHD-v.js +0 -1
  279. package/dist/chunks/auth-BL238vgr.js +0 -1
  280. package/dist/chunks/auth-D3GkU6d7.js +0 -1
  281. package/dist/chunks/backgroundHousekeeping-Du2tN2WE.js +0 -1
  282. package/dist/chunks/bridgeConfig-joBqeK0j.js +0 -1
  283. package/dist/chunks/bridgePointer-CiHy2tTN.js +0 -1
  284. package/dist/chunks/bridgeStatusUtil-Dwz4YHNA.js +0 -1
  285. package/dist/chunks/caches-BLQUkrIG.js +0 -1
  286. package/dist/chunks/caches-DsFl83sh.js +0 -1
  287. package/dist/chunks/client-BX0r6K3I.js +0 -1
  288. package/dist/chunks/client-Pap_HyZZ.js +0 -1
  289. package/dist/chunks/client-zhozU2ws.js +0 -1
  290. package/dist/chunks/commands-BKLsl6gK.js +0 -1
  291. package/dist/chunks/config-DrY1SvhQ.js +0 -1
  292. package/dist/chunks/context-noninteractive-DpVlZ-wP.js +0 -1
  293. package/dist/chunks/conversation-C0yysXds.js +0 -1
  294. package/dist/chunks/createSession-CmBawnsh.js +0 -1
  295. package/dist/chunks/cwd-DpqwaYHw.js +0 -1
  296. package/dist/chunks/detectRepository-tRUoPOKy.js +0 -1
  297. package/dist/chunks/doctor-BkCtT7H1.js +0 -1
  298. package/dist/chunks/extractMemories-DnTBWFOW.js +0 -1
  299. package/dist/chunks/fast-B3fRp1xO.js +0 -1
  300. package/dist/chunks/fetchModelList-B8KG79EK.js +0 -1
  301. package/dist/chunks/firstPartyEventLogger-YYOb8aIo.js +0 -1
  302. package/dist/chunks/flushGate-n4kK6H1U.js +0 -1
  303. package/dist/chunks/git-BaSq69E7.js +0 -1
  304. package/dist/chunks/hooks-COhKt_pF.js +0 -1
  305. package/dist/chunks/lazySchema-B4D4qJVE.js +0 -1
  306. package/dist/chunks/loadAgentsDir-qvqrTVuS.js +0 -1
  307. package/dist/chunks/localSearch-CDk_stXJ.js +0 -1
  308. package/dist/chunks/managedEnv-BUrzwaD3.js +0 -1
  309. package/dist/chunks/managedEnv-XOUMOtEF.js +0 -1
  310. package/dist/chunks/model-Bz4JHoU0.js +0 -1
  311. package/dist/chunks/model-g6XBcNAG.js +0 -1
  312. package/dist/chunks/model-sviY1inu.js +0 -1
  313. package/dist/chunks/parser-x-w3ikxt.js +0 -1
  314. package/dist/chunks/pluginStartupCheck-DWpquqxx.js +0 -1
  315. package/dist/chunks/pollConfig-BgpfHQPJ.js +0 -1
  316. package/dist/chunks/poorMode-DD88nPJ4.js +0 -1
  317. package/dist/chunks/prompt-BBeDQXIs.js +0 -1
  318. package/dist/chunks/prompt-CXhdqgB7.js +0 -1
  319. package/dist/chunks/remoteManagedSettings-Ahgn2e80.js +0 -1
  320. package/dist/chunks/ripgrep-Di-2j8Ws.js +0 -1
  321. package/dist/chunks/sandbox-adapter-D4Uho1vF.js +0 -1
  322. package/dist/chunks/searchExtraTools-BHMkqGBf.js +0 -1
  323. package/dist/chunks/sessionFileAccessHooks-BaWZ8sqn.js +0 -1
  324. package/dist/chunks/sessionObserver-KB1UL_n2.js +0 -1
  325. package/dist/chunks/sessionStorage-D6nlmaI-.js +0 -1
  326. package/dist/chunks/sessionTitle-SCqmSDYM.js +0 -14
  327. package/dist/chunks/settings-BgHApyGL.js +0 -1
  328. package/dist/chunks/settingsSync-nxeaGM2-.js +0 -1
  329. package/dist/chunks/sinks-D1opmy_x.js +0 -1
  330. package/dist/chunks/startupProfiler-B2fyaBEa.js +0 -1
  331. package/dist/chunks/state-CsdHk8n-.js +0 -1
  332. package/dist/chunks/status-CVcXPoOZ.js +0 -1
  333. package/dist/chunks/switcher-BIP3rbQn.js +0 -1
  334. package/dist/chunks/switcher-zbG6T9dN.js +0 -1
  335. package/dist/chunks/trustedDevice-hw3iq84W.js +0 -1
  336. package/dist/chunks/useMainLoopModel-BigVcn2T.js +0 -1
  337. package/dist/chunks/validatePlugin-mWVKNtJa.js +0 -1
  338. package/dist/chunks/windowsPaths-BybjGW7e.js +0 -1
  339. package/dist/chunks/worktree-IxcFe7g-.js +0 -1
@@ -1 +0,0 @@
1
- import{a as e,i as t,o as n}from"./detectRepository-Qy3zKoyn.js";t();export{e as parseGitHubRepository,n as parseGitRemote};
@@ -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-Wh7z6CnF.js";var i,a;e((()=>{n(),i=t(),a=(e,t,n)=>Promise.resolve((0,i.jsx)(r,{onDone:e}))}))();export{a as call};
@@ -1 +0,0 @@
1
- import{Ac as e,Oc as t,jc as n,kc as r}from"./loadAgentsDir-PPiD2Mfq.js";n();export{t as drainPendingExtraction,r as executeExtractMemories,e as initExtractMemories};
@@ -1 +0,0 @@
1
- import{n as e,r as t,t as n}from"./fast-ClOKONyD.js";t();export{n as FastModePicker,e as call};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./fetchModelList-gh_jFYai.js";e();export{t as fetchAvailableModels};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./firstPartyEventLogger-BMnXb9cv.js";e();export{t as initialize1PEventLogging};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{A as n,C as r,m as i,w as a}from"./external-CEp-aPkt.js";import{n as o,r as s,t as c}from"./lazySchema-B4D4qJVE.js";import{P as l,R as u,c as d,i as f}from"./debug-BQj6h99Q.js";import{C as p,vt as m,w as h,yt as g}from"./sessionState-BTFowSpR.js";import"./bridgeMessaging-B_hnuUHb.js";import{i as _}from"./workSecret-BUd8cQ6-.js";import{t as v}from"./ccrClient-AfdUbWzY.js";import{n as y,t as b}from"./SSETransport-BSilVN9e.js";s(),c(),m();var x={init_retry_max_attempts:3,init_retry_base_delay_ms:500,init_retry_jitter_fraction:.25,init_retry_max_delay_ms:4e3,http_timeout_ms:1e4,uuid_dedup_buffer_size:2e3,heartbeat_interval_ms:2e4,heartbeat_jitter_fraction:.1,token_refresh_buffer_ms:3e5,teardown_archive_timeout_ms:1500,connect_timeout_ms:15e3,min_version:`0.0.0`,should_show_app_upgrade_message:!1},S=o(()=>a({init_retry_max_attempts:r().int().min(1).max(10).default(3),init_retry_base_delay_ms:r().int().min(100).default(500),init_retry_jitter_fraction:r().min(0).max(1).default(.25),init_retry_max_delay_ms:r().int().min(500).default(4e3),http_timeout_ms:r().int().min(2e3).default(1e4),uuid_dedup_buffer_size:r().int().min(100).max(5e4).default(2e3),heartbeat_interval_ms:r().int().min(5e3).max(3e4).default(2e4),heartbeat_jitter_fraction:r().min(0).max(.5).default(.1),token_refresh_buffer_ms:r().int().min(3e4).max(18e5).default(3e5),teardown_archive_timeout_ms:r().int().min(500).max(2e3).default(1500),connect_timeout_ms:r().int().min(5e3).max(6e4).default(15e3),min_version:n().refine(e=>{try{return g(e,`0.0.0`),!0}catch{return!1}}).default(`0.0.0`),should_show_app_upgrade_message:i().default(!1)}));async function C(){let e=x,t=S().safeParse(e);return t.success?t.data:x}async function w(){let e=await C();return e.min_version&&g(`0.0.16`,e.min_version)?`Your version of Work Mate (0.0.16) is too old for Remote Control.\nVersion ${e.min_version} or higher is required. Run \`claude update\` to update.`:null}y(),f(),u(),p();function T(e){return{write:t=>e.write(t),writeBatch:t=>e.writeBatch(t),close:()=>e.close(),isConnectedStatus:()=>e.isConnectedStatus(),getStateLabel:()=>e.getStateLabel(),setOnData:t=>e.setOnData(t),setOnClose:t=>e.setOnClose(t),setOnConnect:t=>e.setOnConnect(t),connect:()=>void e.connect(),getLastSequenceNum:()=>0,get droppedBatchCount(){return e.droppedBatchCount},reportState:()=>{},reportMetadata:()=>{},reportDelivery:()=>{},flush:()=>Promise.resolve()}}async function E(e){let{sessionUrl:t,ingressToken:n,sessionId:r,initialSequenceNum:i,getAuthToken:a}=e,o;a?o=()=>{let e=a();return e?{Authorization:`Bearer ${e}`}:{}}:h(n);let s=e.epoch??await _(t,n);d(`[bridge:repl] CCR v2: worker sessionId=${r} epoch=${s}${e.epoch===void 0?` (via registerWorker)`:` (from /bridge)`}`);let c=new URL(t);c.pathname=`${c.pathname.replace(/\/$/,``)}/worker/events/stream`;let u=new b(c,{},r,void 0,i,o),f,p=new v(u,new URL(t),{getAuthHeaders:o,heartbeatIntervalMs:e.heartbeatIntervalMs,heartbeatJitterFraction:e.heartbeatJitterFraction,onEpochMismatch:()=>{d(`[bridge:repl] CCR v2: epoch superseded (409) — closing for poll-loop recovery`);try{p.close(),u.close(),f?.(4090)}catch(e){d(`[bridge:repl] CCR v2: error during epoch-mismatch cleanup: ${l(e)}`,{level:`error`})}throw Error(`epoch superseded`)}});u.setOnEvent(e=>{p.reportDelivery(e.event_id,`received`),p.reportDelivery(e.event_id,`processed`)});let m,g=!1,y=!1;return{write(e){return p.writeEvent(e)},async writeBatch(e){for(let t of e){if(y)break;await p.writeEvent(t)}},close(){y=!0,p.close(),u.close()},isConnectedStatus(){return g},getStateLabel(){return u.isClosedStatus()?`closed`:u.isConnectedStatus()?g?`connected`:`init`:`connecting`},setOnData(e){u.setOnData(e)},setOnClose(e){f=e,u.setOnClose(t=>{p.close(),e(t??4092)})},setOnConnect(e){m=e},getLastSequenceNum(){return u.getLastSequenceNum()},droppedBatchCount:0,reportState(e){p.reportState(e)},reportMetadata(e){p.reportMetadata(e)},reportDelivery(e,t){p.reportDelivery(e,t)},flush(){return p.flush()},connect(){e.outboundOnly||u.connect(),p.initialize(s).then(()=>{g=!0,d(`[bridge:repl] v2 transport ready for writes (epoch=${s}, sse=${u.isConnectedStatus()?`open`:`opening`})`),m?.()},e=>{d(`[bridge:repl] CCR v2 initialize failed: ${l(e)}`,{level:`error`}),p.close(),u.close(),f?.(4091)})}}}e();var D=class{constructor(){t(this,`_active`,!1),t(this,`_pending`,[])}get active(){return this._active}get pendingCount(){return this._pending.length}start(){this._active=!0}end(){return this._active=!1,this._pending.splice(0)}enqueue(...e){return this._active?(this._pending.push(...e),!0):!1}drop(){this._active=!1;let e=this._pending.length;return this._pending.length=0,e}deactivate(){this._active=!1}};export{C as a,w as i,T as n,E as r,D as t};
@@ -1 +0,0 @@
1
- import{a as e,i as t,m as n,r,u as i}from"./git-DplvjXEY.js";n();export{r as findGitRoot,t as getBranch,e as getDefaultBranch,i as getRemoteUrl};
@@ -1 +0,0 @@
1
- import{hn as e,mn as t,qt as n,sn as r}from"./loadAgentsDir-PPiD2Mfq.js";e();export{n as executeSessionEndHooks,r as getSessionEndHookTimeoutMs,t as hasWorktreeCreateHook};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./external-CEp-aPkt.js";var r,i=e((()=>{t(),t(),r=n})),a,o=e((()=>{i(),i(),a=r}));function s(e){let t;return()=>t??(t=e())}var c=e((()=>{}));export{a as i,s as n,o as r,c as t};
@@ -1 +0,0 @@
1
- import{o as e,t}from"./loadAgentsDir-PPiD2Mfq.js";e();export{t as clearAgentDefinitionsCache};
@@ -1 +0,0 @@
1
- import{a as e,o as t,s as n,t as r}from"./localSearch-Cvs9WfoX.js";t();export{r as clearSkillIndexCache,e as getSkillIndex,n as searchSkills};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DcaKZlRU.js";import{c as r,f as i,g as a,ln as o,un as s}from"./settings-CvhsRFaT.js";import{c,h as l}from"./config-BSkuQZNf.js";import{d as u,g as d,h as f,l as p,n as m,t as h,v as g}from"./proxy-C0j74LqT.js";import{n as _,t as v}from"./syncCache-AMQMQ_HR.js";import{n as y,r as b,t as x}from"./managedEnvConstants-BPwL2aWI.js";function S(e){if(!e||!process.env.ANTHROPIC_UNIX_SOCKET)return e||{};let{ANTHROPIC_UNIX_SOCKET:t,ANTHROPIC_BASE_URL:n,ANTHROPIC_API_KEY:r,ANTHROPIC_AUTH_TOKEN:i,CLAUDE_CODE_OAUTH_TOKEN:a,...o}=e;return o}function C(e){if(!e)return{};if(!t(process.env.CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST))return e;let n={};for(let[t,r]of Object.entries(e))b(t)||(n[t]=r);return n}function w(e){if(!e||!O)return e||{};let t={};for(let[n,r]of Object.entries(e))O.has(n)||(t[n]=r);return t}function T(e){return w(C(S(e)))}function E(){O===void 0&&(O=process.env.CLAUDE_CODE_ENTRYPOINT===`claude-desktop`?new Set(Object.keys(process.env)):null),Object.assign(process.env,T(c().env));for(let e of k)e!==`policySettings`&&s(e)&&Object.assign(process.env,T(r(e)?.env));_(),Object.assign(process.env,T(r(`policySettings`)?.env));let e=T(i()?.env);for(let[t,n]of Object.entries(e))x.has(t.toUpperCase())&&(process.env[t]=n)}function D(){Object.assign(process.env,T(c().env)),Object.assign(process.env,T(i()?.env)),d(),u(),h(),m()}var O,k,A=e((()=>{v(),g(),l(),n(),y(),f(),p(),o(),a(),k=[`userSettings`,`flagSettings`,`policySettings`]}));export{E as n,A as r,D as t};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./managedEnv-BUrzwaD3.js";e();export{t as applyConfigEnvironmentVariables};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{$h as n,Kw as r,Xh as i,Zh as a,bp as o,qw as s,xp as c,yp as l}from"./loadAgentsDir-PPiD2Mfq.js";import{ai as u,di as d,fi as f}from"./src-DL3w8VPk2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{D as m,E as h,q as g}from"./log-BlJ7CcKG.js";import{n as _,r as v}from"./analytics-DJobLaWP.js";import{A as y,B as b,J as x,O as S,Q as C,Y as w,Z as T,_ as E,b as D,j as O,k,s as A,w as j}from"./model-sviY1inu.js";import{i as M,n as N,r as P,t as F}from"./extraUsage-5Ueiyw6W.js";function I({onDone:e}){let t=a(e=>e.mainLoopModel),r=a(e=>e.mainLoopModelForSession),i=a(e=>e.fastMode),o=n();function s(){v(`tengu_model_command_menu`,{action:`cancel`});let n=H(t);e(`Kept model as ${d.bold(n)}`,{display:`system`})}function c(n){v(`tengu_model_command_menu`,{action:n,from_model:t,to_model:n}),o(e=>({...e,mainLoopModel:n,mainLoopModelForSession:null}));let r=`Set model to ${d.bold(H(n))}`,a;T()&&(b(),!C(n)&&i?(o(e=>({...e,fastMode:!1})),a=!1):C(n)&&w()&&i&&(r+=` · Fast mode ON`,a=!0)),N(n,a===!0,D())&&(r+=` · Billed as extra usage`),a===!1&&(r+=` · Fast mode OFF`),e(r)}return(0,W.jsx)(P,{initial:t,sessionModel:r,onSelect:c,onCancel:s,isStandaloneCommand:!0,showFastModeNotice:T()&&i&&C(t)&&w()})}function L({args:e,onDone:t}){let r=a(e=>e.fastMode),i=n(),o=e==="default"?null:e;return U.useEffect(()=>{async function e(){if(o&&!k(o)){t(`Model '${o}' is not available. Your organization restricts model selection.`,{display:`system`});return}if(o&&z(o)){t(`Opus 4.7 with 1M context is not available for your account. Learn more: https://code.workmate.com/docs/en/model-config#extended-context-with-1m`,{display:`system`});return}if(o&&B(o)){t(`Sonnet 4.6 with 1M context is not available for your account. Learn more: https://code.workmate.com/docs/en/model-config#extended-context-with-1m`,{display:`system`});return}if(!o){n(null);return}if(R(o)){n(o);return}try{let{valid:e,error:r}=await s(o);e?n(o):t(r||`Model '${o}' not found`,{display:`system`})}catch(e){t(`Failed to validate model: ${e.message}`,{display:`system`})}}function n(e){i(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null}));let n=`Set model to ${d.bold(H(e))}`,a;T()&&(b(),!C(e)&&r?(i(e=>({...e,fastMode:!1})),a=!1):C(e)&&r&&(n+=` · Fast mode ON`,a=!0)),N(e,a===!0,D())&&(n+=` · Billed as extra usage`),a===!1&&(n+=` · Fast mode OFF`),t(n)}e()},[o,t,i]),null}function R(e){return y.includes(e.toLowerCase().trim())}function z(e){let t=e.toLowerCase();return!l()&&!D()&&t.includes(`opus`)&&t.includes(`[1m]`)}function B(e){let t=e.toLowerCase();return!o()&&(t.includes(`sonnet[1m]`)||t.includes(`sonnet-4-6[1m]`))}function V({onDone:e}){let t=a(e=>e.mainLoopModel),n=a(e=>e.mainLoopModelForSession),r=H(t);return e(n?`Current model: ${d.bold(H(n))} (session override from plan mode)\nBase model: ${r}`:`Current model: ${r}`),null}function H(e){let t=j(e??A());return e===null?`${t} (default)`:t}var U,W,G;e((()=>{f(),U=t(u(),1),M(),g(),_(),i(),F(),x(),O(),c(),E(),S(),r(),W=p(),G=async(e,t,n)=>{if(n=n?.trim()||``,m.includes(n))return v(`tengu_model_command_inline_help`,{args:n}),(0,W.jsx)(V,{onDone:e});if(h.includes(n)){e(`Run /model to open the model selection menu, or /model [modelName] to set the model.`,{display:`system`});return}return n?(v(`tengu_model_command_inline`,{args:n}),(0,W.jsx)(L,{args:n,onDone:e})):(0,W.jsx)(I,{onDone:e})}}))();export{G as call};
@@ -1 +0,0 @@
1
- import{_ as e,u as t}from"./model-sviY1inu.js";e();export{t as getMainLoopModel};
@@ -1 +0,0 @@
1
- import{n as e,o as t,r as n}from"./rolldown-runtime-DaDcL9Zw.js";import{n as r,t as i}from"./memoize-BK3gG5ob.js";import{d as a,i as o,l as s,o as c,r as ee,s as l,t as u}from"./envUtils-DcaKZlRU.js";import{n as te,t as d}from"./defineProperty-C-QyHrDq.js";import{n as f,t as p}from"./axios-DaWTGg7G.js";import{di as ne,fi as re}from"./src-DL3w8VPk2.js";import{A as ie,C as ae,p as oe,w as se}from"./external-CEp-aPkt.js";import{n as ce,r as le,t as ue}from"./lazySchema-B4D4qJVE.js";import{$ as de,In as fe,Ir as pe,J as me,Lr as he,Wt as m,Z as ge,Zt as _e,dt as ve,lr as ye,pt as be,sn as xe,ur as Se,vn as Ce,y as we,z as h,zn as Te}from"./state-BPFYBqm1.js";import{B as Ee,C as De,F as Oe,G as ke,P as g,R as Ae,S as je,T as Me,W as Ne,c as _,f as Pe,i as v,o as Fe,s as Ie,u as Le,x as Re}from"./debug-BQj6h99Q.js";import{Wt as ze,c as y,f as b,g as x,n as Be,x as Ve}from"./settings-CvhsRFaT.js";import{C as He,S as Ue,c as S,h as We,n as C,y as w}from"./config-BSkuQZNf.js";import{a as Ge,c as Ke,i as qe,o as Je,r as Ye,s as Xe,t as Ze}from"./execFileNoThrow-DYm1GeGn.js";import{d as Qe,f as $e,o as et,s as T}from"./log-BlJ7CcKG.js";import{r as tt,t as nt}from"./memoize-_2f7NWDv.js";import{s as rt,u as it}from"./types-BomO8WUz.js";import{n as at,r as E}from"./analytics-DJobLaWP.js";import{l as D,n as ot,r as st,s as ct,t as lt,u as O}from"./oauth-D38aRTUb.js";import{n as ut,t as dt}from"./bundledMode--fG1S62b.js";import{n as ft,o as pt}from"./stringUtils-BjnclTLB.js";import{a as mt,i as ht,l as gt}from"./proxy-C0j74LqT.js";import{userInfo as _t}from"os";import{join as vt}from"path";import{chmodSync as yt,mkdirSync as bt,readFileSync as xt,writeFileSync as St}from"fs";import{createHash as Ct,randomUUID as wt}from"crypto";import{mkdir as Tt,stat as Et,writeFile as Dt}from"fs/promises";import{exec as Ot,execFile as kt}from"child_process";import{AsyncLocalStorage as At}from"async_hooks";function k(e=Be()){let t=e.modelType;return t===`openai`?`openai`:t===`gemini`?`gemini`:t===`grok`?`grok`:s(process.env.CLAUDE_CODE_USE_BEDROCK)?`bedrock`:s(process.env.CLAUDE_CODE_USE_VERTEX)?`vertex`:s(process.env.CLAUDE_CODE_USE_FOUNDRY)?`foundry`:s(process.env.CLAUDE_CODE_USE_OPENAI)?`openai`:s(process.env.CLAUDE_CODE_USE_GEMINI)?`gemini`:s(process.env.CLAUDE_CODE_USE_GROK)?`grok`:`firstParty`}function jt(){return k()}function Mt(){let e=process.env.ANTHROPIC_BASE_URL;if(!e)return!0;try{return new URL(e).host===`api.anthropic.com`}catch{return!1}}var A=e((()=>{x(),c()}));function Nt(){return Ft.getStore()?.workload}function Pt(e,t){return Ft.run({workload:e},t)}var Ft,It=e((()=>{Ft=new At}));function Lt(e){let t=[],n=!1;async function r(){if(!n&&t.length!==0){for(n=!0;t.length>0;){let{args:n,resolve:r,reject:i,context:a}=t.shift();try{r(await e.apply(a,n))}catch(e){i(e)}}n=!1,t.length>0&&r()}}return function(...e){return new Promise((n,i)=>{t.push({args:e,resolve:n,reject:i,context:this}),r()})}}var Rt=e((()=>{}));function zt(e,t){return e.find(e=>e.includes(t))??null}async function Bt(){let{BedrockClient:e}=await import(`./dist-es-yHGBqhBe.js`),t=u(),n=s(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH),r={region:t,...process.env.ANTHROPIC_BEDROCK_BASE_URL&&{endpoint:process.env.ANTHROPIC_BEDROCK_BASE_URL},...await ht(),...n&&{requestHandler:new(await(import(`./dist-es-C7vygWzp.js`))).NodeHttpHandler,httpAuthSchemes:[{schemeId:`smithy.api#noAuth`,identityProvider:()=>async()=>({}),signer:new(await(import(`./dist-es-gUzZ_7Vf.js`))).NoAuthSigner}],httpAuthSchemeProvider:()=>[{schemeId:`smithy.api#noAuth`}]}};if(!n&&!process.env.AWS_BEARER_TOKEN_BEDROCK){let e=await U();e&&(r.credentials={accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,sessionToken:e.sessionToken})}return new e(r)}async function Vt(){let{BedrockRuntimeClient:e}=await import(`./dist-es-Gt_DpXlP.js`),t=u(),n=s(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH),r={region:t,...process.env.ANTHROPIC_BEDROCK_BASE_URL&&{endpoint:process.env.ANTHROPIC_BEDROCK_BASE_URL},...await ht(),...n&&{requestHandler:new(await(import(`./dist-es-C7vygWzp.js`))).NodeHttpHandler,httpAuthSchemes:[{schemeId:`smithy.api#noAuth`,identityProvider:()=>async()=>({}),signer:new(await(import(`./dist-es-gUzZ_7Vf.js`))).NoAuthSigner}],httpAuthSchemeProvider:()=>[{schemeId:`smithy.api#noAuth`}]}};if(!n&&!process.env.AWS_BEARER_TOKEN_BEDROCK){let e=await U();e&&(r.credentials={accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,sessionToken:e.sessionToken})}return new e(r)}function Ht(e){return e.startsWith(`anthropic.`)}function Ut(e){if(!e.startsWith(`arn:`))return e;let t=e.lastIndexOf(`/`);return t===-1?e:e.substring(t+1)}function Wt(e){let t=Ut(e);for(let e of Jt)if(t.startsWith(`${e}.anthropic.`))return e}function Gt(e,t){let n=Wt(e);return n?e.replace(`${n}.`,`${t}.`):Ht(e)?`${t}.${e}`:e}var Kt,qt,Jt,Yt=e((()=>{i(),G(),c(),et(),gt(),Kt=r(async()=>{let[e,{ListInferenceProfilesCommand:t}]=await Promise.all([Bt(),import(`./dist-es-yHGBqhBe.js`)]),n=[],r;try{do{let i=new t({...r&&{nextToken:r},typeEquals:`SYSTEM_DEFINED`}),a=await e.send(i);a.inferenceProfileSummaries&&n.push(...a.inferenceProfileSummaries),r=a.nextToken}while(r);return n.filter(e=>e.inferenceProfileId?.includes(`anthropic`)).map(e=>e.inferenceProfileId).filter(Boolean)}catch(e){throw T(e),e}}),qt=r(async e=>{try{let[t,{GetInferenceProfileCommand:n}]=await Promise.all([Bt(),import(`./dist-es-yHGBqhBe.js`)]),r=new n({inferenceProfileIdentifier:e}),i=await t.send(r);if(!i.models||i.models.length===0)return null;let a=i.models[0];if(!a?.modelArn)return null;let o=a.modelArn.lastIndexOf(`/`);return o>=0?a.modelArn.substring(o+1):a.modelArn}catch(e){return T(e),null}}),Jt=[`us`,`eu`,`apac`,`global`]})),Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln,un,dn=e((()=>{Xt={firstParty:`claude-3-7-sonnet-20250219`,bedrock:`us.anthropic.claude-3-7-sonnet-20250219-v1:0`,vertex:`claude-3-7-sonnet@20250219`,foundry:`claude-3-7-sonnet`,openai:`claude-3-7-sonnet-20250219`,gemini:`claude-3-7-sonnet-20250219`,grok:`claude-3-7-sonnet-20250219`},Zt={firstParty:`claude-3-5-sonnet-20241022`,bedrock:`anthropic.claude-3-5-sonnet-20241022-v2:0`,vertex:`claude-3-5-sonnet-v2@20241022`,foundry:`claude-3-5-sonnet`,openai:`claude-3-5-sonnet-20241022`,gemini:`claude-3-5-sonnet-20241022`,grok:`claude-3-5-sonnet-20241022`},Qt={firstParty:`claude-3-5-haiku-20241022`,bedrock:`us.anthropic.claude-3-5-haiku-20241022-v1:0`,vertex:`claude-3-5-haiku@20241022`,foundry:`claude-3-5-haiku`,openai:`claude-3-5-haiku-20241022`,gemini:`claude-3-5-haiku-20241022`,grok:`claude-3-5-haiku-20241022`},$t={firstParty:`claude-haiku-4-5-20251001`,bedrock:`us.anthropic.claude-haiku-4-5-20251001-v1:0`,vertex:`claude-haiku-4-5@20251001`,foundry:`claude-haiku-4-5`,openai:`claude-haiku-4-5-20251001`,gemini:`claude-haiku-4-5-20251001`,grok:`claude-haiku-4-5-20251001`},en={firstParty:`claude-sonnet-4-20250514`,bedrock:`us.anthropic.claude-sonnet-4-20250514-v1:0`,vertex:`claude-sonnet-4@20250514`,foundry:`claude-sonnet-4`,openai:`claude-sonnet-4-20250514`,gemini:`claude-sonnet-4-20250514`,grok:`claude-sonnet-4-20250514`},tn={firstParty:`claude-sonnet-4-5-20250929`,bedrock:`us.anthropic.claude-sonnet-4-5-20250929-v1:0`,vertex:`claude-sonnet-4-5@20250929`,foundry:`claude-sonnet-4-5`,openai:`claude-sonnet-4-5-20250929`,gemini:`claude-sonnet-4-5-20250929`,grok:`claude-sonnet-4-5-20250929`},nn={firstParty:`claude-opus-4-20250514`,bedrock:`us.anthropic.claude-opus-4-20250514-v1:0`,vertex:`claude-opus-4@20250514`,foundry:`claude-opus-4`,openai:`claude-opus-4-20250514`,gemini:`claude-opus-4-20250514`,grok:`claude-opus-4-20250514`},rn={firstParty:`claude-opus-4-1-20250805`,bedrock:`us.anthropic.claude-opus-4-1-20250805-v1:0`,vertex:`claude-opus-4-1@20250805`,foundry:`claude-opus-4-1`,openai:`claude-opus-4-1-20250805`,gemini:`claude-opus-4-1-20250805`,grok:`claude-opus-4-1-20250805`},an={firstParty:`claude-opus-4-5-20251101`,bedrock:`us.anthropic.claude-opus-4-5-20251101-v1:0`,vertex:`claude-opus-4-5@20251101`,foundry:`claude-opus-4-5`,openai:`claude-opus-4-5-20251101`,gemini:`claude-opus-4-5-20251101`,grok:`claude-opus-4-5-20251101`},on={firstParty:`claude-opus-4-6`,bedrock:`us.anthropic.claude-opus-4-6-v1`,vertex:`claude-opus-4-6`,foundry:`claude-opus-4-6`,openai:`claude-opus-4-6`,gemini:`claude-opus-4-6`,grok:`claude-opus-4-6`},sn={firstParty:`claude-opus-4-7`,bedrock:`us.anthropic.claude-opus-4-7-v1`,vertex:`claude-opus-4-7`,foundry:`claude-opus-4-7`,openai:`claude-opus-4-7`,gemini:`claude-opus-4-7`,grok:`claude-opus-4-7`},cn={firstParty:`claude-sonnet-4-6`,bedrock:`us.anthropic.claude-sonnet-4-6`,vertex:`claude-sonnet-4-6`,foundry:`claude-sonnet-4-6`,openai:`claude-sonnet-4-6`,gemini:`claude-sonnet-4-6`,grok:`claude-sonnet-4-6`},ln={haiku35:Qt,haiku45:$t,sonnet35:Zt,sonnet37:Xt,sonnet40:en,sonnet45:tn,sonnet46:cn,opus40:nn,opus41:rn,opus45:an,opus46:on,opus47:sn},Object.values(ln).map(e=>e.firstParty),un=Object.fromEntries(Object.entries(ln).map(([e,t])=>[t.firstParty,e]))}));function fn(e){let t={};for(let n of vn)t[n]=ln[n][e];return t}async function pn(){let e=fn(`bedrock`),t;try{t=await Kt()}catch(t){return T(t),e}if(!t?.length)return e;let n={};for(let r of vn){let i=ln[r].firstParty;n[r]=zt(t,i)||e[r]}return n}function mn(e){let t=Be().modelOverrides;if(!t)return e;let n={...e};for(let[e,r]of Object.entries(t)){let t=un[e];t&&r&&(n[t]=r)}return n}function hn(e){let t;try{t=Be().modelOverrides}catch{return e}if(!t)return e;for(let[n,r]of Object.entries(t))if(r===e)return n;return e}function gn(){if(ge()===null){if(k()!==`bedrock`){fe(fn(k()));return}yn()}}function j(){let e=ge();return e===null?(gn(),mn(fn(k()))):mn(e)}async function _n(){if(ge()===null){if(k()!==`bedrock`){fe(fn(k()));return}await yn()}}var vn,yn,bn=e((()=>{m(),et(),Rt(),x(),Yt(),dn(),A(),vn=Object.keys(ln),yn=Lt(async()=>{if(ge()===null)try{fe(await pn())}catch(e){T(e)}})}));async function xn(){let e=S().oauthAccount?.accountUuid,t=ea();if(!e||!t)return;let n=`${D().BASE_API_URL}/api/claude_cli_profile`;try{return(await f.get(n,{headers:{"x-api-key":t,"anthropic-beta":ct},params:{account_uuid:e},timeout:1e4})).data}catch(e){T(e)}}async function Sn(e){let t=`${D().BASE_API_URL}/api/oauth/profile`;try{return(await f.get(t,{headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`},timeout:1e4})).data}catch(e){T(e)}}var Cn=e((()=>{p(),O(),G(),We(),et()}));function wn(e){return!!e?.includes(ot)}function Tn(e){return e?.split(` `).filter(Boolean)??[]}function En({codeChallenge:e,state:t,port:n,isManual:r,loginWithClaudeAi:i,inferenceOnly:a,orgUUID:o,loginHint:s,loginMethod:c}){let ee=i?D().CLAUDE_AI_AUTHORIZE_URL:D().CONSOLE_AUTHORIZE_URL,l=new URL(ee);l.searchParams.append(`code`,`true`),l.searchParams.append(`client_id`,D().CLIENT_ID),l.searchParams.append(`response_type`,`code`),l.searchParams.append(`redirect_uri`,r?D().MANUAL_REDIRECT_URL:`http://localhost:${n}/callback`);let u=a?[ot]:lt;return l.searchParams.append(`scope`,u.join(` `)),l.searchParams.append(`code_challenge`,e),l.searchParams.append(`code_challenge_method`,`S256`),l.searchParams.append(`state`,t),o&&l.searchParams.append(`orgUUID`,o),s&&l.searchParams.append(`login_hint`,s),c&&l.searchParams.append(`login_method`,c),l.toString()}async function Dn(e,t,n,r,i=!1,a){let o={grant_type:`authorization_code`,code:e,redirect_uri:i?D().MANUAL_REDIRECT_URL:`http://localhost:${r}/callback`,client_id:D().CLIENT_ID,code_verifier:n,state:t};a!==void 0&&(o.expires_in=a);let s=await f.post(D().TOKEN_URL,o,{headers:{"Content-Type":`application/json`},timeout:15e3});if(s.status!==200)throw Error(s.status===401?`Authentication failed: Invalid authorization code`:`Token exchange failed (${s.status}): ${s.statusText}`);return E(`tengu_oauth_token_exchange_success`,{}),s.data}async function On(e,{scopes:t}={}){let n={grant_type:`refresh_token`,refresh_token:e,client_id:D().CLIENT_ID,scope:(t?.length?t:st).join(` `)};try{let t=await f.post(D().TOKEN_URL,n,{headers:{"Content-Type":`application/json`},timeout:15e3});if(t.status!==200)throw Error(`Token refresh failed: ${t.statusText}`);let r=t.data,{access_token:i,refresh_token:a=e,expires_in:o}=r,s=Date.now()+o*1e3,c=Tn(r.scope);E(`tengu_oauth_token_refresh_success`,{});let ee=S(),l=W(),u=ee.oauthAccount?.billingType!==void 0&&ee.oauthAccount?.accountCreatedAt!==void 0&&ee.oauthAccount?.subscriptionCreatedAt!==void 0&&l?.subscriptionType!=null&&l?.rateLimitTier!=null?null:await Mn(i);if(u&&ee.oauthAccount){let e={};u.displayName!==void 0&&(e.displayName=u.displayName),typeof u.hasExtraUsageEnabled==`boolean`&&(e.hasExtraUsageEnabled=u.hasExtraUsageEnabled),u.billingType!==null&&(e.billingType=u.billingType),u.accountCreatedAt!==void 0&&(e.accountCreatedAt=u.accountCreatedAt),u.subscriptionCreatedAt!==void 0&&(e.subscriptionCreatedAt=u.subscriptionCreatedAt),Object.keys(e).length>0&&w(t=>({...t,oauthAccount:t.oauthAccount?{...t.oauthAccount,...e}:t.oauthAccount}))}return{accessToken:i,refreshToken:a,expiresAt:s,scopes:c,subscriptionType:u?.subscriptionType??l?.subscriptionType??null,rateLimitTier:u?.rateLimitTier??l?.rateLimitTier??null,profile:u?.rawProfile,tokenAccount:r.account?{uuid:r.account.uuid,emailAddress:r.account.email_address,organizationUuid:r.organization?.uuid}:void 0}}catch(e){let t=f.isAxiosError(e)&&e.response?.data?JSON.stringify(e.response.data):void 0;throw E(`tengu_oauth_token_refresh_failure`,{error:e.message,...t&&{responseBody:t}}),e}}async function kn(e){let t=await f.get(D().ROLES_URL,{headers:{Authorization:`Bearer ${e}`}});if(t.status!==200)throw Error(`Failed to fetch user roles: ${t.statusText}`);let n=t.data;if(!S().oauthAccount)throw Error(`OAuth account information not found in config`);w(e=>({...e,oauthAccount:e.oauthAccount?{...e.oauthAccount,organizationRole:n.organization_role,workspaceRole:n.workspace_role,organizationName:n.organization_name}:e.oauthAccount})),E(`tengu_oauth_roles_stored`,{org_role:n.organization_role})}async function An(e){try{let t=await f.post(D().API_KEY_URL,null,{headers:{Authorization:`Bearer ${e}`}}),n=t.data?.raw_key;return n?(await ka(n),E(`tengu_oauth_api_key`,{status:`success`,statusCode:t.status}),n):null}catch(e){throw E(`tengu_oauth_api_key`,{status:`failure`,error:e instanceof Error?e.message:String(e)}),e}}function jn(e){return e!==null&&Date.now()+300*1e3>=e}async function Mn(e){let t=await Sn(e),n=t?.organization?.organization_type,r=null;switch(n){case`claude_max`:r=`max`;break;case`claude_pro`:r=`pro`;break;case`claude_enterprise`:r=`enterprise`;break;case`claude_team`:r=`team`;break;default:r=null;break}let i={subscriptionType:r,rateLimitTier:t?.organization?.rate_limit_tier??null,hasExtraUsageEnabled:t?.organization?.has_extra_usage_enabled??null,billingType:t?.organization?.billing_type??null};return t?.account?.display_name&&(i.displayName=t.account.display_name),t?.account?.created_at&&(i.accountCreatedAt=t.account.created_at),t?.organization?.subscription_created_at&&(i.subscriptionCreatedAt=t.organization.subscription_created_at),E(`tengu_oauth_profile_fetch_success`,{}),{...i,rawProfile:t}}async function Nn(){let e=S().oauthAccount?.organizationUuid;if(e)return e;let t=W()?.accessToken;return t===void 0||!Va()?null:(await Sn(t))?.organization?.uuid||null}async function Pn(){let e=process.env.CLAUDE_CODE_ACCOUNT_UUID,t=process.env.CLAUDE_CODE_USER_EMAIL,n=process.env.CLAUDE_CODE_ORGANIZATION_UUID,r=!!(e&&t&&n);e&&t&&n&&(S().oauthAccount||Fn({accountUuid:e,emailAddress:t,organizationUuid:n})),await za();let i=S();if(i.oauthAccount&&i.oauthAccount.billingType!==void 0&&i.oauthAccount.accountCreatedAt!==void 0&&i.oauthAccount.subscriptionCreatedAt!==void 0||!R()||!Va())return!1;let a=W();if(a?.accessToken){let e=await Sn(a.accessToken);if(e)return r&&_(`OAuth profile fetch succeeded, overriding env var account info`,{level:`info`}),Fn({accountUuid:e.account.uuid,emailAddress:e.account.email,organizationUuid:e.organization.uuid,displayName:e.account.display_name||void 0,hasExtraUsageEnabled:e.organization.has_extra_usage_enabled??!1,billingType:e.organization.billing_type??void 0,accountCreatedAt:e.account.created_at,subscriptionCreatedAt:e.organization.subscription_created_at??void 0}),!0}return!1}function Fn({accountUuid:e,emailAddress:t,organizationUuid:n,displayName:r,hasExtraUsageEnabled:i,billingType:a,accountCreatedAt:o,subscriptionCreatedAt:s}){let c={accountUuid:e,emailAddress:t,organizationUuid:n,hasExtraUsageEnabled:i,billingType:a,accountCreatedAt:o,subscriptionCreatedAt:s};r&&(c.displayName=r),w(e=>e.oauthAccount?.accountUuid===c.accountUuid&&e.oauthAccount?.emailAddress===c.emailAddress&&e.oauthAccount?.organizationUuid===c.organizationUuid&&e.oauthAccount?.displayName===c.displayName&&e.oauthAccount?.hasExtraUsageEnabled===c.hasExtraUsageEnabled&&e.oauthAccount?.billingType===c.billingType&&e.oauthAccount?.accountCreatedAt===c.accountCreatedAt&&e.oauthAccount?.subscriptionCreatedAt===c.subscriptionCreatedAt?e:{...e,oauthAccount:c})}var In=e((()=>{p(),at(),O(),G(),We(),v(),Cn()}));function Ln(e,t,n){if(s(process.env.CLAUDE_CODE_REMOTE))try{bt(Hn,{recursive:!0,mode:448}),St(e,t,{encoding:`utf8`,mode:384}),_(`Persisted ${n} to ${e} for subprocess access`)}catch(e){_(`Failed to persist ${n} to disk (non-fatal): ${g(e)}`,{level:`error`})}}function Rn(e,t){try{let n=Le().readFileSync(e,{encoding:`utf8`}).trim();return n?(_(`Read ${t} from well-known file ${e}`),n):null}catch(n){return Ee(n)||_(`Failed to read ${t} from ${e}: ${g(n)}`,{level:`debug`}),null}}function zn({envVar:e,wellKnownPath:t,label:n,getCached:r,setCached:i}){let a=r();if(a!==void 0)return a;let o=process.env[e];if(!o){let e=Rn(t,n);return i(e),e}let s=parseInt(o,10);if(Number.isNaN(s))return _(`${e} must be a valid file descriptor number, got: ${o}`,{level:`error`}),i(null),null;try{let e=Le(),r=process.platform===`darwin`||process.platform===`freebsd`?`/dev/fd/${s}`:`/proc/self/fd/${s}`,a=e.readFileSync(r,{encoding:`utf8`}).trim();return a?(_(`Successfully read ${n} from file descriptor ${s}`),i(a),Ln(t,a,n),a):(_(`File descriptor contained empty ${n}`,{level:`error`}),i(null),null)}catch(e){_(`Failed to read ${n} from file descriptor ${s}: ${g(e)}`,{level:`error`});let r=Rn(t,n);return i(r),r}}function Bn(){return zn({envVar:`CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR`,wellKnownPath:Un,label:`OAuth token`,getCached:de,setCached:Te})}function Vn(){return zn({envVar:`CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR`,wellKnownPath:Wn,label:`API key`,getCached:we,setCached:xe})}var Hn,Un,Wn,Gn,Kn=e((()=>{m(),v(),c(),Ae(),Pe(),Hn=`/home/claude/.workmate/remote`,Un=`${Hn}/.oauth_token`,Wn=`${Hn}/.api_key`,Gn=`${Hn}/.session_ingress_token`}));function M(e=``){let t=o(),n=process.env.WORKMATE_CONFIG_DIR?`-${Ct(`sha256`).update(t).digest(`hex`).substring(0,8)}`:``;return`Claude Code${D().OAUTH_FILE_SUFFIX}${e}${n}`}function qn(){try{return process.env.USER||_t().username}catch{return`claude-code-user`}}function N(){P.cache={data:null,cachedAt:0},P.generation++,P.readInFlight=null}function Jn(e){if(P.cache.cachedAt!==0)return;let t=null;if(e)try{t=JSON.parse(e)}catch{return}P.cache={data:t,cachedAt:Date.now()}}var Yn,P,Xn=e((()=>{O(),c(),Yn=`-credentials`,P={cache:{data:null,cachedAt:0},generation:0,readInFlight:null}}));async function Zn(){if(process.platform===`darwin`&&(await Je(`security delete-generic-password -a $USER -s "${M()}"`,{shell:!0,reject:!1})).exitCode!==0)throw Error(`Failed to delete keychain entry`)}function Qn(e){return e.slice(-20)}var $n=e((()=>{Ke(),Xn()}));function er(e){return e?.name===`CredentialsProviderError`}function tr(e){if(!e||typeof e!=`object`)return!1;let t=e;if(!t.Credentials||typeof t.Credentials!=`object`)return!1;let n=t.Credentials;return typeof n.AccessKeyId==`string`&&typeof n.SecretAccessKey==`string`&&typeof n.SessionToken==`string`&&n.AccessKeyId.length>0&&n.SecretAccessKey.length>0&&n.SessionToken.length>0}async function nr(){let{STSClient:e,GetCallerIdentityCommand:t}=await import(`./dist-es-C-OjW2Ao.js`);await new e().send(new t({}))}async function rr(){try{_(`Clearing AWS credential provider cache`);let{fromIni:e}=await import(`./dist-es-CIULjvtA2.js`);await e({ignoreCache:!0})(),_(`AWS credential provider cache refreshed`)}catch{_(`Failed to clear AWS credential cache (this is expected if no credentials are configured)`)}}var ir=e((()=>{v()})),ar,or=e((()=>{Se(),te(),ar=class e{constructor(){d(this,`status`,{isAuthenticating:!1,output:[]}),d(this,`changed`,ye()),d(this,`subscribe`,this.changed.subscribe)}static getInstance(){return e.instance||(e.instance=new e),e.instance}getStatus(){return{...this.status,output:[...this.status.output]}}startAuthentication(){this.status={isAuthenticating:!0,output:[]},this.changed.emit(this.getStatus())}addOutput(e){this.status.output.push(e),this.changed.emit(this.getStatus())}setError(e){this.status.error=e,this.changed.emit(this.getStatus())}endAuthentication(e){e?this.status={isAuthenticating:!1,output:[]}:this.status.isAuthenticating=!1,this.changed.emit(this.getStatus())}static reset(){e.instance&&(e.instance.changed.clear(),e.instance=null)}},d(ar,`instance`,null)})),sr,cr,lr,ur,dr,fr,pr,mr,hr,gr,_r,vr,yr,br=e((()=>{sr=`claude-code-20250219`,cr=`interleaved-thinking-2025-05-14`,lr=`context-1m-2025-08-07`,ur=`context-management-2025-06-27`,dr=`structured-outputs-2025-12-15`,fr=`tool-search-tool-2025-10-19`,pr=`task-budgets-2026-03-13`,mr=`prompt-caching-scope-2026-01-05`,hr=`fast-mode-2026-02-01`,gr=`redact-thinking-2026-02-12`,_r=`advisor-tool-2026-03-01`,vr=new Set([cr,lr,fr]),yr=new Set([sr,cr,ur])}));function xr(e,t){return pe(e,t)}var Sr=e((()=>{he()}));function Cr(){let e=process.env.CLAUDE_AGENT_SDK_VERSION?`, agent-sdk/${process.env.CLAUDE_AGENT_SDK_VERSION}`:``,t=process.env.CLAUDE_AGENT_SDK_CLIENT_APP?`, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`:``,n=Nt(),r=n?`, workload/${n}`:``;return`claude-cli/0.0.16 (external, ${process.env.CLAUDE_CODE_ENTRYPOINT??`cli`}${e}${t}${r})`}function wr(){let e=[];return process.env.CLAUDE_CODE_ENTRYPOINT&&e.push(process.env.CLAUDE_CODE_ENTRYPOINT),process.env.CLAUDE_AGENT_SDK_VERSION&&e.push(`agent-sdk/${process.env.CLAUDE_AGENT_SDK_VERSION}`),process.env.CLAUDE_AGENT_SDK_CLIENT_APP&&e.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`),`workmate/0.0.16${e.length>0?` (${e.join(`, `)})`:``}`}function Tr(){if(R()){let e=W();return e?.accessToken?{headers:{Authorization:`Bearer ${e.accessToken}`,"anthropic-beta":ct}}:{headers:{},error:`No OAuth token available`}}let e=ea();return e?{headers:{"x-api-key":e}}:{headers:{},error:`No API key available`}}async function Er(e,t){try{return await e()}catch(n){if(!f.isAxiosError(n))throw n;let r=n.response?.status;if(!(r===401||t?.also403Revoked&&r===403&&typeof n.response?.data==`string`&&n.response.data.includes(`OAuth token has been revoked`)))throw n;let i=W()?.accessToken;if(!i)throw n;return await Ia(i),await e()}}var Dr=e((()=>{p(),O(),G(),It()}));function Or(){return{error:(e,...t)=>console.error(`[SDK ERROR]`,e,...t),warn:(e,...t)=>console.error(`[SDK WARN]`,e,...t),info:(e,...t)=>console.error(`[SDK INFO]`,e,...t),debug:(e,...t)=>console.error(`[SDK DEBUG]`,e,...t)}}async function kr({apiKey:e,maxRetries:n,model:r,fetchOverride:i,source:a}){let o=process.env.CLAUDE_CODE_CONTAINER_ID,c=process.env.CLAUDE_CODE_REMOTE_SESSION_ID,l=process.env.CLAUDE_AGENT_SDK_CLIENT_APP,te=jr(),d={"x-app":`cli`,"User-Agent":Cr(),"X-Claude-Code-Session-Id":be(),...te,...o?{"x-claude-remote-container-id":o}:{},...c?{"x-claude-remote-session-id":c}:{},...l?{"x-client-app":l}:{},...process.env.ANTHROPIC_AUTH_NONCE?{"x-auth-nonce":process.env.ANTHROPIC_AUTH_NONCE}:{}};_(`[API:request] Creating client, ANTHROPIC_CUSTOM_HEADERS present: ${!!process.env.ANTHROPIC_CUSTOM_HEADERS}, has Authorization header: ${!!te.Authorization}`),s(process.env.CLAUDE_CODE_ADDITIONAL_PROTECTION)&&(d[`x-anthropic-additional-protection`]=`true`),_(`[API:auth] OAuth token check starting`),await za(),_(`[API:auth] OAuth token check complete`),R()||await Ar(d,h());let f=Mr(i,a),p={defaultHeaders:d,maxRetries:n,timeout:parseInt(process.env.API_TIMEOUT_MS||`600000`,10),dangerouslyAllowBrowser:!0,fetchOptions:mt({forAnthropicAPI:!0}),...f&&{fetch:f}};if(s(process.env.CLAUDE_CODE_USE_BEDROCK)){let{BedrockClient:e}=await import(`./bedrockClient-DxE_mHFI.js`),t=r===js()&&process.env.ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION?process.env.ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:u(),n={...p,awsRegion:t,...s(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&{skipAuth:!0},...Fe()&&{logger:Or()}};if(process.env.AWS_BEARER_TOKEN_BEDROCK)n.skipAuth=!0,n.defaultHeaders={...n.defaultHeaders,Authorization:`Bearer ${process.env.AWS_BEARER_TOKEN_BEDROCK}`};else if(!s(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)){let e=await U();e&&(n.awsAccessKey=e.accessKeyId,n.awsSecretKey=e.secretAccessKey,n.awsSessionToken=e.sessionToken)}return new e(n)}if(s(process.env.CLAUDE_CODE_USE_FOUNDRY)){let{AnthropicFoundry:e}=await import(`./foundry-sdk-BdeF2aBu.js`),t;if(!process.env.ANTHROPIC_FOUNDRY_API_KEY)if(s(process.env.CLAUDE_CODE_SKIP_FOUNDRY_AUTH))t=()=>Promise.resolve(``);else{let{DefaultAzureCredential:e,getBearerTokenProvider:n}=await import(`./esm-CGx9qY3q.js`);t=n(new e,`https://cognitiveservices.azure.com/.default`)}return new e({...p,...t&&{azureADTokenProvider:t},...Fe()&&{logger:Or()}})}if(s(process.env.CLAUDE_CODE_USE_VERTEX)){s(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)||await mo();let[{AnthropicVertex:e},{GoogleAuth:n}]=await Promise.all([import(`./vertex-sdk-DjXcZ2J7.js`),import(`./src-CiJCsqUl.js`).then(e=>t(e.default,1))]),i=process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project,a=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials,o=s(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)?{getClient:()=>({getRequestHeaders:()=>({})})}:new n({scopes:[`https://www.googleapis.com/auth/cloud-platform`],...i||a?{}:{projectId:process.env.ANTHROPIC_VERTEX_PROJECT_ID}});return new e({...p,region:ee(r),googleAuth:o,...Fe()&&{logger:Or()}})}return new ke({apiKey:R()?null:e||ea(),authToken:R()?W()?.accessToken:void 0,...p,...Fe()&&{logger:Or()}})}async function Ar(e,t){let n=process.env.ANTHROPIC_AUTH_TOKEN||await ua(t);n&&(e.Authorization=`Bearer ${n}`)}function jr(){let e={},t=process.env.ANTHROPIC_CUSTOM_HEADERS;if(!t)return e;let n=t.split(/\n|\r\n/);for(let t of n){if(!t.trim())continue;let n=t.indexOf(`:`);if(n===-1)continue;let r=t.slice(0,n).trim(),i=t.slice(n+1).trim();r&&(e[r]=i)}return e}function Mr(e,t){let n=e??globalThis.fetch,r=k()===`firstParty`&&Mt();return(e,i)=>{let a=new Headers(i?.headers);r&&!a.has(`x-client-request-id`)&&a.set(Nr,wt());try{let n=e instanceof Request?e.url:String(e),r=a.get(Nr);_(`[API REQUEST] ${new URL(n).pathname}${r?` ${Nr}=${r}`:``} source=${t??`unknown`}`)}catch{}return n(e,{...i,headers:a})}}var Nr,Pr=e((()=>{Ne(),G(),Dr(),rc(),A(),gt(),m(),v(),c(),Nr=`x-client-request-id`}));function Fr(){return vt(o(),`cache`)}function Ir(){return vt(Fr(),`model-capabilities.json`)}function Lr(){return!(k()!==`firstParty`||!Mt())}function Rr(e){return[...e].sort((e,t)=>t.id.length-e.id.length||e.id.localeCompare(t.id))}function zr(e){if(!Lr())return;let t=Ur(Ir());if(!t||t.length===0)return;let n=e.toLowerCase();return t.find(e=>e.id.toLowerCase()===n)||t.find(e=>n.includes(e.id.toLowerCase()))}async function Br(){if(Lr()&&!$e())try{let e=await kr({maxRetries:1}),t=R()?[ct]:void 0,n=[];for await(let r of e.models.list({betas:t})){let e=Vr().safeParse(r);e.success&&n.push(e.data)}if(n.length===0)return;let r=Ir(),i=Rr(n);if(xr(Ur(r),i)){_(`[modelCapabilities] cache unchanged, skipping write`);return}await Tt(Fr(),{recursive:!0}),await Dt(r,De({models:i,timestamp:Date.now()}),{encoding:`utf-8`,mode:384}),Ur.cache.delete(r),_(`[modelCapabilities] cached ${i.length} models`)}catch(e){_(`[modelCapabilities] fetch failed: ${e instanceof Error?e.message:`unknown`}`)}}var Vr,Hr,Ur,Wr=e((()=>{Sr(),i(),le(),O(),Pr(),G(),v(),c(),rt(),ue(),Qe(),Re(),A(),Vr=ce(()=>se({id:ie(),max_input_tokens:ae().optional(),max_tokens:ae().optional()}).strip()),Hr=ce(()=>se({models:oe(Vr()),timestamp:ae()})),Ur=r(e=>{try{let t=xt(e,`utf-8`),n=Hr().safeParse(it(t,!1));return n.success?n.data.models:null}catch{return null}},e=>e)}));function Gr(){return s(process.env.CLAUDE_CODE_DISABLE_1M_CONTEXT)}function F(e){return!Gr()&&/\[1m\]/i.test(e)}function Kr(e){if(Gr())return!1;let t=Q(e);return t.includes(`claude-sonnet-4`)||t.includes(`opus-4-6`)||t.includes(`opus-4-7`)}function qr(e,t){if(F(e))return 1e6;let n=zr(e);return n?.max_input_tokens&&n.max_input_tokens>=1e5?n.max_input_tokens>2e5&&Gr()?Qr:n.max_input_tokens:t?.includes(`context-1m-2025-08-07`)&&Kr(e)||Jr(e)?1e6:Qr}function Jr(e){return Gr()||F(e)||!Q(e).includes(`sonnet-4-6`)?!1:S().clientDataCache?.coral_reef_sonnet===`true`}function Yr(e,t){if(!e)return{used:null,remaining:null};let n=e.input_tokens+e.cache_creation_input_tokens+e.cache_read_input_tokens;if(n===0)return{used:null,remaining:null};let r=Math.round(n/t*100),i=Math.min(100,Math.max(0,r));return{used:i,remaining:100-i}}function Xr(e){let t,n,r=Q(e);r.includes(`opus-4-7`)||r.includes(`opus-4-6`)?(t=64e3,n=128e3):r.includes(`sonnet-4-6`)?(t=32e3,n=128e3):r.includes(`opus-4-5`)||r.includes(`sonnet-4`)||r.includes(`haiku-4`)?(t=32e3,n=64e3):r.includes(`opus-4-1`)||r.includes(`opus-4`)?(t=32e3,n=32e3):r.includes(`claude-3-opus`)?(t=4096,n=4096):r.includes(`claude-3-sonnet`)?(t=8192,n=8192):r.includes(`claude-3-haiku`)?(t=4096,n=4096):r.includes(`3-5-sonnet`)||r.includes(`3-5-haiku`)?(t=8192,n=8192):r.includes(`3-7-sonnet`)?(t=32e3,n=64e3):(t=ei,n=ti);let i=zr(e);return i?.max_tokens&&i.max_tokens>=4096&&(n=i.max_tokens,t=Math.min(t,n)),{default:t,upperLimit:n}}function Zr(e){return Xr(e).upperLimit-1}var Qr,$r,ei,ti,ni,ri=e((()=>{br(),We(),c(),rc(),Wr(),Qr=2e5,$r=2e4,ei=32e3,ti=64e3,ni=8e3})),ii,ai,oi,si=e((()=>{i(),A(),ii=[{modelEnvVar:`ANTHROPIC_DEFAULT_OPUS_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`ANTHROPIC_DEFAULT_SONNET_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`ANTHROPIC_DEFAULT_HAIKU_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES`}],ai=[{modelEnvVar:`OPENAI_DEFAULT_OPUS_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`OPENAI_DEFAULT_SONNET_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`OPENAI_DEFAULT_HAIKU_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES`}],oi=r((e,t)=>{if(k()===`firstParty`)return;let n=e.toLowerCase(),r=k()===`openai`?ai:ii;for(let e of r){let r=process.env[e.modelEnvVar],i=process.env[e.capabilitiesEnvVar];if(!(!r||i===void 0)&&n===r.toLowerCase())return i.toLowerCase().split(`,`).map(e=>e.trim()).includes(t)}},(e,t)=>`${e.toLowerCase()}:${t}`)}));function ci(e){let t=[],n=[];for(let r of e)vi.includes(r)?t.push(r):n.push(r);return{allowed:t,disallowed:n}}function li(e){if(!e||e.length===0)return;if(R()){console.warn(`Warning: Custom betas are only available for API key users. Ignoring provided betas.`);return}let{allowed:t,disallowed:n}=ci(e);for(let e of n)console.warn(`Warning: Beta header '${e}' is not allowed. Only the following betas are supported: ${vi.join(`, `)}`);return t.length>0?t:void 0}function ui(e){let t=oi(e,`interleaved_thinking`);if(t!==void 0)return t;let n=Q(e),r=k();return r===`foundry`?!0:r===`firstParty`?!n.includes(`claude-3-`):n.includes(`claude-opus-4`)||n.includes(`claude-sonnet-4`)}function di(e){let t=Q(e),n=k();return n===`foundry`?!0:n===`firstParty`?!t.includes(`claude-3-`):t.includes(`claude-opus-4`)||t.includes(`claude-sonnet-4`)||t.includes(`claude-haiku-4`)}function fi(e){let t=Q(e),n=k();return n!==`firstParty`&&n!==`foundry`?!1:t.includes(`claude-sonnet-4-6`)||t.includes(`claude-sonnet-4-5`)||t.includes(`claude-opus-4-1`)||t.includes(`claude-opus-4-5`)||t.includes(`claude-opus-4-6`)||t.includes(`claude-opus-4-7`)||t.includes(`claude-haiku-4-5`)}function pi(e){return!0}function mi(){return(k()===`firstParty`||k()===`foundry`)&&!s(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)&&Mt()}function hi(){return k()===`firstParty`&&!s(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)}function gi(e,t){let n=[...bi(e)];t?.isAgenticQuery&&(n.includes(`claude-code-20250219`)||n.push(sr));let r=ve();return!r||r.length===0?n:[...n,...r.filter(e=>!n.includes(e))]}function _i(){yi.cache?.clear?.(),bi.cache?.clear?.(),xi.cache?.clear?.()}var vi,yi,bi,xi,Si=e((()=>{i(),m(),br(),O(),G(),ri(),c(),rc(),si(),A(),x(),vi=[lr],yi=r(e=>{let t=[],n=Q(e).includes(`haiku`);k();let r=mi();n||t.push(sr),R()&&t.push(ct),F(e)&&t.push(lr),!s(process.env.DISABLE_INTERLEAVED_THINKING)&&ui(e)&&t.push(cr),r&&ui(e)&&!h()&&Be().showThinkingSummaries!==!0&&t.push(gr);let i=s(process.env.USE_API_CONTEXT_MANAGEMENT)||di(e),a=di(e);return mi()&&(i||a)&&t.push(ur),r&&fi(e),r&&t.push(mr),process.env.ANTHROPIC_BETAS&&t.push(...process.env.ANTHROPIC_BETAS.split(`,`).map(e=>e.trim()).filter(Boolean)),t}),bi=r(e=>{let t=yi(e);return k()===`bedrock`?t.filter(e=>!vr.has(e)):t}),xi=r(e=>yi(e).filter(e=>vr.has(e)))}));function Ci(e,t){return{name:`${e.name}-with-${t.name}-fallback`,read(){return e.read()??(t.read()||{})},async readAsync(){return await e.readAsync()??(await t.readAsync()||{})},update(n){let r=e.read(),i=e.update(n);if(i.success)return r===null&&t.delete(),i;let a=t.update(n);return a.success?(r!==null&&e.delete(),{success:!0,warning:a.warning}):{success:!1}},delete(){let n=e.delete(),r=t.delete();return n||r}}}var wi=e((()=>{}));async function Ti(){try{let e=M(Yn),{stdout:t,code:n}=await Ze(`security`,[`find-generic-password`,`-a`,qn(),`-w`,`-s`,e],{useCwd:!1,preserveOutputOnError:!1});if(n===0&&t)return je(t.trim())}catch{}return null}function Ei(){if(ki!==void 0)return ki;if(process.platform!==`darwin`)return ki=!1,!1;try{ki=Xe(`security`,[`show-keychain-info`],{reject:!1,stdio:[`ignore`,`pipe`,`pipe`]}).exitCode===36}catch{ki=!1}return ki}var Di,Oi,ki,Ai=e((()=>{Ke(),v(),Ye(),Ge(),Re(),Xn(),Di=4032,Oi={name:`keychain`,read(){let e=P.cache;if(Date.now()-e.cachedAt<3e4)return e.data;try{let e=M(Yn),t=qe(`security find-generic-password -a "${qn()}" -w -s "${e}"`);if(t){let e=je(t);return P.cache={data:e,cachedAt:Date.now()},e}}catch{}return e.data===null?(P.cache={data:null,cachedAt:Date.now()},null):(_(`[keychain] read failed; serving stale cache`,{level:`warn`}),P.cache={data:e.data,cachedAt:Date.now()},e.data)},async readAsync(){let e=P.cache;if(Date.now()-e.cachedAt<3e4)return e.data;if(P.readInFlight)return P.readInFlight;let t=P.generation,n=Ti().then(n=>{if(t===P.generation){n===null&&e.data!==null&&_(`[keychain] readAsync failed; serving stale cache`,{level:`warn`});let t=n??e.data;return P.cache={data:t,cachedAt:Date.now()},P.readInFlight=null,t}return n});return P.readInFlight=n,n},update(e){N();try{let t=M(Yn),n=qn(),r=De(e),i=Buffer.from(r,`utf-8`).toString(`hex`),a=`add-generic-password -U -a "${n}" -s "${t}" -X "${i}"\n`,o;return a.length<=Di?o=Xe(`security`,[`-i`],{input:a,stdio:[`pipe`,`pipe`,`pipe`],reject:!1}):(_(`Keychain payload (${r.length}B JSON) exceeds security -i stdin limit; using argv`,{level:`warn`}),o=Xe(`security`,[`add-generic-password`,`-U`,`-a`,n,`-s`,t,`-X`,i],{stdio:[`ignore`,`pipe`,`pipe`],reject:!1})),o.exitCode===0?(P.cache={data:e,cachedAt:Date.now()},{success:!0}):{success:!1}}catch{return{success:!1}}},delete(){N();try{let e=M(Yn);return qe(`security delete-generic-password -a "${qn()}" -s "${e}"`),!0}catch{return!1}}}}));function ji(){let e=o();return{storageDir:e,storagePath:vt(e,`.credentials.json`)}}var Mi,Ni=e((()=>{c(),Ae(),Pe(),Re(),Mi={name:`plaintext`,read(){let{storagePath:e}=ji();try{return je(Le().readFileSync(e,{encoding:`utf8`}))}catch{return null}},async readAsync(){let{storagePath:e}=ji();try{return je(await Le().readFile(e,{encoding:`utf8`}))}catch{return null}},update(e){try{let{storageDir:t,storagePath:n}=ji();try{Le().mkdirSync(t)}catch(e){if(Oe(e)!==`EEXIST`)throw e}return Me(n,De(e),{encoding:`utf8`,flush:!1}),yt(n,384),{success:!0,warning:`Warning: Storing credentials in plaintext.`}}catch{return{success:!1}}},delete(){let{storagePath:e}=ji();try{return Le().unlinkSync(e),!0}catch(e){return Oe(e)===`ENOENT`}}}}));function Pi(){return process.platform===`darwin`?Ci(Oi,Mi):Mi}var Fi=e((()=>{wi(),Ai(),Ni()}));function Ii(e){return new Promise(t=>{kt(`security`,[`find-generic-password`,`-a`,qn(),`-w`,`-s`,e],{encoding:`utf-8`,timeout:Vi},(e,n)=>{t({stdout:e?null:n?.trim()||null,timedOut:!!(e&&`killed`in e&&e.killed)})})})}function Li(){if(process.platform!==`darwin`||Ui||l())return;let e=Ii(M(Yn)),t=Ii(M());Ui=Promise.all([e,t]).then(([e,t])=>{e.timedOut||Jn(e.stdout),t.timedOut||(Hi={stdout:t.stdout})})}async function Ri(){Ui&&await Ui}function zi(){return Hi}function Bi(){Hi=null}var Vi,Hi,Ui,Wi=e((()=>{c(),Xn(),Vi=1e4,Hi=null,Ui=null}));function Gi(e,t,n){return new Promise((r,i)=>{if(t?.aborted){n?.throwOnAbort||n?.abortError?i(n.abortError?.()??Error(`aborted`)):r();return}let a=setTimeout((e,t,n)=>{e?.removeEventListener(`abort`,t),n()},e,t,o,r);function o(){clearTimeout(a),n?.throwOnAbort||n?.abortError?i(n.abortError?.()??Error(`aborted`)):r()}t?.addEventListener(`abort`,o,{once:!0}),n?.unref&&a.unref()})}var Ki=e((()=>{}));function qi(){return Yi}function Ji(){Yi.clear()}var Yi,Xi=e((()=>{Yi=new Map})),Zi=n({calculateApiKeyHelperTTL:()=>ca,checkAndRefreshOAuthTokenIfNeeded:()=>za,checkGcpCredentialsValid:()=>Sa,clearApiKeyHelperCache:()=>ma,clearAwsCredentialsCache:()=>ya,clearGcpCredentialsCache:()=>Ta,clearOAuthTokenCache:()=>Pa,getAccountInformation:()=>ao,getAnthropicApiKey:()=>ea,getAnthropicApiKeyWithSource:()=>na,getApiKeyFromApiKeyHelper:()=>ua,getApiKeyFromApiKeyHelperCached:()=>pa,getApiKeyFromConfigOrMacOSKeychain:()=>ho,getApiKeyHelperElapsedMs:()=>la,getAuthTokenSource:()=>$i,getClaudeAIOAuthTokens:()=>W,getClaudeAIOAuthTokensAsync:()=>Ra,getConfiguredApiKeyHelper:()=>L,getOauthAccountInfo:()=>Ua,getOtelHeadersFromHelper:()=>no,getRateLimitTier:()=>Za,getSubscriptionName:()=>Qa,getSubscriptionType:()=>z,handleOAuth401Error:()=>Ia,hasAnthropicApiKeyAuth:()=>ta,hasOpusAccess:()=>Ga,hasProfileScope:()=>Va,is1PApiCustomer:()=>Ha,isAnthropicAuthEnabled:()=>I,isAwsAuthRefreshFromProjectSettings:()=>aa,isAwsCredentialExportFromProjectSettings:()=>sa,isClaudeAISubscriber:()=>R,isConsumerSubscriber:()=>io,isCustomApiKeyApproved:()=>Aa,isEnterpriseSubscriber:()=>Ya,isGcpAuthRefreshFromProjectSettings:()=>xa,isMaxSubscriber:()=>Ka,isOtelHeadersHelperFromProjectOrLocalSettings:()=>to,isOverageProvisioningAllowed:()=>Wa,isProSubscriber:()=>Xa,isTeamPremiumSubscriber:()=>Ja,isTeamSubscriber:()=>qa,isUsing3PServices:()=>$a,prefetchApiKeyFromApiKeyHelperIfSafe:()=>ha,prefetchAwsCredentialsAndBedRockInfoIfSafe:()=>Da,prefetchGcpCredentialsIfSafe:()=>Ea,refreshAndGetAwsCredentials:()=>U,refreshAwsAuth:()=>_a,refreshGcpAuth:()=>wa,refreshGcpCredentialsIfNeeded:()=>mo,removeApiKey:()=>ja,saveApiKey:()=>ka,saveOAuthTokensIfNeeded:()=>Na,validateForceLoginOrg:()=>oo});function Qi(){return s(process.env.CLAUDE_CODE_REMOTE)||process.env.CLAUDE_CODE_ENTRYPOINT===`claude-desktop`}function I(){if(l())return!1;if(process.env.ANTHROPIC_UNIX_SOCKET)return!!process.env.CLAUDE_CODE_OAUTH_TOKEN;let e=b()||{},t=s(process.env.CLAUDE_CODE_USE_BEDROCK)||s(process.env.CLAUDE_CODE_USE_VERTEX)||s(process.env.CLAUDE_CODE_USE_FOUNDRY)||e.modelType===`openai`||e.modelType===`gemini`||!!process.env.OPENAI_BASE_URL||!!process.env.GEMINI_BASE_URL,n=e.apiKeyHelper,r=process.env.ANTHROPIC_AUTH_TOKEN||n||process.env.CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR,{source:i}=na({skipRetrievingKeyFromApiKeyHelper:!0}),a=i===`ANTHROPIC_API_KEY`||i===`apiKeyHelper`;return!(t||r&&!Qi()||a&&!Qi())}function $i(){if(l())return L()?{source:`apiKeyHelper`,hasToken:!0}:{source:`none`,hasToken:!1};if(process.env.ANTHROPIC_AUTH_TOKEN&&!Qi())return{source:`ANTHROPIC_AUTH_TOKEN`,hasToken:!0};if(process.env.CLAUDE_CODE_OAUTH_TOKEN)return{source:`CLAUDE_CODE_OAUTH_TOKEN`,hasToken:!0};if(Bn())return process.env.CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR?{source:`CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR`,hasToken:!0}:{source:`CCR_OAUTH_TOKEN_FILE`,hasToken:!0};if(L()&&!Qi())return{source:`apiKeyHelper`,hasToken:!0};let e=W();return wn(e?.scopes)&&e?.accessToken?{source:`claude.ai`,hasToken:!0}:{source:`none`,hasToken:!1}}function ea(){let{key:e}=na();return e}function ta(){let{key:e,source:t}=na({skipRetrievingKeyFromApiKeyHelper:!0});return e!==null&&t!==`none`}function na(e={}){if(l())return process.env.ANTHROPIC_API_KEY?{key:process.env.ANTHROPIC_API_KEY,source:`ANTHROPIC_API_KEY`}:L()?{key:e.skipRetrievingKeyFromApiKeyHelper?null:pa(),source:`apiKeyHelper`}:{key:null,source:`none`};let t=a()?void 0:process.env.ANTHROPIC_API_KEY;if(_e()&&t)return{key:t,source:`ANTHROPIC_API_KEY`};if(s(process.env.CI)){let e=Vn();if(e)return{key:e,source:`ANTHROPIC_API_KEY`};if(!t&&!process.env.CLAUDE_CODE_OAUTH_TOKEN&&!process.env.CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR)throw Error(`ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN env var is required`);return t?{key:t,source:`ANTHROPIC_API_KEY`}:{key:null,source:`none`}}if(t&&S().customApiKeyResponses?.approved?.includes(Qn(t)))return{key:t,source:`ANTHROPIC_API_KEY`};let n=Vn();return n?{key:n,source:`ANTHROPIC_API_KEY`}:L()?e.skipRetrievingKeyFromApiKeyHelper?{key:null,source:`apiKeyHelper`}:{key:pa(),source:`apiKeyHelper`}:ho()||{key:null,source:`none`}}function L(){return l()?y(`flagSettings`)?.apiKeyHelper:(b()||{}).apiKeyHelper}function ra(){let e=L();if(!e)return!1;let t=y(`projectSettings`),n=y(`localSettings`);return t?.apiKeyHelper===e||n?.apiKeyHelper===e}function ia(){return(b()||{}).awsAuthRefresh}function aa(){let e=ia();if(!e)return!1;let t=y(`projectSettings`),n=y(`localSettings`);return t?.awsAuthRefresh===e||n?.awsAuthRefresh===e}function oa(){return(b()||{}).awsCredentialExport}function sa(){let e=oa();if(!e)return!1;let t=y(`projectSettings`),n=y(`localSettings`);return t?.awsCredentialExport===e||n?.awsCredentialExport===e}function ca(){let e=process.env.CLAUDE_CODE_API_KEY_HELPER_TTL_MS;if(e){let t=parseInt(e,10);if(!Number.isNaN(t)&&t>=0)return t;_(`Found CLAUDE_CODE_API_KEY_HELPER_TTL_MS env var, but it was not a valid number. Got ${e}`,{level:`error`})}return so}function la(){let e=V?.startedAt;return e?Date.now()-e:0}async function ua(e){if(!L())return null;let t=ca();return B?(Date.now()-B.timestamp<t||V||(V={promise:da(e,!1,H),startedAt:null}),B.value):(V||(V={promise:da(e,!0,H),startedAt:Date.now()}),V.promise)}async function da(e,t,n){try{let t=await fa(e);return n===H&&t!==null&&(B={value:t,timestamp:Date.now()}),t}catch(e){if(n!==H)return` `;let r=e instanceof Error?e.message:String(e);return console.error(ne.red(`apiKeyHelper failed: ${r}`)),_(`Error getting API key from apiKeyHelper: ${r}`,{level:`error`}),!t&&B&&B.value!==` `?(B={...B,timestamp:Date.now()},B.value):(B={value:` `,timestamp:Date.now()},` `)}finally{n===H&&(V=null)}}async function fa(e){let t=L();if(!t)return null;if(ra()&&!C()&&!e)return Ie(`apiKeyHelper invoked before trust check`,Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in .`)),E(`tengu_apiKeyHelper_missing_trust11`,{}),null;let n=await Je(t,{shell:!0,timeout:600*1e3,reject:!1});if(n.failed){let e=n.timedOut?`timed out`:`exited ${n.exitCode}`,t=n.stderr?.trim();throw Error(t?`${e}: ${t}`:e)}let r=n.stdout?.trim();if(!r)throw Error(`did not return a value`);return r}function pa(){return B?.value??null}function ma(){H++,B=null,V=null}function ha(e){ra()&&!C()||ua(e)}async function ga(){let e=ia();if(!e)return!1;if(aa()&&!C()&&!h())return Ie(`awsAuthRefresh invoked before trust check`,Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in .`)),E(`tengu_awsAuthRefresh_missing_trust`,{}),!1;try{return _(`Fetching AWS caller identity for AWS auth refresh command`),await nr(),_(`Fetched AWS caller identity, skipping AWS auth refresh command`),!1}catch{return _a(e)}}function _a(e){_(`Running AWS auth refresh command`);let t=ar.getInstance();return t.startAuthentication(),new Promise(n=>{let r=Ot(e,{timeout:lo});r.stdout.on(`data`,e=>{let n=e.toString().trim();n&&(t.addOutput(n),_(n,{level:`debug`}))}),r.stderr.on(`data`,e=>{let n=e.toString().trim();n&&(t.setError(n),_(n,{level:`error`}))}),r.on(`close`,(e,r)=>{if(e===0)_(`AWS auth refresh completed successfully`),t.endAuthentication(!0),n(!0);else{let e=r===`SIGTERM`?ne.red(`AWS auth refresh timed out after 3 minutes. Run your auth command manually in a separate terminal.`):ne.red(`Error running awsAuthRefresh (in settings or ~/.workmate.json):`);console.error(e),t.endAuthentication(!1),n(!1)}})})}async function va(){let e=oa();if(!e)return null;if(sa()&&!C()&&!h())return Ie(`awsCredentialExport invoked before trust check`,Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in .`)),E(`tengu_awsCredentialExport_missing_trust`,{}),null;try{return _(`Fetching AWS caller identity for credential export command`),await nr(),_(`Fetched AWS caller identity, skipping AWS credential export command`),null}catch{try{_(`Running AWS credential export command`);let t=await Je(e,{shell:!0,reject:!1});if(t.exitCode!==0||!t.stdout)throw Error(`awsCredentialExport did not return a valid value`);let n=je(t.stdout.trim());if(!tr(n))throw Error(`awsCredentialExport did not return valid AWS STS output structure`);return _(`AWS credentials retrieved from awsCredentialExport`),{accessKeyId:n.Credentials.AccessKeyId,secretAccessKey:n.Credentials.SecretAccessKey,sessionToken:n.Credentials.SessionToken}}catch(e){let t=ne.red(`Error getting AWS credentials from awsCredentialExport (in settings or ~/.workmate.json):`);return e instanceof Error?console.error(t,e.message):console.error(t,e),null}}}function ya(){U.cache.clear()}function ba(){return(b()||{}).gcpAuthRefresh}function xa(){let e=ba();if(!e)return!1;let t=y(`projectSettings`),n=y(`localSettings`);return t?.gcpAuthRefresh===e||n?.gcpAuthRefresh===e}async function Sa(){try{let{GoogleAuth:e}=await import(`./src-CiJCsqUl.js`).then(e=>t(e.default,1)),n=new e({scopes:[`https://www.googleapis.com/auth/cloud-platform`]}),r=(async()=>{await(await n.getClient()).getAccessToken()})(),i=Gi(uo).then(()=>{throw new So(`GCP credentials check timed out`)});return await Promise.race([r,i]),!0}catch{return!1}}async function Ca(){let e=ba();if(!e)return!1;if(xa()&&!C()&&!h())return Ie(`gcpAuthRefresh invoked before trust check`,Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in .`)),E(`tengu_gcpAuthRefresh_missing_trust`,{}),!1;try{if(_(`Checking GCP credentials validity for auth refresh`),await Sa())return _(`GCP credentials are valid, skipping auth refresh command`),!1}catch{}return wa(e)}function wa(e){_(`Running GCP auth refresh command`);let t=ar.getInstance();return t.startAuthentication(),new Promise(n=>{let r=Ot(e,{timeout:po});r.stdout.on(`data`,e=>{let n=e.toString().trim();n&&(t.addOutput(n),_(n,{level:`debug`}))}),r.stderr.on(`data`,e=>{let n=e.toString().trim();n&&(t.setError(n),_(n,{level:`error`}))}),r.on(`close`,(e,r)=>{if(e===0)_(`GCP auth refresh completed successfully`),t.endAuthentication(!0),n(!0);else{let e=r===`SIGTERM`?ne.red(`GCP auth refresh timed out after 3 minutes. Run your auth command manually in a separate terminal.`):ne.red(`Error running gcpAuthRefresh (in settings or ~/.workmate.json):`);console.error(e),t.endAuthentication(!1),n(!1)}})})}function Ta(){mo.cache.clear()}function Ea(){ba()&&(xa()&&!C()&&!h()||mo())}function Da(){let e=ia(),t=oa();!e&&!t||(aa()||sa())&&!C()&&!h()||(U(),j())}function Oa(e){return/^[a-zA-Z0-9-_]+$/.test(e)}async function ka(e){if(!Oa(e))throw Error(`Invalid API key format. API key must contain only alphanumeric characters, dashes, and underscores.`);await Ma();let t=!1;if(process.platform===`darwin`)try{let n=M();await Je(`security`,[`-i`],{input:`add-generic-password -U -a "${qn()}" -s "${n}" -X "${Buffer.from(e,`utf-8`).toString(`hex`)}"\n`,reject:!1}),E(`tengu_api_key_saved_to_keychain`,{}),t=!0}catch(e){T(e),E(`tengu_api_key_keychain_error`,{error:g(e)}),E(`tengu_api_key_saved_to_config`,{})}else E(`tengu_api_key_saved_to_config`,{});let n=Qn(e);w(r=>{let i=r.customApiKeyResponses?.approved??[];return{...r,primaryApiKey:t?r.primaryApiKey:e,customApiKeyResponses:{...r.customApiKeyResponses,approved:i.includes(n)?i:[...i,n],rejected:r.customApiKeyResponses?.rejected??[]}}}),ho.cache.clear?.(),Bi()}function Aa(e){let t=S(),n=Qn(e);return t.customApiKeyResponses?.approved?.includes(n)??!1}async function ja(){await Ma(),w(e=>({...e,primaryApiKey:void 0})),ho.cache.clear?.(),Bi()}async function Ma(){try{await Zn()}catch(e){T(e)}}function Na(e){if(!wn(e.scopes))return E(`tengu_oauth_tokens_not_claude_ai`,{}),{success:!0};if(!e.refreshToken||!e.expiresAt)return E(`tengu_oauth_tokens_inference_only`,{}),{success:!0};let t=Pi(),n=t.name;try{let r=t.read()||{},i=r.claudeAiOauth;r.claudeAiOauth={accessToken:e.accessToken,refreshToken:e.refreshToken,expiresAt:e.expiresAt,scopes:e.scopes,subscriptionType:e.subscriptionType??i?.subscriptionType??null,rateLimitTier:e.rateLimitTier??i?.rateLimitTier??null};let a=t.update(r);return a.success?E(`tengu_oauth_tokens_saved`,{storageBackend:n}):E(`tengu_oauth_tokens_save_failed`,{storageBackend:n}),W.cache?.clear?.(),_i(),Ji(),a}catch(e){return T(e),E(`tengu_oauth_tokens_save_exception`,{storageBackend:n,error:g(e)}),{success:!1,warning:`Failed to save OAuth tokens`}}}function Pa(){W.cache?.clear?.(),N()}async function Fa(){try{let{mtimeMs:e}=await Et(vt(o(),`.credentials.json`));e!==go&&(go=e,Pa())}catch{W.cache?.clear?.()}}function Ia(e){let t=_o.get(e);if(t)return t;let n=La(e).finally(()=>{_o.delete(e)});return _o.set(e,n),n}async function La(e){Pa();let t=await Ra();return t?.refreshToken?t.accessToken===e?za(0,!0):(E(`tengu_oauth_401_recovered_from_keychain`,{}),!0):!1}async function Ra(){if(l())return null;if(process.env.CLAUDE_CODE_OAUTH_TOKEN||Bn())return W();try{let e=(await Pi().readAsync())?.claudeAiOauth;return e?.accessToken?e:null}catch(e){return T(e),null}}function za(e=0,t=!1){return e===0&&!t?vo||(vo=Ba(e,t).finally(()=>{vo=null}),vo):Ba(e,t)}async function Ba(e,t){await Fa();let n=W();if(!t&&(!n?.refreshToken||!jn(n.expiresAt))||!n?.refreshToken||!wn(n.scopes))return!1;W.cache?.clear?.(),N();let r=await Ra();if(!r?.refreshToken||!jn(r.expiresAt))return!1;let i=o();await Tt(i,{recursive:!0});let a;try{E(`tengu_oauth_token_refresh_lock_acquiring`,{}),a=await He(i),E(`tengu_oauth_token_refresh_lock_acquired`,{})}catch(n){return n.code===`ELOCKED`?e<5?(E(`tengu_oauth_token_refresh_lock_retry`,{retryCount:e+1}),await Gi(1e3+Math.random()*1e3),Ba(e+1,t)):(E(`tengu_oauth_token_refresh_lock_retry_limit_reached`,{maxRetries:5}),!1):(T(n),E(`tengu_oauth_token_refresh_lock_error`,{error:g(n)}),!1)}try{W.cache?.clear?.(),N();let e=await Ra();return!e?.refreshToken||!jn(e.expiresAt)?(E(`tengu_oauth_token_refresh_race_resolved`,{}),!1):(E(`tengu_oauth_token_refresh_starting`,{}),Na(await On(e.refreshToken,{scopes:wn(e.scopes)?void 0:e.scopes})),W.cache?.clear?.(),N(),!0)}catch(e){T(e),W.cache?.clear?.(),N();let t=await Ra();return t&&!jn(t.expiresAt)?(E(`tengu_oauth_token_refresh_race_recovered`,{}),!0):!1}finally{E(`tengu_oauth_token_refresh_lock_releasing`,{}),await a(),E(`tengu_oauth_token_refresh_lock_released`,{})}}function R(){return I()?wn(W()?.scopes):!1}function Va(){return W()?.scopes?.includes(`user:profile`)??!1}function Ha(){return!(s(process.env.CLAUDE_CODE_USE_BEDROCK)||s(process.env.CLAUDE_CODE_USE_VERTEX)||s(process.env.CLAUDE_CODE_USE_FOUNDRY)||R())}function Ua(){return I()?S().oauthAccount:void 0}function Wa(){let e=Ua()?.billingType;return!(!R()||!e||e!==`stripe_subscription`&&e!==`stripe_subscription_contracted`&&e!==`apple_subscription`&&e!==`google_play_subscription`)}function Ga(){let e=z();return e===`max`||e===`enterprise`||e===`team`||e===`pro`||e===null}function z(){if(!I())return null;let e=W();return e?e.subscriptionType??null:null}function Ka(){return z()===`max`}function qa(){return z()===`team`}function Ja(){return z()===`team`&&Za()===`default_claude_max_5x`}function Ya(){return z()===`enterprise`}function Xa(){return z()===`pro`}function Za(){if(!I())return null;let e=W();return e?e.rateLimitTier??null:null}function Qa(){switch(z()){case`enterprise`:return`Work Mate Enterprise`;case`team`:return`Work Mate Team`;case`max`:return`Claude Max`;case`pro`:return`Claude Pro`;default:return`Work Mate API`}}function $a(){return!!(s(process.env.CLAUDE_CODE_USE_BEDROCK)||s(process.env.CLAUDE_CODE_USE_VERTEX)||s(process.env.CLAUDE_CODE_USE_FOUNDRY)||s(process.env.CLAUDE_CODE_USE_OPENAI)||s(process.env.CLAUDE_CODE_USE_GEMINI)||s(process.env.CLAUDE_CODE_USE_GROK))}function eo(){return(b()||{}).otelHeadersHelper}function to(){let e=eo();if(!e)return!1;let t=y(`projectSettings`),n=y(`localSettings`);return t?.otelHeadersHelper===e||n?.otelHeadersHelper===e}function no(){let e=eo();if(!e)return{};let t=parseInt(process.env.CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS||xo.toString(),10);if(yo&&Date.now()-bo<t)return yo;if(to()&&!C())return{};try{let t=qe(e,{timeout:3e4})?.toString().trim();if(!t)throw Error(`otelHeadersHelper did not return a valid value`);let n=je(t);if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`otelHeadersHelper must return a JSON object with string key-value pairs`);for(let[e,t]of Object.entries(n))if(typeof t!=`string`)throw Error(`otelHeadersHelper returned non-string value for key "${e}": ${typeof t}`);return yo=n,bo=Date.now(),yo}catch(e){throw T(Error(`Error getting OpenTelemetry headers from otelHeadersHelper (in settings): ${g(e)}`)),e}}function ro(e){return e===`max`||e===`pro`}function io(){let e=z();return R()&&e!==null&&ro(e)}function ao(){if(k()!==`firstParty`)return;let{source:e}=$i(),t={};e===`CLAUDE_CODE_OAUTH_TOKEN`||e===`CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR`?t.tokenSource=e:R()?t.subscription=Qa():t.tokenSource=e;let{key:n,source:r}=na();if(n&&(t.apiKeySource=r),e===`claude.ai`||r===`/login managed key`){let e=Ua()?.organizationName;e&&(t.organization=e)}let i=Ua()?.emailAddress;return(e===`claude.ai`||r===`/login managed key`)&&i&&(t.email=i),t}async function oo(){if(process.env.ANTHROPIC_UNIX_SOCKET||!I())return{valid:!0};let e=y(`policySettings`)?.forceLoginOrgUUID;if(!e)return{valid:!0};await za();let t=W();if(!t)return{valid:!0};let{source:n}=$i(),r=n===`CLAUDE_CODE_OAUTH_TOKEN`||n===`CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR`,i=await Sn(t.accessToken);if(!i)return{valid:!1,message:`Unable to verify organization for the current authentication token.\nThis machine requires organization ${e} but the profile could not be fetched.\nThis may be a network error, or the token may lack the user:profile scope required for\nverification.\nTry again, or obtain a full-scope token.`};let a=i.organization.uuid;return a===e?{valid:!0}:r?{valid:!1,message:`The ${n===`CLAUDE_CODE_OAUTH_TOKEN`?`CLAUDE_CODE_OAUTH_TOKEN`:`CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR`} environment variable provides a token for a\ndifferent organization than required by this machine's managed settings.\n\nRequired organization: ${e}\nToken organization: ${a}\n\nRemove the environment variable or obtain a token for the correct organization.`}:{valid:!1,message:`Your authentication token belongs to organization ${a},\nbut this machine requires organization ${e}.\n\nAuthentication token belongs to the wrong organization.`}}var so,B,V,H,co,lo,U,uo,fo,po,mo,ho,W,go,_o,vo,yo,bo,xo,So,G=e((()=>{re(),Ke(),i(),O(),at(),bn(),A(),m(),In(),Cn(),Kn(),$n(),ir(),or(),Si(),We(),v(),c(),Ae(),Ye(),Ue(),et(),nt(),Fi(),Wi(),Xn(),x(),Ki(),Re(),Xi(),so=300*1e3,B=null,V=null,H=0,co=3600*1e3,lo=180*1e3,U=tt(async()=>{let e=await ga(),t=await va();return(e||t)&&await rr(),t},co),uo=5e3,fo=3600*1e3,po=180*1e3,mo=tt(async()=>await Ca(),fo),ho=r(()=>{if(l())return null;if(process.platform===`darwin`){let e=zi();if(e){if(e.stdout)return{key:e.stdout,source:`/login managed key`}}else{let e=M();try{let t=qe(`security find-generic-password -a $USER -w -s "${e}"`);if(t)return{key:t,source:`/login managed key`}}catch(e){T(e)}}}let e=S();return e.primaryApiKey?{key:e.primaryApiKey,source:`/login managed key`}:null}),W=r(()=>{if(l())return null;if(process.env.CLAUDE_CODE_OAUTH_TOKEN)return{accessToken:process.env.CLAUDE_CODE_OAUTH_TOKEN,refreshToken:null,expiresAt:null,scopes:[`user:inference`],subscriptionType:null,rateLimitTier:null};let e=Bn();if(e)return{accessToken:e,refreshToken:null,expiresAt:null,scopes:[`user:inference`],subscriptionType:null,rateLimitTier:null};try{let e=Pi().read()?.claudeAiOauth;return e?.accessToken?e:null}catch(e){return T(e),null}}),go=0,_o=new Map,vo=null,yo=null,bo=0,xo=1740*1e3,So=class extends Error{}}));function K(){return!s(process.env.CLAUDE_CODE_DISABLE_FAST_MODE)}function Co(){return K()?To()===null:!1}function wo(e,t){switch(e){case`free`:return t===`oauth`?`Fast mode requires a paid subscription`:`Fast mode unavailable during evaluation. Please purchase credits.`;case`preference`:return`Fast mode has been disabled by your organization`;case`extra_usage_disabled`:return`Fast mode requires extra usage billing · enable it at claude.ai/settings/usage`;case`network_error`:return`Fast mode unavailable due to network connectivity issues`;case`unknown`:return`Fast mode is currently unavailable`}}function To(){if(!K())return`Fast mode is not available`;if(ut(),h()&&_e()&&!y(`flagSettings`)?.fastMode){let e=`Fast mode is not available in the Agent SDK`;return _(`Fast mode unavailable: ${e}`),e}if(k()!==`firstParty`){let e=`Fast mode is not available on Bedrock, Vertex, or Foundry`;return _(`Fast mode unavailable: ${e}`),e}if(J.status===`disabled`){if((J.reason===`network_error`||J.reason===`unknown`)&&s(process.env.CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS))return null;let e=W()===null?`api-key`:`oauth`,t=wo(J.reason,e);return _(`Fast mode unavailable: ${t}`),t}return null}function Eo(){return`opus${Ks()?`[1m]`:``}`}function Do(e){if(!K()||!Co()||!Oo(e))return!1;let t=Be();return!t.fastModePerSessionOptIn&&t.fastMode===!0}function Oo(e){if(!K())return!1;let t=$(e??Vs());return t.toLowerCase().includes(`opus-4-7`)||t.toLowerCase().includes(`opus-4-6`)}function ko(){return q.status===`cooldown`&&Date.now()>=q.resetAt&&(K()&&!Ho&&(_(`Fast mode cooldown expired, re-enabling fast mode`),Ho=!0,Wo.emit()),q={status:`active`}),q}function Ao(e,t){if(!K())return;q={status:`cooldown`,resetAt:e,reason:t},Ho=!1;let n=e-Date.now();_(`Fast mode cooldown triggered (${t}), duration ${Math.round(n/1e3)}s`),E(`tengu_fast_mode_fallback_triggered`,{cooldown_duration_ms:n,cooldown_reason:t}),Uo.emit(e,t)}function jo(){q={status:`active`}}function Mo(){J.status!==`disabled`&&(J={status:`disabled`,reason:`preference`},Ve(`userSettings`,{fastMode:void 0}),w(e=>({...e,penguinModeOrgEnabled:!1})),Yo.emit(!1))}function No(e){switch(e){case`out_of_credits`:return`Fast mode disabled · extra usage credits exhausted`;case`org_level_disabled`:case`org_service_level_disabled`:return`Fast mode disabled · extra usage disabled by your organization`;case`org_level_disabled_until`:return`Fast mode disabled · extra usage spending cap reached`;case`member_level_disabled`:return`Fast mode disabled · extra usage disabled for your account`;case`seat_tier_level_disabled`:case`seat_tier_zero_credit_limit`:case`member_zero_credit_limit`:return`Fast mode disabled · extra usage not available for your plan`;case`overage_not_provisioned`:case`no_limits_configured`:return`Fast mode requires extra usage billing · enable it at claude.ai/settings/usage`;default:return`Fast mode disabled · extra usage not available`}}function Po(e){return e===`org_level_disabled_until`||e===`out_of_credits`}function Fo(e){let t=No(e);_(`Fast mode overage rejection: ${e??`unknown`} — ${t}`),E(`tengu_fast_mode_overage_rejected`,{overage_disabled_reason:e??`unknown`}),Po(e)||(Ve(`userSettings`,{fastMode:void 0}),w(e=>({...e,penguinModeOrgEnabled:!1}))),qo.emit(t)}function Io(){return ko().status===`cooldown`}function Lo(e,t){let n=K()&&Co()&&!!t&&Oo(e);return n&&Io()?`cooldown`:n?`on`:`off`}async function Ro(e){let t=`${D().BASE_API_URL}/api/claude_code_penguin_mode`,n=`accessToken`in e?{Authorization:`Bearer ${e.accessToken}`,"anthropic-beta":ct}:{"x-api-key":e.apiKey};return(await f.get(t,{headers:n})).data}function zo(){K()&&J.status===`pending`&&(J=S().penguinModeOrgEnabled===!0?{status:`enabled`}:{status:`disabled`,reason:`unknown`})}async function Bo(){if($e()||!K())return;if($o)return _(`Fast mode prefetch in progress, returning in-flight promise`),$o;let e=ea();if(!(W()?.accessToken&&Va())&&!e){J=S().penguinModeOrgEnabled===!0?{status:`enabled`}:{status:`disabled`,reason:`preference`};return}let t=Date.now();if(t-Qo<Zo){_(`Skipping fast mode prefetch, fetched recently`);return}Qo=t;let n=async()=>{let t=W(),n=t?.accessToken&&Va()?{accessToken:t.accessToken}:e?{apiKey:e}:null;if(!n)throw Error(`No auth available`);return Ro(n)};async function r(){try{let e;try{e=await n()}catch(t){if(f.isAxiosError(t)&&(t.response?.status===401||t.response?.status===403&&typeof t.response?.data==`string`&&t.response.data.includes(`OAuth token has been revoked`))){let r=W()?.accessToken;if(r)await Ia(r),e=await n();else throw t}else throw t}let t=J.status===`pending`?S().penguinModeOrgEnabled:J.status===`enabled`;J=e.enabled?{status:`enabled`}:{status:`disabled`,reason:e.disabled_reason??`preference`},t!==e.enabled&&(e.enabled||Ve(`userSettings`,{fastMode:void 0}),w(t=>({...t,penguinModeOrgEnabled:e.enabled})),Yo.emit(e.enabled)),_(`Org fast mode: ${e.enabled?`enabled`:`disabled (${e.disabled_reason??`preference`})`}`)}catch(e){J=S().penguinModeOrgEnabled===!0?{status:`enabled`}:{status:`disabled`,reason:`network_error`},_(`Failed to fetch org fast mode status, defaulting to ${J.status===`enabled`?`enabled (cached)`:`disabled (network_error)`}: ${e}`,{level:`error`}),E(`tengu_org_penguin_mode_fetch_failed`,{})}finally{$o=null}}return $o=r(),$o}var Vo,q,Ho,Uo,Wo,Go,Ko,qo,Jo,J,Yo,Xo,Zo,Qo,$o,es=e((()=>{p(),O(),m(),at(),G(),dt(),We(),v(),c(),rc(),A(),Qe(),x(),Se(),Vo=`Opus 4.7`,q={status:`active`},Ho=!1,Uo=ye(),Wo=ye(),Go=Uo.subscribe,Ko=Wo.subscribe,qo=ye(),Jo=qo.subscribe,J={status:`pending`},Yo=ye(),Xo=Yo.subscribe,Zo=3e4,Qo=0,$o=null}));function ts(e){return K()&&e?ds:us}function ns(e,t){return t.input_tokens/1e6*e.inputTokens+t.output_tokens/1e6*e.outputTokens+(t.cache_read_input_tokens??0)/1e6*e.promptCacheReadTokens+(t.cache_creation_input_tokens??0)/1e6*e.promptCacheWriteTokens+(t.server_tool_use?.web_search_requests??0)*e.webSearchRequests}function rs(e,t){let n=Q(e);return n===Z(on.firstParty)?ts(t.speed===`fast`):hs[n]||(is(e,n),hs[Q(Vs())]??ms)}function is(e,t){E(`tengu_unknown_model_cost`,{model:e,shortName:t}),Ce()}function as(e,t){return ns(rs(e,t),t)}function os(e,t){return as(e,{input_tokens:t.inputTokens,output_tokens:t.outputTokens,cache_read_input_tokens:t.cacheReadInputTokens,cache_creation_input_tokens:t.cacheCreationInputTokens})}function ss(e){return Number.isInteger(e)?`$${e}`:`$${e.toFixed(2)}`}function cs(e){return`${ss(e.inputTokens)}/${ss(e.outputTokens)} per Mtok`}var Y,ls,us,ds,fs,ps,ms,hs,gs=e((()=>{at(),m(),es(),dn(),rc(),Y={inputTokens:3,outputTokens:15,promptCacheWriteTokens:3.75,promptCacheReadTokens:.3,webSearchRequests:.01},ls={inputTokens:15,outputTokens:75,promptCacheWriteTokens:18.75,promptCacheReadTokens:1.5,webSearchRequests:.01},us={inputTokens:5,outputTokens:25,promptCacheWriteTokens:6.25,promptCacheReadTokens:.5,webSearchRequests:.01},ds={inputTokens:30,outputTokens:150,promptCacheWriteTokens:37.5,promptCacheReadTokens:3,webSearchRequests:.01},fs={inputTokens:.8,outputTokens:4,promptCacheWriteTokens:1,promptCacheReadTokens:.08,webSearchRequests:.01},ps={inputTokens:1,outputTokens:5,promptCacheWriteTokens:1.25,promptCacheReadTokens:.1,webSearchRequests:.01},ms=us,hs={[Z(Qt.firstParty)]:fs,[Z($t.firstParty)]:ps,[Z(Zt.firstParty)]:Y,[Z(Xt.firstParty)]:Y,[Z(en.firstParty)]:Y,[Z(tn.firstParty)]:Y,[Z(cn.firstParty)]:Y,[Z(nn.firstParty)]:ls,[Z(rn.firstParty)]:ls,[Z(an.firstParty)]:us,[Z(on.firstParty)]:us}}));function X(e){return vs.includes(e)}function _s(e){return ys.includes(e)}var vs,ys,bs=e((()=>{vs=[`sonnet`,`opus`,`haiku`,`best`,`sonnet[1m]`,`opus[1m]`,`opusplan`],ys=[`sonnet`,`opus`,`haiku`]}));function xs(e,t){return e.includes(t)?!0:X(e)?$(e).toLowerCase().includes(t):!1}function Ss(e,t){return e.startsWith(t)?e.length===t.length||e[t.length]===`-`:!1}function Cs(e,t){let n=X(e)?$(e).toLowerCase():e;return!!(Ss(n,t)||!t.startsWith(`claude-`)&&Ss(n,`claude-${t}`))}function ws(e,t){for(let n of t){if(_s(n))continue;let t=n.indexOf(e);if(t===-1)continue;let r=t+e.length;if(r===n.length||n[r]===`-`)return!0}return!1}function Ts(e){let{availableModels:t}=b()||{};if(!t)return!0;if(t.length===0)return!1;let n=hn(e).trim().toLowerCase(),r=t.map(e=>e.trim().toLowerCase());if(r.includes(n)&&(!_s(n)||!ws(n,r)))return!0;for(let e of r)if(_s(e)&&!ws(e,r)&&xs(n,e))return!0;if(X(n)){let e=$(n).toLowerCase();if(r.includes(e))return!0}for(let e of r)if(!_s(e)&&X(e)&&$(e).toLowerCase()===n)return!0;for(let e of r)if(!_s(e)&&!X(e)&&Cs(n,e))return!0;return!1}var Es=e((()=>{x(),bs(),rc(),bn()}));function Ds(){return process.env.OPENAI_AUTH_MODE===`chatgpt`}var Os,ks,As=e((()=>{Os=`gpt-5.5`,ks=`gpt-5.4-mini`}));function js(){let e=k();return e===`openai`&&Ds()?process.env.OPENAI_SMALL_FAST_MODEL??`gpt-5.4-mini`:e===`openai`&&process.env.OPENAI_SMALL_FAST_MODEL?process.env.OPENAI_SMALL_FAST_MODEL:e===`gemini`&&process.env.GEMINI_SMALL_FAST_MODEL?process.env.GEMINI_SMALL_FAST_MODEL:process.env.ANTHROPIC_SMALL_FAST_MODEL||zs()}function Ms(e){return e===j().opus40||e===j().opus41||e===j().opus45||e===j().opus46||e===j().opus47}function Ns(){let e,t=me();if(t!==void 0)e=t;else{let t=b()||{};e=process.env.ANTHROPIC_MODEL||t.model||void 0}if(!(e&&!Ts(e)))return e}function Ps(){let e=Ns();return e==null?Hs():$(e)}function Fs(){return Ls()}function Is(){let e=k();if(e===`openai`)return process.env.OPENAI_MODEL;if(e===`gemini`)return process.env.GEMINI_MODEL;if(e===`grok`)return process.env.GROK_MODEL}function Ls(){let e=k();return e===`openai`&&Ds()?Os:e===`openai`&&process.env.OPENAI_DEFAULT_OPUS_MODEL?process.env.OPENAI_DEFAULT_OPUS_MODEL:e===`gemini`&&process.env.GEMINI_DEFAULT_OPUS_MODEL?process.env.GEMINI_DEFAULT_OPUS_MODEL:process.env.ANTHROPIC_DEFAULT_OPUS_MODEL?process.env.ANTHROPIC_DEFAULT_OPUS_MODEL:Is()||j().opus47}function Rs(){let e=k();return e===`openai`&&Ds()?Os:e===`openai`&&process.env.OPENAI_DEFAULT_SONNET_MODEL?process.env.OPENAI_DEFAULT_SONNET_MODEL:e===`gemini`&&process.env.GEMINI_DEFAULT_SONNET_MODEL?process.env.GEMINI_DEFAULT_SONNET_MODEL:process.env.ANTHROPIC_DEFAULT_SONNET_MODEL?process.env.ANTHROPIC_DEFAULT_SONNET_MODEL:Is()||(e===`firstParty`?j().sonnet46:j().sonnet45)}function zs(){let e=k();return e===`openai`&&Ds()?ks:e===`openai`&&process.env.OPENAI_DEFAULT_HAIKU_MODEL?process.env.OPENAI_DEFAULT_HAIKU_MODEL:e===`gemini`&&process.env.GEMINI_DEFAULT_HAIKU_MODEL?process.env.GEMINI_DEFAULT_HAIKU_MODEL:process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL?process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL:Is()||j().haiku45}function Bs(e){let{permissionMode:t,mainLoopModel:n,exceeds200kTokens:r=!1}=e;return Ns()===`opusplan`&&t===`plan`&&!r?Ls():Ns()===`haiku`&&t===`plan`?Rs():n}function Vs(){return Ka()||Ja()?Ls()+(Ks()?`[1m]`:``):Rs()}function Hs(){return $(Vs())}function Z(e){if(e=e.toLowerCase(),e.includes(`claude-opus-4-7`))return`claude-opus-4-7`;if(e.includes(`claude-opus-4-6`))return`claude-opus-4-6`;if(e.includes(`claude-opus-4-5`))return`claude-opus-4-5`;if(e.includes(`claude-opus-4-1`))return`claude-opus-4-1`;if(e.includes(`claude-opus-4`))return`claude-opus-4`;if(e.includes(`claude-sonnet-4-6`))return`claude-sonnet-4-6`;if(e.includes(`claude-sonnet-4-5`))return`claude-sonnet-4-5`;if(e.includes(`claude-sonnet-4`))return`claude-sonnet-4`;if(e.includes(`claude-haiku-4-5`))return`claude-haiku-4-5`;if(e.includes(`claude-3-7-sonnet`))return`claude-3-7-sonnet`;if(e.includes(`claude-3-5-sonnet`))return`claude-3-5-sonnet`;if(e.includes(`claude-3-5-haiku`))return`claude-3-5-haiku`;if(e.includes(`claude-3-opus`))return`claude-3-opus`;if(e.includes(`claude-3-sonnet`))return`claude-3-sonnet`;if(e.includes(`claude-3-haiku`))return`claude-3-haiku`;let t=e.match(/(claude-(\d+-\d+-)?\w+)/);return t?.[1]?t[1]:e}function Q(e){return Z(hn(e))}function Us(e=!1){return Ka()||Ja()?Ks()?`Opus 4.7 with 1M context · Most capable for complex work${e?Gs(!0):``}`:`Opus 4.7 · Most capable for complex work${e?Gs(!0):``}`:`Sonnet 4.6 · Best for everyday tasks`}function Ws(e){return e===`opusplan`?`Opus 4.7 in plan mode, else Sonnet 4.6`:Ys($(e))}function Gs(e){if(k()!==`firstParty`)return``;let t=cs(ts(e));return` ·${e?` (↯)`:``} ${t}`}function Ks(){return!(Gr()||Xa()||k()!==`firstParty`||!Mt()||R()&&z()===null)}function qs(e){return e===`opusplan`?`Opus Plan`:X(e)?ft(e):Ys(e)}function Js(e){switch(e){case j().opus47:return`Opus 4.7`;case`${j().opus47}[1m]`:return`Opus 4.7 (1M context)`;case j().opus46:return`Opus 4.6`;case`${j().opus46}[1m]`:return`Opus 4.6 (1M context)`;case j().opus45:return`Opus 4.5`;case j().opus41:return`Opus 4.1`;case j().opus40:return`Opus 4`;case`${j().sonnet46}[1m]`:return`Sonnet 4.6 (1M context)`;case j().sonnet46:return`Sonnet 4.6`;case`${j().sonnet45}[1m]`:return`Sonnet 4.5 (1M context)`;case j().sonnet45:return`Sonnet 4.5`;case j().sonnet40:return`Sonnet 4`;case`${j().sonnet40}[1m]`:return`Sonnet 4 (1M context)`;case j().sonnet37:return`Sonnet 3.7`;case j().sonnet35:return`Sonnet 3.5`;case j().haiku45:return`Haiku 4.5`;case j().haiku35:return`Haiku 3.5`;default:return null}}function Ys(e){return Js(e)||e}function $(e){let t=e.trim(),n=t.toLowerCase(),r=F(n),i=r?n.replace(/\[1m]$/i,``).trim():n;if(X(i))switch(i){case`opusplan`:return Rs()+(r?`[1m]`:``);case`sonnet`:return Rs()+(r?`[1m]`:``);case`haiku`:return zs()+(r?`[1m]`:``);case`opus`:return Ls()+(r?`[1m]`:``);case`best`:return Fs();default:}return k()===`firstParty`&&Zs(i)&&Qs()?Ls()+(r?`[1m]`:``):r?`${t.replace(/\[1m\]$/i,``).trim()}[1m]`:t}function Xs(e,t){return F(e)||!F(t)?e:Kr($(e))?`${e}[1m]`:e}function Zs(e){return nc.includes(e)}function Qs(){return!s(process.env.CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP)}function $s(e){if(e===null)return R()?`Default (${Us()})`:`Default (${Hs()})`;let t=$(e);return e===t?t:`${e} (${t})`}function ec(e){if(k()===`foundry`)return;let t=e.toLowerCase().includes(`[1m]`),n=Q(e);if(n.includes(`claude-opus-4-7`))return t?`Opus 4.7 (with 1M context)`:`Opus 4.7`;if(n.includes(`claude-opus-4-6`))return t?`Opus 4.6 (with 1M context)`:`Opus 4.6`;if(n.includes(`claude-opus-4-5`))return`Opus 4.5`;if(n.includes(`claude-opus-4-1`))return`Opus 4.1`;if(n.includes(`claude-opus-4`))return`Opus 4`;if(n.includes(`claude-sonnet-4-6`))return t?`Sonnet 4.6 (with 1M context)`:`Sonnet 4.6`;if(n.includes(`claude-sonnet-4-5`))return t?`Sonnet 4.5 (with 1M context)`:`Sonnet 4.5`;if(n.includes(`claude-sonnet-4`))return t?`Sonnet 4 (with 1M context)`:`Sonnet 4`;if(n.includes(`claude-3-7-sonnet`))return`Work Mate 3.7 Sonnet`;if(n.includes(`claude-3-5-sonnet`))return`Work Mate 3.5 Sonnet`;if(n.includes(`claude-haiku-4-5`))return`Haiku 4.5`;if(n.includes(`claude-3-5-haiku`))return`Work Mate 3.5 Haiku`}function tc(e){return e.replace(/\[(1|2)m\]/gi,``)}var nc,rc=e((()=>{m(),G(),ri(),c(),bn(),gs(),x(),A(),ze(),Es(),bs(),pt(),As(),nc=[`claude-opus-4-20250514`,`claude-opus-4-1-20250805`,`claude-opus-4-0`,`claude-opus-4-1`]}));export{Ko as $,xr as $n,k as $r,Ea as $t,vs as A,oi as An,Tn as Ar,Ia as At,jo as B,ri as Bn,bn as Br,io as Bt,$ as C,gi as Cn,An as Cr,Ra as Ct,Xs as D,fi as Dn,Nn as Dr,Za as Dt,qs as E,pi as En,Mn as Er,no as Et,as as F,qr as Fn,xn as Fr,Ha as Ft,Do as G,kr as Gn,qt as Gr,to as Gt,ko as H,Wr as Hn,Vt as Hr,Ya as Ht,cs as I,Zr as In,Sn as Ir,I as It,es as J,wr as Jn,Rt as Jr,Ja as Jt,Fo as K,Pr as Kn,Yt as Kr,Wa as Kt,ts as L,Xr as Ln,Cn as Lr,aa as Lt,Y as M,ni as Mn,On as Mr,Ga as Mt,hs as N,$r as Nn,wn as Nr,Va as Nt,Es as O,mi as On,In as Or,Qa as Ot,os as P,Yr as Pn,Fn as Pr,G as Pt,Oo as Q,Sr as Qn,Pt as Qr,Da as Qt,gs as R,Jr as Rn,_n as Rr,sa as Rt,tc as S,xi as Sn,En as Sr,W as St,Ys as T,Si as Tn,kn as Tr,Ua as Tt,Lo as U,Br as Un,Kt as Ur,xa as Ut,Eo as V,Gr as Vn,Gt as Vr,Aa as Vt,To as W,Nr as Wn,Wt as Wr,Ka as Wt,Io as X,Dr as Xn,Nt as Xr,$a as Xt,Co as Y,Cr as Yn,Lt as Yr,qa as Yt,K as Z,Er as Zn,It as Zr,ha as Zt,rc as _,Fi as _n,Xn as _r,ua as _t,zs as a,ka as an,gr as ar,Ao as at,Ks as b,_i as bn,Ln as br,la as bt,Ls as c,Ji as cn,yr as cr,za as ct,ec as d,Ki as dn,or as dr,ya as dt,jt as ei,U as en,_r as er,Go as et,Gs as f,Gi as fn,ir as fr,Ta as ft,Ns as g,Pi as gn,N as gr,na as gt,js as h,Li as hn,Qn as hr,ea as ht,Us as i,ja as in,mr as ir,zo as it,bs as j,si as jn,Pn as jr,ta as jt,Ts as k,hi as kn,jn as kr,z as kt,Rs as l,qi as ln,br as lr,Sa as lt,Bs as m,Wi as mn,$n as mr,ao as mt,Fs as n,Mt as ni,wa as nn,ur as nr,Xo as nt,Hs as o,Na as on,dr as or,Zi as ot,Js as p,Ri as pn,er as pr,Pa as pt,Mo as q,Tr as qn,Ht as qr,Xa as qt,Q as r,mo as rn,hr as rr,Bo as rt,Vs as s,oo as sn,pr as sr,ca as st,Z as t,A as ti,_a as tn,lr as tr,Jo as tt,Ps as u,Xi as un,ar as ur,ma as ut,Qs as v,Ai as vn,Gn as vr,pa as vt,Ws as w,bi as wn,Dn as wr,L as wt,$s as x,li as xn,Rn as xr,$i as xt,Ms as y,Ei as yn,Kn as yr,ho as yt,Vo as z,F as zn,j as zr,R as zt};
@@ -1 +0,0 @@
1
- import{i as e,r as t}from"./parser-a2S_eFyE.js";t();export{e as parseCommand};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./pluginStartupCheck-AQGV0DCS.js";e();export{t as getPluginEditableScopes};
@@ -1 +0,0 @@
1
- import{C as e,w as t}from"./external-CEp-aPkt.js";import{n,r,t as i}from"./lazySchema-B4D4qJVE.js";r(),i();var a=2e3,o=6e5,s={poll_interval_ms_not_at_capacity:a,poll_interval_ms_at_capacity:o,non_exclusive_heartbeat_interval_ms:0,multisession_poll_interval_ms_not_at_capacity:a,multisession_poll_interval_ms_partial_capacity:a,multisession_poll_interval_ms_at_capacity:o,reclaim_older_than_ms:5e3,session_keepalive_interval_v2_ms:12e4},c={message:`must be 0 (disabled) or ≥100ms`},l=n(()=>t({poll_interval_ms_not_at_capacity:e().int().min(100),poll_interval_ms_at_capacity:e().int().refine(e=>e===0||e>=100,c),non_exclusive_heartbeat_interval_ms:e().int().min(0).default(0),multisession_poll_interval_ms_not_at_capacity:e().int().min(100).default(s.multisession_poll_interval_ms_not_at_capacity),multisession_poll_interval_ms_partial_capacity:e().int().min(100).default(s.multisession_poll_interval_ms_partial_capacity),multisession_poll_interval_ms_at_capacity:e().int().refine(e=>e===0||e>=100,c).default(s.multisession_poll_interval_ms_at_capacity),reclaim_older_than_ms:e().int().min(1).default(5e3),session_keepalive_interval_v2_ms:e().int().min(0).default(12e4)}).refine(e=>e.non_exclusive_heartbeat_interval_ms>0||e.poll_interval_ms_at_capacity>0,{message:`at-capacity liveness requires non_exclusive_heartbeat_interval_ms > 0 or poll_interval_ms_at_capacity > 0`}).refine(e=>e.non_exclusive_heartbeat_interval_ms>0||e.multisession_poll_interval_ms_at_capacity>0,{message:`at-capacity liveness requires non_exclusive_heartbeat_interval_ms > 0 or multisession_poll_interval_ms_at_capacity > 0`}));function u(){let e=s,t=l().safeParse(e);return t.success?t.data:s}export{s as n,u as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./poorMode-wm2WkPF0.js";t();export{e as isPoorModeActive};
@@ -1 +0,0 @@
1
- import{i as e,r as t}from"./prompt-CQmEvnKN.js";t();export{e as isDeferredTool};
@@ -1 +0,0 @@
1
- import{cw as e,mw as t}from"./loadAgentsDir-PPiD2Mfq.js";t();export{e as clearPromptCache};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./axios-DaWTGg7G.js";import{Av as n,dT as r,jv as i,uT as a}from"./loadAgentsDir-PPiD2Mfq.js";import{A as o,M as s,O as c,w as l}from"./external-CEp-aPkt.js";import{n as ee,r as te,t as u}from"./lazySchema-B4D4qJVE.js";import{C as d,F as f,N as p,R as m,c as h,i as g,nt as ne,tt as re,x as ie}from"./debug-BQj6h99Q.js";import{Hn as _,Kn as v,N as y,P as b,Un as x,Vn as S}from"./settings-CvhsRFaT.js";import{l as C,s as w,u as T}from"./oauth-D38aRTUb.js";import{Pt as E,St as D,ct as O,dn as k,fn as A,gt as j}from"./model-sviY1inu.js";import{n as M,t as N}from"./userAgent-DUt0q-Vl.js";import{n as P,r as F,t as I}from"./syncCache-AMQMQ_HR.js";import{createHash as L}from"crypto";import{open as R,unlink as z}from"fs/promises";t(),te(),re(),m(),ie(),g(),u(),T(),b(),M(),k(),E(),a(),i();async function B(e,t){return`no_check_needed`}function V(e){return!0}x(),I();var H=ee(()=>l({uuid:o(),checksum:o(),settings:c(o(),s())})),ae=1e4,U=5,W=3600*1e3,G=null,K=null,q=null,J=3e4;function oe(){K||P()&&(K=new Promise(e=>{q=e,setTimeout(()=>{q&&(h(`Remote settings: Loading promise timed out, resolving anyway`),q(),q=null)},J)}))}function se(){return`${C().BASE_API_URL}/api/claude_code/settings`}function Y(e){if(Array.isArray(e))return e.map(Y);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e).sort())t[n]=Y(e[n]);return t}return e}function ce(e){let t=d(Y(e));return`sha256:${L(`sha256`).update(t).digest(`hex`)}`}function le(){return P()}async function ue(){K&&await K}function de(){try{let{key:e}=j({skipRetrievingKeyFromApiKeyHelper:!0});if(e)return{headers:{"x-api-key":e}}}catch{}let e=D();return e?.accessToken?{headers:{Authorization:`Bearer ${e.accessToken}`,"anthropic-beta":w}}:{headers:{},error:`No authentication available`}}async function fe(e){let t=null;for(let r=1;r<=6;r++){if(t=await pe(e),t.success||t.skipRetry||r>U)return t;let i=n(r);h(`Remote settings: Retry ${r}/${U} after ${i}ms`),await A(i)}return t}async function pe(t){try{await O();let n=de();if(n.error)return{success:!1,error:`Authentication required for remote settings`,skipRetry:!0};let r=se(),i={...n.headers,"User-Agent":N()};t&&(i[`If-None-Match`]=`"${t}"`);let a=await e.get(r,{headers:i,timeout:ae,validateStatus:e=>e===200||e===204||e===304||e===404});if(a.status===304)return h(`Remote settings: Using cached settings (304)`),{success:!0,settings:null,checksum:t};if(a.status===204||a.status===404)return h(`Remote settings: No settings found (${a.status})`),{success:!0,settings:{},checksum:void 0};let o=H().safeParse(a.data);if(!o.success)return h(`Remote settings: Invalid response format - ${o.error.message}`),{success:!1,error:`Invalid remote settings format`};let s=y().safeParse(o.data.settings);return s.success?(h(`Remote settings: Fetched successfully`),{success:!0,settings:s.data,checksum:o.data.checksum}):(h(`Remote settings: Settings validation failed - ${s.error.message}`),{success:!1,error:`Invalid settings structure`})}catch(e){let{kind:t,status:n,message:r}=p(e);if(n===404)return{success:!0,settings:{},checksum:``};switch(t){case`auth`:return{success:!1,error:`Not authorized for remote settings`,skipRetry:!0};case`timeout`:return{success:!1,error:`Remote settings request timeout`};case`network`:return{success:!1,error:`Cannot connect to server`};default:return{success:!1,error:r}}}}async function me(e){try{let t=_(),n=await R(t,`w`,384);try{await n.writeFile(d(e,null,2),{encoding:`utf-8`}),await n.datasync()}finally{await n.close()}h(`Remote settings: Saved to ${t}`)}catch(e){h(`Remote settings: Failed to save - ${e instanceof Error?e.message:`unknown error`}`)}}async function X(){$(),F(),K=null,q=null;try{await z(_())}catch{}}async function Z(){if(!P())return null;let e=S(),t=e?ce(e):void 0;try{let n=await fe(t);if(!n.success)return e?(h(`Remote settings: Using stale cache after fetch failure`),v(e),e):null;if(n.settings===null&&e)return h(`Remote settings: Cache still valid (304 Not Modified)`),v(e),e;let r=n.settings||{};if(Object.keys(r).length>0)return V(await B(e,r))?(v(r),await me(r),h(`Remote settings: Applied new settings successfully`),r):(h(`Remote settings: User rejected new settings, using cached settings`),e);v(r);try{await z(_()),h(`Remote settings: Deleted cached file (404 response)`)}catch(e){f(e)!==`ENOENT`&&h(`Remote settings: Failed to delete cached file - ${e instanceof Error?e.message:`unknown error`}`)}return r}catch{return e?(h(`Remote settings: Using stale cache after error`),v(e),e):null}}async function Q(){P()&&!K&&(K=new Promise(e=>{q=e})),S()&&q&&(q(),q=null);try{let e=await Z();P()&&_e(),e!==null&&r.notifyChange(`policySettings`)}finally{q&&(q(),q=null)}}async function he(){if(await X(),!P()){r.notifyChange(`policySettings`);return}await Z(),h(`Remote settings: Refreshed after auth change`),r.notifyChange(`policySettings`)}async function ge(){if(!P())return;let e=S(),t=e?d(e):null;try{await Z();let e=S();(e?d(e):null)!==t&&(h(`Remote settings: Changed during background poll`),r.notifyChange(`policySettings`))}catch{}}function _e(){G===null&&P()&&(G=setInterval(()=>{ge()},W),G.unref(),ne(async()=>$()))}function $(){G!==null&&(clearInterval(G),G=null)}export{he as a,Q as i,oe as n,ue as o,le as r,X as t};
@@ -1 +0,0 @@
1
- import{a as e,i as t}from"./ripgrep-DsLUmulz.js";e();export{t as getRipgrepStatus};
@@ -1 +0,0 @@
1
- import{oT as e,rT as t}from"./loadAgentsDir-PPiD2Mfq.js";e();export{t as SandboxManager};
@@ -1 +0,0 @@
1
- import{F_ as e,N_ as t}from"./loadAgentsDir-PPiD2Mfq.js";t();export{e as isSearchExtraToolsEnabled};
@@ -1 +0,0 @@
1
- import{nh as e,rh as t}from"./loadAgentsDir-PPiD2Mfq.js";e();export{t as registerSessionFileAccessHooks};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./sessionObserver-BAr8AWeL.js";t();export{e as heuristicObserverBackend};
@@ -1 +0,0 @@
1
- import{Dr as e,Xr as t,br as n}from"./loadAgentsDir-PPiD2Mfq.js";n();export{e as linkSessionToPR,t as recordTranscript};
@@ -1,14 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{La as t,Ta as n,X as r,Z as i,by as a}from"./loadAgentsDir-PPiD2Mfq.js";import{A as o,w as s}from"./external-CEp-aPkt.js";import{n as c,r as l,t as u}from"./lazySchema-B4D4qJVE.js";import{Wt as d,z as f}from"./state-BPFYBqm1.js";import{c as p,i as m}from"./debug-BQj6h99Q.js";import{s as h,u as g}from"./types-BomO8WUz.js";import{n as _,r as v}from"./analytics-DJobLaWP.js";import{Q as y}from"./sessionState-BTFowSpR.js";function b(e){let t=[];for(let n of e){if(n.type!==`user`&&n.type!==`assistant`||`isMeta`in n&&n.isMeta||`origin`in n&&n.origin&&n.origin.kind!==`human`)continue;let e=n.message.content;if(typeof e==`string`)t.push(e);else if(Array.isArray(e))for(let n of e)`type`in n&&n.type===`text`&&`text`in n&&t.push(n.text)}let n=t.join(`
2
- `);return n.length>S?n.slice(-1e3):n}async function x(e,t){let r=e.trim();if(!r)return null;try{let e=n((await i({systemPrompt:y([C]),userPrompt:r,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{title:{type:`string`}},required:[`title`],additionalProperties:!1}},signal:t,options:{querySource:`generate_session_title`,agents:[],isNonInteractiveSession:f(),hasAppendSystemPrompt:!1,mcpTools:[]}})).message.content),a=w().safeParse(g(e)),o=a.success&&a.data.title.trim()||null;return v(`tengu_session_title_generated`,{success:o!==null}),o}catch(e){return p(`generateSessionTitle failed: ${e}`,{level:`error`}),v(`tengu_session_title_generated`,{success:!1}),null}}var S,C,w,T=e((()=>{l(),d(),_(),r(),m(),h(),u(),t(),a(),S=1e3,C=`Generate a concise, sentence-case title (3-7 words) that captures the main topic or goal of this coding session. The title should be clear enough that the user recognizes the session in a list. Use sentence case: capitalize only the first word and proper nouns.
3
-
4
- Return JSON with a single "title" field.
5
-
6
- Good examples:
7
- {"title": "Fix login button on mobile"}
8
- {"title": "Add OAuth authentication"}
9
- {"title": "Debug failing CI tests"}
10
- {"title": "Refactor API client error handling"}
11
-
12
- Bad (too vague): {"title": "Code changes"}
13
- Bad (too long): {"title": "Investigate and fix the issue where the login button does not respond on mobile devices"}
14
- Bad (wrong case): {"title": "Fix Login Button On Mobile"}`,w=c(()=>s({title:o()}))}));export{x as n,T as r,b as t};
@@ -1 +0,0 @@
1
- import{c as e,g as t,x as n}from"./settings-CvhsRFaT.js";t();export{e as getSettingsForSource,n as updateSettingsForSource};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ky as t,jv as n}from"./loadAgentsDir-PPiD2Mfq.js";import{A as r,C as i,O as a,w as o}from"./external-CEp-aPkt.js";import{n as s,r as c,t as l}from"./lazySchema-B4D4qJVE.js";import{Wt as u}from"./state-BPFYBqm1.js";import{R as d}from"./debug-BQj6h99Q.js";import{g as f}from"./settings-CvhsRFaT.js";import{h as p}from"./config-BSkuQZNf.js";import{O as m,m as h}from"./git-DplvjXEY.js";import{u as g}from"./oauth-D38aRTUb.js";import{Pt as _,ti as v}from"./model-sviY1inu.js";import"path";import"fs/promises";var y,b=e((()=>{c(),l(),y=s(()=>o({entries:a(r(),r())})),s(()=>o({userId:r(),version:i(),lastModified:r(),checksum:r(),content:y()}))})),x=e((()=>{u(),g(),_(),t(),p(),m(),d(),h(),v(),f(),n(),b()}));export{x as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./sinks-Bb2i50kz.js";export{e as initSinks};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./startupProfiler-2sjXZkIP.js";e();export{t as profileCheckpoint};
@@ -1 +0,0 @@
1
- import{Bn as e,Wt as t,dn as n,pt as r,t as i}from"./state-BPFYBqm1.js";t();export{i as addInvokedSkill,r as getSessionId,n as setCwdState,e as setOriginalCwd};
@@ -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-ClcLl0C1.js";async function i(e,t){return(0,a.jsx)(r,{onClose:e,context:t,defaultTab:`Status`})}var a;e((()=>{n(),a=t()}))();export{i as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DcaKZlRU.js";import{A as r,l as i,n as a,p as o,w as s}from"./external-CEp-aPkt.js";import{o as c,s as l}from"./log-BlJ7CcKG.js";import{dirname as u,join as d}from"path";import{existsSync as f,readFileSync as p,renameSync as m,unlinkSync as h,writeFileSync as g}from"fs";import{randomBytes as _}from"node:crypto";var v=e((()=>{a(),a()})),y,b,x,S=e((()=>{v(),y=i([`openai-compat`,`anthropic-compat`]),b=s({id:r().min(1).regex(/^[a-z0-9-]+$/,`id must be kebab-case`),kind:y,baseUrl:r().url(),apiKey:r().min(1).optional(),apiKeyEnv:r().min(1).optional(),defaultModel:r().min(1).default(`gpt-4o-mini`)}).refine(e=>!!e.apiKey||!!e.apiKeyEnv,`either apiKey or apiKeyEnv is required`),x=o(b)}));function C(){return d(t(),`providers.json`)}function w(){k=null}function T(){if(k!==null)return k;let e=E();return k=e.providers,e.providers}function E(){let e=C();if(!f(e))return{providers:[]};let t;try{t=p(e,`utf-8`)}catch(t){let n=`loadProviders: failed to read ${e}: ${t instanceof Error?t.message:String(t)}`;return l(Error(n)),{providers:[],error:n}}if(!t.trim())return{providers:[]};let n;try{n=JSON.parse(t)}catch{let t=`loadProviders: ${e} is not valid JSON. Ignoring.`;return l(Error(t)),{providers:[],error:t}}let r=x.safeParse(n);if(!r.success){let t=`loadProviders: ${e} failed schema validation: ${r.error.message}. Ignoring.`;return l(Error(t)),{providers:[],error:t}}return{providers:r.data}}function D(e,t){return(t??T()).find(t=>t.id===e)}function O(e){let t=C(),n=d(u(t),`.providers-${_(8).toString(`hex`)}.tmp`);try{g(n,JSON.stringify(e,null,2),`utf-8`),m(n,t)}catch(e){try{h(n)}catch{}throw e}return w(),e}var k,A=e((()=>{c(),n(),S(),k=null}));function j(e){if(e.apiKey)return e.apiKey;if(e.apiKeyEnv)return process.env[e.apiKeyEnv]}function M(e,t){let n=t??T(),r=D(e,n);if(!r){let t=n.map(e=>e.id).join(`, `);throw Error(`switchProvider: provider "${e}" not found. Available: ${t}`)}let i=r.kind===`anthropic-compat`?{ANTHROPIC_BASE_URL:r.baseUrl,ANTHROPIC_MODEL:r.defaultModel}:{CLAUDE_CODE_USE_OPENAI:`1`,OPENAI_BASE_URL:r.baseUrl,OPENAI_MODEL:r.defaultModel},a=[];if(r.kind===`openai-compat`){let e=process.env.CLAUDE_CODE_USE_OPENAI===`1`||!!process.env.OPENAI_API_KEY,t=!!process.env.ANTHROPIC_API_KEY;e&&t&&a.push(`Both ANTHROPIC_API_KEY and OpenAI-compat mode are set. ANTHROPIC_API_KEY is for workspace endpoints (/v1/agents, /v1/vaults). OpenAI-compat mode routes /v1/messages to a third-party provider. These are separate planes — verify this is intentional.`)}return!r.apiKey&&!r.apiKeyEnv?a.push(`Provider "${r.id}" has neither apiKey nor apiKeyEnv configured. Edit ~/.workmate/providers.json to add one.`):!r.apiKey&&r.apiKeyEnv&&!process.env[r.apiKeyEnv]&&a.push(`${r.apiKeyEnv} is not set in the current environment. Set it before starting Work Mate: export ${r.apiKeyEnv}=<your-api-key>`),{env:i,warnings:a,provider:r}}function N(e){return e.kind===`anthropic-compat`?`ANTHROPIC_API_KEY`:`OPENAI_API_KEY`}async function P(e,t){delete process.env.CLAUDE_CODE_USE_BEDROCK,delete process.env.CLAUDE_CODE_USE_VERTEX,delete process.env.CLAUDE_CODE_USE_FOUNDRY,delete process.env.CLAUDE_CODE_USE_GEMINI,delete process.env.CLAUDE_CODE_USE_GROK,e.kind===`anthropic-compat`?(delete process.env.CLAUDE_CODE_USE_OPENAI,delete process.env.OPENAI_BASE_URL,delete process.env.OPENAI_API_KEY,delete process.env.OPENAI_MODEL):(delete process.env.ANTHROPIC_BASE_URL,delete process.env.ANTHROPIC_API_KEY,delete process.env.ANTHROPIC_MODEL);let n=e.kind===`anthropic-compat`?{ANTHROPIC_BASE_URL:e.baseUrl,ANTHROPIC_API_KEY:t??``,ANTHROPIC_MODEL:e.defaultModel}:{CLAUDE_CODE_USE_OPENAI:`1`,OPENAI_BASE_URL:e.baseUrl,OPENAI_API_KEY:t??``,OPENAI_MODEL:e.defaultModel},{clearOpenAIClientCache:r}=await import(`./client-zhozU2ws.js`);r();let{fetchAvailableModels:i}=await import(`./fetchModelList-B8KG79EK.js`);i.cache.clear();let{applyConfigEnvironmentVariables:a}=await import(`./managedEnv-XOUMOtEF.js`);a(),Object.assign(process.env,n)}async function F(e,t){let{provider:n,warnings:r}=M(e,t),i=j(n),a=N(n);i||r.push(`No API key available for provider "${n.id}" — ${a} will be empty. Set ${n.apiKeyEnv??`an env var`} or add an apiKey field in ~/.workmate/providers.json.`),await P(n,i);let{updateSettingsForSource:o}=await import(`./settings-BgHApyGL.js`);return o(`userSettings`,{activeProviderId:n.id,modelType:n.kind===`anthropic-compat`?`anthropic`:`openai`}),{provider:n,warnings:r}}async function I(){let{getSettingsForSource:e}=await import(`./settings-BgHApyGL.js`),t=e(`userSettings`)?.activeProviderId;if(!t)return null;let n=D(t);if(!n)return null;let r=[],i=j(n);if(!i){let e=N(n);r.push(`No API key available for provider "${n.id}" — ${e} will be empty. Set ${n.apiKeyEnv??`an env var`} or add an apiKey field in ~/.workmate/providers.json.`)}return await P(n,i),{provider:n,warnings:r}}var L=e((()=>{A()}));export{A as a,v as c,M as i,L as n,T as o,I as r,O as s,F as t};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./switcher-BIP3rbQn.js";e();export{t as restoreActiveProvider};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./trustedDevice-BtXHXu-T.js";export{t as clearTrustedDeviceToken,e as enrollTrustedDevice};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Xh as t,Zh as n}from"./loadAgentsDir-PPiD2Mfq.js";import{C as r,_ as i,s as a}from"./model-sviY1inu.js";function o(){let e=n(e=>e.mainLoopModel);return r(n(e=>e.mainLoopModelForSession)??e??a())}var s=e((()=>{t(),i()}));export{o as n,s as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{Ew as r,Tw as i,dE as a,fE as o,hE as s,mE as c,vw as l,ww as u,yw as d}from"./loadAgentsDir-PPiD2Mfq.js";import{p as f}from"./external-CEp-aPkt.js";import{r as ee}from"./lazySchema-B4D4qJVE.js";import{B as p,C as m,F as h,P as g,R as _,S as v,c as y,f as b,i as te,u as x,x as S}from"./debug-BQj6h99Q.js";import{_t as C,gt as w,ht as T,pt as E,vt as D}from"./settings-CvhsRFaT.js";import{o as ne,s as O}from"./log-BlJ7CcKG.js";import{homedir as re}from"os";import*as k from"path";import{join as ie,resolve as ae}from"path";import{randomBytes as oe}from"crypto";import{readFile as A,readdir as j,rename as M,stat as N,unlink as P,writeFile as F}from"fs/promises";function I(){return ie(l(),U)}async function L(){let e=I();try{let t=v(await A(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return y(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==H)return y(`Install counts cache version mismatch (got ${n.version}, expected ${H})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return y(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(y(`Install counts cache has invalid fetchedAt timestamp`),null):n.counts.every(e=>typeof e==`object`&&!!e&&typeof e.plugin==`string`&&typeof e.unique_installs==`number`)?Date.now()-r>G?(y(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(y(`Install counts cache has malformed entries`),null)}catch(e){return h(e)!==`ENOENT`&&y(`Failed to load install counts cache: ${g(e)}`),null}}async function R(e){let t=I(),n=`${t}.${oe(8).toString(`hex`)}.tmp`;try{let r=l();await x().mkdir(r),await F(n,m(e,null,2),{encoding:`utf-8`,mode:384}),await M(n,t),y(`Install counts cache saved successfully`)}catch(e){O(e);try{await P(n)}catch{}}}async function z(){y(`Fetching install counts from ${W}`);let e=performance.now();try{let n=await t.get(W,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return r(`install_counts`,W,`success`,performance.now()-e),n.data.plugins}catch(t){throw r(`install_counts`,W,`failure`,performance.now()-e,u(t)),t}}async function B(){let e=await L();if(e){y(`Using cached install counts`),r(`install_counts`,W,`cache_hit`,0);let t=new Map;for(let n of e.counts)t.set(n.plugin,n.unique_installs);return t}try{let e=await z();await R({version:H,fetchedAt:new Date().toISOString(),counts:e});let t=new Map;for(let n of e)t.set(n.plugin,n.unique_installs);return t}catch(e){return O(e),y(`Failed to fetch install counts: ${g(e)}`),null}}function V(e){if(e<1e3)return String(e);if(e<1e6){let t=(e/1e3).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}K`:`${t}K`}let t=(e/1e6).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}M`:`${t}M`}var H,U,W,G,K=e((()=>{n(),te(),_(),b(),ne(),S(),i(),d(),H=1,U=`install-counts-cache.json`,W=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,G=1440*60*1e3}));async function se(e){let t=e.trim(),n=x(),r=t.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(r?.[1]){let e=r[1],t=r[3];return t?{source:`git`,url:e,ref:t}:{source:`git`,url:e}}if(t.startsWith(`http://`)||t.startsWith(`https://`)){let e=t.match(/^([^#]+)(#(.+))?$/),n=e?.[1]||t,r=e?.[3];if(n.endsWith(`.git`)||n.includes(`/_git/`))return r?{source:`git`,url:n,ref:r}:{source:`git`,url:n};let i;try{i=new URL(n)}catch{return{source:`url`,url:n}}if((i.hostname===`github.com`||i.hostname===`www.github.com`)&&i.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let e=n.endsWith(`.git`)?n:`${n}.git`;return r?{source:`git`,url:e,ref:r}:{source:`git`,url:e}}return{source:`url`,url:n}}let i=process.platform===`win32`&&(t.startsWith(`.\\`)||t.startsWith(`..\\`)||/^[a-zA-Z]:[/\\]/.test(t));if(t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)||t.startsWith(`~`)||i){let e=ae(t.startsWith(`~`)?t.replace(/^~/,re()):t),r;try{r=await n.stat(e)}catch(t){let n=h(t);return{error:n===`ENOENT`?`Path does not exist: ${e}`:`Cannot access path: ${e} (${n??t})`}}return r.isFile()?e.endsWith(`.json`)?{source:`file`,path:e}:{error:`File path must point to a .json file (marketplace.json), but got: ${e}`}:r.isDirectory()?{source:`directory`,path:e}:{error:`Path is neither a file nor a directory: ${e}`}}if(t.includes(`/`)&&!t.startsWith(`@`)){if(t.includes(`:`))return null;let e=t.match(/^([^#@]+)(?:[#@](.+))?$/),n=e?.[1]||t,r=e?.[2];return r?{source:`github`,repo:n,ref:r}:{source:`github`,repo:n}}return null}var ce=e((()=>{_(),b()}));function le(e){let t=k.basename(e),n=k.basename(k.dirname(e));return t===`plugin.json`?`plugin`:t===`marketplace.json`?`marketplace`:n===`.claude-plugin`?`plugin`:`unknown`}function q(e){return e.issues.map(e=>({path:e.path.join(`.`)||`root`,message:e.message,code:e.code}))}function J(e,t,n,r){e.includes(`..`)&&n.push({path:t,message:r?`Path contains "..": ${e}. ${r}`:`Path contains ".." which could be a path traversal attempt: ${e}`})}function ue(e){let t=e.replace(/^(\.\.\/)+/,``);return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${t===e?`./plugins/my-plugin`:`./${t}`}" instead of "${e}".`}async function Y(e){let t=[],n=[],r=k.resolve(e),i;try{i=await A(r,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${g(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=v(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${g(e)}`}],warnings:[],filePath:r,fileType:`plugin`}}if(a&&typeof a==`object`){let e=a;e.commands&&(Array.isArray(e.commands)?e.commands:[e.commands]).forEach((e,n)=>{typeof e==`string`&&J(e,`commands[${n}]`,t)}),e.agents&&(Array.isArray(e.agents)?e.agents:[e.agents]).forEach((e,n)=>{typeof e==`string`&&J(e,`agents[${n}]`,t)}),e.skills&&(Array.isArray(e.skills)?e.skills:[e.skills]).forEach((e,n)=>{typeof e==`string`&&J(e,`skills[${n}]`,t)})}let o=a;if(typeof a==`object`&&a){let e=a,t=Object.keys(e).filter(e=>$.has(e));if(t.length>0){let r={...e};for(let e of t)delete r[e],n.push({path:e,message:`Field '${e}' belongs in the marketplace entry (marketplace.json), not plugin.json. It's harmless here but unused — Work Mate ignores it at load time.`});o=r}}let s=T().strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Work Mate accepts it, but the Claude.ai marketplace sync requires kebab-case (lowercase letters, digits, and hyphens only, e.g., "my-plugin").`}),e.version||n.push({path:`version`,message:`No version specified. Consider adding a version following semver (e.g., "1.0.0")`}),e.description||n.push({path:`description`,message:`No description provided. Adding a description helps users understand what your plugin does`}),e.author||n.push({path:`author`,message:`No author information provided. Consider adding author details for plugin attribution`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`plugin`}}async function X(e){let t=[],n=[],r=k.resolve(e),i;try{i=await A(r,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${g(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`marketplace`}}let a;try{a=v(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${g(e)}`}],warnings:[],filePath:r,fileType:`marketplace`}}if(a&&typeof a==`object`){let e=a;Array.isArray(e.plugins)&&e.plugins.forEach((e,n)=>{if(e&&typeof e==`object`&&`source`in e){let r=e.source;typeof r==`string`&&J(r,`plugins[${n}].source`,t,ue(r)),r&&typeof r==`object`&&`path`in r&&typeof r.path==`string`&&J(r.path,`plugins[${n}].source.path`,t)}})}let o=C().extend({plugins:f(w().strict())}).strict().safeParse(a);if(o.success||t.push(...q(o.error)),o.success){let e=o.data;if((!e.plugins||e.plugins.length===0)&&n.push({path:`plugins`,message:`Marketplace has no plugins defined`}),e.plugins){e.plugins.forEach((n,r)=>{e.plugins.filter(e=>e.name===n.name).length>1&&t.push({path:`plugins[${r}].name`,message:`Duplicate plugin name "${n.name}" found in marketplace`})});let i=k.dirname(r),a=k.basename(i)===`.claude-plugin`?k.dirname(i):i;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=k.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=v(await A(e,{encoding:`utf-8`}));typeof t.version==`string`&&(i=t.version)}catch{continue}i&&i!==r.version&&n.push({path:`plugins[${t}].version`,message:`Entry declares version "${r.version}" but ${r.source}/.claude-plugin/plugin.json says "${i}". At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. Update this entry to "${i}" to match.`})}}e.metadata?.description||n.push({path:`metadata.description`,message:`No marketplace description provided. Adding a description helps users understand what this marketplace offers`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`marketplace`}}function de(e,t,n){let r=[],i=[],o=t.match(a);if(!o)return i.push({path:`frontmatter`,message:`No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata.`}),{success:!0,errors:r,warnings:i,filePath:e,fileType:n};let c=o[1]||``,l;try{l=s(c)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${g(t)}. At runtime this ${n} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n}}if(typeof l!=`object`||!l||Array.isArray(l))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(l)?`an array`:l===null?`null`:typeof l}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let u=l;if(u.description!==void 0){let e=u.description;typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`&&e!==null&&r.push({path:`description`,message:`description must be a string, got ${Array.isArray(e)?`array`:typeof e}. At runtime this value is dropped.`})}else i.push({path:`description`,message:`No description in frontmatter. A description helps users and Work Mate understand when to use this ${n}.`});u.name!==void 0&&u.name!==null&&typeof u.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof u.name}.`});let d=u[`allowed-tools`];d!=null&&(typeof d!=`string`&&!Array.isArray(d)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof d}.`}):Array.isArray(d)&&d.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let f=u.shell;if(f!=null)if(typeof f!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof f}.`});else{let e=f.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${f}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await A(e,{encoding:`utf-8`})}catch(t){return h(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${g(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=v(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${g(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=E().safeParse(n);return r.success?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:q(r.error),warnings:[],filePath:e,fileType:`hooks`}}async function Q(e,t){let n;try{n=await j(e,{withFileTypes:!0})}catch(e){let t=h(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>k.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=k.join(e,t.name);t.isDirectory()?r.push(...await Q(n,!1)):t.isFile()&&t.name.toLowerCase().endsWith(`.md`)&&r.push(n)}return r}async function fe(e){let t=[],n=[[`skill`,k.join(e,`skills`)],[`agent`,k.join(e,`agents`)],[`command`,k.join(e,`commands`)]];for(let[e,r]of n){let n=await Q(r,e===`skill`);for(let r of n){let n;try{n=await A(r,{encoding:`utf-8`})}catch(n){if(p(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${g(n)}`}],warnings:[],filePath:r,fileType:e});continue}let i=de(r,n,e);(i.errors.length>0||i.warnings.length>0)&&t.push(i)}}let r=await Z(k.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=k.resolve(e),n=null;try{n=await N(t)}catch(e){if(!p(e))throw e}if(n?.isDirectory()){let e=await X(k.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(k.join(t,`.claude-plugin`,`plugin.json`));return n.errors[0]?.code===`ENOENT`?{success:!1,errors:[{path:`directory`,message:`No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json`}],warnings:[],filePath:t,fileType:`plugin`}:n}switch(le(e)){case`plugin`:return Y(e);case`marketplace`:return X(e);case`unknown`:try{let n=v(await A(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(h(e)===`ENOENT`)return{success:!1,errors:[{path:`file`,message:`File not found: ${t}`}],warnings:[],filePath:t,fileType:`plugin`}}return Y(e)}}var $,me=e((()=>{ee(),_(),o(),S(),c(),D(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{se as a,K as c,ce as i,pe as n,V as o,fe as r,B as s,me as t};
@@ -1 +0,0 @@
1
- import{i as e,o as t}from"./windowsPaths-BmXyrasP.js";e();export{t as setShellIfWindows};
@@ -1 +0,0 @@
1
- import{St as e,_t as t}from"./loadAgentsDir-PPiD2Mfq.js";e();export{t as execIntoTmuxWorktree};