pi-prompt-template-model 0.9.0 → 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 +10 -0
- package/index.ts +2 -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,16 @@
|
|
|
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
|
+
|
|
10
|
+
## [0.9.1] - 2026-04-26
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- `boomerang: true` prompt collapses now signal rewind to keep current files automatically, avoiding the restore-options prompt during collapse.
|
|
14
|
+
|
|
5
15
|
## [0.9.0] - 2026-04-25
|
|
6
16
|
|
|
7
17
|
### Added
|
package/index.ts
CHANGED
|
@@ -938,9 +938,11 @@ export default function promptModelExtension(pi: ExtensionAPI) {
|
|
|
938
938
|
|
|
939
939
|
boomerangCollapse = { targetId, task: name, previousSummaries };
|
|
940
940
|
try {
|
|
941
|
+
(globalThis as typeof globalThis & { __boomerangCollapseInProgress?: boolean }).__boomerangCollapseInProgress = true;
|
|
941
942
|
const result = await ctx.navigateTree(targetId, { summarize: true });
|
|
942
943
|
if (result.cancelled) notify(ctx, `Boomerang cancelled for prompt \`${name}\``, "warning");
|
|
943
944
|
} finally {
|
|
945
|
+
(globalThis as typeof globalThis & { __boomerangCollapseInProgress?: boolean }).__boomerangCollapseInProgress = false;
|
|
944
946
|
boomerangCollapse = null;
|
|
945
947
|
}
|
|
946
948
|
}
|
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 {
|