@earendil-works/pi-coding-agent 0.84.0 → 0.84.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 (88) hide show
  1. package/CHANGELOG.md +31 -2
  2. package/dist/cli/args.d.ts.map +1 -1
  3. package/dist/cli/args.js +3 -3
  4. package/dist/cli/args.js.map +1 -1
  5. package/dist/cli/auth-check.d.ts +19 -0
  6. package/dist/cli/auth-check.d.ts.map +1 -0
  7. package/dist/cli/auth-check.js +50 -0
  8. package/dist/cli/auth-check.js.map +1 -0
  9. package/dist/cli/auth-command.d.ts +24 -0
  10. package/dist/cli/auth-command.d.ts.map +1 -0
  11. package/dist/cli/auth-command.js +102 -0
  12. package/dist/cli/auth-command.js.map +1 -0
  13. package/dist/cli/credential-print.d.ts +4 -14
  14. package/dist/cli/credential-print.d.ts.map +1 -1
  15. package/dist/cli/credential-print.js +38 -79
  16. package/dist/cli/credential-print.js.map +1 -1
  17. package/dist/core/auth-storage.d.ts +10 -0
  18. package/dist/core/auth-storage.d.ts.map +1 -1
  19. package/dist/core/auth-storage.js +78 -1
  20. package/dist/core/auth-storage.js.map +1 -1
  21. package/dist/core/extensions/types.d.ts +5 -0
  22. package/dist/core/extensions/types.d.ts.map +1 -1
  23. package/dist/core/extensions/types.js.map +1 -1
  24. package/dist/core/keybindings.d.ts +8 -0
  25. package/dist/core/keybindings.d.ts.map +1 -1
  26. package/dist/core/model-resolver.d.ts.map +1 -1
  27. package/dist/core/model-resolver.js +1 -0
  28. package/dist/core/model-resolver.js.map +1 -1
  29. package/dist/core/model-runtime.d.ts +2 -0
  30. package/dist/core/model-runtime.d.ts.map +1 -1
  31. package/dist/core/model-runtime.js +3 -1
  32. package/dist/core/model-runtime.js.map +1 -1
  33. package/dist/core/tools/bash.d.ts +4 -0
  34. package/dist/core/tools/bash.d.ts.map +1 -1
  35. package/dist/core/tools/bash.js +6 -4
  36. package/dist/core/tools/bash.js.map +1 -1
  37. package/dist/core/tools/edit.d.ts +4 -0
  38. package/dist/core/tools/edit.d.ts.map +1 -1
  39. package/dist/core/tools/edit.js +11 -7
  40. package/dist/core/tools/edit.js.map +1 -1
  41. package/dist/core/tools/find.d.ts +4 -0
  42. package/dist/core/tools/find.d.ts.map +1 -1
  43. package/dist/core/tools/find.js +5 -1
  44. package/dist/core/tools/find.js.map +1 -1
  45. package/dist/core/tools/grep.d.ts +4 -0
  46. package/dist/core/tools/grep.d.ts.map +1 -1
  47. package/dist/core/tools/grep.js +5 -1
  48. package/dist/core/tools/grep.js.map +1 -1
  49. package/dist/core/tools/ls.d.ts +4 -0
  50. package/dist/core/tools/ls.d.ts.map +1 -1
  51. package/dist/core/tools/ls.js +5 -1
  52. package/dist/core/tools/ls.js.map +1 -1
  53. package/dist/core/tools/read.d.ts +4 -0
  54. package/dist/core/tools/read.d.ts.map +1 -1
  55. package/dist/core/tools/read.js +6 -2
  56. package/dist/core/tools/read.js.map +1 -1
  57. package/dist/core/tools/write.d.ts +4 -0
  58. package/dist/core/tools/write.d.ts.map +1 -1
  59. package/dist/core/tools/write.js +6 -2
  60. package/dist/core/tools/write.js.map +1 -1
  61. package/dist/main.d.ts.map +1 -1
  62. package/dist/main.js +57 -21
  63. package/dist/main.js.map +1 -1
  64. package/dist/modes/interactive/interactive-mode.d.ts +3 -0
  65. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  66. package/dist/modes/interactive/interactive-mode.js +37 -6
  67. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  68. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  69. package/dist/modes/interactive/theme/theme.js +11 -3
  70. package/dist/modes/interactive/theme/theme.js.map +1 -1
  71. package/dist/server/create-harness.d.ts +26 -0
  72. package/dist/server/create-harness.d.ts.map +1 -0
  73. package/dist/server/create-harness.js +104 -0
  74. package/dist/server/create-harness.js.map +1 -0
  75. package/docs/extensions.md +3 -2
  76. package/docs/keybindings.md +9 -5
  77. package/docs/providers.md +8 -1
  78. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  79. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  80. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  81. package/examples/extensions/gondolin/package-lock.json +2 -2
  82. package/examples/extensions/gondolin/package.json +1 -1
  83. package/examples/extensions/sandbox/package-lock.json +2 -2
  84. package/examples/extensions/sandbox/package.json +1 -1
  85. package/examples/extensions/with-deps/package-lock.json +2 -2
  86. package/examples/extensions/with-deps/package.json +1 -1
  87. package/npm-shrinkwrap.json +23 -23
  88. package/package.json +7 -7
