@eminent337/aery 0.1.58 → 0.1.60

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 (714) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/README.md +0 -0
  3. package/dist/bun/cli.d.ts +3 -0
  4. package/dist/bun/cli.d.ts.map +1 -0
  5. package/dist/bun/cli.js +8 -0
  6. package/dist/bun/cli.js.map +1 -0
  7. package/dist/bun/register-bedrock.d.ts +2 -0
  8. package/dist/bun/register-bedrock.d.ts.map +1 -0
  9. package/dist/bun/register-bedrock.js +4 -0
  10. package/dist/bun/register-bedrock.js.map +1 -0
  11. package/dist/bun/restore-sandbox-env.d.ts +13 -0
  12. package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
  13. package/dist/bun/restore-sandbox-env.js +32 -0
  14. package/dist/bun/restore-sandbox-env.js.map +1 -0
  15. package/dist/cli/args.d.ts +53 -0
  16. package/dist/cli/args.d.ts.map +1 -0
  17. package/dist/cli/args.js +329 -0
  18. package/dist/cli/args.js.map +1 -0
  19. package/dist/cli/config-selector.d.ts +14 -0
  20. package/dist/cli/config-selector.d.ts.map +1 -0
  21. package/dist/cli/config-selector.js +31 -0
  22. package/dist/cli/config-selector.js.map +1 -0
  23. package/dist/cli/file-processor.d.ts +15 -0
  24. package/dist/cli/file-processor.d.ts.map +1 -0
  25. package/dist/cli/file-processor.js +83 -0
  26. package/dist/cli/file-processor.js.map +1 -0
  27. package/dist/cli/initial-message.d.ts +18 -0
  28. package/dist/cli/initial-message.d.ts.map +1 -0
  29. package/dist/cli/initial-message.js +22 -0
  30. package/dist/cli/initial-message.js.map +1 -0
  31. package/dist/cli/list-models.d.ts +9 -0
  32. package/dist/cli/list-models.d.ts.map +1 -0
  33. package/dist/cli/list-models.js +98 -0
  34. package/dist/cli/list-models.js.map +1 -0
  35. package/dist/cli/session-picker.d.ts +9 -0
  36. package/dist/cli/session-picker.d.ts.map +1 -0
  37. package/dist/cli/session-picker.js +35 -0
  38. package/dist/cli/session-picker.js.map +1 -0
  39. package/dist/cli.d.ts +3 -0
  40. package/dist/cli.d.ts.map +1 -0
  41. package/dist/cli.js +19 -0
  42. package/dist/cli.js.map +1 -0
  43. package/dist/config.d.ts +86 -0
  44. package/dist/config.d.ts.map +1 -0
  45. package/dist/config.js +332 -0
  46. package/dist/config.js.map +1 -0
  47. package/dist/core/agent-session-runtime.d.ts +117 -0
  48. package/dist/core/agent-session-runtime.d.ts.map +1 -0
  49. package/dist/core/agent-session-runtime.js +300 -0
  50. package/dist/core/agent-session-runtime.js.map +1 -0
  51. package/dist/core/agent-session-services.d.ts +86 -0
  52. package/dist/core/agent-session-services.d.ts.map +1 -0
  53. package/dist/core/agent-session-services.js +117 -0
  54. package/dist/core/agent-session-services.js.map +1 -0
  55. package/dist/core/agent-session.d.ts +595 -0
  56. package/dist/core/agent-session.d.ts.map +1 -0
  57. package/dist/core/agent-session.js +2520 -0
  58. package/dist/core/agent-session.js.map +1 -0
  59. package/dist/core/auth-guidance.d.ts +5 -0
  60. package/dist/core/auth-guidance.d.ts.map +1 -0
  61. package/dist/core/auth-guidance.js +21 -0
  62. package/dist/core/auth-guidance.js.map +1 -0
  63. package/dist/core/auth-storage.d.ts +141 -0
  64. package/dist/core/auth-storage.d.ts.map +1 -0
  65. package/dist/core/auth-storage.js +441 -0
  66. package/dist/core/auth-storage.js.map +1 -0
  67. package/dist/core/bash-executor.d.ts +32 -0
  68. package/dist/core/bash-executor.d.ts.map +1 -0
  69. package/dist/core/bash-executor.js +111 -0
  70. package/dist/core/bash-executor.js.map +1 -0
  71. package/dist/core/compaction/branch-summarization.d.ts +88 -0
  72. package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
  73. package/dist/core/compaction/branch-summarization.js +243 -0
  74. package/dist/core/compaction/branch-summarization.js.map +1 -0
  75. package/dist/core/compaction/compaction.d.ts +121 -0
  76. package/dist/core/compaction/compaction.d.ts.map +1 -0
  77. package/dist/core/compaction/compaction.js +615 -0
  78. package/dist/core/compaction/compaction.js.map +1 -0
  79. package/dist/core/compaction/index.d.ts +7 -0
  80. package/dist/core/compaction/index.d.ts.map +1 -0
  81. package/dist/core/compaction/index.js +7 -0
  82. package/dist/core/compaction/index.js.map +1 -0
  83. package/dist/core/compaction/utils.d.ts +38 -0
  84. package/dist/core/compaction/utils.d.ts.map +1 -0
  85. package/dist/core/compaction/utils.js +153 -0
  86. package/dist/core/compaction/utils.js.map +1 -0
  87. package/dist/core/defaults.d.ts +3 -0
  88. package/dist/core/defaults.d.ts.map +1 -0
  89. package/dist/core/defaults.js +2 -0
  90. package/dist/core/defaults.js.map +1 -0
  91. package/dist/core/diagnostics.d.ts +15 -0
  92. package/dist/core/diagnostics.d.ts.map +1 -0
  93. package/dist/core/diagnostics.js +2 -0
  94. package/dist/core/diagnostics.js.map +1 -0
  95. package/dist/core/event-bus.d.ts +9 -0
  96. package/dist/core/event-bus.d.ts.map +1 -0
  97. package/dist/core/event-bus.js +25 -0
  98. package/dist/core/event-bus.js.map +1 -0
  99. package/dist/core/exec.d.ts +29 -0
  100. package/dist/core/exec.d.ts.map +1 -0
  101. package/dist/core/exec.js +75 -0
  102. package/dist/core/exec.js.map +1 -0
  103. package/dist/core/export-html/ansi-to-html.d.ts +22 -0
  104. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
  105. package/dist/core/export-html/ansi-to-html.js +249 -0
  106. package/dist/core/export-html/ansi-to-html.js.map +1 -0
  107. package/dist/core/export-html/index.d.ts +37 -0
  108. package/dist/core/export-html/index.d.ts.map +1 -0
  109. package/dist/core/export-html/index.js +224 -0
  110. package/dist/core/export-html/index.js.map +1 -0
  111. package/dist/core/export-html/template.css +1022 -0
  112. package/dist/core/export-html/template.html +55 -0
  113. package/dist/core/export-html/template.js +1770 -0
  114. package/dist/core/export-html/tool-renderer.d.ts +34 -0
  115. package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
  116. package/dist/core/export-html/tool-renderer.js +108 -0
  117. package/dist/core/export-html/tool-renderer.js.map +1 -0
  118. package/dist/core/export-html/vendor/highlight.min.js +1213 -0
  119. package/dist/core/export-html/vendor/marked.min.js +6 -0
  120. package/dist/core/extensions/index.d.ts +12 -0
  121. package/dist/core/extensions/index.d.ts.map +1 -0
  122. package/dist/core/extensions/index.js +9 -0
  123. package/dist/core/extensions/index.js.map +1 -0
  124. package/dist/core/extensions/loader.d.ts +25 -0
  125. package/dist/core/extensions/loader.d.ts.map +1 -0
  126. package/dist/core/extensions/loader.js +476 -0
  127. package/dist/core/extensions/loader.js.map +1 -0
  128. package/dist/core/extensions/runner.d.ts +158 -0
  129. package/dist/core/extensions/runner.d.ts.map +1 -0
  130. package/dist/core/extensions/runner.js +784 -0
  131. package/dist/core/extensions/runner.js.map +1 -0
  132. package/dist/core/extensions/types.d.ts +1153 -0
  133. package/dist/core/extensions/types.d.ts.map +1 -0
  134. package/dist/core/extensions/types.js +45 -0
  135. package/dist/core/extensions/types.js.map +1 -0
  136. package/dist/core/extensions/wrapper.d.ts +20 -0
  137. package/dist/core/extensions/wrapper.d.ts.map +1 -0
  138. package/dist/core/extensions/wrapper.js +22 -0
  139. package/dist/core/extensions/wrapper.js.map +1 -0
  140. package/dist/core/footer-data-provider.d.ts +52 -0
  141. package/dist/core/footer-data-provider.d.ts.map +1 -0
  142. package/dist/core/footer-data-provider.js +310 -0
  143. package/dist/core/footer-data-provider.js.map +1 -0
  144. package/dist/core/index.d.ts +12 -0
  145. package/dist/core/index.d.ts.map +1 -0
  146. package/dist/core/index.js +12 -0
  147. package/dist/core/index.js.map +1 -0
  148. package/dist/core/keybindings.d.ts +353 -0
  149. package/dist/core/keybindings.d.ts.map +1 -0
  150. package/dist/core/keybindings.js +295 -0
  151. package/dist/core/keybindings.js.map +1 -0
  152. package/dist/core/messages.d.ts +77 -0
  153. package/dist/core/messages.d.ts.map +1 -0
  154. package/dist/core/messages.js +123 -0
  155. package/dist/core/messages.js.map +1 -0
  156. package/dist/core/model-registry.d.ts +144 -0
  157. package/dist/core/model-registry.d.ts.map +1 -0
  158. package/dist/core/model-registry.js +699 -0
  159. package/dist/core/model-registry.js.map +1 -0
  160. package/dist/core/model-resolver.d.ts +110 -0
  161. package/dist/core/model-resolver.d.ts.map +1 -0
  162. package/dist/core/model-resolver.js +489 -0
  163. package/dist/core/model-resolver.js.map +1 -0
  164. package/dist/core/output-guard.d.ts +6 -0
  165. package/dist/core/output-guard.d.ts.map +1 -0
  166. package/dist/core/output-guard.js +59 -0
  167. package/dist/core/output-guard.js.map +1 -0
  168. package/dist/core/package-manager.d.ts +199 -0
  169. package/dist/core/package-manager.d.ts.map +1 -0
  170. package/dist/core/package-manager.js +1973 -0
  171. package/dist/core/package-manager.js.map +1 -0
  172. package/dist/core/prompt-templates.d.ts +52 -0
  173. package/dist/core/prompt-templates.d.ts.map +1 -0
  174. package/dist/core/prompt-templates.js +250 -0
  175. package/dist/core/prompt-templates.js.map +1 -0
  176. package/dist/core/resolve-config-value.d.ts +23 -0
  177. package/dist/core/resolve-config-value.d.ts.map +1 -0
  178. package/dist/core/resolve-config-value.js +126 -0
  179. package/dist/core/resolve-config-value.js.map +1 -0
  180. package/dist/core/resource-loader.d.ts +194 -0
  181. package/dist/core/resource-loader.d.ts.map +1 -0
  182. package/dist/core/resource-loader.js +727 -0
  183. package/dist/core/resource-loader.js.map +1 -0
  184. package/dist/core/sdk.d.ts +107 -0
  185. package/dist/core/sdk.d.ts.map +1 -0
  186. package/dist/core/sdk.js +274 -0
  187. package/dist/core/sdk.js.map +1 -0
  188. package/dist/core/session-cwd.d.ts +19 -0
  189. package/dist/core/session-cwd.d.ts.map +1 -0
  190. package/dist/core/session-cwd.js +38 -0
  191. package/dist/core/session-cwd.js.map +1 -0
  192. package/dist/core/session-manager.d.ts +333 -0
  193. package/dist/core/session-manager.d.ts.map +1 -0
  194. package/dist/core/session-manager.js +1109 -0
  195. package/dist/core/session-manager.js.map +1 -0
  196. package/dist/core/settings-manager.d.ts +261 -0
  197. package/dist/core/settings-manager.d.ts.map +1 -0
  198. package/dist/core/settings-manager.js +782 -0
  199. package/dist/core/settings-manager.js.map +1 -0
  200. package/dist/core/skills.d.ts +60 -0
  201. package/dist/core/skills.d.ts.map +1 -0
  202. package/dist/core/skills.js +404 -0
  203. package/dist/core/skills.js.map +1 -0
  204. package/dist/core/slash-commands.d.ts +14 -0
  205. package/dist/core/slash-commands.d.ts.map +1 -0
  206. package/dist/core/slash-commands.js +25 -0
  207. package/dist/core/slash-commands.js.map +1 -0
  208. package/dist/core/source-info.d.ts +18 -0
  209. package/dist/core/source-info.d.ts.map +1 -0
  210. package/dist/core/source-info.js +19 -0
  211. package/dist/core/source-info.js.map +1 -0
  212. package/dist/core/system-prompt.d.ts +28 -0
  213. package/dist/core/system-prompt.d.ts.map +1 -0
  214. package/dist/core/system-prompt.js +120 -0
  215. package/dist/core/system-prompt.js.map +1 -0
  216. package/dist/core/telemetry.d.ts +3 -0
  217. package/dist/core/telemetry.d.ts.map +1 -0
  218. package/dist/core/telemetry.js +9 -0
  219. package/dist/core/telemetry.js.map +1 -0
  220. package/dist/core/timings.d.ts +8 -0
  221. package/dist/core/timings.d.ts.map +1 -0
  222. package/dist/core/timings.js +31 -0
  223. package/dist/core/timings.js.map +1 -0
  224. package/dist/core/tools/bash.d.ts +68 -0
  225. package/dist/core/tools/bash.d.ts.map +1 -0
  226. package/dist/core/tools/bash.js +355 -0
  227. package/dist/core/tools/bash.js.map +1 -0
  228. package/dist/core/tools/edit-diff.d.ts +85 -0
  229. package/dist/core/tools/edit-diff.d.ts.map +1 -0
  230. package/dist/core/tools/edit-diff.js +337 -0
  231. package/dist/core/tools/edit-diff.js.map +1 -0
  232. package/dist/core/tools/edit.d.ts +49 -0
  233. package/dist/core/tools/edit.d.ts.map +1 -0
  234. package/dist/core/tools/edit.js +323 -0
  235. package/dist/core/tools/edit.js.map +1 -0
  236. package/dist/core/tools/file-mutation-queue.d.ts +6 -0
  237. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
  238. package/dist/core/tools/file-mutation-queue.js +37 -0
  239. package/dist/core/tools/file-mutation-queue.js.map +1 -0
  240. package/dist/core/tools/find.d.ts +35 -0
  241. package/dist/core/tools/find.d.ts.map +1 -0
  242. package/dist/core/tools/find.js +298 -0
  243. package/dist/core/tools/find.js.map +1 -0
  244. package/dist/core/tools/grep.d.ts +37 -0
  245. package/dist/core/tools/grep.d.ts.map +1 -0
  246. package/dist/core/tools/grep.js +304 -0
  247. package/dist/core/tools/grep.js.map +1 -0
  248. package/dist/core/tools/index.d.ts +40 -0
  249. package/dist/core/tools/index.d.ts.map +1 -0
  250. package/dist/core/tools/index.js +112 -0
  251. package/dist/core/tools/index.js.map +1 -0
  252. package/dist/core/tools/ls.d.ts +37 -0
  253. package/dist/core/tools/ls.d.ts.map +1 -0
  254. package/dist/core/tools/ls.js +169 -0
  255. package/dist/core/tools/ls.js.map +1 -0
  256. package/dist/core/tools/path-utils.d.ts +8 -0
  257. package/dist/core/tools/path-utils.d.ts.map +1 -0
  258. package/dist/core/tools/path-utils.js +81 -0
  259. package/dist/core/tools/path-utils.js.map +1 -0
  260. package/dist/core/tools/read.d.ts +35 -0
  261. package/dist/core/tools/read.d.ts.map +1 -0
  262. package/dist/core/tools/read.js +232 -0
  263. package/dist/core/tools/read.js.map +1 -0
  264. package/dist/core/tools/render-utils.d.ts +21 -0
  265. package/dist/core/tools/render-utils.d.ts.map +1 -0
  266. package/dist/core/tools/render-utils.js +49 -0
  267. package/dist/core/tools/render-utils.js.map +1 -0
  268. package/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
  269. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
  270. package/dist/core/tools/tool-definition-wrapper.js +34 -0
  271. package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
  272. package/dist/core/tools/truncate.d.ts +70 -0
  273. package/dist/core/tools/truncate.d.ts.map +1 -0
  274. package/dist/core/tools/truncate.js +205 -0
  275. package/dist/core/tools/truncate.js.map +1 -0
  276. package/dist/core/tools/write.d.ts +26 -0
  277. package/dist/core/tools/write.d.ts.map +1 -0
  278. package/dist/core/tools/write.js +213 -0
  279. package/dist/core/tools/write.js.map +1 -0
  280. package/dist/index.d.ts +28 -0
  281. package/dist/index.d.ts.map +1 -0
  282. package/dist/index.js +41 -0
  283. package/dist/index.js.map +1 -0
  284. package/dist/main.d.ts +12 -0
  285. package/dist/main.d.ts.map +1 -0
  286. package/dist/main.js +589 -0
  287. package/dist/main.js.map +1 -0
  288. package/dist/migrations.d.ts +33 -0
  289. package/dist/migrations.d.ts.map +1 -0
  290. package/dist/migrations.js +281 -0
  291. package/dist/migrations.js.map +1 -0
  292. package/dist/modes/index.d.ts +9 -0
  293. package/dist/modes/index.d.ts.map +1 -0
  294. package/dist/modes/index.js +8 -0
  295. package/dist/modes/index.js.map +1 -0
  296. package/dist/modes/interactive/assets/clankolas.png +0 -0
  297. package/dist/modes/interactive/components/aery-splash.d.ts +18 -0
  298. package/dist/modes/interactive/components/aery-splash.d.ts.map +1 -0
  299. package/dist/modes/interactive/components/aery-splash.js +60 -0
  300. package/dist/modes/interactive/components/aery-splash.js.map +1 -0
  301. package/dist/modes/interactive/components/armin.d.ts +34 -0
  302. package/dist/modes/interactive/components/armin.d.ts.map +1 -0
  303. package/dist/modes/interactive/components/armin.js +333 -0
  304. package/dist/modes/interactive/components/armin.js.map +1 -0
  305. package/dist/modes/interactive/components/assistant-message.d.ts +20 -0
  306. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
  307. package/dist/modes/interactive/components/assistant-message.js +121 -0
  308. package/dist/modes/interactive/components/assistant-message.js.map +1 -0
  309. package/dist/modes/interactive/components/bash-execution.d.ts +34 -0
  310. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
  311. package/dist/modes/interactive/components/bash-execution.js +175 -0
  312. package/dist/modes/interactive/components/bash-execution.js.map +1 -0
  313. package/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
  314. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
  315. package/dist/modes/interactive/components/bordered-loader.js +54 -0
  316. package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
  317. package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
  318. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
  319. package/dist/modes/interactive/components/branch-summary-message.js +44 -0
  320. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
  321. package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
  322. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
  323. package/dist/modes/interactive/components/compaction-summary-message.js +45 -0
  324. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
  325. package/dist/modes/interactive/components/config-selector.d.ts +71 -0
  326. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
  327. package/dist/modes/interactive/components/config-selector.js +481 -0
  328. package/dist/modes/interactive/components/config-selector.js.map +1 -0
  329. package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
  330. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
  331. package/dist/modes/interactive/components/countdown-timer.js +33 -0
  332. package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
  333. package/dist/modes/interactive/components/custom-editor.d.ts +21 -0
  334. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
  335. package/dist/modes/interactive/components/custom-editor.js +70 -0
  336. package/dist/modes/interactive/components/custom-editor.js.map +1 -0
  337. package/dist/modes/interactive/components/custom-message.d.ts +20 -0
  338. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
  339. package/dist/modes/interactive/components/custom-message.js +79 -0
  340. package/dist/modes/interactive/components/custom-message.js.map +1 -0
  341. package/dist/modes/interactive/components/daxnuts.d.ts +23 -0
  342. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
  343. package/dist/modes/interactive/components/daxnuts.js +140 -0
  344. package/dist/modes/interactive/components/daxnuts.js.map +1 -0
  345. package/dist/modes/interactive/components/diff.d.ts +12 -0
  346. package/dist/modes/interactive/components/diff.d.ts.map +1 -0
  347. package/dist/modes/interactive/components/diff.js +133 -0
  348. package/dist/modes/interactive/components/diff.js.map +1 -0
  349. package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
  350. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
  351. package/dist/modes/interactive/components/dynamic-border.js +21 -0
  352. package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
  353. package/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
  354. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -0
  355. package/dist/modes/interactive/components/earendil-announcement.js +40 -0
  356. package/dist/modes/interactive/components/earendil-announcement.js.map +1 -0
  357. package/dist/modes/interactive/components/extension-editor.d.ts +20 -0
  358. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
  359. package/dist/modes/interactive/components/extension-editor.js +111 -0
  360. package/dist/modes/interactive/components/extension-editor.js.map +1 -0
  361. package/dist/modes/interactive/components/extension-input.d.ts +23 -0
  362. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
  363. package/dist/modes/interactive/components/extension-input.js +61 -0
  364. package/dist/modes/interactive/components/extension-input.js.map +1 -0
  365. package/dist/modes/interactive/components/extension-selector.d.ts +24 -0
  366. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
  367. package/dist/modes/interactive/components/extension-selector.js +78 -0
  368. package/dist/modes/interactive/components/extension-selector.js.map +1 -0
  369. package/dist/modes/interactive/components/footer.d.ts +27 -0
  370. package/dist/modes/interactive/components/footer.d.ts.map +1 -0
  371. package/dist/modes/interactive/components/footer.js +201 -0
  372. package/dist/modes/interactive/components/footer.js.map +1 -0
  373. package/dist/modes/interactive/components/index.d.ts +32 -0
  374. package/dist/modes/interactive/components/index.d.ts.map +1 -0
  375. package/dist/modes/interactive/components/index.js +33 -0
  376. package/dist/modes/interactive/components/index.js.map +1 -0
  377. package/dist/modes/interactive/components/keybinding-hints.d.ts +8 -0
  378. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
  379. package/dist/modes/interactive/components/keybinding-hints.js +22 -0
  380. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
  381. package/dist/modes/interactive/components/login-dialog.d.ts +46 -0
  382. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
  383. package/dist/modes/interactive/components/login-dialog.js +158 -0
  384. package/dist/modes/interactive/components/login-dialog.js.map +1 -0
  385. package/dist/modes/interactive/components/model-selector.d.ts +47 -0
  386. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
  387. package/dist/modes/interactive/components/model-selector.js +278 -0
  388. package/dist/modes/interactive/components/model-selector.js.map +1 -0
  389. package/dist/modes/interactive/components/oauth-selector.d.ts +29 -0
  390. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
  391. package/dist/modes/interactive/components/oauth-selector.js +141 -0
  392. package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
  393. package/dist/modes/interactive/components/scoped-models-selector.d.ts +42 -0
  394. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
  395. package/dist/modes/interactive/components/scoped-models-selector.js +290 -0
  396. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
  397. package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
  398. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
  399. package/dist/modes/interactive/components/session-selector-search.js +155 -0
  400. package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
  401. package/dist/modes/interactive/components/session-selector.d.ts +96 -0
  402. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
  403. package/dist/modes/interactive/components/session-selector.js +861 -0
  404. package/dist/modes/interactive/components/session-selector.js.map +1 -0
  405. package/dist/modes/interactive/components/settings-selector.d.ts +67 -0
  406. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
  407. package/dist/modes/interactive/components/settings-selector.js +373 -0
  408. package/dist/modes/interactive/components/settings-selector.js.map +1 -0
  409. package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
  410. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
  411. package/dist/modes/interactive/components/show-images-selector.js +39 -0
  412. package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
  413. package/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
  414. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
  415. package/dist/modes/interactive/components/skill-invocation-message.js +47 -0
  416. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
  417. package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
  418. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
  419. package/dist/modes/interactive/components/theme-selector.js +50 -0
  420. package/dist/modes/interactive/components/theme-selector.js.map +1 -0
  421. package/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
  422. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
  423. package/dist/modes/interactive/components/thinking-selector.js +51 -0
  424. package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
  425. package/dist/modes/interactive/components/tool-execution.d.ts +63 -0
  426. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
  427. package/dist/modes/interactive/components/tool-execution.js +295 -0
  428. package/dist/modes/interactive/components/tool-execution.js.map +1 -0
  429. package/dist/modes/interactive/components/tree-selector.d.ts +89 -0
  430. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
  431. package/dist/modes/interactive/components/tree-selector.js +1092 -0
  432. package/dist/modes/interactive/components/tree-selector.js.map +1 -0
  433. package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
  434. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
  435. package/dist/modes/interactive/components/user-message-selector.js +114 -0
  436. package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
  437. package/dist/modes/interactive/components/user-message.d.ts +10 -0
  438. package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
  439. package/dist/modes/interactive/components/user-message.js +29 -0
  440. package/dist/modes/interactive/components/user-message.js.map +1 -0
  441. package/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
  442. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
  443. package/dist/modes/interactive/components/visual-truncate.js +33 -0
  444. package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
  445. package/dist/modes/interactive/interactive-mode.d.ts +359 -0
  446. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
  447. package/dist/modes/interactive/interactive-mode.js +4573 -0
  448. package/dist/modes/interactive/interactive-mode.js.map +1 -0
  449. package/dist/modes/interactive/theme/aery.json +84 -0
  450. package/dist/modes/interactive/theme/catppuccin-mocha.json +81 -0
  451. package/dist/modes/interactive/theme/dark.json +85 -0
  452. package/dist/modes/interactive/theme/dracula.json +81 -0
  453. package/dist/modes/interactive/theme/light.json +84 -0
  454. package/dist/modes/interactive/theme/nord.json +81 -0
  455. package/dist/modes/interactive/theme/theme-schema.json +335 -0
  456. package/dist/modes/interactive/theme/theme.d.ts +81 -0
  457. package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
  458. package/dist/modes/interactive/theme/theme.js +975 -0
  459. package/dist/modes/interactive/theme/theme.js.map +1 -0
  460. package/dist/modes/interactive/theme/tokyo-night.json +81 -0
  461. package/dist/modes/print-mode.d.ts +28 -0
  462. package/dist/modes/print-mode.d.ts.map +1 -0
  463. package/dist/modes/print-mode.js +131 -0
  464. package/dist/modes/print-mode.js.map +1 -0
  465. package/dist/modes/rpc/jsonl.d.ts +17 -0
  466. package/dist/modes/rpc/jsonl.d.ts.map +1 -0
  467. package/dist/modes/rpc/jsonl.js +49 -0
  468. package/dist/modes/rpc/jsonl.js.map +1 -0
  469. package/dist/modes/rpc/rpc-client.d.ts +224 -0
  470. package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
  471. package/dist/modes/rpc/rpc-client.js +410 -0
  472. package/dist/modes/rpc/rpc-client.js.map +1 -0
  473. package/dist/modes/rpc/rpc-mode.d.ts +20 -0
  474. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
  475. package/dist/modes/rpc/rpc-mode.js +597 -0
  476. package/dist/modes/rpc/rpc-mode.js.map +1 -0
  477. package/dist/modes/rpc/rpc-types.d.ts +419 -0
  478. package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
  479. package/dist/modes/rpc/rpc-types.js +8 -0
  480. package/dist/modes/rpc/rpc-types.js.map +1 -0
  481. package/dist/package-manager-cli.d.ts +4 -0
  482. package/dist/package-manager-cli.d.ts.map +1 -0
  483. package/dist/package-manager-cli.js +468 -0
  484. package/dist/package-manager-cli.js.map +1 -0
  485. package/dist/utils/aery-user-agent.d.ts +2 -0
  486. package/dist/utils/aery-user-agent.d.ts.map +1 -0
  487. package/dist/utils/aery-user-agent.js +5 -0
  488. package/dist/utils/aery-user-agent.js.map +1 -0
  489. package/dist/utils/changelog.d.ts +21 -0
  490. package/dist/utils/changelog.d.ts.map +1 -0
  491. package/dist/utils/changelog.js +87 -0
  492. package/dist/utils/changelog.js.map +1 -0
  493. package/dist/utils/child-process.d.ts +11 -0
  494. package/dist/utils/child-process.d.ts.map +1 -0
  495. package/dist/utils/child-process.js +78 -0
  496. package/dist/utils/child-process.js.map +1 -0
  497. package/dist/utils/clipboard-image.d.ts +11 -0
  498. package/dist/utils/clipboard-image.d.ts.map +1 -0
  499. package/dist/utils/clipboard-image.js +245 -0
  500. package/dist/utils/clipboard-image.js.map +1 -0
  501. package/dist/utils/clipboard-native.d.ts +8 -0
  502. package/dist/utils/clipboard-native.d.ts.map +1 -0
  503. package/dist/utils/clipboard-native.js +14 -0
  504. package/dist/utils/clipboard-native.js.map +1 -0
  505. package/dist/utils/clipboard.d.ts +2 -0
  506. package/dist/utils/clipboard.d.ts.map +1 -0
  507. package/dist/utils/clipboard.js +110 -0
  508. package/dist/utils/clipboard.js.map +1 -0
  509. package/dist/utils/exif-orientation.d.ts +5 -0
  510. package/dist/utils/exif-orientation.d.ts.map +1 -0
  511. package/dist/utils/exif-orientation.js +158 -0
  512. package/dist/utils/exif-orientation.js.map +1 -0
  513. package/dist/utils/frontmatter.d.ts +8 -0
  514. package/dist/utils/frontmatter.d.ts.map +1 -0
  515. package/dist/utils/frontmatter.js +26 -0
  516. package/dist/utils/frontmatter.js.map +1 -0
  517. package/dist/utils/fs-watch.d.ts +5 -0
  518. package/dist/utils/fs-watch.d.ts.map +1 -0
  519. package/dist/utils/fs-watch.js +25 -0
  520. package/dist/utils/fs-watch.js.map +1 -0
  521. package/dist/utils/git.d.ts +26 -0
  522. package/dist/utils/git.d.ts.map +1 -0
  523. package/dist/utils/git.js +163 -0
  524. package/dist/utils/git.js.map +1 -0
  525. package/dist/utils/image-convert.d.ts +9 -0
  526. package/dist/utils/image-convert.d.ts.map +1 -0
  527. package/dist/utils/image-convert.js +39 -0
  528. package/dist/utils/image-convert.js.map +1 -0
  529. package/dist/utils/image-resize.d.ts +36 -0
  530. package/dist/utils/image-resize.d.ts.map +1 -0
  531. package/dist/utils/image-resize.js +137 -0
  532. package/dist/utils/image-resize.js.map +1 -0
  533. package/dist/utils/mime.d.ts +2 -0
  534. package/dist/utils/mime.d.ts.map +1 -0
  535. package/dist/utils/mime.js +26 -0
  536. package/dist/utils/mime.js.map +1 -0
  537. package/dist/utils/paths.d.ts +14 -0
  538. package/dist/utils/paths.d.ts.map +1 -0
  539. package/dist/utils/paths.js +34 -0
  540. package/dist/utils/paths.js.map +1 -0
  541. package/dist/utils/photon.d.ts +21 -0
  542. package/dist/utils/photon.d.ts.map +1 -0
  543. package/dist/utils/photon.js +121 -0
  544. package/dist/utils/photon.js.map +1 -0
  545. package/dist/utils/shell.d.ts +30 -0
  546. package/dist/utils/shell.d.ts.map +1 -0
  547. package/dist/utils/shell.js +190 -0
  548. package/dist/utils/shell.js.map +1 -0
  549. package/dist/utils/sleep.d.ts +5 -0
  550. package/dist/utils/sleep.d.ts.map +1 -0
  551. package/dist/utils/sleep.js +17 -0
  552. package/dist/utils/sleep.js.map +1 -0
  553. package/dist/utils/tools-manager.d.ts +3 -0
  554. package/dist/utils/tools-manager.d.ts.map +1 -0
  555. package/dist/utils/tools-manager.js +256 -0
  556. package/dist/utils/tools-manager.js.map +1 -0
  557. package/dist/utils/version-check.d.ts +7 -0
  558. package/dist/utils/version-check.d.ts.map +1 -0
  559. package/dist/utils/version-check.js +70 -0
  560. package/dist/utils/version-check.js.map +1 -0
  561. package/docs/compaction.md +0 -0
  562. package/docs/custom-provider.md +3 -2
  563. package/docs/development.md +0 -0
  564. package/docs/docs.json +133 -0
  565. package/docs/extensions.md +198 -22
  566. package/docs/images/doom-extension.png +0 -0
  567. package/docs/images/exy.png +0 -0
  568. package/docs/images/interactive-mode.png +0 -0
  569. package/docs/images/tree-view.png +0 -0
  570. package/docs/index.md +61 -0
  571. package/docs/json.md +0 -0
  572. package/docs/keybindings.md +0 -0
  573. package/docs/models.md +39 -2
  574. package/docs/packages.md +0 -0
  575. package/docs/prompt-templates.md +0 -0
  576. package/docs/providers.md +19 -1
  577. package/docs/quickstart.md +142 -0
  578. package/docs/rpc.md +0 -0
  579. package/docs/sdk.md +1 -1
  580. package/docs/{session.md → session-format.md} +0 -0
  581. package/docs/sessions.md +137 -0
  582. package/docs/settings.md +32 -8
  583. package/docs/shell-aliases.md +0 -0
  584. package/docs/skills.md +0 -0
  585. package/docs/terminal-setup.md +0 -0
  586. package/docs/termux.md +0 -0
  587. package/docs/themes.md +0 -0
  588. package/docs/tmux.md +0 -0
  589. package/docs/tui.md +0 -0
  590. package/docs/usage.md +275 -0
  591. package/docs/windows.md +0 -0
  592. package/examples/README.md +0 -0
  593. package/examples/extensions/README.md +2 -0
  594. package/examples/extensions/antigravity-image-gen.ts +2 -2
  595. package/examples/extensions/auto-commit-on-exit.ts +0 -0
  596. package/examples/extensions/bash-spawn-hook.ts +0 -0
  597. package/examples/extensions/bookmark.ts +0 -0
  598. package/examples/extensions/border-status-editor.ts +145 -0
  599. package/examples/extensions/built-in-tool-renderer.ts +0 -0
  600. package/examples/extensions/claude-rules.ts +0 -0
  601. package/examples/extensions/commands.ts +0 -0
  602. package/examples/extensions/confirm-destructive.ts +0 -0
  603. package/examples/extensions/custom-compaction.ts +1 -1
  604. package/examples/extensions/custom-footer.ts +1 -1
  605. package/examples/extensions/custom-header.ts +0 -0
  606. package/examples/extensions/custom-provider-anthropic/index.ts +1 -1
  607. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  608. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  609. package/examples/extensions/custom-provider-gitlab-duo/index.ts +1 -1
  610. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  611. package/examples/extensions/custom-provider-gitlab-duo/test.ts +0 -0
  612. package/examples/extensions/custom-provider-qwen-cli/index.ts +1 -1
  613. package/examples/extensions/custom-provider-qwen-cli/package.json +1 -1
  614. package/examples/extensions/dirty-repo-guard.ts +0 -0
  615. package/examples/extensions/doom-overlay/README.md +0 -0
  616. package/examples/extensions/doom-overlay/doom/build/doom.js +0 -0
  617. package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +0 -0
  618. package/examples/extensions/doom-overlay/doom-component.ts +0 -0
  619. package/examples/extensions/doom-overlay/doom-engine.ts +0 -0
  620. package/examples/extensions/doom-overlay/doom-keys.ts +0 -0
  621. package/examples/extensions/doom-overlay/index.ts +0 -0
  622. package/examples/extensions/doom-overlay/wad-finder.ts +0 -0
  623. package/examples/extensions/dynamic-resources/SKILL.md +0 -0
  624. package/examples/extensions/dynamic-resources/dynamic.json +0 -0
  625. package/examples/extensions/dynamic-resources/dynamic.md +0 -0
  626. package/examples/extensions/dynamic-resources/index.ts +0 -0
  627. package/examples/extensions/dynamic-tools.ts +2 -2
  628. package/examples/extensions/event-bus.ts +0 -0
  629. package/examples/extensions/file-trigger.ts +0 -0
  630. package/examples/extensions/git-checkpoint.ts +0 -0
  631. package/examples/extensions/github-issue-autocomplete.ts +185 -0
  632. package/examples/extensions/handoff.ts +8 -7
  633. package/examples/extensions/hello.ts +1 -1
  634. package/examples/extensions/hidden-thinking-label.ts +0 -0
  635. package/examples/extensions/inline-bash.ts +0 -0
  636. package/examples/extensions/input-transform.ts +0 -0
  637. package/examples/extensions/interactive-shell.ts +0 -0
  638. package/examples/extensions/mac-system-theme.ts +0 -0
  639. package/examples/extensions/message-renderer.ts +0 -0
  640. package/examples/extensions/minimal-mode.ts +0 -0
  641. package/examples/extensions/modal-editor.ts +0 -0
  642. package/examples/extensions/model-status.ts +0 -0
  643. package/examples/extensions/notify.ts +0 -0
  644. package/examples/extensions/overlay-qa-tests.ts +0 -0
  645. package/examples/extensions/overlay-test.ts +0 -0
  646. package/examples/extensions/permission-gate.ts +0 -0
  647. package/examples/extensions/pirate.ts +0 -0
  648. package/examples/extensions/plan-mode/README.md +0 -0
  649. package/examples/extensions/plan-mode/index.ts +2 -2
  650. package/examples/extensions/plan-mode/utils.ts +0 -0
  651. package/examples/extensions/preset.ts +1 -1
  652. package/examples/extensions/prompt-customizer.ts +97 -0
  653. package/examples/extensions/protected-paths.ts +0 -0
  654. package/examples/extensions/provider-payload.ts +0 -0
  655. package/examples/extensions/qna.ts +1 -1
  656. package/examples/extensions/question.ts +1 -1
  657. package/examples/extensions/questionnaire.ts +1 -1
  658. package/examples/extensions/rainbow-editor.ts +0 -0
  659. package/examples/extensions/reload-runtime.ts +1 -1
  660. package/examples/extensions/rpc-demo.ts +0 -0
  661. package/examples/extensions/sandbox/index.ts +0 -0
  662. package/examples/extensions/sandbox/package-lock.json +0 -0
  663. package/examples/extensions/sandbox/package.json +0 -0
  664. package/examples/extensions/send-user-message.ts +0 -0
  665. package/examples/extensions/session-name.ts +0 -0
  666. package/examples/extensions/shutdown-command.ts +1 -1
  667. package/examples/extensions/snake.ts +0 -0
  668. package/examples/extensions/space-invaders.ts +0 -0
  669. package/examples/extensions/ssh.ts +0 -0
  670. package/examples/extensions/status-line.ts +0 -0
  671. package/examples/extensions/structured-output.ts +65 -0
  672. package/examples/extensions/subagent/README.md +0 -0
  673. package/examples/extensions/subagent/agents/planner.md +0 -0
  674. package/examples/extensions/subagent/agents/reviewer.md +0 -0
  675. package/examples/extensions/subagent/agents/scout.md +0 -0
  676. package/examples/extensions/subagent/agents/worker.md +0 -0
  677. package/examples/extensions/subagent/agents.ts +0 -0
  678. package/examples/extensions/subagent/index.ts +3 -3
  679. package/examples/extensions/subagent/prompts/implement-and-review.md +0 -0
  680. package/examples/extensions/subagent/prompts/implement.md +0 -0
  681. package/examples/extensions/subagent/prompts/scout-and-plan.md +0 -0
  682. package/examples/extensions/summarize.ts +1 -1
  683. package/examples/extensions/system-prompt-header.ts +0 -0
  684. package/examples/extensions/tic-tac-toe.ts +2 -2
  685. package/examples/extensions/timed-confirm.ts +0 -0
  686. package/examples/extensions/titlebar-spinner.ts +0 -0
  687. package/examples/extensions/todo.ts +2 -2
  688. package/examples/extensions/tool-override.ts +2 -2
  689. package/examples/extensions/tools.ts +0 -0
  690. package/examples/extensions/trigger-compact.ts +0 -0
  691. package/examples/extensions/truncated-tool.ts +1 -1
  692. package/examples/extensions/widget-placement.ts +0 -0
  693. package/examples/extensions/with-deps/index.ts +1 -1
  694. package/examples/extensions/with-deps/package-lock.json +2 -2
  695. package/examples/extensions/with-deps/package.json +1 -1
  696. package/examples/extensions/working-indicator.ts +0 -0
  697. package/examples/extensions/working-message-test.ts +25 -0
  698. package/examples/rpc-extension-ui.ts +0 -0
  699. package/examples/sdk/01-minimal.ts +0 -0
  700. package/examples/sdk/02-custom-model.ts +1 -1
  701. package/examples/sdk/03-custom-prompt.ts +0 -0
  702. package/examples/sdk/04-skills.ts +0 -0
  703. package/examples/sdk/05-tools.ts +0 -0
  704. package/examples/sdk/06-extensions.ts +0 -0
  705. package/examples/sdk/07-context-files.ts +0 -0
  706. package/examples/sdk/08-prompt-templates.ts +0 -0
  707. package/examples/sdk/09-api-keys-and-oauth.ts +0 -0
  708. package/examples/sdk/10-settings.ts +0 -0
  709. package/examples/sdk/11-sessions.ts +0 -0
  710. package/examples/sdk/12-full-control.ts +1 -1
  711. package/examples/sdk/13-session-runtime.ts +0 -0
  712. package/examples/sdk/README.md +0 -0
  713. package/package.json +3 -4
  714. package/docs/tree.md +0 -233
