charness 3.9.1 → 3.11.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.
- package/CHANGELOG.md +155 -0
- package/DEVELOPMENT.md +4 -1
- package/README.md +2 -1
- package/SETUP.md +6 -4
- package/agent-plugin/README.md +2 -2
- package/agent-plugin/skills/charness-delegate-opencode/SKILL.md +1 -1
- package/agent-plugin/skills/charness-manager/SKILL.md +11 -6
- package/dist/bot.d.ts +27 -18
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +390 -231
- package/dist/bot.js.map +1 -1
- package/dist/connectors/jira/adf.d.ts.map +1 -1
- package/dist/connectors/jira/adf.js +2 -3
- package/dist/connectors/jira/adf.js.map +1 -1
- package/dist/connectors/telegram/commands/botCore.d.ts +17 -0
- package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/claudeAccounts.js +3 -3
- package/dist/connectors/telegram/commands/claudeAccounts.js.map +1 -1
- package/dist/connectors/telegram/commands/runners.d.ts +10 -1
- package/dist/connectors/telegram/commands/runners.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/runners.js +85 -17
- package/dist/connectors/telegram/commands/runners.js.map +1 -1
- package/dist/connectors/telegram/foldedMessage.d.ts +24 -0
- package/dist/connectors/telegram/foldedMessage.d.ts.map +1 -0
- package/dist/connectors/telegram/foldedMessage.js +39 -0
- package/dist/connectors/telegram/foldedMessage.js.map +1 -0
- package/dist/connectors/telegram/inbound.d.ts +24 -1
- package/dist/connectors/telegram/inbound.d.ts.map +1 -1
- package/dist/connectors/telegram/inbound.js +77 -1
- package/dist/connectors/telegram/inbound.js.map +1 -1
- package/dist/connectors/telegram/renderAgentHtml.d.ts +15 -0
- package/dist/connectors/telegram/renderAgentHtml.d.ts.map +1 -1
- package/dist/connectors/telegram/renderAgentHtml.js +11 -1
- package/dist/connectors/telegram/renderAgentHtml.js.map +1 -1
- package/dist/connectors/telegram/runnerLinkNotices.d.ts +24 -0
- package/dist/connectors/telegram/runnerLinkNotices.d.ts.map +1 -0
- package/dist/connectors/telegram/runnerLinkNotices.js +95 -0
- package/dist/connectors/telegram/runnerLinkNotices.js.map +1 -0
- package/dist/connectors/telegram/runnerPairingMessages.d.ts +9 -0
- package/dist/connectors/telegram/runnerPairingMessages.d.ts.map +1 -1
- package/dist/connectors/telegram/runnerPairingMessages.js +17 -1
- package/dist/connectors/telegram/runnerPairingMessages.js.map +1 -1
- package/dist/connectors/telegram/unpinMessages.d.ts +12 -0
- package/dist/connectors/telegram/unpinMessages.d.ts.map +1 -0
- package/dist/connectors/telegram/unpinMessages.js +44 -0
- package/dist/connectors/telegram/unpinMessages.js.map +1 -0
- package/dist/i18n/de.d.ts.map +1 -1
- package/dist/i18n/de.js +30 -3
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +30 -3
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +30 -3
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +30 -3
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/hi.d.ts.map +1 -1
- package/dist/i18n/hi.js +30 -3
- package/dist/i18n/hi.js.map +1 -1
- package/dist/i18n/ja.d.ts.map +1 -1
- package/dist/i18n/ja.js +30 -3
- package/dist/i18n/ja.js.map +1 -1
- package/dist/i18n/ka.d.ts.map +1 -1
- package/dist/i18n/ka.js +30 -3
- package/dist/i18n/ka.js.map +1 -1
- package/dist/i18n/pt.d.ts.map +1 -1
- package/dist/i18n/pt.js +30 -3
- package/dist/i18n/pt.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +30 -3
- package/dist/i18n/ru.js.map +1 -1
- package/dist/i18n/uk.d.ts.map +1 -1
- package/dist/i18n/uk.js +30 -3
- package/dist/i18n/uk.js.map +1 -1
- package/dist/i18n/uz.d.ts.map +1 -1
- package/dist/i18n/uz.js +30 -3
- package/dist/i18n/uz.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +30 -3
- package/dist/i18n/zh.js.map +1 -1
- package/dist/outputTrace.d.ts +6 -0
- package/dist/outputTrace.d.ts.map +1 -1
- package/dist/outputTrace.js +15 -9
- package/dist/outputTrace.js.map +1 -1
- package/dist/rateLimiter.d.ts +3 -1
- package/dist/rateLimiter.d.ts.map +1 -1
- package/dist/rateLimiter.js +3 -1
- package/dist/rateLimiter.js.map +1 -1
- package/dist/remoteRun/cliArgs.d.ts +6 -1
- package/dist/remoteRun/cliArgs.d.ts.map +1 -1
- package/dist/remoteRun/cliArgs.js +39 -2
- package/dist/remoteRun/cliArgs.js.map +1 -1
- package/dist/remoteRun/exitCodes.d.ts +12 -2
- package/dist/remoteRun/exitCodes.d.ts.map +1 -1
- package/dist/remoteRun/exitCodes.js +3 -0
- package/dist/remoteRun/exitCodes.js.map +1 -1
- package/dist/remoteRun/foreground.d.ts +13 -0
- package/dist/remoteRun/foreground.d.ts.map +1 -1
- package/dist/remoteRun/foreground.js +15 -2
- package/dist/remoteRun/foreground.js.map +1 -1
- package/dist/remoteRun/heldBackNotice.d.ts +7 -0
- package/dist/remoteRun/heldBackNotice.d.ts.map +1 -0
- package/dist/remoteRun/heldBackNotice.js +92 -0
- package/dist/remoteRun/heldBackNotice.js.map +1 -0
- package/dist/remoteRun/interrupts.d.ts +6 -2
- package/dist/remoteRun/interrupts.d.ts.map +1 -1
- package/dist/remoteRun/interrupts.js +18 -3
- package/dist/remoteRun/interrupts.js.map +1 -1
- package/dist/remoteRun/leaseTiming.d.ts +1 -2
- package/dist/remoteRun/leaseTiming.d.ts.map +1 -1
- package/dist/remoteRun/leaseTiming.js +3 -17
- package/dist/remoteRun/leaseTiming.js.map +1 -1
- package/dist/remoteRun/output.d.ts +16 -1
- package/dist/remoteRun/output.d.ts.map +1 -1
- package/dist/remoteRun/output.js +28 -2
- package/dist/remoteRun/output.js.map +1 -1
- package/dist/remoteRun/probe.d.ts +40 -2
- package/dist/remoteRun/probe.d.ts.map +1 -1
- package/dist/remoteRun/probe.js +58 -2
- package/dist/remoteRun/probe.js.map +1 -1
- package/dist/remoteRun/project.d.ts +2 -2
- package/dist/remoteRun/project.d.ts.map +1 -1
- package/dist/remoteRun/project.js +5 -4
- package/dist/remoteRun/project.js.map +1 -1
- package/dist/remoteRun/remoteRunCli.d.ts +1 -1
- package/dist/remoteRun/remoteRunCli.d.ts.map +1 -1
- package/dist/remoteRun/remoteRunCli.js +6 -3
- package/dist/remoteRun/remoteRunCli.js.map +1 -1
- package/dist/remoteRun/runnerWait.d.ts +3 -3
- package/dist/remoteRun/runnerWait.d.ts.map +1 -1
- package/dist/remoteRun/runnerWait.js +12 -6
- package/dist/remoteRun/runnerWait.js.map +1 -1
- package/dist/remoteRun/runnerWaitTiming.d.ts +1 -1
- package/dist/remoteRun/runnerWaitTiming.d.ts.map +1 -1
- package/dist/remoteRun/runnerWaitTiming.js +3 -16
- package/dist/remoteRun/runnerWaitTiming.js.map +1 -1
- package/dist/remoteRun/runners.d.ts +16 -3
- package/dist/remoteRun/runners.d.ts.map +1 -1
- package/dist/remoteRun/runners.js +42 -4
- package/dist/remoteRun/runners.js.map +1 -1
- package/dist/remoteRun/sendPlan.d.ts +11 -1
- package/dist/remoteRun/sendPlan.d.ts.map +1 -1
- package/dist/remoteRun/sendPlan.js +29 -5
- package/dist/remoteRun/sendPlan.js.map +1 -1
- package/dist/remoteRun/submit.d.ts.map +1 -1
- package/dist/remoteRun/submit.js +13 -3
- package/dist/remoteRun/submit.js.map +1 -1
- package/dist/runnerUtility/adminService.d.ts +30 -2
- package/dist/runnerUtility/adminService.d.ts.map +1 -1
- package/dist/runnerUtility/adminService.js +104 -6
- package/dist/runnerUtility/adminService.js.map +1 -1
- package/dist/runnerUtility/appInstall.d.ts +13 -4
- package/dist/runnerUtility/appInstall.d.ts.map +1 -1
- package/dist/runnerUtility/appInstall.js +46 -19
- package/dist/runnerUtility/appInstall.js.map +1 -1
- package/dist/runnerUtility/appUpdate.js +1 -1
- package/dist/runnerUtility/appUpdate.js.map +1 -1
- package/dist/runnerUtility/execEnv.d.ts +2 -0
- package/dist/runnerUtility/execEnv.d.ts.map +1 -1
- package/dist/runnerUtility/execEnv.js +6 -2
- package/dist/runnerUtility/execEnv.js.map +1 -1
- package/dist/runnerUtility/guiAgent.d.ts +126 -0
- package/dist/runnerUtility/guiAgent.d.ts.map +1 -0
- package/dist/runnerUtility/guiAgent.js +591 -0
- package/dist/runnerUtility/guiAgent.js.map +1 -0
- package/dist/runnerUtility/guiAgentHeal.d.ts +128 -0
- package/dist/runnerUtility/guiAgentHeal.d.ts.map +1 -0
- package/dist/runnerUtility/guiAgentHeal.js +284 -0
- package/dist/runnerUtility/guiAgentHeal.js.map +1 -0
- package/dist/runnerUtility/homeFolders.d.ts +33 -0
- package/dist/runnerUtility/homeFolders.d.ts.map +1 -0
- package/dist/runnerUtility/homeFolders.js +158 -0
- package/dist/runnerUtility/homeFolders.js.map +1 -0
- package/dist/runnerUtility/hubClient.d.ts +12 -2
- package/dist/runnerUtility/hubClient.d.ts.map +1 -1
- package/dist/runnerUtility/hubClient.js +24 -3
- package/dist/runnerUtility/hubClient.js.map +1 -1
- package/dist/runnerUtility/iosCheck.d.ts +7 -1
- package/dist/runnerUtility/iosCheck.d.ts.map +1 -1
- package/dist/runnerUtility/iosCheck.js +14 -5
- package/dist/runnerUtility/iosCheck.js.map +1 -1
- package/dist/runnerUtility/isolatedCommand.d.ts +31 -0
- package/dist/runnerUtility/isolatedCommand.d.ts.map +1 -0
- package/dist/runnerUtility/isolatedCommand.js +132 -0
- package/dist/runnerUtility/isolatedCommand.js.map +1 -0
- package/dist/runnerUtility/keepAwake.d.ts +67 -0
- package/dist/runnerUtility/keepAwake.d.ts.map +1 -0
- package/dist/runnerUtility/keepAwake.js +211 -0
- package/dist/runnerUtility/keepAwake.js.map +1 -0
- package/dist/runnerUtility/lidPollTiming.d.ts +11 -0
- package/dist/runnerUtility/lidPollTiming.d.ts.map +1 -0
- package/dist/runnerUtility/lidPollTiming.js +18 -0
- package/dist/runnerUtility/lidPollTiming.js.map +1 -0
- package/dist/runnerUtility/lidState.d.ts +57 -0
- package/dist/runnerUtility/lidState.d.ts.map +1 -0
- package/dist/runnerUtility/lidState.js +195 -0
- package/dist/runnerUtility/lidState.js.map +1 -0
- package/dist/runnerUtility/linkLoop.d.ts +5 -0
- package/dist/runnerUtility/linkLoop.d.ts.map +1 -1
- package/dist/runnerUtility/linkLoop.js +37 -1
- package/dist/runnerUtility/linkLoop.js.map +1 -1
- package/dist/runnerUtility/packageManagerShims.d.ts +44 -0
- package/dist/runnerUtility/packageManagerShims.d.ts.map +1 -0
- package/dist/runnerUtility/packageManagerShims.js +130 -0
- package/dist/runnerUtility/packageManagerShims.js.map +1 -0
- package/dist/runnerUtility/progress.d.ts +43 -0
- package/dist/runnerUtility/progress.d.ts.map +1 -0
- package/dist/runnerUtility/progress.js +78 -0
- package/dist/runnerUtility/progress.js.map +1 -0
- package/dist/runnerUtility/pueueDaemon.d.ts +8 -4
- package/dist/runnerUtility/pueueDaemon.d.ts.map +1 -1
- package/dist/runnerUtility/pueueDaemon.js +12 -7
- package/dist/runnerUtility/pueueDaemon.js.map +1 -1
- package/dist/runnerUtility/rootServiceCli.d.ts +23 -3
- package/dist/runnerUtility/rootServiceCli.d.ts.map +1 -1
- package/dist/runnerUtility/rootServiceCli.js +56 -10
- package/dist/runnerUtility/rootServiceCli.js.map +1 -1
- package/dist/runnerUtility/runnerCli.d.ts +1 -0
- package/dist/runnerUtility/runnerCli.d.ts.map +1 -1
- package/dist/runnerUtility/runnerCli.js +14 -7
- package/dist/runnerUtility/runnerCli.js.map +1 -1
- package/dist/runnerUtility/runnerCommands.d.ts +45 -0
- package/dist/runnerUtility/runnerCommands.d.ts.map +1 -1
- package/dist/runnerUtility/runnerCommands.js +188 -21
- package/dist/runnerUtility/runnerCommands.js.map +1 -1
- package/dist/runnerUtility/runnerHome.d.ts +8 -0
- package/dist/runnerUtility/runnerHome.d.ts.map +1 -1
- package/dist/runnerUtility/runnerHome.js +7 -0
- package/dist/runnerUtility/runnerHome.js.map +1 -1
- package/dist/runnerUtility/serviceCommon.d.ts +4 -0
- package/dist/runnerUtility/serviceCommon.d.ts.map +1 -1
- package/dist/runnerUtility/serviceCommon.js +8 -1
- package/dist/runnerUtility/serviceCommon.js.map +1 -1
- package/dist/runnerUtility/serviceManager.d.ts +5 -2
- package/dist/runnerUtility/serviceManager.d.ts.map +1 -1
- package/dist/runnerUtility/serviceManager.js +40 -17
- package/dist/runnerUtility/serviceManager.js.map +1 -1
- package/dist/runnerUtility/serviceUnits.d.ts +11 -0
- package/dist/runnerUtility/serviceUnits.d.ts.map +1 -1
- package/dist/runnerUtility/serviceUnits.js +8 -2
- package/dist/runnerUtility/serviceUnits.js.map +1 -1
- package/dist/runnerUtility/simulatorSilencer.d.ts +55 -0
- package/dist/runnerUtility/simulatorSilencer.d.ts.map +1 -0
- package/dist/runnerUtility/simulatorSilencer.js +203 -0
- package/dist/runnerUtility/simulatorSilencer.js.map +1 -0
- package/dist/runnerUtility/stopSignals.d.ts +10 -0
- package/dist/runnerUtility/stopSignals.d.ts.map +1 -0
- package/dist/runnerUtility/stopSignals.js +27 -0
- package/dist/runnerUtility/stopSignals.js.map +1 -0
- package/dist/runnerUtility/versionPollTiming.d.ts +2 -3
- package/dist/runnerUtility/versionPollTiming.d.ts.map +1 -1
- package/dist/runnerUtility/versionPollTiming.js +4 -18
- package/dist/runnerUtility/versionPollTiming.js.map +1 -1
- package/dist/runners/bootstrapLine.d.ts.map +1 -1
- package/dist/runners/bootstrapLine.js +35 -19
- package/dist/runners/bootstrapLine.js.map +1 -1
- package/dist/runners/gate.d.ts.map +1 -1
- package/dist/runners/gate.js +28 -1
- package/dist/runners/gate.js.map +1 -1
- package/dist/runners/gateLink.d.ts +7 -0
- package/dist/runners/gateLink.d.ts.map +1 -1
- package/dist/runners/gateLink.js +36 -3
- package/dist/runners/gateLink.js.map +1 -1
- package/dist/runners/gateProtocol.d.ts +37 -2
- package/dist/runners/gateProtocol.d.ts.map +1 -1
- package/dist/runners/gateProtocol.js +45 -4
- package/dist/runners/gateProtocol.js.map +1 -1
- package/dist/runners/hubPackage.d.ts +2 -1
- package/dist/runners/hubPackage.d.ts.map +1 -1
- package/dist/runners/hubPackage.js +32 -11
- package/dist/runners/hubPackage.js.map +1 -1
- package/dist/runners/hubPairing.d.ts +1 -1
- package/dist/runners/hubPairing.d.ts.map +1 -1
- package/dist/runners/hubPairing.js +8 -1
- package/dist/runners/hubPairing.js.map +1 -1
- package/dist/runners/hubPaths.d.ts +2 -0
- package/dist/runners/hubPaths.d.ts.map +1 -1
- package/dist/runners/hubPaths.js +1 -1
- package/dist/runners/hubPaths.js.map +1 -1
- package/dist/runners/linkConcern.d.ts +75 -0
- package/dist/runners/linkConcern.d.ts.map +1 -0
- package/dist/runners/linkConcern.js +85 -0
- package/dist/runners/linkConcern.js.map +1 -0
- package/dist/runners/linkControl.d.ts +25 -1
- package/dist/runners/linkControl.d.ts.map +1 -1
- package/dist/runners/linkControl.js +46 -4
- package/dist/runners/linkControl.js.map +1 -1
- package/dist/runners/pairingTiming.d.ts +2 -3
- package/dist/runners/pairingTiming.d.ts.map +1 -1
- package/dist/runners/pairingTiming.js +4 -18
- package/dist/runners/pairingTiming.js.map +1 -1
- package/dist/runners/runnerLock.d.ts +112 -0
- package/dist/runners/runnerLock.d.ts.map +1 -0
- package/dist/runners/runnerLock.js +292 -0
- package/dist/runners/runnerLock.js.map +1 -0
- package/dist/runners/runnersCli.d.ts +6 -3
- package/dist/runners/runnersCli.d.ts.map +1 -1
- package/dist/runners/runnersCli.js +33 -6
- package/dist/runners/runnersCli.js.map +1 -1
- package/dist/runners/runnersList.d.ts +3 -3
- package/dist/runners/runnersList.d.ts.map +1 -1
- package/dist/runners/runnersList.js +9 -2
- package/dist/runners/runnersList.js.map +1 -1
- package/dist/runners/runnersOverview.d.ts +29 -3
- package/dist/runners/runnersOverview.d.ts.map +1 -1
- package/dist/runners/runnersOverview.js +71 -6
- package/dist/runners/runnersOverview.js.map +1 -1
- package/dist/runners/serviceRemoval.d.ts +43 -0
- package/dist/runners/serviceRemoval.d.ts.map +1 -0
- package/dist/runners/serviceRemoval.js +114 -0
- package/dist/runners/serviceRemoval.js.map +1 -0
- package/dist/scheduler/checkRun.d.ts +9 -10
- package/dist/scheduler/checkRun.d.ts.map +1 -1
- package/dist/scheduler/checkRun.js +8 -16
- package/dist/scheduler/checkRun.js.map +1 -1
- package/dist/scheduler/checkStatus.d.ts +75 -0
- package/dist/scheduler/checkStatus.d.ts.map +1 -0
- package/dist/scheduler/checkStatus.js +117 -0
- package/dist/scheduler/checkStatus.js.map +1 -0
- package/dist/scheduler/delivery.d.ts +106 -38
- package/dist/scheduler/delivery.d.ts.map +1 -1
- package/dist/scheduler/delivery.js +199 -73
- package/dist/scheduler/delivery.js.map +1 -1
- package/dist/scheduler/mcpSurface.d.ts +8 -2
- package/dist/scheduler/mcpSurface.d.ts.map +1 -1
- package/dist/scheduler/mcpSurface.js +96 -20
- package/dist/scheduler/mcpSurface.js.map +1 -1
- package/dist/scheduler/recurrence.d.ts +32 -0
- package/dist/scheduler/recurrence.d.ts.map +1 -1
- package/dist/scheduler/recurrence.js +56 -18
- package/dist/scheduler/recurrence.js.map +1 -1
- package/dist/scheduler/scheduleText.d.ts +7 -0
- package/dist/scheduler/scheduleText.d.ts.map +1 -0
- package/dist/scheduler/scheduleText.js +55 -0
- package/dist/scheduler/scheduleText.js.map +1 -0
- package/dist/scheduler/store.d.ts +23 -2
- package/dist/scheduler/store.d.ts.map +1 -1
- package/dist/scheduler/store.js +57 -3
- package/dist/scheduler/store.js.map +1 -1
- package/dist/scheduler/types.d.ts +26 -10
- package/dist/scheduler/types.d.ts.map +1 -1
- package/dist/scheduler/unbindPause.d.ts +27 -0
- package/dist/scheduler/unbindPause.d.ts.map +1 -0
- package/dist/scheduler/unbindPause.js +21 -0
- package/dist/scheduler/unbindPause.js.map +1 -0
- package/dist/scheduler/workerActivity.d.ts +25 -0
- package/dist/scheduler/workerActivity.d.ts.map +1 -0
- package/dist/scheduler/workerActivity.js +195 -0
- package/dist/scheduler/workerActivity.js.map +1 -0
- package/dist/scheduler/workerWatch.d.ts +36 -9
- package/dist/scheduler/workerWatch.d.ts.map +1 -1
- package/dist/scheduler/workerWatch.js +41 -11
- package/dist/scheduler/workerWatch.js.map +1 -1
- package/dist/state.d.ts +8 -0
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +30 -0
- package/dist/state.js.map +1 -1
- package/dist/stt/sttRuntime.d.ts.map +1 -1
- package/dist/stt/sttRuntime.js +8 -1
- package/dist/stt/sttRuntime.js.map +1 -1
- package/dist/stt/sttSettings.d.ts +56 -6
- package/dist/stt/sttSettings.d.ts.map +1 -1
- package/dist/stt/sttSettings.js +128 -7
- package/dist/stt/sttSettings.js.map +1 -1
- package/dist/stt/sttSidecarOwner.d.ts +13 -5
- package/dist/stt/sttSidecarOwner.d.ts.map +1 -1
- package/dist/stt/sttSidecarOwner.js +72 -31
- package/dist/stt/sttSidecarOwner.js.map +1 -1
- package/dist/stt/transcribeChain.d.ts +23 -1
- package/dist/stt/transcribeChain.d.ts.map +1 -1
- package/dist/stt/transcribeChain.js +59 -4
- package/dist/stt/transcribeChain.js.map +1 -1
- package/dist/testTimings.d.ts +4 -2
- package/dist/testTimings.d.ts.map +1 -1
- package/dist/testTimings.js +7 -1
- package/dist/testTimings.js.map +1 -1
- package/dist/testTimingsSeam.d.ts +10 -0
- package/dist/testTimingsSeam.d.ts.map +1 -0
- package/dist/testTimingsSeam.js +29 -0
- package/dist/testTimingsSeam.js.map +1 -0
- package/dist/utils/claudeUsage.d.ts +3 -0
- package/dist/utils/claudeUsage.d.ts.map +1 -1
- package/dist/utils/claudeUsage.js +8 -1
- package/dist/utils/claudeUsage.js.map +1 -1
- package/dist/utils/claudeUsageRefresher.d.ts +27 -3
- package/dist/utils/claudeUsageRefresher.d.ts.map +1 -1
- package/dist/utils/claudeUsageRefresher.js +113 -14
- package/dist/utils/claudeUsageRefresher.js.map +1 -1
- package/dist/utils/forwardedMark.d.ts +54 -0
- package/dist/utils/forwardedMark.d.ts.map +1 -0
- package/dist/utils/forwardedMark.js +80 -0
- package/dist/utils/forwardedMark.js.map +1 -0
- package/dist/utils/limitHeldPrompts.d.ts +8 -2
- package/dist/utils/limitHeldPrompts.d.ts.map +1 -1
- package/dist/utils/limitHeldPrompts.js +11 -4
- package/dist/utils/limitHeldPrompts.js.map +1 -1
- package/dist/utils/messageContext.d.ts +54 -0
- package/dist/utils/messageContext.d.ts.map +1 -0
- package/dist/utils/messageContext.js +58 -0
- package/dist/utils/messageContext.js.map +1 -0
- package/dist/utils/openCodeUsage.d.ts +10 -3
- package/dist/utils/openCodeUsage.d.ts.map +1 -1
- package/dist/utils/openCodeUsage.js +19 -5
- package/dist/utils/openCodeUsage.js.map +1 -1
- package/dist/utils/replyQuote.d.ts +11 -26
- package/dist/utils/replyQuote.d.ts.map +1 -1
- package/dist/utils/replyQuote.js +9 -31
- package/dist/utils/replyQuote.js.map +1 -1
- package/dist/utils/runnersScreenPlan.d.ts +14 -0
- package/dist/utils/runnersScreenPlan.d.ts.map +1 -1
- package/dist/utils/runnersScreenPlan.js +49 -5
- package/dist/utils/runnersScreenPlan.js.map +1 -1
- package/dist/utils/stripControlCharacters.d.ts +8 -0
- package/dist/utils/stripControlCharacters.d.ts.map +1 -0
- package/dist/utils/stripControlCharacters.js +16 -0
- package/dist/utils/stripControlCharacters.js.map +1 -0
- package/dist/utils/surrogateSafeCut.d.ts +14 -0
- package/dist/utils/surrogateSafeCut.d.ts.map +1 -0
- package/dist/utils/surrogateSafeCut.js +30 -0
- package/dist/utils/surrogateSafeCut.js.map +1 -0
- package/dist/utils/telegramError.d.ts +13 -0
- package/dist/utils/telegramError.d.ts.map +1 -1
- package/dist/utils/telegramError.js +45 -0
- package/dist/utils/telegramError.js.map +1 -1
- package/dist/utils/topicRequest.d.ts +13 -0
- package/dist/utils/topicRequest.d.ts.map +1 -1
- package/dist/utils/topicRequest.js +10 -0
- package/dist/utils/topicRequest.js.map +1 -1
- package/dist/utils/transientFrames.d.ts +51 -6
- package/dist/utils/transientFrames.d.ts.map +1 -1
- package/dist/utils/transientFrames.js +52 -2
- package/dist/utils/transientFrames.js.map +1 -1
- package/dist/utils/usageRefreshBudget.d.ts.map +1 -1
- package/dist/utils/usageRefreshBudget.js +4 -10
- package/dist/utils/usageRefreshBudget.js.map +1 -1
- package/dist/utils/waitUpTo.d.ts +8 -0
- package/dist/utils/waitUpTo.d.ts.map +1 -0
- package/dist/utils/waitUpTo.js +20 -0
- package/dist/utils/waitUpTo.js.map +1 -0
- package/dist/voiceProgressNote.d.ts +73 -0
- package/dist/voiceProgressNote.d.ts.map +1 -0
- package/dist/voiceProgressNote.js +142 -0
- package/dist/voiceProgressNote.js.map +1 -0
- package/package.json +4 -1
- package/remoteRun/pickNode.sh +65 -0
- package/remoteRun/runner-package-lock.json +59 -0
- 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,
|
|
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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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
|
-
|
|
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
|
-
|
|
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
|
|
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":"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,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACtC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,KAAK,KAAK,CAAC,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/runners/serviceRemoval.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,0EAWC;AAMD,wDAEC;AAeD,kEAKC;AAMD,4DAOC;AAGD,0EAEC;AAtFD,2CAA6B;AAE7B,kDAAqD;AACrD,kEAAiE;AACjE,4DAAiE;AACjE,gEAAgE;AAEhE,6CAAgD;AAChD,+CAA0F;AAC1F,2DAA4D;AAE5D;;;;;;;;;GASG;AAEH,0DAA0D;AAC7C,QAAA,gBAAgB,GAAG,wBAAwB,CAAC;AAEzD;;;GAGG;AACH,SAAgB,+BAA+B,CAAC,MAAoB;IAClE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3D,MAAM,KAAK,GAAG,IAAA,+BAAkB,EAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,KAAK,CAAC,OAAO,KAAK,MAAM,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAClD,MAAM,KAAK,GAAG,IAAA,8BAAe,EAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,IAAA,+BAAe,EAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,wBAAgB,CAAC,CAAC;IACtE,OAAO;QACL,iCAAiC,KAAK,CAAC,WAAW,EAAE;QACpD,iCAAiC,KAAK,CAAC,aAAa,EAAE;QACtD,WAAW,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE;KACxC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,MAAoB,EAAE,KAAyB;IACpF,OAAO,IAAA,yCAAqB,EAAC,MAAM,EAAE,KAAK,CAAC,KAA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
|
|
3
3
|
* `schedule_create` + `checkCommand`. At fire time the BOT runs the command in the
|
|
4
4
|
* topic's bound folder; exit 0 is a pass and stays silent. The first failure after
|
|
5
|
-
* a pass
|
|
6
|
-
* and the
|
|
7
|
-
*
|
|
5
|
+
* a pass posts one short silent notice (never the command; the output tail folded
|
|
6
|
+
* under it) and wakes the agent with the job's prompt plus the failure and the
|
|
7
|
+
* output tail; further failures stay silent until a run passes again, which posts
|
|
8
|
+
* one "is back to normal" line.
|
|
8
9
|
*
|
|
9
10
|
* WHY the bot runs it: a watcher the agent builds itself (a background loop,
|
|
10
11
|
* `nohup`, a `sleep` loop, a tmux pane) dies with the session, a bot restart or a
|
|
@@ -23,9 +24,9 @@ export declare const maxCheckCommandLength = 1000;
|
|
|
23
24
|
/** Output kept from a run (its TAIL — the end of a log is where the failure is). */
|
|
24
25
|
export declare const checkOutputMaxChars = 3000;
|
|
25
26
|
/**
|
|
26
|
-
* Output tail shown in the topic alert. Shorter than {@link checkOutputMaxChars}
|
|
27
|
-
* so the alert stays under Telegram's 4096-character message cap with the
|
|
28
|
-
*
|
|
27
|
+
* Output tail shown (folded) in the topic alert. Shorter than {@link checkOutputMaxChars}
|
|
28
|
+
* so the alert stays well under Telegram's 4096-character message cap with the
|
|
29
|
+
* job name and the failure around it; the agent gets the full kept tail.
|
|
29
30
|
*/
|
|
30
31
|
export declare const checkAlertOutputMaxChars = 1500;
|
|
31
32
|
/**
|
|
@@ -46,14 +47,14 @@ export interface CheckRunResult {
|
|
|
46
47
|
export declare function checkIsCheckPassing(result: CheckRunResult): boolean;
|
|
47
48
|
/**
|
|
48
49
|
* What a finished run should produce: nothing (`quiet`), the alert that wakes
|
|
49
|
-
* the agent (`alert`), or the one "
|
|
50
|
+
* the agent (`alert`), or the one "back to normal" line (`recovered`).
|
|
50
51
|
*/
|
|
51
52
|
export type CheckAlertDecision = 'quiet' | 'alert' | 'recovered';
|
|
52
53
|
/**
|
|
53
54
|
* @description Alert on the passing → failing edge only, and announce the
|
|
54
55
|
* failing → passing edge once. A check that keeps failing stays quiet: it already
|
|
55
56
|
* raised its alert and woke the agent, and repeating that on every run would bury
|
|
56
|
-
* the topic in
|
|
57
|
+
* the topic in alerts.
|
|
57
58
|
*/
|
|
58
59
|
export declare function getCheckAlertDecision(input: {
|
|
59
60
|
isPassing: boolean;
|
|
@@ -63,8 +64,6 @@ export declare function getCheckAlertDecision(input: {
|
|
|
63
64
|
export declare function describeCheckFailure(result: CheckRunResult, timeoutSec: number): string;
|
|
64
65
|
/** @description The last `maxChars` characters of `text`, marked when something was cut. */
|
|
65
66
|
export declare function getOutputTail(text: string, maxChars: number): string;
|
|
66
|
-
/** @description The command as the topic alert shows it, cut to a readable length. */
|
|
67
|
-
export declare function getCheckAlertCommand(command: string): string;
|
|
68
67
|
/**
|
|
69
68
|
* @description The prompt the agent is woken with: what failed and how, the
|
|
70
69
|
* output tail, then the job's own prompt (what to do about it). English, like the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkRun.d.ts","sourceRoot":"","sources":["../../src/scheduler/checkRun.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"checkRun.d.ts","sourceRoot":"","sources":["../../src/scheduler/checkRun.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,2EAA2E;AAC3E,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,uCAAuC;AACvC,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,oFAAoF;AACpF,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAQ7C;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;IAC9B,UAAU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Passing = checkIsCheckPassing;
|
|
|
5
5
|
exports.getCheckAlertDecision = getCheckAlertDecision;
|
|
6
6
|
exports.describeCheckFailure = describeCheckFailure;
|
|
7
7
|
exports.getOutputTail = getOutputTail;
|
|
8
|
-
exports.getCheckAlertCommand = getCheckAlertCommand;
|
|
9
8
|
exports.buildCheckFailurePrompt = buildCheckFailurePrompt;
|
|
10
9
|
exports.buildCheckEnv = buildCheckEnv;
|
|
11
10
|
exports.runCheckCommand = runCheckCommand;
|
|
@@ -14,9 +13,10 @@ const node_child_process_1 = require("node:child_process");
|
|
|
14
13
|
* @description The `'check'` delivery kind: a watchdog the agent creates with
|
|
15
14
|
* `schedule_create` + `checkCommand`. At fire time the BOT runs the command in the
|
|
16
15
|
* topic's bound folder; exit 0 is a pass and stays silent. The first failure after
|
|
17
|
-
* a pass
|
|
18
|
-
* and the
|
|
19
|
-
*
|
|
16
|
+
* a pass posts one short silent notice (never the command; the output tail folded
|
|
17
|
+
* under it) and wakes the agent with the job's prompt plus the failure and the
|
|
18
|
+
* output tail; further failures stay silent until a run passes again, which posts
|
|
19
|
+
* one "is back to normal" line.
|
|
20
20
|
*
|
|
21
21
|
* WHY the bot runs it: a watcher the agent builds itself (a background loop,
|
|
22
22
|
* `nohup`, a `sleep` loop, a tmux pane) dies with the session, a bot restart or a
|
|
@@ -35,13 +35,11 @@ exports.maxCheckCommandLength = 1000;
|
|
|
35
35
|
/** Output kept from a run (its TAIL — the end of a log is where the failure is). */
|
|
36
36
|
exports.checkOutputMaxChars = 3000;
|
|
37
37
|
/**
|
|
38
|
-
* Output tail shown in the topic alert. Shorter than {@link checkOutputMaxChars}
|
|
39
|
-
* so the alert stays under Telegram's 4096-character message cap with the
|
|
40
|
-
*
|
|
38
|
+
* Output tail shown (folded) in the topic alert. Shorter than {@link checkOutputMaxChars}
|
|
39
|
+
* so the alert stays well under Telegram's 4096-character message cap with the
|
|
40
|
+
* job name and the failure around it; the agent gets the full kept tail.
|
|
41
41
|
*/
|
|
42
42
|
exports.checkAlertOutputMaxChars = 1500;
|
|
43
|
-
/** Command text shown in the topic alert. */
|
|
44
|
-
const checkAlertCommandMaxChars = 300;
|
|
45
43
|
/** Pause between SIGTERM and SIGKILL for a check that outlived its timeout. */
|
|
46
44
|
const checkKillGraceMs = 5000;
|
|
47
45
|
/** Environment variables a check never sees: its output is posted into the topic. */
|
|
@@ -54,7 +52,7 @@ function checkIsCheckPassing(result) {
|
|
|
54
52
|
* @description Alert on the passing → failing edge only, and announce the
|
|
55
53
|
* failing → passing edge once. A check that keeps failing stays quiet: it already
|
|
56
54
|
* raised its alert and woke the agent, and repeating that on every run would bury
|
|
57
|
-
* the topic in
|
|
55
|
+
* the topic in alerts.
|
|
58
56
|
*/
|
|
59
57
|
function getCheckAlertDecision(input) {
|
|
60
58
|
if (input.isPassing)
|
|
@@ -77,12 +75,6 @@ function getOutputTail(text, maxChars) {
|
|
|
77
75
|
return text;
|
|
78
76
|
return `…${text.slice(text.length - maxChars + 1)}`;
|
|
79
77
|
}
|
|
80
|
-
/** @description The command as the topic alert shows it, cut to a readable length. */
|
|
81
|
-
function getCheckAlertCommand(command) {
|
|
82
|
-
return command.length <= checkAlertCommandMaxChars
|
|
83
|
-
? command
|
|
84
|
-
: `${command.slice(0, checkAlertCommandMaxChars - 1)}…`;
|
|
85
|
-
}
|
|
86
78
|
/**
|
|
87
79
|
* @description The prompt the agent is woken with: what failed and how, the
|
|
88
80
|
* output tail, then the job's own prompt (what to do about it). English, like the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkRun.js","sourceRoot":"","sources":["../../src/scheduler/checkRun.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"checkRun.js","sourceRoot":"","sources":["../../src/scheduler/checkRun.ts"],"names":[],"mappings":";;;AA6DA,kDAEC;AAcD,sDAGC;AAGD,oDAKC;AAGD,sCAGC;AAOD,0DAqBC;AAGD,sCAIC;AASD,0CAyDC;AAnMD,2DAA2C;AAE3C;;;;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YACjB,YAAY,CAAC,YAAY,CAAC,CAAC;YAC3B,IAAI,SAAS;gBAAE,YAAY,CAAC,SAAS,CAAC,CAAC;YACvC,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC,CAAC;QAEF,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YAC1B,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QACjG,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
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 The ONE gate that decides whether a topic shows status lines: a Telegram conversation (a tracker issue gets no
|
|
46
|
+
* message, no comment, no edited note) whose view shows the agent's stream — the answers-only view shows nothing but answers.
|
|
47
|
+
*/
|
|
48
|
+
export declare function checkIsCheckStatusShown(input: {
|
|
49
|
+
isTelegram: boolean;
|
|
50
|
+
view: TopicView;
|
|
51
|
+
}): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* @description One line of activity text: whitespace collapsed, cut to {@link checkStatusActivityMaxChars} with an ellipsis;
|
|
54
|
+
* `null` when nothing readable is left. Shared by the log reader and the `statusCommand` output.
|
|
55
|
+
*/
|
|
56
|
+
export declare function formatCheckStatusActivity(text: string): string | null;
|
|
57
|
+
/**
|
|
58
|
+
* @description The «now» of a `statusCommand`: the first non-empty line of its output, which is stdout and stderr together,
|
|
59
|
+
* so a command that only complained has a «now» of its complaint — callers pass the output of a run that exited 0.
|
|
60
|
+
*/
|
|
61
|
+
export declare function getCheckStatusActivityFromOutput(output: string): string | null;
|
|
62
|
+
/** @description «N min» under an hour, «H h M min» from an hour on (rounded to the nearest minute). */
|
|
63
|
+
export declare function getCheckStatusElapsedText(elapsedMs: number): string;
|
|
64
|
+
/** @description A check's name as the topic shows it: without the recipe's leading `watch ` (`watch builder S2` → `builder S2`). */
|
|
65
|
+
export declare function getCheckShownName(name: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* @description The status line: `⏳ <name> · works <elapsed>[ · now: <activity>]`. The name is the check's own without the
|
|
68
|
+
* recipe's leading `watch `; the «now» part is left out when there is nothing readable to say.
|
|
69
|
+
*/
|
|
70
|
+
export declare function buildCheckStatusLine(input: {
|
|
71
|
+
name: string;
|
|
72
|
+
elapsedMs: number;
|
|
73
|
+
activity: string | null;
|
|
74
|
+
}): string;
|
|
75
|
+
//# sourceMappingURL=checkStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkStatus.d.ts","sourceRoot":"","sources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