@ashx-j/lunr-dev 0.2.13-dev.7.1 → 0.2.16-dev.9.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 (384) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/dist/builtin-extensions/ashxj-tui.d.ts +14 -0
  3. package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
  4. package/dist/builtin-extensions/ashxj-tui.js +37 -3
  5. package/dist/builtin-extensions/ashxj-tui.js.map +1 -1
  6. package/dist/builtin-extensions/index.d.ts +1 -15
  7. package/dist/builtin-extensions/index.d.ts.map +1 -1
  8. package/dist/builtin-extensions/index.js +7 -21
  9. package/dist/builtin-extensions/index.js.map +1 -1
  10. package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.d.ts.map +1 -1
  11. package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.js +6 -2
  12. package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.js.map +1 -1
  13. package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts +4 -0
  14. package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts.map +1 -1
  15. package/dist/builtin-extensions/pi-lsp-extension/src/index.js +163 -169
  16. package/dist/builtin-extensions/pi-lsp-extension/src/index.js.map +1 -1
  17. package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts +46 -0
  18. package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts.map +1 -0
  19. package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js +109 -0
  20. package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js.map +1 -0
  21. package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.d.ts +7 -0
  22. package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.d.ts.map +1 -0
  23. package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.js +211 -0
  24. package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.js.map +1 -0
  25. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts +0 -5
  26. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts.map +1 -1
  27. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js +0 -202
  28. package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js.map +1 -1
  29. package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -1
  30. package/dist/builtin-extensions/pi-mcp-adapter/index.js +251 -94
  31. package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
  32. package/dist/builtin-extensions/pi-mcp-adapter/init.d.ts +4 -1
  33. package/dist/builtin-extensions/pi-mcp-adapter/init.d.ts.map +1 -1
  34. package/dist/builtin-extensions/pi-mcp-adapter/init.js +10 -3
  35. package/dist/builtin-extensions/pi-mcp-adapter/init.js.map +1 -1
  36. package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.d.ts.map +1 -1
  37. package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.js +6 -1
  38. package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.js.map +1 -1
  39. package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.d.ts.map +1 -1
  40. package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js +2 -1
  41. package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js.map +1 -1
  42. package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.d.ts +1 -1
  43. package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.d.ts.map +1 -1
  44. package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js +1 -1
  45. package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js.map +1 -1
  46. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +1 -1
  47. package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
  48. package/dist/builtin-extensions/pi-subagents/src/extension/index.js +38 -14
  49. package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
  50. package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.d.ts.map +1 -1
  51. package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.js +1 -1
  52. package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.js.map +1 -1
  53. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts +1 -1
  54. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts.map +1 -1
  55. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js +1 -1
  56. package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js.map +1 -1
  57. package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +1 -1
  58. package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
  59. package/dist/builtin-extensions/pi-subagents/src/tui/render.js +2 -1
  60. package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
  61. package/dist/builtin-extensions/pi-subagents/src/watchdog/review.d.ts +1 -1
  62. package/dist/builtin-extensions/pi-subagents/src/watchdog/review.d.ts.map +1 -1
  63. package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js +2 -1
  64. package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js.map +1 -1
  65. package/dist/builtin-extensions/pi-web-access/extract.d.ts.map +1 -1
  66. package/dist/builtin-extensions/pi-web-access/extract.js +105 -54
  67. package/dist/builtin-extensions/pi-web-access/extract.js.map +1 -1
  68. package/dist/builtin-extensions/pi-web-access/gemini-search.d.ts +1 -1
  69. package/dist/builtin-extensions/pi-web-access/gemini-search.d.ts.map +1 -1
  70. package/dist/builtin-extensions/pi-web-access/gemini-search.js +82 -65
  71. package/dist/builtin-extensions/pi-web-access/gemini-search.js.map +1 -1
  72. package/dist/builtin-extensions/pi-web-access/github-extract.d.ts.map +1 -1
  73. package/dist/builtin-extensions/pi-web-access/github-extract.js +2 -0
  74. package/dist/builtin-extensions/pi-web-access/github-extract.js.map +1 -1
  75. package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
  76. package/dist/builtin-extensions/pi-web-access/index.js +167 -77
  77. package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
  78. package/dist/builtin-extensions/pi-web-access/lazy.d.ts +18 -0
  79. package/dist/builtin-extensions/pi-web-access/lazy.d.ts.map +1 -0
  80. package/dist/builtin-extensions/pi-web-access/lazy.js +19 -0
  81. package/dist/builtin-extensions/pi-web-access/lazy.js.map +1 -0
  82. package/dist/builtin-extensions/pi-web-access/session-cleanup.d.ts +6 -0
  83. package/dist/builtin-extensions/pi-web-access/session-cleanup.d.ts.map +1 -0
  84. package/dist/builtin-extensions/pi-web-access/session-cleanup.js +17 -0
  85. package/dist/builtin-extensions/pi-web-access/session-cleanup.js.map +1 -0
  86. package/dist/catalog/models.json +1 -1
  87. package/dist/catalog/providers/amazon-bedrock.json +1 -1
  88. package/dist/catalog/providers/azure-openai-responses.json +1 -1
  89. package/dist/catalog/providers/fireworks.json +1 -1
  90. package/dist/catalog/providers/github-copilot.json +1 -1
  91. package/dist/catalog/providers/openai-codex.json +1 -1
  92. package/dist/catalog/providers/openai.json +1 -1
  93. package/dist/catalog/providers/opencode.json +1 -1
  94. package/dist/catalog/providers/openrouter.json +1 -1
  95. package/dist/catalog/providers/vercel-ai-gateway.json +1 -1
  96. package/dist/catalog/publication.json +131 -3
  97. package/dist/cli/list-models.d.ts.map +1 -1
  98. package/dist/cli/list-models.js +1 -0
  99. package/dist/cli/list-models.js.map +1 -1
  100. package/dist/cli-runtime.d.ts +3 -0
  101. package/dist/cli-runtime.d.ts.map +1 -0
  102. package/dist/cli-runtime.js +73 -0
  103. package/dist/cli-runtime.js.map +1 -0
  104. package/dist/cli.d.ts.map +1 -1
  105. package/dist/cli.js +14 -53
  106. package/dist/cli.js.map +1 -1
  107. package/dist/config.d.ts +1 -0
  108. package/dist/config.d.ts.map +1 -1
  109. package/dist/config.js +1 -0
  110. package/dist/config.js.map +1 -1
  111. package/dist/core/agent-session.d.ts +3 -0
  112. package/dist/core/agent-session.d.ts.map +1 -1
  113. package/dist/core/agent-session.js +56 -12
  114. package/dist/core/agent-session.js.map +1 -1
  115. package/dist/core/catalog-cache-scope.d.ts +3 -0
  116. package/dist/core/catalog-cache-scope.d.ts.map +1 -0
  117. package/dist/core/catalog-cache-scope.js +12 -0
  118. package/dist/core/catalog-cache-scope.js.map +1 -0
  119. package/dist/core/catalog-merge.d.ts +2 -0
  120. package/dist/core/catalog-merge.d.ts.map +1 -1
  121. package/dist/core/catalog-merge.js +29 -2
  122. package/dist/core/catalog-merge.js.map +1 -1
  123. package/dist/core/catalog-refresh-polling.d.ts +8 -0
  124. package/dist/core/catalog-refresh-polling.d.ts.map +1 -0
  125. package/dist/core/catalog-refresh-polling.js +30 -0
  126. package/dist/core/catalog-refresh-polling.js.map +1 -0
  127. package/dist/core/codex-catalog.d.ts +3 -0
  128. package/dist/core/codex-catalog.d.ts.map +1 -0
  129. package/dist/core/codex-catalog.js +15 -0
  130. package/dist/core/codex-catalog.js.map +1 -0
  131. package/dist/core/compaction/compaction.d.ts.map +1 -1
  132. package/dist/core/compaction/compaction.js +10 -5
  133. package/dist/core/compaction/compaction.js.map +1 -1
  134. package/dist/core/extensions/host-static.d.ts.map +1 -1
  135. package/dist/core/extensions/host-static.js +34 -12
  136. package/dist/core/extensions/host-static.js.map +1 -1
  137. package/dist/core/extensions/loader.d.ts +1 -2
  138. package/dist/core/extensions/loader.d.ts.map +1 -1
  139. package/dist/core/extensions/loader.js +10 -64
  140. package/dist/core/extensions/loader.js.map +1 -1
  141. package/dist/core/extensions/types.d.ts +2 -2
  142. package/dist/core/extensions/types.d.ts.map +1 -1
  143. package/dist/core/extensions/types.js.map +1 -1
  144. package/dist/core/footer-data-provider.d.ts.map +1 -1
  145. package/dist/core/footer-data-provider.js +2 -0
  146. package/dist/core/footer-data-provider.js.map +1 -1
  147. package/dist/core/live-catalog.d.ts +5 -2
  148. package/dist/core/live-catalog.d.ts.map +1 -1
  149. package/dist/core/live-catalog.js +108 -27
  150. package/dist/core/live-catalog.js.map +1 -1
  151. package/dist/core/model-runtime.d.ts +8 -0
  152. package/dist/core/model-runtime.d.ts.map +1 -1
  153. package/dist/core/model-runtime.js +64 -12
  154. package/dist/core/model-runtime.js.map +1 -1
  155. package/dist/core/official-catalog.d.ts +4 -0
  156. package/dist/core/official-catalog.d.ts.map +1 -1
  157. package/dist/core/official-catalog.js +86 -21
  158. package/dist/core/official-catalog.js.map +1 -1
  159. package/dist/core/permissions.d.ts +0 -2
  160. package/dist/core/permissions.d.ts.map +1 -1
  161. package/dist/core/permissions.js +10 -18
  162. package/dist/core/permissions.js.map +1 -1
  163. package/dist/core/sdk.d.ts +1 -1
  164. package/dist/core/sdk.d.ts.map +1 -1
  165. package/dist/core/sdk.js +1 -1
  166. package/dist/core/sdk.js.map +1 -1
  167. package/dist/core/slash-commands.d.ts.map +1 -1
  168. package/dist/core/slash-commands.js +0 -1
  169. package/dist/core/slash-commands.js.map +1 -1
  170. package/dist/core/timings.d.ts +2 -1
  171. package/dist/core/timings.d.ts.map +1 -1
  172. package/dist/core/timings.js +17 -2
  173. package/dist/core/timings.js.map +1 -1
  174. package/dist/gateway/commands.d.ts +1 -1
  175. package/dist/gateway/commands.d.ts.map +1 -1
  176. package/dist/gateway/commands.js +1 -18
  177. package/dist/gateway/commands.js.map +1 -1
  178. package/dist/main.d.ts +2 -2
  179. package/dist/main.d.ts.map +1 -1
  180. package/dist/main.js +66 -48
  181. package/dist/main.js.map +1 -1
  182. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  183. package/dist/modes/interactive/components/model-selector.js +4 -1
  184. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  185. package/dist/modes/interactive/interactive-mode.d.ts +13 -22
  186. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  187. package/dist/modes/interactive/interactive-mode.js +141 -207
  188. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  189. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  190. package/dist/modes/interactive/theme/theme.js +95 -84
  191. package/dist/modes/interactive/theme/theme.js.map +1 -1
  192. package/dist/node-runtime/agent-session-services-IFJMSX7Z.js +36 -0
  193. package/dist/node-runtime/benchmark-request-UC7PD3V3.js +57 -0
  194. package/dist/node-runtime/brave-UWDA3I22.js +143 -0
  195. package/dist/node-runtime/builtin-extensions-LYZ3BFWQ.js +28 -0
  196. package/dist/node-runtime/chunk-2QKLKMKC.js +173 -0
  197. package/dist/node-runtime/chunk-3GHXVUAK.js +21 -0
  198. package/dist/node-runtime/chunk-3RCWXWAY.js +466 -0
  199. package/dist/node-runtime/chunk-3WFAEVKS.js +115 -0
  200. package/dist/node-runtime/chunk-3X3KZKMI.js +49 -0
  201. package/dist/node-runtime/chunk-4HXHDDCF.js +16 -0
  202. package/dist/node-runtime/chunk-4TLO4PO2.js +3427 -0
  203. package/dist/node-runtime/chunk-4ZWGEEAS.js +69 -0
  204. package/dist/node-runtime/chunk-53YJI7JU.js +137 -0
  205. package/dist/node-runtime/chunk-5P7PZMRU.js +610 -0
  206. package/dist/node-runtime/chunk-7N3YHTYF.js +26 -0
  207. package/dist/node-runtime/chunk-7NBZ5P7I.js +24 -0
  208. package/dist/node-runtime/chunk-A2KQXUJD.js +105 -0
  209. package/dist/node-runtime/chunk-AD6VXAO7.js +342 -0
  210. package/dist/node-runtime/chunk-AHSTJBIB.js +64 -0
  211. package/dist/node-runtime/chunk-AJX357CL.js +20211 -0
  212. package/dist/node-runtime/chunk-ARC4KOTI.js +11178 -0
  213. package/dist/node-runtime/chunk-AUXVGBO4.js +19 -0
  214. package/dist/node-runtime/chunk-AY6CAJSL.js +30 -0
  215. package/dist/node-runtime/chunk-BHO7O6E5.js +296 -0
  216. package/dist/node-runtime/chunk-BI3DHYCN.js +8845 -0
  217. package/dist/node-runtime/chunk-BR7YDUKA.js +109 -0
  218. package/dist/node-runtime/chunk-BRJX2PRC.js +53 -0
  219. package/dist/node-runtime/chunk-C4O2RSQQ.js +37 -0
  220. package/dist/node-runtime/chunk-CCZJ3PYY.js +17 -0
  221. package/dist/node-runtime/chunk-CDFZEWPU.js +8388 -0
  222. package/dist/node-runtime/chunk-CGBXPL3E.js +1171 -0
  223. package/dist/node-runtime/chunk-CJECDQKP.js +19 -0
  224. package/dist/node-runtime/chunk-DAPBPCBP.js +53 -0
  225. package/dist/node-runtime/chunk-DDGMHUOW.js +305 -0
  226. package/dist/node-runtime/chunk-DMMTJQMQ.js +43 -0
  227. package/dist/node-runtime/chunk-DVGWF6A2.js +1180 -0
  228. package/dist/node-runtime/chunk-ECD5L7YI.js +1369 -0
  229. package/dist/node-runtime/chunk-EDBJNRSM.js +46 -0
  230. package/dist/node-runtime/chunk-F4VQFJI2.js +1269 -0
  231. package/dist/node-runtime/chunk-FVDOXRUD.js +96 -0
  232. package/dist/node-runtime/chunk-GZQHMEWL.js +126 -0
  233. package/dist/node-runtime/chunk-H2EOZYMP.js +57 -0
  234. package/dist/node-runtime/chunk-HQCKFM2O.js +56 -0
  235. package/dist/node-runtime/chunk-HYHJIRDW.js +19 -0
  236. package/dist/node-runtime/chunk-I6R76AG7.js +22 -0
  237. package/dist/node-runtime/chunk-IPA627GP.js +296 -0
  238. package/dist/node-runtime/chunk-JHYKXIMM.js +378 -0
  239. package/dist/node-runtime/chunk-KKSIVROT.js +88 -0
  240. package/dist/node-runtime/chunk-LZAW4ZX3.js +633 -0
  241. package/dist/node-runtime/chunk-M3LZLQW2.js +98 -0
  242. package/dist/node-runtime/chunk-MGWCVY6Y.js +47 -0
  243. package/dist/node-runtime/chunk-MJQDX3BA.js +72 -0
  244. package/dist/node-runtime/chunk-MKKH27PH.js +8956 -0
  245. package/dist/node-runtime/chunk-MX3GJNXJ.js +986 -0
  246. package/dist/node-runtime/chunk-N77MY65L.js +966 -0
  247. package/dist/node-runtime/chunk-NUIFPZWX.js +209 -0
  248. package/dist/node-runtime/chunk-OBMWP3I5.js +68 -0
  249. package/dist/node-runtime/chunk-OR4L3IB2.js +42 -0
  250. package/dist/node-runtime/chunk-PBC2Y6GS.js +903 -0
  251. package/dist/node-runtime/chunk-PCGNAY2O.js +1324 -0
  252. package/dist/node-runtime/chunk-PCIGF2XK.js +250 -0
  253. package/dist/node-runtime/chunk-PGAJ5MO5.js +7558 -0
  254. package/dist/node-runtime/chunk-PL6JKXWI.js +3622 -0
  255. package/dist/node-runtime/chunk-PVCDKGR6.js +55 -0
  256. package/dist/node-runtime/chunk-Q4Q6D4IY.js +364 -0
  257. package/dist/node-runtime/chunk-Q5ZU2VRT.js +83 -0
  258. package/dist/node-runtime/chunk-QFWG2RVL.js +5477 -0
  259. package/dist/node-runtime/chunk-QH42CDX3.js +9451 -0
  260. package/dist/node-runtime/chunk-RQ2Q5IYR.js +72 -0
  261. package/dist/node-runtime/chunk-RQ5DNUNG.js +429 -0
  262. package/dist/node-runtime/chunk-RRIZE6QQ.js +17 -0
  263. package/dist/node-runtime/chunk-SN6G4OU6.js +4753 -0
  264. package/dist/node-runtime/chunk-SWSN6HAB.js +53 -0
  265. package/dist/node-runtime/chunk-TQNSPERU.js +949 -0
  266. package/dist/node-runtime/chunk-VRB2IYGG.js +53 -0
  267. package/dist/node-runtime/chunk-VSELYKWU.js +772 -0
  268. package/dist/node-runtime/chunk-W3CVH5RX.js +62 -0
  269. package/dist/node-runtime/chunk-WJVFOIB5.js +24921 -0
  270. package/dist/node-runtime/chunk-WOVTOV5P.js +5653 -0
  271. package/dist/node-runtime/chunk-XBWPBZBN.js +125 -0
  272. package/dist/node-runtime/chunk-XTHQ7XR7.js +509 -0
  273. package/dist/node-runtime/chunk-YF63P5ZT.js +864 -0
  274. package/dist/node-runtime/chunk-YSKSB3BJ.js +295 -0
  275. package/dist/node-runtime/chunk-ZCHMJ34K.js +130 -0
  276. package/dist/node-runtime/chunk-ZKMFUD3Q.js +2834 -0
  277. package/dist/node-runtime/cli-runtime.js +81 -0
  278. package/dist/node-runtime/clipboard-OZ63BBC6.js +12 -0
  279. package/dist/node-runtime/clipboard-image-7QR6GXVA.js +13 -0
  280. package/dist/node-runtime/command-L3LAHDIH.js +13 -0
  281. package/dist/node-runtime/commands-RL5YBW5I.js +291 -0
  282. package/dist/node-runtime/config-FMEOZSWE.js +77 -0
  283. package/dist/node-runtime/curator-server-XCM43VEF.js +3816 -0
  284. package/dist/node-runtime/customize-XEXL2DGQ.js +12 -0
  285. package/dist/node-runtime/direct-tool-executor-JVDXTO7A.js +188 -0
  286. package/dist/node-runtime/exa-LL64QZR2.js +329 -0
  287. package/dist/node-runtime/export-html-KR26FOUZ.js +150 -0
  288. package/dist/node-runtime/extension-input-RV5N6APL.js +14 -0
  289. package/dist/node-runtime/extension-selector-CPD5LWDD.js +14 -0
  290. package/dist/node-runtime/extract-XLQSJN4V.js +17 -0
  291. package/dist/node-runtime/file-sync-HCOP2QVF.js +117 -0
  292. package/dist/node-runtime/gateway-X2TI5X7F.js +2484 -0
  293. package/dist/node-runtime/gemini-api-QE7ANVDZ.js +29 -0
  294. package/dist/node-runtime/gemini-search-U7SUMPQA.js +330 -0
  295. package/dist/node-runtime/gemini-url-context-PXWCBQHK.js +103 -0
  296. package/dist/node-runtime/gemini-web-MM446SEH.js +14 -0
  297. package/dist/node-runtime/github-extract-F64RZOEA.js +619 -0
  298. package/dist/node-runtime/goal-CZQ7FFQJ.js +1831 -0
  299. package/dist/node-runtime/index.js +859 -0
  300. package/dist/node-runtime/init-NJV2T55N.js +28 -0
  301. package/dist/node-runtime/install-cli-TH7IJJQQ.js +308 -0
  302. package/dist/node-runtime/interactive-mode-KOM35YF2.js +56 -0
  303. package/dist/node-runtime/interactive-view-U6OILKF3.js +249 -0
  304. package/dist/node-runtime/lsp-manager-3ASUSO4T.js +1104 -0
  305. package/dist/node-runtime/lunr-cron-YJ5UHYRD.js +268 -0
  306. package/dist/node-runtime/main.js +54 -0
  307. package/dist/node-runtime/mcp-auth-flow-QIXHW6QN.js +32 -0
  308. package/dist/node-runtime/mcp-panel-IIGMXQGP.js +501 -0
  309. package/dist/node-runtime/mcp-setup-panel-FEK7663I.js +355 -0
  310. package/dist/node-runtime/memory-cap-3S4XRLNP.js +20 -0
  311. package/dist/node-runtime/model-tiers-NJLHUEGK.js +20 -0
  312. package/dist/node-runtime/openai-search-B3MSNCQA.js +288 -0
  313. package/dist/node-runtime/package-manager-cli-TZZHJCVI.js +749 -0
  314. package/dist/node-runtime/parallel-AI2MNSCU.js +265 -0
  315. package/dist/node-runtime/parser-manager-TQHWYDH7.js +152 -0
  316. package/dist/node-runtime/pdf-extract-IPE6H4HP.js +57 -0
  317. package/dist/node-runtime/perplexity-QVJW3I35.js +12 -0
  318. package/dist/node-runtime/pi-intercom-EEMBGQID.js +2215 -0
  319. package/dist/node-runtime/pi-mcp-adapter-QFB37AVN.js +422 -0
  320. package/dist/node-runtime/pi-ollama-cloud-4VZRMULP.js +1440 -0
  321. package/dist/node-runtime/pi-prompt-template-model-4QT4LLXF.js +3946 -0
  322. package/dist/node-runtime/pi-subagents-7XJ4H53P.js +6023 -0
  323. package/dist/node-runtime/pi-web-access-DPGAVKOA.js +1864 -0
  324. package/dist/node-runtime/print-mode-VWIRFDAC.js +12 -0
  325. package/dist/node-runtime/proxy-modes-HEEFK4KC.js +685 -0
  326. package/dist/node-runtime/rpc-entry.js +62 -0
  327. package/dist/node-runtime/rpc-mode-SJNSOA4G.js +13 -0
  328. package/dist/node-runtime/runtime-bridges-PPHNBFWL.js +14 -0
  329. package/dist/node-runtime/session-manager-MQNBYACL.js +35 -0
  330. package/dist/node-runtime/session-selector-5AZLJS6U.js +14 -0
  331. package/dist/node-runtime/settings-manager-5LF2VQWC.js +21 -0
  332. package/dist/node-runtime/src-Y7JSCK64.js +2407 -0
  333. package/dist/node-runtime/subagent-executor-5RNDEPIJ.js +8483 -0
  334. package/dist/node-runtime/summary-review-YSMXKITO.js +228 -0
  335. package/dist/node-runtime/tavily-WEZFVFP7.js +154 -0
  336. package/dist/node-runtime/timings-UAD5BEAS.js +16 -0
  337. package/dist/node-runtime/tool-renderer-MV5O452K.js +204 -0
  338. package/dist/node-runtime/update-cli-A253SZ7P.js +73 -0
  339. package/dist/node-runtime/v4-5MNC3H7G.js +424 -0
  340. package/dist/node-runtime/video-extract-OYT5WKS5.js +304 -0
  341. package/dist/node-runtime/workspace-index-6DBXSTJ6.js +163 -0
  342. package/dist/node-runtime/youtube-extract-TQYKGFGS.js +264 -0
  343. package/dist/startup/benchmark-request.d.ts +3 -0
  344. package/dist/startup/benchmark-request.d.ts.map +1 -0
  345. package/dist/startup/benchmark-request.js +65 -0
  346. package/dist/startup/benchmark-request.js.map +1 -0
  347. package/dist/startup/interactive-view.d.ts +55 -0
  348. package/dist/startup/interactive-view.d.ts.map +1 -0
  349. package/dist/startup/interactive-view.js +332 -0
  350. package/dist/startup/interactive-view.js.map +1 -0
  351. package/dist/startup/launch-routing.d.ts.map +1 -1
  352. package/dist/startup/launch-routing.js +9 -10
  353. package/dist/startup/launch-routing.js.map +1 -1
  354. package/dist/startup/startup-milestones.d.ts +1 -1
  355. package/dist/startup/startup-milestones.d.ts.map +1 -1
  356. package/dist/startup/startup-milestones.js +3 -2
  357. package/dist/startup/startup-milestones.js.map +1 -1
  358. package/dist/utils/await-with-abort.d.ts +2 -0
  359. package/dist/utils/await-with-abort.d.ts.map +1 -0
  360. package/dist/utils/await-with-abort.js +19 -0
  361. package/dist/utils/await-with-abort.js.map +1 -0
  362. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  363. package/dist/utils/syntax-highlight.js +10 -4
  364. package/dist/utils/syntax-highlight.js.map +1 -1
  365. package/docs/compaction.md +5 -3
  366. package/docs/development.md +5 -1
  367. package/docs/features.md +0 -1
  368. package/docs/interactive-startup.md +98 -0
  369. package/docs/model-catalog.md +29 -0
  370. package/docs/usage.md +0 -1
  371. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  372. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  373. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  374. package/examples/extensions/gondolin/package-lock.json +2 -2
  375. package/examples/extensions/gondolin/package.json +1 -1
  376. package/examples/extensions/sandbox/package-lock.json +2 -2
  377. package/examples/extensions/sandbox/package.json +1 -1
  378. package/examples/extensions/with-deps/package-lock.json +2 -2
  379. package/examples/extensions/with-deps/package.json +1 -1
  380. package/package.json +20 -20
  381. package/dist/core/swarm.d.ts +0 -23
  382. package/dist/core/swarm.d.ts.map +0 -1
  383. package/dist/core/swarm.js +0 -45
  384. package/dist/core/swarm.js.map +0 -1
