@ashx-j/lunr-dev 0.2.13-dev.1.1

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 (2280) hide show
  1. package/CHANGELOG.md +5055 -0
  2. package/README.md +25 -0
  3. package/dist/builtin-extensions/ashxj-spinners.d.ts +7 -0
  4. package/dist/builtin-extensions/ashxj-spinners.d.ts.map +1 -0
  5. package/dist/builtin-extensions/ashxj-spinners.js +282 -0
  6. package/dist/builtin-extensions/ashxj-spinners.js.map +1 -0
  7. package/dist/builtin-extensions/ashxj-thinking.d.ts +66 -0
  8. package/dist/builtin-extensions/ashxj-thinking.d.ts.map +1 -0
  9. package/dist/builtin-extensions/ashxj-thinking.js +321 -0
  10. package/dist/builtin-extensions/ashxj-thinking.js.map +1 -0
  11. package/dist/builtin-extensions/ashxj-tui.d.ts +148 -0
  12. package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -0
  13. package/dist/builtin-extensions/ashxj-tui.js +679 -0
  14. package/dist/builtin-extensions/ashxj-tui.js.map +1 -0
  15. package/dist/builtin-extensions/index.d.ts +34 -0
  16. package/dist/builtin-extensions/index.d.ts.map +1 -0
  17. package/dist/builtin-extensions/index.js +81 -0
  18. package/dist/builtin-extensions/index.js.map +1 -0
  19. package/dist/builtin-extensions/lunr-cron.d.ts +26 -0
  20. package/dist/builtin-extensions/lunr-cron.d.ts.map +1 -0
  21. package/dist/builtin-extensions/lunr-cron.js +351 -0
  22. package/dist/builtin-extensions/lunr-cron.js.map +1 -0
  23. package/dist/builtin-extensions/lunr-local-providers/index.d.ts +20 -0
  24. package/dist/builtin-extensions/lunr-local-providers/index.d.ts.map +1 -0
  25. package/dist/builtin-extensions/lunr-local-providers/index.js +130 -0
  26. package/dist/builtin-extensions/lunr-local-providers/index.js.map +1 -0
  27. package/dist/builtin-extensions/lunr-local-providers/local-servers.d.ts +51 -0
  28. package/dist/builtin-extensions/lunr-local-providers/local-servers.d.ts.map +1 -0
  29. package/dist/builtin-extensions/lunr-local-providers/local-servers.js +130 -0
  30. package/dist/builtin-extensions/lunr-local-providers/local-servers.js.map +1 -0
  31. package/dist/builtin-extensions/lunr-plan-tools.d.ts +25 -0
  32. package/dist/builtin-extensions/lunr-plan-tools.d.ts.map +1 -0
  33. package/dist/builtin-extensions/lunr-plan-tools.js +59 -0
  34. package/dist/builtin-extensions/lunr-plan-tools.js.map +1 -0
  35. package/dist/builtin-extensions/lunr-skill-creator/index.d.ts +12 -0
  36. package/dist/builtin-extensions/lunr-skill-creator/index.d.ts.map +1 -0
  37. package/dist/builtin-extensions/lunr-skill-creator/index.js +18 -0
  38. package/dist/builtin-extensions/lunr-skill-creator/index.js.map +1 -0
  39. package/dist/builtin-extensions/lunr-skill-creator/skills/skill-creator/SKILL.md +68 -0
  40. package/dist/builtin-extensions/lunr-todos.d.ts +50 -0
  41. package/dist/builtin-extensions/lunr-todos.d.ts.map +1 -0
  42. package/dist/builtin-extensions/lunr-todos.js +210 -0
  43. package/dist/builtin-extensions/lunr-todos.js.map +1 -0
  44. package/dist/builtin-extensions/narumiruna-pi-goal/src/accounting.d.ts +23 -0
  45. package/dist/builtin-extensions/narumiruna-pi-goal/src/accounting.d.ts.map +1 -0
  46. package/dist/builtin-extensions/narumiruna-pi-goal/src/accounting.js +77 -0
  47. package/dist/builtin-extensions/narumiruna-pi-goal/src/accounting.js.map +1 -0
  48. package/dist/builtin-extensions/narumiruna-pi-goal/src/command.d.ts +18 -0
  49. package/dist/builtin-extensions/narumiruna-pi-goal/src/command.d.ts.map +1 -0
  50. package/dist/builtin-extensions/narumiruna-pi-goal/src/command.js +165 -0
  51. package/dist/builtin-extensions/narumiruna-pi-goal/src/command.js.map +1 -0
  52. package/dist/builtin-extensions/narumiruna-pi-goal/src/commands.d.ts +19 -0
  53. package/dist/builtin-extensions/narumiruna-pi-goal/src/commands.d.ts.map +1 -0
  54. package/dist/builtin-extensions/narumiruna-pi-goal/src/commands.js +499 -0
  55. package/dist/builtin-extensions/narumiruna-pi-goal/src/commands.js.map +1 -0
  56. package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.d.ts +10 -0
  57. package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.d.ts.map +1 -0
  58. package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.js +885 -0
  59. package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.js.map +1 -0
  60. package/dist/builtin-extensions/narumiruna-pi-goal/src/persistence.d.ts +57 -0
  61. package/dist/builtin-extensions/narumiruna-pi-goal/src/persistence.d.ts.map +1 -0
  62. package/dist/builtin-extensions/narumiruna-pi-goal/src/persistence.js +225 -0
  63. package/dist/builtin-extensions/narumiruna-pi-goal/src/persistence.js.map +1 -0
  64. package/dist/builtin-extensions/narumiruna-pi-goal/src/prompts.d.ts +20 -0
  65. package/dist/builtin-extensions/narumiruna-pi-goal/src/prompts.d.ts.map +1 -0
  66. package/dist/builtin-extensions/narumiruna-pi-goal/src/prompts.js +75 -0
  67. package/dist/builtin-extensions/narumiruna-pi-goal/src/prompts.js.map +1 -0
  68. package/dist/builtin-extensions/narumiruna-pi-goal/src/queue.d.ts +16 -0
  69. package/dist/builtin-extensions/narumiruna-pi-goal/src/queue.d.ts.map +1 -0
  70. package/dist/builtin-extensions/narumiruna-pi-goal/src/queue.js +67 -0
  71. package/dist/builtin-extensions/narumiruna-pi-goal/src/queue.js.map +1 -0
  72. package/dist/builtin-extensions/narumiruna-pi-goal/src/runtime.d.ts +158 -0
  73. package/dist/builtin-extensions/narumiruna-pi-goal/src/runtime.d.ts.map +1 -0
  74. package/dist/builtin-extensions/narumiruna-pi-goal/src/runtime.js +835 -0
  75. package/dist/builtin-extensions/narumiruna-pi-goal/src/runtime.js.map +1 -0
  76. package/dist/builtin-extensions/narumiruna-pi-goal/src/settings.d.ts +22 -0
  77. package/dist/builtin-extensions/narumiruna-pi-goal/src/settings.d.ts.map +1 -0
  78. package/dist/builtin-extensions/narumiruna-pi-goal/src/settings.js +64 -0
  79. package/dist/builtin-extensions/narumiruna-pi-goal/src/settings.js.map +1 -0
  80. package/dist/builtin-extensions/pi-intercom/broker/broker.d.ts +2 -0
  81. package/dist/builtin-extensions/pi-intercom/broker/broker.d.ts.map +1 -0
  82. package/dist/builtin-extensions/pi-intercom/broker/broker.js +541 -0
  83. package/dist/builtin-extensions/pi-intercom/broker/broker.js.map +1 -0
  84. package/dist/builtin-extensions/pi-intercom/broker/client.d.ts +39 -0
  85. package/dist/builtin-extensions/pi-intercom/broker/client.d.ts.map +1 -0
  86. package/dist/builtin-extensions/pi-intercom/broker/client.js +484 -0
  87. package/dist/builtin-extensions/pi-intercom/broker/client.js.map +1 -0
  88. package/dist/builtin-extensions/pi-intercom/broker/framing.d.ts +14 -0
  89. package/dist/builtin-extensions/pi-intercom/broker/framing.d.ts.map +1 -0
  90. package/dist/builtin-extensions/pi-intercom/broker/framing.js +74 -0
  91. package/dist/builtin-extensions/pi-intercom/broker/framing.js.map +1 -0
  92. package/dist/builtin-extensions/pi-intercom/broker/paths.d.ts +22 -0
  93. package/dist/builtin-extensions/pi-intercom/broker/paths.d.ts.map +1 -0
  94. package/dist/builtin-extensions/pi-intercom/broker/paths.js +88 -0
  95. package/dist/builtin-extensions/pi-intercom/broker/paths.js.map +1 -0
  96. package/dist/builtin-extensions/pi-intercom/broker/spawn.d.ts +27 -0
  97. package/dist/builtin-extensions/pi-intercom/broker/spawn.d.ts.map +1 -0
  98. package/dist/builtin-extensions/pi-intercom/broker/spawn.js +313 -0
  99. package/dist/builtin-extensions/pi-intercom/broker/spawn.js.map +1 -0
  100. package/dist/builtin-extensions/pi-intercom/config.d.ts +22 -0
  101. package/dist/builtin-extensions/pi-intercom/config.d.ts.map +1 -0
  102. package/dist/builtin-extensions/pi-intercom/config.js +103 -0
  103. package/dist/builtin-extensions/pi-intercom/config.js.map +1 -0
  104. package/dist/builtin-extensions/pi-intercom/index.d.ts +3 -0
  105. package/dist/builtin-extensions/pi-intercom/index.d.ts.map +1 -0
  106. package/dist/builtin-extensions/pi-intercom/index.js +1800 -0
  107. package/dist/builtin-extensions/pi-intercom/index.js.map +1 -0
  108. package/dist/builtin-extensions/pi-intercom/reply-tracker.d.ts +27 -0
  109. package/dist/builtin-extensions/pi-intercom/reply-tracker.d.ts.map +1 -0
  110. package/dist/builtin-extensions/pi-intercom/reply-tracker.js +101 -0
  111. package/dist/builtin-extensions/pi-intercom/reply-tracker.js.map +1 -0
  112. package/dist/builtin-extensions/pi-intercom/types.d.ts +84 -0
  113. package/dist/builtin-extensions/pi-intercom/types.d.ts.map +1 -0
  114. package/dist/builtin-extensions/pi-intercom/types.js +2 -0
  115. package/dist/builtin-extensions/pi-intercom/types.js.map +1 -0
  116. package/dist/builtin-extensions/pi-intercom/ui/compose.d.ts +27 -0
  117. package/dist/builtin-extensions/pi-intercom/ui/compose.d.ts.map +1 -0
  118. package/dist/builtin-extensions/pi-intercom/ui/compose.js +112 -0
  119. package/dist/builtin-extensions/pi-intercom/ui/compose.js.map +1 -0
  120. package/dist/builtin-extensions/pi-intercom/ui/inline-message.d.ts +15 -0
  121. package/dist/builtin-extensions/pi-intercom/ui/inline-message.d.ts.map +1 -0
  122. package/dist/builtin-extensions/pi-intercom/ui/inline-message.js +86 -0
  123. package/dist/builtin-extensions/pi-intercom/ui/inline-message.js.map +1 -0
  124. package/dist/builtin-extensions/pi-intercom/ui/session-list.d.ts +18 -0
  125. package/dist/builtin-extensions/pi-intercom/ui/session-list.d.ts.map +1 -0
  126. package/dist/builtin-extensions/pi-intercom/ui/session-list.js +134 -0
  127. package/dist/builtin-extensions/pi-intercom/ui/session-list.js.map +1 -0
  128. package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/bemol.d.ts +81 -0
  129. package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/bemol.d.ts.map +1 -0
  130. package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/bemol.js +273 -0
  131. package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/bemol.js.map +1 -0
  132. package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/index.d.ts +13 -0
  133. package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/index.d.ts.map +1 -0
  134. package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/index.js +163 -0
  135. package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/index.js.map +1 -0
  136. package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/locks.d.ts +34 -0
  137. package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/locks.d.ts.map +1 -0
  138. package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/locks.js +148 -0
  139. package/dist/builtin-extensions/pi-lsp-extension/bemol-extension/locks.js.map +1 -0
  140. package/dist/builtin-extensions/pi-lsp-extension/src/file-sync.d.ts +59 -0
  141. package/dist/builtin-extensions/pi-lsp-extension/src/file-sync.d.ts.map +1 -0
  142. package/dist/builtin-extensions/pi-lsp-extension/src/file-sync.js +172 -0
  143. package/dist/builtin-extensions/pi-lsp-extension/src/file-sync.js.map +1 -0
  144. package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts +25 -0
  145. package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts.map +1 -0
  146. package/dist/builtin-extensions/pi-lsp-extension/src/index.js +521 -0
  147. package/dist/builtin-extensions/pi-lsp-extension/src/index.js.map +1 -0
  148. package/dist/builtin-extensions/pi-lsp-extension/src/lsp-client.d.ts +80 -0
  149. package/dist/builtin-extensions/pi-lsp-extension/src/lsp-client.d.ts.map +1 -0
  150. package/dist/builtin-extensions/pi-lsp-extension/src/lsp-client.js +366 -0
  151. package/dist/builtin-extensions/pi-lsp-extension/src/lsp-client.js.map +1 -0
  152. package/dist/builtin-extensions/pi-lsp-extension/src/lsp-daemon.d.ts +22 -0
  153. package/dist/builtin-extensions/pi-lsp-extension/src/lsp-daemon.d.ts.map +1 -0
  154. package/dist/builtin-extensions/pi-lsp-extension/src/lsp-daemon.js +476 -0
  155. package/dist/builtin-extensions/pi-lsp-extension/src/lsp-daemon.js.map +1 -0
  156. package/dist/builtin-extensions/pi-lsp-extension/src/lsp-manager.d.ts +141 -0
  157. package/dist/builtin-extensions/pi-lsp-extension/src/lsp-manager.d.ts.map +1 -0
  158. package/dist/builtin-extensions/pi-lsp-extension/src/lsp-manager.js +633 -0
  159. package/dist/builtin-extensions/pi-lsp-extension/src/lsp-manager.js.map +1 -0
  160. package/dist/builtin-extensions/pi-lsp-extension/src/resolve-provider.d.ts +30 -0
  161. package/dist/builtin-extensions/pi-lsp-extension/src/resolve-provider.d.ts.map +1 -0
  162. package/dist/builtin-extensions/pi-lsp-extension/src/resolve-provider.js +52 -0
  163. package/dist/builtin-extensions/pi-lsp-extension/src/resolve-provider.js.map +1 -0
  164. package/dist/builtin-extensions/pi-lsp-extension/src/shared/constants.d.ts +12 -0
  165. package/dist/builtin-extensions/pi-lsp-extension/src/shared/constants.d.ts.map +1 -0
  166. package/dist/builtin-extensions/pi-lsp-extension/src/shared/constants.js +18 -0
  167. package/dist/builtin-extensions/pi-lsp-extension/src/shared/constants.js.map +1 -0
  168. package/dist/builtin-extensions/pi-lsp-extension/src/shared/debug.d.ts +10 -0
  169. package/dist/builtin-extensions/pi-lsp-extension/src/shared/debug.d.ts.map +1 -0
  170. package/dist/builtin-extensions/pi-lsp-extension/src/shared/debug.js +18 -0
  171. package/dist/builtin-extensions/pi-lsp-extension/src/shared/debug.js.map +1 -0
  172. package/dist/builtin-extensions/pi-lsp-extension/src/shared/format.d.ts +9 -0
  173. package/dist/builtin-extensions/pi-lsp-extension/src/shared/format.d.ts.map +1 -0
  174. package/dist/builtin-extensions/pi-lsp-extension/src/shared/format.js +29 -0
  175. package/dist/builtin-extensions/pi-lsp-extension/src/shared/format.js.map +1 -0
  176. package/dist/builtin-extensions/pi-lsp-extension/src/shared/language-map.d.ts +10 -0
  177. package/dist/builtin-extensions/pi-lsp-extension/src/shared/language-map.d.ts.map +1 -0
  178. package/dist/builtin-extensions/pi-lsp-extension/src/shared/language-map.js +51 -0
  179. package/dist/builtin-extensions/pi-lsp-extension/src/shared/language-map.js.map +1 -0
  180. package/dist/builtin-extensions/pi-lsp-extension/src/shared/resolve-position.d.ts +33 -0
  181. package/dist/builtin-extensions/pi-lsp-extension/src/shared/resolve-position.d.ts.map +1 -0
  182. package/dist/builtin-extensions/pi-lsp-extension/src/shared/resolve-position.js +191 -0
  183. package/dist/builtin-extensions/pi-lsp-extension/src/shared/resolve-position.js.map +1 -0
  184. package/dist/builtin-extensions/pi-lsp-extension/src/shared/timing.d.ts +14 -0
  185. package/dist/builtin-extensions/pi-lsp-extension/src/shared/timing.d.ts.map +1 -0
  186. package/dist/builtin-extensions/pi-lsp-extension/src/shared/timing.js +15 -0
  187. package/dist/builtin-extensions/pi-lsp-extension/src/shared/timing.js.map +1 -0
  188. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-actions.d.ts +23 -0
  189. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-actions.d.ts.map +1 -0
  190. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-actions.js +259 -0
  191. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-actions.js.map +1 -0
  192. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-overview.d.ts +23 -0
  193. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-overview.d.ts.map +1 -0
  194. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-overview.js +197 -0
  195. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-overview.js.map +1 -0
  196. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-rewrite.d.ts +23 -0
  197. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-rewrite.d.ts.map +1 -0
  198. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-rewrite.js +131 -0
  199. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-rewrite.js.map +1 -0
  200. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-search.d.ts +18 -0
  201. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-search.d.ts.map +1 -0
  202. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-search.js +87 -0
  203. package/dist/builtin-extensions/pi-lsp-extension/src/tools/code-search.js.map +1 -0
  204. package/dist/builtin-extensions/pi-lsp-extension/src/tools/completions.d.ts +34 -0
  205. package/dist/builtin-extensions/pi-lsp-extension/src/tools/completions.d.ts.map +1 -0
  206. package/dist/builtin-extensions/pi-lsp-extension/src/tools/completions.js +347 -0
  207. package/dist/builtin-extensions/pi-lsp-extension/src/tools/completions.js.map +1 -0
  208. package/dist/builtin-extensions/pi-lsp-extension/src/tools/definition.d.ts +20 -0
  209. package/dist/builtin-extensions/pi-lsp-extension/src/tools/definition.d.ts.map +1 -0
  210. package/dist/builtin-extensions/pi-lsp-extension/src/tools/definition.js +166 -0
  211. package/dist/builtin-extensions/pi-lsp-extension/src/tools/definition.js.map +1 -0
  212. package/dist/builtin-extensions/pi-lsp-extension/src/tools/diagnostics.d.ts +22 -0
  213. package/dist/builtin-extensions/pi-lsp-extension/src/tools/diagnostics.d.ts.map +1 -0
  214. package/dist/builtin-extensions/pi-lsp-extension/src/tools/diagnostics.js +228 -0
  215. package/dist/builtin-extensions/pi-lsp-extension/src/tools/diagnostics.js.map +1 -0
  216. package/dist/builtin-extensions/pi-lsp-extension/src/tools/hover.d.ts +19 -0
  217. package/dist/builtin-extensions/pi-lsp-extension/src/tools/hover.d.ts.map +1 -0
  218. package/dist/builtin-extensions/pi-lsp-extension/src/tools/hover.js +143 -0
  219. package/dist/builtin-extensions/pi-lsp-extension/src/tools/hover.js.map +1 -0
  220. package/dist/builtin-extensions/pi-lsp-extension/src/tools/references.d.ts +20 -0
  221. package/dist/builtin-extensions/pi-lsp-extension/src/tools/references.d.ts.map +1 -0
  222. package/dist/builtin-extensions/pi-lsp-extension/src/tools/references.js +98 -0
  223. package/dist/builtin-extensions/pi-lsp-extension/src/tools/references.js.map +1 -0
  224. package/dist/builtin-extensions/pi-lsp-extension/src/tools/rename.d.ts +22 -0
  225. package/dist/builtin-extensions/pi-lsp-extension/src/tools/rename.d.ts.map +1 -0
  226. package/dist/builtin-extensions/pi-lsp-extension/src/tools/rename.js +150 -0
  227. package/dist/builtin-extensions/pi-lsp-extension/src/tools/rename.js.map +1 -0
  228. package/dist/builtin-extensions/pi-lsp-extension/src/tools/symbols.d.ts +18 -0
  229. package/dist/builtin-extensions/pi-lsp-extension/src/tools/symbols.d.ts.map +1 -0
  230. package/dist/builtin-extensions/pi-lsp-extension/src/tools/symbols.js +211 -0
  231. package/dist/builtin-extensions/pi-lsp-extension/src/tools/symbols.js.map +1 -0
  232. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/parser-manager.d.ts +44 -0
  233. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/parser-manager.d.ts.map +1 -0
  234. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/parser-manager.js +188 -0
  235. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/parser-manager.js.map +1 -0
  236. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/pattern-compiler.d.ts +58 -0
  237. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/pattern-compiler.d.ts.map +1 -0
  238. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/pattern-compiler.js +260 -0
  239. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/pattern-compiler.js.map +1 -0
  240. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/rewrite-engine.d.ts +33 -0
  241. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/rewrite-engine.d.ts.map +1 -0
  242. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/rewrite-engine.js +102 -0
  243. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/rewrite-engine.js.map +1 -0
  244. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/search-engine.d.ts +38 -0
  245. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/search-engine.d.ts.map +1 -0
  246. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/search-engine.js +276 -0
  247. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/search-engine.js.map +1 -0
  248. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/symbol-extractor.d.ts +77 -0
  249. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/symbol-extractor.d.ts.map +1 -0
  250. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/symbol-extractor.js +339 -0
  251. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/symbol-extractor.js.map +1 -0
  252. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/workspace-index.d.ts +51 -0
  253. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/workspace-index.d.ts.map +1 -0
  254. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/workspace-index.js +219 -0
  255. package/dist/builtin-extensions/pi-lsp-extension/src/tree-sitter/workspace-index.js.map +1 -0
  256. package/dist/builtin-extensions/pi-lsp-extension/src/workspace-provider.d.ts +45 -0
  257. package/dist/builtin-extensions/pi-lsp-extension/src/workspace-provider.d.ts.map +1 -0
  258. package/dist/builtin-extensions/pi-lsp-extension/src/workspace-provider.js +30 -0
  259. package/dist/builtin-extensions/pi-lsp-extension/src/workspace-provider.js.map +1 -0
  260. package/dist/builtin-extensions/pi-mcp-adapter/abort.d.ts +3 -0
  261. package/dist/builtin-extensions/pi-mcp-adapter/abort.d.ts.map +1 -0
  262. package/dist/builtin-extensions/pi-mcp-adapter/abort.js +37 -0
  263. package/dist/builtin-extensions/pi-mcp-adapter/abort.js.map +1 -0
  264. package/dist/builtin-extensions/pi-mcp-adapter/agent-dir.d.ts +3 -0
  265. package/dist/builtin-extensions/pi-mcp-adapter/agent-dir.d.ts.map +1 -0
  266. package/dist/builtin-extensions/pi-mcp-adapter/agent-dir.js +22 -0
  267. package/dist/builtin-extensions/pi-mcp-adapter/agent-dir.js.map +1 -0
  268. package/dist/builtin-extensions/pi-mcp-adapter/commands.d.ts +18 -0
  269. package/dist/builtin-extensions/pi-mcp-adapter/commands.d.ts.map +1 -0
  270. package/dist/builtin-extensions/pi-mcp-adapter/commands.js +327 -0
  271. package/dist/builtin-extensions/pi-mcp-adapter/commands.js.map +1 -0
  272. package/dist/builtin-extensions/pi-mcp-adapter/config.d.ts +79 -0
  273. package/dist/builtin-extensions/pi-mcp-adapter/config.d.ts.map +1 -0
  274. package/dist/builtin-extensions/pi-mcp-adapter/config.js +557 -0
  275. package/dist/builtin-extensions/pi-mcp-adapter/config.js.map +1 -0
  276. package/dist/builtin-extensions/pi-mcp-adapter/consent-manager.d.ts +14 -0
  277. package/dist/builtin-extensions/pi-mcp-adapter/consent-manager.d.ts.map +1 -0
  278. package/dist/builtin-extensions/pi-mcp-adapter/consent-manager.js +61 -0
  279. package/dist/builtin-extensions/pi-mcp-adapter/consent-manager.js.map +1 -0
  280. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts +11 -0
  281. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts.map +1 -0
  282. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js +374 -0
  283. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js.map +1 -0
  284. package/dist/builtin-extensions/pi-mcp-adapter/elicitation-handler.d.ts +18 -0
  285. package/dist/builtin-extensions/pi-mcp-adapter/elicitation-handler.d.ts.map +1 -0
  286. package/dist/builtin-extensions/pi-mcp-adapter/elicitation-handler.js +309 -0
  287. package/dist/builtin-extensions/pi-mcp-adapter/elicitation-handler.js.map +1 -0
  288. package/dist/builtin-extensions/pi-mcp-adapter/error-signal.d.ts +16 -0
  289. package/dist/builtin-extensions/pi-mcp-adapter/error-signal.d.ts.map +1 -0
  290. package/dist/builtin-extensions/pi-mcp-adapter/error-signal.js +23 -0
  291. package/dist/builtin-extensions/pi-mcp-adapter/error-signal.js.map +1 -0
  292. package/dist/builtin-extensions/pi-mcp-adapter/errors.d.ts +100 -0
  293. package/dist/builtin-extensions/pi-mcp-adapter/errors.d.ts.map +1 -0
  294. package/dist/builtin-extensions/pi-mcp-adapter/errors.js +167 -0
  295. package/dist/builtin-extensions/pi-mcp-adapter/errors.js.map +1 -0
  296. package/dist/builtin-extensions/pi-mcp-adapter/glimpse-ui.d.ts +10 -0
  297. package/dist/builtin-extensions/pi-mcp-adapter/glimpse-ui.d.ts.map +1 -0
  298. package/dist/builtin-extensions/pi-mcp-adapter/glimpse-ui.js +77 -0
  299. package/dist/builtin-extensions/pi-mcp-adapter/glimpse-ui.js.map +1 -0
  300. package/dist/builtin-extensions/pi-mcp-adapter/host-html-template.d.ts +17 -0
  301. package/dist/builtin-extensions/pi-mcp-adapter/host-html-template.d.ts.map +1 -0
  302. package/dist/builtin-extensions/pi-mcp-adapter/host-html-template.js +413 -0
  303. package/dist/builtin-extensions/pi-mcp-adapter/host-html-template.js.map +1 -0
  304. package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts +3 -0
  305. package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -0
  306. package/dist/builtin-extensions/pi-mcp-adapter/index.js +334 -0
  307. package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -0
  308. package/dist/builtin-extensions/pi-mcp-adapter/init.d.ts +11 -0
  309. package/dist/builtin-extensions/pi-mcp-adapter/init.d.ts.map +1 -0
  310. package/dist/builtin-extensions/pi-mcp-adapter/init.js +296 -0
  311. package/dist/builtin-extensions/pi-mcp-adapter/init.js.map +1 -0
  312. package/dist/builtin-extensions/pi-mcp-adapter/lifecycle.d.ts +30 -0
  313. package/dist/builtin-extensions/pi-mcp-adapter/lifecycle.d.ts.map +1 -0
  314. package/dist/builtin-extensions/pi-mcp-adapter/lifecycle.js +80 -0
  315. package/dist/builtin-extensions/pi-mcp-adapter/lifecycle.js.map +1 -0
  316. package/dist/builtin-extensions/pi-mcp-adapter/logger.d.ts +52 -0
  317. package/dist/builtin-extensions/pi-mcp-adapter/logger.d.ts.map +1 -0
  318. package/dist/builtin-extensions/pi-mcp-adapter/logger.js +132 -0
  319. package/dist/builtin-extensions/pi-mcp-adapter/logger.js.map +1 -0
  320. package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth-flow.d.ts +86 -0
  321. package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth-flow.d.ts.map +1 -0
  322. package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth-flow.js +482 -0
  323. package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth-flow.js.map +1 -0
  324. package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth.d.ts +104 -0
  325. package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth.d.ts.map +1 -0
  326. package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth.js +252 -0
  327. package/dist/builtin-extensions/pi-mcp-adapter/mcp-auth.js.map +1 -0
  328. package/dist/builtin-extensions/pi-mcp-adapter/mcp-callback-server.d.ts +45 -0
  329. package/dist/builtin-extensions/pi-mcp-adapter/mcp-callback-server.d.ts.map +1 -0
  330. package/dist/builtin-extensions/pi-mcp-adapter/mcp-callback-server.js +305 -0
  331. package/dist/builtin-extensions/pi-mcp-adapter/mcp-callback-server.js.map +1 -0
  332. package/dist/builtin-extensions/pi-mcp-adapter/mcp-oauth-provider.d.ts +111 -0
  333. package/dist/builtin-extensions/pi-mcp-adapter/mcp-oauth-provider.d.ts.map +1 -0
  334. package/dist/builtin-extensions/pi-mcp-adapter/mcp-oauth-provider.js +302 -0
  335. package/dist/builtin-extensions/pi-mcp-adapter/mcp-oauth-provider.js.map +1 -0
  336. package/dist/builtin-extensions/pi-mcp-adapter/mcp-output-guard.d.ts +59 -0
  337. package/dist/builtin-extensions/pi-mcp-adapter/mcp-output-guard.d.ts.map +1 -0
  338. package/dist/builtin-extensions/pi-mcp-adapter/mcp-output-guard.js +325 -0
  339. package/dist/builtin-extensions/pi-mcp-adapter/mcp-output-guard.js.map +1 -0
  340. package/dist/builtin-extensions/pi-mcp-adapter/mcp-panel.d.ts +64 -0
  341. package/dist/builtin-extensions/pi-mcp-adapter/mcp-panel.d.ts.map +1 -0
  342. package/dist/builtin-extensions/pi-mcp-adapter/mcp-panel.js +777 -0
  343. package/dist/builtin-extensions/pi-mcp-adapter/mcp-panel.js.map +1 -0
  344. package/dist/builtin-extensions/pi-mcp-adapter/mcp-setup-panel.d.ts +77 -0
  345. package/dist/builtin-extensions/pi-mcp-adapter/mcp-setup-panel.d.ts.map +1 -0
  346. package/dist/builtin-extensions/pi-mcp-adapter/mcp-setup-panel.js +490 -0
  347. package/dist/builtin-extensions/pi-mcp-adapter/mcp-setup-panel.js.map +1 -0
  348. package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.d.ts +32 -0
  349. package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.d.ts.map +1 -0
  350. package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.js +160 -0
  351. package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.js.map +1 -0
  352. package/dist/builtin-extensions/pi-mcp-adapter/npx-resolver.d.ts +7 -0
  353. package/dist/builtin-extensions/pi-mcp-adapter/npx-resolver.d.ts.map +1 -0
  354. package/dist/builtin-extensions/pi-mcp-adapter/npx-resolver.js +388 -0
  355. package/dist/builtin-extensions/pi-mcp-adapter/npx-resolver.js.map +1 -0
  356. package/dist/builtin-extensions/pi-mcp-adapter/oauth-handler.d.ts +19 -0
  357. package/dist/builtin-extensions/pi-mcp-adapter/oauth-handler.d.ts.map +1 -0
  358. package/dist/builtin-extensions/pi-mcp-adapter/oauth-handler.js +53 -0
  359. package/dist/builtin-extensions/pi-mcp-adapter/oauth-handler.js.map +1 -0
  360. package/dist/builtin-extensions/pi-mcp-adapter/onboarding-state.d.ts +13 -0
  361. package/dist/builtin-extensions/pi-mcp-adapter/onboarding-state.d.ts.map +1 -0
  362. package/dist/builtin-extensions/pi-mcp-adapter/onboarding-state.js +58 -0
  363. package/dist/builtin-extensions/pi-mcp-adapter/onboarding-state.js.map +1 -0
  364. package/dist/builtin-extensions/pi-mcp-adapter/panel-keys.d.ts +17 -0
  365. package/dist/builtin-extensions/pi-mcp-adapter/panel-keys.d.ts.map +1 -0
  366. package/dist/builtin-extensions/pi-mcp-adapter/panel-keys.js +17 -0
  367. package/dist/builtin-extensions/pi-mcp-adapter/panel-keys.js.map +1 -0
  368. package/dist/builtin-extensions/pi-mcp-adapter/proxy-modes.d.ts +14 -0
  369. package/dist/builtin-extensions/pi-mcp-adapter/proxy-modes.d.ts.map +1 -0
  370. package/dist/builtin-extensions/pi-mcp-adapter/proxy-modes.js +853 -0
  371. package/dist/builtin-extensions/pi-mcp-adapter/proxy-modes.js.map +1 -0
  372. package/dist/builtin-extensions/pi-mcp-adapter/resource-tools.d.ts +2 -0
  373. package/dist/builtin-extensions/pi-mcp-adapter/resource-tools.d.ts.map +1 -0
  374. package/dist/builtin-extensions/pi-mcp-adapter/resource-tools.js +16 -0
  375. package/dist/builtin-extensions/pi-mcp-adapter/resource-tools.js.map +1 -0
  376. package/dist/builtin-extensions/pi-mcp-adapter/sampling-handler.d.ts +16 -0
  377. package/dist/builtin-extensions/pi-mcp-adapter/sampling-handler.d.ts.map +1 -0
  378. package/dist/builtin-extensions/pi-mcp-adapter/sampling-handler.js +209 -0
  379. package/dist/builtin-extensions/pi-mcp-adapter/sampling-handler.js.map +1 -0
  380. package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts +58 -0
  381. package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts.map +1 -0
  382. package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js +403 -0
  383. package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js.map +1 -0
  384. package/dist/builtin-extensions/pi-mcp-adapter/state.d.ts +41 -0
  385. package/dist/builtin-extensions/pi-mcp-adapter/state.d.ts.map +1 -0
  386. package/dist/builtin-extensions/pi-mcp-adapter/state.js +2 -0
  387. package/dist/builtin-extensions/pi-mcp-adapter/state.js.map +1 -0
  388. package/dist/builtin-extensions/pi-mcp-adapter/tool-metadata.d.ts +11 -0
  389. package/dist/builtin-extensions/pi-mcp-adapter/tool-metadata.d.ts.map +1 -0
  390. package/dist/builtin-extensions/pi-mcp-adapter/tool-metadata.js +178 -0
  391. package/dist/builtin-extensions/pi-mcp-adapter/tool-metadata.js.map +1 -0
  392. package/dist/builtin-extensions/pi-mcp-adapter/tool-registrar.d.ts +11 -0
  393. package/dist/builtin-extensions/pi-mcp-adapter/tool-registrar.d.ts.map +1 -0
  394. package/dist/builtin-extensions/pi-mcp-adapter/tool-registrar.js +66 -0
  395. package/dist/builtin-extensions/pi-mcp-adapter/tool-registrar.js.map +1 -0
  396. package/dist/builtin-extensions/pi-mcp-adapter/tool-result-renderer.d.ts +35 -0
  397. package/dist/builtin-extensions/pi-mcp-adapter/tool-result-renderer.d.ts.map +1 -0
  398. package/dist/builtin-extensions/pi-mcp-adapter/tool-result-renderer.js +107 -0
  399. package/dist/builtin-extensions/pi-mcp-adapter/tool-result-renderer.js.map +1 -0
  400. package/dist/builtin-extensions/pi-mcp-adapter/types.d.ts +286 -0
  401. package/dist/builtin-extensions/pi-mcp-adapter/types.d.ts.map +1 -0
  402. package/dist/builtin-extensions/pi-mcp-adapter/types.js +94 -0
  403. package/dist/builtin-extensions/pi-mcp-adapter/types.js.map +1 -0
  404. package/dist/builtin-extensions/pi-mcp-adapter/ui-resource-handler.d.ts +10 -0
  405. package/dist/builtin-extensions/pi-mcp-adapter/ui-resource-handler.d.ts.map +1 -0
  406. package/dist/builtin-extensions/pi-mcp-adapter/ui-resource-handler.js +118 -0
  407. package/dist/builtin-extensions/pi-mcp-adapter/ui-resource-handler.js.map +1 -0
  408. package/dist/builtin-extensions/pi-mcp-adapter/ui-server.d.ts +37 -0
  409. package/dist/builtin-extensions/pi-mcp-adapter/ui-server.d.ts.map +1 -0
  410. package/dist/builtin-extensions/pi-mcp-adapter/ui-server.js +524 -0
  411. package/dist/builtin-extensions/pi-mcp-adapter/ui-server.js.map +1 -0
  412. package/dist/builtin-extensions/pi-mcp-adapter/ui-session.d.ts +27 -0
  413. package/dist/builtin-extensions/pi-mcp-adapter/ui-session.d.ts.map +1 -0
  414. package/dist/builtin-extensions/pi-mcp-adapter/ui-session.js +311 -0
  415. package/dist/builtin-extensions/pi-mcp-adapter/ui-session.js.map +1 -0
  416. package/dist/builtin-extensions/pi-mcp-adapter/ui-stream-types.d.ts +105 -0
  417. package/dist/builtin-extensions/pi-mcp-adapter/ui-stream-types.d.ts.map +1 -0
  418. package/dist/builtin-extensions/pi-mcp-adapter/ui-stream-types.js +60 -0
  419. package/dist/builtin-extensions/pi-mcp-adapter/ui-stream-types.js.map +1 -0
  420. package/dist/builtin-extensions/pi-mcp-adapter/utils.d.ts +18 -0
  421. package/dist/builtin-extensions/pi-mcp-adapter/utils.d.ts.map +1 -0
  422. package/dist/builtin-extensions/pi-mcp-adapter/utils.js +112 -0
  423. package/dist/builtin-extensions/pi-mcp-adapter/utils.js.map +1 -0
  424. package/dist/builtin-extensions/pi-mcp-adapter/vitest.config.d.ts +3 -0
  425. package/dist/builtin-extensions/pi-mcp-adapter/vitest.config.d.ts.map +1 -0
  426. package/dist/builtin-extensions/pi-mcp-adapter/vitest.config.js +15 -0
  427. package/dist/builtin-extensions/pi-mcp-adapter/vitest.config.js.map +1 -0
  428. package/dist/builtin-extensions/pi-ollama-cloud/index.d.ts +30 -0
  429. package/dist/builtin-extensions/pi-ollama-cloud/index.d.ts.map +1 -0
  430. package/dist/builtin-extensions/pi-ollama-cloud/index.js +99 -0
  431. package/dist/builtin-extensions/pi-ollama-cloud/index.js.map +1 -0
  432. package/dist/builtin-extensions/pi-ollama-cloud/models.d.ts +49 -0
  433. package/dist/builtin-extensions/pi-ollama-cloud/models.d.ts.map +1 -0
  434. package/dist/builtin-extensions/pi-ollama-cloud/models.generated.d.ts +3 -0
  435. package/dist/builtin-extensions/pi-ollama-cloud/models.generated.d.ts.map +1 -0
  436. package/dist/builtin-extensions/pi-ollama-cloud/models.generated.js +1135 -0
  437. package/dist/builtin-extensions/pi-ollama-cloud/models.generated.js.map +1 -0
  438. package/dist/builtin-extensions/pi-ollama-cloud/models.js +239 -0
  439. package/dist/builtin-extensions/pi-ollama-cloud/models.js.map +1 -0
  440. package/dist/builtin-extensions/pi-ollama-cloud/thinking-levels.d.ts +40 -0
  441. package/dist/builtin-extensions/pi-ollama-cloud/thinking-levels.d.ts.map +1 -0
  442. package/dist/builtin-extensions/pi-ollama-cloud/thinking-levels.js +80 -0
  443. package/dist/builtin-extensions/pi-ollama-cloud/thinking-levels.js.map +1 -0
  444. package/dist/builtin-extensions/pi-ollama-cloud/utils.d.ts +9 -0
  445. package/dist/builtin-extensions/pi-ollama-cloud/utils.d.ts.map +1 -0
  446. package/dist/builtin-extensions/pi-ollama-cloud/utils.js +52 -0
  447. package/dist/builtin-extensions/pi-ollama-cloud/utils.js.map +1 -0
  448. package/dist/builtin-extensions/pi-prompt-template-model/args.d.ts +56 -0
  449. package/dist/builtin-extensions/pi-prompt-template-model/args.d.ts.map +1 -0
  450. package/dist/builtin-extensions/pi-prompt-template-model/args.js +555 -0
  451. package/dist/builtin-extensions/pi-prompt-template-model/args.js.map +1 -0
  452. package/dist/builtin-extensions/pi-prompt-template-model/chain-parser.d.ts +22 -0
  453. package/dist/builtin-extensions/pi-prompt-template-model/chain-parser.d.ts.map +1 -0
  454. package/dist/builtin-extensions/pi-prompt-template-model/chain-parser.js +249 -0
  455. package/dist/builtin-extensions/pi-prompt-template-model/chain-parser.js.map +1 -0
  456. package/dist/builtin-extensions/pi-prompt-template-model/deterministic-renderer.d.ts +20 -0
  457. package/dist/builtin-extensions/pi-prompt-template-model/deterministic-renderer.d.ts.map +1 -0
  458. package/dist/builtin-extensions/pi-prompt-template-model/deterministic-renderer.js +102 -0
  459. package/dist/builtin-extensions/pi-prompt-template-model/deterministic-renderer.js.map +1 -0
  460. package/dist/builtin-extensions/pi-prompt-template-model/deterministic-step.d.ts +30 -0
  461. package/dist/builtin-extensions/pi-prompt-template-model/deterministic-step.d.ts.map +1 -0
  462. package/dist/builtin-extensions/pi-prompt-template-model/deterministic-step.js +260 -0
  463. package/dist/builtin-extensions/pi-prompt-template-model/deterministic-step.js.map +1 -0
  464. package/dist/builtin-extensions/pi-prompt-template-model/index.d.ts +3 -0
  465. package/dist/builtin-extensions/pi-prompt-template-model/index.d.ts.map +1 -0
  466. package/dist/builtin-extensions/pi-prompt-template-model/index.js +1403 -0
  467. package/dist/builtin-extensions/pi-prompt-template-model/index.js.map +1 -0
  468. package/dist/builtin-extensions/pi-prompt-template-model/loop-utils.d.ts +8 -0
  469. package/dist/builtin-extensions/pi-prompt-template-model/loop-utils.d.ts.map +1 -0
  470. package/dist/builtin-extensions/pi-prompt-template-model/loop-utils.js +164 -0
  471. package/dist/builtin-extensions/pi-prompt-template-model/loop-utils.js.map +1 -0
  472. package/dist/builtin-extensions/pi-prompt-template-model/model-selection.d.ts +22 -0
  473. package/dist/builtin-extensions/pi-prompt-template-model/model-selection.d.ts.map +1 -0
  474. package/dist/builtin-extensions/pi-prompt-template-model/model-selection.js +82 -0
  475. package/dist/builtin-extensions/pi-prompt-template-model/model-selection.js.map +1 -0
  476. package/dist/builtin-extensions/pi-prompt-template-model/notifications.d.ts +6 -0
  477. package/dist/builtin-extensions/pi-prompt-template-model/notifications.d.ts.map +1 -0
  478. package/dist/builtin-extensions/pi-prompt-template-model/notifications.js +21 -0
  479. package/dist/builtin-extensions/pi-prompt-template-model/notifications.js.map +1 -0
  480. package/dist/builtin-extensions/pi-prompt-template-model/prompt-execution.d.ts +24 -0
  481. package/dist/builtin-extensions/pi-prompt-template-model/prompt-execution.d.ts.map +1 -0
  482. package/dist/builtin-extensions/pi-prompt-template-model/prompt-execution.js +56 -0
  483. package/dist/builtin-extensions/pi-prompt-template-model/prompt-execution.js.map +1 -0
  484. package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.d.ts +80 -0
  485. package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.d.ts.map +1 -0
  486. package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js +1234 -0
  487. package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js.map +1 -0
  488. package/dist/builtin-extensions/pi-prompt-template-model/skill-loaded-renderer.d.ts +11 -0
  489. package/dist/builtin-extensions/pi-prompt-template-model/skill-loaded-renderer.d.ts.map +1 -0
  490. package/dist/builtin-extensions/pi-prompt-template-model/skill-loaded-renderer.js +31 -0
  491. package/dist/builtin-extensions/pi-prompt-template-model/skill-loaded-renderer.js.map +1 -0
  492. package/dist/builtin-extensions/pi-prompt-template-model/subagent-renderer.d.ts +43 -0
  493. package/dist/builtin-extensions/pi-prompt-template-model/subagent-renderer.d.ts.map +1 -0
  494. package/dist/builtin-extensions/pi-prompt-template-model/subagent-renderer.js +177 -0
  495. package/dist/builtin-extensions/pi-prompt-template-model/subagent-renderer.js.map +1 -0
  496. package/dist/builtin-extensions/pi-prompt-template-model/subagent-runtime.d.ts +97 -0
  497. package/dist/builtin-extensions/pi-prompt-template-model/subagent-runtime.d.ts.map +1 -0
  498. package/dist/builtin-extensions/pi-prompt-template-model/subagent-runtime.js +64 -0
  499. package/dist/builtin-extensions/pi-prompt-template-model/subagent-runtime.js.map +1 -0
  500. package/dist/builtin-extensions/pi-prompt-template-model/subagent-step.d.ts +48 -0
  501. package/dist/builtin-extensions/pi-prompt-template-model/subagent-step.d.ts.map +1 -0
  502. package/dist/builtin-extensions/pi-prompt-template-model/subagent-step.js +550 -0
  503. package/dist/builtin-extensions/pi-prompt-template-model/subagent-step.js.map +1 -0
  504. package/dist/builtin-extensions/pi-prompt-template-model/subagent-widget.d.ts +8 -0
  505. package/dist/builtin-extensions/pi-prompt-template-model/subagent-widget.d.ts.map +1 -0
  506. package/dist/builtin-extensions/pi-prompt-template-model/subagent-widget.js +230 -0
  507. package/dist/builtin-extensions/pi-prompt-template-model/subagent-widget.js.map +1 -0
  508. package/dist/builtin-extensions/pi-prompt-template-model/template-conditionals.d.ts +10 -0
  509. package/dist/builtin-extensions/pi-prompt-template-model/template-conditionals.d.ts.map +1 -0
  510. package/dist/builtin-extensions/pi-prompt-template-model/template-conditionals.js +226 -0
  511. package/dist/builtin-extensions/pi-prompt-template-model/template-conditionals.js.map +1 -0
  512. package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.d.ts +17 -0
  513. package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.d.ts.map +1 -0
  514. package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js +201 -0
  515. package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js.map +1 -0
  516. package/dist/builtin-extensions/pi-subagents/index.d.ts +2 -0
  517. package/dist/builtin-extensions/pi-subagents/index.d.ts.map +1 -0
  518. package/dist/builtin-extensions/pi-subagents/index.js +3 -0
  519. package/dist/builtin-extensions/pi-subagents/index.js.map +1 -0
  520. package/dist/builtin-extensions/pi-subagents/src/agents/frontmatter.d.ts +11 -0
  521. package/dist/builtin-extensions/pi-subagents/src/agents/frontmatter.d.ts.map +1 -0
  522. package/dist/builtin-extensions/pi-subagents/src/agents/frontmatter.js +84 -0
  523. package/dist/builtin-extensions/pi-subagents/src/agents/frontmatter.js.map +1 -0
  524. package/dist/builtin-extensions/pi-subagents/src/agents/skills.d.ts +33 -0
  525. package/dist/builtin-extensions/pi-subagents/src/agents/skills.d.ts.map +1 -0
  526. package/dist/builtin-extensions/pi-subagents/src/agents/skills.js +674 -0
  527. package/dist/builtin-extensions/pi-subagents/src/agents/skills.js.map +1 -0
  528. package/dist/builtin-extensions/pi-subagents/src/api/background-work.d.ts +35 -0
  529. package/dist/builtin-extensions/pi-subagents/src/api/background-work.d.ts.map +1 -0
  530. package/dist/builtin-extensions/pi-subagents/src/api/background-work.js +162 -0
  531. package/dist/builtin-extensions/pi-subagents/src/api/background-work.js.map +1 -0
  532. package/dist/builtin-extensions/pi-subagents/src/api/delegation.d.ts +113 -0
  533. package/dist/builtin-extensions/pi-subagents/src/api/delegation.d.ts.map +1 -0
  534. package/dist/builtin-extensions/pi-subagents/src/api/delegation.js +10 -0
  535. package/dist/builtin-extensions/pi-subagents/src/api/delegation.js.map +1 -0
  536. package/dist/builtin-extensions/pi-subagents/src/extension/chain-validation.d.ts +34 -0
  537. package/dist/builtin-extensions/pi-subagents/src/extension/chain-validation.d.ts.map +1 -0
  538. package/dist/builtin-extensions/pi-subagents/src/extension/chain-validation.js +125 -0
  539. package/dist/builtin-extensions/pi-subagents/src/extension/chain-validation.js.map +1 -0
  540. package/dist/builtin-extensions/pi-subagents/src/extension/config.d.ts +6 -0
  541. package/dist/builtin-extensions/pi-subagents/src/extension/config.d.ts.map +1 -0
  542. package/dist/builtin-extensions/pi-subagents/src/extension/config.js +37 -0
  543. package/dist/builtin-extensions/pi-subagents/src/extension/config.js.map +1 -0
  544. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts +21 -0
  545. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts.map +1 -0
  546. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.js +70 -0
  547. package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.js.map +1 -0
  548. package/dist/builtin-extensions/pi-subagents/src/extension/doctor.d.ts +31 -0
  549. package/dist/builtin-extensions/pi-subagents/src/extension/doctor.d.ts.map +1 -0
  550. package/dist/builtin-extensions/pi-subagents/src/extension/doctor.js +152 -0
  551. package/dist/builtin-extensions/pi-subagents/src/extension/doctor.js.map +1 -0
  552. package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.d.ts +3 -0
  553. package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.d.ts.map +1 -0
  554. package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.js +174 -0
  555. package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.js.map +1 -0
  556. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +17 -0
  557. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -0
  558. package/dist/builtin-extensions/pi-subagents/src/extension/index.js +565 -0
  559. package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -0
  560. package/dist/builtin-extensions/pi-subagents/src/extension/rpc.d.ts +57 -0
  561. package/dist/builtin-extensions/pi-subagents/src/extension/rpc.d.ts.map +1 -0
  562. package/dist/builtin-extensions/pi-subagents/src/extension/rpc.js +291 -0
  563. package/dist/builtin-extensions/pi-subagents/src/extension/rpc.js.map +1 -0
  564. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts +228 -0
  565. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -0
  566. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +305 -0
  567. package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -0
  568. package/dist/builtin-extensions/pi-subagents/src/extension/steering-notices.d.ts +15 -0
  569. package/dist/builtin-extensions/pi-subagents/src/extension/steering-notices.d.ts.map +1 -0
  570. package/dist/builtin-extensions/pi-subagents/src/extension/steering-notices.js +23 -0
  571. package/dist/builtin-extensions/pi-subagents/src/extension/steering-notices.js.map +1 -0
  572. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts +12 -0
  573. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts.map +1 -0
  574. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js +209 -0
  575. package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -0
  576. package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts +35 -0
  577. package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts.map +1 -0
  578. package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js +144 -0
  579. package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js.map +1 -0
  580. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts +36 -0
  581. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +1 -0
  582. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js +626 -0
  583. package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js.map +1 -0
  584. package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.d.ts +31 -0
  585. package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.d.ts.map +1 -0
  586. package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.js +331 -0
  587. package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.js.map +1 -0
  588. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts +166 -0
  589. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts.map +1 -0
  590. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js +1049 -0
  591. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js.map +1 -0
  592. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.d.ts +20 -0
  593. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.d.ts.map +1 -0
  594. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js +500 -0
  595. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js.map +1 -0
  596. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts +65 -0
  597. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.d.ts.map +1 -0
  598. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js +512 -0
  599. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-resume.js.map +1 -0
  600. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.d.ts +96 -0
  601. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.d.ts.map +1 -0
  602. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.js +336 -0
  603. package/dist/builtin-extensions/pi-subagents/src/runs/background/async-status.js.map +1 -0
  604. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.d.ts +15 -0
  605. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.d.ts.map +1 -0
  606. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.js +47 -0
  607. package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.js.map +1 -0
  608. package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.d.ts +31 -0
  609. package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.d.ts.map +1 -0
  610. package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.js +260 -0
  611. package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-append.js.map +1 -0
  612. package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.d.ts +35 -0
  613. package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.d.ts.map +1 -0
  614. package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.js +146 -0
  615. package/dist/builtin-extensions/pi-subagents/src/runs/background/chain-root-attachment.js.map +1 -0
  616. package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-batcher.d.ts +52 -0
  617. package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-batcher.d.ts.map +1 -0
  618. package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-batcher.js +119 -0
  619. package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-batcher.js.map +1 -0
  620. package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-dedupe.d.ts +14 -0
  621. package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-dedupe.d.ts.map +1 -0
  622. package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-dedupe.js +55 -0
  623. package/dist/builtin-extensions/pi-subagents/src/runs/background/completion-dedupe.js.map +1 -0
  624. package/dist/builtin-extensions/pi-subagents/src/runs/background/control-channel.d.ts +182 -0
  625. package/dist/builtin-extensions/pi-subagents/src/runs/background/control-channel.d.ts.map +1 -0
  626. package/dist/builtin-extensions/pi-subagents/src/runs/background/control-channel.js +487 -0
  627. package/dist/builtin-extensions/pi-subagents/src/runs/background/control-channel.js.map +1 -0
  628. package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.d.ts +43 -0
  629. package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.d.ts.map +1 -0
  630. package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.js +518 -0
  631. package/dist/builtin-extensions/pi-subagents/src/runs/background/fleet-view.js.map +1 -0
  632. package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts +63 -0
  633. package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts.map +1 -0
  634. package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js +202 -0
  635. package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js.map +1 -0
  636. package/dist/builtin-extensions/pi-subagents/src/runs/background/parallel-groups.d.ts +4 -0
  637. package/dist/builtin-extensions/pi-subagents/src/runs/background/parallel-groups.d.ts.map +1 -0
  638. package/dist/builtin-extensions/pi-subagents/src/runs/background/parallel-groups.js +47 -0
  639. package/dist/builtin-extensions/pi-subagents/src/runs/background/parallel-groups.js.map +1 -0
  640. package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts +22 -0
  641. package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts.map +1 -0
  642. package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js +247 -0
  643. package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js.map +1 -0
  644. package/dist/builtin-extensions/pi-subagents/src/runs/background/run-id-resolver.d.ts +23 -0
  645. package/dist/builtin-extensions/pi-subagents/src/runs/background/run-id-resolver.d.ts.map +1 -0
  646. package/dist/builtin-extensions/pi-subagents/src/runs/background/run-id-resolver.js +91 -0
  647. package/dist/builtin-extensions/pi-subagents/src/runs/background/run-id-resolver.js.map +1 -0
  648. package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.d.ts +24 -0
  649. package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.d.ts.map +1 -0
  650. package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js +453 -0
  651. package/dist/builtin-extensions/pi-subagents/src/runs/background/run-status.js.map +1 -0
  652. package/dist/builtin-extensions/pi-subagents/src/runs/background/scheduled-runs.d.ts +52 -0
  653. package/dist/builtin-extensions/pi-subagents/src/runs/background/scheduled-runs.d.ts.map +1 -0
  654. package/dist/builtin-extensions/pi-subagents/src/runs/background/scheduled-runs.js +473 -0
  655. package/dist/builtin-extensions/pi-subagents/src/runs/background/scheduled-runs.js.map +1 -0
  656. package/dist/builtin-extensions/pi-subagents/src/runs/background/stale-run-reconciler.d.ts +34 -0
  657. package/dist/builtin-extensions/pi-subagents/src/runs/background/stale-run-reconciler.d.ts.map +1 -0
  658. package/dist/builtin-extensions/pi-subagents/src/runs/background/stale-run-reconciler.js +351 -0
  659. package/dist/builtin-extensions/pi-subagents/src/runs/background/stale-run-reconciler.js.map +1 -0
  660. package/dist/builtin-extensions/pi-subagents/src/runs/background/steering.d.ts +44 -0
  661. package/dist/builtin-extensions/pi-subagents/src/runs/background/steering.d.ts.map +1 -0
  662. package/dist/builtin-extensions/pi-subagents/src/runs/background/steering.js +228 -0
  663. package/dist/builtin-extensions/pi-subagents/src/runs/background/steering.js.map +1 -0
  664. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts +2 -0
  665. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts.map +1 -0
  666. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +3534 -0
  667. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -0
  668. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts +95 -0
  669. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts.map +1 -0
  670. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js +387 -0
  671. package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js.map +1 -0
  672. package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.d.ts +8 -0
  673. package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.d.ts.map +1 -0
  674. package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.js +6 -0
  675. package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.js.map +1 -0
  676. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-config.d.ts +7 -0
  677. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-config.d.ts.map +1 -0
  678. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-config.js +34 -0
  679. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-config.js.map +1 -0
  680. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts +4 -0
  681. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -0
  682. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +24 -0
  683. package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -0
  684. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/async-steering-action.d.ts +23 -0
  685. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/async-steering-action.d.ts.map +1 -0
  686. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/async-steering-action.js +230 -0
  687. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/async-steering-action.js.map +1 -0
  688. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.d.ts +127 -0
  689. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.d.ts.map +1 -0
  690. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.js +1161 -0
  691. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-clarify.js.map +1 -0
  692. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts +82 -0
  693. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.d.ts.map +1 -0
  694. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js +1042 -0
  695. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/chain-execution.js.map +1 -0
  696. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts +10 -0
  697. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -0
  698. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +1439 -0
  699. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -0
  700. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts +85 -0
  701. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -0
  702. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +3468 -0
  703. package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -0
  704. package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts +65 -0
  705. package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.d.ts.map +1 -0
  706. package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.js +1113 -0
  707. package/dist/builtin-extensions/pi-subagents/src/runs/shared/acceptance.js.map +1 -0
  708. package/dist/builtin-extensions/pi-subagents/src/runs/shared/chain-outputs.d.ts +19 -0
  709. package/dist/builtin-extensions/pi-subagents/src/runs/shared/chain-outputs.d.ts.map +1 -0
  710. package/dist/builtin-extensions/pi-subagents/src/runs/shared/chain-outputs.js +106 -0
  711. package/dist/builtin-extensions/pi-subagents/src/runs/shared/chain-outputs.js.map +1 -0
  712. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-protocol.d.ts +27 -0
  713. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-protocol.d.ts.map +1 -0
  714. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-protocol.js +108 -0
  715. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-protocol.js.map +1 -0
  716. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts +25 -0
  717. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts.map +1 -0
  718. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js +51 -0
  719. package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js.map +1 -0
  720. package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.d.ts +19 -0
  721. package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.d.ts.map +1 -0
  722. package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.js +51 -0
  723. package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.js.map +1 -0
  724. package/dist/builtin-extensions/pi-subagents/src/runs/shared/dynamic-fanout.d.ts +49 -0
  725. package/dist/builtin-extensions/pi-subagents/src/runs/shared/dynamic-fanout.d.ts.map +1 -0
  726. package/dist/builtin-extensions/pi-subagents/src/runs/shared/dynamic-fanout.js +291 -0
  727. package/dist/builtin-extensions/pi-subagents/src/runs/shared/dynamic-fanout.js.map +1 -0
  728. package/dist/builtin-extensions/pi-subagents/src/runs/shared/long-running-guard.d.ts +33 -0
  729. package/dist/builtin-extensions/pi-subagents/src/runs/shared/long-running-guard.d.ts.map +1 -0
  730. package/dist/builtin-extensions/pi-subagents/src/runs/shared/long-running-guard.js +152 -0
  731. package/dist/builtin-extensions/pi-subagents/src/runs/shared/long-running-guard.js.map +1 -0
  732. package/dist/builtin-extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.d.ts +18 -0
  733. package/dist/builtin-extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.d.ts.map +1 -0
  734. package/dist/builtin-extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.js +326 -0
  735. package/dist/builtin-extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.js.map +1 -0
  736. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts +83 -0
  737. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.d.ts.map +1 -0
  738. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js +299 -0
  739. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-fallback.js.map +1 -0
  740. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-scope.d.ts +49 -0
  741. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-scope.d.ts.map +1 -0
  742. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-scope.js +98 -0
  743. package/dist/builtin-extensions/pi-subagents/src/runs/shared/model-scope.js.map +1 -0
  744. package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-events.d.ts +121 -0
  745. package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-events.d.ts.map +1 -0
  746. package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-events.js +881 -0
  747. package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-events.js.map +1 -0
  748. package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-path.d.ts +11 -0
  749. package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-path.d.ts.map +1 -0
  750. package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-path.js +50 -0
  751. package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-path.js.map +1 -0
  752. package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-render.d.ts +19 -0
  753. package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-render.d.ts.map +1 -0
  754. package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-render.js +109 -0
  755. package/dist/builtin-extensions/pi-subagents/src/runs/shared/nested-render.js.map +1 -0
  756. package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts +106 -0
  757. package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +1 -0
  758. package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js +112 -0
  759. package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js.map +1 -0
  760. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts +87 -0
  761. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts.map +1 -0
  762. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js +260 -0
  763. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js.map +1 -0
  764. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-spawn.d.ts +25 -0
  765. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-spawn.d.ts.map +1 -0
  766. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-spawn.js +111 -0
  767. package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-spawn.js.map +1 -0
  768. package/dist/builtin-extensions/pi-subagents/src/runs/shared/run-history.d.ts +11 -0
  769. package/dist/builtin-extensions/pi-subagents/src/runs/shared/run-history.d.ts.map +1 -0
  770. package/dist/builtin-extensions/pi-subagents/src/runs/shared/run-history.js +57 -0
  771. package/dist/builtin-extensions/pi-subagents/src/runs/shared/run-history.js.map +1 -0
  772. package/dist/builtin-extensions/pi-subagents/src/runs/shared/session-lease.d.ts +54 -0
  773. package/dist/builtin-extensions/pi-subagents/src/runs/shared/session-lease.d.ts.map +1 -0
  774. package/dist/builtin-extensions/pi-subagents/src/runs/shared/session-lease.js +244 -0
  775. package/dist/builtin-extensions/pi-subagents/src/runs/shared/session-lease.js.map +1 -0
  776. package/dist/builtin-extensions/pi-subagents/src/runs/shared/single-output.d.ts +50 -0
  777. package/dist/builtin-extensions/pi-subagents/src/runs/shared/single-output.d.ts.map +1 -0
  778. package/dist/builtin-extensions/pi-subagents/src/runs/shared/single-output.js +202 -0
  779. package/dist/builtin-extensions/pi-subagents/src/runs/shared/single-output.js.map +1 -0
  780. package/dist/builtin-extensions/pi-subagents/src/runs/shared/structured-output.d.ts +22 -0
  781. package/dist/builtin-extensions/pi-subagents/src/runs/shared/structured-output.d.ts.map +1 -0
  782. package/dist/builtin-extensions/pi-subagents/src/runs/shared/structured-output.js +67 -0
  783. package/dist/builtin-extensions/pi-subagents/src/runs/shared/structured-output.js.map +1 -0
  784. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.d.ts +35 -0
  785. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.d.ts.map +1 -0
  786. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.js +187 -0
  787. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.js.map +1 -0
  788. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts +22 -0
  789. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -0
  790. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +438 -0
  791. package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +1 -0
  792. package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.d.ts +35 -0
  793. package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.d.ts.map +1 -0
  794. package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.js +157 -0
  795. package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.js.map +1 -0
  796. package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-availability.d.ts +13 -0
  797. package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-availability.d.ts.map +1 -0
  798. package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-availability.js +51 -0
  799. package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-availability.js.map +1 -0
  800. package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-budget.d.ts +16 -0
  801. package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-budget.d.ts.map +1 -0
  802. package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-budget.js +74 -0
  803. package/dist/builtin-extensions/pi-subagents/src/runs/shared/tool-budget.js.map +1 -0
  804. package/dist/builtin-extensions/pi-subagents/src/runs/shared/turn-budget.d.ts +14 -0
  805. package/dist/builtin-extensions/pi-subagents/src/runs/shared/turn-budget.d.ts.map +1 -0
  806. package/dist/builtin-extensions/pi-subagents/src/runs/shared/turn-budget.js +66 -0
  807. package/dist/builtin-extensions/pi-subagents/src/runs/shared/turn-budget.js.map +1 -0
  808. package/dist/builtin-extensions/pi-subagents/src/runs/shared/workflow-graph.d.ts +30 -0
  809. package/dist/builtin-extensions/pi-subagents/src/runs/shared/workflow-graph.d.ts.map +1 -0
  810. package/dist/builtin-extensions/pi-subagents/src/runs/shared/workflow-graph.js +200 -0
  811. package/dist/builtin-extensions/pi-subagents/src/runs/shared/workflow-graph.js.map +1 -0
  812. package/dist/builtin-extensions/pi-subagents/src/runs/shared/worktree.d.ts +49 -0
  813. package/dist/builtin-extensions/pi-subagents/src/runs/shared/worktree.d.ts.map +1 -0
  814. package/dist/builtin-extensions/pi-subagents/src/runs/shared/worktree.js +473 -0
  815. package/dist/builtin-extensions/pi-subagents/src/runs/shared/worktree.js.map +1 -0
  816. package/dist/builtin-extensions/pi-subagents/src/shared/artifacts.d.ts +13 -0
  817. package/dist/builtin-extensions/pi-subagents/src/shared/artifacts.d.ts.map +1 -0
  818. package/dist/builtin-extensions/pi-subagents/src/shared/artifacts.js +104 -0
  819. package/dist/builtin-extensions/pi-subagents/src/shared/artifacts.js.map +1 -0
  820. package/dist/builtin-extensions/pi-subagents/src/shared/atomic-json.d.ts +17 -0
  821. package/dist/builtin-extensions/pi-subagents/src/shared/atomic-json.d.ts.map +1 -0
  822. package/dist/builtin-extensions/pi-subagents/src/shared/atomic-json.js +68 -0
  823. package/dist/builtin-extensions/pi-subagents/src/shared/atomic-json.js.map +1 -0
  824. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts +70 -0
  825. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.d.ts.map +1 -0
  826. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js +153 -0
  827. package/dist/builtin-extensions/pi-subagents/src/shared/child-spec.js.map +1 -0
  828. package/dist/builtin-extensions/pi-subagents/src/shared/child-transcript.d.ts +36 -0
  829. package/dist/builtin-extensions/pi-subagents/src/shared/child-transcript.d.ts.map +1 -0
  830. package/dist/builtin-extensions/pi-subagents/src/shared/child-transcript.js +173 -0
  831. package/dist/builtin-extensions/pi-subagents/src/shared/child-transcript.js.map +1 -0
  832. package/dist/builtin-extensions/pi-subagents/src/shared/file-coalescer.d.ts +11 -0
  833. package/dist/builtin-extensions/pi-subagents/src/shared/file-coalescer.d.ts.map +1 -0
  834. package/dist/builtin-extensions/pi-subagents/src/shared/file-coalescer.js +26 -0
  835. package/dist/builtin-extensions/pi-subagents/src/shared/file-coalescer.js.map +1 -0
  836. package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.d.ts +44 -0
  837. package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.d.ts.map +1 -0
  838. package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.js +158 -0
  839. package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.js.map +1 -0
  840. package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts +34 -0
  841. package/dist/builtin-extensions/pi-subagents/src/shared/formatters.d.ts.map +1 -0
  842. package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js +128 -0
  843. package/dist/builtin-extensions/pi-subagents/src/shared/formatters.js.map +1 -0
  844. package/dist/builtin-extensions/pi-subagents/src/shared/jsonl-writer.d.ts +20 -0
  845. package/dist/builtin-extensions/pi-subagents/src/shared/jsonl-writer.d.ts.map +1 -0
  846. package/dist/builtin-extensions/pi-subagents/src/shared/jsonl-writer.js +59 -0
  847. package/dist/builtin-extensions/pi-subagents/src/shared/jsonl-writer.js.map +1 -0
  848. package/dist/builtin-extensions/pi-subagents/src/shared/lunr-child-context.d.ts +21 -0
  849. package/dist/builtin-extensions/pi-subagents/src/shared/lunr-child-context.d.ts.map +1 -0
  850. package/dist/builtin-extensions/pi-subagents/src/shared/lunr-child-context.js +22 -0
  851. package/dist/builtin-extensions/pi-subagents/src/shared/lunr-child-context.js.map +1 -0
  852. package/dist/builtin-extensions/pi-subagents/src/shared/model-info.d.ts +31 -0
  853. package/dist/builtin-extensions/pi-subagents/src/shared/model-info.d.ts.map +1 -0
  854. package/dist/builtin-extensions/pi-subagents/src/shared/model-info.js +68 -0
  855. package/dist/builtin-extensions/pi-subagents/src/shared/model-info.js.map +1 -0
  856. package/dist/builtin-extensions/pi-subagents/src/shared/post-exit-stdio-guard.d.ts +17 -0
  857. package/dist/builtin-extensions/pi-subagents/src/shared/post-exit-stdio-guard.d.ts.map +1 -0
  858. package/dist/builtin-extensions/pi-subagents/src/shared/post-exit-stdio-guard.js +72 -0
  859. package/dist/builtin-extensions/pi-subagents/src/shared/post-exit-stdio-guard.js.map +1 -0
  860. package/dist/builtin-extensions/pi-subagents/src/shared/session-identity.d.ts +7 -0
  861. package/dist/builtin-extensions/pi-subagents/src/shared/session-identity.d.ts.map +1 -0
  862. package/dist/builtin-extensions/pi-subagents/src/shared/session-identity.js +7 -0
  863. package/dist/builtin-extensions/pi-subagents/src/shared/session-identity.js.map +1 -0
  864. package/dist/builtin-extensions/pi-subagents/src/shared/session-tokens.d.ts +3 -0
  865. package/dist/builtin-extensions/pi-subagents/src/shared/session-tokens.d.ts.map +1 -0
  866. package/dist/builtin-extensions/pi-subagents/src/shared/session-tokens.js +49 -0
  867. package/dist/builtin-extensions/pi-subagents/src/shared/session-tokens.js.map +1 -0
  868. package/dist/builtin-extensions/pi-subagents/src/shared/settings.d.ts +141 -0
  869. package/dist/builtin-extensions/pi-subagents/src/shared/settings.d.ts.map +1 -0
  870. package/dist/builtin-extensions/pi-subagents/src/shared/settings.js +254 -0
  871. package/dist/builtin-extensions/pi-subagents/src/shared/settings.js.map +1 -0
  872. package/dist/builtin-extensions/pi-subagents/src/shared/status-format.d.ts +10 -0
  873. package/dist/builtin-extensions/pi-subagents/src/shared/status-format.d.ts.map +1 -0
  874. package/dist/builtin-extensions/pi-subagents/src/shared/status-format.js +61 -0
  875. package/dist/builtin-extensions/pi-subagents/src/shared/status-format.js.map +1 -0
  876. package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +1166 -0
  877. package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -0
  878. package/dist/builtin-extensions/pi-subagents/src/shared/types.js +229 -0
  879. package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -0
  880. package/dist/builtin-extensions/pi-subagents/src/shared/utils.d.ts +52 -0
  881. package/dist/builtin-extensions/pi-subagents/src/shared/utils.d.ts.map +1 -0
  882. package/dist/builtin-extensions/pi-subagents/src/shared/utils.js +562 -0
  883. package/dist/builtin-extensions/pi-subagents/src/shared/utils.js.map +1 -0
  884. package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.d.ts +149 -0
  885. package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.d.ts.map +1 -0
  886. package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.js +321 -0
  887. package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.js.map +1 -0
  888. package/dist/builtin-extensions/pi-subagents/src/slash/delegation-request.d.ts +11 -0
  889. package/dist/builtin-extensions/pi-subagents/src/slash/delegation-request.d.ts.map +1 -0
  890. package/dist/builtin-extensions/pi-subagents/src/slash/delegation-request.js +102 -0
  891. package/dist/builtin-extensions/pi-subagents/src/slash/delegation-request.js.map +1 -0
  892. package/dist/builtin-extensions/pi-subagents/src/slash/prompt-template-bridge.d.ts +25 -0
  893. package/dist/builtin-extensions/pi-subagents/src/slash/prompt-template-bridge.d.ts.map +1 -0
  894. package/dist/builtin-extensions/pi-subagents/src/slash/prompt-template-bridge.js +200 -0
  895. package/dist/builtin-extensions/pi-subagents/src/slash/prompt-template-bridge.js.map +1 -0
  896. package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts +23 -0
  897. package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts.map +1 -0
  898. package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js +294 -0
  899. package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js.map +1 -0
  900. package/dist/builtin-extensions/pi-subagents/src/slash/slash-bridge.d.ts +31 -0
  901. package/dist/builtin-extensions/pi-subagents/src/slash/slash-bridge.d.ts.map +1 -0
  902. package/dist/builtin-extensions/pi-subagents/src/slash/slash-bridge.js +117 -0
  903. package/dist/builtin-extensions/pi-subagents/src/slash/slash-bridge.js.map +1 -0
  904. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts +52 -0
  905. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts.map +1 -0
  906. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js +1097 -0
  907. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js.map +1 -0
  908. package/dist/builtin-extensions/pi-subagents/src/slash/slash-live-state.d.ts +22 -0
  909. package/dist/builtin-extensions/pi-subagents/src/slash/slash-live-state.d.ts.map +1 -0
  910. package/dist/builtin-extensions/pi-subagents/src/slash/slash-live-state.js +246 -0
  911. package/dist/builtin-extensions/pi-subagents/src/slash/slash-live-state.js.map +1 -0
  912. package/dist/builtin-extensions/pi-subagents/src/tui/fleet.d.ts +78 -0
  913. package/dist/builtin-extensions/pi-subagents/src/tui/fleet.d.ts.map +1 -0
  914. package/dist/builtin-extensions/pi-subagents/src/tui/fleet.js +401 -0
  915. package/dist/builtin-extensions/pi-subagents/src/tui/fleet.js.map +1 -0
  916. package/dist/builtin-extensions/pi-subagents/src/tui/render-helpers.d.ts +13 -0
  917. package/dist/builtin-extensions/pi-subagents/src/tui/render-helpers.d.ts.map +1 -0
  918. package/dist/builtin-extensions/pi-subagents/src/tui/render-helpers.js +74 -0
  919. package/dist/builtin-extensions/pi-subagents/src/tui/render-helpers.js.map +1 -0
  920. package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +45 -0
  921. package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -0
  922. package/dist/builtin-extensions/pi-subagents/src/tui/render.js +1715 -0
  923. package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -0
  924. package/dist/builtin-extensions/pi-subagents/src/watchdog/change-signature.d.ts +8 -0
  925. package/dist/builtin-extensions/pi-subagents/src/watchdog/change-signature.d.ts.map +1 -0
  926. package/dist/builtin-extensions/pi-subagents/src/watchdog/change-signature.js +123 -0
  927. package/dist/builtin-extensions/pi-subagents/src/watchdog/change-signature.js.map +1 -0
  928. package/dist/builtin-extensions/pi-subagents/src/watchdog/child-status.d.ts +58 -0
  929. package/dist/builtin-extensions/pi-subagents/src/watchdog/child-status.d.ts.map +1 -0
  930. package/dist/builtin-extensions/pi-subagents/src/watchdog/child-status.js +160 -0
  931. package/dist/builtin-extensions/pi-subagents/src/watchdog/child-status.js.map +1 -0
  932. package/dist/builtin-extensions/pi-subagents/src/watchdog/emission-guard.d.ts +34 -0
  933. package/dist/builtin-extensions/pi-subagents/src/watchdog/emission-guard.d.ts.map +1 -0
  934. package/dist/builtin-extensions/pi-subagents/src/watchdog/emission-guard.js +96 -0
  935. package/dist/builtin-extensions/pi-subagents/src/watchdog/emission-guard.js.map +1 -0
  936. package/dist/builtin-extensions/pi-subagents/src/watchdog/lsp-diagnostics.d.ts +18 -0
  937. package/dist/builtin-extensions/pi-subagents/src/watchdog/lsp-diagnostics.d.ts.map +1 -0
  938. package/dist/builtin-extensions/pi-subagents/src/watchdog/lsp-diagnostics.js +485 -0
  939. package/dist/builtin-extensions/pi-subagents/src/watchdog/lsp-diagnostics.js.map +1 -0
  940. package/dist/builtin-extensions/pi-subagents/src/watchdog/model-selection.d.ts +21 -0
  941. package/dist/builtin-extensions/pi-subagents/src/watchdog/model-selection.d.ts.map +1 -0
  942. package/dist/builtin-extensions/pi-subagents/src/watchdog/model-selection.js +151 -0
  943. package/dist/builtin-extensions/pi-subagents/src/watchdog/model-selection.js.map +1 -0
  944. package/dist/builtin-extensions/pi-subagents/src/watchdog/register-child.d.ts +4 -0
  945. package/dist/builtin-extensions/pi-subagents/src/watchdog/register-child.d.ts.map +1 -0
  946. package/dist/builtin-extensions/pi-subagents/src/watchdog/register-child.js +111 -0
  947. package/dist/builtin-extensions/pi-subagents/src/watchdog/register-child.js.map +1 -0
  948. package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.d.ts +10 -0
  949. package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.d.ts.map +1 -0
  950. package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js +407 -0
  951. package/dist/builtin-extensions/pi-subagents/src/watchdog/register-main.js.map +1 -0
  952. package/dist/builtin-extensions/pi-subagents/src/watchdog/render.d.ts +12 -0
  953. package/dist/builtin-extensions/pi-subagents/src/watchdog/render.d.ts.map +1 -0
  954. package/dist/builtin-extensions/pi-subagents/src/watchdog/render.js +55 -0
  955. package/dist/builtin-extensions/pi-subagents/src/watchdog/render.js.map +1 -0
  956. package/dist/builtin-extensions/pi-subagents/src/watchdog/review.d.ts +29 -0
  957. package/dist/builtin-extensions/pi-subagents/src/watchdog/review.d.ts.map +1 -0
  958. package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js +245 -0
  959. package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js.map +1 -0
  960. package/dist/builtin-extensions/pi-subagents/src/watchdog/runtime.d.ts +142 -0
  961. package/dist/builtin-extensions/pi-subagents/src/watchdog/runtime.d.ts.map +1 -0
  962. package/dist/builtin-extensions/pi-subagents/src/watchdog/runtime.js +648 -0
  963. package/dist/builtin-extensions/pi-subagents/src/watchdog/runtime.js.map +1 -0
  964. package/dist/builtin-extensions/pi-subagents/src/watchdog/settings.d.ts +30 -0
  965. package/dist/builtin-extensions/pi-subagents/src/watchdog/settings.d.ts.map +1 -0
  966. package/dist/builtin-extensions/pi-subagents/src/watchdog/settings.js +486 -0
  967. package/dist/builtin-extensions/pi-subagents/src/watchdog/settings.js.map +1 -0
  968. package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts +18 -0
  969. package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.d.ts.map +1 -0
  970. package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js +150 -0
  971. package/dist/builtin-extensions/pi-subagents/src/watchdog/tool-actions.js.map +1 -0
  972. package/dist/builtin-extensions/pi-subagents/src/watchdog/turn-delta.d.ts +10 -0
  973. package/dist/builtin-extensions/pi-subagents/src/watchdog/turn-delta.d.ts.map +1 -0
  974. package/dist/builtin-extensions/pi-subagents/src/watchdog/turn-delta.js +159 -0
  975. package/dist/builtin-extensions/pi-subagents/src/watchdog/turn-delta.js.map +1 -0
  976. package/dist/builtin-extensions/pi-subagents/src/watchdog/types.d.ts +143 -0
  977. package/dist/builtin-extensions/pi-subagents/src/watchdog/types.d.ts.map +1 -0
  978. package/dist/builtin-extensions/pi-subagents/src/watchdog/types.js +31 -0
  979. package/dist/builtin-extensions/pi-subagents/src/watchdog/types.js.map +1 -0
  980. package/dist/builtin-extensions/pi-subagents/src/watchdog/warning-format.d.ts +8 -0
  981. package/dist/builtin-extensions/pi-subagents/src/watchdog/warning-format.d.ts.map +1 -0
  982. package/dist/builtin-extensions/pi-subagents/src/watchdog/warning-format.js +62 -0
  983. package/dist/builtin-extensions/pi-subagents/src/watchdog/warning-format.js.map +1 -0
  984. package/dist/builtin-extensions/pi-tps.d.ts +3 -0
  985. package/dist/builtin-extensions/pi-tps.d.ts.map +1 -0
  986. package/dist/builtin-extensions/pi-tps.js +89 -0
  987. package/dist/builtin-extensions/pi-tps.js.map +1 -0
  988. package/dist/builtin-extensions/pi-web-access/activity.d.ts +34 -0
  989. package/dist/builtin-extensions/pi-web-access/activity.d.ts.map +1 -0
  990. package/dist/builtin-extensions/pi-web-access/activity.js +68 -0
  991. package/dist/builtin-extensions/pi-web-access/activity.js.map +1 -0
  992. package/dist/builtin-extensions/pi-web-access/brave.d.ts +4 -0
  993. package/dist/builtin-extensions/pi-web-access/brave.d.ts.map +1 -0
  994. package/dist/builtin-extensions/pi-web-access/brave.js +185 -0
  995. package/dist/builtin-extensions/pi-web-access/brave.js.map +1 -0
  996. package/dist/builtin-extensions/pi-web-access/chrome-cookies.d.ts +9 -0
  997. package/dist/builtin-extensions/pi-web-access/chrome-cookies.d.ts.map +1 -0
  998. package/dist/builtin-extensions/pi-web-access/chrome-cookies.js +299 -0
  999. package/dist/builtin-extensions/pi-web-access/chrome-cookies.js.map +1 -0
  1000. package/dist/builtin-extensions/pi-web-access/curator-page.d.ts +13 -0
  1001. package/dist/builtin-extensions/pi-web-access/curator-page.d.ts.map +1 -0
  1002. package/dist/builtin-extensions/pi-web-access/curator-page.js +3382 -0
  1003. package/dist/builtin-extensions/pi-web-access/curator-page.js.map +1 -0
  1004. package/dist/builtin-extensions/pi-web-access/curator-server.d.ts +71 -0
  1005. package/dist/builtin-extensions/pi-web-access/curator-server.d.ts.map +1 -0
  1006. package/dist/builtin-extensions/pi-web-access/curator-server.js +604 -0
  1007. package/dist/builtin-extensions/pi-web-access/curator-server.js.map +1 -0
  1008. package/dist/builtin-extensions/pi-web-access/exa.d.ts +10 -0
  1009. package/dist/builtin-extensions/pi-web-access/exa.d.ts.map +1 -0
  1010. package/dist/builtin-extensions/pi-web-access/exa.js +391 -0
  1011. package/dist/builtin-extensions/pi-web-access/exa.js.map +1 -0
  1012. package/dist/builtin-extensions/pi-web-access/extract.d.ts +48 -0
  1013. package/dist/builtin-extensions/pi-web-access/extract.d.ts.map +1 -0
  1014. package/dist/builtin-extensions/pi-web-access/extract.js +619 -0
  1015. package/dist/builtin-extensions/pi-web-access/extract.js.map +1 -0
  1016. package/dist/builtin-extensions/pi-web-access/fetch-params.d.ts +21 -0
  1017. package/dist/builtin-extensions/pi-web-access/fetch-params.d.ts.map +1 -0
  1018. package/dist/builtin-extensions/pi-web-access/fetch-params.js +44 -0
  1019. package/dist/builtin-extensions/pi-web-access/fetch-params.js.map +1 -0
  1020. package/dist/builtin-extensions/pi-web-access/gemini-api.d.ts +18 -0
  1021. package/dist/builtin-extensions/pi-web-access/gemini-api.d.ts.map +1 -0
  1022. package/dist/builtin-extensions/pi-web-access/gemini-api.js +120 -0
  1023. package/dist/builtin-extensions/pi-web-access/gemini-api.js.map +1 -0
  1024. package/dist/builtin-extensions/pi-web-access/gemini-search.d.ts +14 -0
  1025. package/dist/builtin-extensions/pi-web-access/gemini-search.d.ts.map +1 -0
  1026. package/dist/builtin-extensions/pi-web-access/gemini-search.js +371 -0
  1027. package/dist/builtin-extensions/pi-web-access/gemini-search.js.map +1 -0
  1028. package/dist/builtin-extensions/pi-web-access/gemini-url-context.d.ts +4 -0
  1029. package/dist/builtin-extensions/pi-web-access/gemini-url-context.d.ts.map +1 -0
  1030. package/dist/builtin-extensions/pi-web-access/gemini-url-context.js +101 -0
  1031. package/dist/builtin-extensions/pi-web-access/gemini-url-context.js.map +1 -0
  1032. package/dist/builtin-extensions/pi-web-access/gemini-web-config.d.ts +4 -0
  1033. package/dist/builtin-extensions/pi-web-access/gemini-web-config.d.ts.map +1 -0
  1034. package/dist/builtin-extensions/pi-web-access/gemini-web-config.js +43 -0
  1035. package/dist/builtin-extensions/pi-web-access/gemini-web-config.js.map +1 -0
  1036. package/dist/builtin-extensions/pi-web-access/gemini-web.d.ts +12 -0
  1037. package/dist/builtin-extensions/pi-web-access/gemini-web.d.ts.map +1 -0
  1038. package/dist/builtin-extensions/pi-web-access/gemini-web.js +331 -0
  1039. package/dist/builtin-extensions/pi-web-access/gemini-web.js.map +1 -0
  1040. package/dist/builtin-extensions/pi-web-access/github-api.d.ts +7 -0
  1041. package/dist/builtin-extensions/pi-web-access/github-api.d.ts.map +1 -0
  1042. package/dist/builtin-extensions/pi-web-access/github-api.js +161 -0
  1043. package/dist/builtin-extensions/pi-web-access/github-api.js.map +1 -0
  1044. package/dist/builtin-extensions/pi-web-access/github-extract.d.ts +13 -0
  1045. package/dist/builtin-extensions/pi-web-access/github-extract.d.ts.map +1 -0
  1046. package/dist/builtin-extensions/pi-web-access/github-extract.js +558 -0
  1047. package/dist/builtin-extensions/pi-web-access/github-extract.js.map +1 -0
  1048. package/dist/builtin-extensions/pi-web-access/index.d.ts +3 -0
  1049. package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -0
  1050. package/dist/builtin-extensions/pi-web-access/index.js +2165 -0
  1051. package/dist/builtin-extensions/pi-web-access/index.js.map +1 -0
  1052. package/dist/builtin-extensions/pi-web-access/openai-search.d.ts +13 -0
  1053. package/dist/builtin-extensions/pi-web-access/openai-search.d.ts.map +1 -0
  1054. package/dist/builtin-extensions/pi-web-access/openai-search.js +374 -0
  1055. package/dist/builtin-extensions/pi-web-access/openai-search.js.map +1 -0
  1056. package/dist/builtin-extensions/pi-web-access/parallel.d.ts +12 -0
  1057. package/dist/builtin-extensions/pi-web-access/parallel.d.ts.map +1 -0
  1058. package/dist/builtin-extensions/pi-web-access/parallel.js +316 -0
  1059. package/dist/builtin-extensions/pi-web-access/parallel.js.map +1 -0
  1060. package/dist/builtin-extensions/pi-web-access/pdf-extract.d.ts +26 -0
  1061. package/dist/builtin-extensions/pi-web-access/pdf-extract.d.ts.map +1 -0
  1062. package/dist/builtin-extensions/pi-web-access/pdf-extract.js +150 -0
  1063. package/dist/builtin-extensions/pi-web-access/pdf-extract.js.map +1 -0
  1064. package/dist/builtin-extensions/pi-web-access/perplexity.d.ts +20 -0
  1065. package/dist/builtin-extensions/pi-web-access/perplexity.d.ts.map +1 -0
  1066. package/dist/builtin-extensions/pi-web-access/perplexity.js +150 -0
  1067. package/dist/builtin-extensions/pi-web-access/perplexity.js.map +1 -0
  1068. package/dist/builtin-extensions/pi-web-access/render-search-chrome.d.ts +37 -0
  1069. package/dist/builtin-extensions/pi-web-access/render-search-chrome.d.ts.map +1 -0
  1070. package/dist/builtin-extensions/pi-web-access/render-search-chrome.js +107 -0
  1071. package/dist/builtin-extensions/pi-web-access/render-search-chrome.js.map +1 -0
  1072. package/dist/builtin-extensions/pi-web-access/render-search-error.d.ts +57 -0
  1073. package/dist/builtin-extensions/pi-web-access/render-search-error.d.ts.map +1 -0
  1074. package/dist/builtin-extensions/pi-web-access/render-search-error.js +131 -0
  1075. package/dist/builtin-extensions/pi-web-access/render-search-error.js.map +1 -0
  1076. package/dist/builtin-extensions/pi-web-access/rsc-extract.d.ts +12 -0
  1077. package/dist/builtin-extensions/pi-web-access/rsc-extract.d.ts.map +1 -0
  1078. package/dist/builtin-extensions/pi-web-access/rsc-extract.js +330 -0
  1079. package/dist/builtin-extensions/pi-web-access/rsc-extract.js.map +1 -0
  1080. package/dist/builtin-extensions/pi-web-access/ssrf-protection.d.ts +24 -0
  1081. package/dist/builtin-extensions/pi-web-access/ssrf-protection.d.ts.map +1 -0
  1082. package/dist/builtin-extensions/pi-web-access/ssrf-protection.js +255 -0
  1083. package/dist/builtin-extensions/pi-web-access/ssrf-protection.js.map +1 -0
  1084. package/dist/builtin-extensions/pi-web-access/storage.d.ts +25 -0
  1085. package/dist/builtin-extensions/pi-web-access/storage.d.ts.map +1 -0
  1086. package/dist/builtin-extensions/pi-web-access/storage.js +49 -0
  1087. package/dist/builtin-extensions/pi-web-access/storage.js.map +1 -0
  1088. package/dist/builtin-extensions/pi-web-access/summary-model-scope.d.ts +13 -0
  1089. package/dist/builtin-extensions/pi-web-access/summary-model-scope.d.ts.map +1 -0
  1090. package/dist/builtin-extensions/pi-web-access/summary-model-scope.js +86 -0
  1091. package/dist/builtin-extensions/pi-web-access/summary-model-scope.js.map +1 -0
  1092. package/dist/builtin-extensions/pi-web-access/summary-review.d.ts +21 -0
  1093. package/dist/builtin-extensions/pi-web-access/summary-review.d.ts.map +1 -0
  1094. package/dist/builtin-extensions/pi-web-access/summary-review.js +278 -0
  1095. package/dist/builtin-extensions/pi-web-access/summary-review.js.map +1 -0
  1096. package/dist/builtin-extensions/pi-web-access/tavily.d.ts +8 -0
  1097. package/dist/builtin-extensions/pi-web-access/tavily.d.ts.map +1 -0
  1098. package/dist/builtin-extensions/pi-web-access/tavily.js +184 -0
  1099. package/dist/builtin-extensions/pi-web-access/tavily.js.map +1 -0
  1100. package/dist/builtin-extensions/pi-web-access/utils.d.ts +12 -0
  1101. package/dist/builtin-extensions/pi-web-access/utils.d.ts.map +1 -0
  1102. package/dist/builtin-extensions/pi-web-access/utils.js +61 -0
  1103. package/dist/builtin-extensions/pi-web-access/utils.js.map +1 -0
  1104. package/dist/builtin-extensions/pi-web-access/video-extract.d.ts +14 -0
  1105. package/dist/builtin-extensions/pi-web-access/video-extract.d.ts.map +1 -0
  1106. package/dist/builtin-extensions/pi-web-access/video-extract.js +324 -0
  1107. package/dist/builtin-extensions/pi-web-access/video-extract.js.map +1 -0
  1108. package/dist/builtin-extensions/pi-web-access/youtube-extract.d.ts +27 -0
  1109. package/dist/builtin-extensions/pi-web-access/youtube-extract.d.ts.map +1 -0
  1110. package/dist/builtin-extensions/pi-web-access/youtube-extract.js +282 -0
  1111. package/dist/builtin-extensions/pi-web-access/youtube-extract.js.map +1 -0
  1112. package/dist/builtin-extensions/simple-pi-memory.d.ts +55 -0
  1113. package/dist/builtin-extensions/simple-pi-memory.d.ts.map +1 -0
  1114. package/dist/builtin-extensions/simple-pi-memory.js +263 -0
  1115. package/dist/builtin-extensions/simple-pi-memory.js.map +1 -0
  1116. package/dist/bun/cli.d.ts +3 -0
  1117. package/dist/bun/cli.d.ts.map +1 -0
  1118. package/dist/bun/cli.js +12 -0
  1119. package/dist/bun/cli.js.map +1 -0
  1120. package/dist/bun/register-bedrock.d.ts +2 -0
  1121. package/dist/bun/register-bedrock.d.ts.map +1 -0
  1122. package/dist/bun/register-bedrock.js +4 -0
  1123. package/dist/bun/register-bedrock.js.map +1 -0
  1124. package/dist/bun/restore-sandbox-env.d.ts +17 -0
  1125. package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
  1126. package/dist/bun/restore-sandbox-env.js +36 -0
  1127. package/dist/bun/restore-sandbox-env.js.map +1 -0
  1128. package/dist/catalog/models.json +1 -0
  1129. package/dist/catalog/providers/amazon-bedrock.json +1 -0
  1130. package/dist/catalog/providers/ant-ling.json +1 -0
  1131. package/dist/catalog/providers/anthropic.json +1 -0
  1132. package/dist/catalog/providers/azure-openai-responses.json +1 -0
  1133. package/dist/catalog/providers/cerebras.json +1 -0
  1134. package/dist/catalog/providers/cloudflare-ai-gateway.json +1 -0
  1135. package/dist/catalog/providers/cloudflare-workers-ai.json +1 -0
  1136. package/dist/catalog/providers/deepseek.json +1 -0
  1137. package/dist/catalog/providers/fireworks.json +1 -0
  1138. package/dist/catalog/providers/github-copilot.json +1 -0
  1139. package/dist/catalog/providers/google-vertex.json +1 -0
  1140. package/dist/catalog/providers/google.json +1 -0
  1141. package/dist/catalog/providers/groq.json +1 -0
  1142. package/dist/catalog/providers/huggingface.json +1 -0
  1143. package/dist/catalog/providers/kimi-coding.json +1 -0
  1144. package/dist/catalog/providers/minimax-cn.json +1 -0
  1145. package/dist/catalog/providers/minimax.json +1 -0
  1146. package/dist/catalog/providers/mistral.json +1 -0
  1147. package/dist/catalog/providers/moonshotai-cn.json +1 -0
  1148. package/dist/catalog/providers/moonshotai.json +1 -0
  1149. package/dist/catalog/providers/nvidia.json +1 -0
  1150. package/dist/catalog/providers/openai-codex.json +1 -0
  1151. package/dist/catalog/providers/openai.json +1 -0
  1152. package/dist/catalog/providers/opencode-go.json +1 -0
  1153. package/dist/catalog/providers/opencode.json +1 -0
  1154. package/dist/catalog/providers/openrouter.json +1 -0
  1155. package/dist/catalog/providers/qwen-cloud-cn.json +1 -0
  1156. package/dist/catalog/providers/qwen-cloud.json +1 -0
  1157. package/dist/catalog/providers/qwen-token-plan-cn.json +1 -0
  1158. package/dist/catalog/providers/qwen-token-plan.json +1 -0
  1159. package/dist/catalog/providers/together.json +1 -0
  1160. package/dist/catalog/providers/vercel-ai-gateway.json +1 -0
  1161. package/dist/catalog/providers/xai.json +1 -0
  1162. package/dist/catalog/providers/xiaomi-token-plan-ams.json +1 -0
  1163. package/dist/catalog/providers/xiaomi-token-plan-cn.json +1 -0
  1164. package/dist/catalog/providers/xiaomi-token-plan-sgp.json +1 -0
  1165. package/dist/catalog/providers/xiaomi.json +1 -0
  1166. package/dist/catalog/providers/zai-coding-cn.json +1 -0
  1167. package/dist/catalog/providers/zai.json +1 -0
  1168. package/dist/catalog/providers.json +1 -0
  1169. package/dist/catalog/publication.json +6 -0
  1170. package/dist/cli/args.d.ts +57 -0
  1171. package/dist/cli/args.d.ts.map +1 -0
  1172. package/dist/cli/args.js +381 -0
  1173. package/dist/cli/args.js.map +1 -0
  1174. package/dist/cli/config-selector.d.ts +16 -0
  1175. package/dist/cli/config-selector.d.ts.map +1 -0
  1176. package/dist/cli/config-selector.js +31 -0
  1177. package/dist/cli/config-selector.js.map +1 -0
  1178. package/dist/cli/file-processor.d.ts +15 -0
  1179. package/dist/cli/file-processor.d.ts.map +1 -0
  1180. package/dist/cli/file-processor.js +70 -0
  1181. package/dist/cli/file-processor.js.map +1 -0
  1182. package/dist/cli/initial-message.d.ts +18 -0
  1183. package/dist/cli/initial-message.d.ts.map +1 -0
  1184. package/dist/cli/initial-message.js +22 -0
  1185. package/dist/cli/initial-message.js.map +1 -0
  1186. package/dist/cli/install-cli.d.ts +13 -0
  1187. package/dist/cli/install-cli.d.ts.map +1 -0
  1188. package/dist/cli/install-cli.js +352 -0
  1189. package/dist/cli/install-cli.js.map +1 -0
  1190. package/dist/cli/list-models.d.ts +9 -0
  1191. package/dist/cli/list-models.d.ts.map +1 -0
  1192. package/dist/cli/list-models.js +98 -0
  1193. package/dist/cli/list-models.js.map +1 -0
  1194. package/dist/cli/project-trust.d.ts +10 -0
  1195. package/dist/cli/project-trust.d.ts.map +1 -0
  1196. package/dist/cli/project-trust.js +48 -0
  1197. package/dist/cli/project-trust.js.map +1 -0
  1198. package/dist/cli/read-secret.d.ts +6 -0
  1199. package/dist/cli/read-secret.d.ts.map +1 -0
  1200. package/dist/cli/read-secret.js +62 -0
  1201. package/dist/cli/read-secret.js.map +1 -0
  1202. package/dist/cli/session-picker.d.ts +10 -0
  1203. package/dist/cli/session-picker.d.ts.map +1 -0
  1204. package/dist/cli/session-picker.js +36 -0
  1205. package/dist/cli/session-picker.js.map +1 -0
  1206. package/dist/cli/startup-ui.d.ts +20 -0
  1207. package/dist/cli/startup-ui.d.ts.map +1 -0
  1208. package/dist/cli/startup-ui.js +190 -0
  1209. package/dist/cli/startup-ui.js.map +1 -0
  1210. package/dist/cli/update-cli.d.ts +18 -0
  1211. package/dist/cli/update-cli.d.ts.map +1 -0
  1212. package/dist/cli/update-cli.js +87 -0
  1213. package/dist/cli/update-cli.js.map +1 -0
  1214. package/dist/cli.d.ts +3 -0
  1215. package/dist/cli.d.ts.map +1 -0
  1216. package/dist/cli.js +57 -0
  1217. package/dist/cli.js.map +1 -0
  1218. package/dist/config.d.ts +85 -0
  1219. package/dist/config.d.ts.map +1 -0
  1220. package/dist/config.js +212 -0
  1221. package/dist/config.js.map +1 -0
  1222. package/dist/core/agent-session-runtime.d.ts +119 -0
  1223. package/dist/core/agent-session-runtime.d.ts.map +1 -0
  1224. package/dist/core/agent-session-runtime.js +306 -0
  1225. package/dist/core/agent-session-runtime.js.map +1 -0
  1226. package/dist/core/agent-session-services.d.ts +85 -0
  1227. package/dist/core/agent-session-services.d.ts.map +1 -0
  1228. package/dist/core/agent-session-services.js +127 -0
  1229. package/dist/core/agent-session-services.js.map +1 -0
  1230. package/dist/core/agent-session.d.ts +670 -0
  1231. package/dist/core/agent-session.d.ts.map +1 -0
  1232. package/dist/core/agent-session.js +2933 -0
  1233. package/dist/core/agent-session.js.map +1 -0
  1234. package/dist/core/auth-guidance.d.ts +5 -0
  1235. package/dist/core/auth-guidance.d.ts.map +1 -0
  1236. package/dist/core/auth-guidance.js +21 -0
  1237. package/dist/core/auth-guidance.js.map +1 -0
  1238. package/dist/core/auth-storage.d.ts +56 -0
  1239. package/dist/core/auth-storage.d.ts.map +1 -0
  1240. package/dist/core/auth-storage.js +261 -0
  1241. package/dist/core/auth-storage.js.map +1 -0
  1242. package/dist/core/bash-executor.d.ts +32 -0
  1243. package/dist/core/bash-executor.d.ts.map +1 -0
  1244. package/dist/core/bash-executor.js +111 -0
  1245. package/dist/core/bash-executor.js.map +1 -0
  1246. package/dist/core/cache-stats.d.ts +49 -0
  1247. package/dist/core/cache-stats.d.ts.map +1 -0
  1248. package/dist/core/cache-stats.js +101 -0
  1249. package/dist/core/cache-stats.js.map +1 -0
  1250. package/dist/core/catalog-merge.d.ts +46 -0
  1251. package/dist/core/catalog-merge.d.ts.map +1 -0
  1252. package/dist/core/catalog-merge.js +138 -0
  1253. package/dist/core/catalog-merge.js.map +1 -0
  1254. package/dist/core/compaction/branch-summarization.d.ts +92 -0
  1255. package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
  1256. package/dist/core/compaction/branch-summarization.js +249 -0
  1257. package/dist/core/compaction/branch-summarization.js.map +1 -0
  1258. package/dist/core/compaction/compaction.d.ts +121 -0
  1259. package/dist/core/compaction/compaction.d.ts.map +1 -0
  1260. package/dist/core/compaction/compaction.js +600 -0
  1261. package/dist/core/compaction/compaction.js.map +1 -0
  1262. package/dist/core/compaction/index.d.ts +7 -0
  1263. package/dist/core/compaction/index.d.ts.map +1 -0
  1264. package/dist/core/compaction/index.js +7 -0
  1265. package/dist/core/compaction/index.js.map +1 -0
  1266. package/dist/core/compaction/utils.d.ts +38 -0
  1267. package/dist/core/compaction/utils.d.ts.map +1 -0
  1268. package/dist/core/compaction/utils.js +153 -0
  1269. package/dist/core/compaction/utils.js.map +1 -0
  1270. package/dist/core/context-breakdown.d.ts +89 -0
  1271. package/dist/core/context-breakdown.d.ts.map +1 -0
  1272. package/dist/core/context-breakdown.js +175 -0
  1273. package/dist/core/context-breakdown.js.map +1 -0
  1274. package/dist/core/cron/fire-guard.d.ts +16 -0
  1275. package/dist/core/cron/fire-guard.d.ts.map +1 -0
  1276. package/dist/core/cron/fire-guard.js +24 -0
  1277. package/dist/core/cron/fire-guard.js.map +1 -0
  1278. package/dist/core/cron/jobs.d.ts +162 -0
  1279. package/dist/core/cron/jobs.d.ts.map +1 -0
  1280. package/dist/core/cron/jobs.js +545 -0
  1281. package/dist/core/cron/jobs.js.map +1 -0
  1282. package/dist/core/cron/origin-context.d.ts +22 -0
  1283. package/dist/core/cron/origin-context.d.ts.map +1 -0
  1284. package/dist/core/cron/origin-context.js +22 -0
  1285. package/dist/core/cron/origin-context.js.map +1 -0
  1286. package/dist/core/cron/scheduler.d.ts +51 -0
  1287. package/dist/core/cron/scheduler.d.ts.map +1 -0
  1288. package/dist/core/cron/scheduler.js +165 -0
  1289. package/dist/core/cron/scheduler.js.map +1 -0
  1290. package/dist/core/customize.d.ts +37 -0
  1291. package/dist/core/customize.d.ts.map +1 -0
  1292. package/dist/core/customize.js +72 -0
  1293. package/dist/core/customize.js.map +1 -0
  1294. package/dist/core/defaults.d.ts +3 -0
  1295. package/dist/core/defaults.d.ts.map +1 -0
  1296. package/dist/core/defaults.js +2 -0
  1297. package/dist/core/defaults.js.map +1 -0
  1298. package/dist/core/diagnostics.d.ts +15 -0
  1299. package/dist/core/diagnostics.d.ts.map +1 -0
  1300. package/dist/core/diagnostics.js +2 -0
  1301. package/dist/core/diagnostics.js.map +1 -0
  1302. package/dist/core/event-bus.d.ts +9 -0
  1303. package/dist/core/event-bus.d.ts.map +1 -0
  1304. package/dist/core/event-bus.js +25 -0
  1305. package/dist/core/event-bus.js.map +1 -0
  1306. package/dist/core/exec.d.ts +29 -0
  1307. package/dist/core/exec.d.ts.map +1 -0
  1308. package/dist/core/exec.js +75 -0
  1309. package/dist/core/exec.js.map +1 -0
  1310. package/dist/core/experimental.d.ts +2 -0
  1311. package/dist/core/experimental.d.ts.map +1 -0
  1312. package/dist/core/experimental.js +4 -0
  1313. package/dist/core/experimental.js.map +1 -0
  1314. package/dist/core/export-html/ansi-to-html.d.ts +22 -0
  1315. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
  1316. package/dist/core/export-html/ansi-to-html.js +249 -0
  1317. package/dist/core/export-html/ansi-to-html.js.map +1 -0
  1318. package/dist/core/export-html/index.d.ts +37 -0
  1319. package/dist/core/export-html/index.d.ts.map +1 -0
  1320. package/dist/core/export-html/index.js +226 -0
  1321. package/dist/core/export-html/index.js.map +1 -0
  1322. package/dist/core/export-html/template.css +1066 -0
  1323. package/dist/core/export-html/template.html +55 -0
  1324. package/dist/core/export-html/template.js +1864 -0
  1325. package/dist/core/export-html/tool-renderer.d.ts +34 -0
  1326. package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
  1327. package/dist/core/export-html/tool-renderer.js +108 -0
  1328. package/dist/core/export-html/tool-renderer.js.map +1 -0
  1329. package/dist/core/export-html/vendor/highlight.min.js +1213 -0
  1330. package/dist/core/export-html/vendor/marked.min.js +78 -0
  1331. package/dist/core/extensions/host-static.d.ts +2 -0
  1332. package/dist/core/extensions/host-static.d.ts.map +1 -0
  1333. package/dist/core/extensions/host-static.js +15 -0
  1334. package/dist/core/extensions/host-static.js.map +1 -0
  1335. package/dist/core/extensions/index.d.ts +12 -0
  1336. package/dist/core/extensions/index.d.ts.map +1 -0
  1337. package/dist/core/extensions/index.js +9 -0
  1338. package/dist/core/extensions/index.js.map +1 -0
  1339. package/dist/core/extensions/loader.d.ts +33 -0
  1340. package/dist/core/extensions/loader.d.ts.map +1 -0
  1341. package/dist/core/extensions/loader.js +588 -0
  1342. package/dist/core/extensions/loader.js.map +1 -0
  1343. package/dist/core/extensions/runner.d.ts +172 -0
  1344. package/dist/core/extensions/runner.d.ts.map +1 -0
  1345. package/dist/core/extensions/runner.js +935 -0
  1346. package/dist/core/extensions/runner.js.map +1 -0
  1347. package/dist/core/extensions/types.d.ts +1263 -0
  1348. package/dist/core/extensions/types.d.ts.map +1 -0
  1349. package/dist/core/extensions/types.js +45 -0
  1350. package/dist/core/extensions/types.js.map +1 -0
  1351. package/dist/core/extensions/wrapper.d.ts +20 -0
  1352. package/dist/core/extensions/wrapper.d.ts.map +1 -0
  1353. package/dist/core/extensions/wrapper.js +41 -0
  1354. package/dist/core/extensions/wrapper.js.map +1 -0
  1355. package/dist/core/footer-data-provider.d.ts +64 -0
  1356. package/dist/core/footer-data-provider.d.ts.map +1 -0
  1357. package/dist/core/footer-data-provider.js +373 -0
  1358. package/dist/core/footer-data-provider.js.map +1 -0
  1359. package/dist/core/grok-cli-auth.d.ts +42 -0
  1360. package/dist/core/grok-cli-auth.d.ts.map +1 -0
  1361. package/dist/core/grok-cli-auth.js +327 -0
  1362. package/dist/core/grok-cli-auth.js.map +1 -0
  1363. package/dist/core/http-dispatcher.d.ts +22 -0
  1364. package/dist/core/http-dispatcher.d.ts.map +1 -0
  1365. package/dist/core/http-dispatcher.js +91 -0
  1366. package/dist/core/http-dispatcher.js.map +1 -0
  1367. package/dist/core/index.d.ts +13 -0
  1368. package/dist/core/index.d.ts.map +1 -0
  1369. package/dist/core/index.js +13 -0
  1370. package/dist/core/index.js.map +1 -0
  1371. package/dist/core/injected-prompt.d.ts +20 -0
  1372. package/dist/core/injected-prompt.d.ts.map +1 -0
  1373. package/dist/core/injected-prompt.js +64 -0
  1374. package/dist/core/injected-prompt.js.map +1 -0
  1375. package/dist/core/install-features.d.ts +106 -0
  1376. package/dist/core/install-features.d.ts.map +1 -0
  1377. package/dist/core/install-features.js +392 -0
  1378. package/dist/core/install-features.js.map +1 -0
  1379. package/dist/core/install-layout.d.ts +18 -0
  1380. package/dist/core/install-layout.d.ts.map +1 -0
  1381. package/dist/core/install-layout.js +54 -0
  1382. package/dist/core/install-layout.js.map +1 -0
  1383. package/dist/core/keybindings.d.ts +373 -0
  1384. package/dist/core/keybindings.d.ts.map +1 -0
  1385. package/dist/core/keybindings.js +309 -0
  1386. package/dist/core/keybindings.js.map +1 -0
  1387. package/dist/core/live-catalog.d.ts +74 -0
  1388. package/dist/core/live-catalog.d.ts.map +1 -0
  1389. package/dist/core/live-catalog.js +351 -0
  1390. package/dist/core/live-catalog.js.map +1 -0
  1391. package/dist/core/memory-cap.d.ts +23 -0
  1392. package/dist/core/memory-cap.d.ts.map +1 -0
  1393. package/dist/core/memory-cap.js +32 -0
  1394. package/dist/core/memory-cap.js.map +1 -0
  1395. package/dist/core/messages.d.ts +77 -0
  1396. package/dist/core/messages.d.ts.map +1 -0
  1397. package/dist/core/messages.js +123 -0
  1398. package/dist/core/messages.js.map +1 -0
  1399. package/dist/core/model-config-writer.d.ts +24 -0
  1400. package/dist/core/model-config-writer.d.ts.map +1 -0
  1401. package/dist/core/model-config-writer.js +84 -0
  1402. package/dist/core/model-config-writer.js.map +1 -0
  1403. package/dist/core/model-config.d.ts +512 -0
  1404. package/dist/core/model-config.d.ts.map +1 -0
  1405. package/dist/core/model-config.js +243 -0
  1406. package/dist/core/model-config.js.map +1 -0
  1407. package/dist/core/model-registry.d.ts +39 -0
  1408. package/dist/core/model-registry.d.ts.map +1 -0
  1409. package/dist/core/model-registry.js +89 -0
  1410. package/dist/core/model-registry.js.map +1 -0
  1411. package/dist/core/model-resolver.d.ts +121 -0
  1412. package/dist/core/model-resolver.d.ts.map +1 -0
  1413. package/dist/core/model-resolver.js +536 -0
  1414. package/dist/core/model-resolver.js.map +1 -0
  1415. package/dist/core/model-runtime.d.ts +135 -0
  1416. package/dist/core/model-runtime.d.ts.map +1 -0
  1417. package/dist/core/model-runtime.js +696 -0
  1418. package/dist/core/model-runtime.js.map +1 -0
  1419. package/dist/core/model-tiers.d.ts +43 -0
  1420. package/dist/core/model-tiers.d.ts.map +1 -0
  1421. package/dist/core/model-tiers.js +78 -0
  1422. package/dist/core/model-tiers.js.map +1 -0
  1423. package/dist/core/models-store.d.ts +17 -0
  1424. package/dist/core/models-store.d.ts.map +1 -0
  1425. package/dist/core/models-store.js +57 -0
  1426. package/dist/core/models-store.js.map +1 -0
  1427. package/dist/core/official-catalog.d.ts +79 -0
  1428. package/dist/core/official-catalog.d.ts.map +1 -0
  1429. package/dist/core/official-catalog.js +404 -0
  1430. package/dist/core/official-catalog.js.map +1 -0
  1431. package/dist/core/output-guard.d.ts +7 -0
  1432. package/dist/core/output-guard.d.ts.map +1 -0
  1433. package/dist/core/output-guard.js +89 -0
  1434. package/dist/core/output-guard.js.map +1 -0
  1435. package/dist/core/package-manager.d.ts +201 -0
  1436. package/dist/core/package-manager.d.ts.map +1 -0
  1437. package/dist/core/package-manager.js +2035 -0
  1438. package/dist/core/package-manager.js.map +1 -0
  1439. package/dist/core/permission-mode-control.d.ts +27 -0
  1440. package/dist/core/permission-mode-control.d.ts.map +1 -0
  1441. package/dist/core/permission-mode-control.js +39 -0
  1442. package/dist/core/permission-mode-control.js.map +1 -0
  1443. package/dist/core/permission-mode.d.ts +19 -0
  1444. package/dist/core/permission-mode.d.ts.map +1 -0
  1445. package/dist/core/permission-mode.js +26 -0
  1446. package/dist/core/permission-mode.js.map +1 -0
  1447. package/dist/core/permissions.d.ts +110 -0
  1448. package/dist/core/permissions.d.ts.map +1 -0
  1449. package/dist/core/permissions.js +438 -0
  1450. package/dist/core/permissions.js.map +1 -0
  1451. package/dist/core/plan-mode.d.ts +39 -0
  1452. package/dist/core/plan-mode.d.ts.map +1 -0
  1453. package/dist/core/plan-mode.js +429 -0
  1454. package/dist/core/plan-mode.js.map +1 -0
  1455. package/dist/core/process-registry.d.ts +40 -0
  1456. package/dist/core/process-registry.d.ts.map +1 -0
  1457. package/dist/core/process-registry.js +190 -0
  1458. package/dist/core/process-registry.js.map +1 -0
  1459. package/dist/core/project-trust.d.ts +15 -0
  1460. package/dist/core/project-trust.d.ts.map +1 -0
  1461. package/dist/core/project-trust.js +59 -0
  1462. package/dist/core/project-trust.js.map +1 -0
  1463. package/dist/core/prompt-templates.d.ts +53 -0
  1464. package/dist/core/prompt-templates.d.ts.map +1 -0
  1465. package/dist/core/prompt-templates.js +236 -0
  1466. package/dist/core/prompt-templates.js.map +1 -0
  1467. package/dist/core/provider-attribution.d.ts +4 -0
  1468. package/dist/core/provider-attribution.d.ts.map +1 -0
  1469. package/dist/core/provider-attribution.js +31 -0
  1470. package/dist/core/provider-attribution.js.map +1 -0
  1471. package/dist/core/provider-composer.d.ts +55 -0
  1472. package/dist/core/provider-composer.d.ts.map +1 -0
  1473. package/dist/core/provider-composer.js +375 -0
  1474. package/dist/core/provider-composer.js.map +1 -0
  1475. package/dist/core/radius.d.ts +2 -0
  1476. package/dist/core/radius.d.ts.map +1 -0
  1477. package/dist/core/radius.js +2 -0
  1478. package/dist/core/radius.js.map +1 -0
  1479. package/dist/core/resolve-config-value.d.ts +30 -0
  1480. package/dist/core/resolve-config-value.d.ts.map +1 -0
  1481. package/dist/core/resolve-config-value.js +247 -0
  1482. package/dist/core/resolve-config-value.js.map +1 -0
  1483. package/dist/core/resource-loader.d.ts +211 -0
  1484. package/dist/core/resource-loader.d.ts.map +1 -0
  1485. package/dist/core/resource-loader.js +848 -0
  1486. package/dist/core/resource-loader.js.map +1 -0
  1487. package/dist/core/rollback.d.ts +80 -0
  1488. package/dist/core/rollback.d.ts.map +1 -0
  1489. package/dist/core/rollback.js +659 -0
  1490. package/dist/core/rollback.js.map +1 -0
  1491. package/dist/core/runtime-credentials.d.ts +15 -0
  1492. package/dist/core/runtime-credentials.d.ts.map +1 -0
  1493. package/dist/core/runtime-credentials.js +36 -0
  1494. package/dist/core/runtime-credentials.js.map +1 -0
  1495. package/dist/core/sdk.d.ts +106 -0
  1496. package/dist/core/sdk.d.ts.map +1 -0
  1497. package/dist/core/sdk.js +264 -0
  1498. package/dist/core/sdk.js.map +1 -0
  1499. package/dist/core/search-curator.d.ts +23 -0
  1500. package/dist/core/search-curator.d.ts.map +1 -0
  1501. package/dist/core/search-curator.js +34 -0
  1502. package/dist/core/search-curator.js.map +1 -0
  1503. package/dist/core/session-cwd.d.ts +19 -0
  1504. package/dist/core/session-cwd.d.ts.map +1 -0
  1505. package/dist/core/session-cwd.js +38 -0
  1506. package/dist/core/session-cwd.js.map +1 -0
  1507. package/dist/core/session-manager.d.ts +352 -0
  1508. package/dist/core/session-manager.d.ts.map +1 -0
  1509. package/dist/core/session-manager.js +1319 -0
  1510. package/dist/core/session-manager.js.map +1 -0
  1511. package/dist/core/session-retention.d.ts +17 -0
  1512. package/dist/core/session-retention.d.ts.map +1 -0
  1513. package/dist/core/session-retention.js +69 -0
  1514. package/dist/core/session-retention.js.map +1 -0
  1515. package/dist/core/settings-manager.d.ts +392 -0
  1516. package/dist/core/settings-manager.d.ts.map +1 -0
  1517. package/dist/core/settings-manager.js +1165 -0
  1518. package/dist/core/settings-manager.js.map +1 -0
  1519. package/dist/core/skills.d.ts +60 -0
  1520. package/dist/core/skills.d.ts.map +1 -0
  1521. package/dist/core/skills.js +387 -0
  1522. package/dist/core/skills.js.map +1 -0
  1523. package/dist/core/slash-commands.d.ts +15 -0
  1524. package/dist/core/slash-commands.d.ts.map +1 -0
  1525. package/dist/core/slash-commands.js +54 -0
  1526. package/dist/core/slash-commands.js.map +1 -0
  1527. package/dist/core/source-info.d.ts +18 -0
  1528. package/dist/core/source-info.d.ts.map +1 -0
  1529. package/dist/core/source-info.js +19 -0
  1530. package/dist/core/source-info.js.map +1 -0
  1531. package/dist/core/subagent-permission-inherit.d.ts +50 -0
  1532. package/dist/core/subagent-permission-inherit.d.ts.map +1 -0
  1533. package/dist/core/subagent-permission-inherit.js +67 -0
  1534. package/dist/core/subagent-permission-inherit.js.map +1 -0
  1535. package/dist/core/subscriptions.d.ts +64 -0
  1536. package/dist/core/subscriptions.d.ts.map +1 -0
  1537. package/dist/core/subscriptions.js +259 -0
  1538. package/dist/core/subscriptions.js.map +1 -0
  1539. package/dist/core/swarm.d.ts +54 -0
  1540. package/dist/core/swarm.d.ts.map +1 -0
  1541. package/dist/core/swarm.js +119 -0
  1542. package/dist/core/swarm.js.map +1 -0
  1543. package/dist/core/system-prompt.d.ts +30 -0
  1544. package/dist/core/system-prompt.d.ts.map +1 -0
  1545. package/dist/core/system-prompt.js +97 -0
  1546. package/dist/core/system-prompt.js.map +1 -0
  1547. package/dist/core/timings.d.ts +11 -0
  1548. package/dist/core/timings.d.ts.map +1 -0
  1549. package/dist/core/timings.js +46 -0
  1550. package/dist/core/timings.js.map +1 -0
  1551. package/dist/core/tools/bash.d.ts +69 -0
  1552. package/dist/core/tools/bash.d.ts.map +1 -0
  1553. package/dist/core/tools/bash.js +403 -0
  1554. package/dist/core/tools/bash.js.map +1 -0
  1555. package/dist/core/tools/edit-diff.d.ts +106 -0
  1556. package/dist/core/tools/edit-diff.d.ts.map +1 -0
  1557. package/dist/core/tools/edit-diff.js +424 -0
  1558. package/dist/core/tools/edit-diff.js.map +1 -0
  1559. package/dist/core/tools/edit.d.ts +51 -0
  1560. package/dist/core/tools/edit.d.ts.map +1 -0
  1561. package/dist/core/tools/edit.js +303 -0
  1562. package/dist/core/tools/edit.js.map +1 -0
  1563. package/dist/core/tools/file-mutation-queue.d.ts +6 -0
  1564. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
  1565. package/dist/core/tools/file-mutation-queue.js +52 -0
  1566. package/dist/core/tools/file-mutation-queue.js.map +1 -0
  1567. package/dist/core/tools/find.d.ts +35 -0
  1568. package/dist/core/tools/find.d.ts.map +1 -0
  1569. package/dist/core/tools/find.js +325 -0
  1570. package/dist/core/tools/find.js.map +1 -0
  1571. package/dist/core/tools/grep.d.ts +37 -0
  1572. package/dist/core/tools/grep.d.ts.map +1 -0
  1573. package/dist/core/tools/grep.js +324 -0
  1574. package/dist/core/tools/grep.js.map +1 -0
  1575. package/dist/core/tools/index.d.ts +40 -0
  1576. package/dist/core/tools/index.d.ts.map +1 -0
  1577. package/dist/core/tools/index.js +112 -0
  1578. package/dist/core/tools/index.js.map +1 -0
  1579. package/dist/core/tools/ls.d.ts +37 -0
  1580. package/dist/core/tools/ls.d.ts.map +1 -0
  1581. package/dist/core/tools/ls.js +185 -0
  1582. package/dist/core/tools/ls.js.map +1 -0
  1583. package/dist/core/tools/output-accumulator.d.ts +52 -0
  1584. package/dist/core/tools/output-accumulator.d.ts.map +1 -0
  1585. package/dist/core/tools/output-accumulator.js +184 -0
  1586. package/dist/core/tools/output-accumulator.js.map +1 -0
  1587. package/dist/core/tools/path-utils.d.ts +10 -0
  1588. package/dist/core/tools/path-utils.d.ts.map +1 -0
  1589. package/dist/core/tools/path-utils.js +99 -0
  1590. package/dist/core/tools/path-utils.js.map +1 -0
  1591. package/dist/core/tools/read.d.ts +35 -0
  1592. package/dist/core/tools/read.d.ts.map +1 -0
  1593. package/dist/core/tools/read.js +289 -0
  1594. package/dist/core/tools/read.js.map +1 -0
  1595. package/dist/core/tools/render-utils.d.ts +74 -0
  1596. package/dist/core/tools/render-utils.d.ts.map +1 -0
  1597. package/dist/core/tools/render-utils.js +150 -0
  1598. package/dist/core/tools/render-utils.js.map +1 -0
  1599. package/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
  1600. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
  1601. package/dist/core/tools/tool-definition-wrapper.js +34 -0
  1602. package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
  1603. package/dist/core/tools/truncate.d.ts +70 -0
  1604. package/dist/core/tools/truncate.d.ts.map +1 -0
  1605. package/dist/core/tools/truncate.js +215 -0
  1606. package/dist/core/tools/truncate.js.map +1 -0
  1607. package/dist/core/tools/write.d.ts +26 -0
  1608. package/dist/core/tools/write.d.ts.map +1 -0
  1609. package/dist/core/tools/write.js +219 -0
  1610. package/dist/core/tools/write.js.map +1 -0
  1611. package/dist/core/trust-manager.d.ts +36 -0
  1612. package/dist/core/trust-manager.d.ts.map +1 -0
  1613. package/dist/core/trust-manager.js +202 -0
  1614. package/dist/core/trust-manager.js.map +1 -0
  1615. package/dist/core/update-check.d.ts +35 -0
  1616. package/dist/core/update-check.d.ts.map +1 -0
  1617. package/dist/core/update-check.js +117 -0
  1618. package/dist/core/update-check.js.map +1 -0
  1619. package/dist/core/usage-adapters/kimi-coding.d.ts +11 -0
  1620. package/dist/core/usage-adapters/kimi-coding.d.ts.map +1 -0
  1621. package/dist/core/usage-adapters/kimi-coding.js +78 -0
  1622. package/dist/core/usage-adapters/kimi-coding.js.map +1 -0
  1623. package/dist/core/usage-adapters/openai-codex.d.ts +4 -0
  1624. package/dist/core/usage-adapters/openai-codex.d.ts.map +1 -0
  1625. package/dist/core/usage-adapters/openai-codex.js +185 -0
  1626. package/dist/core/usage-adapters/openai-codex.js.map +1 -0
  1627. package/dist/core/usage-adapters/shared.d.ts +20 -0
  1628. package/dist/core/usage-adapters/shared.d.ts.map +1 -0
  1629. package/dist/core/usage-adapters/shared.js +75 -0
  1630. package/dist/core/usage-adapters/shared.js.map +1 -0
  1631. package/dist/core/usage-adapters/xai.d.ts +21 -0
  1632. package/dist/core/usage-adapters/xai.d.ts.map +1 -0
  1633. package/dist/core/usage-adapters/xai.js +81 -0
  1634. package/dist/core/usage-adapters/xai.js.map +1 -0
  1635. package/dist/core/usage-adapters/zai.d.ts +14 -0
  1636. package/dist/core/usage-adapters/zai.d.ts.map +1 -0
  1637. package/dist/core/usage-adapters/zai.js +67 -0
  1638. package/dist/core/usage-adapters/zai.js.map +1 -0
  1639. package/dist/core/usage-history.d.ts +63 -0
  1640. package/dist/core/usage-history.d.ts.map +1 -0
  1641. package/dist/core/usage-history.js +239 -0
  1642. package/dist/core/usage-history.js.map +1 -0
  1643. package/dist/core/usage-limit.d.ts +17 -0
  1644. package/dist/core/usage-limit.d.ts.map +1 -0
  1645. package/dist/core/usage-limit.js +79 -0
  1646. package/dist/core/usage-limit.js.map +1 -0
  1647. package/dist/core/usage-service.d.ts +75 -0
  1648. package/dist/core/usage-service.d.ts.map +1 -0
  1649. package/dist/core/usage-service.js +180 -0
  1650. package/dist/core/usage-service.js.map +1 -0
  1651. package/dist/core/user-models.d.ts +50 -0
  1652. package/dist/core/user-models.d.ts.map +1 -0
  1653. package/dist/core/user-models.js +192 -0
  1654. package/dist/core/user-models.js.map +1 -0
  1655. package/dist/dev-cli.d.ts +3 -0
  1656. package/dist/dev-cli.d.ts.map +1 -0
  1657. package/dist/dev-cli.js +5 -0
  1658. package/dist/dev-cli.js.map +1 -0
  1659. package/dist/gateway/adapters/discord.d.ts +251 -0
  1660. package/dist/gateway/adapters/discord.d.ts.map +1 -0
  1661. package/dist/gateway/adapters/discord.js +693 -0
  1662. package/dist/gateway/adapters/discord.js.map +1 -0
  1663. package/dist/gateway/adapters/telegram.d.ts +187 -0
  1664. package/dist/gateway/adapters/telegram.d.ts.map +1 -0
  1665. package/dist/gateway/adapters/telegram.js +581 -0
  1666. package/dist/gateway/adapters/telegram.js.map +1 -0
  1667. package/dist/gateway/agent-bridge.d.ts +144 -0
  1668. package/dist/gateway/agent-bridge.d.ts.map +1 -0
  1669. package/dist/gateway/agent-bridge.js +477 -0
  1670. package/dist/gateway/agent-bridge.js.map +1 -0
  1671. package/dist/gateway/approval.d.ts +34 -0
  1672. package/dist/gateway/approval.d.ts.map +1 -0
  1673. package/dist/gateway/approval.js +152 -0
  1674. package/dist/gateway/approval.js.map +1 -0
  1675. package/dist/gateway/authz.d.ts +21 -0
  1676. package/dist/gateway/authz.d.ts.map +1 -0
  1677. package/dist/gateway/authz.js +61 -0
  1678. package/dist/gateway/authz.js.map +1 -0
  1679. package/dist/gateway/buttons.d.ts +58 -0
  1680. package/dist/gateway/buttons.d.ts.map +1 -0
  1681. package/dist/gateway/buttons.js +269 -0
  1682. package/dist/gateway/buttons.js.map +1 -0
  1683. package/dist/gateway/command.d.ts +8 -0
  1684. package/dist/gateway/command.d.ts.map +1 -0
  1685. package/dist/gateway/command.js +17 -0
  1686. package/dist/gateway/command.js.map +1 -0
  1687. package/dist/gateway/commands.d.ts +43 -0
  1688. package/dist/gateway/commands.d.ts.map +1 -0
  1689. package/dist/gateway/commands.js +644 -0
  1690. package/dist/gateway/commands.js.map +1 -0
  1691. package/dist/gateway/config.d.ts +53 -0
  1692. package/dist/gateway/config.d.ts.map +1 -0
  1693. package/dist/gateway/config.js +136 -0
  1694. package/dist/gateway/config.js.map +1 -0
  1695. package/dist/gateway/cron.d.ts +72 -0
  1696. package/dist/gateway/cron.d.ts.map +1 -0
  1697. package/dist/gateway/cron.js +331 -0
  1698. package/dist/gateway/cron.js.map +1 -0
  1699. package/dist/gateway/index.d.ts +31 -0
  1700. package/dist/gateway/index.d.ts.map +1 -0
  1701. package/dist/gateway/index.js +233 -0
  1702. package/dist/gateway/index.js.map +1 -0
  1703. package/dist/gateway/pairing.d.ts +44 -0
  1704. package/dist/gateway/pairing.d.ts.map +1 -0
  1705. package/dist/gateway/pairing.js +171 -0
  1706. package/dist/gateway/pairing.js.map +1 -0
  1707. package/dist/gateway/router.d.ts +48 -0
  1708. package/dist/gateway/router.d.ts.map +1 -0
  1709. package/dist/gateway/router.js +215 -0
  1710. package/dist/gateway/router.js.map +1 -0
  1711. package/dist/gateway/session-keys.d.ts +18 -0
  1712. package/dist/gateway/session-keys.d.ts.map +1 -0
  1713. package/dist/gateway/session-keys.js +26 -0
  1714. package/dist/gateway/session-keys.js.map +1 -0
  1715. package/dist/gateway/store.d.ts +28 -0
  1716. package/dist/gateway/store.d.ts.map +1 -0
  1717. package/dist/gateway/store.js +93 -0
  1718. package/dist/gateway/store.js.map +1 -0
  1719. package/dist/gateway/stream.d.ts +55 -0
  1720. package/dist/gateway/stream.d.ts.map +1 -0
  1721. package/dist/gateway/stream.js +107 -0
  1722. package/dist/gateway/stream.js.map +1 -0
  1723. package/dist/gateway/text.d.ts +18 -0
  1724. package/dist/gateway/text.d.ts.map +1 -0
  1725. package/dist/gateway/text.js +136 -0
  1726. package/dist/gateway/text.js.map +1 -0
  1727. package/dist/gateway/types.d.ts +95 -0
  1728. package/dist/gateway/types.d.ts.map +1 -0
  1729. package/dist/gateway/types.js +9 -0
  1730. package/dist/gateway/types.js.map +1 -0
  1731. package/dist/index.d.ts +35 -0
  1732. package/dist/index.d.ts.map +1 -0
  1733. package/dist/index.js +47 -0
  1734. package/dist/index.js.map +1 -0
  1735. package/dist/main.d.ts +22 -0
  1736. package/dist/main.d.ts.map +1 -0
  1737. package/dist/main.js +861 -0
  1738. package/dist/main.js.map +1 -0
  1739. package/dist/migrations.d.ts +48 -0
  1740. package/dist/migrations.d.ts.map +1 -0
  1741. package/dist/migrations.js +375 -0
  1742. package/dist/migrations.js.map +1 -0
  1743. package/dist/modes/index.d.ts +9 -0
  1744. package/dist/modes/index.d.ts.map +1 -0
  1745. package/dist/modes/index.js +8 -0
  1746. package/dist/modes/index.js.map +1 -0
  1747. package/dist/modes/interactive/assets/clankolas.png +0 -0
  1748. package/dist/modes/interactive/components/armin.d.ts +34 -0
  1749. package/dist/modes/interactive/components/armin.d.ts.map +1 -0
  1750. package/dist/modes/interactive/components/armin.js +333 -0
  1751. package/dist/modes/interactive/components/armin.js.map +1 -0
  1752. package/dist/modes/interactive/components/assistant-message.d.ts +41 -0
  1753. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
  1754. package/dist/modes/interactive/components/assistant-message.js +333 -0
  1755. package/dist/modes/interactive/components/assistant-message.js.map +1 -0
  1756. package/dist/modes/interactive/components/bash-execution.d.ts +32 -0
  1757. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
  1758. package/dist/modes/interactive/components/bash-execution.js +171 -0
  1759. package/dist/modes/interactive/components/bash-execution.js.map +1 -0
  1760. package/dist/modes/interactive/components/boot-ascii.d.ts +6 -0
  1761. package/dist/modes/interactive/components/boot-ascii.d.ts.map +1 -0
  1762. package/dist/modes/interactive/components/boot-ascii.js +6 -0
  1763. package/dist/modes/interactive/components/boot-ascii.js.map +1 -0
  1764. package/dist/modes/interactive/components/boot-screen.d.ts +22 -0
  1765. package/dist/modes/interactive/components/boot-screen.d.ts.map +1 -0
  1766. package/dist/modes/interactive/components/boot-screen.js +53 -0
  1767. package/dist/modes/interactive/components/boot-screen.js.map +1 -0
  1768. package/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
  1769. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
  1770. package/dist/modes/interactive/components/bordered-loader.js +54 -0
  1771. package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
  1772. package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
  1773. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
  1774. package/dist/modes/interactive/components/branch-summary-message.js +44 -0
  1775. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
  1776. package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
  1777. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
  1778. package/dist/modes/interactive/components/compaction-summary-message.js +45 -0
  1779. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
  1780. package/dist/modes/interactive/components/config-selector.d.ts +102 -0
  1781. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
  1782. package/dist/modes/interactive/components/config-selector.js +761 -0
  1783. package/dist/modes/interactive/components/config-selector.js.map +1 -0
  1784. package/dist/modes/interactive/components/context-view.d.ts +13 -0
  1785. package/dist/modes/interactive/components/context-view.d.ts.map +1 -0
  1786. package/dist/modes/interactive/components/context-view.js +44 -0
  1787. package/dist/modes/interactive/components/context-view.js.map +1 -0
  1788. package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
  1789. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
  1790. package/dist/modes/interactive/components/countdown-timer.js +33 -0
  1791. package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
  1792. package/dist/modes/interactive/components/custom-editor.d.ts +21 -0
  1793. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
  1794. package/dist/modes/interactive/components/custom-editor.js +70 -0
  1795. package/dist/modes/interactive/components/custom-editor.js.map +1 -0
  1796. package/dist/modes/interactive/components/custom-entry.d.ts +19 -0
  1797. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -0
  1798. package/dist/modes/interactive/components/custom-entry.js +52 -0
  1799. package/dist/modes/interactive/components/custom-entry.js.map +1 -0
  1800. package/dist/modes/interactive/components/custom-message.d.ts +20 -0
  1801. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
  1802. package/dist/modes/interactive/components/custom-message.js +79 -0
  1803. package/dist/modes/interactive/components/custom-message.js.map +1 -0
  1804. package/dist/modes/interactive/components/daxnuts.d.ts +23 -0
  1805. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
  1806. package/dist/modes/interactive/components/daxnuts.js +140 -0
  1807. package/dist/modes/interactive/components/daxnuts.js.map +1 -0
  1808. package/dist/modes/interactive/components/diff.d.ts +12 -0
  1809. package/dist/modes/interactive/components/diff.d.ts.map +1 -0
  1810. package/dist/modes/interactive/components/diff.js +133 -0
  1811. package/dist/modes/interactive/components/diff.js.map +1 -0
  1812. package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
  1813. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
  1814. package/dist/modes/interactive/components/dynamic-border.js +21 -0
  1815. package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
  1816. package/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
  1817. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -0
  1818. package/dist/modes/interactive/components/earendil-announcement.js +40 -0
  1819. package/dist/modes/interactive/components/earendil-announcement.js.map +1 -0
  1820. package/dist/modes/interactive/components/exit-card.d.ts +22 -0
  1821. package/dist/modes/interactive/components/exit-card.d.ts.map +1 -0
  1822. package/dist/modes/interactive/components/exit-card.js +69 -0
  1823. package/dist/modes/interactive/components/exit-card.js.map +1 -0
  1824. package/dist/modes/interactive/components/extension-editor.d.ts +22 -0
  1825. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
  1826. package/dist/modes/interactive/components/extension-editor.js +128 -0
  1827. package/dist/modes/interactive/components/extension-editor.js.map +1 -0
  1828. package/dist/modes/interactive/components/extension-input.d.ts +23 -0
  1829. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
  1830. package/dist/modes/interactive/components/extension-input.js +61 -0
  1831. package/dist/modes/interactive/components/extension-input.js.map +1 -0
  1832. package/dist/modes/interactive/components/extension-selector.d.ts +30 -0
  1833. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
  1834. package/dist/modes/interactive/components/extension-selector.js +106 -0
  1835. package/dist/modes/interactive/components/extension-selector.js.map +1 -0
  1836. package/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
  1837. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
  1838. package/dist/modes/interactive/components/first-time-setup.js +99 -0
  1839. package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
  1840. package/dist/modes/interactive/components/footer.d.ts +30 -0
  1841. package/dist/modes/interactive/components/footer.d.ts.map +1 -0
  1842. package/dist/modes/interactive/components/footer.js +230 -0
  1843. package/dist/modes/interactive/components/footer.js.map +1 -0
  1844. package/dist/modes/interactive/components/index.d.ts +34 -0
  1845. package/dist/modes/interactive/components/index.d.ts.map +1 -0
  1846. package/dist/modes/interactive/components/index.js +35 -0
  1847. package/dist/modes/interactive/components/index.js.map +1 -0
  1848. package/dist/modes/interactive/components/injected-prompt-message.d.ts +21 -0
  1849. package/dist/modes/interactive/components/injected-prompt-message.d.ts.map +1 -0
  1850. package/dist/modes/interactive/components/injected-prompt-message.js +51 -0
  1851. package/dist/modes/interactive/components/injected-prompt-message.js.map +1 -0
  1852. package/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
  1853. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
  1854. package/dist/modes/interactive/components/keybinding-hints.js +36 -0
  1855. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
  1856. package/dist/modes/interactive/components/login-dialog.d.ts +52 -0
  1857. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
  1858. package/dist/modes/interactive/components/login-dialog.js +188 -0
  1859. package/dist/modes/interactive/components/login-dialog.js.map +1 -0
  1860. package/dist/modes/interactive/components/model-selector.d.ts +61 -0
  1861. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
  1862. package/dist/modes/interactive/components/model-selector.js +320 -0
  1863. package/dist/modes/interactive/components/model-selector.js.map +1 -0
  1864. package/dist/modes/interactive/components/oauth-selector.d.ts +33 -0
  1865. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
  1866. package/dist/modes/interactive/components/oauth-selector.js +163 -0
  1867. package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
  1868. package/dist/modes/interactive/components/plan-message.d.ts +17 -0
  1869. package/dist/modes/interactive/components/plan-message.d.ts.map +1 -0
  1870. package/dist/modes/interactive/components/plan-message.js +43 -0
  1871. package/dist/modes/interactive/components/plan-message.js.map +1 -0
  1872. package/dist/modes/interactive/components/processes-selector.d.ts +20 -0
  1873. package/dist/modes/interactive/components/processes-selector.d.ts.map +1 -0
  1874. package/dist/modes/interactive/components/processes-selector.js +175 -0
  1875. package/dist/modes/interactive/components/processes-selector.js.map +1 -0
  1876. package/dist/modes/interactive/components/scoped-models-selector.d.ts +42 -0
  1877. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
  1878. package/dist/modes/interactive/components/scoped-models-selector.js +293 -0
  1879. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
  1880. package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
  1881. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
  1882. package/dist/modes/interactive/components/session-selector-search.js +155 -0
  1883. package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
  1884. package/dist/modes/interactive/components/session-selector.d.ts +95 -0
  1885. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
  1886. package/dist/modes/interactive/components/session-selector.js +857 -0
  1887. package/dist/modes/interactive/components/session-selector.js.map +1 -0
  1888. package/dist/modes/interactive/components/settings-selector.d.ts +157 -0
  1889. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
  1890. package/dist/modes/interactive/components/settings-selector.js +1273 -0
  1891. package/dist/modes/interactive/components/settings-selector.js.map +1 -0
  1892. package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
  1893. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
  1894. package/dist/modes/interactive/components/show-images-selector.js +39 -0
  1895. package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
  1896. package/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
  1897. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
  1898. package/dist/modes/interactive/components/skill-invocation-message.js +47 -0
  1899. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
  1900. package/dist/modes/interactive/components/status-indicator.d.ts +28 -0
  1901. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -0
  1902. package/dist/modes/interactive/components/status-indicator.js +60 -0
  1903. package/dist/modes/interactive/components/status-indicator.js.map +1 -0
  1904. package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
  1905. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
  1906. package/dist/modes/interactive/components/theme-selector.js +50 -0
  1907. package/dist/modes/interactive/components/theme-selector.js.map +1 -0
  1908. package/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
  1909. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
  1910. package/dist/modes/interactive/components/thinking-selector.js +52 -0
  1911. package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
  1912. package/dist/modes/interactive/components/thinking-summary.d.ts +36 -0
  1913. package/dist/modes/interactive/components/thinking-summary.d.ts.map +1 -0
  1914. package/dist/modes/interactive/components/thinking-summary.js +96 -0
  1915. package/dist/modes/interactive/components/thinking-summary.js.map +1 -0
  1916. package/dist/modes/interactive/components/thinking-tail.d.ts +22 -0
  1917. package/dist/modes/interactive/components/thinking-tail.d.ts.map +1 -0
  1918. package/dist/modes/interactive/components/thinking-tail.js +27 -0
  1919. package/dist/modes/interactive/components/thinking-tail.js.map +1 -0
  1920. package/dist/modes/interactive/components/tool-execution.d.ts +81 -0
  1921. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
  1922. package/dist/modes/interactive/components/tool-execution.js +473 -0
  1923. package/dist/modes/interactive/components/tool-execution.js.map +1 -0
  1924. package/dist/modes/interactive/components/tree-selector.d.ts +94 -0
  1925. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
  1926. package/dist/modes/interactive/components/tree-selector.js +1245 -0
  1927. package/dist/modes/interactive/components/tree-selector.js.map +1 -0
  1928. package/dist/modes/interactive/components/trust-selector.d.ts +23 -0
  1929. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
  1930. package/dist/modes/interactive/components/trust-selector.js +91 -0
  1931. package/dist/modes/interactive/components/trust-selector.js.map +1 -0
  1932. package/dist/modes/interactive/components/usage-view.d.ts +42 -0
  1933. package/dist/modes/interactive/components/usage-view.d.ts.map +1 -0
  1934. package/dist/modes/interactive/components/usage-view.js +140 -0
  1935. package/dist/modes/interactive/components/usage-view.js.map +1 -0
  1936. package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
  1937. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
  1938. package/dist/modes/interactive/components/user-message-selector.js +114 -0
  1939. package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
  1940. package/dist/modes/interactive/components/user-message.d.ts +17 -0
  1941. package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
  1942. package/dist/modes/interactive/components/user-message.js +63 -0
  1943. package/dist/modes/interactive/components/user-message.js.map +1 -0
  1944. package/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
  1945. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
  1946. package/dist/modes/interactive/components/visual-truncate.js +33 -0
  1947. package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
  1948. package/dist/modes/interactive/interactive-mode.d.ts +508 -0
  1949. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
  1950. package/dist/modes/interactive/interactive-mode.js +6867 -0
  1951. package/dist/modes/interactive/interactive-mode.js.map +1 -0
  1952. package/dist/modes/interactive/model-search.d.ts +12 -0
  1953. package/dist/modes/interactive/model-search.d.ts.map +1 -0
  1954. package/dist/modes/interactive/model-search.js +15 -0
  1955. package/dist/modes/interactive/model-search.js.map +1 -0
  1956. package/dist/modes/interactive/skill-tag-autocomplete.d.ts +13 -0
  1957. package/dist/modes/interactive/skill-tag-autocomplete.d.ts.map +1 -0
  1958. package/dist/modes/interactive/skill-tag-autocomplete.js +72 -0
  1959. package/dist/modes/interactive/skill-tag-autocomplete.js.map +1 -0
  1960. package/dist/modes/interactive/smooth-streaming.d.ts +43 -0
  1961. package/dist/modes/interactive/smooth-streaming.d.ts.map +1 -0
  1962. package/dist/modes/interactive/smooth-streaming.js +182 -0
  1963. package/dist/modes/interactive/smooth-streaming.js.map +1 -0
  1964. package/dist/modes/interactive/theme/moon.json +83 -0
  1965. package/dist/modes/interactive/theme/theme-controller.d.ts +29 -0
  1966. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
  1967. package/dist/modes/interactive/theme/theme-controller.js +97 -0
  1968. package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
  1969. package/dist/modes/interactive/theme/theme-schema.json +363 -0
  1970. package/dist/modes/interactive/theme/theme.d.ts +128 -0
  1971. package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
  1972. package/dist/modes/interactive/theme/theme.js +1092 -0
  1973. package/dist/modes/interactive/theme/theme.js.map +1 -0
  1974. package/dist/modes/print-mode.d.ts +28 -0
  1975. package/dist/modes/print-mode.d.ts.map +1 -0
  1976. package/dist/modes/print-mode.js +132 -0
  1977. package/dist/modes/print-mode.js.map +1 -0
  1978. package/dist/modes/rpc/jsonl.d.ts +17 -0
  1979. package/dist/modes/rpc/jsonl.d.ts.map +1 -0
  1980. package/dist/modes/rpc/jsonl.js +49 -0
  1981. package/dist/modes/rpc/jsonl.js.map +1 -0
  1982. package/dist/modes/rpc/rpc-client.d.ts +242 -0
  1983. package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
  1984. package/dist/modes/rpc/rpc-client.js +481 -0
  1985. package/dist/modes/rpc/rpc-client.js.map +1 -0
  1986. package/dist/modes/rpc/rpc-mode.d.ts +20 -0
  1987. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
  1988. package/dist/modes/rpc/rpc-mode.js +635 -0
  1989. package/dist/modes/rpc/rpc-mode.js.map +1 -0
  1990. package/dist/modes/rpc/rpc-types.d.ts +446 -0
  1991. package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
  1992. package/dist/modes/rpc/rpc-types.js +8 -0
  1993. package/dist/modes/rpc/rpc-types.js.map +1 -0
  1994. package/dist/package-manager-cli.d.ts +8 -0
  1995. package/dist/package-manager-cli.d.ts.map +1 -0
  1996. package/dist/package-manager-cli.js +378 -0
  1997. package/dist/package-manager-cli.js.map +1 -0
  1998. package/dist/rpc-entry.d.ts +3 -0
  1999. package/dist/rpc-entry.d.ts.map +1 -0
  2000. package/dist/rpc-entry.js +10 -0
  2001. package/dist/rpc-entry.js.map +1 -0
  2002. package/dist/startup/interactive-shell.d.ts +55 -0
  2003. package/dist/startup/interactive-shell.d.ts.map +1 -0
  2004. package/dist/startup/interactive-shell.js +263 -0
  2005. package/dist/startup/interactive-shell.js.map +1 -0
  2006. package/dist/startup/launch-routing.d.ts +8 -0
  2007. package/dist/startup/launch-routing.d.ts.map +1 -0
  2008. package/dist/startup/launch-routing.js +30 -0
  2009. package/dist/startup/launch-routing.js.map +1 -0
  2010. package/dist/startup/startup-milestones.d.ts +4 -0
  2011. package/dist/startup/startup-milestones.d.ts.map +1 -0
  2012. package/dist/startup/startup-milestones.js +13 -0
  2013. package/dist/startup/startup-milestones.js.map +1 -0
  2014. package/dist/utils/ansi.d.ts +2 -0
  2015. package/dist/utils/ansi.d.ts.map +1 -0
  2016. package/dist/utils/ansi.js +52 -0
  2017. package/dist/utils/ansi.js.map +1 -0
  2018. package/dist/utils/child-process.d.ts +18 -0
  2019. package/dist/utils/child-process.d.ts.map +1 -0
  2020. package/dist/utils/child-process.js +106 -0
  2021. package/dist/utils/child-process.js.map +1 -0
  2022. package/dist/utils/clipboard-image.d.ts +11 -0
  2023. package/dist/utils/clipboard-image.d.ts.map +1 -0
  2024. package/dist/utils/clipboard-image.js +304 -0
  2025. package/dist/utils/clipboard-image.js.map +1 -0
  2026. package/dist/utils/clipboard-native.d.ts +11 -0
  2027. package/dist/utils/clipboard-native.d.ts.map +1 -0
  2028. package/dist/utils/clipboard-native.js +20 -0
  2029. package/dist/utils/clipboard-native.js.map +1 -0
  2030. package/dist/utils/clipboard.d.ts +4 -0
  2031. package/dist/utils/clipboard.d.ts.map +1 -0
  2032. package/dist/utils/clipboard.js +130 -0
  2033. package/dist/utils/clipboard.js.map +1 -0
  2034. package/dist/utils/deprecation.d.ts +4 -0
  2035. package/dist/utils/deprecation.d.ts.map +1 -0
  2036. package/dist/utils/deprecation.js +13 -0
  2037. package/dist/utils/deprecation.js.map +1 -0
  2038. package/dist/utils/exif-orientation.d.ts +5 -0
  2039. package/dist/utils/exif-orientation.d.ts.map +1 -0
  2040. package/dist/utils/exif-orientation.js +158 -0
  2041. package/dist/utils/exif-orientation.js.map +1 -0
  2042. package/dist/utils/frontmatter.d.ts +8 -0
  2043. package/dist/utils/frontmatter.d.ts.map +1 -0
  2044. package/dist/utils/frontmatter.js +26 -0
  2045. package/dist/utils/frontmatter.js.map +1 -0
  2046. package/dist/utils/fs-watch.d.ts +5 -0
  2047. package/dist/utils/fs-watch.d.ts.map +1 -0
  2048. package/dist/utils/fs-watch.js +25 -0
  2049. package/dist/utils/fs-watch.js.map +1 -0
  2050. package/dist/utils/git.d.ts +26 -0
  2051. package/dist/utils/git.d.ts.map +1 -0
  2052. package/dist/utils/git.js +195 -0
  2053. package/dist/utils/git.js.map +1 -0
  2054. package/dist/utils/html.d.ts +7 -0
  2055. package/dist/utils/html.d.ts.map +1 -0
  2056. package/dist/utils/html.js +40 -0
  2057. package/dist/utils/html.js.map +1 -0
  2058. package/dist/utils/image-convert.d.ts +10 -0
  2059. package/dist/utils/image-convert.d.ts.map +1 -0
  2060. package/dist/utils/image-convert.js +45 -0
  2061. package/dist/utils/image-convert.js.map +1 -0
  2062. package/dist/utils/image-process.d.ts +18 -0
  2063. package/dist/utils/image-process.d.ts.map +1 -0
  2064. package/dist/utils/image-process.js +83 -0
  2065. package/dist/utils/image-process.js.map +1 -0
  2066. package/dist/utils/image-resize-core.d.ts +30 -0
  2067. package/dist/utils/image-resize-core.d.ts.map +1 -0
  2068. package/dist/utils/image-resize-core.js +124 -0
  2069. package/dist/utils/image-resize-core.js.map +1 -0
  2070. package/dist/utils/image-resize-worker.d.ts +2 -0
  2071. package/dist/utils/image-resize-worker.d.ts.map +1 -0
  2072. package/dist/utils/image-resize-worker.js +31 -0
  2073. package/dist/utils/image-resize-worker.js.map +1 -0
  2074. package/dist/utils/image-resize.d.ts +16 -0
  2075. package/dist/utils/image-resize.d.ts.map +1 -0
  2076. package/dist/utils/image-resize.js +97 -0
  2077. package/dist/utils/image-resize.js.map +1 -0
  2078. package/dist/utils/json.d.ts +3 -0
  2079. package/dist/utils/json.d.ts.map +1 -0
  2080. package/dist/utils/json.js +7 -0
  2081. package/dist/utils/json.js.map +1 -0
  2082. package/dist/utils/mime.d.ts +3 -0
  2083. package/dist/utils/mime.d.ts.map +1 -0
  2084. package/dist/utils/mime.js +110 -0
  2085. package/dist/utils/mime.js.map +1 -0
  2086. package/dist/utils/open-browser.d.ts +9 -0
  2087. package/dist/utils/open-browser.d.ts.map +1 -0
  2088. package/dist/utils/open-browser.js +22 -0
  2089. package/dist/utils/open-browser.js.map +1 -0
  2090. package/dist/utils/paths.d.ts +31 -0
  2091. package/dist/utils/paths.d.ts.map +1 -0
  2092. package/dist/utils/paths.js +92 -0
  2093. package/dist/utils/paths.js.map +1 -0
  2094. package/dist/utils/photon.d.ts +21 -0
  2095. package/dist/utils/photon.d.ts.map +1 -0
  2096. package/dist/utils/photon.js +121 -0
  2097. package/dist/utils/photon.js.map +1 -0
  2098. package/dist/utils/pi-user-agent.d.ts +2 -0
  2099. package/dist/utils/pi-user-agent.d.ts.map +1 -0
  2100. package/dist/utils/pi-user-agent.js +5 -0
  2101. package/dist/utils/pi-user-agent.js.map +1 -0
  2102. package/dist/utils/shell.d.ts +31 -0
  2103. package/dist/utils/shell.d.ts.map +1 -0
  2104. package/dist/utils/shell.js +202 -0
  2105. package/dist/utils/shell.js.map +1 -0
  2106. package/dist/utils/sleep.d.ts +5 -0
  2107. package/dist/utils/sleep.d.ts.map +1 -0
  2108. package/dist/utils/sleep.js +17 -0
  2109. package/dist/utils/sleep.js.map +1 -0
  2110. package/dist/utils/syntax-highlight.d.ts +12 -0
  2111. package/dist/utils/syntax-highlight.d.ts.map +1 -0
  2112. package/dist/utils/syntax-highlight.js +118 -0
  2113. package/dist/utils/syntax-highlight.js.map +1 -0
  2114. package/dist/utils/tools-manager.d.ts +3 -0
  2115. package/dist/utils/tools-manager.d.ts.map +1 -0
  2116. package/dist/utils/tools-manager.js +328 -0
  2117. package/dist/utils/tools-manager.js.map +1 -0
  2118. package/docs/compaction.md +396 -0
  2119. package/docs/containerization.md +111 -0
  2120. package/docs/custom-provider.md +735 -0
  2121. package/docs/development.md +104 -0
  2122. package/docs/docs.json +160 -0
  2123. package/docs/extensions.md +2913 -0
  2124. package/docs/features.md +102 -0
  2125. package/docs/images/doom-extension.png +0 -0
  2126. package/docs/images/exy.png +0 -0
  2127. package/docs/images/interactive-mode.png +0 -0
  2128. package/docs/images/tree-view.png +0 -0
  2129. package/docs/index.md +88 -0
  2130. package/docs/json.md +82 -0
  2131. package/docs/keybindings.md +202 -0
  2132. package/docs/models.md +540 -0
  2133. package/docs/packages.md +224 -0
  2134. package/docs/prompt-templates.md +95 -0
  2135. package/docs/providers.md +308 -0
  2136. package/docs/quickstart.md +200 -0
  2137. package/docs/rpc.md +1474 -0
  2138. package/docs/sdk.md +1185 -0
  2139. package/docs/security.md +59 -0
  2140. package/docs/session-format.md +422 -0
  2141. package/docs/sessions.md +146 -0
  2142. package/docs/settings.md +341 -0
  2143. package/docs/shell-aliases.md +13 -0
  2144. package/docs/skills.md +241 -0
  2145. package/docs/terminal-setup.md +155 -0
  2146. package/docs/termux.md +127 -0
  2147. package/docs/themes.md +295 -0
  2148. package/docs/tmux.md +63 -0
  2149. package/docs/tui.md +927 -0
  2150. package/docs/usage.md +337 -0
  2151. package/docs/windows.md +25 -0
  2152. package/examples/README.md +27 -0
  2153. package/examples/extensions/README.md +213 -0
  2154. package/examples/extensions/auto-commit-on-exit.ts +49 -0
  2155. package/examples/extensions/bash-spawn-hook.ts +30 -0
  2156. package/examples/extensions/bookmark.ts +50 -0
  2157. package/examples/extensions/border-status-editor.ts +150 -0
  2158. package/examples/extensions/built-in-tool-renderer.ts +249 -0
  2159. package/examples/extensions/claude-rules.ts +86 -0
  2160. package/examples/extensions/commands.ts +72 -0
  2161. package/examples/extensions/confirm-destructive.ts +59 -0
  2162. package/examples/extensions/custom-compaction.ts +128 -0
  2163. package/examples/extensions/custom-footer.ts +64 -0
  2164. package/examples/extensions/custom-header.ts +73 -0
  2165. package/examples/extensions/custom-provider-anthropic/index.ts +604 -0
  2166. package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
  2167. package/examples/extensions/custom-provider-anthropic/package.json +19 -0
  2168. package/examples/extensions/custom-provider-gitlab-duo/index.ts +404 -0
  2169. package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
  2170. package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
  2171. package/examples/extensions/dirty-repo-guard.ts +56 -0
  2172. package/examples/extensions/doom-overlay/README.md +46 -0
  2173. package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
  2174. package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
  2175. package/examples/extensions/doom-overlay/doom/build.sh +152 -0
  2176. package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
  2177. package/examples/extensions/doom-overlay/doom-component.ts +132 -0
  2178. package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
  2179. package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
  2180. package/examples/extensions/doom-overlay/index.ts +74 -0
  2181. package/examples/extensions/doom-overlay/wad-finder.ts +51 -0
  2182. package/examples/extensions/dynamic-resources/SKILL.md +8 -0
  2183. package/examples/extensions/dynamic-resources/dynamic.json +79 -0
  2184. package/examples/extensions/dynamic-resources/dynamic.md +5 -0
  2185. package/examples/extensions/dynamic-resources/index.ts +15 -0
  2186. package/examples/extensions/dynamic-tools.ts +74 -0
  2187. package/examples/extensions/entry-renderer.ts +41 -0
  2188. package/examples/extensions/event-bus.ts +43 -0
  2189. package/examples/extensions/file-trigger.ts +41 -0
  2190. package/examples/extensions/git-checkpoint.ts +53 -0
  2191. package/examples/extensions/git-merge-and-resolve.ts +115 -0
  2192. package/examples/extensions/github-issue-autocomplete.ts +185 -0
  2193. package/examples/extensions/gondolin/index.ts +531 -0
  2194. package/examples/extensions/gondolin/package-lock.json +185 -0
  2195. package/examples/extensions/gondolin/package.json +19 -0
  2196. package/examples/extensions/handoff.ts +191 -0
  2197. package/examples/extensions/hello.ts +26 -0
  2198. package/examples/extensions/hidden-thinking-label.ts +53 -0
  2199. package/examples/extensions/inline-bash.ts +94 -0
  2200. package/examples/extensions/input-transform-streaming.ts +39 -0
  2201. package/examples/extensions/input-transform.ts +43 -0
  2202. package/examples/extensions/interactive-shell.ts +196 -0
  2203. package/examples/extensions/kimi-deferred-tools.ts +61 -0
  2204. package/examples/extensions/mac-system-theme.ts +47 -0
  2205. package/examples/extensions/message-renderer.ts +59 -0
  2206. package/examples/extensions/minimal-mode.ts +426 -0
  2207. package/examples/extensions/modal-editor.ts +85 -0
  2208. package/examples/extensions/model-status.ts +31 -0
  2209. package/examples/extensions/notify.ts +55 -0
  2210. package/examples/extensions/overlay-qa-tests.ts +1450 -0
  2211. package/examples/extensions/overlay-test.ts +153 -0
  2212. package/examples/extensions/permission-gate.ts +34 -0
  2213. package/examples/extensions/pirate.ts +47 -0
  2214. package/examples/extensions/plan-mode/README.md +68 -0
  2215. package/examples/extensions/plan-mode/index.ts +390 -0
  2216. package/examples/extensions/plan-mode/utils.ts +168 -0
  2217. package/examples/extensions/preset.ts +436 -0
  2218. package/examples/extensions/project-trust.ts +64 -0
  2219. package/examples/extensions/prompt-customizer.ts +97 -0
  2220. package/examples/extensions/protected-paths.ts +30 -0
  2221. package/examples/extensions/provider-payload.ts +18 -0
  2222. package/examples/extensions/qna.ts +122 -0
  2223. package/examples/extensions/question.ts +286 -0
  2224. package/examples/extensions/questionnaire.ts +448 -0
  2225. package/examples/extensions/rainbow-editor.ts +88 -0
  2226. package/examples/extensions/reload-runtime.ts +37 -0
  2227. package/examples/extensions/rpc-demo.ts +118 -0
  2228. package/examples/extensions/sandbox/index.ts +321 -0
  2229. package/examples/extensions/sandbox/package-lock.json +92 -0
  2230. package/examples/extensions/sandbox/package.json +19 -0
  2231. package/examples/extensions/send-user-message.ts +97 -0
  2232. package/examples/extensions/session-name.ts +27 -0
  2233. package/examples/extensions/shutdown-command.ts +63 -0
  2234. package/examples/extensions/snake.ts +343 -0
  2235. package/examples/extensions/space-invaders.ts +560 -0
  2236. package/examples/extensions/ssh.ts +220 -0
  2237. package/examples/extensions/status-line.ts +32 -0
  2238. package/examples/extensions/structured-output.ts +65 -0
  2239. package/examples/extensions/subagent/README.md +177 -0
  2240. package/examples/extensions/subagent/agents/planner.md +37 -0
  2241. package/examples/extensions/subagent/agents/reviewer.md +35 -0
  2242. package/examples/extensions/subagent/agents/scout.md +50 -0
  2243. package/examples/extensions/subagent/agents/worker.md +24 -0
  2244. package/examples/extensions/subagent/agents.ts +126 -0
  2245. package/examples/extensions/subagent/index.ts +1015 -0
  2246. package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
  2247. package/examples/extensions/subagent/prompts/implement.md +10 -0
  2248. package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
  2249. package/examples/extensions/summarize.ts +207 -0
  2250. package/examples/extensions/system-prompt-header.ts +17 -0
  2251. package/examples/extensions/tic-tac-toe.ts +1008 -0
  2252. package/examples/extensions/timed-confirm.ts +70 -0
  2253. package/examples/extensions/titlebar-spinner.ts +58 -0
  2254. package/examples/extensions/todo.ts +298 -0
  2255. package/examples/extensions/tool-override.ts +144 -0
  2256. package/examples/extensions/tools.ts +146 -0
  2257. package/examples/extensions/trigger-compact.ts +50 -0
  2258. package/examples/extensions/truncated-tool.ts +195 -0
  2259. package/examples/extensions/widget-placement.ts +9 -0
  2260. package/examples/extensions/with-deps/index.ts +32 -0
  2261. package/examples/extensions/with-deps/package-lock.json +31 -0
  2262. package/examples/extensions/with-deps/package.json +22 -0
  2263. package/examples/extensions/working-indicator.ts +123 -0
  2264. package/examples/extensions/working-message-test.ts +25 -0
  2265. package/examples/rpc-extension-ui.ts +632 -0
  2266. package/examples/sdk/01-minimal.ts +26 -0
  2267. package/examples/sdk/02-custom-model.ts +50 -0
  2268. package/examples/sdk/03-custom-prompt.ts +75 -0
  2269. package/examples/sdk/04-skills.ts +55 -0
  2270. package/examples/sdk/05-tools.ts +48 -0
  2271. package/examples/sdk/06-extensions.ts +99 -0
  2272. package/examples/sdk/07-context-files.ts +47 -0
  2273. package/examples/sdk/08-prompt-templates.ts +51 -0
  2274. package/examples/sdk/09-api-keys-and-oauth.ts +34 -0
  2275. package/examples/sdk/10-settings.ts +53 -0
  2276. package/examples/sdk/11-sessions.ts +52 -0
  2277. package/examples/sdk/12-full-control.ts +72 -0
  2278. package/examples/sdk/13-session-runtime.ts +67 -0
  2279. package/examples/sdk/README.md +144 -0
  2280. package/package.json +115 -0
