@averyyy/pi-coding-agent 0.87.1-piclient.2 → 1.0.0-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 (765) hide show
  1. package/CHANGELOG.md +183 -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-UID2PALB.js +6 -0
  10. package/dist/bundle/chunks/anthropic.js +2 -2
  11. package/dist/bundle/chunks/azure-openai-responses-WK37QQ3X.js +2 -0
  12. package/dist/bundle/chunks/bedrock-converse-stream.js +3 -3
  13. package/dist/bundle/chunks/chunk-2LGHNI5Y.js +1553 -0
  14. package/dist/bundle/chunks/chunk-6D7LHLKG.js +2 -0
  15. package/dist/bundle/chunks/chunk-7JGR3GZN.js +11 -0
  16. package/dist/bundle/chunks/{chunk-FUXEF6JQ.js → chunk-CWVWZD3J.js} +2 -2
  17. package/dist/bundle/chunks/chunk-GIUN2MS4.js +16 -0
  18. package/dist/bundle/chunks/chunk-H3QXYIF7.js +31 -0
  19. package/dist/bundle/chunks/chunk-KYK7L7MP.js +127 -0
  20. package/dist/bundle/chunks/chunk-LD2P6SFZ.js +2 -0
  21. package/dist/bundle/chunks/chunk-LDPPAHPJ.js +4 -0
  22. package/dist/bundle/chunks/chunk-NEUJZQL3.js +19 -0
  23. package/dist/bundle/chunks/chunk-OI6YFHHK.js +82 -0
  24. package/dist/bundle/chunks/chunk-OSKPX3Z5.js +2 -0
  25. package/dist/bundle/chunks/{chunk-XDUWOHPL.js → chunk-S3GGRYIO.js} +2 -2
  26. package/dist/bundle/chunks/chunk-SQXKOUF6.js +2 -0
  27. package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
  28. package/dist/bundle/chunks/chunk-VIV3CWXG.js +2 -0
  29. package/dist/bundle/chunks/chunk-Y5O5BZGX.js +136 -0
  30. package/dist/bundle/chunks/{chunk-UZNGGY6N.js → chunk-Z772OFUN.js} +3 -3
  31. package/dist/bundle/chunks/cli-JE36AHMI.js +51 -0
  32. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-NPQN263E.js +2 -0
  33. package/dist/bundle/chunks/codemode-worker.js +354 -0
  34. package/dist/bundle/chunks/execute-UX73LR4F.js +367 -0
  35. package/dist/bundle/chunks/github-copilot.js +1 -1
  36. package/dist/bundle/chunks/google-generative-ai-OHRSHIE7.js +2 -0
  37. package/dist/bundle/chunks/google-vertex-KXEB3MVO.js +2 -0
  38. package/dist/bundle/chunks/{https-proxy-agent-2VXB7436.js → https-proxy-agent-UDEHOBGS.js} +1 -1
  39. package/dist/bundle/chunks/{lib-HGQMNYVT.js → lib-TEDK3E5I.js} +2 -2
  40. package/dist/bundle/chunks/llama-cpp-classify-XT44PI3C.js +22 -0
  41. package/dist/bundle/chunks/mistral-conversations-DKVFNQL6.js +5 -0
  42. package/dist/bundle/chunks/openai-chatgpt.js +75 -0
  43. package/dist/bundle/chunks/{openai-codex-responses-SG7PGUUZ.js → openai-codex-responses-WVERB76N.js} +2 -2
  44. package/dist/bundle/chunks/openai-codex.js +2 -2
  45. package/dist/bundle/chunks/{openai-completions-OBX42CLD.js → openai-completions-JXDDPZ23.js} +2 -2
  46. package/dist/bundle/chunks/openai-responses-WDT74L23.js +3 -0
  47. package/dist/bundle/chunks/{openrouter-images-N4XVVFSD.js → openrouter-images-ZVXWCSIM.js} +1 -1
  48. package/dist/bundle/chunks/openrouter.js +2 -2
  49. package/dist/bundle/chunks/pi-logo-animation-APS4JS6B.js +2 -0
  50. package/dist/bundle/chunks/{pi-messages-GFKBWJHZ.js → pi-messages-TM5SOOIW.js} +2 -2
  51. package/dist/bundle/chunks/radius.js +2 -2
  52. package/dist/bundle/chunks/runtime-MPXPM7VL.js +2 -0
  53. package/dist/bundle/chunks/typesafe-system-one-A4CZTQWZ.js +2 -0
  54. package/dist/bundle/chunks/virtual-modules-XLXFDFIX.js +2 -0
  55. package/dist/bundle/cli-runtime.js +1 -1
  56. package/dist/bundle/index.js +1 -1
  57. package/dist/bundle/rpc-entry.js +1 -1
  58. package/dist/cli/args.d.ts.map +1 -1
  59. package/dist/cli/args.js +6 -5
  60. package/dist/cli/args.js.map +1 -1
  61. package/dist/cli/auth-check.d.ts.map +1 -1
  62. package/dist/cli/auth-check.js.map +1 -1
  63. package/dist/cli/auth-command.d.ts.map +1 -1
  64. package/dist/cli/auth-command.js.map +1 -1
  65. package/dist/cli/config-selector.d.ts.map +1 -1
  66. package/dist/cli/config-selector.js.map +1 -1
  67. package/dist/cli/credential-print.d.ts.map +1 -1
  68. package/dist/cli/credential-print.js.map +1 -1
  69. package/dist/cli/file-processor.d.ts.map +1 -1
  70. package/dist/cli/file-processor.js.map +1 -1
  71. package/dist/cli/initial-message.d.ts +1 -1
  72. package/dist/cli/initial-message.d.ts.map +1 -1
  73. package/dist/cli/initial-message.js.map +1 -1
  74. package/dist/cli/list-models.d.ts.map +1 -1
  75. package/dist/cli/list-models.js.map +1 -1
  76. package/dist/cli/project-trust.d.ts.map +1 -1
  77. package/dist/cli/project-trust.js.map +1 -1
  78. package/dist/cli/session-picker.d.ts.map +1 -1
  79. package/dist/cli/session-picker.js.map +1 -1
  80. package/dist/cli/setup.d.ts.map +1 -1
  81. package/dist/cli/setup.js.map +1 -1
  82. package/dist/cli/startup-ui.d.ts.map +1 -1
  83. package/dist/cli/startup-ui.js +38 -30
  84. package/dist/cli/startup-ui.js.map +1 -1
  85. package/dist/cli.d.ts.map +1 -1
  86. package/dist/config.d.ts +15 -4
  87. package/dist/config.d.ts.map +1 -1
  88. package/dist/config.js +33 -4
  89. package/dist/config.js.map +1 -1
  90. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  91. package/dist/core/agent-session-runtime.js +1 -1
  92. package/dist/core/agent-session-runtime.js.map +1 -1
  93. package/dist/core/agent-session-services.d.ts.map +1 -1
  94. package/dist/core/agent-session-services.js +13 -0
  95. package/dist/core/agent-session-services.js.map +1 -1
  96. package/dist/core/agent-session.d.ts +133 -12
  97. package/dist/core/agent-session.d.ts.map +1 -1
  98. package/dist/core/agent-session.js +598 -297
  99. package/dist/core/agent-session.js.map +1 -1
  100. package/dist/core/auth-guidance.d.ts.map +1 -1
  101. package/dist/core/auth-guidance.js.map +1 -1
  102. package/dist/core/auth-storage.d.ts.map +1 -1
  103. package/dist/core/auth-storage.js.map +1 -1
  104. package/dist/core/bash-executor.d.ts.map +1 -1
  105. package/dist/core/bash-executor.js.map +1 -1
  106. package/dist/core/bug-report-upload.d.ts.map +1 -1
  107. package/dist/core/bug-report-upload.js.map +1 -1
  108. package/dist/core/bug-report.d.ts +1 -1
  109. package/dist/core/bug-report.d.ts.map +1 -1
  110. package/dist/core/bug-report.js +1 -1
  111. package/dist/core/bug-report.js.map +1 -1
  112. package/dist/core/cache-stats.d.ts.map +1 -1
  113. package/dist/core/cache-stats.js.map +1 -1
  114. package/dist/core/cache-warmer.d.ts.map +1 -1
  115. package/dist/core/cache-warmer.js.map +1 -1
  116. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  117. package/dist/core/compaction/branch-summarization.js.map +1 -1
  118. package/dist/core/compaction/compaction.d.ts.map +1 -1
  119. package/dist/core/compaction/compaction.js +1 -22
  120. package/dist/core/compaction/compaction.js.map +1 -1
  121. package/dist/core/compaction/index.d.ts.map +1 -1
  122. package/dist/core/compaction/utils.d.ts +2 -1
  123. package/dist/core/compaction/utils.d.ts.map +1 -1
  124. package/dist/core/compaction/utils.js +25 -18
  125. package/dist/core/compaction/utils.js.map +1 -1
  126. package/dist/core/crash-log.d.ts.map +1 -1
  127. package/dist/core/crash-log.js +2 -1
  128. package/dist/core/crash-log.js.map +1 -1
  129. package/dist/core/defaults.d.ts.map +1 -1
  130. package/dist/core/diagnostics.d.ts.map +1 -1
  131. package/dist/core/event-bus.d.ts.map +1 -1
  132. package/dist/core/event-bus.js.map +1 -1
  133. package/dist/core/exec.d.ts.map +1 -1
  134. package/dist/core/exec.js.map +1 -1
  135. package/dist/core/experimental.d.ts.map +1 -1
  136. package/dist/core/experimental.js.map +1 -1
  137. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  138. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  139. package/dist/core/export-html/index.d.ts.map +1 -1
  140. package/dist/core/export-html/index.js.map +1 -1
  141. package/dist/core/export-html/template.css +10 -0
  142. package/dist/core/export-html/template.js +66 -17
  143. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  144. package/dist/core/export-html/tool-renderer.js.map +1 -1
  145. package/dist/core/extensions/index.d.ts +1 -1
  146. package/dist/core/extensions/index.d.ts.map +1 -1
  147. package/dist/core/extensions/index.js.map +1 -1
  148. package/dist/core/extensions/jiti-loader.d.ts.map +1 -1
  149. package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -1
  150. package/dist/core/extensions/loader.d.ts.map +1 -1
  151. package/dist/core/extensions/loader.js +67 -5
  152. package/dist/core/extensions/loader.js.map +1 -1
  153. package/dist/core/extensions/runner.d.ts +18 -1
  154. package/dist/core/extensions/runner.d.ts.map +1 -1
  155. package/dist/core/extensions/runner.js +99 -0
  156. package/dist/core/extensions/runner.js.map +1 -1
  157. package/dist/core/extensions/types.d.ts +301 -22
  158. package/dist/core/extensions/types.d.ts.map +1 -1
  159. package/dist/core/extensions/types.js.map +1 -1
  160. package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
  161. package/dist/core/extensions/wrapper.d.ts +2 -2
  162. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  163. package/dist/core/extensions/wrapper.js +3 -3
  164. package/dist/core/extensions/wrapper.js.map +1 -1
  165. package/dist/core/footer-data-provider.d.ts.map +1 -1
  166. package/dist/core/footer-data-provider.js.map +1 -1
  167. package/dist/core/http-dispatcher.d.ts.map +1 -1
  168. package/dist/core/http-dispatcher.js.map +1 -1
  169. package/dist/core/index.d.ts.map +1 -1
  170. package/dist/core/keybindings.d.ts +1 -1
  171. package/dist/core/keybindings.d.ts.map +1 -1
  172. package/dist/core/keybindings.js +1 -1
  173. package/dist/core/keybindings.js.map +1 -1
  174. package/dist/core/mcp-servers.d.ts +125 -0
  175. package/dist/core/mcp-servers.d.ts.map +1 -0
  176. package/dist/core/mcp-servers.js +198 -0
  177. package/dist/core/mcp-servers.js.map +1 -0
  178. package/dist/core/messages.d.ts.map +1 -1
  179. package/dist/core/messages.js.map +1 -1
  180. package/dist/core/model-config.d.ts.map +1 -1
  181. package/dist/core/model-config.js.map +1 -1
  182. package/dist/core/model-registry.d.ts +15 -1
  183. package/dist/core/model-registry.d.ts.map +1 -1
  184. package/dist/core/model-registry.js +29 -0
  185. package/dist/core/model-registry.js.map +1 -1
  186. package/dist/core/model-resolver.d.ts +2 -2
  187. package/dist/core/model-resolver.d.ts.map +1 -1
  188. package/dist/core/model-resolver.js +5 -5
  189. package/dist/core/model-resolver.js.map +1 -1
  190. package/dist/core/model-runtime.d.ts +47 -3
  191. package/dist/core/model-runtime.d.ts.map +1 -1
  192. package/dist/core/model-runtime.js +189 -35
  193. package/dist/core/model-runtime.js.map +1 -1
  194. package/dist/core/models-store.d.ts.map +1 -1
  195. package/dist/core/models-store.js.map +1 -1
  196. package/dist/core/nested-tool-calls.d.ts +102 -0
  197. package/dist/core/nested-tool-calls.d.ts.map +1 -0
  198. package/dist/core/nested-tool-calls.js +178 -0
  199. package/dist/core/nested-tool-calls.js.map +1 -0
  200. package/dist/core/output-guard.d.ts.map +1 -1
  201. package/dist/core/output-guard.js.map +1 -1
  202. package/dist/core/package-manager.d.ts +4 -0
  203. package/dist/core/package-manager.d.ts.map +1 -1
  204. package/dist/core/package-manager.js +59 -12
  205. package/dist/core/package-manager.js.map +1 -1
  206. package/dist/core/pi-client-cli-adapter.d.ts.map +1 -1
  207. package/dist/core/pi-client-cli-adapter.js.map +1 -1
  208. package/dist/core/pi-client-runtime-update.d.ts.map +1 -1
  209. package/dist/core/pi-client-runtime-update.js.map +1 -1
  210. package/dist/core/pi-manifest.d.ts.map +1 -1
  211. package/dist/core/pi-manifest.js.map +1 -1
  212. package/dist/core/pi-server-client.d.ts.map +1 -1
  213. package/dist/core/pi-server-client.js.map +1 -1
  214. package/dist/core/pi-server-protocol.d.ts.map +1 -1
  215. package/dist/core/pi-server-protocol.js.map +1 -1
  216. package/dist/core/pi-server-request.d.ts.map +1 -1
  217. package/dist/core/pi-server-request.js.map +1 -1
  218. package/dist/core/project-trust.d.ts.map +1 -1
  219. package/dist/core/project-trust.js.map +1 -1
  220. package/dist/core/prompt-templates.d.ts.map +1 -1
  221. package/dist/core/prompt-templates.js.map +1 -1
  222. package/dist/core/provider-attribution.d.ts.map +1 -1
  223. package/dist/core/provider-attribution.js.map +1 -1
  224. package/dist/core/provider-composer.d.ts +40 -21
  225. package/dist/core/provider-composer.d.ts.map +1 -1
  226. package/dist/core/provider-composer.js +92 -40
  227. package/dist/core/provider-composer.js.map +1 -1
  228. package/dist/core/radius.d.ts +2 -0
  229. package/dist/core/radius.d.ts.map +1 -1
  230. package/dist/core/radius.js +2 -0
  231. package/dist/core/radius.js.map +1 -1
  232. package/dist/core/remote-catalog-provider.d.ts +8 -1
  233. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  234. package/dist/core/remote-catalog-provider.js +21 -11
  235. package/dist/core/remote-catalog-provider.js.map +1 -1
  236. package/dist/core/resolve-config-value.d.ts.map +1 -1
  237. package/dist/core/resolve-config-value.js.map +1 -1
  238. package/dist/core/resource-loader.d.ts +7 -1
  239. package/dist/core/resource-loader.d.ts.map +1 -1
  240. package/dist/core/resource-loader.js +161 -35
  241. package/dist/core/resource-loader.js.map +1 -1
  242. package/dist/core/runtime-credentials.d.ts.map +1 -1
  243. package/dist/core/runtime-credentials.js.map +1 -1
  244. package/dist/core/sdk.d.ts +1 -1
  245. package/dist/core/sdk.d.ts.map +1 -1
  246. package/dist/core/sdk.js +25 -6
  247. package/dist/core/sdk.js.map +1 -1
  248. package/dist/core/session-cwd.d.ts.map +1 -1
  249. package/dist/core/session-cwd.js.map +1 -1
  250. package/dist/core/session-export.d.ts.map +1 -1
  251. package/dist/core/session-export.js.map +1 -1
  252. package/dist/core/session-manager.d.ts +9 -0
  253. package/dist/core/session-manager.d.ts.map +1 -1
  254. package/dist/core/session-manager.js +22 -22
  255. package/dist/core/session-manager.js.map +1 -1
  256. package/dist/core/settings-diagnostics.d.ts.map +1 -1
  257. package/dist/core/settings-diagnostics.js.map +1 -1
  258. package/dist/core/settings-manager.d.ts +36 -4
  259. package/dist/core/settings-manager.d.ts.map +1 -1
  260. package/dist/core/settings-manager.js +75 -4
  261. package/dist/core/settings-manager.js.map +1 -1
  262. package/dist/core/skills.d.ts.map +1 -1
  263. package/dist/core/skills.js.map +1 -1
  264. package/dist/core/slash-commands.d.ts.map +1 -1
  265. package/dist/core/source-info.d.ts +8 -0
  266. package/dist/core/source-info.d.ts.map +1 -1
  267. package/dist/core/source-info.js +16 -0
  268. package/dist/core/source-info.js.map +1 -1
  269. package/dist/core/system-prompt.d.ts.map +1 -1
  270. package/dist/core/system-prompt.js +1 -1
  271. package/dist/core/system-prompt.js.map +1 -1
  272. package/dist/core/telemetry.d.ts.map +1 -1
  273. package/dist/core/telemetry.js.map +1 -1
  274. package/dist/core/timings.d.ts.map +1 -1
  275. package/dist/core/timings.js.map +1 -1
  276. package/dist/core/tools/bash.d.ts +12 -0
  277. package/dist/core/tools/bash.d.ts.map +1 -1
  278. package/dist/core/tools/bash.js +33 -2
  279. package/dist/core/tools/bash.js.map +1 -1
  280. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  281. package/dist/core/tools/edit-diff.js.map +1 -1
  282. package/dist/core/tools/edit.d.ts.map +1 -1
  283. package/dist/core/tools/edit.js.map +1 -1
  284. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
  285. package/dist/core/tools/file-mutation-queue.js.map +1 -1
  286. package/dist/core/tools/find.d.ts.map +1 -1
  287. package/dist/core/tools/find.js.map +1 -1
  288. package/dist/core/tools/grep.d.ts.map +1 -1
  289. package/dist/core/tools/grep.js.map +1 -1
  290. package/dist/core/tools/index.d.ts.map +1 -1
  291. package/dist/core/tools/index.js.map +1 -1
  292. package/dist/core/tools/ls.d.ts.map +1 -1
  293. package/dist/core/tools/ls.js.map +1 -1
  294. package/dist/core/tools/output-accumulator.d.ts +11 -0
  295. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  296. package/dist/core/tools/output-accumulator.js +36 -0
  297. package/dist/core/tools/output-accumulator.js.map +1 -1
  298. package/dist/core/tools/path-utils.d.ts.map +1 -1
  299. package/dist/core/tools/path-utils.js.map +1 -1
  300. package/dist/core/tools/powershell.d.ts.map +1 -1
  301. package/dist/core/tools/powershell.js.map +1 -1
  302. package/dist/core/tools/read.d.ts.map +1 -1
  303. package/dist/core/tools/read.js.map +1 -1
  304. package/dist/core/tools/render-utils.d.ts +6 -0
  305. package/dist/core/tools/render-utils.d.ts.map +1 -1
  306. package/dist/core/tools/render-utils.js +26 -0
  307. package/dist/core/tools/render-utils.js.map +1 -1
  308. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  309. package/dist/core/tools/renderers/bash.js +11 -32
  310. package/dist/core/tools/renderers/bash.js.map +1 -1
  311. package/dist/core/tools/renderers/edit.d.ts.map +1 -1
  312. package/dist/core/tools/renderers/edit.js.map +1 -1
  313. package/dist/core/tools/renderers/find.d.ts.map +1 -1
  314. package/dist/core/tools/renderers/find.js.map +1 -1
  315. package/dist/core/tools/renderers/grep.d.ts.map +1 -1
  316. package/dist/core/tools/renderers/grep.js.map +1 -1
  317. package/dist/core/tools/renderers/index.d.ts.map +1 -1
  318. package/dist/core/tools/renderers/index.js.map +1 -1
  319. package/dist/core/tools/renderers/ls.d.ts.map +1 -1
  320. package/dist/core/tools/renderers/ls.js.map +1 -1
  321. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  322. package/dist/core/tools/renderers/read.js +3 -2
  323. package/dist/core/tools/renderers/read.js.map +1 -1
  324. package/dist/core/tools/renderers/write.d.ts.map +1 -1
  325. package/dist/core/tools/renderers/write.js.map +1 -1
  326. package/dist/core/tools/tool-definition-wrapper.d.ts +5 -3
  327. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  328. package/dist/core/tools/tool-definition-wrapper.js +3 -1
  329. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  330. package/dist/core/tools/truncate.d.ts +14 -0
  331. package/dist/core/tools/truncate.d.ts.map +1 -1
  332. package/dist/core/tools/truncate.js +29 -0
  333. package/dist/core/tools/truncate.js.map +1 -1
  334. package/dist/core/tools/write.d.ts.map +1 -1
  335. package/dist/core/tools/write.js.map +1 -1
  336. package/dist/core/trust-manager.d.ts.map +1 -1
  337. package/dist/core/trust-manager.js +1 -0
  338. package/dist/core/trust-manager.js.map +1 -1
  339. package/dist/core/usage-totals.d.ts +2 -0
  340. package/dist/core/usage-totals.d.ts.map +1 -1
  341. package/dist/core/usage-totals.js +23 -0
  342. package/dist/core/usage-totals.js.map +1 -1
  343. package/dist/core/virtual-models.d.ts +117 -0
  344. package/dist/core/virtual-models.d.ts.map +1 -0
  345. package/dist/core/virtual-models.js +124 -0
  346. package/dist/core/virtual-models.js.map +1 -0
  347. package/dist/extensions/codemode/execute.d.ts +16 -0
  348. package/dist/extensions/codemode/execute.d.ts.map +1 -0
  349. package/dist/extensions/codemode/execute.js +536 -0
  350. package/dist/extensions/codemode/execute.js.map +1 -0
  351. package/dist/extensions/codemode/execute.lazy.d.ts +3 -0
  352. package/dist/extensions/codemode/execute.lazy.d.ts.map +1 -0
  353. package/dist/extensions/codemode/execute.lazy.js +3 -0
  354. package/dist/extensions/codemode/execute.lazy.js.map +1 -0
  355. package/dist/extensions/codemode/index.d.ts +21 -0
  356. package/dist/extensions/codemode/index.d.ts.map +1 -0
  357. package/dist/extensions/codemode/index.js +31 -0
  358. package/dist/extensions/codemode/index.js.map +1 -0
  359. package/dist/extensions/codemode/renderer.d.ts +12 -0
  360. package/dist/extensions/codemode/renderer.d.ts.map +1 -0
  361. package/dist/extensions/codemode/renderer.js +137 -0
  362. package/dist/extensions/codemode/renderer.js.map +1 -0
  363. package/dist/extensions/codemode/tool.d.ts +123 -0
  364. package/dist/extensions/codemode/tool.d.ts.map +1 -0
  365. package/dist/extensions/codemode/tool.js +268 -0
  366. package/dist/extensions/codemode/tool.js.map +1 -0
  367. package/dist/extensions/codemode/worker.d.ts +7 -0
  368. package/dist/extensions/codemode/worker.d.ts.map +1 -0
  369. package/dist/extensions/codemode/worker.js +7 -0
  370. package/dist/extensions/codemode/worker.js.map +1 -0
  371. package/dist/extensions/index.d.ts.map +1 -1
  372. package/dist/extensions/index.js +11 -1
  373. package/dist/extensions/index.js.map +1 -1
  374. package/dist/extensions/llama/client.d.ts.map +1 -1
  375. package/dist/extensions/llama/client.js.map +1 -1
  376. package/dist/extensions/llama/huggingface.d.ts.map +1 -1
  377. package/dist/extensions/llama/huggingface.js.map +1 -1
  378. package/dist/extensions/llama/index.d.ts.map +1 -1
  379. package/dist/extensions/llama/index.js.map +1 -1
  380. package/dist/extensions/llama/provider.d.ts +1 -1
  381. package/dist/extensions/llama/provider.d.ts.map +1 -1
  382. package/dist/extensions/llama/provider.js +65 -13
  383. package/dist/extensions/llama/provider.js.map +1 -1
  384. package/dist/extensions/llama/ui.d.ts.map +1 -1
  385. package/dist/extensions/llama/ui.js.map +1 -1
  386. package/dist/extensions/mcp/cli.d.ts +21 -0
  387. package/dist/extensions/mcp/cli.d.ts.map +1 -0
  388. package/dist/extensions/mcp/cli.js +500 -0
  389. package/dist/extensions/mcp/cli.js.map +1 -0
  390. package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
  391. package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
  392. package/dist/extensions/mcp/cli.lazy.js +3 -0
  393. package/dist/extensions/mcp/cli.lazy.js.map +1 -0
  394. package/dist/extensions/mcp/config.d.ts +72 -0
  395. package/dist/extensions/mcp/config.d.ts.map +1 -0
  396. package/dist/extensions/mcp/config.js +158 -0
  397. package/dist/extensions/mcp/config.js.map +1 -0
  398. package/dist/extensions/mcp/index.d.ts +76 -0
  399. package/dist/extensions/mcp/index.d.ts.map +1 -0
  400. package/dist/extensions/mcp/index.js +1066 -0
  401. package/dist/extensions/mcp/index.js.map +1 -0
  402. package/dist/extensions/mcp/log.d.ts +16 -0
  403. package/dist/extensions/mcp/log.d.ts.map +1 -0
  404. package/dist/extensions/mcp/log.js +66 -0
  405. package/dist/extensions/mcp/log.js.map +1 -0
  406. package/dist/extensions/mcp/oauth.d.ts +97 -0
  407. package/dist/extensions/mcp/oauth.d.ts.map +1 -0
  408. package/dist/extensions/mcp/oauth.js +358 -0
  409. package/dist/extensions/mcp/oauth.js.map +1 -0
  410. package/dist/extensions/mcp/resources.d.ts +43 -0
  411. package/dist/extensions/mcp/resources.d.ts.map +1 -0
  412. package/dist/extensions/mcp/resources.js +262 -0
  413. package/dist/extensions/mcp/resources.js.map +1 -0
  414. package/dist/extensions/mcp/runtime.d.ts +98 -0
  415. package/dist/extensions/mcp/runtime.d.ts.map +1 -0
  416. package/dist/extensions/mcp/runtime.js +395 -0
  417. package/dist/extensions/mcp/runtime.js.map +1 -0
  418. package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
  419. package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
  420. package/dist/extensions/mcp/runtime.lazy.js +3 -0
  421. package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
  422. package/dist/extensions/mcp/tools.d.ts +84 -0
  423. package/dist/extensions/mcp/tools.d.ts.map +1 -0
  424. package/dist/extensions/mcp/tools.js +251 -0
  425. package/dist/extensions/mcp/tools.js.map +1 -0
  426. package/dist/extensions/mcp/ui.d.ts +60 -0
  427. package/dist/extensions/mcp/ui.d.ts.map +1 -0
  428. package/dist/extensions/mcp/ui.js +174 -0
  429. package/dist/extensions/mcp/ui.js.map +1 -0
  430. package/dist/extensions/tool-search/index.d.ts +12 -0
  431. package/dist/extensions/tool-search/index.d.ts.map +1 -0
  432. package/dist/extensions/tool-search/index.js +15 -0
  433. package/dist/extensions/tool-search/index.js.map +1 -0
  434. package/dist/extensions/tool-search/tool.d.ts +73 -0
  435. package/dist/extensions/tool-search/tool.d.ts.map +1 -0
  436. package/dist/extensions/tool-search/tool.js +189 -0
  437. package/dist/extensions/tool-search/tool.js.map +1 -0
  438. package/dist/index.d.ts +10 -3
  439. package/dist/index.d.ts.map +1 -1
  440. package/dist/index.js +5 -0
  441. package/dist/index.js.map +1 -1
  442. package/dist/main.d.ts.map +1 -1
  443. package/dist/main.js +16 -0
  444. package/dist/main.js.map +1 -1
  445. package/dist/migrations.d.ts.map +1 -1
  446. package/dist/migrations.js.map +1 -1
  447. package/dist/modes/index.d.ts.map +1 -1
  448. package/dist/modes/interactive/bug-report.d.ts.map +1 -1
  449. package/dist/modes/interactive/bug-report.js.map +1 -1
  450. package/dist/modes/interactive/chat-viewport.d.ts.map +1 -1
  451. package/dist/modes/interactive/chat-viewport.js.map +1 -1
  452. package/dist/modes/interactive/components/armin.d.ts.map +1 -1
  453. package/dist/modes/interactive/components/armin.js.map +1 -1
  454. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  455. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  456. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  457. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  458. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
  459. package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
  460. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  461. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  462. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  463. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  464. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  465. package/dist/modes/interactive/components/config-selector.js +13 -3
  466. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  467. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
  468. package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
  469. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  470. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  471. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  472. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  473. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  474. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  475. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
  476. package/dist/modes/interactive/components/daxnuts.js.map +1 -1
  477. package/dist/modes/interactive/components/diff.d.ts.map +1 -1
  478. package/dist/modes/interactive/components/diff.js.map +1 -1
  479. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
  480. package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
  481. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
  482. package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
  483. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  484. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  485. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
  486. package/dist/modes/interactive/components/extension-input.js.map +1 -1
  487. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  488. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  489. package/dist/modes/interactive/components/first-time-setup.d.ts +4 -4
  490. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
  491. package/dist/modes/interactive/components/first-time-setup.js +8 -2
  492. package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
  493. package/dist/modes/interactive/components/footer.d.ts +7 -0
  494. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  495. package/dist/modes/interactive/components/footer.js +43 -3
  496. package/dist/modes/interactive/components/footer.js.map +1 -1
  497. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  498. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  499. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  500. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  501. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  502. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
  503. package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
  504. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  505. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  506. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  507. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  508. package/dist/modes/interactive/components/oauth-selector.d.ts +8 -2
  509. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  510. package/dist/modes/interactive/components/oauth-selector.js +24 -21
  511. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  512. package/dist/modes/interactive/components/pi-logo-animation.d.ts +68 -0
  513. package/dist/modes/interactive/components/pi-logo-animation.d.ts.map +1 -0
  514. package/dist/modes/interactive/components/pi-logo-animation.js +1086 -0
  515. package/dist/modes/interactive/components/pi-logo-animation.js.map +1 -0
  516. package/dist/modes/interactive/components/pi-logo-animation.lazy.d.ts +7 -0
  517. package/dist/modes/interactive/components/pi-logo-animation.lazy.d.ts.map +1 -0
  518. package/dist/modes/interactive/components/pi-logo-animation.lazy.js +12 -0
  519. package/dist/modes/interactive/components/pi-logo-animation.lazy.js.map +1 -0
  520. package/dist/modes/interactive/components/pi-logo.d.ts +19 -0
  521. package/dist/modes/interactive/components/pi-logo.d.ts.map +1 -0
  522. package/dist/modes/interactive/components/pi-logo.js +37 -0
  523. package/dist/modes/interactive/components/pi-logo.js.map +1 -0
  524. package/dist/modes/interactive/components/radius-login-selector.d.ts +15 -0
  525. package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -0
  526. package/dist/modes/interactive/components/radius-login-selector.js +85 -0
  527. package/dist/modes/interactive/components/radius-login-selector.js.map +1 -0
  528. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  529. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  530. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  531. package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  532. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  533. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  534. package/dist/modes/interactive/components/settings-selector.d.ts +6 -4
  535. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  536. package/dist/modes/interactive/components/settings-selector.js +33 -11
  537. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  538. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  539. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  540. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
  541. package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
  542. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  543. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  544. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  545. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  546. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
  547. package/dist/modes/interactive/components/theme-selector.js.map +1 -1
  548. package/dist/modes/interactive/components/themed-text.d.ts +17 -0
  549. package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
  550. package/dist/modes/interactive/components/themed-text.js +29 -0
  551. package/dist/modes/interactive/components/themed-text.js.map +1 -0
  552. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  553. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  554. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  555. package/dist/modes/interactive/components/tool-execution.js +2 -2
  556. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  557. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  558. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  559. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
  560. package/dist/modes/interactive/components/trust-selector.js.map +1 -1
  561. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  562. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  563. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  564. package/dist/modes/interactive/components/user-message.js +5 -4
  565. package/dist/modes/interactive/components/user-message.js.map +1 -1
  566. package/dist/modes/interactive/components/visual-truncate.d.ts +27 -3
  567. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  568. package/dist/modes/interactive/components/visual-truncate.js +39 -6
  569. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  570. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  571. package/dist/modes/interactive/external-editor.js.map +1 -1
  572. package/dist/modes/interactive/interactive-mode.d.ts +21 -0
  573. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  574. package/dist/modes/interactive/interactive-mode.js +348 -197
  575. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  576. package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -1
  577. package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
  578. package/dist/modes/interactive/model-search.d.ts.map +1 -1
  579. package/dist/modes/interactive/model-search.js.map +1 -1
  580. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  581. package/dist/modes/interactive/session-share.js.map +1 -1
  582. package/dist/modes/interactive/theme/dark.json +59 -72
  583. package/dist/modes/interactive/theme/light.json +57 -69
  584. package/dist/modes/interactive/theme/system-theme.d.ts +55 -0
  585. package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
  586. package/dist/modes/interactive/theme/system-theme.js +546 -0
  587. package/dist/modes/interactive/theme/system-theme.js.map +1 -0
  588. package/dist/modes/interactive/theme/theme-controller.d.ts +46 -6
  589. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  590. package/dist/modes/interactive/theme/theme-controller.js +127 -47
  591. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  592. package/dist/modes/interactive/theme/theme-json.d.ts +1 -0
  593. package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -1
  594. package/dist/modes/interactive/theme/theme-json.js +3 -1
  595. package/dist/modes/interactive/theme/theme-json.js.map +1 -1
  596. package/dist/modes/interactive/theme/theme-schema.json +7 -2
  597. package/dist/modes/interactive/theme/theme.d.ts +66 -39
  598. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  599. package/dist/modes/interactive/theme/theme.js +238 -317
  600. package/dist/modes/interactive/theme/theme.js.map +1 -1
  601. package/dist/modes/interactive/tui-renderer.d.ts +2 -1
  602. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -1
  603. package/dist/modes/interactive/tui-renderer.js +1 -0
  604. package/dist/modes/interactive/tui-renderer.js.map +1 -1
  605. package/dist/modes/json-event.d.ts.map +1 -1
  606. package/dist/modes/json-event.js.map +1 -1
  607. package/dist/modes/print-mode.d.ts.map +1 -1
  608. package/dist/modes/print-mode.js.map +1 -1
  609. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  610. package/dist/modes/rpc/jsonl.js.map +1 -1
  611. package/dist/modes/rpc/rpc-client.d.ts +6 -6
  612. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  613. package/dist/modes/rpc/rpc-client.js +12 -8
  614. package/dist/modes/rpc/rpc-client.js.map +1 -1
  615. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  616. package/dist/modes/rpc/rpc-mode.js +7 -9
  617. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  618. package/dist/modes/rpc/rpc-types.d.ts +10 -1
  619. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  620. package/dist/modes/rpc/rpc-types.js.map +1 -1
  621. package/dist/package-manager-cli.d.ts.map +1 -1
  622. package/dist/package-manager-cli.js +6 -2
  623. package/dist/package-manager-cli.js.map +1 -1
  624. package/dist/pi-client-cli.d.ts.map +1 -1
  625. package/dist/pi-client-cli.js.map +1 -1
  626. package/dist/rpc-entry.d.ts.map +1 -1
  627. package/dist/rpc-entry.js.map +1 -1
  628. package/dist/utils/abort.d.ts.map +1 -1
  629. package/dist/utils/abort.js.map +1 -1
  630. package/dist/utils/ansi.d.ts.map +1 -1
  631. package/dist/utils/ansi.js.map +1 -1
  632. package/dist/utils/changelog.d.ts.map +1 -1
  633. package/dist/utils/changelog.js.map +1 -1
  634. package/dist/utils/child-process.d.ts.map +1 -1
  635. package/dist/utils/child-process.js.map +1 -1
  636. package/dist/utils/clipboard-command.d.ts.map +1 -1
  637. package/dist/utils/clipboard-command.js.map +1 -1
  638. package/dist/utils/clipboard-image.d.ts.map +1 -1
  639. package/dist/utils/clipboard-image.js +14 -17
  640. package/dist/utils/clipboard-image.js.map +1 -1
  641. package/dist/utils/clipboard.d.ts +2 -0
  642. package/dist/utils/clipboard.d.ts.map +1 -1
  643. package/dist/utils/clipboard.js +5 -0
  644. package/dist/utils/clipboard.js.map +1 -1
  645. package/dist/utils/deprecation.d.ts.map +1 -1
  646. package/dist/utils/deprecation.js.map +1 -1
  647. package/dist/utils/exif-orientation.d.ts.map +1 -1
  648. package/dist/utils/exif-orientation.js.map +1 -1
  649. package/dist/utils/frontmatter.d.ts.map +1 -1
  650. package/dist/utils/frontmatter.js.map +1 -1
  651. package/dist/utils/fs-watch.d.ts.map +1 -1
  652. package/dist/utils/fs-watch.js.map +1 -1
  653. package/dist/utils/git.d.ts.map +1 -1
  654. package/dist/utils/git.js.map +1 -1
  655. package/dist/utils/html.d.ts.map +1 -1
  656. package/dist/utils/html.js.map +1 -1
  657. package/dist/utils/image-convert.d.ts.map +1 -1
  658. package/dist/utils/image-convert.js.map +1 -1
  659. package/dist/utils/image-process.d.ts.map +1 -1
  660. package/dist/utils/image-process.js.map +1 -1
  661. package/dist/utils/image-resize-core.d.ts.map +1 -1
  662. package/dist/utils/image-resize-core.js.map +1 -1
  663. package/dist/utils/image-resize-worker.d.ts.map +1 -1
  664. package/dist/utils/image-resize-worker.js.map +1 -1
  665. package/dist/utils/image-resize.d.ts.map +1 -1
  666. package/dist/utils/image-resize.js.map +1 -1
  667. package/dist/utils/json.d.ts.map +1 -1
  668. package/dist/utils/json.js.map +1 -1
  669. package/dist/utils/management-http.d.ts.map +1 -1
  670. package/dist/utils/management-http.js.map +1 -1
  671. package/dist/utils/mime.d.ts.map +1 -1
  672. package/dist/utils/mime.js.map +1 -1
  673. package/dist/utils/open-browser.d.ts.map +1 -1
  674. package/dist/utils/open-browser.js.map +1 -1
  675. package/dist/utils/paths.d.ts +3 -3
  676. package/dist/utils/paths.d.ts.map +1 -1
  677. package/dist/utils/paths.js +5 -4
  678. package/dist/utils/paths.js.map +1 -1
  679. package/dist/utils/photon.d.ts.map +1 -1
  680. package/dist/utils/photon.js.map +1 -1
  681. package/dist/utils/pi-user-agent.d.ts.map +1 -1
  682. package/dist/utils/pi-user-agent.js.map +1 -1
  683. package/dist/utils/shell.d.ts +1 -3
  684. package/dist/utils/shell.d.ts.map +1 -1
  685. package/dist/utils/shell.js +3 -30
  686. package/dist/utils/shell.js.map +1 -1
  687. package/dist/utils/sleep.d.ts.map +1 -1
  688. package/dist/utils/sleep.js.map +1 -1
  689. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  690. package/dist/utils/syntax-highlight.js +2 -0
  691. package/dist/utils/syntax-highlight.js.map +1 -1
  692. package/dist/utils/text.d.ts.map +1 -1
  693. package/dist/utils/text.js.map +1 -1
  694. package/dist/utils/tool-result-images.d.ts.map +1 -1
  695. package/dist/utils/tool-result-images.js.map +1 -1
  696. package/dist/utils/tools-manager.d.ts.map +1 -1
  697. package/dist/utils/tools-manager.js.map +1 -1
  698. package/dist/utils/version-check.d.ts.map +1 -1
  699. package/dist/utils/version-check.js.map +1 -1
  700. package/dist/utils/windows-self-update.d.ts.map +1 -1
  701. package/dist/utils/windows-self-update.js.map +1 -1
  702. package/dist/utils/wsl.d.ts.map +1 -1
  703. package/dist/utils/wsl.js.map +1 -1
  704. package/dist/utils/zip.d.ts.map +1 -1
  705. package/dist/utils/zip.js.map +1 -1
  706. package/docs/cli.md +58 -7
  707. package/docs/codemode.md +207 -0
  708. package/docs/configuration.md +2 -0
  709. package/docs/custom-provider.md +43 -4
  710. package/docs/docs.json +13 -1
  711. package/docs/environment-variables.md +2 -2
  712. package/docs/extensions.md +55 -0
  713. package/docs/index.md +1 -1
  714. package/docs/keybindings.md +1 -1
  715. package/docs/llama-cpp.md +13 -0
  716. package/docs/mcp.md +248 -0
  717. package/docs/models.md +57 -1
  718. package/docs/packages.md +4 -2
  719. package/docs/providers.md +19 -6
  720. package/docs/rpc-commands.md +9 -3
  721. package/docs/rpc.md +3 -1
  722. package/docs/sdk.md +8 -3
  723. package/docs/security.md +2 -0
  724. package/docs/session-format.md +5 -1
  725. package/docs/settings.md +24 -5
  726. package/docs/themes.md +33 -7
  727. package/docs/tui.md +18 -0
  728. package/docs/usage.md +1 -1
  729. package/docs/virtual-models.md +114 -0
  730. package/docs/windows.md +2 -0
  731. package/examples/README.md +1 -1
  732. package/examples/extensions/README.md +2 -0
  733. package/examples/extensions/built-in-tool-renderer.ts +16 -40
  734. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  735. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  736. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  737. package/examples/extensions/custom-provider-gitlab-duo/test.ts +5 -5
  738. package/examples/extensions/debug-provider.ts +90 -0
  739. package/examples/extensions/gondolin/package-lock.json +2 -2
  740. package/examples/extensions/gondolin/package.json +1 -1
  741. package/examples/extensions/jev-router.ts +113 -0
  742. package/examples/extensions/minimal-mode.ts +24 -96
  743. package/examples/extensions/sandbox/package-lock.json +2 -2
  744. package/examples/extensions/sandbox/package.json +1 -1
  745. package/examples/extensions/with-deps/package-lock.json +2 -2
  746. package/examples/extensions/with-deps/package.json +1 -1
  747. package/examples/rpc-client.ts +1 -1
  748. package/examples/rpc-extension-ui.ts +1 -1
  749. package/examples/sdk/14-codemode-mcp.ts +61 -0
  750. package/examples/sdk/README.md +2 -1
  751. package/package.json +14 -12
  752. package/dist/bundle/chunks/anthropic-messages-J5WXPPPC.js +0 -6
  753. package/dist/bundle/chunks/azure-openai-responses-QJ7SPP5M.js +0 -2
  754. package/dist/bundle/chunks/chunk-6R7UI4IY.js +0 -2
  755. package/dist/bundle/chunks/chunk-BZKWNWMI.js +0 -2
  756. package/dist/bundle/chunks/chunk-NUHFSC37.js +0 -25
  757. package/dist/bundle/chunks/chunk-RCZIEVGO.js +0 -11
  758. package/dist/bundle/chunks/chunk-S7SZN6Z3.js +0 -2
  759. package/dist/bundle/chunks/chunk-X2F52Z34.js +0 -1685
  760. package/dist/bundle/chunks/chunk-XNGRGP62.js +0 -2
  761. package/dist/bundle/chunks/google-generative-ai-IMS5EK2Y.js +0 -2
  762. package/dist/bundle/chunks/google-vertex-O4YJEQUW.js +0 -2
  763. package/dist/bundle/chunks/mistral-conversations-NOSQHBEY.js +0 -5
  764. package/dist/bundle/chunks/openai-responses-AH7QTG23.js +0 -2
  765. package/dist/bundle/chunks/virtual-modules-WWGGM27U.js +0 -2
