charness 3.9.1 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +155 -0
- package/DEVELOPMENT.md +4 -1
- package/README.md +2 -1
- package/SETUP.md +6 -4
- package/agent-plugin/README.md +2 -2
- package/agent-plugin/skills/charness-delegate-opencode/SKILL.md +1 -1
- package/agent-plugin/skills/charness-manager/SKILL.md +11 -6
- package/dist/bot.d.ts +27 -18
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +390 -231
- package/dist/bot.js.map +1 -1
- package/dist/connectors/jira/adf.d.ts.map +1 -1
- package/dist/connectors/jira/adf.js +2 -3
- package/dist/connectors/jira/adf.js.map +1 -1
- package/dist/connectors/telegram/commands/botCore.d.ts +17 -0
- package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/claudeAccounts.js +3 -3
- package/dist/connectors/telegram/commands/claudeAccounts.js.map +1 -1
- package/dist/connectors/telegram/commands/runners.d.ts +10 -1
- package/dist/connectors/telegram/commands/runners.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/runners.js +85 -17
- package/dist/connectors/telegram/commands/runners.js.map +1 -1
- package/dist/connectors/telegram/foldedMessage.d.ts +24 -0
- package/dist/connectors/telegram/foldedMessage.d.ts.map +1 -0
- package/dist/connectors/telegram/foldedMessage.js +39 -0
- package/dist/connectors/telegram/foldedMessage.js.map +1 -0
- package/dist/connectors/telegram/inbound.d.ts +24 -1
- package/dist/connectors/telegram/inbound.d.ts.map +1 -1
- package/dist/connectors/telegram/inbound.js +77 -1
- package/dist/connectors/telegram/inbound.js.map +1 -1
- package/dist/connectors/telegram/renderAgentHtml.d.ts +15 -0
- package/dist/connectors/telegram/renderAgentHtml.d.ts.map +1 -1
- package/dist/connectors/telegram/renderAgentHtml.js +11 -1
- package/dist/connectors/telegram/renderAgentHtml.js.map +1 -1
- package/dist/connectors/telegram/runnerLinkNotices.d.ts +24 -0
- package/dist/connectors/telegram/runnerLinkNotices.d.ts.map +1 -0
- package/dist/connectors/telegram/runnerLinkNotices.js +95 -0
- package/dist/connectors/telegram/runnerLinkNotices.js.map +1 -0
- package/dist/connectors/telegram/runnerPairingMessages.d.ts +9 -0
- package/dist/connectors/telegram/runnerPairingMessages.d.ts.map +1 -1
- package/dist/connectors/telegram/runnerPairingMessages.js +17 -1
- package/dist/connectors/telegram/runnerPairingMessages.js.map +1 -1
- package/dist/connectors/telegram/unpinMessages.d.ts +12 -0
- package/dist/connectors/telegram/unpinMessages.d.ts.map +1 -0
- package/dist/connectors/telegram/unpinMessages.js +44 -0
- package/dist/connectors/telegram/unpinMessages.js.map +1 -0
- package/dist/i18n/de.d.ts.map +1 -1
- package/dist/i18n/de.js +30 -3
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +30 -3
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +30 -3
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +30 -3
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/hi.d.ts.map +1 -1
- package/dist/i18n/hi.js +30 -3
- package/dist/i18n/hi.js.map +1 -1
- package/dist/i18n/ja.d.ts.map +1 -1
- package/dist/i18n/ja.js +30 -3
- package/dist/i18n/ja.js.map +1 -1
- package/dist/i18n/ka.d.ts.map +1 -1
- package/dist/i18n/ka.js +30 -3
- package/dist/i18n/ka.js.map +1 -1
- package/dist/i18n/pt.d.ts.map +1 -1
- package/dist/i18n/pt.js +30 -3
- package/dist/i18n/pt.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +30 -3
- package/dist/i18n/ru.js.map +1 -1
- package/dist/i18n/uk.d.ts.map +1 -1
- package/dist/i18n/uk.js +30 -3
- package/dist/i18n/uk.js.map +1 -1
- package/dist/i18n/uz.d.ts.map +1 -1
- package/dist/i18n/uz.js +30 -3
- package/dist/i18n/uz.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +30 -3
- package/dist/i18n/zh.js.map +1 -1
- package/dist/outputTrace.d.ts +6 -0
- package/dist/outputTrace.d.ts.map +1 -1
- package/dist/outputTrace.js +15 -9
- package/dist/outputTrace.js.map +1 -1
- package/dist/rateLimiter.d.ts +3 -1
- package/dist/rateLimiter.d.ts.map +1 -1
- package/dist/rateLimiter.js +3 -1
- package/dist/rateLimiter.js.map +1 -1
- package/dist/remoteRun/cliArgs.d.ts +6 -1
- package/dist/remoteRun/cliArgs.d.ts.map +1 -1
- package/dist/remoteRun/cliArgs.js +39 -2
- package/dist/remoteRun/cliArgs.js.map +1 -1
- package/dist/remoteRun/exitCodes.d.ts +12 -2
- package/dist/remoteRun/exitCodes.d.ts.map +1 -1
- package/dist/remoteRun/exitCodes.js +3 -0
- package/dist/remoteRun/exitCodes.js.map +1 -1
- package/dist/remoteRun/foreground.d.ts +13 -0
- package/dist/remoteRun/foreground.d.ts.map +1 -1
- package/dist/remoteRun/foreground.js +15 -2
- package/dist/remoteRun/foreground.js.map +1 -1
- package/dist/remoteRun/heldBackNotice.d.ts +7 -0
- package/dist/remoteRun/heldBackNotice.d.ts.map +1 -0
- package/dist/remoteRun/heldBackNotice.js +92 -0
- package/dist/remoteRun/heldBackNotice.js.map +1 -0
- package/dist/remoteRun/interrupts.d.ts +6 -2
- package/dist/remoteRun/interrupts.d.ts.map +1 -1
- package/dist/remoteRun/interrupts.js +18 -3
- package/dist/remoteRun/interrupts.js.map +1 -1
- package/dist/remoteRun/leaseTiming.d.ts +1 -2
- package/dist/remoteRun/leaseTiming.d.ts.map +1 -1
- package/dist/remoteRun/leaseTiming.js +3 -17
- package/dist/remoteRun/leaseTiming.js.map +1 -1
- package/dist/remoteRun/output.d.ts +16 -1
- package/dist/remoteRun/output.d.ts.map +1 -1
- package/dist/remoteRun/output.js +28 -2
- package/dist/remoteRun/output.js.map +1 -1
- package/dist/remoteRun/probe.d.ts +40 -2
- package/dist/remoteRun/probe.d.ts.map +1 -1
- package/dist/remoteRun/probe.js +58 -2
- package/dist/remoteRun/probe.js.map +1 -1
- package/dist/remoteRun/project.d.ts +2 -2
- package/dist/remoteRun/project.d.ts.map +1 -1
- package/dist/remoteRun/project.js +5 -4
- package/dist/remoteRun/project.js.map +1 -1
- package/dist/remoteRun/remoteRunCli.d.ts +1 -1
- package/dist/remoteRun/remoteRunCli.d.ts.map +1 -1
- package/dist/remoteRun/remoteRunCli.js +6 -3
- package/dist/remoteRun/remoteRunCli.js.map +1 -1
- package/dist/remoteRun/runnerWait.d.ts +3 -3
- package/dist/remoteRun/runnerWait.d.ts.map +1 -1
- package/dist/remoteRun/runnerWait.js +12 -6
- package/dist/remoteRun/runnerWait.js.map +1 -1
- package/dist/remoteRun/runnerWaitTiming.d.ts +1 -1
- package/dist/remoteRun/runnerWaitTiming.d.ts.map +1 -1
- package/dist/remoteRun/runnerWaitTiming.js +3 -16
- package/dist/remoteRun/runnerWaitTiming.js.map +1 -1
- package/dist/remoteRun/runners.d.ts +16 -3
- package/dist/remoteRun/runners.d.ts.map +1 -1
- package/dist/remoteRun/runners.js +42 -4
- package/dist/remoteRun/runners.js.map +1 -1
- package/dist/remoteRun/sendPlan.d.ts +11 -1
- package/dist/remoteRun/sendPlan.d.ts.map +1 -1
- package/dist/remoteRun/sendPlan.js +29 -5
- package/dist/remoteRun/sendPlan.js.map +1 -1
- package/dist/remoteRun/submit.d.ts.map +1 -1
- package/dist/remoteRun/submit.js +13 -3
- package/dist/remoteRun/submit.js.map +1 -1
- package/dist/runnerUtility/adminService.d.ts +30 -2
- package/dist/runnerUtility/adminService.d.ts.map +1 -1
- package/dist/runnerUtility/adminService.js +104 -6
- package/dist/runnerUtility/adminService.js.map +1 -1
- package/dist/runnerUtility/appInstall.d.ts +13 -4
- package/dist/runnerUtility/appInstall.d.ts.map +1 -1
- package/dist/runnerUtility/appInstall.js +46 -19
- package/dist/runnerUtility/appInstall.js.map +1 -1
- package/dist/runnerUtility/appUpdate.js +1 -1
- package/dist/runnerUtility/appUpdate.js.map +1 -1
- package/dist/runnerUtility/execEnv.d.ts +2 -0
- package/dist/runnerUtility/execEnv.d.ts.map +1 -1
- package/dist/runnerUtility/execEnv.js +6 -2
- package/dist/runnerUtility/execEnv.js.map +1 -1
- package/dist/runnerUtility/guiAgent.d.ts +126 -0
- package/dist/runnerUtility/guiAgent.d.ts.map +1 -0
- package/dist/runnerUtility/guiAgent.js +591 -0
- package/dist/runnerUtility/guiAgent.js.map +1 -0
- package/dist/runnerUtility/guiAgentHeal.d.ts +128 -0
- package/dist/runnerUtility/guiAgentHeal.d.ts.map +1 -0
- package/dist/runnerUtility/guiAgentHeal.js +284 -0
- package/dist/runnerUtility/guiAgentHeal.js.map +1 -0
- package/dist/runnerUtility/homeFolders.d.ts +33 -0
- package/dist/runnerUtility/homeFolders.d.ts.map +1 -0
- package/dist/runnerUtility/homeFolders.js +158 -0
- package/dist/runnerUtility/homeFolders.js.map +1 -0
- package/dist/runnerUtility/hubClient.d.ts +12 -2
- package/dist/runnerUtility/hubClient.d.ts.map +1 -1
- package/dist/runnerUtility/hubClient.js +24 -3
- package/dist/runnerUtility/hubClient.js.map +1 -1
- package/dist/runnerUtility/iosCheck.d.ts +7 -1
- package/dist/runnerUtility/iosCheck.d.ts.map +1 -1
- package/dist/runnerUtility/iosCheck.js +14 -5
- package/dist/runnerUtility/iosCheck.js.map +1 -1
- package/dist/runnerUtility/isolatedCommand.d.ts +31 -0
- package/dist/runnerUtility/isolatedCommand.d.ts.map +1 -0
- package/dist/runnerUtility/isolatedCommand.js +132 -0
- package/dist/runnerUtility/isolatedCommand.js.map +1 -0
- package/dist/runnerUtility/keepAwake.d.ts +67 -0
- package/dist/runnerUtility/keepAwake.d.ts.map +1 -0
- package/dist/runnerUtility/keepAwake.js +211 -0
- package/dist/runnerUtility/keepAwake.js.map +1 -0
- package/dist/runnerUtility/lidPollTiming.d.ts +11 -0
- package/dist/runnerUtility/lidPollTiming.d.ts.map +1 -0
- package/dist/runnerUtility/lidPollTiming.js +18 -0
- package/dist/runnerUtility/lidPollTiming.js.map +1 -0
- package/dist/runnerUtility/lidState.d.ts +57 -0
- package/dist/runnerUtility/lidState.d.ts.map +1 -0
- package/dist/runnerUtility/lidState.js +195 -0
- package/dist/runnerUtility/lidState.js.map +1 -0
- package/dist/runnerUtility/linkLoop.d.ts +5 -0
- package/dist/runnerUtility/linkLoop.d.ts.map +1 -1
- package/dist/runnerUtility/linkLoop.js +37 -1
- package/dist/runnerUtility/linkLoop.js.map +1 -1
- package/dist/runnerUtility/packageManagerShims.d.ts +44 -0
- package/dist/runnerUtility/packageManagerShims.d.ts.map +1 -0
- package/dist/runnerUtility/packageManagerShims.js +130 -0
- package/dist/runnerUtility/packageManagerShims.js.map +1 -0
- package/dist/runnerUtility/progress.d.ts +43 -0
- package/dist/runnerUtility/progress.d.ts.map +1 -0
- package/dist/runnerUtility/progress.js +78 -0
- package/dist/runnerUtility/progress.js.map +1 -0
- package/dist/runnerUtility/pueueDaemon.d.ts +8 -4
- package/dist/runnerUtility/pueueDaemon.d.ts.map +1 -1
- package/dist/runnerUtility/pueueDaemon.js +12 -7
- package/dist/runnerUtility/pueueDaemon.js.map +1 -1
- package/dist/runnerUtility/rootServiceCli.d.ts +23 -3
- package/dist/runnerUtility/rootServiceCli.d.ts.map +1 -1
- package/dist/runnerUtility/rootServiceCli.js +56 -10
- package/dist/runnerUtility/rootServiceCli.js.map +1 -1
- package/dist/runnerUtility/runnerCli.d.ts +1 -0
- package/dist/runnerUtility/runnerCli.d.ts.map +1 -1
- package/dist/runnerUtility/runnerCli.js +14 -7
- package/dist/runnerUtility/runnerCli.js.map +1 -1
- package/dist/runnerUtility/runnerCommands.d.ts +45 -0
- package/dist/runnerUtility/runnerCommands.d.ts.map +1 -1
- package/dist/runnerUtility/runnerCommands.js +188 -21
- package/dist/runnerUtility/runnerCommands.js.map +1 -1
- package/dist/runnerUtility/runnerHome.d.ts +8 -0
- package/dist/runnerUtility/runnerHome.d.ts.map +1 -1
- package/dist/runnerUtility/runnerHome.js +7 -0
- package/dist/runnerUtility/runnerHome.js.map +1 -1
- package/dist/runnerUtility/serviceCommon.d.ts +4 -0
- package/dist/runnerUtility/serviceCommon.d.ts.map +1 -1
- package/dist/runnerUtility/serviceCommon.js +8 -1
- package/dist/runnerUtility/serviceCommon.js.map +1 -1
- package/dist/runnerUtility/serviceManager.d.ts +5 -2
- package/dist/runnerUtility/serviceManager.d.ts.map +1 -1
- package/dist/runnerUtility/serviceManager.js +40 -17
- package/dist/runnerUtility/serviceManager.js.map +1 -1
- package/dist/runnerUtility/serviceUnits.d.ts +11 -0
- package/dist/runnerUtility/serviceUnits.d.ts.map +1 -1
- package/dist/runnerUtility/serviceUnits.js +8 -2
- package/dist/runnerUtility/serviceUnits.js.map +1 -1
- package/dist/runnerUtility/simulatorSilencer.d.ts +55 -0
- package/dist/runnerUtility/simulatorSilencer.d.ts.map +1 -0
- package/dist/runnerUtility/simulatorSilencer.js +203 -0
- package/dist/runnerUtility/simulatorSilencer.js.map +1 -0
- package/dist/runnerUtility/stopSignals.d.ts +10 -0
- package/dist/runnerUtility/stopSignals.d.ts.map +1 -0
- package/dist/runnerUtility/stopSignals.js +27 -0
- package/dist/runnerUtility/stopSignals.js.map +1 -0
- package/dist/runnerUtility/versionPollTiming.d.ts +2 -3
- package/dist/runnerUtility/versionPollTiming.d.ts.map +1 -1
- package/dist/runnerUtility/versionPollTiming.js +4 -18
- package/dist/runnerUtility/versionPollTiming.js.map +1 -1
- package/dist/runners/bootstrapLine.d.ts.map +1 -1
- package/dist/runners/bootstrapLine.js +35 -19
- package/dist/runners/bootstrapLine.js.map +1 -1
- package/dist/runners/gate.d.ts.map +1 -1
- package/dist/runners/gate.js +28 -1
- package/dist/runners/gate.js.map +1 -1
- package/dist/runners/gateLink.d.ts +7 -0
- package/dist/runners/gateLink.d.ts.map +1 -1
- package/dist/runners/gateLink.js +36 -3
- package/dist/runners/gateLink.js.map +1 -1
- package/dist/runners/gateProtocol.d.ts +37 -2
- package/dist/runners/gateProtocol.d.ts.map +1 -1
- package/dist/runners/gateProtocol.js +45 -4
- package/dist/runners/gateProtocol.js.map +1 -1
- package/dist/runners/hubPackage.d.ts +2 -1
- package/dist/runners/hubPackage.d.ts.map +1 -1
- package/dist/runners/hubPackage.js +32 -11
- package/dist/runners/hubPackage.js.map +1 -1
- package/dist/runners/hubPairing.d.ts +1 -1
- package/dist/runners/hubPairing.d.ts.map +1 -1
- package/dist/runners/hubPairing.js +8 -1
- package/dist/runners/hubPairing.js.map +1 -1
- package/dist/runners/hubPaths.d.ts +2 -0
- package/dist/runners/hubPaths.d.ts.map +1 -1
- package/dist/runners/hubPaths.js +1 -1
- package/dist/runners/hubPaths.js.map +1 -1
- package/dist/runners/linkConcern.d.ts +75 -0
- package/dist/runners/linkConcern.d.ts.map +1 -0
- package/dist/runners/linkConcern.js +85 -0
- package/dist/runners/linkConcern.js.map +1 -0
- package/dist/runners/linkControl.d.ts +25 -1
- package/dist/runners/linkControl.d.ts.map +1 -1
- package/dist/runners/linkControl.js +46 -4
- package/dist/runners/linkControl.js.map +1 -1
- package/dist/runners/pairingTiming.d.ts +2 -3
- package/dist/runners/pairingTiming.d.ts.map +1 -1
- package/dist/runners/pairingTiming.js +4 -18
- package/dist/runners/pairingTiming.js.map +1 -1
- package/dist/runners/runnerLock.d.ts +112 -0
- package/dist/runners/runnerLock.d.ts.map +1 -0
- package/dist/runners/runnerLock.js +292 -0
- package/dist/runners/runnerLock.js.map +1 -0
- package/dist/runners/runnersCli.d.ts +6 -3
- package/dist/runners/runnersCli.d.ts.map +1 -1
- package/dist/runners/runnersCli.js +33 -6
- package/dist/runners/runnersCli.js.map +1 -1
- package/dist/runners/runnersList.d.ts +3 -3
- package/dist/runners/runnersList.d.ts.map +1 -1
- package/dist/runners/runnersList.js +9 -2
- package/dist/runners/runnersList.js.map +1 -1
- package/dist/runners/runnersOverview.d.ts +29 -3
- package/dist/runners/runnersOverview.d.ts.map +1 -1
- package/dist/runners/runnersOverview.js +71 -6
- package/dist/runners/runnersOverview.js.map +1 -1
- package/dist/runners/serviceRemoval.d.ts +43 -0
- package/dist/runners/serviceRemoval.d.ts.map +1 -0
- package/dist/runners/serviceRemoval.js +114 -0
- package/dist/runners/serviceRemoval.js.map +1 -0
- package/dist/scheduler/checkRun.d.ts +9 -10
- package/dist/scheduler/checkRun.d.ts.map +1 -1
- package/dist/scheduler/checkRun.js +8 -16
- package/dist/scheduler/checkRun.js.map +1 -1
- package/dist/scheduler/checkStatus.d.ts +75 -0
- package/dist/scheduler/checkStatus.d.ts.map +1 -0
- package/dist/scheduler/checkStatus.js +117 -0
- package/dist/scheduler/checkStatus.js.map +1 -0
- package/dist/scheduler/delivery.d.ts +106 -38
- package/dist/scheduler/delivery.d.ts.map +1 -1
- package/dist/scheduler/delivery.js +199 -73
- package/dist/scheduler/delivery.js.map +1 -1
- package/dist/scheduler/mcpSurface.d.ts +8 -2
- package/dist/scheduler/mcpSurface.d.ts.map +1 -1
- package/dist/scheduler/mcpSurface.js +96 -20
- package/dist/scheduler/mcpSurface.js.map +1 -1
- package/dist/scheduler/recurrence.d.ts +32 -0
- package/dist/scheduler/recurrence.d.ts.map +1 -1
- package/dist/scheduler/recurrence.js +56 -18
- package/dist/scheduler/recurrence.js.map +1 -1
- package/dist/scheduler/scheduleText.d.ts +7 -0
- package/dist/scheduler/scheduleText.d.ts.map +1 -0
- package/dist/scheduler/scheduleText.js +55 -0
- package/dist/scheduler/scheduleText.js.map +1 -0
- package/dist/scheduler/store.d.ts +23 -2
- package/dist/scheduler/store.d.ts.map +1 -1
- package/dist/scheduler/store.js +57 -3
- package/dist/scheduler/store.js.map +1 -1
- package/dist/scheduler/types.d.ts +26 -10
- package/dist/scheduler/types.d.ts.map +1 -1
- package/dist/scheduler/unbindPause.d.ts +27 -0
- package/dist/scheduler/unbindPause.d.ts.map +1 -0
- package/dist/scheduler/unbindPause.js +21 -0
- package/dist/scheduler/unbindPause.js.map +1 -0
- package/dist/scheduler/workerActivity.d.ts +25 -0
- package/dist/scheduler/workerActivity.d.ts.map +1 -0
- package/dist/scheduler/workerActivity.js +195 -0
- package/dist/scheduler/workerActivity.js.map +1 -0
- package/dist/scheduler/workerWatch.d.ts +36 -9
- package/dist/scheduler/workerWatch.d.ts.map +1 -1
- package/dist/scheduler/workerWatch.js +41 -11
- package/dist/scheduler/workerWatch.js.map +1 -1
- package/dist/state.d.ts +8 -0
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +30 -0
- package/dist/state.js.map +1 -1
- package/dist/stt/sttRuntime.d.ts.map +1 -1
- package/dist/stt/sttRuntime.js +8 -1
- package/dist/stt/sttRuntime.js.map +1 -1
- package/dist/stt/sttSettings.d.ts +56 -6
- package/dist/stt/sttSettings.d.ts.map +1 -1
- package/dist/stt/sttSettings.js +128 -7
- package/dist/stt/sttSettings.js.map +1 -1
- package/dist/stt/sttSidecarOwner.d.ts +13 -5
- package/dist/stt/sttSidecarOwner.d.ts.map +1 -1
- package/dist/stt/sttSidecarOwner.js +72 -31
- package/dist/stt/sttSidecarOwner.js.map +1 -1
- package/dist/stt/transcribeChain.d.ts +23 -1
- package/dist/stt/transcribeChain.d.ts.map +1 -1
- package/dist/stt/transcribeChain.js +59 -4
- package/dist/stt/transcribeChain.js.map +1 -1
- package/dist/testTimings.d.ts +4 -2
- package/dist/testTimings.d.ts.map +1 -1
- package/dist/testTimings.js +7 -1
- package/dist/testTimings.js.map +1 -1
- package/dist/testTimingsSeam.d.ts +10 -0
- package/dist/testTimingsSeam.d.ts.map +1 -0
- package/dist/testTimingsSeam.js +29 -0
- package/dist/testTimingsSeam.js.map +1 -0
- package/dist/utils/claudeUsage.d.ts +3 -0
- package/dist/utils/claudeUsage.d.ts.map +1 -1
- package/dist/utils/claudeUsage.js +8 -1
- package/dist/utils/claudeUsage.js.map +1 -1
- package/dist/utils/claudeUsageRefresher.d.ts +27 -3
- package/dist/utils/claudeUsageRefresher.d.ts.map +1 -1
- package/dist/utils/claudeUsageRefresher.js +113 -14
- package/dist/utils/claudeUsageRefresher.js.map +1 -1
- package/dist/utils/forwardedMark.d.ts +54 -0
- package/dist/utils/forwardedMark.d.ts.map +1 -0
- package/dist/utils/forwardedMark.js +80 -0
- package/dist/utils/forwardedMark.js.map +1 -0
- package/dist/utils/limitHeldPrompts.d.ts +8 -2
- package/dist/utils/limitHeldPrompts.d.ts.map +1 -1
- package/dist/utils/limitHeldPrompts.js +11 -4
- package/dist/utils/limitHeldPrompts.js.map +1 -1
- package/dist/utils/messageContext.d.ts +54 -0
- package/dist/utils/messageContext.d.ts.map +1 -0
- package/dist/utils/messageContext.js +58 -0
- package/dist/utils/messageContext.js.map +1 -0
- package/dist/utils/openCodeUsage.d.ts +10 -3
- package/dist/utils/openCodeUsage.d.ts.map +1 -1
- package/dist/utils/openCodeUsage.js +19 -5
- package/dist/utils/openCodeUsage.js.map +1 -1
- package/dist/utils/replyQuote.d.ts +11 -26
- package/dist/utils/replyQuote.d.ts.map +1 -1
- package/dist/utils/replyQuote.js +9 -31
- package/dist/utils/replyQuote.js.map +1 -1
- package/dist/utils/runnersScreenPlan.d.ts +14 -0
- package/dist/utils/runnersScreenPlan.d.ts.map +1 -1
- package/dist/utils/runnersScreenPlan.js +49 -5
- package/dist/utils/runnersScreenPlan.js.map +1 -1
- package/dist/utils/stripControlCharacters.d.ts +8 -0
- package/dist/utils/stripControlCharacters.d.ts.map +1 -0
- package/dist/utils/stripControlCharacters.js +16 -0
- package/dist/utils/stripControlCharacters.js.map +1 -0
- package/dist/utils/surrogateSafeCut.d.ts +14 -0
- package/dist/utils/surrogateSafeCut.d.ts.map +1 -0
- package/dist/utils/surrogateSafeCut.js +30 -0
- package/dist/utils/surrogateSafeCut.js.map +1 -0
- package/dist/utils/telegramError.d.ts +13 -0
- package/dist/utils/telegramError.d.ts.map +1 -1
- package/dist/utils/telegramError.js +45 -0
- package/dist/utils/telegramError.js.map +1 -1
- package/dist/utils/topicRequest.d.ts +13 -0
- package/dist/utils/topicRequest.d.ts.map +1 -1
- package/dist/utils/topicRequest.js +10 -0
- package/dist/utils/topicRequest.js.map +1 -1
- package/dist/utils/transientFrames.d.ts +51 -6
- package/dist/utils/transientFrames.d.ts.map +1 -1
- package/dist/utils/transientFrames.js +52 -2
- package/dist/utils/transientFrames.js.map +1 -1
- package/dist/utils/usageRefreshBudget.d.ts.map +1 -1
- package/dist/utils/usageRefreshBudget.js +4 -10
- package/dist/utils/usageRefreshBudget.js.map +1 -1
- package/dist/utils/waitUpTo.d.ts +8 -0
- package/dist/utils/waitUpTo.d.ts.map +1 -0
- package/dist/utils/waitUpTo.js +20 -0
- package/dist/utils/waitUpTo.js.map +1 -0
- package/dist/voiceProgressNote.d.ts +73 -0
- package/dist/voiceProgressNote.d.ts.map +1 -0
- package/dist/voiceProgressNote.js +142 -0
- package/dist/voiceProgressNote.js.map +1 -0
- package/package.json +4 -1
- package/remoteRun/pickNode.sh +65 -0
- package/remoteRun/runner-package-lock.json +59 -0
- package/remoteRun/runner.sh +304 -6
|
@@ -1,21 +1,45 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { type LinkConcern } from './linkConcern';
|
|
2
3
|
declare const linkStateSchema: z.ZodObject<{
|
|
3
4
|
pid: z.ZodNumber;
|
|
4
5
|
sinceMs: z.ZodNumber;
|
|
5
6
|
lastBeatMs: z.ZodNumber;
|
|
6
7
|
endedAtMs: z.ZodNullable<z.ZodNumber>;
|
|
8
|
+
source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
|
+
sourceChanges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
10
|
+
fromSource: z.ZodString;
|
|
11
|
+
toSource: z.ZodString;
|
|
12
|
+
atMs: z.ZodNumber;
|
|
13
|
+
isLiveReplacement: z.ZodBoolean;
|
|
14
|
+
}, z.core.$strict>>>;
|
|
7
15
|
}, z.core.$strict>;
|
|
8
16
|
/** @name LinkState @description `link/<id>.json`. */
|
|
9
17
|
export type LinkState = z.infer<typeof linkStateSchema>;
|
|
18
|
+
declare const lidStateSchema: z.ZodObject<{
|
|
19
|
+
isClosed: z.ZodBoolean;
|
|
20
|
+
reportedAtMs: z.ZodNumber;
|
|
21
|
+
linkEpochMs: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
/** @name LidState @description `link/<id>.lid`: the runner's last report about its lid. */
|
|
24
|
+
export type LidState = z.infer<typeof lidStateSchema>;
|
|
10
25
|
export interface RunnerLinkStatus {
|
|
11
26
|
isOnline: boolean;
|
|
12
27
|
/** When the link in force started (only while online). */
|
|
13
28
|
sinceMs: number | null;
|
|
14
29
|
/** The last time the hub knew the link alive; `null` if it never was. */
|
|
15
30
|
lastSeenMs: number | null;
|
|
31
|
+
/** Where the link in force (or the last one) connects from; `null` when not known. */
|
|
32
|
+
source: string | null;
|
|
33
|
+
/** What is worth telling about where the link comes from (`linkConcern.ts`) — it stays until the runner is removed or paired again; `null` when the link never changed address. */
|
|
34
|
+
concern: LinkConcern | null;
|
|
35
|
+
/** The runner's last report says its lid is closed with nothing keeping it awake. Only meaningful beside `isOnline`: a runner that is not linked is offline, whatever it said last. */
|
|
36
|
+
isLidClosed: boolean;
|
|
16
37
|
}
|
|
17
38
|
export declare function readLinkState(dir: string, runnerId: string): LinkState | null;
|
|
18
39
|
export declare function writeLinkState(dir: string, runnerId: string, state: LinkState): void;
|
|
40
|
+
/** @description What the runner last said about its lid, `null` when it never said (a runner that is not a Mac, or an older one). */
|
|
41
|
+
export declare function readLidState(dir: string, runnerId: string): LidState | null;
|
|
42
|
+
export declare function writeLidState(dir: string, runnerId: string, state: LidState): void;
|
|
19
43
|
/** @description Does anything accept a connection on the unix socket `socketPath` right now? */
|
|
20
44
|
export declare function probeSocket(socketPath: string, timeoutMs?: number): Promise<boolean>;
|
|
21
45
|
export declare function getRunnerLinkStatus(dir: string, runnerId: string): Promise<RunnerLinkStatus>;
|
|
@@ -24,7 +48,7 @@ export declare function checkIsGateProcessOf(pid: number, runnerId: string): boo
|
|
|
24
48
|
/** @description Cut the link of a runner that was removed: no new connection reaches it, its gate leaves, and its link files are deleted. */
|
|
25
49
|
export declare function cutRunnerLink(dir: string, runnerId: string): void;
|
|
26
50
|
/**
|
|
27
|
-
* @description Delete the link files (`<id>.json`, `<id>.sock`) of every runner that is not in `registeredRunnerIds`: a removal that was cut
|
|
51
|
+
* @description Delete the link files (`<id>.json`, `<id>.sock`, `<id>.lid`) of every runner that is not in `registeredRunnerIds`: a removal that was cut
|
|
28
52
|
* short, a gate that wrote its status after the removal, a runner dropped from the registry by hand. Records of a runner whose gate is still
|
|
29
53
|
* running are kept — it is on its way out, and {@link cutRunnerLink} still needs the pid to stop it.
|
|
30
54
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linkControl.d.ts","sourceRoot":"","sources":["../../src/runners/linkControl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"linkControl.d.ts","sourceRoot":"","sources":["../../src/runners/linkControl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAqF,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAmBpI,QAAA,MAAM,eAAe;;;;;;;;;;;;kBAUnB,CAAC;AAEH,qDAAqD;AACrD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,QAAA,MAAM,cAAc;;;;kBASlB,CAAC;AAEH,2FAA2F;AAC3F,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,C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AAE,mBAAmB,EAAE,SAAS,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,EAAE,CAwB1I"}
|
|
@@ -35,6 +35,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.readLinkState = readLinkState;
|
|
37
37
|
exports.writeLinkState = writeLinkState;
|
|
38
|
+
exports.readLidState = readLidState;
|
|
39
|
+
exports.writeLidState = writeLidState;
|
|
38
40
|
exports.probeSocket = probeSocket;
|
|
39
41
|
exports.getRunnerLinkStatus = getRunnerLinkStatus;
|
|
40
42
|
exports.checkIsGateProcessOf = checkIsGateProcessOf;
|
|
@@ -48,21 +50,42 @@ const zod_1 = require("zod");
|
|
|
48
50
|
const configDirFile_1 = require("../configDirFile");
|
|
49
51
|
const hubPaths_1 = require("./hubPaths");
|
|
50
52
|
const hubIds_1 = require("./hubIds");
|
|
53
|
+
const linkConcern_1 = require("./linkConcern");
|
|
51
54
|
/**
|
|
52
55
|
* @description The hub's view of a runner's link: the gate that holds it writes `link/<id>.json` (its pid, since when, a heartbeat) and
|
|
53
56
|
* listens on `link/<id>.sock`. A runner is ONLINE when its socket accepts a connection; the json only says who holds the socket and
|
|
54
57
|
* when it was last seen. A removed runner's link is cut by deleting the socket (the gate notices within one check interval and
|
|
55
58
|
* leaves) and, when the recorded pid still is that runner's gate, by stopping it at once; its two link files go with it, and any left behind
|
|
56
59
|
* for a runner the registry does not know are swept by {@link sweepOrphanLinkRecords}.
|
|
60
|
+
*
|
|
61
|
+
* A Mac runner also tells the hub when its LID is closed with nothing keeping the machine awake (`lid` request of the gate; `lidState` below): it is
|
|
62
|
+
* going to sleep, and a job that lands in the minute before it does — or in the dark wake macOS gives a sleeping Mac on power every so often — is cut. The
|
|
63
|
+
* record outlives the link on purpose: a Mac that wakes for those seconds reconnects with the lid still shut, and must not look available until it
|
|
64
|
+
* says it is not.
|
|
57
65
|
*/
|
|
58
66
|
const stateFileMode = 0o600;
|
|
59
67
|
const probeTimeoutMs = 1000;
|
|
68
|
+
const lidFileMode = 0o600;
|
|
60
69
|
const linkStateSchema = zod_1.z.strictObject({
|
|
61
70
|
pid: zod_1.z.number().int().positive(),
|
|
62
71
|
sinceMs: zod_1.z.number().int().nonnegative(),
|
|
63
72
|
lastBeatMs: zod_1.z.number().int().nonnegative(),
|
|
64
73
|
/** Set by the gate when it leaves; `null` while it holds the link. */
|
|
65
74
|
endedAtMs: zod_1.z.number().int().nonnegative().nullable(),
|
|
75
|
+
/** Where the link connects from (sshd's `SSH_CLIENT`); `null` when sshd did not say. Absent in a file an older gate wrote. */
|
|
76
|
+
source: zod_1.z.string().max(linkConcern_1.maxSourceLength).nullable().optional(),
|
|
77
|
+
/** The last times a link came from another address than the one before it (`linkConcern.ts`). */
|
|
78
|
+
sourceChanges: zod_1.z.array(linkConcern_1.linkSourceChangeSchema).max(linkConcern_1.maxRecordedSourceChanges).optional(),
|
|
79
|
+
});
|
|
80
|
+
const lidStateSchema = zod_1.z.strictObject({
|
|
81
|
+
/** The lid is closed and nothing keeps the Mac awake (no external display): it takes no new job. */
|
|
82
|
+
isClosed: zod_1.z.boolean(),
|
|
83
|
+
reportedAtMs: zod_1.z.number().int().nonnegative(),
|
|
84
|
+
/**
|
|
85
|
+
* The epoch (the start in ms, by the hub's clock) of the link the report was made on. A report from a link that began EARLIER than the one on record is dropped: a
|
|
86
|
+
* Mac that fell asleep with a report in flight may have it delivered after its next link has already said where its lid is. Absent in a record without a link behind it.
|
|
87
|
+
*/
|
|
88
|
+
linkEpochMs: zod_1.z.number().int().nonnegative().optional(),
|
|
66
89
|
});
|
|
67
90
|
function readLinkState(dir, runnerId) {
|
|
68
91
|
try {
|
|
@@ -77,6 +100,20 @@ function writeLinkState(dir, runnerId, state) {
|
|
|
77
100
|
fs.mkdirSync((0, hubPaths_1.getHubFilePaths)(dir).linkDir, { recursive: true, mode: 0o700 });
|
|
78
101
|
(0, configDirFile_1.writeJsonFileAtomically)((0, hubPaths_1.getRunnerLinkPaths)(dir, runnerId).state, linkStateSchema.parse(state), stateFileMode);
|
|
79
102
|
}
|
|
103
|
+
/** @description What the runner last said about its lid, `null` when it never said (a runner that is not a Mac, or an older one). */
|
|
104
|
+
function readLidState(dir, runnerId) {
|
|
105
|
+
try {
|
|
106
|
+
const parsed = lidStateSchema.safeParse(JSON.parse(fs.readFileSync((0, hubPaths_1.getRunnerLinkPaths)(dir, runnerId).lid, 'utf8')));
|
|
107
|
+
return parsed.success ? parsed.data : null;
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function writeLidState(dir, runnerId, state) {
|
|
114
|
+
fs.mkdirSync((0, hubPaths_1.getHubFilePaths)(dir).linkDir, { recursive: true, mode: 0o700 });
|
|
115
|
+
(0, configDirFile_1.writeJsonFileAtomically)((0, hubPaths_1.getRunnerLinkPaths)(dir, runnerId).lid, lidStateSchema.parse(state), lidFileMode);
|
|
116
|
+
}
|
|
80
117
|
/** @description Does anything accept a connection on the unix socket `socketPath` right now? */
|
|
81
118
|
function probeSocket(socketPath, timeoutMs = probeTimeoutMs) {
|
|
82
119
|
return new Promise((resolve) => {
|
|
@@ -98,6 +135,9 @@ async function getRunnerLinkStatus(dir, runnerId) {
|
|
|
98
135
|
isOnline,
|
|
99
136
|
sinceMs: isOnline ? (state?.sinceMs ?? null) : null,
|
|
100
137
|
lastSeenMs: state === null ? null : (state.endedAtMs ?? state.lastBeatMs),
|
|
138
|
+
source: state?.source ?? null,
|
|
139
|
+
concern: (0, linkConcern_1.getLinkConcern)(state?.sourceChanges),
|
|
140
|
+
isLidClosed: readLidState(dir, runnerId)?.isClosed === true,
|
|
101
141
|
};
|
|
102
142
|
}
|
|
103
143
|
/** @description Is `pid` a charness gate serving runner `runnerId`? (A pid in an old json may belong to anything by now.) */
|
|
@@ -119,17 +159,19 @@ function cutRunnerLink(dir, runnerId) {
|
|
|
119
159
|
throw error;
|
|
120
160
|
}
|
|
121
161
|
}
|
|
122
|
-
// Nobody reads the status of a runner that is gone, and a gate that leaves because of the removal writes none (`gateLink.ts`).
|
|
162
|
+
// Nobody reads the status of a runner that is gone, and a gate that leaves because of the removal writes none (`gateLink.ts`). Its lid report goes with it:
|
|
163
|
+
// the name or the id may belong to another machine tomorrow.
|
|
123
164
|
fs.rmSync(paths.state, { force: true });
|
|
165
|
+
fs.rmSync(paths.lid, { force: true });
|
|
124
166
|
}
|
|
125
|
-
const linkRecordExtensions = ['json', 'sock'];
|
|
126
|
-
/** @description The runner id a link file belongs to (`<id>.json`, `<id>.sock`); `null` for anything else in the folder (a temp file of an atomic write, a gate's pending socket). */
|
|
167
|
+
const linkRecordExtensions = ['json', 'sock', 'lid'];
|
|
168
|
+
/** @description The runner id a link file belongs to (`<id>.json`, `<id>.sock`, `<id>.lid`); `null` for anything else in the folder (a temp file of an atomic write, a gate's pending socket). */
|
|
127
169
|
function getLinkRecordRunnerId(fileName) {
|
|
128
170
|
const [runnerId, extension, ...rest] = fileName.split('.');
|
|
129
171
|
return hubIds_1.hubIdPattern.test(runnerId) && linkRecordExtensions.includes(extension) && rest.length === 0 ? runnerId : null;
|
|
130
172
|
}
|
|
131
173
|
/**
|
|
132
|
-
* @description Delete the link files (`<id>.json`, `<id>.sock`) of every runner that is not in `registeredRunnerIds`: a removal that was cut
|
|
174
|
+
* @description Delete the link files (`<id>.json`, `<id>.sock`, `<id>.lid`) of every runner that is not in `registeredRunnerIds`: a removal that was cut
|
|
133
175
|
* short, a gate that wrote its status after the removal, a runner dropped from the registry by hand. Records of a runner whose gate is still
|
|
134
176
|
* running are kept — it is on its way out, and {@link cutRunnerLink} still needs the pid to stop it.
|
|
135
177
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linkControl.js","sourceRoot":"","sources":["../../src/runners/linkControl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;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YACrD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,SAAS,CAAC,0BAA0B,IAAI,0BAA0B,IAAA,kCAAkB,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClG,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* @description How long a pairing code works. In a module of its own so the headless CLI reads it without loading the bot.
|
|
3
3
|
*
|
|
4
4
|
* The test seam `CHARNESS_TEST_TIMINGS` (`testTimings.ts`) may only SHORTEN it (key `pairingLifetimeMs`, at least
|
|
5
|
-
* {@link pairingLifetimeMinMs}: sshd's `expiry-time` has a granularity of a second). Like the remote-run lease it is read
|
|
6
|
-
* because this module cannot import `testTimings.ts` (its graph reaches the bot)
|
|
7
|
-
* refuses it by name.
|
|
5
|
+
* {@link pairingLifetimeMinMs}: sshd's `expiry-time` has a granularity of a second). Like the remote-run lease it is read through `testTimingsSeam.ts`,
|
|
6
|
+
* because this module cannot import `testTimings.ts` (its graph reaches the bot).
|
|
8
7
|
*/
|
|
9
8
|
export declare const pairingLifetimeMinutes = 10;
|
|
10
9
|
/** Production: a code works for ten minutes, once. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pairingTiming.d.ts","sourceRoot":"","sources":["../../src/runners/pairingTiming.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pairingTiming.d.ts","sourceRoot":"","sources":["../../src/runners/pairingTiming.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,sDAAsD;AACtD,eAAO,MAAM,iBAAiB,QAAuC,CAAC;AACtE,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,kKAAkK;AAClK,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAEpE;AAED,oGAAoG;AACpG,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEzD"}
|
|
@@ -3,37 +3,23 @@
|
|
|
3
3
|
* @description How long a pairing code works. In a module of its own so the headless CLI reads it without loading the bot.
|
|
4
4
|
*
|
|
5
5
|
* The test seam `CHARNESS_TEST_TIMINGS` (`testTimings.ts`) may only SHORTEN it (key `pairingLifetimeMs`, at least
|
|
6
|
-
* {@link pairingLifetimeMinMs}: sshd's `expiry-time` has a granularity of a second). Like the remote-run lease it is read
|
|
7
|
-
* because this module cannot import `testTimings.ts` (its graph reaches the bot)
|
|
8
|
-
* refuses it by name.
|
|
6
|
+
* {@link pairingLifetimeMinMs}: sshd's `expiry-time` has a granularity of a second). Like the remote-run lease it is read through `testTimingsSeam.ts`,
|
|
7
|
+
* because this module cannot import `testTimings.ts` (its graph reaches the bot).
|
|
9
8
|
*/
|
|
10
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
10
|
exports.pairingLifetimeMinMs = exports.pairingLifetimeMs = exports.pairingLifetimeMinutes = void 0;
|
|
12
11
|
exports.readPairingLifetimeMs = readPairingLifetimeMs;
|
|
13
12
|
exports.formatLifetime = formatLifetime;
|
|
13
|
+
const testTimingsSeam_1 = require("../testTimingsSeam");
|
|
14
14
|
const msPerMinute = 60 * 1000;
|
|
15
15
|
exports.pairingLifetimeMinutes = 10;
|
|
16
16
|
/** Production: a code works for ten minutes, once. */
|
|
17
17
|
exports.pairingLifetimeMs = exports.pairingLifetimeMinutes * msPerMinute;
|
|
18
18
|
/** sshd compares `expiry-time` in whole seconds: a shorter window would be rounding. */
|
|
19
19
|
exports.pairingLifetimeMinMs = 5000;
|
|
20
|
-
const testTimingsVariableName = 'CHARNESS_TEST_TIMINGS';
|
|
21
20
|
/** @description The lifetime in force: the production one, or the seam's shorter `pairingLifetimeMs` when it is a whole number of ms within [min, production]. */
|
|
22
21
|
function readPairingLifetimeMs(env) {
|
|
23
|
-
|
|
24
|
-
if (rawTestTimings === undefined || rawTestTimings.trim() === '')
|
|
25
|
-
return exports.pairingLifetimeMs;
|
|
26
|
-
let overrides;
|
|
27
|
-
try {
|
|
28
|
-
overrides = JSON.parse(rawTestTimings);
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return exports.pairingLifetimeMs;
|
|
32
|
-
}
|
|
33
|
-
const overrideMs = overrides?.pairingLifetimeMs;
|
|
34
|
-
if (overrideMs === undefined || !Number.isInteger(overrideMs))
|
|
35
|
-
return exports.pairingLifetimeMs;
|
|
36
|
-
return overrideMs >= exports.pairingLifetimeMinMs && overrideMs <= exports.pairingLifetimeMs ? overrideMs : exports.pairingLifetimeMs;
|
|
22
|
+
return (0, testTimingsSeam_1.readShorterTestWindowMs)(env, 'pairingLifetimeMs', exports.pairingLifetimeMs, exports.pairingLifetimeMinMs);
|
|
37
23
|
}
|
|
38
24
|
/** @description «10 minutes», or «5 seconds» for a window shorter than a minute (only a test's). */
|
|
39
25
|
function formatLifetime(lifetimeMs) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pairingTiming.js","sourceRoot":"","sources":["../../src/runners/pairingTiming.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"pairingTiming.js","sourceRoot":"","sources":["../../src/runners/pairingTiming.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAYH,sDAEC;AAGD,wCAEC;AAjBD,wDAA6D;AAE7D,MAAM,WAAW,GAAG,EAAE,GAAG,IAAI,CAAC;AACjB,QAAA,sBAAsB,GAAG,EAAE,CAAC;AACzC,sDAAsD;AACzC,QAAA,iBAAiB,GAAG,8BAAsB,GAAG,WAAW,CAAC;AACtE,wFAAwF;AAC3E,QAAA,oBAAoB,GAAG,IAAI,CAAC;AAEzC,kKAAkK;AAClK,SAAgB,qBAAqB,CAAC,GAAsB;IAC1D,OAAO,IAAA,yCAAuB,EAAC,GAAG,EAAE,mBAAmB,EAAE,yBAAiB,EAAE,4BAAoB,CAAC,CAAC;AACpG,CAAC;AAED,oGAAoG;AACpG,SAAgB,cAAc,CAAC,UAAkB;IAC/C,OAAO,UAAU,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;AACpI,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* @description The lockfile that the hub's package carries for the runner: made from `yarn.lock` for EXACTLY the packages the runner program needs at
|
|
4
|
+
* run time, so that `npm ci` on a runner installs what the hub has run and nothing newer. Without it the runner ran `npm install` against the open
|
|
5
|
+
* ranges of `package.json` (`"ssh2": "^1.17.0"`): at the next auto-update the machine could pull a version that was published since — hijacked,
|
|
6
|
+
* say — and that nobody on the hub had ever run, into an always-on process.
|
|
7
|
+
*
|
|
8
|
+
* Pure, and free of `node_modules` of its own, so a test can run it on the repo's real `yarn.lock`:
|
|
9
|
+
*
|
|
10
|
+
* - {@link parseYarnLock} reads the entries of a Yarn Berry lockfile (`__metadata: version: 8`);
|
|
11
|
+
* - {@link buildRunnerLock} walks the dependency tree from the runner's own dependencies ({@link runnerRuntimePackages}) and writes an npm
|
|
12
|
+
* lockfile (`lockfileVersion: 3`) with each package at the version `yarn.lock` resolved, from the registry URL npm would use. OPTIONAL dependencies
|
|
13
|
+
* are left out (`ssh2` has two native add-ons, `cpu-features` and `nan`: it falls back to JavaScript without them, and `--ignore-scripts` would not
|
|
14
|
+
* build them anyway), and so is the `node-gyp` that Yarn adds by itself to packages with a `binding.gyp`. A package that would need two versions
|
|
15
|
+
* (a nested `node_modules`) is refused — the runner's tree has none, and a flat lock stays easy to read;
|
|
16
|
+
* - the integrity hash of each package is NOT in `yarn.lock` (its checksums cover Yarn's own archives): `yarn runner-lock` fetches them once from
|
|
17
|
+
* the registry and keeps them, so the committed file pins the tarballs and not only the versions;
|
|
18
|
+
* - {@link renderRunnerPackageJson} is the `package.json` the runner gets: the hub's own, cut down to the runner's dependencies.
|
|
19
|
+
*
|
|
20
|
+
* The committed file is `remoteRun/runner-package-lock.json`; a unit test fails when it no longer matches `yarn.lock` and `package.json`.
|
|
21
|
+
*/
|
|
22
|
+
/** The runner program's runtime dependencies, as the hub's `package.json` names them (a unit test checks them against what the runner's code imports). */
|
|
23
|
+
export declare const runnerRuntimePackages: readonly string[];
|
|
24
|
+
/** Where the hub's package keeps the lock, next to `runner.sh`; the package ships it as `package-lock.json`. */
|
|
25
|
+
export declare const runnerLockRelativePath = "remoteRun/runner-package-lock.json";
|
|
26
|
+
export declare const registryUrl = "https://registry.npmjs.org";
|
|
27
|
+
/** The version the committed lock carries for the package itself: the hub's real one changes with every release, and the packer writes it in ({@link renderRunnerLockForPackage}). */
|
|
28
|
+
export declare const committedLockVersion = "0.0.0";
|
|
29
|
+
/** One entry of `yarn.lock`: what the runner's lock needs of it. */
|
|
30
|
+
export interface YarnLockEntry {
|
|
31
|
+
version: string;
|
|
32
|
+
/** `name@npm:version` for a package of the registry; anything else (a workspace, a patch, a git repository) is not one. */
|
|
33
|
+
resolution: string;
|
|
34
|
+
/** The dependencies as written (`name` → `npm:^1.0.0`). */
|
|
35
|
+
dependencies: Record<string, string>;
|
|
36
|
+
/** The names of dependencies that are optional. */
|
|
37
|
+
optionalDependencyNames: string[];
|
|
38
|
+
hasPeerDependencies: boolean;
|
|
39
|
+
}
|
|
40
|
+
declare const npmLockPackageSchema: z.ZodObject<{
|
|
41
|
+
name: z.ZodOptional<z.ZodString>;
|
|
42
|
+
version: z.ZodOptional<z.ZodString>;
|
|
43
|
+
resolved: z.ZodOptional<z.ZodString>;
|
|
44
|
+
integrity: z.ZodOptional<z.ZodString>;
|
|
45
|
+
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
46
|
+
engines: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
/** @name NpmLockPackage @description One `packages` entry of an npm lockfile as the runner's lock writes it. */
|
|
49
|
+
export type NpmLockPackage = z.infer<typeof npmLockPackageSchema>;
|
|
50
|
+
declare const npmLockfileSchema: z.ZodObject<{
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
version: z.ZodString;
|
|
53
|
+
lockfileVersion: z.ZodNumber;
|
|
54
|
+
requires: z.ZodBoolean;
|
|
55
|
+
packages: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
56
|
+
name: z.ZodOptional<z.ZodString>;
|
|
57
|
+
version: z.ZodOptional<z.ZodString>;
|
|
58
|
+
resolved: z.ZodOptional<z.ZodString>;
|
|
59
|
+
integrity: z.ZodOptional<z.ZodString>;
|
|
60
|
+
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
61
|
+
engines: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
/** @name NpmLockfile @description The npm lockfile (`lockfileVersion` 3) as the runner's lock writes it. */
|
|
65
|
+
export type NpmLockfile = z.infer<typeof npmLockfileSchema>;
|
|
66
|
+
declare const rootPackageJsonSchema: z.ZodObject<{
|
|
67
|
+
name: z.ZodString;
|
|
68
|
+
version: z.ZodString;
|
|
69
|
+
license: z.ZodOptional<z.ZodString>;
|
|
70
|
+
dependencies: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
71
|
+
engines: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
/** @name RootPackageJson @description What the runner's `package.json` is cut from: the hub's own. */
|
|
74
|
+
export type RootPackageJson = z.infer<typeof rootPackageJsonSchema>;
|
|
75
|
+
/** @description The hub's `package.json` text as the parts the runner's package needs of it; throws when it is not what the packer expects. */
|
|
76
|
+
export declare function parseRootPackageJson(text: string): RootPackageJson;
|
|
77
|
+
/** @description The text of a runner lock file; throws when it is not an npm lockfile. */
|
|
78
|
+
export declare function parseRunnerLock(text: string): NpmLockfile;
|
|
79
|
+
/**
|
|
80
|
+
* @description The entries of a Yarn Berry `yarn.lock`, by descriptor (`ssh2@npm:^1.17.0`): an entry that serves several descriptors is found under each.
|
|
81
|
+
* Only what the runner's lock needs is kept. Throws when the text is not that format.
|
|
82
|
+
*/
|
|
83
|
+
export declare function parseYarnLock(text: string): Map<string, YarnLockEntry>;
|
|
84
|
+
/** The tarball of a registry package, where npm looks for it: `<registry>/<name>/-/<last part of name>-<version>.tgz`. */
|
|
85
|
+
export declare function getRegistryTarballUrl(name: string, version: string): string;
|
|
86
|
+
/** The key of a package's integrity in the map `buildRunnerLock` takes. */
|
|
87
|
+
export declare function getIntegrityKey(name: string, version: string): string;
|
|
88
|
+
export interface BuildRunnerLockInputs {
|
|
89
|
+
yarnLockText: string;
|
|
90
|
+
rootPackageJson: RootPackageJson;
|
|
91
|
+
/** The runner's direct dependencies; default {@link runnerRuntimePackages}. */
|
|
92
|
+
packageNames?: readonly string[];
|
|
93
|
+
/** Integrity hashes already known, by {@link getIntegrityKey}; a package without one is written without. */
|
|
94
|
+
integrities?: Readonly<Record<string, string>>;
|
|
95
|
+
}
|
|
96
|
+
/** @description The runner's npm lockfile for `inputs`: see the head of the file. Throws, saying what is wrong, when the tree cannot be written flat. */
|
|
97
|
+
export declare function buildRunnerLock(inputs: BuildRunnerLockInputs): NpmLockfile;
|
|
98
|
+
/** @description The lockfile as it is written to disk: two-space JSON and a final newline, deterministic. */
|
|
99
|
+
export declare function renderRunnerLock(lock: NpmLockfile): string;
|
|
100
|
+
/** @description The runner's direct dependencies as the lock records them (`packages[""].dependencies`). */
|
|
101
|
+
export declare function readRunnerLockRootDependencies(lock: NpmLockfile): Record<string, string>;
|
|
102
|
+
/** @description The integrity hashes a lock already holds, by {@link getIntegrityKey}: what a regeneration keeps for a package whose version has not moved. */
|
|
103
|
+
export declare function readLockIntegrities(lock: NpmLockfile): Record<string, string>;
|
|
104
|
+
/**
|
|
105
|
+
* @description The `package.json` the runner gets: the hub's own name, version and engines, and ONLY the dependencies the lock records — each at
|
|
106
|
+
* the range the lock records, which must be the hub's own. Throws when the lock no longer matches the hub's `package.json`.
|
|
107
|
+
*/
|
|
108
|
+
export declare function renderRunnerPackageJson(rootPackageJson: RootPackageJson, lock: NpmLockfile): string;
|
|
109
|
+
/** @description The lock with the hub's own name and version on it — they change with every release, and the committed file must not. */
|
|
110
|
+
export declare function renderRunnerLockForPackage(lock: NpmLockfile, rootPackageJson: RootPackageJson): string;
|
|
111
|
+
export {};
|
|
112
|
+
//# sourceMappingURL=runnerLock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runnerLock.d.ts","sourceRoot":"","sources":["../../src/runners/runnerLock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,0JAA0J;AAC1J,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAAoB,CAAC;AACxE,gHAAgH;AAChH,eAAO,MAAM,sBAAsB,uCAAuC,CAAC;AAC3E,eAAO,MAAM,WAAW,+BAA+B,CAAC;AAOxD,sLAAsL;AACtL,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAE5C,oEAAoE;AACpE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,2HAA2H;IAC3H,UAAU,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,mDAAmD;IACnD,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAID,QAAA,MAAM,oBAAoB;;;;;;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