@rynfar/meridian 1.37.3 → 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-76s66ede.js → cli-g6ndy8jh.js} +116 -76
- package/dist/cli.js +1 -1
- package/dist/proxy/adapter.d.ts +10 -0
- package/dist/proxy/adapter.d.ts.map +1 -1
- package/dist/proxy/adapters/droid.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";
|
|
@@ -9452,6 +9534,9 @@ var droidAdapter = {
|
|
|
9452
9534
|
normalizeContent(content) {
|
|
9453
9535
|
return normalizeContent(content);
|
|
9454
9536
|
},
|
|
9537
|
+
leaksCwdViaSystemReminder() {
|
|
9538
|
+
return true;
|
|
9539
|
+
},
|
|
9455
9540
|
getBlockedBuiltinTools() {
|
|
9456
9541
|
return BLOCKED_BUILTIN_TOOLS;
|
|
9457
9542
|
},
|
|
@@ -15725,7 +15810,6 @@ function formatUsageSummary(usage) {
|
|
|
15725
15810
|
|
|
15726
15811
|
// src/proxy/sanitize.ts
|
|
15727
15812
|
var ORCHESTRATION_TAGS = [
|
|
15728
|
-
"system-reminder",
|
|
15729
15813
|
"env",
|
|
15730
15814
|
"system_information",
|
|
15731
15815
|
"current_working_directory",
|
|
@@ -15754,9 +15838,14 @@ var ALL_PATTERNS = [
|
|
|
15754
15838
|
...SELF_CLOSING_TAG_PATTERNS,
|
|
15755
15839
|
...NON_XML_PATTERNS
|
|
15756
15840
|
];
|
|
15757
|
-
|
|
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 = {}) {
|
|
15758
15846
|
let result = text;
|
|
15759
|
-
|
|
15847
|
+
const patterns = opts.stripSystemReminder ? [...ALL_PATTERNS, ...SYSTEM_REMINDER_PATTERNS] : ALL_PATTERNS;
|
|
15848
|
+
for (const pattern of patterns) {
|
|
15760
15849
|
pattern.lastIndex = 0;
|
|
15761
15850
|
result = result.replace(pattern, "");
|
|
15762
15851
|
}
|
|
@@ -15896,71 +15985,6 @@ function verifyLineage(cached, messages, cacheKey2, cache) {
|
|
|
15896
15985
|
return { type: "diverged" };
|
|
15897
15986
|
}
|
|
15898
15987
|
|
|
15899
|
-
// src/utils/lruMap.ts
|
|
15900
|
-
class LRUMap {
|
|
15901
|
-
maxSize;
|
|
15902
|
-
onEvict;
|
|
15903
|
-
map = new Map;
|
|
15904
|
-
constructor(maxSize, onEvict) {
|
|
15905
|
-
this.maxSize = maxSize;
|
|
15906
|
-
this.onEvict = onEvict;
|
|
15907
|
-
}
|
|
15908
|
-
get size() {
|
|
15909
|
-
return this.map.size;
|
|
15910
|
-
}
|
|
15911
|
-
get(key) {
|
|
15912
|
-
const value = this.map.get(key);
|
|
15913
|
-
if (value === undefined)
|
|
15914
|
-
return;
|
|
15915
|
-
this.map.delete(key);
|
|
15916
|
-
this.map.set(key, value);
|
|
15917
|
-
return value;
|
|
15918
|
-
}
|
|
15919
|
-
set(key, value) {
|
|
15920
|
-
if (this.map.has(key)) {
|
|
15921
|
-
this.map.delete(key);
|
|
15922
|
-
} else if (this.map.size >= this.maxSize) {
|
|
15923
|
-
this.evictOldest();
|
|
15924
|
-
}
|
|
15925
|
-
this.map.set(key, value);
|
|
15926
|
-
return this;
|
|
15927
|
-
}
|
|
15928
|
-
has(key) {
|
|
15929
|
-
return this.map.has(key);
|
|
15930
|
-
}
|
|
15931
|
-
delete(key) {
|
|
15932
|
-
return this.map.delete(key);
|
|
15933
|
-
}
|
|
15934
|
-
clear() {
|
|
15935
|
-
this.map.clear();
|
|
15936
|
-
}
|
|
15937
|
-
entries() {
|
|
15938
|
-
return this.map.entries();
|
|
15939
|
-
}
|
|
15940
|
-
keys() {
|
|
15941
|
-
return this.map.keys();
|
|
15942
|
-
}
|
|
15943
|
-
values() {
|
|
15944
|
-
return this.map.values();
|
|
15945
|
-
}
|
|
15946
|
-
forEach(callbackfn) {
|
|
15947
|
-
this.map.forEach((value, key) => callbackfn(value, key, this));
|
|
15948
|
-
}
|
|
15949
|
-
[Symbol.iterator]() {
|
|
15950
|
-
return this.map[Symbol.iterator]();
|
|
15951
|
-
}
|
|
15952
|
-
evictOldest() {
|
|
15953
|
-
const oldestKey = this.map.keys().next().value;
|
|
15954
|
-
if (oldestKey === undefined)
|
|
15955
|
-
return;
|
|
15956
|
-
const oldestValue = this.map.get(oldestKey);
|
|
15957
|
-
if (oldestValue === undefined)
|
|
15958
|
-
return;
|
|
15959
|
-
this.map.delete(oldestKey);
|
|
15960
|
-
this.onEvict?.(oldestKey, oldestValue);
|
|
15961
|
-
}
|
|
15962
|
-
}
|
|
15963
|
-
|
|
15964
15988
|
// src/proxy/sessionStore.ts
|
|
15965
15989
|
import {
|
|
15966
15990
|
closeSync,
|
|
@@ -16371,7 +16395,7 @@ function storeSession(sessionId, messages, claudeSessionId, workingDirectory, sd
|
|
|
16371
16395
|
// src/proxy/server.ts
|
|
16372
16396
|
var exec3 = promisify3(execCallback2);
|
|
16373
16397
|
var claudeExecutable = "";
|
|
16374
|
-
function buildFreshPrompt(messages, stripCacheControl) {
|
|
16398
|
+
function buildFreshPrompt(messages, stripCacheControl, sanitizeOpts = {}) {
|
|
16375
16399
|
const MULTIMODAL_TYPES = new Set(["image", "document", "file"]);
|
|
16376
16400
|
const hasMultimodal = messages.some((m) => Array.isArray(m.content) && m.content.some((b) => MULTIMODAL_TYPES.has(b.type)));
|
|
16377
16401
|
if (hasMultimodal) {
|
|
@@ -16417,11 +16441,11 @@ function buildFreshPrompt(messages, stripCacheControl) {
|
|
|
16417
16441
|
const role = m.role === "assistant" ? "Assistant" : "Human";
|
|
16418
16442
|
let content;
|
|
16419
16443
|
if (typeof m.content === "string") {
|
|
16420
|
-
content = sanitizeTextContent(m.content);
|
|
16444
|
+
content = sanitizeTextContent(m.content, sanitizeOpts);
|
|
16421
16445
|
} else if (Array.isArray(m.content)) {
|
|
16422
16446
|
content = m.content.map((block) => {
|
|
16423
16447
|
if (block.type === "text" && block.text)
|
|
16424
|
-
return sanitizeTextContent(block.text);
|
|
16448
|
+
return sanitizeTextContent(block.text, sanitizeOpts);
|
|
16425
16449
|
if (block.type === "tool_use")
|
|
16426
16450
|
return `[Tool Use: ${block.name}(${JSON.stringify(block.input)})]`;
|
|
16427
16451
|
if (block.type === "tool_result")
|
|
@@ -16495,6 +16519,7 @@ function createProxyServer(config = {}) {
|
|
|
16495
16519
|
restoreActiveProfile(finalConfig.profiles);
|
|
16496
16520
|
const sessionDiscoveredTools = new Map;
|
|
16497
16521
|
const sessionToolCache = new Map;
|
|
16522
|
+
const sessionMcpCache = new LRUMap(getMaxSessionsLimit());
|
|
16498
16523
|
const app = new Hono2;
|
|
16499
16524
|
app.use("*", cors());
|
|
16500
16525
|
app.use("/v1/*", requireAuth);
|
|
@@ -16666,6 +16691,9 @@ function createProxyServer(config = {}) {
|
|
|
16666
16691
|
claudeLog("debug.agents", { names: validAgentNames, count: validAgentNames.length });
|
|
16667
16692
|
}
|
|
16668
16693
|
systemContext += adapter.buildSystemContextAddendum?.(body, sdkAgents) ?? "";
|
|
16694
|
+
const sanitizeOpts = {
|
|
16695
|
+
stripSystemReminder: adapter.leaksCwdViaSystemReminder?.() ?? false
|
|
16696
|
+
};
|
|
16669
16697
|
const allMessages = body.messages || [];
|
|
16670
16698
|
let messagesToConvert;
|
|
16671
16699
|
if ((isResume || isUndo) && cachedSession) {
|
|
@@ -16739,11 +16767,11 @@ function createProxyServer(config = {}) {
|
|
|
16739
16767
|
const role = m.role === "assistant" ? "Assistant" : "Human";
|
|
16740
16768
|
let content;
|
|
16741
16769
|
if (typeof m.content === "string") {
|
|
16742
|
-
content = sanitizeTextContent(m.content);
|
|
16770
|
+
content = sanitizeTextContent(m.content, sanitizeOpts);
|
|
16743
16771
|
} else if (Array.isArray(m.content)) {
|
|
16744
16772
|
content = m.content.map((block) => {
|
|
16745
16773
|
if (block.type === "text" && block.text)
|
|
16746
|
-
return sanitizeTextContent(block.text);
|
|
16774
|
+
return sanitizeTextContent(block.text, sanitizeOpts);
|
|
16747
16775
|
if (block.type === "tool_use")
|
|
16748
16776
|
return `[Tool Use: ${block.name}(${JSON.stringify(block.input)})]`;
|
|
16749
16777
|
if (block.type === "tool_result")
|
|
@@ -16780,7 +16808,19 @@ function createProxyServer(config = {}) {
|
|
|
16780
16808
|
}
|
|
16781
16809
|
}
|
|
16782
16810
|
if (passthrough && requestTools.length > 0) {
|
|
16783
|
-
|
|
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
|
+
}
|
|
16784
16824
|
if (profileSessionId)
|
|
16785
16825
|
sessionToolCache.set(profileSessionId, requestTools);
|
|
16786
16826
|
}
|
|
@@ -16903,7 +16943,7 @@ function createProxyServer(config = {}) {
|
|
|
16903
16943
|
for (let i = 0;i < allMessages.length; i++)
|
|
16904
16944
|
sdkUuidMap.push(null);
|
|
16905
16945
|
yield* query(buildQueryOptions({
|
|
16906
|
-
prompt: buildFreshPrompt(allMessages, stripCacheControl),
|
|
16946
|
+
prompt: buildFreshPrompt(allMessages, stripCacheControl, sanitizeOpts),
|
|
16907
16947
|
model,
|
|
16908
16948
|
workingDirectory,
|
|
16909
16949
|
systemContext,
|
|
@@ -17272,7 +17312,7 @@ Subprocess stderr: ${stderrOutput}`;
|
|
|
17272
17312
|
for (let i = 0;i < allMessages.length; i++)
|
|
17273
17313
|
sdkUuidMap.push(null);
|
|
17274
17314
|
yield* query(buildQueryOptions({
|
|
17275
|
-
prompt: buildFreshPrompt(allMessages, stripCacheControl),
|
|
17315
|
+
prompt: buildFreshPrompt(allMessages, stripCacheControl, sanitizeOpts),
|
|
17276
17316
|
model,
|
|
17277
17317
|
workingDirectory,
|
|
17278
17318
|
systemContext,
|
package/dist/cli.js
CHANGED
package/dist/proxy/adapter.d.ts
CHANGED
|
@@ -125,6 +125,16 @@ export interface AgentAdapter {
|
|
|
125
125
|
* the extra block is noisy. When undefined, the proxy defaults to true.
|
|
126
126
|
*/
|
|
127
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;
|
|
128
138
|
/**
|
|
129
139
|
* Map a client-side tool_use block to file changes (passthrough mode).
|
|
130
140
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","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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"}
|
|
@@ -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