@ex-machina/opencode-anthropic-auth 1.8.0 → 1.8.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
@@ -1,12 +1,17 @@
1
1
  # OpenCode Anthropic Auth Plugin
2
2
 
3
- An [OpenCode](https://github.com/anomalyco/opencode) plugin that provides Anthropic OAuth authentication, enabling Claude Pro/Max users to use their subscription directly with OpenCode.
3
+ > [!WARNING]
4
+ > This plugin comes with no guarantees. You might be banned for breaking the TOS, you might not be. I don't work at Anthropic, nor am I an attorney.
5
+ >
6
+ > Use your best judgment and don't try to abuse the subscriptions. Plugins like oh-my-openagent are _known_ to trigger bans. Please be careful when using Ralph loops or insanely heavy usage patterns.
4
7
 
5
8
  > [!IMPORTANT]
6
- > If you are seeing issues, please try to `rm -rf ~/.cache/opencode` and check your `opencode.json` config to make sure you're on the latest version.
9
+ > If you are seeing issues, please try to `rm -rf ~/.cache/opencode/packages/@ex-machina` and check your `opencode.json` config to make sure you're on the latest version.
7
10
  >
8
11
  > Try this FIRST before making an Issue. Thanks!
9
12
 
13
+ An [OpenCode](https://github.com/anomalyco/opencode) plugin that provides Anthropic OAuth authentication, enabling Claude Pro/Max users to use their subscription directly with OpenCode.
14
+
10
15
  ## Usage
11
16
 
12
17
  Add the plugin to your OpenCode configuration:
@@ -26,7 +31,7 @@ Add the plugin to your OpenCode configuration:
26
31
 
27
32
  ```json
28
33
  {
29
- "plugin": ["@ex-machina/opencode-anthropic-auth@1.7.5"]
34
+ "plugin": ["@ex-machina/opencode-anthropic-auth@1.8.1"]
30
35
  }
31
36
  ```
32
37
 
@@ -35,6 +40,7 @@ Add the plugin to your OpenCode configuration:
35
40
  The plugin provides three authentication options:
36
41
 
37
42
  - **Claude Pro/Max** - OAuth flow via `claude.ai` for Pro/Max subscribers. Uses your existing subscription at no additional API cost.
43
+ - run the `/connect` command, select `Anthropic (API key)` -> `Claude Pro/Max` and do OAuth
38
44
  - **Create an API Key** - OAuth flow via `console.anthropic.com` that creates an API key on your behalf.
39
45
  - **Manually enter API Key** - Standard API key entry for users who already have one.
40
46
 
@@ -12,9 +12,19 @@ export declare const OPENCODE_IDENTITY_PREFIX = "You are OpenCode";
12
12
  export declare const CLAUDE_CODE_IDENTITY = "You are a Claude agent, built on Anthropic's Claude Agent SDK.";
13
13
  export declare const CCH_SALT = "59cf53e54c78";
14
14
  export declare const CCH_POSITIONS: number[];
15
- export declare const CLAUDE_CODE_VERSION = "2.1.87";
15
+ /**
16
+ * The Claude Code version we report to Anthropic, via both the `user-agent`
17
+ * header and the `cc_version` field of the billing header.
18
+ *
19
+ * Anthropic gates new models on this value server-side: requesting a model
20
+ * newer than the reported client returns a 400 `claude_code_version_too_old`
21
+ * (e.g. "Claude Code 2.1.87 does not support this model; version 2.1.251 or
22
+ * newer is required"). Keep this at or above the latest published
23
+ * `@anthropic-ai/claude-code` release, otherwise new models are unreachable.
24
+ */
25
+ export declare const CLAUDE_CODE_VERSION = "2.1.258";
16
26
  export declare const CLAUDE_CODE_ENTRYPOINT = "sdk-cli";
17
- export declare const USER_AGENT = "claude-cli/2.1.87 (external, cli)";
27
+ export declare const USER_AGENT = "claude-cli/2.1.258 (external, cli)";
18
28
  /**
19
29
  * Anchors that identify paragraphs to remove from the system prompt.
20
30
  * Any paragraph (text between blank lines) containing one of these
package/dist/constants.js CHANGED
@@ -22,9 +22,19 @@ export const OPENCODE_IDENTITY_PREFIX = 'You are OpenCode';
22
22
  export const CLAUDE_CODE_IDENTITY = "You are a Claude agent, built on Anthropic's Claude Agent SDK.";
23
23
  export const CCH_SALT = '59cf53e54c78';
24
24
  export const CCH_POSITIONS = [4, 7, 20];
25
- export const CLAUDE_CODE_VERSION = '2.1.87';
25
+ /**
26
+ * The Claude Code version we report to Anthropic, via both the `user-agent`
27
+ * header and the `cc_version` field of the billing header.
28
+ *
29
+ * Anthropic gates new models on this value server-side: requesting a model
30
+ * newer than the reported client returns a 400 `claude_code_version_too_old`
31
+ * (e.g. "Claude Code 2.1.87 does not support this model; version 2.1.251 or
32
+ * newer is required"). Keep this at or above the latest published
33
+ * `@anthropic-ai/claude-code` release, otherwise new models are unreachable.
34
+ */
35
+ export const CLAUDE_CODE_VERSION = '2.1.258';
26
36
  export const CLAUDE_CODE_ENTRYPOINT = 'sdk-cli';
27
- export const USER_AGENT = 'claude-cli/2.1.87 (external, cli)';
37
+ export const USER_AGENT = `claude-cli/${CLAUDE_CODE_VERSION} (external, cli)`;
28
38
  /**
29
39
  * Anchors that identify paragraphs to remove from the system prompt.
30
40
  * Any paragraph (text between blank lines) containing one of these
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ex-machina/opencode-anthropic-auth",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/ex-machina-co/opencode-anthropic-auth"
@@ -8,7 +8,7 @@
8
8
  "main": "./dist/index.js",
9
9
  "types": "./dist/index.d.ts",
10
10
  "engines": {
11
- "bun": "1.3.13"
11
+ "bun": "1.3.14"
12
12
  },
13
13
  "files": [
14
14
  "dist"
@@ -31,14 +31,14 @@
31
31
  "@opencode-ai/plugin": "*"
32
32
  },
33
33
  "devDependencies": {
34
- "@biomejs/biome": "2.4.13",
35
- "@changesets/changelog-github": "^0.6.0",
34
+ "@biomejs/biome": "2.5.2",
35
+ "@changesets/changelog-github": "^0.7.0",
36
36
  "@changesets/cli": "^2.31.0",
37
- "@opencode-ai/plugin": "1.14.28",
37
+ "@opencode-ai/plugin": "1.17.13",
38
38
  "@tsconfig/bun": "1.0.10",
39
- "@types/bun": "1.3.13",
39
+ "@types/bun": "1.3.14",
40
40
  "dedent": "^1.7.2",
41
- "lefthook": "2.1.6",
41
+ "lefthook": "2.1.9",
42
42
  "typescript": "6.0.3"
43
43
  }
44
44
  }