@punch-bot/cli 1.5.0 → 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 +168 -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-RFVYQ7ZX.js → chunk-LOHGXPCL.js} +2 -2
  19. package/dist/bundle/chunks/{chunk-NO2FNWW3.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-BRECMFDT.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-FDCKYGTP.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-2ESDEFYR.js → google-generative-ai-KA6FZCHM.js} +1 -1
  33. package/dist/bundle/chunks/{google-vertex-YERBWL2T.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-M4KMJHPS.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-PPJMQ3W4.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-WWPCCAPX.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-NLWRPIRL.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 +19 -29
  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 +58 -53
  451. package/package.json +15 -17
  452. package/schemas/models.schema.json +65 -36
  453. package/schemas/settings.schema.json +17 -243
  454. package/dist/bundle/chunks/anthropic-messages-WCANLUXE.js +0 -6
  455. package/dist/bundle/chunks/azure-openai-responses-46GRAI5B.js +0 -2
  456. package/dist/bundle/chunks/chunk-37OLNCAX.js +0 -16
  457. package/dist/bundle/chunks/chunk-3V45WARH.js +0 -7
  458. package/dist/bundle/chunks/chunk-4LBJE4YM.js +0 -14
  459. package/dist/bundle/chunks/chunk-4NE64BTO.js +0 -82
  460. package/dist/bundle/chunks/chunk-5NXXRYVM.js +0 -2
  461. package/dist/bundle/chunks/chunk-7BOHO7TR.js +0 -1190
  462. package/dist/bundle/chunks/chunk-7XECPCHN.js +0 -2
  463. package/dist/bundle/chunks/chunk-NJK3U3WK.js +0 -8
  464. package/dist/bundle/chunks/chunk-PLK2QSUR.js +0 -2
  465. package/dist/bundle/chunks/chunk-TEPMHNKQ.js +0 -2
  466. package/dist/bundle/chunks/chunk-UE7JCDFW.js +0 -2
  467. package/dist/bundle/chunks/chunk-UKVNB6C4.js +0 -2
  468. package/dist/bundle/chunks/chunk-USJZMAIR.js +0 -2
  469. package/dist/bundle/chunks/chunk-WZONBDPY.js +0 -11
  470. package/dist/bundle/chunks/cli-W5KJM7YB.js +0 -51
  471. package/dist/bundle/chunks/mistral-conversations-D6VQXE7C.js +0 -5
  472. package/dist/bundle/chunks/openai-codex-responses-QSNSWBYG.js +0 -10
  473. package/dist/bundle/chunks/openai-completions-72VXSFHQ.js +0 -7
  474. package/dist/bundle/chunks/openai-responses-PMTL72CY.js +0 -4
  475. package/dist/bundle/chunks/pi-messages-WVCFUCBL.js +0 -8
  476. package/dist/bundle/chunks/virtual-modules-7Y5QW4VK.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 -92
  505. package/examples/extensions/sandbox/package.json +0 -19
package/docs/cli.md CHANGED
@@ -12,8 +12,10 @@ pi uninstall <source> [options]
12
12
  pi update [target] [options]
13
13
  pi list
14
14
  pi config [options]
15
+ pi auth login <provider> [--api-key] [--no-browser]
16
+ pi auth logout <provider>
15
17
  pi auth <check|print-api-key|print-bearer-token> [options]
16
- pi mcp <list|login|logout> [options]
18
+ pi mcp <add|remove|list|login|logout> [options]
17
19
  ```
18
20
 
19
21
  <a id="modes"></a>
@@ -21,13 +23,13 @@ pi mcp <list|login|logout> [options]
21
23
  ## Invocation and output
22
24
 
23
25
  ```sh
24
- pi
26
+ pi "Summarize this repository"
25
27
  pi --print "Summarize this repository"
26
28
  git diff | pi --print "Review this change"
27
29
  pi --mode json "Inspect this repository" > events.jsonl
28
30
  ```
29
31
 
30
- With terminal stdin and stdout, Pi opens the terminal UI unless `--print`, `--mode json`, or `--mode rpc` selects another interface. When either stream is redirected and neither JSON nor RPC mode is selected, Pi uses print mode. See [CLI Integration](cli-integration.md) for choosing between interactive, print, JSON, RPC, and SDK integration.
32
+ Pi runs in print mode unless `--mode json` or `--mode rpc` selects another interface. See [CLI Integration](cli-integration.md) for choosing between print, JSON, RPC, and SDK integration.
31
33
 
32
34
  | Input | Behavior |
33
35
  |---|---|
@@ -38,12 +40,12 @@ With terminal stdin and stdout, Pi opens the terminal UI unless `--print`, `--mo
38
40
 
39
41
  Pi resolves `@path` from the current working directory. The working directory also controls project configuration, resource discovery, and session grouping.
40
42
 
41
- `--print` controls whether Pi runs once and exits. `--mode` selects the output interface. `--mode text` does not force one-shot execution when stdin and stdout are terminals; use `--print` for that behavior.
43
+ `--mode` selects the output interface. `--mode text` is the default and is the same as `--print`.
42
44
 
43
45
  | Option | Behavior |
44
46
  |---|---|
45
47
  | `-p`, `--print` | Run the supplied prompts, write the final assistant text to stdout, then exit |
46
- | `--mode text` | Select text output; still open the terminal UI when stdin and stdout are terminals |
48
+ | `--mode text` | Same as `--print` |
47
49
  | `--mode json` | Run the supplied prompts, write JSONL events to stdout, then exit |
48
50
  | `--mode rpc` | Read JSONL commands from stdin and write responses and events to stdout until shutdown |
49
51
  | `--export <input> [output]` | Export a session file to HTML and exit; derive the destination when `output` is omitted |
@@ -69,7 +71,7 @@ See [Choose a Model](models.md) for model selection and [Providers](providers.md
69
71
  - `--thinking <level>`<br>
70
72
  Sets `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`. It overrides a `--model` suffix and is clamped to the model's capabilities.
71
73
  - `--models <patterns>`<br>
72
- Sets a comma-separated scope for startup and cycling. It accepts exact IDs, partial matches (with a warning), case-insensitive globs, and optional `:<thinking>` suffixes. A model offered by several providers is added for each, with a warning. An entry that matches nothing is skipped with a warning.
74
+ Sets a comma-separated scope for startup and RPC `cycle_model`. It accepts exact IDs, partial matches (with a warning), case-insensitive globs, and optional `:<thinking>` suffixes. A model offered by several providers is added for each, with a warning. An entry that matches nothing is skipped with a warning.
73
75
  - `--list-models [search]`<br>
74
76
  Lists available models, optionally filtered by a fuzzy search, then exits.
75
77
 
@@ -84,15 +86,15 @@ pi --continue
84
86
  See [Sessions and Context](sessions.md) for resuming, forking, naming, and storing sessions.
85
87
 
86
88
  - `-c`, `--continue`<br>
87
- Continues the most recent session for the current project.
89
+ Continues the most recent session for the current directory.
88
90
  - `-r`, `--resume`<br>
89
- Opens the session selector.
91
+ Alias for `--continue`.
90
92
  - `--session <path|id>`<br>
91
- Opens by file path, exact ID, or partial ID. Pi searches the current project first and offers to fork a cross-project match.
93
+ Opens a session by file path or full/partial ID. Pi exits with an error when the session belongs to another directory and suggests `--fork`.
92
94
  - `--session-id <id>`<br>
93
- Opens the exact project session ID or creates it if absent. IDs accept letters, numbers, `.`, `_`, and `-`.
95
+ Opens the current directory's existing session with the ID, or creates it otherwise. IDs accept letters, numbers, `.`, `_`, and `-`.
94
96
  - `--fork <path|id>`<br>
95
- Forks an existing session into a new session for the current project.
97
+ Forks a session, chosen by file path or full/partial ID, into a new session in the current directory.
96
98
  - `--session-dir <dir>`<br>
97
99
  Overrides storage and lookup. It takes precedence over `PI_CODING_AGENT_SESSION_DIR` and the `sessionDir` setting.
98
100
  - `--no-session`<br>
@@ -125,7 +127,7 @@ See [Settings](settings.md#tools) for configuring the default tool selection.
125
127
  - `-nt`, `--no-tools`<br>
126
128
  Starts with all built-in, extension, custom, and MCP tools disabled.
127
129
 
128
- Default enabled tools are `read`, `bash`, `edit`, and `write`, unless `defaultTools` changes them. `--tools` with plain names replaces the whole selection, so name every tool you want. Like `defaultTools`, it also accepts a list of only `+name` and `-name` entries, which adds tools to or removes them from the default selection: `pi --tools +codemode,-write` keeps the other default tools, enables `codemode`, and disables `write`. These entries take exact tool names, not `*` patterns; use `--exclude-tools` to disable tools by pattern. Plain names and `+name`/`-name` entries cannot be mixed. `/reload` enables tools newly added to `defaultTools`, but a tool removed with `-name` stays removed.
130
+ Default enabled tools are `read`, `bash`, `edit`, and `write`, unless `defaultTools` changes them. `--tools` with plain names replaces the whole selection, so name every tool you want. Like `defaultTools`, it also accepts a list of only `+name` and `-name` entries, which adds tools to or removes them from the default selection: `pi --tools +codemode,-write` keeps the other default tools, enables `codemode`, and disables `write`. These entries take exact tool names, not `*` patterns; use `--exclude-tools` to disable tools by pattern. Plain names and `+name`/`-name` entries cannot be mixed. Reloading with an extension command's `ctx.reload()` enables tools newly added to `defaultTools`, but a tool removed with `-name` stays removed.
129
131
 
130
132
  <a id="mcp-tools"></a>
131
133
 
@@ -148,7 +150,7 @@ The MCP resource tools (`list_mcp_resources`, `list_mcp_resource_templates`, `re
148
150
  | `find` | Find paths using glob patterns |
149
151
  | `ls` | List directory contents |
150
152
 
151
- Built-in extensions add two more tools. They are off by default; the MCP extension turns them on when an MCP server needs them (see [MCP](mcp.md#exposure)). To enable them yourself, name them in `--tools` or `defaultTools`.
153
+ Built-in extensions add two more tools. They are off by default; the MCP extension turns them on when an MCP server needs them (see [MCP](mcp.md#control-tool-exposure)). To enable them yourself, name them in `--tools` or `defaultTools`.
152
154
 
153
155
  | Built-in extension | Purpose |
154
156
  |---|---|
@@ -196,7 +198,7 @@ See [Configuration](configuration.md) for conventional directories and project t
196
198
  - `-ne`, `--no-extensions`<br>
197
199
  Disables discovered, configured, and built-in extensions. Explicit `-e` paths still load, so `pi -ne -e builtin:mcp` keeps only the built-in MCP support.
198
200
  - `--no-mcp`<br>
199
- Disables the built-in MCP support for this run: no servers connect, and there are no MCP tools or `/mcp`. It does not affect an extension that replaces the built-in MCP support.
201
+ Disables the built-in MCP support for this run: no servers connect, and there are no MCP tools or `/mcp` command. It does not affect an extension that replaces the built-in MCP support.
200
202
  - `--skill <path>`<br>
201
203
  Loads a skill file or directory and is repeatable.
202
204
  - `-ns`, `--no-skills`<br>
@@ -207,8 +209,8 @@ See [Configuration](configuration.md) for conventional directories and project t
207
209
  Disables discovered and configured templates. Explicit `--prompt-template` paths still load.
208
210
  - `--theme <path>`<br>
209
211
  Loads a theme file or directory and is repeatable.
210
- - `--use-theme <name[/name]>`<br>
211
- Selects the initial interactive theme for this run.
212
+ - `--use-theme <name>`<br>
213
+ Selects the [theme](themes.md) for this run without changing settings.
212
214
  - `--no-themes`<br>
213
215
  Disables discovered and configured themes. Explicit `--theme` paths still load.
214
216
  - `-nc`, `--no-context-files`<br>
@@ -230,10 +232,6 @@ See [Configuration](configuration.md) for saved configuration, [Security](securi
230
232
  Replaces the opening of the default system prompt with text or the contents of an existing file. The tool list and rules still follow it.
231
233
  - `--append-system-prompt <text|path>`<br>
232
234
  Appends text or an existing file to the system prompt and is repeatable.
233
- - `--tui-mode <mode>`<br>
234
- Uses `fullscreen` (default) or `regular` terminal mode.
235
- - `--verbose`<br>
236
- Shows verbose interactive startup information, overriding `quietStartup`.
237
235
  - `-a`, `--approve`<br>
238
236
  Trusts project-local configuration and resources for this process.
239
237
  - `-na`, `--no-approve`<br>
@@ -262,7 +260,7 @@ See [Pi Packages](packages.md) for source formats, filtering, installation, and
262
260
  | Install a package | `pi install <source>` |
263
261
  | List configured packages | `pi list` |
264
262
  | Remove a package and its settings entry | `pi remove <source>` |
265
- | Configure which package resources load | `pi config` |
263
+ | Print the resolved package resources as JSON | `pi config` |
266
264
 
267
265
  Add `--local` or `-l` to `install`, `remove`, `uninstall`, or `config` to use project settings instead of global settings.
268
266
 
@@ -282,6 +280,16 @@ Add `--force` to reinstall Pi when the selected update includes Pi.
282
280
 
283
281
  `pi update` cannot update Pi when another package manager provides it, such as Nix. Update Pi with that package manager, for example `nix profile upgrade pi`. Package and model catalog updates still work.
284
282
 
283
+ #### Custom update command
284
+
285
+ If a wrapper or another package manager provides Pi, set `PI_SELF_UPDATE_COMMAND` so `pi update` runs its update command:
286
+
287
+ ```sh
288
+ export PI_SELF_UPDATE_COMMAND="mise use -g npm:{packageName}@{version}"
289
+ ```
290
+
291
+ `pi update` runs it only when pi.dev has a newer release, replacing `{packageName}`, `{version}`, and `{installSpec}` (`{packageName}@{version}`) with that release. The value is split on spaces. For arguments with spaces, use the `selfUpdateCommand` setting in `~/.pi/agent/settings.json` instead, an argv array such as `["nix", "profile", "upgrade", "pi"]`.
292
+
285
293
  ### Aliases and command options
286
294
 
287
295
  - `pi uninstall <source>` is an alias for `pi remove <source>`.
@@ -292,11 +300,22 @@ Add `--force` to reinstall Pi when the selected update includes Pi.
292
300
 
293
301
  ## Credential commands
294
302
 
303
+ `pi auth login <provider>` logs in to a provider in the terminal and exits, without starting a session. It signs in with an account and opens the browser. Providers without account sign-in ask for an API key. Providers registered by extensions, such as `llama.cpp`, are not available. Logging in to Radius also adds the Radius MCP server to `~/.pi/agent/mcp.json` when no global server uses that login yet. It requires an interactive terminal.
304
+
305
+ | Option | Description |
306
+ |---|---|
307
+ | `--api-key` | Save an API key instead of signing in with an account; the key is read without echoing it |
308
+ | `--no-browser` | Do not open a browser; use the provider's other sign-in method, such as a device code, for example over SSH. Asks when there are several. Not allowed with `--api-key` |
309
+
310
+ `pi auth logout <provider>` removes the credentials that `pi auth login` stored. Environment variables and `models.json` config are unchanged. It exits with status `0` when nothing is stored, so it is safe to repeat.
311
+
295
312
  ```sh
313
+ pi auth login radius
314
+ pi auth logout radius
296
315
  pi auth check --provider openai --json
297
316
  ```
298
317
 
299
- Authentication commands require `--provider <provider>` or `--model <model>`. See [Providers](providers.md) for supported methods.
318
+ The other authentication commands require `--provider <provider>` or `--model <model>`. See [Providers](providers.md) for supported methods.
300
319
 
301
320
  | Command | Description |
302
321
  |---|---|
@@ -322,12 +341,12 @@ These commands work outside a session, so agents can run them through `bash`. Se
322
341
  | Command | Description |
323
342
  |---|---|
324
343
  | `pi mcp add <server> [options] -- <command> [args...]` | Add or replace a stdio server in `mcp.json`; `--env KEY=VALUE` (repeatable) and `--cwd <dir>` set its environment and working directory. Arguments after the command are passed to it |
325
- | `pi mcp add <server> [options] --url <url>` | Add or replace a streamable HTTP server; `--header KEY=VALUE` (repeatable), `--bearer-token-env-var <NAME>` (sends `Authorization: Bearer ${NAME}`), `--oauth-client-id`, `--oauth-client-secret`, `--oauth-callback-port`, and `--oauth-client-name` configure authentication |
344
+ | `pi mcp add <server> [options] --url <url>` | Add or replace a streamable HTTP server; `--header KEY=VALUE` (repeatable), `--bearer-token-env-var <NAME>` (sends `Authorization: Bearer ${NAME}`), `--oauth-client-id`, `--oauth-client-secret`, `--oauth-callback-port`, `--oauth-client-name`, and `--oauth-client-registration` (`auto`, `cimd`, or `dcr`) configure authentication |
326
345
  | `pi mcp remove <server>` | Remove a server from `mcp.json`; stored OAuth credentials are kept |
327
346
  | `pi mcp list [--json]` | Connect to every enabled server and print its state, tools, and errors; exit with `1` when a config entry is invalid or an enabled server is not connected |
328
- | `pi mcp login <server> [--timeout <seconds>]` | Sign in to an OAuth server: open the authorization page and wait for the browser; a terminal also accepts the pasted redirect URL. `--timeout` limits the whole sign-in, including requests to the authorization server (default 300 seconds) |
329
- | `pi mcp logout <server>` | Delete the stored OAuth credentials of a server |
347
+ | `pi mcp login <server> [-l] [--timeout <seconds>]` | Sign in to an OAuth server: open the authorization page and wait for the browser; a terminal also accepts the pasted redirect URL. `--timeout` limits the whole sign-in, including requests to the authorization server (default 300 seconds). `-l` requires the server to be defined in the project's `.pi/mcp.json` |
348
+ | `pi mcp logout <server> [-l]` | Delete the stored OAuth credentials of a server |
330
349
 
331
- `add` and `remove` change `~/.pi/agent/mcp.json`, or `.pi/mcp.json` in the current directory with `--local` (`-l`). `add` also takes `--exposure <mode>` (see [Exposure](mcp.md#exposure)) and `--description <text>` and does not connect; run `pi mcp list` to check the server.
350
+ `add` and `remove` change `~/.pi/agent/mcp.json`, or `.pi/mcp.json` in the current directory with `--local` (`-l`). `add` also takes `--exposure <mode>` (see [Exposure](mcp.md#control-tool-exposure)) and `--description <text>` and does not connect; run `pi mcp list` to check the server.
332
351
 
333
352
  Project `.pi/mcp.json` files are only read for projects that are already trusted.
@@ -17,8 +17,8 @@ Pi has two summarization mechanisms:
17
17
 
18
18
  | Mechanism | Trigger | Purpose |
19
19
  |-----------|---------|---------|
20
- | Compaction | Context exceeds threshold, or `/compact` | Summarize old messages to free up context |
21
- | Branch summarization | `/tree` navigation | Preserve context when switching branches |
20
+ | Compaction | Context exceeds threshold, or RPC `compact` / `ctx.compact()` | Summarize old messages to free up context |
21
+ | Branch summarization | `ctx.navigateTree()` with `summarize: true` | Preserve context when switching branches |
22
22
 
23
23
  Both use closely related structured formats and track file operations cumulatively. Summarization requests disable prompt-cache writes because these one-off prompts are unlikely to be reused.
24
24
 
@@ -38,7 +38,7 @@ During a multi-turn agent run, Pi checks the canonical projected context after t
38
38
 
39
39
  A provider context-overflow error or an early final `stopReason: "length"` can select one compact-and-retry recovery attempt. Length responses with tool calls retain their synthetic failed tool results and follow the ordinary tool/queue scheduler rather than forcing the run to end.
40
40
 
41
- You can also trigger manually with `/compact [instructions]`, where optional instructions focus the summary.
41
+ You can also trigger it manually with the RPC [`compact`](rpc-commands.md#compact) command or `ctx.compact()`, whose optional custom instructions focus the summary.
42
42
 
43
43
  ### How It Works
44
44
 
@@ -170,7 +170,7 @@ See [`prepareCompaction()`](https://github.com/earendil-works/pi/blob/main/packa
170
170
 
171
171
  ### When It Triggers
172
172
 
173
- When you use `/tree` to navigate to a different branch, Pi offers to summarize the work you're leaving. This injects context from the left branch into the new branch.
173
+ When an extension command calls `ctx.navigateTree()` with `summarize: true` to move to a different branch, Pi summarizes the work being left. This injects context from the left branch into the new branch.
174
174
 
175
175
  ### How It Works
176
176
 
@@ -296,7 +296,7 @@ Extensions can intercept and customize both compaction and branch summarization.
296
296
 
297
297
  ### session_before_compact
298
298
 
299
- Fired before auto-compaction or `/compact`. Can cancel or provide custom summary. See `SessionBeforeCompactEvent` and `CompactionPreparation` in the types file.
299
+ Fired before auto-compaction or manual compaction (RPC `compact`, `ctx.compact()`). Can cancel or provide custom summary. See `SessionBeforeCompactEvent` and `CompactionPreparation` in the types file.
300
300
 
301
301
  ```typescript
302
302
  pi.on("session_before_compact", async (event, ctx) => {
@@ -311,7 +311,7 @@ pi.on("session_before_compact", async (event, ctx) => {
311
311
  // preparation.settings - effective settings after applying model overrides
312
312
 
313
313
  // branchEntries - all entries on current branch (for custom state)
314
- // reason - "manual" (/compact), "threshold", or "overflow"
314
+ // reason - "manual" (RPC `compact` or `ctx.compact()`), "threshold", or "overflow"
315
315
  // willRetry - whether the aborted turn is retried after compaction (overflow recovery)
316
316
  // signal - AbortSignal (pass to LLM calls)
317
317
 
@@ -374,7 +374,7 @@ Fired when manual or automatic compaction fails or is aborted. This is useful fo
374
374
  ```typescript
375
375
  pi.on("session_compact_failed", async (event, ctx) => {
376
376
  const { reason, errorMessage, aborted, willRetry, fromExtension } = event;
377
- // reason - "manual" (/compact), "threshold", or "overflow"
377
+ // reason - "manual" (RPC `compact` or `ctx.compact()`), "threshold", or "overflow"
378
378
  // errorMessage - present for non-abort failures
379
379
  // aborted - true for canceled/aborted compactions
380
380
  // willRetry - whether the aborted turn would have retried after compaction
@@ -384,7 +384,7 @@ pi.on("session_compact_failed", async (event, ctx) => {
384
384
 
385
385
  ### session_before_tree
386
386
 
387
- Fired before `/tree` navigation. Always fires regardless of whether user chose to summarize. Can cancel navigation or provide custom summary.
387
+ Fired before `ctx.navigateTree()` navigation. Always fires, whether or not the call asked for a summary. Can cancel navigation or provide custom summary.
388
388
 
389
389
  ```typescript
390
390
  pi.on("session_before_tree", async (event, ctx) => {
@@ -434,7 +434,7 @@ Configure compaction in `~/.pi/agent/settings.json` or `<project-dir>/.pi/settin
434
434
  | `reserveTokens` | `16384` | Free context tokens below which auto-compaction starts |
435
435
  | `keepRecentTokens` | `20000` | Recent tokens to keep (not summarized) |
436
436
 
437
- Disable auto-compaction with `"enabled": false`. You can still compact manually with `/compact`.
437
+ Disable auto-compaction with `"enabled": false`. You can still compact manually with RPC `compact` or `ctx.compact()`.
438
438
 
439
439
  ### Per-model overrides
440
440
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Pi supports user-level and project configuration. User-level configuration lives in the agent directory, which defaults to `~/.pi/agent`. Project configuration lives in `.pi` under the working directory and loads after [project trust](security.md#understand-project-trust) is granted. The only exception is `sessionDir`, which Pi reads before resolving trust so it can locate sessions.
4
4
 
5
- In interactive mode, use `/settings` to change common preferences. For other options, ask Pi to update the configuration or edit the relevant files directly. Run `/reload` after manually changing settings, keybindings, instructions, or resources.
5
+ Edit the files below directly, or ask Pi to update them. Pi reads them at startup, so changes apply to the next Pi process. An extension command can reload a running session with `ctx.reload()`.
6
6
 
7
7
  ## Agent directory
8
8
 
@@ -11,7 +11,6 @@ The agent directory is shown as `<agent-dir>` below. Set its location with the `
11
11
  | Path | Responsibility |
12
12
  |---|---|
13
13
  | `<agent-dir>/settings.json` | User-level [settings](settings.md), including preferences, defaults, resource paths, and Pi package declarations. |
14
- | `<agent-dir>/keybindings.json` | Custom terminal UI and application [keybindings](keybindings.md). |
15
14
  | `<agent-dir>/mcp.json` | [MCP servers](mcp.md) available in every project. |
16
15
  | `<agent-dir>/models.json` | [Compatible endpoints, models, and model overrides](models.md#configure-a-compatible-endpoint). |
17
16
  | `<agent-dir>/auth.json` | Saved API keys and OAuth credentials. |
@@ -8,10 +8,10 @@ You can isolate the complete Pi process or keep Pi on the host and route selecte
8
8
 
9
9
  | Method | Where Pi runs | What is isolated | Credential handling | Best for |
10
10
  |---|---|---|---|---|
11
- | Plain Docker | Container | Pi, built-in tools, `!` commands, and extensions | Credentials passed into the container | A straightforward local container boundary |
12
- | Docker Sandboxes | Managed sandbox | Pi, built-in tools, `!` commands, and extensions | Provider credentials remain on the host and are substituted by the proxy | Managed local isolation without exposing the real provider key |
13
- | OpenShell | Local or remote sandbox | Pi, built-in tools, `!` commands, and extensions | Policy-controlled credentials and inference routing | Filesystem, process, network, and credential policies |
14
- | Gondolin extension | Host | Built-in tools and `!` commands | Stored Pi credentials remain on the host, but commands inherit host environment variables | A local micro-VM for tool execution while retaining the host interface |
11
+ | Plain Docker | Container | Pi, built-in tools, RPC `bash` commands, and extensions | Credentials passed into the container | A straightforward local container boundary |
12
+ | Docker Sandboxes | Managed sandbox | Pi, built-in tools, RPC `bash` commands, and extensions | Provider credentials remain on the host and are substituted by the proxy | Managed local isolation without exposing the real provider key |
13
+ | OpenShell | Local or remote sandbox | Pi, built-in tools, RPC `bash` commands, and extensions | Policy-controlled credentials and inference routing | Filesystem, process, network, and credential policies |
14
+ | Gondolin extension | Host | Built-in tools and RPC `bash` commands | Stored Pi credentials remain on the host, but commands inherit host environment variables | A local micro-VM for tool execution while retaining the host interface |
15
15
 
16
16
  The method changes where extensions run. When the complete Pi process runs inside an isolated environment, its extensions run there too. When host Pi delegates built-in tools through Gondolin, other extension tools still run on the host unless they also delegate their work.
17
17
 
@@ -58,23 +58,25 @@ docker build -t pi-sandbox -f Dockerfile.pi .
58
58
  From the working folder you want Pi to access, run:
59
59
 
60
60
  ```bash
61
- docker run --rm -it \
61
+ docker run --rm -i \
62
62
  -e ANTHROPIC_API_KEY \
63
63
  -v "$PWD:/workspace" \
64
64
  -v pi-agent-home:/root/.pi/agent \
65
- pi-sandbox
65
+ pi-sandbox -p "list the failing tests"
66
66
  ```
67
67
 
68
+ Arguments after the image name are passed to `pi`. Use `--mode rpc` instead of `-p` to drive the container from an RPC client over stdin and stdout.
69
+
68
70
  Replace `ANTHROPIC_API_KEY` with the credential required by your provider. The named `pi-agent-home` volume keeps container-local settings, credentials, and sessions between runs.
69
71
 
70
72
  Do not mount the host's `~/.pi/agent` unless the container should have access to your host Pi configuration and credentials.
71
73
 
72
74
  ### Verify the workspace
73
75
 
74
- Inside Pi, run:
76
+ Ask Pi for its working directory:
75
77
 
76
- ```text
77
- !pwd
78
+ ```bash
79
+ docker run --rm -i -e ANTHROPIC_API_KEY -v "$PWD:/workspace" pi-sandbox --tools bash -p "Run pwd and print its output."
78
80
  ```
79
81
 
80
82
  The command should report `/workspace`. Changes under `/workspace` write through to the mounted host folder. Remove the bind mount or use a read-only mount when that is not acceptable.
@@ -83,7 +85,7 @@ The command should report `/workspace`. Changes under `/workspace` write through
83
85
 
84
86
  [Docker Sandboxes](https://docs.docker.com/ai/sandboxes/) runs the complete Pi process inside a managed sandbox. Its proxy can keep the real provider credential on the host and substitute it when requests leave the sandbox.
85
87
 
86
- Configure credentials before creating the sandbox. Do not run `/login` inside the sandbox because that writes a real credential into it.
88
+ Configure credentials before creating the sandbox. Do not run `pi auth login` inside the sandbox because that writes a real credential into it.
87
89
 
88
90
  ### Use a Claude Pro or Max token
89
91
 
@@ -110,7 +112,7 @@ Run this from the working folder you want mounted:
110
112
  sbx run --kit "docker.io/sbx/pi-kit:latest" pi
111
113
  ```
112
114
 
113
- For an existing sandbox, run Pi non-interactively with:
115
+ For an existing sandbox, run a Pi prompt with:
114
116
 
115
117
  ```bash
116
118
  sbx exec <sandbox-name> -- pi -p "list the failing tests"
@@ -137,7 +139,7 @@ openshell gateway select <name>
137
139
  openshell sandbox create --name pi-sandbox --from pi -- pi
138
140
  ```
139
141
 
140
- Pi, its built-in tools, `!` commands, and extension tools run inside the OpenShell boundary.
142
+ Pi, its built-in tools, RPC `bash` commands, and extension tools run inside the OpenShell boundary.
141
143
 
142
144
  ### Transfer files to a remote sandbox
143
145
 
@@ -152,7 +154,7 @@ OpenShell inference routing can keep raw model credentials outside the sandbox.
152
154
 
153
155
  ## Route tools through Gondolin
154
156
 
155
- [Gondolin](https://github.com/earendil-works/gondolin) is a local Linux micro-VM. Its example extension keeps the Pi process and file-based provider credentials on the host while routing the built-in tools and user `!` commands into the VM.
157
+ [Gondolin](https://github.com/earendil-works/gondolin) is a local Linux micro-VM. Its example extension keeps the Pi process and file-based provider credentials on the host while routing the built-in tools and RPC `bash` commands into the VM.
156
158
 
157
159
  Commands inside the VM inherit the host process environment. Provider keys supplied through environment variables can therefore be visible inside the VM. Do not use this pattern as a credential boundary unless you remove sensitive variables or change the extension's environment handling.
158
160
 
@@ -175,7 +177,7 @@ Run Pi from the working folder you want mounted:
175
177
 
176
178
  ```bash
177
179
  cd /path/to/working-folder
178
- pi -e ~/.pi/agent/extensions/gondolin
180
+ pi -e ~/.pi/agent/extensions/gondolin -p "list the failing tests"
179
181
  ```
180
182
 
181
183
  The extension mounts the host working folder at `/workspace` in the VM and overrides `read`, `write`, `edit`, `bash`, `grep`, `find`, and `ls`. File changes under `/workspace` write through to the host.
@@ -11,7 +11,7 @@ Provider extensions run inside Pi and can inspect credentials, prompts, tool def
11
11
  | Add models behind a supported API | [`models.json`](models.md#configure-a-compatible-endpoint) |
12
12
  | Change an existing provider endpoint or headers | `models.json` or a small provider extension |
13
13
  | Discover models dynamically | A provider with `refreshModels` |
14
- | Add a `/login` flow | A provider with native or legacy OAuth configuration |
14
+ | Add an OAuth login flow | A provider with native or legacy OAuth configuration |
15
15
  | Implement an unsupported wire protocol | A provider with `stream` or `streamSimple` |
16
16
 
17
17
  A provider extension is an [extension](extensions.md), so it follows the same loading, trust, reload, and error behavior.
@@ -134,10 +134,12 @@ Static providers can resolve an API key from a literal, environment interpolatio
134
134
 
135
135
  Use native provider authentication when the integration needs stored credentials, custom resolution, provider-scoped environment, or multiple login methods.
136
136
 
137
- An OAuth provider supplies a display name, login flow, token refresh, and access-token resolution. After registration it appears in `/login`, and Pi stores returned credentials in `~/.pi/agent/auth.json`.
137
+ An OAuth provider supplies a display name, login flow, token refresh, and access-token resolution. Pi stores returned credentials in `~/.pi/agent/auth.json`. `pi auth login <provider>` starts this flow for providers that built-in extensions or your own extensions (in `~/.pi/agent/extensions/` or the `extensions` setting) register. A project's own extensions do not load for that command. SDK applications can start the flow through `session.modelRuntime.login()`.
138
138
 
139
139
  OAuth callbacks are UI-neutral. They can open an authorization URL, show a device code, report progress, request input, or ask the user to choose a login method. Honor cancellation and the supplied abort signal during network requests.
140
140
 
141
+ A device-code notification can ask the client to open the login URL and copy the code. Providers can disable either action with `openBrowserOnConfirm: false` or `copyCodeOnConfirm: false` in `onDeviceCode` or native `AuthEvent` notifications.
142
+
141
143
  Never write access tokens, refresh tokens, authorization headers, or complete provider responses to ordinary logs.
142
144
 
143
145
  ## Supply and refresh models
@@ -222,4 +224,4 @@ Test at least:
222
224
 
223
225
  The provider tests under [`packages/ai/test`](https://github.com/earendil-works/pi/tree/main/packages/ai/test) define the behavior expected from built-in providers. Adapt the relevant suites rather than relying only on manual prompts.
224
226
 
225
- Run the extension directly while developing, then move it to a discovered extension location or distribute it through a [Pi package](packages.md). Use `/reload` after changing a discovered provider extension in an active session.
227
+ Run the extension directly while developing, then move it to a discovered extension location or distribute it through a [Pi package](packages.md). Restart Pi after changing a discovered provider extension, or reload a running session from an extension command with `ctx.reload()`.
package/docs/docs.json CHANGED
@@ -24,7 +24,7 @@
24
24
  "title": "Run Pi",
25
25
  "items": [
26
26
  {
27
- "title": "Use Pi in the Terminal",
27
+ "title": "Use Pi from the Command Line",
28
28
  "path": "usage.md"
29
29
  },
30
30
  {
@@ -55,18 +55,10 @@
55
55
  "title": "Run Local Models on NVIDIA RTX",
56
56
  "path": "nvidia-rtx-llama-cpp.md"
57
57
  },
58
- {
59
- "title": "Configure Your Terminal",
60
- "path": "terminal-setup.md"
61
- },
62
58
  {
63
59
  "title": "Configure Shell Commands",
64
60
  "path": "shell-aliases.md"
65
61
  },
66
- {
67
- "title": "Run Pi in tmux",
68
- "path": "tmux.md"
69
- },
70
62
  {
71
63
  "title": "Run Pi on Windows",
72
64
  "path": "windows.md"
@@ -215,6 +207,14 @@
215
207
  {
216
208
  "from": "process-integration.md",
217
209
  "to": "cli-integration.md"
210
+ },
211
+ {
212
+ "from": "terminal-setup.md",
213
+ "to": "themes.md"
214
+ },
215
+ {
216
+ "from": "tmux.md",
217
+ "to": "usage.md"
218
218
  }
219
219
  ]
220
220
  }
@@ -46,7 +46,7 @@ if [ -n "$PI_SESSION_FILE" ]; then
46
46
  fi
47
47
  ```
48
48
 
49
- These variables are injected into the LLM-callable `bash` and `powershell` tools. They are not injected into user-entered `!` or `!!` commands.
49
+ These variables are injected into the LLM-callable `bash` and `powershell` tools. They are not injected into commands run through the RPC `bash` command.
50
50
 
51
51
  ### Custom Shell Tools
52
52
 
@@ -83,22 +83,15 @@ These variables are read by Pi itself:
83
83
  | `PI_PACKAGE_DIR` | Override the package directory, useful for Nix/Guix store paths |
84
84
  | `PI_OFFLINE` | Disable automatic network activity, including model catalog refreshes |
85
85
  | `PI_SKIP_VERSION_CHECK` | Disable the `pi.dev` latest-version request |
86
+ | `PI_SELF_UPDATE_COMMAND` | Command `pi update` runs to update Pi itself, split on whitespace, with `{packageName}`, `{version}`, and `{installSpec}` placeholders. Takes precedence over the `selfUpdateCommand` setting. See [Custom update command](cli.md#custom-update-command) |
86
87
  | `PI_TELEMETRY` | Override install/update telemetry and provider attribution headers: `1`/`true`/`yes` or `0`/`false`/`no` |
87
88
  | `PI_CODEMODE_MAX_WORKERS` | Maximum codemode workers alive at once across all sessions in the process; default `2`. Each worker's script may use up to 256 MB. Raise it when one process runs several sessions, such as in-process subagents. Further scripts wait for a free worker. See [Codemode](codemode.md) |
88
89
  | `PI_CACHE_RETENTION` | Set to `long` for extended provider prompt caching where supported |
89
- | `PI_SHARE_VIEWER_URL` | Override the base URL used by `/share` |
90
- | `PI_RADIUS_GATEWAY` | Override the Radius gateway origin used by `/bug` uploads |
91
- | `PI_HARDWARE_CURSOR` | Set to `1` to show the hardware cursor; see [Terminal setup](terminal-setup.md) |
92
- | `PI_CLIPBOARD_OSC52` | Set to `1` to also send copied text to the terminal with OSC 52 after the local clipboard write, as Pi does over SSH. Use it when a remote client reaches Pi without SSH variables, such as a multiplexer attached from another machine or a remote IDE daemon |
93
- | `PI_HYPERLINKS` | Override OSC 8 hyperlink detection with `1`, `0`, or `auto` |
94
- | `PI_PROGRAM_STATUS` | Override OSC 7501 program status detection: `1` always reports, `0` never reports; otherwise Pi reports only after the terminal confirms support. See [Terminal setup](terminal-setup.md#program-status) |
95
- | `PI_IMAGE_PROTOCOL` | Override inline image detection with `kitty`, `iterm2`, `none`, or `auto` |
96
- | `PI_TRUE_COLOR` | Override truecolor detection with `1`, `0`, or `auto` |
97
- | `PI_TUI_ESC_TIMEOUT` | How long to wait after a lone ESC before treating it as Escape, in milliseconds; defaults to `100` over SSH and `10` otherwise. Increase if Alt-key input is misread as Escape |
98
- | `VISUAL`, `EDITOR` | External editor fallback when `externalEditor` is unset |
90
+ | `PI_CLIPBOARD_OSC52` | Set to `1` to make the SDK's `copyToClipboard()` also send copied text to the terminal with OSC 52 after the local clipboard write, as it does over SSH. Use it when a remote client reaches Pi without SSH variables, such as a multiplexer attached from another machine or a remote IDE daemon |
91
+ | `PI_TRUE_COLOR` | Override truecolor detection with `1`, `0`, or `auto`; see [Themes](themes.md#override-detected-capabilities) |
99
92
  | `HTTP_PROXY`, `HTTPS_PROXY` | Proxy outbound HTTP requests |
100
93
 
101
- Provider credentials such as `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, and cloud-provider configuration are listed in [Providers](providers.md#environment-variables-or-auth-file).
94
+ Provider credentials such as `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, and cloud-provider configuration are listed in [Providers](providers.md#use-an-api-key-from-the-environment).
102
95
 
103
96
  ## Punch sandbox A2A discovery
104
97