@earendil-works/pi-coding-agent 0.87.0 → 0.99.0

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 (743) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/README.md +25 -711
  3. package/dist/bun/cli.d.ts.map +1 -1
  4. package/dist/bun/restore-sandbox-env.d.ts.map +1 -1
  5. package/dist/bun/restore-sandbox-env.js.map +1 -1
  6. package/dist/bun/runtime-setup.d.ts.map +1 -1
  7. package/dist/bun/runtime-setup.js +4 -1
  8. package/dist/bun/runtime-setup.js.map +1 -1
  9. package/dist/bun/sandbox-env-setup.d.ts.map +1 -1
  10. package/dist/bundle/chunks/anthropic-messages-A6EXUBG6.js +6 -0
  11. package/dist/bundle/chunks/anthropic.js +2 -2
  12. package/dist/bundle/chunks/azure-openai-responses-EN5WOBET.js +2 -0
  13. package/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
  14. package/dist/bundle/chunks/chunk-4CSSZFEW.js +1435 -0
  15. package/dist/bundle/chunks/chunk-7JGR3GZN.js +11 -0
  16. package/dist/bundle/chunks/chunk-AXPY26X7.js +146 -0
  17. package/dist/bundle/chunks/chunk-EPDRUIU6.js +2 -0
  18. package/dist/bundle/chunks/chunk-GOPCREV2.js +4 -0
  19. package/dist/bundle/chunks/chunk-H3QXYIF7.js +31 -0
  20. package/dist/bundle/chunks/{chunk-S7SZN6Z3.js → chunk-HSPCVFST.js} +1 -1
  21. package/dist/bundle/chunks/chunk-IMTXZUO7.js +82 -0
  22. package/dist/bundle/chunks/chunk-J4CWPC4N.js +2 -0
  23. package/dist/bundle/chunks/chunk-LLMKQWZS.js +21 -0
  24. package/dist/bundle/chunks/{chunk-WIUZI2CJ.js → chunk-LRS5S6EK.js} +3 -3
  25. package/dist/bundle/chunks/chunk-PEHWOV5U.js +187 -0
  26. package/dist/bundle/chunks/{chunk-XDUWOHPL.js → chunk-S3GGRYIO.js} +2 -2
  27. package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
  28. package/dist/bundle/chunks/{chunk-FUXEF6JQ.js → chunk-W2DOMZSC.js} +1 -1
  29. package/dist/bundle/chunks/cli-AZXNGIZH.js +49 -0
  30. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-XJQQYGGU.js +2 -0
  31. package/dist/bundle/chunks/codemode-worker.js +295 -0
  32. package/dist/bundle/chunks/execute-7XXPZAWW.js +308 -0
  33. package/dist/bundle/chunks/github-copilot.js +1 -1
  34. package/dist/bundle/chunks/google-generative-ai-CQAKKJTA.js +2 -0
  35. package/dist/bundle/chunks/google-vertex-AE36YXJU.js +2 -0
  36. package/dist/bundle/chunks/{lib-HGQMNYVT.js → lib-TEDK3E5I.js} +2 -2
  37. package/dist/bundle/chunks/llama-cpp-classify-PJJYKPLD.js +22 -0
  38. package/dist/bundle/chunks/mistral-conversations-KEYTXJM7.js +5 -0
  39. package/dist/bundle/chunks/{openai-codex-responses-QDSOTBBO.js → openai-codex-responses-JQTCOVEG.js} +2 -2
  40. package/dist/bundle/chunks/openai-codex.js +2 -2
  41. package/dist/bundle/chunks/{openai-completions-XHML6MTL.js → openai-completions-XW2Q5HVC.js} +2 -2
  42. package/dist/bundle/chunks/openai-responses-6AXWFL75.js +3 -0
  43. package/dist/bundle/chunks/{openrouter-images-N4XVVFSD.js → openrouter-images-TPQ4V6OR.js} +1 -1
  44. package/dist/bundle/chunks/openrouter.js +2 -2
  45. package/dist/bundle/chunks/{pi-messages-GFKBWJHZ.js → pi-messages-TM5SOOIW.js} +2 -2
  46. package/dist/bundle/chunks/radius.js +2 -2
  47. package/dist/bundle/chunks/runtime-G5WJPRBM.js +2 -0
  48. package/dist/bundle/chunks/typesafe-system-one-E7A4HNJI.js +2 -0
  49. package/dist/bundle/chunks/virtual-modules-AQ3FLU6H.js +2 -0
  50. package/dist/bundle/cli-runtime.js +1 -1
  51. package/dist/bundle/index.js +1 -1
  52. package/dist/bundle/rpc-entry.js +1 -1
  53. package/dist/cli/args.d.ts.map +1 -1
  54. package/dist/cli/args.js +18 -7
  55. package/dist/cli/args.js.map +1 -1
  56. package/dist/cli/auth-check.d.ts.map +1 -1
  57. package/dist/cli/auth-check.js.map +1 -1
  58. package/dist/cli/auth-command.d.ts.map +1 -1
  59. package/dist/cli/auth-command.js.map +1 -1
  60. package/dist/cli/config-selector.d.ts.map +1 -1
  61. package/dist/cli/config-selector.js.map +1 -1
  62. package/dist/cli/credential-print.d.ts.map +1 -1
  63. package/dist/cli/credential-print.js.map +1 -1
  64. package/dist/cli/file-processor.d.ts.map +1 -1
  65. package/dist/cli/file-processor.js.map +1 -1
  66. package/dist/cli/initial-message.d.ts +1 -1
  67. package/dist/cli/initial-message.d.ts.map +1 -1
  68. package/dist/cli/initial-message.js.map +1 -1
  69. package/dist/cli/list-models.d.ts.map +1 -1
  70. package/dist/cli/list-models.js.map +1 -1
  71. package/dist/cli/project-trust.d.ts.map +1 -1
  72. package/dist/cli/project-trust.js.map +1 -1
  73. package/dist/cli/session-picker.d.ts.map +1 -1
  74. package/dist/cli/session-picker.js.map +1 -1
  75. package/dist/cli/setup.d.ts.map +1 -1
  76. package/dist/cli/setup.js.map +1 -1
  77. package/dist/cli/startup-ui.d.ts.map +1 -1
  78. package/dist/cli/startup-ui.js +38 -30
  79. package/dist/cli/startup-ui.js.map +1 -1
  80. package/dist/cli.d.ts.map +1 -1
  81. package/dist/config.d.ts +18 -4
  82. package/dist/config.d.ts.map +1 -1
  83. package/dist/config.js +30 -4
  84. package/dist/config.js.map +1 -1
  85. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  86. package/dist/core/agent-session-runtime.js +1 -1
  87. package/dist/core/agent-session-runtime.js.map +1 -1
  88. package/dist/core/agent-session-services.d.ts.map +1 -1
  89. package/dist/core/agent-session-services.js +13 -0
  90. package/dist/core/agent-session-services.js.map +1 -1
  91. package/dist/core/agent-session.d.ts +135 -11
  92. package/dist/core/agent-session.d.ts.map +1 -1
  93. package/dist/core/agent-session.js +509 -253
  94. package/dist/core/agent-session.js.map +1 -1
  95. package/dist/core/auth-guidance.d.ts.map +1 -1
  96. package/dist/core/auth-guidance.js.map +1 -1
  97. package/dist/core/auth-storage.d.ts.map +1 -1
  98. package/dist/core/auth-storage.js.map +1 -1
  99. package/dist/core/bash-executor.d.ts.map +1 -1
  100. package/dist/core/bash-executor.js.map +1 -1
  101. package/dist/core/bug-report-upload.d.ts.map +1 -1
  102. package/dist/core/bug-report-upload.js.map +1 -1
  103. package/dist/core/bug-report.d.ts +1 -1
  104. package/dist/core/bug-report.d.ts.map +1 -1
  105. package/dist/core/bug-report.js +1 -1
  106. package/dist/core/bug-report.js.map +1 -1
  107. package/dist/core/cache-stats.d.ts.map +1 -1
  108. package/dist/core/cache-stats.js.map +1 -1
  109. package/dist/core/cache-warmer.d.ts.map +1 -1
  110. package/dist/core/cache-warmer.js.map +1 -1
  111. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  112. package/dist/core/compaction/branch-summarization.js.map +1 -1
  113. package/dist/core/compaction/compaction.d.ts.map +1 -1
  114. package/dist/core/compaction/compaction.js +10 -31
  115. package/dist/core/compaction/compaction.js.map +1 -1
  116. package/dist/core/compaction/index.d.ts.map +1 -1
  117. package/dist/core/compaction/utils.d.ts +2 -1
  118. package/dist/core/compaction/utils.d.ts.map +1 -1
  119. package/dist/core/compaction/utils.js +25 -18
  120. package/dist/core/compaction/utils.js.map +1 -1
  121. package/dist/core/crash-log.d.ts.map +1 -1
  122. package/dist/core/crash-log.js +2 -1
  123. package/dist/core/crash-log.js.map +1 -1
  124. package/dist/core/defaults.d.ts.map +1 -1
  125. package/dist/core/diagnostics.d.ts.map +1 -1
  126. package/dist/core/event-bus.d.ts.map +1 -1
  127. package/dist/core/event-bus.js.map +1 -1
  128. package/dist/core/exec.d.ts.map +1 -1
  129. package/dist/core/exec.js.map +1 -1
  130. package/dist/core/experimental.d.ts.map +1 -1
  131. package/dist/core/experimental.js.map +1 -1
  132. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  133. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  134. package/dist/core/export-html/index.d.ts.map +1 -1
  135. package/dist/core/export-html/index.js.map +1 -1
  136. package/dist/core/export-html/template.css +10 -0
  137. package/dist/core/export-html/template.js +66 -17
  138. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  139. package/dist/core/export-html/tool-renderer.js.map +1 -1
  140. package/dist/core/extensions/index.d.ts +1 -1
  141. package/dist/core/extensions/index.d.ts.map +1 -1
  142. package/dist/core/extensions/index.js.map +1 -1
  143. package/dist/core/extensions/jiti-loader.d.ts.map +1 -1
  144. package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -1
  145. package/dist/core/extensions/loader.d.ts.map +1 -1
  146. package/dist/core/extensions/loader.js +55 -5
  147. package/dist/core/extensions/loader.js.map +1 -1
  148. package/dist/core/extensions/runner.d.ts +18 -1
  149. package/dist/core/extensions/runner.d.ts.map +1 -1
  150. package/dist/core/extensions/runner.js +99 -0
  151. package/dist/core/extensions/runner.js.map +1 -1
  152. package/dist/core/extensions/types.d.ts +296 -22
  153. package/dist/core/extensions/types.d.ts.map +1 -1
  154. package/dist/core/extensions/types.js.map +1 -1
  155. package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
  156. package/dist/core/extensions/wrapper.d.ts +2 -2
  157. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  158. package/dist/core/extensions/wrapper.js +3 -3
  159. package/dist/core/extensions/wrapper.js.map +1 -1
  160. package/dist/core/footer-data-provider.d.ts.map +1 -1
  161. package/dist/core/footer-data-provider.js.map +1 -1
  162. package/dist/core/http-dispatcher.d.ts.map +1 -1
  163. package/dist/core/http-dispatcher.js.map +1 -1
  164. package/dist/core/index.d.ts.map +1 -1
  165. package/dist/core/keybindings.d.ts +1 -1
  166. package/dist/core/keybindings.d.ts.map +1 -1
  167. package/dist/core/keybindings.js +1 -1
  168. package/dist/core/keybindings.js.map +1 -1
  169. package/dist/core/mcp-servers.d.ts +98 -0
  170. package/dist/core/mcp-servers.d.ts.map +1 -0
  171. package/dist/core/mcp-servers.js +157 -0
  172. package/dist/core/mcp-servers.js.map +1 -0
  173. package/dist/core/messages.d.ts.map +1 -1
  174. package/dist/core/messages.js.map +1 -1
  175. package/dist/core/model-config.d.ts.map +1 -1
  176. package/dist/core/model-config.js.map +1 -1
  177. package/dist/core/model-registry.d.ts +13 -1
  178. package/dist/core/model-registry.d.ts.map +1 -1
  179. package/dist/core/model-registry.js +25 -0
  180. package/dist/core/model-registry.js.map +1 -1
  181. package/dist/core/model-resolver.d.ts +2 -2
  182. package/dist/core/model-resolver.d.ts.map +1 -1
  183. package/dist/core/model-resolver.js +5 -5
  184. package/dist/core/model-resolver.js.map +1 -1
  185. package/dist/core/model-runtime.d.ts +41 -3
  186. package/dist/core/model-runtime.d.ts.map +1 -1
  187. package/dist/core/model-runtime.js +167 -17
  188. package/dist/core/model-runtime.js.map +1 -1
  189. package/dist/core/models-store.d.ts.map +1 -1
  190. package/dist/core/models-store.js.map +1 -1
  191. package/dist/core/nested-tool-calls.d.ts +102 -0
  192. package/dist/core/nested-tool-calls.d.ts.map +1 -0
  193. package/dist/core/nested-tool-calls.js +178 -0
  194. package/dist/core/nested-tool-calls.js.map +1 -0
  195. package/dist/core/output-guard.d.ts.map +1 -1
  196. package/dist/core/output-guard.js.map +1 -1
  197. package/dist/core/package-manager.d.ts +4 -0
  198. package/dist/core/package-manager.d.ts.map +1 -1
  199. package/dist/core/package-manager.js +59 -12
  200. package/dist/core/package-manager.js.map +1 -1
  201. package/dist/core/pi-manifest.d.ts.map +1 -1
  202. package/dist/core/pi-manifest.js.map +1 -1
  203. package/dist/core/project-trust.d.ts.map +1 -1
  204. package/dist/core/project-trust.js.map +1 -1
  205. package/dist/core/prompt-templates.d.ts.map +1 -1
  206. package/dist/core/prompt-templates.js.map +1 -1
  207. package/dist/core/provider-attribution.d.ts.map +1 -1
  208. package/dist/core/provider-attribution.js.map +1 -1
  209. package/dist/core/provider-composer.d.ts +40 -21
  210. package/dist/core/provider-composer.d.ts.map +1 -1
  211. package/dist/core/provider-composer.js +92 -40
  212. package/dist/core/provider-composer.js.map +1 -1
  213. package/dist/core/radius.d.ts.map +1 -1
  214. package/dist/core/radius.js.map +1 -1
  215. package/dist/core/remote-catalog-provider.d.ts +8 -1
  216. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  217. package/dist/core/remote-catalog-provider.js +18 -3
  218. package/dist/core/remote-catalog-provider.js.map +1 -1
  219. package/dist/core/resolve-config-value.d.ts.map +1 -1
  220. package/dist/core/resolve-config-value.js.map +1 -1
  221. package/dist/core/resource-loader.d.ts +7 -1
  222. package/dist/core/resource-loader.d.ts.map +1 -1
  223. package/dist/core/resource-loader.js +161 -35
  224. package/dist/core/resource-loader.js.map +1 -1
  225. package/dist/core/runtime-credentials.d.ts.map +1 -1
  226. package/dist/core/runtime-credentials.js.map +1 -1
  227. package/dist/core/sdk.d.ts +1 -1
  228. package/dist/core/sdk.d.ts.map +1 -1
  229. package/dist/core/sdk.js +24 -6
  230. package/dist/core/sdk.js.map +1 -1
  231. package/dist/core/session-cwd.d.ts.map +1 -1
  232. package/dist/core/session-cwd.js.map +1 -1
  233. package/dist/core/session-export.d.ts.map +1 -1
  234. package/dist/core/session-export.js.map +1 -1
  235. package/dist/core/session-manager.d.ts +9 -0
  236. package/dist/core/session-manager.d.ts.map +1 -1
  237. package/dist/core/session-manager.js +22 -22
  238. package/dist/core/session-manager.js.map +1 -1
  239. package/dist/core/settings-diagnostics.d.ts.map +1 -1
  240. package/dist/core/settings-diagnostics.js.map +1 -1
  241. package/dist/core/settings-manager.d.ts +31 -1
  242. package/dist/core/settings-manager.d.ts.map +1 -1
  243. package/dist/core/settings-manager.js +72 -2
  244. package/dist/core/settings-manager.js.map +1 -1
  245. package/dist/core/skills.d.ts.map +1 -1
  246. package/dist/core/skills.js.map +1 -1
  247. package/dist/core/slash-commands.d.ts.map +1 -1
  248. package/dist/core/source-info.d.ts +8 -0
  249. package/dist/core/source-info.d.ts.map +1 -1
  250. package/dist/core/source-info.js +16 -0
  251. package/dist/core/source-info.js.map +1 -1
  252. package/dist/core/system-prompt.d.ts.map +1 -1
  253. package/dist/core/system-prompt.js +1 -1
  254. package/dist/core/system-prompt.js.map +1 -1
  255. package/dist/core/telemetry.d.ts.map +1 -1
  256. package/dist/core/telemetry.js.map +1 -1
  257. package/dist/core/timings.d.ts.map +1 -1
  258. package/dist/core/timings.js.map +1 -1
  259. package/dist/core/tools/bash.d.ts +12 -0
  260. package/dist/core/tools/bash.d.ts.map +1 -1
  261. package/dist/core/tools/bash.js +35 -2
  262. package/dist/core/tools/bash.js.map +1 -1
  263. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  264. package/dist/core/tools/edit-diff.js.map +1 -1
  265. package/dist/core/tools/edit.d.ts.map +1 -1
  266. package/dist/core/tools/edit.js.map +1 -1
  267. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
  268. package/dist/core/tools/file-mutation-queue.js.map +1 -1
  269. package/dist/core/tools/find.d.ts.map +1 -1
  270. package/dist/core/tools/find.js.map +1 -1
  271. package/dist/core/tools/grep.d.ts.map +1 -1
  272. package/dist/core/tools/grep.js.map +1 -1
  273. package/dist/core/tools/index.d.ts.map +1 -1
  274. package/dist/core/tools/index.js.map +1 -1
  275. package/dist/core/tools/ls.d.ts.map +1 -1
  276. package/dist/core/tools/ls.js.map +1 -1
  277. package/dist/core/tools/output-accumulator.d.ts +11 -0
  278. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  279. package/dist/core/tools/output-accumulator.js +36 -0
  280. package/dist/core/tools/output-accumulator.js.map +1 -1
  281. package/dist/core/tools/path-utils.d.ts.map +1 -1
  282. package/dist/core/tools/path-utils.js.map +1 -1
  283. package/dist/core/tools/powershell.d.ts.map +1 -1
  284. package/dist/core/tools/powershell.js.map +1 -1
  285. package/dist/core/tools/read.d.ts.map +1 -1
  286. package/dist/core/tools/read.js.map +1 -1
  287. package/dist/core/tools/render-utils.d.ts +6 -0
  288. package/dist/core/tools/render-utils.d.ts.map +1 -1
  289. package/dist/core/tools/render-utils.js +26 -0
  290. package/dist/core/tools/render-utils.js.map +1 -1
  291. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  292. package/dist/core/tools/renderers/bash.js +9 -10
  293. package/dist/core/tools/renderers/bash.js.map +1 -1
  294. package/dist/core/tools/renderers/edit.d.ts.map +1 -1
  295. package/dist/core/tools/renderers/edit.js.map +1 -1
  296. package/dist/core/tools/renderers/find.d.ts.map +1 -1
  297. package/dist/core/tools/renderers/find.js.map +1 -1
  298. package/dist/core/tools/renderers/grep.d.ts.map +1 -1
  299. package/dist/core/tools/renderers/grep.js.map +1 -1
  300. package/dist/core/tools/renderers/index.d.ts.map +1 -1
  301. package/dist/core/tools/renderers/index.js.map +1 -1
  302. package/dist/core/tools/renderers/ls.d.ts.map +1 -1
  303. package/dist/core/tools/renderers/ls.js.map +1 -1
  304. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  305. package/dist/core/tools/renderers/read.js +3 -2
  306. package/dist/core/tools/renderers/read.js.map +1 -1
  307. package/dist/core/tools/renderers/write.d.ts.map +1 -1
  308. package/dist/core/tools/renderers/write.js.map +1 -1
  309. package/dist/core/tools/tool-definition-wrapper.d.ts +5 -3
  310. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  311. package/dist/core/tools/tool-definition-wrapper.js +3 -1
  312. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  313. package/dist/core/tools/truncate.d.ts +14 -0
  314. package/dist/core/tools/truncate.d.ts.map +1 -1
  315. package/dist/core/tools/truncate.js +29 -0
  316. package/dist/core/tools/truncate.js.map +1 -1
  317. package/dist/core/tools/write.d.ts.map +1 -1
  318. package/dist/core/tools/write.js.map +1 -1
  319. package/dist/core/trust-manager.d.ts.map +1 -1
  320. package/dist/core/trust-manager.js +1 -0
  321. package/dist/core/trust-manager.js.map +1 -1
  322. package/dist/core/usage-totals.d.ts +2 -0
  323. package/dist/core/usage-totals.d.ts.map +1 -1
  324. package/dist/core/usage-totals.js +23 -0
  325. package/dist/core/usage-totals.js.map +1 -1
  326. package/dist/core/virtual-models.d.ts +115 -0
  327. package/dist/core/virtual-models.d.ts.map +1 -0
  328. package/dist/core/virtual-models.js +117 -0
  329. package/dist/core/virtual-models.js.map +1 -0
  330. package/dist/extensions/codemode/execute.d.ts +16 -0
  331. package/dist/extensions/codemode/execute.d.ts.map +1 -0
  332. package/dist/extensions/codemode/execute.js +390 -0
  333. package/dist/extensions/codemode/execute.js.map +1 -0
  334. package/dist/extensions/codemode/execute.lazy.d.ts +3 -0
  335. package/dist/extensions/codemode/execute.lazy.d.ts.map +1 -0
  336. package/dist/extensions/codemode/execute.lazy.js +3 -0
  337. package/dist/extensions/codemode/execute.lazy.js.map +1 -0
  338. package/dist/extensions/codemode/index.d.ts +21 -0
  339. package/dist/extensions/codemode/index.d.ts.map +1 -0
  340. package/dist/extensions/codemode/index.js +31 -0
  341. package/dist/extensions/codemode/index.js.map +1 -0
  342. package/dist/extensions/codemode/renderer.d.ts +12 -0
  343. package/dist/extensions/codemode/renderer.d.ts.map +1 -0
  344. package/dist/extensions/codemode/renderer.js +119 -0
  345. package/dist/extensions/codemode/renderer.js.map +1 -0
  346. package/dist/extensions/codemode/tool.d.ts +122 -0
  347. package/dist/extensions/codemode/tool.d.ts.map +1 -0
  348. package/dist/extensions/codemode/tool.js +324 -0
  349. package/dist/extensions/codemode/tool.js.map +1 -0
  350. package/dist/extensions/codemode/worker.d.ts +7 -0
  351. package/dist/extensions/codemode/worker.d.ts.map +1 -0
  352. package/dist/extensions/codemode/worker.js +7 -0
  353. package/dist/extensions/codemode/worker.js.map +1 -0
  354. package/dist/extensions/index.d.ts.map +1 -1
  355. package/dist/extensions/index.js +11 -1
  356. package/dist/extensions/index.js.map +1 -1
  357. package/dist/extensions/llama/client.d.ts.map +1 -1
  358. package/dist/extensions/llama/client.js.map +1 -1
  359. package/dist/extensions/llama/huggingface.d.ts.map +1 -1
  360. package/dist/extensions/llama/huggingface.js.map +1 -1
  361. package/dist/extensions/llama/index.d.ts.map +1 -1
  362. package/dist/extensions/llama/index.js.map +1 -1
  363. package/dist/extensions/llama/provider.d.ts +1 -1
  364. package/dist/extensions/llama/provider.d.ts.map +1 -1
  365. package/dist/extensions/llama/provider.js +65 -13
  366. package/dist/extensions/llama/provider.js.map +1 -1
  367. package/dist/extensions/llama/ui.d.ts.map +1 -1
  368. package/dist/extensions/llama/ui.js.map +1 -1
  369. package/dist/extensions/mcp/cli.d.ts +21 -0
  370. package/dist/extensions/mcp/cli.d.ts.map +1 -0
  371. package/dist/extensions/mcp/cli.js +485 -0
  372. package/dist/extensions/mcp/cli.js.map +1 -0
  373. package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
  374. package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
  375. package/dist/extensions/mcp/cli.lazy.js +3 -0
  376. package/dist/extensions/mcp/cli.lazy.js.map +1 -0
  377. package/dist/extensions/mcp/config.d.ts +70 -0
  378. package/dist/extensions/mcp/config.d.ts.map +1 -0
  379. package/dist/extensions/mcp/config.js +146 -0
  380. package/dist/extensions/mcp/config.js.map +1 -0
  381. package/dist/extensions/mcp/index.d.ts +52 -0
  382. package/dist/extensions/mcp/index.d.ts.map +1 -0
  383. package/dist/extensions/mcp/index.js +902 -0
  384. package/dist/extensions/mcp/index.js.map +1 -0
  385. package/dist/extensions/mcp/log.d.ts +16 -0
  386. package/dist/extensions/mcp/log.d.ts.map +1 -0
  387. package/dist/extensions/mcp/log.js +66 -0
  388. package/dist/extensions/mcp/log.js.map +1 -0
  389. package/dist/extensions/mcp/oauth.d.ts +94 -0
  390. package/dist/extensions/mcp/oauth.d.ts.map +1 -0
  391. package/dist/extensions/mcp/oauth.js +333 -0
  392. package/dist/extensions/mcp/oauth.js.map +1 -0
  393. package/dist/extensions/mcp/resources.d.ts +43 -0
  394. package/dist/extensions/mcp/resources.d.ts.map +1 -0
  395. package/dist/extensions/mcp/resources.js +262 -0
  396. package/dist/extensions/mcp/resources.js.map +1 -0
  397. package/dist/extensions/mcp/runtime.d.ts +96 -0
  398. package/dist/extensions/mcp/runtime.d.ts.map +1 -0
  399. package/dist/extensions/mcp/runtime.js +388 -0
  400. package/dist/extensions/mcp/runtime.js.map +1 -0
  401. package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
  402. package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
  403. package/dist/extensions/mcp/runtime.lazy.js +3 -0
  404. package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
  405. package/dist/extensions/mcp/tools.d.ts +83 -0
  406. package/dist/extensions/mcp/tools.d.ts.map +1 -0
  407. package/dist/extensions/mcp/tools.js +233 -0
  408. package/dist/extensions/mcp/tools.js.map +1 -0
  409. package/dist/extensions/mcp/ui.d.ts +60 -0
  410. package/dist/extensions/mcp/ui.d.ts.map +1 -0
  411. package/dist/extensions/mcp/ui.js +172 -0
  412. package/dist/extensions/mcp/ui.js.map +1 -0
  413. package/dist/extensions/tool-search/index.d.ts +12 -0
  414. package/dist/extensions/tool-search/index.d.ts.map +1 -0
  415. package/dist/extensions/tool-search/index.js +15 -0
  416. package/dist/extensions/tool-search/index.js.map +1 -0
  417. package/dist/extensions/tool-search/tool.d.ts +72 -0
  418. package/dist/extensions/tool-search/tool.d.ts.map +1 -0
  419. package/dist/extensions/tool-search/tool.js +210 -0
  420. package/dist/extensions/tool-search/tool.js.map +1 -0
  421. package/dist/index.d.ts +9 -2
  422. package/dist/index.d.ts.map +1 -1
  423. package/dist/index.js +5 -0
  424. package/dist/index.js.map +1 -1
  425. package/dist/main.d.ts.map +1 -1
  426. package/dist/main.js +10 -0
  427. package/dist/main.js.map +1 -1
  428. package/dist/migrations.d.ts.map +1 -1
  429. package/dist/migrations.js.map +1 -1
  430. package/dist/modes/index.d.ts.map +1 -1
  431. package/dist/modes/interactive/bug-report.d.ts.map +1 -1
  432. package/dist/modes/interactive/bug-report.js.map +1 -1
  433. package/dist/modes/interactive/chat-viewport.d.ts.map +1 -1
  434. package/dist/modes/interactive/chat-viewport.js.map +1 -1
  435. package/dist/modes/interactive/components/armin.d.ts.map +1 -1
  436. package/dist/modes/interactive/components/armin.js.map +1 -1
  437. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  438. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  439. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  440. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  441. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
  442. package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
  443. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  444. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  445. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  446. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  447. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  448. package/dist/modes/interactive/components/config-selector.js +13 -3
  449. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  450. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
  451. package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
  452. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  453. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  454. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  455. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  456. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  457. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  458. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
  459. package/dist/modes/interactive/components/daxnuts.js.map +1 -1
  460. package/dist/modes/interactive/components/diff.d.ts.map +1 -1
  461. package/dist/modes/interactive/components/diff.js.map +1 -1
  462. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
  463. package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
  464. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
  465. package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
  466. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  467. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  468. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
  469. package/dist/modes/interactive/components/extension-input.js.map +1 -1
  470. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  471. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  472. package/dist/modes/interactive/components/first-time-setup.d.ts +4 -4
  473. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
  474. package/dist/modes/interactive/components/first-time-setup.js +8 -2
  475. package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
  476. package/dist/modes/interactive/components/footer.d.ts +7 -0
  477. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  478. package/dist/modes/interactive/components/footer.js +43 -3
  479. package/dist/modes/interactive/components/footer.js.map +1 -1
  480. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  481. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  482. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  483. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  484. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  485. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
  486. package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
  487. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  488. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  489. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  490. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  491. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  492. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  493. package/dist/modes/interactive/components/pi-logo.d.ts +12 -0
  494. package/dist/modes/interactive/components/pi-logo.d.ts.map +1 -0
  495. package/dist/modes/interactive/components/pi-logo.js +25 -0
  496. package/dist/modes/interactive/components/pi-logo.js.map +1 -0
  497. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  498. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  499. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  500. package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  501. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  502. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  503. package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
  504. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  505. package/dist/modes/interactive/components/settings-selector.js +28 -6
  506. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  507. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  508. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  509. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
  510. package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
  511. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  512. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  513. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  514. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  515. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
  516. package/dist/modes/interactive/components/theme-selector.js.map +1 -1
  517. package/dist/modes/interactive/components/themed-text.d.ts +17 -0
  518. package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
  519. package/dist/modes/interactive/components/themed-text.js +29 -0
  520. package/dist/modes/interactive/components/themed-text.js.map +1 -0
  521. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  522. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  523. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  524. package/dist/modes/interactive/components/tool-execution.js +2 -2
  525. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  526. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  527. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  528. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
  529. package/dist/modes/interactive/components/trust-selector.js.map +1 -1
  530. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  531. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  532. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  533. package/dist/modes/interactive/components/user-message.js.map +1 -1
  534. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  535. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  536. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  537. package/dist/modes/interactive/external-editor.js.map +1 -1
  538. package/dist/modes/interactive/interactive-mode.d.ts +11 -0
  539. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  540. package/dist/modes/interactive/interactive-mode.js +199 -161
  541. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  542. package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -1
  543. package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
  544. package/dist/modes/interactive/model-search.d.ts.map +1 -1
  545. package/dist/modes/interactive/model-search.js.map +1 -1
  546. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  547. package/dist/modes/interactive/session-share.js.map +1 -1
  548. package/dist/modes/interactive/theme/dark.json +59 -72
  549. package/dist/modes/interactive/theme/light.json +57 -69
  550. package/dist/modes/interactive/theme/system-theme.d.ts +54 -0
  551. package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
  552. package/dist/modes/interactive/theme/system-theme.js +535 -0
  553. package/dist/modes/interactive/theme/system-theme.js.map +1 -0
  554. package/dist/modes/interactive/theme/theme-controller.d.ts +46 -6
  555. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  556. package/dist/modes/interactive/theme/theme-controller.js +127 -47
  557. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  558. package/dist/modes/interactive/theme/theme-json.d.ts +1 -0
  559. package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -1
  560. package/dist/modes/interactive/theme/theme-json.js +3 -1
  561. package/dist/modes/interactive/theme/theme-json.js.map +1 -1
  562. package/dist/modes/interactive/theme/theme-schema.json +7 -2
  563. package/dist/modes/interactive/theme/theme.d.ts +66 -39
  564. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  565. package/dist/modes/interactive/theme/theme.js +238 -317
  566. package/dist/modes/interactive/theme/theme.js.map +1 -1
  567. package/dist/modes/interactive/tui-renderer.d.ts +2 -1
  568. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -1
  569. package/dist/modes/interactive/tui-renderer.js +1 -0
  570. package/dist/modes/interactive/tui-renderer.js.map +1 -1
  571. package/dist/modes/json-event.d.ts.map +1 -1
  572. package/dist/modes/json-event.js.map +1 -1
  573. package/dist/modes/print-mode.d.ts.map +1 -1
  574. package/dist/modes/print-mode.js.map +1 -1
  575. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  576. package/dist/modes/rpc/jsonl.js.map +1 -1
  577. package/dist/modes/rpc/rpc-client.d.ts +6 -6
  578. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  579. package/dist/modes/rpc/rpc-client.js +12 -8
  580. package/dist/modes/rpc/rpc-client.js.map +1 -1
  581. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  582. package/dist/modes/rpc/rpc-mode.js +7 -9
  583. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  584. package/dist/modes/rpc/rpc-types.d.ts +10 -1
  585. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  586. package/dist/modes/rpc/rpc-types.js.map +1 -1
  587. package/dist/package-manager-cli.d.ts.map +1 -1
  588. package/dist/package-manager-cli.js +6 -2
  589. package/dist/package-manager-cli.js.map +1 -1
  590. package/dist/rpc-entry.d.ts.map +1 -1
  591. package/dist/rpc-entry.js.map +1 -1
  592. package/dist/utils/abort.d.ts.map +1 -1
  593. package/dist/utils/abort.js.map +1 -1
  594. package/dist/utils/ansi.d.ts.map +1 -1
  595. package/dist/utils/ansi.js.map +1 -1
  596. package/dist/utils/changelog.d.ts.map +1 -1
  597. package/dist/utils/changelog.js.map +1 -1
  598. package/dist/utils/child-process.d.ts.map +1 -1
  599. package/dist/utils/child-process.js.map +1 -1
  600. package/dist/utils/clipboard-command.d.ts.map +1 -1
  601. package/dist/utils/clipboard-command.js.map +1 -1
  602. package/dist/utils/clipboard-image.d.ts.map +1 -1
  603. package/dist/utils/clipboard-image.js +14 -17
  604. package/dist/utils/clipboard-image.js.map +1 -1
  605. package/dist/utils/clipboard.d.ts +2 -0
  606. package/dist/utils/clipboard.d.ts.map +1 -1
  607. package/dist/utils/clipboard.js +5 -0
  608. package/dist/utils/clipboard.js.map +1 -1
  609. package/dist/utils/deprecation.d.ts.map +1 -1
  610. package/dist/utils/deprecation.js.map +1 -1
  611. package/dist/utils/exif-orientation.d.ts.map +1 -1
  612. package/dist/utils/exif-orientation.js.map +1 -1
  613. package/dist/utils/frontmatter.d.ts.map +1 -1
  614. package/dist/utils/frontmatter.js.map +1 -1
  615. package/dist/utils/fs-watch.d.ts.map +1 -1
  616. package/dist/utils/fs-watch.js.map +1 -1
  617. package/dist/utils/git.d.ts.map +1 -1
  618. package/dist/utils/git.js.map +1 -1
  619. package/dist/utils/html.d.ts.map +1 -1
  620. package/dist/utils/html.js.map +1 -1
  621. package/dist/utils/image-convert.d.ts.map +1 -1
  622. package/dist/utils/image-convert.js.map +1 -1
  623. package/dist/utils/image-process.d.ts.map +1 -1
  624. package/dist/utils/image-process.js.map +1 -1
  625. package/dist/utils/image-resize-core.d.ts.map +1 -1
  626. package/dist/utils/image-resize-core.js.map +1 -1
  627. package/dist/utils/image-resize-worker.d.ts.map +1 -1
  628. package/dist/utils/image-resize-worker.js.map +1 -1
  629. package/dist/utils/image-resize.d.ts.map +1 -1
  630. package/dist/utils/image-resize.js.map +1 -1
  631. package/dist/utils/json.d.ts.map +1 -1
  632. package/dist/utils/json.js.map +1 -1
  633. package/dist/utils/management-http.d.ts.map +1 -1
  634. package/dist/utils/management-http.js.map +1 -1
  635. package/dist/utils/mime.d.ts.map +1 -1
  636. package/dist/utils/mime.js.map +1 -1
  637. package/dist/utils/open-browser.d.ts.map +1 -1
  638. package/dist/utils/open-browser.js.map +1 -1
  639. package/dist/utils/paths.d.ts +3 -3
  640. package/dist/utils/paths.d.ts.map +1 -1
  641. package/dist/utils/paths.js +5 -4
  642. package/dist/utils/paths.js.map +1 -1
  643. package/dist/utils/photon.d.ts.map +1 -1
  644. package/dist/utils/photon.js.map +1 -1
  645. package/dist/utils/pi-user-agent.d.ts.map +1 -1
  646. package/dist/utils/pi-user-agent.js.map +1 -1
  647. package/dist/utils/shell.d.ts +1 -3
  648. package/dist/utils/shell.d.ts.map +1 -1
  649. package/dist/utils/shell.js +3 -30
  650. package/dist/utils/shell.js.map +1 -1
  651. package/dist/utils/sleep.d.ts.map +1 -1
  652. package/dist/utils/sleep.js.map +1 -1
  653. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  654. package/dist/utils/syntax-highlight.js +2 -0
  655. package/dist/utils/syntax-highlight.js.map +1 -1
  656. package/dist/utils/text.d.ts.map +1 -1
  657. package/dist/utils/text.js.map +1 -1
  658. package/dist/utils/tool-result-images.d.ts.map +1 -1
  659. package/dist/utils/tool-result-images.js.map +1 -1
  660. package/dist/utils/tools-manager.d.ts.map +1 -1
  661. package/dist/utils/tools-manager.js.map +1 -1
  662. package/dist/utils/version-check.d.ts.map +1 -1
  663. package/dist/utils/version-check.js.map +1 -1
  664. package/dist/utils/windows-self-update.d.ts.map +1 -1
  665. package/dist/utils/windows-self-update.js.map +1 -1
  666. package/dist/utils/wsl.d.ts.map +1 -1
  667. package/dist/utils/wsl.js.map +1 -1
  668. package/dist/utils/zip.d.ts.map +1 -1
  669. package/dist/utils/zip.js.map +1 -1
  670. package/docs/cli-integration.md +106 -0
  671. package/docs/cli.md +329 -0
  672. package/docs/compaction.md +22 -22
  673. package/docs/configuration.md +47 -0
  674. package/docs/containerization.md +109 -82
  675. package/docs/custom-provider.md +109 -722
  676. package/docs/docs.json +147 -99
  677. package/docs/environment-variables.md +3 -5
  678. package/docs/extensions.md +165 -2996
  679. package/docs/how-pi-works.md +49 -0
  680. package/docs/images/interactive-mode.png +0 -0
  681. package/docs/index.md +24 -69
  682. package/docs/json.md +193 -65
  683. package/docs/keybindings.md +58 -103
  684. package/docs/llama-cpp.md +16 -3
  685. package/docs/mcp.md +188 -0
  686. package/docs/message-types.md +261 -0
  687. package/docs/models.md +81 -556
  688. package/docs/packages.md +67 -166
  689. package/docs/prompt-templates.md +31 -68
  690. package/docs/providers.md +103 -240
  691. package/docs/quickstart.md +61 -106
  692. package/docs/rpc-commands.md +860 -0
  693. package/docs/rpc-extension-ui.md +200 -0
  694. package/docs/rpc.md +130 -1555
  695. package/docs/sdk.md +79 -1169
  696. package/docs/security.md +72 -32
  697. package/docs/session-format.md +15 -215
  698. package/docs/sessions.md +35 -141
  699. package/docs/settings.md +116 -377
  700. package/docs/shell-aliases.md +85 -5
  701. package/docs/skills.md +51 -190
  702. package/docs/slash-commands.md +60 -0
  703. package/docs/terminal-setup.md +105 -78
  704. package/docs/termux.md +74 -83
  705. package/docs/themes.md +88 -274
  706. package/docs/tmux.md +31 -39
  707. package/docs/tui.md +74 -910
  708. package/docs/usage.md +54 -272
  709. package/docs/virtual-models.md +114 -0
  710. package/docs/windows.md +45 -17
  711. package/examples/README.md +13 -2
  712. package/examples/extensions/README.md +2 -0
  713. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  714. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  715. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  716. package/examples/extensions/custom-provider-gitlab-duo/test.ts +5 -5
  717. package/examples/extensions/debug-provider.ts +90 -0
  718. package/examples/extensions/gondolin/package-lock.json +2 -2
  719. package/examples/extensions/gondolin/package.json +1 -1
  720. package/examples/extensions/jev-router.ts +113 -0
  721. package/examples/extensions/sandbox/package-lock.json +2 -2
  722. package/examples/extensions/sandbox/package.json +1 -1
  723. package/examples/extensions/with-deps/package-lock.json +2 -2
  724. package/examples/extensions/with-deps/package.json +1 -1
  725. package/examples/rpc-client.ts +35 -0
  726. package/examples/rpc-extension-ui.ts +26 -6
  727. package/examples/sdk/14-codemode-mcp.ts +61 -0
  728. package/examples/sdk/README.md +3 -2
  729. package/npm-shrinkwrap.json +89 -39
  730. package/package.json +14 -12
  731. package/dist/bundle/chunks/anthropic-messages-MYU5ZMRF.js +0 -6
  732. package/dist/bundle/chunks/azure-openai-responses-HUSQ3GP2.js +0 -2
  733. package/dist/bundle/chunks/chunk-4DKZACXI.js +0 -1568
  734. package/dist/bundle/chunks/chunk-6R7UI4IY.js +0 -2
  735. package/dist/bundle/chunks/chunk-GV2E3GBU.js +0 -2
  736. package/dist/bundle/chunks/chunk-NUHFSC37.js +0 -25
  737. package/dist/bundle/chunks/chunk-RCZIEVGO.js +0 -11
  738. package/dist/bundle/chunks/google-generative-ai-IMS5EK2Y.js +0 -2
  739. package/dist/bundle/chunks/google-vertex-O4YJEQUW.js +0 -2
  740. package/dist/bundle/chunks/mistral-conversations-NOSQHBEY.js +0 -5
  741. package/dist/bundle/chunks/openai-responses-HWEUZ6WZ.js +0 -2
  742. package/dist/bundle/chunks/virtual-modules-BNWPZYDH.js +0 -2
  743. package/docs/development.md +0 -90
