@mariozechner/pi-coding-agent 0.51.1 → 0.51.2

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 (33) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/config.d.ts +3 -0
  3. package/dist/config.d.ts.map +1 -1
  4. package/dist/config.js +36 -0
  5. package/dist/config.js.map +1 -1
  6. package/dist/core/extensions/runner.d.ts +3 -1
  7. package/dist/core/extensions/runner.d.ts.map +1 -1
  8. package/dist/core/extensions/runner.js +16 -1
  9. package/dist/core/extensions/runner.js.map +1 -1
  10. package/dist/core/extensions/types.d.ts +4 -0
  11. package/dist/core/extensions/types.d.ts.map +1 -1
  12. package/dist/core/extensions/types.js.map +1 -1
  13. package/dist/core/tools/path-utils.d.ts.map +1 -1
  14. package/dist/core/tools/path-utils.js +4 -1
  15. package/dist/core/tools/path-utils.js.map +1 -1
  16. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  17. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  18. package/dist/modes/interactive/interactive-mode.js +16 -7
  19. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  20. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  21. package/dist/modes/rpc/rpc-mode.js +7 -0
  22. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  23. package/docs/extensions.md +7 -0
  24. package/docs/packages.md +21 -0
  25. package/docs/rpc.md +2 -1
  26. package/docs/terminal-setup.md +5 -0
  27. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  28. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  29. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  30. package/examples/extensions/custom-provider-qwen-cli/package.json +1 -1
  31. package/examples/extensions/with-deps/package-lock.json +2 -2
  32. package/examples/extensions/with-deps/package.json +1 -1
  33. package/package.json +4 -4
@@ -9,7 +9,7 @@ import * as path from "node:path";
9
9
  import { getOAuthProviders, } from "@mariozechner/pi-ai";
10
10
  import { CombinedAutocompleteProvider, Container, fuzzyFilter, Loader, Markdown, matchesKey, ProcessTerminal, Spacer, Text, TruncatedText, TUI, visibleWidth, } from "@mariozechner/pi-tui";
11
11
  import { spawn, spawnSync } from "child_process";
12
- import { APP_NAME, getAuthPath, getDebugLogPath, getShareViewerUrl, isBunBinary, isBunRuntime, VERSION, } from "../../config.js";
12
+ import { APP_NAME, getAuthPath, getDebugLogPath, getShareViewerUrl, getUpdateInstruction, VERSION, } from "../../config.js";
13
13
  import { parseSkillBlock } from "../../core/agent-session.js";
14
14
  import { FooterDataProvider } from "../../core/footer-data-provider.js";
15
15
  import { KeybindingsManager } from "../../core/keybindings.js";
@@ -218,7 +218,8 @@ export class InteractiveMode {
218
218
  description: cmd.description,
219
219
  }));
220
220
  // Convert extension commands to SlashCommand format
221
- const extensionCommands = (this.session.extensionRunner?.getRegisteredCommands() ?? []).map((cmd) => ({
221
+ const builtinCommandNames = new Set(slashCommands.map((c) => c.name));
222
+ const extensionCommands = (this.session.extensionRunner?.getRegisteredCommands(builtinCommandNames) ?? []).map((cmd) => ({
222
223
  name: cmd.name,
223
224
  description: cmd.description ?? "(extension command)",
224
225
  getArgumentCompletions: cmd.getArgumentCompletions,
@@ -724,6 +725,8 @@ export class InteractiveMode {
724
725
  extensionDiagnostics.push({ type: "error", message: error.error, path: error.path });
725
726
  }
726
727
  }
728
+ const commandDiagnostics = this.session.extensionRunner?.getCommandDiagnostics() ?? [];
729
+ extensionDiagnostics.push(...commandDiagnostics);
727
730
  const shortcutDiagnostics = this.session.extensionRunner?.getShortcutDiagnostics() ?? [];
728
731
  extensionDiagnostics.push(...shortcutDiagnostics);
729
732
  if (extensionDiagnostics.length > 0) {
@@ -1112,6 +1115,8 @@ export class InteractiveMode {
1112
1115
  }
1113
1116
  return result;
1114
1117
  },
1118
+ getToolsExpanded: () => this.toolOutputExpanded,
1119
+ setToolsExpanded: (expanded) => this.setToolsExpanded(expanded),
1115
1120
  };
1116
1121
  }
1117
1122
  /**
@@ -2110,6 +2115,9 @@ export class InteractiveMode {
2110
2115
  // Wait for any pending renders to complete
2111
2116
  // requestRender() uses process.nextTick(), so we wait one tick
2112
2117
  await new Promise((resolve) => process.nextTick(resolve));
2118
+ // Drain any in-flight Kitty key release events before stopping.
2119
+ // This prevents escape sequences from leaking to the parent shell over slow SSH.
2120
+ await this.ui.terminal.drainInput(1000);
2113
2121
  this.stop();
2114
2122
  process.exit(0);
2115
2123
  }
@@ -2211,10 +2219,13 @@ export class InteractiveMode {
2211
2219
  }
2212
2220
  }
2213
2221
  toggleToolOutputExpansion() {
2214
- this.toolOutputExpanded = !this.toolOutputExpanded;
2222
+ this.setToolsExpanded(!this.toolOutputExpanded);
2223
+ }
2224
+ setToolsExpanded(expanded) {
2225
+ this.toolOutputExpanded = expanded;
2215
2226
  for (const child of this.chatContainer.children) {
2216
2227
  if (isExpandable(child)) {
2217
- child.setExpanded(this.toolOutputExpanded);
2228
+ child.setExpanded(expanded);
2218
2229
  }
2219
2230
  }
2220
2231
  this.ui.requestRender();
@@ -2292,9 +2303,7 @@ export class InteractiveMode {
2292
2303
  this.ui.requestRender();
2293
2304
  }
2294
2305
  showNewVersionNotification(newVersion) {
2295
- const action = isBunBinary
2296
- ? `Download from: ${theme.fg("accent", "https://github.com/badlogic/pi-mono/releases/latest")}`
2297
- : `Run: ${theme.fg("accent", `${isBunRuntime ? "bun" : "npm"} install -g @mariozechner/pi-coding-agent`)}`;
2306
+ const action = theme.fg("accent", getUpdateInstruction("@mariozechner/pi-coding-agent"));
2298
2307
  const updateInstruction = theme.fg("muted", `New version ${newVersion} is available. `) + action;
2299
2308
  const changelogUrl = theme.fg("accent", "https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/CHANGELOG.md");
2300
2309
  const changelogLine = theme.fg("muted", "Changelog: ") + changelogUrl;