charness 3.7.0 → 3.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 (359) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/DEVELOPMENT.md +6 -2
  3. package/README.md +5 -5
  4. package/SETUP.md +16 -5
  5. package/agent-plugin/skills/charness-manager/SKILL.md +3 -3
  6. package/dist/adapters/openCodeAdapter.d.ts.map +1 -1
  7. package/dist/adapters/openCodeAdapter.js +2 -1
  8. package/dist/adapters/openCodeAdapter.js.map +1 -1
  9. package/dist/bot.d.ts.map +1 -1
  10. package/dist/bot.js +50 -9
  11. package/dist/bot.js.map +1 -1
  12. package/dist/cli.js +44 -1
  13. package/dist/cli.js.map +1 -1
  14. package/dist/configDirFile.d.ts +7 -3
  15. package/dist/configDirFile.d.ts.map +1 -1
  16. package/dist/configDirFile.js +12 -5
  17. package/dist/configDirFile.js.map +1 -1
  18. package/dist/connectors/telegram/commands/botCore.d.ts +5 -1
  19. package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
  20. package/dist/connectors/telegram/commands/runners.d.ts +52 -0
  21. package/dist/connectors/telegram/commands/runners.d.ts.map +1 -0
  22. package/dist/connectors/telegram/commands/runners.js +486 -0
  23. package/dist/connectors/telegram/commands/runners.js.map +1 -0
  24. package/dist/connectors/telegram/runnerPairingMessages.d.ts +27 -0
  25. package/dist/connectors/telegram/runnerPairingMessages.d.ts.map +1 -0
  26. package/dist/connectors/telegram/runnerPairingMessages.js +105 -0
  27. package/dist/connectors/telegram/runnerPairingMessages.js.map +1 -0
  28. package/dist/i18n/de.d.ts.map +1 -1
  29. package/dist/i18n/de.js +58 -0
  30. package/dist/i18n/de.js.map +1 -1
  31. package/dist/i18n/en.d.ts.map +1 -1
  32. package/dist/i18n/en.js +58 -0
  33. package/dist/i18n/en.js.map +1 -1
  34. package/dist/i18n/es.d.ts.map +1 -1
  35. package/dist/i18n/es.js +58 -0
  36. package/dist/i18n/es.js.map +1 -1
  37. package/dist/i18n/fr.d.ts.map +1 -1
  38. package/dist/i18n/fr.js +58 -0
  39. package/dist/i18n/fr.js.map +1 -1
  40. package/dist/i18n/hi.d.ts.map +1 -1
  41. package/dist/i18n/hi.js +58 -0
  42. package/dist/i18n/hi.js.map +1 -1
  43. package/dist/i18n/ja.d.ts.map +1 -1
  44. package/dist/i18n/ja.js +58 -0
  45. package/dist/i18n/ja.js.map +1 -1
  46. package/dist/i18n/ka.d.ts.map +1 -1
  47. package/dist/i18n/ka.js +58 -0
  48. package/dist/i18n/ka.js.map +1 -1
  49. package/dist/i18n/pt.d.ts.map +1 -1
  50. package/dist/i18n/pt.js +58 -0
  51. package/dist/i18n/pt.js.map +1 -1
  52. package/dist/i18n/ru.d.ts.map +1 -1
  53. package/dist/i18n/ru.js +58 -0
  54. package/dist/i18n/ru.js.map +1 -1
  55. package/dist/i18n/uk.d.ts.map +1 -1
  56. package/dist/i18n/uk.js +58 -0
  57. package/dist/i18n/uk.js.map +1 -1
  58. package/dist/i18n/uz.d.ts.map +1 -1
  59. package/dist/i18n/uz.js +58 -0
  60. package/dist/i18n/uz.js.map +1 -1
  61. package/dist/i18n/zh.d.ts.map +1 -1
  62. package/dist/i18n/zh.js +58 -0
  63. package/dist/i18n/zh.js.map +1 -1
  64. package/dist/installManager.d.ts +57 -1
  65. package/dist/installManager.d.ts.map +1 -1
  66. package/dist/installManager.js +88 -10
  67. package/dist/installManager.js.map +1 -1
  68. package/dist/instanceSettings.d.ts +12 -2
  69. package/dist/instanceSettings.d.ts.map +1 -1
  70. package/dist/instanceSettings.js +17 -3
  71. package/dist/instanceSettings.js.map +1 -1
  72. package/dist/outputTrace.d.ts +6 -0
  73. package/dist/outputTrace.d.ts.map +1 -1
  74. package/dist/outputTrace.js +24 -1
  75. package/dist/outputTrace.js.map +1 -1
  76. package/dist/remoteRun/cliArgs.d.ts +2 -0
  77. package/dist/remoteRun/cliArgs.d.ts.map +1 -1
  78. package/dist/remoteRun/cliArgs.js +11 -2
  79. package/dist/remoteRun/cliArgs.js.map +1 -1
  80. package/dist/remoteRun/commands.d.ts +21 -0
  81. package/dist/remoteRun/commands.d.ts.map +1 -1
  82. package/dist/remoteRun/commands.js +38 -17
  83. package/dist/remoteRun/commands.js.map +1 -1
  84. package/dist/remoteRun/interrupts.d.ts +10 -0
  85. package/dist/remoteRun/interrupts.d.ts.map +1 -1
  86. package/dist/remoteRun/interrupts.js +43 -6
  87. package/dist/remoteRun/interrupts.js.map +1 -1
  88. package/dist/remoteRun/output.d.ts +2 -0
  89. package/dist/remoteRun/output.d.ts.map +1 -1
  90. package/dist/remoteRun/output.js +45 -0
  91. package/dist/remoteRun/output.js.map +1 -1
  92. package/dist/remoteRun/pairedRunners.d.ts +51 -0
  93. package/dist/remoteRun/pairedRunners.d.ts.map +1 -0
  94. package/dist/remoteRun/pairedRunners.js +165 -0
  95. package/dist/remoteRun/pairedRunners.js.map +1 -0
  96. package/dist/remoteRun/probe.d.ts +23 -1
  97. package/dist/remoteRun/probe.d.ts.map +1 -1
  98. package/dist/remoteRun/probe.js +45 -11
  99. package/dist/remoteRun/probe.js.map +1 -1
  100. package/dist/remoteRun/remoteRunCli.d.ts +13 -6
  101. package/dist/remoteRun/remoteRunCli.d.ts.map +1 -1
  102. package/dist/remoteRun/remoteRunCli.js +34 -59
  103. package/dist/remoteRun/remoteRunCli.js.map +1 -1
  104. package/dist/remoteRun/runnerClient.d.ts +2 -0
  105. package/dist/remoteRun/runnerClient.d.ts.map +1 -1
  106. package/dist/remoteRun/runnerClient.js +5 -1
  107. package/dist/remoteRun/runnerClient.js.map +1 -1
  108. package/dist/remoteRun/runnerSummary.d.ts +24 -0
  109. package/dist/remoteRun/runnerSummary.d.ts.map +1 -0
  110. package/dist/remoteRun/runnerSummary.js +86 -0
  111. package/dist/remoteRun/runnerSummary.js.map +1 -0
  112. package/dist/remoteRun/runnerWait.d.ts +68 -0
  113. package/dist/remoteRun/runnerWait.d.ts.map +1 -0
  114. package/dist/remoteRun/runnerWait.js +137 -0
  115. package/dist/remoteRun/runnerWait.js.map +1 -0
  116. package/dist/remoteRun/runnerWaitTiming.d.ts +16 -0
  117. package/dist/remoteRun/runnerWaitTiming.d.ts.map +1 -0
  118. package/dist/remoteRun/runnerWaitTiming.js +37 -0
  119. package/dist/remoteRun/runnerWaitTiming.js.map +1 -0
  120. package/dist/remoteRun/runners.d.ts +7 -7
  121. package/dist/remoteRun/runners.d.ts.map +1 -1
  122. package/dist/remoteRun/runners.js +45 -17
  123. package/dist/remoteRun/runners.js.map +1 -1
  124. package/dist/remoteRun/runnersCatalog.d.ts +14 -0
  125. package/dist/remoteRun/runnersCatalog.d.ts.map +1 -0
  126. package/dist/remoteRun/runnersCatalog.js +68 -0
  127. package/dist/remoteRun/runnersCatalog.js.map +1 -0
  128. package/dist/remoteRun/runnersConfig.d.ts +29 -20
  129. package/dist/remoteRun/runnersConfig.d.ts.map +1 -1
  130. package/dist/remoteRun/runnersConfig.js +14 -12
  131. package/dist/remoteRun/runnersConfig.js.map +1 -1
  132. package/dist/remoteRun/ssh.d.ts +22 -2
  133. package/dist/remoteRun/ssh.d.ts.map +1 -1
  134. package/dist/remoteRun/ssh.js +41 -7
  135. package/dist/remoteRun/ssh.js.map +1 -1
  136. package/dist/runnerUtility/adminCheck.d.ts +11 -0
  137. package/dist/runnerUtility/adminCheck.d.ts.map +1 -0
  138. package/dist/runnerUtility/adminCheck.js +68 -0
  139. package/dist/runnerUtility/adminCheck.js.map +1 -0
  140. package/dist/runnerUtility/appInstall.d.ts +25 -0
  141. package/dist/runnerUtility/appInstall.d.ts.map +1 -0
  142. package/dist/runnerUtility/appInstall.js +147 -0
  143. package/dist/runnerUtility/appInstall.js.map +1 -0
  144. package/dist/runnerUtility/appUpdate.d.ts +39 -0
  145. package/dist/runnerUtility/appUpdate.d.ts.map +1 -0
  146. package/dist/runnerUtility/appUpdate.js +90 -0
  147. package/dist/runnerUtility/appUpdate.js.map +1 -0
  148. package/dist/runnerUtility/execEnv.d.ts +21 -0
  149. package/dist/runnerUtility/execEnv.d.ts.map +1 -0
  150. package/dist/runnerUtility/execEnv.js +109 -0
  151. package/dist/runnerUtility/execEnv.js.map +1 -0
  152. package/dist/runnerUtility/execSession.d.ts +13 -0
  153. package/dist/runnerUtility/execSession.d.ts.map +1 -0
  154. package/dist/runnerUtility/execSession.js +58 -0
  155. package/dist/runnerUtility/execSession.js.map +1 -0
  156. package/dist/runnerUtility/hubClient.d.ts +30 -0
  157. package/dist/runnerUtility/hubClient.d.ts.map +1 -0
  158. package/dist/runnerUtility/hubClient.js +127 -0
  159. package/dist/runnerUtility/hubClient.js.map +1 -0
  160. package/dist/runnerUtility/injectStream.d.ts +9 -0
  161. package/dist/runnerUtility/injectStream.d.ts.map +1 -0
  162. package/dist/runnerUtility/injectStream.js +12 -0
  163. package/dist/runnerUtility/injectStream.js.map +1 -0
  164. package/dist/runnerUtility/iosCheck.d.ts +62 -0
  165. package/dist/runnerUtility/iosCheck.d.ts.map +1 -0
  166. package/dist/runnerUtility/iosCheck.js +200 -0
  167. package/dist/runnerUtility/iosCheck.js.map +1 -0
  168. package/dist/runnerUtility/launcher.d.ts +5 -0
  169. package/dist/runnerUtility/launcher.d.ts.map +1 -0
  170. package/dist/runnerUtility/launcher.js +85 -0
  171. package/dist/runnerUtility/launcher.js.map +1 -0
  172. package/dist/runnerUtility/linkLoop.d.ts +47 -0
  173. package/dist/runnerUtility/linkLoop.d.ts.map +1 -0
  174. package/dist/runnerUtility/linkLoop.js +281 -0
  175. package/dist/runnerUtility/linkLoop.js.map +1 -0
  176. package/dist/runnerUtility/localLinkStop.d.ts +23 -0
  177. package/dist/runnerUtility/localLinkStop.d.ts.map +1 -0
  178. package/dist/runnerUtility/localLinkStop.js +79 -0
  179. package/dist/runnerUtility/localLinkStop.js.map +1 -0
  180. package/dist/runnerUtility/machineReport.d.ts +39 -0
  181. package/dist/runnerUtility/machineReport.d.ts.map +1 -0
  182. package/dist/runnerUtility/machineReport.js +161 -0
  183. package/dist/runnerUtility/machineReport.js.map +1 -0
  184. package/dist/runnerUtility/packageId.d.ts +5 -0
  185. package/dist/runnerUtility/packageId.d.ts.map +1 -0
  186. package/dist/runnerUtility/packageId.js +64 -0
  187. package/dist/runnerUtility/packageId.js.map +1 -0
  188. package/dist/runnerUtility/pairingRecovery.d.ts +31 -0
  189. package/dist/runnerUtility/pairingRecovery.d.ts.map +1 -0
  190. package/dist/runnerUtility/pairingRecovery.js +24 -0
  191. package/dist/runnerUtility/pairingRecovery.js.map +1 -0
  192. package/dist/runnerUtility/pueueDaemon.d.ts +36 -0
  193. package/dist/runnerUtility/pueueDaemon.d.ts.map +1 -0
  194. package/dist/runnerUtility/pueueDaemon.js +165 -0
  195. package/dist/runnerUtility/pueueDaemon.js.map +1 -0
  196. package/dist/runnerUtility/runnerCli.d.ts +18 -0
  197. package/dist/runnerUtility/runnerCli.d.ts.map +1 -0
  198. package/dist/runnerUtility/runnerCli.js +184 -0
  199. package/dist/runnerUtility/runnerCli.js.map +1 -0
  200. package/dist/runnerUtility/runnerCommands.d.ts +67 -0
  201. package/dist/runnerUtility/runnerCommands.d.ts.map +1 -0
  202. package/dist/runnerUtility/runnerCommands.js +418 -0
  203. package/dist/runnerUtility/runnerCommands.js.map +1 -0
  204. package/dist/runnerUtility/runnerConfig.d.ts +63 -0
  205. package/dist/runnerUtility/runnerConfig.d.ts.map +1 -0
  206. package/dist/runnerUtility/runnerConfig.js +153 -0
  207. package/dist/runnerUtility/runnerConfig.js.map +1 -0
  208. package/dist/runnerUtility/runnerFlags.d.ts +9 -0
  209. package/dist/runnerUtility/runnerFlags.d.ts.map +1 -0
  210. package/dist/runnerUtility/runnerFlags.js +53 -0
  211. package/dist/runnerUtility/runnerFlags.js.map +1 -0
  212. package/dist/runnerUtility/runnerHome.d.ts +30 -0
  213. package/dist/runnerUtility/runnerHome.d.ts.map +1 -0
  214. package/dist/runnerUtility/runnerHome.js +82 -0
  215. package/dist/runnerUtility/runnerHome.js.map +1 -0
  216. package/dist/runnerUtility/runnerKeys.d.ts +11 -0
  217. package/dist/runnerUtility/runnerKeys.d.ts.map +1 -0
  218. package/dist/runnerUtility/runnerKeys.js +80 -0
  219. package/dist/runnerUtility/runnerKeys.js.map +1 -0
  220. package/dist/runnerUtility/runnerServers.d.ts +40 -0
  221. package/dist/runnerUtility/runnerServers.d.ts.map +1 -0
  222. package/dist/runnerUtility/runnerServers.js +79 -0
  223. package/dist/runnerUtility/runnerServers.js.map +1 -0
  224. package/dist/runnerUtility/serviceManager.d.ts +54 -0
  225. package/dist/runnerUtility/serviceManager.d.ts.map +1 -0
  226. package/dist/runnerUtility/serviceManager.js +413 -0
  227. package/dist/runnerUtility/serviceManager.js.map +1 -0
  228. package/dist/runnerUtility/serviceUnits.d.ts +36 -0
  229. package/dist/runnerUtility/serviceUnits.d.ts.map +1 -0
  230. package/dist/runnerUtility/serviceUnits.js +169 -0
  231. package/dist/runnerUtility/serviceUnits.js.map +1 -0
  232. package/dist/runnerUtility/toolInstall.d.ts +95 -0
  233. package/dist/runnerUtility/toolInstall.d.ts.map +1 -0
  234. package/dist/runnerUtility/toolInstall.js +232 -0
  235. package/dist/runnerUtility/toolInstall.js.map +1 -0
  236. package/dist/runnerUtility/versionPollTiming.d.ts +16 -0
  237. package/dist/runnerUtility/versionPollTiming.d.ts.map +1 -0
  238. package/dist/runnerUtility/versionPollTiming.js +36 -0
  239. package/dist/runnerUtility/versionPollTiming.js.map +1 -0
  240. package/dist/runners/authorizedKeys.d.ts +52 -0
  241. package/dist/runners/authorizedKeys.d.ts.map +1 -0
  242. package/dist/runners/authorizedKeys.js +153 -0
  243. package/dist/runners/authorizedKeys.js.map +1 -0
  244. package/dist/runners/bootstrapLine.d.ts +4 -0
  245. package/dist/runners/bootstrapLine.d.ts.map +1 -0
  246. package/dist/runners/bootstrapLine.js +69 -0
  247. package/dist/runners/bootstrapLine.js.map +1 -0
  248. package/dist/runners/gate.d.ts +41 -0
  249. package/dist/runners/gate.d.ts.map +1 -0
  250. package/dist/runners/gate.js +216 -0
  251. package/dist/runners/gate.js.map +1 -0
  252. package/dist/runners/gateLink.d.ts +26 -0
  253. package/dist/runners/gateLink.d.ts.map +1 -0
  254. package/dist/runners/gateLink.js +240 -0
  255. package/dist/runners/gateLink.js.map +1 -0
  256. package/dist/runners/gateProtocol.d.ts +98 -0
  257. package/dist/runners/gateProtocol.d.ts.map +1 -0
  258. package/dist/runners/gateProtocol.js +149 -0
  259. package/dist/runners/gateProtocol.js.map +1 -0
  260. package/dist/runners/gateWrapper.d.ts +6 -0
  261. package/dist/runners/gateWrapper.d.ts.map +1 -0
  262. package/dist/runners/gateWrapper.js +70 -0
  263. package/dist/runners/gateWrapper.js.map +1 -0
  264. package/dist/runners/hubAddress.d.ts +33 -0
  265. package/dist/runners/hubAddress.d.ts.map +1 -0
  266. package/dist/runners/hubAddress.js +88 -0
  267. package/dist/runners/hubAddress.js.map +1 -0
  268. package/dist/runners/hubAddressCandidates.d.ts +16 -0
  269. package/dist/runners/hubAddressCandidates.d.ts.map +1 -0
  270. package/dist/runners/hubAddressCandidates.js +96 -0
  271. package/dist/runners/hubAddressCandidates.js.map +1 -0
  272. package/dist/runners/hubIds.d.ts +16 -0
  273. package/dist/runners/hubIds.d.ts.map +1 -0
  274. package/dist/runners/hubIds.js +25 -0
  275. package/dist/runners/hubIds.js.map +1 -0
  276. package/dist/runners/hubKey.d.ts +6 -0
  277. package/dist/runners/hubKey.d.ts.map +1 -0
  278. package/dist/runners/hubKey.js +78 -0
  279. package/dist/runners/hubKey.js.map +1 -0
  280. package/dist/runners/hubLock.d.ts +7 -0
  281. package/dist/runners/hubLock.d.ts.map +1 -0
  282. package/dist/runners/hubLock.js +230 -0
  283. package/dist/runners/hubLock.js.map +1 -0
  284. package/dist/runners/hubPackage.d.ts +23 -0
  285. package/dist/runners/hubPackage.d.ts.map +1 -0
  286. package/dist/runners/hubPackage.js +184 -0
  287. package/dist/runners/hubPackage.js.map +1 -0
  288. package/dist/runners/hubPairing.d.ts +63 -0
  289. package/dist/runners/hubPairing.d.ts.map +1 -0
  290. package/dist/runners/hubPairing.js +261 -0
  291. package/dist/runners/hubPairing.js.map +1 -0
  292. package/dist/runners/hubPaths.d.ts +38 -0
  293. package/dist/runners/hubPaths.d.ts.map +1 -0
  294. package/dist/runners/hubPaths.js +94 -0
  295. package/dist/runners/hubPaths.js.map +1 -0
  296. package/dist/runners/hubRegistry.d.ts +112 -0
  297. package/dist/runners/hubRegistry.d.ts.map +1 -0
  298. package/dist/runners/hubRegistry.js +210 -0
  299. package/dist/runners/hubRegistry.js.map +1 -0
  300. package/dist/runners/linkControl.d.ts +27 -0
  301. package/dist/runners/linkControl.d.ts.map +1 -0
  302. package/dist/runners/linkControl.js +124 -0
  303. package/dist/runners/linkControl.js.map +1 -0
  304. package/dist/runners/pairCode.d.ts +30 -0
  305. package/dist/runners/pairCode.d.ts.map +1 -0
  306. package/dist/runners/pairCode.js +46 -0
  307. package/dist/runners/pairCode.js.map +1 -0
  308. package/dist/runners/pairingTiming.d.ts +18 -0
  309. package/dist/runners/pairingTiming.d.ts.map +1 -0
  310. package/dist/runners/pairingTiming.js +42 -0
  311. package/dist/runners/pairingTiming.js.map +1 -0
  312. package/dist/runners/runnerProxy.d.ts +9 -0
  313. package/dist/runners/runnerProxy.d.ts.map +1 -0
  314. package/dist/runners/runnerProxy.js +67 -0
  315. package/dist/runners/runnerProxy.js.map +1 -0
  316. package/dist/runners/runnerRemoval.d.ts +21 -0
  317. package/dist/runners/runnerRemoval.d.ts.map +1 -0
  318. package/dist/runners/runnerRemoval.js +82 -0
  319. package/dist/runners/runnerRemoval.js.map +1 -0
  320. package/dist/runners/runnersCli.d.ts +16 -0
  321. package/dist/runners/runnersCli.d.ts.map +1 -0
  322. package/dist/runners/runnersCli.js +214 -0
  323. package/dist/runners/runnersCli.js.map +1 -0
  324. package/dist/runners/runnersList.d.ts +17 -0
  325. package/dist/runners/runnersList.d.ts.map +1 -0
  326. package/dist/runners/runnersList.js +49 -0
  327. package/dist/runners/runnersList.js.map +1 -0
  328. package/dist/runners/runnersOverview.d.ts +20 -0
  329. package/dist/runners/runnersOverview.d.ts.map +1 -0
  330. package/dist/runners/runnersOverview.js +55 -0
  331. package/dist/runners/runnersOverview.js.map +1 -0
  332. package/dist/runners/sshKeys.d.ts +26 -0
  333. package/dist/runners/sshKeys.d.ts.map +1 -0
  334. package/dist/runners/sshKeys.js +60 -0
  335. package/dist/runners/sshKeys.js.map +1 -0
  336. package/dist/runners/tarArchive.d.ts +20 -0
  337. package/dist/runners/tarArchive.d.ts.map +1 -0
  338. package/dist/runners/tarArchive.js +70 -0
  339. package/dist/runners/tarArchive.js.map +1 -0
  340. package/dist/scheduler/mcpSurface.d.ts +11 -5
  341. package/dist/scheduler/mcpSurface.d.ts.map +1 -1
  342. package/dist/scheduler/mcpSurface.js +59 -26
  343. package/dist/scheduler/mcpSurface.js.map +1 -1
  344. package/dist/selfUpdate/selfCheck.js +2 -2
  345. package/dist/selfUpdate/selfCheck.js.map +1 -1
  346. package/dist/testTimings.d.ts +5 -2
  347. package/dist/testTimings.d.ts.map +1 -1
  348. package/dist/testTimings.js +10 -1
  349. package/dist/testTimings.js.map +1 -1
  350. package/dist/utils/agentEnvironment.d.ts +6 -2
  351. package/dist/utils/agentEnvironment.d.ts.map +1 -1
  352. package/dist/utils/agentEnvironment.js +13 -2
  353. package/dist/utils/agentEnvironment.js.map +1 -1
  354. package/dist/utils/runnersScreenPlan.d.ts +130 -0
  355. package/dist/utils/runnersScreenPlan.d.ts.map +1 -0
  356. package/dist/utils/runnersScreenPlan.js +257 -0
  357. package/dist/utils/runnersScreenPlan.js.map +1 -0
  358. package/package.json +5 -2
  359. package/remoteRun/runner.sh +81 -6
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.shortCallTimeoutMs = void 0;
36
+ exports.notConnectedReason = exports.shortCallTimeoutMs = void 0;
37
37
  exports.getRunnerScriptPath = getRunnerScriptPath;