@@ -1,16 +1,35 @@
1
- # Keybindings
1
+ # Keybindings Reference
2
2
 
3
- All keyboard shortcuts can be customized via `~/.pi/agent/keybindings.json`. Each action can be bound to one or more keys.
3
+ Pi exposes named actions, such as `app.session.new`, that can be assigned keybindings. You can change default assignments or bind unassigned actions in Pi's [user configuration](configuration.md#agent-directory).
4
4
 
5
- The config file uses the same namespaced keybinding ids that pi uses internally and that extension authors use in `keyHint()` and injected `keybindings` managers.
5
+ Run `/hotkeys` to see the active shortcuts for the main editor and application.
6
6
 
7
- Older configs using pre-namespaced ids such as `cursorUp` or `expandTools` are migrated automatically to the namespaced ids on startup.
7
+ ## Assign keybindings
8
8
 
9
- After editing `keybindings.json`, run `/reload` in pi to apply the changes without restarting the session.
9
+ Create `<agent-dir>/keybindings.json`. The agent directory defaults to `~/.pi/agent` and is described in [Agent directory](configuration.md#agent-directory).
10
10
 
11
- ## Key Format
11
+ Map each action identifier to one key or a list of keys:
12
12
 
13
- `modifier+key` where modifiers are `ctrl`, `shift`, `alt`, `super` (combinable) and keys are:
13
+ ```json
14
+ {
15
+ "app.session.new": "ctrl+shift+n",
16
+ "app.session.tree": ["ctrl+shift+t", "alt+shift+t"]
17
+ }
18
+ ```
19
+
20
+ A configured value replaces the default for that action. Use an empty list to disable an action's keybindings:
21
+
22
+ ```json
23
+ {
24
+ "tui.altScreen.pageUp": []
25
+ }
26
+ ```
27
+
28
+ After editing the file, run `/reload` to apply the changes to the active session.
29
+
30
+ ## Key syntax
31
+
32
+ Write a key as `modifier+key`. Modifiers are `ctrl`, `shift`, `alt`, and `super`. You can combine modifiers. Valid keys are:
14
33
 
15
34
  - **Letters:** `a-z`
16
35
  - **Digits:** `0-9`
@@ -18,20 +37,22 @@ After editing `keybindings.json`, run `/reload` in pi to apply the changes witho
18
37
  - **Function:** `f1`-`f12`
19
38
  - **Symbols:** `` ` ``, `-`, `=`, `[`, `]`, `\`, `;`, `'`, `,`, `.`, `/`, `!`, `@`, `#`, `$`, `%`, `^`, `&`, `*`, `(`, `)`, `_`, `+`, `|`, `~`, `{`, `}`, `:`, `<`, `>`, `?`
20
39
 
21
- Modifier combinations: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, `super+k`, `ctrl+super+k`, `ctrl+1`, etc.
40
+ Examples: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, `super+k`, `ctrl+super+k`, and `ctrl+1`.
22
41
 
23
42
  `super` bindings require a terminal that reports the modifier separately, typically through the Kitty keyboard protocol. They may not work in terminals without that support.
24
43
 
25
- ## All Actions
44
+ ## Actions
45
+
46
+ ### Terminal UI
26
47
 
27
- ### TUI Editor Cursor Movement
48
+ #### Cursor movement
28
49
 
29
50
  | Keybinding id | Default | Description |
30
- |--------|---------|-------------|
51
+ |---|---|---|
31
52
  | `tui.editor.cursorUp` | `up` | Move cursor up, browsing older history at the top |
32
53
  | `tui.editor.cursorDown` | `down` | Move cursor down, browsing newer history at the bottom |
33
- | `tui.editor.historyPrevious` | *(none)* | Select the previous prompt history entry |
34
- | `tui.editor.historyNext` | *(none)* | Select the next prompt history entry |
54
+ | `tui.editor.historyPrevious` | None | Select the previous prompt history entry |
55
+ | `tui.editor.historyNext` | None | Select the next prompt history entry |
35
56
  | `tui.editor.cursorLeft` | `left`, `ctrl+b` | Move cursor left |
36
57
  | `tui.editor.cursorRight` | `right`, `ctrl+f` | Move cursor right |
37
58
  | `tui.editor.cursorWordLeft` | `alt+left`, `ctrl+left`, `alt+b` | Move cursor word left |
@@ -43,39 +64,29 @@ Modifier combinations: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, `super+
43
64
  | `tui.editor.pageUp` | `pageUp`, `ctrl+pageUp` | Scroll up by page |
44
65
  | `tui.editor.pageDown` | `pageDown`, `ctrl+pageDown` | Scroll down by page |
45
66
 
46
- The dedicated history actions always change history entries, regardless of the cursor position in a multiline prompt. Explicit history bindings take precedence over application actions while the main editor is focused, so binding `tui.editor.historyPrevious` to `ctrl+p` overrides model cycling in that context without changing `Ctrl+P` in selectors.
67
+ The dedicated history actions browse prompt history regardless of cursor position and take precedence over application actions using the same key.
47
68
 
48
- ### TUI Editor Deletion
69
+ #### Text editing
49
70
 
50
71
  | Keybinding id | Default | Description |
51
- |--------|---------|-------------|
72
+ |---|---|---|
52
73
  | `tui.editor.deleteCharBackward` | `backspace` | Delete character backward |
53
74
  | `tui.editor.deleteCharForward` | `delete`, `ctrl+d` | Delete character forward |
54
75
  | `tui.editor.deleteWordBackward` | `ctrl+w`, `alt+backspace` | Delete word backward |
55
76
  | `tui.editor.deleteWordForward` | `alt+d`, `alt+delete` | Delete word forward |
56
77
  | `tui.editor.deleteToLineStart` | `ctrl+u` | Delete to line start |
57
78
  | `tui.editor.deleteToLineEnd` | `ctrl+k` | Delete to line end |
58
-
59
- ### TUI Input
60
-
61
- | Keybinding id | Default | Description |
62
- |--------|---------|-------------|
63
- | `tui.input.newLine` | `shift+enter`, `ctrl+j` | Insert new line |
64
- | `tui.input.submit` | `enter` | Submit input |
65
- | `tui.input.tab` | `tab` | Tab / autocomplete |
66
-
67
- ### TUI Kill Ring
68
-
69
- | Keybinding id | Default | Description |
70
- |--------|---------|-------------|
71
79
  | `tui.editor.yank` | `ctrl+y` | Paste most recently deleted text |
72
80
  | `tui.editor.yankPop` | `alt+y` | Cycle through deleted text after yank |
73
81
  | `tui.editor.undo` | `ctrl+-` (`ctrl+z` on Windows; `alt+z` on WSL) | Undo last edit |
74
82
 
75
- ### TUI Clipboard and Selection
83
+ #### Input and selection
76
84
 
77
85
  | Keybinding id | Default | Description |
78
- |--------|---------|-------------|
86
+ |---|---|---|
87
+ | `tui.input.newLine` | `shift+enter`, `ctrl+j` | Insert new line |
88
+ | `tui.input.submit` | `enter` | Submit input |
89
+ | `tui.input.tab` | `tab` | Tab or autocomplete |
79
90
  | `tui.input.copy` | `ctrl+c` | Copy selection |
80
91
  | `tui.select.up` | `up` | Move selection up |
81
92
  | `tui.select.down` | `down` | Move selection down |
@@ -84,31 +95,18 @@ The dedicated history actions always change history entries, regardless of the c
84
95
  | `tui.select.confirm` | `enter` | Confirm selection |
85
96
  | `tui.select.cancel` | `escape`, `ctrl+c` | Cancel selection |
86
97
 
87
- ### TUI Fullscreen Viewport
88
-
89
- These actions apply when interactive mode uses `--tui-mode fullscreen` and target the primary transcript scroll region. Two-finger trackpad and mouse-wheel input scroll the region under the pointer, falling back to the transcript over the fixed editor/status/footer dock. Clicking an OSC 8 hyperlink opens it in the default handler. Dragging with the primary mouse button selects text and copies it to the clipboard; holding at the transcript's top or bottom edge auto-scrolls into off-screen content. While the transcript is scrolled up, a clickable "Jump to latest message" label on its bottom row shows the `tui.altScreen.bottom` shortcut. See [Terminal setup](terminal-setup.md) for terminal-specific mouse and trackpad behavior.
90
-
91
- Fullscreen transcript bindings take precedence over editor bindings. The default unmodified navigation keys therefore control the transcript in fullscreen mode, while their `ctrl` variants continue to control the editor. Outside fullscreen mode, both variants control the editor.
92
-
93
- The transcript search panel shows the configured previous/next shortcuts and clickable arrow controls. Press `tui.altScreen.search` again, or use `tui.altScreen.searchClose`, to close it.
98
+ #### Fullscreen
94
99
 
95
- | Key | Default mode | Fullscreen mode |
96
- |-----|--------------|-----------------|
97
- | `home`, `end` | Editor | Transcript |
98
- | `ctrl+home`, `ctrl+end` | Editor | Editor |
99
- | `pageUp`, `pageDown` | Editor | Transcript |
100
- | `ctrl+pageUp`, `ctrl+pageDown` | Editor | Editor |
101
-
102
- This routing remains configurable through the ordinary action bindings. For example, `"tui.altScreen.pageUp": "ctrl+pageUp"` makes `pageUp` control the editor and `ctrl+pageUp` control the transcript in fullscreen mode. Bind `tui.altScreen.halfPageUp` and `tui.altScreen.halfPageDown` for half-page steps, or bind `tui.altScreen.lineUp` and `tui.altScreen.lineDown` for single-line steps. Setting `"tui.altScreen.pageUp": []` disables that transcript shortcut entirely. User bindings replace the defaults for that action.
100
+ In fullscreen mode, these actions control the transcript and take precedence over editor actions using the same key.
103
101
 
104
102
  | Keybinding id | Default | Description |
105
- |--------|---------|-------------|
103
+ |---|---|---|
106
104
  | `tui.altScreen.pageUp` | `pageUp` | Scroll the transcript up by one page |
107
105
  | `tui.altScreen.pageDown` | `pageDown` | Scroll the transcript down by one page |
108
- | `tui.altScreen.halfPageUp` | *(none)* | Scroll the transcript up by half a page |
109
- | `tui.altScreen.halfPageDown` | *(none)* | Scroll the transcript down by half a page |
110
- | `tui.altScreen.lineUp` | *(none)* | Scroll the transcript up by one line |
111
- | `tui.altScreen.lineDown` | *(none)* | Scroll the transcript down by one line |
106
+ | `tui.altScreen.halfPageUp` | None | Scroll the transcript up by half a page |
107
+ | `tui.altScreen.halfPageDown` | None | Scroll the transcript down by half a page |
108
+ | `tui.altScreen.lineUp` | None | Scroll the transcript up by one line |
109
+ | `tui.altScreen.lineDown` | None | Scroll the transcript down by one line |
112
110
  | `tui.altScreen.previousPrompt` | `ctrl+shift+up`, `ctrl+up` (`ctrl+up` only on Windows and WSL) | Jump to the previous marked message |
113
111
  | `tui.altScreen.nextPrompt` | `ctrl+shift+down`, `ctrl+down` (`ctrl+down` only on Windows and WSL) | Jump to the next marked message |
114
112
  | `tui.altScreen.search` | `ctrl+shift+f` (`ctrl+f` on Windows and WSL) | Search the rendered transcript |
@@ -125,18 +123,20 @@ This routing remains configurable through the ordinary action bindings. For exam
125
123
  | `app.interrupt` | `escape` | Cancel / abort |
126
124
  | `app.clear` | `ctrl+c` | Clear editor (first) / exit (second) |
127
125
  | `app.exit` | `ctrl+d` | Exit (when editor empty) |
128
- | `app.suspend` | `ctrl+z` (none on Windows) | Suspend to background |
126
+ | `app.suspend` | `ctrl+z` (None on Windows) | Suspend to background |
129
127
  | `app.editor.external` | `ctrl+g` | Open in external editor (`externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere) |
