charness 3.6.1 → 3.8.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 +297 -0
- package/DEVELOPMENT.md +35 -5
- package/MIGRATION_RENAME_TO_CHARNESS.md +3 -2
- package/README.md +84 -782
- package/SETUP.md +48 -10
- package/agent-plugin/.claude-plugin/plugin.json +7 -0
- package/agent-plugin/README.md +35 -0
- package/agent-plugin/skills/charness-delegate-claude/SKILL.md +85 -0
- package/agent-plugin/skills/charness-delegate-claude/summarize-events.py +90 -0
- package/agent-plugin/skills/charness-delegate-opencode/SKILL.md +68 -0
- package/agent-plugin/skills/charness-manager/SKILL.md +152 -0
- package/dist/adapters/adapterNames.d.ts +6 -0
- package/dist/adapters/adapterNames.d.ts.map +1 -1
- package/dist/adapters/adapterNames.js +8 -2
- package/dist/adapters/adapterNames.js.map +1 -1
- package/dist/adapters/claudeCliAdapter.d.ts +8 -0
- package/dist/adapters/claudeCliAdapter.d.ts.map +1 -1
- package/dist/adapters/claudeCliAdapter.js +42 -5
- package/dist/adapters/claudeCliAdapter.js.map +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.d.ts +10 -9
- package/dist/adapters/claudeJsonStreamAdapter.d.ts.map +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.js +53 -55
- package/dist/adapters/claudeJsonStreamAdapter.js.map +1 -1
- package/dist/adapters/createAdapter.d.ts +8 -0
- package/dist/adapters/createAdapter.d.ts.map +1 -1
- package/dist/adapters/createAdapter.js +14 -2
- package/dist/adapters/createAdapter.js.map +1 -1
- package/dist/adapters/openCodeAdapter.d.ts +43 -6
- package/dist/adapters/openCodeAdapter.d.ts.map +1 -1
- package/dist/adapters/openCodeAdapter.js +97 -7
- package/dist/adapters/openCodeAdapter.js.map +1 -1
- package/dist/agentLogin/agentLogin.d.ts +1 -1
- package/dist/agentLogin/agentLogin.d.ts.map +1 -1
- package/dist/apiRetryKick.d.ts +4 -3
- package/dist/apiRetryKick.d.ts.map +1 -1
- package/dist/apiRetryKick.js +16 -9
- package/dist/apiRetryKick.js.map +1 -1
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +1360 -387
- package/dist/bot.js.map +1 -1
- package/dist/cli/claudeProfiles.d.ts +11 -6
- package/dist/cli/claudeProfiles.d.ts.map +1 -1
- package/dist/cli/claudeProfiles.js +50 -22
- package/dist/cli/claudeProfiles.js.map +1 -1
- package/dist/cli/hot.d.ts +5 -0
- package/dist/cli/hot.d.ts.map +1 -1
- package/dist/cli/hot.js +71 -25
- package/dist/cli/hot.js.map +1 -1
- package/dist/cli/tscWatchGuard.d.ts +95 -0
- package/dist/cli/tscWatchGuard.d.ts.map +1 -0
- package/dist/cli/tscWatchGuard.js +295 -0
- package/dist/cli/tscWatchGuard.js.map +1 -0
- package/dist/cli.js +55 -1
- package/dist/cli.js.map +1 -1
- package/dist/configDirFile.d.ts +7 -3
- package/dist/configDirFile.d.ts.map +1 -1
- package/dist/configDirFile.js +12 -5
- package/dist/configDirFile.js.map +1 -1
- package/dist/connectors/jira/answerSink.d.ts +10 -0
- package/dist/connectors/jira/answerSink.d.ts.map +1 -1
- package/dist/connectors/jira/answerSink.js +13 -0
- package/dist/connectors/jira/answerSink.js.map +1 -1
- package/dist/connectors/jira/config.d.ts +2 -0
- package/dist/connectors/jira/config.d.ts.map +1 -1
- package/dist/connectors/jira/config.js +9 -1
- package/dist/connectors/jira/config.js.map +1 -1
- package/dist/connectors/jira/connector.d.ts +11 -1
- package/dist/connectors/jira/connector.d.ts.map +1 -1
- package/dist/connectors/jira/connector.js +7 -0
- package/dist/connectors/jira/connector.js.map +1 -1
- package/dist/connectors/jira/inbound.d.ts +27 -4
- package/dist/connectors/jira/inbound.d.ts.map +1 -1
- package/dist/connectors/jira/inbound.js +69 -8
- package/dist/connectors/jira/inbound.js.map +1 -1
- package/dist/connectors/jira/issueBlocks.d.ts +5 -0
- package/dist/connectors/jira/issueBlocks.d.ts.map +1 -1
- package/dist/connectors/jira/issueBlocks.js +11 -0
- package/dist/connectors/jira/issueBlocks.js.map +1 -1
- package/dist/connectors/telegram/bindPicker.d.ts +5 -0
- package/dist/connectors/telegram/bindPicker.d.ts.map +1 -1
- package/dist/connectors/telegram/bindPicker.js +18 -1
- package/dist/connectors/telegram/bindPicker.js.map +1 -1
- package/dist/connectors/telegram/bindPickerClaims.d.ts +46 -0
- package/dist/connectors/telegram/bindPickerClaims.d.ts.map +1 -0
- package/dist/connectors/telegram/bindPickerClaims.js +83 -0
- package/dist/connectors/telegram/bindPickerClaims.js.map +1 -0
- package/dist/connectors/telegram/bindSweep.d.ts +32 -0
- package/dist/connectors/telegram/bindSweep.d.ts.map +1 -0
- package/dist/connectors/telegram/bindSweep.js +47 -0
- package/dist/connectors/telegram/bindSweep.js.map +1 -0
- package/dist/connectors/telegram/bindingWelcome.d.ts +23 -0
- package/dist/connectors/telegram/bindingWelcome.d.ts.map +1 -0
- package/dist/connectors/telegram/bindingWelcome.js +26 -0
- package/dist/connectors/telegram/bindingWelcome.js.map +1 -0
- package/dist/connectors/telegram/botApiConnection.d.ts +74 -0
- package/dist/connectors/telegram/botApiConnection.d.ts.map +1 -0
- package/dist/connectors/telegram/botApiConnection.js +201 -0
- package/dist/connectors/telegram/botApiConnection.js.map +1 -0
- package/dist/connectors/telegram/commands/botCore.d.ts +13 -3
- package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/botSkills.d.ts +21 -0
- package/dist/connectors/telegram/commands/botSkills.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/botSkills.js +133 -0
- package/dist/connectors/telegram/commands/botSkills.js.map +1 -0
- package/dist/connectors/telegram/commands/callbackMessage.d.ts +5 -0
- package/dist/connectors/telegram/commands/callbackMessage.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/callbackMessage.js +9 -0
- package/dist/connectors/telegram/commands/callbackMessage.js.map +1 -1
- package/dist/connectors/telegram/commands/compaction.d.ts +65 -3
- package/dist/connectors/telegram/commands/compaction.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/compaction.js +512 -94
- package/dist/connectors/telegram/commands/compaction.js.map +1 -1
- package/dist/connectors/telegram/commands/displayModes.d.ts +1 -1
- package/dist/connectors/telegram/commands/displayModes.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/displayModes.js +6 -18
- package/dist/connectors/telegram/commands/displayModes.js.map +1 -1
- package/dist/connectors/telegram/commands/fallbackChain.js +5 -5
- package/dist/connectors/telegram/commands/fallbackChain.js.map +1 -1
- package/dist/connectors/telegram/commands/reminders.d.ts +1 -1
- package/dist/connectors/telegram/commands/reminders.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/reminders.js +4 -15
- package/dist/connectors/telegram/commands/reminders.js.map +1 -1
- package/dist/connectors/telegram/commands/runners.d.ts +52 -0
- package/dist/connectors/telegram/commands/runners.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/runners.js +486 -0
- package/dist/connectors/telegram/commands/runners.js.map +1 -0
- package/dist/connectors/telegram/commands/selfUpdate.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/selfUpdate.js +1 -11
- package/dist/connectors/telegram/commands/selfUpdate.js.map +1 -1
- package/dist/connectors/telegram/commands/taskAgents.d.ts +22 -0
- package/dist/connectors/telegram/commands/taskAgents.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/taskAgents.js +104 -0
- package/dist/connectors/telegram/commands/taskAgents.js.map +1 -0
- package/dist/connectors/telegram/commands/todo.d.ts +82 -0
- package/dist/connectors/telegram/commands/todo.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/todo.js +384 -0
- package/dist/connectors/telegram/commands/todo.js.map +1 -0
- package/dist/connectors/telegram/commands/topicCommand.d.ts +6 -2
- package/dist/connectors/telegram/commands/topicCommand.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/topicCommand.js +6 -9
- package/dist/connectors/telegram/commands/topicCommand.js.map +1 -1
- package/dist/connectors/telegram/openBindMessages.d.ts +45 -0
- package/dist/connectors/telegram/openBindMessages.d.ts.map +1 -0
- package/dist/connectors/telegram/openBindMessages.js +67 -0
- package/dist/connectors/telegram/openBindMessages.js.map +1 -0
- package/dist/connectors/telegram/outputFlushPlan.d.ts +49 -0
- package/dist/connectors/telegram/outputFlushPlan.d.ts.map +1 -1
- package/dist/connectors/telegram/outputFlushPlan.js +46 -0
- package/dist/connectors/telegram/outputFlushPlan.js.map +1 -1
- package/dist/connectors/telegram/pendingTopicName.d.ts +26 -0
- package/dist/connectors/telegram/pendingTopicName.d.ts.map +1 -0
- package/dist/connectors/telegram/pendingTopicName.js +27 -0
- package/dist/connectors/telegram/pendingTopicName.js.map +1 -0
- package/dist/connectors/telegram/runnerPairingMessages.d.ts +27 -0
- package/dist/connectors/telegram/runnerPairingMessages.d.ts.map +1 -0
- package/dist/connectors/telegram/runnerPairingMessages.js +105 -0
- package/dist/connectors/telegram/runnerPairingMessages.js.map +1 -0
- package/dist/connectors/test/connector.d.ts.map +1 -1
- package/dist/connectors/test/connector.js +6 -1
- package/dist/connectors/test/connector.js.map +1 -1
- package/dist/i18n/de.d.ts.map +1 -1
- package/dist/i18n/de.js +148 -7
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +148 -7
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +148 -7
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +148 -7
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/hi.d.ts.map +1 -1
- package/dist/i18n/hi.js +148 -7
- package/dist/i18n/hi.js.map +1 -1
- package/dist/i18n/ja.d.ts.map +1 -1
- package/dist/i18n/ja.js +148 -7
- package/dist/i18n/ja.js.map +1 -1
- package/dist/i18n/ka.d.ts.map +1 -1
- package/dist/i18n/ka.js +148 -7
- package/dist/i18n/ka.js.map +1 -1
- package/dist/i18n/pt.d.ts.map +1 -1
- package/dist/i18n/pt.js +148 -7
- package/dist/i18n/pt.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +148 -7
- package/dist/i18n/ru.js.map +1 -1
- package/dist/i18n/uk.d.ts.map +1 -1
- package/dist/i18n/uk.js +148 -7
- package/dist/i18n/uk.js.map +1 -1
- package/dist/i18n/uz.d.ts.map +1 -1
- package/dist/i18n/uz.js +148 -7
- package/dist/i18n/uz.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +148 -7
- package/dist/i18n/zh.js.map +1 -1
- package/dist/i18n.d.ts +1 -1
- package/dist/i18n.js +1 -1
- package/dist/installManager.d.ts +70 -1
- package/dist/installManager.d.ts.map +1 -1
- package/dist/installManager.js +125 -13
- package/dist/installManager.js.map +1 -1
- package/dist/instanceSettings.d.ts +50 -1
- package/dist/instanceSettings.d.ts.map +1 -1
- package/dist/instanceSettings.js +119 -26
- package/dist/instanceSettings.js.map +1 -1
- package/dist/openCodeQuestionFlow.d.ts +30 -0
- package/dist/openCodeQuestionFlow.d.ts.map +1 -1
- package/dist/openCodeQuestionFlow.js +43 -0
- package/dist/openCodeQuestionFlow.js.map +1 -1
- package/dist/outputTrace.d.ts +6 -0
- package/dist/outputTrace.d.ts.map +1 -1
- package/dist/outputTrace.js +24 -1
- package/dist/outputTrace.js.map +1 -1
- package/dist/postToSession.d.ts +20 -5
- package/dist/postToSession.d.ts.map +1 -1
- package/dist/postToSession.js +38 -7
- package/dist/postToSession.js.map +1 -1
- package/dist/remoteRun/cliArgs.d.ts +75 -0
- package/dist/remoteRun/cliArgs.d.ts.map +1 -0
- package/dist/remoteRun/cliArgs.js +206 -0
- package/dist/remoteRun/cliArgs.js.map +1 -0
- package/dist/remoteRun/commands.d.ts +77 -0
- package/dist/remoteRun/commands.d.ts.map +1 -0
- package/dist/remoteRun/commands.js +327 -0
- package/dist/remoteRun/commands.js.map +1 -0
- package/dist/remoteRun/depsPlan.d.ts +16 -0
- package/dist/remoteRun/depsPlan.d.ts.map +1 -0
- package/dist/remoteRun/depsPlan.js +82 -0
- package/dist/remoteRun/depsPlan.js.map +1 -0
- package/dist/remoteRun/exitCodes.d.ts +34 -0
- package/dist/remoteRun/exitCodes.d.ts.map +1 -0
- package/dist/remoteRun/exitCodes.js +38 -0
- package/dist/remoteRun/exitCodes.js.map +1 -0
- package/dist/remoteRun/foreground.d.ts +29 -0
- package/dist/remoteRun/foreground.d.ts.map +1 -0
- package/dist/remoteRun/foreground.js +159 -0
- package/dist/remoteRun/foreground.js.map +1 -0
- package/dist/remoteRun/interrupts.d.ts +27 -0
- package/dist/remoteRun/interrupts.d.ts.map +1 -0
- package/dist/remoteRun/interrupts.js +78 -0
- package/dist/remoteRun/interrupts.js.map +1 -0
- package/dist/remoteRun/jobFiles.d.ts +31 -0
- package/dist/remoteRun/jobFiles.d.ts.map +1 -0
- package/dist/remoteRun/jobFiles.js +84 -0
- package/dist/remoteRun/jobFiles.js.map +1 -0
- package/dist/remoteRun/jobFormat.d.ts +16 -0
- package/dist/remoteRun/jobFormat.d.ts.map +1 -0
- package/dist/remoteRun/jobFormat.js +130 -0
- package/dist/remoteRun/jobFormat.js.map +1 -0
- package/dist/remoteRun/jobId.d.ts +15 -0
- package/dist/remoteRun/jobId.d.ts.map +1 -0
- package/dist/remoteRun/jobId.js +85 -0
- package/dist/remoteRun/jobId.js.map +1 -0
- package/dist/remoteRun/jobMeta.d.ts +18 -0
- package/dist/remoteRun/jobMeta.d.ts.map +1 -0
- package/dist/remoteRun/jobMeta.js +33 -0
- package/dist/remoteRun/jobMeta.js.map +1 -0
- package/dist/remoteRun/jobQuery.d.ts +12 -0
- package/dist/remoteRun/jobQuery.d.ts.map +1 -0
- package/dist/remoteRun/jobQuery.js +22 -0
- package/dist/remoteRun/jobQuery.js.map +1 -0
- package/dist/remoteRun/jobRecords.d.ts +22 -0
- package/dist/remoteRun/jobRecords.d.ts.map +1 -0
- package/dist/remoteRun/jobRecords.js +145 -0
- package/dist/remoteRun/jobRecords.js.map +1 -0
- package/dist/remoteRun/jobState.d.ts +62 -0
- package/dist/remoteRun/jobState.d.ts.map +1 -0
- package/dist/remoteRun/jobState.js +132 -0
- package/dist/remoteRun/jobState.js.map +1 -0
- package/dist/remoteRun/leaseTiming.d.ts +18 -0
- package/dist/remoteRun/leaseTiming.d.ts.map +1 -0
- package/dist/remoteRun/leaseTiming.js +43 -0
- package/dist/remoteRun/leaseTiming.js.map +1 -0
- package/dist/remoteRun/output.d.ts +37 -0
- package/dist/remoteRun/output.d.ts.map +1 -0
- package/dist/remoteRun/output.js +127 -0
- package/dist/remoteRun/output.js.map +1 -0
- package/dist/remoteRun/pairedRunners.d.ts +51 -0
- package/dist/remoteRun/pairedRunners.d.ts.map +1 -0
- package/dist/remoteRun/pairedRunners.js +165 -0
- package/dist/remoteRun/pairedRunners.js.map +1 -0
- package/dist/remoteRun/pathPatterns.d.ts +33 -0
- package/dist/remoteRun/pathPatterns.d.ts.map +1 -0
- package/dist/remoteRun/pathPatterns.js +115 -0
- package/dist/remoteRun/pathPatterns.js.map +1 -0
- package/dist/remoteRun/probe.d.ts +78 -0
- package/dist/remoteRun/probe.d.ts.map +1 -0
- package/dist/remoteRun/probe.js +157 -0
- package/dist/remoteRun/probe.js.map +1 -0
- package/dist/remoteRun/project.d.ts +26 -0
- package/dist/remoteRun/project.d.ts.map +1 -0
- package/dist/remoteRun/project.js +159 -0
- package/dist/remoteRun/project.js.map +1 -0
- package/dist/remoteRun/projectConfig.d.ts +38 -0
- package/dist/remoteRun/projectConfig.d.ts.map +1 -0
- package/dist/remoteRun/projectConfig.js +87 -0
- package/dist/remoteRun/projectConfig.js.map +1 -0
- package/dist/remoteRun/remoteRunCli.d.ts +22 -0
- package/dist/remoteRun/remoteRunCli.d.ts.map +1 -0
- package/dist/remoteRun/remoteRunCli.js +119 -0
- package/dist/remoteRun/remoteRunCli.js.map +1 -0
- package/dist/remoteRun/remoteRunError.d.ts +14 -0
- package/dist/remoteRun/remoteRunError.d.ts.map +1 -0
- package/dist/remoteRun/remoteRunError.js +28 -0
- package/dist/remoteRun/remoteRunError.js.map +1 -0
- package/dist/remoteRun/rsync.d.ts +17 -0
- package/dist/remoteRun/rsync.d.ts.map +1 -0
- package/dist/remoteRun/rsync.js +39 -0
- package/dist/remoteRun/rsync.js.map +1 -0
- package/dist/remoteRun/runnerClient.d.ts +52 -0
- package/dist/remoteRun/runnerClient.d.ts.map +1 -0
- package/dist/remoteRun/runnerClient.js +143 -0
- package/dist/remoteRun/runnerClient.js.map +1 -0
- package/dist/remoteRun/runnerSummary.d.ts +24 -0
- package/dist/remoteRun/runnerSummary.d.ts.map +1 -0
- package/dist/remoteRun/runnerSummary.js +86 -0
- package/dist/remoteRun/runnerSummary.js.map +1 -0
- package/dist/remoteRun/runnerWait.d.ts +68 -0
- package/dist/remoteRun/runnerWait.d.ts.map +1 -0
- package/dist/remoteRun/runnerWait.js +137 -0
- package/dist/remoteRun/runnerWait.js.map +1 -0
- package/dist/remoteRun/runnerWaitTiming.d.ts +16 -0
- package/dist/remoteRun/runnerWaitTiming.d.ts.map +1 -0
- package/dist/remoteRun/runnerWaitTiming.js +37 -0
- package/dist/remoteRun/runnerWaitTiming.js.map +1 -0
- package/dist/remoteRun/runners.d.ts +57 -0
- package/dist/remoteRun/runners.d.ts.map +1 -0
- package/dist/remoteRun/runners.js +209 -0
- package/dist/remoteRun/runners.js.map +1 -0
- package/dist/remoteRun/runnersCatalog.d.ts +14 -0
- package/dist/remoteRun/runnersCatalog.d.ts.map +1 -0
- package/dist/remoteRun/runnersCatalog.js +68 -0
- package/dist/remoteRun/runnersCatalog.js.map +1 -0
- package/dist/remoteRun/runnersConfig.d.ts +53 -0
- package/dist/remoteRun/runnersConfig.d.ts.map +1 -0
- package/dist/remoteRun/runnersConfig.js +109 -0
- package/dist/remoteRun/runnersConfig.js.map +1 -0
- package/dist/remoteRun/safeCopy.d.ts +31 -0
- package/dist/remoteRun/safeCopy.d.ts.map +1 -0
- package/dist/remoteRun/safeCopy.js +137 -0
- package/dist/remoteRun/safeCopy.js.map +1 -0
- package/dist/remoteRun/sendPlan.d.ts +67 -0
- package/dist/remoteRun/sendPlan.d.ts.map +1 -0
- package/dist/remoteRun/sendPlan.js +139 -0
- package/dist/remoteRun/sendPlan.js.map +1 -0
- package/dist/remoteRun/ssh.d.ts +82 -0
- package/dist/remoteRun/ssh.d.ts.map +1 -0
- package/dist/remoteRun/ssh.js +236 -0
- package/dist/remoteRun/ssh.js.map +1 -0
- package/dist/remoteRun/submit.d.ts +29 -0
- package/dist/remoteRun/submit.d.ts.map +1 -0
- package/dist/remoteRun/submit.js +142 -0
- package/dist/remoteRun/submit.js.map +1 -0
- package/dist/requests/answerRequest.d.ts +5 -0
- package/dist/requests/answerRequest.d.ts.map +1 -1
- package/dist/requests/answerRequest.js +16 -1
- package/dist/requests/answerRequest.js.map +1 -1
- package/dist/requests/requestLedger.d.ts +13 -0
- package/dist/requests/requestLedger.d.ts.map +1 -1
- package/dist/requests/requestLedger.js +9 -0
- package/dist/requests/requestLedger.js.map +1 -1
- package/dist/requests/topicRequestSettle.d.ts +30 -0
- package/dist/requests/topicRequestSettle.d.ts.map +1 -0
- package/dist/requests/topicRequestSettle.js +23 -0
- package/dist/requests/topicRequestSettle.js.map +1 -0
- package/dist/requests/wakeUpEngine.d.ts +4 -0
- package/dist/requests/wakeUpEngine.d.ts.map +1 -1
- package/dist/requests/wakeUpEngine.js +5 -1
- package/dist/requests/wakeUpEngine.js.map +1 -1
- package/dist/runnerUtility/adminCheck.d.ts +11 -0
- package/dist/runnerUtility/adminCheck.d.ts.map +1 -0
- package/dist/runnerUtility/adminCheck.js +68 -0
- package/dist/runnerUtility/adminCheck.js.map +1 -0
- package/dist/runnerUtility/appInstall.d.ts +25 -0
- package/dist/runnerUtility/appInstall.d.ts.map +1 -0
- package/dist/runnerUtility/appInstall.js +147 -0
- package/dist/runnerUtility/appInstall.js.map +1 -0
- package/dist/runnerUtility/appUpdate.d.ts +39 -0
- package/dist/runnerUtility/appUpdate.d.ts.map +1 -0
- package/dist/runnerUtility/appUpdate.js +90 -0
- package/dist/runnerUtility/appUpdate.js.map +1 -0
- package/dist/runnerUtility/execEnv.d.ts +21 -0
- package/dist/runnerUtility/execEnv.d.ts.map +1 -0
- package/dist/runnerUtility/execEnv.js +109 -0
- package/dist/runnerUtility/execEnv.js.map +1 -0
- package/dist/runnerUtility/execSession.d.ts +13 -0
- package/dist/runnerUtility/execSession.d.ts.map +1 -0
- package/dist/runnerUtility/execSession.js +58 -0
- package/dist/runnerUtility/execSession.js.map +1 -0
- package/dist/runnerUtility/hubClient.d.ts +30 -0
- package/dist/runnerUtility/hubClient.d.ts.map +1 -0
- package/dist/runnerUtility/hubClient.js +127 -0
- package/dist/runnerUtility/hubClient.js.map +1 -0
- package/dist/runnerUtility/injectStream.d.ts +9 -0
- package/dist/runnerUtility/injectStream.d.ts.map +1 -0
- package/dist/runnerUtility/injectStream.js +12 -0
- package/dist/runnerUtility/injectStream.js.map +1 -0
- package/dist/runnerUtility/iosCheck.d.ts +62 -0
- package/dist/runnerUtility/iosCheck.d.ts.map +1 -0
- package/dist/runnerUtility/iosCheck.js +200 -0
- package/dist/runnerUtility/iosCheck.js.map +1 -0
- package/dist/runnerUtility/launcher.d.ts +5 -0
- package/dist/runnerUtility/launcher.d.ts.map +1 -0
- package/dist/runnerUtility/launcher.js +85 -0
- package/dist/runnerUtility/launcher.js.map +1 -0
- package/dist/runnerUtility/linkLoop.d.ts +47 -0
- package/dist/runnerUtility/linkLoop.d.ts.map +1 -0
- package/dist/runnerUtility/linkLoop.js +281 -0
- package/dist/runnerUtility/linkLoop.js.map +1 -0
- package/dist/runnerUtility/localLinkStop.d.ts +23 -0
- package/dist/runnerUtility/localLinkStop.d.ts.map +1 -0
- package/dist/runnerUtility/localLinkStop.js +79 -0
- package/dist/runnerUtility/localLinkStop.js.map +1 -0
- package/dist/runnerUtility/machineReport.d.ts +39 -0
- package/dist/runnerUtility/machineReport.d.ts.map +1 -0
- package/dist/runnerUtility/machineReport.js +161 -0
- package/dist/runnerUtility/machineReport.js.map +1 -0
- package/dist/runnerUtility/packageId.d.ts +5 -0
- package/dist/runnerUtility/packageId.d.ts.map +1 -0
- package/dist/runnerUtility/packageId.js +64 -0
- package/dist/runnerUtility/packageId.js.map +1 -0
- package/dist/runnerUtility/pairingRecovery.d.ts +31 -0
- package/dist/runnerUtility/pairingRecovery.d.ts.map +1 -0
- package/dist/runnerUtility/pairingRecovery.js +24 -0
- package/dist/runnerUtility/pairingRecovery.js.map +1 -0
- package/dist/runnerUtility/pueueDaemon.d.ts +36 -0
- package/dist/runnerUtility/pueueDaemon.d.ts.map +1 -0
- package/dist/runnerUtility/pueueDaemon.js +165 -0
- package/dist/runnerUtility/pueueDaemon.js.map +1 -0
- package/dist/runnerUtility/runnerCli.d.ts +18 -0
- package/dist/runnerUtility/runnerCli.d.ts.map +1 -0
- package/dist/runnerUtility/runnerCli.js +184 -0
- package/dist/runnerUtility/runnerCli.js.map +1 -0
- package/dist/runnerUtility/runnerCommands.d.ts +67 -0
- package/dist/runnerUtility/runnerCommands.d.ts.map +1 -0
- package/dist/runnerUtility/runnerCommands.js +418 -0
- package/dist/runnerUtility/runnerCommands.js.map +1 -0
- package/dist/runnerUtility/runnerConfig.d.ts +63 -0
- package/dist/runnerUtility/runnerConfig.d.ts.map +1 -0
- package/dist/runnerUtility/runnerConfig.js +153 -0
- package/dist/runnerUtility/runnerConfig.js.map +1 -0
- package/dist/runnerUtility/runnerFlags.d.ts +9 -0
- package/dist/runnerUtility/runnerFlags.d.ts.map +1 -0
- package/dist/runnerUtility/runnerFlags.js +53 -0
- package/dist/runnerUtility/runnerFlags.js.map +1 -0
- package/dist/runnerUtility/runnerHome.d.ts +30 -0
- package/dist/runnerUtility/runnerHome.d.ts.map +1 -0
- package/dist/runnerUtility/runnerHome.js +82 -0
- package/dist/runnerUtility/runnerHome.js.map +1 -0
- package/dist/runnerUtility/runnerKeys.d.ts +11 -0
- package/dist/runnerUtility/runnerKeys.d.ts.map +1 -0
- package/dist/runnerUtility/runnerKeys.js +80 -0
- package/dist/runnerUtility/runnerKeys.js.map +1 -0
- package/dist/runnerUtility/runnerServers.d.ts +40 -0
- package/dist/runnerUtility/runnerServers.d.ts.map +1 -0
- package/dist/runnerUtility/runnerServers.js +79 -0
- package/dist/runnerUtility/runnerServers.js.map +1 -0
- package/dist/runnerUtility/serviceManager.d.ts +54 -0
- package/dist/runnerUtility/serviceManager.d.ts.map +1 -0
- package/dist/runnerUtility/serviceManager.js +413 -0
- package/dist/runnerUtility/serviceManager.js.map +1 -0
- package/dist/runnerUtility/serviceUnits.d.ts +36 -0
- package/dist/runnerUtility/serviceUnits.d.ts.map +1 -0
- package/dist/runnerUtility/serviceUnits.js +169 -0
- package/dist/runnerUtility/serviceUnits.js.map +1 -0
- package/dist/runnerUtility/toolInstall.d.ts +95 -0
- package/dist/runnerUtility/toolInstall.d.ts.map +1 -0
- package/dist/runnerUtility/toolInstall.js +232 -0
- package/dist/runnerUtility/toolInstall.js.map +1 -0
- package/dist/runnerUtility/versionPollTiming.d.ts +16 -0
- package/dist/runnerUtility/versionPollTiming.d.ts.map +1 -0
- package/dist/runnerUtility/versionPollTiming.js +36 -0
- package/dist/runnerUtility/versionPollTiming.js.map +1 -0
- package/dist/runners/authorizedKeys.d.ts +52 -0
- package/dist/runners/authorizedKeys.d.ts.map +1 -0
- package/dist/runners/authorizedKeys.js +153 -0
- package/dist/runners/authorizedKeys.js.map +1 -0
- package/dist/runners/bootstrapLine.d.ts +4 -0
- package/dist/runners/bootstrapLine.d.ts.map +1 -0
- package/dist/runners/bootstrapLine.js +69 -0
- package/dist/runners/bootstrapLine.js.map +1 -0
- package/dist/runners/gate.d.ts +41 -0
- package/dist/runners/gate.d.ts.map +1 -0
- package/dist/runners/gate.js +216 -0
- package/dist/runners/gate.js.map +1 -0
- package/dist/runners/gateLink.d.ts +26 -0
- package/dist/runners/gateLink.d.ts.map +1 -0
- package/dist/runners/gateLink.js +240 -0
- package/dist/runners/gateLink.js.map +1 -0
- package/dist/runners/gateProtocol.d.ts +98 -0
- package/dist/runners/gateProtocol.d.ts.map +1 -0
- package/dist/runners/gateProtocol.js +149 -0
- package/dist/runners/gateProtocol.js.map +1 -0
- package/dist/runners/gateWrapper.d.ts +6 -0
- package/dist/runners/gateWrapper.d.ts.map +1 -0
- package/dist/runners/gateWrapper.js +70 -0
- package/dist/runners/gateWrapper.js.map +1 -0
- package/dist/runners/hubAddress.d.ts +33 -0
- package/dist/runners/hubAddress.d.ts.map +1 -0
- package/dist/runners/hubAddress.js +88 -0
- package/dist/runners/hubAddress.js.map +1 -0
- package/dist/runners/hubAddressCandidates.d.ts +16 -0
- package/dist/runners/hubAddressCandidates.d.ts.map +1 -0
- package/dist/runners/hubAddressCandidates.js +96 -0
- package/dist/runners/hubAddressCandidates.js.map +1 -0
- package/dist/runners/hubIds.d.ts +16 -0
- package/dist/runners/hubIds.d.ts.map +1 -0
- package/dist/runners/hubIds.js +25 -0
- package/dist/runners/hubIds.js.map +1 -0
- package/dist/runners/hubKey.d.ts +6 -0
- package/dist/runners/hubKey.d.ts.map +1 -0
- package/dist/runners/hubKey.js +78 -0
- package/dist/runners/hubKey.js.map +1 -0
- package/dist/runners/hubLock.d.ts +7 -0
- package/dist/runners/hubLock.d.ts.map +1 -0
- package/dist/runners/hubLock.js +230 -0
- package/dist/runners/hubLock.js.map +1 -0
- package/dist/runners/hubPackage.d.ts +23 -0
- package/dist/runners/hubPackage.d.ts.map +1 -0
- package/dist/runners/hubPackage.js +184 -0
- package/dist/runners/hubPackage.js.map +1 -0
- package/dist/runners/hubPairing.d.ts +63 -0
- package/dist/runners/hubPairing.d.ts.map +1 -0
- package/dist/runners/hubPairing.js +261 -0
- package/dist/runners/hubPairing.js.map +1 -0
- package/dist/runners/hubPaths.d.ts +38 -0
- package/dist/runners/hubPaths.d.ts.map +1 -0
- package/dist/runners/hubPaths.js +94 -0
- package/dist/runners/hubPaths.js.map +1 -0
- package/dist/runners/hubRegistry.d.ts +112 -0
- package/dist/runners/hubRegistry.d.ts.map +1 -0
- package/dist/runners/hubRegistry.js +210 -0
- package/dist/runners/hubRegistry.js.map +1 -0
- package/dist/runners/linkControl.d.ts +27 -0
- package/dist/runners/linkControl.d.ts.map +1 -0
- package/dist/runners/linkControl.js +124 -0
- package/dist/runners/linkControl.js.map +1 -0
- package/dist/runners/pairCode.d.ts +30 -0
- package/dist/runners/pairCode.d.ts.map +1 -0
- package/dist/runners/pairCode.js +46 -0
- package/dist/runners/pairCode.js.map +1 -0
- package/dist/runners/pairingTiming.d.ts +18 -0
- package/dist/runners/pairingTiming.d.ts.map +1 -0
- package/dist/runners/pairingTiming.js +42 -0
- package/dist/runners/pairingTiming.js.map +1 -0
- package/dist/runners/runnerProxy.d.ts +9 -0
- package/dist/runners/runnerProxy.d.ts.map +1 -0
- package/dist/runners/runnerProxy.js +67 -0
- package/dist/runners/runnerProxy.js.map +1 -0
- package/dist/runners/runnerRemoval.d.ts +21 -0
- package/dist/runners/runnerRemoval.d.ts.map +1 -0
- package/dist/runners/runnerRemoval.js +82 -0
- package/dist/runners/runnerRemoval.js.map +1 -0
- package/dist/runners/runnersCli.d.ts +16 -0
- package/dist/runners/runnersCli.d.ts.map +1 -0
- package/dist/runners/runnersCli.js +214 -0
- package/dist/runners/runnersCli.js.map +1 -0
- package/dist/runners/runnersList.d.ts +17 -0
- package/dist/runners/runnersList.d.ts.map +1 -0
- package/dist/runners/runnersList.js +49 -0
- package/dist/runners/runnersList.js.map +1 -0
- package/dist/runners/runnersOverview.d.ts +20 -0
- package/dist/runners/runnersOverview.d.ts.map +1 -0
- package/dist/runners/runnersOverview.js +55 -0
- package/dist/runners/runnersOverview.js.map +1 -0
- package/dist/runners/sshKeys.d.ts +26 -0
- package/dist/runners/sshKeys.d.ts.map +1 -0
- package/dist/runners/sshKeys.js +60 -0
- package/dist/runners/sshKeys.js.map +1 -0
- package/dist/runners/tarArchive.d.ts +20 -0
- package/dist/runners/tarArchive.d.ts.map +1 -0
- package/dist/runners/tarArchive.js +70 -0
- package/dist/runners/tarArchive.js.map +1 -0
- package/dist/scheduler/delivery.d.ts +2 -0
- package/dist/scheduler/delivery.d.ts.map +1 -1
- package/dist/scheduler/delivery.js +8 -4
- package/dist/scheduler/delivery.js.map +1 -1
- package/dist/scheduler/mcpSurface.d.ts +65 -10
- package/dist/scheduler/mcpSurface.d.ts.map +1 -1
- package/dist/scheduler/mcpSurface.js +319 -89
- package/dist/scheduler/mcpSurface.js.map +1 -1
- package/dist/scheduler/recurrence.d.ts +5 -0
- package/dist/scheduler/recurrence.d.ts.map +1 -1
- package/dist/scheduler/recurrence.js +12 -2
- package/dist/scheduler/recurrence.js.map +1 -1
- package/dist/scheduler/strictToolInput.d.ts +45 -0
- package/dist/scheduler/strictToolInput.d.ts.map +1 -0
- package/dist/scheduler/strictToolInput.js +155 -0
- package/dist/scheduler/strictToolInput.js.map +1 -0
- package/dist/scheduler/types.d.ts +5 -0
- package/dist/scheduler/types.d.ts.map +1 -1
- package/dist/scheduler/workerWatch.d.ts +23 -0
- package/dist/scheduler/workerWatch.d.ts.map +1 -0
- package/dist/scheduler/workerWatch.js +26 -0
- package/dist/scheduler/workerWatch.js.map +1 -0
- package/dist/selfUpdate/emittedSource.d.ts +11 -0
- package/dist/selfUpdate/emittedSource.d.ts.map +1 -0
- package/dist/selfUpdate/emittedSource.js +24 -0
- package/dist/selfUpdate/emittedSource.js.map +1 -0
- package/dist/selfUpdate/gitSource.d.ts +0 -6
- package/dist/selfUpdate/gitSource.d.ts.map +1 -1
- package/dist/selfUpdate/gitSource.js +2 -18
- package/dist/selfUpdate/gitSource.js.map +1 -1
- package/dist/selfUpdate/selfCheck.js +2 -2
- package/dist/selfUpdate/selfCheck.js.map +1 -1
- package/dist/selfUpdate/updatePending.d.ts +1 -1
- package/dist/sendErrorClassifier.d.ts +10 -0
- package/dist/sendErrorClassifier.d.ts.map +1 -1
- package/dist/sendErrorClassifier.js +22 -0
- package/dist/sendErrorClassifier.js.map +1 -1
- package/dist/state.d.ts +78 -7
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +125 -8
- package/dist/state.js.map +1 -1
- package/dist/stateFile.d.ts +9 -0
- package/dist/stateFile.d.ts.map +1 -0
- package/dist/stateFile.js +57 -0
- package/dist/stateFile.js.map +1 -0
- package/dist/stt/sttInstall.d.ts +7 -3
- package/dist/stt/sttInstall.d.ts.map +1 -1
- package/dist/stt/sttInstall.js +8 -4
- package/dist/stt/sttInstall.js.map +1 -1
- package/dist/stt/sttSettings.d.ts +2 -1
- package/dist/stt/sttSettings.d.ts.map +1 -1
- package/dist/stt/sttSettings.js +3 -2
- package/dist/stt/sttSettings.js.map +1 -1
- package/dist/stt/transcribeChain.js +2 -0
- package/dist/stt/transcribeChain.js.map +1 -1
- package/dist/testTimings.d.ts +16 -3
- package/dist/testTimings.d.ts.map +1 -1
- package/dist/testTimings.js +35 -2
- package/dist/testTimings.js.map +1 -1
- package/dist/todos/board.d.ts +83 -0
- package/dist/todos/board.d.ts.map +1 -0
- package/dist/todos/board.js +227 -0
- package/dist/todos/board.js.map +1 -0
- package/dist/todos/format.d.ts +33 -0
- package/dist/todos/format.d.ts.map +1 -0
- package/dist/todos/format.js +90 -0
- package/dist/todos/format.js.map +1 -0
- package/dist/todos/merge.d.ts +46 -0
- package/dist/todos/merge.d.ts.map +1 -0
- package/dist/todos/merge.js +137 -0
- package/dist/todos/merge.js.map +1 -0
- package/dist/todos/midTurn.d.ts +75 -0
- package/dist/todos/midTurn.d.ts.map +1 -0
- package/dist/todos/midTurn.js +214 -0
- package/dist/todos/midTurn.js.map +1 -0
- package/dist/todos/nag.d.ts +85 -0
- package/dist/todos/nag.d.ts.map +1 -0
- package/dist/todos/nag.js +103 -0
- package/dist/todos/nag.js.map +1 -0
- package/dist/todos/order.d.ts +25 -0
- package/dist/todos/order.d.ts.map +1 -0
- package/dist/todos/order.js +61 -0
- package/dist/todos/order.js.map +1 -0
- package/dist/todos/projects.d.ts +102 -0
- package/dist/todos/projects.d.ts.map +1 -0
- package/dist/todos/projects.js +342 -0
- package/dist/todos/projects.js.map +1 -0
- package/dist/todos/registry.d.ts +64 -0
- package/dist/todos/registry.d.ts.map +1 -0
- package/dist/todos/registry.js +116 -0
- package/dist/todos/registry.js.map +1 -0
- package/dist/todos/reminderEngine.d.ts +78 -0
- package/dist/todos/reminderEngine.d.ts.map +1 -0
- package/dist/todos/reminderEngine.js +162 -0
- package/dist/todos/reminderEngine.js.map +1 -0
- package/dist/todos/store.d.ts +34 -0
- package/dist/todos/store.d.ts.map +1 -0
- package/dist/todos/store.js +208 -0
- package/dist/todos/store.js.map +1 -0
- package/dist/todos/tools.d.ts +26 -0
- package/dist/todos/tools.d.ts.map +1 -0
- package/dist/todos/tools.js +25 -0
- package/dist/todos/tools.js.map +1 -0
- package/dist/todos/types.d.ts +85 -0
- package/dist/todos/types.d.ts.map +1 -0
- package/dist/todos/types.js +30 -0
- package/dist/todos/types.js.map +1 -0
- package/dist/trackers/taskAgentLimit.d.ts +58 -0
- package/dist/trackers/taskAgentLimit.d.ts.map +1 -0
- package/dist/trackers/taskAgentLimit.js +62 -0
- package/dist/trackers/taskAgentLimit.js.map +1 -0
- package/dist/trackers/taskAgentSlots.d.ts +109 -0
- package/dist/trackers/taskAgentSlots.d.ts.map +1 -0
- package/dist/trackers/taskAgentSlots.js +227 -0
- package/dist/trackers/taskAgentSlots.js.map +1 -0
- package/dist/trackers/types.d.ts +14 -0
- package/dist/trackers/types.d.ts.map +1 -0
- package/dist/trackers/types.js +3 -0
- package/dist/trackers/types.js.map +1 -0
- package/dist/types.d.ts +80 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/adoptReplayGate.d.ts +16 -0
- package/dist/utils/adoptReplayGate.d.ts.map +1 -0
- package/dist/utils/adoptReplayGate.js +35 -0
- package/dist/utils/adoptReplayGate.js.map +1 -0
- package/dist/utils/agentEnvironment.d.ts +6 -2
- package/dist/utils/agentEnvironment.d.ts.map +1 -1
- package/dist/utils/agentEnvironment.js +13 -2
- package/dist/utils/agentEnvironment.js.map +1 -1
- package/dist/utils/agentPlugin.d.ts +113 -0
- package/dist/utils/agentPlugin.d.ts.map +1 -0
- package/dist/utils/agentPlugin.js +192 -0
- package/dist/utils/agentPlugin.js.map +1 -0
- package/dist/utils/autoContinueOnLimit.d.ts +7 -4
- package/dist/utils/autoContinueOnLimit.d.ts.map +1 -1
- package/dist/utils/autoContinueOnLimit.js +8 -5
- package/dist/utils/autoContinueOnLimit.js.map +1 -1
- package/dist/utils/botSkills.d.ts +62 -0
- package/dist/utils/botSkills.d.ts.map +1 -0
- package/dist/utils/botSkills.js +53 -0
- package/dist/utils/botSkills.js.map +1 -0
- package/dist/utils/botSkillsSetting.d.ts +7 -0
- package/dist/utils/botSkillsSetting.d.ts.map +1 -0
- package/dist/utils/botSkillsSetting.js +9 -0
- package/dist/utils/botSkillsSetting.js.map +1 -0
- package/dist/utils/claudeCodeVersion.d.ts +7 -0
- package/dist/utils/claudeCodeVersion.d.ts.map +1 -1
- package/dist/utils/claudeCodeVersion.js +14 -1
- package/dist/utils/claudeCodeVersion.js.map +1 -1
- package/dist/utils/claudeCompactHook.d.ts +33 -15
- package/dist/utils/claudeCompactHook.d.ts.map +1 -1
- package/dist/utils/claudeCompactHook.js +36 -17
- package/dist/utils/claudeCompactHook.js.map +1 -1
- package/dist/utils/claudeCompactSummary.d.ts +15 -0
- package/dist/utils/claudeCompactSummary.d.ts.map +1 -0
- package/dist/utils/claudeCompactSummary.js +96 -0
- package/dist/utils/claudeCompactSummary.js.map +1 -0
- package/dist/utils/claudeLimitSwitch.d.ts +11 -9
- package/dist/utils/claudeLimitSwitch.d.ts.map +1 -1
- package/dist/utils/claudeLimitSwitch.js +18 -16
- package/dist/utils/claudeLimitSwitch.js.map +1 -1
- package/dist/utils/claudeProfiles.d.ts +5 -0
- package/dist/utils/claudeProfiles.d.ts.map +1 -1
- package/dist/utils/claudeProfiles.js +14 -0
- package/dist/utils/claudeProfiles.js.map +1 -1
- package/dist/utils/claudeSessionTitle.d.ts +2 -1
- package/dist/utils/claudeSessionTitle.d.ts.map +1 -1
- package/dist/utils/claudeSessionTitle.js +14 -14
- package/dist/utils/claudeSessionTitle.js.map +1 -1
- package/dist/utils/claudeUsage.d.ts +95 -15
- package/dist/utils/claudeUsage.d.ts.map +1 -1
- package/dist/utils/claudeUsage.js +241 -41
- package/dist/utils/claudeUsage.js.map +1 -1
- package/dist/utils/claudeUsageRefresher.d.ts +10 -0
- package/dist/utils/claudeUsageRefresher.d.ts.map +1 -1
- package/dist/utils/claudeUsageRefresher.js +11 -0
- package/dist/utils/claudeUsageRefresher.js.map +1 -1
- package/dist/utils/claudeUserEntry.d.ts +50 -0
- package/dist/utils/claudeUserEntry.d.ts.map +1 -0
- package/dist/utils/claudeUserEntry.js +120 -0
- package/dist/utils/claudeUserEntry.js.map +1 -0
- package/dist/utils/clearThreadOutputQueues.d.ts +4 -3
- package/dist/utils/clearThreadOutputQueues.d.ts.map +1 -1
- package/dist/utils/clearThreadOutputQueues.js +1 -1
- package/dist/utils/clearThreadOutputQueues.js.map +1 -1
- package/dist/utils/compactOnIdle.d.ts +33 -13
- package/dist/utils/compactOnIdle.d.ts.map +1 -1
- package/dist/utils/compactOnIdle.js +35 -15
- package/dist/utils/compactOnIdle.js.map +1 -1
- package/dist/utils/fallbackBridge.d.ts +5 -0
- package/dist/utils/fallbackBridge.d.ts.map +1 -1
- package/dist/utils/fallbackBridge.js +19 -3
- package/dist/utils/fallbackBridge.js.map +1 -1
- package/dist/utils/fallbackChain.d.ts +9 -3
- package/dist/utils/fallbackChain.d.ts.map +1 -1
- package/dist/utils/fallbackChain.js +21 -3
- package/dist/utils/fallbackChain.js.map +1 -1
- package/dist/utils/fileSendPlan.d.ts +6 -0
- package/dist/utils/fileSendPlan.d.ts.map +1 -1
- package/dist/utils/fileSendPlan.js +11 -0
- package/dist/utils/fileSendPlan.js.map +1 -1
- package/dist/utils/fileSendService.d.ts +7 -1
- package/dist/utils/fileSendService.d.ts.map +1 -1
- package/dist/utils/fileSendService.js +6 -2
- package/dist/utils/fileSendService.js.map +1 -1
- package/dist/utils/groupFinalizePlan.d.ts +8 -10
- package/dist/utils/groupFinalizePlan.d.ts.map +1 -1
- package/dist/utils/groupFinalizePlan.js +8 -12
- package/dist/utils/groupFinalizePlan.js.map +1 -1
- package/dist/utils/jsonStreamHost.d.ts +13 -0
- package/dist/utils/jsonStreamHost.d.ts.map +1 -1
- package/dist/utils/jsonStreamHost.js +13 -0
- package/dist/utils/jsonStreamHost.js.map +1 -1
- package/dist/utils/messageSendService.d.ts +5 -3
- package/dist/utils/messageSendService.d.ts.map +1 -1
- package/dist/utils/messageSendService.js +12 -5
- package/dist/utils/messageSendService.js.map +1 -1
- package/dist/utils/openCodeCompactPlugin.d.ts +39 -14
- package/dist/utils/openCodeCompactPlugin.d.ts.map +1 -1
- package/dist/utils/openCodeCompactPlugin.js +106 -38
- package/dist/utils/openCodeCompactPlugin.js.map +1 -1
- package/dist/utils/promptDelivery.d.ts +29 -12
- package/dist/utils/promptDelivery.d.ts.map +1 -1
- package/dist/utils/promptDelivery.js +13 -5
- package/dist/utils/promptDelivery.js.map +1 -1
- package/dist/utils/runnersScreenPlan.d.ts +130 -0
- package/dist/utils/runnersScreenPlan.d.ts.map +1 -0
- package/dist/utils/runnersScreenPlan.js +257 -0
- package/dist/utils/runnersScreenPlan.js.map +1 -0
- package/dist/utils/sentKindsSummary.d.ts +10 -0
- package/dist/utils/sentKindsSummary.d.ts.map +1 -0
- package/dist/utils/sentKindsSummary.js +18 -0
- package/dist/utils/sentKindsSummary.js.map +1 -0
- package/dist/utils/telegramError.d.ts +6 -0
- package/dist/utils/telegramError.d.ts.map +1 -1
- package/dist/utils/telegramError.js +12 -0
- package/dist/utils/telegramError.js.map +1 -1
- package/dist/utils/topicView.d.ts +1 -1
- package/dist/utils/topicView.js +1 -1
- package/dist/utils/transcribeAudio.d.ts +10 -0
- package/dist/utils/transcribeAudio.d.ts.map +1 -1
- package/dist/utils/transcribeAudio.js +22 -3
- package/dist/utils/transcribeAudio.js.map +1 -1
- package/dist/utils/transcriptErrorTime.d.ts +8 -0
- package/dist/utils/transcriptErrorTime.d.ts.map +1 -0
- package/dist/utils/transcriptErrorTime.js +56 -0
- package/dist/utils/transcriptErrorTime.js.map +1 -0
- package/dist/utils/wedgeRecovery.d.ts +2 -0
- package/dist/utils/wedgeRecovery.d.ts.map +1 -1
- package/dist/utils/wedgeRecovery.js +1 -1
- package/dist/utils/wedgeRecovery.js.map +1 -1
- package/package.json +15 -4
- package/remoteRun/runner.sh +1317 -0
- package/stt/gigaam_sidecar.py +555 -50
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.answerReplyToCommentIdsMaxCount = exports.schedulerMcpPendingCancellationMax = exports.schedulerMcpPendingCancellationTtlMs = exports.schedulerMcpBindRetryDelayMs = exports.schedulerMcpBindRetryCount = exports.legacySchedulerMcpClientIdHeader = exports.schedulerMcpClientIdHeader = exports.schedulerMcpPath = exports.defaultSchedulerMcpPort = void 0;
|
|
3
|
+
exports.answerReplyToCommentIdsMaxCount = exports.claudeCodeInstructionsMaxLength = exports.schedulerMcpPendingCancellationMax = exports.schedulerMcpPendingCancellationTtlMs = exports.schedulerMcpBindRetryDelayMs = exports.schedulerMcpBindRetryCount = exports.legacySchedulerMcpClientIdHeader = exports.schedulerMcpClientIdHeader = exports.schedulerMcpPath = exports.defaultSchedulerMcpPort = void 0;
|
|
4
4
|
exports.buildMcpServerInstructions = buildMcpServerInstructions;
|
|
5
5
|
exports.getSchedulerMcpPort = getSchedulerMcpPort;
|
|
6
6
|
exports.resolveSchedulerMcpPort = resolveSchedulerMcpPort;
|
|
@@ -12,6 +12,7 @@ exports.verifySchedulerMcpToken = verifySchedulerMcpToken;
|
|
|
12
12
|
exports.extractBearerToken = extractBearerToken;
|
|
13
13
|
exports.buildBotMcpToolDigest = buildBotMcpToolDigest;
|
|
14
14
|
exports.getBotMcpToolDigest = getBotMcpToolDigest;
|
|
15
|
+
exports.getBotMcpToolDefinitions = getBotMcpToolDefinitions;
|
|
15
16
|
exports.resolveTargetThreadKey = resolveTargetThreadKey;
|
|
16
17
|
exports.buildSpecFromCreateArgs = buildSpecFromCreateArgs;
|
|
17
18
|
exports.checkIsConversationInScope = checkIsConversationInScope;
|
|
@@ -23,17 +24,25 @@ const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
|
23
24
|
const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/server/streamableHttp.js");
|
|
24
25
|
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
25
26
|
const zod_1 = require("zod");
|
|
27
|
+
const adapterNames_1 = require("../adapters/adapterNames");
|
|
26
28
|
const sessionKey_1 = require("../sessionKey");
|
|
29
|
+
const botSkills_1 = require("../utils/botSkills");
|
|
30
|
+
const claudeProfiles_1 = require("../utils/claudeProfiles");
|
|
31
|
+
const claudeUsage_1 = require("../utils/claudeUsage");
|
|
27
32
|
const isoTimestamp_1 = require("../utils/isoTimestamp");
|
|
28
33
|
const messageSendService_1 = require("../utils/messageSendService");
|
|
29
34
|
const utils_1 = require("../utils");
|
|
30
35
|
const checkRun_1 = require("./checkRun");
|
|
31
36
|
const deliveryKind_1 = require("./deliveryKind");
|
|
37
|
+
const workerWatch_1 = require("./workerWatch");
|
|
32
38
|
const recurrence_1 = require("./recurrence");
|
|
39
|
+
const strictToolInput_1 = require("./strictToolInput");
|
|
33
40
|
const store_1 = require("./store");
|
|
34
41
|
const legacyNames_1 = require("../legacyNames");
|
|
35
42
|
const answerRequest_1 = require("../requests/answerRequest");
|
|
36
43
|
const answerStyle_1 = require("../requests/answerStyle");
|
|
44
|
+
const registry_1 = require("../todos/registry");
|
|
45
|
+
const types_1 = require("../todos/types");
|
|
37
46
|
/**
|
|
38
47
|
* @description The bot-owned MCP server exposes the agent-facing tools —
|
|
39
48
|
* `schedule_create`, `schedule_list`, `schedule_cancel`, `send_file_to_user`,
|
|
@@ -106,28 +115,82 @@ const schedulerMcpClientIdPattern = /^[A-Za-z0-9._:-]+$/;
|
|
|
106
115
|
/** Server identity reported in the MCP `initialize` handshake. */
|
|
107
116
|
const mcpServerName = 'telegram-bot-scheduler';
|
|
108
117
|
const mcpServerVersion = '1.0.0';
|
|
118
|
+
/** The skill an orchestrating agent loads in a bot session, as each CLI names it. */
|
|
119
|
+
const managerSkillInstruction = 'load the `charness-manager` skill (Claude Code lists it as `charness:charness-manager`) and follow it instead of any other manager skill';
|
|
109
120
|
/** The instruction bullets that hold on every platform (the two platform-neutral tools). */
|
|
110
|
-
const compactConversationInstruction = '• The user EXPLICITLY asks to compact/shrink/summarize this conversation\'s context → compact_conversation.
|
|
111
|
-
const answerRequestInstruction = '• A message carries a "[Request <id> · from: …]" header → answer it through answer_request with that id: kind "final" with the full result at the end of your turn, "question" when you need the requester before you can go on (their reply arrives as a new request), "progress" for an interim note.
|
|
121
|
+
const compactConversationInstruction = '• The user EXPLICITLY asks to compact/shrink/summarize this conversation\'s context → compact_conversation. Never on your own judgement.';
|
|
122
|
+
const answerRequestInstruction = '• A message carries a "[Request <id> · from: …]" header → answer it through answer_request with that id: kind "final" with the full result at the end of your turn, "question" when you need the requester before you can go on (their reply arrives as a new request), "progress" for an interim note. Only question/final close the request. ' +
|
|
112
123
|
answerStyle_1.answerStyleInstruction;
|
|
113
|
-
|
|
114
|
-
const
|
|
124
|
+
/** The shared todo registry's bullet (D7) — Telegram topics and Jira issues publish alike. */
|
|
125
|
+
const todoInstruction = '• BEFORE you start any task (fixes you found yourself included: a failing test, a leak) → todo_update adds it as inWork, naming the area (files, tests). Check the returned board for overlap with other agents. Take the queue top-down; mark items done / dropped at once. A ticket you create in a tracker gets an item with its key in `ref`.';
|
|
126
|
+
/** The `charness remote-run` bullet — present only while a runner is paired or listed in `runners.json`, for Telegram topics and tracker issues alike. The CLI's own `--help` has the job commands. */
|
|
127
|
+
const remoteRunInstruction = '• Heavy work (test suite, build, e2e run) → send it to a runner, not this machine: `charness remote-run runners` lists them and what each can do; `charness remote-run [--needs android|ios|docker|playwright] <command>` runs it in a copy of this project and returns its output and exit code (edit files only here). Longer than your tool timeout: `charness remote-run --bg <command>`, then `charness remote-run wait <id>` in the background; `charness remote-run --help` lists the rest.';
|
|
128
|
+
/**
|
|
129
|
+
* Claude Code cuts a server's connect-time `instructions` that are longer than this: whatever comes last is lost, silently. The Telegram
|
|
130
|
+
* text is within a few hundred characters of it before the remote-run bullet, so the runner lines are fitted to the room that is left.
|
|
131
|
+
*/
|
|
132
|
+
exports.claudeCodeInstructionsMaxLength = 4096;
|
|
133
|
+
/**
|
|
134
|
+
* The remote-run bullet with one line per runner under it (`mac — macOS 15.1, android, playwright`: the name, the OS, what it could do when
|
|
135
|
+
* last probed): the first `shownCount` runners, and «… and N more» for the rest. The lines are a snapshot taken at connect; `charness
|
|
136
|
+
* remote-run runners` has the live state. `shownCount` 0 gives the bullet alone.
|
|
137
|
+
*/
|
|
138
|
+
function buildRemoteRunInstruction(runnerLines, shownCount) {
|
|
139
|
+
if (shownCount === 0)
|
|
140
|
+
return remoteRunInstruction;
|
|
141
|
+
const hiddenCount = runnerLines.length - shownCount;
|
|
142
|
+
return [
|
|
143
|
+
remoteRunInstruction,
|
|
144
|
+
' Runners, as last seen:',
|
|
145
|
+
...runnerLines.slice(0, shownCount).map((line) => ` – ${line}`),
|
|
146
|
+
...(hiddenCount > 0 ? [` – … and ${hiddenCount} more`] : []),
|
|
147
|
+
].join('\n');
|
|
148
|
+
}
|
|
149
|
+
const orchestrationInstructionHead = '• You orchestrate detached workers (a `claude -p` / `opencode run` builder, reviewer, researcher) →';
|
|
150
|
+
/** What the worker-watch recipe says once a tool is named: shared by both wordings of the Telegram bullet. */
|
|
151
|
+
const workerWatchRecipeText = `its description has the recipe (checkCommand, cron, \`${workerWatch_1.workerWatchPinArgument}\`); never \`kill -0\` alone: it never fires on a hung worker.`;
|
|
152
|
+
/**
|
|
153
|
+
* The orchestration bullet of a conversation on a tracker, which has no scheduling tools: only the manager-skill hint, so
|
|
154
|
+
* with the bot's skills off (`/bot_skills`) there is nothing left of it and `null` drops it.
|
|
155
|
+
*/
|
|
156
|
+
function buildTrackerOrchestrationInstruction(isBotSkillsEnabled) {
|
|
157
|
+
return isBotSkillsEnabled ? `${orchestrationInstructionHead} ${managerSkillInstruction}.` : null;
|
|
158
|
+
}
|
|
159
|
+
/** The orchestration bullet of a Telegram topic: the manager-skill hint (dropped with the skills off) and the worker-watch recipe, which is a tool fact and stays. */
|
|
160
|
+
function buildTelegramOrchestrationInstruction(isBotSkillsEnabled) {
|
|
161
|
+
return isBotSkillsEnabled
|
|
162
|
+
? `${orchestrationInstructionHead} ${managerSkillInstruction}. Watch EACH worker with schedule_create — ${workerWatchRecipeText}`
|
|
163
|
+
: `${orchestrationInstructionHead} schedule_create to watch EACH worker — ${workerWatchRecipeText}`;
|
|
164
|
+
}
|
|
165
|
+
const claudeProfilesInstruction = '• Before you start or resume a child `claude` process (worker, reviewer, planner) → claude_profiles with the model you will launch, and start the child under the account it names (`CLAUDE_CONFIG_DIR=<configDir>`): without it the child inherits YOUR account and drains the same limits. The tool description has the rest (resuming, `recommended: null`).';
|
|
166
|
+
/** @description Which optional tools `deps` offers. */
|
|
167
|
+
function getOptionalBotTools(deps) {
|
|
168
|
+
return {
|
|
169
|
+
isJiraAttachmentToolOffered: deps.fetchJiraAttachment !== undefined,
|
|
170
|
+
isTodoToolOffered: deps.todos !== undefined,
|
|
171
|
+
remoteRunRunnerLines: deps.getRemoteRunRunnerLines?.() ?? [],
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function buildTelegramInstructions(isTodoToolOffered, remoteRunInstructionText, isBotSkillsEnabled) {
|
|
175
|
+
return `This MCP lets the agent act on its own Telegram topic.
|
|
115
176
|
|
|
116
177
|
When to use it:
|
|
117
|
-
• The user asks to run/finish a plan or task LATER ("in 2h", "tomorrow 9am", "every weekday") → schedule_create. Put the work in \`prompt\`; the future run is a fresh session with no memory of this chat. Not CronCreate / ScheduleWakeup for anything that must happen: they
|
|
118
|
-
• You produced a file/chart/screenshot/video to deliver → send_file_to_user. Videos MUST be H.264 .mp4 sent as video (never as_file/document
|
|
119
|
-
• You want to deliver SEVERAL discrete messages (each
|
|
178
|
+
• The user asks to run/finish a plan or task LATER ("in 2h", "tomorrow 9am", "every weekday") → schedule_create. Put the work in \`prompt\`; the future run is a fresh session with no memory of this chat. Not CronCreate / ScheduleWakeup for anything that must happen: they die with your process, which the bot stops after a long idle stretch.
|
|
179
|
+
• You produced a file/chart/screenshot/video to deliver → send_file_to_user. Videos MUST be H.264 .mp4 sent as video (never as_file/document or .webm/.mov — those render as GIFs or don't play); transcode first if needed (recipe in the tool description).
|
|
180
|
+
• You want to deliver SEVERAL discrete messages (each its own message, e.g. a per-item news digest) → send_messages_to_user; an item may attach ONE file (the text becomes its caption).
|
|
120
181
|
${compactConversationInstruction}
|
|
121
|
-
• You need to review or remove scheduled jobs → schedule_list / schedule_cancel.
|
|
122
|
-
• You need a watchdog — keep an eye on a service,
|
|
123
|
-
${
|
|
124
|
-
${
|
|
182
|
+
${isTodoToolOffered ? `${todoInstruction}\n` : ''}• You need to review or remove scheduled jobs → schedule_list / schedule_cancel.
|
|
183
|
+
• You need a watchdog — keep an eye on a service, build, deploy, disk, URL… → schedule_create with \`checkCommand\` (cron): the bot runs it in this folder, stays silent while it exits 0, and on the first failure pins an alert and wakes you with \`prompt\` + the exit code and output tail. Checks survive restarts and crashes. NEVER build your own watcher (background loop, nohup, sleep loop, tmux pane, shell crontab): it dies with your session or a restart, silently.
|
|
184
|
+
${buildTelegramOrchestrationInstruction(isBotSkillsEnabled)}
|
|
185
|
+
${answerRequestInstruction} The requester may not see your plain text: anything they must read goes through answer_request — yet your plain text is relayed into the topic too, so end the turn WITHOUT a recap of what you answered (it would show twice).
|
|
186
|
+
${claudeProfilesInstruction}${remoteRunInstructionText === null ? '' : `\n${remoteRunInstructionText}`}
|
|
125
187
|
|
|
126
|
-
|
|
188
|
+
Tool descriptions hold the argument recipes.`;
|
|
189
|
+
}
|
|
127
190
|
/** What a Jira session's instructions add: the tool that reaches the issue's original files (C10). */
|
|
128
191
|
const jiraAttachmentInstruction = '• The issue lists a file (an attachment id in the attachments list, or in a placeholder such as "[image: shot.png — attachment 10234]") you need to look at → jira_get_attachment with that id; it saves the original file and returns its path.';
|
|
129
192
|
/** For a conversation on a tracker: the requester sees nothing but the answers; `extraInstructions` name the platform's own tools. */
|
|
130
|
-
function buildTrackerInstructions(extraInstructions) {
|
|
193
|
+
function buildTrackerInstructions(extraInstructions, isBotSkillsEnabled) {
|
|
131
194
|
return `This MCP connects the agent to the conversation that asked for its work.
|
|
132
195
|
|
|
133
196
|
When to use it:
|
|
@@ -136,12 +199,11 @@ ${[
|
|
|
136
199
|
...extraInstructions,
|
|
137
200
|
compactConversationInstruction,
|
|
138
201
|
claudeProfilesInstruction,
|
|
139
|
-
|
|
202
|
+
buildTrackerOrchestrationInstruction(isBotSkillsEnabled),
|
|
203
|
+
].filter((instruction) => instruction !== null).join('\n')}
|
|
140
204
|
|
|
141
205
|
Each tool's own description has the exact argument recipe.`;
|
|
142
206
|
}
|
|
143
|
-
const neutralInstructions = buildTrackerInstructions([]);
|
|
144
|
-
const jiraInstructions = buildTrackerInstructions([jiraAttachmentInstruction]);
|
|
145
207
|
/**
|
|
146
208
|
* Connect-time `instructions` returned in the MCP `initialize` handshake — a
|
|
147
209
|
* short, high-level pointer the client surfaces to the agent BEFORE any call.
|
|
@@ -151,12 +213,33 @@ const jiraInstructions = buildTrackerInstructions([jiraAttachmentInstruction]);
|
|
|
151
213
|
*
|
|
152
214
|
* @description The connect-time instructions for a session of `platform`: only
|
|
153
215
|
* a Telegram session has the scheduling and send-to-topic tools, so only its
|
|
154
|
-
* instructions name them (Jira connector plan J2, D18)
|
|
216
|
+
* instructions name them (Jira connector plan J2, D18); an optional tool is named
|
|
217
|
+
* only where it is offered. With the bot's skills off for the session
|
|
218
|
+
* (`isBotSkillsEnabled`, `/bot_skills`) the orchestration bullet no longer tells it to load `charness-manager`.
|
|
155
219
|
*/
|
|
156
|
-
function buildMcpServerInstructions(platform,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
220
|
+
function buildMcpServerInstructions(platform, offered, isBotSkillsEnabled) {
|
|
221
|
+
const render = (remoteRunInstructionText) => {
|
|
222
|
+
if (platform === 'telegram')
|
|
223
|
+
return buildTelegramInstructions(offered.isTodoToolOffered, remoteRunInstructionText, isBotSkillsEnabled);
|
|
224
|
+
const remoteRunInstructions = remoteRunInstructionText === null ? [] : [remoteRunInstructionText];
|
|
225
|
+
if (platform !== 'jira')
|
|
226
|
+
return buildTrackerInstructions(remoteRunInstructions, isBotSkillsEnabled);
|
|
227
|
+
return buildTrackerInstructions([
|
|
228
|
+
...(offered.isJiraAttachmentToolOffered ? [jiraAttachmentInstruction] : []),
|
|
229
|
+
...(offered.isTodoToolOffered ? [todoInstruction] : []),
|
|
230
|
+
...remoteRunInstructions,
|
|
231
|
+
], isBotSkillsEnabled);
|
|
232
|
+
};
|
|
233
|
+
const runnerCount = offered.remoteRunRunnerLines.length;
|
|
234
|
+
if (runnerCount === 0)
|
|
235
|
+
return render(null);
|
|
236
|
+
// As many runners as the room under Claude Code's cap leaves; the bullet itself always stays (its `runners` command is the full list).
|
|
237
|
+
for (let shownCount = runnerCount; shownCount > 0; shownCount -= 1) {
|
|
238
|
+
const text = render(buildRemoteRunInstruction(offered.remoteRunRunnerLines, shownCount));
|
|
239
|
+
if (text.length <= exports.claudeCodeInstructionsMaxLength)
|
|
240
|
+
return text;
|
|
241
|
+
}
|
|
242
|
+
return render(buildRemoteRunInstruction(offered.remoteRunRunnerLines, 0));
|
|
160
243
|
}
|
|
161
244
|
/** Max characters of a free-text job name / prompt accepted by a tool (defensive bound). */
|
|
162
245
|
const maxNameLength = 200;
|
|
@@ -298,15 +381,22 @@ const digestScope = { kind: 'dir', directory: '' };
|
|
|
298
381
|
* a tool added, renamed, re-described or re-shaped changes it and nothing else
|
|
299
382
|
* has to be kept in step by hand.
|
|
300
383
|
*/
|
|
301
|
-
function getBotMcpToolDigest(deps, platform) {
|
|
384
|
+
function getBotMcpToolDigest(deps, platform, isBotSkillsEnabled) {
|
|
385
|
+
return buildBotMcpToolDigest(buildMcpServerInstructions(platform, getOptionalBotTools(deps), isBotSkillsEnabled), getBotMcpToolDefinitions(deps, platform));
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* @description The tool definitions a session of `platform` gets, recorded from the SAME registration the request
|
|
389
|
+
* path runs (never a handler): what the digest hashes, and what a test reads the tools' names and descriptions from.
|
|
390
|
+
*/
|
|
391
|
+
function getBotMcpToolDefinitions(deps, platform) {
|
|
302
392
|
const definitions = [];
|
|
303
393
|
const recorder = {
|
|
304
394
|
registerTool: (name, config) => {
|
|
305
|
-
definitions.push({ name, title: config.title, description: config.description, inputKeys: Object.keys(config.inputSchema
|
|
395
|
+
definitions.push({ name, title: config.title, description: config.description, inputKeys: Object.keys(config.inputSchema.shape).sort() });
|
|
306
396
|
},
|
|
307
397
|
};
|
|
308
398
|
registerBotTools(recorder, deps, digestScope, platform, undefined);
|
|
309
|
-
return
|
|
399
|
+
return definitions;
|
|
310
400
|
}
|
|
311
401
|
/**
|
|
312
402
|
* @description Resolve the single thread a tool call targets, from its scope and
|
|
@@ -356,6 +446,11 @@ function resolveTargetThreadKey(scope, suppliedThreadKey, getThreadsForDirectory
|
|
|
356
446
|
return { ok: true, threadKey: suppliedThreadKey };
|
|
357
447
|
}
|
|
358
448
|
// ─── tool input schemas + spec building ──────────────────────────────
|
|
449
|
+
/** The optional target thread every topic-scoped tool takes (a `dir:` scope with several bound threads needs it). */
|
|
450
|
+
const threadKeyArgSchema = zod_1.z
|
|
451
|
+
.string()
|
|
452
|
+
.optional()
|
|
453
|
+
.describe('Target thread "<chatId>:<threadId>". Required when a directory scope has more than one bound thread.');
|
|
359
454
|
const scheduleCreateShape = {
|
|
360
455
|
name: zod_1.z.string().min(1).max(maxNameLength).describe('Short human name for the job (shown in announcements/lists).'),
|
|
361
456
|
cron: zod_1.z
|
|
@@ -396,7 +491,7 @@ const scheduleCreateShape = {
|
|
|
396
491
|
'non-zero exit or timeout pins an alert in the topic and wakes you with `prompt` plus the exit ' +
|
|
397
492
|
'code and output tail; later failures stay silent until a run passes again (the topic is told). ' +
|
|
398
493
|
'Keep it a quick probe, e.g. `systemctl --user is-active myapp`, `curl -fsS -m 10 http://127.0.0.1:8080/health`, ' +
|
|
399
|
-
'`test $(df --output=pcent / | tail -1 | tr -dc 0-9) -lt 90
|
|
494
|
+
'`test $(df --output=pcent / | tail -1 | tr -dc 0-9) -lt 90`; a detached worker: the recipe in the tool description.'),
|
|
400
495
|
checkTimeoutSeconds: zod_1.z
|
|
401
496
|
.number()
|
|
402
497
|
.int()
|
|
@@ -409,24 +504,18 @@ const scheduleCreateShape = {
|
|
|
409
504
|
.boolean()
|
|
410
505
|
.optional()
|
|
411
506
|
.describe('Pin the fire announcement silently (no member notification). Default false = notify all.'),
|
|
412
|
-
threadKey:
|
|
413
|
-
.string()
|
|
414
|
-
.optional()
|
|
415
|
-
.describe('Target thread "<chatId>:<threadId>". Required when a directory scope has more than one bound thread.'),
|
|
507
|
+
threadKey: threadKeyArgSchema,
|
|
416
508
|
};
|
|
509
|
+
const scheduleCreateInput = (0, strictToolInput_1.createStrictToolInput)(scheduleCreateShape);
|
|
417
510
|
const scheduleListShape = {
|
|
418
|
-
threadKey:
|
|
419
|
-
.string()
|
|
420
|
-
.optional()
|
|
421
|
-
.describe('Target thread "<chatId>:<threadId>". Required when a directory scope has more than one bound thread.'),
|
|
511
|
+
threadKey: threadKeyArgSchema,
|
|
422
512
|
};
|
|
513
|
+
const scheduleListInput = (0, strictToolInput_1.createStrictToolInput)(scheduleListShape);
|
|
423
514
|
const scheduleCancelShape = {
|
|
424
515
|
id: zod_1.z.string().min(1).describe('The schedule id to cancel (from schedule_list).'),
|
|
425
|
-
threadKey:
|
|
426
|
-
.string()
|
|
427
|
-
.optional()
|
|
428
|
-
.describe('Target thread "<chatId>:<threadId>". Required when a directory scope has more than one bound thread.'),
|
|
516
|
+
threadKey: threadKeyArgSchema,
|
|
429
517
|
};
|
|
518
|
+
const scheduleCancelInput = (0, strictToolInput_1.createStrictToolInput)(scheduleCancelShape);
|
|
430
519
|
/**
|
|
431
520
|
* Coerces an ARRAY tool argument into an actual array before validation. Some
|
|
432
521
|
* MCP bridges (observed: Claude-agent harnesses AND OpenCode) serialize an array
|
|
@@ -466,19 +555,18 @@ const sendFileShape = {
|
|
|
466
555
|
.boolean()
|
|
467
556
|
.optional()
|
|
468
557
|
.describe('Explicitly force sendDocument (original quality, no inline preview), including for MP4s that use sendVideo by default.'),
|
|
469
|
-
threadKey:
|
|
470
|
-
.string()
|
|
471
|
-
.optional()
|
|
472
|
-
.describe('Target thread "<chatId>:<threadId>". Required when a directory scope has more than one bound thread.'),
|
|
558
|
+
threadKey: threadKeyArgSchema,
|
|
473
559
|
};
|
|
560
|
+
const sendFileInput = (0, strictToolInput_1.createStrictToolInput)(sendFileShape);
|
|
474
561
|
/**
|
|
475
562
|
* One batch item: EITHER a plain non-empty string (text-only message,
|
|
476
563
|
* backward-compatible with the original string-array tool) OR an object that may
|
|
477
|
-
* carry a text body, an attachment `path`, or both. The
|
|
478
|
-
*
|
|
564
|
+
* carry a text body, an attachment `path`, or both. The object is CLOSED: an
|
|
565
|
+
* agent that writes `filePath` for `path` must be told, not silently sent as a
|
|
566
|
+
* text-only message. The `.refine` rejects an all-empty object so a stray `{}`
|
|
567
|
+
* never posts nothing.
|
|
479
568
|
*/
|
|
480
|
-
const sendMessageItemObjectSchema =
|
|
481
|
-
.object({
|
|
569
|
+
const sendMessageItemObjectSchema = (0, strictToolInput_1.createStrictToolInput)({
|
|
482
570
|
text: zod_1.z
|
|
483
571
|
.string()
|
|
484
572
|
.optional()
|
|
@@ -494,12 +582,11 @@ const sendMessageItemObjectSchema = zod_1.z
|
|
|
494
582
|
.boolean()
|
|
495
583
|
.optional()
|
|
496
584
|
.describe('Force sendDocument for THIS attachment (original quality, no inline preview), including for MP4s.'),
|
|
497
|
-
})
|
|
498
|
-
.refine((item) => (item.text?.trim().length ?? 0) > 0 || (item.path?.trim().length ?? 0) > 0, { message: 'each message object must set a non-empty text or path' });
|
|
585
|
+
}).refine((item) => (item.text?.trim().length ?? 0) > 0 || (item.path?.trim().length ?? 0) > 0, { message: 'each message object must set a non-empty text or path' });
|
|
499
586
|
const sendMessageShape = {
|
|
500
587
|
messages: zod_1.z
|
|
501
588
|
.preprocess(coerceJsonArrayArg, zod_1.z
|
|
502
|
-
.array(zod_1.z.union([zod_1.z.string().min(1), sendMessageItemObjectSchema]))
|
|
589
|
+
.array(zod_1.z.union([zod_1.z.string().min(1), sendMessageItemObjectSchema], { error: strictToolInput_1.getUnknownKeysMessageOfUnion }))
|
|
503
590
|
.min(1)
|
|
504
591
|
.max(messageSendService_1.maxDiscreteMessages))
|
|
505
592
|
.describe(`1..${messageSendService_1.maxDiscreteMessages} items; EACH item is posted as its OWN separate Telegram message, in order (never ` +
|
|
@@ -512,11 +599,9 @@ const sendMessageShape = {
|
|
|
512
599
|
'Use this when you deliberately want several distinct messages (e.g. a per-item news digest: one message ' +
|
|
513
600
|
'per headline). Do NOT also print the same content as your normal reply, or it posts twice. Text supports ' +
|
|
514
601
|
'the usual markdown (links, bold); an over-long text item is split automatically.'),
|
|
515
|
-
threadKey:
|
|
516
|
-
.string()
|
|
517
|
-
.optional()
|
|
518
|
-
.describe('Target thread "<chatId>:<threadId>". Required when a directory scope has more than one bound thread.'),
|
|
602
|
+
threadKey: threadKeyArgSchema,
|
|
519
603
|
};
|
|
604
|
+
const sendMessageInput = (0, strictToolInput_1.createStrictToolInput)(sendMessageShape);
|
|
520
605
|
/**
|
|
521
606
|
* The three valid call shapes, appended to structural errors so a bad first call
|
|
522
607
|
* teaches the corrected next call (the model spirals when an error says only what
|
|
@@ -629,8 +714,13 @@ function registerSchedulerTools(server, deps, scope) {
|
|
|
629
714
|
'with a cron — the bot runs it in this folder and wakes you only when it starts failing. This is ' +
|
|
630
715
|
'the ONLY reliable watcher: it survives bot restarts and crashes. Never build your own (a ' +
|
|
631
716
|
'background loop, nohup, a sleep loop, a tmux pane, a shell crontab) — it dies with your session ' +
|
|
632
|
-
'or a restart and then fails silently
|
|
633
|
-
|
|
717
|
+
'or a restart and then fails silently.\n\n' +
|
|
718
|
+
`A DETACHED WORKER you launched (a \`claude -p\` / \`opencode run\` process): cron \`${workerWatch_1.workerWatchCheckCron}\`, ` +
|
|
719
|
+
`\`${workerWatch_1.workerWatchPinArgument}\`, checkCommand \`${workerWatch_1.workerWatchCheckCommand}\` with its PID and run dir — it fails when ` +
|
|
720
|
+
'the worker exits OR nothing in its run dir changed for 45 min, so the first failure is also the "worker finished" ' +
|
|
721
|
+
'signal (hence the silent pin: a normal finish must not notify the user). Never `kill -0` alone: it stays green ' +
|
|
722
|
+
'while a worker hangs. One check per worker run; schedule_cancel it once its wake is handled.',
|
|
723
|
+
inputSchema: scheduleCreateInput,
|
|
634
724
|
}, async (args) => {
|
|
635
725
|
const resolved = resolveTargetThreadKey(scope, args.threadKey, deps.getThreadsForDirectory);
|
|
636
726
|
if (!resolved.ok)
|
|
@@ -678,7 +768,7 @@ function registerSchedulerTools(server, deps, scope) {
|
|
|
678
768
|
server.registerTool('schedule_list', {
|
|
679
769
|
title: 'List scheduled prompts',
|
|
680
770
|
description: 'List the scheduled prompts for this topic (id, name, schedule, next run, paused flag).',
|
|
681
|
-
inputSchema:
|
|
771
|
+
inputSchema: scheduleListInput,
|
|
682
772
|
}, async (args) => {
|
|
683
773
|
const resolved = resolveTargetThreadKey(scope, args.threadKey, deps.getThreadsForDirectory);
|
|
684
774
|
if (!resolved.ok)
|
|
@@ -706,8 +796,10 @@ function registerSchedulerTools(server, deps, scope) {
|
|
|
706
796
|
});
|
|
707
797
|
server.registerTool('schedule_cancel', {
|
|
708
798
|
title: 'Cancel a scheduled prompt',
|
|
709
|
-
description: 'Cancel (delete) a scheduled prompt by its id. Only schedules owned by this topic can be cancelled.'
|
|
710
|
-
|
|
799
|
+
description: 'Cancel (delete) a scheduled prompt by its id. Only schedules owned by this topic can be cancelled. Cancelling a ' +
|
|
800
|
+
'watchdog check also unpins the alerts it pinned — cancel a worker watch once its wake is handled, so a finished ' +
|
|
801
|
+
'worker leaves no pinned alert behind.',
|
|
802
|
+
inputSchema: scheduleCancelInput,
|
|
711
803
|
}, async (args) => {
|
|
712
804
|
const resolved = resolveTargetThreadKey(scope, args.threadKey, deps.getThreadsForDirectory);
|
|
713
805
|
if (!resolved.ok)
|
|
@@ -723,7 +815,11 @@ function registerSchedulerTools(server, deps, scope) {
|
|
|
723
815
|
}
|
|
724
816
|
await deps.store.removeSchedule(args.id);
|
|
725
817
|
deps.disarmJob(args.id);
|
|
726
|
-
|
|
818
|
+
const alertPins = record.alertPinMessageIds ?? [];
|
|
819
|
+
if (alertPins.length === 0)
|
|
820
|
+
return textResult(`Cancelled "${record.name}" (id: ${record.id}).`);
|
|
821
|
+
await deps.unpinMessages(record.threadKey, alertPins);
|
|
822
|
+
return textResult(`Cancelled "${record.name}" (id: ${record.id}); its ${alertPins.length} pinned alert(s) unpinned.`);
|
|
727
823
|
});
|
|
728
824
|
}
|
|
729
825
|
/**
|
|
@@ -750,7 +846,7 @@ function registerFileSendTool(server, deps, scope, requestSignal) {
|
|
|
750
846
|
'the whole album documents — which turns its MP4s into GIFs, so send videos in their own call. ' +
|
|
751
847
|
'If a send fails, say so and give the file\'s path in your reply, then go on with the work — never stop over it. ' +
|
|
752
848
|
'Caption is optional (trimmed to 1024 chars; on the first album item).',
|
|
753
|
-
inputSchema:
|
|
849
|
+
inputSchema: sendFileInput,
|
|
754
850
|
}, async (args, extra) => {
|
|
755
851
|
const signal = requestSignal
|
|
756
852
|
? AbortSignal.any([extra.signal, requestSignal])
|
|
@@ -797,7 +893,7 @@ function registerMessageSendTool(server, deps, scope, requestSignal) {
|
|
|
797
893
|
'items; an over-long text item is split automatically. Note: this does NOT replace your normal single ' +
|
|
798
894
|
'reply — only reach for it when multiple discrete messages are wanted, and do not also print the same ' +
|
|
799
895
|
'content as your reply text (that would post it twice).',
|
|
800
|
-
inputSchema:
|
|
896
|
+
inputSchema: sendMessageInput,
|
|
801
897
|
}, async (args, extra) => {
|
|
802
898
|
const signal = requestSignal
|
|
803
899
|
? AbortSignal.any([extra.signal, requestSignal])
|
|
@@ -843,12 +939,12 @@ function registerCompactConversationTool(server, deps, scope) {
|
|
|
843
939
|
'never to "clean up". It does NOT compact mid-turn: it arms compaction and returns immediately; the ' +
|
|
844
940
|
'bot runs the real compaction the moment this turn finishes. There is nothing for you to do ' +
|
|
845
941
|
'afterwards — do not call it again for the same request.',
|
|
846
|
-
inputSchema: {
|
|
942
|
+
inputSchema: (0, strictToolInput_1.createStrictToolInput)({
|
|
847
943
|
reason: zod_1.z
|
|
848
944
|
.string()
|
|
849
945
|
.optional()
|
|
850
946
|
.describe('Optional short note on why the user asked to compact (for the bot log only).'),
|
|
851
|
-
},
|
|
947
|
+
}),
|
|
852
948
|
}, async (args) => {
|
|
853
949
|
// A surviving session may call this before boot re-attached it.
|
|
854
950
|
await deps.whenSessionsRestored();
|
|
@@ -861,6 +957,95 @@ function registerCompactConversationTool(server, deps, scope) {
|
|
|
861
957
|
return outcome.ok ? textResult(outcome.message) : errorResult(outcome.message);
|
|
862
958
|
});
|
|
863
959
|
}
|
|
960
|
+
/** The most items one `todo_update` call may name, and the longest `order` — a stand-up list is a few items (D1). */
|
|
961
|
+
const todoUpdateMaxItems = 30;
|
|
962
|
+
const todoOrderMaxIds = 100;
|
|
963
|
+
const todoItemPatchSchema = (0, strictToolInput_1.createStrictToolInput)({
|
|
964
|
+
id: zod_1.z
|
|
965
|
+
.string()
|
|
966
|
+
.trim()
|
|
967
|
+
.regex(/^t\d+$/)
|
|
968
|
+
.optional()
|
|
969
|
+
.describe('The item to change ("t3", from your list). Leave it out to ADD a new item.'),
|
|
970
|
+
title: zod_1.z
|
|
971
|
+
.string()
|
|
972
|
+
.max(types_1.todoTitleMaxLength)
|
|
973
|
+
.optional()
|
|
974
|
+
.describe('Task-sized and concrete: name the area (files, tests). Required for a new item.'),
|
|
975
|
+
status: zod_1.z
|
|
976
|
+
.enum(types_1.todoStatuses)
|
|
977
|
+
.optional()
|
|
978
|
+
.describe('queued (default for a new item) · inWork (you are on it) · done · dropped (will not be done — the way to remove an item).'),
|
|
979
|
+
note: zod_1.z.string().max(types_1.todoNoteMaxLength).optional().describe('A short note other agents should know (what is left, a blocker). An empty note removes it.'),
|
|
980
|
+
ref: zod_1.z
|
|
981
|
+
.string()
|
|
982
|
+
.max(types_1.todoRefMaxLength)
|
|
983
|
+
.optional()
|
|
984
|
+
.describe('A tracker key / id / link the item stands for, e.g. the bug ticket you just created. An empty ref removes it.'),
|
|
985
|
+
position: zod_1.z.enum(types_1.todoPositions).optional().describe('Put the item first or last among the open ones (a new item goes last by default).'),
|
|
986
|
+
});
|
|
987
|
+
const todoUpdateShape = {
|
|
988
|
+
items: zod_1.z
|
|
989
|
+
.preprocess(coerceJsonArrayArg, zod_1.z.array(todoItemPatchSchema).max(todoUpdateMaxItems))
|
|
990
|
+
.optional()
|
|
991
|
+
.describe('Items to add (no id) or change (id + only the fields that change). Nothing disappears by omission: set status dropped to remove one.'),
|
|
992
|
+
order: zod_1.z
|
|
993
|
+
.preprocess(coerceJsonArrayArg, zod_1.z.array(zod_1.z.string().trim().min(1)).max(todoOrderMaxIds))
|
|
994
|
+
.optional()
|
|
995
|
+
.describe('Open item ids in the wanted queue order; the ones left out keep their relative order after them.'),
|
|
996
|
+
threadKey: threadKeyArgSchema,
|
|
997
|
+
};
|
|
998
|
+
const todoUpdateInput = (0, strictToolInput_1.createStrictToolInput)(todoUpdateShape);
|
|
999
|
+
const todoReadShape = {
|
|
1000
|
+
scope: zod_1.z
|
|
1001
|
+
.enum(registry_1.todoReadScopes)
|
|
1002
|
+
.optional()
|
|
1003
|
+
.describe('own (default): your list · project: the whole board of the project\'s other topics (what they work on now).'),
|
|
1004
|
+
includeHistory: zod_1.z.boolean().optional().describe(`With scope own: also list older closed items (done / dropped), up to ${registry_1.todoHistoryMaxItems}.`),
|
|
1005
|
+
threadKey: threadKeyArgSchema,
|
|
1006
|
+
};
|
|
1007
|
+
const todoReadInput = (0, strictToolInput_1.createStrictToolInput)(todoReadShape);
|
|
1008
|
+
/**
|
|
1009
|
+
* @description Register `todo_update` / `todo_read` (shared todo registry D3–D5): the published list of the
|
|
1010
|
+
* conversation the token names — never another one; the rules live in `todos/registry.ts`.
|
|
1011
|
+
*/
|
|
1012
|
+
function registerTodoTools(server, deps, todos, scope) {
|
|
1013
|
+
server.registerTool('todo_update', {
|
|
1014
|
+
title: 'Update your published todo list',
|
|
1015
|
+
description: 'Publish what you are doing so the agents in the project\'s other topics see it and never fix the same thing ' +
|
|
1016
|
+
'unknowingly (and you see theirs). Stand-up level: a few task-sized items, never micro-steps (those stay in ' +
|
|
1017
|
+
'your own todo tool). Add an item as inWork BEFORE you start any task, self-found fixes included (a failing ' +
|
|
1018
|
+
'test, a leak), naming the area concretely; mark it done / dropped as soon as it is. An UPSERT: an item ' +
|
|
1019
|
+
'without id is new; with an id only the fields given change. A call with no items and no order confirms the ' +
|
|
1020
|
+
'list is still accurate. The result is your list and what changed in the project\'s other topics since you last saw them.',
|
|
1021
|
+
inputSchema: todoUpdateInput,
|
|
1022
|
+
}, async (args) => {
|
|
1023
|
+
const resolved = resolveTargetThreadKey(scope, args.threadKey, deps.getThreadsForDirectory);
|
|
1024
|
+
if (!resolved.ok)
|
|
1025
|
+
return errorResult(resolved.error);
|
|
1026
|
+
const outcome = await todos.update(resolved.threadKey, {
|
|
1027
|
+
...(args.items === undefined ? {} : { items: args.items }),
|
|
1028
|
+
...(args.order === undefined ? {} : { order: args.order }),
|
|
1029
|
+
});
|
|
1030
|
+
return outcome.ok ? textResult(outcome.message) : errorResult(outcome.error);
|
|
1031
|
+
});
|
|
1032
|
+
server.registerTool('todo_read', {
|
|
1033
|
+
title: 'Read your published todo list',
|
|
1034
|
+
description: 'Your published todo list (in work, the queue in order, recently done) and what changed in the project\'s other ' +
|
|
1035
|
+
'topics since you last saw them; with includeHistory also your older closed items; with scope project the whole board ' +
|
|
1036
|
+
'of the other topics.',
|
|
1037
|
+
inputSchema: todoReadInput,
|
|
1038
|
+
}, async (args) => {
|
|
1039
|
+
const resolved = resolveTargetThreadKey(scope, args.threadKey, deps.getThreadsForDirectory);
|
|
1040
|
+
if (!resolved.ok)
|
|
1041
|
+
return errorResult(resolved.error);
|
|
1042
|
+
const outcome = await todos.read(resolved.threadKey, {
|
|
1043
|
+
...(args.scope === undefined ? {} : { scope: args.scope }),
|
|
1044
|
+
...(args.includeHistory === undefined ? {} : { includeHistory: args.includeHistory }),
|
|
1045
|
+
});
|
|
1046
|
+
return outcome.ok ? textResult(outcome.message) : errorResult(outcome.error);
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
864
1049
|
/**
|
|
865
1050
|
* `jira_get_attachment`: the issue is the conversation this session's token names — never an argument —
|
|
866
1051
|
* so a file of any other issue cannot be asked for, however the id got into the agent's head.
|
|
@@ -873,9 +1058,9 @@ function registerJiraAttachmentTool(server, deps, fetchJiraAttachment, scope) {
|
|
|
873
1058
|
'"[image: shot.png — attachment 10234]". There is no size limit. What you do with the file is up to ' +
|
|
874
1059
|
'you: view an image with your file-reading tool, take frames or the audio of a video with ffmpeg ' +
|
|
875
1060
|
'(when it is on your PATH). Only this issue\'s own attachments can be fetched.',
|
|
876
|
-
inputSchema: {
|
|
1061
|
+
inputSchema: (0, strictToolInput_1.createStrictToolInput)({
|
|
877
1062
|
attachmentId: zod_1.z.string().min(1).describe('The attachment id, e.g. "10234" from "[image: shot.png — attachment 10234]".'),
|
|
878
|
-
},
|
|
1063
|
+
}),
|
|
879
1064
|
}, async (args) => {
|
|
880
1065
|
await deps.whenSessionsRestored();
|
|
881
1066
|
const resolved = resolveTargetThreadKey(scope, undefined, deps.getThreadsForDirectory);
|
|
@@ -917,6 +1102,7 @@ const answerRequestShape = {
|
|
|
917
1102
|
.max(answerRequest_1.answerBodyMaxLength)
|
|
918
1103
|
.describe(`The answer itself, in Markdown. The requester does not see your other output. ${answerStyle_1.answerStyleInstruction}`),
|
|
919
1104
|
};
|
|
1105
|
+
const answerRequestInput = (0, strictToolInput_1.createStrictToolInput)(answerRequestShape);
|
|
920
1106
|
/** `answer_request` in a Jira session: the same, and the comments the answer replies to. */
|
|
921
1107
|
const jiraAnswerRequestShape = {
|
|
922
1108
|
...answerRequestShape,
|
|
@@ -927,6 +1113,7 @@ const jiraAnswerRequestShape = {
|
|
|
927
1113
|
.describe('Ids of the issue\'s comments this answer replies to, e.g. ["10240"]. The bot mentions each comment\'s ' +
|
|
928
1114
|
'author at the top of your answer so they are notified. Only comments you were shown in this conversation count.'),
|
|
929
1115
|
};
|
|
1116
|
+
const jiraAnswerRequestInput = (0, strictToolInput_1.createStrictToolInput)(jiraAnswerRequestShape);
|
|
930
1117
|
/**
|
|
931
1118
|
* @description Register `answer_request` (request/answer core S3): the agent's
|
|
932
1119
|
* answer to a request, delivered to the surface the request came from. The
|
|
@@ -956,9 +1143,9 @@ function registerAnswerRequestTool(server, deps, scope, platform) {
|
|
|
956
1143
|
};
|
|
957
1144
|
// The reply field names a tracker's comments: only a Jira session is offered it.
|
|
958
1145
|
if (platform === 'jira')
|
|
959
|
-
server.registerTool('answer_request', { ...definition, inputSchema:
|
|
1146
|
+
server.registerTool('answer_request', { ...definition, inputSchema: jiraAnswerRequestInput }, handle);
|
|
960
1147
|
else
|
|
961
|
-
server.registerTool('answer_request', { ...definition, inputSchema:
|
|
1148
|
+
server.registerTool('answer_request', { ...definition, inputSchema: answerRequestInput }, handle);
|
|
962
1149
|
}
|
|
963
1150
|
/**
|
|
964
1151
|
* @description Correlate stateless MCP requests with cancellation notifications.
|
|
@@ -1058,6 +1245,20 @@ function createSchedulerMcpCancellationLifecycle(options = {}) {
|
|
|
1058
1245
|
}
|
|
1059
1246
|
return { registerRequest, cancelRequest };
|
|
1060
1247
|
}
|
|
1248
|
+
/**
|
|
1249
|
+
* @description Whether the bot's skills are on for the conversations a scope reaches (`utils/botSkills.ts`). A `thread:`
|
|
1250
|
+
* scope is one conversation. A `dir:` scope is the OpenCode registration of a folder — ONE per folder and server run, read
|
|
1251
|
+
* at connect — so it serves the folder's OpenCode topics alone (a Claude topic bound to the same folder has its own
|
|
1252
|
+
* `thread:` scope) and keeps the manager hint while any of them has the skills on; a folder with no OpenCode topic gets the
|
|
1253
|
+
* instance value.
|
|
1254
|
+
*/
|
|
1255
|
+
function checkIsBotSkillsEnabledForScope(deps, scope) {
|
|
1256
|
+
const threadKeys = scope.kind === 'thread'
|
|
1257
|
+
? [scope.threadKey]
|
|
1258
|
+
: deps.getThreadsForDirectory(scope.directory).filter((threadKey) => deps.getThreadAdapterName(threadKey) === adapterNames_1.openCodeAdapterName);
|
|
1259
|
+
const keys = threadKeys.map(sessionKey_1.tryKeyFromString).filter((key) => key !== null);
|
|
1260
|
+
return keys.length === 0 ? (0, botSkills_1.checkIsBotSkillsEnabled)(null) : keys.some((key) => (0, botSkills_1.checkIsBotSkillsEnabled)(key));
|
|
1261
|
+
}
|
|
1061
1262
|
/**
|
|
1062
1263
|
* @description Build a fresh {@link McpServer} for one request, registering the
|
|
1063
1264
|
* scope-bound scheduler tools plus the `send_file_to_user` tool. The SDK binds one server
|
|
@@ -1066,7 +1267,7 @@ function createSchedulerMcpCancellationLifecycle(options = {}) {
|
|
|
1066
1267
|
*/
|
|
1067
1268
|
function buildRequestServer(deps, scope, requestSignal) {
|
|
1068
1269
|
const platform = getSchedulerScopePlatform(scope);
|
|
1069
|
-
const server = new mcp_js_1.McpServer({ name: mcpServerName, version: mcpServerVersion }, { instructions: buildMcpServerInstructions(platform, deps
|
|
1270
|
+
const server = new mcp_js_1.McpServer({ name: mcpServerName, version: mcpServerVersion }, { instructions: buildMcpServerInstructions(platform, getOptionalBotTools(deps), checkIsBotSkillsEnabledForScope(deps, scope)) });
|
|
1070
1271
|
registerBotTools(server, deps, scope, platform, requestSignal);
|
|
1071
1272
|
return server;
|
|
1072
1273
|
}
|
|
@@ -1082,10 +1283,22 @@ function registerBotTools(server, deps, scope, platform, requestSignal) {
|
|
|
1082
1283
|
if (platform === 'jira' && deps.fetchJiraAttachment)
|
|
1083
1284
|
registerJiraAttachmentTool(server, deps, deps.fetchJiraAttachment, scope);
|
|
1084
1285
|
registerCompactConversationTool(server, deps, scope);
|
|
1286
|
+
// A published list belongs to a conversation of a platform that has one (D54): a topic or a Jira issue.
|
|
1287
|
+
if (deps.todos && (platform === 'telegram' || platform === 'jira'))
|
|
1288
|
+
registerTodoTools(server, deps, deps.todos, scope);
|
|
1085
1289
|
registerAnswerRequestTool(server, deps, scope, platform);
|
|
1086
1290
|
if (deps.listClaudeProfiles)
|
|
1087
1291
|
registerClaudeProfilesTool(server, deps.listClaudeProfiles);
|
|
1088
1292
|
}
|
|
1293
|
+
/** The first line of the `claude_profiles` answer: the pick with how to launch it and why, or that nothing is usable and when something is. */
|
|
1294
|
+
function buildClaudeProfilesVerdict(report, currentProfile) {
|
|
1295
|
+
const outcome = (0, claudeUsage_1.describeClaudeLaunchOutcome)(report, currentProfile);
|
|
1296
|
+
if (report.recommended === null)
|
|
1297
|
+
return outcome;
|
|
1298
|
+
const dir = report.profiles.find((profile) => profile.name === report.recommended)?.configDir ?? null;
|
|
1299
|
+
const launch = dir === null ? 'default profile, set no CLAUDE_CONFIG_DIR' : `CLAUDE_CONFIG_DIR=${dir}`;
|
|
1300
|
+
return `recommended: ${report.recommended} → ${launch} (${outcome})`;
|
|
1301
|
+
}
|
|
1089
1302
|
/**
|
|
1090
1303
|
* `claude_profiles`: which Claude account a child process should run on. Reads the bot's per-profile usage
|
|
1091
1304
|
* cache (refreshed on demand by the port); touches no conversation, so it needs no scope resolution. The
|
|
@@ -1095,31 +1308,43 @@ function registerClaudeProfilesTool(server, listClaudeProfiles) {
|
|
|
1095
1308
|
server.registerTool('claude_profiles', {
|
|
1096
1309
|
title: 'Claude accounts and their usage',
|
|
1097
1310
|
description: 'The Claude account profiles signed in on this host, each with its usage windows — session (5 h), weekly ' +
|
|
1098
|
-
'(all models) and weekly Fable — as percent used + reset instant, and `recommended`: the
|
|
1099
|
-
'
|
|
1100
|
-
'
|
|
1101
|
-
'
|
|
1102
|
-
'
|
|
1103
|
-
'
|
|
1104
|
-
'
|
|
1105
|
-
'
|
|
1106
|
-
|
|
1311
|
+
'(all models) and weekly Fable — as percent used + reset instant, and `recommended`: the account a process of ' +
|
|
1312
|
+
'the model you pass should run on. A NEW agent (omit `currentProfile`) goes to the usable account whose weekly ' +
|
|
1313
|
+
'limit resets SOONEST — what burns soonest is spent first; an account whose five-hour window is at 90 % or more ' +
|
|
1314
|
+
'is skipped until it resets. A session you RESUME (pass `currentProfile`, the profile it last ran on) stays on ' +
|
|
1315
|
+
'it unless that account is signed out, limited or at 100 % on a window the model drains; when it broke off on a ' +
|
|
1316
|
+
'usage limit pass `isStoppedByLimit: true` and resume the SAME session at once on the answer. The session ' +
|
|
1317
|
+
'window and the shared weekly window bound every model, Fable included; Fable also drains its own weekly ' +
|
|
1318
|
+
'window; signed-out, limited and operator-switched-off accounts are skipped. An account with `billing: "api"` ' +
|
|
1319
|
+
'pays per request from a Claude Console balance: it has no windows and is NEVER picked for a new agent — do ' +
|
|
1320
|
+
'not launch a child on it unless the operator asked you to. `recommended: null` means nothing is usable now: ' +
|
|
1321
|
+
'`nextAvailable` names the account and instant that frees up first — schedule ONE resume at that time instead ' +
|
|
1322
|
+
'of retrying; when `nextAvailable` is null too, tell the user and retry once in about 30 minutes. Call it BEFORE launching or resuming a child `claude` and start the child with ' +
|
|
1323
|
+
'CLAUDE_CONFIG_DIR=<configDir> in its environment — configDir null means the default profile: set nothing. ' +
|
|
1324
|
+
'Without the variable the child inherits the account of this very session.',
|
|
1325
|
+
inputSchema: (0, strictToolInput_1.createStrictToolInput)({
|
|
1107
1326
|
model: zod_1.z
|
|
1108
1327
|
.string()
|
|
1109
1328
|
.max(64)
|
|
1110
1329
|
.optional()
|
|
1111
1330
|
.describe('The model the child will run (e.g. "fable", "opus", "sonnet"); decides whether the Fable weekly window counts besides the shared ones. Omit for the shared windows.'),
|
|
1112
|
-
|
|
1331
|
+
currentProfile: zod_1.z
|
|
1332
|
+
.string()
|
|
1333
|
+
.max(claudeProfiles_1.claudeProfileNameMaxLength)
|
|
1334
|
+
.optional()
|
|
1335
|
+
.describe('The profile the session you RESUME last ran on (the `name` you recorded at its launch); omit for a new agent.'),
|
|
1336
|
+
isStoppedByLimit: zod_1.z
|
|
1337
|
+
.boolean()
|
|
1338
|
+
.optional()
|
|
1339
|
+
.describe('The resumed session broke off on a usage limit of `currentProfile`: that account is left out of this answer. Needs `currentProfile`.'),
|
|
1340
|
+
}),
|
|
1113
1341
|
}, async (args) => {
|
|
1114
|
-
const
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
return `recommended: ${report.recommended} → ${dir === null ? 'default profile, set no CLAUDE_CONFIG_DIR' : `CLAUDE_CONFIG_DIR=${dir}`}`;
|
|
1121
|
-
})();
|
|
1122
|
-
return textResult(`${verdict}\n${JSON.stringify(report, null, 1)}`);
|
|
1342
|
+
const currentProfile = args.currentProfile?.trim() || null;
|
|
1343
|
+
if (args.isStoppedByLimit === true && currentProfile === null) {
|
|
1344
|
+
return errorResult('isStoppedByLimit needs currentProfile — the profile the session that hit the limit last ran on.');
|
|
1345
|
+
}
|
|
1346
|
+
const report = await listClaudeProfiles({ model: args.model?.trim() || null, currentProfile, isStoppedByLimit: args.isStoppedByLimit === true });
|
|
1347
|
+
return textResult(`${buildClaudeProfilesVerdict(report, currentProfile)}\n${JSON.stringify(report, null, 1)}`);
|
|
1123
1348
|
});
|
|
1124
1349
|
}
|
|
1125
1350
|
/** Read the whole request body into a string (the SDK wants the parsed JSON body). */
|
|
@@ -1229,7 +1454,12 @@ function createSchedulerMcpServer(deps) {
|
|
|
1229
1454
|
void server.close();
|
|
1230
1455
|
});
|
|
1231
1456
|
await server.connect(transport);
|
|
1232
|
-
|
|
1457
|
+
// The SDK refuses a call's input before any tool code runs, so the refusal is reported from inside the handling.
|
|
1458
|
+
const toolCall = types_js_1.CallToolRequestSchema.safeParse(parsedBody);
|
|
1459
|
+
const handleRequest = () => transport.handleRequest(req, res, parsedBody);
|
|
1460
|
+
await (toolCall.success && deps.logDiagnostic
|
|
1461
|
+
? (0, strictToolInput_1.runWithRefusalLogging)({ toolName: toolCall.data.params.name, log: deps.logDiagnostic }, handleRequest)
|
|
1462
|
+
: handleRequest());
|
|
1233
1463
|
}
|
|
1234
1464
|
function start() {
|
|
1235
1465
|
return new Promise((resolve, reject) => {
|
|
@@ -1323,7 +1553,7 @@ function createSchedulerMcpServer(deps) {
|
|
|
1323
1553
|
return {
|
|
1324
1554
|
start,
|
|
1325
1555
|
stop,
|
|
1326
|
-
getToolDigest: (platform) => getBotMcpToolDigest(deps, platform),
|
|
1556
|
+
getToolDigest: (platform, isBotSkillsEnabled) => getBotMcpToolDigest(deps, platform, isBotSkillsEnabled),
|
|
1327
1557
|
get port() {
|
|
1328
1558
|
return boundPort;
|
|
1329
1559
|
},
|