@rynfar/meridian 1.37.2 → 1.37.4
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-q712ymxw.js → cli-g6ndy8jh.js} +121 -78
- package/dist/cli.js +1 -1
- package/dist/proxy/adapter.d.ts +18 -0
- package/dist/proxy/adapter.d.ts.map +1 -1
- package/dist/proxy/adapters/droid.d.ts.map +1 -1
- package/dist/proxy/adapters/opencode.d.ts.map +1 -1
- package/dist/proxy/passthroughTools.d.ts +10 -0
- package/dist/proxy/passthroughTools.d.ts.map +1 -1
- package/dist/proxy/sanitize.d.ts +6 -1
- package/dist/proxy/sanitize.d.ts.map +1 -1
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/server.js +1 -1
- package/package.json +1 -1
|
@@ -7782,6 +7782,23 @@ function shouldAlwaysLoad(tool, coreSet) {
|
|
|
7782
7782
|
return coreSet.has(tool.name.toLowerCase());
|
|
7783
7783
|
return true;
|
|
7784
7784
|
}
|
|
7785
|
+
function computeToolSetKey(tools) {
|
|
7786
|
+
const entries = tools.map((t) => ({
|
|
7787
|
+
name: t.name,
|
|
7788
|
+
defer: t.defer_loading === true,
|
|
7789
|
+
schema: stableStringify(t.input_schema ?? null)
|
|
7790
|
+
})).sort((a, b) => a.name.localeCompare(b.name));
|
|
7791
|
+
return JSON.stringify(entries);
|
|
7792
|
+
}
|
|
7793
|
+
function stableStringify(value) {
|
|
7794
|
+
if (value === null || typeof value !== "object")
|
|
7795
|
+
return JSON.stringify(value);
|
|
7796
|
+
if (Array.isArray(value))
|
|
7797
|
+
return `[${value.map(stableStringify).join(",")}]`;
|
|
7798
|
+
const keys = Object.keys(value).sort();
|
|
7799
|
+
const parts = keys.map((k) => `${JSON.stringify(k)}:${stableStringify(value[k])}`);
|
|
7800
|
+
return `{${parts.join(",")}}`;
|
|
7801
|
+
}
|
|
7785
7802
|
function stripMcpPrefix(toolName) {
|
|
7786
7803
|
if (toolName.startsWith(PASSTHROUGH_MCP_PREFIX)) {
|
|
7787
7804
|
return toolName.slice(PASSTHROUGH_MCP_PREFIX.length);
|
|
@@ -7789,6 +7806,71 @@ function stripMcpPrefix(toolName) {
|
|
|
7789
7806
|
return toolName;
|
|
7790
7807
|
}
|
|
7791
7808
|
|
|
7809
|
+
// src/utils/lruMap.ts
|
|
7810
|
+
class LRUMap {
|
|
7811
|
+
maxSize;
|
|
7812
|
+
onEvict;
|
|
7813
|
+
map = new Map;
|
|
7814
|
+
constructor(maxSize, onEvict) {
|
|
7815
|
+
this.maxSize = maxSize;
|
|
7816
|
+
this.onEvict = onEvict;
|
|
7817
|
+
}
|
|
7818
|
+
get size() {
|
|
7819
|
+
return this.map.size;
|
|
7820
|
+
}
|
|
7821
|
+
get(key) {
|
|
7822
|
+
const value = this.map.get(key);
|
|
7823
|
+
if (value === undefined)
|
|
7824
|
+
return;
|
|
7825
|
+
this.map.delete(key);
|
|
7826
|
+
this.map.set(key, value);
|
|
7827
|
+
return value;
|
|
7828
|
+
}
|
|
7829
|
+
set(key, value) {
|
|
7830
|
+
if (this.map.has(key)) {
|
|
7831
|
+
this.map.delete(key);
|
|
7832
|
+
} else if (this.map.size >= this.maxSize) {
|
|
7833
|
+
this.evictOldest();
|
|
7834
|
+
}
|
|
7835
|
+
this.map.set(key, value);
|
|
7836
|
+
return this;
|
|
7837
|
+
}
|
|
7838
|
+
has(key) {
|
|
7839
|
+
return this.map.has(key);
|
|
7840
|
+
}
|
|
7841
|
+
delete(key) {
|
|
7842
|
+
return this.map.delete(key);
|
|
7843
|
+
}
|
|
7844
|
+
clear() {
|
|
7845
|
+
this.map.clear();
|
|
7846
|
+
}
|
|
7847
|
+
entries() {
|
|
7848
|
+
return this.map.entries();
|
|
7849
|
+
}
|
|
7850
|
+
keys() {
|
|
7851
|
+
return this.map.keys();
|
|
7852
|
+
}
|
|
7853
|
+
values() {
|
|
7854
|
+
return this.map.values();
|
|
7855
|
+
}
|
|
7856
|
+
forEach(callbackfn) {
|
|
7857
|
+
this.map.forEach((value, key) => callbackfn(value, key, this));
|
|
7858
|
+
}
|
|
7859
|
+
[Symbol.iterator]() {
|
|
7860
|
+
return this.map[Symbol.iterator]();
|
|
7861
|
+
}
|
|
7862
|
+
evictOldest() {
|
|
7863
|
+
const oldestKey = this.map.keys().next().value;
|
|
7864
|
+
if (oldestKey === undefined)
|
|
7865
|
+
return;
|
|
7866
|
+
const oldestValue = this.map.get(oldestKey);
|
|
7867
|
+
if (oldestValue === undefined)
|
|
7868
|
+
return;
|
|
7869
|
+
this.map.delete(oldestKey);
|
|
7870
|
+
this.onEvict?.(oldestKey, oldestValue);
|
|
7871
|
+
}
|
|
7872
|
+
}
|
|
7873
|
+
|
|
7792
7874
|
// src/telemetry/index.ts
|
|
7793
7875
|
import { join } from "node:path";
|
|
7794
7876
|
import { homedir } from "node:os";
|
|
@@ -9358,6 +9440,9 @@ var openCodeAdapter = {
|
|
|
9358
9440
|
supportsThinking() {
|
|
9359
9441
|
return true;
|
|
9360
9442
|
},
|
|
9443
|
+
shouldTrackFileChanges() {
|
|
9444
|
+
return false;
|
|
9445
|
+
},
|
|
9361
9446
|
buildSdkAgents(body, mcpToolNames) {
|
|
9362
9447
|
if (!Array.isArray(body.tools))
|
|
9363
9448
|
return {};
|
|
@@ -9449,6 +9534,9 @@ var droidAdapter = {
|
|
|
9449
9534
|
normalizeContent(content) {
|
|
9450
9535
|
return normalizeContent(content);
|
|
9451
9536
|
},
|
|
9537
|
+
leaksCwdViaSystemReminder() {
|
|
9538
|
+
return true;
|
|
9539
|
+
},
|
|
9452
9540
|
getBlockedBuiltinTools() {
|
|
9453
9541
|
return BLOCKED_BUILTIN_TOOLS;
|
|
9454
9542
|
},
|
|
@@ -15722,7 +15810,6 @@ function formatUsageSummary(usage) {
|
|
|
15722
15810
|
|
|
15723
15811
|
// src/proxy/sanitize.ts
|
|
15724
15812
|
var ORCHESTRATION_TAGS = [
|
|
15725
|
-
"system-reminder",
|
|
15726
15813
|
"env",
|
|
15727
15814
|
"system_information",
|
|
15728
15815
|
"current_working_directory",
|
|
@@ -15751,9 +15838,14 @@ var ALL_PATTERNS = [
|
|
|
15751
15838
|
...SELF_CLOSING_TAG_PATTERNS,
|
|
15752
15839
|
...NON_XML_PATTERNS
|
|
15753
15840
|
];
|
|
15754
|
-
|
|
15841
|
+
var SYSTEM_REMINDER_PATTERNS = [
|
|
15842
|
+
/<system-reminder\b[^>]*>[\s\S]*?<\/system-reminder>/gi,
|
|
15843
|
+
/<system-reminder\b[^>]*\/>/gi
|
|
15844
|
+
];
|
|
15845
|
+
function sanitizeTextContent(text, opts = {}) {
|
|
15755
15846
|
let result = text;
|
|
15756
|
-
|
|
15847
|
+
const patterns = opts.stripSystemReminder ? [...ALL_PATTERNS, ...SYSTEM_REMINDER_PATTERNS] : ALL_PATTERNS;
|
|
15848
|
+
for (const pattern of patterns) {
|
|
15757
15849
|
pattern.lastIndex = 0;
|
|
15758
15850
|
result = result.replace(pattern, "");
|
|
15759
15851
|
}
|
|
@@ -15893,71 +15985,6 @@ function verifyLineage(cached, messages, cacheKey2, cache) {
|
|
|
15893
15985
|
return { type: "diverged" };
|
|
15894
15986
|
}
|
|
15895
15987
|
|
|
15896
|
-
// src/utils/lruMap.ts
|
|
15897
|
-
class LRUMap {
|
|
15898
|
-
maxSize;
|
|
15899
|
-
onEvict;
|
|
15900
|
-
map = new Map;
|
|
15901
|
-
constructor(maxSize, onEvict) {
|
|
15902
|
-
this.maxSize = maxSize;
|
|
15903
|
-
this.onEvict = onEvict;
|
|
15904
|
-
}
|
|
15905
|
-
get size() {
|
|
15906
|
-
return this.map.size;
|
|
15907
|
-
}
|
|
15908
|
-
get(key) {
|
|
15909
|
-
const value = this.map.get(key);
|
|
15910
|
-
if (value === undefined)
|
|
15911
|
-
return;
|
|
15912
|
-
this.map.delete(key);
|
|
15913
|
-
this.map.set(key, value);
|
|
15914
|
-
return value;
|
|
15915
|
-
}
|
|
15916
|
-
set(key, value) {
|
|
15917
|
-
if (this.map.has(key)) {
|
|
15918
|
-
this.map.delete(key);
|
|
15919
|
-
} else if (this.map.size >= this.maxSize) {
|
|
15920
|
-
this.evictOldest();
|
|
15921
|
-
}
|
|
15922
|
-
this.map.set(key, value);
|
|
15923
|
-
return this;
|
|
15924
|
-
}
|
|
15925
|
-
has(key) {
|
|
15926
|
-
return this.map.has(key);
|
|
15927
|
-
}
|
|
15928
|
-
delete(key) {
|
|
15929
|
-
return this.map.delete(key);
|
|
15930
|
-
}
|
|
15931
|
-
clear() {
|
|
15932
|
-
this.map.clear();
|
|
15933
|
-
}
|
|
15934
|
-
entries() {
|
|
15935
|
-
return this.map.entries();
|
|
15936
|
-
}
|
|
15937
|
-
keys() {
|
|
15938
|
-
return this.map.keys();
|
|
15939
|
-
}
|
|
15940
|
-
values() {
|
|
15941
|
-
return this.map.values();
|
|
15942
|
-
}
|
|
15943
|
-
forEach(callbackfn) {
|
|
15944
|
-
this.map.forEach((value, key) => callbackfn(value, key, this));
|
|
15945
|
-
}
|
|
15946
|
-
[Symbol.iterator]() {
|
|
15947
|
-
return this.map[Symbol.iterator]();
|
|
15948
|
-
}
|
|
15949
|
-
evictOldest() {
|
|
15950
|
-
const oldestKey = this.map.keys().next().value;
|
|
15951
|
-
if (oldestKey === undefined)
|
|
15952
|
-
return;
|
|
15953
|
-
const oldestValue = this.map.get(oldestKey);
|
|
15954
|
-
if (oldestValue === undefined)
|
|
15955
|
-
return;
|
|
15956
|
-
this.map.delete(oldestKey);
|
|
15957
|
-
this.onEvict?.(oldestKey, oldestValue);
|
|
15958
|
-
}
|
|
15959
|
-
}
|
|
15960
|
-
|
|
15961
15988
|
// src/proxy/sessionStore.ts
|
|
15962
15989
|
import {
|
|
15963
15990
|
closeSync,
|
|
@@ -16368,7 +16395,7 @@ function storeSession(sessionId, messages, claudeSessionId, workingDirectory, sd
|
|
|
16368
16395
|
// src/proxy/server.ts
|
|
16369
16396
|
var exec3 = promisify3(execCallback2);
|
|
16370
16397
|
var claudeExecutable = "";
|
|
16371
|
-
function buildFreshPrompt(messages, stripCacheControl) {
|
|
16398
|
+
function buildFreshPrompt(messages, stripCacheControl, sanitizeOpts = {}) {
|
|
16372
16399
|
const MULTIMODAL_TYPES = new Set(["image", "document", "file"]);
|
|
16373
16400
|
const hasMultimodal = messages.some((m) => Array.isArray(m.content) && m.content.some((b) => MULTIMODAL_TYPES.has(b.type)));
|
|
16374
16401
|
if (hasMultimodal) {
|
|
@@ -16414,11 +16441,11 @@ function buildFreshPrompt(messages, stripCacheControl) {
|
|
|
16414
16441
|
const role = m.role === "assistant" ? "Assistant" : "Human";
|
|
16415
16442
|
let content;
|
|
16416
16443
|
if (typeof m.content === "string") {
|
|
16417
|
-
content = sanitizeTextContent(m.content);
|
|
16444
|
+
content = sanitizeTextContent(m.content, sanitizeOpts);
|
|
16418
16445
|
} else if (Array.isArray(m.content)) {
|
|
16419
16446
|
content = m.content.map((block) => {
|
|
16420
16447
|
if (block.type === "text" && block.text)
|
|
16421
|
-
return sanitizeTextContent(block.text);
|
|
16448
|
+
return sanitizeTextContent(block.text, sanitizeOpts);
|
|
16422
16449
|
if (block.type === "tool_use")
|
|
16423
16450
|
return `[Tool Use: ${block.name}(${JSON.stringify(block.input)})]`;
|
|
16424
16451
|
if (block.type === "tool_result")
|
|
@@ -16492,6 +16519,7 @@ function createProxyServer(config = {}) {
|
|
|
16492
16519
|
restoreActiveProfile(finalConfig.profiles);
|
|
16493
16520
|
const sessionDiscoveredTools = new Map;
|
|
16494
16521
|
const sessionToolCache = new Map;
|
|
16522
|
+
const sessionMcpCache = new LRUMap(getMaxSessionsLimit());
|
|
16495
16523
|
const app = new Hono2;
|
|
16496
16524
|
app.use("*", cors());
|
|
16497
16525
|
app.use("/v1/*", requireAuth);
|
|
@@ -16663,6 +16691,9 @@ function createProxyServer(config = {}) {
|
|
|
16663
16691
|
claudeLog("debug.agents", { names: validAgentNames, count: validAgentNames.length });
|
|
16664
16692
|
}
|
|
16665
16693
|
systemContext += adapter.buildSystemContextAddendum?.(body, sdkAgents) ?? "";
|
|
16694
|
+
const sanitizeOpts = {
|
|
16695
|
+
stripSystemReminder: adapter.leaksCwdViaSystemReminder?.() ?? false
|
|
16696
|
+
};
|
|
16666
16697
|
const allMessages = body.messages || [];
|
|
16667
16698
|
let messagesToConvert;
|
|
16668
16699
|
if ((isResume || isUndo) && cachedSession) {
|
|
@@ -16736,11 +16767,11 @@ function createProxyServer(config = {}) {
|
|
|
16736
16767
|
const role = m.role === "assistant" ? "Assistant" : "Human";
|
|
16737
16768
|
let content;
|
|
16738
16769
|
if (typeof m.content === "string") {
|
|
16739
|
-
content = sanitizeTextContent(m.content);
|
|
16770
|
+
content = sanitizeTextContent(m.content, sanitizeOpts);
|
|
16740
16771
|
} else if (Array.isArray(m.content)) {
|
|
16741
16772
|
content = m.content.map((block) => {
|
|
16742
16773
|
if (block.type === "text" && block.text)
|
|
16743
|
-
return sanitizeTextContent(block.text);
|
|
16774
|
+
return sanitizeTextContent(block.text, sanitizeOpts);
|
|
16744
16775
|
if (block.type === "tool_use")
|
|
16745
16776
|
return `[Tool Use: ${block.name}(${JSON.stringify(block.input)})]`;
|
|
16746
16777
|
if (block.type === "tool_result")
|
|
@@ -16777,7 +16808,19 @@ function createProxyServer(config = {}) {
|
|
|
16777
16808
|
}
|
|
16778
16809
|
}
|
|
16779
16810
|
if (passthrough && requestTools.length > 0) {
|
|
16780
|
-
|
|
16811
|
+
const toolSetKey = computeToolSetKey(requestTools);
|
|
16812
|
+
const cachedMcp = profileSessionId ? sessionMcpCache.get(profileSessionId) : undefined;
|
|
16813
|
+
if (cachedMcp && cachedMcp.key === toolSetKey) {
|
|
16814
|
+
passthroughMcp = cachedMcp.mcp;
|
|
16815
|
+
} else {
|
|
16816
|
+
passthroughMcp = createPassthroughMcpServer(requestTools, adapter.getCoreToolNames?.());
|
|
16817
|
+
if (profileSessionId) {
|
|
16818
|
+
sessionMcpCache.set(profileSessionId, { key: toolSetKey, mcp: passthroughMcp });
|
|
16819
|
+
if (cachedMcp) {
|
|
16820
|
+
console.error(`[PROXY] ${requestMeta.requestId} tools_changed: MCP server recreated (prompt cache likely invalidates)`);
|
|
16821
|
+
}
|
|
16822
|
+
}
|
|
16823
|
+
}
|
|
16781
16824
|
if (profileSessionId)
|
|
16782
16825
|
sessionToolCache.set(profileSessionId, requestTools);
|
|
16783
16826
|
}
|
|
@@ -16789,7 +16832,7 @@ function createProxyServer(config = {}) {
|
|
|
16789
16832
|
console.error(`[PROXY] ${requestMeta.requestId} deferred=${deferredToolCount}/${toolCount} tools (core: ${coreNames?.join(",") ?? "none"})`);
|
|
16790
16833
|
}
|
|
16791
16834
|
const mcpPrefix = `mcp__${adapter.getMcpServerName()}__`;
|
|
16792
|
-
const trackFileChanges = !(process.env.MERIDIAN_NO_FILE_CHANGES ?? process.env.CLAUDE_PROXY_NO_FILE_CHANGES);
|
|
16835
|
+
const trackFileChanges = !(process.env.MERIDIAN_NO_FILE_CHANGES ?? process.env.CLAUDE_PROXY_NO_FILE_CHANGES) && adapter.shouldTrackFileChanges?.() !== false;
|
|
16793
16836
|
const fileChangeHook = trackFileChanges ? createFileChangeHook(fileChanges, mcpPrefix) : undefined;
|
|
16794
16837
|
const discoveredTools = new Set;
|
|
16795
16838
|
const sdkHooks = passthrough ? {
|
|
@@ -16797,7 +16840,7 @@ function createProxyServer(config = {}) {
|
|
|
16797
16840
|
matcher: "",
|
|
16798
16841
|
hooks: [async (input) => {
|
|
16799
16842
|
if (input.tool_name === "ToolSearch")
|
|
16800
|
-
return;
|
|
16843
|
+
return {};
|
|
16801
16844
|
const toolName = stripMcpPrefix(input.tool_name);
|
|
16802
16845
|
if (hasDeferredTools && coreSet && !coreSet.has(toolName.toLowerCase())) {
|
|
16803
16846
|
discoveredTools.add(toolName);
|
|
@@ -16900,7 +16943,7 @@ function createProxyServer(config = {}) {
|
|
|
16900
16943
|
for (let i = 0;i < allMessages.length; i++)
|
|
16901
16944
|
sdkUuidMap.push(null);
|
|
16902
16945
|
yield* query(buildQueryOptions({
|
|
16903
|
-
prompt: buildFreshPrompt(allMessages, stripCacheControl),
|
|
16946
|
+
prompt: buildFreshPrompt(allMessages, stripCacheControl, sanitizeOpts),
|
|
16904
16947
|
model,
|
|
16905
16948
|
workingDirectory,
|
|
16906
16949
|
systemContext,
|
|
@@ -17269,7 +17312,7 @@ Subprocess stderr: ${stderrOutput}`;
|
|
|
17269
17312
|
for (let i = 0;i < allMessages.length; i++)
|
|
17270
17313
|
sdkUuidMap.push(null);
|
|
17271
17314
|
yield* query(buildQueryOptions({
|
|
17272
|
-
prompt: buildFreshPrompt(allMessages, stripCacheControl),
|
|
17315
|
+
prompt: buildFreshPrompt(allMessages, stripCacheControl, sanitizeOpts),
|
|
17273
17316
|
model,
|
|
17274
17317
|
workingDirectory,
|
|
17275
17318
|
systemContext,
|
package/dist/cli.js
CHANGED
package/dist/proxy/adapter.d.ts
CHANGED
|
@@ -117,6 +117,24 @@ export interface AgentAdapter {
|
|
|
117
117
|
* clients that may choke on the encrypted signature field).
|
|
118
118
|
*/
|
|
119
119
|
supportsThinking?(): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Whether the proxy should append synthetic file-change summaries to the
|
|
122
|
+
* agent-visible response.
|
|
123
|
+
*
|
|
124
|
+
* Return false for agents that already expose file edits natively or where
|
|
125
|
+
* the extra block is noisy. When undefined, the proxy defaults to true.
|
|
126
|
+
*/
|
|
127
|
+
shouldTrackFileChanges?(): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Whether this agent leaks CWD/env info through `<system-reminder>` blocks
|
|
130
|
+
* in user messages (Droid). When true, the proxy strips those blocks before
|
|
131
|
+
* flattening to a text prompt so they don't echo back to the model.
|
|
132
|
+
*
|
|
133
|
+
* Most agents (OpenCode, Crush, ForgeCode) use `<system-reminder>` to surface
|
|
134
|
+
* harness state the model needs to see (e.g. oh-my-opencode background task
|
|
135
|
+
* IDs), so the default is false — preserve them.
|
|
136
|
+
*/
|
|
137
|
+
leaksCwdViaSystemReminder?(): boolean;
|
|
120
138
|
/**
|
|
121
139
|
* Map a client-side tool_use block to file changes (passthrough mode).
|
|
122
140
|
*
|
|
@@ -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;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAEnE;;;;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,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,CAA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AAE,MAAM,YAAY,CAAA;AAwC9C,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"droid.d.ts","sourceRoot":"","sources":["../../../src/proxy/adapters/droid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAwC9C,eAAO,MAAM,YAAY,EAAE,YA8E1B,CAAA"}
|
|
@@ -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,YA8H7B,CAAA"}
|
|
@@ -30,6 +30,16 @@ export declare function createPassthroughMcpServer(tools: Array<{
|
|
|
30
30
|
toolNames: string[];
|
|
31
31
|
hasDeferredTools: boolean;
|
|
32
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Stable cache key for a tool set — name + input schema, sorted.
|
|
35
|
+
* Schema is included so silently-updated tool definitions force a rebuild
|
|
36
|
+
* of the cached MCP server.
|
|
37
|
+
*/
|
|
38
|
+
export declare function computeToolSetKey(tools: Array<{
|
|
39
|
+
name: string;
|
|
40
|
+
input_schema?: unknown;
|
|
41
|
+
defer_loading?: boolean;
|
|
42
|
+
}>): string;
|
|
33
43
|
/**
|
|
34
44
|
* Strip the MCP prefix from a tool name to get the OpenCode tool name.
|
|
35
45
|
* e.g., "mcp__oc__todowrite" → "todowrite"
|
|
@@ -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;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"}
|
|
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;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,GAC9E,MAAM,CASR;AAUD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKvD"}
|
package/dist/proxy/sanitize.d.ts
CHANGED
|
@@ -16,11 +16,16 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Fixes: https://github.com/rynfar/meridian/issues/167
|
|
18
18
|
*/
|
|
19
|
+
export interface SanitizeOptions {
|
|
20
|
+
/** Strip `<system-reminder>` blocks. Enable for adapters (Droid) that leak
|
|
21
|
+
* CWD/env through this tag. */
|
|
22
|
+
stripSystemReminder?: boolean;
|
|
23
|
+
}
|
|
19
24
|
/**
|
|
20
25
|
* Strip orchestration wrappers from a single text string.
|
|
21
26
|
*
|
|
22
27
|
* Designed to be called on individual content blocks (not concatenated
|
|
23
28
|
* prompt strings) to eliminate cross-block regex matching risk.
|
|
24
29
|
*/
|
|
25
|
-
export declare function sanitizeTextContent(text: string): string;
|
|
30
|
+
export declare function sanitizeTextContent(text: string, opts?: SanitizeOptions): string;
|
|
26
31
|
//# sourceMappingURL=sanitize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/proxy/sanitize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/proxy/sanitize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAwEH,MAAM,WAAW,eAAe;IAC9B;oCACgC;IAChC,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,eAAoB,GAAG,MAAM,CAapF"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AA0BvD,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;AAmJ7B,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CA65DhF;AAED,wBAAsB,gBAAgB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAiEhG"}
|
package/dist/server.js
CHANGED
package/package.json
CHANGED