avtc-pi-settings-ui 1.0.5 → 1.0.6
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.
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "avtc-pi-settings-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "A schema-driven settings UI for pi extensions — define your settings, get a tabbed modal, a /<name>:settings command, and layered persistence.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.ts",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"lint:as-never": "node scripts/no-as-never.cjs src/ tests/ index.ts"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"avtc-pi-logger": "^1.0.
|
|
26
|
+
"avtc-pi-logger": "^1.0.3",
|
|
27
27
|
"minimatch": "^10.0.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@biomejs/biome": "^2.5.0",
|
|
31
|
-
"@earendil-works/pi-coding-agent": "^0.80.
|
|
32
|
-
"@earendil-works/pi-tui": "^0.80.
|
|
31
|
+
"@earendil-works/pi-coding-agent": "^0.80.10",
|
|
32
|
+
"@earendil-works/pi-tui": "^0.80.10",
|
|
33
33
|
"@types/node": "^25.9.3",
|
|
34
34
|
"jscpd": "^5.0.10",
|
|
35
35
|
"knip": "^6.17.1",
|
package/src/model-presets.ts
CHANGED
|
@@ -83,12 +83,17 @@ function isEnabled(model: ModelLike, patterns: readonly string[]): boolean {
|
|
|
83
83
|
* enabled-models patterns, each `[modelLabel(model), "provider/id"]`, with `["Default", null]`
|
|
84
84
|
* prepended. When the registry was not captured, or enabled-models patterns are configured but
|
|
85
85
|
* match nothing, the list degrades to `["Default", null]` (the modal still opens).
|
|
86
|
+
*
|
|
87
|
+
* Async because `modelRegistry.refresh()` is async on pi 0.80.8+ (it reloads models.json
|
|
88
|
+
* asynchronously). Awaiting it guarantees the subsequent synchronous `getAvailable()` reads
|
|
89
|
+
* the freshly loaded list rather than a stale one. On older pi (where refresh returned void)
|
|
90
|
+
* `await`-ing a non-promise is a no-op, so this is forward- and backward-compatible.
|
|
86
91
|
*/
|
|
87
|
-
export function resolveModelPresets(): PresetPair[] {
|
|
92
|
+
export async function resolveModelPresets(): Promise<PresetPair[]> {
|
|
88
93
|
const { modelRegistry } = getCapturedCtx();
|
|
89
94
|
if (!modelRegistry) return [DEFAULT_PAIR];
|
|
90
95
|
|
|
91
|
-
modelRegistry.refresh();
|
|
96
|
+
await modelRegistry.refresh();
|
|
92
97
|
const all = modelRegistry.getAvailable();
|
|
93
98
|
const patterns = readEnabledModelPatterns();
|
|
94
99
|
|
|
@@ -23,7 +23,7 @@ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
|
23
23
|
* and one active session (so one lastMessage), observed identically by every
|
|
24
24
|
* subscriber. Listener unsubs are NOT shared: each subscribeToNotificationApi() call
|
|
25
25
|
* owns its own local closure unsubs, so multiple subscribers (ui-components,
|
|
26
|
-
* ask-user-question,
|
|
26
|
+
* ask-user-question, featyard) don't clobber each other's cleanup.
|
|
27
27
|
*/
|
|
28
28
|
interface NotificationForwardingState {
|
|
29
29
|
requestAttention: ((source: string, detail?: string) => (() => void) | undefined) | null;
|