130
- | `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows and WSL) | Paste image or text from clipboard |
128
+ | `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows and WSL) | Paste files on macOS, images, or text from clipboard |
129
+
130
+ On native Windows, `app.suspend` has no default because Windows terminals do not support Unix job control. If you assign it manually, Pi shows a status message instead of suspending. WSL uses the normal `ctrl+z` and `fg` behavior.
131
131
 
132
132
  ### Sessions
133
133
 
134
134
  | Keybinding id | Default | Description |
135
135
  |--------|---------|-------------|
136
- | `app.session.new` | *(none)* | Start a new session (`/new`) |
137
- | `app.session.tree` | *(none)* | Open session tree navigator (`/tree`) |
138
- | `app.session.fork` | *(none)* | Fork current session (`/fork`) |
139
- | `app.session.resume` | *(none)* | Open session resume picker (`/resume`) |
136
+ | `app.session.new` | None | Start a new session (`/new`) |
137
+ | `app.session.tree` | None | Open session tree navigator (`/tree`) |
138
+ | `app.session.fork` | None | Fork current session (`/fork`) |
139
+ | `app.session.resume` | None | Open session resume picker (`/resume`) |
140
140
  | `app.session.togglePath` | `ctrl+p` | Toggle path display |
141
141
  | `app.session.toggleSort` | `ctrl+s` | Toggle sort mode |
