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,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description Per-thread defense-in-depth backstop against a runaway flood of
|
|
4
|
+
* byte-identical PERMANENT output.
|
|
5
|
+
*
|
|
6
|
+
* WHY it exists (flood 2026-06-16): a Claude tmux-scrape topic emitted a
|
|
7
|
+
* box-drawing table ~500 times, one byte-identical copy every ~12s for >2h.
|
|
8
|
+
* The root cause was fixed at the table emit path (S1, `recentRelayWindow`'s
|
|
9
|
+
* block-level dedup), but ANY emit path that re-sends the same large block —
|
|
10
|
+
* present or future, either backend — should not be able to flood a topic.
|
|
11
|
+
* This guard caps that regardless of which path produced the output: if a fresh
|
|
12
|
+
* permanent output is byte-identical to one recently sent to the SAME thread, it
|
|
13
|
+
* is suppressed.
|
|
14
|
+
*
|
|
15
|
+
* Deliberately NARROW to avoid false positives:
|
|
16
|
+
* - only LARGE blocks ({@link identicalOutputMinChars}) are guarded — short
|
|
17
|
+
* answers ("done", "yes", a one-line confirmation) legitimately repeat and
|
|
18
|
+
* always pass;
|
|
19
|
+
* - only within a short TIME window ({@link identicalOutputWindowMs}) and the
|
|
20
|
+
* last few outputs ({@link identicalOutputWindowSize}) — a deliberate
|
|
21
|
+
* re-print minutes apart is not a flood and passes;
|
|
22
|
+
* - it is the BACKSTOP, not the primary fix: byte-identical only, never a
|
|
23
|
+
* fuzzy match, so a genuinely-changed block (a cell flipped, a row added) is
|
|
24
|
+
* different text and always passes.
|
|
25
|
+
*
|
|
26
|
+
* The continuation / status / transient / question exclusions are the caller's
|
|
27
|
+
* (`bot.ts` handleAgentOutput) — this guard only ever sees fresh permanent
|
|
28
|
+
* output text + the current time. State is reset at the same per-thread
|
|
29
|
+
* teardown points as the other relay state (session stop / closed / unbind).
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.identicalOutputMinChars = exports.identicalOutputWindowMs = exports.identicalOutputWindowSize = void 0;
|
|
33
|
+
exports.checkIsIdenticalOutputRepeat = checkIsIdenticalOutputRepeat;
|
|
34
|
+
exports.recordRecentOutput = recordRecentOutput;
|
|
35
|
+
exports.createIdenticalOutputGuard = createIdenticalOutputGuard;
|
|
36
|
+
/** Last N permanent outputs per thread kept for the identical-repeat check. */
|
|
37
|
+
exports.identicalOutputWindowSize = 5;
|
|
38
|
+
/** Only an identical output within this time window is treated as a flood. */
|
|
39
|
+
exports.identicalOutputWindowMs = 60_000;
|
|
40
|
+
/**
|
|
41
|
+
* Minimum candidate length (chars) to be guarded at all. Short answers repeat
|
|
42
|
+
* legitimately far too often to ever suppress — only LARGE blocks (a re-printed
|
|
43
|
+
* table, a re-rendered file dump) can flood meaningfully.
|
|
44
|
+
*/
|
|
45
|
+
exports.identicalOutputMinChars = 200;
|
|
46
|
+
/**
|
|
47
|
+
* @description Pure decision: is `candidate` a byte-identical repeat of a recent
|
|
48
|
+
* permanent output still inside the window? Short candidates (< {@link
|
|
49
|
+
* identicalOutputMinChars}) always return false. Only records within {@link
|
|
50
|
+
* identicalOutputWindowMs} of `nowMs` count — an older identical output has
|
|
51
|
+
* already aged out and is not a flood.
|
|
52
|
+
*/
|
|
53
|
+
function checkIsIdenticalOutputRepeat(candidate, recentOutputs, nowMs) {
|
|
54
|
+
if (candidate.length < exports.identicalOutputMinChars)
|
|
55
|
+
return false;
|
|
56
|
+
for (const record of recentOutputs) {
|
|
57
|
+
if (nowMs - record.sentAtMs > exports.identicalOutputWindowMs)
|
|
58
|
+
continue;
|
|
59
|
+
if (record.text === candidate)
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @description Append a permanent output to a thread's bounded recent-output
|
|
66
|
+
* history (newest last), evicting the oldest beyond {@link
|
|
67
|
+
* identicalOutputWindowSize}. Returns a NEW array (pure) so callers store the
|
|
68
|
+
* result. Outputs below {@link identicalOutputMinChars} are not recorded — they
|
|
69
|
+
* are never guarded, so they would only waste a slot.
|
|
70
|
+
*/
|
|
71
|
+
function recordRecentOutput(recentOutputs, text, sentAtMs) {
|
|
72
|
+
if (text.length < exports.identicalOutputMinChars)
|
|
73
|
+
return [...recentOutputs];
|
|
74
|
+
const next = [...recentOutputs, { text, sentAtMs }];
|
|
75
|
+
if (next.length > exports.identicalOutputWindowSize)
|
|
76
|
+
next.splice(0, next.length - exports.identicalOutputWindowSize);
|
|
77
|
+
return next;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @description Create an empty identical-output guard. `nowMs` is supplied per
|
|
81
|
+
* call (not read from `Date.now()` here) so tests can drive the time window
|
|
82
|
+
* deterministically.
|
|
83
|
+
*/
|
|
84
|
+
function createIdenticalOutputGuard() {
|
|
85
|
+
const historyByThread = new Map();
|
|
86
|
+
return {
|
|
87
|
+
checkAndRecord(threadKey, text, nowMs) {
|
|
88
|
+
const history = historyByThread.get(threadKey) ?? [];
|
|
89
|
+
if (checkIsIdenticalOutputRepeat(text, history, nowMs))
|
|
90
|
+
return true;
|
|
91
|
+
historyByThread.set(threadKey, recordRecentOutput(history, text, nowMs));
|
|
92
|
+
return false;
|
|
93
|
+
},
|
|
94
|
+
reset(threadKey) {
|
|
95
|
+
historyByThread.delete(threadKey);
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=identicalOutputGuard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identicalOutputGuard.js","sourceRoot":"","sources":["../../src/utils/identicalOutputGuard.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;;AA4BH,oEAWC;AASD,gDASC;AAwBD,gEAcC;AA7FD,+EAA+E;AAClE,QAAA,yBAAyB,GAAG,CAAC,CAAC;AAE3C,8EAA8E;AACjE,QAAA,uBAAuB,GAAG,MAAM,CAAC;AAE9C;;;;GAIG;AACU,QAAA,uBAAuB,GAAG,GAAG,CAAC;AAQ3C;;;;;;GAMG;AACH,SAAgB,4BAA4B,CAC1C,SAAiB,EACjB,aAA4C,EAC5C,KAAa;IAEb,IAAI,SAAS,CAAC,MAAM,GAAG,+BAAuB;QAAE,OAAO,KAAK,CAAC;IAC7D,KAAK,MAAM,MAAM,IAAI,aAAa,EAAE,CAAC;QACnC,IAAI,KAAK,GAAG,MAAM,CAAC,QAAQ,GAAG,+BAAuB;YAAE,SAAS;QAChE,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;IAC7C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAChC,aAA4C,EAC5C,IAAY,EACZ,QAAgB;IAEhB,IAAI,IAAI,CAAC,MAAM,GAAG,+BAAuB;QAAE,OAAO,CAAC,GAAG,aAAa,CAAC,CAAC;IACrE,MAAM,IAAI,GAAG,CAAC,GAAG,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACpD,IAAI,IAAI,CAAC,MAAM,GAAG,iCAAyB;QAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,iCAAyB,CAAC,CAAC;IACrG,OAAO,IAAI,CAAC;AACd,CAAC;AAmBD;;;;GAIG;AACH,SAAgB,0BAA0B;IACxC,MAAM,eAAe,GAAG,IAAI,GAAG,EAAgC,CAAC;IAEhE,OAAO;QACL,cAAc,CAAC,SAAiB,EAAE,IAAY,EAAE,KAAa;YAC3D,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;YACrD,IAAI,4BAA4B,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC;gBAAE,OAAO,IAAI,CAAC;YACpE,eAAe,CAAC,GAAG,CAAC,SAAS,EAAE,kBAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;YACzE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,KAAK,CAAC,SAAiB;YACrB,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACpC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Pure formatter for the `/timestamps` prompt injection: an
|
|
3
|
+
* ISO-8601 wall-clock timestamp carrying the host's LOCAL UTC offset
|
|
4
|
+
* (`2026-06-27T19:42:10+04:00`), never the `Z` suffix `toISOString()` emits.
|
|
5
|
+
* The agent-facing use case is absolute-time context for long multi-day
|
|
6
|
+
* sessions ("yesterday", "2-3 days ago"), so the operator's local clock — not
|
|
7
|
+
* UTC — is the meaningful frame of reference.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @description Format an epoch-ms instant as local-offset ISO-8601, second
|
|
11
|
+
* precision: `YYYY-MM-DDTHH:mm:ss±HH:MM`. Uses the host timezone in effect for
|
|
12
|
+
* that instant (DST-correct — the offset comes from the Date itself), so
|
|
13
|
+
* parsing the result back yields the same instant.
|
|
14
|
+
*/
|
|
15
|
+
export declare function formatIsoLocalOffset(epochMs: number): string;
|
|
16
|
+
//# sourceMappingURL=isoTimestamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isoTimestamp.d.ts","sourceRoot":"","sources":["../../src/utils/isoTimestamp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAW5D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description Pure formatter for the `/timestamps` prompt injection: an
|
|
4
|
+
* ISO-8601 wall-clock timestamp carrying the host's LOCAL UTC offset
|
|
5
|
+
* (`2026-06-27T19:42:10+04:00`), never the `Z` suffix `toISOString()` emits.
|
|
6
|
+
* The agent-facing use case is absolute-time context for long multi-day
|
|
7
|
+
* sessions ("yesterday", "2-3 days ago"), so the operator's local clock — not
|
|
8
|
+
* UTC — is the meaningful frame of reference.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.formatIsoLocalOffset = formatIsoLocalOffset;
|
|
12
|
+
const minutesPerHour = 60;
|
|
13
|
+
/** Zero-pad a calendar/clock component to two digits. */
|
|
14
|
+
function padTwo(value) {
|
|
15
|
+
return value.toString().padStart(2, '0');
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @description Format an epoch-ms instant as local-offset ISO-8601, second
|
|
19
|
+
* precision: `YYYY-MM-DDTHH:mm:ss±HH:MM`. Uses the host timezone in effect for
|
|
20
|
+
* that instant (DST-correct — the offset comes from the Date itself), so
|
|
21
|
+
* parsing the result back yields the same instant.
|
|
22
|
+
*/
|
|
23
|
+
function formatIsoLocalOffset(epochMs) {
|
|
24
|
+
const date = new Date(epochMs);
|
|
25
|
+
const offsetTotalMinutes = -date.getTimezoneOffset();
|
|
26
|
+
const offsetSign = offsetTotalMinutes >= 0 ? '+' : '-';
|
|
27
|
+
const offsetAbsMinutes = Math.abs(offsetTotalMinutes);
|
|
28
|
+
const offsetHours = Math.floor(offsetAbsMinutes / minutesPerHour);
|
|
29
|
+
const offsetMinutes = offsetAbsMinutes % minutesPerHour;
|
|
30
|
+
const datePart = `${date.getFullYear()}-${padTwo(date.getMonth() + 1)}-${padTwo(date.getDate())}`;
|
|
31
|
+
const timePart = `${padTwo(date.getHours())}:${padTwo(date.getMinutes())}:${padTwo(date.getSeconds())}`;
|
|
32
|
+
return `${datePart}T${timePart}${offsetSign}${padTwo(offsetHours)}:${padTwo(offsetMinutes)}`;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=isoTimestamp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isoTimestamp.js","sourceRoot":"","sources":["../../src/utils/isoTimestamp.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAeH,oDAWC;AAxBD,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,yDAAyD;AACzD,SAAS,MAAM,CAAC,KAAa;IAC3B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,OAAe;IAClD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,MAAM,kBAAkB,GAAG,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;IACrD,MAAM,UAAU,GAAG,kBAAkB,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IACvD,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACtD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,cAAc,CAAC,CAAC;IAClE,MAAM,aAAa,GAAG,gBAAgB,GAAG,cAAc,CAAC;IAExD,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;IAClG,MAAM,QAAQ,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC;IACxG,OAAO,GAAG,QAAQ,IAAI,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;AAC/F,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Pure idle-watchdog decision for the `claude-json-stream` adapter's
|
|
3
|
+
* `isBusy` flag — the flag that (via `checkIsBusy` → `checkShouldKeepTyping`)
|
|
4
|
+
* keeps the native Telegram "agent is typing…" indicator alive.
|
|
5
|
+
*
|
|
6
|
+
* ROOT-CAUSE CONTEXT. In `claudeJsonStreamAdapter` `isBusy` has exactly ONE
|
|
7
|
+
* clear-point: a processed terminal `result` line (`handleTurnEnd`). Every other
|
|
8
|
+
* event only ever SETS it (`sendInput`, a text/thinking delta, a `tool_use`, a
|
|
9
|
+
* surfaced question). So if that single `result` is ever missed — an `interrupt`
|
|
10
|
+
* the CLI aborts without a final `result`, a process that goes quiet after the
|
|
11
|
+
* answer, a `result` shape a newer CLI stops emitting — `isBusy` sticks `true`
|
|
12
|
+
* forever and the typing indicator hangs. Observed live: an otherwise-idle topic
|
|
13
|
+
* firing `sendChatAction('typing')` every 4s for an hour+ after the agent was
|
|
14
|
+
* already done. The typing loop self-stops only when `checkShouldKeepTyping`
|
|
15
|
+
* (`isBusy || isOutputStreaming`) goes false and has NO absolute bound, so a
|
|
16
|
+
* single stuck flag is unbounded.
|
|
17
|
+
*
|
|
18
|
+
* This is the bounded safety net: when the session is flagged busy but stdout has
|
|
19
|
+
* been SILENT for {@link busyIdleWatchdogMs} AND nothing is genuinely in flight
|
|
20
|
+
* (no outstanding tool, no active sub-agent, no pending user question, no
|
|
21
|
+
* un-emitted answer batch), the turn has really ended — clear `isBusy`.
|
|
22
|
+
*
|
|
23
|
+
* SILENCE — not wall-clock since the turn started — is the signal, so a
|
|
24
|
+
* legitimately long turn is NEVER cut short: a working agent is always doing one
|
|
25
|
+
* of (a) streaming text/thinking deltas → stdout activity, (b) waiting on a tool
|
|
26
|
+
* → `outstandingToolCount > 0`, (c) waiting on a sub-agent → `subagentActive`,
|
|
27
|
+
* (d) waiting on the user → `hasPendingQuestion`. Each of those VETOES the clear.
|
|
28
|
+
* The watchdog can therefore only fire once the work is provably done but the
|
|
29
|
+
* terminal `result` never arrived.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* @description How long stdout may be silent, with nothing in flight, before a
|
|
33
|
+
* busy session is force-declared idle. Comfortably longer than the only silent
|
|
34
|
+
* gap a working-yet-nothing-in-flight turn has (pre-first-token latency), far
|
|
35
|
+
* shorter than the reported hour+ hang.
|
|
36
|
+
*/
|
|
37
|
+
export declare const busyIdleWatchdogMs = 120000;
|
|
38
|
+
export interface BusyIdleWatchdogInput {
|
|
39
|
+
/** Is the session currently flagged busy (drives the typing indicator)? */
|
|
40
|
+
isBusy: boolean;
|
|
41
|
+
/** ms since the last stdout byte was consumed for this session. */
|
|
42
|
+
msSinceStdoutActivity: number;
|
|
43
|
+
/** The silence threshold (injected so tests need no fake clock). */
|
|
44
|
+
idleTimeoutMs: number;
|
|
45
|
+
/** Tool calls started but whose `tool_result` hasn't returned (Bash/Read/Task/…). */
|
|
46
|
+
outstandingToolCount: number;
|
|
47
|
+
/** A sub-agent delegation is mid-flight. */
|
|
48
|
+
subagentActive: boolean;
|
|
49
|
+
/** A user question is awaiting an answer. */
|
|
50
|
+
hasPendingQuestion: boolean;
|
|
51
|
+
/** Answer text still sits un-emitted in the coalesce batch. */
|
|
52
|
+
hasUnflushedAnswer: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @description True iff a busy session should be force-cleared to idle: it is
|
|
56
|
+
* busy, stdout has been silent past the threshold, and every "in flight" signal
|
|
57
|
+
* is absent. Any single in-flight signal (tool / sub-agent / question / batched
|
|
58
|
+
* answer) VETOES the clear so a legitimately mid-turn agent is never truncated.
|
|
59
|
+
*/
|
|
60
|
+
export declare function checkShouldClearBusyOnIdle(input: BusyIdleWatchdogInput): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* @description How long stdout may be silent before a compaction the CLI never
|
|
63
|
+
* confirmed is declared dead. Same signal, same reasoning as
|
|
64
|
+
* {@link busyIdleWatchdogMs}: while it compacts, the CLI heartbeats
|
|
65
|
+
* `system/status status:"compacting"` every few seconds, so real silence this long
|
|
66
|
+
* means the process is gone — not that it is thinking.
|
|
67
|
+
*/
|
|
68
|
+
export declare const compactionSilenceTimeoutMs = 120000;
|
|
69
|
+
/**
|
|
70
|
+
* @description Absolute backstop on one compaction wait. Only reachable by a CLI
|
|
71
|
+
* that keeps talking forever without ever finishing (a retry loop), which silence
|
|
72
|
+
* alone cannot catch; without it the caller's promise — and with it the
|
|
73
|
+
* "a compaction is running" guard — would never settle.
|
|
74
|
+
*/
|
|
75
|
+
export declare const compactionAbsoluteTimeoutMs: number;
|
|
76
|
+
/** How often the compaction wait re-evaluates its verdict. */
|
|
77
|
+
export declare const compactionWaitPollMs = 15000;
|
|
78
|
+
export type CompactionWaitVerdict = 'keepWaiting' | 'timedOutSilent' | 'timedOutTotal';
|
|
79
|
+
/** How a timed-out wait is REPORTED (decided by {@link getCompactionTimeoutOutcome}). */
|
|
80
|
+
export type CompactionTimeoutOutcome =
|
|
81
|
+
/** It demonstrably worked; only the frame carrying the token counts is missing. */
|
|
82
|
+
{
|
|
83
|
+
kind: 'succeededWithoutTokenCounts';
|
|
84
|
+
} | {
|
|
85
|
+
kind: 'failed';
|
|
86
|
+
reason: 'silent' | 'total';
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* @description What a timed-out compaction wait should report.
|
|
90
|
+
*
|
|
91
|
+
* `sawSuccess` means the CLI already sent `compact_status success` and only the
|
|
92
|
+
* boundary frame (which carries the pre/post token counts) never followed. The
|
|
93
|
+
* context IS compacted at that point, so reporting failure would suppress the
|
|
94
|
+
* notice over an already-compacted session and leave the operator with the same
|
|
95
|
+
* silence this whole fix exists to remove. Token counts are a diagnostic; the
|
|
96
|
+
* compaction is the outcome.
|
|
97
|
+
*/
|
|
98
|
+
export declare function getCompactionTimeoutOutcome(input: {
|
|
99
|
+
verdict: Exclude<CompactionWaitVerdict, 'keepWaiting'>;
|
|
100
|
+
sawSuccess: boolean;
|
|
101
|
+
}): CompactionTimeoutOutcome;
|
|
102
|
+
/**
|
|
103
|
+
* @description Decide whether to keep waiting for a compaction to confirm.
|
|
104
|
+
*
|
|
105
|
+
* ROOT-CAUSE CONTEXT. This wait used to be a flat 3-minute cap on TOTAL elapsed
|
|
106
|
+
* time, and it produced the operator's report that idle compaction "runs but never
|
|
107
|
+
* says so": the compaction fired, the CLI compacted successfully, and the bot had
|
|
108
|
+
* already given up and posted nothing. Measured on the real session that exposed
|
|
109
|
+
* it — `compact_metadata.duration_ms: 195649`, i.e. 3 min 15.6 s against a 180 s
|
|
110
|
+
* cap, missing by 15 seconds. Elapsed time is the wrong bound: how long a summary
|
|
111
|
+
* takes scales with the context being summarised, so ANY fixed cap is a guess that
|
|
112
|
+
* a big enough session beats, and compact-on-idle exists precisely FOR big
|
|
113
|
+
* sessions — the bound was guaranteed to fail exactly where the feature matters.
|
|
114
|
+
*
|
|
115
|
+
* So silence decides instead, and the absolute cap survives only as a backstop
|
|
116
|
+
* against a CLI that never finishes at all. Silence is checked FIRST: for a dead
|
|
117
|
+
* process both bounds can be past, and "still talking, never finished" would be
|
|
118
|
+
* the wrong report.
|
|
119
|
+
*/
|
|
120
|
+
export declare function getCompactionWaitVerdict(input: {
|
|
121
|
+
/** ms since the last stdout byte was consumed for this session. */
|
|
122
|
+
msSinceStdoutActivity: number;
|
|
123
|
+
/** ms since the `/compact` turn was written to stdin. */
|
|
124
|
+
msSinceCompactionStarted: number;
|
|
125
|
+
/** Silence threshold (injected so tests need no fake clock). */
|
|
126
|
+
silenceTimeoutMs: number;
|
|
127
|
+
/** Absolute backstop (injected for the same reason). */
|
|
128
|
+
absoluteTimeoutMs: number;
|
|
129
|
+
}): CompactionWaitVerdict;
|
|
130
|
+
//# sourceMappingURL=jsonStreamBusyWatchdog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonStreamBusyWatchdog.d.ts","sourceRoot":"","sources":["../../src/utils/jsonStreamBusyWatchdog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,SAAU,CAAC;AAE1C,MAAM,WAAW,qBAAqB;IACpC,2EAA2E;IAC3E,MAAM,EAAE,OAAO,CAAC;IAChB,mEAAmE;IACnE,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;IACtB,qFAAqF;IACrF,oBAAoB,EAAE,MAAM,CAAC;IAC7B,4CAA4C;IAC5C,cAAc,EAAE,OAAO,CAAC;IACxB,6CAA6C;IAC7C,kBAAkB,EAAE,OAAO,CAAC;IAC5B,+DAA+D;IAC/D,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAQhF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,SAAU,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAAiB,CAAC;AAE1D,8DAA8D;AAC9D,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAE3C,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAEvF,yFAAyF;AACzF,MAAM,MAAM,wBAAwB;AAClC,mFAAmF;AACjF;IAAE,IAAI,EAAE,6BAA6B,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAA;CAAE,CAAC;AAEnD;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IACjD,OAAO,EAAE,OAAO,CAAC,qBAAqB,EAAE,aAAa,CAAC,CAAC;IACvD,UAAU,EAAE,OAAO,CAAC;CACrB,GAAG,wBAAwB,CAG3B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,mEAAmE;IACnE,qBAAqB,EAAE,MAAM,CAAC;IAC9B,yDAAyD;IACzD,wBAAwB,EAAE,MAAM,CAAC;IACjC,gEAAgE;IAChE,gBAAgB,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,iBAAiB,EAAE,MAAM,CAAC;CAC3B,GAAG,qBAAqB,CAIxB"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description Pure idle-watchdog decision for the `claude-json-stream` adapter's
|
|
4
|
+
* `isBusy` flag — the flag that (via `checkIsBusy` → `checkShouldKeepTyping`)
|
|
5
|
+
* keeps the native Telegram "agent is typing…" indicator alive.
|
|
6
|
+
*
|
|
7
|
+
* ROOT-CAUSE CONTEXT. In `claudeJsonStreamAdapter` `isBusy` has exactly ONE
|
|
8
|
+
* clear-point: a processed terminal `result` line (`handleTurnEnd`). Every other
|
|
9
|
+
* event only ever SETS it (`sendInput`, a text/thinking delta, a `tool_use`, a
|
|
10
|
+
* surfaced question). So if that single `result` is ever missed — an `interrupt`
|
|
11
|
+
* the CLI aborts without a final `result`, a process that goes quiet after the
|
|
12
|
+
* answer, a `result` shape a newer CLI stops emitting — `isBusy` sticks `true`
|
|
13
|
+
* forever and the typing indicator hangs. Observed live: an otherwise-idle topic
|
|
14
|
+
* firing `sendChatAction('typing')` every 4s for an hour+ after the agent was
|
|
15
|
+
* already done. The typing loop self-stops only when `checkShouldKeepTyping`
|
|
16
|
+
* (`isBusy || isOutputStreaming`) goes false and has NO absolute bound, so a
|
|
17
|
+
* single stuck flag is unbounded.
|
|
18
|
+
*
|
|
19
|
+
* This is the bounded safety net: when the session is flagged busy but stdout has
|
|
20
|
+
* been SILENT for {@link busyIdleWatchdogMs} AND nothing is genuinely in flight
|
|
21
|
+
* (no outstanding tool, no active sub-agent, no pending user question, no
|
|
22
|
+
* un-emitted answer batch), the turn has really ended — clear `isBusy`.
|
|
23
|
+
*
|
|
24
|
+
* SILENCE — not wall-clock since the turn started — is the signal, so a
|
|
25
|
+
* legitimately long turn is NEVER cut short: a working agent is always doing one
|
|
26
|
+
* of (a) streaming text/thinking deltas → stdout activity, (b) waiting on a tool
|
|
27
|
+
* → `outstandingToolCount > 0`, (c) waiting on a sub-agent → `subagentActive`,
|
|
28
|
+
* (d) waiting on the user → `hasPendingQuestion`. Each of those VETOES the clear.
|
|
29
|
+
* The watchdog can therefore only fire once the work is provably done but the
|
|
30
|
+
* terminal `result` never arrived.
|
|
31
|
+
*/
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.compactionWaitPollMs = exports.compactionAbsoluteTimeoutMs = exports.compactionSilenceTimeoutMs = exports.busyIdleWatchdogMs = void 0;
|
|
34
|
+
exports.checkShouldClearBusyOnIdle = checkShouldClearBusyOnIdle;
|
|
35
|
+
exports.getCompactionTimeoutOutcome = getCompactionTimeoutOutcome;
|
|
36
|
+
exports.getCompactionWaitVerdict = getCompactionWaitVerdict;
|
|
37
|
+
/**
|
|
38
|
+
* @description How long stdout may be silent, with nothing in flight, before a
|
|
39
|
+
* busy session is force-declared idle. Comfortably longer than the only silent
|
|
40
|
+
* gap a working-yet-nothing-in-flight turn has (pre-first-token latency), far
|
|
41
|
+
* shorter than the reported hour+ hang.
|
|
42
|
+
*/
|
|
43
|
+
exports.busyIdleWatchdogMs = 120_000;
|
|
44
|
+
/**
|
|
45
|
+
* @description True iff a busy session should be force-cleared to idle: it is
|
|
46
|
+
* busy, stdout has been silent past the threshold, and every "in flight" signal
|
|
47
|
+
* is absent. Any single in-flight signal (tool / sub-agent / question / batched
|
|
48
|
+
* answer) VETOES the clear so a legitimately mid-turn agent is never truncated.
|
|
49
|
+
*/
|
|
50
|
+
function checkShouldClearBusyOnIdle(input) {
|
|
51
|
+
if (!input.isBusy)
|
|
52
|
+
return false;
|
|
53
|
+
if (input.msSinceStdoutActivity < input.idleTimeoutMs)
|
|
54
|
+
return false;
|
|
55
|
+
if (input.outstandingToolCount > 0)
|
|
56
|
+
return false;
|
|
57
|
+
if (input.subagentActive)
|
|
58
|
+
return false;
|
|
59
|
+
if (input.hasPendingQuestion)
|
|
60
|
+
return false;
|
|
61
|
+
if (input.hasUnflushedAnswer)
|
|
62
|
+
return false;
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @description How long stdout may be silent before a compaction the CLI never
|
|
67
|
+
* confirmed is declared dead. Same signal, same reasoning as
|
|
68
|
+
* {@link busyIdleWatchdogMs}: while it compacts, the CLI heartbeats
|
|
69
|
+
* `system/status status:"compacting"` every few seconds, so real silence this long
|
|
70
|
+
* means the process is gone — not that it is thinking.
|
|
71
|
+
*/
|
|
72
|
+
exports.compactionSilenceTimeoutMs = 120_000;
|
|
73
|
+
/**
|
|
74
|
+
* @description Absolute backstop on one compaction wait. Only reachable by a CLI
|
|
75
|
+
* that keeps talking forever without ever finishing (a retry loop), which silence
|
|
76
|
+
* alone cannot catch; without it the caller's promise — and with it the
|
|
77
|
+
* "a compaction is running" guard — would never settle.
|
|
78
|
+
*/
|
|
79
|
+
exports.compactionAbsoluteTimeoutMs = 30 * 60 * 1000;
|
|
80
|
+
/** How often the compaction wait re-evaluates its verdict. */
|
|
81
|
+
exports.compactionWaitPollMs = 15_000;
|
|
82
|
+
/**
|
|
83
|
+
* @description What a timed-out compaction wait should report.
|
|
84
|
+
*
|
|
85
|
+
* `sawSuccess` means the CLI already sent `compact_status success` and only the
|
|
86
|
+
* boundary frame (which carries the pre/post token counts) never followed. The
|
|
87
|
+
* context IS compacted at that point, so reporting failure would suppress the
|
|
88
|
+
* notice over an already-compacted session and leave the operator with the same
|
|
89
|
+
* silence this whole fix exists to remove. Token counts are a diagnostic; the
|
|
90
|
+
* compaction is the outcome.
|
|
91
|
+
*/
|
|
92
|
+
function getCompactionTimeoutOutcome(input) {
|
|
93
|
+
if (input.sawSuccess)
|
|
94
|
+
return { kind: 'succeededWithoutTokenCounts' };
|
|
95
|
+
return { kind: 'failed', reason: input.verdict === 'timedOutSilent' ? 'silent' : 'total' };
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* @description Decide whether to keep waiting for a compaction to confirm.
|
|
99
|
+
*
|
|
100
|
+
* ROOT-CAUSE CONTEXT. This wait used to be a flat 3-minute cap on TOTAL elapsed
|
|
101
|
+
* time, and it produced the operator's report that idle compaction "runs but never
|
|
102
|
+
* says so": the compaction fired, the CLI compacted successfully, and the bot had
|
|
103
|
+
* already given up and posted nothing. Measured on the real session that exposed
|
|
104
|
+
* it — `compact_metadata.duration_ms: 195649`, i.e. 3 min 15.6 s against a 180 s
|
|
105
|
+
* cap, missing by 15 seconds. Elapsed time is the wrong bound: how long a summary
|
|
106
|
+
* takes scales with the context being summarised, so ANY fixed cap is a guess that
|
|
107
|
+
* a big enough session beats, and compact-on-idle exists precisely FOR big
|
|
108
|
+
* sessions — the bound was guaranteed to fail exactly where the feature matters.
|
|
109
|
+
*
|
|
110
|
+
* So silence decides instead, and the absolute cap survives only as a backstop
|
|
111
|
+
* against a CLI that never finishes at all. Silence is checked FIRST: for a dead
|
|
112
|
+
* process both bounds can be past, and "still talking, never finished" would be
|
|
113
|
+
* the wrong report.
|
|
114
|
+
*/
|
|
115
|
+
function getCompactionWaitVerdict(input) {
|
|
116
|
+
if (input.msSinceStdoutActivity >= input.silenceTimeoutMs)
|
|
117
|
+
return 'timedOutSilent';
|
|
118
|
+
if (input.msSinceCompactionStarted >= input.absoluteTimeoutMs)
|
|
119
|
+
return 'timedOutTotal';
|
|
120
|
+
return 'keepWaiting';
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=jsonStreamBusyWatchdog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonStreamBusyWatchdog.js","sourceRoot":"","sources":["../../src/utils/jsonStreamBusyWatchdog.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;;;AAiCH,gEAQC;AAwCD,kEAMC;AAoBD,4DAaC;AAtHD;;;;;GAKG;AACU,QAAA,kBAAkB,GAAG,OAAO,CAAC;AAmB1C;;;;;GAKG;AACH,SAAgB,0BAA0B,CAAC,KAA4B;IACrE,IAAI,CAAC,KAAK,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAChC,IAAI,KAAK,CAAC,qBAAqB,GAAG,KAAK,CAAC,aAAa;QAAE,OAAO,KAAK,CAAC;IACpE,IAAI,KAAK,CAAC,oBAAoB,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACjD,IAAI,KAAK,CAAC,cAAc;QAAE,OAAO,KAAK,CAAC;IACvC,IAAI,KAAK,CAAC,kBAAkB;QAAE,OAAO,KAAK,CAAC;IAC3C,IAAI,KAAK,CAAC,kBAAkB;QAAE,OAAO,KAAK,CAAC;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACU,QAAA,0BAA0B,GAAG,OAAO,CAAC;AAElD;;;;;GAKG;AACU,QAAA,2BAA2B,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE1D,8DAA8D;AACjD,QAAA,oBAAoB,GAAG,MAAM,CAAC;AAU3C;;;;;;;;;GASG;AACH,SAAgB,2BAA2B,CAAC,KAG3C;IACC,IAAI,KAAK,CAAC,UAAU;QAAE,OAAO,EAAE,IAAI,EAAE,6BAA6B,EAAE,CAAC;IACrE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,OAAO,KAAK,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;AAC7F,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,wBAAwB,CAAC,KASxC;IACC,IAAI,KAAK,CAAC,qBAAqB,IAAI,KAAK,CAAC,gBAAgB;QAAE,OAAO,gBAAgB,CAAC;IACnF,IAAI,KAAK,CAAC,wBAAwB,IAAI,KAAK,CAAC,iBAAiB;QAAE,OAAO,eAAe,CAAC;IACtF,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Host layout + IO primitives for the json-stream Claude backend's
|
|
3
|
+
* EXTERNAL process transport (plan 2026-07-05-jsonstream-restart-isolation).
|
|
4
|
+
*
|
|
5
|
+
* The `claude -p … stream-json` process is NOT a bot child any more: a `#!/bin/sh`
|
|
6
|
+
* wrapper hosts it inside a detached tmux session, with stdio rerouted to files
|
|
7
|
+
* under `DATA_DIR/jsonstream/<serialized key with ":" → "_">/` (Telegram:
|
|
8
|
+
* `<chatId>_<threadId>`):
|
|
9
|
+
*
|
|
10
|
+
* stdin.fifo ← the bot's control/user-turn writes (claude holds it `0<>`,
|
|
11
|
+
* i.e. open read-write on fd 0, so a bot restart — the writer
|
|
12
|
+
* dying — never EOFs claude's stdin; proven by the P1 probe)
|
|
13
|
+
* stdout.jsonl ← append-only stream-json event log the bot TAILS from a byte
|
|
14
|
+
* offset (deltas keep landing while the bot is down)
|
|
15
|
+
* stderr.log ← passive; read only for spawn-fail / exit diagnostics
|
|
16
|
+
* pid, exitcode ← written by the wrapper; the adapter's poll tick uses them
|
|
17
|
+
* for exit detection (pid-alive + exitcode file)
|
|
18
|
+
* wrapper.sh ← the generated host script itself
|
|
19
|
+
* question.json ← the pending AskUserQuestion control_request (written when
|
|
20
|
+
* surfaced, removed when resolved) so an adopt after a bot
|
|
21
|
+
* restart can still answer it over the FIFO
|
|
22
|
+
*
|
|
23
|
+
* Everything here is either pure decision logic (tail offsets, wrapper text,
|
|
24
|
+
* name codecs) or a thin fs primitive (FIFO open/write, pid/exitcode readers)
|
|
25
|
+
* — the orchestration lives in `adapters/claudeJsonStreamAdapter.ts`.
|
|
26
|
+
*/
|
|
27
|
+
import { StringDecoder } from 'string_decoder';
|
|
28
|
+
import { type SessionKey } from '../sessionKey';
|
|
29
|
+
import type { JsonStreamTailOffset } from '../types';
|
|
30
|
+
/** Subdirectory of `DATA_DIR` that holds every thread's json-stream host dir. */
|
|
31
|
+
export declare const jsonStreamRootDirName = "jsonstream";
|
|
32
|
+
/** tmux session-name prefix for this backend — distinct from the scrape
|
|
33
|
+
* backend's `claude` and the terminal's `term`, so adopt-at-boot scans never
|
|
34
|
+
* cross-talk (locked decision). */
|
|
35
|
+
export declare const jsonStreamTmuxPrefix = "cjson";
|
|
36
|
+
/** Exit code the wrapper reports when `cd <workDir>` fails (folder vanished
|
|
37
|
+
* between bind and spawn) — claude must never run in the wrong directory. */
|
|
38
|
+
export declare const wrapperCdFailExitCode = 96;
|
|
39
|
+
/** How long a fresh spawn waits for the wrapper to write the `pid` file. */
|
|
40
|
+
export declare const pidFileWaitTimeoutMs = 5000;
|
|
41
|
+
export declare const pidFilePollIntervalMs = 100;
|
|
42
|
+
/** FIFO write-open guard (P1 probe): `O_WRONLY|O_NONBLOCK` raises `ENXIO`
|
|
43
|
+
* while nothing holds the read end — a BLOCKING open would hang forever.
|
|
44
|
+
* Retried because claude opens its `0<>` end asynchronously during spawn;
|
|
45
|
+
* `ENXIO` persisting past the retries means the process is dead. */
|
|
46
|
+
export declare const fifoOpenMaxTries = 10;
|
|
47
|
+
export declare const fifoOpenRetryDelayMs = 500;
|
|
48
|
+
/** A full FIFO buffer raises `EAGAIN` on a non-blocking write — transient,
|
|
49
|
+
* claude drains it. Bounded so a truly wedged reader can't spin forever. */
|
|
50
|
+
export declare const fifoWriteMaxRetries = 100;
|
|
51
|
+
export declare const fifoWriteRetryDelayMs = 50;
|
|
52
|
+
/** No rotation in v1 (locked decision): the file is per-session and deleted on
|
|
53
|
+
* stop/release. Past this size we log ONE warning, never rotate. */
|
|
54
|
+
export declare const stdoutOversizeWarnBytes: number;
|
|
55
|
+
/** Cap for the stderr excerpt quoted into spawn-fail / unexpected-exit logs. */
|
|
56
|
+
export declare const stderrTailMaxChars = 400;
|
|
57
|
+
/** Absolute paths of every file in one thread's json-stream host dir. */
|
|
58
|
+
export interface JsonStreamSessionPaths {
|
|
59
|
+
dir: string;
|
|
60
|
+
stdinFifo: string;
|
|
61
|
+
stdoutFile: string;
|
|
62
|
+
stderrFile: string;
|
|
63
|
+
pidFile: string;
|
|
64
|
+
exitCodeFile: string;
|
|
65
|
+
wrapperFile: string;
|
|
66
|
+
questionFile: string;
|
|
67
|
+
}
|
|
68
|
+
/** Absolute path of the `jsonstream/` root under a given data dir. */
|
|
69
|
+
export declare function resolveJsonStreamRoot(dataDir: string): string;
|
|
70
|
+
/** Absolute path of one thread's json-stream host dir. */
|
|
71
|
+
export declare function resolveJsonStreamSessionDir(dataDir: string, key: SessionKey): string;
|
|
72
|
+
/**
|
|
73
|
+
* @description Inverse of the host-dir naming for the orphan-dir janitor.
|
|
74
|
+
* Strictness lives in the connector's codec (mirrors `parseTmuxSessionName`),
|
|
75
|
+
* so a foreign dir that happens to sit under `jsonstream/` is skipped, never
|
|
76
|
+
* swept by a mis-parse.
|
|
77
|
+
*/
|
|
78
|
+
export declare function parseJsonStreamDirName(name: string): SessionKey | null;
|
|
79
|
+
export declare function getJsonStreamSessionPaths(dir: string): JsonStreamSessionPaths;
|
|
80
|
+
/** tmux session name for a json-stream thread (`cjson-<chatId>-<threadId>`). */
|
|
81
|
+
export declare function buildJsonStreamTmuxSessionName(key: SessionKey): string;
|
|
82
|
+
/** Inverse of {@link buildJsonStreamTmuxSessionName}; `null` for foreign names. */
|
|
83
|
+
export declare function parseJsonStreamTmuxSessionName(name: string): SessionKey | null;
|
|
84
|
+
/**
|
|
85
|
+
* @description The `#!/bin/sh` host script (exact shape proven by the P1 probe
|
|
86
|
+
* `p1-probe2.mjs`): background claude with its stdio rerouted to the host files,
|
|
87
|
+
* record the child pid, then `wait` and record the exit code. `0<>` opens the
|
|
88
|
+
* stdin FIFO READ-WRITE on fd 0 — the load-bearing trick: claude itself holds a
|
|
89
|
+
* read end open, so the bot (a plain writer) can die and reconnect freely.
|
|
90
|
+
* `env -u ANTHROPIC_API_KEY` keeps subscription billing (`apiKeySource:"none"`)
|
|
91
|
+
* even if the tmux server environment carries a key. With an `environment`
|
|
92
|
+
* (a tracker conversation, R32) claude gets exactly those variables instead —
|
|
93
|
+
* `env -i`, so nothing of the tmux server's environment reaches it (no API key
|
|
94
|
+
* either). All embedded strings are single-quoted; `claudePath` must be ABSOLUTE
|
|
95
|
+
* (tmux server PATH differs).
|
|
96
|
+
*/
|
|
97
|
+
export declare function buildWrapperScript(claudePath: string, args: readonly string[], workDir: string, paths: JsonStreamSessionPaths, environment?: Readonly<Record<string, string>> | null): string;
|
|
98
|
+
/**
|
|
99
|
+
* @description Open the stdin FIFO for writing WITHOUT ever blocking: a plain
|
|
100
|
+
* `open(O_WRONLY)` on a FIFO with no reader hangs forever (the P1 probe's first
|
|
101
|
+
* attempt did exactly that). `O_NONBLOCK` turns "no reader" into `ENXIO`,
|
|
102
|
+
* retried on a short delay while claude is still coming up. Returns the fd, or
|
|
103
|
+
* `null` when `ENXIO` persists — i.e. the claude process is NOT holding the
|
|
104
|
+
* FIFO, so the session is dead.
|
|
105
|
+
*/
|
|
106
|
+
export declare function openFifoWriterNonBlocking(fifoPath: string, maxTries?: number): Promise<number | null>;
|
|
107
|
+
/**
|
|
108
|
+
* @description Write `text` to a non-blocking FIFO fd, retrying transient
|
|
109
|
+
* `EAGAIN` (buffer full — claude drains it) with a bounded backoff and
|
|
110
|
+
* continuing partial writes (a payload larger than the FIFO buffer lands in
|
|
111
|
+
* chunks). Anything else (`EPIPE` after claude died, `EBADF` after close)
|
|
112
|
+
* propagates to the caller's per-session write chain, which logs it.
|
|
113
|
+
*/
|
|
114
|
+
export declare function writeFifoText(fd: number, text: string): Promise<void>;
|
|
115
|
+
export declare function readPidFile(pidFile: string): number | null;
|
|
116
|
+
export declare function readExitCodeFile(exitCodeFile: string): number | null;
|
|
117
|
+
/** `kill(pid, 0)` liveness probe (no signal actually delivered). */
|
|
118
|
+
export declare function checkIsPidAlive(pid: number): boolean;
|
|
119
|
+
/** Wait (bounded) for the wrapper to write the `pid` file after tmux spawn.
|
|
120
|
+
* Returns the pid, or `null` on timeout (spawn diagnostics read stderr). */
|
|
121
|
+
export declare function waitForPidFile(pidFile: string, timeoutMs?: number): Promise<number | null>;
|
|
122
|
+
/** Last `maxChars` of the passive stderr log — spawn-fail / exit diagnostics
|
|
123
|
+
* only (locked decision: no live stderr consumer). Empty when absent. */
|
|
124
|
+
export declare function readStderrTail(stderrFile: string, maxChars?: number): string;
|
|
125
|
+
/** File size in bytes, or `null` when the file doesn't exist (yet). */
|
|
126
|
+
export declare function getFileSize(filePath: string): number | null;
|
|
127
|
+
/** Read the byte range `[startOffset..endOffset)` of a file. May return fewer
|
|
128
|
+
* bytes than asked on a race — the tail accounts by ACTUAL bytes consumed. */
|
|
129
|
+
export declare function readFileByteRange(filePath: string, startOffset: number, endOffset: number): Buffer;
|
|
130
|
+
/** Where an adopting bot resumes the stdout tail, and the background-task list
|
|
131
|
+
* in force at that point (see {@link resolveAdoptedTail}). */
|
|
132
|
+
export interface AdoptedTailStart {
|
|
133
|
+
startOffset: number;
|
|
134
|
+
backgroundTaskIds: string[];
|
|
135
|
+
isTurnInFlight: boolean;
|
|
136
|
+
outstandingToolUseIds: string[];
|
|
137
|
+
claudeCodeVersion: string | null;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* @description Decide where an ADOPT resumes the stdout tail. A persisted offset
|
|
141
|
+
* is trusted only when it was recorded for the SAME claude session — a foreign /
|
|
142
|
+
* unknown offset seeds to the current EOF (no backlog flood, the first-migration
|
|
143
|
+
* case) — and is clamped to the file size (an externally truncated file). The
|
|
144
|
+
* background-task list persisted with the offset is restored on the same
|
|
145
|
+
* condition: the frames that built it lie before the offset and will not
|
|
146
|
+
* replay, so without it an adopted session with a running background task
|
|
147
|
+
* would read as idle and could be stopped (L-D2). The turn-in-flight flag and
|
|
148
|
+
* the outstanding tool calls are restored the same way — a turn in a long,
|
|
149
|
+
* silent tool call leaves no frame after the offset either, and the outstanding
|
|
150
|
+
* tool is what keeps the busy-idle watchdog from clearing the restored turn.
|
|
151
|
+
*/
|
|
152
|
+
export declare function resolveAdoptedTail(persistedTail: JsonStreamTailOffset | null, claudeSessionId: string, stdoutSizeBytes: number): AdoptedTailStart;
|
|
153
|
+
/**
|
|
154
|
+
* @description Tail bookkeeping for ONE session's `stdout.jsonl` (the pattern of
|
|
155
|
+
* `claudeSubagentTail`, adapted to a single file feeding the stream-json line
|
|
156
|
+
* reader). Byte-exact so the offset persisted across bot restarts always lands
|
|
157
|
+
* on a LINE BOUNDARY — the restarted tail resumes on clean JSON, never a torn
|
|
158
|
+
* line:
|
|
159
|
+
*
|
|
160
|
+
* consumedBytes — file bytes read + fed to the utf8 decoder
|
|
161
|
+
* decoderRetainedBytes — bytes the decoder holds back (a multi-byte char split
|
|
162
|
+
* at a read boundary; stdout is block-buffered, so
|
|
163
|
+
* splits mid-char DO happen with non-ASCII deltas)
|
|
164
|
+
*
|
|
165
|
+
* The line-boundary offset additionally subtracts the line reader's pending
|
|
166
|
+
* partial line ({@link getStdoutLineBoundaryOffset}) — those bytes were consumed
|
|
167
|
+
* but not yet processed, so a restart re-reads exactly them and nothing twice.
|
|
168
|
+
*/
|
|
169
|
+
export interface StdoutTailState {
|
|
170
|
+
consumedBytes: number;
|
|
171
|
+
decoderRetainedBytes: number;
|
|
172
|
+
decoder: StringDecoder;
|
|
173
|
+
}
|
|
174
|
+
export declare function createStdoutTailState(startOffsetBytes: number): StdoutTailState;
|
|
175
|
+
/** What one tail poll should do given the file's current size. */
|
|
176
|
+
export type StdoutTailDecision =
|
|
177
|
+
/** Nothing new. */
|
|
178
|
+
{
|
|
179
|
+
kind: 'none';
|
|
180
|
+
}
|
|
181
|
+
/** Read `[startOffset..endOffset)` and feed it through the decoder/reader. */
|
|
182
|
+
| {
|
|
183
|
+
kind: 'read';
|
|
184
|
+
startOffset: number;
|
|
185
|
+
endOffset: number;
|
|
186
|
+
}
|
|
187
|
+
/** The file SHRANK below the consumed offset (external truncation — should
|
|
188
|
+
* not happen for the append-only log). State was reset to the new EOF; the
|
|
189
|
+
* caller must reset its line reader too (a stale partial would corrupt the
|
|
190
|
+
* next line). */
|
|
191
|
+
| {
|
|
192
|
+
kind: 'reseed';
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* @description Decide the next tail action. Does NOT advance offsets on a
|
|
196
|
+
* `read` — {@link decodeStdoutTailChunk} advances by the bytes ACTUALLY read,
|
|
197
|
+
* so a short read (race with a concurrent append) self-heals next poll.
|
|
198
|
+
*/
|
|
199
|
+
export declare function getStdoutTailDecision(state: StdoutTailState, sizeBytes: number): StdoutTailDecision;
|
|
200
|
+
/**
|
|
201
|
+
* @description Feed one appended byte chunk through the stateful utf8 decoder.
|
|
202
|
+
* Returns the decoded text (possibly empty while a multi-byte char is split);
|
|
203
|
+
* advances `consumedBytes` by the chunk length and re-derives the decoder's
|
|
204
|
+
* retained-byte count (`retainedNew = retainedPrior + chunkLen - decodedLen`,
|
|
205
|
+
* clamped defensively — invalid utf8 replacement chars could otherwise skew it
|
|
206
|
+
* negative).
|
|
207
|
+
*/
|
|
208
|
+
export declare function decodeStdoutTailChunk(state: StdoutTailState, chunk: Buffer): string;
|
|
209
|
+
/**
|
|
210
|
+
* @description The byte offset up to which every COMPLETE line has been
|
|
211
|
+
* processed — the value persisted across bot restarts. `pendingLineText` is the
|
|
212
|
+
* line reader's buffered partial line (`ClaudeStreamLineReader.pending`): those
|
|
213
|
+
* bytes were consumed but not yet processed, so the persisted offset excludes
|
|
214
|
+
* them and a restarted tail re-reads exactly the unprocessed remainder.
|
|
215
|
+
*/
|
|
216
|
+
export declare function getStdoutLineBoundaryOffset(state: StdoutTailState, pendingLineText: string): number;
|
|
217
|
+
/**
|
|
218
|
+
* @description Janitor: remove `jsonstream/` host dirs whose thread no longer
|
|
219
|
+
* owns a json-stream session (crash leftovers — the normal stop/release paths
|
|
220
|
+
* delete the dir themselves, and reattach handles live tmux sessions).
|
|
221
|
+
* `checkIsThreadOwned` is injected by the bot (persisted json-stream agent row
|
|
222
|
+
* with a session id, or a currently-active adapter session). Unparseable dir
|
|
223
|
+
* names are skipped, never swept. Returns the number of dirs removed. Runs at
|
|
224
|
+
* boot + the daily file sweep.
|
|
225
|
+
*/
|
|
226
|
+
export declare function sweepOrphanJsonStreamDirs(jsonStreamRoot: string, checkIsThreadOwned: (key: SessionKey) => boolean): Promise<number>;
|
|
227
|
+
//# sourceMappingURL=jsonStreamHost.d.ts.map
|