@d3ara1n/pi-model-roles 0.1.0 → 0.2.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/README.md +16 -9
- package/package.json +2 -1
- package/src/defaults.ts +11 -5
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Model role configuration library for [pi](https://github.com/earendil-works/pi) extensions.
|
|
4
4
|
|
|
5
|
-
Defines named model roles (e.g. "heavy", "fast", "
|
|
5
|
+
Defines named model roles (e.g. "heavy", "fast", "utility") and resolves them to pi `Model` instances with API key and headers.
|
|
6
6
|
|
|
7
7
|
## What it does
|
|
8
8
|
|
|
@@ -24,14 +24,15 @@ Built-in defaults use `model: null` (use pi's current model, don't switch):
|
|
|
24
24
|
|
|
25
25
|
| Role | model | thinking | Description |
|
|
26
26
|
|------|-------|----------|-------------|
|
|
27
|
-
| `default` | null | medium |
|
|
28
|
-
| `heavy` | null | high |
|
|
29
|
-
| `fast` | null |
|
|
27
|
+
| `default` | null | medium | Regular dev tasks: new features, code edits, code review, adding tests, general debugging, single-file changes |
|
|
28
|
+
| `heavy` | null | high | Deep-thinking tasks: cross-file refactoring, architecture design, complex bug debugging, performance optimization, security analysis, DB schema changes, multi-module migrations |
|
|
29
|
+
| `fast` | null | low | Simple deterministic tasks: one-line edits, formatting, simple Q&A, doc lookups, git operations, confirmations |
|
|
30
|
+
| `utility` | null | off | Lightweight utility tasks: routing, commit gen, title summarization |
|
|
30
31
|
|
|
31
32
|
`model: null` means "keep using whatever model pi currently has".
|
|
32
33
|
Only `thinking` level differs between roles by default.
|
|
33
34
|
|
|
34
|
-
Custom roles
|
|
35
|
+
Custom roles can be added freely — any role name works:
|
|
35
36
|
|
|
36
37
|
## Configuration
|
|
37
38
|
|
|
@@ -48,11 +49,10 @@ Override specific roles in `~/.pi/agent/settings.json`:
|
|
|
48
49
|
"model": "google/gemini-2.5-flash",
|
|
49
50
|
"thinking": "off"
|
|
50
51
|
},
|
|
51
|
-
//
|
|
52
|
-
"
|
|
52
|
+
// Lightweight utility tasks (routing, commit generation, etc.)
|
|
53
|
+
"utility": {
|
|
53
54
|
"model": "deepseek/deepseek-v4-flash",
|
|
54
|
-
"thinking": "off"
|
|
55
|
-
"hidden": true
|
|
55
|
+
"thinking": "off"
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"defaultRole": "default"
|
|
@@ -63,6 +63,13 @@ Override specific roles in `~/.pi/agent/settings.json`:
|
|
|
63
63
|
User settings **merge** with built-in defaults: only override roles you want to change.
|
|
64
64
|
You can also add entirely new roles.
|
|
65
65
|
|
|
66
|
+
### Hidden roles
|
|
67
|
+
|
|
68
|
+
Roles with `hidden: true` (like `utility` by default) are excluded from scout's role
|
|
69
|
+
selection list — the side agent won't suggest switching to them. They can still be
|
|
70
|
+
used directly by name (e.g. as `sideAgentRole` in scout config) and resolved via
|
|
71
|
+
`resolveRole()` / `resolveRoleAsync()`.
|
|
72
|
+
|
|
66
73
|
### Role fields
|
|
67
74
|
|
|
68
75
|
| Field | Type | Default | Description |
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d3ara1n/pi-model-roles",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "Model role configuration library for pi extensions — defines named model roles and resolves them to Model instances",
|
|
5
6
|
"main": "src/index.ts",
|
|
6
7
|
"types": "src/types.ts",
|
package/src/defaults.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Built-in default role definitions.
|
|
3
3
|
*
|
|
4
|
-
* Only universal roles are built-in.
|
|
5
|
-
*
|
|
4
|
+
* Only universal roles are built-in. Plugin-specific roles
|
|
5
|
+
* are left for users to define — modelRoles accepts
|
|
6
6
|
* any custom role name.
|
|
7
7
|
*
|
|
8
8
|
* model=null means "use pi's current model, don't switch".
|
|
@@ -13,17 +13,23 @@ import type { RoleConfig } from "./types.ts";
|
|
|
13
13
|
export const BUILTIN_DEFAULT_ROLES: Record<string, RoleConfig> = {
|
|
14
14
|
default: {
|
|
15
15
|
model: null,
|
|
16
|
-
description: "
|
|
16
|
+
description: "General development tasks: writing new features, modifying existing code, code review, adding tests, routine debugging, file-level changes",
|
|
17
17
|
thinking: "medium",
|
|
18
18
|
},
|
|
19
19
|
heavy: {
|
|
20
20
|
model: null,
|
|
21
|
-
description: "
|
|
21
|
+
description: "Tasks requiring deep thinking: cross-file refactoring, architecture design, complex bug debugging, performance optimization, security analysis, database schema changes, multi-module migrations",
|
|
22
22
|
thinking: "high",
|
|
23
23
|
},
|
|
24
24
|
fast: {
|
|
25
25
|
model: null,
|
|
26
|
-
description: "
|
|
26
|
+
description: "Simple deterministic tasks: one-line edits, formatting tweaks, simple Q&A, doc lookups, git operations, confirmation replies",
|
|
27
|
+
thinking: "low",
|
|
28
|
+
},
|
|
29
|
+
utility: {
|
|
30
|
+
model: null,
|
|
31
|
+
description: "Lightweight utilities: model routing, commit generation, title/summary, etc. (hidden)",
|
|
27
32
|
thinking: "off",
|
|
33
|
+
hidden: true,
|
|
28
34
|
},
|
|
29
35
|
};
|