@ashx-j/lunr-dev 0.2.13-dev.8.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 (339) 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/publication.json +12 -12
  87. package/dist/cli-runtime.d.ts +3 -0
  88. package/dist/cli-runtime.d.ts.map +1 -0
  89. package/dist/cli-runtime.js +73 -0
  90. package/dist/cli-runtime.js.map +1 -0
  91. package/dist/cli.d.ts.map +1 -1
  92. package/dist/cli.js +14 -53
  93. package/dist/cli.js.map +1 -1
  94. package/dist/config.d.ts +1 -0
  95. package/dist/config.d.ts.map +1 -1
  96. package/dist/config.js +1 -0
  97. package/dist/config.js.map +1 -1
  98. package/dist/core/agent-session.d.ts +3 -0
  99. package/dist/core/agent-session.d.ts.map +1 -1
  100. package/dist/core/agent-session.js +56 -12
  101. package/dist/core/agent-session.js.map +1 -1
  102. package/dist/core/compaction/compaction.d.ts.map +1 -1
  103. package/dist/core/compaction/compaction.js +10 -5
  104. package/dist/core/compaction/compaction.js.map +1 -1
  105. package/dist/core/extensions/host-static.d.ts.map +1 -1
  106. package/dist/core/extensions/host-static.js +34 -12
  107. package/dist/core/extensions/host-static.js.map +1 -1
  108. package/dist/core/extensions/loader.d.ts +1 -2
  109. package/dist/core/extensions/loader.d.ts.map +1 -1
  110. package/dist/core/extensions/loader.js +10 -64
  111. package/dist/core/extensions/loader.js.map +1 -1
  112. package/dist/core/extensions/types.d.ts +2 -2
  113. package/dist/core/extensions/types.d.ts.map +1 -1
  114. package/dist/core/extensions/types.js.map +1 -1
  115. package/dist/core/footer-data-provider.d.ts.map +1 -1
  116. package/dist/core/footer-data-provider.js +2 -0
  117. package/dist/core/footer-data-provider.js.map +1 -1
  118. package/dist/core/permissions.d.ts +0 -2
  119. package/dist/core/permissions.d.ts.map +1 -1
  120. package/dist/core/permissions.js +10 -18
  121. package/dist/core/permissions.js.map +1 -1
  122. package/dist/core/sdk.d.ts +1 -1
  123. package/dist/core/sdk.d.ts.map +1 -1
  124. package/dist/core/sdk.js +1 -1
  125. package/dist/core/sdk.js.map +1 -1
  126. package/dist/core/slash-commands.d.ts.map +1 -1
  127. package/dist/core/slash-commands.js +0 -1
  128. package/dist/core/slash-commands.js.map +1 -1
  129. package/dist/core/timings.d.ts +2 -1
  130. package/dist/core/timings.d.ts.map +1 -1
  131. package/dist/core/timings.js +17 -2
  132. package/dist/core/timings.js.map +1 -1
  133. package/dist/gateway/commands.d.ts +1 -1
  134. package/dist/gateway/commands.d.ts.map +1 -1
  135. package/dist/gateway/commands.js +1 -18
  136. package/dist/gateway/commands.js.map +1 -1
  137. package/dist/main.d.ts +2 -2
  138. package/dist/main.d.ts.map +1 -1
  139. package/dist/main.js +57 -48
  140. package/dist/main.js.map +1 -1
  141. package/dist/modes/interactive/interactive-mode.d.ts +12 -21
  142. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  143. package/dist/modes/interactive/interactive-mode.js +120 -144
  144. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  145. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  146. package/dist/modes/interactive/theme/theme.js +95 -84
  147. package/dist/modes/interactive/theme/theme.js.map +1 -1
  148. package/dist/node-runtime/agent-session-services-IFJMSX7Z.js +36 -0
  149. package/dist/node-runtime/benchmark-request-UC7PD3V3.js +57 -0
  150. package/dist/node-runtime/brave-UWDA3I22.js +143 -0
  151. package/dist/node-runtime/builtin-extensions-LYZ3BFWQ.js +28 -0
  152. package/dist/node-runtime/chunk-2QKLKMKC.js +173 -0
  153. package/dist/node-runtime/chunk-3GHXVUAK.js +21 -0
  154. package/dist/node-runtime/chunk-3RCWXWAY.js +466 -0
  155. package/dist/node-runtime/chunk-3WFAEVKS.js +115 -0
  156. package/dist/node-runtime/chunk-3X3KZKMI.js +49 -0
  157. package/dist/node-runtime/chunk-4HXHDDCF.js +16 -0
  158. package/dist/node-runtime/chunk-4TLO4PO2.js +3427 -0
  159. package/dist/node-runtime/chunk-4ZWGEEAS.js +69 -0
  160. package/dist/node-runtime/chunk-53YJI7JU.js +137 -0
  161. package/dist/node-runtime/chunk-5P7PZMRU.js +610 -0
  162. package/dist/node-runtime/chunk-7N3YHTYF.js +26 -0
  163. package/dist/node-runtime/chunk-7NBZ5P7I.js +24 -0
  164. package/dist/node-runtime/chunk-A2KQXUJD.js +105 -0
  165. package/dist/node-runtime/chunk-AD6VXAO7.js +342 -0
  166. package/dist/node-runtime/chunk-AHSTJBIB.js +64 -0
  167. package/dist/node-runtime/chunk-AJX357CL.js +20211 -0
  168. package/dist/node-runtime/chunk-ARC4KOTI.js +11178 -0
  169. package/dist/node-runtime/chunk-AUXVGBO4.js +19 -0
  170. package/dist/node-runtime/chunk-AY6CAJSL.js +30 -0
  171. package/dist/node-runtime/chunk-BHO7O6E5.js +296 -0
  172. package/dist/node-runtime/chunk-BI3DHYCN.js +8845 -0
  173. package/dist/node-runtime/chunk-BR7YDUKA.js +109 -0
  174. package/dist/node-runtime/chunk-BRJX2PRC.js +53 -0
  175. package/dist/node-runtime/chunk-C4O2RSQQ.js +37 -0
  176. package/dist/node-runtime/chunk-CCZJ3PYY.js +17 -0
  177. package/dist/node-runtime/chunk-CDFZEWPU.js +8388 -0
  178. package/dist/node-runtime/chunk-CGBXPL3E.js +1171 -0
  179. package/dist/node-runtime/chunk-CJECDQKP.js +19 -0
  180. package/dist/node-runtime/chunk-DAPBPCBP.js +53 -0
  181. package/dist/node-runtime/chunk-DDGMHUOW.js +305 -0
  182. package/dist/node-runtime/chunk-DMMTJQMQ.js +43 -0
  183. package/dist/node-runtime/chunk-DVGWF6A2.js +1180 -0
  184. package/dist/node-runtime/chunk-ECD5L7YI.js +1369 -0
  185. package/dist/node-runtime/chunk-EDBJNRSM.js +46 -0
  186. package/dist/node-runtime/chunk-F4VQFJI2.js +1269 -0
  187. package/dist/node-runtime/chunk-FVDOXRUD.js +96 -0
  188. package/dist/node-runtime/chunk-GZQHMEWL.js +126 -0
  189. package/dist/node-runtime/chunk-H2EOZYMP.js +57 -0
  190. package/dist/node-runtime/chunk-HQCKFM2O.js +56 -0
  191. package/dist/node-runtime/chunk-HYHJIRDW.js +19 -0
  192. package/dist/node-runtime/chunk-I6R76AG7.js +22 -0
  193. package/dist/node-runtime/chunk-IPA627GP.js +296 -0
  194. package/dist/node-runtime/chunk-JHYKXIMM.js +378 -0
  195. package/dist/node-runtime/chunk-KKSIVROT.js +88 -0
  196. package/dist/node-runtime/chunk-LZAW4ZX3.js +633 -0
  197. package/dist/node-runtime/chunk-M3LZLQW2.js +98 -0
  198. package/dist/node-runtime/chunk-MGWCVY6Y.js +47 -0
  199. package/dist/node-runtime/chunk-MJQDX3BA.js +72 -0
  200. package/dist/node-runtime/chunk-MKKH27PH.js +8956 -0
  201. package/dist/node-runtime/chunk-MX3GJNXJ.js +986 -0
  202. package/dist/node-runtime/chunk-N77MY65L.js +966 -0
  203. package/dist/node-runtime/chunk-NUIFPZWX.js +209 -0
  204. package/dist/node-runtime/chunk-OBMWP3I5.js +68 -0
  205. package/dist/node-runtime/chunk-OR4L3IB2.js +42 -0
  206. package/dist/node-runtime/chunk-PBC2Y6GS.js +903 -0
  207. package/dist/node-runtime/chunk-PCGNAY2O.js +1324 -0
  208. package/dist/node-runtime/chunk-PCIGF2XK.js +250 -0
  209. package/dist/node-runtime/chunk-PGAJ5MO5.js +7558 -0
  210. package/dist/node-runtime/chunk-PL6JKXWI.js +3622 -0
  211. package/dist/node-runtime/chunk-PVCDKGR6.js +55 -0
  212. package/dist/node-runtime/chunk-Q4Q6D4IY.js +364 -0
  213. package/dist/node-runtime/chunk-Q5ZU2VRT.js +83 -0
  214. package/dist/node-runtime/chunk-QFWG2RVL.js +5477 -0
  215. package/dist/node-runtime/chunk-QH42CDX3.js +9451 -0
  216. package/dist/node-runtime/chunk-RQ2Q5IYR.js +72 -0
  217. package/dist/node-runtime/chunk-RQ5DNUNG.js +429 -0
  218. package/dist/node-runtime/chunk-RRIZE6QQ.js +17 -0
  219. package/dist/node-runtime/chunk-SN6G4OU6.js +4753 -0
  220. package/dist/node-runtime/chunk-SWSN6HAB.js +53 -0
  221. package/dist/node-runtime/chunk-TQNSPERU.js +949 -0
  222. package/dist/node-runtime/chunk-VRB2IYGG.js +53 -0
  223. package/dist/node-runtime/chunk-VSELYKWU.js +772 -0
  224. package/dist/node-runtime/chunk-W3CVH5RX.js +62 -0
  225. package/dist/node-runtime/chunk-WJVFOIB5.js +24921 -0
  226. package/dist/node-runtime/chunk-WOVTOV5P.js +5653 -0
  227. package/dist/node-runtime/chunk-XBWPBZBN.js +125 -0
  228. package/dist/node-runtime/chunk-XTHQ7XR7.js +509 -0
  229. package/dist/node-runtime/chunk-YF63P5ZT.js +864 -0
  230. package/dist/node-runtime/chunk-YSKSB3BJ.js +295 -0
  231. package/dist/node-runtime/chunk-ZCHMJ34K.js +130 -0
  232. package/dist/node-runtime/chunk-ZKMFUD3Q.js +2834 -0
  233. package/dist/node-runtime/cli-runtime.js +81 -0
  234. package/dist/node-runtime/clipboard-OZ63BBC6.js +12 -0
  235. package/dist/node-runtime/clipboard-image-7QR6GXVA.js +13 -0
  236. package/dist/node-runtime/command-L3LAHDIH.js +13 -0
  237. package/dist/node-runtime/commands-RL5YBW5I.js +291 -0
  238. package/dist/node-runtime/config-FMEOZSWE.js +77 -0
  239. package/dist/node-runtime/curator-server-XCM43VEF.js +3816 -0
  240. package/dist/node-runtime/customize-XEXL2DGQ.js +12 -0
  241. package/dist/node-runtime/direct-tool-executor-JVDXTO7A.js +188 -0
  242. package/dist/node-runtime/exa-LL64QZR2.js +329 -0
  243. package/dist/node-runtime/export-html-KR26FOUZ.js +150 -0
  244. package/dist/node-runtime/extension-input-RV5N6APL.js +14 -0
  245. package/dist/node-runtime/extension-selector-CPD5LWDD.js +14 -0
  246. package/dist/node-runtime/extract-XLQSJN4V.js +17 -0
  247. package/dist/node-runtime/file-sync-HCOP2QVF.js +117 -0
  248. package/dist/node-runtime/gateway-X2TI5X7F.js +2484 -0
  249. package/dist/node-runtime/gemini-api-QE7ANVDZ.js +29 -0
  250. package/dist/node-runtime/gemini-search-U7SUMPQA.js +330 -0
  251. package/dist/node-runtime/gemini-url-context-PXWCBQHK.js +103 -0
  252. package/dist/node-runtime/gemini-web-MM446SEH.js +14 -0
  253. package/dist/node-runtime/github-extract-F64RZOEA.js +619 -0
  254. package/dist/node-runtime/goal-CZQ7FFQJ.js +1831 -0
  255. package/dist/node-runtime/index.js +859 -0
  256. package/dist/node-runtime/init-NJV2T55N.js +28 -0
  257. package/dist/node-runtime/install-cli-TH7IJJQQ.js +308 -0
  258. package/dist/node-runtime/interactive-mode-KOM35YF2.js +56 -0
  259. package/dist/node-runtime/interactive-view-U6OILKF3.js +249 -0
  260. package/dist/node-runtime/lsp-manager-3ASUSO4T.js +1104 -0
  261. package/dist/node-runtime/lunr-cron-YJ5UHYRD.js +268 -0
  262. package/dist/node-runtime/main.js +54 -0
  263. package/dist/node-runtime/mcp-auth-flow-QIXHW6QN.js +32 -0
  264. package/dist/node-runtime/mcp-panel-IIGMXQGP.js +501 -0
  265. package/dist/node-runtime/mcp-setup-panel-FEK7663I.js +355 -0
  266. package/dist/node-runtime/memory-cap-3S4XRLNP.js +20 -0
  267. package/dist/node-runtime/model-tiers-NJLHUEGK.js +20 -0
  268. package/dist/node-runtime/openai-search-B3MSNCQA.js +288 -0
  269. package/dist/node-runtime/package-manager-cli-TZZHJCVI.js +749 -0
  270. package/dist/node-runtime/parallel-AI2MNSCU.js +265 -0
  271. package/dist/node-runtime/parser-manager-TQHWYDH7.js +152 -0
  272. package/dist/node-runtime/pdf-extract-IPE6H4HP.js +57 -0
  273. package/dist/node-runtime/perplexity-QVJW3I35.js +12 -0
  274. package/dist/node-runtime/pi-intercom-EEMBGQID.js +2215 -0
  275. package/dist/node-runtime/pi-mcp-adapter-QFB37AVN.js +422 -0
  276. package/dist/node-runtime/pi-ollama-cloud-4VZRMULP.js +1440 -0
  277. package/dist/node-runtime/pi-prompt-template-model-4QT4LLXF.js +3946 -0
  278. package/dist/node-runtime/pi-subagents-7XJ4H53P.js +6023 -0
  279. package/dist/node-runtime/pi-web-access-DPGAVKOA.js +1864 -0
  280. package/dist/node-runtime/print-mode-VWIRFDAC.js +12 -0
  281. package/dist/node-runtime/proxy-modes-HEEFK4KC.js +685 -0
  282. package/dist/node-runtime/rpc-entry.js +62 -0
  283. package/dist/node-runtime/rpc-mode-SJNSOA4G.js +13 -0
  284. package/dist/node-runtime/runtime-bridges-PPHNBFWL.js +14 -0
  285. package/dist/node-runtime/session-manager-MQNBYACL.js +35 -0
  286. package/dist/node-runtime/session-selector-5AZLJS6U.js +14 -0
  287. package/dist/node-runtime/settings-manager-5LF2VQWC.js +21 -0
  288. package/dist/node-runtime/src-Y7JSCK64.js +2407 -0
  289. package/dist/node-runtime/subagent-executor-5RNDEPIJ.js +8483 -0
  290. package/dist/node-runtime/summary-review-YSMXKITO.js +228 -0
  291. package/dist/node-runtime/tavily-WEZFVFP7.js +154 -0
  292. package/dist/node-runtime/timings-UAD5BEAS.js +16 -0
  293. package/dist/node-runtime/tool-renderer-MV5O452K.js +204 -0
  294. package/dist/node-runtime/update-cli-A253SZ7P.js +73 -0
  295. package/dist/node-runtime/v4-5MNC3H7G.js +424 -0
  296. package/dist/node-runtime/video-extract-OYT5WKS5.js +304 -0
  297. package/dist/node-runtime/workspace-index-6DBXSTJ6.js +163 -0
  298. package/dist/node-runtime/youtube-extract-TQYKGFGS.js +264 -0
  299. package/dist/startup/benchmark-request.d.ts +3 -0
  300. package/dist/startup/benchmark-request.d.ts.map +1 -0
  301. package/dist/startup/benchmark-request.js +65 -0
  302. package/dist/startup/benchmark-request.js.map +1 -0
  303. package/dist/startup/interactive-view.d.ts +55 -0
  304. package/dist/startup/interactive-view.d.ts.map +1 -0
  305. package/dist/startup/interactive-view.js +332 -0
  306. package/dist/startup/interactive-view.js.map +1 -0
  307. package/dist/startup/launch-routing.d.ts.map +1 -1
  308. package/dist/startup/launch-routing.js +9 -10
  309. package/dist/startup/launch-routing.js.map +1 -1
  310. package/dist/startup/startup-milestones.d.ts +1 -1
  311. package/dist/startup/startup-milestones.d.ts.map +1 -1
  312. package/dist/startup/startup-milestones.js +3 -2
  313. package/dist/startup/startup-milestones.js.map +1 -1
  314. package/dist/utils/await-with-abort.d.ts +2 -0
  315. package/dist/utils/await-with-abort.d.ts.map +1 -0
  316. package/dist/utils/await-with-abort.js +19 -0
  317. package/dist/utils/await-with-abort.js.map +1 -0
  318. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  319. package/dist/utils/syntax-highlight.js +10 -4
  320. package/dist/utils/syntax-highlight.js.map +1 -1
  321. package/docs/compaction.md +5 -3
  322. package/docs/development.md +5 -1
  323. package/docs/features.md +0 -1
  324. package/docs/interactive-startup.md +98 -0
  325. package/docs/usage.md +0 -1
  326. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  327. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  328. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  329. package/examples/extensions/gondolin/package-lock.json +2 -2
  330. package/examples/extensions/gondolin/package.json +1 -1
  331. package/examples/extensions/sandbox/package-lock.json +2 -2
  332. package/examples/extensions/sandbox/package.json +1 -1
  333. package/examples/extensions/with-deps/package-lock.json +2 -2
  334. package/examples/extensions/with-deps/package.json +1 -1
  335. package/package.json +20 -20
  336. package/dist/core/swarm.d.ts +0 -23
  337. package/dist/core/swarm.d.ts.map +0 -1
  338. package/dist/core/swarm.js +0 -45
  339. package/dist/core/swarm.js.map +0 -1