142
142
  | `app.session.toggleNamedFilter` | `ctrl+n` | Toggle named-only filter |
@@ -161,7 +161,7 @@ This routing remains configurable through the ordinary action bindings. For exam
161
161
  | Keybinding id | Default | Description |
162
162
  |--------|---------|-------------|
163
163
  | `app.tools.expand` | `ctrl+o` | Collapse or expand tool output |
164
- | `app.message.copy` | `ctrl+x` | Copy the selected message in `/tree`; otherwise copy the last assistant message, or the active fullscreen text selection when `fullscreenCopyOnSelect` is disabled |
164
+ | `app.message.copy` | `ctrl+x` | Copy the selected message in `/tree`; in fullscreen mode, copy the active selection when `fullscreenCopyOnSelect` is `false`; otherwise copy the last assistant message |
165
165
  | `app.message.followUp` | `alt+enter` (`ctrl+q` on Windows and WSL) | Queue follow-up message |
166
166
  | `app.message.dequeue` | `alt+up` (`alt+q` on Windows and WSL) | Restore queued messages to editor |
167
167
 
@@ -192,48 +192,3 @@ Used inside the scoped models selector (opened via `/scoped-models`).
192
192
  | `app.models.toggleProvider` | `ctrl+p` | Toggle all models for the current provider |
