@selesai/code 0.9.5 → 0.9.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  All notable changes to `@selesai/code` will be documented in this file.
4
4
 
5
+ ## [0.9.6] - 2026-08-23
6
+
7
+ ### Fixed
8
+ - **Vision caption model selector.** Opening the selector from `/settings` now shows the available image-capable models instead of filtering the list by the configured model ID, highlights the current caption model, and preserves the Disabled option when switching model scopes.
9
+
5
10
  ## [0.9.5] - 2026-08-23
6
11
 
7
12
  ### Added
@@ -47,6 +47,7 @@ export declare class ModelSelectorComponent extends Container implements Focusab
47
47
  private closed;
48
48
  constructor(tui: TUI, currentModel: Model<any> | undefined, settingsManager: SettingsManager, modelRuntime: ModelRuntime, scopedModels: ReadonlyArray<ScopedModelItem>, onSelect: (model: Model<any> | undefined) => void, onCancel: () => void, initialSearchInput?: string, options?: ModelSelectorOptions);
49
49
  private loadModelsFromSnapshot;
50
+ private getActiveModels;
50
51
  private refreshModels;
51
52
  private close;
52
53
  private sortModels;
@@ -112,14 +112,18 @@ export class ModelSelectorComponent extends Container {
112
112
  id: scoped.model.id,
113
113
  model: scoped.model,
114
114
  }));
115
- this.activeModels = this.scope === "scoped" ? this.scopedModelItems : this.allModels;
116
- if (this.options.allowOff)
117
- this.activeModels = [{ provider: "", id: "off", model: { provider: "", id: "off", name: "Disabled", input: ["text"] } }, ...this.activeModels];
115
+ this.activeModels = this.getActiveModels();
118
116
  this.filteredModels = this.activeModels;
119
117
  const currentIndex = this.filteredModels.findIndex((item) => modelsAreEqual(this.currentModel, item.model));
120
118
  this.selectedIndex =
121
119
  currentIndex >= 0 ? currentIndex : Math.min(this.selectedIndex, Math.max(0, this.filteredModels.length - 1));
122
120
  }
121
+ getActiveModels() {
122
+ const items = this.scope === "scoped" ? this.scopedModelItems : this.allModels;
123
+ if (this.options.allowOff)
124
+ return [{ provider: "", id: "off", model: { provider: "", id: "off", name: "Disabled", input: ["text"] } }, ...items];
125
+ return items;
126
+ }
123
127
  async refreshModels() {
124
128
  const timeoutMs = 15_000;
125
129
  let timedOut = false;
@@ -189,7 +193,7 @@ export class ModelSelectorComponent extends Container {
189
193
  if (this.scope === scope)
190
194
  return;
191
195
  this.scope = scope;
192
- this.activeModels = this.scope === "scoped" ? this.scopedModelItems : this.allModels;
196
+ this.activeModels = this.getActiveModels();
193
197
  const currentIndex = this.activeModels.findIndex((item) => modelsAreEqual(this.currentModel, item.model));
194
198
  this.selectedIndex = currentIndex >= 0 ? currentIndex : 0;
195
199
  this.filterModels(this.searchInput.getValue());
@@ -3682,11 +3682,15 @@ export class InteractiveMode {
3682
3682
  imageCaptionModel: this.settingsManager.getImageCaptionModel(),
3683
3683
  imageCaptionContextTokens: this.settingsManager.getImageCaptionContextTokens(),
3684
3684
  visionModels: this.getVisionModels(),
3685
- visionModelSelector: (currentValue, selectorDone) => new ModelSelectorComponent(this.ui, undefined, this.settingsManager, this.session.modelRuntime, this.session.scopedModels, (model) => {
3686
- this.settingsManager.setImageCaptionModel(model ? `${model.provider}/${model.id}` : undefined);
3687
- selectorDone();
3688
- this.showStatus(model ? `Vision caption model: ${model.provider}/${model.id}` : "Vision captioning disabled");
3689
- }, selectorDone, currentValue === "off" ? undefined : currentValue, { modelFilter: (model) => model.input.includes("image"), allowOff: true, persistSelection: false }),
3685
+ visionModelSelector: (currentValue, selectorDone) => {
3686
+ const slash = currentValue.indexOf("/");
3687
+ const currentModel = slash > 0 ? this.session.modelRuntime.getModel(currentValue.slice(0, slash), currentValue.slice(slash + 1)) : undefined;
3688
+ return new ModelSelectorComponent(this.ui, currentModel, this.settingsManager, this.session.modelRuntime, this.session.scopedModels, (model) => {
3689
+ this.settingsManager.setImageCaptionModel(model ? `${model.provider}/${model.id}` : undefined);
3690
+ selectorDone();
3691
+ this.showStatus(model ? `Vision caption model: ${model.provider}/${model.id}` : "Vision captioning disabled");
3692
+ }, selectorDone, undefined, { modelFilter: (model) => model.input.includes("image"), allowOff: true, persistSelection: false });
3693
+ },
3690
3694
  steeringMode: this.session.steeringMode,
3691
3695
  followUpMode: this.session.followUpMode,
3692
3696
  transport: this.settingsManager.getTransport(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selesai/code",
3
- "version": "0.9.5",
3
+ "version": "0.9.6",
4
4
  "description": "Maintained, extension-first Pi coding agent with built-in workflows, subagents, web research, questions, skills, and an enhanced terminal UI.",
5
5
  "type": "module",
6
6
  "repository": {