opencode-claude-max-proxy 1.0.0 → 1.0.2

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
@@ -4,7 +4,9 @@
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
5
  [![GitHub stars](https://img.shields.io/github/stars/rynfar/opencode-claude-max-proxy.svg)](https://github.com/rynfar/opencode-claude-max-proxy/stargazers)
6
6
 
7
- Use your **Claude Max subscription** with OpenCode.
7
+ Use your **Claude Max subscription** with [OpenCode](https://github.com/opencode-ai/opencode). Built to work with [Oh-My-OpenCode](https://github.com/code-yeongyu/oh-my-opencode) and its full agent orchestration system.
8
+
9
+ ![OpenCode with Claude Max](screenshot.png)
8
10
 
9
11
  ## The Problem
10
12
 
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-claude-max-proxy",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Use your Claude Max subscription with OpenCode via proxy server",
5
5
  "type": "module",
6
6
  "main": "./src/proxy/server.ts",
@@ -110,18 +110,30 @@ export function createProxyServer(config: Partial<ProxyConfig> = {}) {
110
110
  options: { maxTurns: 1, model }
111
111
  })
112
112
 
113
- for await (const message of response) {
114
- if (message.type === "assistant") {
115
- for (const block of message.message.content) {
116
- if (block.type === "text") {
117
- controller.enqueue(encoder.encode(`event: content_block_delta\ndata: ${JSON.stringify({
118
- type: "content_block_delta",
119
- index: 0,
120
- delta: { type: "text_delta", text: block.text }
121
- })}\n\n`))
113
+ const heartbeat = setInterval(() => {
114
+ try {
115
+ controller.enqueue(encoder.encode(`: ping\n\n`))
116
+ } catch {
117
+ clearInterval(heartbeat)
118
+ }
119
+ }, 15_000)
120
+
121
+ try {
122
+ for await (const message of response) {
123
+ if (message.type === "assistant") {
124
+ for (const block of message.message.content) {
125
+ if (block.type === "text") {
126
+ controller.enqueue(encoder.encode(`event: content_block_delta\ndata: ${JSON.stringify({
127
+ type: "content_block_delta",
128
+ index: 0,
129
+ delta: { type: "text_delta", text: block.text }
130
+ })}\n\n`))
131
+ }
122
132
  }
123
133
  }
124
134
  }
135
+ } finally {
136
+ clearInterval(heartbeat)
125
137
  }
126
138
 
127
139
  controller.enqueue(encoder.encode(`event: content_block_stop\ndata: ${JSON.stringify({