@@ -80,6 +80,8 @@ Automatic retries, recovery, compaction, or queued work can continue afterward.
80
80
  | Persist non-context session data | `pi.appendEntry()` |
81
81
  | Change active tools, model, or thinking level | Session control methods on `pi` |
82
82
  | Add a model provider | `pi.registerProvider()` |
83
+ | Add an MCP server | `pi.registerMcpServer()` |
84
+ | Route each request to a model | [`pi.registerVirtualModel()`](virtual-models.md) |
83
85
  | Add terminal rendering | Renderer registration and `ctx.ui` |
84
86
  | Communicate with another extension | `pi.events` |
85
87
 
@@ -102,6 +104,12 @@ Events cover resource discovery, sessions, agent and message lifecycle, provider
102
104
 
103
105
  `message_end` can replace a finalized message while preserving its role. `tool_call` can mutate input or block execution. `tool_result` handlers compose, with each handler seeing prior changes.
104
106
 
107
+ <a id="provider_stream_event"></a>
108
+
109
+ `provider_stream_event` fires for each parsed provider stream event before Pi normalizes it. The event identifies the provider, API, and model; `event.data` is the earliest structured value available to Pi, not necessarily the original HTTP bytes or SSE frame. Treat it as read-only because mutation can affect normalization. The event is notification-only and is not persisted.
110
+
111
+ Handlers are awaited in stream order, so slow handlers delay stream consumption. Handler errors are reported without changing the provider response. See [`debug-provider.ts`](../examples/extensions/debug-provider.ts) for an opt-in viewer that groups raw events by assistant message.
112
+
105
113
  <a id="context_with_system"></a>
