@ex-machina/opencode-anthropic-auth 1.7.0 → 1.7.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 +2 -2
- package/dist/auth.js +2 -2
- package/dist/cch.js +1 -1
- package/dist/index.js +3 -3
- package/dist/transform.js +2 -2
- package/package.json +11 -5
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
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.
|
|
4
4
|
|
|
5
5
|
> [!IMPORTANT]
|
|
6
|
-
> If you are seeing issues, please try to `rm -rf ~/.
|
|
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.
|
|
7
7
|
>
|
|
8
8
|
> Try this FIRST before making an Issue. Thanks!
|
|
9
9
|
|
|
@@ -26,7 +26,7 @@ Add the plugin to your OpenCode configuration:
|
|
|
26
26
|
|
|
27
27
|
```json
|
|
28
28
|
{
|
|
29
|
-
"plugin": ["@ex-machina/opencode-anthropic-auth@1.
|
|
29
|
+
"plugin": ["@ex-machina/opencode-anthropic-auth@1.7.1"]
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
package/dist/auth.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AUTHORIZE_URLS, CLIENT_ID, CODE_CALLBACK_URL, OAUTH_SCOPES, TOKEN_URL, } from
|
|
2
|
-
import { generatePKCE } from
|
|
1
|
+
import { AUTHORIZE_URLS, CLIENT_ID, CODE_CALLBACK_URL, OAUTH_SCOPES, TOKEN_URL, } from "./constants.js";
|
|
2
|
+
import { generatePKCE } from "./pkce.js";
|
|
3
3
|
function generateState() {
|
|
4
4
|
return crypto.randomUUID().replace(/-/g, '');
|
|
5
5
|
}
|
package/dist/cch.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
|
-
import { CCH_POSITIONS, CCH_SALT, CLAUDE_CODE_VERSION } from
|
|
2
|
+
import { CCH_POSITIONS, CCH_SALT, CLAUDE_CODE_VERSION } from "./constants.js";
|
|
3
3
|
/**
|
|
4
4
|
* Extract text from the first user message's first text block.
|
|
5
5
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { authorize, exchange } from
|
|
2
|
-
import { CLIENT_ID, TOKEN_URL } from
|
|
3
|
-
import { createStrippedStream, isInsecure, mergeHeaders, rewriteRequestBody, rewriteUrl, setOAuthHeaders, } from
|
|
1
|
+
import { authorize, exchange } from "./auth.js";
|
|
2
|
+
import { CLIENT_ID, TOKEN_URL } from "./constants.js";
|
|
3
|
+
import { createStrippedStream, isInsecure, mergeHeaders, rewriteRequestBody, rewriteUrl, setOAuthHeaders, } from "./transform.js";
|
|
4
4
|
export const AnthropicAuthPlugin = async ({ client }) => {
|
|
5
5
|
return {
|
|
6
6
|
auth: {
|
package/dist/transform.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { buildBillingHeaderValue } from
|
|
2
|
-
import { CLAUDE_CODE_ENTRYPOINT, CLAUDE_CODE_IDENTITY, OPENCODE_IDENTITY_PREFIX, PARAGRAPH_REMOVAL_ANCHORS, REQUIRED_BETAS, TEXT_REPLACEMENTS, TOOL_PREFIX, USER_AGENT, } from
|
|
1
|
+
import { buildBillingHeaderValue } from "./cch.js";
|
|
2
|
+
import { CLAUDE_CODE_ENTRYPOINT, CLAUDE_CODE_IDENTITY, OPENCODE_IDENTITY_PREFIX, PARAGRAPH_REMOVAL_ANCHORS, REQUIRED_BETAS, TEXT_REPLACEMENTS, TOOL_PREFIX, USER_AGENT, } from "./constants.js";
|
|
3
3
|
/**
|
|
4
4
|
* Prefix a tool name with TOOL_PREFIX and uppercase the first character.
|
|
5
5
|
* Claude Code uses PascalCase tool names (e.g. mcp_Bash, mcp_Read);
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ex-machina/opencode-anthropic-auth",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/ex-machina-co/opencode-anthropic-auth"
|
|
7
7
|
},
|
|
8
8
|
"main": "./dist/index.js",
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
|
+
"engines": {
|
|
11
|
+
"bun": "1.3.12"
|
|
12
|
+
},
|
|
10
13
|
"files": [
|
|
11
14
|
"dist"
|
|
12
15
|
],
|
|
@@ -24,15 +27,18 @@
|
|
|
24
27
|
"change": "changeset",
|
|
25
28
|
"release": "bun run build && bun change publish"
|
|
26
29
|
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@opencode-ai/plugin": "*"
|
|
32
|
+
},
|
|
27
33
|
"devDependencies": {
|
|
28
|
-
"@biomejs/biome": "2.4.
|
|
34
|
+
"@biomejs/biome": "2.4.12",
|
|
29
35
|
"@changesets/changelog-github": "^0.6.0",
|
|
30
36
|
"@changesets/cli": "^2.30.0",
|
|
31
|
-
"@opencode-ai/plugin": "1.4.
|
|
37
|
+
"@opencode-ai/plugin": "1.4.7",
|
|
32
38
|
"@tsconfig/bun": "1.0.10",
|
|
33
|
-
"@types/bun": "1.3.
|
|
39
|
+
"@types/bun": "1.3.12",
|
|
34
40
|
"dedent": "^1.7.2",
|
|
35
|
-
"lefthook": "2.1.
|
|
41
|
+
"lefthook": "2.1.6",
|
|
36
42
|
"typescript": "6.0.2"
|
|
37
43
|
}
|
|
38
44
|
}
|