charness 3.9.1 → 3.10.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 (374) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/DEVELOPMENT.md +4 -1
  3. package/SETUP.md +6 -4
  4. package/agent-plugin/README.md +2 -2
  5. package/agent-plugin/skills/charness-delegate-opencode/SKILL.md +1 -1
  6. package/agent-plugin/skills/charness-manager/SKILL.md +8 -4
  7. package/dist/bot.d.ts +27 -18
  8. package/dist/bot.d.ts.map +1 -1
  9. package/dist/bot.js +217 -99
  10. package/dist/bot.js.map +1 -1
  11. package/dist/connectors/jira/adf.d.ts.map +1 -1
  12. package/dist/connectors/jira/adf.js +2 -3
  13. package/dist/connectors/jira/adf.js.map +1 -1
  14. package/dist/connectors/telegram/commands/botCore.d.ts +16 -0
  15. package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
  16. package/dist/connectors/telegram/commands/runners.d.ts +10 -1
  17. package/dist/connectors/telegram/commands/runners.d.ts.map +1 -1
  18. package/dist/connectors/telegram/commands/runners.js +75 -13
  19. package/dist/connectors/telegram/commands/runners.js.map +1 -1
  20. package/dist/connectors/telegram/runnerLinkNotices.d.ts +24 -0
  21. package/dist/connectors/telegram/runnerLinkNotices.d.ts.map +1 -0
  22. package/dist/connectors/telegram/runnerLinkNotices.js +95 -0
  23. package/dist/connectors/telegram/runnerLinkNotices.js.map +1 -0
  24. package/dist/connectors/telegram/runnerPairingMessages.d.ts +9 -0
  25. package/dist/connectors/telegram/runnerPairingMessages.d.ts.map +1 -1
  26. package/dist/connectors/telegram/runnerPairingMessages.js +17 -1
  27. package/dist/connectors/telegram/runnerPairingMessages.js.map +1 -1
  28. package/dist/i18n/de.d.ts.map +1 -1
  29. package/dist/i18n/de.js +19 -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 +19 -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 +19 -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 +19 -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 +19 -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 +19 -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 +19 -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 +19 -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 +19 -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 +19 -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 +19 -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 +19 -0
  63. package/dist/i18n/zh.js.map +1 -1
  64. package/dist/outputTrace.d.ts.map +1 -1
  65. package/dist/outputTrace.js +2 -9
  66. package/dist/outputTrace.js.map +1 -1
  67. package/dist/rateLimiter.d.ts +3 -1
  68. package/dist/rateLimiter.d.ts.map +1 -1
  69. package/dist/rateLimiter.js +3 -1
  70. package/dist/rateLimiter.js.map +1 -1
  71. package/dist/remoteRun/cliArgs.d.ts +6 -1
  72. package/dist/remoteRun/cliArgs.d.ts.map +1 -1
  73. package/dist/remoteRun/cliArgs.js +39 -2
  74. package/dist/remoteRun/cliArgs.js.map +1 -1
  75. package/dist/remoteRun/exitCodes.d.ts +12 -2
  76. package/dist/remoteRun/exitCodes.d.ts.map +1 -1
  77. package/dist/remoteRun/exitCodes.js +3 -0
  78. package/dist/remoteRun/exitCodes.js.map +1 -1
  79. package/dist/remoteRun/foreground.d.ts +13 -0
  80. package/dist/remoteRun/foreground.d.ts.map +1 -1
  81. package/dist/remoteRun/foreground.js +15 -2
  82. package/dist/remoteRun/foreground.js.map +1 -1
  83. package/dist/remoteRun/heldBackNotice.d.ts +7 -0
  84. package/dist/remoteRun/heldBackNotice.d.ts.map +1 -0
  85. package/dist/remoteRun/heldBackNotice.js +92 -0
  86. package/dist/remoteRun/heldBackNotice.js.map +1 -0
  87. package/dist/remoteRun/interrupts.d.ts +6 -2
  88. package/dist/remoteRun/interrupts.d.ts.map +1 -1
  89. package/dist/remoteRun/interrupts.js +18 -3
  90. package/dist/remoteRun/interrupts.js.map +1 -1
  91. package/dist/remoteRun/leaseTiming.d.ts +1 -2
  92. package/dist/remoteRun/leaseTiming.d.ts.map +1 -1
  93. package/dist/remoteRun/leaseTiming.js +3 -17
  94. package/dist/remoteRun/leaseTiming.js.map +1 -1
  95. package/dist/remoteRun/output.d.ts +16 -1
  96. package/dist/remoteRun/output.d.ts.map +1 -1
  97. package/dist/remoteRun/output.js +28 -2
  98. package/dist/remoteRun/output.js.map +1 -1
  99. package/dist/remoteRun/probe.d.ts +40 -2
  100. package/dist/remoteRun/probe.d.ts.map +1 -1
  101. package/dist/remoteRun/probe.js +58 -2
  102. package/dist/remoteRun/probe.js.map +1 -1
  103. package/dist/remoteRun/project.d.ts +2 -2
  104. package/dist/remoteRun/project.d.ts.map +1 -1
  105. package/dist/remoteRun/project.js +5 -4
  106. package/dist/remoteRun/project.js.map +1 -1
  107. package/dist/remoteRun/remoteRunCli.d.ts +1 -1
  108. package/dist/remoteRun/remoteRunCli.d.ts.map +1 -1
  109. package/dist/remoteRun/remoteRunCli.js +6 -3
  110. package/dist/remoteRun/remoteRunCli.js.map +1 -1
  111. package/dist/remoteRun/runnerWait.d.ts +3 -3
  112. package/dist/remoteRun/runnerWait.d.ts.map +1 -1
  113. package/dist/remoteRun/runnerWait.js +12 -6
  114. package/dist/remoteRun/runnerWait.js.map +1 -1
  115. package/dist/remoteRun/runnerWaitTiming.d.ts +1 -1
  116. package/dist/remoteRun/runnerWaitTiming.d.ts.map +1 -1
  117. package/dist/remoteRun/runnerWaitTiming.js +3 -16
  118. package/dist/remoteRun/runnerWaitTiming.js.map +1 -1
  119. package/dist/remoteRun/runners.d.ts +16 -3
  120. package/dist/remoteRun/runners.d.ts.map +1 -1
  121. package/dist/remoteRun/runners.js +42 -4
  122. package/dist/remoteRun/runners.js.map +1 -1
  123. package/dist/remoteRun/sendPlan.d.ts +11 -1
  124. package/dist/remoteRun/sendPlan.d.ts.map +1 -1
  125. package/dist/remoteRun/sendPlan.js +29 -5
  126. package/dist/remoteRun/sendPlan.js.map +1 -1
  127. package/dist/remoteRun/submit.d.ts.map +1 -1
  128. package/dist/remoteRun/submit.js +13 -3
  129. package/dist/remoteRun/submit.js.map +1 -1
  130. package/dist/runnerUtility/adminService.d.ts +30 -2
  131. package/dist/runnerUtility/adminService.d.ts.map +1 -1
  132. package/dist/runnerUtility/adminService.js +104 -6
  133. package/dist/runnerUtility/adminService.js.map +1 -1
  134. package/dist/runnerUtility/appInstall.d.ts +13 -4
  135. package/dist/runnerUtility/appInstall.d.ts.map +1 -1
  136. package/dist/runnerUtility/appInstall.js +46 -19
  137. package/dist/runnerUtility/appInstall.js.map +1 -1
  138. package/dist/runnerUtility/appUpdate.js +1 -1
  139. package/dist/runnerUtility/appUpdate.js.map +1 -1
  140. package/dist/runnerUtility/execEnv.d.ts +2 -0
  141. package/dist/runnerUtility/execEnv.d.ts.map +1 -1
  142. package/dist/runnerUtility/execEnv.js +6 -2
  143. package/dist/runnerUtility/execEnv.js.map +1 -1
  144. package/dist/runnerUtility/guiAgent.d.ts +126 -0
  145. package/dist/runnerUtility/guiAgent.d.ts.map +1 -0
  146. package/dist/runnerUtility/guiAgent.js +591 -0
  147. package/dist/runnerUtility/guiAgent.js.map +1 -0
  148. package/dist/runnerUtility/guiAgentHeal.d.ts +128 -0
  149. package/dist/runnerUtility/guiAgentHeal.d.ts.map +1 -0
  150. package/dist/runnerUtility/guiAgentHeal.js +284 -0
  151. package/dist/runnerUtility/guiAgentHeal.js.map +1 -0
  152. package/dist/runnerUtility/homeFolders.d.ts +33 -0
  153. package/dist/runnerUtility/homeFolders.d.ts.map +1 -0
  154. package/dist/runnerUtility/homeFolders.js +158 -0
  155. package/dist/runnerUtility/homeFolders.js.map +1 -0
  156. package/dist/runnerUtility/hubClient.d.ts +12 -2
  157. package/dist/runnerUtility/hubClient.d.ts.map +1 -1
  158. package/dist/runnerUtility/hubClient.js +24 -3
  159. package/dist/runnerUtility/hubClient.js.map +1 -1
  160. package/dist/runnerUtility/iosCheck.d.ts +7 -1
  161. package/dist/runnerUtility/iosCheck.d.ts.map +1 -1
  162. package/dist/runnerUtility/iosCheck.js +14 -5
  163. package/dist/runnerUtility/iosCheck.js.map +1 -1
  164. package/dist/runnerUtility/isolatedCommand.d.ts +33 -0
  165. package/dist/runnerUtility/isolatedCommand.d.ts.map +1 -0
  166. package/dist/runnerUtility/isolatedCommand.js +139 -0
  167. package/dist/runnerUtility/isolatedCommand.js.map +1 -0
  168. package/dist/runnerUtility/keepAwake.d.ts +67 -0
  169. package/dist/runnerUtility/keepAwake.d.ts.map +1 -0
  170. package/dist/runnerUtility/keepAwake.js +211 -0
  171. package/dist/runnerUtility/keepAwake.js.map +1 -0
  172. package/dist/runnerUtility/lidPollTiming.d.ts +11 -0
  173. package/dist/runnerUtility/lidPollTiming.d.ts.map +1 -0
  174. package/dist/runnerUtility/lidPollTiming.js +18 -0
  175. package/dist/runnerUtility/lidPollTiming.js.map +1 -0
  176. package/dist/runnerUtility/lidState.d.ts +57 -0
  177. package/dist/runnerUtility/lidState.d.ts.map +1 -0
  178. package/dist/runnerUtility/lidState.js +195 -0
  179. package/dist/runnerUtility/lidState.js.map +1 -0
  180. package/dist/runnerUtility/linkLoop.d.ts +5 -0
  181. package/dist/runnerUtility/linkLoop.d.ts.map +1 -1
  182. package/dist/runnerUtility/linkLoop.js +37 -1
  183. package/dist/runnerUtility/linkLoop.js.map +1 -1
  184. package/dist/runnerUtility/packageManagerShims.d.ts +44 -0
  185. package/dist/runnerUtility/packageManagerShims.d.ts.map +1 -0
  186. package/dist/runnerUtility/packageManagerShims.js +130 -0
  187. package/dist/runnerUtility/packageManagerShims.js.map +1 -0
  188. package/dist/runnerUtility/progress.d.ts +43 -0
  189. package/dist/runnerUtility/progress.d.ts.map +1 -0
  190. package/dist/runnerUtility/progress.js +78 -0
  191. package/dist/runnerUtility/progress.js.map +1 -0
  192. package/dist/runnerUtility/pueueDaemon.d.ts +8 -4
  193. package/dist/runnerUtility/pueueDaemon.d.ts.map +1 -1
  194. package/dist/runnerUtility/pueueDaemon.js +12 -7
  195. package/dist/runnerUtility/pueueDaemon.js.map +1 -1
  196. package/dist/runnerUtility/rootServiceCli.d.ts +23 -3
  197. package/dist/runnerUtility/rootServiceCli.d.ts.map +1 -1
  198. package/dist/runnerUtility/rootServiceCli.js +56 -10
  199. package/dist/runnerUtility/rootServiceCli.js.map +1 -1
  200. package/dist/runnerUtility/runnerCli.d.ts +1 -0
  201. package/dist/runnerUtility/runnerCli.d.ts.map +1 -1
  202. package/dist/runnerUtility/runnerCli.js +14 -7
  203. package/dist/runnerUtility/runnerCli.js.map +1 -1
  204. package/dist/runnerUtility/runnerCommands.d.ts +45 -0
  205. package/dist/runnerUtility/runnerCommands.d.ts.map +1 -1
  206. package/dist/runnerUtility/runnerCommands.js +188 -21
  207. package/dist/runnerUtility/runnerCommands.js.map +1 -1
  208. package/dist/runnerUtility/runnerHome.d.ts +8 -0
  209. package/dist/runnerUtility/runnerHome.d.ts.map +1 -1
  210. package/dist/runnerUtility/runnerHome.js +7 -0
  211. package/dist/runnerUtility/runnerHome.js.map +1 -1
  212. package/dist/runnerUtility/serviceCommon.d.ts +4 -0
  213. package/dist/runnerUtility/serviceCommon.d.ts.map +1 -1
  214. package/dist/runnerUtility/serviceCommon.js +8 -1
  215. package/dist/runnerUtility/serviceCommon.js.map +1 -1
  216. package/dist/runnerUtility/serviceManager.d.ts +5 -2
  217. package/dist/runnerUtility/serviceManager.d.ts.map +1 -1
  218. package/dist/runnerUtility/serviceManager.js +40 -17
  219. package/dist/runnerUtility/serviceManager.js.map +1 -1
  220. package/dist/runnerUtility/serviceUnits.d.ts +11 -0
  221. package/dist/runnerUtility/serviceUnits.d.ts.map +1 -1
  222. package/dist/runnerUtility/serviceUnits.js +8 -2
  223. package/dist/runnerUtility/serviceUnits.js.map +1 -1
  224. package/dist/runnerUtility/simulatorSilencer.d.ts +55 -0
  225. package/dist/runnerUtility/simulatorSilencer.d.ts.map +1 -0
  226. package/dist/runnerUtility/simulatorSilencer.js +203 -0
  227. package/dist/runnerUtility/simulatorSilencer.js.map +1 -0
  228. package/dist/runnerUtility/stopSignals.d.ts +10 -0
  229. package/dist/runnerUtility/stopSignals.d.ts.map +1 -0
  230. package/dist/runnerUtility/stopSignals.js +27 -0
  231. package/dist/runnerUtility/stopSignals.js.map +1 -0
  232. package/dist/runnerUtility/versionPollTiming.d.ts +2 -3
  233. package/dist/runnerUtility/versionPollTiming.d.ts.map +1 -1
  234. package/dist/runnerUtility/versionPollTiming.js +4 -18
  235. package/dist/runnerUtility/versionPollTiming.js.map +1 -1
  236. package/dist/runners/bootstrapLine.d.ts.map +1 -1
  237. package/dist/runners/bootstrapLine.js +35 -19
  238. package/dist/runners/bootstrapLine.js.map +1 -1
  239. package/dist/runners/gate.d.ts.map +1 -1
  240. package/dist/runners/gate.js +28 -1
  241. package/dist/runners/gate.js.map +1 -1
  242. package/dist/runners/gateLink.d.ts +7 -0
  243. package/dist/runners/gateLink.d.ts.map +1 -1
  244. package/dist/runners/gateLink.js +36 -3
  245. package/dist/runners/gateLink.js.map +1 -1
  246. package/dist/runners/gateProtocol.d.ts +37 -2
  247. package/dist/runners/gateProtocol.d.ts.map +1 -1
  248. package/dist/runners/gateProtocol.js +45 -4
  249. package/dist/runners/gateProtocol.js.map +1 -1
  250. package/dist/runners/hubPackage.d.ts +2 -1
  251. package/dist/runners/hubPackage.d.ts.map +1 -1
  252. package/dist/runners/hubPackage.js +32 -11
  253. package/dist/runners/hubPackage.js.map +1 -1
  254. package/dist/runners/hubPairing.d.ts +1 -1
  255. package/dist/runners/hubPairing.d.ts.map +1 -1
  256. package/dist/runners/hubPairing.js +8 -1
  257. package/dist/runners/hubPairing.js.map +1 -1
  258. package/dist/runners/hubPaths.d.ts +2 -0
  259. package/dist/runners/hubPaths.d.ts.map +1 -1
  260. package/dist/runners/hubPaths.js +1 -1
  261. package/dist/runners/hubPaths.js.map +1 -1
  262. package/dist/runners/linkConcern.d.ts +75 -0
  263. package/dist/runners/linkConcern.d.ts.map +1 -0
  264. package/dist/runners/linkConcern.js +85 -0
  265. package/dist/runners/linkConcern.js.map +1 -0
  266. package/dist/runners/linkControl.d.ts +25 -1
  267. package/dist/runners/linkControl.d.ts.map +1 -1
  268. package/dist/runners/linkControl.js +46 -4
  269. package/dist/runners/linkControl.js.map +1 -1
  270. package/dist/runners/pairingTiming.d.ts +2 -3
  271. package/dist/runners/pairingTiming.d.ts.map +1 -1
  272. package/dist/runners/pairingTiming.js +4 -18
  273. package/dist/runners/pairingTiming.js.map +1 -1
  274. package/dist/runners/runnerLock.d.ts +112 -0
  275. package/dist/runners/runnerLock.d.ts.map +1 -0
  276. package/dist/runners/runnerLock.js +292 -0
  277. package/dist/runners/runnerLock.js.map +1 -0
  278. package/dist/runners/runnersCli.d.ts +6 -3
  279. package/dist/runners/runnersCli.d.ts.map +1 -1
  280. package/dist/runners/runnersCli.js +33 -6
  281. package/dist/runners/runnersCli.js.map +1 -1
  282. package/dist/runners/runnersList.d.ts +3 -3
  283. package/dist/runners/runnersList.d.ts.map +1 -1
  284. package/dist/runners/runnersList.js +9 -2
  285. package/dist/runners/runnersList.js.map +1 -1
  286. package/dist/runners/runnersOverview.d.ts +29 -3
  287. package/dist/runners/runnersOverview.d.ts.map +1 -1
  288. package/dist/runners/runnersOverview.js +71 -6
  289. package/dist/runners/runnersOverview.js.map +1 -1
  290. package/dist/runners/serviceRemoval.d.ts +43 -0
  291. package/dist/runners/serviceRemoval.d.ts.map +1 -0
  292. package/dist/runners/serviceRemoval.js +114 -0
  293. package/dist/runners/serviceRemoval.js.map +1 -0
  294. package/dist/scheduler/checkStatus.d.ts +78 -0
  295. package/dist/scheduler/checkStatus.d.ts.map +1 -0
  296. package/dist/scheduler/checkStatus.js +122 -0
  297. package/dist/scheduler/checkStatus.js.map +1 -0
  298. package/dist/scheduler/delivery.d.ts +27 -1
  299. package/dist/scheduler/delivery.d.ts.map +1 -1
  300. package/dist/scheduler/delivery.js +83 -6
  301. package/dist/scheduler/delivery.js.map +1 -1
  302. package/dist/scheduler/mcpSurface.d.ts +2 -0
  303. package/dist/scheduler/mcpSurface.d.ts.map +1 -1
  304. package/dist/scheduler/mcpSurface.js +62 -10
  305. package/dist/scheduler/mcpSurface.js.map +1 -1
  306. package/dist/scheduler/store.d.ts +16 -1
  307. package/dist/scheduler/store.d.ts.map +1 -1
  308. package/dist/scheduler/store.js +33 -0
  309. package/dist/scheduler/store.js.map +1 -1
  310. package/dist/scheduler/types.d.ts +22 -0
  311. package/dist/scheduler/types.d.ts.map +1 -1
  312. package/dist/scheduler/unbindPause.d.ts +27 -0
  313. package/dist/scheduler/unbindPause.d.ts.map +1 -0
  314. package/dist/scheduler/unbindPause.js +21 -0
  315. package/dist/scheduler/unbindPause.js.map +1 -0
  316. package/dist/scheduler/workerActivity.d.ts +25 -0
  317. package/dist/scheduler/workerActivity.d.ts.map +1 -0
  318. package/dist/scheduler/workerActivity.js +195 -0
  319. package/dist/scheduler/workerActivity.js.map +1 -0
  320. package/dist/scheduler/workerWatch.d.ts +14 -2
  321. package/dist/scheduler/workerWatch.d.ts.map +1 -1
  322. package/dist/scheduler/workerWatch.js +15 -3
  323. package/dist/scheduler/workerWatch.js.map +1 -1
  324. package/dist/state.d.ts +8 -0
  325. package/dist/state.d.ts.map +1 -1
  326. package/dist/state.js +30 -0
  327. package/dist/state.js.map +1 -1
  328. package/dist/stt/sttRuntime.d.ts.map +1 -1
  329. package/dist/stt/sttRuntime.js +8 -1
  330. package/dist/stt/sttRuntime.js.map +1 -1
  331. package/dist/stt/sttSettings.d.ts +56 -6
  332. package/dist/stt/sttSettings.d.ts.map +1 -1
  333. package/dist/stt/sttSettings.js +128 -7
  334. package/dist/stt/sttSettings.js.map +1 -1
  335. package/dist/stt/sttSidecarOwner.d.ts +13 -5
  336. package/dist/stt/sttSidecarOwner.d.ts.map +1 -1
  337. package/dist/stt/sttSidecarOwner.js +72 -31
  338. package/dist/stt/sttSidecarOwner.js.map +1 -1
  339. package/dist/stt/transcribeChain.d.ts +23 -1
  340. package/dist/stt/transcribeChain.d.ts.map +1 -1
  341. package/dist/stt/transcribeChain.js +59 -4
  342. package/dist/stt/transcribeChain.js.map +1 -1
  343. package/dist/testTimings.d.ts +4 -2
  344. package/dist/testTimings.d.ts.map +1 -1
  345. package/dist/testTimings.js +7 -1
  346. package/dist/testTimings.js.map +1 -1
  347. package/dist/testTimingsSeam.d.ts +10 -0
  348. package/dist/testTimingsSeam.d.ts.map +1 -0
  349. package/dist/testTimingsSeam.js +29 -0
  350. package/dist/testTimingsSeam.js.map +1 -0
  351. package/dist/utils/runnersScreenPlan.d.ts +14 -0
  352. package/dist/utils/runnersScreenPlan.d.ts.map +1 -1
  353. package/dist/utils/runnersScreenPlan.js +49 -5
  354. package/dist/utils/runnersScreenPlan.js.map +1 -1
  355. package/dist/utils/surrogateSafeCut.d.ts +14 -0
  356. package/dist/utils/surrogateSafeCut.d.ts.map +1 -0
  357. package/dist/utils/surrogateSafeCut.js +30 -0
  358. package/dist/utils/surrogateSafeCut.js.map +1 -0
  359. package/dist/utils/telegramError.d.ts +7 -0
  360. package/dist/utils/telegramError.d.ts.map +1 -1
  361. package/dist/utils/telegramError.js +15 -0
  362. package/dist/utils/telegramError.js.map +1 -1
  363. package/dist/utils/transientFrames.d.ts +51 -6
  364. package/dist/utils/transientFrames.d.ts.map +1 -1
  365. package/dist/utils/transientFrames.js +52 -2
  366. package/dist/utils/transientFrames.js.map +1 -1
  367. package/dist/voiceProgressNote.d.ts +73 -0
  368. package/dist/voiceProgressNote.d.ts.map +1 -0
  369. package/dist/voiceProgressNote.js +142 -0
  370. package/dist/voiceProgressNote.js.map +1 -0
  371. package/package.json +4 -1
  372. package/remoteRun/pickNode.sh +65 -0
  373. package/remoteRun/runner-package-lock.json +59 -0
  374. package/remoteRun/runner.sh +304 -6
