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
@@ -0,0 +1,161 @@
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.createMachineProbe = createMachineProbe;
37
+ exports.getArchName = getArchName;
38
+ exports.parseOsRelease = parseOsRelease;
39
+ exports.collectMachineReport = collectMachineReport;
40
+ exports.formatMachineReport = formatMachineReport;
41
+ const fs = __importStar(require("fs"));
42
+ const os = __importStar(require("os"));
43
+ const path = __importStar(require("path"));
44
+ const commandRunner_1 = require("../selfUpdate/commandRunner");
45
+ const execEnv_1 = require("./execEnv");
46
+ /**
47
+ * @description What `charness-runner check` (and the pairing) tells the operator about the machine: the OS, the hardware, and which of
48
+ * the four things agents send to a runner it can do — Android emulator runs, iOS, Playwright, Docker. A first look from the account that
49
+ * will run the jobs, not a promise: iOS is shown as «checked when the service starts» (the boot check of a LaunchDaemon is S3's), and a
50
+ * capability that cannot be told cheaply is reported as it is found. Commands are bounded (4 s).
51
+ */
52
+ const probeTimeoutMs = 4000;
53
+ const bytesPerGib = 1024 ** 3;
54
+ const maxDiskPathDepth = 8;
55
+ function readTextFileOrNull(filePath) {
56
+ try {
57
+ return fs.readFileSync(filePath, 'utf8');
58
+ }
59
+ catch {
60
+ return null;
61
+ }
62
+ }
63
+ function readFreeDiskBytes(directory) {
64
+ let probe = directory;
65
+ for (let depth = 0; depth < maxDiskPathDepth; depth += 1) {
66
+ try {
67
+ const stats = fs.statfsSync(probe);
68
+ return stats.bavail * stats.bsize;
69
+ }
70
+ catch {
71
+ probe = path.dirname(probe);
72
+ }
73
+ }
74
+ return null;
75
+ }
76
+ function createMachineProbe(homeDir = os.homedir()) {
77
+ return {
78
+ runner: commandRunner_1.runCommand,
79
+ platform: process.platform,
80
+ nodeArch: process.arch,
81
+ homeDir,
82
+ environment: process.env,
83
+ checkExists: fs.existsSync,
84
+ readTextFile: readTextFileOrNull,
85
+ cpus: os.cpus,
86
+ totalMemoryBytes: os.totalmem,
87
+ freeDiskBytes: readFreeDiskBytes,
88
+ };
89
+ }
90
+ /** @description `x86_64`/`arm64` for what Node calls `x64`/`arm64`. */
91
+ function getArchName(nodeArch) {
92
+ return nodeArch === 'x64' ? 'x86_64' : nodeArch;
93
+ }
94
+ /** @description `Ubuntu 24.04` from `/etc/os-release`'s PRETTY_NAME, or the kernel's name. */
95
+ function parseOsRelease(text) {
96
+ const match = text === null ? null : /^PRETTY_NAME="?([^"\n]+)"?$/m.exec(text);
97
+ return match === null ? null : match[1].trim();
98
+ }
99
+ async function readOsName(probe) {
100
+ if (probe.platform === 'darwin') {
101
+ const version = await probe.runner('sw_vers', ['-productVersion'], { timeoutMs: probeTimeoutMs });
102
+ return version.ok ? `macOS ${version.stdout.trim()}` : 'macOS';
103
+ }
104
+ return parseOsRelease(probe.readTextFile('/etc/os-release')) ?? os.type();
105
+ }
106
+ async function detectAndroid(probe) {
107
+ const sdk = (0, execEnv_1.findAndroidSdk)(probe.homeDir, probe.environment, probe.checkExists);
108
+ if (sdk === null)
109
+ return { name: 'android', isAvailable: false, detail: 'no Android SDK found' };
110
+ const hasEmulator = probe.checkExists(path.join(sdk, 'emulator', 'emulator'));
111
+ if (!hasEmulator)
112
+ return { name: 'android', isAvailable: false, detail: 'the SDK has no emulator' };
113
+ const acceleration = probe.platform === 'darwin' ? 'HVF' : probe.checkExists('/dev/kvm') ? 'KVM' : 'no KVM';
114
+ return { name: 'android', isAvailable: true, detail: `${acceleration}, emulator found` };
115
+ }
116
+ async function detectIos(probe) {
117
+ if (probe.platform !== 'darwin')
118
+ return { name: 'ios', isAvailable: false, detail: 'needs macOS' };
119
+ const xcode = await probe.runner('xcodebuild', ['-version'], { timeoutMs: probeTimeoutMs });
120
+ const version = /Xcode\s+(\S+)/.exec(xcode.stdout)?.[1];
121
+ return xcode.ok && version !== undefined
122
+ ? { name: 'ios', isAvailable: true, detail: `Xcode ${version}, checked when the service starts` }
123
+ : { name: 'ios', isAvailable: false, detail: 'no Xcode' };
124
+ }
125
+ function detectPlaywright(probe) {
126
+ const browsersPath = probe.environment.PLAYWRIGHT_BROWSERS_PATH
127
+ ?? path.join(probe.homeDir, probe.platform === 'darwin' ? 'Library/Caches/ms-playwright' : '.cache/ms-playwright');
128
+ return probe.checkExists(browsersPath)
129
+ ? { name: 'playwright', isAvailable: true, detail: 'browsers installed' }
130
+ : { name: 'playwright', isAvailable: false, detail: 'no browsers installed' };
131
+ }
132
+ async function detectDocker(probe) {
133
+ const docker = await probe.runner('docker', ['--version'], { timeoutMs: probeTimeoutMs });
134
+ return docker.ok ? { name: 'docker', isAvailable: true, detail: docker.stdout.trim().replace(/^Docker version\s*/, '').split(',')[0] } : { name: 'docker', isAvailable: false, detail: 'not installed' };
135
+ }
136
+ /** @description Look at this machine. */
137
+ async function collectMachineReport(probe, workRoot) {
138
+ const cpus = probe.cpus();
139
+ const [osName, android, ios, docker] = await Promise.all([readOsName(probe), detectAndroid(probe), detectIos(probe), detectDocker(probe)]);
140
+ return {
141
+ osName,
142
+ arch: getArchName(probe.nodeArch),
143
+ cpuModel: cpus[0]?.model.trim() ?? 'unknown CPU',
144
+ cpuCores: cpus.length,
145
+ ramBytes: probe.totalMemoryBytes(),
146
+ diskFreeBytes: probe.freeDiskBytes(workRoot),
147
+ capabilities: [android, ios, detectPlaywright(probe), docker],
148
+ };
149
+ }
150
+ function formatGib(bytes) {
151
+ return `${Math.round(bytes / bytesPerGib)} GB`;
152
+ }
153
+ /** @description The lines of the check screen for the machine: system, hardware, what it can do. */
154
+ function formatMachineReport(report) {
155
+ const capabilityText = report.capabilities.map((capability) => (capability.isAvailable ? `${capability.name} (${capability.detail})` : `${capability.name}: no`)).join(' · ');
156
+ return [
157
+ ` ${report.osName} (${report.arch}) · ${report.cpuModel}, ${report.cpuCores} cores · RAM ${formatGib(report.ramBytes)}${report.diskFreeBytes === null ? '' : ` · disk ${formatGib(report.diskFreeBytes)} free`}`,
158
+ ` can: ${capabilityText}`,
159
+ ];
160
+ }
161
+ //# sourceMappingURL=machineReport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"machineReport.js","sourceRoot":"","sources":["../../src/runnerUtility/machineReport.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA,gDAaC;AAGD,kCAEC;AAGD,wCAGC;AA0CD,oDAYC;AAOD,kDAMC;AA9JD,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAC7B,+DAA6E;AAC7E,uCAA2C;AAE3C;;;;;GAKG;AAEH,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,CAAC;AAC9B,MAAM,gBAAgB,GAAG,CAAC,CAAC;AA+B3B,SAAS,kBAAkB,CAAC,QAAgB;IAC1C,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC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AE,IAAI,aAAa;QAChD,QAAQ,EAAE,IAAI,CAAC,MAAM;QACrB,QAAQ,EAAE,KAAK,CAAC,gBAAgB,EAAE;QAClC,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC;QAC5C,YAAY,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;KAC9D,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;AACjD,CAAC;AAED,oGAAoG;AACpG,SAAgB,mBAAmB,CAAC,MAAqB;IACvD,MAAM,cAAc,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,KAAK,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9K,OAAO;QACL,KAAK,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,gBAAgB,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE;QACjN,UAAU,cAAc,EAAE;KAC3B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare function getPackageIdOfArchive(archive: Buffer): string;
2
+ export declare function checkIsPackageId(value: string): boolean;
3
+ /** @description Does the archive file hold the package `expectedId` names? An unreadable or damaged archive does not. */
4
+ export declare function checkArchiveHasId(archivePath: string, expectedId: string): boolean;
5
+ //# sourceMappingURL=packageId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageId.d.ts","sourceRoot":"","sources":["../../src/runnerUtility/packageId.ts"],"names":[],"mappings":"AAaA,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,yHAAyH;AACzH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAMlF"}
@@ -0,0 +1,64 @@
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.getPackageIdOfArchive = getPackageIdOfArchive;
37
+ exports.checkIsPackageId = checkIsPackageId;
38
+ exports.checkArchiveHasId = checkArchiveHasId;
39
+ const crypto_1 = require("crypto");
40
+ const fs = __importStar(require("fs"));
41
+ const zlib_1 = require("zlib");
42
+ /**
43
+ * @description The id of a hub package: the first 16 hex digits of the sha256 of the tar BEFORE compression (`runners/hubPackage.ts`
44
+ * computes it the same way). Builtins only: the very first step of a pairing, which has no dependencies installed, checks the archive it
45
+ * downloaded against the id the hub announced with it.
46
+ */
47
+ const packageIdLength = 16;
48
+ const packageIdPattern = /^[0-9a-f]{16}$/;
49
+ function getPackageIdOfArchive(archive) {
50
+ return (0, crypto_1.createHash)('sha256').update((0, zlib_1.gunzipSync)(archive)).digest('hex').slice(0, packageIdLength);
51
+ }
52
+ function checkIsPackageId(value) {
53
+ return packageIdPattern.test(value);
54
+ }
55
+ /** @description Does the archive file hold the package `expectedId` names? An unreadable or damaged archive does not. */
56
+ function checkArchiveHasId(archivePath, expectedId) {
57
+ try {
58
+ return checkIsPackageId(expectedId) && getPackageIdOfArchive(fs.readFileSync(archivePath)) === expectedId;
59
+ }
60
+ catch {
61
+ return false;
62
+ }
63
+ }
64
+ //# sourceMappingURL=packageId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageId.js","sourceRoot":"","sources":["../../src/runnerUtility/packageId.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,sDAEC;AAED,4CAEC;AAGD,8CAMC;AA5BD,mCAAoC;AACpC,uCAAyB;AACzB,+BAAkC;AAElC;;;;GAIG;AAEH,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAE1C,SAAgB,qBAAqB,CAAC,OAAe;IACnD,OAAO,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAA,iBAAU,EAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC;AAClG,CAAC;AAED,SAAgB,gBAAgB,CAAC,KAAa;IAC5C,OAAO,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC;AAED,yHAAyH;AACzH,SAAgB,iBAAiB,CAAC,WAAmB,EAAE,UAAkB;IACvE,IAAI,CAAC;QACH,OAAO,gBAAgB,CAAC,UAAU,CAAC,IAAI,qBAAqB,CAAC,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,KAAK,UAAU,CAAC;IAC5G,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { type RedeemReply } from '../runners/gateProtocol';
2
+ import { type HubEndpoint } from './hubClient';
3
+ import type { RunnerKeys } from './runnerKeys';
4
+ /**
5
+ * @description Getting a pairing back whose answer was lost. The hub commits a redemption — the runner is registered, the code's
6
+ * temporary key is deleted — BEFORE the runner has the answer and writes `config.json`. If the answer never arrives (the connection
7
+ * drops, the process dies), the temporary key cannot be used again and a fresh code is refused (the runner's own key is already
8
+ * registered). What can still ask is the runner's PERMANENT key, so the runner writes `pairing.json` before it redeems and, whenever it
9
+ * finds that file without a `config.json`, asks the gate for its `identity`: the very answer `redeem` gave. A key the hub does not
10
+ * know is the other answer — nothing was committed, the half-done pairing is dropped.
11
+ */
12
+ export type RecoveryOutcome =
13
+ /** The hub has this runner: here is what `redeem` answered. */
14
+ {
15
+ kind: 'recovered';
16
+ reply: Extract<RedeemReply, {
17
+ ok: true;
18
+ }>;
19
+ }
20
+ /** The hub does not know this key (or no longer): nothing was committed there. */
21
+ | {
22
+ kind: 'not-registered';
23
+ }
24
+ /** The hub could not be asked right now; try again later. */
25
+ | {
26
+ kind: 'unreachable';
27
+ message: string;
28
+ };
29
+ /** @description Ask the hub, with the runner's own key, what it knows of this runner. */
30
+ export declare function recoverPairing(endpoint: HubEndpoint, keys: RunnerKeys): Promise<RecoveryOutcome>;
31
+ //# sourceMappingURL=pairingRecovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pairingRecovery.d.ts","sourceRoot":"","sources":["../../src/runnerUtility/pairingRecovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAqD,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAClG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;;;GAOG;AAEH,MAAM,MAAM,eAAe;AACzB,+DAA+D;AAC7D;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC,WAAW,EAAE;QAAE,EAAE,EAAE,IAAI,CAAA;KAAE,CAAC,CAAA;CAAE;AAClE,kFAAkF;GAChF;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE;AAC5B,6DAA6D;GAC3D;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7C,yFAAyF;AACzF,wBAAsB,cAAc,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,eAAe,CAAC,CAatG"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.recoverPairing = recoverPairing;
4
+ const gateProtocol_1 = require("../runners/gateProtocol");
5
+ const hubClient_1 = require("./hubClient");
6
+ /** @description Ask the hub, with the runner's own key, what it knows of this runner. */
7
+ async function recoverPairing(endpoint, keys) {
8
+ try {
9
+ const client = await (0, hubClient_1.connectToHub)(endpoint, keys.client.privateKey);
10
+ try {
11
+ const reply = await (0, hubClient_1.requestGateJson)(client, 'identity', null, gateProtocol_1.redeemReplySchema);
12
+ return reply.ok ? { kind: 'recovered', reply } : { kind: 'not-registered' };
13
+ }
14
+ finally {
15
+ client.end();
16
+ }
17
+ }
18
+ catch (error) {
19
+ if (error instanceof hubClient_1.HubConnectionError && error.failure === 'auth')
20
+ return { kind: 'not-registered' };
21
+ return { kind: 'unreachable', message: error instanceof Error ? error.message : 'could not reach the hub' };
22
+ }
23
+ }
24
+ //# sourceMappingURL=pairingRecovery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pairingRecovery.js","sourceRoot":"","sources":["../../src/runnerUtility/pairingRecovery.ts"],"names":[],"mappings":";;AAsBA,wCAaC;AAnCD,0DAA8E;AAC9E,2CAAkG;AAoBlG,yFAAyF;AAClF,KAAK,UAAU,cAAc,CAAC,QAAqB,EAAE,IAAgB;IAC1E,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAY,EAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACpE,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,IAAA,2BAAe,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,gCAAiB,CAAC,CAAC;YACjF,OAAO,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;QAC9E,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,GAAG,EAAE,CAAC;QACf,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,8BAAkB,IAAI,KAAK,CAAC,OAAO,KAAK,MAAM;YAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;QACvG,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB,EAAE,CAAC;IAC9G,CAAC;AACH,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { type CommandRunner } from '../selfUpdate/commandRunner';
2
+ import type { RunnerHomePaths } from './runnerHome';
3
+ export declare function renderPueueConfig(paths: RunnerHomePaths): string;
4
+ /** @description Write the config (and its folders) when it is missing or differs. */
5
+ export declare function ensurePueueConfig(paths: RunnerHomePaths): void;
6
+ /** @description Is the daemon answering? */
7
+ export declare function checkIsPueueRunning(paths: RunnerHomePaths, runner?: CommandRunner): Promise<boolean>;
8
+ /** @description Start the daemon (daemonized, so it outlives this process) unless it answers; `false` when it could not be started. */
9
+ export declare function ensurePueueDaemon(paths: RunnerHomePaths, runner?: CommandRunner): Promise<boolean>;
10
+ /** @description When a service manages Pueue the link must not start a second daemon: wait (up to `timeoutMs`) for the service's to answer. */
11
+ export declare function waitForPueueDaemon(paths: RunnerHomePaths, timeoutMs: number, runner?: CommandRunner): Promise<boolean>;
12
+ /** What a Pueue daemon on this runner's private socket is doing. */
13
+ export type PueueState = {
14
+ kind: 'absent';
15
+ } | {
16
+ kind: 'idle';
17
+ } | {
18
+ kind: 'busy';
19
+ activeJobs: number;
20
+ } | {
21
+ kind: 'unreadable';
22
+ };
23
+ /** @description The tasks of `pueue status --json` that hold a process — `Running` and `Paused` — or `null` when the text is not that. */
24
+ export declare function countActivePueueTasks(statusJson: string): number | null;
25
+ /** @description Is a daemon answering on the runner's socket, and does it hold running jobs? */
26
+ export declare function inspectPueue(paths: RunnerHomePaths, runner?: CommandRunner): Promise<PueueState>;
27
+ /** @description Ask a daemon that no service manager owns to shut down, and wait for it to go. Pueue kills the jobs it runs when it stops: only for an IDLE one. */
28
+ export declare function shutDownPueue(paths: RunnerHomePaths, runner?: CommandRunner): Promise<boolean>;
29
+ /**
30
+ * @description Stop every job of the queue and empty it (`pueue reset --force`: it kills the running tasks and their children and removes the
31
+ * rest, so no queued task starts in their place), then wait until nothing is left running. `true` also when no daemon answers (its jobs died
32
+ * with it). The reset only ASKS: Pueue 4 answers at once and its task handler kills the tasks a moment later, so one look right after the
33
+ * command would still see them `Running` — it looks again, until `settleTimeoutMs` is over.
34
+ */
35
+ export declare function stopAllPueueJobs(paths: RunnerHomePaths, runner?: CommandRunner, settleTimeoutMs?: number): Promise<boolean>;
36
+ //# sourceMappingURL=pueueDaemon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pueueDaemon.d.ts","sourceRoot":"","sources":["../../src/runnerUtility/pueueDaemon.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAapD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAWhE;AAED,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAW9D;AAED,4CAA4C;AAC5C,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,GAAE,aAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAGtH;AAED,uIAAuI;AACvI,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,GAAE,aAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAKpH;AAED,+IAA+I;AAC/I,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,aAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAQxI;AAED,oEAAoE;AACpE,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC;AAE3B,0IAA0I;AAC1I,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWvE;AAED,gGAAgG;AAChG,wBAAsB,YAAY,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,GAAE,aAA0B,GAAG,OAAO,CAAC,UAAU,CAAC,CAMlH;AAED,oKAAoK;AACpK,wBAAsB,aAAa,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,GAAE,aAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAQhH;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,GAAE,aAA0B,EAAE,eAAe,GAAE,MAA6B,GAAG,OAAO,CAAC,OAAO,CAAC,CAUnK"}
@@ -0,0 +1,165 @@
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.renderPueueConfig = renderPueueConfig;
37
+ exports.ensurePueueConfig = ensurePueueConfig;
38
+ exports.checkIsPueueRunning = checkIsPueueRunning;
39
+ exports.ensurePueueDaemon = ensurePueueDaemon;
40
+ exports.waitForPueueDaemon = waitForPueueDaemon;
41
+ exports.countActivePueueTasks = countActivePueueTasks;
42
+ exports.inspectPueue = inspectPueue;
43
+ exports.shutDownPueue = shutDownPueue;
44
+ exports.stopAllPueueJobs = stopAllPueueJobs;
45
+ const fs = __importStar(require("fs"));
46
+ const path = __importStar(require("path"));
47
+ const configDirFile_1 = require("../configDirFile");
48
+ const commandRunner_1 = require("../selfUpdate/commandRunner");
49
+ /**
50
+ * @description The runner's private Pueue: its config under `~/.charness-runner/pueue/` (own directories and unix socket — never the
51
+ * account's default Pueue), and a daemon that is started if it is not running. Pueue is a service of its own: stopping or restarting the
52
+ * link never touches the queue or a running job.
53
+ */
54
+ const probeTimeoutMs = 5000;
55
+ const daemonStartTimeoutMs = 15 * 1000;
56
+ const configMode = 0o600;
57
+ const pueueWaitPollMs = 500;
58
+ function renderPueueConfig(paths) {
59
+ const runtimeDir = path.join(paths.pueueDir, 'run');
60
+ return [
61
+ 'shared:',
62
+ ` pueue_directory: ${path.join(paths.pueueDir, 'data')}`,
63
+ ` runtime_directory: ${runtimeDir}`,
64
+ ' use_unix_socket: true',
65
+ ` unix_socket_path: ${path.join(runtimeDir, 'pueue.socket')}`,
66
+ ` pid_path: ${path.join(runtimeDir, 'pueue.pid')}`,
67
+ '',
68
+ ].join('\n');
69
+ }
70
+ /** @description Write the config (and its folders) when it is missing or differs. */
71
+ function ensurePueueConfig(paths) {
72
+ fs.mkdirSync(path.join(paths.pueueDir, 'run'), { recursive: true, mode: 0o700 });
73
+ fs.mkdirSync(path.join(paths.pueueDir, 'data'), { recursive: true, mode: 0o700 });
74
+ const text = renderPueueConfig(paths);
75
+ let current = null;
76
+ try {
77
+ current = fs.readFileSync(paths.pueueConfig, 'utf8');
78
+ }
79
+ catch {
80
+ current = null;
81
+ }
82
+ if (current !== text)
83
+ (0, configDirFile_1.writeTextFileAtomically)(paths.pueueConfig, text, configMode);
84
+ }
85
+ /** @description Is the daemon answering? */
86
+ async function checkIsPueueRunning(paths, runner = commandRunner_1.runCommand) {
87
+ const result = await runner(path.join(paths.binDir, 'pueue'), ['--config', paths.pueueConfig, 'status'], { timeoutMs: probeTimeoutMs });
88
+ return result.ok;
89
+ }
90
+ /** @description Start the daemon (daemonized, so it outlives this process) unless it answers; `false` when it could not be started. */
91
+ async function ensurePueueDaemon(paths, runner = commandRunner_1.runCommand) {
92
+ ensurePueueConfig(paths);
93
+ if (await checkIsPueueRunning(paths, runner))
94
+ return true;
95
+ const started = await runner(path.join(paths.binDir, 'pueued'), ['--daemonize', '--config', paths.pueueConfig], { timeoutMs: daemonStartTimeoutMs });
96
+ return started.ok && await checkIsPueueRunning(paths, runner);
97
+ }
98
+ /** @description When a service manages Pueue the link must not start a second daemon: wait (up to `timeoutMs`) for the service's to answer. */
99
+ async function waitForPueueDaemon(paths, timeoutMs, runner = commandRunner_1.runCommand) {
100
+ ensurePueueConfig(paths);
101
+ const deadline = Date.now() + timeoutMs;
102
+ while (Date.now() < deadline) {
103
+ if (await checkIsPueueRunning(paths, runner))
104
+ return true;
105
+ await new Promise((resolve) => { setTimeout(resolve, pueueWaitPollMs); });
106
+ }
107
+ return false;
108
+ }
109
+ /** @description The tasks of `pueue status --json` that hold a process — `Running` and `Paused` — or `null` when the text is not that. */
110
+ function countActivePueueTasks(statusJson) {
111
+ try {
112
+ const parsed = JSON.parse(statusJson);
113
+ if (parsed.tasks === undefined)
114
+ return null;
115
+ return Object.values(parsed.tasks).filter((task) => {
116
+ const status = typeof task.status === 'string' ? [task.status] : Object.keys(task.status ?? {});
117
+ return status.includes('Running') || status.includes('Paused');
118
+ }).length;
119
+ }
120
+ catch {
121
+ return null;
122
+ }
123
+ }
124
+ /** @description Is a daemon answering on the runner's socket, and does it hold running jobs? */
125
+ async function inspectPueue(paths, runner = commandRunner_1.runCommand) {
126
+ const result = await runner(path.join(paths.binDir, 'pueue'), ['--config', paths.pueueConfig, 'status', '--json'], { timeoutMs: probeTimeoutMs });
127
+ if (!result.ok)
128
+ return { kind: 'absent' };
129
+ const activeJobs = countActivePueueTasks(result.stdout);
130
+ if (activeJobs === null)
131
+ return { kind: 'unreadable' };
132
+ return activeJobs === 0 ? { kind: 'idle' } : { kind: 'busy', activeJobs };
133
+ }
134
+ /** @description Ask a daemon that no service manager owns to shut down, and wait for it to go. Pueue kills the jobs it runs when it stops: only for an IDLE one. */
135
+ async function shutDownPueue(paths, runner = commandRunner_1.runCommand) {
136
+ await runner(path.join(paths.binDir, 'pueue'), ['--config', paths.pueueConfig, 'shutdown'], { timeoutMs: probeTimeoutMs });
137
+ const deadline = Date.now() + daemonStartTimeoutMs;
138
+ while (Date.now() < deadline) {
139
+ if (!(await checkIsPueueRunning(paths, runner)))
140
+ return true;
141
+ await new Promise((resolve) => { setTimeout(resolve, pueueWaitPollMs); });
142
+ }
143
+ return false;
144
+ }
145
+ /**
146
+ * @description Stop every job of the queue and empty it (`pueue reset --force`: it kills the running tasks and their children and removes the
147
+ * rest, so no queued task starts in their place), then wait until nothing is left running. `true` also when no daemon answers (its jobs died
148
+ * with it). The reset only ASKS: Pueue 4 answers at once and its task handler kills the tasks a moment later, so one look right after the
149
+ * command would still see them `Running` — it looks again, until `settleTimeoutMs` is over.
150
+ */
151
+ async function stopAllPueueJobs(paths, runner = commandRunner_1.runCommand, settleTimeoutMs = daemonStartTimeoutMs) {
152
+ if ((await inspectPueue(paths, runner)).kind === 'absent')
153
+ return true;
154
+ await runner(path.join(paths.binDir, 'pueue'), ['--config', paths.pueueConfig, 'reset', '--force'], { timeoutMs: daemonStartTimeoutMs });
155
+ const deadline = Date.now() + settleTimeoutMs;
156
+ for (;;) {
157
+ const after = await inspectPueue(paths, runner);
158
+ if (after.kind === 'absent' || after.kind === 'idle')
159
+ return true;
160
+ if (Date.now() >= deadline)
161
+ return false;
162
+ await new Promise((resolve) => { setTimeout(resolve, pueueWaitPollMs); });
163
+ }
164
+ }
165
+ //# sourceMappingURL=pueueDaemon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pueueDaemon.js","sourceRoot":"","sources":["../../src/runnerUtility/pueueDaemon.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,8CAWC;AAGD,8CAWC;AAGD,kDAGC;AAGD,8CAKC;AAGD,gDAQC;AAUD,sDAWC;AAGD,oCAMC;AAGD,sCAQC;AAQD,4CAUC;AA9HD,uCAAyB;AACzB,2CAA6B;AAC7B,oDAA2D;AAC3D,+DAA6E;AAG7E;;;;GAIG;AAEH,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,CAAC;AACvC,MAAM,UAAU,GAAG,KAAK,CAAC;AACzB,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,SAAgB,iBAAiB,CAAC,KAAsB;IACtD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACpD,OAAO;QACL,SAAS;QACT,sBAAsB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE;QACzD,wBAAwB,UAAU,EAAE;QACpC,yBAAyB;QACzB,uBAAuB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,EAAE;QAC9D,eAAe,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE;QACnD,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,qFAAqF;AACrF,SAA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IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,GAAG,UAAU,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * `charness-runner` — the program that attaches a machine to a charness hub as a runner (see `src/runners/README.md` for the hub side
4
+ * and `src/runnerUtility/README.md` for this one).
5
+ *
6
+ * charness-runner what this account is attached to and what the link is doing (= `status`)
7
+ * charness-runner pair <code> attach this account with a pairing code (the line from /runners does it for you)
8
+ * charness-runner run hold the link to the hub; Ctrl-C stops (a service does the same, see the pairing text)
9
+ * charness-runner check look at this machine and install what a runner needs (Pueue, rsync)
10
+ * charness-runner service install keep it running without a terminal (see `serviceManager.ts`)
11
+ * charness-runner pause | resume | unpair
12
+ *
13
+ * This file is the FIRST thing a pairing runs, from a package that has no `node_modules` yet (`pair --bootstrap <folder> <code>`,
14
+ * started by the pasted line): it imports Node built-ins only, installs the package's dependencies into a new app folder, and starts
15
+ * the installed copy to do the pairing. Everything else is loaded after that, on demand.
16
+ */
17
+ export {};
18
+ //# sourceMappingURL=runnerCli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnerCli.d.ts","sourceRoot":"","sources":["../../src/runnerUtility/runnerCli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;GAcG"}