38
38
  exports.readRunnerScript = readRunnerScript;
39
39
  exports.describeSshFailure = describeSshFailure;
@@ -62,6 +62,8 @@ function readRunnerScript(scriptPath = getRunnerScriptPath()) {
62
62
  const text = fs.readFileSync(scriptPath, 'utf8');
63
63
  return { name: `runner-${(0, crypto_1.createHash)('sha256').update(text).digest('hex').slice(0, scriptHashLength)}.sh`, text };
64
64
  }
65
+ /** Why a paired runner whose link is down is offline — the words `charness runner-proxy` (`runners/runnerProxy.ts`) puts on stderr when nothing listens on the link's socket. */
66
+ exports.notConnectedReason = 'the runner is not connected';
65
67
  /**
66
68
  * @description The first useful line of a failed ssh's stderr, for a message (never the whole text: it may quote the destination). A
67
69
  * rejected key from a process with no ssh-agent (`SSH_AUTH_SOCK` unset — a tracker agent such as Jira's starts with a minimal environment
@@ -70,6 +72,8 @@ function readRunnerScript(scriptPath = getRunnerScriptPath()) {
70
72
  function describeSshFailure(result, env = process.env) {
71
73
  if (result.isTimedOut)
72
74
  return 'ssh: the command ran past its deadline';
75
+ if (result.stderr.includes(exports.notConnectedReason))
76
+ return exports.notConnectedReason;
73
77
  const lines = result.stderr.split('\n').map((line) => line.trim()).filter((line) => line !== '');
74
78
  const text = lines.length === 0 ? `ssh exited with ${result.exitCode ?? 'a signal'}` : lines[lines.length - 1];
75
79
  if (/host key verification failed/i.test(result.stderr))
@@ -1 +1 @@
1
- {"version":3,"file":"runnerClient.js","sourceRoot":"","sources":["../../src/remoteRun/runnerClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,kDAEC;AAED,4CAGC;AA2BD,gDAYC;AAGD,sDAGC;AAGD,gDA8CC;AAxID,mCAAoC;AACpC,uCAAyB;AACzB,2CAA6B;AAC7B,qDAA0E;AAE1E,+BASe;AAEf;;;;;GAKG;AAEH,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,6FAA6F;AAChF,QAAA,kB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MAAM,CAAC,QAAQ,KAAK,CAAC;gBAAE,MAAM,IAAI,+BAAc,CAAC,uCAAuC,MAAM,CAAC,IAAI,MAAM,MAAM,CAAC,OAAO,WAAW,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACrK,CAAC;QACD,IAAI;QACJ,KAAK,CAAC,WAAW,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO;YACzC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YACrD,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;gBAC1B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACjI,MAAM,IAAI,+BAAc,CAAC,WAAW,MAAM,CAAC,IAAI,MAAM,UAAU,aAAa,MAAM,EAAE,CAAC,CAAC;YACxF,CAAC;YACD,OAAO,MAAM,CAAC,MAAM,CAAC;QACvB,CAAC;QACD,MAAM,CAAC,UAAU,EAAE,IAAI;YACrB,OAAO,IAAA,oBAAc,EAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAA,8BAAwB,EAAC,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9I,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { type RunnerCapability, type RunnerProbe } from './probe';
2
+ import type { RunnerConfig } from './runnersConfig';
3
+ /** @description The OS text of a runner as a short plain label: letters, digits and a few signs; no line break, no markup, 40 characters at most. */
4
+ export declare function sanitizeOsLabel(reportedOs: string): string;
5
+ /** @name RunnerSummary @description What the instructions say of one runner. */
6
+ export interface RunnerSummary {
7
+ name: string;
8
+ osLabel: string;
9
+ /** The capabilities it had when last probed, in the order `--needs` lists them. */
10
+ capabilities: RunnerCapability[];
11
+ /** Paused from the hub, or on the runner itself when last seen: not used for new jobs. */
12
+ isPaused: boolean;
13
+ }
14
+ /** @description The summary of `runner`; `probe` is its last snapshot, if it has one. */
15
+ export declare function summarizeRunner(runner: RunnerConfig, probe: RunnerProbe | null): RunnerSummary;
16
+ /** @description `mac — macOS 15.1, android, playwright`; `box1 (paused) — Ubuntu 24.04`; just the name when nothing else is known. */
17
+ export declare function formatRunnerSummaryLine(summary: RunnerSummary): string;
18
+ /**
19
+ * @description The lines for the instructions of a session that connects now: one per runner of the catalog (hand-made first, then paired; a
20
+ * catalog with an error still gives the runners that last loaded). Empty = no runner, and remote-run is not mentioned. The snapshots are
21
+ * read from the cache `env` names — the bot's own, which the agents share (`XDG_CACHE_HOME` is on the tracker agents' allowlist).
22
+ */
23
+ export declare function getRunnerSummaryLines(homeDir?: string, env?: NodeJS.ProcessEnv): string[];
24
+ //# sourceMappingURL=runnerSummary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnerSummary.d.ts","sourceRoot":"","sources":["../../src/remoteRun/runnerSummary.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAiBpD,qJAAqJ;AACrJ,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,gFAAgF;AAChF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,0FAA0F;IAC1F,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,yFAAyF;AACzF,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,GAAG,aAAa,CAQ9F;AAED,sIAAsI;AACtI,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAGtE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,MAAqB,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,EAAE,CAIpH"}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.sanitizeOsLabel = sanitizeOsLabel;
37
+ exports.summarizeRunner = summarizeRunner;
38
+ exports.formatRunnerSummaryLine = formatRunnerSummaryLine;
39
+ exports.getRunnerSummaryLines = getRunnerSummaryLines;
40
+ const os = __importStar(require("os"));
41
+ const probe_1 = require("./probe");
42
+ const runners_1 = require("./runners");
43
+ const runnersCatalog_1 = require("./runnersCatalog");
44
+ const ssh_1 = require("./ssh");
45
+ /**
46
+ * @description The one line per runner that the bot MCP's instructions give an agent — `mac — macOS 15.1, android, playwright`: the name, the
47
+ * OS and what the runner could do when it was last probed (`remote-run`'s own snapshot, so a runner nobody has probed yet shows only its name
48
+ * and the OS it reported at pairing). It is a hint for choosing `--needs`, read once per connect; the live state — online, load, jobs — stays
49
+ * in `charness remote-run runners`, which the bullet tells the agent to look at first.
50
+ *
51
+ * What a runner machine reported (its OS name) goes into an agent's instructions, so it is reduced to a short plain label here: a runner is
52
+ * code the operator attached, not a voice the agent should obey.
53
+ */
54
+ const maxOsLabelLength = 40;
55
+ /** `/` stays: `/etc/os-release` names are «Debian GNU/Linux 12»; a slash cannot start a line, a bullet or markup. */
56
+ const unsafeLabelCharacters = /[^A-Za-z0-9 ._+()/-]/g;
57
+ /** @description The OS text of a runner as a short plain label: letters, digits and a few signs; no line break, no markup, 40 characters at most. */
58
+ function sanitizeOsLabel(reportedOs) {
59
+ return reportedOs.replace(unsafeLabelCharacters, '').replace(/\s+/g, ' ').trim().slice(0, maxOsLabelLength).trim();
60
+ }
61
+ /** @description The summary of `runner`; `probe` is its last snapshot, if it has one. */
62
+ function summarizeRunner(runner, probe) {
63
+ const probedOs = probe === null ? '' : [probe.osName, probe.osVersion].filter((part) => part !== '').join(' ');
64
+ return {
65
+ name: runner.name,
66
+ osLabel: sanitizeOsLabel(probedOs !== '' ? probedOs : (runner.paired?.os ?? '')),
67
+ capabilities: probe === null ? [] : probe_1.runnerCapabilities.filter((capability) => probe.capabilities[capability].isAvailable),
68
+ isPaused: runner.paired?.isPausedByHub === true || probe?.isPaused === true,
69
+ };
70
+ }
71
+ /** @description `mac — macOS 15.1, android, playwright`; `box1 (paused) — Ubuntu 24.04`; just the name when nothing else is known. */
72
+ function formatRunnerSummaryLine(summary) {
73
+ const details = [...(summary.osLabel === '' ? [] : [summary.osLabel]), ...summary.capabilities];
74
+ return `${summary.name}${summary.isPaused ? ' (paused)' : ''}${details.length === 0 ? '' : ` — ${details.join(', ')}`}`;
75
+ }
76
+ /**
77
+ * @description The lines for the instructions of a session that connects now: one per runner of the catalog (hand-made first, then paired; a
78
+ * catalog with an error still gives the runners that last loaded). Empty = no runner, and remote-run is not mentioned. The snapshots are
79
+ * read from the cache `env` names — the bot's own, which the agents share (`XDG_CACHE_HOME` is on the tracker agents' allowlist).
80
+ */
81
+ function getRunnerSummaryLines(homeDir = os.homedir(), env = process.env) {
82
+ const runners = (0, runnersCatalog_1.loadRunnersCatalog)(homeDir).config?.runners ?? [];
83
+ const cacheDir = (0, ssh_1.getRemoteRunCacheDir)(env, homeDir);
84
+ return runners.map((runner) => formatRunnerSummaryLine(summarizeRunner(runner, (0, runners_1.readLastProbe)(cacheDir, runner.name)?.probe ?? null)));
85
+ }
86
+ //# sourceMappingURL=runnerSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnerSummary.js","sourceRoot":"","sources":["../../src/remoteRun/runnerSummary.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,0CAEC;AAaD,0CAQC;AAGD,0DAGC;AAOD,sDAIC;AA9DD,uCAAyB;AACzB,mCAAsF;AACtF,uCAA0C;AAC1C,qDAAsD;AAEtD,+BAA6C;AAE7C;;;;;;;;GAQG;AAEH,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,qHAAqH;AACrH,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAEtD,qJAAqJ;AACrJ,SAAgB,eAAe,CAAC,UAAkB;IAChD,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OAAO,CAAC,YAAY,CAAC,CAAC;IAChG,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;AAC1H,CAAC;AAED;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,UAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,MAAyB,OAAO,CAAC,GAAG;IACxG,MAAM,OAAO,GAAG,IAAA,mCAAkB,EAAC,OAAO,CAAC,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE,CAAC;IAClE,MAAM,QAAQ,GAAG,IAAA,0BAAoB,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACpD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,uBAAuB,CAAC,eAAe,CAAC,MAAM,EAAE,IAAA,uBAAa,EAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AACxI,CAAC"}
@@ -0,0 +1,68 @@
1
+ import { type InterruptSignal } from './exitCodes';
2
+ import { type RunnerCapability, type RunnerReport } from './probe';
3
+ import type { RunnerPick } from './runners';
4
+ import type { RunnersConfig } from './runnersConfig';
5
+ /** @name RunnerWaitPlan @description What a failed pick is worth waiting for. */
6
+ export interface RunnerWaitPlan {
7
+ /** The offline paired runners that, when they were last seen, could do the job. */
8
+ runnerNames: string[];
9
+ /** «mac offline since 2026-11-01 14:02 UTC», for the line that says the command is waiting. */
10
+ description: string;
11
+ }
12
+ /**
13
+ * @description Is there an offline PAIRED runner worth waiting for? Only when a capability is needed and no runner is named: a runner is
14
+ * worth it when its last snapshot had the capability and Pueue and nobody paused it (a paused one would be skipped when it came back).
15
+ * `null` = fail now.
16
+ */
17
+ export declare function planRunnerWait(config: RunnersConfig, reports: readonly RunnerReport[], wanted: {
18
+ runner: string | null;
19
+ needs: RunnerCapability | null;
20
+ }): RunnerWaitPlan | null;
21
+ /** @description `15 min`, `90 s`, `2 h`, `1 h 30 min`: a wait in the words a person would use. */
22
+ export declare function formatWaitDuration(totalSeconds: number): string;
23
+ /** The least an attempt made DURING the wait is worth: a probe through ssh cannot answer in less, so with less left the wait is over. */
24
+ export declare const minWaitAttemptMs = 1000;
25
+ /** One try at choosing a runner: the choice, or why there is none and whether it is worth waiting. */
26
+ export type RunnerAttempt<TChoice> = {
27
+ ok: true;
28
+ choice: TChoice;
29
+ } | {
30
+ ok: false;
31
+ failure: Extract<RunnerPick, {
32
+ ok: false;
33
+ }>;
34
+ wait: RunnerWaitPlan | null;
35
+ };
36
+ export interface RunnerWaitLoop<TChoice> {
37
+ /**
38
+ * Probe and pick once. `budgetMs` is what is left of the wait once it has begun (the probe must end within it), `null` for the first attempt.
39
+ * `stop` aborts when the user interrupts: the attempt ends what it started (its ssh calls) at once, and whatever it returns after that is not used.
40
+ */
41
+ attempt: (budgetMs: number | null, stop: AbortSignal) => Promise<RunnerAttempt<TChoice>>;
42
+ needs: RunnerCapability | null;
43
+ /** `--runner-wait` in seconds; `0` = never wait. */
44
+ waitSeconds: number;
45
+ pollMs: number;
46
+ now: () => number;
47
+ /** Resolves after `ms`, or at once when `stop` aborts. */
48
+ sleep: (ms: number, stop: AbortSignal) => Promise<void>;
49
+ /** Calls `onInterrupt` with the signal when the user interrupts (Ctrl-C, SIGTERM, SIGHUP), until the returned function is called. */
50
+ watchInterrupts: (onInterrupt: (signal: InterruptSignal) => void) => () => void;
51
+ say: (line: string) => void;
52
+ }
53
+ /**
54
+ * @description Choose a runner, waiting for an offline paired one when that is worth it: the choice as soon as an attempt gives one IN TIME;
55
+ * a {@link RemoteRunError} with the pick's own message (and, after waiting, how long it waited) when nothing can be waited for or the wait
56
+ * ran out; and, if the user interrupts, the interrupt's exit code (130 / 143 / 129).
57
+ *
58
+ * An interrupt is heard from the first attempt to the last, in a sleep AND in a probe: it aborts what is in flight, and after every await the
59
+ * loop looks at it first — a runner an attempt picked after the interrupt is not taken, and no other attempt starts.
60
+ *
61
+ * `--runner-wait` is a promise about when the command stops waiting, so once the wait has begun no attempt starts with less than
62
+ * {@link minWaitAttemptMs} left, every attempt is told the time it has (its probe is cut at it), and an answer that comes after the
63
+ * deadline is refused — the job is not started late. The last sleep is cut so that one more look still fits before the deadline.
64
+ */
65
+ export declare function chooseRunnerWithWait<TChoice>(loop: RunnerWaitLoop<TChoice>): Promise<TChoice>;
66
+ /** @description `sleep` for {@link chooseRunnerWithWait}: ends after `ms`, or at once when `stop` aborts; its timer never outlives the call. */
67
+ export declare function sleepUntilStopped(ms: number, stop: AbortSignal): Promise<void>;
68
+ //# sourceMappingURL=runnerWait.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnerWait.d.ts","sourceRoot":"","sources":["../../src/remoteRun/runnerWait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAA2D,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5H,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAcrD,iFAAiF;AACjF,MAAM,WAAW,cAAc;IAC7B,mFAAmF;IACnF,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,+FAA+F;IAC/F,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,YAAY,EAAE,EAAE,MAAM,EAAE;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,gBAA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AG,OAAO,CAAC,OAAO,CAAC,CA2CnG;AAED,gJAAgJ;AAChJ,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB9E"}
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.minWaitAttemptMs = void 0;
4
+ exports.planRunnerWait = planRunnerWait;
5
+ exports.formatWaitDuration = formatWaitDuration;
6
+ exports.chooseRunnerWithWait = chooseRunnerWithWait;
7
+ exports.sleepUntilStopped = sleepUntilStopped;
8
+ const exitCodes_1 = require("./exitCodes");
9
+ const probe_1 = require("./probe");
10
+ const remoteRunError_1 = require("./remoteRunError");
11
+ /**
12
+ * @description The wait of `charness remote-run --needs <capability>`: when the only runners that could take the job are PAIRED ones
13
+ * that are offline right now (a laptop that slept, a link that restarts), the command waits for one of them instead of failing — it says
14
+ * so once, looks again every few seconds and gives up after `--runner-wait` (default 15 min, `0` = fail at once). A runner nothing is known
15
+ * to be able to do the job (no runner with the capability at all, or one never seen) is not waited for: that is exit 125 at once, as in
16
+ * phase 1. Hand-made runners (plain ssh) are never waited for either — their offline state is not part of a design.
17
+ */
18
+ const msPerSecond = 1000;
19
+ const secondsPerMinute = 60;
20
+ const secondsPerHour = 3600;
21
+ /**
22
+ * @description Is there an offline PAIRED runner worth waiting for? Only when a capability is needed and no runner is named: a runner is
23
+ * worth it when its last snapshot had the capability and Pueue and nobody paused it (a paused one would be skipped when it came back).
24
+ * `null` = fail now.
25
+ */
26
+ function planRunnerWait(config, reports, wanted) {
27
+ const needs = wanted.needs;
28
+ if (needs === null || wanted.runner !== null)
29
+ return null;
30
+ const candidates = reports.filter((report) => {
31
+ if (report.status !== 'offline' || report.lastProbe === null)
32
+ return false;
33
+ const isPaired = config.runners.some((runner) => runner.name === report.name && runner.paired !== undefined);
34
+ return isPaired && !(0, probe_1.checkIsRunnerPaused)(report) && report.lastProbe.pueueVersion !== null && (0, probe_1.checkHasCapability)(report.lastProbe, needs);
35
+ });
36
+ if (candidates.length === 0)
37
+ return null;
38
+ return {
39
+ runnerNames: candidates.map((report) => report.name),
40
+ description: candidates.map((report) => `${report.name} offline${report.lastSeenAtMs === null ? '' : ` since ${(0, probe_1.formatLastSeen)(report.lastSeenAtMs)}`}`).join(', '),
41
+ };
42
+ }
43
+ /** @description `15 min`, `90 s`, `2 h`, `1 h 30 min`: a wait in the words a person would use. */
44
+ function formatWaitDuration(totalSeconds) {
45
+ if (totalSeconds < secondsPerMinute)
46
+ return `${totalSeconds} s`;
47
+ const hours = Math.floor(totalSeconds / secondsPerHour);
48
+ const minutes = Math.floor((totalSeconds % secondsPerHour) / secondsPerMinute);
49
+ const seconds = totalSeconds % secondsPerMinute;
50
+ const parts = [...(hours > 0 ? [`${hours} h`] : []), ...(minutes > 0 ? [`${minutes} min`] : []), ...(hours === 0 && seconds > 0 ? [`${seconds} s`] : [])];
51
+ return parts.join(' ');
52
+ }
53
+ /** The poll as a person reads it: «10 s», or «500 ms» for the test window's sub-second polls. */
54
+ function formatPoll(pollMs) {
55
+ return pollMs < msPerSecond ? `${pollMs} ms` : formatWaitDuration(Math.round(pollMs / msPerSecond));
56
+ }
57
+ /** The least an attempt made DURING the wait is worth: a probe through ssh cannot answer in less, so with less left the wait is over. */
58
+ exports.minWaitAttemptMs = 1000;
59
+ /**
60
+ * @description Choose a runner, waiting for an offline paired one when that is worth it: the choice as soon as an attempt gives one IN TIME;
61
+ * a {@link RemoteRunError} with the pick's own message (and, after waiting, how long it waited) when nothing can be waited for or the wait
62
+ * ran out; and, if the user interrupts, the interrupt's exit code (130 / 143 / 129).
63
+ *
64
+ * An interrupt is heard from the first attempt to the last, in a sleep AND in a probe: it aborts what is in flight, and after every await the
65
+ * loop looks at it first — a runner an attempt picked after the interrupt is not taken, and no other attempt starts.
66
+ *
67
+ * `--runner-wait` is a promise about when the command stops waiting, so once the wait has begun no attempt starts with less than
68
+ * {@link minWaitAttemptMs} left, every attempt is told the time it has (its probe is cut at it), and an answer that comes after the
69
+ * deadline is refused — the job is not started late. The last sleep is cut so that one more look still fits before the deadline.
70
+ */
71
+ async function chooseRunnerWithWait(loop) {
72
+ const startedAtMs = loop.now();
73
+ const deadlineMs = startedAtMs + loop.waitSeconds * msPerSecond;
74
+ /** Set once the wait has begun (announced): the attempt that made it worth waiting, then the latest failed one. */
75
+ let waiting = null;
76
+ const stop = new AbortController();
77
+ const interrupted = { signal: null };
78
+ const stopWatching = loop.watchInterrupts((signal) => {
79
+ interrupted.signal ??= signal;
80
+ stop.abort();
81
+ });
82
+ const throwIfInterrupted = () => {
83
+ if (interrupted.signal === null)
84
+ return;
85
+ throw new remoteRunError_1.RemoteRunError(waiting === null ? 'interrupted while looking for a runner' : 'interrupted while waiting for a runner', (0, exitCodes_1.planInterrupt)(interrupted.signal).exitCode);
86
+ };
87
+ const giveUp = (failure, endNote) => {
88
+ const waited = waiting === null ? '' : `\nwaited ${formatWaitDuration(Math.round((loop.now() - startedAtMs) / msPerSecond))} for a runner with "${loop.needs}" ${endNote}`;
89
+ throw new remoteRunError_1.RemoteRunError(`${failure.failure.message}${waited}`, failure.failure.exitCode);
90
+ };
91
+ try {
92
+ for (;;) {
93
+ if (waiting !== null && deadlineMs - loop.now() < exports.minWaitAttemptMs)
94
+ giveUp(waiting.lastFailure, 'to come back — none did');
95
+ const attempt = await loop.attempt(waiting === null ? null : deadlineMs - loop.now(), stop.signal);
96
+ throwIfInterrupted();
97
+ if (attempt.ok) {
98
+ if (waiting === null || loop.now() <= deadlineMs)
99
+ return attempt.choice;
100
+ return giveUp(waiting.lastFailure, 'to come back — one answered only after the wait had ended, so the job was not started');
101
+ }
102
+ // The last sleep ends minWaitAttemptMs before the deadline, so the wait ends with one more look instead of with a sleep nobody answers; with
103
+ // less than that left there is nothing to wait for.
104
+ const sleepMs = Math.min(loop.pollMs, deadlineMs - loop.now() - exports.minWaitAttemptMs);
105
+ if (attempt.wait === null || loop.waitSeconds <= 0 || sleepMs <= 0)
106
+ return giveUp(attempt, 'to come back — none did');
107
+ if (waiting === null) {
108
+ loop.say(`waiting for a runner with ${loop.needs} (${attempt.wait.description}) — looking again every ${formatPoll(loop.pollMs)}, up to ${formatWaitDuration(loop.waitSeconds)}`);
109
+ }
110
+ waiting = { lastFailure: attempt };
111
+ await loop.sleep(sleepMs, stop.signal);
112
+ throwIfInterrupted();
113
+ }
114
+ }
115
+ finally {
116
+ stopWatching();
117
+ }
118
+ }
119
+ /** @description `sleep` for {@link chooseRunnerWithWait}: ends after `ms`, or at once when `stop` aborts; its timer never outlives the call. */
120
+ function sleepUntilStopped(ms, stop) {
121
+ return new Promise((resolve) => {
122
+ if (stop.aborted) {
123
+ resolve();
124
+ return;
125
+ }
126
+ const onStop = () => {
127
+ clearTimeout(timer);
128
+ resolve();
129
+ };
130
+ const timer = setTimeout(() => {
131
+ stop.removeEventListener('abort', onStop);
132
+ resolve();
133
+ }, ms);
134
+ stop.addEventListener('abort', onStop, { once: true });
135
+ });
136
+ }
137
+ //# sourceMappingURL=runnerWait.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnerWait.js","sourceRoot":"","sources":["../../src/remoteRun/runnerWait.ts"],"names":[],"mappings":";;;AA+BA,wCAaC;AAGD,gDAOC;AA6CD,oDA2CC;AAGD,8CAgBC;AAjKD,2CAAkE;AAClE,mCAA4H;AAC5H,qDAAkD;AAIlD;;;;;;GAMG;AAEH,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,cAAc,GAAG,IAAI,CAAC;AAU5B;;;;GAIG;AACH,SAAgB,cAAc,CAAC,MAAqB,EAAE,OAAgC,EAAE,MAAiE;IACvJ,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAC3B,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC1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IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,OAAO;QACT,CAAC;QACD,MAAM,MAAM,GAAG,GAAS,EAAE;YACxB,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;QACF,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC1C,OAAO,EAAE,CAAC;QACZ,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @description How long `charness remote-run --needs <capability>` waits for a paired runner that is offline, and how often it looks
3
+ * again — in a leaf module of its own so the CLI reads them without loading the bot (like `leaseTiming.ts`).
4
+ *
5
+ * The test seam `CHARNESS_TEST_TIMINGS` (`testTimings.ts`) may only SHORTEN the poll (key `remoteRunRunnerPollMs`); the CLI cannot import
6
+ * `testTimings.ts` (its graph reaches the bot), so it reads this one key tolerantly, as the lease does.
7
+ */
8
+ /** `--runner-wait` when the command line does not say: a laptop that slept or a link that restarts is back well within this. */
9
+ export declare const defaultRunnerWaitSeconds: number;
10
+ /** How often the wait looks at the runners again. */
11
+ export declare const runnerWaitPollMs: number;
12
+ /** A shorter poll would probe every runner (an ssh call each) in a tight loop. */
13
+ export declare const runnerWaitPollMinMs = 200;
14
+ /** @description The poll in force: the production one, or the test seam's shorter `remoteRunRunnerPollMs` when it is a whole number of ms within [min, production]. */
15
+ export declare function readRunnerWaitPollMs(env: NodeJS.ProcessEnv): number;
16
+ //# sourceMappingURL=runnerWaitTiming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnerWaitTiming.d.ts","sourceRoot":"","sources":["../../src/remoteRun/runnerWaitTiming.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,gIAAgI;AAChI,eAAO,MAAM,wBAAwB,QAAU,CAAC;AAChD,qDAAqD;AACrD,eAAO,MAAM,gBAAgB,QAAmB,CAAC;AACjD,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAIvC,uKAAuK;AACvK,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAYnE"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ /**
3
+ * @description How long `charness remote-run --needs <capability>` waits for a paired runner that is offline, and how often it looks
4
+ * again — in a leaf module of its own so the CLI reads them without loading the bot (like `leaseTiming.ts`).
5
+ *
6
+ * The test seam `CHARNESS_TEST_TIMINGS` (`testTimings.ts`) may only SHORTEN the poll (key `remoteRunRunnerPollMs`); the CLI cannot import
7
+ * `testTimings.ts` (its graph reaches the bot), so it reads this one key tolerantly, as the lease does.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.runnerWaitPollMinMs = exports.runnerWaitPollMs = exports.defaultRunnerWaitSeconds = void 0;
11
+ exports.readRunnerWaitPollMs = readRunnerWaitPollMs;
12
+ const msPerSecond = 1000;
13
+ /** `--runner-wait` when the command line does not say: a laptop that slept or a link that restarts is back well within this. */
14
+ exports.defaultRunnerWaitSeconds = 15 * 60;
15
+ /** How often the wait looks at the runners again. */
16
+ exports.runnerWaitPollMs = 10 * msPerSecond;
17
+ /** A shorter poll would probe every runner (an ssh call each) in a tight loop. */
18
+ exports.runnerWaitPollMinMs = 200;
19
+ const testTimingsVariableName = 'CHARNESS_TEST_TIMINGS';
20
+ /** @description The poll in force: the production one, or the test seam's shorter `remoteRunRunnerPollMs` when it is a whole number of ms within [min, production]. */
21
+ function readRunnerWaitPollMs(env) {
22
+ const rawTestTimings = env[testTimingsVariableName];
23
+ if (rawTestTimings === undefined || rawTestTimings.trim() === '')
24
+ return exports.runnerWaitPollMs;
25
+ let overrides;
26
+ try {
27
+ overrides = JSON.parse(rawTestTimings);
28
+ }
29
+ catch {
30
+ return exports.runnerWaitPollMs;
31
+ }
32
+ const overrideMs = overrides?.remoteRunRunnerPollMs;
33
+ if (overrideMs === undefined || !Number.isInteger(overrideMs))
34
+ return exports.runnerWaitPollMs;
35
+ return overrideMs >= exports.runnerWaitPollMinMs && overrideMs <= exports.runnerWaitPollMs ? overrideMs : exports.runnerWaitPollMs;
36
+ }
37
+ //# sourceMappingURL=runnerWaitTiming.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnerWaitTiming.js","sourceRoot":"","sources":["../../src/remoteRun/runnerWaitTiming.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAaH,oDAYC;AAvBD,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,gIAAgI;AACnH,QAAA,wBAAwB,GAAG,EAAE,GAAG,EAAE,CAAC;AAChD,qDAAqD;AACxC,QAAA,gBAAgB,GAAG,EAAE,GAAG,WAAW,CAAC;AACjD,kFAAkF;AACrE,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAEvC,MAAM,uBAAuB,GAAG,uBAAuB,CAAC;AAExD,uKAAuK;AACvK,SAAgB,oBAAoB,CAAC,GAAsB;IACzD,MAAM,cAAc,GAAG,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACpD,IAAI,cAAc,KAAK,SAAS,IAAI,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,wBAAgB,CAAC;IAC1F,IAAI,SAAoD,CAAC;IACzD,IAAI,CAAC;QACH,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,wBAAgB,CAAC;IAC1B,CAAC;IACD,MAAM,UAAU,GAAG,SAAS,EAAE,qBAAqB,CAAC;IACpD,IAAI,UAAU,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC;QAAE,OAAO,wBAAgB,CAAC;IACvF,OAAO,UAAU,IAAI,2BAAmB,IAAI,UAAU,IAAI,wBAAgB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,wBAAgB,CAAC;AAC7G,CAAC"}
@@ -3,8 +3,8 @@ import { type RunnerClient } from './runnerClient';
3
3
  import type { RunnerConfig, RunnersConfig } from './runnersConfig';