106
114
 
107
115
  `context` transforms conversation messages without prompt and tool system messages; Pi restores that state afterward. Use `context_with_system` only when a request-local transformation must own the complete transcript, and keep a system message at index zero.
@@ -135,14 +143,61 @@ Use sequential execution when tools share mutable in-memory state.
135
143
  File-mutating tools should wrap the complete read-modify-write operation with `withFileMutationQueue()`.
136
144
  Truncate large model-facing results and tell the model where to read the complete output.
137
145
 
146
+ Declare `outputSchema` and return a matching `structuredContent` when the result is data. The model still receives `content`; programmatic callers such as codemode scripts receive `structuredContent` instead of the text. Tools without `outputSchema` are passed to scripts as their text content. To report a failure that still carries data, return the result with `isError: true` instead of throwing: the model sees an error, and scripts still receive `structuredContent`.
147
+
148
+ A tool can run other tools with `ctx.executeTool(name, args, { signal, onUpdate })`. Nested calls go through argument validation and the `tool_call` and `tool_result` handlers like model-issued calls, and emit `tool_execution_start`, `tool_execution_update`, and `tool_execution_end`; all of these events carry `parentToolCallId`, and their `toolCallId` is assigned by pi as `<parent id>/<n>`. These ids do not appear as tool calls or tool results in the transcript. Nested calls do not add transcript entries: their results only reach the calling tool, which reports them itself, for example through `onUpdate` and `details`. The session keeps a bounded record of them (name, arguments, status, duration, error; never results) as `nestedCalls` on the calling tool's result message. It is used for compaction file lists and shown in HTML exports. Arguments over 8 KiB per call or 32 KiB per tool result are omitted, at most 256 calls are kept, and `complete: false` marks a record that lost anything. The `usage` of nested results, at every depth, is added to the calling tool's result `usage`, so a tool reports only its own usage, not that of the tools it called. `ctx.tools` lists the tools `ctx.executeTool()` can call. `tool_result` handlers that redact `content` should also replace `structuredContent`; replacing only `content` drops it.
149
+
138
150
  See [`hello.ts`](../examples/extensions/hello.ts), [`todo.ts`](../examples/extensions/todo.ts), [`dynamic-tools.ts`](../examples/extensions/dynamic-tools.ts), and [`truncated-tool.ts`](../examples/extensions/truncated-tool.ts).