@@ -0,0 +1,228 @@
1
+ import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
2
+ import {
3
+ loadEnabledModelPatterns,
4
+ modelMatchesEnabledPatterns
5
+ } from "./chunk-4ZWGEEAS.js";
6
+ import "./chunk-BRJX2PRC.js";
7
+
8
+ // packages/coding-agent/dist/builtin-extensions/pi-web-access/summary-review.js
9
+ import { complete } from "@ashx-j/lunr-ai/compat";
10
+ var PREFERRED_SUMMARY_MODELS = [
11
+ { provider: "anthropic", id: "claude-haiku-4-5" },
12
+ { provider: "openai-codex", id: "gpt-5.3-codex-spark" }
13
+ ];
14
+ function estimateTokens(text) {
15
+ let trimmed = text.trim();
16
+ return trimmed.length === 0 ? 0 : Math.max(1, Math.ceil(trimmed.length / 4));
17
+ }
18
+ function summarizeQueryResult(result) {
19
+ if (result.error)
20
+ return `Query: ${result.query}
21
+ Status: Error
22
+ Error: ${result.error}`;
23
+ let lines = [
24
+ `Query: ${result.query}`,
25
+ `Provider: ${result.provider ?? "unknown"}`,
26
+ `Answer: ${result.answer || "(no answer text returned)"}`
27
+ ];
28
+ if (result.results.length === 0)
29
+ return lines.push("Sources: none"), lines.join(`
30
+ `);
31
+ lines.push("Sources:");
32
+ for (let i = 0; i < result.results.length; i++) {
33
+ let source = result.results[i];
34
+ lines.push(`${i + 1}. ${source.title} \u2014 ${source.url}`);
35
+ }
36
+ return lines.join(`
37
+ `);
38
+ }
39
+ function buildSummaryPrompt(results, feedback) {
40
+ let sections = [
41
+ "You are writing the final web search summary for a coding assistant.",
42
+ "Write a concise, factual summary using only the provided search results.",
43
+ "Requirements:",
44
+ "- Keep it readable and skimmable.",
45
+ "- Include key findings and caveats.",
46
+ "- Do not invent sources or claims.",
47
+ "- If evidence is weak or conflicting, say so explicitly.",
48
+ '- End with a short "Sources" section listing the most relevant URLs.'
49
+ ];
50
+ feedback && sections.push("- Incorporate the user feedback provided below into the summary."), sections.push(""), sections.push("<search_results>");
51
+ for (let i = 0; i < results.length; i++)
52
+ sections.push(`
53
+ [Result ${i + 1}]`), sections.push(summarizeQueryResult(results[i]));
54
+ return sections.push(`
55
+ </search_results>`), feedback && (sections.push(""), sections.push("<user_feedback>"), sections.push(feedback), sections.push("</user_feedback>")), sections.join(`
56
+ `);
57
+ }
58
+ function buildDeterministicAnswerPreview(answer) {
59
+ let text = answer.replace(/\s+/g, " ").trim();
60
+ if (text.length === 0)
61
+ return "";
62
+ let sourceMarker = text.search(/\bSources?\s*:/i);
63
+ return sourceMarker >= 0 && (text = text.slice(0, sourceMarker).trim()), text.length === 0 ? "" : text.length > 240 ? `${text.slice(0, 237)}...` : text;
64
+ }
65
+ function buildDeterministicSummaryLines(results) {
66
+ if (results.length === 0)
67
+ return [
68
+ "No completed search results were available when the curator session finished.",
69
+ "",
70
+ "Sources",
71
+ "- None"
72
+ ];
73
+ let lines = [
74
+ "Summary based on the currently selected search results.",
75
+ ""
76
+ ], sourceUrls = [], successful = 0, failed = 0;
77
+ for (let result of results) {
78
+ if (result.error) {
79
+ failed += 1, lines.push(`- ${result.query}: failed (${result.error})`);
80
+ continue;
81
+ }
82
+ successful += 1;
83
+ let preview = buildDeterministicAnswerPreview(result.answer);
84
+ preview.length > 0 ? lines.push(`- ${result.query}: ${preview}`) : lines.push(`- ${result.query}: returned ${result.results.length} source${result.results.length === 1 ? "" : "s"} without answer text.`);
85
+ for (let source of result.results)
86
+ sourceUrls.includes(source.url) || sourceUrls.push(source.url);
87
+ }
88
+ if (lines.push(""), lines.push(`Completed queries: ${results.length}`), lines.push(`Successful: ${successful}`), lines.push(`Failed: ${failed}`), lines.push(""), lines.push("Sources"), sourceUrls.length === 0)
89
+ lines.push("- None");
90
+ else {
91
+ for (let url of sourceUrls.slice(0, 12))
92
+ lines.push(`- ${url}`);
93
+ sourceUrls.length > 12 && lines.push(`- ... and ${sourceUrls.length - 12} more`);
94
+ }
95
+ return lines;
96
+ }
97
+ function buildDeterministicSummary(results) {
98
+ let summary = buildDeterministicSummaryLines(results).join(`
99
+ `).trim(), nonEmptySummary = summary.length > 0 ? summary : `No completed search results were available when the curator session finished.
100
+
101
+ Sources
102
+ - None`;
103
+ return {
104
+ summary: nonEmptySummary,
105
+ meta: {
106
+ model: null,
107
+ durationMs: 0,
108
+ tokenEstimate: estimateTokens(nonEmptySummary),
109
+ fallbackUsed: !0,
110
+ fallbackReason: "deterministic-submit-fallback",
111
+ edited: !1
112
+ }
113
+ };
114
+ }
115
+ function parseModelSelector(value) {
116
+ let slashIndex = value.indexOf("/");
117
+ if (slashIndex <= 0 || slashIndex >= value.length - 1)
118
+ throw new Error(`Invalid summary model: ${value}. Use provider/model-id.`);
119
+ return {
120
+ provider: value.slice(0, slashIndex),
121
+ id: value.slice(slashIndex + 1)
122
+ };
123
+ }
124
+ async function resolveSummaryModelCandidates(ctx, modelOverride) {
125
+ let enabledModelPatterns = loadEnabledModelPatterns(ctx), specs = [], normalizedOverride = typeof modelOverride == "string" ? modelOverride.trim() : "";
126
+ normalizedOverride.length > 0 && specs.push(parseModelSelector(normalizedOverride)), specs.push(...PREFERRED_SUMMARY_MODELS);
127
+ let candidates = [], errors = [], seen = /* @__PURE__ */ new Set();
128
+ for (let spec of specs) {
129
+ let value = `${spec.provider}/${spec.id}`;
130
+ if (seen.has(value))
131
+ continue;
132
+ seen.add(value);
133
+ let model = ctx.modelRegistry.find(spec.provider, spec.id);
134
+ if (!model) {
135
+ errors.push(`Summary model not found: ${value}`);
136
+ continue;
137
+ }
138
+ if (!modelMatchesEnabledPatterns(model, enabledModelPatterns)) {
139
+ errors.push(`Summary model is not enabled: ${value}`);
140
+ continue;
141
+ }
142
+ let auth = await ctx.modelRegistry.getApiKeyAndHeaders(model);
143
+ if (!auth.ok || !auth.apiKey) {
144
+ errors.push(`No API key available for summary model ${value}`);
145
+ continue;
146
+ }
147
+ candidates.push({ model, apiKey: auth.apiKey, headers: auth.headers });
148
+ }
149
+ return { candidates, errors };
150
+ }
151
+ function buildFallbackSummary(results, fallbackReason) {
152
+ let deterministic = buildDeterministicSummary(results);
153
+ return {
154
+ summary: deterministic.summary,
155
+ meta: {
156
+ ...deterministic.meta,
157
+ fallbackReason
158
+ }
159
+ };
160
+ }
161
+ function isAbortError(err) {
162
+ if (!err || typeof err != "object")
163
+ return !1;
164
+ let name = err.name, message = err.message;
165
+ return name === "AbortError" || typeof message == "string" && message.toLowerCase().includes("abort");
166
+ }
167
+ function getTextFromContentPart(part) {
168
+ if (!part || typeof part != "object")
169
+ return "";
170
+ let value = part;
171
+ return typeof value.text == "string" ? value.text : typeof value.refusal == "string" ? value.refusal : "";
172
+ }
173
+ function getContentPartType(part) {
174
+ if (!part || typeof part != "object")
175
+ return "unknown";
176
+ let value = part;
177
+ return typeof value.type == "string" ? value.type : "unknown";
178
+ }
179
+ async function generateSummaryDraft(results, ctx, signal, modelOverride, feedback) {
180
+ if (!ctx || !ctx.modelRegistry)
181
+ throw new Error("Summary generation context unavailable");
182
+ let prompt = buildSummaryPrompt(results, feedback), resolved;
183
+ try {
184
+ resolved = await resolveSummaryModelCandidates(ctx, modelOverride);
185
+ } catch (err) {
186
+ let message = err instanceof Error ? err.message : String(err);
187
+ return buildFallbackSummary(results, `summary-model-settings-error: ${message}`);
188
+ }
189
+ let lastError = resolved.errors.at(-1);
190
+ for (let { model, apiKey, headers } of resolved.candidates) {
191
+ let startedAt = Date.now();
192
+ try {
193
+ let userMessage = {
194
+ role: "user",
195
+ content: [{ type: "text", text: prompt }],
196
+ timestamp: Date.now()
197
+ }, response = await complete(model, { messages: [userMessage] }, { apiKey, headers, signal });
198
+ if (response.stopReason === "aborted")
199
+ throw new Error("Aborted");
200
+ let contentParts = Array.isArray(response.content) ? response.content : [], summary = contentParts.map((part) => getTextFromContentPart(part)).filter((text) => text.trim().length > 0).join(`
201
+ `).trim();
202
+ if (summary.length === 0) {
203
+ let partTypes = contentParts.map((part) => getContentPartType(part)), typesLabel = partTypes.length > 0 ? partTypes.join(", ") : "none";
204
+ throw new Error(`Summary model returned empty response (content parts: ${typesLabel})`);
205
+ }
206
+ return {
207
+ summary,
208
+ meta: {
209
+ model: `${model.provider}/${model.id}`,
210
+ durationMs: Math.max(0, Date.now() - startedAt),
211
+ tokenEstimate: estimateTokens(summary),
212
+ fallbackUsed: !1,
213
+ edited: !1
214
+ }
215
+ };
216
+ } catch (err) {
217
+ if (isAbortError(err))
218
+ throw err;
219
+ lastError = err instanceof Error ? err.message : String(err);
220
+ }
221
+ }
222
+ return buildFallbackSummary(results, lastError ? `summary-model-unavailable: ${lastError}` : "summary-model-unavailable");
223
+ }
224
+ export {
225
+ buildDeterministicSummary,
226
+ buildSummaryPrompt,
227
+ generateSummaryDraft
228
+ };
@@ -0,0 +1,154 @@
1
+ import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
2
+ import {
3
+ activityMonitor
4
+ } from "./chunk-DAPBPCBP.js";
5
+ import {
6
+ getWebSearchConfigPath
7
+ } from "./chunk-VRB2IYGG.js";
8
+ import "./chunk-BRJX2PRC.js";
9
+
10
+ // packages/coding-agent/dist/builtin-extensions/pi-web-access/tavily.js
11
+ import { existsSync, readFileSync } from "node:fs";
12
+ var TAVILY_API_URL = "https://api.tavily.com/search", CONFIG_PATH = getWebSearchConfigPath(), SEARCH_TIMEOUT_MS = 6e4, cachedConfig = null;
13
+ function loadConfig() {
14
+ if (cachedConfig)
15
+ return cachedConfig;
16
+ if (!existsSync(CONFIG_PATH))
17
+ return cachedConfig = {}, cachedConfig;
18
+ let raw = readFileSync(CONFIG_PATH, "utf-8");
19
+ try {
20
+ return cachedConfig = JSON.parse(raw), cachedConfig;
21
+ } catch (err) {
22
+ let message = err instanceof Error ? err.message : String(err);
23
+ throw new Error(`Failed to parse ${CONFIG_PATH}: ${message}`);
24
+ }
25
+ }
26
+ function normalizeApiKey(value) {
27
+ if (typeof value != "string")
28
+ return null;
29
+ let normalized = value.trim();
30
+ return normalized.length > 0 ? normalized : null;
31
+ }
32
+ function getApiKey() {
33
+ return normalizeApiKey(process.env.TAVILY_API_KEY) ?? normalizeApiKey(loadConfig().tavilyApiKey);
34
+ }
35
+ function requireApiKey() {
36
+ let apiKey = getApiKey();
37
+ if (!apiKey)
38
+ throw new Error(`Tavily API key not found. Either:
39
+ 1. Create ${CONFIG_PATH} with { "tavilyApiKey": "your-key" }
40
+ 2. Set TAVILY_API_KEY environment variable
41
+ Get a key at https://app.tavily.com/`);
42
+ return apiKey;
43
+ }
44
+ function normalizeCount(value) {
45
+ return typeof value != "number" || !Number.isFinite(value) ? 5 : Math.max(1, Math.min(Math.floor(value), 20));
46
+ }
47
+ function normalizeDomain(value) {
48
+ let input = value.trim().toLowerCase();
49
+ if (!input || (input.startsWith("-") && (input = input.slice(1).trim()), !input))
50
+ return null;
51
+ try {
52
+ input = (input.includes("://") ? new URL(input) : new URL(`https://${input}`)).hostname;
53
+ } catch {
54
+ input = input.split("/")[0]?.split(":")[0] ?? "";
55
+ }
56
+ return input = input.replace(/^\.+|\.+$/g, ""), /^[a-z0-9][a-z0-9.-]*\.[a-z]{2,}$/i.test(input) ? input : null;
57
+ }
58
+ function mapDomainFilter(domainFilter) {
59
+ if (!domainFilter?.length)
60
+ return {};
61
+ let include_domains = [], exclude_domains = [];
62
+ for (let raw of domainFilter) {
63
+ let domain = normalizeDomain(raw);
64
+ if (!domain)
65
+ continue;
66
+ let target = raw.trim().startsWith("-") ? exclude_domains : include_domains;
67
+ target.includes(domain) || target.push(domain);
68
+ }
69
+ return {
70
+ ...include_domains.length > 0 ? { include_domains } : {},
71
+ ...exclude_domains.length > 0 ? { exclude_domains } : {}
72
+ };
73
+ }
74
+ function requestSignal(signal) {
75
+ let timeout = AbortSignal.timeout(SEARCH_TIMEOUT_MS);
76
+ return signal ? AbortSignal.any([signal, timeout]) : timeout;
77
+ }
78
+ function errorMessage(err) {
79
+ return err instanceof Error ? err.message : String(err);
80
+ }
81
+ function mapResults(results, numResults) {
82
+ if (!Array.isArray(results))
83
+ return [];
84
+ let mapped = [];
85
+ for (let item of results)
86
+ if (item?.url && (mapped.push({
87
+ title: item.title || `Source ${mapped.length + 1}`,
88
+ url: item.url,
89
+ snippet: typeof item.content == "string" ? item.content.replace(/\s+/g, " ").trim() : ""
90
+ }), mapped.length >= numResults))
91
+ break;
92
+ return mapped;
93
+ }
94
+ function mapInlineContent(results) {
95
+ return Array.isArray(results) ? results.flatMap((item) => !item?.url || typeof item.raw_content != "string" || item.raw_content.trim().length === 0 ? [] : [{
96
+ url: item.url,
97
+ title: item.title || "",
98
+ content: item.raw_content,
99
+ error: null
100
+ }]) : [];
101
+ }
102
+ function isTavilyAvailable() {
103
+ return !!getApiKey();
104
+ }
105
+ async function searchWithTavily(query, options = {}) {
106
+ let numResults = normalizeCount(options.numResults), body = {
107
+ query,
108
+ search_depth: "basic",
109
+ max_results: numResults,
110
+ include_answer: "basic",
111
+ include_raw_content: options.includeContent ? "markdown" : !1,
112
+ ...options.recencyFilter ? { time_range: options.recencyFilter } : {},
113
+ ...mapDomainFilter(options.domainFilter)
114
+ }, activityId = activityMonitor.logStart({ type: "api", query }), response;
115
+ try {
116
+ response = await fetch(TAVILY_API_URL, {
117
+ method: "POST",
118
+ headers: {
119
+ Authorization: `Bearer ${requireApiKey()}`,
120
+ "Content-Type": "application/json"
121
+ },
122
+ body: JSON.stringify(body),
123
+ signal: requestSignal(options.signal)
124
+ });
125
+ } catch (err) {
126
+ let message = errorMessage(err);
127
+ throw message.toLowerCase().includes("abort") ? activityMonitor.logComplete(activityId, 0) : activityMonitor.logError(activityId, message), err;
128
+ }
129
+ if (!response.ok) {
130
+ activityMonitor.logComplete(activityId, response.status);
131
+ let errorText = await response.text();
132
+ throw new Error(`Tavily API error ${response.status}: ${errorText.slice(0, 300)}`);
133
+ }
134
+ let data;
135
+ try {
136
+ data = await response.json();
137
+ } catch (err) {
138
+ throw activityMonitor.logComplete(activityId, response.status), new Error(`Tavily API returned invalid JSON: ${errorMessage(err)}`);
139
+ }
140
+ activityMonitor.logComplete(activityId, response.status);
141
+ let result = {
142
+ answer: typeof data.answer == "string" ? data.answer : "",
143
+ results: mapResults(data.results, numResults)
144
+ };
145
+ if (options.includeContent) {
146
+ let inlineContent = mapInlineContent(data.results);
147
+ inlineContent.length > 0 && (result.inlineContent = inlineContent);
148
+ }
149
+ return result;
150
+ }
151
+ export {
152
+ isTavilyAvailable,
153
+ searchWithTavily
154
+ };
@@ -0,0 +1,16 @@
1
+ import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
2
+ import {
3
+ measureStartup,
4
+ noteImportMain,
5
+ printTimings,
6
+ resetTimings,
7
+ time
8
+ } from "./chunk-PVCDKGR6.js";
9
+ import "./chunk-BRJX2PRC.js";
10
+ export {
11
+ measureStartup,
12
+ noteImportMain,
13
+ printTimings,
14
+ resetTimings,
15
+ time
16
+ };
@@ -0,0 +1,204 @@
1
+ import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
2
+ import "./chunk-BRJX2PRC.js";
3
+
4
+ // packages/coding-agent/dist/core/export-html/ansi-to-html.js
5
+ var ANSI_COLORS = [
6
+ "#000000",
7
+ // 0: black
8
+ "#800000",
9
+ // 1: red
10
+ "#008000",
11
+ // 2: green
12
+ "#808000",
13
+ // 3: yellow
14
+ "#000080",
15
+ // 4: blue
16
+ "#800080",
17
+ // 5: magenta
18
+ "#008080",
19
+ // 6: cyan
20
+ "#c0c0c0",
21
+ // 7: white
22
+ "#808080",
23
+ // 8: bright black
24
+ "#ff0000",
25
+ // 9: bright red
26
+ "#00ff00",
27
+ // 10: bright green
28
+ "#ffff00",
29
+ // 11: bright yellow
30
+ "#0000ff",
31
+ // 12: bright blue
32
+ "#ff00ff",
33
+ // 13: bright magenta
34
+ "#00ffff",
35
+ // 14: bright cyan
36
+ "#ffffff"
37
+ // 15: bright white
38
+ ];
39
+ function color256ToHex(index) {
40
+ if (index < 16)
41
+ return ANSI_COLORS[index];
42
+ if (index < 232) {
43
+ let cubeIndex = index - 16, r = Math.floor(cubeIndex / 36), g = Math.floor(cubeIndex % 36 / 6), b = cubeIndex % 6, toComponent = (n) => n === 0 ? 0 : 55 + n * 40, toHex = (n) => toComponent(n).toString(16).padStart(2, "0");
44
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
45
+ }
46
+ let grayHex = (8 + (index - 232) * 10).toString(16).padStart(2, "0");
47
+ return `#${grayHex}${grayHex}${grayHex}`;
48
+ }
49
+ function escapeHtml(text) {
50
+ return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
51
+ }
52
+ function createEmptyStyle() {
53
+ return {
54
+ fg: null,
55
+ bg: null,
56
+ bold: !1,
57
+ dim: !1,
58
+ italic: !1,
59
+ underline: !1
60
+ };
61
+ }
62
+ function styleToInlineCSS(style) {
63
+ let parts = [];
64
+ return style.fg && parts.push(`color:${style.fg}`), style.bg && parts.push(`background-color:${style.bg}`), style.bold && parts.push("font-weight:bold"), style.dim && parts.push("opacity:0.6"), style.italic && parts.push("font-style:italic"), style.underline && parts.push("text-decoration:underline"), parts.join(";");
65
+ }
66
+ function hasStyle(style) {
67
+ return style.fg !== null || style.bg !== null || style.bold || style.dim || style.italic || style.underline;
68
+ }
69
+ function applySgrCode(params, style) {
70
+ let i = 0;
71
+ for (; i < params.length; ) {
72
+ let code = params[i];
73
+ if (code === 0)
74
+ style.fg = null, style.bg = null, style.bold = !1, style.dim = !1, style.italic = !1, style.underline = !1;
75
+ else if (code === 1)
76
+ style.bold = !0;
77
+ else if (code === 2)
78
+ style.dim = !0;
79
+ else if (code === 3)
80
+ style.italic = !0;
81
+ else if (code === 4)
82
+ style.underline = !0;
83
+ else if (code === 22)
84
+ style.bold = !1, style.dim = !1;
85
+ else if (code === 23)
86
+ style.italic = !1;
87
+ else if (code === 24)
88
+ style.underline = !1;
89
+ else if (code >= 30 && code <= 37)
90
+ style.fg = ANSI_COLORS[code - 30];
91
+ else if (code === 38) {
92
+ if (params[i + 1] === 5 && params.length > i + 2)
93
+ style.fg = color256ToHex(params[i + 2]), i += 2;
94
+ else if (params[i + 1] === 2 && params.length > i + 4) {
95
+ let r = params[i + 2], g = params[i + 3], b = params[i + 4];
96
+ style.fg = `rgb(${r},${g},${b})`, i += 4;
97
+ }
98
+ } else if (code === 39)
99
+ style.fg = null;
100
+ else if (code >= 40 && code <= 47)
101
+ style.bg = ANSI_COLORS[code - 40];
102
+ else if (code === 48) {
103
+ if (params[i + 1] === 5 && params.length > i + 2)
104
+ style.bg = color256ToHex(params[i + 2]), i += 2;
105
+ else if (params[i + 1] === 2 && params.length > i + 4) {
106
+ let r = params[i + 2], g = params[i + 3], b = params[i + 4];
107
+ style.bg = `rgb(${r},${g},${b})`, i += 4;
108
+ }
109
+ } else code === 49 ? style.bg = null : code >= 90 && code <= 97 ? style.fg = ANSI_COLORS[code - 90 + 8] : code >= 100 && code <= 107 && (style.bg = ANSI_COLORS[code - 100 + 8]);
110
+ i++;
111
+ }
112
+ }
113
+ var ANSI_REGEX = /\x1b\[([\d;]*)m/g;
114
+ function ansiToHtml(text) {
115
+ let style = createEmptyStyle(), result = "", lastIndex = 0, inSpan = !1;
116
+ ANSI_REGEX.lastIndex = 0;
117
+ let match = ANSI_REGEX.exec(text);
118
+ for (; match !== null; ) {
119
+ let beforeText = text.slice(lastIndex, match.index);
120
+ beforeText && (result += escapeHtml(beforeText));
121
+ let paramStr = match[1], params = paramStr ? paramStr.split(";").map((p) => parseInt(p, 10) || 0) : [0];
122
+ inSpan && (result += "</span>", inSpan = !1), applySgrCode(params, style), hasStyle(style) && (result += `<span style="${styleToInlineCSS(style)}">`, inSpan = !0), lastIndex = match.index + match[0].length, match = ANSI_REGEX.exec(text);
123
+ }
124
+ let remainingText = text.slice(lastIndex);
125
+ return remainingText && (result += escapeHtml(remainingText)), inSpan && (result += "</span>"), result;
126
+ }
127
+ function ansiLinesToHtml(lines) {
128
+ return lines.map((line) => `<div class="ansi-line">${ansiToHtml(line) || "&nbsp;"}</div>`).join("");
129
+ }
130
+
131
+ // packages/coding-agent/dist/core/export-html/tool-renderer.js
132
+ var ANSI_ESCAPE_REGEX = /\x1b\[[\d;]*m/g;
133
+ function isBlankRenderedLine(line) {
134
+ return line.replace(ANSI_ESCAPE_REGEX, "").trim().length === 0;
135
+ }
136
+ function trimRenderedResultLines(lines) {
137
+ let start = 0, end = lines.length;
138
+ for (; start < end && isBlankRenderedLine(lines[start]); )
139
+ start++;
140
+ for (; end > start && isBlankRenderedLine(lines[end - 1]); )
141
+ end--;
142
+ return lines.slice(start, end);
143
+ }
144
+ function createToolHtmlRenderer(deps) {
145
+ let { getToolDefinition, theme, cwd, width = 100 } = deps, renderedCallComponents = /* @__PURE__ */ new Map(), renderedResultComponents = /* @__PURE__ */ new Map(), renderedStates = /* @__PURE__ */ new Map(), renderedArgs = /* @__PURE__ */ new Map(), getState = (toolCallId) => {
146
+ let state = renderedStates.get(toolCallId);
147
+ return state || (state = {}, renderedStates.set(toolCallId, state)), state;
148
+ }, createRenderContext = (toolCallId, lastComponent, expanded, isPartial, isError) => ({
149
+ args: renderedArgs.get(toolCallId),
150
+ toolCallId,
151
+ invalidate: () => {
152
+ },
153
+ lastComponent,
154
+ state: getState(toolCallId),
155
+ cwd,
156
+ executionStarted: !0,
157
+ argsComplete: !0,
158
+ isPartial,
159
+ expanded,
160
+ showImages: !1,
161
+ isError
162
+ });
163
+ return {
164
+ renderCall(toolCallId, toolName, args) {
165
+ try {
166
+ renderedArgs.set(toolCallId, args);
167
+ let toolDef = getToolDefinition(toolName);
168
+ if (!toolDef?.renderCall)
169
+ return;
170
+ let component = toolDef.renderCall(args, theme, createRenderContext(toolCallId, renderedCallComponents.get(toolCallId), !1, !0, !1));
171
+ renderedCallComponents.set(toolCallId, component);
172
+ let lines = component.render(width);
173
+ return ansiLinesToHtml(lines);
174
+ } catch {
175
+ return;
176
+ }
177
+ },
178
+ renderResult(toolCallId, toolName, result, details, isError) {
179
+ try {
180
+ let toolDef = getToolDefinition(toolName);
181
+ if (!toolDef?.renderResult)
182
+ return;
183
+ let agentToolResult = {
184
+ content: result,
185
+ details,
186
+ isError
187
+ }, collapsedComponent = toolDef.renderResult(agentToolResult, { expanded: !1, isPartial: !1 }, theme, createRenderContext(toolCallId, renderedResultComponents.get(toolCallId), !1, !1, isError));
188
+ renderedResultComponents.set(toolCallId, collapsedComponent);
189
+ let collapsed = ansiLinesToHtml(trimRenderedResultLines(collapsedComponent.render(width))), expandedComponent = toolDef.renderResult(agentToolResult, { expanded: !0, isPartial: !1 }, theme, createRenderContext(toolCallId, renderedResultComponents.get(toolCallId), !0, !1, isError));
190
+ renderedResultComponents.set(toolCallId, expandedComponent);
191
+ let expanded = ansiLinesToHtml(trimRenderedResultLines(expandedComponent.render(width)));
192
+ return {
193
+ ...collapsed && collapsed !== expanded ? { collapsed } : {},
194
+ expanded
195
+ };
196
+ } catch {
197
+ return;
198
+ }
199
+ }
200
+ };
201
+ }
202
+ export {
203
+ createToolHtmlRenderer
204
+ };
@@ -0,0 +1,73 @@
1
+ import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
2
+ import {
3
+ checkForUpdate,
4
+ isPublishedInstall
5
+ } from "./chunk-BR7YDUKA.js";
6
+ import "./chunk-DVGWF6A2.js";
7
+ import {
8
+ SettingsManager
9
+ } from "./chunk-AJX357CL.js";
10
+ import "./chunk-AY6CAJSL.js";
11
+ import {
12
+ APP_NAME,
13
+ NPM_CLI_PACKAGE,
14
+ PACKAGE_NAME,
15
+ VERSION,
16
+ getAgentDir,
17
+ getPackageDir,
18
+ spawnProcess,
19
+ waitForChildProcess
20
+ } from "./chunk-PCIGF2XK.js";
21
+ import "./chunk-Q4Q6D4IY.js";
22
+ import "./chunk-BRJX2PRC.js";
23
+
24
+ // packages/coding-agent/dist/cli/update-cli.js
25
+ import chalk from "chalk";
26
+ function printUpdateHelp() {
27
+ console.log(`${chalk.bold("Usage:")}
28
+ ${APP_NAME} update [--self]
29
+
30
+ Reinstall the global ${NPM_CLI_PACKAGE} package from npm.
31
+
32
+ Options:
33
+ --self Same as \`${APP_NAME} update\` (kept for muscle memory)
34
+ -h, --help
35
+
36
+ This does not refresh model catalogs (/refresh) or extension packages (${APP_NAME} install).
37
+ `);
38
+ }
39
+ async function handleUpdateCli(args, deps = {}) {
40
+ if (args[0] !== "update")
41
+ return !1;
42
+ let rest = args.slice(1).filter((a) => a !== "--self");
43
+ if (rest.includes("-h") || rest.includes("--help"))
44
+ return printUpdateHelp(), process.exitCode = 0, !0;
45
+ if (rest.length > 0)
46
+ return (deps.error ?? console.error)(`Unknown argument: ${rest[0]}`), printUpdateHelp(), process.exitCode = 2, !0;
47
+ let npmPackage = deps.npmPackage ?? NPM_CLI_PACKAGE, appName = deps.appName ?? APP_NAME;
48
+ if (!(deps.published ?? isPublishedInstall(PACKAGE_NAME, npmPackage)))
49
+ return (deps.error ?? console.error)(`This tree is ${PACKAGE_NAME}, not a global ${NPM_CLI_PACKAGE} install. Use \`npm i -g ${NPM_CLI_PACKAGE}\` to update the published CLI; workspace \`npx ${APP_NAME}\` is not self-updated.`), process.exitCode = 1, !0;
50
+ let log = deps.log ?? console.log, error = deps.error ?? console.error, result = await (deps.check ?? checkForUpdate)({
51
+ currentVersion: deps.currentVersion ?? VERSION,
52
+ agentDir: getAgentDir(),
53
+ published: !0,
54
+ packageName: npmPackage,
55
+ appName,
56
+ offline: process.env.PI_OFFLINE === "1",
57
+ force: !0
58
+ });
59
+ if (!result)
60
+ return error("Could not reach the npm registry to check for updates."), process.exitCode = 1, !0;
61
+ if (!result.newer)
62
+ return log(`${appName} ${result.current} is up to date.`), process.exitCode = 0, !0;
63
+ let cwd = process.cwd(), npmArgv = SettingsManager.create(cwd, getAgentDir(), { projectTrusted: !1 }).getNpmCommand() ?? ["npm"], installArgv = [...npmArgv.slice(1), "install", "-g", `${npmPackage}@${result.latest}`], command = npmArgv[0] ?? "npm", packageDir = deps.packageDir ?? getPackageDir();
64
+ (deps.warn ?? console.warn)(`Installing ${npmPackage}@${result.latest}. If this process is the global install (${packageDir}), Windows may fail to overwrite files until ${appName} exits.`);
65
+ let code = await (deps.spawn ?? (async (cmd, argv) => {
66
+ let child = spawnProcess(cmd, argv, { stdio: "inherit" });
67
+ return waitForChildProcess(child);
68
+ }))(command, installArgv);
69
+ return process.exitCode = code === 0 || code === null ? 0 : code, (process.exitCode ?? 0) === 0 && log(`Updated ${appName} ${result.current} \u2192 ${result.latest}.`), !0;
70
+ }
71
+ export {
72
+ handleUpdateCli
73
+ };