@daniel156161/prism 0.2.78 → 0.2.82

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 (204) hide show
  1. package/dist/pi/pi-env.d.ts +1 -1
  2. package/dist/pi/pi-env.js +1 -1
  3. package/dist/pi/pi-patch-interactive.js +8 -5
  4. package/dist/pi/pi-patch-interactive.js.map +1 -1
  5. package/dist/prism-extensions/integrations/ai-memory-errors.d.ts +29 -0
  6. package/dist/prism-extensions/integrations/ai-memory-errors.js +106 -0
  7. package/dist/prism-extensions/integrations/ai-memory-errors.js.map +1 -0
  8. package/dist/prism-extensions/integrations/ai-memory-http.d.ts +28 -0
  9. package/dist/prism-extensions/integrations/ai-memory-http.js +92 -0
  10. package/dist/prism-extensions/integrations/ai-memory-http.js.map +1 -0
  11. package/dist/prism-extensions/integrations/ai-memory-system.d.ts +5 -0
  12. package/dist/prism-extensions/integrations/ai-memory-system.js +205 -123
  13. package/dist/prism-extensions/integrations/ai-memory-system.js.map +1 -1
  14. package/dist/prism-extensions/integrations/ai-memory-write-preview.d.ts +36 -0
  15. package/dist/prism-extensions/integrations/ai-memory-write-preview.js +67 -0
  16. package/dist/prism-extensions/integrations/ai-memory-write-preview.js.map +1 -0
  17. package/dist/prism-extensions/integrations/research-tools.js +3 -3
  18. package/dist/prism-extensions/integrations/research-tools.js.map +1 -1
  19. package/dist/prism-extensions/integrations/youtube.d.ts +2 -2
  20. package/dist/prism-extensions/integrations/youtube.js +6 -7
  21. package/dist/prism-extensions/integrations/youtube.js.map +1 -1
  22. package/dist/prism-extensions/ui/collapsed-text-rendering.d.ts +4 -2
  23. package/dist/prism-extensions/ui/collapsed-text-rendering.js +12 -7
  24. package/dist/prism-extensions/ui/collapsed-text-rendering.js.map +1 -1
  25. package/node_modules/@earendil-works/pi-agent-core/README.md +4 -4
  26. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  27. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +5 -1
  28. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  29. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
  30. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +3 -0
  31. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
  32. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +6 -0
  33. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  34. package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
  35. package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
  36. package/node_modules/@earendil-works/pi-ai/README.md +8 -1
  37. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts.map +1 -1
  38. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -0
  39. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
  40. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +2 -0
  41. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  42. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +2 -0
  43. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
  44. package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts.map +1 -1
  45. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +2 -0
  46. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
  47. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  48. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  49. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  50. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  51. package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-individual.json +1 -0
  52. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  53. package/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-individual.d.ts +3 -0
  54. package/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-individual.d.ts.map +1 -0
  55. package/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-individual.js +15 -0
  56. package/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-individual.js.map +1 -0
  57. package/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-individual.models.d.ts +4 -0
  58. package/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-individual.models.d.ts.map +1 -0
  59. package/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-individual.models.js +6 -0
  60. package/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-individual.models.js.map +1 -0
  61. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +1 -1
  62. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  63. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  64. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  65. package/node_modules/@earendil-works/pi-client/CHANGELOG.md +1 -1
  66. package/node_modules/@earendil-works/pi-client/package.json +2 -2
  67. package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +31 -2
  68. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts.map +1 -1
  69. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +3 -3
  70. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js.map +1 -1
  71. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-check.d.ts +19 -0
  72. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-check.d.ts.map +1 -0
  73. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-check.js +50 -0
  74. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-check.js.map +1 -0
  75. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-command.d.ts +24 -0
  76. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-command.d.ts.map +1 -0
  77. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-command.js +102 -0
  78. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-command.js.map +1 -0
  79. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/credential-print.d.ts +4 -14
  80. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/credential-print.d.ts.map +1 -1
  81. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/credential-print.js +38 -79
  82. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/credential-print.js.map +1 -1
  83. package/node_modules/@earendil-works/pi-coding-agent/dist/cli.js +1 -1
  84. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +11 -6
  85. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.js +1 -1
  86. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +0 -5
  87. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.d.ts +10 -0
  88. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  89. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +79 -2
  90. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  91. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +1 -3
  92. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts +5 -0
  93. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  94. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  95. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts +8 -0
  96. package/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts.map +1 -1
  97. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
  98. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +1 -0
  99. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  100. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.d.ts +2 -0
  101. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.d.ts.map +1 -1
  102. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js +3 -1
  103. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js.map +1 -1
  104. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +1 -1
  105. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +1 -1
  106. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +37 -39
  107. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +16 -20
  108. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.d.ts +4 -0
  109. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
  110. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +6 -4
  111. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
  112. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.d.ts +4 -0
  113. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -1
  114. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +11 -7
  115. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js.map +1 -1
  116. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.d.ts +4 -0
  117. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
  118. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +5 -1
  119. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js.map +1 -1
  120. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.d.ts +4 -0
  121. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -1
  122. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +5 -1
  123. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js.map +1 -1
  124. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.d.ts +4 -0
  125. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -1
  126. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +5 -1
  127. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js.map +1 -1
  128. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts +4 -0
  129. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
  130. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +6 -2
  131. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js.map +1 -1
  132. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.d.ts +4 -0
  133. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -1
  134. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +6 -2
  135. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js.map +1 -1
  136. package/node_modules/@earendil-works/pi-coding-agent/dist/main.d.ts.map +1 -1
  137. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +57 -21
  138. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js.map +1 -1
  139. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/session-selector.js +0 -4
  140. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +3 -0
  141. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  142. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +48 -233
  143. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  144. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  145. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +11 -3
  146. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  147. package/node_modules/@earendil-works/pi-coding-agent/dist/server/create-harness.d.ts +26 -0
  148. package/node_modules/@earendil-works/pi-coding-agent/dist/server/create-harness.d.ts.map +1 -0
  149. package/node_modules/@earendil-works/pi-coding-agent/dist/server/create-harness.js +104 -0
  150. package/node_modules/@earendil-works/pi-coding-agent/dist/server/create-harness.js.map +1 -0
  151. package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +3 -2
  152. package/node_modules/@earendil-works/pi-coding-agent/docs/keybindings.md +9 -5
  153. package/node_modules/@earendil-works/pi-coding-agent/docs/providers.md +8 -1
  154. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  155. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
  156. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  157. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package-lock.json +2 -2
  158. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package.json +1 -1
  159. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package-lock.json +2 -2
  160. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
  161. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package-lock.json +2 -2
  162. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
  163. package/node_modules/@earendil-works/pi-coding-agent/package.json +7 -7
  164. package/node_modules/@earendil-works/pi-protocol/package.json +1 -1
  165. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  166. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +1 -1
  167. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +10 -0
  168. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
  169. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +8 -0
  170. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
  171. package/node_modules/@earendil-works/pi-tui/dist/latex.d.ts.map +1 -1
  172. package/node_modules/@earendil-works/pi-tui/dist/latex.js +188 -48
  173. package/node_modules/@earendil-works/pi-tui/dist/latex.js.map +1 -1
  174. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +12 -0
  175. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
  176. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +146 -12
  177. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
  178. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  179. package/node_modules/@types/node/README.md +1 -1
  180. package/node_modules/@types/node/child_process.d.ts +0 -1
  181. package/node_modules/@types/node/crypto.d.ts +6 -6
  182. package/node_modules/@types/node/dns/promises.d.ts +5 -5
  183. package/node_modules/@types/node/dns.d.ts +5 -5
  184. package/node_modules/@types/node/fs.d.ts +7 -0
  185. package/node_modules/@types/node/http.d.ts +30 -0
  186. package/node_modules/@types/node/http2.d.ts +4 -4
  187. package/node_modules/@types/node/os.d.ts +30 -30
  188. package/node_modules/@types/node/package.json +2 -2
  189. package/node_modules/@types/node/perf_hooks.d.ts +2 -1
  190. package/node_modules/@types/node/process.d.ts +42 -43
  191. package/node_modules/@types/node/quic.d.ts +1049 -84
  192. package/node_modules/@types/node/sqlite.d.ts +14 -1
  193. package/node_modules/@types/node/stream/iter.d.ts +3 -2
  194. package/node_modules/@types/node/test.d.ts +61 -0
  195. package/node_modules/@types/node/v8.d.ts +20 -23
  196. package/package.json +6 -6
  197. package/src/prism-extensions/integrations/ai-memory-errors.ts +112 -0
  198. package/src/prism-extensions/integrations/ai-memory-http.ts +114 -0
  199. package/src/prism-extensions/integrations/ai-memory-system.ts +221 -132
  200. package/src/prism-extensions/integrations/ai-memory-write-preview.ts +83 -0
  201. package/src/prism-extensions/integrations/research-tools.ts +3 -3
  202. package/src/prism-extensions/integrations/youtube.ts +6 -6
  203. package/src/prism-extensions/ui/collapsed-text-rendering.ts +14 -8
  204. package/node_modules/@earendil-works/pi-coding-agent/dist/core/prism-session-db.js +0 -128
