devharness 0.8.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 (627) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +185 -0
  3. package/build/atomic-write.d.ts +28 -0
  4. package/build/atomic-write.d.ts.map +1 -0
  5. package/build/atomic-write.js +126 -0
  6. package/build/atomic-write.js.map +1 -0
  7. package/build/cdp-manager.d.ts +524 -0
  8. package/build/cdp-manager.d.ts.map +1 -0
  9. package/build/cdp-manager.js +1828 -0
  10. package/build/cdp-manager.js.map +1 -0
  11. package/build/cdp-manager.test.d.ts +6 -0
  12. package/build/cdp-manager.test.d.ts.map +1 -0
  13. package/build/cdp-manager.test.js +546 -0
  14. package/build/cdp-manager.test.js.map +1 -0
  15. package/build/chrome-launcher.d.ts +400 -0
  16. package/build/chrome-launcher.d.ts.map +1 -0
  17. package/build/chrome-launcher.js +1071 -0
  18. package/build/chrome-launcher.js.map +1 -0
  19. package/build/chrome-launcher.test.d.ts +11 -0
  20. package/build/chrome-launcher.test.d.ts.map +1 -0
  21. package/build/chrome-launcher.test.js +204 -0
  22. package/build/chrome-launcher.test.js.map +1 -0
  23. package/build/clickable-cache.d.ts +73 -0
  24. package/build/clickable-cache.d.ts.map +1 -0
  25. package/build/clickable-cache.js +90 -0
  26. package/build/clickable-cache.js.map +1 -0
  27. package/build/command-recorder.d.ts +401 -0
  28. package/build/command-recorder.d.ts.map +1 -0
  29. package/build/command-recorder.js +701 -0
  30. package/build/command-recorder.js.map +1 -0
  31. package/build/config.d.ts +390 -0
  32. package/build/config.d.ts.map +1 -0
  33. package/build/config.js +826 -0
  34. package/build/config.js.map +1 -0
  35. package/build/config.test.d.ts +2 -0
  36. package/build/config.test.d.ts.map +1 -0
  37. package/build/config.test.js +112 -0
  38. package/build/config.test.js.map +1 -0
  39. package/build/connection-manager.d.ts +159 -0
  40. package/build/connection-manager.d.ts.map +1 -0
  41. package/build/connection-manager.js +432 -0
  42. package/build/connection-manager.js.map +1 -0
  43. package/build/connection-manager.test.d.ts +11 -0
  44. package/build/connection-manager.test.d.ts.map +1 -0
  45. package/build/connection-manager.test.js +114 -0
  46. package/build/connection-manager.test.js.map +1 -0
  47. package/build/console-monitor.d.ts +150 -0
  48. package/build/console-monitor.d.ts.map +1 -0
  49. package/build/console-monitor.js +454 -0
  50. package/build/console-monitor.js.map +1 -0
  51. package/build/dashboard/bundle.js +1 -0
  52. package/build/dashboard/dashboard-client.d.ts +42 -0
  53. package/build/dashboard/dashboard-client.d.ts.map +1 -0
  54. package/build/dashboard/dashboard-client.js +184 -0
  55. package/build/dashboard/dashboard-client.js.map +1 -0
  56. package/build/dashboard/dashboard-hub.d.ts +50 -0
  57. package/build/dashboard/dashboard-hub.d.ts.map +1 -0
  58. package/build/dashboard/dashboard-hub.js +654 -0
  59. package/build/dashboard/dashboard-hub.js.map +1 -0
  60. package/build/dashboard/hub-lock.d.ts +16 -0
  61. package/build/dashboard/hub-lock.d.ts.map +1 -0
  62. package/build/dashboard/hub-lock.js +77 -0
  63. package/build/dashboard/hub-lock.js.map +1 -0
  64. package/build/dashboard/index.d.ts +25 -0
  65. package/build/dashboard/index.d.ts.map +1 -0
  66. package/build/dashboard/index.js +77 -0
  67. package/build/dashboard/index.js.map +1 -0
  68. package/build/dashboard/types.d.ts +83 -0
  69. package/build/dashboard/types.d.ts.map +1 -0
  70. package/build/dashboard/types.js +6 -0
  71. package/build/dashboard/types.js.map +1 -0
  72. package/build/debug-logger.d.ts +85 -0
  73. package/build/debug-logger.d.ts.map +1 -0
  74. package/build/debug-logger.js +195 -0
  75. package/build/debug-logger.js.map +1 -0
  76. package/build/debugger-aware-wrapper.d.ts +37 -0
  77. package/build/debugger-aware-wrapper.d.ts.map +1 -0
  78. package/build/debugger-aware-wrapper.js +128 -0
  79. package/build/debugger-aware-wrapper.js.map +1 -0
  80. package/build/dom-change-monitor.d.ts +92 -0
  81. package/build/dom-change-monitor.d.ts.map +1 -0
  82. package/build/dom-change-monitor.js +437 -0
  83. package/build/dom-change-monitor.js.map +1 -0
  84. package/build/element-collector.d.ts +16 -0
  85. package/build/element-collector.d.ts.map +1 -0
  86. package/build/element-collector.js +207 -0
  87. package/build/element-collector.js.map +1 -0
  88. package/build/error-helpers.d.ts +43 -0
  89. package/build/error-helpers.d.ts.map +1 -0
  90. package/build/error-helpers.js +143 -0
  91. package/build/error-helpers.js.map +1 -0
  92. package/build/formatters/console-formatter.d.ts +160 -0
  93. package/build/formatters/console-formatter.d.ts.map +1 -0
  94. package/build/formatters/console-formatter.js +338 -0
  95. package/build/formatters/console-formatter.js.map +1 -0
  96. package/build/helpers/parser-plugins.d.ts +44 -0
  97. package/build/helpers/parser-plugins.d.ts.map +1 -0
  98. package/build/helpers/parser-plugins.js +102 -0
  99. package/build/helpers/parser-plugins.js.map +1 -0
  100. package/build/helpers/paths.d.ts +79 -0
  101. package/build/helpers/paths.d.ts.map +1 -0
  102. package/build/helpers/paths.js +168 -0
  103. package/build/helpers/paths.js.map +1 -0
  104. package/build/helpers/process-liveness.d.ts +24 -0
  105. package/build/helpers/process-liveness.d.ts.map +1 -0
  106. package/build/helpers/process-liveness.js +36 -0
  107. package/build/helpers/process-liveness.js.map +1 -0
  108. package/build/helpers/process-liveness.test.d.ts +2 -0
  109. package/build/helpers/process-liveness.test.d.ts.map +1 -0
  110. package/build/helpers/process-liveness.test.js +40 -0
  111. package/build/helpers/process-liveness.test.js.map +1 -0
  112. package/build/helpers/sequence-tree.d.ts +27 -0
  113. package/build/helpers/sequence-tree.d.ts.map +1 -0
  114. package/build/helpers/sequence-tree.js +80 -0
  115. package/build/helpers/sequence-tree.js.map +1 -0
  116. package/build/helpers/sequence-tree.test.d.ts +2 -0
  117. package/build/helpers/sequence-tree.test.d.ts.map +1 -0
  118. package/build/helpers/sequence-tree.test.js +122 -0
  119. package/build/helpers/sequence-tree.test.js.map +1 -0
  120. package/build/index.d.ts +3 -0
  121. package/build/index.d.ts.map +1 -0
  122. package/build/index.js +2007 -0
  123. package/build/index.js.map +1 -0
  124. package/build/interaction-recorder.d.ts +214 -0
  125. package/build/interaction-recorder.d.ts.map +1 -0
  126. package/build/interaction-recorder.js +2007 -0
  127. package/build/interaction-recorder.js.map +1 -0
  128. package/build/issue-tracker.d.ts +107 -0
  129. package/build/issue-tracker.d.ts.map +1 -0
  130. package/build/issue-tracker.js +582 -0
  131. package/build/issue-tracker.js.map +1 -0
  132. package/build/issue-tracker.test.d.ts +2 -0
  133. package/build/issue-tracker.test.d.ts.map +1 -0
  134. package/build/issue-tracker.test.js +88 -0
  135. package/build/issue-tracker.test.js.map +1 -0
  136. package/build/launch-chrome-port.test.d.ts +14 -0
  137. package/build/launch-chrome-port.test.d.ts.map +1 -0
  138. package/build/launch-chrome-port.test.js +97 -0
  139. package/build/launch-chrome-port.test.js.map +1 -0
  140. package/build/log-processor/orchestrator.d.ts +32 -0
  141. package/build/log-processor/orchestrator.d.ts.map +1 -0
  142. package/build/log-processor/orchestrator.js +27 -0
  143. package/build/log-processor/orchestrator.js.map +1 -0
  144. package/build/logpoint-execution-tracker.d.ts +57 -0
  145. package/build/logpoint-execution-tracker.d.ts.map +1 -0
  146. package/build/logpoint-execution-tracker.js +112 -0
  147. package/build/logpoint-execution-tracker.js.map +1 -0
  148. package/build/mcp-supervisor.d.ts +3 -0
  149. package/build/mcp-supervisor.d.ts.map +1 -0
  150. package/build/mcp-supervisor.js +211 -0
  151. package/build/mcp-supervisor.js.map +1 -0
  152. package/build/messages.d.ts +165 -0
  153. package/build/messages.d.ts.map +1 -0
  154. package/build/messages.js +574 -0
  155. package/build/messages.js.map +1 -0
  156. package/build/network-monitor.d.ts +172 -0
  157. package/build/network-monitor.d.ts.map +1 -0
  158. package/build/network-monitor.js +350 -0
  159. package/build/network-monitor.js.map +1 -0
  160. package/build/overlays.d.ts +49 -0
  161. package/build/overlays.d.ts.map +1 -0
  162. package/build/overlays.js +409 -0
  163. package/build/overlays.js.map +1 -0
  164. package/build/persistent-profiles.test.d.ts +15 -0
  165. package/build/persistent-profiles.test.d.ts.map +1 -0
  166. package/build/persistent-profiles.test.js +470 -0
  167. package/build/persistent-profiles.test.js.map +1 -0
  168. package/build/port-reserver.d.ts +32 -0
  169. package/build/port-reserver.d.ts.map +1 -0
  170. package/build/port-reserver.js +118 -0
  171. package/build/port-reserver.js.map +1 -0
  172. package/build/puppeteer-manager.d.ts +47 -0
  173. package/build/puppeteer-manager.d.ts.map +1 -0
  174. package/build/puppeteer-manager.js +116 -0
  175. package/build/puppeteer-manager.js.map +1 -0
  176. package/build/recording-coverage.test.d.ts +12 -0
  177. package/build/recording-coverage.test.d.ts.map +1 -0
  178. package/build/recording-coverage.test.js +72 -0
  179. package/build/recording-coverage.test.js.map +1 -0
  180. package/build/reference-validator.d.ts +47 -0
  181. package/build/reference-validator.d.ts.map +1 -0
  182. package/build/reference-validator.js +86 -0
  183. package/build/reference-validator.js.map +1 -0
  184. package/build/reference-validator.test.d.ts +5 -0
  185. package/build/reference-validator.test.d.ts.map +1 -0
  186. package/build/reference-validator.test.js +243 -0
  187. package/build/reference-validator.test.js.map +1 -0
  188. package/build/replay-cursor.d.ts +27 -0
  189. package/build/replay-cursor.d.ts.map +1 -0
  190. package/build/replay-cursor.js +240 -0
  191. package/build/replay-cursor.js.map +1 -0
  192. package/build/runners/docker-compose-runner.d.ts +69 -0
  193. package/build/runners/docker-compose-runner.d.ts.map +1 -0
  194. package/build/runners/docker-compose-runner.js +438 -0
  195. package/build/runners/docker-compose-runner.js.map +1 -0
  196. package/build/runners/docker-runner.d.ts +65 -0
  197. package/build/runners/docker-runner.d.ts.map +1 -0
  198. package/build/runners/docker-runner.js +414 -0
  199. package/build/runners/docker-runner.js.map +1 -0
  200. package/build/runners/index.d.ts +19 -0
  201. package/build/runners/index.d.ts.map +1 -0
  202. package/build/runners/index.js +35 -0
  203. package/build/runners/index.js.map +1 -0
  204. package/build/runners/native-runner.d.ts +95 -0
  205. package/build/runners/native-runner.d.ts.map +1 -0
  206. package/build/runners/native-runner.js +370 -0
  207. package/build/runners/native-runner.js.map +1 -0
  208. package/build/runners/types.d.ts +147 -0
  209. package/build/runners/types.d.ts.map +1 -0
  210. package/build/runners/types.js +25 -0
  211. package/build/runners/types.js.map +1 -0
  212. package/build/self-restart.d.ts +12 -0
  213. package/build/self-restart.d.ts.map +1 -0
  214. package/build/self-restart.js +41 -0
  215. package/build/self-restart.js.map +1 -0
  216. package/build/self-restart.test.d.ts +2 -0
  217. package/build/self-restart.test.d.ts.map +1 -0
  218. package/build/self-restart.test.js +34 -0
  219. package/build/self-restart.test.js.map +1 -0
  220. package/build/server-claims.d.ts +161 -0
  221. package/build/server-claims.d.ts.map +1 -0
  222. package/build/server-claims.js +382 -0
  223. package/build/server-claims.js.map +1 -0
  224. package/build/server-claims.test.d.ts +2 -0
  225. package/build/server-claims.test.d.ts.map +1 -0
  226. package/build/server-claims.test.js +197 -0
  227. package/build/server-claims.test.js.map +1 -0
  228. package/build/server-manager.d.ts +438 -0
  229. package/build/server-manager.d.ts.map +1 -0
  230. package/build/server-manager.js +1674 -0
  231. package/build/server-manager.js.map +1 -0
  232. package/build/server-manager.test.d.ts +17 -0
  233. package/build/server-manager.test.d.ts.map +1 -0
  234. package/build/server-manager.test.js +122 -0
  235. package/build/server-manager.test.js.map +1 -0
  236. package/build/server-ownership.test.d.ts +2 -0
  237. package/build/server-ownership.test.d.ts.map +1 -0
  238. package/build/server-ownership.test.js +238 -0
  239. package/build/server-ownership.test.js.map +1 -0
  240. package/build/server-watcher.d.ts +21 -0
  241. package/build/server-watcher.d.ts.map +1 -0
  242. package/build/server-watcher.js +105 -0
  243. package/build/server-watcher.js.map +1 -0
  244. package/build/session-detector.d.ts +47 -0
  245. package/build/session-detector.d.ts.map +1 -0
  246. package/build/session-detector.js +229 -0
  247. package/build/session-detector.js.map +1 -0
  248. package/build/session-detector.test.d.ts +9 -0
  249. package/build/session-detector.test.d.ts.map +1 -0
  250. package/build/session-detector.test.js +45 -0
  251. package/build/session-detector.test.js.map +1 -0
  252. package/build/sourcemap-handler.d.ts +114 -0
  253. package/build/sourcemap-handler.d.ts.map +1 -0
  254. package/build/sourcemap-handler.js +479 -0
  255. package/build/sourcemap-handler.js.map +1 -0
  256. package/build/supervisor/child-manager.d.ts +43 -0
  257. package/build/supervisor/child-manager.d.ts.map +1 -0
  258. package/build/supervisor/child-manager.js +148 -0
  259. package/build/supervisor/child-manager.js.map +1 -0
  260. package/build/supervisor/child-manager.test.d.ts +2 -0
  261. package/build/supervisor/child-manager.test.d.ts.map +1 -0
  262. package/build/supervisor/child-manager.test.js +107 -0
  263. package/build/supervisor/child-manager.test.js.map +1 -0
  264. package/build/supervisor/client-watcher.d.ts +48 -0
  265. package/build/supervisor/client-watcher.d.ts.map +1 -0
  266. package/build/supervisor/client-watcher.js +186 -0
  267. package/build/supervisor/client-watcher.js.map +1 -0
  268. package/build/supervisor/client-watcher.test.d.ts +2 -0
  269. package/build/supervisor/client-watcher.test.d.ts.map +1 -0
  270. package/build/supervisor/client-watcher.test.js +121 -0
  271. package/build/supervisor/client-watcher.test.js.map +1 -0
  272. package/build/supervisor/idle-config.d.ts +30 -0
  273. package/build/supervisor/idle-config.d.ts.map +1 -0
  274. package/build/supervisor/idle-config.js +76 -0
  275. package/build/supervisor/idle-config.js.map +1 -0
  276. package/build/supervisor/idle-config.test.d.ts +2 -0
  277. package/build/supervisor/idle-config.test.d.ts.map +1 -0
  278. package/build/supervisor/idle-config.test.js +119 -0
  279. package/build/supervisor/idle-config.test.js.map +1 -0
  280. package/build/supervisor/ndjson-reader.d.ts +47 -0
  281. package/build/supervisor/ndjson-reader.d.ts.map +1 -0
  282. package/build/supervisor/ndjson-reader.js +75 -0
  283. package/build/supervisor/ndjson-reader.js.map +1 -0
  284. package/build/supervisor/ndjson-reader.test.d.ts +2 -0
  285. package/build/supervisor/ndjson-reader.test.d.ts.map +1 -0
  286. package/build/supervisor/ndjson-reader.test.js +92 -0
  287. package/build/supervisor/ndjson-reader.test.js.map +1 -0
  288. package/build/supervisor/pidfile.d.ts +11 -0
  289. package/build/supervisor/pidfile.d.ts.map +1 -0
  290. package/build/supervisor/pidfile.js +29 -0
  291. package/build/supervisor/pidfile.js.map +1 -0
  292. package/build/supervisor/pidfile.test.d.ts +8 -0
  293. package/build/supervisor/pidfile.test.d.ts.map +1 -0
  294. package/build/supervisor/pidfile.test.js +46 -0
  295. package/build/supervisor/pidfile.test.js.map +1 -0
  296. package/build/supervisor/restart-coordinator.d.ts +73 -0
  297. package/build/supervisor/restart-coordinator.d.ts.map +1 -0
  298. package/build/supervisor/restart-coordinator.js +300 -0
  299. package/build/supervisor/restart-coordinator.js.map +1 -0
  300. package/build/supervisor/restart-coordinator.test.d.ts +2 -0
  301. package/build/supervisor/restart-coordinator.test.d.ts.map +1 -0
  302. package/build/supervisor/restart-coordinator.test.js +434 -0
  303. package/build/supervisor/restart-coordinator.test.js.map +1 -0
  304. package/build/test-support/fake-execute-tool-call.d.ts +11 -0
  305. package/build/test-support/fake-execute-tool-call.d.ts.map +1 -0
  306. package/build/test-support/fake-execute-tool-call.js +19 -0
  307. package/build/test-support/fake-execute-tool-call.js.map +1 -0
  308. package/build/tool-error.d.ts +14 -0
  309. package/build/tool-error.d.ts.map +1 -0
  310. package/build/tool-error.js +18 -0
  311. package/build/tool-error.js.map +1 -0
  312. package/build/tool-response.d.ts +293 -0
  313. package/build/tool-response.d.ts.map +1 -0
  314. package/build/tool-response.js +365 -0
  315. package/build/tool-response.js.map +1 -0
  316. package/build/tools/assert-tools.d.ts +62 -0
  317. package/build/tools/assert-tools.d.ts.map +1 -0
  318. package/build/tools/assert-tools.js +330 -0
  319. package/build/tools/assert-tools.js.map +1 -0
  320. package/build/tools/breakpoint-await-abort.test.d.ts +2 -0
  321. package/build/tools/breakpoint-await-abort.test.d.ts.map +1 -0
  322. package/build/tools/breakpoint-await-abort.test.js +124 -0
  323. package/build/tools/breakpoint-await-abort.test.js.map +1 -0
  324. package/build/tools/breakpoint-tools.d.ts +99 -0
  325. package/build/tools/breakpoint-tools.d.ts.map +1 -0
  326. package/build/tools/breakpoint-tools.js +1197 -0
  327. package/build/tools/breakpoint-tools.js.map +1 -0
  328. package/build/tools/config-tools.d.ts +58 -0
  329. package/build/tools/config-tools.d.ts.map +1 -0
  330. package/build/tools/config-tools.js +180 -0
  331. package/build/tools/config-tools.js.map +1 -0
  332. package/build/tools/connection-routing.test.d.ts +12 -0
  333. package/build/tools/connection-routing.test.d.ts.map +1 -0
  334. package/build/tools/connection-routing.test.js +206 -0
  335. package/build/tools/connection-routing.test.js.map +1 -0
  336. package/build/tools/console-tools.d.ts +84 -0
  337. package/build/tools/console-tools.d.ts.map +1 -0
  338. package/build/tools/console-tools.js +241 -0
  339. package/build/tools/console-tools.js.map +1 -0
  340. package/build/tools/content-tools.d.ts +74 -0
  341. package/build/tools/content-tools.d.ts.map +1 -0
  342. package/build/tools/content-tools.js +582 -0
  343. package/build/tools/content-tools.js.map +1 -0
  344. package/build/tools/dashboard-tools.d.ts +38 -0
  345. package/build/tools/dashboard-tools.d.ts.map +1 -0
  346. package/build/tools/dashboard-tools.js +123 -0
  347. package/build/tools/dashboard-tools.js.map +1 -0
  348. package/build/tools/dom-tools.d.ts +41 -0
  349. package/build/tools/dom-tools.d.ts.map +1 -0
  350. package/build/tools/dom-tools.js +277 -0
  351. package/build/tools/dom-tools.js.map +1 -0
  352. package/build/tools/download-tools.d.ts +55 -0
  353. package/build/tools/download-tools.d.ts.map +1 -0
  354. package/build/tools/download-tools.js +280 -0
  355. package/build/tools/download-tools.js.map +1 -0
  356. package/build/tools/execution-tools.d.ts +40 -0
  357. package/build/tools/execution-tools.d.ts.map +1 -0
  358. package/build/tools/execution-tools.js +121 -0
  359. package/build/tools/execution-tools.js.map +1 -0
  360. package/build/tools/input-abort.test.d.ts +2 -0
  361. package/build/tools/input-abort.test.d.ts.map +1 -0
  362. package/build/tools/input-abort.test.js +227 -0
  363. package/build/tools/input-abort.test.js.map +1 -0
  364. package/build/tools/input-ambiguous-selector.test.d.ts +2 -0
  365. package/build/tools/input-ambiguous-selector.test.d.ts.map +1 -0
  366. package/build/tools/input-ambiguous-selector.test.js +34 -0
  367. package/build/tools/input-ambiguous-selector.test.js.map +1 -0
  368. package/build/tools/input-tools.d.ts +168 -0
  369. package/build/tools/input-tools.d.ts.map +1 -0
  370. package/build/tools/input-tools.js +1397 -0
  371. package/build/tools/input-tools.js.map +1 -0
  372. package/build/tools/inspection-tools.d.ts +112 -0
  373. package/build/tools/inspection-tools.d.ts.map +1 -0
  374. package/build/tools/inspection-tools.js +637 -0
  375. package/build/tools/inspection-tools.js.map +1 -0
  376. package/build/tools/interpolation.d.ts +30 -0
  377. package/build/tools/interpolation.d.ts.map +1 -0
  378. package/build/tools/interpolation.js +143 -0
  379. package/build/tools/interpolation.js.map +1 -0
  380. package/build/tools/issues-abort-hygiene.test.d.ts +2 -0
  381. package/build/tools/issues-abort-hygiene.test.d.ts.map +1 -0
  382. package/build/tools/issues-abort-hygiene.test.js +79 -0
  383. package/build/tools/issues-abort-hygiene.test.js.map +1 -0
  384. package/build/tools/issues-tools.d.ts +98 -0
  385. package/build/tools/issues-tools.d.ts.map +1 -0
  386. package/build/tools/issues-tools.js +821 -0
  387. package/build/tools/issues-tools.js.map +1 -0
  388. package/build/tools/issues-tools.test.d.ts +8 -0
  389. package/build/tools/issues-tools.test.d.ts.map +1 -0
  390. package/build/tools/issues-tools.test.js +184 -0
  391. package/build/tools/issues-tools.test.js.map +1 -0
  392. package/build/tools/modal-tools.d.ts +73 -0
  393. package/build/tools/modal-tools.d.ts.map +1 -0
  394. package/build/tools/modal-tools.js +161 -0
  395. package/build/tools/modal-tools.js.map +1 -0
  396. package/build/tools/network-tools.d.ts +72 -0
  397. package/build/tools/network-tools.d.ts.map +1 -0
  398. package/build/tools/network-tools.js +432 -0
  399. package/build/tools/network-tools.js.map +1 -0
  400. package/build/tools/page-tools.d.ts +78 -0
  401. package/build/tools/page-tools.d.ts.map +1 -0
  402. package/build/tools/page-tools.js +255 -0
  403. package/build/tools/page-tools.js.map +1 -0
  404. package/build/tools/plugin-tools.d.ts +16 -0
  405. package/build/tools/plugin-tools.d.ts.map +1 -0
  406. package/build/tools/plugin-tools.js +17 -0
  407. package/build/tools/plugin-tools.js.map +1 -0
  408. package/build/tools/replay-abort.test.d.ts +2 -0
  409. package/build/tools/replay-abort.test.d.ts.map +1 -0
  410. package/build/tools/replay-abort.test.js +259 -0
  411. package/build/tools/replay-abort.test.js.map +1 -0
  412. package/build/tools/replay-add-conditional.test.d.ts +2 -0
  413. package/build/tools/replay-add-conditional.test.d.ts.map +1 -0
  414. package/build/tools/replay-add-conditional.test.js +205 -0
  415. package/build/tools/replay-add-conditional.test.js.map +1 -0
  416. package/build/tools/replay-background-run.test.d.ts +2 -0
  417. package/build/tools/replay-background-run.test.d.ts.map +1 -0
  418. package/build/tools/replay-background-run.test.js +176 -0
  419. package/build/tools/replay-background-run.test.js.map +1 -0
  420. package/build/tools/replay-capture-variables.test.d.ts +2 -0
  421. package/build/tools/replay-capture-variables.test.d.ts.map +1 -0
  422. package/build/tools/replay-capture-variables.test.js +331 -0
  423. package/build/tools/replay-capture-variables.test.js.map +1 -0
  424. package/build/tools/replay-conditional-idb-and-launch.test.d.ts +11 -0
  425. package/build/tools/replay-conditional-idb-and-launch.test.d.ts.map +1 -0
  426. package/build/tools/replay-conditional-idb-and-launch.test.js +429 -0
  427. package/build/tools/replay-conditional-idb-and-launch.test.js.map +1 -0
  428. package/build/tools/replay-conditional-timeout.test.d.ts +14 -0
  429. package/build/tools/replay-conditional-timeout.test.d.ts.map +1 -0
  430. package/build/tools/replay-conditional-timeout.test.js +126 -0
  431. package/build/tools/replay-conditional-timeout.test.js.map +1 -0
  432. package/build/tools/replay-declare.test.d.ts +2 -0
  433. package/build/tools/replay-declare.test.d.ts.map +1 -0
  434. package/build/tools/replay-declare.test.js +106 -0
  435. package/build/tools/replay-declare.test.js.map +1 -0
  436. package/build/tools/replay-declared-browser-cleanup.test.d.ts +2 -0
  437. package/build/tools/replay-declared-browser-cleanup.test.d.ts.map +1 -0
  438. package/build/tools/replay-declared-browser-cleanup.test.js +103 -0
  439. package/build/tools/replay-declared-browser-cleanup.test.js.map +1 -0
  440. package/build/tools/replay-declared-profile.test.d.ts +2 -0
  441. package/build/tools/replay-declared-profile.test.d.ts.map +1 -0
  442. package/build/tools/replay-declared-profile.test.js +116 -0
  443. package/build/tools/replay-declared-profile.test.js.map +1 -0
  444. package/build/tools/replay-executor.d.ts +556 -0
  445. package/build/tools/replay-executor.d.ts.map +1 -0
  446. package/build/tools/replay-executor.js +2347 -0
  447. package/build/tools/replay-executor.js.map +1 -0
  448. package/build/tools/replay-folder-save.test.d.ts +2 -0
  449. package/build/tools/replay-folder-save.test.d.ts.map +1 -0
  450. package/build/tools/replay-folder-save.test.js +63 -0
  451. package/build/tools/replay-folder-save.test.js.map +1 -0
  452. package/build/tools/replay-formatters.d.ts +148 -0
  453. package/build/tools/replay-formatters.d.ts.map +1 -0
  454. package/build/tools/replay-formatters.js +856 -0
  455. package/build/tools/replay-formatters.js.map +1 -0
  456. package/build/tools/replay-kill-chrome-on-finish.test.d.ts +2 -0
  457. package/build/tools/replay-kill-chrome-on-finish.test.d.ts.map +1 -0
  458. package/build/tools/replay-kill-chrome-on-finish.test.js +175 -0
  459. package/build/tools/replay-kill-chrome-on-finish.test.js.map +1 -0
  460. package/build/tools/replay-multi-connection.test.d.ts +2 -0
  461. package/build/tools/replay-multi-connection.test.d.ts.map +1 -0
  462. package/build/tools/replay-multi-connection.test.js +547 -0
  463. package/build/tools/replay-multi-connection.test.js.map +1 -0
  464. package/build/tools/replay-output-and-record-options.test.d.ts +2 -0
  465. package/build/tools/replay-output-and-record-options.test.d.ts.map +1 -0
  466. package/build/tools/replay-output-and-record-options.test.js +240 -0
  467. package/build/tools/replay-output-and-record-options.test.js.map +1 -0
  468. package/build/tools/replay-production-error-shape.test.d.ts +7 -0
  469. package/build/tools/replay-production-error-shape.test.d.ts.map +1 -0
  470. package/build/tools/replay-production-error-shape.test.js +93 -0
  471. package/build/tools/replay-production-error-shape.test.js.map +1 -0
  472. package/build/tools/replay-rebase.test.d.ts +2 -0
  473. package/build/tools/replay-rebase.test.d.ts.map +1 -0
  474. package/build/tools/replay-rebase.test.js +58 -0
  475. package/build/tools/replay-rebase.test.js.map +1 -0
  476. package/build/tools/replay-retry-classification.test.d.ts +9 -0
  477. package/build/tools/replay-retry-classification.test.d.ts.map +1 -0
  478. package/build/tools/replay-retry-classification.test.js +57 -0
  479. package/build/tools/replay-retry-classification.test.js.map +1 -0
  480. package/build/tools/replay-run-registry.d.ts +55 -0
  481. package/build/tools/replay-run-registry.d.ts.map +1 -0
  482. package/build/tools/replay-run-registry.js +65 -0
  483. package/build/tools/replay-run-registry.js.map +1 -0
  484. package/build/tools/replay-sequence-reload.test.d.ts +2 -0
  485. package/build/tools/replay-sequence-reload.test.d.ts.map +1 -0
  486. package/build/tools/replay-sequence-reload.test.js +82 -0
  487. package/build/tools/replay-sequence-reload.test.js.map +1 -0
  488. package/build/tools/replay-socket-scope.test.d.ts +2 -0
  489. package/build/tools/replay-socket-scope.test.d.ts.map +1 -0
  490. package/build/tools/replay-socket-scope.test.js +75 -0
  491. package/build/tools/replay-socket-scope.test.js.map +1 -0
  492. package/build/tools/replay-step-connection.test.d.ts +2 -0
  493. package/build/tools/replay-step-connection.test.d.ts.map +1 -0
  494. package/build/tools/replay-step-connection.test.js +292 -0
  495. package/build/tools/replay-step-connection.test.js.map +1 -0
  496. package/build/tools/replay-step-timeout.test.d.ts +2 -0
  497. package/build/tools/replay-step-timeout.test.d.ts.map +1 -0
  498. package/build/tools/replay-step-timeout.test.js +204 -0
  499. package/build/tools/replay-step-timeout.test.js.map +1 -0
  500. package/build/tools/replay-tags.test.d.ts +2 -0
  501. package/build/tools/replay-tags.test.d.ts.map +1 -0
  502. package/build/tools/replay-tags.test.js +99 -0
  503. package/build/tools/replay-tags.test.js.map +1 -0
  504. package/build/tools/replay-teardown-and-foreach.test.d.ts +13 -0
  505. package/build/tools/replay-teardown-and-foreach.test.d.ts.map +1 -0
  506. package/build/tools/replay-teardown-and-foreach.test.js +318 -0
  507. package/build/tools/replay-teardown-and-foreach.test.js.map +1 -0
  508. package/build/tools/replay-tool-name-validation.test.d.ts +2 -0
  509. package/build/tools/replay-tool-name-validation.test.d.ts.map +1 -0
  510. package/build/tools/replay-tool-name-validation.test.js +280 -0
  511. package/build/tools/replay-tool-name-validation.test.js.map +1 -0
  512. package/build/tools/replay-tools.d.ts +288 -0
  513. package/build/tools/replay-tools.d.ts.map +1 -0
  514. package/build/tools/replay-tools.js +2994 -0
  515. package/build/tools/replay-tools.js.map +1 -0
  516. package/build/tools/request-abort.test.d.ts +2 -0
  517. package/build/tools/request-abort.test.d.ts.map +1 -0
  518. package/build/tools/request-abort.test.js +130 -0
  519. package/build/tools/request-abort.test.js.map +1 -0
  520. package/build/tools/request-tools.d.ts +56 -0
  521. package/build/tools/request-tools.d.ts.map +1 -0
  522. package/build/tools/request-tools.js +174 -0
  523. package/build/tools/request-tools.js.map +1 -0
  524. package/build/tools/screenshot-tools.d.ts +135 -0
  525. package/build/tools/screenshot-tools.d.ts.map +1 -0
  526. package/build/tools/screenshot-tools.js +636 -0
  527. package/build/tools/screenshot-tools.js.map +1 -0
  528. package/build/tools/server-tools.d.ts +88 -0
  529. package/build/tools/server-tools.d.ts.map +1 -0
  530. package/build/tools/server-tools.js +485 -0
  531. package/build/tools/server-tools.js.map +1 -0
  532. package/build/tools/source-tools.d.ts +46 -0
  533. package/build/tools/source-tools.d.ts.map +1 -0
  534. package/build/tools/source-tools.js +47 -0
  535. package/build/tools/source-tools.js.map +1 -0
  536. package/build/tools/storage-tools.d.ts +141 -0
  537. package/build/tools/storage-tools.d.ts.map +1 -0
  538. package/build/tools/storage-tools.js +894 -0
  539. package/build/tools/storage-tools.js.map +1 -0
  540. package/build/tools/storage-tools.test.d.ts +13 -0
  541. package/build/tools/storage-tools.test.d.ts.map +1 -0
  542. package/build/tools/storage-tools.test.js +707 -0
  543. package/build/tools/storage-tools.test.js.map +1 -0
  544. package/build/tools/tab-tools.d.ts +42 -0
  545. package/build/tools/tab-tools.d.ts.map +1 -0
  546. package/build/tools/tab-tools.js +296 -0
  547. package/build/tools/tab-tools.js.map +1 -0
  548. package/build/tools/wait-tools.d.ts +85 -0
  549. package/build/tools/wait-tools.d.ts.map +1 -0
  550. package/build/tools/wait-tools.js +236 -0
  551. package/build/tools/wait-tools.js.map +1 -0
  552. package/build/tools/wait-tools.test.d.ts +9 -0
  553. package/build/tools/wait-tools.test.d.ts.map +1 -0
  554. package/build/tools/wait-tools.test.js +193 -0
  555. package/build/tools/wait-tools.test.js.map +1 -0
  556. package/build/types.d.ts +133 -0
  557. package/build/types.d.ts.map +1 -0
  558. package/build/types.js +5 -0
  559. package/build/types.js.map +1 -0
  560. package/build/ui-verifier.d.ts +88 -0
  561. package/build/ui-verifier.d.ts.map +1 -0
  562. package/build/ui-verifier.js +540 -0
  563. package/build/ui-verifier.js.map +1 -0
  564. package/build/utils/abort.d.ts +68 -0
  565. package/build/utils/abort.d.ts.map +1 -0
  566. package/build/utils/abort.js +159 -0
  567. package/build/utils/abort.js.map +1 -0
  568. package/build/utils/abort.test.d.ts +2 -0
  569. package/build/utils/abort.test.d.ts.map +1 -0
  570. package/build/utils/abort.test.js +174 -0
  571. package/build/utils/abort.test.js.map +1 -0
  572. package/build/utils/modal-detection-core.d.ts +150 -0
  573. package/build/utils/modal-detection-core.d.ts.map +1 -0
  574. package/build/utils/modal-detection-core.js +332 -0
  575. package/build/utils/modal-detection-core.js.map +1 -0
  576. package/build/utils/modal-detection-core.test.d.ts +5 -0
  577. package/build/utils/modal-detection-core.test.d.ts.map +1 -0
  578. package/build/utils/modal-detection-core.test.js +492 -0
  579. package/build/utils/modal-detection-core.test.js.map +1 -0
  580. package/build/utils/modal-detector.d.ts +29 -0
  581. package/build/utils/modal-detector.d.ts.map +1 -0
  582. package/build/utils/modal-detector.js +281 -0
  583. package/build/utils/modal-detector.js.map +1 -0
  584. package/build/utils/modal-dismissal.d.ts +32 -0
  585. package/build/utils/modal-dismissal.d.ts.map +1 -0
  586. package/build/utils/modal-dismissal.js +190 -0
  587. package/build/utils/modal-dismissal.js.map +1 -0
  588. package/build/utils/port-check.d.ts +31 -0
  589. package/build/utils/port-check.d.ts.map +1 -0
  590. package/build/utils/port-check.js +87 -0
  591. package/build/utils/port-check.js.map +1 -0
  592. package/build/utils/port-check.test.d.ts +2 -0
  593. package/build/utils/port-check.test.d.ts.map +1 -0
  594. package/build/utils/port-check.test.js +66 -0
  595. package/build/utils/port-check.test.js.map +1 -0
  596. package/build/utils/selector-resolver.d.ts +66 -0
  597. package/build/utils/selector-resolver.d.ts.map +1 -0
  598. package/build/utils/selector-resolver.js +200 -0
  599. package/build/utils/selector-resolver.js.map +1 -0
  600. package/build/validation-helpers.d.ts +41 -0
  601. package/build/validation-helpers.d.ts.map +1 -0
  602. package/build/validation-helpers.js +236 -0
  603. package/build/validation-helpers.js.map +1 -0
  604. package/build/window-sizing.d.ts +26 -0
  605. package/build/window-sizing.d.ts.map +1 -0
  606. package/build/window-sizing.js +87 -0
  607. package/build/window-sizing.js.map +1 -0
  608. package/build/window-sizing.test.d.ts +8 -0
  609. package/build/window-sizing.test.d.ts.map +1 -0
  610. package/build/window-sizing.test.js +113 -0
  611. package/build/window-sizing.test.js.map +1 -0
  612. package/docs/README.md +74 -0
  613. package/docs/automation.md +562 -0
  614. package/docs/debugging.md +229 -0
  615. package/docs/installation.md +133 -0
  616. package/docs/instructions.md +227 -0
  617. package/docs/mcp-instructions.md +15 -0
  618. package/docs/message-system.md +327 -0
  619. package/docs/messages.md +3480 -0
  620. package/docs/parser-plugins.md +132 -0
  621. package/docs/replay.md +1411 -0
  622. package/docs/troubleshooting.md +272 -0
  623. package/docs/working_with_llm_notes.md +5 -0
  624. package/package.json +87 -0
  625. package/skills/devharness/SKILL.md +195 -0
  626. package/skills/devharness/references/sequences.md +613 -0
  627. package/skills/devharness/references/tool-categories.md +99 -0