193
193
  | `app.models.reorderUp` | `alt+up` | Move the selected model up in the cycle order |
194
194
  | `app.models.reorderDown` | `alt+down` | Move the selected model down in the cycle order |
195
-
196
- ## Custom Configuration
197
-
198
- Create `~/.pi/agent/keybindings.json`:
199
-
200
- ```json
201
- {
202
- "tui.editor.historyPrevious": "ctrl+p",
203
- "tui.editor.historyNext": "ctrl+n",
204
- "tui.editor.deleteWordBackward": ["ctrl+w", "alt+backspace"]
205
- }
206
- ```
207
-
208
- Each action can have a single key or an array of keys. User config overrides defaults.
209
-
210
- On native Windows, `app.suspend` has no default binding because Windows terminals do not support Unix job control. If you bind it manually, pi shows a status message instead of suspending. In WSL, the normal Linux `ctrl+z`/`fg` behavior still applies.
211
-
212
- ### Emacs Example
213
-
214
- ```json
215
- {
216
- "tui.editor.historyPrevious": "ctrl+p",
217
- "tui.editor.historyNext": "ctrl+n",
218
- "tui.editor.cursorLeft": ["left", "ctrl+b"],
219
- "tui.editor.cursorRight": ["right", "ctrl+f"],
220
- "tui.editor.cursorWordLeft": ["alt+left", "alt+b"],
221
- "tui.editor.cursorWordRight": ["alt+right", "alt+f"],
222
- "tui.editor.deleteCharForward": ["delete", "ctrl+d"],
223
- "tui.editor.deleteCharBackward": ["backspace", "ctrl+h"],
224
- "tui.input.newLine": ["shift+enter", "ctrl+j"]
225
- }
226
- ```
227
-
228
- ### Vim Example
229
-
230
- ```json
231
- {
232
- "tui.editor.cursorUp": ["up", "alt+k"],
233
- "tui.editor.cursorDown": ["down", "alt+j"],
234
- "tui.editor.cursorLeft": ["left", "alt+h"],
235
- "tui.editor.cursorRight": ["right", "alt+l"],
236
- "tui.editor.cursorWordLeft": ["alt+left", "alt+b"],
237
- "tui.editor.cursorWordRight": ["alt+right", "alt+w"]
238
- }
239
- ```
package/docs/llama-cpp.md CHANGED
@@ -1,4 +1,4 @@
1
- # llama.cpp
1
+ # Local Models with llama.cpp
2
2
 
