@punch-bot/cli 1.5.1 → 1.5.3

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 (505) hide show
  1. package/CHANGELOG.md +162 -1
  2. package/README.md +6 -8
  3. package/dist/bundle/chunks/anthropic-messages-WIBS5YKY.js +6 -0
  4. package/dist/bundle/chunks/azure-openai-responses-GP5GDEGO.js +2 -0
  5. package/dist/bundle/chunks/bedrock-converse-stream.js +7 -4
  6. package/dist/bundle/chunks/chunk-35EHANXE.js +2 -0
  7. package/dist/bundle/chunks/chunk-3IMHRFLG.js +6 -0
  8. package/dist/bundle/chunks/chunk-77CRE5SV.js +9 -0
  9. package/dist/bundle/chunks/chunk-CE33JMCE.js +861 -0
  10. package/dist/bundle/chunks/{chunk-MYNHUMKE.js → chunk-CXY7BILM.js} +2 -44
  11. package/dist/bundle/chunks/chunk-EISXNXOQ.js +41 -0
  12. package/dist/bundle/chunks/chunk-ENMVUQHE.js +26 -0
  13. package/dist/bundle/chunks/chunk-FFMDRXC4.js +10 -0
  14. package/dist/bundle/chunks/chunk-GFUN2N5K.js +2 -0
  15. package/dist/bundle/chunks/chunk-HQH636GU.js +361 -0
  16. package/dist/bundle/chunks/chunk-IEBK4HQA.js +2 -0
  17. package/dist/bundle/chunks/chunk-JAJLG57O.js +4 -0
  18. package/dist/bundle/chunks/{chunk-RROECCMX.js → chunk-LOHGXPCL.js} +2 -2
  19. package/dist/bundle/chunks/{chunk-CRILLKNU.js → chunk-OV2VGRRS.js} +1 -1
  20. package/dist/bundle/chunks/chunk-P7FPUEYA.js +2 -0
  21. package/dist/bundle/chunks/chunk-PDENR63J.js +16 -0
  22. package/dist/bundle/chunks/chunk-RHOWRSGK.js +2 -0
  23. package/dist/bundle/chunks/{chunk-HMPP4ECW.js → chunk-UZ3LUZDC.js} +1 -1
  24. package/dist/bundle/chunks/chunk-WN2D4UD4.js +2 -0
  25. package/dist/bundle/chunks/chunk-X4T5TGM4.js +82 -0
  26. package/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
  27. package/dist/bundle/chunks/cli-OQNR6ESL.js +53 -0
  28. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-JWAAZATQ.js → cloudflare-workers-ai-system-one-36EDUVVN.js} +1 -1
  29. package/dist/bundle/chunks/codemode-worker.js +2 -0
  30. package/dist/bundle/chunks/{execute-HXULRBCI.js → execute-EHT55MW7.js} +5 -3
  31. package/dist/bundle/chunks/github-copilot.js +1 -1
  32. package/dist/bundle/chunks/{google-generative-ai-EHUU7JII.js → google-generative-ai-KA6FZCHM.js} +1 -1
  33. package/dist/bundle/chunks/{google-vertex-AFMVUS5C.js → google-vertex-DXKQ4IYR.js} +1 -1
  34. package/dist/bundle/chunks/image-resize-worker.js +1 -1
  35. package/dist/bundle/chunks/kimi-coding.js +1 -1
  36. package/dist/bundle/chunks/{llama-cpp-classify-YVA2UOJG.js → llama-cpp-classify-676UCBOD.js} +1 -1
  37. package/dist/bundle/chunks/meta.js +1 -1
  38. package/dist/bundle/chunks/mistral-conversations-PJ56UMXO.js +5 -0
  39. package/dist/bundle/chunks/openai-codex-responses-DWVG7MAQ.js +10 -0
  40. package/dist/bundle/chunks/openai-completions-OKI6KBNP.js +7 -0
  41. package/dist/bundle/chunks/{openai-decisions-GNOLFL74.js → openai-decisions-SO57QA6O.js} +1 -1
  42. package/dist/bundle/chunks/openai-responses-3HV234HB.js +4 -0
  43. package/dist/bundle/chunks/{openrouter-images-ZTNVFSL2.js → openrouter-images-5X6D7HFS.js} +1 -1
  44. package/dist/bundle/chunks/pi-messages-BS5Z34RE.js +8 -0
  45. package/dist/bundle/chunks/radius.js +1 -1
  46. package/dist/bundle/chunks/{runtime-R5GXO4CV.js → runtime-74PFKASL.js} +1 -1
  47. package/dist/bundle/chunks/{typesafe-system-one-I5AHLF6T.js → typesafe-system-one-IPNULX2M.js} +1 -1
  48. package/dist/bundle/chunks/virtual-modules-2Y422I6U.js +2 -0
  49. package/dist/bundle/cli-runtime.js +1 -1
  50. package/dist/bundle/index.js +1 -1
  51. package/dist/bundle/rpc-entry.js +1 -1
  52. package/dist/cli/args.d.ts +0 -1
  53. package/dist/cli/args.d.ts.map +1 -1
  54. package/dist/cli/args.js +8 -12
  55. package/dist/cli/args.js.map +1 -1
  56. package/dist/cli/auth-command.d.ts.map +1 -1
  57. package/dist/cli/auth-command.js +26 -2
  58. package/dist/cli/auth-command.js.map +1 -1
  59. package/dist/cli/auth-login.d.ts +15 -0
  60. package/dist/cli/auth-login.d.ts.map +1 -0
  61. package/dist/cli/auth-login.js +232 -0
  62. package/dist/cli/auth-login.js.map +1 -0
  63. package/dist/cli/auth-logout.d.ts +14 -0
  64. package/dist/cli/auth-logout.d.ts.map +1 -0
  65. package/dist/cli/auth-logout.js +63 -0
  66. package/dist/cli/auth-logout.js.map +1 -0
  67. package/dist/cli/auth-terminal.d.ts +17 -0
  68. package/dist/cli/auth-terminal.d.ts.map +1 -0
  69. package/dist/cli/auth-terminal.js +63 -0
  70. package/dist/cli/auth-terminal.js.map +1 -0
  71. package/dist/cli/project-trust.js +1 -1
  72. package/dist/cli/project-trust.js.map +1 -1
  73. package/dist/config.d.ts +10 -2
  74. package/dist/config.d.ts.map +1 -1
  75. package/dist/config.js +24 -11
  76. package/dist/config.js.map +1 -1
  77. package/dist/core/agent-session-runtime.d.ts +5 -0
  78. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  79. package/dist/core/agent-session-runtime.js +20 -5
  80. package/dist/core/agent-session-runtime.js.map +1 -1
  81. package/dist/core/agent-session.d.ts +31 -15
  82. package/dist/core/agent-session.d.ts.map +1 -1
  83. package/dist/core/agent-session.js +158 -71
  84. package/dist/core/agent-session.js.map +1 -1
  85. package/dist/core/auth-storage.d.ts.map +1 -1
  86. package/dist/core/auth-storage.js +3 -2
  87. package/dist/core/auth-storage.js.map +1 -1
  88. package/dist/core/bash-executor.d.ts.map +1 -1
  89. package/dist/core/bash-executor.js +3 -1
  90. package/dist/core/bash-executor.js.map +1 -1
  91. package/dist/core/cache-warmer.d.ts +4 -37
  92. package/dist/core/cache-warmer.d.ts.map +1 -1
  93. package/dist/core/cache-warmer.js +11 -89
  94. package/dist/core/cache-warmer.js.map +1 -1
  95. package/dist/core/compaction/branch-summarization.d.ts +4 -2
  96. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  97. package/dist/core/compaction/branch-summarization.js +16 -4
  98. package/dist/core/compaction/branch-summarization.js.map +1 -1
  99. package/dist/core/compaction/utils.d.ts.map +1 -1
  100. package/dist/core/compaction/utils.js +2 -1
  101. package/dist/core/compaction/utils.js.map +1 -1
  102. package/dist/core/exec.d.ts +9 -1
  103. package/dist/core/exec.d.ts.map +1 -1
  104. package/dist/core/exec.js +104 -60
  105. package/dist/core/exec.js.map +1 -1
  106. package/dist/core/export-html/template.css +9 -0
  107. package/dist/core/export-html/template.js +165 -45
  108. package/dist/core/extensions/index.d.ts +1 -1
  109. package/dist/core/extensions/index.d.ts.map +1 -1
  110. package/dist/core/extensions/index.js.map +1 -1
  111. package/dist/core/extensions/loader.d.ts.map +1 -1
  112. package/dist/core/extensions/loader.js +10 -13
  113. package/dist/core/extensions/loader.js.map +1 -1
  114. package/dist/core/extensions/pi-ai-extension-view.d.ts +19 -0
  115. package/dist/core/extensions/pi-ai-extension-view.d.ts.map +1 -0
  116. package/dist/core/extensions/pi-ai-extension-view.js +22 -0
  117. package/dist/core/extensions/pi-ai-extension-view.js.map +1 -0
  118. package/dist/core/extensions/runner.d.ts +1 -4
  119. package/dist/core/extensions/runner.d.ts.map +1 -1
  120. package/dist/core/extensions/runner.js +0 -14
  121. package/dist/core/extensions/runner.js.map +1 -1
  122. package/dist/core/extensions/types.d.ts +5 -18
  123. package/dist/core/extensions/types.d.ts.map +1 -1
  124. package/dist/core/extensions/types.js +1 -1
  125. package/dist/core/extensions/types.js.map +1 -1
  126. package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
  127. package/dist/core/extensions/virtual-modules.js +8 -7
  128. package/dist/core/extensions/virtual-modules.js.map +1 -1
  129. package/dist/core/index.d.ts +1 -1
  130. package/dist/core/index.d.ts.map +1 -1
  131. package/dist/core/index.js.map +1 -1
  132. package/dist/core/mcp-servers.d.ts +23 -41
  133. package/dist/core/mcp-servers.d.ts.map +1 -1
  134. package/dist/core/mcp-servers.js +51 -120
  135. package/dist/core/mcp-servers.js.map +1 -1
  136. package/dist/core/model-config.d.ts +1730 -2029
  137. package/dist/core/model-config.d.ts.map +1 -1
  138. package/dist/core/model-config.js +2 -3
  139. package/dist/core/model-config.js.map +1 -1
  140. package/dist/core/model-resolver.d.ts.map +1 -1
  141. package/dist/core/model-resolver.js +36 -29
  142. package/dist/core/model-resolver.js.map +1 -1
  143. package/dist/core/model-runtime.d.ts +5 -0
  144. package/dist/core/model-runtime.d.ts.map +1 -1
  145. package/dist/core/model-runtime.js +11 -4
  146. package/dist/core/model-runtime.js.map +1 -1
  147. package/dist/core/package-manager.d.ts +24 -1
  148. package/dist/core/package-manager.d.ts.map +1 -1
  149. package/dist/core/package-manager.js +210 -51
  150. package/dist/core/package-manager.js.map +1 -1
  151. package/dist/core/pi-ai-schemas.d.ts +167 -0
  152. package/dist/core/pi-ai-schemas.d.ts.map +1 -0
  153. package/dist/core/pi-ai-schemas.js +21 -0
  154. package/dist/core/pi-ai-schemas.js.map +1 -0
  155. package/dist/core/pi-manifest.d.ts +1 -0
  156. package/dist/core/pi-manifest.d.ts.map +1 -1
  157. package/dist/core/pi-manifest.js +4 -0
  158. package/dist/core/pi-manifest.js.map +1 -1
  159. package/dist/core/preferred-providers.d.ts +17 -0
  160. package/dist/core/preferred-providers.d.ts.map +1 -0
  161. package/dist/core/preferred-providers.js +24 -0
  162. package/dist/core/preferred-providers.js.map +1 -0
  163. package/dist/core/project-trust.d.ts +1 -1
  164. package/dist/core/project-trust.d.ts.map +1 -1
  165. package/dist/core/project-trust.js +1 -1
  166. package/dist/core/project-trust.js.map +1 -1
  167. package/dist/core/prompt-templates.d.ts.map +1 -1
  168. package/dist/core/prompt-templates.js +18 -2
  169. package/dist/core/prompt-templates.js.map +1 -1
  170. package/dist/core/provider-composer.d.ts.map +1 -1
  171. package/dist/core/provider-composer.js +3 -1
  172. package/dist/core/provider-composer.js.map +1 -1
  173. package/dist/core/provider-matching.d.ts +11 -0
  174. package/dist/core/provider-matching.d.ts.map +1 -0
  175. package/dist/core/provider-matching.js +14 -0
  176. package/dist/core/provider-matching.js.map +1 -0
  177. package/dist/core/radius-mcp.d.ts +13 -0
  178. package/dist/core/radius-mcp.d.ts.map +1 -0
  179. package/dist/core/radius-mcp.js +29 -0
  180. package/dist/core/radius-mcp.js.map +1 -0
  181. package/dist/core/radius.d.ts +0 -3
  182. package/dist/core/radius.d.ts.map +1 -1
  183. package/dist/core/radius.js +0 -5
  184. package/dist/core/radius.js.map +1 -1
  185. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  186. package/dist/core/remote-catalog-provider.js +2 -0
  187. package/dist/core/remote-catalog-provider.js.map +1 -1
  188. package/dist/core/resource-loader.d.ts +4 -1
  189. package/dist/core/resource-loader.d.ts.map +1 -1
  190. package/dist/core/resource-loader.js +40 -25
  191. package/dist/core/resource-loader.js.map +1 -1
  192. package/dist/core/runtime-credentials.d.ts +8 -0
  193. package/dist/core/runtime-credentials.d.ts.map +1 -1
  194. package/dist/core/runtime-credentials.js +15 -1
  195. package/dist/core/runtime-credentials.js.map +1 -1
  196. package/dist/core/sdk.d.ts.map +1 -1
  197. package/dist/core/sdk.js +3 -1
  198. package/dist/core/sdk.js.map +1 -1
  199. package/dist/core/session-cwd.d.ts +0 -1
  200. package/dist/core/session-cwd.d.ts.map +1 -1
  201. package/dist/core/session-cwd.js +0 -3
  202. package/dist/core/session-cwd.js.map +1 -1
  203. package/dist/core/session-manager.d.ts +7 -0
  204. package/dist/core/session-manager.d.ts.map +1 -1
  205. package/dist/core/session-manager.js +32 -13
  206. package/dist/core/session-manager.js.map +1 -1
  207. package/dist/core/settings-defaults.d.ts +1 -31
  208. package/dist/core/settings-defaults.d.ts.map +1 -1
  209. package/dist/core/settings-defaults.js +1 -31
  210. package/dist/core/settings-defaults.js.map +1 -1
  211. package/dist/core/settings-manager.d.ts +4 -56
  212. package/dist/core/settings-manager.d.ts.map +1 -1
  213. package/dist/core/settings-manager.js +11 -247
  214. package/dist/core/settings-manager.js.map +1 -1
  215. package/dist/core/settings-schema.d.ts +4 -54
  216. package/dist/core/settings-schema.d.ts.map +1 -1
  217. package/dist/core/settings-schema.js +7 -101
  218. package/dist/core/settings-schema.js.map +1 -1
  219. package/dist/core/skills.d.ts.map +1 -1
  220. package/dist/core/skills.js +6 -14
  221. package/dist/core/skills.js.map +1 -1
  222. package/dist/core/slash-commands.d.ts +0 -6
  223. package/dist/core/slash-commands.d.ts.map +1 -1
  224. package/dist/core/slash-commands.js +1 -27
  225. package/dist/core/slash-commands.js.map +1 -1
  226. package/dist/core/source-info.d.ts +9 -0
  227. package/dist/core/source-info.d.ts.map +1 -1
  228. package/dist/core/source-info.js +13 -0
  229. package/dist/core/source-info.js.map +1 -1
  230. package/dist/core/system-prompt.d.ts.map +1 -1
  231. package/dist/core/system-prompt.js +5 -6
  232. package/dist/core/system-prompt.js.map +1 -1
  233. package/dist/core/telemetry.js +1 -1
  234. package/dist/core/telemetry.js.map +1 -1
  235. package/dist/core/theme/theme.d.ts.map +1 -1
  236. package/dist/core/theme/theme.js +5 -1
  237. package/dist/core/theme/theme.js.map +1 -1
  238. package/dist/core/tools/bash.d.ts +2 -2
  239. package/dist/core/tools/bash.d.ts.map +1 -1
  240. package/dist/core/tools/bash.js +35 -5
  241. package/dist/core/tools/bash.js.map +1 -1
  242. package/dist/core/tools/edit-diff.d.ts +23 -14
  243. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  244. package/dist/core/tools/edit-diff.js +182 -41
  245. package/dist/core/tools/edit-diff.js.map +1 -1
  246. package/dist/core/tools/edit.d.ts +3 -3
  247. package/dist/core/tools/edit.d.ts.map +1 -1
  248. package/dist/core/tools/edit.js +10 -11
  249. package/dist/core/tools/edit.js.map +1 -1
  250. package/dist/core/tools/find.d.ts +2 -2
  251. package/dist/core/tools/find.d.ts.map +1 -1
  252. package/dist/core/tools/find.js +82 -36
  253. package/dist/core/tools/find.js.map +1 -1
  254. package/dist/core/tools/grep.d.ts +7 -5
  255. package/dist/core/tools/grep.d.ts.map +1 -1
  256. package/dist/core/tools/grep.js +87 -75
  257. package/dist/core/tools/grep.js.map +1 -1
  258. package/dist/core/tools/ls.d.ts +2 -2
  259. package/dist/core/tools/ls.d.ts.map +1 -1
  260. package/dist/core/tools/ls.js +2 -1
  261. package/dist/core/tools/ls.js.map +1 -1
  262. package/dist/core/tools/powershell.d.ts.map +1 -1
  263. package/dist/core/tools/powershell.js +15 -2
  264. package/dist/core/tools/powershell.js.map +1 -1
  265. package/dist/core/tools/read.d.ts +10 -2
  266. package/dist/core/tools/read.d.ts.map +1 -1
  267. package/dist/core/tools/read.js +141 -25
  268. package/dist/core/tools/read.js.map +1 -1
  269. package/dist/core/tools/tool-definition-wrapper.d.ts +11 -1
  270. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  271. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  272. package/dist/core/tools/truncate.d.ts +4 -14
  273. package/dist/core/tools/truncate.d.ts.map +1 -1
  274. package/dist/core/tools/truncate.js +23 -29
  275. package/dist/core/tools/truncate.js.map +1 -1
  276. package/dist/core/tools/write.d.ts +2 -2
  277. package/dist/core/tools/write.d.ts.map +1 -1
  278. package/dist/core/tools/write.js.map +1 -1
  279. package/dist/core/trust-manager.d.ts.map +1 -1
  280. package/dist/core/trust-manager.js +14 -8
  281. package/dist/core/trust-manager.js.map +1 -1
  282. package/dist/core/usage-totals.d.ts.map +1 -1
  283. package/dist/core/usage-totals.js +2 -0
  284. package/dist/core/usage-totals.js.map +1 -1
  285. package/dist/extensions/codemode/execute.js +4 -4
  286. package/dist/extensions/codemode/execute.js.map +1 -1
  287. package/dist/extensions/codemode/tool.d.ts +2 -1
  288. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  289. package/dist/extensions/codemode/tool.js +59 -12
  290. package/dist/extensions/codemode/tool.js.map +1 -1
  291. package/dist/extensions/llama/client.d.ts +2 -0
  292. package/dist/extensions/llama/client.d.ts.map +1 -1
  293. package/dist/extensions/llama/client.js +23 -2
  294. package/dist/extensions/llama/client.js.map +1 -1
  295. package/dist/extensions/llama/index.d.ts.map +1 -1
  296. package/dist/extensions/llama/index.js +1 -1
  297. package/dist/extensions/llama/index.js.map +1 -1
  298. package/dist/extensions/mcp/cli.d.ts +2 -0
  299. package/dist/extensions/mcp/cli.d.ts.map +1 -1
  300. package/dist/extensions/mcp/cli.js +83 -22
  301. package/dist/extensions/mcp/cli.js.map +1 -1
  302. package/dist/extensions/mcp/config.d.ts.map +1 -1
  303. package/dist/extensions/mcp/config.js +4 -7
  304. package/dist/extensions/mcp/config.js.map +1 -1
  305. package/dist/extensions/mcp/index.d.ts.map +1 -1
  306. package/dist/extensions/mcp/index.js +5 -4
  307. package/dist/extensions/mcp/index.js.map +1 -1
  308. package/dist/extensions/mcp/oauth.d.ts +11 -49
  309. package/dist/extensions/mcp/oauth.d.ts.map +1 -1
  310. package/dist/extensions/mcp/oauth.js +56 -296
  311. package/dist/extensions/mcp/oauth.js.map +1 -1
  312. package/dist/extensions/mcp/resources.d.ts +1 -1
  313. package/dist/extensions/mcp/resources.d.ts.map +1 -1
  314. package/dist/extensions/mcp/resources.js +4 -3
  315. package/dist/extensions/mcp/resources.js.map +1 -1
  316. package/dist/extensions/mcp/runtime.d.ts +4 -3
  317. package/dist/extensions/mcp/runtime.d.ts.map +1 -1
  318. package/dist/extensions/mcp/runtime.js +7 -5
  319. package/dist/extensions/mcp/runtime.js.map +1 -1
  320. package/dist/extensions/mcp/tools.d.ts +2 -23
  321. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  322. package/dist/extensions/mcp/tools.js +6 -58
  323. package/dist/extensions/mcp/tools.js.map +1 -1
  324. package/dist/extensions/punch/index.d.ts.map +1 -1
  325. package/dist/extensions/punch/index.js +1 -1
  326. package/dist/extensions/punch/index.js.map +1 -1
  327. package/dist/extensions/punch/todos.js +1 -1
  328. package/dist/extensions/punch/todos.js.map +1 -1
  329. package/dist/extensions/subagent/index.d.ts.map +1 -1
  330. package/dist/extensions/subagent/index.js +278 -129
  331. package/dist/extensions/subagent/index.js.map +1 -1
  332. package/dist/extensions/tool-search/tool.d.ts +21 -6
  333. package/dist/extensions/tool-search/tool.d.ts.map +1 -1
  334. package/dist/extensions/tool-search/tool.js +122 -42
  335. package/dist/extensions/tool-search/tool.js.map +1 -1
  336. package/dist/index.d.ts +4 -4
  337. package/dist/index.d.ts.map +1 -1
  338. package/dist/index.js +2 -0
  339. package/dist/index.js.map +1 -1
  340. package/dist/main.d.ts.map +1 -1
  341. package/dist/main.js +106 -14
  342. package/dist/main.js.map +1 -1
  343. package/dist/modes/print-mode.d.ts.map +1 -1
  344. package/dist/modes/print-mode.js +19 -10
  345. package/dist/modes/print-mode.js.map +1 -1
  346. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  347. package/dist/modes/rpc/rpc-mode.js +53 -23
  348. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  349. package/dist/package-manager-cli.d.ts.map +1 -1
  350. package/dist/package-manager-cli.js +94 -12
  351. package/dist/package-manager-cli.js.map +1 -1
  352. package/dist/utils/ansi.d.ts.map +1 -1
  353. package/dist/utils/ansi.js +5 -2
  354. package/dist/utils/ansi.js.map +1 -1
  355. package/dist/utils/changelog.d.ts +2 -2
  356. package/dist/utils/changelog.d.ts.map +1 -1
  357. package/dist/utils/changelog.js +12 -9
  358. package/dist/utils/changelog.js.map +1 -1
  359. package/dist/utils/clipboard-command.d.ts.map +1 -1
  360. package/dist/utils/clipboard-command.js +4 -0
  361. package/dist/utils/clipboard-command.js.map +1 -1
  362. package/dist/utils/fuzzy.d.ts.map +1 -1
  363. package/dist/utils/fuzzy.js +59 -44
  364. package/dist/utils/fuzzy.js.map +1 -1
  365. package/dist/utils/git.d.ts +11 -1
  366. package/dist/utils/git.d.ts.map +1 -1
  367. package/dist/utils/git.js +44 -0
  368. package/dist/utils/git.js.map +1 -1
  369. package/dist/utils/image-resize-core.d.ts.map +1 -1
  370. package/dist/utils/image-resize-core.js +5 -3
  371. package/dist/utils/image-resize-core.js.map +1 -1
  372. package/dist/utils/image-resize.d.ts.map +1 -1
  373. package/dist/utils/image-resize.js +3 -1
  374. package/dist/utils/image-resize.js.map +1 -1
  375. package/dist/utils/open-browser.d.ts.map +1 -1
  376. package/dist/utils/open-browser.js +4 -1
  377. package/dist/utils/open-browser.js.map +1 -1
  378. package/dist/utils/paths.d.ts +17 -0
  379. package/dist/utils/paths.d.ts.map +1 -1
  380. package/dist/utils/paths.js +42 -1
  381. package/dist/utils/paths.js.map +1 -1
  382. package/dist/utils/shell.d.ts.map +1 -1
  383. package/dist/utils/shell.js +14 -0
  384. package/dist/utils/shell.js.map +1 -1
  385. package/dist/utils/terminal-question.d.ts +8 -0
  386. package/dist/utils/terminal-question.d.ts.map +1 -0
  387. package/dist/utils/terminal-question.js +24 -0
  388. package/dist/utils/terminal-question.js.map +1 -0
  389. package/dist/utils/text.d.ts +2 -0
  390. package/dist/utils/text.d.ts.map +1 -1
  391. package/dist/utils/text.js +5 -0
  392. package/dist/utils/text.js.map +1 -1
  393. package/dist/utils/tools-manager.d.ts.map +1 -1
  394. package/dist/utils/tools-manager.js +30 -35
  395. package/dist/utils/tools-manager.js.map +1 -1
  396. package/dist/utils/web-url.d.ts +12 -0
  397. package/dist/utils/web-url.d.ts.map +1 -0
  398. package/dist/utils/web-url.js +20 -0
  399. package/dist/utils/web-url.js.map +1 -0
  400. package/docs/cli-integration.md +3 -5
  401. package/docs/cli.md +45 -26
  402. package/docs/compaction.md +9 -9
  403. package/docs/configuration.md +1 -2
  404. package/docs/containerization.md +16 -14
  405. package/docs/custom-provider.md +5 -3
  406. package/docs/docs.json +9 -9
  407. package/docs/environment-variables.md +5 -12
  408. package/docs/extensions.md +683 -757
  409. package/docs/how-pi-works.md +5 -5
  410. package/docs/index.md +5 -5
  411. package/docs/llama-cpp.md +41 -39
  412. package/docs/mcp.md +12 -10
  413. package/docs/message-types.md +1 -1
  414. package/docs/models-configuration.md +6 -1
  415. package/docs/models.md +18 -19
  416. package/docs/nvidia-rtx-llama-cpp.md +1 -1
  417. package/docs/packages.md +21 -1
  418. package/docs/prompt-templates.md +11 -9
  419. package/docs/providers.md +8 -8
  420. package/docs/quickstart.md +28 -52
  421. package/docs/rpc-commands.md +2 -2
  422. package/docs/rpc-extension-ui.md +5 -7
  423. package/docs/rpc.md +4 -2
  424. package/docs/sdk.md +1 -1
  425. package/docs/security.md +9 -5
  426. package/docs/session-format.md +7 -9
  427. package/docs/sessions.md +26 -26
  428. package/docs/settings.md +36 -67
  429. package/docs/shell-aliases.md +7 -7
  430. package/docs/skills.md +4 -4
  431. package/docs/slash-commands.md +50 -58
  432. package/docs/termux.md +8 -9
  433. package/docs/themes.md +21 -41
  434. package/docs/usage.md +59 -177
  435. package/docs/virtual-models.md +4 -4
  436. package/docs/windows.md +8 -10
  437. package/examples/extensions/README.md +3 -2
  438. package/examples/extensions/custom-provider-anthropic/index.ts +27 -31
  439. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  440. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  441. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  442. package/examples/extensions/gondolin/package-lock.json +16 -26
  443. package/examples/extensions/gondolin/package.json +2 -2
  444. package/examples/extensions/reload-runtime.ts +17 -5
  445. package/examples/extensions/rpc-demo.ts +2 -2
  446. package/examples/extensions/subagent/README.md +14 -11
  447. package/examples/extensions/with-deps/package-lock.json +2 -2
  448. package/examples/extensions/with-deps/package.json +1 -1
  449. package/examples/tsconfig.json +208 -0
  450. package/npm-shrinkwrap.json +32 -34
  451. package/package.json +12 -14
  452. package/schemas/models.schema.json +65 -36
  453. package/schemas/settings.schema.json +17 -243
  454. package/dist/bundle/chunks/anthropic-messages-WAYXCPZL.js +0 -6
  455. package/dist/bundle/chunks/azure-openai-responses-LUIPKPFC.js +0 -2
  456. package/dist/bundle/chunks/chunk-275CIYA5.js +0 -16
  457. package/dist/bundle/chunks/chunk-2W2ATKZM.js +0 -2
  458. package/dist/bundle/chunks/chunk-3V45WARH.js +0 -7
  459. package/dist/bundle/chunks/chunk-4LBJE4YM.js +0 -14
  460. package/dist/bundle/chunks/chunk-4NE64BTO.js +0 -82
  461. package/dist/bundle/chunks/chunk-7SFLP7ZK.js +0 -1197
  462. package/dist/bundle/chunks/chunk-BQU3RKDL.js +0 -2
  463. package/dist/bundle/chunks/chunk-NJK3U3WK.js +0 -8
  464. package/dist/bundle/chunks/chunk-NQWQE4BR.js +0 -11
  465. package/dist/bundle/chunks/chunk-TEPMHNKQ.js +0 -2
  466. package/dist/bundle/chunks/chunk-TRN3ET6M.js +0 -2
  467. package/dist/bundle/chunks/chunk-UE7JCDFW.js +0 -2
  468. package/dist/bundle/chunks/chunk-UKVNB6C4.js +0 -2
  469. package/dist/bundle/chunks/chunk-USJZMAIR.js +0 -2
  470. package/dist/bundle/chunks/cli-W5KJM7YB.js +0 -51
  471. package/dist/bundle/chunks/mistral-conversations-FEBYNTL2.js +0 -5
  472. package/dist/bundle/chunks/openai-codex-responses-MI7TTP3C.js +0 -10
  473. package/dist/bundle/chunks/openai-completions-BVORSTAM.js +0 -7
  474. package/dist/bundle/chunks/openai-responses-TLIV5OQA.js +0 -4
  475. package/dist/bundle/chunks/pi-messages-4MVQCGGY.js +0 -8
  476. package/dist/bundle/chunks/virtual-modules-QK7S56IZ.js +0 -2
  477. package/dist/core/bug-report-upload.d.ts +0 -12
  478. package/dist/core/bug-report-upload.d.ts.map +0 -1
  479. package/dist/core/bug-report-upload.js +0 -22
  480. package/dist/core/bug-report-upload.js.map +0 -1
  481. package/dist/core/bug-report.d.ts +0 -184
  482. package/dist/core/bug-report.d.ts.map +0 -1
  483. package/dist/core/bug-report.js +0 -292
  484. package/dist/core/bug-report.js.map +0 -1
  485. package/dist/core/crash-log.d.ts +0 -27
  486. package/dist/core/crash-log.d.ts.map +0 -1
  487. package/dist/core/crash-log.js +0 -140
  488. package/dist/core/crash-log.js.map +0 -1
  489. package/dist/core/footer-data-provider.d.ts +0 -64
  490. package/dist/core/footer-data-provider.d.ts.map +0 -1
  491. package/dist/core/footer-data-provider.js +0 -338
  492. package/dist/core/footer-data-provider.js.map +0 -1
  493. package/dist/utils/zip.d.ts +0 -7
  494. package/dist/utils/zip.d.ts.map +0 -1
  495. package/dist/utils/zip.js +0 -60
  496. package/dist/utils/zip.js.map +0 -1
  497. package/docs/images/interactive-mode.png +0 -0
  498. package/docs/images/tree-view.png +0 -0
  499. package/docs/keybindings.md +0 -194
  500. package/docs/terminal-setup.md +0 -17
  501. package/docs/tmux.md +0 -55
  502. package/docs/tui.md +0 -125
  503. package/examples/extensions/sandbox/index.ts +0 -321
  504. package/examples/extensions/sandbox/package-lock.json +0 -66
  505. package/examples/extensions/sandbox/package.json +0 -22
