opencode-claude-max-proxy 1.12.0 → 1.12.1

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
@@ -15,30 +15,22 @@ We avoid that limitation by forwarding tool calls instead of executing them. Whe
15
15
  From Claude’s perspective, tool usage proceeds normally. From OpenCode’s perspective, it is interacting with the Anthropic API. Execution remains distributed according to the configured agents, allowing different models to handle different roles without being constrained by the SDK.
16
16
 
17
17
  ```
18
- ┌──────────┐ ┌───────────────┐ ┌──────────────┐
19
- │ │ │ │ │
20
- OpenCode │ ─────────────► │ Proxy │ ───────────► │ Claude Max │
21
- │ │ (localhost) │ │ (Agent SDK) │
22
- │ │ │ │ │ │
23
- │ │ │ │ ◄─────────── │ tool_use │
24
- │ │ ◄──────────── │ │ │
25
- │ │ │ Intercept │ └──────────────┘
26
- │ │ │ (stop turn) │
27
- │ │ │ │
28
- │ │ ▼
29
- │ │ │ ┌──────────────┐
30
- │ │ │ │ OpenCode │
31
- │ │ │ agent │
32
- │ │ │ │ system │
33
- │ │ │ └──────────────┘
34
- │ │ │ │
35
- │ │ │ ▼
36
- │ │ │ ◄────────────
37
- │ │ │ Resume turn
38
- │ │ │
39
- │ │ ◄───────────── │
40
- │ │ response │
41
- └──────────┘ └───────────────┘
18
+ OpenCode ──► Proxy (localhost) ──► Claude Max (Agent SDK)
19
+
20
+ tool_use response
21
+
22
+ Proxy intercepts ◄─────────┘
23
+ (stop turn)
24
+
25
+
26
+ OpenCode agent system
27
+ (routes to GPT-5.4, Gemini, etc.)
28
+
29
+
30
+ Proxy resumes SDK ──► Claude continues
31
+
32
+
33
+ OpenCode ◄── final response
42
34
  ```
43
35
 
44
36
  ## How Passthrough Works
@@ -54,6 +46,14 @@ The Claude Agent SDK exposes a `PreToolUse` hook that fires before any tool exec
54
46
 
55
47
  ## Quick Start
56
48
 
49
+ ### One-Liner Install
50
+
51
+ ```bash
52
+ curl -fsSL https://raw.githubusercontent.com/ianjwhite99/opencode-with-claude/main/install.sh | bash
53
+ ```
54
+
55
+ Installs everything (Claude CLI, OpenCode, proxy) and gives you an `oc` command. See [opencode-with-claude](https://github.com/ianjwhite99/opencode-with-claude) for details.
56
+
57
57
  ### Prerequisites
58
58
 
59
59
  1. **Claude Max subscription** — [Subscribe here](https://claude.ai/settings/billing)
@@ -361,3 +361,5 @@ MIT
361
361
  ## Credits
362
362
 
363
363
  Built with the [Claude Agent SDK](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk) by Anthropic.
364
+
365
+ [opencode-with-claude](https://github.com/ianjwhite99/opencode-with-claude) installer by [@ianjwhite99](https://github.com/ianjwhite99). Multimodal support based on work by [@juanferreiramorel](https://github.com/juanferreiramorel). Per-terminal proxy idea by [@calebdw](https://github.com/calebdw). README cleanup by [@skipships](https://github.com/skipships).
@@ -12799,6 +12799,7 @@ ${conversationParts}` : conversationParts;
12799
12799
  }
12800
12800
  }, 15000);
12801
12801
  const skipBlockIndices = new Set;
12802
+ const streamedToolUseIds = new Set;
12802
12803
  let messageStartEmitted = false;
12803
12804
  try {
12804
12805
  for await (const message of response) {
@@ -12836,6 +12837,8 @@ ${conversationParts}` : conversationParts;
12836
12837
  if (block?.type === "tool_use" && typeof block.name === "string") {
12837
12838
  if (passthrough && block.name.startsWith(PASSTHROUGH_MCP_PREFIX)) {
12838
12839
  block.name = stripMcpPrefix(block.name);
12840
+ if (block.id)
12841
+ streamedToolUseIds.add(block.id);
12839
12842
  } else if (block.name.startsWith("mcp__")) {
12840
12843
  if (eventIndex !== undefined)
12841
12844
  skipBlockIndices.add(eventIndex);
@@ -12883,9 +12886,10 @@ data: ${JSON.stringify(event)}
12883
12886
  storeSession(opencodeSessionId, body.messages || [], currentSessionId);
12884
12887
  }
12885
12888
  if (!streamClosed) {
12886
- if (passthrough && capturedToolUses.length > 0 && messageStartEmitted) {
12887
- for (let i = 0;i < capturedToolUses.length; i++) {
12888
- const tu = capturedToolUses[i];
12889
+ const unseenToolUses = capturedToolUses.filter((tu) => !streamedToolUseIds.has(tu.id));
12890
+ if (passthrough && unseenToolUses.length > 0 && messageStartEmitted) {
12891
+ for (let i = 0;i < unseenToolUses.length; i++) {
12892
+ const tu = unseenToolUses[i];
12889
12893
  const blockIndex = eventsForwarded + i;
12890
12894
  safeEnqueue(encoder.encode(`event: content_block_start
12891
12895
  data: ${JSON.stringify({
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  startProxyServer
4
- } from "./cli-x0mnz7nm.js";
4
+ } from "./cli-s4sk7eks.js";
5
5
 
6
6
  // bin/cli.ts
7
7
  import { execSync } from "child_process";
package/dist/server.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  clearSessionCache,
3
3
  createProxyServer,
4
4
  startProxyServer
5
- } from "./cli-x0mnz7nm.js";
5
+ } from "./cli-s4sk7eks.js";
6
6
  export {
7
7
  startProxyServer,
8
8
  createProxyServer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-claude-max-proxy",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "Use your Claude Max subscription with OpenCode via proxy server",
5
5
  "type": "module",
6
6
  "main": "./dist/server.js",