charness 4.1.1 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +186 -2
- package/DEVELOPMENT.md +65 -11
- package/LICENSE +331 -151
- package/MIGRATION_3_TO_4.md +8 -5
- package/README.md +23 -8
- package/SETUP.md +57 -11
- package/agent-plugin/README.md +10 -3
- package/agent-plugin/skills/charness-delegate-claude/SKILL.md +18 -26
- package/agent-plugin/skills/charness-delegate-opencode/SKILL.md +5 -3
- package/agent-plugin/skills/charness-orchestration/SKILL.md +57 -16
- package/dist/adapters/adapterNames.d.ts +2 -0
- package/dist/adapters/adapterNames.d.ts.map +1 -1
- package/dist/adapters/adapterNames.js +3 -1
- package/dist/adapters/adapterNames.js.map +1 -1
- package/dist/adapters/claudeCliAdapter.d.ts +4 -0
- package/dist/adapters/claudeCliAdapter.d.ts.map +1 -1
- package/dist/adapters/claudeCliAdapter.js +13 -0
- package/dist/adapters/claudeCliAdapter.js.map +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.d.ts +150 -10
- package/dist/adapters/claudeJsonStreamAdapter.d.ts.map +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.js +401 -83
- package/dist/adapters/claudeJsonStreamAdapter.js.map +1 -1
- package/dist/adapters/createAdapter.d.ts +12 -3
- package/dist/adapters/createAdapter.d.ts.map +1 -1
- package/dist/adapters/createAdapter.js +39 -13
- package/dist/adapters/createAdapter.js.map +1 -1
- package/dist/adapters/openCodeAdapter.d.ts +65 -2
- package/dist/adapters/openCodeAdapter.d.ts.map +1 -1
- package/dist/adapters/openCodeAdapter.js +202 -19
- package/dist/adapters/openCodeAdapter.js.map +1 -1
- package/dist/adapters/terminalAdapter.d.ts.map +1 -1
- package/dist/adapters/terminalAdapter.js +2 -1
- package/dist/adapters/terminalAdapter.js.map +1 -1
- package/dist/apiErrorRetry.d.ts +11 -3
- package/dist/apiErrorRetry.d.ts.map +1 -1
- package/dist/apiErrorRetry.js +33 -3
- package/dist/apiErrorRetry.js.map +1 -1
- package/dist/apiRetryKick.d.ts +3 -2
- package/dist/apiRetryKick.d.ts.map +1 -1
- package/dist/apiRetryKick.js +13 -5
- package/dist/apiRetryKick.js.map +1 -1
- package/dist/bot.d.ts +2 -6
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +2586 -693
- package/dist/bot.js.map +1 -1
- package/dist/cli/claudeProfiles.d.ts +31 -6
- package/dist/cli/claudeProfiles.d.ts.map +1 -1
- package/dist/cli/claudeProfiles.js +97 -22
- package/dist/cli/claudeProfiles.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/connectors/jira/answerSink.d.ts +102 -7
- package/dist/connectors/jira/answerSink.d.ts.map +1 -1
- package/dist/connectors/jira/answerSink.js +364 -60
- package/dist/connectors/jira/answerSink.js.map +1 -1
- package/dist/connectors/jira/answerThreads.d.ts +44 -0
- package/dist/connectors/jira/answerThreads.d.ts.map +1 -0
- package/dist/connectors/jira/answerThreads.js +85 -0
- package/dist/connectors/jira/answerThreads.js.map +1 -0
- package/dist/connectors/jira/client.d.ts +67 -2
- package/dist/connectors/jira/client.d.ts.map +1 -1
- package/dist/connectors/jira/client.js +176 -4
- package/dist/connectors/jira/client.js.map +1 -1
- package/dist/connectors/jira/config.d.ts +6 -0
- package/dist/connectors/jira/config.d.ts.map +1 -1
- package/dist/connectors/jira/config.js +14 -1
- package/dist/connectors/jira/config.js.map +1 -1
- package/dist/connectors/jira/connector.d.ts +19 -0
- package/dist/connectors/jira/connector.d.ts.map +1 -1
- package/dist/connectors/jira/connector.js +68 -6
- package/dist/connectors/jira/connector.js.map +1 -1
- package/dist/connectors/jira/contextPreamble.d.ts.map +1 -1
- package/dist/connectors/jira/contextPreamble.js +6 -1
- package/dist/connectors/jira/contextPreamble.js.map +1 -1
- package/dist/connectors/jira/inbound.d.ts +21 -6
- package/dist/connectors/jira/inbound.d.ts.map +1 -1
- package/dist/connectors/jira/inbound.js +22 -16
- package/dist/connectors/jira/inbound.js.map +1 -1
- package/dist/connectors/jira/issueBlocks.d.ts +8 -1
- package/dist/connectors/jira/issueBlocks.d.ts.map +1 -1
- package/dist/connectors/jira/issueBlocks.js +38 -2
- package/dist/connectors/jira/issueBlocks.js.map +1 -1
- package/dist/connectors/jira/operatorIssue.d.ts +28 -0
- package/dist/connectors/jira/operatorIssue.d.ts.map +1 -0
- package/dist/connectors/jira/operatorIssue.js +81 -0
- package/dist/connectors/jira/operatorIssue.js.map +1 -0
- package/dist/connectors/jira/outbound.d.ts +8 -4
- package/dist/connectors/jira/outbound.d.ts.map +1 -1
- package/dist/connectors/jira/outbound.js +16 -8
- package/dist/connectors/jira/outbound.js.map +1 -1
- package/dist/connectors/jira/outgoingFileCheck.d.ts +37 -0
- package/dist/connectors/jira/outgoingFileCheck.d.ts.map +1 -0
- package/dist/connectors/jira/outgoingFileCheck.js +279 -0
- package/dist/connectors/jira/outgoingFileCheck.js.map +1 -0
- package/dist/connectors/jira/outgoingFiles.d.ts +81 -0
- package/dist/connectors/jira/outgoingFiles.d.ts.map +1 -0
- package/dist/connectors/jira/outgoingFiles.js +268 -0
- package/dist/connectors/jira/outgoingFiles.js.map +1 -0
- package/dist/connectors/jira/progressComments.d.ts +69 -0
- package/dist/connectors/jira/progressComments.d.ts.map +1 -0
- package/dist/connectors/jira/progressComments.js +136 -0
- package/dist/connectors/jira/progressComments.js.map +1 -0
- package/dist/connectors/jira/prompt.d.ts +5 -1
- package/dist/connectors/jira/prompt.d.ts.map +1 -1
- package/dist/connectors/jira/prompt.js +23 -3
- package/dist/connectors/jira/prompt.js.map +1 -1
- package/dist/connectors/jira/promptSpill.js +1 -1
- package/dist/connectors/jira/promptSpill.js.map +1 -1
- package/dist/connectors/jira/trigger.d.ts +13 -5
- package/dist/connectors/jira/trigger.d.ts.map +1 -1
- package/dist/connectors/jira/trigger.js +13 -7
- package/dist/connectors/jira/trigger.js.map +1 -1
- package/dist/connectors/jira/uploadedFiles.d.ts +48 -0
- package/dist/connectors/jira/uploadedFiles.d.ts.map +1 -0
- package/dist/connectors/jira/uploadedFiles.js +123 -0
- package/dist/connectors/jira/uploadedFiles.js.map +1 -0
- package/dist/connectors/telegram/commands/backendSwitch.d.ts +9 -1
- package/dist/connectors/telegram/commands/backendSwitch.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/backendSwitch.js +17 -8
- package/dist/connectors/telegram/commands/backendSwitch.js.map +1 -1
- package/dist/connectors/telegram/commands/botCore.d.ts +5 -2
- package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/botSkills.d.ts +2 -0
- package/dist/connectors/telegram/commands/botSkills.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/botSkills.js +17 -2
- package/dist/connectors/telegram/commands/botSkills.js.map +1 -1
- package/dist/connectors/telegram/commands/claudeAccounts.d.ts +11 -0
- package/dist/connectors/telegram/commands/claudeAccounts.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/claudeAccounts.js +36 -42
- package/dist/connectors/telegram/commands/claudeAccounts.js.map +1 -1
- package/dist/connectors/telegram/commands/compaction.d.ts +20 -3
- package/dist/connectors/telegram/commands/compaction.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/compaction.js +268 -96
- package/dist/connectors/telegram/commands/compaction.js.map +1 -1
- package/dist/connectors/telegram/commands/limitReminders.d.ts +21 -0
- package/dist/connectors/telegram/commands/limitReminders.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/limitReminders.js +95 -0
- package/dist/connectors/telegram/commands/limitReminders.js.map +1 -0
- package/dist/connectors/telegram/commands/limitsBoard.d.ts +4 -0
- package/dist/connectors/telegram/commands/limitsBoard.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/limitsBoard.js +27 -6
- package/dist/connectors/telegram/commands/limitsBoard.js.map +1 -1
- package/dist/connectors/telegram/commands/modelProviders.d.ts +2 -2
- package/dist/connectors/telegram/commands/modelProviders.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/modelProviders.js +27 -16
- package/dist/connectors/telegram/commands/modelProviders.js.map +1 -1
- package/dist/connectors/telegram/commands/questionSetAside.d.ts +111 -0
- package/dist/connectors/telegram/commands/questionSetAside.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/questionSetAside.js +637 -0
- package/dist/connectors/telegram/commands/questionSetAside.js.map +1 -0
- package/dist/connectors/telegram/commands/questionWait.d.ts +21 -0
- package/dist/connectors/telegram/commands/questionWait.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/questionWait.js +109 -0
- package/dist/connectors/telegram/commands/questionWait.js.map +1 -0
- package/dist/connectors/telegram/commands/topicAccess.js +1 -1
- package/dist/connectors/telegram/commands/topicAccess.js.map +1 -1
- package/dist/connectors/telegram/commands/topicCommand.d.ts +0 -2
- package/dist/connectors/telegram/commands/topicCommand.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/topicCommand.js +11 -7
- package/dist/connectors/telegram/commands/topicCommand.js.map +1 -1
- package/dist/connectors/telegram/commands/topicStatus.d.ts +24 -0
- package/dist/connectors/telegram/commands/topicStatus.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/topicStatus.js +148 -0
- package/dist/connectors/telegram/commands/topicStatus.js.map +1 -0
- package/dist/connectors/telegram/commands/workerRoles.d.ts +25 -0
- package/dist/connectors/telegram/commands/workerRoles.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/workerRoles.js +259 -0
- package/dist/connectors/telegram/commands/workerRoles.js.map +1 -0
- package/dist/connectors/telegram/firstUpdateBatchNote.d.ts +30 -0
- package/dist/connectors/telegram/firstUpdateBatchNote.d.ts.map +1 -0
- package/dist/connectors/telegram/firstUpdateBatchNote.js +39 -0
- package/dist/connectors/telegram/firstUpdateBatchNote.js.map +1 -0
- package/dist/connectors/telegram/groupWelcome.d.ts +12 -0
- package/dist/connectors/telegram/groupWelcome.d.ts.map +1 -0
- package/dist/connectors/telegram/groupWelcome.js +12 -0
- package/dist/connectors/telegram/groupWelcome.js.map +1 -0
- package/dist/connectors/telegram/inbound.d.ts +19 -0
- package/dist/connectors/telegram/inbound.d.ts.map +1 -1
- package/dist/connectors/telegram/inbound.js +41 -3
- package/dist/connectors/telegram/inbound.js.map +1 -1
- package/dist/connectors/telegram/outputFlushPlan.d.ts +12 -0
- package/dist/connectors/telegram/outputFlushPlan.d.ts.map +1 -1
- package/dist/connectors/telegram/outputFlushPlan.js +12 -0
- package/dist/connectors/telegram/outputFlushPlan.js.map +1 -1
- package/dist/connectors/telegram/runnerPairingMessages.d.ts +1 -1
- package/dist/connectors/telegram/topicIndicator.d.ts +86 -0
- package/dist/connectors/telegram/topicIndicator.d.ts.map +1 -0
- package/dist/connectors/telegram/topicIndicator.js +588 -0
- package/dist/connectors/telegram/topicIndicator.js.map +1 -0
- package/dist/connectors/telegram/waitingTopicRenames.d.ts +39 -0
- package/dist/connectors/telegram/waitingTopicRenames.d.ts.map +1 -0
- package/dist/connectors/telegram/waitingTopicRenames.js +48 -0
- package/dist/connectors/telegram/waitingTopicRenames.js.map +1 -0
- package/dist/effortLevels.d.ts +6 -0
- package/dist/effortLevels.d.ts.map +1 -1
- package/dist/effortLevels.js +6 -1
- package/dist/effortLevels.js.map +1 -1
- package/dist/i18n/de.d.ts.map +1 -1
- package/dist/i18n/de.js +141 -13
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +141 -13
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +141 -13
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +141 -13
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/hi.d.ts.map +1 -1
- package/dist/i18n/hi.js +141 -13
- package/dist/i18n/hi.js.map +1 -1
- package/dist/i18n/ja.d.ts.map +1 -1
- package/dist/i18n/ja.js +141 -13
- package/dist/i18n/ja.js.map +1 -1
- package/dist/i18n/ka.d.ts.map +1 -1
- package/dist/i18n/ka.js +141 -13
- package/dist/i18n/ka.js.map +1 -1
- package/dist/i18n/pt.d.ts.map +1 -1
- package/dist/i18n/pt.js +141 -13
- package/dist/i18n/pt.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +141 -13
- package/dist/i18n/ru.js.map +1 -1
- package/dist/i18n/uk.d.ts.map +1 -1
- package/dist/i18n/uk.js +141 -13
- package/dist/i18n/uk.js.map +1 -1
- package/dist/i18n/uz.d.ts.map +1 -1
- package/dist/i18n/uz.js +141 -13
- package/dist/i18n/uz.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +141 -13
- package/dist/i18n/zh.js.map +1 -1
- package/dist/instanceSettings.d.ts +43 -3
- package/dist/instanceSettings.d.ts.map +1 -1
- package/dist/instanceSettings.js +109 -4
- package/dist/instanceSettings.js.map +1 -1
- package/dist/limitNotes/engine.d.ts +47 -0
- package/dist/limitNotes/engine.d.ts.map +1 -0
- package/dist/limitNotes/engine.js +98 -0
- package/dist/limitNotes/engine.js.map +1 -0
- package/dist/limitNotes/noteText.d.ts +33 -0
- package/dist/limitNotes/noteText.d.ts.map +1 -0
- package/dist/limitNotes/noteText.js +55 -0
- package/dist/limitNotes/noteText.js.map +1 -0
- package/dist/limitNotes/plan.d.ts +147 -0
- package/dist/limitNotes/plan.d.ts.map +1 -0
- package/dist/limitNotes/plan.js +323 -0
- package/dist/limitNotes/plan.js.map +1 -0
- package/dist/limitNotes/reminderChoices.d.ts +30 -0
- package/dist/limitNotes/reminderChoices.d.ts.map +1 -0
- package/dist/limitNotes/reminderChoices.js +48 -0
- package/dist/limitNotes/reminderChoices.js.map +1 -0
- package/dist/limitNotes/service.d.ts +106 -0
- package/dist/limitNotes/service.d.ts.map +1 -0
- package/dist/limitNotes/service.js +169 -0
- package/dist/limitNotes/service.js.map +1 -0
- package/dist/openCodeOpenQuestion.d.ts +12 -4
- package/dist/openCodeOpenQuestion.d.ts.map +1 -1
- package/dist/openCodeOpenQuestion.js +16 -7
- package/dist/openCodeOpenQuestion.js.map +1 -1
- package/dist/openCodeQuestionFlow.d.ts +10 -2
- package/dist/openCodeQuestionFlow.d.ts.map +1 -1
- package/dist/openCodeQuestionFlow.js +27 -5
- package/dist/openCodeQuestionFlow.js.map +1 -1
- package/dist/openCodeSessionTitle.js +1 -1
- package/dist/openCodeSessionTitle.js.map +1 -1
- package/dist/outputTrace.d.ts +19 -0
- package/dist/outputTrace.d.ts.map +1 -1
- package/dist/outputTrace.js +23 -2
- package/dist/outputTrace.js.map +1 -1
- package/dist/platform/answerSink.d.ts +23 -0
- package/dist/platform/answerSink.d.ts.map +1 -1
- package/dist/platform/answerSink.js.map +1 -1
- package/dist/platform/operatorAlert.d.ts +24 -0
- package/dist/platform/operatorAlert.d.ts.map +1 -0
- package/dist/platform/operatorAlert.js +9 -0
- package/dist/platform/operatorAlert.js.map +1 -0
- package/dist/postToSession.d.ts +43 -2
- package/dist/postToSession.d.ts.map +1 -1
- package/dist/postToSession.js +46 -4
- package/dist/postToSession.js.map +1 -1
- package/dist/remoteRun/exitCodes.d.ts +2 -2
- package/dist/remoteRun/exitCodes.d.ts.map +1 -1
- package/dist/remoteRun/exitCodes.js +2 -2
- package/dist/remoteRun/exitCodes.js.map +1 -1
- package/dist/remoteRun/foreground.d.ts.map +1 -1
- package/dist/remoteRun/foreground.js +5 -1
- package/dist/remoteRun/foreground.js.map +1 -1
- package/dist/remoteRun/runnerClient.d.ts +1 -1
- package/dist/remoteRun/runnerClient.d.ts.map +1 -1
- package/dist/remoteRun/runnerClient.js +3 -3
- package/dist/remoteRun/runnerClient.js.map +1 -1
- package/dist/requests/answerRequest.d.ts +3 -0
- package/dist/requests/answerRequest.d.ts.map +1 -1
- package/dist/requests/answerRequest.js +9 -2
- package/dist/requests/answerRequest.js.map +1 -1
- package/dist/requests/limitWaitAnswer.d.ts +14 -0
- package/dist/requests/limitWaitAnswer.d.ts.map +1 -1
- package/dist/requests/limitWaitAnswer.js +26 -4
- package/dist/requests/limitWaitAnswer.js.map +1 -1
- package/dist/requests/requestHeader.d.ts +37 -5
- package/dist/requests/requestHeader.d.ts.map +1 -1
- package/dist/requests/requestHeader.js +46 -17
- package/dist/requests/requestHeader.js.map +1 -1
- package/dist/requests/scheduleWait.d.ts +79 -0
- package/dist/requests/scheduleWait.d.ts.map +1 -0
- package/dist/requests/scheduleWait.js +101 -0
- package/dist/requests/scheduleWait.js.map +1 -0
- package/dist/requests/sessionTurnProbe.d.ts +21 -3
- package/dist/requests/sessionTurnProbe.d.ts.map +1 -1
- package/dist/requests/sessionTurnProbe.js +18 -3
- package/dist/requests/sessionTurnProbe.js.map +1 -1
- package/dist/requests/topicRequestSettle.d.ts +13 -7
- package/dist/requests/topicRequestSettle.d.ts.map +1 -1
- package/dist/requests/topicRequestSettle.js +2 -2
- package/dist/requests/topicRequestSettle.js.map +1 -1
- package/dist/requests/trackerTurnPoster.d.ts +30 -0
- package/dist/requests/trackerTurnPoster.d.ts.map +1 -0
- package/dist/requests/trackerTurnPoster.js +36 -0
- package/dist/requests/trackerTurnPoster.js.map +1 -0
- package/dist/requests/types.d.ts +9 -2
- package/dist/requests/types.d.ts.map +1 -1
- package/dist/requests/wakeUpEngine.d.ts +188 -11
- package/dist/requests/wakeUpEngine.d.ts.map +1 -1
- package/dist/requests/wakeUpEngine.js +452 -43
- package/dist/requests/wakeUpEngine.js.map +1 -1
- package/dist/requests/wakeUpRules.d.ts +122 -12
- package/dist/requests/wakeUpRules.d.ts.map +1 -1
- package/dist/requests/wakeUpRules.js +117 -15
- package/dist/requests/wakeUpRules.js.map +1 -1
- package/dist/resumeContext.d.ts +2 -2
- package/dist/resumeContext.js +3 -3
- package/dist/resumeContext.js.map +1 -1
- package/dist/runnerUtility/adminService.js +1 -1
- package/dist/runnerUtility/adminService.js.map +1 -1
- package/dist/runnerUtility/guiAgent.d.ts +1 -1
- package/dist/runnerUtility/guiAgent.d.ts.map +1 -1
- package/dist/runnerUtility/guiAgent.js +1 -1
- package/dist/runnerUtility/guiAgent.js.map +1 -1
- package/dist/runnerUtility/managedNode.d.ts +3 -3
- package/dist/runnerUtility/managedNode.d.ts.map +1 -1
- package/dist/runnerUtility/managedNode.js +2 -2
- package/dist/runnerUtility/managedNode.js.map +1 -1
- package/dist/runnerUtility/runnerConfig.d.ts +1 -1
- package/dist/runnerUtility/runnerHome.d.ts +1 -1
- package/dist/runnerUtility/runnerHome.js +1 -1
- package/dist/runnerUtility/serviceCommon.d.ts +1 -1
- package/dist/runnerUtility/serviceCommon.d.ts.map +1 -1
- package/dist/runnerUtility/serviceCommon.js +1 -1
- package/dist/runnerUtility/serviceCommon.js.map +1 -1
- package/dist/runners/bootstrapLine.js +1 -1
- package/dist/runners/hubPackage.d.ts +1 -1
- package/dist/runners/hubPackage.js +3 -3
- package/dist/runners/hubPackage.js.map +1 -1
- package/dist/runners/hubPaths.d.ts +1 -1
- package/dist/runners/hubPaths.d.ts.map +1 -1
- package/dist/runners/runnerLock.d.ts +2 -2
- package/dist/runners/runnerLock.d.ts.map +1 -1
- package/dist/runners/runnerLock.js +2 -2
- package/dist/runners/runnerLock.js.map +1 -1
- package/dist/scheduler/checkRun.d.ts +2 -0
- package/dist/scheduler/checkRun.d.ts.map +1 -1
- package/dist/scheduler/checkRun.js +5 -1
- package/dist/scheduler/checkRun.js.map +1 -1
- package/dist/scheduler/delivery.d.ts +57 -0
- package/dist/scheduler/delivery.d.ts.map +1 -1
- package/dist/scheduler/delivery.js +152 -14
- package/dist/scheduler/delivery.js.map +1 -1
- package/dist/scheduler/injection.d.ts +6 -0
- package/dist/scheduler/injection.d.ts.map +1 -1
- package/dist/scheduler/injection.js +10 -0
- package/dist/scheduler/injection.js.map +1 -1
- package/dist/scheduler/mcpSurface.d.ts +38 -3
- package/dist/scheduler/mcpSurface.d.ts.map +1 -1
- package/dist/scheduler/mcpSurface.js +291 -175
- package/dist/scheduler/mcpSurface.js.map +1 -1
- package/dist/scheduler/rebindResume.d.ts +24 -0
- package/dist/scheduler/rebindResume.d.ts.map +1 -1
- package/dist/scheduler/rebindResume.js +32 -0
- package/dist/scheduler/rebindResume.js.map +1 -1
- package/dist/scheduler/scheduleToolWording.d.ts +29 -0
- package/dist/scheduler/scheduleToolWording.d.ts.map +1 -0
- package/dist/scheduler/scheduleToolWording.js +117 -0
- package/dist/scheduler/scheduleToolWording.js.map +1 -0
- package/dist/scheduler/scheduledRunTarget.d.ts +90 -0
- package/dist/scheduler/scheduledRunTarget.d.ts.map +1 -0
- package/dist/scheduler/scheduledRunTarget.js +92 -0
- package/dist/scheduler/scheduledRunTarget.js.map +1 -0
- package/dist/scheduler/store.d.ts +2 -0
- package/dist/scheduler/store.d.ts.map +1 -1
- package/dist/scheduler/store.js +2 -0
- package/dist/scheduler/store.js.map +1 -1
- package/dist/scheduler/types.d.ts +10 -0
- package/dist/scheduler/types.d.ts.map +1 -1
- package/dist/scheduler/workerWatch.d.ts +2 -0
- package/dist/scheduler/workerWatch.d.ts.map +1 -1
- package/dist/scheduler/workerWatch.js +3 -3
- package/dist/scheduler/workerWatch.js.map +1 -1
- package/dist/selfUpdate/constants.d.ts +2 -0
- package/dist/selfUpdate/constants.d.ts.map +1 -1
- package/dist/selfUpdate/constants.js +3 -1
- package/dist/selfUpdate/constants.js.map +1 -1
- package/dist/selfUpdate/emittedSource.d.ts.map +1 -1
- package/dist/selfUpdate/emittedSource.js +1 -1
- package/dist/selfUpdate/emittedSource.js.map +1 -1
- package/dist/selfUpdate/updateRuntime.js +1 -1
- package/dist/selfUpdate/updateRuntime.js.map +1 -1
- package/dist/sessionPick.d.ts +1 -1
- package/dist/sessionPick.js +1 -1
- package/dist/startupPromptBuffer.d.ts +35 -6
- package/dist/startupPromptBuffer.d.ts.map +1 -1
- package/dist/startupPromptBuffer.js +70 -21
- package/dist/startupPromptBuffer.js.map +1 -1
- package/dist/state.d.ts +270 -30
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +403 -37
- package/dist/state.js.map +1 -1
- package/dist/testTimings.d.ts +17 -4
- package/dist/testTimings.d.ts.map +1 -1
- package/dist/testTimings.js +35 -3
- package/dist/testTimings.js.map +1 -1
- package/dist/threadContextPreamble.d.ts +7 -0
- package/dist/threadContextPreamble.d.ts.map +1 -1
- package/dist/threadContextPreamble.js +11 -0
- package/dist/threadContextPreamble.js.map +1 -1
- package/dist/threadRouting.d.ts +12 -0
- package/dist/threadRouting.d.ts.map +1 -1
- package/dist/threadRouting.js +15 -0
- package/dist/threadRouting.js.map +1 -1
- package/dist/todos/midTurn.d.ts +15 -41
- package/dist/todos/midTurn.d.ts.map +1 -1
- package/dist/todos/midTurn.js +27 -171
- package/dist/todos/midTurn.js.map +1 -1
- package/dist/todos/registry.d.ts +2 -0
- package/dist/todos/registry.d.ts.map +1 -1
- package/dist/todos/registry.js +3 -1
- package/dist/todos/registry.js.map +1 -1
- package/dist/types.d.ts +235 -23
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/backendSwitchPlan.d.ts +3 -3
- package/dist/utils/backendSwitchPlan.js +3 -3
- package/dist/utils/claudeAccountAlert.d.ts +104 -0
- package/dist/utils/claudeAccountAlert.d.ts.map +1 -0
- package/dist/utils/claudeAccountAlert.js +130 -0
- package/dist/utils/claudeAccountAlert.js.map +1 -0
- package/dist/utils/claudeAccountPickerPlan.d.ts +7 -0
- package/dist/utils/claudeAccountPickerPlan.d.ts.map +1 -1
- package/dist/utils/claudeAccountPickerPlan.js +13 -2
- package/dist/utils/claudeAccountPickerPlan.js.map +1 -1
- package/dist/utils/claudeAuthRefusal.d.ts +122 -0
- package/dist/utils/claudeAuthRefusal.d.ts.map +1 -0
- package/dist/utils/claudeAuthRefusal.js +228 -0
- package/dist/utils/claudeAuthRefusal.js.map +1 -0
- package/dist/utils/claudeCompactHook.d.ts +9 -7
- package/dist/utils/claudeCompactHook.d.ts.map +1 -1
- package/dist/utils/claudeCompactHook.js +11 -9
- package/dist/utils/claudeCompactHook.js.map +1 -1
- package/dist/utils/claudeLimitSwitch.d.ts +1 -1
- package/dist/utils/claudeLimitSwitch.d.ts.map +1 -1
- package/dist/utils/claudeLimitSwitch.js +1 -1
- package/dist/utils/claudeLimitSwitch.js.map +1 -1
- package/dist/utils/claudeProfileSync.d.ts +88 -0
- package/dist/utils/claudeProfileSync.d.ts.map +1 -0
- package/dist/utils/claudeProfileSync.js +198 -0
- package/dist/utils/claudeProfileSync.js.map +1 -0
- package/dist/utils/claudeProfileUsageViews.d.ts +54 -2
- package/dist/utils/claudeProfileUsageViews.d.ts.map +1 -1
- package/dist/utils/claudeProfileUsageViews.js +44 -1
- package/dist/utils/claudeProfileUsageViews.js.map +1 -1
- package/dist/utils/claudeProfiles.d.ts +101 -6
- package/dist/utils/claudeProfiles.d.ts.map +1 -1
- package/dist/utils/claudeProfiles.js +297 -23
- package/dist/utils/claudeProfiles.js.map +1 -1
- package/dist/utils/claudeRuntimeInfo.d.ts +24 -0
- package/dist/utils/claudeRuntimeInfo.d.ts.map +1 -1
- package/dist/utils/claudeRuntimeInfo.js +128 -3
- package/dist/utils/claudeRuntimeInfo.js.map +1 -1
- package/dist/utils/claudeScheduledJobs.d.ts +6 -2
- package/dist/utils/claudeScheduledJobs.d.ts.map +1 -1
- package/dist/utils/claudeScheduledJobs.js +10 -2
- package/dist/utils/claudeScheduledJobs.js.map +1 -1
- package/dist/utils/claudeSessionTitle.js +1 -1
- package/dist/utils/claudeSessionTitle.js.map +1 -1
- package/dist/utils/claudeStreamJson.d.ts +28 -2
- package/dist/utils/claudeStreamJson.d.ts.map +1 -1
- package/dist/utils/claudeStreamJson.js +33 -3
- package/dist/utils/claudeStreamJson.js.map +1 -1
- package/dist/utils/claudeTranscriptEpoch.d.ts +14 -0
- package/dist/utils/claudeTranscriptEpoch.d.ts.map +1 -1
- package/dist/utils/claudeTranscriptEpoch.js +79 -19
- package/dist/utils/claudeTranscriptEpoch.js.map +1 -1
- package/dist/utils/claudeUsage.d.ts +103 -7
- package/dist/utils/claudeUsage.d.ts.map +1 -1
- package/dist/utils/claudeUsage.js +108 -15
- package/dist/utils/claudeUsage.js.map +1 -1
- package/dist/utils/claudeUsageRefresher.d.ts +8 -1
- package/dist/utils/claudeUsageRefresher.d.ts.map +1 -1
- package/dist/utils/claudeUsageRefresher.js +11 -1
- package/dist/utils/claudeUsageRefresher.js.map +1 -1
- package/dist/utils/compactOnIdle.d.ts +139 -29
- package/dist/utils/compactOnIdle.d.ts.map +1 -1
- package/dist/utils/compactOnIdle.js +163 -36
- package/dist/utils/compactOnIdle.js.map +1 -1
- package/dist/utils/conversationEnding.d.ts +76 -0
- package/dist/utils/conversationEnding.d.ts.map +1 -0
- package/dist/utils/conversationEnding.js +117 -0
- package/dist/utils/conversationEnding.js.map +1 -0
- package/dist/utils/cutButtonLabel.d.ts +7 -0
- package/dist/utils/cutButtonLabel.d.ts.map +1 -0
- package/dist/utils/cutButtonLabel.js +17 -0
- package/dist/utils/cutButtonLabel.js.map +1 -0
- package/dist/utils/doctorLine.d.ts +10 -0
- package/dist/utils/doctorLine.d.ts.map +1 -1
- package/dist/utils/doctorLine.js +16 -0
- package/dist/utils/doctorLine.js.map +1 -1
- package/dist/utils/fallbackBridge.d.ts.map +1 -1
- package/dist/utils/fallbackBridge.js +2 -1
- package/dist/utils/fallbackBridge.js.map +1 -1
- package/dist/utils/fallbackChain.d.ts +2 -0
- package/dist/utils/fallbackChain.d.ts.map +1 -1
- package/dist/utils/fallbackChain.js +4 -3
- package/dist/utils/fallbackChain.js.map +1 -1
- package/dist/utils/fallbackSwitchNotice.d.ts +11 -4
- package/dist/utils/fallbackSwitchNotice.d.ts.map +1 -1
- package/dist/utils/fallbackSwitchNotice.js +9 -5
- package/dist/utils/fallbackSwitchNotice.js.map +1 -1
- package/dist/utils/fileSendService.d.ts +31 -0
- package/dist/utils/fileSendService.d.ts.map +1 -1
- package/dist/utils/fileSendService.js +45 -2
- package/dist/utils/fileSendService.js.map +1 -1
- package/dist/utils/jsonStreamHost.d.ts +2 -0
- package/dist/utils/jsonStreamHost.d.ts.map +1 -1
- package/dist/utils/jsonStreamHost.js +4 -1
- package/dist/utils/jsonStreamHost.js.map +1 -1
- package/dist/utils/jsonStreamPendingWork.d.ts +14 -2
- package/dist/utils/jsonStreamPendingWork.d.ts.map +1 -1
- package/dist/utils/jsonStreamPendingWork.js +25 -5
- package/dist/utils/jsonStreamPendingWork.js.map +1 -1
- package/dist/utils/jsonStreamUnconsumedInput.d.ts +80 -0
- package/dist/utils/jsonStreamUnconsumedInput.d.ts.map +1 -0
- package/dist/utils/jsonStreamUnconsumedInput.js +99 -0
- package/dist/utils/jsonStreamUnconsumedInput.js.map +1 -0
- package/dist/utils/limitEpisodeRecovery.d.ts +43 -4
- package/dist/utils/limitEpisodeRecovery.d.ts.map +1 -1
- package/dist/utils/limitEpisodeRecovery.js +107 -20
- package/dist/utils/limitEpisodeRecovery.js.map +1 -1
- package/dist/utils/limitHeldPrompts.d.ts +21 -11
- package/dist/utils/limitHeldPrompts.d.ts.map +1 -1
- package/dist/utils/limitHeldPrompts.js +12 -9
- package/dist/utils/limitHeldPrompts.js.map +1 -1
- package/dist/utils/limitRemindersScreenPlan.d.ts +63 -0
- package/dist/utils/limitRemindersScreenPlan.d.ts.map +1 -0
- package/dist/utils/limitRemindersScreenPlan.js +121 -0
- package/dist/utils/limitRemindersScreenPlan.js.map +1 -0
- package/dist/utils/limitSwitchPlan.d.ts +44 -0
- package/dist/utils/limitSwitchPlan.d.ts.map +1 -0
- package/dist/utils/limitSwitchPlan.js +54 -0
- package/dist/utils/limitSwitchPlan.js.map +1 -0
- package/dist/utils/limitsBoardPlan.d.ts +16 -7
- package/dist/utils/limitsBoardPlan.d.ts.map +1 -1
- package/dist/utils/limitsBoardPlan.js +41 -9
- package/dist/utils/limitsBoardPlan.js.map +1 -1
- package/dist/utils/lostWork.d.ts +16 -2
- package/dist/utils/lostWork.d.ts.map +1 -1
- package/dist/utils/lostWork.js +16 -3
- package/dist/utils/lostWork.js.map +1 -1
- package/dist/utils/messageContext.d.ts +2 -2
- package/dist/utils/messageContext.js +2 -2
- package/dist/utils/midTurnInbox.d.ts +79 -0
- package/dist/utils/midTurnInbox.d.ts.map +1 -0
- package/dist/utils/midTurnInbox.js +265 -0
- package/dist/utils/midTurnInbox.js.map +1 -0
- package/dist/utils/promptDelivery.d.ts +70 -22
- package/dist/utils/promptDelivery.d.ts.map +1 -1
- package/dist/utils/promptDelivery.js +100 -42
- package/dist/utils/promptDelivery.js.map +1 -1
- package/dist/utils/questionWaitChoices.d.ts +20 -0
- package/dist/utils/questionWaitChoices.d.ts.map +1 -0
- package/dist/utils/questionWaitChoices.js +31 -0
- package/dist/utils/questionWaitChoices.js.map +1 -0
- package/dist/utils/questionWaitPlan.d.ts +166 -0
- package/dist/utils/questionWaitPlan.d.ts.map +1 -0
- package/dist/utils/questionWaitPlan.js +237 -0
- package/dist/utils/questionWaitPlan.js.map +1 -0
- package/dist/utils/replyQuote.d.ts +10 -0
- package/dist/utils/replyQuote.d.ts.map +1 -1
- package/dist/utils/replyQuote.js +18 -7
- package/dist/utils/replyQuote.js.map +1 -1
- package/dist/utils/talkerAccess.d.ts +2 -2
- package/dist/utils/talkerAccess.d.ts.map +1 -1
- package/dist/utils/talkerAccess.js +5 -4
- package/dist/utils/talkerAccess.js.map +1 -1
- package/dist/utils/telegramError.d.ts +6 -0
- package/dist/utils/telegramError.d.ts.map +1 -1
- package/dist/utils/telegramError.js +12 -0
- package/dist/utils/telegramError.js.map +1 -1
- package/dist/utils/topicAccessScreenPlan.d.ts +1 -1
- package/dist/utils/topicAccessScreenPlan.d.ts.map +1 -1
- package/dist/utils/topicAccessScreenPlan.js +3 -7
- package/dist/utils/topicAccessScreenPlan.js.map +1 -1
- package/dist/utils/topicIndicatorPlan.d.ts +153 -0
- package/dist/utils/topicIndicatorPlan.d.ts.map +1 -0
- package/dist/utils/topicIndicatorPlan.js +224 -0
- package/dist/utils/topicIndicatorPlan.js.map +1 -0
- package/dist/utils/topicIndicatorSources.d.ts +40 -0
- package/dist/utils/topicIndicatorSources.d.ts.map +1 -0
- package/dist/utils/topicIndicatorSources.js +31 -0
- package/dist/utils/topicIndicatorSources.js.map +1 -0
- package/dist/utils/topicRequest.d.ts +3 -0
- package/dist/utils/topicRequest.d.ts.map +1 -1
- package/dist/utils/topicRequest.js +4 -0
- package/dist/utils/topicRequest.js.map +1 -1
- package/dist/utils/topicStatusPlan.d.ts +90 -0
- package/dist/utils/topicStatusPlan.d.ts.map +1 -0
- package/dist/utils/topicStatusPlan.js +160 -0
- package/dist/utils/topicStatusPlan.js.map +1 -0
- package/dist/utils/workerRoles.d.ts +122 -0
- package/dist/utils/workerRoles.d.ts.map +1 -0
- package/dist/utils/workerRoles.js +160 -0
- package/dist/utils/workerRoles.js.map +1 -0
- package/dist/utils/workerRolesScreenPlan.d.ts +118 -0
- package/dist/utils/workerRolesScreenPlan.d.ts.map +1 -0
- package/dist/utils/workerRolesScreenPlan.js +232 -0
- package/dist/utils/workerRolesScreenPlan.js.map +1 -0
- package/dist/utils/workingSignals.d.ts +49 -0
- package/dist/utils/workingSignals.d.ts.map +1 -0
- package/dist/utils/workingSignals.js +41 -0
- package/dist/utils/workingSignals.js.map +1 -0
- package/licensing.json +88 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +7 -7
- package/{remoteRun → runner-scripts}/runner.sh +6 -3
- package/COMMERCIAL-LICENSE.md +0 -142
- package/dist/agentTrigger.d.ts +0 -28
- package/dist/agentTrigger.d.ts.map +0 -1
- package/dist/agentTrigger.js +0 -53
- package/dist/agentTrigger.js.map +0 -1
- /package/{remoteRun → runner-scripts}/ensureNode.sh +0 -0
- /package/{remoteRun → runner-scripts}/runner-package-lock.json +0 -0
|
@@ -6,21 +6,22 @@ exports.deliverLatePrompt = deliverLatePrompt;
|
|
|
6
6
|
const sessionKey_1 = require("../sessionKey");
|
|
7
7
|
const sessionKeyCodec_1 = require("../connectors/telegram/sessionKeyCodec");
|
|
8
8
|
/**
|
|
9
|
-
* @description Deliver `text` to a conversation's agent
|
|
10
|
-
* window
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* API-error retry's "continue" nudge — the last two reach it with a session another
|
|
15
|
-
* caller's start may still be bringing up, where a direct forward would hit an
|
|
16
|
-
* adapter that is not there yet.
|
|
9
|
+
* @description Deliver `text` to a conversation's agent, routed at the MOMENT OF THE WRITE ({@link deliverLatePrompt}): a start's or a
|
|
10
|
+
* stop's window open → buffered behind it (it replays in order once the session is up, exactly like a text typed during boot); a live
|
|
11
|
+
* session → forwarded; no window and no live session → the conversation is woken first, then forwarded. The one "buffer-or-forward"
|
|
12
|
+
* unit of every prompt that may meet a session another caller is starting or stopping: a person's prompt (`deliverPromptByState` in
|
|
13
|
+
* `bot.ts`), a scheduled run, a tracker's post, the lost-work post, a retry's «continue», a move's first prompt.
|
|
17
14
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
15
|
+
* Nothing a caller read before an await decides it: a window that closed during the caller's awaits (its request opened, a file
|
|
16
|
+
* downloaded) never takes the prompt. The buffer is read and added to in the same tick, so it never refuses a prompt here
|
|
17
|
+
* ({@link StartupPromptBuffer.addPrompt} refuses a closed window); a refusal would be a bug and throws.
|
|
21
18
|
*
|
|
22
19
|
* The "queued while starting" notice is posted once per startup window, and only
|
|
23
|
-
* for a Telegram conversation: a tracker issue has no topic to say it in (R6).
|
|
20
|
+
* for a Telegram conversation: a tracker issue has no topic to say it in (R6). It is
|
|
21
|
+
* NOT awaited (a topic send through the process-wide pacer can take seconds): this
|
|
22
|
+
* resolves `buffered` in the tick the buffer took the prompt, so a caller that watches
|
|
23
|
+
* the prompt's turn does so before any replay can write it, and before the agent can
|
|
24
|
+
* answer it (review 20 #2). The pacer keeps the notice's place in the topic.
|
|
24
25
|
*
|
|
25
26
|
* A buffered prompt lives in memory, so a restart before the start ends loses it.
|
|
26
27
|
* A caller that must know how the wait ended — to keep what would re-send the prompt
|
|
@@ -29,31 +30,53 @@ const sessionKeyCodec_1 = require("../connectors/telegram/sessionKeyCodec");
|
|
|
29
30
|
* A failed "queued" notice is logged and does not change the answer: the prompt was
|
|
30
31
|
* buffered before the notice went out.
|
|
31
32
|
*/
|
|
32
|
-
async function deliverPromptOrBuffer(deps, key, text,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
33
|
+
async function deliverPromptOrBuffer(deps, key, text, onBufferedSettled, options = {}) {
|
|
34
|
+
const threadId = (0, sessionKey_1.keyToString)(key);
|
|
35
|
+
let isBuffered = false;
|
|
36
|
+
const outcome = await deliverLatePrompt({
|
|
37
|
+
checkIsWindowOpen: () => deps.startupBuffer.checkIsStarting(threadId),
|
|
38
|
+
checkIsSessionActive: () => deps.checkIsSessionActive(key),
|
|
39
|
+
waitBeforeRoute: options.waitBeforeRoute,
|
|
40
|
+
// Only a person's prompt is refused while a command ends or replaces the conversation: a bot-made one is settled by its caller.
|
|
41
|
+
...(options.isPersonInput === true ? { checkIsRefused: () => deps.checkIsRefusingMessages(key) } : {}),
|
|
42
|
+
buffer: async () => {
|
|
43
|
+
// Called in the tick the window was read open (`deliverLatePrompt` awaits nothing between), so it cannot be refused.
|
|
44
|
+
const added = deps.startupBuffer.addPrompt(threadId, text, onBufferedSettled, getBufferedPromptOptions(options));
|
|
45
|
+
if (added === 'refused')
|
|
46
|
+
throw new Error(`[promptDelivery] the startup buffer of ${threadId} refused a prompt in the tick its window read open`);
|
|
47
|
+
isBuffered = true;
|
|
48
|
+
if (added !== 'firstInWindow' || !(0, sessionKeyCodec_1.checkIsTelegramKey)(key))
|
|
49
|
+
return;
|
|
50
|
+
// The prompt IS buffered by now (and its settle callback registered), so a notice that fails must not read as a delivery
|
|
51
|
+
// that failed: a caller keeping something until the prompt reached a session would otherwise treat it as spent.
|
|
52
|
+
deps.announceQueued(key).catch((err) => console.error(`[promptDelivery] queued notice for ${threadId} failed:`, err));
|
|
53
|
+
},
|
|
54
|
+
wake: () => deps.wakeSession(key),
|
|
55
|
+
forward: () => deps.forwardPrompt(key, text, options),
|
|
56
|
+
reportNoSession: (isAlreadyTold) => deps.reportNoSession(key, isAlreadyTold, options),
|
|
57
|
+
reportRefused: () => deps.reportRefused(key, options),
|
|
58
|
+
});
|
|
59
|
+
if (isBuffered)
|
|
60
|
+
return 'buffered';
|
|
61
|
+
// A forward that re-routed the prompt behind a stop window itself registered no `onBufferedSettled`: it reads as forwarded.
|
|
62
|
+
return outcome === 'noSession' ? 'noSession' : 'forwarded';
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @description The options a prompt is buffered with, for its replay: all of them but a bot post's wait for a command
|
|
66
|
+
* (`waitBeforeRoute`), which is its own routing's. A replay writes what its window held one after another, at once, into the process
|
|
67
|
+
* its start brought up; a wait carried into it would hold every prompt behind the post for a whole ending command, while the turn probe
|
|
68
|
+
* reads the conversation as still starting (mini-review of round 28, #1).
|
|
69
|
+
*/
|
|
70
|
+
function getBufferedPromptOptions(options) {
|
|
71
|
+
const { waitBeforeRoute: _ownRoutingWait, ...bufferedOptions } = options;
|
|
72
|
+
return bufferedOptions;
|
|
51
73
|
}
|
|
52
74
|
/**
|
|
53
75
|
* @description The {@link LatePromptRoute} of a prompt, read at the moment it is forwarded. The idle stop posts a
|
|
54
76
|
* re-asked question just before it stops the process, and a handler awaits between reading the session's state and the
|
|
55
77
|
* forward (the tap's toast, the request it opens): written into a process being stopped the prompt was lost, and
|
|
56
|
-
* into one already gone it was dropped.
|
|
78
|
+
* into one already gone it was dropped. A person's prompt that meets a command ending or replacing the conversation
|
|
79
|
+
* (`isRefused`) is refused, whatever the session reads as (`requests/README.md` § Turn starts, review 25 #1).
|
|
57
80
|
*
|
|
58
81
|
* A bot-made TECHNICAL prompt (the todo list's standalone reminder) is posted only into a live session that is idle at
|
|
59
82
|
* this moment — never a resume, never held for a later one, never reported to the person: where a user's prompt would be
|
|
@@ -62,30 +85,65 @@ async function deliverPromptOrBuffer(deps, key, text, isStarting, onBufferedSett
|
|
|
62
85
|
function getLatePromptRoute(input) {
|
|
63
86
|
if (input.isTechnical === true)
|
|
64
87
|
return input.isWindowOpen || !input.isSessionActive ? 'drop' : 'forward';
|
|
88
|
+
// Ahead of any window: the window open now is the stop of the conversation the command ends, or the start of the one it begins — a
|
|
89
|
+
// message for the first is lost with it, and one for the second would reach that agent ahead of what the command hands it first.
|
|
90
|
+
if (input.isRefused === true)
|
|
91
|
+
return 'refuse';
|
|
65
92
|
if (input.isWindowOpen)
|
|
66
93
|
return 'buffer';
|
|
67
94
|
return input.isSessionActive ? 'forward' : 'wake';
|
|
68
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* How many times one prompt may wake its conversation: a wake awaits (its start, the notice it posts), and the session it brought up
|
|
98
|
+
* may be stopping again, or gone, by the time it resolves — the prompt is then routed once more, and woken for at most once more.
|
|
99
|
+
*/
|
|
100
|
+
const latePromptMaxWakes = 2;
|
|
69
101
|
/**
|
|
70
102
|
* @description Deliver a prompt whose handler decided, when it arrived, that the session is live — routed again by
|
|
71
103
|
* {@link getLatePromptRoute} now, after the handler's awaits. A wake that finds nothing never forwards: the forward
|
|
72
|
-
* would show the topic as working while the adapter drops the text.
|
|
104
|
+
* would show the topic as working while the adapter drops the text. A wake that brought a session up is followed by
|
|
105
|
+
* one more routing by the state at that moment, never a blind forward: during its awaits (a fresh start's notice is a
|
|
106
|
+
* paced topic send) a prompt it replayed can end its turn and the per-turn stop open its window — a prompt written
|
|
107
|
+
* into that stopping process would be lost (review 19 nit 2).
|
|
73
108
|
*/
|
|
74
|
-
|
|
75
|
-
|
|
109
|
+
function deliverLatePrompt(ports) {
|
|
110
|
+
return routeLatePrompt(ports, latePromptMaxWakes);
|
|
111
|
+
}
|
|
112
|
+
async function routeLatePrompt(ports, wakesLeft) {
|
|
113
|
+
// Only when there is one: an await here would move every other prompt's routing out of its caller's tick.
|
|
114
|
+
if (ports.waitBeforeRoute)
|
|
115
|
+
await ports.waitBeforeRoute();
|
|
116
|
+
const route = getLatePromptRoute({
|
|
117
|
+
isWindowOpen: ports.checkIsWindowOpen(),
|
|
118
|
+
isSessionActive: ports.checkIsSessionActive(),
|
|
119
|
+
isTechnical: ports.isTechnical,
|
|
120
|
+
isRefused: ports.checkIsRefused?.() === true,
|
|
121
|
+
});
|
|
76
122
|
if (route === 'drop')
|
|
77
123
|
return 'dropped';
|
|
124
|
+
if (route === 'refuse')
|
|
125
|
+
return reportRefused(ports);
|
|
78
126
|
if (route === 'buffer') {
|
|
79
127
|
await ports.buffer();
|
|
80
128
|
return 'buffered';
|
|
81
129
|
}
|
|
82
|
-
if (route === '
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
130
|
+
if (route === 'forward')
|
|
131
|
+
return ports.forward();
|
|
132
|
+
if (wakesLeft === 0) {
|
|
133
|
+
await ports.reportNoSession(false);
|
|
134
|
+
return 'noSession';
|
|
88
135
|
}
|
|
89
|
-
|
|
136
|
+
const wake = await ports.wake();
|
|
137
|
+
if (wake.isEnded === true)
|
|
138
|
+
return reportRefused(ports);
|
|
139
|
+
if (!wake.isAwake) {
|
|
140
|
+
await ports.reportNoSession(wake.isNoticePosted);
|
|
141
|
+
return 'noSession';
|
|
142
|
+
}
|
|
143
|
+
return routeLatePrompt(ports, wakesLeft - 1);
|
|
144
|
+
}
|
|
145
|
+
async function reportRefused(ports) {
|
|
146
|
+
await (ports.reportRefused ? ports.reportRefused() : ports.reportNoSession(false));
|
|
147
|
+
return 'noSession';
|
|
90
148
|
}
|
|
91
149
|
//# sourceMappingURL=promptDelivery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptDelivery.js","sourceRoot":"","sources":["../../src/utils/promptDelivery.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"promptDelivery.js","sourceRoot":"","sources":["../../src/utils/promptDelivery.ts"],"names":[],"mappings":";;AAqFA,sDAiCC;AAkCD,gDAOC;AAoED,8CAEC;AArOD,8CAA6D;AAC7D,4EAA4E;AA2D5E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACI,KAAK,UAAU,qBAAqB,CACzC,IAAwB,EACxB,GAAe,EACf,IAAY,EACZ,iBAAyC,EACzC,UAAiC,EAAE;IAEnC,MAAM,QAAQ,GAAG,IAAA,wBAAW,EAAC,GAAG,CAAC,CAAC;IAClC,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC;QACtC,iBAAiB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,QAAQ,CAAC;QACrE,oBAAoB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC;QAC1D,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,gIAAgI;QAChI,GAAG,CAAC,OAAO,CAAC,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACtG,MAAM,EAAE,KAAK,IAAI,EAAE;YACjB,qHAAqH;YACrH,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,iBAAiB,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC;YACjH,IAAI,KAAK,KAAK,SAAS;gBAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,QAAQ,oDAAoD,CAAC,CAA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ACnC,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;IAChC,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI;QAAE,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;IACvD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACjD,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,OAAO,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,KAAK,UAAU,aAAa,CAAC,KAA8B;IACzD,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;IACnF,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description The choices of the «question wait» setting and how long each lets a question wait — kept apart from
|
|
3
|
+
* `questionWaitPlan.ts` (the texts and the routing of a set-aside question) because the instance settings, the state store and the
|
|
4
|
+
* test timings need only these, and they load before any env file is read: this module imports nothing.
|
|
5
|
+
*/
|
|
6
|
+
/** The question wait, in the order a picker lists it: `dontWait` sets a question aside at once, `untilAnswered` never does. */
|
|
7
|
+
export declare const questionWaitChoices: readonly ["dontWait", "tenMinutes", "thirtyMinutes", "oneHour", "untilAnswered"];
|
|
8
|
+
/** @name QuestionWaitChoice @description One value of the «question wait» setting. */
|
|
9
|
+
export type QuestionWaitChoice = (typeof questionWaitChoices)[number];
|
|
10
|
+
/** @description Whether `value` is one of the wait choices (a hand-edited state or settings file may hold anything). */
|
|
11
|
+
export declare function checkIsQuestionWaitChoice(value: string | undefined): value is QuestionWaitChoice;
|
|
12
|
+
/** What an instance does until the operator chooses: the owner's figure. */
|
|
13
|
+
export declare const defaultQuestionWaitChoice: QuestionWaitChoice;
|
|
14
|
+
/** How long each choice lets a question wait; `null` = for as long as it takes (the pre-set-aside behaviour). */
|
|
15
|
+
export declare const questionWaitMs: Record<QuestionWaitChoice, number | null>;
|
|
16
|
+
/** The longest finite wait the setting offers: the ceiling a test's shorter window (`CHARNESS_TEST_TIMINGS`) may name. */
|
|
17
|
+
export declare const longestQuestionWaitMs: number;
|
|
18
|
+
/** After the agent's server did not take what sets a question aside, the bot tries again this long after: the ceiling a test's shorter window may name. */
|
|
19
|
+
export declare const setAsideRetryDelayMs = 30000;
|
|
20
|
+
//# sourceMappingURL=questionWaitChoices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"questionWaitChoices.d.ts","sourceRoot":"","sources":["../../src/utils/questionWaitChoices.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,+HAA+H;AAC/H,eAAO,MAAM,mBAAmB,kFAAmF,CAAC;AAEpH,sFAAsF;AACtF,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,wHAAwH;AACxH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,IAAI,kBAAkB,CAEhG;AAED,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,EAAE,kBAAoC,CAAC;AAE7E,iHAAiH;AACjH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAMpE,CAAC;AAEF,0HAA0H;AAC1H,eAAO,MAAM,qBAAqB,QAAmB,CAAC;AAEtD,2JAA2J;AAC3J,eAAO,MAAM,oBAAoB,QAAS,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description The choices of the «question wait» setting and how long each lets a question wait — kept apart from
|
|
4
|
+
* `questionWaitPlan.ts` (the texts and the routing of a set-aside question) because the instance settings, the state store and the
|
|
5
|
+
* test timings need only these, and they load before any env file is read: this module imports nothing.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.setAsideRetryDelayMs = exports.longestQuestionWaitMs = exports.questionWaitMs = exports.defaultQuestionWaitChoice = exports.questionWaitChoices = void 0;
|
|
9
|
+
exports.checkIsQuestionWaitChoice = checkIsQuestionWaitChoice;
|
|
10
|
+
const msPerMinute = 60_000;
|
|
11
|
+
/** The question wait, in the order a picker lists it: `dontWait` sets a question aside at once, `untilAnswered` never does. */
|
|
12
|
+
exports.questionWaitChoices = ['dontWait', 'tenMinutes', 'thirtyMinutes', 'oneHour', 'untilAnswered'];
|
|
13
|
+
/** @description Whether `value` is one of the wait choices (a hand-edited state or settings file may hold anything). */
|
|
14
|
+
function checkIsQuestionWaitChoice(value) {
|
|
15
|
+
return exports.questionWaitChoices.some((choice) => choice === value);
|
|
16
|
+
}
|
|
17
|
+
/** What an instance does until the operator chooses: the owner's figure. */
|
|
18
|
+
exports.defaultQuestionWaitChoice = 'thirtyMinutes';
|
|
19
|
+
/** How long each choice lets a question wait; `null` = for as long as it takes (the pre-set-aside behaviour). */
|
|
20
|
+
exports.questionWaitMs = {
|
|
21
|
+
dontWait: 0,
|
|
22
|
+
tenMinutes: 10 * msPerMinute,
|
|
23
|
+
thirtyMinutes: 30 * msPerMinute,
|
|
24
|
+
oneHour: 60 * msPerMinute,
|
|
25
|
+
untilAnswered: null,
|
|
26
|
+
};
|
|
27
|
+
/** The longest finite wait the setting offers: the ceiling a test's shorter window (`CHARNESS_TEST_TIMINGS`) may name. */
|
|
28
|
+
exports.longestQuestionWaitMs = 60 * msPerMinute;
|
|
29
|
+
/** After the agent's server did not take what sets a question aside, the bot tries again this long after: the ceiling a test's shorter window may name. */
|
|
30
|
+
exports.setAsideRetryDelayMs = 30_000;
|
|
31
|
+
//# sourceMappingURL=questionWaitChoices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"questionWaitChoices.js","sourceRoot":"","sources":["../../src/utils/questionWaitChoices.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAWH,8DAEC;AAXD,MAAM,WAAW,GAAG,MAAM,CAAC;AAE3B,+HAA+H;AAClH,QAAA,mBAAmB,GAAG,CAAC,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,CAAU,CAAC;AAKpH,wHAAwH;AACxH,SAAgB,yBAAyB,CAAC,KAAyB;IACjE,OAAO,2BAAmB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,4EAA4E;AAC/D,QAAA,yBAAyB,GAAuB,eAAe,CAAC;AAE7E,iHAAiH;AACpG,QAAA,cAAc,GAA8C;IACvE,QAAQ,EAAE,CAAC;IACX,UAAU,EAAE,EAAE,GAAG,WAAW;IAC5B,aAAa,EAAE,EAAE,GAAG,WAAW;IAC/B,OAAO,EAAE,EAAE,GAAG,WAAW;IACzB,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,0HAA0H;AAC7G,QAAA,qBAAqB,GAAG,EAAE,GAAG,WAAW,CAAC;AAEtD,2JAA2J;AAC9I,QAAA,oBAAoB,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Pure plan for «a question the agent asked never stops its work»: how long a question waits for the owner
|
|
3
|
+
* (the «question wait» setting and its resolution), what the agent is told when the wait ends and the question is set aside,
|
|
4
|
+
* what it is told when the answer comes later, how a typed message is routed while questions wait or are set aside, and how
|
|
5
|
+
* many set-aside questions stay open at once.
|
|
6
|
+
*
|
|
7
|
+
* The bot owns every side effect (the timer, the deny / reply to the CLI, the Telegram edit and pin, the delivery of the late
|
|
8
|
+
* answer); this module only decides and words — so the rules are unit-testable without a live agent. The texts here are
|
|
9
|
+
* agent-facing English, never i18n, and the only place the model learns what «set aside» means: they are literal and
|
|
10
|
+
* never phrased as the user's words.
|
|
11
|
+
*/
|
|
12
|
+
import type { OpenCodeQuestion, SetAsideQuestionRecord } from '../types';
|
|
13
|
+
import { type QuestionWaitChoice } from './questionWaitChoices';
|
|
14
|
+
/** The most questions set aside and still open in one conversation; a further one closes the oldest. */
|
|
15
|
+
export declare const maxSetAsideQuestions = 5;
|
|
16
|
+
/**
|
|
17
|
+
* @description The wait that applies to a topic: its own choice, else General's (the instance default), else
|
|
18
|
+
* {@link defaultQuestionWaitChoice}.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveQuestionWait(topicChoice: QuestionWaitChoice | undefined, generalChoice: QuestionWaitChoice | undefined): QuestionWaitChoice;
|
|
21
|
+
/**
|
|
22
|
+
* @description How long from `nowMs` until a question asked at `askedAtMs` is to be set aside: `0` when its wait is over
|
|
23
|
+
* (also a `dontWait`), `null` when its choice never sets it aside. The point is `askedAtMs + wait` whatever the agent's
|
|
24
|
+
* process looks like — the timer is armed from this at ask time and again at boot, so a restart keeps the original moment.
|
|
25
|
+
* `shortenedToMs` is a test instance's own window (`CHARNESS_TEST_TIMINGS`): it cuts a finite wait to at most that, and
|
|
26
|
+
* leaves `dontWait` and `untilAnswered` as they are.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getQuestionSetAsideDelayMs(askedAtMs: number, choice: QuestionWaitChoice, nowMs: number, shortenedToMs?: number): number | null;
|
|
29
|
+
/** @description What {@link buildQuestionSetAsideText} words. */
|
|
30
|
+
export interface QuestionSetAsideTextInput {
|
|
31
|
+
/** The questions of the call the agent is blocked on. */
|
|
32
|
+
questions: OpenCodeQuestion[];
|
|
33
|
+
/** One slot per question: the answer given before the wait ended, `null` while open. */
|
|
34
|
+
answers: (string[] | null)[];
|
|
35
|
+
askedAtMs: number;
|
|
36
|
+
/** The moment the text is written: the end of the wait (or of an earlier set-aside, for the question asked again). */
|
|
37
|
+
nowMs: number;
|
|
38
|
+
/** The agent asked a question whose set-aside copy is still open: told it is the same one, not a new one. */
|
|
39
|
+
isAlreadyOpen?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @description The text the agent gets as the result of its question when the wait ends: Claude's `can_use_tool` deny
|
|
43
|
+
* message, OpenCode's custom answer of every question left open. It says the truth — nobody answered, the question stays
|
|
44
|
+
* open, the answer arrives later as a message — and tells the agent to go on, so its turn does not stop on the tool call.
|
|
45
|
+
* Answers given before the wait ended are named, so the agent does not lose them.
|
|
46
|
+
*/
|
|
47
|
+
export declare function buildQuestionSetAsideText(input: QuestionSetAsideTextInput): string;
|
|
48
|
+
/** One answer of a late-answer prompt: the question and what the person answered (a label, labels or typed text). */
|
|
49
|
+
export interface LateAnswerEntry {
|
|
50
|
+
question: OpenCodeQuestion;
|
|
51
|
+
answer: string[];
|
|
52
|
+
}
|
|
53
|
+
/** @description What {@link buildLateAnswerPrompt} words. */
|
|
54
|
+
export interface LateAnswerPromptInput {
|
|
55
|
+
/** The questions answered now — one for an ordinary question, several when a call's remaining questions are answered together. */
|
|
56
|
+
entries: [LateAnswerEntry, ...LateAnswerEntry[]];
|
|
57
|
+
askedAtMs: number;
|
|
58
|
+
setAsideAtMs: number;
|
|
59
|
+
/** The moment of the answer: clocks of an earlier day read with their date. */
|
|
60
|
+
nowMs: number;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @description The message that carries a late answer to the agent, which went on without it: names the question, the
|
|
64
|
+
* answer, and asks the agent to check what it did meanwhile. The words of the question and the answer cannot open a line
|
|
65
|
+
* the way one of the bot's own headers does (`neutraliseHeaderLookalikes`) — an answer may be typed by a topic member.
|
|
66
|
+
*/
|
|
67
|
+
export declare function buildLateAnswerPrompt(input: LateAnswerPromptInput): string;
|
|
68
|
+
/**
|
|
69
|
+
* @description The id of the set-aside record made from the topic's `sequence`-th set-aside question (the counter starts at 1,
|
|
70
|
+
* only goes up, and is kept for the topic's lifetime — closing a record, an eviction or a new conversation never resets it). A
|
|
71
|
+
* counter, not a hash or a clock: two questions can never share an id, so an old keyboard that stayed live can never answer a
|
|
72
|
+
* newer question. Short, as the button data holds 64 bytes.
|
|
73
|
+
*/
|
|
74
|
+
export declare function createSetAsideQuestionId(sequence: number): string;
|
|
75
|
+
/**
|
|
76
|
+
* @description Whether `messageId` is one of the messages that show a set-aside question: the live one (`messageId`) or, when a
|
|
77
|
+
* re-post put a copy at the bottom, the original it left up (`originalMessageId`). A reply to either answers the record, and a
|
|
78
|
+
* tap is honoured only on one of them.
|
|
79
|
+
*/
|
|
80
|
+
export declare function checkIsSetAsideRecordMessage(record: SetAsideQuestionRecord, messageId: number): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* @description The question of a set-aside record a late answer goes to: its first one still open (the questions of one call
|
|
83
|
+
* are answered in order, like on screen), `null` when none is. `index` is its place in `record.questions` / `record.answers`.
|
|
84
|
+
*/
|
|
85
|
+
export declare function getSetAsideAnswerTarget(record: SetAsideQuestionRecord): {
|
|
86
|
+
index: number;
|
|
87
|
+
question: OpenCodeQuestion;
|
|
88
|
+
} | null;
|
|
89
|
+
/** @description What {@link getSetAsideRecordAskedAgain} found. */
|
|
90
|
+
export interface SetAsideRecordAskedAgain {
|
|
91
|
+
record: SetAsideQuestionRecord;
|
|
92
|
+
/** One slot per question of the call the agent asks now: what the owner answered before, `null` for a question still open. */
|
|
93
|
+
answers: (string[] | null)[];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* @description The set-aside record the question the agent asks NOW repeats — it did not take «do not ask it again»: the same question
|
|
97
|
+
* texts AND option labels (the header does not count), in the same order, as the record's whole call — the answers the owner
|
|
98
|
+
* already gave ride along — or as the questions the record still has open (the rest of a call the owner answered in part, asked
|
|
99
|
+
* again alone). The newest such record; `null` for a question that is new.
|
|
100
|
+
*/
|
|
101
|
+
export declare function getSetAsideRecordAskedAgain(records: SetAsideQuestionRecord[], questions: OpenCodeQuestion[]): SetAsideRecordAskedAgain | null;
|
|
102
|
+
/**
|
|
103
|
+
* @description How a message typed in the topic is routed while a question may wait or may be set aside.
|
|
104
|
+
* - `answer` / `cancel` — a question is still waiting (the agent is blocked on it): today's route, see {@link getQuestionReplyRoute};
|
|
105
|
+
* - `answerSetAside` — the message answers the open question `questionIndex` of the set-aside record `recordId`, with `answer`
|
|
106
|
+
* (a reply: the label a bare option number names, else the typed text);
|
|
107
|
+
* - `prompt` — an ordinary message: it closes nothing and interrupts nothing, a set-aside question stays open.
|
|
108
|
+
*/
|
|
109
|
+
export type QuestionReplyRouteWithSetAside = {
|
|
110
|
+
kind: 'answer';
|
|
111
|
+
labels: string[];
|
|
112
|
+
} | {
|
|
113
|
+
kind: 'cancel';
|
|
114
|
+
} | {
|
|
115
|
+
kind: 'answerSetAside';
|
|
116
|
+
recordId: string;
|
|
117
|
+
questionIndex: number;
|
|
118
|
+
answer: string[];
|
|
119
|
+
} | {
|
|
120
|
+
kind: 'prompt';
|
|
121
|
+
};
|
|
122
|
+
/** @description What {@link getQuestionReplyRouteWithSetAside} decides on. */
|
|
123
|
+
export interface QuestionReplyRouteInput {
|
|
124
|
+
text: string;
|
|
125
|
+
/** The Telegram message the text replies to, `null` when it is not a reply. */
|
|
126
|
+
replyToMessageId: number | null;
|
|
127
|
+
/** The question on screen that the agent is blocked on right now, if any. */
|
|
128
|
+
liveQuestion: OpenCodeQuestion | undefined;
|
|
129
|
+
/** The conversation's open set-aside questions, oldest first. */
|
|
130
|
+
setAside: readonly SetAsideQuestionRecord[];
|
|
131
|
+
/**
|
|
132
|
+
* The message is a forward: somebody else's words are content, never control, so it answers no question (the same rule as
|
|
133
|
+
* `deliverActivePrompt`'s). A waiting question is still cancelled by it, as by any other message that is not a pick.
|
|
134
|
+
*/
|
|
135
|
+
isForwarded: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Whether the reply may be the answer in the person's own words. The operator's may; a topic member's answers only with an option
|
|
138
|
+
* number or an option's label — their free text is an ordinary prompt, as on the waiting-question route.
|
|
139
|
+
*/
|
|
140
|
+
canAnswerWithFreeText: boolean;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* @description Route a typed message, in this order. A forwarded message is somebody else's words — content, never control —
|
|
144
|
+
* so it does not answer a set-aside question (1), and answers no waiting question either (2: it cancels it, like any message
|
|
145
|
+
* that is not a pick).
|
|
146
|
+
* 1. a REPLY to either message of a set-aside question answers that question — whatever else is open, the person named it: a
|
|
147
|
+
* bare option number in range picks that label, so does an option's own label (both read without the quotes and the closing
|
|
148
|
+
* punctuation around them, which a transcript adds), and any other text is the answer itself, as it was typed — but
|
|
149
|
+
* only where `canAnswerWithFreeText` (a topic member's other text routes on, as an ordinary message; a reply with no text routes
|
|
150
|
+
* on too);
|
|
151
|
+
* 2. a question still waiting keeps its route (a number answers it, other text cancels it and goes as a prompt);
|
|
152
|
+
* 3. anything else is an ordinary prompt — it never closes a set-aside question. In particular a bare number with nothing
|
|
153
|
+
* waiting is NOT an answer to one: the agent writes new numbered text right after a set-aside, and no guard on it can be kept
|
|
154
|
+
* across a restart, so a set-aside question is answered late only by a tap on its buttons or a reply to its message.
|
|
155
|
+
*/
|
|
156
|
+
export declare function getQuestionReplyRouteWithSetAside(input: QuestionReplyRouteInput): QuestionReplyRouteWithSetAside;
|
|
157
|
+
/**
|
|
158
|
+
* @description Add a newly set-aside question to the conversation's list (oldest first), keeping at most
|
|
159
|
+
* {@link maxSetAsideQuestions}: the oldest ones that no longer fit are handed back as `evicted`, for the bot to close as
|
|
160
|
+
* «not answered» and unpin.
|
|
161
|
+
*/
|
|
162
|
+
export declare function addSetAsideQuestion(records: readonly SetAsideQuestionRecord[], added: SetAsideQuestionRecord): {
|
|
163
|
+
records: SetAsideQuestionRecord[];
|
|
164
|
+
evicted: SetAsideQuestionRecord[];
|
|
165
|
+
};
|
|
166
|
+
//# sourceMappingURL=questionWaitPlan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"questionWaitPlan.d.ts","source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