139
151
 
152
+ ### Tool exposure
153
+
154
+ `exposure` controls how the model reaches a tool. "Callable" means callable from other tools through `ctx.executeTool()` (`ctx.tools`), as the `codemode` tool's scripts do:
155
+
156
+ - `direct` (default): declared to the model while active, and callable while active.
157
+ - `model-only`: declared to the model while active, never callable. Use it for tools that orchestrate other tools or ask the user.
158
+ - `codemode`: callable whenever registered, and listed by the `codemode` tool. Not declared to the model unless activated explicitly.
159
+ - `deferred`: like `codemode`, but codemode tools do not list it; `tool_search` can find and activate it.
160
+ - `hidden`: registered but unreachable. Re-register a tool with `exposure: "hidden"` to withdraw it, since tools cannot be unregistered.
161
+
162
+ `namespace: { name, description, instructions }` groups related tools, as MCP servers do. Codemode tools list a namespace under one heading with its `description`. `instructions` holds longer usage guidance; it is not listed, and codemode scripts read it with `describeNamespace(name)`.
163
+
164
+ Registering a `direct` or `model-only` tool activates it; the other exposures are not activated on registration. The active set (`pi.getActiveTools()`, `pi.setActiveTools()`) is the set of tools declared to the model. `pi.getAllTools()` reports each tool's `exposure`, `namespace`, and `annotations`.
165
+
166
+ `annotations` are hints about what a tool does, with the meaning of MCP tool annotations: `readOnlyHint`, `destructiveHint`, `idempotentHint`, and `openWorldHint`. MCP tools carry the hints their server declares. Missing hints take the MCP defaults: a tool is not read-only, and may be destructive and reach an open world. The hints are not verified, but a permission extension can use them to decide which calls to confirm. This confirms the calls Codex asks approval for:
167
+
168
+ ```typescript
169
+ pi.on("tool_call", async (event, ctx) => {
170
+ const hints = pi.getAllTools().find((tool) => tool.name === event.toolName)?.annotations;
171
+ const needsApproval =
172
+ hints?.destructiveHint === true ||
173
+ (!hints?.readOnlyHint && ((hints?.destructiveHint ?? true) || (hints?.openWorldHint ?? true)));
174
+ if (needsApproval && !(await ctx.ui.confirm("Allow tool call?", event.toolName))) {
175
+ return { block: true, reason: `${event.toolName} was not approved` };
176
+ }
177
+ });
178
+ ```
179
+
180
+ A tool that orchestrates other tools can adjust what the model sees while it is active with `prepareLoadout(loadout)`. It runs whenever the active tools change and receives the declared tools, the callable tools, and every registered tool with its exposure and namespace. It returns replacement `descriptions` for declared tools (including its own) and `hiddenDeclarations`: active tools whose declarations requests leave out while they stay active and callable. `codemode` uses only this hook, `exposure`, and `ctx.executeTool()`, so another tool can implement the same behavior under a different name.
181
+
140
182
  ### Activate tools dynamically