@@ -169,7 +169,10 @@ function formatLoginProviderCompletionDescription(provider) {
169
169
  export function createInteractiveTui(options) {
170
170
  const terminal = options.terminal ?? new ProcessTerminal();
171
171
  if (options.tuiMode === "fullscreen") {
172
- return new TuiAltScreen(terminal, options.showHardwareCursor, options.logDirectory, { openUrl: openBrowser });
172
+ return new TuiAltScreen(terminal, options.showHardwareCursor, options.logDirectory, {
173
+ openUrl: openBrowser,
174
+ onRightClickPaste: options.onRightClickPaste,
175
+ });
173
176
  }
174
177
  return new TuiMainScreen(terminal, options.showHardwareCursor, options.logDirectory);
175
178
  }
@@ -181,12 +184,19 @@ export function createInteractiveTuiReference(getTui) {
181
184
  const value = Reflect.get(tui, property, tui);
182
185
  if (typeof value !== "function")
183
186
  return value;
187
+ let methodTui = tui;
188
+ let method = value;
184
189
  return (...args) => {
185
- const tui = getTui();
186
- const method = Reflect.get(tui, property, tui);
187
- if (typeof method !== "function")
188
- throw new TypeError(`TUI property ${String(property)} is not callable`);
189
- return Reflect.apply(method, tui, args);
190
+ const currentTui = getTui();
191
+ if (currentTui !== methodTui) {
192
+ const currentMethod = Reflect.get(currentTui, property, currentTui);
193
+ if (typeof currentMethod !== "function") {
194
+ throw new TypeError(`TUI property ${String(property)} is not callable`);
195
+ }
196
+ methodTui = currentTui;
197
+ method = currentMethod;
198
+ }
199
+ return Reflect.apply(method, methodTui, args);
190
200
  };
191
201
  },
192
202
  set: (_target, property, value) => {
@@ -295,6 +305,9 @@ export class InteractiveMode {
295
305
  // Custom header from extension (undefined = use built-in header)
296
306
  customHeader = undefined;
297
307
  options;
308
+ onRightClickPaste = () => {
309
+ void this.handleRightClickPaste();
310
+ };
298
311
  autoTrustOnReloadCwd;
299
312
  themeController;
300
313
  // Convenience accessors
@@ -326,6 +339,7 @@ export class InteractiveMode {
326
339
  tuiMode,
327
340
  showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
328
341
  logDirectory: getAgentDir(),
342
+ onRightClickPaste: this.onRightClickPaste,
329
343
  });
330
344
  this.ui = createInteractiveTuiReference(() => this.renderer);
331
345
  this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
@@ -558,6 +572,7 @@ export class InteractiveMode {
558
572
  showHardwareCursor,
559
573
  logDirectory: getAgentDir(),
560
574
  terminal,
575
+ onRightClickPaste: this.onRightClickPaste,
561
576
  });
562
577
  nextUi.setClearOnShrink(clearOnShrink);
563
578
  nextUi.onDebug = onDebug;
@@ -2237,6 +2252,22 @@ export class InteractiveMode {
2237
2252
  void this.handleClipboardPaste();
2238
2253
  };
2239
2254
  }
2255
+ async handleRightClickPaste() {
2256
+ const target = this.renderer.getFocusedComponent();
2257
+ const handleInput = target?.handleInput;
2258
+ if (!target || !handleInput)
2259
+ return;
2260
+ try {
2261
+ const text = await readClipboardText();
2262
+ if (!text || this.renderer.getFocusedComponent() !== target)
2263
+ return;
2264
+ handleInput.call(target, `\x1b[200~${text}\x1b[201~`);
2265
+ this.ui.requestRender();
2266
+ }
2267
+ catch {
2268
+ // Silently ignore clipboard errors (may not have permission, etc.)
2269
+ }
2270
+ }
2240
2271
  async handleClipboardPaste() {
2241
2272
  try {
2242
2273
  const image = await readClipboardImage();