@rynfar/meridian 1.30.0 → 1.31.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/dist/{cli-b2n69dg7.js → cli-7hathpbb.js} +108 -13
- package/dist/cli.js +1 -1
- package/dist/proxy/adapter.d.ts +9 -0
- package/dist/proxy/adapter.d.ts.map +1 -1
- package/dist/proxy/adapters/opencode.d.ts.map +1 -1
- package/dist/proxy/passthroughTools.d.ts +9 -1
- package/dist/proxy/passthroughTools.d.ts.map +1 -1
- package/dist/proxy/query.d.ts +2 -0
- package/dist/proxy/query.d.ts.map +1 -1
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/proxy/tokenHealth.d.ts.map +1 -1
- package/dist/proxy/tools.d.ts.map +1 -1
- package/dist/server.js +1 -1
- package/dist/telemetry/types.d.ts +10 -0
- package/dist/telemetry/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -6217,22 +6217,51 @@ function jsonSchemaToZod(schema) {
|
|
|
6217
6217
|
}
|
|
6218
6218
|
return exports_external.any();
|
|
6219
6219
|
}
|
|
6220
|
-
|
|
6220
|
+
var DEFAULT_DEFER_THRESHOLD = 15;
|
|
6221
|
+
function getAutoDeferThreshold() {
|
|
6222
|
+
const raw2 = process.env.MERIDIAN_DEFER_TOOL_THRESHOLD;
|
|
6223
|
+
if (raw2 === undefined)
|
|
6224
|
+
return DEFAULT_DEFER_THRESHOLD;
|
|
6225
|
+
const parsed = Number.parseInt(raw2, 10);
|
|
6226
|
+
if (!Number.isFinite(parsed) || parsed < 0)
|
|
6227
|
+
return DEFAULT_DEFER_THRESHOLD;
|
|
6228
|
+
return parsed;
|
|
6229
|
+
}
|
|
6230
|
+
function createPassthroughMcpServer(tools, coreToolNames) {
|
|
6221
6231
|
const server = createSdkMcpServer({ name: PASSTHROUGH_MCP_NAME });
|
|
6222
6232
|
const toolNames = [];
|
|
6233
|
+
const threshold = getAutoDeferThreshold();
|
|
6234
|
+
const autoDefer = !!(threshold > 0 && coreToolNames && coreToolNames.length > 0 && tools.length > threshold);
|
|
6235
|
+
const coreSet = autoDefer ? new Set(coreToolNames.map((n) => n.toLowerCase())) : undefined;
|
|
6236
|
+
const hasDeferredTools = tools.some((t) => t.defer_loading === true) || autoDefer;
|
|
6223
6237
|
const sortedTools = [...tools].sort((a, b) => a.name.localeCompare(b.name));
|
|
6224
6238
|
for (const tool of sortedTools) {
|
|
6225
6239
|
try {
|
|
6226
6240
|
const zodSchema = tool.input_schema?.properties ? jsonSchemaToZod(tool.input_schema) : exports_external.object({});
|
|
6227
6241
|
const shape = zodSchema instanceof exports_external.ZodObject ? zodSchema.shape : { input: exports_external.any() };
|
|
6228
|
-
server.instance.
|
|
6242
|
+
server.instance.registerTool(tool.name, {
|
|
6243
|
+
description: tool.description || tool.name,
|
|
6244
|
+
inputSchema: shape,
|
|
6245
|
+
...hasDeferredTools ? shouldAlwaysLoad(tool, coreSet) ? { _meta: { "anthropic/alwaysLoad": true } } : {} : {}
|
|
6246
|
+
}, async () => ({ content: [{ type: "text", text: "passthrough" }] }));
|
|
6229
6247
|
toolNames.push(`${PASSTHROUGH_MCP_PREFIX}${tool.name}`);
|
|
6230
6248
|
} catch {
|
|
6231
|
-
server.instance.
|
|
6249
|
+
server.instance.registerTool(tool.name, {
|
|
6250
|
+
description: tool.description || tool.name,
|
|
6251
|
+
inputSchema: { input: exports_external.string().optional() },
|
|
6252
|
+
...hasDeferredTools ? shouldAlwaysLoad(tool, coreSet) ? { _meta: { "anthropic/alwaysLoad": true } } : {} : {}
|
|
6253
|
+
}, async () => ({ content: [{ type: "text", text: "passthrough" }] }));
|
|
6232
6254
|
toolNames.push(`${PASSTHROUGH_MCP_PREFIX}${tool.name}`);
|
|
6233
6255
|
}
|
|
6234
6256
|
}
|
|
6235
|
-
return { server, toolNames };
|
|
6257
|
+
return { server, toolNames, hasDeferredTools };
|
|
6258
|
+
}
|
|
6259
|
+
function shouldAlwaysLoad(tool, coreSet) {
|
|
6260
|
+
if (tool.defer_loading === true)
|
|
6261
|
+
return false;
|
|
6262
|
+
if (coreSet)
|
|
6263
|
+
return coreSet.has(tool.name.toLowerCase());
|
|
6264
|
+
return true;
|
|
6236
6265
|
}
|
|
6237
6266
|
function stripMcpPrefix(toolName) {
|
|
6238
6267
|
if (toolName.startsWith(PASSTHROUGH_MCP_PREFIX)) {
|
|
@@ -6740,7 +6769,7 @@ function render(s, reqs, logs) {
|
|
|
6740
6769
|
+ '<td class="mono">' + ago(r.timestamp) + '</td>'
|
|
6741
6770
|
+ '<td>' + (r.adapter || '—') + '</td>'
|
|
6742
6771
|
+ '<td>' + (r.requestModel || r.model) + '<br><span style="font-size:10px;color:var(--muted)">' + r.model + '</span></td>'
|
|
6743
|
-
+ '<td>' + r.mode + '</td>'
|
|
6772
|
+
+ '<td>' + r.mode + (r.hasDeferredTools ? (function() { var sessDisc = r.sessionDiscoveredCount || 0; var loaded = ((r.toolCount || 0) - (r.deferredToolCount || 0)) + sessDisc; var deferred = Math.max(0, (r.deferredToolCount || 0) - sessDisc); var newDisc = r.discoveredTools || []; return '<br><span style="font-size:10px;color:var(--purple)">loaded=' + loaded + ' deferred=' + deferred + '</span>' + (newDisc.length > 0 ? '<br><span style="font-size:10px;color:var(--green)">+' + newDisc.join(', +') + '</span>' : ''); })() : '') + '</td>'
|
|
6744
6773
|
+ '<td class="mono">' + sessionShort + ' ' + lineageBadge + '<br><span style="font-size:10px;color:var(--muted)">' + msgCount + ' msgs</span></td>'
|
|
6745
6774
|
+ '<td class="' + statusClass + '">' + statusText + '</td>'
|
|
6746
6775
|
+ '<td class="mono">' + ms(r.queueWaitMs) + '</td>'
|
|
@@ -7617,7 +7646,6 @@ var BLOCKED_BUILTIN_TOOLS = [
|
|
|
7617
7646
|
"TodoWrite"
|
|
7618
7647
|
];
|
|
7619
7648
|
var CLAUDE_CODE_ONLY_TOOLS = [
|
|
7620
|
-
"ToolSearch",
|
|
7621
7649
|
"CronCreate",
|
|
7622
7650
|
"CronDelete",
|
|
7623
7651
|
"CronList",
|
|
@@ -7766,6 +7794,9 @@ var openCodeAdapter = {
|
|
|
7766
7794
|
getAllowedMcpTools() {
|
|
7767
7795
|
return ALLOWED_MCP_TOOLS;
|
|
7768
7796
|
},
|
|
7797
|
+
getCoreToolNames() {
|
|
7798
|
+
return ["read", "write", "edit", "bash", "glob", "grep"];
|
|
7799
|
+
},
|
|
7769
7800
|
usesPassthrough() {
|
|
7770
7801
|
const envVal = process.env.MERIDIAN_PASSTHROUGH ?? process.env.CLAUDE_PROXY_PASSTHROUGH;
|
|
7771
7802
|
if (envVal === "0" || envVal === "false" || envVal === "no") {
|
|
@@ -13848,6 +13879,7 @@ function buildQueryOptions(ctx) {
|
|
|
13848
13879
|
sdkAgents,
|
|
13849
13880
|
passthroughMcp,
|
|
13850
13881
|
cleanEnv,
|
|
13882
|
+
hasDeferredTools,
|
|
13851
13883
|
resumeSessionId,
|
|
13852
13884
|
isUndo,
|
|
13853
13885
|
undoRollbackUuid,
|
|
@@ -13866,7 +13898,7 @@ function buildQueryOptions(ctx) {
|
|
|
13866
13898
|
prompt,
|
|
13867
13899
|
options: {
|
|
13868
13900
|
executable: "node",
|
|
13869
|
-
maxTurns: passthrough ? 2 : 200,
|
|
13901
|
+
maxTurns: passthrough ? resumeSessionId || hasDeferredTools ? 3 : 2 : 200,
|
|
13870
13902
|
cwd: workingDirectory,
|
|
13871
13903
|
model,
|
|
13872
13904
|
pathToClaudeCodeExecutable: claudeExecutable,
|
|
@@ -13891,7 +13923,7 @@ function buildQueryOptions(ctx) {
|
|
|
13891
13923
|
...onStderr ? { stderr: onStderr } : {},
|
|
13892
13924
|
env: {
|
|
13893
13925
|
...cleanEnv,
|
|
13894
|
-
ENABLE_TOOL_SEARCH: "false",
|
|
13926
|
+
ENABLE_TOOL_SEARCH: hasDeferredTools ? "true" : "false",
|
|
13895
13927
|
...passthrough ? { ENABLE_CLAUDEAI_MCP_SERVERS: "false" } : {},
|
|
13896
13928
|
...process.getuid?.() === 0 ? { IS_SANDBOX: "1" } : {}
|
|
13897
13929
|
},
|
|
@@ -13970,10 +14002,11 @@ function detectTokenAnomalies(current, previous) {
|
|
|
13970
14002
|
}
|
|
13971
14003
|
}
|
|
13972
14004
|
if (current.isResume && current.cacheHitRate <= CACHE_MISS_THRESHOLD && current.inputTokens > 0) {
|
|
14005
|
+
const isFirstAfterRestart = !previous;
|
|
13973
14006
|
anomalies.push({
|
|
13974
14007
|
type: "cache_miss",
|
|
13975
|
-
severity: "critical",
|
|
13976
|
-
detail: `Cache hit rate ${Math.round(current.cacheHitRate * 100)}% on resume (expected >50%). Prompt caching likely invalidated — check tool ordering or system prompt changes.`
|
|
14008
|
+
severity: isFirstAfterRestart ? "warn" : "critical",
|
|
14009
|
+
detail: isFirstAfterRestart ? `Cache hit rate ${Math.round(current.cacheHitRate * 100)}% on resume — normal after proxy restart, cache will re-prime on next turn.` : `Cache hit rate ${Math.round(current.cacheHitRate * 100)}% on resume (expected >50%). Prompt caching likely invalidated — check tool ordering or system prompt changes.`
|
|
13977
14010
|
});
|
|
13978
14011
|
}
|
|
13979
14012
|
if (previous && previous.outputTokens > 0 && current.outputTokens > 0) {
|
|
@@ -14743,6 +14776,7 @@ function checkTokenHealth(requestId, sdkSessionId, usage, turnNumber, isResume,
|
|
|
14743
14776
|
function createProxyServer(config = {}) {
|
|
14744
14777
|
const finalConfig = { ...DEFAULT_PROXY_CONFIG, ...config };
|
|
14745
14778
|
restoreActiveProfile(finalConfig.profiles);
|
|
14779
|
+
const sessionDiscoveredTools = new Map;
|
|
14746
14780
|
const app = new Hono2;
|
|
14747
14781
|
app.use("*", cors());
|
|
14748
14782
|
app.get("/", (c) => {
|
|
@@ -14865,7 +14899,8 @@ function createProxyServer(config = {}) {
|
|
|
14865
14899
|
}).join(" → ");
|
|
14866
14900
|
const lineageType = lineageResult.type === "diverged" && !cachedSession ? "new" : lineageResult.type;
|
|
14867
14901
|
const msgCount = Array.isArray(body.messages) ? body.messages.length : 0;
|
|
14868
|
-
const
|
|
14902
|
+
const toolCount = body.tools?.length ?? 0;
|
|
14903
|
+
const requestLogLine = `${requestMeta.requestId} adapter=${adapter.name} model=${model} stream=${stream2} tools=${toolCount} lineage=${lineageType} session=${resumeSessionId?.slice(0, 8) || "new"}${isUndo && undoRollbackUuid ? ` rollback=${undoRollbackUuid.slice(0, 8)}` : ""}${agentMode ? ` agent=${agentMode}` : ""} active=${activeSessions}/${MAX_CONCURRENT_SESSIONS} msgCount=${msgCount}`;
|
|
14869
14904
|
console.error(`[PROXY] ${requestLogLine} msgs=${msgSummary}`);
|
|
14870
14905
|
diagnosticLog.session(`${requestLogLine}`, requestMeta.requestId);
|
|
14871
14906
|
if (lineageResult.type === "diverged" && profileSessionId) {
|
|
@@ -14995,18 +15030,32 @@ function createProxyServer(config = {}) {
|
|
|
14995
15030
|
const fileChanges = [];
|
|
14996
15031
|
let passthroughMcp;
|
|
14997
15032
|
if (passthrough && Array.isArray(body.tools) && body.tools.length > 0) {
|
|
14998
|
-
passthroughMcp = createPassthroughMcpServer(body.tools);
|
|
15033
|
+
passthroughMcp = createPassthroughMcpServer(body.tools, adapter.getCoreToolNames?.());
|
|
15034
|
+
}
|
|
15035
|
+
const hasDeferredTools = passthroughMcp?.hasDeferredTools ?? false;
|
|
15036
|
+
const coreNames = adapter.getCoreToolNames?.();
|
|
15037
|
+
const coreSet = coreNames ? new Set(coreNames.map((n) => n.toLowerCase())) : undefined;
|
|
15038
|
+
const deferredToolCount = hasDeferredTools && Array.isArray(body.tools) ? body.tools.filter((t) => t.defer_loading === true || coreSet && !coreSet.has(String(t.name).toLowerCase())).length : 0;
|
|
15039
|
+
if (hasDeferredTools) {
|
|
15040
|
+
console.error(`[PROXY] ${requestMeta.requestId} deferred=${deferredToolCount}/${toolCount} tools (core: ${coreNames?.join(",") ?? "none"})`);
|
|
14999
15041
|
}
|
|
15000
15042
|
const mcpPrefix = `mcp__${adapter.getMcpServerName()}__`;
|
|
15001
15043
|
const trackFileChanges = !(process.env.MERIDIAN_NO_FILE_CHANGES ?? process.env.CLAUDE_PROXY_NO_FILE_CHANGES);
|
|
15002
15044
|
const fileChangeHook = trackFileChanges ? createFileChangeHook(fileChanges, mcpPrefix) : undefined;
|
|
15045
|
+
const discoveredTools = new Set;
|
|
15003
15046
|
const sdkHooks = passthrough ? {
|
|
15004
15047
|
PreToolUse: [{
|
|
15005
15048
|
matcher: "",
|
|
15006
15049
|
hooks: [async (input) => {
|
|
15050
|
+
if (input.tool_name === "ToolSearch")
|
|
15051
|
+
return;
|
|
15052
|
+
const toolName = stripMcpPrefix(input.tool_name);
|
|
15053
|
+
if (hasDeferredTools && coreSet && !coreSet.has(toolName.toLowerCase())) {
|
|
15054
|
+
discoveredTools.add(toolName);
|
|
15055
|
+
}
|
|
15007
15056
|
capturedToolUses.push({
|
|
15008
15057
|
id: input.tool_use_id,
|
|
15009
|
-
name:
|
|
15058
|
+
name: toolName,
|
|
15010
15059
|
input: input.tool_input
|
|
15011
15060
|
});
|
|
15012
15061
|
return {
|
|
@@ -15058,6 +15107,7 @@ function createProxyServer(config = {}) {
|
|
|
15058
15107
|
sdkAgents,
|
|
15059
15108
|
passthroughMcp,
|
|
15060
15109
|
cleanEnv: profileEnv,
|
|
15110
|
+
hasDeferredTools,
|
|
15061
15111
|
resumeSessionId,
|
|
15062
15112
|
isUndo,
|
|
15063
15113
|
undoRollbackUuid,
|
|
@@ -15101,6 +15151,7 @@ function createProxyServer(config = {}) {
|
|
|
15101
15151
|
sdkAgents,
|
|
15102
15152
|
passthroughMcp,
|
|
15103
15153
|
cleanEnv: profileEnv,
|
|
15154
|
+
hasDeferredTools,
|
|
15104
15155
|
resumeSessionId: undefined,
|
|
15105
15156
|
isUndo: false,
|
|
15106
15157
|
undoRollbackUuid: undefined,
|
|
@@ -15191,6 +15242,10 @@ function createProxyServer(config = {}) {
|
|
|
15191
15242
|
} else {
|
|
15192
15243
|
for (const block of message.message.content) {
|
|
15193
15244
|
const b = block;
|
|
15245
|
+
if (b.type === "tool_use" && b.name === "ToolSearch") {
|
|
15246
|
+
claudeLog("passthrough.toolsearch_filtered", { mode: "non_stream" });
|
|
15247
|
+
continue;
|
|
15248
|
+
}
|
|
15194
15249
|
if (passthrough && !adapter.supportsThinking?.() && (b.type === "thinking" || b.type === "redacted_thinking")) {
|
|
15195
15250
|
claudeLog("passthrough.thinking_stripped", { mode: "non_stream", type: b.type });
|
|
15196
15251
|
continue;
|
|
@@ -15214,6 +15269,16 @@ function createProxyServer(config = {}) {
|
|
|
15214
15269
|
});
|
|
15215
15270
|
if (lastUsage)
|
|
15216
15271
|
logUsage(requestMeta.requestId, lastUsage);
|
|
15272
|
+
const sessId = currentSessionId || resumeSessionId;
|
|
15273
|
+
if (sessId && discoveredTools.size > 0) {
|
|
15274
|
+
if (!sessionDiscoveredTools.has(sessId))
|
|
15275
|
+
sessionDiscoveredTools.set(sessId, new Set);
|
|
15276
|
+
for (const t of discoveredTools)
|
|
15277
|
+
sessionDiscoveredTools.get(sessId).add(t);
|
|
15278
|
+
const newNames = [...discoveredTools].join(", ");
|
|
15279
|
+
const allNames = [...sessionDiscoveredTools.get(sessId)];
|
|
15280
|
+
console.error(`[PROXY] ${requestMeta.requestId} discovered=${discoveredTools.size} (${newNames}) session_total=${allNames.length}`);
|
|
15281
|
+
}
|
|
15217
15282
|
} catch (error) {
|
|
15218
15283
|
const stderrOutput = stderrLines.join(`
|
|
15219
15284
|
`).trim();
|
|
@@ -15286,6 +15351,11 @@ Subprocess stderr: ${stderrOutput}`;
|
|
|
15286
15351
|
mode: "non-stream",
|
|
15287
15352
|
isResume,
|
|
15288
15353
|
isPassthrough: passthrough,
|
|
15354
|
+
hasDeferredTools,
|
|
15355
|
+
deferredToolCount: hasDeferredTools ? deferredToolCount : undefined,
|
|
15356
|
+
toolCount,
|
|
15357
|
+
discoveredTools: discoveredTools.size > 0 ? [...discoveredTools] : undefined,
|
|
15358
|
+
sessionDiscoveredCount: sessionDiscoveredTools.get(currentSessionId || resumeSessionId || "")?.size,
|
|
15289
15359
|
lineageType,
|
|
15290
15360
|
messageCount: allMessages.length,
|
|
15291
15361
|
sdkSessionId: currentSessionId || resumeSessionId,
|
|
@@ -15381,6 +15451,7 @@ Subprocess stderr: ${stderrOutput}`;
|
|
|
15381
15451
|
sdkAgents,
|
|
15382
15452
|
passthroughMcp,
|
|
15383
15453
|
cleanEnv: profileEnv,
|
|
15454
|
+
hasDeferredTools,
|
|
15384
15455
|
resumeSessionId,
|
|
15385
15456
|
isUndo,
|
|
15386
15457
|
undoRollbackUuid,
|
|
@@ -15424,6 +15495,7 @@ Subprocess stderr: ${stderrOutput}`;
|
|
|
15424
15495
|
sdkAgents,
|
|
15425
15496
|
passthroughMcp,
|
|
15426
15497
|
cleanEnv: profileEnv,
|
|
15498
|
+
hasDeferredTools,
|
|
15427
15499
|
resumeSessionId: undefined,
|
|
15428
15500
|
isUndo: false,
|
|
15429
15501
|
undoRollbackUuid: undefined,
|
|
@@ -15577,6 +15649,11 @@ data: ${JSON.stringify({ type: "message_stop" })}
|
|
|
15577
15649
|
continue;
|
|
15578
15650
|
}
|
|
15579
15651
|
if (block?.type === "tool_use" && typeof block.name === "string") {
|
|
15652
|
+
if (block.name === "ToolSearch") {
|
|
15653
|
+
if (eventIndex !== undefined)
|
|
15654
|
+
skipBlockIndices.add(eventIndex);
|
|
15655
|
+
continue;
|
|
15656
|
+
}
|
|
15580
15657
|
if (passthrough && block.name.startsWith(PASSTHROUGH_MCP_PREFIX)) {
|
|
15581
15658
|
block.name = stripMcpPrefix(block.name);
|
|
15582
15659
|
if (block.id)
|
|
@@ -15646,6 +15723,16 @@ data: ${JSON.stringify({ type: "message_stop" })}
|
|
|
15646
15723
|
});
|
|
15647
15724
|
if (lastUsage)
|
|
15648
15725
|
logUsage(requestMeta.requestId, lastUsage);
|
|
15726
|
+
const sessId = currentSessionId || resumeSessionId;
|
|
15727
|
+
if (sessId && discoveredTools.size > 0) {
|
|
15728
|
+
if (!sessionDiscoveredTools.has(sessId))
|
|
15729
|
+
sessionDiscoveredTools.set(sessId, new Set);
|
|
15730
|
+
for (const t of discoveredTools)
|
|
15731
|
+
sessionDiscoveredTools.get(sessId).add(t);
|
|
15732
|
+
const newNames = [...discoveredTools].join(", ");
|
|
15733
|
+
const allNames = [...sessionDiscoveredTools.get(sessId)];
|
|
15734
|
+
console.error(`[PROXY] ${requestMeta.requestId} discovered=${discoveredTools.size} (${newNames}) session_total=${allNames.length}`);
|
|
15735
|
+
}
|
|
15649
15736
|
if (currentSessionId) {
|
|
15650
15737
|
storeSession(profileSessionId, body.messages || [], currentSessionId, profileScopedCwd, sdkUuidMap, lastUsage);
|
|
15651
15738
|
}
|
|
@@ -15762,6 +15849,11 @@ data: {"type":"message_stop"}
|
|
|
15762
15849
|
mode: "stream",
|
|
15763
15850
|
isResume,
|
|
15764
15851
|
isPassthrough: passthrough,
|
|
15852
|
+
hasDeferredTools,
|
|
15853
|
+
deferredToolCount: hasDeferredTools ? deferredToolCount : undefined,
|
|
15854
|
+
toolCount,
|
|
15855
|
+
discoveredTools: discoveredTools.size > 0 ? [...discoveredTools] : undefined,
|
|
15856
|
+
sessionDiscoveredCount: sessionDiscoveredTools.get(currentSessionId || resumeSessionId || "")?.size,
|
|
15765
15857
|
lineageType,
|
|
15766
15858
|
messageCount: allMessages.length,
|
|
15767
15859
|
sdkSessionId: currentSessionId || resumeSessionId,
|
|
@@ -15876,6 +15968,9 @@ data: ${JSON.stringify({
|
|
|
15876
15968
|
mode: "non-stream",
|
|
15877
15969
|
isResume: false,
|
|
15878
15970
|
isPassthrough: envBool("PASSTHROUGH"),
|
|
15971
|
+
hasDeferredTools: undefined,
|
|
15972
|
+
deferredToolCount: undefined,
|
|
15973
|
+
toolCount: undefined,
|
|
15879
15974
|
lineageType: undefined,
|
|
15880
15975
|
messageCount: undefined,
|
|
15881
15976
|
sdkSessionId: undefined,
|
package/dist/cli.js
CHANGED
package/dist/proxy/adapter.d.ts
CHANGED
|
@@ -82,6 +82,15 @@ export interface AgentAdapter {
|
|
|
82
82
|
* When defined, takes precedence over the env var for this agent.
|
|
83
83
|
*/
|
|
84
84
|
usesPassthrough?(): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Core tool names that should always be loaded (never deferred).
|
|
87
|
+
* When auto-defer is active (tool count exceeds threshold), these tools
|
|
88
|
+
* are marked alwaysLoad while everything else is deferred to reduce
|
|
89
|
+
* system prompt size.
|
|
90
|
+
*
|
|
91
|
+
* Return undefined to disable auto-defer for this agent.
|
|
92
|
+
*/
|
|
93
|
+
getCoreToolNames?(): readonly string[];
|
|
85
94
|
/**
|
|
86
95
|
* Whether this agent's client can render thinking blocks.
|
|
87
96
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/proxy/adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,sCAAsC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;IAE5C;;;OAGG;IACH,uBAAuB,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAAA;IAEtD;;;OAGG;IACH,gBAAgB,CAAC,OAAO,EAAE,GAAG,GAAG,MAAM,CAAA;IAEtC;;;OAGG;IACH,sBAAsB,IAAI,SAAS,MAAM,EAAE,CAAA;IAE3C;;;;OAIG;IACH,yBAAyB,IAAI,SAAS,MAAM,EAAE,CAAA;IAE9C;;;OAGG;IACH,gBAAgB,IAAI,MAAM,CAAA;IAE1B;;OAEG;IACH,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAAA;IAEvC;;;;OAIG;IACH,cAAc,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,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IACH,yBAAyB,IAAI,SAAS,MAAM,EAAE,CAAA;IAE9C;;;OAGG;IACH,gBAAgB,IAAI,MAAM,CAAA;IAE1B;;OAEG;IACH,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAAA;IAEvC;;;;OAIG;IACH,cAAc,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAEhF;;;OAGG;IACH,aAAa,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,CAAA;IAE9D;;;OAGG;IACH,0BAA0B,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAA;IAE9E;;;;;;OAMG;IACH,gBAAgB,CAAC,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAA;IAErC;;;;;;;;OAQG;IACH,eAAe,CAAC,IAAI,OAAO,CAAA;IAE3B;;;;;;;OAOG;IACH,gBAAgB,CAAC,IAAI,SAAS,MAAM,EAAE,CAAA;IAEtC;;;;;;;OAOG;IACH,gBAAgB,CAAC,IAAI,OAAO,CAAA;IAE5B;;;;;;;;;;;;;;;OAeG;IACH,6BAA6B,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,eAAe,EAAE,UAAU,EAAE,CAAA;CAC3G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../../src/proxy/adapters/opencode.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAQ9C,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../../src/proxy/adapters/opencode.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAQ9C,eAAO,MAAM,eAAe,EAAE,YAsH7B,CAAA"}
|
|
@@ -11,16 +11,24 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const PASSTHROUGH_MCP_NAME = "oc";
|
|
13
13
|
export declare const PASSTHROUGH_MCP_PREFIX = "mcp__oc__";
|
|
14
|
+
export declare function getAutoDeferThreshold(): number;
|
|
14
15
|
/**
|
|
15
16
|
* Create an MCP server with tool definitions matching OpenCode's request.
|
|
17
|
+
*
|
|
18
|
+
* Auto-defer: when the tool count exceeds the threshold and coreToolNames
|
|
19
|
+
* is provided, non-core tools are registered without alwaysLoad so the SDK
|
|
20
|
+
* defers them. Core tools are marked alwaysLoad to stay in the prompt.
|
|
21
|
+
* Client-provided defer_loading: true also triggers deferral for specific tools.
|
|
16
22
|
*/
|
|
17
23
|
export declare function createPassthroughMcpServer(tools: Array<{
|
|
18
24
|
name: string;
|
|
19
25
|
description?: string;
|
|
20
26
|
input_schema?: any;
|
|
21
|
-
|
|
27
|
+
defer_loading?: boolean;
|
|
28
|
+
}>, coreToolNames?: readonly string[]): {
|
|
22
29
|
server: import("@anthropic-ai/claude-agent-sdk").McpSdkServerConfigWithInstance;
|
|
23
30
|
toolNames: string[];
|
|
31
|
+
hasDeferredTools: boolean;
|
|
24
32
|
};
|
|
25
33
|
/**
|
|
26
34
|
* Strip the MCP prefix from a tool name to get the OpenCode tool name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passthroughTools.d.ts","sourceRoot":"","sources":["../../src/proxy/passthroughTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,eAAO,MAAM,oBAAoB,OAAO,CAAA;AACxC,eAAO,MAAM,sBAAsB,cAAmC,CAAA;
|
|
1
|
+
{"version":3,"file":"passthroughTools.d.ts","sourceRoot":"","sources":["../../src/proxy/passthroughTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,eAAO,MAAM,oBAAoB,OAAO,CAAA;AACxC,eAAO,MAAM,sBAAsB,cAAmC,CAAA;AA0CtE,wBAAgB,qBAAqB,IAAI,MAAM,CAM9C;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,GAAG,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,EACjG,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE;;;;EA4DlC;AAqBD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKvD"}
|
package/dist/proxy/query.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export interface QueryContext {
|
|
|
28
28
|
passthroughMcp?: ReturnType<typeof createPassthroughMcpServer>;
|
|
29
29
|
/** Cleaned environment variables (API keys stripped) */
|
|
30
30
|
cleanEnv: Record<string, string | undefined>;
|
|
31
|
+
/** Whether any passthrough tools use deferred loading */
|
|
32
|
+
hasDeferredTools: boolean;
|
|
31
33
|
/** SDK session ID for resume (if continuing a session) */
|
|
32
34
|
resumeSessionId?: string;
|
|
33
35
|
/** Whether this is an undo operation */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/proxy/query.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAW,MAAM,gCAAgC,CAAA;AAEtE,OAAO,EAAE,0BAA0B,EAAwB,MAAM,oBAAoB,CAAA;AAErF,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,MAAM,EAAE,MA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B,KAAK,aAAa,EAEnB,MAAM,mBAAmB,CAAA;AAG1B,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;AAyK7B,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":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA;AAuBvD,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACpB,KAAK,aAAa,EAEnB,MAAM,mBAAmB,CAAA;AAG1B,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;AAyK7B,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CA0vDhF;AAED,wBAAsB,gBAAgB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAiEhG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenHealth.d.ts","sourceRoot":"","sources":["../../src/proxy/tokenHealth.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,a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G,SAAS,GAClC,YAAY,EAAE,CA6ChB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAK1F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/proxy/tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,UAIjC,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/proxy/tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,UAIjC,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,UAmBlC,CAAA;AAED,gDAAgD;AAChD,eAAO,MAAM,eAAe,aAAa,CAAA;AAEzC,iEAAiE;AACjE,eAAO,MAAM,iBAAiB,UAO7B,CAAA"}
|
package/dist/server.js
CHANGED
|
@@ -33,6 +33,16 @@ export interface RequestMetric {
|
|
|
33
33
|
* - diverged: no overlap with stored session → fresh start
|
|
34
34
|
* - new: first request, no stored session to compare */
|
|
35
35
|
lineageType?: "continuation" | "compaction" | "undo" | "diverged" | "new";
|
|
36
|
+
/** Whether deferred tool loading was active (auto-defer or client defer_loading) */
|
|
37
|
+
hasDeferredTools?: boolean;
|
|
38
|
+
/** Number of tools deferred (not in prompt, discoverable via ToolSearch) */
|
|
39
|
+
deferredToolCount?: number;
|
|
40
|
+
/** Total number of tools in the request */
|
|
41
|
+
toolCount?: number;
|
|
42
|
+
/** Tool names discovered via ToolSearch this request (deferred tools that got called) */
|
|
43
|
+
discoveredTools?: string[];
|
|
44
|
+
/** Cumulative count of tools discovered via ToolSearch across the entire session */
|
|
45
|
+
sessionDiscoveredCount?: number;
|
|
36
46
|
/** Number of messages in the request */
|
|
37
47
|
messageCount?: number;
|
|
38
48
|
/** SDK session ID used for this request (for correlating across turns) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/telemetry/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,aAAa;IAC5B,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAA;IAEjB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAA;IAEjB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAA;IAEb,wFAAwF;IACxF,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB,iCAAiC;IACjC,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAA;IAE7B,8CAA8C;IAC9C,QAAQ,EAAE,OAAO,CAAA;IAEjB,0CAA0C;IAC1C,aAAa,EAAE,OAAO,CAAA;IAEtB;;;;;sEAKkE;IAClE,WAAW,CAAC,EAAE,cAAc,GAAG,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,CAAA;IAEzE,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAA;IAEd,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAA;IAEnB;;8CAE0C;IAC1C,eAAe,EAAE,MAAM,CAAA;IAEvB,4DAA4D;IAC5D,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAErB,yCAAyC;IACzC,kBAAkB,EAAE,MAAM,CAAA;IAE1B,6DAA6D;IAC7D,eAAe,EAAE,MAAM,CAAA;IAEvB,+CAA+C;IAC/C,aAAa,EAAE,MAAM,CAAA;IAErB,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAA;IAElB,2DAA2D;IAC3D,KA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