pi-anthropic-oauth 0.1.1 → 0.1.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
@@ -29,6 +29,7 @@ Claude Pro/Max
29
29
 
30
30
  - sends Claude Code-like OAuth headers
31
31
  - rewrites Pi system identity where needed
32
+ - auto-creates `~/.Claude Code` → `~/.pi` symlink
32
33
 
33
34
  ## License
34
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-anthropic-oauth",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Claude Pro/Max OAuth extension for Pi",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import { existsSync, symlinkSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { join } from "node:path";
1
4
  import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
2
5
  import { loginAnthropic, refreshAnthropicToken } from "./auth.js";
3
6
  import { streamAnthropicOAuth } from "./stream.js";
@@ -32,7 +35,18 @@ const MODELS = [
32
35
  },
33
36
  ];
34
37
 
38
+ function ensureClaudeCodeSymlink() {
39
+ const target = join(homedir(), ".pi");
40
+ const link = join(homedir(), ".Claude Code");
41
+ if (existsSync(target) && !existsSync(link)) {
42
+ try {
43
+ symlinkSync(target, link);
44
+ } catch {}
45
+ }
46
+ }
47
+
35
48
  export default function (pi: ExtensionAPI) {
49
+ ensureClaudeCodeSymlink();
36
50
  pi.registerProvider("anthropic", {
37
51
  baseUrl: "https://api.anthropic.com",
38
52
  apiKey: "ANTHROPIC_MAX_API_KEY",