@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
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.
@@ -0,0 +1,114 @@
1
+ # Virtual Models
2
+
3
+ A virtual model is a selectable model that picks a physical model for each request. Use one to route by task, cost, or conversation state. For example, a router can send quick questions to a small model and hard problems to a large one, while the user selects a single model.
4
+
5
+ Register virtual models from an [extension](extensions.md). They appear in `/model`, `--model`, scoped models, and settings like any other model. A virtual model can be listed under any provider, including one with physical models, such as `openai-codex/auto`.
6
+
7
+ ## Selection and dispatch
8
+
9
+ A virtual model selects a model and a thinking level. A router maps that pair to a physical pair for each request:
10
+
11
+ ```
12
+ selected (virtual model, virtual level) -> dispatched (physical model, physical level)
13
+ jev/auto:low -> anthropic/claude-sonnet-4-5:high
14
+ ```
15
+
16
+ The virtual thinking level is an input to the router. Its meaning is up to the router; it need not correspond to a reasoning budget.
17
+
18
+ Pi keeps the two pairs apart:
19
+
20
+ | | Selection | Dispatch |
21
+ |---|---|---|
22
+ | Recorded in | `model_change` and `thinking_level_change` entries | Each assistant message: `provider`, `api`, `model`, `thinkingLevel` |
23
+ | Visible as | `ctx.model`, `ctx.thinkingLevel`, `PI_MODEL`, `PI_REASONING_LEVEL`, `/model` | The assistant message of each response |
24
+
25
+ Providers only receive physical models. Assistant messages name the physical model, so replaying a conversation across different physical models works the same as after a manual model switch. Resuming a session restores the virtual selection from its latest `model_change` entry. If the virtual model is no longer registered, Pi falls back to the physical model that answered last.
26
+
27
+ In interactive mode, the footer shows the routed model next to the selection, for example `auto • high → gpt-5.6-luna • medium`. `/session` lists the cost for each physical model.
28
+
29
+ Context usage uses the limits of the physical model that produced the latest response, even if that response came before switching to the virtual model. Without such a response, it uses the limits declared on the virtual model, if any. Compaction checks the same limits, and again the limits of the model each request is routed to. If that model's context window is too small for the conversation, Pi compacts before sending the request; the route stays as the router chose it.
30
+
31
+ ## Register a virtual model
32
+
33
+ ```typescript
34
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
35
+
36
+ export default function (pi: ExtensionAPI) {
37
+ pi.registerVirtualModel({
38
+ provider: "router",
39
+ id: "auto",
40
+ name: "Auto",
41
+ thinkingLevels: ["low", "high"],
42
+ route(request, ctx) {
43
+ // Tool follow-ups and retries stay on the model that handled the turn.
44
+ const sticky = request.failed ?? request.previous;
45
+ if (request.reason !== "user" && sticky) {
46
+ return { model: sticky.model, thinkingLevel: sticky.thinkingLevel ?? "medium" };
47
+ }
48
+ const id = request.thinkingLevel === "high" ? "claude-sonnet-4-5" : "claude-haiku-4-5";
49
+ return { model: ctx.modelRegistry.find("anthropic", id)!, thinkingLevel: "medium" };
50
+ },
51
+ });
52
+ }
53
+ ```
54
+
55
+ - `provider` is the provider the model is listed under. It can be any provider ID. A provider can list several virtual models next to its physical ones. On a physical provider, the virtual model is available when that provider has credentials. Under an ID that no provider uses, it is always available.
56
+ - `id` must not be the ID of a physical model of that provider. If a catalog refresh later adds a physical model with the same ID, the virtual model hides it.
57
+ - `thinkingLevels` lists the levels offered for selection. It defaults to `["off"]`.
58
+ - `contextWindow` and `maxTokens` are shown before the first response. Unset limits are unknown.
59
+ - `input` lists the input types offered for selection. It defaults to text and images; physical models without image support receive placeholders.
60
+
61
+ Registration follows the same queuing and reload rules as `pi.registerProvider()`. Registering the same provider and ID again replaces the virtual model. `pi.unregisterVirtualModel(provider, id)` removes it; `pi.unregisterProvider()` does not. SDK code can register one without an extension: `modelRuntime.registerVirtualModel(definition)`.
62
+
63
+ ## Route requests
64
+
65
+ `route(request, ctx)` runs before every request made with the virtual model and returns `{ model, thinkingLevel }`. The model can be any physical model in the catalog whose provider has credentials; look it up with `ctx.modelRegistry`. A virtual model cannot route to another virtual model. Pi clamps the thinking level to the returned model.
66
+
67
+ | Field | Meaning |
68
+ |---|---|
69
+ | `model`, `thinkingLevel` | The selected virtual model and level |
70
+ | `reason` | Why the request is made, see below |
71
+ | `previous` | Physical model and thinking level of the latest successful response in `messages` |
72
+ | `failed` | For `retry`: physical model, thinking level, and assistant `message` of the failed request, which `messages` no longer contains. The message carries `stopReason` and `errorMessage`. Absent when routing itself failed |
73
+ | `state` | Router state last returned on this session branch, see below |
74
+ | `messages` | The conversation for this request, including system messages |
75
+ | `signal` | Abort signal of the request |
76
+
77
+ | `reason` | Request |
78
+ |---|---|
79
+ | `user` | First request after a message the user wrote, including steering and follow-up messages |
80
+ | `continuation` | Any other request in the agent loop, such as after tool results or extension messages |
81
+ | `retry` | Automatic retry after a failed request, including after compaction for a context overflow |
82
+ | `direct` | Request made outside the agent loop, such as a compaction summary or an extension calling `ctx.modelRegistry.streamSimple()` |
83
+
84
+ Returning `previous` for `continuation` and `failed` for `retry` keeps prompt caches and thinking signatures valid. Switching models between turns is allowed but loses the prompt cache. A retry can also switch to another model, for example when `failed.message.errorMessage` reports that a provider is overloaded or the context overflowed.
85
+
86
+ If `route()` throws, or returns a virtual model or a model without credentials, the request ends with an error response.
87
+
88
+ ## Keep routing state
89
+
90
+ `route()` can return `state` next to the model. Pi stores it on the session branch and passes it back as `request.state` on later requests. Use it for decisions the transcript does not record, such as classifier results or a routing phase:
91
+
92
+ ```typescript
93
+ pi.registerVirtualModel<{ phase: "plan" | "build" }>({
94
+ provider: "router",
95
+ id: "phased",
96
+ name: "Phased",
97
+ route(request, ctx) {
98
+ const state = request.state ?? { phase: "plan" };
99
+ const id = state.phase === "plan" ? "claude-opus-4-5" : "claude-haiku-4-5";
100
+ return { model: ctx.modelRegistry.find("anthropic", id)!, thinkingLevel: "medium", state };
101
+ },
102
+ });
103
+ ```
104
+
105
+ - State must be JSON-serializable. Returning `undefined` or `request.state` itself keeps the current state.
106
+ - Pi stores any other returned object as new state, before the request is sent, even when it equals the current state. Return a new object only when the state changes. The state stays stored if the request later fails.
107
+ - State follows the session tree, so forks and `/tree` navigation see the state of their branch. It survives compaction.
108
+ - `direct` requests have no state, and Pi ignores state they return.
109
+
110
+ The transcript already records the selection and every dispatched model, and `ctx.sessionManager.getBranch()` exposes both.
111
+
112
+ Routers can call other models through `ctx.modelRegistry`, for example `ctx.modelRegistry.classify()` with a classifier model from `ctx.modelRegistry.findOfType("classifier", provider, id)`. The call adds latency before the first token of the turn.
113
+
114
+ See [`jev-router.ts`](../examples/extensions/jev-router.ts) for a complete router. It plans on a strong OpenAI Codex model chosen by the Jev classifier, lets that model make the first edit, and then switches once to a cheaper model, accepting a single prompt-cache miss. It keeps the phase as router state.
package/docs/windows.md CHANGED
@@ -42,6 +42,8 @@ To replace the model-facing `bash` tool with `powershell`, add this to `~/.pi/ag
42
42
  }
43
43
  ```
