pi-delegation-policy 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
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.3.1 - 2026-08-26
6
+
7
+ ### Fixed
8
+
9
+ - Matched model results to Pi's `/model` presentation: model ID first, `[provider]` last, with no more than ten visible model rows.
10
+
5
11
  ## 0.3.0 - 2026-08-26
6
12
 
7
13
  ### Added
package/README.md CHANGED
@@ -41,7 +41,7 @@ It supports Pi `0.84.1`. Restart Pi or run `/reload` after installation. To inst
41
41
 
42
42
  `Alt+G` opens the same editor when the shortcut is available. There is no separate off shortcut; use `/delegate off` or choose `off` in the editor. Changes apply to the next agent run. An agent already running keeps the system prompt it started with.
43
43
 
44
- The interactive editor requires Pi's TUI mode; quick `/delegate` arguments remain available in other modes. The editor is one bounded, keyboard-first panel. It shows the effective value and the built-in, global, and session value for each setting. Model fields open a live fuzzy search over provider, model ID, and display name; long catalogs scroll within the terminal instead of extending past the screen. **Use global default** remains available while searching, and UI Design also offers **Disable for this session**.
44
+ The interactive editor requires Pi's TUI mode; quick `/delegate` arguments remain available in other modes. The editor is one bounded, keyboard-first panel. It shows the effective value and the built-in, global, and session value for each setting. Model fields use the same compact presentation as Pi's `/model` selector: model ID first with `[provider]` at the end, live fuzzy search over provider, model ID, and display name, and at most ten visible model rows before scrolling. **Use global default** remains available while searching, and UI Design also offers **Disable for this session**.
45
45
 
46
46
  Edits stay in a draft until **Apply changes** is selected or `A` is pressed. **Save effective configuration as defaults** updates the global file without applying the session draft. **Reset draft to off** remains local until Apply. Escape returns from a field editor; closing a modified draft requires explicit discard confirmation.
47
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-delegation-policy",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "private": false,
5
5
  "description": "A Pi extension for configurable delegation intensity and exact subagent role model references.",
6
6
  "type": "module",
@@ -470,22 +470,29 @@ export class DelegatePanel implements Component, Focusable {
470
470
  ),
471
471
  );
472
472
  const dividerRows = budget > pinnedLines.length + 3 ? 1 : 0;
473
- const listBudget = Math.max(0, budget - 2 - pinnedLines.length - dividerRows);
474
- const showDescriptions = listBudget >= 3;
473
+ const selectedChoice = choices[mode.selected];
474
+ const selectedName =
475
+ selectedChoice?.kind === "model" && selectedChoice.description
476
+ ? [` Model Name: ${selectedChoice.description}`]
477
+ : [];
478
+ const detailRows = selectedName.length > 0 && budget > pinnedLines.length + 6 ? 2 : 0;
479
+ const availableListRows = Math.max(
480
+ 0,
481
+ budget - 2 - pinnedLines.length - dividerRows - detailRows,
482
+ );
483
+ const listBudget = Math.min(11, availableListRows);
475
484
  const modelBlocks = models.map((choice, index) => {
476
485
  const combinedIndex = index + pinnedCount;
477
- const lines = [
478
- selectedLine(this.theme, choice.label, width, mode.selected === combinedIndex),
479
- ];
480
- if (showDescriptions && choice.description) {
481
- lines.push(truncateToWidth(this.theme.fg("muted", ` ${choice.description}`), width, ""));
482
- }
483
- return lines;
486
+ const provider = choice.kind === "model" ? choice.reference.provider : "";
487
+ const label = provider
488
+ ? `${choice.label} ${this.theme.fg("muted", `[${provider}]`)}`
489
+ : choice.label;
490
+ return [selectedLine(this.theme, label, width, mode.selected === combinedIndex)];
484
491
  });
485
492
  const modelSelected = Math.max(0, mode.selected - pinnedCount);
486
493
  const modelLines =
487
494
  listBudget > 0 && modelBlocks.length > 0
488
- ? this.renderBlockViewport(modelBlocks, modelSelected, width, listBudget)
495
+ ? this.renderBlockViewport(modelBlocks, modelSelected, width, listBudget, 10)
489
496
  : [];
490
497
  if (models.length === 0 && modelLines.length < listBudget) {
491
498
  modelLines.push(
@@ -505,6 +512,7 @@ export class DelegatePanel implements Component, Focusable {
505
512
  ...pinnedLines,
506
513
  ...(dividerRows ? [this.theme.fg("borderMuted", "─".repeat(width))] : []),
507
514
  ...modelLines,
515
+ ...(detailRows ? ["", ...selectedName.map((line) => this.theme.fg("muted", line))] : []),
508
516
  ].slice(0, budget);
509
517
  }
510
518
 
@@ -523,10 +531,11 @@ export class DelegatePanel implements Component, Focusable {
523
531
  selected: number,
524
532
  width: number,
525
533
  budget: number,
534
+ maxVisibleBlocks = Number.POSITIVE_INFINITY,
526
535
  ): string[] {
527
536
  const totalRows = blocks.reduce((sum, block) => sum + block.length, 0);
528
- const reserveIndicator = totalRows > budget ? 1 : 0;
529
- const contentBudget = Math.max(1, budget - reserveIndicator);
537
+ const reserveIndicator = totalRows > budget || blocks.length > maxVisibleBlocks ? 1 : 0;
538
+ const contentBudget = Math.max(1, Math.min(budget - reserveIndicator, maxVisibleBlocks));
530
539
  const [start, end] = visibleBlockRange(blocks, selected, contentBudget);
531
540
  const lines = blocks
532
541
  .slice(start, end)
@@ -672,7 +681,7 @@ export class DelegatePanel implements Component, Focusable {
672
681
  }
673
682
  const filtered = query
674
683
  ? fuzzyFilter(this.candidates, query, (model) =>
675
- `${model.provider}/${model.id} ${model.name ?? ""}`.trim(),
684
+ `${model.provider} ${model.provider}/${model.id} ${model.provider} ${model.id} ${model.name ?? ""}`.trim(),
676
685
  )
677
686
  : this.candidates;
678
687
  return [
@@ -680,7 +689,7 @@ export class DelegatePanel implements Component, Focusable {
680
689
  ...filtered.map<ModelChoice>((model) => ({
681
690
  kind: "model",
682
691
  key: modelKey({ provider: model.provider, model: model.id }),
683
- label: `${model.provider}/${model.id}`,
692
+ label: model.id,
684
693
  ...(model.name && model.name !== model.id ? { description: model.name } : {}),
685
694
  reference: { provider: model.provider, model: model.id },
686
695
  })),