@averyyy/pi-coding-agent 0.87.1-piclient.2 → 0.99.1-piclient.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (733) hide show
  1. package/CHANGELOG.md +97 -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-YZ3Q2WVP.js +2 -0
  12. package/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
  13. package/dist/bundle/chunks/chunk-3YXHSP6S.js +21 -0
  14. package/dist/bundle/chunks/chunk-7BINYQ2V.js +1548 -0
  15. package/dist/bundle/chunks/chunk-7JGR3GZN.js +11 -0
  16. package/dist/bundle/chunks/chunk-F6ORSP6L.js +187 -0
  17. package/dist/bundle/chunks/chunk-FJTXMIZI.js +150 -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-J4CWPC4N.js +2 -0
  21. package/dist/bundle/chunks/chunk-KYJKN5BJ.js +2 -0
  22. package/dist/bundle/chunks/chunk-RO6I2QFQ.js +4 -0
  23. package/dist/bundle/chunks/{chunk-XDUWOHPL.js → chunk-S3GGRYIO.js} +2 -2
  24. package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
  25. package/dist/bundle/chunks/{chunk-UZNGGY6N.js → chunk-V7V43FNB.js} +3 -3
  26. package/dist/bundle/chunks/{chunk-FUXEF6JQ.js → chunk-W2DOMZSC.js} +1 -1
  27. package/dist/bundle/chunks/chunk-WVKBMRQX.js +82 -0
  28. package/dist/bundle/chunks/cli-WF6HDHBO.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-AVGAUHMT.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-chatgpt.js +75 -0
  39. package/dist/bundle/chunks/{openai-codex-responses-SG7PGUUZ.js → openai-codex-responses-FUE7WESF.js} +2 -2
  40. package/dist/bundle/chunks/openai-codex.js +2 -2
  41. package/dist/bundle/chunks/{openai-completions-OBX42CLD.js → openai-completions-XW2Q5HVC.js} +2 -2
  42. package/dist/bundle/chunks/openai-responses-ZUXFVYPI.js +3 -0
  43. package/dist/bundle/chunks/{openrouter-images-N4XVVFSD.js → openrouter-images-TPQ4V6OR.js} +1 -1
  44. package/dist/bundle/chunks/openrouter.js +2 -2
  45. package/dist/bundle/chunks/{pi-messages-GFKBWJHZ.js → pi-messages-TM5SOOIW.js} +2 -2
  46. package/dist/bundle/chunks/radius.js +2 -2
  47. package/dist/bundle/chunks/runtime-6ZC4MGWD.js +2 -0
  48. package/dist/bundle/chunks/typesafe-system-one-E7A4HNJI.js +2 -0
  49. package/dist/bundle/chunks/virtual-modules-H7OCXN6W.js +2 -0
  50. package/dist/bundle/cli-runtime.js +1 -1
  51. package/dist/bundle/index.js +1 -1
  52. package/dist/bundle/rpc-entry.js +1 -1
  53. package/dist/cli/args.d.ts.map +1 -1
  54. package/dist/cli/args.js +4 -3
  55. package/dist/cli/args.js.map +1 -1
  56. package/dist/cli/auth-check.d.ts.map +1 -1
  57. package/dist/cli/auth-check.js.map +1 -1
  58. package/dist/cli/auth-command.d.ts.map +1 -1
  59. package/dist/cli/auth-command.js.map +1 -1
  60. package/dist/cli/config-selector.d.ts.map +1 -1
  61. package/dist/cli/config-selector.js.map +1 -1
  62. package/dist/cli/credential-print.d.ts.map +1 -1
  63. package/dist/cli/credential-print.js.map +1 -1
  64. package/dist/cli/file-processor.d.ts.map +1 -1
  65. package/dist/cli/file-processor.js.map +1 -1
  66. package/dist/cli/initial-message.d.ts +1 -1
  67. package/dist/cli/initial-message.d.ts.map +1 -1
  68. package/dist/cli/initial-message.js.map +1 -1
  69. package/dist/cli/list-models.d.ts.map +1 -1
  70. package/dist/cli/list-models.js.map +1 -1
  71. package/dist/cli/project-trust.d.ts.map +1 -1
  72. package/dist/cli/project-trust.js.map +1 -1
  73. package/dist/cli/session-picker.d.ts.map +1 -1
  74. package/dist/cli/session-picker.js.map +1 -1
  75. package/dist/cli/setup.d.ts.map +1 -1
  76. package/dist/cli/setup.js.map +1 -1
  77. package/dist/cli/startup-ui.d.ts.map +1 -1
  78. package/dist/cli/startup-ui.js +38 -30
  79. package/dist/cli/startup-ui.js.map +1 -1
  80. package/dist/cli.d.ts.map +1 -1
  81. package/dist/config.d.ts +18 -4
  82. package/dist/config.d.ts.map +1 -1
  83. package/dist/config.js +30 -4
  84. package/dist/config.js.map +1 -1
  85. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  86. package/dist/core/agent-session-runtime.js +1 -1
  87. package/dist/core/agent-session-runtime.js.map +1 -1
  88. package/dist/core/agent-session-services.d.ts.map +1 -1
  89. package/dist/core/agent-session-services.js +13 -0
  90. package/dist/core/agent-session-services.js.map +1 -1
  91. package/dist/core/agent-session.d.ts +118 -11
  92. package/dist/core/agent-session.d.ts.map +1 -1
  93. package/dist/core/agent-session.js +548 -288
  94. package/dist/core/agent-session.js.map +1 -1
  95. package/dist/core/auth-guidance.d.ts.map +1 -1
  96. package/dist/core/auth-guidance.js.map +1 -1
  97. package/dist/core/auth-storage.d.ts.map +1 -1
  98. package/dist/core/auth-storage.js.map +1 -1
  99. package/dist/core/bash-executor.d.ts.map +1 -1
  100. package/dist/core/bash-executor.js.map +1 -1
  101. package/dist/core/bug-report-upload.d.ts.map +1 -1
  102. package/dist/core/bug-report-upload.js.map +1 -1
  103. package/dist/core/bug-report.d.ts +1 -1
  104. package/dist/core/bug-report.d.ts.map +1 -1
  105. package/dist/core/bug-report.js +1 -1
  106. package/dist/core/bug-report.js.map +1 -1
  107. package/dist/core/cache-stats.d.ts.map +1 -1
  108. package/dist/core/cache-stats.js.map +1 -1
  109. package/dist/core/cache-warmer.d.ts.map +1 -1
  110. package/dist/core/cache-warmer.js.map +1 -1
  111. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  112. package/dist/core/compaction/branch-summarization.js.map +1 -1
  113. package/dist/core/compaction/compaction.d.ts.map +1 -1
  114. package/dist/core/compaction/compaction.js +1 -22
  115. package/dist/core/compaction/compaction.js.map +1 -1
  116. package/dist/core/compaction/index.d.ts.map +1 -1
  117. package/dist/core/compaction/utils.d.ts +2 -1
  118. package/dist/core/compaction/utils.d.ts.map +1 -1
  119. package/dist/core/compaction/utils.js +25 -18
  120. package/dist/core/compaction/utils.js.map +1 -1
  121. package/dist/core/crash-log.d.ts.map +1 -1
  122. package/dist/core/crash-log.js +2 -1
  123. package/dist/core/crash-log.js.map +1 -1
  124. package/dist/core/defaults.d.ts.map +1 -1
  125. package/dist/core/diagnostics.d.ts.map +1 -1
  126. package/dist/core/event-bus.d.ts.map +1 -1
  127. package/dist/core/event-bus.js.map +1 -1
  128. package/dist/core/exec.d.ts.map +1 -1
  129. package/dist/core/exec.js.map +1 -1
  130. package/dist/core/experimental.d.ts.map +1 -1
  131. package/dist/core/experimental.js.map +1 -1
  132. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  133. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  134. package/dist/core/export-html/index.d.ts.map +1 -1
  135. package/dist/core/export-html/index.js.map +1 -1
  136. package/dist/core/export-html/template.css +10 -0
  137. package/dist/core/export-html/template.js +66 -17
  138. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  139. package/dist/core/export-html/tool-renderer.js.map +1 -1
  140. package/dist/core/extensions/index.d.ts +1 -1
  141. package/dist/core/extensions/index.d.ts.map +1 -1
  142. package/dist/core/extensions/index.js.map +1 -1
  143. package/dist/core/extensions/jiti-loader.d.ts.map +1 -1
  144. package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -1
  145. package/dist/core/extensions/loader.d.ts.map +1 -1
  146. package/dist/core/extensions/loader.js +55 -5
  147. package/dist/core/extensions/loader.js.map +1 -1
  148. package/dist/core/extensions/runner.d.ts +18 -1
  149. package/dist/core/extensions/runner.d.ts.map +1 -1
  150. package/dist/core/extensions/runner.js +99 -0
  151. package/dist/core/extensions/runner.js.map +1 -1
  152. package/dist/core/extensions/types.d.ts +296 -22
  153. package/dist/core/extensions/types.d.ts.map +1 -1
  154. package/dist/core/extensions/types.js.map +1 -1
  155. package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
  156. package/dist/core/extensions/wrapper.d.ts +2 -2
  157. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  158. package/dist/core/extensions/wrapper.js +3 -3
  159. package/dist/core/extensions/wrapper.js.map +1 -1
  160. package/dist/core/footer-data-provider.d.ts.map +1 -1
  161. package/dist/core/footer-data-provider.js.map +1 -1
  162. package/dist/core/http-dispatcher.d.ts.map +1 -1
  163. package/dist/core/http-dispatcher.js.map +1 -1
  164. package/dist/core/index.d.ts.map +1 -1
  165. package/dist/core/keybindings.d.ts +1 -1
  166. package/dist/core/keybindings.d.ts.map +1 -1
  167. package/dist/core/keybindings.js +1 -1
  168. package/dist/core/keybindings.js.map +1 -1
  169. package/dist/core/mcp-servers.d.ts +98 -0
  170. package/dist/core/mcp-servers.d.ts.map +1 -0
  171. package/dist/core/mcp-servers.js +157 -0
  172. package/dist/core/mcp-servers.js.map +1 -0
  173. package/dist/core/messages.d.ts.map +1 -1
  174. package/dist/core/messages.js.map +1 -1
  175. package/dist/core/model-config.d.ts.map +1 -1
  176. package/dist/core/model-config.js.map +1 -1
  177. package/dist/core/model-registry.d.ts +13 -1
  178. package/dist/core/model-registry.d.ts.map +1 -1
  179. package/dist/core/model-registry.js +25 -0
  180. package/dist/core/model-registry.js.map +1 -1
  181. package/dist/core/model-resolver.d.ts +2 -2
  182. package/dist/core/model-resolver.d.ts.map +1 -1
  183. package/dist/core/model-resolver.js +5 -5
  184. package/dist/core/model-resolver.js.map +1 -1
  185. package/dist/core/model-runtime.d.ts +41 -3
  186. package/dist/core/model-runtime.d.ts.map +1 -1
  187. package/dist/core/model-runtime.js +167 -17
  188. package/dist/core/model-runtime.js.map +1 -1
  189. package/dist/core/models-store.d.ts.map +1 -1
  190. package/dist/core/models-store.js.map +1 -1
  191. package/dist/core/nested-tool-calls.d.ts +102 -0
  192. package/dist/core/nested-tool-calls.d.ts.map +1 -0
  193. package/dist/core/nested-tool-calls.js +178 -0
  194. package/dist/core/nested-tool-calls.js.map +1 -0
  195. package/dist/core/output-guard.d.ts.map +1 -1
  196. package/dist/core/output-guard.js.map +1 -1
  197. package/dist/core/package-manager.d.ts +4 -0
  198. package/dist/core/package-manager.d.ts.map +1 -1
  199. package/dist/core/package-manager.js +59 -12
  200. package/dist/core/package-manager.js.map +1 -1
  201. package/dist/core/pi-client-cli-adapter.d.ts.map +1 -1
  202. package/dist/core/pi-client-cli-adapter.js.map +1 -1
  203. package/dist/core/pi-client-runtime-update.d.ts.map +1 -1
  204. package/dist/core/pi-client-runtime-update.js.map +1 -1
  205. package/dist/core/pi-manifest.d.ts.map +1 -1
  206. package/dist/core/pi-manifest.js.map +1 -1
  207. package/dist/core/pi-server-client.d.ts.map +1 -1
  208. package/dist/core/pi-server-client.js.map +1 -1
  209. package/dist/core/pi-server-protocol.d.ts.map +1 -1
  210. package/dist/core/pi-server-protocol.js.map +1 -1
  211. package/dist/core/pi-server-request.d.ts.map +1 -1
  212. package/dist/core/pi-server-request.js.map +1 -1
  213. package/dist/core/project-trust.d.ts.map +1 -1
  214. package/dist/core/project-trust.js.map +1 -1
  215. package/dist/core/prompt-templates.d.ts.map +1 -1
  216. package/dist/core/prompt-templates.js.map +1 -1
  217. package/dist/core/provider-attribution.d.ts.map +1 -1
  218. package/dist/core/provider-attribution.js.map +1 -1
  219. package/dist/core/provider-composer.d.ts +40 -21
  220. package/dist/core/provider-composer.d.ts.map +1 -1
  221. package/dist/core/provider-composer.js +92 -40
  222. package/dist/core/provider-composer.js.map +1 -1
  223. package/dist/core/radius.d.ts.map +1 -1
  224. package/dist/core/radius.js.map +1 -1
  225. package/dist/core/remote-catalog-provider.d.ts +8 -1
  226. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  227. package/dist/core/remote-catalog-provider.js +18 -3
  228. package/dist/core/remote-catalog-provider.js.map +1 -1
  229. package/dist/core/resolve-config-value.d.ts.map +1 -1
  230. package/dist/core/resolve-config-value.js.map +1 -1
  231. package/dist/core/resource-loader.d.ts +7 -1
  232. package/dist/core/resource-loader.d.ts.map +1 -1
  233. package/dist/core/resource-loader.js +161 -35
  234. package/dist/core/resource-loader.js.map +1 -1
  235. package/dist/core/runtime-credentials.d.ts.map +1 -1
  236. package/dist/core/runtime-credentials.js.map +1 -1
  237. package/dist/core/sdk.d.ts +1 -1
  238. package/dist/core/sdk.d.ts.map +1 -1
  239. package/dist/core/sdk.js +24 -6
  240. package/dist/core/sdk.js.map +1 -1
  241. package/dist/core/session-cwd.d.ts.map +1 -1
  242. package/dist/core/session-cwd.js.map +1 -1
  243. package/dist/core/session-export.d.ts.map +1 -1
  244. package/dist/core/session-export.js.map +1 -1
  245. package/dist/core/session-manager.d.ts +9 -0
  246. package/dist/core/session-manager.d.ts.map +1 -1
  247. package/dist/core/session-manager.js +22 -22
  248. package/dist/core/session-manager.js.map +1 -1
  249. package/dist/core/settings-diagnostics.d.ts.map +1 -1
  250. package/dist/core/settings-diagnostics.js.map +1 -1
  251. package/dist/core/settings-manager.d.ts +31 -1
  252. package/dist/core/settings-manager.d.ts.map +1 -1
  253. package/dist/core/settings-manager.js +72 -2
  254. package/dist/core/settings-manager.js.map +1 -1
  255. package/dist/core/skills.d.ts.map +1 -1
  256. package/dist/core/skills.js.map +1 -1
  257. package/dist/core/slash-commands.d.ts.map +1 -1
  258. package/dist/core/source-info.d.ts +8 -0
  259. package/dist/core/source-info.d.ts.map +1 -1
  260. package/dist/core/source-info.js +16 -0
  261. package/dist/core/source-info.js.map +1 -1
  262. package/dist/core/system-prompt.d.ts.map +1 -1
  263. package/dist/core/system-prompt.js +1 -1
  264. package/dist/core/system-prompt.js.map +1 -1
  265. package/dist/core/telemetry.d.ts.map +1 -1
  266. package/dist/core/telemetry.js.map +1 -1
  267. package/dist/core/timings.d.ts.map +1 -1
  268. package/dist/core/timings.js.map +1 -1
  269. package/dist/core/tools/bash.d.ts +12 -0
  270. package/dist/core/tools/bash.d.ts.map +1 -1
  271. package/dist/core/tools/bash.js +35 -2
  272. package/dist/core/tools/bash.js.map +1 -1
  273. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  274. package/dist/core/tools/edit-diff.js.map +1 -1
  275. package/dist/core/tools/edit.d.ts.map +1 -1
  276. package/dist/core/tools/edit.js.map +1 -1
  277. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
  278. package/dist/core/tools/file-mutation-queue.js.map +1 -1
  279. package/dist/core/tools/find.d.ts.map +1 -1
  280. package/dist/core/tools/find.js.map +1 -1
  281. package/dist/core/tools/grep.d.ts.map +1 -1
  282. package/dist/core/tools/grep.js.map +1 -1
  283. package/dist/core/tools/index.d.ts.map +1 -1
  284. package/dist/core/tools/index.js.map +1 -1
  285. package/dist/core/tools/ls.d.ts.map +1 -1
  286. package/dist/core/tools/ls.js.map +1 -1
  287. package/dist/core/tools/output-accumulator.d.ts +11 -0
  288. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  289. package/dist/core/tools/output-accumulator.js +36 -0
  290. package/dist/core/tools/output-accumulator.js.map +1 -1
  291. package/dist/core/tools/path-utils.d.ts.map +1 -1
  292. package/dist/core/tools/path-utils.js.map +1 -1
  293. package/dist/core/tools/powershell.d.ts.map +1 -1
  294. package/dist/core/tools/powershell.js.map +1 -1
  295. package/dist/core/tools/read.d.ts.map +1 -1
  296. package/dist/core/tools/read.js.map +1 -1
  297. package/dist/core/tools/render-utils.d.ts +6 -0
  298. package/dist/core/tools/render-utils.d.ts.map +1 -1
  299. package/dist/core/tools/render-utils.js +26 -0
  300. package/dist/core/tools/render-utils.js.map +1 -1
  301. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  302. package/dist/core/tools/renderers/bash.js +9 -10
  303. package/dist/core/tools/renderers/bash.js.map +1 -1
  304. package/dist/core/tools/renderers/edit.d.ts.map +1 -1
  305. package/dist/core/tools/renderers/edit.js.map +1 -1
  306. package/dist/core/tools/renderers/find.d.ts.map +1 -1
  307. package/dist/core/tools/renderers/find.js.map +1 -1
  308. package/dist/core/tools/renderers/grep.d.ts.map +1 -1
  309. package/dist/core/tools/renderers/grep.js.map +1 -1
  310. package/dist/core/tools/renderers/index.d.ts.map +1 -1
  311. package/dist/core/tools/renderers/index.js.map +1 -1
  312. package/dist/core/tools/renderers/ls.d.ts.map +1 -1
  313. package/dist/core/tools/renderers/ls.js.map +1 -1
  314. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  315. package/dist/core/tools/renderers/read.js +3 -2
  316. package/dist/core/tools/renderers/read.js.map +1 -1
  317. package/dist/core/tools/renderers/write.d.ts.map +1 -1
  318. package/dist/core/tools/renderers/write.js.map +1 -1
  319. package/dist/core/tools/tool-definition-wrapper.d.ts +5 -3
  320. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  321. package/dist/core/tools/tool-definition-wrapper.js +3 -1
  322. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  323. package/dist/core/tools/truncate.d.ts +14 -0
  324. package/dist/core/tools/truncate.d.ts.map +1 -1
  325. package/dist/core/tools/truncate.js +29 -0
  326. package/dist/core/tools/truncate.js.map +1 -1
  327. package/dist/core/tools/write.d.ts.map +1 -1
  328. package/dist/core/tools/write.js.map +1 -1
  329. package/dist/core/trust-manager.d.ts.map +1 -1
  330. package/dist/core/trust-manager.js +1 -0
  331. package/dist/core/trust-manager.js.map +1 -1
  332. package/dist/core/usage-totals.d.ts +2 -0
  333. package/dist/core/usage-totals.d.ts.map +1 -1
  334. package/dist/core/usage-totals.js +23 -0
  335. package/dist/core/usage-totals.js.map +1 -1
  336. package/dist/core/virtual-models.d.ts +115 -0
  337. package/dist/core/virtual-models.d.ts.map +1 -0
  338. package/dist/core/virtual-models.js +117 -0
  339. package/dist/core/virtual-models.js.map +1 -0
  340. package/dist/extensions/codemode/execute.d.ts +16 -0
  341. package/dist/extensions/codemode/execute.d.ts.map +1 -0
  342. package/dist/extensions/codemode/execute.js +390 -0
  343. package/dist/extensions/codemode/execute.js.map +1 -0
  344. package/dist/extensions/codemode/execute.lazy.d.ts +3 -0
  345. package/dist/extensions/codemode/execute.lazy.d.ts.map +1 -0
  346. package/dist/extensions/codemode/execute.lazy.js +3 -0
  347. package/dist/extensions/codemode/execute.lazy.js.map +1 -0
  348. package/dist/extensions/codemode/index.d.ts +21 -0
  349. package/dist/extensions/codemode/index.d.ts.map +1 -0
  350. package/dist/extensions/codemode/index.js +31 -0
  351. package/dist/extensions/codemode/index.js.map +1 -0
  352. package/dist/extensions/codemode/renderer.d.ts +12 -0
  353. package/dist/extensions/codemode/renderer.d.ts.map +1 -0
  354. package/dist/extensions/codemode/renderer.js +119 -0
  355. package/dist/extensions/codemode/renderer.js.map +1 -0
  356. package/dist/extensions/codemode/tool.d.ts +122 -0
  357. package/dist/extensions/codemode/tool.d.ts.map +1 -0
  358. package/dist/extensions/codemode/tool.js +324 -0
  359. package/dist/extensions/codemode/tool.js.map +1 -0
  360. package/dist/extensions/codemode/worker.d.ts +7 -0
  361. package/dist/extensions/codemode/worker.d.ts.map +1 -0
  362. package/dist/extensions/codemode/worker.js +7 -0
  363. package/dist/extensions/codemode/worker.js.map +1 -0
  364. package/dist/extensions/index.d.ts.map +1 -1
  365. package/dist/extensions/index.js +11 -1
  366. package/dist/extensions/index.js.map +1 -1
  367. package/dist/extensions/llama/client.d.ts.map +1 -1
  368. package/dist/extensions/llama/client.js.map +1 -1
  369. package/dist/extensions/llama/huggingface.d.ts.map +1 -1
  370. package/dist/extensions/llama/huggingface.js.map +1 -1
  371. package/dist/extensions/llama/index.d.ts.map +1 -1
  372. package/dist/extensions/llama/index.js.map +1 -1
  373. package/dist/extensions/llama/provider.d.ts +1 -1
  374. package/dist/extensions/llama/provider.d.ts.map +1 -1
  375. package/dist/extensions/llama/provider.js +65 -13
  376. package/dist/extensions/llama/provider.js.map +1 -1
  377. package/dist/extensions/llama/ui.d.ts.map +1 -1
  378. package/dist/extensions/llama/ui.js.map +1 -1
  379. package/dist/extensions/mcp/cli.d.ts +21 -0
  380. package/dist/extensions/mcp/cli.d.ts.map +1 -0
  381. package/dist/extensions/mcp/cli.js +485 -0
  382. package/dist/extensions/mcp/cli.js.map +1 -0
  383. package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
  384. package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
  385. package/dist/extensions/mcp/cli.lazy.js +3 -0
  386. package/dist/extensions/mcp/cli.lazy.js.map +1 -0
  387. package/dist/extensions/mcp/config.d.ts +70 -0
  388. package/dist/extensions/mcp/config.d.ts.map +1 -0
  389. package/dist/extensions/mcp/config.js +146 -0
  390. package/dist/extensions/mcp/config.js.map +1 -0
  391. package/dist/extensions/mcp/index.d.ts +52 -0
  392. package/dist/extensions/mcp/index.d.ts.map +1 -0
  393. package/dist/extensions/mcp/index.js +902 -0
  394. package/dist/extensions/mcp/index.js.map +1 -0
  395. package/dist/extensions/mcp/log.d.ts +16 -0
  396. package/dist/extensions/mcp/log.d.ts.map +1 -0
  397. package/dist/extensions/mcp/log.js +66 -0
  398. package/dist/extensions/mcp/log.js.map +1 -0
  399. package/dist/extensions/mcp/oauth.d.ts +94 -0
  400. package/dist/extensions/mcp/oauth.d.ts.map +1 -0
  401. package/dist/extensions/mcp/oauth.js +333 -0
  402. package/dist/extensions/mcp/oauth.js.map +1 -0
  403. package/dist/extensions/mcp/resources.d.ts +43 -0
  404. package/dist/extensions/mcp/resources.d.ts.map +1 -0
  405. package/dist/extensions/mcp/resources.js +262 -0
  406. package/dist/extensions/mcp/resources.js.map +1 -0
  407. package/dist/extensions/mcp/runtime.d.ts +96 -0
  408. package/dist/extensions/mcp/runtime.d.ts.map +1 -0
  409. package/dist/extensions/mcp/runtime.js +388 -0
  410. package/dist/extensions/mcp/runtime.js.map +1 -0
  411. package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
  412. package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
  413. package/dist/extensions/mcp/runtime.lazy.js +3 -0
  414. package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
  415. package/dist/extensions/mcp/tools.d.ts +83 -0
  416. package/dist/extensions/mcp/tools.d.ts.map +1 -0
  417. package/dist/extensions/mcp/tools.js +233 -0
  418. package/dist/extensions/mcp/tools.js.map +1 -0
  419. package/dist/extensions/mcp/ui.d.ts +60 -0
  420. package/dist/extensions/mcp/ui.d.ts.map +1 -0
  421. package/dist/extensions/mcp/ui.js +172 -0
  422. package/dist/extensions/mcp/ui.js.map +1 -0
  423. package/dist/extensions/tool-search/index.d.ts +12 -0
  424. package/dist/extensions/tool-search/index.d.ts.map +1 -0
  425. package/dist/extensions/tool-search/index.js +15 -0
  426. package/dist/extensions/tool-search/index.js.map +1 -0
  427. package/dist/extensions/tool-search/tool.d.ts +72 -0
  428. package/dist/extensions/tool-search/tool.d.ts.map +1 -0
  429. package/dist/extensions/tool-search/tool.js +210 -0
  430. package/dist/extensions/tool-search/tool.js.map +1 -0
  431. package/dist/index.d.ts +9 -2
  432. package/dist/index.d.ts.map +1 -1
  433. package/dist/index.js +5 -0
  434. package/dist/index.js.map +1 -1
  435. package/dist/main.d.ts.map +1 -1
  436. package/dist/main.js +10 -0
  437. package/dist/main.js.map +1 -1
  438. package/dist/migrations.d.ts.map +1 -1
  439. package/dist/migrations.js.map +1 -1
  440. package/dist/modes/index.d.ts.map +1 -1
  441. package/dist/modes/interactive/bug-report.d.ts.map +1 -1
  442. package/dist/modes/interactive/bug-report.js.map +1 -1
  443. package/dist/modes/interactive/chat-viewport.d.ts.map +1 -1
  444. package/dist/modes/interactive/chat-viewport.js.map +1 -1
  445. package/dist/modes/interactive/components/armin.d.ts.map +1 -1
  446. package/dist/modes/interactive/components/armin.js.map +1 -1
  447. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  448. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  449. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  450. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  451. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
  452. package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
  453. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  454. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  455. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  456. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  457. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  458. package/dist/modes/interactive/components/config-selector.js +13 -3
  459. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  460. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
  461. package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
  462. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  463. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  464. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  465. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  466. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  467. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  468. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
  469. package/dist/modes/interactive/components/daxnuts.js.map +1 -1
  470. package/dist/modes/interactive/components/diff.d.ts.map +1 -1
  471. package/dist/modes/interactive/components/diff.js.map +1 -1
  472. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
  473. package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
  474. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
  475. package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
  476. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  477. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  478. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
  479. package/dist/modes/interactive/components/extension-input.js.map +1 -1
  480. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  481. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  482. package/dist/modes/interactive/components/first-time-setup.d.ts +4 -4
  483. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
  484. package/dist/modes/interactive/components/first-time-setup.js +8 -2
  485. package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
  486. package/dist/modes/interactive/components/footer.d.ts +7 -0
  487. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  488. package/dist/modes/interactive/components/footer.js +43 -3
  489. package/dist/modes/interactive/components/footer.js.map +1 -1
  490. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  491. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  492. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  493. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  494. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  495. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
  496. package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
  497. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  498. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  499. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  500. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  501. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  502. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  503. package/dist/modes/interactive/components/pi-logo.d.ts +12 -0
  504. package/dist/modes/interactive/components/pi-logo.d.ts.map +1 -0
  505. package/dist/modes/interactive/components/pi-logo.js +25 -0
  506. package/dist/modes/interactive/components/pi-logo.js.map +1 -0
  507. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  508. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  509. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  510. package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  511. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  512. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  513. package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
  514. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  515. package/dist/modes/interactive/components/settings-selector.js +28 -6
  516. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  517. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  518. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  519. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
  520. package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
  521. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  522. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  523. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  524. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  525. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
  526. package/dist/modes/interactive/components/theme-selector.js.map +1 -1
  527. package/dist/modes/interactive/components/themed-text.d.ts +17 -0
  528. package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
  529. package/dist/modes/interactive/components/themed-text.js +29 -0
  530. package/dist/modes/interactive/components/themed-text.js.map +1 -0
  531. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  532. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  533. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  534. package/dist/modes/interactive/components/tool-execution.js +2 -2
  535. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  536. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  537. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  538. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
  539. package/dist/modes/interactive/components/trust-selector.js.map +1 -1
  540. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  541. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  542. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  543. package/dist/modes/interactive/components/user-message.js.map +1 -1
  544. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  545. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  546. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  547. package/dist/modes/interactive/external-editor.js.map +1 -1
  548. package/dist/modes/interactive/interactive-mode.d.ts +11 -0
  549. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  550. package/dist/modes/interactive/interactive-mode.js +199 -161
  551. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  552. package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -1
  553. package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
  554. package/dist/modes/interactive/model-search.d.ts.map +1 -1
  555. package/dist/modes/interactive/model-search.js.map +1 -1
  556. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  557. package/dist/modes/interactive/session-share.js.map +1 -1
  558. package/dist/modes/interactive/theme/dark.json +59 -72
  559. package/dist/modes/interactive/theme/light.json +57 -69
  560. package/dist/modes/interactive/theme/system-theme.d.ts +54 -0
  561. package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
  562. package/dist/modes/interactive/theme/system-theme.js +535 -0
  563. package/dist/modes/interactive/theme/system-theme.js.map +1 -0
  564. package/dist/modes/interactive/theme/theme-controller.d.ts +46 -6
  565. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  566. package/dist/modes/interactive/theme/theme-controller.js +127 -47
  567. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  568. package/dist/modes/interactive/theme/theme-json.d.ts +1 -0
  569. package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -1
  570. package/dist/modes/interactive/theme/theme-json.js +3 -1
  571. package/dist/modes/interactive/theme/theme-json.js.map +1 -1
  572. package/dist/modes/interactive/theme/theme-schema.json +7 -2
  573. package/dist/modes/interactive/theme/theme.d.ts +66 -39
  574. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  575. package/dist/modes/interactive/theme/theme.js +238 -317
  576. package/dist/modes/interactive/theme/theme.js.map +1 -1
  577. package/dist/modes/interactive/tui-renderer.d.ts +2 -1
  578. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -1
  579. package/dist/modes/interactive/tui-renderer.js +1 -0
  580. package/dist/modes/interactive/tui-renderer.js.map +1 -1
  581. package/dist/modes/json-event.d.ts.map +1 -1
  582. package/dist/modes/json-event.js.map +1 -1
  583. package/dist/modes/print-mode.d.ts.map +1 -1
  584. package/dist/modes/print-mode.js.map +1 -1
  585. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  586. package/dist/modes/rpc/jsonl.js.map +1 -1
  587. package/dist/modes/rpc/rpc-client.d.ts +6 -6
  588. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  589. package/dist/modes/rpc/rpc-client.js +12 -8
  590. package/dist/modes/rpc/rpc-client.js.map +1 -1
  591. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  592. package/dist/modes/rpc/rpc-mode.js +7 -9
  593. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  594. package/dist/modes/rpc/rpc-types.d.ts +10 -1
  595. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  596. package/dist/modes/rpc/rpc-types.js.map +1 -1
  597. package/dist/package-manager-cli.d.ts.map +1 -1
  598. package/dist/package-manager-cli.js +6 -2
  599. package/dist/package-manager-cli.js.map +1 -1
  600. package/dist/pi-client-cli.d.ts.map +1 -1
  601. package/dist/pi-client-cli.js.map +1 -1
  602. package/dist/rpc-entry.d.ts.map +1 -1
  603. package/dist/rpc-entry.js.map +1 -1
  604. package/dist/utils/abort.d.ts.map +1 -1
  605. package/dist/utils/abort.js.map +1 -1
  606. package/dist/utils/ansi.d.ts.map +1 -1
  607. package/dist/utils/ansi.js.map +1 -1
  608. package/dist/utils/changelog.d.ts.map +1 -1
  609. package/dist/utils/changelog.js.map +1 -1
  610. package/dist/utils/child-process.d.ts.map +1 -1
  611. package/dist/utils/child-process.js.map +1 -1
  612. package/dist/utils/clipboard-command.d.ts.map +1 -1
  613. package/dist/utils/clipboard-command.js.map +1 -1
  614. package/dist/utils/clipboard-image.d.ts.map +1 -1
  615. package/dist/utils/clipboard-image.js +14 -17
  616. package/dist/utils/clipboard-image.js.map +1 -1
  617. package/dist/utils/clipboard.d.ts +2 -0
  618. package/dist/utils/clipboard.d.ts.map +1 -1
  619. package/dist/utils/clipboard.js +5 -0
  620. package/dist/utils/clipboard.js.map +1 -1
  621. package/dist/utils/deprecation.d.ts.map +1 -1
  622. package/dist/utils/deprecation.js.map +1 -1
  623. package/dist/utils/exif-orientation.d.ts.map +1 -1
  624. package/dist/utils/exif-orientation.js.map +1 -1
  625. package/dist/utils/frontmatter.d.ts.map +1 -1
  626. package/dist/utils/frontmatter.js.map +1 -1
  627. package/dist/utils/fs-watch.d.ts.map +1 -1
  628. package/dist/utils/fs-watch.js.map +1 -1
  629. package/dist/utils/git.d.ts.map +1 -1
  630. package/dist/utils/git.js.map +1 -1
  631. package/dist/utils/html.d.ts.map +1 -1
  632. package/dist/utils/html.js.map +1 -1
  633. package/dist/utils/image-convert.d.ts.map +1 -1
  634. package/dist/utils/image-convert.js.map +1 -1
  635. package/dist/utils/image-process.d.ts.map +1 -1
  636. package/dist/utils/image-process.js.map +1 -1
  637. package/dist/utils/image-resize-core.d.ts.map +1 -1
  638. package/dist/utils/image-resize-core.js.map +1 -1
  639. package/dist/utils/image-resize-worker.d.ts.map +1 -1
  640. package/dist/utils/image-resize-worker.js.map +1 -1
  641. package/dist/utils/image-resize.d.ts.map +1 -1
  642. package/dist/utils/image-resize.js.map +1 -1
  643. package/dist/utils/json.d.ts.map +1 -1
  644. package/dist/utils/json.js.map +1 -1
  645. package/dist/utils/management-http.d.ts.map +1 -1
  646. package/dist/utils/management-http.js.map +1 -1
  647. package/dist/utils/mime.d.ts.map +1 -1
  648. package/dist/utils/mime.js.map +1 -1
  649. package/dist/utils/open-browser.d.ts.map +1 -1
  650. package/dist/utils/open-browser.js.map +1 -1
  651. package/dist/utils/paths.d.ts +3 -3
  652. package/dist/utils/paths.d.ts.map +1 -1
  653. package/dist/utils/paths.js +5 -4
  654. package/dist/utils/paths.js.map +1 -1
  655. package/dist/utils/photon.d.ts.map +1 -1
  656. package/dist/utils/photon.js.map +1 -1
  657. package/dist/utils/pi-user-agent.d.ts.map +1 -1
  658. package/dist/utils/pi-user-agent.js.map +1 -1
  659. package/dist/utils/shell.d.ts +1 -3
  660. package/dist/utils/shell.d.ts.map +1 -1
  661. package/dist/utils/shell.js +3 -30
  662. package/dist/utils/shell.js.map +1 -1
  663. package/dist/utils/sleep.d.ts.map +1 -1
  664. package/dist/utils/sleep.js.map +1 -1
  665. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  666. package/dist/utils/syntax-highlight.js +2 -0
  667. package/dist/utils/syntax-highlight.js.map +1 -1
  668. package/dist/utils/text.d.ts.map +1 -1
  669. package/dist/utils/text.js.map +1 -1
  670. package/dist/utils/tool-result-images.d.ts.map +1 -1
  671. package/dist/utils/tool-result-images.js.map +1 -1
  672. package/dist/utils/tools-manager.d.ts.map +1 -1
  673. package/dist/utils/tools-manager.js.map +1 -1
  674. package/dist/utils/version-check.d.ts.map +1 -1
  675. package/dist/utils/version-check.js.map +1 -1
  676. package/dist/utils/windows-self-update.d.ts.map +1 -1
  677. package/dist/utils/windows-self-update.js.map +1 -1
  678. package/dist/utils/wsl.d.ts.map +1 -1
  679. package/dist/utils/wsl.js.map +1 -1
  680. package/dist/utils/zip.d.ts.map +1 -1
  681. package/dist/utils/zip.js.map +1 -1
  682. package/docs/cli.md +64 -3
  683. package/docs/configuration.md +2 -0
  684. package/docs/custom-provider.md +43 -4
  685. package/docs/docs.json +8 -0
  686. package/docs/extensions.md +55 -0
  687. package/docs/keybindings.md +1 -1
  688. package/docs/llama-cpp.md +13 -0
  689. package/docs/mcp.md +188 -0
  690. package/docs/models.md +35 -0
  691. package/docs/packages.md +4 -2
  692. package/docs/providers.md +1 -0
  693. package/docs/rpc-commands.md +9 -3
  694. package/docs/rpc.md +3 -1
  695. package/docs/sdk.md +7 -2
  696. package/docs/security.md +2 -0
  697. package/docs/session-format.md +5 -1
  698. package/docs/settings.md +20 -3
  699. package/docs/themes.md +33 -7
  700. package/docs/tui.md +18 -0
  701. package/docs/virtual-models.md +114 -0
  702. package/docs/windows.md +2 -0
  703. package/examples/README.md +1 -1
  704. package/examples/extensions/README.md +2 -0
  705. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  706. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  707. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  708. package/examples/extensions/custom-provider-gitlab-duo/test.ts +5 -5
  709. package/examples/extensions/debug-provider.ts +90 -0
  710. package/examples/extensions/gondolin/package-lock.json +2 -2
  711. package/examples/extensions/gondolin/package.json +1 -1
  712. package/examples/extensions/jev-router.ts +113 -0
  713. package/examples/extensions/sandbox/package-lock.json +2 -2
  714. package/examples/extensions/sandbox/package.json +1 -1
  715. package/examples/extensions/with-deps/package-lock.json +2 -2
  716. package/examples/extensions/with-deps/package.json +1 -1
  717. package/examples/rpc-client.ts +1 -1
  718. package/examples/rpc-extension-ui.ts +1 -1
  719. package/examples/sdk/14-codemode-mcp.ts +61 -0
  720. package/examples/sdk/README.md +2 -1
  721. package/package.json +14 -12
  722. package/dist/bundle/chunks/anthropic-messages-J5WXPPPC.js +0 -6
  723. package/dist/bundle/chunks/azure-openai-responses-QJ7SPP5M.js +0 -2
  724. package/dist/bundle/chunks/chunk-6R7UI4IY.js +0 -2
  725. package/dist/bundle/chunks/chunk-BZKWNWMI.js +0 -2
  726. package/dist/bundle/chunks/chunk-NUHFSC37.js +0 -25
  727. package/dist/bundle/chunks/chunk-RCZIEVGO.js +0 -11
  728. package/dist/bundle/chunks/chunk-X2F52Z34.js +0 -1685
  729. package/dist/bundle/chunks/google-generative-ai-IMS5EK2Y.js +0 -2
  730. package/dist/bundle/chunks/google-vertex-O4YJEQUW.js +0 -2
  731. package/dist/bundle/chunks/mistral-conversations-NOSQHBEY.js +0 -5
  732. package/dist/bundle/chunks/openai-responses-AH7QTG23.js +0 -2
  733. package/dist/bundle/chunks/virtual-modules-WWGGM27U.js +0 -2
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.
package/docs/packages.md CHANGED
@@ -85,7 +85,9 @@ Pi supplies these packages to extensions and skills:
85
85
  - `@earendil-works/pi-tui`
