@punch-bot/cli 0.85.1 → 1.2.0

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 (1103) hide show
  1. package/CHANGELOG.md +572 -3
  2. package/README.md +82 -174
  3. package/dist/bun/cli.d.ts.map +1 -1
  4. package/dist/bun/restore-sandbox-env.d.ts.map +1 -1
  5. package/dist/bun/restore-sandbox-env.js.map +1 -1
  6. package/dist/bun/runtime-setup.d.ts.map +1 -1
  7. package/dist/bun/runtime-setup.js +4 -1
  8. package/dist/bun/runtime-setup.js.map +1 -1
  9. package/dist/bun/sandbox-env-setup.d.ts.map +1 -1
  10. package/dist/bundle/chunks/anthropic-messages-DA6M7CRN.js +6 -0
  11. package/dist/bundle/chunks/anthropic.js +2 -2
  12. package/dist/bundle/chunks/azure-openai-responses-IJO5RNR3.js +2 -0
  13. package/dist/bundle/chunks/bedrock-converse-stream.js +10 -2
  14. package/dist/bundle/chunks/chunk-22CYIUS4.js +2 -0
  15. package/dist/bundle/chunks/chunk-2M76JOVH.js +8 -0
  16. package/dist/bundle/chunks/chunk-5HTGPCR7.js +2 -0
  17. package/dist/bundle/chunks/chunk-5OD3Y36V.js +11 -0
  18. package/dist/bundle/chunks/chunk-6C5VKHGV.js +50 -0
  19. package/dist/bundle/chunks/chunk-F5ZABL6Z.js +20 -0
  20. package/dist/bundle/chunks/{chunk-3DNTDXPG.js → chunk-FJPXW4TE.js} +3 -3
  21. package/dist/bundle/chunks/chunk-FLX3SJDL.js +1156 -0
  22. package/dist/bundle/chunks/chunk-HACVPRBJ.js +11 -0
  23. package/dist/bundle/chunks/chunk-ITZNWD4K.js +2 -0
  24. package/dist/bundle/chunks/chunk-J7I2NFJ7.js +82 -0
  25. package/dist/bundle/chunks/chunk-JHYQSLCR.js +2 -0
  26. package/dist/bundle/chunks/chunk-LPXNMA2W.js +2 -0
  27. package/dist/bundle/chunks/chunk-OO6DJ3CL.js +31 -0
  28. package/dist/bundle/chunks/chunk-PMRZO46Y.js +2 -0
  29. package/dist/bundle/chunks/{chunk-TRDNDS6A.js → chunk-PYGXRV27.js} +5 -2
  30. package/dist/bundle/chunks/chunk-RDZVAGPR.js +2 -0
  31. package/dist/bundle/chunks/{chunk-XDUWOHPL.js → chunk-S3GGRYIO.js} +2 -2
  32. package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
  33. package/dist/bundle/chunks/chunk-WUIPA42N.js +14 -0
  34. package/dist/bundle/chunks/chunk-XIX7LUWI.js +2 -0
  35. package/dist/bundle/chunks/chunk-YWHGLBPB.js +2 -0
  36. package/dist/bundle/chunks/chunk-ZBURYEWF.js +2 -0
  37. package/dist/bundle/chunks/cli-QAQLORRY.js +51 -0
  38. package/dist/bundle/chunks/cloudflare-workers-ai-system-one-UTBL2KOF.js +2 -0
  39. package/dist/bundle/chunks/codemode-worker.js +478 -0
  40. package/dist/bundle/chunks/execute-2Z6BN5R3.js +499 -0
  41. package/dist/bundle/chunks/github-copilot.js +1 -1
  42. package/dist/bundle/chunks/google-generative-ai-JSIIVUNP.js +2 -0
  43. package/dist/bundle/chunks/google-vertex-BZ3ID54S.js +2 -0
  44. package/dist/bundle/chunks/image-resize-worker.js +1 -1
  45. package/dist/bundle/chunks/jiti-loader-C3NU2SDH.js +21 -0
  46. package/dist/bundle/chunks/jiti-static-loader-E6ANQD5T.js +2 -0
  47. package/dist/bundle/chunks/{lib-HGQMNYVT.js → lib-TEDK3E5I.js} +2 -2
  48. package/dist/bundle/chunks/llama-cpp-classify-FYN623RH.js +22 -0
  49. package/dist/bundle/chunks/meta.js +2 -0
  50. package/dist/bundle/chunks/mistral-conversations-RMNTDYQK.js +5 -0
  51. package/dist/bundle/chunks/node-N5BSDOA5.js +16 -0
  52. package/dist/bundle/chunks/{node-4PXJTSWH.js → node-TWVVAGPO.js} +1 -1
  53. package/dist/bundle/chunks/openai-chatgpt.js +75 -0
  54. package/dist/bundle/chunks/openai-codex-responses-O3P3UWDP.js +10 -0
  55. package/dist/bundle/chunks/openai-codex.js +2 -2
  56. package/dist/bundle/chunks/openai-completions-G4BKSHGH.js +7 -0
  57. package/dist/bundle/chunks/openai-decisions-WVPMQ4JD.js +5 -0
  58. package/dist/bundle/chunks/openai-responses-377V6EDU.js +3 -0
  59. package/dist/bundle/chunks/{openrouter-images-N4XVVFSD.js → openrouter-images-YU24TD7D.js} +1 -1
  60. package/dist/bundle/chunks/openrouter.js +2 -2
  61. package/dist/bundle/chunks/{pi-messages-ZRYGTSON.js → pi-messages-V27DSLVC.js} +2 -2
  62. package/dist/bundle/chunks/radius.js +2 -2
  63. package/dist/bundle/chunks/runtime-R6O72Q4R.js +2 -0
  64. package/dist/bundle/chunks/typesafe-system-one-ZSK3RN4B.js +2 -0
  65. package/dist/bundle/chunks/virtual-modules-FOSN3OT2.js +2 -0
  66. package/dist/bundle/cli-runtime.js +3 -0
  67. package/dist/bundle/cli.js +4 -2
  68. package/dist/bundle/index.js +1 -1
  69. package/dist/bundle/rpc-entry.js +1 -1
  70. package/dist/cli/args.d.ts +1 -2
  71. package/dist/cli/args.d.ts.map +1 -1
  72. package/dist/cli/args.js +73 -53
  73. package/dist/cli/args.js.map +1 -1
  74. package/dist/cli/auth-check.d.ts.map +1 -1
  75. package/dist/cli/auth-check.js.map +1 -1
  76. package/dist/cli/auth-command.d.ts.map +1 -1
  77. package/dist/cli/auth-command.js.map +1 -1
  78. package/dist/cli/credential-print.d.ts.map +1 -1
  79. package/dist/cli/credential-print.js.map +1 -1
  80. package/dist/cli/experimental/transport-address.d.ts +21 -0
  81. package/dist/cli/experimental/transport-address.d.ts.map +1 -0
  82. package/dist/cli/experimental/transport-address.js +89 -0
  83. package/dist/cli/experimental/transport-address.js.map +1 -0
  84. package/dist/cli/file-processor.d.ts +1 -1
  85. package/dist/cli/file-processor.d.ts.map +1 -1
  86. package/dist/cli/file-processor.js.map +1 -1
  87. package/dist/cli/initial-message.d.ts +1 -1
  88. package/dist/cli/initial-message.d.ts.map +1 -1
  89. package/dist/cli/initial-message.js.map +1 -1
  90. package/dist/cli/list-models.d.ts.map +1 -1
  91. package/dist/cli/list-models.js +1 -1
  92. package/dist/cli/list-models.js.map +1 -1
  93. package/dist/cli/project-trust.d.ts.map +1 -1
  94. package/dist/cli/project-trust.js +5 -35
  95. package/dist/cli/project-trust.js.map +1 -1
  96. package/dist/cli/setup.d.ts.map +1 -1
  97. package/dist/cli/setup.js.map +1 -1
  98. package/dist/cli.d.ts.map +1 -1
  99. package/dist/config.d.ts +30 -11
  100. package/dist/config.d.ts.map +1 -1
  101. package/dist/config.js +72 -21
  102. package/dist/config.js.map +1 -1
  103. package/dist/core/agent-session-runtime.d.ts +4 -3
  104. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  105. package/dist/core/agent-session-runtime.js +37 -27
  106. package/dist/core/agent-session-runtime.js.map +1 -1
  107. package/dist/core/agent-session-services.d.ts +1 -0
  108. package/dist/core/agent-session-services.d.ts.map +1 -1
  109. package/dist/core/agent-session-services.js +14 -0
  110. package/dist/core/agent-session-services.js.map +1 -1
  111. package/dist/core/agent-session.d.ts +270 -22
  112. package/dist/core/agent-session.d.ts.map +1 -1
  113. package/dist/core/agent-session.js +1174 -410
  114. package/dist/core/agent-session.js.map +1 -1
  115. package/dist/core/auth-guidance.d.ts.map +1 -1
  116. package/dist/core/auth-guidance.js.map +1 -1
  117. package/dist/core/auth-storage.d.ts.map +1 -1
  118. package/dist/core/auth-storage.js +20 -13
  119. package/dist/core/auth-storage.js.map +1 -1
  120. package/dist/core/bash-executor.d.ts.map +1 -1
  121. package/dist/core/bash-executor.js +42 -52
  122. package/dist/core/bash-executor.js.map +1 -1
  123. package/dist/core/bug-report-upload.d.ts +12 -0
  124. package/dist/core/bug-report-upload.d.ts.map +1 -0
  125. package/dist/core/bug-report-upload.js +22 -0
  126. package/dist/core/bug-report-upload.js.map +1 -0
  127. package/dist/core/bug-report.d.ts +184 -0
  128. package/dist/core/bug-report.d.ts.map +1 -0
  129. package/dist/core/bug-report.js +292 -0
  130. package/dist/core/bug-report.js.map +1 -0
  131. package/dist/core/cache-stats.d.ts.map +1 -1
  132. package/dist/core/cache-stats.js +12 -1
  133. package/dist/core/cache-stats.js.map +1 -1
  134. package/dist/core/cache-warmer.d.ts +103 -0
  135. package/dist/core/cache-warmer.d.ts.map +1 -0
  136. package/dist/core/cache-warmer.js +356 -0
  137. package/dist/core/cache-warmer.js.map +1 -0
  138. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  139. package/dist/core/compaction/branch-summarization.js +2 -2
  140. package/dist/core/compaction/branch-summarization.js.map +1 -1
  141. package/dist/core/compaction/compaction.d.ts +5 -3
  142. package/dist/core/compaction/compaction.d.ts.map +1 -1
  143. package/dist/core/compaction/compaction.js +164 -88
  144. package/dist/core/compaction/compaction.js.map +1 -1
  145. package/dist/core/compaction/index.d.ts.map +1 -1
  146. package/dist/core/compaction/utils.d.ts +8 -1
  147. package/dist/core/compaction/utils.d.ts.map +1 -1
  148. package/dist/core/compaction/utils.js +32 -26
  149. package/dist/core/compaction/utils.js.map +1 -1
  150. package/dist/core/crash-log.d.ts +27 -0
  151. package/dist/core/crash-log.d.ts.map +1 -0
  152. package/dist/core/crash-log.js +140 -0
  153. package/dist/core/crash-log.js.map +1 -0
  154. package/dist/core/defaults.d.ts.map +1 -1
  155. package/dist/core/delivery.d.ts.map +1 -1
  156. package/dist/core/delivery.js.map +1 -1
  157. package/dist/core/diagnostics.d.ts.map +1 -1
  158. package/dist/core/event-bus.d.ts.map +1 -1
  159. package/dist/core/event-bus.js.map +1 -1
  160. package/dist/core/exec.d.ts.map +1 -1
  161. package/dist/core/exec.js.map +1 -1
  162. package/dist/core/experimental.d.ts.map +1 -1
  163. package/dist/core/experimental.js.map +1 -1
  164. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  165. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  166. package/dist/core/export-html/index.d.ts.map +1 -1
  167. package/dist/core/export-html/index.js +1 -1
  168. package/dist/core/export-html/index.js.map +1 -1
  169. package/dist/core/export-html/template.css +10 -0
  170. package/dist/core/export-html/template.js +93 -34
  171. package/dist/core/export-html/tool-renderer.d.ts +5 -11
  172. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  173. package/dist/core/export-html/tool-renderer.js +8 -99
  174. package/dist/core/export-html/tool-renderer.js.map +1 -1
  175. package/dist/core/extensions/index.d.ts +1 -1
  176. package/dist/core/extensions/index.d.ts.map +1 -1
  177. package/dist/core/extensions/index.js.map +1 -1
  178. package/dist/core/extensions/jiti-loader.d.ts +2 -0
  179. package/dist/core/extensions/jiti-loader.d.ts.map +1 -0
  180. package/dist/core/extensions/jiti-loader.js +4 -0
  181. package/dist/core/extensions/jiti-loader.js.map +1 -0
  182. package/dist/core/extensions/jiti-static-loader.d.ts +2 -0
  183. package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -0
  184. package/dist/core/extensions/jiti-static-loader.js +4 -0
  185. package/dist/core/extensions/jiti-static-loader.js.map +1 -0
  186. package/dist/core/extensions/loader.d.ts.map +1 -1
  187. package/dist/core/extensions/loader.js +102 -74
  188. package/dist/core/extensions/loader.js.map +1 -1
  189. package/dist/core/extensions/runner.d.ts +44 -14
  190. package/dist/core/extensions/runner.d.ts.map +1 -1
  191. package/dist/core/extensions/runner.js +297 -169
  192. package/dist/core/extensions/runner.js.map +1 -1
  193. package/dist/core/extensions/types.d.ts +482 -238
  194. package/dist/core/extensions/types.d.ts.map +1 -1
  195. package/dist/core/extensions/types.js.map +1 -1
  196. package/dist/core/extensions/virtual-modules.d.ts +3 -0
  197. package/dist/core/extensions/virtual-modules.d.ts.map +1 -0
  198. package/dist/core/extensions/virtual-modules.js +35 -0
  199. package/dist/core/extensions/virtual-modules.js.map +1 -0
  200. package/dist/core/extensions/wrapper.d.ts +2 -2
  201. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  202. package/dist/core/extensions/wrapper.js +3 -22
  203. package/dist/core/extensions/wrapper.js.map +1 -1
  204. package/dist/core/footer-data-provider.d.ts.map +1 -1
  205. package/dist/core/footer-data-provider.js.map +1 -1
  206. package/dist/core/http-dispatcher.d.ts +13 -0
  207. package/dist/core/http-dispatcher.d.ts.map +1 -1
  208. package/dist/core/http-dispatcher.js +13 -4
  209. package/dist/core/http-dispatcher.js.map +1 -1
  210. package/dist/core/index.d.ts +2 -1
  211. package/dist/core/index.d.ts.map +1 -1
  212. package/dist/core/index.js.map +1 -1
  213. package/dist/core/mcp-servers.d.ts +139 -0
  214. package/dist/core/mcp-servers.d.ts.map +1 -0
  215. package/dist/core/mcp-servers.js +232 -0
  216. package/dist/core/mcp-servers.js.map +1 -0
  217. package/dist/core/messages.d.ts.map +1 -1
  218. package/dist/core/messages.js +1 -0
  219. package/dist/core/messages.js.map +1 -1
  220. package/dist/{modes/interactive → core}/model-catalog-refresh.d.ts +2 -2
  221. package/dist/core/model-catalog-refresh.d.ts.map +1 -0
  222. package/dist/{modes/interactive → core}/model-catalog-refresh.js +2 -2
  223. package/dist/core/model-catalog-refresh.js.map +1 -0
  224. package/dist/core/model-config.d.ts +886 -80
  225. package/dist/core/model-config.d.ts.map +1 -1
  226. package/dist/core/model-config.js +33 -148
  227. package/dist/core/model-config.js.map +1 -1
  228. package/dist/core/model-registry.d.ts +15 -1
  229. package/dist/core/model-registry.d.ts.map +1 -1
  230. package/dist/core/model-registry.js +29 -0
  231. package/dist/core/model-registry.js.map +1 -1
  232. package/dist/core/model-resolver.d.ts +19 -46
  233. package/dist/core/model-resolver.d.ts.map +1 -1
  234. package/dist/core/model-resolver.js +149 -359
  235. package/dist/core/model-resolver.js.map +1 -1
  236. package/dist/core/model-runtime.d.ts +47 -3
  237. package/dist/core/model-runtime.d.ts.map +1 -1
  238. package/dist/core/model-runtime.js +205 -43
  239. package/dist/core/model-runtime.js.map +1 -1
  240. package/dist/core/models-store.d.ts.map +1 -1
  241. package/dist/core/models-store.js.map +1 -1
  242. package/dist/core/nested-tool-calls.d.ts +103 -0
  243. package/dist/core/nested-tool-calls.d.ts.map +1 -0
  244. package/dist/core/nested-tool-calls.js +179 -0
  245. package/dist/core/nested-tool-calls.js.map +1 -0
  246. package/dist/core/output-guard.d.ts.map +1 -1
  247. package/dist/core/output-guard.js.map +1 -1
  248. package/dist/core/package-manager.d.ts +4 -0
  249. package/dist/core/package-manager.d.ts.map +1 -1
  250. package/dist/core/package-manager.js +62 -15
  251. package/dist/core/package-manager.js.map +1 -1
  252. package/dist/core/pi-manifest.d.ts.map +1 -1
  253. package/dist/core/pi-manifest.js.map +1 -1
  254. package/dist/core/project-trust.d.ts.map +1 -1
  255. package/dist/core/project-trust.js +2 -1
  256. package/dist/core/project-trust.js.map +1 -1
  257. package/dist/core/prompt-templates.d.ts +6 -1
  258. package/dist/core/prompt-templates.d.ts.map +1 -1
  259. package/dist/core/prompt-templates.js +68 -37
  260. package/dist/core/prompt-templates.js.map +1 -1
  261. package/dist/core/provider-attribution.d.ts.map +1 -1
  262. package/dist/core/provider-attribution.js.map +1 -1
  263. package/dist/core/provider-composer.d.ts +42 -20
  264. package/dist/core/provider-composer.d.ts.map +1 -1
  265. package/dist/core/provider-composer.js +126 -40
  266. package/dist/core/provider-composer.js.map +1 -1
  267. package/dist/core/radius.d.ts +5 -0
  268. package/dist/core/radius.d.ts.map +1 -1
  269. package/dist/core/radius.js +8 -0
  270. package/dist/core/radius.js.map +1 -1
  271. package/dist/core/remote-catalog-provider.d.ts +19 -1
  272. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  273. package/dist/core/remote-catalog-provider.js +102 -34
  274. package/dist/core/remote-catalog-provider.js.map +1 -1
  275. package/dist/core/resolve-config-value.d.ts.map +1 -1
  276. package/dist/core/resolve-config-value.js.map +1 -1
  277. package/dist/core/resource-loader.d.ts +11 -2
  278. package/dist/core/resource-loader.d.ts.map +1 -1
  279. package/dist/core/resource-loader.js +170 -42
  280. package/dist/core/resource-loader.js.map +1 -1
  281. package/dist/core/runtime-credentials.d.ts.map +1 -1
  282. package/dist/core/runtime-credentials.js.map +1 -1
  283. package/dist/core/sdk.d.ts +16 -5
  284. package/dist/core/sdk.d.ts.map +1 -1
  285. package/dist/core/sdk.js +124 -52
  286. package/dist/core/sdk.js.map +1 -1
  287. package/dist/core/session-cwd.d.ts.map +1 -1
  288. package/dist/core/session-cwd.js.map +1 -1
  289. package/dist/core/session-export.d.ts +6 -2
  290. package/dist/core/session-export.d.ts.map +1 -1
  291. package/dist/core/session-export.js +14 -13
  292. package/dist/core/session-export.js.map +1 -1
  293. package/dist/core/session-manager.d.ts +72 -13
  294. package/dist/core/session-manager.d.ts.map +1 -1
  295. package/dist/core/session-manager.js +277 -124
  296. package/dist/core/session-manager.js.map +1 -1
  297. package/dist/core/settings-defaults.d.ts +65 -0
  298. package/dist/core/settings-defaults.d.ts.map +1 -0
  299. package/dist/core/settings-defaults.js +66 -0
  300. package/dist/core/settings-defaults.js.map +1 -0
  301. package/dist/core/settings-diagnostics.d.ts.map +1 -1
  302. package/dist/core/settings-diagnostics.js.map +1 -1
  303. package/dist/core/settings-manager.d.ts +41 -126
  304. package/dist/core/settings-manager.d.ts.map +1 -1
  305. package/dist/core/settings-manager.js +165 -52
  306. package/dist/core/settings-manager.js.map +1 -1
  307. package/dist/core/settings-schema.d.ts +224 -0
  308. package/dist/core/settings-schema.d.ts.map +1 -0
  309. package/dist/core/settings-schema.js +285 -0
  310. package/dist/core/settings-schema.js.map +1 -0
  311. package/dist/core/skills.d.ts +4 -1
  312. package/dist/core/skills.d.ts.map +1 -1
  313. package/dist/core/skills.js +6 -1
  314. package/dist/core/skills.js.map +1 -1
  315. package/dist/core/slash-commands.d.ts.map +1 -1
  316. package/dist/core/slash-commands.js +3 -2
  317. package/dist/core/slash-commands.js.map +1 -1
  318. package/dist/core/source-info.d.ts +8 -0
  319. package/dist/core/source-info.d.ts.map +1 -1
  320. package/dist/core/source-info.js +16 -0
  321. package/dist/core/source-info.js.map +1 -1
  322. package/dist/core/system-prompt.d.ts +55 -6
  323. package/dist/core/system-prompt.d.ts.map +1 -1
  324. package/dist/core/system-prompt.js +128 -93
  325. package/dist/core/system-prompt.js.map +1 -1
  326. package/dist/core/telemetry.d.ts +2 -0
  327. package/dist/core/telemetry.d.ts.map +1 -1
  328. package/dist/core/telemetry.js +45 -0
  329. package/dist/core/telemetry.js.map +1 -1
  330. package/dist/core/theme/dark.json +78 -0
  331. package/dist/core/theme/light.json +78 -0
  332. package/dist/core/theme/system-theme.d.ts +54 -0
  333. package/dist/core/theme/system-theme.d.ts.map +1 -0
  334. package/dist/core/theme/system-theme.js +547 -0
  335. package/dist/core/theme/system-theme.js.map +1 -0
  336. package/dist/core/theme/theme-schema.d.ts +28 -0
  337. package/dist/core/theme/theme-schema.d.ts.map +1 -0
  338. package/dist/core/theme/theme-schema.js +105 -0
  339. package/dist/core/theme/theme-schema.js.map +1 -0
  340. package/dist/core/theme/theme-tokens.d.ts +257 -0
  341. package/dist/core/theme/theme-tokens.d.ts.map +1 -0
  342. package/dist/core/theme/theme-tokens.js +94 -0
  343. package/dist/core/theme/theme-tokens.js.map +1 -0
  344. package/dist/core/theme/theme.d.ts +162 -0
  345. package/dist/core/theme/theme.d.ts.map +1 -0
  346. package/dist/{modes/interactive → core}/theme/theme.js +265 -402
  347. package/dist/core/theme/theme.js.map +1 -0
  348. package/dist/core/timings.d.ts.map +1 -1
  349. package/dist/core/timings.js.map +1 -1
  350. package/dist/core/tools/bash.d.ts +14 -1
  351. package/dist/core/tools/bash.d.ts.map +1 -1
  352. package/dist/core/tools/bash.js +43 -6
  353. package/dist/core/tools/bash.js.map +1 -1
  354. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  355. package/dist/core/tools/edit-diff.js.map +1 -1
  356. package/dist/core/tools/edit.d.ts +1 -2
  357. package/dist/core/tools/edit.d.ts.map +1 -1
  358. package/dist/core/tools/edit.js +0 -3
  359. package/dist/core/tools/edit.js.map +1 -1
  360. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
  361. package/dist/core/tools/file-mutation-queue.js.map +1 -1
  362. package/dist/core/tools/find.d.ts.map +1 -1
  363. package/dist/core/tools/find.js +0 -2
  364. package/dist/core/tools/find.js.map +1 -1
  365. package/dist/core/tools/grep.d.ts.map +1 -1
  366. package/dist/core/tools/grep.js +0 -2
  367. package/dist/core/tools/grep.js.map +1 -1
  368. package/dist/core/tools/index.d.ts.map +1 -1
  369. package/dist/core/tools/index.js.map +1 -1
  370. package/dist/core/tools/ls.d.ts.map +1 -1
  371. package/dist/core/tools/ls.js +0 -2
  372. package/dist/core/tools/ls.js.map +1 -1
  373. package/dist/core/tools/output-accumulator.d.ts +11 -0
  374. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  375. package/dist/core/tools/output-accumulator.js +40 -10
  376. package/dist/core/tools/output-accumulator.js.map +1 -1
  377. package/dist/core/tools/path-utils.d.ts.map +1 -1
  378. package/dist/core/tools/path-utils.js.map +1 -1
  379. package/dist/core/tools/powershell.d.ts.map +1 -1
  380. package/dist/core/tools/powershell.js.map +1 -1
  381. package/dist/core/tools/read.d.ts +17 -1
  382. package/dist/core/tools/read.d.ts.map +1 -1
  383. package/dist/core/tools/read.js +23 -4
  384. package/dist/core/tools/read.js.map +1 -1
  385. package/dist/core/tools/tool-definition-wrapper.d.ts +5 -3
  386. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  387. package/dist/core/tools/tool-definition-wrapper.js +3 -1
  388. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  389. package/dist/core/tools/truncate.d.ts +14 -0
  390. package/dist/core/tools/truncate.d.ts.map +1 -1
  391. package/dist/core/tools/truncate.js +29 -0
  392. package/dist/core/tools/truncate.js.map +1 -1
  393. package/dist/core/tools/write.d.ts.map +1 -1
  394. package/dist/core/tools/write.js +0 -2
  395. package/dist/core/tools/write.js.map +1 -1
  396. package/dist/core/trust-manager.d.ts.map +1 -1
  397. package/dist/core/trust-manager.js +1 -0
  398. package/dist/core/trust-manager.js.map +1 -1
  399. package/dist/core/usage-totals.d.ts +3 -1
  400. package/dist/core/usage-totals.d.ts.map +1 -1
  401. package/dist/core/usage-totals.js +28 -1
  402. package/dist/core/usage-totals.js.map +1 -1
  403. package/dist/core/virtual-models.d.ts +117 -0
  404. package/dist/core/virtual-models.d.ts.map +1 -0
  405. package/dist/core/virtual-models.js +124 -0
  406. package/dist/core/virtual-models.js.map +1 -0
  407. package/dist/extensions/browser/index.d.ts.map +1 -1
  408. package/dist/extensions/browser/index.js.map +1 -1
  409. package/dist/extensions/codemode/execute.d.ts +16 -0
  410. package/dist/extensions/codemode/execute.d.ts.map +1 -0
  411. package/dist/extensions/codemode/execute.js +665 -0
  412. package/dist/extensions/codemode/execute.js.map +1 -0
  413. package/dist/extensions/codemode/execute.lazy.d.ts +3 -0
  414. package/dist/extensions/codemode/execute.lazy.d.ts.map +1 -0
  415. package/dist/extensions/codemode/execute.lazy.js +3 -0
  416. package/dist/extensions/codemode/execute.lazy.js.map +1 -0
  417. package/dist/extensions/codemode/index.d.ts +21 -0
  418. package/dist/extensions/codemode/index.d.ts.map +1 -0
  419. package/dist/extensions/codemode/index.js +33 -0
  420. package/dist/extensions/codemode/index.js.map +1 -0
  421. package/dist/extensions/codemode/tool.d.ts +124 -0
  422. package/dist/extensions/codemode/tool.d.ts.map +1 -0
  423. package/dist/extensions/codemode/tool.js +286 -0
  424. package/dist/extensions/codemode/tool.js.map +1 -0
  425. package/dist/extensions/codemode/worker.d.ts +7 -0
  426. package/dist/extensions/codemode/worker.d.ts.map +1 -0
  427. package/dist/extensions/codemode/worker.js +7 -0
  428. package/dist/extensions/codemode/worker.js.map +1 -0
  429. package/dist/extensions/context-pruning/compress_context.d.ts.map +1 -1
  430. package/dist/extensions/context-pruning/compress_context.js +1 -3
  431. package/dist/extensions/context-pruning/compress_context.js.map +1 -1
  432. package/dist/extensions/context-pruning/context-pruning-state.d.ts.map +1 -1
  433. package/dist/extensions/context-pruning/context-pruning-state.js.map +1 -1
  434. package/dist/extensions/index.d.ts.map +1 -1
  435. package/dist/extensions/index.js +6 -2
  436. package/dist/extensions/index.js.map +1 -1
  437. package/dist/extensions/llama/client.d.ts +2 -0
  438. package/dist/extensions/llama/client.d.ts.map +1 -1
  439. package/dist/extensions/llama/client.js +7 -3
  440. package/dist/extensions/llama/client.js.map +1 -1
  441. package/dist/extensions/llama/huggingface.d.ts.map +1 -1
  442. package/dist/extensions/llama/huggingface.js.map +1 -1
  443. package/dist/extensions/llama/index.d.ts.map +1 -1
  444. package/dist/extensions/llama/index.js +0 -4
  445. package/dist/extensions/llama/index.js.map +1 -1
  446. package/dist/extensions/llama/provider.d.ts +1 -1
  447. package/dist/extensions/llama/provider.d.ts.map +1 -1
  448. package/dist/extensions/llama/provider.js +103 -13
  449. package/dist/extensions/llama/provider.js.map +1 -1
  450. package/dist/extensions/llama/ui.d.ts +3 -2
  451. package/dist/extensions/llama/ui.d.ts.map +1 -1
  452. package/dist/extensions/llama/ui.js +106 -364
  453. package/dist/extensions/llama/ui.js.map +1 -1
  454. package/dist/extensions/mcp/cli.d.ts +21 -0
  455. package/dist/extensions/mcp/cli.d.ts.map +1 -0
  456. package/dist/extensions/mcp/cli.js +494 -0
  457. package/dist/extensions/mcp/cli.js.map +1 -0
  458. package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
  459. package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
  460. package/dist/extensions/mcp/cli.lazy.js +3 -0
  461. package/dist/extensions/mcp/cli.lazy.js.map +1 -0
  462. package/dist/extensions/mcp/config.d.ts +84 -0
  463. package/dist/extensions/mcp/config.d.ts.map +1 -0
  464. package/dist/extensions/mcp/config.js +196 -0
  465. package/dist/extensions/mcp/config.js.map +1 -0
  466. package/dist/extensions/mcp/index.d.ts +71 -2
  467. package/dist/extensions/mcp/index.d.ts.map +1 -1
  468. package/dist/extensions/mcp/index.js +839 -131
  469. package/dist/extensions/mcp/index.js.map +1 -1
  470. package/dist/extensions/mcp/log.d.ts +16 -0
  471. package/dist/extensions/mcp/log.d.ts.map +1 -0
  472. package/dist/extensions/mcp/log.js +66 -0
  473. package/dist/extensions/mcp/log.js.map +1 -0
  474. package/dist/extensions/mcp/oauth.d.ts +102 -0
  475. package/dist/extensions/mcp/oauth.d.ts.map +1 -0
  476. package/dist/extensions/mcp/oauth.js +428 -0
  477. package/dist/extensions/mcp/oauth.js.map +1 -0
  478. package/dist/extensions/mcp/resources.d.ts +36 -0
  479. package/dist/extensions/mcp/resources.d.ts.map +1 -0
  480. package/dist/extensions/mcp/resources.js +261 -0
  481. package/dist/extensions/mcp/resources.js.map +1 -0
  482. package/dist/extensions/mcp/runtime.d.ts +98 -0
  483. package/dist/extensions/mcp/runtime.d.ts.map +1 -0
  484. package/dist/extensions/mcp/runtime.js +378 -0
  485. package/dist/extensions/mcp/runtime.js.map +1 -0
  486. package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
  487. package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
  488. package/dist/extensions/mcp/runtime.lazy.js +3 -0
  489. package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
  490. package/dist/extensions/mcp/tools.d.ts +84 -0
  491. package/dist/extensions/mcp/tools.d.ts.map +1 -0
  492. package/dist/extensions/mcp/tools.js +263 -0
  493. package/dist/extensions/mcp/tools.js.map +1 -0
  494. package/dist/extensions/punch/a2a-listen.d.ts +9 -0
  495. package/dist/extensions/punch/a2a-listen.d.ts.map +1 -0
  496. package/dist/extensions/punch/a2a-listen.js +88 -0
  497. package/dist/extensions/punch/a2a-listen.js.map +1 -0
  498. package/dist/extensions/punch/a2a.d.ts +12 -0
  499. package/dist/extensions/punch/a2a.d.ts.map +1 -0
  500. package/dist/extensions/punch/a2a.js +106 -0
  501. package/dist/extensions/punch/a2a.js.map +1 -0
  502. package/dist/extensions/punch/auth.d.ts.map +1 -1
  503. package/dist/extensions/punch/auth.js.map +1 -1
  504. package/dist/extensions/punch/collabs.d.ts.map +1 -1
  505. package/dist/extensions/punch/collabs.js.map +1 -1
  506. package/dist/extensions/punch/index.d.ts.map +1 -1
  507. package/dist/extensions/punch/index.js +9 -14
  508. package/dist/extensions/punch/index.js.map +1 -1
  509. package/dist/extensions/punch/routines.d.ts +1 -3
  510. package/dist/extensions/punch/routines.d.ts.map +1 -1
  511. package/dist/extensions/punch/routines.js +1 -121
  512. package/dist/extensions/punch/routines.js.map +1 -1
  513. package/dist/extensions/punch/server.d.ts.map +1 -1
  514. package/dist/extensions/punch/server.js.map +1 -1
  515. package/dist/extensions/punch/timezone.d.ts.map +1 -1
  516. package/dist/extensions/punch/timezone.js.map +1 -1
  517. package/dist/extensions/punch/todos.d.ts.map +1 -1
  518. package/dist/extensions/punch/todos.js.map +1 -1
  519. package/dist/extensions/report-progress/index.d.ts.map +1 -1
  520. package/dist/extensions/report-progress/index.js.map +1 -1
  521. package/dist/extensions/subagent/agents.d.ts.map +1 -1
  522. package/dist/extensions/subagent/agents.js.map +1 -1
  523. package/dist/extensions/subagent/index.d.ts.map +1 -1
  524. package/dist/extensions/subagent/index.js +0 -372
  525. package/dist/extensions/subagent/index.js.map +1 -1
  526. package/dist/extensions/tool-search/index.d.ts +12 -0
  527. package/dist/extensions/tool-search/index.d.ts.map +1 -0
  528. package/dist/extensions/tool-search/index.js +15 -0
  529. package/dist/extensions/tool-search/index.js.map +1 -0
  530. package/dist/extensions/tool-search/tool.d.ts +71 -0
  531. package/dist/extensions/tool-search/tool.d.ts.map +1 -0
  532. package/dist/extensions/tool-search/tool.js +187 -0
  533. package/dist/extensions/tool-search/tool.js.map +1 -0
  534. package/dist/extensions/webfetch/index.d.ts.map +1 -1
  535. package/dist/extensions/webfetch/index.js.map +1 -1
  536. package/dist/extensions/websearch/index.d.ts.map +1 -1
  537. package/dist/extensions/websearch/index.js.map +1 -1
  538. package/dist/index.d.ts +13 -6
  539. package/dist/index.d.ts.map +1 -1
  540. package/dist/index.js +9 -6
  541. package/dist/index.js.map +1 -1
  542. package/dist/main.d.ts +1 -1
  543. package/dist/main.d.ts.map +1 -1
  544. package/dist/main.js +139 -173
  545. package/dist/main.js.map +1 -1
  546. package/dist/migrations.d.ts.map +1 -1
  547. package/dist/migrations.js +0 -20
  548. package/dist/migrations.js.map +1 -1
  549. package/dist/modes/index.d.ts +0 -1
  550. package/dist/modes/index.d.ts.map +1 -1
  551. package/dist/modes/index.js +0 -1
  552. package/dist/modes/index.js.map +1 -1
  553. package/dist/modes/json-event.d.ts.map +1 -1
  554. package/dist/modes/json-event.js.map +1 -1
  555. package/dist/modes/print-mode.d.ts.map +1 -1
  556. package/dist/modes/print-mode.js +4 -0
  557. package/dist/modes/print-mode.js.map +1 -1
  558. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  559. package/dist/modes/rpc/jsonl.js.map +1 -1
  560. package/dist/modes/rpc/rpc-client.d.ts +6 -6
  561. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  562. package/dist/modes/rpc/rpc-client.js +12 -8
  563. package/dist/modes/rpc/rpc-client.js.map +1 -1
  564. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  565. package/dist/modes/rpc/rpc-mode.js +16 -46
  566. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  567. package/dist/modes/rpc/rpc-types.d.ts +10 -1
  568. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  569. package/dist/modes/rpc/rpc-types.js.map +1 -1
  570. package/dist/package-manager-cli.d.ts.map +1 -1
  571. package/dist/package-manager-cli.js +43 -43
  572. package/dist/package-manager-cli.js.map +1 -1
  573. package/dist/rpc-entry.d.ts.map +1 -1
  574. package/dist/rpc-entry.js.map +1 -1
  575. package/dist/server/a2a/harness-runner.d.ts.map +1 -1
  576. package/dist/server/a2a/harness-runner.js.map +1 -1
  577. package/dist/server/a2a/run-server.d.ts.map +1 -1
  578. package/dist/server/a2a/run-server.js.map +1 -1
  579. package/dist/utils/abort.d.ts.map +1 -1
  580. package/dist/utils/abort.js.map +1 -1
  581. package/dist/utils/ansi.d.ts +8 -0
  582. package/dist/utils/ansi.d.ts.map +1 -1
  583. package/dist/utils/ansi.js +30 -11
  584. package/dist/utils/ansi.js.map +1 -1
  585. package/dist/utils/changelog.d.ts.map +1 -1
  586. package/dist/utils/changelog.js +5 -2
  587. package/dist/utils/changelog.js.map +1 -1
  588. package/dist/utils/child-process.d.ts.map +1 -1
  589. package/dist/utils/child-process.js.map +1 -1
  590. package/dist/utils/clipboard-command.d.ts.map +1 -1
  591. package/dist/utils/clipboard-command.js.map +1 -1
  592. package/dist/utils/clipboard-image.d.ts.map +1 -1
  593. package/dist/utils/clipboard-image.js +15 -41
  594. package/dist/utils/clipboard-image.js.map +1 -1
  595. package/dist/utils/clipboard.d.ts.map +1 -1
  596. package/dist/utils/clipboard.js +96 -38
  597. package/dist/utils/clipboard.js.map +1 -1
  598. package/dist/utils/colors.d.ts +73 -0
  599. package/dist/utils/colors.d.ts.map +1 -0
  600. package/dist/utils/colors.js +273 -0
  601. package/dist/utils/colors.js.map +1 -0
  602. package/dist/utils/deprecation.d.ts.map +1 -1
  603. package/dist/utils/deprecation.js.map +1 -1
  604. package/dist/utils/exif-orientation.d.ts.map +1 -1
  605. package/dist/utils/exif-orientation.js.map +1 -1
  606. package/dist/utils/frontmatter.d.ts.map +1 -1
  607. package/dist/utils/frontmatter.js.map +1 -1
  608. package/dist/utils/fs-watch.d.ts.map +1 -1
  609. package/dist/utils/fs-watch.js.map +1 -1
  610. package/dist/utils/fuzzy.d.ts +16 -0
  611. package/dist/utils/fuzzy.d.ts.map +1 -0
  612. package/dist/utils/fuzzy.js +111 -0
  613. package/dist/utils/fuzzy.js.map +1 -0
  614. package/dist/utils/git.d.ts.map +1 -1
  615. package/dist/utils/git.js.map +1 -1
  616. package/dist/utils/html.d.ts.map +1 -1
  617. package/dist/utils/html.js.map +1 -1
  618. package/dist/utils/image-convert.d.ts.map +1 -1
  619. package/dist/utils/image-convert.js.map +1 -1
  620. package/dist/utils/image-process.d.ts.map +1 -1
  621. package/dist/utils/image-process.js.map +1 -1
  622. package/dist/utils/image-resize-core.d.ts +12 -0
  623. package/dist/utils/image-resize-core.d.ts.map +1 -1
  624. package/dist/utils/image-resize-core.js +5 -0
  625. package/dist/utils/image-resize-core.js.map +1 -1
  626. package/dist/utils/image-resize-worker.d.ts.map +1 -1
  627. package/dist/utils/image-resize-worker.js +3 -2
  628. package/dist/utils/image-resize-worker.js.map +1 -1
  629. package/dist/utils/image-resize.d.ts.map +1 -1
  630. package/dist/utils/image-resize.js +9 -10
  631. package/dist/utils/image-resize.js.map +1 -1
  632. package/dist/utils/json.d.ts.map +1 -1
  633. package/dist/utils/json.js.map +1 -1
  634. package/dist/utils/management-http.d.ts.map +1 -1
  635. package/dist/utils/management-http.js.map +1 -1
  636. package/dist/utils/mime.d.ts.map +1 -1
  637. package/dist/utils/mime.js +1 -1
  638. package/dist/utils/mime.js.map +1 -1
  639. package/dist/utils/oklab.d.ts +43 -0
  640. package/dist/utils/oklab.d.ts.map +1 -0
  641. package/dist/utils/oklab.js +210 -0
  642. package/dist/utils/oklab.js.map +1 -0
  643. package/dist/utils/open-browser.d.ts.map +1 -1
  644. package/dist/utils/open-browser.js.map +1 -1
  645. package/dist/utils/output-files.d.ts +15 -0
  646. package/dist/utils/output-files.d.ts.map +1 -0
  647. package/dist/utils/output-files.js +30 -0
  648. package/dist/utils/output-files.js.map +1 -0
  649. package/dist/utils/paths.d.ts +3 -3
  650. package/dist/utils/paths.d.ts.map +1 -1
  651. package/dist/utils/paths.js +5 -4
  652. package/dist/utils/paths.js.map +1 -1
  653. package/dist/utils/photon.d.ts.map +1 -1
  654. package/dist/utils/photon.js.map +1 -1
  655. package/dist/utils/pi-user-agent.d.ts.map +1 -1
  656. package/dist/utils/pi-user-agent.js.map +1 -1
  657. package/dist/utils/shell.d.ts +1 -3
  658. package/dist/utils/shell.d.ts.map +1 -1
  659. package/dist/utils/shell.js +3 -30
  660. package/dist/utils/shell.js.map +1 -1
  661. package/dist/utils/sleep.d.ts.map +1 -1
  662. package/dist/utils/sleep.js.map +1 -1
  663. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  664. package/dist/utils/syntax-highlight.js +8 -1
  665. package/dist/utils/syntax-highlight.js.map +1 -1
  666. package/dist/utils/text.d.ts.map +1 -1
  667. package/dist/utils/text.js.map +1 -1
  668. package/dist/utils/tool-result-images.d.ts +3 -1
  669. package/dist/utils/tool-result-images.d.ts.map +1 -1
  670. package/dist/utils/tool-result-images.js +4 -1
  671. package/dist/utils/tool-result-images.js.map +1 -1
  672. package/dist/utils/tools-manager.d.ts.map +1 -1
  673. package/dist/utils/tools-manager.js.map +1 -1
  674. package/dist/utils/version-check.d.ts.map +1 -1
  675. package/dist/utils/version-check.js.map +1 -1
  676. package/dist/utils/windows-self-update.d.ts.map +1 -1
  677. package/dist/utils/windows-self-update.js.map +1 -1
  678. package/dist/utils/wsl.d.ts +3 -0
  679. package/dist/utils/wsl.d.ts.map +1 -0
  680. package/dist/utils/wsl.js +15 -0
  681. package/dist/utils/wsl.js.map +1 -0
  682. package/dist/utils/zip.d.ts +7 -0
  683. package/dist/utils/zip.d.ts.map +1 -0
  684. package/dist/utils/zip.js +60 -0
  685. package/dist/utils/zip.js.map +1 -0
  686. package/docs/cli-integration.md +106 -0
  687. package/docs/cli.md +333 -0
  688. package/docs/codemode.md +230 -0
  689. package/docs/compaction.md +47 -28
  690. package/docs/configuration.md +47 -0
  691. package/docs/containerization.md +109 -82
  692. package/docs/custom-provider.md +109 -713
  693. package/docs/docs.json +148 -96
  694. package/docs/environment-variables.md +18 -3
  695. package/docs/extensions.md +284 -604
  696. package/docs/how-pi-works.md +49 -0
  697. package/docs/images/interactive-mode.png +0 -0
  698. package/docs/index.md +24 -69
  699. package/docs/json.md +193 -65
  700. package/docs/keybindings.md +58 -103
  701. package/docs/llama-cpp.md +24 -4
  702. package/docs/mcp.md +272 -0
  703. package/docs/message-types.md +279 -0
  704. package/docs/models.md +124 -489
  705. package/docs/nvidia-rtx-llama-cpp.md +96 -0
  706. package/docs/packages.md +67 -166
  707. package/docs/prompt-templates.md +31 -68
  708. package/docs/providers.md +158 -228
  709. package/docs/quickstart.md +61 -106
  710. package/docs/rpc-commands.md +860 -0
  711. package/docs/rpc-extension-ui.md +200 -0
  712. package/docs/rpc.md +131 -1554
  713. package/docs/sdk.md +79 -1158
  714. package/docs/security.md +72 -32
  715. package/docs/session-format.md +58 -215
  716. package/docs/sessions.md +35 -114
  717. package/docs/settings.md +98 -326
  718. package/docs/shell-aliases.md +85 -5
  719. package/docs/skills.md +51 -190
  720. package/docs/slash-commands.md +60 -0
  721. package/docs/subagents.md +2 -0
  722. package/docs/terminal-setup.md +7 -182
  723. package/docs/termux.md +74 -83
  724. package/docs/themes.md +89 -273
  725. package/docs/tmux.md +31 -39
  726. package/docs/tui.md +74 -910
  727. package/docs/usage.md +52 -129
  728. package/docs/virtual-models.md +114 -0
  729. package/docs/windows.md +45 -17
  730. package/examples/README.md +13 -5
  731. package/examples/extensions/README.md +4 -30
  732. package/examples/extensions/custom-provider-anthropic/index.ts +18 -12
  733. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  734. package/examples/extensions/custom-provider-anthropic/package.json +17 -17
  735. package/examples/extensions/custom-provider-gitlab-duo/index.ts +2 -2
  736. package/examples/extensions/custom-provider-gitlab-duo/package.json +14 -14
  737. package/examples/extensions/custom-provider-gitlab-duo/test.ts +5 -5
  738. package/examples/extensions/debug-provider.ts +69 -0
  739. package/examples/extensions/dynamic-resources/dynamic.json +1 -1
  740. package/examples/extensions/gondolin/package-lock.json +5 -5
  741. package/examples/extensions/gondolin/package.json +1 -1
  742. package/examples/extensions/jev-router.ts +113 -0
  743. package/examples/extensions/prompt-customizer.ts +19 -67
  744. package/examples/extensions/sandbox/package-lock.json +2 -2
  745. package/examples/extensions/sandbox/package.json +1 -1
  746. package/examples/extensions/with-deps/package-lock.json +2 -2
  747. package/examples/extensions/with-deps/package.json +20 -20
  748. package/examples/rpc-client.ts +35 -0
  749. package/examples/sdk/14-codemode-mcp.ts +61 -0
  750. package/examples/sdk/README.md +3 -2
  751. package/npm-shrinkwrap.json +2425 -0
  752. package/package.json +20 -29
  753. package/schemas/models.schema.json +1157 -0
  754. package/schemas/settings.schema.json +734 -0
  755. package/schemas/theme.schema.json +365 -0
  756. package/dist/bundle/chunks/anthropic-messages-ASRU76PT.js +0 -6
  757. package/dist/bundle/chunks/azure-openai-responses-UGF6LMEX.js +0 -2
  758. package/dist/bundle/chunks/chunk-5PRUVL6W.js +0 -1770
  759. package/dist/bundle/chunks/chunk-6R7UI4IY.js +0 -2
  760. package/dist/bundle/chunks/chunk-A3JYRWB6.js +0 -2
  761. package/dist/bundle/chunks/chunk-CHB3CEFP.js +0 -2
  762. package/dist/bundle/chunks/chunk-ELBMWBDG.js +0 -11
  763. package/dist/bundle/chunks/chunk-GMWCTUPB.js +0 -2
  764. package/dist/bundle/chunks/chunk-GTBU4EAF.js +0 -2
  765. package/dist/bundle/chunks/chunk-NUHFSC37.js +0 -25
  766. package/dist/bundle/chunks/chunk-UIWY7TU5.js +0 -42
  767. package/dist/bundle/chunks/chunk-XNGRGP62.js +0 -2
  768. package/dist/bundle/chunks/google-generative-ai-VCD2PGIY.js +0 -2
  769. package/dist/bundle/chunks/google-vertex-L6U34ZRC.js +0 -2
  770. package/dist/bundle/chunks/mistral-conversations-IXWQ2YKN.js +0 -5
  771. package/dist/bundle/chunks/node-5YXRXMVN.js +0 -16
  772. package/dist/bundle/chunks/openai-codex-responses-P7HKQLIT.js +0 -10
  773. package/dist/bundle/chunks/openai-completions-O7BFLP3U.js +0 -7
  774. package/dist/bundle/chunks/openai-responses-QAKWAYVG.js +0 -2
  775. package/dist/cli/config-selector.d.ts +0 -16
  776. package/dist/cli/config-selector.d.ts.map +0 -1
  777. package/dist/cli/config-selector.js +0 -32
  778. package/dist/cli/config-selector.js.map +0 -1
  779. package/dist/cli/session-picker.d.ts +0 -10
  780. package/dist/cli/session-picker.d.ts.map +0 -1
  781. package/dist/cli/session-picker.js +0 -36
  782. package/dist/cli/session-picker.js.map +0 -1
  783. package/dist/cli/startup-ui.d.ts +0 -20
  784. package/dist/cli/startup-ui.d.ts.map +0 -1
  785. package/dist/cli/startup-ui.js +0 -185
  786. package/dist/cli/startup-ui.js.map +0 -1
  787. package/dist/core/keybindings.d.ts +0 -428
  788. package/dist/core/keybindings.d.ts.map +0 -1
  789. package/dist/core/keybindings.js +0 -321
  790. package/dist/core/keybindings.js.map +0 -1
  791. package/dist/core/tools/render-utils.d.ts +0 -24
  792. package/dist/core/tools/render-utils.d.ts.map +0 -1
  793. package/dist/core/tools/render-utils.js +0 -65
  794. package/dist/core/tools/render-utils.js.map +0 -1
  795. package/dist/core/tools/renderers/bash.d.ts +0 -12
  796. package/dist/core/tools/renderers/bash.d.ts.map +0 -1
  797. package/dist/core/tools/renderers/bash.js +0 -130
  798. package/dist/core/tools/renderers/bash.js.map +0 -1
  799. package/dist/core/tools/renderers/edit.d.ts +0 -23
  800. package/dist/core/tools/renderers/edit.d.ts.map +0 -1
  801. package/dist/core/tools/renderers/edit.js +0 -167
  802. package/dist/core/tools/renderers/edit.js.map +0 -1
  803. package/dist/core/tools/renderers/find.d.ts +0 -10
  804. package/dist/core/tools/renderers/find.d.ts.map +0 -1
  805. package/dist/core/tools/renderers/find.js +0 -64
  806. package/dist/core/tools/renderers/find.js.map +0 -1
  807. package/dist/core/tools/renderers/grep.d.ts +0 -10
  808. package/dist/core/tools/renderers/grep.d.ts.map +0 -1
  809. package/dist/core/tools/renderers/grep.js +0 -69
  810. package/dist/core/tools/renderers/grep.js.map +0 -1
  811. package/dist/core/tools/renderers/index.d.ts +0 -28
  812. package/dist/core/tools/renderers/index.d.ts.map +0 -1
  813. package/dist/core/tools/renderers/index.js +0 -47
  814. package/dist/core/tools/renderers/index.js.map +0 -1
  815. package/dist/core/tools/renderers/ls.d.ts +0 -10
  816. package/dist/core/tools/renderers/ls.d.ts.map +0 -1
  817. package/dist/core/tools/renderers/ls.js +0 -58
  818. package/dist/core/tools/renderers/ls.js.map +0 -1
  819. package/dist/core/tools/renderers/read.d.ts +0 -11
  820. package/dist/core/tools/renderers/read.d.ts.map +0 -1
  821. package/dist/core/tools/renderers/read.js +0 -129
  822. package/dist/core/tools/renderers/read.js.map +0 -1
  823. package/dist/core/tools/renderers/write.d.ts +0 -10
  824. package/dist/core/tools/renderers/write.d.ts.map +0 -1
  825. package/dist/core/tools/renderers/write.js +0 -153
  826. package/dist/core/tools/renderers/write.js.map +0 -1
  827. package/dist/extensions/mcp/mcp-client.d.ts +0 -31
  828. package/dist/extensions/mcp/mcp-client.d.ts.map +0 -1
  829. package/dist/extensions/mcp/mcp-client.js +0 -149
  830. package/dist/extensions/mcp/mcp-client.js.map +0 -1
  831. package/dist/extensions/mcp/mcp-config.d.ts +0 -47
  832. package/dist/extensions/mcp/mcp-config.d.ts.map +0 -1
  833. package/dist/extensions/mcp/mcp-config.js +0 -281
  834. package/dist/extensions/mcp/mcp-config.js.map +0 -1
  835. package/dist/extensions/mcp/mcp-transport.d.ts +0 -65
  836. package/dist/extensions/mcp/mcp-transport.d.ts.map +0 -1
  837. package/dist/extensions/mcp/mcp-transport.js +0 -278
  838. package/dist/extensions/mcp/mcp-transport.js.map +0 -1
  839. package/dist/modes/interactive/assets/clankolas.png +0 -0
  840. package/dist/modes/interactive/chat-viewport.d.ts +0 -20
  841. package/dist/modes/interactive/chat-viewport.d.ts.map +0 -1
  842. package/dist/modes/interactive/chat-viewport.js +0 -28
  843. package/dist/modes/interactive/chat-viewport.js.map +0 -1
  844. package/dist/modes/interactive/components/armin.d.ts +0 -34
  845. package/dist/modes/interactive/components/armin.d.ts.map +0 -1
  846. package/dist/modes/interactive/components/armin.js +0 -333
  847. package/dist/modes/interactive/components/armin.js.map +0 -1
  848. package/dist/modes/interactive/components/assistant-message.d.ts +0 -26
  849. package/dist/modes/interactive/components/assistant-message.d.ts.map +0 -1
  850. package/dist/modes/interactive/components/assistant-message.js +0 -158
  851. package/dist/modes/interactive/components/assistant-message.js.map +0 -1
  852. package/dist/modes/interactive/components/bash-execution.d.ts +0 -34
  853. package/dist/modes/interactive/components/bash-execution.d.ts.map +0 -1
  854. package/dist/modes/interactive/components/bash-execution.js +0 -175
  855. package/dist/modes/interactive/components/bash-execution.js.map +0 -1
  856. package/dist/modes/interactive/components/bordered-loader.d.ts +0 -16
  857. package/dist/modes/interactive/components/bordered-loader.d.ts.map +0 -1
  858. package/dist/modes/interactive/components/bordered-loader.js +0 -54
  859. package/dist/modes/interactive/components/bordered-loader.js.map +0 -1
  860. package/dist/modes/interactive/components/branch-summary-message.d.ts +0 -16
  861. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +0 -1
  862. package/dist/modes/interactive/components/branch-summary-message.js +0 -44
  863. package/dist/modes/interactive/components/branch-summary-message.js.map +0 -1
  864. package/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -16
  865. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +0 -1
  866. package/dist/modes/interactive/components/compaction-summary-message.js +0 -45
  867. package/dist/modes/interactive/components/compaction-summary-message.js.map +0 -1
  868. package/dist/modes/interactive/components/config-selector.d.ts +0 -102
  869. package/dist/modes/interactive/components/config-selector.d.ts.map +0 -1
  870. package/dist/modes/interactive/components/config-selector.js +0 -761
  871. package/dist/modes/interactive/components/config-selector.js.map +0 -1
  872. package/dist/modes/interactive/components/countdown-timer.d.ts +0 -14
  873. package/dist/modes/interactive/components/countdown-timer.d.ts.map +0 -1
  874. package/dist/modes/interactive/components/countdown-timer.js +0 -33
  875. package/dist/modes/interactive/components/countdown-timer.js.map +0 -1
  876. package/dist/modes/interactive/components/custom-editor.d.ts +0 -30
  877. package/dist/modes/interactive/components/custom-editor.d.ts.map +0 -1
  878. package/dist/modes/interactive/components/custom-editor.js +0 -115
  879. package/dist/modes/interactive/components/custom-editor.js.map +0 -1
  880. package/dist/modes/interactive/components/custom-entry.d.ts +0 -19
  881. package/dist/modes/interactive/components/custom-entry.d.ts.map +0 -1
  882. package/dist/modes/interactive/components/custom-entry.js +0 -52
  883. package/dist/modes/interactive/components/custom-entry.js.map +0 -1
  884. package/dist/modes/interactive/components/custom-message.d.ts +0 -22
  885. package/dist/modes/interactive/components/custom-message.d.ts.map +0 -1
  886. package/dist/modes/interactive/components/custom-message.js +0 -87
  887. package/dist/modes/interactive/components/custom-message.js.map +0 -1
  888. package/dist/modes/interactive/components/daxnuts.d.ts +0 -23
  889. package/dist/modes/interactive/components/daxnuts.d.ts.map +0 -1
  890. package/dist/modes/interactive/components/daxnuts.js +0 -140
  891. package/dist/modes/interactive/components/daxnuts.js.map +0 -1
  892. package/dist/modes/interactive/components/diff.d.ts +0 -12
  893. package/dist/modes/interactive/components/diff.d.ts.map +0 -1
  894. package/dist/modes/interactive/components/diff.js +0 -133
  895. package/dist/modes/interactive/components/diff.js.map +0 -1
  896. package/dist/modes/interactive/components/dynamic-border.d.ts +0 -15
  897. package/dist/modes/interactive/components/dynamic-border.d.ts.map +0 -1
  898. package/dist/modes/interactive/components/dynamic-border.js +0 -21
  899. package/dist/modes/interactive/components/dynamic-border.js.map +0 -1
  900. package/dist/modes/interactive/components/earendil-announcement.d.ts +0 -5
  901. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +0 -1
  902. package/dist/modes/interactive/components/earendil-announcement.js +0 -40
  903. package/dist/modes/interactive/components/earendil-announcement.js.map +0 -1
  904. package/dist/modes/interactive/components/extension-editor.d.ts +0 -21
  905. package/dist/modes/interactive/components/extension-editor.d.ts.map +0 -1
  906. package/dist/modes/interactive/components/extension-editor.js +0 -98
  907. package/dist/modes/interactive/components/extension-editor.js.map +0 -1
  908. package/dist/modes/interactive/components/extension-input.d.ts +0 -23
  909. package/dist/modes/interactive/components/extension-input.d.ts.map +0 -1
  910. package/dist/modes/interactive/components/extension-input.js +0 -61
  911. package/dist/modes/interactive/components/extension-input.js.map +0 -1
  912. package/dist/modes/interactive/components/extension-selector.d.ts +0 -26
  913. package/dist/modes/interactive/components/extension-selector.d.ts.map +0 -1
  914. package/dist/modes/interactive/components/extension-selector.js +0 -83
  915. package/dist/modes/interactive/components/extension-selector.js.map +0 -1
  916. package/dist/modes/interactive/components/first-time-setup.d.ts +0 -25
  917. package/dist/modes/interactive/components/first-time-setup.d.ts.map +0 -1
  918. package/dist/modes/interactive/components/first-time-setup.js +0 -103
  919. package/dist/modes/interactive/components/first-time-setup.js.map +0 -1
  920. package/dist/modes/interactive/components/footer.d.ts +0 -32
  921. package/dist/modes/interactive/components/footer.d.ts.map +0 -1
  922. package/dist/modes/interactive/components/footer.js +0 -222
  923. package/dist/modes/interactive/components/footer.js.map +0 -1
  924. package/dist/modes/interactive/components/index.d.ts +0 -34
  925. package/dist/modes/interactive/components/index.d.ts.map +0 -1
  926. package/dist/modes/interactive/components/index.js +0 -35
  927. package/dist/modes/interactive/components/index.js.map +0 -1
  928. package/dist/modes/interactive/components/keybinding-hints.d.ts +0 -13
  929. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +0 -1
  930. package/dist/modes/interactive/components/keybinding-hints.js +0 -36
  931. package/dist/modes/interactive/components/keybinding-hints.js.map +0 -1
  932. package/dist/modes/interactive/components/login-dialog.d.ts +0 -52
  933. package/dist/modes/interactive/components/login-dialog.d.ts.map +0 -1
  934. package/dist/modes/interactive/components/login-dialog.js +0 -188
  935. package/dist/modes/interactive/components/login-dialog.js.map +0 -1
  936. package/dist/modes/interactive/components/markdown-transform.d.ts +0 -3
  937. package/dist/modes/interactive/components/markdown-transform.d.ts.map +0 -1
  938. package/dist/modes/interactive/components/markdown-transform.js +0 -19
  939. package/dist/modes/interactive/components/markdown-transform.js.map +0 -1
  940. package/dist/modes/interactive/components/mermaid.d.ts +0 -11
  941. package/dist/modes/interactive/components/mermaid.d.ts.map +0 -1
  942. package/dist/modes/interactive/components/mermaid.js +0 -75
  943. package/dist/modes/interactive/components/mermaid.js.map +0 -1
  944. package/dist/modes/interactive/components/model-selector.d.ts +0 -60
  945. package/dist/modes/interactive/components/model-selector.d.ts.map +0 -1
  946. package/dist/modes/interactive/components/model-selector.js +0 -361
  947. package/dist/modes/interactive/components/model-selector.js.map +0 -1
  948. package/dist/modes/interactive/components/oauth-selector.d.ts +0 -33
  949. package/dist/modes/interactive/components/oauth-selector.d.ts.map +0 -1
  950. package/dist/modes/interactive/components/oauth-selector.js +0 -163
  951. package/dist/modes/interactive/components/oauth-selector.js.map +0 -1
  952. package/dist/modes/interactive/components/question-selector.d.ts +0 -24
  953. package/dist/modes/interactive/components/question-selector.d.ts.map +0 -1
  954. package/dist/modes/interactive/components/question-selector.js +0 -158
  955. package/dist/modes/interactive/components/question-selector.js.map +0 -1
  956. package/dist/modes/interactive/components/scoped-models-selector.d.ts +0 -46
  957. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +0 -1
  958. package/dist/modes/interactive/components/scoped-models-selector.js +0 -326
  959. package/dist/modes/interactive/components/scoped-models-selector.js.map +0 -1
  960. package/dist/modes/interactive/components/session-selector-search.d.ts +0 -23
  961. package/dist/modes/interactive/components/session-selector-search.d.ts.map +0 -1
  962. package/dist/modes/interactive/components/session-selector-search.js +0 -155
  963. package/dist/modes/interactive/components/session-selector-search.js.map +0 -1
  964. package/dist/modes/interactive/components/session-selector.d.ts +0 -95
  965. package/dist/modes/interactive/components/session-selector.d.ts.map +0 -1
  966. package/dist/modes/interactive/components/session-selector.js +0 -867
  967. package/dist/modes/interactive/components/session-selector.js.map +0 -1
  968. package/dist/modes/interactive/components/settings-selector.d.ts +0 -92
  969. package/dist/modes/interactive/components/settings-selector.d.ts.map +0 -1
  970. package/dist/modes/interactive/components/settings-selector.js +0 -709
  971. package/dist/modes/interactive/components/settings-selector.js.map +0 -1
  972. package/dist/modes/interactive/components/settings-submenu.d.ts +0 -72
  973. package/dist/modes/interactive/components/settings-submenu.d.ts.map +0 -1
  974. package/dist/modes/interactive/components/settings-submenu.js +0 -165
  975. package/dist/modes/interactive/components/settings-submenu.js.map +0 -1
  976. package/dist/modes/interactive/components/show-images-selector.d.ts +0 -10
  977. package/dist/modes/interactive/components/show-images-selector.d.ts.map +0 -1
  978. package/dist/modes/interactive/components/show-images-selector.js +0 -39
  979. package/dist/modes/interactive/components/show-images-selector.js.map +0 -1
  980. package/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -17
  981. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +0 -1
  982. package/dist/modes/interactive/components/skill-invocation-message.js +0 -47
  983. package/dist/modes/interactive/components/skill-invocation-message.js.map +0 -1
  984. package/dist/modes/interactive/components/status-indicator.d.ts +0 -30
  985. package/dist/modes/interactive/components/status-indicator.d.ts.map +0 -1
  986. package/dist/modes/interactive/components/status-indicator.js +0 -67
  987. package/dist/modes/interactive/components/status-indicator.js.map +0 -1
  988. package/dist/modes/interactive/components/theme-selector.d.ts +0 -11
  989. package/dist/modes/interactive/components/theme-selector.d.ts.map +0 -1
  990. package/dist/modes/interactive/components/theme-selector.js +0 -50
  991. package/dist/modes/interactive/components/theme-selector.js.map +0 -1
  992. package/dist/modes/interactive/components/thinking-selector.d.ts +0 -23
  993. package/dist/modes/interactive/components/thinking-selector.d.ts.map +0 -1
  994. package/dist/modes/interactive/components/thinking-selector.js +0 -109
  995. package/dist/modes/interactive/components/thinking-selector.js.map +0 -1
  996. package/dist/modes/interactive/components/tool-execution.d.ts +0 -80
  997. package/dist/modes/interactive/components/tool-execution.d.ts.map +0 -1
  998. package/dist/modes/interactive/components/tool-execution.js +0 -328
  999. package/dist/modes/interactive/components/tool-execution.js.map +0 -1
  1000. package/dist/modes/interactive/components/tree-selector.d.ts +0 -94
  1001. package/dist/modes/interactive/components/tree-selector.d.ts.map +0 -1
  1002. package/dist/modes/interactive/components/tree-selector.js +0 -1245
  1003. package/dist/modes/interactive/components/tree-selector.js.map +0 -1
  1004. package/dist/modes/interactive/components/trust-selector.d.ts +0 -23
  1005. package/dist/modes/interactive/components/trust-selector.d.ts.map +0 -1
  1006. package/dist/modes/interactive/components/trust-selector.js +0 -91
  1007. package/dist/modes/interactive/components/trust-selector.js.map +0 -1
  1008. package/dist/modes/interactive/components/user-message-selector.d.ts +0 -30
  1009. package/dist/modes/interactive/components/user-message-selector.d.ts.map +0 -1
  1010. package/dist/modes/interactive/components/user-message-selector.js +0 -114
  1011. package/dist/modes/interactive/components/user-message-selector.js.map +0 -1
  1012. package/dist/modes/interactive/components/user-message.d.ts +0 -16
  1013. package/dist/modes/interactive/components/user-message.d.ts.map +0 -1
  1014. package/dist/modes/interactive/components/user-message.js +0 -49
  1015. package/dist/modes/interactive/components/user-message.js.map +0 -1
  1016. package/dist/modes/interactive/components/visual-truncate.d.ts +0 -24
  1017. package/dist/modes/interactive/components/visual-truncate.d.ts.map +0 -1
  1018. package/dist/modes/interactive/components/visual-truncate.js +0 -33
  1019. package/dist/modes/interactive/components/visual-truncate.js.map +0 -1
  1020. package/dist/modes/interactive/external-editor.d.ts +0 -12
  1021. package/dist/modes/interactive/external-editor.d.ts.map +0 -1
  1022. package/dist/modes/interactive/external-editor.js +0 -38
  1023. package/dist/modes/interactive/external-editor.js.map +0 -1
  1024. package/dist/modes/interactive/interactive-mode.d.ts +0 -443
  1025. package/dist/modes/interactive/interactive-mode.d.ts.map +0 -1
  1026. package/dist/modes/interactive/interactive-mode.js +0 -5604
  1027. package/dist/modes/interactive/interactive-mode.js.map +0 -1
  1028. package/dist/modes/interactive/model-catalog-refresh.d.ts.map +0 -1
  1029. package/dist/modes/interactive/model-catalog-refresh.js.map +0 -1
  1030. package/dist/modes/interactive/model-search.d.ts +0 -12
  1031. package/dist/modes/interactive/model-search.d.ts.map +0 -1
  1032. package/dist/modes/interactive/model-search.js +0 -15
  1033. package/dist/modes/interactive/model-search.js.map +0 -1
  1034. package/dist/modes/interactive/session-share.d.ts +0 -16
  1035. package/dist/modes/interactive/session-share.d.ts.map +0 -1
  1036. package/dist/modes/interactive/session-share.js +0 -184
  1037. package/dist/modes/interactive/session-share.js.map +0 -1
  1038. package/dist/modes/interactive/theme/dark.json +0 -91
  1039. package/dist/modes/interactive/theme/light.json +0 -90
  1040. package/dist/modes/interactive/theme/theme-controller.d.ts +0 -41
  1041. package/dist/modes/interactive/theme/theme-controller.d.ts.map +0 -1
  1042. package/dist/modes/interactive/theme/theme-controller.js +0 -130
  1043. package/dist/modes/interactive/theme/theme-controller.js.map +0 -1
  1044. package/dist/modes/interactive/theme/theme-json.d.ts +0 -84
  1045. package/dist/modes/interactive/theme/theme-json.d.ts.map +0 -1
  1046. package/dist/modes/interactive/theme/theme-json.js +0 -130
  1047. package/dist/modes/interactive/theme/theme-json.js.map +0 -1
  1048. package/dist/modes/interactive/theme/theme-schema.json +0 -356
  1049. package/dist/modes/interactive/theme/theme.d.ts +0 -131
  1050. package/dist/modes/interactive/theme/theme.d.ts.map +0 -1
  1051. package/dist/modes/interactive/theme/theme.js.map +0 -1
  1052. package/dist/modes/interactive/tui-renderer.d.ts +0 -21
  1053. package/dist/modes/interactive/tui-renderer.d.ts.map +0 -1
  1054. package/dist/modes/interactive/tui-renderer.js +0 -66
  1055. package/dist/modes/interactive/tui-renderer.js.map +0 -1
  1056. package/docs/development.md +0 -90
  1057. package/examples/extensions/border-status-editor.ts +0 -145
  1058. package/examples/extensions/built-in-tool-renderer.ts +0 -249
  1059. package/examples/extensions/custom-footer.ts +0 -64
  1060. package/examples/extensions/custom-header.ts +0 -73
  1061. package/examples/extensions/doom-overlay/README.md +0 -46
  1062. package/examples/extensions/doom-overlay/doom/build/doom.js +0 -21
  1063. package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
  1064. package/examples/extensions/doom-overlay/doom/build.sh +0 -152
  1065. package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +0 -72
  1066. package/examples/extensions/doom-overlay/doom-component.ts +0 -132
  1067. package/examples/extensions/doom-overlay/doom-engine.ts +0 -173
  1068. package/examples/extensions/doom-overlay/doom-keys.ts +0 -104
  1069. package/examples/extensions/doom-overlay/index.ts +0 -74
  1070. package/examples/extensions/doom-overlay/wad-finder.ts +0 -55
  1071. package/examples/extensions/entry-renderer.ts +0 -41
  1072. package/examples/extensions/github-issue-autocomplete.ts +0 -185
  1073. package/examples/extensions/handoff.ts +0 -190
  1074. package/examples/extensions/interactive-shell.ts +0 -196
  1075. package/examples/extensions/kimi-deferred-tools.ts +0 -61
  1076. package/examples/extensions/message-renderer.ts +0 -59
  1077. package/examples/extensions/minimal-mode.ts +0 -426
  1078. package/examples/extensions/modal-editor.ts +0 -85
  1079. package/examples/extensions/overlay-qa-tests.ts +0 -1450
  1080. package/examples/extensions/overlay-test.ts +0 -153
  1081. package/examples/extensions/plan-mode/README.md +0 -66
  1082. package/examples/extensions/plan-mode/index.ts +0 -390
  1083. package/examples/extensions/plan-mode/utils.ts +0 -168
  1084. package/examples/extensions/preset.ts +0 -436
  1085. package/examples/extensions/qna.ts +0 -118
  1086. package/examples/extensions/question.ts +0 -278
  1087. package/examples/extensions/questionnaire.ts +0 -440
  1088. package/examples/extensions/rainbow-editor.ts +0 -88
  1089. package/examples/extensions/snake.ts +0 -343
  1090. package/examples/extensions/space-invaders.ts +0 -560
  1091. package/examples/extensions/structured-output.ts +0 -65
  1092. package/examples/extensions/summarize.ts +0 -199
  1093. package/examples/extensions/tic-tac-toe.ts +0 -1008
  1094. package/examples/extensions/todo.ts +0 -297
  1095. package/examples/extensions/tools.ts +0 -146
  1096. package/examples/extensions/truncated-tool.ts +0 -195
  1097. package/examples/plugins/pi-example-plugin/README.md +0 -38
  1098. package/examples/plugins/pi-example-plugin/package.json +0 -10
  1099. package/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
  1100. package/examples/plugins/pi-example-plugin/src/session.ts +0 -23
  1101. package/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
  1102. package/examples/rpc-extension-ui.ts +0 -641
  1103. /package/dist/bundle/chunks/{chunk-PATAL4PO.js → chunk-7ZC4UXSL.js} +0 -0
