charness 3.11.0 → 3.12.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 +142 -0
- package/DEVELOPMENT.md +3 -3
- package/README.md +1 -1
- package/SETUP.md +6 -5
- package/agent-plugin/README.md +15 -6
- package/agent-plugin/skills/charness-delegate-claude/SKILL.md +23 -13
- package/agent-plugin/skills/charness-delegate-opencode/SKILL.md +10 -6
- package/agent-plugin/skills/charness-delivery-loop/SKILL.md +92 -0
- package/agent-plugin/skills/charness-orchestration/SKILL.md +116 -0
- package/dist/adapters/openCodeAdapter.d.ts +15 -0
- package/dist/adapters/openCodeAdapter.d.ts.map +1 -1
- package/dist/adapters/openCodeAdapter.js +48 -4
- package/dist/adapters/openCodeAdapter.js.map +1 -1
- package/dist/agentLogin/agentLogin.d.ts +11 -0
- package/dist/agentLogin/agentLogin.d.ts.map +1 -1
- package/dist/agentLogin/agentLogin.js +18 -6
- package/dist/agentLogin/agentLogin.js.map +1 -1
- package/dist/apiErrorRetry.d.ts +5 -0
- package/dist/apiErrorRetry.d.ts.map +1 -1
- package/dist/apiErrorRetry.js +3 -3
- package/dist/apiErrorRetry.js.map +1 -1
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +158 -20
- package/dist/bot.js.map +1 -1
- package/dist/cli/claudeProfiles.d.ts +5 -2
- package/dist/cli/claudeProfiles.d.ts.map +1 -1
- package/dist/cli/claudeProfiles.js +43 -20
- package/dist/cli/claudeProfiles.js.map +1 -1
- package/dist/cli/claudeProfilesCredit.d.ts +49 -0
- package/dist/cli/claudeProfilesCredit.d.ts.map +1 -0
- package/dist/cli/claudeProfilesCredit.js +160 -0
- package/dist/cli/claudeProfilesCredit.js.map +1 -0
- package/dist/cli/flagValue.d.ts +10 -0
- package/dist/cli/flagValue.d.ts.map +1 -0
- package/dist/cli/flagValue.js +17 -0
- package/dist/cli/flagValue.js.map +1 -0
- package/dist/connectors/telegram/commands/botSkills.js +1 -1
- package/dist/connectors/telegram/commands/claudeAccounts.d.ts +6 -1
- package/dist/connectors/telegram/commands/claudeAccounts.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/claudeAccounts.js +9 -6
- package/dist/connectors/telegram/commands/claudeAccounts.js.map +1 -1
- package/dist/connectors/telegram/commands/compaction.d.ts +11 -0
- package/dist/connectors/telegram/commands/compaction.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/compaction.js +208 -22
- package/dist/connectors/telegram/commands/compaction.js.map +1 -1
- package/dist/connectors/telegram/commands/runners.d.ts +5 -1
- package/dist/connectors/telegram/commands/runners.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/runners.js +146 -31
- package/dist/connectors/telegram/commands/runners.js.map +1 -1
- package/dist/connectors/telegram/runnerPairingMessages.d.ts +2 -7
- package/dist/connectors/telegram/runnerPairingMessages.d.ts.map +1 -1
- package/dist/connectors/telegram/runnerPairingMessages.js +5 -19
- package/dist/connectors/telegram/runnerPairingMessages.js.map +1 -1
- package/dist/i18n/de.d.ts.map +1 -1
- package/dist/i18n/de.js +52 -8
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +52 -8
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +52 -8
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +52 -8
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/hi.d.ts.map +1 -1
- package/dist/i18n/hi.js +52 -8
- package/dist/i18n/hi.js.map +1 -1
- package/dist/i18n/ja.d.ts.map +1 -1
- package/dist/i18n/ja.js +52 -8
- package/dist/i18n/ja.js.map +1 -1
- package/dist/i18n/ka.d.ts.map +1 -1
- package/dist/i18n/ka.js +52 -8
- package/dist/i18n/ka.js.map +1 -1
- package/dist/i18n/pt.d.ts.map +1 -1
- package/dist/i18n/pt.js +52 -8
- package/dist/i18n/pt.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +52 -8
- package/dist/i18n/ru.js.map +1 -1
- package/dist/i18n/uk.d.ts.map +1 -1
- package/dist/i18n/uk.js +52 -8
- package/dist/i18n/uk.js.map +1 -1
- package/dist/i18n/uz.d.ts.map +1 -1
- package/dist/i18n/uz.js +52 -8
- package/dist/i18n/uz.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +52 -8
- package/dist/i18n/zh.js.map +1 -1
- package/dist/installManager.d.ts.map +1 -1
- package/dist/installManager.js +3 -0
- package/dist/installManager.js.map +1 -1
- package/dist/instanceLock.d.ts.map +1 -1
- package/dist/instanceLock.js +2 -1
- package/dist/instanceLock.js.map +1 -1
- package/dist/platform/outbound.d.ts +14 -1
- package/dist/platform/outbound.d.ts.map +1 -1
- package/dist/platform/outbound.js.map +1 -1
- package/dist/remoteRun/cleanReport.d.ts +45 -0
- package/dist/remoteRun/cleanReport.d.ts.map +1 -0
- package/dist/remoteRun/cleanReport.js +84 -0
- package/dist/remoteRun/cleanReport.js.map +1 -0
- package/dist/remoteRun/cliArgs.d.ts +18 -0
- package/dist/remoteRun/cliArgs.d.ts.map +1 -1
- package/dist/remoteRun/cliArgs.js +100 -4
- package/dist/remoteRun/cliArgs.js.map +1 -1
- package/dist/remoteRun/commands.d.ts +30 -1
- package/dist/remoteRun/commands.d.ts.map +1 -1
- package/dist/remoteRun/commands.js +84 -9
- package/dist/remoteRun/commands.js.map +1 -1
- package/dist/remoteRun/exitCodes.d.ts +5 -0
- package/dist/remoteRun/exitCodes.d.ts.map +1 -1
- package/dist/remoteRun/exitCodes.js +6 -1
- package/dist/remoteRun/exitCodes.js.map +1 -1
- package/dist/remoteRun/foreground.d.ts +6 -0
- package/dist/remoteRun/foreground.d.ts.map +1 -1
- package/dist/remoteRun/foreground.js +13 -1
- package/dist/remoteRun/foreground.js.map +1 -1
- package/dist/remoteRun/interrupts.d.ts.map +1 -1
- package/dist/remoteRun/interrupts.js +2 -2
- package/dist/remoteRun/interrupts.js.map +1 -1
- package/dist/remoteRun/jobFiles.d.ts +6 -1
- package/dist/remoteRun/jobFiles.d.ts.map +1 -1
- package/dist/remoteRun/jobFiles.js +14 -0
- package/dist/remoteRun/jobFiles.js.map +1 -1
- package/dist/remoteRun/jobId.d.ts +5 -0
- package/dist/remoteRun/jobId.d.ts.map +1 -1
- package/dist/remoteRun/jobId.js +10 -0
- package/dist/remoteRun/jobId.js.map +1 -1
- package/dist/remoteRun/jobState.d.ts.map +1 -1
- package/dist/remoteRun/jobState.js +3 -2
- package/dist/remoteRun/jobState.js.map +1 -1
- package/dist/remoteRun/pairedRunners.d.ts +1 -1
- package/dist/remoteRun/pairedRunners.d.ts.map +1 -1
- package/dist/remoteRun/pairedRunners.js +4 -0
- package/dist/remoteRun/pairedRunners.js.map +1 -1
- package/dist/remoteRun/pathPatterns.d.ts +1 -1
- package/dist/remoteRun/pathPatterns.js +1 -1
- package/dist/remoteRun/probe.d.ts +58 -5
- package/dist/remoteRun/probe.d.ts.map +1 -1
- package/dist/remoteRun/probe.js +107 -11
- package/dist/remoteRun/probe.js.map +1 -1
- package/dist/remoteRun/probeTiming.d.ts +15 -0
- package/dist/remoteRun/probeTiming.d.ts.map +1 -0
- package/dist/remoteRun/probeTiming.js +23 -0
- package/dist/remoteRun/probeTiming.js.map +1 -0
- package/dist/remoteRun/project.d.ts +5 -0
- package/dist/remoteRun/project.d.ts.map +1 -1
- package/dist/remoteRun/project.js +10 -0
- package/dist/remoteRun/project.js.map +1 -1
- package/dist/remoteRun/projectConfig.d.ts +8 -1
- package/dist/remoteRun/projectConfig.d.ts.map +1 -1
- package/dist/remoteRun/projectConfig.js +18 -5
- package/dist/remoteRun/projectConfig.js.map +1 -1
- package/dist/remoteRun/pruneReport.d.ts +48 -0
- package/dist/remoteRun/pruneReport.d.ts.map +1 -0
- package/dist/remoteRun/pruneReport.js +80 -0
- package/dist/remoteRun/pruneReport.js.map +1 -0
- package/dist/remoteRun/remoteRunCli.d.ts +1 -1
- package/dist/remoteRun/remoteRunCli.d.ts.map +1 -1
- package/dist/remoteRun/remoteRunCli.js +20 -0
- package/dist/remoteRun/remoteRunCli.js.map +1 -1
- package/dist/remoteRun/runnerClient.d.ts +10 -0
- package/dist/remoteRun/runnerClient.d.ts.map +1 -1
- package/dist/remoteRun/runnerClient.js +19 -5
- package/dist/remoteRun/runnerClient.js.map +1 -1
- package/dist/remoteRun/runnerWait.d.ts.map +1 -1
- package/dist/remoteRun/runnerWait.js +2 -1
- package/dist/remoteRun/runnerWait.js.map +1 -1
- package/dist/remoteRun/runners.d.ts +48 -7
- package/dist/remoteRun/runners.d.ts.map +1 -1
- package/dist/remoteRun/runners.js +105 -40
- package/dist/remoteRun/runners.js.map +1 -1
- package/dist/remoteRun/runnersConfig.d.ts +24 -0
- package/dist/remoteRun/runnersConfig.d.ts.map +1 -1
- package/dist/remoteRun/runnersConfig.js +29 -2
- package/dist/remoteRun/runnersConfig.js.map +1 -1
- package/dist/remoteRun/ssh.d.ts +3 -3
- package/dist/remoteRun/ssh.d.ts.map +1 -1
- package/dist/remoteRun/ssh.js +19 -5
- package/dist/remoteRun/ssh.js.map +1 -1
- package/dist/remoteRun/submit.d.ts +1 -1
- package/dist/remoteRun/submit.d.ts.map +1 -1
- package/dist/remoteRun/submit.js +30 -2
- package/dist/remoteRun/submit.js.map +1 -1
- package/dist/runnerUtility/adminService.d.ts.map +1 -1
- package/dist/runnerUtility/adminService.js +5 -5
- package/dist/runnerUtility/adminService.js.map +1 -1
- package/dist/runnerUtility/appInstall.d.ts +9 -0
- package/dist/runnerUtility/appInstall.d.ts.map +1 -1
- package/dist/runnerUtility/appInstall.js +12 -2
- package/dist/runnerUtility/appInstall.js.map +1 -1
- package/dist/runnerUtility/execEnv.d.ts +1 -1
- package/dist/runnerUtility/execEnv.d.ts.map +1 -1
- package/dist/runnerUtility/execEnv.js +23 -5
- package/dist/runnerUtility/execEnv.js.map +1 -1
- package/dist/runnerUtility/guiAgentHeal.d.ts +3 -3
- package/dist/runnerUtility/guiAgentHeal.d.ts.map +1 -1
- package/dist/runnerUtility/guiAgentHeal.js +4 -2
- package/dist/runnerUtility/guiAgentHeal.js.map +1 -1
- package/dist/runnerUtility/homeFolders.d.ts +1 -0
- package/dist/runnerUtility/homeFolders.d.ts.map +1 -1
- package/dist/runnerUtility/homeFolders.js +2 -1
- package/dist/runnerUtility/homeFolders.js.map +1 -1
- package/dist/runnerUtility/iosCheck.d.ts +2 -0
- package/dist/runnerUtility/iosCheck.d.ts.map +1 -1
- package/dist/runnerUtility/iosCheck.js +12 -3
- package/dist/runnerUtility/iosCheck.js.map +1 -1
- package/dist/runnerUtility/keepAwake.d.ts +47 -10
- package/dist/runnerUtility/keepAwake.d.ts.map +1 -1
- package/dist/runnerUtility/keepAwake.js +108 -31
- package/dist/runnerUtility/keepAwake.js.map +1 -1
- package/dist/runnerUtility/launcher.d.ts +4 -0
- package/dist/runnerUtility/launcher.d.ts.map +1 -1
- package/dist/runnerUtility/launcher.js +31 -13
- package/dist/runnerUtility/launcher.js.map +1 -1
- package/dist/runnerUtility/linkLoop.d.ts +4 -0
- package/dist/runnerUtility/linkLoop.d.ts.map +1 -1
- package/dist/runnerUtility/linkLoop.js +15 -6
- package/dist/runnerUtility/linkLoop.js.map +1 -1
- package/dist/runnerUtility/managedNode.d.ts +84 -0
- package/dist/runnerUtility/managedNode.d.ts.map +1 -0
- package/dist/runnerUtility/managedNode.js +165 -0
- package/dist/runnerUtility/managedNode.js.map +1 -0
- package/dist/runnerUtility/nodeOnPath.d.ts +10 -0
- package/dist/runnerUtility/nodeOnPath.d.ts.map +1 -0
- package/dist/runnerUtility/nodeOnPath.js +49 -0
- package/dist/runnerUtility/nodeOnPath.js.map +1 -0
- package/dist/runnerUtility/nodeUpkeep.d.ts +140 -0
- package/dist/runnerUtility/nodeUpkeep.d.ts.map +1 -0
- package/dist/runnerUtility/nodeUpkeep.js +348 -0
- package/dist/runnerUtility/nodeUpkeep.js.map +1 -0
- package/dist/runnerUtility/nodeUpkeepTiming.d.ts +14 -0
- package/dist/runnerUtility/nodeUpkeepTiming.d.ts.map +1 -0
- package/dist/runnerUtility/nodeUpkeepTiming.js +21 -0
- package/dist/runnerUtility/nodeUpkeepTiming.js.map +1 -0
- package/dist/runnerUtility/packageManagerShims.d.ts +10 -0
- package/dist/runnerUtility/packageManagerShims.d.ts.map +1 -1
- package/dist/runnerUtility/packageManagerShims.js +67 -3
- package/dist/runnerUtility/packageManagerShims.js.map +1 -1
- package/dist/runnerUtility/pueueDaemon.d.ts +73 -8
- package/dist/runnerUtility/pueueDaemon.d.ts.map +1 -1
- package/dist/runnerUtility/pueueDaemon.js +90 -15
- package/dist/runnerUtility/pueueDaemon.js.map +1 -1
- package/dist/runnerUtility/runnerCommands.d.ts +7 -1
- package/dist/runnerUtility/runnerCommands.d.ts.map +1 -1
- package/dist/runnerUtility/runnerCommands.js +119 -16
- package/dist/runnerUtility/runnerCommands.js.map +1 -1
- package/dist/runnerUtility/runnerHome.d.ts +34 -0
- package/dist/runnerUtility/runnerHome.d.ts.map +1 -1
- package/dist/runnerUtility/runnerHome.js +17 -3
- package/dist/runnerUtility/runnerHome.js.map +1 -1
- package/dist/runnerUtility/serviceCommon.d.ts +2 -0
- package/dist/runnerUtility/serviceCommon.d.ts.map +1 -1
- package/dist/runnerUtility/serviceCommon.js +3 -1
- package/dist/runnerUtility/serviceCommon.js.map +1 -1
- package/dist/runnerUtility/serviceManager.d.ts.map +1 -1
- package/dist/runnerUtility/serviceManager.js +7 -2
- package/dist/runnerUtility/serviceManager.js.map +1 -1
- package/dist/runnerUtility/simctlGuard.d.ts +38 -0
- package/dist/runnerUtility/simctlGuard.d.ts.map +1 -0
- package/dist/runnerUtility/simctlGuard.js +166 -0
- package/dist/runnerUtility/simctlGuard.js.map +1 -0
- package/dist/runners/bootstrapLine.d.ts +3 -4
- package/dist/runners/bootstrapLine.d.ts.map +1 -1
- package/dist/runners/bootstrapLine.js +108 -83
- package/dist/runners/bootstrapLine.js.map +1 -1
- package/dist/runners/hubPackage.d.ts +1 -1
- package/dist/runners/hubPackage.d.ts.map +1 -1
- package/dist/runners/hubPackage.js +5 -6
- package/dist/runners/hubPackage.js.map +1 -1
- package/dist/runners/hubPairing.d.ts +19 -0
- package/dist/runners/hubPairing.d.ts.map +1 -1
- package/dist/runners/hubPairing.js +38 -0
- package/dist/runners/hubPairing.js.map +1 -1
- package/dist/runners/hubRegistry.d.ts +8 -0
- package/dist/runners/hubRegistry.d.ts.map +1 -1
- package/dist/runners/hubRegistry.js +6 -0
- package/dist/runners/hubRegistry.js.map +1 -1
- package/dist/runners/pairCode.d.ts +34 -3
- package/dist/runners/pairCode.d.ts.map +1 -1
- package/dist/runners/pairCode.js +65 -13
- package/dist/runners/pairCode.js.map +1 -1
- package/dist/runners/runnerGroups.d.ts +22 -0
- package/dist/runners/runnerGroups.d.ts.map +1 -0
- package/dist/runners/runnerGroups.js +41 -0
- package/dist/runners/runnerGroups.js.map +1 -0
- package/dist/runners/runnersCli.d.ts +5 -2
- package/dist/runners/runnersCli.d.ts.map +1 -1
- package/dist/runners/runnersCli.js +59 -9
- package/dist/runners/runnersCli.js.map +1 -1
- package/dist/runners/runnersList.d.ts +1 -1
- package/dist/runners/runnersList.d.ts.map +1 -1
- package/dist/runners/runnersList.js +3 -1
- package/dist/runners/runnersList.js.map +1 -1
- package/dist/runners/runnersOverview.d.ts.map +1 -1
- package/dist/runners/runnersOverview.js +8 -4
- package/dist/runners/runnersOverview.js.map +1 -1
- package/dist/scheduler/checkStatus.d.ts +2 -0
- package/dist/scheduler/checkStatus.d.ts.map +1 -1
- package/dist/scheduler/checkStatus.js +5 -4
- package/dist/scheduler/checkStatus.js.map +1 -1
- package/dist/scheduler/delivery.d.ts +2 -1
- package/dist/scheduler/delivery.d.ts.map +1 -1
- package/dist/scheduler/delivery.js +5 -1
- package/dist/scheduler/delivery.js.map +1 -1
- package/dist/scheduler/mcpSurface.d.ts +7 -3
- package/dist/scheduler/mcpSurface.d.ts.map +1 -1
- package/dist/scheduler/mcpSurface.js +48 -22
- package/dist/scheduler/mcpSurface.js.map +1 -1
- package/dist/scheduler/workerWatch.d.ts +33 -10
- package/dist/scheduler/workerWatch.d.ts.map +1 -1
- package/dist/scheduler/workerWatch.js +37 -11
- package/dist/scheduler/workerWatch.js.map +1 -1
- package/dist/state.d.ts +95 -2
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +145 -7
- package/dist/state.js.map +1 -1
- package/dist/testTimings.d.ts +6 -2
- package/dist/testTimings.d.ts.map +1 -1
- package/dist/testTimings.js +12 -1
- package/dist/testTimings.js.map +1 -1
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/agentPlugin.d.ts +2 -1
- package/dist/utils/agentPlugin.d.ts.map +1 -1
- package/dist/utils/agentPlugin.js +2 -1
- package/dist/utils/agentPlugin.js.map +1 -1
- package/dist/utils/botSkills.d.ts +1 -1
- package/dist/utils/claudeApiAgentStop.d.ts +64 -0
- package/dist/utils/claudeApiAgentStop.d.ts.map +1 -0
- package/dist/utils/claudeApiAgentStop.js +85 -0
- package/dist/utils/claudeApiAgentStop.js.map +1 -0
- package/dist/utils/claudeApiCredit.d.ts +168 -0
- package/dist/utils/claudeApiCredit.d.ts.map +1 -0
- package/dist/utils/claudeApiCredit.js +260 -0
- package/dist/utils/claudeApiCredit.js.map +1 -0
- package/dist/utils/claudeApiCreditRecheck.d.ts +120 -0
- package/dist/utils/claudeApiCreditRecheck.d.ts.map +1 -0
- package/dist/utils/claudeApiCreditRecheck.js +173 -0
- package/dist/utils/claudeApiCreditRecheck.js.map +1 -0
- package/dist/utils/claudeCompactHook.d.ts +18 -10
- package/dist/utils/claudeCompactHook.d.ts.map +1 -1
- package/dist/utils/claudeCompactHook.js +35 -14
- package/dist/utils/claudeCompactHook.js.map +1 -1
- package/dist/utils/claudeProfileUsageLines.d.ts +13 -1
- package/dist/utils/claudeProfileUsageLines.d.ts.map +1 -1
- package/dist/utils/claudeProfileUsageLines.js +75 -4
- package/dist/utils/claudeProfileUsageLines.js.map +1 -1
- package/dist/utils/claudeProfileUsageViews.d.ts +46 -0
- package/dist/utils/claudeProfileUsageViews.d.ts.map +1 -0
- package/dist/utils/claudeProfileUsageViews.js +114 -0
- package/dist/utils/claudeProfileUsageViews.js.map +1 -0
- package/dist/utils/claudeProfiles.d.ts +15 -0
- package/dist/utils/claudeProfiles.d.ts.map +1 -1
- package/dist/utils/claudeProfiles.js +54 -0
- package/dist/utils/claudeProfiles.js.map +1 -1
- package/dist/utils/claudeUsage.d.ts +94 -36
- package/dist/utils/claudeUsage.d.ts.map +1 -1
- package/dist/utils/claudeUsage.js +134 -60
- package/dist/utils/claudeUsage.js.map +1 -1
- package/dist/utils/compactOnIdle.d.ts +140 -15
- package/dist/utils/compactOnIdle.d.ts.map +1 -1
- package/dist/utils/compactOnIdle.js +209 -23
- package/dist/utils/compactOnIdle.js.map +1 -1
- package/dist/utils/compactSelfReviewFlags.d.ts +50 -0
- package/dist/utils/compactSelfReviewFlags.d.ts.map +1 -0
- package/dist/utils/compactSelfReviewFlags.js +120 -0
- package/dist/utils/compactSelfReviewFlags.js.map +1 -0
- package/dist/utils/fallbackChain.d.ts +18 -7
- package/dist/utils/fallbackChain.d.ts.map +1 -1
- package/dist/utils/fallbackChain.js +28 -12
- package/dist/utils/fallbackChain.js.map +1 -1
- package/dist/utils/openCodeCompactPlugin.d.ts +28 -7
- package/dist/utils/openCodeCompactPlugin.d.ts.map +1 -1
- package/dist/utils/openCodeCompactPlugin.js +80 -15
- package/dist/utils/openCodeCompactPlugin.js.map +1 -1
- package/dist/utils/runnersScreenPlan.d.ts +51 -20
- package/dist/utils/runnersScreenPlan.d.ts.map +1 -1
- package/dist/utils/runnersScreenPlan.js +143 -28
- package/dist/utils/runnersScreenPlan.js.map +1 -1
- package/dist/utils/streamedCompactionSummary.d.ts +65 -0
- package/dist/utils/streamedCompactionSummary.d.ts.map +1 -0
- package/dist/utils/streamedCompactionSummary.js +108 -0
- package/dist/utils/streamedCompactionSummary.js.map +1 -0
- package/package.json +2 -2
- package/remoteRun/ensureNode.sh +288 -0
- package/remoteRun/runner.sh +2252 -115
- package/agent-plugin/skills/charness-manager/SKILL.md +0 -157
- package/remoteRun/pickNode.sh +0 -65
package/dist/bot.js
CHANGED
|
@@ -157,6 +157,8 @@ const adoptedToolList_1 = require("./utils/adoptedToolList");
|
|
|
157
157
|
const lostWork_1 = require("./utils/lostWork");
|
|
158
158
|
const jsonStreamPendingWork_1 = require("./utils/jsonStreamPendingWork");
|
|
159
159
|
const compactOnIdle_1 = require("./utils/compactOnIdle");
|
|
160
|
+
const compactSelfReviewFlags_1 = require("./utils/compactSelfReviewFlags");
|
|
161
|
+
const openCodeCompactPlugin_1 = require("./utils/openCodeCompactPlugin");
|
|
160
162
|
const fileSendService_1 = require("./utils/fileSendService");
|
|
161
163
|
const messageSendService_1 = require("./utils/messageSendService");
|
|
162
164
|
const fileSendGateway_1 = require("./connectors/telegram/fileSendGateway");
|
|
@@ -251,6 +253,7 @@ const hubAddress_1 = require("./runners/hubAddress");
|
|
|
251
253
|
const hubAddressCandidates_1 = require("./runners/hubAddressCandidates");
|
|
252
254
|
const hubPaths_1 = require("./runners/hubPaths");
|
|
253
255
|
const hubPairing_1 = require("./runners/hubPairing");
|
|
256
|
+
const runnerGroups_1 = require("./runners/runnerGroups");
|
|
254
257
|
const runnersOverview_1 = require("./runners/runnersOverview");
|
|
255
258
|
const ssh_1 = require("./remoteRun/ssh");
|
|
256
259
|
const claudeAccounts_1 = require("./connectors/telegram/commands/claudeAccounts");
|
|
@@ -275,6 +278,10 @@ const backendSwitchPlan_1 = require("./utils/backendSwitchPlan");
|
|
|
275
278
|
const selfUpdate_1 = require("./connectors/telegram/commands/selfUpdate");
|
|
276
279
|
const stt_1 = require("./connectors/telegram/commands/stt");
|
|
277
280
|
const claudeApiSpend_1 = require("./utils/claudeApiSpend");
|
|
281
|
+
const claudeProfileUsageViews_1 = require("./utils/claudeProfileUsageViews");
|
|
282
|
+
const claudeApiAgentStop_1 = require("./utils/claudeApiAgentStop");
|
|
283
|
+
const claudeApiCredit_1 = require("./utils/claudeApiCredit");
|
|
284
|
+
const claudeApiCreditRecheck_1 = require("./utils/claudeApiCreditRecheck");
|
|
278
285
|
const claudeProfileUsageLines_1 = require("./utils/claudeProfileUsageLines");
|
|
279
286
|
const resolveBinary_1 = require("./utils/resolveBinary");
|
|
280
287
|
const runnerSummary_1 = require("./remoteRun/runnerSummary");
|
|
@@ -2202,6 +2209,7 @@ const { cancelPendingLogin, checkIsAuthLoginAwaitingCode, cancelClaudeAuthLogin,
|
|
|
2202
2209
|
execFileAsync,
|
|
2203
2210
|
onClaudeProfileAuthStatus: (key, profile, status) => claudeProfileAuthStatusSink?.(key, profile, status) ?? Promise.resolve(),
|
|
2204
2211
|
onClaudeProfileApiKey: (key, profile, apiKey) => claudeProfileApiKeySink?.(key, profile, apiKey) ?? Promise.resolve((0, i18n_1.t)('account.apiKeyNoDirectory', { name: profile.name })),
|
|
2212
|
+
checkIsProfileMissingFromLimitsList: (name) => (0, fallbackChain_1.checkIsClaudeProfileMissingFromChain)(state.getFallbackChain(), name),
|
|
2205
2213
|
});
|
|
2206
2214
|
/**
|
|
2207
2215
|
* @description Buffers prompts typed while an agent session is still booting so
|
|
@@ -4418,6 +4426,8 @@ function getPerTurnRefusal(key) {
|
|
|
4418
4426
|
*/
|
|
4419
4427
|
async function persistSessionStart(key, adapter) {
|
|
4420
4428
|
await (0, persistAdapterSessionIds_1.persistAdapterSessionIds)(key, adapter, state);
|
|
4429
|
+
// The session id is new or changed: the hook's and the plugin's flags for it (`/compact_self_review`) are due.
|
|
4430
|
+
syncThreadCompactSelfReviewFlags(key);
|
|
4421
4431
|
if ((0, adapterNames_1.checkIsJsonStreamBackend)(adapter.name) && botMcpToolDigestReader) {
|
|
4422
4432
|
await state.setAgentMcpToolDigest(key, botMcpToolDigestReader(key));
|
|
4423
4433
|
}
|
|
@@ -5175,7 +5185,7 @@ const botCore = {
|
|
|
5175
5185
|
cancelConversationRequest,
|
|
5176
5186
|
wakeSleepingSession,
|
|
5177
5187
|
};
|
|
5178
|
-
const { checkIsThreadCompacting, noteThreadActivity, noteThreadUserActivity, markThreadTurnProducedOutput, clearThreadCompaction, rearmThreadIdleTimer, armDeferredCompaction, checkIsDeferredCompactionArmed, threadsCompacting, answerReAskedQuestionByNumber, reAskInterruptedQuestion, restoreReAskedQuestion, closeSavedReAskedQuestion, closeReAskedQuestion, registerCompactionCommands, registerCompactionCallbacks, } = (0, compaction_1.createCompaction)({
|
|
5188
|
+
const { checkIsThreadCompacting, noteThreadActivity, noteThreadUserActivity, markThreadTurnProducedOutput, postOwnCompactionInstructionGaps, routeStreamedCompactionSummaryTail, clearThreadCompaction, rearmThreadIdleTimer, armDeferredCompaction, checkIsDeferredCompactionArmed, threadsCompacting, answerReAskedQuestionByNumber, reAskInterruptedQuestion, restoreReAskedQuestion, closeSavedReAskedQuestion, closeReAskedQuestion, syncThreadCompactSelfReviewFlags, syncAllCompactSelfReviewFlags, registerCompactionCommands, registerCompactionCallbacks, } = (0, compaction_1.createCompaction)({
|
|
5179
5189
|
...botCore,
|
|
5180
5190
|
startTypingLoader,
|
|
5181
5191
|
forwardPromptToAgent: async (key, adapter, text) => { await forwardPromptToAgent(key, adapter, text); },
|
|
@@ -5194,6 +5204,7 @@ const { checkIsThreadCompacting, noteThreadActivity, noteThreadUserActivity, mar
|
|
|
5194
5204
|
checkIsStarting: (key) => startupPromptBuffer.checkIsStarting((0, sessionKey_1.keyToString)(key)),
|
|
5195
5205
|
closeOrphanQuestionMessage,
|
|
5196
5206
|
notePersonActivity,
|
|
5207
|
+
compactSelfReviewFlagDirs: (0, compactSelfReviewFlags_1.getCompactSelfReviewFlagDirs)((0, state_1.resolveDataDir)(), (0, openCodeCompactPlugin_1.resolveOpenCodeGlobalPluginDir)(process.env)),
|
|
5197
5208
|
});
|
|
5198
5209
|
/**
|
|
5199
5210
|
* @description True iff the neutral router owns `name`, i.e. a `/name` message
|
|
@@ -6700,11 +6711,13 @@ const { registerRunnersCommands, registerRunnersCallbacks, handleRunnersAddressT
|
|
|
6700
6711
|
getGeneralKey: () => getOperatorGeneralKey(),
|
|
6701
6712
|
pinMessage: (key, messageId) => pinMessageQuiet(key, messageId, { disableNotification: false }),
|
|
6702
6713
|
sweepExpiredCodes: async (nowMs) => { await (0, hubPairing_1.sweepExpiredPairings)(runnersHub, nowMs); },
|
|
6714
|
+
applyGroups: (runner) => (0, runnerGroups_1.applyRunnerGroups)(runnersHub, runner, runnersCacheDir),
|
|
6703
6715
|
readRunnerHost: (0, instanceSettings_1.createRunnerHostReader)(() => (0, instanceSettings_1.getInstanceSettingsPath)(), (line) => console.error(line)),
|
|
6704
6716
|
saveRunnerHost: (address) => (0, instanceSettings_1.saveInstanceSettingsChange)((0, instanceSettings_1.getInstanceSettingsPath)(), { runnerHost: address }),
|
|
6705
6717
|
getBotLabel: () => (bot.botInfo?.username === undefined ? os.hostname() : `@${bot.botInfo.username}`),
|
|
6706
6718
|
readOverview: (nowMs) => (0, runnersOverview_1.readRunnersOverview)(runnersHub, runnersCacheDir, nowMs),
|
|
6707
|
-
|
|
6719
|
+
// The 20 s deadline of the live probe, which the test seam may shorten (a flow that must see a BUSY machine cannot wait it out).
|
|
6720
|
+
probeOverview: (overview, nowMs) => (0, runnersOverview_1.probeRunnersOverview)(runnersHub, overview, runnersCacheDir, nowMs, ENV.testTimings.remoteRunProbeDeadlineMs),
|
|
6708
6721
|
listAddressCandidates: () => (0, hubAddressCandidates_1.listPublicAddressCandidates)(),
|
|
6709
6722
|
scanHostKey: hubAddress_1.scanHostKey,
|
|
6710
6723
|
ensureGateWrapper: () => { (0, gateWrapper_1.ensureGateWrapper)(runnersHub); },
|
|
@@ -6822,6 +6835,56 @@ const claudeUsageRefresher = (0, claudeUsageRefresher_1.createClaudeUsageRefresh
|
|
|
6822
6835
|
refreshOpenCode: (options) => openCodeUsagePoller.refreshAll(options),
|
|
6823
6836
|
markOpenCodeStale: (reason) => openCodeUsagePoller.markAllStale(reason),
|
|
6824
6837
|
});
|
|
6838
|
+
/**
|
|
6839
|
+
* What the daily recheck of a used-up API credit (`utils/claudeApiCreditRecheck.ts`) reads and does in the bot: the profiles
|
|
6840
|
+
* with their marks (after the operator's newer figures have ended the marks they supersede), their own keys, and the state it
|
|
6841
|
+
* writes — the attempt BEFORE the request, the renewal after an answer.
|
|
6842
|
+
*/
|
|
6843
|
+
const claudeApiCreditRecheckPorts = {
|
|
6844
|
+
nowMs: () => Date.now(),
|
|
6845
|
+
intervalMs: ENV.testTimings.creditRecheckIntervalMs ?? claudeApiCreditRecheck_1.claudeApiCreditRecheckIntervalMs,
|
|
6846
|
+
listProfiles: () => {
|
|
6847
|
+
syncClaudeApiCreditAnchors();
|
|
6848
|
+
return Object.entries(state.getAllClaudeProfileInfos()).map(([name, record]) => ({
|
|
6849
|
+
name,
|
|
6850
|
+
billing: record.billing ?? null,
|
|
6851
|
+
// The refusal the operator acted on awaits its answer too: the account is in use again, but nothing has confirmed the credit.
|
|
6852
|
+
creditExhaustedAt: record.creditExhaustedAt ?? record.creditUnconfirmedSince ?? null,
|
|
6853
|
+
creditRecheckedAt: record.creditRecheckedAt ?? null,
|
|
6854
|
+
}));
|
|
6855
|
+
},
|
|
6856
|
+
readApiKey: (name) => {
|
|
6857
|
+
if (name === claudeProfiles_1.defaultClaudeProfileName)
|
|
6858
|
+
return (0, claudeProfiles_1.readDefaultClaudeProfileApiKey)(state.getClaudeProfileInfo(name)?.isConsoleLoginKey === true);
|
|
6859
|
+
const configDir = (0, claudeProfiles_1.resolveClaudeProfileDir)((0, state_1.resolveDataDir)(), name);
|
|
6860
|
+
return configDir === null ? null : (0, claudeProfiles_1.readClaudeProfileApiKey)(configDir);
|
|
6861
|
+
},
|
|
6862
|
+
probe: (apiKey) => (0, claudeApiCreditRecheck_1.probeClaudeApiCredit)(apiKey),
|
|
6863
|
+
markRechecked: (name, atIso) => state.setClaudeProfileCreditRechecked(name, atIso),
|
|
6864
|
+
onRenewed: (name, atIso) => {
|
|
6865
|
+
if (!state.setClaudeProfileCreditRenewed(name, atIso))
|
|
6866
|
+
console.log(`[credit] ${name}: a refusal came in while the recheck was running, so the credit is not marked renewed`);
|
|
6867
|
+
},
|
|
6868
|
+
log: (line) => console.log(line),
|
|
6869
|
+
warn: (line) => console.warn(line),
|
|
6870
|
+
};
|
|
6871
|
+
/**
|
|
6872
|
+
* What the check of an agent's stop report on an API account (`utils/claudeApiAgentStop.ts`) reads and does in the bot: the same
|
|
6873
|
+
* key, attempt record and probe as the daily recheck above, a probe with a timeout of its own, and — instead of an unverified
|
|
6874
|
+
* used-up mark — a mark only on a refusal for the balance, an hour off AGENTS (their own field, never the topics' limit mark) otherwise.
|
|
6875
|
+
*/
|
|
6876
|
+
const claudeApiAgentStopPorts = {
|
|
6877
|
+
nowMs: () => Date.now(),
|
|
6878
|
+
readApiKey: (name) => claudeApiCreditRecheckPorts.readApiKey(name),
|
|
6879
|
+
probe: (apiKey, timeoutMs) => (0, claudeApiCreditRecheck_1.probeClaudeApiCredit)(apiKey, { timeoutMs }),
|
|
6880
|
+
markRechecked: (name, atIso) => state.setClaudeProfileCreditRechecked(name, atIso),
|
|
6881
|
+
markUsedUp: (name, atIso) => state.setClaudeProfileCreditExhausted(name, atIso),
|
|
6882
|
+
holdOff: (name, untilIso) => state.setClaudeProfileAgentHoldUntil(name, untilIso),
|
|
6883
|
+
checkIsRenewalAwaited: (name) => state.getClaudeProfileInfo(name)?.creditUnconfirmedSince !== undefined,
|
|
6884
|
+
onRenewed: (name, atIso) => claudeApiCreditRecheckPorts.onRenewed(name, atIso),
|
|
6885
|
+
log: (line) => console.log(line),
|
|
6886
|
+
warn: (line) => console.warn(line),
|
|
6887
|
+
};
|
|
6825
6888
|
/** The profile that owns a config directory (`null` = default); `null` for a directory outside the profiles root. */
|
|
6826
6889
|
function resolveClaudeProfileNameForDir(configDir) {
|
|
6827
6890
|
if (configDir === null)
|
|
@@ -6861,14 +6924,52 @@ function onClaudeTurnCost(key, configDir, report) {
|
|
|
6861
6924
|
const name = resolveClaudeProfileNameForDir(configDir);
|
|
6862
6925
|
if (name === null)
|
|
6863
6926
|
return;
|
|
6927
|
+
// Read first: a figure newer than the account's used-up evidence ends it before this turn is judged against it.
|
|
6928
|
+
const creditAnchors = syncClaudeApiCreditAnchors();
|
|
6864
6929
|
const info = state.getClaudeProfileInfo(name);
|
|
6930
|
+
// The refusal the operator acted on (picked the account again) is still evidence: the turn that now goes through renews.
|
|
6865
6931
|
const outcome = (0, claudeApiSpend_1.getClaudeTurnCostOutcome)({
|
|
6866
|
-
billing: info?.billing ?? null,
|
|
6932
|
+
billing: info?.billing ?? null,
|
|
6933
|
+
isCreditExhausted: info?.creditExhaustedAt !== undefined || info?.creditUnconfirmedSince !== undefined,
|
|
6934
|
+
isError: report.isError,
|
|
6935
|
+
turnCostUsd,
|
|
6867
6936
|
});
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6937
|
+
const nowIso = new Date().toISOString();
|
|
6938
|
+
// A billed turn that goes through on an API account marked used up — or one the operator picked again after the refusal — is
|
|
6939
|
+
// the proof the daily recheck looks for: the credit is back, and the account's spend counter starts over from this turn.
|
|
6940
|
+
if (outcome.isCreditMarkCleared && info?.billing === 'api')
|
|
6941
|
+
state.setClaudeProfileCreditRenewed(name, nowIso);
|
|
6942
|
+
else if (outcome.isCreditMarkCleared)
|
|
6943
|
+
state.liftClaudeProfileCreditExhaustion(name);
|
|
6944
|
+
if (outcome.spendUsd === null)
|
|
6945
|
+
return;
|
|
6946
|
+
const apiSpend = (0, claudeApiSpend_1.addClaudeApiSpend)(info?.apiSpend, outcome.spendUsd, nowIso);
|
|
6947
|
+
state.setClaudeProfileApiSpend(name, apiSpend);
|
|
6948
|
+
// The same spend also counts in the account's credit period (`utils/claudeApiCredit.ts`), read AFTER a renewal above.
|
|
6949
|
+
const period = (0, claudeApiCredit_1.getClaudeApiCreditPeriod)({ anchor: creditAnchors[name], renewedAt: state.getClaudeProfileInfo(name)?.creditRenewedAt, apiSpend });
|
|
6950
|
+
const creditSpend = (0, claudeApiCredit_1.addClaudeApiCreditSpend)(state.getClaudeProfileInfo(name)?.creditSpend, period, outcome.spendUsd);
|
|
6951
|
+
if (creditSpend)
|
|
6952
|
+
state.setClaudeProfileCreditSpend(name, creditSpend);
|
|
6953
|
+
}
|
|
6954
|
+
/**
|
|
6955
|
+
* Read the operator's credit figures (`utils/claudeApiCredit.ts`) AND settle what they supersede: a figure newer than an
|
|
6956
|
+
* account's used-up evidence (the mark, or the refusal the operator acted on) ends that evidence — the operator saying there is
|
|
6957
|
+
* money is the signal a billed turn going through is — so the stored mark, the fallback chain and the screens never contradict
|
|
6958
|
+
* the figure. It writes state: a call whose result is dropped is meant (a read path that must see the settled marks).
|
|
6959
|
+
*/
|
|
6960
|
+
function syncClaudeApiCreditAnchors() {
|
|
6961
|
+
const anchors = (0, claudeApiCredit_1.readClaudeApiCreditAnchors)((0, state_1.resolveDataDir)());
|
|
6962
|
+
for (const name of (0, claudeApiCredit_1.listProfilesWithSupersededCreditEvidence)(state.getAllClaudeProfileInfos(), anchors))
|
|
6963
|
+
state.clearClaudeProfileCreditEvidence(name);
|
|
6964
|
+
return anchors;
|
|
6965
|
+
}
|
|
6966
|
+
/** Every Claude profile's usage view as the bot knows it now: its record plus the operator's credit figures. */
|
|
6967
|
+
function getClaudeProfileUsageViews() {
|
|
6968
|
+
return (0, claudeProfileUsageViews_1.buildClaudeProfileUsageViews)({ dataDir: (0, state_1.resolveDataDir)(), records: state.getAllClaudeProfileInfos(), creditAnchors: syncClaudeApiCreditAnchors() });
|
|
6969
|
+
}
|
|
6970
|
+
/** One profile's usage view — the very one `/limits` renders, for the rows of `/accounts`. */
|
|
6971
|
+
function getClaudeProfileUsageView(name) {
|
|
6972
|
+
return (0, claudeProfileUsageViews_1.buildClaudeProfileUsageView)({ dataDir: (0, state_1.resolveDataDir)(), name, record: state.getClaudeProfileInfo(name), creditAnchor: syncClaudeApiCreditAnchors()[name] });
|
|
6872
6973
|
}
|
|
6873
6974
|
/** The model a topic's Claude session runs (or last ran), for the usage ranking's choice of windows. */
|
|
6874
6975
|
function getThreadClaudeModel(key) {
|
|
@@ -6876,6 +6977,7 @@ function getThreadClaudeModel(key) {
|
|
|
6876
6977
|
}
|
|
6877
6978
|
/** What `/status` names of a Claude profile: its last probed sign-in and email, and its limit mark (none until probed). */
|
|
6878
6979
|
function readStatusAccountSource(name) {
|
|
6980
|
+
syncClaudeApiCreditAnchors();
|
|
6879
6981
|
const info = state.getClaudeProfileInfo(name);
|
|
6880
6982
|
return {
|
|
6881
6983
|
name, email: info?.email ?? null, loggedIn: info?.loggedIn, limitedUntil: info?.limitedUntil ?? null,
|
|
@@ -6907,7 +7009,7 @@ async function detectFallbackOptions() {
|
|
|
6907
7009
|
console.warn('[fallback] the OpenCode catalog is unavailable:', e instanceof Error ? e.message : e);
|
|
6908
7010
|
}
|
|
6909
7011
|
return {
|
|
6910
|
-
claudeProfiles: (
|
|
7012
|
+
claudeProfiles: getClaudeProfileUsageViews(),
|
|
6911
7013
|
openCodeModels,
|
|
6912
7014
|
recentOpenCodeModels: (0, openCodeAdapter_1.listSavedOpenCodeModelLabels)().reverse(),
|
|
6913
7015
|
openCodeLimits: state.getOpenCodeModelLimits(),
|
|
@@ -6974,6 +7076,7 @@ function getConversationAccountState(key) {
|
|
|
6974
7076
|
const checkIsFuture = (instant) => instant !== undefined && Date.parse(instant) > nowMs;
|
|
6975
7077
|
if (position.backend === 'opencode')
|
|
6976
7078
|
return { isLimited: checkIsFuture(state.getOpenCodeModelLimitedUntil((0, fallbackChain_1.buildOpenCodeModelLabel)(position))), isApiBilled: false };
|
|
7079
|
+
syncClaudeApiCreditAnchors();
|
|
6977
7080
|
const info = state.getClaudeProfileInfo(position.profile);
|
|
6978
7081
|
return { isLimited: checkIsFuture(info?.limitedUntil) || info?.creditExhaustedAt !== undefined, isApiBilled: info?.billing === 'api' };
|
|
6979
7082
|
}
|
|
@@ -7403,9 +7506,10 @@ function buildBackendSwitchTargetOfRung(to) {
|
|
|
7403
7506
|
*/
|
|
7404
7507
|
async function switchTopicByOperator(key, to) {
|
|
7405
7508
|
// The operator's own pick of an account whose API credits were used up is the act that ends that mark (topped up, or
|
|
7406
|
-
// trying anyway): a failing request marks it again.
|
|
7509
|
+
// trying anyway): a failing request marks it again. An API account keeps the refusal as unconfirmed, so the first turn that
|
|
7510
|
+
// goes through still records the renewal.
|
|
7407
7511
|
if (to.backend === 'claude')
|
|
7408
|
-
state.
|
|
7512
|
+
state.liftClaudeProfileCreditExhaustion(to.profile);
|
|
7409
7513
|
const currentFamily = getTopicBackendFamily(key);
|
|
7410
7514
|
const from = getTopicFallbackPosition(key);
|
|
7411
7515
|
const isUsageLimitWaitArmed = getArmedApiRetry(key)?.kind === 'usageLimit';
|
|
@@ -7486,13 +7590,23 @@ async function takeFallbackSwitchOffer(key, episodeId, index) {
|
|
|
7486
7590
|
/**
|
|
7487
7591
|
* The `claude_profiles` MCP tool's answer: snapshots refreshed on demand (a minute's cache; the account a resumed session
|
|
7488
7592
|
* was stopped on is re-read at once), then the launch pick — a new agent, or the session's own account when it is warm.
|
|
7489
|
-
*
|
|
7490
|
-
*
|
|
7491
|
-
*
|
|
7593
|
+
* Only the accounts the operator's `/limits` list holds with an enabled rung are named once it lists any Claude account (an
|
|
7594
|
+
* account billed to API credits among them goes first, `getClaudeLaunchPick`). A resumed session reported stopped on an API
|
|
7595
|
+
* account is CHECKED, not believed (`verifyClaudeApiAgentStop`): one probe on its key marks the credit used up only if the API
|
|
7596
|
+
* refuses for the balance; otherwise the account is just kept off agents for an hour. The check runs beside the usage refresh
|
|
7597
|
+
* with a timeout of its own, so the answer is held for the longer of the two, never their sum. The refresh is waited for only
|
|
7598
|
+
* up to `claudeLaunchRefreshBudgetMs`; past it the cached figures are answered (an agent that waits on a silent tool call is
|
|
7599
|
+
* dropped by its own client after 300 s).
|
|
7492
7600
|
*/
|
|
7493
7601
|
async function listClaudeProfilesForAgent(query) {
|
|
7494
|
-
|
|
7495
|
-
|
|
7602
|
+
const stoppedApiProfile = (0, claudeApiAgentStop_1.getApiProfileStoppedByAgent)(getClaudeProfileUsageViews(), query, Date.now());
|
|
7603
|
+
await Promise.all([
|
|
7604
|
+
(0, claudeUsageRefresher_1.refreshClaudeUsageForLaunch)(claudeUsageRefresher, { currentProfile: query.currentProfile, isStoppedByLimit: query.isStoppedByLimit, maxAgeMs: claudeUsageRefresher_1.claudeUsageOnDemandMaxAgeMs }),
|
|
7605
|
+
stoppedApiProfile === null
|
|
7606
|
+
? Promise.resolve()
|
|
7607
|
+
: (0, claudeApiAgentStop_1.verifyClaudeApiAgentStop)(stoppedApiProfile, claudeApiAgentStopPorts).then(() => undefined, (e) => console.warn(`[credit] ${stoppedApiProfile}: checking an agent's stop report failed:`, e instanceof Error ? e.message : e)),
|
|
7608
|
+
]);
|
|
7609
|
+
return (0, claudeProfileUsageViews_1.buildClaudeProfilesCreditReport)(getClaudeProfileUsageViews(), query.model, Date.now(), { currentProfile: query.currentProfile, isStoppedByLimit: query.isStoppedByLimit, chainScope: (0, fallbackChain_1.getClaudeLaunchChainScope)(state.getFallbackChain()) });
|
|
7496
7610
|
}
|
|
7497
7611
|
const { registerFallbackChainCommands, registerFallbackChainCallbacks, openAutoSwitchView, runAutoSwitchCommand, applyAutoSwitch } = (0, fallbackChain_2.createFallbackChain)({
|
|
7498
7612
|
...botCore,
|
|
@@ -7542,6 +7656,8 @@ const { registerClaudeAccountCommands, registerClaudeAccountCallbacks, checkIsAw
|
|
|
7542
7656
|
startOpenCodeConnect: showConnectMethodPicker,
|
|
7543
7657
|
applyAutoSwitch,
|
|
7544
7658
|
verifyAnthropicApiKey: (apiKey) => (0, anthropicApiKeyCheck_1.verifyAnthropicApiKey)(apiKey),
|
|
7659
|
+
getProfileUsageView: getClaudeProfileUsageView,
|
|
7660
|
+
checkIsProfileMissingFromLimitsList: (name) => (0, fallbackChain_1.checkIsClaudeProfileMissingFromChain)(state.getFallbackChain(), name),
|
|
7545
7661
|
});
|
|
7546
7662
|
claudeProfileAuthStatusSink = recordClaudeProfileAuthStatus;
|
|
7547
7663
|
claudeProfileApiKeySink = storeClaudeProfileApiKey;
|
|
@@ -8184,7 +8300,7 @@ const botCommands = new Set([
|
|
|
8184
8300
|
'start', 'claude', 'opencode', 'oc', 'terminal', 'agent', 'sessions', 'resume', 'cancel', 'model', 'connect',
|
|
8185
8301
|
'disconnect', 'stop', 'stopall', 'stop-all', 'quit-all', 'status', 'c', 'y', 'n', 'enter', 'up', 'down', 'tab', 'esc', 'escape', 'interrupt', 'output', 'clear_messages',
|
|
8186
8302
|
'bind', 'topic', 'unbind', 'where', 'ls', 'list', 'new', 'whoami', 'version', 'help', 'language', 'lang',
|
|
8187
|
-
'doctor', 'mcp', 'rename_session', 'compact', 'compact_on_idle', 'compact_summary', 'bot_skills', 'task_agents', 'runners', 'auto_continue_limits', 'limits', 'limits_autoswitch', 'trace', 'timestamps', 'timezone', 'schedule', 'reminders', 'todo', 'thinking', 'tool_results',
|
|
8303
|
+
'doctor', 'mcp', 'rename_session', 'compact', 'compact_on_idle', 'compact_summary', 'compact_self_review', 'bot_skills', 'task_agents', 'runners', 'auto_continue_limits', 'limits', 'limits_autoswitch', 'trace', 'timestamps', 'timezone', 'schedule', 'reminders', 'todo', 'thinking', 'tool_results',
|
|
8188
8304
|
'subagent', 'claude_mode', 'effort', 'verbosity', 'quit', 'q', 'quitall', 'pair', 'account', 'accounts', 'fallback', 'stt', 'voice', 'speech', 'update',
|
|
8189
8305
|
]);
|
|
8190
8306
|
/**
|
|
@@ -9891,10 +10007,23 @@ function handleAgentOutput(key, output, meta) {
|
|
|
9891
10007
|
// skip while THIS thread's own compaction streams (loop guard).
|
|
9892
10008
|
markThreadTurnProducedOutput(key);
|
|
9893
10009
|
noteThreadActivity(key);
|
|
9894
|
-
// A backend's own streamed compaction summary (OpenCode) obeys `/compact_summary`, like the
|
|
9895
|
-
//
|
|
9896
|
-
|
|
10010
|
+
// A backend's own streamed compaction summary (OpenCode) obeys `/compact_summary`, like the summary the bot posts for the
|
|
10011
|
+
// other backends: off → the compaction ends in its short notices, plus the summary's self-review section, which is
|
|
10012
|
+
// shown in hide mode too; on → the summary is shown without the marker lines the agent was asked to write.
|
|
10013
|
+
if (meta?.isCompactionSummary) {
|
|
10014
|
+
const summaryTail = routeStreamedCompactionSummaryTail(key, output, meta);
|
|
10015
|
+
if (summaryTail === null)
|
|
10016
|
+
return;
|
|
10017
|
+
deliverAgentOutput(key, summaryTail.text, { ...meta, isContinuation: summaryTail.isContinuation });
|
|
9897
10018
|
return;
|
|
10019
|
+
}
|
|
10020
|
+
deliverAgentOutput(key, output, meta);
|
|
10021
|
+
}
|
|
10022
|
+
/**
|
|
10023
|
+
* @description The rest of {@link handleAgentOutput} for the text that is going to the topic: the answers-only view, the
|
|
10024
|
+
* sub-agent chunks, the questions and the answer itself.
|
|
10025
|
+
*/
|
|
10026
|
+
function deliverAgentOutput(key, output, meta) {
|
|
9898
10027
|
// Answers-only view (S9): the agent's text — sub-agent chunks and progress
|
|
9899
10028
|
// bursts included — never reaches the topic; a native question still does (it
|
|
9900
10029
|
// falls through to its branch below). A real answer still retires a pinned
|
|
@@ -11284,6 +11413,7 @@ exports.COMMANDS_MENU = [
|
|
|
11284
11413
|
{ command: 'compact', description: '🧹 Compact agent context' },
|
|
11285
11414
|
{ command: 'compact_on_idle', description: '🧹 Auto-compact after idle (toggle)' },
|
|
11286
11415
|
{ command: 'compact_summary', description: '📄 Post the compaction summary (toggle)' },
|
|
11416
|
+
{ command: 'compact_self_review', description: '💡 Agent self-review on compaction: its mistakes and what to change in its instructions' },
|
|
11287
11417
|
{ command: 'bot_skills', description: '🧰 The bot\'s own skills for agents (on/off)' },
|
|
11288
11418
|
{ command: 'task_agents', description: '🧵 How many tracker task agents work at once' },
|
|
11289
11419
|
{ command: 'runners', description: '🖥 Runners — machines for the agents\' tests and builds' },
|
|
@@ -12774,6 +12904,8 @@ async function startBot() {
|
|
|
12774
12904
|
(0, createAdapter_1.registerClaudeConfigDirReader)(resolveThreadClaudeConfigDir);
|
|
12775
12905
|
// The «Bot skills» switch (`/bot_skills`): every agent start, the OpenCode server's start and the bot MCP's instructions read it.
|
|
12776
12906
|
(0, botSkills_1.setBotSkillsReader)(botSkillsReader);
|
|
12907
|
+
// The flags the CLI's and OpenCode's own compactions read for `/compact_self_review` follow the saved settings from the start.
|
|
12908
|
+
syncAllCompactSelfReviewFlags();
|
|
12777
12909
|
(0, createAdapter_1.registerClaudeRateLimitSink)(onClaudeRateLimitEvent);
|
|
12778
12910
|
(0, createAdapter_1.registerClaudeTurnCostSink)(onClaudeTurnCost);
|
|
12779
12911
|
if (ENV.testTimings.openCodeServerUpBudgetMs !== undefined)
|
|
@@ -12781,6 +12913,8 @@ async function startBot() {
|
|
|
12781
12913
|
// The usage cache: a first poll now (off the boot path), then the timer.
|
|
12782
12914
|
claudeUsageRefresher.start();
|
|
12783
12915
|
void claudeUsageRefresher.refreshAll();
|
|
12916
|
+
// The daily recheck of API accounts marked used up (`utils/claudeApiCreditRecheck.ts`): a pass now — a day may have passed while the bot was down — then the timer.
|
|
12917
|
+
(0, claudeApiCreditRecheck_1.startClaudeApiCreditRechecks)(claudeApiCreditRecheckPorts, ENV.testTimings.creditRecheckPollMs ?? claudeApiCreditRecheck_1.claudeApiCreditRecheckPollMs);
|
|
12784
12918
|
const jiraConnector = ENV.servedPlatforms.has('jira') ? await prepareJiraConnectorOrExit() : null;
|
|
12785
12919
|
todoJiraConversations = jiraConnector;
|
|
12786
12920
|
if (jiraConnector) {
|
|
@@ -12963,7 +13097,11 @@ async function startBot() {
|
|
|
12963
13097
|
void todoReminderEngine?.noteAdapterTurnEnd(key).catch((e) => console.warn(`[todos] the turn end of ${(0, sessionKey_1.keyToString)(key)} was not noted:`, e instanceof Error ? e.message : e));
|
|
12964
13098
|
handleAgentTurnEnded(key);
|
|
12965
13099
|
}),
|
|
12966
|
-
onContextCompacted: (key, trigger) => (0, adapterEventRouting_1.dispatchAdapterEvent)(key, 'contextCompacted', () =>
|
|
13100
|
+
onContextCompacted: (key, trigger) => (0, adapterEventRouting_1.dispatchAdapterEvent)(key, 'contextCompacted', () => {
|
|
13101
|
+
noteConversationContextReset(key, `compaction (${trigger ?? 'bot'})`);
|
|
13102
|
+
// The CLI's own overflow compaction: nobody else posts its self-review section (a bot-issued one is its caller's).
|
|
13103
|
+
void postOwnCompactionInstructionGaps(key).catch((e) => console.warn(`[compact] ${(0, sessionKey_1.keyToString)(key)} the self-review section of the CLI's own compaction was not posted:`, e instanceof Error ? e.message : e));
|
|
13104
|
+
}),
|
|
12967
13105
|
onConversationLost: (key) => (0, adapterEventRouting_1.dispatchAdapterEvent)(key, 'conversationLost', () => withThreadLocale(key, () => handleConversationLost(key)), () => { dropLostConversationWatermark(key); noteConversationContextReset(key, 'its transcript was lost'); }),
|
|
12968
13106
|
onError: (key, error) => (0, adapterEventRouting_1.dispatchAdapterEvent)(key, 'error', () => withThreadLocale(key, () => handleAgentError(key, error)), () => {
|
|
12969
13107
|
console.error(`[Bot] adapter error ${(0, sessionKey_1.keyToString)(key)}:`, error.message);
|