charness 0.0.0-stage → 3.0.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/.env.example +88 -0
- package/DEVELOPMENT.md +110 -0
- package/LICENSE +21 -0
- package/MIGRATION_1_TO_2.md +24 -0
- package/README.md +1024 -2
- package/dist/accessControl.d.ts +71 -0
- package/dist/accessControl.d.ts.map +1 -0
- package/dist/accessControl.js +108 -0
- package/dist/accessControl.js.map +1 -0
- package/dist/adapters/adapterEventRouting.d.ts +51 -0
- package/dist/adapters/adapterEventRouting.d.ts.map +1 -0
- package/dist/adapters/adapterEventRouting.js +74 -0
- package/dist/adapters/adapterEventRouting.js.map +1 -0
- package/dist/adapters/adapterNames.d.ts +19 -0
- package/dist/adapters/adapterNames.d.ts.map +1 -0
- package/dist/adapters/adapterNames.js +25 -0
- package/dist/adapters/adapterNames.js.map +1 -0
- package/dist/adapters/claudeCliAdapter.d.ts +1336 -0
- package/dist/adapters/claudeCliAdapter.d.ts.map +1 -0
- package/dist/adapters/claudeCliAdapter.js +4204 -0
- package/dist/adapters/claudeCliAdapter.js.map +1 -0
- package/dist/adapters/claudeJsonStreamAdapter.d.ts +548 -0
- package/dist/adapters/claudeJsonStreamAdapter.d.ts.map +1 -0
- package/dist/adapters/claudeJsonStreamAdapter.js +1810 -0
- package/dist/adapters/claudeJsonStreamAdapter.js.map +1 -0
- package/dist/adapters/claudePlatformFlags.d.ts +35 -0
- package/dist/adapters/claudePlatformFlags.d.ts.map +1 -0
- package/dist/adapters/claudePlatformFlags.js +46 -0
- package/dist/adapters/claudePlatformFlags.js.map +1 -0
- package/dist/adapters/createAdapter.d.ts +252 -0
- package/dist/adapters/createAdapter.d.ts.map +1 -0
- package/dist/adapters/createAdapter.js +475 -0
- package/dist/adapters/createAdapter.js.map +1 -0
- package/dist/adapters/openCodeAdapter.d.ts +1446 -0
- package/dist/adapters/openCodeAdapter.d.ts.map +1 -0
- package/dist/adapters/openCodeAdapter.js +4540 -0
- package/dist/adapters/openCodeAdapter.js.map +1 -0
- package/dist/adapters/sessionLaunchDefaults.d.ts +28 -0
- package/dist/adapters/sessionLaunchDefaults.d.ts.map +1 -0
- package/dist/adapters/sessionLaunchDefaults.js +15 -0
- package/dist/adapters/sessionLaunchDefaults.js.map +1 -0
- package/dist/adapters/terminalAdapter.d.ts +68 -0
- package/dist/adapters/terminalAdapter.d.ts.map +1 -0
- package/dist/adapters/terminalAdapter.js +371 -0
- package/dist/adapters/terminalAdapter.js.map +1 -0
- package/dist/agentLogin/agentLogin.d.ts +31 -0
- package/dist/agentLogin/agentLogin.d.ts.map +1 -0
- package/dist/agentLogin/agentLogin.js +493 -0
- package/dist/agentLogin/agentLogin.js.map +1 -0
- package/dist/agentTrigger.d.ts +28 -0
- package/dist/agentTrigger.d.ts.map +1 -0
- package/dist/agentTrigger.js +53 -0
- package/dist/agentTrigger.js.map +1 -0
- package/dist/apiErrorRetry.d.ts +209 -0
- package/dist/apiErrorRetry.d.ts.map +1 -0
- package/dist/apiErrorRetry.js +351 -0
- package/dist/apiErrorRetry.js.map +1 -0
- package/dist/apiRetryKick.d.ts +148 -0
- package/dist/apiRetryKick.d.ts.map +1 -0
- package/dist/apiRetryKick.js +158 -0
- package/dist/apiRetryKick.js.map +1 -0
- package/dist/bootClassifier.d.ts +46 -0
- package/dist/bootClassifier.d.ts.map +1 -0
- package/dist/bootClassifier.js +43 -0
- package/dist/bootClassifier.js.map +1 -0
- package/dist/bot.d.ts +207 -0
- package/dist/bot.d.ts.map +1 -0
- package/dist/bot.js +10611 -0
- package/dist/bot.js.map +1 -0
- package/dist/botFileStorage.d.ts +60 -0
- package/dist/botFileStorage.d.ts.map +1 -0
- package/dist/botFileStorage.js +205 -0
- package/dist/botFileStorage.js.map +1 -0
- package/dist/cli/applyDnsFix.d.ts +7 -0
- package/dist/cli/applyDnsFix.d.ts.map +1 -0
- package/dist/cli/applyDnsFix.js +46 -0
- package/dist/cli/applyDnsFix.js.map +1 -0
- package/dist/cli/bot.d.ts +27 -0
- package/dist/cli/bot.d.ts.map +1 -0
- package/dist/cli/bot.js +98 -0
- package/dist/cli/bot.js.map +1 -0
- package/dist/cli/botEntry.d.ts +3 -0
- package/dist/cli/botEntry.d.ts.map +1 -0
- package/dist/cli/botEntry.js +11 -0
- package/dist/cli/botEntry.js.map +1 -0
- package/dist/cli/connectorGuards.d.ts +31 -0
- package/dist/cli/connectorGuards.d.ts.map +1 -0
- package/dist/cli/connectorGuards.js +159 -0
- package/dist/cli/connectorGuards.js.map +1 -0
- package/dist/cli/envLoader.d.ts +34 -0
- package/dist/cli/envLoader.d.ts.map +1 -0
- package/dist/cli/envLoader.js +132 -0
- package/dist/cli/envLoader.js.map +1 -0
- package/dist/cli/hot.d.ts +82 -0
- package/dist/cli/hot.d.ts.map +1 -0
- package/dist/cli/hot.js +323 -0
- package/dist/cli/hot.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +130 -0
- package/dist/cli.js.map +1 -0
- package/dist/connectors/jira/adf.d.ts +72 -0
- package/dist/connectors/jira/adf.d.ts.map +1 -0
- package/dist/connectors/jira/adf.js +407 -0
- package/dist/connectors/jira/adf.js.map +1 -0
- package/dist/connectors/jira/agentBinaries.d.ts +14 -0
- package/dist/connectors/jira/agentBinaries.d.ts.map +1 -0
- package/dist/connectors/jira/agentBinaries.js +75 -0
- package/dist/connectors/jira/agentBinaries.js.map +1 -0
- package/dist/connectors/jira/answerSink.d.ts +52 -0
- package/dist/connectors/jira/answerSink.d.ts.map +1 -0
- package/dist/connectors/jira/answerSink.js +220 -0
- package/dist/connectors/jira/answerSink.js.map +1 -0
- package/dist/connectors/jira/attachmentDownload.d.ts +41 -0
- package/dist/connectors/jira/attachmentDownload.d.ts.map +1 -0
- package/dist/connectors/jira/attachmentDownload.js +92 -0
- package/dist/connectors/jira/attachmentDownload.js.map +1 -0
- package/dist/connectors/jira/attachmentTool.d.ts +43 -0
- package/dist/connectors/jira/attachmentTool.d.ts.map +1 -0
- package/dist/connectors/jira/attachmentTool.js +150 -0
- package/dist/connectors/jira/attachmentTool.js.map +1 -0
- package/dist/connectors/jira/client.d.ts +490 -0
- package/dist/connectors/jira/client.d.ts.map +1 -0
- package/dist/connectors/jira/client.js +453 -0
- package/dist/connectors/jira/client.js.map +1 -0
- package/dist/connectors/jira/config.d.ts +117 -0
- package/dist/connectors/jira/config.d.ts.map +1 -0
- package/dist/connectors/jira/config.js +350 -0
- package/dist/connectors/jira/config.js.map +1 -0
- package/dist/connectors/jira/configFile.d.ts +10 -0
- package/dist/connectors/jira/configFile.d.ts.map +1 -0
- package/dist/connectors/jira/configFile.js +50 -0
- package/dist/connectors/jira/configFile.js.map +1 -0
- package/dist/connectors/jira/connector.d.ts +68 -0
- package/dist/connectors/jira/connector.d.ts.map +1 -0
- package/dist/connectors/jira/connector.js +257 -0
- package/dist/connectors/jira/connector.js.map +1 -0
- package/dist/connectors/jira/contextLedger.d.ts +59 -0
- package/dist/connectors/jira/contextLedger.d.ts.map +1 -0
- package/dist/connectors/jira/contextLedger.js +194 -0
- package/dist/connectors/jira/contextLedger.js.map +1 -0
- package/dist/connectors/jira/contextPreamble.d.ts +18 -0
- package/dist/connectors/jira/contextPreamble.d.ts.map +1 -0
- package/dist/connectors/jira/contextPreamble.js +31 -0
- package/dist/connectors/jira/contextPreamble.js.map +1 -0
- package/dist/connectors/jira/inbound.d.ts +132 -0
- package/dist/connectors/jira/inbound.d.ts.map +1 -0
- package/dist/connectors/jira/inbound.js +316 -0
- package/dist/connectors/jira/inbound.js.map +1 -0
- package/dist/connectors/jira/issueBlocks.d.ts +51 -0
- package/dist/connectors/jira/issueBlocks.d.ts.map +1 -0
- package/dist/connectors/jira/issueBlocks.js +182 -0
- package/dist/connectors/jira/issueBlocks.js.map +1 -0
- package/dist/connectors/jira/issueContext.d.ts +25 -0
- package/dist/connectors/jira/issueContext.d.ts.map +1 -0
- package/dist/connectors/jira/issueContext.js +53 -0
- package/dist/connectors/jira/issueContext.js.map +1 -0
- package/dist/connectors/jira/issueDelta.d.ts +35 -0
- package/dist/connectors/jira/issueDelta.d.ts.map +1 -0
- package/dist/connectors/jira/issueDelta.js +50 -0
- package/dist/connectors/jira/issueDelta.js.map +1 -0
- package/dist/connectors/jira/mediaPlaceholders.d.ts +20 -0
- package/dist/connectors/jira/mediaPlaceholders.d.ts.map +1 -0
- package/dist/connectors/jira/mediaPlaceholders.js +92 -0
- package/dist/connectors/jira/mediaPlaceholders.js.map +1 -0
- package/dist/connectors/jira/outbound.d.ts +6 -0
- package/dist/connectors/jira/outbound.d.ts.map +1 -0
- package/dist/connectors/jira/outbound.js +38 -0
- package/dist/connectors/jira/outbound.js.map +1 -0
- package/dist/connectors/jira/prompt.d.ts +37 -0
- package/dist/connectors/jira/prompt.d.ts.map +1 -0
- package/dist/connectors/jira/prompt.js +99 -0
- package/dist/connectors/jira/prompt.js.map +1 -0
- package/dist/connectors/jira/promptSpill.d.ts +50 -0
- package/dist/connectors/jira/promptSpill.d.ts.map +1 -0
- package/dist/connectors/jira/promptSpill.js +157 -0
- package/dist/connectors/jira/promptSpill.js.map +1 -0
- package/dist/connectors/jira/promptText.d.ts +7 -0
- package/dist/connectors/jira/promptText.d.ts.map +1 -0
- package/dist/connectors/jira/promptText.js +26 -0
- package/dist/connectors/jira/promptText.js.map +1 -0
- package/dist/connectors/jira/sessionKeyCodec.d.ts +16 -0
- package/dist/connectors/jira/sessionKeyCodec.d.ts.map +1 -0
- package/dist/connectors/jira/sessionKeyCodec.js +101 -0
- package/dist/connectors/jira/sessionKeyCodec.js.map +1 -0
- package/dist/connectors/jira/trigger.d.ts +50 -0
- package/dist/connectors/jira/trigger.d.ts.map +1 -0
- package/dist/connectors/jira/trigger.js +93 -0
- package/dist/connectors/jira/trigger.js.map +1 -0
- package/dist/connectors/jira/triggerLog.d.ts +51 -0
- package/dist/connectors/jira/triggerLog.d.ts.map +1 -0
- package/dist/connectors/jira/triggerLog.js +78 -0
- package/dist/connectors/jira/triggerLog.js.map +1 -0
- package/dist/connectors/jira/unconfirmedPosts.d.ts +58 -0
- package/dist/connectors/jira/unconfirmedPosts.d.ts.map +1 -0
- package/dist/connectors/jira/unconfirmedPosts.js +105 -0
- package/dist/connectors/jira/unconfirmedPosts.js.map +1 -0
- package/dist/connectors/telegram/answerSink.d.ts +46 -0
- package/dist/connectors/telegram/answerSink.d.ts.map +1 -0
- package/dist/connectors/telegram/answerSink.js +71 -0
- package/dist/connectors/telegram/answerSink.js.map +1 -0
- package/dist/connectors/telegram/commands/autoContinueLimits.d.ts +31 -0
- package/dist/connectors/telegram/commands/autoContinueLimits.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/autoContinueLimits.js +142 -0
- package/dist/connectors/telegram/commands/autoContinueLimits.js.map +1 -0
- package/dist/connectors/telegram/commands/botCore.d.ts +46 -0
- package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/botCore.js +3 -0
- package/dist/connectors/telegram/commands/botCore.js.map +1 -0
- package/dist/connectors/telegram/commands/callbackMessage.d.ts +12 -0
- package/dist/connectors/telegram/commands/callbackMessage.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/callbackMessage.js +13 -0
- package/dist/connectors/telegram/commands/callbackMessage.js.map +1 -0
- package/dist/connectors/telegram/commands/compaction.d.ts +47 -0
- package/dist/connectors/telegram/commands/compaction.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/compaction.js +868 -0
- package/dist/connectors/telegram/commands/compaction.js.map +1 -0
- package/dist/connectors/telegram/commands/displayModes.d.ts +13 -0
- package/dist/connectors/telegram/commands/displayModes.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/displayModes.js +335 -0
- package/dist/connectors/telegram/commands/displayModes.js.map +1 -0
- package/dist/connectors/telegram/commands/modelProviders.d.ts +95 -0
- package/dist/connectors/telegram/commands/modelProviders.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/modelProviders.js +841 -0
- package/dist/connectors/telegram/commands/modelProviders.js.map +1 -0
- package/dist/connectors/telegram/commands/reminders.d.ts +54 -0
- package/dist/connectors/telegram/commands/reminders.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/reminders.js +624 -0
- package/dist/connectors/telegram/commands/reminders.js.map +1 -0
- package/dist/connectors/telegram/fileIntake.d.ts +166 -0
- package/dist/connectors/telegram/fileIntake.d.ts.map +1 -0
- package/dist/connectors/telegram/fileIntake.js +304 -0
- package/dist/connectors/telegram/fileIntake.js.map +1 -0
- package/dist/connectors/telegram/fileSendGateway.d.ts +57 -0
- package/dist/connectors/telegram/fileSendGateway.d.ts.map +1 -0
- package/dist/connectors/telegram/fileSendGateway.js +221 -0
- package/dist/connectors/telegram/fileSendGateway.js.map +1 -0
- package/dist/connectors/telegram/foreignKeyFallbacks.d.ts +52 -0
- package/dist/connectors/telegram/foreignKeyFallbacks.d.ts.map +1 -0
- package/dist/connectors/telegram/foreignKeyFallbacks.js +71 -0
- package/dist/connectors/telegram/foreignKeyFallbacks.js.map +1 -0
- package/dist/connectors/telegram/inbound.d.ts +131 -0
- package/dist/connectors/telegram/inbound.d.ts.map +1 -0
- package/dist/connectors/telegram/inbound.js +278 -0
- package/dist/connectors/telegram/inbound.js.map +1 -0
- package/dist/connectors/telegram/languagePicker.d.ts +32 -0
- package/dist/connectors/telegram/languagePicker.d.ts.map +1 -0
- package/dist/connectors/telegram/languagePicker.js +55 -0
- package/dist/connectors/telegram/languagePicker.js.map +1 -0
- package/dist/connectors/telegram/messageSplit.d.ts +62 -0
- package/dist/connectors/telegram/messageSplit.d.ts.map +1 -0
- package/dist/connectors/telegram/messageSplit.js +119 -0
- package/dist/connectors/telegram/messageSplit.js.map +1 -0
- package/dist/connectors/telegram/outbound.d.ts +62 -0
- package/dist/connectors/telegram/outbound.d.ts.map +1 -0
- package/dist/connectors/telegram/outbound.js +116 -0
- package/dist/connectors/telegram/outbound.js.map +1 -0
- package/dist/connectors/telegram/output/createOutputTransport.d.ts +34 -0
- package/dist/connectors/telegram/output/createOutputTransport.d.ts.map +1 -0
- package/dist/connectors/telegram/output/createOutputTransport.js +77 -0
- package/dist/connectors/telegram/output/createOutputTransport.js.map +1 -0
- package/dist/connectors/telegram/output/dmOutputTransport.d.ts +47 -0
- package/dist/connectors/telegram/output/dmOutputTransport.d.ts.map +1 -0
- package/dist/connectors/telegram/output/dmOutputTransport.js +412 -0
- package/dist/connectors/telegram/output/dmOutputTransport.js.map +1 -0
- package/dist/connectors/telegram/outputBacklogGlue.d.ts +38 -0
- package/dist/connectors/telegram/outputBacklogGlue.d.ts.map +1 -0
- package/dist/connectors/telegram/outputBacklogGlue.js +49 -0
- package/dist/connectors/telegram/outputBacklogGlue.js.map +1 -0
- package/dist/connectors/telegram/outputFlushPlan.d.ts +93 -0
- package/dist/connectors/telegram/outputFlushPlan.d.ts.map +1 -0
- package/dist/connectors/telegram/outputFlushPlan.js +120 -0
- package/dist/connectors/telegram/outputFlushPlan.js.map +1 -0
- package/dist/connectors/telegram/questionKeyboards.d.ts +30 -0
- package/dist/connectors/telegram/questionKeyboards.d.ts.map +1 -0
- package/dist/connectors/telegram/questionKeyboards.js +37 -0
- package/dist/connectors/telegram/questionKeyboards.js.map +1 -0
- package/dist/connectors/telegram/renderAgentHtml.d.ts +27 -0
- package/dist/connectors/telegram/renderAgentHtml.d.ts.map +1 -0
- package/dist/connectors/telegram/renderAgentHtml.js +97 -0
- package/dist/connectors/telegram/renderAgentHtml.js.map +1 -0
- package/dist/connectors/telegram/sessionKeyCodec.d.ts +28 -0
- package/dist/connectors/telegram/sessionKeyCodec.d.ts.map +1 -0
- package/dist/connectors/telegram/sessionKeyCodec.js +107 -0
- package/dist/connectors/telegram/sessionKeyCodec.js.map +1 -0
- package/dist/connectors/telegram/telegramCallGuard.d.ts +19 -0
- package/dist/connectors/telegram/telegramCallGuard.d.ts.map +1 -0
- package/dist/connectors/telegram/telegramCallGuard.js +35 -0
- package/dist/connectors/telegram/telegramCallGuard.js.map +1 -0
- package/dist/connectors/telegram/timezonePicker.d.ts +85 -0
- package/dist/connectors/telegram/timezonePicker.d.ts.map +1 -0
- package/dist/connectors/telegram/timezonePicker.js +142 -0
- package/dist/connectors/telegram/timezonePicker.js.map +1 -0
- package/dist/connectors/telegram/updateDispatcher.d.ts +85 -0
- package/dist/connectors/telegram/updateDispatcher.d.ts.map +1 -0
- package/dist/connectors/telegram/updateDispatcher.js +159 -0
- package/dist/connectors/telegram/updateDispatcher.js.map +1 -0
- package/dist/connectors/test/connector.d.ts +52 -0
- package/dist/connectors/test/connector.d.ts.map +1 -0
- package/dist/connectors/test/connector.js +143 -0
- package/dist/connectors/test/connector.js.map +1 -0
- package/dist/connectors/test/sessionKeyCodec.d.ts +25 -0
- package/dist/connectors/test/sessionKeyCodec.d.ts.map +1 -0
- package/dist/connectors/test/sessionKeyCodec.js +50 -0
- package/dist/connectors/test/sessionKeyCodec.js.map +1 -0
- package/dist/diagLog.d.ts +6 -0
- package/dist/diagLog.d.ts.map +1 -0
- package/dist/diagLog.js +58 -0
- package/dist/diagLog.js.map +1 -0
- package/dist/effortLevels.d.ts +68 -0
- package/dist/effortLevels.d.ts.map +1 -0
- package/dist/effortLevels.js +114 -0
- package/dist/effortLevels.js.map +1 -0
- package/dist/folderName.d.ts +42 -0
- package/dist/folderName.d.ts.map +1 -0
- package/dist/folderName.js +51 -0
- package/dist/folderName.js.map +1 -0
- package/dist/i18n/de.d.ts +2 -0
- package/dist/i18n/de.d.ts.map +1 -0
- package/dist/i18n/de.js +537 -0
- package/dist/i18n/de.js.map +1 -0
- package/dist/i18n/en.d.ts +7 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +566 -0
- package/dist/i18n/en.js.map +1 -0
- package/dist/i18n/es.d.ts +2 -0
- package/dist/i18n/es.d.ts.map +1 -0
- package/dist/i18n/es.js +537 -0
- package/dist/i18n/es.js.map +1 -0
- package/dist/i18n/fr.d.ts +2 -0
- package/dist/i18n/fr.d.ts.map +1 -0
- package/dist/i18n/fr.js +537 -0
- package/dist/i18n/fr.js.map +1 -0
- package/dist/i18n/hi.d.ts +2 -0
- package/dist/i18n/hi.d.ts.map +1 -0
- package/dist/i18n/hi.js +537 -0
- package/dist/i18n/hi.js.map +1 -0
- package/dist/i18n/ja.d.ts +2 -0
- package/dist/i18n/ja.d.ts.map +1 -0
- package/dist/i18n/ja.js +537 -0
- package/dist/i18n/ja.js.map +1 -0
- package/dist/i18n/ka.d.ts +2 -0
- package/dist/i18n/ka.d.ts.map +1 -0
- package/dist/i18n/ka.js +537 -0
- package/dist/i18n/ka.js.map +1 -0
- package/dist/i18n/pt.d.ts +2 -0
- package/dist/i18n/pt.d.ts.map +1 -0
- package/dist/i18n/pt.js +537 -0
- package/dist/i18n/pt.js.map +1 -0
- package/dist/i18n/ru.d.ts +6 -0
- package/dist/i18n/ru.d.ts.map +1 -0
- package/dist/i18n/ru.js +540 -0
- package/dist/i18n/ru.js.map +1 -0
- package/dist/i18n/uk.d.ts +8 -0
- package/dist/i18n/uk.d.ts.map +1 -0
- package/dist/i18n/uk.js +542 -0
- package/dist/i18n/uk.js.map +1 -0
- package/dist/i18n/uz.d.ts +2 -0
- package/dist/i18n/uz.d.ts.map +1 -0
- package/dist/i18n/uz.js +537 -0
- package/dist/i18n/uz.js.map +1 -0
- package/dist/i18n/zh.d.ts +2 -0
- package/dist/i18n/zh.d.ts.map +1 -0
- package/dist/i18n/zh.js +537 -0
- package/dist/i18n/zh.js.map +1 -0
- package/dist/i18n.d.ts +115 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +233 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/installManager.d.ts +99 -0
- package/dist/installManager.d.ts.map +1 -0
- package/dist/installManager.js +943 -0
- package/dist/installManager.js.map +1 -0
- package/dist/instanceLock.d.ts +161 -0
- package/dist/instanceLock.d.ts.map +1 -0
- package/dist/instanceLock.js +388 -0
- package/dist/instanceLock.js.map +1 -0
- package/dist/mcpConfig.d.ts +76 -0
- package/dist/mcpConfig.d.ts.map +1 -0
- package/dist/mcpConfig.js +270 -0
- package/dist/mcpConfig.js.map +1 -0
- package/dist/openCodeOpenQuestion.d.ts +44 -0
- package/dist/openCodeOpenQuestion.d.ts.map +1 -0
- package/dist/openCodeOpenQuestion.js +64 -0
- package/dist/openCodeOpenQuestion.js.map +1 -0
- package/dist/openCodeQuestionFlow.d.ts +105 -0
- package/dist/openCodeQuestionFlow.d.ts.map +1 -0
- package/dist/openCodeQuestionFlow.js +143 -0
- package/dist/openCodeQuestionFlow.js.map +1 -0
- package/dist/openCodeSessionRouting.d.ts +133 -0
- package/dist/openCodeSessionRouting.d.ts.map +1 -0
- package/dist/openCodeSessionRouting.js +253 -0
- package/dist/openCodeSessionRouting.js.map +1 -0
- package/dist/openCodeSessionTitle.d.ts +50 -0
- package/dist/openCodeSessionTitle.d.ts.map +1 -0
- package/dist/openCodeSessionTitle.js +84 -0
- package/dist/openCodeSessionTitle.js.map +1 -0
- package/dist/outputTrace.d.ts +108 -0
- package/dist/outputTrace.d.ts.map +1 -0
- package/dist/outputTrace.js +430 -0
- package/dist/outputTrace.js.map +1 -0
- package/dist/pendingQuestionRepost.d.ts +47 -0
- package/dist/pendingQuestionRepost.d.ts.map +1 -0
- package/dist/pendingQuestionRepost.js +29 -0
- package/dist/pendingQuestionRepost.js.map +1 -0
- package/dist/pinnedStatus.d.ts +52 -0
- package/dist/pinnedStatus.d.ts.map +1 -0
- package/dist/pinnedStatus.js +36 -0
- package/dist/pinnedStatus.js.map +1 -0
- package/dist/platform/answerSink.d.ts +93 -0
- package/dist/platform/answerSink.d.ts.map +1 -0
- package/dist/platform/answerSink.js +31 -0
- package/dist/platform/answerSink.js.map +1 -0
- package/dist/platform/capabilityFallback.d.ts +39 -0
- package/dist/platform/capabilityFallback.d.ts.map +1 -0
- package/dist/platform/capabilityFallback.js +55 -0
- package/dist/platform/capabilityFallback.js.map +1 -0
- package/dist/platform/commandRouter.d.ts +51 -0
- package/dist/platform/commandRouter.d.ts.map +1 -0
- package/dist/platform/commandRouter.js +53 -0
- package/dist/platform/commandRouter.js.map +1 -0
- package/dist/platform/connectorSet.d.ts +39 -0
- package/dist/platform/connectorSet.d.ts.map +1 -0
- package/dist/platform/connectorSet.js +55 -0
- package/dist/platform/connectorSet.js.map +1 -0
- package/dist/platform/inbound.d.ts +147 -0
- package/dist/platform/inbound.d.ts.map +1 -0
- package/dist/platform/inbound.js +18 -0
- package/dist/platform/inbound.js.map +1 -0
- package/dist/platform/outbound.d.ts +225 -0
- package/dist/platform/outbound.d.ts.map +1 -0
- package/dist/platform/outbound.js +30 -0
- package/dist/platform/outbound.js.map +1 -0
- package/dist/platform/unservedStateGuard.d.ts +27 -0
- package/dist/platform/unservedStateGuard.d.ts.map +1 -0
- package/dist/platform/unservedStateGuard.js +42 -0
- package/dist/platform/unservedStateGuard.js.map +1 -0
- package/dist/postToSession.d.ts +94 -0
- package/dist/postToSession.d.ts.map +1 -0
- package/dist/postToSession.js +56 -0
- package/dist/postToSession.js.map +1 -0
- package/dist/progressLine.d.ts +180 -0
- package/dist/progressLine.d.ts.map +1 -0
- package/dist/progressLine.js +293 -0
- package/dist/progressLine.js.map +1 -0
- package/dist/rateLimiter.d.ts +246 -0
- package/dist/rateLimiter.d.ts.map +1 -0
- package/dist/rateLimiter.js +555 -0
- package/dist/rateLimiter.js.map +1 -0
- package/dist/requests/answerRequest.d.ts +57 -0
- package/dist/requests/answerRequest.d.ts.map +1 -0
- package/dist/requests/answerRequest.js +96 -0
- package/dist/requests/answerRequest.js.map +1 -0
- package/dist/requests/answerTail.d.ts +83 -0
- package/dist/requests/answerTail.d.ts.map +1 -0
- package/dist/requests/answerTail.js +102 -0
- package/dist/requests/answerTail.js.map +1 -0
- package/dist/requests/limitWaitAnswer.d.ts +87 -0
- package/dist/requests/limitWaitAnswer.d.ts.map +1 -0
- package/dist/requests/limitWaitAnswer.js +83 -0
- package/dist/requests/limitWaitAnswer.js.map +1 -0
- package/dist/requests/requestGroup.d.ts +44 -0
- package/dist/requests/requestGroup.d.ts.map +1 -0
- package/dist/requests/requestGroup.js +63 -0
- package/dist/requests/requestGroup.js.map +1 -0
- package/dist/requests/requestHeader.d.ts +70 -0
- package/dist/requests/requestHeader.d.ts.map +1 -0
- package/dist/requests/requestHeader.js +83 -0
- package/dist/requests/requestHeader.js.map +1 -0
- package/dist/requests/requestLedger.d.ts +217 -0
- package/dist/requests/requestLedger.d.ts.map +1 -0
- package/dist/requests/requestLedger.js +468 -0
- package/dist/requests/requestLedger.js.map +1 -0
- package/dist/requests/sessionTurnProbe.d.ts +52 -0
- package/dist/requests/sessionTurnProbe.d.ts.map +1 -0
- package/dist/requests/sessionTurnProbe.js +29 -0
- package/dist/requests/sessionTurnProbe.js.map +1 -0
- package/dist/requests/types.d.ts +181 -0
- package/dist/requests/types.d.ts.map +1 -0
- package/dist/requests/types.js +9 -0
- package/dist/requests/types.js.map +1 -0
- package/dist/requests/wakeUpEngine.d.ts +160 -0
- package/dist/requests/wakeUpEngine.d.ts.map +1 -0
- package/dist/requests/wakeUpEngine.js +399 -0
- package/dist/requests/wakeUpEngine.js.map +1 -0
- package/dist/requests/wakeUpRules.d.ts +151 -0
- package/dist/requests/wakeUpRules.d.ts.map +1 -0
- package/dist/requests/wakeUpRules.js +167 -0
- package/dist/requests/wakeUpRules.js.map +1 -0
- package/dist/resumeContext.d.ts +87 -0
- package/dist/resumeContext.d.ts.map +1 -0
- package/dist/resumeContext.js +114 -0
- package/dist/resumeContext.js.map +1 -0
- package/dist/scheduler/checkRun.d.ts +95 -0
- package/dist/scheduler/checkRun.d.ts.map +1 -0
- package/dist/scheduler/checkRun.js +172 -0
- package/dist/scheduler/checkRun.js.map +1 -0
- package/dist/scheduler/delivery.d.ts +99 -0
- package/dist/scheduler/delivery.d.ts.map +1 -0
- package/dist/scheduler/delivery.js +212 -0
- package/dist/scheduler/delivery.js.map +1 -0
- package/dist/scheduler/deliveryKind.d.ts +29 -0
- package/dist/scheduler/deliveryKind.d.ts.map +1 -0
- package/dist/scheduler/deliveryKind.js +39 -0
- package/dist/scheduler/deliveryKind.js.map +1 -0
- package/dist/scheduler/directoryThreads.d.ts +19 -0
- package/dist/scheduler/directoryThreads.d.ts.map +1 -0
- package/dist/scheduler/directoryThreads.js +28 -0
- package/dist/scheduler/directoryThreads.js.map +1 -0
- package/dist/scheduler/engine.d.ts +77 -0
- package/dist/scheduler/engine.d.ts.map +1 -0
- package/dist/scheduler/engine.js +337 -0
- package/dist/scheduler/engine.js.map +1 -0
- package/dist/scheduler/injection.d.ts +102 -0
- package/dist/scheduler/injection.d.ts.map +1 -0
- package/dist/scheduler/injection.js +122 -0
- package/dist/scheduler/injection.js.map +1 -0
- package/dist/scheduler/mcpBoot.d.ts +65 -0
- package/dist/scheduler/mcpBoot.d.ts.map +1 -0
- package/dist/scheduler/mcpBoot.js +60 -0
- package/dist/scheduler/mcpBoot.js.map +1 -0
- package/dist/scheduler/mcpSurface.d.ts +355 -0
- package/dist/scheduler/mcpSurface.d.ts.map +1 -0
- package/dist/scheduler/mcpSurface.js +1257 -0
- package/dist/scheduler/mcpSurface.js.map +1 -0
- package/dist/scheduler/rebindResume.d.ts +27 -0
- package/dist/scheduler/rebindResume.d.ts.map +1 -0
- package/dist/scheduler/rebindResume.js +17 -0
- package/dist/scheduler/rebindResume.js.map +1 -0
- package/dist/scheduler/recurrence.d.ts +58 -0
- package/dist/scheduler/recurrence.d.ts.map +1 -0
- package/dist/scheduler/recurrence.js +210 -0
- package/dist/scheduler/recurrence.js.map +1 -0
- package/dist/scheduler/runLedger.d.ts +59 -0
- package/dist/scheduler/runLedger.d.ts.map +1 -0
- package/dist/scheduler/runLedger.js +54 -0
- package/dist/scheduler/runLedger.js.map +1 -0
- package/dist/scheduler/store.d.ts +97 -0
- package/dist/scheduler/store.d.ts.map +1 -0
- package/dist/scheduler/store.js +124 -0
- package/dist/scheduler/store.js.map +1 -0
- package/dist/scheduler/timezoneRecompute.d.ts +61 -0
- package/dist/scheduler/timezoneRecompute.d.ts.map +1 -0
- package/dist/scheduler/timezoneRecompute.js +46 -0
- package/dist/scheduler/timezoneRecompute.js.map +1 -0
- package/dist/scheduler/types.d.ts +139 -0
- package/dist/scheduler/types.d.ts.map +1 -0
- package/dist/scheduler/types.js +8 -0
- package/dist/scheduler/types.js.map +1 -0
- package/dist/sendErrorClassifier.d.ts +45 -0
- package/dist/sendErrorClassifier.d.ts.map +1 -0
- package/dist/sendErrorClassifier.js +65 -0
- package/dist/sendErrorClassifier.js.map +1 -0
- package/dist/sessionKey.d.ts +136 -0
- package/dist/sessionKey.d.ts.map +1 -0
- package/dist/sessionKey.js +153 -0
- package/dist/sessionKey.js.map +1 -0
- package/dist/sessionPick.d.ts +42 -0
- package/dist/sessionPick.d.ts.map +1 -0
- package/dist/sessionPick.js +39 -0
- package/dist/sessionPick.js.map +1 -0
- package/dist/shutdown.d.ts +126 -0
- package/dist/shutdown.d.ts.map +1 -0
- package/dist/shutdown.js +164 -0
- package/dist/shutdown.js.map +1 -0
- package/dist/startupPromptBuffer.d.ts +85 -0
- package/dist/startupPromptBuffer.d.ts.map +1 -0
- package/dist/startupPromptBuffer.js +123 -0
- package/dist/startupPromptBuffer.js.map +1 -0
- package/dist/state.d.ts +1245 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +1830 -0
- package/dist/state.js.map +1 -0
- package/dist/threadContextPreamble.d.ts +89 -0
- package/dist/threadContextPreamble.d.ts.map +1 -0
- package/dist/threadContextPreamble.js +102 -0
- package/dist/threadContextPreamble.js.map +1 -0
- package/dist/threadRouting.d.ts +164 -0
- package/dist/threadRouting.d.ts.map +1 -0
- package/dist/threadRouting.js +182 -0
- package/dist/threadRouting.js.map +1 -0
- package/dist/types.d.ts +1015 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/abortableFifo.d.ts +10 -0
- package/dist/utils/abortableFifo.d.ts.map +1 -0
- package/dist/utils/abortableFifo.js +55 -0
- package/dist/utils/abortableFifo.js.map +1 -0
- package/dist/utils/adoptedToolList.d.ts +27 -0
- package/dist/utils/adoptedToolList.d.ts.map +1 -0
- package/dist/utils/adoptedToolList.js +22 -0
- package/dist/utils/adoptedToolList.js.map +1 -0
- package/dist/utils/agentEnvironment.d.ts +42 -0
- package/dist/utils/agentEnvironment.d.ts.map +1 -0
- package/dist/utils/agentEnvironment.js +122 -0
- package/dist/utils/agentEnvironment.js.map +1 -0
- package/dist/utils/ansiClean.d.ts +11 -0
- package/dist/utils/ansiClean.d.ts.map +1 -0
- package/dist/utils/ansiClean.js +139 -0
- package/dist/utils/ansiClean.js.map +1 -0
- package/dist/utils/autoContinueOnLimit.d.ts +49 -0
- package/dist/utils/autoContinueOnLimit.d.ts.map +1 -0
- package/dist/utils/autoContinueOnLimit.js +69 -0
- package/dist/utils/autoContinueOnLimit.js.map +1 -0
- package/dist/utils/canonicalPathContainment.d.ts +7 -0
- package/dist/utils/canonicalPathContainment.d.ts.map +1 -0
- package/dist/utils/canonicalPathContainment.js +48 -0
- package/dist/utils/canonicalPathContainment.js.map +1 -0
- package/dist/utils/claudeAuthLogin.d.ts +71 -0
- package/dist/utils/claudeAuthLogin.d.ts.map +1 -0
- package/dist/utils/claudeAuthLogin.js +93 -0
- package/dist/utils/claudeAuthLogin.js.map +1 -0
- package/dist/utils/claudeChunkClassifier.d.ts +97 -0
- package/dist/utils/claudeChunkClassifier.d.ts.map +1 -0
- package/dist/utils/claudeChunkClassifier.js +254 -0
- package/dist/utils/claudeChunkClassifier.js.map +1 -0
- package/dist/utils/claudeCodeVersion.d.ts +31 -0
- package/dist/utils/claudeCodeVersion.d.ts.map +1 -0
- package/dist/utils/claudeCodeVersion.js +62 -0
- package/dist/utils/claudeCodeVersion.js.map +1 -0
- package/dist/utils/claudeCompactHook.d.ts +64 -0
- package/dist/utils/claudeCompactHook.d.ts.map +1 -0
- package/dist/utils/claudeCompactHook.js +98 -0
- package/dist/utils/claudeCompactHook.js.map +1 -0
- package/dist/utils/claudeLivenessAction.d.ts +208 -0
- package/dist/utils/claudeLivenessAction.d.ts.map +1 -0
- package/dist/utils/claudeLivenessAction.js +135 -0
- package/dist/utils/claudeLivenessAction.js.map +1 -0
- package/dist/utils/claudeMcpHeal.d.ts +92 -0
- package/dist/utils/claudeMcpHeal.d.ts.map +1 -0
- package/dist/utils/claudeMcpHeal.js +91 -0
- package/dist/utils/claudeMcpHeal.js.map +1 -0
- package/dist/utils/claudeRelayRouting.d.ts +86 -0
- package/dist/utils/claudeRelayRouting.d.ts.map +1 -0
- package/dist/utils/claudeRelayRouting.js +159 -0
- package/dist/utils/claudeRelayRouting.js.map +1 -0
- package/dist/utils/claudeRuntimeInfo.d.ts +26 -0
- package/dist/utils/claudeRuntimeInfo.d.ts.map +1 -0
- package/dist/utils/claudeRuntimeInfo.js +151 -0
- package/dist/utils/claudeRuntimeInfo.js.map +1 -0
- package/dist/utils/claudeScrapeShapes.d.ts +256 -0
- package/dist/utils/claudeScrapeShapes.d.ts.map +1 -0
- package/dist/utils/claudeScrapeShapes.js +290 -0
- package/dist/utils/claudeScrapeShapes.js.map +1 -0
- package/dist/utils/claudeSessionTitle.d.ts +27 -0
- package/dist/utils/claudeSessionTitle.d.ts.map +1 -0
- package/dist/utils/claudeSessionTitle.js +90 -0
- package/dist/utils/claudeSessionTitle.js.map +1 -0
- package/dist/utils/claudeStreamJson.d.ts +202 -0
- package/dist/utils/claudeStreamJson.d.ts.map +1 -0
- package/dist/utils/claudeStreamJson.js +351 -0
- package/dist/utils/claudeStreamJson.js.map +1 -0
- package/dist/utils/claudeSubagentTail.d.ts +93 -0
- package/dist/utils/claudeSubagentTail.d.ts.map +1 -0
- package/dist/utils/claudeSubagentTail.js +136 -0
- package/dist/utils/claudeSubagentTail.js.map +1 -0
- package/dist/utils/clearThreadOutputQueues.d.ts +43 -0
- package/dist/utils/clearThreadOutputQueues.d.ts.map +1 -0
- package/dist/utils/clearThreadOutputQueues.js +39 -0
- package/dist/utils/clearThreadOutputQueues.js.map +1 -0
- package/dist/utils/compactCommandRoute.d.ts +45 -0
- package/dist/utils/compactCommandRoute.d.ts.map +1 -0
- package/dist/utils/compactCommandRoute.js +36 -0
- package/dist/utils/compactCommandRoute.js.map +1 -0
- package/dist/utils/compactOnIdle.d.ts +329 -0
- package/dist/utils/compactOnIdle.d.ts.map +1 -0
- package/dist/utils/compactOnIdle.js +379 -0
- package/dist/utils/compactOnIdle.js.map +1 -0
- package/dist/utils/consoleFileTap.d.ts +51 -0
- package/dist/utils/consoleFileTap.d.ts.map +1 -0
- package/dist/utils/consoleFileTap.js +86 -0
- package/dist/utils/consoleFileTap.js.map +1 -0
- package/dist/utils/displayVerbosity.d.ts +44 -0
- package/dist/utils/displayVerbosity.d.ts.map +1 -0
- package/dist/utils/displayVerbosity.js +75 -0
- package/dist/utils/displayVerbosity.js.map +1 -0
- package/dist/utils/download.d.ts +72 -0
- package/dist/utils/download.d.ts.map +1 -0
- package/dist/utils/download.js +216 -0
- package/dist/utils/download.js.map +1 -0
- package/dist/utils/draftFinalize.d.ts +110 -0
- package/dist/utils/draftFinalize.d.ts.map +1 -0
- package/dist/utils/draftFinalize.js +100 -0
- package/dist/utils/draftFinalize.js.map +1 -0
- package/dist/utils/draftId.d.ts +36 -0
- package/dist/utils/draftId.d.ts.map +1 -0
- package/dist/utils/draftId.js +46 -0
- package/dist/utils/draftId.js.map +1 -0
- package/dist/utils/draftPacer.d.ts +72 -0
- package/dist/utils/draftPacer.d.ts.map +1 -0
- package/dist/utils/draftPacer.js +53 -0
- package/dist/utils/draftPacer.js.map +1 -0
- package/dist/utils/effortStartupKeystroke.d.ts +20 -0
- package/dist/utils/effortStartupKeystroke.d.ts.map +1 -0
- package/dist/utils/effortStartupKeystroke.js +28 -0
- package/dist/utils/effortStartupKeystroke.js.map +1 -0
- package/dist/utils/ensureSessionPlan.d.ts +70 -0
- package/dist/utils/ensureSessionPlan.d.ts.map +1 -0
- package/dist/utils/ensureSessionPlan.js +54 -0
- package/dist/utils/ensureSessionPlan.js.map +1 -0
- package/dist/utils/fileSendPlan.d.ts +217 -0
- package/dist/utils/fileSendPlan.d.ts.map +1 -0
- package/dist/utils/fileSendPlan.js +291 -0
- package/dist/utils/fileSendPlan.js.map +1 -0
- package/dist/utils/fileSendService.d.ts +94 -0
- package/dist/utils/fileSendService.d.ts.map +1 -0
- package/dist/utils/fileSendService.js +387 -0
- package/dist/utils/fileSendService.js.map +1 -0
- package/dist/utils/groupFinalizePlan.d.ts +38 -0
- package/dist/utils/groupFinalizePlan.d.ts.map +1 -0
- package/dist/utils/groupFinalizePlan.js +35 -0
- package/dist/utils/groupFinalizePlan.js.map +1 -0
- package/dist/utils/identicalOutputGuard.d.ts +83 -0
- package/dist/utils/identicalOutputGuard.d.ts.map +1 -0
- package/dist/utils/identicalOutputGuard.js +99 -0
- package/dist/utils/identicalOutputGuard.js.map +1 -0
- package/dist/utils/isoTimestamp.d.ts +16 -0
- package/dist/utils/isoTimestamp.d.ts.map +1 -0
- package/dist/utils/isoTimestamp.js +34 -0
- package/dist/utils/isoTimestamp.js.map +1 -0
- package/dist/utils/jsonStreamBusyWatchdog.d.ts +130 -0
- package/dist/utils/jsonStreamBusyWatchdog.d.ts.map +1 -0
- package/dist/utils/jsonStreamBusyWatchdog.js +122 -0
- package/dist/utils/jsonStreamBusyWatchdog.js.map +1 -0
- package/dist/utils/jsonStreamHost.d.ts +227 -0
- package/dist/utils/jsonStreamHost.d.ts.map +1 -0
- package/dist/utils/jsonStreamHost.js +417 -0
- package/dist/utils/jsonStreamHost.js.map +1 -0
- package/dist/utils/keyedTransitionQueue.d.ts +18 -0
- package/dist/utils/keyedTransitionQueue.d.ts.map +1 -0
- package/dist/utils/keyedTransitionQueue.js +34 -0
- package/dist/utils/keyedTransitionQueue.js.map +1 -0
- package/dist/utils/limitEpisodeRecovery.d.ts +92 -0
- package/dist/utils/limitEpisodeRecovery.d.ts.map +1 -0
- package/dist/utils/limitEpisodeRecovery.js +133 -0
- package/dist/utils/limitEpisodeRecovery.js.map +1 -0
- package/dist/utils/limitHeldPromptQueue.d.ts +48 -0
- package/dist/utils/limitHeldPromptQueue.d.ts.map +1 -0
- package/dist/utils/limitHeldPromptQueue.js +59 -0
- package/dist/utils/limitHeldPromptQueue.js.map +1 -0
- package/dist/utils/limitHeldPrompts.d.ts +58 -0
- package/dist/utils/limitHeldPrompts.d.ts.map +1 -0
- package/dist/utils/limitHeldPrompts.js +65 -0
- package/dist/utils/limitHeldPrompts.js.map +1 -0
- package/dist/utils/linkPreviewSuppression.d.ts +18 -0
- package/dist/utils/linkPreviewSuppression.d.ts.map +1 -0
- package/dist/utils/linkPreviewSuppression.js +37 -0
- package/dist/utils/linkPreviewSuppression.js.map +1 -0
- package/dist/utils/localClock.d.ts +15 -0
- package/dist/utils/localClock.d.ts.map +1 -0
- package/dist/utils/localClock.js +29 -0
- package/dist/utils/localClock.js.map +1 -0
- package/dist/utils/markdownTableRender.d.ts +83 -0
- package/dist/utils/markdownTableRender.d.ts.map +1 -0
- package/dist/utils/markdownTableRender.js +298 -0
- package/dist/utils/markdownTableRender.js.map +1 -0
- package/dist/utils/mediaGroupCollector.d.ts +51 -0
- package/dist/utils/mediaGroupCollector.d.ts.map +1 -0
- package/dist/utils/mediaGroupCollector.js +90 -0
- package/dist/utils/mediaGroupCollector.js.map +1 -0
- package/dist/utils/messageSendService.d.ts +136 -0
- package/dist/utils/messageSendService.d.ts.map +1 -0
- package/dist/utils/messageSendService.js +165 -0
- package/dist/utils/messageSendService.js.map +1 -0
- package/dist/utils/minutesOverride.d.ts +7 -0
- package/dist/utils/minutesOverride.d.ts.map +1 -0
- package/dist/utils/minutesOverride.js +16 -0
- package/dist/utils/minutesOverride.js.map +1 -0
- package/dist/utils/modelPickerPlan.d.ts +119 -0
- package/dist/utils/modelPickerPlan.d.ts.map +1 -0
- package/dist/utils/modelPickerPlan.js +171 -0
- package/dist/utils/modelPickerPlan.js.map +1 -0
- package/dist/utils/modelSetReplyDecision.d.ts +67 -0
- package/dist/utils/modelSetReplyDecision.d.ts.map +1 -0
- package/dist/utils/modelSetReplyDecision.js +27 -0
- package/dist/utils/modelSetReplyDecision.js.map +1 -0
- package/dist/utils/openCodeAuthLogin.d.ts +181 -0
- package/dist/utils/openCodeAuthLogin.d.ts.map +1 -0
- package/dist/utils/openCodeAuthLogin.js +393 -0
- package/dist/utils/openCodeAuthLogin.js.map +1 -0
- package/dist/utils/openCodeCompactPlugin.d.ts +81 -0
- package/dist/utils/openCodeCompactPlugin.d.ts.map +1 -0
- package/dist/utils/openCodeCompactPlugin.js +146 -0
- package/dist/utils/openCodeCompactPlugin.js.map +1 -0
- package/dist/utils/openCodeTurnActivity.d.ts +67 -0
- package/dist/utils/openCodeTurnActivity.d.ts.map +1 -0
- package/dist/utils/openCodeTurnActivity.js +27 -0
- package/dist/utils/openCodeTurnActivity.js.map +1 -0
- package/dist/utils/outputDebounce.d.ts +24 -0
- package/dist/utils/outputDebounce.d.ts.map +1 -0
- package/dist/utils/outputDebounce.js +30 -0
- package/dist/utils/outputDebounce.js.map +1 -0
- package/dist/utils/outputFlushTiming.d.ts +54 -0
- package/dist/utils/outputFlushTiming.d.ts.map +1 -0
- package/dist/utils/outputFlushTiming.js +48 -0
- package/dist/utils/outputFlushTiming.js.map +1 -0
- package/dist/utils/paginateList.d.ts +25 -0
- package/dist/utils/paginateList.d.ts.map +1 -0
- package/dist/utils/paginateList.js +32 -0
- package/dist/utils/paginateList.js.map +1 -0
- package/dist/utils/paneDiff.d.ts +55 -0
- package/dist/utils/paneDiff.d.ts.map +1 -0
- package/dist/utils/paneDiff.js +88 -0
- package/dist/utils/paneDiff.js.map +1 -0
- package/dist/utils/paneResizeGuard.d.ts +69 -0
- package/dist/utils/paneResizeGuard.d.ts.map +1 -0
- package/dist/utils/paneResizeGuard.js +91 -0
- package/dist/utils/paneResizeGuard.js.map +1 -0
- package/dist/utils/persistAdapterSessionIds.d.ts +39 -0
- package/dist/utils/persistAdapterSessionIds.d.ts.map +1 -0
- package/dist/utils/persistAdapterSessionIds.js +28 -0
- package/dist/utils/persistAdapterSessionIds.js.map +1 -0
- package/dist/utils/pinnedBannerSkipDecision.d.ts +44 -0
- package/dist/utils/pinnedBannerSkipDecision.d.ts.map +1 -0
- package/dist/utils/pinnedBannerSkipDecision.js +20 -0
- package/dist/utils/pinnedBannerSkipDecision.js.map +1 -0
- package/dist/utils/pollBackoff.d.ts +45 -0
- package/dist/utils/pollBackoff.d.ts.map +1 -0
- package/dist/utils/pollBackoff.js +44 -0
- package/dist/utils/pollBackoff.js.map +1 -0
- package/dist/utils/promptDelivery.d.ts +46 -0
- package/dist/utils/promptDelivery.d.ts.map +1 -0
- package/dist/utils/promptDelivery.js +49 -0
- package/dist/utils/promptDelivery.js.map +1 -0
- package/dist/utils/providerDisconnectPlan.d.ts +82 -0
- package/dist/utils/providerDisconnectPlan.d.ts.map +1 -0
- package/dist/utils/providerDisconnectPlan.js +110 -0
- package/dist/utils/providerDisconnectPlan.js.map +1 -0
- package/dist/utils/rateLimitLog.d.ts +48 -0
- package/dist/utils/rateLimitLog.d.ts.map +1 -0
- package/dist/utils/rateLimitLog.js +43 -0
- package/dist/utils/rateLimitLog.js.map +1 -0
- package/dist/utils/recentRelayWindow.d.ts +165 -0
- package/dist/utils/recentRelayWindow.d.ts.map +1 -0
- package/dist/utils/recentRelayWindow.js +284 -0
- package/dist/utils/recentRelayWindow.js.map +1 -0
- package/dist/utils/recvPreviewRedaction.d.ts +23 -0
- package/dist/utils/recvPreviewRedaction.d.ts.map +1 -0
- package/dist/utils/recvPreviewRedaction.js +39 -0
- package/dist/utils/recvPreviewRedaction.js.map +1 -0
- package/dist/utils/reminderFlow.d.ts +148 -0
- package/dist/utils/reminderFlow.d.ts.map +1 -0
- package/dist/utils/reminderFlow.js +122 -0
- package/dist/utils/reminderFlow.js.map +1 -0
- package/dist/utils/reminderScheduleText.d.ts +87 -0
- package/dist/utils/reminderScheduleText.d.ts.map +1 -0
- package/dist/utils/reminderScheduleText.js +135 -0
- package/dist/utils/reminderScheduleText.js.map +1 -0
- package/dist/utils/reminderWizard.d.ts +710 -0
- package/dist/utils/reminderWizard.d.ts.map +1 -0
- package/dist/utils/reminderWizard.js +1164 -0
- package/dist/utils/reminderWizard.js.map +1 -0
- package/dist/utils/replyQuote.d.ts +111 -0
- package/dist/utils/replyQuote.d.ts.map +1 -0
- package/dist/utils/replyQuote.js +122 -0
- package/dist/utils/replyQuote.js.map +1 -0
- package/dist/utils/resolveBinary.d.ts +25 -0
- package/dist/utils/resolveBinary.d.ts.map +1 -0
- package/dist/utils/resolveBinary.js +99 -0
- package/dist/utils/resolveBinary.js.map +1 -0
- package/dist/utils/retryAfterHeader.d.ts +7 -0
- package/dist/utils/retryAfterHeader.d.ts.map +1 -0
- package/dist/utils/retryAfterHeader.js +17 -0
- package/dist/utils/retryAfterHeader.js.map +1 -0
- package/dist/utils/rotatingJsonlFile.d.ts +40 -0
- package/dist/utils/rotatingJsonlFile.d.ts.map +1 -0
- package/dist/utils/rotatingJsonlFile.js +106 -0
- package/dist/utils/rotatingJsonlFile.js.map +1 -0
- package/dist/utils/rotatingLogFile.d.ts +25 -0
- package/dist/utils/rotatingLogFile.d.ts.map +1 -0
- package/dist/utils/rotatingLogFile.js +74 -0
- package/dist/utils/rotatingLogFile.js.map +1 -0
- package/dist/utils/sendRateTracker.d.ts +59 -0
- package/dist/utils/sendRateTracker.d.ts.map +1 -0
- package/dist/utils/sendRateTracker.js +144 -0
- package/dist/utils/sendRateTracker.js.map +1 -0
- package/dist/utils/serialQueue.d.ts +5 -0
- package/dist/utils/serialQueue.d.ts.map +1 -0
- package/dist/utils/serialQueue.js +14 -0
- package/dist/utils/serialQueue.js.map +1 -0
- package/dist/utils/sseStreamLifecycle.d.ts +32 -0
- package/dist/utils/sseStreamLifecycle.d.ts.map +1 -0
- package/dist/utils/sseStreamLifecycle.js +41 -0
- package/dist/utils/sseStreamLifecycle.js.map +1 -0
- package/dist/utils/startupReadiness.d.ts +119 -0
- package/dist/utils/startupReadiness.d.ts.map +1 -0
- package/dist/utils/startupReadiness.js +148 -0
- package/dist/utils/startupReadiness.js.map +1 -0
- package/dist/utils/statusFlushDecision.d.ts +18 -0
- package/dist/utils/statusFlushDecision.d.ts.map +1 -0
- package/dist/utils/statusFlushDecision.js +53 -0
- package/dist/utils/statusFlushDecision.js.map +1 -0
- package/dist/utils/subagentRender.d.ts +52 -0
- package/dist/utils/subagentRender.d.ts.map +1 -0
- package/dist/utils/subagentRender.js +66 -0
- package/dist/utils/subagentRender.js.map +1 -0
- package/dist/utils/subagentStatusRender.d.ts +90 -0
- package/dist/utils/subagentStatusRender.d.ts.map +1 -0
- package/dist/utils/subagentStatusRender.js +124 -0
- package/dist/utils/subagentStatusRender.js.map +1 -0
- package/dist/utils/telegramError.d.ts +2 -0
- package/dist/utils/telegramError.d.ts.map +1 -0
- package/dist/utils/telegramError.js +16 -0
- package/dist/utils/telegramError.js.map +1 -0
- package/dist/utils/terminalEmitPlan.d.ts +74 -0
- package/dist/utils/terminalEmitPlan.d.ts.map +1 -0
- package/dist/utils/terminalEmitPlan.js +86 -0
- package/dist/utils/terminalEmitPlan.js.map +1 -0
- package/dist/utils/thinkingRender.d.ts +74 -0
- package/dist/utils/thinkingRender.d.ts.map +1 -0
- package/dist/utils/thinkingRender.js +85 -0
- package/dist/utils/thinkingRender.js.map +1 -0
- package/dist/utils/threadStatusReport.d.ts +55 -0
- package/dist/utils/threadStatusReport.d.ts.map +1 -0
- package/dist/utils/threadStatusReport.js +65 -0
- package/dist/utils/threadStatusReport.js.map +1 -0
- package/dist/utils/threadToggle.d.ts +29 -0
- package/dist/utils/threadToggle.d.ts.map +1 -0
- package/dist/utils/threadToggle.js +39 -0
- package/dist/utils/threadToggle.js.map +1 -0
- package/dist/utils/timezone.d.ts +125 -0
- package/dist/utils/timezone.d.ts.map +1 -0
- package/dist/utils/timezone.js +278 -0
- package/dist/utils/timezone.js.map +1 -0
- package/dist/utils/tmuxExec.d.ts +61 -0
- package/dist/utils/tmuxExec.d.ts.map +1 -0
- package/dist/utils/tmuxExec.js +109 -0
- package/dist/utils/tmuxExec.js.map +1 -0
- package/dist/utils/tmuxSessionName.d.ts +34 -0
- package/dist/utils/tmuxSessionName.d.ts.map +1 -0
- package/dist/utils/tmuxSessionName.js +51 -0
- package/dist/utils/tmuxSessionName.js.map +1 -0
- package/dist/utils/toolResultRender.d.ts +61 -0
- package/dist/utils/toolResultRender.d.ts.map +1 -0
- package/dist/utils/toolResultRender.js +62 -0
- package/dist/utils/toolResultRender.js.map +1 -0
- package/dist/utils/topicRequest.d.ts +61 -0
- package/dist/utils/topicRequest.d.ts.map +1 -0
- package/dist/utils/topicRequest.js +68 -0
- package/dist/utils/topicRequest.js.map +1 -0
- package/dist/utils/topicView.d.ts +55 -0
- package/dist/utils/topicView.d.ts.map +1 -0
- package/dist/utils/topicView.js +56 -0
- package/dist/utils/topicView.js.map +1 -0
- package/dist/utils/transcribeAudio.d.ts +89 -0
- package/dist/utils/transcribeAudio.d.ts.map +1 -0
- package/dist/utils/transcribeAudio.js +249 -0
- package/dist/utils/transcribeAudio.js.map +1 -0
- package/dist/utils/transientFrames.d.ts +52 -0
- package/dist/utils/transientFrames.d.ts.map +1 -0
- package/dist/utils/transientFrames.js +41 -0
- package/dist/utils/transientFrames.js.map +1 -0
- package/dist/utils/typingActive.d.ts +35 -0
- package/dist/utils/typingActive.d.ts.map +1 -0
- package/dist/utils/typingActive.js +22 -0
- package/dist/utils/typingActive.js.map +1 -0
- package/dist/utils/typingLoopBackstop.d.ts +64 -0
- package/dist/utils/typingLoopBackstop.d.ts.map +1 -0
- package/dist/utils/typingLoopBackstop.js +68 -0
- package/dist/utils/typingLoopBackstop.js.map +1 -0
- package/dist/utils/verbosityRender.d.ts +18 -0
- package/dist/utils/verbosityRender.d.ts.map +1 -0
- package/dist/utils/verbosityRender.js +17 -0
- package/dist/utils/verbosityRender.js.map +1 -0
- package/dist/utils/wedgeRecovery.d.ts +57 -0
- package/dist/utils/wedgeRecovery.d.ts.map +1 -0
- package/dist/utils/wedgeRecovery.js +24 -0
- package/dist/utils/wedgeRecovery.js.map +1 -0
- package/dist/utils.d.ts +30 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +61 -0
- package/dist/utils.js.map +1 -0
- package/dist/validation.d.ts +113 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +226 -0
- package/dist/validation.js.map +1 -0
- package/dist/voiceQueue.d.ts +7 -0
- package/dist/voiceQueue.d.ts.map +1 -0
- package/dist/voiceQueue.js +33 -0
- package/dist/voiceQueue.js.map +1 -0
- package/examples/.env.example +17 -0
- package/examples/docker-compose.yml +36 -0
- package/package.json +83 -4
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultRequestBackstopMs = exports.postRetryDelaysMs = exports.progressFollowUpDelayMs = exports.maxWakeUpsPerRequest = exports.maxSilentTurns = void 0;
|
|
4
|
+
exports.getPostRetryUpdate = getPostRetryUpdate;
|
|
5
|
+
exports.getRequestBackstopMs = getRequestBackstopMs;
|
|
6
|
+
exports.checkIsWakingStopped = checkIsWakingStopped;
|
|
7
|
+
exports.decideTurnEnd = decideTurnEnd;
|
|
8
|
+
exports.decideUnwatchedRequest = decideUnwatchedRequest;
|
|
9
|
+
exports.checkIsTurnInputConsumed = checkIsTurnInputConsumed;
|
|
10
|
+
exports.getWatchedTurnState = getWatchedTurnState;
|
|
11
|
+
exports.checkIsWatchedTurnStale = checkIsWatchedTurnStale;
|
|
12
|
+
const minutesOverride_1 = require("../utils/minutesOverride");
|
|
13
|
+
/**
|
|
14
|
+
* @description The wake-up rules of the request/answer core (S4), as pure
|
|
15
|
+
* decisions over an open request and what the session looks like right now:
|
|
16
|
+
*
|
|
17
|
+
* turn ends, request still open
|
|
18
|
+
* └─ the turn sent NO answer → silent-turn counter +1
|
|
19
|
+
* counter < 2 → wake the same session at once
|
|
20
|
+
* counter = 2 → alert a person, stop waking
|
|
21
|
+
* └─ the turn sent a progress → counter = 0, wake again after 15 min
|
|
22
|
+
* cap: 10 wake-ups per request → alert, stop waking (loop guard)
|
|
23
|
+
* backstop: nothing seen working on it for 90 min (a dead process, tracking
|
|
24
|
+
* lost across a restart or a watch that never saw its turn end)
|
|
25
|
+
* → resume / wake the session
|
|
26
|
+
*
|
|
27
|
+
* A wake-up never interrupts a live turn and never starts while the session is
|
|
28
|
+
* blocked on something that is not a turn end (a pending native question, a
|
|
29
|
+
* compaction, an armed API-error retry or usage-limit wait). After the alert or
|
|
30
|
+
* the cap nothing wakes the request again until it closes or is superseded.
|
|
31
|
+
*/
|
|
32
|
+
/** Silent turns in a row that make the rules give up. */
|
|
33
|
+
exports.maxSilentTurns = 2;
|
|
34
|
+
/** Wake-ups one request may receive before the loop guard gives up. */
|
|
35
|
+
exports.maxWakeUpsPerRequest = 10;
|
|
36
|
+
/** After a progress answer, how long before the agent is reminded again. */
|
|
37
|
+
exports.progressFollowUpDelayMs = 15 * 60 * 1000;
|
|
38
|
+
/**
|
|
39
|
+
* After a request's prompt could not be posted (no session, a forward that
|
|
40
|
+
* failed), when to try again (R28): soon, then less soon — these retries are not
|
|
41
|
+
* wake-ups of a silent agent, so they do not count against the wake-up cap.
|
|
42
|
+
*/
|
|
43
|
+
exports.postRetryDelaysMs = [60 * 1000, 5 * 60 * 1000, 15 * 60 * 1000];
|
|
44
|
+
/**
|
|
45
|
+
* @description The next post retry after a failed post (R28), or `null` once the
|
|
46
|
+
* retries are spent — the normal backstop / alert rules take the request then.
|
|
47
|
+
*/
|
|
48
|
+
function getPostRetryUpdate(request, nowMs) {
|
|
49
|
+
const retryCount = request.postRetryCount ?? 0;
|
|
50
|
+
const delayMs = exports.postRetryDelaysMs[retryCount];
|
|
51
|
+
return delayMs === undefined ? null : { postRetryCount: retryCount + 1, nextPostRetryAt: nowMs + delayMs };
|
|
52
|
+
}
|
|
53
|
+
/** Default backstop: open with nothing seen working on it for this long. */
|
|
54
|
+
exports.defaultRequestBackstopMs = 90 * 60 * 1000;
|
|
55
|
+
/**
|
|
56
|
+
* @description The backstop window, honouring the `REQUEST_BACKSTOP_MINUTES`
|
|
57
|
+
* override (a live test shortens it to finish a killed-process scenario in
|
|
58
|
+
* minutes). A missing, non-numeric or non-positive value keeps the default.
|
|
59
|
+
*/
|
|
60
|
+
function getRequestBackstopMs(overrideMinutes) {
|
|
61
|
+
return (0, minutesOverride_1.getMinutesOverrideMs)(overrideMinutes, exports.defaultRequestBackstopMs);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @description Whether anything may still wake the request: the rules' own
|
|
65
|
+
* give-up (`isWakeStopped`, for good) and a limit stop (`isLimitStopped`, until a
|
|
66
|
+
* limit wait ends with a resume) both say no.
|
|
67
|
+
*/
|
|
68
|
+
function checkIsWakingStopped(request) {
|
|
69
|
+
return request.isWakeStopped || request.isLimitStopped === true;
|
|
70
|
+
}
|
|
71
|
+
/** The update that stops every further wake-up of a request. */
|
|
72
|
+
const stopWakingUpdate = { isWakeStopped: true, nextWakeAt: undefined };
|
|
73
|
+
/**
|
|
74
|
+
* @description Wake the request now unless it already used up its wake-ups, in
|
|
75
|
+
* which case the loop guard alerts instead. `update` adds to the wake's own
|
|
76
|
+
* bookkeeping.
|
|
77
|
+
*/
|
|
78
|
+
function getWakeOrCapDecision(request, reason, update) {
|
|
79
|
+
if (request.wakeCount >= exports.maxWakeUpsPerRequest) {
|
|
80
|
+
return { kind: 'alert', reason: 'wakeCap', update: { ...update, ...stopWakingUpdate } };
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
kind: 'wake',
|
|
84
|
+
reason,
|
|
85
|
+
update: { ...update, wakeCount: request.wakeCount + 1, nextWakeAt: undefined },
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* @description The decision at the end of a turn the request's message started.
|
|
90
|
+
* `progressCountAtTurnStart` is the request's progress-answer count when the
|
|
91
|
+
* turn began, so an increase means this turn sent a progress note (a `question`
|
|
92
|
+
* or `final` would have closed the request — there is nothing to decide then).
|
|
93
|
+
*/
|
|
94
|
+
function decideTurnEnd(request, progressCountAtTurnStart, nowMs) {
|
|
95
|
+
if (checkIsWakingStopped(request))
|
|
96
|
+
return { kind: 'none' };
|
|
97
|
+
if (request.progressAnswerCount > progressCountAtTurnStart) {
|
|
98
|
+
return {
|
|
99
|
+
kind: 'followUpLater',
|
|
100
|
+
update: { silentTurnCount: 0, nextWakeAt: nowMs + exports.progressFollowUpDelayMs, lastTurnActivityAt: nowMs },
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
const silentTurnCount = request.silentTurnCount + 1;
|
|
104
|
+
if (silentTurnCount >= exports.maxSilentTurns) {
|
|
105
|
+
return { kind: 'alert', reason: 'silentTurns', update: { silentTurnCount, ...stopWakingUpdate } };
|
|
106
|
+
}
|
|
107
|
+
return getWakeOrCapDecision(request, 'silentTurn', { silentTurnCount, lastTurnActivityAt: nowMs });
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* @description The periodic decision for an open request whose turn is NOT being
|
|
111
|
+
* watched: a due progress follow-up, or the backstop. Never while the session is
|
|
112
|
+
* working or blocked — and a live turn counts as activity, which pushes the
|
|
113
|
+
* backstop back (the caller records it).
|
|
114
|
+
*/
|
|
115
|
+
function decideUnwatchedRequest(request, probe, nowMs, backstopMs) {
|
|
116
|
+
if (checkIsWakingStopped(request) || probe.isBusy || probe.isTurnEndBlocked)
|
|
117
|
+
return { kind: 'none' };
|
|
118
|
+
if (request.nextPostRetryAt !== undefined) {
|
|
119
|
+
// R28: outside the wake-up cap — the agent never saw the request, it is not looping.
|
|
120
|
+
return nowMs >= request.nextPostRetryAt
|
|
121
|
+
? { kind: 'wake', reason: 'postRetry', update: { nextPostRetryAt: undefined, lastTurnActivityAt: nowMs } }
|
|
122
|
+
: { kind: 'none' };
|
|
123
|
+
}
|
|
124
|
+
if (request.nextWakeAt !== undefined) {
|
|
125
|
+
return nowMs >= request.nextWakeAt ? getWakeOrCapDecision(request, 'progressFollowUp', {}) : { kind: 'none' };
|
|
126
|
+
}
|
|
127
|
+
const lastSeenAt = request.lastTurnActivityAt ?? request.createdAt;
|
|
128
|
+
return nowMs - lastSeenAt >= backstopMs
|
|
129
|
+
? getWakeOrCapDecision(request, 'backstop', { lastTurnActivityAt: nowMs })
|
|
130
|
+
: { kind: 'none' };
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* @description Has the backend taken in what was forwarded for this turn? Its own
|
|
134
|
+
* signal when it has one (nothing written is still unread), else busy or output
|
|
135
|
+
* seen since the forward.
|
|
136
|
+
*/
|
|
137
|
+
function checkIsTurnInputConsumed(turn, probe) {
|
|
138
|
+
return probe.hasUnconsumedInput === null ? turn.hasSeenBusy || turn.hasSeenOutput : !probe.hasUnconsumedInput;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* @description Has the turn the request's message started ended? The backend
|
|
142
|
+
* must first have TAKEN IN the message — otherwise an idle reported for the
|
|
143
|
+
* earlier turn would read as this turn's end: a backend that tracks it says so
|
|
144
|
+
* (`hasUnconsumedInput`), one that does not must have been seen busy or
|
|
145
|
+
* producing output since the forward (the busy-onset race).
|
|
146
|
+
*/
|
|
147
|
+
function getWatchedTurnState(turn, probe) {
|
|
148
|
+
if (!probe.isActive)
|
|
149
|
+
return probe.isTurnEndBlocked ? 'running' : 'sessionGone';
|
|
150
|
+
if (!checkIsTurnInputConsumed(turn, probe) || probe.isBusy || probe.isTurnEndBlocked)
|
|
151
|
+
return 'running';
|
|
152
|
+
return 'ended';
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* @description Has a watched turn that is still `running` lost its tracking? It
|
|
156
|
+
* is idle, nothing holds it open, and nothing was seen working on the request
|
|
157
|
+
* for the whole backstop window — so what keeps it `running` is a consumption
|
|
158
|
+
* signal that never settled (an input counter left behind, a turn start never
|
|
159
|
+
* seen). Dropping the watch hands the request to the backstop: a watch that
|
|
160
|
+
* stayed forever would silence every wake-up and alert of the request.
|
|
161
|
+
*/
|
|
162
|
+
function checkIsWatchedTurnStale(request, probe, nowMs, backstopMs) {
|
|
163
|
+
if (probe.isBusy || probe.isTurnEndBlocked)
|
|
164
|
+
return false;
|
|
165
|
+
return nowMs - (request.lastTurnActivityAt ?? request.createdAt) >= backstopMs;
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=wakeUpRules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wakeUpRules.js","sourceRoot":"","sources":["../../src/requests/wakeUpRules.ts"],"names":[],"mappings":";;;AAwCA,gDAIC;AAUD,oDAEC;AAmCD,oDAEC;AA+BD,sCAaC;AAQD,wDAoBC;AAoCD,4DAEC;AASD,kDAIC;AAUD,0DAQC;AAzOD,8DAAgE;AAEhE;;;;;;;;;;;;;;;;;;GAkBG;AAEH,yDAAyD;AAC5C,QAAA,cAAc,GAAG,CAAC,CAAC;AAChC,uEAAuE;AAC1D,QAAA,oBAAoB,GAAG,EAAE,CAAC;AACvC,4EAA4E;AAC/D,QAAA,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACtD;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,CAAU,CAAC;AAErF;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,OAAyB,EAAE,KAAa;IACzE,MAAM,UAAU,GAAG,OAAO,CAAC,cAAc,IAAI,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,yBAAiB,CAAC,UAAU,CAAC,CAAC;IAC9C,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,GAAG,CAAC,EAAE,eAAe,EAAE,KAAK,GAAG,OAAO,EAAE,CAAC;AAC7G,CAAC;AAED,4EAA4E;AAC/D,QAAA,wBAAwB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEvD;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,eAAmC;IACtE,OAAO,IAAA,sCAAoB,EAAC,eAAe,EAAE,gCAAwB,CAAC,CAAC;AACzE,CAAC;AA8BD;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,OAAyB;IAC5D,OAAO,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,cAAc,KAAK,IAAI,CAAC;AAClE,CAAC;AAED,gEAAgE;AAChE,MAAM,gBAAgB,GAAsB,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AAE3F;;;;GAIG;AACH,SAAS,oBAAoB,CAC3B,OAAyB,EACzB,MAA2B,EAC3B,MAAyB;IAEzB,IAAI,OAAO,CAAC,SAAS,IAAI,4BAAoB,EAAE,CAAC;QAC9C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,gBAAgB,EAAE,EAAE,CAAC;IAC1F,CAAC;IACD,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,MAAM;QACN,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,GAAG,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE;KAC/E,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,OAAyB,EAAE,wBAAgC,EAAE,KAAa;IACtG,IAAI,oBAAoB,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC3D,IAAI,OAAO,CAAC,mBAAmB,GAAG,wBAAwB,EAAE,CAAC;QAC3D,OAAO;YACL,IAAI,EAAE,eAAe;YACrB,MAAM,EAAE,EAAE,eAAe,EAAE,CAAC,EAAE,UAAU,EAAE,KAAK,GAAG,+BAAuB,EAAE,kBAAkB,EAAE,KAAK,EAAE;SACvG,CAAC;IACJ,CAAC;IACD,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,GAAG,CAAC,CAAC;IACpD,IAAI,eAAe,IAAI,sBAAc,EAAE,CAAC;QACtC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,eAAe,EAAE,GAAG,gBAAgB,EAAE,EAAE,CAAC;IACpG,CAAC;IACD,OAAO,oBAAoB,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,eAAe,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,CAAC;AACrG,CAAC;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB,CACpC,OAAyB,EACzB,KAAuB,EACvB,KAAa,EACb,UAAkB;IAElB,IAAI,oBAAoB,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,gBAAgB;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACrG,IAAI,OAAO,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QAC1C,qFAAqF;QACrF,OAAO,KAAK,IAAI,OAAO,CAAC,eAAe;YACrC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,kBAAkB,EAAE,KAAK,EAAE,EAAE;YAC1G,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACvB,CAAC;IACD,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACrC,OAAO,KAAK,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAChH,CAAC;IACD,MAAM,UAAU,GAAG,OAAO,CAAC,kBAAkB,IAAI,OAAO,CAAC,SAAS,CAAC;IACnE,OAAO,KAAK,GAAG,UAAU,IAAI,UAAU;QACrC,CAAC,CAAC,oBAAoB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC;QAC1E,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACvB,CAAC;AA+BD;;;;GAIG;AACH,SAAgB,wBAAwB,CAAC,IAAiB,EAAE,KAAuB;IACjF,OAAO,KAAK,CAAC,kBAAkB,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC;AAChH,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAAC,IAAiB,EAAE,KAAuB;IAC5E,IAAI,CAAC,KAAK,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC;IAC/E,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,gBAAgB;QAAE,OAAO,SAAS,CAAC;IACvG,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,uBAAuB,CACrC,OAAyB,EACzB,KAAuB,EACvB,KAAa,EACb,UAAkB;IAElB,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,gBAAgB;QAAE,OAAO,KAAK,CAAC;IACzD,OAAO,KAAK,GAAG,CAAC,OAAO,CAAC,kBAAkB,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,UAAU,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { RecentTurn } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @description How many recent conversational turns the resume context block
|
|
4
|
+
* shows. Tunable: raising it shows more history, lowering it shows less. Kept
|
|
5
|
+
* small so resuming a long session does not re-flood the topic — this turn
|
|
6
|
+
* count is the only flood bound (each turn is rendered in full; the bot's
|
|
7
|
+
* message-splitting handles turns longer than the Telegram cap).
|
|
8
|
+
*/
|
|
9
|
+
export declare const resumeContextTurnLimit = 3;
|
|
10
|
+
/**
|
|
11
|
+
* @description Render the last conversational turns as role-labeled blocks, each
|
|
12
|
+
* in FULL (no per-turn truncation — the bot's message-splitting handles over-cap
|
|
13
|
+
* blocks). Shared by {@link formatResumeContext} (the `/sessions` resume block)
|
|
14
|
+
* and {@link formatReattachRecap} (the silent-reattach recap) so the turn body
|
|
15
|
+
* looks identical in both. `turns` must be chronological (oldest→newest).
|
|
16
|
+
*
|
|
17
|
+
* Pure (only reads i18n) — the stored user prompts carry the forwarded
|
|
18
|
+
* "[Telegram thread context]" glue, which is service noise when shown back, so
|
|
19
|
+
* it is stripped from user turns only (assistant text is never touched).
|
|
20
|
+
*/
|
|
21
|
+
export declare function renderTurns(turns: RecentTurn[]): string[];
|
|
22
|
+
/**
|
|
23
|
+
* @description Render the short resume context block from the last conversational
|
|
24
|
+
* turns of a resumed session. `turns` must already be chronological
|
|
25
|
+
* (oldest→newest) and capped to {@link resumeContextTurnLimit} by the caller
|
|
26
|
+
* (the adapter's `getRecentTurns`).
|
|
27
|
+
*
|
|
28
|
+
* Output is a localized header (with the turn count) followed by the
|
|
29
|
+
* role-labeled turn blocks from {@link renderTurns}, each rendered in FULL — the
|
|
30
|
+
* user expects the complete last messages, and the bot's message-splitting path
|
|
31
|
+
* (`getOutputFlushPlan` → `splitMessage`) chunks a block over the Telegram cap.
|
|
32
|
+
* Returns `null` when there are no turns (brand-new / pruned-history session)
|
|
33
|
+
* so the caller emits nothing extra.
|
|
34
|
+
*
|
|
35
|
+
* Pure (only reads i18n, no I/O) so it is unit-testable without a live backend.
|
|
36
|
+
*/
|
|
37
|
+
export declare function formatResumeContext(turns: RecentTurn[]): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* @description Anti-spam gate for the silent-reattach recap. Decides whether
|
|
40
|
+
* {@link formatReattachRecap}'s output should actually be posted, given the boot
|
|
41
|
+
* mode. Two trigger paths:
|
|
42
|
+
*
|
|
43
|
+
* - **Known missed output** (`missedCount > 0`) → ALWAYS post: the agent produced
|
|
44
|
+
* messages the user never saw, regardless of whether the gap was a hot reload
|
|
45
|
+
* or a cold start. Recovering them is the whole point.
|
|
46
|
+
* - **Fallback** (watermark unknown but there ARE turns) → post ONLY on a COLD
|
|
47
|
+
* start. On a hot reload (sub-second blink) nothing was actually missed, so
|
|
48
|
+
* re-showing the last turns is pure noise — and a watermark-less session (first
|
|
49
|
+
* run after ship, pruned transcript) would otherwise re-spam every active topic
|
|
50
|
+
* on every hot rebuild (the exact regression the old recent-turns block was
|
|
51
|
+
* disabled to avoid).
|
|
52
|
+
*
|
|
53
|
+
* Pure (no I/O) so it is unit-testable. A clean reload with a known watermark and
|
|
54
|
+
* no missed output (`missedCount === 0`, known) is always silent.
|
|
55
|
+
*/
|
|
56
|
+
export declare function checkShouldPostReattachRecap(args: {
|
|
57
|
+
missedCount: number;
|
|
58
|
+
isWatermarkKnown: boolean;
|
|
59
|
+
hasTurns: boolean;
|
|
60
|
+
isColdStart: boolean;
|
|
61
|
+
}): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* @description Format the post-restart recap shown on a SILENT reattach (the bot
|
|
64
|
+
* re-adopted a session that kept working while the bot was down), so output
|
|
65
|
+
* produced during the downtime is recovered instead of lost. Mirrors
|
|
66
|
+
* {@link formatResumeContext}'s turn body (via {@link renderTurns}) under a
|
|
67
|
+
* scale-conveying header:
|
|
68
|
+
*
|
|
69
|
+
* - `isWatermarkKnown && missedCount > 0` → the count header
|
|
70
|
+
* ("⚠️ Missed N message(s) …"); the body stays the last few turns regardless
|
|
71
|
+
* of N (the count conveys scale, the hard turn cap is the flood bound).
|
|
72
|
+
* - otherwise (watermark unknown / untrusted) → the no-number fallback header.
|
|
73
|
+
*
|
|
74
|
+
* A best-effort trailing "still working …" line is appended only when `isActive`.
|
|
75
|
+
* Returns `null` when there are no turns to show (the caller posts nothing).
|
|
76
|
+
*
|
|
77
|
+
* Pure (only reads i18n, no I/O) so it is unit-testable. The caller
|
|
78
|
+
* (`reattachExistingSessions`) owns the anti-spam gate — it invokes this only
|
|
79
|
+
* when `missedCount > 0` OR (watermark unknown AND there are turns).
|
|
80
|
+
*/
|
|
81
|
+
export declare function formatReattachRecap(args: {
|
|
82
|
+
missedCount: number;
|
|
83
|
+
turns: RecentTurn[];
|
|
84
|
+
isActive: boolean;
|
|
85
|
+
isWatermarkKnown: boolean;
|
|
86
|
+
}): string | null;
|
|
87
|
+
//# sourceMappingURL=resumeContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resumeContext.d.ts","sourceRoot":"","sources":["../src/resumeContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE,CAQzD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,GAAG,IAAI,CAKtE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;CACtB,GAAG,OAAO,CAIV;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,GAAG,MAAM,GAAG,IAAI,CAYhB"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resumeContextTurnLimit = void 0;
|
|
4
|
+
exports.renderTurns = renderTurns;
|
|
5
|
+
exports.formatResumeContext = formatResumeContext;
|
|
6
|
+
exports.checkShouldPostReattachRecap = checkShouldPostReattachRecap;
|
|
7
|
+
exports.formatReattachRecap = formatReattachRecap;
|
|
8
|
+
const i18n_1 = require("./i18n");
|
|
9
|
+
const threadContextPreamble_1 = require("./threadContextPreamble");
|
|
10
|
+
/**
|
|
11
|
+
* @description How many recent conversational turns the resume context block
|
|
12
|
+
* shows. Tunable: raising it shows more history, lowering it shows less. Kept
|
|
13
|
+
* small so resuming a long session does not re-flood the topic — this turn
|
|
14
|
+
* count is the only flood bound (each turn is rendered in full; the bot's
|
|
15
|
+
* message-splitting handles turns longer than the Telegram cap).
|
|
16
|
+
*/
|
|
17
|
+
exports.resumeContextTurnLimit = 3;
|
|
18
|
+
/**
|
|
19
|
+
* @description Render the last conversational turns as role-labeled blocks, each
|
|
20
|
+
* in FULL (no per-turn truncation — the bot's message-splitting handles over-cap
|
|
21
|
+
* blocks). Shared by {@link formatResumeContext} (the `/sessions` resume block)
|
|
22
|
+
* and {@link formatReattachRecap} (the silent-reattach recap) so the turn body
|
|
23
|
+
* looks identical in both. `turns` must be chronological (oldest→newest).
|
|
24
|
+
*
|
|
25
|
+
* Pure (only reads i18n) — the stored user prompts carry the forwarded
|
|
26
|
+
* "[Telegram thread context]" glue, which is service noise when shown back, so
|
|
27
|
+
* it is stripped from user turns only (assistant text is never touched).
|
|
28
|
+
*/
|
|
29
|
+
function renderTurns(turns) {
|
|
30
|
+
const userLabel = (0, i18n_1.t)('resume.context_user_label');
|
|
31
|
+
const assistantLabel = (0, i18n_1.t)('resume.context_assistant_label');
|
|
32
|
+
return turns.map((turn) => {
|
|
33
|
+
const label = turn.role === 'user' ? userLabel : assistantLabel;
|
|
34
|
+
const visibleText = turn.role === 'user' ? (0, threadContextPreamble_1.stripThreadContextPreamble)(turn.text) : turn.text;
|
|
35
|
+
return `${label} ${visibleText}`;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @description Render the short resume context block from the last conversational
|
|
40
|
+
* turns of a resumed session. `turns` must already be chronological
|
|
41
|
+
* (oldest→newest) and capped to {@link resumeContextTurnLimit} by the caller
|
|
42
|
+
* (the adapter's `getRecentTurns`).
|
|
43
|
+
*
|
|
44
|
+
* Output is a localized header (with the turn count) followed by the
|
|
45
|
+
* role-labeled turn blocks from {@link renderTurns}, each rendered in FULL — the
|
|
46
|
+
* user expects the complete last messages, and the bot's message-splitting path
|
|
47
|
+
* (`getOutputFlushPlan` → `splitMessage`) chunks a block over the Telegram cap.
|
|
48
|
+
* Returns `null` when there are no turns (brand-new / pruned-history session)
|
|
49
|
+
* so the caller emits nothing extra.
|
|
50
|
+
*
|
|
51
|
+
* Pure (only reads i18n, no I/O) so it is unit-testable without a live backend.
|
|
52
|
+
*/
|
|
53
|
+
function formatResumeContext(turns) {
|
|
54
|
+
if (turns.length === 0)
|
|
55
|
+
return null;
|
|
56
|
+
const header = (0, i18n_1.t)('resume.context_header', { count: turns.length });
|
|
57
|
+
return [header, ...renderTurns(turns)].join('\n\n');
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @description Anti-spam gate for the silent-reattach recap. Decides whether
|
|
61
|
+
* {@link formatReattachRecap}'s output should actually be posted, given the boot
|
|
62
|
+
* mode. Two trigger paths:
|
|
63
|
+
*
|
|
64
|
+
* - **Known missed output** (`missedCount > 0`) → ALWAYS post: the agent produced
|
|
65
|
+
* messages the user never saw, regardless of whether the gap was a hot reload
|
|
66
|
+
* or a cold start. Recovering them is the whole point.
|
|
67
|
+
* - **Fallback** (watermark unknown but there ARE turns) → post ONLY on a COLD
|
|
68
|
+
* start. On a hot reload (sub-second blink) nothing was actually missed, so
|
|
69
|
+
* re-showing the last turns is pure noise — and a watermark-less session (first
|
|
70
|
+
* run after ship, pruned transcript) would otherwise re-spam every active topic
|
|
71
|
+
* on every hot rebuild (the exact regression the old recent-turns block was
|
|
72
|
+
* disabled to avoid).
|
|
73
|
+
*
|
|
74
|
+
* Pure (no I/O) so it is unit-testable. A clean reload with a known watermark and
|
|
75
|
+
* no missed output (`missedCount === 0`, known) is always silent.
|
|
76
|
+
*/
|
|
77
|
+
function checkShouldPostReattachRecap(args) {
|
|
78
|
+
const { missedCount, isWatermarkKnown, hasTurns, isColdStart } = args;
|
|
79
|
+
if (missedCount > 0)
|
|
80
|
+
return true;
|
|
81
|
+
return isColdStart && !isWatermarkKnown && hasTurns;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* @description Format the post-restart recap shown on a SILENT reattach (the bot
|
|
85
|
+
* re-adopted a session that kept working while the bot was down), so output
|
|
86
|
+
* produced during the downtime is recovered instead of lost. Mirrors
|
|
87
|
+
* {@link formatResumeContext}'s turn body (via {@link renderTurns}) under a
|
|
88
|
+
* scale-conveying header:
|
|
89
|
+
*
|
|
90
|
+
* - `isWatermarkKnown && missedCount > 0` → the count header
|
|
91
|
+
* ("⚠️ Missed N message(s) …"); the body stays the last few turns regardless
|
|
92
|
+
* of N (the count conveys scale, the hard turn cap is the flood bound).
|
|
93
|
+
* - otherwise (watermark unknown / untrusted) → the no-number fallback header.
|
|
94
|
+
*
|
|
95
|
+
* A best-effort trailing "still working …" line is appended only when `isActive`.
|
|
96
|
+
* Returns `null` when there are no turns to show (the caller posts nothing).
|
|
97
|
+
*
|
|
98
|
+
* Pure (only reads i18n, no I/O) so it is unit-testable. The caller
|
|
99
|
+
* (`reattachExistingSessions`) owns the anti-spam gate — it invokes this only
|
|
100
|
+
* when `missedCount > 0` OR (watermark unknown AND there are turns).
|
|
101
|
+
*/
|
|
102
|
+
function formatReattachRecap(args) {
|
|
103
|
+
const { missedCount, turns, isActive, isWatermarkKnown } = args;
|
|
104
|
+
if (turns.length === 0)
|
|
105
|
+
return null;
|
|
106
|
+
const header = isWatermarkKnown && missedCount > 0
|
|
107
|
+
? (0, i18n_1.t)('recap.missedCountHeader', { count: missedCount })
|
|
108
|
+
: (0, i18n_1.t)('recap.restartedFallbackHeader');
|
|
109
|
+
const lines = [header, ...renderTurns(turns)];
|
|
110
|
+
if (isActive)
|
|
111
|
+
lines.push((0, i18n_1.t)('recap.stillWorkingLine'));
|
|
112
|
+
return lines.join('\n\n');
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=resumeContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resumeContext.js","sourceRoot":"","sources":["../src/resumeContext.ts"],"names":[],"mappings":";;;AAwBA,kCAQC;AAiBD,kDAKC;AAoBD,oEASC;AAqBD,kDAiBC;AAzHD,iCAA2B;AAC3B,mEAAqE;AAGrE;;;;;;GAMG;AACU,QAAA,sBAAsB,GAAG,CAAC,CAAC;AAExC;;;;;;;;;;GAUG;AACH,SAAgB,WAAW,CAAC,KAAmB;IAC7C,MAAM,SAAS,GAAG,IAAA,QAAC,EAAC,2BAA2B,CAAC,CAAC;IACjD,MAAM,cAAc,GAAG,IAAA,QAAC,EAAC,gCAAgC,CAAC,CAAC;IAC3D,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC;QAChE,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IAAA,kDAA0B,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC7F,OAAO,GAAG,KAAK,IAAI,WAAW,EAAE,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,mBAAmB,CAAC,KAAmB;IACrD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEpC,MAAM,MAAM,GAAG,IAAA,QAAC,EAAC,uBAAuB,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACnE,OAAO,CAAC,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,4BAA4B,CAAC,IAK5C;IACC,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IACtE,IAAI,WAAW,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACjC,OAAO,WAAW,IAAI,CAAC,gBAAgB,IAAI,QAAQ,CAAC;AACtD,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,mBAAmB,CAAC,IAKnC;IACC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;IAChE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEpC,MAAM,MAAM,GACV,gBAAgB,IAAI,WAAW,GAAG,CAAC;QACjC,CAAC,CAAC,IAAA,QAAC,EAAC,yBAAyB,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;QACtD,CAAC,CAAC,IAAA,QAAC,EAAC,+BAA+B,CAAC,CAAC;IAEzC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9C,IAAI,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,IAAA,QAAC,EAAC,wBAAwB,CAAC,CAAC,CAAC;IACtD,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description The `'check'` delivery kind: a watchdog the agent creates with
|
|
3
|
+
* `schedule_create` + `checkCommand`. At fire time the BOT runs the command in the
|
|
4
|
+
* topic's bound folder; exit 0 is a pass and stays silent. The first failure after
|
|
5
|
+
* a pass pins an alert and wakes the agent with the job's prompt plus the failure
|
|
6
|
+
* and the output tail; further failures stay silent until a run passes again,
|
|
7
|
+
* which posts one unpinned "passes again" line.
|
|
8
|
+
*
|
|
9
|
+
* WHY the bot runs it: a watcher the agent builds itself (a background loop,
|
|
10
|
+
* `nohup`, a `sleep` loop, a tmux pane) dies with the session, a bot restart or a
|
|
11
|
+
* crash, and then fails silently. A schedule is persisted, re-armed at boot and
|
|
12
|
+
* catches up a run missed while the bot was down.
|
|
13
|
+
*
|
|
14
|
+
* The command runs as the bot's own user, the same user the agent's shell tools
|
|
15
|
+
* run as, so it grants the agent nothing it could not already do.
|
|
16
|
+
*/
|
|
17
|
+
/** Timeout applied when `schedule_create` leaves `checkTimeoutSeconds` out. */
|
|
18
|
+
export declare const defaultCheckTimeoutSec = 60;
|
|
19
|
+
/** Upper bound of `checkTimeoutSeconds`: a check is a probe, not a job. */
|
|
20
|
+
export declare const maxCheckTimeoutSec = 600;
|
|
21
|
+
/** Longest `checkCommand` accepted. */
|
|
22
|
+
export declare const maxCheckCommandLength = 1000;
|
|
23
|
+
/** Output kept from a run (its TAIL — the end of a log is where the failure is). */
|
|
24
|
+
export declare const checkOutputMaxChars = 3000;
|
|
25
|
+
/**
|
|
26
|
+
* Output tail shown in the topic alert. Shorter than {@link checkOutputMaxChars}
|
|
27
|
+
* so the alert stays under Telegram's 4096-character message cap with the
|
|
28
|
+
* command and the job name around it; the agent gets the full kept tail.
|
|
29
|
+
*/
|
|
30
|
+
export declare const checkAlertOutputMaxChars = 1500;
|
|
31
|
+
/**
|
|
32
|
+
* @name CheckRunResult
|
|
33
|
+
* @description One finished check run. `exitCode` is null when the process was
|
|
34
|
+
* killed by a signal or never started (`startError`).
|
|
35
|
+
*/
|
|
36
|
+
export interface CheckRunResult {
|
|
37
|
+
exitCode: number | null;
|
|
38
|
+
signal: NodeJS.Signals | null;
|
|
39
|
+
isTimedOut: boolean;
|
|
40
|
+
/** Why the shell could not be started (e.g. the folder is gone). */
|
|
41
|
+
startError?: string;
|
|
42
|
+
/** Combined stdout + stderr, the last {@link checkOutputMaxChars} characters. */
|
|
43
|
+
output: string;
|
|
44
|
+
}
|
|
45
|
+
/** @description A run passes only when it exited 0 within its timeout. */
|
|
46
|
+
export declare function checkIsCheckPassing(result: CheckRunResult): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* What a finished run should produce: nothing (`quiet`), the alert that wakes
|
|
49
|
+
* the agent (`alert`), or the one "passes again" line (`recovered`).
|
|
50
|
+
*/
|
|
51
|
+
export type CheckAlertDecision = 'quiet' | 'alert' | 'recovered';
|
|
52
|
+
/**
|
|
53
|
+
* @description Alert on the passing → failing edge only, and announce the
|
|
54
|
+
* failing → passing edge once. A check that keeps failing stays quiet: it already
|
|
55
|
+
* raised its alert and woke the agent, and repeating that on every run would bury
|
|
56
|
+
* the topic in pins.
|
|
57
|
+
*/
|
|
58
|
+
export declare function getCheckAlertDecision(input: {
|
|
59
|
+
isPassing: boolean;
|
|
60
|
+
wasFailing: boolean;
|
|
61
|
+
}): CheckAlertDecision;
|
|
62
|
+
/** @description Short technical description of a failed run: `exit 3`, `timeout 60s`, `SIGKILL`. */
|
|
63
|
+
export declare function describeCheckFailure(result: CheckRunResult, timeoutSec: number): string;
|
|
64
|
+
/** @description The last `maxChars` characters of `text`, marked when something was cut. */
|
|
65
|
+
export declare function getOutputTail(text: string, maxChars: number): string;
|
|
66
|
+
/** @description The command as the topic alert shows it, cut to a readable length. */
|
|
67
|
+
export declare function getCheckAlertCommand(command: string): string;
|
|
68
|
+
/**
|
|
69
|
+
* @description The prompt the agent is woken with: what failed and how, the
|
|
70
|
+
* output tail, then the job's own prompt (what to do about it). English, like the
|
|
71
|
+
* `[Scheduled run]` marker — it is read by the agent, never shown in the topic.
|
|
72
|
+
*/
|
|
73
|
+
export declare function buildCheckFailurePrompt(input: {
|
|
74
|
+
name: string;
|
|
75
|
+
command: string;
|
|
76
|
+
failure: string;
|
|
77
|
+
output: string;
|
|
78
|
+
prompt: string;
|
|
79
|
+
}): string;
|
|
80
|
+
/** @description The bot's environment minus the variables a check must not see. */
|
|
81
|
+
export declare function buildCheckEnv(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
82
|
+
/**
|
|
83
|
+
* @description Run `command` through `/bin/sh -c` in `cwd` and collect its output
|
|
84
|
+
* tail. The shell leads its own process group, so a run that outlives
|
|
85
|
+
* `timeoutMs` is stopped together with everything it started: SIGTERM to the
|
|
86
|
+
* group, SIGKILL after a grace period. Never rejects — a shell that cannot start
|
|
87
|
+
* resolves with `startError`.
|
|
88
|
+
*/
|
|
89
|
+
export declare function runCheckCommand(input: {
|
|
90
|
+
command: string;
|
|
91
|
+
cwd: string;
|
|
92
|
+
timeoutMs: number;
|
|
93
|
+
env: NodeJS.ProcessEnv;
|
|
94
|
+
}): Promise<CheckRunResult>;
|
|
95
|
+
//# sourceMappingURL=checkRun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkRun.d.ts","sourceRoot":"","sources":["../../src/scheduler/checkRun.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,2EAA2E;AAC3E,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,uCAAuC;AACvC,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,oFAAoF;AACpF,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAW7C;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAEnE;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,WAAW,CAAC;AAEjE;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,GAAG,kBAAkB,CAG5G;AAED,oGAAoG;AACpG,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAKvF;AAED,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED,sFAAsF;AACtF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,MAAM,CAeT;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAIvE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;CACxB,GAAG,OAAO,CAAC,cAAc,CAAC,CAoD1B"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkAlertOutputMaxChars = exports.checkOutputMaxChars = exports.maxCheckCommandLength = exports.maxCheckTimeoutSec = exports.defaultCheckTimeoutSec = void 0;
|
|
4
|
+
exports.checkIsCheckPassing = checkIsCheckPassing;
|
|
5
|
+
exports.getCheckAlertDecision = getCheckAlertDecision;
|
|
6
|
+
exports.describeCheckFailure = describeCheckFailure;
|
|
7
|
+
exports.getOutputTail = getOutputTail;
|
|
8
|
+
exports.getCheckAlertCommand = getCheckAlertCommand;
|
|
9
|
+
exports.buildCheckFailurePrompt = buildCheckFailurePrompt;
|
|
10
|
+
exports.buildCheckEnv = buildCheckEnv;
|
|
11
|
+
exports.runCheckCommand = runCheckCommand;
|
|
12
|
+
const node_child_process_1 = require("node:child_process");
|
|
13
|
+
/**
|
|
14
|
+
* @description The `'check'` delivery kind: a watchdog the agent creates with
|
|
15
|
+
* `schedule_create` + `checkCommand`. At fire time the BOT runs the command in the
|
|
16
|
+
* topic's bound folder; exit 0 is a pass and stays silent. The first failure after
|
|
17
|
+
* a pass pins an alert and wakes the agent with the job's prompt plus the failure
|
|
18
|
+
* and the output tail; further failures stay silent until a run passes again,
|
|
19
|
+
* which posts one unpinned "passes again" line.
|
|
20
|
+
*
|
|
21
|
+
* WHY the bot runs it: a watcher the agent builds itself (a background loop,
|
|
22
|
+
* `nohup`, a `sleep` loop, a tmux pane) dies with the session, a bot restart or a
|
|
23
|
+
* crash, and then fails silently. A schedule is persisted, re-armed at boot and
|
|
24
|
+
* catches up a run missed while the bot was down.
|
|
25
|
+
*
|
|
26
|
+
* The command runs as the bot's own user, the same user the agent's shell tools
|
|
27
|
+
* run as, so it grants the agent nothing it could not already do.
|
|
28
|
+
*/
|
|
29
|
+
/** Timeout applied when `schedule_create` leaves `checkTimeoutSeconds` out. */
|
|
30
|
+
exports.defaultCheckTimeoutSec = 60;
|
|
31
|
+
/** Upper bound of `checkTimeoutSeconds`: a check is a probe, not a job. */
|
|
32
|
+
exports.maxCheckTimeoutSec = 600;
|
|
33
|
+
/** Longest `checkCommand` accepted. */
|
|
34
|
+
exports.maxCheckCommandLength = 1000;
|
|
35
|
+
/** Output kept from a run (its TAIL — the end of a log is where the failure is). */
|
|
36
|
+
exports.checkOutputMaxChars = 3000;
|
|
37
|
+
/**
|
|
38
|
+
* Output tail shown in the topic alert. Shorter than {@link checkOutputMaxChars}
|
|
39
|
+
* so the alert stays under Telegram's 4096-character message cap with the
|
|
40
|
+
* command and the job name around it; the agent gets the full kept tail.
|
|
41
|
+
*/
|
|
42
|
+
exports.checkAlertOutputMaxChars = 1500;
|
|
43
|
+
/** Command text shown in the topic alert. */
|
|
44
|
+
const checkAlertCommandMaxChars = 300;
|
|
45
|
+
/** Pause between SIGTERM and SIGKILL for a check that outlived its timeout. */
|
|
46
|
+
const checkKillGraceMs = 5000;
|
|
47
|
+
/** Environment variables a check never sees: its output is posted into the topic. */
|
|
48
|
+
const checkHiddenEnvNames = ['TELEGRAM_BOT_TOKEN'];
|
|
49
|
+
/** @description A run passes only when it exited 0 within its timeout. */
|
|
50
|
+
function checkIsCheckPassing(result) {
|
|
51
|
+
return result.exitCode === 0 && !result.isTimedOut && result.startError === undefined;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @description Alert on the passing → failing edge only, and announce the
|
|
55
|
+
* failing → passing edge once. A check that keeps failing stays quiet: it already
|
|
56
|
+
* raised its alert and woke the agent, and repeating that on every run would bury
|
|
57
|
+
* the topic in pins.
|
|
58
|
+
*/
|
|
59
|
+
function getCheckAlertDecision(input) {
|
|
60
|
+
if (input.isPassing)
|
|
61
|
+
return input.wasFailing ? 'recovered' : 'quiet';
|
|
62
|
+
return input.wasFailing ? 'quiet' : 'alert';
|
|
63
|
+
}
|
|
64
|
+
/** @description Short technical description of a failed run: `exit 3`, `timeout 60s`, `SIGKILL`. */
|
|
65
|
+
function describeCheckFailure(result, timeoutSec) {
|
|
66
|
+
if (result.startError !== undefined)
|
|
67
|
+
return `error: ${result.startError}`;
|
|
68
|
+
if (result.isTimedOut)
|
|
69
|
+
return `timeout ${timeoutSec}s`;
|
|
70
|
+
if (result.exitCode !== null)
|
|
71
|
+
return `exit ${result.exitCode}`;
|
|
72
|
+
return result.signal ?? 'killed';
|
|
73
|
+
}
|
|
74
|
+
/** @description The last `maxChars` characters of `text`, marked when something was cut. */
|
|
75
|
+
function getOutputTail(text, maxChars) {
|
|
76
|
+
if (text.length <= maxChars)
|
|
77
|
+
return text;
|
|
78
|
+
return `…${text.slice(text.length - maxChars + 1)}`;
|
|
79
|
+
}
|
|
80
|
+
/** @description The command as the topic alert shows it, cut to a readable length. */
|
|
81
|
+
function getCheckAlertCommand(command) {
|
|
82
|
+
return command.length <= checkAlertCommandMaxChars
|
|
83
|
+
? command
|
|
84
|
+
: `${command.slice(0, checkAlertCommandMaxChars - 1)}…`;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* @description The prompt the agent is woken with: what failed and how, the
|
|
88
|
+
* output tail, then the job's own prompt (what to do about it). English, like the
|
|
89
|
+
* `[Scheduled run]` marker — it is read by the agent, never shown in the topic.
|
|
90
|
+
*/
|
|
91
|
+
function buildCheckFailurePrompt(input) {
|
|
92
|
+
const output = input.output.trim() || '(no output)';
|
|
93
|
+
return [
|
|
94
|
+
`[Scheduled check "${input.name}" failed]`,
|
|
95
|
+
`Command (run by the bot in this folder): ${input.command}`,
|
|
96
|
+
`Result: ${input.failure}`,
|
|
97
|
+
'Output (tail):',
|
|
98
|
+
'```',
|
|
99
|
+
output,
|
|
100
|
+
'```',
|
|
101
|
+
'',
|
|
102
|
+
'The bot stays silent while the check keeps failing and tells the topic when it passes again.',
|
|
103
|
+
'',
|
|
104
|
+
input.prompt,
|
|
105
|
+
].join('\n');
|
|
106
|
+
}
|
|
107
|
+
/** @description The bot's environment minus the variables a check must not see. */
|
|
108
|
+
function buildCheckEnv(env) {
|
|
109
|
+
const checkEnv = { ...env };
|
|
110
|
+
for (const name of checkHiddenEnvNames)
|
|
111
|
+
delete checkEnv[name];
|
|
112
|
+
return checkEnv;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* @description Run `command` through `/bin/sh -c` in `cwd` and collect its output
|
|
116
|
+
* tail. The shell leads its own process group, so a run that outlives
|
|
117
|
+
* `timeoutMs` is stopped together with everything it started: SIGTERM to the
|
|
118
|
+
* group, SIGKILL after a grace period. Never rejects — a shell that cannot start
|
|
119
|
+
* resolves with `startError`.
|
|
120
|
+
*/
|
|
121
|
+
function runCheckCommand(input) {
|
|
122
|
+
return new Promise((resolve) => {
|
|
123
|
+
let output = '';
|
|
124
|
+
let isTimedOut = false;
|
|
125
|
+
let killTimer = null;
|
|
126
|
+
let isSettled = false;
|
|
127
|
+
const child = (0, node_child_process_1.spawn)('/bin/sh', ['-c', input.command], {
|
|
128
|
+
cwd: input.cwd,
|
|
129
|
+
env: input.env,
|
|
130
|
+
detached: true,
|
|
131
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
132
|
+
});
|
|
133
|
+
const appendOutput = (chunk) => {
|
|
134
|
+
output = getOutputTail(output + chunk.toString('utf-8'), exports.checkOutputMaxChars);
|
|
135
|
+
};
|
|
136
|
+
child.stdout?.on('data', appendOutput);
|
|
137
|
+
child.stderr?.on('data', appendOutput);
|
|
138
|
+
const signalGroup = (signal) => {
|
|
139
|
+
if (child.pid === undefined)
|
|
140
|
+
return;
|
|
141
|
+
try {
|
|
142
|
+
process.kill(-child.pid, signal);
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
// The group already exited.
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
const timeoutTimer = setTimeout(() => {
|
|
149
|
+
isTimedOut = true;
|
|
150
|
+
signalGroup('SIGTERM');
|
|
151
|
+
killTimer = setTimeout(() => signalGroup('SIGKILL'), checkKillGraceMs);
|
|
152
|
+
killTimer.unref?.();
|
|
153
|
+
}, input.timeoutMs);
|
|
154
|
+
timeoutTimer.unref?.();
|
|
155
|
+
const settle = (result) => {
|
|
156
|
+
if (isSettled)
|
|
157
|
+
return;
|
|
158
|
+
isSettled = true;
|
|
159
|
+
clearTimeout(timeoutTimer);
|
|
160
|
+
if (killTimer)
|
|
161
|
+
clearTimeout(killTimer);
|
|
162
|
+
resolve(result);
|
|
163
|
+
};
|
|
164
|
+
child.on('error', (error) => {
|
|
165
|
+
settle({ exitCode: null, signal: null, isTimedOut: false, startError: error.message, output });
|
|
166
|
+
});
|
|
167
|
+
child.on('close', (exitCode, signal) => {
|
|
168
|
+
settle({ exitCode, signal, isTimedOut, output });
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=checkRun.js.map
|