@@ -0,0 +1,230 @@
1
+ # Codemode
2
+
3
+ The `codemode` tool lets the model write a JavaScript script that calls pi's other tools and runs non-LLM models, such as classifiers and image models. Only the script's output reaches the model, so a script can run calls in parallel and filter large results before the model sees them. To turn it on, see [Enable codemode](cli.md#enable-codemode).
4
+
5
+ ## Scripts
6
+
7
+ The tool input is raw JavaScript source, not JSON and not a markdown code fence. It runs as the body of an async function in a QuickJS sandbox, so top-level `await` and `return` work. The sandbox has no Node APIs, file system, network, or timers; scripts reach the outside world only through tools and `models`.
8
+
9
+ A script may start with an options line. It must be the first line; an options line anywhere else fails the call before the script runs:
10
+
11
+ ```js
12
+ // @options: {"max_output_tokens": 2000, "timeout_ms": 60000}
13
+ ```
14
+
15
+ - `max_output_tokens` (default 10000) limits the output. Longer output keeps its start and end, and the full text is written to a temp file whose path is included in the result. A script fails when its output passes 16777216 characters of text and base64 image data or 100000 `text()`, `image()`, and `console` calls; write large data to a file with a tool instead.
16
+ - `timeout_ms` is a hard deadline for the whole script. It is unset by default. Image generation can take minutes, so do not set a short deadline for scripts that generate images.
17
+
18
+ The result starts with `Script completed` or `Script failed`, the wall time, and the output. Text and image items appear in order, each on its own line. When the output has more than one text item (from `text()` or `return`), each starts with a `==> text N/M <==` line. `console` calls follow in one `<console_output>` block with one line per call. A failed script keeps its partial output, followed by `Script error:` and the error. Tool calls are real: calls made before a failure are not undone. Calls still running when the script ends are cancelled, and unawaited promises are discarded.
19
+
20
+ ## Globals
21
+
22
+ | Global | Purpose |
23
+ |---|---|
24
+ | `tools.<name>(args)` | Call a tool. See [Call tools](#call-tools). |
25
+ | `text(value)` | Add a text item to the output. Strings are added as is, other values as JSON. |
26
+ | `image(value)` | Add an image to the output: a base64 `data:` URL, an `{ image_url }` object, or an image block `{ type: "image", data, mimeType }` such as those returned by MCP tools and `models.generateImages()`. Remote URLs are not supported. PNG, JPEG, GIF, and WebP are accepted. Each image is also saved to a temp file, and the result names the path before the image. |
27
+ | `console.log(...)` | Add a line to the `<console_output>` block after the other output. Arguments are joined with spaces; `info`, `warn`, `error`, and `debug` do the same. |
28
+ | `return value` | A top-level `return` adds the value like `text()`. |
29
+ | `exit()` | End the script successfully. |
30
+ | `store(key, value)` / `load(key)` | Keep small JSON values across `codemode` calls. See [Store values](#store-values). |
31
+ | `ALL_TOOLS` | Every callable tool as `{ name, description }`, including tools the description does not list. |
32
+ | `searchTools(query, { limit?, namespace? })` | Rank callable tools by relevance (BM25, default limit 8). Resolves to `{ name, description }[]`. |
33
+ | `describeTool(name)` | Resolves to a tool's description and TypeScript declaration, or `undefined`. |
34
+ | `describeNamespace(name)` | Resolves to `{ name, description?, instructions?, tools }` for a namespace such as an MCP server, or `undefined`. |
35
+ | `models` | List and run non-LLM models. See [Models](#models). |
36
+
37
+ ## Call tools
38
+
39
+ Every tool the session can call is a method of `tools`, named by its identifier: characters that are not valid in a JavaScript identifier become `_`, so the MCP tool `mcp__dev-radius__search` is `tools.mcp__dev_radius__search`. Each method takes one object with the tool's arguments.
40
+
41
+ What a call resolves to depends on the tool:
42
+
43
+ - Tools with an output schema resolve to a structured value. `bash` resolves to `{ output, truncated, full_output_path?, exit_code, wall_time_seconds }`, also for non-zero exit codes. Its `output` is not limited to the 2000 lines or 50KB the model sees: it holds up to 1 MiB, and longer output keeps its first and last 512 KiB around an omission marker, with `truncated` set and the full output in `full_output_path`.
44
+ - MCP tools resolve to their `CallToolResult`, including `isError` and `structuredContent`.
45
+ - `read` resolves to the file's text, or for an image to an image block `{ type: "image", data, mimeType, note }` that `image()` shows. `data` is the base64 image the model would see and `note` the text that goes with it, such as resize hints.
46
+ - Other tools, such as `edit` and `write`, resolve to their text output.
47
+
48
+ A call that fails, is blocked, or gets invalid arguments rejects with an `Error` that carries the tool's error text. Use `Promise.allSettled()` to keep the results of the calls that succeed.
49
+
50
+ The `codemode` description lists tools with their TypeScript declarations, grouped by namespace (for example one MCP server). Tools with `deferred` exposure, which includes MCP tools with the default `codemode` exposure, are not listed, so the description stays the same while MCP servers connect. Listed declarations share a budget of 3000 estimated tokens (`codemode.inlineBudget` in [settings](settings.md#tools)). Scripts find the other tools with `searchTools()`, `describeTool()`, `describeNamespace()`, or by filtering `ALL_TOOLS`.
51
+
52
+ While `codemode` is active, `codemode.mode` in [settings](settings.md#tools) decides how the other tools are presented. With `on` (default) declared tools stay declared, and their descriptions say how to call them from scripts. With `only` they are hidden from the model and listed in the `codemode` description instead, so the model calls them through scripts. Tool declarations in the `codemode` description, `describeTool()`, and `ALL_TOOLS` carry the tools' prompt guidelines, since the system prompt rules only cover declared tools.
53
+
54
+ ## Store values
55
+
56
+ `store(key, value)` keeps a JSON value under a string key for later `codemode` calls; storing `undefined` deletes the key. `load(key)` returns the value, or `undefined`. Writes are kept only when the script succeeds: each successful script that stores values appends a `codemode-store` custom entry to the session, so resumed sessions keep the values and each branch sees only the values written on its path.
57
+
58
+ The store is for small state such as IDs, cursors, or summaries. One value may have at most 262144 characters of JSON and all values together at most 1048576. Do not store image data; show images with `image()`, which also saves them to a temp file.
59
+
60
+ ## Models
61
+
62
+ `models` reaches the model catalog and runs non-LLM models with the session's credentials: classifiers, which answer typed questions about JSON state and, for some models, images, and image models, which generate images. Chat models are listed but cannot be run from scripts. Which classifier and image models exist is described in [Use classifier models](models.md#use-classifier-models) and [Use image models](models.md#use-image-models).
63
+
64
+ ```ts
65
+ type ModelType = "chat" | "image" | "classifier";
66
+
67
+ /** A catalog entry. `provider` and `id` identify it; other fields depend on the type. */
68
+ interface ModelInfo {
69
+ type?: ModelType;
70
+ provider: string;
71
+ id: string;
72
+ name: string;
73
+ api: string;
74
+ input: ("text" | "image")[];
75
+ contextWindow?: number;
76
+ [key: string]: unknown;
77
+ }
78
+
79
+ declare const models: {
80
+ /** Every known model of a type, optionally for one provider. */
81
+ getModelsOfType(type: ModelType, provider?: string): Promise<ModelInfo[]>;
82
+ /** Models of a type whose provider has working credentials. */
83
+ getAvailableOfType(type: ModelType, provider?: string): Promise<ModelInfo[]>;
84
+ /** One catalog entry, or undefined. */
85
+ getModelOfType(type: ModelType, provider: string, id: string): Promise<ModelInfo | undefined>;
86
+ /** Answer `context.questions` about `context.state`; answers are in `result.answers` by question ID. */
87
+ classify(model: ModelInfo, context: ClassifierContext): Promise<ClassifierResult>;
88
+ /** Generate images from `context.input` text and image blocks; show `result.output` blocks with image(). Can take minutes. */
89
+ generateImages(model: ModelInfo, context: ImagesContext): Promise<ImagesResult>;
90
+ };
91
+ ```
92
+
93
+ `classify()` and `generateImages()` use only the `provider` and `id` of `model`, so `{ provider, id }` works as well. They do not throw on provider errors: check `stopReason` and `errorMessage`. At most four such calls run at once per script; more calls wait for a free slot, so `Promise.all()` over many items is fine. Their usage is added to the `codemode` tool result and counts toward the session cost.
94
+
95
+ Model IDs differ between providers, for example `typesafe/jev-latest` and `openrouter/typesafe/jev-1.13`. Use `models.getAvailableOfType(type)` to find the IDs that work with the current credentials.
96
+
97
+ ### Classify
98
+
99
+ ```ts
100
+ interface ClassifierContext {
101
+ /** The data to classify. */
102
+ state: Record<string, unknown>;
103
+ /** Images judged together with `state`. Only models whose `input` includes "image" accept them. */
104
+ images?: { type: "image"; data: string; mimeType: string }[];
105
+ /** Questions by ID. One call answers all of them. */
106
+ questions: Record<string, ClassifierQuestion>;
107
+ }
108
+
109
+ type ClassifierQuestion =
110
+ /** Pick one label. `criteria` maps each label to what it means. */
111
+ | { type: "choice"; instructions: string; criteria: Record<string, string> }
112
+ /** Score on an ordered scale. `criteria` describes each level, lowest first. */
113
+ | { type: "score"; instructions: string; criteria: string[] }
114
+ /** Yes or no. */
115
+ | { type: "bool"; instructions: string; criteria: { true: string; false: string } };
116
+
117
+ interface ClassifierResult {
118
+ provider: string;
119
+ model: string;
120
+ /** Answers by question ID. */
121
+ answers: Record<string, ClassifierAnswer>;
122
+ usage?: ModelUsage;
123
+ stopReason: "stop" | "error" | "aborted";
124
+ errorMessage?: string;
125
+ }
126
+
127
+ type ClassifierAnswer =
128
+ | { type: "choice"; choice: string; probabilities: Record<string, number>; confidence: number }
129
+ /** `score` is the expected level index, from 0 to `criteria.length - 1`. */
130
+ | { type: "score"; score: number; confidence: number }
131
+ /** Probability of `true`. */
132
+ | { type: "bool"; probability: number };
133
+
134
+ /** Token counts and cost in USD, when the service reports them. */
135
+ type ModelUsage = { input: number; output: number; totalTokens: number; cost: { total: number } };
136
+ ```
137
+
138
+ Classify several items by calling `classify()` once per item. This script sorts feedback messages, for example ones a tool returned earlier in the script:
139
+
140
+ ```js
141
+ const jev = await models.getModelOfType("classifier", "typesafe", "jev-latest");
142
+ const results = await Promise.all(
143
+ messages.map((message) =>
144
+ models.classify(jev, {
145
+ state: { message },
146
+ questions: {
147
+ sentiment: {
148
+ type: "choice",
149
+ instructions: "How does the user feel about the product?",
150
+ criteria: { positive: "Satisfied or happy", negative: "Unhappy or frustrated", neutral: "Neither" },
151
+ },
152
+ urgency: {
153
+ type: "score",
154
+ instructions: "How urgently does this need a reply?",
155
+ criteria: ["no reply needed", "reply this week", "reply today"],
156
+ },
157
+ },
158
+ }),
159
+ ),
160
+ );
161
+ return results.map((result, i) =>
162
+ result.stopReason === "stop"
163
+ ? { message: messages[i], sentiment: result.answers.sentiment.choice, urgency: result.answers.urgency.score }
164
+ : { message: messages[i], error: result.errorMessage },
165
+ );
166
+ ```
167
+
168
+ Classifiers whose `input` includes `"image"` also judge images. `tools.read()` returns an image file as an image block that `images` accepts. Other classifiers return an error result when `images` is not empty.
169
+
170
+ ```js
171
+ const luna = await models.getModelOfType("classifier", "openai", "gpt-6-luna");
172
+ const photo = await tools.read({ path: "screenshot.png" });
173
+ const result = await models.classify(luna, {
174
+ state: { task: "Settings page redesign" },
175
+ images: [photo],
176
+ questions: {
177
+ broken: {
178
+ type: "bool",
179
+ instructions: "Does the screenshot show a broken layout?",
180
+ criteria: { true: "Overlapping, cut-off, or misaligned elements", false: "Clean layout" },
181
+ },
182
+ },
183
+ });
184
+ ```
185
+
186
+ ### Generate images
187
+
188
+ ```ts
189
+ interface ImagesContext {
190
+ /** The prompt as text blocks, plus image blocks to edit or use as references. */
191
+ input: (TextBlock | ImageBlock)[];
192
+ }
193
+
194
+ interface ImagesResult {
195
+ provider: string;
196
+ model: string;
197
+ /** Generated images, and text blocks for models that also return text. */
198
+ output: (TextBlock | ImageBlock)[];
199
+ usage?: ModelUsage;
200
+ stopReason: "stop" | "error" | "aborted";
201
+ errorMessage?: string;
202
+ }
203
+
204
+ type TextBlock = { type: "text"; text: string };
205
+ /** `data` is base64. */
206
+ type ImageBlock = { type: "image"; data: string; mimeType: string };
207
+ ```
208
+
209
+ Show generated images with `image(block)`. Do not print `data` with `text()`, `console`, or `return`: it is large and the model cannot read it as text. `image()` also saves each image to a temp file and puts its path in the result, so a later turn can copy or move the file.
210
+
211
+ ```js
212
+ // @options: {"timeout_ms": 300000}
213
+ const painter = await models.getModelOfType("image", "openrouter", "google/gemini-2.5-flash-image");
214
+ const result = await models.generateImages(painter, {
215
+ input: [{ type: "text", text: "A red fox in the snow, watercolor" }],
216
+ });
217
+ if (result.stopReason !== "stop") return result.errorMessage;
218
+ for (const block of result.output) {
219
+ if (block.type === "image") image(block);
220
+ else text(block.text);
221
+ }
222
+ ```
223
+
224
+ ## Limits
225
+
226
+ - A script's VM has 256 MB of memory. Running out throws `InternalError: out of memory`; filter or aggregate large data instead of accumulating it.
227
+ - On Bun, stopping a script or reaching its deadline ends the call promptly, but a built-in that does not poll QuickJS's interrupt handler can keep computing in its worker until it returns.
228
+ - At most two codemode workers may be alive across all sessions in one pi process. A cancelled worker occupies its slot until it exits. At capacity, new scripts fail immediately without starting another worker; retry after an existing worker exits.
229
+ - A script that waits on a promise that can never settle (no tool call pending) fails immediately, since there are no timers.
230
+ - Scripts cannot start other `codemode` scripts.
@@ -1,6 +1,6 @@
1
- # Compaction & Branch Summarization
1
+ # Compaction Reference
2
2
 
3
- LLMs have limited context windows. When conversations grow too long, Pi uses compaction to summarize older content while preserving recent work. This page covers both auto-compaction and branch summarization.
3
+ This reference describes automatic compaction, branch summarization, persisted entries, and extension hooks. For the user workflow, see [Sessions and Context](sessions.md#manage-conversation-context).
4
4
 
5
5
  **Source files** ([pi](https://github.com/earendil-works/pi)):
6
6
  - [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
@@ -20,7 +20,7 @@ Pi has two summarization mechanisms:
20
20
  | Compaction | Context exceeds threshold, or `/compact` | Summarize old messages to free up context |
21
21
  | Branch summarization | `/tree` navigation | Preserve context when switching branches |
22
22
 
23
- Both use the same structured summary format and track file operations cumulatively. Compaction and branch-summary requests use fresh routing session IDs and, where supported by the provider, disable prompt-cache writes because these one-off prompts are unlikely to be reused.
23
+ Both use closely related structured formats and track file operations cumulatively. Summarization requests disable prompt-cache writes because these one-off prompts are unlikely to be reused.
24
24
 
25
25
  ## Compaction
26
26
 
@@ -34,14 +34,16 @@ contextTokens > contextWindow - reserveTokens
34
34
 
35
35
  By default, `reserveTokens` is 16384 tokens (configurable in `~/.pi/agent/settings.json` or `<project-dir>/.pi/settings.json`). This leaves room for the LLM's response.
36
36
 
37
- During a multi-turn agent run, Pi checks this threshold after tools finish and their results are appended, before starting the next assistant response. If the threshold is crossed, Pi compacts inside the same agent run and resumes with the summary and retained messages. It skips this between-turn check when the completed tool batch terminates the run and no queued message requires another response. Pi also checks the threshold before a new user prompt and after a low-level agent run ends.
37
+ During a multi-turn agent run, Pi checks the canonical projected context after tools finish and their results are appended, before starting the next assistant response. If the threshold is crossed, Pi compacts during `prepareNextTurn`, then performs the existing catch-up steering poll before `turn_start`. It skips this between-turn check when the completed tool batch terminates the run and no queued message requires another response. Pi also checks before a new user prompt and performs final-attempt overflow recovery after the low-level run ends.
38
+
39
+ A provider context-overflow error or an early final `stopReason: "length"` can select one compact-and-retry recovery attempt. Length responses with tool calls retain their synthetic failed tool results and follow the ordinary tool/queue scheduler rather than forcing the run to end.
38
40
 
39
41
  You can also trigger manually with `/compact [instructions]`, where optional instructions focus the summary.
40
42
 
41
43
  ### How It Works
42
44
 
43
- 1. **Find cut point**: Walk backwards from newest message, accumulating token estimates until `keepRecentTokens` (default 20k, configurable in `~/.pi/agent/settings.json` or `<project-dir>/.pi/settings.json`) is reached
44
- 2. **Extract messages**: Collect messages from the previous kept boundary (or session start) up to the cut point
45
+ 1. **Find cut point**: Walk backwards through the finalized session projection, accumulating token estimates until `keepRecentTokens` (default 20k, configurable in `~/.pi/agent/settings.json` or `<project-dir>/.pi/settings.json`) is reached
46
+ 2. **Extract messages**: Collect projected messages from the previous kept boundary (or session start) up to the cut point
45
47
  3. **Generate summary**: Call LLM to summarize with structured format, passing the previous summary as iterative context when present
46
48
  4. **Append entry**: Save `CompactionEntry` with summary and `firstKeptEntryId`
47
49
  5. **Rebuilds context**: Session rebuilds the context for the next request, using summary + messages from `firstKeptEntryId` onwards
@@ -78,16 +80,31 @@ What the LLM sees:
78
80
  prompt from cmp messages from firstKeptEntryId
79
81
  ```
80
82
 
81
- On repeated compactions, the summarized span starts at the previous compaction's kept boundary (`firstKeptEntryId`), not at the compaction entry itself, falling back to the entry after the previous compaction if that kept entry cannot be found in the path. This preserves messages that survived the earlier compaction by including them in the next summarization pass as well. Pi also recalculates `tokensBefore` from the rebuilt session context before writing the new `CompactionEntry`, so the token count reflects the actual pre-compaction context being replaced.
83
+ On repeated compactions, the summarized span starts at the previous compaction's kept boundary (`firstKeptEntryId`), not at the compaction entry itself, falling back to the entry after the previous compaction if that kept entry cannot be found in the path. A retain-none compaction records its own ID as `firstKeptEntryId`; repeated compaction starts after that entry. This preserves messages that survived the earlier compaction by including them in the next summarization pass as well. Pi also recalculates `tokensBefore` from the rebuilt, context-edited session projection before writing the new `CompactionEntry`, so the token count reflects the actual pre-compaction context being replaced. Omitted raw entries remain stored but do not affect cut selection, summaries, checkpoints, or token estimates.
84
+
85
+ ### Overflow and Length Recovery Ordering
86
+
87
+ Recovery preserves the existing lifecycle and queue order. The completed attempt remains visible to `turn_end` and `agent_end`; post-run recovery then repairs persisted model context before a fresh retry:
88
+
89
+ ```text
90
+ persist final assistant response
91
+ → extension/public turn_end
92
+ → extension/public agent_end
93
+ → append context_edit omissions for the selected attempt
94
+ → for overflow/length: run session_before_compact and append compaction on success
95
+ → start the retry as a fresh run
96
+ ```
82
97
 
83
- ### Split Turns
98
+ If recovery compaction fails or is cancelled, Pi keeps the omission edits, appends no compaction, and schedules no internal retry. Existing queued work remains governed by ordinary steering and follow-up rules. `agent_before_settle` sees the repaired projection after recovery processing. Raw transcript history, exports, billing totals, and history-search extensions can still inspect the omitted attempt.
84
99
 
85
- A "turn" starts with a user message and includes all assistant responses and tool calls until the next user message. Normally, compaction cuts at turn boundaries.
100
+ ### Split user-message spans
86
101
 
87
- When a single turn exceeds `keepRecentTokens`, the cut point lands mid-turn at an assistant message. This is a "split turn":
102
+ A user-message span starts with a user message and includes all turns until the next user message. Normally, compaction cuts at user-message boundaries.
103
+
104
+ When one user-message span exceeds `keepRecentTokens`, the cut point lands within that span at an assistant message. This is a split user-message span:
88
105
 
89
106
  ```
90
- Split turn (one huge turn exceeds budget):
107
+ Split user-message span (one span exceeds budget):
91
108
 
92
109
  entry: 0 1 2 3 4 5 6 7 8
93
110
  ┌─────┬─────┬─────┬──────┬─────┬──────┬──────┬─────┬──────┐
@@ -100,13 +117,13 @@ Split turn (one huge turn exceeds budget):
100
117
  └── kept (7-8)
101
118
 
102
119
  isSplitTurn = true
103
- messagesToSummarize = [] (no complete turns before)
120
+ messagesToSummarize = [] (no earlier user-message spans)
104
121
  turnPrefixMessages = [usr, ass, tool, ass, tool, tool]
105
122
  ```
106
123
 
107
- For split turns, Pi generates two summaries and merges them:
124
+ For split user-message spans, Pi generates two summaries and merges them:
108
125
  1. **History summary**: Previous context (if any)
109
- 2. **Turn prefix summary**: The early part of the split turn
126
+ 2. **User-message-span prefix summary**: The early part of the split user-message span
110
127
 
111
128
  ### Cut Point Rules
112
129
 
@@ -118,6 +135,8 @@ Valid cut points are:
118
135
 
119
136
  Never cut at tool results (they must stay with their tool call).
120
137
 
138
+ Preparation advances the kept boundary into a context-invisible suffix only when that suffix contains an omitted assistant attempt and no unomitted context-producing entries. Recovery `context_edit` omissions satisfy this rule; intrinsically context-invisible metadata may coexist with them. Metadata alone and newly appended custom messages do not move the cut. A replacement edit affecting the candidate input or summarized prefix also blocks advancement because the omitted assistant answered the pre-edit input; replacements of suffix entries that are ultimately omitted remain safe. This allows an over-budget recovered input to be summarized while retaining the edits that keep the abandoned attempt omitted, without making bookkeeping change whether new model input is preserved verbatim.
139
+
121
140
  ### CompactionEntry Structure
122
141
 
123
142
  Defined in [`session-manager.ts`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/session-manager.ts):
@@ -126,8 +145,8 @@ Defined in [`session-manager.ts`](https://github.com/earendil-works/pi/blob/main
126
145
  interface CompactionEntry<T = unknown> {
127
146
  type: "compaction";
128
147
  id: string;
129
- parentId: string;
130
- timestamp: number;
148
+ parentId: string | null;
149
+ timestamp: string;
131
150
  summary: string;
132
151
  firstKeptEntryId: string;
133
152
  tokensBefore: number;
@@ -180,11 +199,9 @@ After navigation with summary:
180
199
 
181
200
  ### Cumulative File Tracking
182
201
 
183
- Both compaction and branch summarization track files cumulatively. When generating a summary, pi extracts file operations from:
184
- - Tool calls in the messages being summarized
185
- - Previous compaction or branch summary `details` (if any)
202
+ Default compaction and branch summarization track files cumulatively. Both extract file operations from tool calls in the messages being summarized. Compaction also carries file lists from the previous Pi-generated compaction. Branch summarization carries file lists from Pi-generated branch summaries in the entries it summarizes.
186
203
 
187
- This means file tracking accumulates across multiple compactions or nested branch summaries, preserving the full history of read and modified files.
204
+ File tracking therefore accumulates across default compactions and nested default branch summaries. Pi does not automatically carry file lists from extension-generated summaries whose `fromHook` field is `true`; extensions manage their own `details` format.
188
205
 
189
206
  ### BranchSummaryEntry Structure
190
207
 
@@ -194,8 +211,8 @@ Defined in [`session-manager.ts`](https://github.com/earendil-works/pi/blob/main
194
211
  interface BranchSummaryEntry<T = unknown> {
195
212
  type: "branch_summary";
196
213
  id: string;
197
- parentId: string;
198
- timestamp: number;
214
+ parentId: string | null;
215
+ timestamp: string;
199
216
  summary: string;
200
217
  fromId: string; // Entry we navigated from
201
218
  usage?: Usage; // LLM usage that generated the summary
@@ -216,7 +233,9 @@ See [`collectEntriesForBranchSummary()`](https://github.com/earendil-works/pi/bl
216
233
 
217
234
  ## Summary Format
218
235
 
219
- Both compaction and branch summarization use the same structured format:
236
+ Both formats include Goal, Constraints & Preferences, Progress, Key Decisions, and Next Steps. Compaction summaries also include Critical Context. Branch summaries stop after Next Steps. Pi appends file lists to either format when relevant.
237
+
238
+ Compaction summaries use this format:
220
239
 
221
240
  ```markdown
222
241
  ## Goal
@@ -260,7 +279,6 @@ Before summarization, messages are serialized to text via [`serializeConversatio
260
279
 
261
280
  ```
262
281
  [User]: What they said
263
- [Assistant thinking]: Internal reasoning
264
282
  [Assistant]: Response text
265
283
  [Assistant tool calls]: read(path="foo.ts"); edit(path="bar.ts", ...)
266
284
  [Tool result]: Output from tool
@@ -268,6 +286,8 @@ Before summarization, messages are serialized to text via [`serializeConversatio
268
286
 
269
287
  This prevents the model from treating it as a conversation to continue.
270
288
 
289
+ Thinking blocks are omitted. Providers return summaries of the real reasoning, and replayed thinking is often not part of the model's live context, so including it could make the summarization request larger than the context it summarizes.
290
+
271
291
  Tool results are truncated to 2000 characters during serialization. Content beyond that limit is replaced with a marker indicating how many characters were truncated. This keeps summarization requests within reasonable token budgets, since tool results (especially from `read` and `bash`) are typically the largest contributors to context size.
272
292
 
273
293
  ## Custom Summarization via Extensions
@@ -283,7 +303,7 @@ pi.on("session_before_compact", async (event, ctx) => {
283
303
  const { preparation, branchEntries, customInstructions, reason, willRetry, signal } = event;
284
304
 
285
305
  // preparation.messagesToSummarize - messages to summarize
286
- // preparation.turnPrefixMessages - split turn prefix (if isSplitTurn)
306
+ // preparation.turnPrefixMessages - user-message-span prefix (if isSplitTurn)
287
307
  // preparation.previousSummary - previous compaction summary
288
308
  // preparation.fileOps - extracted file operations
289
309
  // preparation.tokensBefore - context tokens before compaction
@@ -327,7 +347,6 @@ pi.on("session_before_compact", async (event, ctx) => {
327
347
  );
328
348
  // Returns:
329
349
  // [User]: message text
330
- // [Assistant thinking]: thinking content
331
350
  // [Assistant]: response text
332
351
  // [Assistant tool calls]: read(path="..."); bash(command="...")
333
352
  // [Tool result]: output text
@@ -357,7 +376,7 @@ pi.on("session_compact_failed", async (event, ctx) => {
357
376
  const { reason, errorMessage, aborted, willRetry, fromExtension } = event;
358
377
  // reason - "manual" (/compact), "threshold", or "overflow"
359
378
  // errorMessage - present for non-abort failures
360
- // aborted - true for cancelled/aborted compactions
379
+ // aborted - true for canceled/aborted compactions
361
380
  // willRetry - whether the aborted turn would have retried after compaction
362
381
  // fromExtension - whether extension-provided compaction content was being used
363
382
  });
@@ -441,4 +460,4 @@ Keys are exact, case-sensitive `provider/modelId` values, including any slashes
441
460
 
442
461
  These resolved values are used for manual compaction, all automatic threshold checks, overflow recovery, and extension-visible `preparation.settings`. Model switches affect subsequent checks and compactions without changing ordinary settings. Compaction already in progress uses the model and settings captured for that operation. Branch summarization settings are unaffected.
443
462
 
444
- Overrides work in both global and project settings. The files merge recursively before lookup, so a global model-specific value beats a project-wide fallback; a project must override that model entry to change it. See [settings.md](settings.md#per-model-compaction-overrides) for details.
463
+ Overrides work in both global and project settings. The files merge recursively before lookup, so a global model-specific value beats a project-wide fallback; a project must override that model entry to change it. See [Settings](settings.md#per-model-compaction-overrides) for details.
@@ -0,0 +1,47 @@
1
+ # Configuration
2
+
3
+ Pi supports user-level and project configuration. User-level configuration lives in the agent directory, which defaults to `~/.pi/agent`. Project configuration lives in `.pi` under the working directory and loads after [project trust](security.md#understand-project-trust) is granted. The only exception is `sessionDir`, which Pi reads before resolving trust so it can locate sessions.
4
+
5
+ In interactive mode, use `/settings` to change common preferences. For other options, ask Pi to update the configuration or edit the relevant files directly. Run `/reload` after manually changing settings, keybindings, instructions, or resources.
6
+
7
+ ## Agent directory
8
+
9
+ The agent directory is shown as `<agent-dir>` below. Set its location with the `PI_CODING_AGENT_DIR` environment variable or the SDK's [`agentDir`](sdk.md) option.
10
+
11
+ | Path | Responsibility |
12
+ |---|---|
13
+ | `<agent-dir>/settings.json` | User-level [settings](settings.md), including preferences, defaults, resource paths, and Pi package declarations. |
14
+ | `<agent-dir>/keybindings.json` | Custom terminal UI and application [keybindings](keybindings.md). |
15
+ | `<agent-dir>/mcp.json` | [MCP servers](mcp.md) available in every project. |
16
+ | `<agent-dir>/models.json` | [Compatible endpoints, models, and model overrides](models.md#configure-a-compatible-endpoint). |
17
+ | `<agent-dir>/auth.json` | Saved API keys and OAuth credentials. |
18
+ | `<agent-dir>/AGENTS.override.md`, `AGENTS.md`, `AGENTS.MD`, `CLAUDE.md`, or `CLAUDE.MD` | User instructions applied across working directories. |
19
+ | `<agent-dir>/SYSTEM.md` | Replaces Pi’s default system prompt. |
20
+ | `<agent-dir>/APPEND_SYSTEM.md` | Adds instructions to Pi’s system prompt. |
21
+ | `<agent-dir>/extensions/` | User [extensions](extensions.md). |
22
+ | `<agent-dir>/skills/` | User [skills](skills.md) and supporting files. |
23
+ | `<agent-dir>/prompts/` | User [prompt templates](prompt-templates.md) exposed as slash commands. |
24
+ | `<agent-dir>/themes/` | User [theme](themes.md) files. |
25
+
26
+ ## Project `.pi` directory
27
+
28
+ | Path | Responsibility |
29
+ |---|---|
30
+ | `.pi/settings.json` | Project-level [settings](settings.md), resource paths, and Pi package declarations. |
31
+ | `.pi/mcp.json` | Project [MCP servers](mcp.md). |
32
+ | `.pi/SYSTEM.md` | Replaces the system prompt for the project. |
33
+ | `.pi/APPEND_SYSTEM.md` | Adds project-specific instructions to the system prompt. |
34
+ | `.pi/extensions/` | Project extensions. |
35
+ | `.pi/skills/` | Project skills and supporting files. |
36
+ | `.pi/prompts/` | Project prompt templates exposed as slash commands. |
37
+ | `.pi/themes/` | Project theme files. |
38
+
39
+ For `SYSTEM.md` and `APPEND_SYSTEM.md`, the trusted project file takes precedence over the corresponding agent-directory file. Files with the same name are not combined.
40
+
41
+ ## Context files
42
+
43
+ Context files are separate from project `.pi` configuration. Pi loads them from the agent directory, the working directory, and its parent directories. A context file applies whenever Pi runs in its directory or anywhere below it.
44
+
45
+ An `AGENTS.override.md` replaces `AGENTS.md` or `CLAUDE.md` only in the same directory. It does not suppress context files from the agent directory or other directories.
46
+
47
+ Context-file discovery does not require project trust.