takomi 2.1.2 → 2.1.3
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/.pi/README.md +124 -124
- package/.pi/agents/architect.md +15 -15
- package/.pi/agents/coder.md +14 -14
- package/.pi/agents/designer.md +17 -17
- package/.pi/agents/orchestrator.md +22 -22
- package/.pi/agents/reviewer.md +16 -16
- package/.pi/extensions/oauth-router/README.md +125 -125
- package/.pi/extensions/oauth-router/commands.ts +380 -380
- package/.pi/extensions/oauth-router/config.ts +200 -200
- package/.pi/extensions/oauth-router/index.ts +41 -41
- package/.pi/extensions/oauth-router/oauth-flow.ts +154 -154
- package/.pi/extensions/oauth-router/oauth-store.ts +121 -121
- package/.pi/extensions/oauth-router/package.json +14 -14
- package/.pi/extensions/oauth-router/policies.ts +27 -27
- package/.pi/extensions/oauth-router/provider.ts +492 -492
- package/.pi/extensions/oauth-router/scripts/vibe-verify.py +98 -98
- package/.pi/extensions/oauth-router/state.ts +174 -174
- package/.pi/extensions/oauth-router/types.ts +153 -153
- package/.pi/extensions/takomi-runtime/command-text.ts +130 -130
- package/.pi/extensions/takomi-runtime/commands.ts +179 -179
- package/.pi/extensions/takomi-runtime/context-panel.ts +282 -282
- package/.pi/extensions/takomi-runtime/index.ts +1288 -1288
- package/.pi/extensions/takomi-runtime/profile.ts +114 -114
- package/.pi/extensions/takomi-runtime/routing-policy.ts +105 -105
- package/.pi/extensions/takomi-runtime/shared.ts +492 -492
- package/.pi/extensions/takomi-runtime/subagent-controller.ts +364 -364
- package/.pi/extensions/takomi-runtime/subagent-render.ts +501 -501
- package/.pi/extensions/takomi-runtime/subagent-types.ts +83 -83
- package/.pi/extensions/takomi-runtime/ui.ts +133 -133
- package/.pi/extensions/takomi-subagents/agent-aliases.ts +18 -18
- package/.pi/extensions/takomi-subagents/agents.ts +113 -113
- package/.pi/extensions/takomi-subagents/delegation-plan.ts +95 -95
- package/.pi/extensions/takomi-subagents/dispatch-helpers.ts +26 -26
- package/.pi/extensions/takomi-subagents/dispatch.ts +215 -215
- package/.pi/extensions/takomi-subagents/index.ts +75 -75
- package/.pi/extensions/takomi-subagents/live-updates.ts +83 -83
- package/.pi/extensions/takomi-subagents/native-render.ts +174 -174
- package/.pi/extensions/takomi-subagents/tool-runner.ts +209 -209
- package/.pi/themes/takomi-noir.json +81 -81
- package/package.json +59 -59
- package/src/doctor.js +87 -84
- package/src/pi-harness.js +355 -351
- package/src/pi-installer.js +193 -171
- package/src/pi-takomi-core/index.ts +4 -4
- package/src/pi-takomi-core/orchestration.ts +402 -402
- package/src/pi-takomi-core/routing.ts +93 -93
- package/src/pi-takomi-core/types.ts +173 -173
- package/src/pi-takomi-core/workflows.ts +299 -299
- package/src/skills-installer.js +101 -101
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
# oauth-router
|
|
2
|
-
|
|
3
|
-
Pi extension that auto-loads and registers an `oauth-router` provider with multi-account routing, health tracking, cooldowns, and extension-owned credential storage.
|
|
4
|
-
|
|
5
|
-
## What it does
|
|
6
|
-
|
|
7
|
-
- auto-loads from `~/.pi/agent/extensions/oauth-router`
|
|
8
|
-
- registers provider: `oauth-router`
|
|
9
|
-
- stores multiple accounts in `~/.pi/agent/oauth-router/credentials.json`
|
|
10
|
-
- stores health, cooldown, and routing state in `~/.pi/agent/oauth-router/state.json`
|
|
11
|
-
- supports account commands:
|
|
12
|
-
- `/router-login add`
|
|
13
|
-
- `/router-login list`
|
|
14
|
-
- `/router-login remove <id>`
|
|
15
|
-
- `/router-login refresh <id>`
|
|
16
|
-
- `/router-status`
|
|
17
|
-
- `/router-enable <id>`
|
|
18
|
-
- `/router-disable <id>`
|
|
19
|
-
- `/router-policy <name>`
|
|
20
|
-
- routes across healthy accounts with:
|
|
21
|
-
- round robin
|
|
22
|
-
- weighted round robin
|
|
23
|
-
- 429 cooldowns
|
|
24
|
-
- transient failure penalties
|
|
25
|
-
- auth failure quarantine
|
|
26
|
-
- safe pre-output failover
|
|
27
|
-
|
|
28
|
-
## Default upstreams
|
|
29
|
-
|
|
30
|
-
The extension ships with two default upstream profiles:
|
|
31
|
-
|
|
32
|
-
1. `chatgpt-codex`
|
|
33
|
-
- auth mode: OAuth
|
|
34
|
-
- oauth provider: `openai-codex`
|
|
35
|
-
- api: `openai-codex-responses`
|
|
36
|
-
- default models: `gpt-5.1`, `gpt-5.4`, `gpt-5.4-mini`
|
|
37
|
-
|
|
38
|
-
2. `openai-compatible`
|
|
39
|
-
- auth mode: API key fallback
|
|
40
|
-
- api: `openai-responses`
|
|
41
|
-
- default models: `gpt-4o`, `gpt-4.1`, `o4-mini`
|
|
42
|
-
|
|
43
|
-
Edit `~/.pi/agent/oauth-router/config.json` to add more upstreams, swap endpoints, or change model catalogs.
|
|
44
|
-
|
|
45
|
-
## Setup
|
|
46
|
-
|
|
47
|
-
1. Restart Pi or run `/reload`
|
|
48
|
-
2. Confirm the provider is present:
|
|
49
|
-
- `pi --list-models | grep oauth-router`
|
|
50
|
-
3. Add an account:
|
|
51
|
-
- OAuth: `/router-login add chatgpt-codex`
|
|
52
|
-
- API key fallback: `/router-login add openai-compatible`
|
|
53
|
-
4. Check state:
|
|
54
|
-
- `/router-status`
|
|
55
|
-
5. Select a model:
|
|
56
|
-
- `oauth-router/gpt-5.4`
|
|
57
|
-
- `oauth-router/gpt-4o`
|
|
58
|
-
|
|
59
|
-
## Account storage format
|
|
60
|
-
|
|
61
|
-
Credentials live in:
|
|
62
|
-
|
|
63
|
-
- `~/.pi/agent/oauth-router/credentials.json`
|
|
64
|
-
|
|
65
|
-
Shape:
|
|
66
|
-
|
|
67
|
-
```json
|
|
68
|
-
{
|
|
69
|
-
"version": 1,
|
|
70
|
-
"accounts": [
|
|
71
|
-
{
|
|
72
|
-
"id": "acct_ab12cd34",
|
|
73
|
-
"label": "Primary Codex",
|
|
74
|
-
"provider": "openai-codex",
|
|
75
|
-
"upstreamId": "chatgpt-codex",
|
|
76
|
-
"access": "<sensitive>",
|
|
77
|
-
"refresh": "<sensitive>",
|
|
78
|
-
"expires": 1777580854310,
|
|
79
|
-
"enabled": true,
|
|
80
|
-
"weight": 1,
|
|
81
|
-
"createdAt": 1776000000000,
|
|
82
|
-
"updatedAt": 1776000000000,
|
|
83
|
-
"meta": {
|
|
84
|
-
"accountId": "..."
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Health state lives separately in:
|
|
92
|
-
|
|
93
|
-
- `~/.pi/agent/oauth-router/state.json`
|
|
94
|
-
|
|
95
|
-
## Security notes
|
|
96
|
-
|
|
97
|
-
- credentials are stored separately from health state
|
|
98
|
-
- files are written with restrictive permissions where the OS allows it
|
|
99
|
-
- command output redacts secrets
|
|
100
|
-
- the extension does not log access or refresh tokens
|
|
101
|
-
|
|
102
|
-
## Known limitations
|
|
103
|
-
|
|
104
|
-
- Pi's built-in `/login` is intentionally not used for multi-account storage because Pi stores one OAuth identity per provider entry
|
|
105
|
-
- the shipped OAuth adapter reuses Pi's built-in `openai-codex` OAuth implementation; generic OpenAI-compatible upstream OAuth still requires provider-specific adapters
|
|
106
|
-
- safe failover only happens before meaningful output is emitted; no unsafe mid-stream account switching is attempted
|
|
107
|
-
- API key fallback is supported, but OAuth remains the primary path for subscription-style upstreams
|
|
108
|
-
|
|
109
|
-
## Validation
|
|
110
|
-
|
|
111
|
-
Run:
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
python scripts/vibe-verify.py
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Docs
|
|
118
|
-
|
|
119
|
-
OAuth Router documentation is maintained in the repo-level docs tree so it stays unified with the rest of Takomi/Pi documentation:
|
|
120
|
-
|
|
121
|
-
- `../../../docs/features/Pi_OAuth_Router.md`
|
|
122
|
-
- `../../../docs/oauth-router/genesis/Project_Requirements.md`
|
|
123
|
-
- `../../../docs/oauth-router/genesis/Coding_Guidelines.md`
|
|
124
|
-
- `../../../docs/oauth-router/genesis/Builder_Prompt.md`
|
|
125
|
-
- `../../../docs/oauth-router/genesis/issues/`
|
|
1
|
+
# oauth-router
|
|
2
|
+
|
|
3
|
+
Pi extension that auto-loads and registers an `oauth-router` provider with multi-account routing, health tracking, cooldowns, and extension-owned credential storage.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
- auto-loads from `~/.pi/agent/extensions/oauth-router`
|
|
8
|
+
- registers provider: `oauth-router`
|
|
9
|
+
- stores multiple accounts in `~/.pi/agent/oauth-router/credentials.json`
|
|
10
|
+
- stores health, cooldown, and routing state in `~/.pi/agent/oauth-router/state.json`
|
|
11
|
+
- supports account commands:
|
|
12
|
+
- `/router-login add`
|
|
13
|
+
- `/router-login list`
|
|
14
|
+
- `/router-login remove <id>`
|
|
15
|
+
- `/router-login refresh <id>`
|
|
16
|
+
- `/router-status`
|
|
17
|
+
- `/router-enable <id>`
|
|
18
|
+
- `/router-disable <id>`
|
|
19
|
+
- `/router-policy <name>`
|
|
20
|
+
- routes across healthy accounts with:
|
|
21
|
+
- round robin
|
|
22
|
+
- weighted round robin
|
|
23
|
+
- 429 cooldowns
|
|
24
|
+
- transient failure penalties
|
|
25
|
+
- auth failure quarantine
|
|
26
|
+
- safe pre-output failover
|
|
27
|
+
|
|
28
|
+
## Default upstreams
|
|
29
|
+
|
|
30
|
+
The extension ships with two default upstream profiles:
|
|
31
|
+
|
|
32
|
+
1. `chatgpt-codex`
|
|
33
|
+
- auth mode: OAuth
|
|
34
|
+
- oauth provider: `openai-codex`
|
|
35
|
+
- api: `openai-codex-responses`
|
|
36
|
+
- default models: `gpt-5.1`, `gpt-5.4`, `gpt-5.4-mini`
|
|
37
|
+
|
|
38
|
+
2. `openai-compatible`
|
|
39
|
+
- auth mode: API key fallback
|
|
40
|
+
- api: `openai-responses`
|
|
41
|
+
- default models: `gpt-4o`, `gpt-4.1`, `o4-mini`
|
|
42
|
+
|
|
43
|
+
Edit `~/.pi/agent/oauth-router/config.json` to add more upstreams, swap endpoints, or change model catalogs.
|
|
44
|
+
|
|
45
|
+
## Setup
|
|
46
|
+
|
|
47
|
+
1. Restart Pi or run `/reload`
|
|
48
|
+
2. Confirm the provider is present:
|
|
49
|
+
- `pi --list-models | grep oauth-router`
|
|
50
|
+
3. Add an account:
|
|
51
|
+
- OAuth: `/router-login add chatgpt-codex`
|
|
52
|
+
- API key fallback: `/router-login add openai-compatible`
|
|
53
|
+
4. Check state:
|
|
54
|
+
- `/router-status`
|
|
55
|
+
5. Select a model:
|
|
56
|
+
- `oauth-router/gpt-5.4`
|
|
57
|
+
- `oauth-router/gpt-4o`
|
|
58
|
+
|
|
59
|
+
## Account storage format
|
|
60
|
+
|
|
61
|
+
Credentials live in:
|
|
62
|
+
|
|
63
|
+
- `~/.pi/agent/oauth-router/credentials.json`
|
|
64
|
+
|
|
65
|
+
Shape:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"version": 1,
|
|
70
|
+
"accounts": [
|
|
71
|
+
{
|
|
72
|
+
"id": "acct_ab12cd34",
|
|
73
|
+
"label": "Primary Codex",
|
|
74
|
+
"provider": "openai-codex",
|
|
75
|
+
"upstreamId": "chatgpt-codex",
|
|
76
|
+
"access": "<sensitive>",
|
|
77
|
+
"refresh": "<sensitive>",
|
|
78
|
+
"expires": 1777580854310,
|
|
79
|
+
"enabled": true,
|
|
80
|
+
"weight": 1,
|
|
81
|
+
"createdAt": 1776000000000,
|
|
82
|
+
"updatedAt": 1776000000000,
|
|
83
|
+
"meta": {
|
|
84
|
+
"accountId": "..."
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Health state lives separately in:
|
|
92
|
+
|
|
93
|
+
- `~/.pi/agent/oauth-router/state.json`
|
|
94
|
+
|
|
95
|
+
## Security notes
|
|
96
|
+
|
|
97
|
+
- credentials are stored separately from health state
|
|
98
|
+
- files are written with restrictive permissions where the OS allows it
|
|
99
|
+
- command output redacts secrets
|
|
100
|
+
- the extension does not log access or refresh tokens
|
|
101
|
+
|
|
102
|
+
## Known limitations
|
|
103
|
+
|
|
104
|
+
- Pi's built-in `/login` is intentionally not used for multi-account storage because Pi stores one OAuth identity per provider entry
|
|
105
|
+
- the shipped OAuth adapter reuses Pi's built-in `openai-codex` OAuth implementation; generic OpenAI-compatible upstream OAuth still requires provider-specific adapters
|
|
106
|
+
- safe failover only happens before meaningful output is emitted; no unsafe mid-stream account switching is attempted
|
|
107
|
+
- API key fallback is supported, but OAuth remains the primary path for subscription-style upstreams
|
|
108
|
+
|
|
109
|
+
## Validation
|
|
110
|
+
|
|
111
|
+
Run:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
python scripts/vibe-verify.py
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Docs
|
|
118
|
+
|
|
119
|
+
OAuth Router documentation is maintained in the repo-level docs tree so it stays unified with the rest of Takomi/Pi documentation:
|
|
120
|
+
|
|
121
|
+
- `../../../docs/features/Pi_OAuth_Router.md`
|
|
122
|
+
- `../../../docs/oauth-router/genesis/Project_Requirements.md`
|
|
123
|
+
- `../../../docs/oauth-router/genesis/Coding_Guidelines.md`
|
|
124
|
+
- `../../../docs/oauth-router/genesis/Builder_Prompt.md`
|
|
125
|
+
- `../../../docs/oauth-router/genesis/issues/`
|