@henryqw/pi-task-models 0.1.2 → 0.3.0

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/CONTEXT.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Pi Task Models
2
2
 
3
- Pi Task Models stores shared task profiles and task-to-profile assignments for HenryQW extensions.
3
+ Pi Task Models stores shared task profiles and task-to-profile assignments for HenryQW extensions, including default Subagent effort.
4
4
 
5
5
  ## Language
6
6
 
package/README.md CHANGED
@@ -12,9 +12,10 @@ pi install npm:@henryqw/pi-task-models
12
12
 
13
13
  | Package | Why |
14
14
  | --- | --- |
15
- | `@henryqw/pi-auto-compact` | Consumer. Compaction uses the `balanced` profile. |
15
+ | `@henryqw/pi-auto-compact` | Consumer. Compaction defaults to the `fast` profile. |
16
+ | `@henryqw/pi-auto-dag` | Consumer. Implement uses `balanced`; review uses `frontier`. |
16
17
  | `@henryqw/pi-herdr-rename` | Consumer. Rename uses the `fast` profile. |
17
- | `@henryqw/pi-subagent` | Consumer. Caller picks `fast`, `balanced`, or `frontier`. |
18
+ | `@henryqw/pi-subagent` | Consumer. Delegation defaults to `balanced`; caller may override it. |
18
19
  | `@henryqw/pi-multi-codex` | Improves. Numbered Codex slots dedupe to one route. |
19
20
 
20
21
  ## Use
@@ -49,7 +50,10 @@ Package also exports config and route-resolution helpers for consumers.
49
50
  },
50
51
  "tasks": {
51
52
  "pi-herdr-rename/rename": "fast",
52
- "pi-auto-compact/autoCompact": "balanced"
53
+ "pi-auto-compact/autoCompact": "fast",
54
+ "pi-subagent/delegateTask": "balanced",
55
+ "pi-auto-dag/implement": "balanced",
56
+ "pi-auto-dag/review": "frontier"
53
57
  }
54
58
  }
55
59
  ```
@@ -58,6 +62,8 @@ Each configured profile needs one primary model and thinking level. Fallback is
58
62
 
59
63
  Reads are strict. Malformed or unknown values fail visibly and never rewrite the file. Only explicit `/task-models` actions write config.
60
64
 
65
+ Consumers can call `resolveConfiguredTaskRoute(ctx, taskId)` to read strict shared config, choose usable primary or fallback route, and fail with `/task-models` guidance when assignment, profile, or route is unavailable.
66
+
61
67
  ## Remove
62
68
 
63
69
  ```bash
package/dist/index.d.ts CHANGED
@@ -5,7 +5,10 @@ export declare const THINKING_LEVELS: readonly ["off", "minimal", "low", "medium
5
5
  export type ThinkingLevel = (typeof THINKING_LEVELS)[number];
6
6
  export declare const DEFAULT_TASK_ASSIGNMENTS: {
7
7
  readonly "pi-herdr-rename/rename": "fast";
8
- readonly "pi-auto-compact/autoCompact": "balanced";
8
+ readonly "pi-auto-compact/autoCompact": "fast";
9
+ readonly "pi-subagent/delegateTask": "balanced";
10
+ readonly "pi-auto-dag/implement": "balanced";
11
+ readonly "pi-auto-dag/review": "frontier";
9
12
  };
10
13
  export type TaskModelRoute = {
11
14
  model: string;
@@ -45,6 +48,7 @@ export declare function supportedThinkingLevels(model: AvailableModel): Thinking
45
48
  export declare function availableTaskModels(ctx: ExtensionContext): AvailableModel[];
46
49
  export declare function taskThinkingLevels(ctx: ExtensionContext, model: AvailableModel): ThinkingLevel[];
47
50
  export declare function resolveTaskModelRoute(ctx: ExtensionContext, route: TaskModelRoute): ResolvedTaskRoute | undefined;
51
+ export declare function resolveConfiguredTaskRoute(ctx: ExtensionContext, task: string, agentDir?: string): ResolvedTaskRoute;
48
52
  export declare function orderedProfileRoutes(profile: TaskModelProfile): TaskModelRoute[];
49
53
  export declare function activeTaskPackages(pi: Pick<ExtensionAPI, "getCommands" | "getAllTools">, tasks?: Readonly<Record<string, ProfileName>>): ActiveTaskPackage[];
50
54
  export declare function createTaskModelsExtension(pi: ExtensionAPI, options?: {
package/dist/index.js CHANGED
@@ -6,7 +6,10 @@ export const PROFILE_NAMES = ["fast", "balanced", "frontier"];
6
6
  export const THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
7
7
  export const DEFAULT_TASK_ASSIGNMENTS = {
8
8
  "pi-herdr-rename/rename": "fast",
9
- "pi-auto-compact/autoCompact": "balanced",
9
+ "pi-auto-compact/autoCompact": "fast",
10
+ "pi-subagent/delegateTask": "balanced",
11
+ "pi-auto-dag/implement": "balanced",
12
+ "pi-auto-dag/review": "frontier",
10
13
  };
11
14
  const CODEX_ALIAS = /^openai-codex-(?:[2-9]|[1-9]\d+)$/;
12
15
  const CONFIG_FILE = "pi-task-models.json";
@@ -189,6 +192,27 @@ export function resolveTaskModelRoute(ctx, route) {
189
192
  ? { model, thinkingLevel: route.thinkingLevel }
190
193
  : undefined;
191
194
  }
195
+ export function resolveConfiguredTaskRoute(ctx, task, agentDir = getAgentDir()) {
196
+ let config;
197
+ try {
198
+ config = readTaskModelsConfig(agentDir);
199
+ }
200
+ catch {
201
+ throw new Error("Couldn't read task model config. Run /task-models.");
202
+ }
203
+ const profileName = config.tasks[task];
204
+ if (!profileName)
205
+ throw new Error(`Task ${task} is not assigned to a profile. Run /task-models.`);
206
+ const profile = config.profiles[profileName];
207
+ if (!profile)
208
+ throw new Error(`Task ${task} profile ${profileName} is not configured. Run /task-models.`);
209
+ for (const route of orderedProfileRoutes(profile)) {
210
+ const resolved = resolveTaskModelRoute(ctx, route);
211
+ if (resolved)
212
+ return resolved;
213
+ }
214
+ throw new Error(`Task ${task} profile ${profileName} has no available route. Run /task-models.`);
215
+ }
192
216
  export function orderedProfileRoutes(profile) {
193
217
  return profile.fallback ? [profile.primary, profile.fallback] : [profile.primary];
194
218
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-task-models",
3
- "version": "0.1.2",
3
+ "version": "0.3.0",
4
4
  "description": "Shared task model profiles and routing for HenryQW Pi extensions.",
5
5
  "keywords": [
6
6
  "pi-package",