@cortex-agent/server 2026.10.25 → 2026.10.28

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 (1877) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +23 -5
  3. package/THIRD_PARTY_NOTICES.txt +16546 -0
  4. package/defaults/prompts/clean-workspace.md +21 -0
  5. package/dist/agent-adapter/claude/remote-mcp-proxy.js +4 -66
  6. package/dist/chunks/anthropic-SUZWKBRW.js +4 -0
  7. package/dist/chunks/anthropic-messages-M3SMXACA.js +8 -0
  8. package/dist/chunks/api-GM53PHIL-GFHEXXE6.js +4 -0
  9. package/dist/chunks/azure-openai-responses-76YWXHSB.js +4 -0
  10. package/dist/chunks/bedrock-converse-stream-5UPX4NTQ.js +58 -0
  11. package/dist/chunks/child-runner-3GHOWGZP.js +4 -0
  12. package/dist/chunks/chunk-23PRJECN.js +4 -0
  13. package/dist/chunks/chunk-2ZNLUY2U.js +128 -0
  14. package/dist/chunks/chunk-3F6WW7HR.js +13 -0
  15. package/dist/chunks/chunk-3OKHUVEM.js +7 -0
  16. package/dist/chunks/chunk-3TGQSGG4.js +8 -0
  17. package/dist/chunks/chunk-3THJYAEF.js +4 -0
  18. package/dist/chunks/chunk-3YHOCPQU.js +10 -0
  19. package/dist/chunks/chunk-4EX2JJWB.js +4 -0
  20. package/dist/chunks/chunk-4LLH5OWM.js +10 -0
  21. package/dist/chunks/chunk-4U7XXM4W.js +4 -0
  22. package/dist/chunks/chunk-52T37Y47.js +8 -0
  23. package/dist/chunks/chunk-5M4PFLRW.js +4 -0
  24. package/dist/chunks/chunk-5NRGVROY.js +4 -0
  25. package/dist/chunks/chunk-5T7IX5KN.js +4 -0
  26. package/dist/chunks/chunk-6AKUD3CF.js +4 -0
  27. package/dist/chunks/chunk-6LZK4DDH.js +4 -0
  28. package/dist/chunks/chunk-6R73ICDB.js +4 -0
  29. package/dist/chunks/chunk-7MU2AKNM.js +4 -0
  30. package/dist/chunks/chunk-A34TDMIC.js +7 -0
  31. package/dist/chunks/chunk-AAA3UBIS.js +4 -0
  32. package/dist/chunks/chunk-ASYQHJVQ.js +9 -0
  33. package/dist/chunks/chunk-AWFUHWQK.js +4 -0
  34. package/dist/chunks/chunk-B3XBQEFM.js +4 -0
  35. package/dist/chunks/chunk-BGVHA2D4.js +4 -0
  36. package/dist/chunks/chunk-BGYR4ID3.js +4 -0
  37. package/dist/chunks/chunk-BKHDWCRT.js +79 -0
  38. package/dist/chunks/chunk-BR7A5SWM.js +23 -0
  39. package/dist/chunks/chunk-CQLH4UVX.js +4 -0
  40. package/dist/chunks/chunk-CVC66CFV.js +33 -0
  41. package/dist/chunks/chunk-CXT5IR5T.js +4 -0
  42. package/dist/chunks/chunk-D3NXKK2L.js +4 -0
  43. package/dist/chunks/chunk-D6UA4BZC.js +19 -0
  44. package/dist/chunks/chunk-D6VMBA4C.js +4 -0
  45. package/dist/chunks/chunk-DGMNI4AO.js +4 -0
  46. package/dist/chunks/chunk-DHSA5ACV.js +125 -0
  47. package/dist/chunks/chunk-DPQPXBTP.js +68 -0
  48. package/dist/chunks/chunk-DQJ6LLAS.js +4 -0
  49. package/dist/chunks/chunk-DXBSQXJL.js +18 -0
  50. package/dist/chunks/chunk-E6BYRULL.js +4 -0
  51. package/dist/chunks/chunk-E7ZMYIY6.js +30 -0
  52. package/dist/chunks/chunk-EQIMHXC4.js +5 -0
  53. package/dist/chunks/chunk-EQITBTJC.js +10 -0
  54. package/dist/chunks/chunk-EXJA5RIX.js +357 -0
  55. package/dist/chunks/chunk-FF7UELTU.js +4 -0
  56. package/dist/chunks/chunk-FH74NME3.js +115 -0
  57. package/dist/chunks/chunk-FOJQXLL2.js +6 -0
  58. package/dist/chunks/chunk-FOQ7VLIL.js +17 -0
  59. package/dist/chunks/chunk-FX6MOGLR.js +11 -0
  60. package/dist/chunks/chunk-FXDIR3SQ.js +4 -0
  61. package/dist/chunks/chunk-G2V65UBA.js +4 -0
  62. package/dist/chunks/chunk-H2FP6DG4.js +5 -0
  63. package/dist/chunks/chunk-HALUQ7ZF.js +4 -0
  64. package/dist/chunks/chunk-HGPBHTVD.js +6 -0
  65. package/dist/chunks/chunk-HU6UIDEJ.js +6 -0
  66. package/dist/chunks/chunk-I6OPDRVF.js +4 -0
  67. package/dist/chunks/chunk-ILEML5IP.js +4 -0
  68. package/dist/chunks/chunk-IRWZ7UPF.js +77 -0
  69. package/dist/chunks/chunk-J5DVLUKY.js +6 -0
  70. package/dist/chunks/chunk-JERCOLY3.js +142 -0
  71. package/dist/chunks/chunk-JW2HFMTF.js +4 -0
  72. package/dist/chunks/chunk-JXFG66UN.js +4 -0
  73. package/dist/chunks/chunk-K4NTZEDJ.js +4 -0
  74. package/dist/chunks/chunk-KDYEGGMW.js +4 -0
  75. package/dist/chunks/chunk-KENCMLRE.js +4 -0
  76. package/dist/chunks/chunk-KGJZAYQD.js +4 -0
  77. package/dist/chunks/chunk-KIGMAATV.js +23 -0
  78. package/dist/chunks/chunk-KIU5FAPY.js +5 -0
  79. package/dist/chunks/chunk-KIWMQPH7.js +739 -0
  80. package/dist/chunks/chunk-KRXTI4JO.js +3 -0
  81. package/dist/chunks/chunk-L6VCIGWS.js +11 -0
  82. package/dist/chunks/chunk-LACGULCN.js +10 -0
  83. package/dist/chunks/chunk-LCKVYFMD.js +4 -0
  84. package/dist/chunks/chunk-LEUENXI2.js +6 -0
  85. package/dist/chunks/chunk-LMDWRRX4.js +4 -0
  86. package/dist/chunks/chunk-LMSQZ6TQ.js +4 -0
  87. package/dist/chunks/chunk-MEPASGPP.js +6 -0
  88. package/dist/chunks/chunk-MFAEUHMV.js +28 -0
  89. package/dist/chunks/chunk-N6BTQN7R.js +8 -0
  90. package/dist/chunks/chunk-NAA7GF6Q.js +5 -0
  91. package/dist/chunks/chunk-NHD2ESHA.js +4 -0
  92. package/dist/chunks/chunk-NKDMKRSB.js +68 -0
  93. package/dist/chunks/chunk-NKXV32S6.js +4 -0
  94. package/dist/chunks/chunk-NR6U3WIZ.js +4 -0
  95. package/dist/chunks/chunk-NT32UURL.js +4 -0
  96. package/dist/chunks/chunk-NVX5IPRN.js +4 -0
  97. package/dist/chunks/chunk-O3JW2F7D.js +8 -0
  98. package/dist/chunks/chunk-OE4KH3NJ.js +4 -0
  99. package/dist/chunks/chunk-OISO5JXB.js +4 -0
  100. package/dist/chunks/chunk-OKRK6JPY.js +4 -0
  101. package/dist/chunks/chunk-OPYXNSMY.js +4 -0
  102. package/dist/chunks/chunk-OSEIQ7SS.js +4 -0
  103. package/dist/chunks/chunk-OZGBWAT2.js +4 -0
  104. package/dist/chunks/chunk-P52RMIYX.js +6 -0
  105. package/dist/chunks/chunk-PBJ5MPPX.js +60 -0
  106. package/dist/chunks/chunk-PFMEUFJ7.js +4 -0
  107. package/dist/chunks/chunk-PMG4YGDU.js +7 -0
  108. package/dist/chunks/chunk-PXS5SHOV.js +4 -0
  109. package/dist/chunks/chunk-PZMGBKUR.js +13 -0
  110. package/dist/chunks/chunk-PZMXHA6X.js +9 -0
  111. package/dist/chunks/chunk-Q4UGYGU5.js +4 -0
  112. package/dist/chunks/chunk-Q7CE3UIE.js +133 -0
  113. package/dist/chunks/chunk-QBKCAIJG.js +4 -0
  114. package/dist/chunks/chunk-QEOFEETJ.js +4 -0
  115. package/dist/chunks/chunk-QN44UXQR.js +11 -0
  116. package/dist/chunks/chunk-QUUEQRIT.js +4 -0
  117. package/dist/chunks/chunk-QWAQHHRS.js +4 -0
  118. package/dist/chunks/chunk-RA6HKFBV.js +4 -0
  119. package/dist/chunks/chunk-REBNWCKI.js +4 -0
  120. package/dist/chunks/chunk-REPYBMQS.js +4 -0
  121. package/dist/chunks/chunk-RO4C2MJP.js +4 -0
  122. package/dist/chunks/chunk-SKHLZ6XY.js +9 -0
  123. package/dist/chunks/chunk-STUHNKQS.js +4 -0
  124. package/dist/chunks/chunk-SUFW24P4.js +7 -0
  125. package/dist/chunks/chunk-TAWLERZA.js +4 -0
  126. package/dist/chunks/chunk-TCAEECDI.js +4 -0
  127. package/dist/chunks/chunk-TJ4GQRT6.js +8 -0
  128. package/dist/chunks/chunk-TURBFBYN.js +4 -0
  129. package/dist/chunks/chunk-TWAEABGG.js +52 -0
  130. package/dist/chunks/chunk-TZFLHVOQ.js +7 -0
  131. package/dist/chunks/chunk-TZGNSHOL.js +4 -0
  132. package/dist/chunks/chunk-UD3NMUHR.js +12 -0
  133. package/dist/chunks/chunk-UNVEZI57.js +4 -0
  134. package/dist/chunks/chunk-USBJFDJ6.js +4 -0
  135. package/dist/chunks/chunk-V3AQJSWR.js +4 -0
  136. package/dist/chunks/chunk-VQUPKMDR.js +4 -0
  137. package/dist/chunks/chunk-W25TB3PU.js +4 -0
  138. package/dist/chunks/chunk-W5LGYSPZ.js +4 -0
  139. package/dist/chunks/chunk-WEZWKMYU.js +4 -0
  140. package/dist/chunks/chunk-WHC7AYZD.js +4 -0
  141. package/dist/chunks/chunk-X2GYYRVM.js +22 -0
  142. package/dist/chunks/chunk-XAJLZR7C.js +28 -0
  143. package/dist/chunks/chunk-XAXWLYH5.js +4 -0
  144. package/dist/chunks/chunk-XBJOYU5Y.js +4 -0
  145. package/dist/chunks/chunk-XH6FMP3N.js +71 -0
  146. package/dist/chunks/chunk-XIECJESP.js +4 -0
  147. package/dist/chunks/chunk-XNSSUVT6.js +4 -0
  148. package/dist/chunks/chunk-XSRZHN63.js +4 -0
  149. package/dist/chunks/chunk-Y3GFB5XM.js +8 -0
  150. package/dist/chunks/chunk-Y6ZEVVL5.js +4 -0
  151. package/dist/chunks/chunk-YAEVYJAR.js +4 -0
  152. package/dist/chunks/chunk-YG7OEPR2.js +6 -0
  153. package/dist/chunks/chunk-YHIWOGVL.js +4 -0
  154. package/dist/chunks/chunk-YKKEI5GI.js +4 -0
  155. package/dist/chunks/chunk-YPK2CAIZ.js +8 -0
  156. package/dist/chunks/chunk-YZSHTWNM.js +92 -0
  157. package/dist/chunks/chunk-Z2Q2NR46.js +34 -0
  158. package/dist/chunks/chunk-Z4H3VDHI.js +4 -0
  159. package/dist/chunks/chunk-ZFPMIQA3.js +6 -0
  160. package/dist/chunks/chunk-ZNZFWSPH.js +4 -0
  161. package/dist/chunks/chunk-ZQ7LGTSN.js +8 -0
  162. package/dist/chunks/chunk-ZSV6TO7Q.js +4 -0
  163. package/dist/chunks/cli-5DBTRMHU.js +53 -0
  164. package/dist/chunks/client-XOGYH5UR.js +4 -0
  165. package/dist/chunks/cloudflare-workers-ai-system-one-32JCFHI3.js +4 -0
  166. package/dist/chunks/config-DJSQI77S-335IXHSM.js +4 -0
  167. package/dist/chunks/context-VCQH5OB6.js +4 -0
  168. package/dist/chunks/cost-PGGFI7QJ.js +5 -0
  169. package/dist/chunks/dist-7RWW7YH4.js +11 -0
  170. package/dist/chunks/dist-PUKMZ7GW.js +4 -0
  171. package/dist/chunks/easter-egg-3d-MO4MOEVF.js +4 -0
  172. package/dist/chunks/es5-VNTQPCKX.js +4 -0
  173. package/dist/chunks/event-streams-3JSFPOTZ.js +4 -0
  174. package/dist/chunks/execution-repo-ZLJTBWFC.js +4 -0
  175. package/dist/chunks/executions-6ARGR3IO.js +9 -0
  176. package/dist/chunks/file-7BN7RCAY.js +4 -0
  177. package/dist/chunks/gateway-UCRPMR75.js +36 -0
  178. package/dist/chunks/github-copilot-HAI2DA62.js +4 -0
  179. package/dist/chunks/google-generative-ai-2VXWLHWI.js +4 -0
  180. package/dist/chunks/google-vertex-UA36QP2U.js +4 -0
  181. package/dist/chunks/init-HA7FAQ73.js +4 -0
  182. package/dist/chunks/install-cli-4IZCSDFZ.js +16 -0
  183. package/dist/chunks/interaction-ask-G5T3H3CG.js +9 -0
  184. package/dist/chunks/interaction-plan-E5V42MUP.js +11 -0
  185. package/dist/chunks/jiti-loader-WANUXUDO.js +4 -0
  186. package/dist/chunks/jiti-static-loader-W3QZ4GDS.js +476 -0
  187. package/dist/chunks/kimi-coding-HMJRKCPA.js +4 -0
  188. package/dist/chunks/lib-RSOU34HQ.js +11 -0
  189. package/dist/chunks/llama-cpp-classify-OTXZWCMW.js +24 -0
  190. package/dist/chunks/local-client-stop-SQRU7ZZM.js +4 -0
  191. package/dist/chunks/memory-cli-PYOILNN5.js +11 -0
  192. package/dist/chunks/meta-KY3LNFV2.js +4 -0
  193. package/dist/chunks/mistral-conversations-34F66L3O.js +7 -0
  194. package/dist/chunks/model-resolver-N3DTAQ2S.js +4 -0
  195. package/dist/chunks/models-L5VF4I5O-XXNJYQMQ.js +4 -0
  196. package/dist/chunks/multipart-parser-GEHG6YAR.js +5 -0
  197. package/dist/chunks/node-PTK2HCDV.js +18 -0
  198. package/dist/chunks/node-VLVSZ76W.js +4 -0
  199. package/dist/chunks/openai-chatgpt-PETGIJOZ.js +4 -0
  200. package/dist/chunks/openai-codex-2REL6UQU.js +4 -0
  201. package/dist/chunks/openai-codex-responses-ZBVHREB3.js +12 -0
  202. package/dist/chunks/openai-completions-VVIB26SH.js +9 -0
  203. package/dist/chunks/openai-decisions-2N6ZRPZC.js +7 -0
  204. package/dist/chunks/openai-responses-735XA2ZX.js +6 -0
  205. package/dist/chunks/openrouter-GDY3BLT2.js +4 -0
  206. package/dist/chunks/openrouter-images-3IKETHAC.js +4 -0
  207. package/dist/chunks/pi-messages-I3E4ZFHA.js +10 -0
  208. package/dist/chunks/radius-HXRZVBDB.js +4 -0
  209. package/dist/chunks/remote-ops-BALZYKH6.js +14 -0
  210. package/dist/chunks/runner-PLVZDGHB.js +4 -0
  211. package/dist/chunks/runtime-6YLTA2ZD.js +4 -0
  212. package/dist/chunks/schedule-cli-OLASBBYJ.js +4 -0
  213. package/dist/chunks/slack-WAGSPZUX.js +4 -0
  214. package/dist/chunks/src-CCI7P7AI.js +6 -0
  215. package/dist/chunks/start-ui-http-QALT7C3P.js +43 -0
  216. package/dist/chunks/subagent-E3UC7ZHC.js +4 -0
  217. package/dist/chunks/time-KEHDQT6K.js +4 -0
  218. package/dist/chunks/tool-shims-Q6P6UXVC.js +4 -0
  219. package/dist/chunks/typesafe-system-one-6ULACYD4.js +4 -0
  220. package/dist/chunks/ui-board-4GYW6KKW.js +5 -0
  221. package/dist/chunks/ui-decision-U2FXSEC2.js +4 -0
  222. package/dist/chunks/ui-file-GVH53O3X.js +5 -0
  223. package/dist/chunks/ui-view-O7PLANT7.js +4 -0
  224. package/dist/chunks/virtual-modules-IDC5YKZJ.js +4 -0
  225. package/dist/chunks/waitpoint-2FGQBIAC.js +5 -0
  226. package/dist/chunks/workers-XN4PSTH6.js +4 -0
  227. package/dist/chunks/xai-KEVUJTFV.js +4 -0
  228. package/dist/client-bundle/manifest.json +1 -1
  229. package/dist/core/pi-sdk.js +4 -73
  230. package/dist/domain/auth/cc-auth-cli.js +4 -248
  231. package/dist/domain/mcp/bundled-server.js +4 -146
  232. package/dist/entry/app.js +601 -611
  233. package/dist/entry/browser-cli.js +14 -316
  234. package/dist/entry/cli.js +4 -587
  235. package/dist/entry/cortex-cli.js +4 -2
  236. package/dist/entry/daemon.js +7 -909
  237. package/dist/entry/hook-cli.js +6 -401
  238. package/dist/entry/production-app-bootstrap.js +5 -42
  239. package/dist/entry/production-evidence-export-cli.js +12 -99
  240. package/dist/entry/signal-cli.js +6 -198
  241. package/dist/tui/index.js +114 -306
  242. package/package.json +11 -50
  243. package/scripts/bundle-prune-browser.mjs +52 -0
  244. package/scripts/postinstall-restart-trigger.mjs +8 -0
  245. package/vendor/aistatus/gateway-cli.js +21 -0
  246. package/vendor/pi/CHANGELOG.md +6365 -0
  247. package/vendor/pi/README.md +95 -0
  248. package/vendor/pi/dist/codemode-worker.js +478 -0
  249. package/vendor/pi/dist/core/export-html/ansi-to-html.js +249 -0
  250. package/vendor/pi/dist/core/export-html/index.js +228 -0
  251. package/vendor/pi/dist/core/export-html/template.css +1076 -0
  252. package/vendor/pi/dist/core/export-html/template.html +56 -0
  253. package/vendor/pi/dist/core/export-html/template.js +1924 -0
  254. package/vendor/pi/dist/core/export-html/tool-renderer.js +110 -0
  255. package/vendor/pi/dist/core/export-html/vendor/highlight.min.js +1213 -0
  256. package/vendor/pi/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
  257. package/vendor/pi/dist/core/export-html/vendor/marked.min.js +79 -0
  258. package/vendor/pi/dist/core/extensions/loader.js +4 -0
  259. package/vendor/pi/dist/extensions/codemode/execute.js +507 -0
  260. package/vendor/pi/dist/modes/interactive/assets/clankolas.png +0 -0
  261. package/vendor/pi/dist/modes/interactive/theme/dark.json +78 -0
  262. package/vendor/pi/dist/modes/interactive/theme/light.json +78 -0
  263. package/vendor/pi/dist/modes/interactive/theme/system-theme.js +546 -0
  264. package/vendor/pi/dist/modes/interactive/theme/theme-controller.js +210 -0
  265. package/vendor/pi/dist/modes/interactive/theme/theme-schema.js +105 -0
  266. package/vendor/pi/dist/modes/interactive/theme/theme-tokens.js +94 -0
  267. package/vendor/pi/dist/modes/interactive/theme/theme.js +905 -0
  268. package/vendor/pi/dist/utils/image-resize-worker.js +4 -0
  269. package/vendor/pi/dist/utils/image-resize.js +4 -0
  270. package/vendor/pi/docs/cli-integration.md +106 -0
  271. package/vendor/pi/docs/cli.md +333 -0
  272. package/vendor/pi/docs/codemode.md +230 -0
  273. package/vendor/pi/docs/compaction.md +463 -0
  274. package/vendor/pi/docs/configuration.md +47 -0
  275. package/vendor/pi/docs/containerization.md +183 -0
  276. package/vendor/pi/docs/custom-provider.md +225 -0
  277. package/vendor/pi/docs/docs.json +220 -0
  278. package/vendor/pi/docs/environment-variables.md +101 -0
  279. package/vendor/pi/docs/extensions.md +400 -0
  280. package/vendor/pi/docs/how-pi-works.md +49 -0
  281. package/vendor/pi/docs/images/doom-extension.png +0 -0
  282. package/vendor/pi/docs/images/exy.png +0 -0
  283. package/vendor/pi/docs/images/interactive-mode.png +0 -0
  284. package/vendor/pi/docs/images/tree-view.png +0 -0
  285. package/vendor/pi/docs/index.md +39 -0
  286. package/vendor/pi/docs/json.md +226 -0
  287. package/vendor/pi/docs/keybindings.md +195 -0
  288. package/vendor/pi/docs/llama-cpp.md +121 -0
  289. package/vendor/pi/docs/mcp.md +272 -0
  290. package/vendor/pi/docs/message-types.md +279 -0
  291. package/vendor/pi/docs/models-configuration.md +196 -0
  292. package/vendor/pi/docs/models.md +225 -0
  293. package/vendor/pi/docs/nvidia-rtx-llama-cpp.md +96 -0
  294. package/vendor/pi/docs/packages.md +129 -0
  295. package/vendor/pi/docs/prompt-templates.md +59 -0
  296. package/vendor/pi/docs/providers.md +247 -0
  297. package/vendor/pi/docs/quickstart.md +136 -0
  298. package/vendor/pi/docs/rpc-commands.md +860 -0
  299. package/vendor/pi/docs/rpc-extension-ui.md +200 -0
  300. package/vendor/pi/docs/rpc.md +193 -0
  301. package/vendor/pi/docs/sdk.md +147 -0
  302. package/vendor/pi/docs/security.md +99 -0
  303. package/vendor/pi/docs/session-format.md +293 -0
  304. package/vendor/pi/docs/sessions.md +66 -0
  305. package/vendor/pi/docs/settings.md +172 -0
  306. package/vendor/pi/docs/shell-aliases.md +93 -0
  307. package/vendor/pi/docs/skills.md +93 -0
  308. package/vendor/pi/docs/slash-commands.md +60 -0
  309. package/vendor/pi/docs/terminal-setup.md +233 -0
  310. package/vendor/pi/docs/termux.md +117 -0
  311. package/vendor/pi/docs/themes.md +138 -0
  312. package/vendor/pi/docs/tmux.md +55 -0
  313. package/vendor/pi/docs/tui.md +195 -0
  314. package/vendor/pi/docs/usage.md +94 -0
  315. package/vendor/pi/docs/virtual-models.md +114 -0
  316. package/vendor/pi/docs/windows.md +81 -0
  317. package/vendor/pi/examples/README.md +36 -0
  318. package/vendor/pi/examples/extensions/README.md +214 -0
  319. package/vendor/pi/examples/extensions/auto-commit-on-exit.ts +49 -0
  320. package/vendor/pi/examples/extensions/bash-spawn-hook.ts +30 -0
  321. package/vendor/pi/examples/extensions/bookmark.ts +50 -0
  322. package/vendor/pi/examples/extensions/border-status-editor.ts +150 -0
  323. package/vendor/pi/examples/extensions/built-in-tool-renderer.ts +225 -0
  324. package/vendor/pi/examples/extensions/claude-rules.ts +86 -0
  325. package/vendor/pi/examples/extensions/commands.ts +72 -0
  326. package/vendor/pi/examples/extensions/confirm-destructive.ts +59 -0
  327. package/vendor/pi/examples/extensions/custom-compaction.ts +117 -0
  328. package/vendor/pi/examples/extensions/custom-footer.ts +64 -0
  329. package/vendor/pi/examples/extensions/custom-header.ts +73 -0
  330. package/vendor/pi/examples/extensions/custom-provider-anthropic/index.ts +617 -0
  331. package/vendor/pi/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
  332. package/vendor/pi/examples/extensions/custom-provider-anthropic/package.json +19 -0
  333. package/vendor/pi/examples/extensions/custom-provider-gitlab-duo/index.ts +405 -0
  334. package/vendor/pi/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
  335. package/vendor/pi/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
  336. package/vendor/pi/examples/extensions/debug-provider.ts +90 -0
  337. package/vendor/pi/examples/extensions/dirty-repo-guard.ts +56 -0
  338. package/vendor/pi/examples/extensions/doom-overlay/README.md +46 -0
  339. package/vendor/pi/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
  340. package/vendor/pi/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
  341. package/vendor/pi/examples/extensions/doom-overlay/doom/build.sh +152 -0
  342. package/vendor/pi/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
  343. package/vendor/pi/examples/extensions/doom-overlay/doom-component.ts +132 -0
  344. package/vendor/pi/examples/extensions/doom-overlay/doom-engine.ts +173 -0
  345. package/vendor/pi/examples/extensions/doom-overlay/doom-keys.ts +104 -0
  346. package/vendor/pi/examples/extensions/doom-overlay/index.ts +74 -0
  347. package/vendor/pi/examples/extensions/doom-overlay/wad-finder.ts +55 -0
  348. package/vendor/pi/examples/extensions/dynamic-resources/SKILL.md +8 -0
  349. package/vendor/pi/examples/extensions/dynamic-resources/dynamic.json +81 -0
  350. package/vendor/pi/examples/extensions/dynamic-resources/dynamic.md +5 -0
  351. package/vendor/pi/examples/extensions/dynamic-resources/index.ts +15 -0
  352. package/vendor/pi/examples/extensions/dynamic-tools.ts +74 -0
  353. package/vendor/pi/examples/extensions/entry-renderer.ts +41 -0
  354. package/vendor/pi/examples/extensions/event-bus.ts +43 -0
  355. package/vendor/pi/examples/extensions/file-trigger.ts +41 -0
  356. package/vendor/pi/examples/extensions/git-checkpoint.ts +53 -0
  357. package/vendor/pi/examples/extensions/git-merge-and-resolve.ts +115 -0
  358. package/vendor/pi/examples/extensions/github-issue-autocomplete.ts +185 -0
  359. package/vendor/pi/examples/extensions/gondolin/index.ts +531 -0
  360. package/vendor/pi/examples/extensions/gondolin/package-lock.json +185 -0
  361. package/vendor/pi/examples/extensions/gondolin/package.json +19 -0
  362. package/vendor/pi/examples/extensions/handoff.ts +190 -0
  363. package/vendor/pi/examples/extensions/hello.ts +26 -0
  364. package/vendor/pi/examples/extensions/hidden-thinking-label.ts +53 -0
  365. package/vendor/pi/examples/extensions/inline-bash.ts +94 -0
  366. package/vendor/pi/examples/extensions/input-transform-streaming.ts +39 -0
  367. package/vendor/pi/examples/extensions/input-transform.ts +43 -0
  368. package/vendor/pi/examples/extensions/interactive-shell.ts +196 -0
  369. package/vendor/pi/examples/extensions/jev-router.ts +113 -0
  370. package/vendor/pi/examples/extensions/mac-system-theme.ts +47 -0
  371. package/vendor/pi/examples/extensions/message-renderer.ts +59 -0
  372. package/vendor/pi/examples/extensions/minimal-mode.ts +353 -0
  373. package/vendor/pi/examples/extensions/modal-editor.ts +85 -0
  374. package/vendor/pi/examples/extensions/model-status.ts +31 -0
  375. package/vendor/pi/examples/extensions/notify.ts +57 -0
  376. package/vendor/pi/examples/extensions/overlay-qa-tests.ts +1450 -0
  377. package/vendor/pi/examples/extensions/overlay-test.ts +153 -0
  378. package/vendor/pi/examples/extensions/permission-gate.ts +34 -0
  379. package/vendor/pi/examples/extensions/pirate.ts +47 -0
  380. package/vendor/pi/examples/extensions/plan-mode/README.md +66 -0
  381. package/vendor/pi/examples/extensions/plan-mode/index.ts +394 -0
  382. package/vendor/pi/examples/extensions/plan-mode/utils.ts +168 -0
  383. package/vendor/pi/examples/extensions/preset.ts +436 -0
  384. package/vendor/pi/examples/extensions/project-trust.ts +64 -0
  385. package/vendor/pi/examples/extensions/prompt-customizer.ts +49 -0
  386. package/vendor/pi/examples/extensions/protected-paths.ts +30 -0
  387. package/vendor/pi/examples/extensions/provider-payload.ts +18 -0
  388. package/vendor/pi/examples/extensions/qna.ts +118 -0
  389. package/vendor/pi/examples/extensions/question.ts +286 -0
  390. package/vendor/pi/examples/extensions/questionnaire.ts +448 -0
  391. package/vendor/pi/examples/extensions/rainbow-editor.ts +88 -0
  392. package/vendor/pi/examples/extensions/reload-runtime.ts +37 -0
  393. package/vendor/pi/examples/extensions/rpc-demo.ts +118 -0
  394. package/vendor/pi/examples/extensions/sandbox/index.ts +321 -0
  395. package/vendor/pi/examples/extensions/sandbox/package-lock.json +92 -0
  396. package/vendor/pi/examples/extensions/sandbox/package.json +19 -0
  397. package/vendor/pi/examples/extensions/send-user-message.ts +97 -0
  398. package/vendor/pi/examples/extensions/session-name.ts +27 -0
  399. package/vendor/pi/examples/extensions/shutdown-command.ts +63 -0
  400. package/vendor/pi/examples/extensions/snake.ts +343 -0
  401. package/vendor/pi/examples/extensions/space-invaders.ts +560 -0
  402. package/vendor/pi/examples/extensions/ssh.ts +220 -0
  403. package/vendor/pi/examples/extensions/status-line.ts +32 -0
  404. package/vendor/pi/examples/extensions/structured-output.ts +65 -0
  405. package/vendor/pi/examples/extensions/subagent/README.md +177 -0
  406. package/vendor/pi/examples/extensions/subagent/agents/planner.md +37 -0
  407. package/vendor/pi/examples/extensions/subagent/agents/reviewer.md +35 -0
  408. package/vendor/pi/examples/extensions/subagent/agents/scout.md +50 -0
  409. package/vendor/pi/examples/extensions/subagent/agents/worker.md +24 -0
  410. package/vendor/pi/examples/extensions/subagent/agents.ts +157 -0
  411. package/vendor/pi/examples/extensions/subagent/index.ts +1036 -0
  412. package/vendor/pi/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
  413. package/vendor/pi/examples/extensions/subagent/prompts/implement.md +10 -0
  414. package/vendor/pi/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
  415. package/vendor/pi/examples/extensions/summarize.ts +199 -0
  416. package/vendor/pi/examples/extensions/system-prompt-header.ts +17 -0
  417. package/vendor/pi/examples/extensions/tic-tac-toe.ts +1008 -0
  418. package/vendor/pi/examples/extensions/timed-confirm.ts +70 -0
  419. package/vendor/pi/examples/extensions/titlebar-spinner.ts +58 -0
  420. package/vendor/pi/examples/extensions/todo.ts +297 -0
  421. package/vendor/pi/examples/extensions/tool-override.ts +144 -0
  422. package/vendor/pi/examples/extensions/tools.ts +146 -0
  423. package/vendor/pi/examples/extensions/trigger-compact.ts +50 -0
  424. package/vendor/pi/examples/extensions/truncated-tool.ts +195 -0
  425. package/vendor/pi/examples/extensions/widget-placement.ts +9 -0
  426. package/vendor/pi/examples/extensions/with-deps/index.ts +32 -0
  427. package/vendor/pi/examples/extensions/with-deps/package-lock.json +31 -0
  428. package/vendor/pi/examples/extensions/with-deps/package.json +22 -0
  429. package/vendor/pi/examples/extensions/working-indicator.ts +123 -0
  430. package/vendor/pi/examples/extensions/working-message-test.ts +25 -0
  431. package/vendor/pi/examples/rpc-client.ts +35 -0
  432. package/vendor/pi/examples/rpc-extension-ui.ts +661 -0
  433. package/vendor/pi/examples/sdk/01-minimal.ts +26 -0
  434. package/vendor/pi/examples/sdk/02-custom-model.ts +49 -0
  435. package/vendor/pi/examples/sdk/03-custom-prompt.ts +75 -0
  436. package/vendor/pi/examples/sdk/04-skills.ts +55 -0
  437. package/vendor/pi/examples/sdk/05-tools.ts +48 -0
  438. package/vendor/pi/examples/sdk/06-extensions.ts +99 -0
  439. package/vendor/pi/examples/sdk/07-context-files.ts +47 -0
  440. package/vendor/pi/examples/sdk/08-prompt-templates.ts +51 -0
  441. package/vendor/pi/examples/sdk/09-api-keys-and-oauth.ts +34 -0
  442. package/vendor/pi/examples/sdk/10-settings.ts +53 -0
  443. package/vendor/pi/examples/sdk/11-sessions.ts +52 -0
  444. package/vendor/pi/examples/sdk/12-full-control.ts +74 -0
  445. package/vendor/pi/examples/sdk/13-session-runtime.ts +67 -0
  446. package/vendor/pi/examples/sdk/14-codemode-mcp.ts +61 -0
  447. package/vendor/pi/examples/sdk/README.md +141 -0
  448. package/vendor/pi/package.json +98 -0
  449. package/vendor/pi/schemas/keybindings.schema.json +393 -0
  450. package/vendor/pi/schemas/models.schema.json +1211 -0
  451. package/vendor/pi/schemas/settings.schema.json +783 -0
  452. package/vendor/pi/schemas/theme.schema.json +365 -0
  453. package/vendor/pi-ai/bedrock.js +4 -0
  454. package/vendor/pi-ai/oauth-load.js +4 -0
  455. package/vendor/quickjs.wasm +0 -0
  456. package/web/dist/assets/board-math-css-BPXakv_3.js +2 -0
  457. package/web/dist/assets/index-BHZpFXhc.js +525 -0
  458. package/web/dist/assets/index-DqWMdMkh.css +1 -0
  459. package/web/dist/assets/index-WCm6wwmM.js +1 -0
  460. package/web/dist/index.html +2 -2
  461. package/dist/agent-adapter/bg-wait.d.ts +0 -11
  462. package/dist/agent-adapter/bg-wait.js +0 -32
  463. package/dist/agent-adapter/capabilities.d.ts +0 -18
  464. package/dist/agent-adapter/capabilities.js +0 -39
  465. package/dist/agent-adapter/claude/active-capture-registry.d.ts +0 -7
  466. package/dist/agent-adapter/claude/active-capture-registry.js +0 -42
  467. package/dist/agent-adapter/claude/adapter.d.ts +0 -170
  468. package/dist/agent-adapter/claude/adapter.js +0 -459
  469. package/dist/agent-adapter/claude/assistant-blocks.d.ts +0 -5
  470. package/dist/agent-adapter/claude/assistant-blocks.js +0 -61
  471. package/dist/agent-adapter/claude/bg-task-tracker.d.ts +0 -105
  472. package/dist/agent-adapter/claude/bg-task-tracker.js +0 -168
  473. package/dist/agent-adapter/claude/cache-refresh.d.ts +0 -58
  474. package/dist/agent-adapter/claude/cache-refresh.js +0 -145
  475. package/dist/agent-adapter/claude/cache-touch.d.ts +0 -12
  476. package/dist/agent-adapter/claude/cache-touch.js +0 -75
  477. package/dist/agent-adapter/claude/compact-window.d.ts +0 -18
  478. package/dist/agent-adapter/claude/compact-window.js +0 -49
  479. package/dist/agent-adapter/claude/context-usage.d.ts +0 -28
  480. package/dist/agent-adapter/claude/context-usage.js +0 -173
  481. package/dist/agent-adapter/claude/defaults.d.ts +0 -42
  482. package/dist/agent-adapter/claude/defaults.js +0 -59
  483. package/dist/agent-adapter/claude/engine.d.ts +0 -75
  484. package/dist/agent-adapter/claude/engine.js +0 -139
  485. package/dist/agent-adapter/claude/event-parser.d.ts +0 -60
  486. package/dist/agent-adapter/claude/event-parser.js +0 -259
  487. package/dist/agent-adapter/claude/event-translator.d.ts +0 -45
  488. package/dist/agent-adapter/claude/event-translator.js +0 -98
  489. package/dist/agent-adapter/claude/hooks-builder.d.ts +0 -19
  490. package/dist/agent-adapter/claude/hooks-builder.js +0 -57
  491. package/dist/agent-adapter/claude/mcp-config.d.ts +0 -11
  492. package/dist/agent-adapter/claude/mcp-config.js +0 -142
  493. package/dist/agent-adapter/claude/remote-mcp-proxy.d.ts +0 -1
  494. package/dist/agent-adapter/claude/session-options.d.ts +0 -70
  495. package/dist/agent-adapter/claude/session-options.js +0 -148
  496. package/dist/agent-adapter/claude/spawn-args.d.ts +0 -70
  497. package/dist/agent-adapter/claude/spawn-args.js +0 -367
  498. package/dist/agent-adapter/claude/tool-summarizers.d.ts +0 -2
  499. package/dist/agent-adapter/claude/tool-summarizers.js +0 -20
  500. package/dist/agent-adapter/claude/transcript-clear.d.ts +0 -42
  501. package/dist/agent-adapter/claude/transcript-clear.js +0 -217
  502. package/dist/agent-adapter/claude/transcript-path.d.ts +0 -39
  503. package/dist/agent-adapter/claude/transcript-path.js +0 -114
  504. package/dist/agent-adapter/claude/turn-machine.d.ts +0 -220
  505. package/dist/agent-adapter/claude/turn-machine.js +0 -731
  506. package/dist/agent-adapter/claude/window-warmup.d.ts +0 -13
  507. package/dist/agent-adapter/claude/window-warmup.js +0 -38
  508. package/dist/agent-adapter/continuation-phase.d.ts +0 -131
  509. package/dist/agent-adapter/continuation-phase.js +0 -345
  510. package/dist/agent-adapter/engine-injections.d.ts +0 -47
  511. package/dist/agent-adapter/engine-injections.js +0 -80
  512. package/dist/agent-adapter/mcp-remote-fetch.d.ts +0 -1
  513. package/dist/agent-adapter/mcp-remote-fetch.js +0 -32
  514. package/dist/agent-adapter/normalize/event-types.d.ts +0 -125
  515. package/dist/agent-adapter/normalize/event-types.js +0 -1
  516. package/dist/agent-adapter/normalize/prompt-builder.d.ts +0 -22
  517. package/dist/agent-adapter/normalize/prompt-builder.js +0 -41
  518. package/dist/agent-adapter/normalize/tool-result-images.d.ts +0 -11
  519. package/dist/agent-adapter/normalize/tool-result-images.js +0 -32
  520. package/dist/agent-adapter/pi/adapter.d.ts +0 -125
  521. package/dist/agent-adapter/pi/adapter.js +0 -275
  522. package/dist/agent-adapter/pi/agent-dir.d.ts +0 -57
  523. package/dist/agent-adapter/pi/agent-dir.js +0 -154
  524. package/dist/agent-adapter/pi/background-subagent.d.ts +0 -26
  525. package/dist/agent-adapter/pi/background-subagent.js +0 -1
  526. package/dist/agent-adapter/pi/child-events.d.ts +0 -13
  527. package/dist/agent-adapter/pi/child-events.js +0 -96
  528. package/dist/agent-adapter/pi/child-runner.d.ts +0 -31
  529. package/dist/agent-adapter/pi/child-runner.js +0 -133
  530. package/dist/agent-adapter/pi/child-session.d.ts +0 -28
  531. package/dist/agent-adapter/pi/child-session.js +0 -70
  532. package/dist/agent-adapter/pi/custom-catalog.d.ts +0 -10
  533. package/dist/agent-adapter/pi/custom-catalog.js +0 -38
  534. package/dist/agent-adapter/pi/defaults.d.ts +0 -7
  535. package/dist/agent-adapter/pi/defaults.js +0 -11
  536. package/dist/agent-adapter/pi/discovery.d.ts +0 -37
  537. package/dist/agent-adapter/pi/discovery.js +0 -33
  538. package/dist/agent-adapter/pi/engine.d.ts +0 -66
  539. package/dist/agent-adapter/pi/engine.js +0 -180
  540. package/dist/agent-adapter/pi/event-parser.d.ts +0 -43
  541. package/dist/agent-adapter/pi/event-parser.js +0 -446
  542. package/dist/agent-adapter/pi/extensions.d.ts +0 -33
  543. package/dist/agent-adapter/pi/extensions.js +0 -58
  544. package/dist/agent-adapter/pi/hook-bridge.d.ts +0 -54
  545. package/dist/agent-adapter/pi/hook-bridge.js +0 -394
  546. package/dist/agent-adapter/pi/image-first.d.ts +0 -3
  547. package/dist/agent-adapter/pi/image-first.js +0 -31
  548. package/dist/agent-adapter/pi/mcp-bridge-logic.d.ts +0 -32
  549. package/dist/agent-adapter/pi/mcp-bridge-logic.js +0 -63
  550. package/dist/agent-adapter/pi/mcp-bridge.d.ts +0 -65
  551. package/dist/agent-adapter/pi/mcp-bridge.js +0 -389
  552. package/dist/agent-adapter/pi/native-tool-policy.d.ts +0 -3
  553. package/dist/agent-adapter/pi/native-tool-policy.js +0 -11
  554. package/dist/agent-adapter/pi/pi-session.d.ts +0 -185
  555. package/dist/agent-adapter/pi/pi-session.js +0 -656
  556. package/dist/agent-adapter/pi/providers-config.d.ts +0 -60
  557. package/dist/agent-adapter/pi/providers-config.js +0 -96
  558. package/dist/agent-adapter/pi/quota-probe.d.ts +0 -12
  559. package/dist/agent-adapter/pi/quota-probe.js +0 -33
  560. package/dist/agent-adapter/pi/quota-sink.d.ts +0 -33
  561. package/dist/agent-adapter/pi/quota-sink.js +0 -57
  562. package/dist/agent-adapter/pi/runtime-settings.d.ts +0 -9
  563. package/dist/agent-adapter/pi/runtime-settings.js +0 -53
  564. package/dist/agent-adapter/pi/runtime.d.ts +0 -48
  565. package/dist/agent-adapter/pi/runtime.js +0 -163
  566. package/dist/agent-adapter/pi/session-files.d.ts +0 -2
  567. package/dist/agent-adapter/pi/session-files.js +0 -15
  568. package/dist/agent-adapter/pi/session-options.d.ts +0 -86
  569. package/dist/agent-adapter/pi/session-options.js +0 -162
  570. package/dist/agent-adapter/pi/session-support.d.ts +0 -54
  571. package/dist/agent-adapter/pi/session-support.js +0 -101
  572. package/dist/agent-adapter/pi/subagent-bridge.d.ts +0 -17
  573. package/dist/agent-adapter/pi/subagent-bridge.js +0 -1
  574. package/dist/agent-adapter/pi/subagent.d.ts +0 -100
  575. package/dist/agent-adapter/pi/subagent.js +0 -199
  576. package/dist/agent-adapter/pi/tool-shims.d.ts +0 -32
  577. package/dist/agent-adapter/pi/tool-shims.js +0 -148
  578. package/dist/agent-adapter/pi/ui-context.d.ts +0 -20
  579. package/dist/agent-adapter/pi/ui-context.js +0 -92
  580. package/dist/agent-adapter/pi/web-fetch.d.ts +0 -13
  581. package/dist/agent-adapter/pi/web-fetch.js +0 -196
  582. package/dist/agent-adapter/pi/web-search.d.ts +0 -9
  583. package/dist/agent-adapter/pi/web-search.js +0 -517
  584. package/dist/agent-adapter/run-events.d.ts +0 -169
  585. package/dist/agent-adapter/run-events.js +0 -119
  586. package/dist/agent-adapter/types.d.ts +0 -330
  587. package/dist/agent-adapter/types.js +0 -3
  588. package/dist/core/agents/roles.d.ts +0 -50
  589. package/dist/core/agents/roles.js +0 -176
  590. package/dist/core/agents/subagent/attribution.d.ts +0 -15
  591. package/dist/core/agents/subagent/attribution.js +0 -60
  592. package/dist/core/agents/subagent/catalog.d.ts +0 -65
  593. package/dist/core/agents/subagent/catalog.js +0 -200
  594. package/dist/core/agents/subagent/model-spec.d.ts +0 -28
  595. package/dist/core/agents/subagent/model-spec.js +0 -39
  596. package/dist/core/agents/subagent/orchestrate.d.ts +0 -25
  597. package/dist/core/agents/subagent/orchestrate.js +0 -92
  598. package/dist/core/agents/subagent/schema.d.ts +0 -12
  599. package/dist/core/agents/subagent/schema.js +0 -51
  600. package/dist/core/agents/subagent/types.d.ts +0 -84
  601. package/dist/core/agents/subagent/types.js +0 -1
  602. package/dist/core/agents/subagent/usage.d.ts +0 -8
  603. package/dist/core/agents/subagent/usage.js +0 -32
  604. package/dist/core/anthropic-model-discovery.d.ts +0 -54
  605. package/dist/core/anthropic-model-discovery.js +0 -156
  606. package/dist/core/anthropic-models.d.ts +0 -1
  607. package/dist/core/anthropic-models.js +0 -13
  608. package/dist/core/async-mutex.d.ts +0 -6
  609. package/dist/core/async-mutex.js +0 -32
  610. package/dist/core/atomic-write.d.ts +0 -9
  611. package/dist/core/atomic-write.js +0 -104
  612. package/dist/core/auth.d.ts +0 -40
  613. package/dist/core/auth.js +0 -94
  614. package/dist/core/board-action.d.ts +0 -19
  615. package/dist/core/board-action.js +0 -24
  616. package/dist/core/builtin-layer.d.ts +0 -22
  617. package/dist/core/builtin-layer.js +0 -45
  618. package/dist/core/cached-scan.d.ts +0 -42
  619. package/dist/core/cached-scan.js +0 -95
  620. package/dist/core/calver.d.ts +0 -1
  621. package/dist/core/calver.js +0 -25
  622. package/dist/core/claude-credentials.d.ts +0 -91
  623. package/dist/core/claude-credentials.js +0 -242
  624. package/dist/core/cli-utils.d.ts +0 -56
  625. package/dist/core/cli-utils.js +0 -70
  626. package/dist/core/codex-quota.d.ts +0 -27
  627. package/dist/core/codex-quota.js +0 -55
  628. package/dist/core/codex-token.d.ts +0 -4
  629. package/dist/core/codex-token.js +0 -26
  630. package/dist/core/config-generator.d.ts +0 -17
  631. package/dist/core/config-generator.js +0 -181
  632. package/dist/core/debug-mode.d.ts +0 -15
  633. package/dist/core/debug-mode.js +0 -22
  634. package/dist/core/exec-async.d.ts +0 -28
  635. package/dist/core/exec-async.js +0 -48
  636. package/dist/core/file-lock.d.ts +0 -15
  637. package/dist/core/file-lock.js +0 -164
  638. package/dist/core/format-duration.d.ts +0 -7
  639. package/dist/core/format-duration.js +0 -23
  640. package/dist/core/gateway-generator.d.ts +0 -152
  641. package/dist/core/gateway-generator.js +0 -559
  642. package/dist/core/git-availability.d.ts +0 -2
  643. package/dist/core/git-availability.js +0 -43
  644. package/dist/core/hook-bus.d.ts +0 -25
  645. package/dist/core/hook-bus.js +0 -99
  646. package/dist/core/hook-exec.d.ts +0 -15
  647. package/dist/core/hook-exec.js +0 -86
  648. package/dist/core/hook-scripts.d.ts +0 -19
  649. package/dist/core/hook-scripts.js +0 -30
  650. package/dist/core/i18n.d.ts +0 -19
  651. package/dist/core/i18n.js +0 -42
  652. package/dist/core/icons.d.ts +0 -72
  653. package/dist/core/icons.js +0 -71
  654. package/dist/core/json-repository.d.ts +0 -78
  655. package/dist/core/json-repository.js +0 -154
  656. package/dist/core/locales/en.d.ts +0 -911
  657. package/dist/core/locales/en.js +0 -32
  658. package/dist/core/locales/slices/commands.d.ts +0 -301
  659. package/dist/core/locales/slices/commands.js +0 -634
  660. package/dist/core/locales/slices/init.d.ts +0 -153
  661. package/dist/core/locales/slices/init.js +0 -431
  662. package/dist/core/locales/slices/interactions.d.ts +0 -47
  663. package/dist/core/locales/slices/interactions.js +0 -99
  664. package/dist/core/locales/slices/lang.d.ts +0 -8
  665. package/dist/core/locales/slices/lang.js +0 -15
  666. package/dist/core/locales/slices/notices.d.ts +0 -78
  667. package/dist/core/locales/slices/notices.js +0 -156
  668. package/dist/core/locales/slices/providers.d.ts +0 -43
  669. package/dist/core/locales/slices/providers.js +0 -87
  670. package/dist/core/locales/slices/scheduling.d.ts +0 -33
  671. package/dist/core/locales/slices/scheduling.js +0 -65
  672. package/dist/core/locales/slices/startup.d.ts +0 -10
  673. package/dist/core/locales/slices/startup.js +0 -19
  674. package/dist/core/locales/slices/status.d.ts +0 -48
  675. package/dist/core/locales/slices/status.js +0 -109
  676. package/dist/core/locales/slices/tui.d.ts +0 -93
  677. package/dist/core/locales/slices/tui.js +0 -192
  678. package/dist/core/locales/slices/uiextra.d.ts +0 -49
  679. package/dist/core/locales/slices/uiextra.js +0 -102
  680. package/dist/core/locales/slices/uimsg.d.ts +0 -74
  681. package/dist/core/locales/slices/uimsg.js +0 -158
  682. package/dist/core/locales/zh.d.ts +0 -5
  683. package/dist/core/locales/zh.js +0 -30
  684. package/dist/core/log.d.ts +0 -16
  685. package/dist/core/log.js +0 -174
  686. package/dist/core/loopback-http.d.ts +0 -6
  687. package/dist/core/loopback-http.js +0 -43
  688. package/dist/core/mcp-bundles.d.ts +0 -8
  689. package/dist/core/mcp-bundles.js +0 -47
  690. package/dist/core/mcp-timeout.d.ts +0 -1
  691. package/dist/core/mcp-timeout.js +0 -1
  692. package/dist/core/mcp-tool-gate.d.ts +0 -25
  693. package/dist/core/mcp-tool-gate.js +0 -97
  694. package/dist/core/media-types.d.ts +0 -20
  695. package/dist/core/media-types.js +0 -63
  696. package/dist/core/models-generator.d.ts +0 -29
  697. package/dist/core/models-generator.js +0 -82
  698. package/dist/core/native-name.d.ts +0 -4
  699. package/dist/core/native-name.js +0 -57
  700. package/dist/core/paths.d.ts +0 -63
  701. package/dist/core/paths.js +0 -105
  702. package/dist/core/pi-sdk.d.ts +0 -38
  703. package/dist/core/pi-session-filename.d.ts +0 -10
  704. package/dist/core/pi-session-filename.js +0 -49
  705. package/dist/core/platform-settings-spec.d.ts +0 -47
  706. package/dist/core/platform-settings-spec.js +0 -28
  707. package/dist/core/private-dir.d.ts +0 -13
  708. package/dist/core/private-dir.js +0 -48
  709. package/dist/core/process-command-line.d.ts +0 -6
  710. package/dist/core/process-command-line.js +0 -39
  711. package/dist/core/prompt-template.d.ts +0 -14
  712. package/dist/core/prompt-template.js +0 -29
  713. package/dist/core/rebuild-progress.d.ts +0 -59
  714. package/dist/core/rebuild-progress.js +0 -106
  715. package/dist/core/resilient-watch.d.ts +0 -28
  716. package/dist/core/resilient-watch.js +0 -108
  717. package/dist/core/resume-reminder.d.ts +0 -5
  718. package/dist/core/resume-reminder.js +0 -12
  719. package/dist/core/run-registry.d.ts +0 -134
  720. package/dist/core/run-registry.js +0 -256
  721. package/dist/core/runtime-env.d.ts +0 -1
  722. package/dist/core/runtime-env.js +0 -11
  723. package/dist/core/session-holds.d.ts +0 -88
  724. package/dist/core/session-holds.js +0 -168
  725. package/dist/core/session-state.d.ts +0 -32
  726. package/dist/core/session-state.js +0 -39
  727. package/dist/core/session-todos.d.ts +0 -12
  728. package/dist/core/session-todos.js +0 -44
  729. package/dist/core/settings-migration.d.ts +0 -5
  730. package/dist/core/settings-migration.js +0 -128
  731. package/dist/core/settings-spec.d.ts +0 -301
  732. package/dist/core/settings-spec.js +0 -309
  733. package/dist/core/settings.d.ts +0 -19
  734. package/dist/core/settings.js +0 -492
  735. package/dist/core/short-session-id.d.ts +0 -2
  736. package/dist/core/short-session-id.js +0 -4
  737. package/dist/core/singleton-lock.d.ts +0 -39
  738. package/dist/core/singleton-lock.js +0 -127
  739. package/dist/core/status-format.d.ts +0 -70
  740. package/dist/core/status-format.js +0 -59
  741. package/dist/core/subagent-spawn.d.ts +0 -40
  742. package/dist/core/subagent-spawn.js +0 -47
  743. package/dist/core/team-action.d.ts +0 -28
  744. package/dist/core/team-action.js +0 -65
  745. package/dist/core/todo.d.ts +0 -18
  746. package/dist/core/todo.js +0 -79
  747. package/dist/core/tool-names.d.ts +0 -12
  748. package/dist/core/tool-names.js +0 -65
  749. package/dist/core/types/agent-types.d.ts +0 -173
  750. package/dist/core/types/agent-types.js +0 -1
  751. package/dist/core/types/environment-types.d.ts +0 -45
  752. package/dist/core/types/environment-types.js +0 -1
  753. package/dist/core/utils.d.ts +0 -72
  754. package/dist/core/utils.js +0 -176
  755. package/dist/core/version.d.ts +0 -6
  756. package/dist/core/version.js +0 -11
  757. package/dist/core/workspace-filenames.d.ts +0 -9
  758. package/dist/core/workspace-filenames.js +0 -61
  759. package/dist/domain/agents/agent-state.d.ts +0 -19
  760. package/dist/domain/agents/agent-state.js +0 -73
  761. package/dist/domain/agents/agent-switch.d.ts +0 -16
  762. package/dist/domain/agents/agent-switch.js +0 -30
  763. package/dist/domain/agents/config.d.ts +0 -20
  764. package/dist/domain/agents/config.js +0 -89
  765. package/dist/domain/agents/engine-selection.d.ts +0 -21
  766. package/dist/domain/agents/engine-selection.js +0 -37
  767. package/dist/domain/agents/environments/entities.d.ts +0 -50
  768. package/dist/domain/agents/environments/entities.js +0 -94
  769. package/dist/domain/agents/environments/file-refs.d.ts +0 -20
  770. package/dist/domain/agents/environments/file-refs.js +0 -51
  771. package/dist/domain/agents/environments/index.d.ts +0 -7
  772. package/dist/domain/agents/environments/index.js +0 -9
  773. package/dist/domain/agents/environments/paths.d.ts +0 -7
  774. package/dist/domain/agents/environments/paths.js +0 -9
  775. package/dist/domain/agents/environments/prompt-includes.d.ts +0 -1
  776. package/dist/domain/agents/environments/prompt-includes.js +0 -91
  777. package/dist/domain/agents/environments/registry.d.ts +0 -17
  778. package/dist/domain/agents/environments/registry.js +0 -163
  779. package/dist/domain/agents/environments/resolve.d.ts +0 -11
  780. package/dist/domain/agents/environments/resolve.js +0 -36
  781. package/dist/domain/agents/environments/schema.d.ts +0 -69
  782. package/dist/domain/agents/environments/schema.js +0 -115
  783. package/dist/domain/agents/environments/schema.parity.d.ts +0 -1
  784. package/dist/domain/agents/environments/schema.parity.js +0 -7
  785. package/dist/domain/agents/environments/system-prompt.d.ts +0 -37
  786. package/dist/domain/agents/environments/system-prompt.js +0 -110
  787. package/dist/domain/agents/index.d.ts +0 -6
  788. package/dist/domain/agents/index.js +0 -7
  789. package/dist/domain/agents/model-selection.d.ts +0 -30
  790. package/dist/domain/agents/model-selection.js +0 -111
  791. package/dist/domain/agents/models.d.ts +0 -12
  792. package/dist/domain/agents/models.js +0 -94
  793. package/dist/domain/agents/provider-run-lifecycle.d.ts +0 -11
  794. package/dist/domain/agents/provider-run-lifecycle.js +0 -17
  795. package/dist/domain/agents/subagent/background-spend.d.ts +0 -17
  796. package/dist/domain/agents/subagent/background-spend.js +0 -42
  797. package/dist/domain/agents/subagent/foreign.d.ts +0 -13
  798. package/dist/domain/agents/subagent/foreign.js +0 -30
  799. package/dist/domain/agents/subagent/registry.d.ts +0 -106
  800. package/dist/domain/agents/subagent/registry.js +0 -272
  801. package/dist/domain/agents/subagent/runner.d.ts +0 -61
  802. package/dist/domain/agents/subagent/runner.js +0 -301
  803. package/dist/domain/agents/subagent/service.d.ts +0 -26
  804. package/dist/domain/agents/subagent/service.js +0 -68
  805. package/dist/domain/auth/anthropic-env.d.ts +0 -20
  806. package/dist/domain/auth/anthropic-env.js +0 -132
  807. package/dist/domain/auth/auth-events.d.ts +0 -18
  808. package/dist/domain/auth/auth-events.js +0 -34
  809. package/dist/domain/auth/auth-format.d.ts +0 -2
  810. package/dist/domain/auth/auth-format.js +0 -53
  811. package/dist/domain/auth/auth-status.d.ts +0 -63
  812. package/dist/domain/auth/auth-status.js +0 -286
  813. package/dist/domain/auth/auth-watch.d.ts +0 -16
  814. package/dist/domain/auth/auth-watch.js +0 -166
  815. package/dist/domain/auth/cc-auth-cli.d.ts +0 -30
  816. package/dist/domain/auth/cc-login.d.ts +0 -7
  817. package/dist/domain/auth/cc-login.js +0 -20
  818. package/dist/domain/auth/cc-subscription.d.ts +0 -18
  819. package/dist/domain/auth/cc-subscription.js +0 -54
  820. package/dist/domain/auth/claude-account-credentials.d.ts +0 -13
  821. package/dist/domain/auth/claude-account-credentials.js +0 -22
  822. package/dist/domain/auth/claude-user-settings.d.ts +0 -22
  823. package/dist/domain/auth/claude-user-settings.js +0 -104
  824. package/dist/domain/auth/codex-credentials.d.ts +0 -13
  825. package/dist/domain/auth/codex-credentials.js +0 -25
  826. package/dist/domain/auth/gateway-sync.d.ts +0 -19
  827. package/dist/domain/auth/gateway-sync.js +0 -46
  828. package/dist/domain/auth/index.d.ts +0 -14
  829. package/dist/domain/auth/index.js +0 -14
  830. package/dist/domain/auth/login-flow.d.ts +0 -141
  831. package/dist/domain/auth/login-flow.js +0 -339
  832. package/dist/domain/auth/login-service.d.ts +0 -33
  833. package/dist/domain/auth/login-service.js +0 -65
  834. package/dist/domain/auth/logout.d.ts +0 -32
  835. package/dist/domain/auth/logout.js +0 -156
  836. package/dist/domain/auth/pi-login.d.ts +0 -26
  837. package/dist/domain/auth/pi-login.js +0 -70
  838. package/dist/domain/auth/pi-oauth.d.ts +0 -26
  839. package/dist/domain/auth/pi-oauth.js +0 -85
  840. package/dist/domain/auth/pi-runtime.d.ts +0 -82
  841. package/dist/domain/auth/pi-runtime.js +0 -40
  842. package/dist/domain/benchmark/accounting-reconciliation.d.ts +0 -117
  843. package/dist/domain/benchmark/accounting-reconciliation.js +0 -174
  844. package/dist/domain/benchmark/atif.d.ts +0 -42
  845. package/dist/domain/benchmark/atif.js +0 -263
  846. package/dist/domain/benchmark/attempt-record.d.ts +0 -167
  847. package/dist/domain/benchmark/attempt-record.js +0 -113
  848. package/dist/domain/benchmark/benchmark-types.d.ts +0 -17
  849. package/dist/domain/benchmark/benchmark-types.js +0 -1
  850. package/dist/domain/benchmark/composite-manifest.d.ts +0 -117
  851. package/dist/domain/benchmark/composite-manifest.js +0 -477
  852. package/dist/domain/benchmark/decimal-text.d.ts +0 -22
  853. package/dist/domain/benchmark/decimal-text.js +0 -42
  854. package/dist/domain/benchmark/identity.d.ts +0 -39
  855. package/dist/domain/benchmark/identity.js +0 -70
  856. package/dist/domain/benchmark/journal.d.ts +0 -47
  857. package/dist/domain/benchmark/journal.js +0 -254
  858. package/dist/domain/benchmark/manifest-contract.d.ts +0 -30
  859. package/dist/domain/benchmark/manifest-contract.js +0 -118
  860. package/dist/domain/benchmark/production-attempt-identity.d.ts +0 -73
  861. package/dist/domain/benchmark/production-attempt-identity.js +0 -372
  862. package/dist/domain/benchmark/production-attempt-journal.d.ts +0 -38
  863. package/dist/domain/benchmark/production-attempt-journal.js +0 -267
  864. package/dist/domain/benchmark/production-benchmark-evidence.d.ts +0 -2
  865. package/dist/domain/benchmark/production-benchmark-evidence.js +0 -67
  866. package/dist/domain/benchmark/production-evidence-export.d.ts +0 -14
  867. package/dist/domain/benchmark/production-evidence-export.js +0 -134
  868. package/dist/domain/benchmark/production-evidence-journal.d.ts +0 -11
  869. package/dist/domain/benchmark/production-evidence-journal.js +0 -81
  870. package/dist/domain/benchmark/production-evidence-projection.d.ts +0 -39
  871. package/dist/domain/benchmark/production-evidence-projection.js +0 -392
  872. package/dist/domain/benchmark/role-surface.d.ts +0 -4
  873. package/dist/domain/benchmark/role-surface.js +0 -117
  874. package/dist/domain/benchmark/session-evidence.d.ts +0 -7
  875. package/dist/domain/benchmark/session-evidence.js +0 -34
  876. package/dist/domain/boards/board-context.d.ts +0 -17
  877. package/dist/domain/boards/board-context.js +0 -11
  878. package/dist/domain/boards/board-paths.d.ts +0 -18
  879. package/dist/domain/boards/board-paths.js +0 -32
  880. package/dist/domain/boards/board-service.d.ts +0 -50
  881. package/dist/domain/boards/board-service.js +0 -146
  882. package/dist/domain/boards/board-watcher.d.ts +0 -36
  883. package/dist/domain/boards/board-watcher.js +0 -284
  884. package/dist/domain/boards/decision-projection.d.ts +0 -46
  885. package/dist/domain/boards/decision-projection.js +0 -44
  886. package/dist/domain/browser/broker.d.ts +0 -99
  887. package/dist/domain/browser/broker.js +0 -487
  888. package/dist/domain/costs/account-reset.d.ts +0 -30
  889. package/dist/domain/costs/account-reset.js +0 -98
  890. package/dist/domain/costs/aistatus-config.d.ts +0 -27
  891. package/dist/domain/costs/aistatus-config.js +0 -56
  892. package/dist/domain/costs/claude-account.d.ts +0 -34
  893. package/dist/domain/costs/claude-account.js +0 -170
  894. package/dist/domain/costs/codex-account.d.ts +0 -55
  895. package/dist/domain/costs/codex-account.js +0 -155
  896. package/dist/domain/costs/cost-tracker.d.ts +0 -181
  897. package/dist/domain/costs/cost-tracker.js +0 -350
  898. package/dist/domain/costs/gateway-manager.d.ts +0 -6
  899. package/dist/domain/costs/gateway-manager.js +0 -225
  900. package/dist/domain/costs/rate-limit-throttle.d.ts +0 -78
  901. package/dist/domain/costs/rate-limit-throttle.js +0 -502
  902. package/dist/domain/costs/reset-account.d.ts +0 -36
  903. package/dist/domain/costs/reset-account.js +0 -5
  904. package/dist/domain/costs/resume-registry.d.ts +0 -30
  905. package/dist/domain/costs/resume-registry.js +0 -108
  906. package/dist/domain/costs/usage-service.d.ts +0 -80
  907. package/dist/domain/costs/usage-service.js +0 -618
  908. package/dist/domain/costs/usage-store.d.ts +0 -83
  909. package/dist/domain/costs/usage-store.js +0 -104
  910. package/dist/domain/executions/registry.d.ts +0 -47
  911. package/dist/domain/executions/registry.js +0 -100
  912. package/dist/domain/hooks/hook-view.d.ts +0 -22
  913. package/dist/domain/hooks/hook-view.js +0 -34
  914. package/dist/domain/mcp/bundled-server.d.ts +0 -19
  915. package/dist/domain/mcp/feishu/client.d.ts +0 -46
  916. package/dist/domain/mcp/feishu/client.js +0 -91
  917. package/dist/domain/mcp/feishu/file.d.ts +0 -14
  918. package/dist/domain/mcp/feishu/file.js +0 -88
  919. package/dist/domain/mcp/feishu/types.d.ts +0 -31
  920. package/dist/domain/mcp/feishu/types.js +0 -34
  921. package/dist/domain/mcp/feishu/user-auth.d.ts +0 -140
  922. package/dist/domain/mcp/feishu/user-auth.js +0 -278
  923. package/dist/domain/mcp/tools/agents-md.d.ts +0 -16
  924. package/dist/domain/mcp/tools/agents-md.js +0 -34
  925. package/dist/domain/mcp/tools/catalog-owner.d.ts +0 -3
  926. package/dist/domain/mcp/tools/catalog-owner.js +0 -23
  927. package/dist/domain/mcp/tools/context.d.ts +0 -69
  928. package/dist/domain/mcp/tools/context.js +0 -106
  929. package/dist/domain/mcp/tools/cost.d.ts +0 -2
  930. package/dist/domain/mcp/tools/cost.js +0 -56
  931. package/dist/domain/mcp/tools/executions.d.ts +0 -2
  932. package/dist/domain/mcp/tools/executions.js +0 -71
  933. package/dist/domain/mcp/tools/interaction-ask.d.ts +0 -37
  934. package/dist/domain/mcp/tools/interaction-ask.js +0 -131
  935. package/dist/domain/mcp/tools/interaction-plan.d.ts +0 -34
  936. package/dist/domain/mcp/tools/interaction-plan.js +0 -116
  937. package/dist/domain/mcp/tools/remote-devices.d.ts +0 -9
  938. package/dist/domain/mcp/tools/remote-devices.js +0 -28
  939. package/dist/domain/mcp/tools/remote-file.d.ts +0 -24
  940. package/dist/domain/mcp/tools/remote-file.js +0 -52
  941. package/dist/domain/mcp/tools/remote-ops.d.ts +0 -3
  942. package/dist/domain/mcp/tools/remote-ops.js +0 -359
  943. package/dist/domain/mcp/tools/slack.d.ts +0 -23
  944. package/dist/domain/mcp/tools/slack.js +0 -106
  945. package/dist/domain/mcp/tools/subagent.d.ts +0 -23
  946. package/dist/domain/mcp/tools/subagent.js +0 -179
  947. package/dist/domain/mcp/tools/time.d.ts +0 -2
  948. package/dist/domain/mcp/tools/time.js +0 -62
  949. package/dist/domain/mcp/tools/ui-board.d.ts +0 -12
  950. package/dist/domain/mcp/tools/ui-board.js +0 -48
  951. package/dist/domain/mcp/tools/ui-decision.d.ts +0 -3
  952. package/dist/domain/mcp/tools/ui-decision.js +0 -37
  953. package/dist/domain/mcp/tools/ui-file.d.ts +0 -3
  954. package/dist/domain/mcp/tools/ui-file.js +0 -70
  955. package/dist/domain/mcp/tools/ui-view.d.ts +0 -3
  956. package/dist/domain/mcp/tools/ui-view.js +0 -44
  957. package/dist/domain/mcp/tools/waitpoint.d.ts +0 -28
  958. package/dist/domain/mcp/tools/waitpoint.js +0 -109
  959. package/dist/domain/mcp/tools/workers.d.ts +0 -5
  960. package/dist/domain/mcp/tools/workers.js +0 -77
  961. package/dist/domain/memory/agents-md-injector.d.ts +0 -25
  962. package/dist/domain/memory/agents-md-injector.js +0 -58
  963. package/dist/domain/memory/consolidate.d.ts +0 -56
  964. package/dist/domain/memory/consolidate.js +0 -419
  965. package/dist/domain/memory/index-regen.d.ts +0 -30
  966. package/dist/domain/memory/index-regen.js +0 -334
  967. package/dist/domain/memory/rules-loader.d.ts +0 -6
  968. package/dist/domain/memory/rules-loader.js +0 -13
  969. package/dist/domain/memory/user-context.d.ts +0 -5
  970. package/dist/domain/memory/user-context.js +0 -32
  971. package/dist/domain/memory/watcher.d.ts +0 -8
  972. package/dist/domain/memory/watcher.js +0 -135
  973. package/dist/domain/monitor/disk-monitor.d.ts +0 -17
  974. package/dist/domain/monitor/disk-monitor.js +0 -117
  975. package/dist/domain/monitor/event-loop-monitor.d.ts +0 -35
  976. package/dist/domain/monitor/event-loop-monitor.js +0 -64
  977. package/dist/domain/monitor/gpu-monitor.d.ts +0 -26
  978. package/dist/domain/monitor/gpu-monitor.js +0 -132
  979. package/dist/domain/pi-providers/custom-provider-model.d.ts +0 -49
  980. package/dist/domain/pi-providers/custom-provider-model.js +0 -116
  981. package/dist/domain/pi-providers/custom-provider-service.d.ts +0 -57
  982. package/dist/domain/pi-providers/custom-provider-service.js +0 -153
  983. package/dist/domain/pi-providers/gateway-route-store.d.ts +0 -23
  984. package/dist/domain/pi-providers/gateway-route-store.js +0 -74
  985. package/dist/domain/pi-providers/index.d.ts +0 -3
  986. package/dist/domain/pi-providers/index.js +0 -3
  987. package/dist/domain/pi-providers/models-json-store.d.ts +0 -6
  988. package/dist/domain/pi-providers/models-json-store.js +0 -73
  989. package/dist/domain/plugins/agent-plugins-v1.d.ts +0 -58
  990. package/dist/domain/plugins/agent-plugins-v1.js +0 -84
  991. package/dist/domain/plugins/authoring.d.ts +0 -46
  992. package/dist/domain/plugins/authoring.js +0 -335
  993. package/dist/domain/plugins/builtin.d.ts +0 -25
  994. package/dist/domain/plugins/builtin.js +0 -44
  995. package/dist/domain/plugins/catalog-types.d.ts +0 -89
  996. package/dist/domain/plugins/catalog-types.js +0 -39
  997. package/dist/domain/plugins/catalog.d.ts +0 -39
  998. package/dist/domain/plugins/catalog.js +0 -482
  999. package/dist/domain/plugins/conversation-skills.d.ts +0 -10
  1000. package/dist/domain/plugins/conversation-skills.js +0 -22
  1001. package/dist/domain/plugins/fs-helpers.d.ts +0 -9
  1002. package/dist/domain/plugins/fs-helpers.js +0 -107
  1003. package/dist/domain/plugins/mcp.d.ts +0 -6
  1004. package/dist/domain/plugins/mcp.js +0 -223
  1005. package/dist/domain/plugins/runtime-gc.d.ts +0 -17
  1006. package/dist/domain/plugins/runtime-gc.js +0 -101
  1007. package/dist/domain/plugins/runtime.d.ts +0 -21
  1008. package/dist/domain/plugins/runtime.js +0 -555
  1009. package/dist/domain/plugins/skill-projection.d.ts +0 -19
  1010. package/dist/domain/plugins/skill-projection.js +0 -193
  1011. package/dist/domain/plugins/skill.d.ts +0 -14
  1012. package/dist/domain/plugins/skill.js +0 -145
  1013. package/dist/domain/projects/index.d.ts +0 -3
  1014. package/dist/domain/projects/index.js +0 -3
  1015. package/dist/domain/projects/project-store.d.ts +0 -72
  1016. package/dist/domain/projects/project-store.js +0 -240
  1017. package/dist/domain/projects/project-types.d.ts +0 -11
  1018. package/dist/domain/projects/project-types.js +0 -1
  1019. package/dist/domain/remote/client-bootstrap.d.ts +0 -1
  1020. package/dist/domain/remote/client-bootstrap.js +0 -126
  1021. package/dist/domain/remote/client-hot-reload.d.ts +0 -40
  1022. package/dist/domain/remote/client-hot-reload.js +0 -269
  1023. package/dist/domain/remote/client-lifecycle.d.ts +0 -32
  1024. package/dist/domain/remote/client-lifecycle.js +0 -382
  1025. package/dist/domain/remote/client-manager.d.ts +0 -54
  1026. package/dist/domain/remote/client-manager.js +0 -325
  1027. package/dist/domain/remote/client-pids.d.ts +0 -13
  1028. package/dist/domain/remote/client-pids.js +0 -43
  1029. package/dist/domain/remote/client-protocol.d.ts +0 -1
  1030. package/dist/domain/remote/client-protocol.js +0 -1
  1031. package/dist/domain/remote/client-remove.d.ts +0 -61
  1032. package/dist/domain/remote/client-remove.js +0 -129
  1033. package/dist/domain/remote/client-ssh-tunnel.d.ts +0 -79
  1034. package/dist/domain/remote/client-ssh-tunnel.js +0 -352
  1035. package/dist/domain/remote/device-browser.d.ts +0 -38
  1036. package/dist/domain/remote/device-browser.js +0 -158
  1037. package/dist/domain/remote/device-chrome-commands.d.ts +0 -18
  1038. package/dist/domain/remote/device-chrome-commands.js +0 -125
  1039. package/dist/domain/remote/device-file.d.ts +0 -51
  1040. package/dist/domain/remote/device-file.js +0 -193
  1041. package/dist/domain/remote/device-port.d.ts +0 -23
  1042. package/dist/domain/remote/device-port.js +0 -192
  1043. package/dist/domain/remote/local-client-install.d.ts +0 -32
  1044. package/dist/domain/remote/local-client-install.js +0 -168
  1045. package/dist/domain/remote/local-client-stop.d.ts +0 -37
  1046. package/dist/domain/remote/local-client-stop.js +0 -101
  1047. package/dist/domain/remote/machine-registry.d.ts +0 -54
  1048. package/dist/domain/remote/machine-registry.js +0 -184
  1049. package/dist/domain/remote/owned-local-launch.d.ts +0 -22
  1050. package/dist/domain/remote/owned-local-launch.js +0 -75
  1051. package/dist/domain/remote/package-client-bundle.d.ts +0 -14
  1052. package/dist/domain/remote/package-client-bundle.js +0 -37
  1053. package/dist/domain/remote/reverse-stream.d.ts +0 -42
  1054. package/dist/domain/remote/reverse-stream.js +0 -95
  1055. package/dist/domain/remote/ssh-exec.d.ts +0 -10
  1056. package/dist/domain/remote/ssh-exec.js +0 -25
  1057. package/dist/domain/runs/adapters.d.ts +0 -15
  1058. package/dist/domain/runs/adapters.js +0 -59
  1059. package/dist/domain/runs/attempt.d.ts +0 -37
  1060. package/dist/domain/runs/attempt.js +0 -232
  1061. package/dist/domain/runs/builders.d.ts +0 -27
  1062. package/dist/domain/runs/builders.js +0 -47
  1063. package/dist/domain/runs/compact.d.ts +0 -30
  1064. package/dist/domain/runs/compact.js +0 -43
  1065. package/dist/domain/runs/config-resolver.d.ts +0 -26
  1066. package/dist/domain/runs/config-resolver.js +0 -38
  1067. package/dist/domain/runs/engine-spec.d.ts +0 -40
  1068. package/dist/domain/runs/engine-spec.js +0 -215
  1069. package/dist/domain/runs/engines.d.ts +0 -71
  1070. package/dist/domain/runs/engines.js +0 -181
  1071. package/dist/domain/runs/events.d.ts +0 -2
  1072. package/dist/domain/runs/events.js +0 -1
  1073. package/dist/domain/runs/fallback.d.ts +0 -11
  1074. package/dist/domain/runs/fallback.js +0 -18
  1075. package/dist/domain/runs/mode-env.d.ts +0 -16
  1076. package/dist/domain/runs/mode-env.js +0 -48
  1077. package/dist/domain/runs/notices.d.ts +0 -44
  1078. package/dist/domain/runs/notices.js +0 -109
  1079. package/dist/domain/runs/observers/resume-recorder.d.ts +0 -26
  1080. package/dist/domain/runs/observers/resume-recorder.js +0 -27
  1081. package/dist/domain/runs/prompt.d.ts +0 -78
  1082. package/dist/domain/runs/prompt.js +0 -98
  1083. package/dist/domain/runs/request.d.ts +0 -99
  1084. package/dist/domain/runs/request.js +0 -1
  1085. package/dist/domain/runs/retryable-errors.d.ts +0 -5
  1086. package/dist/domain/runs/retryable-errors.js +0 -24
  1087. package/dist/domain/runs/run.d.ts +0 -238
  1088. package/dist/domain/runs/run.js +0 -574
  1089. package/dist/domain/runs/service.d.ts +0 -3
  1090. package/dist/domain/runs/service.js +0 -63
  1091. package/dist/domain/runs/spec-loader.d.ts +0 -75
  1092. package/dist/domain/runs/spec-loader.js +0 -58
  1093. package/dist/domain/runs/spend.d.ts +0 -16
  1094. package/dist/domain/runs/spend.js +0 -31
  1095. package/dist/domain/scheduling/builtin-job-controller.d.ts +0 -21
  1096. package/dist/domain/scheduling/builtin-job-controller.js +0 -106
  1097. package/dist/domain/scheduling/builtin-job-migration.d.ts +0 -23
  1098. package/dist/domain/scheduling/builtin-job-migration.js +0 -64
  1099. package/dist/domain/scheduling/builtin-jobs.d.ts +0 -2
  1100. package/dist/domain/scheduling/builtin-jobs.js +0 -44
  1101. package/dist/domain/scheduling/job-registry.d.ts +0 -22
  1102. package/dist/domain/scheduling/job-registry.js +0 -16
  1103. package/dist/domain/scheduling/jobs/auth-expiry-scan.d.ts +0 -15
  1104. package/dist/domain/scheduling/jobs/auth-expiry-scan.js +0 -75
  1105. package/dist/domain/scheduling/jobs/scheduled-task.d.ts +0 -24
  1106. package/dist/domain/scheduling/jobs/scheduled-task.js +0 -112
  1107. package/dist/domain/scheduling/jobs/sync-public.d.ts +0 -4
  1108. package/dist/domain/scheduling/jobs/sync-public.js +0 -40
  1109. package/dist/domain/scheduling/run-guards.d.ts +0 -6
  1110. package/dist/domain/scheduling/run-guards.js +0 -18
  1111. package/dist/domain/scheduling/runner.d.ts +0 -17
  1112. package/dist/domain/scheduling/runner.js +0 -22
  1113. package/dist/domain/scheduling/schedule-ops.d.ts +0 -15
  1114. package/dist/domain/scheduling/schedule-ops.js +0 -43
  1115. package/dist/domain/scheduling/schedule-selection.d.ts +0 -3
  1116. package/dist/domain/scheduling/schedule-selection.js +0 -16
  1117. package/dist/domain/scheduling/schedule-spec.d.ts +0 -79
  1118. package/dist/domain/scheduling/schedule-spec.js +0 -169
  1119. package/dist/domain/scheduling/scheduler.d.ts +0 -75
  1120. package/dist/domain/scheduling/scheduler.js +0 -312
  1121. package/dist/domain/sessions/session-backup.d.ts +0 -44
  1122. package/dist/domain/sessions/session-backup.js +0 -138
  1123. package/dist/domain/sessions/session-hooks.d.ts +0 -130
  1124. package/dist/domain/sessions/session-hooks.js +0 -347
  1125. package/dist/domain/sessions/session-lifecycle.d.ts +0 -91
  1126. package/dist/domain/sessions/session-lifecycle.js +0 -82
  1127. package/dist/domain/sessions/session-retention.d.ts +0 -50
  1128. package/dist/domain/sessions/session-retention.js +0 -466
  1129. package/dist/domain/sessions/session-use.d.ts +0 -28
  1130. package/dist/domain/sessions/session-use.js +0 -45
  1131. package/dist/domain/sessions/session.d.ts +0 -3
  1132. package/dist/domain/sessions/session.js +0 -13
  1133. package/dist/domain/sessions/team.d.ts +0 -26
  1134. package/dist/domain/sessions/team.js +0 -30
  1135. package/dist/domain/system/doctor.d.ts +0 -82
  1136. package/dist/domain/system/doctor.js +0 -484
  1137. package/dist/domain/system/github-release.d.ts +0 -16
  1138. package/dist/domain/system/github-release.js +0 -101
  1139. package/dist/domain/system/install-cli.d.ts +0 -7
  1140. package/dist/domain/system/install-cli.js +0 -107
  1141. package/dist/domain/system/notice-history.d.ts +0 -18
  1142. package/dist/domain/system/notice-history.js +0 -23
  1143. package/dist/domain/system/own-bin-path.d.ts +0 -13
  1144. package/dist/domain/system/own-bin-path.js +0 -36
  1145. package/dist/domain/system/preferences.d.ts +0 -30
  1146. package/dist/domain/system/preferences.js +0 -59
  1147. package/dist/domain/system/rebuild-hold.d.ts +0 -36
  1148. package/dist/domain/system/rebuild-hold.js +0 -83
  1149. package/dist/domain/system/server-update-check.d.ts +0 -24
  1150. package/dist/domain/system/server-update-check.js +0 -89
  1151. package/dist/domain/system/server-update-coordinator.d.ts +0 -46
  1152. package/dist/domain/system/server-update-coordinator.js +0 -155
  1153. package/dist/domain/system/server-update-install.d.ts +0 -16
  1154. package/dist/domain/system/server-update-install.js +0 -65
  1155. package/dist/domain/system/system-notice.d.ts +0 -24
  1156. package/dist/domain/system/system-notice.js +0 -31
  1157. package/dist/domain/system/terminal-cli/index.d.ts +0 -58
  1158. package/dist/domain/system/terminal-cli/index.js +0 -100
  1159. package/dist/domain/system/terminal-cli/posix-profiles.d.ts +0 -23
  1160. package/dist/domain/system/terminal-cli/posix-profiles.js +0 -74
  1161. package/dist/domain/system/terminal-cli/registrar.d.ts +0 -12
  1162. package/dist/domain/system/terminal-cli/registrar.js +0 -1
  1163. package/dist/domain/system/terminal-cli/shims.d.ts +0 -27
  1164. package/dist/domain/system/terminal-cli/shims.js +0 -108
  1165. package/dist/domain/system/terminal-cli/state.d.ts +0 -7
  1166. package/dist/domain/system/terminal-cli/state.js +0 -36
  1167. package/dist/domain/system/terminal-cli/windows-user-path.d.ts +0 -13
  1168. package/dist/domain/system/terminal-cli/windows-user-path.js +0 -67
  1169. package/dist/domain/system/update-prompt.d.ts +0 -8
  1170. package/dist/domain/system/update-prompt.js +0 -1
  1171. package/dist/domain/system/update-state.d.ts +0 -9
  1172. package/dist/domain/system/update-state.js +0 -22
  1173. package/dist/domain/system/update-ui-state.d.ts +0 -39
  1174. package/dist/domain/system/update-ui-state.js +0 -70
  1175. package/dist/domain/telemetry/bus-collector.d.ts +0 -3
  1176. package/dist/domain/telemetry/bus-collector.js +0 -22
  1177. package/dist/domain/telemetry/child-exit.d.ts +0 -11
  1178. package/dist/domain/telemetry/child-exit.js +0 -36
  1179. package/dist/domain/telemetry/client-kind.d.ts +0 -4
  1180. package/dist/domain/telemetry/client-kind.js +0 -7
  1181. package/dist/domain/telemetry/crash-limits.d.ts +0 -15
  1182. package/dist/domain/telemetry/crash-limits.js +0 -50
  1183. package/dist/domain/telemetry/crash.d.ts +0 -25
  1184. package/dist/domain/telemetry/crash.js +0 -70
  1185. package/dist/domain/telemetry/daily-upload.d.ts +0 -5
  1186. package/dist/domain/telemetry/daily-upload.js +0 -20
  1187. package/dist/domain/telemetry/daily.d.ts +0 -5
  1188. package/dist/domain/telemetry/daily.js +0 -104
  1189. package/dist/domain/telemetry/endpoint.d.ts +0 -7
  1190. package/dist/domain/telemetry/endpoint.js +0 -40
  1191. package/dist/domain/telemetry/envelope.d.ts +0 -6
  1192. package/dist/domain/telemetry/envelope.js +0 -35
  1193. package/dist/domain/telemetry/error-digest.d.ts +0 -7
  1194. package/dist/domain/telemetry/error-digest.js +0 -43
  1195. package/dist/domain/telemetry/funnel.d.ts +0 -6
  1196. package/dist/domain/telemetry/funnel.js +0 -22
  1197. package/dist/domain/telemetry/gate.d.ts +0 -19
  1198. package/dist/domain/telemetry/gate.js +0 -67
  1199. package/dist/domain/telemetry/heartbeat.d.ts +0 -17
  1200. package/dist/domain/telemetry/heartbeat.js +0 -49
  1201. package/dist/domain/telemetry/info.d.ts +0 -9
  1202. package/dist/domain/telemetry/info.js +0 -12
  1203. package/dist/domain/telemetry/init-answer.d.ts +0 -12
  1204. package/dist/domain/telemetry/init-answer.js +0 -42
  1205. package/dist/domain/telemetry/install-id.d.ts +0 -5
  1206. package/dist/domain/telemetry/install-id.js +0 -42
  1207. package/dist/domain/telemetry/normalize.d.ts +0 -33
  1208. package/dist/domain/telemetry/normalize.js +0 -88
  1209. package/dist/domain/telemetry/outbox.d.ts +0 -18
  1210. package/dist/domain/telemetry/outbox.js +0 -93
  1211. package/dist/domain/telemetry/panic-group.d.ts +0 -4
  1212. package/dist/domain/telemetry/panic-group.js +0 -51
  1213. package/dist/domain/telemetry/paths.d.ts +0 -7
  1214. package/dist/domain/telemetry/paths.js +0 -11
  1215. package/dist/domain/telemetry/redact.d.ts +0 -18
  1216. package/dist/domain/telemetry/redact.js +0 -109
  1217. package/dist/domain/telemetry/rollup-types.d.ts +0 -81
  1218. package/dist/domain/telemetry/rollup-types.js +0 -31
  1219. package/dist/domain/telemetry/rollup.d.ts +0 -16
  1220. package/dist/domain/telemetry/rollup.js +0 -102
  1221. package/dist/domain/telemetry/schema.d.ts +0 -931
  1222. package/dist/domain/telemetry/schema.js +0 -275
  1223. package/dist/domain/telemetry/service.d.ts +0 -34
  1224. package/dist/domain/telemetry/service.js +0 -146
  1225. package/dist/domain/telemetry/state.d.ts +0 -17
  1226. package/dist/domain/telemetry/state.js +0 -29
  1227. package/dist/domain/telemetry/turns.d.ts +0 -17
  1228. package/dist/domain/telemetry/turns.js +0 -176
  1229. package/dist/domain/telemetry/upgrade.d.ts +0 -14
  1230. package/dist/domain/telemetry/upgrade.js +0 -87
  1231. package/dist/domain/telemetry/uploader.d.ts +0 -21
  1232. package/dist/domain/telemetry/uploader.js +0 -82
  1233. package/dist/domain/telemetry/usage.d.ts +0 -25
  1234. package/dist/domain/telemetry/usage.js +0 -153
  1235. package/dist/domain/telemetry/web-report.d.ts +0 -8
  1236. package/dist/domain/telemetry/web-report.js +0 -15
  1237. package/dist/domain/tui-session/index.d.ts +0 -2
  1238. package/dist/domain/tui-session/index.js +0 -1
  1239. package/dist/domain/tui-session/tui-session-service.d.ts +0 -2
  1240. package/dist/domain/tui-session/tui-session-service.js +0 -85
  1241. package/dist/domain/tui-session/types.d.ts +0 -40
  1242. package/dist/domain/tui-session/types.js +0 -1
  1243. package/dist/domain/ui-service/app-router.d.ts +0 -1180
  1244. package/dist/domain/ui-service/app-router.js +0 -312
  1245. package/dist/domain/ui-service/assistant-snapshots.d.ts +0 -10
  1246. package/dist/domain/ui-service/assistant-snapshots.js +0 -45
  1247. package/dist/domain/ui-service/contract.parity.d.ts +0 -19
  1248. package/dist/domain/ui-service/contract.parity.js +0 -1
  1249. package/dist/domain/ui-service/index.d.ts +0 -4
  1250. package/dist/domain/ui-service/index.js +0 -1
  1251. package/dist/domain/ui-service/inline-media-types.d.ts +0 -18
  1252. package/dist/domain/ui-service/inline-media-types.js +0 -1
  1253. package/dist/domain/ui-service/input-schemas.d.ts +0 -1132
  1254. package/dist/domain/ui-service/input-schemas.js +0 -710
  1255. package/dist/domain/ui-service/mutate/approvals.d.ts +0 -33
  1256. package/dist/domain/ui-service/mutate/approvals.js +0 -134
  1257. package/dist/domain/ui-service/mutate/auth.d.ts +0 -15
  1258. package/dist/domain/ui-service/mutate/auth.js +0 -103
  1259. package/dist/domain/ui-service/mutate/config.d.ts +0 -18
  1260. package/dist/domain/ui-service/mutate/config.js +0 -108
  1261. package/dist/domain/ui-service/mutate/custom-providers.d.ts +0 -8
  1262. package/dist/domain/ui-service/mutate/custom-providers.js +0 -33
  1263. package/dist/domain/ui-service/mutate/environments.d.ts +0 -27
  1264. package/dist/domain/ui-service/mutate/environments.js +0 -66
  1265. package/dist/domain/ui-service/mutate/errors.d.ts +0 -7
  1266. package/dist/domain/ui-service/mutate/errors.js +0 -14
  1267. package/dist/domain/ui-service/mutate/executions.d.ts +0 -4
  1268. package/dist/domain/ui-service/mutate/executions.js +0 -15
  1269. package/dist/domain/ui-service/mutate/hooks.d.ts +0 -12
  1270. package/dist/domain/ui-service/mutate/hooks.js +0 -110
  1271. package/dist/domain/ui-service/mutate/issues.d.ts +0 -18
  1272. package/dist/domain/ui-service/mutate/issues.js +0 -100
  1273. package/dist/domain/ui-service/mutate/models.d.ts +0 -13
  1274. package/dist/domain/ui-service/mutate/models.js +0 -137
  1275. package/dist/domain/ui-service/mutate/notes.d.ts +0 -6
  1276. package/dist/domain/ui-service/mutate/notes.js +0 -32
  1277. package/dist/domain/ui-service/mutate/platform-settings.d.ts +0 -6
  1278. package/dist/domain/ui-service/mutate/platform-settings.js +0 -17
  1279. package/dist/domain/ui-service/mutate/plugin-packages.d.ts +0 -10
  1280. package/dist/domain/ui-service/mutate/plugin-packages.js +0 -152
  1281. package/dist/domain/ui-service/mutate/plugins.d.ts +0 -2
  1282. package/dist/domain/ui-service/mutate/plugins.js +0 -38
  1283. package/dist/domain/ui-service/mutate/projects.d.ts +0 -4
  1284. package/dist/domain/ui-service/mutate/projects.js +0 -7
  1285. package/dist/domain/ui-service/mutate/resolve-media.d.ts +0 -4
  1286. package/dist/domain/ui-service/mutate/resolve-media.js +0 -17
  1287. package/dist/domain/ui-service/mutate/schedules.d.ts +0 -12
  1288. package/dist/domain/ui-service/mutate/schedules.js +0 -75
  1289. package/dist/domain/ui-service/mutate/session-metadata.d.ts +0 -3
  1290. package/dist/domain/ui-service/mutate/session-metadata.js +0 -22
  1291. package/dist/domain/ui-service/mutate/sessions.d.ts +0 -19
  1292. package/dist/domain/ui-service/mutate/sessions.js +0 -307
  1293. package/dist/domain/ui-service/mutate/system.d.ts +0 -10
  1294. package/dist/domain/ui-service/mutate/system.js +0 -120
  1295. package/dist/domain/ui-service/mutate/telemetry.d.ts +0 -5
  1296. package/dist/domain/ui-service/mutate/telemetry.js +0 -6
  1297. package/dist/domain/ui-service/mutate/usage-sharing.d.ts +0 -8
  1298. package/dist/domain/ui-service/mutate/usage-sharing.js +0 -16
  1299. package/dist/domain/ui-service/mutate/waitpoints.d.ts +0 -2
  1300. package/dist/domain/ui-service/mutate/waitpoints.js +0 -13
  1301. package/dist/domain/ui-service/platform-settings.d.ts +0 -5
  1302. package/dist/domain/ui-service/platform-settings.js +0 -72
  1303. package/dist/domain/ui-service/plugins-shared.d.ts +0 -29
  1304. package/dist/domain/ui-service/plugins-shared.js +0 -176
  1305. package/dist/domain/ui-service/query/approvals.d.ts +0 -10
  1306. package/dist/domain/ui-service/query/approvals.js +0 -119
  1307. package/dist/domain/ui-service/query/auth.d.ts +0 -6
  1308. package/dist/domain/ui-service/query/auth.js +0 -8
  1309. package/dist/domain/ui-service/query/boards.d.ts +0 -14
  1310. package/dist/domain/ui-service/query/boards.js +0 -111
  1311. package/dist/domain/ui-service/query/config.d.ts +0 -9
  1312. package/dist/domain/ui-service/query/config.js +0 -167
  1313. package/dist/domain/ui-service/query/cost.d.ts +0 -3
  1314. package/dist/domain/ui-service/query/cost.js +0 -3
  1315. package/dist/domain/ui-service/query/custom-providers.d.ts +0 -8
  1316. package/dist/domain/ui-service/query/custom-providers.js +0 -9
  1317. package/dist/domain/ui-service/query/environments.d.ts +0 -12
  1318. package/dist/domain/ui-service/query/environments.js +0 -73
  1319. package/dist/domain/ui-service/query/executions.d.ts +0 -3
  1320. package/dist/domain/ui-service/query/executions.js +0 -61
  1321. package/dist/domain/ui-service/query/hooks.d.ts +0 -9
  1322. package/dist/domain/ui-service/query/hooks.js +0 -92
  1323. package/dist/domain/ui-service/query/issues.d.ts +0 -14
  1324. package/dist/domain/ui-service/query/issues.js +0 -78
  1325. package/dist/domain/ui-service/query/machine-detail.d.ts +0 -2
  1326. package/dist/domain/ui-service/query/machine-detail.js +0 -30
  1327. package/dist/domain/ui-service/query/machine-probe.d.ts +0 -18
  1328. package/dist/domain/ui-service/query/machine-probe.js +0 -133
  1329. package/dist/domain/ui-service/query/machines.d.ts +0 -2
  1330. package/dist/domain/ui-service/query/machines.js +0 -21
  1331. package/dist/domain/ui-service/query/memory.d.ts +0 -7
  1332. package/dist/domain/ui-service/query/memory.js +0 -191
  1333. package/dist/domain/ui-service/query/models.d.ts +0 -27
  1334. package/dist/domain/ui-service/query/models.js +0 -125
  1335. package/dist/domain/ui-service/query/notes.d.ts +0 -3
  1336. package/dist/domain/ui-service/query/notes.js +0 -15
  1337. package/dist/domain/ui-service/query/plugin-source.d.ts +0 -4
  1338. package/dist/domain/ui-service/query/plugin-source.js +0 -58
  1339. package/dist/domain/ui-service/query/plugins.d.ts +0 -2
  1340. package/dist/domain/ui-service/query/plugins.js +0 -28
  1341. package/dist/domain/ui-service/query/projects.d.ts +0 -2
  1342. package/dist/domain/ui-service/query/projects.js +0 -27
  1343. package/dist/domain/ui-service/query/schedules.d.ts +0 -5
  1344. package/dist/domain/ui-service/query/schedules.js +0 -28
  1345. package/dist/domain/ui-service/query/sessions.d.ts +0 -6
  1346. package/dist/domain/ui-service/query/sessions.js +0 -430
  1347. package/dist/domain/ui-service/query/skills.d.ts +0 -5
  1348. package/dist/domain/ui-service/query/skills.js +0 -16
  1349. package/dist/domain/ui-service/query/system.d.ts +0 -6
  1350. package/dist/domain/ui-service/query/system.js +0 -120
  1351. package/dist/domain/ui-service/query/telemetry.d.ts +0 -3
  1352. package/dist/domain/ui-service/query/telemetry.js +0 -4
  1353. package/dist/domain/ui-service/query/usage-sharing.d.ts +0 -4
  1354. package/dist/domain/ui-service/query/usage-sharing.js +0 -5
  1355. package/dist/domain/ui-service/query/waitpoints.d.ts +0 -10
  1356. package/dist/domain/ui-service/query/waitpoints.js +0 -37
  1357. package/dist/domain/ui-service/query-input-schemas.d.ts +0 -73
  1358. package/dist/domain/ui-service/query-input-schemas.js +0 -70
  1359. package/dist/domain/ui-service/session-metadata-schemas.d.ts +0 -13
  1360. package/dist/domain/ui-service/session-metadata-schemas.js +0 -9
  1361. package/dist/domain/ui-service/subscribe.d.ts +0 -6
  1362. package/dist/domain/ui-service/subscribe.js +0 -125
  1363. package/dist/domain/ui-service/trpc.d.ts +0 -52
  1364. package/dist/domain/ui-service/trpc.js +0 -43
  1365. package/dist/domain/ui-service/types.d.ts +0 -1808
  1366. package/dist/domain/ui-service/types.js +0 -1
  1367. package/dist/domain/ui-service/ui-service.d.ts +0 -541
  1368. package/dist/domain/ui-service/ui-service.js +0 -235
  1369. package/dist/domain/waitpoints/notices.d.ts +0 -25
  1370. package/dist/domain/waitpoints/notices.js +0 -125
  1371. package/dist/domain/waitpoints/service.d.ts +0 -107
  1372. package/dist/domain/waitpoints/service.js +0 -276
  1373. package/dist/domain/waitpoints/view.d.ts +0 -29
  1374. package/dist/domain/waitpoints/view.js +0 -97
  1375. package/dist/entry/admin-channel-hot-reload.d.ts +0 -4
  1376. package/dist/entry/admin-channel-hot-reload.js +0 -17
  1377. package/dist/entry/app.d.ts +0 -1
  1378. package/dist/entry/auth-cli.d.ts +0 -9
  1379. package/dist/entry/auth-cli.js +0 -55
  1380. package/dist/entry/auth-login-cli.d.ts +0 -20
  1381. package/dist/entry/auth-login-cli.js +0 -153
  1382. package/dist/entry/auth-login-terminal.d.ts +0 -16
  1383. package/dist/entry/auth-login-terminal.js +0 -59
  1384. package/dist/entry/boot-jobs.d.ts +0 -7
  1385. package/dist/entry/boot-jobs.js +0 -16
  1386. package/dist/entry/browser-cli.d.ts +0 -39
  1387. package/dist/entry/cli-help.d.ts +0 -10
  1388. package/dist/entry/cli-help.js +0 -290
  1389. package/dist/entry/cli.d.ts +0 -19
  1390. package/dist/entry/client-cli.d.ts +0 -4
  1391. package/dist/entry/client-cli.js +0 -62
  1392. package/dist/entry/cortex-cli.d.ts +0 -1
  1393. package/dist/entry/daemon-notice.d.ts +0 -26
  1394. package/dist/entry/daemon-notice.js +0 -38
  1395. package/dist/entry/daemon.d.ts +0 -120
  1396. package/dist/entry/doctor-cli.d.ts +0 -8
  1397. package/dist/entry/doctor-cli.js +0 -70
  1398. package/dist/entry/draft-attachments.d.ts +0 -8
  1399. package/dist/entry/draft-attachments.js +0 -79
  1400. package/dist/entry/fast-install.d.ts +0 -49
  1401. package/dist/entry/fast-install.js +0 -192
  1402. package/dist/entry/feishu-login.d.ts +0 -21
  1403. package/dist/entry/feishu-login.js +0 -209
  1404. package/dist/entry/hook-cli.d.ts +0 -14
  1405. package/dist/entry/init-auth.d.ts +0 -4
  1406. package/dist/entry/init-auth.js +0 -42
  1407. package/dist/entry/init-git.d.ts +0 -6
  1408. package/dist/entry/init-git.js +0 -36
  1409. package/dist/entry/init-local-client.d.ts +0 -11
  1410. package/dist/entry/init-local-client.js +0 -34
  1411. package/dist/entry/init.d.ts +0 -151
  1412. package/dist/entry/init.js +0 -1292
  1413. package/dist/entry/local-ui.d.ts +0 -38
  1414. package/dist/entry/local-ui.js +0 -107
  1415. package/dist/entry/memory-cli.d.ts +0 -3
  1416. package/dist/entry/memory-cli.js +0 -79
  1417. package/dist/entry/path-cli.d.ts +0 -4
  1418. package/dist/entry/path-cli.js +0 -65
  1419. package/dist/entry/platform-connect.d.ts +0 -23
  1420. package/dist/entry/platform-connect.js +0 -94
  1421. package/dist/entry/production-app-bootstrap.d.ts +0 -1
  1422. package/dist/entry/production-evidence-export-cli.d.ts +0 -13
  1423. package/dist/entry/provider-cli.d.ts +0 -12
  1424. package/dist/entry/provider-cli.js +0 -199
  1425. package/dist/entry/schedule-cli.d.ts +0 -10
  1426. package/dist/entry/schedule-cli.js +0 -166
  1427. package/dist/entry/shutdown.d.ts +0 -32
  1428. package/dist/entry/shutdown.js +0 -84
  1429. package/dist/entry/signal-cli.d.ts +0 -25
  1430. package/dist/entry/start-ui-http.d.ts +0 -24
  1431. package/dist/entry/start-ui-http.js +0 -188
  1432. package/dist/entry/startup-helpers.d.ts +0 -2
  1433. package/dist/entry/startup-helpers.js +0 -15
  1434. package/dist/entry/startup-notify.d.ts +0 -6
  1435. package/dist/entry/startup-notify.js +0 -18
  1436. package/dist/entry/telemetry-wiring.d.ts +0 -12
  1437. package/dist/entry/telemetry-wiring.js +0 -56
  1438. package/dist/entry/ui-cli.d.ts +0 -2
  1439. package/dist/entry/ui-cli.js +0 -87
  1440. package/dist/entry/ui-http-gate.d.ts +0 -17
  1441. package/dist/entry/ui-http-gate.js +0 -17
  1442. package/dist/entry/ui-service-wiring.d.ts +0 -12
  1443. package/dist/entry/ui-service-wiring.js +0 -144
  1444. package/dist/events/event-bus.d.ts +0 -47
  1445. package/dist/events/event-bus.js +0 -83
  1446. package/dist/events/event-logger.d.ts +0 -12
  1447. package/dist/events/event-logger.js +0 -144
  1448. package/dist/events/event-types.d.ts +0 -259
  1449. package/dist/events/event-types.js +0 -1
  1450. package/dist/events/index.d.ts +0 -5
  1451. package/dist/events/index.js +0 -2
  1452. package/dist/orchestration/agent-decision-send.d.ts +0 -42
  1453. package/dist/orchestration/agent-decision-send.js +0 -62
  1454. package/dist/orchestration/agent-file-send.d.ts +0 -58
  1455. package/dist/orchestration/agent-file-send.js +0 -69
  1456. package/dist/orchestration/agent-runner.d.ts +0 -52
  1457. package/dist/orchestration/agent-runner.js +0 -230
  1458. package/dist/orchestration/agent-view-send.d.ts +0 -66
  1459. package/dist/orchestration/agent-view-send.js +0 -103
  1460. package/dist/orchestration/attachments-store.d.ts +0 -31
  1461. package/dist/orchestration/attachments-store.js +0 -156
  1462. package/dist/orchestration/benchmark-session-webhook.d.ts +0 -19
  1463. package/dist/orchestration/benchmark-session-webhook.js +0 -142
  1464. package/dist/orchestration/board-webhook.d.ts +0 -7
  1465. package/dist/orchestration/board-webhook.js +0 -38
  1466. package/dist/orchestration/browser-webhook.d.ts +0 -11
  1467. package/dist/orchestration/browser-webhook.js +0 -28
  1468. package/dist/orchestration/busy-tracker.d.ts +0 -15
  1469. package/dist/orchestration/busy-tracker.js +0 -38
  1470. package/dist/orchestration/cache-keep-warm.d.ts +0 -77
  1471. package/dist/orchestration/cache-keep-warm.js +0 -213
  1472. package/dist/orchestration/claude-window-warmup.d.ts +0 -40
  1473. package/dist/orchestration/claude-window-warmup.js +0 -126
  1474. package/dist/orchestration/conduit-queue.d.ts +0 -14
  1475. package/dist/orchestration/conduit-queue.js +0 -53
  1476. package/dist/orchestration/conversation-request.d.ts +0 -163
  1477. package/dist/orchestration/conversation-request.js +0 -276
  1478. package/dist/orchestration/delta-coalescer.d.ts +0 -69
  1479. package/dist/orchestration/delta-coalescer.js +0 -120
  1480. package/dist/orchestration/durable-helpers.d.ts +0 -3
  1481. package/dist/orchestration/durable-helpers.js +0 -38
  1482. package/dist/orchestration/edit-retry.d.ts +0 -35
  1483. package/dist/orchestration/edit-retry.js +0 -127
  1484. package/dist/orchestration/injection-ledger.d.ts +0 -56
  1485. package/dist/orchestration/injection-ledger.js +0 -270
  1486. package/dist/orchestration/inline-media-eager.d.ts +0 -13
  1487. package/dist/orchestration/inline-media-eager.js +0 -58
  1488. package/dist/orchestration/inline-media.d.ts +0 -22
  1489. package/dist/orchestration/inline-media.js +0 -151
  1490. package/dist/orchestration/interactions/answer-question.d.ts +0 -16
  1491. package/dist/orchestration/interactions/answer-question.js +0 -38
  1492. package/dist/orchestration/interactions/ask-user-question.d.ts +0 -34
  1493. package/dist/orchestration/interactions/ask-user-question.js +0 -179
  1494. package/dist/orchestration/interactions/ask-user-resume.d.ts +0 -11
  1495. package/dist/orchestration/interactions/ask-user-resume.js +0 -57
  1496. package/dist/orchestration/interactions/command-action-router.d.ts +0 -31
  1497. package/dist/orchestration/interactions/command-action-router.js +0 -48
  1498. package/dist/orchestration/interactions/interaction-handlers.d.ts +0 -5
  1499. package/dist/orchestration/interactions/interaction-handlers.js +0 -288
  1500. package/dist/orchestration/interactions/interaction-records.d.ts +0 -57
  1501. package/dist/orchestration/interactions/interaction-records.js +0 -142
  1502. package/dist/orchestration/interactions/plan-approvals.d.ts +0 -38
  1503. package/dist/orchestration/interactions/plan-approvals.js +0 -73
  1504. package/dist/orchestration/interactions/plan-handler.d.ts +0 -3
  1505. package/dist/orchestration/interactions/plan-handler.js +0 -13
  1506. package/dist/orchestration/interactions/plan-response.d.ts +0 -9
  1507. package/dist/orchestration/interactions/plan-response.js +0 -23
  1508. package/dist/orchestration/interactions/ui-update-prompt.d.ts +0 -8
  1509. package/dist/orchestration/interactions/ui-update-prompt.js +0 -39
  1510. package/dist/orchestration/interactions/update-prompt.d.ts +0 -6
  1511. package/dist/orchestration/interactions/update-prompt.js +0 -150
  1512. package/dist/orchestration/mid-turn-inject.d.ts +0 -64
  1513. package/dist/orchestration/mid-turn-inject.js +0 -103
  1514. package/dist/orchestration/orchestrator.d.ts +0 -23
  1515. package/dist/orchestration/orchestrator.js +0 -12
  1516. package/dist/orchestration/outputs-store.d.ts +0 -40
  1517. package/dist/orchestration/outputs-store.js +0 -83
  1518. package/dist/orchestration/pending-injection-recovery.d.ts +0 -36
  1519. package/dist/orchestration/pending-injection-recovery.js +0 -88
  1520. package/dist/orchestration/pi-background-subagent.d.ts +0 -15
  1521. package/dist/orchestration/pi-background-subagent.js +0 -34
  1522. package/dist/orchestration/resume-dispatcher.d.ts +0 -20
  1523. package/dist/orchestration/resume-dispatcher.js +0 -97
  1524. package/dist/orchestration/resume-target-sink.d.ts +0 -37
  1525. package/dist/orchestration/resume-target-sink.js +0 -68
  1526. package/dist/orchestration/routing/commands/cancel.d.ts +0 -58
  1527. package/dist/orchestration/routing/commands/cancel.js +0 -212
  1528. package/dist/orchestration/routing/commands/channel.d.ts +0 -7
  1529. package/dist/orchestration/routing/commands/channel.js +0 -229
  1530. package/dist/orchestration/routing/commands/command-context.d.ts +0 -14
  1531. package/dist/orchestration/routing/commands/command-context.js +0 -1
  1532. package/dist/orchestration/routing/commands/compact.d.ts +0 -6
  1533. package/dist/orchestration/routing/commands/compact.js +0 -22
  1534. package/dist/orchestration/routing/commands/cost.d.ts +0 -11
  1535. package/dist/orchestration/routing/commands/cost.js +0 -101
  1536. package/dist/orchestration/routing/commands/device.d.ts +0 -4
  1537. package/dist/orchestration/routing/commands/device.js +0 -70
  1538. package/dist/orchestration/routing/commands/index.d.ts +0 -22
  1539. package/dist/orchestration/routing/commands/index.js +0 -160
  1540. package/dist/orchestration/routing/commands/lang.d.ts +0 -9
  1541. package/dist/orchestration/routing/commands/lang.js +0 -34
  1542. package/dist/orchestration/routing/commands/login-custom.d.ts +0 -26
  1543. package/dist/orchestration/routing/commands/login-custom.js +0 -85
  1544. package/dist/orchestration/routing/commands/login-notice.d.ts +0 -23
  1545. package/dist/orchestration/routing/commands/login-notice.js +0 -84
  1546. package/dist/orchestration/routing/commands/login.d.ts +0 -12
  1547. package/dist/orchestration/routing/commands/login.js +0 -560
  1548. package/dist/orchestration/routing/commands/mode.d.ts +0 -10
  1549. package/dist/orchestration/routing/commands/mode.js +0 -302
  1550. package/dist/orchestration/routing/commands/nvtop.d.ts +0 -3
  1551. package/dist/orchestration/routing/commands/nvtop.js +0 -107
  1552. package/dist/orchestration/routing/commands/orient.d.ts +0 -2
  1553. package/dist/orchestration/routing/commands/orient.js +0 -5
  1554. package/dist/orchestration/routing/commands/restart.d.ts +0 -18
  1555. package/dist/orchestration/routing/commands/restart.js +0 -31
  1556. package/dist/orchestration/routing/commands/schedule.d.ts +0 -6
  1557. package/dist/orchestration/routing/commands/schedule.js +0 -206
  1558. package/dist/orchestration/routing/commands/sendfile.d.ts +0 -2
  1559. package/dist/orchestration/routing/commands/sendfile.js +0 -97
  1560. package/dist/orchestration/routing/commands/session.d.ts +0 -18
  1561. package/dist/orchestration/routing/commands/session.js +0 -131
  1562. package/dist/orchestration/routing/commands/status.d.ts +0 -5
  1563. package/dist/orchestration/routing/commands/status.js +0 -165
  1564. package/dist/orchestration/routing/commands/tail.d.ts +0 -2
  1565. package/dist/orchestration/routing/commands/tail.js +0 -79
  1566. package/dist/orchestration/routing/commands/time-ago.d.ts +0 -2
  1567. package/dist/orchestration/routing/commands/time-ago.js +0 -14
  1568. package/dist/orchestration/routing/commands/usage-format.d.ts +0 -5
  1569. package/dist/orchestration/routing/commands/usage-format.js +0 -107
  1570. package/dist/orchestration/routing/commands/usage-reset.d.ts +0 -20
  1571. package/dist/orchestration/routing/commands/usage-reset.js +0 -123
  1572. package/dist/orchestration/routing/commands/usage.d.ts +0 -10
  1573. package/dist/orchestration/routing/commands/usage.js +0 -54
  1574. package/dist/orchestration/routing/edit-handler.d.ts +0 -27
  1575. package/dist/orchestration/routing/edit-handler.js +0 -205
  1576. package/dist/orchestration/routing/file-handler.d.ts +0 -15
  1577. package/dist/orchestration/routing/file-handler.js +0 -39
  1578. package/dist/orchestration/routing/hook-bridge-subscribers.d.ts +0 -14
  1579. package/dist/orchestration/routing/hook-bridge-subscribers.js +0 -174
  1580. package/dist/orchestration/routing/hook-bridge.d.ts +0 -28
  1581. package/dist/orchestration/routing/hook-bridge.js +0 -104
  1582. package/dist/orchestration/routing/message-router.d.ts +0 -6
  1583. package/dist/orchestration/routing/message-router.js +0 -62
  1584. package/dist/orchestration/routing/webhook.d.ts +0 -10
  1585. package/dist/orchestration/routing/webhook.js +0 -434
  1586. package/dist/orchestration/runtime.d.ts +0 -30
  1587. package/dist/orchestration/runtime.js +0 -37
  1588. package/dist/orchestration/session-compact.d.ts +0 -50
  1589. package/dist/orchestration/session-compact.js +0 -84
  1590. package/dist/orchestration/session-events.d.ts +0 -173
  1591. package/dist/orchestration/session-events.js +0 -140
  1592. package/dist/orchestration/session-gateway.d.ts +0 -52
  1593. package/dist/orchestration/session-gateway.js +0 -87
  1594. package/dist/orchestration/session-retention-controller.d.ts +0 -14
  1595. package/dist/orchestration/session-retention-controller.js +0 -88
  1596. package/dist/orchestration/session-retention-liveness.d.ts +0 -13
  1597. package/dist/orchestration/session-retention-liveness.js +0 -31
  1598. package/dist/orchestration/session-rewind.d.ts +0 -79
  1599. package/dist/orchestration/session-rewind.js +0 -147
  1600. package/dist/orchestration/status-helpers.d.ts +0 -40
  1601. package/dist/orchestration/status-helpers.js +0 -177
  1602. package/dist/orchestration/subagent-adopt.d.ts +0 -20
  1603. package/dist/orchestration/subagent-adopt.js +0 -43
  1604. package/dist/orchestration/subagent-attribution.d.ts +0 -42
  1605. package/dist/orchestration/subagent-attribution.js +0 -130
  1606. package/dist/orchestration/subagent-delivery.d.ts +0 -43
  1607. package/dist/orchestration/subagent-delivery.js +0 -112
  1608. package/dist/orchestration/subagent-rows.d.ts +0 -11
  1609. package/dist/orchestration/subagent-rows.js +0 -16
  1610. package/dist/orchestration/subagent-webhook.d.ts +0 -6
  1611. package/dist/orchestration/subagent-webhook.js +0 -89
  1612. package/dist/orchestration/team-delivery.d.ts +0 -81
  1613. package/dist/orchestration/team-delivery.js +0 -284
  1614. package/dist/orchestration/team-inbox.d.ts +0 -18
  1615. package/dist/orchestration/team-inbox.js +0 -49
  1616. package/dist/orchestration/team-state.d.ts +0 -74
  1617. package/dist/orchestration/team-state.js +0 -219
  1618. package/dist/orchestration/team-webhook.d.ts +0 -57
  1619. package/dist/orchestration/team-webhook.js +0 -293
  1620. package/dist/orchestration/transcript-sink.d.ts +0 -83
  1621. package/dist/orchestration/transcript-sink.js +0 -267
  1622. package/dist/orchestration/turn/active-turns.d.ts +0 -49
  1623. package/dist/orchestration/turn/active-turns.js +0 -76
  1624. package/dist/orchestration/turn/background-hold.d.ts +0 -158
  1625. package/dist/orchestration/turn/background-hold.js +0 -240
  1626. package/dist/orchestration/turn/hold-render-platform.d.ts +0 -35
  1627. package/dist/orchestration/turn/hold-render-platform.js +0 -105
  1628. package/dist/orchestration/turn/hold-render-web.d.ts +0 -17
  1629. package/dist/orchestration/turn/hold-render-web.js +0 -51
  1630. package/dist/orchestration/turn/terminal.d.ts +0 -105
  1631. package/dist/orchestration/turn/terminal.js +0 -194
  1632. package/dist/orchestration/turn/turn-prep.d.ts +0 -33
  1633. package/dist/orchestration/turn/turn-prep.js +0 -44
  1634. package/dist/orchestration/turn/turn-tracking.d.ts +0 -22
  1635. package/dist/orchestration/turn/turn-tracking.js +0 -89
  1636. package/dist/orchestration/turn/turn.d.ts +0 -199
  1637. package/dist/orchestration/turn/turn.js +0 -586
  1638. package/dist/orchestration/turn-mutation-lock.d.ts +0 -3
  1639. package/dist/orchestration/turn-mutation-lock.js +0 -32
  1640. package/dist/orchestration/turn-notify.d.ts +0 -22
  1641. package/dist/orchestration/turn-notify.js +0 -50
  1642. package/dist/orchestration/waitpoint-ingress.d.ts +0 -36
  1643. package/dist/orchestration/waitpoint-ingress.js +0 -183
  1644. package/dist/orchestration/waitpoint-notifier.d.ts +0 -32
  1645. package/dist/orchestration/waitpoint-notifier.js +0 -140
  1646. package/dist/orchestration/waitpoint-remote-drain.d.ts +0 -22
  1647. package/dist/orchestration/waitpoint-remote-drain.js +0 -134
  1648. package/dist/orchestration/waitpoint-sweep.d.ts +0 -43
  1649. package/dist/orchestration/waitpoint-sweep.js +0 -84
  1650. package/dist/platform/adapter.d.ts +0 -48
  1651. package/dist/platform/adapter.js +0 -1
  1652. package/dist/platform/adapters/chunked-output-stream.d.ts +0 -71
  1653. package/dist/platform/adapters/chunked-output-stream.js +0 -382
  1654. package/dist/platform/adapters/composite-adapter.d.ts +0 -99
  1655. package/dist/platform/adapters/composite-adapter.js +0 -369
  1656. package/dist/platform/adapters/feishu-http.d.ts +0 -46
  1657. package/dist/platform/adapters/feishu-http.js +0 -108
  1658. package/dist/platform/adapters/feishu-image.d.ts +0 -19
  1659. package/dist/platform/adapters/feishu-image.js +0 -64
  1660. package/dist/platform/adapters/feishu-output-stream.d.ts +0 -11
  1661. package/dist/platform/adapters/feishu-output-stream.js +0 -29
  1662. package/dist/platform/adapters/feishu.d.ts +0 -167
  1663. package/dist/platform/adapters/feishu.js +0 -1059
  1664. package/dist/platform/adapters/index.d.ts +0 -19
  1665. package/dist/platform/adapters/index.js +0 -108
  1666. package/dist/platform/adapters/project-conduits.d.ts +0 -9
  1667. package/dist/platform/adapters/project-conduits.js +0 -36
  1668. package/dist/platform/adapters/slack-output-stream.d.ts +0 -15
  1669. package/dist/platform/adapters/slack-output-stream.js +0 -33
  1670. package/dist/platform/adapters/slack.d.ts +0 -106
  1671. package/dist/platform/adapters/slack.js +0 -733
  1672. package/dist/platform/adapters/tui/index.d.ts +0 -2
  1673. package/dist/platform/adapters/tui/index.js +0 -2
  1674. package/dist/platform/adapters/tui/ports.d.ts +0 -46
  1675. package/dist/platform/adapters/tui/ports.js +0 -1
  1676. package/dist/platform/adapters/tui/tui-connection.d.ts +0 -20
  1677. package/dist/platform/adapters/tui/tui-connection.js +0 -44
  1678. package/dist/platform/adapters/tui/tui-gateway.d.ts +0 -90
  1679. package/dist/platform/adapters/tui/tui-gateway.js +0 -884
  1680. package/dist/platform/adapters/tui/tui-output-stream.d.ts +0 -35
  1681. package/dist/platform/adapters/tui/tui-output-stream.js +0 -94
  1682. package/dist/platform/adapters/tui/tui-transcript.d.ts +0 -8
  1683. package/dist/platform/adapters/tui/tui-transcript.js +0 -42
  1684. package/dist/platform/browser/agent-browser.d.ts +0 -50
  1685. package/dist/platform/browser/agent-browser.js +0 -165
  1686. package/dist/platform/browser/display.d.ts +0 -48
  1687. package/dist/platform/browser/display.js +0 -188
  1688. package/dist/platform/browser/managed-browser.d.ts +0 -23
  1689. package/dist/platform/browser/managed-browser.js +0 -357
  1690. package/dist/platform/index.d.ts +0 -10
  1691. package/dist/platform/index.js +0 -6
  1692. package/dist/platform/interactive-builder.d.ts +0 -34
  1693. package/dist/platform/interactive-builder.js +0 -138
  1694. package/dist/platform/output-stream-chunk.d.ts +0 -6
  1695. package/dist/platform/output-stream-chunk.js +0 -42
  1696. package/dist/platform/output-stream-helpers.d.ts +0 -8
  1697. package/dist/platform/output-stream-helpers.js +0 -19
  1698. package/dist/platform/output-stream.d.ts +0 -35
  1699. package/dist/platform/output-stream.js +0 -1
  1700. package/dist/platform/testing.d.ts +0 -136
  1701. package/dist/platform/testing.js +0 -286
  1702. package/dist/platform/tool-trace.d.ts +0 -35
  1703. package/dist/platform/tool-trace.js +0 -287
  1704. package/dist/platform/tui/protocol.d.ts +0 -352
  1705. package/dist/platform/tui/protocol.js +0 -146
  1706. package/dist/platform/types.d.ts +0 -223
  1707. package/dist/platform/types.js +0 -22
  1708. package/dist/platform/ui-http/access-jwt.d.ts +0 -28
  1709. package/dist/platform/ui-http/access-jwt.js +0 -53
  1710. package/dist/platform/ui-http/app-update.d.ts +0 -69
  1711. package/dist/platform/ui-http/app-update.js +0 -143
  1712. package/dist/platform/ui-http/browser-stream.d.ts +0 -110
  1713. package/dist/platform/ui-http/browser-stream.js +0 -447
  1714. package/dist/platform/ui-http/device-ports.d.ts +0 -34
  1715. package/dist/platform/ui-http/device-ports.js +0 -102
  1716. package/dist/platform/ui-http/file-routes.d.ts +0 -23
  1717. package/dist/platform/ui-http/file-routes.js +0 -224
  1718. package/dist/platform/ui-http/http-json.d.ts +0 -24
  1719. package/dist/platform/ui-http/http-json.js +0 -109
  1720. package/dist/platform/ui-http/listening-ports.d.ts +0 -98
  1721. package/dist/platform/ui-http/listening-ports.js +0 -239
  1722. package/dist/platform/ui-http/port-forward.d.ts +0 -40
  1723. package/dist/platform/ui-http/port-forward.js +0 -130
  1724. package/dist/platform/ui-http/ui-auth-routes.d.ts +0 -51
  1725. package/dist/platform/ui-http/ui-auth-routes.js +0 -120
  1726. package/dist/platform/ui-http/ui-device-routes.d.ts +0 -13
  1727. package/dist/platform/ui-http/ui-device-routes.js +0 -81
  1728. package/dist/platform/ui-http/ui-devices.d.ts +0 -24
  1729. package/dist/platform/ui-http/ui-devices.js +0 -107
  1730. package/dist/platform/ui-http/ui-http-server.d.ts +0 -100
  1731. package/dist/platform/ui-http/ui-http-server.js +0 -310
  1732. package/dist/platform/ui-http/ui-ota.d.ts +0 -22
  1733. package/dist/platform/ui-http/ui-ota.js +0 -151
  1734. package/dist/platform/ui-http/ui-pairing.d.ts +0 -25
  1735. package/dist/platform/ui-http/ui-pairing.js +0 -98
  1736. package/dist/platform/ui-http/ui-session.d.ts +0 -33
  1737. package/dist/platform/ui-http/ui-session.js +0 -124
  1738. package/dist/platform/ui-http/zip-writer.d.ts +0 -13
  1739. package/dist/platform/ui-http/zip-writer.js +0 -93
  1740. package/dist/platform/utils/rate-limiter.d.ts +0 -90
  1741. package/dist/platform/utils/rate-limiter.js +0 -203
  1742. package/dist/platform/utils/reaction-diagnostics.d.ts +0 -9
  1743. package/dist/platform/utils/reaction-diagnostics.js +0 -19
  1744. package/dist/platform/utils/readable-file.d.ts +0 -9
  1745. package/dist/platform/utils/readable-file.js +0 -18
  1746. package/dist/store/board-migration.d.ts +0 -21
  1747. package/dist/store/board-migration.js +0 -217
  1748. package/dist/store/board-repo.d.ts +0 -35
  1749. package/dist/store/board-repo.js +0 -62
  1750. package/dist/store/builtin-overlay-migration.d.ts +0 -11
  1751. package/dist/store/builtin-overlay-migration.js +0 -308
  1752. package/dist/store/claude-transcript-migration.d.ts +0 -32
  1753. package/dist/store/claude-transcript-migration.js +0 -119
  1754. package/dist/store/conversation-display-projection.d.ts +0 -36
  1755. package/dist/store/conversation-display-projection.js +0 -180
  1756. package/dist/store/conversation-history-reader.d.ts +0 -30
  1757. package/dist/store/conversation-history-reader.js +0 -440
  1758. package/dist/store/conversation-history-repo.d.ts +0 -449
  1759. package/dist/store/conversation-history-repo.js +0 -632
  1760. package/dist/store/conversation-ledger-repo.d.ts +0 -76
  1761. package/dist/store/conversation-ledger-repo.js +0 -219
  1762. package/dist/store/cost-repo.d.ts +0 -88
  1763. package/dist/store/cost-repo.js +0 -233
  1764. package/dist/store/execution-repo.d.ts +0 -169
  1765. package/dist/store/execution-repo.js +0 -329
  1766. package/dist/store/gitignore-migration.d.ts +0 -2
  1767. package/dist/store/gitignore-migration.js +0 -16
  1768. package/dist/store/hook-registry.d.ts +0 -101
  1769. package/dist/store/hook-registry.js +0 -319
  1770. package/dist/store/hook-writer.d.ts +0 -43
  1771. package/dist/store/hook-writer.js +0 -133
  1772. package/dist/store/models-repo.d.ts +0 -18
  1773. package/dist/store/models-repo.js +0 -74
  1774. package/dist/store/outbound-queue.d.ts +0 -67
  1775. package/dist/store/outbound-queue.js +0 -284
  1776. package/dist/store/pending-injection-repo.d.ts +0 -29
  1777. package/dist/store/pending-injection-repo.js +0 -52
  1778. package/dist/store/project-dir-repo.d.ts +0 -17
  1779. package/dist/store/project-dir-repo.js +0 -44
  1780. package/dist/store/project-notes-repo.d.ts +0 -27
  1781. package/dist/store/project-notes-repo.js +0 -219
  1782. package/dist/store/prompt-migration-replacements.d.ts +0 -3
  1783. package/dist/store/prompt-migration-replacements.js +0 -96
  1784. package/dist/store/provider-state-repo.d.ts +0 -22
  1785. package/dist/store/provider-state-repo.js +0 -115
  1786. package/dist/store/retention-candidate-repo.d.ts +0 -12
  1787. package/dist/store/retention-candidate-repo.js +0 -47
  1788. package/dist/store/retire-profiles-migration.d.ts +0 -28
  1789. package/dist/store/retire-profiles-migration.js +0 -335
  1790. package/dist/store/schedule-repo.d.ts +0 -53
  1791. package/dist/store/schedule-repo.js +0 -121
  1792. package/dist/store/session-registry-import.d.ts +0 -34
  1793. package/dist/store/session-registry-import.js +0 -173
  1794. package/dist/store/session-registry-journal.d.ts +0 -195
  1795. package/dist/store/session-registry-journal.js +0 -871
  1796. package/dist/store/session-registry-repo.d.ts +0 -169
  1797. package/dist/store/session-registry-repo.js +0 -530
  1798. package/dist/store/session-totals-repo.d.ts +0 -45
  1799. package/dist/store/session-totals-repo.js +0 -104
  1800. package/dist/store/session-totals.d.ts +0 -69
  1801. package/dist/store/session-totals.js +0 -93
  1802. package/dist/store/team-inbox-repo.d.ts +0 -34
  1803. package/dist/store/team-inbox-repo.js +0 -72
  1804. package/dist/store/team-outbox-repo.d.ts +0 -20
  1805. package/dist/store/team-outbox-repo.js +0 -39
  1806. package/dist/store/tool-image-files.d.ts +0 -12
  1807. package/dist/store/tool-image-files.js +0 -40
  1808. package/dist/store/version-migrations.d.ts +0 -120
  1809. package/dist/store/version-migrations.js +0 -1408
  1810. package/dist/store/waitpoint-repo.d.ts +0 -111
  1811. package/dist/store/waitpoint-repo.js +0 -83
  1812. package/dist/tui/App.d.ts +0 -27
  1813. package/dist/tui/App.js +0 -406
  1814. package/dist/tui/components/AskUserModal.d.ts +0 -10
  1815. package/dist/tui/components/AskUserModal.js +0 -362
  1816. package/dist/tui/components/ConfirmModal.d.ts +0 -12
  1817. package/dist/tui/components/ConfirmModal.js +0 -29
  1818. package/dist/tui/components/Dashboard.d.ts +0 -24
  1819. package/dist/tui/components/Dashboard.js +0 -89
  1820. package/dist/tui/components/DashboardCostTab.d.ts +0 -7
  1821. package/dist/tui/components/DashboardCostTab.js +0 -32
  1822. package/dist/tui/components/DashboardExecutionsTab.d.ts +0 -11
  1823. package/dist/tui/components/DashboardExecutionsTab.js +0 -112
  1824. package/dist/tui/components/DashboardSchedulesTab.d.ts +0 -11
  1825. package/dist/tui/components/DashboardSchedulesTab.js +0 -132
  1826. package/dist/tui/components/InputBox.d.ts +0 -26
  1827. package/dist/tui/components/InputBox.js +0 -266
  1828. package/dist/tui/components/Notifications.d.ts +0 -12
  1829. package/dist/tui/components/Notifications.js +0 -59
  1830. package/dist/tui/components/ProjectSwitcher.d.ts +0 -17
  1831. package/dist/tui/components/ProjectSwitcher.js +0 -40
  1832. package/dist/tui/components/SessionPicker.d.ts +0 -13
  1833. package/dist/tui/components/SessionPicker.js +0 -42
  1834. package/dist/tui/components/SidePanel.d.ts +0 -19
  1835. package/dist/tui/components/SidePanel.js +0 -8
  1836. package/dist/tui/components/SlashMenu.d.ts +0 -8
  1837. package/dist/tui/components/SlashMenu.js +0 -15
  1838. package/dist/tui/components/StatusLine.d.ts +0 -19
  1839. package/dist/tui/components/StatusLine.js +0 -39
  1840. package/dist/tui/components/Transcript.d.ts +0 -21
  1841. package/dist/tui/components/Transcript.js +0 -150
  1842. package/dist/tui/components/dashboard-constants.d.ts +0 -1
  1843. package/dist/tui/components/dashboard-constants.js +0 -1
  1844. package/dist/tui/hooks/useDashboardData.d.ts +0 -24
  1845. package/dist/tui/hooks/useDashboardData.js +0 -75
  1846. package/dist/tui/hooks/useKeybindings.d.ts +0 -19
  1847. package/dist/tui/hooks/useKeybindings.js +0 -75
  1848. package/dist/tui/hooks/useMouseHandler.d.ts +0 -15
  1849. package/dist/tui/hooks/useMouseHandler.js +0 -90
  1850. package/dist/tui/hooks/useMutate.d.ts +0 -22
  1851. package/dist/tui/hooks/useMutate.js +0 -54
  1852. package/dist/tui/hooks/useNotifications.d.ts +0 -26
  1853. package/dist/tui/hooks/useNotifications.js +0 -60
  1854. package/dist/tui/hooks/useTranscript.d.ts +0 -42
  1855. package/dist/tui/hooks/useTranscript.js +0 -277
  1856. package/dist/tui/index.d.ts +0 -2
  1857. package/dist/tui/logic.d.ts +0 -144
  1858. package/dist/tui/logic.js +0 -388
  1859. package/dist/tui/raf-batch.d.ts +0 -31
  1860. package/dist/tui/raf-batch.js +0 -89
  1861. package/dist/tui/render/inline-markdown.d.ts +0 -22
  1862. package/dist/tui/render/inline-markdown.js +0 -99
  1863. package/dist/tui/render/markdown.d.ts +0 -10
  1864. package/dist/tui/render/markdown.js +0 -35
  1865. package/dist/tui/render-output.d.ts +0 -42
  1866. package/dist/tui/render-output.js +0 -81
  1867. package/dist/tui/slash-commands.d.ts +0 -21
  1868. package/dist/tui/slash-commands.js +0 -71
  1869. package/dist/tui/turn-status.d.ts +0 -10
  1870. package/dist/tui/turn-status.js +0 -48
  1871. package/dist/tui/ws-client.d.ts +0 -39
  1872. package/dist/tui/ws-client.js +0 -139
  1873. package/scripts/install-bundled-dependencies.mjs +0 -54
  1874. package/web/dist/assets/board-math-css-spk7yR6n.js +0 -2
  1875. package/web/dist/assets/index-BQ69u-92.css +0 -1
  1876. package/web/dist/assets/index-CKNLatCd.js +0 -1
  1877. package/web/dist/assets/index-CkzWfC98.js +0 -525
