@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
@@ -1,194 +0,0 @@
1
- # Keybindings Reference
2
-
3
- Pi exposes named actions, such as `app.session.new`, that can be assigned keybindings. You can change default assignments or bind unassigned actions in Pi's [user configuration](configuration.md#agent-directory).
4
-
5
- Run `/hotkeys` to see the active shortcuts for the main editor and application.
6
-
7
- ## Assign keybindings
8
-
9
- Create `<agent-dir>/keybindings.json`. The agent directory defaults to `~/.pi/agent` and is described in [Agent directory](configuration.md#agent-directory).
10
-
11
- Map each action identifier to one key or a list of keys:
12
-
13
- ```json
14
- {
15
- "app.session.new": "ctrl+shift+n",
16
- "app.session.tree": ["ctrl+shift+t", "alt+shift+t"]
17
- }
18
- ```
19
-
20
- A configured value replaces the default for that action. Use an empty list to disable an action's keybindings:
21
-
22
- ```json
23
- {
24
- "tui.altScreen.pageUp": []
25
- }
26
- ```
27
-
28
- After editing the file, run `/reload` to apply the changes to the active session.
29
-
30
- ## Key syntax
31
-
32
- Write a key as `modifier+key`. Modifiers are `ctrl`, `shift`, `alt`, and `super`. You can combine modifiers. Valid keys are:
33
-
34
- - **Letters:** `a-z`
35
- - **Digits:** `0-9`
36
- - **Special:** `escape`, `esc`, `enter`, `return`, `tab`, `space`, `backspace`, `delete`, `insert`, `clear`, `home`, `end`, `pageUp`, `pageDown`, `up`, `down`, `left`, `right`
37
- - **Function:** `f1`-`f12`
38
- - **Symbols:** `` ` ``, `-`, `=`, `[`, `]`, `\`, `;`, `'`, `,`, `.`, `/`, `!`, `@`, `#`, `$`, `%`, `^`, `&`, `*`, `(`, `)`, `_`, `+`, `|`, `~`, `{`, `}`, `:`, `<`, `>`, `?`
39
-
40
- Examples: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, `super+k`, `ctrl+super+k`, and `ctrl+1`.
41
-
42
- `super` bindings require a terminal that reports the modifier separately, typically through the Kitty keyboard protocol. They may not work in terminals without that support.
43
-
44
- ## Actions
45
-
46
- ### Terminal UI
47
-
48
- #### Cursor movement
49
-
50
- | Keybinding id | Default | Description |
51
- |---|---|---|
52
- | `tui.editor.cursorUp` | `up` | Move cursor up, browsing older history at the top |
53
- | `tui.editor.cursorDown` | `down` | Move cursor down, browsing newer history at the bottom |
54
- | `tui.editor.historyPrevious` | None | Select the previous prompt history entry |
55
- | `tui.editor.historyNext` | None | Select the next prompt history entry |
56
- | `tui.editor.cursorLeft` | `left`, `ctrl+b` | Move cursor left |
57
- | `tui.editor.cursorRight` | `right`, `ctrl+f` | Move cursor right |
58
- | `tui.editor.cursorWordLeft` | `alt+left`, `ctrl+left`, `alt+b` | Move cursor word left |
59
- | `tui.editor.cursorWordRight` | `alt+right`, `ctrl+right`, `alt+f` | Move cursor word right |
60
- | `tui.editor.cursorLineStart` | `home`, `ctrl+home`, `ctrl+a` | Move to line start |
61
- | `tui.editor.cursorLineEnd` | `end`, `ctrl+end`, `ctrl+e` | Move to line end |
62
- | `tui.editor.jumpForward` | `ctrl+]` | Jump forward to character |
63
- | `tui.editor.jumpBackward` | `ctrl+alt+]` | Jump backward to character |
64
- | `tui.editor.pageUp` | `pageUp`, `ctrl+pageUp` | Scroll up by page |
65
- | `tui.editor.pageDown` | `pageDown`, `ctrl+pageDown` | Scroll down by page |
66
-
67
- The dedicated history actions browse prompt history regardless of cursor position and take precedence over application actions using the same key.
68
-
69
- #### Text editing
70
-
71
- | Keybinding id | Default | Description |
72
- |---|---|---|
73
- | `tui.editor.deleteCharBackward` | `backspace` | Delete character backward |
74
- | `tui.editor.deleteCharForward` | `delete`, `ctrl+d` | Delete character forward |
75
- | `tui.editor.deleteWordBackward` | `ctrl+w`, `alt+backspace` | Delete word backward |
76
- | `tui.editor.deleteWordForward` | `alt+d`, `alt+delete` | Delete word forward |
77
- | `tui.editor.deleteToLineStart` | `ctrl+u` | Delete to line start |
78
- | `tui.editor.deleteToLineEnd` | `ctrl+k` | Delete to line end |
79
- | `tui.editor.yank` | `ctrl+y` | Paste most recently deleted text |
80
- | `tui.editor.yankPop` | `alt+y` | Cycle through deleted text after yank |
81
- | `tui.editor.undo` | `ctrl+-` (`ctrl+z` on Windows; `alt+z` on WSL) | Undo last edit |
82
-
83
- #### Input and selection
84
-
85
- | Keybinding id | Default | Description |
86
- |---|---|---|
87
- | `tui.input.newLine` | `shift+enter`, `ctrl+j` | Insert new line |
88
- | `tui.input.submit` | `enter` | Submit input |
89
- | `tui.input.tab` | `tab` | Tab or autocomplete |
90
- | `tui.input.copy` | `ctrl+c` | Copy selection |
91
- | `tui.select.up` | `up` | Move selection up |
92
- | `tui.select.down` | `down` | Move selection down |
93
- | `tui.select.pageUp` | `pageUp` | Page up in list |
94
- | `tui.select.pageDown` | `pageDown` | Page down in list |
95
- | `tui.select.confirm` | `enter` | Confirm selection |
96
- | `tui.select.cancel` | `escape`, `ctrl+c` | Cancel selection |
97
-
98
- #### Fullscreen
99
-
100
- In fullscreen mode, these actions control the transcript and take precedence over editor actions using the same key.
101
-
102
- | Keybinding id | Default | Description |
103
- |---|---|---|
104
- | `tui.altScreen.pageUp` | `pageUp` | Scroll the transcript up by one page |
105
- | `tui.altScreen.pageDown` | `pageDown` | Scroll the transcript down by one page |
106
- | `tui.altScreen.halfPageUp` | None | Scroll the transcript up by half a page |
107
- | `tui.altScreen.halfPageDown` | None | Scroll the transcript down by half a page |
108
- | `tui.altScreen.lineUp` | None | Scroll the transcript up by one line |
109
- | `tui.altScreen.lineDown` | None | Scroll the transcript down by one line |
110
- | `tui.altScreen.previousPrompt` | `ctrl+shift+up`, `ctrl+up` (`ctrl+up` only on Windows and WSL) | Jump to the previous marked message |
111
- | `tui.altScreen.nextPrompt` | `ctrl+shift+down`, `ctrl+down` (`ctrl+down` only on Windows and WSL) | Jump to the next marked message |
112
- | `tui.altScreen.search` | `ctrl+shift+f` (`ctrl+f` on Windows and WSL) | Search the rendered transcript |
113
- | `tui.altScreen.searchNext` | `enter`, `ctrl+g` | Select the next search match while searching |
114
- | `tui.altScreen.searchPrevious` | `shift+enter`, `ctrl+shift+g` | Select the previous search match while searching |
115
- | `tui.altScreen.searchClose` | `escape` | Close transcript search |
116
- | `tui.altScreen.top` | `home` | Scroll to the beginning of the transcript |
117
- | `tui.altScreen.bottom` | `end` | Scroll to the transcript end and follow new output |
118
-
119
- ### Application
120
-
121
- | Keybinding id | Default | Description |
122
- |--------|---------|-------------|
123
- | `app.interrupt` | `escape` | Cancel / abort |
124
- | `app.clear` | `ctrl+c` | Clear editor (first) / exit (second) |
125
- | `app.exit` | `ctrl+d` | Exit (when editor empty) |
126
- | `app.suspend` | `ctrl+z` (None on Windows) | Suspend to background |
127
- | `app.editor.external` | `ctrl+g` | Open in external editor (`externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere) |
128
- | `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows and WSL) | Paste files on macOS, images, or text from clipboard |
129
-
130
- On native Windows, `app.suspend` has no default because Windows terminals do not support Unix job control. If you assign it manually, Pi shows a status message instead of suspending. WSL uses the normal `ctrl+z` and `fg` behavior.
131
-
132
- ### Sessions
133
-
134
- | Keybinding id | Default | Description |
135
- |--------|---------|-------------|
136
- | `app.session.new` | None | Start a new session (`/new`) |
137
- | `app.session.tree` | None | Open session tree navigator (`/tree`) |
138
- | `app.session.fork` | None | Fork current session (`/fork`) |
139
- | `app.session.resume` | None | Open session resume picker (`/resume`) |
140
- | `app.session.togglePath` | `ctrl+p` | Toggle path display |
141
- | `app.session.toggleSort` | `ctrl+s` | Toggle sort mode |
142
- | `app.session.toggleNamedFilter` | `ctrl+n` | Toggle named-only filter |
143
- | `app.session.rename` | `ctrl+r` | Rename session |
144
- | `app.session.delete` | `ctrl+d` | Delete session |
145
- | `app.session.deleteNoninvasive` | `ctrl+backspace` | Delete session when query is empty |
146
-
147
- ### Models and Thinking
148
-
149
- | Keybinding id | Default | Description |
150
- |--------|---------|-------------|
151
- | `app.model.select` | `ctrl+l` | Open model selector |
152
- | `app.model.cycleForward` | `ctrl+p` | Cycle to next model |
153
- | `app.model.cycleBackward` | `shift+ctrl+p` (`alt+p` on Windows and WSL) | Cycle to previous model |
154
- | `app.models.save` | `ctrl+s` | Save the selected default model or scoped model configuration to settings |
155
- | `app.thinking.cycle` | `shift+tab` | Cycle thinking level |
156
- | `app.thinking.save` | `ctrl+s` | Save current thinking level to settings |
157
- | `app.thinking.toggle` | `ctrl+t` | Collapse or expand thinking blocks |
158
-
159
- ### Display and Message Queue
160
-
161
- | Keybinding id | Default | Description |
162
- |--------|---------|-------------|
163
- | `app.tools.expand` | `ctrl+o` | Collapse or expand tool output |
164
- | `app.message.copy` | `ctrl+x` | Copy the selected message in `/tree`; in fullscreen mode, copy the active selection when `fullscreenCopyOnSelect` is `false`; otherwise copy the last assistant message |
165
- | `app.message.followUp` | `alt+enter` (`ctrl+q` on Windows and WSL) | Queue follow-up message |
166
- | `app.message.dequeue` | `alt+up` (`alt+q` on Windows and WSL) | Restore queued messages to editor |
167
-
168
- ### Tree Navigation
169
-
170
- | Keybinding id | Default | Description |
171
- |--------|---------|-------------|
172
- | `app.tree.foldOrUp` | `ctrl+left`, `alt+left` | Fold current branch segment, or jump to the previous segment start |
173
- | `app.tree.unfoldOrDown` | `ctrl+right`, `alt+right` | Unfold current branch segment, or jump to the next segment start or branch end |
174
- | `app.tree.editLabel` | `shift+l` | Edit the label on the selected tree node |
175
- | `app.tree.toggleLabelTimestamp` | `shift+t` | Toggle label timestamps in the tree |
176
- | `app.tree.filter.default` | `ctrl+d` | Set tree filter to default view |
177
- | `app.tree.filter.noTools` | `ctrl+t` | Toggle tree filter that hides tool results |
178
- | `app.tree.filter.userOnly` | `ctrl+u` | Toggle tree filter that shows only user messages |
179
- | `app.tree.filter.labeledOnly` | `ctrl+l` | Toggle tree filter that shows only labeled entries |
180
- | `app.tree.filter.all` | `ctrl+a` | Toggle tree filter that shows all entries |
181
- | `app.tree.filter.cycleForward` | `ctrl+o` | Cycle tree filter forward |
182
- | `app.tree.filter.cycleBackward` | `shift+ctrl+o` | Cycle tree filter backward |
183
-
184
- ### Scoped Models Selector
185
-
186
- Used inside the scoped models selector (opened via `/scoped-models`).
187
-
188
- | Keybinding id | Default | Description |
189
- |--------|---------|-------------|
190
- | `app.models.enableAll` | `ctrl+a` | Enable all models (or all matching the current search) |
191
- | `app.models.clearAll` | `ctrl+x` | Clear all models (or all matching the current search) |
192
- | `app.models.toggleProvider` | `ctrl+p` | Toggle all models for the current provider |
193
- | `app.models.reorderUp` | `alt+up` | Move the selected model up in the cycle order |
194
- | `app.models.reorderDown` | `alt+down` | Move the selected model down in the cycle order |
@@ -1,17 +0,0 @@
1
- # Configure your terminal
2
-
3
- Most modern terminals work with Pi without additional setup. Use this page when modified keys, scrolling, links, images, colors, or input-method editor (IME) positioning do not behave as expected.
4
-
5
- Pi uses extended-key protocols so terminals can distinguish combinations such as `Shift+Enter` and `Alt+Enter` from plain `Enter`. Terminal proxies, multiplexers, and built-in IDE terminals can change or discard that information.
6
-
7
- Pi auto-detects truecolor support for themed output. If detection fails behind a terminal proxy or multiplexer, use this advanced override:
8
-
9
- | Capability | Environment variable | JSON setting |
10
- |------------|----------------------|--------------|
11
- | Truecolor | `PI_TRUE_COLOR=1\|0\|auto` | `terminal.trueColor: true\|false\|"auto"` |
12
-
13
- Use `/hotkeys` to inspect Pi's active shortcuts. See [Keybindings](keybindings.md) to change them.
14
-
15
- ## Terminal emulators
16
-
17
- Pi's headless modes do not capture keyboard or mouse input and do not use an alternate screen. Terminal-specific key mappings, fullscreen scrolling workarounds, and hardware-cursor settings are not required. An RPC client owns its own input and display behavior.
package/docs/tmux.md DELETED
@@ -1,55 +0,0 @@
1
- # Run Pi in tmux
2
-
3
- Pi works inside tmux, but tmux can report `Shift+Enter`, `Ctrl+Enter`, and plain `Enter` as the same key. Enable extended keys so Pi can distinguish them.
4
-
5
- ## Check your tmux version
6
-
7
- ```bash
8
- tmux -V
9
- ```
10
-
11
- For tmux 3.5 or newer, use the recommended CSI-u configuration below. For tmux 3.2 through 3.4, use the older-version configuration.
12
-
13
- ## Enable extended keys in tmux 3.5 or newer
14
-
15
- Add these lines to `~/.tmux.conf`:
16
-
17
- ```tmux
18
- set -g extended-keys on
19
- set -g extended-keys-format csi-u
20
- ```
21
-
22
- Pi requests extended-key reporting when the terminal does not provide the Kitty keyboard protocol directly. CSI-u is the most reliable format for forwarding modified keys through tmux.
23
-
24
- ## Restart tmux
25
-
26
- The configuration applies to the tmux server. To guarantee that it is active, close your tmux sessions and start a new server.
27
-
28
- If you choose to stop the server from the command line, save your work first. This command terminates every session managed by that server:
29
-
30
- ```bash
31
- tmux kill-server
32
- tmux
33
- ```
34
-
35
- ## Verify modified keys
36
-
37
- Start Pi inside the new tmux session and check that:
38
-
39
- 1. `Shift+Enter` inserts a new line in the editor.
40
- 2. `Enter` submits the prompt.
41
- 3. `Alt+Enter` queues a follow-up on macOS and Linux. Windows and WSL use `Ctrl+Q` by default.
42
-
43
- If these keys still behave like plain `Enter`, verify that the terminal outside tmux can report modified keys. See [Configure your terminal](terminal-setup.md).
44
-
45
- ## Use tmux 3.2 through 3.4
46
-
47
- These versions support extended keys but not `extended-keys-format csi-u`. Add only:
48
-
49
- ```tmux
50
- set -g extended-keys on
51
- ```
52
-
53
- Pi supports the xterm `modifyOtherKeys` format used by these versions. Restart tmux and repeat the verification steps.
54
-
55
- For older versions, upgrade tmux or use Pi outside tmux rather than relying on modified Enter shortcuts.
package/docs/tui.md DELETED
@@ -1,125 +0,0 @@
1
- # Terminal UI
2
-
3
- `@punch-bot/tui` provides the terminal component system used by Pi. Extensions use it when built-in dialogs, notifications, status text, and widgets are not enough for the interaction they need.
4
-
5
- Start with `ctx.ui` methods from an [extension](extensions.md#interact-with-the-user). Build a custom component only when the UI needs its own rendering, keyboard or mouse input, focus, layout, or lifecycle.
6
-
7
- ## Choose an integration point
8
-
9
- | Need | Use |
10
- |---|---|
11
- | Select, confirm, input, or multi-line editor | `ctx.ui.select()`, `confirm()`, `input()`, or `editor()` |
12
- | Non-blocking feedback | `ctx.ui.notify()` or `setStatus()` |
13
- | Persistent content near the editor | `ctx.ui.setWidget()` |
14
- | Replace the header, footer, or editor | The corresponding `ctx.ui` component factory |
15
- | Temporary interactive screen or overlay | `ctx.ui.custom()` |
16
- | Custom rendering for a tool or session entry | An extension renderer |
17
-
18
- These APIs receive Pi’s active theme and keybindings where needed. Do not create a second terminal renderer inside an extension.
19
-
20
- ## Understand the component model
21
-
22
- A component renders an array of terminal lines for an available width. It can optionally handle keyboard and mouse input, and it must invalidate cached output when its state or theme-dependent content changes.
23
-
24
- Every rendered line must fit within the supplied width. Measure visible terminal columns rather than string length because ANSI escapes, wide characters, emoji, and combining characters change display width.
25
-
26
- Use `visibleWidth()`, `truncateToWidth()`, `sliceByColumn()`, and `wrapTextWithAnsi()` instead of implementing terminal-width handling yourself. Pi resets styling and hyperlinks after every line, so reapply styles on each rendered line.
27
-
28
- After changing component state, invalidate the affected component and call the injected `tui.requestRender()`. The TUI coalesces render requests and updates the terminal.
29
-
30
- ## Compose built-in components
31
-
32
- The package includes components for common layouts and controls:
33
-
34
- - `Text`, `Markdown`, `Image`, and `TruncatedText` render content.
35
- - `Container`, `VStack`, `HStack`, `Box`, and `Spacer` compose layouts.
36
- - `Input` and `Editor` accept text.
37
- - `SelectList` and `SettingsList` implement searchable selection and settings flows.
38
- - `ScrollView` provides a bounded scrollable viewport.
39
- - `Loader` and `CancellableLoader` report ongoing work.
40
- - `MouseRegion` adds pointer behavior around another component.
41
-
42
- Prefer these components over rebuilding selection, scrolling, text editing, or width handling. The extension examples show how to combine them with Pi’s borders and themes.
43
-
44
- ## Handle keyboard input and focus
45
-
46
- Use `matchesKey()` and `Key` for terminal keyboard input. The parser accounts for supported terminal protocols and key modifiers. Extension components should use the injected `KeybindingsManager` for configurable application actions.
47
-
48
- A component that displays a text cursor should implement `Focusable` and place `CURSOR_MARKER` immediately before its visual cursor. The TUI uses that marker to position the hardware cursor for input method editors.
49
-
50
- Containers that wrap an `Input` or `Editor` must propagate their `focused` state to that child. Without propagation, Chinese, Japanese, Korean, and other IME candidate windows can appear at the wrong screen position.
51
-
52
- Extend Pi’s `CustomEditor` when replacing the main editor. It preserves application shortcuts and agent controls.
53
-
54
- Forward keys your editor does not own to the base implementation, and restore the default by clearing the custom editor factory.
55
-
56
- ## Handle mouse input
57
-
58
- Fullscreen mode routes normalized mouse events to components. A handler can mark an event handled, capture a drag sequence, request focus, or request a render.
59
-
60
- Unhandled wheel events scroll the nearest `ScrollView`. Unhandled primary-button drags remain available for transcript selection. OSC 8 links take precedence over enclosing click regions.
61
-
62
- Regular mode leaves mouse input to the terminal because the terminal owns scrollback. Design every interaction with a keyboard path even when fullscreen mouse input is available.
63
-
64
- ## Use custom screens and overlays
65
-
66
- `ctx.ui.custom()` temporarily gives one component control of the interactive area and resolves when that component calls the supplied completion callback.
67
-
68
- Pass `overlay: true` to draw above existing content. Overlay options control size, anchors, offsets, margins, and responsive visibility. An overlay handle can change focus or temporarily hide and show the overlay with `setHidden()` while the interaction remains active.
69
-
70
- Focused overlays retain input ownership across ordinary renders. If another component should receive input while an overlay remains visible, explicitly release or redirect focus through the handle.
71
-
72
- Treat each custom component instance as belonging to one interaction. Create a new instance when starting that interaction again.
73
-
74
- Finish the interaction with the completion callback supplied to the component factory. It resolves the `ctx.ui.custom()` promise and disposes the component. Do not call `OverlayHandle.hide()` on an overlay created by `ctx.ui.custom()`.
75
-
76
- See [`overlay-qa-tests.ts`](../examples/extensions/overlay-qa-tests.ts) for positioning, stacking, focus, responsive visibility, and animation behavior.
77
-
78
- ## Apply themes correctly
79
-
80
- Use the theme passed to the extension or component callback. Theme helpers produce ANSI-styled strings for semantic colors such as accent, muted text, success, warnings, errors, tool output, and Markdown.
81
-
82
- Use `theme.style()` to combine foreground and background colors with text attributes:
83
-
84
- ```typescript
85
- return new Text(
86
- theme.style("Done!", {
87
- fg: "success",
88
- bg: "toolSuccessBg",
89
- bold: true,
90
- }),
91
- 0,
92
- 0,
93
- );
94
- ```
95
-
96
- A style color can be a semantic theme token or a concrete `Color`. Foreground tokens are accepted as `fg` and background tokens as `bg`; to use a token's color in the other position, pass its concrete color, for example `{ fg: theme.colors.userMessageBg }`. Access concrete colors through `theme.colors` and use utilities such as `mixColors()` from `@punch-bot/tui` when color math is needed. Tokens that a theme sets to the terminal default render with the terminal's own color; `theme.colors` reports the color the terminal announced for them, or a guess when it did not. Use `theme.appearance` (`"dark"` or `"light"`) to decide, for example, whether to lighten or darken a color. Pi converts the result to truecolor or 256-color output based on terminal capabilities. Theme tokens are converted once per theme; compute concrete colors outside the render path when possible.
97
-
98
- The existing `theme.fg()` and `theme.bg()` helpers remain available for applying one semantic color.
99
-
100
- Do not permanently store strings with theme colors unless `invalidate()` rebuilds them. A theme change clears render caches, but it cannot remove old ANSI colors embedded in application state.
101
-
102
- Theme callbacks evaluated during rendering do not need special rebuilding. Stateless components can also calculate themed output on every render.
103
-
104
- Use [Themes](themes.md) to create terminal palettes. Use Pi’s `getMarkdownTheme()` when rendering Markdown that should match the active application theme.
105
-
106
- ## Keep rendering responsive
107
-
108
- Rendering runs on the interactive path. Cache expensive layout and highlighting work by width and content, then clear that cache from `invalidate()`.
109
-
110
- Keep the default view compact and reveal detail through expansion or a dedicated screen. For custom tool rendering, handle partial results and reuse the previous component when it can be updated safely.
111
-
112
- Use `PI_TUI_WRITE_LOG` to capture the raw ANSI stream when diagnosing rendering problems. Test narrow widths, wide characters, resize events, theme changes, focus transitions, and both regular and fullscreen modes.
113
-
114
- ## Examples and source
115
-
116
- The checked extension examples cover the main patterns:
117
-
118
- - [`preset.ts`](../examples/extensions/preset.ts) and [`tools.ts`](../examples/extensions/tools.ts) use selection and settings lists.
119
- - [`qna.ts`](../examples/extensions/qna.ts) uses cancellable asynchronous UI.
120
- - [`modal-editor.ts`](../examples/extensions/modal-editor.ts) replaces the editor.
121
- - [`custom-footer.ts`](../examples/extensions/custom-footer.ts) replaces the footer.
122
- - [`widget-placement.ts`](../examples/extensions/widget-placement.ts) places persistent content around the editor.
123
- - [`doom-overlay/`](../examples/extensions/doom-overlay/) demonstrates a continuously rendered overlay.
124
-
125
- The public exports are defined in [`packages/tui/src/index.ts`](https://github.com/earendil-works/pi/blob/main/packages/tui/src/index.ts). See [Extensions](extensions.md) for extension lifecycle, state, tools, events, and mode behavior.