@@ -15,13 +15,13 @@ import { parseSkillBlock } from "../../core/agent-session.js";
15
15
  import { SessionImportFileNotFoundError } from "../../core/agent-session-runtime.js";
16
16
  import { CACHE_TTL_MS, collectCacheMisses, computeCacheWaste, detectCacheMiss, } from "../../core/cache-stats.js";
17
17
  import { formatCatalogRefreshSummary } from "../../core/catalog-merge.js";
18
+ import { startCatalogRefreshPolling } from "../../core/catalog-refresh-polling.js";
18
19
  import { computeContextBreakdown } from "../../core/context-breakdown.js";
19
20
  import { FooterDataProvider } from "../../core/footer-data-provider.js";
20
21
  import { hasGrokCliXaiAuth } from "../../core/grok-cli-auth.js";
21
22
  import { configureHttpDispatcher, formatHttpIdleTimeoutMs } from "../../core/http-dispatcher.js";
22
23
  import { detectInjectedPrompt } from "../../core/injected-prompt.js";
23
24
  import { KeybindingsManager } from "../../core/keybindings.js";
24
- import { applyIncompleteAnswers, describeIncomplete, INCOMPLETE_PROMPT_CAP, parsePositiveInt, } from "../../core/live-catalog.js";
25
25
  import { createCompactionSummaryMessage } from "../../core/messages.js";
