@subimpact/e 0.0.0-stage → 0.99.2

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 (1147) hide show
  1. package/CHANGELOG.md +6025 -0
  2. package/README.md +54 -2
  3. package/dist/bun/cli.d.ts +5 -0
  4. package/dist/bun/cli.d.ts.map +1 -0
  5. package/dist/bun/cli.js +5 -0
  6. package/dist/bun/cli.js.map +1 -0
  7. package/dist/bun/restore-sandbox-env.d.ts +17 -0
  8. package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
  9. package/dist/bun/restore-sandbox-env.js +36 -0
  10. package/dist/bun/restore-sandbox-env.js.map +1 -0
  11. package/dist/bun/runtime-setup.d.ts +2 -0
  12. package/dist/bun/runtime-setup.d.ts.map +1 -0
  13. package/dist/bun/runtime-setup.js +9 -0
  14. package/dist/bun/runtime-setup.js.map +1 -0
  15. package/dist/bun/sandbox-env-setup.d.ts +2 -0
  16. package/dist/bun/sandbox-env-setup.d.ts.map +1 -0
  17. package/dist/bun/sandbox-env-setup.js +4 -0
  18. package/dist/bun/sandbox-env-setup.js.map +1 -0
  19. package/dist/bundle/chunks/anthropic-messages-UID2PALB.js +6 -0
  20. package/dist/bundle/chunks/anthropic.js +75 -0
  21. package/dist/bundle/chunks/azure-openai-responses-TLHNIYZK.js +2 -0
  22. package/dist/bundle/chunks/bedrock-converse-stream.js +83 -0
  23. package/dist/bundle/chunks/chunk-4L3WN2XY.js +2 -0
  24. package/dist/bundle/chunks/chunk-5ZENNE67.js +1447 -0
  25. package/dist/bundle/chunks/chunk-6CYCI3EJ.js +12 -0
  26. package/dist/bundle/chunks/chunk-6D7LHLKG.js +2 -0
  27. package/dist/bundle/chunks/chunk-75XIWY7P.js +2 -0
  28. package/dist/bundle/chunks/chunk-7JGR3GZN.js +11 -0
  29. package/dist/bundle/chunks/chunk-7ZC4UXSL.js +2 -0
  30. package/dist/bundle/chunks/chunk-A3JYRWB6.js +2 -0
  31. package/dist/bundle/chunks/chunk-DRQDKNXA.js +2 -0
  32. package/dist/bundle/chunks/chunk-DTD7JQ7Y.js +42 -0
  33. package/dist/bundle/chunks/chunk-H3QXYIF7.js +31 -0
  34. package/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
  35. package/dist/bundle/chunks/chunk-LD2P6SFZ.js +2 -0
  36. package/dist/bundle/chunks/chunk-OENUXCXU.js +46 -0
  37. package/dist/bundle/chunks/chunk-OSKPX3Z5.js +2 -0
  38. package/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
  39. package/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
  40. package/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
  41. package/dist/bundle/chunks/chunk-R5J3MOBF.js +11 -0
  42. package/dist/bundle/chunks/chunk-S3GGRYIO.js +6 -0
  43. package/dist/bundle/chunks/chunk-SS3AAGL7.js +132 -0
  44. package/dist/bundle/chunks/chunk-TEPMHNKQ.js +2 -0
  45. package/dist/bundle/chunks/chunk-TRDNDS6A.js +4 -0
  46. package/dist/bundle/chunks/chunk-USJZMAIR.js +2 -0
  47. package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
  48. package/dist/bundle/chunks/chunk-VIV3CWXG.js +2 -0
  49. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-NPQN263E.js +2 -0
  50. package/dist/bundle/chunks/github-copilot.js +2 -0
  51. package/dist/bundle/chunks/google-generative-ai-3Z6VNDJN.js +2 -0
  52. package/dist/bundle/chunks/google-vertex-NU6OFGNA.js +2 -0
  53. package/dist/bundle/chunks/https-proxy-agent-2VXB7436.js +13 -0
  54. package/dist/bundle/chunks/image-resize-worker.js +2 -0
  55. package/dist/bundle/chunks/jiti-loader-C3NU2SDH.js +21 -0
  56. package/dist/bundle/chunks/jiti-static-loader-E6ANQD5T.js +2 -0
  57. package/dist/bundle/chunks/kimi-coding.js +2 -0
  58. package/dist/bundle/chunks/lib-TEDK3E5I.js +9 -0
  59. package/dist/bundle/chunks/llama-cpp-classify-XT44PI3C.js +22 -0
  60. package/dist/bundle/chunks/meta.js +2 -0
  61. package/dist/bundle/chunks/mistral-conversations-DKVFNQL6.js +5 -0
  62. package/dist/bundle/chunks/multipart-parser-SQ6GDJL7.js +3 -0
  63. package/dist/bundle/chunks/node-O3RIBJRH.js +16 -0
  64. package/dist/bundle/chunks/node-TWVVAGPO.js +2 -0
  65. package/dist/bundle/chunks/openai-chatgpt.js +75 -0
  66. package/dist/bundle/chunks/openai-codex-responses-3GKGNXC4.js +10 -0
  67. package/dist/bundle/chunks/openai-codex.js +75 -0
  68. package/dist/bundle/chunks/openai-completions-JXDDPZ23.js +7 -0
  69. package/dist/bundle/chunks/openai-responses-S7GKCCDG.js +3 -0
  70. package/dist/bundle/chunks/openrouter-images-ZVXWCSIM.js +2 -0
  71. package/dist/bundle/chunks/openrouter.js +75 -0
  72. package/dist/bundle/chunks/pi-logo-animation-MA3YLQTM.js +2 -0
  73. package/dist/bundle/chunks/pi-messages-TM5SOOIW.js +8 -0
  74. package/dist/bundle/chunks/radius.js +75 -0
  75. package/dist/bundle/chunks/src-UK77SYZE.js +4 -0
  76. package/dist/bundle/chunks/typesafe-system-one-A4CZTQWZ.js +2 -0
  77. package/dist/bundle/chunks/virtual-modules-VX2P5PB3.js +2 -0
  78. package/dist/bundle/chunks/xai.js +2 -0
  79. package/dist/bundle/cli-runtime.js +3 -0
  80. package/dist/bundle/cli.js +5 -0
  81. package/dist/bundle/index.js +2 -0
  82. package/dist/bundle/rpc-entry.js +3 -0
  83. package/dist/cli/args.d.ts +61 -0
  84. package/dist/cli/args.d.ts.map +1 -0
  85. package/dist/cli/args.js +450 -0
  86. package/dist/cli/args.js.map +1 -0
  87. package/dist/cli/auth-check.d.ts +19 -0
  88. package/dist/cli/auth-check.d.ts.map +1 -0
  89. package/dist/cli/auth-check.js +50 -0
  90. package/dist/cli/auth-check.js.map +1 -0
  91. package/dist/cli/auth-command.d.ts +24 -0
  92. package/dist/cli/auth-command.d.ts.map +1 -0
  93. package/dist/cli/auth-command.js +103 -0
  94. package/dist/cli/auth-command.js.map +1 -0
  95. package/dist/cli/config-selector.d.ts +16 -0
  96. package/dist/cli/config-selector.d.ts.map +1 -0
  97. package/dist/cli/config-selector.js +32 -0
  98. package/dist/cli/config-selector.js.map +1 -0
  99. package/dist/cli/credential-print.d.ts +13 -0
  100. package/dist/cli/credential-print.d.ts.map +1 -0
  101. package/dist/cli/credential-print.js +76 -0
  102. package/dist/cli/credential-print.js.map +1 -0
  103. package/dist/cli/file-processor.d.ts +15 -0
  104. package/dist/cli/file-processor.d.ts.map +1 -0
  105. package/dist/cli/file-processor.js +71 -0
  106. package/dist/cli/file-processor.js.map +1 -0
  107. package/dist/cli/initial-message.d.ts +18 -0
  108. package/dist/cli/initial-message.d.ts.map +1 -0
  109. package/dist/cli/initial-message.js +22 -0
  110. package/dist/cli/initial-message.js.map +1 -0
  111. package/dist/cli/list-models.d.ts +9 -0
  112. package/dist/cli/list-models.d.ts.map +1 -0
  113. package/dist/cli/list-models.js +98 -0
  114. package/dist/cli/list-models.js.map +1 -0
  115. package/dist/cli/project-trust.d.ts +10 -0
  116. package/dist/cli/project-trust.d.ts.map +1 -0
  117. package/dist/cli/project-trust.js +48 -0
  118. package/dist/cli/project-trust.js.map +1 -0
  119. package/dist/cli/session-picker.d.ts +10 -0
  120. package/dist/cli/session-picker.d.ts.map +1 -0
  121. package/dist/cli/session-picker.js +36 -0
  122. package/dist/cli/session-picker.js.map +1 -0
  123. package/dist/cli/setup.d.ts +2 -0
  124. package/dist/cli/setup.d.ts.map +1 -0
  125. package/dist/cli/setup.js +12 -0
  126. package/dist/cli/setup.js.map +1 -0
  127. package/dist/cli/startup-ui.d.ts +20 -0
  128. package/dist/cli/startup-ui.d.ts.map +1 -0
  129. package/dist/cli/startup-ui.js +193 -0
  130. package/dist/cli/startup-ui.js.map +1 -0
  131. package/dist/cli.d.ts +3 -0
  132. package/dist/cli.d.ts.map +1 -0
  133. package/dist/cli.js +6 -0
  134. package/dist/cli.js.map +1 -0
  135. package/dist/config.d.ts +107 -0
  136. package/dist/config.d.ts.map +1 -0
  137. package/dist/config.js +486 -0
  138. package/dist/config.js.map +1 -0
  139. package/dist/core/agent-session-runtime.d.ts +119 -0
  140. package/dist/core/agent-session-runtime.d.ts.map +1 -0
  141. package/dist/core/agent-session-runtime.js +317 -0
  142. package/dist/core/agent-session-runtime.js.map +1 -0
  143. package/dist/core/agent-session-services.d.ts +86 -0
  144. package/dist/core/agent-session-services.d.ts.map +1 -0
  145. package/dist/core/agent-session-services.js +147 -0
  146. package/dist/core/agent-session-services.js.map +1 -0
  147. package/dist/core/agent-session.d.ts +881 -0
  148. package/dist/core/agent-session.d.ts.map +1 -0
  149. package/dist/core/agent-session.js +3524 -0
  150. package/dist/core/agent-session.js.map +1 -0
  151. package/dist/core/auth-guidance.d.ts +5 -0
  152. package/dist/core/auth-guidance.d.ts.map +1 -0
  153. package/dist/core/auth-guidance.js +21 -0
  154. package/dist/core/auth-guidance.js.map +1 -0
  155. package/dist/core/auth-storage.d.ts +72 -0
  156. package/dist/core/auth-storage.d.ts.map +1 -0
  157. package/dist/core/auth-storage.js +426 -0
  158. package/dist/core/auth-storage.js.map +1 -0
  159. package/dist/core/bash-executor.d.ts +32 -0
  160. package/dist/core/bash-executor.d.ts.map +1 -0
  161. package/dist/core/bash-executor.js +111 -0
  162. package/dist/core/bash-executor.js.map +1 -0
  163. package/dist/core/bug-report-upload.d.ts +12 -0
  164. package/dist/core/bug-report-upload.d.ts.map +1 -0
  165. package/dist/core/bug-report-upload.js +22 -0
  166. package/dist/core/bug-report-upload.js.map +1 -0
  167. package/dist/core/bug-report.d.ts +176 -0
  168. package/dist/core/bug-report.d.ts.map +1 -0
  169. package/dist/core/bug-report.js +292 -0
  170. package/dist/core/bug-report.js.map +1 -0
  171. package/dist/core/cache-stats.d.ts +49 -0
  172. package/dist/core/cache-stats.d.ts.map +1 -0
  173. package/dist/core/cache-stats.js +112 -0
  174. package/dist/core/cache-stats.js.map +1 -0
  175. package/dist/core/cache-warmer.d.ts +103 -0
  176. package/dist/core/cache-warmer.d.ts.map +1 -0
  177. package/dist/core/cache-warmer.js +359 -0
  178. package/dist/core/cache-warmer.js.map +1 -0
  179. package/dist/core/compaction/branch-summarization.d.ts +98 -0
  180. package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
  181. package/dist/core/compaction/branch-summarization.js +251 -0
  182. package/dist/core/compaction/branch-summarization.js.map +1 -0
  183. package/dist/core/compaction/compaction.d.ts +145 -0
  184. package/dist/core/compaction/compaction.d.ts.map +1 -0
  185. package/dist/core/compaction/compaction.js +744 -0
  186. package/dist/core/compaction/compaction.js.map +1 -0
  187. package/dist/core/compaction/index.d.ts +7 -0
  188. package/dist/core/compaction/index.d.ts.map +1 -0
  189. package/dist/core/compaction/index.js +7 -0
  190. package/dist/core/compaction/index.js.map +1 -0
  191. package/dist/core/compaction/utils.d.ts +39 -0
  192. package/dist/core/compaction/utils.d.ts.map +1 -0
  193. package/dist/core/compaction/utils.js +149 -0
  194. package/dist/core/compaction/utils.js.map +1 -0
  195. package/dist/core/crash-log.d.ts +27 -0
  196. package/dist/core/crash-log.d.ts.map +1 -0
  197. package/dist/core/crash-log.js +140 -0
  198. package/dist/core/crash-log.js.map +1 -0
  199. package/dist/core/defaults.d.ts +4 -0
  200. package/dist/core/defaults.d.ts.map +1 -0
  201. package/dist/core/defaults.js +11 -0
  202. package/dist/core/defaults.js.map +1 -0
  203. package/dist/core/diagnostics.d.ts +15 -0
  204. package/dist/core/diagnostics.d.ts.map +1 -0
  205. package/dist/core/diagnostics.js +2 -0
  206. package/dist/core/diagnostics.js.map +1 -0
  207. package/dist/core/event-bus.d.ts +9 -0
  208. package/dist/core/event-bus.d.ts.map +1 -0
  209. package/dist/core/event-bus.js +25 -0
  210. package/dist/core/event-bus.js.map +1 -0
  211. package/dist/core/exec.d.ts +29 -0
  212. package/dist/core/exec.d.ts.map +1 -0
  213. package/dist/core/exec.js +75 -0
  214. package/dist/core/exec.js.map +1 -0
  215. package/dist/core/experimental.d.ts +2 -0
  216. package/dist/core/experimental.d.ts.map +1 -0
  217. package/dist/core/experimental.js +6 -0
  218. package/dist/core/experimental.js.map +1 -0
  219. package/dist/core/export-html/ansi-to-html.d.ts +22 -0
  220. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
  221. package/dist/core/export-html/ansi-to-html.js +249 -0
  222. package/dist/core/export-html/ansi-to-html.js.map +1 -0
  223. package/dist/core/export-html/index.d.ts +37 -0
  224. package/dist/core/export-html/index.d.ts.map +1 -0
  225. package/dist/core/export-html/index.js +226 -0
  226. package/dist/core/export-html/index.js.map +1 -0
  227. package/dist/core/export-html/template.css +1076 -0
  228. package/dist/core/export-html/template.html +55 -0
  229. package/dist/core/export-html/template.js +1918 -0
  230. package/dist/core/export-html/tool-renderer.d.ts +34 -0
  231. package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
  232. package/dist/core/export-html/tool-renderer.js +108 -0
  233. package/dist/core/export-html/tool-renderer.js.map +1 -0
  234. package/dist/core/export-html/vendor/highlight.min.js +1213 -0
  235. package/dist/core/export-html/vendor/marked.min.js +78 -0
  236. package/dist/core/extensions/index.d.ts +12 -0
  237. package/dist/core/extensions/index.d.ts.map +1 -0
  238. package/dist/core/extensions/index.js +9 -0
  239. package/dist/core/extensions/index.js.map +1 -0
  240. package/dist/core/extensions/jiti-loader.d.ts +2 -0
  241. package/dist/core/extensions/jiti-loader.d.ts.map +1 -0
  242. package/dist/core/extensions/jiti-loader.js +4 -0
  243. package/dist/core/extensions/jiti-loader.js.map +1 -0
  244. package/dist/core/extensions/jiti-static-loader.d.ts +2 -0
  245. package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -0
  246. package/dist/core/extensions/jiti-static-loader.js +4 -0
  247. package/dist/core/extensions/jiti-static-loader.js.map +1 -0
  248. package/dist/core/extensions/loader.d.ts +23 -0
  249. package/dist/core/extensions/loader.d.ts.map +1 -0
  250. package/dist/core/extensions/loader.js +667 -0
  251. package/dist/core/extensions/loader.js.map +1 -0
  252. package/dist/core/extensions/runner.d.ts +204 -0
  253. package/dist/core/extensions/runner.d.ts.map +1 -0
  254. package/dist/core/extensions/runner.js +1207 -0
  255. package/dist/core/extensions/runner.js.map +1 -0
  256. package/dist/core/extensions/types.d.ts +1667 -0
  257. package/dist/core/extensions/types.d.ts.map +1 -0
  258. package/dist/core/extensions/types.js +48 -0
  259. package/dist/core/extensions/types.js.map +1 -0
  260. package/dist/core/extensions/virtual-modules.d.ts +3 -0
  261. package/dist/core/extensions/virtual-modules.d.ts.map +1 -0
  262. package/dist/core/extensions/virtual-modules.js +38 -0
  263. package/dist/core/extensions/virtual-modules.js.map +1 -0
  264. package/dist/core/extensions/wrapper.d.ts +20 -0
  265. package/dist/core/extensions/wrapper.d.ts.map +1 -0
  266. package/dist/core/extensions/wrapper.js +22 -0
  267. package/dist/core/extensions/wrapper.js.map +1 -0
  268. package/dist/core/footer-data-provider.d.ts +64 -0
  269. package/dist/core/footer-data-provider.d.ts.map +1 -0
  270. package/dist/core/footer-data-provider.js +338 -0
  271. package/dist/core/footer-data-provider.js.map +1 -0
  272. package/dist/core/http-dispatcher.d.ts +22 -0
  273. package/dist/core/http-dispatcher.d.ts.map +1 -0
  274. package/dist/core/http-dispatcher.js +98 -0
  275. package/dist/core/http-dispatcher.js.map +1 -0
  276. package/dist/core/index.d.ts +14 -0
  277. package/dist/core/index.d.ts.map +1 -0
  278. package/dist/core/index.js +13 -0
  279. package/dist/core/index.js.map +1 -0
  280. package/dist/core/keybindings.d.ts +428 -0
  281. package/dist/core/keybindings.d.ts.map +1 -0
  282. package/dist/core/keybindings.js +321 -0
  283. package/dist/core/keybindings.js.map +1 -0
  284. package/dist/core/messages.d.ts +77 -0
  285. package/dist/core/messages.d.ts.map +1 -0
  286. package/dist/core/messages.js +124 -0
  287. package/dist/core/messages.js.map +1 -0
  288. package/dist/core/model-config.d.ts +724 -0
  289. package/dist/core/model-config.d.ts.map +1 -0
  290. package/dist/core/model-config.js +282 -0
  291. package/dist/core/model-config.js.map +1 -0
  292. package/dist/core/model-registry.d.ts +61 -0
  293. package/dist/core/model-registry.d.ts.map +1 -0
  294. package/dist/core/model-registry.js +140 -0
  295. package/dist/core/model-registry.js.map +1 -0
  296. package/dist/core/model-resolver.d.ts +124 -0
  297. package/dist/core/model-resolver.d.ts.map +1 -0
  298. package/dist/core/model-resolver.js +590 -0
  299. package/dist/core/model-resolver.js.map +1 -0
  300. package/dist/core/model-runtime.d.ts +145 -0
  301. package/dist/core/model-runtime.d.ts.map +1 -0
  302. package/dist/core/model-runtime.js +758 -0
  303. package/dist/core/model-runtime.js.map +1 -0
  304. package/dist/core/models-store.d.ts +22 -0
  305. package/dist/core/models-store.d.ts.map +1 -0
  306. package/dist/core/models-store.js +115 -0
  307. package/dist/core/models-store.js.map +1 -0
  308. package/dist/core/nested-tool-calls.d.ts +102 -0
  309. package/dist/core/nested-tool-calls.d.ts.map +1 -0
  310. package/dist/core/nested-tool-calls.js +178 -0
  311. package/dist/core/nested-tool-calls.js.map +1 -0
  312. package/dist/core/output-guard.d.ts +7 -0
  313. package/dist/core/output-guard.d.ts.map +1 -0
  314. package/dist/core/output-guard.js +89 -0
  315. package/dist/core/output-guard.js.map +1 -0
  316. package/dist/core/package-manager.d.ts +217 -0
  317. package/dist/core/package-manager.d.ts.map +1 -0
  318. package/dist/core/package-manager.js +2224 -0
  319. package/dist/core/package-manager.js.map +1 -0
  320. package/dist/core/pi-manifest.d.ts +8 -0
  321. package/dist/core/pi-manifest.d.ts.map +1 -0
  322. package/dist/core/pi-manifest.js +26 -0
  323. package/dist/core/pi-manifest.js.map +1 -0
  324. package/dist/core/project-trust.d.ts +15 -0
  325. package/dist/core/project-trust.d.ts.map +1 -0
  326. package/dist/core/project-trust.js +59 -0
  327. package/dist/core/project-trust.js.map +1 -0
  328. package/dist/core/prompt-templates.d.ts +59 -0
  329. package/dist/core/prompt-templates.d.ts.map +1 -0
  330. package/dist/core/prompt-templates.js +262 -0
  331. package/dist/core/prompt-templates.js.map +1 -0
  332. package/dist/core/provider-attribution.d.ts +4 -0
  333. package/dist/core/provider-attribution.d.ts.map +1 -0
  334. package/dist/core/provider-attribution.js +72 -0
  335. package/dist/core/provider-attribution.js.map +1 -0
  336. package/dist/core/provider-composer.d.ts +79 -0
  337. package/dist/core/provider-composer.d.ts.map +1 -0
  338. package/dist/core/provider-composer.js +475 -0
  339. package/dist/core/provider-composer.js.map +1 -0
  340. package/dist/core/radius.d.ts +5 -0
  341. package/dist/core/radius.d.ts.map +1 -0
  342. package/dist/core/radius.js +9 -0
  343. package/dist/core/radius.js.map +1 -0
  344. package/dist/core/remote-catalog-provider.d.ts +12 -0
  345. package/dist/core/remote-catalog-provider.d.ts.map +1 -0
  346. package/dist/core/remote-catalog-provider.js +132 -0
  347. package/dist/core/remote-catalog-provider.js.map +1 -0
  348. package/dist/core/resolve-config-value.d.ts +30 -0
  349. package/dist/core/resolve-config-value.d.ts.map +1 -0
  350. package/dist/core/resolve-config-value.js +247 -0
  351. package/dist/core/resolve-config-value.js.map +1 -0
  352. package/dist/core/resource-loader.d.ts +227 -0
  353. package/dist/core/resource-loader.d.ts.map +1 -0
  354. package/dist/core/resource-loader.js +1004 -0
  355. package/dist/core/resource-loader.js.map +1 -0
  356. package/dist/core/runtime-credentials.d.ts +15 -0
  357. package/dist/core/runtime-credentials.d.ts.map +1 -0
  358. package/dist/core/runtime-credentials.js +39 -0
  359. package/dist/core/runtime-credentials.js.map +1 -0
  360. package/dist/core/sdk.d.ts +108 -0
  361. package/dist/core/sdk.d.ts.map +1 -0
  362. package/dist/core/sdk.js +315 -0
  363. package/dist/core/sdk.js.map +1 -0
  364. package/dist/core/session-cwd.d.ts +19 -0
  365. package/dist/core/session-cwd.d.ts.map +1 -0
  366. package/dist/core/session-cwd.js +38 -0
  367. package/dist/core/session-cwd.js.map +1 -0
  368. package/dist/core/session-export.d.ts +8 -0
  369. package/dist/core/session-export.d.ts.map +1 -0
  370. package/dist/core/session-export.js +33 -0
  371. package/dist/core/session-export.js.map +1 -0
  372. package/dist/core/session-manager.d.ts +416 -0
  373. package/dist/core/session-manager.d.ts.map +1 -0
  374. package/dist/core/session-manager.js +1523 -0
  375. package/dist/core/session-manager.js.map +1 -0
  376. package/dist/core/settings-diagnostics.d.ts +9 -0
  377. package/dist/core/settings-diagnostics.d.ts.map +1 -0
  378. package/dist/core/settings-diagnostics.js +21 -0
  379. package/dist/core/settings-diagnostics.js.map +1 -0
  380. package/dist/core/settings-manager.d.ts +362 -0
  381. package/dist/core/settings-manager.d.ts.map +1 -0
  382. package/dist/core/settings-manager.js +1103 -0
  383. package/dist/core/settings-manager.js.map +1 -0
  384. package/dist/core/skills.d.ts +60 -0
  385. package/dist/core/skills.d.ts.map +1 -0
  386. package/dist/core/skills.js +407 -0
  387. package/dist/core/skills.js.map +1 -0
  388. package/dist/core/slash-commands.d.ts +15 -0
  389. package/dist/core/slash-commands.d.ts.map +1 -0
  390. package/dist/core/slash-commands.js +28 -0
  391. package/dist/core/slash-commands.js.map +1 -0
  392. package/dist/core/source-info.d.ts +26 -0
  393. package/dist/core/source-info.d.ts.map +1 -0
  394. package/dist/core/source-info.js +35 -0
  395. package/dist/core/source-info.js.map +1 -0
  396. package/dist/core/system-prompt.d.ts +71 -0
  397. package/dist/core/system-prompt.d.ts.map +1 -0
  398. package/dist/core/system-prompt.js +147 -0
  399. package/dist/core/system-prompt.js.map +1 -0
  400. package/dist/core/telemetry.d.ts +3 -0
  401. package/dist/core/telemetry.d.ts.map +1 -0
  402. package/dist/core/telemetry.js +10 -0
  403. package/dist/core/telemetry.js.map +1 -0
  404. package/dist/core/timings.d.ts +6 -0
  405. package/dist/core/timings.d.ts.map +1 -0
  406. package/dist/core/timings.js +42 -0
  407. package/dist/core/timings.js.map +1 -0
  408. package/dist/core/tools/bash.d.ts +101 -0
  409. package/dist/core/tools/bash.d.ts.map +1 -0
  410. package/dist/core/tools/bash.js +348 -0
  411. package/dist/core/tools/bash.js.map +1 -0
  412. package/dist/core/tools/edit-diff.d.ts +101 -0
  413. package/dist/core/tools/edit-diff.d.ts.map +1 -0
  414. package/dist/core/tools/edit-diff.js +421 -0
  415. package/dist/core/tools/edit-diff.js.map +1 -0
  416. package/dist/core/tools/edit.d.ts +44 -0
  417. package/dist/core/tools/edit.d.ts.map +1 -0
  418. package/dist/core/tools/edit.js +147 -0
  419. package/dist/core/tools/edit.js.map +1 -0
  420. package/dist/core/tools/file-mutation-queue.d.ts +6 -0
  421. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
  422. package/dist/core/tools/file-mutation-queue.js +52 -0
  423. package/dist/core/tools/file-mutation-queue.js.map +1 -0
  424. package/dist/core/tools/find.d.ts +42 -0
  425. package/dist/core/tools/find.d.ts.map +1 -0
  426. package/dist/core/tools/find.js +251 -0
  427. package/dist/core/tools/find.js.map +1 -0
  428. package/dist/core/tools/grep.d.ts +41 -0
  429. package/dist/core/tools/grep.d.ts.map +1 -0
  430. package/dist/core/tools/grep.js +252 -0
  431. package/dist/core/tools/grep.js.map +1 -0
  432. package/dist/core/tools/index.d.ts +43 -0
  433. package/dist/core/tools/index.d.ts.map +1 -0
  434. package/dist/core/tools/index.js +129 -0
  435. package/dist/core/tools/index.js.map +1 -0
  436. package/dist/core/tools/ls.d.ts +41 -0
  437. package/dist/core/tools/ls.d.ts.map +1 -0
  438. package/dist/core/tools/ls.js +126 -0
  439. package/dist/core/tools/ls.js.map +1 -0
  440. package/dist/core/tools/output-accumulator.d.ts +63 -0
  441. package/dist/core/tools/output-accumulator.d.ts.map +1 -0
  442. package/dist/core/tools/output-accumulator.js +220 -0
  443. package/dist/core/tools/output-accumulator.js.map +1 -0
  444. package/dist/core/tools/path-utils.d.ts +10 -0
  445. package/dist/core/tools/path-utils.d.ts.map +1 -0
  446. package/dist/core/tools/path-utils.js +99 -0
  447. package/dist/core/tools/path-utils.js.map +1 -0
  448. package/dist/core/tools/powershell.d.ts +16 -0
  449. package/dist/core/tools/powershell.d.ts.map +1 -0
  450. package/dist/core/tools/powershell.js +39 -0
  451. package/dist/core/tools/powershell.js.map +1 -0
  452. package/dist/core/tools/read.d.ts +42 -0
  453. package/dist/core/tools/read.d.ts.map +1 -0
  454. package/dist/core/tools/read.js +169 -0
  455. package/dist/core/tools/read.js.map +1 -0
  456. package/dist/core/tools/render-utils.d.ts +30 -0
  457. package/dist/core/tools/render-utils.d.ts.map +1 -0
  458. package/dist/core/tools/render-utils.js +91 -0
  459. package/dist/core/tools/render-utils.js.map +1 -0
  460. package/dist/core/tools/renderers/bash.d.ts +12 -0
  461. package/dist/core/tools/renderers/bash.d.ts.map +1 -0
  462. package/dist/core/tools/renderers/bash.js +117 -0
  463. package/dist/core/tools/renderers/bash.js.map +1 -0
  464. package/dist/core/tools/renderers/edit.d.ts +23 -0
  465. package/dist/core/tools/renderers/edit.d.ts.map +1 -0
  466. package/dist/core/tools/renderers/edit.js +167 -0
  467. package/dist/core/tools/renderers/edit.js.map +1 -0
  468. package/dist/core/tools/renderers/find.d.ts +10 -0
  469. package/dist/core/tools/renderers/find.d.ts.map +1 -0
  470. package/dist/core/tools/renderers/find.js +64 -0
  471. package/dist/core/tools/renderers/find.js.map +1 -0
  472. package/dist/core/tools/renderers/grep.d.ts +10 -0
  473. package/dist/core/tools/renderers/grep.d.ts.map +1 -0
  474. package/dist/core/tools/renderers/grep.js +69 -0
  475. package/dist/core/tools/renderers/grep.js.map +1 -0
  476. package/dist/core/tools/renderers/index.d.ts +28 -0
  477. package/dist/core/tools/renderers/index.d.ts.map +1 -0
  478. package/dist/core/tools/renderers/index.js +47 -0
  479. package/dist/core/tools/renderers/index.js.map +1 -0
  480. package/dist/core/tools/renderers/ls.d.ts +10 -0
  481. package/dist/core/tools/renderers/ls.d.ts.map +1 -0
  482. package/dist/core/tools/renderers/ls.js +58 -0
  483. package/dist/core/tools/renderers/ls.js.map +1 -0
  484. package/dist/core/tools/renderers/read.d.ts +11 -0
  485. package/dist/core/tools/renderers/read.d.ts.map +1 -0
  486. package/dist/core/tools/renderers/read.js +130 -0
  487. package/dist/core/tools/renderers/read.js.map +1 -0
  488. package/dist/core/tools/renderers/write.d.ts +10 -0
  489. package/dist/core/tools/renderers/write.d.ts.map +1 -0
  490. package/dist/core/tools/renderers/write.js +153 -0
  491. package/dist/core/tools/renderers/write.js.map +1 -0
  492. package/dist/core/tools/tool-definition-wrapper.d.ts +16 -0
  493. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
  494. package/dist/core/tools/tool-definition-wrapper.js +38 -0
  495. package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
  496. package/dist/core/tools/truncate.d.ts +84 -0
  497. package/dist/core/tools/truncate.d.ts.map +1 -0
  498. package/dist/core/tools/truncate.js +244 -0
  499. package/dist/core/tools/truncate.js.map +1 -0
  500. package/dist/core/tools/write.d.ts +30 -0
  501. package/dist/core/tools/write.d.ts.map +1 -0
  502. package/dist/core/tools/write.js +61 -0
  503. package/dist/core/tools/write.js.map +1 -0
  504. package/dist/core/trust-manager.d.ts +36 -0
  505. package/dist/core/trust-manager.d.ts.map +1 -0
  506. package/dist/core/trust-manager.js +203 -0
  507. package/dist/core/trust-manager.js.map +1 -0
  508. package/dist/core/usage-totals.d.ts +21 -0
  509. package/dist/core/usage-totals.d.ts.map +1 -0
  510. package/dist/core/usage-totals.js +79 -0
  511. package/dist/core/usage-totals.js.map +1 -0
  512. package/dist/core/virtual-models.d.ts +117 -0
  513. package/dist/core/virtual-models.d.ts.map +1 -0
  514. package/dist/core/virtual-models.js +124 -0
  515. package/dist/core/virtual-models.js.map +1 -0
  516. package/dist/extensions/index.d.ts +3 -0
  517. package/dist/extensions/index.d.ts.map +1 -0
  518. package/dist/extensions/index.js +3 -0
  519. package/dist/extensions/index.js.map +1 -0
  520. package/dist/extensions/llama/client.d.ts +69 -0
  521. package/dist/extensions/llama/client.d.ts.map +1 -0
  522. package/dist/extensions/llama/client.js +313 -0
  523. package/dist/extensions/llama/client.js.map +1 -0
  524. package/dist/extensions/llama/huggingface.d.ts +23 -0
  525. package/dist/extensions/llama/huggingface.d.ts.map +1 -0
  526. package/dist/extensions/llama/huggingface.js +141 -0
  527. package/dist/extensions/llama/huggingface.js.map +1 -0
  528. package/dist/extensions/llama/index.d.ts +3 -0
  529. package/dist/extensions/llama/index.d.ts.map +1 -0
  530. package/dist/extensions/llama/index.js +219 -0
  531. package/dist/extensions/llama/index.js.map +1 -0
  532. package/dist/extensions/llama/provider.d.ts +12 -0
  533. package/dist/extensions/llama/provider.d.ts.map +1 -0
  534. package/dist/extensions/llama/provider.js +213 -0
  535. package/dist/extensions/llama/provider.js.map +1 -0
  536. package/dist/extensions/llama/ui.d.ts +42 -0
  537. package/dist/extensions/llama/ui.d.ts.map +1 -0
  538. package/dist/extensions/llama/ui.js +416 -0
  539. package/dist/extensions/llama/ui.js.map +1 -0
  540. package/dist/index.d.ts +38 -0
  541. package/dist/index.d.ts.map +1 -0
  542. package/dist/index.js +49 -0
  543. package/dist/index.js.map +1 -0
  544. package/dist/main.d.ts +16 -0
  545. package/dist/main.d.ts.map +1 -0
  546. package/dist/main.js +819 -0
  547. package/dist/main.js.map +1 -0
  548. package/dist/migrations.d.ts +33 -0
  549. package/dist/migrations.d.ts.map +1 -0
  550. package/dist/migrations.js +282 -0
  551. package/dist/migrations.js.map +1 -0
  552. package/dist/modes/index.d.ts +10 -0
  553. package/dist/modes/index.d.ts.map +1 -0
  554. package/dist/modes/index.js +8 -0
  555. package/dist/modes/index.js.map +1 -0
  556. package/dist/modes/interactive/assets/clankolas.png +0 -0
  557. package/dist/modes/interactive/bug-report.d.ts +16 -0
  558. package/dist/modes/interactive/bug-report.d.ts.map +1 -0
  559. package/dist/modes/interactive/bug-report.js +210 -0
  560. package/dist/modes/interactive/bug-report.js.map +1 -0
  561. package/dist/modes/interactive/chat-viewport.d.ts +20 -0
  562. package/dist/modes/interactive/chat-viewport.d.ts.map +1 -0
  563. package/dist/modes/interactive/chat-viewport.js +28 -0
  564. package/dist/modes/interactive/chat-viewport.js.map +1 -0
  565. package/dist/modes/interactive/components/armin.d.ts +34 -0
  566. package/dist/modes/interactive/components/armin.d.ts.map +1 -0
  567. package/dist/modes/interactive/components/armin.js +333 -0
  568. package/dist/modes/interactive/components/armin.js.map +1 -0
  569. package/dist/modes/interactive/components/assistant-message.d.ts +26 -0
  570. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
  571. package/dist/modes/interactive/components/assistant-message.js +158 -0
  572. package/dist/modes/interactive/components/assistant-message.js.map +1 -0
  573. package/dist/modes/interactive/components/bash-execution.d.ts +34 -0
  574. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
  575. package/dist/modes/interactive/components/bash-execution.js +175 -0
  576. package/dist/modes/interactive/components/bash-execution.js.map +1 -0
  577. package/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
  578. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
  579. package/dist/modes/interactive/components/bordered-loader.js +54 -0
  580. package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
  581. package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
  582. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
  583. package/dist/modes/interactive/components/branch-summary-message.js +51 -0
  584. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
  585. package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
  586. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
  587. package/dist/modes/interactive/components/compaction-summary-message.js +52 -0
  588. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
  589. package/dist/modes/interactive/components/config-selector.d.ts +102 -0
  590. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
  591. package/dist/modes/interactive/components/config-selector.js +771 -0
  592. package/dist/modes/interactive/components/config-selector.js.map +1 -0
  593. package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
  594. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
  595. package/dist/modes/interactive/components/countdown-timer.js +33 -0
  596. package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
  597. package/dist/modes/interactive/components/custom-editor.d.ts +30 -0
  598. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
  599. package/dist/modes/interactive/components/custom-editor.js +115 -0
  600. package/dist/modes/interactive/components/custom-editor.js.map +1 -0
  601. package/dist/modes/interactive/components/custom-entry.d.ts +19 -0
  602. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -0
  603. package/dist/modes/interactive/components/custom-entry.js +52 -0
  604. package/dist/modes/interactive/components/custom-entry.js.map +1 -0
  605. package/dist/modes/interactive/components/custom-message.d.ts +22 -0
  606. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
  607. package/dist/modes/interactive/components/custom-message.js +87 -0
  608. package/dist/modes/interactive/components/custom-message.js.map +1 -0
  609. package/dist/modes/interactive/components/daxnuts.d.ts +23 -0
  610. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
  611. package/dist/modes/interactive/components/daxnuts.js +140 -0
  612. package/dist/modes/interactive/components/daxnuts.js.map +1 -0
  613. package/dist/modes/interactive/components/diff.d.ts +12 -0
  614. package/dist/modes/interactive/components/diff.d.ts.map +1 -0
  615. package/dist/modes/interactive/components/diff.js +133 -0
  616. package/dist/modes/interactive/components/diff.js.map +1 -0
  617. package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
  618. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
  619. package/dist/modes/interactive/components/dynamic-border.js +21 -0
  620. package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
  621. package/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
  622. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -0
  623. package/dist/modes/interactive/components/earendil-announcement.js +40 -0
  624. package/dist/modes/interactive/components/earendil-announcement.js.map +1 -0
  625. package/dist/modes/interactive/components/extension-editor.d.ts +24 -0
  626. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
  627. package/dist/modes/interactive/components/extension-editor.js +103 -0
  628. package/dist/modes/interactive/components/extension-editor.js.map +1 -0
  629. package/dist/modes/interactive/components/extension-input.d.ts +25 -0
  630. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
  631. package/dist/modes/interactive/components/extension-input.js +67 -0
  632. package/dist/modes/interactive/components/extension-input.js.map +1 -0
  633. package/dist/modes/interactive/components/extension-selector.d.ts +27 -0
  634. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
  635. package/dist/modes/interactive/components/extension-selector.js +87 -0
  636. package/dist/modes/interactive/components/extension-selector.js.map +1 -0
  637. package/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
  638. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
  639. package/dist/modes/interactive/components/first-time-setup.js +109 -0
  640. package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
  641. package/dist/modes/interactive/components/footer.d.ts +39 -0
  642. package/dist/modes/interactive/components/footer.d.ts.map +1 -0
  643. package/dist/modes/interactive/components/footer.js +265 -0
  644. package/dist/modes/interactive/components/footer.js.map +1 -0
  645. package/dist/modes/interactive/components/index.d.ts +34 -0
  646. package/dist/modes/interactive/components/index.d.ts.map +1 -0
  647. package/dist/modes/interactive/components/index.js +35 -0
  648. package/dist/modes/interactive/components/index.js.map +1 -0
  649. package/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
  650. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
  651. package/dist/modes/interactive/components/keybinding-hints.js +36 -0
  652. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
  653. package/dist/modes/interactive/components/login-dialog.d.ts +52 -0
  654. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
  655. package/dist/modes/interactive/components/login-dialog.js +188 -0
  656. package/dist/modes/interactive/components/login-dialog.js.map +1 -0
  657. package/dist/modes/interactive/components/markdown-transform.d.ts +3 -0
  658. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
  659. package/dist/modes/interactive/components/markdown-transform.js +19 -0
  660. package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
  661. package/dist/modes/interactive/components/mermaid.d.ts +11 -0
  662. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -0
  663. package/dist/modes/interactive/components/mermaid.js +75 -0
  664. package/dist/modes/interactive/components/mermaid.js.map +1 -0
  665. package/dist/modes/interactive/components/model-selector.d.ts +60 -0
  666. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
  667. package/dist/modes/interactive/components/model-selector.js +361 -0
  668. package/dist/modes/interactive/components/model-selector.js.map +1 -0
  669. package/dist/modes/interactive/components/oauth-selector.d.ts +33 -0
  670. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
  671. package/dist/modes/interactive/components/oauth-selector.js +163 -0
  672. package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
  673. package/dist/modes/interactive/components/pi-logo-animation.d.ts +68 -0
  674. package/dist/modes/interactive/components/pi-logo-animation.d.ts.map +1 -0
  675. package/dist/modes/interactive/components/pi-logo-animation.js +1086 -0
  676. package/dist/modes/interactive/components/pi-logo-animation.js.map +1 -0
  677. package/dist/modes/interactive/components/pi-logo-animation.lazy.d.ts +7 -0
  678. package/dist/modes/interactive/components/pi-logo-animation.lazy.d.ts.map +1 -0
  679. package/dist/modes/interactive/components/pi-logo-animation.lazy.js +12 -0
  680. package/dist/modes/interactive/components/pi-logo-animation.lazy.js.map +1 -0
  681. package/dist/modes/interactive/components/pi-logo.d.ts +12 -0
  682. package/dist/modes/interactive/components/pi-logo.d.ts.map +1 -0
  683. package/dist/modes/interactive/components/pi-logo.js +25 -0
  684. package/dist/modes/interactive/components/pi-logo.js.map +1 -0
  685. package/dist/modes/interactive/components/scoped-models-selector.d.ts +46 -0
  686. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
  687. package/dist/modes/interactive/components/scoped-models-selector.js +326 -0
  688. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
  689. package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
  690. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
  691. package/dist/modes/interactive/components/session-selector-search.js +155 -0
  692. package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
  693. package/dist/modes/interactive/components/session-selector.d.ts +95 -0
  694. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
  695. package/dist/modes/interactive/components/session-selector.js +893 -0
  696. package/dist/modes/interactive/components/session-selector.js.map +1 -0
  697. package/dist/modes/interactive/components/settings-selector.d.ts +96 -0
  698. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
  699. package/dist/modes/interactive/components/settings-selector.js +742 -0
  700. package/dist/modes/interactive/components/settings-selector.js.map +1 -0
  701. package/dist/modes/interactive/components/settings-submenu.d.ts +72 -0
  702. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -0
  703. package/dist/modes/interactive/components/settings-submenu.js +165 -0
  704. package/dist/modes/interactive/components/settings-submenu.js.map +1 -0
  705. package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
  706. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
  707. package/dist/modes/interactive/components/show-images-selector.js +39 -0
  708. package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
  709. package/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
  710. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
  711. package/dist/modes/interactive/components/skill-invocation-message.js +54 -0
  712. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
  713. package/dist/modes/interactive/components/status-indicator.d.ts +30 -0
  714. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -0
  715. package/dist/modes/interactive/components/status-indicator.js +67 -0
  716. package/dist/modes/interactive/components/status-indicator.js.map +1 -0
  717. package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
  718. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
  719. package/dist/modes/interactive/components/theme-selector.js +50 -0
  720. package/dist/modes/interactive/components/theme-selector.js.map +1 -0
  721. package/dist/modes/interactive/components/themed-text.d.ts +17 -0
  722. package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
  723. package/dist/modes/interactive/components/themed-text.js +29 -0
  724. package/dist/modes/interactive/components/themed-text.js.map +1 -0
  725. package/dist/modes/interactive/components/thinking-selector.d.ts +23 -0
  726. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
  727. package/dist/modes/interactive/components/thinking-selector.js +109 -0
  728. package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
  729. package/dist/modes/interactive/components/tool-execution.d.ts +80 -0
  730. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
  731. package/dist/modes/interactive/components/tool-execution.js +337 -0
  732. package/dist/modes/interactive/components/tool-execution.js.map +1 -0
  733. package/dist/modes/interactive/components/tree-selector.d.ts +94 -0
  734. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
  735. package/dist/modes/interactive/components/tree-selector.js +1254 -0
  736. package/dist/modes/interactive/components/tree-selector.js.map +1 -0
  737. package/dist/modes/interactive/components/trust-selector.d.ts +23 -0
  738. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
  739. package/dist/modes/interactive/components/trust-selector.js +91 -0
  740. package/dist/modes/interactive/components/trust-selector.js.map +1 -0
  741. package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
  742. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
  743. package/dist/modes/interactive/components/user-message-selector.js +114 -0
  744. package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
  745. package/dist/modes/interactive/components/user-message.d.ts +16 -0
  746. package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
  747. package/dist/modes/interactive/components/user-message.js +50 -0
  748. package/dist/modes/interactive/components/user-message.js.map +1 -0
  749. package/dist/modes/interactive/components/visual-truncate.d.ts +48 -0
  750. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
  751. package/dist/modes/interactive/components/visual-truncate.js +66 -0
  752. package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
  753. package/dist/modes/interactive/external-editor.d.ts +12 -0
  754. package/dist/modes/interactive/external-editor.d.ts.map +1 -0
  755. package/dist/modes/interactive/external-editor.js +38 -0
  756. package/dist/modes/interactive/external-editor.js.map +1 -0
  757. package/dist/modes/interactive/interactive-mode.d.ts +470 -0
  758. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
  759. package/dist/modes/interactive/interactive-mode.js +5789 -0
  760. package/dist/modes/interactive/interactive-mode.js.map +1 -0
  761. package/dist/modes/interactive/model-catalog-refresh.d.ts +7 -0
  762. package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -0
  763. package/dist/modes/interactive/model-catalog-refresh.js +34 -0
  764. package/dist/modes/interactive/model-catalog-refresh.js.map +1 -0
  765. package/dist/modes/interactive/model-search.d.ts +12 -0
  766. package/dist/modes/interactive/model-search.d.ts.map +1 -0
  767. package/dist/modes/interactive/model-search.js +15 -0
  768. package/dist/modes/interactive/model-search.js.map +1 -0
  769. package/dist/modes/interactive/session-share.d.ts +18 -0
  770. package/dist/modes/interactive/session-share.d.ts.map +1 -0
  771. package/dist/modes/interactive/session-share.js +188 -0
  772. package/dist/modes/interactive/session-share.js.map +1 -0
  773. package/dist/modes/interactive/theme/dark.json +78 -0
  774. package/dist/modes/interactive/theme/light.json +78 -0
  775. package/dist/modes/interactive/theme/system-theme.d.ts +55 -0
  776. package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
  777. package/dist/modes/interactive/theme/system-theme.js +546 -0
  778. package/dist/modes/interactive/theme/system-theme.js.map +1 -0
  779. package/dist/modes/interactive/theme/theme-controller.d.ts +81 -0
  780. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
  781. package/dist/modes/interactive/theme/theme-controller.js +210 -0
  782. package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
  783. package/dist/modes/interactive/theme/theme-json.d.ts +85 -0
  784. package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -0
  785. package/dist/modes/interactive/theme/theme-json.js +132 -0
  786. package/dist/modes/interactive/theme/theme-json.js.map +1 -0
  787. package/dist/modes/interactive/theme/theme-schema.json +361 -0
  788. package/dist/modes/interactive/theme/theme.d.ts +158 -0
  789. package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
  790. package/dist/modes/interactive/theme/theme.js +912 -0
  791. package/dist/modes/interactive/theme/theme.js.map +1 -0
  792. package/dist/modes/interactive/tui-renderer.d.ts +22 -0
  793. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -0
  794. package/dist/modes/interactive/tui-renderer.js +67 -0
  795. package/dist/modes/interactive/tui-renderer.js.map +1 -0
  796. package/dist/modes/json-event.d.ts +34 -0
  797. package/dist/modes/json-event.d.ts.map +1 -0
  798. package/dist/modes/json-event.js +29 -0
  799. package/dist/modes/json-event.js.map +1 -0
  800. package/dist/modes/print-mode.d.ts +28 -0
  801. package/dist/modes/print-mode.d.ts.map +1 -0
  802. package/dist/modes/print-mode.js +142 -0
  803. package/dist/modes/print-mode.js.map +1 -0
  804. package/dist/modes/rpc/jsonl.d.ts +17 -0
  805. package/dist/modes/rpc/jsonl.d.ts.map +1 -0
  806. package/dist/modes/rpc/jsonl.js +49 -0
  807. package/dist/modes/rpc/jsonl.js.map +1 -0
  808. package/dist/modes/rpc/rpc-client.d.ts +254 -0
  809. package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
  810. package/dist/modes/rpc/rpc-client.js +499 -0
  811. package/dist/modes/rpc/rpc-client.js.map +1 -0
  812. package/dist/modes/rpc/rpc-mode.d.ts +20 -0
  813. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
  814. package/dist/modes/rpc/rpc-mode.js +655 -0
  815. package/dist/modes/rpc/rpc-mode.js.map +1 -0
  816. package/dist/modes/rpc/rpc-types.d.ts +478 -0
  817. package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
  818. package/dist/modes/rpc/rpc-types.js +8 -0
  819. package/dist/modes/rpc/rpc-types.js.map +1 -0
  820. package/dist/package-manager-cli.d.ts +9 -0
  821. package/dist/package-manager-cli.d.ts.map +1 -0
  822. package/dist/package-manager-cli.js +976 -0
  823. package/dist/package-manager-cli.js.map +1 -0
  824. package/dist/rpc-entry.d.ts +3 -0
  825. package/dist/rpc-entry.d.ts.map +1 -0
  826. package/dist/rpc-entry.js +11 -0
  827. package/dist/rpc-entry.js.map +1 -0
  828. package/dist/utils/abort.d.ts +5 -0
  829. package/dist/utils/abort.d.ts.map +1 -0
  830. package/dist/utils/abort.js +48 -0
  831. package/dist/utils/abort.js.map +1 -0
  832. package/dist/utils/ansi.d.ts +2 -0
  833. package/dist/utils/ansi.d.ts.map +1 -0
  834. package/dist/utils/ansi.js +52 -0
  835. package/dist/utils/ansi.js.map +1 -0
  836. package/dist/utils/changelog.d.ts +22 -0
  837. package/dist/utils/changelog.d.ts.map +1 -0
  838. package/dist/utils/changelog.js +165 -0
  839. package/dist/utils/changelog.js.map +1 -0
  840. package/dist/utils/child-process.d.ts +18 -0
  841. package/dist/utils/child-process.d.ts.map +1 -0
  842. package/dist/utils/child-process.js +106 -0
  843. package/dist/utils/child-process.js.map +1 -0
  844. package/dist/utils/clipboard-command.d.ts +7 -0
  845. package/dist/utils/clipboard-command.d.ts.map +1 -0
  846. package/dist/utils/clipboard-command.js +45 -0
  847. package/dist/utils/clipboard-command.js.map +1 -0
  848. package/dist/utils/clipboard-image.d.ts +11 -0
  849. package/dist/utils/clipboard-image.d.ts.map +1 -0
  850. package/dist/utils/clipboard-image.js +214 -0
  851. package/dist/utils/clipboard-image.js.map +1 -0
  852. package/dist/utils/clipboard.d.ts +6 -0
  853. package/dist/utils/clipboard.d.ts.map +1 -0
  854. package/dist/utils/clipboard.js +156 -0
  855. package/dist/utils/clipboard.js.map +1 -0
  856. package/dist/utils/deprecation.d.ts +4 -0
  857. package/dist/utils/deprecation.d.ts.map +1 -0
  858. package/dist/utils/deprecation.js +13 -0
  859. package/dist/utils/deprecation.js.map +1 -0
  860. package/dist/utils/exif-orientation.d.ts +5 -0
  861. package/dist/utils/exif-orientation.d.ts.map +1 -0
  862. package/dist/utils/exif-orientation.js +157 -0
  863. package/dist/utils/exif-orientation.js.map +1 -0
  864. package/dist/utils/frontmatter.d.ts +8 -0
  865. package/dist/utils/frontmatter.d.ts.map +1 -0
  866. package/dist/utils/frontmatter.js +27 -0
  867. package/dist/utils/frontmatter.js.map +1 -0
  868. package/dist/utils/fs-watch.d.ts +5 -0
  869. package/dist/utils/fs-watch.d.ts.map +1 -0
  870. package/dist/utils/fs-watch.js +25 -0
  871. package/dist/utils/fs-watch.js.map +1 -0
  872. package/dist/utils/git.d.ts +26 -0
  873. package/dist/utils/git.d.ts.map +1 -0
  874. package/dist/utils/git.js +195 -0
  875. package/dist/utils/git.js.map +1 -0
  876. package/dist/utils/html.d.ts +7 -0
  877. package/dist/utils/html.d.ts.map +1 -0
  878. package/dist/utils/html.js +40 -0
  879. package/dist/utils/html.js.map +1 -0
  880. package/dist/utils/image-convert.d.ts +10 -0
  881. package/dist/utils/image-convert.d.ts.map +1 -0
  882. package/dist/utils/image-convert.js +45 -0
  883. package/dist/utils/image-convert.js.map +1 -0
  884. package/dist/utils/image-process.d.ts +18 -0
  885. package/dist/utils/image-process.d.ts.map +1 -0
  886. package/dist/utils/image-process.js +83 -0
  887. package/dist/utils/image-process.js.map +1 -0
  888. package/dist/utils/image-resize-core.d.ts +30 -0
  889. package/dist/utils/image-resize-core.d.ts.map +1 -0
  890. package/dist/utils/image-resize-core.js +124 -0
  891. package/dist/utils/image-resize-core.js.map +1 -0
  892. package/dist/utils/image-resize-worker.d.ts +2 -0
  893. package/dist/utils/image-resize-worker.d.ts.map +1 -0
  894. package/dist/utils/image-resize-worker.js +31 -0
  895. package/dist/utils/image-resize-worker.js.map +1 -0
  896. package/dist/utils/image-resize.d.ts +16 -0
  897. package/dist/utils/image-resize.d.ts.map +1 -0
  898. package/dist/utils/image-resize.js +97 -0
  899. package/dist/utils/image-resize.js.map +1 -0
  900. package/dist/utils/json.d.ts +3 -0
  901. package/dist/utils/json.d.ts.map +1 -0
  902. package/dist/utils/json.js +7 -0
  903. package/dist/utils/json.js.map +1 -0
  904. package/dist/utils/management-http.d.ts +25 -0
  905. package/dist/utils/management-http.d.ts.map +1 -0
  906. package/dist/utils/management-http.js +54 -0
  907. package/dist/utils/management-http.js.map +1 -0
  908. package/dist/utils/mime.d.ts +3 -0
  909. package/dist/utils/mime.d.ts.map +1 -0
  910. package/dist/utils/mime.js +110 -0
  911. package/dist/utils/mime.js.map +1 -0
  912. package/dist/utils/open-browser.d.ts +9 -0
  913. package/dist/utils/open-browser.d.ts.map +1 -0
  914. package/dist/utils/open-browser.js +22 -0
  915. package/dist/utils/open-browser.js.map +1 -0
  916. package/dist/utils/paths.d.ts +34 -0
  917. package/dist/utils/paths.d.ts.map +1 -0
  918. package/dist/utils/paths.js +115 -0
  919. package/dist/utils/paths.js.map +1 -0
  920. package/dist/utils/photon.d.ts +21 -0
  921. package/dist/utils/photon.d.ts.map +1 -0
  922. package/dist/utils/photon.js +121 -0
  923. package/dist/utils/photon.js.map +1 -0
  924. package/dist/utils/pi-user-agent.d.ts +2 -0
  925. package/dist/utils/pi-user-agent.d.ts.map +1 -0
  926. package/dist/utils/pi-user-agent.js +5 -0
  927. package/dist/utils/pi-user-agent.js.map +1 -0
  928. package/dist/utils/shell.d.ts +32 -0
  929. package/dist/utils/shell.d.ts.map +1 -0
  930. package/dist/utils/shell.js +189 -0
  931. package/dist/utils/shell.js.map +1 -0
  932. package/dist/utils/sleep.d.ts +5 -0
  933. package/dist/utils/sleep.d.ts.map +1 -0
  934. package/dist/utils/sleep.js +17 -0
  935. package/dist/utils/sleep.js.map +1 -0
  936. package/dist/utils/syntax-highlight.d.ts +13 -0
  937. package/dist/utils/syntax-highlight.d.ts.map +1 -0
  938. package/dist/utils/syntax-highlight.js +179 -0
  939. package/dist/utils/syntax-highlight.js.map +1 -0
  940. package/dist/utils/text.d.ts +8 -0
  941. package/dist/utils/text.d.ts.map +1 -0
  942. package/dist/utils/text.js +9 -0
  943. package/dist/utils/text.js.map +1 -0
  944. package/dist/utils/tool-result-images.d.ts +21 -0
  945. package/dist/utils/tool-result-images.d.ts.map +1 -0
  946. package/dist/utils/tool-result-images.js +48 -0
  947. package/dist/utils/tool-result-images.js.map +1 -0
  948. package/dist/utils/tools-manager.d.ts +13 -0
  949. package/dist/utils/tools-manager.d.ts.map +1 -0
  950. package/dist/utils/tools-manager.js +343 -0
  951. package/dist/utils/tools-manager.js.map +1 -0
  952. package/dist/utils/version-check.d.ts +19 -0
  953. package/dist/utils/version-check.d.ts.map +1 -0
  954. package/dist/utils/version-check.js +72 -0
  955. package/dist/utils/version-check.js.map +1 -0
  956. package/dist/utils/windows-self-update.d.ts +3 -0
  957. package/dist/utils/windows-self-update.d.ts.map +1 -0
  958. package/dist/utils/windows-self-update.js +77 -0
  959. package/dist/utils/windows-self-update.js.map +1 -0
  960. package/dist/utils/wsl.d.ts +3 -0
  961. package/dist/utils/wsl.d.ts.map +1 -0
  962. package/dist/utils/wsl.js +15 -0
  963. package/dist/utils/wsl.js.map +1 -0
  964. package/dist/utils/zip.d.ts +7 -0
  965. package/dist/utils/zip.d.ts.map +1 -0
  966. package/dist/utils/zip.js +60 -0
  967. package/dist/utils/zip.js.map +1 -0
  968. package/docs/cli-integration.md +106 -0
  969. package/docs/cli.md +329 -0
  970. package/docs/compaction.md +463 -0
  971. package/docs/configuration.md +47 -0
  972. package/docs/containerization.md +183 -0
  973. package/docs/custom-provider.md +173 -0
  974. package/docs/docs.json +208 -0
  975. package/docs/environment-variables.md +104 -0
  976. package/docs/extensions.md +270 -0
  977. package/docs/how-pi-works.md +49 -0
  978. package/docs/images/doom-extension.png +0 -0
  979. package/docs/images/exy.png +0 -0
  980. package/docs/images/interactive-mode.png +0 -0
  981. package/docs/images/tree-view.png +0 -0
  982. package/docs/index.md +39 -0
  983. package/docs/json.md +226 -0
  984. package/docs/keybindings.md +194 -0
  985. package/docs/llama-cpp.md +114 -0
  986. package/docs/mcp.md +248 -0
  987. package/docs/message-types.md +261 -0
  988. package/docs/models.md +158 -0
  989. package/docs/packages.md +129 -0
  990. package/docs/prompt-templates.md +59 -0
  991. package/docs/providers.md +190 -0
  992. package/docs/quickstart.md +122 -0
  993. package/docs/rpc-commands.md +860 -0
  994. package/docs/rpc-extension-ui.md +200 -0
  995. package/docs/rpc.md +193 -0
  996. package/docs/sdk.md +147 -0
  997. package/docs/security.md +99 -0
  998. package/docs/session-format.md +293 -0
  999. package/docs/sessions.md +66 -0
  1000. package/docs/settings.md +169 -0
  1001. package/docs/shell-aliases.md +93 -0
  1002. package/docs/skills.md +93 -0
  1003. package/docs/slash-commands.md +60 -0
  1004. package/docs/terminal-setup.md +219 -0
  1005. package/docs/termux.md +117 -0
  1006. package/docs/themes.md +136 -0
  1007. package/docs/tmux.md +55 -0
  1008. package/docs/tui.md +125 -0
  1009. package/docs/usage.md +94 -0
  1010. package/docs/virtual-models.md +114 -0
  1011. package/docs/windows.md +67 -0
  1012. package/examples/README.md +39 -0
  1013. package/examples/extensions/README.md +214 -0
  1014. package/examples/extensions/auto-commit-on-exit.ts +49 -0
  1015. package/examples/extensions/bash-spawn-hook.ts +30 -0
  1016. package/examples/extensions/bookmark.ts +50 -0
  1017. package/examples/extensions/border-status-editor.ts +150 -0
  1018. package/examples/extensions/built-in-tool-renderer.ts +225 -0
  1019. package/examples/extensions/claude-rules.ts +86 -0
  1020. package/examples/extensions/commands.ts +72 -0
  1021. package/examples/extensions/confirm-destructive.ts +59 -0
  1022. package/examples/extensions/custom-compaction.ts +117 -0
  1023. package/examples/extensions/custom-footer.ts +64 -0
  1024. package/examples/extensions/custom-header.ts +73 -0
  1025. package/examples/extensions/custom-provider-anthropic/index.ts +617 -0
  1026. package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
  1027. package/examples/extensions/custom-provider-anthropic/package.json +19 -0
  1028. package/examples/extensions/custom-provider-gitlab-duo/index.ts +405 -0
  1029. package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
  1030. package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
  1031. package/examples/extensions/debug-provider.ts +90 -0
  1032. package/examples/extensions/dirty-repo-guard.ts +56 -0
  1033. package/examples/extensions/doom-overlay/README.md +46 -0
  1034. package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
  1035. package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
  1036. package/examples/extensions/doom-overlay/doom/build.sh +152 -0
  1037. package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
  1038. package/examples/extensions/doom-overlay/doom-component.ts +132 -0
  1039. package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
  1040. package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
  1041. package/examples/extensions/doom-overlay/index.ts +74 -0
  1042. package/examples/extensions/doom-overlay/wad-finder.ts +55 -0
  1043. package/examples/extensions/dynamic-resources/SKILL.md +8 -0
  1044. package/examples/extensions/dynamic-resources/dynamic.json +81 -0
  1045. package/examples/extensions/dynamic-resources/dynamic.md +5 -0
  1046. package/examples/extensions/dynamic-resources/index.ts +15 -0
  1047. package/examples/extensions/dynamic-tools.ts +74 -0
  1048. package/examples/extensions/entry-renderer.ts +41 -0
  1049. package/examples/extensions/event-bus.ts +43 -0
  1050. package/examples/extensions/file-trigger.ts +41 -0
  1051. package/examples/extensions/git-checkpoint.ts +53 -0
  1052. package/examples/extensions/git-merge-and-resolve.ts +115 -0
  1053. package/examples/extensions/github-issue-autocomplete.ts +185 -0
  1054. package/examples/extensions/gondolin/index.ts +531 -0
  1055. package/examples/extensions/gondolin/package-lock.json +185 -0
  1056. package/examples/extensions/gondolin/package.json +19 -0
  1057. package/examples/extensions/handoff.ts +190 -0
  1058. package/examples/extensions/hello.ts +26 -0
  1059. package/examples/extensions/hidden-thinking-label.ts +53 -0
  1060. package/examples/extensions/inline-bash.ts +94 -0
  1061. package/examples/extensions/input-transform-streaming.ts +39 -0
  1062. package/examples/extensions/input-transform.ts +43 -0
  1063. package/examples/extensions/interactive-shell.ts +196 -0
  1064. package/examples/extensions/jev-router.ts +113 -0
  1065. package/examples/extensions/mac-system-theme.ts +47 -0
  1066. package/examples/extensions/message-renderer.ts +59 -0
  1067. package/examples/extensions/minimal-mode.ts +354 -0
  1068. package/examples/extensions/modal-editor.ts +85 -0
  1069. package/examples/extensions/model-status.ts +31 -0
  1070. package/examples/extensions/notify.ts +57 -0
  1071. package/examples/extensions/overlay-qa-tests.ts +1450 -0
  1072. package/examples/extensions/overlay-test.ts +153 -0
  1073. package/examples/extensions/permission-gate.ts +34 -0
  1074. package/examples/extensions/pirate.ts +47 -0
  1075. package/examples/extensions/plan-mode/README.md +66 -0
  1076. package/examples/extensions/plan-mode/index.ts +390 -0
  1077. package/examples/extensions/plan-mode/utils.ts +168 -0
  1078. package/examples/extensions/preset.ts +436 -0
  1079. package/examples/extensions/project-trust.ts +64 -0
  1080. package/examples/extensions/prompt-customizer.ts +49 -0
  1081. package/examples/extensions/protected-paths.ts +30 -0
  1082. package/examples/extensions/provider-payload.ts +18 -0
  1083. package/examples/extensions/qna.ts +118 -0
  1084. package/examples/extensions/question.ts +286 -0
  1085. package/examples/extensions/questionnaire.ts +448 -0
  1086. package/examples/extensions/rainbow-editor.ts +88 -0
  1087. package/examples/extensions/reload-runtime.ts +37 -0
  1088. package/examples/extensions/rpc-demo.ts +118 -0
  1089. package/examples/extensions/sandbox/index.ts +321 -0
  1090. package/examples/extensions/sandbox/package-lock.json +92 -0
  1091. package/examples/extensions/sandbox/package.json +19 -0
  1092. package/examples/extensions/send-user-message.ts +97 -0
  1093. package/examples/extensions/session-name.ts +27 -0
  1094. package/examples/extensions/shutdown-command.ts +63 -0
  1095. package/examples/extensions/snake.ts +343 -0
  1096. package/examples/extensions/space-invaders.ts +560 -0
  1097. package/examples/extensions/ssh.ts +220 -0
  1098. package/examples/extensions/status-line.ts +32 -0
  1099. package/examples/extensions/structured-output.ts +65 -0
  1100. package/examples/extensions/subagent/README.md +177 -0
  1101. package/examples/extensions/subagent/agents/planner.md +37 -0
  1102. package/examples/extensions/subagent/agents/reviewer.md +35 -0
  1103. package/examples/extensions/subagent/agents/scout.md +50 -0
  1104. package/examples/extensions/subagent/agents/worker.md +24 -0
  1105. package/examples/extensions/subagent/agents.ts +157 -0
  1106. package/examples/extensions/subagent/index.ts +1038 -0
  1107. package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
  1108. package/examples/extensions/subagent/prompts/implement.md +10 -0
  1109. package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
  1110. package/examples/extensions/summarize.ts +199 -0
  1111. package/examples/extensions/system-prompt-header.ts +17 -0
  1112. package/examples/extensions/tic-tac-toe.ts +1008 -0
  1113. package/examples/extensions/timed-confirm.ts +70 -0
  1114. package/examples/extensions/titlebar-spinner.ts +58 -0
  1115. package/examples/extensions/todo.ts +297 -0
  1116. package/examples/extensions/tool-override.ts +144 -0
  1117. package/examples/extensions/tools.ts +146 -0
  1118. package/examples/extensions/trigger-compact.ts +50 -0
  1119. package/examples/extensions/truncated-tool.ts +195 -0
  1120. package/examples/extensions/widget-placement.ts +9 -0
  1121. package/examples/extensions/with-deps/index.ts +32 -0
  1122. package/examples/extensions/with-deps/package-lock.json +31 -0
  1123. package/examples/extensions/with-deps/package.json +22 -0
  1124. package/examples/extensions/working-indicator.ts +123 -0
  1125. package/examples/extensions/working-message-test.ts +25 -0
  1126. package/examples/plugins/pi-example-plugin/README.md +38 -0
  1127. package/examples/plugins/pi-example-plugin/package.json +10 -0
  1128. package/examples/plugins/pi-example-plugin/src/contract.ts +13 -0
  1129. package/examples/plugins/pi-example-plugin/src/session.ts +24 -0
  1130. package/examples/plugins/pi-example-plugin/src/tui.ts +31 -0
  1131. package/examples/rpc-client.ts +35 -0
  1132. package/examples/rpc-extension-ui.ts +661 -0
  1133. package/examples/sdk/01-minimal.ts +26 -0
  1134. package/examples/sdk/02-custom-model.ts +49 -0
  1135. package/examples/sdk/03-custom-prompt.ts +75 -0
  1136. package/examples/sdk/04-skills.ts +55 -0
  1137. package/examples/sdk/05-tools.ts +48 -0
  1138. package/examples/sdk/06-extensions.ts +99 -0
  1139. package/examples/sdk/07-context-files.ts +47 -0
  1140. package/examples/sdk/08-prompt-templates.ts +51 -0
  1141. package/examples/sdk/09-api-keys-and-oauth.ts +34 -0
  1142. package/examples/sdk/10-settings.ts +53 -0
  1143. package/examples/sdk/11-sessions.ts +52 -0
  1144. package/examples/sdk/12-full-control.ts +74 -0
  1145. package/examples/sdk/13-session-runtime.ts +67 -0
  1146. package/examples/sdk/README.md +140 -0
  1147. package/package.json +110 -5
