@ai-devkit/agent-manager 0.37.0 → 0.39.0

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 (357) hide show
  1. package/dist/AgentManager.d.ts +0 -4
  2. package/dist/AgentManager.d.ts.map +1 -1
  3. package/dist/AgentManager.js +2 -2
  4. package/dist/AgentManager.js.map +1 -1
  5. package/dist/__tests__/capacity/anthropic.test.js +115 -0
  6. package/dist/__tests__/capacity/anthropic.test.js.map +1 -0
  7. package/dist/__tests__/capacity/boundaries.test.js +45 -0
  8. package/dist/__tests__/capacity/boundaries.test.js.map +1 -0
  9. package/dist/__tests__/capacity/claude.test.js +3 -3
  10. package/dist/__tests__/capacity/claude.test.js.map +1 -1
  11. package/dist/__tests__/capacity/codex.test.js +3 -1
  12. package/dist/__tests__/capacity/codex.test.js.map +1 -1
  13. package/dist/__tests__/capacity/openai.test.js +21 -12
  14. package/dist/__tests__/capacity/openai.test.js.map +1 -1
  15. package/dist/__tests__/capacity/wham.test.js +1 -1
  16. package/dist/__tests__/capacity/wham.test.js.map +1 -1
  17. package/dist/__tests__/capacity/zai.test.js +7 -8
  18. package/dist/__tests__/capacity/zai.test.js.map +1 -1
  19. package/dist/__tests__/harnesses/claude/durable/ClaudePrintAgent.integration.test.js +2 -1
  20. package/dist/__tests__/harnesses/claude/durable/ClaudePrintAgent.integration.test.js.map +1 -1
  21. package/dist/__tests__/harnesses/claude/durable/ClaudePrintRunner.test.js.map +1 -1
  22. package/dist/__tests__/harnesses/codex/durable/CodexCliProbe.test.js +7 -15
  23. package/dist/__tests__/harnesses/codex/durable/CodexCliProbe.test.js.map +1 -1
  24. package/dist/__tests__/harnesses/codex/durable/CodexPrintAgent.integration.test.js +3 -1
  25. package/dist/__tests__/harnesses/codex/durable/CodexPrintAgent.integration.test.js.map +1 -1
  26. package/dist/__tests__/harnesses/codex/durable/CodexPrintAgentService.test.js +11 -26
  27. package/dist/__tests__/harnesses/codex/durable/CodexPrintAgentService.test.js.map +1 -1
  28. package/dist/__tests__/harnesses/codex/durable/CodexPrintRunner.test.js +3 -7
  29. package/dist/__tests__/harnesses/codex/durable/CodexPrintRunner.test.js.map +1 -1
  30. package/dist/__tests__/harnesses/devin/DevinAdapter.test.js +597 -0
  31. package/dist/__tests__/harnesses/devin/DevinAdapter.test.js.map +1 -0
  32. package/dist/__tests__/harnesses/devin/DevinAgentMapper.test.js +91 -0
  33. package/dist/__tests__/harnesses/devin/DevinAgentMapper.test.js.map +1 -0
  34. package/dist/__tests__/harnesses/devin/DevinSessionLocator.test.js +192 -0
  35. package/dist/__tests__/harnesses/devin/DevinSessionLocator.test.js.map +1 -0
  36. package/dist/__tests__/harnesses/devin/DevinSessionParser.test.js +407 -0
  37. package/dist/__tests__/harnesses/devin/DevinSessionParser.test.js.map +1 -0
  38. package/dist/__tests__/harnesses/devin/fixtures.js +95 -0
  39. package/dist/__tests__/harnesses/devin/fixtures.js.map +1 -0
  40. package/dist/__tests__/harnesses/pi/durable/PiCliProbe.test.js +5 -11
  41. package/dist/__tests__/harnesses/pi/durable/PiCliProbe.test.js.map +1 -1
  42. package/dist/__tests__/harnesses/pi/durable/PiPrintAgentService.test.js +9 -19
  43. package/dist/__tests__/harnesses/pi/durable/PiPrintAgentService.test.js.map +1 -1
  44. package/dist/__tests__/harnesses/pi/durable/PiPrintRunner.test.js +3 -7
  45. package/dist/__tests__/harnesses/pi/durable/PiPrintRunner.test.js.map +1 -1
  46. package/dist/__tests__/{readiness → harnesses/readiness}/AgentReadiness.test.js +95 -11
  47. package/dist/__tests__/harnesses/readiness/AgentReadiness.test.js.map +1 -0
  48. package/dist/__tests__/harnesses/runtimeProfiles.test.js +89 -0
  49. package/dist/__tests__/harnesses/runtimeProfiles.test.js.map +1 -0
  50. package/dist/__tests__/print/DurableAgent.test.js +4 -6
  51. package/dist/__tests__/print/DurableAgent.test.js.map +1 -1
  52. package/dist/__tests__/print/DurableAgentRepository.test.js +1 -12
  53. package/dist/__tests__/print/DurableAgentRepository.test.js.map +1 -1
  54. package/dist/__tests__/runtime/ManagedAgentRuntime.test.js.map +1 -1
  55. package/dist/__tests__/terminal/GhosttyBackend.test.js +334 -0
  56. package/dist/__tests__/terminal/GhosttyBackend.test.js.map +1 -0
  57. package/dist/__tests__/terminal/TmuxManager.test.js +1 -1
  58. package/dist/__tests__/terminal/TmuxManager.test.js.map +1 -1
  59. package/dist/adapters/AgentAdapter.d.ts +1 -1
  60. package/dist/adapters/AgentAdapter.d.ts.map +1 -1
  61. package/dist/adapters/AgentAdapter.js +2 -1
  62. package/dist/adapters/AgentAdapter.js.map +1 -1
  63. package/dist/capacity/index.d.ts +9 -19
  64. package/dist/capacity/index.d.ts.map +1 -1
  65. package/dist/capacity/index.js +11 -4
  66. package/dist/capacity/index.js.map +1 -1
  67. package/dist/capacity/providers/anthropic.d.ts +9 -0
  68. package/dist/capacity/providers/anthropic.d.ts.map +1 -0
  69. package/dist/capacity/{claude.js → providers/anthropic.js} +10 -128
  70. package/dist/capacity/providers/anthropic.js.map +1 -0
  71. package/dist/capacity/providers/openai-platform.d.ts +14 -0
  72. package/dist/capacity/providers/openai-platform.d.ts.map +1 -0
  73. package/dist/capacity/providers/openai-platform.js +120 -0
  74. package/dist/capacity/providers/openai-platform.js.map +1 -0
  75. package/dist/capacity/providers/openai-subscription.d.ts +20 -0
  76. package/dist/capacity/providers/openai-subscription.d.ts.map +1 -0
  77. package/dist/capacity/providers/openai-subscription.js +129 -0
  78. package/dist/capacity/providers/openai-subscription.js.map +1 -0
  79. package/dist/capacity/providers/zai.d.ts +8 -0
  80. package/dist/capacity/providers/zai.d.ts.map +1 -0
  81. package/dist/capacity/{zai.js → providers/zai.js} +17 -62
  82. package/dist/capacity/providers/zai.js.map +1 -0
  83. package/dist/capacity/sources/claude.d.ts +9 -0
  84. package/dist/capacity/sources/claude.d.ts.map +1 -0
  85. package/dist/capacity/sources/claude.js +17 -0
  86. package/dist/capacity/sources/claude.js.map +1 -0
  87. package/dist/capacity/{codex.d.ts → sources/codex.d.ts} +5 -9
  88. package/dist/capacity/sources/codex.d.ts.map +1 -0
  89. package/dist/capacity/{codex.js → sources/codex.js} +31 -84
  90. package/dist/capacity/sources/codex.js.map +1 -0
  91. package/dist/capacity/sources/pi.d.ts +30 -0
  92. package/dist/capacity/sources/pi.d.ts.map +1 -0
  93. package/dist/capacity/sources/pi.js +81 -0
  94. package/dist/capacity/sources/pi.js.map +1 -0
  95. package/dist/capacity/types.d.ts +2 -0
  96. package/dist/capacity/types.d.ts.map +1 -1
  97. package/dist/capacity/types.js +1 -1
  98. package/dist/capacity/types.js.map +1 -1
  99. package/dist/harnesses/claude/credentials.d.ts +10 -0
  100. package/dist/harnesses/claude/credentials.d.ts.map +1 -0
  101. package/dist/harnesses/claude/credentials.js +112 -0
  102. package/dist/harnesses/claude/credentials.js.map +1 -0
  103. package/dist/harnesses/claude/readiness.d.ts +3 -0
  104. package/dist/harnesses/claude/readiness.d.ts.map +1 -0
  105. package/dist/harnesses/claude/readiness.js +63 -0
  106. package/dist/harnesses/claude/readiness.js.map +1 -0
  107. package/dist/harnesses/codex/credentials.d.ts +15 -0
  108. package/dist/harnesses/codex/credentials.d.ts.map +1 -0
  109. package/dist/harnesses/codex/credentials.js +58 -0
  110. package/dist/harnesses/codex/credentials.js.map +1 -0
  111. package/dist/harnesses/codex/readiness.d.ts +3 -0
  112. package/dist/harnesses/codex/readiness.d.ts.map +1 -0
  113. package/dist/harnesses/codex/readiness.js +60 -0
  114. package/dist/harnesses/codex/readiness.js.map +1 -0
  115. package/dist/harnesses/copilot/readiness.d.ts +3 -0
  116. package/dist/harnesses/copilot/readiness.d.ts.map +1 -0
  117. package/dist/harnesses/copilot/readiness.js +39 -0
  118. package/dist/harnesses/copilot/readiness.js.map +1 -0
  119. package/dist/harnesses/devin/DevinAdapter.d.ts +39 -0
  120. package/dist/harnesses/devin/DevinAdapter.d.ts.map +1 -0
  121. package/dist/harnesses/devin/DevinAdapter.js +177 -0
  122. package/dist/harnesses/devin/DevinAdapter.js.map +1 -0
  123. package/dist/harnesses/devin/DevinAgentMapper.d.ts +11 -0
  124. package/dist/harnesses/devin/DevinAgentMapper.d.ts.map +1 -0
  125. package/dist/harnesses/devin/DevinAgentMapper.js +35 -0
  126. package/dist/harnesses/devin/DevinAgentMapper.js.map +1 -0
  127. package/dist/harnesses/devin/DevinSessionLocator.d.ts +46 -0
  128. package/dist/harnesses/devin/DevinSessionLocator.d.ts.map +1 -0
  129. package/dist/harnesses/devin/DevinSessionLocator.js +176 -0
  130. package/dist/harnesses/devin/DevinSessionLocator.js.map +1 -0
  131. package/dist/harnesses/devin/DevinSessionParser.d.ts +29 -0
  132. package/dist/harnesses/devin/DevinSessionParser.d.ts.map +1 -0
  133. package/dist/harnesses/devin/DevinSessionParser.js +166 -0
  134. package/dist/harnesses/devin/DevinSessionParser.js.map +1 -0
  135. package/dist/harnesses/devin/readiness.d.ts +3 -0
  136. package/dist/harnesses/devin/readiness.d.ts.map +1 -0
  137. package/dist/harnesses/devin/readiness.js +39 -0
  138. package/dist/harnesses/devin/readiness.js.map +1 -0
  139. package/dist/harnesses/index.d.ts.map +1 -1
  140. package/dist/harnesses/index.js +3 -1
  141. package/dist/harnesses/index.js.map +1 -1
  142. package/dist/harnesses/opencode/readiness.d.ts +3 -0
  143. package/dist/harnesses/opencode/readiness.d.ts.map +1 -0
  144. package/dist/harnesses/opencode/readiness.js +50 -0
  145. package/dist/harnesses/opencode/readiness.js.map +1 -0
  146. package/dist/harnesses/pi/credentials.d.ts +22 -0
  147. package/dist/harnesses/pi/credentials.d.ts.map +1 -0
  148. package/dist/harnesses/pi/credentials.js +98 -0
  149. package/dist/harnesses/pi/credentials.js.map +1 -0
  150. package/dist/harnesses/pi/readiness.d.ts +3 -0
  151. package/dist/harnesses/pi/readiness.d.ts.map +1 -0
  152. package/dist/harnesses/pi/readiness.js +96 -0
  153. package/dist/harnesses/pi/readiness.js.map +1 -0
  154. package/dist/harnesses/readiness/AgentReadiness.d.ts +6 -0
  155. package/dist/harnesses/readiness/AgentReadiness.d.ts.map +1 -0
  156. package/dist/harnesses/readiness/AgentReadiness.js +70 -0
  157. package/dist/harnesses/readiness/AgentReadiness.js.map +1 -0
  158. package/dist/harnesses/readiness/checks.d.ts +31 -0
  159. package/dist/harnesses/readiness/checks.d.ts.map +1 -0
  160. package/dist/harnesses/readiness/checks.js +270 -0
  161. package/dist/harnesses/readiness/checks.js.map +1 -0
  162. package/dist/{readiness/AgentReadiness.d.ts → harnesses/readiness/types.d.ts} +19 -10
  163. package/dist/harnesses/readiness/types.d.ts.map +1 -0
  164. package/dist/harnesses/readiness/types.js +4 -0
  165. package/dist/harnesses/readiness/types.js.map +1 -0
  166. package/dist/harnesses/runtimeProfiles.d.ts +11 -0
  167. package/dist/harnesses/runtimeProfiles.d.ts.map +1 -0
  168. package/dist/harnesses/runtimeProfiles.js +100 -0
  169. package/dist/harnesses/runtimeProfiles.js.map +1 -0
  170. package/dist/index.d.ts +16 -42
  171. package/dist/index.d.ts.map +1 -1
  172. package/dist/index.js +9 -23
  173. package/dist/index.js.map +1 -1
  174. package/dist/runtime/ManagedAgentRuntime.d.ts +3 -3
  175. package/dist/runtime/ManagedAgentRuntime.d.ts.map +1 -1
  176. package/dist/runtime/ManagedAgentRuntime.js +6 -20
  177. package/dist/runtime/ManagedAgentRuntime.js.map +1 -1
  178. package/dist/runtime/herdr/HerdrAgentDiscovery.d.ts.map +1 -1
  179. package/dist/runtime/herdr/HerdrAgentDiscovery.js +2 -43
  180. package/dist/runtime/herdr/HerdrAgentDiscovery.js.map +1 -1
  181. package/dist/runtime/tmux/PidPolling.d.ts +1 -1
  182. package/dist/runtime/tmux/PidPolling.d.ts.map +1 -1
  183. package/dist/runtime/tmux/PidPolling.js.map +1 -1
  184. package/dist/runtime/tmux/TmuxAgentRuntime.d.ts +1 -1
  185. package/dist/runtime/tmux/TmuxAgentRuntime.d.ts.map +1 -1
  186. package/dist/runtime/tmux/TmuxAgentRuntime.js +1 -1
  187. package/dist/runtime/tmux/TmuxAgentRuntime.js.map +1 -1
  188. package/dist/runtime/tmux/TmuxManager.d.ts +12 -0
  189. package/dist/runtime/tmux/TmuxManager.d.ts.map +1 -0
  190. package/dist/{terminal → runtime/tmux}/TmuxManager.js +9 -28
  191. package/dist/runtime/tmux/TmuxManager.js.map +1 -0
  192. package/dist/runtime/types.d.ts +1 -1
  193. package/dist/runtime/types.d.ts.map +1 -1
  194. package/dist/runtime/types.js.map +1 -1
  195. package/dist/terminal/TerminalFocusManager.d.ts +4 -32
  196. package/dist/terminal/TerminalFocusManager.d.ts.map +1 -1
  197. package/dist/terminal/TerminalFocusManager.js +17 -267
  198. package/dist/terminal/TerminalFocusManager.js.map +1 -1
  199. package/dist/terminal/TtyWriter.d.ts +1 -44
  200. package/dist/terminal/TtyWriter.d.ts.map +1 -1
  201. package/dist/terminal/TtyWriter.js +12 -347
  202. package/dist/terminal/TtyWriter.js.map +1 -1
  203. package/dist/terminal/backends/ghostty.d.ts +3 -0
  204. package/dist/terminal/backends/ghostty.d.ts.map +1 -0
  205. package/dist/terminal/backends/ghostty.js +161 -0
  206. package/dist/terminal/backends/ghostty.js.map +1 -0
  207. package/dist/terminal/backends/index.d.ts +5 -0
  208. package/dist/terminal/backends/index.d.ts.map +1 -0
  209. package/dist/terminal/backends/index.js +21 -0
  210. package/dist/terminal/backends/index.js.map +1 -0
  211. package/dist/terminal/backends/iterm2.d.ts +3 -0
  212. package/dist/terminal/backends/iterm2.d.ts.map +1 -0
  213. package/dist/terminal/backends/iterm2.js +135 -0
  214. package/dist/terminal/backends/iterm2.js.map +1 -0
  215. package/dist/terminal/backends/shared.d.ts +9 -0
  216. package/dist/terminal/backends/shared.d.ts.map +1 -0
  217. package/dist/terminal/backends/shared.js +38 -0
  218. package/dist/terminal/backends/shared.js.map +1 -0
  219. package/dist/terminal/backends/terminal-app.d.ts +3 -0
  220. package/dist/terminal/backends/terminal-app.d.ts.map +1 -0
  221. package/dist/terminal/backends/terminal-app.js +129 -0
  222. package/dist/terminal/backends/terminal-app.js.map +1 -0
  223. package/dist/terminal/backends/tmux.d.ts +3 -0
  224. package/dist/terminal/backends/tmux.d.ts.map +1 -0
  225. package/dist/terminal/backends/tmux.js +76 -0
  226. package/dist/terminal/backends/tmux.js.map +1 -0
  227. package/dist/terminal/backends/wezterm.d.ts +3 -0
  228. package/dist/terminal/backends/wezterm.d.ts.map +1 -0
  229. package/dist/terminal/backends/wezterm.js +71 -0
  230. package/dist/terminal/backends/wezterm.js.map +1 -0
  231. package/dist/terminal/types.d.ts +22 -0
  232. package/dist/terminal/types.d.ts.map +1 -0
  233. package/dist/terminal/types.js +11 -0
  234. package/dist/terminal/types.js.map +1 -0
  235. package/dist/utils/process.d.ts +2 -0
  236. package/dist/utils/process.d.ts.map +1 -1
  237. package/dist/utils/process.js +3 -0
  238. package/dist/utils/process.js.map +1 -1
  239. package/package.json +1 -1
  240. package/src/AgentManager.ts +1 -1
  241. package/src/__tests__/capacity/anthropic.test.ts +105 -0
  242. package/src/__tests__/capacity/boundaries.test.ts +36 -0
  243. package/src/__tests__/capacity/claude.test.ts +3 -8
  244. package/src/__tests__/capacity/codex.test.ts +12 -35
  245. package/src/__tests__/capacity/fixtures/openai-codex-auth.json +1 -1
  246. package/src/__tests__/capacity/openai.test.ts +15 -15
  247. package/src/__tests__/capacity/wham.test.ts +1 -1
  248. package/src/__tests__/capacity/zai.test.ts +27 -62
  249. package/src/__tests__/harnesses/claude/durable/ClaudePrintAgent.integration.test.ts +2 -2
  250. package/src/__tests__/harnesses/claude/durable/ClaudePrintRunner.test.ts +1 -1
  251. package/src/__tests__/harnesses/codex/durable/CodexCliProbe.test.ts +14 -19
  252. package/src/__tests__/harnesses/codex/durable/CodexPrintAgent.integration.test.ts +3 -3
  253. package/src/__tests__/harnesses/codex/durable/CodexPrintAgentService.test.ts +24 -30
  254. package/src/__tests__/harnesses/codex/durable/CodexPrintRunner.test.ts +4 -8
  255. package/src/__tests__/harnesses/devin/DevinAdapter.test.ts +292 -0
  256. package/src/__tests__/harnesses/devin/DevinAgentMapper.test.ts +88 -0
  257. package/src/__tests__/harnesses/devin/DevinSessionLocator.test.ts +139 -0
  258. package/src/__tests__/harnesses/devin/DevinSessionParser.test.ts +218 -0
  259. package/src/__tests__/harnesses/devin/fixtures.ts +144 -0
  260. package/src/__tests__/harnesses/pi/durable/PiCliProbe.test.ts +7 -11
  261. package/src/__tests__/harnesses/pi/durable/PiPrintAgentService.test.ts +19 -22
  262. package/src/__tests__/harnesses/pi/durable/PiPrintRunner.test.ts +7 -8
  263. package/src/__tests__/{readiness → harnesses/readiness}/AgentReadiness.test.ts +77 -9
  264. package/src/__tests__/harnesses/runtimeProfiles.test.ts +110 -0
  265. package/src/__tests__/print/DurableAgent.test.ts +4 -13
  266. package/src/__tests__/print/DurableAgentRepository.test.ts +1 -13
  267. package/src/__tests__/runtime/ManagedAgentRuntime.test.ts +1 -1
  268. package/src/__tests__/terminal/GhosttyBackend.test.ts +271 -0
  269. package/src/__tests__/terminal/TmuxManager.test.ts +1 -1
  270. package/src/adapters/AgentAdapter.ts +1 -0
  271. package/src/capacity/index.ts +29 -23
  272. package/src/capacity/{claude.ts → providers/anthropic.ts} +16 -131
  273. package/src/capacity/providers/openai-platform.ts +150 -0
  274. package/src/capacity/{wham.ts → providers/openai-subscription.ts} +86 -8
  275. package/src/capacity/{zai.ts → providers/zai.ts} +29 -111
  276. package/src/capacity/sources/claude.ts +30 -0
  277. package/src/capacity/{codex.ts → sources/codex.ts} +54 -124
  278. package/src/capacity/sources/pi.ts +131 -0
  279. package/src/capacity/types.ts +3 -0
  280. package/src/harnesses/claude/credentials.ts +122 -0
  281. package/src/harnesses/claude/readiness.ts +69 -0
  282. package/src/harnesses/codex/credentials.ts +81 -0
  283. package/src/harnesses/codex/readiness.ts +72 -0
  284. package/src/harnesses/copilot/readiness.ts +33 -0
  285. package/src/harnesses/devin/DevinAdapter.ts +224 -0
  286. package/src/harnesses/devin/DevinAgentMapper.ts +43 -0
  287. package/src/harnesses/devin/DevinSessionLocator.ts +230 -0
  288. package/src/harnesses/devin/DevinSessionParser.ts +236 -0
  289. package/src/harnesses/devin/readiness.ts +36 -0
  290. package/src/harnesses/index.ts +2 -0
  291. package/src/harnesses/opencode/readiness.ts +48 -0
  292. package/src/harnesses/pi/credentials.ts +129 -0
  293. package/src/harnesses/pi/readiness.ts +104 -0
  294. package/src/harnesses/readiness/AgentReadiness.ts +89 -0
  295. package/src/harnesses/readiness/checks.ts +336 -0
  296. package/src/harnesses/readiness/types.ts +90 -0
  297. package/src/{utils/agents.ts → harnesses/runtimeProfiles.ts} +35 -38
  298. package/src/index.ts +15 -128
  299. package/src/runtime/ManagedAgentRuntime.ts +7 -22
  300. package/src/runtime/herdr/HerdrAgentDiscovery.ts +3 -19
  301. package/src/runtime/tmux/PidPolling.ts +1 -1
  302. package/src/runtime/tmux/TmuxAgentRuntime.ts +1 -1
  303. package/src/{terminal → runtime/tmux}/TmuxManager.ts +9 -30
  304. package/src/runtime/types.ts +1 -1
  305. package/src/terminal/TerminalFocusManager.ts +19 -292
  306. package/src/terminal/TtyWriter.ts +15 -335
  307. package/src/terminal/backends/ghostty.ts +180 -0
  308. package/src/terminal/backends/index.ts +23 -0
  309. package/src/terminal/backends/iterm2.ts +126 -0
  310. package/src/terminal/backends/shared.ts +47 -0
  311. package/src/terminal/backends/terminal-app.ts +122 -0
  312. package/src/terminal/backends/tmux.ts +62 -0
  313. package/src/terminal/backends/wezterm.ts +65 -0
  314. package/src/terminal/types.ts +23 -0
  315. package/src/utils/process.ts +5 -0
  316. package/dist/__tests__/readiness/AgentReadiness.test.js.map +0 -1
  317. package/dist/__tests__/utils/agents.test.js +0 -93
  318. package/dist/__tests__/utils/agents.test.js.map +0 -1
  319. package/dist/capacity/claude.d.ts +0 -17
  320. package/dist/capacity/claude.d.ts.map +0 -1
  321. package/dist/capacity/claude.js.map +0 -1
  322. package/dist/capacity/codex.d.ts.map +0 -1
  323. package/dist/capacity/codex.js.map +0 -1
  324. package/dist/capacity/openai.d.ts +0 -47
  325. package/dist/capacity/openai.d.ts.map +0 -1
  326. package/dist/capacity/openai.js +0 -307
  327. package/dist/capacity/openai.js.map +0 -1
  328. package/dist/capacity/wham.d.ts +0 -16
  329. package/dist/capacity/wham.d.ts.map +0 -1
  330. package/dist/capacity/wham.js +0 -66
  331. package/dist/capacity/wham.js.map +0 -1
  332. package/dist/capacity/zai.d.ts +0 -14
  333. package/dist/capacity/zai.d.ts.map +0 -1
  334. package/dist/capacity/zai.js.map +0 -1
  335. package/dist/readiness/AgentReadiness.d.ts.map +0 -1
  336. package/dist/readiness/AgentReadiness.js +0 -614
  337. package/dist/readiness/AgentReadiness.js.map +0 -1
  338. package/dist/terminal/TmuxManager.d.ts +0 -28
  339. package/dist/terminal/TmuxManager.d.ts.map +0 -1
  340. package/dist/terminal/TmuxManager.js.map +0 -1
  341. package/dist/terminal/index.d.ts +0 -5
  342. package/dist/terminal/index.d.ts.map +0 -1
  343. package/dist/terminal/index.js +0 -5
  344. package/dist/terminal/index.js.map +0 -1
  345. package/dist/utils/agents.d.ts +0 -16
  346. package/dist/utils/agents.d.ts.map +0 -1
  347. package/dist/utils/agents.js +0 -117
  348. package/dist/utils/agents.js.map +0 -1
  349. package/dist/utils/index.d.ts +0 -8
  350. package/dist/utils/index.d.ts.map +0 -1
  351. package/dist/utils/index.js +0 -6
  352. package/dist/utils/index.js.map +0 -1
  353. package/src/__tests__/utils/agents.test.ts +0 -105
  354. package/src/capacity/openai.ts +0 -355
  355. package/src/readiness/AgentReadiness.ts +0 -730
  356. package/src/terminal/index.ts +0 -4
  357. package/src/utils/index.ts +0 -14
