@grrrck/pi-clear 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.
Files changed (3) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/index.ts +15 -9
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.3.1] - 2026-10-27
9
+
10
+ ### Fixed
11
+
12
+ - Improved `/hand-off` model search to match providers, model IDs, and names.
13
+
8
14
  ## [0.3.0] - 2026-10-22
9
15
 
10
16
  ### Added
package/index.ts CHANGED
@@ -45,7 +45,7 @@ import type {
45
45
  ExtensionContext,
46
46
  } from "@earendil-works/pi-coding-agent";
47
47
  import { DynamicBorder } from "@earendil-works/pi-coding-agent";
48
- import { Container, Input, SelectList, Text, type SelectItem } from "@earendil-works/pi-tui";
48
+ import { Container, fuzzyFilter, Input, SelectList, Text, type SelectItem } from "@earendil-works/pi-tui";
49
49
 
50
50
  // Model and thinking-level types, derived from the API surface because the
51
51
  // package root does not re-export them directly.
@@ -240,8 +240,10 @@ async function pickTargetModelTui(ctx: ExtensionContext): Promise<PickedModel |
240
240
 
241
241
  const entriesForScope = () => (scope === "scoped" ? scopedEntries : allEntries);
242
242
 
243
- const makeList = () => {
244
- const entries = orderCurrentFirst(entriesForScope(), current, (entry) => entry.model);
243
+ const makeList = (query = "") => {
244
+ const ordered = orderCurrentFirst(entriesForScope(), current, (entry) => entry.model);
245
+ // SelectList.setFilter() only prefix-matches item values, not labels.
246
+ const entries = fuzzyFilter(ordered, query, ({ model }) => `${model.provider} ${model.id} ${model.name}`);
245
247
  const items: SelectItem[] = entries.map((entry, index) => ({
246
248
  value: String(index),
247
249
  label: modelLabel(entry.model, current),
@@ -259,8 +261,15 @@ async function pickTargetModelTui(ctx: ExtensionContext): Promise<PickedModel |
259
261
  container.addChild(header);
260
262
  const searchInput = new Input({ placeholder: "Type to filter" });
261
263
  container.addChild(searchInput);
264
+ const listContainer = new Container();
262
265
  selectList = makeList();
263
- container.addChild(selectList);
266
+ listContainer.addChild(selectList);
267
+ container.addChild(listContainer);
268
+ const updateList = () => {
269
+ selectList = makeList(searchInput.getValue());
270
+ listContainer.clear();
271
+ listContainer.addChild(selectList);
272
+ };
264
273
  const hint = new Text("");
265
274
  container.addChild(hint);
266
275
  container.addChild(new DynamicBorder((str) => theme.fg("accent", str)));
@@ -292,10 +301,7 @@ async function pickTargetModelTui(ctx: ExtensionContext): Promise<PickedModel |
292
301
  handleInput(data: string) {
293
302
  if (scopedEntries.length > 0 && kb.matches(data, "tui.input.tab")) {
294
303
  scope = scope === "scoped" ? "all" : "scoped";
295
- container.removeChild(selectList);
296
- selectList = makeList();
297
- container.addChild(selectList);
298
- selectList.setFilter(searchInput.getValue());
304
+ updateList();
299
305
  updateChrome();
300
306
  tui.requestRender();
301
307
  return;
@@ -311,7 +317,7 @@ async function pickTargetModelTui(ctx: ExtensionContext): Promise<PickedModel |
311
317
  return;
312
318
  }
313
319
  searchInput.handleInput(data);
314
- selectList.setFilter(searchInput.getValue());
320
+ updateList();
315
321
  tui.requestRender();
316
322
  },
317
323
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grrrck/pi-clear",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Pi extension that starts a fresh session with /clear while keeping your current model and thinking level, and hands conversations off between models with /hand-off",
5
5
  "keywords": [
6
6
  "pi-package",