44
44
 
45
+ `["-bash", "+powershell"]` does the same while keeping any other default tools you configured.
46
+
45
47
  Restart Pi, then ask it to run a harmless PowerShell command. The `!` and `!!` editor commands continue to use Bash. The `powershell` tool is available only when Pi runs as a native Windows process.
46
48
 
47
49
  See [Settings](settings.md#tools) for other tool combinations.
@@ -9,7 +9,7 @@ Example code for the pi-coding-agent SDK, process integration, and extensions.
9
9
  Build the coding-agent package before running it from a repository checkout:
10
10
 
11
11
  ```bash
12
- npx tsx examples/rpc-client.ts "Explain this repository"
12
+ node examples/rpc-client.ts "Explain this repository"
13
13
  ```
14
14
 
15
15
  ## Directories
@@ -113,6 +113,7 @@ cp permission-gate.ts ~/.pi/agent/extensions/
113
113
  |-----------|-------------|
114
114
  | `message-renderer.ts` | Custom message rendering with colors and expandable details via `registerMessageRenderer` |
115
115
  | `entry-renderer.ts` | TUI-only session entry rendering via `appendEntry` and `registerEntryRenderer` |
116
+ | `debug-provider.ts` | Toggle raw provider stream capture with `/debug-provider` and inspect each assistant message in a TUI-only session entry |
116
117
  | `event-bus.ts` | Inter-extension communication via `pi.events` |
117
118
 
118
119
  ### Session Metadata
@@ -128,6 +129,7 @@ cp permission-gate.ts ~/.pi/agent/extensions/
128
129
  |-----------|-------------|
129
130
  | `custom-provider-anthropic/` | Custom Anthropic provider with OAuth support and custom streaming implementation |
130
131
  | `custom-provider-gitlab-duo/` | GitLab Duo provider using pi-ai's built-in Anthropic/OpenAI streaming via proxy |
132
+ | `jev-router.ts` | Virtual model via `registerVirtualModel` that plans on Codex Sol or Terra (picked by the Jev classifier) and switches to Luna after the first edit |
131
133
 
132
134
  ### External Dependencies
133
135
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider",
3
- "version": "0.87.1",
3
+ "version": "0.99.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-custom-provider",
9
- "version": "0.87.1",
9
+ "version": "0.99.0",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.52.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-anthropic",
3
3
  "private": true,
4
- "version": "0.87.1",
4
+ "version": "0.99.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "0.87.1",
4
+ "version": "0.99.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * Test script for GitLab Duo extension
3
- * Run: npx tsx test.ts [model-id] [--thinking]
3
+ * Run: node test.ts [model-id] [--thinking]
4
4
  *
5
5
  * Examples:
6
- * npx tsx test.ts # Test default (claude-sonnet-4-5-20250929)
7
- * npx tsx test.ts gpt-5-codex # Test GPT-5 Codex
8
- * npx tsx test.ts claude-sonnet-4-5-20250929 --thinking
6
+ * node test.ts # Test default (claude-sonnet-4-5-20250929)
7
+ * node test.ts gpt-5-codex # Test GPT-5 Codex
8
+ * node test.ts claude-sonnet-4-5-20250929 --thinking
9
9
  */
10
10
 
11
11
  import { type Api, type Context, type Model, registerApiProvider, streamSimple } from "@earendil-works/pi-ai/compat";
12
+ import { getAgentDir } from "@earendil-works/pi-coding-agent";
12
13
  import { readFileSync } from "fs";
13
- import { getAgentDir } from "packages/coding-agent/src/config.js";
14
14
  import { join } from "path";
15
15
  import { MODELS, streamGitLabDuo } from "./index.ts";
16
16
 
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Raw provider event viewer.
3
+ *
4
+ * Usage: /debug-provider [on|off]
5
+ * With no argument, the command toggles capture. Captured events are persisted
6
+ * as expandable custom entries.
7
+ */
8
+
9
+ import { type ExtensionAPI, keyHint } from "@earendil-works/pi-coding-agent";
10
+ import { Box, Text } from "@earendil-works/pi-tui";
11
+
12
+ const ENTRY_TYPE = "debug-provider-events";
13
+ const STATUS_KEY = "debug-provider";
14
+
15
+ interface ProviderDebugEntry {
16
+ provider: string;
17
+ api: string;
18
+ model: string;
19
+ events: unknown[];
20
+ }
21
+
22
+ export default function (pi: ExtensionAPI) {
23
+ let enabled = false;
24
+ let activeEvents: unknown[] | undefined;
25
+ let completedEntry: ProviderDebugEntry | undefined;
26
+
27
+ pi.registerEntryRenderer<ProviderDebugEntry>(ENTRY_TYPE, (entry, { expanded }, theme) => {
28
+ const data = entry.data;
29
+ if (!data) return new Text(theme.fg("warning", "[provider debug] Missing event data"), 0, 0);
30
+
31
+ const box = new Box(1, 1, (text) => theme.bg("customMessageBg", text));
32
+ const count = `${data.events.length} event${data.events.length === 1 ? "" : "s"}`;
33
+ const expandHint = expanded ? "" : ` (${keyHint("app.tools.expand", "to view events")})`;
34
+ box.addChild(
35
+ new Text(
36
+ `${theme.fg("accent", "[provider debug]")} ${data.provider}/${data.model} (${data.api}) · ${count}${expandHint}`,
37
+ 0,
38
+ 0,
39
+ ),
40
+ );
41
+ if (expanded) {
42
+ box.addChild(new Text(JSON.stringify(data.events, null, 2), 0, 0));
43
+ }
44
+ return box;
45
+ });
46
+
47
+ pi.registerCommand("debug-provider", {
48
+ description: "Toggle capture of raw provider stream events",
49
+ handler: async (args, ctx) => {
50
+ const requestedState = args.trim().toLowerCase();
51
+ if (requestedState !== "" && requestedState !== "on" && requestedState !== "off") {
52
+ ctx.ui.notify("Usage: /debug-provider [on|off]", "warning");
53
+ return;
54
+ }
55
+
56
+ enabled = requestedState === "" ? !enabled : requestedState === "on";
57
+ if (!enabled) {
58
+ activeEvents = undefined;
59
+ completedEntry = undefined;
60
+ }
61
+ ctx.ui.setStatus(STATUS_KEY, enabled ? "provider debug" : undefined);
62
+ ctx.ui.notify(`Provider event capture ${enabled ? "enabled" : "disabled"}`, "info");
63
+ },
64
+ });
65
+
66
+ pi.on("turn_start", () => {
67
+ activeEvents = enabled ? [] : undefined;
68
+ });
69
+
70
+ pi.on("provider_stream_event", (event) => {
71
+ activeEvents?.push(structuredClone(event.data));
72
+ });
73
+
74
+ pi.on("message_end", (event) => {
75
+ if (event.message.role !== "assistant" || !activeEvents) return;
76
+ completedEntry = {
77
+ provider: event.message.provider,
78
+ api: event.message.api,
79
+ model: event.message.model,
80
+ events: activeEvents,
81
+ };
82
+ activeEvents = undefined;
83
+ });
84
+
85
+ pi.on("turn_end", () => {
86
+ if (!completedEntry) return;
87
+ pi.appendEntry<ProviderDebugEntry>(ENTRY_TYPE, completedEntry);
88
+ completedEntry = undefined;
89
+ });
90
+ }