@rynfar/meridian 1.61.0 → 1.62.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 +2 -1
- package/dist/{cli-tbhba0cv.js → cli-k36dddkm.js} +305 -35
- package/dist/cli.js +1 -1
- package/dist/proxy/adapters/detect.d.ts.map +1 -1
- package/dist/proxy/adapters/prime.d.ts +99 -0
- package/dist/proxy/adapters/prime.d.ts.map +1 -0
- package/dist/proxy/errors.d.ts +14 -0
- package/dist/proxy/errors.d.ts.map +1 -1
- package/dist/proxy/messages.d.ts.map +1 -1
- package/dist/proxy/sdkFeatures.d.ts.map +1 -1
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/proxy/session/cache.d.ts.map +1 -1
- package/dist/proxy/session/lineage.d.ts +58 -0
- package/dist/proxy/session/lineage.d.ts.map +1 -1
- package/dist/proxy/transform.d.ts +33 -0
- package/dist/proxy/transform.d.ts.map +1 -1
- package/dist/proxy/transforms/prime.d.ts +3 -0
- package/dist/proxy/transforms/prime.d.ts.map +1 -0
- package/dist/proxy/transforms/registry.d.ts.map +1 -1
- package/dist/server.js +1 -1
- package/dist/telemetry/landing.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
Meridian bridges the Claude Agent SDK (formerly the Claude Code SDK) to the standard Anthropic API. No OAuth interception. No binary patches. No hacks. Just pure, documented SDK calls. Any tool that speaks the Anthropic or OpenAI protocol — OpenCode, ForgeCode, Crush, Cline, Aider, Pi, Droid, Jcode, Open WebUI, Claude Code — connects to Meridian and gets Claude, with session management, streaming, and prompt caching handled natively by the SDK.
|
|
15
|
+
Meridian bridges the Claude Agent SDK (formerly the Claude Code SDK) to the standard Anthropic API. No OAuth interception. No binary patches. No hacks. Just pure, documented SDK calls. Any tool that speaks the Anthropic or OpenAI protocol — OpenCode, ForgeCode, Crush, Cline, Aider, Pi, Prime Agent, Droid, Jcode, Open WebUI, Claude Code — connects to Meridian and gets Claude, with session management, streaming, and prompt caching handled natively by the SDK.
|
|
16
16
|
|
|
17
17
|
> [!NOTE]
|
|
18
18
|
> ### How Meridian works with Anthropic
|
|
@@ -104,6 +104,7 @@ The Claude Agent SDK provides programmatic access to Claude. But your favorite c
|
|
|
104
104
|
| [Aider](https://github.com/paul-gauthier/aider) | ✅ Verified | Env vars — file editing, streaming; `--no-stream` broken (litellm bug) |
|
|
105
105
|
| [Open WebUI](https://github.com/open-webui/open-webui) | ✅ Verified | OpenAI-compatible endpoints — set base URL to `http://127.0.0.1:3456` |
|
|
106
106
|
| [Pi](https://github.com/mariozechner/pi-coding-agent) | ✅ Verified | models.json config (see [Agent Setup](docs/agents.md)) — full tool support via passthrough; detected via `x-meridian-agent: pi` header |
|
|
107
|
+
| [Prime Agent](https://www.npmjs.com/package/prime-agent) | ✅ Verified | Extension config (see [Agent Setup](docs/agents.md)) — a Pi fork with its own `prime` adapter; single `ipython` tool via passthrough, RLM subagents get distinct session keys, sessions survive long idle gaps. The extension's `metadata.user_id` stamp is **required**, not optional. Cron/scheduled ticks are [not yet verified](docs/agents.md#prime-agent) |
|
|
107
108
|
| [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | ✅ Verified | `ANTHROPIC_BASE_URL` — remote clients share a Max subscription over the network; client CWD preserved in system prompt |
|
|
108
109
|
| [Cherry Studio](https://github.com/CherryHQ/cherry-studio) | ✅ Verified | `cherry` adapter (see [Agent Setup](docs/agents.md)) — chat client with Claude's built-in web search via internal mode |
|
|
109
110
|
| Jcode | ✅ Verified | `/v1/chat/completions` + `x-jcode-session` header — dedicated `jcode` adapter keeps append-only history intact, so retained sessions resume on one SDK session (90.9% cache hit on turn 2 of a two-turn Opus session) |
|
|
@@ -2020,6 +2020,12 @@ function consolidateMultimodalOntoLastUser(structured) {
|
|
|
2020
2020
|
};
|
|
2021
2021
|
return result;
|
|
2022
2022
|
}
|
|
2023
|
+
function normalizeTarget(value) {
|
|
2024
|
+
const collapsed = value.replace(/\s+/g, " ").trim();
|
|
2025
|
+
if (!collapsed)
|
|
2026
|
+
return;
|
|
2027
|
+
return collapsed.length > TOOL_TARGET_MAX ? collapsed.slice(0, TOOL_TARGET_MAX - 3) + "..." : collapsed;
|
|
2028
|
+
}
|
|
2023
2029
|
function summarizeContent(value) {
|
|
2024
2030
|
if (typeof value !== "string" || value.length === 0)
|
|
2025
2031
|
return;
|
|
@@ -2028,13 +2034,18 @@ function summarizeContent(value) {
|
|
|
2028
2034
|
return;
|
|
2029
2035
|
return collapsed.length > CONTENT_SUMMARY_MAX ? collapsed.slice(0, CONTENT_SUMMARY_MAX) + "..." : collapsed;
|
|
2030
2036
|
}
|
|
2037
|
+
function editReplacementText(rec) {
|
|
2038
|
+
if (!rec)
|
|
2039
|
+
return;
|
|
2040
|
+
return rec.new_string ?? rec.newString ?? rec.new_text ?? rec.newText;
|
|
2041
|
+
}
|
|
2031
2042
|
function extractContentSummary(name, input) {
|
|
2032
2043
|
if (!input || typeof input !== "object")
|
|
2033
2044
|
return;
|
|
2034
2045
|
const rec = input;
|
|
2035
2046
|
switch (name.toLowerCase()) {
|
|
2036
2047
|
case "edit":
|
|
2037
|
-
return summarizeContent(rec
|
|
2048
|
+
return summarizeContent(editReplacementText(rec));
|
|
2038
2049
|
case "write":
|
|
2039
2050
|
return summarizeContent(rec.content);
|
|
2040
2051
|
case "multiedit": {
|
|
@@ -2042,7 +2053,7 @@ function extractContentSummary(name, input) {
|
|
|
2042
2053
|
if (!Array.isArray(edits) || edits.length === 0)
|
|
2043
2054
|
return;
|
|
2044
2055
|
const first = edits[0];
|
|
2045
|
-
const firstSummary = summarizeContent(first
|
|
2056
|
+
const firstSummary = summarizeContent(editReplacementText(first));
|
|
2046
2057
|
if (!firstSummary)
|
|
2047
2058
|
return;
|
|
2048
2059
|
return edits.length > 1 ? `${edits.length} edits; first: ${firstSummary}` : firstSummary;
|
|
@@ -2065,8 +2076,9 @@ function buildToolUseIndex(messages) {
|
|
|
2065
2076
|
for (const key of TOOL_TARGET_KEYS) {
|
|
2066
2077
|
const v = input[key];
|
|
2067
2078
|
if (typeof v === "string" && v) {
|
|
2068
|
-
target = v
|
|
2069
|
-
|
|
2079
|
+
target = normalizeTarget(v);
|
|
2080
|
+
if (target)
|
|
2081
|
+
break;
|
|
2070
2082
|
}
|
|
2071
2083
|
}
|
|
2072
2084
|
}
|
|
@@ -2091,7 +2103,7 @@ function extractSystemText(system) {
|
|
|
2091
2103
|
return system.filter((b) => b?.type === "text" && typeof b.text === "string" && b.text).map((b) => b.text).filter((text) => !TRANSPORT_HEADER_BLOCK.test(text)).join(`
|
|
2092
2104
|
`);
|
|
2093
2105
|
}
|
|
2094
|
-
var HASH_IGNORED_BLOCK_TYPES, HASH_HANDLED_BLOCK_TYPES, HASH_SERIALIZED_BLOCK_TYPES, PASSTHROUGH_CONTINUATION_LEAD_IN, MULTIMODAL_TYPES, TOOL_TARGET_KEYS, CONTENT_SUMMARY_MAX = 120, TRANSPORT_HEADER_BLOCK;
|
|
2106
|
+
var HASH_IGNORED_BLOCK_TYPES, HASH_HANDLED_BLOCK_TYPES, HASH_SERIALIZED_BLOCK_TYPES, PASSTHROUGH_CONTINUATION_LEAD_IN, MULTIMODAL_TYPES, TOOL_TARGET_KEYS, TOOL_TARGET_MAX = 80, CONTENT_SUMMARY_MAX = 120, TRANSPORT_HEADER_BLOCK;
|
|
2095
2107
|
var init_messages = __esm(() => {
|
|
2096
2108
|
HASH_IGNORED_BLOCK_TYPES = new Set(["thinking", "redacted_thinking"]);
|
|
2097
2109
|
HASH_HANDLED_BLOCK_TYPES = new Set(["text", "tool_use", "tool_result"]);
|
|
@@ -2110,7 +2122,7 @@ var init_messages = __esm(() => {
|
|
|
2110
2122
|
]);
|
|
2111
2123
|
PASSTHROUGH_CONTINUATION_LEAD_IN = "The tool calls from your previous turn were forwarded to the client, which has now executed them — " + "their results follow. The instruction to end that turn without further text applied to it alone and " + "is now discharged: continue the work and respond.";
|
|
2112
2124
|
MULTIMODAL_TYPES = new Set(["image", "document", "file"]);
|
|
2113
|
-
TOOL_TARGET_KEYS = ["filePath", "file_path", "path", "command", "pattern", "query", "url"];
|
|
2125
|
+
TOOL_TARGET_KEYS = ["filePath", "file_path", "path", "command", "code", "pattern", "query", "url"];
|
|
2114
2126
|
TRANSPORT_HEADER_BLOCK = /^\s*x-anthropic-[a-z0-9-]*header\s*:/i;
|
|
2115
2127
|
});
|
|
2116
2128
|
|
|
@@ -2942,6 +2954,124 @@ var init_pi2 = __esm(() => {
|
|
|
2942
2954
|
};
|
|
2943
2955
|
});
|
|
2944
2956
|
|
|
2957
|
+
// src/proxy/adapters/prime.ts
|
|
2958
|
+
function extractPrimeCwd(body) {
|
|
2959
|
+
let systemText = "";
|
|
2960
|
+
if (typeof body?.system === "string") {
|
|
2961
|
+
systemText = body.system;
|
|
2962
|
+
} else if (Array.isArray(body?.system)) {
|
|
2963
|
+
systemText = body.system.filter((b) => b?.type === "text" && b.text).map((b) => b.text).join(`
|
|
2964
|
+
`);
|
|
2965
|
+
}
|
|
2966
|
+
if (!systemText)
|
|
2967
|
+
return;
|
|
2968
|
+
const match2 = systemText.match(RLM_CWD_LINE) ?? systemText.match(CUSTOM_PROMPT_CWD_LINE);
|
|
2969
|
+
return match2?.[1]?.trim() || undefined;
|
|
2970
|
+
}
|
|
2971
|
+
function extractFileChangesFromIpythonCell(code) {
|
|
2972
|
+
const lines = code.split(`
|
|
2973
|
+
`);
|
|
2974
|
+
const firstMeaningful = lines.find((l) => l.trim().length > 0) ?? "";
|
|
2975
|
+
if (/^[ \t]*%%bash\b/.test(firstMeaningful)) {
|
|
2976
|
+
const bodyStart = lines.indexOf(firstMeaningful) + 1;
|
|
2977
|
+
return extractFileChangesFromBash(lines.slice(bodyStart).join(`
|
|
2978
|
+
`));
|
|
2979
|
+
}
|
|
2980
|
+
const changes = [];
|
|
2981
|
+
for (const line of lines) {
|
|
2982
|
+
const escaped = line.match(SHELL_ESCAPE_LINE);
|
|
2983
|
+
if (escaped?.[1])
|
|
2984
|
+
changes.push(...extractFileChangesFromBash(escaped[1]));
|
|
2985
|
+
}
|
|
2986
|
+
for (const m of code.matchAll(EDIT_SKILL_CALL)) {
|
|
2987
|
+
if (m[2])
|
|
2988
|
+
changes.push({ operation: "edited", path: m[2] });
|
|
2989
|
+
}
|
|
2990
|
+
return changes;
|
|
2991
|
+
}
|
|
2992
|
+
function extractPrimeFileChanges(toolName, toolInput) {
|
|
2993
|
+
const input = toolInput;
|
|
2994
|
+
if (toolName === "ipython" && typeof input?.code === "string") {
|
|
2995
|
+
return extractFileChangesFromIpythonCell(input.code);
|
|
2996
|
+
}
|
|
2997
|
+
const filePath = input?.path ?? input?.file_path ?? input?.filePath;
|
|
2998
|
+
if (toolName === "edit" && filePath) {
|
|
2999
|
+
return [{ operation: "edited", path: String(filePath) }];
|
|
3000
|
+
}
|
|
3001
|
+
if (toolName === "write" && filePath) {
|
|
3002
|
+
return [{ operation: "wrote", path: String(filePath) }];
|
|
3003
|
+
}
|
|
3004
|
+
if (toolName === "bash" && input?.command) {
|
|
3005
|
+
return extractFileChangesFromBash(String(input.command));
|
|
3006
|
+
}
|
|
3007
|
+
return [];
|
|
3008
|
+
}
|
|
3009
|
+
var PRIME_MCP_SERVER_NAME = "prime", PRIME_ALLOWED_MCP_TOOLS, RLM_CWD_LINE, CUSTOM_PROMPT_CWD_LINE, EDIT_SKILL_CALL, SHELL_ESCAPE_LINE, primeAdapter;
|
|
3010
|
+
var init_prime = __esm(() => {
|
|
3011
|
+
init_fileChanges();
|
|
3012
|
+
init_messages();
|
|
3013
|
+
init_tools();
|
|
3014
|
+
init_env();
|
|
3015
|
+
init_claudecode();
|
|
3016
|
+
PRIME_ALLOWED_MCP_TOOLS = [
|
|
3017
|
+
`mcp__${PRIME_MCP_SERVER_NAME}__read`,
|
|
3018
|
+
`mcp__${PRIME_MCP_SERVER_NAME}__write`,
|
|
3019
|
+
`mcp__${PRIME_MCP_SERVER_NAME}__edit`,
|
|
3020
|
+
`mcp__${PRIME_MCP_SERVER_NAME}__bash`,
|
|
3021
|
+
`mcp__${PRIME_MCP_SERVER_NAME}__glob`,
|
|
3022
|
+
`mcp__${PRIME_MCP_SERVER_NAME}__grep`
|
|
3023
|
+
];
|
|
3024
|
+
RLM_CWD_LINE = /^Working directory:[ \t]*(.+)$/m;
|
|
3025
|
+
CUSTOM_PROMPT_CWD_LINE = /^Current working directory:[ \t]*(.+)$/m;
|
|
3026
|
+
EDIT_SKILL_CALL = /\bedit\s*\(\s*path\s*=\s*(['"])(.+?)\1/g;
|
|
3027
|
+
SHELL_ESCAPE_LINE = /^[ \t]*!(.+)$/;
|
|
3028
|
+
primeAdapter = {
|
|
3029
|
+
name: "prime",
|
|
3030
|
+
getSessionId(c, body) {
|
|
3031
|
+
return c.req.header("x-session-affinity") ?? extractClaudeCodeSessionId(body);
|
|
3032
|
+
},
|
|
3033
|
+
extractWorkingDirectory(body) {
|
|
3034
|
+
return extractPrimeCwd(body);
|
|
3035
|
+
},
|
|
3036
|
+
extractClientWorkingDirectory(body) {
|
|
3037
|
+
return extractPrimeCwd(body);
|
|
3038
|
+
},
|
|
3039
|
+
normalizeContent(content) {
|
|
3040
|
+
return normalizeContent(content);
|
|
3041
|
+
},
|
|
3042
|
+
getBlockedBuiltinTools() {
|
|
3043
|
+
return BLOCKED_BUILTIN_TOOLS;
|
|
3044
|
+
},
|
|
3045
|
+
getAgentIncompatibleTools() {
|
|
3046
|
+
return CLAUDE_CODE_ONLY_TOOLS;
|
|
3047
|
+
},
|
|
3048
|
+
getMcpServerName() {
|
|
3049
|
+
return PRIME_MCP_SERVER_NAME;
|
|
3050
|
+
},
|
|
3051
|
+
getAllowedMcpTools() {
|
|
3052
|
+
return PRIME_ALLOWED_MCP_TOOLS;
|
|
3053
|
+
},
|
|
3054
|
+
buildSdkAgents(_body, _mcpToolNames) {
|
|
3055
|
+
return {};
|
|
3056
|
+
},
|
|
3057
|
+
supportsThinking() {
|
|
3058
|
+
return true;
|
|
3059
|
+
},
|
|
3060
|
+
buildSdkHooks(_body, _sdkAgents) {
|
|
3061
|
+
return;
|
|
3062
|
+
},
|
|
3063
|
+
buildSystemContextAddendum(_body, _sdkAgents) {
|
|
3064
|
+
return "";
|
|
3065
|
+
},
|
|
3066
|
+
usesPassthrough() {
|
|
3067
|
+
return resolvePassthrough(true);
|
|
3068
|
+
},
|
|
3069
|
+
extractFileChangesFromToolUse(toolName, toolInput) {
|
|
3070
|
+
return extractPrimeFileChanges(toolName, toolInput);
|
|
3071
|
+
}
|
|
3072
|
+
};
|
|
3073
|
+
});
|
|
3074
|
+
|
|
2945
3075
|
// src/proxy/transforms/forgecode.ts
|
|
2946
3076
|
var FORGECODE_MCP_SERVER_NAME = "forgecode", FORGECODE_ALLOWED_MCP_TOOLS, forgeCodeTransforms;
|
|
2947
3077
|
var init_forgecode = __esm(() => {
|
|
@@ -3279,6 +3409,7 @@ var init_detect = __esm(() => {
|
|
|
3279
3409
|
init_crush2();
|
|
3280
3410
|
init_passthrough2();
|
|
3281
3411
|
init_pi2();
|
|
3412
|
+
init_prime();
|
|
3282
3413
|
init_forgecode2();
|
|
3283
3414
|
init_claudecode();
|
|
3284
3415
|
init_openai();
|
|
@@ -3292,6 +3423,8 @@ var init_detect = __esm(() => {
|
|
|
3292
3423
|
crush: crushAdapter,
|
|
3293
3424
|
passthrough: passthroughAdapter,
|
|
3294
3425
|
pi: piAdapter,
|
|
3426
|
+
prime: primeAdapter,
|
|
3427
|
+
"prime-agent": primeAdapter,
|
|
3295
3428
|
forgecode: forgeCodeAdapter,
|
|
3296
3429
|
"claude-code": claudeCodeAdapter,
|
|
3297
3430
|
claudecode: claudeCodeAdapter,
|
|
@@ -3455,6 +3588,9 @@ var init_sdkFeatures = __esm(() => {
|
|
|
3455
3588
|
cherry: {
|
|
3456
3589
|
codeSystemPrompt: false
|
|
3457
3590
|
},
|
|
3591
|
+
prime: {
|
|
3592
|
+
codeSystemPrompt: false
|
|
3593
|
+
},
|
|
3458
3594
|
codex: {
|
|
3459
3595
|
codeSystemPrompt: false
|
|
3460
3596
|
}
|
|
@@ -11768,7 +11904,14 @@ function profileSection(q,s,pl,h){
|
|
|
11768
11904
|
var orderIdx=(pl.profileOrder||[]).indexOf(p.id);
|
|
11769
11905
|
if(orderIdx>=0)badge+='<span class="pool-chip">#'+(orderIdx+1)+' in pool</span>';
|
|
11770
11906
|
var exh=(pl.exhausted||[]).filter(function(e){return e.id===p.id})[0];
|
|
11771
|
-
if(exh)
|
|
11907
|
+
if(exh){
|
|
11908
|
+
// A billing refusal has no reset to wait for — the pool re-probes on the
|
|
11909
|
+
// same timer, but nothing changes until a human fixes the account.
|
|
11910
|
+
// Showing it as 'resets in 9m' promises a recovery that never comes.
|
|
11911
|
+
badge+=exh.reason==='billing_error'
|
|
11912
|
+
?' <span class="pool-chip exhausted" title="Subscription or payment refused — this does not clear on its own">subscription refused</span>'
|
|
11913
|
+
:' <span class="pool-chip exhausted">exhausted · resets '+resetIn(exh.until)+'</span>';
|
|
11914
|
+
}
|
|
11772
11915
|
}
|
|
11773
11916
|
cards+='<div class="profile-card'+(p.isActive?' active':'')+(switchable?' switchable':'')+'"'+(switchable?' data-profile="'+esc(p.id)+'" role="button" tabindex="0"':'')+'>'
|
|
11774
11917
|
+'<div class="profile-head"><span class="profile-name"><span class="prof-dot"></span>'+esc(p.label||p.id)+' '+badge+'</span>'
|
|
@@ -11954,6 +12097,16 @@ function extendedContextHint(model) {
|
|
|
11954
12097
|
return advise("MERIDIAN_SONNET_MODEL=sonnet");
|
|
11955
12098
|
return advise("MERIDIAN_1M_CONTEXT_SUPPORT=0");
|
|
11956
12099
|
}
|
|
12100
|
+
var BILLING_SIGNALS = [
|
|
12101
|
+
/\b402\b(?!:\d)/,
|
|
12102
|
+
/billing[_ ](?:error|issue|problem|failure)/,
|
|
12103
|
+
/subscription (?:is |has )?(?:inactive|expired|lapsed|cancell?ed|ended|invalid|not active)/,
|
|
12104
|
+
/(?:expired|inactive|lapsed|invalid|no active|cancell?ed) subscription/,
|
|
12105
|
+
/payment (?:method|required|failed|declined|details|info)/,
|
|
12106
|
+
/update your payment/,
|
|
12107
|
+
/(?:out of|draw from|draws from) extra usage/,
|
|
12108
|
+
/insufficient (?:credit|funds|balance)/
|
|
12109
|
+
];
|
|
11957
12110
|
var HIT_YOUR_LIMIT = /hit your (?:[\w-]+ )?limit/;
|
|
11958
12111
|
function classifyError(errMsg, model) {
|
|
11959
12112
|
const lower = errMsg.toLowerCase();
|
|
@@ -11979,7 +12132,7 @@ function classifyError(errMsg, model) {
|
|
|
11979
12132
|
message: `Claude Max rate limit reached. Wait a moment and try again.${hint}`
|
|
11980
12133
|
};
|
|
11981
12134
|
}
|
|
11982
|
-
if (
|
|
12135
|
+
if (BILLING_SIGNALS.some((rx) => rx.test(lower))) {
|
|
11983
12136
|
return {
|
|
11984
12137
|
status: 402,
|
|
11985
12138
|
type: "billing_error",
|
|
@@ -12064,6 +12217,16 @@ function isRateLimitError(errMsg) {
|
|
|
12064
12217
|
const lower = errMsg.toLowerCase();
|
|
12065
12218
|
return lower.includes("429") || lower.includes("rate limit") || lower.includes("too many requests");
|
|
12066
12219
|
}
|
|
12220
|
+
var ACCOUNT_FAILOVER_ERROR_TYPES = new Set([
|
|
12221
|
+
"rate_limit_error",
|
|
12222
|
+
"billing_error"
|
|
12223
|
+
]);
|
|
12224
|
+
function isAccountFailoverError(errorType) {
|
|
12225
|
+
return typeof errorType === "string" && ACCOUNT_FAILOVER_ERROR_TYPES.has(errorType);
|
|
12226
|
+
}
|
|
12227
|
+
function isQuotaRefusal(errorType) {
|
|
12228
|
+
return errorType === "rate_limit_error";
|
|
12229
|
+
}
|
|
12067
12230
|
function isExtraUsageRequiredError(errMsg) {
|
|
12068
12231
|
const lower = errMsg.toLowerCase();
|
|
12069
12232
|
return lower.includes("extra usage") && lower.includes("1m") || lower.includes("out of extra usage");
|
|
@@ -19168,6 +19331,34 @@ init_opencode();
|
|
|
19168
19331
|
init_crush();
|
|
19169
19332
|
init_droid();
|
|
19170
19333
|
init_pi();
|
|
19334
|
+
|
|
19335
|
+
// src/proxy/transforms/prime.ts
|
|
19336
|
+
init_tools();
|
|
19337
|
+
init_env();
|
|
19338
|
+
init_prime();
|
|
19339
|
+
function resolvePrimePassthrough() {
|
|
19340
|
+
return resolvePassthrough(true);
|
|
19341
|
+
}
|
|
19342
|
+
var primeTransforms = [
|
|
19343
|
+
{
|
|
19344
|
+
name: "prime-core",
|
|
19345
|
+
adapters: ["prime"],
|
|
19346
|
+
onRequest(ctx) {
|
|
19347
|
+
return {
|
|
19348
|
+
...ctx,
|
|
19349
|
+
blockedTools: BLOCKED_BUILTIN_TOOLS,
|
|
19350
|
+
incompatibleTools: CLAUDE_CODE_ONLY_TOOLS,
|
|
19351
|
+
allowedMcpTools: PRIME_ALLOWED_MCP_TOOLS,
|
|
19352
|
+
sdkAgents: {},
|
|
19353
|
+
passthrough: resolvePrimePassthrough(),
|
|
19354
|
+
supportsThinking: true,
|
|
19355
|
+
extractFileChangesFromToolUse: extractPrimeFileChanges
|
|
19356
|
+
};
|
|
19357
|
+
}
|
|
19358
|
+
}
|
|
19359
|
+
];
|
|
19360
|
+
|
|
19361
|
+
// src/proxy/transforms/registry.ts
|
|
19171
19362
|
init_forgecode();
|
|
19172
19363
|
init_passthrough();
|
|
19173
19364
|
|
|
@@ -19249,6 +19440,7 @@ var ADAPTER_TRANSFORMS = {
|
|
|
19249
19440
|
crush: crushTransforms,
|
|
19250
19441
|
droid: droidTransforms,
|
|
19251
19442
|
pi: piTransforms,
|
|
19443
|
+
prime: primeTransforms,
|
|
19252
19444
|
forgecode: forgeCodeTransforms,
|
|
19253
19445
|
passthrough: passthroughTransforms,
|
|
19254
19446
|
cherry: cherryTransforms,
|
|
@@ -19622,6 +19814,48 @@ function computeLineageHash(messages) {
|
|
|
19622
19814
|
function hashMessage(message) {
|
|
19623
19815
|
return createHash2("sha256").update(`${message.role}:${normalizeContent(message.content)}`).digest("hex").slice(0, 32);
|
|
19624
19816
|
}
|
|
19817
|
+
function describeShape(message) {
|
|
19818
|
+
const normalized = normalizeContent(message.content);
|
|
19819
|
+
return {
|
|
19820
|
+
role: message.role,
|
|
19821
|
+
blocks: Array.isArray(message.content) ? message.content.map((b) => String(b?.type ?? "unknown")).join(",") : typeof message.content === "string" ? "string" : "unknown",
|
|
19822
|
+
bytes: Buffer.byteLength(normalized, "utf8")
|
|
19823
|
+
};
|
|
19824
|
+
}
|
|
19825
|
+
function describeLineageMismatch(cached, messages, precomputedIncomingHashes) {
|
|
19826
|
+
const storedHashes = cached.messageHashes ?? [];
|
|
19827
|
+
const incomingHashes = precomputedIncomingHashes ?? computeMessageHashes(messages);
|
|
19828
|
+
const limit = Math.min(storedHashes.length, incomingHashes.length);
|
|
19829
|
+
let index = -1;
|
|
19830
|
+
for (let i = 0;i < limit; i++) {
|
|
19831
|
+
if (storedHashes[i] !== incomingHashes[i]) {
|
|
19832
|
+
index = i;
|
|
19833
|
+
break;
|
|
19834
|
+
}
|
|
19835
|
+
}
|
|
19836
|
+
const base = {
|
|
19837
|
+
index,
|
|
19838
|
+
storedCount: cached.messageCount,
|
|
19839
|
+
incomingCount: messages.length
|
|
19840
|
+
};
|
|
19841
|
+
if (index < 0)
|
|
19842
|
+
return base;
|
|
19843
|
+
return {
|
|
19844
|
+
...base,
|
|
19845
|
+
storedDigest: storedHashes[index],
|
|
19846
|
+
incomingDigest: incomingHashes[index],
|
|
19847
|
+
incomingShape: messages[index] ? describeShape(messages[index]) : undefined,
|
|
19848
|
+
previousDigest: index > 0 ? storedHashes[index - 1] : undefined
|
|
19849
|
+
};
|
|
19850
|
+
}
|
|
19851
|
+
function formatLineageMismatch(mismatch) {
|
|
19852
|
+
if (mismatch.index < 0)
|
|
19853
|
+
return;
|
|
19854
|
+
const short = (digest) => digest ? digest.slice(0, 12) : "—";
|
|
19855
|
+
const trailing = mismatch.index === mismatch.storedCount - 1 ? " (trailing message only — the rest of the history matched)" : "";
|
|
19856
|
+
const shape = mismatch.incomingShape ? `${mismatch.incomingShape.role}[${mismatch.incomingShape.blocks}] ${mismatch.incomingShape.bytes}B` : "unknown";
|
|
19857
|
+
return `first mismatch at index ${mismatch.index}${trailing}: ` + `stored=${short(mismatch.storedDigest)} incoming=${short(mismatch.incomingDigest)}, ` + `incoming now ${shape}`;
|
|
19858
|
+
}
|
|
19625
19859
|
function computeMessageHashes(messages) {
|
|
19626
19860
|
if (!messages || messages.length === 0)
|
|
19627
19861
|
return [];
|
|
@@ -19763,7 +19997,12 @@ function verifyLineage(cached, messages) {
|
|
|
19763
19997
|
return { type: "undo", session: cached, prefixOverlap, rollbackUuid };
|
|
19764
19998
|
}
|
|
19765
19999
|
if (prefixOverlap > 0 && messages.length > cached.messageCount) {
|
|
19766
|
-
return {
|
|
20000
|
+
return {
|
|
20001
|
+
type: "diverged",
|
|
20002
|
+
reason: "modified-history",
|
|
20003
|
+
prefixOverlap,
|
|
20004
|
+
mismatch: describeLineageMismatch(cached, messages, incomingHashes)
|
|
20005
|
+
};
|
|
19767
20006
|
}
|
|
19768
20007
|
return { type: "diverged", reason: "unrelated-history", prefixOverlap };
|
|
19769
20008
|
}
|
|
@@ -20087,7 +20326,9 @@ function classifyLineage(state, messages, cacheKey2) {
|
|
|
20087
20326
|
console.error(`[PROXY] ${msg}`);
|
|
20088
20327
|
diagnosticLog2.lineage(msg);
|
|
20089
20328
|
} else if (result.type === "diverged" && result.reason === "modified-history") {
|
|
20090
|
-
const
|
|
20329
|
+
const detail = result.mismatch ? formatLineageMismatch(result.mismatch) : undefined;
|
|
20330
|
+
const msg = `Stale session detected (key=${cacheKey2.slice(0, 8)}…): prefix overlap ${result.prefixOverlap || 0}/${state.messageCount}, incoming ${messages.length} msgs. Starting fresh replay.` + (detail ? `
|
|
20331
|
+
${detail}` : "");
|
|
20091
20332
|
console.error(`[PROXY] ${msg}`);
|
|
20092
20333
|
diagnosticLog2.lineage(msg);
|
|
20093
20334
|
}
|
|
@@ -20501,23 +20742,25 @@ function createProxyServer(config = {}) {
|
|
|
20501
20742
|
});
|
|
20502
20743
|
});
|
|
20503
20744
|
}
|
|
20504
|
-
async function
|
|
20745
|
+
async function sniffAccountFailure(res) {
|
|
20505
20746
|
const contentType = res.headers.get("content-type") ?? "";
|
|
20506
20747
|
if (!contentType.includes("text/event-stream")) {
|
|
20507
|
-
if (res.
|
|
20748
|
+
if (!res.ok) {
|
|
20508
20749
|
const body = await res.clone().json().catch(() => null);
|
|
20509
|
-
|
|
20510
|
-
|
|
20750
|
+
const errorType = body?.error?.type;
|
|
20751
|
+
if (isAccountFailoverError(errorType)) {
|
|
20752
|
+
return { failed: true, errorPayload: body, errorType, response: res };
|
|
20753
|
+
}
|
|
20511
20754
|
}
|
|
20512
|
-
return { failed: false, errorPayload: null, response: res };
|
|
20755
|
+
return { failed: false, errorPayload: null, errorType: null, response: res };
|
|
20513
20756
|
}
|
|
20514
20757
|
const reader = res.body?.getReader();
|
|
20515
20758
|
if (!reader)
|
|
20516
|
-
return { failed: false, errorPayload: null, response: res };
|
|
20759
|
+
return { failed: false, errorPayload: null, errorType: null, response: res };
|
|
20517
20760
|
const decoder = new TextDecoder;
|
|
20518
20761
|
const consumed = [];
|
|
20519
20762
|
let text = "";
|
|
20520
|
-
let
|
|
20763
|
+
let failure = null;
|
|
20521
20764
|
while (true) {
|
|
20522
20765
|
const { done, value } = await reader.read();
|
|
20523
20766
|
if (done)
|
|
@@ -20535,16 +20778,17 @@ function createProxyServer(config = {}) {
|
|
|
20535
20778
|
`).find((l) => l.startsWith("data: "));
|
|
20536
20779
|
try {
|
|
20537
20780
|
const parsed = dataLine ? JSON.parse(dataLine.slice(6)) : null;
|
|
20538
|
-
|
|
20539
|
-
|
|
20781
|
+
const parsedType = parsed?.error?.type;
|
|
20782
|
+
if (isAccountFailoverError(parsedType)) {
|
|
20783
|
+
failure = { payload: parsed, type: parsedType };
|
|
20540
20784
|
}
|
|
20541
20785
|
} catch {}
|
|
20542
20786
|
}
|
|
20543
20787
|
break;
|
|
20544
20788
|
}
|
|
20545
|
-
if (
|
|
20789
|
+
if (failure) {
|
|
20546
20790
|
await reader.cancel().catch(() => {});
|
|
20547
|
-
return { failed: true, errorPayload:
|
|
20791
|
+
return { failed: true, errorPayload: failure.payload, errorType: failure.type, response: res };
|
|
20548
20792
|
}
|
|
20549
20793
|
const rest = new ReadableStream({
|
|
20550
20794
|
start(ctrl) {
|
|
@@ -20562,33 +20806,40 @@ function createProxyServer(config = {}) {
|
|
|
20562
20806
|
reader.cancel(reason).catch(() => {});
|
|
20563
20807
|
}
|
|
20564
20808
|
});
|
|
20565
|
-
return { failed: false, errorPayload: null, response: new Response(rest, { status: res.status, headers: res.headers }) };
|
|
20809
|
+
return { failed: false, errorPayload: null, errorType: null, response: new Response(rest, { status: res.status, headers: res.headers }) };
|
|
20566
20810
|
}
|
|
20567
20811
|
async function dispatchPriority(c, orderedCandidateIds, sessionKey, wantsStream) {
|
|
20568
20812
|
const bodyBuf = await c.req.arrayBuffer();
|
|
20569
20813
|
let lastError = null;
|
|
20814
|
+
let lastStatus = 429;
|
|
20570
20815
|
let previous = null;
|
|
20816
|
+
let previousReason = "rate_limit_error";
|
|
20571
20817
|
for (const candidate of orderedCandidateIds) {
|
|
20572
20818
|
const headers = new Headers(c.req.raw.headers);
|
|
20573
20819
|
headers.set("x-meridian-profile", candidate);
|
|
20574
20820
|
headers.set("x-meridian-priority-dispatch", "1");
|
|
20575
20821
|
const inner = await app.fetch(new Request(c.req.url, { method: "POST", headers, body: bodyBuf }));
|
|
20576
|
-
const
|
|
20577
|
-
if (!failed) {
|
|
20822
|
+
const sniffed = await sniffAccountFailure(inner);
|
|
20823
|
+
if (!sniffed.failed) {
|
|
20578
20824
|
if (sessionKey)
|
|
20579
20825
|
priorityAssignments.set(sessionKey, candidate);
|
|
20580
20826
|
if (previous) {
|
|
20581
|
-
claudeLog("profile.failover", { from: previous, to: candidate, reason:
|
|
20582
|
-
plog(`[PROXY] PRIORITY failover ${previous} -> ${candidate}`);
|
|
20583
|
-
}
|
|
20584
|
-
return response;
|
|
20585
|
-
}
|
|
20586
|
-
const
|
|
20587
|
-
|
|
20588
|
-
|
|
20589
|
-
|
|
20590
|
-
|
|
20827
|
+
claudeLog("profile.failover", { from: previous, to: candidate, reason: previousReason, sessionKey });
|
|
20828
|
+
plog(`[PROXY] PRIORITY failover ${previous} -> ${candidate} (${previousReason})`);
|
|
20829
|
+
}
|
|
20830
|
+
return sniffed.response;
|
|
20831
|
+
}
|
|
20832
|
+
const reason = sniffed.errorType;
|
|
20833
|
+
const quotaRefusal = isQuotaRefusal(reason);
|
|
20834
|
+
const cooldownUntil = quotaRefusal ? priorityCooldownUntil(candidate, Date.now()) : Date.now() + PRIORITY_DEFAULT_COOLDOWN_MS;
|
|
20835
|
+
priorityExhaustion.mark(candidate, cooldownUntil, reason);
|
|
20836
|
+
claudeLog("priority.exhausted", { profile: candidate, until: cooldownUntil, reason });
|
|
20837
|
+
if (quotaRefusal)
|
|
20838
|
+
refinePriorityCooldown(candidate);
|
|
20839
|
+
lastError = sniffed.errorPayload;
|
|
20840
|
+
lastStatus = inner.status;
|
|
20591
20841
|
previous = candidate;
|
|
20842
|
+
previousReason = reason;
|
|
20592
20843
|
}
|
|
20593
20844
|
if (wantsStream) {
|
|
20594
20845
|
return new Response(`event: error
|
|
@@ -20599,7 +20850,7 @@ data: ${JSON.stringify(lastError)}
|
|
|
20599
20850
|
headers: { "content-type": "text/event-stream; charset=utf-8", "cache-control": "no-cache" }
|
|
20600
20851
|
});
|
|
20601
20852
|
}
|
|
20602
|
-
return new Response(JSON.stringify(lastError), { status:
|
|
20853
|
+
return new Response(JSON.stringify(lastError), { status: lastStatus, headers: { "content-type": "application/json" } });
|
|
20603
20854
|
}
|
|
20604
20855
|
app.use("/auth/*", requireAuth);
|
|
20605
20856
|
app.get("/", (c) => {
|
|
@@ -20797,6 +21048,25 @@ data: ${JSON.stringify(lastError)}
|
|
|
20797
21048
|
if (lineageResult.type === "undo" && adapterBase === "opencode" && !agentSessionId) {
|
|
20798
21049
|
lineageResult = { type: "diverged", reason: "missing-session-header" };
|
|
20799
21050
|
}
|
|
21051
|
+
if (pipeline.some((t) => t.onSession)) {
|
|
21052
|
+
const mismatch = lineageResult.type === "diverged" ? lineageResult.mismatch : undefined;
|
|
21053
|
+
runTransformHook(pipeline, "onSession", {
|
|
21054
|
+
adapter: adapterBase,
|
|
21055
|
+
lineage: lineageResult.type,
|
|
21056
|
+
reason: lineageResult.type === "diverged" ? lineageResult.reason : undefined,
|
|
21057
|
+
sessionKey: profileSessionId,
|
|
21058
|
+
storedCount: mismatch?.storedCount,
|
|
21059
|
+
incomingCount: (body.messages || []).length,
|
|
21060
|
+
prefixOverlap: lineageResult.type === "diverged" ? lineageResult.prefixOverlap : undefined,
|
|
21061
|
+
mismatch: mismatch && mismatch.index >= 0 ? {
|
|
21062
|
+
index: mismatch.index,
|
|
21063
|
+
storedDigest: mismatch.storedDigest,
|
|
21064
|
+
incomingDigest: mismatch.incomingDigest,
|
|
21065
|
+
previousDigest: mismatch.previousDigest,
|
|
21066
|
+
incomingShape: mismatch.incomingShape
|
|
21067
|
+
} : undefined
|
|
21068
|
+
}, adapterBase);
|
|
21069
|
+
}
|
|
20800
21070
|
const isResume = lineageResult.type === "continuation" || lineageResult.type === "compaction";
|
|
20801
21071
|
const isUndo = lineageResult.type === "undo";
|
|
20802
21072
|
const cachedSession = lineageResult.type !== "diverged" ? lineageResult.session : undefined;
|
package/dist/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../../src/proxy/adapters/detect.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../../src/proxy/adapters/detect.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AA4C9C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAE3C;AA2DD,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,YAAY,CA2FtD"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prime Agent adapter.
|
|
3
|
+
*
|
|
4
|
+
* Prime Agent (npm `prime-agent`) is a FORK of Pi, not Pi. Its dependencies are
|
|
5
|
+
* `@earendil-works/pi-agent-core` / `pi-ai` / `pi-tui` — republished Pi packages
|
|
6
|
+
* — and its transport layer is Pi's unchanged: the official `@anthropic-ai/sdk`,
|
|
7
|
+
* `stream: true` on every request, the same OAuth-vs-API-key client branch.
|
|
8
|
+
*
|
|
9
|
+
* Everything above the transport differs, which is why it gets its own adapter
|
|
10
|
+
* rather than riding Pi's. Measured on 2026-08-12 by capturing real traffic
|
|
11
|
+
* against a local recording server (prime-agent 0.7.2):
|
|
12
|
+
*
|
|
13
|
+
* - User-Agent (API-key mode): `Anthropic/JS <version>` — NOT `claude-cli/`.
|
|
14
|
+
* - No session header, and no `metadata` on the wire by default.
|
|
15
|
+
* - Exactly ONE tool is offered: `ipython` ({ code: string }). Not Pi's
|
|
16
|
+
* read/write/edit/bash/glob/grep. `bash` and `edit` exist only when a user
|
|
17
|
+
* opts into them with `-t`.
|
|
18
|
+
* - System prompt ~17-19KB, one text block, opening "You are a general purpose
|
|
19
|
+
* agent that uses code to solve tasks."
|
|
20
|
+
* - CWD arrives as `Working directory: <path>` — no `Current` prefix.
|
|
21
|
+
*
|
|
22
|
+
* Detection: the User-Agent is the generic Anthropic SDK one, shared with every
|
|
23
|
+
* other SDK client, so a UA heuristic would misroute unrelated traffic. Select
|
|
24
|
+
* with `x-meridian-agent: prime` (set in the provider config) or
|
|
25
|
+
* `MERIDIAN_DEFAULT_AGENT=prime`. Running Prime Agent with an OAuth token makes
|
|
26
|
+
* it send `claude-cli/<version>`, which the existing env-var tiebreaker in
|
|
27
|
+
* detect.ts already resolves.
|
|
28
|
+
*/
|
|
29
|
+
import type { AgentAdapter } from "../adapter";
|
|
30
|
+
import { type FileChange } from "../fileChanges";
|
|
31
|
+
/**
|
|
32
|
+
* Internal-mode fallback tools.
|
|
33
|
+
*
|
|
34
|
+
* Prime Agent's real tool is `ipython`, a persistent kernel living in the
|
|
35
|
+
* client — the proxy cannot provide it over MCP. Passthrough is therefore the
|
|
36
|
+
* only mode in which Prime Agent works as designed. This set exists so that a
|
|
37
|
+
* user who explicitly sets MERIDIAN_PASSTHROUGH=0 still gets a usable file/shell
|
|
38
|
+
* surface rather than nothing, and is documented as a degraded mode.
|
|
39
|
+
*/
|
|
40
|
+
declare const PRIME_ALLOWED_MCP_TOOLS: readonly string[];
|
|
41
|
+
/**
|
|
42
|
+
* Extract the client's working directory from Prime Agent's system prompt.
|
|
43
|
+
*
|
|
44
|
+
* Both patterns are anchored to start-of-line. In harness-generated text that
|
|
45
|
+
* anchoring is not currently load-bearing — a capture of the real prompt
|
|
46
|
+
* contains exactly one `Working directory:` occurrence and it is already at
|
|
47
|
+
* line start (the prompt does discuss "the working directory" in prose, but
|
|
48
|
+
* lowercase and without a colon, so it never matched either way).
|
|
49
|
+
*
|
|
50
|
+
* The anchor guards user-supplied content instead. Project context files are
|
|
51
|
+
* inlined into this same prompt under `# Project Context`, so an AGENTS.md that
|
|
52
|
+
* quotes the line mid-sentence — "set Working directory: /tmp/example first" —
|
|
53
|
+
* would otherwise be read as the client's real cwd.
|
|
54
|
+
*
|
|
55
|
+
* `Working directory:` is tried first because in the common (default-prompt)
|
|
56
|
+
* case it sits at line 5, ahead of any user content that might introduce the
|
|
57
|
+
* other spelling. The customPrompt branch emits no such line, so it falls
|
|
58
|
+
* through to `Current working directory:`.
|
|
59
|
+
*/
|
|
60
|
+
declare function extractPrimeCwd(body: any): string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Map an `ipython` cell to file changes.
|
|
63
|
+
*
|
|
64
|
+
* Handles the two forms that are cheap to read accurately:
|
|
65
|
+
*
|
|
66
|
+
* 1. `%%bash` cells. A cell magic must be the first line of the cell (Prime
|
|
67
|
+
* Agent's own prompt states this), so the whole remaining cell is shell
|
|
68
|
+
* and goes through the existing bash extractor.
|
|
69
|
+
* 2. `edit(path=...)` calls and `!cmd` shell escapes inside a Python cell.
|
|
70
|
+
*
|
|
71
|
+
* It deliberately does NOT parse arbitrary Python writes — `open(p, "w")`,
|
|
72
|
+
* `Path.write_text`, library calls, anything behind a variable. That would need
|
|
73
|
+
* real dataflow analysis, and a parser that silently half-works is worse than a
|
|
74
|
+
* documented gap: file-change summaries are a reporting nicety here, not
|
|
75
|
+
* correctness. The limitation is stated in docs/agents.md.
|
|
76
|
+
*/
|
|
77
|
+
declare function extractFileChangesFromIpythonCell(code: string): FileChange[];
|
|
78
|
+
/**
|
|
79
|
+
* Map a client-side tool_use block to file changes.
|
|
80
|
+
*
|
|
81
|
+
* In passthrough mode the SDK never executes tools, so PostToolUse hooks never
|
|
82
|
+
* fire and file changes have to be read back out of the conversation.
|
|
83
|
+
*
|
|
84
|
+
* `ipython` is the only tool Prime Agent offers by default; `bash` and `edit`
|
|
85
|
+
* appear only when a user opts into them with `-t`.
|
|
86
|
+
*
|
|
87
|
+
* Shared with transforms/prime.ts so the two cannot drift.
|
|
88
|
+
*/
|
|
89
|
+
declare function extractPrimeFileChanges(toolName: string, toolInput: unknown): FileChange[];
|
|
90
|
+
export declare const primeAdapter: AgentAdapter;
|
|
91
|
+
/**
|
|
92
|
+
* Exported so transforms/prime.ts can share the exact same implementations
|
|
93
|
+
* rather than keeping a hand-copied duplicate in step (the transform-parity
|
|
94
|
+
* test catches drift, but not sharing is simply better). The import direction
|
|
95
|
+
* is transforms → adapters, matching transforms/cherry.ts; the adapter
|
|
96
|
+
* deliberately does NOT re-export primeTransforms, which would close the cycle.
|
|
97
|
+
*/
|
|
98
|
+
export { extractPrimeCwd, extractFileChangesFromIpythonCell, extractPrimeFileChanges, PRIME_ALLOWED_MCP_TOOLS, };
|
|
99
|
+
//# sourceMappingURL=prime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prime.d.ts","sourceRoot":"","sources":["../../../src/proxy/adapters/prime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,KAAK,UAAU,EAA8B,MAAM,gBAAgB,CAAA;AAQ5E;;;;;;;;GAQG;AACH,QAAA,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAO7C,CAAA;AAiBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,iBAAS,eAAe,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CActD;AAYD;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,iCAAiC,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAuBrE;AAED;;;;;;;;;;GAUG;AACH,iBAAS,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,UAAU,EAAE,CAkBnF;AAED,eAAO,MAAM,YAAY,EAAE,YAoH1B,CAAA;AAED;;;;;;GAMG;AACH,OAAO,EACL,eAAe,EACf,iCAAiC,EACjC,uBAAuB,EACvB,uBAAuB,GACxB,CAAA"}
|
package/dist/proxy/errors.d.ts
CHANGED
|
@@ -73,6 +73,20 @@ export declare function isBusySessionError(error: unknown, stderr?: string): boo
|
|
|
73
73
|
* Used by server.ts to decide whether to retry with a smaller context window.
|
|
74
74
|
*/
|
|
75
75
|
export declare function isRateLimitError(errMsg: string): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Whether a classified error type means "this account cannot serve the
|
|
78
|
+
* request, another one might". Used by priority routing to decide failover.
|
|
79
|
+
*/
|
|
80
|
+
export declare function isAccountFailoverError(errorType: string | null | undefined): errorType is string;
|
|
81
|
+
/**
|
|
82
|
+
* Whether the refusal is the quota kind, which names its own reset — the two
|
|
83
|
+
* cooldown tiers read the account's five-hour window, and only this kind has
|
|
84
|
+
* anything to look up there. Lives beside the set so the type name stays
|
|
85
|
+
* owned by one module: a rename that missed a caller in the orchestrator would
|
|
86
|
+
* not break failover loudly, it would silently downgrade every quota cooldown
|
|
87
|
+
* to the conservative default.
|
|
88
|
+
*/
|
|
89
|
+
export declare function isQuotaRefusal(errorType: string | null | undefined): boolean;
|
|
76
90
|
/**
|
|
77
91
|
* Detect errors caused by the 1M context window requiring Extra Usage.
|
|
78
92
|
* Max subscribers without Extra Usage enabled get this error when using
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/proxy/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAc1D;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/proxy/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAc1D;AAsBD;;;;;;GA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AgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAgC5E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAInG;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAI9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/proxy/server.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA;AAGvD,YAAY,EACV,SAAS,EACT,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,WAAW,GACZ,MAAM,aAAa,CAAA;AAKpB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAoDnG,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EAEpB,KAAK,aAAa,EAGnB,MAAM,mBAAmB,CAAA;AAI1B,OAAO,EAA+B,iBAAiB,EAAE,mBAAmB,EAAsC,MAAM,iBAAiB,CAAA;AAGzI,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAA;AACjD,YAAY,EAAE,aAAa,EAAE,CAAA;AA+R7B,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/proxy/server.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA;AAGvD,YAAY,EACV,SAAS,EACT,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,WAAW,GACZ,MAAM,aAAa,CAAA;AAKpB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAoDnG,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EAEpB,KAAK,aAAa,EAGnB,MAAM,mBAAmB,CAAA;AAI1B,OAAO,EAA+B,iBAAiB,EAAE,mBAAmB,EAAsC,MAAM,iBAAiB,CAAA;AAGzI,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAA;AACjD,YAAY,EAAE,aAAa,EAAE,CAAA;AA+R7B,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CA0hJhF;AAWD,wBAAgB,gCAAgC,IAAI,IAAI,CAavD;AAED,wBAAsB,gBAAgB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAmGhG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/proxy/session/cache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,OAAO,
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/proxy/session/cache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,OAAO,EAML,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,WAAW,CAAA;AAMlB,wBAAgB,mBAAmB,IAAI,MAAM,CAW5C;AAqCD;kGACkG;AAClG,wBAAgB,iBAAiB,SAYhC;AAED;iFACiF;AACjF,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,gBAAgB,CAAC,EAAE,MAAM,EACzB,QAAQ,CAAC,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,GAAG,CAAA;CAAE,CAAC,GAC/C,IAAI,CAoBN;AA0CD;;uDAEuD;AACvD,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,GAAG,CAAA;CAAE,CAAC,EAC/C,gBAAgB,CAAC,EAAE,MAAM,GACxB,aAAa,CA2Df;AAED;;uFAEuF;AACvF,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CA6BtF;AAED;;;yFAGyF;AACzF,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,EACnD,eAAe,EAAE,MAAM,EACvB,gBAAgB,CAAC,EAAE,MAAM,EACzB,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,EACtC,YAAY,CAAC,EAAE,UAAU,EACzB,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,QA0CtC"}
|
|
@@ -71,6 +71,9 @@ export type LineageResult = {
|
|
|
71
71
|
type: "diverged";
|
|
72
72
|
reason: LineageDivergenceReason;
|
|
73
73
|
prefixOverlap?: number;
|
|
74
|
+
/** Which message stopped matching. Present for modified-history, the
|
|
75
|
+
* only divergence where the answer is both knowable and useful. */
|
|
76
|
+
mismatch?: LineageMismatch;
|
|
74
77
|
};
|
|
75
78
|
export type LineageDivergenceReason = "unverifiable" | "replayed-request" | "modified-history" | "unrelated-history" | "not-found" | "independent-request" | "missing-session-header";
|
|
76
79
|
/**
|
|
@@ -90,6 +93,61 @@ export declare function hashMessage(message: {
|
|
|
90
93
|
role: string;
|
|
91
94
|
content: any;
|
|
92
95
|
}): string;
|
|
96
|
+
/** A message's shape, for diagnostics that must never carry its content. */
|
|
97
|
+
export interface MessageShape {
|
|
98
|
+
role: string;
|
|
99
|
+
/** "string" for plain content, otherwise the block types in order. */
|
|
100
|
+
blocks: string;
|
|
101
|
+
/** Bytes of normalized content — size moves when content does. */
|
|
102
|
+
bytes: number;
|
|
103
|
+
}
|
|
104
|
+
/** Why two histories stopped matching, in terms safe to log.
|
|
105
|
+
*
|
|
106
|
+
* Answers the question `prefix overlap 50/51` raises and never answers: WHICH
|
|
107
|
+
* message stopped matching, and what changed about its shape. Content never
|
|
108
|
+
* appears here — only role, block types, byte counts, and digests.
|
|
109
|
+
*/
|
|
110
|
+
export interface LineageMismatch {
|
|
111
|
+
/** First index whose digest differs, or -1 when the prefix matches entirely. */
|
|
112
|
+
index: number;
|
|
113
|
+
storedDigest?: string;
|
|
114
|
+
incomingDigest?: string;
|
|
115
|
+
/** Only the incoming side has a shape: the stored side is kept as digests,
|
|
116
|
+
* so its structure is not recoverable — by design, nothing to recover. */
|
|
117
|
+
incomingShape?: MessageShape;
|
|
118
|
+
/** Digest of the preceding index, which by definition matched. */
|
|
119
|
+
previousDigest?: string;
|
|
120
|
+
storedCount: number;
|
|
121
|
+
incomingCount: number;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Locate the first message whose hash differs between a stored session and an
|
|
125
|
+
* incoming request.
|
|
126
|
+
*
|
|
127
|
+
* Pure and allocation-light: callers reach for it only on a divergence, which
|
|
128
|
+
* is rare and already about to cost a full replay.
|
|
129
|
+
*/
|
|
130
|
+
export declare function describeLineageMismatch(cached: SessionState, messages: Array<{
|
|
131
|
+
role: string;
|
|
132
|
+
content: any;
|
|
133
|
+
}>,
|
|
134
|
+
/** Reuse the caller's hashes. verifyLineage has already hashed the incoming
|
|
135
|
+
* history to measure overlap; hashing it again on a 700-message transcript
|
|
136
|
+
* would double the cost of the request that is already paying for a replay. */
|
|
137
|
+
precomputedIncomingHashes?: string[]): LineageMismatch;
|
|
138
|
+
/**
|
|
139
|
+
* One-line explanation of a divergence, for the log that reports it.
|
|
140
|
+
*
|
|
141
|
+
* `prefix overlap 50/51` says how many messages matched and never which one
|
|
142
|
+
* stopped, which is the fact needed to act on it — a trailing-only mismatch is
|
|
143
|
+
* a late tool result or a client re-serialising its last turn, while a mismatch
|
|
144
|
+
* in the middle means the history was rewritten. Same overlap count, different
|
|
145
|
+
* bug.
|
|
146
|
+
*
|
|
147
|
+
* Digests are truncated and content never appears, so the line is safe to paste
|
|
148
|
+
* into a public issue.
|
|
149
|
+
*/
|
|
150
|
+
export declare function formatLineageMismatch(mismatch: LineageMismatch): string | undefined;
|
|
93
151
|
/**
|
|
94
152
|
* Compute per-message hashes for an entire message array.
|
|
95
153
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineage.d.ts","sourceRoot":"","sources":["../../../src/proxy/session/lineage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,4EAA4E;AAC5E,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,2BAA2B,CAAC,EAAE,MAAM,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,kFAAkF;AAClF,MAAM,WAAW,UAAW,SAAQ,mBAAmB;IACrD,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAAA;CACnC;AAED;;6DAE6D;AAC7D,w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@@ export interface TelemetryContext {
|
|
|
93
93
|
readonly cacheCreationTokens: number;
|
|
94
94
|
readonly cacheHitRate: number;
|
|
95
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* A lineage decision, after it has been made.
|
|
98
|
+
*
|
|
99
|
+
* Observe-only in practice: the pipeline takes the returned context, but
|
|
100
|
+
* nothing downstream reads it back, so a plugin cannot change how a session
|
|
101
|
+
* resumes. That is deliberate — resume correctness is core's to own, and the
|
|
102
|
+
* three stale-lineage defects it has already produced are not a surface to
|
|
103
|
+
* open to third parties.
|
|
104
|
+
*
|
|
105
|
+
* `mismatch` is present only on a divergence, which is the case worth
|
|
106
|
+
* diagnosing: it names WHICH message stopped matching, where `prefix overlap
|
|
107
|
+
* 50/51` only ever said how many did. Content never appears — roles, block
|
|
108
|
+
* types, byte counts, and digests are enough to tell a late tool result from a
|
|
109
|
+
* rewritten transcript, and they are safe to write to a log.
|
|
110
|
+
*/
|
|
96
111
|
export interface SessionContext {
|
|
97
112
|
readonly adapter: string;
|
|
113
|
+
readonly lineage: "continuation" | "compaction" | "undo" | "diverged";
|
|
114
|
+
/** Set when lineage is `diverged`. */
|
|
115
|
+
readonly reason?: string;
|
|
116
|
+
readonly sessionKey?: string;
|
|
117
|
+
readonly storedCount?: number;
|
|
118
|
+
readonly incomingCount?: number;
|
|
119
|
+
readonly prefixOverlap?: number;
|
|
120
|
+
readonly mismatch?: {
|
|
121
|
+
readonly index: number;
|
|
122
|
+
readonly storedDigest?: string;
|
|
123
|
+
readonly incomingDigest?: string;
|
|
124
|
+
readonly previousDigest?: string;
|
|
125
|
+
readonly incomingShape?: {
|
|
126
|
+
readonly role: string;
|
|
127
|
+
readonly blocks: string;
|
|
128
|
+
readonly bytes: number;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
98
131
|
[key: string]: unknown;
|
|
99
132
|
}
|
|
100
133
|
export interface ToolUseContext {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"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A;IACT,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,GAAG,EAAE,CAAA;IACf,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,GAAG,EAAE,CAAA;IACb,MAAM,EAAE,OAAO,CAAA;IACf,gBAAgB,EAAE,MAAM,CAAA;CACzB,GAAG,cAAc,CAqBjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prime.d.ts","sourceRoot":"","sources":["../../../src/proxy/transforms/prime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,cAAc,CAAA;AAkB7D,eAAO,MAAM,eAAe,EAAE,SAAS,EAmBtC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/proxy/transforms/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/proxy/transforms/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAyC7C,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,SAAS,EAAE,CAE9E"}
|
package/dist/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"landing.d.ts","sourceRoot":"","sources":["../../src/telemetry/landing.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"landing.d.ts","sourceRoot":"","sources":["../../src/telemetry/landing.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,eAAO,MAAM,WAAW,QA8QhB,CAAA"}
|
package/package.json
CHANGED