@jameslovespancakes/pi-plus 1.0.0 → 1.0.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.
Files changed (41) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +190 -190
  3. package/config/pi-plus.example.json +60 -60
  4. package/config/skills/model-routing/SKILL.md +86 -86
  5. package/images/pi-plus.svg +10 -10
  6. package/images/usage_demo.png +0 -0
  7. package/package.json +67 -67
  8. package/server/board-server.mjs +641 -641
  9. package/server/package.json +17 -17
  10. package/src/core/accounts/registry.ts +93 -93
  11. package/src/core/anthropic/client-identity.ts +241 -241
  12. package/src/core/catalog/quality.ts +314 -314
  13. package/src/core/config.ts +169 -169
  14. package/src/core/env.ts +58 -58
  15. package/src/core/exec/process.ts +146 -146
  16. package/src/core/exec/ssh-config.ts +157 -157
  17. package/src/core/policy/policy.ts +183 -183
  18. package/src/core/quota/pool.ts +64 -64
  19. package/src/core/quota/usage-source.ts +289 -289
  20. package/src/core/store.ts +43 -43
  21. package/src/domains/agents/board-setup.ts +409 -409
  22. package/src/domains/agents/index.ts +462 -462
  23. package/src/domains/models/catalog-tool.ts +361 -361
  24. package/src/domains/models/index.ts +14 -14
  25. package/src/domains/models/policy-gate.ts +169 -169
  26. package/src/domains/models/provider-picker.ts +207 -207
  27. package/src/domains/remote/config-path.ts +41 -41
  28. package/src/domains/remote/index.ts +866 -866
  29. package/src/domains/remote/setup.ts +425 -425
  30. package/src/domains/setup/index.ts +220 -220
  31. package/src/domains/subscriptions/accounts.ts +242 -242
  32. package/src/domains/subscriptions/footer.ts +182 -182
  33. package/src/domains/subscriptions/index.ts +42 -42
  34. package/src/domains/subscriptions/provider.ts +219 -219
  35. package/src/domains/subscriptions/providers/anthropic.ts +149 -149
  36. package/src/domains/subscriptions/providers/codex.ts +148 -148
  37. package/src/domains/subscriptions/routing.ts +72 -72
  38. package/src/services/usage-service.ts +186 -186
  39. package/src/ui/format.ts +73 -73
  40. package/src/ui/usage-bars.ts +154 -154
  41. package/src/vendor/anthropic.ts +109 -109