@@ -0,0 +1,2913 @@
1
+ > lunR can create extensions. Ask it to build one for your use case.
2
+
3
+ # Extensions
4
+
5
+ Extensions are TypeScript modules that extend lunR's behavior. They can subscribe to lifecycle events, register custom tools callable by the LLM, add commands, and more.
6
+
7
+ > **Placement for /reload:** Put extensions in `~/.lunr/agent/extensions/` (global) or `.lunr/extensions/` (project-local) for auto-discovery. Use `lunr -e ./path.ts` only for quick tests. Extensions in auto-discovered locations can be hot-reloaded with `/reload`.
8
+
9
+ **Key capabilities:**
10
+ - **Custom tools** - Register tools the LLM can call via `pi.registerTool()`
11
+ - **Event interception** - Block or modify tool calls, inject context, customize compaction
12
+ - **User interaction** - Prompt users via `ctx.ui` (select, confirm, input, notify)
13
+ - **Custom UI components** - Full TUI components with keyboard input via `ctx.ui.custom()` for complex interactions
14
+ - **Custom commands** - Register commands like `/mycommand` via `pi.registerCommand()`
15
+ - **Session persistence** - Store state that survives restarts via `pi.appendEntry()`
16
+ - **Custom rendering** - Control how tool calls/results and messages appear in TUI
17
+
18
+ **Example use cases:**
19
+ - Permission gates (confirm before `rm -rf`, `sudo`, etc.)
20
+ - Git checkpointing (stash at each turn, restore on branch)
21
+ - Path protection (block writes to `.env`, `node_modules/`)
22
+ - Custom compaction (summarize conversation your way)
23
+ - Conversation summaries (see `summarize.ts` example)
24
+ - Interactive tools (questions, wizards, custom dialogs)
25
+ - Stateful tools (todo lists, connection pools)
26
+ - External integrations (file watchers, webhooks, CI triggers)
27
+ - Games while you wait (see `snake.ts` example)
28
+
29
+ See [examples/extensions/](../examples/extensions/) for working implementations.
30
+
31
+ ## Table of Contents
32
+
33
+ - [Quick Start](#quick-start)
34
+ - [Extension Locations](#extension-locations)
35
+ - [Available Imports](#available-imports)
36
+ - [Writing an Extension](#writing-an-extension)
37
+ - [Extension Styles](#extension-styles)
38
+ - [Events](#events)
39
+ - [Lifecycle Overview](#lifecycle-overview)
40
+ - [Resource Events](#resource-events)
41
+ - [Session Events](#session-events)
42
+ - [Agent Events](#agent-events)
43
+ - [Model Events](#model-events)
44
+ - [Tool Events](#tool-events)
45
+ - [ExtensionContext](#extensioncontext)
46
+ - [ExtensionCommandContext](#extensioncommandcontext)
47
+ - [ExtensionAPI Methods](#extensionapi-methods)
48
+ - [State Management](#state-management)
49
+ - [Custom Tools](#custom-tools)
50
+ - [Dynamic Tool Loading](#dynamic-tool-loading)
51
+ - [Custom UI](#custom-ui)
52
+ - [Error Handling](#error-handling)
53
+ - [Mode Behavior](#mode-behavior)
54
+ - [Examples Reference](#examples-reference)
55
+
56
+ ## Quick Start
57
+
58
+ Create `~/.lunr/agent/extensions/my-extension.ts`:
59
+
60
+ ```typescript
61
+ import type { ExtensionAPI } from "@ashx-j/lunr";
62
+ import { Type } from "typebox";
63
+
64
+ export default function (pi: ExtensionAPI) {
65
+ // React to events
66
+ pi.on("session_start", async (_event, ctx) => {
67
+ ctx.ui.notify("Extension loaded!", "info");
68
+ });
69
+
70
+ pi.on("tool_call", async (event, ctx) => {
71
+ if (event.toolName === "bash" && event.input.command?.includes("rm -rf")) {
72
+ const ok = await ctx.ui.confirm("Dangerous!", "Allow rm -rf?");
73
+ if (!ok) return { block: true, reason: "Blocked by user" };
74
+ }
75
+ });
76
+
77
+ // Register a custom tool
78
+ pi.registerTool({
79
+ name: "greet",
80
+ label: "Greet",
81
+ description: "Greet someone by name",
82
+ parameters: Type.Object({
83
+ name: Type.String({ description: "Name to greet" }),
84
+ }),
85
+ async execute(toolCallId, params, signal, onUpdate, ctx) {
86
+ return {
87
+ content: [{ type: "text", text: `Hello, ${params.name}!` }],
88
+ details: {},
89
+ };
90
+ },
91
+ });
92
+
93
+ // Register a command
94
+ pi.registerCommand("hello", {
95
+ description: "Say hello",
96
+ handler: async (args, ctx) => {
97
+ ctx.ui.notify(`Hello ${args || "world"}!`, "info");
98
+ },
99
+ });
100
+ }
101
+ ```
102
+
103
+ Test with `--extension` (or `-e`) flag:
104
+
105
+ ```bash
106
+ lunr -e ./my-extension.ts
107
+ ```
108
+
109
+ ## Extension Locations
110
+
111
+ > **Security:** Extensions run with your full system permissions and can execute arbitrary code. Only install from sources you trust.
112
+
113
+ Extensions are auto-discovered from trusted locations. Project-local `.lunr/extensions` entries load only after the project is trusted.
114
+
115
+ | Location | Scope |
116
+ |----------|-------|
117
+ | `~/.lunr/agent/extensions/*.ts` | Global (all projects) |
118
+ | `~/.lunr/agent/extensions/*/index.ts` | Global (subdirectory) |
119
+ | `.lunr/extensions/*.ts` | Project-local |
120
+ | `.lunr/extensions/*/index.ts` | Project-local (subdirectory) |
121
+
122
+ Additional paths via `settings.json`:
123
+
124
+ ```json
125
+ {
126
+ "packages": [
127
+ "npm:@foo/bar@1.0.0",
128
+ "git:github.com/user/repo@v1"
129
+ ],
130
+ "extensions": [
131
+ "/path/to/local/extension.ts",
132
+ "/path/to/local/extension/dir"
133
+ ]
134
+ }
135
+ ```
136
+
137
+ To share extensions via npm or git as packages, see [packages.md](packages.md).
138
+
139
+ ## Available Imports
140
+
141
+ | Package | Purpose |
142
+ |---------|---------|
143
+ | `@ashx-j/lunr` | Extension types (`ExtensionAPI`, `ExtensionContext`, events) |
144
+ | `typebox` | Schema definitions for tool parameters |
145
+ | `@ashx-j/lunr-ai` | AI utilities (`StringEnum` for Google-compatible enums) |
146
+ | `@ashx-j/lunr-tui` | TUI components for custom rendering |
147
+
148
+ The factory argument is conventionally named `pi` (`export default function (pi: ExtensionAPI)`). Keep that. The jiti loader aliases both published names (`@ashx-j/lunr`, `@ashx-j/lunr-ai`, `@ashx-j/lunr-tui`, `@ashx-j/lunr-agent`) and workspace names (`@earendil-works/pi-coding-agent`, `@earendil-works/pi-ai`, `@earendil-works/pi-tui`, `@earendil-works/pi-agent-core`).
149
+
150
+ npm dependencies work too. Add a `package.json` next to your extension (or in a parent directory), run `npm install`, and imports from `node_modules/` are resolved automatically.
151
+
152
+ For distributed packages installed with `lunr install` (npm or git), runtime deps must be in `dependencies`. Package installation uses production installs (`npm install --omit=dev`) by default, so `devDependencies` are not available at runtime; when `npmCommand` is configured, git packages use plain `install` for compatibility with wrappers.
153
+
154
+ Node.js built-ins (`node:fs`, `node:path`, etc.) are also available.
155
+
156
+ ## Writing an Extension
157
+
158
+ An extension exports a default factory function that receives `ExtensionAPI`. The factory can be synchronous or asynchronous:
159
+
160
+ ```typescript
161
+ import type { ExtensionAPI } from "@ashx-j/lunr";
162
+
163
+ export default function (pi: ExtensionAPI) {
164
+ // Subscribe to events
165
+ pi.on("event_name", async (event, ctx) => {
166
+ // ctx.ui for user interaction
167
+ const ok = await ctx.ui.confirm("Title", "Are you sure?");
168
+ ctx.ui.notify("Done!", "info");
169
+ ctx.ui.setStatus("my-ext", "Processing..."); // Footer status
170
+ ctx.ui.setWidget("my-ext", ["Line 1", "Line 2"]); // Widget above editor (default)
171
+ });
172
+
173
+ // Register tools, commands, shortcuts, flags
174
+ pi.registerTool({ ... });
175
+ pi.registerCommand("name", { ... });
176
+ pi.registerShortcut("ctrl+x", { ... });
177
+ pi.registerFlag("my-flag", { ... });
178
+ }
179
+ ```
180
+
181
+ Extensions are loaded via [jiti](https://github.com/unjs/jiti), so TypeScript works without compilation.
182
+
183
+ If the factory returns a `Promise`, pi awaits it before continuing startup. That means async initialization completes before `session_start`, before `resources_discover`, and before provider registrations queued via `pi.registerProvider()` are flushed.
184
+
185
+ ### Async factory functions
186
+
187
+ Use an async factory for one-time startup work such as fetching remote configuration or dynamically discovering available models.
188
+
189
+ ```typescript
190
+ import type { ExtensionAPI } from "@ashx-j/lunr";
191
+
192
+ export default async function (pi: ExtensionAPI) {
193
+ const response = await fetch("http://localhost:1234/v1/models");
194
+ const payload = (await response.json()) as {
195
+ data: Array<{
196
+ id: string;
197
+ name?: string;
198
+ context_window?: number;
199
+ max_tokens?: number;
200
+ }>;
201
+ };
202
+
203
+ pi.registerProvider("local-openai", {
204
+ baseUrl: "http://localhost:1234/v1",
205
+ apiKey: "$LOCAL_OPENAI_API_KEY",
206
+ api: "openai-completions",
207
+ models: payload.data.map((model) => ({
208
+ id: model.id,
209
+ name: model.name ?? model.id,
210
+ reasoning: false,
211
+ input: ["text"],
212
+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
213
+ contextWindow: model.context_window ?? 128000,
214
+ maxTokens: model.max_tokens ?? 4096,
215
+ })),
216
+ });
217
+ }
218
+ ```
219
+
220
+ This pattern makes the fetched models available during normal startup and to `lunr --list-models`.
221
+
222
+ ### Long-lived resources and shutdown
223
+
224
+ Extension factories may run in invocations that never start a session. Do not start background resources such as processes, sockets, file watchers, or timers from the factory.
225
+
226
+ Defer background resource startup until `session_start` or the command/tool/event that needs the resource. Register an idempotent `session_shutdown` handler to close any session-scoped resources you start.
227
+
228
+ ### Extension Styles
229
+
230
+ **Single file** - simplest, for small extensions:
231
+
232
+ ```
233
+ ~/.lunr/agent/extensions/
234
+ └── my-extension.ts
235
+ ```
236
+
237
+ **Directory with index.ts** - for multi-file extensions:
238
+
239
+ ```
240
+ ~/.lunr/agent/extensions/
241
+ └── my-extension/
242
+ ├── index.ts # Entry point (exports default function)
243
+ ├── tools.ts # Helper module
244
+ └── utils.ts # Helper module
245
+ ```
246
+
247
+ **Package with dependencies** - for extensions that need npm packages:
248
+
249
+ ```
250
+ ~/.lunr/agent/extensions/
251
+ └── my-extension/
252
+ ├── package.json # Declares dependencies and entry points
253
+ ├── package-lock.json
254
+ ├── node_modules/ # After npm install
255
+ └── src/
256
+ └── index.ts
257
+ ```
258
+
259
+ ```json
260
+ // package.json
261
+ {
262
+ "name": "my-extension",
263
+ "dependencies": {
264
+ "zod": "^3.0.0",
265
+ "chalk": "^5.0.0"
266
+ },
267
+ "pi": {
268
+ "extensions": ["./src/index.ts"]
269
+ }
270
+ }
271
+ ```
272
+
273
+ Run `npm install` in the extension directory, then imports from `node_modules/` work automatically.
274
+
275
+ ## Events
276
+
277
+ ### Lifecycle Overview
278
+
279
+ ```
280
+ lunR starts
281
+
282
+ ├─► project_trust (user/global and CLI extensions only, before project resources load)
283
+ ├─► session_start { reason: "startup" }
284
+ └─► resources_discover { reason: "startup" }
285
+
286
+
287
+ user sends prompt ─────────────────────────────────────────┐
288
+ │ │
289
+ ├─► (extension commands checked first, bypass if found) │
290
+ ├─► input (can intercept, transform, or handle) │
291
+ ├─► (skill/template expansion if not handled) │
292
+ ├─► before_agent_start (can inject message, modify system prompt)
293
+ ├─► agent_start │
294
+ ├─► message_start / message_update / message_end │
295
+ │ │
296
+ │ ┌─── turn (repeats while LLM calls tools) ───┐ │
297
+ │ │ │ │
298
+ │ ├─► turn_start │ │
299
+ │ ├─► context (can modify messages) │ │
300
+ │ ├─► before_provider_headers (can mutate headers) |
301
+ │ ├─► before_provider_request (can inspect or replace payload)
302
+ │ ├─► after_provider_response (status + headers, before stream consume)
303
+ │ │ │ │
304
+ │ │ LLM responds, may call tools: │ │
305
+ │ │ ├─► tool_execution_start │ │
306
+ │ │ ├─► tool_call (can block) │ │
307
+ │ │ ├─► tool_execution_update │ │
308
+ │ │ ├─► tool_result (can modify) │ │
309
+ │ │ └─► tool_execution_end │ │
310
+ │ │ │ │
311
+ │ └─► turn_end │ │
312
+ │ │
313
+ ├─► agent_end │
314
+ └─► agent_settled (no retry/compaction/follow-up left) │
315
+
316
+ user sends another prompt ◄────────────────────────────────┘
317
+
318
+ /new (new session) or /resume (switch session)
319
+ ├─► session_before_switch (can cancel)
320
+ ├─► session_shutdown
321
+ ├─► session_start { reason: "new" | "resume", previousSessionFile? }
322
+ └─► resources_discover { reason: "startup" }
323
+
324
+ /fork or /clone
325
+ ├─► session_before_fork (can cancel)
326
+ ├─► session_shutdown
327
+ ├─► session_start { reason: "fork", previousSessionFile }
328
+ └─► resources_discover { reason: "startup" }
329
+
330
+ /name or pi.setSessionName()
331
+ └─► session_info_changed
332
+
333
+ /compact or auto-compaction
334
+ ├─► session_before_compact (can cancel or customize)
335
+ └─► session_compact
336
+
337
+ /tree navigation
338
+ ├─► session_before_tree (can cancel or customize)
339
+ └─► session_tree
340
+
341
+ /model or Ctrl+P (model selection/cycling)
342
+ ├─► thinking_level_select (if model change changes/clamps thinking level)
343
+ └─► model_select
344
+
345
+ thinking level changes (settings, keybinding, pi.setThinkingLevel())
346
+ └─► thinking_level_select
347
+
348
+ exit (Ctrl+C, Ctrl+D, SIGHUP, SIGTERM)
349
+ └─► session_shutdown
350
+ ```
351
+
352
+ ### Startup Events
353
+
354
+ #### project_trust
355
+
356
+ Fired before lunR decides whether to trust a project with dynamic configs (`.lunr` or `.agents/skills`). It runs during startup and when session replacement (for example `/resume`) enters a cwd whose trust has not been resolved in the current process. Only user/global extensions and CLI `-e` extensions participate; project-local extensions are not loaded until after trust is resolved.
357
+
358
+ ```typescript
359
+ pi.on("project_trust", async (event, ctx) => {
360
+ // event.cwd - current working directory
361
+ // ctx has a limited trust context: cwd, mode, hasUI, and select/confirm/input/notify UI helpers
362
+ if (await ctx.ui.confirm("Trust project?", event.cwd)) {
363
+ return { trusted: "yes", remember: true };
364
+ }
365
+ return { trusted: "undecided" };
366
+ });
367
+ ```
368
+
369
+ A `project_trust` handler must return `{ trusted: "yes" | "no" | "undecided" }`. A user/global or CLI extension that returns `"yes"` or `"no"` owns the decision; the first yes/no decision wins and suppresses the built-in trust prompt. Use `remember: true` to persist a yes/no decision; otherwise it applies only to the current process. Return `"undecided"` to let later handlers or the built-in trust flow decide. Check `ctx.hasUI` before prompting. If no handler returns yes/no, normal trust resolution continues: saved `trust.json` decisions apply first, then `defaultProjectTrust` controls whether lunR asks, trusts, or declines by default.
370
+
371
+ ### Resource Events
372
+
373
+ #### resources_discover
374
+
375
+ Fired after `session_start` so extensions can contribute additional skill, prompt, and theme paths.
376
+ The startup path uses `reason: "startup"`. Reload uses `reason: "reload"`.
377
+
378
+ ```typescript
379
+ pi.on("resources_discover", async (event, _ctx) => {
380
+ // event.cwd - current working directory
381
+ // event.reason - "startup" | "reload"
382
+ return {
383
+ skillPaths: ["/path/to/skills"],
384
+ promptPaths: ["/path/to/prompts"],
385
+ themePaths: ["/path/to/themes"],
386
+ };
387
+ });
388
+ ```
389
+
390
+ ### Session Events
391
+
392
+ See [Session Format](session-format.md) for session storage internals and the SessionManager API.
393
+
394
+ #### session_start
395
+
396
+ Fired when a session is started, loaded, or reloaded.
397
+
398
+ ```typescript
399
+ pi.on("session_start", async (event, ctx) => {
400
+ // event.reason - "startup" | "reload" | "new" | "resume" | "fork"
401
+ // event.previousSessionFile - present for "new", "resume", and "fork"
402
+ ctx.ui.notify(`Session: ${ctx.sessionManager.getSessionFile() ?? "ephemeral"}`, "info");
403
+ });
404
+ ```
405
+
406
+ #### session_info_changed
407
+
408
+ Fired when the current session display name is set via `/name`, RPC, or `pi.setSessionName()`.
409
+
410
+ ```typescript
411
+ pi.on("session_info_changed", async (event, ctx) => {
412
+ // event.name - current normalized name, or undefined if cleared
413
+ ctx.ui.notify(`Session renamed: ${event.name ?? "(none)"}`, "info");
414
+ });
415
+ ```
416
+
417
+ #### session_before_switch
418
+
419
+ Fired before starting a new session (`/new`) or switching sessions (`/resume`).
420
+
421
+ ```typescript
422
+ pi.on("session_before_switch", async (event, ctx) => {
423
+ // event.reason - "new" or "resume"
424
+ // event.targetSessionFile - session we're switching to (only for "resume")
425
+
426
+ if (event.reason === "new") {
427
+ const ok = await ctx.ui.confirm("Clear?", "Delete all messages?");
428
+ if (!ok) return { cancel: true };
429
+ }
430
+ });
431
+ ```
432
+
433
+ After a successful switch or new-session action, lunR emits `session_shutdown` for the old extension instance, reloads and rebinds extensions for the new session, then emits `session_start` with `reason: "new" | "resume"` and `previousSessionFile`.
434
+ Do cleanup work in `session_shutdown`, then reestablish any in-memory state in `session_start`.
435
+
436
+ #### session_before_fork
437
+
438
+ Fired when forking via `/fork` or cloning via `/clone`.
439
+
440
+ ```typescript
441
+ pi.on("session_before_fork", async (event, ctx) => {
442
+ // event.entryId - ID of the selected entry
443
+ // event.position - "before" for /fork, "at" for /clone
444
+ return { cancel: true }; // Cancel fork/clone
445
+ // OR
446
+ return { skipConversationRestore: true }; // Reserved for future conversation restore control
447
+ });
448
+ ```
449
+
450
+ After a successful fork or clone, lunR emits `session_shutdown` for the old extension instance, reloads and rebinds extensions for the new session, then emits `session_start` with `reason: "fork"` and `previousSessionFile`.
451
+ Do cleanup work in `session_shutdown`, then reestablish any in-memory state in `session_start`.
452
+
453
+ #### session_before_compact / session_compact
454
+
455
+ Fired on compaction. See [compaction.md](compaction.md) for details.
456
+
457
+ ```typescript
458
+ pi.on("session_before_compact", async (event, ctx) => {
459
+ const { preparation, branchEntries, customInstructions, reason, willRetry, signal } = event;
460
+
461
+ // reason - "manual" (/compact), "threshold", or "overflow"
462
+ // willRetry - whether the aborted turn is retried after compaction (overflow recovery)
463
+
464
+ // Cancel:
465
+ return { cancel: true };
466
+
467
+ // Custom summary:
468
+ return {
469
+ compaction: {
470
+ summary: "...",
471
+ firstKeptEntryId: preparation.firstKeptEntryId,
472
+ tokensBefore: preparation.tokensBefore,
473
+ }
474
+ };
475
+ });
476
+
477
+ pi.on("session_compact", async (event, ctx) => {
478
+ // event.compactionEntry - the saved compaction
479
+ // event.fromExtension - whether extension provided it
480
+ // event.reason - "manual" (/compact), "threshold", or "overflow"
481
+ // event.willRetry - whether the aborted turn is retried after compaction (overflow recovery)
482
+ });
483
+ ```
484
+
485
+ #### session_before_tree / session_tree
486
+
487
+ Fired on `/tree` navigation. See [Sessions](sessions.md) for tree navigation concepts.
488
+
489
+ ```typescript
490
+ pi.on("session_before_tree", async (event, ctx) => {
491
+ const { preparation, signal } = event;
492
+ return { cancel: true };
493
+ // OR provide custom summary:
494
+ return { summary: { summary: "...", details: {} } };
495
+ });
496
+
497
+ pi.on("session_tree", async (event, ctx) => {
498
+ // event.newLeafId, oldLeafId, summaryEntry, fromExtension
499
+ });
500
+ ```
501
+
502
+ #### session_shutdown
503
+
504
+ Fired before a started session runtime is torn down. Use this to clean up resources opened from `session_start` or other session-scoped hooks.
505
+
506
+ ```typescript
507
+ pi.on("session_shutdown", async (event, ctx) => {
508
+ // event.reason - "quit" | "reload" | "new" | "resume" | "fork"
509
+ // event.targetSessionFile - destination session for session replacement flows
510
+ // Cleanup, save state, etc.
511
+ });
512
+ ```
513
+
514
+ ### Agent Events
515
+
516
+ #### before_agent_start
517
+
518
+ Fired after user submits prompt, before agent loop. Can inject a message and/or modify the system prompt.
519
+
520
+ ```typescript
521
+ pi.on("before_agent_start", async (event, ctx) => {
522
+ // event.prompt - user's prompt text
523
+ // event.images - attached images (if any)
524
+ // event.systemPrompt - current chained system prompt for this handler
525
+ // (includes changes from earlier before_agent_start handlers)
526
+ // event.systemPromptOptions - structured options used to build the system prompt
527
+ // .customPrompt - any custom system prompt (from --system-prompt, SYSTEM.md, or custom templates)
528
+ // .selectedTools - tools currently active in the prompt
529
+ // .toolSnippets - one-line descriptions for each tool
530
+ // .promptGuidelines - custom guideline bullets
531
+ // .appendSystemPrompt - text from --append-system-prompt flags
532
+ // .cwd - working directory
533
+ // .contextFiles - AGENTS.md files and other loaded context files
534
+ // .skills - loaded skills
535
+
536
+ return {
537
+ // Inject a persistent message (stored in session, sent to LLM)
538
+ message: {
539
+ customType: "my-extension",
540
+ content: "Additional context for the LLM",
541
+ display: true,
542
+ },
543
+ // Replace the system prompt for this turn (chained across extensions)
544
+ systemPrompt: event.systemPrompt + "\n\nExtra instructions for this turn...",
545
+ };
546
+ });
547
+ ```
548
+
549
+ The `systemPromptOptions` field gives extensions access to the same structured data lunR uses to build the system prompt. This lets you inspect what lunR 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.
550
+
551
+ Inside `before_agent_start`, `event.systemPrompt` and `ctx.getSystemPrompt()` both reflect the chained system prompt as of the current handler. Later `before_agent_start` handlers can still modify it again.
552
+
553
+ #### agent_start / agent_end / agent_settled
554
+
555
+ `agent_start` fires when a low-level agent run begins. `agent_end` fires when that run ends, but lunR may still auto-retry, auto-compact and retry, or continue with queued follow-up messages. Use `agent_settled` for status integrations that need to know lunR will not continue running automatically.
556
+
557
+ ```typescript
558
+ pi.on("agent_start", async (_event, ctx) => {});
559
+
560
+ pi.on("agent_end", async (event, ctx) => {
561
+ // event.messages - messages from this low-level run
562
+ });
563
+
564
+ pi.on("agent_settled", async (_event, ctx) => {
565
+ // ctx.isIdle() is true here unless another extension started a new run.
566
+ });
567
+ ```
568
+
569
+ #### turn_start / turn_end
570
+
571
+ Fired for each turn (one LLM response + tool calls).
572
+
573
+ ```typescript
574
+ pi.on("turn_start", async (event, ctx) => {
575
+ // event.turnIndex, event.timestamp
576
+ });
577
+
578
+ pi.on("turn_end", async (event, ctx) => {
579
+ // event.turnIndex, event.message, event.toolResults
580
+ });
581
+ ```
582
+
583
+ #### message_start / message_update / message_end
584
+
585
+ Fired for message lifecycle updates.
586
+
587
+ - `message_start` and `message_end` fire for user, assistant, and toolResult messages.
588
+ - `message_update` fires for assistant streaming updates.
589
+ - `message_end` handlers can return `{ message }` to replace the finalized message. The replacement must keep the same `role`.
590
+
591
+ ```typescript
592
+ pi.on("message_start", async (event, ctx) => {
593
+ // event.message
594
+ });
595
+
596
+ pi.on("message_update", async (event, ctx) => {
597
+ // event.message
598
+ // event.assistantMessageEvent (token-by-token stream event)
599
+ });
600
+
601
+ pi.on("message_end", async (event, ctx) => {
602
+ if (event.message.role !== "assistant") return;
603
+
604
+ return {
605
+ message: {
606
+ ...event.message,
607
+ usage: {
608
+ ...event.message.usage,
609
+ cost: {
610
+ ...event.message.usage.cost,
611
+ total: 0.123,
612
+ },
613
+ },
614
+ },
615
+ };
616
+ });
617
+ ```
618
+
619
+ #### tool_execution_start / tool_execution_update / tool_execution_end
620
+
621
+ Fired for tool execution lifecycle updates.
622
+
623
+ In parallel tool mode:
624
+ - `tool_execution_start` is emitted in assistant source order during the preflight phase
625
+ - `tool_execution_update` events may interleave across tools
626
+ - `tool_execution_end` is emitted in tool completion order after each tool is finalized
627
+ - final `toolResult` message events are still emitted later in assistant source order
628
+
629
+ ```typescript
630
+ pi.on("tool_execution_start", async (event, ctx) => {
631
+ // event.toolCallId, event.toolName, event.args
632
+ });
633
+
634
+ pi.on("tool_execution_update", async (event, ctx) => {
635
+ // event.toolCallId, event.toolName, event.args, event.partialResult
636
+ });
637
+
638
+ pi.on("tool_execution_end", async (event, ctx) => {
639
+ // event.toolCallId, event.toolName, event.result, event.isError
640
+ });
641
+ ```
642
+
643
+ #### context
644
+
645
+ Fired before each LLM call. Modify messages non-destructively. See [Session Format](session-format.md) for message types.
646
+
647
+ ```typescript
648
+ pi.on("context", async (event, ctx) => {
649
+ // event.messages - deep copy, safe to modify
650
+ const filtered = event.messages.filter(m => !shouldPrune(m));
651
+ return { messages: filtered };
652
+ });
653
+ ```
654
+
655
+ #### before_provider_headers
656
+
657
+ Fired after the outgoing HTTP headers are assembled. Use it to add, override, or remove request headers.
658
+
659
+ Handlers mutate `event.headers` in place. Set a key to a string to add or override it, or to `null` to delete it.
660
+
661
+ ```typescript
662
+ pi.on("before_provider_headers", (event, ctx) => {
663
+ // Add or override — e.g. a session id for gateway tracing/attribution
664
+ event.headers["x-session-id"] = ctx.sessionManager.getSessionId();
665
+
666
+ // Drop a tracking header pi adds for this call
667
+ event.headers["X-OpenRouter-Title"] = null;
668
+ });
669
+ ```
670
+
671
+ Runs once per provider request; retries reuse the same headers rather than re-firing the hook.
672
+
673
+ #### before_provider_request
674
+
675
+ 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.
676
+
677
+ This hook can rewrite provider-level system instructions or remove them entirely. Those payload-level changes are not reflected by `ctx.getSystemPrompt()`, which reports lunR's system prompt string rather than the final serialized provider payload.
678
+
679
+ ```typescript
680
+ pi.on("before_provider_request", (event, ctx) => {
681
+ console.log(JSON.stringify(event.payload, null, 2));
682
+
683
+ // Optional: replace payload
684
+ // return { ...event.payload, temperature: 0 };
685
+ });
686
+ ```
687
+
688
+ This is mainly useful for debugging provider serialization and cache behavior.
689
+
690
+ #### after_provider_response
691
+
692
+ Fired after an HTTP response is received and before its stream body is consumed. Handlers run in extension load order.
693
+
694
+ ```typescript
695
+ pi.on("after_provider_response", (event, ctx) => {
696
+ // event.status - HTTP status code
697
+ // event.headers - normalized response headers
698
+ if (event.status === 429) {
699
+ console.log("rate limited", event.headers["retry-after"]);
700
+ }
701
+ });
702
+ ```
703
+
704
+ Header availability depends on provider and transport. Providers that abstract HTTP responses may not expose headers.
705
+
706
+ ### Model Events
707
+
708
+ #### model_select
709
+
710
+ Fired when the model changes via `/model` command, model cycling (`Ctrl+P`), or session restore.
711
+
712
+ ```typescript
713
+ pi.on("model_select", async (event, ctx) => {
714
+ // event.model - newly selected model
715
+ // event.previousModel - previous model (undefined if first selection)
716
+ // event.source - "set" | "cycle" | "restore"
717
+
718
+ const prev = event.previousModel
719
+ ? `${event.previousModel.provider}/${event.previousModel.id}`
720
+ : "none";
721
+ const next = `${event.model.provider}/${event.model.id}`;
722
+
723
+ ctx.ui.notify(`Model changed (${event.source}): ${prev} -> ${next}`, "info");
724
+ });
725
+ ```
726
+
727
+ Use this to update UI elements (status bars, footers) or perform model-specific initialization when the active model changes.
728
+
729
+ #### thinking_level_select
730
+
731
+ Fired when the thinking level changes. This is notification-only; handler return values are ignored.
732
+
733
+ ```typescript
734
+ pi.on("thinking_level_select", async (event, ctx) => {
735
+ // event.level - newly selected thinking level
736
+ // event.previousLevel - previous thinking level
737
+
738
+ ctx.ui.setStatus("thinking", `thinking: ${event.level}`);
739
+ });
740
+ ```
741
+
742
+ Use this to update extension UI when `pi.setThinkingLevel()`, model changes, or built-in thinking-level controls change the active thinking level.
743
+
744
+ ### Tool Events
745
+
746
+ #### tool_call
747
+
748
+ Fired after `tool_execution_start`, before the tool executes. **Can block.** Use `isToolCallEventType` to narrow and get typed inputs.
749
+
750
+ Before `tool_call` runs, lunR waits for previously emitted Agent events to finish draining through `AgentSession`. This means `ctx.sessionManager` is up to date through the current assistant tool-calling message.
751
+
752
+ In the default parallel tool execution mode, sibling tool calls from the same assistant message are preflighted sequentially, then executed concurrently. `tool_call` is not guaranteed to see sibling tool results from that same assistant message in `ctx.sessionManager`.
753
+
754
+ `event.input` is mutable. Mutate it in place to patch tool arguments before execution.
755
+
756
+ Behavior guarantees:
757
+ - Mutations to `event.input` affect the actual tool execution
758
+ - Later `tool_call` handlers see mutations made by earlier handlers
759
+ - No re-validation is performed after your mutation
760
+ - Return values from `tool_call` only control blocking via `{ block: true, reason?: string }`
761
+
762
+ ```typescript
763
+ import { isToolCallEventType } from "@ashx-j/lunr";
764
+
765
+ pi.on("tool_call", async (event, ctx) => {
766
+ // event.toolName - "bash", "read", "write", "edit", etc.
767
+ // event.toolCallId
768
+ // event.input - tool parameters (mutable)
769
+
770
+ // Built-in tools: no type params needed
771
+ if (isToolCallEventType("bash", event)) {
772
+ // event.input is { command: string; timeout?: number }
773
+ event.input.command = `source ~/.profile\n${event.input.command}`;
774
+
775
+ if (event.input.command.includes("rm -rf")) {
776
+ return { block: true, reason: "Dangerous command" };
777
+ }
778
+ }
779
+
780
+ if (isToolCallEventType("read", event)) {
781
+ // event.input is { path: string; offset?: number; limit?: number }
782
+ console.log(`Reading: ${event.input.path}`);
783
+ }
784
+ });
785
+ ```
786
+
787
+ #### Typing custom tool input
788
+
789
+ Custom tools should export their input type:
790
+
791
+ ```typescript
792
+ // my-extension.ts
793
+ export type MyToolInput = Static<typeof myToolSchema>;
794
+ ```
795
+
796
+ Use `isToolCallEventType` with explicit type parameters:
797
+
798
+ ```typescript
799
+ import { isToolCallEventType } from "@ashx-j/lunr";
800
+ import type { MyToolInput } from "my-extension";
801
+
802
+ pi.on("tool_call", (event) => {
803
+ if (isToolCallEventType<"my_tool", MyToolInput>("my_tool", event)) {
804
+ event.input.action; // typed
805
+ }
806
+ });
807
+ ```
808
+
809
+ #### tool_result
810
+
811
+ Fired after tool execution finishes and before `tool_execution_end` plus the final tool result message events are emitted. **Can modify result.**
812
+
813
+ 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.
814
+
815
+ `tool_result` handlers chain like middleware:
816
+ - Handlers run in extension load order
817
+ - Each handler sees the latest result after previous handler changes
818
+ - Handlers can return partial patches (`content`, `details`, or `isError`); omitted fields keep their current values
819
+
820
+ Use `ctx.signal` for nested async work inside the handler. This lets Esc cancel model calls, `fetch()`, and other abort-aware operations started by the extension.
821
+
822
+ ```typescript
823
+ import { isBashToolResult } from "@ashx-j/lunr";
824
+
825
+ pi.on("tool_result", async (event, ctx) => {
826
+ // event.toolName, event.toolCallId, event.input
827
+ // event.content, event.details, event.isError
828
+
829
+ if (isBashToolResult(event)) {
830
+ // event.details is typed as BashToolDetails
831
+ }
832
+
833
+ const response = await fetch("https://example.com/summarize", {
834
+ method: "POST",
835
+ body: JSON.stringify({ content: event.content }),
836
+ signal: ctx.signal,
837
+ });
838
+
839
+ // Modify result:
840
+ return { content: [...], details: {...}, isError: false };
841
+ });
842
+ ```
843
+
844
+ ### User Bash Events
845
+
846
+ #### user_bash
847
+
848
+ Fired when user executes `!` or `!!` commands. **Can intercept.**
849
+
850
+ ```typescript
851
+ import { createLocalBashOperations } from "@ashx-j/lunr";
852
+
853
+ pi.on("user_bash", (event, ctx) => {
854
+ // event.command - the bash command
855
+ // event.excludeFromContext - true if !! prefix
856
+ // event.cwd - working directory
857
+
858
+ // Option 1: Provide custom operations (e.g., SSH)
859
+ return { operations: remoteBashOps };
860
+
861
+ // Option 2: Wrap lunR's built-in local bash backend
862
+ const local = createLocalBashOperations();
863
+ return {
864
+ operations: {
865
+ exec(command, cwd, options) {
866
+ return local.exec(`source ~/.profile\n${command}`, cwd, options);
867
+ }
868
+ }
869
+ };
870
+
871
+ // Option 3: Full replacement - return result directly
872
+ return { result: { output: "...", exitCode: 0, cancelled: false, truncated: false } };
873
+ });
874
+ ```
875
+
876
+ ### Input Events
877
+
878
+ #### input
879
+
880
+ Fired when user input is received, after extension commands are checked but before skill and template expansion. The event sees the raw input text, so `/skill:foo` and `/template` are not yet expanded.
881
+
882
+ **Processing order:**
883
+ 1. Extension commands (`/cmd`) checked first - if found, handler runs and input event is skipped
884
+ 2. `input` event fires - can intercept, transform, or handle
885
+ 3. If not handled: skill commands (`/skill:name`) expanded to skill content
886
+ 4. If not handled: prompt templates (`/template`) expanded to template content
887
+ 5. Agent processing begins (`before_agent_start`, etc.)
888
+
889
+ ```typescript
890
+ pi.on("input", async (event, ctx) => {
891
+ // event.text - raw input (before skill/template expansion)
892
+ // event.images - attached images, if any
893
+ // event.source - "interactive" (typed), "rpc" (API), or "extension" (via sendUserMessage)
894
+ // event.streamingBehavior - "steer" | "followUp" | undefined
895
+ // undefined when idle, "steer" for mid-stream interrupts,
896
+ // "followUp" for messages queued until the agent finishes
897
+
898
+ // Transform: rewrite input before expansion
899
+ if (event.text.startsWith("?quick "))
900
+ return { action: "transform", text: `Respond briefly: ${event.text.slice(7)}` };
901
+
902
+ // Handle: respond without LLM (extension shows its own feedback)
903
+ if (event.text === "ping") {
904
+ ctx.ui.notify("pong", "info");
905
+ return { action: "handled" };
906
+ }
907
+
908
+ // Route by source: skip processing for extension-injected messages
909
+ if (event.source === "extension") return { action: "continue" };
910
+
911
+ // Intercept skill commands before expansion
912
+ if (event.text.startsWith("/skill:")) {
913
+ // Could transform, block, or let pass through
914
+ }
915
+
916
+ return { action: "continue" }; // Default: pass through to expansion
917
+ });
918
+ ```
919
+
920
+ **Results:**
921
+ - `continue` - pass through unchanged (default if handler returns nothing)
922
+ - `transform` - modify text/images, then continue to expansion
923
+ - `handled` - skip agent entirely (first handler to return this wins)
924
+
925
+ Transforms chain across handlers. See [input-transform.ts](../examples/extensions/input-transform.ts) and [input-transform-streaming.ts](../examples/extensions/input-transform-streaming.ts) for `streamingBehavior`-aware routing.
926
+
927
+ ## ExtensionContext
928
+
929
+ All handlers receive `ctx: ExtensionContext`.
930
+
931
+ ### ctx.ui
932
+
933
+ UI methods for user interaction. See [Custom UI](#custom-ui) for full details.
934
+
935
+ ### ctx.mode
936
+
937
+ Current run mode: `"tui"`, `"rpc"`, `"json"`, or `"print"`. Use `ctx.mode === "tui"` to guard terminal-only features such as `custom()`, component factories, terminal input, and direct TUI rendering.
938
+
939
+ ### ctx.hasUI
940
+
941
+ `true` in TUI and RPC modes. `false` in print mode (`-p`) and JSON mode. Use this to guard dialog methods (`select`, `confirm`, `input`, `editor`) and fire-and-forget methods (`notify`, `setStatus`, `setWidget`, `setTitle`, `setEditorText`) that work in both TUI and RPC modes. In RPC mode, some TUI-specific methods are no-ops or return defaults (see [rpc.md](rpc.md#extension-ui-protocol)).
942
+
943
+ ### ctx.cwd
944
+
945
+ Current working directory.
946
+
947
+ Use `CONFIG_DIR_NAME` instead of hardcoding `.lunr` when constructing project-local config paths. Rebranded distributions can use a different config directory name.
948
+
949
+ ```typescript
950
+ import { CONFIG_DIR_NAME, type ExtensionAPI } from "@ashx-j/lunr";
951
+ import { join } from "node:path";
952
+
953
+ export default function (pi: ExtensionAPI) {
954
+ pi.on("session_start", (_event, ctx) => {
955
+ const projectConfigPath = join(ctx.cwd, CONFIG_DIR_NAME, "my-extension.json");
956
+ // ...
957
+ });
958
+ }
959
+ ```
960
+
961
+ ### ctx.isProjectTrusted()
962
+
963
+ Returns whether project-local trust is active for the current session context. This includes temporary trust decisions and CLI trust overrides, not just saved decisions in the global trust store.
964
+
965
+ Use this before reading project-local extension configuration that should only be honored for trusted projects.
966
+
967
+ ### ctx.sessionManager
968
+
969
+ Read-only access to session state. See [Session Format](session-format.md) for the full SessionManager API and entry types.
970
+
971
+ 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.
972
+
973
+ ```typescript
974
+ ctx.sessionManager.getEntries() // All entries
975
+ ctx.sessionManager.getBranch() // Current branch
976
+ ctx.sessionManager.buildContextEntries() // Active branch entries with compaction applied
977
+ ctx.sessionManager.getLeafId() // Current leaf entry ID
978
+ ```
979
+
980
+ ### ctx.modelRegistry / ctx.model
981
+
982
+ Access to models and API keys.
983
+
984
+ ### ctx.signal
985
+
986
+ The current agent abort signal, or `undefined` when no agent turn is active.
987
+
988
+ Use this for abort-aware nested work started by extension handlers, for example:
989
+ - `fetch(..., { signal: ctx.signal })`
990
+ - model calls that accept `signal`
991
+ - file or process helpers that accept `AbortSignal`
992
+
993
+ `ctx.signal` is typically defined during active turn events such as `tool_call`, `tool_result`, `message_update`, and `turn_end`.
994
+ It is usually `undefined` in idle or non-turn contexts such as session events, extension commands, and shortcuts fired while lunR is idle.
995
+
996
+ ```typescript
997
+ pi.on("tool_result", async (event, ctx) => {
998
+ const response = await fetch("https://example.com/api", {
999
+ method: "POST",
1000
+ body: JSON.stringify(event),
1001
+ signal: ctx.signal,
1002
+ });
1003
+
1004
+ const data = await response.json();
1005
+ return { details: data };
1006
+ });
1007
+ ```
1008
+
1009
+ ### ctx.isIdle() / ctx.abort() / ctx.hasPendingMessages()
1010
+
1011
+ Control flow helpers. `ctx.isIdle()` is false while lunR is processing an agent run, automatic retry, auto-compaction retry, or queued continuation.
1012
+
1013
+ ### ctx.shutdown()
1014
+
1015
+ Request a graceful shutdown of pi.
1016
+
1017
+ - **Interactive mode:** Deferred until the agent becomes idle (after processing all queued steering and follow-up messages).
1018
+ - **RPC mode:** Deferred until the next idle state (after completing the current command response, when waiting for the next command).
1019
+ - **Print mode:** No-op. The process exits automatically when all prompts are processed.
1020
+
1021
+ Emits `session_shutdown` event to all extensions before exiting. Available in all contexts (event handlers, tools, commands, shortcuts).
1022
+
1023
+ ```typescript
1024
+ pi.on("tool_call", (event, ctx) => {
1025
+ if (isFatal(event.input)) {
1026
+ ctx.shutdown();
1027
+ }
1028
+ });
1029
+ ```
1030
+
1031
+ ### ctx.getContextUsage()
1032
+
1033
+ Returns current context usage for the active model. Uses last assistant usage when available, then estimates tokens for trailing messages.
1034
+
1035
+ ```typescript
1036
+ const usage = ctx.getContextUsage();
1037
+ if (usage && usage.tokens > 100_000) {
1038
+ // ...
1039
+ }
1040
+ ```
1041
+
1042
+ ### ctx.compact()
1043
+
1044
+ Trigger compaction without awaiting completion. Use `onComplete` and `onError` for follow-up actions.
1045
+
1046
+ ```typescript
1047
+ ctx.compact({
1048
+ customInstructions: "Focus on recent changes",
1049
+ onComplete: (result) => {
1050
+ ctx.ui.notify("Compaction completed", "info");
1051
+ },
1052
+ onError: (error) => {
1053
+ ctx.ui.notify(`Compaction failed: ${error.message}`, "error");
1054
+ },
1055
+ });
1056
+ ```
1057
+
1058
+ ### ctx.getSystemPrompt()
1059
+
1060
+ Returns lunR's current system prompt string.
1061
+
1062
+ - During `before_agent_start`, this reflects chained system-prompt changes made so far for the current turn.
1063
+ - It does not include later `context` message mutations.
1064
+ - It does not include `before_provider_request` payload rewrites.
1065
+ - If later-loaded extensions run after yours, they can still change what is ultimately sent.
1066
+
1067
+ ```typescript
1068
+ pi.on("before_agent_start", (event, ctx) => {
1069
+ const prompt = ctx.getSystemPrompt();
1070
+ console.log(`System prompt length: ${prompt.length}`);
1071
+ });
1072
+ ```
1073
+
1074
+ ## ExtensionCommandContext
1075
+
1076
+ Command handlers receive `ExtensionCommandContext`, which extends `ExtensionContext` with session control methods. These are only available in commands because they can deadlock if called from event handlers.
1077
+
1078
+ ### ctx.getSystemPromptOptions()
1079
+
1080
+ Returns the base inputs lunR currently uses to build the system prompt.
1081
+
1082
+ ```typescript
1083
+ const options = ctx.getSystemPromptOptions();
1084
+ const contextPaths = options.contextFiles?.map((file) => file.path) ?? [];
1085
+ ```
1086
+
1087
+ This has the same shape and mutability as `before_agent_start` `event.systemPromptOptions`: custom prompt, active tools, tool snippets, prompt guidelines, appended system prompt text, cwd, loaded context files, and loaded skills. It may include full context file contents, so treat it as sensitive extension-local data and avoid exposing it through command lists, logs, or autocomplete metadata.
1088
+
1089
+ This reports the current base prompt inputs. It does not include per-turn `before_agent_start` chained system-prompt changes, later `context` event message mutations, or `before_provider_request` payload rewrites.
1090
+
1091
+ ### ctx.waitForIdle()
1092
+
1093
+ Wait for the agent to fully settle, including automatic retries, auto-compaction retries, and queued continuations:
1094
+
1095
+ ```typescript
1096
+ pi.registerCommand("my-cmd", {
1097
+ handler: async (args, ctx) => {
1098
+ await ctx.waitForIdle();
1099
+ // Agent is now idle, safe to modify session
1100
+ },
1101
+ });
1102
+ ```
1103
+
1104
+ ### ctx.newSession(options?)
1105
+
1106
+ Create a new session:
1107
+
1108
+ ```typescript
1109
+ const parentSession = ctx.sessionManager.getSessionFile();
1110
+ const kickoff = "Continue in the replacement session";
1111
+
1112
+ const result = await ctx.newSession({
1113
+ parentSession,
1114
+ setup: async (sm) => {
1115
+ sm.appendMessage({
1116
+ role: "user",
1117
+ content: [{ type: "text", text: "Context from previous session..." }],
1118
+ timestamp: Date.now(),
1119
+ });
1120
+ },
1121
+ withSession: async (ctx) => {
1122
+ // Use only the replacement-session ctx here.
1123
+ await ctx.sendUserMessage(kickoff);
1124
+ },
1125
+ });
1126
+
1127
+ if (result.cancelled) {
1128
+ // An extension cancelled the new session
1129
+ }
1130
+ ```
1131
+
1132
+ Options:
1133
+ - `parentSession`: parent session file to record in the new session header
1134
+ - `setup`: mutate the new session's `SessionManager` before `withSession` runs
1135
+ - `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).
1136
+
1137
+ ### ctx.fork(entryId, options?)
1138
+
1139
+ Fork from a specific entry, creating a new session file:
1140
+
1141
+ ```typescript
1142
+ const result = await ctx.fork("entry-id-123", {
1143
+ withSession: async (ctx) => {
1144
+ // Use only the replacement-session ctx here.
1145
+ ctx.ui.notify("Now in the forked session", "info");
1146
+ },
1147
+ });
1148
+ if (result.cancelled) {
1149
+ // An extension cancelled the fork
1150
+ }
1151
+
1152
+ const cloneResult = await ctx.fork("entry-id-456", { position: "at" });
1153
+ if (cloneResult.cancelled) {
1154
+ // An extension cancelled the clone
1155
+ }
1156
+ ```
1157
+
1158
+ Options:
1159
+ - `position`: `"before"` (default) forks before the selected user message, restoring that prompt into the editor
1160
+ - `position`: `"at"` duplicates the active path through the selected entry without restoring editor text
1161
+ - `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).
1162
+
1163
+ ### ctx.navigateTree(targetId, options?)
1164
+
1165
+ Navigate to a different point in the session tree:
1166
+
1167
+ ```typescript
1168
+ const result = await ctx.navigateTree("entry-id-456", {
1169
+ summarize: true,
1170
+ customInstructions: "Focus on error handling changes",
1171
+ replaceInstructions: false, // true = replace default prompt entirely
1172
+ label: "review-checkpoint",
1173
+ });
1174
+ ```
1175
+
1176
+ Options:
1177
+ - `summarize`: Whether to generate a summary of the abandoned branch
1178
+ - `customInstructions`: Custom instructions for the summarizer
1179
+ - `replaceInstructions`: If true, `customInstructions` replaces the default prompt instead of being appended
1180
+ - `label`: Label to attach to the branch summary entry (or target entry if not summarizing)
1181
+
1182
+ ### ctx.switchSession(sessionPath, options?)
1183
+
1184
+ Switch to a different session file:
1185
+
1186
+ ```typescript
1187
+ const result = await ctx.switchSession("/path/to/session.jsonl", {
1188
+ withSession: async (ctx) => {
1189
+ await ctx.sendUserMessage("Resume work in the replacement session");
1190
+ },
1191
+ });
1192
+ if (result.cancelled) {
1193
+ // An extension cancelled the switch via session_before_switch
1194
+ }
1195
+ ```
1196
+
1197
+ Options:
1198
+ - `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).
1199
+
1200
+ To discover available sessions, use the static `SessionManager.list()` or `SessionManager.listAll()` methods:
1201
+
1202
+ ```typescript
1203
+ import { SessionManager } from "@ashx-j/lunr";
1204
+
1205
+ pi.registerCommand("switch", {
1206
+ description: "Switch to another session",
1207
+ handler: async (args, ctx) => {
1208
+ const sessions = await SessionManager.list(ctx.cwd);
1209
+ if (sessions.length === 0) return;
1210
+ const choice = await ctx.ui.select(
1211
+ "Pick session:",
1212
+ sessions.map(s => s.file),
1213
+ );
1214
+ if (choice) {
1215
+ await ctx.switchSession(choice, {
1216
+ withSession: async (ctx) => {
1217
+ ctx.ui.notify("Switched session", "info");
1218
+ },
1219
+ });
1220
+ }
1221
+ },
1222
+ });
1223
+ ```
1224
+
1225
+ ### Session replacement lifecycle and footguns
1226
+
1227
+ `withSession` receives a fresh `ReplacedSessionContext`, which extends `ExtensionCommandContext` with async `sendMessage()` and `sendUserMessage()` helpers bound to the replacement session.
1228
+
1229
+ Lifecycle and footguns:
1230
+ - `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`.
1231
+ - 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.
1232
+ - 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.
1233
+ - 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.
1234
+ - 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.
1235
+
1236
+ Safe pattern:
1237
+
1238
+ ```typescript
1239
+ pi.registerCommand("handoff", {
1240
+ handler: async (_args, ctx) => {
1241
+ const kickoff = "Continue from the replacement session";
1242
+ await ctx.newSession({
1243
+ withSession: async (ctx) => {
1244
+ await ctx.sendUserMessage(kickoff);
1245
+ },
1246
+ });
1247
+ },
1248
+ });
1249
+ ```
1250
+
1251
+ Unsafe pattern:
1252
+
1253
+ ```typescript
1254
+ pi.registerCommand("handoff", {
1255
+ handler: async (_args, ctx) => {
1256
+ const oldSessionManager = ctx.sessionManager;
1257
+ await ctx.newSession({
1258
+ withSession: async (_ctx) => {
1259
+ // stale old objects: do not do this
1260
+ oldSessionManager.getSessionFile();
1261
+ pi.sendUserMessage("wrong");
1262
+ },
1263
+ });
1264
+ },
1265
+ });
1266
+ ```
1267
+
1268
+ ### ctx.reload()
1269
+
1270
+ Run the same reload flow as `/reload`.
1271
+
1272
+ ```typescript
1273
+ pi.registerCommand("reload-runtime", {
1274
+ description: "Reload extensions, skills, prompts, themes, and context files",
1275
+ handler: async (_args, ctx) => {
1276
+ await ctx.reload();
1277
+ return;
1278
+ },
1279
+ });
1280
+ ```
1281
+
1282
+ Important behavior:
1283
+ - `await ctx.reload()` emits `session_shutdown` for the current extension runtime
1284
+ - It then reloads resources and emits `session_start` with `reason: "reload"` and `resources_discover` with reason `"reload"`
1285
+ - The currently running command handler still continues in the old call frame
1286
+ - Code after `await ctx.reload()` still runs from the pre-reload version
1287
+ - Code after `await ctx.reload()` must not assume old in-memory extension state is still valid
1288
+ - After the handler returns, future commands/events/tool calls use the new extension version
1289
+
1290
+ For predictable behavior, treat reload as terminal for that handler (`await ctx.reload(); return;`).
1291
+
1292
+ Tools run with `ExtensionContext`, so they cannot call `ctx.reload()` directly. Use a command as the reload entrypoint, then expose a tool that queues that command as a follow-up user message.
1293
+
1294
+ Example tool the LLM can call to trigger reload:
1295
+
1296
+ ```typescript
1297
+ import type { ExtensionAPI } from "@ashx-j/lunr";
1298
+ import { Type } from "typebox";
1299
+
1300
+ export default function (pi: ExtensionAPI) {
1301
+ pi.registerCommand("reload-runtime", {
1302
+ description: "Reload extensions, skills, prompts, themes, and context files",
1303
+ handler: async (_args, ctx) => {
1304
+ await ctx.reload();
1305
+ return;
1306
+ },
1307
+ });
1308
+
1309
+ pi.registerTool({
1310
+ name: "reload_runtime",
1311
+ label: "Reload Runtime",
1312
+ description: "Reload extensions, skills, prompts, themes, and context files",
1313
+ parameters: Type.Object({}),
1314
+ async execute() {
1315
+ pi.sendUserMessage("/reload-runtime", { deliverAs: "followUp" });
1316
+ return {
1317
+ content: [{ type: "text", text: "Queued /reload-runtime as a follow-up command." }],
1318
+ };
1319
+ },
1320
+ });
1321
+ }
1322
+ ```
1323
+
1324
+ ## ExtensionAPI Methods
1325
+
1326
+ ### pi.on(event, handler)
1327
+
1328
+ Subscribe to events. See [Events](#events) for event types and return values.
1329
+
1330
+ ### pi.registerTool(definition)
1331
+
1332
+ Register a custom tool callable by the LLM. See [Custom Tools](#custom-tools) for full details.
1333
+
1334
+ `pi.registerTool()` works both during extension load and after startup. You can call it inside `session_start`, command handlers, or other event handlers. New tools are refreshed immediately in the same session, so they appear in `pi.getAllTools()` and are callable by the LLM without `/reload`.
1335
+
1336
+ Use `pi.setActiveTools()` to enable or disable tools (including dynamically added tools) at runtime.
1337
+
1338
+ 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.
1339
+
1340
+ **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.
1341
+
1342
+ See [dynamic-tools.ts](../examples/extensions/dynamic-tools.ts) for a full example.
1343
+
1344
+ ```typescript
1345
+ import { Type } from "typebox";
1346
+ import { StringEnum } from "@ashx-j/lunr-ai";
1347
+
1348
+ pi.registerTool({
1349
+ name: "my_tool",
1350
+ label: "My Tool",
1351
+ description: "What this tool does",
1352
+ promptSnippet: "Summarize or transform text according to action",
1353
+ promptGuidelines: ["Use my_tool when the user asks to summarize previously generated text."],
1354
+ parameters: Type.Object({
1355
+ action: StringEnum(["list", "add"] as const),
1356
+ text: Type.Optional(Type.String()),
1357
+ }),
1358
+ prepareArguments(args) {
1359
+ // Optional compatibility shim. Runs before schema validation.
1360
+ // Return the current schema shape, for example to fold legacy fields
1361
+ // into the modern parameter object.
1362
+ return args;
1363
+ },
1364
+
1365
+ async execute(toolCallId, params, signal, onUpdate, ctx) {
1366
+ // Stream progress
1367
+ onUpdate?.({ content: [{ type: "text", text: "Working..." }] });
1368
+
1369
+ return {
1370
+ content: [{ type: "text", text: "Done" }],
1371
+ details: { result: "..." },
1372
+ };
1373
+ },
1374
+
1375
+ // Optional: Custom rendering
1376
+ renderCall(args, theme, context) { ... },
1377
+ renderResult(result, options, theme, context) { ... },
1378
+ });
1379
+ ```
1380
+
1381
+ ### pi.sendMessage(message, options?)
1382
+
1383
+ Inject a custom message into the session. Custom messages participate in LLM context. For durable TUI-only content that should not be sent to the LLM, use [`pi.appendEntry()`](#piappendentrycustomtype-data) with [`pi.registerEntryRenderer()`](#piregisterentryrenderercustomtype-renderer).
1384
+
1385
+ ```typescript
1386
+ pi.sendMessage({
1387
+ customType: "my-extension",
1388
+ content: "Message text",
1389
+ display: true,
1390
+ details: { ... },
1391
+ }, {
1392
+ triggerTurn: true,
1393
+ deliverAs: "steer",
1394
+ });
1395
+ ```
1396
+
1397
+ **Options:**
1398
+ - `deliverAs` - Delivery mode:
1399
+ - `"steer"` (default) - Queues the message while streaming. Delivered after the current assistant turn finishes executing its tool calls, before the next LLM call.
1400
+ - `"followUp"` - Waits for agent to finish. Delivered only when agent has no more tool calls.
1401
+ - `"nextTurn"` - Queued for next user prompt. Does not interrupt or trigger anything.
1402
+ - `triggerTurn: true` - If agent is idle, trigger an LLM response immediately. Only applies to `"steer"` and `"followUp"` modes (ignored for `"nextTurn"`).
1403
+
1404
+ ### pi.sendUserMessage(content, options?)
1405
+
1406
+ Send a user message to the agent. Unlike `sendMessage()` which sends custom messages, this sends an actual user message that appears as if typed by the user. Always triggers a turn.
1407
+
1408
+ ```typescript
1409
+ // Simple text message
1410
+ pi.sendUserMessage("What is 2+2?");
1411
+
1412
+ // With content array (text + images)
1413
+ pi.sendUserMessage([
1414
+ { type: "text", text: "Describe this image:" },
1415
+ { type: "image", source: { type: "base64", mediaType: "image/png", data: "..." } },
1416
+ ]);
1417
+
1418
+ // During streaming - must specify delivery mode
1419
+ pi.sendUserMessage("Focus on error handling", { deliverAs: "steer" });
1420
+ pi.sendUserMessage("And then summarize", { deliverAs: "followUp" });
1421
+ ```
1422
+
1423
+ **Options:**
1424
+ - `deliverAs` - Required when agent is streaming:
1425
+ - `"steer"` - Queues the message for delivery after the current assistant turn finishes executing its tool calls
1426
+ - `"followUp"` - Waits for agent to finish all tools
1427
+
1428
+ When not streaming, the message is sent immediately and triggers a new turn. When streaming without `deliverAs`, throws an error.
1429
+
1430
+ See [send-user-message.ts](../examples/extensions/send-user-message.ts) for a complete example.
1431
+
1432
+ ### pi.appendEntry(customType, data?)
1433
+
1434
+ Persist extension data. Custom entries do NOT participate in LLM context. In interactive mode, they can also render inside the chat transcript when paired with `pi.registerEntryRenderer()`.
1435
+
1436
+ ```typescript
1437
+ pi.appendEntry("my-state", { count: 42 });
1438
+ pi.appendEntry("status-card", { title: "Indexed files", count: 17 });
1439
+
1440
+ // Restore on reload
1441
+ pi.on("session_start", async (_event, ctx) => {
1442
+ for (const entry of ctx.sessionManager.getEntries()) {
1443
+ if (entry.type === "custom" && entry.customType === "my-state") {
1444
+ // Reconstruct from entry.data
1445
+ }
1446
+ }
1447
+ });
1448
+ ```
1449
+
1450
+ ### pi.setSessionName(name)
1451
+
1452
+ Set the session display name (shown in session selector instead of first message).
1453
+
1454
+ ```typescript
1455
+ pi.setSessionName("Refactor auth module");
1456
+ ```
1457
+
1458
+ ### pi.getSessionName()
1459
+
1460
+ Get the current session name, if set.
1461
+
1462
+ ```typescript
1463
+ const name = pi.getSessionName();
1464
+ if (name) {
1465
+ console.log(`Session: ${name}`);
1466
+ }
1467
+ ```
1468
+
1469
+ ### pi.setLabel(entryId, label)
1470
+
1471
+ Set or clear a label on an entry. Labels are user-defined markers for bookmarking and navigation (shown in `/tree` selector).
1472
+
1473
+ ```typescript
1474
+ // Set a label
1475
+ pi.setLabel(entryId, "checkpoint-before-refactor");
1476
+
1477
+ // Clear a label
1478
+ pi.setLabel(entryId, undefined);
1479
+
1480
+ // Read labels via sessionManager
1481
+ const label = ctx.sessionManager.getLabel(entryId);
1482
+ ```
1483
+
1484
+ Labels persist in the session and survive restarts. Use them to mark important points (turns, checkpoints) in the conversation tree.
1485
+
1486
+ ### pi.registerCommand(name, options)
1487
+
1488
+ Register a command.
1489
+
1490
+ If multiple extensions register the same command name, pi keeps them all and assigns numeric invocation suffixes in load order, for example `/review:1` and `/review:2`.
1491
+
1492
+ ```typescript
1493
+ pi.registerCommand("stats", {
1494
+ description: "Show session statistics",
1495
+ handler: async (args, ctx) => {
1496
+ const count = ctx.sessionManager.getEntries().length;
1497
+ ctx.ui.notify(`${count} entries`, "info");
1498
+ }
1499
+ });
1500
+ ```
1501
+
1502
+ Optional: add argument auto-completion for `/command ...`:
1503
+
1504
+ ```typescript
1505
+ import type { AutocompleteItem } from "@ashx-j/lunr-tui";
1506
+
1507
+ pi.registerCommand("deploy", {
1508
+ description: "Deploy to an environment",
1509
+ getArgumentCompletions: (prefix: string): AutocompleteItem[] | null => {
1510
+ const envs = ["dev", "staging", "prod"];
1511
+ const items = envs.map((e) => ({ value: e, label: e }));
1512
+ const filtered = items.filter((i) => i.value.startsWith(prefix));
1513
+ return filtered.length > 0 ? filtered : null;
1514
+ },
1515
+ handler: async (args, ctx) => {
1516
+ ctx.ui.notify(`Deploying: ${args}`, "info");
1517
+ },
1518
+ });
1519
+ ```
1520
+
1521
+ ### pi.getCommands()
1522
+
1523
+ Get the slash commands available for invocation via `prompt` in the current session. Includes extension commands, prompt templates, and skill commands.
1524
+ The list matches the RPC `get_commands` ordering: extensions first, then templates, then skills.
1525
+
1526
+ ```typescript
1527
+ const commands = pi.getCommands();
1528
+ const bySource = commands.filter((command) => command.source === "extension");
1529
+ const userScoped = commands.filter((command) => command.sourceInfo.scope === "user");
1530
+ ```
1531
+
1532
+ Each entry has this shape:
1533
+
1534
+ ```typescript
1535
+ {
1536
+ name: string; // Invokable command name without the leading slash. May be suffixed like "review:1"
1537
+ description?: string;
1538
+ source: "extension" | "prompt" | "skill";
1539
+ sourceInfo: {
1540
+ path: string;
1541
+ source: string;
1542
+ scope: "user" | "project" | "temporary";
1543
+ origin: "package" | "top-level";
1544
+ baseDir?: string;
1545
+ };
1546
+ }
1547
+ ```
1548
+
1549
+ Use `sourceInfo` as the canonical provenance field. Do not infer ownership from command names or from ad hoc path parsing.
1550
+
1551
+ Built-in interactive commands (like `/model` and `/settings`) are not included here. They are handled only in interactive
1552
+ mode and would not execute if sent via `prompt`.
1553
+
1554
+ ### pi.registerMessageRenderer(customType, renderer)
1555
+
1556
+ Register a custom TUI renderer for custom messages with your `customType`. Custom messages are created with `pi.sendMessage()` and participate in LLM context. See [Custom UI](#custom-ui).
1557
+
1558
+ ### pi.registerEntryRenderer(customType, renderer)
1559
+
1560
+ Register a custom TUI renderer for custom entries with your `customType`. Custom entries are created with `pi.appendEntry()` and do not participate in LLM context.
1561
+
1562
+ ```typescript
1563
+ import { Box, Text } from "@ashx-j/lunr-tui";
1564
+
1565
+ pi.registerEntryRenderer("status-card", (entry, { expanded }, theme) => {
1566
+ const data = entry.data as { title: string; count: number };
1567
+ const box = new Box(1, 1, (text) => theme.bg("customMessageBg", text));
1568
+ box.addChild(new Text(`${theme.bold(data.title)}: ${data.count}`));
1569
+ if (expanded) {
1570
+ box.addChild(new Text(theme.fg("dim", JSON.stringify(data, null, 2))));
1571
+ }
1572
+ return box;
1573
+ });
1574
+
1575
+ pi.appendEntry("status-card", { title: "Indexed files", count: 17 });
1576
+ ```
1577
+
1578
+ ### pi.registerShortcut(shortcut, options)
1579
+
1580
+ Register a keyboard shortcut. See [keybindings.md](keybindings.md) for the shortcut format and built-in keybindings.
1581
+
1582
+ ```typescript
1583
+ pi.registerShortcut("ctrl+shift+p", {
1584
+ description: "Toggle plan mode",
1585
+ handler: async (ctx) => {
1586
+ ctx.ui.notify("Toggled!");
1587
+ },
1588
+ });
1589
+ ```
1590
+
1591
+ ### pi.registerFlag(name, options)
1592
+
1593
+ Register a CLI flag.
1594
+
1595
+ ```typescript
1596
+ pi.registerFlag("plan", {
1597
+ description: "Start in plan mode",
1598
+ type: "boolean",
1599
+ default: false,
1600
+ });
1601
+
1602
+ // Check value
1603
+ if (pi.getFlag("plan")) {
1604
+ // Plan mode enabled
1605
+ }
1606
+ ```
1607
+
1608
+ ### pi.exec(command, args, options?)
1609
+
1610
+ Execute a shell command.
1611
+
1612
+ ```typescript
1613
+ const result = await pi.exec("git", ["status"], { signal, timeout: 5000 });
1614
+ // result.stdout, result.stderr, result.code, result.killed
1615
+ ```
1616
+
1617
+ ### pi.getActiveTools() / pi.getAllTools() / pi.setActiveTools(names)
1618
+
1619
+ Manage active tools. This works for both built-in tools and dynamically registered tools. `pi.getActiveTools()` returns the active tool names as `string[]`; `pi.getAllTools()` returns metadata for all configured tools.
1620
+
1621
+ ```typescript
1622
+ const active = pi.getActiveTools(); // ["read", "bash", ...]
1623
+ const all = pi.getAllTools();
1624
+ // all = [{
1625
+ // name: "read",
1626
+ // description: "Read file contents...",
1627
+ // parameters: ...,
1628
+ // promptGuidelines: ["Use read to examine files instead of cat or sed."],
1629
+ // sourceInfo: { path: "<builtin:read>", source: "builtin", scope: "temporary", origin: "top-level" }
1630
+ // }, ...]
1631
+ const builtinTools = all.filter((t) => t.sourceInfo.source === "builtin");
1632
+ const extensionTools = all.filter((t) => t.sourceInfo.source !== "builtin" && t.sourceInfo.source !== "sdk");
1633
+ pi.setActiveTools([...new Set([...active, "my_custom_tool"])]); // Keep current tools and enable my_custom_tool
1634
+ pi.setActiveTools(["read", "bash"]); // Switch to read-only
1635
+ ```
1636
+
1637
+ `pi.getAllTools()` returns `name`, `description`, `parameters`, `promptGuidelines`, and `sourceInfo`.
1638
+
1639
+ Typical `sourceInfo.source` values:
1640
+ - `builtin` for built-in tools
1641
+ - `sdk` for tools passed via `createAgentSession({ customTools })`
1642
+ - extension source metadata for tools registered by extensions
1643
+
1644
+ ### pi.setModel(model)
1645
+
1646
+ Set the current model. Returns `false` if no API key is available for the model. See [models.md](models.md) for configuring custom models.
1647
+
1648
+ ```typescript
1649
+ const model = ctx.modelRegistry.find("anthropic", "claude-sonnet-4-5");
1650
+ if (model) {
1651
+ const success = await pi.setModel(model);
1652
+ if (!success) {
1653
+ ctx.ui.notify("No API key for this model", "error");
1654
+ }
1655
+ }
1656
+ ```
1657
+
1658
+ ### pi.getThinkingLevel() / pi.setThinkingLevel(level)
1659
+
1660
+ Get or set the thinking level. Level is clamped to model capabilities (non-reasoning models always use "off"). Changes emit `thinking_level_select`.
1661
+
1662
+ ```typescript
1663
+ const current = pi.getThinkingLevel(); // "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max"
1664
+ pi.setThinkingLevel("high");
1665
+ ```
1666
+
1667
+ ### pi.events
1668
+
1669
+ Shared event bus for communication between extensions:
1670
+
1671
+ ```typescript
1672
+ pi.events.on("my:event", (data) => { ... });
1673
+ pi.events.emit("my:event", { ... });
1674
+ ```
1675
+
1676
+ ### pi.registerProvider(name, config)
1677
+
1678
+ Register or override a model provider dynamically. Useful for proxies, custom endpoints, or team-wide model configurations.
1679
+
1680
+ Calls made during the extension factory function are queued and applied once the runner initialises. Calls made after that — for example from a command handler following a user setup flow — take effect immediately without requiring a `/reload`.
1681
+
1682
+ Dynamic providers can implement `refreshModels`. lunR calls it during model refresh, publishes the returned list synchronously through the provider, and passes the canonical credential/store/network/signal context. The extension decides whether to persist the catalog through `context.store`; live servers such as llama.cpp can ignore it.
1683
+
1684
+ ```typescript
1685
+ // Register a new provider with custom models
1686
+ pi.registerProvider("my-proxy", {
1687
+ name: "My Proxy",
1688
+ baseUrl: "https://proxy.example.com",
1689
+ apiKey: "$PROXY_API_KEY", // env var reference
1690
+ api: "anthropic-messages",
1691
+ models: [
1692
+ {
1693
+ id: "claude-sonnet-4-20250514",
1694
+ name: "Claude 4 Sonnet (proxy)",
1695
+ reasoning: false,
1696
+ input: ["text", "image"],
1697
+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
1698
+ contextWindow: 200000,
1699
+ maxTokens: 16384
1700
+ }
1701
+ ]
1702
+ });
1703
+
1704
+ // Register a live llama.cpp catalog without persisting discovered models
1705
+ pi.registerProvider("llama.cpp", {
1706
+ baseUrl: "http://localhost:8080/v1",
1707
+ apiKey: "local",
1708
+ api: "openai-completions",
1709
+ async refreshModels({ signal }) {
1710
+ const response = await fetch("http://localhost:8080/v1/models", { signal });
1711
+ const { data } = await response.json();
1712
+ return data.map(({ id }) => ({
1713
+ id,
1714
+ name: id,
1715
+ reasoning: false,
1716
+ input: ["text"],
1717
+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
1718
+ contextWindow: 128000,
1719
+ maxTokens: 16384
1720
+ }));
1721
+ }
1722
+ });
1723
+
1724
+ // Override baseUrl for an existing provider (keeps all models)
1725
+ pi.registerProvider("anthropic", {
1726
+ baseUrl: "https://proxy.example.com"
1727
+ });
1728
+
1729
+ // Register provider with OAuth support for /login
1730
+ pi.registerProvider("corporate-ai", {
1731
+ baseUrl: "https://ai.corp.com",
1732
+ api: "openai-responses",
1733
+ models: [...],
1734
+ oauth: {
1735
+ name: "Corporate AI (SSO)",
1736
+ async login(callbacks) {
1737
+ // Custom OAuth flow
1738
+ callbacks.onAuth({ url: "https://sso.corp.com/..." });
1739
+ const code = await callbacks.onPrompt({ message: "Enter code:" });
1740
+ return { refresh: code, access: code, expires: Date.now() + 3600000 };
1741
+ },
1742
+ async refreshToken(credentials) {
1743
+ // Refresh logic
1744
+ return credentials;
1745
+ },
1746
+ getApiKey(credentials) {
1747
+ return credentials.access;
1748
+ }
1749
+ }
1750
+ });
1751
+ ```
1752
+
1753
+ **Config options:**
1754
+ - `name` - Display name for the provider in UI such as `/login`.
1755
+ - `baseUrl` - API endpoint URL. Required when defining models.
1756
+ - `apiKey` - API key literal, environment interpolation (`$ENV_VAR` or `${ENV_VAR}`), or leading `!command`. Required when defining models (unless `oauth` provided). `$$` escapes `$`, and `$!` escapes a literal `!` without triggering command execution.
1757
+ - `api` - API type: `"anthropic-messages"`, `"openai-completions"`, `"openai-responses"`, etc.
1758
+ - `headers` - Custom headers to include in requests.
1759
+ - `authHeader` - If true, adds `Authorization: Bearer` header automatically.
1760
+ - `models` - Array of model definitions. If provided, replaces all existing models for this provider. Model definitions can set `baseUrl` to override the provider endpoint for that model.
1761
+ - `refreshModels` - Async dynamic discovery callback. Its returned models replace extension-provided models. Use the scoped `context.store` only when results should persist.
1762
+ - `oauth` - OAuth provider config for `/login` support. When provided, the provider appears in the login menu.
1763
+ - `streamSimple` - Custom streaming implementation for non-standard APIs.
1764
+
1765
+ See [custom-provider.md](custom-provider.md) for advanced topics: custom streaming APIs, OAuth details, model definition reference.
1766
+
1767
+ ### pi.unregisterProvider(name)
1768
+
1769
+ Remove a previously registered provider and its models. Built-in models that were overridden by the provider are restored. Has no effect if the provider was not registered.
1770
+
1771
+ Like `registerProvider`, this takes effect immediately when called after the initial load phase, so a `/reload` is not required.
1772
+
1773
+ ```typescript
1774
+ pi.registerCommand("my-setup-teardown", {
1775
+ description: "Remove the custom proxy provider",
1776
+ handler: async (_args, _ctx) => {
1777
+ pi.unregisterProvider("my-proxy");
1778
+ },
1779
+ });
1780
+ ```
1781
+
1782
+ ## State Management
1783
+
1784
+ Extensions with state should store it in tool result `details` for proper branching support:
1785
+
1786
+ ```typescript
1787
+ export default function (pi: ExtensionAPI) {
1788
+ let items: string[] = [];
1789
+
1790
+ // Reconstruct state from session
1791
+ pi.on("session_start", async (_event, ctx) => {
1792
+ items = [];
1793
+ for (const entry of ctx.sessionManager.getBranch()) {
1794
+ if (entry.type === "message" && entry.message.role === "toolResult") {
1795
+ if (entry.message.toolName === "my_tool") {
1796
+ items = entry.message.details?.items ?? [];
1797
+ }
1798
+ }
1799
+ }
1800
+ });
1801
+
1802
+ pi.registerTool({
1803
+ name: "my_tool",
1804
+ // ...
1805
+ async execute(toolCallId, params, signal, onUpdate, ctx) {
1806
+ items.push("new item");
1807
+ return {
1808
+ content: [{ type: "text", text: "Added" }],
1809
+ details: { items: [...items] }, // Store for reconstruction
1810
+ };
1811
+ },
1812
+ });
1813
+ }
1814
+ ```
1815
+
1816
+ ## Custom Tools
1817
+
1818
+ Register tools the LLM can call via `pi.registerTool()`. Tools appear in the system prompt and can have custom rendering.
1819
+
1820
+ Use `promptSnippet` for a short one-line entry in the `Available tools` section in the default system prompt. If omitted, custom tools are left out of that section.
1821
+
1822
+ 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 `pi.setActiveTools([...])`).
1823
+
1824
+ **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.
1825
+
1826
+ 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.
1827
+
1828
+ 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.
1829
+
1830
+ Example failure case: your custom tool edits `foo.ts` while built-in `edit` also changes `foo.ts` in the same assistant turn. If your tool does not participate in the queue, both can read the original `foo.ts`, apply separate changes, and one of those changes is lost.
1831
+
1832
+ Pass the real target file path to `withFileMutationQueue()`, not the raw user argument. Resolve it to an absolute path first, relative to `ctx.cwd` or your tool's working directory. For existing files, the helper canonicalizes through `realpath()`, so symlink aliases for the same file share one queue. For new files, it falls back to the resolved absolute path because there is nothing to `realpath()` yet.
1833
+
1834
+ Queue the entire mutation window on that target path. That includes read-modify-write logic, not just the final write.
1835
+
1836
+ ```typescript
1837
+ import { withFileMutationQueue } from "@ashx-j/lunr";
1838
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
1839
+ import { dirname, resolve } from "node:path";
1840
+
1841
+ async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
1842
+ const absolutePath = resolve(ctx.cwd, params.path);
1843
+
1844
+ return withFileMutationQueue(absolutePath, async () => {
1845
+ await mkdir(dirname(absolutePath), { recursive: true });
1846
+ const current = await readFile(absolutePath, "utf8");
1847
+ const next = current.replace(params.oldText, params.newText);
1848
+ await writeFile(absolutePath, next, "utf8");
1849
+
1850
+ return {
1851
+ content: [{ type: "text", text: `Updated ${params.path}` }],
1852
+ details: {},
1853
+ };
1854
+ });
1855
+ }
1856
+ ```
1857
+
1858
+ ### Tool Definition
1859
+
1860
+ ```typescript
1861
+ import { Type } from "typebox";
1862
+ import { StringEnum } from "@ashx-j/lunr-ai";
1863
+ import { Text } from "@ashx-j/lunr-tui";
1864
+
1865
+ pi.registerTool({
1866
+ name: "my_tool",
1867
+ label: "My Tool",
1868
+ description: "What this tool does (shown to LLM)",
1869
+ promptSnippet: "List or add items in the project todo list",
1870
+ promptGuidelines: [
1871
+ "Use my_tool for todo planning instead of direct file edits when the user asks for a task list."
1872
+ ],
1873
+ parameters: Type.Object({
1874
+ action: StringEnum(["list", "add"] as const), // Use StringEnum for Google compatibility
1875
+ text: Type.Optional(Type.String()),
1876
+ }),
1877
+ prepareArguments(args) {
1878
+ if (!args || typeof args !== "object") return args;
1879
+ const input = args as { action?: string; oldAction?: string };
1880
+ if (typeof input.oldAction === "string" && input.action === undefined) {
1881
+ return { ...input, action: input.oldAction };
1882
+ }
1883
+ return args;
1884
+ },
1885
+
1886
+ async execute(toolCallId, params, signal, onUpdate, ctx) {
1887
+ // Check for cancellation
1888
+ if (signal?.aborted) {
1889
+ return { content: [{ type: "text", text: "Cancelled" }] };
1890
+ }
1891
+
1892
+ // Stream progress updates
1893
+ onUpdate?.({
1894
+ content: [{ type: "text", text: "Working..." }],
1895
+ details: { progress: 50 },
1896
+ });
1897
+
1898
+ // Run commands via pi.exec (captured from extension closure)
1899
+ const result = await pi.exec("some-command", [], { signal });
1900
+
1901
+ // Return result
1902
+ return {
1903
+ content: [{ type: "text", text: "Done" }], // Sent to LLM
1904
+ details: { data: result }, // For rendering & state
1905
+ // Optional: stop after this tool batch when every finalized tool result
1906
+ // in the batch also returns terminate: true.
1907
+ terminate: true,
1908
+ };
1909
+ },
1910
+
1911
+ // Optional: Custom rendering
1912
+ renderCall(args, theme, context) { ... },
1913
+ renderResult(result, options, theme, context) { ... },
1914
+ });
1915
+ ```
1916
+
1917
+ **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.
1918
+
1919
+ **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.
1920
+
1921
+ ```typescript
1922
+ // Correct: throw to signal an error
1923
+ async execute(toolCallId, params) {
1924
+ if (!isValid(params.input)) {
1925
+ throw new Error(`Invalid input: ${params.input}`);
1926
+ }
1927
+ return { content: [{ type: "text", text: "OK" }], details: {} };
1928
+ }
1929
+ ```
1930
+
1931
+ **Important:** Use `StringEnum` from `@ashx-j/lunr-ai` for string enums. `Type.Union`/`Type.Literal` doesn't work with Google's API.
1932
+
1933
+ **Argument preparation:** `prepareArguments(args)` is optional. If defined, it runs before schema validation and before `execute()`. Use it to mimic an older accepted input shape when pi resumes an older session whose stored tool call arguments no longer match the current schema. Return the object you want validated against `parameters`. Keep the public schema strict. Do not add deprecated compatibility fields to `parameters` just to keep old resumed sessions working.
1934
+
1935
+ Example: an older session may contain an `edit` tool call with top-level `oldText` and `newText`, while the current schema only accepts `edits: [{ oldText, newText }]`.
1936
+
1937
+ ```typescript
1938
+ pi.registerTool({
1939
+ name: "edit",
1940
+ label: "Edit",
1941
+ description: "Edit a single file using exact text replacement",
1942
+ parameters: Type.Object({
1943
+ path: Type.String(),
1944
+ edits: Type.Array(
1945
+ Type.Object({
1946
+ oldText: Type.String(),
1947
+ newText: Type.String(),
1948
+ }),
1949
+ ),
1950
+ }),
1951
+ prepareArguments(args) {
1952
+ if (!args || typeof args !== "object") return args;
1953
+
1954
+ const input = args as {
1955
+ path?: string;
1956
+ edits?: Array<{ oldText: string; newText: string }>;
1957
+ oldText?: unknown;
1958
+ newText?: unknown;
1959
+ };
1960
+
1961
+ if (typeof input.oldText !== "string" || typeof input.newText !== "string") {
1962
+ return args;
1963
+ }
1964
+
1965
+ return {
1966
+ ...input,
1967
+ edits: [...(input.edits ?? []), { oldText: input.oldText, newText: input.newText }],
1968
+ };
1969
+ },
1970
+ async execute(toolCallId, params, signal, onUpdate, ctx) {
1971
+ // params now matches the current schema
1972
+ return {
1973
+ content: [{ type: "text", text: `Applying ${params.edits.length} edit block(s)` }],
1974
+ details: {},
1975
+ };
1976
+ },
1977
+ });
1978
+ ```
1979
+
1980
+ ### Overriding Built-in Tools
1981
+
1982
+ Extensions can override built-in tools (`read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`) by registering a tool with the same name. Interactive mode displays a warning when this happens.
1983
+
1984
+ ```bash
1985
+ # Extension's read tool replaces built-in read
1986
+ lunr -e ./tool-override.ts
1987
+ ```
1988
+
1989
+ Alternatively, use `--no-builtin-tools` to start without any built-in tools while keeping extension tools enabled:
1990
+ ```bash
1991
+ # No built-in tools, only extension tools
1992
+ lunr --no-builtin-tools -e ./my-extension.ts
1993
+ ```
1994
+
1995
+ See [examples/extensions/tool-override.ts](../examples/extensions/tool-override.ts) for a complete example that overrides `read` with logging and access control.
1996
+
1997
+ **Rendering:** Built-in renderer inheritance is resolved per slot. Execution override and rendering override are independent. If your override omits `renderCall`, the built-in `renderCall` is used. If your override omits `renderResult`, the built-in `renderResult` is used. If your override omits both, the built-in renderer is used automatically (syntax highlighting, diffs, etc.). This lets you wrap built-in tools for logging or access control without reimplementing the UI.
1998
+
1999
+ **Prompt metadata:** `promptSnippet` and `promptGuidelines` are not inherited from the built-in tool. If your override should keep those prompt instructions, define them on the override explicitly.
2000
+
2001
+ **Your implementation must match the exact result shape**, including the `details` type. The UI and session logic depend on these shapes for rendering and state tracking.
2002
+
2003
+ Built-in tool implementations:
2004
+ - [read.ts](https://github.com/ashx-j/lunR/blob/master/packages/coding-agent/src/core/tools/read.ts) - `ReadToolDetails`
2005
+ - [bash.ts](https://github.com/ashx-j/lunR/blob/master/packages/coding-agent/src/core/tools/bash.ts) - `BashToolDetails`
2006
+ - [edit.ts](https://github.com/ashx-j/lunR/blob/master/packages/coding-agent/src/core/tools/edit.ts)
2007
+ - [write.ts](https://github.com/ashx-j/lunR/blob/master/packages/coding-agent/src/core/tools/write.ts)
2008
+ - [grep.ts](https://github.com/ashx-j/lunR/blob/master/packages/coding-agent/src/core/tools/grep.ts) - `GrepToolDetails`
2009
+ - [find.ts](https://github.com/ashx-j/lunR/blob/master/packages/coding-agent/src/core/tools/find.ts) - `FindToolDetails`
2010
+ - [ls.ts](https://github.com/ashx-j/lunR/blob/master/packages/coding-agent/src/core/tools/ls.ts) - `LsToolDetails`
2011
+
2012
+ ### Remote Execution
2013
+
2014
+ Built-in tools support pluggable operations for delegating to remote systems (SSH, containers, etc.):
2015
+
2016
+ ```typescript
2017
+ import { createReadTool, createBashTool, type ReadOperations } from "@ashx-j/lunr";
2018
+
2019
+ // Create tool with custom operations
2020
+ const remoteRead = createReadTool(cwd, {
2021
+ operations: {
2022
+ readFile: (path) => sshExec(remote, `cat ${path}`),
2023
+ access: (path) => sshExec(remote, `test -r ${path}`).then(() => {}),
2024
+ }
2025
+ });
2026
+
2027
+ // Register, checking flag at execution time
2028
+ pi.registerTool({
2029
+ ...remoteRead,
2030
+ async execute(id, params, signal, onUpdate, _ctx) {
2031
+ const ssh = getSshConfig();
2032
+ if (ssh) {
2033
+ const tool = createReadTool(cwd, { operations: createRemoteOps(ssh) });
2034
+ return tool.execute(id, params, signal, onUpdate);
2035
+ }
2036
+ return localRead.execute(id, params, signal, onUpdate);
2037
+ },
2038
+ });
2039
+ ```
2040
+
2041
+ **Operations interfaces:** `ReadOperations`, `WriteOperations`, `EditOperations`, `BashOperations`, `LsOperations`, `GrepOperations`, `FindOperations`
2042
+
2043
+ For `user_bash`, extensions can reuse lunR's local shell backend via `createLocalBashOperations()` instead of reimplementing local process spawning, shell resolution, and process-tree termination.
2044
+
2045
+ The bash tool also supports a spawn hook to adjust the command, cwd, or env before execution:
2046
+
2047
+ ```typescript
2048
+ import { createBashTool } from "@ashx-j/lunr";
2049
+
2050
+ const bashTool = createBashTool(cwd, {
2051
+ spawnHook: ({ command, cwd, env }) => ({
2052
+ command: `source ~/.profile\n${command}`,
2053
+ cwd: `/mnt/sandbox${cwd}`,
2054
+ env: { ...env, CI: "1" },
2055
+ }),
2056
+ });
2057
+ ```
2058
+
2059
+ See [examples/extensions/ssh.ts](../examples/extensions/ssh.ts) for a complete SSH example with `--ssh` flag.
2060
+
2061
+ ### Output Truncation
2062
+
2063
+ **Tools MUST truncate their output** to avoid overwhelming the LLM context. Large outputs can cause:
2064
+ - Context overflow errors (prompt too long)
2065
+ - Compaction failures
2066
+ - Degraded model performance
2067
+
2068
+ The built-in limit is **50KB** (~10k tokens) and **2000 lines**, whichever is hit first. Use the exported truncation utilities:
2069
+
2070
+ ```typescript
2071
+ import {
2072
+ truncateHead, // Keep first N lines/bytes (good for file reads, search results)
2073
+ truncateTail, // Keep last N lines/bytes (good for logs, command output)
2074
+ truncateLine, // Truncate a single line to maxBytes with ellipsis
2075
+ formatSize, // Human-readable size (e.g., "50KB", "1.5MB")
2076
+ DEFAULT_MAX_BYTES, // 50KB
2077
+ DEFAULT_MAX_LINES, // 2000
2078
+ } from "@ashx-j/lunr";
2079
+
2080
+ async execute(toolCallId, params, signal, onUpdate, ctx) {
2081
+ const output = await runCommand();
2082
+
2083
+ // Apply truncation
2084
+ const truncation = truncateHead(output, {
2085
+ maxLines: DEFAULT_MAX_LINES,
2086
+ maxBytes: DEFAULT_MAX_BYTES,
2087
+ });
2088
+
2089
+ let result = truncation.content;
2090
+
2091
+ if (truncation.truncated) {
2092
+ // Write full output to temp file
2093
+ const tempFile = writeTempFile(output);
2094
+
2095
+ // Inform the LLM where to find complete output
2096
+ result += `\n\n[Output truncated: ${truncation.outputLines} of ${truncation.totalLines} lines`;
2097
+ result += ` (${formatSize(truncation.outputBytes)} of ${formatSize(truncation.totalBytes)}).`;
2098
+ result += ` Full output saved to: ${tempFile}]`;
2099
+ }
2100
+
2101
+ return { content: [{ type: "text", text: result }] };
2102
+ }
2103
+ ```
2104
+
2105
+ **Key points:**
2106
+ - Use `truncateHead` for content where the beginning matters (search results, file reads)
2107
+ - Use `truncateTail` for content where the end matters (logs, command output)
2108
+ - Always inform the LLM when output is truncated and where to find the full version
2109
+ - Document the truncation limits in your tool's description
2110
+
2111
+ See [examples/extensions/truncated-tool.ts](../examples/extensions/truncated-tool.ts) for a complete example wrapping `rg` (ripgrep) with proper truncation.
2112
+
2113
+ ### Multiple Tools
2114
+
2115
+ One extension can register multiple tools with shared state:
2116
+
2117
+ ```typescript
2118
+ export default function (pi: ExtensionAPI) {
2119
+ let connection = null;
2120
+
2121
+ pi.registerTool({ name: "db_connect", ... });
2122
+ pi.registerTool({ name: "db_query", ... });
2123
+ pi.registerTool({ name: "db_close", ... });
2124
+
2125
+ pi.on("session_shutdown", async () => {
2126
+ connection?.close();
2127
+ });
2128
+ }
2129
+ ```
2130
+
2131
+ ### Custom Rendering
2132
+
2133
+ Tools can provide `renderCall` and `renderResult` for custom TUI display. See [tui.md](tui.md) for the full component API and [tool-execution.ts](https://github.com/ashx-j/lunR/blob/master/packages/coding-agent/src/modes/interactive/components/tool-execution.ts) for how tool rows are composed.
2134
+
2135
+ By default, tool output is wrapped in a `Box` that handles padding and background. A defined `renderCall` or `renderResult` must return a `Component`. If a slot renderer is not defined, `tool-execution.ts` uses fallback rendering for that slot.
2136
+
2137
+ Set `renderShell: "self"` when the tool should render its own shell instead of using the default `Box`. This is useful for tools that need complete control over framing or background behavior, for example large previews that must stay visually stable after the tool settles.
2138
+
2139
+ ```typescript
2140
+ pi.registerTool({
2141
+ name: "my_tool",
2142
+ label: "My Tool",
2143
+ description: "Custom shell example",
2144
+ parameters: Type.Object({}),
2145
+ renderShell: "self",
2146
+ async execute() {
2147
+ return { content: [{ type: "text", text: "ok" }], details: undefined };
2148
+ },
2149
+ renderCall(args, theme, context) {
2150
+ return new Text(theme.fg("accent", "my custom shell"), 0, 0);
2151
+ },
2152
+ });
2153
+ ```
2154
+
2155
+ `renderCall` and `renderResult` each receive a `context` object with:
2156
+ - `args` - the current tool call arguments
2157
+ - `state` - shared row-local state across `renderCall` and `renderResult`
2158
+ - `lastComponent` - the previously returned component for that slot, if any
2159
+ - `invalidate()` - request a rerender of this tool row
2160
+ - `toolCallId`, `cwd`, `executionStarted`, `argsComplete`, `isPartial`, `expanded`, `showImages`, `isError`
2161
+
2162
+ Use `context.state` for cross-slot shared state. Keep slot-local caches on the returned component instance when you want to reuse and mutate the same component across renders.
2163
+
2164
+ #### renderCall
2165
+
2166
+ Renders the tool call or header:
2167
+
2168
+ ```typescript
2169
+ import { Text } from "@ashx-j/lunr-tui";
2170
+
2171
+ renderCall(args, theme, context) {
2172
+ const text = (context.lastComponent as Text | undefined) ?? new Text("", 0, 0);
2173
+ let content = theme.fg("toolTitle", theme.bold("my_tool "));
2174
+ content += theme.fg("muted", args.action);
2175
+ if (args.text) {
2176
+ content += " " + theme.fg("dim", `"${args.text}"`);
2177
+ }
2178
+ text.setText(content);
2179
+ return text;
2180
+ }
2181
+ ```
2182
+
2183
+ #### renderResult
2184
+
2185
+ Renders the tool result or output:
2186
+
2187
+ ```typescript
2188
+ renderResult(result, { expanded, isPartial }, theme, context) {
2189
+ if (isPartial) {
2190
+ return new Text(theme.fg("warning", "Processing..."), 0, 0);
2191
+ }
2192
+
2193
+ if (result.details?.error) {
2194
+ return new Text(theme.fg("error", `Error: ${result.details.error}`), 0, 0);
2195
+ }
2196
+
2197
+ let text = theme.fg("success", "✓ Done");
2198
+ if (expanded && result.details?.items) {
2199
+ for (const item of result.details.items) {
2200
+ text += "\n " + theme.fg("dim", item);
2201
+ }
2202
+ }
2203
+ return new Text(text, 0, 0);
2204
+ }
2205
+ ```
2206
+
2207
+ If a slot intentionally has no visible content, return an empty `Component` such as an empty `Container`.
2208
+
2209
+ #### Keybinding Hints
2210
+
2211
+ Use `keyHint()` to display keybinding hints that respect the active keybinding configuration:
2212
+
2213
+ ```typescript
2214
+ import { keyHint } from "@ashx-j/lunr";
2215
+
2216
+ renderResult(result, { expanded }, theme, context) {
2217
+ let text = theme.fg("success", "✓ Done");
2218
+ if (!expanded) {
2219
+ text += ` (${keyHint("app.tools.expand", "to expand")})`;
2220
+ }
2221
+ return new Text(text, 0, 0);
2222
+ }
2223
+ ```
2224
+
2225
+ Available functions:
2226
+ - `keyHint(keybinding, description)` - Formats a configured keybinding id such as `"app.tools.expand"` or `"tui.select.confirm"`
2227
+ - `keyText(keybinding)` - Returns the raw configured key text for a keybinding id
2228
+ - `rawKeyHint(key, description)` - Format a raw key string
2229
+
2230
+ Use namespaced keybinding ids:
2231
+ - Coding-agent ids use the `app.*` namespace, for example `app.tools.expand`, `app.editor.external`, `app.session.rename`
2232
+ - Shared TUI ids use the `tui.*` namespace, for example `tui.select.confirm`, `tui.select.cancel`, `tui.input.tab`
2233
+
2234
+ For the exhaustive list of keybinding ids and defaults, see [keybindings.md](keybindings.md). `keybindings.json` uses those same namespaced ids.
2235
+
2236
+ Custom editors and `ctx.ui.custom()` components receive `keybindings: KeybindingsManager` as an injected argument. They should use that injected manager directly instead of calling `getKeybindings()` or `setKeybindings()`.
2237
+
2238
+ #### Best Practices
2239
+
2240
+ - Use `Text` with padding `(0, 0)`. The default Box handles padding.
2241
+ - Use `\n` for multi-line content.
2242
+ - Handle `isPartial` for streaming progress.
2243
+ - Support `expanded` for detail on demand.
2244
+ - Keep default view compact.
2245
+ - Read `context.args` in `renderResult` instead of copying args into `context.state`.
2246
+ - Use `context.state` only for data that must be shared across call and result slots.
2247
+ - Reuse `context.lastComponent` when the same component instance can be updated in place.
2248
+ - Use `renderShell: "self"` only when the default boxed shell gets in the way. In self-shell mode the tool is responsible for its own framing, padding, and background.
2249
+
2250
+ #### Fallback
2251
+
2252
+ If a slot renderer is not defined or throws:
2253
+ - `renderCall`: Shows the tool name
2254
+ - `renderResult`: Shows raw text from `content`
2255
+
2256
+ ### Dynamic Tool Loading
2257
+
2258
+ Extensions can register many tools while keeping only a small initial set active. A tool can then add more tools with `pi.setActiveTools()` during execution. lunR detects purely additive changes, records the newly available tool names on that tool result, and applies the updated active set before the next model request.
2259
+
2260
+ This works with every model. Models with native deferred-loading support preserve the stable prompt prefix and load the new definitions at the tool-result position. Other models use the fallback described below.
2261
+
2262
+ The lifecycle is:
2263
+
2264
+ 1. Register every tool with `pi.registerTool()` so it appears in `pi.getAllTools()`.
2265
+ 2. Keep loader tools, such as `search_tools`, active and leave searchable tools inactive.
2266
+ 3. During loader execution, call `pi.setActiveTools([...currentTools, ...matchingTools])`. The change must be additive: do not remove currently active tools in the same call.
2267
+ 4. lunR records which tools were added on the loader's tool result.
2268
+ 5. Before the next model response, lunR exposes the added definitions using native deferred loading when supported, or the normal active tool list otherwise.
2269
+
2270
+ You do not need to return provider-specific tool references or mark the loader as a special search tool. The active-tool change is the signal. Names passed to `pi.setActiveTools()` must already be registered; unknown names are ignored.
2271
+
2272
+ #### Models with native deferred loading
2273
+
2274
+ - **Anthropic**
2275
+ - **Models:** Sonnet, Opus, Fable version 4.5 or newer (without Haiku)
2276
+ - **Native representation:** Deferred definitions use `defer_loading`; the load point uses `tool_reference` content.
2277
+ - **OpenAI**
2278
+ - **Models:** `gpt-5.4` and newer family
2279
+ - **Native representation:** lunR adds completed client `tool_search_call` and `tool_search_output` items at the load point.
2280
+
2281
+ For a verified custom model or proxy, native handling can be enabled with `compat.supportsToolReferences: true` for `anthropic-messages`, or `compat.supportsToolSearch: true` for `openai-responses` and `openai-codex-responses`. Leave these disabled unless the endpoint and model accept the corresponding native protocol.
2282
+
2283
+ #### Fallback behavior
2284
+
2285
+ For all other models and providers, dynamic activation still works: lunR sends the complete current active tool list normally on the next request. The model can call the newly activated tools, but adding their definitions may invalidate the provider's cached prompt prefix.
2286
+
2287
+ lunR also uses this safe fallback when the active set is not purely additive, such as replacing one group of tools with another. Tool removals therefore work, but they do not use deferred loading.
2288
+
2289
+ For the best cache behavior, keep the loader tool active for the whole session and add tools instead of replacing the active set. Also note that activating a tool with `promptSnippet` or `promptGuidelines` rebuilds the system prompt; that system-prompt change can invalidate the prefix even when the provider supports deferred schemas. Lazily loaded tools should usually rely on their tool `description` and omit active-only prompt metadata.
2290
+
2291
+ #### Search tool example
2292
+
2293
+ The following extension registers two searchable tools, removes them from the initial active set, and keeps only `search_tools` as their loader. The example uses simple keyword matching, but the search implementation could use BM25, embeddings, a remote catalog, or project-specific routing.
2294
+
2295
+ ```typescript
2296
+ import type { ExtensionAPI } from "@ashx-j/lunr";
2297
+ import { Type } from "typebox";
2298
+
2299
+ const SEARCHABLE_TOOL_NAMES = new Set(["lookup_weather", "search_issues"]);
2300
+
2301
+ export default function (pi: ExtensionAPI) {
2302
+ pi.registerTool({
2303
+ name: "lookup_weather",
2304
+ label: "Lookup Weather",
2305
+ description: "Look up the current weather for a city",
2306
+ parameters: Type.Object({ city: Type.String() }),
2307
+ async execute(_toolCallId, params) {
2308
+ return {
2309
+ content: [{ type: "text", text: `Weather for ${params.city}: sunny` }],
2310
+ details: {},
2311
+ };
2312
+ },
2313
+ });
2314
+
2315
+ pi.registerTool({
2316
+ name: "search_issues",
2317
+ label: "Search Issues",
2318
+ description: "Search project issues by keyword",
2319
+ parameters: Type.Object({ query: Type.String() }),
2320
+ async execute(_toolCallId, params) {
2321
+ return {
2322
+ content: [{ type: "text", text: `No open issues matching ${params.query}` }],
2323
+ details: {},
2324
+ };
2325
+ },
2326
+ });
2327
+
2328
+ pi.registerTool({
2329
+ name: "search_tools",
2330
+ label: "Search Tools",
2331
+ description: "Search for and enable tools relevant to a task",
2332
+ promptSnippet: "Search for additional tools when the active tools cannot perform the task",
2333
+ promptGuidelines: [
2334
+ "Use search_tools when a task requires a capability that is not currently available.",
2335
+ ],
2336
+ parameters: Type.Object({
2337
+ query: Type.String({ description: "Capability or task to search for" }),
2338
+ limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 10 })),
2339
+ }),
2340
+ async execute(_toolCallId, params) {
2341
+ const terms = params.query.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);
2342
+ const matches = pi.getAllTools()
2343
+ .filter((tool) => SEARCHABLE_TOOL_NAMES.has(tool.name))
2344
+ .map((tool) => ({
2345
+ tool,
2346
+ score: terms.reduce(
2347
+ (score, term) =>
2348
+ score + (`${tool.name} ${tool.description}`.toLowerCase().includes(term) ? 1 : 0),
2349
+ 0,
2350
+ ),
2351
+ }))
2352
+ .filter((match) => match.score > 0)
2353
+ .sort((a, b) => b.score - a.score)
2354
+ .slice(0, params.limit ?? 3)
2355
+ .map((match) => match.tool.name);
2356
+
2357
+ if (matches.length === 0) {
2358
+ return {
2359
+ content: [{ type: "text", text: `No tools found for: ${params.query}` }],
2360
+ details: { matches: [] },
2361
+ };
2362
+ }
2363
+
2364
+ const active = pi.getActiveTools();
2365
+ const added = matches.filter((name) => !active.includes(name));
2366
+ pi.setActiveTools([...new Set([...active, ...added])]);
2367
+
2368
+ return {
2369
+ content: [{
2370
+ type: "text",
2371
+ text: added.length > 0
2372
+ ? `Loaded tools: ${added.join(", ")}`
2373
+ : `Matching tools already active: ${matches.join(", ")}`,
2374
+ }],
2375
+ details: { matches, added },
2376
+ };
2377
+ },
2378
+ });
2379
+
2380
+ pi.on("session_start", () => {
2381
+ // Keep searchable tools registered but initially inactive. Preserve built-ins
2382
+ // and tools owned by other extensions, and keep the loader itself active.
2383
+ const initialTools = pi.getActiveTools().filter(
2384
+ (name) => !SEARCHABLE_TOOL_NAMES.has(name),
2385
+ );
2386
+ pi.setActiveTools([...new Set([...initialTools, "search_tools"])]);
2387
+ });
2388
+ }
2389
+ ```
2390
+
2391
+ When `search_tools` adds a match, the model receives that definition on the immediately following request. On a native-capable model the definition is anchored after the search result without changing the initial tool-schema prefix. On other models it appears in the normal tool list on that same following request.
2392
+
2393
+ ## Custom UI
2394
+
2395
+ Extensions can interact with users via `ctx.ui` methods and customize how messages/tools render.
2396
+
2397
+ **For custom components, see [tui.md](tui.md)** which has copy-paste patterns for:
2398
+ - Selection dialogs (SelectList)
2399
+ - Async operations with cancel (BorderedLoader)
2400
+ - Settings toggles (SettingsList)
2401
+ - Status indicators (setStatus)
2402
+ - Working message, visibility, and indicator during streaming (`setWorkingMessage`, `setWorkingVisible`, `setWorkingIndicator`)
2403
+ - Widgets above/below editor (setWidget)
2404
+ - Autocomplete providers layered on top of built-in slash/path completion (addAutocompleteProvider)
2405
+ - Custom footers (setFooter)
2406
+
2407
+ ### Dialogs
2408
+
2409
+ ```typescript
2410
+ // Select from options
2411
+ const choice = await ctx.ui.select("Pick one:", ["A", "B", "C"]);
2412
+
2413
+ // Confirm dialog
2414
+ const ok = await ctx.ui.confirm("Delete?", "This cannot be undone");
2415
+
2416
+ // Text input
2417
+ const name = await ctx.ui.input("Name:", "placeholder");
2418
+
2419
+ // Multi-line editor
2420
+ const text = await ctx.ui.editor("Edit:", "prefilled text");
2421
+
2422
+ // Notification (non-blocking)
2423
+ ctx.ui.notify("Done!", "info"); // "info" | "warning" | "error"
2424
+ ```
2425
+
2426
+ #### Timed Dialogs with Countdown
2427
+
2428
+ Dialogs support a `timeout` option that auto-dismisses with a live countdown display:
2429
+
2430
+ ```typescript
2431
+ // Dialog shows "Title (5s)" → "Title (4s)" → ... → auto-dismisses at 0
2432
+ const confirmed = await ctx.ui.confirm(
2433
+ "Timed Confirmation",
2434
+ "This dialog will auto-cancel in 5 seconds. Confirm?",
2435
+ { timeout: 5000 }
2436
+ );
2437
+
2438
+ if (confirmed) {
2439
+ // User confirmed
2440
+ } else {
2441
+ // User cancelled or timed out
2442
+ }
2443
+ ```
2444
+
2445
+ **Return values on timeout:**
2446
+ - `select()` returns `undefined`
2447
+ - `confirm()` returns `false`
2448
+ - `input()` returns `undefined`
2449
+
2450
+ #### Manual Dismissal with AbortSignal
2451
+
2452
+ For more control (e.g., to distinguish timeout from user cancel), use `AbortSignal`:
2453
+
2454
+ ```typescript
2455
+ const controller = new AbortController();
2456
+ const timeoutId = setTimeout(() => controller.abort(), 5000);
2457
+
2458
+ const confirmed = await ctx.ui.confirm(
2459
+ "Timed Confirmation",
2460
+ "This dialog will auto-cancel in 5 seconds. Confirm?",
2461
+ { signal: controller.signal }
2462
+ );
2463
+
2464
+ clearTimeout(timeoutId);
2465
+
2466
+ if (confirmed) {
2467
+ // User confirmed
2468
+ } else if (controller.signal.aborted) {
2469
+ // Dialog timed out
2470
+ } else {
2471
+ // User cancelled (pressed Escape or selected "No")
2472
+ }
2473
+ ```
2474
+
2475
+ See [examples/extensions/timed-confirm.ts](../examples/extensions/timed-confirm.ts) for complete examples.
2476
+
2477
+ ### Widgets, Status, and Footer
2478
+
2479
+ ```typescript
2480
+ // Status in footer (persistent until cleared)
2481
+ ctx.ui.setStatus("my-ext", "Processing...");
2482
+ ctx.ui.setStatus("my-ext", undefined); // Clear
2483
+
2484
+ // Working loader (shown during streaming)
2485
+ ctx.ui.setWorkingMessage("Thinking deeply...");
2486
+ ctx.ui.setWorkingMessage(); // Restore default
2487
+ ctx.ui.setWorkingVisible(false); // Hide the built-in working loader row entirely
2488
+ ctx.ui.setWorkingVisible(true); // Show the built-in working loader row
2489
+
2490
+ // Working indicator (shown during streaming)
2491
+ ctx.ui.setWorkingIndicator({ frames: [ctx.ui.theme.fg("accent", "●")] }); // Static dot
2492
+ ctx.ui.setWorkingIndicator({
2493
+ frames: [
2494
+ ctx.ui.theme.fg("dim", "·"),
2495
+ ctx.ui.theme.fg("muted", "•"),
2496
+ ctx.ui.theme.fg("accent", "●"),
2497
+ ctx.ui.theme.fg("muted", "•"),
2498
+ ],
2499
+ intervalMs: 120,
2500
+ });
2501
+ ctx.ui.setWorkingIndicator({ frames: [] }); // Hide indicator
2502
+ ctx.ui.setWorkingIndicator(); // Restore default spinner
2503
+
2504
+ // Widget above editor (default)
2505
+ ctx.ui.setWidget("my-widget", ["Line 1", "Line 2"]);
2506
+ // Widget below editor
2507
+ ctx.ui.setWidget("my-widget", ["Line 1", "Line 2"], { placement: "belowEditor" });
2508
+ ctx.ui.setWidget("my-widget", (tui, theme) => new Text(theme.fg("accent", "Custom"), 0, 0));
2509
+ ctx.ui.setWidget("my-widget", undefined); // Clear
2510
+
2511
+ // Custom footer (replaces built-in footer entirely)
2512
+ ctx.ui.setFooter((tui, theme) => ({
2513
+ render(width) { return [theme.fg("dim", "Custom footer")]; },
2514
+ invalidate() {},
2515
+ }));
2516
+ ctx.ui.setFooter(undefined); // Restore built-in footer
2517
+
2518
+ // Terminal title
2519
+ ctx.ui.setTitle("pi - my-project");
2520
+
2521
+ // Editor text
2522
+ ctx.ui.setEditorText("Prefill text");
2523
+ const current = ctx.ui.getEditorText();
2524
+
2525
+ // Paste into editor (triggers paste handling, including collapse for large content)
2526
+ ctx.ui.pasteToEditor("pasted content");
2527
+
2528
+ // Stack custom autocomplete behavior on top of the built-in provider
2529
+ ctx.ui.addAutocompleteProvider((current) => ({
2530
+ triggerCharacters: ["#"],
2531
+ async getSuggestions(lines, line, col, options) {
2532
+ const beforeCursor = (lines[line] ?? "").slice(0, col);
2533
+ const match = beforeCursor.match(/(?:^|[ \t])#([^\s#]*)$/);
2534
+ if (!match) {
2535
+ return current.getSuggestions(lines, line, col, options);
2536
+ }
2537
+
2538
+ return {
2539
+ prefix: `#${match[1] ?? ""}`,
2540
+ items: [{ value: "#2983", label: "#2983", description: "Extension API for autocomplete" }],
2541
+ };
2542
+ },
2543
+ applyCompletion(lines, line, col, item, prefix) {
2544
+ return current.applyCompletion(lines, line, col, item, prefix);
2545
+ },
2546
+ shouldTriggerFileCompletion(lines, line, col) {
2547
+ return current.shouldTriggerFileCompletion?.(lines, line, col) ?? true;
2548
+ },
2549
+ }));
2550
+
2551
+ // Tool output expansion
2552
+ const wasExpanded = ctx.ui.getToolsExpanded();
2553
+ ctx.ui.setToolsExpanded(true);
2554
+ ctx.ui.setToolsExpanded(wasExpanded);
2555
+
2556
+ // Custom editor (vim mode, emacs mode, etc.)
2557
+ ctx.ui.setEditorComponent((tui, theme, keybindings) => new VimEditor(tui, theme, keybindings));
2558
+ const currentEditor = ctx.ui.getEditorComponent();
2559
+ ctx.ui.setEditorComponent((tui, theme, keybindings) =>
2560
+ new WrappedEditor(tui, theme, keybindings, currentEditor?.(tui, theme, keybindings))
2561
+ );
2562
+ ctx.ui.setEditorComponent(undefined); // Restore default editor
2563
+
2564
+ // Theme management (see themes.md for creating themes)
2565
+ const themes = ctx.ui.getAllThemes(); // [{ name: "dark", path: "/..." | undefined }, ...]
2566
+ const lightTheme = ctx.ui.getTheme("light"); // Load without switching
2567
+ const result = ctx.ui.setTheme("light"); // Switch by name
2568
+ if (!result.success) {
2569
+ ctx.ui.notify(`Failed: ${result.error}`, "error");
2570
+ }
2571
+ ctx.ui.setTheme(lightTheme!); // Or switch by Theme object
2572
+ ctx.ui.theme.fg("accent", "styled text"); // Access current theme
2573
+ ```
2574
+
2575
+ 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(...)`.
2576
+
2577
+ ### Autocomplete Providers
2578
+
2579
+ Use `ctx.ui.addAutocompleteProvider()` to stack custom autocomplete logic on top of the built-in slash-command and path provider. Set `triggerCharacters` for custom natural triggers such as `$`.
2580
+
2581
+ Typical pattern:
2582
+
2583
+ - inspect the text before the cursor
2584
+ - return your own suggestions when your extension-specific syntax matches
2585
+ - otherwise delegate to `current.getSuggestions(...)`
2586
+ - delegate `applyCompletion(...)` unless you need custom insertion behavior
2587
+
2588
+ ```typescript
2589
+ pi.on("session_start", (_event, ctx) => {
2590
+ ctx.ui.addAutocompleteProvider((current) => ({
2591
+ triggerCharacters: ["#"],
2592
+ async getSuggestions(lines, cursorLine, cursorCol, options) {
2593
+ const line = lines[cursorLine] ?? "";
2594
+ const beforeCursor = line.slice(0, cursorCol);
2595
+ const match = beforeCursor.match(/(?:^|[ \t])#([^\s#]*)$/);
2596
+ if (!match) {
2597
+ return current.getSuggestions(lines, cursorLine, cursorCol, options);
2598
+ }
2599
+
2600
+ return {
2601
+ prefix: `#${match[1] ?? ""}`,
2602
+ items: [
2603
+ { value: "#2983", label: "#2983", description: "Extension API for registering custom @ autocomplete providers" },
2604
+ { value: "#2753", label: "#2753", description: "Reload stale resource settings" },
2605
+ ],
2606
+ };
2607
+ },
2608
+
2609
+ applyCompletion(lines, cursorLine, cursorCol, item, prefix) {
2610
+ return current.applyCompletion(lines, cursorLine, cursorCol, item, prefix);
2611
+ },
2612
+
2613
+ shouldTriggerFileCompletion(lines, cursorLine, cursorCol) {
2614
+ return current.shouldTriggerFileCompletion?.(lines, cursorLine, cursorCol) ?? true;
2615
+ },
2616
+ }));
2617
+ });
2618
+ ```
2619
+
2620
+ 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.
2621
+
2622
+ ### Custom Components
2623
+
2624
+ For complex UI, use `ctx.ui.custom()`. This temporarily replaces the editor with your component until `done()` is called:
2625
+
2626
+ ```typescript
2627
+ import { Text, Component } from "@ashx-j/lunr-tui";
2628
+
2629
+ const result = await ctx.ui.custom<boolean>((tui, theme, keybindings, done) => {
2630
+ const text = new Text("Press Enter to confirm, Escape to cancel", 1, 1);
2631
+
2632
+ text.onKey = (key) => {
2633
+ if (key === "return") done(true);
2634
+ if (key === "escape") done(false);
2635
+ return true;
2636
+ };
2637
+
2638
+ return text;
2639
+ });
2640
+
2641
+ if (result) {
2642
+ // User pressed Enter
2643
+ }
2644
+ ```
2645
+
2646
+ The callback receives:
2647
+ - `tui` - TUI instance (for screen dimensions, focus management)
2648
+ - `theme` - Current theme for styling
2649
+ - `keybindings` - App keybinding manager (for checking shortcuts)
2650
+ - `done(value)` - Call to close component and return value
2651
+
2652
+ See [tui.md](tui.md) for the full component API.
2653
+
2654
+ #### Overlay Mode (Experimental)
2655
+
2656
+ Pass `{ overlay: true }` to render the component as a floating modal on top of existing content, without clearing the screen:
2657
+
2658
+ ```typescript
2659
+ const result = await ctx.ui.custom<string | null>(
2660
+ (tui, theme, keybindings, done) => new MyOverlayComponent({ onClose: done }),
2661
+ { overlay: true }
2662
+ );
2663
+ ```
2664
+
2665
+ For advanced positioning (anchors, margins, percentages, responsive visibility), pass `overlayOptions`. Use `onHandle` to control focus or visibility programmatically:
2666
+
2667
+ ```typescript
2668
+ const result = await ctx.ui.custom<string | null>(
2669
+ (tui, theme, keybindings, done) => new MyOverlayComponent({ onClose: done }),
2670
+ {
2671
+ overlay: true,
2672
+ overlayOptions: { anchor: "top-right", width: "50%", margin: 2 },
2673
+ onHandle: (handle) => {
2674
+ handle.focus(); // focus this overlay and bring it to the visual front
2675
+ // handle.unfocus({ target: editorComponent }); // release input to a specific component
2676
+ // handle.setHidden(true/false); // toggle visibility
2677
+ // handle.hide(); // permanently remove
2678
+ }
2679
+ }
2680
+ );
2681
+ ```
2682
+
2683
+ A focused visible overlay can reclaim input after temporary non-overlay custom UI closes. If you intentionally want another component to keep input while the overlay stays visible, call `handle.unfocus({ target })`. Passing `{ target: null }` releases the overlay without focusing another component.
2684
+
2685
+ See [tui.md](tui.md) for the full `OverlayOptions` and `OverlayHandle` API and [overlay-qa-tests.ts](../examples/extensions/overlay-qa-tests.ts) for examples.
2686
+
2687
+ ### Custom Editor
2688
+
2689
+ Replace the main input editor with a custom implementation (vim mode, emacs mode, etc.):
2690
+
2691
+ ```typescript
2692
+ import { CustomEditor, type ExtensionAPI } from "@ashx-j/lunr";
2693
+ import { matchesKey } from "@ashx-j/lunr-tui";
2694
+
2695
+ class VimEditor extends CustomEditor {
2696
+ private mode: "normal" | "insert" = "insert";
2697
+
2698
+ handleInput(data: string): void {
2699
+ if (matchesKey(data, "escape") && this.mode === "insert") {
2700
+ this.mode = "normal";
2701
+ return;
2702
+ }
2703
+ if (this.mode === "normal" && data === "i") {
2704
+ this.mode = "insert";
2705
+ return;
2706
+ }
2707
+ super.handleInput(data); // App keybindings + text editing
2708
+ }
2709
+ }
2710
+
2711
+ export default function (pi: ExtensionAPI) {
2712
+ pi.on("session_start", (_event, ctx) => {
2713
+ ctx.ui.setEditorComponent((_tui, theme, keybindings) =>
2714
+ new VimEditor(theme, keybindings)
2715
+ );
2716
+ });
2717
+ }
2718
+ ```
2719
+
2720
+ **Key points:**
2721
+ - Extend `CustomEditor` (not base `Editor`) to get app keybindings (escape to abort, ctrl+d, model switching)
2722
+ - Call `super.handleInput(data)` for keys you don't handle
2723
+ - Factory receives `theme` and `keybindings` from the app
2724
+ - Use `ctx.ui.getEditorComponent()` before `setEditorComponent()` to wrap the previously configured custom editor
2725
+ - Pass `undefined` to restore default: `ctx.ui.setEditorComponent(undefined)`
2726
+
2727
+ To compose with another extension that already replaced the editor, capture the previous factory before setting yours:
2728
+
2729
+ ```typescript
2730
+ const previous = ctx.ui.getEditorComponent();
2731
+ ctx.ui.setEditorComponent((tui, theme, keybindings) =>
2732
+ new MyEditor(tui, theme, keybindings, { base: previous?.(tui, theme, keybindings) })
2733
+ );
2734
+ ```
2735
+
2736
+ See [tui.md](tui.md) Pattern 7 for a complete example with mode indicator.
2737
+
2738
+ ### Message and Entry Rendering
2739
+
2740
+ Register a custom renderer for messages with your `customType`. Use message renderers for content that should participate in LLM context:
2741
+
2742
+ ```typescript
2743
+ import { Text } from "@ashx-j/lunr-tui";
2744
+
2745
+ pi.registerMessageRenderer("my-extension", (message, options, theme) => {
2746
+ const { expanded } = options;
2747
+ let text = theme.fg("accent", `[${message.customType}] `);
2748
+ text += message.content;
2749
+
2750
+ if (expanded && message.details) {
2751
+ text += "\n" + theme.fg("dim", JSON.stringify(message.details, null, 2));
2752
+ }
2753
+
2754
+ return new Text(text, 0, 0);
2755
+ });
2756
+ ```
2757
+
2758
+ Messages are sent via `pi.sendMessage()`:
2759
+
2760
+ ```typescript
2761
+ pi.sendMessage({
2762
+ customType: "my-extension", // Matches registerMessageRenderer
2763
+ content: "Status update",
2764
+ display: true, // Show in TUI
2765
+ details: { ... }, // Available in renderer
2766
+ });
2767
+ ```
2768
+
2769
+ For TUI-only content that should not be sent to the LLM, render custom entries instead:
2770
+
2771
+ ```typescript
2772
+ pi.registerEntryRenderer("my-card", (entry, options, theme) => {
2773
+ return new Text(theme.fg("accent", JSON.stringify(entry.data)));
2774
+ });
2775
+
2776
+ pi.appendEntry("my-card", { status: "done" });
2777
+ ```
2778
+
2779
+ ### Theme Colors
2780
+
2781
+ All render functions receive a `theme` object. See [themes.md](themes.md) for creating custom themes and the full color palette.
2782
+
2783
+ ```typescript
2784
+ // Foreground colors
2785
+ theme.fg("toolTitle", text) // Tool names
2786
+ theme.fg("accent", text) // Highlights
2787
+ theme.fg("success", text) // Success (green)
2788
+ theme.fg("error", text) // Errors (red)
2789
+ theme.fg("warning", text) // Warnings (yellow)
2790
+ theme.fg("muted", text) // Secondary text
2791
+ theme.fg("dim", text) // Tertiary text
2792
+
2793
+ // Text styles
2794
+ theme.bold(text)
2795
+ theme.italic(text)
2796
+ theme.strikethrough(text)
2797
+ ```
2798
+
2799
+ For syntax highlighting in custom tool renderers:
2800
+
2801
+ ```typescript
2802
+ import { highlightCode, getLanguageFromPath } from "@ashx-j/lunr";
2803
+
2804
+ // Highlight code with explicit language
2805
+ const highlighted = highlightCode("const x = 1;", "typescript", theme);
2806
+
2807
+ // Auto-detect language from file path
2808
+ const lang = getLanguageFromPath("/path/to/file.rs"); // "rust"
2809
+ const highlighted = highlightCode(code, lang, theme);
2810
+ ```
2811
+
2812
+ ## Error Handling
2813
+
2814
+ - Extension errors are logged, agent continues
2815
+ - `tool_call` errors block the tool (fail-safe)
2816
+ - Tool `execute` errors must be signaled by throwing; the thrown error is caught, reported to the LLM with `isError: true`, and execution continues
2817
+
2818
+ ## Mode Behavior
2819
+
2820
+ | Mode | `ctx.mode` | `ctx.hasUI` | Notes |
2821
+ |------|------------|-------------|-------|
2822
+ | Interactive | `"tui"` | `true` | Full TUI with terminal rendering |
2823
+ | RPC (`--mode rpc`) | `"rpc"` | `true` | Dialogs and notifications via JSON protocol; `custom()` returns `undefined`. See [rpc.md](rpc.md) |
2824
+ | JSON (`--mode json`) | `"json"` | `false` | Event stream to stdout; UI methods are no-ops |
2825
+ | Print (`-p`) | `"print"` | `false` | Extensions run but can't prompt |
2826
+
2827
+ Use `ctx.mode === "tui"` before TUI-specific features (`custom()`, component factories, terminal input). Use `ctx.hasUI` before dialog and notification methods that work in both TUI and RPC modes.
2828
+
2829
+ ## Examples Reference
2830
+
2831
+ All examples in [examples/extensions/](../examples/extensions/).
2832
+
2833
+ | Example | Description | Key APIs |
2834
+ |---------|-------------|----------|
2835
+ | **Tools** |||
2836
+ | `hello.ts` | Minimal tool registration | `registerTool` |
2837
+ | `question.ts` | Tool with user interaction | `registerTool`, `ui.select` |
2838
+ | `questionnaire.ts` | Multi-step wizard tool | `registerTool`, `ui.custom` |
2839
+ | `todo.ts` | Stateful tool with persistence | `registerTool`, `appendEntry`, `renderResult`, session events |
2840
+ | `dynamic-tools.ts` | Register tools after startup and during commands | `registerTool`, `session_start`, `registerCommand` |
2841
+ | `structured-output.ts` | Final structured-output tool with `terminate: true` | `registerTool`, terminating tool results |
2842
+ | `truncated-tool.ts` | Output truncation example | `registerTool`, `truncateHead` |
2843
+ | `tool-override.ts` | Override built-in read tool | `registerTool` (same name as built-in) |
2844
+ | **Commands** |||
2845
+ | `pirate.ts` | Modify system prompt per-turn | `registerCommand`, `before_agent_start` |
2846
+ | `summarize.ts` | Conversation summary command | `registerCommand`, `ui.custom` |
2847
+ | `handoff.ts` | Cross-provider model handoff | `registerCommand`, `ui.editor`, `ui.custom` |
2848
+ | `qna.ts` | Q&A with custom UI | `registerCommand`, `ui.custom`, `setEditorText` |
2849
+ | `send-user-message.ts` | Inject user messages | `registerCommand`, `sendUserMessage` |
2850
+ | `reload-runtime.ts` | Reload command and LLM tool handoff | `registerCommand`, `ctx.reload()`, `sendUserMessage` |
2851
+ | `shutdown-command.ts` | Graceful shutdown command | `registerCommand`, `shutdown()` |
2852
+ | **Events & Gates** |||
2853
+ | `permission-gate.ts` | Block dangerous commands | `on("tool_call")`, `ui.confirm` |
2854
+ | `project-trust.ts` | Decide or defer project trust from a user/global or CLI extension | `on("project_trust")`, trust UI, required trust result |
2855
+ | `protected-paths.ts` | Block writes to specific paths | `on("tool_call")` |
2856
+ | `confirm-destructive.ts` | Confirm session changes | `on("session_before_switch")`, `on("session_before_fork")` |
2857
+ | `dirty-repo-guard.ts` | Warn on dirty git repo | `on("session_before_*")`, `exec` |
2858
+ | `input-transform.ts` | Transform user input | `on("input")` |
2859
+ | `input-transform-streaming.ts` | Streaming-aware input transform | `on("input")`, `streamingBehavior` |
2860
+ | `model-status.ts` | React to model changes | `on("model_select")`, `setStatus` |
2861
+ | `provider-payload.ts` | Inspect payloads and provider response headers | `on("before_provider_request")`, `on("after_provider_response")` |
2862
+ | `system-prompt-header.ts` | Display system prompt info | `on("agent_start")`, `getSystemPrompt` |
2863
+ | `claude-rules.ts` | Load rules from files | `on("session_start")`, `on("before_agent_start")` |
2864
+ | `prompt-customizer.ts` | Add context-aware tool guidance using `systemPromptOptions` | `on("before_agent_start")`, `BuildSystemPromptOptions` |
2865
+ | `file-trigger.ts` | File watcher triggers messages | `sendMessage` |
2866
+ | **Compaction & Sessions** |||
2867
+ | `custom-compaction.ts` | Custom compaction summary | `on("session_before_compact")` |
2868
+ | `trigger-compact.ts` | Trigger compaction manually | `compact()` |
2869
+ | `git-checkpoint.ts` | Git stash on turns | `on("turn_start")`, `on("session_before_fork")`, `exec` |
2870
+ | `git-merge-and-resolve.ts` | Fetch, merge, and resolve conflicts | `on("agent_end")`, `exec`, `sendUserMessage` |
2871
+ | `auto-commit-on-exit.ts` | Commit on shutdown | `on("session_shutdown")`, `exec` |
2872
+ | **UI Components** |||
2873
+ | `status-line.ts` | Footer status indicator | `setStatus`, session events |
2874
+ | `working-indicator.ts` | Customize the streaming working indicator | `setWorkingIndicator`, `registerCommand` |
2875
+ | `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` |
2876
+ | `custom-footer.ts` | Replace footer entirely | `registerCommand`, `setFooter` |
2877
+ | `custom-header.ts` | Replace startup header | `on("session_start")`, `setHeader` |
2878
+ | `modal-editor.ts` | Vim-style modal editor | `setEditorComponent`, `CustomEditor` |
2879
+ | `rainbow-editor.ts` | Custom editor styling | `setEditorComponent` |
2880
+ | `widget-placement.ts` | Widget above/below editor | `setWidget` |
2881
+ | `overlay-test.ts` | Overlay components | `ui.custom` with overlay options |
2882
+ | `overlay-qa-tests.ts` | Comprehensive overlay tests | `ui.custom`, all overlay options |
2883
+ | `notify.ts` | Simple notifications | `ui.notify` |
2884
+ | `timed-confirm.ts` | Dialogs with timeout | `ui.confirm` with timeout/signal |
2885
+ | `mac-system-theme.ts` | Auto-switch theme | `setTheme`, `exec` |
2886
+ | **Complex Extensions** |||
2887
+ | `plan-mode/` | Full plan mode implementation | All event types, `registerCommand`, `registerShortcut`, `registerFlag`, `setStatus`, `setWidget`, `sendMessage`, `setActiveTools` |
2888
+ | `preset.ts` | Saveable presets (model, tools, thinking) | `registerCommand`, `registerShortcut`, `registerFlag`, `setModel`, `setActiveTools`, `setThinkingLevel`, `appendEntry` |
2889
+ | `tools.ts` | Toggle tools on/off UI | `registerCommand`, `setActiveTools`, `SettingsList`, session events |
2890
+ | **Remote & Sandbox** |||
2891
+ | `ssh.ts` | SSH remote execution | `registerFlag`, `on("user_bash")`, `on("before_agent_start")`, tool operations |
2892
+ | `interactive-shell.ts` | Persistent shell session | `on("user_bash")` |
2893
+ | `sandbox/` | Sandboxed tool execution | Tool operations |
2894
+ | `gondolin/` | Route built-in tools and `!` commands into a Gondolin micro-VM | Tool operations, built-in tool overrides, `on("user_bash")` |
2895
+ | `subagent/` | Spawn sub-agents | `registerTool`, `exec` |
2896
+ | **Games** |||
2897
+ | `snake.ts` | Snake game | `registerCommand`, `ui.custom`, keyboard handling |
2898
+ | `space-invaders.ts` | Space Invaders game | `registerCommand`, `ui.custom` |
2899
+ | `doom-overlay/` | Doom in overlay | `ui.custom` with overlay |
2900
+ | **Providers** |||
2901
+ | `custom-provider-anthropic/` | Custom Anthropic proxy | `registerProvider` |
2902
+ | `custom-provider-gitlab-duo/` | GitLab Duo integration | `registerProvider` with OAuth |
2903
+ | **Messages & Communication** |||
2904
+ | `message-renderer.ts` | Custom message rendering | `registerMessageRenderer`, `sendMessage` |
2905
+ | `entry-renderer.ts` | TUI-only custom entry rendering | `registerEntryRenderer`, `appendEntry` |
2906
+ | `event-bus.ts` | Inter-extension events | `pi.events` |
2907
+ | **Session Metadata** |||
2908
+ | `session-name.ts` | Name sessions for selector | `setSessionName`, `getSessionName` |
2909
+ | `bookmark.ts` | Bookmark entries for /tree | `setLabel` |
2910
+ | **Misc** |||
2911
+ | `inline-bash.ts` | Inline bash in tool calls | `on("tool_call")` |
2912
+ | `bash-spawn-hook.ts` | Adjust bash command, cwd, and env before execution | `createBashTool`, `spawnHook` |
2913
+ | `with-deps/` | Extension with npm dependencies | Package structure with `package.json` |