charness 3.6.0 → 3.7.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 +274 -0
- package/DEVELOPMENT.md +31 -5
- package/MIGRATION_RENAME_TO_CHARNESS.md +3 -2
- package/README.md +84 -782
- package/SETUP.md +37 -10
- package/agent-plugin/.claude-plugin/plugin.json +7 -0
- package/agent-plugin/README.md +35 -0
- package/agent-plugin/skills/charness-delegate-claude/SKILL.md +85 -0
- package/agent-plugin/skills/charness-delegate-claude/summarize-events.py +90 -0
- package/agent-plugin/skills/charness-delegate-opencode/SKILL.md +68 -0
- package/agent-plugin/skills/charness-manager/SKILL.md +152 -0
- package/dist/adapters/adapterNames.d.ts +6 -0
- package/dist/adapters/adapterNames.d.ts.map +1 -1
- package/dist/adapters/adapterNames.js +8 -2
- package/dist/adapters/adapterNames.js.map +1 -1
- package/dist/adapters/claudeCliAdapter.d.ts +8 -0
- package/dist/adapters/claudeCliAdapter.d.ts.map +1 -1
- package/dist/adapters/claudeCliAdapter.js +42 -5
- package/dist/adapters/claudeCliAdapter.js.map +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.d.ts +10 -9
- package/dist/adapters/claudeJsonStreamAdapter.d.ts.map +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.js +53 -55
- package/dist/adapters/claudeJsonStreamAdapter.js.map +1 -1
- package/dist/adapters/createAdapter.d.ts +8 -0
- package/dist/adapters/createAdapter.d.ts.map +1 -1
- package/dist/adapters/createAdapter.js +14 -2
- package/dist/adapters/createAdapter.js.map +1 -1
- package/dist/adapters/openCodeAdapter.d.ts +43 -6
- package/dist/adapters/openCodeAdapter.d.ts.map +1 -1
- package/dist/adapters/openCodeAdapter.js +95 -6
- package/dist/adapters/openCodeAdapter.js.map +1 -1
- package/dist/agentLogin/agentLogin.d.ts +1 -1
- package/dist/agentLogin/agentLogin.d.ts.map +1 -1
- package/dist/apiRetryKick.d.ts +4 -3
- package/dist/apiRetryKick.d.ts.map +1 -1
- package/dist/apiRetryKick.js +16 -9
- package/dist/apiRetryKick.js.map +1 -1
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +1313 -381
- package/dist/bot.js.map +1 -1
- package/dist/cli/claudeProfiles.d.ts +11 -6
- package/dist/cli/claudeProfiles.d.ts.map +1 -1
- package/dist/cli/claudeProfiles.js +50 -22
- package/dist/cli/claudeProfiles.js.map +1 -1
- package/dist/cli/hot.d.ts +5 -0
- package/dist/cli/hot.d.ts.map +1 -1
- package/dist/cli/hot.js +71 -25
- package/dist/cli/hot.js.map +1 -1
- package/dist/cli/tscWatchGuard.d.ts +95 -0
- package/dist/cli/tscWatchGuard.d.ts.map +1 -0
- package/dist/cli/tscWatchGuard.js +295 -0
- package/dist/cli/tscWatchGuard.js.map +1 -0
- package/dist/cli.js +12 -1
- package/dist/cli.js.map +1 -1
- package/dist/connectors/jira/answerSink.d.ts +10 -0
- package/dist/connectors/jira/answerSink.d.ts.map +1 -1
- package/dist/connectors/jira/answerSink.js +13 -0
- package/dist/connectors/jira/answerSink.js.map +1 -1
- package/dist/connectors/jira/config.d.ts +2 -0
- package/dist/connectors/jira/config.d.ts.map +1 -1
- package/dist/connectors/jira/config.js +9 -1
- package/dist/connectors/jira/config.js.map +1 -1
- package/dist/connectors/jira/connector.d.ts +11 -1
- package/dist/connectors/jira/connector.d.ts.map +1 -1
- package/dist/connectors/jira/connector.js +13 -1
- package/dist/connectors/jira/connector.js.map +1 -1
- package/dist/connectors/jira/inbound.d.ts +29 -4
- package/dist/connectors/jira/inbound.d.ts.map +1 -1
- package/dist/connectors/jira/inbound.js +71 -8
- package/dist/connectors/jira/inbound.js.map +1 -1
- package/dist/connectors/jira/issueBlocks.d.ts +5 -0
- package/dist/connectors/jira/issueBlocks.d.ts.map +1 -1
- package/dist/connectors/jira/issueBlocks.js +11 -0
- package/dist/connectors/jira/issueBlocks.js.map +1 -1
- package/dist/connectors/jira/prompt.d.ts +4 -0
- package/dist/connectors/jira/prompt.d.ts.map +1 -1
- package/dist/connectors/jira/prompt.js +11 -2
- package/dist/connectors/jira/prompt.js.map +1 -1
- package/dist/connectors/telegram/bindPicker.d.ts +5 -0
- package/dist/connectors/telegram/bindPicker.d.ts.map +1 -1
- package/dist/connectors/telegram/bindPicker.js +18 -1
- package/dist/connectors/telegram/bindPicker.js.map +1 -1
- package/dist/connectors/telegram/bindPickerClaims.d.ts +46 -0
- package/dist/connectors/telegram/bindPickerClaims.d.ts.map +1 -0
- package/dist/connectors/telegram/bindPickerClaims.js +83 -0
- package/dist/connectors/telegram/bindPickerClaims.js.map +1 -0
- package/dist/connectors/telegram/bindSweep.d.ts +32 -0
- package/dist/connectors/telegram/bindSweep.d.ts.map +1 -0
- package/dist/connectors/telegram/bindSweep.js +47 -0
- package/dist/connectors/telegram/bindSweep.js.map +1 -0
- package/dist/connectors/telegram/bindingWelcome.d.ts +23 -0
- package/dist/connectors/telegram/bindingWelcome.d.ts.map +1 -0
- package/dist/connectors/telegram/bindingWelcome.js +26 -0
- package/dist/connectors/telegram/bindingWelcome.js.map +1 -0
- package/dist/connectors/telegram/botApiConnection.d.ts +74 -0
- package/dist/connectors/telegram/botApiConnection.d.ts.map +1 -0
- package/dist/connectors/telegram/botApiConnection.js +201 -0
- package/dist/connectors/telegram/botApiConnection.js.map +1 -0
- package/dist/connectors/telegram/commands/botCore.d.ts +8 -2
- package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/botSkills.d.ts +21 -0
- package/dist/connectors/telegram/commands/botSkills.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/botSkills.js +133 -0
- package/dist/connectors/telegram/commands/botSkills.js.map +1 -0
- package/dist/connectors/telegram/commands/callbackMessage.d.ts +5 -0
- package/dist/connectors/telegram/commands/callbackMessage.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/callbackMessage.js +9 -0
- package/dist/connectors/telegram/commands/callbackMessage.js.map +1 -1
- package/dist/connectors/telegram/commands/compaction.d.ts +65 -3
- package/dist/connectors/telegram/commands/compaction.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/compaction.js +512 -94
- package/dist/connectors/telegram/commands/compaction.js.map +1 -1
- package/dist/connectors/telegram/commands/displayModes.d.ts +1 -1
- package/dist/connectors/telegram/commands/displayModes.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/displayModes.js +6 -18
- package/dist/connectors/telegram/commands/displayModes.js.map +1 -1
- package/dist/connectors/telegram/commands/fallbackChain.js +5 -5
- package/dist/connectors/telegram/commands/fallbackChain.js.map +1 -1
- package/dist/connectors/telegram/commands/reminders.d.ts +1 -1
- package/dist/connectors/telegram/commands/reminders.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/reminders.js +4 -15
- package/dist/connectors/telegram/commands/reminders.js.map +1 -1
- package/dist/connectors/telegram/commands/selfUpdate.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/selfUpdate.js +1 -11
- package/dist/connectors/telegram/commands/selfUpdate.js.map +1 -1
- package/dist/connectors/telegram/commands/taskAgents.d.ts +22 -0
- package/dist/connectors/telegram/commands/taskAgents.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/taskAgents.js +104 -0
- package/dist/connectors/telegram/commands/taskAgents.js.map +1 -0
- package/dist/connectors/telegram/commands/todo.d.ts +82 -0
- package/dist/connectors/telegram/commands/todo.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/todo.js +384 -0
- package/dist/connectors/telegram/commands/todo.js.map +1 -0
- package/dist/connectors/telegram/commands/topicCommand.d.ts +6 -2
- package/dist/connectors/telegram/commands/topicCommand.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/topicCommand.js +6 -9
- package/dist/connectors/telegram/commands/topicCommand.js.map +1 -1
- package/dist/connectors/telegram/openBindMessages.d.ts +45 -0
- package/dist/connectors/telegram/openBindMessages.d.ts.map +1 -0
- package/dist/connectors/telegram/openBindMessages.js +67 -0
- package/dist/connectors/telegram/openBindMessages.js.map +1 -0
- package/dist/connectors/telegram/outputFlushPlan.d.ts +49 -0
- package/dist/connectors/telegram/outputFlushPlan.d.ts.map +1 -1
- package/dist/connectors/telegram/outputFlushPlan.js +46 -0
- package/dist/connectors/telegram/outputFlushPlan.js.map +1 -1
- package/dist/connectors/telegram/pendingTopicName.d.ts +26 -0
- package/dist/connectors/telegram/pendingTopicName.d.ts.map +1 -0
- package/dist/connectors/telegram/pendingTopicName.js +27 -0
- package/dist/connectors/telegram/pendingTopicName.js.map +1 -0
- package/dist/connectors/test/connector.d.ts.map +1 -1
- package/dist/connectors/test/connector.js +6 -1
- package/dist/connectors/test/connector.js.map +1 -1
- package/dist/i18n/de.d.ts.map +1 -1
- package/dist/i18n/de.js +90 -7
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +90 -7
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +90 -7
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +90 -7
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/hi.d.ts.map +1 -1
- package/dist/i18n/hi.js +90 -7
- package/dist/i18n/hi.js.map +1 -1
- package/dist/i18n/ja.d.ts.map +1 -1
- package/dist/i18n/ja.js +90 -7
- package/dist/i18n/ja.js.map +1 -1
- package/dist/i18n/ka.d.ts.map +1 -1
- package/dist/i18n/ka.js +90 -7
- package/dist/i18n/ka.js.map +1 -1
- package/dist/i18n/pt.d.ts.map +1 -1
- package/dist/i18n/pt.js +90 -7
- package/dist/i18n/pt.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +90 -7
- package/dist/i18n/ru.js.map +1 -1
- package/dist/i18n/uk.d.ts.map +1 -1
- package/dist/i18n/uk.js +90 -7
- package/dist/i18n/uk.js.map +1 -1
- package/dist/i18n/uz.d.ts.map +1 -1
- package/dist/i18n/uz.js +90 -7
- package/dist/i18n/uz.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +90 -7
- package/dist/i18n/zh.js.map +1 -1
- package/dist/i18n.d.ts +1 -1
- package/dist/i18n.js +1 -1
- package/dist/installManager.d.ts +13 -0
- package/dist/installManager.d.ts.map +1 -1
- package/dist/installManager.js +38 -4
- package/dist/installManager.js.map +1 -1
- package/dist/instanceSettings.d.ts +40 -1
- package/dist/instanceSettings.d.ts.map +1 -1
- package/dist/instanceSettings.js +105 -26
- package/dist/instanceSettings.js.map +1 -1
- package/dist/openCodeQuestionFlow.d.ts +30 -0
- package/dist/openCodeQuestionFlow.d.ts.map +1 -1
- package/dist/openCodeQuestionFlow.js +43 -0
- package/dist/openCodeQuestionFlow.js.map +1 -1
- package/dist/postToSession.d.ts +20 -5
- package/dist/postToSession.d.ts.map +1 -1
- package/dist/postToSession.js +38 -7
- package/dist/postToSession.js.map +1 -1
- package/dist/remoteRun/cliArgs.d.ts +73 -0
- package/dist/remoteRun/cliArgs.d.ts.map +1 -0
- package/dist/remoteRun/cliArgs.js +197 -0
- package/dist/remoteRun/cliArgs.js.map +1 -0
- package/dist/remoteRun/commands.d.ts +56 -0
- package/dist/remoteRun/commands.d.ts.map +1 -0
- package/dist/remoteRun/commands.js +306 -0
- package/dist/remoteRun/commands.js.map +1 -0
- package/dist/remoteRun/depsPlan.d.ts +16 -0
- package/dist/remoteRun/depsPlan.d.ts.map +1 -0
- package/dist/remoteRun/depsPlan.js +82 -0
- package/dist/remoteRun/depsPlan.js.map +1 -0
- package/dist/remoteRun/exitCodes.d.ts +34 -0
- package/dist/remoteRun/exitCodes.d.ts.map +1 -0
- package/dist/remoteRun/exitCodes.js +38 -0
- package/dist/remoteRun/exitCodes.js.map +1 -0
- package/dist/remoteRun/foreground.d.ts +29 -0
- package/dist/remoteRun/foreground.d.ts.map +1 -0
- package/dist/remoteRun/foreground.js +159 -0
- package/dist/remoteRun/foreground.js.map +1 -0
- package/dist/remoteRun/interrupts.d.ts +17 -0
- package/dist/remoteRun/interrupts.d.ts.map +1 -0
- package/dist/remoteRun/interrupts.js +41 -0
- package/dist/remoteRun/interrupts.js.map +1 -0
- package/dist/remoteRun/jobFiles.d.ts +31 -0
- package/dist/remoteRun/jobFiles.d.ts.map +1 -0
- package/dist/remoteRun/jobFiles.js +84 -0
- package/dist/remoteRun/jobFiles.js.map +1 -0
- package/dist/remoteRun/jobFormat.d.ts +16 -0
- package/dist/remoteRun/jobFormat.d.ts.map +1 -0
- package/dist/remoteRun/jobFormat.js +130 -0
- package/dist/remoteRun/jobFormat.js.map +1 -0
- package/dist/remoteRun/jobId.d.ts +15 -0
- package/dist/remoteRun/jobId.d.ts.map +1 -0
- package/dist/remoteRun/jobId.js +85 -0
- package/dist/remoteRun/jobId.js.map +1 -0
- package/dist/remoteRun/jobMeta.d.ts +18 -0
- package/dist/remoteRun/jobMeta.d.ts.map +1 -0
- package/dist/remoteRun/jobMeta.js +33 -0
- package/dist/remoteRun/jobMeta.js.map +1 -0
- package/dist/remoteRun/jobQuery.d.ts +12 -0
- package/dist/remoteRun/jobQuery.d.ts.map +1 -0
- package/dist/remoteRun/jobQuery.js +22 -0
- package/dist/remoteRun/jobQuery.js.map +1 -0
- package/dist/remoteRun/jobRecords.d.ts +22 -0
- package/dist/remoteRun/jobRecords.d.ts.map +1 -0
- package/dist/remoteRun/jobRecords.js +145 -0
- package/dist/remoteRun/jobRecords.js.map +1 -0
- package/dist/remoteRun/jobState.d.ts +62 -0
- package/dist/remoteRun/jobState.d.ts.map +1 -0
- package/dist/remoteRun/jobState.js +132 -0
- package/dist/remoteRun/jobState.js.map +1 -0
- package/dist/remoteRun/leaseTiming.d.ts +18 -0
- package/dist/remoteRun/leaseTiming.d.ts.map +1 -0
- package/dist/remoteRun/leaseTiming.js +43 -0
- package/dist/remoteRun/leaseTiming.js.map +1 -0
- package/dist/remoteRun/output.d.ts +35 -0
- package/dist/remoteRun/output.d.ts.map +1 -0
- package/dist/remoteRun/output.js +82 -0
- package/dist/remoteRun/output.js.map +1 -0
- package/dist/remoteRun/pathPatterns.d.ts +33 -0
- package/dist/remoteRun/pathPatterns.d.ts.map +1 -0
- package/dist/remoteRun/pathPatterns.js +115 -0
- package/dist/remoteRun/pathPatterns.js.map +1 -0
- package/dist/remoteRun/probe.d.ts +56 -0
- package/dist/remoteRun/probe.d.ts.map +1 -0
- package/dist/remoteRun/probe.js +123 -0
- package/dist/remoteRun/probe.js.map +1 -0
- package/dist/remoteRun/project.d.ts +26 -0
- package/dist/remoteRun/project.d.ts.map +1 -0
- package/dist/remoteRun/project.js +159 -0
- package/dist/remoteRun/project.js.map +1 -0
- package/dist/remoteRun/projectConfig.d.ts +38 -0
- package/dist/remoteRun/projectConfig.d.ts.map +1 -0
- package/dist/remoteRun/projectConfig.js +87 -0
- package/dist/remoteRun/projectConfig.js.map +1 -0
- package/dist/remoteRun/remoteRunCli.d.ts +15 -0
- package/dist/remoteRun/remoteRunCli.d.ts.map +1 -0
- package/dist/remoteRun/remoteRunCli.js +144 -0
- package/dist/remoteRun/remoteRunCli.js.map +1 -0
- package/dist/remoteRun/remoteRunError.d.ts +14 -0
- package/dist/remoteRun/remoteRunError.d.ts.map +1 -0
- package/dist/remoteRun/remoteRunError.js +28 -0
- package/dist/remoteRun/remoteRunError.js.map +1 -0
- package/dist/remoteRun/rsync.d.ts +17 -0
- package/dist/remoteRun/rsync.d.ts.map +1 -0
- package/dist/remoteRun/rsync.js +39 -0
- package/dist/remoteRun/rsync.js.map +1 -0
- package/dist/remoteRun/runnerClient.d.ts +50 -0
- package/dist/remoteRun/runnerClient.d.ts.map +1 -0
- package/dist/remoteRun/runnerClient.js +139 -0
- package/dist/remoteRun/runnerClient.js.map +1 -0
- package/dist/remoteRun/runners.d.ts +57 -0
- package/dist/remoteRun/runners.d.ts.map +1 -0
- package/dist/remoteRun/runners.js +181 -0
- package/dist/remoteRun/runners.js.map +1 -0
- package/dist/remoteRun/runnersConfig.d.ts +44 -0
- package/dist/remoteRun/runnersConfig.d.ts.map +1 -0
- package/dist/remoteRun/runnersConfig.js +107 -0
- package/dist/remoteRun/runnersConfig.js.map +1 -0
- package/dist/remoteRun/safeCopy.d.ts +31 -0
- package/dist/remoteRun/safeCopy.d.ts.map +1 -0
- package/dist/remoteRun/safeCopy.js +137 -0
- package/dist/remoteRun/safeCopy.js.map +1 -0
- package/dist/remoteRun/sendPlan.d.ts +67 -0
- package/dist/remoteRun/sendPlan.d.ts.map +1 -0
- package/dist/remoteRun/sendPlan.js +139 -0
- package/dist/remoteRun/sendPlan.js.map +1 -0
- package/dist/remoteRun/ssh.d.ts +62 -0
- package/dist/remoteRun/ssh.d.ts.map +1 -0
- package/dist/remoteRun/ssh.js +202 -0
- package/dist/remoteRun/ssh.js.map +1 -0
- package/dist/remoteRun/submit.d.ts +29 -0
- package/dist/remoteRun/submit.d.ts.map +1 -0
- package/dist/remoteRun/submit.js +142 -0
- package/dist/remoteRun/submit.js.map +1 -0
- package/dist/requests/answerRequest.d.ts +5 -0
- package/dist/requests/answerRequest.d.ts.map +1 -1
- package/dist/requests/answerRequest.js +16 -1
- package/dist/requests/answerRequest.js.map +1 -1
- package/dist/requests/requestLedger.d.ts +13 -0
- package/dist/requests/requestLedger.d.ts.map +1 -1
- package/dist/requests/requestLedger.js +9 -0
- package/dist/requests/requestLedger.js.map +1 -1
- package/dist/requests/topicRequestSettle.d.ts +30 -0
- package/dist/requests/topicRequestSettle.d.ts.map +1 -0
- package/dist/requests/topicRequestSettle.js +23 -0
- package/dist/requests/topicRequestSettle.js.map +1 -0
- package/dist/requests/wakeUpEngine.d.ts +4 -0
- package/dist/requests/wakeUpEngine.d.ts.map +1 -1
- package/dist/requests/wakeUpEngine.js +5 -1
- package/dist/requests/wakeUpEngine.js.map +1 -1
- package/dist/scheduler/delivery.d.ts +2 -0
- package/dist/scheduler/delivery.d.ts.map +1 -1
- package/dist/scheduler/delivery.js +8 -4
- package/dist/scheduler/delivery.js.map +1 -1
- package/dist/scheduler/mcpSurface.d.ts +59 -10
- package/dist/scheduler/mcpSurface.d.ts.map +1 -1
- package/dist/scheduler/mcpSurface.js +276 -79
- package/dist/scheduler/mcpSurface.js.map +1 -1
- package/dist/scheduler/recurrence.d.ts +5 -0
- package/dist/scheduler/recurrence.d.ts.map +1 -1
- package/dist/scheduler/recurrence.js +12 -2
- package/dist/scheduler/recurrence.js.map +1 -1
- package/dist/scheduler/strictToolInput.d.ts +45 -0
- package/dist/scheduler/strictToolInput.d.ts.map +1 -0
- package/dist/scheduler/strictToolInput.js +155 -0
- package/dist/scheduler/strictToolInput.js.map +1 -0
- package/dist/scheduler/types.d.ts +5 -0
- package/dist/scheduler/types.d.ts.map +1 -1
- package/dist/scheduler/workerWatch.d.ts +23 -0
- package/dist/scheduler/workerWatch.d.ts.map +1 -0
- package/dist/scheduler/workerWatch.js +26 -0
- package/dist/scheduler/workerWatch.js.map +1 -0
- package/dist/selfUpdate/emittedSource.d.ts +11 -0
- package/dist/selfUpdate/emittedSource.d.ts.map +1 -0
- package/dist/selfUpdate/emittedSource.js +24 -0
- package/dist/selfUpdate/emittedSource.js.map +1 -0
- package/dist/selfUpdate/gitSource.d.ts +0 -6
- package/dist/selfUpdate/gitSource.d.ts.map +1 -1
- package/dist/selfUpdate/gitSource.js +2 -18
- package/dist/selfUpdate/gitSource.js.map +1 -1
- package/dist/selfUpdate/updatePending.d.ts +1 -1
- package/dist/sendErrorClassifier.d.ts +10 -0
- package/dist/sendErrorClassifier.d.ts.map +1 -1
- package/dist/sendErrorClassifier.js +22 -0
- package/dist/sendErrorClassifier.js.map +1 -1
- package/dist/state.d.ts +78 -7
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +125 -8
- package/dist/state.js.map +1 -1
- package/dist/stateFile.d.ts +9 -0
- package/dist/stateFile.d.ts.map +1 -0
- package/dist/stateFile.js +57 -0
- package/dist/stateFile.js.map +1 -0
- package/dist/stt/sttInstall.d.ts +7 -3
- package/dist/stt/sttInstall.d.ts.map +1 -1
- package/dist/stt/sttInstall.js +8 -4
- package/dist/stt/sttInstall.js.map +1 -1
- package/dist/stt/sttSettings.d.ts +2 -1
- package/dist/stt/sttSettings.d.ts.map +1 -1
- package/dist/stt/sttSettings.js +3 -2
- package/dist/stt/sttSettings.js.map +1 -1
- package/dist/stt/transcribeChain.js +2 -0
- package/dist/stt/transcribeChain.js.map +1 -1
- package/dist/testTimings.d.ts +13 -3
- package/dist/testTimings.d.ts.map +1 -1
- package/dist/testTimings.js +26 -2
- package/dist/testTimings.js.map +1 -1
- package/dist/todos/board.d.ts +83 -0
- package/dist/todos/board.d.ts.map +1 -0
- package/dist/todos/board.js +227 -0
- package/dist/todos/board.js.map +1 -0
- package/dist/todos/format.d.ts +33 -0
- package/dist/todos/format.d.ts.map +1 -0
- package/dist/todos/format.js +90 -0
- package/dist/todos/format.js.map +1 -0
- package/dist/todos/merge.d.ts +46 -0
- package/dist/todos/merge.d.ts.map +1 -0
- package/dist/todos/merge.js +137 -0
- package/dist/todos/merge.js.map +1 -0
- package/dist/todos/midTurn.d.ts +75 -0
- package/dist/todos/midTurn.d.ts.map +1 -0
- package/dist/todos/midTurn.js +214 -0
- package/dist/todos/midTurn.js.map +1 -0
- package/dist/todos/nag.d.ts +85 -0
- package/dist/todos/nag.d.ts.map +1 -0
- package/dist/todos/nag.js +103 -0
- package/dist/todos/nag.js.map +1 -0
- package/dist/todos/order.d.ts +25 -0
- package/dist/todos/order.d.ts.map +1 -0
- package/dist/todos/order.js +61 -0
- package/dist/todos/order.js.map +1 -0
- package/dist/todos/projects.d.ts +102 -0
- package/dist/todos/projects.d.ts.map +1 -0
- package/dist/todos/projects.js +342 -0
- package/dist/todos/projects.js.map +1 -0
- package/dist/todos/registry.d.ts +64 -0
- package/dist/todos/registry.d.ts.map +1 -0
- package/dist/todos/registry.js +116 -0
- package/dist/todos/registry.js.map +1 -0
- package/dist/todos/reminderEngine.d.ts +78 -0
- package/dist/todos/reminderEngine.d.ts.map +1 -0
- package/dist/todos/reminderEngine.js +162 -0
- package/dist/todos/reminderEngine.js.map +1 -0
- package/dist/todos/store.d.ts +34 -0
- package/dist/todos/store.d.ts.map +1 -0
- package/dist/todos/store.js +208 -0
- package/dist/todos/store.js.map +1 -0
- package/dist/todos/tools.d.ts +26 -0
- package/dist/todos/tools.d.ts.map +1 -0
- package/dist/todos/tools.js +25 -0
- package/dist/todos/tools.js.map +1 -0
- package/dist/todos/types.d.ts +85 -0
- package/dist/todos/types.d.ts.map +1 -0
- package/dist/todos/types.js +30 -0
- package/dist/todos/types.js.map +1 -0
- package/dist/trackers/taskAgentLimit.d.ts +58 -0
- package/dist/trackers/taskAgentLimit.d.ts.map +1 -0
- package/dist/trackers/taskAgentLimit.js +62 -0
- package/dist/trackers/taskAgentLimit.js.map +1 -0
- package/dist/trackers/taskAgentSlots.d.ts +109 -0
- package/dist/trackers/taskAgentSlots.d.ts.map +1 -0
- package/dist/trackers/taskAgentSlots.js +227 -0
- package/dist/trackers/taskAgentSlots.js.map +1 -0
- package/dist/trackers/types.d.ts +14 -0
- package/dist/trackers/types.d.ts.map +1 -0
- package/dist/trackers/types.js +3 -0
- package/dist/trackers/types.js.map +1 -0
- package/dist/types.d.ts +80 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/adoptReplayGate.d.ts +16 -0
- package/dist/utils/adoptReplayGate.d.ts.map +1 -0
- package/dist/utils/adoptReplayGate.js +35 -0
- package/dist/utils/adoptReplayGate.js.map +1 -0
- package/dist/utils/agentPlugin.d.ts +113 -0
- package/dist/utils/agentPlugin.d.ts.map +1 -0
- package/dist/utils/agentPlugin.js +192 -0
- package/dist/utils/agentPlugin.js.map +1 -0
- package/dist/utils/autoContinueOnLimit.d.ts +7 -4
- package/dist/utils/autoContinueOnLimit.d.ts.map +1 -1
- package/dist/utils/autoContinueOnLimit.js +8 -5
- package/dist/utils/autoContinueOnLimit.js.map +1 -1
- package/dist/utils/botSkills.d.ts +62 -0
- package/dist/utils/botSkills.d.ts.map +1 -0
- package/dist/utils/botSkills.js +53 -0
- package/dist/utils/botSkills.js.map +1 -0
- package/dist/utils/botSkillsSetting.d.ts +7 -0
- package/dist/utils/botSkillsSetting.d.ts.map +1 -0
- package/dist/utils/botSkillsSetting.js +9 -0
- package/dist/utils/botSkillsSetting.js.map +1 -0
- package/dist/utils/claudeCodeVersion.d.ts +7 -0
- package/dist/utils/claudeCodeVersion.d.ts.map +1 -1
- package/dist/utils/claudeCodeVersion.js +14 -1
- package/dist/utils/claudeCodeVersion.js.map +1 -1
- package/dist/utils/claudeCompactHook.d.ts +33 -15
- package/dist/utils/claudeCompactHook.d.ts.map +1 -1
- package/dist/utils/claudeCompactHook.js +36 -17
- package/dist/utils/claudeCompactHook.js.map +1 -1
- package/dist/utils/claudeCompactSummary.d.ts +15 -0
- package/dist/utils/claudeCompactSummary.d.ts.map +1 -0
- package/dist/utils/claudeCompactSummary.js +96 -0
- package/dist/utils/claudeCompactSummary.js.map +1 -0
- package/dist/utils/claudeLimitSwitch.d.ts +11 -9
- package/dist/utils/claudeLimitSwitch.d.ts.map +1 -1
- package/dist/utils/claudeLimitSwitch.js +18 -16
- package/dist/utils/claudeLimitSwitch.js.map +1 -1
- package/dist/utils/claudeProfiles.d.ts +5 -0
- package/dist/utils/claudeProfiles.d.ts.map +1 -1
- package/dist/utils/claudeProfiles.js +14 -0
- package/dist/utils/claudeProfiles.js.map +1 -1
- package/dist/utils/claudeSessionTitle.d.ts +2 -1
- package/dist/utils/claudeSessionTitle.d.ts.map +1 -1
- package/dist/utils/claudeSessionTitle.js +14 -14
- package/dist/utils/claudeSessionTitle.js.map +1 -1
- package/dist/utils/claudeUsage.d.ts +95 -15
- package/dist/utils/claudeUsage.d.ts.map +1 -1
- package/dist/utils/claudeUsage.js +241 -41
- package/dist/utils/claudeUsage.js.map +1 -1
- package/dist/utils/claudeUsageRefresher.d.ts +10 -0
- package/dist/utils/claudeUsageRefresher.d.ts.map +1 -1
- package/dist/utils/claudeUsageRefresher.js +11 -0
- package/dist/utils/claudeUsageRefresher.js.map +1 -1
- package/dist/utils/claudeUserEntry.d.ts +50 -0
- package/dist/utils/claudeUserEntry.d.ts.map +1 -0
- package/dist/utils/claudeUserEntry.js +120 -0
- package/dist/utils/claudeUserEntry.js.map +1 -0
- package/dist/utils/clearThreadOutputQueues.d.ts +4 -3
- package/dist/utils/clearThreadOutputQueues.d.ts.map +1 -1
- package/dist/utils/clearThreadOutputQueues.js +1 -1
- package/dist/utils/clearThreadOutputQueues.js.map +1 -1
- package/dist/utils/compactOnIdle.d.ts +33 -13
- package/dist/utils/compactOnIdle.d.ts.map +1 -1
- package/dist/utils/compactOnIdle.js +35 -15
- package/dist/utils/compactOnIdle.js.map +1 -1
- package/dist/utils/fallbackBridge.d.ts +5 -0
- package/dist/utils/fallbackBridge.d.ts.map +1 -1
- package/dist/utils/fallbackBridge.js +19 -3
- package/dist/utils/fallbackBridge.js.map +1 -1
- package/dist/utils/fallbackChain.d.ts +9 -3
- package/dist/utils/fallbackChain.d.ts.map +1 -1
- package/dist/utils/fallbackChain.js +21 -3
- package/dist/utils/fallbackChain.js.map +1 -1
- package/dist/utils/fileSendPlan.d.ts +6 -0
- package/dist/utils/fileSendPlan.d.ts.map +1 -1
- package/dist/utils/fileSendPlan.js +11 -0
- package/dist/utils/fileSendPlan.js.map +1 -1
- package/dist/utils/fileSendService.d.ts +7 -1
- package/dist/utils/fileSendService.d.ts.map +1 -1
- package/dist/utils/fileSendService.js +6 -2
- package/dist/utils/fileSendService.js.map +1 -1
- package/dist/utils/groupFinalizePlan.d.ts +8 -10
- package/dist/utils/groupFinalizePlan.d.ts.map +1 -1
- package/dist/utils/groupFinalizePlan.js +8 -12
- package/dist/utils/groupFinalizePlan.js.map +1 -1
- package/dist/utils/jsonStreamHost.d.ts +13 -0
- package/dist/utils/jsonStreamHost.d.ts.map +1 -1
- package/dist/utils/jsonStreamHost.js +13 -0
- package/dist/utils/jsonStreamHost.js.map +1 -1
- package/dist/utils/messageSendService.d.ts +5 -3
- package/dist/utils/messageSendService.d.ts.map +1 -1
- package/dist/utils/messageSendService.js +12 -5
- package/dist/utils/messageSendService.js.map +1 -1
- package/dist/utils/openCodeCompactPlugin.d.ts +39 -14
- package/dist/utils/openCodeCompactPlugin.d.ts.map +1 -1
- package/dist/utils/openCodeCompactPlugin.js +106 -38
- package/dist/utils/openCodeCompactPlugin.js.map +1 -1
- package/dist/utils/promptDelivery.d.ts +29 -12
- package/dist/utils/promptDelivery.d.ts.map +1 -1
- package/dist/utils/promptDelivery.js +13 -5
- package/dist/utils/promptDelivery.js.map +1 -1
- package/dist/utils/sentKindsSummary.d.ts +10 -0
- package/dist/utils/sentKindsSummary.d.ts.map +1 -0
- package/dist/utils/sentKindsSummary.js +18 -0
- package/dist/utils/sentKindsSummary.js.map +1 -0
- package/dist/utils/telegramError.d.ts +6 -0
- package/dist/utils/telegramError.d.ts.map +1 -1
- package/dist/utils/telegramError.js +12 -0
- package/dist/utils/telegramError.js.map +1 -1
- package/dist/utils/topicView.d.ts +1 -1
- package/dist/utils/topicView.js +1 -1
- package/dist/utils/transcribeAudio.d.ts +10 -0
- package/dist/utils/transcribeAudio.d.ts.map +1 -1
- package/dist/utils/transcribeAudio.js +22 -3
- package/dist/utils/transcribeAudio.js.map +1 -1
- package/dist/utils/transcriptErrorTime.d.ts +8 -0
- package/dist/utils/transcriptErrorTime.d.ts.map +1 -0
- package/dist/utils/transcriptErrorTime.js +56 -0
- package/dist/utils/transcriptErrorTime.js.map +1 -0
- package/dist/utils/wedgeRecovery.d.ts +2 -0
- package/dist/utils/wedgeRecovery.d.ts.map +1 -1
- package/dist/utils/wedgeRecovery.js +1 -1
- package/dist/utils/wedgeRecovery.js.map +1 -1
- package/package.json +11 -3
- package/remoteRun/runner.sh +1242 -0
- package/stt/gigaam_sidecar.py +555 -50
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.runRunCommand = runRunCommand;
|
|
37
|
+
exports.runRunnersCommand = runRunnersCommand;
|
|
38
|
+
exports.runLsCommand = runLsCommand;
|
|
39
|
+
exports.runStatusCommand = runStatusCommand;
|
|
40
|
+
exports.runLogsCommand = runLogsCommand;
|
|
41
|
+
exports.waitForJob = waitForJob;
|
|
42
|
+
exports.runWaitCommand = runWaitCommand;
|
|
43
|
+
exports.runFetchCommand = runFetchCommand;
|
|
44
|
+
exports.runKillCommand = runKillCommand;
|
|
45
|
+
exports.describeKillResult = describeKillResult;
|
|
46
|
+
exports.runExecCommand = runExecCommand;
|
|
47
|
+
const fs = __importStar(require("fs"));
|
|
48
|
+
const os = __importStar(require("os"));
|
|
49
|
+
const path = __importStar(require("path"));
|
|
50
|
+
const zod_1 = require("zod");
|
|
51
|
+
const exitCodes_1 = require("./exitCodes");
|
|
52
|
+
const interrupts_1 = require("./interrupts");
|
|
53
|
+
const foreground_1 = require("./foreground");
|
|
54
|
+
const jobFiles_1 = require("./jobFiles");
|
|
55
|
+
const jobFormat_1 = require("./jobFormat");
|
|
56
|
+
const jobId_1 = require("./jobId");
|
|
57
|
+
const jobMeta_1 = require("./jobMeta");
|
|
58
|
+
const jobRecords_1 = require("./jobRecords");
|
|
59
|
+
const jobQuery_1 = require("./jobQuery");
|
|
60
|
+
const jobState_1 = require("./jobState");
|
|
61
|
+
const output_1 = require("./output");
|
|
62
|
+
const probe_1 = require("./probe");
|
|
63
|
+
const project_1 = require("./project");
|
|
64
|
+
const remoteRunError_1 = require("./remoteRunError");
|
|
65
|
+
const runnerClient_1 = require("./runnerClient");
|
|
66
|
+
const runners_1 = require("./runners");
|
|
67
|
+
const ssh_1 = require("./ssh");
|
|
68
|
+
const submit_1 = require("./submit");
|
|
69
|
+
/** The last lines of a finished job's log that `wait` prints. */
|
|
70
|
+
const waitTailLines = 50;
|
|
71
|
+
/** `wait` holds one ssh session for as long as the job runs; a dropped one is opened again this many times before it gives up. */
|
|
72
|
+
const waitReconnectAttempts = 5;
|
|
73
|
+
const waitReconnectDelayMs = 3000;
|
|
74
|
+
const jobsListTimeoutMs = 30 * 1000;
|
|
75
|
+
function createClient(context, runnerName) {
|
|
76
|
+
const runner = context.config.runners.find((candidate) => candidate.name === runnerName);
|
|
77
|
+
if (runner === undefined)
|
|
78
|
+
throw new remoteRunError_1.RemoteRunError(`no runner named "${runnerName}" in runners.json (configured: ${context.config.runners.map((candidate) => candidate.name).join(', ')})`, exitCodes_1.remoteRunExitCodes.usage);
|
|
79
|
+
return (0, runnerClient_1.createRunnerClient)(runner, context.cacheDir, context.script);
|
|
80
|
+
}
|
|
81
|
+
/** Probe the runners a command may use and pick one (the named one, or the first that answers and has `needs`). */
|
|
82
|
+
async function chooseClient(context, wanted) {
|
|
83
|
+
const clients = wanted.runner === null
|
|
84
|
+
? context.config.runners.map((runner) => createClient(context, runner.name))
|
|
85
|
+
: [createClient(context, wanted.runner)];
|
|
86
|
+
const reports = await (0, runners_1.probeRunners)(clients, context.now());
|
|
87
|
+
const pick = (0, runners_1.pickRunner)(context.config, reports, wanted);
|
|
88
|
+
if (!pick.ok)
|
|
89
|
+
throw new remoteRunError_1.RemoteRunError(pick.message, pick.exitCode);
|
|
90
|
+
const client = clients.find((candidate) => candidate.runner.name === pick.runnerName);
|
|
91
|
+
if (client === undefined)
|
|
92
|
+
throw new remoteRunError_1.RemoteRunError('the picked runner is not among the candidates');
|
|
93
|
+
return client;
|
|
94
|
+
}
|
|
95
|
+
/** The client of the runner a job id belongs to, with its script in place. */
|
|
96
|
+
async function openJobClient(context, jobId) {
|
|
97
|
+
const parsed = (0, jobId_1.parseJobId)(jobId);
|
|
98
|
+
if (parsed === null)
|
|
99
|
+
throw new remoteRunError_1.RemoteRunError(`"${jobId}" is not a job id`, exitCodes_1.remoteRunExitCodes.usage);
|
|
100
|
+
const client = (0, runnerClient_1.createRunnerClient)((0, runners_1.findRunnerOfJob)(context.config, parsed.runnerName), context.cacheDir, context.script);
|
|
101
|
+
await client.ensureScript();
|
|
102
|
+
return client;
|
|
103
|
+
}
|
|
104
|
+
// ─────────────────────────── run ───────────────────────────
|
|
105
|
+
async function runRunCommand(command, context) {
|
|
106
|
+
const { io } = context;
|
|
107
|
+
const project = (0, project_1.getProjectContext)(io.cwd);
|
|
108
|
+
const client = await chooseClient(context, { runner: command.options.runner, needs: command.options.needs });
|
|
109
|
+
const metaDirectory = fs.mkdtempSync(path.join(os.tmpdir(), 'remote-run-'));
|
|
110
|
+
// Before the job exists an interrupt only has the temp files to clean up.
|
|
111
|
+
const removeStagingGuard = (0, interrupts_1.addInterruptHandler)((signal) => {
|
|
112
|
+
fs.rmSync(metaDirectory, { recursive: true, force: true });
|
|
113
|
+
process.exit((0, exitCodes_1.planInterrupt)(signal).exitCode);
|
|
114
|
+
});
|
|
115
|
+
let staged;
|
|
116
|
+
try {
|
|
117
|
+
staged = await (0, submit_1.stageJob)({ client, project, command: command.command, options: command.options, metaDirectory, say: (line) => (0, output_1.sayOwn)(io, line) });
|
|
118
|
+
}
|
|
119
|
+
finally {
|
|
120
|
+
removeStagingGuard();
|
|
121
|
+
fs.rmSync(metaDirectory, { recursive: true, force: true });
|
|
122
|
+
}
|
|
123
|
+
if (command.options.isBackground) {
|
|
124
|
+
await client.callOrThrow('submit', [staged.slug, staged.jobId, staged.group]);
|
|
125
|
+
io.stdout(`${staged.jobId}\n`);
|
|
126
|
+
(0, output_1.sayOwn)(io, `job ${staged.jobId} runs on ${client.runner.name} — \`charness remote-run wait ${staged.jobId}\` blocks until it ends and brings its files back`);
|
|
127
|
+
return 0;
|
|
128
|
+
}
|
|
129
|
+
return (0, foreground_1.followForeground)({ client, staged, target: (0, jobFiles_1.createFetchTarget)(project.root, project.slug, project.config.pull), io, leaseMs: context.leaseMs });
|
|
130
|
+
}
|
|
131
|
+
// ─────────────────────────── runners ───────────────────────────
|
|
132
|
+
async function runRunnersCommand(context) {
|
|
133
|
+
const clients = context.config.runners.map((runner) => (0, runnerClient_1.createRunnerClient)(runner, context.cacheDir, context.script));
|
|
134
|
+
const reports = await (0, runners_1.probeRunners)(clients, context.now());
|
|
135
|
+
context.io.stdout(`${reports.map(probe_1.formatRunnerBlock).join('\n\n')}\n`);
|
|
136
|
+
return 0;
|
|
137
|
+
}
|
|
138
|
+
// ─────────────────────────── ls / status ───────────────────────────
|
|
139
|
+
const jobListSchema = zod_1.z.array(zod_1.z.looseObject({ id: zod_1.z.string(), facts: zod_1.z.string(), meta: zod_1.z.looseObject({}) }));
|
|
140
|
+
async function listRunnerJobs(client, slugFilter) {
|
|
141
|
+
await client.ensureScript();
|
|
142
|
+
const listed = await client.call('jobs', slugFilter === null ? [] : [slugFilter], { timeoutMs: jobsListTimeoutMs });
|
|
143
|
+
if (listed.exitCode !== 0)
|
|
144
|
+
throw new remoteRunError_1.RemoteRunError(`runner "${client.runner.name}": listing jobs failed — ${listed.stderr.trim().split('\n')[0] || 'no output'}`);
|
|
145
|
+
const rows = jobListSchema.parse(JSON.parse(listed.stdout));
|
|
146
|
+
const pueue = await client.call('pueue', ['status', '--json'], { timeoutMs: jobsListTimeoutMs });
|
|
147
|
+
const tasks = pueue.exitCode === 0 ? (0, jobState_1.parsePueueStatus)(pueue.stdout) : [];
|
|
148
|
+
const owner = (0, submit_1.getJobOwner)();
|
|
149
|
+
const entries = [];
|
|
150
|
+
for (const row of rows) {
|
|
151
|
+
const meta = (0, jobMeta_1.parseJobMeta)(JSON.stringify(row.meta));
|
|
152
|
+
if (meta === null || meta.owner !== owner)
|
|
153
|
+
continue;
|
|
154
|
+
const facts = (0, jobState_1.parseJobFacts)(row.facts.replace(/;/g, '\n'));
|
|
155
|
+
const task = tasks.find((candidate) => candidate.label === (0, jobId_1.getJobLabel)(row.id)) ?? null;
|
|
156
|
+
entries.push({ meta, facts, outcome: (0, jobState_1.describeJobOutcome)(facts, task) });
|
|
157
|
+
}
|
|
158
|
+
return entries;
|
|
159
|
+
}
|
|
160
|
+
async function runLsCommand(command, context) {
|
|
161
|
+
const { io } = context;
|
|
162
|
+
const slugFilter = command.isAll ? null : (0, project_1.getProjectContext)(io.cwd).slug;
|
|
163
|
+
const clients = context.config.runners.map((runner) => (0, runnerClient_1.createRunnerClient)(runner, context.cacheDir, context.script));
|
|
164
|
+
const results = await Promise.all(clients.map(async (client) => {
|
|
165
|
+
try {
|
|
166
|
+
return { client, entries: await listRunnerJobs(client, slugFilter), problem: null };
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
const problem = error instanceof remoteRunError_1.RunnerUnreachableError ? `unreachable (${error.reason})` : error instanceof Error ? error.message : 'failed';
|
|
170
|
+
return { client, entries: [], problem };
|
|
171
|
+
}
|
|
172
|
+
}));
|
|
173
|
+
for (const result of results) {
|
|
174
|
+
if (result.problem !== null)
|
|
175
|
+
(0, output_1.sayOwn)(io, `runner ${result.client.runner.name}: ${result.problem}`);
|
|
176
|
+
}
|
|
177
|
+
const lines = (0, jobFormat_1.formatJobList)(results.flatMap((result) => result.entries), context.now());
|
|
178
|
+
if (lines.length === 0)
|
|
179
|
+
(0, output_1.sayOwn)(io, command.isAll ? 'no jobs' : 'no jobs of this project');
|
|
180
|
+
else
|
|
181
|
+
io.stdout(`${lines.join('\n')}\n`);
|
|
182
|
+
return 0;
|
|
183
|
+
}
|
|
184
|
+
async function runStatusCommand(command, context) {
|
|
185
|
+
const client = await openJobClient(context, command.jobId);
|
|
186
|
+
const meta = (0, jobMeta_1.parseJobMeta)(await client.callOrThrow('meta', ['-', command.jobId]));
|
|
187
|
+
if (meta === null)
|
|
188
|
+
throw new remoteRunError_1.RemoteRunError(`job ${command.jobId} has no readable description on ${client.runner.name} (pruned?)`);
|
|
189
|
+
const { facts, outcome } = await (0, jobQuery_1.readJobOutcome)(client, '-', command.jobId);
|
|
190
|
+
context.io.stdout(`${(0, jobFormat_1.formatJobStatus)({ meta, facts, outcome }, context.now())}\n`);
|
|
191
|
+
return 0;
|
|
192
|
+
}
|
|
193
|
+
// ─────────────────────────── logs ───────────────────────────
|
|
194
|
+
async function runLogsCommand(command, context) {
|
|
195
|
+
const { io } = context;
|
|
196
|
+
const client = await openJobClient(context, command.jobId);
|
|
197
|
+
if (!command.isFollow) {
|
|
198
|
+
const log = await client.callOrThrow('tail', ['-', command.jobId, command.tail === null ? 'all' : `${command.tail}`]);
|
|
199
|
+
const router = (0, output_1.createJobOutputRouter)(io);
|
|
200
|
+
router.write(log);
|
|
201
|
+
router.flush();
|
|
202
|
+
return 0;
|
|
203
|
+
}
|
|
204
|
+
const child = client.stream('follow', ['-', command.jobId, command.tail === null ? 'start' : `tail:${command.tail}`]);
|
|
205
|
+
const router = (0, output_1.createJobOutputRouter)(io);
|
|
206
|
+
child.stdout.setEncoding('utf8');
|
|
207
|
+
child.stdout.on('data', (chunk) => router.write(chunk));
|
|
208
|
+
let stderr = '';
|
|
209
|
+
child.stderr.on('data', (chunk) => { stderr += chunk.toString('utf8'); });
|
|
210
|
+
child.stdin.end();
|
|
211
|
+
let interrupt = null;
|
|
212
|
+
const removeHandler = (0, interrupts_1.addInterruptHandler)((signal) => {
|
|
213
|
+
interrupt ??= signal;
|
|
214
|
+
child.kill('SIGTERM');
|
|
215
|
+
});
|
|
216
|
+
const exitCode = await (0, interrupts_1.waitForChildEnd)(child, () => interrupt !== null);
|
|
217
|
+
removeHandler();
|
|
218
|
+
router.flush();
|
|
219
|
+
// Following is not owning: the job is left as it is.
|
|
220
|
+
if (interrupt !== null)
|
|
221
|
+
return (0, exitCodes_1.planInterrupt)(interrupt).exitCode;
|
|
222
|
+
if (exitCode !== 0)
|
|
223
|
+
throw new remoteRunError_1.RemoteRunError(`following the log of ${command.jobId} failed — ${stderr.trim().split('\n').pop() || `exit ${exitCode}`}`);
|
|
224
|
+
return 0;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* @description Block until the runner says the job is done. A connection that drops is opened again a few times (the job is Pueue's, it
|
|
228
|
+
* keeps running); a refusal of the runner itself — no such job (never submitted, pruned, a submit that failed half-way) — is final and
|
|
229
|
+
* says so at once instead of passing for a bad network. Resolves with the signal that interrupted the wait, if one did.
|
|
230
|
+
*/
|
|
231
|
+
async function waitForJob(client, jobId, retry = { attempts: waitReconnectAttempts, delayMs: waitReconnectDelayMs }) {
|
|
232
|
+
let interrupt = null;
|
|
233
|
+
for (let attempt = 1; attempt <= retry.attempts && interrupt === null; attempt += 1) {
|
|
234
|
+
const child = client.stream('wait', ['-', jobId]);
|
|
235
|
+
child.stdin.end();
|
|
236
|
+
let stderr = '';
|
|
237
|
+
child.stderr.setEncoding('utf8');
|
|
238
|
+
child.stderr.on('data', (chunk) => { stderr += chunk; });
|
|
239
|
+
const removeHandler = (0, interrupts_1.addInterruptHandler)((signal) => {
|
|
240
|
+
interrupt ??= signal;
|
|
241
|
+
child.kill('SIGTERM');
|
|
242
|
+
});
|
|
243
|
+
const exitCode = await (0, interrupts_1.waitForChildEnd)(child, () => interrupt !== null);
|
|
244
|
+
removeHandler();
|
|
245
|
+
if (exitCode === 0 || interrupt !== null)
|
|
246
|
+
return interrupt;
|
|
247
|
+
if (!(0, ssh_1.checkIsConnectionLost)(exitCode))
|
|
248
|
+
throw new remoteRunError_1.RemoteRunError(`runner "${client.runner.name}": ${(0, runnerClient_1.describeRunnerRefusal)(stderr, `wait ended with exit ${exitCode}`)}`);
|
|
249
|
+
if (attempt === retry.attempts)
|
|
250
|
+
throw new remoteRunError_1.RemoteRunError(`lost the connection to ${client.runner.name} while waiting for ${jobId}`);
|
|
251
|
+
await new Promise((resolve) => setTimeout(resolve, retry.delayMs));
|
|
252
|
+
}
|
|
253
|
+
return interrupt;
|
|
254
|
+
}
|
|
255
|
+
async function runWaitCommand(command, context) {
|
|
256
|
+
const { io } = context;
|
|
257
|
+
const client = await openJobClient(context, command.jobId);
|
|
258
|
+
const interrupt = await waitForJob(client, command.jobId);
|
|
259
|
+
if (interrupt !== null)
|
|
260
|
+
return (0, exitCodes_1.planInterrupt)(interrupt).exitCode;
|
|
261
|
+
const { facts, outcome } = await (0, jobQuery_1.readJobOutcome)(client, '-', command.jobId);
|
|
262
|
+
const log = await client.callOrThrow('tail', ['-', command.jobId, `${waitTailLines}`]);
|
|
263
|
+
const router = (0, output_1.createJobOutputRouter)(io);
|
|
264
|
+
router.write(log);
|
|
265
|
+
router.flush();
|
|
266
|
+
try {
|
|
267
|
+
await (0, jobFiles_1.fetchJobFiles)({ client, facts, jobId: command.jobId, target: (0, jobFiles_1.resolveFetchTarget)((0, jobRecords_1.readLocalJobRecord)(context.cacheDir, command.jobId)), io });
|
|
268
|
+
}
|
|
269
|
+
catch (error) {
|
|
270
|
+
(0, output_1.sayOwn)(io, error instanceof remoteRunError_1.RemoteRunError ? error.message : 'the result files could not be fetched');
|
|
271
|
+
}
|
|
272
|
+
return (0, foreground_1.describeEnd)(outcome, command.jobId, io);
|
|
273
|
+
}
|
|
274
|
+
async function runFetchCommand(command, context) {
|
|
275
|
+
const client = await openJobClient(context, command.jobId);
|
|
276
|
+
const { facts, outcome } = await (0, jobQuery_1.readJobOutcome)(client, '-', command.jobId);
|
|
277
|
+
if (outcome.state !== 'done')
|
|
278
|
+
throw new remoteRunError_1.RemoteRunError(`job ${command.jobId} has not finished yet (${outcome.state}) — \`charness remote-run wait ${command.jobId}\` waits for it`);
|
|
279
|
+
if (!facts.isWithArtifacts)
|
|
280
|
+
(0, output_1.sayOwn)(context.io, 'the job left no result files');
|
|
281
|
+
await (0, jobFiles_1.fetchJobFiles)({ client, facts, jobId: command.jobId, target: (0, jobFiles_1.resolveFetchTarget)((0, jobRecords_1.readLocalJobRecord)(context.cacheDir, command.jobId)), io: context.io });
|
|
282
|
+
return 0;
|
|
283
|
+
}
|
|
284
|
+
async function runKillCommand(command, context) {
|
|
285
|
+
const client = await openJobClient(context, command.jobId);
|
|
286
|
+
const result = await client.call('kill', ['-', command.jobId], { timeoutMs: interrupts_1.killCallTimeoutMs });
|
|
287
|
+
if (result.exitCode !== 0)
|
|
288
|
+
throw new remoteRunError_1.RemoteRunError(`killing ${command.jobId} failed — ${result.stderr.trim().split('\n').pop() || `exit ${result.exitCode}`}`);
|
|
289
|
+
(0, output_1.sayOwn)(context.io, describeKillResult(command.jobId, result.stdout));
|
|
290
|
+
return 0;
|
|
291
|
+
}
|
|
292
|
+
/** @description What `kill` tells the user: the runner answers `killed`, or `already-ended <code>` for a job that had finished (nothing was killed then). */
|
|
293
|
+
function describeKillResult(jobId, runnerAnswer) {
|
|
294
|
+
const ended = /^already-ended (\d+)$/m.exec(runnerAnswer);
|
|
295
|
+
return ended === null ? `job ${jobId} killed` : `job ${jobId} had already ended (exit ${ended[1]}) — nothing to kill`;
|
|
296
|
+
}
|
|
297
|
+
// ─────────────────────────── exec ───────────────────────────
|
|
298
|
+
async function runExecCommand(command, context) {
|
|
299
|
+
const project = (0, project_1.getProjectContext)(context.io.cwd);
|
|
300
|
+
const chosen = (0, runners_1.chooseExecRunnerName)(context.config, command.runner, command.runner === null ? (0, jobRecords_1.readLastRunnerNameOfProject)(context.cacheDir, project.root) : null);
|
|
301
|
+
if (chosen.note !== null)
|
|
302
|
+
(0, output_1.sayOwn)(context.io, chosen.note);
|
|
303
|
+
const client = await chooseClient(context, { runner: chosen.runnerName, needs: null });
|
|
304
|
+
return (0, foreground_1.runExec)({ client, slug: project.slug, subfolder: project.subfolder, command: command.command, io: context.io, leaseMs: context.leaseMs });
|
|
305
|
+
}
|
|
306
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/remoteRun/commands.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EA,sCAwBC;AAID,8CAKC;AAyBD,oCAmBC;AAED,4CAOC;AAID,wCA6BC;AAcD,gCAoBC;AAED,wCAgBC;AAED,0CAOC;AAED,wCAMC;AAGD,gDAGC;AAID,wCAMC;AAzRD,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAC7B,6BAAwB;AAExB,2CAAsF;AACtF,6CAAuF;AACvF,6CAAsE;AACtE,yCAAkF;AAClF,2CAA4E;AAC5E,mCAAkD;AAClD,uCAAyC;AACzC,6CAA+E;AAC/E,yCAA4C;AAC5C,yCAAiF;AACjF,qCAAqE;AACrE,mCAAmE;AACnE,uCAA8C;AAC9C,q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B,CAAC;AACxH,CAAC;AAED,+DAA+D;AAExD,KAAK,UAAU,cAAc,CAAC,OAAoD,EAAE,OAAuB;IAChH,MAAM,OAAO,GAAG,IAAA,2BAAiB,EAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,IAAA,8BAAoB,EAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAA,wCAA2B,EAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAClK,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI;QAAE,IAAA,eAAM,EAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACvF,OAAO,IAAA,oBAAO,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;AACnJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ProjectConfig } from './projectConfig';
|
|
2
|
+
export interface DepsPlan {
|
|
3
|
+
command: string;
|
|
4
|
+
/** The files whose content makes the key, relative to the project root, sorted. */
|
|
5
|
+
keyFiles: string[];
|
|
6
|
+
}
|
|
7
|
+
/** @description The dependencies plan for the files being sent, or `null` when there is no step (no lockfile and no `install:`, or `install: none`). */
|
|
8
|
+
export declare function planDepsStep(sentFiles: readonly string[], config: Pick<ProjectConfig, 'install' | 'installKey'>): DepsPlan | null;
|
|
9
|
+
/** @description The key: a hash of the command and of every key file's path and content hash. A changed command re-runs the step as well. */
|
|
10
|
+
export declare function computeDepsKey(command: string, keyFiles: ReadonlyArray<{
|
|
11
|
+
path: string;
|
|
12
|
+
contentHash: string;
|
|
13
|
+
}>): string;
|
|
14
|
+
/** @description The hash of one file's content, as the key takes it. */
|
|
15
|
+
export declare function hashContent(content: Buffer): string;
|
|
16
|
+
//# sourceMappingURL=depsPlan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"depsPlan.d.ts","sourceRoot":"","sources":["../../src/remoteRun/depsPlan.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AA2BlE,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wJAAwJ;AACxJ,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,YAAY,CAAC,GAAG,QAAQ,GAAG,IAAI,CAejI;AAED,6IAA6I;AAC7I,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,MAAM,CAMtH;AAED,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.planDepsStep = planDepsStep;
|
|
37
|
+
exports.computeDepsKey = computeDepsKey;
|
|
38
|
+
exports.hashContent = hashContent;
|
|
39
|
+
const crypto_1 = require("crypto");
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
const projectConfig_1 = require("./projectConfig");
|
|
42
|
+
const pathPatterns_1 = require("./pathPatterns");
|
|
43
|
+
/** In this order: a repository that keeps two lockfiles is read as the first. */
|
|
44
|
+
const lockfileDefaults = [
|
|
45
|
+
{ lockfile: 'yarn.lock', command: 'yarn install --immutable' },
|
|
46
|
+
{ lockfile: 'pnpm-lock.yaml', command: 'pnpm install --frozen-lockfile' },
|
|
47
|
+
{ lockfile: 'package-lock.json', command: 'npm ci' },
|
|
48
|
+
];
|
|
49
|
+
const yarnConfigFile = '.yarnrc.yml';
|
|
50
|
+
const patchesDirectory = 'patches/';
|
|
51
|
+
const packageManifestName = 'package.json';
|
|
52
|
+
/** @description The dependencies plan for the files being sent, or `null` when there is no step (no lockfile and no `install:`, or `install: none`). */
|
|
53
|
+
function planDepsStep(sentFiles, config) {
|
|
54
|
+
if (config.install === projectConfig_1.installNone)
|
|
55
|
+
return null;
|
|
56
|
+
const lockfile = lockfileDefaults.find((candidate) => sentFiles.includes(candidate.lockfile));
|
|
57
|
+
const command = config.install ?? lockfile?.command ?? null;
|
|
58
|
+
if (command === null)
|
|
59
|
+
return null;
|
|
60
|
+
let keyFiles;
|
|
61
|
+
if (config.installKey !== null) {
|
|
62
|
+
const isNamed = (0, pathPatterns_1.createPathMatcher)(config.installKey);
|
|
63
|
+
keyFiles = sentFiles.filter((file) => isNamed(file));
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
keyFiles = sentFiles.filter((file) => file === lockfile?.lockfile || path.posix.basename(file) === packageManifestName || file === yarnConfigFile || file.startsWith(patchesDirectory));
|
|
67
|
+
}
|
|
68
|
+
return { command, keyFiles: [...keyFiles].sort() };
|
|
69
|
+
}
|
|
70
|
+
/** @description The key: a hash of the command and of every key file's path and content hash. A changed command re-runs the step as well. */
|
|
71
|
+
function computeDepsKey(command, keyFiles) {
|
|
72
|
+
const hash = (0, crypto_1.createHash)('sha256').update(`${command}\0`);
|
|
73
|
+
for (const keyFile of [...keyFiles].sort((first, second) => (first.path < second.path ? -1 : first.path > second.path ? 1 : 0))) {
|
|
74
|
+
hash.update(`${keyFile.path}\0${keyFile.contentHash}\n`);
|
|
75
|
+
}
|
|
76
|
+
return hash.digest('hex');
|
|
77
|
+
}
|
|
78
|
+
/** @description The hash of one file's content, as the key takes it. */
|
|
79
|
+
function hashContent(content) {
|
|
80
|
+
return (0, crypto_1.createHash)('sha256').update(content).digest('hex');
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=depsPlan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"depsPlan.js","sourceRoot":"","sources":["../../src/remoteRun/depsPlan.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,oCAeC;AAGD,wCAMC;AAGD,kCAEC;AAjED,mCAAoC;AACpC,2CAA6B;AAC7B,mDAAkE;AAClE,iDAAmD;AAgBnD,iFAAiF;AACjF,MAAM,gBAAgB,GAA+B;IACnD,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,0BAA0B,EAAE;IAC9D,EAAE,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,gCAAgC,EAAE;IACzE,EAAE,QAAQ,EAAE,mBAAmB,EAAE,OAAO,EAAE,QAAQ,EAAE;CACrD,CAAC;AACF,MAAM,cAAc,GAAG,aAAa,CAAC;AACrC,MAAM,gBAAgB,GAAG,UAAU,CAAC;AACpC,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAQ3C,wJAAwJ;AACxJ,SAAgB,YAAY,CAAC,SAA4B,EAAE,MAAqD;IAC9G,IAAI,MAAM,CAAC,OAAO,KAAK,2BAAW;QAAE,OAAO,IAAI,CAAC;IAChD,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC9F,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,QAAQ,EAAE,OAAO,IAAI,IAAI,CAAC;IAC5D,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IA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,CAAC,WAAW,IAAI,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED,wEAAwE;AACxE,SAAgB,WAAW,CAAC,OAAe;IACzC,OAAO,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description The exit codes of `charness remote-run` itself. The command's own code passes through untouched; these are the
|
|
3
|
+
* ones remote-run reports when it is the one that failed or that stopped the job. They follow `timeout(1)` and the shell
|
|
4
|
+
* (128 + signal) so a caller that already knows those reads them right.
|
|
5
|
+
*/
|
|
6
|
+
export declare const remoteRunExitCodes: {
|
|
7
|
+
/** A bad command line (`remote-run --nope`): the usage convention of the other subcommands. */
|
|
8
|
+
readonly usage: 2;
|
|
9
|
+
/** The job ran past its `--timeout` and was killed. */
|
|
10
|
+
readonly timedOut: 124;
|
|
11
|
+
/** remote-run failed: no runner, ssh, the file sync, the dependencies step — the message on stderr says which. */
|
|
12
|
+
readonly failed: 125;
|
|
13
|
+
/** The local run was ended by SIGHUP. */
|
|
14
|
+
readonly hangup: 129;
|
|
15
|
+
/** The local run was ended by SIGINT. */
|
|
16
|
+
readonly interrupted: 130;
|
|
17
|
+
/** The job was killed (`remote-run kill`, a lost lease). */
|
|
18
|
+
readonly killed: 137;
|
|
19
|
+
/** The local run was ended by SIGTERM. */
|
|
20
|
+
readonly terminated: 143;
|
|
21
|
+
};
|
|
22
|
+
export type InterruptSignal = 'SIGINT' | 'SIGTERM' | 'SIGHUP';
|
|
23
|
+
export declare const interruptSignals: readonly InterruptSignal[];
|
|
24
|
+
/** @description How a local interrupt ends the run: the remote job is killed first (TERM, then KILL after the grace), then this code. */
|
|
25
|
+
export interface InterruptPlan {
|
|
26
|
+
exitCode: number;
|
|
27
|
+
/** How long the runner gives the job after SIGTERM before it is killed. */
|
|
28
|
+
killGraceSeconds: number;
|
|
29
|
+
}
|
|
30
|
+
/** How long the runner gives a job after SIGTERM before it kills it (`kill_grace_sec` in `remoteRun/runner.sh`: the two are one number). */
|
|
31
|
+
export declare const killGraceSeconds = 10;
|
|
32
|
+
/** @description What to do when the local remote-run gets `signal`: kill the whole remote job, then exit with the shell's code for it. */
|
|
33
|
+
export declare function planInterrupt(signal: InterruptSignal): InterruptPlan;
|
|
34
|
+
//# sourceMappingURL=exitCodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exitCodes.d.ts","sourceRoot":"","sources":["../../src/remoteRun/exitCodes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;IAC7B,+FAA+F;;IAE/F,uDAAuD;;IAEvD,kHAAkH;;IAElH,yCAAyC;;IAEzC,yCAAyC;;IAEzC,4DAA4D;;IAE5D,0CAA0C;;CAElC,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9D,eAAO,MAAM,gBAAgB,EAAE,SAAS,eAAe,EAAoC,CAAC;AAE5F,yIAAyI;AACzI,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,4IAA4I;AAC5I,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,0IAA0I;AAC1I,wBAAgB,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,aAAa,CAOpE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.killGraceSeconds = exports.interruptSignals = exports.remoteRunExitCodes = void 0;
|
|
4
|
+
exports.planInterrupt = planInterrupt;
|
|
5
|
+
/**
|
|
6
|
+
* @description The exit codes of `charness remote-run` itself. The command's own code passes through untouched; these are the
|
|
7
|
+
* ones remote-run reports when it is the one that failed or that stopped the job. They follow `timeout(1)` and the shell
|
|
8
|
+
* (128 + signal) so a caller that already knows those reads them right.
|
|
9
|
+
*/
|
|
10
|
+
exports.remoteRunExitCodes = {
|
|
11
|
+
/** A bad command line (`remote-run --nope`): the usage convention of the other subcommands. */
|
|
12
|
+
usage: 2,
|
|
13
|
+
/** The job ran past its `--timeout` and was killed. */
|
|
14
|
+
timedOut: 124,
|
|
15
|
+
/** remote-run failed: no runner, ssh, the file sync, the dependencies step — the message on stderr says which. */
|
|
16
|
+
failed: 125,
|
|
17
|
+
/** The local run was ended by SIGHUP. */
|
|
18
|
+
hangup: 129,
|
|
19
|
+
/** The local run was ended by SIGINT. */
|
|
20
|
+
interrupted: 130,
|
|
21
|
+
/** The job was killed (`remote-run kill`, a lost lease). */
|
|
22
|
+
killed: 137,
|
|
23
|
+
/** The local run was ended by SIGTERM. */
|
|
24
|
+
terminated: 143,
|
|
25
|
+
};
|
|
26
|
+
exports.interruptSignals = ['SIGINT', 'SIGTERM', 'SIGHUP'];
|
|
27
|
+
/** How long the runner gives a job after SIGTERM before it kills it (`kill_grace_sec` in `remoteRun/runner.sh`: the two are one number). */
|
|
28
|
+
exports.killGraceSeconds = 10;
|
|
29
|
+
/** @description What to do when the local remote-run gets `signal`: kill the whole remote job, then exit with the shell's code for it. */
|
|
30
|
+
function planInterrupt(signal) {
|
|
31
|
+
const exitCodeBySignal = {
|
|
32
|
+
SIGINT: exports.remoteRunExitCodes.interrupted,
|
|
33
|
+
SIGTERM: exports.remoteRunExitCodes.terminated,
|
|
34
|
+
SIGHUP: exports.remoteRunExitCodes.hangup,
|
|
35
|
+
};
|
|
36
|
+
return { exitCode: exitCodeBySignal[signal], killGraceSeconds: exports.killGraceSeconds };
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=exitCodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exitCodes.js","sourceRoot":"","sources":["../../src/remoteRun/exitCodes.ts"],"names":[],"mappings":";;;AAqCA,sCAOC;AA5CD;;;;GAIG;AACU,QAAA,kBAAkB,GAAG;IAChC,+FAA+F;IAC/F,KAAK,EAAE,CAAC;IACR,uDAAuD;IACvD,QAAQ,EAAE,GAAG;IACb,kHAAkH;IAClH,MAAM,EAAE,GAAG;IACX,yCAAyC;IACzC,MAAM,EAAE,GAAG;IACX,yCAAyC;IACzC,WAAW,EAAE,GAAG;IAChB,4DAA4D;IAC5D,MAAM,EAAE,GAAG;IACX,0CAA0C;IAC1C,UAAU,EAAE,GAAG;CACP,CAAC;AAIE,QAAA,gBAAgB,GAA+B,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAS5F,4IAA4I;AAC/H,QAAA,gBAAgB,GAAG,EAAE,CAAC;AAEnC,0IAA0I;AAC1I,SAAgB,aAAa,CAAC,MAAuB;IACnD,MAAM,gBAAgB,GAAoC;QACxD,MAAM,EAAE,0BAAkB,CAAC,WAAW;QACtC,OAAO,EAAE,0BAAkB,CAAC,UAAU;QACtC,MAAM,EAAE,0BAAkB,CAAC,MAAM;KAClC,CAAC;IACF,OAAO,EAAE,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAE,gBAAgB,EAAhB,wBAAgB,EAAE,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type FetchTarget } from './jobFiles';
|
|
2
|
+
import { type CliIo } from './output';
|
|
3
|
+
import { type RunnerClient } from './runnerClient';
|
|
4
|
+
import type { StagedJob } from './submit';
|
|
5
|
+
import type { JobOutcome } from './jobState';
|
|
6
|
+
/**
|
|
7
|
+
* @description Say why a job ended the way it did (when it is not simply its command's own code) and return remote-run's exit code for it.
|
|
8
|
+
* `runnerStderr` is what the runner script wrote on the session that ran the job: a job it refused at once (`pueue add` failed) has no
|
|
9
|
+
* state to show, and that last line is the only thing that says why.
|
|
10
|
+
*/
|
|
11
|
+
export declare function describeEnd(outcome: JobOutcome, jobId: string, io: Pick<CliIo, 'stderr'>, runnerStderr?: string): number;
|
|
12
|
+
/** @description Follow a staged job in the foreground; resolves with remote-run's exit code. */
|
|
13
|
+
export declare function followForeground(params: {
|
|
14
|
+
client: RunnerClient;
|
|
15
|
+
staged: StagedJob;
|
|
16
|
+
target: FetchTarget;
|
|
17
|
+
io: CliIo;
|
|
18
|
+
leaseMs: number;
|
|
19
|
+
}): Promise<number>;
|
|
20
|
+
/** @description Run a one-off command in the runner's copy under the same lease; resolves with the command's exit code. */
|
|
21
|
+
export declare function runExec(params: {
|
|
22
|
+
client: RunnerClient;
|
|
23
|
+
slug: string;
|
|
24
|
+
subfolder: string;
|
|
25
|
+
command: string;
|
|
26
|
+
io: CliIo;
|
|
27
|
+
leaseMs: number;
|
|
28
|
+
}): Promise<number>;
|
|
29
|
+
//# sourceMappingURL=foreground.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"foreground.d.ts","sourceRoot":"","sources":["../../src/remoteRun/foreground.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAG7D,OAAO,EAAyD,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAE7F,OAAO,EAAyB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAgB7C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,YAAY,SAAK,GAAG,MAAM,CAYpH;AAED,gGAAgG;AAChG,wBAAsB,gBAAgB,CAAC,MAAM,EAAE;IAC7C,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,EAAE,EAAE,KAAK,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmElB;AAED,2HAA2H;AAC3H,wBAAsB,OAAO,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAqC7J"}
|