pi-better-model-select 0.3.0 → 0.3.1

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
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Fixed
6
+
7
+ - Included the README's showcase GIF in the npm package without shipping the other demo assets.
8
+ - Restored the Ctrl+D set-default hint on the main model search screen, including at 80-column widths.
9
+ - Accepting "Save and use anyway" now saves without asking for confirmation again. Default-save messages show the settings path and identify any startup override that remains.
10
+
3
11
  ## 0.3.0
4
12
 
5
13
  ### Added
Binary file
@@ -48,8 +48,14 @@ async function applyMainDefault(pi: any, ctx: any, provider: string, modelId: st
48
48
  setPiDefault(preview, provider, modelId, effort);
49
49
  const effective = piPreference(scope === "user" ? preview : user, scope === "project" ? preview : project);
50
50
  const shadowed = effective.provider !== provider || effective.model !== modelId || (effort !== undefined && effective.effort !== effort);
51
- if (shadowed && !(await confirmDefault(ctx, "Higher-priority settings", "Project or per-model settings override this preference at startup. Save and use your selection in this session anyway?", "Save and use anyway"))) return false;
52
- if (selectedEffort === undefined && !(await confirmDefault(ctx, "Save and use Pi default?", `${provider}/${modelId}, effort ${choice}\nScope: ${scope}\n${settingsPath(ctx.cwd, scope)}`, "Save and use"))) return false;
51
+ const path = settingsPath(ctx.cwd, scope);
52
+ const key = `${provider}/${modelId}`;
53
+ const overridePath = settingsPath(ctx.cwd, effective.provider !== provider || effective.model !== modelId || project.modelThinkingLevels?.[key] !== undefined || (scope === "user" && project.defaultThinkingLevel !== undefined) ? "project" : "user");
54
+ const summary = `${provider}/${modelId}, effort ${choice}\nScope: ${scope}\nSave to: ${path}`;
55
+ if (shadowed) {
56
+ const message = `${summary}\nHigher-priority settings in ${overridePath} still apply at startup.\nSave this preference and use your selection in this session anyway?`;
57
+ if (!(await confirmDefault(ctx, "Higher-priority settings", message, "Save and use anyway"))) return false;
58
+ } else if (selectedEffort === undefined && !(await confirmDefault(ctx, "Save and use Pi default?", summary, "Save and use"))) return false;
53
59
  // Parse before changing session state. A malformed file must never be overwritten.
54
60
  readSettings(settingsPath(ctx.cwd, scope));
55
61
  const previousModel = ctx.model;
@@ -68,7 +74,7 @@ async function applyMainDefault(pi: any, ctx: any, provider: string, modelId: st
68
74
  return false;
69
75
  }
70
76
  patchSettings(settingsPath(ctx.cwd, scope), data => setPiDefault(data, provider, modelId, effort === undefined ? undefined : applied));
71
- ctx.ui.notify(`Using ${provider}/${modelId}, effort ${applied}. Saved ${scope} Pi default.${shadowed ? " Higher-priority startup settings still apply." : ""}`, "info");
77
+ ctx.ui.notify(`Using ${provider}/${modelId}, effort ${applied}. Saved ${scope} Pi default to ${path}.${shadowed ? ` Startup still uses ${effective.provider}/${effective.model}, effort ${effective.effort ?? "automatic"}, due to ${overridePath}. Edit the overriding preference to change startup behavior.` : ""}`, "info");
72
78
  return true;
73
79
  } catch (error) {
74
80
  if (previousModel) await pi.setModel(previousModel);
@@ -102,7 +102,8 @@ export function selectListTheme(theme: any): SelectListTheme {
102
102
  };
103
103
  }
104
104
 
105
- const HINT = "↑↓ move · enter load · ctrl+a add · ctrl+o actions · esc close";
105
+ // Keep the default shortcut ahead of secondary actions so narrow terminals show it.
106
+ const HINT = "↑↓ move · enter load · ctrl+d set default · ctrl+o actions · esc close";
106
107
 
107
108
  export interface PickerOptions {
108
109
  placement?: Placement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-better-model-select",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "description": "Searchable, usage-ranked model picker for Pi with model management, default model and thinking effort selection, and per-role subagent defaults.",
6
6
  "keywords": [
@@ -28,6 +28,7 @@
28
28
  "CHANGELOG.md",
29
29
  "docs/configuration.md",
30
30
  "docs/development.md",
31
+ "docs/demo/showcase.gif",
31
32
  "LICENSE"
32
33
  ],
33
34
  "pi": {