26
26
  import { isValidProviderBaseUrl, parseModelIds, slugifyProviderId, upsertCustomProvider, } from "../../core/model-config-writer.js";
27
27
  import { getGlobalInstructionsPath, getModelInstructionsPath } from "../../core/model-instructions.js";
@@ -38,12 +38,10 @@ import { getSearchCuratorSetting, setSearchCuratorSetting } from "../../core/sea
38
38
  import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
39
39
  import { SessionManager, sessionEntryToContextMessages } from "../../core/session-manager.js";
40
40
  import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
41
- import { buildSwarmPrompt } from "../../core/swarm.js";
42
41
  import { time } from "../../core/timings.js";
43
42
  import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
44
43
  import { checkForUpdate, markUpdateNotified } from "../../core/update-check.js";
45
44
  import { getAllPlanUsageResults, getUsageServiceBridge } from "../../core/usage-service.js";
46
- import { modelToUserEntry } from "../../core/user-models.js";
47
45
  import { markStartupMilestone } from "../../startup/startup-milestones.js";
48
46
  import { copyToClipboard, readClipboardText } from "../../utils/clipboard.js";
49
47
  import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
@@ -225,11 +223,9 @@ export class InteractiveMode {
225
223
  keybindings;
226
224
  version;
227
225
  isInitialized = false;
226
+ stopCatalogRefresh;
228
227
  onInputCallback;
229
228
  pendingUserInputs = [];
230
- startupUserInputs = [];
231
- startedFromShell;
232
- deferredStartupEditorFactory;
233
229
  stagedSubmitImages;
234
230
  fallbackImageAttachments = new Map();
235
231
  activeStatusIndicator = undefined;
@@ -275,8 +271,6 @@ export class InteractiveMode {
275
271
  signalCleanupHandlers = [];
276
272
  // Track if editor is in bash mode (text starts with !)
277
273
  isBashMode = false;
278
- // Track whether a /swarm orchestration turn is in flight (footer status)
279
- swarmMode = false;
280
274
  // lunr: mode in effect before the current plan stretch. Used by approve / `/plan off`
281
275
  // / `/plan <text>` to leave plan. Shift+Tab and `/mode` pick the destination themselves.
282
276
  previousPermissionMode;
@@ -294,6 +288,7 @@ export class InteractiveMode {
294
288
  pendingBashComponents = [];
295
289
  // Auto-compaction state
296
290
  autoCompactionEscapeHandler;
291
+ pendingCompactionRender;
297
292
  // Auto-retry state
298
293
  retryEscapeHandler;
299
294
  // Messages queued while compaction is running
@@ -322,8 +317,9 @@ export class InteractiveMode {
322
317
  autoTrustOnReloadCwd;
323
318
  themeController;
324
319
  deferredBuiltinsAttached = false;
320
+ startupReadyPromise;
321
+ startupFeatureError;
325
322
  deferredBuiltinAttachPromise;
326
- promptBarrierPromise;
327
323
  // Convenience accessors
328
324
  get session() {
329
325
  return this.runtimeHost.session;
@@ -363,9 +359,7 @@ export class InteractiveMode {
363
359
  this.syncPermissionModeEffects(this.settingsManager.getDefaultPermissionMode());
364
360
  });
365
361
  this.version = VERSION;
366
- const startupShell = options.startupShellBinding;
367
- this.startedFromShell = startupShell !== undefined;
368
- this.ui = startupShell?.ui ?? new TUI(new ProcessTerminal(), this.settingsManager.getShowHardwareCursor());
362
+ this.ui = options.startupView?.ui ?? new TUI(new ProcessTerminal(), this.settingsManager.getShowHardwareCursor());
369
363
  this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
370
364
  // lunr: register the permission-mode footer bridge (provider-side: InteractiveMode owns the state).
371
365
  registerPermissionModeBridge(() => getPermissionMode());
@@ -376,25 +370,29 @@ export class InteractiveMode {
376
370
  // lunr: reset permission mode to configured default on startup.
377
371
  resetPermissions(this.settingsManager.getDefaultPermissionMode());
378
372
  this.headerContainer = new Container();
373
+ if (options.startupView) {
374
+ this.headerContainer.addChild(new Spacer(1));
375
+ this.headerContainer.addChild(options.startupView.header);
376
+ this.customFooter = options.startupView.footer;
377
+ }
379
378
  this.loadedResourcesContainer = new Container();
380
379
  this.chatContainer = new Container();
381
380
  this.pendingMessagesContainer = new Container();
382
- this.statusContainer = new Container();
381
+ this.statusContainer = options.startupView?.statusContainer ?? new Container();
383
382
  this.widgetContainerAbove = new Container();
384
383
  this.widgetContainerBelow = new Container();
385
- this.keybindings = startupShell?.keybindings ?? KeybindingsManager.create();
384
+ this.keybindings = options.startupView?.keybindings ?? KeybindingsManager.create();
386
385
  setKeybindings(this.keybindings);
387
386
  const editorPaddingX = this.settingsManager.getEditorPaddingX();
388
387
  const autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();
389
388
  this.defaultEditor =
390
- startupShell?.editor ??
389
+ options.startupView?.editor ??
391
390
  new CustomEditor(this.ui, getEditorTheme(), this.keybindings, {
392
391
  paddingX: editorPaddingX,
393
392
  autocompleteMaxVisible,
394
393
  });
395
- this.defaultEditor.setPaddingX(editorPaddingX);
396
- this.defaultEditor.setAutocompleteMaxVisible(autocompleteMaxVisible);
397
394
  this.editor = this.defaultEditor;
395
+ options.startupView?.setCurrentEditor(() => this.editor);
398
396
  this.editorContainer = new Container();
399
397
  this.editorContainer.addChild(this.editor);
400
398
  this.footerDataProvider = new FooterDataProvider(this.sessionManager.getCwd());
@@ -556,14 +554,11 @@ export class InteractiveMode {
556
554
  if (this.isInitialized)
557
555
  return;
558
556
  this.registerSignalHandlers();
559
- const startupBenchmark = process.env.PI_STARTUP_BENCHMARK === "1";
560
557
  this.fdPath = getToolPath("fd") ?? undefined;
561
- const toolMaintenance = startupBenchmark
562
- ? Promise.resolve()
563
- : startInteractiveToolInstalls(this.fdPath, (fdPath) => {
564
- this.fdPath = fdPath;
565
- this.setupAutocompleteProvider();
566
- });
558
+ void startInteractiveToolInstalls(this.fdPath, (fdPath) => {
559
+ this.fdPath = fdPath;
560
+ this.setupAutocompleteProvider();
561
+ });
567
562
  time("ensureTools");
568
563
  if (this.session.scopedModels.length > 0 && (this.options.verbose || !this.settingsManager.getQuietStartup())) {
569
564
  const modelList = this.session.scopedModels
@@ -578,7 +573,7 @@ export class InteractiveMode {
578
573
  : "";
579
574
  console.log(theme.fg("dim", `Model scope: ${modelList}${cycleHint}`));
580
575
  }
581
- if (this.startedFromShell) {
576
+ if (this.options.startupView) {
582
577
  this.ui.pinFrom(null);
583
578
  this.ui.clear();
584
579
  }
@@ -593,28 +588,20 @@ export class InteractiveMode {
593
588
  this.ui.addChild(this.widgetContainerAbove);
594
589
  this.ui.addChild(this.editorContainer);
595
590
  this.ui.addChild(this.widgetContainerBelow);
596
- this.ui.addChild(this.footer);
591
+ this.ui.addChild(this.customFooter ?? this.footer);
597
592
  this.ui.setFocus(this.editor);
598
- this.setupKeyHandlers();
599
- const startupSubmissions = this.options.startupShellBinding?.pendingSubmissions.splice(0) ?? [];
600
- this.startupUserInputs.push(...startupSubmissions.map(async ({ text, attachments }) => ({
601
- text,
602
- images: await this.loadImageAttachments(attachments),
603
- })));
604
- this.setupEditorSubmitHandler();
605
593
  this.ui.pinFrom(this.widgetContainerAbove);
594
+ this.setupKeyHandlers();
595
+ if (!this.options.startupView)
596
+ this.setupEditorSubmitHandler();
606
597
  this.ui.setAlternateScreen(true);
607
- if (this.startedFromShell) {
608
- this.ui.requestRender(true);
609
- }
610
- else {
598
+ // Start the UI before initializing extensions so session_start handlers can use interactive dialogs
599
+ if (!this.options.startupView)
611
600
  this.ui.start();
612
- }
613
601
  this.isInitialized = true;
614
602
  time("ui.start");
615
- const updateMaintenance = startupBenchmark ? Promise.resolve() : this.maybeNotifyCliUpdate();
616
- if (!startupBenchmark)
617
- this.startPlanUsagePolling();
603
+ void this.maybeNotifyCliUpdate();
604
+ this.startPlanUsagePolling();
618
605
  // lunr: register the permission approval dialog handler so manual mode can prompt.
619
606
  registerApprovalHandler(async (req) => {
620
607
  if (req.kind === "large-subagent-launch") {
@@ -638,6 +625,7 @@ export class InteractiveMode {
638
625
  setRollbackWarningHandler((msg) => this.showStatus(msg));
639
626
  this.syncPermissionModeEffects(this.settingsManager.getDefaultPermissionMode());
640
627
  await this.themeController.applyFromSettings();
628
+ this.headerContainer.clear();
641
629
  // Add boot screen header (unless silenced)
642
630
  if (this.options.verbose || !this.settingsManager.getQuietStartup()) {
643
631
  const header = theme.bold(theme.fg("accent", APP_NAME)) + theme.fg("dim", ` v${this.version}`);
@@ -657,21 +645,32 @@ export class InteractiveMode {
657
645
  await this.rebindCurrentSession();
658
646
  time("rebindCurrentSession");
659
647
  this.renderInitialMessages();
660
- for (const diagnostic of this.options.startupDiagnostics ?? []) {
661
- if (diagnostic.type === "warning")
662
- this.showWarning(diagnostic.message);
663
- else
664
- this.showStatus(diagnostic.message);
665
- }
648
+ this.ui.requestRender();
649
+ for (const diagnostic of this.options.startupDiagnostics ?? [])
650
+ this.showStatus(diagnostic.message);
666
651
  for (const warning of this.options.deprecationWarnings ?? [])
667
652
  this.showWarning(warning);
668
653
  this.deferredBuiltinAttachPromise = this.attachDeferredBuiltinExtensions();
669
- this.promptBarrierPromise = this.deferredBuiltinAttachPromise.then(() => {
670
- time("attachDeferredBuiltins");
671
- markStartupMilestone("prompt_barrier_open");
672
- }, () => {
654
+ this.startupReadyPromise = this.deferredBuiltinAttachPromise.then(() => {
655
+ if (!this.isInitialized)
656
+ return;
657
+ if (this.startupFeatureError)
658
+ throw this.startupFeatureError;
659
+ if (this.options.startupView) {
660
+ this.setupEditorSubmitHandler();
661
+ // Extensions can replace the editor. Wire its submit callback after readiness as well.
662
+ this.editor.onSubmit = this.defaultEditor.onSubmit;
663
+ this.options.startupView.activate();
664
+ }
673
665
  time("attachDeferredBuiltins");
674
666
  markStartupMilestone("prompt_barrier_open");
667
+ void this.options.deferredMaintenance?.();
668
+ });
669
+ void this.startupReadyPromise.catch((error) => {
670
+ if (this.options.startupView)
671
+ this.options.startupView.showError(error);
672
+ else
673
+ this.showError(String(error));
675
674
  });
676
675
  // Set up theme file watcher
677
676
  onThemeChange(() => {
@@ -681,34 +680,40 @@ export class InteractiveMode {
681
680
  });
682
681
  // Set up git branch watcher (uses provider instead of footer)
683
682
  this.footerDataProvider.onBranchChange(() => {
684
- this.ui.requestPaint();
683
+ this.ui.requestRender();
684
+ });
685
+ // Cache-only footer snapshot. Do not hold time-to-type on it.
686
+ void this.updateAvailableProviderCount().then(() => {
687
+ time("updateAvailableProviderCount");
685
688
  });
686
- const providerMaintenance = startupBenchmark
687
- ? Promise.resolve()
688
- : this.updateAvailableProviderCount().then(() => {
689
- time("updateAvailableProviderCount");
689
+ void this.waitForDeferredBuiltins().then(() => {
690
+ if (!this.isInitialized)
691
+ return;
692
+ this.stopCatalogRefresh = startCatalogRefreshPolling({
693
+ refresh: (signal) => this.session.modelRuntime.refreshIfStale({ signal }),
694
+ isBusy: () => this.session.isStreaming,
695
+ onUpdate: () => {
696
+ this.session.refreshModelFromRegistry();
697
+ this.footer.invalidate();
698
+ },
690
699
  });
691
- const callerMaintenance = startupBenchmark
692
- ? Promise.resolve()
693
- : this.waitForPromptBarrier().then(() => this.options.deferredMaintenance?.());
694
- void Promise.allSettled([toolMaintenance, updateMaintenance, providerMaintenance, callerMaintenance]).then(() => {
695
- markStartupMilestone("deferred_maintenance_idle");
696
700
  });
697
701
  }
702
+ async waitForStartupReady() {
703
+ await this.startupReadyPromise;
704
+ }
705
+ /** Wait until deferred builtins have attached (or were skipped). */
698
706
  async waitForDeferredBuiltins() {
699
- if (this.deferredBuiltinAttachPromise)
707
+ if (this.deferredBuiltinAttachPromise) {
700
708
  await this.deferredBuiltinAttachPromise;
701
- }
702
- async waitForPromptBarrier() {
703
- if (this.promptBarrierPromise)
704
- await this.promptBarrierPromise;
709
+ }
705
710
  }
706
711
  planUsageTimer;
707
712
  startPlanUsagePolling() {
708
713
  const bridge = getUsageServiceBridge();
709
714
  if (!bridge)
710
715
  return;
711
- bridge.setOnUpdate(() => this.ui.requestPaint());
716
+ bridge.setOnUpdate(() => this.ui.requestRender());
712
717
  const tick = () => {
713
718
  const provider = this.session.model?.provider;
714
719
  if (provider)
@@ -756,6 +761,7 @@ export class InteractiveMode {
756
761
  if (!this.isInitialized) {
757
762
  await this.init();
758
763
  }
764
+ await this.waitForStartupReady();
759
765
  // Check tmux keyboard setup asynchronously
760
766
  this.checkTmuxKeyboardSetup().then((warning) => {
761
767
  if (warning) {
@@ -1294,7 +1300,7 @@ export class InteractiveMode {
1294
1300
  * Initialize the extension system with TUI-based UI context.
1295
1301
  */
1296
1302
  async awaitDeferredBuiltinsForPrompt() {
1297
- await this.waitForPromptBarrier();
1303
+ await this.waitForDeferredBuiltins();
1298
1304
  }
1299
1305
  async promptAfterDeferredBuiltins(text, options) {
1300
1306
  await this.awaitDeferredBuiltinsForPrompt();
@@ -1310,24 +1316,24 @@ export class InteractiveMode {
1310
1316
  }
1311
1317
  this.setExtensionStatus("deferred-builtins", "loading tools…");
1312
1318
  try {
1313
- const { extensions, failures } = await this.options.deferredBuiltinFactories();
1314
- if (extensions.length > 0) {
1315
- this.options.onDeferredBuiltinsAttached?.(extensions);
1316
- await this.session.attachInlineExtensions(extensions);
1317
- this.setupAutocompleteProvider();
1318
- this.setupExtensionShortcuts(this.session.extensionRunner);
1319
- this.showLoadedResources({ force: false, showDiagnosticsWhenQuiet: true });
1320
- }
1321
- if (failures.length > 0) {
1322
- this.showError(`Failed to load deferred extensions: ${failures.map(({ name }) => name).join(", ")}`);
1323
- }
1319
+ const factories = await this.options.deferredBuiltinFactories();
1320
+ this.deferredBuiltinsAttached = true;
1321
+ if (factories.length === 0)
1322
+ return;
1323
+ this.options.onDeferredBuiltinsAttached?.(factories);
1324
+ await this.session.attachInlineExtensions(factories);
1325
+ this.setupAutocompleteProvider();
1326
+ this.setupExtensionShortcuts(this.session.extensionRunner);
1327
+ this.showLoadedResources({ force: false, showDiagnosticsWhenQuiet: true });
1324
1328
  }
1325
1329
  catch (error) {
1330
+ this.deferredBuiltinsAttached = false;
1326
1331
  const message = error instanceof Error ? error.message : String(error);
1332
+ if (this.options.startupView)
1333
+ this.startupFeatureError = new Error(message);
1327
1334
  this.showError(`Failed to load deferred extensions: ${message}`);
1328
1335
  }
1329
1336
  finally {
1330
- this.deferredBuiltinsAttached = true;
1331
1337
  this.setExtensionStatus("deferred-builtins", undefined);
1332
1338
  }
1333
1339
  }
@@ -1477,6 +1483,7 @@ export class InteractiveMode {
1477
1483
  this.chatContainer.clear();
1478
1484
  this.pendingMessagesContainer.clear();
1479
1485
  this.compactionQueuedMessages = [];
1486
+ this.pendingCompactionRender = undefined;
1480
1487
  this.stopSmoothStreaming();
1481
1488
  this.streamingComponent = undefined;
1482
1489
  this.streamingMessage = undefined;
@@ -1983,12 +1990,9 @@ export class InteractiveMode {
1983
1990
  */
1984
1991
  setCustomEditorComponent(factory) {
1985
1992
  this.editorComponentFactory = factory;
1993
+ // Save text from current editor before switching
1986
1994
  const currentText = this.editor.getText();
1987
- if (this.startedFromShell && factory && currentText.length > 0) {
1988
- this.deferredStartupEditorFactory = factory;
1989
- return;
1990
- }
1991
- this.deferredStartupEditorFactory = undefined;
1995
+ const startupImages = this.options.startupView ? this.editor.getPendingImages?.() : undefined;
1992
1996
  this.editorContainer.clear();
1993
1997
  if (factory) {
1994
1998
  // Create the custom editor with tui, theme, and keybindings
@@ -1997,7 +2001,16 @@ export class InteractiveMode {
1997
2001
  newEditor.onSubmit = this.defaultEditor.onSubmit;
1998
2002
  newEditor.onChange = this.defaultEditor.onChange;
1999
2003
  // Copy text from previous editor
2000
- newEditor.setText(currentText);
2004
+ if (newEditor !== this.editor) {
2005
+ newEditor.setText(currentText);
2006
+ if (startupImages?.length) {
2007
+ if (newEditor.restoreImageMarkers)
2008
+ newEditor.restoreImageMarkers(startupImages);
2009
+ else
2010
+ for (const image of startupImages)
2011
+ this.fallbackImageAttachments.set(image.id, image);
2012
+ }
2013
+ }
2001
2014
  // Copy appearance settings if supported
2002
2015
  if (newEditor.borderColor !== undefined) {
2003
2016
  newEditor.borderColor = this.defaultEditor.borderColor;
@@ -2012,7 +2025,9 @@ export class InteractiveMode {
2012
2025
  // If extending CustomEditor, copy app-level handlers
2013
2026
  // Use duck typing since instanceof fails across jiti module boundaries
2014
2027
  const customEditor = newEditor;
2015
- if ("actionHandlers" in customEditor && customEditor.actionHandlers instanceof Map) {
2028
+ if (newEditor !== this.defaultEditor &&
2029
+ "actionHandlers" in customEditor &&
2030
+ customEditor.actionHandlers instanceof Map) {
2016
2031
  if (!customEditor.onEscape) {
2017
2032
  customEditor.onEscape = () => this.defaultEditor.onEscape?.();
2018
2033
  }
@@ -2031,20 +2046,14 @@ export class InteractiveMode {
2031
2046
  }
2032
2047
  else {
2033
2048
  // Restore default editor with text from custom editor
2034
- this.defaultEditor.setText(currentText);
2049
+ if (this.editor !== this.defaultEditor)
2050
+ this.defaultEditor.setText(currentText);
2035
2051
  this.editor = this.defaultEditor;
2036
2052
  }
2037
2053
  this.editorContainer.addChild(this.editor);
2038
2054
  this.ui.setFocus(this.editor);
2039
2055
  this.ui.requestRender();
2040
2056
  }
2041
- activateDeferredStartupEditor() {
2042
- const factory = this.deferredStartupEditorFactory;
2043
- if (!factory || this.editor.getText().length > 0)
2044
- return;
2045
- this.deferredStartupEditorFactory = undefined;
2046
- this.setCustomEditorComponent(factory);
2047
- }
2048
2057
  /**
2049
2058
  * Show a notification for extensions.
2050
2059
  */
@@ -2368,7 +2377,6 @@ export class InteractiveMode {
2368
2377
  return;
2369
2378
  }
2370
2379
  const images = this.consumeStagedSubmitImages() ?? (await this.loadImageAttachments(this.takeSubmittedImages(text)));
2371
- this.activateDeferredStartupEditor();
2372
2380
  this.ui.setChatScroll(0);
2373
2381
  // Handle commands
2374
2382
  if (text === "/paste-image") {
@@ -2541,12 +2549,6 @@ export class InteractiveMode {
2541
2549
  await this.handleInitCommand();
2542
2550
  return;
2543
2551
  }
2544
- if (text === "/swarm" || text.startsWith("/swarm ")) {
2545
- const task = text.startsWith("/swarm ") ? text.slice(7).trim() : "";
2546
- this.editor.setText("");
2547
- await this.handleSwarmCommand(task);
2548
- return;
2549
- }
2550
2552
  if (text === "/debug") {
2551
2553
  this.handleDebugCommand();
2552
2554
  this.editor.setText("");
@@ -2932,6 +2934,7 @@ export class InteractiveMode {
2932
2934
  break;
2933
2935
  }
2934
2936
  case "agent_end":
2937
+ this.session.refreshModelFromRegistry();
2935
2938
  if (this.settingsManager.getShowTerminalProgress()) {
2936
2939
  this.ui.terminal.setProgress(false);
2937
2940
  }
@@ -2943,16 +2946,17 @@ export class InteractiveMode {
2943
2946
  this.streamingMessage = undefined;
2944
2947
  }
2945
2948
  this.pendingTools.clear();
2946
- if (this.swarmMode) {
2947
- this.swarmMode = false;
2948
- this.setExtensionStatus("swarm", undefined);
2949
- }
2950
2949
  this.maybeAutoNameSession();
2951
2950
  // lunr: capture tree-scope changes at turn boundary (bash side-effects).
2952
2951
  captureTreeChanges(this.sessionManager.getCwd(), this.sessionManager.getSessionId());
2953
2952
  this.ui.requestRender();
2954
2953
  break;
2955
2954
  case "agent_settled":
2955
+ if (this.pendingCompactionRender) {
2956
+ const result = this.pendingCompactionRender;
2957
+ this.pendingCompactionRender = undefined;
2958
+ this.renderCompactionResult(result);
2959
+ }
2956
2960
  await this.checkShutdownRequested();
2957
2961
  break;
2958
2962
  case "compaction_start": {
@@ -2986,10 +2990,12 @@ export class InteractiveMode {
2986
2990
  }
2987
2991
  }
2988
2992
  else if (event.result) {
2989
- this.chatContainer.clear();
2990
- this.rebuildChatFromMessages();
2991
- this.addMessageToChat(createCompactionSummaryMessage(event.result.summary, event.result.tokensBefore, new Date().toISOString()));
2992
- this.footer.invalidate();
2993
+ if (this.session.isIdle) {
2994
+ this.renderCompactionResult(event.result);
2995
+ }
2996
+ else {
2997
+ this.pendingCompactionRender = event.result;
2998
+ }
2993
2999
  }
2994
3000
  else if (event.errorMessage) {
2995
3001
  if (event.reason === "manual") {
@@ -3318,9 +3324,6 @@ export class InteractiveMode {
3318
3324
  this.chatContainer.addChild(new Text(theme.fg("warning", `This project is not trusted. Project ${CONFIG_DIR_NAME} resources and packages are ignored. Use /trust to save a trust decision, then restart pi.`), 1, 0));
3319
3325
  }
3320
3326
  async getUserInput() {
3321
- const startupInput = this.startupUserInputs.shift();
3322
- if (startupInput !== undefined)
3323
- return startupInput;
3324
3327
  const queuedInput = this.pendingUserInputs.shift();
3325
3328
  if (queuedInput !== undefined) {
3326
3329
  return queuedInput;
@@ -3346,7 +3349,6 @@ export class InteractiveMode {
3346
3349
  }
3347
3350
  else {
3348
3351
  this.clearEditor();
3349
- this.activateDeferredStartupEditor();
3350
3352
  this.lastSigintTime = now;
3351
3353
  }
3352
3354
  }
@@ -3847,6 +3849,12 @@ export class InteractiveMode {
3847
3849
  const commandName = spaceIndex === -1 ? text.slice(1) : text.slice(1, spaceIndex);
3848
3850
  return !!extensionRunner.getCommand(commandName);
3849
3851
  }
3852
+ renderCompactionResult(result) {
3853
+ this.chatContainer.clear();
3854
+ this.rebuildChatFromMessages();
3855
+ this.addMessageToChat(createCompactionSummaryMessage(result.summary, result.tokensBefore, new Date().toISOString()));
3856
+ this.footer.invalidate();
3857
+ }
3850
3858
  async flushCompactionQueue(options) {
3851
3859
  if (this.compactionQueuedMessages.length === 0) {
3852
3860
  return;
@@ -4322,40 +4330,9 @@ export class InteractiveMode {
4322
4330
  this.footer.invalidate();
4323
4331
  return;
4324
4332
  }
4325
- const incomplete = result.incomplete;
4326
- const toPrompt = incomplete.slice(0, INCOMPLETE_PROMPT_CAP);
4327
- const extraDefaults = Math.max(0, incomplete.length - toPrompt.length);
4328
- const persisted = [];
4333
+ // Discovered metadata stays in its cache, not in user overrides. Enrichment is automatic.
4334
+ const extraDefaults = result.incomplete.length;
4329
4335
  const asked = [];
4330
- let skipRemaining = false;
4331
- for (const item of toPrompt) {
4332
- if (skipRemaining) {
4333
- persisted.push(modelToUserEntry(item.draft));
4334
- continue;
4335
- }
4336
- const choice = await this.showExtensionSelector(describeIncomplete(item), [
4337
- "Enter details",
4338
- "Use defaults",
4339
- "Skip remaining",
4340
- ]);
4341
- asked.push(`${item.provider}/${item.id}`);
4342
- if (choice === "Skip remaining") {
4343
- skipRemaining = true;
4344
- persisted.push(modelToUserEntry(item.draft));
4345
- continue;
4346
- }
4347
- if (choice === "Enter details") {
4348
- const detailed = await this.promptIncompleteModelDetails(item);
4349
- persisted.push(modelToUserEntry(detailed ?? item.draft));
4350
- continue;
4351
- }
4352
- persisted.push(modelToUserEntry(item.draft));
4353
- }
4354
- for (const item of incomplete.slice(toPrompt.length)) {
4355
- persisted.push(modelToUserEntry(item.draft));
4356
- }
4357
- if (persisted.length > 0)
4358
- runtime.persistUserModels(persisted);
4359
4336
  let ollama;
4360
4337
  const runner = this.session.extensionRunner;
4361
4338
  const cloudRefresh = globalThis[Symbol.for("@lunr/ollama-cloud-refresh")];
@@ -4376,53 +4353,26 @@ export class InteractiveMode {
4376
4353
  evictedUserRows: result.official.evictedUserRows,
4377
4354
  }
4378
4355
  : undefined,
4379
- providers: result.live.map((entry) => ({
4380
- id: entry.providerId,
4381
- status: entry.status,
4382
- added: entry.added,
4383
- total: entry.total,
4384
- error: entry.error,
4385
- })),
4356
+ providers: [
4357
+ ...result.live.map((entry) => ({
4358
+ id: entry.providerId,
4359
+ status: entry.status,
4360
+ added: entry.added,
4361
+ total: entry.total,
4362
+ error: entry.error,
4363
+ })),
4364
+ ...Object.entries(result.official?.errors ?? {}).map(([id, error]) => ({
4365
+ id,
4366
+ status: "error",
4367
+ error,
4368
+ })),
4369
+ ],
4386
4370
  asked,
4387
4371
  extraDefaults,
4388
4372
  ollama,
4389
4373
  }));
4390
4374
  this.footer.invalidate();
4391
4375
  }
4392
- async promptIncompleteModelDetails(item) {
4393
- const contextInput = await this.showExtensionInput(`${item.provider}/${item.id} — context window:`, String(item.draft.contextWindow || 128000));
4394
- if (contextInput === undefined)
4395
- return undefined;
4396
- const maxTokensInput = await this.showExtensionInput(`${item.provider}/${item.id} — max output tokens:`, String(item.draft.maxTokens || 8192));
4397
- if (maxTokensInput === undefined)
4398
- return undefined;
4399
- const inputChoice = await this.showExtensionSelector(`${item.provider}/${item.id} — input:`, [
4400
- "text",
4401
- "text + image",
4402
- ]);
4403
- if (inputChoice === undefined)
4404
- return undefined;
4405
- const reasoningChoice = await this.showExtensionSelector(`${item.provider}/${item.id} — reasoning:`, [
4406
- "yes",
4407
- "no",
4408
- ]);
4409
- if (reasoningChoice === undefined)
4410
- return undefined;
4411
- let api = item.draft.api;
4412
- if (item.availableApis.length > 1) {
4413
- const apiChoice = await this.showExtensionSelector(`${item.provider}/${item.id} — API protocol:`, item.availableApis.map(String));
4414
- if (apiChoice === undefined)
4415
- return undefined;
4416
- api = apiChoice;
4417
- }
4418
- return applyIncompleteAnswers(item.draft, {
4419
- contextWindow: parsePositiveInt(contextInput, item.draft.contextWindow),
4420
- maxTokens: parsePositiveInt(maxTokensInput, item.draft.maxTokens),
4421
- input: inputChoice === "text + image" ? ["text", "image"] : ["text"],
4422
- reasoning: reasoningChoice === "yes",
4423
- api,
4424
- });
4425
- }
4426
4376
  async findExactModelMatch(searchTerm) {
4427
4377
  const models = await this.getModelCandidates();
4428
4378
  return findExactModelReferenceMatch(searchTerm, models);
@@ -5643,24 +5593,6 @@ export class InteractiveMode {
5643
5593
  await this.sendUserMessageAfterDeferredBuiltins(prompt);
5644
5594
  this.showStatus("AGENTS.md is being generated — run /reload when it finishes to load it into context.");
5645
5595
  }
5646
- async handleSwarmCommand(task) {
5647
- if (task.length === 0) {
5648
- if (this.swarmMode) {
5649
- this.showStatus("Swarm mode is active — run /subagents-fleet to monitor the fleet.");
5650
- }
5651
- else {
5652
- this.showStatus("Usage: /swarm <task> — decomposes the task across parallel subagents. Monitor with /subagents-fleet.");
5653
- }
5654
- return;
5655
- }
5656
- if (this.session.isStreaming) {
5657
- this.showWarning("Wait for the current response to finish before running /swarm.");
5658
- return;
5659
- }
5660
- this.swarmMode = true;
5661
- this.setExtensionStatus("swarm", "swarm");
5662
- await this.sendUserMessageAfterDeferredBuiltins(buildSwarmPrompt(task));
5663
- }
5664
5596
  // lunr: /undo and /edit rewind the same session via navigateTree (no fork).
5665
5597
  // /undo leaves the editor alone; /edit pastes the undone user text. /redo
5666
5598
  // pops the previous leaf and navigates back.
@@ -6504,7 +6436,7 @@ export class InteractiveMode {
6504
6436
  this.showSelector((done) => {
6505
6437
  const component = new ProcessesSelectorComponent(() => {
6506
6438
  done();
6507
- }, () => this.ui.requestPaint());
6439
+ });
6508
6440
  return { component, focus: component };
6509
6441
  });
6510
6442
  }
@@ -6849,6 +6781,8 @@ ${cycleThinkingLevel ? `| \`${cycleThinkingLevel}\` | Cycle thinking level |\n`
6849
6781
  }
6850
6782
  }
6851
6783
  stop() {
6784
+ this.stopCatalogRefresh?.();
6785
+ this.stopCatalogRefresh = undefined;
6852
6786
  if (this.settingsManager.getShowTerminalProgress()) {
6853
6787
  this.ui.terminal.setProgress(false);
6854
6788
  }