@readmagic/workmate 0.0.9 → 0.0.11

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 (445) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-qFZy3FOD.js → AddWorkspaceDirectory-ag2JTpmU.js} +1 -1
  2. package/dist/chunks/{App-DW4elk6E.js → App-BuKmqFPm.js} +1 -1
  3. package/dist/chunks/ApproveApiKey-CIWOi_7v.js +1 -0
  4. package/dist/chunks/ApproveApiKey-M6U-NafA.js +1 -0
  5. package/dist/chunks/BackgroundTasksDialog-Pnpl3Ixx.js +2 -0
  6. package/dist/chunks/{BypassPermissionsModeDialog-BuRFF1fQ.js → BypassPermissionsModeDialog-B05t83wa.js} +1 -1
  7. package/dist/chunks/{ClaudeMdExternalIncludesDialog-CDrArsSX.js → ClaudeMdExternalIncludesDialog-CSywJdVL.js} +1 -1
  8. package/dist/chunks/ClaudeMdExternalIncludesDialog-D-w166RC.js +1 -0
  9. package/dist/chunks/ConsoleOAuthFlow-CV6PcJOP.js +1 -0
  10. package/dist/chunks/{DiffDialog-BIcwpgSr.js → DiffDialog-DUbFrzKu.js} +3 -3
  11. package/dist/chunks/Doctor-BcnUfJ4I.js +1 -0
  12. package/dist/chunks/Doctor-Dz4TuYas.js +3 -0
  13. package/dist/chunks/ExitFlow-BwyAtIHx.js +2 -0
  14. package/dist/chunks/{Grove-BmirUB6V.js → Grove-BDoVj02t.js} +2 -2
  15. package/dist/chunks/{HybridTransport-BVmSUHf0.js → HybridTransport-C_U0IJfz.js} +4 -4
  16. package/dist/chunks/{InvalidConfigDialog-WRywkKeS.js → InvalidConfigDialog-bih293Xt.js} +1 -1
  17. package/dist/chunks/{InvalidSettingsDialog-C4n3A72C.js → InvalidSettingsDialog-Br8kQOHz.js} +1 -1
  18. package/dist/chunks/MCPConnectionManager-B9n4SXN4.js +1 -0
  19. package/dist/chunks/MCPToolListView-DJ06N1DG.js +1 -0
  20. package/dist/chunks/{McpParsingWarnings-CH4yyMAL.js → McpParsingWarnings-COa71S9q.js} +1 -1
  21. package/dist/chunks/MessageSelector-o4ULADFg.js +3 -0
  22. package/dist/chunks/Messages-qqwHuAW5.js +11 -0
  23. package/dist/chunks/{Onboarding-BboWs1pp.js → Onboarding-BzuQjney.js} +1 -1
  24. package/dist/chunks/{PromptInputFooterSuggestions-BpC9COmh.js → PromptInputFooterSuggestions-to5eYBvI.js} +1 -1
  25. package/dist/chunks/PromptInputHelpMenu-CfMFx-TF.js +1 -0
  26. package/dist/chunks/QueryEngine-Dt0BKUeF.js +1 -0
  27. package/dist/chunks/REPL-CUbEDqEl.js +133 -0
  28. package/dist/chunks/REPL-DMaKNhTa.js +1 -0
  29. package/dist/chunks/RemoteSessionManager-Bf44A0Ol.js +2 -0
  30. package/dist/chunks/ResumeConversation-Ctw5Q1g9.js +1 -0
  31. package/dist/chunks/{SSETransport-1KBBUikF.js → SSETransport-DN4tCDEh.js} +3 -3
  32. package/dist/chunks/SearchExtraToolsTool-C80OdtPZ.js +1 -0
  33. package/dist/chunks/Settings-DfdcmvOV.js +2 -0
  34. package/dist/chunks/{TeleportProgress-BmgPAZAi.js → TeleportProgress-C2LQVLav.js} +1 -1
  35. package/dist/chunks/{TeleportRepoMismatchDialog-sgxNOeM_.js → TeleportRepoMismatchDialog-BZL8Zblz.js} +1 -1
  36. package/dist/chunks/{TeleportResumeWrapper-GptvrUdv.js → TeleportResumeWrapper-wPiIs8xg.js} +1 -1
  37. package/dist/chunks/{ThemePicker-gAMqqD1P.js → ThemePicker-BT_NaRQC.js} +1 -1
  38. package/dist/chunks/{TrustDialog-CWt-4Evl.js → TrustDialog-ACaJ_m7A.js} +1 -1
  39. package/dist/chunks/{ValidationErrorsList-De3kzHtz.js → ValidationErrorsList-C-hWdy_8.js} +1 -1
  40. package/dist/chunks/WelcomeV2-ZQRKlcT4.js +1 -0
  41. package/dist/chunks/add-dir-SAKTkw0S.js +1 -0
  42. package/dist/chunks/{agentDisplay-5gnCQwUY.js → agentDisplay-CuSHqgZc.js} +1 -1
  43. package/dist/chunks/{agents-Bz1MLp4A.js → agents-CMC0iQP4.js} +1 -1
  44. package/dist/chunks/agents-ZgRKpjHv.js +103 -0
  45. package/dist/chunks/allErrors-_cOQksHC.js +1 -0
  46. package/dist/chunks/{api-DzccRM_z.js → api-BbJfMXRS.js} +1 -1
  47. package/dist/chunks/api-DS1MiW01.js +1 -0
  48. package/dist/chunks/{auth-Cjnyy10u.js → auth-7mJGtlZp.js} +2 -2
  49. package/dist/chunks/auth-DGZzCbU0.js +1 -0
  50. package/dist/chunks/auth-DN1MUpB8.js +1 -0
  51. package/dist/chunks/{autoMode-CQ5nqP9c.js → autoMode-CBtY7ACs.js} +6 -6
  52. package/dist/chunks/autonomy-DuQmYhq6.js +15 -0
  53. package/dist/chunks/{autonomy-CPUCe-YU.js → autonomy-lJV7yWUl.js} +1 -1
  54. package/dist/chunks/autonomyPanel-DAQm6lDz.js +1 -0
  55. package/dist/chunks/backgroundHousekeeping-BTy71bcY.js +1 -0
  56. package/dist/chunks/backgroundHousekeeping-Cc7Ag7JG.js +17 -0
  57. package/dist/chunks/{banner-BJZNMppT.js → banner-1Wyeyawe.js} +1 -1
  58. package/dist/chunks/{bg-w3Vlsm3Y.js → bg-CJ0YWFli.js} +2 -2
  59. package/dist/chunks/bg-CeUrRz_7.js +1 -0
  60. package/dist/chunks/branch-k3kirqbA.js +3 -0
  61. package/dist/chunks/{break-cache-DXV0brco.js → break-cache-CAoZ9b72.js} +2 -2
  62. package/dist/chunks/bridgeConfig-CzRUPn-D.js +1 -0
  63. package/dist/chunks/{bridgeConfig-vORehbGG.js → bridgeConfig-UgaUfuP6.js} +1 -1
  64. package/dist/chunks/bridgeMessaging-Ci5H68MX.js +1 -0
  65. package/dist/chunks/{bridgePointer-D4W9GpWw.js → bridgePointer-BL8-lGvN.js} +1 -1
  66. package/dist/chunks/bridgeStatusUtil-C36w15ge.js +1 -0
  67. package/dist/chunks/{btw-DDUC_t0w.js → btw-nVoVuIae.js} +1 -1
  68. package/dist/chunks/caches-B8sM3Zys.js +1 -0
  69. package/dist/chunks/caches-Bp9MZ7IE.js +1 -0
  70. package/dist/chunks/{capacityWake-L7b1mMft.js → capacityWake-BOySRJUJ.js} +1 -1
  71. package/dist/chunks/ccrClient-Br4LAofR.js +1 -0
  72. package/dist/chunks/{claudeDesktop-CAmnheYx.js → claudeDesktop-Bgds1-YT.js} +1 -1
  73. package/dist/chunks/{clear-DdWexxbM.js → clear-C4Vtnbye.js} +1 -1
  74. package/dist/chunks/{cliLaunch-BWWOgBFh.js → cliLaunch-BTpfAGGI.js} +1 -1
  75. package/dist/chunks/{client-CoXtVRzi.js → client-B9404qIP.js} +1 -1
  76. package/dist/chunks/client-BCAbKdNz.js +1 -0
  77. package/dist/chunks/client-CJE6gEvU.js +1 -0
  78. package/dist/chunks/commands-DL-BzoMQ.js +1 -0
  79. package/dist/chunks/compact-Cx7BPXLU.js +2 -0
  80. package/dist/chunks/config-S5OW4Xqr.js +1 -0
  81. package/dist/chunks/config-aRiTrtCv.js +3 -0
  82. package/dist/chunks/{config-CVvUNkj2.js → config-kB2eazPX.js} +1 -1
  83. package/dist/chunks/{context-BWcfhhDj.js → context-BN7DEjoH.js} +1 -1
  84. package/dist/chunks/{context-noninteractive-c7jGVWHQ.js → context-noninteractive-D91W2B8e.js} +5 -5
  85. package/dist/chunks/context-noninteractive-DPacEFJ1.js +1 -0
  86. package/dist/chunks/conversation-D5Nbu9eT.js +1 -0
  87. package/dist/chunks/conversation-hcUx9e-C.js +1 -0
  88. package/dist/chunks/{createSSHSession-DP7B8yvb.js → createSSHSession-DecOR6M5.js} +6 -6
  89. package/dist/chunks/createSession-D27zvmOs.js +1 -0
  90. package/dist/chunks/createSession-DRqkLZWt.js +1 -0
  91. package/dist/chunks/crossProjectResume-Bw3U0Ty6.js +40 -0
  92. package/dist/chunks/cwd-Cfdf7z7s.js +1 -0
  93. package/dist/chunks/cwd-ClLru_7T.js +1 -0
  94. package/dist/chunks/datadog-bm551AVV.js +1 -0
  95. package/dist/chunks/debug-BecbSVoN.js +39 -0
  96. package/dist/chunks/{debugUtils-CezNYZ-4.js → debugUtils-CmJfIUxW.js} +1 -1
  97. package/dist/chunks/{detached-CkPpYMJj.js → detached-CIyF0M5O.js} +1 -1
  98. package/dist/chunks/detectRepository-C15umvKN.js +1 -0
  99. package/dist/chunks/detectRepository-DDfLfKcM.js +1 -0
  100. package/dist/chunks/{diff-DHzz9WAp.js → diff-DeK4bwjw.js} +1 -1
  101. package/dist/chunks/{directoryCompletion-D5AvL7TF.js → directoryCompletion-BJCu19HJ.js} +1 -1
  102. package/dist/chunks/doctor-BJORBomU.js +1 -0
  103. package/dist/chunks/earlyInput-BEjRkAtH.js +1 -0
  104. package/dist/chunks/{earlyInput-BTC_Wucv.js → earlyInput-IghoCjG5.js} +1 -1
  105. package/dist/chunks/entry-mdegyj8z.js +14 -0
  106. package/dist/chunks/esm-Ka3lhafK.js +1 -0
  107. package/dist/chunks/{execFileNoThrow-5SylUnAI.js → execFileNoThrow-DHyW8FMX.js} +2 -2
  108. package/dist/chunks/execSyncWrapper-CDzB0BM1.js +1 -0
  109. package/dist/chunks/exit-CF3KBl-S.js +1 -0
  110. package/dist/chunks/{extraUsage-Dt5mw35U.js → extraUsage-BrKbpBK-.js} +1 -1
  111. package/dist/chunks/extractMemories-4lBn134y.js +1 -0
  112. package/dist/chunks/fast-0Vi354KI.js +1 -0
  113. package/dist/chunks/{fast-ClYQcEv5.js → fast-DWn40OcQ.js} +1 -1
  114. package/dist/chunks/featureCheck-D6FjD-nt.js +1 -0
  115. package/dist/chunks/featureCheck-JOur3pHb.js +1 -0
  116. package/dist/chunks/{fileSuggestions-fNxREjpe.js → fileSuggestions-C7Pwq2yj.js} +3 -3
  117. package/dist/chunks/firstPartyEventLogger-BHjBQH0J.js +5 -0
  118. package/dist/chunks/firstPartyEventLogger-BNBnLYPK.js +1 -0
  119. package/dist/chunks/flushGate-DdJjxCes.js +1 -0
  120. package/dist/chunks/{gemini-fZ0VPU2A.js → gemini-DHv2iVfy.js} +1 -1
  121. package/dist/chunks/generateSessionName-DhS_6oHd.js +1 -0
  122. package/dist/chunks/{genericProcessUtils-BmDSLcMf.js → genericProcessUtils-B2HcDYhg.js} +1 -1
  123. package/dist/chunks/git-DBlOv64X.js +6 -0
  124. package/dist/chunks/git-DF4RFFaT.js +1 -0
  125. package/dist/chunks/githubRepoPathMapping-CK56bUDe.js +1 -0
  126. package/dist/chunks/{goal-IasZVqKh.js → goal-BZG4gtnb.js} +3 -3
  127. package/dist/chunks/{grok-Dk3LyzMa.js → grok-BS57ZhyW.js} +1 -1
  128. package/dist/chunks/{grove-BE4fQ6tG.js → grove-_zlQ83yR.js} +2 -2
  129. package/dist/chunks/help-C_2tdXHC.js +1 -0
  130. package/dist/chunks/{hooks-BrKy5XWQ.js → hooks-C7Bn7MBe.js} +2 -2
  131. package/dist/chunks/hooks-DT80Arzc.js +1 -0
  132. package/dist/chunks/initReplBridge-NkZRcM77.js +1 -0
  133. package/dist/chunks/{install-CVGZ55wV.js → install-Du-DSVzj.js} +1 -1
  134. package/dist/chunks/{instrumentation-BmWotlxR.js → instrumentation-DMs3b82f.js} +5 -5
  135. package/dist/chunks/intl-D2kgJmX7.js +1 -0
  136. package/dist/chunks/{job-DEXxW_Zo.js → job-rbX1VZmp.js} +1 -1
  137. package/dist/chunks/jwtUtils-OzxN2zts.js +1 -0
  138. package/dist/chunks/keybindings-CwdC_8S0.js +2 -0
  139. package/dist/chunks/{launchLocalMemory-CLSSVFoj.js → launchLocalMemory-BLRCK1_o.js} +2 -2
  140. package/dist/chunks/{launchOnboarding-BkJfKviO.js → launchOnboarding-Al_X75Vz.js} +1 -1
  141. package/dist/chunks/{loadAgentsDir-CKSb56Gp.js → loadAgentsDir-BL93ulMm.js} +2197 -2332
  142. package/dist/chunks/loadAgentsDir-eVKq8efm.js +1 -0
  143. package/dist/chunks/loadPluginHooks-B0au35a4.js +1 -0
  144. package/dist/chunks/{localSearch-CPOnyi8I.js → localSearch-C5ipegd9.js} +1 -1
  145. package/dist/chunks/localSearch-CZlFfR_X.js +1 -0
  146. package/dist/chunks/log-Dauqle-Z.js +1 -0
  147. package/dist/chunks/{logoV2Utils-we1sfJvf.js → logoV2Utils-CkvOihX7.js} +1 -1
  148. package/dist/chunks/{magicDocs-DmKlTQvK.js → magicDocs-DLav5QK0.js} +3 -3
  149. package/dist/chunks/main-CVNWNAoh.js +513 -0
  150. package/dist/chunks/{main-ClXu1ilx.js → main-LMyE3jXY.js} +4 -4
  151. package/dist/chunks/managedEnv-CYepSnm8.js +1 -0
  152. package/dist/chunks/{managedEnv-Cl7YbYzf.js → managedEnv-DJSCuqCb.js} +1 -1
  153. package/dist/chunks/{mappers-xQC-Z4-h.js → mappers-DQxMcezy.js} +1 -1
  154. package/dist/chunks/mcp-BAbbEaBA.js +1 -0
  155. package/dist/chunks/mcp-Ct4Sum6A.js +6 -0
  156. package/dist/chunks/mcp-D5HkCqUh.js +2 -0
  157. package/dist/chunks/{memoize-FJv2HV1u.js → memoize-FeyE7JEh.js} +1 -1
  158. package/dist/chunks/memory-COa7aUbx.js +1 -0
  159. package/dist/chunks/{mode-lYTs0XHs.js → mode-Bl2RZC8M.js} +2 -2
  160. package/dist/chunks/model-B7rtZ7KV.js +1 -0
  161. package/dist/chunks/model-Bgh_r4lg.js +1 -0
  162. package/dist/chunks/model-DiuEAv6h.js +1 -0
  163. package/dist/chunks/{modelOptions-efCGKnXT.js → modelOptions-BtEZe5BB.js} +1 -1
  164. package/dist/chunks/nativeInstaller-BEwayifa.js +1 -0
  165. package/dist/chunks/omit--yH_T4rf.js +1 -0
  166. package/dist/chunks/onChangeAppState-ZdwI7boX.js +1 -0
  167. package/dist/chunks/{openai-DJLYqiRl.js → openai-DWs4D-nQ.js} +3 -3
  168. package/dist/chunks/panel-CoNfXy3K.js +1 -0
  169. package/dist/chunks/{parser-BdCj2GrE.js → parser-BH4u7QiV.js} +1 -1
  170. package/dist/chunks/parser-BMIaRErw.js +1 -0
  171. package/dist/chunks/partition-DLcW5Oo_.js +1 -0
  172. package/dist/chunks/permissions-CaucYK3s.js +3 -0
  173. package/dist/chunks/pidLock-DgOBc1Xo.js +3 -0
  174. package/dist/chunks/{plan-BeoIjNPv.js → plan-BNYDTnQd.js} +1 -1
  175. package/dist/chunks/{platform-D6IMiyqT.js → platform-B0uTQc9P.js} +1 -1
  176. package/dist/chunks/plugin-BN-of1_H.js +17 -0
  177. package/dist/chunks/pluginAutoupdate-BBU9Jn4p.js +1 -0
  178. package/dist/chunks/pluginBlocklist-DXQlbG0P.js +1 -0
  179. package/dist/chunks/pluginCliCommands-CfdVNs8D.js +1 -0
  180. package/dist/chunks/pluginFlagging-DcJ_FQuv.js +1 -0
  181. package/dist/chunks/pluginOperations-DnhzFbYI.js +2 -0
  182. package/dist/chunks/pluginStartupCheck-CKBFaMFr.js +1 -0
  183. package/dist/chunks/pluginStartupCheck-CpNB4jxG.js +1 -0
  184. package/dist/chunks/{plugins-pmipe7kE.js → plugins-CBW7kPyp.js} +4 -4
  185. package/dist/chunks/{poorMode-BxsyllUK.js → poorMode-B_xEvuEV.js} +1 -1
  186. package/dist/chunks/poorMode-yH1o41cQ.js +1 -0
  187. package/dist/chunks/print-BZOx09SU.js +26 -0
  188. package/dist/chunks/processBashCommand-dcCNCiBp.js +1 -0
  189. package/dist/chunks/processSlashCommand-YDiM63Qr.js +5 -0
  190. package/dist/chunks/prompt-CXGy0llt.js +1 -0
  191. package/dist/chunks/prompt-DovNDmcx.js +1 -0
  192. package/dist/chunks/{prompt-CybUvG8G.js → prompt-Dx7IWhBt.js} +34 -34
  193. package/dist/chunks/{promptEditor-0Ug93P2I.js → promptEditor-WCkmpejM.js} +2 -2
  194. package/dist/chunks/{protocolHandler-ClfbHTjI.js → protocolHandler-BiVWrpHi.js} +4 -4
  195. package/dist/chunks/{proxy-Blq4W6Ox.js → proxy-CVn7o19p.js} +3 -3
  196. package/dist/chunks/reconciler-C2Nd_e4n.js +1 -0
  197. package/dist/chunks/refresh-B84H2Ezd.js +1 -0
  198. package/dist/chunks/{registerProtocol-3_ozAuDK.js → registerProtocol-E0Iu5hEx.js} +2 -2
  199. package/dist/chunks/{reload-plugins-Dn1ibOiI.js → reload-plugins-D-3AUT9g.js} +1 -1
  200. package/dist/chunks/{remoteBridgeCore-Dpg6Se9C.js → remoteBridgeCore-CV6we3ZA.js} +1 -1
  201. package/dist/chunks/remoteManagedSettings-D26Q09-7.js +1 -0
  202. package/dist/chunks/rename-CSavuBIE.js +1 -0
  203. package/dist/chunks/{renderOptions-CLcco6fc.js → renderOptions-DDLbSMQU.js} +1 -1
  204. package/dist/chunks/resume-CROylN3J.js +2 -0
  205. package/dist/chunks/ripgrep-2M1GkXqJ.js +1 -0
  206. package/dist/chunks/{ripgrep-DkL2S7-I.js → ripgrep-C1ydIMzT.js} +5 -5
  207. package/dist/chunks/{runtimeObserver-DonWCJOx.js → runtimeObserver-L7pSIWBT.js} +4 -4
  208. package/dist/chunks/{runtimeObserver-B0xfyLiA.js → runtimeObserver-OU8KrZQG.js} +1 -1
  209. package/dist/chunks/sandbox-adapter-6UwMLh6e.js +1 -0
  210. package/dist/chunks/{sandbox-toggle-CSdnHWp-.js → sandbox-toggle-YrQNWGsr.js} +1 -1
  211. package/dist/chunks/searchExtraTools-Bdv5HJ74.js +1 -0
  212. package/dist/chunks/{session-BbQlh2S5.js → session-DUYsfPy_.js} +2 -2
  213. package/dist/chunks/sessionFileAccessHooks-Czen7Ejz.js +1 -0
  214. package/dist/chunks/sessionObserver-B0zucj_c.js +1 -0
  215. package/dist/chunks/{sessionObserver-XV6N0XER.js → sessionObserver-Dv3Ba8eA.js} +2 -2
  216. package/dist/chunks/sessionState-D-SaBzWD.js +11 -0
  217. package/dist/chunks/sessionStorage-BM1x51Z7.js +1 -0
  218. package/dist/chunks/{sessionTitle-E1FvsKM9.js → sessionTitle-uCuYaNif.js} +2 -2
  219. package/dist/chunks/{sessionTracing-ClGQ08jM.js → sessionTracing-Bqb3vJTt.js} +3 -3
  220. package/dist/chunks/settings-BG15IFYx.js +1 -0
  221. package/dist/chunks/settings-D4CpDv2y.js +20 -0
  222. package/dist/chunks/settingsSync-BSrpnyqo.js +1 -0
  223. package/dist/chunks/setup-C62oq4AZ.js +3 -0
  224. package/dist/chunks/{shadowedRuleDetection-B9iSx6mB.js → shadowedRuleDetection-BzAZ57p2.js} +1 -1
  225. package/dist/chunks/{shellQuote-Bth6IZgX.js → shellQuote-DS6WrivY.js} +2 -2
  226. package/dist/chunks/{sideQuestion-D2dPToW8.js → sideQuestion-CvMBBjI8.js} +3 -3
  227. package/dist/chunks/sinks-WJ7nzLQs.js +1 -0
  228. package/dist/chunks/sinks-f7qYjbKJ.js +2 -0
  229. package/dist/chunks/skillChangeDetector-U5kRU5nd.js +1 -0
  230. package/dist/chunks/{skillGapStore-DylpOKJ6.js → skillGapStore-CqaT8c0C.js} +2 -2
  231. package/dist/chunks/{skillLifecycle-GK-8eyyn.js → skillLifecycle-CnR8IqJM.js} +2 -2
  232. package/dist/chunks/skillSearchPanel-D9qrOXpI.js +21 -0
  233. package/dist/chunks/{skills-t6krW8GZ.js → skills-BgcFh0vy.js} +1 -1
  234. package/dist/chunks/startupProfiler-B4HBBbHN.js +1 -0
  235. package/dist/chunks/{startupProfiler-jeId9f2i.js → startupProfiler-CmH_aVy2.js} +3 -3
  236. package/dist/chunks/state-BemZdQIl.js +1 -0
  237. package/dist/chunks/state-D_lk6z-C.js +1 -0
  238. package/dist/chunks/{stats-BJBhl-Lc.js → stats-B8uQ-UDi.js} +1 -1
  239. package/dist/chunks/{status-BtsnKNVY.js → status-BekdWoIj.js} +1 -1
  240. package/dist/chunks/{status-nZQEar7T.js → status-D6KlRJmR.js} +2 -2
  241. package/dist/chunks/statusNoticeHelpers-BMM8_uJ1.js +1 -0
  242. package/dist/chunks/{stringUtils-CbS6OkmE.js → stringUtils-C8PaYpQF.js} +1 -1
  243. package/dist/chunks/switcher-Ck9CrXrr.js +1 -0
  244. package/dist/chunks/{switcher-77h2J5HC.js → switcher-DnAhkyIn.js} +1 -1
  245. package/dist/chunks/syncCache-ClP9aBqK.js +1 -0
  246. package/dist/chunks/{tasks-BNrdmF9p.js → tasks-Dmh6qikm.js} +1 -1
  247. package/dist/chunks/teleport-DH3IuAUQ.js +1 -0
  248. package/dist/chunks/{templateJobs-Dkv4I9c1.js → templateJobs-CxqU-s5i.js} +1 -1
  249. package/dist/chunks/{terminalSetup-DQopnSPR.js → terminalSetup-BKGcmlWp.js} +1 -1
  250. package/dist/chunks/{terminalSetup-DTGm1Eo2.js → terminalSetup-Cy19F1Js.js} +4 -4
  251. package/dist/chunks/{theme-BjpBVRf5.js → theme-U7lMFHQ0.js} +1 -1
  252. package/dist/chunks/{tmux-CMRiI6CD.js → tmux-D5EvHWi3.js} +1 -1
  253. package/dist/chunks/{toolEventObserver-D-sNBvOe.js → toolEventObserver-D9qjoVl5.js} +1 -1
  254. package/dist/chunks/toolPool-69mfSPAs.js +1 -0
  255. package/dist/chunks/trustedDevice-B6AKlsl_.js +1 -0
  256. package/dist/chunks/trustedDevice-DL0pWP4_.js +1 -0
  257. package/dist/chunks/{types-DWRxAH0E.js → types-DafcFtmb.js} +2 -2
  258. package/dist/chunks/udsClient-CWnfsgFP.js +1 -0
  259. package/dist/chunks/updateCCB-C6XftzIG.js +11 -0
  260. package/dist/chunks/{upstreamproxy-DDVMwoRi.js → upstreamproxy-CXmjxHpl.js} +2 -2
  261. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-D2FvHieH.js → useExitOnCtrlCDWithKeybindings-DEEJhm_W.js} +1 -1
  262. package/dist/chunks/useMainLoopModel-6w7mhwhU.js +1 -0
  263. package/dist/chunks/useManagePlugins-CjnsO-Of.js +1 -0
  264. package/dist/chunks/{useMergedTools-B-Z9XQ6U.js → useMergedTools-DbhqKk1-.js} +1 -1
  265. package/dist/chunks/{useSearchInput-C6d6nt9S.js → useSearchInput-gUDbkLaC.js} +1 -1
  266. package/dist/chunks/useSettingsErrors-CgPad-H0.js +1 -0
  267. package/dist/chunks/{userAgent-Ng_TTjWr.js → userAgent-CU7Ndh79.js} +1 -1
  268. package/dist/chunks/util-B4oMhJKh.js +1 -0
  269. package/dist/chunks/validatePlugin-y_O_tCEL.js +1 -0
  270. package/dist/chunks/{vim-3mUqsEJm.js → vim-w37BfGZ5.js} +1 -1
  271. package/dist/chunks/{which-DznMOwny.js → which-BRWBO7Gu.js} +1 -1
  272. package/dist/chunks/windowsPaths-BY-IVNwQ.js +1 -0
  273. package/dist/chunks/windowsPaths-DtWHLjmE.js +1 -0
  274. package/dist/chunks/{workSecret-DtiFreRl.js → workSecret-BEhXgH2M.js} +1 -1
  275. package/dist/chunks/workerRegistry-Bq9bS5pw.js +6 -0
  276. package/dist/chunks/worktree-4SUJ4dtz.js +1 -0
  277. package/dist/cli.js +1 -1
  278. package/package.json +2 -3
  279. package/dist/chunks/ApproveApiKey-D05WywHU.js +0 -1
  280. package/dist/chunks/ApproveApiKey-DHAbdwkC.js +0 -1
  281. package/dist/chunks/BackgroundTasksDialog-QgFwoaaC.js +0 -2
  282. package/dist/chunks/ClaudeMdExternalIncludesDialog-DpecRCAt.js +0 -1
  283. package/dist/chunks/ConsoleOAuthFlow-D1MYL1dJ.js +0 -1
  284. package/dist/chunks/Doctor-D160J8Ad.js +0 -3
  285. package/dist/chunks/Doctor-VhJi2cmL.js +0 -1
  286. package/dist/chunks/ExitFlow-CoWHhKHJ.js +0 -2
  287. package/dist/chunks/MCPConnectionManager-DPFe4hPh.js +0 -1
  288. package/dist/chunks/MCPToolListView-BPmE0C2o.js +0 -1
  289. package/dist/chunks/MessageSelector-kOn2GaU-.js +0 -3
  290. package/dist/chunks/Messages-4EnHFeh1.js +0 -11
  291. package/dist/chunks/PromptInputHelpMenu-BvcAzbSi.js +0 -1
  292. package/dist/chunks/QueryEngine-J6ElcO16.js +0 -1
  293. package/dist/chunks/REPL-DBjbAJsm.js +0 -133
  294. package/dist/chunks/REPL-oBemMXvp.js +0 -1
  295. package/dist/chunks/RemoteSessionManager-CoIyFKKa.js +0 -2
  296. package/dist/chunks/ResumeConversation-wBG8OD9P.js +0 -1
  297. package/dist/chunks/SearchExtraToolsTool-BugrzImr.js +0 -1
  298. package/dist/chunks/Settings-DptKuJE7.js +0 -2
  299. package/dist/chunks/WelcomeV2-BWF-cJOu.js +0 -1
  300. package/dist/chunks/add-dir-DBVT1cEK.js +0 -1
  301. package/dist/chunks/agents-CnwTOlqO.js +0 -103
  302. package/dist/chunks/allErrors-DYw_q14e.js +0 -1
  303. package/dist/chunks/api-DXDXTFGa.js +0 -1
  304. package/dist/chunks/attributionTrailer-oKKrF3z8.js +0 -1
  305. package/dist/chunks/auth-CnLb6RWc.js +0 -1
  306. package/dist/chunks/auth-D-SGHS0K.js +0 -1
  307. package/dist/chunks/autonomy-dSJl0hN1.js +0 -15
  308. package/dist/chunks/autonomyPanel-Ccr9ilei.js +0 -1
  309. package/dist/chunks/backgroundHousekeeping--cs5crp7.js +0 -17
  310. package/dist/chunks/backgroundHousekeeping-CcbHitKC.js +0 -1
  311. package/dist/chunks/bg-DWloqGwk.js +0 -1
  312. package/dist/chunks/branch-CG0AKS1J.js +0 -3
  313. package/dist/chunks/bridgeConfig-Dmc1ZDev.js +0 -1
  314. package/dist/chunks/bridgeMessaging-DlczTV9X.js +0 -1
  315. package/dist/chunks/caches-1IFb6_M_.js +0 -1
  316. package/dist/chunks/caches-CB8MHqy2.js +0 -1
  317. package/dist/chunks/ccrClient-CG6HTv_n.js +0 -1
  318. package/dist/chunks/client-Crrwkw7g.js +0 -1
  319. package/dist/chunks/client-D8hKghba.js +0 -1
  320. package/dist/chunks/color-Cuq0c6xy.js +0 -1
  321. package/dist/chunks/commands-D3sESsTp.js +0 -1
  322. package/dist/chunks/compact-DIpwuBDq.js +0 -2
  323. package/dist/chunks/config-D4G8_MqJ.js +0 -3
  324. package/dist/chunks/config-q9D4hFiK.js +0 -1
  325. package/dist/chunks/context-noninteractive-Bwt9A3XD.js +0 -1
  326. package/dist/chunks/conversation-Bjo_8kia.js +0 -1
  327. package/dist/chunks/conversation-DrHZIQX2.js +0 -1
  328. package/dist/chunks/createSession-CPo6GBSb.js +0 -1
  329. package/dist/chunks/createSession-DnykRoia.js +0 -1
  330. package/dist/chunks/crossProjectResume-D2A-qjgP.js +0 -40
  331. package/dist/chunks/cwd--q1ONL7P.js +0 -1
  332. package/dist/chunks/cwd-L4wygFqJ.js +0 -1
  333. package/dist/chunks/daemon-D2vFIVOz.js +0 -2
  334. package/dist/chunks/datadog-DrmHyl3_.js +0 -1
  335. package/dist/chunks/debug-BdqxZ7rV.js +0 -39
  336. package/dist/chunks/detectRepository-DA1Q_Skc.js +0 -1
  337. package/dist/chunks/detectRepository-DvxoaPlk.js +0 -1
  338. package/dist/chunks/doctor-PWqB46xd.js +0 -1
  339. package/dist/chunks/earlyInput-xcoTbKQn.js +0 -1
  340. package/dist/chunks/entry-4JtoJONR.js +0 -14
  341. package/dist/chunks/esm-DcIr7tVd.js +0 -1
  342. package/dist/chunks/execSyncWrapper-DKuxVTaf.js +0 -1
  343. package/dist/chunks/exit-OW9g7b9A.js +0 -1
  344. package/dist/chunks/extractMemories-1VlmCGwa.js +0 -1
  345. package/dist/chunks/fast-CrvLdpy3.js +0 -1
  346. package/dist/chunks/featureCheck-CrJeuheQ.js +0 -1
  347. package/dist/chunks/featureCheck-HslM03dr.js +0 -1
  348. package/dist/chunks/firstPartyEventLogger-BBXEQUf0.js +0 -1
  349. package/dist/chunks/firstPartyEventLogger-DhEPWcit.js +0 -5
  350. package/dist/chunks/flushGate-ch-Tvwjj.js +0 -1
  351. package/dist/chunks/generateRecap-BIBVlB__.js +0 -1
  352. package/dist/chunks/generateSessionName-nZj_VvKZ.js +0 -1
  353. package/dist/chunks/git-B9uvt96d.js +0 -6
  354. package/dist/chunks/git-BfS5Hk4S.js +0 -1
  355. package/dist/chunks/githubRepoPathMapping-Cqx3pSfc.js +0 -1
  356. package/dist/chunks/help-D2-v9Ug9.js +0 -1
  357. package/dist/chunks/hooks-DGd02IKF.js +0 -1
  358. package/dist/chunks/initReplBridge-RhCAlmHE.js +0 -1
  359. package/dist/chunks/intl-cKc-V6Mq.js +0 -1
  360. package/dist/chunks/jwtUtils-C9sdGhvT.js +0 -1
  361. package/dist/chunks/keybindings-BRdSOSUD.js +0 -2
  362. package/dist/chunks/language-C0cIpKE2.js +0 -1
  363. package/dist/chunks/language-CxThoWRC.js +0 -1
  364. package/dist/chunks/loadAgentsDir-8UprzS4w.js +0 -1
  365. package/dist/chunks/loadPluginHooks-LbaURHVH.js +0 -1
  366. package/dist/chunks/localSearch-DNjbr4S9.js +0 -1
  367. package/dist/chunks/log-CTFl4qpD.js +0 -1
  368. package/dist/chunks/main-BIiwW4mM.js +0 -605
  369. package/dist/chunks/managedEnv-CpiiQx_v.js +0 -1
  370. package/dist/chunks/mcp-B_m1XBDt.js +0 -6
  371. package/dist/chunks/mcp-BiyfH9Sd.js +0 -1
  372. package/dist/chunks/mcp-BjlaPUWX.js +0 -2
  373. package/dist/chunks/memory-LN8f_p2b.js +0 -1
  374. package/dist/chunks/model-C2e73CJD.js +0 -1
  375. package/dist/chunks/model-CvmS-Esk.js +0 -1
  376. package/dist/chunks/model-DJ8mFfuR.js +0 -1
  377. package/dist/chunks/nativeInstaller-DQIFwdat.js +0 -1
  378. package/dist/chunks/omit-CLPZGevl.js +0 -1
  379. package/dist/chunks/onChangeAppState-DhBO34OK.js +0 -1
  380. package/dist/chunks/panel-q0_iT9cg.js +0 -1
  381. package/dist/chunks/panelCall-sum-3zvi.js +0 -1
  382. package/dist/chunks/parser-BcdhBGx0.js +0 -1
  383. package/dist/chunks/partition-CpfoVrg1.js +0 -1
  384. package/dist/chunks/permissions-DTb9wkAP.js +0 -3
  385. package/dist/chunks/pidLock-BR5M6RQw.js +0 -3
  386. package/dist/chunks/pipeTransport-B3TIkTAp.js +0 -1
  387. package/dist/chunks/plugin-D_dHjTud.js +0 -17
  388. package/dist/chunks/pluginAutoupdate-BHKlOOXI.js +0 -1
  389. package/dist/chunks/pluginBlocklist-D93Hd1GF.js +0 -1
  390. package/dist/chunks/pluginCliCommands-vv0wNt4O.js +0 -1
  391. package/dist/chunks/pluginFlagging-CxuRF2Vc.js +0 -1
  392. package/dist/chunks/pluginOperations-BTq4AjYB.js +0 -2
  393. package/dist/chunks/pluginStartupCheck-B6leNWq9.js +0 -1
  394. package/dist/chunks/pluginStartupCheck-DBOCHUHQ.js +0 -1
  395. package/dist/chunks/poorMode-iV1NwC5L.js +0 -1
  396. package/dist/chunks/print-CAUvczBM.js +0 -23
  397. package/dist/chunks/processBashCommand-CdeQg_c6.js +0 -1
  398. package/dist/chunks/processSlashCommand-CbkshIC6.js +0 -5
  399. package/dist/chunks/prompt-RBn4JdEg.js +0 -1
  400. package/dist/chunks/prompt-Rb8zXlDo.js +0 -1
  401. package/dist/chunks/reconciler-Drq3HSkj.js +0 -4
  402. package/dist/chunks/refresh-D8TLHO_T.js +0 -1
  403. package/dist/chunks/remoteManagedSettings-CCrq-qL-.js +0 -1
  404. package/dist/chunks/rename-CKsSc7Z3.js +0 -1
  405. package/dist/chunks/replBridgeHandle-DNC797_T.js +0 -1
  406. package/dist/chunks/resume-B1a5gLVR.js +0 -2
  407. package/dist/chunks/ripgrep-BisRODQ2.js +0 -1
  408. package/dist/chunks/sandbox-adapter-BnBOSkKJ.js +0 -1
  409. package/dist/chunks/searchExtraTools-DbgfnQkH.js +0 -1
  410. package/dist/chunks/sessionFileAccessHooks-Xfr1NiXG.js +0 -1
  411. package/dist/chunks/sessionMemory-7UOFdp29.js +0 -1
  412. package/dist/chunks/sessionMemory-fAzgAS7Q.js +0 -1
  413. package/dist/chunks/sessionMemoryUtils-DVjFw5Bd.js +0 -1
  414. package/dist/chunks/sessionObserver-Cl26OdaW.js +0 -1
  415. package/dist/chunks/sessionState-BvECKycx.js +0 -11
  416. package/dist/chunks/sessionStorage-DSj9yZkl.js +0 -1
  417. package/dist/chunks/settings-B-R9ZJNY.js +0 -1
  418. package/dist/chunks/settings-Xbq6AaD-.js +0 -20
  419. package/dist/chunks/settingsSync-NCN0a4sc.js +0 -1
  420. package/dist/chunks/setup-uZ0dSekt.js +0 -3
  421. package/dist/chunks/sinks-C7q46rvE.js +0 -2
  422. package/dist/chunks/sinks-D3bXeHlQ.js +0 -1
  423. package/dist/chunks/skillChangeDetector-C1EJ7rUL.js +0 -1
  424. package/dist/chunks/skillSearchPanel-mpaC62y4.js +0 -21
  425. package/dist/chunks/startupProfiler-BaiXZ9tr.js +0 -1
  426. package/dist/chunks/state-B4HwLt8i.js +0 -1
  427. package/dist/chunks/state-Bs5xweDL.js +0 -1
  428. package/dist/chunks/statusNoticeHelpers-DMqRGFOh.js +0 -1
  429. package/dist/chunks/switcher-B2CYzCC_.js +0 -1
  430. package/dist/chunks/syncCache-By_-buUC.js +0 -1
  431. package/dist/chunks/teleport-mdnhIZBj.js +0 -1
  432. package/dist/chunks/toolPool-Di30gn_Y.js +0 -1
  433. package/dist/chunks/trustedDevice-CupLMpO8.js +0 -1
  434. package/dist/chunks/trustedDevice-j1u2TG5U.js +0 -1
  435. package/dist/chunks/udsClient-Cm3HqYUu.js +0 -1
  436. package/dist/chunks/updateCCB-BlUAU2Vp.js +0 -11
  437. package/dist/chunks/useMainLoopModel-ylPQNj7Z.js +0 -1
  438. package/dist/chunks/useManagePlugins-BbWJNLe8.js +0 -1
  439. package/dist/chunks/useSettingsErrors-DKh4rkGi.js +0 -1
  440. package/dist/chunks/util-D-X8i5Z2.js +0 -1
  441. package/dist/chunks/validatePlugin-DSw08u76.js +0 -1
  442. package/dist/chunks/windowsPaths-1mgenSWa.js +0 -1
  443. package/dist/chunks/windowsPaths-BVztIhXM.js +0 -1
  444. package/dist/chunks/workerRegistry-DdOYjLm3.js +0 -6
  445. package/dist/chunks/worktree-BX1ULzrw.js +0 -1
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ar as t,BT as n,FT as r,Ft as i,Gg as a,Hs as o,Ix as s,Ji as c,Li as ee,PT as l,Pc as te,Qh as ne,Ri as re,Si as u,St as d,Tt as ie,Ug as f,VT as p,Vg as ae,Vs as oe,Wg as m,Yv as h,Zh as g,Zv as _,bv as se,di as ce,ei as le,fi as ue,hE as de,hn as fe,ix as pe,jt as v,jx as y,kc as me,lD as he,mE as ge,m_ as _e,my as ve,oD as ye,p_ as be,py as b,qn as x,rx as S,uD as C,vl as w,vn as T,xv as E,yi as D,yl as O}from"./loadAgentsDir-CKSb56Gp.js";import{Fn as k,Hn as A,Kt as j,Pn as M,Y as N,fr as xe,h as Se,lr as Ce,mt as P,pr as we}from"./state-Bs5xweDL.js";import{n as Te,t as F}from"./cwd-L4wygFqJ.js";import{a as I,d as Ee,l as L,nt as De,p as Oe,rt as R}from"./debug-BdqxZ7rV.js";import{n as ke,r as Ae}from"./analytics-DJobLaWP.js";import{C as je,_ as Me}from"./model-C2e73CJD.js";import{Rt as Ne}from"./prompt-CybUvG8G.js";import*as z from"path";import{dirname as Pe}from"path";j(),ne(),S(),Ne(),ve(),s(),he(),me(),Te(),I(),_(),Me(),r(),se(),t(),n(),_e(),ie();function Fe(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.type!==`assistant`)continue;let r=n.message.content.find(e=>e.type===`tool_use`&&e.name===`TodoWrite`);if(!r||r.type!==`tool_use`)continue;let i=r.input;if(typeof i!=`object`||!i)return[];let a=be().safeParse(i.todos);return a.success?a.data:[]}return[]}function Ie(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&h(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),e.attributionSnapshots&&e.attributionSnapshots.length>0&&ye(e.attributionSnapshots,e=>{t(t=>({...t,attribution:e}))}),!p()&&e.messages&&e.messages.length>0){let n=Fe(e.messages);if(n.length>0){let e=P();t(t=>({...t,todos:{...t.todos,[e]:n}}))}}}function Le(e){if(e.attributionSnapshots&&e.attributionSnapshots.length>0)return C(e.attributionSnapshots)}function B(e,t){if(!(!e&&!t))return{name:e??``,color:t==="default"?void 0:t}}function V(e,t,n){if(t)return{agentDefinition:t,agentType:void 0};if(!e)return k(void 0),{agentDefinition:void 0,agentType:void 0};let r=n.activeAgents.find(t=>t.agentType===e);return r?(k(r.agentType),!N()&&r.model&&r.model!==`inherit`&&M(je(r.model)),{agentDefinition:r,agentType:r.agentType}):(L(`Resumed session had agent "${e}" but it is no longer available. Using default behavior.`),k(void 0),{agentDefinition:void 0,agentType:void 0})}function H(e){let t=d();if(t){u(t);return}if(e){try{process.chdir(e.worktreePath)}catch{u(null);return}E(e.worktreePath),A(F()),v(e),y(),g(),l.cache.clear?.()}}function Re(){let e=d();if(e){v(null),y(),g(),l.cache.clear?.();try{process.chdir(e.originalCwd)}catch{return}E(e.originalCwd),A(F())}}async function ze(t,n,r){if(n.forkSession)t.contentReplacements?.length&&await le(t.contentReplacements);else{let e=n.sessionIdOverride??t.sessionId;e&&(Ce(b(e),n.transcriptPath?Pe(n.transcriptPath):null),await ce(),pe(e))}if(ue(n.forkSession?{...t,worktreeSession:void 0}:t),t.goal){let{hydrateGoalFromTranscript:r}=(O(),e(w)),i=new Map,a=n.sessionIdOverride??t.sessionId??P();i.set(a,t.goal),r(i,a)}n.forkSession||(H(t.worktreeSession),x());let{agentDefinition:i,agentType:a}=V(t.agentSetting,r.mainThreadAgentDefinition,r.agentDefinitions);D(`normal`);let o=n.includeAttribution?Le(t):void 0,s=B(t.agentName,t.agentColor);te(t.agentName);let c=r.agentDefinitions;return{messages:t.messages,fileHistorySnapshots:t.fileHistorySnapshots,contentReplacements:t.contentReplacements,agentName:t.agentName,agentColor:t.agentColor==="default"?void 0:t.agentColor,restoredAgentDef:i,initialState:{...r.initialState,...a&&{agent:a},...o&&{attribution:o},...s&&{standaloneAgentContext:s},agentDefinitions:c}}}de(),j(),c(),ke(),m(),oe(),De(),I(),Oe(),T(),we();var Be=1e3,Ve=500,He=300,Ue=2e3,We=typeof Bun<`u`,U=null,W=null,G=new Set,K=!1,q=!1,J=!1,Y=null,X=xe(),Z=null;async function Ge(){if(K||q)return;K=!0,J||(J=!0,a(()=>{ee(),X.emit()}));let e=await qe();e.length!==0&&(L(`Watching for changes in skill/command directories: ${e.join(`, `)}...`),U=ge.watch(e,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:Z?.stabilityThreshold??Be,pollInterval:Z?.pollInterval??Ve},ignored:(e,t)=>t&&!t.isFile()&&!t.isDirectory()?!0:e.split(z.sep).some(e=>e===`.git`),ignorePermissionErrors:!0,usePolling:We,interval:Z?.chokidarInterval??Ue,atomic:!0}),U.on(`add`,$),U.on(`change`,$),U.on(`unlink`,$),Y=R(async()=>{await Q()}))}function Q(){q=!0,Y&&(Y(),Y=null);let e=Promise.resolve();return U&&(e=U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),e}var Ke=X.subscribe;async function qe(){let e=Ee(),t=[],n=f(`userSettings`,`skills`);if(n)try{await e.stat(n),t.push(n)}catch{}let r=f(`userSettings`,`commands`);if(r)try{await e.stat(r),t.push(r)}catch{}let i=f(`projectSettings`,`skills`);if(i)try{let n=z.resolve(i);await e.stat(n),t.push(n)}catch{}let a=f(`projectSettings`,`commands`);if(a)try{let n=z.resolve(a);await e.stat(n),t.push(n)}catch{}for(let n of Se()){let r=z.join(n,`.claude`,`skills`);try{await e.stat(r),t.push(r)}catch{}}return t}function $(e){L(`Detected skill change: ${e}`),Ae(`tengu_skill_file_changed`,{source:`chokidar`}),Je(e)}function Je(e){G.add(e),W&&clearTimeout(W),W=setTimeout(async()=>{W=null;let e=[...G];if(G.clear(),fe(await i(`skills`,e[0]))){L(`ConfigChange hook blocked skill reload (${e.length} paths)`);return}ae(),re(),o(),X.emit()},Z?.reloadDebounce??He)}async function Ye(e){U&&(await U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),K=!1,q=!1,Z=e??null}var Xe={initialize:Ge,dispose:Q,subscribe:Ke,resetForTesting:Ye};export{V as a,ze as i,B as n,Ie as o,Re as r,H as s,Xe as t};
@@ -1,21 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Lf as n,Rf as r,hd as i,vd as a}from"./loadAgentsDir-CKSb56Gp.js";import{I as o,P as s,fi as c,hn as l,t as u,y as d}from"./src-P_wYS_NJ2.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";function p(){return[`Skill Search (自动技能匹配)`,`Status: ${r()?`enabled`:`disabled`}`,``,`When enabled, relevant skills are automatically matched and`,`injected into conversation context each turn.`].join(`
2
- `)}async function m(){if(r()&&process.env.SKILL_SEARCH_ENABLED!==`0`)return`Skill Search: already enabled`;process.env.SKILL_SEARCH_ENABLED=`1`;let e=[`Skill Search: enabled (SKILL_SEARCH_ENABLED=1)`];try{let{clearSkillIndexCache:t}=await import(`./localSearch-DNjbr4S9.js`);t(),e.push(`Skill index cache: cleared (will rebuild on next search)`)}catch{e.push(`Skill index cache: clear skipped`)}return e.join(`
3
- `)}async function h(){return r()?(process.env.SKILL_SEARCH_ENABLED=`0`,`Skill Search: disabled (SKILL_SEARCH_ENABLED=0)`):`Skill Search: already disabled`}function g({onDone:e}){a(`skill-search-panel`);let[t,n]=(0,v.useState)(0),r=(0,v.useMemo)(()=>[{label:`Status`,description:`Show whether automatic skill matching is active`,run:()=>Promise.resolve(p())},{label:`Start`,description:`Enable automatic skill matching for this session`,run:m},{label:`Stop`,description:`Disable automatic skill matching for this session`,run:h},{label:`About`,description:`How automatic skill matching works`,run:()=>Promise.resolve(x)}],[]),i=()=>{let n=r[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return l((e,t)=>{if(t.upArrow){n(e=>Math.max(0,e-1));return}if(t.downArrow){n(e=>Math.min(r.length-1,e+1));return}t.return&&i()}),(0,y.jsx)(d,{title:`Skill Search`,subtitle:`${r.length} actions`,onCancel:()=>e(`Skill search panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,y.jsxs)(o,{flexDirection:`column`,children:[r.map((e,n)=>(0,y.jsxs)(o,{flexDirection:`row`,children:[(0,y.jsx)(s,{children:`${n===t?`›`:` `} ${e.label}`.padEnd(b)}),(0,y.jsx)(s,{dimColor:!0,children:e.description})]},e.label)),(0,y.jsx)(o,{marginTop:1,children:(0,y.jsx)(s,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function _(e,t,n){let r=n?.trim()??``;return r===`start`?(e(await m(),{display:`system`}),null):r===`stop`?(e(await h(),{display:`system`}),null):r===`about`?(e(x,{display:`system`}),null):r===`status`?(e(p(),{display:`system`}),null):(0,y.jsx)(g,{onDone:e})}var v,y,b,x;e((()=>{v=t(c(),1),u(),i(),n(),y=f(),b=28,x=`# Skill Search (自动技能匹配)
4
-
5
- Skill Search 控制对话中的自动技能匹配功能。
6
-
7
- 启用后,Work Mate 会在每轮对话中自动搜索并加载与当前任务最相关的 skill 文件,
8
- 无需手动指定。搜索基于 TF-IDF 向量余弦相似度,支持英文词干化和 CJK bi-gram 分词。
9
-
10
- ## 工作原理
11
- 1. 对话开始时,自动索引 .claude/skills/ 和 ~/.claude/skills/ 下的 Markdown 文件
12
- 2. 每轮对话根据上下文自动匹配最相关的 skill
13
- 3. 匹配到的 skill 内容会作为上下文注入,指导 Work Mate 的行为
14
-
15
- ## 控制方式
16
- - /skill-search start — 启用自动匹配
17
- - /skill-search stop — 禁用自动匹配
18
- - /skill-search status — 查看当前状态
19
-
20
- 当前状态: ${r()?`已启用`:`未启用`}
21
- `}))();export{_ as call};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./startupProfiler-jeId9f2i.js";e();export{t as profileCheckpoint};
@@ -1 +0,0 @@
1
- import{Hn as e,Kt as t,mt as n,pn as r,t as i}from"./state-Bs5xweDL.js";t();export{i as addInvokedSkill,n as getSessionId,r as setCwdState,e as setOriginalCwd};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,c as n,i as r,l as i,n as a,o,r as s,s as c,t as l,u}from"./isObject-C6qM3WEW.js";import{a as d,c as f,d as p,f as m,g as h,h as g,i as _,l as v,m as y,n as ee,o as te,p as ne,r as re,s as ie,t as ae,u as oe}from"./memoize-BK3gG5ob.js";import{i as b,n as se,r as x,t as ce}from"./isSymbol-BO6cdPI7.js";import{realpathSync as le}from"fs";import{randomUUID as ue}from"crypto";import{cwd as de}from"process";function fe(){this.__data__=new ie,this.size=0}var pe=e((()=>{f()}));function me(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var he=e((()=>{}));function ge(e){return this.__data__.get(e)}var _e=e((()=>{}));function ve(e){return this.__data__.has(e)}var ye=e((()=>{}));function be(e,t){var n=this.__data__;if(n instanceof ie){var r=n.__data__;if(!d||r.length<xe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new re(r)}return n.set(e,t),this.size=n.size,this}var xe,Se=e((()=>{f(),te(),_(),xe=200}));function S(e){var t=this.__data__=new ie(e);this.size=t.size}var Ce=e((()=>{f(),pe(),he(),_e(),ye(),Se(),S.prototype.clear=fe,S.prototype.delete=me,S.prototype.get=ge,S.prototype.has=ve,S.prototype.set=be}));function we(e){return this.__data__.set(e,Te),this}var Te,Ee=e((()=>{Te=`__lodash_hash_undefined__`}));function De(e){return this.__data__.has(e)}var Oe=e((()=>{}));function C(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new re;++t<n;)this.add(e[t])}var ke=e((()=>{_(),Ee(),Oe(),C.prototype.add=C.prototype.push=we,C.prototype.has=De}));function Ae(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var je=e((()=>{}));function Me(e,t){return e.has(t)}var Ne=e((()=>{}));function Pe(e,t,n,r,i,a){var o=n&Fe,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Ie?new C:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!Ae(t,function(e,t){if(!Me(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}var Fe,Ie,Le=e((()=>{ke(),je(),Ne(),Fe=1,Ie=2})),w,Re=e((()=>{c(),w=n.Uint8Array}));function ze(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}var Be=e((()=>{}));function Ve(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var He=e((()=>{}));function Ue(e,t,n,r,i,a,o){switch(n){case nt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case tt:return!(e.byteLength!=t.byteLength||!a(new w(e),new w(t)));case Ke:case qe:case Xe:return v(+e,+t);case Je:return e.name==t.name&&e.message==t.message;case Ze:case $e:return e==t+``;case Ye:var s=ze;case Qe:var c=r&We;if(s||(s=Ve),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=Ge,o.set(e,t);var u=Pe(s(e),s(t),r,i,a,o);return o.delete(e),u;case et:if(T)return T.call(e)==T.call(t)}return!1}var We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,T,it=e((()=>{o(),Re(),oe(),Le(),Be(),He(),We=1,Ge=2,Ke=`[object Boolean]`,qe=`[object Date]`,Je=`[object Error]`,Ye=`[object Map]`,Xe=`[object Number]`,Ze=`[object RegExp]`,Qe=`[object Set]`,$e=`[object String]`,et=`[object Symbol]`,tt=`[object ArrayBuffer]`,nt=`[object DataView]`,rt=t?t.prototype:void 0,T=rt?rt.valueOf:void 0}));function at(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var ot=e((()=>{})),E,D=e((()=>{E=Array.isArray}));function st(e,t,n){var r=t(e);return E(e)?r:at(r,n(e))}var ct=e((()=>{ot(),D()}));function lt(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}var ut=e((()=>{}));function dt(){return[]}var ft=e((()=>{})),pt,mt,ht,gt=e((()=>{ut(),ft(),pt=Object.prototype.propertyIsEnumerable,mt=Object.getOwnPropertySymbols,ht=mt?function(e){return e==null?[]:(e=Object(e),lt(mt(e),function(t){return pt.call(e,t)}))}:dt}));function _t(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var vt=e((()=>{}));function yt(e){return b(e)&&s(e)==bt}var bt,xt=e((()=>{r(),x(),bt=`[object Arguments]`})),St,Ct,wt,O,Tt=e((()=>{xt(),x(),St=Object.prototype,Ct=St.hasOwnProperty,wt=St.propertyIsEnumerable,O=yt(function(){return arguments}())?yt:function(e){return b(e)&&Ct.call(e,`callee`)&&!wt.call(e,`callee`)}}));function Et(){return!1}var Dt=e((()=>{})),Ot,kt,At,k,jt=e((()=>{c(),Dt(),Ot=typeof exports==`object`&&exports&&!exports.nodeType&&exports,kt=Ot&&typeof module==`object`&&module&&!module.nodeType&&module,At=kt&&kt.exports===Ot?n.Buffer:void 0,k=(At?At.isBuffer:void 0)||Et}));function Mt(e,t){var n=typeof e;return t=t??Nt,!!t&&(n==`number`||n!=`symbol`&&Pt.test(e))&&e>-1&&e%1==0&&e<t}var Nt,Pt,A=e((()=>{Nt=9007199254740991,Pt=/^(?:0|[1-9]\d*)$/}));function j(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=Ft}var Ft,It=e((()=>{Ft=9007199254740991}));function Lt(e){return b(e)&&j(e.length)&&!!M[s(e)]}var Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,M,ln=e((()=>{r(),It(),x(),Rt=`[object Arguments]`,zt=`[object Array]`,Bt=`[object Boolean]`,Vt=`[object Date]`,Ht=`[object Error]`,Ut=`[object Function]`,Wt=`[object Map]`,Gt=`[object Number]`,Kt=`[object Object]`,qt=`[object RegExp]`,Jt=`[object Set]`,Yt=`[object String]`,Xt=`[object WeakMap]`,Zt=`[object ArrayBuffer]`,Qt=`[object DataView]`,$t=`[object Float32Array]`,en=`[object Float64Array]`,tn=`[object Int8Array]`,nn=`[object Int16Array]`,rn=`[object Int32Array]`,an=`[object Uint8Array]`,on=`[object Uint8ClampedArray]`,sn=`[object Uint16Array]`,cn=`[object Uint32Array]`,M={},M[$t]=M[en]=M[tn]=M[nn]=M[rn]=M[an]=M[on]=M[sn]=M[cn]=!0,M[Rt]=M[zt]=M[Zt]=M[Bt]=M[Qt]=M[Vt]=M[Ht]=M[Ut]=M[Wt]=M[Gt]=M[Kt]=M[qt]=M[Jt]=M[Yt]=M[Xt]=!1}));function un(e){return function(t){return e(t)}}var dn=e((()=>{})),fn,N,P,F,pn=e((()=>{u(),fn=typeof exports==`object`&&exports&&!exports.nodeType&&exports,N=fn&&typeof module==`object`&&module&&!module.nodeType&&module,P=N&&N.exports===fn&&i.process,F=function(){try{return N&&N.require&&N.require(`util`).types||P&&P.binding&&P.binding(`util`)}catch{}}()})),mn,I,hn=e((()=>{ln(),dn(),pn(),mn=F&&F.isTypedArray,I=mn?un(mn):Lt}));function gn(e,t){var n=E(e),r=!n&&O(e),i=!n&&!r&&k(e),a=!n&&!r&&!i&&I(e),o=n||r||i||a,s=o?_t(e.length,String):[],c=s.length;for(var l in e)(t||_n.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Mt(l,c)))&&s.push(l);return s}var _n,vn=e((()=>{vt(),Tt(),D(),jt(),A(),hn(),_n=Object.prototype.hasOwnProperty}));function yn(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||bn)}var bn,xn=e((()=>{bn=Object.prototype}));function Sn(e,t){return function(n){return e(t(n))}}var Cn=e((()=>{})),wn,Tn=e((()=>{Cn(),wn=Sn(Object.keys,Object)}));function En(e){if(!yn(e))return wn(e);var t=[];for(var n in Object(e))Dn.call(e,n)&&n!=`constructor`&&t.push(n);return t}var Dn,On=e((()=>{xn(),Tn(),Dn=Object.prototype.hasOwnProperty}));function kn(e){return e!=null&&j(e.length)&&!h(e)}var An=e((()=>{g(),It()}));function L(e){return kn(e)?gn(e):En(e)}var jn=e((()=>{vn(),On(),An()}));function Mn(e){return st(e,L,ht)}var Nn=e((()=>{ct(),gt(),jn()}));function Pn(e,t,n,r,i,a){var o=n&Fn,s=Mn(e),c=s.length;if(c!=Mn(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:In.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||(m=u==`constructor`)}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var Fn,In,Ln=e((()=>{Nn(),Fn=1,In=Object.prototype.hasOwnProperty})),R,Rn=e((()=>{m(),c(),R=p(n,`DataView`)})),z,zn=e((()=>{m(),c(),z=p(n,`Promise`)})),B,Bn=e((()=>{m(),c(),B=p(n,`Set`)})),V,Vn=e((()=>{m(),c(),V=p(n,`WeakMap`)})),Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,H,U,$n=e((()=>{Rn(),te(),zn(),Bn(),Vn(),r(),ne(),Hn=`[object Map]`,Un=`[object Object]`,Wn=`[object Promise]`,Gn=`[object Set]`,Kn=`[object WeakMap]`,qn=`[object DataView]`,Jn=y(R),Yn=y(d),Xn=y(z),Zn=y(B),Qn=y(V),H=s,(R&&H(new R(new ArrayBuffer(1)))!=qn||d&&H(new d)!=Hn||z&&H(z.resolve())!=Wn||B&&H(new B)!=Gn||V&&H(new V)!=Kn)&&(H=function(e){var t=s(e),n=t==Un?e.constructor:void 0,r=n?y(n):``;if(r)switch(r){case Jn:return qn;case Yn:return Hn;case Xn:return Wn;case Zn:return Gn;case Qn:return Kn}return t}),U=H}));function er(e,t,n,r,i,a){var o=E(e),s=E(t),c=o?rr:U(e),l=s?rr:U(t);c=c==nr?W:c,l=l==nr?W:l;var u=c==W,d=l==W,f=c==l;if(f&&k(e)){if(!k(t))return!1;o=!0,u=!1}if(f&&!u)return a||(a=new S),o||I(e)?Pe(e,t,n,r,i,a):Ue(e,t,c,n,r,i,a);if(!(n&tr)){var p=u&&ir.call(e,`__wrapped__`),m=d&&ir.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||(a=new S),i(h,g,n,r,a)}}return f?(a||(a=new S),Pn(e,t,n,r,i,a)):!1}var tr,nr,rr,W,ir,ar=e((()=>{Ce(),Le(),it(),Ln(),$n(),D(),jt(),hn(),tr=1,nr=`[object Arguments]`,rr=`[object Array]`,W=`[object Object]`,ir=Object.prototype.hasOwnProperty}));function G(e,t,n,r,i){return e===t?!0:e==null||t==null||!b(e)&&!b(t)?e!==e&&t!==t:er(e,t,n,r,G,i)}var or=e((()=>{ar(),x()}));function sr(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new S;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?G(u,l,cr|lr,r,d):f))return!1}}return!0}var cr,lr,ur=e((()=>{Ce(),or(),cr=1,lr=2}));function dr(e){return e===e&&!a(e)}var fr=e((()=>{l()}));function pr(e){for(var t=L(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,dr(i)]}return t}var mr=e((()=>{fr(),jn()}));function hr(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}var gr=e((()=>{}));function _r(e){var t=pr(e);return t.length==1&&t[0][2]?hr(t[0][0],t[0][1]):function(n){return n===e||sr(n,e,t)}}var vr=e((()=>{ur(),mr(),gr()}));function yr(e,t){if(E(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||se(e)?!0:xr.test(e)||!br.test(e)||t!=null&&e in Object(t)}var br,xr,Sr=e((()=>{D(),ce(),br=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xr=/^\w*$/}));function Cr(e){var t=ee(e,function(e){return n.size===wr&&n.clear(),e}),n=t.cache;return t}var wr,Tr=e((()=>{ae(),wr=500})),Er,Dr,Or,kr=e((()=>{Tr(),Er=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dr=/\\(\\)?/g,Or=Cr(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Er,function(e,n,r,i){t.push(r?i.replace(Dr,`$1`):n||e)}),t})}));function Ar(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var jr=e((()=>{}));function Mr(e){if(typeof e==`string`)return e;if(E(e))return Ar(e,Mr)+``;if(se(e))return Fr?Fr.call(e):``;var t=e+``;return t==`0`&&1/e==-Nr?`-0`:t}var Nr,Pr,Fr,Ir=e((()=>{o(),jr(),D(),ce(),Nr=1/0,Pr=t?t.prototype:void 0,Fr=Pr?Pr.toString:void 0}));function Lr(e){return e==null?``:Mr(e)}var Rr=e((()=>{Ir()}));function zr(e,t){return E(e)?e:yr(e,t)?[e]:Or(Lr(e))}var Br=e((()=>{D(),Sr(),kr(),Rr()}));function K(e){if(typeof e==`string`||se(e))return e;var t=e+``;return t==`0`&&1/e==-Vr?`-0`:t}var Vr,q=e((()=>{ce(),Vr=1/0}));function Hr(e,t){t=zr(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[K(t[n++])];return n&&n==r?e:void 0}var Ur=e((()=>{Br(),q()}));function Wr(e,t,n){var r=e==null?void 0:Hr(e,t);return r===void 0?n:r}var Gr=e((()=>{Ur()}));function Kr(e,t){return e!=null&&t in Object(e)}var qr=e((()=>{}));function Jr(e,t,n){t=zr(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=K(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&j(i)&&Mt(o,i)&&(E(e)||O(e)))}var Yr=e((()=>{Br(),Tt(),D(),A(),It(),q()}));function Xr(e,t){return e!=null&&Jr(e,t,Kr)}var Zr=e((()=>{qr(),Yr()}));function Qr(e,t){return yr(e)&&dr(t)?hr(K(e),t):function(n){var r=Wr(n,e);return r===void 0&&r===t?Xr(n,e):G(t,r,$r|ei)}}var $r,ei,ti=e((()=>{or(),Gr(),Zr(),Sr(),fr(),gr(),q(),$r=1,ei=2}));function ni(e){return e}var ri=e((()=>{}));function ii(e){return function(t){return t?.[e]}}var ai=e((()=>{}));function oi(e){return function(t){return Hr(t,e)}}var si=e((()=>{Ur()}));function ci(e){return yr(e)?ii(K(e)):oi(e)}var li=e((()=>{ai(),si(),Sr(),q()}));function ui(e){return typeof e==`function`?e:e==null?ni:typeof e==`object`?E(e)?Qr(e[0],e[1]):_r(e):ci(e)}var di=e((()=>{vr(),ti(),ri(),D(),li()}));function fi(e,t){for(var n,r=-1,i=e.length;++r<i;){var a=t(e[r]);a!==void 0&&(n=n===void 0?a:n+a)}return n}var pi=e((()=>{}));function J(e,t){return e&&e.length?fi(e,ui(t,2)):0}var mi=e((()=>{di(),pi()})),hi=e((()=>{}));function gi(){return Y}function _i(e){Y=e}function vi(e){return X.has(e)?X.get(e):void 0}function yi(e,t){X.set(e,t)}function bi(e){return Z.get(e)}function xi(e,t){Z.set(e,t)}function Si(){Y=null,X.clear(),Z.clear()}function Ci(){return Ei}function wi(e){Ei=e}function Ti(){Ei=void 0}var Y,X,Z,Ei,Di=e((()=>{Y=null,X=new Map,Z=new Map}));function Oi(){let e=new Set;return{subscribe(t){return e.add(t),()=>{e.delete(t)}},emit(...t){for(let n of e)n(...t)},clear(){e.clear()}}}var ki=e((()=>{}));function Ai(){let e=``;if(typeof process<`u`&&typeof process.cwd==`function`&&typeof le==`function`){let t=de();try{e=le(t).normalize(`NFC`)}catch{e=t.normalize(`NFC`)}}return{originalCwd:e,projectRoot:e,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,turnHookDurationMs:0,turnToolDurationMs:0,turnClassifierDurationMs:0,turnToolCount:0,turnHookCount:0,turnClassifierCount:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:e,modelUsage:{},mainLoopModelOverride:void 0,initialMainLoopModel:null,modelStrings:null,isInteractive:!1,kairosActive:!1,strictToolResultPairing:!1,sdkAgentProgressSummariesEnabled:!1,userMsgOptIn:!1,clientType:`cli`,sessionSource:void 0,questionPreviewFormat:void 0,sessionIngressToken:void 0,oauthTokenFromFd:void 0,apiKeyFromFd:void 0,flagSettingsPath:void 0,flagSettingsInline:null,allowedSettingSources:[`userSettings`,`projectSettings`,`localSettings`,`flagSettings`,`policySettings`],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,statsStore:null,sessionId:ue(),parentSessionId:void 0,loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,agentColorMap:new Map,agentColorIndex:0,lastAPIRequest:null,lastAPIRequestMessages:null,lastClassifierRequests:null,cachedClaudeMdContent:null,inMemoryErrorLog:[],inlinePlugins:[],chromeFlagOverride:void 0,useCoworkPlugins:!1,sessionBypassPermissionsMode:!1,sessionCreatedTeams:new Set,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,needsAutoModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0,mainThreadAgentType:void 0,isRemoteMode:!1,directConnectServerUrl:void 0,systemPromptSectionCache:new Map,lastEmittedDate:null,additionalDirectoriesForClaudeMd:[],sessionProjectDir:null,promptCache1hAllowlist:null,promptCache1hEligible:null,afkModeHeaderLatched:null,fastModeHeaderLatched:null,cacheEditingHeaderLatched:null,promptId:null,lastMainRequestId:void 0,lastApiCompletionTimestamp:null,pendingPostCompaction:!1}}function ji(){return Q.sessionId}function Mi(e={}){return e.setCurrentAsParent&&(Q.parentSessionId=Q.sessionId),Q.planSlugCache.delete(Q.sessionId),Q.sessionId=ue(),Q.sessionProjectDir=null,Q.sessionId}function Ni(){return Q.parentSessionId}function Pi(e,t=null){Q.planSlugCache.delete(Q.sessionId),Q.sessionId=e,Q.sessionProjectDir=t,Hs.emit(e)}function Fi(){return Q.sessionProjectDir}function Ii(){return Q.originalCwd}function Li(){return Q.projectRoot}function Ri(e){Q.originalCwd=e.normalize(`NFC`)}function zi(e){Q.projectRoot=e.normalize(`NFC`)}function Bi(){return Q.cwd}function Vi(e){Q.cwd=e.normalize(`NFC`)}function Hi(){return Q.directConnectServerUrl}function Ui(e){Q.directConnectServerUrl=e}function Wi(e,t){Q.totalAPIDuration+=e,Q.totalAPIDurationWithoutRetries+=t}function Gi(e,t,n){Q.modelUsage[n]=t,Q.totalCostUSD+=e}function Ki(){return Q.totalCostUSD}function qi(){return Q.totalAPIDuration}function Ji(){return Date.now()-Q.startTime}function Yi(){return Q.totalAPIDurationWithoutRetries}function Xi(){return Q.totalToolDuration}function Zi(e){Q.totalToolDuration+=e,Q.turnToolDurationMs+=e,Q.turnToolCount++}function Qi(e){Q.turnHookDurationMs+=e,Q.turnHookCount++}function $i(){Q.turnHookDurationMs=0,Q.turnHookCount=0}function ea(){Q.turnToolDurationMs=0,Q.turnToolCount=0}function ta(e){Q.turnClassifierDurationMs+=e,Q.turnClassifierCount++}function na(){Q.turnClassifierDurationMs=0,Q.turnClassifierCount=0}function ra(){return Q.statsStore}function ia(e){Q.statsStore=e}function aa(e){e?oa():Ws=!0}function oa(){Q.lastInteractionTime=Date.now(),Ws=!1}function sa(e,t){Q.totalLinesAdded+=e,Q.totalLinesRemoved+=t}function ca(){return Q.totalLinesAdded}function la(){return Q.totalLinesRemoved}function ua(){return J(Object.values(Q.modelUsage),`inputTokens`)}function da(){return J(Object.values(Q.modelUsage),`outputTokens`)}function fa(){return J(Object.values(Q.modelUsage),`cacheReadInputTokens`)}function pa(){return J(Object.values(Q.modelUsage),`cacheCreationInputTokens`)}function ma(){return J(Object.values(Q.modelUsage),`webSearchRequests`)}function ha(){return da()-Gs}function ga(){return Ks}function _a(e){Gs=da(),Ks=e,$=0}function va(){return $}function ya(){$++}function ba(){Q.hasUnknownModelCost=!0}function xa(){return Q.hasUnknownModelCost}function Sa(){return Q.lastMainRequestId}function Ca(e){Q.lastMainRequestId=e}function wa(){return Q.lastApiCompletionTimestamp}function Ta(e){Q.lastApiCompletionTimestamp=e}function Ea(){Q.pendingPostCompaction=!0}function Da(){let e=Q.pendingPostCompaction;return Q.pendingPostCompaction=!1,e}function Oa(){return Q.lastInteractionTime}function ka(){return qs}async function Aa(){for(;qs;)await new Promise(e=>setTimeout(e,Js).unref?.())}function ja(){return Q.modelUsage}function Ma(e){return Q.modelUsage[e]}function Na(){return Q.mainLoopModelOverride}function Pa(){return Q.initialMainLoopModel}function Fa(e){Q.mainLoopModelOverride=e}function Ia(e){Q.initialMainLoopModel=e}function La(){return Q.sdkBetas}function Ra(e){Q.sdkBetas=e}function za(){Q.totalCostUSD=0,Q.totalAPIDuration=0,Q.totalAPIDurationWithoutRetries=0,Q.totalToolDuration=0,Q.startTime=Date.now(),Q.totalLinesAdded=0,Q.totalLinesRemoved=0,Q.hasUnknownModelCost=!1,Q.modelUsage={},Q.promptId=null}function Ba({totalCostUSD:e,totalAPIDuration:t,totalAPIDurationWithoutRetries:n,totalToolDuration:r,totalLinesAdded:i,totalLinesRemoved:a,lastDuration:o,modelUsage:s}){Q.totalCostUSD=e,Q.totalAPIDuration=t,Q.totalAPIDurationWithoutRetries=n,Q.totalToolDuration=r,Q.totalLinesAdded=i,Q.totalLinesRemoved=a,s&&(Q.modelUsage=s),o&&(Q.startTime=Date.now()-o)}function Va(){return Q.modelStrings}function Ha(e){Q.modelStrings=e}function Ua(e,t){Q.meter=e,Q.sessionCounter=t(`claude_code.session.count`,{description:`Count of CLI sessions started`}),Q.locCounter=t(`claude_code.lines_of_code.count`,{description:`Count of lines of code modified, with the 'type' attribute indicating whether lines were added or removed`}),Q.prCounter=t(`claude_code.pull_request.count`,{description:`Number of pull requests created`}),Q.commitCounter=t(`claude_code.commit.count`,{description:`Number of git commits created`}),Q.costCounter=t(`claude_code.cost.usage`,{description:`Cost of the Work Mate session`,unit:`USD`}),Q.tokenCounter=t(`claude_code.token.usage`,{description:`Number of tokens used`,unit:`tokens`}),Q.codeEditToolDecisionCounter=t(`claude_code.code_edit_tool.decision`,{description:`Count of code editing tool permission decisions (accept/reject) for Edit, Write, and NotebookEdit tools`}),Q.activeTimeCounter=t(`claude_code.active_time.total`,{description:`Total active time in seconds`,unit:`s`})}function Wa(){return Q.sessionCounter}function Ga(){return Q.locCounter}function Ka(){return Q.prCounter}function qa(){return Q.commitCounter}function Ja(){return Q.costCounter}function Ya(){return Q.tokenCounter}function Xa(){return Q.codeEditToolDecisionCounter}function Za(){return Q.activeTimeCounter}function Qa(){return Q.loggerProvider}function $a(e){Q.loggerProvider=e}function eo(){return Q.eventLogger}function to(e){Q.eventLogger=e}function no(){return Q.meterProvider}function ro(e){Q.meterProvider=e}function io(){return Q.tracerProvider}function ao(e){Q.tracerProvider=e}function oo(){return!Q.isInteractive}function so(){return Q.isInteractive}function co(e){Q.isInteractive=e}function lo(){return Q.clientType}function uo(e){Q.clientType=e}function fo(){return Q.sdkAgentProgressSummariesEnabled}function po(e){Q.sdkAgentProgressSummariesEnabled=e}function mo(){return Q.kairosActive}function ho(){return Q.strictToolResultPairing}function go(){return Q.userMsgOptIn}function _o(e){Q.userMsgOptIn=e}function vo(e){Q.sessionSource=e}function yo(){return Q.questionPreviewFormat}function bo(e){Q.questionPreviewFormat=e}function xo(){return Q.agentColorMap}function So(){return Q.flagSettingsPath}function Co(e){Q.flagSettingsPath=e}function wo(){return Q.flagSettingsInline}function To(e){Q.flagSettingsInline=e}function Eo(){return Q.sessionIngressToken}function Do(e){Q.sessionIngressToken=e}function Oo(){return Q.oauthTokenFromFd}function ko(e){Q.oauthTokenFromFd=e}function Ao(){return Q.apiKeyFromFd}function jo(e){Q.apiKeyFromFd=e}function Mo(e){Q.lastAPIRequest=e}function No(e){Q.lastAPIRequestMessages=e}function Po(e){Q.lastClassifierRequests=e}function Fo(e){Q.cachedClaudeMdContent=e}function Io(){return Q.cachedClaudeMdContent}function Lo(){return Q.allowedSettingSources}function Ro(e){Q.allowedSettingSources=e}function zo(){return oo()&&Q.clientType!==`claude-vscode`}function Bo(e){Q.inlinePlugins=e}function Vo(){return Q.inlinePlugins}function Ho(e){Q.useCoworkPlugins=e,Si()}function Uo(){return Q.useCoworkPlugins}function Wo(e){Q.sessionBypassPermissionsMode=e}function Go(e){Q.sessionTrustAccepted=e}function Ko(){return Q.sessionTrustAccepted}function qo(e){Q.sessionPersistenceDisabled=e}function Jo(){return Q.sessionPersistenceDisabled}function Yo(){return Q.hasExitedPlanMode}function Xo(e){Q.hasExitedPlanMode=e}function Zo(){return Q.needsPlanModeExitAttachment}function Qo(e){Q.needsPlanModeExitAttachment=e}function $o(e,t){t===`plan`&&e!==`plan`&&(Q.needsPlanModeExitAttachment=!1),e===`plan`&&t!==`plan`&&(Q.needsPlanModeExitAttachment=!0)}function es(){return Q.needsAutoModeExitAttachment}function ts(e){Q.needsAutoModeExitAttachment=e}function ns(e,t){if(e===`auto`&&t===`plan`||e===`plan`&&t===`auto`)return;let n=e===`auto`,r=t===`auto`;r&&!n&&(Q.needsAutoModeExitAttachment=!1),n&&!r&&(Q.needsAutoModeExitAttachment=!0)}function rs(){return Q.lspRecommendationShownThisSession}function is(e){Q.lspRecommendationShownThisSession=e}function as(e){Q.initJsonSchema=e}function os(){return Q.initJsonSchema}function ss(e){Q.registeredHooks||(Q.registeredHooks={});for(let[t,n]of Object.entries(e)){let e=t;Q.registeredHooks[e]||(Q.registeredHooks[e]=[]),Q.registeredHooks[e].push(...n??[])}}function cs(){return Q.registeredHooks}function ls(){if(!Q.registeredHooks)return;let e={};for(let[t,n]of Object.entries(Q.registeredHooks)){let r=(n??[]).filter(e=>!(`pluginRoot`in e));r.length>0&&(e[t]=r)}Q.registeredHooks=Object.keys(e).length>0?e:null}function us(){return Q.planSlugCache}function ds(e,t){if(Q.planSlugCache.size>=50){let e=Q.planSlugCache.keys().next().value;e!==void 0&&Q.planSlugCache.delete(e)}Q.planSlugCache.set(e,t)}function fs(e){Q.teleportedSessionInfo={isTeleported:!0,hasLoggedFirstMessage:!1,sessionId:e.sessionId}}function ps(){return Q.teleportedSessionInfo}function ms(){Q.teleportedSessionInfo&&(Q.teleportedSessionInfo.hasLoggedFirstMessage=!0)}function hs(e,t,n,r=null){let i=`${r??``}:${e}`;Q.invokedSkills.set(i,{skillName:e,skillPath:t,content:n,invokedAt:Date.now(),agentId:r})}function gs(e){let t=e??null,n=new Map;for(let[e,r]of Q.invokedSkills)r.agentId===t&&n.set(e,r);return n}function _s(e){if(!e||e.size===0){Q.invokedSkills.clear();return}for(let[t,n]of Q.invokedSkills)(n.agentId===null||!e.has(n.agentId))&&Q.invokedSkills.delete(t)}function vs(e){for(let[t,n]of Q.invokedSkills)n.agentId===e&&Q.invokedSkills.delete(t)}function ys(){return Q.mainThreadAgentType}function bs(e){Q.mainThreadAgentType=e}function xs(){return Q.isRemoteMode}function Ss(e){Q.isRemoteMode=e}function Cs(){return Q.systemPromptSectionCache}function ws(e,t){if(Q.systemPromptSectionCache.size>=100){let e=Q.systemPromptSectionCache.keys().next().value;e!==void 0&&Q.systemPromptSectionCache.delete(e)}Q.systemPromptSectionCache.set(e,t)}function Ts(){Q.systemPromptSectionCache.clear()}function Es(){return Q.lastEmittedDate}function Ds(e){Q.lastEmittedDate=e}function Os(){return Q.additionalDirectoriesForClaudeMd}function ks(e){Q.additionalDirectoriesForClaudeMd=e}function As(){return Q.promptCache1hAllowlist}function js(e){Q.promptCache1hAllowlist=e}function Ms(){return Q.promptCache1hEligible}function Ns(e){Q.promptCache1hEligible=e}function Ps(){return Q.afkModeHeaderLatched}function Fs(e){Q.afkModeHeaderLatched=e}function Is(){return Q.fastModeHeaderLatched}function Ls(e){Q.fastModeHeaderLatched=e}function Rs(){return Q.cacheEditingHeaderLatched}function zs(){Q.afkModeHeaderLatched=null,Q.fastModeHeaderLatched=null,Q.cacheEditingHeaderLatched=null}function Bs(){return Q.promptId}function Vs(e){Q.promptId=e}var Q,Hs,Us,Ws,Gs,Ks,$,qs,Js,Ys=e((()=>{mi(),hi(),Di(),ki(),Q=Ai(),Hs=Oi(),Us=Hs.subscribe,Gs=0,Ks=null,$=0,qs=!1,Js=150}));export{ja as $,qo as $n,xn as $r,zo as $t,eo as A,Re as Ai,Ds as An,Ur as Ar,ca as At,xs as B,Qo as Bn,or as Br,ns as Bt,lo as C,D as Ci,Bo as Cn,wi as Cr,qi as Ct,ga as D,He as Di,No as Dn,ni as Dr,Ki as Dt,Ja as E,ot as Ei,Mo as En,di as Er,fa as Et,Pa as F,S as Fi,bs as Fn,Rr as Fr,io as Ft,Oa as G,js as Gn,Mn as Gr,ya as Gt,mo as H,Ri as Hn,$n as Hr,Yo as Ht,Vo as I,Ce as Ii,Ua as In,Lr as Ir,ha as It,Qa as J,bo as Jn,L as Jr,ms as Jt,Sa as K,Ns as Kn,Nn as Kr,Ys as Kt,gs as L,ro as Ln,Ar as Lr,Ma as Lt,wo as M,Ne as Mi,$a as Mn,K as Mr,da as Mt,So as N,C as Ni,is as Nn,zr as Nr,Xi as Nt,Bi as O,Ve as Oi,Ta as On,ri as Or,Ji as Ot,os as P,ke as Pi,Fa as Pn,Br as Pr,ma as Pt,Va as Q,Do as Qn,Sn as Qr,Us as Qt,so as R,Ha as Rn,jr as Rr,Uo as Rt,Io as S,ct as Si,Ia as Sn,yi as Sr,Ya as St,qa as T,at as Ti,Ss as Tn,ui as Tr,pa as Tt,wa as U,ds as Un,B as Ur,rs as Ut,ka as V,ko as Vn,U as Vr,$o as Vt,Es as W,zi as Wn,Bn as Wr,xa as Wt,ys as X,Ra as Xn,kn as Xr,es as Xt,Na as Y,po as Yn,An as Yr,Ea as Yt,no as Z,Wo as Zn,Cn as Zr,Zo as Zt,xo as _,ft as _i,To as _n,Ci as _r,Ko as _t,sa as a,pn as ai,ea as an,ao as ar,Li as at,va as b,ut as bi,ba as bn,Si as br,Cs as bt,zs as c,dn as ci,Ro as cn,_a as cr,Bs as ct,ls as d,jt as di,uo as dn,Aa as dr,fo as dt,yn as ei,Mi as en,vo as er,Oo as et,Ts as f,k as fi,Ba as fn,Oi as fr,La as ft,Ps as g,gt as gi,Ls as gn,vi as gr,Fi as gt,Os as h,ht as hi,to as hn,bi as hr,Eo as ht,Wi as i,I as ii,$i as in,fs as ir,Ka as it,Is as j,Me as ji,Ca as jn,q as jr,la as jt,Hi as k,w as ki,Po as kn,Hr as kr,ua as kt,_s as l,A as li,jo as ln,Pi as lr,yo as lt,Za as m,O as mi,Ui as mn,Ti as mr,ji as mt,Zi as n,vn as ni,za as nn,ia as nr,Ni as nt,ta as o,F as oi,ks as on,Ho as or,As as ot,Da as p,Tt as pi,Vi as pn,ki as pr,Wa as pt,Ga as q,Vs as qn,jn as qr,Jo as qt,Gi as r,hn as ri,na as rn,ws as rr,us as rt,Qi as s,un as si,Fs as sn,_o as sr,Ms as st,hs as t,gn as ti,ss as tn,Go as tr,Ii as tt,vs as u,Mt as ui,Fo as un,aa as ur,cs as ut,Lo as v,dt as vi,Co as vn,gi as vr,ra as vt,Xa as w,E as wi,co as wn,_i as wr,Yi as wt,Rs as x,st as xi,as as xn,xi as xr,ps as xt,Ao as y,lt as yi,Xo as yn,Di as yr,ho as yt,oo as z,ts as zn,G as zr,go as zt};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fa as t,pa as n}from"./loadAgentsDir-CKSb56Gp.js";function r(e){return e?e.activeAgents.filter(e=>e.source!==`built-in`).reduce((e,t)=>e+n(`${t.agentType}: ${t.whenToUse}`),0):0}var i,a=e((()=>{t(),i=15e3}));export{r as n,a as r,i as t};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./switcher-77h2J5HC.js";e();export{t as restoreActiveProvider};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Hn as t,Un as n,Wn as r}from"./settings-Xbq6AaD-.js";import{u as i}from"./oauth-C9VBDB0Y.js";import{Bt as a,Ot as o,St as s,ai as c,ci as l,si as u}from"./model-C2e73CJD.js";function d(){p=void 0,n()}function f(){if(p!==void 0)return p;if(c()!==`firstParty`||!l()||process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`)return p=r(!1);let e=o();if(e?.accessToken&&e.subscriptionType===null||e?.accessToken&&e.scopes?.includes(`user:inference`)&&(e.subscriptionType===`enterprise`||e.subscriptionType===`team`))return p=r(!0);try{let{key:e}=s({skipRetrievingKeyFromApiKeyHelper:!0});if(e)return p=r(!0)}catch{}return p=r(!1)}var p,m=e((()=>{i(),a(),u(),t()}));export{f as n,d as r,m as t};
@@ -1 +0,0 @@
1
- import{Su as e,_u as t,hu as n,mu as r,yu as i}from"./loadAgentsDir-CKSb56Gp.js";n();export{r as checkOutTeleportedSessionBranch,t as processMessagesForTeleportResume,i as teleportResumeCodeSession,e as validateGitState};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{bC as t,bE as n,yC as r,yE as i}from"./loadAgentsDir-CKSb56Gp.js";import{n as a,t as o}from"./partition-CpfoVrg1.js";function s(e,r,i){let[o,s]=a(n([...e,...r],`name`),t),c=(e,t)=>e.name.localeCompare(t.name);return[...s.sort(c),...o.sort(c)]}var c=e((()=>{o(),i(),r()}));export{s as n,c as t};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./trustedDevice-j1u2TG5U.js";export{t as clearTrustedDeviceToken,e as enrollTrustedDevice};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{F as a,S as o,a as s,l as c,w as l,z as u}from"./debug-BdqxZ7rV.js";import{d,f}from"./log-CTFl4qpD.js";import{l as p,u as m}from"./oauth-C9VBDB0Y.js";import{Bt as h,Cn as g,Sn as _,ft as v}from"./model-C2e73CJD.js";import{hostname as y}from"os";i(),n(),m(),s(),u(),d(),g(),o();var b=`tengu_sessions_elevated_auth_enforcement`;function x(){return!1}var S=t(()=>process.env.CLAUDE_TRUSTED_DEVICE_TOKEN||_().read()?.trustedDeviceToken);function C(){if(x())return S()}function w(){S.cache?.clear?.()}function T(){if(!x())return;let e=_();try{let t=e.read();t?.trustedDeviceToken&&(delete t.trustedDeviceToken,e.update(t))}catch{}S.cache?.clear?.()}async function E(){try{if(!await!1){c(`[trusted-device] Gate ${b} is off, skipping enrollment`);return}if(process.env.CLAUDE_TRUSTED_DEVICE_TOKEN){c(`[trusted-device] CLAUDE_TRUSTED_DEVICE_TOKEN env var is set, skipping enrollment (env var takes precedence)`);return}let{getClaudeAIOAuthTokens:t}=(h(),e(v)),n=t()?.accessToken;if(!n){c(`[trusted-device] No OAuth token, skipping enrollment`);return}let i=_();if(f()){c(`[trusted-device] Essential traffic only, skipping enrollment`);return}let o=p().BASE_API_URL,s;try{s=await r.post(`${o}/api/auth/trusted_devices`,{display_name:`Work Mate on ${y()} · ${process.platform}`},{headers:{Authorization:`Bearer ${n}`,"Content-Type":`application/json`},timeout:1e4,validateStatus:e=>e<500})}catch(e){c(`[trusted-device] Enrollment request failed: ${a(e)}`);return}if(s.status!==200&&s.status!==201){c(`[trusted-device] Enrollment failed ${s.status}: ${l(s.data).slice(0,200)}`);return}let u=s.data?.device_token;if(!u||typeof u!=`string`){c(`[trusted-device] Enrollment response missing device_token field`);return}try{let e=i.read();if(!e){c(`[trusted-device] Cannot read storage, skipping token persist`);return}e.trustedDeviceToken=u;let t=i.update(e);if(!t.success){c(`[trusted-device] Failed to persist token: ${t.warning??`unknown`}`);return}S.cache?.clear?.(),c(`[trusted-device] Enrolled device_id=${s.data.device_id??`unknown`}`)}catch(e){c(`[trusted-device] Storage write failed: ${a(e)}`)}}catch(e){c(`[trusted-device] Enrollment error: ${a(e)}`)}}export{C as i,w as n,E as r,T as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-BDhHQY0-.js";import{C as r,F as i,H as a,S as o,a as s,l as c,z as l}from"./debug-BdqxZ7rV.js";import{o as u}from"./log-CTFl4qpD.js";import{a as d,i as f}from"./genericProcessUtils-BmDSLcMf.js";import"os";import{join as p}from"path";import"crypto";import{readFile as m,readdir as h}from"fs/promises";import"net";import"node:string_decoder";var g=e((()=>{l(),o()})),_=e((()=>{s(),l(),n(),g(),u(),o()}));function v(){return p(t(),`sessions`)}async function y(){let e=v(),t;try{t=await h(e)}catch(e){return a(e)||c(`[udsClient] readdir failed: ${i(e)}`),[]}let n=[];for(let i of t){if(!/^\d+\.json$/.test(i))continue;let t=parseInt(i.slice(0,-5),10);if(d(t))try{let a=r(await m(p(e,i),`utf8`));n.push({pid:t,sessionId:a.sessionId,cwd:a.cwd,startedAt:a.startedAt,kind:a.kind,name:a.name,messagingSocketPath:a.messagingSocketPath,entrypoint:a.entrypoint,bridgeSessionId:a.bridgeSessionId,alive:!0})}catch{}}return n}e((()=>{n(),s(),l(),f(),o(),_(),g()}))();export{y as listAllLiveSessions};
@@ -1,11 +0,0 @@
1
- import{ff as e,uf as t}from"./loadAgentsDir-CKSb56Gp.js";import{di as n,ui as r}from"./src-P_wYS_NJ2.js";import{a as i,l as a}from"./debug-BdqxZ7rV.js";import{n as o,o as s}from"./process-gEbdy6uY.js";import{n as c,r as l}from"./execFileNoThrow-5SylUnAI.js";import{l as u,u as d}from"./ripgrep-DkL2S7-I.js";import{join as f}from"node:path";import{execSync as p}from"node:child_process";import{existsSync as m,readFileSync as h}from"node:fs";import{homedir as g}from"node:os";n(),i(),d(),l(),e(),o();var _=`@readmagic/workmate`;function v(){try{let e=f(u,`..`,`package.json`);if(m(e)){let t=JSON.parse(h(e,`utf-8`));if(t.version)return t.version}}catch{}return`0.0.9`}function y(e){try{return p(`which ${e} 2>/dev/null`,{stdio:`pipe`}),!0}catch{return!1}}function b(){return!!(process.execPath.includes(`bun`)||m(f(f(g(),`.bun`,`install`,`global`),`node_modules`,_)))}async function x(){let e=await c(`npm`,[`view`,`${_}@latest`,`version`,`--prefer-online`],{abortSignal:AbortSignal.timeout(1e4),cwd:g()});return e.code===0?e.stdout.trim():(a(`npm view failed: ${e.stderr}`),null)}function S(e,t){let n=e=>e.replace(/^\D/,``).split(`.`).map(Number),r=n(e),i=n(t);for(let e=0;e<3;e++){if((r[e]??0)>(i[e]??0))return!0;if((r[e]??0)<(i[e]??0))return!1}return!0}async function C(){let e=v();s(`Current version: ${e}\n`);let n=y(`bun`),i=b()&&n?`bun`:`npm`;s(`Package manager: ${i}\n`),s(`Checking for updates...
2
- `);let a=await x();if(!a){process.stderr.write(r.red(`Failed to check for updates`)+`
3
- `),process.stderr.write(`Unable to fetch latest version from npm registry.
4
- `),await t(1);return}if(a===e||S(e,a)){s(r.green(`ccb is up to date (${e})`)+`
5
- `),await t(0);return}s(`New version available: ${a} (current: ${e})\n`),s(`Installing update via ${i}...\n`);try{p(i===`bun`?`bun install -g ${_}@latest`:`npm install -g ${_}@latest`,{stdio:`inherit`,cwd:g(),timeout:12e4}),s(r.green(`Successfully updated from ${e} to ${a}`)+`
6
- `)}catch(e){process.stderr.write(r.red(`Update failed`)+`
7
- `),process.stderr.write(`${e}\n`),process.stderr.write(`
8
- `),process.stderr.write(`Try manually updating with:
9
- `),i===`bun`?process.stderr.write(r.bold(` bun install -g ${_}@latest`)+`
10
- `):process.stderr.write(r.bold(` npm install -g ${_}@latest`)+`
11
- `),await t(1)}await t(0)}export{C as updateCCB};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ov as t,sv as n}from"./loadAgentsDir-CKSb56Gp.js";import{C as r,_ as i,s as a}from"./model-C2e73CJD.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{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Eo as t,Fp as n,Fs as r,Ip as i,Is as a,KC as o,Ls as s,Np as c,Ps as l,To as u,cf as d,jp as f,lf as p,lv as m,mg as h,ov as g,pg as _,qC as v,sv as y}from"./loadAgentsDir-CKSb56Gp.js";import{fi as b}from"./src-P_wYS_NJ2.js";import{W as x,a as S,l as C,z as w}from"./debug-BdqxZ7rV.js";import{In as T,Ln as E}from"./settings-Xbq6AaD-.js";import{O as D,k as O}from"./git-B9uvt96d.js";import{o as k,s as A}from"./log-CTFl4qpD.js";import{n as j,r as M}from"./analytics-DJobLaWP.js";import{n as N,r as P}from"./pluginFlagging-CxuRF2Vc.js";import{t as F}from"./pluginBlocklist-D93Hd1GF.js";var I=e(b(),1);d(),j(),f(),g(),E(),S(),D(),w(),k(),a(),r(),_(),n(),o(),P(),u();function L({enabled:e=!0}={}){let n=m(),r=y(e=>e.plugins.needsRefresh),{addNotification:a}=p(),o=(0,I.useCallback)(async()=>{try{let{enabled:e,disabled:r,errors:o}=await t();await F();let u=N();Object.keys(u).length>0&&a({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let d=[],f=[];try{d=await l()}catch(e){let t=e instanceof Error?e.message:String(e);o.push({type:`generic-error`,source:`plugin-commands`,error:`Failed to load plugin commands: ${t}`})}try{f=await s()}catch(e){let t=e instanceof Error?e.message:String(e);o.push({type:`generic-error`,source:`plugin-agents`,error:`Failed to load plugin agents: ${t}`})}try{await h()}catch(e){let t=e instanceof Error?e.message:String(e);o.push({type:`generic-error`,source:`plugin-hooks`,error:`Failed to load plugin hooks: ${t}`})}let p=(await Promise.all(e.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await v(e,o);return t&&(e.mcpServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0),m=(await Promise.all(e.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await i(e,o);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);c(),n(t=>{let n=t.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),i=new Set(o.map(e=>e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`)),a=[...n.filter(e=>{let t=e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`;return!i.has(t)}),...o];return{...t,plugins:{...t.plugins,enabled:e,disabled:r,commands:d,errors:a}}}),C(`Loaded plugins - Enabled: ${e.length}, Disabled: ${r.length}, Commands: ${d.length}, Agents: ${f.length}, Errors: ${o.length}`);let g=e.reduce((e,t)=>t.hooksConfig?e+Object.values(t.hooksConfig).reduce((e,t)=>e+(t?.reduce((e,t)=>e+t.hooks.length,0)??0),0):e,0);return{enabled_count:e.length,disabled_count:r.length,inline_count:T(e,e=>e.source.endsWith(`@inline`)),marketplace_count:T(e,e=>!e.source.endsWith(`@inline`)),error_count:o.length,skill_count:d.length,agent_count:f.length,hook_count:g,mcp_count:p,lsp_count:m}}catch(e){let t=x(e);return A(t),C(`Error loading plugins: ${e}`),n(e=>{let n=e.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r={type:`generic-error`,source:`plugin-system`,error:t.message};return{...e,plugins:{...e.plugins,enabled:[],disabled:[],commands:[],errors:[...n,r]}}}),{enabled_count:0,disabled_count:0,inline_count:0,marketplace_count:0,error_count:1,skill_count:0,agent_count:0,hook_count:0,mcp_count:0,lsp_count:0,load_failed:!0,ant_enabled_names:void 0}}},[n,a]);(0,I.useEffect)(()=>{e&&o().then(e=>{let{ant_enabled_names:t,...n}=e,r={...n,has_custom_plugin_cache_dir:!!process.env.CLAUDE_CODE_PLUGIN_CACHE_DIR};M(`tengu_plugins_loaded`,{...r,...t!==void 0&&{enabled_names:t}}),O(`info`,`tengu_plugins_loaded`,r)})},[o,e]),(0,I.useEffect)(()=>{!e||!r||a({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,r,a])}export{L as t};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{cf as n,gv as r,hv as i,lf as a}from"./loadAgentsDir-CKSb56Gp.js";import{fi as o}from"./src-P_wYS_NJ2.js";import{B as s,Kt as c}from"./state-Bs5xweDL.js";import{n as l,t as u}from"./allErrors-DYw_q14e.js";function d(){let{addNotification:e,removeNotification:t}=a(),[n,i]=(0,f.useState)(()=>{let{errors:e}=u();return e});return r((0,f.useCallback)(()=>{let{errors:e}=u();i(e)},[])),(0,f.useEffect)(()=>{if(!s())if(n.length>0){let t=`Found ${n.length} settings ${n.length===1?`issue`:`issues`} · /doctor for details`;e({key:p,text:t,color:`warning`,priority:`high`,timeoutMs:6e4})}else t(p)},[n,e,t]),n}var f,p,m=e((()=>{f=t(o(),1),n(),c(),l(),i(),p=`settings-errors`}));export{d as n,m as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Fu as t,Pu as n,av as r,ov as i}from"./loadAgentsDir-CKSb56Gp.js";import{I as a,P as o,fi as s,t as c}from"./src-P_wYS_NJ2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{n as u,r as d}from"./analytics-DJobLaWP.js";import{Bt as f,Ht as p}from"./model-C2e73CJD.js";import{t as m}from"./WelcomeV2-BWF-cJOu.js";import{t as h}from"./useManagePlugins-BbWJNLe8.js";import{n as g,t as _}from"./MCPConnectionManager-DPFe4hPh.js";import{n as v}from"./onChangeAppState-DhBO34OK.js";import{cwd as y}from"process";var b=e(s(),1);c(),t(),u(),g(),i(),f();var x=l();async function S(e){d(`tengu_setup_token_command`,{});let t=!p(),{ConsoleOAuthFlow:i}=await import(`./ConsoleOAuthFlow-D1MYL1dJ.js`);await new Promise(s=>{e.render((0,x.jsx)(r,{onChangeAppState:v,children:(0,x.jsx)(n,{children:(0,x.jsxs)(a,{flexDirection:`column`,gap:1,children:[(0,x.jsx)(m,{}),t&&(0,x.jsxs)(a,{flexDirection:`column`,children:[(0,x.jsx)(o,{color:`warning`,children:`Warning: You already have authentication configured via environment variable or API key helper.`}),(0,x.jsx)(o,{color:`warning`,children:`The setup-token command will create a new OAuth token which you can use instead.`})]}),(0,x.jsx)(i,{onDone:()=>{s()}})]})})}))}),e.unmount(),process.exit(0)}var C=b.lazy(()=>import(`./Doctor-VhJi2cmL.js`).then(e=>({default:e.Doctor})));function w({onDone:e}){return h(),(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(C,{onDone:e})})}async function T(e){d(`tengu_doctor_command`,{}),await new Promise(t=>{e.render((0,x.jsx)(r,{children:(0,x.jsx)(n,{children:(0,x.jsx)(_,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1,children:(0,x.jsx)(w,{onDone:()=>{t()}})})})}))}),e.unmount(),process.exit(0)}async function E(e,t){let{setup:n}=await import(`./setup-uZ0dSekt.js`);await n(y(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-CVGZ55wV.js`);await new Promise(n=>{let i=[];e&&i.push(e),t.force&&i.push(`--force`),r.call(e=>{n(),process.exit(+!!e.includes(`failed`))},{},i)})}export{T as doctorHandler,E as installHandler,S as setupTokenHandler};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{IE as r,LE as i,RE as a,_D as o,gD as s,mD as c,nE as l,pD as ee,rE as u}from"./loadAgentsDir-CKSb56Gp.js";import{p as d}from"./external-CEp-aPkt.js";import{r as f}from"./lazySchema-B4D4qJVE.js";import{C as p,F as m,I as h,S as g,V as _,a as te,d as v,l as y,p as b,w as x,z as S}from"./debug-BdqxZ7rV.js";import{_t as C,gt as w,ht as T,pt as ne,vt as re}from"./settings-Xbq6AaD-.js";import{o as ie,s as E}from"./log-CTFl4qpD.js";import{homedir as ae}from"os";import*as D from"path";import{join as oe,resolve as se}from"path";import{randomBytes as O}from"crypto";import{readFile as k,readdir as A,rename as j,stat as M,unlink as N,writeFile as P}from"fs/promises";function F(){return oe(l(),H)}async function I(){let e=F();try{let t=p(await k(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return y(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==V)return y(`Install counts cache version mismatch (got ${n.version}, expected ${V})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return y(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(y(`Install counts cache has invalid fetchedAt timestamp`),null):n.counts.every(e=>typeof e==`object`&&!!e&&typeof e.plugin==`string`&&typeof e.unique_installs==`number`)?Date.now()-r>W?(y(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(y(`Install counts cache has malformed entries`),null)}catch(e){return h(e)!==`ENOENT`&&y(`Failed to load install counts cache: ${m(e)}`),null}}async function L(e){let t=F(),n=`${t}.${O(8).toString(`hex`)}.tmp`;try{let r=l();await v().mkdir(r),await P(n,x(e,null,2),{encoding:`utf-8`,mode:384}),await j(n,t),y(`Install counts cache saved successfully`)}catch(e){E(e);try{await N(n)}catch{}}}async function R(){y(`Fetching install counts from ${U}`);let e=performance.now();try{let n=await t.get(U,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return a(`install_counts`,U,`success`,performance.now()-e),n.data.plugins}catch(t){throw a(`install_counts`,U,`failure`,performance.now()-e,r(t)),t}}async function z(){let e=await I();if(e){y(`Using cached install counts`),a(`install_counts`,U,`cache_hit`,0);let t=new Map;for(let n of e.counts)t.set(n.plugin,n.unique_installs);return t}try{let e=await R();await L({version:V,fetchedAt:new Date().toISOString(),counts:e});let t=new Map;for(let n of e)t.set(n.plugin,n.unique_installs);return t}catch(e){return E(e),y(`Failed to fetch install counts: ${m(e)}`),null}}function B(e){if(e<1e3)return String(e);if(e<1e6){let t=(e/1e3).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}K`:`${t}K`}let t=(e/1e6).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}M`:`${t}M`}var V,H,U,W,G=e((()=>{n(),te(),S(),b(),ie(),g(),i(),u(),V=1,H=`install-counts-cache.json`,U=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,W=1440*60*1e3}));async function K(e){let t=e.trim(),n=v(),r=t.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(r?.[1]){let e=r[1],t=r[3];return t?{source:`git`,url:e,ref:t}:{source:`git`,url:e}}if(t.startsWith(`http://`)||t.startsWith(`https://`)){let e=t.match(/^([^#]+)(#(.+))?$/),n=e?.[1]||t,r=e?.[3];if(n.endsWith(`.git`)||n.includes(`/_git/`))return r?{source:`git`,url:n,ref:r}:{source:`git`,url:n};let i;try{i=new URL(n)}catch{return{source:`url`,url:n}}if((i.hostname===`github.com`||i.hostname===`www.github.com`)&&i.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let e=n.endsWith(`.git`)?n:`${n}.git`;return r?{source:`git`,url:e,ref:r}:{source:`git`,url:e}}return{source:`url`,url:n}}let i=process.platform===`win32`&&(t.startsWith(`.\\`)||t.startsWith(`..\\`)||/^[a-zA-Z]:[/\\]/.test(t));if(t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)||t.startsWith(`~`)||i){let e=se(t.startsWith(`~`)?t.replace(/^~/,ae()):t),r;try{r=await n.stat(e)}catch(t){let n=h(t);return{error:n===`ENOENT`?`Path does not exist: ${e}`:`Cannot access path: ${e} (${n??t})`}}return r.isFile()?e.endsWith(`.json`)?{source:`file`,path:e}:{error:`File path must point to a .json file (marketplace.json), but got: ${e}`}:r.isDirectory()?{source:`directory`,path:e}:{error:`Path is neither a file nor a directory: ${e}`}}if(t.includes(`/`)&&!t.startsWith(`@`)){if(t.includes(`:`))return null;let e=t.match(/^([^#@]+)(?:[#@](.+))?$/),n=e?.[1]||t,r=e?.[2];return r?{source:`github`,repo:n,ref:r}:{source:`github`,repo:n}}return null}var ce=e((()=>{S(),b()}));function le(e){let t=D.basename(e),n=D.basename(D.dirname(e));return t===`plugin.json`?`plugin`:t===`marketplace.json`?`marketplace`:n===`.claude-plugin`?`plugin`:`unknown`}function q(e){return e.issues.map(e=>({path:e.path.join(`.`)||`root`,message:e.message,code:e.code}))}function J(e,t,n,r){e.includes(`..`)&&n.push({path:t,message:r?`Path contains "..": ${e}. ${r}`:`Path contains ".." which could be a path traversal attempt: ${e}`})}function ue(e){let t=e.replace(/^(\.\.\/)+/,``);return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${t===e?`./plugins/my-plugin`:`./${t}`}" instead of "${e}".`}async function Y(e){let t=[],n=[],r=D.resolve(e),i;try{i=await k(r,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${m(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=p(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(e)}`}],warnings:[],filePath:r,fileType:`plugin`}}if(a&&typeof a==`object`){let e=a;e.commands&&(Array.isArray(e.commands)?e.commands:[e.commands]).forEach((e,n)=>{typeof e==`string`&&J(e,`commands[${n}]`,t)}),e.agents&&(Array.isArray(e.agents)?e.agents:[e.agents]).forEach((e,n)=>{typeof e==`string`&&J(e,`agents[${n}]`,t)}),e.skills&&(Array.isArray(e.skills)?e.skills:[e.skills]).forEach((e,n)=>{typeof e==`string`&&J(e,`skills[${n}]`,t)})}let o=a;if(typeof a==`object`&&a){let e=a,t=Object.keys(e).filter(e=>$.has(e));if(t.length>0){let r={...e};for(let e of t)delete r[e],n.push({path:e,message:`Field '${e}' belongs in the marketplace entry (marketplace.json), not plugin.json. It's harmless here but unused — Work Mate ignores it at load time.`});o=r}}let s=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=D.resolve(e),i;try{i=await k(r,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${m(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`marketplace`}}let a;try{a=p(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(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:d(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=D.dirname(r),a=D.basename(i)===`.claude-plugin`?D.dirname(i):i;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=D.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=p(await k(e,{encoding:`utf-8`}));typeof t.version==`string`&&(i=t.version)}catch{continue}i&&i!==r.version&&n.push({path:`plugins[${t}].version`,message:`Entry declares version "${r.version}" but ${r.source}/.claude-plugin/plugin.json says "${i}". At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. Update this entry to "${i}" to match.`})}}e.metadata?.description||n.push({path:`metadata.description`,message:`No marketplace description provided. Adding a description helps users understand what this marketplace offers`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`marketplace`}}function de(e,t,n){let r=[],i=[],a=t.match(ee);if(!a)return i.push({path:`frontmatter`,message:`No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata.`}),{success:!0,errors:r,warnings:i,filePath:e,fileType:n};let s=a[1]||``,c;try{c=o(s)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${m(t)}. At runtime this ${n} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n}}if(typeof c!=`object`||!c||Array.isArray(c))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(c)?`an array`:c===null?`null`:typeof c}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let l=c;if(l.description!==void 0){let e=l.description;typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`&&e!==null&&r.push({path:`description`,message:`description must be a string, got ${Array.isArray(e)?`array`:typeof e}. At runtime this value is dropped.`})}else i.push({path:`description`,message:`No description in frontmatter. A description helps users and Claude understand when to use this ${n}.`});l.name!==void 0&&l.name!==null&&typeof l.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof l.name}.`});let u=l[`allowed-tools`];u!=null&&(typeof u!=`string`&&!Array.isArray(u)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof u}.`}):Array.isArray(u)&&u.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let d=l.shell;if(d!=null)if(typeof d!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof d}.`});else{let e=d.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${d}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await k(e,{encoding:`utf-8`})}catch(t){return h(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${m(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=p(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=ne().safeParse(n);return r.success?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:q(r.error),warnings:[],filePath:e,fileType:`hooks`}}async function Q(e,t){let n;try{n=await A(e,{withFileTypes:!0})}catch(e){let t=h(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>D.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=D.join(e,t.name);t.isDirectory()?r.push(...await Q(n,!1)):t.isFile()&&t.name.toLowerCase().endsWith(`.md`)&&r.push(n)}return r}async function fe(e){let t=[],n=[[`skill`,D.join(e,`skills`)],[`agent`,D.join(e,`agents`)],[`command`,D.join(e,`commands`)]];for(let[e,r]of n){let n=await Q(r,e===`skill`);for(let r of n){let n;try{n=await k(r,{encoding:`utf-8`})}catch(n){if(_(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${m(n)}`}],warnings:[],filePath:r,fileType:e});continue}let i=de(r,n,e);(i.errors.length>0||i.warnings.length>0)&&t.push(i)}}let r=await Z(D.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=D.resolve(e),n=null;try{n=await M(t)}catch(e){if(!_(e))throw e}if(n?.isDirectory()){let e=await X(D.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(D.join(t,`.claude-plugin`,`plugin.json`));return n.errors[0]?.code===`ENOENT`?{success:!1,errors:[{path:`directory`,message:`No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json`}],warnings:[],filePath:t,fileType:`plugin`}:n}switch(le(e)){case`plugin`:return Y(e);case`marketplace`:return X(e);case`unknown`:try{let n=p(await k(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(h(e)===`ENOENT`)return{success:!1,errors:[{path:`file`,message:`File not found: ${t}`}],warnings:[],filePath:t,fileType:`plugin`}}return Y(e)}}var $,me=e((()=>{f(),S(),c(),g(),s(),re(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{K as a,G as c,ce as i,pe as n,B as o,fe as r,z as s,me as t};
@@ -1 +0,0 @@
1
- import{i as e,o as t}from"./windowsPaths-BVztIhXM.js";e();export{t as setShellIfWindows};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./cwd-L4wygFqJ.js";import{a,l as o}from"./debug-BdqxZ7rV.js";import{n as s,t as c}from"./memoize-FJv2HV1u.js";import{n as l,t as u}from"./execSyncWrapper-DKuxVTaf.js";import{i as d,o as f}from"./platform-D6IMiyqT.js";import{existsSync as p}from"fs";import*as m from"path/win32";function h(){if(d()===`windows`){let e=y();process.env.SHELL=e,process.env.CLAUDE_CODE_GIT_BASH_PATH=e,o(`Using bash path: "${e}"`)}}function g(e,t){let n=[`C:\\Program Files\\Git\\bin\\bash.exe`,`C:\\Program Files\\Git\\usr\\bin\\bash.exe`,`C:\\Program Files (x86)\\Git\\bin\\bash.exe`,`C:\\Program Files (x86)\\Git\\usr\\bin\\bash.exe`];t&&n.push(`${t}\\scoop\\apps\\git\\current\\usr\\bin\\bash.exe`);for(let t of n)if(e(t))return t;return null}function _(e,t){if(e===`git`){for(let e of[`C:\\Program Files\\Git\\cmd\\git.exe`,`C:\\Program Files (x86)\\Git\\cmd\\git.exe`])if(t.checkExists(e))return e}try{let n=t.execCommand(`where.exe ${e}`).split(/\r?\n/).map(e=>e.trim()).filter(Boolean),r=m.resolve(t.cwdFn()).toLowerCase();for(let e of n){let t=m.resolve(e).toLowerCase(),n=m.dirname(t).toLowerCase(),i=m.relative(r,n);if(i===``||!i.startsWith(`..`)&&!m.isAbsolute(i)){o(`Skipping potentially malicious executable in current directory: ${e}`);continue}return e}return null}catch{return null}}function v(e=b){let t=e.envOverride??process.env.CLAUDE_CODE_GIT_BASH_PATH;if(t)return e.checkExists(t)?t:null;let n=_(`bash`,e);if(n&&e.checkExists(n))return n;let r=_(`git`,e);if(r){let t=[m.join(r,`..`,`..`,`bin`,`bash.exe`),m.join(r,`..`,`..`,`usr`,`bin`,`bash.exe`),m.join(r,`..`,`bash.exe`)];for(let n of t)if(e.checkExists(n))return n}return g(e.checkExists,e.userProfile)}function y(){let e=x();if(e!==null)return e;let t=process.env.CLAUDE_CODE_GIT_BASH_PATH;console.error(t?`Work Mate was unable to find CLAUDE_CODE_GIT_BASH_PATH path "${t}"`:`Work Mate on Windows requires git-bash (https://git-scm.com/downloads/win). If installed but not in PATH, set environment variable pointing to your bash.exe, similar to: CLAUDE_CODE_GIT_BASH_PATH=C:\\Program Files\\Git\\bin\\bash.exe`),process.exit(1)}var b,x,S,C,w=e((()=>{n(),r(),a(),l(),c(),f(),b={checkExists:p,execCommand:e=>u(e,{stdio:`pipe`,encoding:`utf8`}).trim(),cwdFn:i,userProfile:process.env.USERPROFILE,envOverride:void 0},x=t(()=>v()),S=s(e=>{if(e.startsWith(`\\\\`))return e.replace(/\\/g,`/`);let t=e.match(/^([A-Za-z]):[/\\]/);return t?`/`+t[1].toLowerCase()+e.slice(2).replace(/\\/g,`/`):e.replace(/\\/g,`/`)},e=>e,500),C=s(e=>{if(e.startsWith(`//`))return e.replace(/\//g,`\\`);let t=e.match(/^\/cygdrive\/([A-Za-z])(\/|$)/);if(t){let n=t[1].toUpperCase(),r=e.slice((`/cygdrive/`+t[1]).length);return n+`:`+(r||`\\`).replace(/\//g,`\\`)}let n=e.match(/^\/([A-Za-z])(\/|$)/);if(n){let t=n[1].toUpperCase(),r=e.slice(2);return t+`:`+(r||`\\`).replace(/\//g,`\\`)}return e.replace(/\//g,`\\`)},e=>e,500)}));export{C as a,w as i,x as n,h as o,v as r,S as s,y as t};
@@ -1,6 +0,0 @@
1
- import{l as e,o as t,u as n}from"./envUtils-BDhHQY0-.js";import{At as r,Tt as i,_t as a,dD as o,fD as s,ld as c}from"./loadAgentsDir-CKSb56Gp.js";import{t as l}from"./src-P_wYS_NJ2.js";import{C as u,F as d,S as f,a as p,l as m,w as h,z as g}from"./debug-BdqxZ7rV.js";import{Ut as _}from"./settings-Xbq6AaD-.js";import{O as v,k as y}from"./git-B9uvt96d.js";import{o as b,s as x}from"./log-CTFl4qpD.js";import{n as S,r as C}from"./analytics-DJobLaWP.js";import{C as w,l as T,v as E}from"./startupProfiler-jeId9f2i.js";import{Bt as D,Ot as O,_n as k,vn as A}from"./model-C2e73CJD.js";import{i as ee,t as j}from"./sessionIdCompat-DMayYBrf.js";import{n as te}from"./firstPartyEventLogger-DhEPWcit.js";import{t as M}from"./datadog-DrmHyl3_.js";import{n as N,o as P,r as F}from"./debugUtils-CezNYZ-4.js";import{t as I}from"./pollConfig-BgpfHQPJ.js";import{n as L,t as ne}from"./rcDebugLog-CARUIORE.js";import{a as R,i as z,n as B,o as re,r as V,s as H,t as ie}from"./capacityWake-L7b1mMft.js";import{a as ae,i as oe,n as se,r as U,t as ce}from"./workSecret-DtiFreRl.js";import{i as W}from"./trustedDevice-j1u2TG5U.js";import{t as le}from"./jwtUtils-C9sdGhvT.js";import{i as G,n as K,r as q}from"./cliLaunch-BWWOgBFh.js";import{t as J}from"./lib-BlVGipXx.js";import{hostname as Y,tmpdir as ue}from"os";import{dirname as X,join as de,resolve as Z}from"path";import{createWriteStream as fe}from"fs";import{randomUUID as Q}from"crypto";import{spawn as pe}from"child_process";import{createInterface as me}from"readline";t(),g(),f(),v(),b(),S(),E(),k(),s(),M(),te(),i(),ne(),G(),J(),_(),l(),p(),c(),j(),P();var he=10,$=10;function ge(e){return e.replace(/[^a-zA-Z0-9_-]/g,`_`)}var _e={Read:`Reading`,Write:`Writing`,Edit:`Editing`,MultiEdit:`Editing`,Bash:`Running`,Glob:`Searching`,Grep:`Searching`,WebFetch:`Fetching`,WebSearch:`Searching`,Task:`Running task`,FileReadTool:`Reading`,FileWriteTool:`Writing`,FileEditTool:`Editing`,GlobTool:`Searching`,GrepTool:`Searching`,BashTool:`Running`,NotebookEditTool:`Editing notebook`,LSP:`LSP`};function ve(e,t){let n=_e[e]??e,r=t.file_path??t.filePath??t.pattern??t.command?.slice(0,60)??t.url??t.query??``;return r?`${n} ${r}`:n}function ye(e,t,n){let r;try{r=u(e)}catch{return[]}if(!r||typeof r!=`object`)return[];let i=r,a=[],o=Date.now();switch(i.type){case`assistant`:{let e=i.message;if(!e)break;let r=e.content;if(!Array.isArray(r))break;for(let e of r){if(!e||typeof e!=`object`)continue;let r=e;if(r.type===`tool_use`){let e=r.name??`Tool`,i=r.input??{},s=ve(e,i);a.push({type:`tool_start`,summary:s,timestamp:o}),n(`[bridge:activity] sessionId=${t} tool_use name=${e} ${xe(i)}`)}else if(r.type===`text`){let e=r.text??``;e.length>0&&(a.push({type:`text`,summary:e.slice(0,80),timestamp:o}),n(`[bridge:activity] sessionId=${t} text "${e.slice(0,100)}"`))}}break}case`result`:{let e=i.subtype;if(e===`success`)a.push({type:`result`,summary:`Session completed`,timestamp:o}),n(`[bridge:activity] sessionId=${t} result subtype=success`);else if(e){let r=i.errors?.[0]??`Error: ${e}`;a.push({type:`error`,summary:r,timestamp:o}),n(`[bridge:activity] sessionId=${t} result subtype=${e} error="${r}"`)}else n(`[bridge:activity] sessionId=${t} result subtype=undefined`);break}default:break}return a}function be(e){if(e.parent_tool_use_id!=null||e.isSynthetic||e.isReplay)return;let t=e.message?.content,n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let e of t)if(e&&typeof e==`object`&&e.type===`text`){n=e.text;break}}return n=n?.trim(),n||void 0}function xe(e){let t=[];for(let[n,r]of Object.entries(e))if(typeof r==`string`&&t.push(`${n}="${r.slice(0,100)}"`),t.length>=3)break;return t.join(` `)}function Se(e){return{spawn(t,n){let r=ge(t.sessionId),i;if(e.debugFile){let t=e.debugFile.lastIndexOf(`.`);i=t>0?`${e.debugFile.slice(0,t)}-${r}${e.debugFile.slice(t)}`:`${e.debugFile}-${r}`}else e.verbose&&(i=de(ue(),`claude`,`bridge-session-${r}.log`));let a=null,o;e.debugFile&&(o=de(X(e.debugFile),`bridge-transcript-${r}.jsonl`),a=fe(o,{flags:`a`}),a.on(`error`,t=>{e.onDebug(`[bridge:session] Transcript write error: ${t.message}`),a=null}),e.onDebug(`[bridge:session] Transcript log: ${o}`));let s=[...e.scriptArgs,`--print`,`--sdk-url`,t.sdkUrl,`--session-id`,t.sessionId,`--input-format`,`stream-json`,`--output-format`,`stream-json`,`--replay-user-messages`,...e.verbose?[`--verbose`]:[],...i?[`--debug-file`,i]:[],...e.permissionMode?[`--permission-mode`,e.permissionMode]:[]],c={...e.env,CLAUDE_CODE_OAUTH_TOKEN:void 0,CLAUDE_CODE_ENVIRONMENT_KIND:`bridge`,...e.sandbox&&{CLAUDE_CODE_FORCE_SANDBOX:`1`},CLAUDE_CODE_SESSION_ACCESS_TOKEN:t.accessToken,CLAUDE_CODE_POST_FOR_SESSION_INGRESS_V2:`1`,...t.useCcrV2&&{CLAUDE_CODE_USE_CCR_V2:`1`,CLAUDE_CODE_WORKER_EPOCH:String(t.workerEpoch)}};e.onDebug(`[bridge:session] Spawning sessionId=${t.sessionId} sdkUrl=${t.sdkUrl} accessToken=${t.accessToken?`present`:`MISSING`}`),e.onDebug(`[bridge:session] Child args: ${s.join(` `)}`),i&&e.onDebug(`[bridge:session] Debug log: ${i}`);let l=pe(e.execPath,s,{cwd:n,stdio:[`pipe`,`pipe`,`pipe`],env:c,windowsHide:!0});e.onDebug(`[bridge:session] sessionId=${t.sessionId} pid=${l.pid}`);let d=[],f=null,p=[],m=!1,g=!1;l.stderr&&me({input:l.stderr}).on(`line`,t=>{e.verbose&&process.stderr.write(t+`
2
- `),p.length>=$&&p.shift(),p.push(t)}),l.stdout&&me({input:l.stdout}).on(`line`,n=>{a&&a.write(n+`
3
- `),e.onDebug(`[bridge:ws] sessionId=${t.sessionId} <<< ${N(n)}`),e.verbose&&process.stderr.write(n+`
4
- `);let r=ye(n,t.sessionId,e.onDebug);for(let n of r)d.length>=he&&d.shift(),d.push(n),f=n,e.onActivity?.(t.sessionId,n);{let r;try{r=u(n)}catch{}if(r&&typeof r==`object`){let n=r;if(n.type===`control_request`)n.request?.subtype===`can_use_tool`&&e.onPermissionRequest&&e.onPermissionRequest(t.sessionId,r,t.accessToken);else if(n.type===`user`&&!g&&t.onFirstUserMessage){let e=be(n);e&&(g=!0,t.onFirstUserMessage(e))}}}});let _=new Promise(n=>{l.on(`close`,(r,i)=>{a&&(a.end(),a=null),i===`SIGTERM`||i===`SIGINT`?(e.onDebug(`[bridge:session] sessionId=${t.sessionId} interrupted signal=${i} pid=${l.pid}`),n(`interrupted`)):r===0?(e.onDebug(`[bridge:session] sessionId=${t.sessionId} completed exit_code=0 pid=${l.pid}`),n(`completed`)):(e.onDebug(`[bridge:session] sessionId=${t.sessionId} failed exit_code=${r} pid=${l.pid}`),n(`failed`))}),l.on(`error`,r=>{e.onDebug(`[bridge:session] sessionId=${t.sessionId} spawn error: ${r.message}`),n(`failed`)})}),v={sessionId:t.sessionId,done:_,activities:d,accessToken:t.accessToken,lastStderr:p,get currentActivity(){return f},kill(){l.killed||(e.onDebug(`[bridge:session] Sending SIGTERM to sessionId=${t.sessionId} pid=${l.pid}`),process.platform===`win32`?l.kill():l.kill(`SIGTERM`))},forceKill(){!m&&l.pid&&(m=!0,e.onDebug(`[bridge:session] Sending SIGKILL to sessionId=${t.sessionId} pid=${l.pid}`),process.platform===`win32`?l.kill():l.kill(`SIGKILL`))},writeStdin(n){l.stdin&&!l.stdin.destroyed&&(e.onDebug(`[bridge:ws] sessionId=${t.sessionId} >>> ${N(n)}`),l.stdin.write(n))},updateAccessToken(n){v.accessToken=n,v.writeStdin(h({type:`update_environment_variables`,variables:{CLAUDE_CODE_SESSION_ACCESS_TOKEN:n}})+`
5
- `),e.onDebug(`[bridge:session] Sent token refresh via stdin for sessionId=${t.sessionId}`)}};return v}}}p(),c(),P();var Ce={connInitialMs:2e3,connCapMs:12e4,connGiveUpMs:6e5,generalInitialMs:500,generalCapMs:3e4,generalGiveUpMs:6e5},we=1e3;function Te(e){return e.connCapMs*2}function Ee(){let e=[...K()],t=q();return t&&e.push(t),e}function De(e,t,n){try{return e.spawn(t,n)}catch(e){let t=d(e);return x(Error(`Session spawn failed: ${t}`)),t}}async function Oe(t,i,s,c,l,u,f,p=Ce,h,g){let _=new AbortController;f.aborted?_.abort():f.addEventListener(`abort`,()=>_.abort(),{once:!0});let v=_.signal,b=new Map,S=new Map,w=new Map,E=new Map,D=new Map,O=new Map,k=new Set,j=new Map,te=new Set,M=new Set,N=ie(v);async function P(){L(`heartbeat: checking ${b.size} active session(s)`);let e=!1,t=!1,n=[];for(let[r]of b){let a=w.get(r),o=D.get(r);if(!(!a||!o))try{await c.heartbeatWork(i,a,o),e=!0}catch(e){m(`[bridge:heartbeat] Failed for sessionId=${r} workId=${a}: ${d(e)}`),e instanceof B&&(C(`tengu_bridge_heartbeat_error`,{status:e.status,error_type:e.status===401||e.status===403?`auth_failed`:`fatal`}),e.status===401||e.status===403?n.push(r):t=!0)}}for(let e of n){u.logVerbose(`Session ${e} token expired — re-queuing via bridge/reconnect`);try{await c.reconnectSession(i,e),m(`[bridge:heartbeat] Re-queued sessionId=${e} via bridge/reconnect`)}catch(t){u.logError(`Failed to refresh session ${e} token: ${d(t)}`),m(`[bridge:heartbeat] reconnectSession(${e}) failed: ${d(t)}`,{level:`error`})}}return t?`fatal`:n.length>0?`auth_failed`:e?`ok`:`failed`}let ne=new Set,V=g?le({getAccessToken:g,onRefresh:(e,t)=>{let n=b.get(e);n&&(ne.has(e)?(u.logVerbose(`Refreshing session ${e} token via bridge/reconnect`),c.reconnectSession(i,e).catch(t=>{u.logError(`Failed to refresh session ${e} token: ${d(t)}`),m(`[bridge:token] reconnectSession(${e}) failed: ${d(t)}`,{level:`error`})})):n.updateAccessToken(t))},label:`bridge`}):null,H=Date.now(),W=new Set;function G(e){W.add(e),e.finally(()=>W.delete(e))}let K=0,q=0,J=null,Y=null,X=null,Z=null;m(`[bridge:work] Starting poll loop spawnMode=${t.spawnMode} maxSessions=${t.maxSessions} environmentId=${i}`),y(`info`,`bridge_loop_started`,{max_sessions:t.maxSessions,spawn_mode:t.spawnMode}),u.printBanner(t,i),u.updateSessionCount(0,t.maxSessions,t.spawnMode),h&&u.setAttached(h);function fe(){u.updateSessionCount(b.size,t.maxSessions,t.spawnMode);for(let[e,t]of b){let n=t.currentActivity;n&&u.updateSessionActivity(E.get(e)??e,n)}if(b.size===0){u.updateIdleStatus();return}let[e,n]=[...b.entries()].pop(),r=S.get(e);if(!r)return;let i=n.currentActivity;if(!i||i.type===`result`||i.type===`error`){t.maxSessions>1&&u.refreshDisplay();return}let a=T(Date.now()-r),o=n.activities.filter(e=>e.type===`tool_start`).slice(-5).map(e=>e.summary);u.updateSessionStatus(e,a,i,o)}function Q(){pe(),fe(),Z=setInterval(fe,we)}function pe(){Z&&(clearInterval(Z),Z=null)}function me(e,n,a){return o=>{let s=w.get(e);L(`session done: sessionId=${e} workId=${s??`none`} status=${o} wasTimedOut=${te.has(e)} duration=${Math.round((Date.now()-n)/1e3)}s stderr=${a.lastStderr.length>0?a.lastStderr.join(`\\n`).slice(0,500):`(none)`}`),b.delete(e),S.delete(e),w.delete(e),D.delete(e);let l=E.get(e)??e;E.delete(e),u.removeSession(l),M.delete(l),ne.delete(e);let f=O.get(e);f&&(clearTimeout(f),O.delete(e)),V?.cancel(e),N.wake();let h=te.delete(e),g=h&&o===`interrupted`?`failed`:o,A=Date.now()-n;m(`[bridge:session] sessionId=${e} workId=${s??`unknown`} exited status=${g} duration=${T(A)}`),C(`tengu_bridge_session_done`,{status:g,duration_ms:A}),y(`info`,`bridge_session_done`,{status:g,duration_ms:A}),u.clearStatus(),pe();let ee=a.lastStderr.length>0?a.lastStderr.join(`
6
- `):void 0,P;switch(g){case`completed`:u.logSessionComplete(e,A);break;case`failed`:!h&&!v.aborted&&(P=ee??`Process exited with error`,u.logSessionFailed(e,P),x(Error(`Bridge session failed: ${P}`)));break;case`interrupted`:u.logVerbose(`Session ${e} interrupted`);break}g!==`interrupted`&&s&&(G(Pe(c,i,s,u,p.stopWorkBaseDelayMs)),k.add(s));let F=j.get(e);if(F&&(j.delete(e),G(r(F.worktreePath,F.worktreeBranch,F.gitRoot,F.hookBased).catch(e=>u.logVerbose(`Failed to remove worktree ${F.worktreePath}: ${d(e)}`)))),g!==`interrupted`&&!v.aborted)if(t.spawnMode!==`single-session`)G(c.archiveSession(l).catch(t=>u.logVerbose(`Failed to archive session ${e}: ${d(t)}`))),m(`[bridge:session] Session ${g}, returning to idle (multi-session mode)`);else{m(`[bridge:session] Session ${g}, aborting poll loop to tear down environment`),_.abort();return}v.aborted||Q()}}for(h||Q();!v.aborted;){let f=I();try{L(`poll: envId=${i} activeSessions=${b.size}`);let g=await c.pollForWork(i,s,v,f.reclaim_older_than_ms);if(J!==null||Y!==null){let e=Date.now()-(J??Y??Date.now());u.logReconnected(e),m(`[bridge:poll] Reconnected after ${T(e)}`),C(`tengu_bridge_reconnected`,{disconnected_ms:e})}if(K=0,q=0,J=null,Y=null,X=null,!g){if(b.size>=t.maxSessions){let e=f.multisession_poll_interval_ms_at_capacity;if(f.non_exclusive_heartbeat_interval_ms>0){C(`tengu_bridge_heartbeat_mode_entered`,{active_sessions:b.size,heartbeat_interval_ms:f.non_exclusive_heartbeat_interval_ms});let n=e>0?Date.now()+e:null,r=`ok`,i=0;for(;!v.aborted&&b.size>=t.maxSessions&&(n===null||Date.now()<n);){let e=I();if(e.non_exclusive_heartbeat_interval_ms<=0)break;let t=N.signal();if(r=await P(),r===`auth_failed`||r===`fatal`){t.cleanup();break}i++,await A(e.non_exclusive_heartbeat_interval_ms,t.signal),t.cleanup()}let a=r===`auth_failed`||r===`fatal`?r:v.aborted?`shutdown`:b.size<t.maxSessions?`capacity_changed`:n!==null&&Date.now()>=n?`poll_due`:`config_disabled`;if(C(`tengu_bridge_heartbeat_mode_exited`,{reason:a,heartbeat_cycles:i,active_sessions:b.size}),a===`poll_due`&&m(`[bridge:poll] Heartbeat poll_due after ${i} cycles — falling through to pollForWork`),r===`auth_failed`||r===`fatal`){let t=N.signal();await A(e>0?e:f.non_exclusive_heartbeat_interval_ms,t.signal),t.cleanup()}}else if(e>0){let t=N.signal();await A(e,t.signal),t.cleanup()}}else await A(b.size>0?f.multisession_poll_interval_ms_partial_capacity:f.multisession_poll_interval_ms_not_at_capacity,v);continue}let _=b.size>=t.maxSessions;if(k.has(g.id)){if(m(`[bridge:work] Skipping already-completed workId=${g.id}`),_){let e=N.signal();f.non_exclusive_heartbeat_interval_ms>0?(await P(),await A(f.non_exclusive_heartbeat_interval_ms,e.signal)):f.multisession_poll_interval_ms_at_capacity>0&&await A(f.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}else await A(1e3,v);continue}let F;try{F=U(g.secret)}catch(e){let t=d(e);if(u.logError(`Failed to decode work secret for workId=${g.id}: ${t}`),C(`tengu_bridge_work_secret_failed`,{}),k.add(g.id),G(Pe(c,i,g.id,u,p.stopWorkBaseDelayMs)),_){let e=N.signal();f.non_exclusive_heartbeat_interval_ms>0?(await P(),await A(f.non_exclusive_heartbeat_interval_ms,e.signal)):f.multisession_poll_interval_ms_at_capacity>0&&await A(f.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}continue}let R=async()=>{m(`[bridge:work] Acknowledging workId=${g.id}`);try{await c.acknowledgeWork(i,g.id,F.session_ingress_token)}catch(e){m(`[bridge:work] Acknowledge failed workId=${g.id}: ${d(e)}`)}},z=g.data.type;switch(g.data.type){case`healthcheck`:await R(),m(`[bridge:work] Healthcheck received`),u.logVerbose(`Healthcheck received`);break;case`session`:{let s=g.data.id;L(`work received: type=session sessionId=${s} workId=${g.id}`);try{re(s,`session_id`)}catch{await R(),u.logError(`Invalid session_id received: ${s}`);break}let f=b.get(s);if(f){f.updateAccessToken(F.session_ingress_token),D.set(s,F.session_ingress_token),w.set(s,g.id),V?.schedule(s,F.session_ingress_token),m(`[bridge:work] Updated access token for existing sessionId=${s} workId=${g.id}`),await R();break}if(b.size>=t.maxSessions){m(`[bridge:work] At capacity (${b.size}/${t.maxSessions}), cannot spawn new session for workId=${g.id}`);break}await R();let _=Date.now(),T,N=!1,P;if(F.use_code_sessions===!0||e(process.env.CLAUDE_BRIDGE_USE_CCR_V2)){T=ce(t.apiBaseUrl,s);for(let e=1;e<=2;e++)try{P=await oe(T,F.session_ingress_token),N=!0,m(`[bridge:session] CCR v2: registered worker sessionId=${s} epoch=${P} attempt=${e}`);break}catch(t){let n=d(t);if(e<2){if(m(`[bridge:session] CCR v2: registerWorker attempt ${e} failed, retrying: ${n}`),await A(2e3,v),v.aborted)break;continue}u.logError(`CCR v2 worker registration failed for session ${s}: ${n}`),x(Error(`registerWorker failed: ${n}`)),k.add(g.id),G(Pe(c,i,g.id,u,p.stopWorkBaseDelayMs))}if(!N)break}else T=se(t.sessionIngressUrl,s);let I=t.spawnMode,z=t.dir,B=0;if(I===`worktree`&&(h===void 0||!ae(s,h))){let e=Date.now();try{let t=await a(`bridge-${ge(s)}`);B=Date.now()-e,j.set(s,{worktreePath:t.worktreePath,worktreeBranch:t.worktreeBranch,gitRoot:t.gitRoot,hookBased:t.hookBased}),z=t.worktreePath,m(`[bridge:session] Created worktree for sessionId=${s} at ${t.worktreePath}`)}catch(e){let t=d(e);u.logError(`Failed to create worktree for session ${s}: ${t}`),x(Error(`Worktree creation failed: ${t}`)),k.add(g.id),G(Pe(c,i,g.id,u,p.stopWorkBaseDelayMs));break}}m(`[bridge:session] Spawning sessionId=${s} sdkUrl=${T}`);let H=ee(s);L(`spawning session: sessionId=${s} sdkUrl=${T} useCcrV2=${N} workerEpoch=${P} dir=${z} accessToken=${F.session_ingress_token?F.session_ingress_token.slice(0,8)+`...`:`NONE`}`);let ie=De(l,{sessionId:s,sdkUrl:T,accessToken:F.session_ingress_token,useCcrV2:N,workerEpoch:P,onFirstUserMessage:e=>{if(M.has(H))return;M.add(H);let n=Le(e);u.setSessionTitle(H,n),m(`[bridge:title] derived title for ${H}: ${n}`),import(`./createSession-DnykRoia.js`).then(({updateBridgeSessionTitle:e})=>e(H,n,{baseUrl:t.apiBaseUrl})).catch(e=>m(`[bridge:title] failed to update title for ${H}: ${e}`,{level:`error`}))}},z);if(typeof ie==`string`){u.logError(`Failed to spawn session ${s}: ${ie}`);let e=j.get(s);e&&(j.delete(s),G(r(e.worktreePath,e.worktreeBranch,e.gitRoot,e.hookBased).catch(t=>u.logVerbose(`Failed to remove worktree ${e.worktreePath}: ${d(t)}`)))),k.add(g.id),G(Pe(c,i,g.id,u,p.stopWorkBaseDelayMs));break}let U=ie,W=Date.now()-_;C(`tengu_bridge_session_started`,{active_sessions:b.size,spawn_mode:I,in_worktree:j.has(s),spawn_duration_ms:W,worktree_create_ms:B,inProtectedNamespace:n()}),y(`info`,`bridge_session_started`,{spawn_mode:I,in_worktree:j.has(s),spawn_duration_ms:W,worktree_create_ms:B}),b.set(s,U),w.set(s,g.id),D.set(s,F.session_ingress_token),E.set(s,H);let le=Date.now();S.set(s,le),u.logSessionStart(s,`Session ${s}`);let K=ge(s),q;if(t.debugFile){let e=t.debugFile.lastIndexOf(`.`);q=e>0?`${t.debugFile.slice(0,e)}-${K}${t.debugFile.slice(e)}`:`${t.debugFile}-${K}`}else t.verbose&&(q=de(ue(),`claude`,`bridge-session-${K}.log`));q&&u.logVerbose(`Debug log: ${q}`),u.addSession(H,o(H,t.sessionIngressUrl)),Q(),u.setAttached(H),Re(H,t.apiBaseUrl).then(e=>{e&&b.has(s)&&(M.add(H),u.setSessionTitle(H,e),m(`[bridge:title] server title for ${H}: ${e}`))}).catch(e=>m(`[bridge:title] failed to fetch title for ${H}: ${e}`,{level:`error`}));let J=t.sessionTimeoutMs??864e5;if(J>0){let e=setTimeout(Fe,J,s,J,u,te,U);O.set(s,e)}N&&ne.add(s),V?.schedule(s,F.session_ingress_token),U.done.then(me(s,le,U));break}default:await R(),m(`[bridge:work] Unknown work type: ${z}, skipping`);break}if(_){let e=N.signal();f.non_exclusive_heartbeat_interval_ms>0?(await P(),await A(f.non_exclusive_heartbeat_interval_ms,e.signal)):f.multisession_poll_interval_ms_at_capacity>0&&await A(f.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}}catch(e){if(v.aborted)break;if(e instanceof B){z(e.errorType)?u.logStatus(e.message):R(e)?m(`[bridge:work] Suppressed 403 error: ${e.message}`):(u.logError(e.message),x(e)),C(`tengu_bridge_fatal_error`,{status:e.status,error_type:e.errorType}),y(z(e.errorType)?`info`:`error`,`bridge_fatal_error`,{status:e.status,error_type:e.errorType});break}let t=F(e);if(L(`poll error: ${t} isConn=${Ae(e)} isServer=${je(e)} activeSessions=${b.size}`),Ae(e)||je(e)){let e=Date.now();X!==null&&e-X>Te(p)&&(m(`[bridge:work] Detected system sleep (${Math.round((e-X)/1e3)}s gap), resetting error budget`),y(`info`,`bridge_poll_sleep_detected`,{gapMs:e-X}),J=null,K=0,Y=null,q=0),X=e,J||(J=e);let n=e-J;if(n>=p.connGiveUpMs){u.logError(`Server unreachable for ${Math.round(n/6e4)} minutes, giving up.`),C(`tengu_bridge_poll_give_up`,{error_type:`connection`,elapsed_ms:n}),y(`error`,`bridge_poll_give_up`,{error_type:`connection`,elapsed_ms:n});break}Y=null,q=0,K=K?Math.min(K*2,p.connCapMs):p.connInitialMs;let r=Me(K);u.logVerbose(`Connection error, retrying in ${Ne(r)} (${Math.round(n/1e3)}s elapsed): ${t}`),u.updateReconnectingStatus(Ne(r),T(n)),I().non_exclusive_heartbeat_interval_ms>0&&await P(),await A(r,v)}else{let e=Date.now();X!==null&&e-X>Te(p)&&(m(`[bridge:work] Detected system sleep (${Math.round((e-X)/1e3)}s gap), resetting error budget`),y(`info`,`bridge_poll_sleep_detected`,{gapMs:e-X}),J=null,K=0,Y=null,q=0),X=e,Y||(Y=e);let n=e-Y;if(n>=p.generalGiveUpMs){u.logError(`Persistent errors for ${Math.round(n/6e4)} minutes, giving up.`),C(`tengu_bridge_poll_give_up`,{error_type:`general`,elapsed_ms:n}),y(`error`,`bridge_poll_give_up`,{error_type:`general`,elapsed_ms:n});break}J=null,K=0,q=q?Math.min(q*2,p.generalCapMs):p.generalInitialMs;let r=Me(q);u.logVerbose(`Poll failed, retrying in ${Ne(r)} (${Math.round(n/1e3)}s elapsed): ${t}`),u.updateReconnectingStatus(Ne(r),T(n)),I().non_exclusive_heartbeat_interval_ms>0&&await P(),await A(r,v)}}}pe(),u.clearStatus();let he=Date.now()-H;C(`tengu_bridge_shutdown`,{active_sessions:b.size,loop_duration_ms:he}),y(`info`,`bridge_shutdown`,{active_sessions:b.size,loop_duration_ms:he});let $=new Set(b.keys());h&&$.add(h);let _e=new Map(E);if(b.size>0){m(`[bridge:shutdown] Shutting down ${b.size} active session(s)`),u.logStatus(`Shutting down ${b.size} active session(s)\u2026`);let e=new Map(w);for(let[e,t]of b.entries())m(`[bridge:shutdown] Sending SIGTERM to sessionId=${e}`),t.kill();let t=new AbortController;await Promise.race([Promise.allSettled([...b.values()].map(e=>e.done)),A(p.shutdownGraceMs??3e4,t.signal)]),t.abort();for(let[e,t]of b.entries())m(`[bridge:shutdown] Force-killing stuck sessionId=${e}`),t.forceKill();for(let e of O.values())clearTimeout(e);if(O.clear(),V?.cancelAll(),j.size>0){let e=[...j.values()];j.clear(),m(`[bridge:shutdown] Cleaning up ${e.length} worktree(s)`),await Promise.allSettled(e.map(e=>r(e.worktreePath,e.worktreeBranch,e.gitRoot,e.hookBased)))}await Promise.allSettled([...e.entries()].map(([e,t])=>c.stopWork(i,t,!0).catch(n=>u.logVerbose(`Failed to stop work ${t} for session ${e}: ${d(n)}`))))}W.size>0&&await Promise.allSettled([...W]),$.size>0&&(m(`[bridge:shutdown] Archiving ${$.size} session(s)`),await Promise.allSettled([...$].map(e=>c.archiveSession(_e.get(e)??ee(e)).catch(t=>u.logVerbose(`Failed to archive session ${e}: ${d(t)}`)))));try{await c.deregisterEnvironment(i),m(`[bridge:shutdown] Environment deregistered, bridge offline`),u.logVerbose(`Environment deregistered.`)}catch(e){u.logVerbose(`Failed to deregister environment: ${d(e)}`)}let{clearBridgePointer:ve}=await import(`./bridgePointer-D4W9GpWw.js`);await ve(t.dir),u.logVerbose(`Environment offline.`)}var ke=new Set([`ECONNREFUSED`,`ECONNRESET`,`ETIMEDOUT`,`ENETUNREACH`,`EHOSTUNREACH`]);function Ae(e){return!!(e&&typeof e==`object`&&`code`in e&&typeof e.code==`string`&&ke.has(e.code))}function je(e){return!!e&&typeof e==`object`&&`code`in e&&typeof e.code==`string`&&e.code===`ERR_BAD_RESPONSE`}function Me(e){return Math.max(0,e+e*.25*(2*Math.random()-1))}function Ne(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`}async function Pe(e,t,n,r,i=1e3){for(let a=1;a<=3;a++)try{await e.stopWork(t,n,!1),m(`[bridge:work] stopWork succeeded for workId=${n} on attempt ${a}/3`);return}catch(e){if(e instanceof B){R(e)?m(`[bridge:work] Suppressed stopWork 403 for ${n}: ${e.message}`):r.logError(`Failed to stop work ${n}: ${e.message}`),y(`error`,`bridge_stop_work_failed`,{attempts:a,fatal:!0});return}let t=d(e);if(a<3){let e=Me(i*2**(a-1));r.logVerbose(`Failed to stop work ${n} (attempt ${a}/3), retrying in ${Ne(e)}: ${t}`),await A(e)}else r.logError(`Failed to stop work ${n} after 3 attempts: ${t}`),y(`error`,`bridge_stop_work_failed`,{attempts:3})}}function Fe(e,t,n,r,i){m(`[bridge:session] sessionId=${e} timed out after ${T(t)}`),C(`tengu_bridge_session_timeout`,{timeout_ms:t}),n.logSessionFailed(e,`Session timed out after ${T(t)}`),r.add(e),i.kill()}var Ie=80;function Le(e){return w(e.replace(/\s+/g,` `).trim(),Ie)}async function Re(e,t){let{getBridgeSession:n}=await import(`./createSession-DnykRoia.js`);return(await n(e,{baseUrl:t}))?.title||void 0}var ze=class extends Error{constructor(e){super(e),this.name=`BridgeHeadlessPermanentError`}};async function Be(e,t){let{dir:n,log:r}=e;process.chdir(n);let{setOriginalCwd:i,setCwdState:a}=await import(`./state-B4HwLt8i.js`);i(n),a(n);let{enableConfigs:o,checkHasTrustDialogAccepted:s}=await import(`./config-CVvUNkj2.js`);o();let{initSinks:c}=await import(`./sinks-D3bXeHlQ.js`);if(c(),!s())throw new ze(`Workspace not trusted: ${n}. Run \`claude\` in that directory first to accept the trust dialog.`);if(!e.getAccessToken())throw Error(H);let{getBridgeBaseUrl:l}=await import(`./bridgeConfig-Dmc1ZDev.js`),u=l();if(u.startsWith(`http://`)&&!u.includes(`localhost`)&&!u.includes(`127.0.0.1`))throw new ze(`Remote Control base URL uses HTTP. Only HTTPS or localhost HTTP is allowed.`);let f=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||u,{getBranch:p,getRemoteUrl:m,findGitRoot:h}=await import(`./git-BfS5Hk4S.js`),{hasWorktreeCreateHook:g}=await import(`./hooks-DGd02IKF.js`);if(e.spawnMode===`worktree`&&!(g()||h(n)!==null))throw new ze(`Worktree mode requires a git repository or WorktreeCreate hooks. Directory ${n} has neither.`);let _=await p(),v=await m(),y=Y(),b=Q(),x={dir:n,machineName:y,branch:_,gitRepoUrl:v,maxSessions:e.capacity,spawnMode:e.spawnMode,verbose:!1,sandbox:e.sandbox,bridgeId:b,workerType:`claude_code`,environmentId:Q(),apiBaseUrl:u,sessionIngressUrl:f,sessionTimeoutMs:e.sessionTimeoutMs},S=V({baseUrl:u,getAccessToken:e.getAccessToken,runnerVersion:`0.0.9`,onDebug:r,onAuth401:e.onAuth401,getTrustedDeviceToken:W}),C,w;try{let e=await S.registerBridgeEnvironment(x);C=e.environment_id,w=e.environment_secret}catch(e){throw Error(`Bridge registration failed: ${d(e)}`)}let T=Se({execPath:process.execPath,scriptArgs:Ee(),env:process.env,verbose:!1,sandbox:e.sandbox,permissionMode:e.permissionMode,onDebug:r}),E=Ve(r);E.printBanner(x,C);let D;if(e.createSessionOnStart){let{createBridgeSession:n}=await import(`./createSession-DnykRoia.js`);try{let i=await n({environmentId:C,title:e.name,events:[],gitRepoUrl:v,branch:_,signal:t,baseUrl:u,getAccessToken:e.getAccessToken,permissionMode:e.permissionMode});i&&(D=i,r(`created initial session ${i}`))}catch(e){r(`session pre-creation failed (non-fatal): ${d(e)}`)}}await Oe(x,C,w,S,T,E,t,void 0,D,async()=>e.getAccessToken())}function Ve(e){let t=()=>{};return{printBanner:(t,n)=>e(`registered environmentId=${n} dir=${t.dir} spawnMode=${t.spawnMode} capacity=${t.maxSessions}`),logSessionStart:(t,n)=>e(`session start ${t}`),logSessionComplete:(t,n)=>e(`session complete ${t} (${n}ms)`),logSessionFailed:(t,n)=>e(`session failed ${t}: ${n}`),logStatus:e,logVerbose:e,logError:t=>e(`error: ${t}`),logReconnected:t=>e(`reconnected after ${t}ms`),addSession:(t,n)=>e(`session attached ${t}`),removeSession:t=>e(`session detached ${t}`),updateIdleStatus:t,updateReconnectingStatus:t,updateSessionStatus:t,updateSessionActivity:t,updateSessionCount:t,updateFailedStatus:t,setSpawnModeDisplay:t,setRepoInfo:t,setDebugLogPath:t,setAttached:t,setSessionTitle:t,clearStatus:t,toggleQr:t,refreshDisplay:t}}D(),g();var He=78,Ue=1;async function We(e){if(!e){console.error(`Error: --daemon-worker requires a worker kind`),process.exitCode=He;return}switch(e){case`remoteControl`:await Ge();break;default:console.error(`Error: unknown daemon worker kind '${e}'`),process.exitCode=He}}async function Ge(){let e=process.env.DAEMON_WORKER_DIR||Z(`.`),t=process.env.DAEMON_WORKER_NAME||void 0,n=process.env.DAEMON_WORKER_SPAWN_MODE||`same-dir`,r=parseInt(process.env.DAEMON_WORKER_CAPACITY||`4`,10),i=process.env.DAEMON_WORKER_PERMISSION||void 0,a=process.env.DAEMON_WORKER_SANDBOX===`1`,o=process.env.DAEMON_WORKER_TIMEOUT_MS?parseInt(process.env.DAEMON_WORKER_TIMEOUT_MS,10):void 0,s=process.env.DAEMON_WORKER_CREATE_SESSION!==`0`,c=new AbortController,l=()=>c.abort();process.on(`SIGTERM`,l),process.on(`SIGINT`,l);let u={dir:e,name:t,spawnMode:n,capacity:r,permissionMode:i,sandbox:a,sessionTimeoutMs:o,createSessionOnStart:s,getAccessToken:()=>O()?.accessToken,onAuth401:async e=>!!O()?.accessToken,log:e=>{console.log(`[remoteControl] ${e}`)}};try{await Be(u,c.signal)}catch(e){e instanceof ze?(console.error(`[remoteControl] permanent error: ${e.message}`),process.exitCode=He):(console.error(`[remoteControl] transient error: ${d(e)}`),process.exitCode=Ue)}finally{process.off(`SIGTERM`,l),process.off(`SIGINT`,l)}}export{We as runDaemonWorker};
@@ -1 +0,0 @@
1
- import{Tt as e,bt as t}from"./loadAgentsDir-CKSb56Gp.js";e();export{t as execIntoTmuxWorktree};