pi-prompt-template-model 0.9.1 → 0.9.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.
- package/CHANGELOG.md +5 -0
- package/model-selection.ts +2 -1
- package/package.json +1 -1
- package/prompt-loader.ts +7 -4
- package/template-conditionals.ts +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.2] - 2026-04-28
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Prompt templates now accept provider-qualified model IDs that contain additional slashes, such as `openrouter/openai/gpt-5.4`, across prompt loading, model selection, compare lineups, and `<if-model>` conditionals.
|
|
9
|
+
|
|
5
10
|
## [0.9.1] - 2026-04-26
|
|
6
11
|
|
|
7
12
|
### Fixed
|
package/model-selection.ts
CHANGED
|
@@ -68,7 +68,8 @@ function getModelCandidates(modelSpec: string, registry: Pick<RegistryLike, "fin
|
|
|
68
68
|
if (slashIndex !== -1) {
|
|
69
69
|
const provider = modelSpec.slice(0, slashIndex);
|
|
70
70
|
const modelId = modelSpec.slice(slashIndex + 1);
|
|
71
|
-
if (!provider || !modelId
|
|
71
|
+
if (!provider || !modelId) return [];
|
|
72
|
+
if (modelId.split("/").some((segment) => segment.length === 0)) return [];
|
|
72
73
|
const model = registry.find(provider, modelId);
|
|
73
74
|
return model ? [model] : [];
|
|
74
75
|
}
|
package/package.json
CHANGED
package/prompt-loader.ts
CHANGED
|
@@ -150,10 +150,13 @@ function normalizeStringField(
|
|
|
150
150
|
function isValidModelSelectionSpec(spec: string): boolean {
|
|
151
151
|
if (!spec || spec.includes("*") || /\s/.test(spec)) return false;
|
|
152
152
|
|
|
153
|
-
const
|
|
154
|
-
if (
|
|
155
|
-
if (
|
|
156
|
-
|
|
153
|
+
const slashIndex = spec.indexOf("/");
|
|
154
|
+
if (slashIndex === -1) return true;
|
|
155
|
+
if (slashIndex === 0) return false;
|
|
156
|
+
const modelId = spec.slice(slashIndex + 1);
|
|
157
|
+
if (modelId.length === 0) return false;
|
|
158
|
+
if (modelId.split("/").some((segment) => segment.length === 0)) return false;
|
|
159
|
+
return true;
|
|
157
160
|
}
|
|
158
161
|
|
|
159
162
|
function normalizeFrontmatterRecord(
|
package/template-conditionals.ts
CHANGED
|
@@ -47,10 +47,13 @@ function isValidSpec(spec: string): boolean {
|
|
|
47
47
|
return segments.length === 2 && segments[0].length > 0 && segments[1] === "*";
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
if (
|
|
53
|
-
|
|
50
|
+
const slashIndex = spec.indexOf("/");
|
|
51
|
+
if (slashIndex === -1) return true;
|
|
52
|
+
if (slashIndex === 0) return false;
|
|
53
|
+
const modelId = spec.slice(slashIndex + 1);
|
|
54
|
+
if (modelId.length === 0) return false;
|
|
55
|
+
if (modelId.split("/").some((segment) => segment.length === 0)) return false;
|
|
56
|
+
return true;
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
function matchSpec(spec: string, model: ResolvedModelRef): boolean {
|