@@ -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());
@@ -450,15 +464,12 @@ export class InteractiveMode {
450
464
  }));
451
465
  // Convert extension commands to SlashCommand format
452
466
  const builtinCommandNames = new Set(slashCommands.map((c) => c.name));
453
- const prismInternalCommandExtensions = new Set(["caveman-mode.ts", "clear-session.ts", "git-commit.ts", "plan-command.ts", "voice-command.ts", "obsidian-memory.ts", "logseq-memory.ts", "honcho-memory.ts", "research-tools.ts", "ai-memory-system.ts", "rp-memory.ts", "manifest-provider.ts", "ollama-provider.ts", "toolbox.ts", "context-usage.ts", "prism-status.ts", "toolbar.ts", "pi-mcp-adapter"]);
454
- const prismInternalCommandNpmPackages = new Set(["pi-mcp-adapter"]);
455
- const isPrismInternalCommand = (cmd) => (() => { const prismExtensionPath = String(cmd.sourceInfo?.path || "").replaceAll("\\", "/"); const prismExtensionSource = String(cmd.sourceInfo?.source || ""); return prismInternalCommandExtensions.has(path.basename(prismExtensionPath)) || Array.from(prismInternalCommandNpmPackages).some((pkg) => prismExtensionSource === "npm:" + pkg || prismExtensionPath.includes("/node_modules/" + pkg + "/")); })();
456
467
  const extensionCommands = this.session.extensionRunner
