@henryqw/pi-task-models 0.7.3 → 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 +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -15
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ Package also exports config and route-resolution helpers for consumers.
|
|
|
70
70
|
|
|
71
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`.
|
|
72
72
|
|
|
73
|
-
Profile thinking is authoritative for task routes.
|
|
73
|
+
Profile thinking is authoritative for task routes.
|
|
74
74
|
|
|
75
75
|
Reads are strict. Malformed or unknown values fail visibly and never rewrite the file. Only explicit `/task-models` actions write config.
|
|
76
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.
|
|
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.
|
|
39
|
-
"@earendil-works/pi-coding-agent": "^0.84.
|
|
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",
|