4
4
  /**
5
5
  * @description Which runners exist right now: probe them (in parallel, bounded), remember each one's last answer so an offline runner
6
- * still shows what it was, and pick the one a command should use — the named one, or the first in `runners.json` that answers and, with
7
- * `--needs`, has the capability.
6
+ * still shows what it was, and pick the one a command should use — the named one, or the first in the catalog (`runners.json` entries,
7
+ * then the paired runners) that answers, is not paused and, with `--needs`, has the capability.
8
8
  */
9
9
  /** The whole probing of all runners ends by then (a dead host costs its ssh connect timeout, once, in parallel with the others). */
10
10
  export declare const probeAllTimeoutMs: number;
@@ -21,9 +21,9 @@ export declare function probeRunner(client: RunnerClient, nowMs?: number, signal
21
21
  /**
22
22
  * @description Probe every client at once under ONE deadline (20 s): a runner that has not answered by then is reported offline with its
23
23
  * last snapshot and its ssh calls are killed, so the view ends on time and nothing keeps the process alive afterwards. The others are not
24
- * held back by it.
24
+ * held back by it. `stop` ends the same ssh calls from outside — the user interrupted the command that asked.
25
25
  */
26
- export declare function probeRunners(clients: readonly RunnerClient[], nowMs?: number, deadlineMs?: number): Promise<RunnerReport[]>;
26
+ export declare function probeRunners(clients: readonly RunnerClient[], nowMs?: number, deadlineMs?: number, stop?: AbortSignal): Promise<RunnerReport[]>;
27
27
  export type RunnerPick = {
28
28
  ok: true;
29
29
  runnerName: string;
@@ -35,9 +35,9 @@ export type RunnerPick = {
35
35
  /** The `runners` view of why nothing fits, one block per runner. */
36
36
  export declare function formatRunnersView(reports: readonly RunnerReport[]): string;
37
37
  /**
38
- * @description The runner a command should use. `wanted.runner` names one (it must exist, answer and have Pueue); otherwise the first
39
- * runner in `config` order that answers, has Pueue and — with `wanted.needs` — the capability. None: the reason and the `runners`
40
- * view, exit 125.
38
+ * @description The runner a command should use. `wanted.runner` names one (it must exist, answer, have Pueue and not be paused);
39
+ * otherwise the first runner in `config` order that answers, has Pueue, is not paused and — with `wanted.needs` — the capability. None:
40
+ * the reason and the `runners` view, exit 125.
41
41
  */
42
42
  export declare function pickRunner(config: RunnersConfig, reports: readonly RunnerReport[], wanted: {
43
43
  runner: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"runners.d.ts","sourceRoot":"","sources":["../../src/remoteRun/runners.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEnE;;;;GAIG;AAEH,oIAAoI;AACpI,eAAO,MAAM,iBAAiB,QAAY,CAAC;AAc3C,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GAAG,IAAI,CAQnH;AAOD;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,GAAE,MAAmB,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,UAAU,GAAE,MAA0B,GAAG,OAAO,CAAC,YAAY,CAAC,CAwBvK;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,EAAE,KAAK,GAAE,MAAmB,EAAE,UAAU,GAAE,MAA0B,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAQhK;AAED,MAAM,MAAM,UAAU,GA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