@henryqw/pi-task-models 1.0.1 → 1.0.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/README.md +14 -22
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,7 +18,6 @@ pi install npm:@henryqw/pi-task-models
|
|
|
18
18
|
| Package | Why |
|
|
19
19
|
| --- | --- |
|
|
20
20
|
| `@henryqw/pi-auto-compact` | Consumer. Compaction defaults to the `fast` profile. |
|
|
21
|
-
| `@henryqw/pi-auto-dag` | Consumer. Implement uses `balanced`; review uses `frontier`. |
|
|
22
21
|
| `@henryqw/pi-herdr-btw` | Consumer. Side-thread launch uses the `fast` profile. |
|
|
23
22
|
| `@henryqw/pi-herdr-rename` | Consumer. Rename uses the `fast` profile. |
|
|
24
23
|
| `@henryqw/pi-subagent` | Consumer. Delegation defaults to `balanced`; caller may override it. |
|
|
@@ -38,7 +37,7 @@ Package also exports config and route-resolution helpers for consumers.
|
|
|
38
37
|
|
|
39
38
|
## Config
|
|
40
39
|
|
|
41
|
-
`~/.pi/agent/config/pi-task-models.json`
|
|
40
|
+
Single shared JSON file at the exact package-owned path `~/.pi/agent/config/pi-task-models.json`. Consumers read it but never write it; only explicit `/task-models` actions save it.
|
|
42
41
|
|
|
43
42
|
```json
|
|
44
43
|
{
|
|
@@ -61,31 +60,24 @@ Package also exports config and route-resolution helpers for consumers.
|
|
|
61
60
|
"pi-herdr-btw/btw": "fast",
|
|
62
61
|
"pi-herdr-rename/rename": "fast",
|
|
63
62
|
"pi-auto-compact/autoCompact": "fast",
|
|
64
|
-
"pi-subagent/delegateTask": "balanced"
|
|
65
|
-
"pi-auto-dag/implement": "balanced",
|
|
66
|
-
"pi-auto-dag/review": "frontier"
|
|
63
|
+
"pi-subagent/delegateTask": "balanced"
|
|
67
64
|
}
|
|
68
65
|
}
|
|
69
66
|
```
|
|
70
67
|
|
|
71
|
-
|
|
68
|
+
| Field | Required | Possible values | Default |
|
|
69
|
+
| --- | --- | --- | --- |
|
|
70
|
+
| `profiles` | No | Object keyed by `fast`, `balanced`, `frontier`, `fav`; unknown profile names are rejected | `{}` (no profiles configured) |
|
|
71
|
+
| `profiles.<profile>.primary.model` | Yes within a configured profile's `primary` | Canonical `provider/model` reference without whitespace or NUL; available models come from Pi's model registry (or session-scoped models) at resolution time, not from this file | — |
|
|
72
|
+
| `profiles.<profile>.primary.thinkingLevel` | Yes within a configured profile's `primary` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`; the model must support the level when the route resolves | — |
|
|
73
|
+
| `profiles.<profile>.fallback` | No | When present, requires both `model` and `thinkingLevel` with the corresponding `primary.*` values; not allowed for `fav` | Omitted |
|
|
74
|
+
| `tasks` | No | Object mapping task IDs (`<package>/<task>`) to a profile name | Built-in defaults listed in the example above |
|
|
75
|
+
| `tasks.<taskId>` | Value required if the key is present | `fast`, `balanced`, `frontier`, `fav` | The built-in default for that task, if any |
|
|
72
76
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
Reads are strict. Malformed or unknown values fail visibly and never rewrite the file. Only explicit `/task-models` actions write config.
|
|
76
|
-
|
|
77
|
-
Consumers can call `resolveConfiguredTaskRoute(ctx, taskId)` for the first usable route or `resolveConfiguredTaskRoutes(ctx, taskId)` for primary and fallback routes. Both read strict shared config and fail with `/task-models` guidance when assignment, profile, or route is unavailable.
|
|
77
|
+
Model references use canonical `provider/model`; numbered Codex account aliases (`openai-codex-N`) resolve through Pi's registry and store canonically as `openai-codex/<model>`.
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
Reads are strict. A missing file yields no profiles and the built-in default task assignments; malformed JSON, unknown keys, invalid task IDs, unknown profiles, or invalid profile or route values fail visibly with `/task-models` guidance and never rewrite the file.
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
pi remove npm:@henryqw/pi-task-models
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
## Development
|
|
81
|
+
Profile thinking is authoritative for task routes.
|
|
86
82
|
|
|
87
|
-
|
|
88
|
-
npm test --workspace @henryqw/pi-task-models
|
|
89
|
-
npm run typecheck --workspace @henryqw/pi-task-models
|
|
90
|
-
npm run pack:check --workspace @henryqw/pi-task-models
|
|
91
|
-
```
|
|
83
|
+
Consumers can call `resolveConfiguredTaskRoute(ctx, taskId)` for the first usable route or `resolveConfiguredTaskRoutes(ctx, taskId)` for primary and fallback routes. Both read strict shared config and fail with `/task-models` guidance when assignment, profile, or route is unavailable.
|
package/dist/index.d.ts
CHANGED
|
@@ -8,8 +8,6 @@ export declare const DEFAULT_TASK_ASSIGNMENTS: {
|
|
|
8
8
|
readonly "pi-herdr-rename/rename": "fast";
|
|
9
9
|
readonly "pi-auto-compact/autoCompact": "fast";
|
|
10
10
|
readonly "pi-subagent/delegateTask": "balanced";
|
|
11
|
-
readonly "pi-auto-dag/implement": "balanced";
|
|
12
|
-
readonly "pi-auto-dag/review": "frontier";
|
|
13
11
|
};
|
|
14
12
|
export type TaskModelRoute = {
|
|
15
13
|
model: string;
|
package/dist/index.js
CHANGED
|
@@ -9,8 +9,6 @@ export const DEFAULT_TASK_ASSIGNMENTS = {
|
|
|
9
9
|
"pi-herdr-rename/rename": "fast",
|
|
10
10
|
"pi-auto-compact/autoCompact": "fast",
|
|
11
11
|
"pi-subagent/delegateTask": "balanced",
|
|
12
|
-
"pi-auto-dag/implement": "balanced",
|
|
13
|
-
"pi-auto-dag/review": "frontier",
|
|
14
12
|
};
|
|
15
13
|
const CODEX_ALIAS = /^openai-codex-(?:[2-9]|[1-9]\d+)$/;
|
|
16
14
|
const CONFIG_FILE = "pi-task-models.json";
|