charness 3.11.0 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +5 -0
- package/CHANGELOG.md +169 -0
- package/DEVELOPMENT.md +81 -18
- package/README.md +3 -2
- package/SETUP.md +71 -25
- package/agent-plugin/README.md +15 -6
- package/agent-plugin/skills/charness-delegate-claude/SKILL.md +37 -18
- 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/accessControl.d.ts +43 -0
- package/dist/accessControl.d.ts.map +1 -1
- package/dist/accessControl.js +50 -1
- package/dist/accessControl.js.map +1 -1
- package/dist/adapters/claudeCliAdapter.d.ts.map +1 -1
- package/dist/adapters/claudeCliAdapter.js +9 -4
- package/dist/adapters/claudeCliAdapter.js.map +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.js +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.js.map +1 -1
- package/dist/adapters/claudePlatformFlags.d.ts +4 -3
- package/dist/adapters/claudePlatformFlags.d.ts.map +1 -1
- package/dist/adapters/claudePlatformFlags.js +4 -3
- package/dist/adapters/claudePlatformFlags.js.map +1 -1
- package/dist/adapters/openCodeAdapter.d.ts +52 -13
- package/dist/adapters/openCodeAdapter.d.ts.map +1 -1
- package/dist/adapters/openCodeAdapter.js +121 -45
- package/dist/adapters/openCodeAdapter.js.map +1 -1
- package/dist/adapters/terminalAdapter.d.ts.map +1 -1
- package/dist/adapters/terminalAdapter.js +5 -3
- package/dist/adapters/terminalAdapter.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 +20 -20
- 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 +12 -3
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +634 -153
- 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 +45 -22
- 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/jira/client.js +1 -1
- package/dist/connectors/jira/client.js.map +1 -1
- package/dist/connectors/jira/config.d.ts +7 -0
- package/dist/connectors/jira/config.d.ts.map +1 -1
- package/dist/connectors/jira/config.js +12 -1
- package/dist/connectors/jira/config.js.map +1 -1
- package/dist/connectors/jira/connector.d.ts +7 -0
- package/dist/connectors/jira/connector.d.ts.map +1 -1
- package/dist/connectors/jira/connector.js +20 -3
- package/dist/connectors/jira/connector.js.map +1 -1
- package/dist/connectors/jira/inbound.d.ts.map +1 -1
- package/dist/connectors/jira/inbound.js +4 -3
- package/dist/connectors/jira/inbound.js.map +1 -1
- package/dist/connectors/jira/issueBlocks.d.ts +1 -1
- package/dist/connectors/jira/trustedGroup.d.ts +21 -6
- package/dist/connectors/jira/trustedGroup.d.ts.map +1 -1
- package/dist/connectors/jira/trustedGroup.js +46 -6
- package/dist/connectors/jira/trustedGroup.js.map +1 -1
- package/dist/connectors/telegram/commands/botCore.d.ts +19 -2
- package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
- 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 +16 -3
- package/dist/connectors/telegram/commands/compaction.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/compaction.js +216 -27
- 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/commands/todo.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/todo.js +2 -2
- package/dist/connectors/telegram/commands/todo.js.map +1 -1
- package/dist/connectors/telegram/commands/topicAccess.d.ts +30 -0
- package/dist/connectors/telegram/commands/topicAccess.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/topicAccess.js +399 -0
- package/dist/connectors/telegram/commands/topicAccess.js.map +1 -0
- package/dist/connectors/telegram/inbound.d.ts +44 -7
- package/dist/connectors/telegram/inbound.d.ts.map +1 -1
- package/dist/connectors/telegram/inbound.js +142 -24
- package/dist/connectors/telegram/inbound.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 +120 -8
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +120 -8
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +120 -8
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +120 -8
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/hi.d.ts.map +1 -1
- package/dist/i18n/hi.js +120 -8
- package/dist/i18n/hi.js.map +1 -1
- package/dist/i18n/ja.d.ts.map +1 -1
- package/dist/i18n/ja.js +120 -8
- package/dist/i18n/ja.js.map +1 -1
- package/dist/i18n/ka.d.ts.map +1 -1
- package/dist/i18n/ka.js +120 -8
- package/dist/i18n/ka.js.map +1 -1
- package/dist/i18n/pt.d.ts.map +1 -1
- package/dist/i18n/pt.js +120 -8
- package/dist/i18n/pt.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +120 -8
- package/dist/i18n/ru.js.map +1 -1
- package/dist/i18n/uk.d.ts.map +1 -1
- package/dist/i18n/uk.js +120 -8
- package/dist/i18n/uk.js.map +1 -1
- package/dist/i18n/uz.d.ts.map +1 -1
- package/dist/i18n/uz.js +120 -8
- package/dist/i18n/uz.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +120 -8
- package/dist/i18n/zh.js.map +1 -1
- package/dist/installManager.d.ts +37 -1
- package/dist/installManager.d.ts.map +1 -1
- package/dist/installManager.js +208 -14
- 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/commandRouter.d.ts +13 -1
- package/dist/platform/commandRouter.d.ts.map +1 -1
- package/dist/platform/commandRouter.js +14 -2
- package/dist/platform/commandRouter.js.map +1 -1
- package/dist/platform/inbound.d.ts +2 -0
- package/dist/platform/inbound.d.ts.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/runnerLock.d.ts +36 -1
- package/dist/runners/runnerLock.d.ts.map +1 -1
- package/dist/runners/runnerLock.js +94 -30
- package/dist/runners/runnerLock.js.map +1 -1
- 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/checkRun.d.ts +0 -2
- package/dist/scheduler/checkRun.d.ts.map +1 -1
- package/dist/scheduler/checkRun.js +0 -10
- package/dist/scheduler/checkRun.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/selfUpdate/bootRollback.d.ts.map +1 -1
- package/dist/selfUpdate/bootRollback.js +3 -2
- package/dist/selfUpdate/bootRollback.js.map +1 -1
- package/dist/selfUpdate/updateRuntime.d.ts.map +1 -1
- package/dist/selfUpdate/updateRuntime.js +6 -3
- package/dist/selfUpdate/updateRuntime.js.map +1 -1
- package/dist/state.d.ts +144 -2
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +257 -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/threadContextPreamble.d.ts +15 -1
- package/dist/threadContextPreamble.d.ts.map +1 -1
- package/dist/threadContextPreamble.js +15 -3
- package/dist/threadContextPreamble.js.map +1 -1
- package/dist/threadRouting.d.ts +47 -4
- package/dist/threadRouting.d.ts.map +1 -1
- package/dist/threadRouting.js +31 -4
- package/dist/threadRouting.js.map +1 -1
- package/dist/todos/projects.d.ts +1 -1
- package/dist/todos/projects.d.ts.map +1 -1
- package/dist/todos/projects.js +3 -14
- package/dist/todos/projects.js.map +1 -1
- package/dist/topicTalkerMemory.d.ts +37 -0
- package/dist/topicTalkerMemory.d.ts.map +1 -0
- package/dist/topicTalkerMemory.js +61 -0
- package/dist/topicTalkerMemory.js.map +1 -0
- package/dist/topicTalkers.d.ts +123 -0
- package/dist/topicTalkers.d.ts.map +1 -0
- package/dist/topicTalkers.js +276 -0
- package/dist/topicTalkers.js.map +1 -0
- package/dist/types.d.ts +7 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/agentEnvironment.d.ts +23 -0
- package/dist/utils/agentEnvironment.d.ts.map +1 -1
- package/dist/utils/agentEnvironment.js +33 -1
- package/dist/utils/agentEnvironment.js.map +1 -1
- package/dist/utils/agentPlugin.d.ts +9 -3
- package/dist/utils/agentPlugin.d.ts.map +1 -1
- package/dist/utils/agentPlugin.js +13 -6
- package/dist/utils/agentPlugin.js.map +1 -1
- package/dist/utils/authorMark.d.ts +59 -0
- package/dist/utils/authorMark.d.ts.map +1 -0
- package/dist/utils/authorMark.js +86 -0
- package/dist/utils/authorMark.js.map +1 -0
- 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/claudeLimitSwitch.d.ts +5 -1
- package/dist/utils/claudeLimitSwitch.d.ts.map +1 -1
- package/dist/utils/claudeLimitSwitch.js +6 -2
- package/dist/utils/claudeLimitSwitch.js.map +1 -1
- package/dist/utils/claudeProfileUsageLines.d.ts +14 -2
- package/dist/utils/claudeProfileUsageLines.d.ts.map +1 -1
- package/dist/utils/claudeProfileUsageLines.js +78 -7
- 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 +22 -0
- package/dist/utils/claudeProfiles.d.ts.map +1 -1
- package/dist/utils/claudeProfiles.js +69 -0
- package/dist/utils/claudeProfiles.js.map +1 -1
- package/dist/utils/claudeUsage.d.ts +145 -51
- package/dist/utils/claudeUsage.d.ts.map +1 -1
- package/dist/utils/claudeUsage.js +211 -94
- 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 +36 -16
- package/dist/utils/fallbackChain.js.map +1 -1
- package/dist/utils/folderGit.d.ts +9 -0
- package/dist/utils/folderGit.d.ts.map +1 -0
- package/dist/utils/folderGit.js +33 -0
- package/dist/utils/folderGit.js.map +1 -0
- package/dist/utils/forwardedMark.d.ts +8 -0
- package/dist/utils/forwardedMark.d.ts.map +1 -1
- package/dist/utils/forwardedMark.js +2 -0
- package/dist/utils/forwardedMark.js.map +1 -1
- package/dist/utils/jsonStreamHost.d.ts +2 -1
- package/dist/utils/jsonStreamHost.d.ts.map +1 -1
- package/dist/utils/jsonStreamHost.js +4 -2
- package/dist/utils/jsonStreamHost.js.map +1 -1
- package/dist/utils/messageContext.d.ts +22 -7
- package/dist/utils/messageContext.d.ts.map +1 -1
- package/dist/utils/messageContext.js +19 -5
- package/dist/utils/messageContext.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/personLabel.d.ts +13 -0
- package/dist/utils/personLabel.d.ts.map +1 -0
- package/dist/utils/personLabel.js +15 -0
- package/dist/utils/personLabel.js.map +1 -0
- package/dist/utils/replyQuote.d.ts +17 -3
- package/dist/utils/replyQuote.d.ts.map +1 -1
- package/dist/utils/replyQuote.js +25 -2
- package/dist/utils/replyQuote.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/dist/utils/talkerAccess.d.ts +9 -0
- package/dist/utils/talkerAccess.d.ts.map +1 -0
- package/dist/utils/talkerAccess.js +20 -0
- package/dist/utils/talkerAccess.js.map +1 -0
- package/dist/utils/tmuxExec.d.ts +20 -8
- package/dist/utils/tmuxExec.d.ts.map +1 -1
- package/dist/utils/tmuxExec.js +27 -7
- package/dist/utils/tmuxExec.js.map +1 -1
- package/dist/utils/topicAccessScreenPlan.d.ts +253 -0
- package/dist/utils/topicAccessScreenPlan.d.ts.map +1 -0
- package/dist/utils/topicAccessScreenPlan.js +287 -0
- package/dist/utils/topicAccessScreenPlan.js.map +1 -0
- package/dist/utils/topicLabel.d.ts +12 -0
- package/dist/utils/topicLabel.d.ts.map +1 -0
- package/dist/utils/topicLabel.js +12 -0
- package/dist/utils/topicLabel.js.map +1 -0
- package/dist/utils/topicRequest.d.ts +8 -5
- package/dist/utils/topicRequest.d.ts.map +1 -1
- package/dist/utils/topicRequest.js +9 -7
- package/dist/utils/topicRequest.js.map +1 -1
- package/npm-shrinkwrap.json +1003 -0
- package/package.json +5 -3
- 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
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.OpenCodeAdapter = exports.openCodeServerRestartRetryBudgetMs = exports.openCodeServerRestartRetryDelaysMs = exports.schedulerMcpRetryDelaysMs = exports.openCodeErrorMessageMaxLength = exports.providerRetryReplacementStartTimeoutMs = exports.criticalSseEventTypes = exports.openCodeRuntimeContextHydrationConcurrency = void 0;
|
|
36
|
+
exports.OpenCodeAdapter = exports.mislaunchedServerRecheckDelayMs = exports.openCodeServerRestartRetryBudgetMs = exports.openCodeServerRestartRetryDelaysMs = exports.schedulerMcpRetryDelaysMs = exports.openCodeErrorMessageMaxLength = exports.providerRetryReplacementStartTimeoutMs = exports.criticalSseEventTypes = exports.openCodeRuntimeContextHydrationConcurrency = void 0;
|
|
37
37
|
exports.listSavedOpenCodeModelLabels = listSavedOpenCodeModelLabels;
|
|
38
38
|
exports.normaliseOpenCodeSseEvent = normaliseOpenCodeSseEvent;
|
|
39
39
|
exports.buildDirectoryScopedPath = buildDirectoryScopedPath;
|
|
@@ -1010,6 +1010,12 @@ exports.openCodeServerRestartRetryDelaysMs = [2_000, 5_000, 10_000, 15_000, 20_0
|
|
|
1010
1010
|
* a hopeless start from holding the topics for minutes.
|
|
1011
1011
|
*/
|
|
1012
1012
|
exports.openCodeServerRestartRetryBudgetMs = 60_000;
|
|
1013
|
+
/**
|
|
1014
|
+
* How long {@link OpenCodeAdapter.replaceMislaunchedServer} waits before it looks again at a server it must replace while a
|
|
1015
|
+
* session works in it: a plain instance boots rarely, so "the next boot" alone could leave a server without a password open
|
|
1016
|
+
* for days.
|
|
1017
|
+
*/
|
|
1018
|
+
exports.mislaunchedServerRecheckDelayMs = 10 * 60_000;
|
|
1013
1019
|
/**
|
|
1014
1020
|
* @description The pause before retry number `retryIndex` (0-based), or
|
|
1015
1021
|
* `null` once the pauses are used up or the retry would start past `budgetMs`
|
|
@@ -1028,6 +1034,7 @@ const defaultOpenCodeServerRestartOps = {
|
|
|
1028
1034
|
ensureServer: installManager_1.ensureOpenCodeServer,
|
|
1029
1035
|
restartServer: installManager_1.restartOpenCodeServer,
|
|
1030
1036
|
readServerLaunch: installManager_1.readOpenCodeServerLaunch,
|
|
1037
|
+
readServerExposure: installManager_1.readOpenCodeServerExposure,
|
|
1031
1038
|
};
|
|
1032
1039
|
function buildProviderApiAuthPayload(apiKey) {
|
|
1033
1040
|
return { type: 'api', key: apiKey };
|
|
@@ -1235,7 +1242,6 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
1235
1242
|
*/
|
|
1236
1243
|
sseDropLogThrottle = new Map();
|
|
1237
1244
|
baseUrl;
|
|
1238
|
-
authHeader;
|
|
1239
1245
|
/**
|
|
1240
1246
|
* Grace period (ms) the fallback rename waits for opencode's native
|
|
1241
1247
|
* auto-title before stepping in. Instance field (initialised from
|
|
@@ -1268,8 +1274,12 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
1268
1274
|
* tests can fail attempts and shrink the pauses — production never changes them.
|
|
1269
1275
|
*/
|
|
1270
1276
|
serverRestartOps = defaultOpenCodeServerRestartOps;
|
|
1271
|
-
/** The
|
|
1272
|
-
|
|
1277
|
+
/** The boot step said once why it leaves the running server alone (`replaceMislaunchedServer`). */
|
|
1278
|
+
isMislaunchedServerSkipAnnounced = false;
|
|
1279
|
+
/** The pending look again of {@link replaceMislaunchedServer} at a server a working session kept it from replacing. */
|
|
1280
|
+
mislaunchedServerRecheckTimer = null;
|
|
1281
|
+
/** Instance field only so a test can shorten it; production keeps {@link mislaunchedServerRecheckDelayMs}. */
|
|
1282
|
+
mislaunchedServerRecheckDelayMs = exports.mislaunchedServerRecheckDelayMs;
|
|
1273
1283
|
serverRestartRetryDelaysMs = exports.openCodeServerRestartRetryDelaysMs;
|
|
1274
1284
|
serverRestartRetryBudgetMs = exports.openCodeServerRestartRetryBudgetMs;
|
|
1275
1285
|
/**
|
|
@@ -1335,14 +1345,6 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
1335
1345
|
super();
|
|
1336
1346
|
// Audit S7 / #34: SSRF guard on OPENCODE_URL before any fetch runs.
|
|
1337
1347
|
this.baseUrl = validateOpenCodeUrl(process.env.OPENCODE_URL || installManager_1.defaultOpenCodeUrl);
|
|
1338
|
-
const password = process.env.OPENCODE_PASSWORD;
|
|
1339
|
-
if (password) {
|
|
1340
|
-
const username = process.env.OPENCODE_USERNAME || 'opencode';
|
|
1341
|
-
this.authHeader = 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64');
|
|
1342
|
-
}
|
|
1343
|
-
else {
|
|
1344
|
-
this.authHeader = null;
|
|
1345
|
-
}
|
|
1346
1348
|
// Listen for unexpected server crashes (OOM kill, segfault, etc.)
|
|
1347
1349
|
(0, installManager_1.onOpenCodeServerExit)((code, signal) => {
|
|
1348
1350
|
console.error(`[OpenCode] Server crashed unexpectedly: code=${code}, signal=${signal}`);
|
|
@@ -1535,15 +1537,13 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
1535
1537
|
async reloadProviderAuth() {
|
|
1536
1538
|
return this.restartServer(true);
|
|
1537
1539
|
}
|
|
1540
|
+
/** @description Read per request: every server generation the bot starts has a password of its own. */
|
|
1538
1541
|
getHeaders() {
|
|
1539
|
-
|
|
1542
|
+
return {
|
|
1540
1543
|
'Content-Type': 'application/json',
|
|
1541
1544
|
'Accept': 'application/json',
|
|
1545
|
+
...(0, installManager_1.getOpenCodeServerAuthHeaders)(),
|
|
1542
1546
|
};
|
|
1543
|
-
if (this.authHeader) {
|
|
1544
|
-
headers['Authorization'] = this.authHeader;
|
|
1545
|
-
}
|
|
1546
|
-
return headers;
|
|
1547
1547
|
}
|
|
1548
1548
|
async apiRequest(method, urlPath, body, options) {
|
|
1549
1549
|
const url = `${this.baseUrl}${urlPath}`;
|
|
@@ -1665,6 +1665,9 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
1665
1665
|
lastEmittedLength: 0,
|
|
1666
1666
|
outputTimer: null,
|
|
1667
1667
|
compactionSummaryMessageId: null,
|
|
1668
|
+
isBotCompactionInFlight: false,
|
|
1669
|
+
botCompactionSummaryMessageId: null,
|
|
1670
|
+
responseMessageId: null,
|
|
1668
1671
|
isResponseCompactionSummary: false,
|
|
1669
1672
|
childResponseText: '',
|
|
1670
1673
|
childLastEmittedLength: 0,
|
|
@@ -1894,6 +1897,7 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
1894
1897
|
// Reset accumulated response text for new message
|
|
1895
1898
|
session.currentResponseText = '';
|
|
1896
1899
|
session.lastEmittedLength = 0;
|
|
1900
|
+
session.responseMessageId = null;
|
|
1897
1901
|
session.isResponseCompactionSummary = false;
|
|
1898
1902
|
// The child (sub-agent) accumulator resets with the parent's — a new turn
|
|
1899
1903
|
// starts clean (a stale debounce firing later emits nothing: empty tail).
|
|
@@ -2633,6 +2637,9 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
2633
2637
|
// compaction prompt (F2/S6) — only send it when non-empty so an ordinary
|
|
2634
2638
|
// `/compact` stays byte-identical to before.
|
|
2635
2639
|
const trimmedInstruction = instruction?.trim();
|
|
2640
|
+
// While the call is open the summary message the server announces is this call's (see `handleMessageUpdate`): the bot
|
|
2641
|
+
// reads its section itself after the call, so its streamed tails are marked as the bot's.
|
|
2642
|
+
session.isBotCompactionInFlight = true;
|
|
2636
2643
|
try {
|
|
2637
2644
|
await this.apiRequest('POST', buildDirectoryScopedPath(`/session/${session.sessionId}/summarize`, session.workDir), {
|
|
2638
2645
|
providerID: modelRef.providerID,
|
|
@@ -2649,6 +2656,9 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
2649
2656
|
console.warn(`[OpenCode] context compaction failed:`, reason);
|
|
2650
2657
|
return { ok: false, error: (0, i18n_1.t)('compact.failed', { reason }) };
|
|
2651
2658
|
}
|
|
2659
|
+
finally {
|
|
2660
|
+
session.isBotCompactionInFlight = false;
|
|
2661
|
+
}
|
|
2652
2662
|
}
|
|
2653
2663
|
/**
|
|
2654
2664
|
* @description Whether this thread's directory instance loaded the bot's
|
|
@@ -2862,6 +2872,9 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
2862
2872
|
lastEmittedLength: 0,
|
|
2863
2873
|
outputTimer: null,
|
|
2864
2874
|
compactionSummaryMessageId: null,
|
|
2875
|
+
isBotCompactionInFlight: false,
|
|
2876
|
+
botCompactionSummaryMessageId: null,
|
|
2877
|
+
responseMessageId: null,
|
|
2865
2878
|
isResponseCompactionSummary: false,
|
|
2866
2879
|
childResponseText: '',
|
|
2867
2880
|
childLastEmittedLength: 0,
|
|
@@ -3068,41 +3081,75 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
3068
3081
|
await Promise.allSettled(Array.from(directories, (directory) => this.reconcileSchedulerMcpForDirectory(directory)));
|
|
3069
3082
|
}
|
|
3070
3083
|
/**
|
|
3071
|
-
* @description Boot step
|
|
3072
|
-
*
|
|
3073
|
-
*
|
|
3074
|
-
*
|
|
3075
|
-
*
|
|
3076
|
-
* (
|
|
3077
|
-
*
|
|
3078
|
-
*
|
|
3084
|
+
* @description Boot step that replaces a server started the wrong way, which a running server never corrects by itself:
|
|
3085
|
+
* - the skills the bot gives its agents (`utils/agentPlugin.ts`): OpenCode reads its `OPENCODE_CONFIG_DIR` once, at start,
|
|
3086
|
+
* so a server started the other way than the instance's «Bot skills» switch says — without the bot's folder while the
|
|
3087
|
+
* switch is ON (an older bot, adopted ever since; the switch turned on since), with it while the switch is OFF — keeps
|
|
3088
|
+
* offering the wrong thing; only the INSTANCE value counts: one server serves every topic. Replaced only when the bot
|
|
3089
|
+
* owns it (its process record) AND `/proc` shows it is an `opencode … serve`, and the folder it would get is ready;
|
|
3090
|
+
* - its password: a server that answers a request without one lets every local account drive its agents. Read the way such
|
|
3091
|
+
* an account would, on every platform ({@link OpenCodeServerExposure}), and replaced whether the bot owns it or not — like a
|
|
3092
|
+
* stale version — as long as it is an `opencode … serve` the bot may stop: one a bot from before passwords left running,
|
|
3093
|
+
* and also one the operator runs on the bot's port (the idle check sees only the bot's sessions, so a turn of the
|
|
3094
|
+
* operator's own in it ends; the docs tell them to start such a server with `OPENCODE_SERVER_PASSWORD`). A test's
|
|
3095
|
+
* stand-in or another account's process never is.
|
|
3096
|
+
* The replacement is the controlled restart that restores the sessions, and only when no session is working: a busy
|
|
3097
|
+
* directory, or a status it cannot read, makes it look again after {@link mislaunchedServerRecheckDelayMs} (and at the
|
|
3098
|
+
* next boot). A server it leaves for another reason gets one log line per process. Best-effort, never rejects.
|
|
3079
3099
|
*/
|
|
3080
|
-
async
|
|
3100
|
+
async replaceMislaunchedServer() {
|
|
3081
3101
|
try {
|
|
3082
3102
|
const expectation = (0, agentPlugin_1.getOpenCodeAgentSkillsExpectation)(process.env, (0, state_1.resolveDataDir)(), (0, botSkills_1.checkIsBotSkillsEnabled)(null));
|
|
3083
|
-
const
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
console.log(`[OpenCode] the server ${reason}; it is left as is, and offers the bot's skills only if it was started with them`);
|
|
3089
|
-
}
|
|
3090
|
-
return;
|
|
3103
|
+
const skillsAction = (0, agentPlugin_1.getOpenCodeAgentSkillsServerAction)(await this.serverRestartOps.readServerLaunch(), expectation);
|
|
3104
|
+
const exposure = await this.serverRestartOps.readServerExposure();
|
|
3105
|
+
const faults = [];
|
|
3106
|
+
if (skillsAction === 'replace') {
|
|
3107
|
+
faults.push(expectation.kind === 'offered' ? `without the bot's skills` : `with the bot's skills, which the instance switched off`);
|
|
3091
3108
|
}
|
|
3092
|
-
if (
|
|
3109
|
+
if (exposure === 'openStoppable')
|
|
3110
|
+
faults.push('without a password (every local account can drive its agents)');
|
|
3111
|
+
if (faults.length === 0) {
|
|
3112
|
+
const reasonsLeft = [];
|
|
3113
|
+
if (skillsAction === 'skipNotOwned')
|
|
3114
|
+
reasonsLeft.push(`is not owned by the bot, and offers the bot's skills only if it was started with them`);
|
|
3115
|
+
if (skillsAction === 'skipUnidentified')
|
|
3116
|
+
reasonsLeft.push(`cannot be identified as \`opencode serve\`, and offers the bot's skills only if it was started with them`);
|
|
3117
|
+
if (exposure === 'openUnstoppable')
|
|
3118
|
+
reasonsLeft.push('answers without a password, and is not an `opencode serve` of the bot\'s user it may stop');
|
|
3119
|
+
if (reasonsLeft.length > 0)
|
|
3120
|
+
this.announceMislaunchedServerSkipOnce(`the server ${reasonsLeft.join('; it ')}; it is left as is`);
|
|
3093
3121
|
return;
|
|
3094
|
-
|
|
3122
|
+
}
|
|
3123
|
+
const startedWith = faults.join(' and ');
|
|
3095
3124
|
if (!(await this.checkIsEveryActiveSessionIdle())) {
|
|
3096
|
-
console.log(`[OpenCode] the server was started ${startedWith}; a session is working,
|
|
3125
|
+
console.log(`[OpenCode] the server was started ${startedWith}; a session is working, looking again in ${Math.round(this.mislaunchedServerRecheckDelayMs / 60_000)} min`);
|
|
3126
|
+
this.scheduleMislaunchedServerRecheck();
|
|
3097
3127
|
return;
|
|
3098
3128
|
}
|
|
3099
3129
|
console.log(`[OpenCode] the server was started ${startedWith}; replacing it`);
|
|
3100
3130
|
await this.restartServer(true);
|
|
3101
3131
|
}
|
|
3102
3132
|
catch (e) {
|
|
3103
|
-
console.warn(`[OpenCode] could not check the server
|
|
3133
|
+
console.warn(`[OpenCode] could not check how the server was started:`, e instanceof Error ? e.message : e);
|
|
3104
3134
|
}
|
|
3105
3135
|
}
|
|
3136
|
+
/** @description Look again at the server once the delay is over; one pending look at a time, never holding the process open. */
|
|
3137
|
+
scheduleMislaunchedServerRecheck() {
|
|
3138
|
+
if (this.mislaunchedServerRecheckTimer)
|
|
3139
|
+
return;
|
|
3140
|
+
this.mislaunchedServerRecheckTimer = setTimeout(() => {
|
|
3141
|
+
this.mislaunchedServerRecheckTimer = null;
|
|
3142
|
+
void this.replaceMislaunchedServer();
|
|
3143
|
+
}, this.mislaunchedServerRecheckDelayMs);
|
|
3144
|
+
this.mislaunchedServerRecheckTimer.unref();
|
|
3145
|
+
}
|
|
3146
|
+
/** @description Say once per process why {@link replaceMislaunchedServer} leaves the running server alone. */
|
|
3147
|
+
announceMislaunchedServerSkipOnce(line) {
|
|
3148
|
+
if (this.isMislaunchedServerSkipAnnounced)
|
|
3149
|
+
return;
|
|
3150
|
+
this.isMislaunchedServerSkipAnnounced = true;
|
|
3151
|
+
console.log(`[OpenCode] ${line}`);
|
|
3152
|
+
}
|
|
3106
3153
|
/**
|
|
3107
3154
|
* @description Whether no active session is working — by the adapter's own view and by each directory's status.
|
|
3108
3155
|
*
|
|
@@ -3456,10 +3503,8 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
3456
3503
|
const streamLabel = stream.directory;
|
|
3457
3504
|
const headers = {
|
|
3458
3505
|
'Accept': 'text/event-stream',
|
|
3506
|
+
...(0, installManager_1.getOpenCodeServerAuthHeaders)(),
|
|
3459
3507
|
};
|
|
3460
|
-
if (this.authHeader) {
|
|
3461
|
-
headers['Authorization'] = this.authHeader;
|
|
3462
|
-
}
|
|
3463
3508
|
// Audit S7 / #12: SSE was previously read with no abort path —
|
|
3464
3509
|
// `await reader.read()` blocks until bytes arrive, so a teardown during a
|
|
3465
3510
|
// silent server couldn't actually free the connection. The stream-scoped
|
|
@@ -4038,8 +4083,8 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
4038
4083
|
const text = delta || '';
|
|
4039
4084
|
if (!text)
|
|
4040
4085
|
return;
|
|
4041
|
-
if (messageId !== undefined
|
|
4042
|
-
|
|
4086
|
+
if (messageId !== undefined)
|
|
4087
|
+
this.followResponseMessage(key, session, messageId);
|
|
4043
4088
|
session.currentResponseText += text;
|
|
4044
4089
|
// Debounce: batch rapid SSE deltas before emitting
|
|
4045
4090
|
if (session.outputTimer) {
|
|
@@ -4050,6 +4095,29 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
4050
4095
|
this.emitResponseTail(key, session);
|
|
4051
4096
|
}, sseOutputBatchMs);
|
|
4052
4097
|
}
|
|
4098
|
+
/**
|
|
4099
|
+
* @description Keep the buffer's text and its tails to ONE message at the edge of a compaction summary. The buffer holds
|
|
4100
|
+
* whatever arrives until a turn flush, so without this a tail could carry the agent's words and the first words of a
|
|
4101
|
+
* summary (tagged as the summary, and dropped with it when the summary is hidden), and the agent's answer after a summary
|
|
4102
|
+
* in the same turn would be tagged as the summary too. When the deltas move from one message to another and either of the
|
|
4103
|
+
* two is a summary, the pending tail is sent as it is and the buffer starts afresh: the next tail is the first of a message
|
|
4104
|
+
* of its own, not a continuation of the one before. Messages that are no summary share the buffer as they always did.
|
|
4105
|
+
*/
|
|
4106
|
+
followResponseMessage(key, session, messageId) {
|
|
4107
|
+
const isSummaryMessage = messageId === session.compactionSummaryMessageId;
|
|
4108
|
+
const isNewMessage = session.responseMessageId !== null && messageId !== session.responseMessageId;
|
|
4109
|
+
if (isNewMessage && (isSummaryMessage || session.isResponseCompactionSummary)) {
|
|
4110
|
+
if (session.outputTimer) {
|
|
4111
|
+
clearTimeout(session.outputTimer);
|
|
4112
|
+
session.outputTimer = null;
|
|
4113
|
+
}
|
|
4114
|
+
this.emitResponseTail(key, session);
|
|
4115
|
+
session.currentResponseText = '';
|
|
4116
|
+
session.lastEmittedLength = 0;
|
|
4117
|
+
}
|
|
4118
|
+
session.responseMessageId = messageId;
|
|
4119
|
+
session.isResponseCompactionSummary = isSummaryMessage;
|
|
4120
|
+
}
|
|
4053
4121
|
/**
|
|
4054
4122
|
* @description Emit only the part of `currentResponseText` not yet sent as
|
|
4055
4123
|
* an `output` event, then advance `lastEmittedLength`. The bot does not
|
|
@@ -4073,8 +4141,11 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
4073
4141
|
// `isFinal` rides only the idle-triggered flush so the bot can skip the
|
|
4074
4142
|
// possibly-429-stretched debounce for the turn's last frame.
|
|
4075
4143
|
const meta = { isContinuation, isFinal };
|
|
4076
|
-
if (session.isResponseCompactionSummary)
|
|
4144
|
+
if (session.isResponseCompactionSummary && session.responseMessageId !== null) {
|
|
4077
4145
|
meta.isCompactionSummary = true;
|
|
4146
|
+
meta.compactionSummaryMessageId = session.responseMessageId;
|
|
4147
|
+
meta.isBotIssuedCompaction = session.responseMessageId === session.botCompactionSummaryMessageId;
|
|
4148
|
+
}
|
|
4078
4149
|
this.emit('output', key, tail, meta);
|
|
4079
4150
|
session.lastEmittedLength = session.currentResponseText.length;
|
|
4080
4151
|
}
|
|
@@ -4413,8 +4484,12 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
4413
4484
|
if (info.role === 'assistant')
|
|
4414
4485
|
session.sawTurnActivity = true;
|
|
4415
4486
|
// The summary message is stored (and announced here) before its text streams.
|
|
4416
|
-
if (isParentAssistantMessage && info.summary === true && info.id)
|
|
4487
|
+
if (isParentAssistantMessage && info.summary === true && info.id) {
|
|
4417
4488
|
session.compactionSummaryMessageId = info.id;
|
|
4489
|
+
// A summary announced while the bot's own compaction call is open is that call's: it, not the server, started it.
|
|
4490
|
+
if (session.isBotCompactionInFlight)
|
|
4491
|
+
session.botCompactionSummaryMessageId = info.id;
|
|
4492
|
+
}
|
|
4418
4493
|
if (info.role === 'user' && (!info.sessionID || info.sessionID === session.sessionId)) {
|
|
4419
4494
|
this.noteUserMessageSeen(session, info.id);
|
|
4420
4495
|
}
|
|
@@ -4986,6 +5061,7 @@ class OpenCodeAdapter extends events_1.EventEmitter {
|
|
|
4986
5061
|
this.emitResponseTail(key, session, isFinal);
|
|
4987
5062
|
session.currentResponseText = '';
|
|
4988
5063
|
session.lastEmittedLength = 0;
|
|
5064
|
+
session.responseMessageId = null;
|
|
4989
5065
|
session.isResponseCompactionSummary = false;
|
|
4990
5066
|
session.childResponseText = '';
|
|
4991
5067
|
session.childLastEmittedLength = 0;
|