opencode-anthropic-multi-account 0.2.31 → 0.2.33

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,10 +1,15 @@
1
1
  # opencode-anthropic-multi-account
2
2
 
3
- OpenCode plugin for multi-account Anthropic (Claude) OAuth management with automatic rate limit switching.
3
+ OpenCode plugin for multi-account Claude OAuth. It runs inside OpenCode and does not
4
+ launch `kyoli serve`.
5
+
6
+ Use this package for OpenCode Plugin Mode. Use Server Mode (`kyoli serve` +
7
+ `kyoli install opencode`) when the same account pool should also serve Codex CLI, SDK
8
+ clients, or a dashboard.
4
9
 
5
10
  ## Install
6
11
 
7
- Add to `opencode.json`:
12
+ Add the plugin to `~/.config/opencode/opencode.json`:
8
13
 
9
14
  ```jsonc
10
15
  {
@@ -12,20 +17,73 @@ Add to `opencode.json`:
12
17
  }
13
18
  ```
14
19
 
15
- ## Features
20
+ If `plugin` already exists, append this package to the existing array.
21
+
22
+ Then use OpenCode's normal auth flow:
23
+
24
+ ```bash
25
+ opencode auth login
26
+ ```
27
+
28
+ Choose the Claude/Anthropic multi-auth OAuth method. Run the same command again to add
29
+ more Claude accounts or open the account management menu.
30
+
31
+ ## What it does
16
32
 
17
- - Automatic account rotation on 429 responses
18
- - Three selection strategies: sticky, round-robin, and hybrid
19
- - Cross-process coordination for parallel sessions
20
- - Background token refresh before expiry
21
- - Status tool (`claude_multiauth_status`) for mid-session account overview
33
+ - Uses OpenCode's built-in `anthropic` provider.
34
+ - Stores accounts under OpenCode's config directory.
35
+ - Rotates accounts on auth/rate-limit failures.
36
+ - Refreshes tokens before expiry.
37
+ - Keeps routing sticky by default for prompt-cache-heavy sessions.
22
38
 
23
- ## Architecture
39
+ ## Tool policy
24
40
 
41
+ Claude tool handling is OpenCode-first:
42
+
43
+ - preserve incoming OpenCode tools when present;
44
+ - use Claude Code template tools only when OpenCode sends no tools;
45
+ - fill missing `input_schema` from the template only when tool counts match;
46
+ - do not remap unknown OpenCode/custom tools onto Claude Code fallback tools.
47
+
48
+ This is an internal compatibility policy, not a third user-facing mode.
49
+
50
+ ## Server Mode migration
51
+
52
+ ```bash
53
+ kyoli accounts import opencode --dry-run --provider claude-code
54
+ kyoli accounts import opencode --provider claude-code
55
+ kyoli install opencode
25
56
  ```
26
- opencode-anthropic-multi-account ← you are here
27
-
28
- opencode-multi-account-core
57
+
58
+ Do not keep this plugin enabled for Anthropic while also routing Anthropic through
59
+ `kyoli install opencode`, unless you are intentionally comparing both paths.
60
+
61
+ ## Checks
62
+
63
+ No-live contract:
64
+
65
+ ```bash
66
+ pnpm --filter opencode-anthropic-multi-account test:contract:native
67
+ ```
68
+
69
+ Full package checks:
70
+
71
+ ```bash
72
+ pnpm --filter opencode-anthropic-multi-account typecheck
73
+ pnpm --filter opencode-anthropic-multi-account test
74
+ pnpm --filter opencode-anthropic-multi-account build
29
75
  ```
30
76
 
31
- See the [root README](../../README.md) for full documentation.
77
+ Opt-in live acceptance:
78
+
79
+ ```bash
80
+ KYOLI_ENABLE_LIVE_OPENCODE_CLAUDE_NATIVE=1 \
81
+ KYOLI_CLAUDE_ALLOW_LIVE_MESSAGES=1 \
82
+ pnpm --filter opencode-anthropic-multi-account test:live:opencode-claude-native
83
+ ```
84
+
85
+ ## Docs
86
+
87
+ - [Root README](../../README.md)
88
+ - [OpenCode Plugin Usage](../../docs/opencode-plugin-usage.md)
89
+ - [Claude live acceptance](../../docs/claude-live-acceptance.md)
@@ -21,7 +21,7 @@ import {
21
21
  var data_default = {
22
22
  _version: 1,
23
23
  _schemaVersion: 1,
24
- _captured: "2026-05-09T04:25:44.414Z",
24
+ _captured: "2026-05-09T15:52:01.400Z",
25
25
  _source: "bundled",
26
26
  agent_identity: "You are a Claude agent, built on Anthropic's Claude Agent SDK.",
27
27
  system_prompt: `You are an interactive agent that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
@@ -1419,7 +1419,7 @@ IMPORTANT - Use the correct year in search queries:
1419
1419
  "Write"
1420
1420
  ],
1421
1421
  anthropic_beta: "claude-code-20250219,oauth-2025-04-20,context-1m-2025-08-07,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advisor-tool-2026-03-01,effort-2025-11-24,extended-cache-ttl-2025-04-11",
1422
- cc_version: "2.1.137",
1422
+ cc_version: "2.1.138",
1423
1423
  header_order: [
1424
1424
  "Accept",
1425
1425
  "Authorization",
@@ -1449,7 +1449,7 @@ IMPORTANT - Use the correct year in search queries:
1449
1449
  "anthropic-dangerous-direct-browser-access": "true",
1450
1450
  "anthropic-version": "2023-06-01",
1451
1451
  "content-type": "application/json",
1452
- "user-agent": "claude-cli/2.1.137 (external, sdk-cli)",
1452
+ "user-agent": "claude-cli/2.1.138 (external, sdk-cli)",
1453
1453
  "x-app": "cli",
1454
1454
  "x-stainless-timeout": "600"
1455
1455
  },
@@ -2042,7 +2042,7 @@ var STATIC_HEADER_NAMES = [
2042
2042
  ];
2043
2043
  var SUPPORTED_CC_RANGE = {
2044
2044
  min: "1.0.0",
2045
- maxTested: "2.1.137"
2045
+ maxTested: "2.1.138"
2046
2046
  };
2047
2047
  var bundledTemplate = data_default;
2048
2048
  var fingerprintCaptureTestOverrides = {};
@@ -2543,9 +2543,9 @@ export {
2543
2543
  PLAN_LABELS,
2544
2544
  TOKEN_EXPIRY_BUFFER_MS,
2545
2545
  TOKEN_REFRESH_TIMEOUT_MS,
2546
- cc_derived_defaults_default,
2547
2546
  data_default,
2548
2547
  detectCliVersion,
2548
+ cc_derived_defaults_default,
2549
2549
  showToast,
2550
2550
  debugLog,
2551
2551
  createMinimalClient,
@@ -2568,4 +2568,4 @@ export {
2568
2568
  setFingerprintCaptureTestOverridesForTest,
2569
2569
  resetFingerprintCaptureForTest
2570
2570
  };
2571
- //# sourceMappingURL=chunk-VV6PT72I.js.map
2571
+ //# sourceMappingURL=chunk-CFK244IN.js.map