charness 3.9.1 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +126 -0
- package/DEVELOPMENT.md +4 -1
- package/SETUP.md +6 -4
- package/agent-plugin/README.md +2 -2
- package/agent-plugin/skills/charness-delegate-opencode/SKILL.md +1 -1
- package/agent-plugin/skills/charness-manager/SKILL.md +8 -4
- package/dist/bot.d.ts +27 -18
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +217 -99
- package/dist/bot.js.map +1 -1
- package/dist/connectors/jira/adf.d.ts.map +1 -1
- package/dist/connectors/jira/adf.js +2 -3
- package/dist/connectors/jira/adf.js.map +1 -1
- package/dist/connectors/telegram/commands/botCore.d.ts +16 -0
- package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/runners.d.ts +10 -1
- package/dist/connectors/telegram/commands/runners.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/runners.js +75 -13
- package/dist/connectors/telegram/commands/runners.js.map +1 -1
- package/dist/connectors/telegram/runnerLinkNotices.d.ts +24 -0
- package/dist/connectors/telegram/runnerLinkNotices.d.ts.map +1 -0
- package/dist/connectors/telegram/runnerLinkNotices.js +95 -0
- package/dist/connectors/telegram/runnerLinkNotices.js.map +1 -0
- package/dist/connectors/telegram/runnerPairingMessages.d.ts +9 -0
- package/dist/connectors/telegram/runnerPairingMessages.d.ts.map +1 -1
- package/dist/connectors/telegram/runnerPairingMessages.js +17 -1
- package/dist/connectors/telegram/runnerPairingMessages.js.map +1 -1
- package/dist/i18n/de.d.ts.map +1 -1
- package/dist/i18n/de.js +19 -0
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +19 -0
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +19 -0
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +19 -0
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/hi.d.ts.map +1 -1
- package/dist/i18n/hi.js +19 -0
- package/dist/i18n/hi.js.map +1 -1
- package/dist/i18n/ja.d.ts.map +1 -1
- package/dist/i18n/ja.js +19 -0
- package/dist/i18n/ja.js.map +1 -1
- package/dist/i18n/ka.d.ts.map +1 -1
- package/dist/i18n/ka.js +19 -0
- package/dist/i18n/ka.js.map +1 -1
- package/dist/i18n/pt.d.ts.map +1 -1
- package/dist/i18n/pt.js +19 -0
- package/dist/i18n/pt.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +19 -0
- package/dist/i18n/ru.js.map +1 -1
- package/dist/i18n/uk.d.ts.map +1 -1
- package/dist/i18n/uk.js +19 -0
- package/dist/i18n/uk.js.map +1 -1
- package/dist/i18n/uz.d.ts.map +1 -1
- package/dist/i18n/uz.js +19 -0
- package/dist/i18n/uz.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +19 -0
- package/dist/i18n/zh.js.map +1 -1
- package/dist/outputTrace.d.ts.map +1 -1
- package/dist/outputTrace.js +2 -9
- package/dist/outputTrace.js.map +1 -1
- package/dist/rateLimiter.d.ts +3 -1
- package/dist/rateLimiter.d.ts.map +1 -1
- package/dist/rateLimiter.js +3 -1
- package/dist/rateLimiter.js.map +1 -1
- package/dist/remoteRun/cliArgs.d.ts +6 -1
- package/dist/remoteRun/cliArgs.d.ts.map +1 -1
- package/dist/remoteRun/cliArgs.js +39 -2
- package/dist/remoteRun/cliArgs.js.map +1 -1
- package/dist/remoteRun/exitCodes.d.ts +12 -2
- package/dist/remoteRun/exitCodes.d.ts.map +1 -1
- package/dist/remoteRun/exitCodes.js +3 -0
- package/dist/remoteRun/exitCodes.js.map +1 -1
- package/dist/remoteRun/foreground.d.ts +13 -0
- package/dist/remoteRun/foreground.d.ts.map +1 -1
- package/dist/remoteRun/foreground.js +15 -2
- package/dist/remoteRun/foreground.js.map +1 -1
- package/dist/remoteRun/heldBackNotice.d.ts +7 -0
- package/dist/remoteRun/heldBackNotice.d.ts.map +1 -0
- package/dist/remoteRun/heldBackNotice.js +92 -0
- package/dist/remoteRun/heldBackNotice.js.map +1 -0
- package/dist/remoteRun/interrupts.d.ts +6 -2
- package/dist/remoteRun/interrupts.d.ts.map +1 -1
- package/dist/remoteRun/interrupts.js +18 -3
- package/dist/remoteRun/interrupts.js.map +1 -1
- package/dist/remoteRun/leaseTiming.d.ts +1 -2
- package/dist/remoteRun/leaseTiming.d.ts.map +1 -1
- package/dist/remoteRun/leaseTiming.js +3 -17
- package/dist/remoteRun/leaseTiming.js.map +1 -1
- package/dist/remoteRun/output.d.ts +16 -1
- package/dist/remoteRun/output.d.ts.map +1 -1
- package/dist/remoteRun/output.js +28 -2
- package/dist/remoteRun/output.js.map +1 -1
- package/dist/remoteRun/probe.d.ts +40 -2
- package/dist/remoteRun/probe.d.ts.map +1 -1
- package/dist/remoteRun/probe.js +58 -2
- package/dist/remoteRun/probe.js.map +1 -1
- package/dist/remoteRun/project.d.ts +2 -2
- package/dist/remoteRun/project.d.ts.map +1 -1
- package/dist/remoteRun/project.js +5 -4
- package/dist/remoteRun/project.js.map +1 -1
- package/dist/remoteRun/remoteRunCli.d.ts +1 -1
- package/dist/remoteRun/remoteRunCli.d.ts.map +1 -1
- package/dist/remoteRun/remoteRunCli.js +6 -3
- package/dist/remoteRun/remoteRunCli.js.map +1 -1
- package/dist/remoteRun/runnerWait.d.ts +3 -3
- package/dist/remoteRun/runnerWait.d.ts.map +1 -1
- package/dist/remoteRun/runnerWait.js +12 -6
- package/dist/remoteRun/runnerWait.js.map +1 -1
- package/dist/remoteRun/runnerWaitTiming.d.ts +1 -1
- package/dist/remoteRun/runnerWaitTiming.d.ts.map +1 -1
- package/dist/remoteRun/runnerWaitTiming.js +3 -16
- package/dist/remoteRun/runnerWaitTiming.js.map +1 -1
- package/dist/remoteRun/runners.d.ts +16 -3
- package/dist/remoteRun/runners.d.ts.map +1 -1
- package/dist/remoteRun/runners.js +42 -4
- package/dist/remoteRun/runners.js.map +1 -1
- package/dist/remoteRun/sendPlan.d.ts +11 -1
- package/dist/remoteRun/sendPlan.d.ts.map +1 -1
- package/dist/remoteRun/sendPlan.js +29 -5
- package/dist/remoteRun/sendPlan.js.map +1 -1
- package/dist/remoteRun/submit.d.ts.map +1 -1
- package/dist/remoteRun/submit.js +13 -3
- package/dist/remoteRun/submit.js.map +1 -1
- package/dist/runnerUtility/adminService.d.ts +30 -2
- package/dist/runnerUtility/adminService.d.ts.map +1 -1
- package/dist/runnerUtility/adminService.js +104 -6
- package/dist/runnerUtility/adminService.js.map +1 -1
- package/dist/runnerUtility/appInstall.d.ts +13 -4
- package/dist/runnerUtility/appInstall.d.ts.map +1 -1
- package/dist/runnerUtility/appInstall.js +46 -19
- package/dist/runnerUtility/appInstall.js.map +1 -1
- package/dist/runnerUtility/appUpdate.js +1 -1
- package/dist/runnerUtility/appUpdate.js.map +1 -1
- package/dist/runnerUtility/execEnv.d.ts +2 -0
- package/dist/runnerUtility/execEnv.d.ts.map +1 -1
- package/dist/runnerUtility/execEnv.js +6 -2
- package/dist/runnerUtility/execEnv.js.map +1 -1
- package/dist/runnerUtility/guiAgent.d.ts +126 -0
- package/dist/runnerUtility/guiAgent.d.ts.map +1 -0
- package/dist/runnerUtility/guiAgent.js +591 -0
- package/dist/runnerUtility/guiAgent.js.map +1 -0
- package/dist/runnerUtility/guiAgentHeal.d.ts +128 -0
- package/dist/runnerUtility/guiAgentHeal.d.ts.map +1 -0
- package/dist/runnerUtility/guiAgentHeal.js +284 -0
- package/dist/runnerUtility/guiAgentHeal.js.map +1 -0
- package/dist/runnerUtility/homeFolders.d.ts +33 -0
- package/dist/runnerUtility/homeFolders.d.ts.map +1 -0
- package/dist/runnerUtility/homeFolders.js +158 -0
- package/dist/runnerUtility/homeFolders.js.map +1 -0
- package/dist/runnerUtility/hubClient.d.ts +12 -2
- package/dist/runnerUtility/hubClient.d.ts.map +1 -1
- package/dist/runnerUtility/hubClient.js +24 -3
- package/dist/runnerUtility/hubClient.js.map +1 -1
- package/dist/runnerUtility/iosCheck.d.ts +7 -1
- package/dist/runnerUtility/iosCheck.d.ts.map +1 -1
- package/dist/runnerUtility/iosCheck.js +14 -5
- package/dist/runnerUtility/iosCheck.js.map +1 -1
- package/dist/runnerUtility/isolatedCommand.d.ts +33 -0
- package/dist/runnerUtility/isolatedCommand.d.ts.map +1 -0
- package/dist/runnerUtility/isolatedCommand.js +139 -0
- package/dist/runnerUtility/isolatedCommand.js.map +1 -0
- package/dist/runnerUtility/keepAwake.d.ts +67 -0
- package/dist/runnerUtility/keepAwake.d.ts.map +1 -0
- package/dist/runnerUtility/keepAwake.js +211 -0
- package/dist/runnerUtility/keepAwake.js.map +1 -0
- package/dist/runnerUtility/lidPollTiming.d.ts +11 -0
- package/dist/runnerUtility/lidPollTiming.d.ts.map +1 -0
- package/dist/runnerUtility/lidPollTiming.js +18 -0
- package/dist/runnerUtility/lidPollTiming.js.map +1 -0
- package/dist/runnerUtility/lidState.d.ts +57 -0
- package/dist/runnerUtility/lidState.d.ts.map +1 -0
- package/dist/runnerUtility/lidState.js +195 -0
- package/dist/runnerUtility/lidState.js.map +1 -0
- package/dist/runnerUtility/linkLoop.d.ts +5 -0
- package/dist/runnerUtility/linkLoop.d.ts.map +1 -1
- package/dist/runnerUtility/linkLoop.js +37 -1
- package/dist/runnerUtility/linkLoop.js.map +1 -1
- package/dist/runnerUtility/packageManagerShims.d.ts +44 -0
- package/dist/runnerUtility/packageManagerShims.d.ts.map +1 -0
- package/dist/runnerUtility/packageManagerShims.js +130 -0
- package/dist/runnerUtility/packageManagerShims.js.map +1 -0
- package/dist/runnerUtility/progress.d.ts +43 -0
- package/dist/runnerUtility/progress.d.ts.map +1 -0
- package/dist/runnerUtility/progress.js +78 -0
- package/dist/runnerUtility/progress.js.map +1 -0
- package/dist/runnerUtility/pueueDaemon.d.ts +8 -4
- package/dist/runnerUtility/pueueDaemon.d.ts.map +1 -1
- package/dist/runnerUtility/pueueDaemon.js +12 -7
- package/dist/runnerUtility/pueueDaemon.js.map +1 -1
- package/dist/runnerUtility/rootServiceCli.d.ts +23 -3
- package/dist/runnerUtility/rootServiceCli.d.ts.map +1 -1
- package/dist/runnerUtility/rootServiceCli.js +56 -10
- package/dist/runnerUtility/rootServiceCli.js.map +1 -1
- package/dist/runnerUtility/runnerCli.d.ts +1 -0
- package/dist/runnerUtility/runnerCli.d.ts.map +1 -1
- package/dist/runnerUtility/runnerCli.js +14 -7
- package/dist/runnerUtility/runnerCli.js.map +1 -1
- package/dist/runnerUtility/runnerCommands.d.ts +45 -0
- package/dist/runnerUtility/runnerCommands.d.ts.map +1 -1
- package/dist/runnerUtility/runnerCommands.js +188 -21
- package/dist/runnerUtility/runnerCommands.js.map +1 -1
- package/dist/runnerUtility/runnerHome.d.ts +8 -0
- package/dist/runnerUtility/runnerHome.d.ts.map +1 -1
- package/dist/runnerUtility/runnerHome.js +7 -0
- package/dist/runnerUtility/runnerHome.js.map +1 -1
- package/dist/runnerUtility/serviceCommon.d.ts +4 -0
- package/dist/runnerUtility/serviceCommon.d.ts.map +1 -1
- package/dist/runnerUtility/serviceCommon.js +8 -1
- package/dist/runnerUtility/serviceCommon.js.map +1 -1
- package/dist/runnerUtility/serviceManager.d.ts +5 -2
- package/dist/runnerUtility/serviceManager.d.ts.map +1 -1
- package/dist/runnerUtility/serviceManager.js +40 -17
- package/dist/runnerUtility/serviceManager.js.map +1 -1
- package/dist/runnerUtility/serviceUnits.d.ts +11 -0
- package/dist/runnerUtility/serviceUnits.d.ts.map +1 -1
- package/dist/runnerUtility/serviceUnits.js +8 -2
- package/dist/runnerUtility/serviceUnits.js.map +1 -1
- package/dist/runnerUtility/simulatorSilencer.d.ts +55 -0
- package/dist/runnerUtility/simulatorSilencer.d.ts.map +1 -0
- package/dist/runnerUtility/simulatorSilencer.js +203 -0
- package/dist/runnerUtility/simulatorSilencer.js.map +1 -0
- package/dist/runnerUtility/stopSignals.d.ts +10 -0
- package/dist/runnerUtility/stopSignals.d.ts.map +1 -0
- package/dist/runnerUtility/stopSignals.js +27 -0
- package/dist/runnerUtility/stopSignals.js.map +1 -0
- package/dist/runnerUtility/versionPollTiming.d.ts +2 -3
- package/dist/runnerUtility/versionPollTiming.d.ts.map +1 -1
- package/dist/runnerUtility/versionPollTiming.js +4 -18
- package/dist/runnerUtility/versionPollTiming.js.map +1 -1
- package/dist/runners/bootstrapLine.d.ts.map +1 -1
- package/dist/runners/bootstrapLine.js +35 -19
- package/dist/runners/bootstrapLine.js.map +1 -1
- package/dist/runners/gate.d.ts.map +1 -1
- package/dist/runners/gate.js +28 -1
- package/dist/runners/gate.js.map +1 -1
- package/dist/runners/gateLink.d.ts +7 -0
- package/dist/runners/gateLink.d.ts.map +1 -1
- package/dist/runners/gateLink.js +36 -3
- package/dist/runners/gateLink.js.map +1 -1
- package/dist/runners/gateProtocol.d.ts +37 -2
- package/dist/runners/gateProtocol.d.ts.map +1 -1
- package/dist/runners/gateProtocol.js +45 -4
- package/dist/runners/gateProtocol.js.map +1 -1
- package/dist/runners/hubPackage.d.ts +2 -1
- package/dist/runners/hubPackage.d.ts.map +1 -1
- package/dist/runners/hubPackage.js +32 -11
- package/dist/runners/hubPackage.js.map +1 -1
- package/dist/runners/hubPairing.d.ts +1 -1
- package/dist/runners/hubPairing.d.ts.map +1 -1
- package/dist/runners/hubPairing.js +8 -1
- package/dist/runners/hubPairing.js.map +1 -1
- package/dist/runners/hubPaths.d.ts +2 -0
- package/dist/runners/hubPaths.d.ts.map +1 -1
- package/dist/runners/hubPaths.js +1 -1
- package/dist/runners/hubPaths.js.map +1 -1
- package/dist/runners/linkConcern.d.ts +75 -0
- package/dist/runners/linkConcern.d.ts.map +1 -0
- package/dist/runners/linkConcern.js +85 -0
- package/dist/runners/linkConcern.js.map +1 -0
- package/dist/runners/linkControl.d.ts +25 -1
- package/dist/runners/linkControl.d.ts.map +1 -1
- package/dist/runners/linkControl.js +46 -4
- package/dist/runners/linkControl.js.map +1 -1
- package/dist/runners/pairingTiming.d.ts +2 -3
- package/dist/runners/pairingTiming.d.ts.map +1 -1
- package/dist/runners/pairingTiming.js +4 -18
- package/dist/runners/pairingTiming.js.map +1 -1
- package/dist/runners/runnerLock.d.ts +112 -0
- package/dist/runners/runnerLock.d.ts.map +1 -0
- package/dist/runners/runnerLock.js +292 -0
- package/dist/runners/runnerLock.js.map +1 -0
- package/dist/runners/runnersCli.d.ts +6 -3
- package/dist/runners/runnersCli.d.ts.map +1 -1
- package/dist/runners/runnersCli.js +33 -6
- package/dist/runners/runnersCli.js.map +1 -1
- package/dist/runners/runnersList.d.ts +3 -3
- package/dist/runners/runnersList.d.ts.map +1 -1
- package/dist/runners/runnersList.js +9 -2
- package/dist/runners/runnersList.js.map +1 -1
- package/dist/runners/runnersOverview.d.ts +29 -3
- package/dist/runners/runnersOverview.d.ts.map +1 -1
- package/dist/runners/runnersOverview.js +71 -6
- package/dist/runners/runnersOverview.js.map +1 -1
- package/dist/runners/serviceRemoval.d.ts +43 -0
- package/dist/runners/serviceRemoval.d.ts.map +1 -0
- package/dist/runners/serviceRemoval.js +114 -0
- package/dist/runners/serviceRemoval.js.map +1 -0
- package/dist/scheduler/checkStatus.d.ts +78 -0
- package/dist/scheduler/checkStatus.d.ts.map +1 -0
- package/dist/scheduler/checkStatus.js +122 -0
- package/dist/scheduler/checkStatus.js.map +1 -0
- package/dist/scheduler/delivery.d.ts +27 -1
- package/dist/scheduler/delivery.d.ts.map +1 -1
- package/dist/scheduler/delivery.js +83 -6
- package/dist/scheduler/delivery.js.map +1 -1
- package/dist/scheduler/mcpSurface.d.ts +2 -0
- package/dist/scheduler/mcpSurface.d.ts.map +1 -1
- package/dist/scheduler/mcpSurface.js +62 -10
- package/dist/scheduler/mcpSurface.js.map +1 -1
- package/dist/scheduler/store.d.ts +16 -1
- package/dist/scheduler/store.d.ts.map +1 -1
- package/dist/scheduler/store.js +33 -0
- package/dist/scheduler/store.js.map +1 -1
- package/dist/scheduler/types.d.ts +22 -0
- package/dist/scheduler/types.d.ts.map +1 -1
- package/dist/scheduler/unbindPause.d.ts +27 -0
- package/dist/scheduler/unbindPause.d.ts.map +1 -0
- package/dist/scheduler/unbindPause.js +21 -0
- package/dist/scheduler/unbindPause.js.map +1 -0
- package/dist/scheduler/workerActivity.d.ts +25 -0
- package/dist/scheduler/workerActivity.d.ts.map +1 -0
- package/dist/scheduler/workerActivity.js +195 -0
- package/dist/scheduler/workerActivity.js.map +1 -0
- package/dist/scheduler/workerWatch.d.ts +14 -2
- package/dist/scheduler/workerWatch.d.ts.map +1 -1
- package/dist/scheduler/workerWatch.js +15 -3
- package/dist/scheduler/workerWatch.js.map +1 -1
- package/dist/state.d.ts +8 -0
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +30 -0
- package/dist/state.js.map +1 -1
- package/dist/stt/sttRuntime.d.ts.map +1 -1
- package/dist/stt/sttRuntime.js +8 -1
- package/dist/stt/sttRuntime.js.map +1 -1
- package/dist/stt/sttSettings.d.ts +56 -6
- package/dist/stt/sttSettings.d.ts.map +1 -1
- package/dist/stt/sttSettings.js +128 -7
- package/dist/stt/sttSettings.js.map +1 -1
- package/dist/stt/sttSidecarOwner.d.ts +13 -5
- package/dist/stt/sttSidecarOwner.d.ts.map +1 -1
- package/dist/stt/sttSidecarOwner.js +72 -31
- package/dist/stt/sttSidecarOwner.js.map +1 -1
- package/dist/stt/transcribeChain.d.ts +23 -1
- package/dist/stt/transcribeChain.d.ts.map +1 -1
- package/dist/stt/transcribeChain.js +59 -4
- package/dist/stt/transcribeChain.js.map +1 -1
- package/dist/testTimings.d.ts +4 -2
- package/dist/testTimings.d.ts.map +1 -1
- package/dist/testTimings.js +7 -1
- package/dist/testTimings.js.map +1 -1
- package/dist/testTimingsSeam.d.ts +10 -0
- package/dist/testTimingsSeam.d.ts.map +1 -0
- package/dist/testTimingsSeam.js +29 -0
- package/dist/testTimingsSeam.js.map +1 -0
- package/dist/utils/runnersScreenPlan.d.ts +14 -0
- package/dist/utils/runnersScreenPlan.d.ts.map +1 -1
- package/dist/utils/runnersScreenPlan.js +49 -5
- package/dist/utils/runnersScreenPlan.js.map +1 -1
- package/dist/utils/surrogateSafeCut.d.ts +14 -0
- package/dist/utils/surrogateSafeCut.d.ts.map +1 -0
- package/dist/utils/surrogateSafeCut.js +30 -0
- package/dist/utils/surrogateSafeCut.js.map +1 -0
- package/dist/utils/telegramError.d.ts +7 -0
- package/dist/utils/telegramError.d.ts.map +1 -1
- package/dist/utils/telegramError.js +15 -0
- package/dist/utils/telegramError.js.map +1 -1
- package/dist/utils/transientFrames.d.ts +51 -6
- package/dist/utils/transientFrames.d.ts.map +1 -1
- package/dist/utils/transientFrames.js +52 -2
- package/dist/utils/transientFrames.js.map +1 -1
- package/dist/voiceProgressNote.d.ts +73 -0
- package/dist/voiceProgressNote.d.ts.map +1 -0
- package/dist/voiceProgressNote.js +142 -0
- package/dist/voiceProgressNote.js.map +1 -0
- package/package.json +4 -1
- package/remoteRun/pickNode.sh +65 -0
- package/remoteRun/runner-package-lock.json +59 -0
- package/remoteRun/runner.sh +304 -6
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { type ChildProcess } from 'child_process';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { RunnerHomePaths } from './runnerHome';
|
|
4
|
+
/**
|
|
5
|
+
* @description The login session's agent of an always-on Mac. A runner kept running by LaunchDaemons lives in launchd's System session, and
|
|
6
|
+
* Xcode's nested builds crash there (SIGTRAP at «Resolve Package Graph»; the same build is fine in the account's GUI session). The account's own
|
|
7
|
+
* LaunchAgent in `gui/<uid>` runs this program while the account has a login session; a job that needs iOS runs its steps through it.
|
|
8
|
+
*
|
|
9
|
+
* `runner.sh` (job script, System session) writes <state>/gui/requests/<id>/ — cwd, command, locale, log, env, owner, then `go` last
|
|
10
|
+
* this agent (account's GUI session) starts `bash -c <command>` there as the leader of a process group of its own, writes that group's id
|
|
11
|
+
* (`pgid`), its output appended to the job's log, and `exit` when it ends
|
|
12
|
+
* a kill the script touches `kill` the agent ends the step's process group (TERM, KILL after the runner's grace)
|
|
13
|
+
* a lost owner the script is gone (SIGKILLed) the agent ends the step too: nothing runs on for a job nobody waits for
|
|
14
|
+
*
|
|
15
|
+
* The agent beats into `agent.json` every few seconds (`runner.sh` reads it: no beat for {@link guiAgentStaleAfterMs} = no agent = no session, and
|
|
16
|
+
* says so instead of queueing into nothing). A step is NOT taken down with the agent: it is a process group of its own (`detached` is `setsid`), which
|
|
17
|
+
* neither a crash of the agent nor launchd ending the agent's own group reaches — so the group id is in the request folder, and whoever cuts a step ends
|
|
18
|
+
* its group: the script, when it cuts the step with 125 because the heartbeat is gone or another instance answers (TERM, KILL after the grace), and an
|
|
19
|
+
* agent that starts and finds the groups of an earlier instance (`reapStepsOfEarlierInstances`). Without that a dying agent would orphan an `xcodebuild`
|
|
20
|
+
* while the script released the project's lock to the next job. No auto-login: the session is the owner's to open once.
|
|
21
|
+
*
|
|
22
|
+
* A recorded id is NEVER signalled on trust: the folders live on disk and survive a reboot, pids restart after one, and an old number can name an unrelated
|
|
23
|
+
* group of the account (Finder, the Dock, the new agent). A folder older than the system's boot is removed without a signal; otherwise the id is signalled only
|
|
24
|
+
* while the process of that pid still has the start time recorded beside it (`pgid-start`, from `ps -o lstart=`) — or is gone while the group's other members
|
|
25
|
+
* keep the id from being handed out again. The same goes for the job script's pid (`owner`, `owner-start`): a reused pid does not make a dead script look alive.
|
|
26
|
+
*/
|
|
27
|
+
/** How often the agent beats, and how long without a beat is «gone» — `gui_agent_stale_sec` in `remoteRun/runner.sh` is the same number (a test pins both). */
|
|
28
|
+
export declare const guiAgentBeatIntervalMs: number;
|
|
29
|
+
export declare const guiAgentStaleAfterMs: number;
|
|
30
|
+
/** How often an agent asks whether its always-on service is still there. */
|
|
31
|
+
export declare const guiAgentServiceCheckIntervalMs: number;
|
|
32
|
+
declare const statusSchema: z.ZodObject<{
|
|
33
|
+
pid: z.ZodNumber;
|
|
34
|
+
uid: z.ZodNumber;
|
|
35
|
+
account: z.ZodString;
|
|
36
|
+
startedAtMs: z.ZodNumber;
|
|
37
|
+
beatAtMs: z.ZodNumber;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
/** @name GuiAgentStatus @description `gui/agent.json`: one JSON line. */
|
|
40
|
+
export type GuiAgentStatus = z.infer<typeof statusSchema>;
|
|
41
|
+
export declare function readGuiAgentStatus(paths: RunnerHomePaths): GuiAgentStatus | null;
|
|
42
|
+
export declare function writeGuiAgentStatus(paths: RunnerHomePaths, status: GuiAgentStatus): void;
|
|
43
|
+
/** @description Is the agent there: it beat within {@link guiAgentStaleAfterMs} and its process is alive. What `runner.sh` decides the same way. */
|
|
44
|
+
export declare function checkIsGuiAgentAlive(status: GuiAgentStatus | null, nowMs: number, isProcessAlive: (pid: number) => boolean): boolean;
|
|
45
|
+
export declare function checkIsProcessAlive(pid: number): boolean;
|
|
46
|
+
/** `NAME=VALUE` per line, as `runner.sh` exports them (no quote handling: the value is everything after the first `=`); a line that is not a pair is skipped. */
|
|
47
|
+
export declare function parseJobEnvLines(text: string): Record<string, string>;
|
|
48
|
+
/** What `ps -o lstart=` says of a process's start, the way both sides compare it: whitespace squeezed, so «Tue Nov 4 02:10:11 2026» is one string everywhere. */
|
|
49
|
+
export declare function normalizeProcessStart(text: string): string;
|
|
50
|
+
/** What is known of a process's start: the text (`known`), that there is no such process (`none`), or that `ps` could not be asked (`unknown`). */
|
|
51
|
+
export type ProcessStart = {
|
|
52
|
+
kind: 'known';
|
|
53
|
+
text: string;
|
|
54
|
+
} | {
|
|
55
|
+
kind: 'none';
|
|
56
|
+
} | {
|
|
57
|
+
kind: 'unknown';
|
|
58
|
+
};
|
|
59
|
+
/** @description The start time of process `pid` from `ps -o lstart= -p` (C locale: one format on Linux and macOS, and the one `runner.sh` reads). */
|
|
60
|
+
export declare function readProcessStart(pid: number): ProcessStart;
|
|
61
|
+
/** When the system booted, from its uptime: what a folder written before it must not be trusted past (`Date.now() - os.uptime()`). */
|
|
62
|
+
export declare function getBootTimeMs(): number;
|
|
63
|
+
/** Start a step as the LEADER of a process group of its own (its pgid is its pid): the group is what a cut ends. */
|
|
64
|
+
export type StepStarter = (request: {
|
|
65
|
+
directory: string;
|
|
66
|
+
command: string;
|
|
67
|
+
env: NodeJS.ProcessEnv;
|
|
68
|
+
logFd: number;
|
|
69
|
+
}) => ChildProcess;
|
|
70
|
+
export interface GuiAgentDeps {
|
|
71
|
+
now: () => number;
|
|
72
|
+
isProcessAlive: (pid: number) => boolean;
|
|
73
|
+
/** The environment a job gets over the link (`readExecEnv`): the step runs in the same one, plus the job's own `-e` lines. */
|
|
74
|
+
readEnv: () => NodeJS.ProcessEnv;
|
|
75
|
+
startStep: StepStarter;
|
|
76
|
+
/** SIGTERM / SIGKILL to a step's whole process group. */
|
|
77
|
+
signalGroup: (pid: number, signal: NodeJS.Signals) => void;
|
|
78
|
+
/** Is any process left in the group? */
|
|
79
|
+
isGroupAlive: (pgid: number) => boolean;
|
|
80
|
+
/** The start time of a process (`readProcessStart`): what keeps a recorded pid from being trusted once it names someone else. */
|
|
81
|
+
readProcessStart: (pid: number) => ProcessStart;
|
|
82
|
+
/** When the system booted: a request folder from before it is stale, whatever its pids say. */
|
|
83
|
+
getBootTimeMs: () => number;
|
|
84
|
+
/** A problem of one request that must not take the agent down (a full disk, a folder nobody can write): told, and the agent goes on. */
|
|
85
|
+
reportError: (line: string) => void;
|
|
86
|
+
pid: number;
|
|
87
|
+
uid: number;
|
|
88
|
+
account: string;
|
|
89
|
+
killGraceMs: number;
|
|
90
|
+
}
|
|
91
|
+
export declare function createGuiAgentDeps(readEnv: () => NodeJS.ProcessEnv): GuiAgentDeps;
|
|
92
|
+
export interface GuiAgent {
|
|
93
|
+
/** One look: start the requests that are ready, end the steps asked to end (or whose job script is gone), clean up after dead scripts, beat when due. */
|
|
94
|
+
tick: () => void;
|
|
95
|
+
/** Steps that are running now. */
|
|
96
|
+
getRunningCount: () => number;
|
|
97
|
+
/** End every running step and remove the heartbeat: the agent is leaving. */
|
|
98
|
+
stop: () => void;
|
|
99
|
+
getStartedAtMs: () => number;
|
|
100
|
+
}
|
|
101
|
+
/** @description The agent's work, without a loop: {@link GuiAgent.tick} is called every {@link requestPollMs}-ish by `runGuiAgent`, and by a test whenever it wants one look. */
|
|
102
|
+
export declare function createGuiAgent(paths: RunnerHomePaths, deps: GuiAgentDeps): GuiAgent;
|
|
103
|
+
/** How often `runGuiAgent` looks. */
|
|
104
|
+
export declare const guiAgentPollMs = 300;
|
|
105
|
+
export interface GuiAgentRunOptions {
|
|
106
|
+
signal: AbortSignal;
|
|
107
|
+
/**
|
|
108
|
+
* Is the always-on service this agent belongs to gone (an admin removed the daemons)? The agent then leaves for good — the command that runs it also
|
|
109
|
+
* removes its own definition — instead of waiting in the account's session for a link that will not come back. This is how it is removed with the
|
|
110
|
+
* daemons: no command an admin pastes names the account's folders (what the runner reports about itself never goes into a `sudo` line).
|
|
111
|
+
*/
|
|
112
|
+
checkIsServiceRemoved?: () => boolean;
|
|
113
|
+
/** How often that is asked ({@link guiAgentServiceCheckIntervalMs}; a test's own). */
|
|
114
|
+
serviceCheckIntervalMs?: number;
|
|
115
|
+
/** The id of the package copy that runs (the folder `current` points at): another one means an update, and an idle agent restarts onto it by leaving. */
|
|
116
|
+
getAppId: () => string | null;
|
|
117
|
+
/** Called every poll too: the silencer of the Simulator's audio. */
|
|
118
|
+
onTick?: () => void;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* @description Run the agent until `signal` aborts; `'restart'` when an update replaced the package and no step runs (the service manager starts it again, now on
|
|
122
|
+
* the new code); `'removed'` when its always-on service is gone.
|
|
123
|
+
*/
|
|
124
|
+
export declare function runGuiAgent(paths: RunnerHomePaths, deps: GuiAgentDeps, options: GuiAgentRunOptions): Promise<'stopped' | 'restart' | 'removed'>;
|
|
125
|
+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