charness 3.9.0 → 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 +132 -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/jira/inbound.d.ts +25 -1
- package/dist/connectors/jira/inbound.d.ts.map +1 -1
- package/dist/connectors/jira/inbound.js +74 -2
- package/dist/connectors/jira/inbound.js.map +1 -1
- package/dist/connectors/jira/issueContext.d.ts +11 -2
- package/dist/connectors/jira/issueContext.d.ts.map +1 -1
- package/dist/connectors/jira/issueContext.js +22 -2
- package/dist/connectors/jira/issueContext.js.map +1 -1
- package/dist/connectors/jira/prompt.d.ts +12 -2
- package/dist/connectors/jira/prompt.d.ts.map +1 -1
- package/dist/connectors/jira/prompt.js +59 -5
- package/dist/connectors/jira/prompt.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/requests/requestHeader.d.ts +2 -1
- package/dist/requests/requestHeader.d.ts.map +1 -1
- package/dist/requests/requestHeader.js +6 -2
- package/dist/requests/requestHeader.js.map +1 -1
- package/dist/requests/storedPromptRefresh.d.ts +16 -0
- package/dist/requests/storedPromptRefresh.d.ts.map +1 -0
- package/dist/requests/storedPromptRefresh.js +36 -0
- package/dist/requests/storedPromptRefresh.js.map +1 -0
- 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
package/remoteRun/runner.sh
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
# <state>/paused exists → paused=yes (written by `charness-runner pause`; the main box never sends a job to a paused runner)
|
|
11
11
|
# <state>/service one word: user-service | system-service (no file = run by hand: service=foreground)
|
|
12
12
|
# <state>/ios-check.json the runner's iOS Simulator boot check (one JSON line): "status": "pass"|"fail"|"skipped" and "reason": "…"|null
|
|
13
|
+
# <state>/gui/ the login session's agent of an always-on Mac (service=system-service): agent.json is its heartbeat, requests/<id>/ the steps
|
|
14
|
+
# it runs for a job that needs iOS (`needs-ios` in the job folder) — see «the login session» below
|
|
13
15
|
# <state> counts only when it holds config.json and keys/ (a work dir that merely is called «work» is not one).
|
|
14
16
|
#
|
|
15
17
|
# bash 3.2-compatible on purpose (the stock bash of macOS): no associative arrays, no `wait -n`, no `mapfile`, no
|
|
@@ -34,6 +36,7 @@
|
|
|
34
36
|
# prune remove old jobs, stale stage dirs and unused project copies
|
|
35
37
|
# sync-tree the apply step alone (tests)
|
|
36
38
|
|
|
39
|
+
# The script's own tools (sort, sed, grep) run in the C locale: byte-wise and the same everywhere. The user's commands do NOT — see job_locale.
|
|
37
40
|
LC_ALL=C
|
|
38
41
|
export LC_ALL
|
|
39
42
|
set -u
|
|
@@ -41,6 +44,8 @@ set -u
|
|
|
41
44
|
# ─────────────────────────── constants ───────────────────────────
|
|
42
45
|
|
|
43
46
|
kill_grace_sec=10
|
|
47
|
+
# After a SIGKILL of a step's group the script looks this many times (0.2 s apart) for a member that is still there before it goes on.
|
|
48
|
+
kill_settle_polls=10
|
|
44
49
|
pueue_start_wait_sec=8
|
|
45
50
|
default_timeout_sec=10800
|
|
46
51
|
job_keep_days=3
|
|
@@ -53,9 +58,29 @@ task_id_wait_sec=5
|
|
|
53
58
|
heartbeat_poll_sec=1
|
|
54
59
|
# How long a job waiting for its project's lock sleeps between two attempts (a test shortens it to race many waiters quickly).
|
|
55
60
|
lock_poll_sec=1
|
|
61
|
+
# A failed dependencies step names this many of its first error lines (and of its build log's) — few enough that `wait`'s last 50 lines hold them all.
|
|
62
|
+
failed_step_error_lines=8
|
|
63
|
+
# The login session's agent (`charness-runner gui-agent`) beats every 5 s; one that has not for this long is gone (or the session is).
|
|
64
|
+
gui_agent_stale_sec=20
|
|
65
|
+
# What makes a line of a tool's output an error line.
|
|
66
|
+
error_line_pattern='error|fatal|fail|exception|cannot|couldn|not found|no such|denied'
|
|
56
67
|
|
|
57
68
|
# ─────────────────────────── helpers ───────────────────────────
|
|
58
69
|
|
|
70
|
+
# The locale a job's commands run in: a UTF-8 one, never `C`. Tools that read the locale refuse or crash on `C` (CocoaPods: «Unicode Normalization
|
|
71
|
+
# not appropriate for ASCII-8BIT»), and a job that wants another one says so with -e LC_ALL=… (the job's variables are applied after this). The first
|
|
72
|
+
# of C.UTF-8 (Linux) and en_US.UTF-8 (macOS) that this machine has — judged by the charmap it gives — else C: a machine with neither is no worse.
|
|
73
|
+
pick_job_locale() {
|
|
74
|
+
local candidate
|
|
75
|
+
for candidate in C.UTF-8 en_US.UTF-8 en_US.utf8; do
|
|
76
|
+
case $(LC_ALL=$candidate locale charmap 2> /dev/null) in
|
|
77
|
+
[Uu][Tt][Ff]-8 | [Uu][Tt][Ff]8) printf '%s\n' "$candidate"; return 0 ;;
|
|
78
|
+
esac
|
|
79
|
+
done
|
|
80
|
+
printf 'C\n'
|
|
81
|
+
}
|
|
82
|
+
job_locale=$(pick_job_locale)
|
|
83
|
+
|
|
59
84
|
die() {
|
|
60
85
|
printf 'remote-run-runner: %s\n' "$*" >&2
|
|
61
86
|
exit 125
|
|
@@ -138,6 +163,176 @@ keep_awake_while() {
|
|
|
138
163
|
caffeinate -i -w "$1" > /dev/null 2>&1 < /dev/null &
|
|
139
164
|
}
|
|
140
165
|
|
|
166
|
+
# ─────────────────────────── the login session (always-on Mac) ───────────────────────────
|
|
167
|
+
|
|
168
|
+
# A Mac runner kept running by LaunchDaemons has no login session of its own, and Xcode's nested builds crash in the System session the daemons
|
|
169
|
+
# run in. The runner account's LaunchAgent (`charness-runner gui-agent`, runnerUtility/guiAgent.ts) runs in the account's GUI session while there
|
|
170
|
+
# is one; EVERY job's steps run THERE while it does (`gui_step_uses_agent`), through request folders under <state>/gui/requests/. A job that needs iOS
|
|
171
|
+
# (`needs-ios` in its folder, written for `--needs ios`) is refused with the reason when there is none, and `probe` says the same of `ios`; any other job
|
|
172
|
+
# then runs in the daemon as before. No auto-login, no guess.
|
|
173
|
+
|
|
174
|
+
# Does this runner's work go through a login session's agent: a paired runner that is kept running by an always-on service?
|
|
175
|
+
gui_session_expected() {
|
|
176
|
+
read_runner_state
|
|
177
|
+
[ -n "$runner_state" ] && [ "$(head -n 1 "$runner_state/service" 2> /dev/null)" = system-service ]
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
# A whole-number field of the agent's heartbeat file (one JSON line).
|
|
181
|
+
gui_agent_field() {
|
|
182
|
+
sed -n "s/.*\"$1\"[[:space:]]*:[[:space:]]*\([0-9][0-9]*\).*/\1/p" "$runner_state/gui/agent.json" 2> /dev/null | head -n 1
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
# Is the agent there: its process alive and its heartbeat fresh?
|
|
186
|
+
gui_agent_alive() {
|
|
187
|
+
local pid beat now
|
|
188
|
+
pid=$(gui_agent_field pid)
|
|
189
|
+
beat=$(gui_agent_field beatAtMs)
|
|
190
|
+
[ -n "$pid" ] && [ -n "$beat" ] || return 1
|
|
191
|
+
kill -0 "$pid" 2> /dev/null || return 1
|
|
192
|
+
now=$(($(date +%s) * 1000))
|
|
193
|
+
[ $((now - beat)) -le $((gui_agent_stale_sec * 1000)) ]
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
# What a job that needs iOS is told when there is no login session to run it in (also what `probe` says of `ios`). A link that tried to put the agent in place
|
|
197
|
+
# itself (runnerUtility/guiAgentHeal.ts) and could not leaves `<cure> <reason>` in <state>/gui/install-failure: `login` — the definition is in place, so the account
|
|
198
|
+
# logging out and in loads it — or `admin` — it is not, and only a fresh admin line writes and loads it. A record without a cure word reads as `admin`.
|
|
199
|
+
gui_refusal_text() {
|
|
200
|
+
local line cure reason
|
|
201
|
+
line=$(head -n 1 "${runner_state:-}/gui/install-failure" 2> /dev/null | tr -d '[:cntrl:]')
|
|
202
|
+
cure=${line%% *}
|
|
203
|
+
case $line in
|
|
204
|
+
*' '*) reason=${line#* } ;;
|
|
205
|
+
*) reason= ;;
|
|
206
|
+
esac
|
|
207
|
+
case $cure in
|
|
208
|
+
login) printf "ios build: the login session's agent could not be loaded (%s) - log out and back in as %s, or paste a fresh admin line from /runners in an admin account's terminal" "$reason" "$(id -un)" ;;
|
|
209
|
+
admin) printf "ios build: the login session's agent could not be installed (%s) - paste a fresh admin line from /runners in an admin account's terminal" "$reason" ;;
|
|
210
|
+
'') printf 'ios build: needs a login of %s' "$(id -un)" ;;
|
|
211
|
+
*) printf "ios build: the login session's agent could not be installed (%s) - paste a fresh admin line from /runners in an admin account's terminal" "$line" ;;
|
|
212
|
+
esac
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
# Does THIS job need the login session — it needs iOS (`needs-ios`), and the runner is an always-on service? Such a job is refused without one.
|
|
216
|
+
gui_job_needs_session() {
|
|
217
|
+
[ -n "${jd:-}" ] && [ -f "$jd/needs-ios" ] && gui_session_expected
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
# Does THIS step go through the agent? On an always-on Mac EVERY job's steps do, while the login session exists (an iOS build is not always marked, and
|
|
221
|
+
# the session is what the account's own jobs would see); a job that needs iOS does even when it cannot (its step is cut, never run in the System session);
|
|
222
|
+
# any other job, with no session, runs in the daemon as it always did.
|
|
223
|
+
gui_step_uses_agent() {
|
|
224
|
+
[ -n "${jd:-}" ] && gui_session_expected && { [ -f "$jd/needs-ios" ] || gui_agent_alive; }
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
# Refuse a job that needs iOS before it is queued when there is no session to run it in.
|
|
228
|
+
refuse_without_gui_session() {
|
|
229
|
+
gui_job_needs_session || return 0
|
|
230
|
+
gui_agent_alive || die "$(gui_refusal_text)"
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
# The start time of process $1 as `ps` says it, whitespace squeezed — the way runnerUtility/guiAgent.ts records and compares it (the C locale is this script's own).
|
|
234
|
+
gui_process_start() {
|
|
235
|
+
ps -o lstart= -p "$1" 2> /dev/null | tr -s ' \t' ' ' | sed 's/^ //; s/ $//'
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
# Is process group $1 the group of the step whose leader started at $2 (`pgid-start` of the request folder)? The folders live on disk and a pid is handed out again
|
|
239
|
+
# — after a reboot, after a wrap — to something unrelated of the account (the Dock, the agent itself). So a recorded id is signalled only while the process with
|
|
240
|
+
# that pid still has the recorded start; or while no process has it and the group still has members (a pid is not handed out while a group carries it).
|
|
241
|
+
# No recorded start, or no `ps` to ask: not a group to signal.
|
|
242
|
+
gui_group_is_recorded() {
|
|
243
|
+
local current
|
|
244
|
+
[ -n "$2" ] && command -v ps > /dev/null 2>&1 || return 1
|
|
245
|
+
current=$(gui_process_start "$1")
|
|
246
|
+
if [ -n "$current" ]; then
|
|
247
|
+
[ "$current" = "$2" ]
|
|
248
|
+
return
|
|
249
|
+
fi
|
|
250
|
+
kill -0 -- "-$1" 2> /dev/null
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
# End the process group of a step the agent started (its id is in the request folder's `pgid`, its leader's start beside it): TERM, and KILL after the grace if
|
|
254
|
+
# anything is left. A step is a process group of its own (`setsid`), so an agent that died did not take it down — and the job's lock is released next, to a job
|
|
255
|
+
# that would run in the same tree beside an `xcodebuild` still writing into it.
|
|
256
|
+
gui_end_step_group() {
|
|
257
|
+
local pgid recorded waited=0
|
|
258
|
+
pgid=$(cat "$1/pgid" 2> /dev/null)
|
|
259
|
+
# `cat`'s own stderr goes to /dev/null: a redirect of `tr`'s input from a file that is not there fails in the shell, before any `2>` of the command applies.
|
|
260
|
+
recorded=$(cat "$1/pgid-start" 2> /dev/null | tr -s ' \t' ' ' | sed 's/^ //; s/ $//')
|
|
261
|
+
case $pgid in '' | *[!0-9]*) return 0 ;; esac
|
|
262
|
+
[ "$pgid" -gt 1 ] || return 0
|
|
263
|
+
gui_group_is_recorded "$pgid" "$recorded" || return 0
|
|
264
|
+
kill -TERM -- "-$pgid" 2> /dev/null || return 0
|
|
265
|
+
while kill -0 -- "-$pgid" 2> /dev/null && [ "$waited" -lt $((kill_grace_sec * 5)) ]; do
|
|
266
|
+
nap 0.2
|
|
267
|
+
waited=$((waited + 1))
|
|
268
|
+
done
|
|
269
|
+
if gui_group_is_recorded "$pgid" "$recorded" && kill -KILL -- "-$pgid" 2> /dev/null; then
|
|
270
|
+
# SIGKILL lands when each process is next scheduled: on a busy machine the group is still there when `kill` returns. The script goes on to release the job's lock, so it
|
|
271
|
+
# waits (bounded) until no member is left — never beside one that is still dying.
|
|
272
|
+
waited=0
|
|
273
|
+
while kill -0 -- "-$pgid" 2> /dev/null && [ "$waited" -lt "$kill_settle_polls" ]; do
|
|
274
|
+
nap 0.2
|
|
275
|
+
waited=$((waited + 1))
|
|
276
|
+
done
|
|
277
|
+
# Past the bound the script cannot wait for ever, but it does not go on silently either: the job's output says a member of the group outlived SIGKILL.
|
|
278
|
+
if kill -0 -- "-$pgid" 2> /dev/null; then
|
|
279
|
+
say "the step's process group ($pgid) is still alive after SIGKILL: the job goes on, and its lock is released, beside it"
|
|
280
|
+
fi
|
|
281
|
+
fi
|
|
282
|
+
return 0
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
# One step of a job, run by the agent in the login session: a request folder it picks up (`go` last), the step's output appended to the job's log by the agent
|
|
286
|
+
# itself, the exit code in `exit`. A kill is a `kill` file; the agent kills a step whose job script (`owner`, its start in `owner-start`) is gone.
|
|
287
|
+
# A job that needs iOS with no agent beating is refused here — no request is written for an agent that may appear a moment later and start a step nobody
|
|
288
|
+
# waits for. The step is cut with 125 when the agent stops, or is another instance than the one asked — and its process group is ended HERE, before the folder
|
|
289
|
+
# goes and the job's lock with it, on that path and on the one where a restarted agent answered 125 itself (`cut`); see gui_end_step_group.
|
|
290
|
+
gui_run_step() {
|
|
291
|
+
local directory=$1
|
|
292
|
+
local command_text=$2
|
|
293
|
+
if [ -f "$jd/needs-ios" ] && ! gui_agent_alive; then
|
|
294
|
+
say "$(gui_refusal_text)"
|
|
295
|
+
step_code=125
|
|
296
|
+
return 0
|
|
297
|
+
fi
|
|
298
|
+
gui_step_count=$((${gui_step_count:-0} + 1))
|
|
299
|
+
local request="$runner_state/gui/requests/$job.$gui_step_count"
|
|
300
|
+
local started_at
|
|
301
|
+
started_at=$(gui_agent_field startedAtMs)
|
|
302
|
+
rm -rf "$request"
|
|
303
|
+
if ! mkdir -p "$request" 2> /dev/null; then
|
|
304
|
+
say "the login session's agent folder cannot be written ($request)"
|
|
305
|
+
step_code=125
|
|
306
|
+
return 0
|
|
307
|
+
fi
|
|
308
|
+
printf '%s' "$directory" > "$request/cwd"
|
|
309
|
+
printf '%s' "$command_text" > "$request/command"
|
|
310
|
+
printf '%s' "$job_locale" > "$request/locale"
|
|
311
|
+
printf '%s' "$jd/log" > "$request/log"
|
|
312
|
+
printf '%s' "$$" > "$request/owner"
|
|
313
|
+
gui_process_start "$$" > "$request/owner-start"
|
|
314
|
+
if [ -s "$jd/env" ]; then cp "$jd/env" "$request/env"; else : > "$request/env"; fi
|
|
315
|
+
: > "$request/go"
|
|
316
|
+
local looks=0
|
|
317
|
+
while [ ! -f "$request/exit" ]; do
|
|
318
|
+
[ "$killed" -eq 1 ] && [ ! -f "$request/kill" ] && : > "$request/kill"
|
|
319
|
+
looks=$((looks + 1))
|
|
320
|
+
if [ $((looks % 5)) -eq 0 ] && { ! gui_agent_alive || [ "$(gui_agent_field startedAtMs)" != "$started_at" ]; }; then
|
|
321
|
+
say "the login session's agent stopped while this step ran: the step was cut"
|
|
322
|
+
gui_end_step_group "$request"
|
|
323
|
+
step_code=125
|
|
324
|
+
rm -rf "$request"
|
|
325
|
+
return 0
|
|
326
|
+
fi
|
|
327
|
+
nap 0.2
|
|
328
|
+
done
|
|
329
|
+
step_code=$(cat "$request/exit")
|
|
330
|
+
case $step_code in '' | *[!0-9]*) step_code=125 ;; esac
|
|
331
|
+
# A restarted agent cut the step (and told us so): its group got a TERM and gets its KILL after the grace — the job must not go on before it is gone.
|
|
332
|
+
[ -f "$request/cut" ] && gui_end_step_group "$request"
|
|
333
|
+
rm -rf "$request"
|
|
334
|
+
}
|
|
335
|
+
|
|
141
336
|
# ─────────────────────────── probe ───────────────────────────
|
|
142
337
|
|
|
143
338
|
kb_to_mb() {
|
|
@@ -291,6 +486,18 @@ probe_step_output() {
|
|
|
291
486
|
read_file "$probe_dir/$1.out"
|
|
292
487
|
}
|
|
293
488
|
|
|
489
|
+
# What a tool answered to `--version` (its first line, cut short): `none` when it is not on this PATH — a job that calls it ends with exit 127 —
|
|
490
|
+
# and `unknown` when it is there but did not answer in time.
|
|
491
|
+
probe_tool_version() {
|
|
492
|
+
local name=$1
|
|
493
|
+
command -v "$name" > /dev/null 2>&1 || { echo none; return 0; }
|
|
494
|
+
if [ "$(probe_step_status "$name")" = 0 ]; then
|
|
495
|
+
probe_step_output "$name" | head -n 1 | cut -c1-40
|
|
496
|
+
else
|
|
497
|
+
echo unknown
|
|
498
|
+
fi
|
|
499
|
+
}
|
|
500
|
+
|
|
294
501
|
probe_slow() {
|
|
295
502
|
mkdir -p "$work/tmp"
|
|
296
503
|
probe_dir="$work/tmp/probe.$$.$RANDOM"
|
|
@@ -306,9 +513,15 @@ probe_slow() {
|
|
|
306
513
|
start_probe_step simctl "$probe_step_sec" xcrun simctl list devices available
|
|
307
514
|
fi
|
|
308
515
|
[ "$has_docker" -eq 1 ] && start_probe_step docker "$probe_step_sec" docker info
|
|
516
|
+
# The tools of a job as THIS call sees them: the PATH a job runs with is the one of the ssh command that queued it, and so is the probe's.
|
|
517
|
+
# `yarn` may be Corepack's shim, which would fetch a yarn on its first run — never ask it to wait for an answer from the user.
|
|
518
|
+
command -v node > /dev/null 2>&1 && start_probe_step node "$probe_step_sec" node --version
|
|
519
|
+
command -v yarn > /dev/null 2>&1 && start_probe_step yarn "$probe_step_sec" env COREPACK_ENABLE_DOWNLOAD_PROMPT=0 yarn --version
|
|
309
520
|
wait
|
|
310
521
|
|
|
311
522
|
echo "disk_free_mb=$(kb_to_mb "$(probe_step_output disk | awk 'NR == 2 { print $4 }')")"
|
|
523
|
+
echo "job_node=$(probe_tool_version node)"
|
|
524
|
+
echo "job_yarn=$(probe_tool_version yarn)"
|
|
312
525
|
if [ "$(probe_step_status pueue)" = 0 ]; then
|
|
313
526
|
echo "pueue=$(probe_step_output pueue | awk '{ print $NF }')"
|
|
314
527
|
else
|
|
@@ -320,7 +533,11 @@ probe_slow() {
|
|
|
320
533
|
elif [ "$(probe_step_status xcode)" = 0 ]; then
|
|
321
534
|
local xcode_version
|
|
322
535
|
xcode_version=$(probe_step_output xcode | head -n 1 | sed 's/^Xcode //')
|
|
323
|
-
if
|
|
536
|
+
if gui_session_expected && ! gui_agent_alive; then
|
|
537
|
+
# An always-on Mac runs its iOS work in the account's login session: with none, builds crash (Xcode's nested builds) and the Simulator will not boot.
|
|
538
|
+
echo "cap_ios=no"
|
|
539
|
+
echo "cap_ios_detail=$(gui_refusal_text)"
|
|
540
|
+
elif [ "${ios_boot_status:-}" = failed ]; then
|
|
324
541
|
# Xcode is there, but the runner's own check failed. The Simulator refusing to boot is Apple's rule (none is available outside a login
|
|
325
542
|
# session); any other reason (no runtime installed, the device could not be created) is shown as it is — the login session would be a
|
|
326
543
|
# wrong cure. «the Simulator did not» is `iosBootFailureReasonPrefix` in runnerUtility/iosCheck.ts.
|
|
@@ -387,7 +604,35 @@ read_runner_state() {
|
|
|
387
604
|
ios_boot_detail=$(sed -n 's/.*"reason"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$check" | head -n 1)
|
|
388
605
|
}
|
|
389
606
|
|
|
390
|
-
#
|
|
607
|
+
# awake= (caffeinate | systemd-inhibit | no) and awake_detail= of a paired runner: how its link keeps the machine awake, from `<state>/awake` (one line,
|
|
608
|
+
# `<method> <holder pid>` or `none <reason>`; runnerUtility/keepAwake.ts). A holder that is gone is `no`, whatever the file says; no file (a link of an older
|
|
609
|
+
# version, or none ever started) says nothing.
|
|
610
|
+
probe_awake() {
|
|
611
|
+
local awake_file="$runner_state/awake" method detail
|
|
612
|
+
[ -f "$awake_file" ] || return 0
|
|
613
|
+
read -r method detail < "$awake_file"
|
|
614
|
+
case $method in
|
|
615
|
+
caffeinate | systemd-inhibit)
|
|
616
|
+
case $detail in
|
|
617
|
+
'' | *[!0-9]*) echo "awake=no"; echo "awake_detail=the state of the sleep assertion is unreadable" ;;
|
|
618
|
+
*)
|
|
619
|
+
if kill -0 "$detail" 2> /dev/null; then
|
|
620
|
+
echo "awake=$method"
|
|
621
|
+
else
|
|
622
|
+
echo "awake=no"
|
|
623
|
+
echo "awake_detail=the $method process of the link is gone"
|
|
624
|
+
fi
|
|
625
|
+
;;
|
|
626
|
+
esac
|
|
627
|
+
;;
|
|
628
|
+
none)
|
|
629
|
+
echo "awake=no"
|
|
630
|
+
echo "awake_detail=$detail"
|
|
631
|
+
;;
|
|
632
|
+
esac
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
# paused= / service= / runner_version= / ios_boot= / awake= of a paired runner (nothing for a hand-made one).
|
|
391
636
|
probe_runner_state() {
|
|
392
637
|
[ -n "$runner_state" ] || return 0
|
|
393
638
|
if [ -f "$runner_state/paused" ]; then echo "paused=yes"; else echo "paused=no"; fi
|
|
@@ -401,6 +646,7 @@ probe_runner_state() {
|
|
|
401
646
|
echo "runner_version=$(sed -n 's/^[[:space:]]*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$runner_state/current/package.json" 2> /dev/null | head -n 1)"
|
|
402
647
|
[ -n "$ios_boot_status" ] && echo "ios_boot=$ios_boot_status"
|
|
403
648
|
[ -n "$ios_boot_detail" ] && echo "ios_boot_detail=$ios_boot_detail"
|
|
649
|
+
probe_awake
|
|
404
650
|
return 0
|
|
405
651
|
}
|
|
406
652
|
|
|
@@ -543,6 +789,7 @@ add_job() {
|
|
|
543
789
|
|
|
544
790
|
cmd_submit() {
|
|
545
791
|
set_paths "$1" "$2" "$3"
|
|
792
|
+
refuse_without_gui_session
|
|
546
793
|
add_job "${4:-default}" || die "pueue add failed (does the group \"${4:-default}\" exist on this runner?)"
|
|
547
794
|
echo queued
|
|
548
795
|
}
|
|
@@ -597,7 +844,13 @@ kill_job() {
|
|
|
597
844
|
# SIGKILL of the whole group; Pueue's own kill follows only so that its task list agrees. Without a verifiable group, Pueue's kill
|
|
598
845
|
# is all there is. A job that is SIGKILLed cannot write its own result, so the result is recorded FIRST: when the caller is the job's own
|
|
599
846
|
# watchdog the group-wide SIGKILL takes the watchdog down with the job.
|
|
847
|
+
#
|
|
848
|
+
# TERM and HUP are ignored from here on: the record is what the lease's main flow (and a `kill` call) waits for, and the main flow ends the lease's
|
|
849
|
+
# watcher — this very process, when the watcher's kill is the one that got here first — the moment the record appears. A kill that still had its forks to do
|
|
850
|
+
# (`ps` and `tr` in `signal_job_group`: a second or more on a loaded machine) died between the record and its SIGKILL, and a command that ignores SIGTERM lived
|
|
851
|
+
# on in a job that was already "ended", with nobody left to stop it. HUP too: a caller's ssh session that closes must not take a kill half-way either.
|
|
600
852
|
hard_kill_job() {
|
|
853
|
+
trap '' TERM HUP
|
|
601
854
|
finish_killed_job
|
|
602
855
|
signal_job_group KILL || pq kill "$1" > /dev/null 2>&1
|
|
603
856
|
pq kill "$1" > /dev/null 2>&1
|
|
@@ -643,7 +896,7 @@ cmd_kill() {
|
|
|
643
896
|
# Print what the log gained since $log_offset, and move the offset.
|
|
644
897
|
drain_log() {
|
|
645
898
|
local size
|
|
646
|
-
size=$(wc -c < "$jd/log"
|
|
899
|
+
size=$(wc -c 2> /dev/null < "$jd/log" | tr -d ' ')
|
|
647
900
|
[ -n "$size" ] || return 0
|
|
648
901
|
if [ "$size" -gt "$log_offset" ]; then
|
|
649
902
|
tail -c +"$((log_offset + 1))" "$jd/log" | head -c "$((size - log_offset))"
|
|
@@ -704,7 +957,7 @@ follow_until_done() {
|
|
|
704
957
|
# Where `follow` starts in the log: the beginning, the end, or the last N lines.
|
|
705
958
|
resolve_follow_offset() {
|
|
706
959
|
local size
|
|
707
|
-
size=$(wc -c < "$jd/log"
|
|
960
|
+
size=$(wc -c 2> /dev/null < "$jd/log" | tr -d ' ')
|
|
708
961
|
size=${size:-0}
|
|
709
962
|
case ${1:-start} in
|
|
710
963
|
end) echo "$size" ;;
|
|
@@ -824,8 +1077,11 @@ watch_lease() {
|
|
|
824
1077
|
|
|
825
1078
|
# The time of the latest heartbeat, replaced atomically: a plain `> beat` truncates the file first, and a watcher that read it in
|
|
826
1079
|
# that instant got an empty string, whose arithmetic is a syntax error that ended the watcher without a verdict.
|
|
1080
|
+
# SILENT: the watcher's end removes the directory while the reader may be between its `date` and its `mv`, and that `mv: cannot stat …` came out on the
|
|
1081
|
+
# caller's stderr AFTER the exit marker of `exec` — the marker must be the last thing there (a flake of the exec test under load). A beat that cannot be
|
|
1082
|
+
# written for a directory that is gone is nothing to say.
|
|
827
1083
|
write_lease_beat() {
|
|
828
|
-
date +%s > "$lease_state_dir/beat.new" && mv -f "$lease_state_dir/beat.new" "$lease_state_dir/beat"
|
|
1084
|
+
{ date +%s > "$lease_state_dir/beat.new" && mv -f "$lease_state_dir/beat.new" "$lease_state_dir/beat"; } 2> /dev/null
|
|
829
1085
|
}
|
|
830
1086
|
|
|
831
1087
|
end_lease_watch() {
|
|
@@ -842,6 +1098,7 @@ cmd_lease() {
|
|
|
842
1098
|
local group=$4
|
|
843
1099
|
local lease_sec
|
|
844
1100
|
lease_sec=$(ms_to_sec "$5")
|
|
1101
|
+
refuse_without_gui_session
|
|
845
1102
|
# A background job gets /dev/null as stdin unless job control is on: keep the caller's stream on fd 3 for the watcher.
|
|
846
1103
|
exec 3<&0
|
|
847
1104
|
add_job "$group" || die "pueue add failed (does the group \"$group\" exist on this runner?)"
|
|
@@ -1022,13 +1279,45 @@ cmd_sync_tree() {
|
|
|
1022
1279
|
sync_tree || die "apply failed"
|
|
1023
1280
|
}
|
|
1024
1281
|
|
|
1282
|
+
# The first lines of what is on stdin that look like an error, each cut short and none twice (this script's own lines excluded). The ROOT cause
|
|
1283
|
+
# comes first: what a tool prints last is its summary of the failure («couldn't be built successfully», «exit code 1»), and the last lines are
|
|
1284
|
+
# all `wait` shows.
|
|
1285
|
+
first_error_lines() {
|
|
1286
|
+
grep -a -v '^remote-run: ' | grep -a -i -E "$error_line_pattern" | tr -d '\033\r' | cut -c1-240 | awk '!seen[$0]++' | head -n "$failed_step_error_lines"
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
# The dependencies step failed: say why in the job's log, from the step's own output (everything of the log after byte offset $1) — its first
|
|
1290
|
+
# error lines, and the first error lines of the build log the tool names (yarn: «logs can be found here: …/build.log»; yarn removes it with its
|
|
1291
|
+
# temp folder when it exits, then the way to get the build output into the log is said instead).
|
|
1292
|
+
describe_failed_step() {
|
|
1293
|
+
local first_errors build_log
|
|
1294
|
+
first_errors=$(tail -c +"$(($1 + 1))" "$jd/log" 2> /dev/null | first_error_lines)
|
|
1295
|
+
[ -n "$first_errors" ] || return 0
|
|
1296
|
+
say "the first errors of the dependencies step (all of its output is in the log):"
|
|
1297
|
+
printf '%s\n' "$first_errors" | sed 's/^/remote-run: /'
|
|
1298
|
+
for build_log in $(tail -c +"$(($1 + 1))" "$jd/log" 2> /dev/null | grep -a -o -E 'logs can be found here: [^[:space:])]+/build\.log' | sed 's/.*here: //' | awk '!seen[$0]++' | head -n 2); do
|
|
1299
|
+
if [ -f "$build_log" ]; then
|
|
1300
|
+
say "the build log the tool names, $build_log — its first errors:"
|
|
1301
|
+
first_error_lines < "$build_log" | sed 's/^/remote-run: /'
|
|
1302
|
+
else
|
|
1303
|
+
say "the build log the tool names, $build_log, is gone (the tool removes it when it exits): run the step again with -e YARN_ENABLE_INLINE_BUILDS=1 to get the build output into the log"
|
|
1304
|
+
fi
|
|
1305
|
+
done
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1025
1308
|
# bash -c <command> in <directory>, with the job's -e variables, output into the log; sets step_code. Runs as a child so a
|
|
1026
1309
|
# SIGTERM to the job (the `killed` flag) does not abandon it half-way.
|
|
1027
1310
|
run_step() {
|
|
1028
1311
|
local directory=$1
|
|
1029
1312
|
local command_text=$2
|
|
1313
|
+
if gui_step_uses_agent; then
|
|
1314
|
+
gui_run_step "$directory" "$command_text"
|
|
1315
|
+
return 0
|
|
1316
|
+
fi
|
|
1030
1317
|
(
|
|
1031
1318
|
cd "$directory" || exit 126
|
|
1319
|
+
LC_ALL=$job_locale
|
|
1320
|
+
export LC_ALL
|
|
1032
1321
|
if [ -s "$jd/env" ]; then
|
|
1033
1322
|
while IFS= read -r env_line; do export "$env_line"; done < "$jd/env"
|
|
1034
1323
|
fi
|
|
@@ -1180,6 +1469,12 @@ cmd_job() {
|
|
|
1180
1469
|
fi
|
|
1181
1470
|
start_watchdog "$limit_sec"
|
|
1182
1471
|
|
|
1472
|
+
# The session may have ended while the job waited in the queue.
|
|
1473
|
+
if gui_job_needs_session && ! gui_agent_alive; then
|
|
1474
|
+
say "$(gui_refusal_text)"
|
|
1475
|
+
finish_job 125
|
|
1476
|
+
fi
|
|
1477
|
+
|
|
1183
1478
|
set_phase waiting-lock
|
|
1184
1479
|
acquire_lock || finish_job 137
|
|
1185
1480
|
|
|
@@ -1197,11 +1492,14 @@ cmd_job() {
|
|
|
1197
1492
|
if [ -n "$install_command" ] && [ "$(read_file "$proj/deps.hash")" != "$install_key" ]; then
|
|
1198
1493
|
set_phase deps
|
|
1199
1494
|
say "installing dependencies: $install_command"
|
|
1495
|
+
local step_log_offset
|
|
1496
|
+
step_log_offset=$(wc -c < "$jd/log" | tr -d ' ')
|
|
1200
1497
|
run_step "$tree" "$install_command"
|
|
1201
1498
|
if [ "$step_code" -ne 0 ]; then
|
|
1202
1499
|
rm -f "$proj/deps.hash"
|
|
1203
1500
|
echo deps > "$jd/failed-step"
|
|
1204
1501
|
say "the dependencies step failed with exit code $step_code"
|
|
1502
|
+
describe_failed_step "$step_log_offset"
|
|
1205
1503
|
finish_job 125
|
|
1206
1504
|
fi
|
|
1207
1505
|
printf '%s\n' "$install_key" > "$proj/deps.hash"
|
|
@@ -1227,7 +1525,7 @@ cmd_exec() {
|
|
|
1227
1525
|
exec 3<&0
|
|
1228
1526
|
# Own process group, so the lease can stop the command and everything it started.
|
|
1229
1527
|
set -m
|
|
1230
|
-
( cd "$tree/$subfolder" && exec bash -c "$*" ) < /dev/null &
|
|
1528
|
+
( cd "$tree/$subfolder" && LC_ALL=$job_locale && export LC_ALL && exec bash -c "$*" ) < /dev/null &
|
|
1231
1529
|
local exec_pid=$!
|
|
1232
1530
|
keep_awake_while "$exec_pid"
|
|
1233
1531
|
set +m
|