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
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.getPackageIdOfArchive = getPackageIdOfArchive;
|
|
37
|
+
exports.checkIsPackageId = checkIsPackageId;
|
|
38
|
+
exports.checkArchiveHasId = checkArchiveHasId;
|
|
39
|
+
const crypto_1 = require("crypto");
|
|
40
|
+
const fs = __importStar(require("fs"));
|
|
41
|
+
const zlib_1 = require("zlib");
|
|
42
|
+
/**
|
|
43
|
+
* @description The id of a hub package: the first 16 hex digits of the sha256 of the tar BEFORE compression (`runners/hubPackage.ts`
|
|
44
|
+
* computes it the same way). Builtins only: the very first step of a pairing, which has no dependencies installed, checks the archive it
|
|
45
|
+
* downloaded against the id the hub announced with it.
|
|
46
|
+
*/
|
|
47
|
+
const packageIdLength = 16;
|
|
48
|
+
const packageIdPattern = /^[0-9a-f]{16}$/;
|
|
49
|
+
function getPackageIdOfArchive(archive) {
|
|
50
|
+
return (0, crypto_1.createHash)('sha256').update((0, zlib_1.gunzipSync)(archive)).digest('hex').slice(0, packageIdLength);
|
|
51
|
+
}
|
|
52
|
+
function checkIsPackageId(value) {
|
|
53
|
+
return packageIdPattern.test(value);
|
|
54
|
+
}
|
|
55
|
+
/** @description Does the archive file hold the package `expectedId` names? An unreadable or damaged archive does not. */
|
|
56
|
+
function checkArchiveHasId(archivePath, expectedId) {
|
|
57
|
+
try {
|
|
58
|
+
return checkIsPackageId(expectedId) && getPackageIdOfArchive(fs.readFileSync(archivePath)) === expectedId;
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=packageId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageId.js","sourceRoot":"","sources":["../../src/runnerUtility/packageId.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,sDAEC;AAED,4CAEC;AAGD,8CAMC;AA5BD,mCAAoC;AACpC,uCAAyB;AACzB,+BAAkC;AAElC;;;;GAIG;AAEH,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAE1C,SAAgB,qBAAqB,CAAC,OAAe;IACnD,OAAO,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAA,iBAAU,EAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC;AAClG,CAAC;AAED,SAAgB,gBAAgB,CAAC,KAAa;IAC5C,OAAO,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC;AAED,yHAAyH;AACzH,SAAgB,iBAAiB,CAAC,WAAmB,EAAE,UAAkB;IACvE,IAAI,CAAC;QACH,OAAO,gBAAgB,CAAC,UAAU,CAAC,IAAI,qBAAqB,CAAC,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,KAAK,UAAU,CAAC;IAC5G,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description The one option of `charness-runner pair` that the admin line adds. Builtins only: `runnerCli.ts` reads it before any
|
|
3
|
+
* dependency is installed, and the hub (`runners/bootstrapLine.ts`) writes it.
|
|
4
|
+
*
|
|
5
|
+
* `--service-follows` says that the line which started the pairing installs the always-on service right after it, so the pairing does not
|
|
6
|
+
* print the «keep it running» help (its commands would be wrong: the service is already on its way).
|
|
7
|
+
*/
|
|
8
|
+
export declare const serviceFollowsFlag = "--service-follows";
|
|
9
|
+
export interface SplitPairArgs {
|
|
10
|
+
/** The arguments without the flag, in their order. */
|
|
11
|
+
rest: string[];
|
|
12
|
+
isServiceFollowing: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** @description Take the flag out of `args` wherever it stands. */
|
|
15
|
+
export declare function splitServiceFollowsFlag(args: readonly string[]): SplitPairArgs;
|
|
16
|
+
//# sourceMappingURL=pairArgs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pairArgs.d.ts","sourceRoot":"","sources":["../../src/runnerUtility/pairArgs.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AAEtD,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,mEAAmE;AACnE,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,aAAa,CAE9E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description The one option of `charness-runner pair` that the admin line adds. Builtins only: `runnerCli.ts` reads it before any
|
|
4
|
+
* dependency is installed, and the hub (`runners/bootstrapLine.ts`) writes it.
|
|
5
|
+
*
|
|
6
|
+
* `--service-follows` says that the line which started the pairing installs the always-on service right after it, so the pairing does not
|
|
7
|
+
* print the «keep it running» help (its commands would be wrong: the service is already on its way).
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.serviceFollowsFlag = void 0;
|
|
11
|
+
exports.splitServiceFollowsFlag = splitServiceFollowsFlag;
|
|
12
|
+
exports.serviceFollowsFlag = '--service-follows';
|
|
13
|
+
/** @description Take the flag out of `args` wherever it stands. */
|
|
14
|
+
function splitServiceFollowsFlag(args) {
|
|
15
|
+
return { rest: args.filter((argument) => argument !== exports.serviceFollowsFlag), isServiceFollowing: args.includes(exports.serviceFollowsFlag) };
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=pairArgs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pairArgs.js","sourceRoot":"","sources":["../../src/runnerUtility/pairArgs.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAWH,0DAEC;AAXY,QAAA,kBAAkB,GAAG,mBAAmB,CAAC;AAQtD,mEAAmE;AACnE,SAAgB,uBAAuB,CAAC,IAAuB;IAC7D,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,KAAK,0BAAkB,CAAC,EAAE,kBAAkB,EAAE,IAAI,CAAC,QAAQ,CAAC,0BAAkB,CAAC,EAAE,CAAC;AACrI,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type RedeemReply } from '../runners/gateProtocol';
|
|
2
|
+
import { type HubEndpoint } from './hubClient';
|
|
3
|
+
import type { RunnerKeys } from './runnerKeys';
|
|
4
|
+
/**
|
|
5
|
+
* @description Getting a pairing back whose answer was lost. The hub commits a redemption — the runner is registered, the code's
|
|
6
|
+
* temporary key is deleted — BEFORE the runner has the answer and writes `config.json`. If the answer never arrives (the connection
|
|
7
|
+
* drops, the process dies), the temporary key cannot be used again and a fresh code is refused (the runner's own key is already
|
|
8
|
+
* registered). What can still ask is the runner's PERMANENT key, so the runner writes `pairing.json` before it redeems and, whenever it
|
|
9
|
+
* finds that file without a `config.json`, asks the gate for its `identity`: the very answer `redeem` gave. A key the hub does not
|
|
10
|
+
* know is the other answer — nothing was committed, the half-done pairing is dropped.
|
|
11
|
+
*/
|
|
12
|
+
export type RecoveryOutcome =
|
|
13
|
+
/** The hub has this runner: here is what `redeem` answered. */
|
|
14
|
+
{
|
|
15
|
+
kind: 'recovered';
|
|
16
|
+
reply: Extract<RedeemReply, {
|
|
17
|
+
ok: true;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
/** The hub does not know this key (or no longer): nothing was committed there. */
|
|
21
|
+
| {
|
|
22
|
+
kind: 'not-registered';
|
|
23
|
+
}
|
|
24
|
+
/** The hub could not be asked right now; try again later. */
|
|
25
|
+
| {
|
|
26
|
+
kind: 'unreachable';
|
|
27
|
+
message: string;
|
|
28
|
+
};
|
|
29
|
+
/** @description Ask the hub, with the runner's own key, what it knows of this runner. */
|
|
30
|
+
export declare function recoverPairing(endpoint: HubEndpoint, keys: RunnerKeys): Promise<RecoveryOutcome>;
|
|
31
|
+
//# sourceMappingURL=pairingRecovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pairingRecovery.d.ts","sourceRoot":"","sources":["../../src/runnerUtility/pairingRecovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAqD,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAClG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;;;GAOG;AAEH,MAAM,MAAM,eAAe;AACzB,+DAA+D;AAC7D;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC,WAAW,EAAE;QAAE,EAAE,EAAE,IAAI,CAAA;KAAE,CAAC,CAAA;CAAE;AAClE,kFAAkF;GAChF;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE;AAC5B,6DAA6D;GAC3D;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7C,yFAAyF;AACzF,wBAAsB,cAAc,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,eAAe,CAAC,CAatG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.recoverPairing = recoverPairing;
|
|
4
|
+
const gateProtocol_1 = require("../runners/gateProtocol");
|
|
5
|
+
const hubClient_1 = require("./hubClient");
|
|
6
|
+
/** @description Ask the hub, with the runner's own key, what it knows of this runner. */
|
|
7
|
+
async function recoverPairing(endpoint, keys) {
|
|
8
|
+
try {
|
|
9
|
+
const client = await (0, hubClient_1.connectToHub)(endpoint, keys.client.privateKey);
|
|
10
|
+
try {
|
|
11
|
+
const reply = await (0, hubClient_1.requestGateJson)(client, 'identity', null, gateProtocol_1.redeemReplySchema);
|
|
12
|
+
return reply.ok ? { kind: 'recovered', reply } : { kind: 'not-registered' };
|
|
13
|
+
}
|
|
14
|
+
finally {
|
|
15
|
+
client.end();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
if (error instanceof hubClient_1.HubConnectionError && error.failure === 'auth')
|
|
20
|
+
return { kind: 'not-registered' };
|
|
21
|
+
return { kind: 'unreachable', message: error instanceof Error ? error.message : 'could not reach the hub' };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=pairingRecovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pairingRecovery.js","sourceRoot":"","sources":["../../src/runnerUtility/pairingRecovery.ts"],"names":[],"mappings":";;AAsBA,wCAaC;AAnCD,0DAA8E;AAC9E,2CAAkG;AAoBlG,yFAAyF;AAClF,KAAK,UAAU,cAAc,CAAC,QAAqB,EAAE,IAAgB;IAC1E,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAY,EAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACpE,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,IAAA,2BAAe,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,gCAAiB,CAAC,CAAC;YACjF,OAAO,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;QAC9E,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,GAAG,EAAE,CAAC;QACf,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,8BAAkB,IAAI,KAAK,CAAC,OAAO,KAAK,MAAM;YAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;QACvG,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB,EAAE,CAAC;IAC9G,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type CommandRunner } from '../selfUpdate/commandRunner';
|
|
2
|
+
import type { RunnerHomePaths } from './runnerHome';
|
|
3
|
+
export declare function renderPueueConfig(paths: RunnerHomePaths): string;
|
|
4
|
+
/** @description Write the config (and its folders) when it is missing or differs. */
|
|
5
|
+
export declare function ensurePueueConfig(paths: RunnerHomePaths): void;
|
|
6
|
+
/** @description Is the daemon answering? */
|
|
7
|
+
export declare function checkIsPueueRunning(paths: RunnerHomePaths, runner?: CommandRunner): Promise<boolean>;
|
|
8
|
+
/** @description Start the daemon (daemonized, so it outlives this process) unless it answers; `false` when it could not be started. */
|
|
9
|
+
export declare function ensurePueueDaemon(paths: RunnerHomePaths, runner?: CommandRunner): Promise<boolean>;
|
|
10
|
+
/** @description When a service manages Pueue the link must not start a second daemon: wait (up to `timeoutMs`) for the service's to answer. */
|
|
11
|
+
export declare function waitForPueueDaemon(paths: RunnerHomePaths, timeoutMs: number, runner?: CommandRunner): Promise<boolean>;
|
|
12
|
+
/** What a Pueue daemon on this runner's private socket is doing. */
|
|
13
|
+
export type PueueState = {
|
|
14
|
+
kind: 'absent';
|
|
15
|
+
} | {
|
|
16
|
+
kind: 'idle';
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'busy';
|
|
19
|
+
activeJobs: number;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'unreadable';
|
|
22
|
+
};
|
|
23
|
+
/** @description The tasks of `pueue status --json` that hold a process — `Running` and `Paused` — or `null` when the text is not that. */
|
|
24
|
+
export declare function countActivePueueTasks(statusJson: string): number | null;
|
|
25
|
+
/** @description Is a daemon answering on the runner's socket, and does it hold running jobs? */
|
|
26
|
+
export declare function inspectPueue(paths: RunnerHomePaths, runner?: CommandRunner): Promise<PueueState>;
|
|
27
|
+
/** @description Ask a daemon that no service manager owns to shut down, and wait for it to go. Pueue kills the jobs it runs when it stops: only for an IDLE one. */
|
|
28
|
+
export declare function shutDownPueue(paths: RunnerHomePaths, runner?: CommandRunner): Promise<boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* @description Stop every job of the queue and empty it (`pueue reset --force`: it kills the running tasks and their children and removes the
|
|
31
|
+
* rest, so no queued task starts in their place), then wait until nothing is left running. `true` also when no daemon answers (its jobs died
|
|
32
|
+
* with it). The reset only ASKS: Pueue 4 answers at once and its task handler kills the tasks a moment later, so one look right after the
|
|
33
|
+
* command would still see them `Running` — it looks again, until `settleTimeoutMs` is over.
|
|
34
|
+
*/
|
|
35
|
+
export declare function stopAllPueueJobs(paths: RunnerHomePaths, runner?: CommandRunner, settleTimeoutMs?: number): Promise<boolean>;
|
|
36
|
+
//# sourceMappingURL=pueueDaemon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pueueDaemon.d.ts","sourceRoot":"","sources":["../../src/runnerUtility/pueueDaemon.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAapD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAWhE;AAED,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAW9D;AAED,4CAA4C;AAC5C,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,GAAE,aAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAGtH;AAED,uIAAuI;AACvI,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,GAAE,aAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAKpH;AAED,+IAA+I;AAC/I,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,aAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAQxI;AAED,oEAAoE;AACpE,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC;AAE3B,0IAA0I;AAC1I,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWvE;AAED,gGAAgG;AAChG,wBAAsB,YAAY,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,GAAE,aAA0B,GAAG,OAAO,CAAC,UAAU,CAAC,CAMlH;AAED,oKAAoK;AACpK,wBAAsB,aAAa,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,GAAE,aAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAQhH;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,GAAE,aAA0B,EAAE,eAAe,GAAE,MAA6B,GAAG,OAAO,CAAC,OAAO,CAAC,CAUnK"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.renderPueueConfig = renderPueueConfig;
|
|
37
|
+
exports.ensurePueueConfig = ensurePueueConfig;
|
|
38
|
+
exports.checkIsPueueRunning = checkIsPueueRunning;
|
|
39
|
+
exports.ensurePueueDaemon = ensurePueueDaemon;
|
|
40
|
+
exports.waitForPueueDaemon = waitForPueueDaemon;
|
|
41
|
+
exports.countActivePueueTasks = countActivePueueTasks;
|
|
42
|
+
exports.inspectPueue = inspectPueue;
|
|
43
|
+
exports.shutDownPueue = shutDownPueue;
|
|
44
|
+
exports.stopAllPueueJobs = stopAllPueueJobs;
|
|
45
|
+
const fs = __importStar(require("fs"));
|
|
46
|
+
const path = __importStar(require("path"));
|
|
47
|
+
const configDirFile_1 = require("../configDirFile");
|
|
48
|
+
const commandRunner_1 = require("../selfUpdate/commandRunner");
|
|
49
|
+
/**
|
|
50
|
+
* @description The runner's private Pueue: its config under `~/.charness-runner/pueue/` (own directories and unix socket — never the
|
|
51
|
+
* account's default Pueue), and a daemon that is started if it is not running. Pueue is a service of its own: stopping or restarting the
|
|
52
|
+
* link never touches the queue or a running job.
|
|
53
|
+
*/
|
|
54
|
+
const probeTimeoutMs = 5000;
|
|
55
|
+
const daemonStartTimeoutMs = 15 * 1000;
|
|
56
|
+
const configMode = 0o600;
|
|
57
|
+
const pueueWaitPollMs = 500;
|
|
58
|
+
function renderPueueConfig(paths) {
|
|
59
|
+
const runtimeDir = path.join(paths.pueueDir, 'run');
|
|
60
|
+
return [
|
|
61
|
+
'shared:',
|
|
62
|
+
` pueue_directory: ${path.join(paths.pueueDir, 'data')}`,
|
|
63
|
+
` runtime_directory: ${runtimeDir}`,
|
|
64
|
+
' use_unix_socket: true',
|
|
65
|
+
` unix_socket_path: ${path.join(runtimeDir, 'pueue.socket')}`,
|
|
66
|
+
` pid_path: ${path.join(runtimeDir, 'pueue.pid')}`,
|
|
67
|
+
'',
|
|
68
|
+
].join('\n');
|
|
69
|
+
}
|
|
70
|
+
/** @description Write the config (and its folders) when it is missing or differs. */
|
|
71
|
+
function ensurePueueConfig(paths) {
|
|
72
|
+
fs.mkdirSync(path.join(paths.pueueDir, 'run'), { recursive: true, mode: 0o700 });
|
|
73
|
+
fs.mkdirSync(path.join(paths.pueueDir, 'data'), { recursive: true, mode: 0o700 });
|
|
74
|
+
const text = renderPueueConfig(paths);
|
|
75
|
+
let current = null;
|
|
76
|
+
try {
|
|
77
|
+
current = fs.readFileSync(paths.pueueConfig, 'utf8');
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
current = null;
|
|
81
|
+
}
|
|
82
|
+
if (current !== text)
|
|
83
|
+
(0, configDirFile_1.writeTextFileAtomically)(paths.pueueConfig, text, configMode);
|
|
84
|
+
}
|
|
85
|
+
/** @description Is the daemon answering? */
|
|
86
|
+
async function checkIsPueueRunning(paths, runner = commandRunner_1.runCommand) {
|
|
87
|
+
const result = await runner(path.join(paths.binDir, 'pueue'), ['--config', paths.pueueConfig, 'status'], { timeoutMs: probeTimeoutMs });
|
|
88
|
+
return result.ok;
|
|
89
|
+
}
|
|
90
|
+
/** @description Start the daemon (daemonized, so it outlives this process) unless it answers; `false` when it could not be started. */
|
|
91
|
+
async function ensurePueueDaemon(paths, runner = commandRunner_1.runCommand) {
|
|
92
|
+
ensurePueueConfig(paths);
|
|
93
|
+
if (await checkIsPueueRunning(paths, runner))
|
|
94
|
+
return true;
|
|
95
|
+
const started = await runner(path.join(paths.binDir, 'pueued'), ['--daemonize', '--config', paths.pueueConfig], { timeoutMs: daemonStartTimeoutMs });
|
|
96
|
+
return started.ok && await checkIsPueueRunning(paths, runner);
|
|
97
|
+
}
|
|
98
|
+
/** @description When a service manages Pueue the link must not start a second daemon: wait (up to `timeoutMs`) for the service's to answer. */
|
|
99
|
+
async function waitForPueueDaemon(paths, timeoutMs, runner = commandRunner_1.runCommand) {
|
|
100
|
+
ensurePueueConfig(paths);
|
|
101
|
+
const deadline = Date.now() + timeoutMs;
|
|
102
|
+
while (Date.now() < deadline) {
|
|
103
|
+
if (await checkIsPueueRunning(paths, runner))
|
|
104
|
+
return true;
|
|
105
|
+
await new Promise((resolve) => { setTimeout(resolve, pueueWaitPollMs); });
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
/** @description The tasks of `pueue status --json` that hold a process — `Running` and `Paused` — or `null` when the text is not that. */
|
|
110
|
+
function countActivePueueTasks(statusJson) {
|
|
111
|
+
try {
|
|
112
|
+
const parsed = JSON.parse(statusJson);
|
|
113
|
+
if (parsed.tasks === undefined)
|
|
114
|
+
return null;
|
|
115
|
+
return Object.values(parsed.tasks).filter((task) => {
|
|
116
|
+
const status = typeof task.status === 'string' ? [task.status] : Object.keys(task.status ?? {});
|
|
117
|
+
return status.includes('Running') || status.includes('Paused');
|
|
118
|
+
}).length;
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/** @description Is a daemon answering on the runner's socket, and does it hold running jobs? */
|
|
125
|
+
async function inspectPueue(paths, runner = commandRunner_1.runCommand) {
|
|
126
|
+
const result = await runner(path.join(paths.binDir, 'pueue'), ['--config', paths.pueueConfig, 'status', '--json'], { timeoutMs: probeTimeoutMs });
|
|
127
|
+
if (!result.ok)
|
|
128
|
+
return { kind: 'absent' };
|
|
129
|
+
const activeJobs = countActivePueueTasks(result.stdout);
|
|
130
|
+
if (activeJobs === null)
|
|
131
|
+
return { kind: 'unreadable' };
|
|
132
|
+
return activeJobs === 0 ? { kind: 'idle' } : { kind: 'busy', activeJobs };
|
|
133
|
+
}
|
|
134
|
+
/** @description Ask a daemon that no service manager owns to shut down, and wait for it to go. Pueue kills the jobs it runs when it stops: only for an IDLE one. */
|
|
135
|
+
async function shutDownPueue(paths, runner = commandRunner_1.runCommand) {
|
|
136
|
+
await runner(path.join(paths.binDir, 'pueue'), ['--config', paths.pueueConfig, 'shutdown'], { timeoutMs: probeTimeoutMs });
|
|
137
|
+
const deadline = Date.now() + daemonStartTimeoutMs;
|
|
138
|
+
while (Date.now() < deadline) {
|
|
139
|
+
if (!(await checkIsPueueRunning(paths, runner)))
|
|
140
|
+
return true;
|
|
141
|
+
await new Promise((resolve) => { setTimeout(resolve, pueueWaitPollMs); });
|
|
142
|
+
}
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* @description Stop every job of the queue and empty it (`pueue reset --force`: it kills the running tasks and their children and removes the
|
|
147
|
+
* rest, so no queued task starts in their place), then wait until nothing is left running. `true` also when no daemon answers (its jobs died
|
|
148
|
+
* with it). The reset only ASKS: Pueue 4 answers at once and its task handler kills the tasks a moment later, so one look right after the
|
|
149
|
+
* command would still see them `Running` — it looks again, until `settleTimeoutMs` is over.
|
|
150
|
+
*/
|
|
151
|
+
async function stopAllPueueJobs(paths, runner = commandRunner_1.runCommand, settleTimeoutMs = daemonStartTimeoutMs) {
|
|
152
|
+
if ((await inspectPueue(paths, runner)).kind === 'absent')
|
|
153
|
+
return true;
|
|
154
|
+
await runner(path.join(paths.binDir, 'pueue'), ['--config', paths.pueueConfig, 'reset', '--force'], { timeoutMs: daemonStartTimeoutMs });
|
|
155
|
+
const deadline = Date.now() + settleTimeoutMs;
|
|
156
|
+
for (;;) {
|
|
157
|
+
const after = await inspectPueue(paths, runner);
|
|
158
|
+
if (after.kind === 'absent' || after.kind === 'idle')
|
|
159
|
+
return true;
|
|
160
|
+
if (Date.now() >= deadline)
|
|
161
|
+
return false;
|
|
162
|
+
await new Promise((resolve) => { setTimeout(resolve, pueueWaitPollMs); });
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=pueueDaemon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pueueDaemon.js","sourceRoot":"","sources":["../../src/runnerUtility/pueueDaemon.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,8CAWC;AAGD,8CAWC;AAGD,kDAGC;AAGD,8CAKC;AAGD,gDAQC;AAUD,sDAWC;AAGD,oCAMC;AAGD,sCAQC;AAQD,4CAUC;AA9HD,uCAAyB;AACzB,2CAA6B;AAC7B,oDAA2D;AAC3D,+DAA6E;AAG7E;;;;GAIG;AAEH,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,CAAC;AACvC,MAAM,UAAU,GAAG,KAAK,CAAC;AACzB,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,SAAgB,iBAAiB,C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,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC,CAAC;IACzI,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,eAAe,CAAC;IAC9C,SAAS,CAAC;QACR,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAChD,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;YAAE,OAAO,IAAI,CAAC;QAClE,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,QAAQ;YAAE,OAAO,KAAK,CAAC;QACzC,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,GAAG,UAAU,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `rootServiceCli.js install <account>` — the root step of the admin pairing line (`runners/bootstrapLine.ts`), run by it from a copy of
|
|
4
|
+
* the package that root unpacked into a folder of its own. Node built-ins only (that copy has no `node_modules`), and it never reads or
|
|
5
|
+
* runs anything from the account's home but through `sudo -u <account>` (see `adminService.ts`).
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=rootServiceCli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rootServiceCli.d.ts","sourceRoot":"","sources":["../../src/runnerUtility/rootServiceCli.ts"],"names":[],"mappings":";AAEA;;;;GAIG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* `rootServiceCli.js install <account>` — the root step of the admin pairing line (`runners/bootstrapLine.ts`), run by it from a copy of
|
|
5
|
+
* the package that root unpacked into a folder of its own. Node built-ins only (that copy has no `node_modules`), and it never reads or
|
|
6
|
+
* runs anything from the account's home but through `sudo -u <account>` (see `adminService.ts`).
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const adminService_1 = require("./adminService");
|
|
10
|
+
const usageExitCode = 2;
|
|
11
|
+
async function main() {
|
|
12
|
+
const [command, account, ...rest] = process.argv.slice(2);
|
|
13
|
+
if (command !== 'install' || account === undefined || rest.length > 0) {
|
|
14
|
+
process.stderr.write('Usage: rootServiceCli.js install <account>\n');
|
|
15
|
+
return usageExitCode;
|
|
16
|
+
}
|
|
17
|
+
const result = await (0, adminService_1.installServiceForAccount)(account, (0, adminService_1.createAdminServiceDeps)());
|
|
18
|
+
if (result.lines.length > 0)
|
|
19
|
+
(result.ok ? process.stdout : process.stderr).write(`${result.lines.join('\n')}\n`);
|
|
20
|
+
return result.ok ? 0 : 1;
|
|
21
|
+
}
|
|
22
|
+
// Only when this file IS the program (`node <copy>/rootServiceCli.js install <account>`): importing it, as the self-check does, installs nothing.
|
|
23
|
+
if (require.main === module) {
|
|
24
|
+
main().then((code) => {
|
|
25
|
+
process.exitCode = code;
|
|
26
|
+
}, (error) => {
|
|
27
|
+
process.stderr.write(`charness-runner: ${error.message}\n`);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=rootServiceCli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rootServiceCli.js","sourceRoot":"","sources":["../../src/runnerUtility/rootServiceCli.ts"],"names":[],"mappings":";;AAEA;;;;GAIG;;AAEH,iDAAkF;AAElF,MAAM,aAAa,GAAG,CAAC,CAAC;AAExB,KAAK,UAAU,IAAI;IACjB,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1D,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;QACrE,OAAO,aAAa,CAAC;IACvB,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,IAAA,uCAAwB,EAAC,OAAO,EAAE,IAAA,qCAAsB,GAAE,CAAC,CAAC;IACjF,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjH,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3B,CAAC;AAED,kJAAkJ;AAClJ,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,IAAI,EAAE,CAAC,IAAI,CACT,CAAC,IAAI,EAAE,EAAE;QACP,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC1B,CAAC,EACD,CAAC,KAAY,EAAE,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;QAC5D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `charness-runner` — the program that attaches a machine to a charness hub as a runner (see `src/runners/README.md` for the hub side
|
|
4
|
+
* and `src/runnerUtility/README.md` for this one).
|
|
5
|
+
*
|
|
6
|
+
* charness-runner what this account is attached to and what the link is doing (= `status`)
|
|
7
|
+
* charness-runner pair <code> attach this account with a pairing code (the line from /runners does it for you)
|
|
8
|
+
* charness-runner run hold the link to the hub; Ctrl-C stops (a service does the same, see the pairing text)
|
|
9
|
+
* charness-runner check look at this machine and install what a runner needs (Pueue, rsync)
|
|
10
|
+
* charness-runner service install keep it running without a terminal (see `serviceManager.ts`)
|
|
11
|
+
* charness-runner pause | resume | unpair
|
|
12
|
+
*
|
|
13
|
+
* This file is the FIRST thing a pairing runs, from a package that has no `node_modules` yet (`pair --bootstrap <folder> <code>`,
|
|
14
|
+
* started by the pasted line): it imports Node built-ins only, installs the package's dependencies into a new app folder, and starts
|
|
15
|
+
* the installed copy to do the pairing. Everything else is loaded after that, on demand.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=runnerCli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runnerCli.d.ts","sourceRoot":"","sources":["../../src/runnerUtility/runnerCli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;GAcG"}
|