@@ -1,86 +1,86 @@
1
- ---
2
- name: model-routing
3
- description: Choose the right model for a task or workflow stage using live benchmark data. Use when delegating work to subagents, authoring or running inline workflows, or whenever deciding which model should handle a task.
4
- ---
5
-
6
- # Model routing
7
-
8
- Do not guess model quality and do not rely on fixed `small`/`medium`/`big`
9
- profiles. Those profiles have been removed from this machine. Pick a model per
10
- task from live data.
11
-
12
- ## 1. Read the catalogue first
13
-
14
- Call the `list_models` tool before delegating work:
15
-
16
- ```
17
- list_models(sort_by: "coding", limit: 15)
18
- list_models(sort_by: "cost_efficiency", provider: "openai-codex")
19
- list_models(query: "opus", detail: "full")
20
- ```
21
-
22
- It returns, per model:
23
-
24
- - Artificial Analysis Intelligence, Coding and Math indices
25
- - Terminal-Bench Hard, Terminal-Bench 2.1, τ²-bench, τ-bench Banking
26
- - LiveCodeBench, SciCode, GPQA Diamond, HLE, MMLU-Pro, IFBench, AIME, MATH-500,
27
- long-context reasoning
28
- - price per 1M input/output/blended tokens, throughput, time to first token
29
- - cost-efficiency ratios (score per dollar)
30
- - `billing` (`sub` or `paid`) and remaining subscription quota
31
- - `conf`: `measured`, `inferred`, or `unrated`
32
-
33
- ## 2. Match the metric to the task
34
-
35
- | Task | Rank by |
36
- |---|---|
37
- | Agentic coding, terminal work, multi-step edits | Terminal-Bench Hard, then Coding Index |
38
- | Tool-calling reliability | τ²-bench |
39
- | Algorithmic code generation | LiveCodeBench, SciCode |
40
- | Research, analysis, hard reasoning | GPQA, HLE, Intelligence Index |
41
- | Long document or repo-wide reasoning | long-context reasoning, context window |
42
- | Bulk or throwaway fan-out | cost efficiency and tok/s |
43
-
44
- ## 3. Respect billing policy
45
-
46
- - Subscription models (`anthropic/*`, `openai-codex/*`) are free to use. Prefer
47
- them, and prefer accounts with quota remaining.
48
- - Metered models (`openrouter/*`, `google/*`, `openai/*`, `xai/*`) are blocked at
49
- the provider boundary until the user runs `/model-approve <provider>`. If a
50
- call is blocked, switch to a subscription model or ask the user; never retry
51
- in a loop.
52
- - Check `/model-policy` for the current spend ceiling.
53
-
54
- ## 4. Use explicit models in workflows
55
-
56
- In inline workflow scripts pass `model` on each `agent()` call:
57
-
58
- ```ts
59
- const findings = await parallel([
60
- () => agent(prompt, { model: "openai-codex/gpt-5.6-terra", schema: Finding }),
61
- () => agent(prompt, { model: "anthropic/claude-sonnet-5", schema: Finding }),
62
- ]);
63
-
64
- const synthesis = await agent(summaryPrompt, {
65
- model: "anthropic/claude-opus-5",
66
- thinkingLevel: "high",
67
- });
68
- ```
69
-
70
- Rules:
71
-
72
- - Always use the full `provider/id` form.
73
- - Give cheap, fast, high-throughput models the wide fan-out stages.
74
- - Give the strongest agentic model the synthesis, planning and patch-writing
75
- stages.
76
- - Thinking level changes measured quality: `list_models` scores resolve per
77
- effort level where Artificial Analysis publishes them, so raise
78
- `thinkingLevel` when a stage is hard rather than switching to a costlier model
79
- by default.
80
- - If a model is `unrated`, say so before using it for important work, and prefer
81
- a `measured` alternative of similar cost.
82
-
83
- ## 5. Quota awareness
84
-
85
- If Claude's 5h pool is nearly exhausted, route to Codex instead of stalling, and
86
- mention the switch. The `/usage` bar shows remaining quota for every account.
1
+ ---
2
+ name: model-routing
3
+ description: Choose the right model for a task or workflow stage using live benchmark data. Use when delegating work to subagents, authoring or running inline workflows, or whenever deciding which model should handle a task.
4
+ ---
5
+
6
+ # Model routing
7
+
8
+ Do not guess model quality and do not rely on fixed `small`/`medium`/`big`
9
+ profiles. Those profiles have been removed from this machine. Pick a model per
10
+ task from live data.
11
+
12
+ ## 1. Read the catalogue first
13
+
14
+ Call the `list_models` tool before delegating work:
15
+
16
+ ```
17
+ list_models(sort_by: "coding", limit: 15)
18
+ list_models(sort_by: "cost_efficiency", provider: "openai-codex")
19
+ list_models(query: "opus", detail: "full")
20
+ ```
21
+
22
+ It returns, per model:
23
+
24
+ - Artificial Analysis Intelligence, Coding and Math indices
25
+ - Terminal-Bench Hard, Terminal-Bench 2.1, τ²-bench, τ-bench Banking
26
+ - LiveCodeBench, SciCode, GPQA Diamond, HLE, MMLU-Pro, IFBench, AIME, MATH-500,
27
+ long-context reasoning
28
+ - price per 1M input/output/blended tokens, throughput, time to first token
29
+ - cost-efficiency ratios (score per dollar)
30
+ - `billing` (`sub` or `paid`) and remaining subscription quota
31
+ - `conf`: `measured`, `inferred`, or `unrated`
32
+
33
+ ## 2. Match the metric to the task
34
+
35
+ | Task | Rank by |
36
+ |---|---|
37
+ | Agentic coding, terminal work, multi-step edits | Terminal-Bench Hard, then Coding Index |
38
+ | Tool-calling reliability | τ²-bench |
39
+ | Algorithmic code generation | LiveCodeBench, SciCode |
40
+ | Research, analysis, hard reasoning | GPQA, HLE, Intelligence Index |
41
+ | Long document or repo-wide reasoning | long-context reasoning, context window |
42
+ | Bulk or throwaway fan-out | cost efficiency and tok/s |
43
+
44
+ ## 3. Respect billing policy
45
+
46
+ - Subscription models (`anthropic/*`, `openai-codex/*`) are free to use. Prefer
47
+ them, and prefer accounts with quota remaining.
48
+ - Metered models (`openrouter/*`, `google/*`, `openai/*`, `xai/*`) are blocked at
49
+ the provider boundary until the user runs `/model-approve <provider>`. If a
50
+ call is blocked, switch to a subscription model or ask the user; never retry
51
+ in a loop.
52
+ - Check `/model-policy` for the current spend ceiling.
53
+
54
+ ## 4. Use explicit models in workflows
55
+
56
+ In inline workflow scripts pass `model` on each `agent()` call:
57
+
58
+ ```ts
59
+ const findings = await parallel([
60
+ () => agent(prompt, { model: "openai-codex/gpt-5.6-terra", schema: Finding }),
61
+ () => agent(prompt, { model: "anthropic/claude-sonnet-5", schema: Finding }),
62
+ ]);
63
+
64
+ const synthesis = await agent(summaryPrompt, {
65
+ model: "anthropic/claude-opus-5",
66
+ thinkingLevel: "high",
67
+ });
68
+ ```
69
+
70
+ Rules:
71
+
72
+ - Always use the full `provider/id` form.
73
+ - Give cheap, fast, high-throughput models the wide fan-out stages.
74
+ - Give the strongest agentic model the synthesis, planning and patch-writing
75
+ stages.
76
+ - Thinking level changes measured quality: `list_models` scores resolve per
77
+ effort level where Artificial Analysis publishes them, so raise
78
+ `thinkingLevel` when a stage is hard rather than switching to a costlier model
79
+ by default.
80
+ - If a model is `unrated`, say so before using it for important work, and prefer
81
+ a `measured` alternative of similar cost.
82
+
83
+ ## 5. Quota awareness
84
+
85
+ If Claude's 5h pool is nearly exhausted, route to Codex instead of stalling, and
86
+ mention the switch. The `/usage` bar shows remaining quota for every account.
@@ -1,10 +1,10 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800">
3
- <!-- Original Pi logo paths, unchanged -->
4
- <path fill="#F09082" d="M165.29 165.29H517.36V400H400V282.65H165.29Z"/>
5
- <path fill="#4D9ABF" d="M165.29 282.65H282.65V400H400V517.36H282.65V634.72H165.29Z"/>
6
- <path fill="#F1BE58" d="M517.36 400H634.72V634.72H517.36Z"/>
7
-
8
- <!-- Plus mark, matching the logo's square/pixel geometry -->
9
- <path fill="#F09082" d="M697.84 223.97H736.96V263.09H776.08V302.21H736.96V341.33H697.84V302.21H658.72V263.09H697.84Z"/>
10
- </svg>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800">
3
+ <!-- Original Pi logo paths, unchanged -->
4
+ <path fill="#F09082" d="M165.29 165.29H517.36V400H400V282.65H165.29Z"/>
5
+ <path fill="#4D9ABF" d="M165.29 282.65H282.65V400H400V517.36H282.65V634.72H165.29Z"/>
6
+ <path fill="#F1BE58" d="M517.36 400H634.72V634.72H517.36Z"/>
7
+
8
+ <!-- Plus mark, matching the logo's square/pixel geometry -->
9
+ <path fill="#F09082" d="M697.84 223.97H736.96V263.09H776.08V302.21H736.96V341.33H697.84V302.21H658.72V263.09H697.84Z"/>
10
+ </svg>
Binary file
package/package.json CHANGED
@@ -1,67 +1,67 @@
1
- {
2
- "name": "@jameslovespancakes/pi-plus",
3
- "version": "1.0.0",
4
- "type": "module",
5
- "description": "Consolidated pi extensions: Claude subscription accounts and quota HUD, benchmark-driven model catalog and billing policy, live agent board, and capacity-gated remote test workers.",
6
- "license": "MIT",
7
- "author": "james",
8
- "keywords": [
9
- "pi-package",
10
- "pi",
11
- "extensions",
12
- "anthropic",
13
- "claude",
14
- "quota",
15
- "models"
16
- ],
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/jameslovespancakes/pi-plus.git"
20
- },
21
- "homepage": "https://github.com/jameslovespancakes/pi-plus#readme",
22
- "bugs": {
23
- "url": "https://github.com/jameslovespancakes/pi-plus/issues"
24
- },
25
- "files": [
26
- "src",
27
- "server",
28
- "config/skills",
29
- "config/pi-plus.example.json",
30
- "images",
31
- "README.md",
32
- "LICENSE"
33
- ],
34
- "pi": {
35
- "extensions": [
36
- "./src/domains/setup/index.ts",
37
- "./src/domains/subscriptions/index.ts",
38
- "./src/domains/models/index.ts",
39
- "./src/domains/agents/index.ts",
40
- "./src/domains/remote/index.ts"
41
- ],
42
- "skills": [
43
- "./config/skills"
44
- ]
45
- },
46
- "dependencies": {
47
- "ws": "^8.18.3"
48
- },
49
- "peerDependencies": {
50
- "@earendil-works/pi-agent-core": "*",
51
- "@earendil-works/pi-ai": "*",
52
- "@earendil-works/pi-coding-agent": "*",
53
- "@earendil-works/pi-tui": "*",
54
- "typebox": "*"
55
- },
56
- "scripts": {
57
- "lint": "oxlint",
58
- "lint:fix": "oxlint --fix",
59
- "typecheck": "tsc -p tsconfig.json",
60
- "test": "node --test \"tests/*.test.ts\"",
61
- "verify": "npm run lint && npm run typecheck && npm test",
62
- "version:next": "node scripts/bump-version.mjs --dry-run"
63
- },
64
- "devDependencies": {
65
- "oxlint": "^1.83.0"
66
- }
67
- }
1
+ {
2
+ "name": "@jameslovespancakes/pi-plus",
3
+ "version": "1.0.2",
4
+ "type": "module",
5
+ "description": "Consolidated pi extensions: Claude subscription accounts and quota HUD, benchmark-driven model catalog and billing policy, live agent board, and capacity-gated remote test workers.",
6
+ "license": "MIT",
7
+ "author": "james",
8
+ "keywords": [
9
+ "pi-package",
10
+ "pi",
11
+ "extensions",
12
+ "anthropic",
13
+ "claude",
14
+ "quota",
15
+ "models"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/jameslovespancakes/pi-plus.git"
20
+ },
21
+ "homepage": "https://github.com/jameslovespancakes/pi-plus#readme",
22
+ "bugs": {
23
+ "url": "https://github.com/jameslovespancakes/pi-plus/issues"
24
+ },
25
+ "files": [
26
+ "src",
27
+ "server",
28
+ "config/skills",
29
+ "config/pi-plus.example.json",
30
+ "images",
31
+ "README.md",
32
+ "LICENSE"
33
+ ],
34
+ "pi": {
35
+ "extensions": [
36
+ "./src/domains/setup/index.ts",
37
+ "./src/domains/subscriptions/index.ts",
38
+ "./src/domains/models/index.ts",
39
+ "./src/domains/agents/index.ts",
40
+ "./src/domains/remote/index.ts"
41
+ ],
42
+ "skills": [
43
+ "./config/skills"
44
+ ]
45
+ },
46
+ "dependencies": {
47
+ "ws": "^8.18.3"
48
+ },
49
+ "peerDependencies": {
50
+ "@earendil-works/pi-agent-core": "*",
51
+ "@earendil-works/pi-ai": "*",
52
+ "@earendil-works/pi-coding-agent": "*",
53
+ "@earendil-works/pi-tui": "*",
54
+ "typebox": "*"
55
+ },
56
+ "scripts": {
57
+ "lint": "oxlint",
58
+ "lint:fix": "oxlint --fix",
59
+ "typecheck": "tsc -p tsconfig.json",
60
+ "test": "node --test \"tests/*.test.ts\"",
61
+ "verify": "npm run lint && npm run typecheck && npm test",
62
+ "version:next": "node scripts/bump-version.mjs --dry-run"
63
+ },
64
+ "devDependencies": {
65
+ "oxlint": "^1.83.0"
66
+ }
67
+ }