@@ -10,7 +10,7 @@ A submitted message is added to the active branch. Pi builds a model request fro
10
10
 
11
11
  The provider streams an assistant response, which can contain text and tool calls. Pi records the response, executes each tool call, and records the results. That completes one turn. If tool results or queued messages require another model request, Pi starts another turn. Otherwise, the run ends.
12
12
 
13
- Steering messages enter after the current assistant turn. Follow-up messages enter after the agent has finished its pending work. Aborting stops the current run and returns queued messages to the editor.
13
+ Steering messages enter after the current assistant turn. Follow-up messages enter after the agent has finished its pending work. Aborting stops the current run; queued messages stay queued and continue afterwards. RPC clients remove them first with [`clear_queue`](rpc-commands.md#clear_queue).
14
14
 
15
15
  ## Context
16
16
 
@@ -20,7 +20,7 @@ Pi builds the system prompt from its base instructions and discovered context fi
20
20
 
21
21
  Full skill instructions are loaded on demand. Extensions can add instructions or transform context.
22
22
 
23
- Prompt templates expand editor input before it becomes a user message. Selected files, images, pasted text, and shell output can become message content.
23
+ Prompt templates expand prompt text before it becomes a user message. `@file` arguments, images, and output of the RPC `bash` command can become message content.
24
24
 
25
25
  ## Sessions
26
26
 
@@ -32,7 +32,7 @@ Model context is reconstructed from the active branch. Compaction inserts a summ
32
32
 
33
33
  ## Interfaces
34
34
 
35
- Interactive mode renders session and agent events in the terminal. Print mode runs a prompt and writes the final response. JSON mode writes agent events as JSONL.
35
+ Print mode runs a prompt and writes the final response. JSON mode writes agent events as JSONL.
36
36
 
37
37
  RPC mode accepts JSONL commands on stdin and writes responses and events to stdout. The TypeScript SDK creates and controls agent sessions in process.
38
38
 
@@ -40,9 +40,9 @@ All interfaces use the same agent and session mechanisms.
40
40
 
41
41
  ## Extensions and resources
42
42
 
43
- Extensions are TypeScript modules loaded into the Pi process. Their factory functions register tools, commands, shortcuts, providers, event handlers, renderers, and terminal UI.
43
+ Extensions are TypeScript modules loaded into the Pi process. Their factory functions register tools, commands, providers, and event handlers, and can show dialogs through the client's [extension UI](rpc-extension-ui.md).
44
44
 
45
- Skills provide on-demand instructions and supporting files. Prompt templates provide reusable message text. Themes provide terminal colors. Pi packages distribute these resources through npm or git.
45
+ Skills provide on-demand instructions and supporting files. Prompt templates provide reusable message text. Themes provide the colors of HTML session exports. Pi packages distribute these resources through npm or git.
46
46
 
47
47
  ## Trust and permissions
48
48
 
package/docs/index.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Pi
2
2
 
3
- Pi is an extensible AI agent that works from your terminal. Give it a goal and a working folder, and it can inspect files, run commands, edit content, and work through multi-step tasks.
3
+ Pi is an extensible AI agent that runs as a command-line process. Give it a goal and a working folder, and it can inspect files, run commands, edit content, and work through multi-step tasks.
4
4
 
5
5
  Use Pi for software development, research notes, writing projects, data files, or hobby work. You can use Pi as is, prompt it to adapt itself to your workflow, or build other applications powered by Pi using the SDK.
6
6
 
@@ -10,7 +10,7 @@ New to Pi? Follow the [Quickstart](quickstart.md) to install Pi, connect a model
10
10
 
11
11
  If Pi is already installed, choose what you want to do:
12
12
 
13
- - [Use Pi interactively](usage.md) to add files, run commands, direct ongoing work, and export results.
13
+ - [Run Pi](usage.md) in print, JSON, or RPC mode to add files, direct ongoing work, and export results.
14
14
  - [Choose a model](models.md) or connect a subscription, API key, local model, or compatible endpoint.
15
15
  - [Continue or branch a session](sessions.md) to resume work or explore another approach without losing history.
16
16
  - [Configure Pi](configuration.md) for your preferences, working folders, instructions, and reusable resources.
@@ -18,7 +18,7 @@ If Pi is already installed, choose what you want to do:
18
18
 
19
19
  ## Customize Pi
20
20
 
21
- Pi can reuse prompts, load specialized instructions, add executable integrations, change its terminal interface, connect model services, and distribute these resources as packages.
21
+ Pi can reuse prompts, load specialized instructions, add executable integrations, connect model services, and distribute these resources as packages.
22
22
  Use the [Quickstart customization chooser](quickstart.md#choose-how-to-customize-pi) to select the smallest mechanism that meets your need.
23
23
 
24
24
  ## Automate or embed Pi
@@ -30,9 +30,9 @@ 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), [providers](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), and [environment variables](environment-variables.md).
34
34
 
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).
35
+ For platform-specific help, see [Windows](windows.md), [Termux on Android](termux.md), or [Containerization](containerization.md).
36
36
 