@@ -1,44 +1,47 @@
1
- import path from "path";
2
- import type { AGENT_TYPES } from "../adapters/AgentAdapter.js";
3
- import { executablePath } from "./process.js";
1
+ import path from "node:path";
2
+ import { AGENT_TYPES, type AgentType } from "../adapters/AgentAdapter.js";
3
+ import { executablePath } from "../utils/process.js";
4
4
 
5
- /** Every built-in harness can be started, so each needs an {@link AGENTS} entry. */
6
5
  export type StartableAgentType = (typeof AGENT_TYPES)[number];
7
6
 
8
- export interface AgentConfig {
9
- /** Shell command to launch the agent (sent to tmux via `send-keys`). */
7
+ export interface HarnessRuntimeProfile {
10
8
  command: string;
11
- /** Returns true if the given `ps` command line belongs to this agent. */
9
+ runtimeKind: string;
10
+ discoveryAliases: readonly string[];
12
11
  matches: (psCommand: string) => boolean;
13
12
  }
14
13
 
15
- /**
16
- * Per-agent configuration: launch command plus a matcher that recognizes the
17
- * agent's process in `ps` output. Each matcher knows that agent's distribution
18
- * quirks (e.g. gemini ships as a Node script so its real binary is in argv[1..]).
19
- */
20
- export const AGENTS: Record<StartableAgentType, AgentConfig> = {
21
- claude: { command: "claude", matches: matchArgv0("claude") },
22
- codex: { command: "codex", matches: matchArgv0("codex") },
23
- copilot: { command: "copilot", matches: matchArgv0Name("copilot-cli") },
24
- gemini_cli: { command: "gemini", matches: matchAnyToken("gemini") },
25
- grok_cli: { command: "grok", matches: matchArgv0("grok") },
26
- antigravity_cli: { command: "agy", matches: matchArgv0("agy") },
27
- opencode: { command: "opencode", matches: matchArgv0("opencode") },
28
- pi: { command: "pi", matches: matchAnyBasename(["pi"]) },
29
- kiro: { command: "kiro-cli", matches: matchAnyBasename(["kiro-cli", "kiro"]) },
14
+ export const HARNESS_RUNTIME_PROFILES: Record<StartableAgentType, HarnessRuntimeProfile> = {
15
+ claude: profile("claude", matchArgv0("claude")),
16
+ codex: profile("codex", matchArgv0("codex")),
17
+ copilot: profile("copilot", matchArgv0Name("copilot-cli")),
18
+ gemini_cli: profile("gemini", matchAnyBasename(["gemini"]), ["gemini_cli"]),
19
+ grok_cli: profile("grok", matchArgv0("grok"), ["grok_cli"]),
20
+ antigravity_cli: profile("agy", matchArgv0("agy"), ["antigravity", "antigravity_cli"]),
21
+ opencode: profile("opencode", matchArgv0("opencode")),
22
+ pi: profile("pi", matchAnyBasename(["pi"])),
23
+ kiro: profile("kiro", matchAnyBasename(["kiro-cli", "kiro"]), ["kiro_cli", "kiro-cli"]),
24
+ devin: profile("devin", matchArgv0("devin")),
30
25
  };
31
26
 
32
- /**
33
- * Matchers read a `ps` command line, where argv is joined with spaces. argv[0]
34
- * is resolved with {@link executablePath} so executables installed under
35
- * directories containing spaces are recognised, while arguments are never
36
- * folded into the executable path unless that combined path is a real file.
37
- *
38
- * The filesystem is consulted only when a token after the first could be part
39
- * of a matching argv[0]; commands whose first token already decides the match,
40
- * or that contain no candidate token at all, are handled with string checks.
41
- */
27
+ export function runtimeAgentMatchesHarness(runtimeAgent: string, type: AgentType): boolean {
28
+ if (type === "other") return runtimeAgent.toLowerCase() === "other";
29
+ return HARNESS_RUNTIME_PROFILES[type].discoveryAliases.includes(runtimeAgent.toLowerCase());
30
+ }
31
+
32
+ function profile(
33
+ runtimeKind: string,
34
+ matches: (psCommand: string) => boolean,
35
+ extraAliases: readonly string[] = [],
36
+ ): HarnessRuntimeProfile {
37
+ return {
38
+ command: runtimeKind === "kiro" ? "kiro-cli" : runtimeKind,
39
+ runtimeKind,
40
+ discoveryAliases: [runtimeKind, ...extraAliases],
41
+ matches,
42
+ };
43
+ }
44
+
42
45
  const ABSOLUTE_PATH = /^(?:\/|[a-zA-Z]:[\\/])/;
43
46
  const PATH_SEPARATOR = /[\\/]/;
44
47
 
@@ -50,14 +53,12 @@ function tokensOf(psCommand: string): string[] {
50
53
  return psCommand.trim().split(/\s+/).filter(Boolean);
51
54
  }
52
55
 
53
- /** Split a command line into its resolved argv[0] and the remaining argument tokens. */
54
56
  function splitArgv0(psCommand: string): { argv0: string; args: string[] } {
55
57
  const command = psCommand.trim();
56
58
  const argv0 = executablePath(command);
57
59
  return { argv0, args: tokensOf(command.slice(argv0.length)) };
58
60
  }
59
61
 
60
- /** Whether argv[0] may span several tokens, i.e. a later path-like token satisfies `test`. */
61
62
  function mayContinueArgv0(tokens: string[], test: (token: string) => boolean): boolean {
62
63
  return (
63
64
  ABSOLUTE_PATH.test(tokens[0]) &&
@@ -87,10 +88,6 @@ function matchArgv0Name(name: string): (psCommand: string) => boolean {
87
88
  };
88
89
  }
89
90
 
90
- function matchAnyToken(name: string): (psCommand: string) => boolean {
91
- return matchAnyBasename([name]);
92
- }
93
-
94
91
  function matchAnyBasename(names: string[]): (psCommand: string) => boolean {
95
92
  const lowers = new Set(names.map((name) => name.toLowerCase()));
96
93
  const test = (token: string) => lowers.has(basenameOf(token));
package/src/index.ts CHANGED
@@ -1,73 +1,41 @@
1
- export { AgentManager, AgentNotRunningError } from "./AgentManager.js";
1
+ export { AgentManager } from "./AgentManager.js";
2
2
  export {
3
+ getAnthropicCapacityReport,
3
4
  getClaudeCapacityReport,
4
5
  getCodexCapacityReport,
5
6
  getOpenAiCapacityReport,
6
7
  getZaiCapacityReport,
7
8
  } from "./capacity/index.js";
8
- export type {
9
- ClaudeCapacityOptions,
10
- CapacityProbeOptions,
11
- CapacityReport,
12
- CapacityWindow,
13
- OpenAiCapacityOptions,
14
- ZaiCapacityOptions,
15
- } from "./capacity/index.js";
9
+ export type { CapacityReport, CapacityWindow } from "./capacity/index.js";
10
+
16
11
  export {
17
- getAgentReadinessReport,
18
12
  getAgentReadinessReports,
19
13
  worstReadinessStatus,
20
- } from "./readiness/AgentReadiness.js";
14
+ } from "./harnesses/readiness/AgentReadiness.js";
21
15
  export type {
22
16
  AgentReadinessOptions,
23
17
  AgentReadinessReport,
24
- AuthReadinessCheck,
25
- BuiltInSkillsReadinessCheck,
26
- DirectoryReadinessCheck,
27
- ExecutableReadinessCheck,
28
- IntegrationReadinessCheck,
29
18
  ReadinessAgentType,
30
- ReadinessAuthState,
31
- ReadinessCheck,
32
19
  ReadinessStatus,
33
- } from "./readiness/AgentReadiness.js";
20
+ } from "./harnesses/readiness/AgentReadiness.js";
34
21
 
35
- export { ClaudeCodeAdapter } from "./harnesses/claude/ClaudeCodeAdapter.js";
36
- export { CodexAdapter } from "./harnesses/codex/CodexAdapter.js";
37
- export { CopilotAdapter } from "./harnesses/copilot/CopilotAdapter.js";
38
- export { GeminiCliAdapter } from "./harnesses/gemini/GeminiCliAdapter.js";
39
- export { GrokCliAdapter } from "./harnesses/grok/GrokCliAdapter.js";
40
- export { AntigravityCliAdapter } from "./harnesses/antigravity/AntigravityCliAdapter.js";
41
- export { KiroAdapter } from "./harnesses/kiro/KiroAdapter.js";
42
- export { OpenCodeAdapter } from "./harnesses/opencode/OpenCodeAdapter.js";
43
- export { PiAdapter } from "./harnesses/pi/PiAdapter.js";
44
22
  export { createBuiltinAdapters } from "./harnesses/index.js";
23
+ export { HARNESS_RUNTIME_PROFILES, type StartableAgentType } from "./harnesses/runtimeProfiles.js";
45
24
  export { AGENT_TYPES, AgentStatus } from "./adapters/AgentAdapter.js";
46
25
  export type {
47
26
  AgentAdapter,
48
27
  AgentType,
49
28
  AgentInfo,
50
- ProcessInfo,
51
29
  ConversationMessage,
52
- ConversationOptions,
53
30
  SessionSummary,
54
31
  ListSessionsOptions,
55
- AgentDetectionContext,
56
32
  } from "./adapters/AgentAdapter.js";
57
33
 
58
- export { TerminalFocusManager, TerminalType } from "./terminal/TerminalFocusManager.js";
59
- export type { TerminalLocation } from "./terminal/TerminalFocusManager.js";
34
+ export { TerminalFocusManager } from "./terminal/TerminalFocusManager.js";
35
+ export { TerminalType } from "./terminal/types.js";
36
+ export type { TerminalLocation } from "./terminal/types.js";
60
37
  export { TtyWriter } from "./terminal/TtyWriter.js";
61
38
 
62
- export type { AgentManagerOptions, ListAgentsOptions } from "./AgentManager.js";
63
- export {
64
- extractHerdrAgentPanes,
65
- fetchHerdrAgentPanes,
66
- findMatchingHerdrPane,
67
- herdrPaneToRuntimeRef,
68
- } from "./runtime/herdr/HerdrAgentDiscovery.js";
69
- export type { HerdrAgentPane } from "./runtime/herdr/HerdrAgentDiscovery.js";
70
-
71
39
  export {
72
40
  AgentRegistry,
73
41
  RenameNotFoundError,
@@ -75,14 +43,8 @@ export {
75
43
  AGENT_RUNTIME_PROVIDERS,
76
44
  parseTmuxRuntimeRef,
77
45
  } from "./utils/AgentRegistry.js";
78
- export type {
79
- AgentRegistryOptions,
80
- RegistryEntry,
81
- AgentRuntimeProvider,
82
- TmuxRuntimeRef,
83
- } from "./utils/AgentRegistry.js";
84
- export { TmuxManager } from "./terminal/TmuxManager.js";
85
- export type { AgentRuntimeAvailability, InteractiveAgentRuntime } from "./runtime/types.js";
46
+ export type { AgentRuntimeProvider } from "./utils/AgentRegistry.js";
47
+ export type { InteractiveAgentRuntime } from "./runtime/types.js";
86
48
  export {
87
49
  startAgent,
88
50
  stopAgent,
@@ -93,90 +55,15 @@ export {
93
55
  AgentPidPollTimeoutError,
94
56
  AgentRuntimeUnavailableError,
95
57
  AgentTerminalNotFoundError,
96
- DEFAULT_PID_POLL_INTERVAL_MS,
97
58
  DEFAULT_PID_POLL_TIMEOUT_MS,
98
59
  } from "./runtime/ManagedAgentRuntime.js";
99
- export type {
100
- FocusAgentDeps,
101
- StartAgentDeps,
102
- StartAgentOptions,
103
- StopAgentDeps,
104
- StopAgentResult,
105
- FocusAgentResult,
106
- SendAgentPromptDeps,
107
- } from "./runtime/ManagedAgentRuntime.js";
108
- export { AGENTS } from "./utils/agents.js";
109
- export type { AgentConfig, StartableAgentType } from "./utils/agents.js";
110
60
 
111
61
  export type { AgentRequest } from "./utils/agent-requests.js";
112
- export {
113
- getAgentRequestPath,
114
- readLatestAgentRequest,
115
- writeAgentRequest,
116
- } from "./utils/agent-requests.js";
62
+ export { readLatestAgentRequest, writeAgentRequest } from "./utils/agent-requests.js";
117
63
 
118
- export {
119
- AGENT_MODES,
120
- DurableAgentError,
121
- DurableAgentBusyError,
122
- DurableAgentNotFoundError,
123
- DurableAgentRepositoryError,
124
- DurableAgentNameConflictError,
125
- ClaudePrintError,
126
- CodexPrintError,
127
- PiPrintError,
128
- } from "./durable/DurableAgent.js";
129
- export type {
130
- DurableAgent,
131
- DurableAgentBase,
132
- ClaudeDurableAgent,
133
- CodexDurableAgent,
134
- PiDurableAgent,
135
- DurableProvider,
136
- CodexPrintErrorCode,
137
- DurableAgentState,
138
- DurableSessionHealth,
139
- DurableRunStatus,
140
- DurableActiveRun,
141
- DurableLastResult,
142
- PiPrintErrorCode,
143
- ProcessIdentity,
144
- } from "./durable/DurableAgent.js";
64
+ export { AGENT_MODES } from "./durable/DurableAgent.js";
65
+ export type { DurableProvider } from "./durable/DurableAgent.js";
145
66
  export { DurableAgentRepository } from "./durable/DurableAgentRepository.js";
146
- export type {
147
- CreateDurableAgentInput,
148
- DurableAgentRepositoryOptions,
149
- ProcessInspector,
150
- DurableRunCompletion,
151
- } from "./durable/DurableAgentRepository.js";
152
67
  export { ClaudePrintAgentService } from "./harnesses/claude/durable/ClaudePrintAgentService.js";
153
- export type {
154
- ClaudePrintAgentServiceOptions,
155
- ClaudePrintSendResult,
156
- } from "./harnesses/claude/durable/ClaudePrintAgentService.js";
157
- export { CodexCliProbe } from "./harnesses/codex/durable/CodexCliProbe.js";
158
- export type { CodexCliProbeOptions } from "./harnesses/codex/durable/CodexCliProbe.js";
159
- export { CodexPrintRunner } from "./harnesses/codex/durable/CodexPrintRunner.js";
160
- export type {
161
- CodexPrintRunnerOptions,
162
- CodexPrintRunRequest,
163
- CodexPrintRunResult,
164
- } from "./harnesses/codex/durable/CodexPrintRunner.js";
165
68
  export { CodexPrintAgentService } from "./harnesses/codex/durable/CodexPrintAgentService.js";
166
- export type {
167
- CodexPrintAgentServiceOptions,
168
- CodexPrintSendResult,
169
- } from "./harnesses/codex/durable/CodexPrintAgentService.js";
170
- export { PiCliProbe } from "./harnesses/pi/durable/PiCliProbe.js";
171
- export type { PiCliProbeOptions } from "./harnesses/pi/durable/PiCliProbe.js";
172
- export { PiPrintRunner } from "./harnesses/pi/durable/PiPrintRunner.js";
173
- export type {
174
- PiPrintRunnerOptions,
175
- PiPrintRunRequest,
176
- PiPrintRunResult,
177
- } from "./harnesses/pi/durable/PiPrintRunner.js";
178
69
  export { PiPrintAgentService } from "./harnesses/pi/durable/PiPrintAgentService.js";
179
- export type {
180
- PiPrintAgentServiceOptions,
181
- PiPrintSendResult,
182
- } from "./harnesses/pi/durable/PiPrintAgentService.js";
@@ -1,12 +1,12 @@
1
1
  import type { AgentInfo } from "../adapters/AgentAdapter.js";
2
- import type { TerminalLocation } from "../terminal/TerminalFocusManager.js";
3
- import { TmuxManager } from "../terminal/TmuxManager.js";
2
+ import type { TerminalLocation } from "../terminal/types.js";
3
+ import { TmuxManager } from "./tmux/TmuxManager.js";
4
4
  import {
5
5
  AgentRegistry,
6
6
  type AgentRuntimeProvider,
7
7
  type RegistryEntry,
8
8
  } from "../utils/AgentRegistry.js";
9
- import { AGENTS, type StartableAgentType } from "../utils/agents.js";
9
+ import { HARNESS_RUNTIME_PROFILES, type StartableAgentType } from "../harnesses/runtimeProfiles.js";
10
10
  import { createInteractiveRuntime } from "./RuntimeFactory.js";
11
11
  import { DEFAULT_PID_POLL_INTERVAL_MS, DEFAULT_PID_POLL_TIMEOUT_MS } from "./tmux/PidPolling.js";
12
12
  import { TmuxAgentRuntime } from "./tmux/TmuxAgentRuntime.js";
@@ -91,7 +91,7 @@ export async function startAgent(
91
91
  deps: StartAgentDeps = {},
92
92
  ): Promise<RegistryEntry> {
93
93
  const registry = deps.registry ?? AgentRegistry.default();
94
- const agent = AGENTS[opts.type];
94
+ const profile = HARNESS_RUNTIME_PROFILES[opts.type];
95
95
  const intervalMs = opts.pollIntervalMs ?? DEFAULT_PID_POLL_INTERVAL_MS;
96
96
  const timeoutMs = opts.pollTimeoutMs ?? DEFAULT_PID_POLL_TIMEOUT_MS;
97
97
  const provider = opts.runtimeProvider ?? deps.runtime?.provider ?? "tmux";
@@ -119,13 +119,13 @@ export async function startAgent(
119
119
  const result = await runtime.startAgent({
120
120
  name: opts.name,
121
121
  cwd: opts.cwd,
122
- kind: agentRuntimeKind(opts.type, provider),
122
+ kind: profile.runtimeKind,
123
123
  args: [],
124
124
  timeoutMs,
125
125
  ...(provider === "tmux"
126
126
  ? {
127
- command: agent.command,
128
- matches: agent.matches,
127
+ command: profile.command,
128
+ matches: profile.matches,
129
129
  pollIntervalMs: intervalMs,
130
130
  }
131
131
  : {}),
@@ -251,18 +251,3 @@ function isHerdrRegistryEntry(
251
251
  "runtimeRef" in entry
252
252
  );
253
253
  }
254
-
255
- function agentRuntimeKind(type: StartableAgentType, provider: AgentRuntimeProvider): string {
256
- if (provider === "tmux") return type;
257
- return {
258
- claude: "claude",
259
- codex: "codex",
260
- copilot: "copilot",
261
- gemini_cli: "gemini",
262
- grok_cli: "grok",
263
- antigravity_cli: "agy",
264
- opencode: "opencode",
265
- pi: "pi",
266
- kiro: "kiro",
267
- }[type];
268
- }
@@ -1,4 +1,5 @@
1
- import type { AgentInfo, AgentType } from "../../adapters/AgentAdapter.js";
1
+ import type { AgentInfo } from "../../adapters/AgentAdapter.js";
2
+ import { runtimeAgentMatchesHarness } from "../../harnesses/runtimeProfiles.js";
2
3
  import { HerdrCliClient, type HerdrCommandRunner } from "./HerdrCliClient.js";
3
4
  import type { HerdrRuntimeRef } from "./HerdrRuntimeRef.js";
4
5
 
@@ -70,7 +71,7 @@ export function findMatchingHerdrPane(
70
71
  if (shellPidMatches.length > 1) return null;
71
72
 
72
73
  const cwdMatches = panes.filter(
73
- (pane) => pane.cwd === agent.projectPath && herdrAgentMatchesType(pane.agent, agent.type),
74
+ (pane) => pane.cwd === agent.projectPath && runtimeAgentMatchesHarness(pane.agent, agent.type),
74
75
  );
75
76
  return cwdMatches.length === 1 ? cwdMatches[0]! : null;
76
77
  }
@@ -85,23 +86,6 @@ export function herdrPaneToRuntimeRef(pane: HerdrAgentPane, agentName: string):
85
86
  };
86
87
  }
87
88
 
88
- function herdrAgentMatchesType(herdrAgent: string, agentType: AgentType): boolean {
89
- const normalized = herdrAgent.toLowerCase();
90
- const candidates: Record<AgentType, readonly string[]> = {
91
- claude: ["claude"],
92
- codex: ["codex"],
93
- copilot: ["copilot"],
94
- gemini_cli: ["gemini", "gemini_cli"],
95
- grok_cli: ["grok", "grok_cli"],
96
- antigravity_cli: ["agy", "antigravity", "antigravity_cli"],
97
- kiro: ["kiro", "kiro_cli", "kiro-cli"],
98
- opencode: ["opencode"],
99
- pi: ["pi"],
100
- other: ["other"],
101
- };
102
- return candidates[agentType]?.includes(normalized) ?? false;
103
- }
104
-
105
89
  async function enrichHerdrAgentPanes(
106
90
  client: HerdrCliClient,
107
91
  panes: HerdrAgentPane[],
@@ -1,4 +1,4 @@
1
- import type { TmuxManager } from "../../terminal/TmuxManager.js";
1
+ import type { TmuxManager } from "./TmuxManager.js";
2
2
 
3
3
  export const DEFAULT_PID_POLL_INTERVAL_MS = 500;
4
4
  export const DEFAULT_PID_POLL_TIMEOUT_MS = 15_000;
@@ -1,4 +1,4 @@
1
- import { TmuxManager } from "../../terminal/TmuxManager.js";
1
+ import { TmuxManager } from "./TmuxManager.js";
2
2
  import { TtyWriter } from "../../terminal/TtyWriter.js";
3
3
  import { AgentPidPollTimeoutError, AgentTerminalNotFoundError } from "../errors.js";
4
4
  import { pollForPid } from "./PidPolling.js";
@@ -1,5 +1,5 @@
1
- import { execFile } from "child_process";
2
- import { promisify } from "util";
1
+ import { execFile } from "node:child_process";
2
+ import { promisify } from "node:util";
3
3
 
4
4
  const execFileAsync = promisify(execFile);
5
5
 
@@ -38,22 +38,6 @@ export class TmuxManager {
38
38
  }
39
39
  }
40
40
 
41
- /**
42
- * Find the actual agent process PID inside a tmux pane.
43
- *
44
- * Strategy: BFS the process tree, return the deepest process whose
45
- * `ps` command line is accepted by `matches`. The caller supplies the
46
- * matcher so this method has no agent-type knowledge.
47
- *
48
- * This handles two real-world process shapes:
49
- * - Wrapper case: shell → claude-wrapper (matches) → claude (matches, deeper)
50
- * → returns the deeper one
51
- * - Subprocess case: shell → claude (matches) → MCP server child (doesn't match)
52
- * → returns claude, not the subprocess
53
- *
54
- * Returns null when no process matches yet (agent still starting); the
55
- * caller's poll loop retries.
56
- */
57
41
  async findAgentPid(
58
42
  session: string,
59
43
  matches: (psCommand: string) => boolean,
@@ -71,12 +55,8 @@ export class TmuxManager {
71
55
  visited.add(pid);
72
56
 
73
57
  const command = await this.getProcessCommand(pid);
74
- if (command && matches(command)) {
75
- deepestMatch = pid;
76
- }
77
-
78
- const children = await this.pgrepChildren(pid);
79
- queue.push(...children);
58
+ if (command && matches(command)) deepestMatch = pid;
59
+ queue.push(...(await this.pgrepChildren(pid)));
80
60
  }
81
61
 
82
62
  return deepestMatch;
@@ -91,8 +71,8 @@ export class TmuxManager {
91
71
  "-F",
92
72
  "#{pane_pid}",
93
73
  ]);
94
- const panePid = parseInt(stdout.trim().split("\n")[0], 10);
95
- return isNaN(panePid) ? null : panePid;
74
+ const panePid = Number.parseInt(stdout.trim().split("\n")[0], 10);
75
+ return Number.isNaN(panePid) ? null : panePid;
96
76
  } catch {
97
77
  return null;
98
78
  }
@@ -104,8 +84,8 @@ export class TmuxManager {
104
84
  return stdout
105
85
  .trim()
106
86
  .split("\n")
107
- .map((s) => parseInt(s, 10))
108
- .filter((n) => !isNaN(n));
87
+ .map((value) => Number.parseInt(value, 10))
88
+ .filter((value) => !Number.isNaN(value));
109
89
  } catch {
110
90
  return [];
111
91
  }
@@ -114,8 +94,7 @@ export class TmuxManager {
114
94
  private async getProcessCommand(pid: number): Promise<string | null> {
115
95
  try {
116
96
  const { stdout } = await execFileAsync("ps", ["-p", String(pid), "-o", "command="]);
117
- const trimmed = stdout.trim();
118
- return trimmed || null;
97
+ return stdout.trim() || null;
119
98
  } catch {
120
99
  return null;
121
100
  }
@@ -1,5 +1,5 @@
1
1
  import type { AgentInfo } from "../adapters/AgentAdapter.js";
2
- import type { TerminalLocation } from "../terminal/TerminalFocusManager.js";
2
+ import type { TerminalLocation } from "../terminal/types.js";
3
3
  import type { AgentRuntimeProvider } from "../utils/AgentRegistry.js";
4
4
 
5
5
  export type AgentRuntimeAvailability =