86
86
  - `typebox`
87
87
 
88
- Declare imported Pi packages in `peerDependencies` with a `"*"` range and do not bundle them. Other Pi packages used as dependencies must be included in the published tarball and referenced through their `node_modules` resource paths.
88
+ Declare the host-provided packages listed above in `peerDependencies` with a `"*"` range and do not bundle them. Pi suppresses automatic peer installation for managed npm packages and git packages installed with npm, pnpm, or Bun. Local packages are not installed or modified, so their dependency tree remains the package author's responsibility.
89
+
90
+ Do not list host-provided packages in `dependencies`. A physical copy can bypass Pi's extension module mapping in compiled ESM and create duplicate classes, registries, and initialization work. Pi reports an extension warning when it detects this manifest configuration. Other Pi packages used as dependencies must be included in the published tarball and referenced through their `node_modules` resource paths.
89
91
 
90
92
  Installed packages load with separate module roots. Do not rely on two packages sharing one dependency instance or one package resolving another package’s undeclared dependency.
91
93
 
@@ -116,7 +118,7 @@ For each resource type:
116
118
 
117
119
  Filters narrow the package manifest. They do not expose resources that the package itself did not declare.
118
120
 
119
- Run `pi config` to enable or disable discovered resources. It starts with personal configuration; press Tab to switch scope, or run `pi config --local` to start with project overrides.
121
+ Run `pi config` to enable or disable discovered resources and pi's built-in extensions. It starts with personal configuration; press Tab to switch scope, or run `pi config --local` to start with project overrides.
120
122
 
