@earendil-works/pi-coding-agent 0.87.1 → 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 (721) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/dist/bun/cli.d.ts.map +1 -1
  3. package/dist/bun/restore-sandbox-env.d.ts.map +1 -1
  4. package/dist/bun/restore-sandbox-env.js.map +1 -1
  5. package/dist/bun/runtime-setup.d.ts.map +1 -1
  6. package/dist/bun/runtime-setup.js +4 -1
  7. package/dist/bun/runtime-setup.js.map +1 -1
  8. package/dist/bun/sandbox-env-setup.d.ts.map +1 -1
  9. package/dist/bundle/chunks/anthropic-messages-A6EXUBG6.js +6 -0
  10. package/dist/bundle/chunks/anthropic.js +2 -2
  11. package/dist/bundle/chunks/azure-openai-responses-EN5WOBET.js +2 -0
  12. package/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
  13. package/dist/bundle/chunks/chunk-4CSSZFEW.js +1435 -0
  14. package/dist/bundle/chunks/chunk-7JGR3GZN.js +11 -0
  15. package/dist/bundle/chunks/chunk-AXPY26X7.js +146 -0
  16. package/dist/bundle/chunks/chunk-EPDRUIU6.js +2 -0
  17. package/dist/bundle/chunks/chunk-GOPCREV2.js +4 -0
  18. package/dist/bundle/chunks/chunk-H3QXYIF7.js +31 -0
  19. package/dist/bundle/chunks/{chunk-S7SZN6Z3.js → chunk-HSPCVFST.js} +1 -1
  20. package/dist/bundle/chunks/chunk-IMTXZUO7.js +82 -0
  21. package/dist/bundle/chunks/chunk-J4CWPC4N.js +2 -0
  22. package/dist/bundle/chunks/chunk-LLMKQWZS.js +21 -0
  23. package/dist/bundle/chunks/{chunk-WIUZI2CJ.js → chunk-LRS5S6EK.js} +3 -3
  24. package/dist/bundle/chunks/chunk-PEHWOV5U.js +187 -0
  25. package/dist/bundle/chunks/{chunk-XDUWOHPL.js → chunk-S3GGRYIO.js} +2 -2
  26. package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
  27. package/dist/bundle/chunks/{chunk-FUXEF6JQ.js → chunk-W2DOMZSC.js} +1 -1
  28. package/dist/bundle/chunks/cli-AZXNGIZH.js +49 -0
  29. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-XJQQYGGU.js +2 -0
  30. package/dist/bundle/chunks/codemode-worker.js +295 -0
  31. package/dist/bundle/chunks/execute-7XXPZAWW.js +308 -0
  32. package/dist/bundle/chunks/github-copilot.js +1 -1
  33. package/dist/bundle/chunks/google-generative-ai-CQAKKJTA.js +2 -0
  34. package/dist/bundle/chunks/google-vertex-AE36YXJU.js +2 -0
  35. package/dist/bundle/chunks/{lib-HGQMNYVT.js → lib-TEDK3E5I.js} +2 -2
  36. package/dist/bundle/chunks/llama-cpp-classify-PJJYKPLD.js +22 -0
  37. package/dist/bundle/chunks/mistral-conversations-KEYTXJM7.js +5 -0
  38. package/dist/bundle/chunks/{openai-codex-responses-QDSOTBBO.js → openai-codex-responses-JQTCOVEG.js} +2 -2
  39. package/dist/bundle/chunks/openai-codex.js +2 -2
  40. package/dist/bundle/chunks/{openai-completions-OBX42CLD.js → openai-completions-XW2Q5HVC.js} +2 -2
  41. package/dist/bundle/chunks/openai-responses-6AXWFL75.js +3 -0
  42. package/dist/bundle/chunks/{openrouter-images-N4XVVFSD.js → openrouter-images-TPQ4V6OR.js} +1 -1
  43. package/dist/bundle/chunks/openrouter.js +2 -2
  44. package/dist/bundle/chunks/{pi-messages-GFKBWJHZ.js → pi-messages-TM5SOOIW.js} +2 -2
  45. package/dist/bundle/chunks/radius.js +2 -2
  46. package/dist/bundle/chunks/runtime-G5WJPRBM.js +2 -0
  47. package/dist/bundle/chunks/typesafe-system-one-E7A4HNJI.js +2 -0
  48. package/dist/bundle/chunks/virtual-modules-AQ3FLU6H.js +2 -0
  49. package/dist/bundle/cli-runtime.js +1 -1
  50. package/dist/bundle/index.js +1 -1
  51. package/dist/bundle/rpc-entry.js +1 -1
  52. package/dist/cli/args.d.ts.map +1 -1
  53. package/dist/cli/args.js +4 -3
  54. package/dist/cli/args.js.map +1 -1
  55. package/dist/cli/auth-check.d.ts.map +1 -1
  56. package/dist/cli/auth-check.js.map +1 -1
  57. package/dist/cli/auth-command.d.ts.map +1 -1
  58. package/dist/cli/auth-command.js.map +1 -1
  59. package/dist/cli/config-selector.d.ts.map +1 -1
  60. package/dist/cli/config-selector.js.map +1 -1
  61. package/dist/cli/credential-print.d.ts.map +1 -1
  62. package/dist/cli/credential-print.js.map +1 -1
  63. package/dist/cli/file-processor.d.ts.map +1 -1
  64. package/dist/cli/file-processor.js.map +1 -1
  65. package/dist/cli/initial-message.d.ts +1 -1
  66. package/dist/cli/initial-message.d.ts.map +1 -1
  67. package/dist/cli/initial-message.js.map +1 -1
  68. package/dist/cli/list-models.d.ts.map +1 -1
  69. package/dist/cli/list-models.js.map +1 -1
  70. package/dist/cli/project-trust.d.ts.map +1 -1
  71. package/dist/cli/project-trust.js.map +1 -1
  72. package/dist/cli/session-picker.d.ts.map +1 -1
  73. package/dist/cli/session-picker.js.map +1 -1
  74. package/dist/cli/setup.d.ts.map +1 -1
  75. package/dist/cli/setup.js.map +1 -1
  76. package/dist/cli/startup-ui.d.ts.map +1 -1
  77. package/dist/cli/startup-ui.js +38 -30
  78. package/dist/cli/startup-ui.js.map +1 -1
  79. package/dist/cli.d.ts.map +1 -1
  80. package/dist/config.d.ts +18 -4
  81. package/dist/config.d.ts.map +1 -1
  82. package/dist/config.js +30 -4
  83. package/dist/config.js.map +1 -1
  84. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  85. package/dist/core/agent-session-runtime.js +1 -1
  86. package/dist/core/agent-session-runtime.js.map +1 -1
  87. package/dist/core/agent-session-services.d.ts.map +1 -1
  88. package/dist/core/agent-session-services.js +13 -0
  89. package/dist/core/agent-session-services.js.map +1 -1
  90. package/dist/core/agent-session.d.ts +135 -11
  91. package/dist/core/agent-session.d.ts.map +1 -1
  92. package/dist/core/agent-session.js +509 -253
  93. package/dist/core/agent-session.js.map +1 -1
  94. package/dist/core/auth-guidance.d.ts.map +1 -1
  95. package/dist/core/auth-guidance.js.map +1 -1
  96. package/dist/core/auth-storage.d.ts.map +1 -1
  97. package/dist/core/auth-storage.js.map +1 -1
  98. package/dist/core/bash-executor.d.ts.map +1 -1
  99. package/dist/core/bash-executor.js.map +1 -1
  100. package/dist/core/bug-report-upload.d.ts.map +1 -1
  101. package/dist/core/bug-report-upload.js.map +1 -1
  102. package/dist/core/bug-report.d.ts +1 -1
  103. package/dist/core/bug-report.d.ts.map +1 -1
  104. package/dist/core/bug-report.js +1 -1
  105. package/dist/core/bug-report.js.map +1 -1
  106. package/dist/core/cache-stats.d.ts.map +1 -1
  107. package/dist/core/cache-stats.js.map +1 -1
  108. package/dist/core/cache-warmer.d.ts.map +1 -1
  109. package/dist/core/cache-warmer.js.map +1 -1
  110. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  111. package/dist/core/compaction/branch-summarization.js.map +1 -1
  112. package/dist/core/compaction/compaction.d.ts.map +1 -1
  113. package/dist/core/compaction/compaction.js +1 -22
  114. package/dist/core/compaction/compaction.js.map +1 -1
  115. package/dist/core/compaction/index.d.ts.map +1 -1
  116. package/dist/core/compaction/utils.d.ts +2 -1
  117. package/dist/core/compaction/utils.d.ts.map +1 -1
  118. package/dist/core/compaction/utils.js +25 -18
  119. package/dist/core/compaction/utils.js.map +1 -1
  120. package/dist/core/crash-log.d.ts.map +1 -1
  121. package/dist/core/crash-log.js +2 -1
  122. package/dist/core/crash-log.js.map +1 -1
  123. package/dist/core/defaults.d.ts.map +1 -1
  124. package/dist/core/diagnostics.d.ts.map +1 -1
  125. package/dist/core/event-bus.d.ts.map +1 -1
  126. package/dist/core/event-bus.js.map +1 -1
  127. package/dist/core/exec.d.ts.map +1 -1
  128. package/dist/core/exec.js.map +1 -1
  129. package/dist/core/experimental.d.ts.map +1 -1
  130. package/dist/core/experimental.js.map +1 -1
  131. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  132. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  133. package/dist/core/export-html/index.d.ts.map +1 -1
  134. package/dist/core/export-html/index.js.map +1 -1
  135. package/dist/core/export-html/template.css +10 -0
  136. package/dist/core/export-html/template.js +66 -17
  137. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  138. package/dist/core/export-html/tool-renderer.js.map +1 -1
  139. package/dist/core/extensions/index.d.ts +1 -1
  140. package/dist/core/extensions/index.d.ts.map +1 -1
  141. package/dist/core/extensions/index.js.map +1 -1
  142. package/dist/core/extensions/jiti-loader.d.ts.map +1 -1
  143. package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -1
  144. package/dist/core/extensions/loader.d.ts.map +1 -1
  145. package/dist/core/extensions/loader.js +55 -5
  146. package/dist/core/extensions/loader.js.map +1 -1
  147. package/dist/core/extensions/runner.d.ts +18 -1
  148. package/dist/core/extensions/runner.d.ts.map +1 -1
  149. package/dist/core/extensions/runner.js +99 -0
  150. package/dist/core/extensions/runner.js.map +1 -1
  151. package/dist/core/extensions/types.d.ts +296 -22
  152. package/dist/core/extensions/types.d.ts.map +1 -1
  153. package/dist/core/extensions/types.js.map +1 -1
  154. package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
  155. package/dist/core/extensions/wrapper.d.ts +2 -2
  156. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  157. package/dist/core/extensions/wrapper.js +3 -3
  158. package/dist/core/extensions/wrapper.js.map +1 -1
  159. package/dist/core/footer-data-provider.d.ts.map +1 -1
  160. package/dist/core/footer-data-provider.js.map +1 -1
  161. package/dist/core/http-dispatcher.d.ts.map +1 -1
  162. package/dist/core/http-dispatcher.js.map +1 -1
  163. package/dist/core/index.d.ts.map +1 -1
  164. package/dist/core/keybindings.d.ts +1 -1
  165. package/dist/core/keybindings.d.ts.map +1 -1
  166. package/dist/core/keybindings.js +1 -1
  167. package/dist/core/keybindings.js.map +1 -1
  168. package/dist/core/mcp-servers.d.ts +98 -0
  169. package/dist/core/mcp-servers.d.ts.map +1 -0
  170. package/dist/core/mcp-servers.js +157 -0
  171. package/dist/core/mcp-servers.js.map +1 -0
  172. package/dist/core/messages.d.ts.map +1 -1
  173. package/dist/core/messages.js.map +1 -1
  174. package/dist/core/model-config.d.ts.map +1 -1
  175. package/dist/core/model-config.js.map +1 -1
  176. package/dist/core/model-registry.d.ts +13 -1
  177. package/dist/core/model-registry.d.ts.map +1 -1
  178. package/dist/core/model-registry.js +25 -0
  179. package/dist/core/model-registry.js.map +1 -1
  180. package/dist/core/model-resolver.d.ts +2 -2
  181. package/dist/core/model-resolver.d.ts.map +1 -1
  182. package/dist/core/model-resolver.js +4 -4
  183. package/dist/core/model-resolver.js.map +1 -1
  184. package/dist/core/model-runtime.d.ts +41 -3
  185. package/dist/core/model-runtime.d.ts.map +1 -1
  186. package/dist/core/model-runtime.js +167 -17
  187. package/dist/core/model-runtime.js.map +1 -1
  188. package/dist/core/models-store.d.ts.map +1 -1
  189. package/dist/core/models-store.js.map +1 -1
  190. package/dist/core/nested-tool-calls.d.ts +102 -0
  191. package/dist/core/nested-tool-calls.d.ts.map +1 -0
  192. package/dist/core/nested-tool-calls.js +178 -0
  193. package/dist/core/nested-tool-calls.js.map +1 -0
  194. package/dist/core/output-guard.d.ts.map +1 -1
  195. package/dist/core/output-guard.js.map +1 -1
  196. package/dist/core/package-manager.d.ts +4 -0
  197. package/dist/core/package-manager.d.ts.map +1 -1
  198. package/dist/core/package-manager.js +59 -12
  199. package/dist/core/package-manager.js.map +1 -1
  200. package/dist/core/pi-manifest.d.ts.map +1 -1
  201. package/dist/core/pi-manifest.js.map +1 -1
  202. package/dist/core/project-trust.d.ts.map +1 -1
  203. package/dist/core/project-trust.js.map +1 -1
  204. package/dist/core/prompt-templates.d.ts.map +1 -1
  205. package/dist/core/prompt-templates.js.map +1 -1
  206. package/dist/core/provider-attribution.d.ts.map +1 -1
  207. package/dist/core/provider-attribution.js.map +1 -1
  208. package/dist/core/provider-composer.d.ts +40 -21
  209. package/dist/core/provider-composer.d.ts.map +1 -1
  210. package/dist/core/provider-composer.js +92 -40
  211. package/dist/core/provider-composer.js.map +1 -1
  212. package/dist/core/radius.d.ts.map +1 -1
  213. package/dist/core/radius.js.map +1 -1
  214. package/dist/core/remote-catalog-provider.d.ts +8 -1
  215. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  216. package/dist/core/remote-catalog-provider.js +18 -3
  217. package/dist/core/remote-catalog-provider.js.map +1 -1
  218. package/dist/core/resolve-config-value.d.ts.map +1 -1
  219. package/dist/core/resolve-config-value.js.map +1 -1
  220. package/dist/core/resource-loader.d.ts +7 -1
  221. package/dist/core/resource-loader.d.ts.map +1 -1
  222. package/dist/core/resource-loader.js +161 -35
  223. package/dist/core/resource-loader.js.map +1 -1
  224. package/dist/core/runtime-credentials.d.ts.map +1 -1
  225. package/dist/core/runtime-credentials.js.map +1 -1
  226. package/dist/core/sdk.d.ts +1 -1
  227. package/dist/core/sdk.d.ts.map +1 -1
  228. package/dist/core/sdk.js +24 -6
  229. package/dist/core/sdk.js.map +1 -1
  230. package/dist/core/session-cwd.d.ts.map +1 -1
  231. package/dist/core/session-cwd.js.map +1 -1
  232. package/dist/core/session-export.d.ts.map +1 -1
  233. package/dist/core/session-export.js.map +1 -1
  234. package/dist/core/session-manager.d.ts +9 -0
  235. package/dist/core/session-manager.d.ts.map +1 -1
  236. package/dist/core/session-manager.js +22 -22
  237. package/dist/core/session-manager.js.map +1 -1
  238. package/dist/core/settings-diagnostics.d.ts.map +1 -1
  239. package/dist/core/settings-diagnostics.js.map +1 -1
  240. package/dist/core/settings-manager.d.ts +31 -1
  241. package/dist/core/settings-manager.d.ts.map +1 -1
  242. package/dist/core/settings-manager.js +72 -2
  243. package/dist/core/settings-manager.js.map +1 -1
  244. package/dist/core/skills.d.ts.map +1 -1
  245. package/dist/core/skills.js.map +1 -1
  246. package/dist/core/slash-commands.d.ts.map +1 -1
  247. package/dist/core/source-info.d.ts +8 -0
  248. package/dist/core/source-info.d.ts.map +1 -1
  249. package/dist/core/source-info.js +16 -0
  250. package/dist/core/source-info.js.map +1 -1
  251. package/dist/core/system-prompt.d.ts.map +1 -1
  252. package/dist/core/system-prompt.js +1 -1
  253. package/dist/core/system-prompt.js.map +1 -1
  254. package/dist/core/telemetry.d.ts.map +1 -1
  255. package/dist/core/telemetry.js.map +1 -1
  256. package/dist/core/timings.d.ts.map +1 -1
  257. package/dist/core/timings.js.map +1 -1
  258. package/dist/core/tools/bash.d.ts +12 -0
  259. package/dist/core/tools/bash.d.ts.map +1 -1
  260. package/dist/core/tools/bash.js +35 -2
  261. package/dist/core/tools/bash.js.map +1 -1
  262. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  263. package/dist/core/tools/edit-diff.js.map +1 -1
  264. package/dist/core/tools/edit.d.ts.map +1 -1
  265. package/dist/core/tools/edit.js.map +1 -1
  266. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
  267. package/dist/core/tools/file-mutation-queue.js.map +1 -1
  268. package/dist/core/tools/find.d.ts.map +1 -1
  269. package/dist/core/tools/find.js.map +1 -1
  270. package/dist/core/tools/grep.d.ts.map +1 -1
  271. package/dist/core/tools/grep.js.map +1 -1
  272. package/dist/core/tools/index.d.ts.map +1 -1
  273. package/dist/core/tools/index.js.map +1 -1
  274. package/dist/core/tools/ls.d.ts.map +1 -1
  275. package/dist/core/tools/ls.js.map +1 -1
  276. package/dist/core/tools/output-accumulator.d.ts +11 -0
  277. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  278. package/dist/core/tools/output-accumulator.js +36 -0
  279. package/dist/core/tools/output-accumulator.js.map +1 -1
  280. package/dist/core/tools/path-utils.d.ts.map +1 -1
  281. package/dist/core/tools/path-utils.js.map +1 -1
  282. package/dist/core/tools/powershell.d.ts.map +1 -1
  283. package/dist/core/tools/powershell.js.map +1 -1
  284. package/dist/core/tools/read.d.ts.map +1 -1
  285. package/dist/core/tools/read.js.map +1 -1
  286. package/dist/core/tools/render-utils.d.ts +6 -0
  287. package/dist/core/tools/render-utils.d.ts.map +1 -1
  288. package/dist/core/tools/render-utils.js +26 -0
  289. package/dist/core/tools/render-utils.js.map +1 -1
  290. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  291. package/dist/core/tools/renderers/bash.js +9 -10
  292. package/dist/core/tools/renderers/bash.js.map +1 -1
  293. package/dist/core/tools/renderers/edit.d.ts.map +1 -1
  294. package/dist/core/tools/renderers/edit.js.map +1 -1
  295. package/dist/core/tools/renderers/find.d.ts.map +1 -1
  296. package/dist/core/tools/renderers/find.js.map +1 -1
  297. package/dist/core/tools/renderers/grep.d.ts.map +1 -1
  298. package/dist/core/tools/renderers/grep.js.map +1 -1
  299. package/dist/core/tools/renderers/index.d.ts.map +1 -1
  300. package/dist/core/tools/renderers/index.js.map +1 -1
  301. package/dist/core/tools/renderers/ls.d.ts.map +1 -1
  302. package/dist/core/tools/renderers/ls.js.map +1 -1
  303. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  304. package/dist/core/tools/renderers/read.js +3 -2
  305. package/dist/core/tools/renderers/read.js.map +1 -1
  306. package/dist/core/tools/renderers/write.d.ts.map +1 -1
  307. package/dist/core/tools/renderers/write.js.map +1 -1
  308. package/dist/core/tools/tool-definition-wrapper.d.ts +5 -3
  309. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  310. package/dist/core/tools/tool-definition-wrapper.js +3 -1
  311. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  312. package/dist/core/tools/truncate.d.ts +14 -0
  313. package/dist/core/tools/truncate.d.ts.map +1 -1
  314. package/dist/core/tools/truncate.js +29 -0
  315. package/dist/core/tools/truncate.js.map +1 -1
  316. package/dist/core/tools/write.d.ts.map +1 -1
  317. package/dist/core/tools/write.js.map +1 -1
  318. package/dist/core/trust-manager.d.ts.map +1 -1
  319. package/dist/core/trust-manager.js +1 -0
  320. package/dist/core/trust-manager.js.map +1 -1
  321. package/dist/core/usage-totals.d.ts +2 -0
  322. package/dist/core/usage-totals.d.ts.map +1 -1
  323. package/dist/core/usage-totals.js +23 -0
  324. package/dist/core/usage-totals.js.map +1 -1
  325. package/dist/core/virtual-models.d.ts +115 -0
  326. package/dist/core/virtual-models.d.ts.map +1 -0
  327. package/dist/core/virtual-models.js +117 -0
  328. package/dist/core/virtual-models.js.map +1 -0
  329. package/dist/extensions/codemode/execute.d.ts +16 -0
  330. package/dist/extensions/codemode/execute.d.ts.map +1 -0
  331. package/dist/extensions/codemode/execute.js +390 -0
  332. package/dist/extensions/codemode/execute.js.map +1 -0
  333. package/dist/extensions/codemode/execute.lazy.d.ts +3 -0
  334. package/dist/extensions/codemode/execute.lazy.d.ts.map +1 -0
  335. package/dist/extensions/codemode/execute.lazy.js +3 -0
  336. package/dist/extensions/codemode/execute.lazy.js.map +1 -0
  337. package/dist/extensions/codemode/index.d.ts +21 -0
  338. package/dist/extensions/codemode/index.d.ts.map +1 -0
  339. package/dist/extensions/codemode/index.js +31 -0
  340. package/dist/extensions/codemode/index.js.map +1 -0
  341. package/dist/extensions/codemode/renderer.d.ts +12 -0
  342. package/dist/extensions/codemode/renderer.d.ts.map +1 -0
  343. package/dist/extensions/codemode/renderer.js +119 -0
  344. package/dist/extensions/codemode/renderer.js.map +1 -0
  345. package/dist/extensions/codemode/tool.d.ts +122 -0
  346. package/dist/extensions/codemode/tool.d.ts.map +1 -0
  347. package/dist/extensions/codemode/tool.js +324 -0
  348. package/dist/extensions/codemode/tool.js.map +1 -0
  349. package/dist/extensions/codemode/worker.d.ts +7 -0
  350. package/dist/extensions/codemode/worker.d.ts.map +1 -0
  351. package/dist/extensions/codemode/worker.js +7 -0
  352. package/dist/extensions/codemode/worker.js.map +1 -0
  353. package/dist/extensions/index.d.ts.map +1 -1
  354. package/dist/extensions/index.js +11 -1
  355. package/dist/extensions/index.js.map +1 -1
  356. package/dist/extensions/llama/client.d.ts.map +1 -1
  357. package/dist/extensions/llama/client.js.map +1 -1
  358. package/dist/extensions/llama/huggingface.d.ts.map +1 -1
  359. package/dist/extensions/llama/huggingface.js.map +1 -1
  360. package/dist/extensions/llama/index.d.ts.map +1 -1
  361. package/dist/extensions/llama/index.js.map +1 -1
  362. package/dist/extensions/llama/provider.d.ts +1 -1
  363. package/dist/extensions/llama/provider.d.ts.map +1 -1
  364. package/dist/extensions/llama/provider.js +65 -13
  365. package/dist/extensions/llama/provider.js.map +1 -1
  366. package/dist/extensions/llama/ui.d.ts.map +1 -1
  367. package/dist/extensions/llama/ui.js.map +1 -1
  368. package/dist/extensions/mcp/cli.d.ts +21 -0
  369. package/dist/extensions/mcp/cli.d.ts.map +1 -0
  370. package/dist/extensions/mcp/cli.js +485 -0
  371. package/dist/extensions/mcp/cli.js.map +1 -0
  372. package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
  373. package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
  374. package/dist/extensions/mcp/cli.lazy.js +3 -0
  375. package/dist/extensions/mcp/cli.lazy.js.map +1 -0
  376. package/dist/extensions/mcp/config.d.ts +70 -0
  377. package/dist/extensions/mcp/config.d.ts.map +1 -0
  378. package/dist/extensions/mcp/config.js +146 -0
  379. package/dist/extensions/mcp/config.js.map +1 -0
  380. package/dist/extensions/mcp/index.d.ts +52 -0
  381. package/dist/extensions/mcp/index.d.ts.map +1 -0
  382. package/dist/extensions/mcp/index.js +902 -0
  383. package/dist/extensions/mcp/index.js.map +1 -0
  384. package/dist/extensions/mcp/log.d.ts +16 -0
  385. package/dist/extensions/mcp/log.d.ts.map +1 -0
  386. package/dist/extensions/mcp/log.js +66 -0
  387. package/dist/extensions/mcp/log.js.map +1 -0
  388. package/dist/extensions/mcp/oauth.d.ts +94 -0
  389. package/dist/extensions/mcp/oauth.d.ts.map +1 -0
  390. package/dist/extensions/mcp/oauth.js +333 -0
  391. package/dist/extensions/mcp/oauth.js.map +1 -0
  392. package/dist/extensions/mcp/resources.d.ts +43 -0
  393. package/dist/extensions/mcp/resources.d.ts.map +1 -0
  394. package/dist/extensions/mcp/resources.js +262 -0
  395. package/dist/extensions/mcp/resources.js.map +1 -0
  396. package/dist/extensions/mcp/runtime.d.ts +96 -0
  397. package/dist/extensions/mcp/runtime.d.ts.map +1 -0
  398. package/dist/extensions/mcp/runtime.js +388 -0
  399. package/dist/extensions/mcp/runtime.js.map +1 -0
  400. package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
  401. package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
  402. package/dist/extensions/mcp/runtime.lazy.js +3 -0
  403. package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
  404. package/dist/extensions/mcp/tools.d.ts +83 -0
  405. package/dist/extensions/mcp/tools.d.ts.map +1 -0
  406. package/dist/extensions/mcp/tools.js +233 -0
  407. package/dist/extensions/mcp/tools.js.map +1 -0
  408. package/dist/extensions/mcp/ui.d.ts +60 -0
  409. package/dist/extensions/mcp/ui.d.ts.map +1 -0
  410. package/dist/extensions/mcp/ui.js +172 -0
  411. package/dist/extensions/mcp/ui.js.map +1 -0
  412. package/dist/extensions/tool-search/index.d.ts +12 -0
  413. package/dist/extensions/tool-search/index.d.ts.map +1 -0
  414. package/dist/extensions/tool-search/index.js +15 -0
  415. package/dist/extensions/tool-search/index.js.map +1 -0
  416. package/dist/extensions/tool-search/tool.d.ts +72 -0
  417. package/dist/extensions/tool-search/tool.d.ts.map +1 -0
  418. package/dist/extensions/tool-search/tool.js +210 -0
  419. package/dist/extensions/tool-search/tool.js.map +1 -0
  420. package/dist/index.d.ts +9 -2
  421. package/dist/index.d.ts.map +1 -1
  422. package/dist/index.js +5 -0
  423. package/dist/index.js.map +1 -1
  424. package/dist/main.d.ts.map +1 -1
  425. package/dist/main.js +10 -0
  426. package/dist/main.js.map +1 -1
  427. package/dist/migrations.d.ts.map +1 -1
  428. package/dist/migrations.js.map +1 -1
  429. package/dist/modes/index.d.ts.map +1 -1
  430. package/dist/modes/interactive/bug-report.d.ts.map +1 -1
  431. package/dist/modes/interactive/bug-report.js.map +1 -1
  432. package/dist/modes/interactive/chat-viewport.d.ts.map +1 -1
  433. package/dist/modes/interactive/chat-viewport.js.map +1 -1
  434. package/dist/modes/interactive/components/armin.d.ts.map +1 -1
  435. package/dist/modes/interactive/components/armin.js.map +1 -1
  436. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  437. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  438. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  439. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  440. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
  441. package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
  442. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  443. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  444. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  445. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  446. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  447. package/dist/modes/interactive/components/config-selector.js +13 -3
  448. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  449. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
  450. package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
  451. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  452. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  453. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  454. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  455. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  456. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  457. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
  458. package/dist/modes/interactive/components/daxnuts.js.map +1 -1
  459. package/dist/modes/interactive/components/diff.d.ts.map +1 -1
  460. package/dist/modes/interactive/components/diff.js.map +1 -1
  461. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
  462. package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
  463. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
  464. package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
  465. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  466. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  467. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
  468. package/dist/modes/interactive/components/extension-input.js.map +1 -1
  469. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  470. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  471. package/dist/modes/interactive/components/first-time-setup.d.ts +4 -4
  472. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
  473. package/dist/modes/interactive/components/first-time-setup.js +8 -2
  474. package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
  475. package/dist/modes/interactive/components/footer.d.ts +7 -0
  476. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  477. package/dist/modes/interactive/components/footer.js +43 -3
  478. package/dist/modes/interactive/components/footer.js.map +1 -1
  479. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  480. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  481. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  482. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  483. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  484. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
  485. package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
  486. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  487. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  488. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  489. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  490. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  491. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  492. package/dist/modes/interactive/components/pi-logo.d.ts +12 -0
  493. package/dist/modes/interactive/components/pi-logo.d.ts.map +1 -0
  494. package/dist/modes/interactive/components/pi-logo.js +25 -0
  495. package/dist/modes/interactive/components/pi-logo.js.map +1 -0
  496. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  497. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  498. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  499. package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  500. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  501. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  502. package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
  503. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  504. package/dist/modes/interactive/components/settings-selector.js +28 -6
  505. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  506. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  507. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  508. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
  509. package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
  510. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  511. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  512. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  513. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  514. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
  515. package/dist/modes/interactive/components/theme-selector.js.map +1 -1
  516. package/dist/modes/interactive/components/themed-text.d.ts +17 -0
  517. package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
  518. package/dist/modes/interactive/components/themed-text.js +29 -0
  519. package/dist/modes/interactive/components/themed-text.js.map +1 -0
  520. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  521. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  522. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  523. package/dist/modes/interactive/components/tool-execution.js +2 -2
  524. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  525. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  526. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  527. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
  528. package/dist/modes/interactive/components/trust-selector.js.map +1 -1
  529. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  530. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  531. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  532. package/dist/modes/interactive/components/user-message.js.map +1 -1
  533. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  534. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  535. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  536. package/dist/modes/interactive/external-editor.js.map +1 -1
  537. package/dist/modes/interactive/interactive-mode.d.ts +11 -0
  538. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  539. package/dist/modes/interactive/interactive-mode.js +199 -161
  540. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  541. package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -1
  542. package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
  543. package/dist/modes/interactive/model-search.d.ts.map +1 -1
  544. package/dist/modes/interactive/model-search.js.map +1 -1
  545. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  546. package/dist/modes/interactive/session-share.js.map +1 -1
  547. package/dist/modes/interactive/theme/dark.json +59 -72
  548. package/dist/modes/interactive/theme/light.json +57 -69
  549. package/dist/modes/interactive/theme/system-theme.d.ts +54 -0
  550. package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
  551. package/dist/modes/interactive/theme/system-theme.js +535 -0
  552. package/dist/modes/interactive/theme/system-theme.js.map +1 -0
  553. package/dist/modes/interactive/theme/theme-controller.d.ts +46 -6
  554. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  555. package/dist/modes/interactive/theme/theme-controller.js +127 -47
  556. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  557. package/dist/modes/interactive/theme/theme-json.d.ts +1 -0
  558. package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -1
  559. package/dist/modes/interactive/theme/theme-json.js +3 -1
  560. package/dist/modes/interactive/theme/theme-json.js.map +1 -1
  561. package/dist/modes/interactive/theme/theme-schema.json +7 -2
  562. package/dist/modes/interactive/theme/theme.d.ts +66 -39
  563. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  564. package/dist/modes/interactive/theme/theme.js +238 -317
  565. package/dist/modes/interactive/theme/theme.js.map +1 -1
  566. package/dist/modes/interactive/tui-renderer.d.ts +2 -1
  567. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -1
  568. package/dist/modes/interactive/tui-renderer.js +1 -0
  569. package/dist/modes/interactive/tui-renderer.js.map +1 -1
  570. package/dist/modes/json-event.d.ts.map +1 -1
  571. package/dist/modes/json-event.js.map +1 -1
  572. package/dist/modes/print-mode.d.ts.map +1 -1
  573. package/dist/modes/print-mode.js.map +1 -1
  574. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  575. package/dist/modes/rpc/jsonl.js.map +1 -1
  576. package/dist/modes/rpc/rpc-client.d.ts +6 -6
  577. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  578. package/dist/modes/rpc/rpc-client.js +12 -8
  579. package/dist/modes/rpc/rpc-client.js.map +1 -1
  580. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  581. package/dist/modes/rpc/rpc-mode.js +7 -9
  582. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  583. package/dist/modes/rpc/rpc-types.d.ts +10 -1
  584. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  585. package/dist/modes/rpc/rpc-types.js.map +1 -1
  586. package/dist/package-manager-cli.d.ts.map +1 -1
  587. package/dist/package-manager-cli.js +6 -2
  588. package/dist/package-manager-cli.js.map +1 -1
  589. package/dist/rpc-entry.d.ts.map +1 -1
  590. package/dist/rpc-entry.js.map +1 -1
  591. package/dist/utils/abort.d.ts.map +1 -1
  592. package/dist/utils/abort.js.map +1 -1
  593. package/dist/utils/ansi.d.ts.map +1 -1
  594. package/dist/utils/ansi.js.map +1 -1
  595. package/dist/utils/changelog.d.ts.map +1 -1
  596. package/dist/utils/changelog.js.map +1 -1
  597. package/dist/utils/child-process.d.ts.map +1 -1
  598. package/dist/utils/child-process.js.map +1 -1
  599. package/dist/utils/clipboard-command.d.ts.map +1 -1
  600. package/dist/utils/clipboard-command.js.map +1 -1
  601. package/dist/utils/clipboard-image.d.ts.map +1 -1
  602. package/dist/utils/clipboard-image.js +14 -17
  603. package/dist/utils/clipboard-image.js.map +1 -1
  604. package/dist/utils/clipboard.d.ts +2 -0
  605. package/dist/utils/clipboard.d.ts.map +1 -1
  606. package/dist/utils/clipboard.js +5 -0
  607. package/dist/utils/clipboard.js.map +1 -1
  608. package/dist/utils/deprecation.d.ts.map +1 -1
  609. package/dist/utils/deprecation.js.map +1 -1
  610. package/dist/utils/exif-orientation.d.ts.map +1 -1
  611. package/dist/utils/exif-orientation.js.map +1 -1
  612. package/dist/utils/frontmatter.d.ts.map +1 -1
  613. package/dist/utils/frontmatter.js.map +1 -1
  614. package/dist/utils/fs-watch.d.ts.map +1 -1
  615. package/dist/utils/fs-watch.js.map +1 -1
  616. package/dist/utils/git.d.ts.map +1 -1
  617. package/dist/utils/git.js.map +1 -1
  618. package/dist/utils/html.d.ts.map +1 -1
  619. package/dist/utils/html.js.map +1 -1
  620. package/dist/utils/image-convert.d.ts.map +1 -1
  621. package/dist/utils/image-convert.js.map +1 -1
  622. package/dist/utils/image-process.d.ts.map +1 -1
  623. package/dist/utils/image-process.js.map +1 -1
  624. package/dist/utils/image-resize-core.d.ts.map +1 -1
  625. package/dist/utils/image-resize-core.js.map +1 -1
  626. package/dist/utils/image-resize-worker.d.ts.map +1 -1
  627. package/dist/utils/image-resize-worker.js.map +1 -1
  628. package/dist/utils/image-resize.d.ts.map +1 -1
  629. package/dist/utils/image-resize.js.map +1 -1
  630. package/dist/utils/json.d.ts.map +1 -1
  631. package/dist/utils/json.js.map +1 -1
  632. package/dist/utils/management-http.d.ts.map +1 -1
  633. package/dist/utils/management-http.js.map +1 -1
  634. package/dist/utils/mime.d.ts.map +1 -1
  635. package/dist/utils/mime.js.map +1 -1
  636. package/dist/utils/open-browser.d.ts.map +1 -1
  637. package/dist/utils/open-browser.js.map +1 -1
  638. package/dist/utils/paths.d.ts +3 -3
  639. package/dist/utils/paths.d.ts.map +1 -1
  640. package/dist/utils/paths.js +5 -4
  641. package/dist/utils/paths.js.map +1 -1
  642. package/dist/utils/photon.d.ts.map +1 -1
  643. package/dist/utils/photon.js.map +1 -1
  644. package/dist/utils/pi-user-agent.d.ts.map +1 -1
  645. package/dist/utils/pi-user-agent.js.map +1 -1
  646. package/dist/utils/shell.d.ts +1 -3
  647. package/dist/utils/shell.d.ts.map +1 -1
  648. package/dist/utils/shell.js +3 -30
  649. package/dist/utils/shell.js.map +1 -1
  650. package/dist/utils/sleep.d.ts.map +1 -1
  651. package/dist/utils/sleep.js.map +1 -1
  652. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  653. package/dist/utils/syntax-highlight.js +2 -0
  654. package/dist/utils/syntax-highlight.js.map +1 -1
  655. package/dist/utils/text.d.ts.map +1 -1
  656. package/dist/utils/text.js.map +1 -1
  657. package/dist/utils/tool-result-images.d.ts.map +1 -1
  658. package/dist/utils/tool-result-images.js.map +1 -1
  659. package/dist/utils/tools-manager.d.ts.map +1 -1
  660. package/dist/utils/tools-manager.js.map +1 -1
  661. package/dist/utils/version-check.d.ts.map +1 -1
  662. package/dist/utils/version-check.js.map +1 -1
  663. package/dist/utils/windows-self-update.d.ts.map +1 -1
  664. package/dist/utils/windows-self-update.js.map +1 -1
  665. package/dist/utils/wsl.d.ts.map +1 -1
  666. package/dist/utils/wsl.js.map +1 -1
  667. package/dist/utils/zip.d.ts.map +1 -1
  668. package/dist/utils/zip.js.map +1 -1
  669. package/docs/cli.md +64 -3
  670. package/docs/configuration.md +2 -0
  671. package/docs/custom-provider.md +43 -4
  672. package/docs/docs.json +8 -0
  673. package/docs/extensions.md +55 -0
  674. package/docs/keybindings.md +1 -1
  675. package/docs/llama-cpp.md +13 -0
  676. package/docs/mcp.md +188 -0
  677. package/docs/models.md +35 -0
  678. package/docs/packages.md +4 -2
  679. package/docs/providers.md +1 -0
  680. package/docs/rpc-commands.md +9 -3
  681. package/docs/rpc.md +3 -1
  682. package/docs/sdk.md +7 -2
  683. package/docs/security.md +2 -0
  684. package/docs/session-format.md +5 -1
  685. package/docs/settings.md +20 -3
  686. package/docs/themes.md +33 -7
  687. package/docs/tui.md +18 -0
  688. package/docs/virtual-models.md +114 -0
  689. package/docs/windows.md +2 -0
  690. package/examples/README.md +1 -1
  691. package/examples/extensions/README.md +2 -0
  692. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  693. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  694. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  695. package/examples/extensions/custom-provider-gitlab-duo/test.ts +5 -5
  696. package/examples/extensions/debug-provider.ts +90 -0
  697. package/examples/extensions/gondolin/package-lock.json +2 -2
  698. package/examples/extensions/gondolin/package.json +1 -1
  699. package/examples/extensions/jev-router.ts +113 -0
  700. package/examples/extensions/sandbox/package-lock.json +2 -2
  701. package/examples/extensions/sandbox/package.json +1 -1
  702. package/examples/extensions/with-deps/package-lock.json +2 -2
  703. package/examples/extensions/with-deps/package.json +1 -1
  704. package/examples/rpc-client.ts +1 -1
  705. package/examples/rpc-extension-ui.ts +1 -1
  706. package/examples/sdk/14-codemode-mcp.ts +61 -0
  707. package/examples/sdk/README.md +2 -1
  708. package/npm-shrinkwrap.json +89 -39
  709. package/package.json +14 -12
  710. package/dist/bundle/chunks/anthropic-messages-J5WXPPPC.js +0 -6
  711. package/dist/bundle/chunks/azure-openai-responses-HUSQ3GP2.js +0 -2
  712. package/dist/bundle/chunks/chunk-65HAU2C5.js +0 -2
  713. package/dist/bundle/chunks/chunk-6R7UI4IY.js +0 -2
  714. package/dist/bundle/chunks/chunk-NUHFSC37.js +0 -25
  715. package/dist/bundle/chunks/chunk-OJP47DM6.js +0 -1568
  716. package/dist/bundle/chunks/chunk-RCZIEVGO.js +0 -11
  717. package/dist/bundle/chunks/google-generative-ai-IMS5EK2Y.js +0 -2
  718. package/dist/bundle/chunks/google-vertex-O4YJEQUW.js +0 -2
  719. package/dist/bundle/chunks/mistral-conversations-NOSQHBEY.js +0 -5
  720. package/dist/bundle/chunks/openai-responses-HWEUZ6WZ.js +0 -2
  721. package/dist/bundle/chunks/virtual-modules-VHMJYYWQ.js +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"zip.d.ts","sourceRoot":"","sources":["../../src/utils/zip.ts"],"names":[],"mappings":"AAGA,UAAU,QAAQ;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;CAC1B;AA+DD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7F","sourcesContent":["import { writeFile } from \"node:fs/promises\";\nimport { crc32, deflateRawSync } from \"node:zlib\";\n\ninterface ZipEntry {\n\tname: string;\n\tdata: string | Uint8Array;\n}\n\nfunction dosDateTime(date: Date): { time: number; day: number } {\n\treturn {\n\t\ttime: (date.getHours() << 11) | (date.getMinutes() << 5) | (date.getSeconds() >> 1),\n\t\tday: ((Math.max(1980, date.getFullYear()) - 1980) << 9) | ((date.getMonth() + 1) << 5) | date.getDate(),\n\t};\n}\n\n/** Create the small, classic ZIP archives used by bug reports. */\nfunction createZipArchive(entries: readonly ZipEntry[]): Buffer {\n\tconst files: Buffer[] = [];\n\tconst directory: Buffer[] = [];\n\tconst { time, day } = dosDateTime(new Date());\n\tlet offset = 0;\n\n\tfor (const entry of entries) {\n\t\tconst name = Buffer.from(entry.name);\n\t\tconst data = typeof entry.data === \"string\" ? Buffer.from(entry.data) : Buffer.from(entry.data);\n\t\tconst compressed = deflateRawSync(data);\n\t\tconst checksum = crc32(data);\n\n\t\tconst local = Buffer.alloc(30);\n\t\tlocal.writeUInt32LE(0x04034b50, 0);\n\t\tlocal.writeUInt16LE(20, 4);\n\t\tlocal.writeUInt16LE(0x0800, 6);\n\t\tlocal.writeUInt16LE(8, 8);\n\t\tlocal.writeUInt16LE(time, 10);\n\t\tlocal.writeUInt16LE(day, 12);\n\t\tlocal.writeUInt32LE(checksum, 14);\n\t\tlocal.writeUInt32LE(compressed.length, 18);\n\t\tlocal.writeUInt32LE(data.length, 22);\n\t\tlocal.writeUInt16LE(name.length, 26);\n\n\t\tconst central = Buffer.alloc(46);\n\t\tcentral.writeUInt32LE(0x02014b50, 0);\n\t\tcentral.writeUInt16LE(20, 4);\n\t\tcentral.writeUInt16LE(20, 6);\n\t\tcentral.writeUInt16LE(0x0800, 8);\n\t\tcentral.writeUInt16LE(8, 10);\n\t\tcentral.writeUInt16LE(time, 12);\n\t\tcentral.writeUInt16LE(day, 14);\n\t\tcentral.writeUInt32LE(checksum, 16);\n\t\tcentral.writeUInt32LE(compressed.length, 20);\n\t\tcentral.writeUInt32LE(data.length, 24);\n\t\tcentral.writeUInt16LE(name.length, 28);\n\t\tcentral.writeUInt32LE(offset, 42);\n\n\t\tfiles.push(local, name, compressed);\n\t\tdirectory.push(central, name);\n\t\toffset += local.length + name.length + compressed.length;\n\t}\n\n\tconst centralDirectory = Buffer.concat(directory);\n\tconst end = Buffer.alloc(22);\n\tend.writeUInt32LE(0x06054b50, 0);\n\tend.writeUInt16LE(entries.length, 8);\n\tend.writeUInt16LE(entries.length, 10);\n\tend.writeUInt32LE(centralDirectory.length, 12);\n\tend.writeUInt32LE(offset, 16);\n\treturn Buffer.concat([...files, centralDirectory, end]);\n}\n\nexport function writeZipArchive(filePath: string, entries: readonly ZipEntry[]): Promise<void> {\n\treturn writeFile(filePath, createZipArchive(entries));\n}\n"]}
