@centerforagenticai/pi-multi-account 0.1.1
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/LICENSE +21 -0
- package/NOTICE +29 -0
- package/README.md +999 -0
- package/config/models/pi-multi-account.v1.json +32 -0
- package/config/subscription-plans.v1.json +122 -0
- package/package.json +76 -0
- package/packages/pi-anthropic-oauth/LICENSE +21 -0
- package/packages/pi-anthropic-oauth/package.json +54 -0
- package/packages/pi-anthropic-oauth/src/auth.ts +396 -0
- package/packages/pi-anthropic-oauth/src/context.ts +116 -0
- package/packages/pi-anthropic-oauth/src/convert.ts +303 -0
- package/packages/pi-anthropic-oauth/src/index.ts +37 -0
- package/packages/pi-anthropic-oauth/src/prompt.ts +137 -0
- package/packages/pi-anthropic-oauth/src/stream.ts +476 -0
- package/packages/pi-antigravity/LICENSE +21 -0
- package/packages/pi-antigravity/package.json +77 -0
- package/packages/pi-antigravity/src/auth/index.ts +14 -0
- package/packages/pi-antigravity/src/auth/oauth.ts +442 -0
- package/packages/pi-antigravity/src/client/client.ts +561 -0
- package/packages/pi-antigravity/src/client/index.ts +1 -0
- package/packages/pi-antigravity/src/context.ts +110 -0
- package/packages/pi-antigravity/src/diagnostics/diagnostics.ts +96 -0
- package/packages/pi-antigravity/src/diagnostics/index.ts +1 -0
- package/packages/pi-antigravity/src/image/image.ts +336 -0
- package/packages/pi-antigravity/src/image/index.ts +1 -0
- package/packages/pi-antigravity/src/index.ts +280 -0
- package/packages/pi-antigravity/src/models/discovery.ts +154 -0
- package/packages/pi-antigravity/src/models/grouping.ts +424 -0
- package/packages/pi-antigravity/src/models/index.ts +3 -0
- package/packages/pi-antigravity/src/models/models.ts +500 -0
- package/packages/pi-antigravity/src/stream/index.ts +1 -0
- package/packages/pi-antigravity/src/stream/stream.ts +1478 -0
- package/packages/pi-antigravity/src/types/enums.ts +42 -0
- package/packages/pi-antigravity/src/types/index.ts +2 -0
- package/packages/pi-antigravity/src/types/types.ts +292 -0
- package/packages/pi-antigravity/src/usage/index.ts +1 -0
- package/packages/pi-antigravity/src/usage/usage.ts +416 -0
- package/packages/pi-antigravity/src/utils/http.ts +91 -0
- package/packages/pi-antigravity/src/utils/index.ts +3 -0
- package/packages/pi-antigravity/src/utils/security.ts +73 -0
- package/packages/pi-antigravity/src/utils/util.ts +132 -0
- package/scripts/multi-account.mjs +44 -0
- package/src/account-labels.ts +223 -0
- package/src/account-plan-assignment.ts +340 -0
- package/src/account-rate-history.ts +372 -0
- package/src/anthropic-adaptive-stream.ts +531 -0
- package/src/anthropic-alias-stream.ts +140 -0
- package/src/anthropic-context-compat.ts +80 -0
- package/src/api-pricing.ts +579 -0
- package/src/bounded-file-lines.ts +97 -0
- package/src/catalog-rebinding.ts +177 -0
- package/src/catalog-registration-probe.ts +111 -0
- package/src/codex-adapter.ts +345 -0
- package/src/codex-model-defaults.ts +785 -0
- package/src/command-completions.ts +404 -0
- package/src/commands.ts +2000 -0
- package/src/compaction.ts +14 -0
- package/src/config.ts +1317 -0
- package/src/continuation.ts +569 -0
- package/src/cooldowns.ts +110 -0
- package/src/cost-digest-store.ts +332 -0
- package/src/cost-digest.ts +1044 -0
- package/src/cost-history.ts +251 -0
- package/src/cost-period-closer.ts +160 -0
- package/src/cost-report-json.ts +318 -0
- package/src/cost-report-reader.ts +368 -0
- package/src/cost-report-render.ts +207 -0
- package/src/cost-report.ts +1104 -0
- package/src/coverage-attestation.ts +397 -0
- package/src/credential-lifecycle.ts +169 -0
- package/src/credential-refresh.ts +248 -0
- package/src/declaration-notice-marker.ts +238 -0
- package/src/diagnostic-store.ts +276 -0
- package/src/diagnostics.ts +309 -0
- package/src/discovery.ts +471 -0
- package/src/duration.ts +13 -0
- package/src/error-classification.ts +256 -0
- package/src/fuzzy.ts +15 -0
- package/src/group-policy.ts +81 -0
- package/src/history-store.ts +897 -0
- package/src/index.ts +5572 -0
- package/src/lifecycle.ts +378 -0
- package/src/logical-dispatch.ts +279 -0
- package/src/logical-model-selector.ts +254 -0
- package/src/logical-model-switcher.ts +430 -0
- package/src/logical-provider-attribution.ts +544 -0
- package/src/logical-provider.ts +1237 -0
- package/src/logical-route-indicator.ts +215 -0
- package/src/machine-lease.ts +445 -0
- package/src/model-support.ts +66 -0
- package/src/models-declaration.ts +1091 -0
- package/src/openai-adapter.ts +117 -0
- package/src/openrouter-budget.ts +304 -0
- package/src/openrouter-fallback.ts +146 -0
- package/src/period-boundaries.ts +376 -0
- package/src/pi-anthropic-oauth.d.ts +6 -0
- package/src/preflight.ts +253 -0
- package/src/pricing-cache.ts +235 -0
- package/src/project-identity.ts +100 -0
- package/src/provider-registration.ts +942 -0
- package/src/rate-formula.ts +163 -0
- package/src/recovery-engine.ts +853 -0
- package/src/recovery-output.ts +837 -0
- package/src/recovery-plan.ts +239 -0
- package/src/report-range.ts +203 -0
- package/src/route-resolver.ts +789 -0
- package/src/routing-config-transaction.ts +232 -0
- package/src/routing.ts +1163 -0
- package/src/runtime-state.ts +630 -0
- package/src/session-account-groups.ts +284 -0
- package/src/session-restore.ts +287 -0
- package/src/shared-usage.ts +1392 -0
- package/src/standalone-cli.ts +720 -0
- package/src/status-view.ts +578 -0
- package/src/subscription-plan-catalog.ts +346 -0
- package/src/tier-model-resolver.ts +46 -0
- package/src/upstream-anthropic.ts +315 -0
- package/src/upstream-antigravity.ts +327 -0
- package/src/usage-fetch.ts +1634 -0
- package/src/usage.ts +1026 -0
- package/src/vendor.ts +87 -0
- package/src/warmer.ts +231 -0
- package/src/watchdog.ts +219 -0
- package/src/window-history.ts +270 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"providers": {
|
|
4
|
+
"openai-codex": {
|
|
5
|
+
"modelOverrides": {
|
|
6
|
+
"gpt-5.4": {
|
|
7
|
+
"contextWindow": 1050000
|
|
8
|
+
},
|
|
9
|
+
"gpt-5.5": {
|
|
10
|
+
"contextWindow": 1050000
|
|
11
|
+
},
|
|
12
|
+
"gpt-5.6-sol": {
|
|
13
|
+
"contextWindow": 1050000
|
|
14
|
+
},
|
|
15
|
+
"gpt-5.6-terra": {
|
|
16
|
+
"contextWindow": 1050000
|
|
17
|
+
},
|
|
18
|
+
"gpt-5.6-luna": {
|
|
19
|
+
"contextWindow": 1050000
|
|
20
|
+
},
|
|
21
|
+
"gpt-6-astra": {
|
|
22
|
+
"contextWindow": 1050000
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"unified": {
|
|
27
|
+
"name": "unified",
|
|
28
|
+
"api": "unified",
|
|
29
|
+
"baseUrl": "https://unused.invalid"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"presets": [
|
|
4
|
+
{
|
|
5
|
+
"id": "chatgpt-individual-free",
|
|
6
|
+
"provider": "chatgpt",
|
|
7
|
+
"accountType": "individual",
|
|
8
|
+
"label": "free",
|
|
9
|
+
"monthlyUsd": 0,
|
|
10
|
+
"productBasis": "per-account",
|
|
11
|
+
"provenance": "Operator-provided default monthly-equivalent USD comparison rate, not a researched provider entitlement or independently verified official price."
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "chatgpt-individual-go",
|
|
15
|
+
"provider": "chatgpt",
|
|
16
|
+
"accountType": "individual",
|
|
17
|
+
"label": "go",
|
|
18
|
+
"monthlyUsd": 8,
|
|
19
|
+
"productBasis": "per-account",
|
|
20
|
+
"provenance": "Operator-provided default monthly-equivalent USD comparison rate, not a researched provider entitlement or independently verified official price."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "chatgpt-individual-plus",
|
|
24
|
+
"provider": "chatgpt",
|
|
25
|
+
"accountType": "individual",
|
|
26
|
+
"label": "plus",
|
|
27
|
+
"monthlyUsd": 20,
|
|
28
|
+
"productBasis": "per-account",
|
|
29
|
+
"provenance": "Operator-provided default monthly-equivalent USD comparison rate, not a researched provider entitlement or independently verified official price."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "chatgpt-individual-pro-5x",
|
|
33
|
+
"provider": "chatgpt",
|
|
34
|
+
"accountType": "individual",
|
|
35
|
+
"label": "pro 5x",
|
|
36
|
+
"monthlyUsd": 100,
|
|
37
|
+
"productBasis": "per-account",
|
|
38
|
+
"provenance": "Operator-provided default monthly-equivalent USD comparison rate, not a researched provider entitlement or independently verified official price."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "chatgpt-individual-pro-20x",
|
|
42
|
+
"provider": "chatgpt",
|
|
43
|
+
"accountType": "individual",
|
|
44
|
+
"label": "pro 20x",
|
|
45
|
+
"monthlyUsd": 200,
|
|
46
|
+
"productBasis": "per-account",
|
|
47
|
+
"provenance": "Operator-provided default monthly-equivalent USD comparison rate, not a researched provider entitlement or independently verified official price."
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "chatgpt-business-standard",
|
|
51
|
+
"provider": "chatgpt",
|
|
52
|
+
"accountType": "business",
|
|
53
|
+
"label": "standard",
|
|
54
|
+
"monthlyUsd": 25,
|
|
55
|
+
"productBasis": "per-account",
|
|
56
|
+
"provenance": "Operator-provided default monthly-equivalent USD comparison rate, not a researched provider entitlement or independently verified official price."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "chatgpt-business-premium",
|
|
60
|
+
"provider": "chatgpt",
|
|
61
|
+
"accountType": "business",
|
|
62
|
+
"label": "premium",
|
|
63
|
+
"monthlyUsd": 125,
|
|
64
|
+
"productBasis": "per-account",
|
|
65
|
+
"provenance": "Operator-provided default monthly-equivalent USD comparison rate, not a researched provider entitlement or independently verified official price."
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "anthropic-individual-free",
|
|
69
|
+
"provider": "anthropic",
|
|
70
|
+
"accountType": "individual",
|
|
71
|
+
"label": "free",
|
|
72
|
+
"monthlyUsd": 0,
|
|
73
|
+
"productBasis": "per-account",
|
|
74
|
+
"provenance": "Operator-provided default monthly-equivalent USD comparison rate, not a researched provider entitlement or independently verified official price."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "anthropic-individual-pro",
|
|
78
|
+
"provider": "anthropic",
|
|
79
|
+
"accountType": "individual",
|
|
80
|
+
"label": "pro",
|
|
81
|
+
"monthlyUsd": 17,
|
|
82
|
+
"productBasis": "per-account",
|
|
83
|
+
"provenance": "Operator-provided default monthly-equivalent USD comparison rate, not a researched provider entitlement or independently verified official price."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "anthropic-individual-max-5x",
|
|
87
|
+
"provider": "anthropic",
|
|
88
|
+
"accountType": "individual",
|
|
89
|
+
"label": "max 5x",
|
|
90
|
+
"monthlyUsd": 100,
|
|
91
|
+
"productBasis": "per-account",
|
|
92
|
+
"provenance": "Operator-provided default monthly-equivalent USD comparison rate, not a researched provider entitlement or independently verified official price."
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "anthropic-individual-max-20x",
|
|
96
|
+
"provider": "anthropic",
|
|
97
|
+
"accountType": "individual",
|
|
98
|
+
"label": "max 20x",
|
|
99
|
+
"monthlyUsd": 200,
|
|
100
|
+
"productBasis": "per-account",
|
|
101
|
+
"provenance": "Operator-provided default monthly-equivalent USD comparison rate, not a researched provider entitlement or independently verified official price."
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "anthropic-team-standard",
|
|
105
|
+
"provider": "anthropic",
|
|
106
|
+
"accountType": "team",
|
|
107
|
+
"label": "standard",
|
|
108
|
+
"monthlyUsd": 25,
|
|
109
|
+
"productBasis": "per-account",
|
|
110
|
+
"provenance": "Operator-provided default monthly-equivalent USD comparison rate, not a researched provider entitlement or independently verified official price."
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"id": "anthropic-team-premium",
|
|
114
|
+
"provider": "anthropic",
|
|
115
|
+
"accountType": "team",
|
|
116
|
+
"label": "premium",
|
|
117
|
+
"monthlyUsd": 125,
|
|
118
|
+
"productBasis": "per-account",
|
|
119
|
+
"provenance": "Operator-provided default monthly-equivalent USD comparison rate, not a researched provider entitlement or independently verified official price."
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.1.1",
|
|
3
|
+
"description": "Global Anthropic and OpenAI Codex multi-account OAuth routing for Pi.",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"bin": {
|
|
6
|
+
"multi-account": "scripts/multi-account.mjs"
|
|
7
|
+
},
|
|
8
|
+
"exports": "./src/index.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"src",
|
|
11
|
+
"scripts/multi-account.mjs",
|
|
12
|
+
"config",
|
|
13
|
+
"packages/pi-anthropic-oauth/src",
|
|
14
|
+
"packages/pi-anthropic-oauth/package.json",
|
|
15
|
+
"packages/pi-anthropic-oauth/LICENSE",
|
|
16
|
+
"packages/pi-antigravity/src",
|
|
17
|
+
"packages/pi-antigravity/package.json",
|
|
18
|
+
"packages/pi-antigravity/LICENSE",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE",
|
|
21
|
+
"NOTICE"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"check": "npm run typecheck && npm test",
|
|
25
|
+
"test": "node scripts/with-temp-root.mjs vitest run --no-file-parallelism --testTimeout=15000",
|
|
26
|
+
"smoke:child": "node scripts/with-temp-root.mjs node scripts/child-smoke.mjs",
|
|
27
|
+
"canary:audit": "node scripts/with-temp-root.mjs vitest run test/credential-canary.test.ts --no-file-parallelism --testTimeout=15000 && node scripts/with-temp-root.mjs node scripts/child-smoke.mjs",
|
|
28
|
+
"integration:verify": "npm run check && npm run upstream:check && npm run canary:audit && npm pack --dry-run",
|
|
29
|
+
"upstream:check": "node scripts/upstream-check.mjs",
|
|
30
|
+
"upstream:verify-baseline": "node scripts/upstream-verify-baseline.mjs",
|
|
31
|
+
"upstream:diff": "node scripts/upstream-diff.mjs",
|
|
32
|
+
"upstream:update": "node scripts/upstream-update.mjs",
|
|
33
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=22.19.0"
|
|
37
|
+
},
|
|
38
|
+
"pi": {
|
|
39
|
+
"extensions": [
|
|
40
|
+
"./src/index.ts"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"name": "@centerforagenticai/pi-multi-account",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git+https://github.com/CenterForAgenticAI/tools.git",
|
|
48
|
+
"directory": "packages/pi-multi-account"
|
|
49
|
+
},
|
|
50
|
+
"homepage": "https://github.com/CenterForAgenticAI/tools/tree/main/packages/pi-multi-account#readme",
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/CenterForAgenticAI/tools/issues"
|
|
53
|
+
},
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@anthropic-ai/sdk": "^0.52.0",
|
|
59
|
+
"undici": "^8.10.0"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@earendil-works/pi-ai": "0.84.4",
|
|
63
|
+
"@earendil-works/pi-coding-agent": "0.84.4",
|
|
64
|
+
"@earendil-works/pi-tui": "0.84.4",
|
|
65
|
+
"@types/node": "^24.0.0",
|
|
66
|
+
"typebox": "1.3.7",
|
|
67
|
+
"typescript": "^5.9.0",
|
|
68
|
+
"vitest": "^4.1.11"
|
|
69
|
+
},
|
|
70
|
+
"peerDependencies": {
|
|
71
|
+
"@earendil-works/pi-ai": "*",
|
|
72
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
73
|
+
"@earendil-works/pi-tui": "*",
|
|
74
|
+
"typebox": "*"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Leo Henon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-anthropic-oauth",
|
|
3
|
+
"version": "0.2.5-intel.1",
|
|
4
|
+
"description": "Claude Pro/Max OAuth extension for Pi",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"files": [
|
|
8
|
+
"src",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE",
|
|
11
|
+
"UPSTREAM.json",
|
|
12
|
+
"UPSTREAM.md",
|
|
13
|
+
"SOURCE_MANIFEST.sha256"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=18"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/leohenon/pi-anthropic-oauth"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/leohenon/pi-anthropic-oauth/issues"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/leohenon/pi-anthropic-oauth#readme",
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsc -p tsconfig.json --noEmit",
|
|
31
|
+
"prepare": "npm run build",
|
|
32
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
33
|
+
"test": "node -e \"require('node:fs').rmSync('.test-dist', { recursive: true, force: true })\" && tsc -p tsconfig.json --outDir .test-dist && node --test test/*.test.mjs",
|
|
34
|
+
"pack:check": "npm pack --dry-run",
|
|
35
|
+
"prepublishOnly": "npm run check && npm test && npm run pack:check"
|
|
36
|
+
},
|
|
37
|
+
"pi": {
|
|
38
|
+
"extensions": [
|
|
39
|
+
"./src/index.ts"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@anthropic-ai/sdk": "^0.52.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@earendil-works/pi-ai": ">=0.80.8",
|
|
47
|
+
"@earendil-works/pi-coding-agent": ">=0.80.8"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@earendil-works/pi-ai": "0.84.4",
|
|
51
|
+
"@earendil-works/pi-coding-agent": "0.84.4",
|
|
52
|
+
"typescript": "^5.9.3"
|
|
53
|
+
}
|
|
54
|
+
}
|