3
3
  Pi supports the [llama.cpp](https://github.com/ggml-org/llama.cpp) router server. The router discovers multiple GGUF models and loads or unloads them on demand.
4
4
 
@@ -82,10 +82,21 @@ Hugging Face search uses `HF_TOKEN` when set, then checks `$HF_TOKEN_PATH`, `$HF
82
82
 
83
83
  If other models are loaded, Pi asks whether to unload them first or keep them loaded. Pi does not silently unload models and never deletes model files. The router may be shared with other clients, so `/llama` always displays the router's current state.
84
84
 
85
- Only loaded models appear in `/model`. After loading a model, run `/model` to select it for the current Pi session.
85
+ Loaded and sleeping models appear in `/model`. Sleeping models wake automatically when selected. With router autoload enabled, unloaded preset models also appear and load when selected. With `--no-models-autoload`, load a model through `/llama` before selecting it.
86
86
 
87
87
  If the router disconnects, `/llama` shows **Retry** and **Close**. Retry reconnects and refreshes model state without replaying the interrupted operation.
88
88
 
89
+ ## Classification
90
+
91
+ Every model listed for chat is also listed as a classifier model with the same ID and the `llama-cpp-classify` API. Classifier models answer typed `choice`, `bool`, and `score` questions about JSON state, like TypeSafe's Jev models. The model reaches them from [`codemode`](cli.md#enable-codemode) scripts, and extensions through `ctx.modelRegistry.classify()`; see [Classifier models](models.md#use-classifier-models).
92
+
93
+ The model does not generate an answer. Each question becomes one chat prompt: the state, every question of the request, the state again, and then the question with its answers under single-token labels. Labels are letters for a choice (up to 62 options), `Yes`/`No` for a bool, and digits for a score (up to 10 levels). The second copy of the state is read with the questions in view, which improved accuracy on JevBench with small models. Pi reads the probabilities of the labels as the next token and normalizes them. A choice returns every option's probability and a confidence of `(n * peak - 1) / (n - 1)`; a score returns the expected level.
94
+
95
+ - Raw label probabilities are usually overconfident. The per-request `temperature` option divides the label logits before normalizing; values above 1 soften the distribution. It changes no answer.
96
+ - Questions run one after another. Everything before the final question is the same for all questions of a request, so the server's prompt cache evaluates it once. The state appears twice, so it needs twice its size in context.
97
+ - Small models may follow instructions written inside the state. The prompt tells the model to judge the state as data, but that is not a guarantee.
98
+ - Hybrid models such as Qwen3.5 cannot rewind a partially cached prompt without context checkpoints. If each question reprocesses the whole state, start the router with `--ctx-checkpoints 32 --checkpoint-min-step 0`.
99
+
89
100
  ## Troubleshooting
90
101
 
91
102
  Check that the router is reachable:
@@ -96,6 +107,8 @@ curl http://127.0.0.1:8080/models
96
107
  ```
97
108
 
98
109
  - **No models in `/llama`:** Check `--models-dir`, the directory layout, and restart the router.
99
- - **Model missing from `/model`:** Load it with `/llama` first.
110
+ - **Model missing from `/model` with `--no-models-autoload`:** Load it with `/llama` first.
100
111
  - **Load fails or uses too much memory:** Lower `-c` or unload another model.
101
112
  - **Server is not in router mode:** Start it without `--model`, `-m`, or `-hf`.
113
+
114
+ To remove the `llama.cpp` provider and `/llama`, disable `llama.cpp` under Built-in in `pi config`, or set `"extensions": ["-builtin:llama.cpp"]` in [settings](settings.md#resources).
package/docs/mcp.md ADDED
@@ -0,0 +1,188 @@
1
+ # MCP Servers
2
+
3
+ Pi connects to [Model Context Protocol](https://modelcontextprotocol.io) servers over stdio or streamable HTTP and makes their tools available to the model.
4
+
5
+ ## Configure servers
6
+
7
+ Add servers to `~/.pi/agent/mcp.json`, or to `.pi/mcp.json` in a project. The format matches other MCP clients, so existing `mcpServers` entries can be copied over:
8
+
9
+ ```json
10
+ {
11
+ "mcpServers": {
12
+ "filesystem": {
13
+ "command": "npx",
14
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
15
+ },
16
+ "docs": {
17
+ "url": "https://example.com/mcp",
18
+ "headers": { "Authorization": "Bearer ${DOCS_TOKEN}" },
19
+ "exposure": "direct"
20
+ }
21
+ }
22
+ }
23
+ ```
24
+
25
+ - stdio servers take `command`, `args`, `env`, and `cwd`. Relative `cwd` resolves against the session directory. A leading `~/` in `command`, an argument, or `cwd` names the home directory.
26
+ - HTTP servers take `url`, `headers`, and `oauth` (see [Sign in with OAuth](#sign-in-with-oauth)). The legacy SSE transport is not supported.
27
+ - `env` and `headers` values can reference environment variables (`${NAME}`) or commands (`!command`), like provider API keys.
28
+ - `timeout` sets the per-request timeout in seconds (default 60). Progress notifications from the server reset it.
29
+ - `enabled: false` keeps an entry without connecting to it.
30
+
31
+ Project entries replace global entries with the same name. A project `mcp.json` is only read after the project is trusted, because stdio servers run commands.
32
+
33
+ `pi mcp add` and `pi mcp remove` edit the file from a shell (see [MCP commands](cli.md#mcp-commands)):
34
+
35
+ ```bash
36
+ pi mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem .
37
+ pi mcp add docs --url https://example.com/mcp --bearer-token-env-var DOCS_TOKEN --exposure direct
38
+ pi mcp add -l tools --env API_KEY='${TOOLS_KEY}' -- uvx tools-mcp
39
+ pi mcp remove docs
40
+ ```
41
+
42
+ Rules that are easy to get wrong:
43
+
44
+ - Server names may only contain letters, digits, `_`, and `-`. Tools are named `mcp__<server>__<tool>`.
45
+ - `type` is optional: a `command` makes a stdio server and a `url` a streamable HTTP server. When present, it must be `stdio`, `http`, or `streamable-http`. `sse` is rejected; most servers that document an SSE endpoint also serve streamable HTTP, often at `/mcp` instead of `/sse`.
46
+ - `command` is a single executable and `args` its arguments, not one shell string.
47
+ - Keep secrets out of the file: use `${NAME}` for environment variables, as in `"Authorization": "Bearer ${GITHUB_TOKEN}"`, or `!command` to run a command. A command must make up the whole value, so it has to print the header value itself: `"Authorization": "!echo Bearer $(gh auth token)"`.
48
+ - Invalid entries are skipped and reported; the other servers still connect.
49
+
50
+ ## Set up servers
51
+
52
+ When asked to add an MCP server, the agent should:
53
+
54
+ 1. Add simple servers with `pi mcp add` (add `-l` for the project file), or edit `mcp.json` directly for settings the command does not cover. Put personal servers and servers with credentials in `~/.pi/agent/mcp.json`. Use the project `.pi/mcp.json` only for servers the project itself needs, and only in trusted projects.
55
+ 2. Convert entries written for other clients:
56
+ - Claude Desktop, Claude Code, and Cursor use the same `mcpServers` shape; copy the entry.
57
+ - VS Code uses a top-level `servers` object and `inputs` prompts; move the entry under `mcpServers` and replace `${input:...}` with `${NAME}` environment variables.
58
+ - Codex uses TOML (`[mcp_servers.<name>]` with `command`, `args`, `env`, or `url`); write the same fields as JSON.
59
+ - opencode uses `"type": "local"` with `command` as an array (split it into `command` and `args`), `"type": "remote"` for URLs, `environment` for `env`, and `{env:NAME}` for `${NAME}`.
60
+ 3. Run `pi mcp list` to check the entry. It connects to every enabled server and prints the state, the tools, and errors such as the stderr of a stdio server that failed to start. It exits with 1 while anything is wrong.
61
+ 4. For a server that needs a sign-in, run `pi mcp login <server>`. It opens the authorization page in the user's browser and waits until the user approves access; tell the user to approve it. A running session uses the new credentials on its next turn.
62
+ 5. Tell the user to run `/reload` (or start a new session) so the running session connects to added or changed servers.
63
+
64
+ Pi connects when a session starts. The first prompt waits up to 10 seconds for startup connections; the tools of servers that take longer become available once they connect. HTTP connections that fail with a network error or a transient status (408, 429, 5xx) are retried twice. A server that drops its connection shows as disconnected and is reconnected on the next call. When a server announces that its tool list changed, new tools are added and withdrawn tools become unreachable until the server offers them again.
65
+
66
+ Config errors, servers that failed to connect, and servers that need a sign-in are reported once after startup.
67
+
68
+ Log messages servers send with MCP logging notifications are appended to `~/.pi/agent/mcp.log` as `<time> [<server>] <level> <logger>: <message>`. The file is moved to `mcp.log.1` when it grows past 5 MB.
69
+
70
+ ## Manage servers
71
+
72
+ `/mcp` opens the server manager. It lists every configured server with its state, tool count, exposure, and whether it comes from the global or the project `mcp.json`; servers that need attention come first. Select a server to:
73
+
74
+ - sign in, for OAuth servers that need it (see [Sign in with OAuth](#sign-in-with-oauth))
75
+ - see its tools, its command or URL, and the full connection error, including the tail of a stdio server's stderr
76
+ - reconnect
77
+ - sign out, which deletes the stored OAuth credentials
78
+ - change its exposure (see [Exposure](#exposure))
79
+ - disable or enable it
80
+
81
+ Exposure changes and enabling or disabling are saved to the `mcp.json` that defines the server; other content of the file is kept. Disabled servers stay listed so they can be enabled again.
82
+
83
+ Outside the interactive TUI, `/mcp` prints the server status. `/mcp login <server>`, `/mcp logout <server>`, and `/mcp reconnect <server>` run those actions directly.
84
+
85
+ From a shell, `pi mcp add`, `pi mcp remove`, `pi mcp list`, `pi mcp login <server>`, and `pi mcp logout <server>` manage servers without a session (see [MCP commands](cli.md#mcp-commands)).
86
+
87
+ Stopping a stdio server closes its stdin, then sends SIGTERM and finally SIGKILL to its whole process group, so servers started through wrappers such as `npx` or `uvx` do not linger.
88
+
89
+ ## Sign in with OAuth
90
+
91
+ Remote servers that use OAuth, such as Sentry, need no credentials in `mcp.json`:
92
+
93
+ ```json
94
+ {
95
+ "mcpServers": {
96
+ "sentry": { "url": "https://mcp.sentry.dev/mcp" }
97
+ }
98
+ }
99
+ ```
100
+
101
+ When such a server rejects the connection, `/mcp` shows it as needing sign-in. Select it and choose "Sign in" (or run `/mcp login sentry`, or `pi mcp login sentry` in a shell) to open the authorization page in your browser. After you approve access, the browser redirects to a temporary server on `127.0.0.1` and pi connects. If the browser runs on another machine, for example over SSH, paste the URL it was redirected to into the sign-in screen instead.
102
+
103
+ Pi registers itself with the authorization server (dynamic client registration), stores tokens in `~/.pi/agent/mcp-auth.json`, and refreshes access tokens automatically when they expire or the server rejects them. If the server later asks for more scope than was granted, it shows as needing sign-in again, and signing in requests the new scope. "Sign out" in `/mcp` (or `/mcp logout sentry`) deletes the stored credentials.
104
+
105
+ OAuth applies to HTTP servers without an `Authorization` header. For authorization servers that do not support dynamic client registration, configure a pre-registered client:
106
+
107
+ ```json
108
+ {
109
+ "mcpServers": {
110
+ "example": {
111
+ "url": "https://mcp.example.com/mcp",
112
+ "oauth": { "clientId": "my-client", "clientSecret": "${EXAMPLE_SECRET}", "callbackPort": 8765 }
113
+ }
114
+ }
115
+ }
116
+ ```
117
+
118
+ The redirect URI must match the one registered for the client. `callbackPort` fixes it to `http://127.0.0.1:<port>/callback`. For another redirect URI, set `callbackUrl`, for example `"callbackUrl": "http://localhost:8080/oauth/callback"`. It must be an `http` URI on `localhost`, `127.0.0.1`, or `[::1]`, and is sent exactly as written. Without a port in `callbackUrl`, pi listens on `callbackPort`, or on a free port, and adds it to the URI; authorization servers accept any port for loopback redirects (RFC 8252). `clientSecret` is optional and can reference environment variables or commands.
119
+
120
+ `scope` sets the scopes to request, separated by spaces, for servers that do not advertise the ones they need. Without it, pi requests the scopes the server advertises. When a server later asks for more scope, pi requests those on top of `scope`.
121
+
122
+ ## Exposure
123
+
124
+ Each server's tools are registered as `mcp__<server>__<tool>`. The `exposure` setting controls how the model reaches them:
125
+
126
+ - `codemode` (default): the tools are callable from [`codemode`](cli.md#tools) scripts and listed in the `codemode` tool's description, but are not declared to the model. Large MCP tool lists stay out of the model's tool declarations, and scripts can call several MCP tools, in parallel if needed, while returning only the part of the result the model needs. Pi activates the `codemode` tool when such a server connects. Large servers do not fill the description: declarations share a token budget, and scripts find the remaining tools with `searchTools()` (see [`codemode`](cli.md#tools)).
127
+ - `codemode-deferred`: like `codemode`, but the tools are not listed in the `codemode` tool's description either; it only names the server and its tool count. Scripts call them by name and find them with `searchTools()` or in `ALL_TOOLS`. Use it for large servers that codemode scripts use rarely.
128
+ - `deferred`: the tools are not declared to the model until the [`tool_search`](cli.md#tools) tool loads them. The model searches, and the matches are declared from its next call on and called directly, without codemode. Pi activates the `tool_search` tool when such a server connects. Use it for large servers without codemode.
129
+ - `direct`: the tools are declared to the model like built-in tools, and are also callable from codemode.
130
+ - `hidden`: the tools are registered but cannot be called.
131
+
132
+ `toolExposure` sets the exposure of single tools and overrides `exposure` for them. Keys are tool names as the server offers them, or patterns where `*` matches any characters. An exact name wins over patterns; among patterns, the first match in the object wins. With `hidden` as the server's exposure, only the listed tools are reachable:
133
+
134
+ ```json
135
+ {
136
+ "mcpServers": {
137
+ "github": {
138
+ "url": "https://api.githubcopilot.com/mcp/",
139
+ "exposure": "deferred",
140
+ "toolExposure": {
141
+ "search_code": "direct",
142
+ "get_*": "codemode",
143
+ "delete_*": "hidden"
144
+ }
145
+ }
146
+ }
147
+ }
148
+ ```
149
+
150
+ `pi mcp list` marks tools whose exposure differs from the server's, and the Tools view in `/mcp` shows it too.
151
+
152
+ Tools that are not declared (`codemode`, `codemode-deferred`, and `deferred` exposure) are reachable through either tool: codemode scripts can call all of them, and `tool_search` can load any of them. For example, with `codemode` active, scripts can call the tools of a `deferred` server, and with `tool_search` active, the model can load the tools of a `codemode` server.
153
+
154
+ Tools called from codemode scripts do not depend on the active tool set, so they stay callable after `/tree`, resume, and fork. Tools loaded by `tool_search` are recorded in the transcript like any other tool change and stay declared on that branch. To keep `codemode` active without MCP servers too, add `"defaultTools": ["+codemode"]` to [settings](settings.md#tools). To keep pi from activating the `codemode` tool, set `"autoEnableCodemode": false` at the top level of `mcp.json`, next to `mcpServers`. A project `mcp.json` value overrides the global one. Pi warns once when neither `codemode` nor `tool_search` is active, since the tools then cannot be called.
155
+
156
+ Text results over 20KB reach the model with the middle cut out, in the format Codex uses: the start and end of the text around a `…N chars truncated…` marker. The full text is saved to a temp file whose path the result names. Codemode scripts always receive the whole result, so a script can filter a large result down to what the model needs.
157
+
158
+ Codemode scripts receive an MCP tool's whole `CallToolResult` (`content` blocks as sent by the server, `structuredContent`, and `isError`), and the `codemode` description declares it as `CallToolResult<T>`. A result with `isError` resolves in scripts and is reported to the model as an error for direct calls. `image(result.content[0])` forwards an image block to the model. The server's `instructions` describe its tools in the `codemode` description.
159
+
160
+ ## Resources
161
+
162
+ When a connected server offers [resources](https://modelcontextprotocol.io/specification/2025-11-25/server/resources), pi adds the resource tools Codex and opencode use:
163
+
164
+ - `list_mcp_resources` lists resources as JSON: `{ server?, resources: [{ server, uri, name, ... }], nextCursor? }`. With `server`, it lists one page of that server, and `cursor` continues with the next one. Without, it lists every resource of every server.
165
+ - `list_mcp_resource_templates` lists URI templates for resources the servers do not list, in the same way.
166
+ - `read_mcp_resource` reads a resource given `server` and `uri`. Text resources reach the model as text and images as images; other binary resources are saved to temp files, and the model sees the file path. Scripts receive `{ server, uri, contents }`.
167
+
168
+ The tools reach every enabled server with resources whose exposure is not `hidden`, and take the widest exposure among them: `direct` if one of the servers is direct, else `codemode`, else `codemode-deferred`, else `deferred`. Resource links in tool results name `read_mcp_resource` and the server.
169
+
170
+ Resources for MCP Apps (`ui://` URIs or `text/html;profile=mcp-app`) are left out of the listings, since pi does not render them, and so are resource icons.
171
+
172
+ Reading and listing resources is retried once after a transient HTTP error (408, 429, 5xx). Tool calls are not retried, since the server may have run them.
173
+
174
+ ## Permissions
175
+
176
+ Every MCP call goes through pi's tool pipeline, so `tool_call` and `tool_result` extension handlers, including permission gates, apply to MCP tools. Calls made from codemode scripts carry the `codemode` call's id as `parentToolCallId`. `pi.getAllTools()` reports the tool annotations servers declare (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`), so a permission extension can confirm only calls that change something (see [Extensions](extensions.md#tool-exposure)). The resource tools are marked read-only.
177
+
178
+ ## Servers from extensions
179
+
180
+ Extensions can add servers for the current session with `pi.registerMcpServer(name, config)`, using the same config shape as `mcp.json` (see [Extensions](extensions.md#mcp-servers)). They connect like configured servers and appear in `/mcp` with the extension as their source. Enabling, disabling, and exposure changes for them apply to the current session only. A server in `mcp.json` with the same name takes precedence; `/mcp` lists the overridden registration. `pi mcp` shell commands do not load extensions and only see `mcp.json` servers.
181
+
182
+ ## Other MCP extensions
183
+
184
+ An installed extension that registers the `/mcp` command, such as `pi-mcp-adapter`, replaces the built-in MCP support: pi then neither reads `mcp.json` in sessions nor connects servers, and `/mcp` belongs to that extension. Remove the extension to use the built-in support. To turn off the built-in support without installing another extension, disable `mcp` under Built-in in `pi config`, or set `"extensions": ["-builtin:mcp"]` in [settings](settings.md#resources); `pi mcp` shell commands still work. Likewise, an extension that registers a tool named `codemode` or `tool_search` replaces the built-in tool of that name. `pi mcp` shell commands always use the built-in support.
185
+
186
+ ## SDK
187
+
188
+ SDK sessions do not load the built-in extensions. Add the MCP extension, the codemode extension for `codemode` and `codemode-deferred` servers, and the tool search extension for `deferred` servers to the resource loader. See [SDK](sdk.md#codemode-mcp).