pi-anthropic-oauth 0.1.11 → 0.1.13
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 +1 -1
- package/package.json +5 -5
- package/src/auth.ts +1 -1
- package/src/convert.ts +1 -1
- package/src/index.ts +7 -7
- package/src/prompt.ts +1 -1
- package/src/stream.ts +1 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Use Claude Pro/Max in Pi with browser OAuth.
|
|
|
11
11
|
- Claude Code-compatible OAuth headers and prompt shaping
|
|
12
12
|
- No API key or extra usage needed.
|
|
13
13
|
- Uses Pi's Anthropic model registry
|
|
14
|
-
- Adds Claude Opus 4.
|
|
14
|
+
- Adds Claude Opus 4.8 by default
|
|
15
15
|
- Auto-creates `~/.Claude Code` → `~/.pi` symlink when missing
|
|
16
16
|
|
|
17
17
|
## Quick start
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-anthropic-oauth",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Claude Pro/Max OAuth extension for Pi",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
40
|
+
"@earendil-works/pi-ai": "*",
|
|
41
|
+
"@earendil-works/pi-coding-agent": "*"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"@
|
|
44
|
+
"@earendil-works/pi-ai": "^0.74.0",
|
|
45
|
+
"@earendil-works/pi-coding-agent": "^0.74.0",
|
|
46
46
|
"typescript": "^5.9.3"
|
|
47
47
|
}
|
|
48
48
|
}
|
package/src/auth.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { createServer } from "node:http";
|
|
|
2
2
|
import type {
|
|
3
3
|
OAuthCredentials,
|
|
4
4
|
OAuthLoginCallbacks,
|
|
5
|
-
} from "@
|
|
5
|
+
} from "@earendil-works/pi-ai";
|
|
6
6
|
|
|
7
7
|
const CLIENT_ID = "9d1c250a-e61b-44d9-88ed-5944d1962f5e";
|
|
8
8
|
const AUTHORIZE_URL = "https://claude.ai/oauth/authorize";
|
package/src/convert.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
ModelRegistry,
|
|
7
7
|
type ExtensionAPI,
|
|
8
8
|
type ProviderConfig,
|
|
9
|
-
} from "@
|
|
10
|
-
import type { OAuthCredentials } from "@
|
|
9
|
+
} from "@earendil-works/pi-coding-agent";
|
|
10
|
+
import type { OAuthCredentials } from "@earendil-works/pi-ai";
|
|
11
11
|
import { loginAnthropic, refreshAnthropicToken } from "./auth.js";
|
|
12
12
|
import { streamAnthropicOAuth } from "./stream.js";
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
id: "claude-opus-4-
|
|
16
|
-
name: "Claude Opus 4.
|
|
14
|
+
const DEFAULT_OPUS_4_8: NonNullable<ProviderConfig["models"]>[number] = {
|
|
15
|
+
id: "claude-opus-4-8",
|
|
16
|
+
name: "Claude Opus 4.8",
|
|
17
17
|
api: "anthropic-messages",
|
|
18
18
|
reasoning: true,
|
|
19
19
|
input: ["text", "image"],
|
|
@@ -50,8 +50,8 @@ function getAnthropicModels(): NonNullable<ProviderConfig["models"]> {
|
|
|
50
50
|
compat: model.compat,
|
|
51
51
|
}));
|
|
52
52
|
|
|
53
|
-
if (!models.some((model) => model.id ===
|
|
54
|
-
models.push(
|
|
53
|
+
if (!models.some((model) => model.id === DEFAULT_OPUS_4_8.id)) {
|
|
54
|
+
models.push(DEFAULT_OPUS_4_8);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
return models;
|
package/src/prompt.ts
CHANGED
package/src/stream.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
type SimpleStreamOptions,
|
|
12
12
|
type StopReason,
|
|
13
13
|
streamSimpleAnthropic,
|
|
14
|
-
} from "@
|
|
14
|
+
} from "@earendil-works/pi-ai";
|
|
15
15
|
import { isClaudeOAuthAccessToken, USER_AGENT } from "./auth.js";
|
|
16
16
|
import {
|
|
17
17
|
convertPiMessagesToAnthropic,
|