1
+ {"version":3,"file":"zip.d.ts","sourceRoot":"","sources":["../../src/utils/zip.ts"],"names":[],"mappings":"AAGA,UAAU,QAAQ;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;CAC1B;AA+DD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7F"}
@@ -1 +1 @@
1
- {"version":3,"file":"zip.js","sourceRoot":"","sources":["../../src/utils/zip.ts"],"names":[],"mappings":"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","sourcesContent":["import { writeFile } from \"node:fs/promises\";\nimport { crc32, deflateRawSync } from \"node:zlib\";\n\ninterface ZipEntry {\n\tname: string;\n\tdata: string | Uint8Array;\n}\n\nfunction dosDateTime(date: Date): { time: number; day: number } {\n\treturn {\n\t\ttime: (date.getHours() << 11) | (date.getMinutes() << 5) | (date.getSeconds() >> 1),\n\t\tday: ((Math.max(1980, date.getFullYear()) - 1980) << 9) | ((date.getMonth() + 1) << 5) | date.getDate(),\n\t};\n}\n\n/** Create the small, classic ZIP archives used by bug reports. */\nfunction createZipArchive(entries: readonly ZipEntry[]): Buffer {\n\tconst files: Buffer[] = [];\n\tconst directory: Buffer[] = [];\n\tconst { time, day } = dosDateTime(new Date());\n\tlet offset = 0;\n\n\tfor (const entry of entries) {\n\t\tconst name = Buffer.from(entry.name);\n\t\tconst data = typeof entry.data === \"string\" ? Buffer.from(entry.data) : Buffer.from(entry.data);\n\t\tconst compressed = deflateRawSync(data);\n\t\tconst checksum = crc32(data);\n\n\t\tconst local = Buffer.alloc(30);\n\t\tlocal.writeUInt32LE(0x04034b50, 0);\n\t\tlocal.writeUInt16LE(20, 4);\n\t\tlocal.writeUInt16LE(0x0800, 6);\n\t\tlocal.writeUInt16LE(8, 8);\n\t\tlocal.writeUInt16LE(time, 10);\n\t\tlocal.writeUInt16LE(day, 12);\n\t\tlocal.writeUInt32LE(checksum, 14);\n\t\tlocal.writeUInt32LE(compressed.length, 18);\n\t\tlocal.writeUInt32LE(data.length, 22);\n\t\tlocal.writeUInt16LE(name.length, 26);\n\n\t\tconst central = Buffer.alloc(46);\n\t\tcentral.writeUInt32LE(0x02014b50, 0);\n\t\tcentral.writeUInt16LE(20, 4);\n\t\tcentral.writeUInt16LE(20, 6);\n\t\tcentral.writeUInt16LE(0x0800, 8);\n\t\tcentral.writeUInt16LE(8, 10);\n\t\tcentral.writeUInt16LE(time, 12);\n\t\tcentral.writeUInt16LE(day, 14);\n\t\tcentral.writeUInt32LE(checksum, 16);\n\t\tcentral.writeUInt32LE(compressed.length, 20);\n\t\tcentral.writeUInt32LE(data.length, 24);\n\t\tcentral.writeUInt16LE(name.length, 28);\n\t\tcentral.writeUInt32LE(offset, 42);\n\n\t\tfiles.push(local, name, compressed);\n\t\tdirectory.push(central, name);\n\t\toffset += local.length + name.length + compressed.length;\n\t}\n\n\tconst centralDirectory = Buffer.concat(directory);\n\tconst end = Buffer.alloc(22);\n\tend.writeUInt32LE(0x06054b50, 0);\n\tend.writeUInt16LE(entries.length, 8);\n\tend.writeUInt16LE(entries.length, 10);\n\tend.writeUInt32LE(centralDirectory.length, 12);\n\tend.writeUInt32LE(offset, 16);\n\treturn Buffer.concat([...files, centralDirectory, end]);\n}\n\nexport function writeZipArchive(filePath: string, entries: readonly ZipEntry[]): Promise<void> {\n\treturn writeFile(filePath, createZipArchive(entries));\n}\n"]}
1
+ {"version":3,"file":"zip.js","sourceRoot":"","sources":["../../src/utils/zip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAOlD,SAAS,WAAW,CAAC,IAAU;IAC9B,OAAO;QACN,IAAI,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACnF,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE;KACvG,CAAC;AACH,CAAC;AAED,kEAAkE;AAClE,SAAS,gBAAgB,CAAC,OAA4B;IACrD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,WAAW,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAC9C,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChG,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;QACxC,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;QAE7B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC/B,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACnC,KAAK,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC3B,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC/B,KAAK,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1B,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC9B,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC7B,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAClC,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC3C,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACrC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAErC,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACjC,OAAO,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACrC,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC7B,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC7B,OAAO,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACjC,OAAO,CAAC,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC7B,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAChC,OAAO,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC/B,OAAO,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACpC,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC7C,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACvC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACvC,OAAO,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAElC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;QACpC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC1D,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAClD,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC7B,GAAG,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACjC,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACrC,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACtC,GAAG,CAAC,aAAa,CAAC,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC/C,GAAG,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC9B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,EAAE,gBAAgB,EAAE,GAAG,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,QAAgB,EAAE,OAA4B;IAC7E,OAAO,SAAS,CAAC,QAAQ,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;AACvD,CAAC","sourcesContent":["import { writeFile } from \"node:fs/promises\";\nimport { crc32, deflateRawSync } from \"node:zlib\";\n\ninterface ZipEntry {\n\tname: string;\n\tdata: string | Uint8Array;\n}\n\nfunction dosDateTime(date: Date): { time: number; day: number } {\n\treturn {\n\t\ttime: (date.getHours() << 11) | (date.getMinutes() << 5) | (date.getSeconds() >> 1),\n\t\tday: ((Math.max(1980, date.getFullYear()) - 1980) << 9) | ((date.getMonth() + 1) << 5) | date.getDate(),\n\t};\n}\n\n/** Create the small, classic ZIP archives used by bug reports. */\nfunction createZipArchive(entries: readonly ZipEntry[]): Buffer {\n\tconst files: Buffer[] = [];\n\tconst directory: Buffer[] = [];\n\tconst { time, day } = dosDateTime(new Date());\n\tlet offset = 0;\n\n\tfor (const entry of entries) {\n\t\tconst name = Buffer.from(entry.name);\n\t\tconst data = typeof entry.data === \"string\" ? Buffer.from(entry.data) : Buffer.from(entry.data);\n\t\tconst compressed = deflateRawSync(data);\n\t\tconst checksum = crc32(data);\n\n\t\tconst local = Buffer.alloc(30);\n\t\tlocal.writeUInt32LE(0x04034b50, 0);\n\t\tlocal.writeUInt16LE(20, 4);\n\t\tlocal.writeUInt16LE(0x0800, 6);\n\t\tlocal.writeUInt16LE(8, 8);\n\t\tlocal.writeUInt16LE(time, 10);\n\t\tlocal.writeUInt16LE(day, 12);\n\t\tlocal.writeUInt32LE(checksum, 14);\n\t\tlocal.writeUInt32LE(compressed.length, 18);\n\t\tlocal.writeUInt32LE(data.length, 22);\n\t\tlocal.writeUInt16LE(name.length, 26);\n\n\t\tconst central = Buffer.alloc(46);\n\t\tcentral.writeUInt32LE(0x02014b50, 0);\n\t\tcentral.writeUInt16LE(20, 4);\n\t\tcentral.writeUInt16LE(20, 6);\n\t\tcentral.writeUInt16LE(0x0800, 8);\n\t\tcentral.writeUInt16LE(8, 10);\n\t\tcentral.writeUInt16LE(time, 12);\n\t\tcentral.writeUInt16LE(day, 14);\n\t\tcentral.writeUInt32LE(checksum, 16);\n\t\tcentral.writeUInt32LE(compressed.length, 20);\n\t\tcentral.writeUInt32LE(data.length, 24);\n\t\tcentral.writeUInt16LE(name.length, 28);\n\t\tcentral.writeUInt32LE(offset, 42);\n\n\t\tfiles.push(local, name, compressed);\n\t\tdirectory.push(central, name);\n\t\toffset += local.length + name.length + compressed.length;\n\t}\n\n\tconst centralDirectory = Buffer.concat(directory);\n\tconst end = Buffer.alloc(22);\n\tend.writeUInt32LE(0x06054b50, 0);\n\tend.writeUInt16LE(entries.length, 8);\n\tend.writeUInt16LE(entries.length, 10);\n\tend.writeUInt32LE(centralDirectory.length, 12);\n\tend.writeUInt32LE(offset, 16);\n\treturn Buffer.concat([...files, centralDirectory, end]);\n}\n\nexport function writeZipArchive(filePath: string, entries: readonly ZipEntry[]): Promise<void> {\n\treturn writeFile(filePath, createZipArchive(entries));\n}\n"]}
package/docs/cli.md CHANGED
@@ -13,6 +13,7 @@ pi update [target] [options]
13
13
  pi list
14
14
  pi config [options]
15
15
  pi auth <check|print-api-key|print-bearer-token> [options]
16
+ pi mcp <list|login|logout> [options]
16
17
  ```
17
18
 
18
19
  <a id="modes"></a>
@@ -124,7 +125,7 @@ See [Settings](settings.md#tools) for configuring the default tool selection.
124
125
  - `-nt`, `--no-tools`<br>
125
126
  Starts with all built-in, extension, and custom tools disabled.
126
127
 
127
- Default enabled tools are `read`, `bash`, `edit`, and `write`, unless `defaultTools` changes them.
128
+ Default enabled tools are `read`, `bash`, `edit`, and `write`, unless `defaultTools` changes them. `--tools` replaces the whole selection, so name every tool you want; `defaultTools` also accepts `+name` and `-name` to change the defaults instead.
128
129
 
129
130
  | Built-in | Purpose |
130
131
  |---|---|
@@ -137,6 +138,49 @@ Default enabled tools are `read`, `bash`, `edit`, and `write`, unless `defaultTo
137
138
  | `find` | Find paths using glob patterns |
138
139
  | `ls` | List directory contents |
139
140
 
141
+ Built-in extensions add two more tools. They are off by default; the MCP extension turns them on when an MCP server needs them (see [MCP](mcp.md#exposure)). To enable them yourself, name them in `--tools` or `defaultTools`.
142
+
143
+ | Built-in extension | Purpose |
144
+ |---|---|
145
+ | `codemode` | Run JavaScript that calls the other tools, for example in parallel with `Promise.allSettled`; only the script's output reaches the model |
146
+ | `tool_search` | Search tools that are not declared to the model (`codemode` and `deferred` exposure, such as MCP tools) and declare the matches for the next call |
147
+
148
+ ### Enable codemode
149
+
150
+ To turn on `codemode` for every session, add it to the default tools in `~/.pi/agent/settings.json` or a project's `.pi/settings.json`:
151
+
152
+ ```json
153
+ {
154
+ "defaultTools": ["+codemode"]
155
+ }
156
+ ```
157
+
158
+ This keeps `read`, `bash`, `edit`, and `write` and adds `codemode`. For one invocation, list every tool, since `--tools` replaces the selection:
159
+
160
+ ```sh
161
+ pi --tools read,bash,edit,write,codemode
162
+ ```
163
+
164
+ Codemode is useful without MCP: scripts can run several tool calls in parallel, filter large output before it reaches the model, and call classifier models such as TypeSafe's Jev through `models.classify()` (see [Classifier models](models.md#use-classifier-models)).
165
+
166
+ ### How codemode works
167
+
168
+ Codemode scripts run in a QuickJS sandbox that can only reach the other tools, through `tools.<name>(args)`; `ALL_TOOLS` lists them. Output comes from `text(value)`, `image(dataUrlOrImageContent)`, `console.*`, and a top-level `return value`; `exit()` ends the script early. The result starts with `Script completed` or `Script failed`, the wall time, and the output; a failed script keeps its partial output, followed by `Script error:` and the error.
169
+
170
+ A script may start with an options line such as `// @options: {"max_output_tokens": 2000, "timeout_ms": 60000}`. `max_output_tokens` (default 10000) limits the output: longer output keeps its start and end, and the full text is written to a temp file whose path is included in the result. `timeout_ms` is a hard deadline, unset by default.
171
+
172
+ While `codemode` is active, `codemode.mode` in [settings](settings.md#tools) decides how the other tools are presented. With `on` (default) declared tools keep being declared and their descriptions show how to call them from scripts. With `only` they are hidden from the model and listed in the `codemode` description instead, so the model calls them through scripts.
173
+
174
+ The `codemode` description lists the callable tools with their TypeScript declarations, grouped by namespace (for example one MCP server). Declarations share a budget of 3000 estimated tokens (`codemode.inlineBudget` in [settings](settings.md#tools)); every namespace is still listed with its tool count, and the description says whether the list is complete. Scripts find the rest with `await searchTools(query, { limit, namespace })`, which ranks tools with BM25, and `await describeTool(name)`, or by filtering `ALL_TOOLS`.
175
+
176
+ Tools with an output schema resolve to structured values: `bash` to `{ output, truncated, full_output_path?, exit_code, wall_time_seconds }`, also for non-zero exit codes, and MCP tools to their `CallToolResult`. Other tools resolve to their text output. The `output` of `bash` is not limited to the 2000 lines or 50KB the model sees: it holds up to 1 MiB, and longer output keeps its first and last 512 KiB around an omission marker, with `truncated` set and the full output in `full_output_path`.
177
+
178
+ `store(key, value)` and `load(key)` keep JSON values across `codemode` calls: each successful script that stores values appends a `codemode-store` custom entry to the session, so resumed sessions keep the values and each branch sees only the values written on its path. Scripts can also use `models`: `getModelsOfType`, `getAvailableOfType`, and `getModelOfType` list the model catalog, and `classify(model, context)` runs a classifier model with the session's credentials, at most four at a time per script.
179
+
180
+ ### Tool search
181
+
182
+ `tool_search` is off by default; enable it with `"defaultTools": ["+tool_search"]` or `--tools`. It uses the same ranking as `searchTools()` over tools that are not declared yet and declares the matches for the next model call. Loaded tools are recorded in the session like other tool changes, so they stay declared on that branch.
183
+
140
184
  <a id="resource-options"></a>
141
185
 
142
186
  ## Resources
@@ -148,9 +192,9 @@ pi --extension ./review.ts
148
192
  See [Configuration](configuration.md) for conventional directories and project trust, [Settings](settings.md#resources) for configured paths, and [Pi Packages](packages.md) for package sources.
149
193
 
150
194
  - `-e`, `--extension <path>`<br>
151
- Loads an extension file or directory and is repeatable.
195
+ Loads an extension file or directory, or a built-in extension such as `builtin:mcp`, and is repeatable.
152
196
  - `-ne`, `--no-extensions`<br>
153
- Disables discovered and configured extensions. Explicit `-e` paths still load.
197
+ Disables discovered, configured, and built-in extensions. Explicit `-e` paths still load, so `pi -ne -e builtin:mcp` keeps only the built-in MCP support.
154
198
  - `--skill <path>`<br>
155
199
  Loads a skill file or directory and is repeatable.
156
200
  - `-ns`, `--no-skills`<br>
@@ -266,3 +310,20 @@ Authentication commands require `--provider <provider>` or `--model <model>`. Se
266
310
  | `--min-expiry <duration>` | `print-bearer-token` | Require remaining token lifetime using `ms`, `s`, `m`, or `h`, such as `30m` |
267
311
 
268
312
  Credential-printing commands write secrets to stdout.
313
+
314
+ ## MCP commands
315
+
316
+ These commands work outside a session, so agents can run them through `bash`. See [MCP Servers](mcp.md).
317
+
318
+ | Command | Description |
319
+ |---|---|
320
+ | `pi mcp add <server> [options] -- <command> [args...]` | Add or replace a stdio server in `mcp.json`; `--env KEY=VALUE` (repeatable) and `--cwd <dir>` set its environment and working directory. Arguments after the command are passed to it |
321
+ | `pi mcp add <server> [options] --url <url>` | Add or replace a streamable HTTP server; `--header KEY=VALUE` (repeatable), `--bearer-token-env-var <NAME>` (sends `Authorization: Bearer ${NAME}`), `--oauth-client-id`, `--oauth-client-secret`, and `--oauth-callback-port` configure authentication |
322
+ | `pi mcp remove <server>` | Remove a server from `mcp.json`; stored OAuth credentials are kept |
323
+ | `pi mcp list [--json]` | Connect to every enabled server and print its state, tools, and errors; exit with `1` when a config entry is invalid or an enabled server is not connected |
324
+ | `pi mcp login <server> [--timeout <seconds>]` | Sign in to an OAuth server: open the authorization page and wait for the browser (default 300 seconds); a terminal also accepts the pasted redirect URL |
325
+ | `pi mcp logout <server>` | Delete the stored OAuth credentials of a server |
326
+
327
+ `add` and `remove` change `~/.pi/agent/mcp.json`, or `.pi/mcp.json` in the current directory with `--local` (`-l`). `add` also takes `--exposure <mode>` (see [Exposure](mcp.md#exposure)) and does not connect; run `pi mcp list` to check the server.
328
+
329
+ Project `.pi/mcp.json` files are only read for projects that are already trusted.
@@ -12,6 +12,7 @@ The agent directory is shown as `<agent-dir>` below. Set its location with the `
12
12
  |---|---|
13
13
  | `<agent-dir>/settings.json` | User-level [settings](settings.md), including preferences, defaults, resource paths, and Pi package declarations. |
14
14
  | `<agent-dir>/keybindings.json` | Custom terminal UI and application [keybindings](keybindings.md). |
15
+ | `<agent-dir>/mcp.json` | [MCP servers](mcp.md) available in every project. |
15
16
  | `<agent-dir>/models.json` | [Compatible endpoints, models, and model overrides](models.md#configure-a-compatible-endpoint). |
16
17
  | `<agent-dir>/auth.json` | Saved API keys and OAuth credentials. |
17
18
  | `<agent-dir>/AGENTS.override.md`, `AGENTS.md`, `AGENTS.MD`, `CLAUDE.md`, or `CLAUDE.MD` | User instructions applied across working directories. |
@@ -27,6 +28,7 @@ The agent directory is shown as `<agent-dir>` below. Set its location with the `
27
28
  | Path | Responsibility |
28
29
  |---|---|
29
30
  | `.pi/settings.json` | Project-level [settings](settings.md), resource paths, and Pi package declarations. |
31
+ | `.pi/mcp.json` | Project [MCP servers](mcp.md). |
30
32
  | `.pi/SYSTEM.md` | Replaces the system prompt for the project. |
31
33
  | `.pi/APPEND_SYSTEM.md` | Adds project-specific instructions to the system prompt. |
32
34
  | `.pi/extensions/` | Project extensions. |
@@ -27,7 +27,45 @@ There are two registration forms:
27
27
 
28
28
  Prefer a complete provider for new integrations that own more than static endpoint and model metadata. Pi composes `models.json` overrides above a registered native provider.
29
29
 
30
- Registering only `baseUrl` or `headers` for an existing provider preserves its built-in models. Supplying `models` in the legacy form replaces the models supplied by that registration.
30
+ Registering only `baseUrl` or `headers` for an existing provider preserves its built-in models. Supplying `models` in the legacy form replaces that provider's models across chat, image, and classifier operations. An omitted `type` means `"chat"`; image and classifier models require explicit discriminants and implementations keyed by their `api` values through the `images` and `classifiers` fields.
31
+
32
+ For example, a mixed-operation provider can register non-chat models and their implementations together:
33
+
34
+ ```typescript
35
+ pi.registerProvider("media-tools", {
36
+ apiKey: "$MEDIA_TOOLS_API_KEY",
37
+ models: [
38
+ {
39
+ type: "image",
40
+ id: "image-v1",
41
+ name: "Image V1",
42
+ api: "media-images",
43
+ baseUrl: "https://media.example.com/v1",
44
+ input: ["text"],
45
+ output: ["image"],
46
+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
47
+ },
48
+ {
49
+ type: "classifier",
50
+ id: "classifier-v1",
51
+ name: "Classifier V1",
52
+ api: "media-classifier",
53
+ baseUrl: "https://media.example.com/v1",
54
+ input: ["text"],
55
+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
56
+ contextWindow: 64000,
57
+ },
58
+ ],
59
+ images: {
60
+ "media-images": { generateImages: async (model, context, options) => result },
61
+ },
62
+ classifiers: {
63
+ "media-classifier": { classify: async (model, context, options) => result },
64
+ },
65
+ });
66
+ ```
67
+
68
+ Model-level `baseUrl` values take precedence over the provider endpoint. If no `models` list is supplied, built-in models of every operation remain registered. Equal model IDs in different operations remain distinct, including their model-specific headers.
31
69
 
32
70
  Calls made after initial extension loading take effect immediately. Use `pi.unregisterProvider()` to remove the dynamic provider and restore built-in behavior that it replaced.
33
71
 
@@ -52,7 +90,7 @@ Never write access tokens, refresh tokens, authorization headers, or complete pr
52
90
 
53
91
  ## Supply and refresh models
54
92
 
55
- Every model needs an ID, display name, input capabilities, context window, output limit, reasoning support, and cost metadata. Choose the API implementation at the provider level unless one model requires an override.
93
+ Every model needs an ID, display name, input capabilities, and cost metadata. Chat and classifier models also need a context window; chat models need an output limit and reasoning support; image models declare their output modalities. Choose the API implementation at the provider level unless one model requires an override.
56
94
 
57
95
  Set `promptCache.short` or `promptCache.long` to the provider's best-effort cache lifetime in seconds when Pi should keep an idle prompt cache warm. Leave them unset to disable cache warming for that retention tier.
58
96
 
@@ -65,7 +103,7 @@ Use `refreshModels` when the available catalog comes from a live service. Pass `
65
103
  The two registration forms have different refresh contracts:
66
104
 
67
105
  - A complete `Provider` returns nothing. It calls `context.publish({ update })` to install provider-owned model state, after which its synchronous `getModels()` exposes the latest list.
68
- - Legacy `ProviderConfig.refreshModels` returns model definitions. Pi replaces that registration’s live models with the returned list and applies any requested persistence.
106
+ - Legacy `ProviderConfig.refreshModels` returns mixed-operation model definitions. Pi replaces that registration’s live models with the returned list and applies any requested persistence.
69
107
 
70
108
  Publish persisted catalog data only when it should survive across runs. A live service such as llama.cpp can update its in-memory list without persisting it; a remote catalog can retain a snapshot for offline startup.
71
109
 
@@ -102,9 +140,10 @@ The stream must also honor request instrumentation supplied through `SimpleStrea
102
140
 
103
141
  - Call `options.onPayload` before sending the provider request and use any replacement payload it returns.
104
142
  - Call `options.onResponse` after receiving the response but before consuming its body.
143
+ - Await `options.onProviderStreamEvent?.(providerEvent, model)` for each parsed provider event before normalizing it.
105
144
  - Pass through the abort signal and provider-scoped environment.
106
145
 
107
- These hooks power extension request inspection and response-header events. Omitting them makes the provider behave differently from Pi’s built-in providers.
146
+ These hooks power extension request inspection, response-header events, and provider-stream observation. Omitting them makes the provider behave differently from Pi’s built-in providers.
108
147
 
109
148
  ## Report failures and usage
110
149
 
package/docs/docs.json CHANGED
@@ -91,6 +91,10 @@
91
91
  {
92
92
  "title": "Use Pi Packages",
93
93
  "path": "packages.md"
94
+ },
95
+ {
96
+ "title": "Connect MCP Servers",
97
+ "path": "mcp.md"
94
98
  }
95
99
  ]
96
100
  },
@@ -105,6 +109,10 @@
105
109
  "title": "Add Custom Providers",
106
110
  "path": "custom-provider.md"
107
111
  },
112
+ {
113
+ "title": "Route with Virtual Models",
114
+ "path": "virtual-models.md"
115
+ },
108
116
  {
109
117
  "title": "Build Terminal UI Components",
110
118
  "path": "tui.md"
@@ -80,6 +80,8 @@ Automatic retries, recovery, compaction, or queued work can continue afterward.
80
80
  | Persist non-context session data | `pi.appendEntry()` |
81
81
  | Change active tools, model, or thinking level | Session control methods on `pi` |
82
82
  | Add a model provider | `pi.registerProvider()` |
83
+ | Add an MCP server | `pi.registerMcpServer()` |
84
+ | Route each request to a model | [`pi.registerVirtualModel()`](virtual-models.md) |
83
85
  | Add terminal rendering | Renderer registration and `ctx.ui` |
84
86
  | Communicate with another extension | `pi.events` |
85
87
 
@@ -102,6 +104,12 @@ Events cover resource discovery, sessions, agent and message lifecycle, provider
102
104
 
103
105
  `message_end` can replace a finalized message while preserving its role. `tool_call` can mutate input or block execution. `tool_result` handlers compose, with each handler seeing prior changes.
104
106
 
107
+ <a id="provider_stream_event"></a>
108
+
109
+ `provider_stream_event` fires for each parsed provider stream event before Pi normalizes it. The event identifies the provider, API, and model; `event.data` is the earliest structured value available to Pi, not necessarily the original HTTP bytes or SSE frame. Treat it as read-only because mutation can affect normalization. The event is notification-only and is not persisted.
110
+
111
+ Handlers are awaited in stream order, so slow handlers delay stream consumption. Handler errors are reported without changing the provider response. See [`debug-provider.ts`](../examples/extensions/debug-provider.ts) for an opt-in viewer that groups raw events by assistant message.
112
+
105
113
  <a id="context_with_system"></a>
106
114
 
107
115
  `context` transforms conversation messages without prompt and tool system messages; Pi restores that state afterward. Use `context_with_system` only when a request-local transformation must own the complete transcript, and keep a system message at index zero.
@@ -135,14 +143,61 @@ Use sequential execution when tools share mutable in-memory state.
135
143
  File-mutating tools should wrap the complete read-modify-write operation with `withFileMutationQueue()`.
136
144
  Truncate large model-facing results and tell the model where to read the complete output.
137
145
 
146
+ Declare `outputSchema` and return a matching `structuredContent` when the result is data. The model still receives `content`; programmatic callers such as codemode scripts receive `structuredContent` instead of the text. Tools without `outputSchema` are passed to scripts as their text content. To report a failure that still carries data, return the result with `isError: true` instead of throwing: the model sees an error, and scripts still receive `structuredContent`.
147
+
148
+ A tool can run other tools with `ctx.executeTool(name, args, { signal, onUpdate })`. Nested calls go through argument validation and the `tool_call` and `tool_result` handlers like model-issued calls, and emit `tool_execution_start`, `tool_execution_update`, and `tool_execution_end`; all of these events carry `parentToolCallId`, and their `toolCallId` is assigned by pi as `<parent id>/<n>`. These ids do not appear as tool calls or tool results in the transcript. Nested calls do not add transcript entries: their results only reach the calling tool, which reports them itself, for example through `onUpdate` and `details`. The session keeps a bounded record of them (name, arguments, status, duration, error; never results) as `nestedCalls` on the calling tool's result message. It is used for compaction file lists and shown in HTML exports. Arguments over 8 KiB per call or 32 KiB per tool result are omitted, at most 256 calls are kept, and `complete: false` marks a record that lost anything. The `usage` of nested results, at every depth, is added to the calling tool's result `usage`, so a tool reports only its own usage, not that of the tools it called. `ctx.tools` lists the tools `ctx.executeTool()` can call. `tool_result` handlers that redact `content` should also replace `structuredContent`; replacing only `content` drops it.
149
+
138
150
  See [`hello.ts`](../examples/extensions/hello.ts), [`todo.ts`](../examples/extensions/todo.ts), [`dynamic-tools.ts`](../examples/extensions/dynamic-tools.ts), and [`truncated-tool.ts`](../examples/extensions/truncated-tool.ts).
139
151
 
152
+ ### Tool exposure
153
+
154
+ `exposure` controls how the model reaches a tool. "Callable" means callable from other tools through `ctx.executeTool()` (`ctx.tools`), as the `codemode` tool's scripts do:
155
+
156
+ - `direct` (default): declared to the model while active, and callable while active.
157
+ - `model-only`: declared to the model while active, never callable. Use it for tools that orchestrate other tools or ask the user.
158
+ - `codemode`: callable whenever registered, and listed by the `codemode` tool. Not declared to the model unless activated explicitly.
159
+ - `deferred`: like `codemode`, but codemode tools do not list it; `tool_search` can find and activate it.
160
+ - `hidden`: registered but unreachable. Re-register a tool with `exposure: "hidden"` to withdraw it, since tools cannot be unregistered.
161
+
162
+ `namespace: { name, description }` groups related tools, as MCP servers do. Codemode tools list a namespace under one heading.
163
+
164
+ Registering a `direct` or `model-only` tool activates it; the other exposures are not activated on registration. The active set (`pi.getActiveTools()`, `pi.setActiveTools()`) is the set of tools declared to the model. `pi.getAllTools()` reports each tool's `exposure`, `namespace`, and `annotations`.
165
+
166
+ `annotations` are hints about what a tool does, with the meaning of MCP tool annotations: `readOnlyHint`, `destructiveHint`, `idempotentHint`, and `openWorldHint`. MCP tools carry the hints their server declares. Missing hints take the MCP defaults: a tool is not read-only, and may be destructive and reach an open world. The hints are not verified, but a permission extension can use them to decide which calls to confirm. This confirms the calls Codex asks approval for:
167
+
168
+ ```typescript
169
+ pi.on("tool_call", async (event, ctx) => {
170
+ const hints = pi.getAllTools().find((tool) => tool.name === event.toolName)?.annotations;
171
+ const needsApproval =
172
+ hints?.destructiveHint === true ||
173
+ (!hints?.readOnlyHint && ((hints?.destructiveHint ?? true) || (hints?.openWorldHint ?? true)));
174
+ if (needsApproval && !(await ctx.ui.confirm("Allow tool call?", event.toolName))) {
175
+ return { block: true, reason: `${event.toolName} was not approved` };
176
+ }
177
+ });
178
+ ```
179
+
180
+ A tool that orchestrates other tools can adjust what the model sees while it is active with `prepareLoadout(loadout)`. It runs whenever the active tools change and receives the declared tools, the callable tools, and every registered tool with its exposure and namespace. It returns replacement `descriptions` for declared tools (including its own) and `hiddenDeclarations`: active tools whose declarations requests leave out while they stay active and callable. `codemode` and `tool_search` use only this hook, `exposure`, and `ctx.executeTool()`, so another tool can implement the same behavior under a different name.
181
+
140
182
  ### Activate tools dynamically
141
183
 
142
184
  Register every tool first, keep optional tools inactive, and use `pi.setActiveTools()` from a loader tool to select the desired active tools. Names must already be registered; unknown names are ignored.
143
185
 
144
186
  Pi records the initial prompt and tool set in the transcript's first system message, then appends tool and prompt changes before the next model request. Providers that cannot represent the transition receive a complete transcript checkpoint, which can invalidate the cached prefix.
145
187
 
188
+ ### MCP servers
189
+
190
+ `pi.registerMcpServer(name, config)` adds an MCP server for the current session. `config` has the shape of an `mcpServers` entry in [`mcp.json`](mcp.md): `command`, `args`, `env`, and `cwd` for stdio servers, `url`, `headers`, and `oauth` for HTTP servers, plus `exposure`, `toolExposure`, `enabled`, and `timeout`.
191
+
192
+ ```typescript
193
+ pi.registerMcpServer("jira", { url: "https://mcp.example.com/jira", exposure: "codemode" });
194
+ pi.unregisterMcpServer("jira");
195
+ ```
196
+
197
+ Servers registered while the extension loads connect when the session starts, together with the `mcp.json` servers; servers registered later connect right away, and `pi.unregisterMcpServer()` closes the connection and makes the server's tools unreachable. Registrations are not saved: register again on every load, for example based on the extension's own settings. A server in `mcp.json` with the same name takes precedence, and `/mcp` shows the override. Registering the same name again replaces the extension's earlier registration; names registered by another extension, invalid names, and invalid configs throw.
198
+
199
+ The built-in MCP support connects registered servers. When nothing does, because another extension replaced it (see [MCP](mcp.md#other-mcp-extensions)), each registration is reported as an extension error. Other MCP extensions can connect registered servers too: read them with `pi.getMcpServers()` on `session_start` and handle the `mcp_servers_change` event for later changes.
200
+
146
201
  <a id="extensioncontext"></a>
147
202
  <a id="extensioncommandcontext"></a>
148
203
  <a id="use-extension-context"></a>
@@ -125,7 +125,7 @@ In fullscreen mode, these actions control the transcript and take precedence ove
125
125
  | `app.exit` | `ctrl+d` | Exit (when editor empty) |
126
126
  | `app.suspend` | `ctrl+z` (None on Windows) | Suspend to background |
127
127
  | `app.editor.external` | `ctrl+g` | Open in external editor (`externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere) |
128
- | `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
129
 
130
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
 
package/docs/llama-cpp.md CHANGED
@@ -86,6 +86,17 @@ Loaded and sleeping models appear in `/model`. Sleeping models wake automaticall
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:
@@ -99,3 +110,5 @@ curl http://127.0.0.1:8080/models
99
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).
package/docs/models.md CHANGED
@@ -100,6 +100,41 @@ Choose the conservative end of any published range. A model without a lifetime f
100
100
 
101
101
  Compatibility settings should describe verified differences in the endpoint's request or response behavior. Do not enable them based only on an endpoint advertising OpenAI or Anthropic compatibility.
102
102
 
103
+ ## Use classifier models
104
+
105
+ Classifier models do not chat. They answer typed questions about JSON state: pick one of several choices, answer yes or no, or give a score, each with probabilities. Pi includes TypeSafe's Jev model from these providers:
106
+
107
+ | Provider | Model IDs | Authentication |
108
+ |---|---|---|
109
+ | `typesafe` | `jev-latest` | `TYPESAFE_API_KEY` |
110
+ | `openrouter` | `typesafe/jev-1.13`, `~typesafe/jev-latest` | `OPENROUTER_API_KEY` or `/login` |
111
+ | `cloudflare-workers-ai` | `typesafe/jev` | `CLOUDFLARE_API_KEY` and `CLOUDFLARE_ACCOUNT_ID` |
112
+ | `vercel-ai-gateway` | `typesafe-ai/jev` | `AI_GATEWAY_API_KEY` |
113
+ | `opencode` | `jev-1.13`, `jev-1.13-free` | `OPENCODE_API_KEY` |
114
+
115
+ Chat models on a [llama.cpp router](llama-cpp.md#classification) are also listed as classifier models.
116
+
117
+ Classifier models do not appear in `/model`. The model reaches them through the [`codemode`](cli.md#enable-codemode) tool, which is off unless an MCP server turned it on. Enable it with `"defaultTools": ["+codemode"]` in [settings](settings.md#tools). Scripts then list classifier models with `models.getAvailableOfType("classifier")` and call `models.classify(model, { state, questions })`:
118
+
119
+ ```js
120
+ const jev = await models.getModelOfType("classifier", "typesafe", "jev-latest");
121
+ const result = await models.classify(jev, {
122
+ state: { message: "The change works, thanks." },
123
+ questions: {
124
+ approved: {
125
+ type: "bool",
126
+ instructions: "Does the user approve of the result?",
127
+ criteria: { true: "Approval", false: "No approval" },
128
+ },
129
+ },
130
+ });
131
+ return result.answers;
132
+ ```
133
+
134
+ When the service reports token counts, as all System One services do, `result.usage` carries them with their cost. Pi adds the usage of a script's classifier calls to the `codemode` tool result, so it counts toward the session cost in the footer and `/session`. The cost uses the model's catalog price; models without one, such as TypeSafe's direct `jev-latest`, report tokens at no cost.
135
+
136
+ Extensions call classifiers through `ctx.modelRegistry.classify()`, without codemode. [Virtual models](virtual-models.md#route-requests) can use them to route requests; see the `jev-router.ts` example.
137
+
103
138
  ## Add a custom provider
104
139
 
105
140
  Use an extension when the provider needs custom streaming, model discovery, or authentication behavior. See [Custom Providers](custom-provider.md) for the extension workflow.