charness 3.6.1 → 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 +267 -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 +7 -0
- package/dist/connectors/jira/connector.js.map +1 -1
- package/dist/connectors/jira/inbound.d.ts +27 -4
- package/dist/connectors/jira/inbound.d.ts.map +1 -1
- package/dist/connectors/jira/inbound.js +69 -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/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,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description What the commands write and where: the job's output to stdout, remote-run's own lines to stderr prefixed `remote-run: `.
|
|
4
|
+
* The job script writes ITS progress lines (waiting for another job of the project, installing dependencies, a timeout) into the job's
|
|
5
|
+
* log with the same prefix, so the router sends every log line that starts with it to stderr — a command that prints such a line itself
|
|
6
|
+
* only moves it to the other stream.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ownLinePrefix = void 0;
|
|
10
|
+
exports.sayOwn = sayOwn;
|
|
11
|
+
exports.createJobOutputRouter = createJobOutputRouter;
|
|
12
|
+
exports.createExitMarkerFilter = createExitMarkerFilter;
|
|
13
|
+
exports.ownLinePrefix = 'remote-run: ';
|
|
14
|
+
/** @description One of remote-run's own lines, to stderr. */
|
|
15
|
+
function sayOwn(io, line) {
|
|
16
|
+
io.stderr(`${exports.ownLinePrefix}${line}\n`);
|
|
17
|
+
}
|
|
18
|
+
function createJobOutputRouter(io) {
|
|
19
|
+
let pending = '';
|
|
20
|
+
const emit = (line) => {
|
|
21
|
+
if (line.startsWith(exports.ownLinePrefix))
|
|
22
|
+
io.stderr(line);
|
|
23
|
+
else
|
|
24
|
+
io.stdout(line);
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
write(chunk) {
|
|
28
|
+
pending += chunk;
|
|
29
|
+
let newline = pending.indexOf('\n');
|
|
30
|
+
while (newline >= 0) {
|
|
31
|
+
emit(pending.slice(0, newline + 1));
|
|
32
|
+
pending = pending.slice(newline + 1);
|
|
33
|
+
newline = pending.indexOf('\n');
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
flush() {
|
|
37
|
+
if (pending !== '')
|
|
38
|
+
emit(pending);
|
|
39
|
+
pending = '';
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/** The line `runner.sh exec` ends its stderr with: RS (U+001E), the name, the command's exit code, a newline. */
|
|
44
|
+
const exitMarkerPattern = /\u001eremote-run-exit:(\d+)\n/g;
|
|
45
|
+
/** A marker that has begun but not arrived whole is held back at most this long (the marker is shorter than this). */
|
|
46
|
+
const exitMarkerHoldBackLength = 40;
|
|
47
|
+
/**
|
|
48
|
+
* @description Takes the exit marker `runner.sh exec` prints out of a stderr stream, however the stream is cut into chunks, and hands on
|
|
49
|
+
* everything else at once — a partial marker is held back only until the rest arrives or the stream ends.
|
|
50
|
+
*/
|
|
51
|
+
function createExitMarkerFilter(forward) {
|
|
52
|
+
let pending = '';
|
|
53
|
+
let exitCode = null;
|
|
54
|
+
return {
|
|
55
|
+
write(chunk) {
|
|
56
|
+
let text = pending + chunk;
|
|
57
|
+
pending = '';
|
|
58
|
+
let handedOn = 0;
|
|
59
|
+
for (const match of text.matchAll(exitMarkerPattern)) {
|
|
60
|
+
if (match.index > handedOn)
|
|
61
|
+
forward(text.slice(handedOn, match.index));
|
|
62
|
+
exitCode = Number(match[1]);
|
|
63
|
+
handedOn = match.index + match[0].length;
|
|
64
|
+
}
|
|
65
|
+
text = text.slice(handedOn);
|
|
66
|
+
const markerStart = text.lastIndexOf('\u001e');
|
|
67
|
+
if (markerStart >= 0 && text.length - markerStart < exitMarkerHoldBackLength && !text.slice(markerStart).includes('\n')) {
|
|
68
|
+
pending = text.slice(markerStart);
|
|
69
|
+
text = text.slice(0, markerStart);
|
|
70
|
+
}
|
|
71
|
+
if (text !== '')
|
|
72
|
+
forward(text);
|
|
73
|
+
},
|
|
74
|
+
flush() {
|
|
75
|
+
if (pending !== '')
|
|
76
|
+
forward(pending);
|
|
77
|
+
pending = '';
|
|
78
|
+
},
|
|
79
|
+
getExitCode: () => exitCode,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/remoteRun/output.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAaH,wBAEC;AAQD,sDAqBC;AAmBD,wDA2BC;AAxFY,QAAA,aAAa,GAAG,cAAc,CAAC;AAU5C,6DAA6D;AAC7D,SAAgB,MAAM,CAAC,EAAyB,EAAE,IAAY;IAC5D,EAAE,CAAC,MAAM,CAAC,GAAG,qBAAa,GAAG,IAAI,IAAI,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-key:`) means, as
|
|
3
|
+
* extended regular expressions: the main box applies them with `RegExp` and the runner script with bash's `=~` over the very same
|
|
4
|
+
* strings, so the two can never disagree about which files a pattern names.
|
|
5
|
+
*
|
|
6
|
+
* A pattern is relative to the project root. `*` is any run of characters inside one path segment, `?` one character, `**` a whole
|
|
7
|
+
* segment of any depth (`**` + `/` before a name, `/` + `**` at the end). A pattern names a file OR a directory: a directory brings
|
|
8
|
+
* everything below it (`test-results` is `test-results/a/b.png` too). Nothing floats: `snapshots` is the folder at the root only,
|
|
9
|
+
* `**` + `/snapshots` any `snapshots` folder.
|
|
10
|
+
*/
|
|
11
|
+
/** @description Why `pattern` cannot be used, or `null` when it can: not empty, relative, inside the project, no control characters. */
|
|
12
|
+
export declare function getPathPatternProblem(pattern: string): string | null;
|
|
13
|
+
/** @description The extended regular expression (anchored) a project-relative path must match to be named by `pattern`. */
|
|
14
|
+
export declare function compilePathPattern(pattern: string): string;
|
|
15
|
+
/** @description The compiled expressions of `patterns`, in order (the form the runner script receives, one per line). */
|
|
16
|
+
export declare function compilePathPatterns(patterns: readonly string[]): string[];
|
|
17
|
+
/** The root every path of the project lies under. */
|
|
18
|
+
export declare const projectSearchRoot = ".";
|
|
19
|
+
/**
|
|
20
|
+
* @description The folder a walk must start from to find every path `pattern` names: its leading segments that hold no `*`, `?` or `**`
|
|
21
|
+
* (`e2e/artifacts` → itself, `test-results/**` + `/*.xml` → `test-results`, `**` + `/*.png` → `.`). A fully literal pattern is its own root: a file or
|
|
22
|
+
* a folder, either is found from there.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getPathPatternSearchRoot(pattern: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* @description The folders to walk to find what any of `patterns` names, without the ones another root already covers; just `.` as soon
|
|
27
|
+
* as one pattern starts with a wildcard (that one needs the whole tree). The runner walks these instead of the whole copy, which holds
|
|
28
|
+
* `node_modules` and every build folder.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getPathPatternSearchRoots(patterns: readonly string[]): string[];
|
|
31
|
+
/** @description A predicate over project-relative paths: does any of `patterns` name it? No pattern names nothing. */
|
|
32
|
+
export declare function createPathMatcher(patterns: readonly string[]): (relativePath: string) => boolean;
|
|
33
|
+
//# sourceMappingURL=pathPatterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathPatterns.d.ts","sourceRoot":"","sources":["../../src/remoteRun/pathPatterns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAoBH,wIAAwI;AACxI,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQpE;AAED,2HAA2H;AAC3H,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAsB1D;AAED,yHAAyH;AACzH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAEzE;AAED,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOhE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAI/E;AAED,sHAAsH;AACtH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAGhG"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description The ONE definition of what a path pattern of `.remote-run` (`pull:`, `exclude:`, `send:`, `install-key:`) means, as
|
|
4
|
+
* extended regular expressions: the main box applies them with `RegExp` and the runner script with bash's `=~` over the very same
|
|
5
|
+
* strings, so the two can never disagree about which files a pattern names.
|
|
6
|
+
*
|
|
7
|
+
* A pattern is relative to the project root. `*` is any run of characters inside one path segment, `?` one character, `**` a whole
|
|
8
|
+
* segment of any depth (`**` + `/` before a name, `/` + `**` at the end). A pattern names a file OR a directory: a directory brings
|
|
9
|
+
* everything below it (`test-results` is `test-results/a/b.png` too). Nothing floats: `snapshots` is the folder at the root only,
|
|
10
|
+
* `**` + `/snapshots` any `snapshots` folder.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.projectSearchRoot = void 0;
|
|
14
|
+
exports.getPathPatternProblem = getPathPatternProblem;
|
|
15
|
+
exports.compilePathPattern = compilePathPattern;
|
|
16
|
+
exports.compilePathPatterns = compilePathPatterns;
|
|
17
|
+
exports.getPathPatternSearchRoot = getPathPatternSearchRoot;
|
|
18
|
+
exports.getPathPatternSearchRoots = getPathPatternSearchRoots;
|
|
19
|
+
exports.createPathMatcher = createPathMatcher;
|
|
20
|
+
const regexSpecialCharacters = /[.[\]{}()*+?|^$\\]/g;
|
|
21
|
+
const anyDepthPrefix = '(.*/)?';
|
|
22
|
+
const anyDepthSuffix = '.*';
|
|
23
|
+
const singleSegmentRun = '[^/]*';
|
|
24
|
+
const singleCharacter = '[^/]';
|
|
25
|
+
/** Control characters (a newline would split the pattern file the runner reads one pattern per line). */
|
|
26
|
+
const controlCharacters = /[\x00-\x1f\x7f]/;
|
|
27
|
+
function escapeLiteral(text) {
|
|
28
|
+
return text.replace(regexSpecialCharacters, '\\$&');
|
|
29
|
+
}
|
|
30
|
+
/** The parts of a pattern between slashes, without `./` prefixes, trailing slashes or empty parts; consecutive `**` parts are one (they mean the same, and nested any-depth groups backtrack badly). */
|
|
31
|
+
function splitPatternSegments(pattern) {
|
|
32
|
+
const segments = pattern.replace(/^(\.\/)+/, '').replace(/\/+$/, '').split('/').filter((segment) => segment !== '' && segment !== '.');
|
|
33
|
+
return segments.filter((segment, index) => !(segment === '**' && segments[index - 1] === '**'));
|
|
34
|
+
}
|
|
35
|
+
/** @description Why `pattern` cannot be used, or `null` when it can: not empty, relative, inside the project, no control characters. */
|
|
36
|
+
function getPathPatternProblem(pattern) {
|
|
37
|
+
if (pattern.trim() === '')
|
|
38
|
+
return 'is empty';
|
|
39
|
+
if (controlCharacters.test(pattern))
|
|
40
|
+
return 'holds a control character';
|
|
41
|
+
if (pattern.startsWith('/'))
|
|
42
|
+
return 'must be relative to the project root, not absolute';
|
|
43
|
+
if (pattern.startsWith('~'))
|
|
44
|
+
return 'must be relative to the project root, not start with ~';
|
|
45
|
+
if (pattern.split('/').includes('..'))
|
|
46
|
+
return 'must stay inside the project (no ".." part)';
|
|
47
|
+
if (splitPatternSegments(pattern).length === 0)
|
|
48
|
+
return 'names no path (name a file or a folder of the project)';
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
/** @description The extended regular expression (anchored) a project-relative path must match to be named by `pattern`. */
|
|
52
|
+
function compilePathPattern(pattern) {
|
|
53
|
+
const problem = getPathPatternProblem(pattern);
|
|
54
|
+
if (problem !== null)
|
|
55
|
+
throw new Error(`a path pattern ${problem}`);
|
|
56
|
+
const segments = splitPatternSegments(pattern);
|
|
57
|
+
let source = '';
|
|
58
|
+
segments.forEach((segment, index) => {
|
|
59
|
+
const isLast = index === segments.length - 1;
|
|
60
|
+
if (segment === '**') {
|
|
61
|
+
source += isLast ? anyDepthSuffix : anyDepthPrefix;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
let escaped = '';
|
|
65
|
+
for (const character of segment) {
|
|
66
|
+
if (character === '*')
|
|
67
|
+
escaped += singleSegmentRun;
|
|
68
|
+
else if (character === '?')
|
|
69
|
+
escaped += singleCharacter;
|
|
70
|
+
else
|
|
71
|
+
escaped += escapeLiteral(character);
|
|
72
|
+
}
|
|
73
|
+
source += isLast ? escaped : `${escaped}/`;
|
|
74
|
+
});
|
|
75
|
+
// A trailing `**` already ends in `.*` after a slash; a trailing name may be a directory with files below it.
|
|
76
|
+
const needsDirectoryTail = segments[segments.length - 1] !== '**';
|
|
77
|
+
return `^${source}${needsDirectoryTail ? '(/.*)?' : ''}$`;
|
|
78
|
+
}
|
|
79
|
+
/** @description The compiled expressions of `patterns`, in order (the form the runner script receives, one per line). */
|
|
80
|
+
function compilePathPatterns(patterns) {
|
|
81
|
+
return patterns.map(compilePathPattern);
|
|
82
|
+
}
|
|
83
|
+
/** The root every path of the project lies under. */
|
|
84
|
+
exports.projectSearchRoot = '.';
|
|
85
|
+
/**
|
|
86
|
+
* @description The folder a walk must start from to find every path `pattern` names: its leading segments that hold no `*`, `?` or `**`
|
|
87
|
+
* (`e2e/artifacts` → itself, `test-results/**` + `/*.xml` → `test-results`, `**` + `/*.png` → `.`). A fully literal pattern is its own root: a file or
|
|
88
|
+
* a folder, either is found from there.
|
|
89
|
+
*/
|
|
90
|
+
function getPathPatternSearchRoot(pattern) {
|
|
91
|
+
const fixedSegments = [];
|
|
92
|
+
for (const segment of splitPatternSegments(pattern)) {
|
|
93
|
+
if (segment.includes('*') || segment.includes('?'))
|
|
94
|
+
break;
|
|
95
|
+
fixedSegments.push(segment);
|
|
96
|
+
}
|
|
97
|
+
return fixedSegments.length === 0 ? exports.projectSearchRoot : fixedSegments.join('/');
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* @description The folders to walk to find what any of `patterns` names, without the ones another root already covers; just `.` as soon
|
|
101
|
+
* as one pattern starts with a wildcard (that one needs the whole tree). The runner walks these instead of the whole copy, which holds
|
|
102
|
+
* `node_modules` and every build folder.
|
|
103
|
+
*/
|
|
104
|
+
function getPathPatternSearchRoots(patterns) {
|
|
105
|
+
const roots = [...new Set(patterns.map(getPathPatternSearchRoot))];
|
|
106
|
+
if (roots.includes(exports.projectSearchRoot))
|
|
107
|
+
return [exports.projectSearchRoot];
|
|
108
|
+
return roots.filter((root) => !roots.some((other) => other !== root && root.startsWith(`${other}/`)));
|
|
109
|
+
}
|
|
110
|
+
/** @description A predicate over project-relative paths: does any of `patterns` name it? No pattern names nothing. */
|
|
111
|
+
function createPathMatcher(patterns) {
|
|
112
|
+
const expressions = compilePathPatterns(patterns).map((source) => new RegExp(source));
|
|
113
|
+
return (relativePath) => expressions.some((expression) => expression.test(relativePath));
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=pathPatterns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathPatterns.js","sourceRoot":"","sources":["../../src/remoteRun/pathPatterns.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAqBH,sDAQC;AAGD,gDAsBC;AAGD,kDAEC;AAUD,4DAOC;AAOD,8DAIC;AAGD,8CAGC;AA3FD,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AACrD,MAAM,cAAc,GAAG,QAAQ,CAAC;AAChC,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACjC,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,yGAAyG;AACzG,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAE5C,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,IAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC;AAED,wMAAwM;AACxM,SAAS,oBAAoB,CAAC,OAAe;IAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,EAAE,IAAI,OAAO,KAAK,GAAG,CAAC,CAAC;IACvI,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,IAAI,IAAI,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;AAClG,CAAC;AAED,wIAAwI;AACxI,SAAgB,q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AAG,CAAC,QAAQ,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;IACnE,IAAI,KAAK,CAAC,QAAQ,CAAC,yBAAiB,CAAC;QAAE,OAAO,CAAC,yBAAiB,CAAC,CAAC;IAClE,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;AACxG,CAAC;AAED,sHAAsH;AACtH,SAAgB,iBAAiB,CAAC,QAA2B;IAC3D,MAAM,WAAW,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACtF,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;AAC3F,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description What a runner says about itself (`runner.sh probe`), parsed, and the short block `remote-run runners` prints for it.
|
|
3
|
+
* The runner prints `key=value` lines; an unknown key is ignored (a newer runner script, an older main box) and a missing one is
|
|
4
|
+
* "unknown", never a guess.
|
|
5
|
+
*/
|
|
6
|
+
export declare const runnerCapabilities: readonly ["android", "ios", "docker", "playwright"];
|
|
7
|
+
export type RunnerCapability = (typeof runnerCapabilities)[number];
|
|
8
|
+
/** @name CapabilityReport @description One capability: whether the runner can do it and, in plain words, how / why not. */
|
|
9
|
+
export interface CapabilityReport {
|
|
10
|
+
isAvailable: boolean;
|
|
11
|
+
detail: string;
|
|
12
|
+
}
|
|
13
|
+
/** @name RunnerProbe @description The facts of one probe. Numbers are `null` when the runner did not report them. */
|
|
14
|
+
export interface RunnerProbe {
|
|
15
|
+
os: string;
|
|
16
|
+
osName: string;
|
|
17
|
+
osVersion: string;
|
|
18
|
+
kernel: string;
|
|
19
|
+
arch: string;
|
|
20
|
+
cpuModel: string;
|
|
21
|
+
cpuCores: number | null;
|
|
22
|
+
cpuThreads: number | null;
|
|
23
|
+
load: number | null;
|
|
24
|
+
ramTotalMb: number | null;
|
|
25
|
+
ramFreeMb: number | null;
|
|
26
|
+
diskFreeMb: number | null;
|
|
27
|
+
/** The Pueue version, `null` when Pueue is missing on the runner. */
|
|
28
|
+
pueueVersion: string | null;
|
|
29
|
+
jobsRunning: number;
|
|
30
|
+
jobsQueued: number;
|
|
31
|
+
jobsProjects: number;
|
|
32
|
+
capabilities: Record<RunnerCapability, CapabilityReport>;
|
|
33
|
+
}
|
|
34
|
+
/** @description Parse the `key=value` lines of `runner.sh probe`. */
|
|
35
|
+
export declare function parseProbeOutput(text: string): RunnerProbe;
|
|
36
|
+
/** @description Does the probed runner have `capability`? */
|
|
37
|
+
export declare function checkHasCapability(probe: RunnerProbe, capability: RunnerCapability): boolean;
|
|
38
|
+
/** @description The three lines under a runner's heading: hardware, jobs and groups, capabilities. */
|
|
39
|
+
export declare function formatRunnerDetails(probe: RunnerProbe, groupLimits: Readonly<Record<string, number>>): string[];
|
|
40
|
+
/** @name RunnerReport @description What `runners` knows of one runner after probing: live, or the last snapshot with why it is offline. */
|
|
41
|
+
export type RunnerReport = {
|
|
42
|
+
name: string;
|
|
43
|
+
status: 'online';
|
|
44
|
+
probe: RunnerProbe;
|
|
45
|
+
groupLimits: Record<string, number>;
|
|
46
|
+
} | {
|
|
47
|
+
name: string;
|
|
48
|
+
status: 'offline';
|
|
49
|
+
reason: string;
|
|
50
|
+
lastSeenAtMs: number | null;
|
|
51
|
+
lastProbe: RunnerProbe | null;
|
|
52
|
+
groupLimits: Record<string, number>;
|
|
53
|
+
};
|
|
54
|
+
/** @description The block `remote-run runners` prints for one runner. An offline one shows its last snapshot, marked as old. */
|
|
55
|
+
export declare function formatRunnerBlock(report: RunnerReport): string;
|
|
56
|
+
//# sourceMappingURL=probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe.d.ts","sourceRoot":"","sources":["../../src/remoteRun/probe.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,kBAAkB,qDAAsD,CAAC;AACtF,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnE,2HAA2H;AAC3H,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qHAAqH;AACrH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,qEAAqE;IACrE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;CAC1D;AAUD,qEAAqE;AACrE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAmC1D;AAED,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAE5F;AAoCD,sGAAsG;AACtG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,EAAE,CAQ/G;AAED,2IAA2I;AAC3I,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAC3F;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC;AAOzJ,gIAAgI;AAChI,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAU9D"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description What a runner says about itself (`runner.sh probe`), parsed, and the short block `remote-run runners` prints for it.
|
|
4
|
+
* The runner prints `key=value` lines; an unknown key is ignored (a newer runner script, an older main box) and a missing one is
|
|
5
|
+
* "unknown", never a guess.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.runnerCapabilities = void 0;
|
|
9
|
+
exports.parseProbeOutput = parseProbeOutput;
|
|
10
|
+
exports.checkHasCapability = checkHasCapability;
|
|
11
|
+
exports.formatRunnerDetails = formatRunnerDetails;
|
|
12
|
+
exports.formatRunnerBlock = formatRunnerBlock;
|
|
13
|
+
exports.runnerCapabilities = ['android', 'ios', 'docker', 'playwright'];
|
|
14
|
+
const megabytesPerGigabyte = 1024;
|
|
15
|
+
function readNumber(value) {
|
|
16
|
+
if (value === undefined || value.trim() === '')
|
|
17
|
+
return null;
|
|
18
|
+
const parsed = Number(value);
|
|
19
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
20
|
+
}
|
|
21
|
+
/** @description Parse the `key=value` lines of `runner.sh probe`. */
|
|
22
|
+
function parseProbeOutput(text) {
|
|
23
|
+
const fields = new Map();
|
|
24
|
+
for (const line of text.split('\n')) {
|
|
25
|
+
const separator = line.indexOf('=');
|
|
26
|
+
if (separator > 0)
|
|
27
|
+
fields.set(line.slice(0, separator).trim(), line.slice(separator + 1).trim());
|
|
28
|
+
}
|
|
29
|
+
const readCapability = (name) => ({
|
|
30
|
+
isAvailable: fields.get(`cap_${name}`) === 'yes',
|
|
31
|
+
detail: fields.get(`cap_${name}_detail`) ?? '',
|
|
32
|
+
});
|
|
33
|
+
const pueue = fields.get('pueue');
|
|
34
|
+
return {
|
|
35
|
+
os: fields.get('os') ?? '',
|
|
36
|
+
osName: fields.get('os_name') ?? fields.get('os') ?? '',
|
|
37
|
+
osVersion: fields.get('os_version') ?? '',
|
|
38
|
+
kernel: fields.get('kernel') ?? '',
|
|
39
|
+
arch: fields.get('arch') ?? '',
|
|
40
|
+
cpuModel: fields.get('cpu_model') ?? '',
|
|
41
|
+
cpuCores: readNumber(fields.get('cpu_cores')),
|
|
42
|
+
cpuThreads: readNumber(fields.get('cpu_threads')),
|
|
43
|
+
load: readNumber(fields.get('load')),
|
|
44
|
+
ramTotalMb: readNumber(fields.get('ram_total_mb')),
|
|
45
|
+
ramFreeMb: readNumber(fields.get('ram_free_mb')),
|
|
46
|
+
diskFreeMb: readNumber(fields.get('disk_free_mb')),
|
|
47
|
+
pueueVersion: pueue === undefined || pueue === 'missing' || pueue === '' ? null : pueue,
|
|
48
|
+
jobsRunning: readNumber(fields.get('jobs_running')) ?? 0,
|
|
49
|
+
jobsQueued: readNumber(fields.get('jobs_queued')) ?? 0,
|
|
50
|
+
jobsProjects: readNumber(fields.get('jobs_projects')) ?? 0,
|
|
51
|
+
capabilities: {
|
|
52
|
+
android: readCapability('android'),
|
|
53
|
+
ios: readCapability('ios'),
|
|
54
|
+
docker: readCapability('docker'),
|
|
55
|
+
playwright: readCapability('playwright'),
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/** @description Does the probed runner have `capability`? */
|
|
60
|
+
function checkHasCapability(probe, capability) {
|
|
61
|
+
return probe.capabilities[capability].isAvailable;
|
|
62
|
+
}
|
|
63
|
+
function formatGigabytes(megabytes) {
|
|
64
|
+
if (megabytes === null)
|
|
65
|
+
return '?';
|
|
66
|
+
const gigabytes = megabytes / megabytesPerGigabyte;
|
|
67
|
+
return `${gigabytes >= 10 ? Math.round(gigabytes) : Math.round(gigabytes * 10) / 10} GB`;
|
|
68
|
+
}
|
|
69
|
+
/** `Ubuntu 24.04 (Linux 6.8, x86_64)` — the kernel trimmed to major.minor; the kernel's own name is left out when it is the system's name too. */
|
|
70
|
+
function formatSystem(probe) {
|
|
71
|
+
const kernel = probe.kernel.split('.').slice(0, 2).join('.');
|
|
72
|
+
const system = [probe.osName, probe.osVersion].filter((part) => part !== '').join(' ');
|
|
73
|
+
const kernelLabel = probe.osName === probe.os ? kernel : [probe.os, kernel].filter((part) => part !== '').join(' ');
|
|
74
|
+
const details = [kernelLabel, probe.arch].filter((part) => part !== '').join(', ');
|
|
75
|
+
return details === '' ? system : `${system} (${details})`;
|
|
76
|
+
}
|
|
77
|
+
function formatCpu(probe) {
|
|
78
|
+
const model = probe.cpuModel === '' ? 'CPU' : `CPU ${probe.cpuModel}`;
|
|
79
|
+
const shape = probe.cpuCores === null ? '' : `, ${probe.cpuCores} cores / ${probe.cpuThreads ?? '?'} threads`;
|
|
80
|
+
const load = probe.load === null ? '' : `, load ${probe.load}`;
|
|
81
|
+
return `${model}${shape}${load}`;
|
|
82
|
+
}
|
|
83
|
+
/** The `can:` parts in plain words: what the runner can do first (`android (KVM, emulator)`), then what it cannot with why (`ios: no (Linux)`). */
|
|
84
|
+
function formatCapabilities(probe) {
|
|
85
|
+
const available = [];
|
|
86
|
+
const unavailable = [];
|
|
87
|
+
for (const name of exports.runnerCapabilities) {
|
|
88
|
+
const report = probe.capabilities[name];
|
|
89
|
+
if (report.isAvailable)
|
|
90
|
+
available.push(report.detail === '' ? name : `${name} (${report.detail})`);
|
|
91
|
+
else
|
|
92
|
+
unavailable.push(`${name}: no${report.detail === '' ? '' : ` (${report.detail})`}`);
|
|
93
|
+
}
|
|
94
|
+
return [...available, ...unavailable];
|
|
95
|
+
}
|
|
96
|
+
/** @description The three lines under a runner's heading: hardware, jobs and groups, capabilities. */
|
|
97
|
+
function formatRunnerDetails(probe, groupLimits) {
|
|
98
|
+
const groups = Object.entries(groupLimits).map(([groupName, parallel]) => `${groupName} ${parallel}`).join(', ');
|
|
99
|
+
const jobs = `jobs: ${probe.jobsRunning} running, ${probe.jobsQueued} queued, ${probe.jobsProjects} ${probe.jobsProjects === 1 ? 'project' : 'projects'}`;
|
|
100
|
+
return [
|
|
101
|
+
` ${formatCpu(probe)} · RAM ${formatGigabytes(probe.ramTotalMb)}, ${formatGigabytes(probe.ramFreeMb)} free · disk ${formatGigabytes(probe.diskFreeMb)} free (work dir)`,
|
|
102
|
+
` ${jobs}${groups === '' ? '' : ` · groups: ${groups}`}${probe.pueueVersion === null ? ' · Pueue: MISSING (install it, see docs/remote-run.md)' : ''}`,
|
|
103
|
+
` can: ${formatCapabilities(probe).join(' · ')}`,
|
|
104
|
+
];
|
|
105
|
+
}
|
|
106
|
+
/** `2026-10-30 14:02 UTC` */
|
|
107
|
+
function formatLastSeen(timestampMs) {
|
|
108
|
+
return `${new Date(timestampMs).toISOString().slice(0, 16).replace('T', ' ')} UTC`;
|
|
109
|
+
}
|
|
110
|
+
/** @description The block `remote-run runners` prints for one runner. An offline one shows its last snapshot, marked as old. */
|
|
111
|
+
function formatRunnerBlock(report) {
|
|
112
|
+
if (report.status === 'online') {
|
|
113
|
+
return [`${report.name} — online · ${formatSystem(report.probe)}`, ...formatRunnerDetails(report.probe, report.groupLimits)].join('\n');
|
|
114
|
+
}
|
|
115
|
+
const lastSeen = report.lastSeenAtMs === null ? 'never seen' : `last seen ${formatLastSeen(report.lastSeenAtMs)}`;
|
|
116
|
+
if (report.lastProbe === null)
|
|
117
|
+
return `${report.name} — offline (${report.reason}) · ${lastSeen}`;
|
|
118
|
+
return [
|
|
119
|
+
`${report.name} — offline (${report.reason}) · ${lastSeen} — as it was then: ${formatSystem(report.lastProbe)}`,
|
|
120
|
+
...formatRunnerDetails(report.lastProbe, report.groupLimits),
|
|
121
|
+
].join('\n');
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe.js","sourceRoot":"","sources":["../../src/remoteRun/probe.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AA0CH,4CAmCC;AAGD,gDAEC;AAqCD,kDAQC;AAaD,8CAUC;AApJY,QAAA,kBAAkB,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,CAAU,CAAC;AA+BtF,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAElC,SAAS,UAAU,CAAC,KAAyB;IAC3C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAC5D,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC;AAED,qEAAqE;AACrE,SAAgB,gBAAgB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AAC,IAAI,eAAe,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,GAAG,mBAAmB,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1I,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,cAAc,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;IAClH,IAAI,MAAM,CAAC,SAAS,KAAK,IAAI;QAAE,OAAO,GAAG,MAAM,CAAC,IAAI,eAAe,MAAM,CAAC,MAAM,OAAO,QAAQ,EAAE,CAAC;IAClG,OAAO;QACL,GAAG,MAAM,CAAC,IAAI,eAAe,MAAM,CAAC,MAAM,OAAO,QAAQ,sBAAsB,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;QAC/G,GAAG,mBAAmB,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC;KAC7D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ProjectConfig } from './projectConfig';
|
|
2
|
+
import { type SendPlan } from './sendPlan';
|
|
3
|
+
export interface ProjectContext {
|
|
4
|
+
/** The git working tree's root, absolute and real. */
|
|
5
|
+
root: string;
|
|
6
|
+
/** The folder the command runs in, relative to the root (`''` for the root itself), with `/` separators. */
|
|
7
|
+
subfolder: string;
|
|
8
|
+
config: ProjectConfig;
|
|
9
|
+
slug: string;
|
|
10
|
+
}
|
|
11
|
+
/** @description The project of `cwd`: refused with a clear message when `cwd` is not inside a git working tree. */
|
|
12
|
+
export declare function getProjectContext(cwd: string): ProjectContext;
|
|
13
|
+
/** @description `.remote-run` of the project, or the empty config when there is none; a bad file is an error naming its lines. */
|
|
14
|
+
export declare function readProjectConfig(root: string): ProjectConfig;
|
|
15
|
+
/** @description What goes to the runner for this project: git's lists, trimmed and opted in by `.remote-run` (`planSendList`). */
|
|
16
|
+
export declare function planProjectSend(project: ProjectContext): SendPlan;
|
|
17
|
+
/**
|
|
18
|
+
* @description The folders of the project (relative, `/`-separated) in which a file runs on this machine at the next git command, so a
|
|
19
|
+
* result file from a runner must never land there: where git looks for hooks (`git rev-parse --git-path hooks`, which already folds in
|
|
20
|
+
* `core.hooksPath`) when that is inside the project — and, for husky's `_` shim folder, its parent, where the real hooks are — plus the
|
|
21
|
+
* conventional hook folders, which become live the moment a hook manager's install step points git at them. A hooks folder that is the
|
|
22
|
+
* project root itself is `''`: nothing may come back. Ones outside the project (the default `.git/hooks` is covered by the `.git` rule; a
|
|
23
|
+
* worktree's lives in the main checkout) are not the project's to protect.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getHookDirectories(projectRoot: string): string[];
|
|
26
|
+
//# sourceMappingURL=project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/remoteRun/project.ts"],"names":[],"mappings":"AAMA,OAAO,EAAyC,KAAK,aAAa,EAA4B,MAAM,iBAAiB,CAAC;AACtH,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAoBzD,MAAM,WAAW,cAAc;IAC7B,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,4GAA4G;IAC5G,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,mHAAmH;AACnH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAS7D;AAED,kIAAkI;AAClI,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAY7D;AA4CD,kIAAkI;AAClI,wBAAgB,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,QAAQ,CAIjE;AAOD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAehE"}
|
|
@@ -0,0 +1,159 @@
|
|
|
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.getProjectContext = getProjectContext;
|
|
37
|
+
exports.readProjectConfig = readProjectConfig;
|
|
38
|
+
exports.planProjectSend = planProjectSend;
|
|
39
|
+
exports.getHookDirectories = getHookDirectories;
|
|
40
|
+
const child_process_1 = require("child_process");
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
42
|
+
const os = __importStar(require("os"));
|
|
43
|
+
const path = __importStar(require("path"));
|
|
44
|
+
const remoteRunError_1 = require("./remoteRunError");
|
|
45
|
+
const jobId_1 = require("./jobId");
|
|
46
|
+
const projectConfig_1 = require("./projectConfig");
|
|
47
|
+
const sendPlan_1 = require("./sendPlan");
|
|
48
|
+
/**
|
|
49
|
+
* @description The local side of a submit: which project the command is run in, what `.remote-run` says, and which files git says
|
|
50
|
+
* are sendable. The project is the git working tree the command runs in; the command later runs in the same subfolder on the runner.
|
|
51
|
+
*/
|
|
52
|
+
const gitDeadlineMs = 60 * 1000;
|
|
53
|
+
const gitOutputLimitBytes = 512 * 1024 * 1024;
|
|
54
|
+
/** A gitlink (submodule) entry's mode in `git ls-files -s`. */
|
|
55
|
+
const gitlinkMode = '160000';
|
|
56
|
+
function runGit(directory, args) {
|
|
57
|
+
const result = (0, child_process_1.spawnSync)('git', ['-C', directory, ...args], { encoding: 'utf8', timeout: gitDeadlineMs, maxBuffer: gitOutputLimitBytes });
|
|
58
|
+
if (result.error !== undefined || result.status !== 0) {
|
|
59
|
+
throw new remoteRunError_1.RemoteRunError(`git ${args[0]} failed in ${directory}: ${(result.stderr ?? '').trim().split('\n')[0] || result.error?.message || 'no output'}`);
|
|
60
|
+
}
|
|
61
|
+
return result.stdout;
|
|
62
|
+
}
|
|
63
|
+
/** @description The project of `cwd`: refused with a clear message when `cwd` is not inside a git working tree. */
|
|
64
|
+
function getProjectContext(cwd) {
|
|
65
|
+
const probe = (0, child_process_1.spawnSync)('git', ['-C', cwd, 'rev-parse', '--show-toplevel'], { encoding: 'utf8', timeout: gitDeadlineMs });
|
|
66
|
+
if (probe.error !== undefined || probe.status !== 0) {
|
|
67
|
+
throw new remoteRunError_1.RemoteRunError(`${cwd} is not inside a git working tree — remote-run sends the project's files as git lists them (tracked and untracked, not ignored), so it needs a git project`);
|
|
68
|
+
}
|
|
69
|
+
const root = fs.realpathSync(probe.stdout.trim());
|
|
70
|
+
const relative = path.relative(root, fs.realpathSync(cwd));
|
|
71
|
+
const subfolder = relative === '' ? '' : relative.split(path.sep).join('/');
|
|
72
|
+
return { root, subfolder, config: readProjectConfig(root), slug: (0, jobId_1.getProjectSlug)(root, { hostname: os.hostname(), uid: os.userInfo().uid }) };
|
|
73
|
+
}
|
|
74
|
+
/** @description `.remote-run` of the project, or the empty config when there is none; a bad file is an error naming its lines. */
|
|
75
|
+
function readProjectConfig(root) {
|
|
76
|
+
const configPath = path.join(root, projectConfig_1.projectConfigName);
|
|
77
|
+
let text;
|
|
78
|
+
try {
|
|
79
|
+
text = fs.readFileSync(configPath, 'utf8');
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
if (error instanceof Error && 'code' in error && error.code === 'ENOENT')
|
|
83
|
+
return (0, projectConfig_1.createEmptyProjectConfig)();
|
|
84
|
+
throw new remoteRunError_1.RemoteRunError(`${projectConfig_1.projectConfigName} could not be read`);
|
|
85
|
+
}
|
|
86
|
+
const parsed = (0, projectConfig_1.parseProjectConfig)(text);
|
|
87
|
+
if (!parsed.ok)
|
|
88
|
+
throw new remoteRunError_1.RemoteRunError(parsed.errors.join('\n'));
|
|
89
|
+
return parsed.config;
|
|
90
|
+
}
|
|
91
|
+
function splitNul(output) {
|
|
92
|
+
return output.split('\0').filter((entry) => entry !== '');
|
|
93
|
+
}
|
|
94
|
+
function listGitDirectory(directory) {
|
|
95
|
+
const files = splitNul(runGit(directory, ['ls-files', '-co', '--exclude-standard', '-z', '--deduplicate']));
|
|
96
|
+
const staged = splitNul(runGit(directory, ['ls-files', '-s', '-z']));
|
|
97
|
+
const gitlinks = staged.filter((entry) => entry.startsWith(`${gitlinkMode} `)).map((entry) => entry.slice(entry.indexOf('\t') + 1));
|
|
98
|
+
return { files, gitlinks };
|
|
99
|
+
}
|
|
100
|
+
/** Every sendable path of `directory` and of its checked-out submodules (recursively), relative to `directory`, prefixed with `prefix`. */
|
|
101
|
+
function listFilesRecursively(directory, prefix) {
|
|
102
|
+
const { files, gitlinks } = listGitDirectory(directory);
|
|
103
|
+
const result = files.filter((file) => !gitlinks.includes(file)).map((file) => `${prefix}${file}`);
|
|
104
|
+
for (const gitlink of gitlinks) {
|
|
105
|
+
const submodule = path.join(directory, gitlink);
|
|
106
|
+
if (fs.existsSync(path.join(submodule, '.git')))
|
|
107
|
+
result.push(...listFilesRecursively(submodule, `${prefix}${gitlink}/`));
|
|
108
|
+
}
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
111
|
+
/** A file git lists but that is gone from the disk (deleted, not yet staged) or is not a file or a link is not sent: the runner's copy loses it. */
|
|
112
|
+
function checkIsSendable(root, relativePath) {
|
|
113
|
+
try {
|
|
114
|
+
const stat = fs.lstatSync(path.join(root, relativePath));
|
|
115
|
+
return stat.isFile() || stat.isSymbolicLink();
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/** Ignored files that exist, consulted only for what `send:` opts in; a collapsed ignored DIRECTORY (`node_modules/`) is never one of them. */
|
|
122
|
+
function listIgnoredFiles(root) {
|
|
123
|
+
return splitNul(runGit(root, ['ls-files', '-o', '-i', '--exclude-standard', '--directory', '-z'])).filter((entry) => !entry.endsWith('/'));
|
|
124
|
+
}
|
|
125
|
+
/** @description What goes to the runner for this project: git's lists, trimmed and opted in by `.remote-run` (`planSendList`). */
|
|
126
|
+
function planProjectSend(project) {
|
|
127
|
+
const files = listFilesRecursively(project.root, '').filter((file) => checkIsSendable(project.root, file));
|
|
128
|
+
const ignoredFiles = project.config.send.length === 0 ? [] : listIgnoredFiles(project.root).filter((file) => checkIsSendable(project.root, file));
|
|
129
|
+
return (0, sendPlan_1.planSendList)({ files, ignoredFiles, exclude: project.config.exclude, send: project.config.send });
|
|
130
|
+
}
|
|
131
|
+
/** The folders hook managers conventionally keep git hooks in (husky's, and the common `.githooks`): protected whether or not git points at them yet. */
|
|
132
|
+
const conventionalHookDirectories = ['.husky', '.githooks'];
|
|
133
|
+
/** The folder husky 9 points `core.hooksPath` at; the hooks a developer writes are in its parent. */
|
|
134
|
+
const huskyShimDirectoryName = '_';
|
|
135
|
+
/**
|
|
136
|
+
* @description The folders of the project (relative, `/`-separated) in which a file runs on this machine at the next git command, so a
|
|
137
|
+
* result file from a runner must never land there: where git looks for hooks (`git rev-parse --git-path hooks`, which already folds in
|
|
138
|
+
* `core.hooksPath`) when that is inside the project — and, for husky's `_` shim folder, its parent, where the real hooks are — plus the
|
|
139
|
+
* conventional hook folders, which become live the moment a hook manager's install step points git at them. A hooks folder that is the
|
|
140
|
+
* project root itself is `''`: nothing may come back. Ones outside the project (the default `.git/hooks` is covered by the `.git` rule; a
|
|
141
|
+
* worktree's lives in the main checkout) are not the project's to protect.
|
|
142
|
+
*/
|
|
143
|
+
function getHookDirectories(projectRoot) {
|
|
144
|
+
const directories = new Set(conventionalHookDirectories);
|
|
145
|
+
const result = (0, child_process_1.spawnSync)('git', ['-C', projectRoot, 'rev-parse', '--git-path', 'hooks'], { encoding: 'utf8', timeout: gitDeadlineMs });
|
|
146
|
+
if (result.error === undefined && result.status === 0 && result.stdout.trim() !== '') {
|
|
147
|
+
const relative = path.relative(fs.realpathSync(projectRoot), path.resolve(projectRoot, result.stdout.trim()));
|
|
148
|
+
if (!relative.startsWith('..') && !path.isAbsolute(relative)) {
|
|
149
|
+
const hooksDirectory = relative.split(path.sep).join('/');
|
|
150
|
+
directories.add(hooksDirectory);
|
|
151
|
+
if (path.posix.basename(hooksDirectory) === huskyShimDirectoryName) {
|
|
152
|
+
const parent = path.posix.dirname(hooksDirectory);
|
|
153
|
+
directories.add(parent === '.' ? '' : parent);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return [...directories];
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=project.js.map
|