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,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description The OpenCode plugin the bot installs so that a compaction OpenCode
|
|
3
|
+
* runs ON ITS OWN when the context overflows also tells the next session which
|
|
4
|
+
* skills to load again.
|
|
5
|
+
*
|
|
6
|
+
* WHY this exists: the loaded-skills guidance rides the bot's per-invocation
|
|
7
|
+
* `instruction` (`POST /session/:id/summarize`), which an overflow compaction
|
|
8
|
+
* never receives, and unlike D3 it is not baked into the fork's prompt. OpenCode
|
|
9
|
+
* runs the plugin hook `experimental.session.compacting` before EVERY compaction
|
|
10
|
+
* (manual and overflow) and appends the strings a plugin pushes into
|
|
11
|
+
* `output.context` to the compaction prompt. A plugin needs no fork rebuild.
|
|
12
|
+
*
|
|
13
|
+
* WHERE it lives: OpenCode's global plugin folder
|
|
14
|
+
* (`$XDG_CONFIG_HOME/opencode/plugins/`, scanned for `*.{ts,js}` whenever a
|
|
15
|
+
* project-folder instance is created), so every OpenCode on this account loads it
|
|
16
|
+
* — one the bot started, one it adopted, one run by hand. The bot owns that one
|
|
17
|
+
* file and rewrites it only when its content changed; the user's `opencode.json`
|
|
18
|
+
* is never touched.
|
|
19
|
+
*
|
|
20
|
+
* A RUNNING instance does not rescan: OpenCode loads plugins once per project
|
|
21
|
+
* folder. `POST /instance/dispose?directory=` makes the next request recreate the
|
|
22
|
+
* folder's instance, which then loads the plugin — no server restart, sessions
|
|
23
|
+
* stay on disk. Measured on the fork build: a plugin file added to a live folder
|
|
24
|
+
* did not load until that dispose, and its `server()` ran right after. Recreating
|
|
25
|
+
* drops the folder's runtime MCP registrations, so the bot reconciles its own MCP
|
|
26
|
+
* server right after. It only recreates an idle folder
|
|
27
|
+
* ({@link getCompactPluginActivation}).
|
|
28
|
+
*
|
|
29
|
+
* The hook only sees the session id, never the bot's per-invocation instruction,
|
|
30
|
+
* so it cannot skip a compaction that already carries the guidance. The bot
|
|
31
|
+
* therefore leaves the skills guidance out of its instruction when the folder's
|
|
32
|
+
* instance has this plugin ({@link checkHasOpenCodeCompactPlugin} over
|
|
33
|
+
* `GET /config`), and keeps it otherwise.
|
|
34
|
+
*/
|
|
35
|
+
/** File name of the plugin in OpenCode's plugin folder; also how the bot recognises it in `GET /config`. */
|
|
36
|
+
export declare const openCodeCompactPluginFileName = "telegramcode-compaction.js";
|
|
37
|
+
/** OpenCode requires a path plugin to export an id. */
|
|
38
|
+
export declare const openCodeCompactPluginId = "telegramcode-compaction";
|
|
39
|
+
/**
|
|
40
|
+
* @description The text the plugin adds to every compaction prompt. OpenCode
|
|
41
|
+
* appends it AFTER the bot's per-invocation instruction, which may end with the
|
|
42
|
+
* F2 closing-section directive ("write nothing after the end marker"), so the text
|
|
43
|
+
* says outright that the skills list belongs inside the summary.
|
|
44
|
+
*/
|
|
45
|
+
export declare function getOpenCodeCompactPluginContext(): string;
|
|
46
|
+
/** @description The plugin module source: a v1 plugin (`default` export with `id` + `server`). */
|
|
47
|
+
export declare function buildOpenCodeCompactPluginSource(context: string): string;
|
|
48
|
+
/** @description OpenCode's global plugin folder, resolved the way OpenCode resolves it (XDG config home). */
|
|
49
|
+
export declare function resolveOpenCodeGlobalPluginDir(env: NodeJS.ProcessEnv): string;
|
|
50
|
+
/**
|
|
51
|
+
* @description Whether a `GET /config` `plugin` list contains the bot's plugin. A
|
|
52
|
+
* spec is a string or a `[spec, options]` tuple; OpenCode reports a path plugin as
|
|
53
|
+
* a `file://` URL.
|
|
54
|
+
*/
|
|
55
|
+
export declare function checkHasOpenCodeCompactPlugin(pluginSpecs: unknown): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Boot decision for one project folder: its instance already has the plugin, it
|
|
58
|
+
* should be recreated to load it, or it is working and must not be disturbed.
|
|
59
|
+
*/
|
|
60
|
+
export type CompactPluginActivation = 'loaded' | 'recreate' | 'busy';
|
|
61
|
+
/**
|
|
62
|
+
* @description Decide what to do with a folder's instance from its `GET /config`
|
|
63
|
+
* plugin list and its `GET /session/status` map. Recreating aborts whatever the
|
|
64
|
+
* folder is running, so ANY session that is not `idle` makes it `busy` — and so
|
|
65
|
+
* does a status the bot cannot read: never recreate on a guess.
|
|
66
|
+
*/
|
|
67
|
+
export declare function getCompactPluginActivation(input: {
|
|
68
|
+
pluginSpecs: unknown;
|
|
69
|
+
sessionStatus: unknown;
|
|
70
|
+
}): CompactPluginActivation;
|
|
71
|
+
/** Outcome of {@link installOpenCodeCompactPlugin}. */
|
|
72
|
+
export type CompactPluginInstallResult = 'written' | 'unchanged' | 'failed';
|
|
73
|
+
/**
|
|
74
|
+
* @description Put the plugin into OpenCode's global plugin folder. Idempotent:
|
|
75
|
+
* an identical file is left alone, a stale one is replaced atomically (a folder
|
|
76
|
+
* instance being created concurrently never reads half a file). Any failure is
|
|
77
|
+
* logged and returned — the plugin improves a summary, it must never block an
|
|
78
|
+
* OpenCode start or the bot's boot.
|
|
79
|
+
*/
|
|
80
|
+
export declare function installOpenCodeCompactPlugin(pluginDir?: string): CompactPluginInstallResult;
|
|
81
|
+
//# sourceMappingURL=openCodeCompactPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openCodeCompactPlugin.d.ts","sourceRoot":"","sources":["../../src/utils/openCodeCompactPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAOH,4GAA4G;AAC5G,eAAO,MAAM,6BAA6B,+BAA+B,CAAC;AAE1E,uDAAuD;AACvD,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AAEjE;;;;;GAKG;AACH,wBAAgB,+BAA+B,IAAI,MAAM,CAExD;AAED,kGAAkG;AAClG,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAcxE;AAED,6GAA6G;AAC7G,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAG7E;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAM3E;AAED;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAErE;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;CACxB,GAAG,uBAAuB,CAQ1B;AAED,uDAAuD;AACvD,MAAM,MAAM,0BAA0B,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE5E;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,GAAE,MAAoD,GAC9D,0BAA0B,CAmB5B"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description The OpenCode plugin the bot installs so that a compaction OpenCode
|
|
4
|
+
* runs ON ITS OWN when the context overflows also tells the next session which
|
|
5
|
+
* skills to load again.
|
|
6
|
+
*
|
|
7
|
+
* WHY this exists: the loaded-skills guidance rides the bot's per-invocation
|
|
8
|
+
* `instruction` (`POST /session/:id/summarize`), which an overflow compaction
|
|
9
|
+
* never receives, and unlike D3 it is not baked into the fork's prompt. OpenCode
|
|
10
|
+
* runs the plugin hook `experimental.session.compacting` before EVERY compaction
|
|
11
|
+
* (manual and overflow) and appends the strings a plugin pushes into
|
|
12
|
+
* `output.context` to the compaction prompt. A plugin needs no fork rebuild.
|
|
13
|
+
*
|
|
14
|
+
* WHERE it lives: OpenCode's global plugin folder
|
|
15
|
+
* (`$XDG_CONFIG_HOME/opencode/plugins/`, scanned for `*.{ts,js}` whenever a
|
|
16
|
+
* project-folder instance is created), so every OpenCode on this account loads it
|
|
17
|
+
* — one the bot started, one it adopted, one run by hand. The bot owns that one
|
|
18
|
+
* file and rewrites it only when its content changed; the user's `opencode.json`
|
|
19
|
+
* is never touched.
|
|
20
|
+
*
|
|
21
|
+
* A RUNNING instance does not rescan: OpenCode loads plugins once per project
|
|
22
|
+
* folder. `POST /instance/dispose?directory=` makes the next request recreate the
|
|
23
|
+
* folder's instance, which then loads the plugin — no server restart, sessions
|
|
24
|
+
* stay on disk. Measured on the fork build: a plugin file added to a live folder
|
|
25
|
+
* did not load until that dispose, and its `server()` ran right after. Recreating
|
|
26
|
+
* drops the folder's runtime MCP registrations, so the bot reconciles its own MCP
|
|
27
|
+
* server right after. It only recreates an idle folder
|
|
28
|
+
* ({@link getCompactPluginActivation}).
|
|
29
|
+
*
|
|
30
|
+
* The hook only sees the session id, never the bot's per-invocation instruction,
|
|
31
|
+
* so it cannot skip a compaction that already carries the guidance. The bot
|
|
32
|
+
* therefore leaves the skills guidance out of its instruction when the folder's
|
|
33
|
+
* instance has this plugin ({@link checkHasOpenCodeCompactPlugin} over
|
|
34
|
+
* `GET /config`), and keeps it otherwise.
|
|
35
|
+
*/
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.openCodeCompactPluginId = exports.openCodeCompactPluginFileName = void 0;
|
|
41
|
+
exports.getOpenCodeCompactPluginContext = getOpenCodeCompactPluginContext;
|
|
42
|
+
exports.buildOpenCodeCompactPluginSource = buildOpenCodeCompactPluginSource;
|
|
43
|
+
exports.resolveOpenCodeGlobalPluginDir = resolveOpenCodeGlobalPluginDir;
|
|
44
|
+
exports.checkHasOpenCodeCompactPlugin = checkHasOpenCodeCompactPlugin;
|
|
45
|
+
exports.getCompactPluginActivation = getCompactPluginActivation;
|
|
46
|
+
exports.installOpenCodeCompactPlugin = installOpenCodeCompactPlugin;
|
|
47
|
+
const fs_1 = __importDefault(require("fs"));
|
|
48
|
+
const os_1 = __importDefault(require("os"));
|
|
49
|
+
const path_1 = __importDefault(require("path"));
|
|
50
|
+
const compactOnIdle_1 = require("./compactOnIdle");
|
|
51
|
+
/** File name of the plugin in OpenCode's plugin folder; also how the bot recognises it in `GET /config`. */
|
|
52
|
+
exports.openCodeCompactPluginFileName = 'telegramcode-compaction.js';
|
|
53
|
+
/** OpenCode requires a path plugin to export an id. */
|
|
54
|
+
exports.openCodeCompactPluginId = 'telegramcode-compaction';
|
|
55
|
+
/**
|
|
56
|
+
* @description The text the plugin adds to every compaction prompt. OpenCode
|
|
57
|
+
* appends it AFTER the bot's per-invocation instruction, which may end with the
|
|
58
|
+
* F2 closing-section directive ("write nothing after the end marker"), so the text
|
|
59
|
+
* says outright that the skills list belongs inside the summary.
|
|
60
|
+
*/
|
|
61
|
+
function getOpenCodeCompactPluginContext() {
|
|
62
|
+
return `Additional instruction for the summary itself (put it inside the summary, never after a closing section the instructions above require): ${compactOnIdle_1.compactionSkillsGuidance}`;
|
|
63
|
+
}
|
|
64
|
+
/** @description The plugin module source: a v1 plugin (`default` export with `id` + `server`). */
|
|
65
|
+
function buildOpenCodeCompactPluginSource(context) {
|
|
66
|
+
return [
|
|
67
|
+
'// Installed by Charness, which rewrites it when its content changes. Do not edit.',
|
|
68
|
+
`const context = ${JSON.stringify(context)};`,
|
|
69
|
+
'export default {',
|
|
70
|
+
` id: ${JSON.stringify(exports.openCodeCompactPluginId)},`,
|
|
71
|
+
' server: async () => ({',
|
|
72
|
+
' "experimental.session.compacting": async (_input, output) => {',
|
|
73
|
+
' output.context.push(context);',
|
|
74
|
+
' },',
|
|
75
|
+
' }),',
|
|
76
|
+
'};',
|
|
77
|
+
'',
|
|
78
|
+
].join('\n');
|
|
79
|
+
}
|
|
80
|
+
/** @description OpenCode's global plugin folder, resolved the way OpenCode resolves it (XDG config home). */
|
|
81
|
+
function resolveOpenCodeGlobalPluginDir(env) {
|
|
82
|
+
const configHome = env.XDG_CONFIG_HOME || path_1.default.join(os_1.default.homedir(), '.config');
|
|
83
|
+
return path_1.default.join(configHome, 'opencode', 'plugins');
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @description Whether a `GET /config` `plugin` list contains the bot's plugin. A
|
|
87
|
+
* spec is a string or a `[spec, options]` tuple; OpenCode reports a path plugin as
|
|
88
|
+
* a `file://` URL.
|
|
89
|
+
*/
|
|
90
|
+
function checkHasOpenCodeCompactPlugin(pluginSpecs) {
|
|
91
|
+
if (!Array.isArray(pluginSpecs))
|
|
92
|
+
return false;
|
|
93
|
+
return pluginSpecs.some((entry) => {
|
|
94
|
+
const spec = Array.isArray(entry) ? entry[0] : entry;
|
|
95
|
+
return typeof spec === 'string' && spec.endsWith(`/${exports.openCodeCompactPluginFileName}`);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* @description Decide what to do with a folder's instance from its `GET /config`
|
|
100
|
+
* plugin list and its `GET /session/status` map. Recreating aborts whatever the
|
|
101
|
+
* folder is running, so ANY session that is not `idle` makes it `busy` — and so
|
|
102
|
+
* does a status the bot cannot read: never recreate on a guess.
|
|
103
|
+
*/
|
|
104
|
+
function getCompactPluginActivation(input) {
|
|
105
|
+
if (checkHasOpenCodeCompactPlugin(input.pluginSpecs))
|
|
106
|
+
return 'loaded';
|
|
107
|
+
const status = input.sessionStatus;
|
|
108
|
+
if (!status || typeof status !== 'object' || Array.isArray(status))
|
|
109
|
+
return 'busy';
|
|
110
|
+
const isAnyBusy = Object.values(status).some((entry) => !entry || typeof entry !== 'object' || entry.type !== 'idle');
|
|
111
|
+
return isAnyBusy ? 'busy' : 'recreate';
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* @description Put the plugin into OpenCode's global plugin folder. Idempotent:
|
|
115
|
+
* an identical file is left alone, a stale one is replaced atomically (a folder
|
|
116
|
+
* instance being created concurrently never reads half a file). Any failure is
|
|
117
|
+
* logged and returned — the plugin improves a summary, it must never block an
|
|
118
|
+
* OpenCode start or the bot's boot.
|
|
119
|
+
*/
|
|
120
|
+
function installOpenCodeCompactPlugin(pluginDir = resolveOpenCodeGlobalPluginDir(process.env)) {
|
|
121
|
+
const pluginPath = path_1.default.join(pluginDir, exports.openCodeCompactPluginFileName);
|
|
122
|
+
const source = buildOpenCodeCompactPluginSource(getOpenCodeCompactPluginContext());
|
|
123
|
+
try {
|
|
124
|
+
if (fs_1.default.readFileSync(pluginPath, 'utf-8') === source)
|
|
125
|
+
return 'unchanged';
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
// Missing or unreadable: (re)write below.
|
|
129
|
+
}
|
|
130
|
+
const tmpPath = `${pluginPath}.${process.pid}.${Date.now()}.tmp`;
|
|
131
|
+
try {
|
|
132
|
+
fs_1.default.mkdirSync(pluginDir, { recursive: true });
|
|
133
|
+
fs_1.default.writeFileSync(tmpPath, source);
|
|
134
|
+
fs_1.default.renameSync(tmpPath, pluginPath);
|
|
135
|
+
}
|
|
136
|
+
catch (e) {
|
|
137
|
+
console.warn(`[compact-plugin] cannot write ${pluginPath}:`, e);
|
|
138
|
+
try {
|
|
139
|
+
fs_1.default.unlinkSync(tmpPath);
|
|
140
|
+
}
|
|
141
|
+
catch { /* never written */ }
|
|
142
|
+
return 'failed';
|
|
143
|
+
}
|
|
144
|
+
return 'written';
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=openCodeCompactPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openCodeCompactPlugin.js","sourceRoot":"","sources":["../../src/utils/openCodeCompactPlugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;;;;;;AAmBH,0EAEC;AAGD,4EAcC;AAGD,wEAGC;AAOD,sEAMC;AAcD,gEAWC;AAYD,oEAqBC;AAjHD,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AACxB,mDAA2D;AAE3D,4GAA4G;AAC/F,QAAA,6BAA6B,GAAG,4BAA4B,CAAC;AAE1E,uDAAuD;AAC1C,QAAA,uBAAuB,GAAG,yBAAyB,CAAC;AAEjE;;;;;GAKG;AACH,SAAgB,+BAA+B;IAC7C,OAAO,4IAA4I,wCAAwB,EAAE,CAAC;AAChL,CAAC;AAED,kGAAkG;AAClG,SAAgB,gCAAgC,CAAC,OAAe;IAC9D,OAAO;QACL,oFAAoF;QACpF,mBAAmB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG;QAC7C,kBAAkB;QAClB,SAAS,IAAI,CAAC,SAAS,CAAC,+BAAuB,CAAC,GAAG;QACnD,0BAA0B;QAC1B,oEAAoE;QACpE,qCAAqC;QACrC,QAAQ;QACR,OAAO;QACP,IAAI;QACJ,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,6GAA6G;AAC7G,SAAgB,8BAA8B,CAAC,GAAsB;IACnE,MAAM,UAAU,GAAG,GAAG,CAAC,eAAe,IAAI,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;IAC7E,OAAO,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;AACtD,CAAC;AAED;;;;GAIG;AACH,SAAgB,6BAA6B,CAAC,WAAoB;IAChE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9C,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;QAChC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACrD,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,qCAA6B,EAAE,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;AACL,CAAC;AAQD;;;;;GAKG;AACH,SAAgB,0BAA0B,CAAC,KAG1C;IACC,IAAI,6BAA6B,CAAC,KAAK,CAAC,WAAW,CAAC;QAAE,OAAO,QAAQ,CAAC;IACtE,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC;IACnC,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAClF,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAC1C,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAK,KAA4B,CAAC,IAAI,KAAK,MAAM,CAChG,CAAC;IACF,OAAO,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC;AACzC,CAAC;AAKD;;;;;;GAMG;AACH,SAAgB,4BAA4B,CAC1C,YAAoB,8BAA8B,CAAC,OAAO,CAAC,GAAG,CAAC;IAE/D,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,qCAA6B,CAAC,CAAC;IACvE,MAAM,MAAM,GAAG,gCAAgC,CAAC,+BAA+B,EAAE,CAAC,CAAC;IACnF,IAAI,CAAC;QACH,IAAI,YAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,KAAK,MAAM;YAAE,OAAO,WAAW,CAAC;IAC1E,CAAC;IAAC,MAAM,CAAC;QACP,0CAA0C;IAC5C,CAAC;IACD,MAAM,OAAO,GAAG,GAAG,UAAU,IAAI,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC;IACjE,IAAI,CAAC;QACH,YAAE,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7C,YAAE,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAClC,YAAE,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,IAAI,CAAC,iCAAiC,UAAU,GAAG,EAAE,CAAC,CAAC,CAAC;QAChE,IAAI,CAAC;YAAC,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC;QAC7D,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Pure decision for the OpenCode "prompt delivered but the agent
|
|
3
|
+
* never ran a turn" detector.
|
|
4
|
+
*
|
|
5
|
+
* OpenCode ALWAYS creates an assistant message when a turn genuinely starts
|
|
6
|
+
* (even a pure delegation emits the parent's text before spawning a sub-agent),
|
|
7
|
+
* so a healthy turn is always accompanied by assistant activity. A WEDGED
|
|
8
|
+
* session instead accepts the prompt (HTTP 204 from `prompt_async`), records the
|
|
9
|
+
* user message, and its agent loop exits IMMEDIATELY — no `message.updated`, no
|
|
10
|
+
* parts, no LLM call — so `session.idle` arrives with zero assistant activity
|
|
11
|
+
* and the topic looks silently hung.
|
|
12
|
+
*
|
|
13
|
+
* Live incident (2026-08-15, the my-news digest schedule): a bloated session
|
|
14
|
+
* (~648K tokens) accepted every scheduled/manual prompt but produced no output;
|
|
15
|
+
* three user messages piled up with no assistant reply and the topic looked
|
|
16
|
+
* dead with no explanation.
|
|
17
|
+
*
|
|
18
|
+
* Guards against false positives:
|
|
19
|
+
* - a context compaction cycle legitimately idles with no assistant text;
|
|
20
|
+
* - a still-pending provider-managed retry keeps the turn alive past this idle.
|
|
21
|
+
*/
|
|
22
|
+
export interface OpenCodeTurnActivityState {
|
|
23
|
+
/** A prompt was sent and this `session.idle` is the first one since it. */
|
|
24
|
+
awaitingResponse: boolean;
|
|
25
|
+
/** Any assistant message / part was observed for this turn (own or child). */
|
|
26
|
+
sawActivity: boolean;
|
|
27
|
+
/** A context compaction was in flight as the turn ended. */
|
|
28
|
+
wasCompacting: boolean;
|
|
29
|
+
/** A provider-managed retry was still pending as the turn ended. */
|
|
30
|
+
hadPendingProviderRetry: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @description `true` when a delivered prompt produced no turn at all — the
|
|
34
|
+
* caller should surface a notice instead of leaving the topic silently hung.
|
|
35
|
+
*/
|
|
36
|
+
export declare function checkIsWedgedTurn(state: OpenCodeTurnActivityState): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* @description State read when the bound on a post-provider-retry REPLACEMENT
|
|
39
|
+
* prompt's turn start elapses.
|
|
40
|
+
*
|
|
41
|
+
* `session.status` events carry no turn identifier, so after aborting a stale
|
|
42
|
+
* provider-managed retry the adapter marks a boundary and treats the next
|
|
43
|
+
* observed `busy` as the replacement turn's start. A WEDGED session accepts the
|
|
44
|
+
* replacement (HTTP 204) and never runs it, so that `busy` never arrives: the
|
|
45
|
+
* boundary would stay armed forever, swallowing every later idle, pinning the
|
|
46
|
+
* optimistic busy state, and leaving wedge detection disarmed — a permanently
|
|
47
|
+
* hung topic that nothing recovers.
|
|
48
|
+
*/
|
|
49
|
+
export interface OpenCodeReplacementTurnState {
|
|
50
|
+
/** The session is still live (not stopped / detached / replaced by a resume). */
|
|
51
|
+
isSessionActive: boolean;
|
|
52
|
+
/** The replacement boundary is still armed — no `busy` was ever observed. */
|
|
53
|
+
isAwaitingReplacementStart: boolean;
|
|
54
|
+
/** Any assistant activity was observed since the replacement prompt was sent. */
|
|
55
|
+
sawActivity: boolean;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @description `true` when the elapsed bound proves the replacement prompt never
|
|
59
|
+
* became a turn — the caller must end the abort episode and hand the thread to
|
|
60
|
+
* wedge recovery instead of waiting for a `busy` that will never come.
|
|
61
|
+
*
|
|
62
|
+
* Assistant activity releases the bound the same way {@link checkIsWedgedTurn}
|
|
63
|
+
* treats it: a turn that produced output genuinely started, even if its `busy`
|
|
64
|
+
* status was dropped, so reporting it would fire recovery on a working thread.
|
|
65
|
+
*/
|
|
66
|
+
export declare function checkIsReplacementTurnMissing(state: OpenCodeReplacementTurnState): boolean;
|
|
67
|
+
//# sourceMappingURL=openCodeTurnActivity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openCodeTurnActivity.d.ts","sourceRoot":"","sources":["../../src/utils/openCodeTurnActivity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,yBAAyB;IACxC,2EAA2E;IAC3E,gBAAgB,EAAE,OAAO,CAAC;IAC1B,8EAA8E;IAC9E,WAAW,EAAE,OAAO,CAAC;IACrB,4DAA4D;IAC5D,aAAa,EAAE,OAAO,CAAC;IACvB,oEAAoE;IACpE,uBAAuB,EAAE,OAAO,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAO3E;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,4BAA4B;IAC3C,iFAAiF;IACjF,eAAe,EAAE,OAAO,CAAC;IACzB,6EAA6E;IAC7E,0BAA0B,EAAE,OAAO,CAAC;IACpC,iFAAiF;IACjF,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,4BAA4B,GAAG,OAAO,CAE1F"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkIsWedgedTurn = checkIsWedgedTurn;
|
|
4
|
+
exports.checkIsReplacementTurnMissing = checkIsReplacementTurnMissing;
|
|
5
|
+
/**
|
|
6
|
+
* @description `true` when a delivered prompt produced no turn at all — the
|
|
7
|
+
* caller should surface a notice instead of leaving the topic silently hung.
|
|
8
|
+
*/
|
|
9
|
+
function checkIsWedgedTurn(state) {
|
|
10
|
+
return (state.awaitingResponse &&
|
|
11
|
+
!state.sawActivity &&
|
|
12
|
+
!state.wasCompacting &&
|
|
13
|
+
!state.hadPendingProviderRetry);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @description `true` when the elapsed bound proves the replacement prompt never
|
|
17
|
+
* became a turn — the caller must end the abort episode and hand the thread to
|
|
18
|
+
* wedge recovery instead of waiting for a `busy` that will never come.
|
|
19
|
+
*
|
|
20
|
+
* Assistant activity releases the bound the same way {@link checkIsWedgedTurn}
|
|
21
|
+
* treats it: a turn that produced output genuinely started, even if its `busy`
|
|
22
|
+
* status was dropped, so reporting it would fire recovery on a working thread.
|
|
23
|
+
*/
|
|
24
|
+
function checkIsReplacementTurnMissing(state) {
|
|
25
|
+
return state.isSessionActive && state.isAwaitingReplacementStart && !state.sawActivity;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=openCodeTurnActivity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openCodeTurnActivity.js","sourceRoot":"","sources":["../../src/utils/openCodeTurnActivity.ts"],"names":[],"mappings":";;AAoCA,8CAOC;AAgCD,sEAEC;AA7CD;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,KAAgC;IAChE,OAAO,CACL,KAAK,CAAC,gBAAgB;QACtB,CAAC,KAAK,CAAC,WAAW;QAClB,CAAC,KAAK,CAAC,aAAa;QACpB,CAAC,KAAK,CAAC,uBAAuB,CAC/B,CAAC;AACJ,CAAC;AAuBD;;;;;;;;GAQG;AACH,SAAgB,6BAA6B,CAAC,KAAmC;IAC/E,OAAO,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,0BAA0B,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;AACzF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description The output-debounce constant, extracted as a pure helper so the
|
|
3
|
+
* value is unit-testable WITHOUT booting Telegraf.
|
|
4
|
+
*
|
|
5
|
+
* DM v2: the persist/`queueOutput` path runs in GROUP mode ONLY — DM streams its
|
|
6
|
+
* reply through the native-draft cursor (`bot.ts` draft manager) and finalizes
|
|
7
|
+
* at explicit boundaries, so it never debounces here. There is therefore one
|
|
8
|
+
* window left: the original group cadence. The function keeps a thin accessor
|
|
9
|
+
* shape so the regression test can assert the exact value against the same
|
|
10
|
+
* source `bot.ts` uses — no drift.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Group-mode debounce (S2). Raised 1s → 3s so each topic coalesces its own
|
|
14
|
+
* stream to at most ~1 update / 3s: fewer, larger edits that compose with the
|
|
15
|
+
* global 1/2s send pacer instead of a trickle of tiny sends.
|
|
16
|
+
*/
|
|
17
|
+
export declare const OUTPUT_DEBOUNCE_MS = 3000;
|
|
18
|
+
/**
|
|
19
|
+
* @description The output debounce window. Group-only now (DM finalizes the
|
|
20
|
+
* draft at boundaries instead of debouncing the persist), so there is a single
|
|
21
|
+
* value — the original group cadence.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getOutputDebounceMs(): number;
|
|
24
|
+
//# sourceMappingURL=outputDebounce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputDebounce.d.ts","sourceRoot":"","sources":["../../src/utils/outputDebounce.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description The output-debounce constant, extracted as a pure helper so the
|
|
4
|
+
* value is unit-testable WITHOUT booting Telegraf.
|
|
5
|
+
*
|
|
6
|
+
* DM v2: the persist/`queueOutput` path runs in GROUP mode ONLY — DM streams its
|
|
7
|
+
* reply through the native-draft cursor (`bot.ts` draft manager) and finalizes
|
|
8
|
+
* at explicit boundaries, so it never debounces here. There is therefore one
|
|
9
|
+
* window left: the original group cadence. The function keeps a thin accessor
|
|
10
|
+
* shape so the regression test can assert the exact value against the same
|
|
11
|
+
* source `bot.ts` uses — no drift.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.OUTPUT_DEBOUNCE_MS = void 0;
|
|
15
|
+
exports.getOutputDebounceMs = getOutputDebounceMs;
|
|
16
|
+
/**
|
|
17
|
+
* Group-mode debounce (S2). Raised 1s → 3s so each topic coalesces its own
|
|
18
|
+
* stream to at most ~1 update / 3s: fewer, larger edits that compose with the
|
|
19
|
+
* global 1/2s send pacer instead of a trickle of tiny sends.
|
|
20
|
+
*/
|
|
21
|
+
exports.OUTPUT_DEBOUNCE_MS = 3000;
|
|
22
|
+
/**
|
|
23
|
+
* @description The output debounce window. Group-only now (DM finalizes the
|
|
24
|
+
* draft at boundaries instead of debouncing the persist), so there is a single
|
|
25
|
+
* value — the original group cadence.
|
|
26
|
+
*/
|
|
27
|
+
function getOutputDebounceMs() {
|
|
28
|
+
return exports.OUTPUT_DEBOUNCE_MS;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=outputDebounce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputDebounce.js","sourceRoot":"","sources":["../../src/utils/outputDebounce.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAcH,kDAEC;AAdD;;;;GAIG;AACU,QAAA,kBAAkB,GAAG,IAAI,CAAC;AAEvC;;;;GAIG;AACH,SAAgB,mBAAmB;IACjC,OAAO,0BAAkB,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Pure decision for WHEN the per-thread output queue should flush
|
|
3
|
+
* a freshly-queued frame.
|
|
4
|
+
*
|
|
5
|
+
* Extracted from `bot.ts`'s `getOutputDelay` so the timing rule is
|
|
6
|
+
* unit-testable without the Telegraf / queue machinery (same pattern as
|
|
7
|
+
* {@link ../utils/statusFlushDecision.ts}). It governs only flush TIMING — the
|
|
8
|
+
* append/continuation semantics of the buffer are decided elsewhere.
|
|
9
|
+
*
|
|
10
|
+
* Three cases:
|
|
11
|
+
* - `isFinal` (the turn's last frame, emitted as the session goes idle) →
|
|
12
|
+
* `'now'`: flush immediately, regardless of a 429 cooldown. A turn that just
|
|
13
|
+
* ended must not look hung while its closing message sits out the stretched
|
|
14
|
+
* debounce.
|
|
15
|
+
* - non-final + rate-limited → the stretched debounce, ADAPTIVELY scaled to the
|
|
16
|
+
* live remaining cooldown (S3): while throttled, batch the whole cooldown into
|
|
17
|
+
* one larger edit instead of a flat 5s, so a long 429 produces fewer, larger
|
|
18
|
+
* API calls rather than a backlog of tiny ones. A short cooldown still gets at
|
|
19
|
+
* least the 5s floor.
|
|
20
|
+
* - non-final + normal → the normal debounce.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Stretched debounce FLOOR used while the chat is inside a Telegram 429 cooldown,
|
|
24
|
+
* so coalesced output is sent in larger, less-frequent batches instead of
|
|
25
|
+
* hammering an already-throttling API. The actual in-cooldown debounce scales UP
|
|
26
|
+
* to the live remaining cooldown when that is longer (S3).
|
|
27
|
+
*/
|
|
28
|
+
export declare const rateLimitedOutputDebounceMs = 5000;
|
|
29
|
+
/** A flush that should fire immediately, bypassing the debounce. */
|
|
30
|
+
export type ImmediateFlush = 'now';
|
|
31
|
+
export interface OutputFlushTimingInput {
|
|
32
|
+
/** Is this the turn's final frame (emitted as the session goes idle)? */
|
|
33
|
+
isFinal: boolean;
|
|
34
|
+
/** Is the chat currently inside a Telegram 429 cooldown? */
|
|
35
|
+
isRateLimited: boolean;
|
|
36
|
+
/** The thread's normal debounce window, in ms. */
|
|
37
|
+
normalDebounceMs: number;
|
|
38
|
+
/**
|
|
39
|
+
* Live remaining 429 cooldown for the chat, in ms (0 / omitted when not
|
|
40
|
+
* limited). While rate-limited, the debounce scales to this so the flush
|
|
41
|
+
* batches the whole cooldown into one larger edit (S3) — fewer, bigger edits
|
|
42
|
+
* under a long 429. Ignored when not rate-limited.
|
|
43
|
+
*/
|
|
44
|
+
remainingCooldownMs?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @description Decide the flush timing for a queued output frame: either flush
|
|
48
|
+
* `'now'` (final frame) or after a debounce delay in ms. While rate-limited the
|
|
49
|
+
* delay is the LONGEST of the normal debounce, the 5s floor, and the live
|
|
50
|
+
* remaining cooldown — so a long cooldown coalesces into a single larger edit
|
|
51
|
+
* rather than a backlog of tiny ones (S3).
|
|
52
|
+
*/
|
|
53
|
+
export declare function getOutputFlushTiming(input: OutputFlushTimingInput): ImmediateFlush | number;
|
|
54
|
+
//# sourceMappingURL=outputFlushTiming.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputFlushTiming.d.ts","sourceRoot":"","sources":["../../src/utils/outputFlushTiming.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAEhD,oEAAoE;AACpE,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC;AAEnC,MAAM,WAAW,sBAAsB;IACrC,yEAAyE;IACzE,OAAO,EAAE,OAAO,CAAC;IACjB,4DAA4D;IAC5D,aAAa,EAAE,OAAO,CAAC;IACvB,kDAAkD;IAClD,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,sBAAsB,GAAG,cAAc,GAAG,MAAM,CAU3F"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description Pure decision for WHEN the per-thread output queue should flush
|
|
4
|
+
* a freshly-queued frame.
|
|
5
|
+
*
|
|
6
|
+
* Extracted from `bot.ts`'s `getOutputDelay` so the timing rule is
|
|
7
|
+
* unit-testable without the Telegraf / queue machinery (same pattern as
|
|
8
|
+
* {@link ../utils/statusFlushDecision.ts}). It governs only flush TIMING — the
|
|
9
|
+
* append/continuation semantics of the buffer are decided elsewhere.
|
|
10
|
+
*
|
|
11
|
+
* Three cases:
|
|
12
|
+
* - `isFinal` (the turn's last frame, emitted as the session goes idle) →
|
|
13
|
+
* `'now'`: flush immediately, regardless of a 429 cooldown. A turn that just
|
|
14
|
+
* ended must not look hung while its closing message sits out the stretched
|
|
15
|
+
* debounce.
|
|
16
|
+
* - non-final + rate-limited → the stretched debounce, ADAPTIVELY scaled to the
|
|
17
|
+
* live remaining cooldown (S3): while throttled, batch the whole cooldown into
|
|
18
|
+
* one larger edit instead of a flat 5s, so a long 429 produces fewer, larger
|
|
19
|
+
* API calls rather than a backlog of tiny ones. A short cooldown still gets at
|
|
20
|
+
* least the 5s floor.
|
|
21
|
+
* - non-final + normal → the normal debounce.
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.rateLimitedOutputDebounceMs = void 0;
|
|
25
|
+
exports.getOutputFlushTiming = getOutputFlushTiming;
|
|
26
|
+
/**
|
|
27
|
+
* Stretched debounce FLOOR used while the chat is inside a Telegram 429 cooldown,
|
|
28
|
+
* so coalesced output is sent in larger, less-frequent batches instead of
|
|
29
|
+
* hammering an already-throttling API. The actual in-cooldown debounce scales UP
|
|
30
|
+
* to the live remaining cooldown when that is longer (S3).
|
|
31
|
+
*/
|
|
32
|
+
exports.rateLimitedOutputDebounceMs = 5000;
|
|
33
|
+
/**
|
|
34
|
+
* @description Decide the flush timing for a queued output frame: either flush
|
|
35
|
+
* `'now'` (final frame) or after a debounce delay in ms. While rate-limited the
|
|
36
|
+
* delay is the LONGEST of the normal debounce, the 5s floor, and the live
|
|
37
|
+
* remaining cooldown — so a long cooldown coalesces into a single larger edit
|
|
38
|
+
* rather than a backlog of tiny ones (S3).
|
|
39
|
+
*/
|
|
40
|
+
function getOutputFlushTiming(input) {
|
|
41
|
+
if (input.isFinal)
|
|
42
|
+
return 'now';
|
|
43
|
+
if (input.isRateLimited) {
|
|
44
|
+
return Math.max(input.normalDebounceMs, exports.rateLimitedOutputDebounceMs, input.remainingCooldownMs ?? 0);
|
|
45
|
+
}
|
|
46
|
+
return input.normalDebounceMs;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=outputFlushTiming.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputFlushTiming.js","sourceRoot":"","sources":["../../src/utils/outputFlushTiming.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAoCH,oDAUC;AA5CD;;;;;GAKG;AACU,QAAA,2BAA2B,GAAG,IAAI,CAAC;AAqBhD;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,KAA6B;IAChE,IAAI,KAAK,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAChC,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,GAAG,CACb,KAAK,CAAC,gBAAgB,EACtB,mCAA2B,EAC3B,KAAK,CAAC,mBAAmB,IAAI,CAAC,CAC/B,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,gBAAgB,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Generic pagination math shared by every inline-keyboard picker
|
|
3
|
+
* (`/bind` folders, `/model` models). Extracted from `paginateBindList` so the
|
|
4
|
+
* slice/clamp rules live in ONE place — a second picker must not re-derive
|
|
5
|
+
* them and drift (e.g. clamp a stale page to an empty slice instead of the
|
|
6
|
+
* last page).
|
|
7
|
+
*/
|
|
8
|
+
export interface PaginatedSlice<T> {
|
|
9
|
+
/** Entries visible on the resolved page. */
|
|
10
|
+
slice: T[];
|
|
11
|
+
/** `page` clamped to `[0, totalPages-1]` and floored to an integer. */
|
|
12
|
+
currentPage: number;
|
|
13
|
+
/** Total number of pages, ≥ 1 even for an empty list. */
|
|
14
|
+
totalPages: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @description Slice `items` into the page the caller asked for.
|
|
18
|
+
*
|
|
19
|
+
* `pageSize` must be a positive integer. Out-of-range `page` values are clamped
|
|
20
|
+
* silently rather than throwing — a stale callback (the underlying list shrank
|
|
21
|
+
* between rendering the keyboard and the tap) must land on the last available
|
|
22
|
+
* page, not blow up or render an empty body.
|
|
23
|
+
*/
|
|
24
|
+
export declare function paginateList<T>(items: readonly T[], page: number, pageSize: number): PaginatedSlice<T>;
|
|
25
|
+
//# sourceMappingURL=paginateList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paginateList.d.ts","sourceRoot":"","sources":["../../src/utils/paginateList.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,4CAA4C;IAC5C,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,cAAc,CAAC,CAAC,CAAC,CAYnB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description Generic pagination math shared by every inline-keyboard picker
|
|
4
|
+
* (`/bind` folders, `/model` models). Extracted from `paginateBindList` so the
|
|
5
|
+
* slice/clamp rules live in ONE place — a second picker must not re-derive
|
|
6
|
+
* them and drift (e.g. clamp a stale page to an empty slice instead of the
|
|
7
|
+
* last page).
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.paginateList = paginateList;
|
|
11
|
+
/**
|
|
12
|
+
* @description Slice `items` into the page the caller asked for.
|
|
13
|
+
*
|
|
14
|
+
* `pageSize` must be a positive integer. Out-of-range `page` values are clamped
|
|
15
|
+
* silently rather than throwing — a stale callback (the underlying list shrank
|
|
16
|
+
* between rendering the keyboard and the tap) must land on the last available
|
|
17
|
+
* page, not blow up or render an empty body.
|
|
18
|
+
*/
|
|
19
|
+
function paginateList(items, page, pageSize) {
|
|
20
|
+
if (!Number.isInteger(pageSize) || pageSize <= 0) {
|
|
21
|
+
throw new Error(`paginateList: pageSize must be a positive integer, got ${pageSize}`);
|
|
22
|
+
}
|
|
23
|
+
const totalPages = Math.max(1, Math.ceil(items.length / pageSize));
|
|
24
|
+
const clampedPage = Math.max(0, Math.min(Math.floor(page) || 0, totalPages - 1));
|
|
25
|
+
const start = clampedPage * pageSize;
|
|
26
|
+
return {
|
|
27
|
+
slice: items.slice(start, start + pageSize),
|
|
28
|
+
currentPage: clampedPage,
|
|
29
|
+
totalPages,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=paginateList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paginateList.js","sourceRoot":"","sources":["../../src/utils/paginateList.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAmBH,oCAgBC;AAxBD;;;;;;;GAOG;AACH,SAAgB,YAAY,CAC1B,KAAmB,EACnB,IAAY,EACZ,QAAgB;IAEhB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,QAAQ,IAAI,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,KAAK,CAAC,0DAA0D,QAAQ,EAAE,CAAC,CAAC;IACxF,CAAC;IACD,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC;IACnE,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;IACjF,MAAM,KAAK,GAAG,WAAW,GAAG,QAAQ,CAAC;IACrC,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,QAAQ,CAAC;QAC3C,WAAW,EAAE,WAAW;QACxB,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Result of {@link getNewPaneContent}: the diffed NEW pane text
|
|
3
|
+
* plus an OUT-OF-BAND signal that the chunk's first new line was preceded by a
|
|
4
|
+
* paragraph break in the pane. The break is reported separately (not as a
|
|
5
|
+
* leading blank in `text`) because every downstream `.trim()` would strip a
|
|
6
|
+
* leading blank, and a fresh Telegram message must never start blank anyway —
|
|
7
|
+
* so the JOIN layer reconstructs the separator from this flag instead.
|
|
8
|
+
*/
|
|
9
|
+
export interface NewPaneContent {
|
|
10
|
+
/** The new pane lines, leading/trailing blanks trimmed (interior blanks kept). */
|
|
11
|
+
text: string;
|
|
12
|
+
/**
|
|
13
|
+
* True IFF a blank line immediately preceded the chunk's first new line AND
|
|
14
|
+
* there was content above that blank (so it is a real inter-paragraph break,
|
|
15
|
+
* not pane-top padding). Consumed only at the append JOIN, never at a message
|
|
16
|
+
* start. See {@link OutboundHints.startsNewParagraph}.
|
|
17
|
+
*/
|
|
18
|
+
startsNewParagraph: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @description Diff a freshly-captured pane against the last one and return
|
|
22
|
+
* only the NEW lines, as a line-SET difference (positions ignored — Claude's
|
|
23
|
+
* TUI redraws the whole pane every poll, so a positional diff would re-emit
|
|
24
|
+
* everything that scrolled).
|
|
25
|
+
*
|
|
26
|
+
* Blank lines are NOT part of the matched set (they aren't unique), but a
|
|
27
|
+
* single blank that sat BETWEEN two runs of new content is preserved as a
|
|
28
|
+
* paragraph separator: the previous implementation `continue`d past every
|
|
29
|
+
* empty line, so multi-paragraph answers arrived in Telegram with every
|
|
30
|
+
* paragraph glued to the next (the `cleanOutput` C1 fix only kept blanks in
|
|
31
|
+
* the FULL pane; this delta path still dropped them). An INTERIOR blank (within
|
|
32
|
+
* this chunk) is kept inline in `text`; a LEADING blank (before the chunk's
|
|
33
|
+
* first new line) is instead reported via `startsNewParagraph` so the separator
|
|
34
|
+
* survives the pipeline's trims and is rebuilt only at the append join.
|
|
35
|
+
*
|
|
36
|
+
* Suppression is by SET membership, not multiset count (B10): a line that
|
|
37
|
+
* appeared in `oldContent` at all is suppressed for EVERY occurrence in
|
|
38
|
+
* `newContent`, not just the first `oldCount` of them. Why: typing a draft
|
|
39
|
+
* that wraps to several rows grows Claude's input box; the viewport is fixed
|
|
40
|
+
* height, so the transcript scrolls and tmux re-renders the lines straddling
|
|
41
|
+
* the scrollback↔visible boundary twice in one capture. The old multiset diff
|
|
42
|
+
* suppressed only as many copies as `oldContent` held, so the extra copy of an
|
|
43
|
+
* already-sent answer line counted as new and was re-emitted (a chunk of the
|
|
44
|
+
* previous answer reappeared before the next turn). Set membership errs toward
|
|
45
|
+
* DROPPING such a re-render duplicate — the locked tradeoff, since a re-send is
|
|
46
|
+
* the user-visible bug while a genuinely-new line that merely repeats an
|
|
47
|
+
* earlier transcript line is a rare, low-cost loss. (Note: `lastContent`
|
|
48
|
+
* advances to the full pane on every change in `pollOutput`, NOT only on emit,
|
|
49
|
+
* so a suppressed line does NOT self-heal next poll — hence we suppress only
|
|
50
|
+
* lines that were truly already present.)
|
|
51
|
+
*
|
|
52
|
+
* Exported + pure so the diff is unit-testable without booting tmux.
|
|
53
|
+
*/
|
|
54
|
+
export declare function getNewPaneContent(oldContent: string, newContent: string): NewPaneContent;
|
|
55
|
+
//# sourceMappingURL=paneDiff.d.ts.map
|