@rynfar/meridian 1.22.2 → 1.23.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 +1 -0
- package/dist/{cli-avsc9sr9.js → cli-jxs230js.js} +38 -33
- package/dist/cli.js +1 -1
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/server.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -302,6 +302,7 @@ See [`adapters/detect.ts`](src/proxy/adapters/detect.ts) and [`adapters/opencode
|
|
|
302
302
|
| `MERIDIAN_WORKDIR` | `CLAUDE_PROXY_WORKDIR` | `cwd()` | Default working directory for SDK |
|
|
303
303
|
| `MERIDIAN_IDLE_TIMEOUT_SECONDS` | `CLAUDE_PROXY_IDLE_TIMEOUT_SECONDS` | `120` | HTTP keep-alive timeout |
|
|
304
304
|
| `MERIDIAN_TELEMETRY_SIZE` | `CLAUDE_PROXY_TELEMETRY_SIZE` | `1000` | Telemetry ring buffer size |
|
|
305
|
+
| `MERIDIAN_NO_FILE_CHANGES` | `CLAUDE_PROXY_NO_FILE_CHANGES` | unset | Disable "Files changed" summary in responses |
|
|
305
306
|
|
|
306
307
|
## Programmatic API
|
|
307
308
|
|
|
@@ -14194,7 +14194,8 @@ function createProxyServer(config = {}) {
|
|
|
14194
14194
|
passthroughMcp = createPassthroughMcpServer(body.tools);
|
|
14195
14195
|
}
|
|
14196
14196
|
const mcpPrefix = `mcp__${adapter.getMcpServerName()}__`;
|
|
14197
|
-
const
|
|
14197
|
+
const trackFileChanges = !(process.env.MERIDIAN_NO_FILE_CHANGES ?? process.env.CLAUDE_PROXY_NO_FILE_CHANGES);
|
|
14198
|
+
const fileChangeHook = trackFileChanges ? createFileChangeHook(fileChanges, mcpPrefix) : undefined;
|
|
14198
14199
|
const sdkHooks = passthrough ? {
|
|
14199
14200
|
PreToolUse: [{
|
|
14200
14201
|
matcher: "",
|
|
@@ -14212,7 +14213,7 @@ function createProxyServer(config = {}) {
|
|
|
14212
14213
|
}]
|
|
14213
14214
|
} : {
|
|
14214
14215
|
...adapter.buildSdkHooks?.(body, sdkAgents) ?? {},
|
|
14215
|
-
PostToolUse: [fileChangeHook]
|
|
14216
|
+
...fileChangeHook ? { PostToolUse: [fileChangeHook] } : {}
|
|
14216
14217
|
};
|
|
14217
14218
|
if (!stream2) {
|
|
14218
14219
|
const contentBlocks = [];
|
|
@@ -14379,19 +14380,21 @@ function createProxyServer(config = {}) {
|
|
|
14379
14380
|
}
|
|
14380
14381
|
const hasToolUse = contentBlocks.some((b) => b.type === "tool_use");
|
|
14381
14382
|
const stopReason = hasToolUse ? "tool_use" : "end_turn";
|
|
14382
|
-
if (
|
|
14383
|
-
|
|
14384
|
-
|
|
14385
|
-
|
|
14386
|
-
|
|
14387
|
-
|
|
14388
|
-
|
|
14389
|
-
|
|
14390
|
-
|
|
14391
|
-
|
|
14392
|
-
|
|
14383
|
+
if (trackFileChanges) {
|
|
14384
|
+
if (passthrough && stopReason === "end_turn" && adapter.extractFileChangesFromToolUse) {
|
|
14385
|
+
const passthroughChanges = extractFileChangesFromMessages(body.messages || [], adapter.extractFileChangesFromToolUse.bind(adapter));
|
|
14386
|
+
fileChanges.push(...passthroughChanges);
|
|
14387
|
+
}
|
|
14388
|
+
const fileChangeSummary = formatFileChangeSummary(fileChanges);
|
|
14389
|
+
if (fileChangeSummary) {
|
|
14390
|
+
const lastTextBlock = [...contentBlocks].reverse().find((b) => b.type === "text");
|
|
14391
|
+
if (lastTextBlock) {
|
|
14392
|
+
lastTextBlock.text = lastTextBlock.text + fileChangeSummary;
|
|
14393
|
+
} else {
|
|
14394
|
+
contentBlocks.push({ type: "text", text: fileChangeSummary.trimStart() });
|
|
14395
|
+
}
|
|
14396
|
+
claudeLog("response.file_changes", { mode: "non_stream", count: fileChanges.length });
|
|
14393
14397
|
}
|
|
14394
|
-
claudeLog("response.file_changes", { mode: "non_stream", count: fileChanges.length });
|
|
14395
14398
|
}
|
|
14396
14399
|
if (contentBlocks.length === 0) {
|
|
14397
14400
|
contentBlocks.push({
|
|
@@ -14750,37 +14753,39 @@ data: ${JSON.stringify({
|
|
|
14750
14753
|
|
|
14751
14754
|
`), "passthrough_message_delta");
|
|
14752
14755
|
}
|
|
14753
|
-
if (passthrough && adapter.extractFileChangesFromToolUse) {
|
|
14756
|
+
if (trackFileChanges && passthrough && adapter.extractFileChangesFromToolUse) {
|
|
14754
14757
|
const passthroughChanges = extractFileChangesFromMessages(body.messages || [], adapter.extractFileChangesFromToolUse.bind(adapter));
|
|
14755
14758
|
fileChanges.push(...passthroughChanges);
|
|
14756
14759
|
}
|
|
14757
|
-
|
|
14758
|
-
|
|
14759
|
-
|
|
14760
|
-
|
|
14760
|
+
if (trackFileChanges) {
|
|
14761
|
+
const streamFileChangeSummary = formatFileChangeSummary(fileChanges);
|
|
14762
|
+
if (streamFileChangeSummary && messageStartEmitted) {
|
|
14763
|
+
const fcBlockIndex = nextClientBlockIndex++;
|
|
14764
|
+
safeEnqueue(encoder.encode(`event: content_block_start
|
|
14761
14765
|
data: ${JSON.stringify({
|
|
14762
|
-
|
|
14763
|
-
|
|
14764
|
-
|
|
14765
|
-
|
|
14766
|
+
type: "content_block_start",
|
|
14767
|
+
index: fcBlockIndex,
|
|
14768
|
+
content_block: { type: "text", text: "" }
|
|
14769
|
+
})}
|
|
14766
14770
|
|
|
14767
14771
|
`), "file_changes_block_start");
|
|
14768
|
-
|
|
14772
|
+
safeEnqueue(encoder.encode(`event: content_block_delta
|
|
14769
14773
|
data: ${JSON.stringify({
|
|
14770
|
-
|
|
14771
|
-
|
|
14772
|
-
|
|
14773
|
-
|
|
14774
|
+
type: "content_block_delta",
|
|
14775
|
+
index: fcBlockIndex,
|
|
14776
|
+
delta: { type: "text_delta", text: streamFileChangeSummary }
|
|
14777
|
+
})}
|
|
14774
14778
|
|
|
14775
14779
|
`), "file_changes_text_delta");
|
|
14776
|
-
|
|
14780
|
+
safeEnqueue(encoder.encode(`event: content_block_stop
|
|
14777
14781
|
data: ${JSON.stringify({
|
|
14778
|
-
|
|
14779
|
-
|
|
14780
|
-
|
|
14782
|
+
type: "content_block_stop",
|
|
14783
|
+
index: fcBlockIndex
|
|
14784
|
+
})}
|
|
14781
14785
|
|
|
14782
14786
|
`), "file_changes_block_stop");
|
|
14783
|
-
|
|
14787
|
+
claudeLog("response.file_changes", { mode: "stream", count: fileChanges.length });
|
|
14788
|
+
}
|
|
14784
14789
|
}
|
|
14785
14790
|
if (messageStartEmitted) {
|
|
14786
14791
|
safeEnqueue(encoder.encode(`event: message_stop
|
package/dist/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/proxy/server.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA;AAiBvD,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACpB,KAAK,aAAa,EACnB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAA+B,iBAAiB,EAAE,mBAAmB,EAAgB,MAAM,iBAAiB,CAAA;AAEnH,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAA;AACjD,YAAY,EAAE,aAAa,EAAE,CAAA;AAyF7B,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":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA;AAiBvD,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACpB,KAAK,aAAa,EACnB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAA+B,iBAAiB,EAAE,mBAAmB,EAAgB,MAAM,iBAAiB,CAAA;AAEnH,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAA;AACjD,YAAY,EAAE,aAAa,EAAE,CAAA;AAyF7B,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CAgrChF;AAED,wBAAsB,gBAAgB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA0ChG"}
|
package/dist/server.js
CHANGED
package/package.json
CHANGED