package/docs/tui.md ADDED
@@ -0,0 +1,125 @@
1
+ # Terminal UI
2
+
3
+ `@earendil-works/pi-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 `@earendil-works/pi-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.
package/docs/usage.md ADDED
@@ -0,0 +1,94 @@
1
+ # Use Pi in the terminal
2
+
3
+ Run `pi` from the folder you want to work in. Pi uses that folder to discover files, instructions, and configuration, and to group saved sessions. If you have not installed Pi or chosen a model yet, follow the [Quickstart](quickstart.md).
4
+
5
+ Pi may ask whether you trust the working folder before loading its project resources. See [Project trust](security.md#understand-project-trust).
6
+
7
+ <p align="center"><img src="images/interactive-mode.png" alt="Pi interactive mode showing a conversation, editor, and status information" width="750"></p>
8
+
9
+ The transcript shows your prompts, Pi's responses, tool calls, results, and errors. You write prompts and commands in the editor. The footer shows the current folder, session, model, context usage, and accumulated usage and cost.
10
+
11
+ ## Enter a prompt
12
+
13
+ Type a request and press `Enter` to send it. Use `Shift+Enter` to add a line, or press `Ctrl+G` to work on a longer prompt in your configured external editor.
14
+
15
+ To include files or images:
16
+
17
+ - Type `@` to search for a file and add it to your prompt.
18
+ - Press `Tab` to complete a path.
19
+ - Paste an image or drag it into a compatible terminal.
20
+
21
+ ## Follow Pi's work
22
+
23
+ Pi shows each tool call and result while it works. Press `Ctrl+O` to expand or collapse tool output. Press `Ctrl+T` to show or hide thinking blocks.
24
+
25
+ The startup header lists the instructions and resources Pi loaded. The editor border indicates the current thinking level. The footer updates as the model uses context and reports usage.
26
+
27
+ Pi does not ask before every tool call. Review commands and changed files, and use a sandbox for untrusted or unattended work. See [Security](security.md).
28
+
29
+ ## Change direction
30
+
31
+ You can send more input while Pi is working:
32
+
33
+ | What you want | Action |
34
+ |---|---|
35
+ | Adjust the current task | Type a message and press `Enter` |
36
+ | Add work after the current task | Type a message and press `Alt+Enter` |
37
+ | Return queued messages to the editor | Press `Alt+Up` |
38
+ | Stop the current task | Press `Escape` |
39
+
40
+ A message sent with `Enter` waits until the current response and its tool calls finish, then guides the next response. A follow-up sent with `Alt+Enter` waits until Pi finishes the current task. Aborting returns queued messages to the editor.
41
+
42
+ Windows Terminal reserves some Alt shortcuts. See [Terminal Setup](terminal-setup.md) for the Windows alternatives.
43
+
44
+ ## Change the model or settings
45
+
46
+ Type `/` to search the available commands. The commands you will use most often are:
47
+
48
+ - `/model` selects a model. Press `Ctrl+L` to open the same selector.
49
+ - `/thinking` selects how much reasoning the current model uses. Press `Shift+Tab` to cycle through supported levels.
50
+ - `/login` and `/logout` manage provider access.
51
+ - `/settings` changes common preferences.
52
+
53
+ Prompt templates, skills, and extensions can add more commands to the same menu. See [Choose a Model](models.md), [Configuration](configuration.md), or the complete [Slash Commands reference](slash-commands.md).
54
+
55
+ ## Continue or start over
56
+
57
+ Pi saves sessions automatically unless session persistence is disabled.
58
+
59
+ - `/new` starts a new session.
60
+ - `/resume` opens another saved session.
61
+ - `/name` gives the current session a recognizable name.
62
+ - `/session` shows its file, ID, message count, token usage, and cost.
63
+
64
+ Use `/tree`, `/fork`, or `/clone` when you want to explore another approach without losing existing work. Use `/compact` to reduce the conversation history sent to the model. See [Sessions and Context](sessions.md) for these workflows.
65
+
66
+ After leaving Pi, run `pi --continue` from the same folder to resume its most recent session.
67
+
68
+ ## Run a terminal command
69
+
70
+ Prefix a command with `!` to run it and include its output in the conversation:
71
+
72
+ ```text
73
+ !git status
74
+ ```
75
+
76
+ Use `!!` when you want to run a command without sending its output to the model.
77
+
78
+ ## Copy, export, or share results
79
+
80
+ Press `Ctrl+X` or run `/copy` to copy the last assistant response. Use `/export` to save the session as HTML or JSONL.
81
+
82
+ Use `/share` to upload the session and get a viewer link. With Radius authentication, the artifact is visible to your Radius organization. Otherwise, Pi creates a private GitHub gist through the GitHub CLI. Review the session first because it can contain prompts, tool output, file contents, and credentials exposed during the conversation.
83
+
84
+ ## Adjust the terminal
85
+
86
+ Regular mode uses the terminal's normal scrollback. Fullscreen mode keeps the editor and status area fixed while the transcript scrolls within the terminal window. Choose a mode through `/settings` or `--tui-mode`.
87
+
88
+ Terminal support for mouse input, keyboard shortcuts, and inline images varies. See [Terminal Setup](terminal-setup.md) for platform-specific configuration and [Keybindings](keybindings.md) for every configurable shortcut. Run `/hotkeys` to inspect the shortcuts active in your current session.
89
+
90
+ ## Collect diagnostic information
91
+
92
+ When troubleshooting terminal rendering or conversation state, run `/debug`. Pi writes the rendered terminal lines and current session messages to `pi-debug.log` in your [agent directory](configuration.md#agent-directory).
93
+
94
+ Review this file before sharing it. It can contain prompts, model responses, tool output, file contents, and terminal data.
@@ -0,0 +1,114 @@
1
+ # Virtual Models
2
+
3
+ A virtual model is a selectable model that picks a physical model for each request. Use one to route by task, cost, or conversation state. For example, a router can send quick questions to a small model and hard problems to a large one, while the user selects a single model.
4
+
5
+ Register virtual models from an [extension](extensions.md). They appear in `/model`, `--model`, scoped models, and settings like any other model. A virtual model can be listed under any provider, including one with physical models, such as `openai-codex/auto`.
6
+
7
+ ## Selection and dispatch
8
+
9
+ A virtual model selects a model and a thinking level. A router maps that pair to a physical pair for each request:
10
+
11
+ ```
12
+ selected (virtual model, virtual level) -> dispatched (physical model, physical level)
13
+ jev/auto:low -> anthropic/claude-sonnet-4-5:high
14
+ ```
15
+
16
+ The virtual thinking level is an input to the router. Its meaning is up to the router; it need not correspond to a reasoning budget.
17
+
18
+ Pi keeps the two pairs apart:
19
+
20
+ | | Selection | Dispatch |
21
+ |---|---|---|
22
+ | Recorded in | `model_change` and `thinking_level_change` entries | Each assistant message: `provider`, `api`, `model`, `thinkingLevel` |
23
+ | Visible as | `ctx.model`, `ctx.thinkingLevel`, `PI_MODEL`, `PI_REASONING_LEVEL`, `/model` | The assistant message of each response |
24
+
25
+ Providers only receive physical models. Assistant messages name the physical model, so replaying a conversation across different physical models works the same as after a manual model switch. Resuming a session restores the virtual selection from its latest `model_change` entry. If the virtual model is no longer registered, Pi falls back to the physical model that answered last.
26
+
27
+ In interactive mode, the footer shows the routed model next to the selection, for example `auto • high → gpt-5.6-luna • medium`. `/session` lists the cost for each physical model.
28
+
29
+ Context usage uses the limits of the physical model that produced the latest response, even if that response came before switching to the virtual model. Without such a response, it uses the limits declared on the virtual model, if any. Compaction checks the same limits, and again the limits of the model each request is routed to. If that model's context window is too small for the conversation, Pi compacts before sending the request; the route stays as the router chose it.
30
+
31
+ ## Register a virtual model
32
+
33
+ ```typescript
34
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
35
+
36
+ export default function (pi: ExtensionAPI) {
37
+ pi.registerVirtualModel({
38
+ provider: "router",
39
+ id: "auto",
40
+ name: "Auto",
41
+ thinkingLevels: ["low", "high"],
42
+ route(request, ctx) {
43
+ // Tool follow-ups and retries stay on the model that handled the turn.
44
+ const sticky = request.failed ?? request.previous;
45
+ if (request.reason !== "user" && sticky) {
46
+ return { model: sticky.model, thinkingLevel: sticky.thinkingLevel ?? "medium" };
47
+ }
48
+ const id = request.thinkingLevel === "high" ? "claude-sonnet-4-5" : "claude-haiku-4-5";
49
+ return { model: ctx.modelRegistry.find("anthropic", id)!, thinkingLevel: "medium" };
50
+ },
51
+ });
52
+ }
53
+ ```
54
+
55
+ - `provider` is the provider the model is listed under. It can be any provider ID. A provider can list several virtual models next to its physical ones. On a physical provider, the virtual model is available when that provider has credentials. Under an ID that no provider uses, it is always available.
56
+ - `id` must not be the ID of a physical model of that provider. If a catalog refresh later adds a physical model with the same ID, the virtual model hides it.
57
+ - `thinkingLevels` lists the levels offered for selection. It defaults to `["off"]`.
58
+ - `contextWindow` and `maxTokens` are shown before the first response. Unset limits are unknown.
59
+ - `input` lists the input types offered for selection. It defaults to text and images; physical models without image support receive placeholders.
60
+
61
+ Registration follows the same queuing and reload rules as `pi.registerProvider()`. Registering the same provider and ID again replaces the virtual model. `pi.unregisterVirtualModel(provider, id)` removes it; `pi.unregisterProvider()` does not. SDK code can register one without an extension: `modelRuntime.registerVirtualModel(definition)`.
62
+
63
+ ## Route requests
64
+
65
+ `route(request, ctx)` runs before every request made with the virtual model and returns `{ model, thinkingLevel }`. The model can be any physical model in the catalog whose provider has credentials; look it up with `ctx.modelRegistry`. A virtual model cannot route to another virtual model. Pi clamps the thinking level to the returned model.
66
+
67
+ | Field | Meaning |
68
+ |---|---|
69
+ | `model`, `thinkingLevel` | The selected virtual model and level |
70
+ | `reason` | Why the request is made, see below |
71
+ | `previous` | Physical model and thinking level of the latest successful response in `messages` |
72
+ | `failed` | For `retry`: physical model, thinking level, and assistant `message` of the failed request, which `messages` no longer contains. The message carries `stopReason` and `errorMessage`. Absent when routing itself failed |
73
+ | `state` | Router state last returned on this session branch, see below |
74
+ | `messages` | The conversation for this request, including system messages |
75
+ | `signal` | Abort signal of the request |
76
+
77
+ | `reason` | Request |
78
+ |---|---|
79
+ | `user` | First request after a message the user wrote, including steering and follow-up messages |
80
+ | `continuation` | Any other request in the agent loop, such as after tool results or extension messages |
81
+ | `retry` | Automatic retry after a failed request, including after compaction for a context overflow |
82
+ | `direct` | Request made outside the agent loop, such as a compaction summary or an extension calling `ctx.modelRegistry.streamSimple()` |
83
+
84
+ Returning `previous` for `continuation` and `failed` for `retry` keeps prompt caches and thinking signatures valid. Switching models between turns is allowed but loses the prompt cache. A retry can also switch to another model, for example when `failed.message.errorMessage` reports that a provider is overloaded or the context overflowed.
85
+
86
+ If `route()` throws, or returns a virtual model or a model without credentials, the request ends with an error response.
87
+
88
+ ## Keep routing state
89
+
90
+ `route()` can return `state` next to the model. Pi stores it on the session branch and passes it back as `request.state` on later requests. Use it for decisions the transcript does not record, such as classifier results or a routing phase:
91
+
92
+ ```typescript
93
+ pi.registerVirtualModel<{ phase: "plan" | "build" }>({
94
+ provider: "router",
95
+ id: "phased",
96
+ name: "Phased",
97
+ route(request, ctx) {
98
+ const state = request.state ?? { phase: "plan" };
99
+ const id = state.phase === "plan" ? "claude-opus-4-5" : "claude-haiku-4-5";
100
+ return { model: ctx.modelRegistry.find("anthropic", id)!, thinkingLevel: "medium", state };
101
+ },
102
+ });
103
+ ```
104
+
105
+ - State must be JSON-serializable. Returning `undefined` or `request.state` itself keeps the current state.
106
+ - Pi stores any other returned object as new state, before the request is sent, even when it equals the current state. Return a new object only when the state changes. The state stays stored if the request later fails.
107
+ - State follows the session tree, so forks and `/tree` navigation see the state of their branch. It survives compaction.
108
+ - `direct` requests have no state, and Pi ignores state they return.
109
+
110
+ The transcript already records the selection and every dispatched model, and `ctx.sessionManager.getBranch()` exposes both.
111
+
112
+ Routers can call other models through `ctx.modelRegistry`, for example `ctx.modelRegistry.classify()` with a classifier model from `ctx.modelRegistry.findOfType("classifier", provider, id)`. The call adds latency before the first token of the turn.
113
+
114
+ See [`jev-router.ts`](../examples/extensions/jev-router.ts) for a complete router. It plans on a strong OpenAI Codex model chosen by the Jev classifier, lets that model make the first edit, and then switches once to a cheaper model, accepting a single prompt-cache miss. It keeps the phase as router state.
@@ -0,0 +1,67 @@
1
+ # Run Pi on Windows
2
+
3
+ Run Pi either as a native Windows process or inside Windows Subsystem for Linux (WSL). Native Windows uses Git Bash by default for Bash commands and can optionally expose PowerShell to the model. Pi inside WSL uses the Linux environment and its Bash installation.
4
+
5
+ Follow the main [Quickstart](quickstart.md) to install and authenticate Pi. Use this page to choose and configure its command environment.
6
+
7
+ ## Choose native Windows or WSL
8
+
9
+ | Environment | Command environment | Use it when |
10
+ |---|---|---|
11
+ | Native Windows with Git Bash | Git Bash for the built-in `bash` tool and `!` commands | Your files and development tools primarily live on Windows |
12
+ | Native Windows with the `powershell` tool | PowerShell for model tool calls; Bash remains available for `!` commands | The task depends on PowerShell modules or Windows-native commands |
13
+ | WSL | Linux Bash and tools inside the selected WSL distribution | Your files and toolchain already live in Linux or WSL |
14
+
15
+ ## Use Git Bash on native Windows
16
+
17
+ For most native Windows users, installing [Git for Windows](https://git-scm.com/download/win) is sufficient.
18
+
19
+ Pi resolves Bash in this order:
20
+
21
+ 1. `shellPath` from `~/.pi/agent/settings.json`
22
+ 2. Git Bash under `Program Files` or `Program Files (x86)`
23
+ 3. `bash.exe` on `PATH`, including Cygwin, MSYS2, or legacy WSL Bash
24
+
25
+ Start Pi and enter this command to verify the shell:
26
+
27
+ ```text
28
+ !printf 'Bash is working\n'
29
+ ```
30
+
31
+ If Pi cannot find Bash, it reports the locations it checked. Install Git for Windows, put another Bash executable on `PATH`, or configure `shellPath`.
32
+
33
+ ## Let the model use PowerShell
34
+
35
+ The optional `powershell` tool runs commands through `pwsh.exe` when available, then falls back to Windows PowerShell. It starts PowerShell with `-NoProfile -NonInteractive -ExecutionPolicy Bypass`. Administrator-enforced execution policies can still take precedence.
36
+
37
+ To replace the model-facing `bash` tool with `powershell`, add this to `~/.pi/agent/settings.json`:
38
+
39
+ ```json
40
+ {
41
+ "defaultTools": ["read", "powershell", "edit", "write"]
42
+ }
43
+ ```
44
+
45
+ `["-bash", "+powershell"]` does the same while keeping any other default tools you configured.
46
+
47
+ Restart Pi, then ask it to run a harmless PowerShell command. The `!` and `!!` editor commands continue to use Bash. The `powershell` tool is available only when Pi runs as a native Windows process.
48
+
49
+ See [Settings](settings.md#tools) for other tool combinations.
50
+
51
+ ## Use a custom Bash executable
52
+
53
+ Set `shellPath` when Bash is installed somewhere Pi does not discover automatically:
54
+
55
+ ```json
56
+ {
57
+ "shellPath": "C:\\cygwin64\\bin\\bash.exe"
58
+ }
59
+ ```
60
+
61
+ JSON uses backslashes for escape sequences. When you write a Windows path with backslashes, write each backslash twice, as shown above.
62
+
63
+ See [Configure shell commands](shell-aliases.md) for command prefixes, aliases, and the complete shell-resolution behavior.
64
+
65
+ ## Configure Windows Terminal
66
+
67
+ Windows Terminal reserves or rewrites some modified keys. See [Windows Terminal](terminal-setup.md#windows-terminal) to configure `Shift+Enter` and `Alt+Enter`, and [Keybindings](keybindings.md) for Pi's Windows and WSL shortcut defaults.
@@ -0,0 +1,39 @@
1
+ # Examples
2
+
3
+ Example code for the pi-coding-agent SDK, process integration, and extensions.
4
+
5
+ ## CLI integration
6
+
7
+ [`rpc-client.ts`](rpc-client.ts) uses the typed `RpcClient` to run Pi in a child process, stream events, and wait for the run to settle.
8
+
9
+ Build the coding-agent package before running it from a repository checkout:
10
+
11
+ ```bash
12
+ node examples/rpc-client.ts "Explain this repository"
13
+ ```
14
+
15
+ ## Directories
16
+
17
+ ### [sdk/](sdk/)
18
+ Programmatic usage via `createAgentSession()`. Shows how to customize models, prompts, tools, extensions, and session management.
19
+
20
+ ### [extensions/](extensions/)
21
+ Example extensions demonstrating:
22
+ - Lifecycle event handlers (tool interception, safety gates, context modifications)
23
+ - Custom tools (todo lists, questions, subagents, output truncation)
24
+ - Commands and keyboard shortcuts
25
+ - Custom UI (footers, headers, editors, overlays)
26
+ - Git integration (checkpoints, auto-commit)
27
+ - System prompt modifications and custom compaction
28
+ - External integrations (SSH, file watchers, system theme sync)
29
+ - Custom providers (Anthropic with custom streaming, GitLab Duo)
30
+
31
+ ### [plugins/pi-example-plugin/](plugins/pi-example-plugin/)
32
+ An experimental plugin package that Pi automatically builds into separate Session-worker and TUI Chord facets.
33
+
34
+ ## Documentation
35
+
36
+ - [SDK Examples](sdk/README.md)
37
+ - [CLI Integration](../docs/cli-integration.md)
38
+ - [Extensions Documentation](../docs/extensions.md)
39
+ - [Skills Documentation](../docs/skills.md)
@@ -0,0 +1,214 @@
1
+ # Extension Examples
2
+
3
+ Example extensions for pi-coding-agent.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ # Load an extension with --extension flag
9
+ pi --extension examples/extensions/permission-gate.ts
10
+
11
+ # Or copy to extensions directory for auto-discovery
12
+ cp permission-gate.ts ~/.pi/agent/extensions/
13
+ ```
14
+
15
+ ## Examples
16
+
17
+ ### Lifecycle & Safety
18
+
19
+ | Extension | Description |
20
+ |-----------|-------------|
21
+ | `permission-gate.ts` | Prompts for confirmation before dangerous bash commands (rm -rf, sudo, etc.) |
22
+ | `project-trust.ts` | Demonstrates the `project_trust` event for user/global and CLI extensions |
23
+ | `protected-paths.ts` | Blocks writes to protected paths (.env, .git/, node_modules/) |
24
+ | `confirm-destructive.ts` | Confirms before destructive session actions (clear, switch, fork) |
25
+ | `dirty-repo-guard.ts` | Prevents session changes with uncommitted git changes |
26
+ | `sandbox/` | OS-level sandboxing using `@anthropic-ai/sandbox-runtime` with per-project config |
27
+ | `gondolin/` | Route built-in tools and `!` commands into a Gondolin micro-VM |
28
+
29
+ ### Custom Tools
30
+
31
+ | Extension | Description |
32
+ |-----------|-------------|
33
+ | `todo.ts` | Todo list tool + `/todos` command with custom rendering and state persistence |
34
+ | `hello.ts` | Minimal custom tool example |
35
+ | `question.ts` | Demonstrates `ctx.ui.select()` for asking the user questions with custom UI |
36
+ | `questionnaire.ts` | Multi-question input with tab bar navigation between questions |
37
+ | `tool-override.ts` | Override built-in tools (e.g., add logging/access control to `read`) |
38
+ | `dynamic-tools.ts` | Register tools after startup (`session_start`) and at runtime via command, with prompt snippets and tool-specific prompt guidelines |
39
+ | `structured-output.ts` | Final structured-output tool that returns `terminate: true` so the agent can end on the tool call |
40
+ | `built-in-tool-renderer.ts` | Custom compact rendering for built-in tools (read, bash, edit, write) while keeping original behavior |
41
+ | `minimal-mode.ts` | Override built-in tool rendering for minimal display (only tool calls, no output in collapsed mode) |
42
+ | `truncated-tool.ts` | Wraps ripgrep with proper output truncation (50KB/2000 lines) |
43
+ | `ssh.ts` | Delegate all tools to a remote machine via SSH using pluggable operations |
44
+ | `subagent/` | Delegate tasks to specialized subagents with isolated context windows |
45
+
46
+ ### Commands & UI
47
+
48
+ | Extension | Description |
49
+ |-----------|-------------|
50
+ | `preset.ts` | Named presets for model, thinking level, tools, and instructions via `--preset` flag and `/preset` command |
51
+ | `plan-mode/` | Claude Code-style plan mode for read-only exploration with `/plan` command and step tracking |
52
+ | `tools.ts` | Interactive `/tools` command to enable/disable tools with session persistence |
53
+ | `handoff.ts` | Transfer context to a new focused session via `/handoff <goal>` |
54
+ | `qna.ts` | Extracts questions from last response into editor via `ctx.ui.setEditorText()` |
55
+ | `status-line.ts` | Shows turn progress in footer via `ctx.ui.setStatus()` with themed colors |
56
+ | `github-issue-autocomplete.ts` | Adds `#1234` issue completions by stacking a custom autocomplete provider that preloads open issues from `gh issue list` |
57
+ | `widget-placement.ts` | Shows widgets above and below the editor via `ctx.ui.setWidget()` placement |
58
+ | `hidden-thinking-label.ts` | Customizes the collapsed thinking label via `ctx.ui.setHiddenThinkingLabel()` |
59
+ | `working-indicator.ts` | Customizes the streaming working indicator via `ctx.ui.setWorkingIndicator()` |
60
+ | `model-status.ts` | Shows model changes in status bar via `model_select` hook |
61
+ | `snake.ts` | Snake game with custom UI, keyboard handling, and session persistence |
62
+ | `tic-tac-toe.ts` | Tic-tac-toe vs the agent with `executionMode: "sequential"` tools to prevent race conditions on shared cursor state |
63
+ | `send-user-message.ts` | Demonstrates `pi.sendUserMessage()` for sending user messages from extensions |
64
+ | `timed-confirm.ts` | Demonstrates AbortSignal for auto-dismissing `ctx.ui.confirm()` and `ctx.ui.select()` dialogs |
65
+ | `rpc-demo.ts` | Exercises all RPC-supported extension UI methods; pair with [`examples/rpc-extension-ui.ts`](../rpc-extension-ui.ts) |
66
+ | `modal-editor.ts` | Custom vim-like modal editor via `ctx.ui.setEditorComponent()` |
67
+ | `rainbow-editor.ts` | Animated rainbow text effect via custom editor |
68
+ | `notify.ts` | Desktop notifications via OSC 777 when agent finishes (Ghostty, iTerm2, WezTerm) |
69
+ | `titlebar-spinner.ts` | Braille spinner animation in terminal title while the agent is working |
70
+ | `summarize.ts` | Summarize conversation with GPT-5.2 and show in transient UI |
71
+ | `custom-footer.ts` | Custom footer with git branch and token stats via `ctx.ui.setFooter()` |
72
+ | `custom-header.ts` | Custom header via `ctx.ui.setHeader()` |
73
+ | `overlay-test.ts` | Test overlay compositing with inline text inputs and edge cases |
74
+ | `overlay-qa-tests.ts` | Comprehensive overlay QA tests: anchors, margins, stacking, overflow, animation |
75
+ | `doom-overlay/` | DOOM game running as an overlay at 35 FPS (demonstrates real-time game rendering) |
76
+ | `shutdown-command.ts` | Adds `/quit` command demonstrating `ctx.shutdown()` |
77
+ | `reload-runtime.ts` | Adds `/reload-runtime` and `reload_runtime` tool showing safe reload flow |
78
+ | `interactive-shell.ts` | Run interactive commands (vim, htop) with full terminal via `user_bash` hook |
79
+ | `inline-bash.ts` | Expands `!{command}` patterns in prompts via `input` event transformation |
80
+ | `input-transform-streaming.ts` | Skips expensive input preprocessing for mid-stream steering via `streamingBehavior` |
81
+
82
+ ### Git Integration
83
+
84
+ | Extension | Description |
85
+ |-----------|-------------|
86
+ | `git-checkpoint.ts` | Creates git stash checkpoints at each turn for code restoration on fork |
87
+ | `auto-commit-on-exit.ts` | Auto-commits on exit using last assistant message for commit message |
88
+
89
+ ### System Prompt & Compaction
90
+
91
+ | Extension | Description |
92
+ |-----------|-------------|
93
+ | `pirate.ts` | Demonstrates `systemPromptAppend` to dynamically modify system prompt |
94
+ | `claude-rules.ts` | Scans `.claude/rules/` folder and lists rules in system prompt |
95
+ | `custom-compaction.ts` | Custom compaction that summarizes entire conversation |
96
+ | `trigger-compact.ts` | Triggers compaction when context usage exceeds 100k tokens and adds `/trigger-compact` command |
97
+
98
+ ### System Integration
99
+
100
+ | Extension | Description |
101
+ |-----------|-------------|
102
+ | `mac-system-theme.ts` | Syncs pi theme with macOS dark/light mode |
103
+
104
+ ### Resources
105
+
106
+ | Extension | Description |
107
+ |-----------|-------------|
108
+ | `dynamic-resources/` | Loads skills, prompts, and themes using `resources_discover` |
109
+
110
+ ### Messages & Communication
111
+
112
+ | Extension | Description |
113
+ |-----------|-------------|
114
+ | `message-renderer.ts` | Custom message rendering with colors and expandable details via `registerMessageRenderer` |
115
+ | `entry-renderer.ts` | TUI-only session entry rendering via `appendEntry` and `registerEntryRenderer` |
116
+ | `debug-provider.ts` | Toggle raw provider stream capture with `/debug-provider` and inspect each assistant message in a TUI-only session entry |
117
+ | `event-bus.ts` | Inter-extension communication via `pi.events` |
118
+
119
+ ### Session Metadata
120
+
121
+ | Extension | Description |
122
+ |-----------|-------------|
123
+ | `session-name.ts` | Name sessions for the session selector via `setSessionName` |
124
+ | `bookmark.ts` | Bookmark entries with labels for `/tree` navigation via `setLabel` |
125
+
126
+ ### Custom Providers
127
+
128
+ | Extension | Description |
129
+ |-----------|-------------|
130
+ | `custom-provider-anthropic/` | Custom Anthropic provider with OAuth support and custom streaming implementation |
131
+ | `custom-provider-gitlab-duo/` | GitLab Duo provider using pi-ai's built-in Anthropic/OpenAI streaming via proxy |
132
+ | `jev-router.ts` | Virtual model via `registerVirtualModel` that plans on Codex Sol or Terra (picked by the Jev classifier) and switches to Luna after the first edit |
133
+
134
+ ### External Dependencies
135
+
136
+ | Extension | Description |
137
+ |-----------|-------------|
138
+ | `with-deps/` | Extension with its own package.json and dependencies (demonstrates jiti module resolution) |
139
+ | `file-trigger.ts` | Watches a trigger file and injects contents into conversation |
140
+
141
+ ## Writing Extensions
142
+
143
+ See [docs/extensions.md](../../docs/extensions.md) for full documentation.
144
+
145
+ ```typescript
146
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
147
+ import { Type } from "typebox";
148
+
149
+ export default function (pi: ExtensionAPI) {
150
+ // Subscribe to lifecycle events
151
+ pi.on("tool_call", async (event, ctx) => {
152
+ if (event.toolName === "bash" && event.input.command?.includes("rm -rf")) {
153
+ const ok = await ctx.ui.confirm("Dangerous!", "Allow rm -rf?");
154
+ if (!ok) return { block: true, reason: "Blocked by user" };
155
+ }
156
+ });
157
+
158
+ // Register custom tools
159
+ pi.registerTool({
160
+ name: "greet",
161
+ label: "Greeting",
162
+ description: "Generate a greeting",
163
+ parameters: Type.Object({
164
+ name: Type.String({ description: "Name to greet" }),
165
+ }),
166
+ async execute(toolCallId, params, signal, onUpdate, ctx) {
167
+ return {
168
+ content: [{ type: "text", text: `Hello, ${params.name}!` }],
169
+ details: {},
170
+ };
171
+ },
172
+ });
173
+
174
+ // Register commands
175
+ pi.registerCommand("hello", {
176
+ description: "Say hello",
177
+ handler: async (args, ctx) => {
178
+ ctx.ui.notify("Hello!", "info");
179
+ },
180
+ });
181
+ }
182
+ ```
183
+
184
+ ## Key Patterns
185
+
186
+ **Use StringEnum for string parameters** (required for Google API compatibility):
187
+ ```typescript
188
+ import { StringEnum } from "@earendil-works/pi-ai";
189
+
190
+ // Good
191
+ action: StringEnum(["list", "add"] as const)
192
+
193
+ // Bad - doesn't work with Google
194
+ action: Type.Union([Type.Literal("list"), Type.Literal("add")])
195
+ ```
196
+
197
+ **State persistence via details:**
198
+ ```typescript
199
+ // Store state in tool result details for proper forking support
200
+ return {
201
+ content: [{ type: "text", text: "Done" }],
202
+ details: { todos: [...todos], nextId }, // Persisted in session
203
+ };
204
+
205
+ // Reconstruct on session events
206
+ pi.on("session_start", async (_event, ctx) => {
207
+ for (const entry of ctx.sessionManager.getBranch()) {
208
+ if (entry.type === "message" && entry.message.toolName === "my_tool") {
209
+ const details = entry.message.details;
210
+ // Reconstruct state from details
211
+ }
212
+ }
213
+ });
214
+ ```