@@ -0,0 +1,414 @@
1
+ /**
2
+ * Docker Runner
3
+ * Runs containers using Docker CLI
4
+ */
5
+ import { spawnSync } from 'child_process';
6
+ import { debugLog } from '../debug-logger.js';
7
+ /**
8
+ * Check if Docker is available on the system
9
+ * @throws Error if Docker is not installed or not running
10
+ */
11
+ function ensureDockerAvailable() {
12
+ try {
13
+ const result = spawnSync('docker', ['version', '--format', '{{.Server.Version}}'], {
14
+ encoding: 'utf-8',
15
+ timeout: 10000,
16
+ stdio: ['pipe', 'pipe', 'pipe'],
17
+ });
18
+ if (result.error || result.status !== 0) {
19
+ const stderr = result.stderr?.toString() || '';
20
+ // Reset cache on any failure so we re-check next time
21
+ dockerChecked = false;
22
+ if (stderr.includes('Cannot connect') || stderr.includes('Is the docker daemon running')) {
23
+ throw new Error('Docker daemon is not running. Please start Docker and try again.');
24
+ }
25
+ if (stderr.includes('paused') || stderr.includes('Paused')) {
26
+ throw new Error('Docker Desktop is paused. Please unpause it and try again.');
27
+ }
28
+ // Pass through Docker's error message if available, otherwise generic message
29
+ if (stderr.trim()) {
30
+ throw new Error(stderr.trim());
31
+ }
32
+ throw new Error('Docker is not available. Please install Docker and try again.');
33
+ }
34
+ }
35
+ catch (err) {
36
+ if (err.code === 'ENOENT') {
37
+ throw new Error('Docker is not installed. Please install Docker from https://docs.docker.com/get-docker/');
38
+ }
39
+ // Reset cache on any error so we re-check next time
40
+ dockerChecked = false;
41
+ throw err;
42
+ }
43
+ }
44
+ /** Cache for Docker availability check - reset on failure */
45
+ let dockerChecked = false;
46
+ /**
47
+ * Reset the Docker availability cache.
48
+ * Called before autoRun to ensure Docker is checked fresh.
49
+ */
50
+ export function resetDockerCheck() {
51
+ dockerChecked = false;
52
+ }
53
+ /**
54
+ * Sanitize a string to be safe for use as a Docker container/project name.
55
+ * Only allows alphanumeric characters, dashes, and underscores.
56
+ */
57
+ function sanitizeForDocker(name) {
58
+ // Replace any character that isn't alphanumeric, dash, or underscore
59
+ return name.replace(/[^a-zA-Z0-9_-]/g, '_');
60
+ }
61
+ export class DockerRunner {
62
+ type = 'docker';
63
+ id;
64
+ command = '';
65
+ cwd = '';
66
+ containerId = null;
67
+ containerName = null;
68
+ port = null;
69
+ startedAt = null;
70
+ lastLogTimestamp = null;
71
+ env = {};
72
+ constructor(id) {
73
+ this.id = sanitizeForDocker(id);
74
+ // Use sanitized server ID as container name for easy reference
75
+ this.containerName = `cdp-tools-${this.id}`;
76
+ }
77
+ /**
78
+ * Restore state from persisted data
79
+ */
80
+ restore(data) {
81
+ this.command = data.command;
82
+ this.cwd = data.cwd;
83
+ this.containerId = data.containerId ?? null;
84
+ this.port = data.port ?? null;
85
+ this.startedAt = new Date(data.startedAt);
86
+ }
87
+ /**
88
+ * Execute docker command using spawn with args array (prevents shell injection)
89
+ */
90
+ execDocker(args, options) {
91
+ // Check Docker is available on first use
92
+ if (!dockerChecked) {
93
+ ensureDockerAvailable();
94
+ dockerChecked = true;
95
+ }
96
+ const result = spawnSync('docker', args, {
97
+ cwd: options?.cwd,
98
+ encoding: 'utf-8',
99
+ timeout: 30000,
100
+ stdio: ['pipe', 'pipe', 'pipe'],
101
+ });
102
+ if (result.error) {
103
+ throw new Error(result.error.message);
104
+ }
105
+ if (result.status !== 0) {
106
+ const stderr = result.stderr?.toString() || '';
107
+ const stdout = result.stdout?.toString() || '';
108
+ const errorMsg = stderr || stdout || '';
109
+ // Check if Docker daemon stopped while MCP was running
110
+ if (errorMsg.includes('Cannot connect') || errorMsg.includes('Is the docker daemon running')) {
111
+ // Reset cache so next attempt will re-check
112
+ dockerChecked = false;
113
+ throw new Error('Docker daemon is not running. Please start Docker and try again.');
114
+ }
115
+ throw new Error(errorMsg || `Docker command failed with status ${result.status}`);
116
+ }
117
+ return (result.stdout || '').trim();
118
+ }
119
+ /**
120
+ * Parse a docker run command string into an array of arguments.
121
+ * This handles quoted strings properly.
122
+ */
123
+ parseCommandArgs(command) {
124
+ const args = [];
125
+ let current = '';
126
+ let inQuote = null;
127
+ let i = 0;
128
+ // Skip 'docker run' prefix
129
+ const runMatch = command.match(/^docker\s+run\s+/i);
130
+ if (runMatch) {
131
+ i = runMatch[0].length;
132
+ }
133
+ while (i < command.length) {
134
+ const char = command[i];
135
+ if (inQuote) {
136
+ if (char === inQuote) {
137
+ inQuote = null;
138
+ }
139
+ else {
140
+ current += char;
141
+ }
142
+ }
143
+ else if (char === '"' || char === "'") {
144
+ inQuote = char;
145
+ }
146
+ else if (char === ' ' || char === '\t') {
147
+ if (current) {
148
+ args.push(current);
149
+ current = '';
150
+ }
151
+ }
152
+ else {
153
+ current += char;
154
+ }
155
+ i++;
156
+ }
157
+ if (current) {
158
+ args.push(current);
159
+ }
160
+ return args;
161
+ }
162
+ /**
163
+ * Build docker run arguments from the command and options
164
+ */
165
+ buildDockerRunArgs(command, envVars) {
166
+ const parsedArgs = this.parseCommandArgs(command);
167
+ const args = ['run'];
168
+ // Check if already has -d flag
169
+ const hasDetached = parsedArgs.some(arg => arg === '-d' || arg === '--detach');
170
+ const hasName = parsedArgs.some((arg, i) => arg === '--name' || (i > 0 && parsedArgs[i - 1] === '--name'));
171
+ // Always run detached
172
+ if (!hasDetached) {
173
+ args.push('-d');
174
+ }
175
+ // Add container name if not present
176
+ if (!hasName) {
177
+ args.push('--name', this.containerName);
178
+ }
179
+ // Add environment variables
180
+ for (const [key, value] of Object.entries(envVars)) {
181
+ args.push('-e', `${key}=${value}`);
182
+ }
183
+ // Add all parsed args
184
+ args.push(...parsedArgs);
185
+ return args;
186
+ }
187
+ async start(options) {
188
+ const { command, cwd, env } = options;
189
+ // Check Docker is available
190
+ if (!dockerChecked) {
191
+ ensureDockerAvailable();
192
+ dockerChecked = true;
193
+ }
194
+ this.command = command;
195
+ this.cwd = cwd;
196
+ this.env = env ?? {};
197
+ await debugLog('DockerRunner', `Starting: ${command}`);
198
+ // Remove any existing container with same name
199
+ try {
200
+ this.execDocker(['rm', '-f', this.containerName]);
201
+ }
202
+ catch {
203
+ // Container didn't exist, that's fine
204
+ }
205
+ // Build docker run arguments
206
+ const dockerArgs = this.buildDockerRunArgs(command, this.env);
207
+ await debugLog('DockerRunner', `Docker args: ${JSON.stringify(dockerArgs)}`);
208
+ // Execute docker run with spawn (not shell) to prevent injection
209
+ const result = spawnSync('docker', dockerArgs, {
210
+ cwd,
211
+ encoding: 'utf-8',
212
+ timeout: 60000,
213
+ stdio: ['pipe', 'pipe', 'pipe'],
214
+ });
215
+ if (result.error) {
216
+ throw new Error(`Failed to start container: ${result.error.message}`);
217
+ }
218
+ if (result.status !== 0) {
219
+ const stderr = result.stderr?.toString() || '';
220
+ const stdout = result.stdout?.toString() || '';
221
+ throw new Error(`Failed to start container: ${stderr || stdout}`);
222
+ }
223
+ // Get short container ID (first 12 chars)
224
+ const containerId = (result.stdout || '').trim();
225
+ this.containerId = containerId.substring(0, 12);
226
+ this.startedAt = new Date();
227
+ await debugLog('DockerRunner', `Started container: ${this.containerId}`);
228
+ // Try to detect port immediately
229
+ await this.detectPort();
230
+ return {
231
+ pid: -1, // Docker doesn't use PIDs the same way
232
+ containerId: this.containerId,
233
+ port: this.port ?? undefined,
234
+ };
235
+ }
236
+ async stop(options) {
237
+ const timeout = Math.floor((options?.timeout ?? 10000) / 1000); // Convert to seconds
238
+ if (!this.containerId && !this.containerName) {
239
+ return;
240
+ }
241
+ const target = this.containerId || this.containerName;
242
+ await debugLog('DockerRunner', `Stopping container: ${target}`);
243
+ try {
244
+ // Docker stop with timeout
245
+ this.execDocker(['stop', '-t', timeout.toString(), target]);
246
+ await debugLog('DockerRunner', `Stopped container: ${target}`);
247
+ }
248
+ catch (err) {
249
+ await debugLog('DockerRunner', `Stop failed, trying kill: ${err}`);
250
+ try {
251
+ this.execDocker(['kill', target]);
252
+ }
253
+ catch {
254
+ // Already dead
255
+ }
256
+ }
257
+ // Remove the container
258
+ try {
259
+ this.execDocker(['rm', '-f', target]);
260
+ await debugLog('DockerRunner', `Removed container: ${target}`);
261
+ }
262
+ catch {
263
+ // Ignore removal errors
264
+ }
265
+ this.containerId = null;
266
+ }
267
+ async isRunning() {
268
+ if (!this.containerId && !this.containerName) {
269
+ return false;
270
+ }
271
+ const target = this.containerId || this.containerName;
272
+ try {
273
+ const output = this.execDocker(['inspect', '-f', '{{.State.Running}}', target]);
274
+ return output === 'true';
275
+ }
276
+ catch {
277
+ return false;
278
+ }
279
+ }
280
+ async getStatus() {
281
+ const running = await this.isRunning();
282
+ const target = this.containerId || this.containerName;
283
+ let details = {};
284
+ if (target && running) {
285
+ try {
286
+ const output = this.execDocker([
287
+ 'inspect',
288
+ '-f',
289
+ '{{.State.Status}}|{{.State.StartedAt}}|{{.RestartCount}}',
290
+ target,
291
+ ]);
292
+ const [status, startedAt, restartCount] = output.split('|');
293
+ details = { status, startedAt, restartCount: parseInt(restartCount, 10) };
294
+ }
295
+ catch {
296
+ // Ignore
297
+ }
298
+ }
299
+ return {
300
+ running,
301
+ pid: -1,
302
+ containerId: this.containerId ?? undefined,
303
+ port: this.port ?? undefined,
304
+ startedAt: this.startedAt ?? undefined,
305
+ details,
306
+ };
307
+ }
308
+ async getLogs(options) {
309
+ const { type = 'all', lines } = options ?? {};
310
+ if (!this.containerId && !this.containerName) {
311
+ return [];
312
+ }
313
+ const target = this.containerId || this.containerName;
314
+ const args = ['logs'];
315
+ // Add timestamps for delta tracking
316
+ args.push('--timestamps');
317
+ if (lines !== undefined) {
318
+ args.push('--tail', lines.toString());
319
+ }
320
+ else if (this.lastLogTimestamp) {
321
+ // Get logs since last check
322
+ args.push('--since', this.lastLogTimestamp);
323
+ }
324
+ args.push(target);
325
+ try {
326
+ // LIMITATION: Docker CLI's 'logs' command returns both stdout and stderr interleaved
327
+ // in chronological order. There's no reliable way to separate them without running
328
+ // two separate processes or using the Docker API directly. The 'type' filter parameter
329
+ // is ignored for Docker containers - all logs are returned regardless of type.
330
+ // This is a known Docker CLI limitation.
331
+ const output = this.execDocker(args);
332
+ const logLines = output.split('\n').filter(l => l.length > 0);
333
+ // Update timestamp for delta mode
334
+ if (lines === undefined && logLines.length > 0) {
335
+ // Extract timestamp from last line (format: 2024-01-01T12:00:00.000000000Z message)
336
+ const lastLine = logLines[logLines.length - 1];
337
+ const match = lastLine.match(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})/);
338
+ if (match) {
339
+ this.lastLogTimestamp = match[1];
340
+ }
341
+ }
342
+ return logLines;
343
+ }
344
+ catch {
345
+ return [];
346
+ }
347
+ }
348
+ async detectPort() {
349
+ if (this.port)
350
+ return this.port;
351
+ if (!this.containerId && !this.containerName) {
352
+ return null;
353
+ }
354
+ const target = this.containerId || this.containerName;
355
+ try {
356
+ // Get port mappings from container
357
+ const output = this.execDocker(['port', target]);
358
+ // Parse output like "8080/tcp -> 0.0.0.0:3000"
359
+ for (const line of output.split('\n')) {
360
+ const match = line.match(/-> (?:0\.0\.0\.0|127\.0\.0\.1|localhost):(\d+)/);
361
+ if (match) {
362
+ this.port = parseInt(match[1], 10);
363
+ await debugLog('DockerRunner', `Detected port ${this.port} for ${this.id}`);
364
+ return this.port;
365
+ }
366
+ }
367
+ }
368
+ catch {
369
+ // No port mappings
370
+ }
371
+ // Also try docker inspect for exposed ports
372
+ try {
373
+ const output = this.execDocker([
374
+ 'inspect',
375
+ '-f',
376
+ '{{range $p, $conf := .NetworkSettings.Ports}}{{$p}}={{(index $conf 0).HostPort}} {{end}}',
377
+ target,
378
+ ]);
379
+ const match = output.match(/=(\d+)/);
380
+ if (match) {
381
+ this.port = parseInt(match[1], 10);
382
+ return this.port;
383
+ }
384
+ }
385
+ catch {
386
+ // Ignore
387
+ }
388
+ return null;
389
+ }
390
+ async cleanup() {
391
+ // Nothing special to clean up
392
+ }
393
+ /** Getters for state persistence */
394
+ getId() { return this.id; }
395
+ getCommand() { return this.command; }
396
+ getCwd() { return this.cwd; }
397
+ getPid() { return -1; }
398
+ getContainerId() { return this.containerId; }
399
+ getPort() { return this.port; }
400
+ getStartedAt() { return this.startedAt; }
401
+ /** Setters */
402
+ setPort(port) { this.port = port; }
403
+ /**
404
+ * Get log access info
405
+ */
406
+ getLogAccess() {
407
+ const target = this.containerId || this.containerName || this.id;
408
+ return {
409
+ type: 'command',
410
+ command: `docker logs ${target}`,
411
+ };
412
+ }
413
+ }
414
+ //# sourceMappingURL=docker-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docker-runner.js","sourceRoot":"","sources":["../../src/runners/docker-runner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAY,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAY9C;;;GAGG;AACH,SAAS,qBAAqB;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,qBAAqB,CAAC,EAAE;YACjF,QAAQ,EAAE,OAAO;YACjB,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;SAChC,CAAC,CAAC;QACH,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YAC/C,sDAAsD;YACtD,aAAa,GAAG,KAAK,CAAC;YAEtB,IAAI,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,8BAA8B,CAAC,EAAE,CAAC;gBACzF,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;YACtF,CAAC;YACD,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC3D,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;YAChF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AC,QAAQ,CAAC,CAAC;YACrC,IAAI,KAAK,EAAE,CAAC;gBACV,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACnC,OAAO,IAAI,CAAC,IAAI,CAAC;YACnB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,OAAO;QACX,8BAA8B;IAChC,CAAC;IAED,oCAAoC;IACpC,KAAK,KAAa,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,UAAU,KAAa,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAC7C,MAAM,KAAa,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,MAAM,KAAa,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,cAAc,KAAoB,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5D,OAAO,KAAoB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,YAAY,KAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAEtD,cAAc;IACd,OAAO,CAAC,IAAY,IAAU,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;IAEjD;;OAEG;IACH,YAAY;QACV,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,EAAE,CAAC;QACjE,OAAO;YACL,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,eAAe,MAAM,EAAE;SACjC,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Runners Index
3
+ * Export all runner types and factory function
4
+ */
5
+ export * from './types.js';
6
+ export { NativeRunner } from './native-runner.js';
7
+ export { DockerRunner, resetDockerCheck } from './docker-runner.js';
8
+ export { DockerComposeRunner, resetComposeCheck } from './docker-compose-runner.js';
9
+ import type { Runner, RunnerType } from './types.js';
10
+ /**
11
+ * Create a runner instance based on type
12
+ */
13
+ export declare function createRunner(type: RunnerType, id: string): Runner;
14
+ /**
15
+ * Reset Docker availability caches.
16
+ * Called before autoRun to ensure Docker is checked fresh each time.
17
+ */
18
+ export declare function resetDockerCaches(): void;
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runners/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpF,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAKrD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAWjE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAGxC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Runners Index
3
+ * Export all runner types and factory function
4
+ */
5
+ export * from './types.js';
6
+ export { NativeRunner } from './native-runner.js';
7
+ export { DockerRunner, resetDockerCheck } from './docker-runner.js';
8
+ export { DockerComposeRunner, resetComposeCheck } from './docker-compose-runner.js';
9
+ import { NativeRunner } from './native-runner.js';
10
+ import { DockerRunner, resetDockerCheck } from './docker-runner.js';
11
+ import { DockerComposeRunner, resetComposeCheck } from './docker-compose-runner.js';
12
+ /**
13
+ * Create a runner instance based on type
14
+ */
15
+ export function createRunner(type, id) {
16
+ switch (type) {
17
+ case 'native':
18
+ return new NativeRunner(id);
19
+ case 'docker':
20
+ return new DockerRunner(id);
21
+ case 'docker-compose':
22
+ return new DockerComposeRunner(id);
23
+ default:
24
+ throw new Error(`Unknown runner type: ${type}`);
25
+ }
26
+ }
27
+ /**
28
+ * Reset Docker availability caches.
29
+ * Called before autoRun to ensure Docker is checked fresh each time.
30
+ */
31
+ export function resetDockerCaches() {
32
+ resetDockerCheck();
33
+ resetComposeCheck();
34
+ }
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runners/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAGpF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpF;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAAgB,EAAE,EAAU;IACvD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC;QAC9B,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC;QAC9B,KAAK,gBAAgB;YACnB,OAAO,IAAI,mBAAmB,CAAC,EAAE,CAAC,CAAC;QACrC;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC/B,gBAAgB,EAAE,CAAC;IACnB,iBAAiB,EAAE,CAAC;AACtB,CAAC"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Native Runner
3
+ * Runs processes directly using Node.js spawn (the original behavior)
4
+ */
5
+ import type { Runner, RunnerType, RunnerStartOptions, RunnerStartResult, RunnerStopOptions, RunnerLogOptions, RunnerStatus, PersistedRunnerState } from './types.js';
6
+ export declare class NativeRunner implements Runner {
7
+ readonly type: RunnerType;
8
+ private id;
9
+ private command;
10
+ private cwd;
11
+ private process;
12
+ private pid;
13
+ private port;
14
+ private startedAt;
15
+ /** OS-reported start time of `pid`, to detect a recycled pid. */
16
+ private pidStartedAt;
17
+ private logCursor;
18
+ private global;
19
+ constructor(id: string);
20
+ /**
21
+ * Set whether this runner uses global storage
22
+ */
23
+ setGlobal(global: boolean): void;
24
+ /**
25
+ * Restore state from persisted data (for recovery)
26
+ */
27
+ restore(data: PersistedRunnerState): void;
28
+ private getLogDir;
29
+ private getStdoutLogPath;
30
+ private getStderrLogPath;
31
+ private ensureLogDir;
32
+ /**
33
+ * PROCESS IDENTITY
34
+ *
35
+ * `kill(pid, 0)` only answers "is some process wearing this number", which
36
+ * is not the same question. A dev server that crashed leaves its pid behind
37
+ * in servers.json, and once the OS recycles that number the dead server
38
+ * reads as running: it gets recovered instead of restarted, autoRun never
39
+ * fires, and `server list` reports a corpse as live.
40
+ *
41
+ * So a pid recovered from disk is only trusted when the OS still reports the
42
+ * same start time for it. An unreadable start time on either side cannot
43
+ * disprove anything, so it counts as alive - the cost of being wrong that way
44
+ * is a server we decline to touch, rather than one we wrongly declare dead.
45
+ */
46
+ private isProcessRunning;
47
+ private detectPortFromLine;
48
+ start(options: RunnerStartOptions): Promise<RunnerStartResult>;
49
+ stop(options?: RunnerStopOptions): Promise<void>;
50
+ isRunning(): Promise<boolean>;
51
+ getStatus(): Promise<RunnerStatus>;
52
+ getLogs(options?: RunnerLogOptions): Promise<string[]>;
53
+ private countFileLines;
54
+ detectPort(): Promise<number | null>;
55
+ cleanup(): Promise<void>;
56
+ /**
57
+ * Initialize cursor to end of file (for recovered servers)
58
+ */
59
+ initializeCursorToEOF(): Promise<void>;
60
+ /**
61
+ * Clear log files
62
+ */
63
+ clearLogs(): Promise<{
64
+ logDir: string;
65
+ stdoutPath: string;
66
+ stderrPath: string;
67
+ }>;
68
+ /**
69
+ * Get log access info
70
+ */
71
+ getLogAccess(): {
72
+ type: 'file';
73
+ logDir: string;
74
+ stdoutPath: string;
75
+ stderrPath: string;
76
+ };
77
+ /**
78
+ * Get log stats for status line
79
+ */
80
+ getLogStats(): {
81
+ newStdout: number;
82
+ newStderr: number;
83
+ };
84
+ /** Getters for state persistence */
85
+ getId(): string;
86
+ getCommand(): string;
87
+ getCwd(): string;
88
+ getPid(): number;
89
+ getPidStartedAt(): string;
90
+ getPort(): number | null;
91
+ getStartedAt(): Date | null;
92
+ /** Setters for port (when detected externally) */
93
+ setPort(port: number): void;
94
+ }
95
+ //# sourceMappingURL=native-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-runner.d.ts","sourceRoot":"","sources":["../../src/runners/native-runner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,KAAK,EACV,MAAM,EACN,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACrB,MAAM,YAAY,CAAC;AAEpB,qBAAa,YAAa,YAAW,MAAM;IACzC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAY;IAErC,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,IAAI,CAAuB;IACnC,OAAO,CAAC,SAAS,CAAqB;IACtC,iEAAiE;IACjE,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,MAAM,CAAkB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