37
37
  ## Work safely
38
38
 
package/docs/llama-cpp.md CHANGED
@@ -1,31 +1,39 @@
1
1
  # Local Models with llama.cpp
2
2
 
3
- Pi supports the [llama.cpp](https://github.com/ggml-org/llama.cpp) router server. The router discovers multiple GGUF models and loads or unloads them on demand.
3
+ Pi supports the [llama.cpp](https://llama.app) router server. The router discovers multiple GGUF models and loads or unloads them on demand.
4
4
 
5
- Use a current llama.cpp build with router support. Follow the [build instructions](https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md) or install a [prebuilt release](https://github.com/ggml-org/llama.cpp/releases) for your platform.
5
+ ## Install llama.cpp
6
+
7
+ Install llama.cpp with the [official installer](https://llama.app/docs/installation):
8
+
9
+ ```bash
10
+ curl -LsSf https://llama.app/install.sh | sh
11
+ ```
12
+
13
+ Verify the installation:
14
+
15
+ ```bash
16
+ llama --version
17
+ ```
18
+
19
+ See [llama.app](https://llama.app) for other installation methods, including package managers and building from source.
6
20
 
7
21
  ## Start the router
8
22
 
9
- Start `llama-server` without `--model` or `-m`. Passing a model starts single-model mode instead of router mode.
23
+ Start `llama serve` without `--model`, `-m`, or `-hf`. Passing a model starts single-model mode instead of router mode. See the [llama.cpp server guide](https://llama.app/docs/serve#serving-multiple-models-router-mode) for router configuration.
10
24
 
11
25
  ```bash
12
- llama-server \
13
- --models-dir ~/models \
26
+ llama serve \
14
27
  --no-models-autoload \
15
- --jinja \
16
- --host 127.0.0.1 \
17
- --port 8080 \
18
- -ngl 999 \
28
+ -ngl all \
19
29
  -c 32768
20
30
  ```
21
31
 
22
32
  Important options:
23
33
 
24
- - `--models-dir ~/models` discovers local GGUF files.
25
- - `--no-models-autoload` keeps loading explicit through `/llama`.
26
- - `--jinja` enables compatible chat templates and tool calling.
27
- - `-ngl 999` offloads as many layers as possible to the GPU.
28
- - `-c 32768` sets the context window for each loaded model. Omit it to use the model's native context, which may require substantially more memory.
34
+ - `--no-models-autoload` keeps loading explicit through `/llama` or another router client.
35
+ - `-ngl all` offloads all layers to the GPU. Omit it to use automatic GPU offloading.
36
+ - `-c 32768` sets the context size in tokens. Use `-c 0` for the model's full context window, which may require substantially more memory. Context is shared across parallel server slots.
29
37
 
30
38
  A single-file model can sit directly in the model directory. Put multimodal and multi-shard models in separate subdirectories:
31
39
 
@@ -41,48 +49,42 @@ A single-file model can sit directly in the model directory. Put multimodal and
41
49
  └── large-model-Q4_K_M-00003-of-00003.gguf
42
50
  ```
43
51
 
44
- Restart the router after manually adding files. For per-model context sizes and other options, use [llama.cpp model presets](https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md#model-presets). For settings tuned to a specific NVIDIA GPU and model, see [Run Pi with NVIDIA RTX and llama.cpp](nvidia-rtx-llama-cpp.md).
52
+ Restart the router after manually adding files. The router also supports cached models and preset files via `--models-preset`, as described in the [server guide](https://llama.app/docs/serve#serving-multiple-models-router-mode).
45
53
 
46
54
  ## Configure Pi
47
55
 
48
- Start Pi and configure the provider:
49
-
50
- ```text
51
- /login llama.cpp
52
- ```
53
-
54
- Enter the router URL and optional API key. The default URL is `http://127.0.0.1:8080`.
55
-
56
- If you start the router with `--no-models-autoload`, `/login llama.cpp` only stores the connection. Run `/llama` to load a model, then `/model` to select the loaded model for the current session.
57
-
58
- Environment variables can configure the same values without `/login`:
56
+ Point Pi at the router with environment variables. The default URL is `http://127.0.0.1:9931`:
59
57
 
60
58
  ```bash
61
- export LLAMA_BASE_URL=http://127.0.0.1:8080
59
+ export LLAMA_BASE_URL=http://127.0.0.1:9931
62
60
  export LLAMA_API_KEY=optional-secret
63
- pi
61
+ pi --list-models llama
64
62
  ```
65
63
 
66
- If the server uses an API key, start `llama-server` with the matching `--api-key` value. Keep `--host 127.0.0.1` for local-only access.
64
+ Or run `pi auth login llama.cpp` in a terminal: it asks for the server URL and an optional API key, checks that the server answers, and saves both.
65
+
66
+ If you start the router with `--no-models-autoload`, load a model with `/llama` first, then select it with `--model` or the RPC `set_model` command.
67
+
68
+ If the server uses an API key, start `llama serve` with the matching `--api-key` value. Keep `--host 127.0.0.1` for local-only access.
67
69
 
68
70
  ## Manage models
69
71
 
70
- Run:
72
+ Run the `/llama` extension command from an RPC client, which shows its dialogs through the [extension UI protocol](rpc-extension-ui.md):
71
73
 
72
- ```text
73
- /llama
74
+ ```json
75
+ {"type": "prompt", "message": "/llama"}
74
76
  ```
75
77
 
76
78
  - Select an unloaded model to load it.
77
79
  - Select a loaded model to unload it.
78
80
  - Select **Download model…**, search Hugging Face, then choose a repository and quantization. Exact `owner/repository[:quant]` values also work.
79
- - Press Escape during a load or download to confirm cancellation.
81
+ - During a load or download, Pi shows progress as a status entry and asks whether to stop; confirm to cancel the operation.
80
82
 
81
83
  Hugging Face search uses `HF_TOKEN` when set, then checks `$HF_TOKEN_PATH`, `$HF_HOME/token`, `$XDG_CACHE_HOME/huggingface/token`, and `~/.cache/huggingface/token`. Search also works without authentication, subject to lower rate limits. Pi warns before downloading gated repositories and links to their access page. The llama.cpp server performs the download, so its process must also have `HF_TOKEN` when the selected repository requires access.
82
84
 
83
85
  If other models are loaded, Pi asks whether to unload them first or keep them loaded. Pi does not silently unload models and never deletes model files. The router may be shared with other clients, so `/llama` always displays the router's current state.
84
86
 
85
- Loaded and sleeping models appear in `/model`. Sleeping models wake automatically when selected. With router autoload enabled, unloaded preset models also appear and load when selected. With `--no-models-autoload`, load a model through `/llama` before selecting it.
87
+ Loaded and sleeping models appear in `--list-models` and RPC `get_available_models`. Sleeping models wake automatically when selected. With router autoload enabled, unloaded preset models also appear and load when selected. With `--no-models-autoload`, load a model through `/llama` before selecting it.
86
88
 
87
89
  If the router disconnects, `/llama` shows **Retry** and **Close**. Retry reconnects and refreshes model state without replaying the interrupted operation.
88
90
 
@@ -90,7 +92,7 @@ If the router disconnects, `/llama` shows **Retry** and **Close**. Retry reconne
90
92
 
91
93
  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). Pi lists llama.cpp models as classifiers in two ways:
92
94
 
93
- - **Decision models** such as [Julia-1, Laya, Kev, lev, and OpenJev](https://huggingface.co/collections/ggml-org/decision-models-6abf80cca3c83f127060a769) answer natively through llama.cpp's `/v1/systemone` endpoint. They appear only as classifiers, with the `typesafe-system-one` API, and not in `/model`.
95
+ - **Decision models** such as [Julia-1, Laya, Kev, lev, and OpenJev](https://huggingface.co/collections/ggml-org/decision-models-6abf80cca3c83f127060a769) answer natively through llama.cpp's `/v1/systemone` endpoint. They appear only as classifiers, with the `typesafe-system-one` API, and not as chat models.
94
96
  - **Chat models** are also listed as classifiers with the same ID and the `llama-cpp-classify` API, which reads answers from next-token probabilities as described below.
95
97
 
96
98
  llama.cpp 0.6.0 and later report decision models in the router's model list: their `architecture.output_modalities` contains `decisions`. The router reads this from the GGUF metadata without loading the model, so Pi recognizes unloaded and sleeping decision models too. Older llama.cpp builds do not report it, and Pi lists their decision models as chat models.
@@ -109,13 +111,13 @@ The model does not generate an answer. Each question becomes one chat prompt: th
109
111
  Check that the router is reachable:
110
112
 
111
113
  ```bash
112
- curl http://127.0.0.1:8080/health
113
- curl http://127.0.0.1:8080/models
114
+ curl http://127.0.0.1:9931/health
115
+ curl http://127.0.0.1:9931/models
114
116
  ```
115
117
 
116
118
  - **No models in `/llama`:** Check `--models-dir`, the directory layout, and restart the router.
117
- - **Model missing from `/model` with `--no-models-autoload`:** Load it with `/llama` first.
119
+ - **Model missing from `--list-models` with `--no-models-autoload`:** Load it with `/llama` first.
118
120
  - **Load fails or uses too much memory:** Lower `-c` or unload another model.
119
121
  - **Server is not in router mode:** Start it without `--model`, `-m`, or `-hf`.
120
122
 
121
- 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).
123
+ To remove the `llama.cpp` provider and `/llama`, set `"extensions": ["-builtin:llama.cpp"]` in [settings](settings.md#resources).
package/docs/mcp.md CHANGED
@@ -25,7 +25,7 @@ These commands add user-level servers by default. Add `--local` or `-l` to write
25
25
  pi mcp add -l tools --env API_KEY='${TOOLS_KEY}' -- uvx tools-mcp
26
26
  ```
27
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.
28
+ Send `/mcp` as a prompt to print server status, or `/mcp login <server>`, `/mcp logout <server>`, and `/mcp reconnect <server>` to run those actions in a session. Restart Pi after adding, removing, or changing a server outside the session, or reload it from an extension command with `ctx.reload()`.
29
29
 
30
30
  ## Configure servers
31
31
 
@@ -85,9 +85,9 @@ Keep personal servers and servers with credentials in the user-level file. Use t
85
85
 
86
86
  ### Inspect or change a server
87
87
 
88
- `/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.
88
+ `/mcp` prints configured servers with their state, exposure, tool count, and errors. `/mcp login <server>`, `/mcp logout <server>`, and `/mcp reconnect <server>` perform those actions directly. Without a server name, they use the only eligible server, or over RPC ask the client to pick one through the [extension UI protocol](rpc-extension-ui.md). The output reaches the client as an extension notification; in print mode it is not shown, so use `pi mcp list` from a shell instead.
89
89
 
90
- Exposure and enabled-state changes are saved to the file that defines the server without replacing unrelated content. In a trusted project, "Enable in this project" and "Disable in this project" add a project override for a user-level server; later changes to that server are saved to the override. 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.
90
+ To change exposure or enable and disable a server, edit `enabled`, `exposure`, or `toolExposure` in the file that defines it. In a trusted project, a project entry with only those fields overrides a user-level server (see [Configure servers](#configure-servers)). Disabled servers remain listed.
91
91
 
92
92
  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.
93
93
 
@@ -126,7 +126,7 @@ Remote servers that use OAuth, such as Sentry, need no credentials in `mcp.json`
126
126
 
127
127
  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.
128
128
 
129
- 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.
129
+ Pi identifies itself to the authorization server with its Client ID Metadata Document or by registering a client, 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.
130
130
 
131
131
  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.
132
132
 
@@ -159,17 +159,19 @@ Pi registers as `pi`. Some servers only accept registrations from known clients.
159
159
 
160
160
  The name is only sent when Pi registers a client. To register again under a new name, sign out first.
161
161
 
162
- Some authorization servers allow clients by their Client ID Metadata Document URL instead of registering them. Set `clientRegistration` to `cimd` to identify as Pi's document on pi.dev instead of registering:
162
+ Without `clientId`, Pi identifies itself with its Client ID Metadata Document on pi.dev when the authorization server advertises support for documents and public clients. Otherwise it registers a client dynamically. A client registered before stays in use while its redirect URI matches, until you sign out. With the document, the client ID is `https://pi.dev/oauth/client.json` with the redirect URI `http://127.0.0.1:<port>/callback`. If the authorization server does not send the `iss` parameter in authorization responses (RFC 9207), Pi uses a document and redirect path specific to the MCP server instead: `https://pi.dev/oauth/<id>/client.json` with `http://127.0.0.1:<port>/callback/<id>`.
163
+
164
+ Pi registers instead of using the document when `clientName` is set or `callbackUrl` is not `/callback` on `localhost` or `127.0.0.1`. Set `clientRegistration` to choose the method: `auto` (default) as described, `dcr` to always register, or `cimd` to always use the document. With `cimd`, sign-in fails if the authorization server does not support documents for public clients. Use `dcr` when the authorization page reports an invalid client:
163
165
 
164
166
  ```json
165
167
  {
166
168
  "mcpServers": {
167
- "example": { "url": "https://mcp.example.com/mcp", "oauth": { "clientRegistration": "cimd" } }
169
+ "example": { "url": "https://mcp.example.com/mcp", "oauth": { "clientRegistration": "dcr" } }
168
170
  }
169
171
  }
170
172
  ```
171
173
 
172
- The client ID is `https://pi.dev/oauth/client.json` with the redirect URI `http://127.0.0.1:<port>/callback`. If the authorization server does not send the `iss` parameter in authorization responses (RFC 9207), Pi uses a document and redirect path specific to the MCP server instead: `https://pi.dev/oauth/<id>/client.json` with `http://127.0.0.1:<port>/callback/<id>`. The authorization server must advertise Client ID Metadata Document support and public clients, or sign-in fails. `cimd` cannot be combined with `clientId` or `clientName`, and a `callbackUrl` must use `localhost` or `127.0.0.1` with the path `/callback`.
174
+ `pi mcp add --oauth-client-registration <mode>` sets it when adding a server. `cimd` cannot be combined with `clientId` or `clientName`, and a `callbackUrl` must use `localhost` or `127.0.0.1` with the path `/callback`.
173
175
 
174
176
  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:
175
177
 
@@ -221,9 +223,9 @@ Pi activates `codemode` when a server with `codemode` exposure connects. It acti
221
223
  }
222
224
  ```
223
225
 
224
- `pi mcp list` marks tools whose exposure differs from their server. The Tools view in `/mcp` also shows the effective exposure.
226
+ `pi mcp list` marks tools whose exposure differs from their server. `/mcp` also shows each server's exposure.
225
227
 
226
- 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.
228
+ 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 navigation, session switches, and forks. Tools loaded by `tool_search` are recorded in the transcript and remain declared on that branch.
227
229
 
228
230
  `--tools` does not remove MCP tools unless one of its entries starts with `mcp__`; `pi --tools read,codemode,'mcp__radius__*'` keeps only the tools of `radius`. `--exclude-tools` accepts the same patterns, and `--no-mcp` disables MCP for one run (see [Tools](cli.md#mcp-tools)).
229
231
 
@@ -263,7 +265,7 @@ Changes to enabled state or exposure apply only to the current session. A file-c
263
265
 
264
266
  ### Replace the built-in MCP support
265
267
 
266
- 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). `--no-mcp` disables it for one run.
268
+ 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, set `"extensions": ["-builtin:mcp"]` in [settings](settings.md#resources). `--no-mcp` disables it for one run.
267
269
 
268
270
  An extension that registers `codemode` or `tool_search` similarly replaces the built-in tool with that name. Pi activates the replacement for MCP servers and waits for the servers its calls need only when it declares [`reachesTools`](extensions.md#tool-exposure). Shell-level `pi mcp` commands always use the built-in implementation.
269
271
 
@@ -140,7 +140,7 @@ interface AssistantMessage {
140
140
  }
141
141
  ```
142
142
 
143
- `responseModel` records a concrete provider response model when it differs from the requested model. `responseId`, `providerThinkingLevel`, `thinkingLevel`, `diagnostics`, and `rawStopReason` preserve provider or runtime details.
143
+ `responseModel` records the concrete model reported by the provider, when the provider reports one. It may equal the requested model. `responseId`, `providerThinkingLevel`, `thinkingLevel`, `diagnostics`, and `rawStopReason` preserve provider or runtime details.
144
144
 
145
145
  `"pending"` is used for a partial assistant message while it streams. The completed message in `message_end` has a terminal stop reason, and Pi does not persist `"pending"` assistant messages in session JSONL.
146
146
 
@@ -118,6 +118,8 @@ See [Describe model input and caching](models.md#describe-model-input-and-cachin
118
118
  | `maxTokensField` | `"max_completion_tokens" \| "max_tokens"` | | Which field to use for max tokens. Default: auto-detected from URL. |
119
119
  | `requiresToolResultName` | boolean | | Whether tool results require the name field. Default: auto-detected from URL. |
120
120
  | `requiresAssistantAfterToolResult` | boolean | | Whether a user message after tool results requires an assistant message in between. Default: auto-detected from URL. |
121
+ | `requiresNonNullAssistantContent` | boolean | | Whether replayed assistant messages with no text (e.g. tool-call-only messages) must send "" instead of null content. Default: false. |
122
+ | `requiresToolsWithToolHistory` | boolean | | Whether requests without tools must send "tools": [] when the conversation contains tool calls or tool results. Needed by some proxies in front of Anthropic, such as older LiteLLM versions. Default: false, the field is omitted. |
121
123
  | `requiresThinkingAsText` | boolean | | Whether thinking blocks must be converted to text blocks with &lt;thinking> delimiters. Default: auto-detected from URL. |
122
124
  | `requiresReasoningContentOnAssistantMessages` | boolean | | Whether all replayed assistant messages must include an empty reasoning_content field when reasoning is enabled. Default: auto-detected from URL. |
123
125
  | `thinkingFormat` | `"openai" \| "openrouter" \| "deepseek" \| "together" \| "baseten" \| "zai" \| "qwen" \| "chat-template" \| "qwen-chat-template" \| "string-thinking" \| "ant-ling"` | | Format for reasoning or thinking parameters. When omitted, Pi auto-detects the format from the provider URL. "openai" uses reasoning_effort, "openrouter" uses reasoning.effort, "deepseek" uses thinking.type plus reasoning_effort when supported, "together" uses reasoning.enabled plus reasoning_effort when supported, "baseten" uses configurable chat_template_args plus reasoning_effort when supported, "zai" uses thinking.type, "qwen" uses top-level enable_thinking, "qwen-chat-template" uses chat_template_kwargs.enable_thinking and preserve_thinking, "chat-template" uses configurable chat_template_kwargs, "string-thinking" uses top-level thinking, and "ant-ling" uses reasoning.effort only when the mapped effort is non-null. |
@@ -135,6 +137,7 @@ See [Describe model input and caching](models.md#describe-model-input-and-cachin
135
137
  | `cacheControlFormat` | `"anthropic"` | | Cache control convention for prompt caching. Anthropic applies cache_control markers to the system prompt, last tool definition, and last user, assistant, or tool-result text content. |
136
138
  | `sendSessionAffinityHeaders` | boolean | | Whether to send session-affinity data from options.sessionId. Default: true for OpenRouter endpoints, false otherwise. |
137
139
  | `sessionAffinityFormat` | `"openai" \| "openai-nosession" \| "openrouter"` | | Session-affinity header format. openai sends session_id, x-client-request-id, and x-session-affinity; openai-nosession sends x-client-request-id and x-session-affinity; openrouter sends x-session-id. Does not affect prompt_cache_key. Default: auto-detected. |
140
+ | `promptCacheKeyMode` | `"auto" \| "enabled" \| "disabled"` | | Controls the prompt_cache_key request field. auto sends it to api.openai.com, or with long cache retention when supportsLongCacheRetention is true; enabled sends it whenever caching is active, for compatible proxies; disabled never sends it. Default: auto. |
138
141
  | `supportsLongCacheRetention` | boolean | | Whether the provider supports long prompt cache retention (prompt_cache_retention: "24h" or Anthropic-style cache_control.ttl: "1h", depending on format). Default: auto-detected from provider and URL. |
139
142
  | `vllmPriority` | number | | vLLM scheduler priority sent as the top-level priority request field. Lower values are handled earlier and the server default is 0. Only meaningful with --scheduling-policy priority. Off by default and not set on the generated catalog. |
140
143
 
@@ -146,7 +149,8 @@ Also applies to `azure-openai-responses` and `openai-codex-responses`.
146
149
  |---|---|---|---|
147
150
  | `supportsDeveloperRole` | boolean | `true` | Whether the provider supports the developer role instead of system. |
148
151
  | `supportsMidConvoSystemMessages` | boolean | `false` | Whether the exact model accepts developer or system messages after the conversation has started. When false, later system messages are folded into the leading system message. The generated catalog enables this for verified models. |
149
- | `sessionAffinityFormat` | `"openai" \| "openai-nosession" \| "openrouter"` | | Session-affinity header format. openai sends session_id and x-client-request-id; openai-nosession sends x-client-request-id; openrouter sends x-session-id. Does not affect prompt_cache_key. Default: auto-detected. |
152
+ | `sessionAffinityFormat` | `"openai" \| "openai-nosession" \| "openrouter"` | | Session-affinity header format. openai sends session-id and x-client-request-id; openai-nosession sends x-client-request-id; openrouter sends x-session-id. Does not affect prompt_cache_key. Default: auto-detected. |
153
+ | `promptCacheKeyMode` | `"auto" \| "enabled" \| "disabled"` | | Controls the prompt_cache_key request field. auto and enabled send it whenever caching is active; disabled never sends it, for compatible proxies that reject it. Default: auto. |
150
154
  | `supportsLongCacheRetention` | boolean | `true` | Whether the provider supports long prompt cache retention. This uses prompt_cache_options.ttl: "30m" on GPT-5.6+ and prompt_cache_retention: "24h" on earlier models. |
151
155
  | `supportsStrictMode` | boolean | | Whether the provider supports strict JSON-schema function tools. Defaults are API-specific; generated OpenAI models enable it explicitly. |
152
156
  | `supportsOpenAIGrammarTools` | boolean | `false` | Whether to emit OpenAI custom tools with Lark or regex grammar formats. When false, grammar-constrained tools fall back to normal function tools. The generated catalog enables this for capable models. |
@@ -172,6 +176,7 @@ Also applies to `azure-openai-responses` and `openai-codex-responses`.
172
176
  | `supportsMidConvoEffort` | boolean | `false` | Whether the exact model transport supports effort-only system messages and thinking binding controls. |
173
177
  | `supportsMidConvoSystemMessages` | boolean | `false` | Whether the exact model accepts system-role messages inside the conversation. When false, later system messages are folded into the top-level system prompt. |
174
178
  | `supportsMidConvoToolChanges` | boolean | `false` | Whether the exact model accepts mid-conversation tool_addition and tool_removal blocks. Requires supportsMidConvoSystemMessages. |
179
+ | `supportsMessageThreads` | boolean | | Whether the endpoint supports Anthropic message threads, which let a request with a session id send only the new messages and continue from the previous reply. Default: true for provider anthropic with a baseUrl on api.anthropic.com, false otherwise. Set true for gateways that forward the thread request field. |
175
180
  | `allowedFallbackModels` | `object[]` | | Models Anthropic accepts for server-side refusal fallback, with local pricing metadata for returned fallback responses. When absent or empty, callers must omit fallbacks; Anthropic rejects the field for models with no permitted fallback targets. |
176
181
 
177
182
  ### `bedrock-converse-stream`
package/docs/models.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Choose a Model
2
2
 
3
- For a built-in provider, start with `/login`, then choose a model with `/model`. Use custom model configuration only when Pi does not already include the provider or endpoint you need.
3
+ For a built-in provider, start with `pi auth login <provider>`, then choose a model with `--model`. Use custom model configuration only when Pi does not already include the provider or endpoint you need.
4
4
 
5
5
  ## Choose a connection
6
6
 
7
7
  | What you have | Recommended setup |
8
8
  |---|---|
9
- | A supported subscription | Sign in through `/login` |
10
- | A provider API key | Store it through `/login` or set its environment variable |
9
+ | A supported subscription | Sign in with `pi auth login <provider>` |
10
+ | A provider API key | Store it with `pi auth login <provider> --api-key` or set its environment variable |
11
11
  | A local GGUF model | Connect Pi to the llama.cpp router |
12
12
  | An OpenAI-, Anthropic-, or Google-compatible endpoint | Add it to `models.json` |
13
13
  | A provider with a custom protocol or authentication flow | Build or install a provider extension |
@@ -16,7 +16,7 @@ Browse the [model catalog](https://pi.dev/models) for current providers, model I
16
16
 
17
17
  ## Authenticate
18
18
 
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.
19
+ Run `pi auth login <provider>`. Pi stores credentials in [`auth.json`](configuration.md#agent-directory). Run `pi auth logout <provider>` to remove stored credentials for a provider. See [Credential commands](cli.md#credential-commands).
20
20
 
21
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
 
@@ -26,17 +26,15 @@ Keep `auth.json` and any credential commands private. Project settings and exten
26
26
 
27
27
  ## Select a model
28
28
 
29
- Run `/model` to search available models. The picker shows models whose providers have usable authentication. Press `Ctrl+S` on a model to save it as the default for new sessions.
29
+ Run `pi --list-models [search]` to list models whose providers have usable authentication. Select one for a run with `--model`, optionally with a thinking-level suffix such as `--model sonnet:high`, or with `--thinking`. Save defaults for new sessions with the `defaultModel`, `defaultProvider`, and `defaultThinkingLevel` [settings](settings.md#model-and-thinking). Pi limits the thinking level to levels supported by the selected model.
30
30
 
31
- Run `/thinking` to select the thinking level for the current model. Press `Ctrl+S` there to save the startup level. Pi limits the choices to levels supported by the selected model.
32
-
33
- `Ctrl+P` cycles through available models. Use `/scoped-models` to control that cycle and save the selection, or configure model patterns through [Settings](settings.md#model-cycling).
31
+ RPC clients list models with [`get_available_models`](rpc-commands.md#get_available_models) and switch with [`set_model`](rpc-commands.md#set_model) and [`set_thinking_level`](rpc-commands.md#set_thinking_level). [`cycle_model`](rpc-commands.md#cycle_model) cycles through the models scoped with `--models` or the `enabledModels` [setting](settings.md#model-cycling). Extensions use `pi.setModel()` and `pi.setThinkingLevel()`.
34
32
 
35
33
  A session records model and thinking-level changes. Resuming the session restores them without changing defaults for new sessions.
36
34
 
37
35
  ## Connect local models
38
36
 
39
- Pi integrates directly with the llama.cpp router. The router discovers GGUF files and loads models on demand. Pi's `/llama` command manages the router, while `/model` selects one of its loaded models.
37
+ Pi integrates directly with the llama.cpp router. The router discovers GGUF files and loads models on demand. Pi's `/llama` extension command manages the router, while `--model` or RPC `set_model` selects one of its loaded models.
40
38
 
41
39
  Follow [Local Models with llama.cpp](llama-cpp.md) for server startup, model layout, downloads, and connection troubleshooting.
42
40
 
@@ -64,7 +62,7 @@ Use [`models.json`](configuration.md#agent-directory) when an endpoint speaks an
64
62
 
65
63
  The dummy key makes the model available to Pi; Ollama ignores it. For an authenticated endpoint, `apiKey` and header values can use `$NAME` or `${NAME}` environment interpolation, a literal value, or a leading `!command`. `$$` and `$!` produce a literal `$` and `!`. Commands in `models.json` run at request time and are not cached by Pi.
66
64
 
67
- Opening `/model` reloads the file. A `models` entry adds or replaces a model with the same ID on that provider. Use `modelOverrides` to change metadata for an existing built-in or extension-provided model without replacing the provider's model list. Unknown override IDs are ignored.
65
+ Pi reads the file at startup; restart Pi after editing it. A `models` entry adds or replaces a model with the same ID on that provider. Use `modelOverrides` to change metadata for an existing built-in or extension-provided model without replacing the provider's model list. Unknown override IDs are ignored.
68
66
 
69
67
  To route a built-in provider through a proxy, set only its `baseUrl`. Its models and authentication stay unchanged:
70
68
 
@@ -141,22 +139,23 @@ Compatibility settings should describe verified differences in the endpoint's re
141
139
 
142
140
  ## Use classifier models
143
141
 
144
- 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, Cloudflare's Clef, Clef Flash, and Clef Omni models from Workers AI and OpenRouter, and OpenAI's GPT-6 Luna through the [Decisions API](https://developers.openai.com/api/docs/guides/decisions):
142
+ 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, Cloudflare's Clef, Clef Flash, and Clef Omni models from Workers AI and OpenRouter, OpenAI's GPT-6 Luna through the [Decisions API](https://developers.openai.com/api/docs/guides/decisions), and Microsoft-Decision-1 through GitHub Copilot:
145
143
 
146
144
  | Provider | Model IDs | Authentication |
147
145
  |---|---|---|
148
146
  | `typesafe` | `jev-latest` | `TYPESAFE_API_KEY` |
149
- | `openrouter` | `typesafe/jev-1.13`, `typesafe/jev-1.14`, `~typesafe/jev-latest`, `cloudflare/clef`, `cloudflare/clef-flash`, `cloudflare/clef-omni` | `OPENROUTER_API_KEY` or `/login` |
147
+ | `openrouter` | `typesafe/jev-1.13`, `typesafe/jev-1.14`, `~typesafe/jev-latest`, `cloudflare/clef`, `cloudflare/clef-flash`, `cloudflare/clef-omni` | `OPENROUTER_API_KEY` or `pi auth login openrouter` |
150
148
  | `cloudflare-workers-ai` | `typesafe/jev`, `typesafe/jev-1.14.0`, `@cf/cloudflare/clef`, `@cf/cloudflare/clef-flash`, `@cf/cloudflare/clef-omni` | `CLOUDFLARE_API_KEY` and `CLOUDFLARE_ACCOUNT_ID` |
151
149
  | `vercel-ai-gateway` | `typesafe-ai/jev` | `AI_GATEWAY_API_KEY` |
152
150
  | `opencode` | `jev-1.13`, `jev-1.13-free` | `OPENCODE_API_KEY` |
153
151
  | `openai` | `gpt-6-luna` | `OPENAI_API_KEY` |
152
+ | `github-copilot` | `microsoft-decision-1` | `COPILOT_GITHUB_TOKEN` or `pi auth login github-copilot` |
154
153
 
155
154
  Chat models on a [llama.cpp router](llama-cpp.md#classification) are also listed as classifier models.
156
155
 
157
- OpenAI's Decisions API needs an API key. Sign in with ChatGPT credentials do not work with it, so `gpt-6-luna` is not listed as available while `openai` is logged in through `/login`, even when `OPENAI_API_KEY` is set; log out of `openai` to use the key. The API rejects inputs above 922K tokens, but requests that run longer than about five seconds, currently above roughly 600K input tokens, fail with a gateway timeout.
156
+ OpenAI's Decisions API needs an API key. Sign in with ChatGPT credentials do not work with it, so `gpt-6-luna` is not listed as available while `openai` is logged in through `pi auth login`, even when `OPENAI_API_KEY` is set; log out of `openai` to use the key. The API rejects inputs above 922K tokens, but requests that run longer than about five seconds, currently above roughly 600K input tokens, fail with a gateway timeout.
158
157
 
159
- 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 })`:
158
+ Classifier models do not appear in `--list-models` or RPC `get_available_models`. 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 })`:
160
159
 
161
160
  ```js
162
161
  const jev = await models.getModelOfType("classifier", "typesafe", "jev-latest");
@@ -179,15 +178,15 @@ Classifier models whose `input` includes `"image"` also judge images passed in `
179
178
 
180
179
  Each System One service takes images in its own request format, set by the model's `compat.imageInput`. Built-in models set it, so overriding a provider's `baseUrl` keeps it. A custom provider that proxies another service's classifiers sets it in its provider-level `compat` in `models.json` (see [System One compatibility](models-configuration.md#typesafe-system-one)). OpenRouter in particular answers requests in TypeSafe's format without an error but drops the images.
181
180
 
182
- 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.
181
+ 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 RPC `get_session_stats`. The cost uses the model's catalog price; models without one, such as TypeSafe's direct `jev-latest`, report tokens at no cost.
183
182
 
184
183
  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.
185
184
 
186
185
  ## Use image models
187
186
 
188
- 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.
187
+ 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 stored credential as its chat models.
189
188
 
190
- 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:
189
+ Like classifier models, image models do not appear in `--list-models`; 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:
191
190
 
192
191
  ```js
193
192
  const painter = await models.getModelOfType("image", "openrouter", "google/gemini-2.5-flash-image");
@@ -210,7 +209,7 @@ Use an extension when the provider needs custom streaming, model discovery, or a
210
209
 
211
210
  ### A model does not appear
212
211
 
213
- Confirm that its provider has usable authentication. Custom models can load from `models.json` but remain unavailable in `/model` until Pi can resolve credentials. For llama.cpp, only models currently loaded by the router appear.
212
+ Confirm that its provider has usable authentication. Custom models can load from `models.json` but remain unavailable to `--model` until Pi can resolve credentials. For llama.cpp, only models currently loaded by the router appear.
214
213
 
215
214
  ### Authentication works in one shell only
216
215
 
@@ -218,7 +217,7 @@ Check whether the key came from an environment variable rather than `auth.json`.
218
217
 
219
218
  ### Sign-in opens a browser on a remote machine
220
219
 
221
- Complete the provider's headless authentication flow when available. Some providers let you paste the final redirect URL or authorization code back into Pi. See [Authenticate interactively](providers.md#authenticate-interactively).
220
+ Complete the provider's headless authentication flow when available. `pi auth login <provider> --no-browser` uses another sign-in method, such as a device code, and some providers let you paste the final redirect URL or authorization code back into Pi. See [Authenticate interactively](providers.md#authenticate-interactively).
222
221
 
223
222
  ### A compatible endpoint rejects requests
224
223
 
@@ -91,6 +91,6 @@ Use the [router health checks](llama-cpp.md#troubleshooting) to confirm that the
91
91
 
92
92
  ## Use the model in Pi
93
93
 
94
- Follow [Configure Pi](llama-cpp.md#configure-pi) and connect to `http://127.0.0.1:8080`. The preset section name is the model ID, so select `qwen3.8-27b` in `/model` for this example.
94
+ Follow [Configure Pi](llama-cpp.md#configure-pi) and connect to `http://127.0.0.1:8080`. The preset section name is the model ID, so select it with `--model qwen3.8-27b` for this example.
95
95
 
96
96
  NVIDIA recipe memory settings assume that only the selected model uses the GPU. If `/llama` shows other loaded models, unload them before using the recipe model.
package/docs/packages.md CHANGED
@@ -16,6 +16,8 @@ pi install ./local-package
16
16
 
17
17
  `pi list` shows configured packages. Use `pi remove <source>` to remove one and `pi update --extensions` to reconcile package installations. See [Command Line](cli.md#package-commands) for every package command and option.
18
18
 
19
+ If a configured package fails to install at startup, for example because npm cannot reach the registry, Pi warns about it, skips that package's resources, and keeps running. Pi tries to install it again on the next start or reload. `pi install` and `pi update --extensions` still report the failure and exit non-zero.
20
+
19
21
  Personal installs are written to `~/.pi/agent/settings.json`. Add `--local` or `-l` to write the package declaration to `.pi/settings.json`. Pi reads declarations from that file only after project trust is granted.
20
22
 
21
23
  Project packages are installed and loaded only after project trust is resolved. Packages can execute extension code and can include skills that instruct the model to run programs. Review third-party package source before installing it. Review project package declarations before granting project trust.
@@ -26,6 +28,8 @@ Use `--extension` or `-e` to try a package for one invocation without adding it
26
28
  pi -e npm:@example/pi-tools
27
29
  ```
28
30
 
31
+ Pi caches `-e` packages under `~/.pi/agent/tmp/extensions/` and checks them on every start and reload. An npm package is reinstalled when the registry has a newer version that matches the specification. A version pinned to an exact number, such as `@1.2.3`, is not checked. A git package is fetched and reset to the remote branch or ref. A ref that is a commit hash already checked out is not fetched. If the check fails or offline mode is on, Pi loads the cached copy.
32
+
29
33
  ## Choose a source
30
34
 
31
35
  | Source | Example | Behavior |
@@ -73,6 +77,22 @@ Paths are relative to the package root. Arrays accept glob patterns and exclusio
73
77
 
74
78
  The `pi-package` keyword makes an npm package eligible for discovery in the [Pi package gallery](https://pi.dev/packages). Optional `pi.image` and `pi.video` fields add gallery previews.
75
79
 
80
+ ## Point to a changelog
81
+
82
+ Pi does not display package changelogs. It resolves each package's changelog path and reports it as `changelogPath` in the source information of the package's resources, for example in RPC [`get_commands`](rpc-commands.md#get_commands) results, so clients can show it.
83
+
84
+ By default Pi uses `CHANGELOG.md` from the package root. Point `pi.changelogPath` at another file inside the package, or set it to `""` to report none:
85
+
86
+ ```json
87
+ {
88
+ "name": "my-pi-package",
89
+ "version": "1.2.0",
90
+ "pi": {
91
+ "changelogPath": "./docs/CHANGELOG.md"
92
+ }
93
+ }
94
+ ```
95
+
76
96
  ## Declare dependencies
77
97
 
78
98
  Put runtime packages imported by extensions in `dependencies`. Pi installs package dependencies when it installs an npm or git source.
@@ -118,7 +138,7 @@ For each resource type:
118
138
 
119
139
  Filters narrow the package manifest. They do not expose resources that the package itself did not declare.
120
140
 
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.
141
+ Enable or disable discovered resources and Pi's built-in extensions by editing the resource arrays in [settings](settings.md#resources). Run `pi config` to print the resolved resources as JSON, or `pi config --local` to print them with project overrides.
122
142
 
123
143
  ## Understand scope and identity
124
144
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Prompt templates turn Markdown files into reusable `/` commands. Use one when you want to reuse the same prompt without adding executable behavior or a larger set of supporting instructions.
4
4
 
5
- A template can accept arguments and appear in command completion. Pi can load templates from personal configuration, project configuration, an explicit path, or a Pi package. Project configuration loads only after project trust is granted.
5
+ A template can accept arguments and appears in the RPC [`get_commands`](rpc-commands.md#get_commands) list. Pi can load templates from personal configuration, project configuration, an explicit path, or a Pi package. Project configuration loads only after project trust is granted.
6
6
 
7
7
  ## Create a template
8
8
 
@@ -16,23 +16,25 @@ argument-hint: "[focus]"
16
16
  Review the staged changes. Focus on ${1:-correctness, security, and error handling}.
17
17
  ```
18
18
 
19
- The filename becomes the command name, so this template is available as `/review`. The `description` appears in command completion. If it is omitted, Pi uses the first non-empty line.
19
+ The filename becomes the command name, so this template is available as `/review`. The `description` appears in `get_commands`. If it is omitted, Pi uses the first non-empty line.
20
20
 
21
21
  `argument-hint` is optional. Use `<angle brackets>` for required arguments and `[square brackets]` for optional arguments.
22
22
 
23
- Run `/reload` after adding or changing a template in an active session.
23
+ Pi loads templates at startup. Restart Pi after adding or changing a template, or reload a running session from an extension command with `ctx.reload()`.
24
24
 
25
25
  <a id="invoke-a-template"></a>
26
26
 
27
27
  ## Use a template
28
28
 
29
- Type the template command in the editor:
29
+ Send the template command as a prompt:
30
30
 
31
- ```text
32
- /review
33
- /review concurrency
31
+ ```bash
32
+ pi -p /review
33
+ pi -p "/review concurrency"
34
34
  ```
35
35
 
36
+ In RPC mode, send the same text through the [`prompt`](rpc-commands.md#prompt) command.
37
+
36
38
  Pi expands the template before the resulting text enters the agent. Extensions receive the raw input first through the `input` event unless an extension command with the same name handles it.
37
39
 
38
40
  Templates support these substitutions:
@@ -46,7 +48,7 @@ Templates support these substitutions:
46
48
  | `${@:N}` | Arguments starting at position `N` |
47
49
  | `${@:N:L}` | `L` arguments starting at position `N` |
48
50
 
49
- Arguments follow shell-like quoting, so `/review "API compatibility"` supplies one argument containing a space.
51
+ Arguments follow shell-like quoting, so `/review "API compatibility"` supplies one argument containing a space. A quote only starts quoting at the beginning of an argument, so apostrophes inside words such as `doesn't` stay as text, and a quote with no closing match is kept as text. Inside a quoted argument, a backslash before the same quote character keeps it as text, so `/review "the \"fast\" path"` supplies `the "fast" path`; other backslashes are kept as typed.
50
52
 
51
53
  <a id="choose-where-it-loads"></a>
52
54
 
@@ -56,4 +58,4 @@ Place the template in your user or project prompt directory. Conventional prompt
56
58
 
57
59
  Settings and packages can select nested Markdown files; a package manifest can narrow discovery with explicit paths and globs. See [Settings](settings.md#resources) and [Pi Packages](packages.md) for these options.
58
60
 
59
- Project templates become commands in the editor after trust is granted. Review their content before trusting an unfamiliar project. See [Security](security.md#understand-project-trust).
61
+ Project templates become commands after trust is granted. Review their content before trusting an unfamiliar project. See [Security](security.md#understand-project-trust).