@henryqw/pi-task-models 1.0.1 → 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 (2) hide show
  1. package/README.md +13 -18
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -38,7 +38,7 @@ Package also exports config and route-resolution helpers for consumers.
38
38
 
39
39
  ## Config
40
40
 
41
- `~/.pi/agent/config/pi-task-models.json`
41
+ 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
42
 
43
43
  ```json
44
44
  {
@@ -68,24 +68,19 @@ Package also exports config and route-resolution helpers for consumers.
68
68
  }
69
69
  ```
70
70
 
71
- Each configured profile needs one primary model and thinking level. Fallback is optional. Model references use canonical `provider/model`; numbered `openai-codex-N` routes store as `openai-codex/model`.
71
+ | Field | Required | Possible values | Default |
72
+ | --- | --- | --- | --- |
73
+ | `profiles` | No | Object keyed by `fast`, `balanced`, `frontier`, `fav`; unknown profile names are rejected | `{}` (no profiles configured) |
74
+ | `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 | — |
75
+ | `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 | — |
76
+ | `profiles.<profile>.fallback` | No | When present, requires both `model` and `thinkingLevel` with the corresponding `primary.*` values; not allowed for `fav` | Omitted |
77
+ | `tasks` | No | Object mapping task IDs (`<package>/<task>`) to a profile name | Built-in defaults listed in the example above |
78
+ | `tasks.<taskId>` | Value required if the key is present | `fast`, `balanced`, `frontier`, `fav` | The built-in default for that task, if any |
72
79
 
73
- Profile thinking is authoritative for task routes.
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.
80
+ 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
81
 
79
- ## Remove
82
+ 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
83
 
81
- ```bash
82
- pi remove npm:@henryqw/pi-task-models
83
- ```
84
-
85
- ## Development
84
+ Profile thinking is authoritative for task routes.
86
85
 
87
- ```bash
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
- ```
86
+ 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-task-models",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Shared task model profiles and routing for HenryQW Pi extensions.",
5
5
  "keywords": [
6
6
  "pi-package",