opencode-with-claude 1.1.7 → 1.1.9

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
@@ -28,14 +28,20 @@ An [OpenCode](https://opencode.ai) plugin that runs [opencode-claude-max-proxy](
28
28
 
29
29
  The plugin hooks into OpenCode's plugin system. When OpenCode launches, it starts the proxy, configures the Anthropic provider, and cleans everything up on exit.
30
30
 
31
- **1. Authenticate with Claude (one-time)**
31
+ **1. Install the plugin**
32
+
33
+ ```bash
34
+ npm install -g opencode-with-claude
35
+ ```
36
+
37
+ **2. Authenticate with Claude (one-time)**
32
38
 
33
39
  ```bash
34
40
  npm install -g @anthropic-ai/claude-code
35
41
  claude login
36
42
  ```
37
43
 
38
- **2. Add to your `opencode.json`**
44
+ **3. Add to your `opencode.json`**
39
45
 
40
46
  Global (`~/.config/opencode/opencode.json`) or project-level:
41
47
 
package/dist/index.d.ts CHANGED
@@ -1,15 +1,5 @@
1
1
  import { Plugin } from '@opencode-ai/plugin';
2
2
 
3
- /**
4
- * OpenCode plugin that manages the Claude Max proxy lifecycle.
5
- *
6
- * On init:
7
- * 1. Verifies the Claude CLI is installed and authenticated
8
- * 2. Starts the proxy (port 3456, or falls back to a random port if in use)
9
- * 3. Registers cleanup handlers to stop the proxy on exit
10
- * 4. Returns a `config` hook that injects the proxy's baseURL into
11
- * the Anthropic provider so each opencode instance gets its own proxy.
12
- */
13
3
  declare const ClaudeMaxPlugin: Plugin;
14
4
 
15
5
  export { ClaudeMaxPlugin };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function l(n){return(t,o)=>n.app.log({body:{service:"opencode-with-claude",level:t,message:o}})}import{startProxyServer as d}from"opencode-claude-max-proxy";var y=process.platform==="win32",f=3456;async function u(n){let{port:t=f,log:o}=n,e=console.error;console.error=(...r)=>{let a=r.map(String).join(" ");if(a.startsWith("[PROXY]")){o("debug",a);return}e.apply(console,r)};let c=async r=>{try{return await d({port:r,host:"127.0.0.1",silent:!0})}catch(a){if(r!==0&&a instanceof Error&&"code"in a&&a.code==="EADDRINUSE")return await o("info",`Port ${r} in use, starting on a random port instead...`),d({port:0,host:"127.0.0.1",silent:!0});throw a}},i;try{i=await c(t)}catch(r){throw console.error=e,r}let s=i.server.address().port;return await o("info",`Claude Max proxy running on port ${s}`),{port:s,close:async()=>{console.error=e,await i.close()}}}function g(n){let t=!1,o=()=>{t||(t=!0,n.close())};process.on("exit",o),process.on("SIGINT",o),y||process.on("SIGTERM",o)}var v=async({client:n,$:t,directory:o})=>{let e=l(n);try{await t`claude --version`}catch{throw new Error("Claude Code CLI not found. Install it with: npm install -g @anthropic-ai/claude-code")}let c;try{c=await t`claude auth status`.text()}catch{throw new Error("Failed to check Claude auth status. Run: claude login")}if(!c.includes('"loggedIn": true'))throw new Error("Claude not authenticated. Run: claude login");await e("info","Claude authentication verified");let i=parseInt(process.env.CLAUDE_PROXY_PORT||"",10)||void 0;await e("info","Starting Claude Max proxy...");let p=await u({port:i,log:e}),s=`http://127.0.0.1:${p.port}`;return await e("info",`Claude Max proxy ready at ${s}`),g(p),{async config(r){r.provider??={},r.provider.anthropic??={},r.provider.anthropic.options??={},r.provider.anthropic.options.baseURL=s,r.provider.anthropic.options.apiKey="claude-max-proxy"}}};export{v as ClaudeMaxPlugin};
1
+ function l(t){return(n,r)=>t.app.log({body:{service:"opencode-with-claude",level:n,message:r}})}import{startProxyServer as d}from"opencode-claude-max-proxy";var y=process.platform==="win32",f=3456;async function u(t){let{port:n=f,log:r}=t,a=console.error;console.error=(...e)=>{let s=e.map(String).join(" ");if(s.startsWith("[PROXY]")){r("debug",s);return}a.apply(console,e)};let p=async e=>{try{return await d({port:e,host:"127.0.0.1",silent:!0})}catch(s){if(e!==0&&s instanceof Error&&"code"in s&&s.code==="EADDRINUSE")return await r("info",`Port ${e} in use, starting on a random port instead...`),d({port:0,host:"127.0.0.1",silent:!0});throw s}},i;try{i=await p(n)}catch(e){throw console.error=a,e}let o=i.server.address().port;return await r("info",`Claude Max proxy running on port ${o}`),{port:o,close:async()=>{console.error=a,await i.close()}}}function g(t){let n=!1,r=()=>{n||(n=!0,t.close())};process.on("exit",r),process.on("SIGINT",r),y||process.on("SIGTERM",r)}var L=async({client:t,$:n,directory:r})=>{let a=l(t),p=parseInt(process.env.CLAUDE_PROXY_PORT||"",10)||void 0,i=await u({port:p,log:a}),c=`http://127.0.0.1:${i.port}`;return await a("info",`proxy ready at ${c}`),g(i),{async config(o){o.provider??={},o.provider.anthropic??={},o.provider.anthropic.options??={},o.provider.anthropic.options.baseURL=c,o.provider.anthropic.options.apiKey="claude-max-proxy"}}};export{L as ClaudeMaxPlugin};
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "opencode-with-claude",
3
3
  "description": "OpenCode plugin to use your Claude Max subscription via local proxy",
4
- "version": "1.1.7",
4
+ "version": "1.1.9",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "dependencies": {
9
- "opencode-claude-max-proxy": "^1.17.0"
9
+ "opencode-claude-max-proxy": "^1.18.0"
10
10
  },
11
11
  "devDependencies": {
12
- "@opencode-ai/plugin": "^1.3.0",
12
+ "@opencode-ai/plugin": "^1.3.2",
13
13
  "@types/node": "^25.5.0",
14
- "tsup": "^8.4.0",
14
+ "tsup": "^8.5.1",
15
15
  "typescript": "^6.0.2"
16
16
  },
17
17
  "scripts": {