121
123
  ## Understand scope and identity
122
124
 
package/docs/providers.md CHANGED
@@ -49,6 +49,7 @@ This table covers providers with a single primary API-key variable. Providers th
49
49
  | ZAI Coding Plan (China) | `ZAI_CODING_CN_API_KEY` |
50
50
  | OpenCode Zen and Go | `OPENCODE_API_KEY` |
51
51
  | Radius | `RADIUS_API_KEY` |
52
+ | TypeSafe ([classifier models](models.md#use-classifier-models)) | `TYPESAFE_API_KEY` |
52
53
  | Hugging Face | `HF_TOKEN` |
53
54
  | Fireworks | `FIREWORKS_API_KEY` |
54
55
  | Together AI | `TOGETHER_API_KEY` |
@@ -34,9 +34,11 @@ If the agent is streaming and no `streamingBehavior` is specified, the command r
34
34
 
35
35
  Response:
36
36
  ```json
37
- {"id": "req-1", "type": "response", "command": "prompt", "success": true}
37
+ {"id": "req-1", "type": "response", "command": "prompt", "success": true, "data": {"disposition": "started"}}
38
38
  ```
39
39
 
40
+ `data.disposition` is `"handled"` if an extension command or input handler consumed the prompt, `"queued"` if Pi queued it during a run, or `"started"` if Pi accepted it to start a run. This describes the submitted prompt, not independent work started by an extension or a guarantee of completion.
41
+
40
42
  `success: true` means the prompt was accepted, queued, or handled immediately. `success: false` means the prompt was rejected before acceptance. Failures after acceptance are reported through the normal event and message stream, not as a second `response` for the same request id.
41
43
 
42
44
  The `images` field is optional. Each image uses `ImageContent` format: `{"type": "image", "data": "base64-encoded-data", "mimeType": "image/png"}`.
@@ -58,9 +60,11 @@ The `images` field is optional. Each image uses `ImageContent` format (same as `
58
60
 
59
61
  Response:
60
62
  ```json
61
- {"type": "response", "command": "steer", "success": true}
63
+ {"type": "response", "command": "steer", "success": true, "data": {"disposition": "queued"}}
62
64
  ```
63
65
 
66
+ `data.disposition` is `"handled"` if an input handler consumed this steer, or `"queued"` if Pi queued it (including after a handler transformed it). It does not guarantee this message remains queued.
67
+
64
68
  See [set_steering_mode](#set_steering_mode) for controlling how steering messages are processed.
65
69
 
66
70
  ### follow_up
@@ -80,9 +84,11 @@ The `images` field is optional. Each image uses `ImageContent` format (same as `
80
84
 
81
85
  Response:
82
86
  ```json
83
- {"type": "response", "command": "follow_up", "success": true}
87
+ {"type": "response", "command": "follow_up", "success": true, "data": {"disposition": "queued"}}
84
88
  ```
85
89
 
90
+ `data.disposition` has the same `"handled"` or `"queued"` meaning as for `steer`, applied to this follow-up.
91
+
86
92
  See [set_follow_up_mode](#set_follow_up_mode) for controlling how follow-up messages are processed.
87
93
 
88
94
  ### abort
package/docs/rpc.md CHANGED
@@ -61,9 +61,11 @@ A successful `prompt` response means the prompt was accepted, queued, or handled
61
61
 
62
62
  ```json
63
63
  {"id":"req-2","type":"prompt","message":"Review this repository"}
64
- {"id":"req-2","type":"response","command":"prompt","success":true}
64
+ {"id":"req-2","type":"response","command":"prompt","success":true,"data":{"disposition":"started"}}
65
65
  ```
66
66
 
67
+ `data.disposition` reports what happened to the prompt. If it is `"handled"`, no run started for this prompt, so don't wait for `agent_settled`. See [RPC Commands](rpc-commands.md#prompt) for all values.
68
+
67
69
  Continue consuming [events](json.md) after that response. `agent_end` marks the end of one low-level agent run, but retries, overflow recovery, compaction, steering, or follow-up work can still follow. Wait for `agent_settled` when the client needs to know Pi will not continue automatically.
68
70
 
69
71
  Subscribe before sending a prompt to avoid missing a fast completion. `RpcClient.promptAndWait()` does this internally. If using separate `RpcClient` calls, install the event listener before `prompt()` and call `waitForIdle()` only while a run is active.
package/docs/sdk.md CHANGED
@@ -65,7 +65,7 @@ After a runtime replacement, subscriptions belong to the old `AgentSession` and
65
65
 
66
66
  A prompt sent while the session is already streaming must specify whether it should steer the current run or follow it. Calling `prompt()` without that choice rejects rather than guessing.
67
67
 
68
- A steering message enters after the current assistant turn and its tool calls. A follow-up enters after the current run finishes its pending work. `steer()` and `followUp()` expose those behaviors directly.
68
+ A steering message enters after the current assistant turn and its tool calls. A follow-up enters after the current run finishes its pending work. `steer()` and `followUp()` expose those behaviors directly and return `"queued"` if the input was queued (including after an extension transformed it), or `"handled"` if an extension consumed it.
69
69
 
70
70
  `abort()` stops the active operation and waits for the session to become idle. `waitForIdle()` waits without aborting it.
71
71
 
@@ -109,7 +109,11 @@ Use `DefaultResourceLoader` when you want standard discovery with selected overr
109
109
 
110
110
  <a id="inlineextension"></a>
111
111
 
112
- Inline extension factories can be supplied through `DefaultResourceLoader`. Give one an `InlineExtension` name only when it needs a stable name in diagnostics and startup output.
112
+ Inline extension factories can be supplied through `DefaultResourceLoader`. Give one an `InlineExtension` name only when it needs a stable name in diagnostics and startup output. A named inline extension with `replaceable: true` is left out when another extension registers a tool, command, or flag with a name it registers during loading, instead of both loading with a conflict. The CLI's built-in codemode, tool search, and MCP extensions are replaceable. A named entry with `builtin: true` is not an inline extension: it supplies the code of the `builtin:<name>` extension, which loads like a configured extension file. It loads by default, is listed in `pi config`, and is disabled by `-builtin:<name>` in the `extensions` setting or by `noExtensions`; `additionalExtensionPaths: ["builtin:<name>"]` loads it explicitly. It loads after project trust is resolved, so it cannot handle `project_trust`. The CLI's built-in extensions use it.
113
+
114
+ <a id="codemode-mcp"></a>
115
+
116
+ The CLI loads `codemode`, `tool_search`, and MCP as built-in extensions. SDK sessions do not; add `createCodemodeExtension()`, `createToolSearchExtension()`, and `createMcpExtension()` to the `extensionFactories` of `DefaultResourceLoader`. `codemode` and `tool_search` are registered inactive: enable them through the `defaultTools` setting (`["+codemode", "+tool_search"]` keeps the other default tools), or let the MCP extension activate them: `codemode` for servers with `codemode` or `codemode-deferred` exposure, `tool_search` for servers with `deferred` exposure. The MCP extension connects its servers on `session_start`, so call `session.bindExtensions()`. See [Codemode and MCP](../examples/sdk/14-codemode-mcp.ts).
113
117
 
114
118
  See the focused examples for [models](../examples/sdk/02-custom-model.ts), [tools](../examples/sdk/05-tools.ts), [extensions](../examples/sdk/06-extensions.ts), and [full control](../examples/sdk/12-full-control.ts).
115
119
 
@@ -130,6 +134,7 @@ See the focused examples for [models](../examples/sdk/02-custom-model.ts), [tool
130
134
  | [Sessions](../examples/sdk/11-sessions.ts) | Control session persistence and restoration |
131
135
  | [Full control](../examples/sdk/12-full-control.ts) | Replace default discovery and state services |
132
136
  | [Session runtime](../examples/sdk/13-session-runtime.ts) | Replace the active session safely |
137
+ | [Codemode and MCP](../examples/sdk/14-codemode-mcp.ts) | Add the `codemode`, `tool_search`, and MCP extensions |
133
138
 
134
139
  <a id="exports"></a>
135
140
 
package/docs/security.md CHANGED
@@ -37,6 +37,7 @@ Project trust does not limit what tool calls can access or affect. After Pi star
37
37
  Pi requires a project-trust decision when it finds any of these resources from the current working directory:
38
38
 
39
39
  - `.pi/settings.json`
40
+ - `.pi/mcp.json`
40
41
  - `.pi/extensions`, `.pi/skills`, `.pi/prompts`, or `.pi/themes`
41
42
  - `.pi/SYSTEM.md` or `.pi/APPEND_SYSTEM.md`
42
43
  - project `.agents/skills` in the current directory or an ancestor directory
@@ -46,6 +47,7 @@ A bare `.pi` directory does not require project trust.
46
47
  Granting project trust allows Pi to load:
47
48
 
48
49
  - project settings
50
+ - project MCP servers from `.pi/mcp.json`
49
51
  - extensions, skills, prompt templates, themes, and system-prompt files under `.pi`
50
52
  - missing packages configured through project settings
51
53
  - project-local and project-package extensions
@@ -92,9 +92,11 @@ Sessions created before system messages existed have no leading system message;
92
92
  {"type":"message","id":"c3d4e5f6","parentId":"b2c3d4e5","timestamp":"2024-12-03T14:00:03.000Z","message":{"role":"toolResult","toolCallId":"call_123","toolName":"bash","content":[{"type":"text","text":"output"}],"isError":false,"timestamp":1733234403000}}
93
93
  ```
94
94
 
95
+ Assistant messages name the model that produced them. Newer messages also record `thinkingLevel`, the Pi thinking level requested for that response.
96
+
95
97
  ### ModelChangeEntry
96
98
 
97
- Emitted when the user switches models mid-session.
99
+ Emitted when the user switches models mid-session. The latest entry is the selected model, which may be a [virtual model](virtual-models.md); assistant messages then name the physical model that answered.
98
100
 
99
101
  ```json
100
102
  {"type":"model_change","id":"d4e5f6g7","parentId":"c3d4e5f6","timestamp":"2024-12-03T14:05:00.000Z","provider":"openai","modelId":"gpt-4o"}
@@ -169,6 +171,8 @@ Extension state persistence. Does NOT participate in LLM context.
169
171
 
170
172
  Use `customType` to identify your extension's entries on reload. Interactive mode can render custom entries via `pi.registerEntryRenderer(customType, renderer)`, but they still do not participate in LLM context.
171
173
 
174
+ Pi stores [virtual model](virtual-models.md) router state as custom entries with `customType` `pi.virtual-model-state` and `data` `{ provider, modelId, state }`.
175
+
172
176
  ### CustomMessageEntry
173
177
 
174
178
  Extension-injected messages that DO participate in LLM context.
package/docs/settings.md CHANGED
@@ -37,9 +37,23 @@ See [Choose a Model](models.md) for model selection and thinking controls.
37
37
 
38
38
  | Setting | Type | Default | Description |
39
39
  |---|---|---|---|
40
- | `defaultTools` | `string[]` | `read`, `bash`, `edit`, `write` | Built-in tools enabled at startup. An empty array disables all built-in tools but not extension or SDK tools. |
40
+ | `defaultTools` | `string[]` | `read`, `bash`, `edit`, `write` | Tools enabled at startup. Plain names replace the defaults; `+name` adds a tool and `-name` removes one. An empty array disables all built-in tools but not extension or SDK tools. |
41
+ | `codemode.mode` | `"on"` \| `"only"` | `"on"` | How the `codemode` tool presents tools while it is active. `on`: declared tools get their `codemode` declaration appended to their description, and `codemode` lists only tools that are not declared (MCP `codemode` exposure). `only`: `codemode` lists every tool scripts can call, and active built-in and extension tools are hidden from the model, so it reaches them through `codemode`. |
42
+ | `codemode.inlineBudget` | number | `3000` | Estimated tokens (characters / 4) the `codemode` tool's description may spend on tool declarations. Tools that do not fit are left out and found with `searchTools()`. `0` lists only namespaces. |
41
43
 
42
- Available built-in tools are `read`, `bash`, `powershell`, `edit`, `write`, `grep`, `find`, and `ls`. CLI tool options override this setting for one invocation. See [Command Line](cli.md#tools).
44
+ Available built-in tools are `read`, `bash`, `powershell`, `edit`, `write`, `grep`, `find`, and `ls`. `defaultTools` can also name `codemode` and `tool_search`, which built-in extensions register inactive, and other extension tools registered inactive.
45
+
46
+ A list of only `+name` and `-name` entries changes the inherited selection instead of replacing it. For example, this enables `codemode` next to the default tools:
47
+
48
+ ```json
49
+ {
50
+ "defaultTools": ["+codemode"]
51
+ }
52
+ ```
53
+
54
+ This replaces `bash` with `powershell` and enables `grep`: `["-bash", "+powershell", "+grep"]`. Project settings apply on top of user settings: a project list with only `+name` and `-name` entries changes the user's selection, and a project list with a plain name replaces it. In one list, plain names form the selection, and `+name` and `-name` then apply in order.
55
+
56
+ CLI tool options override this setting for one invocation; `--tools` does not accept `+name` or `-name`. See [Command Line](cli.md#tools).
43
57
 
44
58
  ## Sessions and context
45
59
 
@@ -73,12 +87,13 @@ See [Compaction Reference](compaction.md) for trigger, summarization, and valida
73
87
 
74
88
  | Setting | Type | Default | Description |
75
89
  |---|---|---|---|
76
- | `theme` | string | Detected | Built-in or custom theme name. |
90
+ | `theme` | string | `"system"` | Built-in or custom theme name. `system` derives colors from the terminal theme. |
77
91
  | `quietStartup` | boolean | `false` | Hide the startup header. |
78
92
  | `tuiMode` | `"regular" \| "fullscreen"` | `"regular"` | Interactive terminal UI mode. |
79
93
  | `fullscreenExitOutput` | `"transcript" \| "resume-hint"` | `"transcript"` | Output printed when fullscreen mode exits. |
80
94
  | `fullscreenScrollbar` | `"auto" \| "always" \| "hidden"` | `"auto"` | Fullscreen transcript scrollbar behavior. |
81
95
  | `fullscreenCopyOnSelect` | boolean | `true` | Copy selected text automatically in fullscreen mode. |
96
+ | `fullscreenWheelScrollLines` | `"auto"` \| number | `"auto"` | Lines per mouse-wheel event in fullscreen mode, from 1 to 100. `"auto"` moves one line per event in local macOS terminals, which already accelerate wheel and trackpad input; elsewhere, and over SSH, it speeds up fast wheel spins to at most 6 lines per event. Alt+wheel moves five times as far. |
82
97
  | `editorPaddingX` | number | `0` | Horizontal editor padding from 0 to 3 cells. |
83
98
  | `outputPad` | `0 \| 1` | `1` | Horizontal transcript padding. |
84
99
  | `autocompleteMaxVisible` | number | `5` | Visible autocomplete entries, from 3 to 20. |
@@ -140,6 +155,8 @@ Resource paths in user settings resolve from the agent directory. Paths in proje
140
155
 
141
156
  Resource arrays support glob exclusions with `!pattern`, exact inclusion with `+path`, and exact exclusion with `-path`. Pi loads resources listed in both user-level and project settings.
142
157
 
158
+ The built-in extensions are named `builtin:mcp`, `builtin:llama.cpp`, `builtin:codemode`, and `builtin:tool-search` in `extensions`. They load by default; `-builtin:mcp` disables one. A `+builtin:<name>` or `-builtin:<name>` entry in project settings overrides the user setting. `pi config` lists them under Built-in. `--no-extensions` disables them too, and `-e builtin:<name>` loads one explicitly.
159
+
143
160
  ## Updates, telemetry, and warnings
144
161
 
145
162
  | Setting | Type | Default | Description |
package/docs/themes.md CHANGED
@@ -1,6 +1,25 @@
1
1
  # Customize Pi with themes
2
2
 
3
- Themes control the colors Pi uses in interactive mode and HTML exports. Pi includes `dark` and `light` themes. You can select one theme, follow your terminal's light or dark appearance, or create your own palette.
3
+ Themes control the colors Pi uses in interactive mode and HTML exports. Pi includes the `system`, `dark`, and `light` themes. You can select one theme, follow your terminal's light or dark appearance, or create your own palette.
4
+
5
+ ## Use your terminal's colors
6
+
7
+ The `system` theme is the default. It builds Pi's colors from your terminal's theme, so Pi matches the terminal instead of bringing its own palette:
8
+
9
+ - Pi queries the terminal's default foreground and background colors and its 16 ANSI colors.
10
+ - Each Pi color takes its hue from one ANSI color, for example errors from red and links from blue.
11
+ - Pi sets each color's lightness so that it stands out from the background by a minimum contrast. Body text keeps at least a 4.5:1 WCAG contrast ratio on the background and every panel.
12
+ - When the terminal switches between light and dark, Pi queries the colors again and rebuilds the theme.
13
+
14
+ The theme adapts to what the terminal reports:
15
+
16
+ | Terminal reports | Result |
17
+ |---|---|
18
+ | Background and ANSI colors | Colors from the terminal palette, placed for the actual background. |
19
+ | Background only | Pi's own hues, placed for the actual background. |
20
+ | Nothing | ANSI color indices and the terminal's default colors, which the terminal renders itself. Secondary text is faint, and panels have no background color. |
21
+
22
+ Pi asks the terminal for its colors when it starts. Terminals usually answer within a few milliseconds, and Pi waits at most 100 ms before showing the startup header. If the terminal does not answer in time, Pi uses the ANSI color fallback, and it still applies the colors if they arrive later, for example over a slow SSH connection. `system` is a reserved name: a custom theme with that name is ignored.
4
23
 
5
24
  <a id="selecting-a-theme"></a>
6
25
 
@@ -16,6 +35,8 @@ The selection is saved as the `theme` [setting](settings.md#terminal-and-display
16
35
  }
17
36
  ```
18
37
 
38
+ Without a `theme` setting, Pi uses `system`.
39
+
19
40
  Automatic mode stores the light theme first and the dark theme second:
20
41
 
21
42
  ```json
@@ -24,7 +45,7 @@ Automatic mode stores the light theme first and the dark theme second:
24
45
  }
25
46
  ```
26
47
 
27
- When automatic mode is active, Pi changes themes when the terminal reports an appearance change. Theme names cannot contain `/` because Pi reserves it for this setting format.
48
+ Pi decides whether the terminal is light or dark from its reported background and foreground colors. If the terminal does not report its background, Pi uses the terminal's light/dark notification, then the `COLORFGBG` environment variable, then dark. The same decision picks the theme of a light/dark pair and the appearance of `system`. When automatic mode is active, Pi changes themes when the terminal reports an appearance change. Theme names cannot contain `/` because Pi reserves it for this setting format.
28
49
 
29
50
  Use `--use-theme` to choose the initial theme for one invocation without changing the saved setting:
30
51
 
@@ -37,7 +58,7 @@ See [CLI resources](cli.md#resources) for the command-line option.
37
58
 
38
59
  ## Create a custom theme
39
60
 
40
- Copy one of the [built-in themes](https://github.com/earendil-works/pi/tree/main/packages/coding-agent/src/modes/interactive/theme) or create a new JSON file conforming to the [schema](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json).
61
+ Copy one of the [built-in themes](https://github.com/earendil-works/pi/tree/main/packages/coding-agent/src/modes/interactive/theme) or create a new JSON file conforming to the [schema](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json). The built-in themes use OKHSL colors, with variables for colors that several roles share, so you can adjust a hue, saturation, or lightness directly.
41
62
 
42
63
  1. Save the file as `<agent-dir>/themes/my-theme.json`. The agent directory defaults to `~/.pi/agent`.
43
64
  2. Set its `name` to `my-theme`.
@@ -51,21 +72,26 @@ Use the theme name as the filename. Pi hot-reloads the active user theme only fr
51
72
  | Property | Required | Responsibility |
52
73
  |---|---|---|
53
74
  | `$schema` | No | Enables editor validation and completion against Pi's published schema. |
54
- | `name` | Yes | Identifies the theme in selectors and settings. It must be unique and cannot contain `/`. |
75
+ | `name` | Yes | Identifies the theme in selectors and settings. It must be unique, cannot contain `/`, and cannot be `system`. |
76
+ | `appearance` | No | `"dark"` or `"light"`: the background the theme is designed for. Pi detects it from the theme colors when omitted. |
55
77
  | `vars` | No | Defines reusable color values. Variables can reference other variables. |
56
78
  | `colors` | Yes | Assigns colors to terminal UI roles. The schema identifies required and optional roles. |
57
79
  | `export` | No | Overrides page and panel backgrounds in HTML exports. |
58
80
 
59
- A color can be written in four forms:
81
+ A color can be written in six forms:
60
82
 
61
83
  | Form | Example | Meaning |
62
84
  |---|---|---|
63
- | RGB hexadecimal | `"#00aaff"` | A six-digit RGB color. |
85
+ | RGB hexadecimal | `"#0af"` or `"#00aaff"` | A three- or six-digit sRGB color. |
86
+ | OKLCH | `"oklch(62% 0.1 200)"` | Perceptual lightness, chroma, and hue. |
87
+ | OKHSL | `"okhsl(250 60% 55%)"` | Hue, saturation, and lightness. Saturation is relative to the most the sRGB gamut allows at that hue and lightness, so every value is in gamut and equal saturation looks equally colorful. |
64
88
  | 256-color index | `39` | An ANSI palette index from `0` through `255`. |
65
89
  | Variable reference | `"primary"` | The value of an entry in `vars`. |
66
90
  | Terminal default | `""` | The terminal's default foreground or background color. |
67
91
 
68
- Pi resolves chained variable references. A missing variable or circular reference makes the theme invalid. Hexadecimal colors use truecolor when supported and are approximated in terminals limited to 256 colors. If colors differ from their hexadecimal values, check your terminal's truecolor detection and contrast settings. See [Configure Your Terminal](terminal-setup.md#override-detected-capabilities).
92
+ Terminal default colors render as the terminal's own colors. Where Pi needs a concrete value, such as HTML export or extension color math, it uses the default colors the terminal reports, or a black or white guess based on the theme's appearance.
93
+
94
+ Pi resolves chained variable references. A missing variable or circular reference makes the theme invalid. Pi uses truecolor when available, gamut-maps OKLCH to sRGB, and approximates colors for 256-color terminals. HTML exports convert OKHSL values to hexadecimal because CSS does not support them. If colors differ from their source values, check your terminal's truecolor detection and contrast settings. See [Configure Your Terminal](terminal-setup.md#override-detected-capabilities).
69
95
 
70
96
  Use the [theme JSON schema](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json) for the exact properties, required colors, and accepted value types.
71
97
 
package/docs/tui.md CHANGED
@@ -79,6 +79,24 @@ See [`overlay-qa-tests.ts`](../examples/extensions/overlay-qa-tests.ts) for posi
79
79
 
80
80
  Use the theme passed to the extension or component callback. Theme helpers produce ANSI-styled strings for semantic colors such as accent, muted text, success, warnings, errors, tool output, and Markdown.
81
81
 
82
+ Use `theme.style()` to combine foreground and background colors with text attributes:
83
+
84
+ ```typescript
85
+ return new Text(
86
+ theme.style("Done!", {
87
+ fg: "success",
88
+ bg: "toolSuccessBg",
89
+ bold: true,
90
+ }),
91
+ 0,
92
+ 0,
93
+ );
94
+ ```
95
+
96
+ A style color can be a semantic theme token or a concrete `Color`. Foreground tokens are accepted as `fg` and background tokens as `bg`; to use a token's color in the other position, pass its concrete color, for example `{ fg: theme.colors.userMessageBg }`. Access concrete colors through `theme.colors` and use utilities such as `mixColors()` from `@earendil-works/pi-tui` when color math is needed. Tokens that a theme sets to the terminal default render with the terminal's own color; `theme.colors` reports the color the terminal announced for them, or a guess when it did not. Use `theme.appearance` (`"dark"` or `"light"`) to decide, for example, whether to lighten or darken a color. Pi converts the result to truecolor or 256-color output based on terminal capabilities. Theme tokens are converted once per theme; compute concrete colors outside the render path when possible.
97
+
98
+ The existing `theme.fg()` and `theme.bg()` helpers remain available for applying one semantic color.
99
+
82
100
  Do not permanently store strings with theme colors unless `invalidate()` rebuilds them. A theme change clears render caches, but it cannot remove old ANSI colors embedded in application state.
83
101
 
84
102
  Theme callbacks evaluated during rendering do not need special rebuilding. Stateless components can also calculate themed output on every render.