141
183
 
142
184
  Register every tool first, keep optional tools inactive, and use `pi.setActiveTools()` from a loader tool to select the desired active tools. Names must already be registered; unknown names are ignored.
143
185
 
144
186
  Pi records the initial prompt and tool set in the transcript's first system message, then appends tool and prompt changes before the next model request. Providers that cannot represent the transition receive a complete transcript checkpoint, which can invalidate the cached prefix.
145
187
 
188
+ ### MCP servers
189
+
190
+ `pi.registerMcpServer(name, config)` adds an MCP server for the current session. `config` has the shape of an `mcpServers` entry in [`mcp.json`](mcp.md): `command`, `args`, `env`, and `cwd` for stdio servers, `url`, `headers`, and `oauth` for HTTP servers, plus `exposure`, `toolExposure`, `description`, `enabled`, and `timeout`.
191
+
192
+ ```typescript
193
+ pi.registerMcpServer("jira", { url: "https://mcp.example.com/jira", exposure: "codemode" });
194
+ pi.unregisterMcpServer("jira");
195
+ ```
196
+
197
+ Servers registered while the extension loads connect when the session starts, together with the `mcp.json` servers; servers registered later connect right away, and `pi.unregisterMcpServer()` closes the connection and makes the server's tools unreachable. Registrations are not saved: register again on every load, for example based on the extension's own settings. A server in `mcp.json` with the same name takes precedence, and `/mcp` shows the override. Registering the same name again replaces the extension's earlier registration; names registered by another extension, invalid names, and invalid configs throw.
198
+
199
+ The built-in MCP support connects registered servers. When nothing does, because another extension replaced it (see [MCP](mcp.md#other-mcp-extensions)), each registration is reported as an extension error. Other MCP extensions can connect registered servers too: read them with `pi.getMcpServers()` on `session_start` and handle the `mcp_servers_change` event for later changes.
200
+
146
201
  <a id="extensioncontext"></a>
147
202
  <a id="extensioncommandcontext"></a>
148
203
  <a id="use-extension-context"></a>
package/docs/index.md CHANGED
@@ -30,7 +30,7 @@ Use the [Quickstart customization chooser](quickstart.md#choose-how-to-customize
30
30
 
31
31
  ## Find reference and setup information
32
32
 
33
- Use the reference pages to look up [CLI options](cli.md), [settings](settings.md), [provider authentication](providers.md), [keybindings](keybindings.md), and [environment variables](environment-variables.md).
33
+ Use the reference pages to look up [CLI options](cli.md), [settings](settings.md), [providers](providers.md), [keybindings](keybindings.md), and [environment variables](environment-variables.md).
34
34
 
35
35
  For platform-specific help, see [Terminal Setup](terminal-setup.md), [Windows](windows.md), [tmux](tmux.md), [Termux on Android](termux.md), or [Containerization](containerization.md).
36
36
 
@@ -125,7 +125,7 @@ In fullscreen mode, these actions control the transcript and take precedence ove
125
125
  | `app.exit` | `ctrl+d` | Exit (when editor empty) |
126
126
  | `app.suspend` | `ctrl+z` (None on Windows) | Suspend to background |
127
127
  | `app.editor.external` | `ctrl+g` | Open in external editor (`externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere) |
128
- | `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows and WSL) | Paste image or text from clipboard |
128
+ | `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows and WSL) | Paste files on macOS, images, or text from clipboard |
129
129
 
130
130
  On native Windows, `app.suspend` has no default because Windows terminals do not support Unix job control. If you assign it manually, Pi shows a status message instead of suspending. WSL uses the normal `ctrl+z` and `fg` behavior.
131
131
 
package/docs/llama-cpp.md CHANGED
@@ -86,6 +86,17 @@ Loaded and sleeping models appear in `/model`. Sleeping models wake automaticall
86
86
 
87
87
  If the router disconnects, `/llama` shows **Retry** and **Close**. Retry reconnects and refreshes model state without replaying the interrupted operation.
88
88
 
89
+ ## Classification
90
+
91
+ Every model listed for chat is also listed as a classifier model with the same ID and the `llama-cpp-classify` API. Classifier models answer typed `choice`, `bool`, and `score` questions about JSON state, like TypeSafe's Jev models. The model reaches them from [`codemode`](cli.md#enable-codemode) scripts, and extensions through `ctx.modelRegistry.classify()`; see [Classifier models](models.md#use-classifier-models).
92
+
93
+ The model does not generate an answer. Each question becomes one chat prompt: the state, every question of the request, the state again, and then the question with its answers under single-token labels. Labels are letters for a choice (up to 62 options), `Yes`/`No` for a bool, and digits for a score (up to 10 levels). The second copy of the state is read with the questions in view, which improved accuracy on JevBench with small models. Pi reads the probabilities of the labels as the next token and normalizes them. A choice returns every option's probability and a confidence of `(n * peak - 1) / (n - 1)`; a score returns the expected level.
94
+
95
+ - Raw label probabilities are usually overconfident. The per-request `temperature` option divides the label logits before normalizing; values above 1 soften the distribution. It changes no answer.
96
+ - Questions run one after another. Everything before the final question is the same for all questions of a request, so the server's prompt cache evaluates it once. The state appears twice, so it needs twice its size in context.
97
+ - Small models may follow instructions written inside the state. The prompt tells the model to judge the state as data, but that is not a guarantee.
98
+ - Hybrid models such as Qwen3.5 cannot rewind a partially cached prompt without context checkpoints. If each question reprocesses the whole state, start the router with `--ctx-checkpoints 32 --checkpoint-min-step 0`.
99
+
89
100
  ## Troubleshooting
90
101
 
91
102
  Check that the router is reachable:
@@ -99,3 +110,5 @@ curl http://127.0.0.1:8080/models
99
110
  - **Model missing from `/model` with `--no-models-autoload`:** Load it with `/llama` first.
100
111
  - **Load fails or uses too much memory:** Lower `-c` or unload another model.
101
112
  - **Server is not in router mode:** Start it without `--model`, `-m`, or `-hf`.
113
+
114
+ To remove the `llama.cpp` provider and `/llama`, disable `llama.cpp` under Built-in in `pi config`, or set `"extensions": ["-builtin:llama.cpp"]` in [settings](settings.md#resources).
package/docs/mcp.md ADDED
@@ -0,0 +1,248 @@
1
+ # MCP Servers
2
+
3
+ Pi connects to [Model Context Protocol](https://modelcontextprotocol.io) servers over stdio or streamable HTTP and makes their tools and resources available to the model.
4
+
5
+ ## Quick setup
6
+
7
+ Add a local stdio server, check the connection, then start Pi:
8
+
9
+ ```bash
10
+ pi mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem .
11
+ pi mcp list
12
+ pi
13
+ ```
14
+
15
+ For a remote server:
16
+
17
+ ```bash
18
+ pi mcp add docs --url https://example.com/mcp --bearer-token-env-var DOCS_TOKEN
19
+ pi mcp list
20
+ ```
21
+
22
+ These commands add user-level servers by default. Add `--local` or `-l` to write the project configuration instead:
23
+
24
+ ```bash
25
+ pi mcp add -l tools --env API_KEY='${TOOLS_KEY}' -- uvx tools-mcp
26
+ ```
27
+
28
+ Use `/mcp` inside an interactive session to inspect connections, sign in, reconnect, change exposure, or enable and disable servers. Run `/reload` after adding, removing, or changing a server outside the session.
29
+
30
+ ## Configure servers
31
+
32
+ Pi reads user-level servers from `~/.pi/agent/mcp.json` and project servers from `.pi/mcp.json`. Project configuration is read only after [project trust](security.md#understand-project-trust) is granted. A project entry replaces a user-level entry with the same name.
33
+
34
+ The format matches other MCP clients:
35
+
36
+ ```json
37
+ {
38
+ "mcpServers": {
39
+ "filesystem": {
40
+ "command": "npx",
41
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
42
+ },
43
+ "docs": {
44
+ "url": "https://example.com/mcp",
45
+ "headers": { "Authorization": "Bearer ${DOCS_TOKEN}" },
46
+ "description": "Search and read the product documentation"
47
+ }
48
+ }
49
+ }
50
+ ```
51
+
52
+ Stdio servers use `command`, `args`, `env`, and `cwd`. Relative `cwd` values resolve against the session directory. A leading `~/` in `command`, an argument, or `cwd` names the home directory.
53
+
54
+ HTTP servers use `url`, `headers`, and `oauth` (see [Authenticate with OAuth](#authenticate-with-oauth)). The legacy SSE transport is not supported.
55
+
56
+ Both server types support:
57
+
58
+ - `timeout`: per-request timeout in seconds (default 60). Progress notifications reset it.
59
+ - `enabled: false`: keep the entry without connecting to it.
60
+ - `exposure` and `toolExposure`: control how tools reach the model (see [Control tool exposure](#control-tool-exposure)).
61
+ - `description`: what the server offers, in a sentence. It lists the server in the system prompt (see [Control tool exposure](#control-tool-exposure)), tool search ranks the server's tools by it, and codemode's `describeNamespace()` returns it. Without it, the first line of the server instructions is used once the server connects.
62
+
63
+ Keep personal servers and servers with credentials in the user-level file. Use the project file only for servers the project requires, and only in trusted projects.
64
+
65
+ ### Configuration rules
66
+
67
+ - Server names may contain only letters, digits, `_`, and `-`. Tools are named `mcp__<server>__<tool>`, with every character other than letters, digits, and `_` replaced by `_`; tools of a server whose names then collide all get a hash suffix. Server names that differ only in `-` and `_` count as the same server: a second one is rejected, and a `mcp.json` server overrides a registered one.
68
+ - `type` is optional. A `command` selects stdio and a `url` selects streamable HTTP. When present, `type` must be `stdio`, `http`, or `streamable-http`.
69
+ - `sse` is rejected. Servers that document an SSE endpoint often also provide streamable HTTP, commonly at `/mcp` instead of `/sse`.
70
+ - `command` is one executable and `args` contains its arguments. It is not a shell command string.
71
+ - `env` and `headers` values can use environment variables such as `${GITHUB_TOKEN}`. They can also run a command with `!command`, but the command must make up the whole value, for example `"Authorization": "!echo Bearer $(gh auth token)"`.
72
+ - Invalid entries are reported and skipped without preventing other servers from connecting.
73
+
74
+ `pi mcp add` and `pi mcp remove` cover common changes from a shell. See [MCP commands](cli.md#mcp-commands) for their options.
75
+
76
+ ### Inspect or change a server
77
+
78
+ `/mcp` lists configured servers with their state, tool count, exposure, and configuration source. Servers that need attention appear first. Select a server to inspect its tools and connection details, reconnect, sign in or out, change exposure, or enable and disable it.
79
+
80
+ Exposure and enabled-state changes are saved to the file that defines the server without replacing unrelated content. Disabled servers remain listed. Outside the interactive TUI, `/mcp` prints server status; `/mcp login <server>`, `/mcp logout <server>`, and `/mcp reconnect <server>` perform those actions directly.
81
+
82
+ Shell commands work without a session: `pi mcp add`, `pi mcp remove`, `pi mcp list`, `pi mcp login`, and `pi mcp logout`. Shell commands do not load extensions.
83
+
84
+ ### Diagnose connection problems
85
+
86
+ Run `pi mcp list` to connect to every enabled server and print its state, tools, and errors. It exits with status 1 when an entry is invalid or an enabled server is not connected. `/mcp` shows the full connection error and the tail of stderr from a failed stdio server.
87
+
88
+ Pi reports configuration errors, failed connections, and required sign-ins once after startup. Server logging notifications are appended to `~/.pi/agent/mcp.log` as `<time> [<server>] <level> <logger>: <message>`. The file moves to `mcp.log.1` after it grows past 5 MB.
89
+
90
+ Pi connects every enabled server in the background when a session starts. A server's tools appear once it connects; the `codemode` description does not list them, so it does not change when servers connect. The first prompt waits up to 10 seconds only for servers with `direct` tools, which must be declared in its request. Other servers are waited for when they are needed: a codemode script waits for the servers it names (`mcp__<server>`) and, when it calls `searchTools()` or reads `ALL_TOOLS`, for all of them; `tool_search` and the resource tools also wait for all of them. HTTP network errors and transient statuses (408, 429, and 5xx) are retried twice. A dropped connection is shown as disconnected and reconnects on the next call. When a server announces a changed tool list, new tools are added and withdrawn tools become unreachable.
91
+
92
+ Stopping a stdio server closes its stdin, sends SIGTERM, then sends SIGKILL to its process group. This also stops servers launched through wrappers such as `npx` or `uvx`.
93
+
94
+ ## Migrate configuration from another client
95
+
96
+ Move the converted entry under `mcpServers` in `mcp.json`, then run `pi mcp list` to validate it.
97
+
98
+ | Client | Conversion |
99
+ |---|---|
100
+ | Claude Desktop, Claude Code, or Cursor | Copy the existing `mcpServers` entry. |
101
+ | VS Code | Move an entry from the top-level `servers` object and replace `${input:...}` prompts with `${NAME}` environment variables. |
102
+ | Codex | Convert `[mcp_servers.<name>]` TOML fields such as `command`, `args`, `env`, and `url` to JSON. |
103
+ | OpenCode | Convert `"type": "local"` to a stdio entry, split its `command` array into `command` and `args`, rename `environment` to `env`, and replace `{env:NAME}` with `${NAME}`. Convert `"type": "remote"` to a URL entry. |
104
+
105
+ ## Authenticate with OAuth
106
+
107
+ Remote servers that use OAuth, such as Sentry, need no credentials in `mcp.json`:
108
+
109
+ ```json
110
+ {
111
+ "mcpServers": {
112
+ "sentry": { "url": "https://mcp.sentry.dev/mcp" }
113
+ }
114
+ }
115
+ ```
116
+
117
+ When the server rejects an unauthenticated connection, `/mcp` shows that it needs sign-in. Select "Sign in", run `/mcp login sentry`, or run `pi mcp login sentry`. Pi opens the authorization page and waits for approval. If the browser runs on another machine, such as over SSH, paste its redirected URL into the sign-in screen. A running session uses the new credentials on its next turn.
118
+
119
+ Pi registers itself with the authorization server, stores tokens in `~/.pi/agent/mcp-auth.json`, and refreshes access tokens when they expire or the server rejects them. If a server later requests additional scope, Pi asks for sign-in again. Signing out deletes the stored credentials.
120
+
121
+ Credentials belong to a server name and URL. Servers with the same URL under different names, such as one per account, sign in separately; servers with the same name and URL in different `mcp.json` files share one sign-in.
122
+
123
+ OAuth applies to HTTP servers without an `Authorization` header. For a server that does not support dynamic client registration, configure a registered client:
124
+
125
+ ```json
126
+ {
127
+ "mcpServers": {
128
+ "example": {
129
+ "url": "https://mcp.example.com/mcp",
130
+ "oauth": { "clientId": "my-client", "clientSecret": "${EXAMPLE_SECRET}", "callbackPort": 8765 }
131
+ }
132
+ }
133
+ }
134
+ ```
135
+
136
+ The redirect URI must match the registered URI. `callbackPort` uses `http://127.0.0.1:<port>/callback`. To use another URI, set `callbackUrl`; it must use HTTP on `localhost`, `127.0.0.1`, or `[::1]`. Pi sends it exactly as written. When `callbackUrl` omits a port, Pi uses `callbackPort` or a free port and adds it to the URI, as allowed for loopback redirects by RFC 8252. `clientSecret` is optional and can use an environment variable or command.
137
+
138
+ Set `scope` to a space-separated list for servers that do not advertise their required scopes. Otherwise, Pi requests the advertised scopes. Later scope requests are added to the configured value.
139
+
140
+ Pi registers as `pi`. Some servers only accept registrations from known clients. Set `clientName` to send another name:
141
+
142
+ ```json
143
+ {
144
+ "mcpServers": {
145
+ "figma": { "url": "https://mcp.figma.com/mcp", "oauth": { "clientName": "Claude Code" } }
146
+ }
147
+ }
148
+ ```
149
+
150
+ The name is only sent when Pi registers a client. To register again under a new name, sign out first.
151
+
152
+ Pi finds the authorization server through the server's protected resource metadata (RFC 9728) and checks that the authorization server's metadata names the expected issuer (RFC 8414). Some servers advertise the wrong authorization server or none, so sign-in opens a page that does not exist. Set `authServerMetadataUrl` to the metadata document of the right authorization server:
153
+
154
+ ```json
155
+ {
156
+ "mcpServers": {
157
+ "example": {
158
+ "url": "https://mcp.example.com/mcp",
159
+ "oauth": { "authServerMetadataUrl": "https://example.okta.com/.well-known/openid-configuration" }
160
+ }
161
+ }
162
+ }
163
+ ```
164
+
165
+ Pi uses that document instead of discovery and trusts it as configured, so only point it at a document you trust. The URL must use HTTPS, except on `localhost`, `127.0.0.1`, or `[::1]`.
166
+
167
+ ## Control tool exposure
168
+
169
+ Each server tool is registered as `mcp__<server>__<tool>`. The server's `exposure` determines how the model reaches it:
170
+
171
+ | Exposure | Behavior | Typical use |
172
+ |---|---|---|
173
+ | `codemode` (default) | Callable from [`codemode`](cli.md#tools) scripts, but neither declared to the model nor listed in the codemode description. Scripts find tools with `searchTools()`, `describeTool()`, or `ALL_TOOLS`. | General MCP servers, especially when scripts should combine or filter calls. |
174
+ | `deferred` | Not declared until [`tool_search`](cli.md#tools) loads a match for the next model call. | Large servers whose tools should be called directly after discovery. |
175
+ | `direct` | Declared to the model like a built-in tool and also callable from codemode. | Small, frequently used tool sets. |
176
+ | `hidden` | Registered but unreachable. | Servers or tools that should remain unavailable. |
177
+
178
+ `codemode-deferred` is accepted as an alias for `codemode`.
179
+
180
+ Servers with `codemode` or `deferred` tools are listed in the `mcp_servers` section of the system prompt, with how their tools are reached and one line from the configured `description` or, once connected, from the server instructions. Pi updates the section when a prompt starts, after waiting for servers with `direct` tools. When it changed, for example because a server connected and its summary became available, Pi appends the new section to the conversation instead of changing tool declarations, so earlier messages stay cached. `describeNamespace()` and the `namespace` option of `searchTools()` accept `mcp__dev-radius`, `mcp__dev_radius`, `dev-radius`, or `dev_radius`.
181
+
182
+ Pi activates `codemode` when a server with `codemode` exposure connects. It activates `tool_search` for a server with `deferred` exposure. To make the model see a tool without searching, give it `direct` exposure with `toolExposure`.
183
+
184
+ `toolExposure` overrides the server exposure for individual tools. Keys are exact server tool names or patterns where `*` matches any characters. Exact names win over patterns; among patterns, the first match wins. A server with `hidden` exposure can expose only selected tools:
185
+
186
+ ```json
187
+ {
188
+ "mcpServers": {
189
+ "github": {
190
+ "url": "https://api.githubcopilot.com/mcp/",
191
+ "exposure": "deferred",
192
+ "toolExposure": {
193
+ "search_code": "direct",
194
+ "get_*": "codemode",
195
+ "delete_*": "hidden"
196
+ }
197
+ }
198
+ }
199
+ }
200
+ ```
201
+
202
+ `pi mcp list` marks tools whose exposure differs from their server. The Tools view in `/mcp` also shows the effective exposure.
203
+
204
+ Tools with `codemode` or `deferred` exposure can be reached through either indirect mechanism: codemode scripts can call them, and `tool_search` can load them. Codemode calls do not depend on the active tool set, so they remain available after `/tree`, resume, and fork. Tools loaded by `tool_search` are recorded in the transcript and remain declared on that branch.
205
+
206
+ To keep `codemode` active without MCP servers, add `"defaultTools": ["+codemode"]` to [settings](settings.md#tools). To prevent automatic codemode activation, set `"autoEnableCodemode": false` beside `mcpServers`. A project value overrides the user-level value. Pi warns once when neither `codemode` nor `tool_search` is active and non-direct tools cannot be called.
207
+
208
+ Text results over 20 KB reach the model with their middle removed around a `…N chars truncated…` marker. The full text is saved to a temporary file named in the result. Codemode scripts receive the complete result and can reduce it before returning output to the model.
209
+
210
+ Codemode scripts receive the complete MCP `CallToolResult`, including `content`, `structuredContent`, and `isError`. A result with `isError` resolves inside scripts but is reported as an error for direct calls. `image(result.content[0])` forwards an image block. Server instructions are not part of any tool description; scripts read them with `describeNamespace("mcp__<server>")`, which also returns the server's tool names.
211
+
212
+ ## Use resources
213
+
214
+ When a connected server offers [resources](https://modelcontextprotocol.io/specification/2025-11-25/server/resources), Pi adds the resource tools used by Codex and OpenCode:
215
+
216
+ - `list_mcp_resources` lists resources as JSON: `{ server?, resources: [{ server, uri, name, ... }], nextCursor? }`. With `server`, it lists one page; `cursor` continues with the next page. Without `server`, it lists every resource from every server.
217
+ - `list_mcp_resource_templates` lists URI templates for resources the servers do not list directly.
218
+ - `read_mcp_resource` reads a resource by `server` and `uri`. Text reaches the model as text and images as images. Other binary resources are saved to temporary files, and the model receives the path. Scripts receive `{ server, uri, contents }`.
219
+
220
+ These tools reach every enabled, non-hidden server with resources. Their exposure is the widest exposure among those servers: `direct`, then `codemode` or `deferred`. Resource links in tool results identify `read_mcp_resource` and the server.
221
+
222
+ Resources for MCP Apps, identified by `ui://` URIs or `text/html;profile=mcp-app`, are omitted because Pi does not render them. Resource icons are also omitted.
223
+
224
+ Reading and listing resources is retried once after a transient HTTP error (408, 429, or 5xx). Tool calls are not retried because the server may already have performed them.
225
+
226
+ ## Permissions
227
+
228
+ Every MCP call passes through Pi's tool pipeline. Extension `tool_call` and `tool_result` handlers, including permission gates, therefore apply to MCP tools. Calls made from codemode scripts carry the codemode call ID as `parentToolCallId`.
229
+
230
+ `pi.getAllTools()` reports the annotations declared by each server: `readOnlyHint`, `destructiveHint`, `idempotentHint`, and `openWorldHint`. Permission extensions can use these hints to decide which calls require confirmation (see [Tool exposure](extensions.md#tool-exposure)). Resource tools are marked read-only.
231
+
232
+ ## Extensions and SDK
233
+
234
+ ### Add servers from extensions
235
+
236
+ Extensions can add servers for the current session with `pi.registerMcpServer(name, config)`, using the same shape as an `mcpServers` entry (see [MCP servers in extensions](extensions.md#mcp-servers)). Registered servers connect like configured servers and appear in `/mcp` with the extension as their source.
237
+
238
+ Changes to enabled state or exposure apply only to the current session. A file-configured server with the same name takes precedence, and `/mcp` lists the overridden registration. `pi mcp` shell commands do not load extensions and only see file-configured servers.
239
+
240
+ ### Replace the built-in MCP support
241
+
242
+ An installed extension that registers `/mcp`, such as `pi-mcp-adapter`, replaces the built-in MCP support for sessions. Pi then does not read `mcp.json` or connect its servers in a session, and `/mcp` belongs to the extension. Remove the extension to restore the built-in behavior. To disable built-in MCP support without a replacement, disable `mcp` under Built-in in `pi config`, or set `"extensions": ["-builtin:mcp"]` in [settings](settings.md#resources).
243
+
244
+ An extension that registers `codemode` or `tool_search` similarly replaces the built-in tool with that name. Shell-level `pi mcp` commands always use the built-in implementation.
245
+
246
+ ### Use MCP from the SDK
247
+
248
+ SDK sessions do not load built-in extensions. Add the MCP extension, the codemode extension for `codemode` servers, and the tool-search extension for `deferred` servers to the resource loader. See [Codemode and MCP](sdk.md#codemode-mcp).
package/docs/models.md CHANGED
@@ -18,7 +18,7 @@ Browse the [model catalog](https://pi.dev/models) for current providers, model I
18
18
 
19
19
  Run `/login` and select a provider. Pi stores credentials in [`auth.json`](configuration.md#agent-directory). Run `/logout` to remove stored credentials for a provider.
20
20
 
21
- You can instead provide an API key through the provider's environment variable. This is useful in CI and other environments where Pi should not write credentials. [Provider Authentication](providers.md) lists the variables and cloud-provider setup.
21
+ You can instead provide an API key through the provider's environment variable. This is useful in CI and other environments where Pi should not write credentials. [Providers](providers.md) lists the variables and provider-specific setup.
22
22
 
23
23
  When several credential sources are configured, Pi uses a runtime `--api-key` first, then a stored `auth.json` credential, an `apiKey` from `models.json`, and finally the provider's environment variables or ambient cloud credentials. Provider extensions can define their own authentication behavior.
24
24
 
@@ -100,6 +100,62 @@ 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
+ [Codemode](codemode.md#classify) describes the question and answer types.
135
+
136
+ 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.
137
+
138
+ 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.
139
+
140
+ ## Use image models
141
+
142
+ Image models generate images from a prompt and optional input images. Pi lists OpenRouter's image models, such as `google/gemini-2.5-flash-image` and `black-forest-labs/flux.2-pro`, under the `openrouter` provider; they use the same `OPENROUTER_API_KEY` or `/login` credential as its chat models.
143
+
144
+ Like classifier models, image models do not appear in `/model`; the model reaches them through the [`codemode`](cli.md#enable-codemode) tool. Scripts list them with `models.getAvailableOfType("image")` and call `models.generateImages(model, { input })`. The result's `output` holds base64 image blocks, which `image()` attaches to the `codemode` result so the model sees them:
145
+
146
+ ```js
147
+ const painter = await models.getModelOfType("image", "openrouter", "google/gemini-2.5-flash-image");
148
+ const result = await models.generateImages(painter, {
149
+ input: [{ type: "text", text: "A red fox in the snow, watercolor" }],
150
+ });
151
+ if (result.stopReason !== "stop") return result.errorMessage;
152
+ for (const block of result.output) if (block.type === "image") image(block);
153
+ ```
154
+
155
+ `input` can also contain `{ type: "image", data, mimeType }` blocks to edit or use as references. Pi adds the usage of a script's image calls to the `codemode` tool result, like classifier calls. Generated images are not saved to disk. [Codemode](codemode.md#generate-images) describes the full API.
156
+
157
+ Extensions generate images through `ctx.modelRegistry.generateImages()`, without codemode.
158
+
103
159
  ## Add a custom provider
104
160
 
105
161
  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
@@ -1,4 +1,4 @@
1
- # Provider Authentication
1
+ # Providers
2
2
 
3
3
  Most hosted providers support one or both of these authentication methods:
4
4
 
@@ -17,8 +17,6 @@ Run `/logout` and select a provider to remove its stored credential. This does n
17
17
 
18
18
  `auth.json` can contain API keys and OAuth tokens. Keep it private and do not commit it.
19
19
 
20
- Radius authentication uses its gateway catalog and caches refreshed model metadata for later offline startup. A custom Radius gateway configured in `models.json` uses its own catalog rather than inheriting the public `radius.pi.dev` catalog.
21
-
22
20
  ## Use an API key from the environment
23
21
 
24
22
  Environment variables are useful in CI and anywhere Pi should not store the key. Set the variable before starting Pi:
@@ -28,7 +26,7 @@ export ANTHROPIC_API_KEY=sk-ant-...
28
26
  pi
29
27
  ```
30
28
 
31
- This table covers providers with a single primary API-key variable. Providers that need additional configuration or support ambient credentials are covered under [Cloud providers](#cloud-providers).
29
+ This table covers providers with a single primary API-key variable. Providers that need additional configuration or support ambient credentials are covered under [Provider Specific Config](#provider-specific-config).
32
30
 
33
31
  | Provider | Environment variable |
34
32
  |---|---|
@@ -49,6 +47,7 @@ This table covers providers with a single primary API-key variable. Providers th
49
47
  | ZAI Coding Plan (China) | `ZAI_CODING_CN_API_KEY` |
50
48
  | OpenCode Zen and Go | `OPENCODE_API_KEY` |
51
49
  | Radius | `RADIUS_API_KEY` |
50
+ | TypeSafe ([classifier models](models.md#use-classifier-models)) | `TYPESAFE_API_KEY` |
52
51
  | Hugging Face | `HF_TOKEN` |
53
52
  | Fireworks | `FIREWORKS_API_KEY` |
54
53
  | Together AI | `TOGETHER_API_KEY` |
@@ -67,6 +66,8 @@ This table covers providers with a single primary API-key variable. Providers th
67
66
 
68
67
  Anthropic also recognizes `ANTHROPIC_OAUTH_TOKEN` as an API credential and `ANTHROPIC_AUTH_TOKEN` as bearer authentication.
69
68
 
69
+ With no key or token set, Anthropic uses workload identity federation when `ANTHROPIC_FEDERATION_RULE_ID`, `ANTHROPIC_ORGANIZATION_ID` and `ANTHROPIC_IDENTITY_TOKEN_FILE` are set: the Anthropic SDK exchanges the identity token for a short-lived access token and refreshes it itself (re-reading the identity token file, so keep that file fresh for long sessions). `ANTHROPIC_SERVICE_ACCOUNT_ID` and `ANTHROPIC_WORKSPACE_ID` are passed through when set.
70
+
70
71
  ## Load an API key from a command
71
72
 
72
73
  To use a secret manager without writing the resolved key to disk, set a provider's `key` in `auth.json` to a command prefixed with `!`:
@@ -82,9 +83,9 @@ To use a secret manager without writing the resolved key to disk, set a provider
82
83
 
83
84
  Pi runs the command when the key is first needed and caches its standard output for the process lifetime. Empty output, a timeout, or a nonzero exit leaves the key unresolved until Pi restarts.
84
85
 
85
- ## Cloud Providers
86
+ ## Provider Specific Config
86
87
 
87
- The providers below need additional settings or can use credentials supplied by their cloud platform.
88
+ The providers below have additional setup, need additional settings, or can use credentials supplied by their platform.
88
89
 
89
90
  A stored API-key credential can include an `env` object. Its values take priority over the process environment for that provider:
90
91
 
@@ -100,6 +101,18 @@ A stored API-key credential can include an `env` object. Its values take priorit
100
101
  }
101
102
  ```
102
103
 
104
+ ### Radius
105
+
106
+ Radius is a service crafted for Pi by the builders of Pi, Earendil Works. It provides a customizable AI gateway with organization-level controls and analytics built in, and artifacts for sharing what you create with Pi.
107
+
108
+ To get started, run `/login radius` in Pi. This adds Radius as a provider, and its models appear in `/model` like any other provider's.
109
+
110
+ Radius also has an MCP server, so Pi can manage Radius for you.
111
+
112
+ Radius is currently in early alpha and evolving quickly. See [radius.earendil.com](https://radius.earendil.com) for more.
113
+
114
+ Radius authentication uses its gateway catalog and caches refreshed model metadata for later offline startup. A custom Radius gateway configured in `models.json` uses its own catalog rather than inheriting the public `radius.pi.dev` catalog.
115
+
103
116
  ### Azure OpenAI
104
117
 
105
118
  Set an API key plus either a base URL or resource name:
@@ -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.