@mariozechner/pi-coding-agent 0.42.4 → 0.42.5

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.
@@ -15,10 +15,10 @@ import { KeybindingsManager } from "../../core/keybindings.js";
15
15
  import { createCompactionSummaryMessage } from "../../core/messages.js";
16
16
  import { SessionManager } from "../../core/session-manager.js";
17
17
  import { loadProjectContextFiles } from "../../core/system-prompt.js";
18
- import { allTools } from "../../core/tools/index.js";
19
18
  import { getChangelogPath, getNewEntries, parseChangelog } from "../../utils/changelog.js";
20
19
  import { copyToClipboard } from "../../utils/clipboard.js";
21
20
  import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
21
+ import { fuzzyFilter } from "../../utils/fuzzy.js";
22
22
  import { ensureTool } from "../../utils/tools-manager.js";
23
23
  import { ArminComponent } from "./components/armin.js";
24
24
  import { AssistantMessageComponent } from "./components/assistant-message.js";
@@ -146,7 +146,33 @@ export class InteractiveMode {
146
146
  // Define commands for autocomplete
147
147
  const slashCommands = [
148
148
  { name: "settings", description: "Open settings menu" },
149
- { name: "model", description: "Select model (opens selector UI)" },
149
+ {
150
+ name: "model",
151
+ description: "Select model (opens selector UI)",
152
+ getArgumentCompletions: (prefix) => {
153
+ // Get available models (scoped or from registry)
154
+ const models = this.session.scopedModels.length > 0
155
+ ? this.session.scopedModels.map((s) => s.model)
156
+ : this.session.modelRegistry.getAvailable();
157
+ if (models.length === 0)
158
+ return null;
159
+ // Create items with provider/id format
160
+ const items = models.map((m) => ({
161
+ id: m.id,
162
+ provider: m.provider,
163
+ label: `${m.provider}/${m.id}`,
164
+ }));
165
+ // Fuzzy filter by model ID (not provider/id to avoid matching provider name)
166
+ const filtered = fuzzyFilter(items, prefix, (item) => item.id);
167
+ if (filtered.length === 0)
168
+ return null;
169
+ return filtered.map((item) => ({
170
+ value: item.label,
171
+ label: item.id,
172
+ description: item.provider,
173
+ }));
174
+ },
175
+ },
150
176
  { name: "export", description: "Export session to HTML file" },
151
177
  { name: "share", description: "Share session as a secret GitHub gist" },
152
178
  { name: "copy", description: "Copy last agent message to clipboard" },
@@ -565,14 +591,6 @@ export class InteractiveMode {
565
591
  this.chatContainer.addChild(new Text(theme.fg("muted", "Loaded extensions:\n") + extList, 0, 0));
566
592
  this.chatContainer.addChild(new Spacer(1));
567
593
  }
568
- // Warn about built-in tool overrides
569
- const builtInToolNames = new Set(Object.keys(allTools));
570
- const registeredTools = extensionRunner.getAllRegisteredTools();
571
- for (const tool of registeredTools) {
572
- if (builtInToolNames.has(tool.definition.name)) {
573
- this.chatContainer.addChild(new Text(theme.fg("warning", `Warning: Extension "${tool.extensionPath}" overrides built-in tool "${tool.definition.name}"`), 0, 0));
574
- }
575
- }
576
594
  // Emit session_start event
577
595
  await extensionRunner.emit({
578
596
  type: "session_start",
@@ -2623,8 +2641,8 @@ export class InteractiveMode {
2623
2641
  : "No changelog entries found.";
2624
2642
  this.chatContainer.addChild(new Spacer(1));
2625
2643
  this.chatContainer.addChild(new DynamicBorder());
2626
- this.ui.addChild(new Text(theme.bold(theme.fg("accent", "What's New")), 1, 0));
2627
- this.ui.addChild(new Spacer(1));
2644
+ this.chatContainer.addChild(new Text(theme.bold(theme.fg("accent", "What's New")), 1, 0));
2645
+ this.chatContainer.addChild(new Spacer(1));
2628
2646
  this.chatContainer.addChild(new Markdown(changelogMarkdown, 1, 1, getMarkdownTheme()));
2629
2647
  this.chatContainer.addChild(new DynamicBorder());
2630
2648
  this.ui.requestRender();