@@ -1 +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;AASD,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"}
1
+ {"version":3,"file":"runnersOverview.d.ts","sourceRoot":"","sources":["../../src/runners/runnersOverview.ts"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defineProperty(exports, "__esModule", { value: true });
3
+ exports.probeRetryAfterMs = exports.staleRefreshDeadlineMs = void 0;
3
4
  exports.readRunnersOverview = readRunnersOverview;
4
5
  exports.probeRunnersOverview = probeRunnersOverview;
6
+ exports.refreshStaleSnapshots = refreshStaleSnapshots;
5
7
  const pairedRunners_1 = require("../remoteRun/pairedRunners");
6
8
  const runners_1 = require("../remoteRun/runners");
7
9
  const runnerClient_1 = require("../remoteRun/runnerClient");
8
10
  const ssh_1 = require("../remoteRun/ssh");
9
11
  const hubRegistry_1 = require("./hubRegistry");
10
12
  const linkControl_1 = require("./linkControl");
11
- async function readEntry(ctx, runner, cacheDir) {
13
+ /**
14
+ * @description What the `/runners` screen shows, read in two steps so it can open at once: {@link readRunnersOverview} is the registry,
15
+ * the links (does the socket accept?) and the last snapshot each machine left — no ssh, milliseconds — and
16
+ * {@link probeRunnersOverview} asks the machines that are online what they are like right now (one shared 20 s deadline, the phase-1
17
+ * probe), keeping the snapshot of a machine that does not answer.
18
+ */
19
+ /** A one-shot listing is a quick look: a machine that does not answer within this is shown as it was last known (the screen's own probe waits longer). */
20
+ exports.staleRefreshDeadlineMs = 8 * 1000;
21
+ /** A machine that did not answer a listing is not asked again by one for this long, unless its link began anew — a silent machine must not cost a wait at every listing. */
22
+ exports.probeRetryAfterMs = 10 * 60 * 1000;
23
+ async function readEntry(ctx, runner, cacheDir, nowMs) {
12
24
  const status = await (0, linkControl_1.getRunnerLinkStatus)(ctx.dir, runner.id);
13
25
  // Only a report taken since this machine was paired is its own: its name may have belonged to a machine that was removed.
14
26
  const snapshot = (0, runners_1.readLastProbe)(cacheDir, runner.name, runner.pairedAtMs);
15
- return { runner, isOnline: status.isOnline, lastSeenMs: status.lastSeenMs ?? snapshot?.seenAtMs ?? null, probe: snapshot?.probe ?? null };
27
+ const failure = (0, runners_1.readProbeFailure)(cacheDir, runner.name, runner.pairedAtMs);
28
+ const isRecentlySilent = failure !== null && failure.linkSinceMs === status.sinceMs && nowMs - failure.attemptedAtMs < exports.probeRetryAfterMs;
29
+ const isReportOutOfDate = status.isOnline && (snapshot === null || (status.sinceMs !== null && snapshot.seenAtMs < status.sinceMs));
30
+ return {
31
+ runner,
32
+ isOnline: status.isOnline,
33
+ lastSeenMs: status.lastSeenMs ?? snapshot?.seenAtMs ?? null,
34
+ probe: snapshot?.probe ?? null,
35
+ isSnapshotStale: isReportOutOfDate && !isRecentlySilent,
36
+ isReportDoubtful: isReportOutOfDate,
37
+ linkSinceMs: status.sinceMs,
38
+ linkConcern: status.concern,
39
+ isLidClosed: status.isOnline && status.isLidClosed,
40
+ };
16
41
  }
17
42
  /** @description The overview without any ssh call: the registry, which links are up, the last snapshots. */
18
43
  async function readRunnersOverview(ctx, cacheDir, nowMs) {
19
44
  const paired = (0, hubRegistry_1.readPairedFile)(ctx.dir);
20
45
  return {
21
46
  revision: paired.rev,
22
- entries: await Promise.all(paired.runners.map((runner) => readEntry(ctx, runner, cacheDir))),
47
+ entries: await Promise.all(paired.runners.map((runner) => readEntry(ctx, runner, cacheDir, nowMs))),
23
48
  openPairingExpiries: (0, hubRegistry_1.readPendingFile)(ctx.dir).pending.filter((pairing) => pairing.expiresAtMs > nowMs).map((pairing) => pairing.expiresAtMs),
24
49
  };
25
50
  }
@@ -28,11 +53,14 @@ function applyReport(entry, report) {
28
53
  return entry;
29
54
  if (report.status === 'online')
30
55
  return { ...entry, probe: report.probe };
56
+ // Linked, but its Mac's lid is shut: it was not asked, so what is shown is the snapshot the entry already holds (a fresh one would pass for an answer).
57
+ if (report.status === 'lid-closed')
58
+ return { ...entry, isLidClosed: true, probe: entry.probe ?? report.lastProbe };
31
59
  // It answered the socket probe but not the ssh one: it is shown as it was, offline.
32
60
  return { ...entry, isOnline: false, lastSeenMs: report.lastSeenAtMs ?? entry.lastSeenMs, probe: report.lastProbe ?? entry.probe };
33
61
  }
34
- /** @description `overview` with the machines that are online asked for their live state. Offline ones are not called. */
35
- async function probeRunnersOverview(ctx, overview, cacheDir, nowMs) {
62
+ /** @description `overview` with the machines that are online asked for their live state, all under one `deadlineMs`. Offline ones are not called. */
63
+ async function probeRunnersOverview(ctx, overview, cacheDir, nowMs, deadlineMs = runners_1.probeAllTimeoutMs) {
36
64
  const hub = { hubDir: ctx.dir, nodePath: ctx.nodePath, cliPath: ctx.cliPath };
37
65
  const clients = overview.entries
38
66
  .filter((entry) => entry.isOnline)
@@ -50,7 +78,44 @@ async function probeRunnersOverview(ctx, overview, cacheDir, nowMs) {
50
78
  if (clients.length === 0)
51
79
  return overview;
52
80
  (0, ssh_1.ensureRemoteRunCacheDir)(cacheDir);
53
- const reports = await (0, runners_1.probeRunners)(clients, nowMs);
81
+ const reports = await (0, runners_1.probeRunners)(clients, nowMs, deadlineMs);
54
82
  return { ...overview, entries: overview.entries.map((entry) => applyReport(entry, reports.find((report) => report.name === entry.runner.name))) };
55
83
  }
84
+ /** A failed note is no failure of the listing: the next listing then simply asks again. */
85
+ function rememberSilence(cacheDir, entry, nowMs) {
86
+ try {
87
+ (0, runners_1.writeProbeFailure)(cacheDir, entry.runner.name, { attemptedAtMs: nowMs, linkSinceMs: entry.linkSinceMs ?? null });
88
+ }
89
+ catch {
90
+ // The cache folder cannot be written (the probe's own report could not be either): the cost is one more wait at the next listing.
91
+ }
92
+ }
93
+ /**
94
+ * @description The overview for a one-shot listing (`charness runners ls`): as read, with the machines whose report is stale (see
95
+ * {@link OverviewEntry}) asked what they are like now — only those, so a listing that finds every report fresh makes no ssh call, and the report
96
+ * that every probe leaves behind is refreshed for the next reader too. Only the REPORT is taken from the answer: whether a machine is online stays
97
+ * what its link says, so a probe that fails (an ssh that cannot start, a slow machine) never turns a linked machine «offline» in the list.
98
+ * The wait is short ({@link staleRefreshDeadlineMs}), and a machine that gave no answer is remembered ({@link probeRetryAfterMs}) so that the
99
+ * next listing shows it as it was last known at once instead of waiting for the same silence.
100
+ */
101
+ async function refreshStaleSnapshots(ctx, overview, cacheDir, nowMs, probe = probeRunnersOverview) {
102
+ const stale = overview.entries.filter((entry) => entry.isSnapshotStale === true);
103
+ if (stale.length === 0)
104
+ return overview;
105
+ const asked = await probe(ctx, { ...overview, entries: stale }, cacheDir, nowMs, exports.staleRefreshDeadlineMs);
106
+ return {
107
+ ...overview,
108
+ entries: overview.entries.map((entry) => {
109
+ const answer = asked.entries.find((candidate) => candidate.runner.id === entry.runner.id);
110
+ if (answer === undefined)
111
+ return entry;
112
+ // An answer is a machine that is online AND handed back a report of its own: the probe returns an entry as it was when it could not
113
+ // ask it (an ssh that cannot be started safely), and that is no answer either.
114
+ const isAnswered = answer.isOnline && answer.probe !== entry.probe;
115
+ if (!answer.isOnline)
116
+ rememberSilence(cacheDir, entry, nowMs);
117
+ return { ...entry, probe: answer.probe, isSnapshotStale: false, isReportDoubtful: !isAnswered };
118
+ }),
119
+ };
120
+ }
56
121
  //# sourceMappingURL=runnersOverview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runnersOverview.js","sourceRoot":"","sources":["../../src/runners/runnersOverview.ts"],"names":[],"mappings":";;AAiCA,kDAOC;AAUD,oDAiBC;AAnED,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,0HAA0H;IAC1H,MAAM,QAAQ,GAAG,IAAA,uBAAa,EAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IACzE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,QAAQ,EAAE,QAAQ,IAAI,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,IA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AAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC1F,IAAI,MAAM,KAAK,SAAS;gBAAE,OAAO,KAAK,CAAC;YACvC,oIAAoI;YACpI,+EAA+E;YAC/E,MAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC;YACnE,IAAI,CAAC,MAAM,CAAC,QAAQ;gBAAE,eAAe,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;YAC9D,OAAO,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,UAAU,EAAE,CAAC;QAClG,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,43 @@
1
+ import type { RunnerProbe } from '../remoteRun/probe';
2
+ import type { HubContext } from './hubPaths';
3
+ import { type PairedRunner, type RunnerServiceKind } from './hubRegistry';
4
+ /**
5
+ * @description The commands that remove a runner's ALWAYS-ON service (the two LaunchDaemons the admin line installs on a Mac), built by the HUB from
6
+ * what the hub knows of the machine. Nothing of charness runs as root on a runner machine to do it — an admin runs plain `launchctl` and `rm` — and
7
+ * the commands must not come from the runner account's own program either: the account runs the agents' code and can change what that program prints,
8
+ * so a line it printed could be anything an admin would then run with `sudo`. The hub derives the two labels itself (a short hash of the account's state
9
+ * folder, `serviceUnits.ts`) from the work folder the runner reported when it was paired — which only picks WHICH two labels: a hash in hex and a
10
+ * fixed path, never text the account chose (so NO command here names the account's home or anything else the runner reported: the login session's agent,
11
+ * which lives in that home, leaves by itself once the daemons' definitions are gone — `guiAgent.ts`) — and shows them where the operator removes a runner (`charness runners remove`, the `/runners` Remove
12
+ * button), in `charness runners service-removal`, and in `docs/remote-run.md`.
13
+ */
14
+ /** Where the admin line puts the daemons' definitions. */
15
+ export declare const launchDaemonsDir = "/Library/LaunchDaemons";
16
+ /**
17
+ * @description The admin's commands that remove `runner`'s two LaunchDaemons — stop them, then delete their definitions; `null` when the hub cannot say
18
+ * which they are (the runner reported a work folder that is not the state folder's own).
19
+ */
20
+ export declare function getSystemServiceRemovalCommands(runner: PairedRunner): string[] | null;
21
+ /**
22
+ * @description What to tell the operator who removes `runner` (or asks): the removal commands when it runs as an always-on service now — by its probe,
23
+ * else by the registry's word (`getCurrentServiceKind`) — else `[]`.
24
+ */
25
+ export declare function getServiceRemovalLines(runner: PairedRunner, probe: RunnerProbe | null): string[];
26
+ /** What an always-on service's removal needs, for one runner: how the machine is kept running now, and the admin's commands (`[]` when there are none to give). */
27
+ export interface ServiceRemovalFacts {
28
+ runner: PairedRunner;
29
+ kind: RunnerServiceKind;
30
+ commands: string[];
31
+ }
32
+ /**
33
+ * @description The ONE reading behind every place that tells an admin how to remove a runner's always-on service (`charness runners remove` and
34
+ * `service-removal`, the Remove button of `/runners`): the registry's runner `nameOrId` and its last report, nothing else — no link probe, no pairing
35
+ * codes, so a slow or damaged part of the hub cannot get in the way of the removal it accompanies. `null` when no runner is paired by that name or id.
36
+ * Read BEFORE the removal, which deletes the runner's last report.
37
+ */
38
+ export declare function readServiceRemovalForRunner(ctx: HubContext, cacheDir: string, nameOrId: string): ServiceRemovalFacts | null;
39
+ /** @description The note `charness runners remove` and `service-removal` print for an always-on service (English, plain text): what it is, who may stop it, the commands, where they come from. */
40
+ export declare function formatServiceRemovalNote(runnerName: string, commands: readonly string[]): string;
41
+ /** @description What `charness runners service-removal <name>` says for a runner that runs as an always-on service whose daemons the hub cannot name. */
42
+ export declare function formatServiceRemovalUnknownNote(runnerName: string): string;
43
+ //# sourceMappingURL=serviceRemoval.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceRemoval.d.ts","sourceRoot":"","sources":["../../src/runners/serviceRemoval.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAkB,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAG1F;;;;;;;;;GASG;AAEH,0DAA0D;AAC1D,eAAO,MAAM,gBAAgB,2BAA2B,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,EAAE,GAAG,IAAI,CAWrF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,GAAG,MAAM,EAAE,CAEhG;AAED,mKAAmK;AACnK,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAK3H;AAKD,mMAAmM;AACnM,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAOhG;AAED,yJAAyJ;AACzJ,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE1E"}
@@ -0,0 +1,114 @@
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.launchDaemonsDir = void 0;
37
+ exports.getSystemServiceRemovalCommands = getSystemServiceRemovalCommands;
38
+ exports.getServiceRemovalLines = getServiceRemovalLines;
39
+ exports.readServiceRemovalForRunner = readServiceRemovalForRunner;
40
+ exports.formatServiceRemovalNote = formatServiceRemovalNote;
41
+ exports.formatServiceRemovalUnknownNote = formatServiceRemovalUnknownNote;
42
+ const path = __importStar(require("path"));
43
+ const runners_1 = require("../remoteRun/runners");
44
+ const serviceCommon_1 = require("../runnerUtility/serviceCommon");
45
+ const runnerHome_1 = require("../runnerUtility/runnerHome");
46
+ const serviceUnits_1 = require("../runnerUtility/serviceUnits");
47
+ const hubPairing_1 = require("./hubPairing");
48
+ const hubRegistry_1 = require("./hubRegistry");
49
+ const runnerServiceKind_1 = require("./runnerServiceKind");
50
+ /**
51
+ * @description The commands that remove a runner's ALWAYS-ON service (the two LaunchDaemons the admin line installs on a Mac), built by the HUB from
52
+ * what the hub knows of the machine. Nothing of charness runs as root on a runner machine to do it — an admin runs plain `launchctl` and `rm` — and
53
+ * the commands must not come from the runner account's own program either: the account runs the agents' code and can change what that program prints,
54
+ * so a line it printed could be anything an admin would then run with `sudo`. The hub derives the two labels itself (a short hash of the account's state
55
+ * folder, `serviceUnits.ts`) from the work folder the runner reported when it was paired — which only picks WHICH two labels: a hash in hex and a
56
+ * fixed path, never text the account chose (so NO command here names the account's home or anything else the runner reported: the login session's agent,
57
+ * which lives in that home, leaves by itself once the daemons' definitions are gone — `guiAgent.ts`) — and shows them where the operator removes a runner (`charness runners remove`, the `/runners` Remove
58
+ * button), in `charness runners service-removal`, and in `docs/remote-run.md`.
59
+ */
60
+ /** Where the admin line puts the daemons' definitions. */
61
+ exports.launchDaemonsDir = '/Library/LaunchDaemons';
62
+ /**
63
+ * @description The admin's commands that remove `runner`'s two LaunchDaemons — stop them, then delete their definitions; `null` when the hub cannot say
64
+ * which they are (the runner reported a work folder that is not the state folder's own).
65
+ */
66
+ function getSystemServiceRemovalCommands(runner) {
67
+ const homeDir = path.dirname(path.dirname(runner.workDir));
68
+ const paths = (0, runnerHome_1.getRunnerHomePaths)(homeDir);
69
+ if (paths.workDir !== runner.workDir)
70
+ return null;
71
+ const names = (0, serviceUnits_1.getServiceNames)(paths.root);
72
+ const files = (0, serviceCommon_1.getLaunchdFiles)(true, homeDir, names, exports.launchDaemonsDir);
73
+ return [
74
+ `sudo launchctl bootout system/${names.launchdLink}`,
75
+ `sudo launchctl bootout system/${names.launchdPueued}`,
76
+ `sudo rm ${files.link} ${files.pueued}`,
77
+ ];
78
+ }
79
+ /**
80
+ * @description What to tell the operator who removes `runner` (or asks): the removal commands when it runs as an always-on service now — by its probe,
81
+ * else by the registry's word (`getCurrentServiceKind`) — else `[]`.
82
+ */
83
+ function getServiceRemovalLines(runner, probe) {
84
+ return (0, runnerServiceKind_1.getCurrentServiceKind)(runner, probe) === 'system-service' ? (getSystemServiceRemovalCommands(runner) ?? []) : [];
85
+ }
86
+ /**
87
+ * @description The ONE reading behind every place that tells an admin how to remove a runner's always-on service (`charness runners remove` and
88
+ * `service-removal`, the Remove button of `/runners`): the registry's runner `nameOrId` and its last report, nothing else — no link probe, no pairing
89
+ * codes, so a slow or damaged part of the hub cannot get in the way of the removal it accompanies. `null` when no runner is paired by that name or id.
90
+ * Read BEFORE the removal, which deletes the runner's last report.
91
+ */
92
+ function readServiceRemovalForRunner(ctx, cacheDir, nameOrId) {
93
+ const runner = (0, hubPairing_1.findPairedRunner)((0, hubRegistry_1.readPairedFile)(ctx.dir).runners, nameOrId);
94
+ if (runner === undefined)
95
+ return null;
96
+ const probe = (0, runners_1.readLastProbe)(cacheDir, runner.name, runner.pairedAtMs)?.probe ?? null;
97
+ return { runner, kind: (0, runnerServiceKind_1.getCurrentServiceKind)(runner, probe), commands: getServiceRemovalLines(runner, probe) };
98
+ }
99
+ /** The way to find the daemons by hand, for the machine the hub cannot name them for. */
100
+ const findDaemonsByHandCommand = `ls ${exports.launchDaemonsDir} | grep com.charness.runner`;
101
+ /** @description The note `charness runners remove` and `service-removal` print for an always-on service (English, plain text): what it is, who may stop it, the commands, where they come from. */
102
+ function formatServiceRemovalNote(runnerName, commands) {
103
+ return [
104
+ `"${runnerName}" runs as an always-on service on that machine (two LaunchDaemons), which only an admin there can stop — nothing of charness runs as root. As an admin on that machine, run:`,
105
+ ...commands.map((command) => ` ${command}`),
106
+ 'These commands come from this charness host, not from the machine itself.',
107
+ '',
108
+ ].join('\n');
109
+ }
110
+ /** @description What `charness runners service-removal <name>` says for a runner that runs as an always-on service whose daemons the hub cannot name. */
111
+ function formatServiceRemovalUnknownNote(runnerName) {
112
+ return `"${runnerName}" runs as an always-on service on that machine, but it reported a work folder that is not the state folder's own, so this charness host cannot say which daemons are its. On that machine, as an admin, \`${findDaemonsByHandCommand}\` lists them (a charness runner has two: the link and its queue); remove each with \`sudo launchctl bootout system/<label>\`, then \`sudo rm ${exports.launchDaemonsDir}/<label>.plist\`.\n`;
113
+ }
114
+ //# sourceMappingURL=serviceRemoval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceRemoval.js","sourceRoot":"","sources":["../../src/run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;;;;;GAKG;AACH,SAAgB,2BAA2B,CAAC,GAAe,EAAE,QAAgB,EAAE,QAAgB;IAC7F,MAAM,MAAM,GAAG,IAAA,6BAAgB,EAAC,IAAA,4BAAc,EAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC3E,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACtC,MAAM,KAAK,GAAG,IAAA,uBAAa,EAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,EAAE,KAAK,IAAI,IAAI,CAAC;IACrF,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAA,yCAAqB,EAAC,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,sBAAsB,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;AACjH,CAAC;AAED,yFAAyF;AACzF,MAAM,wBAAwB,GAAG,MAAM,wBAAgB,6BAA6B,CAAC;AAErF,mMAAmM;AACnM,SAAgB,wBAAwB,CAAC,UAAkB,EAAE,QAA2B;IACtF,OAAO;QACL,IAAI,UAAU,8KAA8K;QAC5L,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC;QAC5C,2EAA2E;QAC3E,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,yJAAyJ;AACzJ,SAAgB,+BAA+B,CAAC,UAAkB;IAChE,OAAO,IAAI,UAAU,6MAA6M,wBAAwB,iJAAiJ,wBAAgB,qBAAqB,CAAC;AACnb,CAAC"}
@@ -0,0 +1,78 @@
1
+ import type { TopicView } from '../types';
2
+ import type { ScheduleRecord } from './types';
3
+ /**
4
+ * @description The STATUS LINE of a passing check: while a `'check'` job keeps passing and carries a status source
5
+ * (a worker's run directory, or a command), the BOT itself posts a short silent line into the topic — «⏳ builder S2 ·
6
+ * works 30 min · now: Bash: Run the unit tests» — and deletes the previous one. The agent is never woken and no turn
7
+ * runs, so a topic whose agent is idle, compacting or stopped still shows that its worker is alive. This file holds the
8
+ * pure decisions (when a line is due, whether the topic shows it, its text); the I/O lives in `delivery.ts`
9
+ * (`updateCheckStatus`) and `workerActivity.ts`.
10
+ */
11
+ /** Minutes between two status lines when `schedule_create` leaves `statusEveryMinutes` out. */
12
+ export declare const defaultCheckStatusEveryMinutes = 15;
13
+ /** The shortest `statusEveryMinutes`: a status line is a heartbeat, not a stream (the bot posts at most one per 5 min). */
14
+ export declare const minCheckStatusEveryMinutes = 5;
15
+ /** The longest `statusEveryMinutes` (4 h). */
16
+ export declare const maxCheckStatusEveryMinutes = 240;
17
+ /** Longest `statusCommand` accepted (the same bound as `checkCommand`). */
18
+ export declare const maxCheckStatusCommandLength = 1000;
19
+ /** Longest `statusWorkerRunDir` accepted. */
20
+ export declare const maxCheckStatusRunDirLength = 1000;
21
+ /** Seconds a `statusCommand` run may take; a slow probe only costs the «now» part of its line. */
22
+ export declare const checkStatusCommandTimeoutSec = 15;
23
+ /**
24
+ * How much earlier than a full interval a line may come due. A check runs on a cron tick, a few seconds after the minute,
25
+ * so «15 min since the last line» is measured at 14 min 58 s on the tick that should post it, and a plain `>=` would
26
+ * push every line one tick later (a cron ticking every 5 minutes would post every 20 min, not 15).
27
+ */
28
+ export declare const checkStatusSlackMs = 60000;
29
+ /** The longest «now» part of a line: one line of a phone's width, never a paragraph. */
30
+ export declare const checkStatusActivityMaxChars = 120;
31
+ /** @description The status interval of a check, in ms. */
32
+ export declare function getCheckStatusIntervalMs(job: Pick<ScheduleRecord, 'statusEveryMinutes'>): number;
33
+ /**
34
+ * @description Whether a status line is due: an interval (less the slack) has passed since the last line, or since the
35
+ * check was created before the first one — the manager's own launch message covers the first minutes.
36
+ */
37
+ export declare function checkIsCheckStatusDue(input: {
38
+ sinceMs: number;
39
+ nowMs: number;
40
+ intervalMs: number;
41
+ }): boolean;
42
+ /** @description The instant a check's next line is counted from: its last line, else its creation. */
43
+ export declare function getCheckStatusSinceMs(job: Pick<ScheduleRecord, 'lastStatusAt' | 'createdAt'>): number;
44
+ /**
45
+ * @description Whether this is the LAST run the job will ever make (a `once` job, or the final run of an N-times cron): its
46
+ * line would be deleted at once by the finished check, so none is posted and the existing one goes.
47
+ */
48
+ export declare function checkIsFinalCheckRun(job: Pick<ScheduleRecord, 'spec'>): boolean;
49
+ /**
50
+ * @description The ONE gate that decides whether a topic shows status lines: a Telegram conversation (a tracker issue gets no
51
+ * message, no comment, no edited note) whose view shows the agent's stream — the answers-only view shows nothing but answers.
52
+ */
53
+ export declare function checkIsCheckStatusShown(input: {
54
+ isTelegram: boolean;
55
+ view: TopicView;
56
+ }): boolean;
57
+ /**
58
+ * @description One line of activity text: whitespace collapsed, cut to {@link checkStatusActivityMaxChars} with an ellipsis;
59
+ * `null` when nothing readable is left. Shared by the log reader and the `statusCommand` output.
60
+ */
61
+ export declare function formatCheckStatusActivity(text: string): string | null;
62
+ /**
63
+ * @description The «now» of a `statusCommand`: the first non-empty line of its output, which is stdout and stderr together,
64
+ * so a command that only complained has a «now» of its complaint — callers pass the output of a run that exited 0.
65
+ */
66
+ export declare function getCheckStatusActivityFromOutput(output: string): string | null;
67
+ /** @description «N min» under an hour, «H h M min» from an hour on (rounded to the nearest minute). */
68
+ export declare function getCheckStatusElapsedText(elapsedMs: number): string;
69
+ /**
70
+ * @description The status line: `⏳ <name> · works <elapsed>[ · now: <activity>]`. The name is the check's own without the
71
+ * recipe's leading `watch `; the «now» part is left out when there is nothing readable to say.
72
+ */
73
+ export declare function buildCheckStatusLine(input: {
74
+ name: string;
75
+ elapsedMs: number;
76
+ activity: string | null;
77
+ }): string;
78
+ //# sourceMappingURL=checkStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkStatus.d.ts","sourceRoot":"","sources":["../../src/scheduler/checkStatus.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM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MAAM,GAAG,MAAM,GAAG,IAAI,CAKrE;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG9E;AAED,uGAAuG;AACvG,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAOnE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,MAAM,CAOhH"}
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkStatusActivityMaxChars = exports.checkStatusSlackMs = exports.checkStatusCommandTimeoutSec = exports.maxCheckStatusRunDirLength = exports.maxCheckStatusCommandLength = exports.maxCheckStatusEveryMinutes = exports.minCheckStatusEveryMinutes = exports.defaultCheckStatusEveryMinutes = void 0;
4
+ exports.getCheckStatusIntervalMs = getCheckStatusIntervalMs;
5
+ exports.checkIsCheckStatusDue = checkIsCheckStatusDue;
6
+ exports.getCheckStatusSinceMs = getCheckStatusSinceMs;
7
+ exports.checkIsFinalCheckRun = checkIsFinalCheckRun;
8
+ exports.checkIsCheckStatusShown = checkIsCheckStatusShown;
9
+ exports.formatCheckStatusActivity = formatCheckStatusActivity;
10
+ exports.getCheckStatusActivityFromOutput = getCheckStatusActivityFromOutput;
11
+ exports.getCheckStatusElapsedText = getCheckStatusElapsedText;
12
+ exports.buildCheckStatusLine = buildCheckStatusLine;
13
+ const i18n_1 = require("../i18n");
14
+ const surrogateSafeCut_1 = require("../utils/surrogateSafeCut");
15
+ const topicView_1 = require("../utils/topicView");
16
+ /**
17
+ * @description The STATUS LINE of a passing check: while a `'check'` job keeps passing and carries a status source
18
+ * (a worker's run directory, or a command), the BOT itself posts a short silent line into the topic — «⏳ builder S2 ·
19
+ * works 30 min · now: Bash: Run the unit tests» — and deletes the previous one. The agent is never woken and no turn
20
+ * runs, so a topic whose agent is idle, compacting or stopped still shows that its worker is alive. This file holds the
21
+ * pure decisions (when a line is due, whether the topic shows it, its text); the I/O lives in `delivery.ts`
22
+ * (`updateCheckStatus`) and `workerActivity.ts`.
23
+ */
24
+ /** Minutes between two status lines when `schedule_create` leaves `statusEveryMinutes` out. */
25
+ exports.defaultCheckStatusEveryMinutes = 15;
26
+ /** The shortest `statusEveryMinutes`: a status line is a heartbeat, not a stream (the bot posts at most one per 5 min). */
27
+ exports.minCheckStatusEveryMinutes = 5;
28
+ /** The longest `statusEveryMinutes` (4 h). */
29
+ exports.maxCheckStatusEveryMinutes = 240;
30
+ /** Longest `statusCommand` accepted (the same bound as `checkCommand`). */
31
+ exports.maxCheckStatusCommandLength = 1000;
32
+ /** Longest `statusWorkerRunDir` accepted. */
33
+ exports.maxCheckStatusRunDirLength = 1000;
34
+ /** Seconds a `statusCommand` run may take; a slow probe only costs the «now» part of its line. */
35
+ exports.checkStatusCommandTimeoutSec = 15;
36
+ /**
37
+ * How much earlier than a full interval a line may come due. A check runs on a cron tick, a few seconds after the minute,
38
+ * so «15 min since the last line» is measured at 14 min 58 s on the tick that should post it, and a plain `>=` would
39
+ * push every line one tick later (a cron ticking every 5 minutes would post every 20 min, not 15).
40
+ */
41
+ exports.checkStatusSlackMs = 60_000;
42
+ /** The slack never exceeds this share of the interval, so a test window of a minute or two is still an interval. */
43
+ const checkStatusSlackShareDivisor = 5;
44
+ /** The longest «now» part of a line: one line of a phone's width, never a paragraph. */
45
+ exports.checkStatusActivityMaxChars = 120;
46
+ const msPerMinute = 60_000;
47
+ const minutesPerHour = 60;
48
+ /** A leading `watch ` of a check's name is the recipe's own prefix (`watch builder S2`), noise in the topic. */
49
+ const leadingWatchWordPattern = /^watch\s+/i;
50
+ /** @description The status interval of a check, in ms. */
51
+ function getCheckStatusIntervalMs(job) {
52
+ return (job.statusEveryMinutes ?? exports.defaultCheckStatusEveryMinutes) * msPerMinute;
53
+ }
54
+ /**
55
+ * @description Whether a status line is due: an interval (less the slack) has passed since the last line, or since the
56
+ * check was created before the first one — the manager's own launch message covers the first minutes.
57
+ */
58
+ function checkIsCheckStatusDue(input) {
59
+ const slackMs = Math.min(exports.checkStatusSlackMs, Math.floor(input.intervalMs / checkStatusSlackShareDivisor));
60
+ return input.nowMs - input.sinceMs >= input.intervalMs - slackMs;
61
+ }
62
+ /** @description The instant a check's next line is counted from: its last line, else its creation. */
63
+ function getCheckStatusSinceMs(job) {
64
+ return job.lastStatusAt ?? Date.parse(job.createdAt);
65
+ }
66
+ /**
67
+ * @description Whether this is the LAST run the job will ever make (a `once` job, or the final run of an N-times cron): its
68
+ * line would be deleted at once by the finished check, so none is posted and the existing one goes.
69
+ */
70
+ function checkIsFinalCheckRun(job) {
71
+ const { spec } = job;
72
+ return spec.kind === 'once' || (typeof spec.remainingRuns === 'number' && spec.remainingRuns <= 1);
73
+ }
74
+ /**
75
+ * @description The ONE gate that decides whether a topic shows status lines: a Telegram conversation (a tracker issue gets no
76
+ * message, no comment, no edited note) whose view shows the agent's stream — the answers-only view shows nothing but answers.
77
+ */
78
+ function checkIsCheckStatusShown(input) {
79
+ return input.isTelegram && (0, topicView_1.checkIsStreamShown)(input.view);
80
+ }
81
+ /**
82
+ * @description One line of activity text: whitespace collapsed, cut to {@link checkStatusActivityMaxChars} with an ellipsis;
83
+ * `null` when nothing readable is left. Shared by the log reader and the `statusCommand` output.
84
+ */
85
+ function formatCheckStatusActivity(text) {
86
+ const collapsed = text.replace(/\s+/g, ' ').trim();
87
+ if (collapsed === '')
88
+ return null;
89
+ // The cut keeps room for the ellipsis and never splits an emoji's two halves: Telegram refuses a text that ends in half of one.
90
+ return collapsed.length <= exports.checkStatusActivityMaxChars ? collapsed : `${(0, surrogateSafeCut_1.cutTextSurrogateSafe)(collapsed, exports.checkStatusActivityMaxChars - 1)}…`;
91
+ }
92
+ /**
93
+ * @description The «now» of a `statusCommand`: the first non-empty line of its output, which is stdout and stderr together,
94
+ * so a command that only complained has a «now» of its complaint — callers pass the output of a run that exited 0.
95
+ */
96
+ function getCheckStatusActivityFromOutput(output) {
97
+ const firstLine = output.split('\n').find((line) => line.trim() !== '');
98
+ return firstLine === undefined ? null : formatCheckStatusActivity(firstLine);
99
+ }
100
+ /** @description «N min» under an hour, «H h M min» from an hour on (rounded to the nearest minute). */
101
+ function getCheckStatusElapsedText(elapsedMs) {
102
+ const totalMinutes = Math.max(0, Math.round(elapsedMs / msPerMinute));
103
+ if (totalMinutes < minutesPerHour)
104
+ return (0, i18n_1.t)('schedule.statusElapsedMinutes', { minutes: totalMinutes });
105
+ return (0, i18n_1.t)('schedule.statusElapsedHours', {
106
+ hours: Math.floor(totalMinutes / minutesPerHour),
107
+ minutes: totalMinutes % minutesPerHour,
108
+ });
109
+ }
110
+ /**
111
+ * @description The status line: `⏳ <name> · works <elapsed>[ · now: <activity>]`. The name is the check's own without the
112
+ * recipe's leading `watch `; the «now» part is left out when there is nothing readable to say.
113
+ */
114
+ function buildCheckStatusLine(input) {
115
+ const shownName = input.name.replace(leadingWatchWordPattern, '').trim() || input.name;
116
+ return (0, i18n_1.t)('schedule.statusLineText', {
117
+ name: shownName,
118
+ elapsed: getCheckStatusElapsedText(input.elapsedMs),
119
+ activity: input.activity === null ? '' : (0, i18n_1.t)('schedule.statusLineActivity', { activity: input.activity }),
120
+ });
121
+ }
122
+ //# sourceMappingURL=checkStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkStatus.js","sourceRoot":"","sources":["../../src/scheduler/checkStatus.ts"],"names":[],"mappings":";;;AAqDA,4DAEC;AAMD,sDAGC;AAGD,sDAEC;AAMD,oDAGC;AAMD,0DAEC;AAMD,8DAKC;AAMD,4EAGC;AAGD,8DAOC;AAMD,oDAOC;AAjID,kCAA4B;AAC5B,gEAAiE;AACjE,kDAAwD;AAIxD;;;;;;;GAOG;AAEH,+FAA+F;AAClF,QAAA,8BAA8B,GAAG,E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AAE,OAAO,IAAA,QAAC,EAAC,+BAA+B,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;IACxG,OAAO,IAAA,QAAC,EAAC,6BAA6B,EAAE;QACtC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,cAAc,CAAC;QAChD,OAAO,EAAE,YAAY,GAAG,cAAc;KACvC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,KAAmE;IACtG,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC;IACvF,OAAO,IAAA,QAAC,EAAC,yBAAyB,EAAE;QAClC,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,yBAAyB,CAAC,KAAK,CAAC,SAAS,CAAC;QACnD,QAAQ,EAAE,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAA,QAAC,EAAC,6BAA6B,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;KACxG,CAAC,CAAC;AACL,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { type CheckRunResult } from './checkRun';
2
- import type { DeliveryOutcome, FireContext, ScheduleRecord } from './types';
2
+ import type { CheckStatusLine, DeliveryOutcome, FireContext, ScheduleRecord } from './types';
3
3
  import { type PostToSessionDeps } from '../postToSession';
4
4
  /**
5
5
  * @description Scheduler delivery (plan S4): the real `deliver(job, fireContext)`
@@ -61,6 +61,24 @@ export interface ScheduleDeliveryDeps extends PostToSessionDeps {
61
61
  setCheckFailing: (jobId: string, isFailing: boolean) => Promise<void>;
62
62
  /** Remember a check alert's pinned message on its job, so cancelling the job unpins it. */
63
63
  recordAlertPin: (jobId: string, messageId: number) => Promise<void>;
64
+ /** Whether this conversation shows status lines at all (a Telegram topic whose view shows the agent's stream). */
65
+ checkIsStatusShown: (threadKey: string) => boolean;
66
+ /**
67
+ * Post a status line SILENTLY (no notification, never pinned) and resolve with its message id, or `null` when the send
68
+ * failed. It is the bot's own message: it never reaches an agent.
69
+ */
70
+ postStatus: (threadKey: string, text: string) => Promise<number | null>;
71
+ /** Delete a message of the topic, best effort: one that is gone or too old to delete is not an error. */
72
+ deleteMessage: (threadKey: string, messageId: number) => Promise<void>;
73
+ /** What the worker whose run directory is `runDir` (relative to the bound folder, or absolute) did last; `null` when unreadable. */
74
+ readWorkerActivity: (threadKey: string, runDir: string) => Promise<string | null>;
75
+ /**
76
+ * Persist the status line a job now has in the topic (`null`: it has none). Resolves `false` when the job no longer
77
+ * exists (it was cancelled while the line was being posted), so the caller can delete the line it just posted.
78
+ */
79
+ recordStatusLine: (jobId: string, line: CheckStatusLine | null) => Promise<boolean>;
80
+ /** Test seam (`CHARNESS_TEST_TIMINGS`): the status interval in place of the job's `statusEveryMinutes`. */
81
+ statusIntervalOverrideMs?: number;
64
82
  }
65
83
  /**
66
84
  * @description Prefix a scheduled job's prompt with a single English line that
@@ -93,6 +111,14 @@ export declare function prependScheduledRunMarker(jobName: string, prompt: strin
93
111
  export declare function buildFireAnnouncement(job: ScheduleRecord, fireContext: FireContext): string;
94
112
  /** @description The topic alert of a check's first failure: what failed, how, and the output tail. */
95
113
  export declare function buildCheckFailedAnnouncement(job: ScheduleRecord, fireContext: FireContext, failure: string, output: string): string;
114
+ /**
115
+ * @description Take a job's status line out of the topic and out of its record — the ONE place that does it, for a failed or
116
+ * unbound run, a topic that stopped showing the stream, a final run, and the `/unbind` pause (`unbindPause.ts`). The record is
117
+ * cleared first: a crash between the two leaves an orphan line in the topic, never a record that points at a message that was
118
+ * already deleted. Never rejects — the alert of a failed check runs right after it, and a status line must not be able to stop
119
+ * that (nor an unbind be stopped by it).
120
+ */
121
+ export declare function clearCheckStatusLine(deps: Pick<ScheduleDeliveryDeps, 'recordStatusLine' | 'deleteMessage'>, job: Pick<ScheduleRecord, 'id' | 'threadKey' | 'statusMessageId'>): Promise<void>;
96
122
  /**
97
123
  * @description Build the engine's `deliver(job, fireContext)` callback bound to
98
124
  * the injected deps. See the module header for the locked flow.
@@ -1 +1 @@
1
- {"version":3,"file":"delivery.d.ts","sourceRoot":"","sources":["../../src/scheduler/delivery.ts"],"names":[],"mappings":"AAGA,OAAO,EASL,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D;;;;OAIG;IACH,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACtE,qFAAqF;IACrF,GAAG,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChF,iGAAiG;IACjG,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACpG,mFAAmF;IACnF,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,2FAA2F;IAC3F,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI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