@rynfar/meridian 1.22.1 → 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 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
 
@@ -13366,7 +13366,7 @@ function buildQueryOptions(ctx) {
13366
13366
  return {
13367
13367
  prompt,
13368
13368
  options: {
13369
- maxTurns: passthrough ? 1 : 200,
13369
+ maxTurns: passthrough ? 2 : 200,
13370
13370
  cwd: workingDirectory,
13371
13371
  model,
13372
13372
  pathToClaudeCodeExecutable: claudeExecutable,
@@ -14194,7 +14194,8 @@ function createProxyServer(config = {}) {
14194
14194
  passthroughMcp = createPassthroughMcpServer(body.tools);
14195
14195
  }
14196
14196
  const mcpPrefix = `mcp__${adapter.getMcpServerName()}__`;
14197
- const fileChangeHook = createFileChangeHook(fileChanges, mcpPrefix);
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 (passthrough && stopReason === "end_turn" && adapter.extractFileChangesFromToolUse) {
14383
- const passthroughChanges = extractFileChangesFromMessages(body.messages || [], adapter.extractFileChangesFromToolUse.bind(adapter));
14384
- fileChanges.push(...passthroughChanges);
14385
- }
14386
- const fileChangeSummary = formatFileChangeSummary(fileChanges);
14387
- if (fileChangeSummary) {
14388
- const lastTextBlock = [...contentBlocks].reverse().find((b) => b.type === "text");
14389
- if (lastTextBlock) {
14390
- lastTextBlock.text = lastTextBlock.text + fileChangeSummary;
14391
- } else {
14392
- contentBlocks.push({ type: "text", text: fileChangeSummary.trimStart() });
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({
@@ -14680,6 +14683,15 @@ data: ${JSON.stringify(event)}
14680
14683
  break;
14681
14684
  }
14682
14685
  eventsForwarded += 1;
14686
+ if (passthrough && eventType === "message_delta" && event.delta?.stop_reason === "tool_use" && streamedToolUseIds.size > 0) {
14687
+ safeEnqueue(encoder.encode(`event: message_stop
14688
+ data: ${JSON.stringify({ type: "message_stop" })}
14689
+
14690
+ `), "passthrough_tool_stream_stop");
14691
+ streamClosed = true;
14692
+ controller.close();
14693
+ break;
14694
+ }
14683
14695
  if (eventType === "content_block_delta") {
14684
14696
  const delta = event.delta;
14685
14697
  if (delta?.type === "text_delta") {
@@ -14741,37 +14753,39 @@ data: ${JSON.stringify({
14741
14753
 
14742
14754
  `), "passthrough_message_delta");
14743
14755
  }
14744
- if (passthrough && adapter.extractFileChangesFromToolUse) {
14756
+ if (trackFileChanges && passthrough && adapter.extractFileChangesFromToolUse) {
14745
14757
  const passthroughChanges = extractFileChangesFromMessages(body.messages || [], adapter.extractFileChangesFromToolUse.bind(adapter));
14746
14758
  fileChanges.push(...passthroughChanges);
14747
14759
  }
14748
- const streamFileChangeSummary = formatFileChangeSummary(fileChanges);
14749
- if (streamFileChangeSummary && messageStartEmitted) {
14750
- const fcBlockIndex = nextClientBlockIndex++;
14751
- safeEnqueue(encoder.encode(`event: content_block_start
14760
+ if (trackFileChanges) {
14761
+ const streamFileChangeSummary = formatFileChangeSummary(fileChanges);
14762
+ if (streamFileChangeSummary && messageStartEmitted) {
14763
+ const fcBlockIndex = nextClientBlockIndex++;
14764
+ safeEnqueue(encoder.encode(`event: content_block_start
14752
14765
  data: ${JSON.stringify({
14753
- type: "content_block_start",
14754
- index: fcBlockIndex,
14755
- content_block: { type: "text", text: "" }
14756
- })}
14766
+ type: "content_block_start",
14767
+ index: fcBlockIndex,
14768
+ content_block: { type: "text", text: "" }
14769
+ })}
14757
14770
 
14758
14771
  `), "file_changes_block_start");
14759
- safeEnqueue(encoder.encode(`event: content_block_delta
14772
+ safeEnqueue(encoder.encode(`event: content_block_delta
14760
14773
  data: ${JSON.stringify({
14761
- type: "content_block_delta",
14762
- index: fcBlockIndex,
14763
- delta: { type: "text_delta", text: streamFileChangeSummary }
14764
- })}
14774
+ type: "content_block_delta",
14775
+ index: fcBlockIndex,
14776
+ delta: { type: "text_delta", text: streamFileChangeSummary }
14777
+ })}
14765
14778
 
14766
14779
  `), "file_changes_text_delta");
14767
- safeEnqueue(encoder.encode(`event: content_block_stop
14780
+ safeEnqueue(encoder.encode(`event: content_block_stop
14768
14781
  data: ${JSON.stringify({
14769
- type: "content_block_stop",
14770
- index: fcBlockIndex
14771
- })}
14782
+ type: "content_block_stop",
14783
+ index: fcBlockIndex
14784
+ })}
14772
14785
 
14773
14786
  `), "file_changes_block_stop");
14774
- claudeLog("response.file_changes", { mode: "stream", count: fileChanges.length });
14787
+ claudeLog("response.file_changes", { mode: "stream", count: fileChanges.length });
14788
+ }
14775
14789
  }
14776
14790
  if (messageStartEmitted) {
14777
14791
  safeEnqueue(encoder.encode(`event: message_stop
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  __require,
4
4
  startProxyServer
5
- } from "./cli-n9mgaja3.js";
5
+ } from "./cli-jxs230js.js";
6
6
 
7
7
  // bin/cli.ts
8
8
  import { createRequire } from "module";
@@ -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;AAE7C,OAAO,EAAE,0BAA0B,EAAwB,MAAM,oBAAoB,CAAA;AAErF,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;IACnC,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,+BAA+B;IAC/B,gB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kB,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,CAupChF;AAED,wBAAsB,gBAAgB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA0ChG"}
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
@@ -6,7 +6,7 @@ import {
6
6
  getMaxSessionsLimit,
7
7
  hashMessage,
8
8
  startProxyServer
9
- } from "./cli-n9mgaja3.js";
9
+ } from "./cli-jxs230js.js";
10
10
  export {
11
11
  startProxyServer,
12
12
  hashMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rynfar/meridian",
3
- "version": "1.22.1",
3
+ "version": "1.23.0",
4
4
  "description": "Local Anthropic API powered by your Claude Max subscription. One subscription, every agent.",
5
5
  "type": "module",
6
6
  "main": "./dist/server.js",