charness 3.7.0 → 3.9.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 +36 -0
- package/DEVELOPMENT.md +8 -2
- package/README.md +5 -5
- package/SETUP.md +17 -5
- package/agent-plugin/skills/charness-manager/SKILL.md +3 -3
- package/dist/adapters/openCodeAdapter.d.ts.map +1 -1
- package/dist/adapters/openCodeAdapter.js +2 -1
- package/dist/adapters/openCodeAdapter.js.map +1 -1
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +50 -9
- package/dist/bot.js.map +1 -1
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +56 -6
- package/dist/cli.js.map +1 -1
- package/dist/configDirFile.d.ts +7 -3
- package/dist/configDirFile.d.ts.map +1 -1
- package/dist/configDirFile.js +12 -5
- package/dist/configDirFile.js.map +1 -1
- package/dist/connectors/telegram/commands/botCore.d.ts +5 -1
- package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/runners.d.ts +52 -0
- package/dist/connectors/telegram/commands/runners.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/runners.js +524 -0
- package/dist/connectors/telegram/commands/runners.js.map +1 -0
- package/dist/connectors/telegram/runnerPairingMessages.d.ts +29 -0
- package/dist/connectors/telegram/runnerPairingMessages.d.ts.map +1 -0
- package/dist/connectors/telegram/runnerPairingMessages.js +112 -0
- package/dist/connectors/telegram/runnerPairingMessages.js.map +1 -0
- package/dist/i18n/de.d.ts.map +1 -1
- package/dist/i18n/de.js +60 -0
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +60 -0
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +60 -0
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +60 -0
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/hi.d.ts.map +1 -1
- package/dist/i18n/hi.js +60 -0
- package/dist/i18n/hi.js.map +1 -1
- package/dist/i18n/ja.d.ts.map +1 -1
- package/dist/i18n/ja.js +60 -0
- package/dist/i18n/ja.js.map +1 -1
- package/dist/i18n/ka.d.ts.map +1 -1
- package/dist/i18n/ka.js +60 -0
- package/dist/i18n/ka.js.map +1 -1
- package/dist/i18n/pt.d.ts.map +1 -1
- package/dist/i18n/pt.js +60 -0
- package/dist/i18n/pt.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +60 -0
- package/dist/i18n/ru.js.map +1 -1
- package/dist/i18n/uk.d.ts.map +1 -1
- package/dist/i18n/uk.js +60 -0
- package/dist/i18n/uk.js.map +1 -1
- package/dist/i18n/uz.d.ts.map +1 -1
- package/dist/i18n/uz.js +60 -0
- package/dist/i18n/uz.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +60 -0
- package/dist/i18n/zh.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/installManager.d.ts +57 -1
- package/dist/installManager.d.ts.map +1 -1
- package/dist/installManager.js +88 -10
- package/dist/installManager.js.map +1 -1
- package/dist/instanceSettings.d.ts +12 -2
- package/dist/instanceSettings.d.ts.map +1 -1
- package/dist/instanceSettings.js +17 -3
- package/dist/instanceSettings.js.map +1 -1
- package/dist/outputTrace.d.ts +6 -0
- package/dist/outputTrace.d.ts.map +1 -1
- package/dist/outputTrace.js +24 -1
- package/dist/outputTrace.js.map +1 -1
- package/dist/remoteRun/cliArgs.d.ts +2 -0
- package/dist/remoteRun/cliArgs.d.ts.map +1 -1
- package/dist/remoteRun/cliArgs.js +11 -2
- package/dist/remoteRun/cliArgs.js.map +1 -1
- package/dist/remoteRun/commands.d.ts +21 -0
- package/dist/remoteRun/commands.d.ts.map +1 -1
- package/dist/remoteRun/commands.js +38 -17
- package/dist/remoteRun/commands.js.map +1 -1
- package/dist/remoteRun/interrupts.d.ts +10 -0
- package/dist/remoteRun/interrupts.d.ts.map +1 -1
- package/dist/remoteRun/interrupts.js +43 -6
- package/dist/remoteRun/interrupts.js.map +1 -1
- package/dist/remoteRun/output.d.ts +2 -0
- package/dist/remoteRun/output.d.ts.map +1 -1
- package/dist/remoteRun/output.js +45 -0
- package/dist/remoteRun/output.js.map +1 -1
- package/dist/remoteRun/pairedRunners.d.ts +51 -0
- package/dist/remoteRun/pairedRunners.d.ts.map +1 -0
- package/dist/remoteRun/pairedRunners.js +165 -0
- package/dist/remoteRun/pairedRunners.js.map +1 -0
- package/dist/remoteRun/probe.d.ts +23 -1
- package/dist/remoteRun/probe.d.ts.map +1 -1
- package/dist/remoteRun/probe.js +45 -11
- package/dist/remoteRun/probe.js.map +1 -1
- package/dist/remoteRun/remoteRunCli.d.ts +13 -6
- package/dist/remoteRun/remoteRunCli.d.ts.map +1 -1
- package/dist/remoteRun/remoteRunCli.js +34 -59
- package/dist/remoteRun/remoteRunCli.js.map +1 -1
- package/dist/remoteRun/runnerClient.d.ts +2 -0
- package/dist/remoteRun/runnerClient.d.ts.map +1 -1
- package/dist/remoteRun/runnerClient.js +5 -1
- package/dist/remoteRun/runnerClient.js.map +1 -1
- package/dist/remoteRun/runnerSummary.d.ts +24 -0
- package/dist/remoteRun/runnerSummary.d.ts.map +1 -0
- package/dist/remoteRun/runnerSummary.js +86 -0
- package/dist/remoteRun/runnerSummary.js.map +1 -0
- package/dist/remoteRun/runnerWait.d.ts +68 -0
- package/dist/remoteRun/runnerWait.d.ts.map +1 -0
- package/dist/remoteRun/runnerWait.js +137 -0
- package/dist/remoteRun/runnerWait.js.map +1 -0
- package/dist/remoteRun/runnerWaitTiming.d.ts +16 -0
- package/dist/remoteRun/runnerWaitTiming.d.ts.map +1 -0
- package/dist/remoteRun/runnerWaitTiming.js +37 -0
- package/dist/remoteRun/runnerWaitTiming.js.map +1 -0
- package/dist/remoteRun/runners.d.ts +15 -8
- package/dist/remoteRun/runners.d.ts.map +1 -1
- package/dist/remoteRun/runners.js +59 -19
- package/dist/remoteRun/runners.js.map +1 -1
- package/dist/remoteRun/runnersCatalog.d.ts +14 -0
- package/dist/remoteRun/runnersCatalog.d.ts.map +1 -0
- package/dist/remoteRun/runnersCatalog.js +68 -0
- package/dist/remoteRun/runnersCatalog.js.map +1 -0
- package/dist/remoteRun/runnersConfig.d.ts +31 -20
- package/dist/remoteRun/runnersConfig.d.ts.map +1 -1
- package/dist/remoteRun/runnersConfig.js +14 -12
- package/dist/remoteRun/runnersConfig.js.map +1 -1
- package/dist/remoteRun/ssh.d.ts +22 -2
- package/dist/remoteRun/ssh.d.ts.map +1 -1
- package/dist/remoteRun/ssh.js +41 -7
- package/dist/remoteRun/ssh.js.map +1 -1
- package/dist/runnerUtility/adminCheck.d.ts +18 -0
- package/dist/runnerUtility/adminCheck.d.ts.map +1 -0
- package/dist/runnerUtility/adminCheck.js +69 -0
- package/dist/runnerUtility/adminCheck.js.map +1 -0
- package/dist/runnerUtility/adminService.d.ts +22 -0
- package/dist/runnerUtility/adminService.d.ts.map +1 -0
- package/dist/runnerUtility/adminService.js +145 -0
- package/dist/runnerUtility/adminService.js.map +1 -0
- package/dist/runnerUtility/appInstall.d.ts +25 -0
- package/dist/runnerUtility/appInstall.d.ts.map +1 -0
- package/dist/runnerUtility/appInstall.js +147 -0
- package/dist/runnerUtility/appInstall.js.map +1 -0
- package/dist/runnerUtility/appUpdate.d.ts +39 -0
- package/dist/runnerUtility/appUpdate.d.ts.map +1 -0
- package/dist/runnerUtility/appUpdate.js +90 -0
- package/dist/runnerUtility/appUpdate.js.map +1 -0
- package/dist/runnerUtility/execEnv.d.ts +21 -0
- package/dist/runnerUtility/execEnv.d.ts.map +1 -0
- package/dist/runnerUtility/execEnv.js +109 -0
- package/dist/runnerUtility/execEnv.js.map +1 -0
- package/dist/runnerUtility/execSession.d.ts +13 -0
- package/dist/runnerUtility/execSession.d.ts.map +1 -0
- package/dist/runnerUtility/execSession.js +58 -0
- package/dist/runnerUtility/execSession.js.map +1 -0
- package/dist/runnerUtility/hubClient.d.ts +30 -0
- package/dist/runnerUtility/hubClient.d.ts.map +1 -0
- package/dist/runnerUtility/hubClient.js +127 -0
- package/dist/runnerUtility/hubClient.js.map +1 -0
- package/dist/runnerUtility/injectStream.d.ts +9 -0
- package/dist/runnerUtility/injectStream.d.ts.map +1 -0
- package/dist/runnerUtility/injectStream.js +12 -0
- package/dist/runnerUtility/injectStream.js.map +1 -0
- package/dist/runnerUtility/iosCheck.d.ts +62 -0
- package/dist/runnerUtility/iosCheck.d.ts.map +1 -0
- package/dist/runnerUtility/iosCheck.js +200 -0
- package/dist/runnerUtility/iosCheck.js.map +1 -0
- package/dist/runnerUtility/launcher.d.ts +5 -0
- package/dist/runnerUtility/launcher.d.ts.map +1 -0
- package/dist/runnerUtility/launcher.js +85 -0
- package/dist/runnerUtility/launcher.js.map +1 -0
- package/dist/runnerUtility/linkLoop.d.ts +39 -0
- package/dist/runnerUtility/linkLoop.d.ts.map +1 -0
- package/dist/runnerUtility/linkLoop.js +274 -0
- package/dist/runnerUtility/linkLoop.js.map +1 -0
- package/dist/runnerUtility/localLinkStop.d.ts +23 -0
- package/dist/runnerUtility/localLinkStop.d.ts.map +1 -0
- package/dist/runnerUtility/localLinkStop.js +79 -0
- package/dist/runnerUtility/localLinkStop.js.map +1 -0
- package/dist/runnerUtility/machineReport.d.ts +39 -0
- package/dist/runnerUtility/machineReport.d.ts.map +1 -0
- package/dist/runnerUtility/machineReport.js +161 -0
- package/dist/runnerUtility/machineReport.js.map +1 -0
- package/dist/runnerUtility/packageId.d.ts +5 -0
- package/dist/runnerUtility/packageId.d.ts.map +1 -0
- package/dist/runnerUtility/packageId.js +64 -0
- package/dist/runnerUtility/packageId.js.map +1 -0
- package/dist/runnerUtility/pairArgs.d.ts +16 -0
- package/dist/runnerUtility/pairArgs.d.ts.map +1 -0
- package/dist/runnerUtility/pairArgs.js +17 -0
- package/dist/runnerUtility/pairArgs.js.map +1 -0
- package/dist/runnerUtility/pairingRecovery.d.ts +31 -0
- package/dist/runnerUtility/pairingRecovery.d.ts.map +1 -0
- package/dist/runnerUtility/pairingRecovery.js +24 -0
- package/dist/runnerUtility/pairingRecovery.js.map +1 -0
- package/dist/runnerUtility/pueueDaemon.d.ts +36 -0
- package/dist/runnerUtility/pueueDaemon.d.ts.map +1 -0
- package/dist/runnerUtility/pueueDaemon.js +165 -0
- package/dist/runnerUtility/pueueDaemon.js.map +1 -0
- package/dist/runnerUtility/rootServiceCli.d.ts +8 -0
- package/dist/runnerUtility/rootServiceCli.d.ts.map +1 -0
- package/dist/runnerUtility/rootServiceCli.js +31 -0
- package/dist/runnerUtility/rootServiceCli.js.map +1 -0
- package/dist/runnerUtility/runnerCli.d.ts +18 -0
- package/dist/runnerUtility/runnerCli.d.ts.map +1 -0
- package/dist/runnerUtility/runnerCli.js +190 -0
- package/dist/runnerUtility/runnerCli.js.map +1 -0
- package/dist/runnerUtility/runnerCommands.d.ts +76 -0
- package/dist/runnerUtility/runnerCommands.d.ts.map +1 -0
- package/dist/runnerUtility/runnerCommands.js +464 -0
- package/dist/runnerUtility/runnerCommands.js.map +1 -0
- package/dist/runnerUtility/runnerConfig.d.ts +63 -0
- package/dist/runnerUtility/runnerConfig.d.ts.map +1 -0
- package/dist/runnerUtility/runnerConfig.js +153 -0
- package/dist/runnerUtility/runnerConfig.js.map +1 -0
- package/dist/runnerUtility/runnerFlags.d.ts +9 -0
- package/dist/runnerUtility/runnerFlags.d.ts.map +1 -0
- package/dist/runnerUtility/runnerFlags.js +53 -0
- package/dist/runnerUtility/runnerFlags.js.map +1 -0
- package/dist/runnerUtility/runnerHome.d.ts +30 -0
- package/dist/runnerUtility/runnerHome.d.ts.map +1 -0
- package/dist/runnerUtility/runnerHome.js +82 -0
- package/dist/runnerUtility/runnerHome.js.map +1 -0
- package/dist/runnerUtility/runnerKeys.d.ts +11 -0
- package/dist/runnerUtility/runnerKeys.d.ts.map +1 -0
- package/dist/runnerUtility/runnerKeys.js +80 -0
- package/dist/runnerUtility/runnerKeys.js.map +1 -0
- package/dist/runnerUtility/runnerServers.d.ts +40 -0
- package/dist/runnerUtility/runnerServers.d.ts.map +1 -0
- package/dist/runnerUtility/runnerServers.js +79 -0
- package/dist/runnerUtility/runnerServers.js.map +1 -0
- package/dist/runnerUtility/serviceCommon.d.ts +97 -0
- package/dist/runnerUtility/serviceCommon.d.ts.map +1 -0
- package/dist/runnerUtility/serviceCommon.js +209 -0
- package/dist/runnerUtility/serviceCommon.js.map +1 -0
- package/dist/runnerUtility/serviceManager.d.ts +51 -0
- package/dist/runnerUtility/serviceManager.d.ts.map +1 -0
- package/dist/runnerUtility/serviceManager.js +344 -0
- package/dist/runnerUtility/serviceManager.js.map +1 -0
- package/dist/runnerUtility/serviceUnits.d.ts +38 -0
- package/dist/runnerUtility/serviceUnits.d.ts.map +1 -0
- package/dist/runnerUtility/serviceUnits.js +189 -0
- package/dist/runnerUtility/serviceUnits.js.map +1 -0
- package/dist/runnerUtility/toolInstall.d.ts +95 -0
- package/dist/runnerUtility/toolInstall.d.ts.map +1 -0
- package/dist/runnerUtility/toolInstall.js +232 -0
- package/dist/runnerUtility/toolInstall.js.map +1 -0
- package/dist/runnerUtility/versionPollTiming.d.ts +16 -0
- package/dist/runnerUtility/versionPollTiming.d.ts.map +1 -0
- package/dist/runnerUtility/versionPollTiming.js +36 -0
- package/dist/runnerUtility/versionPollTiming.js.map +1 -0
- package/dist/runners/authorizedKeys.d.ts +52 -0
- package/dist/runners/authorizedKeys.d.ts.map +1 -0
- package/dist/runners/authorizedKeys.js +153 -0
- package/dist/runners/authorizedKeys.js.map +1 -0
- package/dist/runners/bootstrapLine.d.ts +13 -0
- package/dist/runners/bootstrapLine.d.ts.map +1 -0
- package/dist/runners/bootstrapLine.js +154 -0
- package/dist/runners/bootstrapLine.js.map +1 -0
- package/dist/runners/gate.d.ts +41 -0
- package/dist/runners/gate.d.ts.map +1 -0
- package/dist/runners/gate.js +225 -0
- package/dist/runners/gate.js.map +1 -0
- package/dist/runners/gateLink.d.ts +26 -0
- package/dist/runners/gateLink.d.ts.map +1 -0
- package/dist/runners/gateLink.js +240 -0
- package/dist/runners/gateLink.js.map +1 -0
- package/dist/runners/gateProtocol.d.ts +104 -0
- package/dist/runners/gateProtocol.d.ts.map +1 -0
- package/dist/runners/gateProtocol.js +151 -0
- package/dist/runners/gateProtocol.js.map +1 -0
- package/dist/runners/gateWrapper.d.ts +6 -0
- package/dist/runners/gateWrapper.d.ts.map +1 -0
- package/dist/runners/gateWrapper.js +70 -0
- package/dist/runners/gateWrapper.js.map +1 -0
- package/dist/runners/hubAddress.d.ts +33 -0
- package/dist/runners/hubAddress.d.ts.map +1 -0
- package/dist/runners/hubAddress.js +88 -0
- package/dist/runners/hubAddress.js.map +1 -0
- package/dist/runners/hubAddressCandidates.d.ts +16 -0
- package/dist/runners/hubAddressCandidates.d.ts.map +1 -0
- package/dist/runners/hubAddressCandidates.js +96 -0
- package/dist/runners/hubAddressCandidates.js.map +1 -0
- package/dist/runners/hubIds.d.ts +16 -0
- package/dist/runners/hubIds.d.ts.map +1 -0
- package/dist/runners/hubIds.js +25 -0
- package/dist/runners/hubIds.js.map +1 -0
- package/dist/runners/hubKey.d.ts +6 -0
- package/dist/runners/hubKey.d.ts.map +1 -0
- package/dist/runners/hubKey.js +78 -0
- package/dist/runners/hubKey.js.map +1 -0
- package/dist/runners/hubLock.d.ts +7 -0
- package/dist/runners/hubLock.d.ts.map +1 -0
- package/dist/runners/hubLock.js +230 -0
- package/dist/runners/hubLock.js.map +1 -0
- package/dist/runners/hubPackage.d.ts +23 -0
- package/dist/runners/hubPackage.d.ts.map +1 -0
- package/dist/runners/hubPackage.js +184 -0
- package/dist/runners/hubPackage.js.map +1 -0
- package/dist/runners/hubPairing.d.ts +70 -0
- package/dist/runners/hubPairing.d.ts.map +1 -0
- package/dist/runners/hubPairing.js +277 -0
- package/dist/runners/hubPairing.js.map +1 -0
- package/dist/runners/hubPaths.d.ts +42 -0
- package/dist/runners/hubPaths.d.ts.map +1 -0
- package/dist/runners/hubPaths.js +96 -0
- package/dist/runners/hubPaths.js.map +1 -0
- package/dist/runners/hubRegistry.d.ts +134 -0
- package/dist/runners/hubRegistry.d.ts.map +1 -0
- package/dist/runners/hubRegistry.js +256 -0
- package/dist/runners/hubRegistry.js.map +1 -0
- package/dist/runners/linkControl.d.ts +38 -0
- package/dist/runners/linkControl.d.ts.map +1 -0
- package/dist/runners/linkControl.js +171 -0
- package/dist/runners/linkControl.js.map +1 -0
- package/dist/runners/pairCode.d.ts +30 -0
- package/dist/runners/pairCode.d.ts.map +1 -0
- package/dist/runners/pairCode.js +46 -0
- package/dist/runners/pairCode.js.map +1 -0
- package/dist/runners/pairingTiming.d.ts +18 -0
- package/dist/runners/pairingTiming.d.ts.map +1 -0
- package/dist/runners/pairingTiming.js +42 -0
- package/dist/runners/pairingTiming.js.map +1 -0
- package/dist/runners/removalTiming.d.ts +13 -0
- package/dist/runners/removalTiming.d.ts.map +1 -0
- package/dist/runners/removalTiming.js +17 -0
- package/dist/runners/removalTiming.js.map +1 -0
- package/dist/runners/runnerProxy.d.ts +9 -0
- package/dist/runners/runnerProxy.d.ts.map +1 -0
- package/dist/runners/runnerProxy.js +67 -0
- package/dist/runners/runnerProxy.js.map +1 -0
- package/dist/runners/runnerRemoval.d.ts +21 -0
- package/dist/runners/runnerRemoval.d.ts.map +1 -0
- package/dist/runners/runnerRemoval.js +94 -0
- package/dist/runners/runnerRemoval.js.map +1 -0
- package/dist/runners/runnerServiceKind.d.ts +10 -0
- package/dist/runners/runnerServiceKind.d.ts.map +1 -0
- package/dist/runners/runnerServiceKind.js +13 -0
- package/dist/runners/runnerServiceKind.js.map +1 -0
- package/dist/runners/runnersCli.d.ts +25 -0
- package/dist/runners/runnersCli.d.ts.map +1 -0
- package/dist/runners/runnersCli.js +239 -0
- package/dist/runners/runnersCli.js.map +1 -0
- package/dist/runners/runnersList.d.ts +14 -0
- package/dist/runners/runnersList.d.ts.map +1 -0
- package/dist/runners/runnersList.js +51 -0
- package/dist/runners/runnersList.js.map +1 -0
- package/dist/runners/runnersOverview.d.ts +20 -0
- package/dist/runners/runnersOverview.d.ts.map +1 -0
- package/dist/runners/runnersOverview.js +56 -0
- package/dist/runners/runnersOverview.js.map +1 -0
- package/dist/runners/sshKeys.d.ts +26 -0
- package/dist/runners/sshKeys.d.ts.map +1 -0
- package/dist/runners/sshKeys.js +60 -0
- package/dist/runners/sshKeys.js.map +1 -0
- package/dist/runners/tarArchive.d.ts +20 -0
- package/dist/runners/tarArchive.d.ts.map +1 -0
- package/dist/runners/tarArchive.js +70 -0
- package/dist/runners/tarArchive.js.map +1 -0
- package/dist/scheduler/mcpSurface.d.ts +11 -5
- package/dist/scheduler/mcpSurface.d.ts.map +1 -1
- package/dist/scheduler/mcpSurface.js +59 -26
- package/dist/scheduler/mcpSurface.js.map +1 -1
- package/dist/selfUpdate/selfCheck.d.ts +13 -0
- package/dist/selfUpdate/selfCheck.d.ts.map +1 -1
- package/dist/selfUpdate/selfCheck.js +9 -3
- package/dist/selfUpdate/selfCheck.js.map +1 -1
- package/dist/stt/sttInstallEntry.js +7 -4
- package/dist/stt/sttInstallEntry.js.map +1 -1
- package/dist/testTimings.d.ts +5 -2
- package/dist/testTimings.d.ts.map +1 -1
- package/dist/testTimings.js +10 -1
- package/dist/testTimings.js.map +1 -1
- package/dist/utils/agentEnvironment.d.ts +6 -2
- package/dist/utils/agentEnvironment.d.ts.map +1 -1
- package/dist/utils/agentEnvironment.js +13 -2
- package/dist/utils/agentEnvironment.js.map +1 -1
- package/dist/utils/runnersScreenPlan.d.ts +141 -0
- package/dist/utils/runnersScreenPlan.d.ts.map +1 -0
- package/dist/utils/runnersScreenPlan.js +272 -0
- package/dist/utils/runnersScreenPlan.js.map +1 -0
- package/package.json +5 -2
- package/remoteRun/runner.sh +81 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sttInstallEntry.js","sourceRoot":"","sources":["../../src/stt/sttInstallEntry.ts"],"names":[],"mappings":";;AAAA,6CAA6C;AAE7C;;;;;;;;;GASG;AAEH,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,UAAU,GAAG,CAAC,CAAC;AACrB,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,UAAU,GAAG,CAAC,CAAC;AAErB,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChC,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAC/B,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAa,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACzF,IAAI,MAAM,CAAC,EAAE;QAAE,OAAO,aAAa,CAAC;IACpC,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC;AAC9D,CAAC;AAED,IAAI,EAAE,CAAC,IAAI,CACT,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EACpC,CAAC,KAAK,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"sttInstallEntry.js","sourceRoot":"","sources":["../../src/stt/sttInstallEntry.ts"],"names":[],"mappings":";;AAAA,6CAA6C;AAE7C;;;;;;;;;GASG;AAEH,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,UAAU,GAAG,CAAC,CAAC;AACrB,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,UAAU,GAAG,CAAC,CAAC;AAErB,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChC,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAC/B,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAa,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACzF,IAAI,MAAM,CAAC,EAAE;QAAE,OAAO,aAAa,CAAC;IACpC,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC;AAC9D,CAAC;AAED,0IAA0I;AAC1I,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,IAAI,EAAE,CAAC,IAAI,CACT,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EACpC,CAAC,KAAK,EAAE,EAAE;QACR,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC5F,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/testTimings.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { z } from 'zod';
|
|
|
4
4
|
* production windows the process-level flows would otherwise wait out in real time (the Telegram send pacer's 2 s, the
|
|
5
5
|
* Jira poll's 10 s floor, the wake-up engine's 10 s turn poll and its sweep's minute, the first re-post retry's minute, the two-minute probe of an
|
|
6
6
|
* unconfirmed usage limit, `state.json`'s save debounce, the OpenCode server's 60 s of retries, the 6 h pending-work hold, the
|
|
7
|
-
* todo reminder's 10 s poll and its interval, the 45 s heartbeat lease of a foreground `charness remote-run
|
|
7
|
+
* todo reminder's 10 s poll and its interval, the 45 s heartbeat lease of a foreground `charness remote-run` and its 10 s poll while it waits for a paired runner, and — a count, not a window —
|
|
8
8
|
* the 200 `/bind` picker claims). It is NOT a setting: no
|
|
9
9
|
* operator sets it and it is documented only for developers (DEVELOPMENT.md); settings live in `settings.json`.
|
|
10
10
|
*
|
|
@@ -29,6 +29,9 @@ declare const testTimingsSchema: z.ZodObject<{
|
|
|
29
29
|
todoReminderIntervalMs: z.ZodOptional<z.ZodNumber>;
|
|
30
30
|
bindPickerClaimLimit: z.ZodOptional<z.ZodNumber>;
|
|
31
31
|
remoteRunLeaseMs: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
runnerVersionPollMs: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
pairingLifetimeMs: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
remoteRunRunnerPollMs: z.ZodOptional<z.ZodNumber>;
|
|
32
35
|
scheduleMinFireIntervalMs: z.ZodOptional<z.ZodNumber>;
|
|
33
36
|
tscWatchCheckIntervalMs: z.ZodOptional<z.ZodNumber>;
|
|
34
37
|
tscWatchStaleGraceMs: z.ZodOptional<z.ZodNumber>;
|
|
@@ -36,7 +39,7 @@ declare const testTimingsSchema: z.ZodObject<{
|
|
|
36
39
|
/** @name TestTimings @description The overrides in force; an absent key keeps its production window. */
|
|
37
40
|
export type TestTimings = z.infer<typeof testTimingsSchema>;
|
|
38
41
|
/** Every key the seam accepts — each must reach its consumer (`bot.ts`, the composition root, reads it). */
|
|
39
|
-
export declare const testTimingKeys: ("tscWatchCheckIntervalMs" | "tscWatchStaleGraceMs" | "telegramSendIntervalMs" | "jiraPollIntervalMs" | "requestTurnPollMs" | "requestSweepIntervalMs" | "requestFirstPostRetryDelayMs" | "limitProbeDelayMs" | "stateSaveDebounceMs" | "openCodeServerUpBudgetMs" | "backgroundHoldMaxMs" | "todoReminderPollMs" | "todoReminderIntervalMs" | "bindPickerClaimLimit" | "remoteRunLeaseMs" | "scheduleMinFireIntervalMs")[];
|
|
42
|
+
export declare const testTimingKeys: ("tscWatchCheckIntervalMs" | "tscWatchStaleGraceMs" | "telegramSendIntervalMs" | "jiraPollIntervalMs" | "requestTurnPollMs" | "requestSweepIntervalMs" | "requestFirstPostRetryDelayMs" | "limitProbeDelayMs" | "stateSaveDebounceMs" | "openCodeServerUpBudgetMs" | "backgroundHoldMaxMs" | "todoReminderPollMs" | "todoReminderIntervalMs" | "bindPickerClaimLimit" | "remoteRunLeaseMs" | "runnerVersionPollMs" | "pairingLifetimeMs" | "remoteRunRunnerPollMs" | "scheduleMinFireIntervalMs")[];
|
|
40
43
|
export type TestTimingsParse = {
|
|
41
44
|
ok: true;
|
|
42
45
|
timings: TestTimings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testTimings.d.ts","sourceRoot":"","sources":["../src/testTimings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"testTimings.d.ts","sourceRoot":"","sources":["../src/testTimings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB;;;;;;;;;;;;;GAaG;AAEH,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAW1D,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;kBA6CrB,CAAC;AAEH,wGAAwG;AACxG,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,4GAA4G;AAC5G,eAAO,MAAM,cAAc,qeAAoC,CAAC;AAEhE,MAAM,MAAM,gBAAgB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEpG;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,gBAAgB,CAa/E;AAED,iGAAiG;AACjG,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAI7E"}
|
package/dist/testTimings.js
CHANGED
|
@@ -18,12 +18,15 @@ const nag_1 = require("./todos/nag");
|
|
|
18
18
|
const reminderEngine_1 = require("./todos/reminderEngine");
|
|
19
19
|
const recurrence_1 = require("./scheduler/recurrence");
|
|
20
20
|
const leaseTiming_1 = require("./remoteRun/leaseTiming");
|
|
21
|
+
const versionPollTiming_1 = require("./runnerUtility/versionPollTiming");
|
|
22
|
+
const pairingTiming_1 = require("./runners/pairingTiming");
|
|
23
|
+
const runnerWaitTiming_1 = require("./remoteRun/runnerWaitTiming");
|
|
21
24
|
/**
|
|
22
25
|
* @description The ONE test-only timing seam: `CHARNESS_TEST_TIMINGS`, a JSON object of named overrides for the
|
|
23
26
|
* production windows the process-level flows would otherwise wait out in real time (the Telegram send pacer's 2 s, the
|
|
24
27
|
* Jira poll's 10 s floor, the wake-up engine's 10 s turn poll and its sweep's minute, the first re-post retry's minute, the two-minute probe of an
|
|
25
28
|
* unconfirmed usage limit, `state.json`'s save debounce, the OpenCode server's 60 s of retries, the 6 h pending-work hold, the
|
|
26
|
-
* todo reminder's 10 s poll and its interval, the 45 s heartbeat lease of a foreground `charness remote-run
|
|
29
|
+
* todo reminder's 10 s poll and its interval, the 45 s heartbeat lease of a foreground `charness remote-run` and its 10 s poll while it waits for a paired runner, and — a count, not a window —
|
|
27
30
|
* the 200 `/bind` picker claims). It is NOT a setting: no
|
|
28
31
|
* operator sets it and it is documented only for developers (DEVELOPMENT.md); settings live in `settings.json`.
|
|
29
32
|
*
|
|
@@ -74,6 +77,12 @@ const testTimingsSchema = zod_1.z.strictObject({
|
|
|
74
77
|
bindPickerClaimLimit: zod_1.z.number().int().positive().max(bindPickerClaims_1.bindPickerClaimLimit).optional(),
|
|
75
78
|
/** How long a runner waits for the heartbeat of a foreground `charness remote-run` before it kills the job (production: `remoteRunLeaseMs`, 45 s; at least `remoteRunLeaseMinMs`). Read by the remote-run CLI, not by the bot. */
|
|
76
79
|
remoteRunLeaseMs: createShorterWindowSchema(leaseTiming_1.remoteRunLeaseMs).min(leaseTiming_1.remoteRunLeaseMinMs).optional(),
|
|
80
|
+
/** How often a linked `charness-runner` asks the hub for its current package (production: `runnerVersionPollMs`, 5 min; at least `runnerVersionPollMinMs`). Read by the runner utility, not by the bot. */
|
|
81
|
+
runnerVersionPollMs: createShorterWindowSchema(versionPollTiming_1.runnerVersionPollMs).min(versionPollTiming_1.runnerVersionPollMinMs).optional(),
|
|
82
|
+
/** How long a runner pairing code works (production: `pairingLifetimeMs`, 10 min; at least `pairingLifetimeMinMs`). Read by `charness runners pair`, not by the bot's boot. */
|
|
83
|
+
pairingLifetimeMs: createShorterWindowSchema(pairingTiming_1.pairingLifetimeMs).min(pairingTiming_1.pairingLifetimeMinMs).optional(),
|
|
84
|
+
/** How often `charness remote-run --needs <capability>` looks again while it waits for an offline paired runner (production: `runnerWaitPollMs`, 10 s; at least `runnerWaitPollMinMs`). Read by the remote-run CLI, not by the bot. */
|
|
85
|
+
remoteRunRunnerPollMs: createShorterWindowSchema(runnerWaitTiming_1.runnerWaitPollMs).min(runnerWaitTiming_1.runnerWaitPollMinMs).optional(),
|
|
77
86
|
/** The shortest gap between two fires of a cron schedule (production: `minFireIntervalMs`, 5 min). */
|
|
78
87
|
scheduleMinFireIntervalMs: createShorterWindowSchema(recurrence_1.minFireIntervalMs).optional(),
|
|
79
88
|
/** How often the hot supervisor compares its `tsc -w` with the sources (production: `tscWatchCheckIntervalMs`, 30 s). Read by `charness hot`, not by the bot. */
|
package/dist/testTimings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testTimings.js","sourceRoot":"","sources":["../src/testTimings.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"testTimings.js","sourceRoot":"","sources":["../src/testTimings.ts"],"names":[],"mappings":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AE,CAAC;AAC5C,CAAC;AAED,iGAAiG;AACjG,SAAgB,yBAAyB,CAAC,OAAoB;IAC5D,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,OAAO,kBAAkB,0BAAkB,sBAAsB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACvI,CAAC"}
|
|
@@ -20,8 +20,12 @@
|
|
|
20
20
|
* `IS_SANDBOX` lets Claude Code run `--dangerously-skip-permissions` as root,
|
|
21
21
|
* which the whole bot in a rootless Docker container is (the image sets it);
|
|
22
22
|
* without it every agent there refuses to start. It holds no secret.
|
|
23
|
+
* `XDG_CACHE_HOME` is a path: with it the agent and the bot (and the other agents) use ONE local cache —
|
|
24
|
+
* `charness remote-run` keeps its ssh control sockets, the last probe of each runner and its record of
|
|
25
|
+
* which project a job came from there; without it a tracker agent's cache followed `HOME` while the bot's
|
|
26
|
+
* did not, and what one wrote the other could not read.
|
|
23
27
|
*/
|
|
24
|
-
export declare const agentEnvironmentNames: readonly ["HOME", "PATH", "USER", "LOGNAME", "SHELL", "LANG", "LC_ALL", "LC_CTYPE", "TERM", "TMPDIR", "TZ", "IS_SANDBOX"];
|
|
28
|
+
export declare const agentEnvironmentNames: readonly ["HOME", "PATH", "USER", "LOGNAME", "SHELL", "LANG", "LC_ALL", "LC_CTYPE", "TERM", "TMPDIR", "TZ", "IS_SANDBOX", "XDG_CACHE_HOME"];
|
|
25
29
|
/** @description Remember which variables came from the instance's `ENV_FILE`: none of them reaches an agent. */
|
|
26
30
|
export declare function addEnvFileVariableNames(names: Iterable<string>): void;
|
|
27
31
|
/** @description Forget the recorded names — for tests only, so each case starts from a process that loaded no env file. */
|
|
@@ -29,7 +33,7 @@ export declare function resetEnvFileVariableNamesForTests(): void;
|
|
|
29
33
|
/**
|
|
30
34
|
* @description The allowlisted variables `env` holds, minus any the `ENV_FILE`
|
|
31
35
|
* set — an instance file that sets `PATH` leaves the agent on the shell's default
|
|
32
|
-
* search path rather than handing it a value from the file.
|
|
36
|
+
* search path rather than handing it a value from the file (`XDG_CACHE_HOME` excepted, see above).
|
|
33
37
|
*/
|
|
34
38
|
export declare function getAgentEnvironment(env?: NodeJS.ProcessEnv): Record<string, string>;
|
|
35
39
|
/** @description Set (or, with `null`, clear) the folder {@link addAgentBinDirToPath} puts first on the PATH. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentEnvironment.d.ts","sourceRoot":"","sources":["../../src/utils/agentEnvironment.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH
|
|
1
|
+
{"version":3,"file":"agentEnvironment.d.ts","sourceRoot":"","sources":["../../src/utils/agentEnvironment.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,6IAcxB,CAAC;AAYX,gHAAgH;AAChH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,CAErE;AAED,2HAA2H;AAC3H,wBAAgB,iCAAiC,IAAI,IAAI,CAExD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOhG;AAQD,gHAAgH;AAChH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAE5D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGhG"}
|
|
@@ -62,6 +62,10 @@ const path = __importStar(require("path"));
|
|
|
62
62
|
* `IS_SANDBOX` lets Claude Code run `--dangerously-skip-permissions` as root,
|
|
63
63
|
* which the whole bot in a rootless Docker container is (the image sets it);
|
|
64
64
|
* without it every agent there refuses to start. It holds no secret.
|
|
65
|
+
* `XDG_CACHE_HOME` is a path: with it the agent and the bot (and the other agents) use ONE local cache —
|
|
66
|
+
* `charness remote-run` keeps its ssh control sockets, the last probe of each runner and its record of
|
|
67
|
+
* which project a job came from there; without it a tracker agent's cache followed `HOME` while the bot's
|
|
68
|
+
* did not, and what one wrote the other could not read.
|
|
65
69
|
*/
|
|
66
70
|
exports.agentEnvironmentNames = [
|
|
67
71
|
'HOME',
|
|
@@ -76,7 +80,14 @@ exports.agentEnvironmentNames = [
|
|
|
76
80
|
'TMPDIR',
|
|
77
81
|
'TZ',
|
|
78
82
|
'IS_SANDBOX',
|
|
83
|
+
'XDG_CACHE_HOME',
|
|
79
84
|
];
|
|
85
|
+
/**
|
|
86
|
+
* Allowlisted names that reach the agent even when the instance's `ENV_FILE` set them: a PATH or TZ from that file is the instance's own
|
|
87
|
+
* business, but `XDG_CACHE_HOME` is a path the BOT then follows too — and the agent must follow the bot, or the two keep separate
|
|
88
|
+
* `charness remote-run` caches (probes, ssh connections, job records) and cannot read each other's. It holds no secret.
|
|
89
|
+
*/
|
|
90
|
+
const namesPassedEvenFromEnvFile = new Set(['XDG_CACHE_HOME']);
|
|
80
91
|
/** Names the instance's `ENV_FILE` set — recorded by the env loader on every load (the hot worker loads it again). */
|
|
81
92
|
const envFileVariableNames = new Set();
|
|
82
93
|
/** @description Remember which variables came from the instance's `ENV_FILE`: none of them reaches an agent. */
|
|
@@ -91,13 +102,13 @@ function resetEnvFileVariableNamesForTests() {
|
|
|
91
102
|
/**
|
|
92
103
|
* @description The allowlisted variables `env` holds, minus any the `ENV_FILE`
|
|
93
104
|
* set — an instance file that sets `PATH` leaves the agent on the shell's default
|
|
94
|
-
* search path rather than handing it a value from the file.
|
|
105
|
+
* search path rather than handing it a value from the file (`XDG_CACHE_HOME` excepted, see above).
|
|
95
106
|
*/
|
|
96
107
|
function getAgentEnvironment(env = process.env) {
|
|
97
108
|
const environment = {};
|
|
98
109
|
for (const name of exports.agentEnvironmentNames) {
|
|
99
110
|
const value = env[name];
|
|
100
|
-
if (value !== undefined && !envFileVariableNames.has(name))
|
|
111
|
+
if (value !== undefined && (!envFileVariableNames.has(name) || namesPassedEvenFromEnvFile.has(name)))
|
|
101
112
|
environment[name] = value;
|
|
102
113
|
}
|
|
103
114
|
return environment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentEnvironment.js","sourceRoot":"","sources":["../../src/utils/agentEnvironment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"agentEnvironment.js","sourceRoot":"","sources":["../../src/utils/agentEnvironment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,0DAEC;AAGD,8EAEC;AAOD,kDAOC;AASD,kDAEC;AAMD,oDAGC;AAlGD,2CAA6B;AAE7B;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;GAeG;AACU,QAAA,qBAAqB,GAAG;IACnC,MAAM;IACN,MAAM;IACN,MAAM;IACN,SAAS;IACT,OAAO;IACP,MAAM;IACN,QAAQ;IACR,UAAU;IACV,MAAM;IACN,QAAQ;IACR,IAAI;IACJ,YAAY;IACZ,gBAAgB;CACR,CAAC;AAEX;;;;GAIG;AACH,MAAM,0BAA0B,GAAwB,IAAI,GAAG,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAEpF,sHAAsH;AACtH,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAU,CAAC;AAE/C,gHAAgH;AAChH,SAAgB,uBAAuB,CAAC,KAAuB;IAC7D,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC3D,CAAC;AAED,2HAA2H;AAC3H,SAAgB,iCAAiC;IAC/C,oBAAoB,CAAC,KAAK,EAAE,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACtE,MAAM,WAAW,GAA2B,EAAE,CAAC;IAC/C,KAAK,MAAM,IAAI,IAAI,6BAAqB,EAAE,CAAC;QACzC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;QACxB,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,0BAA0B,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAAE,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IAClI,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,2EAA2E;AAC3E,MAAM,gBAAgB,GAAG,8BAA8B,CAAC;AAExD,yHAAyH;AACzH,IAAI,WAAW,GAAkB,IAAI,CAAC;AAEtC,gHAAgH;AAChH,SAAgB,mBAAmB,CAAC,GAAkB;IACpD,WAAW,GAAG,GAAG,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,WAAmC;IACtE,IAAI,WAAW,KAAK,IAAI;QAAE,OAAO,WAAW,CAAC;IAC7C,OAAO,EAAE,GAAG,WAAW,EAAE,IAAI,EAAE,GAAG,WAAW,GAAG,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC,IAAI,IAAI,gBAAgB,EAAE,EAAE,CAAC;AAC5G,CAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Pure plan of the `/runners` screen (`connectors/telegram/commands/runners.ts`): the list of paired machines with
|
|
3
|
+
* what they said about themselves, the buttons, the confirmation of a removal, the address step of the first pairing, the pairing
|
|
4
|
+
* message and the texts that replace it once the code was used or expired. Everything here takes the facts in and gives text and
|
|
5
|
+
* button data out, so the first render and every re-render can never drift apart, and the callback data is checked for Telegram's
|
|
6
|
+
* 64-byte cap in one place.
|
|
7
|
+
*
|
|
8
|
+
* Buttons carry the registry revision AND the runner's position in the WHOLE list (`rnr_<rev>_<i>_<action>`): a keyboard left in the
|
|
9
|
+
* history acts on the list it was drawn from or is refused, never on a neighbour that moved up — whichever page it stands on.
|
|
10
|
+
*
|
|
11
|
+
* The text is BOUNDED: Telegram refuses a message over 4096 characters, and what a machine reports about itself (CPU model, capability
|
|
12
|
+
* details) has no length of its own, so every reported string is clipped and the machines are split over pages of at most
|
|
13
|
+
* {@link maxScreenTextChars}. A page holds at least one machine; a list that fits is one page with no navigation.
|
|
14
|
+
*/
|
|
15
|
+
import type { Translate } from '../i18n';
|
|
16
|
+
import { type RunnerProbe } from '../remoteRun/probe';
|
|
17
|
+
import type { PairedRunner } from '../runners/hubRegistry';
|
|
18
|
+
import type { RunnerJobsStop } from '../runners/runnerRemoval';
|
|
19
|
+
/** Telegram refuses callback data over 64 BYTES. */
|
|
20
|
+
export declare const maxCallbackDataBytes = 64;
|
|
21
|
+
/** The most characters a screen's text may have: Telegram's limit is 4096, the rest is the margin for the title, notes and the page line. */
|
|
22
|
+
export declare const maxScreenTextChars = 3600;
|
|
23
|
+
/** The longest a string a machine reported about itself (CPU model, a capability's detail, its OS name) is shown. */
|
|
24
|
+
export declare const maxReportedTextChars = 80;
|
|
25
|
+
export declare const runnersCallbackPrefix = "rnr_";
|
|
26
|
+
export declare const runnersPairCallback = "rnr_pair";
|
|
27
|
+
export declare const runnersRefreshCallback = "rnr_refresh";
|
|
28
|
+
export declare const runnersAddressUseCallback = "rnr_aduse";
|
|
29
|
+
export declare const runnersAddressOtherCallback = "rnr_adother";
|
|
30
|
+
/** Matches `rnr_pg_<page>` (0-based): a view change that acts on nothing, so it carries no revision. */
|
|
31
|
+
export declare const runnersPageCallbackRe: RegExp;
|
|
32
|
+
/** What a button next to a runner does. `remove` asks; `removeYes` / `removeNo` answer the question. */
|
|
33
|
+
export type RunnerAction = 'pause' | 'resume' | 'remove' | 'removeYes' | 'removeNo';
|
|
34
|
+
/** Matches `rnr_<rev>_<index>_<action code>`. */
|
|
35
|
+
export declare const runnerActionCallbackRe: RegExp;
|
|
36
|
+
export type RunnersCallback = {
|
|
37
|
+
kind: 'pair';
|
|
38
|
+
} | {
|
|
39
|
+
kind: 'refresh';
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'addressUse';
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'addressOther';
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'page';
|
|
46
|
+
page: number;
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'runner';
|
|
49
|
+
revision: number;
|
|
50
|
+
index: number;
|
|
51
|
+
action: RunnerAction;
|
|
52
|
+
};
|
|
53
|
+
export declare function buildRunnersPageCallback(page: number): string;
|
|
54
|
+
export declare function buildRunnerActionCallback(revision: number, index: number, action: RunnerAction): string;
|
|
55
|
+
/** @description Read a button's callback data; `null` when it is not one of this screen's. */
|
|
56
|
+
export declare function parseRunnersCallback(data: string): RunnersCallback | null;
|
|
57
|
+
export interface ScreenButton {
|
|
58
|
+
text: string;
|
|
59
|
+
data: string;
|
|
60
|
+
}
|
|
61
|
+
/** @name RunnersScreen @description Text and keyboard rows of one render. */
|
|
62
|
+
export interface RunnersScreen {
|
|
63
|
+
text: string;
|
|
64
|
+
rows: ScreenButton[][];
|
|
65
|
+
}
|
|
66
|
+
/** @name RunnersListScreen @description The list as one page: which of how many it is. */
|
|
67
|
+
export interface RunnersListScreen extends RunnersScreen {
|
|
68
|
+
/** 0-based, clamped into the list that exists. */
|
|
69
|
+
page: number;
|
|
70
|
+
pageCount: number;
|
|
71
|
+
}
|
|
72
|
+
/** @name RunnerScreenEntry @description One paired machine and everything known of it right now. */
|
|
73
|
+
export interface RunnerScreenEntry {
|
|
74
|
+
runner: PairedRunner;
|
|
75
|
+
isOnline: boolean;
|
|
76
|
+
/** The last time the hub knew the link alive; `null` = never connected. */
|
|
77
|
+
lastSeenMs: number | null;
|
|
78
|
+
/** The live probe while online, else the last snapshot taken when the machine was seen; `null` = never probed. */
|
|
79
|
+
probe: RunnerProbe | null;
|
|
80
|
+
}
|
|
81
|
+
export interface RunnersScreenModel {
|
|
82
|
+
/** The registry revision the keyboard is built from. */
|
|
83
|
+
revision: number;
|
|
84
|
+
entries: readonly RunnerScreenEntry[];
|
|
85
|
+
/** When each pairing code that is still open expires. */
|
|
86
|
+
openPairingExpiries: readonly number[];
|
|
87
|
+
/** A probe is running: the screen says so, and is re-rendered when it ends. */
|
|
88
|
+
isChecking: boolean;
|
|
89
|
+
}
|
|
90
|
+
/** @description Formats an instant for the operator (`1 Nov 14:02`) in the bot's timezone and the topic's language. */
|
|
91
|
+
export type FormatTime = (epochMs: number) => string;
|
|
92
|
+
/** @description `text` as a string a machine reported: no longer than {@link maxReportedTextChars}, cut with an ellipsis. */
|
|
93
|
+
export declare function clipReportedText(text: string): string;
|
|
94
|
+
/**
|
|
95
|
+
* @description Split the entry blocks over pages: each page takes blocks while the text stays within `budget` characters (blocks joined by
|
|
96
|
+
* a blank line), and at least one block, so a block over the budget alone still has a page. Returns each page's first block and the
|
|
97
|
+
* block after its last.
|
|
98
|
+
*/
|
|
99
|
+
export declare function paginateBlocks(blocks: readonly string[], budget: number): Array<{
|
|
100
|
+
start: number;
|
|
101
|
+
end: number;
|
|
102
|
+
}>;
|
|
103
|
+
/**
|
|
104
|
+
* @description The list screen, page `page` (0-based; a page past the end is the last): the machines on it, a button to pair another, a
|
|
105
|
+
* Pause/Resume and a Remove per machine on the page, the page buttons when there is more than one page, Refresh.
|
|
106
|
+
*/
|
|
107
|
+
export declare function buildRunnersScreen(model: RunnersScreenModel, t: Translate, formatTime: FormatTime, page?: number): RunnersListScreen;
|
|
108
|
+
/**
|
|
109
|
+
* @description The message that says what a removal came to: the key is deleted in every case, and the jobs were stopped from the hub, or the
|
|
110
|
+
* machine was offline (it stops them itself once its key has been refused for `unconfirmedRemovalStopAfterHours`), or they could not be stopped
|
|
111
|
+
* from here (it does the same). Three outcomes, three texts — «offline» is not what «failed» means.
|
|
112
|
+
*/
|
|
113
|
+
export declare function buildRemovalOutcomeText(runnerName: string, jobs: RunnerJobsStop, t: Translate): string;
|
|
114
|
+
/** @description The question a Remove button turns the screen into. */
|
|
115
|
+
export declare function buildRemoveConfirmation(runnerName: string, revision: number, index: number, t: Translate): RunnersScreen;
|
|
116
|
+
/**
|
|
117
|
+
* @description The address step of the first pairing. With a proposal (an address of this machine that answered with its own
|
|
118
|
+
* sshd) it offers «Use …» and «Enter another address»; without one only the second, and says no address was found.
|
|
119
|
+
*/
|
|
120
|
+
export declare function buildAddressStep(proposedAddress: string | null, t: Translate): RunnersScreen;
|
|
121
|
+
/** @name PairingMessageParts @description The text around the two lines of a pairing: each line sits between its intro and (for the second) the outro. */
|
|
122
|
+
export interface PairingMessageParts {
|
|
123
|
+
/** Above the admin line: the lifetime, and which word of the line is the account. */
|
|
124
|
+
adminIntro: string;
|
|
125
|
+
/** Above the plain line (no admin rights). */
|
|
126
|
+
alternativeIntro: string;
|
|
127
|
+
/** Below the plain line: what the account must be, and who can use a line. */
|
|
128
|
+
alternativeOutro: string;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* @description The pairing's text parts. A pairing is offered in TWO messages — the admin line first, the plain line second — because the
|
|
132
|
+
* two lines together are longer than a Telegram message; `account` is the one the admin line pairs unless its last word is changed.
|
|
133
|
+
*/
|
|
134
|
+
export declare function buildPairingMessageParts(pairingLifetimeMinutes: number, account: string, t: Translate): PairingMessageParts;
|
|
135
|
+
/** @description What the pairing message becomes once the code was used. */
|
|
136
|
+
export declare function buildPairedText(runnerName: string, pairedAtMs: number, t: Translate, formatTime: FormatTime): string;
|
|
137
|
+
/** @description What the pairing message becomes once the code expired unused. */
|
|
138
|
+
export declare function buildExpiredText(t: Translate): string;
|
|
139
|
+
/** @description What the pairing message becomes once its code was CLOSED unused: the line was pasted for a machine that was already paired, so it only installed the service. */
|
|
140
|
+
export declare function buildClosedText(t: Translate): string;
|
|
141
|
+
//# sourceMappingURL=runnersScreenPlan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runnersScreenPlan.d.ts","sourceRoot":"","sources":["../../src/utils/runnersScreenPlan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAuC,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC3F,OAAO,KAAK,EAAE,YAAY,EAAqB,MAAM,wBAAwB,CAAC;AAG9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,oDAAoD;AACpD,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,6IAA6I;AAC7I,eAAO,MAAM,kBAAkB,OAAO,CAAC;AACvC,qHAAqH;AACrH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAKvC,eAAO,MAAM,qBAAqB,SAAS,CAAC;AAC5C,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAC9C,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AACpD,eAAO,MAAM,yBAAyB,cAAc,CAAC;AACrD,eAAO,MAAM,2BAA2B,gBAAgB,CAAC;AACzD,wGAAwG;AACxG,eAAO,MAAM,qBAAqB,QAAmB,CAAC;AAEtD,wGAAwG;AACxG,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AAGpF,iDAAiD;AACjD,eAAO,MAAM,sBAAsB,QAAoC,CAAC;AAExE,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,YAAY,CA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sBAAsB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,GAAG,mBAAmB,CAM3H;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,GAAG,MAAM,CAEpH;AAED,kFAAkF;AAClF,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAErD;AAED,kLAAkL;AAClL,wBAAgB,eAAe,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAEpD"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description Pure plan of the `/runners` screen (`connectors/telegram/commands/runners.ts`): the list of paired machines with
|
|
4
|
+
* what they said about themselves, the buttons, the confirmation of a removal, the address step of the first pairing, the pairing
|
|
5
|
+
* message and the texts that replace it once the code was used or expired. Everything here takes the facts in and gives text and
|
|
6
|
+
* button data out, so the first render and every re-render can never drift apart, and the callback data is checked for Telegram's
|
|
7
|
+
* 64-byte cap in one place.
|
|
8
|
+
*
|
|
9
|
+
* Buttons carry the registry revision AND the runner's position in the WHOLE list (`rnr_<rev>_<i>_<action>`): a keyboard left in the
|
|
10
|
+
* history acts on the list it was drawn from or is refused, never on a neighbour that moved up — whichever page it stands on.
|
|
11
|
+
*
|
|
12
|
+
* The text is BOUNDED: Telegram refuses a message over 4096 characters, and what a machine reports about itself (CPU model, capability
|
|
13
|
+
* details) has no length of its own, so every reported string is clipped and the machines are split over pages of at most
|
|
14
|
+
* {@link maxScreenTextChars}. A page holds at least one machine; a list that fits is one page with no navigation.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.runnerActionCallbackRe = exports.runnersPageCallbackRe = exports.runnersAddressOtherCallback = exports.runnersAddressUseCallback = exports.runnersRefreshCallback = exports.runnersPairCallback = exports.runnersCallbackPrefix = exports.maxReportedTextChars = exports.maxScreenTextChars = exports.maxCallbackDataBytes = void 0;
|
|
18
|
+
exports.buildRunnersPageCallback = buildRunnersPageCallback;
|
|
19
|
+
exports.buildRunnerActionCallback = buildRunnerActionCallback;
|
|
20
|
+
exports.parseRunnersCallback = parseRunnersCallback;
|
|
21
|
+
exports.clipReportedText = clipReportedText;
|
|
22
|
+
exports.paginateBlocks = paginateBlocks;
|
|
23
|
+
exports.buildRunnersScreen = buildRunnersScreen;
|
|
24
|
+
exports.buildRemovalOutcomeText = buildRemovalOutcomeText;
|
|
25
|
+
exports.buildRemoveConfirmation = buildRemoveConfirmation;
|
|
26
|
+
exports.buildAddressStep = buildAddressStep;
|
|
27
|
+
exports.buildPairingMessageParts = buildPairingMessageParts;
|
|
28
|
+
exports.buildPairedText = buildPairedText;
|
|
29
|
+
exports.buildExpiredText = buildExpiredText;
|
|
30
|
+
exports.buildClosedText = buildClosedText;
|
|
31
|
+
const probe_1 = require("../remoteRun/probe");
|
|
32
|
+
const removalTiming_1 = require("../runners/removalTiming");
|
|
33
|
+
const runnerServiceKind_1 = require("../runners/runnerServiceKind");
|
|
34
|
+
/** Telegram refuses callback data over 64 BYTES. */
|
|
35
|
+
exports.maxCallbackDataBytes = 64;
|
|
36
|
+
/** The most characters a screen's text may have: Telegram's limit is 4096, the rest is the margin for the title, notes and the page line. */
|
|
37
|
+
exports.maxScreenTextChars = 3600;
|
|
38
|
+
/** The longest a string a machine reported about itself (CPU model, a capability's detail, its OS name) is shown. */
|
|
39
|
+
exports.maxReportedTextChars = 80;
|
|
40
|
+
/** What the page line («Page 2 of 3») and the separators around it may take of the budget. */
|
|
41
|
+
const pageLineReserveChars = 60;
|
|
42
|
+
const sectionSeparator = '\n\n';
|
|
43
|
+
exports.runnersCallbackPrefix = 'rnr_';
|
|
44
|
+
exports.runnersPairCallback = 'rnr_pair';
|
|
45
|
+
exports.runnersRefreshCallback = 'rnr_refresh';
|
|
46
|
+
exports.runnersAddressUseCallback = 'rnr_aduse';
|
|
47
|
+
exports.runnersAddressOtherCallback = 'rnr_adother';
|
|
48
|
+
/** Matches `rnr_pg_<page>` (0-based): a view change that acts on nothing, so it carries no revision. */
|
|
49
|
+
exports.runnersPageCallbackRe = /^rnr_pg_(\d+)$/;
|
|
50
|
+
const actionCodes = { pause: 'p', resume: 'r', remove: 'x', removeYes: 'xy', removeNo: 'xn' };
|
|
51
|
+
/** Matches `rnr_<rev>_<index>_<action code>`. */
|
|
52
|
+
exports.runnerActionCallbackRe = /^rnr_(\d+)_(\d+)_(p|r|x|xy|xn)$/;
|
|
53
|
+
function buildRunnersPageCallback(page) {
|
|
54
|
+
return `${exports.runnersCallbackPrefix}pg_${page}`;
|
|
55
|
+
}
|
|
56
|
+
function buildRunnerActionCallback(revision, index, action) {
|
|
57
|
+
return `${exports.runnersCallbackPrefix}${revision}_${index}_${actionCodes[action]}`;
|
|
58
|
+
}
|
|
59
|
+
/** @description Read a button's callback data; `null` when it is not one of this screen's. */
|
|
60
|
+
function parseRunnersCallback(data) {
|
|
61
|
+
if (data === exports.runnersPairCallback)
|
|
62
|
+
return { kind: 'pair' };
|
|
63
|
+
if (data === exports.runnersRefreshCallback)
|
|
64
|
+
return { kind: 'refresh' };
|
|
65
|
+
if (data === exports.runnersAddressUseCallback)
|
|
66
|
+
return { kind: 'addressUse' };
|
|
67
|
+
if (data === exports.runnersAddressOtherCallback)
|
|
68
|
+
return { kind: 'addressOther' };
|
|
69
|
+
const pageMatch = exports.runnersPageCallbackRe.exec(data);
|
|
70
|
+
if (pageMatch !== null)
|
|
71
|
+
return { kind: 'page', page: Number(pageMatch[1]) };
|
|
72
|
+
const match = exports.runnerActionCallbackRe.exec(data);
|
|
73
|
+
if (match === null)
|
|
74
|
+
return null;
|
|
75
|
+
const action = Object.keys(actionCodes).find((candidate) => actionCodes[candidate] === match[3]);
|
|
76
|
+
return action === undefined ? null : { kind: 'runner', revision: Number(match[1]), index: Number(match[2]), action };
|
|
77
|
+
}
|
|
78
|
+
const serviceKindKeys = {
|
|
79
|
+
foreground: 'runners.serviceForeground',
|
|
80
|
+
'user-service': 'runners.serviceUserService',
|
|
81
|
+
'system-service': 'runners.serviceSystemService',
|
|
82
|
+
unknown: 'runners.serviceUnknown',
|
|
83
|
+
};
|
|
84
|
+
/** @description `text` as a string a machine reported: no longer than {@link maxReportedTextChars}, cut with an ellipsis. */
|
|
85
|
+
function clipReportedText(text) {
|
|
86
|
+
return text.length <= exports.maxReportedTextChars ? text : `${text.slice(0, exports.maxReportedTextChars - 1)}…`;
|
|
87
|
+
}
|
|
88
|
+
function describeSystem(entry) {
|
|
89
|
+
const { probe, runner } = entry;
|
|
90
|
+
if (probe === null || probe.osName === '')
|
|
91
|
+
return clipReportedText(`${runner.os} (${runner.arch})`);
|
|
92
|
+
const name = [probe.osName, probe.osVersion].filter((part) => part !== '').join(' ');
|
|
93
|
+
return clipReportedText(probe.arch === '' ? name : `${name} (${probe.arch})`);
|
|
94
|
+
}
|
|
95
|
+
function describeCpu(probe, t, isLive) {
|
|
96
|
+
const model = probe.cpuModel === '' ? 'CPU' : clipReportedText(probe.cpuModel);
|
|
97
|
+
const shape = probe.cpuCores !== null
|
|
98
|
+
? t('runners.cpuCores', { model, cores: probe.cpuCores })
|
|
99
|
+
: probe.cpuThreads !== null
|
|
100
|
+
? t('runners.cpuThreads', { model, threads: probe.cpuThreads })
|
|
101
|
+
: model;
|
|
102
|
+
return isLive && probe.load !== null ? `${shape}, ${t('runners.cpuLoad', { load: probe.load })}` : shape;
|
|
103
|
+
}
|
|
104
|
+
function describeCapabilities(probe, t) {
|
|
105
|
+
// What the machine can do first, then what it cannot and why.
|
|
106
|
+
const available = [];
|
|
107
|
+
const unavailable = [];
|
|
108
|
+
for (const name of probe_1.runnerCapabilities) {
|
|
109
|
+
const report = probe.capabilities[name];
|
|
110
|
+
const detail = clipReportedText(report.detail);
|
|
111
|
+
if (report.isAvailable)
|
|
112
|
+
available.push(detail === '' ? name : `${name} (${detail})`);
|
|
113
|
+
else
|
|
114
|
+
unavailable.push(detail === '' ? t('runners.capabilityNo', { name }) : t('runners.capabilityNoWhy', { name, detail }));
|
|
115
|
+
}
|
|
116
|
+
return t('runners.capabilitiesLine', { list: [...available, ...unavailable].join(' · ') });
|
|
117
|
+
}
|
|
118
|
+
function buildEntryBlock(entry, t, formatTime) {
|
|
119
|
+
const { runner, probe } = entry;
|
|
120
|
+
const status = entry.isOnline
|
|
121
|
+
? t('runners.statusOnline')
|
|
122
|
+
: entry.lastSeenMs === null
|
|
123
|
+
? t('runners.statusNeverSeen')
|
|
124
|
+
: t('runners.statusOffline', { time: formatTime(entry.lastSeenMs) });
|
|
125
|
+
const serviceKind = (0, runnerServiceKind_1.getCurrentServiceKind)(runner, probe);
|
|
126
|
+
const heading = [status, ...(runner.isPaused ? [t('runners.pausedMark')] : []), describeSystem(entry), t(serviceKindKeys[serviceKind])].join(' · ');
|
|
127
|
+
const lines = [`${runner.name} — ${heading}`];
|
|
128
|
+
if (probe === null)
|
|
129
|
+
return lines.join('\n');
|
|
130
|
+
if (entry.isOnline) {
|
|
131
|
+
lines.push(` ${t('runners.hardwareLine', { cpu: describeCpu(probe, t, true), ramTotal: (0, probe_1.formatGigabytes)(probe.ramTotalMb), ramFree: (0, probe_1.formatGigabytes)(probe.ramFreeMb), disk: (0, probe_1.formatGigabytes)(probe.diskFreeMb) })}`, ` ${t('runners.jobsLine', { running: probe.jobsRunning, queued: probe.jobsQueued, projects: probe.jobsProjects })}${probe.pueueVersion === null ? ` · ${t('runners.pueueMissing')}` : ''}`, ` ${describeCapabilities(probe, t)}`);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
lines.push(` ${t('runners.hardwareOldLine', { cpu: describeCpu(probe, t, false), ramTotal: (0, probe_1.formatGigabytes)(probe.ramTotalMb), disk: (0, probe_1.formatGigabytes)(probe.diskFreeMb) })}`);
|
|
135
|
+
}
|
|
136
|
+
return lines.join('\n');
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* @description Split the entry blocks over pages: each page takes blocks while the text stays within `budget` characters (blocks joined by
|
|
140
|
+
* a blank line), and at least one block, so a block over the budget alone still has a page. Returns each page's first block and the
|
|
141
|
+
* block after its last.
|
|
142
|
+
*/
|
|
143
|
+
function paginateBlocks(blocks, budget) {
|
|
144
|
+
const pages = [];
|
|
145
|
+
let start = 0;
|
|
146
|
+
let used = 0;
|
|
147
|
+
blocks.forEach((block, index) => {
|
|
148
|
+
const cost = block.length + (index === start ? 0 : sectionSeparator.length);
|
|
149
|
+
if (index > start && used + cost > budget) {
|
|
150
|
+
pages.push({ start, end: index });
|
|
151
|
+
start = index;
|
|
152
|
+
used = 0;
|
|
153
|
+
}
|
|
154
|
+
used += index === start ? block.length : cost;
|
|
155
|
+
});
|
|
156
|
+
if (blocks.length > 0)
|
|
157
|
+
pages.push({ start, end: blocks.length });
|
|
158
|
+
return pages;
|
|
159
|
+
}
|
|
160
|
+
function buildOpenPairingsSection(expiries, t, formatTime) {
|
|
161
|
+
if (expiries.length === 0)
|
|
162
|
+
return [];
|
|
163
|
+
const lastExpiry = Math.max(...expiries);
|
|
164
|
+
return [expiries.length === 1 ? t('runners.pendingCodeLine', { time: formatTime(lastExpiry) }) : t('runners.pendingCodesLine', { count: expiries.length, time: formatTime(lastExpiry) })];
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* @description The list screen, page `page` (0-based; a page past the end is the last): the machines on it, a button to pair another, a
|
|
168
|
+
* Pause/Resume and a Remove per machine on the page, the page buttons when there is more than one page, Refresh.
|
|
169
|
+
*/
|
|
170
|
+
function buildRunnersScreen(model, t, formatTime, page = 0) {
|
|
171
|
+
const title = t('runners.title');
|
|
172
|
+
const openPairings = buildOpenPairingsSection(model.openPairingExpiries, t, formatTime);
|
|
173
|
+
const checking = model.isChecking ? [t('runners.checkingNote')] : [];
|
|
174
|
+
const blocks = model.entries.map((entry) => buildEntryBlock(entry, t, formatTime));
|
|
175
|
+
const chromeChars = [title, ...openPairings, ...checking].join(sectionSeparator).length + sectionSeparator.length + pageLineReserveChars;
|
|
176
|
+
const pages = paginateBlocks(blocks, exports.maxScreenTextChars - chromeChars);
|
|
177
|
+
const pageCount = Math.max(pages.length, 1);
|
|
178
|
+
const shownPage = Math.min(Math.max(page, 0), pageCount - 1);
|
|
179
|
+
const { start, end } = pages[shownPage] ?? { start: 0, end: 0 };
|
|
180
|
+
const sections = [
|
|
181
|
+
title,
|
|
182
|
+
...(pageCount > 1 ? [t('runners.pageLine', { page: shownPage + 1, pages: pageCount })] : []),
|
|
183
|
+
...(model.entries.length === 0 ? [t('runners.emptyText')] : blocks.slice(start, end)),
|
|
184
|
+
...openPairings,
|
|
185
|
+
...checking,
|
|
186
|
+
];
|
|
187
|
+
const rows = [[{ text: t('runners.pairButton'), data: exports.runnersPairCallback }]];
|
|
188
|
+
model.entries.slice(start, end).forEach((entry, offset) => {
|
|
189
|
+
const { name, isPaused } = entry.runner;
|
|
190
|
+
const index = start + offset;
|
|
191
|
+
rows.push([
|
|
192
|
+
isPaused
|
|
193
|
+
? { text: t('runners.resumeButton', { name }), data: buildRunnerActionCallback(model.revision, index, 'resume') }
|
|
194
|
+
: { text: t('runners.pauseButton', { name }), data: buildRunnerActionCallback(model.revision, index, 'pause') },
|
|
195
|
+
{ text: t('runners.removeButton', { name }), data: buildRunnerActionCallback(model.revision, index, 'remove') },
|
|
196
|
+
]);
|
|
197
|
+
});
|
|
198
|
+
if (pageCount > 1) {
|
|
199
|
+
rows.push([
|
|
200
|
+
...(shownPage > 0 ? [{ text: t('runners.pagePreviousButton'), data: buildRunnersPageCallback(shownPage - 1) }] : []),
|
|
201
|
+
...(shownPage < pageCount - 1 ? [{ text: t('runners.pageNextButton'), data: buildRunnersPageCallback(shownPage + 1) }] : []),
|
|
202
|
+
]);
|
|
203
|
+
}
|
|
204
|
+
rows.push([{ text: t('runners.refreshButton'), data: exports.runnersRefreshCallback }]);
|
|
205
|
+
return { text: sections.join(sectionSeparator), rows, page: shownPage, pageCount };
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* @description The message that says what a removal came to: the key is deleted in every case, and the jobs were stopped from the hub, or the
|
|
209
|
+
* machine was offline (it stops them itself once its key has been refused for `unconfirmedRemovalStopAfterHours`), or they could not be stopped
|
|
210
|
+
* from here (it does the same). Three outcomes, three texts — «offline» is not what «failed» means.
|
|
211
|
+
*/
|
|
212
|
+
function buildRemovalOutcomeText(runnerName, jobs, t) {
|
|
213
|
+
const keyByOutcome = {
|
|
214
|
+
stopped: 'runners.removedJobsStoppedText',
|
|
215
|
+
offline: 'runners.removedJobsOfflineText',
|
|
216
|
+
failed: 'runners.removedJobsFailedText',
|
|
217
|
+
};
|
|
218
|
+
return t(keyByOutcome[jobs], { name: runnerName, hours: removalTiming_1.unconfirmedRemovalStopAfterHours });
|
|
219
|
+
}
|
|
220
|
+
/** @description The question a Remove button turns the screen into. */
|
|
221
|
+
function buildRemoveConfirmation(runnerName, revision, index, t) {
|
|
222
|
+
return {
|
|
223
|
+
text: t('runners.removeConfirmText', { name: runnerName }),
|
|
224
|
+
rows: [[
|
|
225
|
+
{ text: t('runners.removeConfirmButton'), data: buildRunnerActionCallback(revision, index, 'removeYes') },
|
|
226
|
+
{ text: t('runners.removeCancelButton'), data: buildRunnerActionCallback(revision, index, 'removeNo') },
|
|
227
|
+
]],
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* @description The address step of the first pairing. With a proposal (an address of this machine that answered with its own
|
|
232
|
+
* sshd) it offers «Use …» and «Enter another address»; without one only the second, and says no address was found.
|
|
233
|
+
*/
|
|
234
|
+
function buildAddressStep(proposedAddress, t) {
|
|
235
|
+
if (proposedAddress === null) {
|
|
236
|
+
return {
|
|
237
|
+
text: `${t('runners.addressIntro')}\n\n${t('runners.addressNotFound')}`,
|
|
238
|
+
rows: [[{ text: t('runners.addressOtherButton'), data: exports.runnersAddressOtherCallback }]],
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
text: `${t('runners.addressIntro')}\n\n${t('runners.addressFound', { address: proposedAddress })}`,
|
|
243
|
+
rows: [[
|
|
244
|
+
{ text: t('runners.addressUseButton', { address: proposedAddress }), data: exports.runnersAddressUseCallback },
|
|
245
|
+
{ text: t('runners.addressOtherButton'), data: exports.runnersAddressOtherCallback },
|
|
246
|
+
]],
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* @description The pairing's text parts. A pairing is offered in TWO messages — the admin line first, the plain line second — because the
|
|
251
|
+
* two lines together are longer than a Telegram message; `account` is the one the admin line pairs unless its last word is changed.
|
|
252
|
+
*/
|
|
253
|
+
function buildPairingMessageParts(pairingLifetimeMinutes, account, t) {
|
|
254
|
+
return {
|
|
255
|
+
adminIntro: t('runners.pairingAdminIntro', { minutes: pairingLifetimeMinutes, account }),
|
|
256
|
+
alternativeIntro: t('runners.pairingAlternativeIntro'),
|
|
257
|
+
alternativeOutro: t('runners.pairingAlternativeOutro'),
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
/** @description What the pairing message becomes once the code was used. */
|
|
261
|
+
function buildPairedText(runnerName, pairedAtMs, t, formatTime) {
|
|
262
|
+
return t('runners.pairedText', { name: runnerName, time: formatTime(pairedAtMs) });
|
|
263
|
+
}
|
|
264
|
+
/** @description What the pairing message becomes once the code expired unused. */
|
|
265
|
+
function buildExpiredText(t) {
|
|
266
|
+
return t('runners.expiredText');
|
|
267
|
+
}
|
|
268
|
+
/** @description What the pairing message becomes once its code was CLOSED unused: the line was pasted for a machine that was already paired, so it only installed the service. */
|
|
269
|
+
function buildClosedText(t) {
|
|
270
|
+
return t('runners.closedText');
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=runnersScreenPlan.js.map
|