@@ -352,7 +352,7 @@ pi.on("resources_discover", async (event, _ctx) => {
352
352
 
353
353
  ### Session Events
354
354
 
355
- See [session.md](session.md) for session storage internals and the SessionManager API.
355
+ See [Session Format](session-format.md) for session storage internals and the SessionManager API.
356
356
 
357
357
  #### session_start
358
358
 
@@ -431,7 +431,7 @@ pi.on("session_compact", async (event, ctx) => {
431
431
 
432
432
  #### session_before_tree / session_tree
433
433
 
434
- Fired on `/tree` navigation. See [tree.md](tree.md) for tree navigation concepts.
434
+ Fired on `/tree` navigation. See [Sessions](sessions.md) for tree navigation concepts.
435
435
 
436
436
  ```typescript
437
437
  pi.on("session_before_tree", async (event, ctx) => {
@@ -448,10 +448,12 @@ pi.on("session_tree", async (event, ctx) => {
448
448
 
449
449
  #### session_shutdown
450
450
 
451
- Fired on exit (Ctrl+C, Ctrl+D, SIGHUP, SIGTERM).
451
+ Fired before an extension runtime is torn down.
452
452
 
453
453
  ```typescript
454
- pi.on("session_shutdown", async (_event, ctx) => {
454
+ pi.on("session_shutdown", async (event, ctx) => {
455
+ // event.reason - "quit" | "reload" | "new" | "resume" | "fork"
456
+ // event.targetSessionFile - destination session for session replacement flows
455
457
  // Cleanup, save state, etc.
456
458
  });
457
459
  ```
@@ -467,6 +469,15 @@ pi.on("before_agent_start", async (event, ctx) => {
467
469
  // event.prompt - user's prompt text
468
470
  // event.images - attached images (if any)
469
471
  // event.systemPrompt - current system prompt
472
+ // event.systemPromptOptions - structured options used to build the system prompt
473
+ // .customPrompt - any custom system prompt (from --system-prompt, SYSTEM.md, or custom templates)
474
+ // .selectedTools - tools currently active in the prompt
475
+ // .toolSnippets - one-line descriptions for each tool
476
+ // .promptGuidelines - custom guideline bullets
477
+ // .appendSystemPrompt - text from --append-system-prompt flags
478
+ // .cwd - working directory
479
+ // .contextFiles - AGENTS.md files and other loaded context files
480
+ // .skills - loaded skills
470
481
 
471
482
  return {
472
483
  // Inject a persistent message (stored in session, sent to LLM)
@@ -481,6 +492,8 @@ pi.on("before_agent_start", async (event, ctx) => {
481
492
  });
482
493
  ```
483
494
 
495
+ The `systemPromptOptions` field gives extensions access to the same structured data Pi uses to build the system prompt. This lets you inspect what Pi has loaded — custom prompts, guidelines, tool snippets, context files, skills — without re-discovering resources or re-parsing flags. Use it when your extension needs to make deep, informed changes to the system prompt while respecting user-provided configuration.
496
+
484
497
  #### agent_start / agent_end
485
498
 
486
499
  Fired once per user prompt.
@@ -536,7 +549,8 @@ Fired for tool execution lifecycle updates.
536
549
  In parallel tool mode:
537
550
  - `tool_execution_start` is emitted in assistant source order during the preflight phase
538
551
  - `tool_execution_update` events may interleave across tools
539
- - `tool_execution_end` is emitted in assistant source order, matching final tool result message order
552
+ - `tool_execution_end` is emitted in tool completion order after each tool is finalized
553
+ - final `toolResult` message events are still emitted later in assistant source order
540
554
 
541
555
  ```typescript
542
556
  pi.on("tool_execution_start", async (event, ctx) => {
@@ -554,7 +568,7 @@ pi.on("tool_execution_end", async (event, ctx) => {
554
568
 
555
569
  #### context
556
570
 
557
- Fired before each LLM call. Modify messages non-destructively. See [session.md](session.md) for message types.
571
+ Fired before each LLM call. Modify messages non-destructively. See [Session Format](session-format.md) for message types.
558
572
 
559
573
  ```typescript
560
574
  pi.on("context", async (event, ctx) => {
@@ -568,6 +582,8 @@ pi.on("context", async (event, ctx) => {
568
582
 
569
583
  Fired after the provider-specific payload is built, right before the request is sent. Handlers run in extension load order. Returning `undefined` keeps the payload unchanged. Returning any other value replaces the payload for later handlers and for the actual request.
570
584
 
585
+ This hook can rewrite provider-level system instructions or remove them entirely. Those payload-level changes are not reflected by `ctx.getSystemPrompt()`, which reports Pi's system prompt string rather than the final serialized provider payload.
586
+
571
587
  ```typescript
572
588
  pi.on("before_provider_request", (event, ctx) => {
573
589
  console.log(JSON.stringify(event.payload, null, 2));
@@ -687,6 +703,8 @@ pi.on("tool_call", (event) => {
687
703
 
688
704
  Fired after tool execution finishes and before `tool_execution_end` plus the final tool result message events are emitted. **Can modify result.**
689
705
 
706
+ In parallel tool mode, `tool_result` and `tool_execution_end` may interleave in tool completion order, while final `toolResult` message events are still emitted later in assistant source order.
707
+
690
708
  `tool_result` handlers chain like middleware:
691
709
  - Handlers run in extension load order
692
710
  - Each handler sees the latest result after previous handler changes
@@ -814,7 +832,7 @@ Current working directory.
814
832
 
815
833
  ### ctx.sessionManager
816
834
 
817
- Read-only access to session state. See [session.md](session.md) for the full SessionManager API and entry types.
835
+ Read-only access to session state. See [Session Format](session-format.md) for the full SessionManager API and entry types.
818
836
 
819
837
  For `tool_call`, this state is synchronized through the current assistant message before handlers run. In parallel tool execution mode it is still not guaranteed to include sibling tool results from the same assistant message.
820
838
 
@@ -904,7 +922,12 @@ ctx.compact({
904
922
 
905
923
  ### ctx.getSystemPrompt()
906
924
 
907
- Returns the current effective system prompt. This includes any modifications made by `before_agent_start` handlers for the current turn.
925
+ Returns Pi's current system prompt string.
926
+
927
+ - During `before_agent_start`, this reflects chained system-prompt changes made so far for the current turn.
928
+ - It does not include later `context` message mutations.
929
+ - It does not include `before_provider_request` payload rewrites.
930
+ - If later-loaded extensions run after yours, they can still change what is ultimately sent.
908
931
 
909
932
  ```typescript
910
933
  pi.on("before_agent_start", (event, ctx) => {
@@ -935,8 +958,11 @@ pi.registerCommand("my-cmd", {
935
958
  Create a new session:
936
959
 
937
960
  ```typescript
961
+ const parentSession = ctx.sessionManager.getSessionFile();
962
+ const kickoff = "Continue in the replacement session";
963
+
938
964
  const result = await ctx.newSession({
939
- parentSession: ctx.sessionManager.getSessionFile(),
965
+ parentSession,
940
966
  setup: async (sm) => {
941
967
  sm.appendMessage({
942
968
  role: "user",
@@ -944,6 +970,10 @@ const result = await ctx.newSession({
944
970
  timestamp: Date.now(),
945
971
  });
946
972
  },
973
+ withSession: async (ctx) => {
974
+ // Use only the replacement-session ctx here.
975
+ await ctx.sendUserMessage(kickoff);
976
+ },
947
977
  });
948
978
 
949
979
  if (result.cancelled) {
@@ -951,25 +981,36 @@ if (result.cancelled) {
951
981
  }
952
982
  ```
953
983
 
984
+ Options:
985
+ - `parentSession`: parent session file to record in the new session header
986
+ - `setup`: mutate the new session's `SessionManager` before `withSession` runs
987
+ - `withSession`: run post-switch work against a fresh replacement-session context. Do not use captured old `pi` / command `ctx`; see [Session replacement lifecycle and footguns](#session-replacement-lifecycle-and-footguns).
988
+
954
989
  ### ctx.fork(entryId, options?)
955
990
 
956
991
  Fork from a specific entry, creating a new session file:
957
992
 
958
993
  ```typescript
959
- const result = await ctx.fork("entry-id-123");
960
- if (!result.cancelled) {
961
- // Now in the forked session
994
+ const result = await ctx.fork("entry-id-123", {
995
+ withSession: async (ctx) => {
996
+ // Use only the replacement-session ctx here.
997
+ ctx.ui.notify("Now in the forked session", "info");
998
+ },
999
+ });
1000
+ if (result.cancelled) {
1001
+ // An extension cancelled the fork
962
1002
  }
963
1003
 
964
1004
  const cloneResult = await ctx.fork("entry-id-456", { position: "at" });
965
- if (!cloneResult.cancelled) {
966
- // New session contains the active path through entry-id-456
1005
+ if (cloneResult.cancelled) {
1006
+ // An extension cancelled the clone
967
1007
  }
968
1008
  ```
969
1009
 
970
1010
  Options:
971
1011
  - `position`: `"before"` (default) forks before the selected user message, restoring that prompt into the editor
972
1012
  - `position`: `"at"` duplicates the active path through the selected entry without restoring editor text
1013
+ - `withSession`: run post-switch work against a fresh replacement-session context. Do not use captured old `pi` / command `ctx`; see [Session replacement lifecycle and footguns](#session-replacement-lifecycle-and-footguns).
973
1014
 
974
1015
  ### ctx.navigateTree(targetId, options?)
975
1016
 
@@ -990,17 +1031,24 @@ Options:
990
1031
  - `replaceInstructions`: If true, `customInstructions` replaces the default prompt instead of being appended
991
1032
  - `label`: Label to attach to the branch summary entry (or target entry if not summarizing)
992
1033
 
993
- ### ctx.switchSession(sessionPath)
1034
+ ### ctx.switchSession(sessionPath, options?)
994
1035
 
995
1036
  Switch to a different session file:
996
1037
 
997
1038
  ```typescript
998
- const result = await ctx.switchSession("/path/to/session.jsonl");
1039
+ const result = await ctx.switchSession("/path/to/session.jsonl", {
1040
+ withSession: async (ctx) => {
1041
+ await ctx.sendUserMessage("Resume work in the replacement session");
1042
+ },
1043
+ });
999
1044
  if (result.cancelled) {
1000
1045
  // An extension cancelled the switch via session_before_switch
1001
1046
  }
1002
1047
  ```
1003
1048
 
1049
+ Options:
1050
+ - `withSession`: run post-switch work against a fresh replacement-session context. Do not use captured old `pi` / command `ctx`; see [Session replacement lifecycle and footguns](#session-replacement-lifecycle-and-footguns).
1051
+
1004
1052
  To discover available sessions, use the static `SessionManager.list()` or `SessionManager.listAll()` methods:
1005
1053
 
1006
1054
  ```typescript
@@ -1016,12 +1064,59 @@ pi.registerCommand("switch", {
1016
1064
  sessions.map(s => s.file),
1017
1065
  );
1018
1066
  if (choice) {
1019
- await ctx.switchSession(choice);
1067
+ await ctx.switchSession(choice, {
1068
+ withSession: async (ctx) => {
1069
+ ctx.ui.notify("Switched session", "info");
1070
+ },
1071
+ });
1020
1072
  }
1021
1073
  },
1022
1074
  });
1023
1075
  ```
1024
1076
 
1077
+ ### Session replacement lifecycle and footguns
1078
+
1079
+ `withSession` receives a fresh `ReplacedSessionContext`, which extends `ExtensionCommandContext` with async `sendMessage()` and `sendUserMessage()` helpers bound to the replacement session.
1080
+
1081
+ Lifecycle and footguns:
1082
+ - `withSession` runs only after the old session has emitted `session_shutdown`, the old runtime has been torn down, the replacement session has been rebound, and the new extension instance has already received `session_start`.
1083
+ - The callback still executes in the original closure, not inside the new extension instance. That means your old extension instance may already have run its shutdown cleanup before `withSession` starts.
1084
+ - Captured old `pi` / old command `ctx` session-bound objects are stale after replacement and will throw if used. Use only the `ctx` passed to `withSession` for session-bound work.
1085
+ - Previously extracted raw objects are still your responsibility. For example, if you capture `const sm = ctx.sessionManager` before replacement, `sm` is still the old `SessionManager` object. Do not reuse it after replacement.
1086
+ - Code in `withSession` should assume any state invalidated by your `session_shutdown` handler is already gone. Only capture plain data that survives shutdown cleanly, such as strings, ids, and serialized config.
1087
+
1088
+ Safe pattern:
1089
+
1090
+ ```typescript
1091
+ pi.registerCommand("handoff", {
1092
+ handler: async (_args, ctx) => {
1093
+ const kickoff = "Continue from the replacement session";
1094
+ await ctx.newSession({
1095
+ withSession: async (ctx) => {
1096
+ await ctx.sendUserMessage(kickoff);
1097
+ },
1098
+ });
1099
+ },
1100
+ });
1101
+ ```
1102
+
1103
+ Unsafe pattern:
1104
+
1105
+ ```typescript
1106
+ pi.registerCommand("handoff", {
1107
+ handler: async (_args, ctx) => {
1108
+ const oldSessionManager = ctx.sessionManager;
1109
+ await ctx.newSession({
1110
+ withSession: async (_ctx) => {
1111
+ // stale old objects: do not do this
1112
+ oldSessionManager.getSessionFile();
1113
+ pi.sendUserMessage("wrong");
1114
+ },
1115
+ });
1116
+ },
1117
+ });
1118
+ ```
1119
+
1025
1120
  ### ctx.reload()
1026
1121
 
1027
1122
  Run the same reload flow as `/reload`.
@@ -1094,6 +1189,8 @@ Use `aery.setActiveTools()` to enable or disable tools (including dynamically ad
1094
1189
 
1095
1190
  Use `promptSnippet` to opt a custom tool into a one-line entry in `Available tools`, and `promptGuidelines` to append tool-specific bullets to the default `Guidelines` section when the tool is active.
1096
1191
 
1192
+ **Important:** `promptGuidelines` bullets are appended flat to the `Guidelines` section with no tool name prefix. Each guideline must name the tool it refers to — avoid "Use this tool when..." because the LLM cannot tell which tool "this" means. Write "Use my_tool when..." instead.
1193
+
1097
1194
  See [dynamic-tools.ts](../examples/extensions/dynamic-tools.ts) for a full example.
1098
1195
 
1099
1196
  ```typescript
@@ -1105,7 +1202,7 @@ pi.registerTool({
1105
1202
  label: "My Tool",
1106
1203
  description: "What this tool does",
1107
1204
  promptSnippet: "Summarize or transform text according to action",
1108
- promptGuidelines: ["Use this tool when the user asks to summarize previously generated text."],
1205
+ promptGuidelines: ["Use my_tool when the user asks to summarize previously generated text."],
1109
1206
  parameters: Type.Object({
1110
1207
  action: StringEnum(["list", "add"] as const),
1111
1208
  text: Type.Optional(Type.String()),
@@ -1531,6 +1628,8 @@ Use `promptSnippet` for a short one-line entry in the `Available tools` section
1531
1628
 
1532
1629
  Use `promptGuidelines` to add tool-specific bullets to the default system prompt `Guidelines` section. These bullets are included only while the tool is active (for example, after `aery.setActiveTools([...])`).
1533
1630
 
1631
+ **Important:** `promptGuidelines` bullets are appended flat to the `Guidelines` section with no tool name prefix or grouping. Each guideline must name the tool it refers to — avoid "Use this tool when..." because the LLM cannot tell which tool "this" means. Write "Use my_tool when..." instead.
1632
+
1534
1633
  Note: Some models are idiots and include the @ prefix in tool path arguments. Built-in tools strip a leading @ before resolving paths. If your custom tool accepts a path, normalize a leading @ as well.
1535
1634
 
1536
1635
  If your custom tool mutates files, use `withFileMutationQueue()` so it participates in the same per-file queue as built-in `edit` and `write`. This matters because tool calls run in parallel by default. Without the queue, two tools can read the same old file contents, compute different updates, and then whichever write lands last overwrites the other.
@@ -1576,7 +1675,7 @@ pi.registerTool({
1576
1675
  description: "What this tool does (shown to LLM)",
1577
1676
  promptSnippet: "List or add items in the project todo list",
1578
1677
  promptGuidelines: [
1579
- "Use this tool for todo planning instead of direct file edits when the user asks for a task list."
1678
+ "Use my_tool for todo planning instead of direct file edits when the user asks for a task list."
1580
1679
  ],
1581
1680
  parameters: Type.Object({
1582
1681
  action: StringEnum(["list", "add"] as const), // Use StringEnum for Google compatibility
@@ -1610,6 +1709,9 @@ pi.registerTool({
1610
1709
  return {
1611
1710
  content: [{ type: "text", text: "Done" }], // Sent to LLM
1612
1711
  details: { data: result }, // For rendering & state
1712
+ // Optional: stop after this tool batch when every finalized tool result
1713
+ // in the batch also returns terminate: true.
1714
+ terminate: true,
1613
1715
  };
1614
1716
  },
1615
1717
 
@@ -1621,6 +1723,8 @@ pi.registerTool({
1621
1723
 
1622
1724
  **Signaling errors:** To mark a tool execution as failed (sets `isError: true` on the result and reports it to the LLM), throw an error from `execute`. Returning a value never sets the error flag regardless of what properties you include in the return object.
1623
1725
 
1726
+ **Early termination:** Return `terminate: true` from `execute()` to hint that the automatic follow-up LLM call should be skipped after the current tool batch. This only takes effect when every finalized tool result in that batch is terminating. See [examples/extensions/structured-output.ts](../examples/extensions/structured-output.ts) for a minimal example where the agent ends on a final structured-output tool call.
1727
+
1624
1728
  ```typescript
1625
1729
  // Correct: throw to signal an error
1626
1730
  async execute(toolCallId, params) {
@@ -1689,7 +1793,7 @@ Extensions can override built-in tools (`read`, `bash`, `edit`, `write`, `grep`,
1689
1793
  aery -e ./tool-override.ts
1690
1794
  ```
1691
1795
 
1692
- Alternatively, use `--no-tools` to start without any built-in tools:
1796
+ Alternatively, use `--no-builtin-tools` to start without any built-in tools while keeping extension tools enabled:
1693
1797
  ```bash
1694
1798
  # No built-in tools, only extension tools
1695
1799
  aery --no-tools -e ./my-extension.ts
@@ -1965,8 +2069,9 @@ Extensions can interact with users via `ctx.ui` methods and customize how messag
1965
2069
  - Async operations with cancel (BorderedLoader)
1966
2070
  - Settings toggles (SettingsList)
1967
2071
  - Status indicators (setStatus)
1968
- - Working message and indicator during streaming (`setWorkingMessage`, `setWorkingIndicator`)
2072
+ - Working message, visibility, and indicator during streaming (`setWorkingMessage`, `setWorkingVisible`, `setWorkingIndicator`)
1969
2073
  - Widgets above/below editor (setWidget)
2074
+ - Autocomplete providers layered on top of built-in slash/path completion (addAutocompleteProvider)
1970
2075
  - Custom footers (setFooter)
1971
2076
 
1972
2077
  ### Dialogs
@@ -2046,9 +2151,11 @@ See [examples/extensions/timed-confirm.ts](../examples/extensions/timed-confirm.
2046
2151
  ctx.ui.setStatus("my-ext", "Processing...");
2047
2152
  ctx.ui.setStatus("my-ext", undefined); // Clear
2048
2153
 
2049
- // Working message (shown during streaming)
2154
+ // Working loader (shown during streaming)
2050
2155
  ctx.ui.setWorkingMessage("Thinking deeply...");
2051
2156
  ctx.ui.setWorkingMessage(); // Restore default
2157
+ ctx.ui.setWorkingVisible(false); // Hide the built-in working loader row entirely
2158
+ ctx.ui.setWorkingVisible(true); // Show the built-in working loader row
2052
2159
 
2053
2160
  // Working indicator (shown during streaming)
2054
2161
  ctx.ui.setWorkingIndicator({ frames: [ctx.ui.theme.fg("accent", "●")] }); // Static dot
@@ -2088,6 +2195,28 @@ const current = ctx.ui.getEditorText();
2088
2195
  // Paste into editor (triggers paste handling, including collapse for large content)
2089
2196
  ctx.ui.pasteToEditor("pasted content");
2090
2197
 
2198
+ // Stack custom autocomplete behavior on top of the built-in provider
2199
+ ctx.ui.addAutocompleteProvider((current) => ({
2200
+ async getSuggestions(lines, line, col, options) {
2201
+ const beforeCursor = (lines[line] ?? "").slice(0, col);
2202
+ const match = beforeCursor.match(/(?:^|[ \t])#([^\s#]*)$/);
2203
+ if (!match) {
2204
+ return current.getSuggestions(lines, line, col, options);
2205
+ }
2206
+
2207
+ return {
2208
+ prefix: `#${match[1] ?? ""}`,
2209
+ items: [{ value: "#2983", label: "#2983", description: "Extension API for autocomplete" }],
2210
+ };
2211
+ },
2212
+ applyCompletion(lines, line, col, item, prefix) {
2213
+ return current.applyCompletion(lines, line, col, item, prefix);
2214
+ },
2215
+ shouldTriggerFileCompletion(lines, line, col) {
2216
+ return current.shouldTriggerFileCompletion?.(lines, line, col) ?? true;
2217
+ },
2218
+ }));
2219
+
2091
2220
  // Tool output expansion
2092
2221
  const wasExpanded = ctx.ui.getToolsExpanded();
2093
2222
  ctx.ui.setToolsExpanded(true);
@@ -2110,6 +2239,50 @@ ctx.ui.theme.fg("accent", "styled text"); // Access current theme
2110
2239
 
2111
2240
  Custom working-indicator frames are rendered verbatim. If you want colors, add them to the frame strings yourself, for example with `ctx.ui.theme.fg(...)`.
2112
2241
 
2242
+ ### Autocomplete Providers
2243
+
2244
+ Use `ctx.ui.addAutocompleteProvider()` to stack custom autocomplete logic on top of the built-in slash-command and path provider.
2245
+
2246
+ Typical pattern:
2247
+
2248
+ - inspect the text before the cursor
2249
+ - return your own suggestions when your extension-specific syntax matches
2250
+ - otherwise delegate to `current.getSuggestions(...)`
2251
+ - delegate `applyCompletion(...)` unless you need custom insertion behavior
2252
+
2253
+ ```typescript
2254
+ pi.on("session_start", (_event, ctx) => {
2255
+ ctx.ui.addAutocompleteProvider((current) => ({
2256
+ async getSuggestions(lines, cursorLine, cursorCol, options) {
2257
+ const line = lines[cursorLine] ?? "";
2258
+ const beforeCursor = line.slice(0, cursorCol);
2259
+ const match = beforeCursor.match(/(?:^|[ \t])#([^\s#]*)$/);
2260
+ if (!match) {
2261
+ return current.getSuggestions(lines, cursorLine, cursorCol, options);
2262
+ }
2263
+
2264
+ return {
2265
+ prefix: `#${match[1] ?? ""}`,
2266
+ items: [
2267
+ { value: "#2983", label: "#2983", description: "Extension API for registering custom @ autocomplete providers" },
2268
+ { value: "#2753", label: "#2753", description: "Reload stale resource settings" },
2269
+ ],
2270
+ };
2271
+ },
2272
+
2273
+ applyCompletion(lines, cursorLine, cursorCol, item, prefix) {
2274
+ return current.applyCompletion(lines, cursorLine, cursorCol, item, prefix);
2275
+ },
2276
+
2277
+ shouldTriggerFileCompletion(lines, cursorLine, cursorCol) {
2278
+ return current.shouldTriggerFileCompletion?.(lines, cursorLine, cursorCol) ?? true;
2279
+ },
2280
+ }));
2281
+ });
2282
+ ```
2283
+
2284
+ See [github-issue-autocomplete.ts](../examples/extensions/github-issue-autocomplete.ts) for a complete example that preloads the latest open GitHub issues with `gh issue list` and filters them locally for fast `#...` completion. It requires GitHub CLI (`gh`) and a GitHub repository checkout.
2285
+
2113
2286
  ### Custom Components
2114
2287
 
2115
2288
  For complex UI, use `ctx.ui.custom()`. This temporarily replaces the editor with your component until `done()` is called:
@@ -2302,6 +2475,7 @@ All examples in [examples/extensions/](../examples/extensions/).
2302
2475
  | `questionnaire.ts` | Multi-step wizard tool | `registerTool`, `ui.custom` |
2303
2476
  | `todo.ts` | Stateful tool with persistence | `registerTool`, `appendEntry`, `renderResult`, session events |
2304
2477
  | `dynamic-tools.ts` | Register tools after startup and during commands | `registerTool`, `session_start`, `registerCommand` |
2478
+ | `structured-output.ts` | Final structured-output tool with `terminate: true` | `registerTool`, terminating tool results |
2305
2479
  | `truncated-tool.ts` | Output truncation example | `registerTool`, `truncateHead` |
2306
2480
  | `tool-override.ts` | Override built-in read tool | `registerTool` (same name as built-in) |
2307
2481
  | **Commands** |||
@@ -2322,6 +2496,7 @@ All examples in [examples/extensions/](../examples/extensions/).
2322
2496
  | `provider-payload.ts` | Inspect payloads and provider response headers | `on("before_provider_request")`, `on("after_provider_response")` |
2323
2497
  | `system-prompt-header.ts` | Display system prompt info | `on("agent_start")`, `getSystemPrompt` |
2324
2498
  | `claude-rules.ts` | Load rules from files | `on("session_start")`, `on("before_agent_start")` |
2499
+ | `prompt-customizer.ts` | Add context-aware tool guidance using `systemPromptOptions` | `on("before_agent_start")`, `BuildSystemPromptOptions` |
2325
2500
  | `file-trigger.ts` | File watcher triggers messages | `sendMessage` |
2326
2501
  | **Compaction & Sessions** |||
2327
2502
  | `custom-compaction.ts` | Custom compaction summary | `on("session_before_compact")` |
@@ -2331,6 +2506,7 @@ All examples in [examples/extensions/](../examples/extensions/).
2331
2506
  | **UI Components** |||
2332
2507
  | `status-line.ts` | Footer status indicator | `setStatus`, session events |
2333
2508
  | `working-indicator.ts` | Customize the streaming working indicator | `setWorkingIndicator`, `registerCommand` |
2509
+ | `github-issue-autocomplete.ts` | Add `#1234` issue completions on top of built-in autocomplete by preloading recent open issues from `gh issue list` | `addAutocompleteProvider`, `on("session_start")`, `exec` |
2334
2510
  | `custom-footer.ts` | Replace footer entirely | `registerCommand`, `setFooter` |
2335
2511
  | `custom-header.ts` | Replace startup header | `on("session_start")`, `setHeader` |
2336
2512
  | `modal-editor.ts` | Vim-style modal editor | `setEditorComponent`, `CustomEditor` |
File without changes
File without changes
File without changes
File without changes
package/docs/index.md ADDED
@@ -0,0 +1,61 @@
1
+ # Pi Documentation
2
+
3
+ Pi is a minimal terminal coding harness. It is designed to stay small at the core while being extended through TypeScript extensions, skills, prompt templates, themes, and pi packages.
4
+
5
+ ## Quick start
6
+
7
+ Install pi with npm:
8
+
9
+ ```bash
10
+ npm install -g @eminent337/aery
11
+ ```
12
+
13
+ Then run it in a project directory:
14
+
15
+ ```bash
16
+ pi
17
+ ```
18
+
19
+ Authenticate with `/login` for subscription providers, or set an API key such as `ANTHROPIC_API_KEY` before starting pi.
20
+
21
+ For the full first-run flow, see [Quickstart](quickstart.md).
22
+
23
+ ## Start here
24
+
25
+ - [Quickstart](quickstart.md) - install, authenticate, and run a first session.
26
+ - [Using Pi](usage.md) - interactive mode, slash commands, context files, and CLI reference.
27
+ - [Providers](providers.md) - subscription and API-key setup for built-in providers.
28
+ - [Settings](settings.md) - global and project settings.
29
+ - [Keybindings](keybindings.md) - default shortcuts and custom keybindings.
30
+ - [Sessions](session.md) - session storage format and session files.
31
+ - [Session tree](tree.md) - branching and navigating previous turns.
32
+ - [Compaction](compaction.md) - context compaction and branch summarization.
33
+
34
+ ## Customization
35
+
36
+ - [Extensions](extensions.md) - TypeScript modules for tools, commands, events, and custom UI.
37
+ - [Skills](skills.md) - Agent Skills for reusable on-demand capabilities.
38
+ - [Prompt templates](prompt-templates.md) - reusable prompts that expand from slash commands.
39
+ - [Themes](themes.md) - built-in and custom terminal themes.
40
+ - [Pi packages](packages.md) - bundle and share extensions, skills, prompts, and themes.
41
+ - [Custom models](models.md) - add model entries for supported provider APIs.
42
+ - [Custom providers](custom-provider.md) - implement custom APIs and OAuth flows.
43
+
44
+ ## Programmatic usage
45
+
46
+ - [SDK](sdk.md) - embed pi in Node.js applications.
47
+ - [RPC mode](rpc.md) - integrate over stdin/stdout JSONL.
48
+ - [JSON event stream mode](json.md) - print mode with structured events.
49
+ - [TUI components](tui.md) - build custom terminal UI for extensions.
50
+
51
+ ## Platform setup
52
+
53
+ - [Windows](windows.md)
54
+ - [Termux on Android](termux.md)
55
+ - [tmux](tmux.md)
56
+ - [Terminal setup](terminal-setup.md)
57
+ - [Shell aliases](shell-aliases.md)
58
+
59
+ ## Development
60
+
61
+ - [Development](development.md) - local setup, project structure, and debugging.
package/docs/json.md CHANGED
File without changes
File without changes
package/docs/models.md CHANGED
@@ -11,6 +11,7 @@ Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.aery/
11
11
  - [Model Configuration](#model-configuration)
12
12
  - [Overriding Built-in Providers](#overriding-built-in-providers)
13
13
  - [Per-model Overrides](#per-model-overrides)
14
+ - [Anthropic Messages Compatibility](#anthropic-messages-compatibility)
14
15
  - [OpenAI Compatibility](#openai-compatibility)
15
16
 
16
17
  ## Minimal Example
@@ -195,7 +196,7 @@ If your command is slow, expensive, rate-limited, or should keep using a previou
195
196
  | `contextWindow` | No | `128000` | Context window size in tokens |
196
197
  | `maxTokens` | No | `16384` | Maximum output tokens |
197
198
  | `cost` | No | all zeros | `{"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0}` (per million tokens) |
198
- | `compat` | No | provider `compat` | OpenAI compatibility overrides. Merged with provider-level `compat` when both are set. |
199
+ | `compat` | No | provider `compat` | Provider compatibility overrides. Merged with provider-level `compat` when both are set. |
199
200
 
200
201
  Current behavior:
201
202
  - `/model` and `--list-models` list entries by model `id`.
@@ -269,6 +270,40 @@ Behavior notes:
269
270
  - You can combine provider-level `baseUrl`/`headers` with `modelOverrides`.
270
271
  - If `models` is also defined for a provider, custom models are merged after built-in overrides. A custom model with the same `id` replaces the overridden built-in model entry.
271
272
 
273
+ ## Anthropic Messages Compatibility
274
+
275
+ For providers or proxies using `api: "anthropic-messages"`, use `compat.supportsEagerToolInputStreaming` to control Anthropic fine-grained tool streaming compatibility.
276
+
277
+ By default pi sends per-tool `eager_input_streaming: true`. If a proxy or Anthropic-compatible backend rejects that field, set `supportsEagerToolInputStreaming` to `false`. Pi will omit `tools[].eager_input_streaming` and send the legacy `fine-grained-tool-streaming-2025-05-14` beta header for tool-enabled requests instead.
278
+
279
+ ```json
280
+ {
281
+ "providers": {
282
+ "anthropic-proxy": {
283
+ "baseUrl": "https://proxy.example.com",
284
+ "api": "anthropic-messages",
285
+ "apiKey": "ANTHROPIC_PROXY_KEY",
286
+ "compat": {
287
+ "supportsEagerToolInputStreaming": false,
288
+ "supportsLongCacheRetention": true
289
+ },
290
+ "models": [
291
+ {
292
+ "id": "claude-opus-4-7",
293
+ "reasoning": true,
294
+ "input": ["text", "image"]
295
+ }
296
+ ]
297
+ }
298
+ }
299
+ }
300
+ ```
301
+
302
+ | Field | Description |
303
+ |-------|-------------|
304
+ | `supportsEagerToolInputStreaming` | Whether the provider accepts per-tool `eager_input_streaming`. Default: `true`. Set to `false` to omit that field and use the legacy fine-grained tool streaming beta header on tool-enabled requests. |
305
+ | `supportsLongCacheRetention` | Whether the provider accepts Anthropic long cache retention (`cache_control.ttl: "1h"`) when cache retention is `long`. Default: `true`. |
306
+
272
307
  ## OpenAI Compatibility
273
308
 
274
309
  For providers with partial OpenAI compatibility, use the `compat` field.
@@ -303,9 +338,11 @@ For providers with partial OpenAI compatibility, use the `compat` field.
303
338
  | `requiresToolResultName` | Include `name` on tool result messages |
304
339
  | `requiresAssistantAfterToolResult` | Insert an assistant message before a user message after tool results |
305
340
  | `requiresThinkingAsText` | Convert thinking blocks to plain text |
306
- | `thinkingFormat` | Use `reasoning_effort`, `zai`, `qwen`, or `qwen-chat-template` thinking parameters |
341
+ | `requiresReasoningContentOnAssistantMessages` | Include empty `reasoning_content` on all replayed assistant messages when reasoning is enabled |
342
+ | `thinkingFormat` | Use `reasoning_effort`, `deepseek`, `zai`, `qwen`, or `qwen-chat-template` thinking parameters |
307
343
  | `cacheControlFormat` | Use Anthropic-style `cache_control` markers on the system prompt, last tool definition, and last user/assistant text content. Currently only `anthropic` is supported. |
308
344
  | `supportsStrictMode` | Include the `strict` field in tool definitions |
345
+ | `supportsLongCacheRetention` | Whether the provider accepts long cache retention when cache retention is `long`: `prompt_cache_retention: "24h"` for OpenAI prompt caching, or `cache_control.ttl: "1h"` when `cacheControlFormat` is `anthropic`. Default: `true`. |
309
346
  | `openRouterRouting` | OpenRouter provider routing preferences. This object is sent as-is in the `provider` field of the [OpenRouter API request](https://openrouter.ai/docs/guides/routing/provider-selection). |
310
347
  | `vercelGatewayRouting` | Vercel AI Gateway routing config for provider selection (`only`, `order`) |
311
348
 
package/docs/packages.md CHANGED
File without changes
File without changes