@@ -0,0 +1,60 @@
1
+ import { createRequire as __cortexCreateRequire } from 'node:module';
2
+ const require = __cortexCreateRequire(import.meta.url);
3
+ const __cortexPackageRoot = new URL("../../", import.meta.url);
4
+ import{e as k,na as x}from"./chunk-LACGULCN.js";import{d as X}from"./chunk-FX6MOGLR.js";import{F as h,Ia as R,R as w,f as W,s as I,v as F,w as G,x as H,y as N,za as J}from"./chunk-Q7CE3UIE.js";import{h as P,w as U}from"./chunk-QUUEQRIT.js";import{randomBytes as be}from"node:crypto";import{createWriteStream as Le}from"node:fs";import{writeFile as Ce}from"node:fs/promises";import{tmpdir as Me}from"node:os";import{join as ke}from"node:path";var q=384;function z(e,t){return ke(Me(),`${e}-${be(8).toString("hex")}${t}`)}async function Pt(e,t,n){let r=z(e,t);return await Ce(r,n,{mode:q,flag:"wx"}),r}function Ut(e,t){let n=z(e,t);return{path:n,stream:Le(n,{mode:q,flags:"wx"})}}var Ft=2e3,Gt=51200;function B(e){if(e.length===0)return[];let t=e.split(`
5
+ `);return e.endsWith(`
6
+ `)&&t.pop(),t}function Ht(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function Jt(e,t={}){let n=t.maxLines??2e3,r=t.maxBytes??51200,o=Buffer.byteLength(e,"utf-8"),i=B(e),s=i.length;if(s<=n&&o<=r)return{content:e,truncated:!1,truncatedBy:null,totalLines:s,totalBytes:o,outputLines:s,outputBytes:o,lastLinePartial:!1,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r};if(Buffer.byteLength(i[0],"utf-8")>r)return{content:"",truncated:!0,truncatedBy:"bytes",totalLines:s,totalBytes:o,outputLines:0,outputBytes:0,lastLinePartial:!1,firstLineExceedsLimit:!0,maxLines:n,maxBytes:r};let l=[],c=0,p="lines";for(let d=0;d<i.length&&d<n;d++){let m=i[d],y=Buffer.byteLength(m,"utf-8")+(d>0?1:0);if(c+y>r){p="bytes";break}l.push(m),c+=y}l.length>=n&&c<=r&&(p="lines");let u=l.join(`
7
+ `),f=Buffer.byteLength(u,"utf-8");return{content:u,truncated:!0,truncatedBy:p,totalLines:s,totalBytes:o,outputLines:l.length,outputBytes:f,lastLinePartial:!1,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r}}function Xt(e,t={}){let n=t.maxLines??2e3,r=t.maxBytes??51200,o=Buffer.byteLength(e,"utf-8"),i=B(e),s=i.length;if(s<=n&&o<=r)return{content:e,truncated:!1,truncatedBy:null,totalLines:s,totalBytes:o,outputLines:s,outputBytes:o,lastLinePartial:!1,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r};let a=[],l=0,c="lines",p=!1;for(let d=i.length-1;d>=0&&a.length<n;d--){let m=i[d],y=Buffer.byteLength(m,"utf-8")+(a.length>0?1:0);if(l+y>r){if(c="bytes",a.length===0){let A=Ie(m,r);a.unshift(A),l=Buffer.byteLength(A,"utf-8"),p=!0}break}a.unshift(m),l+=y}a.length>=n&&l<=r&&(c="lines");let u=a.join(`
8
+ `),f=Buffer.byteLength(u,"utf-8");return{content:u,truncated:!0,truncatedBy:c,totalLines:s,totalBytes:o,outputLines:a.length,outputBytes:f,lastLinePartial:p,firstLineExceedsLimit:!1,maxLines:n,maxBytes:r}}function Ie(e,t){let n=Buffer.from(e,"utf-8");if(n.length<=t)return e;let r=n.length-t;for(;r<n.length&&(n[r]&192)===128;)r++;return n.slice(r).toString("utf-8")}function qt(e,t=500){return e.length<=t?{text:e,wasTruncated:!1}:{text:`${e.slice(0,t)}... [truncated]`,wasTruncated:!0}}function zt(e,t){let n=Buffer.from(e,"utf-8"),r=B(e).length;if(n.length<=t)return{content:e,truncated:!1,removedChars:0,totalBytes:n.length,totalLines:r};let o=p=>p>=n.length||(n[p]&192)!==128,i=Math.floor(t/2);for(;i>0&&!o(i);)i--;let s=n.length-(t-Math.floor(t/2));for(;s<n.length&&!o(s);)s++;let a=n.subarray(0,i).toString("utf-8"),l=n.subarray(s).toString("utf-8"),c=Array.from(n.subarray(i,s).toString("utf-8")).length;return{content:`${a}\u2026${c} chars truncated\u2026${l}`,truncated:!0,removedChars:c,totalBytes:n.length,totalLines:r}}function Ne(){return{input:0,output:0,cacheRead:0,cacheWrite:0,cost:0}}function Re(e,t){e.input+=t.input,e.output+=t.output,e.cacheRead+=t.cacheRead,e.cacheWrite+=t.cacheWrite,e.cost+=t.cost.total}function Yt(e,t){return{input:e.input+t.input,output:e.output+t.output,cacheRead:e.cacheRead+t.cacheRead,cacheWrite:e.cacheWrite+t.cacheWrite,...e.cacheWrite1h!==void 0||t.cacheWrite1h!==void 0?{cacheWrite1h:(e.cacheWrite1h??0)+(t.cacheWrite1h??0)}:{},...e.reasoning!==void 0||t.reasoning!==void 0?{reasoning:(e.reasoning??0)+(t.reasoning??0)}:{},totalTokens:e.totalTokens+t.totalTokens,cost:{input:e.cost.input+t.cost.input,output:e.cost.output+t.cost.output,cacheRead:e.cost.cacheRead+t.cost.cacheRead,cacheWrite:e.cost.cacheWrite+t.cost.cacheWrite,total:e.cost.total+t.cost.total}}}function Vt(e){let t=new Map;for(let n of e){let r,o;if(n.type==="message"&&n.message.role==="assistant"?(r=`${n.message.provider}/${n.message.responseModel??n.message.model}`,o=n.message.usage):n.type==="usage"?(r=`${n.provider}/${n.model}`,o=n.usage):n.type==="message"&&n.message.role==="toolResult"&&n.message.usage?(r="Tools/summaries",o=n.message.usage):(n.type==="branch_summary"||n.type==="compaction")&&n.usage&&(r="Tools/summaries",o=n.usage),!r||!o)continue;let i=t.get(r);i||(i=Ne(),t.set(r,i)),Re(i,o)}return Array.from(t,([n,r])=>({key:n,cost:r.cost,tokens:r.input+r.output+r.cacheRead+r.cacheWrite})).filter(n=>n.cost>0||n.tokens>0).sort((n,r)=>r.cost-n.cost)}function Be(e,t,n,r=0,o="end"){if(!e)return{visualLines:[],skippedCount:0};let s=new h(e,r,0).render(n);if(s.length<=t)return{visualLines:s,skippedCount:0};let a=o==="start"?s.slice(0,t):s.slice(-t),l=s.length-t;return{visualLines:a,skippedCount:l}}var S=class{options;cachedWidth;cachedLines;constructor(t){this.options=t}render(t){if(this.cachedLines===void 0||this.cachedWidth!==t){let{text:n,maxVisualLines:r,keep:o,formatHint:i}=this.options,s=Be(n,r,t,0,o),a=s.visualLines;if(s.skippedCount>0){let l=W(i(s.skippedCount),t,"...");this.cachedLines=o==="start"?[...a,l]:[l,...a]}else this.cachedLines=a;this.cachedWidth=t}return this.cachedLines}invalidate(){this.cachedWidth=void 0,this.cachedLines=void 0}};import*as te from"node:os";import{pathToFileURL as We}from"node:url";var De="(?:\\u0007|\\u001B\\u005C|\\u009C)",Z="\\u001B\\]",Y="[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?",je="[\\dA-PR-TZcf-nq-uy=><~]",ve=new RegExp(`(?:${Z}[\\s\\S]*?${De})|${Y}${je}`,"g"),Pe=new RegExp(`(?:${Z}(?:[^\\u0007\\u009C\\u001B]|\\u001B(?!\\\\))*|${Y})$`),Ue=256;function tn(e){if(!e.includes("\x1B")&&!e.includes("\x9B"))return{complete:e,pending:""};let t=Math.max(0,e.length-Ue),n=Pe.exec(e.slice(t));if(!n)return{complete:e,pending:""};let r=t+n.index;return{complete:e.slice(0,r),pending:e.slice(r)}}function V(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(ve,"")}function Fe(e){if(typeof e!="string")return"";let t=te.homedir();return e.startsWith(t)?`~${e.slice(t.length)}`:e}function Ge(e,t,n){if(!I().hyperlinks)return e;let r=P(t,n);return G(e,We(r).href)}function ne(e){return typeof e=="string"?e:e==null?"":null}function K(e){return typeof e=="string"&&e.trim()!==""&&(e=Number(e)),typeof e=="number"&&Number.isFinite(e)?e:void 0}function cn(e,t){if(e==null&&t==null)return"";let n=e==null?1:K(e);if(n===void 0)return"";if(t==null)return`:${n}`;let r=K(t);if(r===void 0)return"";let o=n+r-1;return`:${n}${o?`-${o}`:""}`}function _(e){return e.replace(/\t/g," ")}function ln(e){return e.replace(/\r/g,"")}function re(e,t){if(!e)return"";let n=e.content.filter(s=>s.type==="text"),r=e.content.filter(s=>s.type==="image"),o=n.map(s=>X(V(s.text||"")).replace(/\r/g,"")).join(`
9
+ `),i=I();if(r.length>0&&(!i.images||!t)){let s=r.map(a=>{let l=a.mimeType??"image/unknown",c=a.data&&a.mimeType?F(a.data,a.mimeType)??void 0:void 0;return H(l,c)}).join(`
10
+ `);o=o?`${o}
11
+ ${s}`:s}return o}var Q=100;function pn(e,t,n,r){let o=n.fg("toolTitle",n.bold(e));if(t==null)return o;let i=typeof t=="object"&&!Array.isArray(t)?Object.entries(t):[["args",t]];if(i.length===0)return o;if(r){let l=i.map(([c,p])=>{let u=typeof p=="string"?p:JSON.stringify(p,null,2)??String(p);return` ${c}: ${_(u).replace(/\r/g,"").split(`
12
+ `).join(`
13
+ `)}`});return`${o}
14
+ ${n.fg("muted",l.join(`
15
+ `))}`}let s=i.map(([l,c])=>`${l}=${JSON.stringify(c)??String(c)}`).join(" "),a=s.length>Q?`${s.slice(0,Q-3)}...`:s;return`${o} ${n.fg("muted",a)}`}function ee(e){let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let n=Math.floor(t),r=Math.floor(n/60),o=n%60;return r<60?`${r}m ${o}s`:`${Math.floor(r/60)}h ${r%60}m ${o}s`}function oe(e){let t=e.state;e.executionStarted&&t.startedAt===void 0&&(t.startedAt=Date.now(),t.endedAt=void 0)}function ie(e,t){let n=e.state;if(n.startedAt!==void 0&&t&&!n.interval&&(n.interval=setInterval(()=>e.invalidate(),1e3)),(!t||e.isError)&&(n.endedAt??=Date.now(),n.interval&&(clearInterval(n.interval),n.interval=void 0)),!t&&e.durationMs!==void 0)return`Took ${ee(e.durationMs)}`;if(n.startedAt===void 0)return;let r=n.endedAt??Date.now();return`${t?"Elapsed":"Took"} ${ee(r-n.startedAt)}`}function He(e){return e.fg("error","[invalid arg]")}function fn(e,t,n,r){if(e===null)return He(t);let o=e||r?.emptyFallback;return o?Ge(t.fg("accent",Fe(o)),o,n):t.fg("toolOutput","...")}function T(e){let t="";for(let n of e){let r=t===""?/^[A-Za-z_$]$/.test(n):/^[A-Za-z0-9_$]$/.test(n);t+=r?n:"_"}return t===""?"_":t}var Je=/^[A-Za-z_$][A-Za-z0-9_$]*$/,E=" ",Xe=16e3,qe=32,ze=["minimum","exclusiveMinimum","maximum","exclusiveMaximum","multipleOf","minLength","maxLength","pattern","format","minItems","maxItems"],se=new Set(["minimum","exclusiveMinimum","minLength","minItems"]),Ze=new Set(["maximum","exclusiveMaximum","maxLength","maxItems"]),Ye=80,ce=/[\r\n\u2028\u2029]/g;function Ve(e,t={}){let n=e.inputSchema===void 0?"unknown":pe(e.inputSchema,{maxChars:t.inputMaxChars??Xe});return`${T(e.name)}(args: ${n}): Promise<${j(e.outputSchema)}>;`}function le(e,t={}){let n=`declare const tools: { ${Ve(e,t)} };`;return`${e.description?.trim()??""}
16
+
17
+ codemode tool declaration:
18
+ \`\`\`ts
19
+ ${n}
20
+ \`\`\``}function j(e){return e===void 0?"unknown":pe(e)}function Ke(e){return Je.test(e)?e:JSON.stringify(e)}function D(e){let t=[...new Set(e)];return t.includes("unknown")?"unknown":t.length===0?"never":t.join(" | ")}function pe(e,t={}){let n=i=>$(e,{root:e,resolving:new Set,expansions:0,tags:i}),r=n(!0);if(t.maxChars===void 0||r.length<=t.maxChars)return r;let o=n(!1);return o.length<=t.maxChars?o:"unknown"}function Qe(e,t){if(e!=="#"&&!e.startsWith("#/"))return;let n=t;for(let r of e.slice(2).split("/").filter(Boolean)){let o=decodeURIComponent(r).replaceAll("~1","/").replaceAll("~0","~");if(typeof n!="object"||n===null||Array.isArray(n)||!(o in n))return;n=n[o]}return typeof n=="boolean"||typeof n=="object"&&n!==null&&!Array.isArray(n)?n:void 0}function $(e,t){if(e===!0)return"unknown";if(e===!1)return"never";if(typeof e!="object"||e===null||Array.isArray(e))return"unknown";if(typeof e.$ref=="string"){let o=e.$ref;if(t.resolving.has(o)||t.expansions>=qe)return"unknown";let i=Qe(o,t.root);if(i===void 0)return"unknown";t.expansions++,t.resolving.add(o);try{return $(i,t)}finally{t.resolving.delete(o)}}if("const"in e)return JSON.stringify(e.const)??"unknown";if(Array.isArray(e.enum))return D(e.enum.map(o=>JSON.stringify(o)??"unknown"));let n=Array.isArray(e.anyOf)?e.anyOf:Array.isArray(e.oneOf)?e.oneOf:void 0;if(n)return D(n.map(o=>$(o,t)));if(Array.isArray(e.allOf)){let o=e.allOf.map(i=>$(i,t)).filter(i=>i!=="unknown");return o.length===0?"unknown":o.map(i=>i.includes(" | ")?`(${i})`:i).join(" & ")}let r=e.type;if(Array.isArray(r))return D(r.map(o=>$({...e,type:o},t)));switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":return ae(e,t);case"object":return ue(e,t);case void 0:return"properties"in e||"additionalProperties"in e||"required"in e?ue(e,t):"items"in e||"prefixItems"in e?ae(e,t):"unknown";default:return"unknown"}}function ae(e,t){if(e.items!==void 0&&!Array.isArray(e.items))return`Array<${$(e.items,t)}>`;let n=Array.isArray(e.prefixItems)?e.prefixItems:Array.isArray(e.items)?e.items:[];return n.length>0?`[${n.map(r=>$(r,t)).join(", ")}]`:"unknown[]"}function et(e){let t=e?.description;return typeof t=="string"?t.trim():""}function tt(e){if(typeof e!="object"||e===null||Array.isArray(e))return"";let t=e,n=Array.isArray(t.anyOf)?t.anyOf:t.oneOf,r=Array.isArray(n)?n.filter(c=>c?.type!=="null"):[],o=r.length===1?r[0]:void 0,s=(typeof o=="object"&&o!==null&&!Array.isArray(o)?[t,o]:[t]).map(c=>({...c,...c.exclusiveMinimum===!0?{minimum:void 0,exclusiveMinimum:c.minimum}:{},...c.exclusiveMaximum===!0?{maximum:void 0,exclusiveMaximum:c.maximum}:{}})),a=[],l=c=>c==="integer"||Array.isArray(c)&&c.includes("integer");s.some(c=>l(c.type))&&a.push("@integer");for(let c of ze){let p=s.map(u=>u[c]);if(se.has(c)||Ze.has(c)){let u=p.filter(f=>typeof f=="number");if(u.length===0)continue;a.push(`@${c} ${se.has(c)?Math.max(...u):Math.min(...u)}`);continue}for(let u of new Set(p))(typeof u=="number"||typeof u=="string")&&a.push(`@${c} ${u}`)}return s.some(c=>c.uniqueItems===!0)&&a.push("@uniqueItems"),t.default!==void 0&&t.default!==null&&a.push(`@default ${JSON.stringify(t.default)}`),t.deprecated===!0&&a.push("@deprecated"),a.filter(c=>c.length<=Ye).map(c=>c.replace(ce,p=>`\\u${p.charCodeAt(0).toString(16).padStart(4,"0")}`)).join(" ")}function ue(e,t){let n=typeof e.properties=="object"&&e.properties!==null&&!Array.isArray(e.properties)?e.properties:{},r=new Set(Array.isArray(e.required)?e.required:[]),o=Object.keys(n).sort(),i=o.map(c=>{let p=r.has(c)?"":"?";return`${Ke(c)}${p}: ${$(n[c],t)};`}),s=e.additionalProperties;if(s!==void 0&&s!==!1){let c=s===!0?"unknown":$(s,t);i.push(`[key: string]: ${c};`)}else s===void 0&&o.length===0&&i.push("[key: string]: unknown;");if(i.length===0)return"{}";let a=o.map(c=>{let p=et(n[c]).split(ce).map(f=>f.trim()).filter(Boolean),u=t.tags?tt(n[c]):"";return u?[...p,u]:p});if(!a.some(c=>c.length>0))return`{ ${i.join(" ")} }`;let l=["{"];a.forEach((c,p)=>{for(let u of c)l.push(`${E}// ${u}`);l.push(`${E}${i[p].replaceAll(`
21
+ `,`
22
+ ${E}`)}`)});for(let c of i.slice(o.length))l.push(`${E}${c}`);return l.push("}"),l.join(`
23
+ `)}var O="// @options:",nt=["max_output_tokens","timeout_ms"],b="`max_output_tokens` and `timeout_ms`";var de=String.raw`
24
+ start: options_source | plain_source
25
+ options_source: OPTIONS_LINE NEWLINE SOURCE
26
+ plain_source: SOURCE
27
+
28
+ OPTIONS_LINE: /[ \t]*\/\/ @options:[^\r\n]*/
29
+ NEWLINE: /\r?\n/
30
+ SOURCE: /[\s\S]+/
31
+ `,g=class extends Error{constructor(t){super(t),this.name="CodemodeSourceError"}};function fe(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function rt(e){if(e==="")throw new g(`@options must be a JSON object with supported fields ${b}`);let t;try{t=JSON.parse(e)}catch(s){throw new g(`@options must be valid JSON with supported fields ${b}: ${s instanceof Error?s.message:String(s)}`)}if(typeof t!="object"||t===null||Array.isArray(t))throw new g(`@options must be a JSON object with supported fields ${b}`);let n=t;for(let s of Object.keys(n))if(!nt.includes(s))throw new g(`@options only supports ${b}; got \`${s}\``);let r={},{max_output_tokens:o,timeout_ms:i}=n;if(o!==void 0){if(!fe(o))throw new g("@options field `max_output_tokens` must be a non-negative safe integer");r.maxOutputTokens=o}if(i!==void 0){if(!fe(i)||i===0||i>2147483647)throw new g("@options field `timeout_ms` must be a positive integer up to 2147483647");r.timeoutMs=i}return r}function yn(e){if(e.trim()==="")throw new g('Expected JavaScript source text (non-empty). Provide JS only, optionally with a first line `// @options: {"max_output_tokens": 1000}`.');let t=e.split(`
32
+ `),n=t.findIndex((a,l)=>l>0&&a.trimStart().startsWith(O));if(n!==-1)throw new g(`The ${O} line must be the first line of the input; found one on line ${n+1}`);let r=e.indexOf(`
33
+ `),i=t[0].replace(/\r$/,"").trimStart();if(!i.startsWith(O))return{code:e,options:{}};let s=r===-1?"":e.slice(r);if(s.trim()==="")throw new g("The @options line must be followed by JavaScript source on subsequent lines");return{code:s,options:rt(i.slice(O.length).trim())}}var C="tool_search",he=8,ot=new Set(["a","an","and","are","as","at","be","by","for","from","in","is","it","of","on","or","that","the","this","to","with"]);function it(e){return e.length>4&&e.endsWith("ies")?`${e.slice(0,-3)}y`:e.length>4&&/(ches|shes|sses|xes|zes)$/.test(e)?e.slice(0,-2):e.length>3&&e.endsWith("s")&&!e.endsWith("ss")?e.slice(0,-1):e}function me(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(t=>t.length>0&&!ot.has(t)).map(it)}function ge(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function L(e,t){if(ge(e)){if(typeof e.description=="string"&&t.push(e.description),ge(e.properties))for(let[n,r]of Object.entries(e.properties))t.push(n),L(r,t);L(e.items,t);for(let n of["anyOf","oneOf","allOf"]){let r=e[n];if(Array.isArray(r))for(let o of r)L(o,t)}}}function st(e,t){let n=[e.name,e.name.replaceAll("_"," "),e.description];return L(e.parameters,n),t&&n.push(t.name,t.description??"",t.instructions??""),{name:e.name,text:n.filter(r=>r.trim()).join(" ")}}var v=class{k1;b;constructor(t={}){this.k1=t.k1??1.2,this.b=t.b??.75}rank(t,n,r){let o=[...new Set(me(t))];if(o.length===0||n.length===0||r<=0)return[];let i=n.map(p=>{let u=new Map;for(let f of me(p.text))u.set(f,(u.get(f)??0)+1);return u}),s=i.map(p=>[...p.values()].reduce((u,f)=>u+f,0)),a=s.reduce((p,u)=>p+u,0)/n.length||1,l=new Map(o.map(p=>{let u=i.filter(f=>f.has(p)).length;return[p,Math.log(1+(n.length-u+.5)/(u+.5))]})),c=[];return n.forEach((p,u)=>{let f=0;for(let d of o){let m=i[u].get(d);if(!m)continue;let y=this.k1*(1-this.b+this.b*s[u]/a);f+=(l.get(d)??0)*(m*(this.k1+1)/(m+y))}f>0&&c.push({name:p.name,score:f})}),c.sort((p,u)=>u.score-p.score).slice(0,r)}},at=x.Object({query:x.String({description:"Search query for deferred tools."}),limit:x.Optional(x.Number({description:`Maximum number of tools to return. Defaults to ${he}.`}))});function ut(e){return e==="codemode"||e==="deferred"}function ct(e,t,n){let r=e.getActiveTools(),o=e.getAllTools().filter(a=>ut(a.exposure)&&!r.includes(a.name)),i=o.map(a=>st(a,a.namespace)),s=new v().rank(t,i,n);return s.length>0&&e.setActiveTools([...r,...s.map(a=>a.name)]),s.map(a=>({name:a.name,description:o.find(l=>l.name===a.name)?.description??""}))}var lt=`# Tool discovery
34
+
35
+ Searches over deferred tool metadata with BM25 and exposes matching tools for the next model call.
36
+
37
+ Some of the tools, such as tools of MCP servers, may not have been provided to you upfront, and you should use this tool (\`${C}\`) to search for the required tools. For MCP tool discovery, always use \`${C}\`.`;function Sn(e={}){return{name:C,label:C,description:lt,promptSnippet:"Search for tools that are not loaded yet and load the matches",parameters:at,exposure:"model-only",reachesTools:()=>"all",async execute(t,{query:n,limit:r}){if(n.trim()==="")throw new Error("query must not be empty");let o=r??he;if(!Number.isInteger(o)||o<=0)throw new Error("limit must be a positive integer");let i=e.tools?ct(e.tools,n,o):[];return{content:[{type:"text",text:i.length===0?"No matching tools found.":`Loaded ${i.length} tool${i.length===1?"":"s"}. They are available from your next call:
38
+ ${i.map(a=>`- ${a.name}: ${a.description.trim().split(/\r?\n/)[0]}`).join(`
39
+ `)}`}],details:{loaded:i.map(a=>a.name)}}}}}import{join as xt}from"node:path";function pt(e,t){return{name:e.name,label:e.label,description:e.description,parameters:e.parameters,outputSchema:e.outputSchema,constrainedSampling:e.constrainedSampling,prepareArguments:e.prepareArguments,executionMode:e.executionMode,execute:(n,r,o,i,s)=>e.execute(n,r,o,i,s??t?.(n,o))}}function An(e){return{name:e.name,label:e.label,description:e.description,parameters:e.parameters,outputSchema:e.outputSchema,constrainedSampling:e.constrainedSampling,prepareArguments:e.prepareArguments,executionMode:e.executionMode,execute:async(t,n,r,o)=>e.execute(t,n,r,o)}}var ye=()=>import("../../vendor/pi/dist/extensions/codemode/execute.js");var ft=10,dt=8,mt=5,$e=80,gt=/^Script (completed|failed)\nWall time [\d.]+ seconds\nOutput:\n$/;function xe(e,t,n){return`${e.fg("muted",`... (${t} more ${n},`)} ${R("app.tools.expand","to expand")}${e.fg("muted",")")}`}function ht(e){return e===void 0?"":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function Se(e){return`$${e>=.01?e.toFixed(2):e.toPrecision(2)}`}function yt(e,t){switch(e.status){case"running":return t.fg("warning","\u2026");case"ok":return t.fg("success","\u2713");case"error":return t.fg("error","\u2717");case"cancelled":return t.fg("muted","\u2298")}}function $t(e,t,n){let r=!n&&e.args.length>$e?`${e.args.slice(0,$e-3)}...`:e.args,o=ht(e.durationMs),i=`${yt(e,t)} ${t.fg("toolTitle",e.name)}`;return r&&(i+=` ${t.fg("muted",r)}`),o&&(i+=` ${t.fg("dim",o)}`),e.cost&&(i+=` ${t.fg("dim",Se(e.cost))}`),n&&e.error&&(i+=`
40
+ ${t.fg("error",e.error.split(`
41
+ `).join(`
42
+ `))}`),i}var Te={renderCall(e,t,n){oe(n);let r=ne(e?.code),o=t.fg("toolTitle",t.bold("codemode")),i=n.lastComponent??new N;if(i.clear(),r===null)return i.addChild(new h(`${o} ${t.fg("error","[invalid arg]")}`,0,0)),i;if(i.addChild(new h(o,0,0)),r){let s=J(_(r.replace(/\r/g,"").trimEnd()),"javascript").join(`
43
+ `);i.addChild(n.expanded?new h(s,0,0):new S({text:s,maxVisualLines:ft,keep:"start",formatHint:a=>xe(t,a,"lines")}))}return i},renderResult(e,t,n,r){let o=ie(r,t.isPartial),i=r.lastComponent??new N;i.clear();let s=e.details?.calls??[];if(s.length>0){let u=t.expanded?s:s.slice(-dt),f=u.map(m=>$t(m,n,t.expanded));u.length<s.length&&f.unshift(`${n.fg("muted",`... (${s.length-u.length} earlier calls,`)} ${R("app.tools.expand","to expand")}${n.fg("muted",")")}`);let d=s.filter(m=>m.cost);if(d.length>1){let m=d.reduce((y,A)=>y+(A.cost??0),0);f.push(n.fg("muted",`Model calls: ${Se(m)}`))}i.addChild(new w(1)),i.addChild(new h(f.join(`
44
+ `),0,0))}let[a,...l]=e.content,c=a?.type==="text"&&gt.test(a.text),p=t.isPartial?"":re({...e,content:c?l:e.content},r.showImages).trim();if(p){let u=r.isError?"error":"toolOutput",f=_(p).split(`
45
+ `).map(d=>n.fg(u,d)).join(`
46
+ `);if(i.addChild(new w(1)),t.expanded)i.addChild(new h(f,0,0));else{i.addChild(new S({text:f,maxVisualLines:mt,keep:"start",formatHint:m=>xe(n,m,"lines")}));let d=e.details?.fullOutputPath;d&&i.addChild(new h(n.fg("muted",`Full output: ${d}`),0,0))}}return o&&(i.addChild(new w(1)),i.addChild(new h(n.fg("muted",o),0,0))),i}};var M="codemode",Un="codemode-store",St={type:"string"},Tt=x.Object({code:x.String({description:"Raw JavaScript source."})}),Ae={snippet:"Run JavaScript that calls other tools",guidelines:["Use codemode to batch independent tool calls (Promise.allSettled), chain them, or filter large output, instead of many separate calls."]},At=xt(U(),"codemode.md"),wt='Run JavaScript that calls other tools. The input is raw JavaScript (not JSON, no code fence), run as an async function body in a QuickJS sandbox: top-level `await` and `return` work. No Node, file system, network, or timers.\n- `await tools.<name>({ ...args })` resolves to a string, or an object if the tool\'s declaration says so, and rejects with an Error on failure. A tool whose declaration returns an object resolves on failure too when it returned that object; check its fields. Calls still running when the script ends are cancelled.\n- Optional first line: `// @options: {"max_output_tokens": 10000, "timeout_ms": 60000}`';function _t(e){let t=["Globals:","- `text(value)`, `image(dataUrlOrImageBlock)`, `console.log(...)`, and top-level `return` add output; `exit()` ends the script. With several text items, each starts with a `==> text N/M <==` line, and `console` lines follow the other output in one `<console_output>` block. `image()` also saves the image to a temp file and the result names its path.","- `store(key, value)` and `load(key)` keep JSON values across codemode calls.","- `ALL_TOOLS`, `await searchTools(query, { limit?, namespace? })`, `await describeTool(name)`, `await describeNamespace(name)`: find unlisted tools, such as MCP tools."];return e&&t.push(`- \`models\`: classifiers and image generation. Read ${At} first.`),t.join(`
47
+ `)}var Et=k.codemode.inlineBudget,Ot=4;function we(e,t=[]){let n=t.flatMap(r=>r.trim()?[`- ${r.trim()}`]:[]);return{name:e.name,description:n.length>0?`${e.description.trim()}
48
+
49
+ ${n.join(`
50
+ `)}`:e.description,inputSchema:e.parameters,outputSchema:e.outputSchema??St}}function _e(e){return e.filter(t=>t.name!==M)}function bt(e){let t=T(e.name);return`${t===e.name?`### \`${t}\``:`### \`${t}\` (\`${e.name}\`)`}
51
+ ${le(e).trim()}`}function Lt(e,t){if(t===void 0)return new Set(e.flatMap(s=>s.entries.map(a=>a.name)));let n=e.map(s=>[...s.entries].sort((a,l)=>a.cost-l.cost)),r=new Set,o=t,i=n.filter(s=>s.length>0);for(;i.length>0;)i=i.filter(s=>{let a=s[0];return a.cost>o?!1:(o-=a.cost,r.add(a.name),s.shift(),s.length>0)});return r}function Ee(e,t={}){let n=_e(e).filter(l=>!t.deferred?.has(l.name)).map(l=>we(l,t.guidelines?.get(l.name))),r=new Map([["",{namespace:void 0,entries:[]}]]);for(let l of n){let c=t.namespaces?.get(l.name),p=c?`ns:${c.name}`:"",u=r.get(p)??{namespace:c,entries:[]};r.set(p,u);let f=bt(l);u.entries.push({name:l.name,section:f,cost:Math.ceil(f.length/Ot)})}let o=[...r.values()].sort((l,c)=>l.namespace===void 0?-1:c.namespace===void 0?1:l.namespace.name.localeCompare(c.namespace.name)),i=Lt(o,t.inlineBudget),s=[wt,_t(t.models===!0)];if(n.length===0)return s.join(`
52
+
53
+ `);let a=["Nested tools:"];for(let{namespace:l,entries:c}of o){let p=c.filter(u=>i.has(u.name));if(l){let u=p.length===c.length?"":p.length===0?" (tools not listed)":" (some tools not listed)",f=l.description?.trim();a.push(`## ${l.name}${u}${f?`
54
+ ${f}`:""}`)}for(let u of p)a.push(u.section)}return s.push(a.join(`
55
+
56
+ `)),s.join(`
57
+
58
+ `)}function Oe(e,t){if(typeof e!="object"||e===null)return;let{type:n,properties:r,required:o}=e;if(n!=="object"||typeof r!="object"||r===null)return;let i=new Set(Array.isArray(o)?o:[]);return`{ ${Object.entries(r).map(([a,l])=>{let c=t>0?Oe(l,t-1):void 0;return`${a}${i.has(a)?"":"?"}${c?`: ${c}`:""}`}).join(", ")} }`}function Ct(e){let t=j(e);return t==="string"?"a string":`\`${Oe(e,1)??t.replace(/\s+/g," ")}\``}function Mt(e){return`${e.description.trim()}
59
+
60
+ Codemode: \`tools.${T(e.name)}(args)\` resolves to ${Ct(we(e).outputSchema)}.`}function kt(e,t){let n=t.getMode?.()??k.codemode.mode,r=u=>e.getExposure(u.name)==="direct",o=_e(e.callable),i=new Set(o.map(u=>u.name)),s={};if(n==="on")for(let u of e.declared)i.has(u.name)&&(s[u.name]=Mt(u));let a=n==="only"?o:o.filter(u=>!r(u)),l=new Map(a.flatMap(u=>{let f=e.getNamespace(u.name);return f?[[u.name,f]]:[]})),c=new Map(a.map(u=>[u.name,e.getPromptGuidelines(u.name)]));s[M]=Ee(a,{models:t.models===!0,namespaces:l,guidelines:c,deferred:new Set(a.filter(u=>e.getExposure(u.name)==="deferred").map(u=>u.name)),inlineBudget:t.getInlineBudget?.()??Et});let p=new Set(e.declared.map(u=>u.name));return{descriptions:s,hiddenDeclarations:n==="only"?o.filter(u=>r(u)&&p.has(u.name)).map(u=>u.name):[]}}var It=/\b(searchTools|describeNamespace|describeTool|ALL_TOOLS)\b/;function Nt(e){return typeof e!="string"?[]:It.test(e)?"all":e.match(/\w+/g)??[]}function Wn(e={}){return{name:M,label:M,description:Ee([],{models:e.models===!0}),promptSnippet:Ae.snippet,promptGuidelines:[...Ae.guidelines],parameters:Tt,exposure:"model-only",prepareLoadout:t=>kt(t,e),reachesTools:t=>Nt(t.code),constrainedSampling:{type:"grammar",variants:{openai_lark:de}},execute:async(t,n,r,o,i)=>(await ye()).executeCodemode(t,n,r,o,i,e),...Te}}export{tn as a,V as b,Pt as c,Ut as d,Ft as e,Gt as f,Ht as g,Jt as h,Xt as i,qt as j,zt as k,Ne as l,Re as m,Yt as n,Vt as o,pt as p,An as q,Be as r,S as s,Fe as t,ne as u,cn as v,_ as w,ln as x,re as y,pn as z,oe as A,ie as B,He as C,fn as D,T as E,le as F,yn as G,C as H,he as I,st as J,v as K,Sn as L,M,Un as N,At as O,we as P,_e as Q,Wn as R};
@@ -0,0 +1,4 @@
1
+ import { createRequire as __cortexCreateRequire } from 'node:module';
2
+ const require = __cortexCreateRequire(import.meta.url);
3
+ const __cortexPackageRoot = new URL("../../", import.meta.url);
4
+ import{c as o}from"./chunk-J5DVLUKY.js";import{readFileSync as t}from"node:fs";import{join as r}from"node:path";var n=r(o,"package.json"),p=JSON.parse(t(n,"utf-8")),a=p.version,c="https://fangxm233.github.io/cortex-agent/";export{a,c as b};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __cortexCreateRequire } from 'node:module';
2
+ const require = __cortexCreateRequire(import.meta.url);
3
+ const __cortexPackageRoot = new URL("../../", import.meta.url);
4
+ import*as u from"node:fs";function d(o,n,r){if(n.commandGroups&&n.commandGroups.length>0){o.push("",r);for(let t of n.commandGroups){o.push(` ${t.heading}:`);for(let a of t.commands)o.push(` ${a.name.padEnd(22)} ${a.description}`)}return}if(!(!n.commands||n.commands.length===0)){o.push("",r);for(let t of n.commands)o.push(` ${t.name.padEnd(22)} ${t.description}`)}}function e(o,n,r){if(!(!n||n.length===0)){o.push("",r);for(let t of n){let a=t.default!=null?` (default: ${t.default})`:"";o.push(` ${t.flag.padEnd(28)} ${t.description}${a}`)}}}function i(o,n,r){if(!(!n||n.length===0)){o.push("",r);for(let t of n)o.push(` # ${t.description}`,` ${t.command}`,"")}}function f(o){let n={usage:"Usage:",commands:"Commands:",options:"Options:",examples:"Examples:",...o.labels},r=[o.description,"",`${n.usage} ${o.usage}`];return d(r,o,n.commands),e(r,o.options,n.options),i(r,o.examples,n.examples),r.join(`
5
+ `).trimEnd()}function m(o,n){let r={validValues:"Valid values:",hint:"Hint:",...n?.labels},t=o;return n?.validValues&&n.validValues.length>0&&(t+=`
6
+ ${r.validValues} ${n.validValues.join(", ")}`),n?.hint&&(t+=`
7
+ ${r.hint} ${n.hint}`),t}function s(){return u.readFileSync(0)}function l(){return s().toString("utf8")}function c(o){let n=new Error(o);return n.cliMessage=o,n}export{f as a,m as b,l as c,c as d};
@@ -0,0 +1,4 @@
1
+ import { createRequire as __cortexCreateRequire } from 'node:module';
2
+ const require = __cortexCreateRequire(import.meta.url);
3
+ const __cortexPackageRoot = new URL("../../", import.meta.url);
4
+ import{c as m}from"./chunk-LMDWRRX4.js";import{e as o}from"./chunk-NAA7GF6Q.js";import{createReadStream as c,promises as u}from"fs";var s=o("feishu-image"),f=10*1024*1024,g=16,l=new Set(["image/png","image/jpeg","image/gif","image/webp","image/bmp"]);async function d(i,a){if(!(a>0)||a>f)return null;let n;try{n=await u.open(i,"r");let e=Buffer.alloc(g),{bytesRead:r}=await n.read(e,0,g,0),t=m(e.subarray(0,r));return t&&l.has(t)?t:null}catch{return null}finally{await n?.close().catch(()=>{})}}async function I(i,a,n){if(!await d(a,n))return null;try{let e=await i.im.v1.image.create({data:{image_type:"message",image:c(a)}});if(e&&typeof e.code=="number"&&e.code!==0)throw new Error(`Feishu API error ${e.code}: ${e.msg??"unknown"}`);let r=e?.data?.image_key??e?.image_key;if(r)return r;s.warn(`image upload returned no image_key for ${a}; sending it as a file`)}catch(e){s.warn(`image upload failed for ${a} (${e.message}); sending it as a file`)}return null}export{I as a};
@@ -0,0 +1,13 @@
1
+ import { createRequire as __cortexCreateRequire } from 'node:module';
2
+ const require = __cortexCreateRequire(import.meta.url);
3
+ const __cortexPackageRoot = new URL("../../", import.meta.url);
4
+ import{a as V}from"./chunk-D6VMBA4C.js";import{c as B,g as Q}from"./chunk-6AKUD3CF.js";import{a as C}from"./chunk-OSEIQ7SS.js";import{d as be}from"./chunk-WHC7AYZD.js";function _(r,e=`
5
+ `){return typeof r=="string"?r:r.filter(t=>t.type==="text").map(t=>t.text).join(e)}function Z(r){let e=[_(r.content)];for(let t of Object.values(r.sections??{}))t!==null&&e.push(t);return e.filter(t=>t.length>0).join(`
6
+
7
+ `)}function Ye(r){let e=[],t=_(r.content);t.length>0&&e.push(t);for(let[n,s]of Object.entries(r.sections??{}))e.push(s===null?`Removed system prompt section "${n}".`:`Updated system prompt section "${n}":
8
+
9
+ ${s}`);return e.join(`
10
+
11
+ `)}function Me(r,e){let t=r!==void 0&&r.length>0,n=e!==void 0&&e.length>0;if(!(!t&&!n))return{role:"system",content:r??"",...n?{toolsAdded:e}:{},timestamp:0}}function U(r){let e=Me(r.systemPrompt,r.tools);return{messages:e?[e,...r.messages]:r.messages}}function T(r){return r.role==="system"}function ee(r){let e=r[0];return e&&T(e)?e:void 0}function Je(r){return ee(r)?r.slice(1):r}function L(r){let e=new Map;for(let t of r)if(T(t)){for(let n of t.toolsRemoved??[])e.delete(n.name);for(let n of t.toolsAdded??[])e.set(n.name,n)}return[...e.values()]}function te(r){let e=[],t=new Map,n;for(let i of r){if(!T(i))continue;n??=i.timestamp;let o=_(i.content);o.length>0&&e.push(o);for(let[c,d]of Object.entries(i.sections??{}))d===null?t.delete(c):t.set(c,d)}let s=L(r);if(!(n===void 0&&s.length===0))return{role:"system",content:e.join(`
12
+
13
+ `),...t.size>0?{sections:Object.fromEntries(t)}:{},...s.length>0?{toolsAdded:s}:{},timestamp:n??0}}function Xe(r){let e=te(r);return e?Z(e):""}function ve(r){let e=te(r.messages),t=r.messages.filter(n=>n.role!=="system");return{messages:e?[e,...t]:t}}function Ve(r,e){return e?r:ve(r)}function N(r){return{name:r.name,description:r.description,parameters:JSON.parse(JSON.stringify(r.parameters)),...r.constrainedSampling===void 0?{}:{constrainedSampling:r.constrainedSampling}}}function j(r,e){return JSON.stringify(N(r))===JSON.stringify(N(e))}function Be(r,e){let t=new Map(r.map(s=>[s.name,s])),n=new Map(e.map(s=>[s.name,s]));return{toolsAdded:e.filter(s=>{let i=t.get(s.name);return i===void 0||!j(i,s)}).map(N),toolsRemoved:r.filter(s=>{let i=n.get(s.name);return i===void 0||!j(s,i)}).map(s=>({name:s.name}))}}function Qe(r){let e=new Map;for(let t of r)if(T(t))for(let n of t.toolsAdded??[])e.set(n.name,n);return[...e.values()]}function Ze(r){let e=new Map;for(let t of r)if(T(t))for(let n of t.toolsAdded??[]){let s=e.get(n.name);if(s!==void 0&&!j(s,n))return!0;e.set(n.name,n)}return!1}function et(r){return re(r.filter(T))>=0}function re(r){let e=new Set,t=-1;for(let n=0;n<r.length;n++){let s=r[n];(s.toolsRemoved?.length??0)>0&&(t=n);for(let i of s.toolsAdded??[])e.has(i.name)&&(t=n),e.add(i.name)}return t}function tt(r,e){let t=r.filter(T);if(e==="none")return{requestTools:L(t),foldedSystemMessages:t.length};if(e==="changes")return{requestTools:[],foldedSystemMessages:0};let n=Math.max(ee(r)?1:0,re(t)+1);return{requestTools:L(t.slice(0,n)),foldedSystemMessages:n}}var He={};be(He,{AI_TELEMETRY_SCHEMA:()=>$,ModelsError:()=>f,calculateCost:()=>Ke,clampThinkingLevel:()=>We,createModels:()=>Ne,createProvider:()=>je,getModelType:()=>S,getSupportedThinkingLevels:()=>ye,hasApi:()=>Ue,isModelType:()=>A,modelsAreEqual:()=>ze});var xe=function(r,e){return typeof r=="string"&&/^\.\.?\//.test(r)?r.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,n,s,i,o){return n?e?".jsx":".js":s&&(!i||!o)?t:s+i+"."+o.toLowerCase()+"js"}):r},ne=r=>import(xe(r));function Ae(){return globalThis.process?.env}function se(){return{async env(r){let e=Ae()?.[r];return typeof e=="string"&&e.trim().length>0?e:void 0},async fileExists(r){try{let e=await ne("node:fs/promises"),t=r;return t.startsWith("~")&&(t=(await ne("node:os")).homedir()+t.slice(1)),await e.access(t),!0}catch{return!1}}}}function ie(r){if(r.reason!==void 0)return r.reason;let e=new Error("The operation was aborted");return e.name="AbortError",e}function v(r){return r??new AbortController().signal}function x(r,e){return e.aborted?(r.catch(()=>{}),Promise.reject(ie(e))):new Promise((t,n)=>{let s=!1,i=()=>e.removeEventListener("abort",o),o=()=>{s||(s=!0,i(),n(ie(e)))};e.addEventListener("abort",o,{once:!0}),r.then(c=>{s||(s=!0,i(),t(c))},c=>{s||(s=!0,i(),n(c))}),e.aborted&&o()})}var I=class{credentials=new Map;chains=new Map;enqueue(e,t,n){let s=v(n?.signal),i=this.chains.get(e)??Promise.resolve(),o=(async()=>(await i.catch(()=>{}),s.throwIfAborted(),t()))(),c=o.catch(()=>{});return this.chains.set(e,c),c.then(()=>{this.chains.get(e)===c&&this.chains.delete(e)}),x(o,s)}async read(e,t){return t?.signal?.throwIfAborted(),this.credentials.get(e)}async list(e){return e?.signal?.throwIfAborted(),[...this.credentials].map(([t,n])=>({providerId:t,type:n.type}))}modify(e,t,n){return this.enqueue(e,async()=>{let s=this.credentials.get(e),i=await t(s);return n?.signal?.throwIfAborted(),i!==void 0&&this.credentials.set(e,i),i??s},n)}delete(e,t){return this.enqueue(e,async()=>{this.credentials.delete(e)},t)}};var f=class extends Error{code;constructor(e,t,n){super(Se(t,n?.cause),n),this.name="ModelsError",this.code=e}};function Se(r,e){if(e==null)return r;let t=V(e).trim();return!t||r.includes(t)?r:`${r}: ${t}`}function W(r,e,t,n){let s=v(n?.signal);return x(Te(r,e,t,n,s),s)}async function Te(r,e,t,n,s){s.throwIfAborted();let i=n?.env?Ce(t,n.env):t;if(n?.apiKey!==void 0&&r.auth.apiKey)return K(i,r.auth.apiKey,r.id,{type:"api_key",key:n.apiKey,env:n.env},s);let o=await Oe(e,r.id,s);if(o){if(o.type==="oauth"&&r.auth.oauth)return Pe(e,r.id,r.auth.oauth,o,s,n?.minOAuthValidityMs);if(o.type==="api_key"&&r.auth.apiKey){let c=n?.env?{...o,env:{...o.env,...n.env}}:o;return K(i,r.auth.apiKey,r.id,c,s)}return}return r.auth.apiKey?K(i,r.auth.apiKey,r.id,void 0,s):void 0}function Ce(r,e){return{env:async t=>e[t]||await r.env(t),fileExists:t=>r.fileExists(t)}}var Ee=300*1e3,ke=15e3;async function z(r,e,t,n,s){let i,o=new AbortController,c=()=>o.abort(s.reason);s.addEventListener("abort",c,{once:!0}),s.aborted&&c();try{i=await r.modify(e,async d=>{if(s.removeEventListener("abort",c),s.throwIfAborted(),d?.type==="oauth"&&n(d))try{return await t.refresh(d,AbortSignal.timeout(ke))}catch(p){throw new f("oauth",`OAuth refresh failed for ${e}`,{cause:p})}},{signal:o.signal})}catch(d){throw d instanceof f?d:(s.throwIfAborted(),new f("auth",`Credential store modify failed for ${e}`,{cause:d}))}finally{s.removeEventListener("abort",c)}return i?.type==="oauth"?i:void 0}async function Pe(r,e,t,n,s,i){let o=Math.max(Ee,i??0),c=p=>Date.now()+o>=p.expires,d=n;if(c(d)){let p=await z(r,e,t,c,s);if(!p)return;if(d=p,i!==void 0&&c(d))throw new f("oauth",`OAuth refresh returned a token that expires too soon for ${e}`)}try{return{auth:await t.toAuth(d),source:"OAuth"}}catch(p){throw new f("oauth",`OAuth auth derivation failed for ${e}`,{cause:p})}}async function K(r,e,t,n,s){try{return await e.resolve({ctx:r,credential:n,signal:s})}catch(i){throw new f("auth",`API key auth failed for provider ${t}`,{cause:i})}}async function Oe(r,e,t){try{return await r.read(e,{signal:t})}catch(n){throw new f("auth",`Credential store read failed for ${e}`,{cause:n})}}var R=class{entries=new Map;async read(e,t){t?.signal?.throwIfAborted();let n=this.entries.get(e);return n?structuredClone(n):void 0}async write(e,t,n){n?.signal?.throwIfAborted(),this.entries.set(e,structuredClone(t))}async delete(e,t){t?.signal?.throwIfAborted(),this.entries.delete(e)}};function H(r,e){let t=new Map;for(let n of e)for(let[s,i]of Object.entries(n.metrics??{}))t.set(s,i);return{counter:n=>r.counter(n,t.get(n)),upDownCounter:n=>r.upDownCounter(n,t.get(n)),histogram:n=>r.histogram(n,t.get(n))}}async function _e(r,e){return e(Y)}var Ie=Object.freeze({add:()=>{}}),Re=Object.freeze({add:()=>{}}),qe=Object.freeze({record:()=>{}}),q=Object.freeze({counter:()=>Ie,upDownCounter:()=>Re,histogram:()=>qe}),oe=Object.freeze({inject:()=>{},extract:()=>E}),Y={metrics:q,propagation:oe,startSpan:_e,addLink:()=>{},addEvent:()=>{},setAttributes:()=>{},setStatus:()=>{}};Object.freeze(Y);var E=Y;function ae(r){return(t,n,s)=>r.startSpan({name:t,attributes:n},i=>s(i,ae(i)))}function ce(r,e){return ae(r)}var k={type:"string",description:"Provider identifier.",required:!0},P={type:"string",description:"Requested model identifier.",required:!0},fe={type:"string",description:"Normalized stop reason.",values:["pending","stop","length","toolUse","error","aborted","deferred"]},de={description:"One logical model request, including authentication and provider setup.",parents:{kind:"any"},startAttributes:{provider:k,api:{type:"string",description:"API identifier.",required:!0},model:P,reasoning:{type:"string",description:"Scalar requested reasoning level.",required:!1}},endAttributes:{stop:fe,"usage.input":{type:"number",description:"Uncached input tokens."},"usage.output":{type:"number",description:"Output tokens."},"usage.cache_read":{type:"number",description:"Cache-read tokens."},"usage.cache_write":{type:"number",description:"Cache-write tokens."},"cost.total":{type:"number",description:"Total request cost in USD."},"response.id":{type:"string",description:"Provider response identifier.",cardinality:"high"}},events:{"pi.ai.first_chunk":{description:"First normalized stream event delivered.",attributes:{}},"pi.ai.block":{description:"A completed content block; content is never recorded.",attributes:{type:{type:"string",description:"Block kind.",values:["text","thinking","tool_call"],required:!0},index:{type:"number",description:"Content block index.",required:!0},chars:{type:"number",description:"UTF-16 character count.",required:!0},tool:{type:"string",description:"Tool name, for tool-call blocks only.",required:!1}}}},status:{default:"ok",errorWhen:"Stop reason is error: provider_error with at most 500 error-message characters. Aborted stays ok."}},$={version:1,spans:{"pi.ai.request":de,"pi.ai.poll":{...de,description:"One deferred-response poll, not the deferred request's lifetime."}},metrics:{"pi.ai.request.duration":{kind:"histogram",description:"Logical request or poll duration.",unit:"ms",attributes:{provider:k,model:P,stop:{...fe,required:!0}}},"pi.ai.first_chunk.duration":{kind:"histogram",description:"Time to the first normalized stream event.",unit:"ms",attributes:{provider:k,model:P}},"pi.ai.tokens":{kind:"counter",description:"Reported model token usage; pending and deferred polls are excluded.",unit:"token",attributes:{provider:k,model:P,kind:{type:"string",description:"Token usage category.",values:["input","output","cache_read","cache_write"],required:!0}}},"pi.ai.cost":{kind:"counter",description:"Reported model cost; pending and deferred polls are excluded.",unit:"USD",attributes:{provider:k,model:P}}}};function $e(r){let e=H(r,[$]);return{requestDuration:e.histogram("pi.ai.request.duration"),firstChunkDuration:e.histogram("pi.ai.first_chunk.duration"),tokens:e.counter("pi.ai.tokens"),cost:e.counter("pi.ai.cost")}}var ue=new WeakMap;function D(r,e,t){let n=performance.now(),s={provider:r.provider,model:r.id},i=e?.telemetry?.metrics??q,o=ue.get(i);o||(o=$e(i),ue.set(i,o));let{requestDuration:c,firstChunkDuration:d,tokens:p,cost:b}=o,m,M,w=!0,y=new Map,a=new Promise(u=>{M=u}),l=u=>(m=u,a),h={...s,api:r.api,...typeof e?.reasoning=="string"?{reasoning:e.reasoning}:{}},g=ce(e?.telemetry??E,[$]);return g(t?"pi.ai.poll":"pi.ai.request",h,l),{onEvent(u){if(w&&(w=!1,m.addEvent("pi.ai.first_chunk"),d.record(performance.now()-n,s,m)),u.type==="toolcall_delta")y.set(u.contentIndex,(y.get(u.contentIndex)??0)+u.delta.length);else if(u.type==="text_end"||u.type==="thinking_end")m.addEvent("pi.ai.block",{type:u.type==="text_end"?"text":"thinking",index:u.contentIndex,chars:u.content.length});else if(u.type==="toolcall_end"){let we=y.get(u.contentIndex)??0;y.delete(u.contentIndex),m.addEvent("pi.ai.block",{type:"tool_call",index:u.contentIndex,chars:we,tool:u.toolCall.name})}},onResult(u){u&&(m.setAttributes({stop:u.stopReason,"usage.input":u.usage.input,"usage.output":u.usage.output,"usage.cache_read":u.usage.cacheRead,"usage.cache_write":u.usage.cacheWrite,"cost.total":u.usage.cost.total,"response.id":u.responseId}),u.stopReason==="error"&&m.setStatus({status:"error",error:{name:"provider_error",message:u.errorMessage?.slice(0,500)??""}}),c.record(performance.now()-n,{...s,stop:u.stopReason},m),(!t||u.stopReason!=="pending"&&u.stopReason!=="deferred")&&(p.add(u.usage.input,{...s,kind:"input"}),p.add(u.usage.output,{...s,kind:"output"}),p.add(u.usage.cacheRead,{...s,kind:"cache_read"}),p.add(u.usage.cacheWrite,{...s,kind:"cache_write"}),b.add(u.usage.cost.total,s))),M()}}}function S(r){return r.type??"chat"}function A(r,e){return S(r)===e}function le(r){if(!A(r,"chat"))throw new f("provider",`Model ${r.provider}/${r.id} is not a chat model`)}function pe(r){if(!A(r,"image"))throw new f("provider",`Model ${r.provider}/${r.id} is not an image model`)}function he(r){if(!A(r,"classifier"))throw new f("provider",`Model ${r.provider}/${r.id} is not a classifier model`)}function me(r,e){if(e.images?.length&&!r.input.includes("image"))throw new f("provider",`Model ${r.provider}/${r.id} does not accept image input`)}function G(r,e,t=!1){return{api:r.api,provider:r.provider,model:r.id,output:[],stopReason:t?"aborted":"error",errorMessage:e instanceof Error?e.message:String(e),timestamp:Date.now()}}function F(r,e,t=!1){return{api:r.api,provider:r.provider,model:r.id,answers:{},stopReason:t?"aborted":"error",errorMessage:e instanceof Error?e.message:String(e),timestamp:Date.now()}}var De={chat:!0,image:!0,classifier:!0};function ge(r){return Object.hasOwn(De,S(r))}function Le(r){return{...r,models:r.models.filter(ge)}}function J(r,e){if(!r&&!e)return;let t={...r};for(let[n,s]of Object.entries(e??{})){let i=n.toLowerCase();for(let o of Object.keys(t))o.toLowerCase()===i&&delete t[o];t[n]=s}return t}var X=class{providers=new Map;credentials;modelsStore;authContext;identity;refreshGenerations=new Map;refreshControllers=new Map;publicationChains=new Map;constructor(e){this.credentials=e?.credentials??new I,this.modelsStore=e?.modelsStore??new R,this.authContext=e?.authContext??se(),this.identity=e?.identity}setProvider(e){this.supersedeProviderRefresh(e.id),this.providers.set(e.id,e)}deleteProvider(e){this.supersedeProviderRefresh(e),this.providers.delete(e)}clearProviders(){for(let e of new Set([...this.providers.keys(),...this.refreshControllers.keys()]))this.supersedeProviderRefresh(e);this.providers.clear()}getProviders(){return Array.from(this.providers.values())}getProvider(e){return this.providers.get(e)}getModels(e){if(e!==void 0){let n=this.providers.get(e);if(!n)return[];try{return n.getModels()}catch{return[]}}let t=[];for(let n of this.providers.values())try{t.push(...n.getModels())}catch{}return t}getAllModels(e){if(e!==void 0){let n=this.providers.get(e);if(!n)return[];try{return n.getAllModels?.()??n.getModels()}catch{return[]}}let t=[];for(let n of this.providers.values())try{t.push(...n.getAllModels?.()??n.getModels())}catch{}return t}getModelsOfType(e,t){return this.getAllModels(t).filter(n=>A(n,e))}getModel(e,t){return this.getModels(e).find(n=>n.id===t)}getModelOfType(e,t,n){return this.getModelsOfType(e,t).find(s=>s.id===n)}supersedeProviderRefresh(e){let t=(this.refreshGenerations.get(e)??0)+1;this.refreshGenerations.set(e,t);let n=this.refreshControllers.get(e);return n&&(this.refreshControllers.delete(e),n.abort()),t}beginProviderRefresh(e){let t=this.supersedeProviderRefresh(e),n=new AbortController;return this.refreshControllers.set(e,n),{generation:t,controller:n}}publishProviderModels(e,t,n,s){let i=this.publicationChains.get(e)??Promise.resolve(),o=(async()=>(await i.catch(()=>{}),n.aborted||this.refreshGenerations.get(e)!==t||(s.persist===null?await this.modelsStore.delete(e,{signal:n}):s.persist!==void 0&&await this.modelsStore.write(e,structuredClone(s.persist),{signal:n}),n.aborted||this.refreshGenerations.get(e)!==t)?!1:(s.update?.(),!0)))(),c=o.catch(()=>{});return this.publicationChains.set(e,c),c.then(()=>{this.publicationChains.get(e)===c&&this.publicationChains.delete(e)}),x(o,n)}async runProviderRefreshPhase(e,t,n,s,i,o){let c=await this.modelsStore.read(e.id,{signal:o});await e.refreshModels({credential:t,stored:c?Le(structuredClone(c)):void 0,publish:d=>this.publishProviderModels(e.id,i,o,d),allowNetwork:n,force:n?s:void 0,signal:o,baseUrl:e.baseUrl})}async refresh(e={}){let t=e.allowNetwork??!0,n=v(e.signal),s=new Map;if(n.aborted)return{aborted:!0,errors:s};let i=e.providers?new Set(e.providers):void 0,o=Array.from(this.providers.values()).filter(d=>d.refreshModels!==void 0&&(!i||i.has(d.id))),c=Promise.all(o.map(async d=>{let{generation:p,controller:b}=this.beginProviderRefresh(d.id),m=AbortSignal.any([n,b.signal]),M=(async()=>{let w,y;try{w=await this.readCredential(d.id,m)}catch(l){y=l}if(await this.runProviderRefreshPhase(d,w,!1,void 0,p,m),y!==void 0)throw y;if(!t||m.aborted)return;let a=await this.resolveRefreshCredential(d,w,m);a&&await this.runProviderRefreshPhase(d,a,!0,e.force,p,m)})();try{await x(M,m)}catch(w){m.aborted||s.set(d.id,w instanceof Error?w:new f("model_source",`Model refresh failed for ${d.id}`,{cause:w}))}finally{this.refreshControllers.get(d.id)===b&&this.refreshControllers.delete(d.id)}}));try{await x(c,n)}catch(d){if(!n.aborted)throw d}return{aborted:n.aborted,errors:new Map(s)}}async resolveRefreshCredential(e,t,n){if(t?.type==="oauth"){let c=e.auth.oauth;return c?Date.now()<t.expires?t:n.aborted?void 0:z(this.credentials,e.id,c,d=>Date.now()>=d.expires,n):void 0}let s=e.auth.apiKey;if(!s)return;let i=t?.type==="api_key"?t:void 0,o=await s.resolve({ctx:this.authContext,credential:i,signal:n});if(o)return{type:"api_key",key:o.auth.apiKey,env:o.env}}async readCredential(e,t){try{return await this.credentials.read(e,{signal:t})}catch(n){throw new f("auth",`Credential store read failed for ${e}`,{cause:n})}}async checkProviderAuth(e,t,n){if(t?.type==="oauth")return e.auth.oauth?{source:"OAuth",type:"oauth"}:void 0;let s=e.auth.apiKey;if(!s)return;if(s.check)try{return await s.check({ctx:this.authContext,credential:t?.type==="api_key"?t:void 0,signal:n})}catch(o){throw new f("auth",`API key auth check failed for provider ${e.id}`,{cause:o})}let i=await W(e,this.credentials,this.authContext,{signal:n});return i?{source:i.source,type:"api_key"}:void 0}checkAuth(e,t){let n=v(t?.signal),s=(async()=>{n.throwIfAborted();let i=this.providers.get(e);if(i)return this.checkProviderAuth(i,await this.readCredential(e,n),n)})();return x(s,n)}async getAuthenticatedProviders(e,t){t.throwIfAborted();let n=e?[this.providers.get(e)].filter(i=>i!==void 0):this.getProviders();return(await Promise.all(n.map(async i=>{let o=await this.readCredential(i.id,t);return{provider:i,credential:o,auth:await this.checkProviderAuth(i,o,t)}}))).filter(i=>i.auth!==void 0)}getAvailable(e,t){let n=v(t?.signal),s=(async()=>(await this.getAuthenticatedProviders(e,n)).flatMap(({provider:o,credential:c})=>{let d=o.getModels();return o.filterModels?.(d,c)??d}))();return x(s,n)}async getAvailableOfType(e,t,n){return(await this.getAllAvailable(t,n)).filter(s=>A(s,e))}getAllAvailable(e,t){let n=v(t?.signal),s=(async()=>(await this.getAuthenticatedProviders(e,n)).flatMap(({provider:o,credential:c})=>{let d=o.getAllModels?.()??o.getModels();if(o.filterAllModels)return o.filterAllModels(d,c);if(!o.filterModels)return d;let p=new Set(o.filterModels(o.getModels(),c).map(b=>b.id));return d.filter(b=>!A(b,"chat")||p.has(b.id))}))();return x(s,n)}async getAuth(e,t){let n=v(t?.signal),s=typeof e=="string"?e:e.provider,i=this.providers.get(s);if(!i)return;let o=await W(i,this.credentials,this.authContext,{...t,signal:n});return!o||typeof e=="string"||!e.headers?o:{...o,auth:{...o.auth,headers:J(o.auth.headers,e.headers)}}}async login(e,t,n,s){let i=v(n.signal);i.throwIfAborted();let o=this.providers.get(e);if(!o)throw new f("provider",`Unknown provider: ${e}`);let c=t==="oauth"?o.auth.oauth:o.auth.apiKey;if(!c?.login)throw new f("auth",`${o.name} does not support ${t} login`);let d=c.login({...n,signal:i},s),p=await x(d,i),b=!1,m,M=new Promise(y=>{m=y}),w=this.credentials.modify(e,async()=>(b=!0,m?.(),p),{signal:i});w.catch(()=>{});try{await new Promise((y,a)=>{let l=()=>{b||a(i.reason)};i.addEventListener("abort",l,{once:!0}),Promise.race([M,w]).then(()=>{i.removeEventListener("abort",l),y()},h=>{i.removeEventListener("abort",l),a(h)}),i.aborted&&l()}),await w}catch(y){throw i.throwIfAborted(),new f("auth",`Credential store modify failed for ${e}`,{cause:y})}return p}async logout(e,t){let n=v(t?.signal);n.throwIfAborted();try{await this.credentials.delete(e,{signal:n})}catch(s){throw n.throwIfAborted(),new f("auth",`Credential store delete failed for ${e}`,{cause:s})}}requireProvider(e){let t=this.providers.get(e.provider);if(!t)throw new f("provider",`Unknown provider: ${e.provider}`);return t}requireChatProvider(e){return le(e),this.requireProvider(e)}async applyAuth(e,t){this.requireProvider(e);let n=await this.getAuth(e,{apiKey:t?.apiKey,env:t?.env,signal:t?.signal});if(!n)throw new f("auth",`Provider is not configured: ${e.provider}`);let s=n.auth,i=t?.apiKey??s.apiKey,o=s.baseUrl?{...e,baseUrl:s.baseUrl}:e,c=t&&"sessionId"in t&&typeof t.sessionId=="string"?t.sessionId:void 0,d=J(J(Q(o,c),s.headers),t?.headers);t?.transformHeaders&&(d=await t.transformHeaders(d??{}));let p=n.env||t?.env?{...n.env??{},...t?.env??{}}:void 0,b=B(this.identity,t?.identity),{transformHeaders:m,...M}=t??{},w={...M,apiKey:i,headers:d,env:p,...b===void 0?{}:{identity:b}};return{requestModel:o,requestOptions:w}}stream(e,t,n){let s=U(t);return C(e,async()=>{let i=this.requireChatProvider(e),{requestModel:o,requestOptions:c}=await this.applyAuth(e,n);return i.stream(o,s,c)},D(e,n,!1))}async complete(e,t,n){return this.stream(e,t,n).result()}streamSimple(e,t,n){let s=U(t);return C(e,async()=>{let i=this.requireChatProvider(e),{requestModel:o,requestOptions:c}=await this.applyAuth(e,n);return i.streamSimple(o,s,c)},D(e,n,!1))}async completeSimple(e,t,n){return this.streamSimple(e,t,n).result()}streamDeferred(e,t,n){return C(e,async()=>{let s=this.requireChatProvider(e);if(!s.fetchDeferred)throw new f("provider",`Provider ${e.provider} does not support deferred responses`);let{requestModel:i,requestOptions:o}=await this.applyAuth(e,n);return s.fetchDeferred(i,t,o)},D(e,n,!0))}async fetchDeferred(e,t,n){return this.streamDeferred(e,t,n).result()}async cancelDeferred(e,t,n){let s=this.requireChatProvider(e);if(!s.cancelDeferred)throw new f("provider",`Provider ${e.provider} does not support deferred responses`);let{requestModel:i,requestOptions:o}=await this.applyAuth(e,n);await s.cancelDeferred(i,t,o)}async generateImages(e,t,n){try{pe(e);let s=this.requireProvider(e);if(!s.generateImages)throw new f("provider",`Provider ${e.provider} does not support image generation`);let{requestModel:i,requestOptions:o}=await this.applyAuth(e,n);return await s.generateImages(i,t,o)}catch(s){return G(e,s,n?.signal?.aborted)}}async classify(e,t,n){try{he(e),me(e,t);let s=this.requireProvider(e);if(!s.classify)throw new f("provider",`Provider ${e.provider} does not support classification`);let{requestModel:i,requestOptions:o}=await this.applyAuth(e,n);return await s.classify(i,t,o)}catch(s){return F(e,s,n?.signal?.aborted)}}};function Ne(r){return new X(r)}function je(r){let e=r.api&&typeof r.api.stream=="function"?r.api:void 0,t=e||!r.api?void 0:r.api,n=r.images,s=r.classifiers,i=e?[e]:Object.values(t??{}).filter(a=>a!==void 0),o=Object.values(n??{}).filter(a=>a!==void 0),c=Object.values(s??{}).filter(a=>a!==void 0);if(i.length===0&&o.length===0&&c.length===0)throw new Error(`Provider ${r.id}: at least one of "api", "images", or "classifiers" is required.`);let d=r.models,p=[],b=r.fetchModels,m=()=>{let a=[...d];for(let l of p){let h=a.findIndex(g=>S(g)===S(l)&&g.id===l.id);h>=0?a[h]=l:a.push(l)}return a},M=a=>e??t?.[a.api],w=(a,l)=>{let h=M(a);return h?l(h):C(a,async()=>{throw new f("stream",`Provider ${r.id} has no API implementation for "${a.api}"`)})},y={id:r.id,name:r.name??r.id,baseUrl:r.baseUrl,headers:r.headers,auth:r.auth,getModels:()=>m().filter(a=>A(a,"chat")),getAllModels:m,refreshModels:b?async a=>{if(a.stored){let g=a.stored.models.filter(u=>u.provider===r.id).map(u=>u);if(!await a.publish({update:()=>{p=g}}))return}if(!a.allowNetwork||a.signal.aborted)return;let l=await b(a);if(a.signal.aborted)return;let h=l.filter(ge);await a.publish({persist:{models:h,checkedAt:Date.now()},update:()=>{p=h}})}:void 0,filterModels:r.filterModels,filterAllModels:r.filterAllModels,stream:(a,l,h)=>w(a,g=>g.stream(a,l,h)),streamSimple:(a,l,h)=>w(a,g=>g.streamSimple(a,l,h))};return i.some(a=>a.fetchDeferred!==void 0)&&(y.fetchDeferred=(a,l,h)=>C(a,async()=>{let g=M(a);if(!g?.fetchDeferred)throw new f("provider",`Provider ${r.id} does not support deferred responses for "${a.api}"`);return g.fetchDeferred(a,l,h)})),i.some(a=>a.cancelDeferred!==void 0)&&(y.cancelDeferred=async(a,l,h)=>{let g=M(a);if(!g?.cancelDeferred)throw new f("provider",`Provider ${r.id} cannot cancel deferred responses for "${a.api}"`);await g.cancelDeferred(a,l,h)}),n&&o.length>0&&(y.generateImages=async(a,l,h)=>{let g=n[a.api];return g?g.generateImages(a,l,h):G(a,new f("provider",`Provider ${r.id} has no image generation implementation for "${a.api}"`))}),s&&c.length>0&&(y.classify=async(a,l,h)=>{let g=s[a.api];return g?g.classify(a,l,h):F(a,new f("provider",`Provider ${r.id} has no classifier implementation for "${a.api}"`))}),y}function Ue(r,e){return A(r,"chat")&&r.api===e}function Ke(r,e){let t=e.input+e.cacheRead+e.cacheWrite,n=r.cost,s=-1;for(let c of r.cost.tiers??[])t>c.inputTokensAbove&&c.inputTokensAbove>s&&(n=c,s=c.inputTokensAbove);let i=e.cacheWrite1h??0,o=e.cacheWrite-i;return e.cost.input=n.input/1e6*e.input,e.cost.output=n.output/1e6*e.output,e.cost.cacheRead=n.cacheRead/1e6*e.cacheRead,e.cost.cacheWrite=(n.cacheWrite*o+n.input*2*i)/1e6,e.cost.total=e.cost.input+e.cost.output+e.cost.cacheRead+e.cost.cacheWrite,e.cost}var O=["off","minimal","low","medium","high","xhigh","max"];function ye(r){return r.reasoning?O.filter(e=>{let t=r.thinkingLevelMap?.[e];return t===null?!1:e==="xhigh"||e==="max"?t!==void 0:!0}):["off"]}function We(r,e){let t=ye(r);if(t.includes(e))return e;let n=O.indexOf(e);if(n===-1)return t[0]??"off";for(let s=n;s<O.length;s++){let i=O[s];if(t.includes(i))return i}for(let s=n-1;s>=0;s--){let i=O[s];if(t.includes(i))return i}return t[0]??"off"}function ze(r,e){return!r||!e?!1:S(r)===S(e)&&r.id===e.id&&r.provider===e.provider}export{se as a,I as b,f as c,R as d,$ as e,S as f,A as g,le as h,pe as i,he as j,me as k,G as l,F as m,_ as n,Z as o,Ye as p,Me as q,U as r,ee as s,Je as t,L as u,te as v,Xe as w,ve as x,Ve as y,N as z,j as A,Be as B,Qe as C,Ze as D,et as E,tt as F,Ne as G,je as H,Ue as I,Ke as J,ye as K,We as L,ze as M,He as N};
@@ -0,0 +1,9 @@
1
+ import { createRequire as __cortexCreateRequire } from 'node:module';
2
+ const require = __cortexCreateRequire(import.meta.url);
3
+ const __cortexPackageRoot = new URL("../../", import.meta.url);
4
+ import{a as t}from"./chunk-PMG4YGDU.js";import{e}from"./chunk-E7ZMYIY6.js";function r(){return["Initialize Cortex data directory","","Usage: cortex init [--home <path>] [--gateway-config-dir <path>] [--force] [--answers <file>] [--json]","","Creates the CORTEX_HOME directory structure and asks for the language, interaction","platform (Slack / Feishu), machine name, usage reporting and system service.","Writes .env, copies default configs and generates mcp-config*.json, machines.json","and agent-state.json. It then detects provider logins, offers to log in, and sets","up gateway routes, the default model and favorites.","","Options:"," --home <path> Set CORTEX_HOME (default: $CORTEX_HOME or ~/.cortex/)"," --gateway-config-dir <path> Gateway config output directory (default: gateway home/.aistatus/)"," --force Overwrite existing configs (.env, budget.json, agent-state.json, etc.)"," --answers <file> Read answers from a JSON file instead of prompting; omitted fields use defaults"," --json Print NDJSON progress events on stdout and send human output to stderr"," --help, -h Show this help","","With --answers or --json, init does not prompt or start provider login; it reports","credential status and can finish before any provider is set up.","","Examples:"," cortex init"," cortex init --home /data/cortex"," cortex init --answers answers.json --json"].join(`
5
+ `)}function s(){return["Auto-detect Claude Code / PI configurations and generate gateway.yaml + models.json","","Usage: cortex setup-gateway [--dry-run] [--output-dir <path>]","","Discovers backend endpoints from local Claude Code and PI configs, then","writes gateway.yaml (with backup) and $CORTEX_HOME/config/models.json.","Gateway settings: CORTEX_GATEWAY_PORT (9880) and CORTEX_GATEWAY_HOME (OS home).","Both read config/.env; gateway.yaml lives in <gateway home>/.aistatus/.","Without flags, this command writes files in place.","","Options:"," --dry-run Print the generated gateway.yaml to stdout without writing anything"," --output-dir <path> Write gateway.yaml and models.json under <path> instead of the defaults"," --help, -h Show this help"].join(`
6
+ `)}function c(){return["Start the Cortex TUI (terminal UI) client","","Usage: cortex tui [options]","","Connects to a running Cortex daemon via WebSocket and opens","a terminal-based chat interface.","","Options:"," --resume Open the resume-session picker on connect"," --project <id> Start a fresh session in the named project"," --port <n> Override TUI port (default: 3003, or CORTEX_TUI_PORT)"," --help, -h Show this help"].join(`
7
+ `)}function d(){return t({name:"cortex ui",description:"Manage the Web UI endpoint used by the Cortex apps and browsers",usage:"cortex ui <enable|pair> [--port <port>] [--home <path>] [--json]",commands:[{name:"enable",description:"Turn on the loopback Web UI endpoint and print how to reach it"},{name:"pair",description:"Print a one-time pairing code (10 minutes) for a new app or browser"}],options:[{flag:"--port <port>",description:"enable: TCP port to serve the Web UI on",default:"the configured CORTEX_UI_PORT, else 3004"},{flag:"--home <path>",description:"CORTEX_HOME to use",default:"$CORTEX_HOME or ~/.cortex"},{flag:"--json",description:"Print the result as JSON (enable: endpoint, token, change state; pair: code, expiry)"},{flag:"--help, -h",description:"Show this help"}],examples:[{description:"Enable the endpoint, keeping the configured port",command:"cortex ui enable"},{description:"Serve on another port",command:"cortex ui enable --port 4000"},{description:"Machine-readable output for the desktop setup flow",command:"cortex ui enable --json"},{description:"Get a code to connect a phone or another computer",command:"cortex ui pair"}]})}function m(){return t({name:"cortex path",description:"Make this install's commands (cortex, cortex-signal, \u2026) available in new terminals",usage:"cortex path <install|remove|status> [--home <path>] [--dry-run] [--json]",commands:[{name:"install",description:"Write launchers that use this install's Node into <home>/runtime/bin and put that directory on PATH (shell profiles on Linux/macOS, the user Path on Windows)"},{name:"remove",description:"Delete the launchers and undo the PATH change"},{name:"status",description:"Show whether the launchers exist, are current, and are on PATH"}],options:[{flag:"--home <path>",description:"CORTEX_HOME the launchers belong to",default:"$CORTEX_HOME or ~/.cortex"},{flag:"--dry-run",description:"Report what install or remove would change and change nothing"},{flag:"--json",description:"Print the result as JSON"},{flag:"--help, -h",description:"Show this help"}],examples:[{description:"Add cortex to new terminals",command:"cortex path install"},{description:"Preview the change",command:"cortex path install --dry-run --json"},{description:"Check the current state",command:"cortex path status"},{description:"Undo it",command:"cortex path remove"}]})}function p(){return t({name:"cortex client",description:"Manage the cortex-client installs on remote machines",usage:"cortex client remove --device <name> [--keep-remote] [--dry-run] [--home <path>]",commands:[{name:"remove",description:"Unregister a machine from machines.json, stop and uninstall its client over SSH, and drop its runtime state"}],options:[{flag:"--device <name>",description:"Machine name as registered in machines.json (required)"},{flag:"--keep-remote",description:"Only unregister locally; leave the remote process and files alone"},{flag:"--dry-run",description:"Print what would be removed as JSON and change nothing"},{flag:"--home <path>",description:"CORTEX_HOME of the server",default:"$CORTEX_HOME or ~/.cortex"},{flag:"--help, -h",description:"Show this help"}],examples:[{description:"Preview the removal",command:"cortex client remove --device trainer --dry-run"},{description:"Remove a machine and uninstall its client",command:"cortex client remove --device trainer"},{description:"Unregister a machine that no longer exists",command:"cortex client remove --device trainer --keep-remote"}]})}function l(){return t({name:"cortex memory",description:`Project memory under $CORTEX_HOME/context/projects (experiments/, knowledge/, patterns/).
8
+ regen rewrites only the generated index.md files; the EXP/K/PAT files are never modified. Output is JSON.`,usage:"cortex memory <command> [--project <name>]... [options]",commands:[{name:"regen",description:"Rebuild experiments/knowledge/patterns index.md from frontmatter and the access log"},{name:"consolidate",description:"Report contradictions, stale entries, anti-pattern signals and consolidation candidates"}],options:[{flag:"--project <name>",description:"Limit to one project; repeat for several",default:"every project with memory directories"},{flag:"--text",description:"consolidate: print a human-readable summary instead of JSON"},{flag:"--help, -h",description:"Show this help"}],examples:[{description:"Rebuild every index",command:"cortex memory regen"},{description:"Rebuild one project's indexes",command:"cortex memory regen --project wm-align"},{description:"Lifecycle report for all projects",command:"cortex memory consolidate --text"},{description:"Lifecycle report as JSON for one project",command:"cortex memory consolidate --project wm-align"}]})}function h(){return t({name:"cortex schedule",description:`Manage scheduled tasks. Each fire opens a new session in the schedule's project and sends it the message.
9
+ Changes land in schedules.json; a running daemon picks them up within a second. Output is JSON.`,usage:"cortex schedule <command> [<id>] [options]",commands:[{name:"list",description:"List schedules (--project to filter)"},{name:"get <id>",description:"Show one schedule"},{name:"add --type <type>",description:"Create a schedule"},{name:"edit <id>",description:"Change message, project, model, thinking, pre-check or timing (the type is fixed)"},{name:"pause <id>",description:"Pause a recurring schedule"},{name:"resume <id>",description:"Resume a paused schedule"},{name:"remove <id>",description:"Delete a schedule (--dry-run to preview)"}],options:[{flag:"--type <type>",description:"add: interval | daily | weekly | once"},{flag:"--interval <duration>",description:"interval: repeat period, e.g. 30m, 2h, 1d"},{flag:"--time <HH:MM>",description:"daily/weekly: time of day, 24-hour, server local time"},{flag:"--day <day>",description:"weekly: sun..sat or 0-6"},{flag:"--delay <duration>",description:"once: fire this long from now, e.g. 90m, 2h"},{flag:"--message <text|->",description:'Prompt for the fired session; "-" reads stdin'},{flag:"--project <id>",description:"Project the fired session belongs to",default:"general"},{flag:"--model [provider/]model",description:"Model to run",default:"the default model"},{flag:"--thinking <level>",description:"Thinking level for the selected model"},{flag:"--pre-check <cmd>",description:"Shell gate run before each fire; non-zero exit skips it"},{flag:"--idempotency-key <key>",description:"add: return the schedule already created with this key"},{flag:"--dry-run",description:"remove: show what would be removed"},{flag:"--help, -h",description:"Show this help"}],examples:[{description:"Every 30 minutes in a project",command:'cortex schedule add --type interval --interval 30m --project nimbus --message "Check GPU usage on lab2 and report a one-line summary"'},{description:"Every day at 09:00",command:`cortex schedule add --type daily --time 09:00 --message "Summarize yesterday's sessions"`},{description:"Every Monday at 21:00",command:'cortex schedule add --type weekly --day mon --time 21:00 --message "Weekly review"'},{description:"Once, two hours from now, prompt from stdin",command:'echo "Check training run r42 on lab2" | cortex schedule add --type once --delay 2h --message -'},{description:"List one project's schedules",command:"cortex schedule list --project nimbus"},{description:"Move a daily schedule to 10:30",command:"cortex schedule edit a1b2c3d4 --time 10:30"},{description:"Preview a removal",command:"cortex schedule remove a1b2c3d4 --dry-run"}]})}function n(){return[{name:"init",description:"Initialize CORTEX_HOME directory with configs and API keys"},{name:"start",description:"Start the Cortex server (node dist/entry/app.js)"},{name:"daemon",description:"Start daemon mode with file watching and auto-restart"},{name:"daemon stop",description:"Stop the running daemon (SIGTERM) and the local client it launched"},{name:"daemon status",description:"Check daemon + child status (PID, uptime)"},{name:"daemon restart",description:"Graceful restart \u2014 signal daemon to drain and respawn app.js"},{name:"daemon restart --hard",description:"Hard restart \u2014 send SIGTERM directly to app.js (daemon auto-recovers)"},{name:"daemon restart --force",description:"Force restart \u2014 send SIGKILL immediately to app.js"},{name:"daemon restart-self",description:"Stop and restart the daemon process itself"},{name:"restart",description:"Legacy alias for daemon restart (touches $STORE_DIR/.restart)"},{name:"install latest",description:"Install the latest version of Cortex from npm"},{name:"config",description:"Show resolved paths and initialization status"},{name:"doctor",description:"Health-check the install (runtime, login, platform, gateway); --fix to repair"},{name:"auth status",description:e("cmd.auth.cli.statusDescription")},{name:"feishu",description:"Manage Feishu user-identity login (login / status / logout)"},{name:"setup-gateway",description:"Auto-detect Claude/PI configs and generate gateway.yaml + models.json"},{name:"ui enable",description:"Enable the local Web UI endpoint the desktop app connects to"},{name:"client remove",description:"Unregister a remote machine and uninstall its cortex-client"},{name:"path install",description:"Make cortex available in new terminals (remove / status to undo or check)"},{name:"schedule",description:"List, add, edit, pause, resume and remove scheduled tasks"},{name:"memory",description:"Rebuild project memory indexes; report knowledge lifecycle findings"},{name:"tui",description:"Start the Terminal UI (TUI) client for local interaction"}]}function o(){return[{description:"Interactive init",command:"cortex init"},{description:"Init to custom directory",command:"cortex init --home /tmp/my-cortex"},{description:"Show resolved paths",command:"cortex config"},{description:"Health-check the install",command:"cortex doctor"},{description:e("cmd.auth.cli.exampleSummary"),command:"cortex auth status"},{description:e("cmd.auth.cli.exampleJson"),command:"cortex auth status --json"},{description:"Diagnose and auto-repair",command:"cortex doctor --fix"},{description:"Re-generate gateway config",command:"cortex setup-gateway"},{description:"Enable the local Web UI endpoint",command:"cortex ui enable"},{description:"Remove a remote machine and its client",command:"cortex client remove --device trainer"},{description:"Add cortex to new terminals",command:"cortex path install"},{description:"List scheduled tasks",command:"cortex schedule list"},{description:"Rebuild every project memory index",command:"cortex memory regen"},{description:"Start the server",command:"cortex start"},{description:"Stop the daemon",command:"cortex daemon stop"},{description:"Check daemon status",command:"cortex daemon status"},{description:"Graceful restart",command:"cortex daemon restart"},{description:"Hard restart app.js",command:"cortex daemon restart --hard"},{description:"Restart daemon itself",command:"cortex daemon restart-self"}]}function u(){return t({name:"cortex",description:"Cortex CLI \u2014 server management and initialization",usage:"cortex <command> [options]",commands:n(),options:[{flag:"--help, -h",description:"Show this help"}],examples:o()})}function g(){return t({name:"cortex auth",description:e("cmd.auth.cli.description"),usage:"cortex auth <status|login|provider> [options]",commands:[{name:"status",description:e("cmd.auth.cli.statusDescription")},{name:"login",description:e("init.auth.loginDescription")},{name:"provider",description:e("provider.cli.description")}],options:[{flag:"--json",description:e("cmd.auth.cli.jsonDescription")},{flag:"--help, -h",description:e("cmd.auth.cli.helpDescription")}],examples:[{description:e("cmd.auth.cli.exampleSummary"),command:"cortex auth status"},{description:e("cmd.auth.cli.exampleJson"),command:"cortex auth status --json"},{description:e("provider.cli.exampleList"),command:"cortex auth provider list"}],labels:{usage:e("cmd.auth.cli.helpUsage"),commands:e("cmd.auth.cli.helpCommands"),options:e("cmd.auth.cli.helpOptions"),examples:e("cmd.auth.cli.helpExamples")}})}export{r as a,s as b,c,d,m as e,p as f,l as g,h,u as i,g as j};
@@ -0,0 +1,4 @@
1
+ import { createRequire as __cortexCreateRequire } from 'node:module';
2
+ const require = __cortexCreateRequire(import.meta.url);
3
+ const __cortexPackageRoot = new URL("../../", import.meta.url);
4
+ var i=class{queue=[];locked=!1;async acquire(){return new Promise(s=>{let e=()=>{this.locked?this.queue.push(e):(this.locked=!0,s(()=>{this.locked=!1;let t=this.queue.shift();t&&t()}))};e()})}async run(s){let e=await this.acquire();try{return await s()}finally{e()}}};export{i as a};