457
468
  .getRegisteredCommands()
458
469
  .filter((cmd) => !builtinCommandNames.has(cmd.name))
459
470
  .map((cmd) => ({
460
471
  name: cmd.invocationName,
461
- description: isPrismInternalCommand(cmd) ? cmd.description : this.prefixAutocompleteDescription(cmd.description, cmd.sourceInfo),
472
+ description: this.prefixAutocompleteDescription(cmd.description, cmd.sourceInfo),
462
473
  getArgumentCompletions: cmd.getArgumentCompletions,
463
474
  }));
464
475
  // Build skill commands from session.skills (if enabled)
@@ -561,6 +572,7 @@ export class InteractiveMode {
561
572
  showHardwareCursor,
562
573
  logDirectory: getAgentDir(),
563
574
  terminal,
575
+ onRightClickPaste: this.onRightClickPaste,
564
576
  });
565
577
  nextUi.setClearOnShrink(clearOnShrink);
566
578
  nextUi.onDebug = onDebug;
@@ -646,7 +658,7 @@ export class InteractiveMode {
646
658
  await this.themeController.applyFromSettings();
647
659
  // Add header with keybindings from config (unless silenced)
648
660
  if (this.options.verbose || !this.settingsManager.getQuietStartup()) {
649
- const logo = " \u001b[38;5;196mp\u001b[38;5;202mr\u001b[38;5;226mi\u001b[38;5;46ms\u001b[38;5;51mm\u001b[0m v0.2.78";
661
+ const logo = theme.bold(theme.fg("accent", APP_NAME)) + theme.fg("dim", ` v${this.version}`);
650
662
  // Build startup instructions using keybinding hint helpers
651
663
  const hint = (keybinding, description) => keyHint(keybinding, description);
652
664
  const expandedInstructions = [
@@ -678,7 +690,7 @@ export class InteractiveMode {
678
690
  hint("app.tools.expand", "more"),
679
691
  ].join(theme.fg("muted", " · "));
680
692
  const compactOnboarding = theme.fg("dim", `Press ${keyText("app.tools.expand")} to show full startup help and loaded resources.`);
681
- const onboarding = theme.fg("dim", `Prism can explain its own features and look up its docs. Ask it how to use or extend Prism.`);
693
+ const onboarding = theme.fg("dim", `Pi can explain its own features and look up its docs. Ask it how to use or extend Pi.`);
682
694
  this.builtInHeader = new ExpandableText(() => `${logo}\n${compactInstructions}\n${compactOnboarding}\n\n${onboarding}`, () => `${logo}\n${expandedInstructions}\n\n${onboarding}`, this.getStartupExpansionState(), 1, 0);
683
695
  // Setup UI layout
684
696
  this.headerContainer.addChild(new Spacer(1));
@@ -715,10 +727,10 @@ export class InteractiveMode {
715
727
  const cwdBasename = path.basename(this.sessionManager.getCwd());
716
728
  const sessionName = this.sessionManager.getSessionName();
717
729
  if (sessionName) {
718
- this.ui.terminal.setTitle(`▲ - ${sessionName} - ${cwdBasename}`);
730
+ this.ui.terminal.setTitle(`${APP_TITLE} - ${sessionName} - ${cwdBasename}`);
719
731
  }
720
732
  else {
721
- this.ui.terminal.setTitle(`▲ - ${cwdBasename}`);
733
+ this.ui.terminal.setTitle(`${APP_TITLE} - ${cwdBasename}`);
722
734
  }
723
735
  }
724
736
  /**
@@ -880,19 +892,14 @@ export class InteractiveMode {
880
892
  const entries = parseChangelog(changelogPath);
881
893
  if (!lastVersion) {
882
894
  // Fresh install - record the version, send telemetry, don't show changelog
883
- this.settingsManager.setLastChangelogVersion("0.84.0");
884
- this.reportInstallTelemetry("0.84.0");
895
+ this.settingsManager.setLastChangelogVersion(VERSION);
896
+ this.reportInstallTelemetry(VERSION);
885
897
  return undefined;
886
898
  }
887
899
  const newEntries = getNewEntries(entries, lastVersion);
888
- if (entries.length > 0 && newEntries.length === entries.length) {
889
- this.settingsManager.setLastChangelogVersion("0.84.0");
890
- this.reportInstallTelemetry("0.84.0");
891
- return normalizeChangelogLinks(entries[0].content, entries[0]);
892
- }
893
900
  if (newEntries.length > 0) {
894
- this.settingsManager.setLastChangelogVersion("0.84.0");
895
- this.reportInstallTelemetry("0.84.0");
901
+ this.settingsManager.setLastChangelogVersion(VERSION);
902
+ this.reportInstallTelemetry(VERSION);
896
903
  return newEntries.map((e) => normalizeChangelogLinks(e.content, e)).join("\n\n");
897
904
  }
898
905
  return undefined;
@@ -1230,7 +1237,7 @@ export class InteractiveMode {
1230
1237
  const skillsResult = this.session.resourceLoader.getSkills();
1231
1238
  const promptsResult = this.session.resourceLoader.getPrompts();
1232
1239
  const themesResult = this.session.resourceLoader.getThemes();
1233
- let extensions = options?.extensions ??
1240
+ const extensions = options?.extensions ??
1234
1241
  this.session.resourceLoader
1235
1242
  .getExtensions()
1236
1243
  .extensions.filter((extension) => !extension.hidden)
@@ -1301,9 +1308,6 @@ export class InteractiveMode {
1301
1308
  const promptCompactList = formatCompactList(templates.map((template) => `/${template.name}`));
1302
1309
  addLoadedSection("Prompts", promptCompactList, templateList);
1303
1310
  }
1304
- const prismInternalExtensions = new Set(["caveman-mode.ts", "clear-session.ts", "git-commit.ts", "plan-command.ts", "voice-command.ts", "obsidian-memory.ts", "logseq-memory.ts", "honcho-memory.ts", "research-tools.ts", "ai-memory-system.ts", "rp-memory.ts", "manifest-provider.ts", "ollama-provider.ts", "toolbox.ts", "context-usage.ts", "prism-status.ts", "toolbar.ts", "pi-mcp-adapter"]);
1305
- const prismInternalNpmPackages = new Set(["pi-mcp-adapter"]);
1306
- extensions = extensions.filter((extension) => !(() => { const prismExtensionPath = String(extension.path || "").replaceAll("\\", "/"); const prismExtensionSource = String(extension.sourceInfo?.source || ""); return prismInternalExtensions.has(path.basename(prismExtensionPath)) || Array.from(prismInternalNpmPackages).some((pkg) => prismExtensionSource === "npm:" + pkg || prismExtensionPath.includes("/node_modules/" + pkg + "/")); })());
1307
1311
  if (extensions.length > 0) {
1308
1312
  const groups = this.buildScopeGroups(extensions);
1309
1313
  const extList = this.formatScopeGroups(groups, {
@@ -1315,8 +1319,7 @@ export class InteractiveMode {
1315
1319
  }
1316
1320
  // Show loaded themes (excluding built-in)
1317
1321
  const loadedThemes = themesResult.themes;
1318
- const prismInternalThemes = new Set(["soft-green"]);
1319
- const customThemes = loadedThemes.filter((t) => t.sourcePath && !prismInternalThemes.has(t.name));
1322
+ const customThemes = loadedThemes.filter((t) => t.sourcePath);
1320
1323
  if (customThemes.length > 0) {
1321
1324
  const groups = this.buildScopeGroups(customThemes.map((loadedTheme) => ({
1322
1325
  path: loadedTheme.sourcePath,
@@ -2249,6 +2252,22 @@ export class InteractiveMode {
2249
2252
  void this.handleClipboardPaste();
2250
2253
  };
2251
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
+ }
2252
2271
  async handleClipboardPaste() {
2253
2272
  try {
2254
2273
  const image = await readClipboardImage();
@@ -2376,27 +2395,6 @@ export class InteractiveMode {
2376
2395
  await this.handleCompactCommand(customInstructions);
2377
2396
  return;
2378
2397
  }
2379
- if (text === "/plan" || text.startsWith("/plan ")) {
2380
- const task = text.startsWith("/plan ") ? text.slice(6).trim() : "";
2381
- this.editor.setText("");
2382
- await this.startPrismPlanMode(task);
2383
- return;
2384
- }
2385
- if (text === "/plan:approve") {
2386
- this.editor.setText("");
2387
- await this.approvePrismPlan();
2388
- return;
2389
- }
2390
- if (text === "/plan:reject") {
2391
- this.editor.setText("");
2392
- this.rejectPrismPlan();
2393
- return;
2394
- }
2395
- if (text === "/plan:cancel") {
2396
- this.editor.setText("");
2397
- this.cancelPrismPlan();
2398
- return;
2399
- }
2400
2398
  if (text === "/reload") {
2401
2399
  this.editor.setText("");
2402
2400
  await this.handleReloadCommand();
@@ -3364,7 +3362,6 @@ export class InteractiveMode {
3364
3362
  this.ui.requestRender();
3365
3363
  }
3366
3364
  showError(errorMessage) {
3367
- errorMessage = this.humanizeUsageLimitError(errorMessage);
3368
3365
  this.chatContainer.addChild(new Spacer(1));
3369
3366
  this.chatContainer.addChild(new Text(theme.fg("error", `Error: ${errorMessage}`), this.outputPad, 0));
3370
3367
  this.ui.requestRender();
@@ -3948,188 +3945,6 @@ export class InteractiveMode {
3948
3945
  return { component: selector, focus: selector };
3949
3946
  });
3950
3947
  }
3951
- formatUsageLimitDuration(ms) {
3952
- const totalMinutes = Math.ceil(ms / 60000);
3953
- const hours = Math.floor(totalMinutes / 60);
3954
- const minutes = totalMinutes % 60;
3955
- const parts = [];
3956
- if (hours > 0) parts.push(hours + "h");
3957
- if (minutes > 0 || parts.length === 0) parts.push(minutes + "min");
3958
- return parts.join(" ");
3959
- }
3960
- humanizeUsageLimitError(errorMessage) {
3961
- return String(errorMessage || "").replace(/(~|about\s*)?(\d+)\s*min\b/gi, (_match, prefix, minutes) => {
3962
- return (prefix || "") + this.formatUsageLimitDuration(Number(minutes) * 60 * 1000);
3963
- });
3964
- }
3965
- extractUsageLimitWaitMs(errorMessage) {
3966
- const text = String(errorMessage || "");
3967
- const parsedSeconds = text.match(/"(?:resets_in_seconds|X-Codex-Primary-Reset-After-Seconds|Retry-After)"\s*:?\s*"?(\d+)"?/i)?.[1];
3968
- if (parsedSeconds) return Number(parsedSeconds) * 1000;
3969
- const resetAt = text.match(/"(?:resets_at|X-Codex-Primary-Reset-At)"\s*:?\s*"?(\d+)"?/i)?.[1];
3970
- if (resetAt) {
3971
- const resetMs = Number(resetAt) * 1000 - Date.now();
3972
- if (Number.isFinite(resetMs) && resetMs > 0) return resetMs;
3973
- }
3974
- const hours = text.match(/(?:~|about\s*)?(\d+)\s*h(?:our)?/i)?.[1];
3975
- if (hours) return Number(hours) * 60 * 60 * 1000;
3976
- const minutes = text.match(/(?:~|about\s*)?(\d+)\s*min/i)?.[1];
3977
- if (minutes) return Number(minutes) * 60 * 1000;
3978
- const seconds = text.match(/(?:~|about\s*)?(\d+)\s*s(?:ec|econd)?/i)?.[1];
3979
- if (seconds) return Number(seconds) * 1000;
3980
- return 5 * 60 * 1000;
3981
- }
3982
- getUsageLimitError(event) {
3983
- const last = event?.messages?.[event.messages.length - 1];
3984
- const errorMessage = last?.errorMessage || last?.content?.find?.((block) => block?.type === "text")?.text || "";
3985
- if (last?.role !== "assistant" || last?.stopReason !== "error") return undefined;
3986
- return /usage limit|try again in/i.test(errorMessage) ? String(errorMessage) : undefined;
3987
- }
3988
- removeLastAssistantErrorFromState() {
3989
- const messages = this.agent.state.messages;
3990
- const last = messages[messages.length - 1];
3991
- if (last?.role === "assistant" && last?.stopReason === "error") this.agent.state.messages = messages.slice(0, -1);
3992
- }
3993
- async continueAfterUsageLimitRecovery() {
3994
- try {
3995
- await this.agent.continue();
3996
- } catch (error) {
3997
- this.showError(error instanceof Error ? error.message : String(error));
3998
- }
3999
- }
4000
- maybeShowUsageLimitRecoveryMenu(event) {
4001
- const errorMessage = this.getUsageLimitError(event);
4002
- if (!errorMessage) return;
4003
- const delayMs = this.extractUsageLimitWaitMs(errorMessage);
4004
- const waitLabel = "Wait " + this.formatUsageLimitDuration(delayMs) + " then retry";
4005
- this.showSelector((done) => {
4006
- const selector = new ExtensionSelectorComponent("Usage limit hit", [waitLabel, "Change model and retry", "Cancel"], async (selected) => {
4007
- done();
4008
- if (selected === "Cancel") return;
4009
- this.removeLastAssistantErrorFromState();
4010
- if (selected === waitLabel) {
4011
- const endTime = Date.now() + delayMs;
4012
- const updateCountdown = () => {
4013
- const remaining = Math.max(0, endTime - Date.now());
4014
- this.showStatus("Waiting " + this.formatUsageLimitDuration(remaining) + " for usage limit, then retrying...");
4015
- this.ui.requestRender();
4016
- };
4017
- updateCountdown();
4018
- const countdownInterval = setInterval(updateCountdown, 60000);
4019
- setTimeout(() => { clearInterval(countdownInterval); void this.continueAfterUsageLimitRecovery(); }, delayMs);
4020
- return;
4021
- }
4022
- this.showUsageLimitModelSelector();
4023
- }, () => {
4024
- done();
4025
- this.ui.requestRender();
4026
- }, { tui: this.ui });
4027
- return { component: selector, focus: selector };
4028
- });
4029
- }
4030
- showUsageLimitModelSelector(initialSearchInput) {
4031
- this.showSelector((done) => {
4032
- const selector = new ModelSelectorComponent(this.ui, this.session.model, this.settingsManager, this.session.modelRegistry, this.session.scopedModels, async (model) => {
4033
- try {
4034
- await this.session.setModel(model);
4035
- this.footer.invalidate();
4036
- this.updateEditorBorderColor();
4037
- done();
4038
- this.showStatus("Model: " + model.id + "; retrying...");
4039
- void this.maybeWarnAboutAnthropicSubscriptionAuth(model);
4040
- this.checkDaxnutsEasterEgg(model);
4041
- void this.continueAfterUsageLimitRecovery();
4042
- } catch (error) {
4043
- done();
4044
- this.showError(error instanceof Error ? error.message : String(error));
4045
- }
4046
- }, () => {
4047
- done();
4048
- this.ui.requestRender();
4049
- }, initialSearchInput);
4050
- return { component: selector, focus: selector };
4051
- });
4052
- }
4053
- getPrismReadOnlyToolNames() {
4054
- const readOnly = new Set(["read", "grep", "find", "ls", "obsidian_memory_read", "obsidian_memory_search", "obsidian_memory_list", "web_search", "web_fetch"]);
4055
- return this.session.getActiveToolNames().filter((name) => readOnly.has(name));
4056
- }
4057
- setPrismPlanStatus(enabled) {
4058
- this.prismPlanMode = enabled;
4059
- this.setExtensionStatus("prism-mode", enabled ? "[Plan]" : undefined);
4060
- this.footer.invalidate();
4061
- }
4062
- async startPrismPlanMode(task) {
4063
- if (!this.prismPlanPreviousTools) this.prismPlanPreviousTools = this.session.getActiveToolNames();
4064
- if (this.prismPlanLeafId === undefined) this.prismPlanLeafId = this.session.sessionManager.getLeafId();
4065
- this.session.setActiveToolsByName(this.getPrismReadOnlyToolNames());
4066
- this.setPrismPlanStatus(true);
4067
- globalThis.__PRISM_MANIFEST_TIER_OVERRIDE__ = "plan";
4068
- const prompt = "PLAN MODE ACTIVE. You must only inspect and plan. Do not modify files or run mutating commands. Ask concise clarification questions if needed. When ready, write the full implementation plan, then end with exactly: /plan:ready\n\nTask: " + (task || "Create an implementation plan for the user's next change.");
4069
- await this.session.prompt(prompt);
4070
- }
4071
- getPrismLastAssistantText(event) {
4072
- const last = event?.messages?.[event.messages.length - 1];
4073
- if (last?.role !== "assistant") return "";
4074
- return (last.content || []).map((block) => block?.type === "text" ? block.text || "" : "").join("\n");
4075
- }
4076
- maybeShowPrismPlanApprovalMenu(event) {
4077
- if (!this.prismPlanMode) return;
4078
- const text = this.getPrismLastAssistantText(event);
4079
- if (!text.includes("/plan:ready")) return;
4080
- this.prismPlanText = text.replace("/plan:ready", "").trim();
4081
- this.showSelector((done) => {
4082
- const selector = new ExtensionSelectorComponent("Plan ready", ["Approve -> make changes", "Reject -> add more context", "Cancel plan"], async (selected) => {
4083
- done();
4084
- if (selected.startsWith("Approve")) return void this.approvePrismPlan();
4085
- if (selected.startsWith("Reject")) return this.rejectPrismPlan();
4086
- this.cancelPrismPlan();
4087
- }, () => {
4088
- done();
4089
- this.ui.requestRender();
4090
- }, { tui: this.ui });
4091
- return { component: selector, focus: selector };
4092
- });
4093
- }
4094
- restorePrismPlanTools() {
4095
- if (this.prismPlanPreviousTools) this.session.setActiveToolsByName(this.prismPlanPreviousTools);
4096
- this.prismPlanPreviousTools = undefined;
4097
- if (globalThis.__PRISM_MANIFEST_TIER_OVERRIDE__ === "plan") globalThis.__PRISM_MANIFEST_TIER_OVERRIDE__ = undefined;
4098
- this.setPrismPlanStatus(false);
4099
- }
4100
- restorePrismPlanBranch() {
4101
- if (this.prismPlanLeafId === undefined) return;
4102
- if (this.prismPlanLeafId === null) {
4103
- this.session.sessionManager.resetLeaf();
4104
- } else {
4105
- this.session.sessionManager.branch(this.prismPlanLeafId);
4106
- }
4107
- this.agent.state.messages = this.session.sessionManager.buildSessionContext().messages;
4108
- this.prismPlanLeafId = undefined;
4109
- }
4110
- async approvePrismPlan() {
4111
- if (!this.prismPlanMode) return this.showWarning("No active plan to approve.");
4112
- const planText = this.prismPlanText || "";
4113
- this.prismPlanText = undefined;
4114
- this.restorePrismPlanBranch();
4115
- this.restorePrismPlanTools();
4116
- await this.session.prompt("Implement this plan:\n\n" + planText);
4117
- }
4118
- rejectPrismPlan() {
4119
- if (!this.prismPlanMode) return this.showWarning("No active plan to reject.");
4120
- this.prismPlanText = undefined;
4121
- this.editor.setText("/plan ");
4122
- this.showStatus("Add more context after /plan and submit.");
4123
- this.ui.requestRender();
4124
- }
4125
- cancelPrismPlan() {
4126
- if (!this.prismPlanMode) return this.showWarning("No active plan to cancel.");
4127
- this.restorePrismPlanBranch();
4128
- this.prismPlanText = undefined;
4129
- this.restorePrismPlanTools();
4130
- this.showStatus("Plan cancelled");
4131
- this.ui.requestRender();
4132
- }
4133
3948
  showModelSelector(initialSearchInput) {
4134
3949
  this.showSelector((done) => {
4135
3950
  const selector = new ModelSelectorComponent(this.ui, this.session.model, this.settingsManager, this.session.modelRuntime, this.session.scopedModels, async (model) => {