@henryqw/pi-task-models 0.7.2 → 1.0.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/README.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  Shared `fast`, `balanced`, `frontier`, and `fav` model profiles for HenryQW Pi extensions.
4
4
 
5
+ ## Why
6
+
7
+ - **Created for**: Deduplicating model pickers and catalogs that each extension previously owned separately.
8
+ - **Advantage**: One shared source of `fast`/`balanced`/`frontier`/`fav` profiles keeps routing consistent across consumers.
9
+
5
10
  ## Install
6
11
 
7
12
  ```bash
@@ -65,7 +70,7 @@ Package also exports config and route-resolution helpers for consumers.
65
70
 
66
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`.
67
72
 
68
- Profile thinking is authoritative for task routes. `pi-model-thinking.json` affects only active-session model selection and never overrides a task route.
73
+ Profile thinking is authoritative for task routes.
69
74
 
70
75
  Reads are strict. Malformed or unknown values fail visibly and never rewrite the file. Only explicit `/task-models` actions write config.
71
76
 
package/dist/index.d.ts CHANGED
@@ -48,10 +48,6 @@ export declare function resolveAvailableModel(models: readonly AvailableModel[],
48
48
  export declare function supportedThinkingLevels(model: AvailableModel): ThinkingLevel[];
49
49
  export declare function availableTaskModels(ctx: ExtensionContext): AvailableModel[];
50
50
  export declare function taskThinkingLevels(ctx: ExtensionContext, model: AvailableModel): ThinkingLevel[];
51
- export declare function rememberedThinkingLevel(model: {
52
- provider: string;
53
- id: string;
54
- } | string, agentDir?: string): ThinkingLevel | undefined;
55
51
  export declare function resolveTaskModelRoute(ctx: ExtensionContext, route: TaskModelRoute, agentDir?: string, thinking?: ThinkingLevel): ResolvedTaskRoute | undefined;
56
52
  export declare function resolveConfiguredTaskRoutes(ctx: ExtensionContext, task: string, agentDir?: string, thinking?: ThinkingLevel): ResolvedTaskRoute[];
57
53
  export type TaskRouteErrorCode = "config-read" | "task-unassigned" | "profile-missing" | "no-route";
package/dist/index.js CHANGED
@@ -14,8 +14,6 @@ export const DEFAULT_TASK_ASSIGNMENTS = {
14
14
  };
15
15
  const CODEX_ALIAS = /^openai-codex-(?:[2-9]|[1-9]\d+)$/;
16
16
  const CONFIG_FILE = "pi-task-models.json";
17
- // Owned by @henryqw/pi-model-thinking; keys use the same canonical provider/model form.
18
- const MODEL_THINKING_CONFIG_FILE = "pi-model-thinking.json";
19
17
  const defaultTaskAssignments = () => ({ ...DEFAULT_TASK_ASSIGNMENTS });
20
18
  export const configPath = (agentDir = getAgentDir()) => join(agentDir, "config", CONFIG_FILE);
21
19
  function isCodexProvider(provider) {
@@ -193,19 +191,6 @@ export function taskThinkingLevels(ctx, model) {
193
191
  return supported;
194
192
  return supported.includes(pinned) ? [pinned] : [];
195
193
  }
196
- // pi-model-thinking's config is untrusted user data; keep only recognized levels for this model.
197
- export function rememberedThinkingLevel(model, agentDir = getAgentDir()) {
198
- try {
199
- const value = JSON.parse(readFileSync(join(agentDir, "config", MODEL_THINKING_CONFIG_FILE), "utf8"));
200
- if (!value || typeof value !== "object" || Array.isArray(value))
201
- return undefined;
202
- const level = value[canonicalModelReference(model)];
203
- return isThinkingLevel(level) ? level : undefined;
204
- }
205
- catch {
206
- return undefined;
207
- }
208
- }
209
194
  export function resolveTaskModelRoute(ctx, route, agentDir = getAgentDir(), thinking) {
210
195
  const model = resolveAvailableModel(availableTaskModels(ctx), route.model, ctx.model?.provider);
211
196
  if (!model)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-task-models",
3
- "version": "0.7.2",
3
+ "version": "1.0.0",
4
4
  "description": "Shared task model profiles and routing for HenryQW Pi extensions.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -35,8 +35,8 @@
35
35
  "pack:check": "npm pack --dry-run"
36
36
  },
37
37
  "peerDependencies": {
38
- "@earendil-works/pi-ai": "^0.84.2",
39
- "@earendil-works/pi-coding-agent": "^0.84.2"
38
+ "@earendil-works/pi-ai": "^0.84.3",
39
+ "@earendil-works/pi-coding-agent": "^0.84.3"
40
40
  },
41
41
  "repository": {
42
42
  "type": "git",