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 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
@@ -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 || modelId.includes("/")) return [];
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-prompt-template-model",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "type": "module",
5
5
  "description": "Prompt template model selector extension for pi coding agent",
6
6
  "author": "Nico Bailon",
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 segments = spec.split("/");
154
- if (segments.length === 1) return true;
155
- if (segments.length !== 2) return false;
156
- return segments[0].length > 0 && segments[1].length > 0;
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(
@@ -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 segments = spec.split("/");
51
- if (segments.length === 1) return true;
52
- if (segments.length !== 2) return false;
53
- return segments[0].length > 0 && segments[1].length > 0;
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 {