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,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serviceKindLabels = void 0;
4
+ exports.formatListTimestamp = formatListTimestamp;
5
+ exports.formatRunnerListLine = formatRunnerListLine;
6
+ exports.formatRunnerList = formatRunnerList;
7
+ /**
8
+ * @description The text of `charness runners ls`: one line per paired runner (name, online or offline since when, paused, OS, how it
9
+ * is kept running, version) and a line for each pairing code still open. Pure: the status is read by the caller.
10
+ */
11
+ exports.serviceKindLabels = {
12
+ foreground: 'run by hand',
13
+ 'user-service': 'user service',
14
+ 'system-service': 'system service',
15
+ unknown: 'service unknown',
16
+ };
17
+ /** @description `2026-11-01 14:05` in the zone of this process. */
18
+ function formatListTimestamp(epochMs) {
19
+ const date = new Date(epochMs);
20
+ const pad = (value) => value.toString().padStart(2, '0');
21
+ return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`;
22
+ }
23
+ function describeConnection(status) {
24
+ if (status.isOnline)
25
+ return 'online';
26
+ return status.lastSeenMs === null ? 'offline, never connected' : `offline since ${formatListTimestamp(status.lastSeenMs)}`;
27
+ }
28
+ function formatRunnerListLine(entry) {
29
+ const { runner, status } = entry;
30
+ const parts = [
31
+ describeConnection(status),
32
+ ...(runner.isPaused ? ['paused'] : []),
33
+ `${runner.os} (${runner.arch})`,
34
+ exports.serviceKindLabels[runner.serviceKind],
35
+ `charness ${runner.version}`,
36
+ `paired ${formatListTimestamp(runner.pairedAtMs)}`,
37
+ ];
38
+ return `${runner.name} — ${parts.join(' · ')}`;
39
+ }
40
+ /** @description The whole `ls` output. */
41
+ function formatRunnerList(entries, pending, nowMs) {
42
+ const lines = entries.length === 0 ? ['No runners paired yet. `charness runners pair --host <address>` makes a pairing line.'] : entries.map(formatRunnerListLine);
43
+ const open = pending.filter((pairing) => pairing.expiresAtMs > nowMs);
44
+ if (open.length > 0) {
45
+ lines.push('', ...open.map((pairing) => `Pairing code open until ${formatListTimestamp(pairing.expiresAtMs)} (${pairing.host}:${pairing.port})`));
46
+ }
47
+ return `${lines.join('\n')}\n`;
48
+ }
49
+ //# sourceMappingURL=runnersList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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C,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtC,GAAG,MAAM,CAAC,EAAE,KAAK,MAAM,CAAC,IAAI,GAAG;QAC/B,yBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC;QACrC,YAAY,MAAM,CAAC,OAAO,EAAE;QAC5B,UAAU,mBAAmB,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;KACnD,CAAC;IACF,OAAO,GAAG,MAAM,CAAC,IAAI,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;AACjD,CAAC;AAED,0CAA0C;AAC1C,SAAgB,gBAAgB,CAAC,OAAmC,EAAE,OAAkC,EAAE,KAAa;IACrH,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,uFAAuF,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACnK,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC,CAAC;IACtE,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,2BAA2B,mBAAmB,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IACpJ,CAAC;IACD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { RunnerScreenEntry } from '../utils/runnersScreenPlan';
2
+ import type { HubContext } from './hubPaths';
3
+ /**
4
+ * @description What the `/runners` screen shows, read in two steps so it can open at once: {@link readRunnersOverview} is the registry,
5
+ * the links (does the socket accept?) and the last snapshot each machine left — no ssh, milliseconds — and
6
+ * {@link probeRunnersOverview} asks the machines that are online what they are like right now (one shared 20 s deadline, the phase-1
7
+ * probe), keeping the snapshot of a machine that does not answer.
8
+ */
9
+ export interface RunnersOverview {
10
+ /** The registry revision (`paired.json` `rev`): what a keyboard built from this overview is valid for. */
11
+ revision: number;
12
+ entries: RunnerScreenEntry[];
13
+ /** Expiry of every pairing code that is still open. */
14
+ openPairingExpiries: number[];
15
+ }
16
+ /** @description The overview without any ssh call: the registry, which links are up, the last snapshots. */
17
+ export declare function readRunnersOverview(ctx: HubContext, cacheDir: string, nowMs: number): Promise<RunnersOverview>;
18
+ /** @description `overview` with the machines that are online asked for their live state. Offline ones are not called. */
19
+ export declare function probeRunnersOverview(ctx: HubContext, overview: RunnersOverview, cacheDir: string, nowMs: number): Promise<RunnersOverview>;
20
+ //# sourceMappingURL=runnersOverview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnersOverview.d.ts","sourceRoot":"","sources":["../../src/runners/runnersOverview.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAI7C;;;;;GAKG;AAEH,MAAM,WAAW,eAAe;IAC9B,0GAA0G;IAC1G,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,uDAAuD;IACvD,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAQD,4GAA4G;AAC5G,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAOpH;AASD,yHAAyH;AACzH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAiBhJ"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.readRunnersOverview = readRunnersOverview;
4
+ exports.probeRunnersOverview = probeRunnersOverview;
5
+ const pairedRunners_1 = require("../remoteRun/pairedRunners");
6
+ const runners_1 = require("../remoteRun/runners");
7
+ const runnerClient_1 = require("../remoteRun/runnerClient");
8
+ const ssh_1 = require("../remoteRun/ssh");
9
+ const hubRegistry_1 = require("./hubRegistry");
10
+ const linkControl_1 = require("./linkControl");
11
+ async function readEntry(ctx, runner, cacheDir) {
12
+ const status = await (0, linkControl_1.getRunnerLinkStatus)(ctx.dir, runner.id);
13
+ const snapshot = (0, runners_1.readLastProbe)(cacheDir, runner.name);
14
+ return { runner, isOnline: status.isOnline, lastSeenMs: status.lastSeenMs ?? snapshot?.seenAtMs ?? null, probe: snapshot?.probe ?? null };
15
+ }
16
+ /** @description The overview without any ssh call: the registry, which links are up, the last snapshots. */
17
+ async function readRunnersOverview(ctx, cacheDir, nowMs) {
18
+ const paired = (0, hubRegistry_1.readPairedFile)(ctx.dir);
19
+ return {
20
+ revision: paired.rev,
21
+ entries: await Promise.all(paired.runners.map((runner) => readEntry(ctx, runner, cacheDir))),
22
+ openPairingExpiries: (0, hubRegistry_1.readPendingFile)(ctx.dir).pending.filter((pairing) => pairing.expiresAtMs > nowMs).map((pairing) => pairing.expiresAtMs),
23
+ };
24
+ }
25
+ function applyReport(entry, report) {
26
+ if (report === undefined)
27
+ return entry;
28
+ if (report.status === 'online')
29
+ return { ...entry, probe: report.probe };
30
+ // It answered the socket probe but not the ssh one: it is shown as it was, offline.
31
+ return { ...entry, isOnline: false, lastSeenMs: report.lastSeenAtMs ?? entry.lastSeenMs, probe: report.lastProbe ?? entry.probe };
32
+ }
33
+ /** @description `overview` with the machines that are online asked for their live state. Offline ones are not called. */
34
+ async function probeRunnersOverview(ctx, overview, cacheDir, nowMs) {
35
+ const hub = { hubDir: ctx.dir, nodePath: ctx.nodePath, cliPath: ctx.cliPath };
36
+ const clients = overview.entries
37
+ .filter((entry) => entry.isOnline)
38
+ .flatMap((entry) => {
39
+ try {
40
+ return [(0, runnerClient_1.createRunnerClient)((0, pairedRunners_1.buildPairedRunnerConfig)(entry.runner, hub), cacheDir)];
41
+ }
42
+ catch (error) {
43
+ // A path of this machine that ssh cannot be given safely: that machine is shown as its last snapshot says, not probed.
44
+ if (error instanceof pairedRunners_1.PairedRunnerSetupError)
45
+ return [];
46
+ throw error;
47
+ }
48
+ });
49
+ if (clients.length === 0)
50
+ return overview;
51
+ (0, ssh_1.ensureRemoteRunCacheDir)(cacheDir);
52
+ const reports = await (0, runners_1.probeRunners)(clients, nowMs);
53
+ return { ...overview, entries: overview.entries.map((entry) => applyReport(entry, reports.find((report) => report.name === entry.runner.name))) };
54
+ }
55
+ //# sourceMappingURL=runnersOverview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnersOverview.js","sourceRoot":"","sources":["../../src/runners/runnersOverview.ts"],"names":[],"mappings":";;AAgCA,kDAOC;AAUD,oDAiBC;AAlED,8DAA6F;AAC7F,kDAAmE;AACnE,4DAA+D;AAC/D,0CAA2D;AAI3D,+CAAmF;AACnF,+CAAoD;AAiBpD,KAAK,UAAU,SAAS,CAAC,GAAe,EAAE,MAAoB,EAAE,QAAgB;IAC9E,MAAM,MAAM,GAAG,MAAM,IAAA,iCAAmB,EAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IAC7D,MAAM,QAAQ,GAAG,IAAA,uBAAa,EAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACtD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,QAAQ,EAAE,QAAQ,IAAI,IAAI,EAAE,KAAK,EAA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7
+ export interface ParsedPublicKey {
8
+ type: string;
9
+ /** The key as the ssh wire protocol carries it (what a host key verifier is handed). */
10
+ blob: Buffer;
11
+ }
12
+ /**
13
+ * @description A new ed25519 pair; `comment` is kept in the private key only. `ssh2`'s generator drops a leading zero byte of the key
14
+ * now and then (about 1 key in 300 comes out with a 31-byte public key, which neither `ssh2` nor OpenSSH can read), so every pair is
15
+ * read back before it is returned and a bad one is made again.
16
+ */
17
+ export declare function generateEd25519KeyPair(comment: string): SshKeyPair;
18
+ /** @description `value` as a public key, or `null` when it is not exactly `<type> <base64>`. */
19
+ export declare function parsePublicKey(value: string): ParsedPublicKey | null;
20
+ /** @description Is `value` a public key of the type charness issues to runners and the hub — ed25519 — in the strict form? */
21
+ export declare function checkIsEd25519PublicKey(value: string): boolean;
22
+ /** @description `SHA256:…`, the fingerprint `ssh-keygen -l` prints. */
23
+ export declare function getPublicKeyFingerprint(publicKey: string): string;
24
+ /** @description A random identifier (12 lowercase hex digits) safe in a file name, a shell word, an `authorized_keys` option and as the first word of an argument list. */
25
+ export declare function createRandomId(): string;
26
+ //# sourceMappingURL=sshKeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sshKeys.d.ts","sourceRoot":"","sources":["../../src/runners/sshKeys.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,UAAU;IACzB,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CASlE;AAED,gGAAgG;AAChG,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAKpE;AAED,8HAA8H;AAC9H,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED,uEAAuE;AACvE,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAIjE;AAED,2KAA2K;AAC3K,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateEd25519KeyPair = generateEd25519KeyPair;
4
+ exports.parsePublicKey = parsePublicKey;
5
+ exports.checkIsEd25519PublicKey = checkIsEd25519PublicKey;
6
+ exports.getPublicKeyFingerprint = getPublicKeyFingerprint;
7
+ exports.createRandomId = createRandomId;
8
+ const crypto_1 = require("crypto");
9
+ const ssh2_1 = require("ssh2");
10
+ /**
11
+ * @description The few things charness does with ssh keys: make an ed25519 pair (the runner's own, the hub's, a pairing's temporary
12
+ * one), write a public key the way `authorized_keys` and `known_hosts` read it, and its fingerprint. Public keys are kept as the
13
+ * two-field `<type> <base64>` text — no comment — and checked against a strict pattern before they are ever written into a file
14
+ * sshd reads: a key that carried a newline or an option would be a line of its own.
15
+ */
16
+ const base64Alphabet = 'A-Za-z0-9+/';
17
+ const publicKeyPattern = new RegExp(`^(ssh-ed25519|ecdsa-sha2-nistp(?:256|384|521)|ssh-rsa) ([${base64Alphabet}]+={0,2})$`);
18
+ const ed25519Type = 'ssh-ed25519';
19
+ const idByteLength = 6;
20
+ /** The odds of a bad key are about 1 in 300: ten tries in a row failing is not luck. */
21
+ const maxKeyGenerationAttempts = 10;
22
+ /**
23
+ * @description A new ed25519 pair; `comment` is kept in the private key only. `ssh2`'s generator drops a leading zero byte of the key
24
+ * now and then (about 1 key in 300 comes out with a 31-byte public key, which neither `ssh2` nor OpenSSH can read), so every pair is
25
+ * read back before it is returned and a bad one is made again.
26
+ */
27
+ function generateEd25519KeyPair(comment) {
28
+ for (let attempt = 0; attempt < maxKeyGenerationAttempts; attempt += 1) {
29
+ const generated = ssh2_1.utils.generateKeyPairSync('ed25519', { comment });
30
+ const publicKey = generated.public.split(' ').slice(0, 2).join(' ');
31
+ if (!(ssh2_1.utils.parseKey(publicKey) instanceof Error) && !(ssh2_1.utils.parseKey(generated.private) instanceof Error)) {
32
+ return { privateKey: generated.private, publicKey };
33
+ }
34
+ }
35
+ throw new Error('could not generate a readable ed25519 key');
36
+ }
37
+ /** @description `value` as a public key, or `null` when it is not exactly `<type> <base64>`. */
38
+ function parsePublicKey(value) {
39
+ const match = publicKeyPattern.exec(value);
40
+ if (match === null)
41
+ return null;
42
+ const blob = Buffer.from(match[2], 'base64');
43
+ return blob.length === 0 ? null : { type: match[1], blob };
44
+ }
45
+ /** @description Is `value` a public key of the type charness issues to runners and the hub — ed25519 — in the strict form? */
46
+ function checkIsEd25519PublicKey(value) {
47
+ return parsePublicKey(value)?.type === ed25519Type;
48
+ }
49
+ /** @description `SHA256:…`, the fingerprint `ssh-keygen -l` prints. */
50
+ function getPublicKeyFingerprint(publicKey) {
51
+ const parsed = parsePublicKey(publicKey);
52
+ if (parsed === null)
53
+ throw new Error('not a public key');
54
+ return `SHA256:${(0, crypto_1.createHash)('sha256').update(parsed.blob).digest('base64').replace(/=+$/, '')}`;
55
+ }
56
+ /** @description A random identifier (12 lowercase hex digits) safe in a file name, a shell word, an `authorized_keys` option and as the first word of an argument list. */
57
+ function createRandomId() {
58
+ return (0, crypto_1.randomBytes)(idByteLength).toString('hex');
59
+ }
60
+ //# sourceMappingURL=sshKeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sshKeys.js","sourceRoot":"","sources":["../../src/runners/sshKeys.ts"],"names":[],"mappings":";;AAmCA,wDASC;AAGD,wCAKC;AAGD,0DAEC;AAGD,0DAIC;AAGD,wCAEC;AArED,mCAAiD;AACjD,+BAA6B;AAE7B;;;;;GAKG;AAEH,MAAM,cAAc,GAAG,aAAa,CAAC;AACrC,MAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC,4DAA4D,cAAc,YAAY,CAAC,CAAC;AAC5H,M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CAAC,EAAE,IAAI,EAAE,CAAC;AAC7D,CAAC;AAED,8HAA8H;AAC9H,SAAgB,uBAAuB,CAAC,KAAa;IACnD,OAAO,cAAc,CAAC,KAAK,CAAC,EAAE,IAAI,KAAK,WAAW,CAAC;AACrD,CAAC;AAED,uEAAuE;AACvE,SAAgB,uBAAuB,CAAC,SAAiB;IACvD,MAAM,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IACzC,IAAI,MAAM,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACzD,OAAO,UAAU,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC;AAClG,CAAC;AAED,2KAA2K;AAC3K,SAAgB,cAAc;IAC5B,OAAO,IAAA,oBAAW,EAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @description A minimal, DETERMINISTIC tar writer (ustar): the same entries always give the same bytes, so the hash of the archive is
3
+ * a stable id of the package it carries (a system `tar` writes its own timestamps and ordering). Regular files only — a runner
4
+ * extracts the archive with the `tar` of its machine, which creates the folders on the way.
5
+ */
6
+ export interface TarEntry {
7
+ /** A relative path with `/` separators. */
8
+ path: string;
9
+ content: Buffer;
10
+ /** `0o755` for something that runs, else `0o644`. */
11
+ mode: number;
12
+ }
13
+ /** @description The ustar `name` and `prefix` fields for `entryPath`, or `null` when no `/` splits it into pieces that fit. */
14
+ export declare function splitTarPath(entryPath: string): {
15
+ name: string;
16
+ prefix: string;
17
+ } | null;
18
+ /** @description The archive of `entries`, in the order given, ended by the two empty blocks tar expects. */
19
+ export declare function createTarArchive(entries: readonly TarEntry[]): Buffer;
20
+ //# sourceMappingURL=tarArchive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tarArchive.d.ts","sourceRoot":"","sources":["../../src/runners/tarArchive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,MAAM,WAAW,QAAQ;IACvB,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;CACd;AAWD,+HAA+H;AAC/H,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQvF;AAwBD,4GAA4G;AAC5G,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,QAAQ,EAAE,GAAG,MAAM,CASrE"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ /**
3
+ * @description A minimal, DETERMINISTIC tar writer (ustar): the same entries always give the same bytes, so the hash of the archive is
4
+ * a stable id of the package it carries (a system `tar` writes its own timestamps and ordering). Regular files only — a runner
5
+ * extracts the archive with the `tar` of its machine, which creates the folders on the way.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.splitTarPath = splitTarPath;
9
+ exports.createTarArchive = createTarArchive;
10
+ const blockSize = 512;
11
+ /** 2000-01-01: a fixed, plausible timestamp (GNU tar warns about a 1970 one). */
12
+ const fixedModifiedTimeSeconds = 946684800;
13
+ const maxNameLength = 100;
14
+ const maxPrefixLength = 155;
15
+ const checksumFieldOffset = 148;
16
+ const checksumFieldLength = 8;
17
+ function writeText(header, offset, length, text) {
18
+ header.write(text, offset, length, 'utf8');
19
+ }
20
+ /** An octal number, zero-padded to `length - 1` digits and ended by a NUL. */
21
+ function writeOctal(header, offset, length, value) {
22
+ header.write(value.toString(8).padStart(length - 1, '0'), offset, length - 1, 'ascii');
23
+ }
24
+ /** @description The ustar `name` and `prefix` fields for `entryPath`, or `null` when no `/` splits it into pieces that fit. */
25
+ function splitTarPath(entryPath) {
26
+ if (Buffer.byteLength(entryPath) <= maxNameLength)
27
+ return { name: entryPath, prefix: '' };
28
+ for (let slash = entryPath.indexOf('/'); slash !== -1; slash = entryPath.indexOf('/', slash + 1)) {
29
+ const prefix = entryPath.slice(0, slash);
30
+ const name = entryPath.slice(slash + 1);
31
+ if (Buffer.byteLength(prefix) <= maxPrefixLength && Buffer.byteLength(name) <= maxNameLength)
32
+ return { name, prefix };
33
+ }
34
+ return null;
35
+ }
36
+ function buildHeader(entry) {
37
+ const split = splitTarPath(entry.path);
38
+ if (split === null)
39
+ throw new Error(`the path is too long for a tar header: ${entry.path}`);
40
+ const header = Buffer.alloc(blockSize);
41
+ writeText(header, 0, maxNameLength, split.name);
42
+ writeOctal(header, 100, 8, entry.mode);
43
+ writeOctal(header, 108, 8, 0);
44
+ writeOctal(header, 116, 8, 0);
45
+ writeOctal(header, 124, 12, entry.content.length);
46
+ writeOctal(header, 136, 12, fixedModifiedTimeSeconds);
47
+ header.fill(0x20, checksumFieldOffset, checksumFieldOffset + checksumFieldLength);
48
+ header.write('0', 156, 1, 'ascii');
49
+ header.write('ustar\0', 257, 6, 'ascii');
50
+ header.write('00', 263, 2, 'ascii');
51
+ writeText(header, 345, maxPrefixLength, split.prefix);
52
+ const checksum = header.reduce((sum, byte) => sum + byte, 0);
53
+ header.write(checksum.toString(8).padStart(6, '0'), checksumFieldOffset, 6, 'ascii');
54
+ header[checksumFieldOffset + 6] = 0;
55
+ header[checksumFieldOffset + 7] = 0x20;
56
+ return header;
57
+ }
58
+ /** @description The archive of `entries`, in the order given, ended by the two empty blocks tar expects. */
59
+ function createTarArchive(entries) {
60
+ const parts = [];
61
+ for (const entry of entries) {
62
+ parts.push(buildHeader(entry), entry.content);
63
+ const remainder = entry.content.length % blockSize;
64
+ if (remainder !== 0)
65
+ parts.push(Buffer.alloc(blockSize - remainder));
66
+ }
67
+ parts.push(Buffer.alloc(blockSize * 2));
68
+ return Buffer.concat(parts);
69
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CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"}
@@ -75,6 +75,11 @@ export declare const schedulerMcpBindRetryDelayMs = 500;
75
75
  export declare const schedulerMcpPendingCancellationTtlMs = 30000;
76
76
  /** Global memory bound shared by pending-cancellation and recent-completion tombstones. */
77
77
  export declare const schedulerMcpPendingCancellationMax = 1000;
78
+ /**
79
+ * Claude Code cuts a server's connect-time `instructions` that are longer than this: whatever comes last is lost, silently. The Telegram
80
+ * text is within a few hundred characters of it before the remote-run bullet, so the runner lines are fitted to the room that is left.
81
+ */
82
+ export declare const claudeCodeInstructionsMaxLength = 4096;
78
83
  /** What the `claude_profiles` tool asks the bot: the model, and for a resumed session the account it last ran on. */
79
84
  export interface ClaudeProfilesQuery {
80
85
  model: string | null;
@@ -91,8 +96,8 @@ export interface ClaudeProfilesQuery {
91
96
  export interface OptionalBotTools {
92
97
  isJiraAttachmentToolOffered: boolean;
93
98
  isTodoToolOffered: boolean;
94
- /** At least one runner is listed in `runners.json`: the instructions name `charness remote-run`. */
95
- isRemoteRunOffered: boolean;
99
+ /** One line per runner that is paired or listed in `runners.json` (`remoteRun/runnerSummary.ts`); none = the instructions do not mention `charness remote-run`. */
100
+ remoteRunRunnerLines: readonly string[];
96
101
  }
97
102
  /**
98
103
  * Connect-time `instructions` returned in the MCP `initialize` handshake — a
@@ -228,10 +233,11 @@ export interface SchedulerMcpDeps {
228
233
  */
229
234
  listClaudeProfiles?: (query: ClaudeProfilesQuery) => Promise<ClaudeProfilesReport>;
230
235
  /**
231
- * Is any runner for `charness remote-run` configured (`runners.json`, `remoteRun/runnersConfig.ts`)? Asked at every connect, so
232
- * adding the first runner shows in the next session's instructions; absent or false = the instructions do not mention it.
236
+ * One line per runner `charness remote-run` can use — paired or in `runners.json` (`remoteRun/runnerSummary.ts`): name, OS, what it could do
237
+ * when last probed. Asked at every connect, so a runner added, removed or paused shows in the next session's instructions; absent or empty =
238
+ * the instructions do not mention remote-run.
233
239
  */
234
- isRemoteRunOffered?: () => boolean;
240
+ getRemoteRunRunnerLines?: () => readonly string[];
235
241
  /**
236
242
  * Where the surface leaves one diagnostic line when it REFUSES a tool call for an unknown input key. The SDK checks
237
243
  * the input before any of the bot's code runs, so without this a client that adds a key of its own to every call
@@ -1 +1 @@
1
- {"version":3,"file":"mcpSurface.d.ts","sourceRoot":"","sources":["../../src/scheduler/mcpSurface.ts"],"names":[],"mappings":"AAKA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,oCAAoC,CAAC;AAE5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAmC,KAAK,UAAU,EAAmB,MAAM,eAAe,CAAC;AAGlG,OAAO,EAA+B,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AAQrC,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5D,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAuC,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGjH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;;;GAGG;AACH,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,qGAAqG;AACrG,eAAO,MAAM,gBAAgB,SAAS,CAAC;AAEvC,4EAA4E;AAC5E,eAAO,MAAM,0BAA0B,6BAA6B,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,iCAAi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,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.answerReplyToCommentIdsMaxCount = exports.schedulerMcpPendingCancellationMax = exports.schedulerMcpPendingCancellationTtlMs = exports.schedulerMcpBindRetryDelayMs = exports.schedulerMcpBindRetryCount = exports.legacySchedulerMcpClientIdHeader = exports.schedulerMcpClientIdHeader = exports.schedulerMcpPath = exports.defaultSchedulerMcpPort = void 0;
3
+ exports.answerReplyToCommentIdsMaxCount = exports.claudeCodeInstructionsMaxLength = exports.schedulerMcpPendingCancellationMax = exports.schedulerMcpPendingCancellationTtlMs = exports.schedulerMcpBindRetryDelayMs = exports.schedulerMcpBindRetryCount = exports.legacySchedulerMcpClientIdHeader = exports.schedulerMcpClientIdHeader = exports.schedulerMcpPath = exports.defaultSchedulerMcpPort = void 0;
4
4
  exports.buildMcpServerInstructions = buildMcpServerInstructions;
5
5
  exports.getSchedulerMcpPort = getSchedulerMcpPort;
6
6
  exports.resolveSchedulerMcpPort = resolveSchedulerMcpPort;
@@ -118,13 +118,34 @@ const mcpServerVersion = '1.0.0';
118
118
  /** The skill an orchestrating agent loads in a bot session, as each CLI names it. */
119
119
  const managerSkillInstruction = 'load the `charness-manager` skill (Claude Code lists it as `charness:charness-manager`) and follow it instead of any other manager skill';
120
120
  /** The instruction bullets that hold on every platform (the two platform-neutral tools). */
121
- const compactConversationInstruction = '• The user EXPLICITLY asks to compact/shrink/summarize this conversation\'s context → compact_conversation. Only on an explicit request, never on your own judgement.';
122
- const answerRequestInstruction = '• A message carries a "[Request <id> · from: …]" header → answer it through answer_request with that id: kind "final" with the full result at the end of your turn, "question" when you need the requester before you can go on (their reply arrives as a new request), "progress" for an interim note. You may call it several times; only question/final close the request. ' +
121
+ const compactConversationInstruction = '• The user EXPLICITLY asks to compact/shrink/summarize this conversation\'s context → compact_conversation. Never on your own judgement.';
122
+ const answerRequestInstruction = '• A message carries a "[Request <id> · from: …]" header → answer it through answer_request with that id: kind "final" with the full result at the end of your turn, "question" when you need the requester before you can go on (their reply arrives as a new request), "progress" for an interim note. Only question/final close the request. ' +
123
123
  answerStyle_1.answerStyleInstruction;
124
124
  /** The shared todo registry's bullet (D7) — Telegram topics and Jira issues publish alike. */
125
- const todoInstruction = '• BEFORE you start any task (fixes you found yourself included: a failing test, a leak) → todo_update adds it as inWork, naming the area concretely (files, tests). Check the returned board for overlap with other agents. Take the queue top-down; mark items done / dropped at once. A ticket you create in a tracker gets an item with its key in `ref`.';
126
- /** The `charness remote-run` bullet — present only while `runners.json` lists a runner, for Telegram topics and tracker issues alike. */
127
- const remoteRunInstruction = '• Heavy work (a test suite, a build, an e2e run) can run on a runner machine instead of this one → `charness remote-run runners` shows which runners are online with their CPU, RAM, disk, load and what each can do (android, ios, docker, playwright); then `charness remote-run [--needs <capability>] <command>` runs the command in a copy of this git project there and gives you its output, exit code and declared result files as if it ran here (edit files only here; an interrupt or tool timeout kills the remote job). Longer than your tool timeout: `charness remote-run --bg <command>` prints a job id, then run `charness remote-run wait <id>` in the background (it blocks until the job ends and exits with its code); `ls`, `status <id>`, `logs <id> -f`, `kill <id>` manage jobs.';
125
+ const todoInstruction = '• BEFORE you start any task (fixes you found yourself included: a failing test, a leak) → todo_update adds it as inWork, naming the area (files, tests). Check the returned board for overlap with other agents. Take the queue top-down; mark items done / dropped at once. A ticket you create in a tracker gets an item with its key in `ref`.';
126
+ /** The `charness remote-run` bullet — present only while a runner is paired or listed in `runners.json`, for Telegram topics and tracker issues alike. The CLI's own `--help` has the job commands. */
127
+ const remoteRunInstruction = '• Heavy work (test suite, build, e2e run) → send it to a runner, not this machine: `charness remote-run runners` lists them and what each can do; `charness remote-run [--needs android|ios|docker|playwright] <command>` runs it in a copy of this project and returns its output and exit code (edit files only here). Longer than your tool timeout: `charness remote-run --bg <command>`, then `charness remote-run wait <id>` in the background; `charness remote-run --help` lists the rest.';
128
+ /**
129
+ * Claude Code cuts a server's connect-time `instructions` that are longer than this: whatever comes last is lost, silently. The Telegram
130
+ * text is within a few hundred characters of it before the remote-run bullet, so the runner lines are fitted to the room that is left.
131
+ */
132
+ exports.claudeCodeInstructionsMaxLength = 4096;
133
+ /**
134
+ * The remote-run bullet with one line per runner under it (`mac — macOS 15.1, android, playwright`: the name, the OS, what it could do when
135
+ * last probed): the first `shownCount` runners, and «… and N more» for the rest. The lines are a snapshot taken at connect; `charness
136
+ * remote-run runners` has the live state. `shownCount` 0 gives the bullet alone.
137
+ */
138
+ function buildRemoteRunInstruction(runnerLines, shownCount) {
139
+ if (shownCount === 0)
140
+ return remoteRunInstruction;
141
+ const hiddenCount = runnerLines.length - shownCount;
142
+ return [
143
+ remoteRunInstruction,
144
+ ' Runners, as last seen:',
145
+ ...runnerLines.slice(0, shownCount).map((line) => ` – ${line}`),
146
+ ...(hiddenCount > 0 ? [` – … and ${hiddenCount} more`] : []),
147
+ ].join('\n');
148
+ }
128
149
  const orchestrationInstructionHead = '• You orchestrate detached workers (a `claude -p` / `opencode run` builder, reviewer, researcher) →';
129
150
  /** What the worker-watch recipe says once a tool is named: shared by both wordings of the Telegram bullet. */
130
151
  const workerWatchRecipeText = `its description has the recipe (checkCommand, cron, \`${workerWatch_1.workerWatchPinArgument}\`); never \`kill -0\` alone: it never fires on a hung worker.`;
@@ -141,30 +162,30 @@ function buildTelegramOrchestrationInstruction(isBotSkillsEnabled) {
141
162
  ? `${orchestrationInstructionHead} ${managerSkillInstruction}. Watch EACH worker with schedule_create — ${workerWatchRecipeText}`
142
163
  : `${orchestrationInstructionHead} schedule_create to watch EACH worker — ${workerWatchRecipeText}`;
143
164
  }
144
- const claudeProfilesInstruction = '• Before you start or resume a child `claude` process (a detached worker, reviewer, planner) → claude_profiles with the model you will launch: it lists the signed-in Claude accounts with their usage windows and names the one to run on (`recommended`: the account whose weekly limit resets soonest is spent first). A new child: no `currentProfile`; a resumed one: the profile it last ran on, plus `isStoppedByLimit: true` when it broke off on a usage limit. Launch the child with `CLAUDE_CONFIG_DIR=<its configDir>` in its environment (nothing when configDir is null); without it the child inherits YOUR account and drains the same limits. `recommended: null` → nothing is usable now: schedule one resume at `nextAvailable.at` (null too: tell the user, retry once in about 30 minutes).';
165
+ const claudeProfilesInstruction = '• Before you start or resume a child `claude` process (worker, reviewer, planner) → claude_profiles with the model you will launch, and start the child under the account it names (`CLAUDE_CONFIG_DIR=<configDir>`): without it the child inherits YOUR account and drains the same limits. The tool description has the rest (resuming, `recommended: null`).';
145
166
  /** @description Which optional tools `deps` offers. */
146
167
  function getOptionalBotTools(deps) {
147
168
  return {
148
169
  isJiraAttachmentToolOffered: deps.fetchJiraAttachment !== undefined,
149
170
  isTodoToolOffered: deps.todos !== undefined,
150
- isRemoteRunOffered: deps.isRemoteRunOffered?.() ?? false,
171
+ remoteRunRunnerLines: deps.getRemoteRunRunnerLines?.() ?? [],
151
172
  };
152
173
  }
153
- function buildTelegramInstructions(isTodoToolOffered, isRemoteRunOffered, isBotSkillsEnabled) {
174
+ function buildTelegramInstructions(isTodoToolOffered, remoteRunInstructionText, isBotSkillsEnabled) {
154
175
  return `This MCP lets the agent act on its own Telegram topic.
155
176
 
156
177
  When to use it:
157
- • The user asks to run/finish a plan or task LATER ("in 2h", "tomorrow 9am", "every weekday") → schedule_create. Put the work in \`prompt\`; the future run is a fresh session with no memory of this chat. Not CronCreate / ScheduleWakeup for anything that must happen: they live only in your process, which the bot stops after a long idle stretch, and die with it.
158
- • You produced a file/chart/screenshot/video to deliver → send_file_to_user. Videos MUST be H.264 .mp4 sent as video (never as_file/document, never .webm/.mov — those render as GIFs or don't play); transcode first if needed (the tool description has the ffmpeg recipe).
159
- • You want to deliver SEVERAL discrete messages (each as its own Telegram message, e.g. a per-item news digest) → send_messages_to_user. Each item can optionally attach ONE file/photo/video (text becomes its caption).
178
+ • The user asks to run/finish a plan or task LATER ("in 2h", "tomorrow 9am", "every weekday") → schedule_create. Put the work in \`prompt\`; the future run is a fresh session with no memory of this chat. Not CronCreate / ScheduleWakeup for anything that must happen: they die with your process, which the bot stops after a long idle stretch.
179
+ • You produced a file/chart/screenshot/video to deliver → send_file_to_user. Videos MUST be H.264 .mp4 sent as video (never as_file/document or .webm/.mov — those render as GIFs or don't play); transcode first if needed (recipe in the tool description).
180
+ • You want to deliver SEVERAL discrete messages (each its own message, e.g. a per-item news digest) → send_messages_to_user; an item may attach ONE file (the text becomes its caption).
160
181
  ${compactConversationInstruction}
161
182
  ${isTodoToolOffered ? `${todoInstruction}\n` : ''}• You need to review or remove scheduled jobs → schedule_list / schedule_cancel.
162
- • You need a watchdog — keep an eye on a service, process, build, deploy, disk, URL… → schedule_create with \`checkCommand\` (cron). The bot runs the command in this folder on schedule, stays silent while it exits 0, and on the first failure pins an alert and wakes you with \`prompt\` + the exit code and output tail. Checks survive bot restarts and crashes. NEVER build your own watcher (a background loop, nohup, a sleep loop, a tmux pane, a shell crontab): it dies with your session or a restart and then fails silently.
183
+ • You need a watchdog — keep an eye on a service, build, deploy, disk, URL… → schedule_create with \`checkCommand\` (cron): the bot runs it in this folder, stays silent while it exits 0, and on the first failure pins an alert and wakes you with \`prompt\` + the exit code and output tail. Checks survive restarts and crashes. NEVER build your own watcher (background loop, nohup, sleep loop, tmux pane, shell crontab): it dies with your session or a restart, silently.
163
184
  ${buildTelegramOrchestrationInstruction(isBotSkillsEnabled)}
164
- ${answerRequestInstruction} The requester may not see your plain text, so anything they must read goes through answer_request. Your plain text is relayed into the topic too, so after answer_request end the turn WITHOUT a plain-text recap of what you answered — it would show up twice.
165
- ${claudeProfilesInstruction}${isRemoteRunOffered ? `\n${remoteRunInstruction}` : ''}
185
+ ${answerRequestInstruction} The requester may not see your plain text: anything they must read goes through answer_request — yet your plain text is relayed into the topic too, so end the turn WITHOUT a recap of what you answered (it would show twice).
186
+ ${claudeProfilesInstruction}${remoteRunInstructionText === null ? '' : `\n${remoteRunInstructionText}`}
166
187
 
167
- Each tool's own description has the exact argument recipe (one-shot vs cron vs N-times, checks).`;
188
+ Tool descriptions hold the argument recipes.`;
168
189
  }
169
190
  /** What a Jira session's instructions add: the tool that reaches the issue's original files (C10). */
170
191
  const jiraAttachmentInstruction = '• The issue lists a file (an attachment id in the attachments list, or in a placeholder such as "[image: shot.png — attachment 10234]") you need to look at → jira_get_attachment with that id; it saves the original file and returns its path.';
@@ -197,16 +218,28 @@ Each tool's own description has the exact argument recipe.`;
197
218
  * (`isBotSkillsEnabled`, `/bot_skills`) the orchestration bullet no longer tells it to load `charness-manager`.
198
219
  */
199
220
  function buildMcpServerInstructions(platform, offered, isBotSkillsEnabled) {
200
- if (platform === 'telegram')
201
- return buildTelegramInstructions(offered.isTodoToolOffered, offered.isRemoteRunOffered, isBotSkillsEnabled);
202
- const remoteRunInstructions = offered.isRemoteRunOffered ? [remoteRunInstruction] : [];
203
- if (platform !== 'jira')
204
- return buildTrackerInstructions(remoteRunInstructions, isBotSkillsEnabled);
205
- return buildTrackerInstructions([
206
- ...(offered.isJiraAttachmentToolOffered ? [jiraAttachmentInstruction] : []),
207
- ...(offered.isTodoToolOffered ? [todoInstruction] : []),
208
- ...remoteRunInstructions,
209
- ], isBotSkillsEnabled);
221
+ const render = (remoteRunInstructionText) => {
222
+ if (platform === 'telegram')
223
+ return buildTelegramInstructions(offered.isTodoToolOffered, remoteRunInstructionText, isBotSkillsEnabled);
224
+ const remoteRunInstructions = remoteRunInstructionText === null ? [] : [remoteRunInstructionText];
225
+ if (platform !== 'jira')
226
+ return buildTrackerInstructions(remoteRunInstructions, isBotSkillsEnabled);
227
+ return buildTrackerInstructions([
228
+ ...(offered.isJiraAttachmentToolOffered ? [jiraAttachmentInstruction] : []),
229
+ ...(offered.isTodoToolOffered ? [todoInstruction] : []),
230
+ ...remoteRunInstructions,
231
+ ], isBotSkillsEnabled);
232
+ };
233
+ const runnerCount = offered.remoteRunRunnerLines.length;
234
+ if (runnerCount === 0)
235
+ return render(null);
236
+ // As many runners as the room under Claude Code's cap leaves; the bullet itself always stays (its `runners` command is the full list).
237
+ for (let shownCount = runnerCount; shownCount > 0; shownCount -= 1) {
238
+ const text = render(buildRemoteRunInstruction(offered.remoteRunRunnerLines, shownCount));
239
+ if (text.length <= exports.claudeCodeInstructionsMaxLength)
240
+ return text;
241
+ }
242
+ return render(buildRemoteRunInstruction(offered.remoteRunRunnerLines, 0));
210
243
  }
211
244
  /** Max characters of a free-text job name / prompt accepted by a tool (defensive bound). */
212
245
  const maxNameLength = 200;