@moxxy/plugin-provider-claude-code 0.28.1 → 0.29.0
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/package.json +4 -4
- package/src/login.test.ts +6 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moxxy/plugin-provider-claude-code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "Claude subscription (Pro/Max) LLMProvider plugin for moxxy. Talks to the standard Anthropic Messages API using a Claude Code OAuth token from `claude setup-token` or an in-app sign-in.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"moxxy",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@moxxy/sdk": "0.
|
|
49
|
-
"@moxxy/plugin-
|
|
50
|
-
"@moxxy/plugin-
|
|
48
|
+
"@moxxy/sdk": "0.29.0",
|
|
49
|
+
"@moxxy/plugin-provider-anthropic": "0.29.0",
|
|
50
|
+
"@moxxy/plugin-oauth": "0.29.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/node": "^22.10.0",
|
package/src/login.test.ts
CHANGED
|
@@ -4,6 +4,7 @@ import * as os from 'node:os';
|
|
|
4
4
|
import * as path from 'node:path';
|
|
5
5
|
import { storeTokenSet, type OAuthVault } from '@moxxy/plugin-oauth';
|
|
6
6
|
import type { ProviderAuthContext } from '@moxxy/sdk';
|
|
7
|
+
import { assertDefined } from '@moxxy/sdk';
|
|
7
8
|
import { CLAUDE_CLIENT_ID, CLAUDE_TOKEN_URL } from './constants.js';
|
|
8
9
|
import {
|
|
9
10
|
claudeLogin,
|
|
@@ -128,14 +129,16 @@ describe('claudeLogin', () => {
|
|
|
128
129
|
const res = await claudeLogin(makeCtx(vault, ['', 'AUTHCODE']));
|
|
129
130
|
|
|
130
131
|
expect(calls).toHaveLength(1);
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
const call0 = calls[0];
|
|
133
|
+
assertDefined(call0, 'one call asserted above');
|
|
134
|
+
expect(call0.url).toBe(CLAUDE_TOKEN_URL);
|
|
135
|
+
expect(call0.body).toMatchObject({
|
|
133
136
|
grant_type: 'authorization_code',
|
|
134
137
|
code: 'AUTHCODE',
|
|
135
138
|
client_id: CLAUDE_CLIENT_ID,
|
|
136
139
|
redirect_uri: 'https://console.anthropic.com/oauth/code/callback',
|
|
137
140
|
});
|
|
138
|
-
expect(typeof
|
|
141
|
+
expect(typeof call0.body.code_verifier).toBe('string');
|
|
139
142
|
expect(vault.store.get('oauth/claude-code/access_token')).toBe('access-1');
|
|
140
143
|
expect(vault.store.get('oauth/claude-code/refresh_token')).toBe('refresh-1');
|
|
141
144
|
expect(vault.store.get('oauth/claude-code/extras')).toContain('me@example.com');
|