@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
package/docs/providers.md CHANGED
@@ -5,15 +5,15 @@ Most hosted providers support one or both of these authentication methods:
5
5
  - Sign in through a browser or device flow backed by OAuth.
6
6
  - Provide an API key.
7
7
 
8
- Use `/login [provider]` to see the methods supported by a provider. Amazon Bedrock and Google Vertex AI can also use ambient cloud credentials.
8
+ Run `pi auth login <provider>` to use the method a provider supports. An unknown provider ID prints the list of known provider IDs. Providers that built-in or user extensions register, such as llama.cpp, log in the same way. A project's own extensions do not load for this command. Amazon Bedrock and Google Vertex AI can also use ambient cloud credentials.
9
9
 
10
10
  ## Authenticate interactively
11
11
 
12
- Run `/login` and select a provider. Pi guides you through its OAuth or API-key flow and saves the resulting credential in [`auth.json`](configuration.md#agent-directory).
12
+ Run `pi auth login <provider>` in a terminal. Pi guides you through its OAuth or API-key flow, saves the resulting credential in [`auth.json`](configuration.md#agent-directory), and exits. Add `--api-key` to save an API key instead of signing in with an account. See [Credential commands](cli.md#credential-commands).
13
13
 
14
- On a remote or headless machine, an OAuth callback may not reach the local process. When prompted, paste the final redirect URL or authorization code back into Pi.
14
+ On a remote or headless machine, an OAuth callback may not reach the local process. Add `--no-browser` to use another sign-in method, such as a device code, or paste the final redirect URL or authorization code back into Pi when prompted.
15
15
 
16
- Run `/logout` and select a provider to remove its stored credential. This does not unset environment variables, remove authentication from `models.json`, or revoke the credential at the provider.
16
+ Run `pi auth logout <provider>` to remove its stored credential. This does not unset environment variables, remove authentication from `models.json`, or revoke the credential at the provider.
17
17
 
18
18
  `auth.json` can contain API keys and OAuth tokens. Keep it private and do not commit it.
19
19
 
@@ -23,7 +23,7 @@ Environment variables are useful in CI and anywhere Pi should not store the key.
23
23
 
24
24
  ```bash
25
25
  export ANTHROPIC_API_KEY=sk-ant-...
26
- pi
26
+ pi -p "Say hello"
27
27
  ```
28
28
 
29
29
  This table covers providers with a single primary API-key variable. Providers that need additional configuration or support ambient credentials are covered under [Provider Specific Config](#provider-specific-config).
@@ -58,7 +58,7 @@ This table covers providers with a single primary API-key variable. Providers th
58
58
  | MiniMax (China) | `MINIMAX_CN_API_KEY` |
59
59
  | Moonshot AI (Global and China) | `MOONSHOT_API_KEY` |
60
60
  | Qwen Token Plan and Individual | `QWEN_TOKEN_PLAN_API_KEY` |
61
- | Qwen Token Plan (China) | `QWEN_TOKEN_PLAN_CN_API_KEY` |
61
+ | Qwen Token Plan (China) and Individual (China) | `QWEN_TOKEN_PLAN_CN_API_KEY` |
62
62
  | Xiaomi MiMo | `XIAOMI_API_KEY` |
63
63
  | Xiaomi MiMo Token Plan (China) | `XIAOMI_TOKEN_PLAN_CN_API_KEY` |
64
64
  | Xiaomi MiMo Token Plan (Amsterdam) | `XIAOMI_TOKEN_PLAN_AMS_API_KEY` |
@@ -105,7 +105,7 @@ A stored API-key credential can include an `env` object. Its values take priorit
105
105
 
106
106
  Radius is a service crafted for Pi by the builders of Pi, Earendil Works. It provides a customizable AI gateway with organization-level controls and analytics built in, and artifacts for sharing what you create with Pi.
107
107
 
108
- To get started, run `/login radius` in Pi. This adds Radius as a provider, and its models appear in `/model` like any other provider's.
108
+ To get started, run `pi auth login radius`. This adds Radius as a provider, and its models appear in `--list-models` like any other provider's.
109
109
 
110
110
  Radius also has an MCP server, so Pi can manage Radius for you.
111
111
 
@@ -115,7 +115,7 @@ Radius authentication uses its gateway catalog and caches refreshed model metada
115
115
 
116
116
  ### OpenRouter
117
117
 
118
- Authenticate with `/login openrouter` or `OPENROUTER_API_KEY`.
118
+ Authenticate with `pi auth login openrouter` or `OPENROUTER_API_KEY`.
119
119
 
120
120
  With a key, Pi lists only the OpenRouter chat models that key may use, with the key's context size, max output, and prices. These come from OpenRouter's `/models/user` endpoint and reflect guardrails and provider restrictions set in OpenRouter. Image and classifier models are not filtered.
121
121
 
@@ -6,13 +6,7 @@ For native Windows setup, read [Windows Setup](windows.md). For Android, read [T
6
6
 
7
7
  ## 1. Install Pi
8
8
 
9
- On macOS or Linux, you can use the installer:
10
-
11
- ```bash
12
- curl -fsSL https://pi.dev/install.sh | sh
13
- ```
14
-
15
- The installer pins all dependencies and updates Pi with `pi update`. Alternatively, install Pi from npm with the fork's generated shrinkwrap. This requires Node.js 22.19 or newer:
9
+ Install Pi from npm with the fork's generated shrinkwrap. This requires Node.js 22.19 or newer:
16
10
 
17
11
  ```bash
18
12
  npm install -g --ignore-scripts @punch-bot/cli
@@ -26,68 +20,57 @@ Verify the installation:
26
20
  pi --version
27
21
  ```
28
22
 
29
- ## 2. Start Pi
23
+ ## 2. Choose a model
30
24
 
31
- Change to the folder you want Pi to work with, then start it:
25
+ A **model** generates Pi's responses. A **provider** is the service or account Pi uses to access that model.
26
+
27
+ Log in to a provider:
32
28
 
33
29
  ```bash
34
- cd /path/to/folder
35
- pi
30
+ pi auth login anthropic
36
31
  ```
37
32
 
38
- The working folder helps Pi discover relevant files, instructions, and configuration. Pi also uses it to group saved sessions.
39
-
40
- <p align="center"><img src="images/interactive-mode.png" alt="Pi running in a terminal with a conversation, input editor, and status footer" width="750"></p>
33
+ Pi signs in with an account in the browser, or asks for an API key when the provider has no account sign-in. Add `--api-key` to save an API key instead. You can also set the provider's environment variable, such as `ANTHROPIC_API_KEY`, without logging in.
41
34
 
42
- The interface shows your conversation, an editor for prompts and commands, and a footer with the current folder, model, and session status. See [Use Pi in the terminal](usage.md) to learn how to add files, run commands, direct ongoing work, and manage results.
35
+ Without `--model`, Pi uses the `defaultModel` [setting](settings.md) or a default model of an authenticated provider. Choose another model with `--model`, for example `pi --model sonnet:high`. Run `pi --list-models` to see the available models.
43
36
 
44
- ## 3. Choose a model
37
+ See [Choose a model and provider](models.md) for supported providers, environment-variable authentication, local models, and custom endpoints.
45
38
 
46
- A **model** generates Pi's responses. A **provider** is the service or account Pi uses to access that model.
39
+ ## 3. Give Pi a task
47
40
 
48
- In Pi, run:
41
+ Change to the folder you want Pi to work with, then give it a task:
49
42
 
50
- ```text
51
- /login
43
+ ```bash
44
+ cd /path/to/folder
45
+ pi -p "Explain how this repository is structured and how to run its checks."
52
46
  ```
53
47
 
54
- Choose a provider, then follow the prompts to use a subscription or store an API key. Run `/model` afterward if you want to select a different available model.
55
-
56
- See [Choose a model and provider](models.md) for supported providers, environment-variable authentication, local models, and custom endpoints.
57
-
58
- ## 4. Give Pi a task
59
-
60
- Pi shows each file read, search, command, and edit it performs. It does not ask before every tool call.
48
+ The working folder helps Pi discover relevant files, instructions, and configuration. Pi also uses it to group saved sessions.
61
49
 
62
- Enter a task that matches your work, for example:
50
+ Pi runs headless: print mode (`-p`) writes the final answer to stdout and exits. Use `--mode json` to stream every event, or `--mode rpc` to drive Pi from another program. See [Use Pi from the command line](usage.md).
63
51
 
64
- ```text
65
- Summarize @meeting-notes.md and save the action items to action-items.md.
66
- ```
52
+ Pi runs file reads, searches, commands, and edits without asking before each tool call. Include files with separate `@path` arguments:
67
53
 
68
- ```text
69
- Explain how this repository is structured and how to run its checks.
70
- ```
71
-
72
- ```text
73
- Compare @previous.csv with @current.csv and summarize the important changes.
54
+ ```bash
55
+ pi -p @meeting-notes.md "Summarize these notes and save the action items to action-items.md."
56
+ pi -p @previous.csv @current.csv "Compare these files and summarize the important changes."
74
57
  ```
75
58
 
76
- Type `@` in the editor to search for a file instead of entering its full path. When Pi finishes, review its response and any changed files. Use version control or backups for important work. For untrusted or unattended work, use a container or another sandbox. See [Security](security.md).
59
+ When Pi finishes, review its response and any changed files. Use version control or backups for important work. For untrusted or unattended work, use a container or another sandbox. See [Security](security.md).
77
60
 
78
61
  ## Continue later
79
62
 
80
- Pi saves sessions automatically. Exit Pi, then resume the most recent session for the same working folder with:
63
+ Pi saves sessions automatically. Continue the most recent session for the same working folder with:
81
64
 
82
65
  ```bash
83
- pi --continue
66
+ pi --continue -p "Now add tests for it."
84
67
  ```
85
68
 
86
- Use `/resume` to choose another saved session. See [Continue or branch a session](sessions.md) for session naming, branching, compaction, export, and sharing.
69
+ Use `--session <path|id>` to open another saved session. See [Continue or branch a session](sessions.md) for session naming, branching, compaction, and export.
87
70
 
88
71
  ## Next steps
89
72
 
90
- - [Use Pi interactively](usage.md) to learn input, commands, shortcuts, and queued messages.
73
+ - [Use Pi from the command line](usage.md) to learn input, commands, and queued messages.
91
74
  - [Add instructions](configuration.md#context-files) that Pi should follow whenever it works in a folder.
92
75
  - [Choose a model and provider](models.md).
93
76
 
@@ -98,25 +81,18 @@ Start with the least powerful mechanism that meets your need:
98
81
  | Need | Start with |
99
82
  |---|---|
100
83
  | Give Pi persistent instructions for a folder | [`AGENTS.md`](configuration.md#context-files) |
101
- | Reuse a prompt from the `/` menu | [Prompt template](prompt-templates.md) |
84
+ | Reuse a prompt as a `/` command | [Prompt template](prompt-templates.md) |
102
85
  | Add task-specific instructions and supporting files | [Skill](skills.md) |
103
86
  | Add executable tools, commands, or event handlers | [Extension](extensions.md) |
104
- | Build a custom terminal component | [Terminal UI](tui.md) |
105
87
  | Connect an unsupported model service | [Custom provider](custom-provider.md) |
106
88
  | Install or distribute several resources | [Pi package](packages.md) |
107
89
 
108
90
  ## Uninstall Pi
109
91
 
110
- If you installed Pi with npm, run:
92
+ Run:
111
93
 
112
94
  ```bash
113
95
  npm uninstall -g @punch-bot/cli
114
96
  ```
115
97
 
116
- If you used the installer, run it again and choose **Uninstall Pi**:
117
-
118
- ```bash
119
- curl -fsSL https://pi.dev/install.sh | sh
120
- ```
121
-
122
- Neither method removes configuration, credentials, sessions, or installed Pi packages from `~/.pi/agent/`.
98
+ This does not remove configuration, credentials, sessions, or installed Pi packages from `~/.pi/agent/`.
@@ -590,7 +590,7 @@ Response:
590
590
  }
591
591
  ```
592
592
 
593
- `tokens` and `cost` include assistant messages, usage reported by tools, and compaction/branch-summary generation across the full session. `contextUsage` contains the actual current context-window estimate used for compaction and footer display.
593
+ `tokens` and `cost` include assistant messages, usage reported by tools, and compaction/branch-summary generation across the full session. `contextUsage` contains the actual current context-window estimate used for compaction.
594
594
 
595
595
  `contextUsage` is omitted when no model or context window is available. `contextUsage.tokens` and `contextUsage.percent` are `null` immediately after compaction until a fresh post-compaction assistant response provides valid usage data.
596
596
 
@@ -859,7 +859,7 @@ Each command has:
859
859
  - `origin`: `"top-level"` for a directly loaded resource or `"package"` for a package resource
860
860
  - `baseDir`: Package base directory, when applicable
861
861
 
862
- **Note**: Built-in TUI commands (`/settings`, `/hotkeys`, etc.) are not included. They are handled only in interactive mode and would not execute if sent via `prompt`.
862
+ **Note**: Pi has no other slash commands. A `prompt` such as `/model` that matches no extension command, prompt template, or skill is sent to the model as plain text. Use RPC commands such as `set_model` instead.
863
863
 
864
864
  ## Model object
865
865
 
@@ -11,18 +11,16 @@ If a dialog method includes a `timeout` field, the agent-side will auto-resolve
11
11
 
12
12
  ## Limitations
13
13
 
14
- Some `ExtensionUIContext` methods are not supported or degraded in RPC mode because they require direct terminal UI access:
14
+ Some `ExtensionUIContext` methods are not supported or degraded in RPC mode:
15
15
 
16
- - `custom()` returns `undefined`.
17
- - `onTerminalInput()` returns a no-op unsubscribe function.
18
- - `setWorkingMessage()`, `setWorkingVisible()`, `setWorkingIndicator()`, `setHiddenThinkingLabel()`, `setFooter()`, `setHeader()`, `addAutocompleteProvider()`, `setEditorComponent()`, and `setToolsExpanded()` are no-ops.
19
- - `getEditorText()` returns `""` and `getEditorComponent()` returns `undefined`.
16
+ - `setWorkingMessage()`, `setWorkingVisible()`, `setWorkingIndicator()`, `setHiddenThinkingLabel()`, and `setToolsExpanded()` are no-ops.
17
+ - `getEditorText()` returns `""`.
20
18
  - `getToolsExpanded()` returns `false`.
21
19
  - `pasteToEditor()` delegates to `setEditorText()` without terminal paste handling.
22
20
  - `getAllThemes()` returns `[]`, and `getTheme()` returns `undefined`.
23
21
  - `setTheme()` returns `{ success: false, error: "Theme switching not supported in RPC mode" }`.
24
22
 
25
- Note: `ctx.mode` is `"rpc"` and `ctx.hasUI` is `true` in RPC mode because the dialog and fire-and-forget methods are functional via the extension UI sub-protocol. Use `ctx.mode === "tui"` to guard TUI-specific features like `custom()` that require a real terminal.
23
+ Note: `ctx.mode` is `"rpc"` and `ctx.hasUI` is `true` in RPC mode because the dialog and fire-and-forget methods are functional via the extension UI sub-protocol.
26
24
 
27
25
  ## Requests from Pi
28
26
 
@@ -195,6 +193,6 @@ Dismiss any dialog method. The extension receives `undefined` (for select/input/
195
193
 
196
194
  ## Example
197
195
 
198
- See the checked [RPC extension UI client](../examples/rpc-extension-ui.ts) and its [demo extension](../examples/extensions/rpc-demo.ts).
196
+ See the checked [demo extension](../examples/extensions/rpc-demo.ts), which exercises these requests.
199
197
 
200
198
  The exported request and response unions are defined in [`rpc-types.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/modes/rpc/rpc-types.ts). See [Extensions](extensions.md#ui-and-modes) for mode-independent extension guidance.
package/docs/rpc.md CHANGED
@@ -92,9 +92,11 @@ Clients must also handle child-process startup failures, unexpected exits, stder
92
92
 
93
93
  ## Shutdown
94
94
 
95
- Close the child's stdin to request an orderly shutdown. Pi disposes the active runtime before exiting. Clients should still handle process signals and unexpected exits.
95
+ Close the child's stdin to request an orderly shutdown. Pi disposes the active runtime and waits for pending work to finish before exiting, so give it time to exit before killing it. Clients should still handle process signals and unexpected exits.
96
96
 
97
- An extension can also request shutdown through its extension context. Pi completes shutdown after the current command or after the active run emits `agent_settled`.
97
+ SIGTERM and SIGHUP also start an orderly shutdown. Once a shutdown has started, from either stdin EOF or a signal, a stdin EOF or a single signal does not interrupt it; a second signal exits at once. Closing stdin and sending SIGTERM together is safe.
98
+
99
+ An extension can also request shutdown with `ctx.shutdown()`. If the session is idle and no command is being handled, Pi shuts down right away. Otherwise it shuts down once the current command finishes (for `prompt`, once the prompt settles) or the active run emits `agent_settled`. (A request made while an extension-started compaction is running waits for the next command or run to finish.)
98
100
 
99
101
  ## Minimal client
100
102
 
package/docs/sdk.md CHANGED
@@ -109,7 +109,7 @@ Use `DefaultResourceLoader` when you want standard discovery with selected overr
109
109
 
110
110
  <a id="inlineextension"></a>
111
111
 
112
- Inline extension factories can be supplied through `DefaultResourceLoader`. Give one an `InlineExtension` name only when it needs a stable name in diagnostics and startup output. A named inline extension with `replaceable: true` is left out when another extension registers a tool, command, or flag with a name it registers during loading, instead of both loading with a conflict. The CLI's built-in codemode, tool search, and MCP extensions are replaceable. A named entry with `builtin: true` is not an inline extension: it supplies the code of the `builtin:<name>` extension, which loads like a configured extension file. It loads by default, is listed in `pi config`, and is disabled by `-builtin:<name>` in the `extensions` setting or by `noExtensions`; `additionalExtensionPaths: ["builtin:<name>"]` loads it explicitly. It loads after project trust is resolved, so it cannot handle `project_trust`. The CLI's built-in extensions use it.
112
+ Inline extension factories can be supplied through `DefaultResourceLoader`. Give one an `InlineExtension` name only when it needs a stable name in diagnostics and startup output. A named inline extension with `replaceable: true` is left out when another extension registers a tool, command, or flag with a name it registers during loading, instead of both loading with a conflict. The CLI's built-in codemode, tool search, and MCP extensions are replaceable. A named entry with `builtin: true` is not an inline extension: it supplies the code of the `builtin:<name>` extension, which loads like a configured extension file. It loads by default, is listed by `pi config`, and is disabled by `-builtin:<name>` in the `extensions` setting or by `noExtensions`; `additionalExtensionPaths: ["builtin:<name>"]` loads it explicitly. It loads after project trust is resolved, so it cannot handle `project_trust`. The CLI's built-in extensions use it.
113
113
 
114
114
  <a id="codemode-mcp"></a>
115
115
 
package/docs/security.md CHANGED
@@ -4,7 +4,7 @@ Treat model-generated commands and code as untrusted. Pi can read, change, and e
4
4
 
5
5
  Files, comments, instructions, command output, and model responses can steer the model through prompt injection. Project trust controls which project resources load at startup, but it does not make that content or the resulting actions safe.
6
6
 
7
- Safety comes from limiting the files, credentials, processes, and network services Pi can access and affect if a generated action is wrong or hostile. Watching the transcript, using project trust, and reviewing changes do not create a security boundary.
7
+ Safety comes from limiting the files, credentials, processes, and network services Pi can access and affect if a generated action is wrong or hostile. Watching the event stream, using project trust, and reviewing changes do not create a security boundary.
8
8
 
9
9
  ## Choose how to run Pi
10
10
 
@@ -64,17 +64,21 @@ A command-line `--approve` or `--no-approve` override applies first. When protec
64
64
  2. If no extension decides, Pi looks for a saved decision for the current directory or one of its parents. The closest decision applies.
65
65
  3. If no saved decision applies, Pi follows the global `defaultProjectTrust` setting, whose default is `"ask"`.
66
66
 
67
- Saved decisions use canonical directory paths and live in:
67
+ Saved decisions use canonical directory paths as keys and `true` or `false` as values, and live in:
68
68
 
69
69
  ```text
70
70
  ~/.pi/agent/trust.json
71
71
  ```
72
72
 
73
- Use `/trust` to save a decision for future Pi processes.
73
+ ```json
74
+ { "/home/user/projects/app": true }
75
+ ```
76
+
77
+ Edit the file, or have a `project_trust` extension handler return `remember: true`, to save a decision for future Pi processes. See [`project_trust`](extensions.md#project_trust).
74
78
 
75
- ### Project trust without an interactive prompt
79
+ ### Project trust without a prompt
76
80
 
77
- Print, JSON, and RPC modes cannot show the built-in trust prompt. If no command-line override, extension, or saved decision applies:
81
+ Pi has no built-in trust prompt. If no command-line override, extension, or saved decision applies:
78
82
 
79
83
  - `defaultProjectTrust: "always"` loads protected project resources.
80
84
  - `defaultProjectTrust: "ask"` or `"never"` skips them.
@@ -17,8 +17,6 @@ By default, `<session-id>` is a UUID. Callers can supply a custom ID through the
17
17
 
18
18
  Sessions can be removed by deleting their `.jsonl` files under `~/.pi/agent/sessions/`.
19
19
 
20
- Pi also supports deleting sessions interactively from `/resume` (select a session and press `Ctrl+D`, then confirm). When available, pi uses the `trash` CLI to avoid permanent deletion.
21
-
22
20
  ## Session Version
23
21
 
24
22
  Sessions have a version field in the header:
@@ -69,7 +67,7 @@ First line of the file. Metadata only, not part of the tree (no `id`/`parentId`)
69
67
  {"type":"session","version":3,"id":"uuid","timestamp":"2024-12-03T14:00:00.000Z","cwd":"/path/to/project"}
70
68
  ```
71
69
 
72
- For sessions with a parent (created via `/fork`, `/clone`, or `newSession({ parentSession })`):
70
+ For sessions with a parent (created via `--fork`, RPC `fork` or `clone`, or `newSession({ parentSession })`):
73
71
 
74
72
  ```json
75
73
  {"type":"session","version":3,"id":"uuid","timestamp":"2024-12-03T14:00:00.000Z","cwd":"/path/to/project","parentSession":"/path/to/original/session.jsonl"}
@@ -148,7 +146,7 @@ Targets may be user, assistant, tool-result, or custom-message entries. `replace
148
146
 
149
147
  ### BranchSummaryEntry
150
148
 
151
- Created when switching branches via `/tree` with an LLM generated summary of the left branch up to the common ancestor. Captures context from the abandoned path.
149
+ Created when switching branches via `ctx.navigateTree()` with an LLM generated summary of the left branch up to the common ancestor. Captures context from the abandoned path.
152
150
 
153
151
  ```json
154
152
  {"type":"branch_summary","id":"g7h8i9j0","parentId":"a1b2c3d4","timestamp":"2024-12-03T14:15:00.000Z","fromId":"f6g7h8i9","summary":"Branch explored approach A..."}
@@ -169,7 +167,7 @@ Extension state persistence. Does NOT participate in LLM context.
169
167
  {"type":"custom","id":"h8i9j0k1","parentId":"g7h8i9j0","timestamp":"2024-12-03T14:20:00.000Z","customType":"my-extension","data":{"count":42}}
170
168
  ```
171
169
 
172
- Use `customType` to identify your extension's entries on reload. Interactive mode can render custom entries via `pi.registerEntryRenderer(customType, renderer)`, but they still do not participate in LLM context.
170
+ Use `customType` to identify your extension's entries on reload. Custom entries do not participate in LLM context.
173
171
 
174
172
  Pi stores [virtual model](virtual-models.md) router state as custom entries with `customType` `pi.virtual-model-state` and `data` `{ provider, modelId, state }`.
175
173
 
@@ -183,7 +181,7 @@ Extension-injected messages that DO participate in LLM context.
183
181
 
184
182
  Fields:
185
183
  - `content`: String or `(TextContent | ImageContent)[]` (same as UserMessage)
186
- - `display`: `true` = show in TUI with distinct styling, `false` = hidden
184
+ - `display`: `true` = clients should show it, `false` = hidden
187
185
  - `details`: Optional extension-specific metadata (not sent to LLM)
188
186
 
189
187
  ### LabelEntry
@@ -198,13 +196,13 @@ Set `label` to `undefined` to clear a label.
198
196
 
199
197
  ### SessionInfoEntry
200
198
 
201
- Session metadata (e.g., user-defined display name). Set via `/name`, `--name` / `-n`, or `pi.setSessionName()` in extensions.
199
+ Session metadata (e.g., user-defined display name). Set via `--name` / `-n`, RPC `set_session_name`, or `pi.setSessionName()` in extensions.
202
200
 
203
201
  ```json
204
202
  {"type":"session_info","id":"k1l2m3n4","parentId":"j0k1l2m3","timestamp":"2024-12-03T14:35:00.000Z","name":"Refactor auth module"}
205
203
  ```
206
204
 
207
- The session name is displayed in the session selector (`/resume`) instead of the first message when set.
205
+ RPC `get_state` returns the latest name as `sessionName`.
208
206
 
209
207
  ## Tree Structure
210
208
 
@@ -230,7 +228,7 @@ Entries normally form one tree, but navigation APIs can create multiple roots:
230
228
  - Includes the compaction entry first
231
229
  - Includes non-system entries from `firstKeptEntryId` up to, but not including, the compaction entry
232
230
  - Includes entries after the compaction entry
233
- 3. Preserves non-message entries in the selected range so interactive mode can render them
231
+ 3. Preserves non-message entries in the selected range so clients can render them
234
232
 
235
233
  `buildSessionProjection()` then applies the latest `context_edit` for each selected target. It returns the model-visible messages together with their source entries. Omitted targets produce no message; replacements retain the source entry's role and metadata while changing only content. The raw selected entries are not modified.
236
234
 
package/docs/sessions.md CHANGED
@@ -1,21 +1,29 @@
1
1
  # Sessions and Context
2
2
 
3
- Pi saves a conversation as a session. The active branch of that session supplies conversation history for the next model request. Use session commands to continue work, explore another branch, or reduce the amount of history sent to the model.
3
+ Pi saves a conversation as a session. The active branch of that session supplies conversation history for the next model request. Use session options and RPC commands to continue work, explore another branch, or reduce the amount of history sent to the model.
4
4
 
5
5
  ## Continue or switch sessions
6
6
 
7
7
  Pi saves sessions automatically unless you start it with `--no-session`.
8
8
 
9
9
  ```bash
10
- pi --continue
11
- pi --resume
10
+ pi --continue -p "What did we discuss?"
11
+ pi --session <path|id> -p "Continue with the next step"
12
12
  ```
13
13
 
14
- `--continue` opens the most recent session for the current working directory. `--resume` opens the session picker. In interactive mode, `/resume` opens the same picker and `/new` starts a new session.
14
+ `--continue` (or its alias `--resume`) opens the most recent session for the current directory. `--session` opens a session by file path or full or partial ID. RPC clients start a new session with [`new_session`](rpc-commands.md#new_session) and open another one with [`switch_session`](rpc-commands.md#switch_session); extensions use `ctx.newSession()` and `ctx.switchSession()`.
15
15
 
16
- Use `/name` or `--name` to assign a recognizable session name. Run `/session` to verify the current session file, ID, message count, token usage, and cost.
16
+ Each session records the working directory it was created in and never changes it. Pi runs a session in its working directory, so tools, `@path` references, project configuration, and context files resolve from there.
17
17
 
18
- The session picker lets you search, rename, and delete sessions. It can also show paths, change sorting, and limit results to named sessions. See [Keybindings](keybindings.md#sessions) for its shortcuts.
18
+ | Entry point | Working directory |
19
+ |---|---|
20
+ | `--continue` | The current directory |
21
+ | `--session`, RPC `switch_session` | The session's working directory. `--session` exits with an error when the session belongs to another directory and suggests `--fork`. |
22
+ | `--fork` | The current directory, in a new session |
23
+
24
+ If a session's working directory no longer exists, for example after the project folder was renamed, Pi exits with an error. Use `--fork` to copy the session into the current directory.
25
+
26
+ Use `--name`, the RPC [`set_session_name`](rpc-commands.md#set_session_name) command, or `pi.setSessionName()` to assign a recognizable session name. RPC [`get_session_stats`](rpc-commands.md#get_session_stats) returns the session file, ID, message count, token usage, and cost.
19
27
 
20
28
  ## Choose how to branch
21
29
 
@@ -23,13 +31,13 @@ Pi stores entries as a tree, so returning to an earlier point does not erase the
23
31
 
24
32
  | Action | Result | Use it when |
25
33
  |---|---|---|
26
- | `/tree` | Moves within the current session file | Related alternatives should stay together |
27
- | `/fork` | Creates a new session from an earlier user message | The alternative should become separate work |
28
- | `/clone` | Copies the active branch into a new session | You want a separate copy of the current state |
34
+ | `ctx.navigateTree()` in an extension command | Moves within the current session file | Related alternatives should stay together |
35
+ | `--fork`, RPC [`fork`](rpc-commands.md#fork) | Creates a new session from an earlier user message | The alternative should become separate work |
36
+ | RPC [`clone`](rpc-commands.md#clone) | Copies the active branch into a new session | You want a separate copy of the current state |
29
37
 
30
- In `/tree`, select a user message to put its text back in the editor. Edit and submit it to create another branch. Selecting an assistant response or another entry continues after that entry with an empty editor.
38
+ RPC [`get_tree`](rpc-commands.md#get_tree) returns the tree, and [`get_fork_messages`](rpc-commands.md#get_fork_messages) lists the user messages `fork` accepts.
31
39
 
32
- When you leave a branch, Pi can summarize it and attach that summary to the branch you enter. This preserves relevant work from the abandoned path without including every message from it.
40
+ When `ctx.navigateTree()` leaves a branch with `summarize: true`, Pi summarizes it and attaches that summary to the branch it enters. This preserves relevant work from the abandoned path without including every message from it.
33
41
 
34
42
  For the persisted tree and entry types, see [Session Format](session-format.md).
35
43
 
@@ -37,11 +45,11 @@ For the persisted tree and entry types, see [Session Format](session-format.md).
37
45
 
38
46
  The model receives the active branch, not every branch in the session file. Pi combines that history with the system prompt, discovered context files, available tools, and loaded skill descriptions. [How Pi Works](how-pi-works.md#context) describes how those inputs are assembled.
39
47
 
40
- The footer shows current context usage. When the active context approaches the model's limit, Pi normally compacts older history automatically. Compaction adds a summary and keeps recent messages. It does not delete the original session entries.
48
+ When the active context approaches the model's limit, Pi normally compacts older history automatically. Compaction adds a summary and keeps recent messages. It does not delete the original session entries. RPC `get_session_stats` reports current context usage.
41
49
 
42
- Run `/compact` to compact manually. You can add instructions when the summary should preserve a particular topic or decision. Configure automatic compaction and retained history through [Settings](settings.md#compaction).
50
+ Use the RPC [`compact`](rpc-commands.md#compact) command or `ctx.compact()` to compact manually. You can add instructions when the summary should preserve a particular topic or decision. Configure automatic compaction and retained history through [Settings](settings.md#compaction).
43
51
 
44
- Compaction can fail if the provider is unavailable or cannot accept the summarization request. Correct the provider problem and run `/compact` again. Disabling automatic compaction does not disable the manual command.
52
+ Compaction can fail if the provider is unavailable or cannot accept the summarization request. Correct the provider problem and compact again. Disabling automatic compaction does not disable manual compaction.
45
53
 
46
54
  See [Compaction Reference](compaction.md) for thresholds, retained boundaries, branch-summary behavior, and extension hooks.
47
55
 
@@ -49,18 +57,10 @@ See [Compaction Reference](compaction.md) for thresholds, retained boundaries, b
49
57
 
50
58
  By default, Pi stores sessions under `~/.pi/agent/sessions/`, grouped by working directory. Use `--session-dir`, `PI_CODING_AGENT_SESSION_DIR`, or the `sessionDir` setting to choose another location. The CLI option has highest precedence.
51
59
 
52
- Use `--no-session` for an ephemeral run. An ephemeral session cannot be resumed after Pi exits.
53
-
54
- Use `--session` when you already know the session path or ID. Use `--fork` to create a new session from an existing session before interactive mode starts.
55
-
56
- ## Export or share a session
57
-
58
- Use `/export` to write the current session as HTML or JSONL. Use `/share` to upload it and get a viewer link. Pi uses a Radius artifact when Radius authentication is configured; otherwise, it uses a private GitHub gist.
59
-
60
- Review exported or shared sessions first. They can contain prompts, model responses, tool arguments, command output, file contents, and extension messages.
60
+ Use `--no-session` for an ephemeral run. An ephemeral session cannot be continued after Pi exits.
61
61
 
62
- ## Report a bug
62
+ ## Export a session
63
63
 
64
- Run `/bug [description]` to prepare a private report for the Pi developers. You can include the session transcript, omit it, or ask the current model to summarize the problem. Review any transcript or generated summary because it can contain sensitive conversation data.
64
+ Use `pi --export <session> [output.html]` or the RPC [`export_html`](rpc-commands.md#export_html) command to write a session as HTML.
65
65
 
66
- The report includes environment and provider configuration without credential values, plus recorded error diagnostics. Upload it through `radius.pi.dev` or export the same report as a zip to inspect and share yourself. Uploads do not require a login; Radius authentication attributes the report to your account so the developers can follow up. If an upload fails, Pi offers to export the zip.
66
+ Review exported sessions before sharing them. They can contain prompts, model responses, tool arguments, command output, file contents, and extension messages.