@henryqw/pi-task-models 3.0.1 → 3.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 +34 -13
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # `@henryqw/pi-task-models`
2
2
 
3
- Shared `fast`, `balanced`, `frontier`, and `fav` model profiles plus routing for consumer-owned Model Tasks.
3
+ Choose shared `fast`, `balanced`, `frontier`, and `fav` model profiles for consumer-owned Model Tasks.
4
4
 
5
5
  ## Why
6
6
 
7
- - **Created for**: Deduplicating model pickers and catalogs that each extension previously owned separately.
7
+ - **Created for**: Remove duplicated model pickers and catalogs that extensions once owned separately.
8
8
  - **Advantage**: One shared profile control plane keeps routes consistent while each consumer owns its task identity, intent, and default profile.
9
9
 
10
10
  ## Install
@@ -20,24 +20,35 @@ pi install npm:@henryqw/pi-task-models
20
20
  | `@henryqw/pi-auto-compact` | Consumer. Its local compaction task defaults to `fast`. |
21
21
  | `@henryqw/pi-herdr-btw` | Consumer. Its local side-thread task defaults to `fast`. |
22
22
  | `@henryqw/pi-herdr-rename` | Consumer. Its local rename task defaults to `fast`. |
23
- | `@henryqw/pi-subagent` | Consumer. Its local delegation task defaults to `fast`; callers can declare their own task. |
23
+ | `@henryqw/pi-memory` | Consumer. Its local candidate-review task defaults to `balanced`. |
24
24
  | `@henryqw/pi-multi-codex` | Improves. Numbered Codex slots dedupe to one route. |
25
+ | `@henryqw/pi-subagent` | Consumer. Its local delegation task defaults to `fast`; callers can declare their own task. |
25
26
 
26
27
  ## Use
27
28
 
28
- | Surface | Type | Purpose |
29
- | --- | --- | --- |
30
- | `/task-models` | command | Edit a profile or override an active task's default profile. |
29
+ Use `/task-models` to select a profile or override an active task's default profile.
30
+
31
+ ### Profile selection
32
+
33
+ Selecting a profile sets its primary model, primary thinking, optional fallback model, and fallback thinking. One completed flow writes the whole profile.
34
+
35
+ Selecting an active task sets its explicit override. Choosing its consumer-declared default removes that override.
36
+
37
+ ### Active declarations
38
+
39
+ Consumers register declarations at extension load. When `/task-models` opens, the shared control plane asks active extensions for declarations. Extension load order does not matter.
31
40
 
32
- Selecting a profile sets primary model, primary thinking, optional fallback model, then fallback thinking. One completed flow writes the whole profile. Selecting an active task sets its explicit override; choosing its consumer-declared default removes that override.
41
+ The control plane lists each active task's effective profile. Hidden explicit assignments stay stored when a consumer is disabled.
33
42
 
34
- Consumers register their declarations at extension load. The one shared control plane asks active extensions for declarations when `/task-models` opens, so extension load order does not matter. It lists each active task's effective profile. Hidden explicit assignments stay stored when a consumer is disabled.
43
+ ### Scoped models, aliases, and fallback
35
44
 
36
- Menus and resolution use the current session's `ctx.scopedModels`, including pinned thinking. Empty scope uses Pi's full available model registry. Numbered Codex account aliases are deduplicated. Fallback choices exclude the selected primary. BTW selects the first authenticated viable route before pane launch.
45
+ Menus and resolution use the current session's `ctx.scopedModels`, including pinned thinking. An empty scope uses Pi's full available model registry. Numbered Codex account aliases are deduplicated.
46
+
47
+ Fallback choices exclude the selected primary. BTW selects the first authenticated viable route before pane launch.
37
48
 
38
49
  ## Config
39
50
 
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.
51
+ The single shared JSON file is 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.
41
52
 
42
53
  ```json
43
54
  {
@@ -71,8 +82,18 @@ Single shared JSON file at the exact package-owned path `~/.pi/agent/config/pi-t
71
82
  | `tasks` | No | Object mapping task IDs (`<package>/<task>`) to explicit user profile overrides | `{}` |
72
83
  | `tasks.<taskId>` | Value required if the key is present | `fast`, `balanced`, `frontier`, `fav` | That task declaration's `defaultProfile` |
73
84
 
74
- Task defaults live only in consumer declarations. Existing explicit assignments, including one equal to a declaration's default, remain valid. 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>`.
85
+ Pi's model registry, including session-scoped models, is the source of available models at resolution. This file does not contain a model catalog.
86
+
87
+ Task defaults live only in consumer declarations. Existing explicit assignments, including one equal to a declaration's default, remain valid.
88
+
89
+ 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>`.
90
+
91
+ Reads are strict. A missing file yields `{ "profiles": {}, "tasks": {} }`.
92
+
93
+ Malformed JSON, unknown keys, invalid task IDs, unknown profiles, or invalid profile or route values fail visibly with `/task-models` guidance. The file is never rewritten.
94
+
95
+ ## For extension authors
75
96
 
76
- Reads are strict. A missing file yields `{ "profiles": {}, "tasks": {} }`; 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.
97
+ A `ModelTask` is a consumer-owned independently executed model operation. Consumers define a `ModelTask` and call `registerModelTask(pi, task)` at extension load.
77
98
 
78
- Profile thinking is authoritative for task routes. Consumers define a `ModelTask`, call `registerModelTask(pi, task)` at extension load, then call `resolveConfiguredTaskRoute(ctx, task)` or `resolveConfiguredTaskRoutes(ctx, task)`. Resolution uses `config.tasks[task.id] ?? task.defaultProfile`.
99
+ Use `resolveConfiguredTaskRoute(ctx, task)` or `resolveConfiguredTaskRoutes(ctx, task)` to resolve routes. Profile thinking is authoritative for task routes. Resolution uses `config.tasks[task.id] ?? task.defaultProfile`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-task-models",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Shared task model profiles and routing for HenryQW Pi extensions.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -14,11 +14,11 @@
14
14
  },
15
15
  "license": "MIT",
16
16
  "files": [
17
+ "LICENSE",
17
18
  "dist",
18
19
  "extensions",
19
20
  "README.md",
20
- "CONTEXT.md",
21
- "LICENSE"
21
+ "CONTEXT.md"
22
22
  ],
23
23
  "types": "./dist/index.d.ts",
24
24
  "exports": {