charness 3.0.0 → 3.1.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/README.md +188 -16
- package/dist/adapters/claudeCliAdapter.d.ts +15 -0
- package/dist/adapters/claudeCliAdapter.d.ts.map +1 -1
- package/dist/adapters/claudeCliAdapter.js +36 -1
- package/dist/adapters/claudeCliAdapter.js.map +1 -1
- package/dist/adapters/claudeConfigDir.d.ts +40 -0
- package/dist/adapters/claudeConfigDir.d.ts.map +1 -0
- package/dist/adapters/claudeConfigDir.js +3 -0
- package/dist/adapters/claudeConfigDir.js.map +1 -0
- package/dist/adapters/claudeJsonStreamAdapter.d.ts +32 -0
- package/dist/adapters/claudeJsonStreamAdapter.d.ts.map +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.js +89 -8
- package/dist/adapters/claudeJsonStreamAdapter.js.map +1 -1
- package/dist/adapters/claudePlatformFlags.d.ts +4 -4
- package/dist/adapters/claudePlatformFlags.js +4 -4
- package/dist/adapters/createAdapter.d.ts +8 -0
- package/dist/adapters/createAdapter.d.ts.map +1 -1
- package/dist/adapters/createAdapter.js +37 -0
- package/dist/adapters/createAdapter.js.map +1 -1
- package/dist/adapters/openCodeAdapter.d.ts +23 -0
- package/dist/adapters/openCodeAdapter.d.ts.map +1 -1
- package/dist/adapters/openCodeAdapter.js +84 -1
- package/dist/adapters/openCodeAdapter.js.map +1 -1
- package/dist/agentLogin/agentLogin.d.ts +15 -2
- package/dist/agentLogin/agentLogin.d.ts.map +1 -1
- package/dist/agentLogin/agentLogin.js +53 -16
- package/dist/agentLogin/agentLogin.js.map +1 -1
- package/dist/apiErrorRetry.d.ts +8 -3
- package/dist/apiErrorRetry.d.ts.map +1 -1
- package/dist/apiErrorRetry.js +36 -5
- package/dist/apiErrorRetry.js.map +1 -1
- package/dist/apiRetryKick.d.ts +9 -0
- package/dist/apiRetryKick.d.ts.map +1 -1
- package/dist/apiRetryKick.js +16 -0
- package/dist/apiRetryKick.js.map +1 -1
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +639 -24
- package/dist/bot.js.map +1 -1
- package/dist/cli/claudeProfiles.d.ts +42 -0
- package/dist/cli/claudeProfiles.d.ts.map +1 -0
- package/dist/cli/claudeProfiles.js +106 -0
- package/dist/cli/claudeProfiles.js.map +1 -0
- package/dist/cli.js +10 -0
- package/dist/cli.js.map +1 -1
- package/dist/connectors/jira/adf.d.ts +2 -0
- package/dist/connectors/jira/adf.d.ts.map +1 -1
- package/dist/connectors/jira/adf.js +5 -0
- package/dist/connectors/jira/adf.js.map +1 -1
- package/dist/connectors/jira/answerSink.d.ts +7 -0
- package/dist/connectors/jira/answerSink.d.ts.map +1 -1
- package/dist/connectors/jira/answerSink.js +24 -10
- package/dist/connectors/jira/answerSink.js.map +1 -1
- package/dist/connectors/jira/attachmentTool.d.ts +7 -0
- package/dist/connectors/jira/attachmentTool.d.ts.map +1 -1
- package/dist/connectors/jira/attachmentTool.js +16 -0
- package/dist/connectors/jira/attachmentTool.js.map +1 -1
- package/dist/connectors/jira/client.d.ts +32 -0
- package/dist/connectors/jira/client.d.ts.map +1 -1
- package/dist/connectors/jira/client.js +43 -5
- package/dist/connectors/jira/client.js.map +1 -1
- package/dist/connectors/jira/config.d.ts +3 -16
- package/dist/connectors/jira/config.d.ts.map +1 -1
- package/dist/connectors/jira/config.js +5 -32
- package/dist/connectors/jira/config.js.map +1 -1
- package/dist/connectors/jira/connector.d.ts +3 -0
- package/dist/connectors/jira/connector.d.ts.map +1 -1
- package/dist/connectors/jira/connector.js +70 -15
- package/dist/connectors/jira/connector.js.map +1 -1
- package/dist/connectors/jira/contextLedger.d.ts +1 -0
- package/dist/connectors/jira/contextLedger.d.ts.map +1 -1
- package/dist/connectors/jira/contextLedger.js +2 -0
- package/dist/connectors/jira/contextLedger.js.map +1 -1
- package/dist/connectors/jira/inbound.d.ts +15 -6
- package/dist/connectors/jira/inbound.d.ts.map +1 -1
- package/dist/connectors/jira/inbound.js +37 -22
- package/dist/connectors/jira/inbound.js.map +1 -1
- package/dist/connectors/jira/issueBlocks.d.ts +26 -3
- package/dist/connectors/jira/issueBlocks.d.ts.map +1 -1
- package/dist/connectors/jira/issueBlocks.js +104 -29
- package/dist/connectors/jira/issueBlocks.js.map +1 -1
- package/dist/connectors/jira/issueContext.d.ts +11 -5
- package/dist/connectors/jira/issueContext.d.ts.map +1 -1
- package/dist/connectors/jira/issueContext.js +23 -6
- package/dist/connectors/jira/issueContext.js.map +1 -1
- package/dist/connectors/jira/issueDelta.d.ts +3 -0
- package/dist/connectors/jira/issueDelta.d.ts.map +1 -1
- package/dist/connectors/jira/issueDelta.js +15 -6
- package/dist/connectors/jira/issueDelta.js.map +1 -1
- package/dist/connectors/jira/mediaPlaceholders.d.ts +2 -0
- package/dist/connectors/jira/mediaPlaceholders.d.ts.map +1 -1
- package/dist/connectors/jira/mediaPlaceholders.js +16 -3
- package/dist/connectors/jira/mediaPlaceholders.js.map +1 -1
- package/dist/connectors/jira/prompt.d.ts +2 -0
- package/dist/connectors/jira/prompt.d.ts.map +1 -1
- package/dist/connectors/jira/prompt.js +4 -1
- package/dist/connectors/jira/prompt.js.map +1 -1
- package/dist/connectors/jira/sessionKeyCodec.d.ts +2 -0
- package/dist/connectors/jira/sessionKeyCodec.d.ts.map +1 -1
- package/dist/connectors/jira/sessionKeyCodec.js +5 -0
- package/dist/connectors/jira/sessionKeyCodec.js.map +1 -1
- package/dist/connectors/jira/trigger.d.ts +4 -0
- package/dist/connectors/jira/trigger.d.ts.map +1 -1
- package/dist/connectors/jira/trigger.js +9 -1
- package/dist/connectors/jira/trigger.js.map +1 -1
- package/dist/connectors/jira/triggerLog.d.ts +4 -2
- package/dist/connectors/jira/triggerLog.d.ts.map +1 -1
- package/dist/connectors/jira/triggerLog.js +1 -1
- package/dist/connectors/jira/triggerLog.js.map +1 -1
- package/dist/connectors/jira/trustedGroup.d.ts +54 -0
- package/dist/connectors/jira/trustedGroup.d.ts.map +1 -0
- package/dist/connectors/jira/trustedGroup.js +98 -0
- package/dist/connectors/jira/trustedGroup.js.map +1 -0
- package/dist/connectors/telegram/commands/autoContinueLimits.d.ts +3 -0
- package/dist/connectors/telegram/commands/autoContinueLimits.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/autoContinueLimits.js +15 -45
- package/dist/connectors/telegram/commands/autoContinueLimits.js.map +1 -1
- package/dist/connectors/telegram/commands/claudeAccounts.d.ts +58 -0
- package/dist/connectors/telegram/commands/claudeAccounts.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/claudeAccounts.js +591 -0
- package/dist/connectors/telegram/commands/claudeAccounts.js.map +1 -0
- package/dist/connectors/telegram/commands/fallbackChain.d.ts +49 -0
- package/dist/connectors/telegram/commands/fallbackChain.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/fallbackChain.js +624 -0
- package/dist/connectors/telegram/commands/fallbackChain.js.map +1 -0
- package/dist/connectors/telegram/commands/modelProviders.d.ts +23 -1
- package/dist/connectors/telegram/commands/modelProviders.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/modelProviders.js +131 -6
- package/dist/connectors/telegram/commands/modelProviders.js.map +1 -1
- package/dist/i18n/de.d.ts.map +1 -1
- package/dist/i18n/de.js +137 -9
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +137 -9
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +137 -9
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +137 -9
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/hi.d.ts.map +1 -1
- package/dist/i18n/hi.js +137 -9
- package/dist/i18n/hi.js.map +1 -1
- package/dist/i18n/ja.d.ts.map +1 -1
- package/dist/i18n/ja.js +137 -9
- package/dist/i18n/ja.js.map +1 -1
- package/dist/i18n/ka.d.ts.map +1 -1
- package/dist/i18n/ka.js +137 -9
- package/dist/i18n/ka.js.map +1 -1
- package/dist/i18n/pt.d.ts.map +1 -1
- package/dist/i18n/pt.js +137 -9
- package/dist/i18n/pt.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +137 -9
- package/dist/i18n/ru.js.map +1 -1
- package/dist/i18n/uk.d.ts.map +1 -1
- package/dist/i18n/uk.js +137 -9
- package/dist/i18n/uk.js.map +1 -1
- package/dist/i18n/uz.d.ts.map +1 -1
- package/dist/i18n/uz.js +137 -9
- package/dist/i18n/uz.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +137 -9
- package/dist/i18n/zh.js.map +1 -1
- package/dist/scheduler/mcpSurface.d.ts +8 -0
- package/dist/scheduler/mcpSurface.d.ts.map +1 -1
- package/dist/scheduler/mcpSurface.js +42 -2
- package/dist/scheduler/mcpSurface.js.map +1 -1
- package/dist/state.d.ts +172 -1
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +298 -0
- package/dist/state.js.map +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/autoContinueOnLimit.d.ts +7 -0
- package/dist/utils/autoContinueOnLimit.d.ts.map +1 -1
- package/dist/utils/autoContinueOnLimit.js +10 -0
- package/dist/utils/autoContinueOnLimit.js.map +1 -1
- package/dist/utils/claudeAccountPickerPlan.d.ts +85 -0
- package/dist/utils/claudeAccountPickerPlan.d.ts.map +1 -0
- package/dist/utils/claudeAccountPickerPlan.js +123 -0
- package/dist/utils/claudeAccountPickerPlan.js.map +1 -0
- package/dist/utils/claudeLimitSwitch.d.ts +40 -0
- package/dist/utils/claudeLimitSwitch.d.ts.map +1 -0
- package/dist/utils/claudeLimitSwitch.js +54 -0
- package/dist/utils/claudeLimitSwitch.js.map +1 -0
- package/dist/utils/claudeProfileUsageLines.d.ts +15 -0
- package/dist/utils/claudeProfileUsageLines.d.ts.map +1 -0
- package/dist/utils/claudeProfileUsageLines.js +42 -0
- package/dist/utils/claudeProfileUsageLines.js.map +1 -0
- package/dist/utils/claudeProfiles.d.ts +117 -0
- package/dist/utils/claudeProfiles.d.ts.map +1 -0
- package/dist/utils/claudeProfiles.js +285 -0
- package/dist/utils/claudeProfiles.js.map +1 -0
- package/dist/utils/claudeStreamJson.d.ts +13 -1
- package/dist/utils/claudeStreamJson.d.ts.map +1 -1
- package/dist/utils/claudeStreamJson.js +13 -0
- package/dist/utils/claudeStreamJson.js.map +1 -1
- package/dist/utils/claudeUsage.d.ts +209 -0
- package/dist/utils/claudeUsage.d.ts.map +1 -0
- package/dist/utils/claudeUsage.js +413 -0
- package/dist/utils/claudeUsage.js.map +1 -0
- package/dist/utils/claudeUsageRefresher.d.ts +44 -0
- package/dist/utils/claudeUsageRefresher.d.ts.map +1 -0
- package/dist/utils/claudeUsageRefresher.js +95 -0
- package/dist/utils/claudeUsageRefresher.js.map +1 -0
- package/dist/utils/fallbackBridge.d.ts +32 -0
- package/dist/utils/fallbackBridge.d.ts.map +1 -0
- package/dist/utils/fallbackBridge.js +62 -0
- package/dist/utils/fallbackBridge.js.map +1 -0
- package/dist/utils/fallbackChain.d.ts +299 -0
- package/dist/utils/fallbackChain.d.ts.map +1 -0
- package/dist/utils/fallbackChain.js +542 -0
- package/dist/utils/fallbackChain.js.map +1 -0
- package/dist/utils/jsonStreamHost.d.ts +14 -3
- package/dist/utils/jsonStreamHost.d.ts.map +1 -1
- package/dist/utils/jsonStreamHost.js +26 -5
- package/dist/utils/jsonStreamHost.js.map +1 -1
- package/dist/utils/modelRecentPlan.d.ts +56 -0
- package/dist/utils/modelRecentPlan.d.ts.map +1 -0
- package/dist/utils/modelRecentPlan.js +107 -0
- package/dist/utils/modelRecentPlan.js.map +1 -0
- package/dist/utils/threadStatusReport.d.ts +25 -1
- package/dist/utils/threadStatusReport.d.ts.map +1 -1
- package/dist/utils/threadStatusReport.js +24 -1
- package/dist/utils/threadStatusReport.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description The CONTEXT BRIDGE a cross-backend fallback switch hands the new agent (`utils/fallbackChain.ts`):
|
|
4
|
+
* when a topic moves between Claude Code and OpenCode the adapter changes, the new session cannot read the
|
|
5
|
+
* old transcript, and the only thing it knows is what its first prompt tells it. That prompt is built here:
|
|
6
|
+
* why it takes over, the folder it shares with its predecessor, the predecessor's last turns verbatim
|
|
7
|
+
* (user and assistant), and the instruction to establish the state of the work from the project itself
|
|
8
|
+
* before carrying on — then to say in one short message what the task is, what is done and what remains.
|
|
9
|
+
*
|
|
10
|
+
* English on purpose (an agent-facing template, like the thread-context preamble) with a baked reply-language
|
|
11
|
+
* directive. Pure: the turns and labels come from the caller, so the shape is unit-tested.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.fallbackBridgeTurnMaxChars = exports.fallbackBridgeTurnLimit = void 0;
|
|
15
|
+
exports.buildFallbackBridgePrompt = buildFallbackBridgePrompt;
|
|
16
|
+
exports.truncateTurnText = truncateTurnText;
|
|
17
|
+
exports.checkIsFallbackBridgePrompt = checkIsFallbackBridgePrompt;
|
|
18
|
+
const threadContextPreamble_1 = require("../threadContextPreamble");
|
|
19
|
+
/** How many of the previous agent's last turns the bridge carries (user and assistant turns alike). */
|
|
20
|
+
exports.fallbackBridgeTurnLimit = 6;
|
|
21
|
+
/** A single turn longer than this is cut in the middle — the bridge is a hand-over, not a transcript copy. */
|
|
22
|
+
exports.fallbackBridgeTurnMaxChars = 2500;
|
|
23
|
+
const bridgeMarker = '[Backend switch]';
|
|
24
|
+
/**
|
|
25
|
+
* @description The bridge prompt. `turns` are chronological (oldest first), already capped by the caller;
|
|
26
|
+
* `resetsAtText` names when the exhausted account comes back (omitted when unknown).
|
|
27
|
+
*/
|
|
28
|
+
function buildFallbackBridgePrompt(input) {
|
|
29
|
+
const lines = [
|
|
30
|
+
`${bridgeMarker} You (${input.toLabel}) are taking this conversation over from ${input.fromLabel}, which hit a usage limit${input.resetsAtText ? ` (it resets at ${input.resetsAtText})` : ''}. You work in the same project folder, but you cannot see its transcript.`,
|
|
31
|
+
'',
|
|
32
|
+
'Do this now:',
|
|
33
|
+
'1. Read the recent turns below to understand the task and where it stopped.',
|
|
34
|
+
'2. Establish the real state of the work from the project itself (git status, git diff, git log, the files mentioned) — trust the folder over the transcript when they disagree.',
|
|
35
|
+
`3. Reply IN ${input.replyLanguage} with ONE short message: the task as you understand it, what is already done, what remains.`,
|
|
36
|
+
'4. Then continue the work from where it stopped, without redoing what is done.',
|
|
37
|
+
];
|
|
38
|
+
if (input.turns.length === 0) {
|
|
39
|
+
lines.push('', 'No turns of the previous agent are available: start from the project state and ask the user what the task is if it is not evident.');
|
|
40
|
+
return lines.join('\n');
|
|
41
|
+
}
|
|
42
|
+
lines.push('', `--- Last ${input.turns.length} turn(s) of ${input.fromLabel} (oldest first) ---`);
|
|
43
|
+
for (const turn of input.turns) {
|
|
44
|
+
const label = turn.role === 'user' ? 'User' : 'Assistant';
|
|
45
|
+
const text = turn.role === 'user' ? (0, threadContextPreamble_1.stripThreadContextPreamble)(turn.text) : turn.text;
|
|
46
|
+
lines.push('', `${label}:`, truncateTurnText(text.trim()));
|
|
47
|
+
}
|
|
48
|
+
lines.push('', '--- End of the previous agent\'s turns ---');
|
|
49
|
+
return lines.join('\n');
|
|
50
|
+
}
|
|
51
|
+
/** Cut the middle of an over-long turn, keeping its head and tail (the ask and the outcome are at the ends). */
|
|
52
|
+
function truncateTurnText(text, maxChars = exports.fallbackBridgeTurnMaxChars) {
|
|
53
|
+
if (text.length <= maxChars)
|
|
54
|
+
return text;
|
|
55
|
+
const half = Math.floor((maxChars - 20) / 2);
|
|
56
|
+
return `${text.slice(0, half)}\n[… ${text.length - 2 * half} characters cut …]\n${text.slice(-half)}`;
|
|
57
|
+
}
|
|
58
|
+
/** Whether a prompt is a bridge (the request ledger and the trace must not read it as the user's own text). */
|
|
59
|
+
function checkIsFallbackBridgePrompt(text) {
|
|
60
|
+
return text.startsWith(bridgeMarker);
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=fallbackBridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fallbackBridge.js","sourceRoot":"","sources":["../../src/utils/fallbackBridge.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAiBH,8DA4BC;AAGD,4CAIC;AAGD,kEAEC;AAvDD,oEAAsE;AAGtE,uGAAuG;AAC1F,QAAA,uBAAuB,GAAG,CAAC,CAAC;AAEzC,8GAA8G;AACjG,QAAA,0BAA0B,GAAG,IAAI,CAAC;AAE/C,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAExC;;;GAGG;AACH,SAAgB,yBAAyB,CAAC,KAMzC;IACC,MAAM,KAAK,GAAa;QACtB,GAAG,YAAY,SAAS,KAAK,CAAC,OAAO,4CAA4C,KAAK,CAAC,SAAS,4BAA4B,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,kBAAkB,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,EAAE,2EAA2E;QACxQ,EAAE;QACF,cAAc;QACd,6EAA6E;QAC7E,iLAAiL;QACjL,eAAe,KAAK,CAAC,aAAa,6FAA6F;QAC/H,gFAAgF;KACjF,CAAC;IACF,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,oIAAoI,CAAC,CAAC;QACrJ,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,YAAY,KAAK,CAAC,KAAK,CAAC,MAAM,eAAe,KAAK,CAAC,SAAS,qBAAqB,CAAC,CAAC;IAClG,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC;QAC1D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IAAA,kDAA0B,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACtF,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,KAAK,GAAG,EAAE,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,4CAA4C,CAAC,CAAC;IAC7D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,gHAAgH;AAChH,SAAgB,gBAAgB,CAAC,IAAY,EAAE,WAAmB,kCAA0B;IAC1F,IAAI,IAAI,CAAC,MAAM,IAAI,QAAQ;QAAE,OAAO,IAAI,CAAC;IACzC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7C,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,uBAAuB,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AACxG,CAAC;AAED,+GAA+G;AAC/G,SAAgB,2BAA2B,CAAC,IAAY;IACtD,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description The FALLBACK CHAIN (`/limits`, formerly `/fallback`): one instance-wide, ordered list of «where a topic's main agent
|
|
3
|
+
* continues when its own account / provider hits a usage limit». An entry names a backend and what it runs on —
|
|
4
|
+
* a Claude account profile (`utils/claudeProfiles.ts`) with an optional model, or an OpenCode provider with a
|
|
5
|
+
* model — and the list is the operator's PRIORITY (top = preferred). The bot drafts it from what is actually
|
|
6
|
+
* signed in (`proposeFallbackChain`), the operator reorders / removes / adds with buttons, and a limit on a
|
|
7
|
+
* topic picks the first AVAILABLE entry (`pickFallbackCandidates`): not disabled, signed in, present in the live catalog,
|
|
8
|
+
* not marked limited, and not the account the topic is already on.
|
|
9
|
+
*
|
|
10
|
+
* This module is the pure layer: the chain shape, its edit operations, the draft, the ranking, the
|
|
11
|
+
* auto / offer / none decision and the `callback_data` codecs. The chain lives in `state.json`
|
|
12
|
+
* (`StateStore.getFallbackChain`), the detection and the switch itself in `bot.ts`, the `/limits` screen in
|
|
13
|
+
* `connectors/telegram/commands/fallbackChain.ts`. The within-Claude ranking by headroom
|
|
14
|
+
* (`claudeLimitSwitch.ts`) is what an EMPTY chain falls back to, so a bot without a configured chain behaves
|
|
15
|
+
* exactly as before.
|
|
16
|
+
*
|
|
17
|
+
* No I/O, no `Date.now()`: the caller passes the clock and the detection views, so every rule is unit-tested.
|
|
18
|
+
*/
|
|
19
|
+
import { type ClaudeProfileUsageView } from './claudeUsage';
|
|
20
|
+
/**
|
|
21
|
+
* One rung of the chain. A Claude entry with `model: null` keeps the topic's own model. `disabled: true`
|
|
22
|
+
* EXCLUDES the rung from automatic switching and from the limit notice's switch offers (the account / provider
|
|
23
|
+
* stays usable by hand through `/model` and `/accounts`); absent means enabled, so older `state.json` files
|
|
24
|
+
* read back unchanged.
|
|
25
|
+
*/
|
|
26
|
+
export type FallbackChainEntry = {
|
|
27
|
+
backend: 'claude';
|
|
28
|
+
profile: string;
|
|
29
|
+
model: string | null;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
} | {
|
|
32
|
+
backend: 'opencode';
|
|
33
|
+
providerId: string;
|
|
34
|
+
modelId: string;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
};
|
|
37
|
+
/** The chain is a short priority list; a longer one is never consulted past the first available entry anyway. */
|
|
38
|
+
export declare const fallbackChainMaxLength = 12;
|
|
39
|
+
/** The most «switch to …» buttons a limit notice offers (best first); the rest of the chain is in `/fallback`. */
|
|
40
|
+
export declare const fallbackSwitchMaxOffers = 3;
|
|
41
|
+
/** Claude's CLI model aliases (`claudeJsonStreamAdapter.getAvailableModels`), the choices a Claude entry offers. */
|
|
42
|
+
export declare const fallbackClaudeModelAliases: readonly string[];
|
|
43
|
+
/**
|
|
44
|
+
* @description What the bot DETECTED as connected, the input of the draft, the picker rows and the ranking:
|
|
45
|
+
* the Claude profiles with their usage views, the OpenCode models the server is authenticated for
|
|
46
|
+
* (`provider/model` labels, the live catalog), the OpenCode models topics recently picked (a hint for the
|
|
47
|
+
* draft) and the per-model limit marks (`provider/model` → ISO instant).
|
|
48
|
+
*/
|
|
49
|
+
export interface FallbackDetection {
|
|
50
|
+
claudeProfiles: readonly ClaudeProfileUsageView[];
|
|
51
|
+
openCodeModels: readonly string[];
|
|
52
|
+
recentOpenCodeModels: readonly string[];
|
|
53
|
+
openCodeLimits: Readonly<Record<string, string>>;
|
|
54
|
+
}
|
|
55
|
+
/** `provider/model` → its two halves; `null` for a label without a provider segment. */
|
|
56
|
+
export declare function parseOpenCodeModelLabel(label: string): {
|
|
57
|
+
providerId: string;
|
|
58
|
+
modelId: string;
|
|
59
|
+
} | null;
|
|
60
|
+
export declare function buildOpenCodeModelLabel(entry: {
|
|
61
|
+
providerId: string;
|
|
62
|
+
modelId: string;
|
|
63
|
+
}): string;
|
|
64
|
+
/** Whether two entries name the same rung (backend, account / provider and model alike). */
|
|
65
|
+
export declare function checkIsSameFallbackEntry(a: FallbackChainEntry, b: FallbackChainEntry): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* @description Whether two entries share the thing a usage limit exhausts: the Claude ACCOUNT (its windows
|
|
68
|
+
* are per account, whatever the model) or the OpenCode provider+model. A limit on `a` makes every entry
|
|
69
|
+
* `checkIsSameFallbackAccount(a, b)` just as limited.
|
|
70
|
+
*/
|
|
71
|
+
export declare function checkIsSameFallbackAccount(a: FallbackChainEntry, b: FallbackChainEntry): boolean;
|
|
72
|
+
/** `claude:work:fable` / `opencode:openai/gpt-5` — the entry as one token (logs, tests, the revision hash). */
|
|
73
|
+
export declare function formatFallbackEntryKey(entry: FallbackChainEntry): string;
|
|
74
|
+
/**
|
|
75
|
+
* @description The entry for a human: `Claude · work · fable`, `Claude · default · <topic's model>`,
|
|
76
|
+
* `OpenCode · openai/gpt-5`. The backend words and the topic-model stand-in come localised from the caller.
|
|
77
|
+
*/
|
|
78
|
+
export declare function formatFallbackEntryLabel(entry: FallbackChainEntry, words: {
|
|
79
|
+
claude: string;
|
|
80
|
+
openCode: string;
|
|
81
|
+
topicModel: string;
|
|
82
|
+
}): string;
|
|
83
|
+
/**
|
|
84
|
+
* @description The chain as `state.json` may hold it, validated entry by entry: a malformed rung (a hand edit,
|
|
85
|
+
* an older shape) is dropped, never thrown on — the chain is advisory and the bot must boot. Duplicates are
|
|
86
|
+
* folded (first wins) and the cap applied.
|
|
87
|
+
*/
|
|
88
|
+
export declare function normaliseFallbackChain(raw: unknown): FallbackChainEntry[];
|
|
89
|
+
/** Whether the rung is excluded from automatic switching. */
|
|
90
|
+
export declare function checkIsFallbackEntryDisabled(entry: FallbackChainEntry): boolean;
|
|
91
|
+
/** Flip the rung at `index` between included and excluded (a NEW chain). */
|
|
92
|
+
export declare function toggleFallbackEntryDisabled(chain: readonly FallbackChainEntry[], index: number): FallbackChainEditResult;
|
|
93
|
+
export type FallbackChainEditResult = {
|
|
94
|
+
ok: true;
|
|
95
|
+
chain: FallbackChainEntry[];
|
|
96
|
+
} | {
|
|
97
|
+
ok: false;
|
|
98
|
+
reason: 'duplicate' | 'full' | 'outOfRange';
|
|
99
|
+
};
|
|
100
|
+
export declare function addFallbackEntry(chain: readonly FallbackChainEntry[], entry: FallbackChainEntry): FallbackChainEditResult;
|
|
101
|
+
export declare function removeFallbackEntry(chain: readonly FallbackChainEntry[], index: number): FallbackChainEditResult;
|
|
102
|
+
/** Move the rung at `index` one step up (`-1`) or down (`+1`); the ends are clamped (a no-op, still `ok`). */
|
|
103
|
+
export declare function moveFallbackEntry(chain: readonly FallbackChainEntry[], index: number, delta: -1 | 1): FallbackChainEditResult;
|
|
104
|
+
/**
|
|
105
|
+
* @description A short, stable fingerprint of the chain's CONTENT (FNV-1a over the entry keys, 8 hex digits).
|
|
106
|
+
* Every edit button of the picker bakes it in: a tap whose revision is not the chain's current one came from a
|
|
107
|
+
* keyboard posted before a later edit, and its index would point at another rung — it is refused as stale.
|
|
108
|
+
*/
|
|
109
|
+
export declare function getFallbackChainRevision(chain: readonly FallbackChainEntry[]): string;
|
|
110
|
+
/** The provider ids of a catalog, in first-seen order. */
|
|
111
|
+
export declare function listOpenCodeProviders(models: readonly string[]): string[];
|
|
112
|
+
/** The model ids of one provider, in catalog order. */
|
|
113
|
+
export declare function listOpenCodeModelsOfProvider(models: readonly string[], providerId: string): string[];
|
|
114
|
+
/** The provider's best model by {@link preferredOpenCodeModelPatterns}, else its first; `null` for an unknown provider. */
|
|
115
|
+
export declare function pickPreferredOpenCodeModel(models: readonly string[], providerId: string): string | null;
|
|
116
|
+
/**
|
|
117
|
+
* @description The draft the bot PROPOSES from what it detected: the signed-in Claude profiles in their
|
|
118
|
+
* registry order (each keeping the topic's model), then OpenCode — the recently picked models that are still
|
|
119
|
+
* in the catalog, then every other provider's preferred model. Only what is actually available is proposed; a
|
|
120
|
+
* profile never probed counts as signed in (the CLI reports a signed-out one as `false`).
|
|
121
|
+
*/
|
|
122
|
+
export declare function proposeFallbackChain(detection: FallbackDetection, previous?: readonly FallbackChainEntry[]): FallbackChainEntry[];
|
|
123
|
+
export type FallbackEntryAvailability = {
|
|
124
|
+
status: 'available';
|
|
125
|
+
}
|
|
126
|
+
/** Marked limited until the instant (ISO). */
|
|
127
|
+
| {
|
|
128
|
+
status: 'limited';
|
|
129
|
+
until: string;
|
|
130
|
+
}
|
|
131
|
+
/** A Claude profile that is not signed in (or removed), or an OpenCode model the server no longer offers. */
|
|
132
|
+
| {
|
|
133
|
+
status: 'signedOut';
|
|
134
|
+
} | {
|
|
135
|
+
status: 'missing';
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* @description Whether a rung can take work over NOW. A Claude profile is available when it is known, signed in
|
|
139
|
+
* and eligible by the usage report (not marked limited, not at 100 % on the windows its model drains — stale
|
|
140
|
+
* usage is allowed: the chain is the operator's explicit order, not a headroom race). An OpenCode model is
|
|
141
|
+
* available when the live catalog lists it and its limit mark, if any, lies in the past.
|
|
142
|
+
*/
|
|
143
|
+
export declare function getFallbackEntryAvailability(entry: FallbackChainEntry, detection: FallbackDetection, nowMs: number): FallbackEntryAvailability;
|
|
144
|
+
/** Two resets closer than this count as the same moment (the current rung then wins: no needless switch). */
|
|
145
|
+
export declare const fallbackEarliestResetToleranceMs = 60000;
|
|
146
|
+
/**
|
|
147
|
+
* @description The rung a usage-limit WAIT should end on when nothing has room now: of the enabled rungs of
|
|
148
|
+
* `chain` and the rung the topic is on (`current`), the one whose limit resets EARLIEST. `null` when some rung
|
|
149
|
+
* is still available (the normal switch plan applies) or none names a future reset. `isCurrent` says the topic's
|
|
150
|
+
* own rung resets first (or within {@link fallbackEarliestResetToleranceMs} of the first): the wait stays as it
|
|
151
|
+
* is. Signed-out and missing rungs are skipped; rungs of the current account count as the current rung.
|
|
152
|
+
*/
|
|
153
|
+
export declare function pickEarliestResetRung(input: {
|
|
154
|
+
chain: readonly FallbackChainEntry[];
|
|
155
|
+
current: FallbackChainEntry | null;
|
|
156
|
+
detection: FallbackDetection;
|
|
157
|
+
nowMs: number;
|
|
158
|
+
}): {
|
|
159
|
+
entry: FallbackChainEntry;
|
|
160
|
+
untilMs: number;
|
|
161
|
+
isCurrent: boolean;
|
|
162
|
+
} | null;
|
|
163
|
+
/**
|
|
164
|
+
* @description The rungs that may take a topic's work over, in CHAIN ORDER (the operator's priority): every
|
|
165
|
+
* available entry that is not the account the topic is on now (`current` — the one that just hit the limit;
|
|
166
|
+
* its other models are just as limited). A topic whose current position is not in the chain at all (a manual
|
|
167
|
+
* `/account` or `/model` pick) simply starts from the top: a manual choice is respected until it hits its own
|
|
168
|
+
* limit, then the chain decides.
|
|
169
|
+
*/
|
|
170
|
+
export declare function pickFallbackCandidates(input: {
|
|
171
|
+
chain: readonly FallbackChainEntry[];
|
|
172
|
+
current: FallbackChainEntry | null;
|
|
173
|
+
detection: FallbackDetection;
|
|
174
|
+
nowMs: number;
|
|
175
|
+
}): FallbackChainEntry[];
|
|
176
|
+
export type FallbackSwitchPlan =
|
|
177
|
+
/** Auto-switch is on and a rung is available: move the topic to `to` now. */
|
|
178
|
+
{
|
|
179
|
+
action: 'auto';
|
|
180
|
+
to: FallbackChainEntry;
|
|
181
|
+
}
|
|
182
|
+
/** Offer the switch on the limit notice, best first. */
|
|
183
|
+
| {
|
|
184
|
+
action: 'offer';
|
|
185
|
+
candidates: FallbackChainEntry[];
|
|
186
|
+
}
|
|
187
|
+
/** Nothing can take over: the existing wait-for-reset behaviour stands. */
|
|
188
|
+
| {
|
|
189
|
+
action: 'none';
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* @description What a usage limit leads to, given the ranked candidates and the auto-switch toggle. No
|
|
193
|
+
* candidate is `none` whatever the toggle says — the auto-switch never loops onto an exhausted rung; the bot
|
|
194
|
+
* then waits for the reset as before.
|
|
195
|
+
*/
|
|
196
|
+
export declare function decideFallbackSwitch(input: {
|
|
197
|
+
candidates: readonly FallbackChainEntry[];
|
|
198
|
+
isAutoSwitchEnabled: boolean;
|
|
199
|
+
}): FallbackSwitchPlan;
|
|
200
|
+
/**
|
|
201
|
+
* @description Until when an OpenCode provider/model that just hit a limit is marked limited: the instant the
|
|
202
|
+
* error named when it lies ahead, else `fallbackMs` from now (the retry's blind delay). A mark already further
|
|
203
|
+
* in the future is kept (the Claude twin is `resolveClaudeLimitedUntil`).
|
|
204
|
+
*/
|
|
205
|
+
export declare function resolveOpenCodeLimitedUntil(input: {
|
|
206
|
+
resetAtMs: number | undefined;
|
|
207
|
+
existingLimitedUntil: string | undefined;
|
|
208
|
+
nowMs: number;
|
|
209
|
+
fallbackMs: number;
|
|
210
|
+
}): string;
|
|
211
|
+
/** `callback_data` prefix of a «switch to <entry>» button on a limit notice. */
|
|
212
|
+
export declare const fallbackSwitchCallbackPrefix = "fbsw_";
|
|
213
|
+
/**
|
|
214
|
+
* Prefix + a 13-digit episode + `_` + a one- or two-digit index: under 25 bytes. The INDEX points into the
|
|
215
|
+
* candidate list the bot remembered for that EPISODE (an epoch ms that identifies the limit error), so an old
|
|
216
|
+
* notice can never pick a rung of a newer list — its episode is no longer the topic's open one.
|
|
217
|
+
*/
|
|
218
|
+
export declare const fallbackSwitchCallbackRe: RegExp;
|
|
219
|
+
export declare function buildFallbackSwitchCallbackData(episodeId: number, index: number): string;
|
|
220
|
+
export declare function parseFallbackSwitchCallbackData(data: string): {
|
|
221
|
+
episodeId: number;
|
|
222
|
+
index: number;
|
|
223
|
+
} | null;
|
|
224
|
+
/**
|
|
225
|
+
* @description What a tap on a switch button does: `switch` to the candidate at `index` only while the topic's
|
|
226
|
+
* OPEN limit episode is the one the button was posted for and the index is inside that episode's list;
|
|
227
|
+
* `expired` otherwise (the operator wrote, the work resumed, the topic was switched already, a newer limit
|
|
228
|
+
* replaced the episode). `expired` changes nothing.
|
|
229
|
+
*/
|
|
230
|
+
export declare function getFallbackSwitchTapDecision(input: {
|
|
231
|
+
openOffer: {
|
|
232
|
+
episodeId: number;
|
|
233
|
+
candidates: readonly FallbackChainEntry[];
|
|
234
|
+
} | null;
|
|
235
|
+
requestedEpisodeId: number;
|
|
236
|
+
index: number;
|
|
237
|
+
}): {
|
|
238
|
+
kind: 'switch';
|
|
239
|
+
to: FallbackChainEntry;
|
|
240
|
+
} | {
|
|
241
|
+
kind: 'expired';
|
|
242
|
+
};
|
|
243
|
+
/** Reorder / remove a rung — the chain revision is baked in, so a stale keyboard is refused. */
|
|
244
|
+
export declare const fallbackMoveUpCallbackRe: RegExp;
|
|
245
|
+
export declare const fallbackMoveDownCallbackRe: RegExp;
|
|
246
|
+
export declare const fallbackRemoveCallbackRe: RegExp;
|
|
247
|
+
/** Include / exclude a rung from automatic switching (revision baked like the other edits). */
|
|
248
|
+
export declare const fallbackToggleCallbackRe: RegExp;
|
|
249
|
+
/** Open a rung's detail view from the list (same baked revision + index). */
|
|
250
|
+
export declare const fallbackOpenCallbackRe: RegExp;
|
|
251
|
+
/** Open the «add» sub-picker (accounts and providers), then a Claude account's model list. */
|
|
252
|
+
export declare const fallbackAddCallback = "fbk_add";
|
|
253
|
+
export declare const fallbackAddClaudeCallbackRe: RegExp;
|
|
254
|
+
/** A Claude account + model: `-` = keep the topic's model. */
|
|
255
|
+
export declare const fallbackAddClaudeModelCallbackRe: RegExp;
|
|
256
|
+
/** An OpenCode provider by its index in the sub-picker's own snapshot; then a model by index on a page. */
|
|
257
|
+
export declare const fallbackAddProviderCallbackRe: RegExp;
|
|
258
|
+
export declare const fallbackAddModelPageCallbackRe: RegExp;
|
|
259
|
+
export declare const fallbackAddModelCallbackRe: RegExp;
|
|
260
|
+
/** Draft the chain from what is detected (confirmed when a chain exists), empty it, back to the main picker. */
|
|
261
|
+
export declare const fallbackProposeCallback = "fbk_prop";
|
|
262
|
+
export declare const fallbackProposeConfirmCallback = "fbk_propok";
|
|
263
|
+
export declare const fallbackClearCallback = "fbk_clear";
|
|
264
|
+
export declare const fallbackBackCallback = "fbk_back";
|
|
265
|
+
/** Flip the auto-switch-on-limit setting (shared with `/account`): the topic's override, in General the instance default. */
|
|
266
|
+
export declare const fallbackAutoSwitchOnCallback = "fbk_asw_on";
|
|
267
|
+
export declare const fallbackAutoSwitchOffCallback = "fbk_asw_off";
|
|
268
|
+
/** A topic returns to the General value of the switch setting (drops its override). */
|
|
269
|
+
export declare const fallbackAutoSwitchSameCallback = "fbk_asw_same";
|
|
270
|
+
/** The «wait for the reset and continue» setting (`/auto_continue_limits`, shown in `/limits`): on / off / same as General. */
|
|
271
|
+
export declare const fallbackWaitOnCallback = "fbk_wait_on";
|
|
272
|
+
export declare const fallbackWaitOffCallback = "fbk_wait_off";
|
|
273
|
+
export declare const fallbackWaitSameCallback = "fbk_wait_same";
|
|
274
|
+
/**
|
|
275
|
+
* A topic's button of a setting on the main screen: opens that setting's sub-menu (on / off / as in General,
|
|
276
|
+
* whose buttons are the callbacks above) in the same message. General has no sub-menu — its button flips the value.
|
|
277
|
+
*/
|
|
278
|
+
export declare const fallbackAutoSwitchOpenCallback = "fbk_set_asw";
|
|
279
|
+
export declare const fallbackWaitOpenCallback = "fbk_set_wait";
|
|
280
|
+
export declare function buildFallbackMoveUpCallback(index: number, revision: string): string;
|
|
281
|
+
export declare function buildFallbackMoveDownCallback(index: number, revision: string): string;
|
|
282
|
+
export declare function buildFallbackRemoveCallback(index: number, revision: string): string;
|
|
283
|
+
export declare function buildFallbackOpenCallback(index: number, revision: string): string;
|
|
284
|
+
export declare function buildFallbackToggleCallback(index: number, revision: string): string;
|
|
285
|
+
export declare function buildFallbackAddClaudeCallback(profile: string): string;
|
|
286
|
+
export declare function buildFallbackAddClaudeModelCallback(profile: string, model: string | null): string;
|
|
287
|
+
export declare function buildFallbackAddProviderCallback(index: number): string;
|
|
288
|
+
export declare function buildFallbackAddModelPageCallback(page: number): string;
|
|
289
|
+
export declare function buildFallbackAddModelCallback(index: number): string;
|
|
290
|
+
/**
|
|
291
|
+
* @description The index and revision an edit button carries, or `null` for foreign data. `isCurrent` says
|
|
292
|
+
* whether the revision is the chain's one NOW — `false` means the keyboard predates an edit and the tap must
|
|
293
|
+
* only re-render, never act.
|
|
294
|
+
*/
|
|
295
|
+
export declare function parseFallbackEditCallback(data: string, re: RegExp, currentRevision: string): {
|
|
296
|
+
index: number;
|
|
297
|
+
isCurrent: boolean;
|
|
298
|
+
} | null;
|
|
299
|
+
//# sourceMappingURL=fallbackCh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