@cortex-agent/server 2026.10.28 → 2026.12.5

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 (401) hide show
  1. package/LICENSE +255 -21
  2. package/README.md +36 -7
  3. package/THIRD_PARTY_NOTICES.txt +1990 -593
  4. package/defaults/hooks/cortex-hook-api.mjs +2 -1
  5. package/defaults/hooks/quota-stop.mjs +37 -0
  6. package/defaults/plugins/cortex-system/skills/client-manage/SKILL.md +23 -15
  7. package/defaults/prompts/clean-workspace.md +5 -0
  8. package/dist/agent-adapter/claude/remote-mcp-proxy.js +1 -1
  9. package/dist/chunks/agent-runner-LVZVKBZX.js +4 -0
  10. package/dist/chunks/anthropic-messages-TT6454AA.js +8 -0
  11. package/dist/chunks/azure-openai-responses-52LR2XZD.js +4 -0
  12. package/dist/chunks/bedrock-converse-stream-EOZGYUNY.js +60 -0
  13. package/dist/chunks/bowser-MLGGLXTZ.js +20 -0
  14. package/dist/chunks/child-runner-SMG2VOU5.js +4 -0
  15. package/dist/chunks/chunk-24DH4IR5.js +4 -0
  16. package/dist/chunks/chunk-25XKBRDT.js +70 -0
  17. package/dist/chunks/chunk-2ABET62E.js +23 -0
  18. package/dist/chunks/chunk-2BVUA256.js +4 -0
  19. package/dist/chunks/{chunk-LEUENXI2.js → chunk-2WFL62UO.js} +1 -1
  20. package/dist/chunks/{chunk-OZGBWAT2.js → chunk-2YTYYG4K.js} +1 -1
  21. package/dist/chunks/chunk-335SSANX.js +4 -0
  22. package/dist/chunks/chunk-377OPTXX.js +17 -0
  23. package/dist/chunks/chunk-3EZNVLBF.js +129 -0
  24. package/dist/chunks/chunk-3O6ZG5HA.js +7 -0
  25. package/dist/chunks/{chunk-6AKUD3CF.js → chunk-3XLHL5YT.js} +1 -1
  26. package/dist/chunks/chunk-4HRI75GU.js +4 -0
  27. package/dist/chunks/chunk-4JBYLRPM.js +57 -0
  28. package/dist/chunks/chunk-4KKV7VKE.js +4 -0
  29. package/dist/chunks/chunk-4KQHDDC5.js +4 -0
  30. package/dist/chunks/chunk-4SWD4JMP.js +33 -0
  31. package/dist/chunks/chunk-52VCLZS5.js +4 -0
  32. package/dist/chunks/chunk-54P7TSY3.js +10 -0
  33. package/dist/chunks/chunk-5DVSAXOI.js +7 -0
  34. package/dist/chunks/chunk-5F3A62YS.js +4 -0
  35. package/dist/chunks/{chunk-XNSSUVT6.js → chunk-5FHETFZM.js} +1 -1
  36. package/dist/chunks/{chunk-A34TDMIC.js → chunk-5LBLRAHS.js} +1 -1
  37. package/dist/chunks/chunk-5UYVNA3W.js +4 -0
  38. package/dist/chunks/chunk-6G3OYMCV.js +21 -0
  39. package/dist/chunks/chunk-7GGPYU5E.js +30 -0
  40. package/dist/chunks/chunk-7TYSMLUV.js +4 -0
  41. package/dist/chunks/chunk-7W7VYUTK.js +5 -0
  42. package/dist/chunks/chunk-AXYAZTTN.js +6 -0
  43. package/dist/chunks/{chunk-BGVHA2D4.js → chunk-B3NB243Z.js} +1 -1
  44. package/dist/chunks/chunk-BKYP6AGM.js +8 -0
  45. package/dist/chunks/chunk-BVEDNESB.js +4 -0
  46. package/dist/chunks/chunk-BWDJS6A4.js +12 -0
  47. package/dist/chunks/chunk-C6YVF7EI.js +4 -0
  48. package/dist/chunks/chunk-CEJIYYVE.js +15 -0
  49. package/dist/chunks/chunk-CI2RHH74.js +50 -0
  50. package/dist/chunks/chunk-CMSOOLJB.js +4 -0
  51. package/dist/chunks/chunk-CSVTYYLP.js +4 -0
  52. package/dist/chunks/chunk-DE5EGVKG.js +6 -0
  53. package/dist/chunks/{chunk-E6BYRULL.js → chunk-DK3RPZOQ.js} +1 -1
  54. package/dist/chunks/{chunk-YPK2CAIZ.js → chunk-DK4UCK7L.js} +1 -1
  55. package/dist/chunks/chunk-DYLBVUAU.js +4 -0
  56. package/dist/chunks/chunk-FDC2GRBK.js +27 -0
  57. package/dist/chunks/chunk-FE7HH5JS.js +18 -0
  58. package/dist/chunks/chunk-FYD57YRO.js +436 -0
  59. package/dist/chunks/chunk-G264APQN.js +5 -0
  60. package/dist/chunks/chunk-G4JYZFEO.js +11 -0
  61. package/dist/chunks/chunk-GFFM56U2.js +4 -0
  62. package/dist/chunks/chunk-GOS3P7KS.js +132 -0
  63. package/dist/chunks/chunk-HVN37UXD.js +4 -0
  64. package/dist/chunks/chunk-IA6IODY3.js +4 -0
  65. package/dist/chunks/{chunk-HU6UIDEJ.js → chunk-IGZWZP7Z.js} +1 -1
  66. package/dist/chunks/{chunk-NR6U3WIZ.js → chunk-IJ7XFQMI.js} +1 -1
  67. package/dist/chunks/chunk-IMMGYDAB.js +6 -0
  68. package/dist/chunks/chunk-IOWBF7UK.js +10 -0
  69. package/dist/chunks/{chunk-HALUQ7ZF.js → chunk-ITGCWQFK.js} +1 -1
  70. package/dist/chunks/chunk-IVZ7QUEG.js +4 -0
  71. package/dist/chunks/{chunk-YAEVYJAR.js → chunk-IWY2HIFK.js} +1 -1
  72. package/dist/chunks/{chunk-KGJZAYQD.js → chunk-J7OBATRN.js} +1 -1
  73. package/dist/chunks/{chunk-QWAQHHRS.js → chunk-JGUEIW2W.js} +1 -1
  74. package/dist/chunks/chunk-JKL3AK5D.js +106 -0
  75. package/dist/chunks/chunk-JZ7U7RUK.js +351 -0
  76. package/dist/chunks/chunk-KJUQCCB5.js +4 -0
  77. package/dist/chunks/chunk-KST6OY76.js +10 -0
  78. package/dist/chunks/chunk-KZSAFVSY.js +129 -0
  79. package/dist/chunks/chunk-LD2ZSH3M.js +903 -0
  80. package/dist/chunks/chunk-LE6QPXN6.js +7 -0
  81. package/dist/chunks/chunk-LEAV3FFG.js +4 -0
  82. package/dist/chunks/chunk-LIIZI3HY.js +5 -0
  83. package/dist/chunks/chunk-LP72AF56.js +45 -0
  84. package/dist/chunks/{chunk-FXDIR3SQ.js → chunk-MJQ2D2OP.js} +1 -1
  85. package/dist/chunks/{chunk-6LZK4DDH.js → chunk-NHHR4DCF.js} +1 -1
  86. package/dist/chunks/chunk-NW4GW47L.js +4 -0
  87. package/dist/chunks/chunk-OALEJ6FG.js +60 -0
  88. package/dist/chunks/chunk-OIV4DIMB.js +4 -0
  89. package/dist/chunks/chunk-OJ37ZWBG.js +4 -0
  90. package/dist/chunks/chunk-OZXMPBUX.js +4 -0
  91. package/dist/chunks/{chunk-3THJYAEF.js → chunk-PG7452XE.js} +1 -1
  92. package/dist/chunks/chunk-PJCUB7YJ.js +4 -0
  93. package/dist/chunks/chunk-PTS3J4DQ.js +6 -0
  94. package/dist/chunks/{chunk-PXS5SHOV.js → chunk-PVVEEBUU.js} +1 -1
  95. package/dist/chunks/chunk-Q7BZLPBU.js +8 -0
  96. package/dist/chunks/{chunk-FOJQXLL2.js → chunk-QC66ZXPP.js} +1 -1
  97. package/dist/chunks/chunk-QXFWIL4C.js +4 -0
  98. package/dist/chunks/{chunk-PFMEUFJ7.js → chunk-R2CCD4OF.js} +1 -1
  99. package/dist/chunks/chunk-R6CGBSTC.js +22 -0
  100. package/dist/chunks/chunk-RG5GP4RB.js +5 -0
  101. package/dist/chunks/{chunk-D3NXKK2L.js → chunk-RW2F2QNP.js} +1 -1
  102. package/dist/chunks/{models-L5VF4I5O-XXNJYQMQ.js → chunk-RWPO3NZ3.js} +1 -1
  103. package/dist/chunks/chunk-SAJD4EKE.js +10 -0
  104. package/dist/chunks/chunk-SDUS2H3E.js +4 -0
  105. package/dist/chunks/chunk-SIHGKM4E.js +4 -0
  106. package/dist/chunks/chunk-SKHFU5DI.js +4 -0
  107. package/dist/chunks/{chunk-STUHNKQS.js → chunk-SM45TH22.js} +1 -1
  108. package/dist/chunks/chunk-T54CZKNJ.js +6 -0
  109. package/dist/chunks/chunk-TKFFQNAP.js +19 -0
  110. package/dist/chunks/chunk-TMV2ZDOI.js +18 -0
  111. package/dist/chunks/chunk-TRXLIL7V.js +4 -0
  112. package/dist/chunks/{chunk-SUFW24P4.js → chunk-UEEW2R4E.js} +1 -1
  113. package/dist/chunks/chunk-UHXPRU6G.js +10 -0
  114. package/dist/chunks/chunk-UPQVWHZ3.js +4 -0
  115. package/dist/chunks/{chunk-JERCOLY3.js → chunk-V35MFAUQ.js} +4 -6
  116. package/dist/chunks/chunk-V7K3KNDM.js +4 -0
  117. package/dist/chunks/chunk-VHX2GHBF.js +4 -0
  118. package/dist/chunks/chunk-VOAKRJ4R.js +4 -0
  119. package/dist/chunks/{chunk-X2GYYRVM.js → chunk-VW7TLY3P.js} +1 -1
  120. package/dist/chunks/chunk-W34AK4SK.js +65 -0
  121. package/dist/chunks/{chunk-REBNWCKI.js → chunk-WU7RNAZD.js} +1 -1
  122. package/dist/chunks/chunk-WZC4TDDM.js +6 -0
  123. package/dist/chunks/chunk-WZYS2HAK.js +4 -0
  124. package/dist/chunks/chunk-X2TKJ7KR.js +11 -0
  125. package/dist/chunks/{chunk-H2FP6DG4.js → chunk-X5ND4H4P.js} +1 -1
  126. package/dist/chunks/{chunk-4U7XXM4W.js → chunk-Y3AOGNDT.js} +1 -1
  127. package/dist/chunks/chunk-Y6DGVTKM.js +6 -0
  128. package/dist/chunks/{chunk-KENCMLRE.js → chunk-YAEHSSR4.js} +1 -1
  129. package/dist/chunks/chunk-YWPBE5LP.js +4 -0
  130. package/dist/chunks/chunk-ZAVX7G2M.js +15 -0
  131. package/dist/chunks/chunk-ZD2M73XA.js +19 -0
  132. package/dist/chunks/chunk-ZD4O6NPV.js +4 -0
  133. package/dist/chunks/chunk-ZNAMETPQ.js +4 -0
  134. package/dist/chunks/chunk-ZY6N5LVQ.js +4 -0
  135. package/dist/chunks/chunk-ZYQ4TDTT.js +81 -0
  136. package/dist/chunks/cli-VB2N7HEK.js +55 -0
  137. package/dist/chunks/cloudflare-workers-ai-system-one-YKU742EC.js +4 -0
  138. package/dist/chunks/context-CI2FKEQE.js +4 -0
  139. package/dist/chunks/cost-CZRRSIUF.js +5 -0
  140. package/dist/chunks/dist-QCNQN6DY.js +4 -0
  141. package/dist/chunks/easter-egg-3d-XR5S2O3T.js +4 -0
  142. package/dist/chunks/{event-streams-3JSFPOTZ.js → event-streams-AVE4MSS6.js} +1 -1
  143. package/dist/chunks/{execution-repo-ZLJTBWFC.js → execution-repo-5TLV2NM4.js} +1 -1
  144. package/dist/chunks/{executions-6ARGR3IO.js → executions-I3UUIGSL.js} +1 -1
  145. package/dist/chunks/file-Y5G56IUT.js +4 -0
  146. package/dist/chunks/github-copilot-BRU2SRRZ.js +4 -0
  147. package/dist/chunks/google-generative-ai-ZF5QEUZV.js +4 -0
  148. package/dist/chunks/google-vertex-4PJZZI3Y.js +4 -0
  149. package/dist/chunks/init-A6GY656J.js +4 -0
  150. package/dist/chunks/{install-cli-4IZCSDFZ.js → install-cli-FALWKQYO.js} +1 -1
  151. package/dist/chunks/{interaction-ask-G5T3H3CG.js → interaction-ask-O5HGF6CH.js} +1 -1
  152. package/dist/chunks/{interaction-plan-E5V42MUP.js → interaction-plan-JTVDN3BC.js} +1 -1
  153. package/dist/chunks/kimi-coding-ZCIBMDZ6.js +4 -0
  154. package/dist/chunks/{llama-cpp-classify-OTXZWCMW.js → llama-cpp-classify-NRUXAIGQ.js} +3 -3
  155. package/dist/chunks/local-client-stop-RS4AHNF4.js +4 -0
  156. package/dist/chunks/{memory-cli-PYOILNN5.js → memory-cli-DIT4DQF3.js} +1 -1
  157. package/dist/chunks/meta-JQH66YU7.js +4 -0
  158. package/dist/chunks/mistral-conversations-CXHOECUV.js +7 -0
  159. package/dist/chunks/model-resolver-GIBPYRKP.js +4 -0
  160. package/dist/chunks/monitor-Z2HKNY5E.js +4 -0
  161. package/dist/chunks/{node-PTK2HCDV.js → node-DAO3SX7O.js} +1 -1
  162. package/dist/chunks/{openai-codex-2REL6UQU.js → openai-codex-JULCKICT.js} +1 -1
  163. package/dist/chunks/openai-codex-responses-U6DGMGDK.js +12 -0
  164. package/dist/chunks/openai-completions-PP4XLLOM.js +9 -0
  165. package/dist/chunks/{openai-decisions-2N6ZRPZC.js → openai-decisions-JU6QQKEM.js} +1 -1
  166. package/dist/chunks/openai-responses-2SG757TL.js +6 -0
  167. package/dist/chunks/openrouter-images-32M7YZWC.js +4 -0
  168. package/dist/chunks/pi-messages-VSINMXN4.js +10 -0
  169. package/dist/chunks/radius-THYKWV4E.js +4 -0
  170. package/dist/chunks/remote-ops-2WBEFQ3E.js +14 -0
  171. package/dist/chunks/runner-5MKMRTIN.js +4 -0
  172. package/dist/chunks/runtime-DST3H5JP.js +4 -0
  173. package/dist/chunks/schedule-cli-V7Y2BBVY.js +4 -0
  174. package/dist/chunks/slack-R7SEJYMY.js +4 -0
  175. package/dist/chunks/start-ui-http-7K5JOLPU.js +43 -0
  176. package/dist/chunks/subagent-Z5IQ4L54.js +4 -0
  177. package/dist/chunks/{time-KEHDQT6K.js → time-P6PE52WL.js} +1 -1
  178. package/dist/chunks/tool-shims-YCXZWTST.js +4 -0
  179. package/dist/chunks/typesafe-system-one-M2DABJSZ.js +4 -0
  180. package/dist/chunks/ui-board-HQIE4RZG.js +5 -0
  181. package/dist/chunks/ui-decision-YBZDS4YW.js +4 -0
  182. package/dist/chunks/{ui-file-GVH53O3X.js → ui-file-SRD4ILBS.js} +1 -1
  183. package/dist/chunks/ui-view-Z25MTZT7.js +4 -0
  184. package/dist/chunks/virtual-modules-H4DXPJZB.js +4 -0
  185. package/dist/chunks/waitpoint-M6JZBSLT.js +5 -0
  186. package/dist/chunks/workers-SQ2R32TK.js +4 -0
  187. package/dist/client-bundle/client.mjs +273 -93
  188. package/dist/client-bundle/manifest.json +2 -2
  189. package/dist/core/pi-sdk.js +1 -1
  190. package/dist/domain/auth/cc-auth-cli.js +1 -1
  191. package/dist/domain/mcp/bundled-server.js +1 -1
  192. package/dist/domain/mcp/feishu/client.js +4 -0
  193. package/dist/entry/app.js +151 -559
  194. package/dist/entry/browser-cli.js +10 -10
  195. package/dist/entry/cli.js +1 -1
  196. package/dist/entry/cortex-cli.js +1 -1
  197. package/dist/entry/daemon.js +4 -4
  198. package/dist/entry/hook-cli.js +2 -2
  199. package/dist/entry/production-app-bootstrap.js +1 -1
  200. package/dist/entry/production-evidence-export-cli.js +1 -1
  201. package/dist/entry/signal-cli.js +2 -2
  202. package/dist/tui/index.js +41 -41
  203. package/package.json +3 -3
  204. package/vendor/pi/CHANGELOG.md +330 -0
  205. package/vendor/pi/dist/codemode-worker.js +2 -0
  206. package/vendor/pi/dist/core/export-html/ansi-to-html.js +57 -20
  207. package/vendor/pi/dist/core/export-html/template.css +9 -0
  208. package/vendor/pi/dist/core/export-html/template.js +166 -46
  209. package/vendor/pi/dist/core/export-html/tool-renderer.js +5 -3
  210. package/vendor/pi/dist/core/extensions/loader.js +1 -1
  211. package/vendor/pi/dist/extensions/codemode/execute.js +15 -13
  212. package/vendor/pi/dist/modes/interactive/theme/theme.js +36 -23
  213. package/vendor/pi/dist/utils/image-resize-worker.js +1 -1
  214. package/vendor/pi/dist/utils/image-resize.js +1 -1
  215. package/vendor/pi/docs/cli.md +35 -12
  216. package/vendor/pi/docs/custom-provider.md +2 -0
  217. package/vendor/pi/docs/environment-variables.md +2 -0
  218. package/vendor/pi/docs/extensions.md +3192 -225
  219. package/vendor/pi/docs/keybindings.md +2 -2
  220. package/vendor/pi/docs/llama-cpp.md +27 -19
  221. package/vendor/pi/docs/mcp.md +6 -4
  222. package/vendor/pi/docs/message-types.md +1 -1
  223. package/vendor/pi/docs/models-configuration.md +9 -3
  224. package/vendor/pi/docs/models.md +2 -1
  225. package/vendor/pi/docs/nvidia-rtx-llama-cpp.md +5 -5
  226. package/vendor/pi/docs/packages.md +24 -0
  227. package/vendor/pi/docs/prompt-templates.md +1 -1
  228. package/vendor/pi/docs/providers.md +4 -2
  229. package/vendor/pi/docs/quickstart.md +7 -3
  230. package/vendor/pi/docs/rpc-commands.md +1 -1
  231. package/vendor/pi/docs/rpc.md +4 -2
  232. package/vendor/pi/docs/sessions.md +17 -3
  233. package/vendor/pi/docs/settings.md +6 -5
  234. package/vendor/pi/docs/slash-commands.md +3 -2
  235. package/vendor/pi/docs/terminal-setup.md +3 -1
  236. package/vendor/pi/docs/tmux.md +6 -0
  237. package/vendor/pi/docs/tui.md +4 -0
  238. package/vendor/pi/docs/windows.md +27 -0
  239. package/vendor/pi/examples/extensions/README.md +2 -1
  240. package/vendor/pi/examples/extensions/custom-provider-anthropic/index.ts +27 -31
  241. package/vendor/pi/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  242. package/vendor/pi/examples/extensions/custom-provider-anthropic/package.json +1 -1
  243. package/vendor/pi/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  244. package/vendor/pi/examples/extensions/debug-provider.ts +2 -2
  245. package/vendor/pi/examples/extensions/gondolin/index.ts +4 -7
  246. package/vendor/pi/examples/extensions/gondolin/package-lock.json +19 -29
  247. package/vendor/pi/examples/extensions/gondolin/package.json +2 -2
  248. package/vendor/pi/examples/extensions/plan-mode/index.ts +23 -13
  249. package/vendor/pi/examples/extensions/plan-mode/utils.ts +42 -16
  250. package/vendor/pi/examples/extensions/preset.ts +2 -0
  251. package/vendor/pi/examples/extensions/reload-runtime.ts +17 -5
  252. package/vendor/pi/examples/extensions/subagent/README.md +14 -11
  253. package/vendor/pi/examples/extensions/subagent/index.ts +392 -171
  254. package/vendor/pi/examples/extensions/todo.ts +7 -0
  255. package/vendor/pi/examples/extensions/tools.ts +2 -0
  256. package/vendor/pi/examples/extensions/with-deps/package-lock.json +2 -2
  257. package/vendor/pi/examples/extensions/with-deps/package.json +1 -1
  258. package/vendor/pi/examples/tsconfig.json +208 -0
  259. package/vendor/pi/package.json +15 -16
  260. package/vendor/pi/schemas/models.schema.json +66 -37
  261. package/vendor/pi/schemas/settings.schema.json +18 -1
  262. package/vendor/pi-ai/bedrock.js +1 -1
  263. package/vendor/pi-ai/oauth-load.js +1 -1
  264. package/web/dist/assets/{board-math-css-BPXakv_3.js → board-math-css-DKX6FcUS.js} +1 -1
  265. package/web/dist/assets/index-D11wi0uG.js +540 -0
  266. package/web/dist/assets/index-JedYumhY.css +1 -0
  267. package/web/dist/assets/{index-WCm6wwmM.js → index-jl30Gy8P.js} +1 -1
  268. package/web/dist/assets/pdf-worker-DdZgk2mV.js +57 -0
  269. package/web/dist/assets/pdf.worker.min-Bz_KHX45.js +55 -0
  270. package/web/dist/index.html +2 -2
  271. package/web/dist/theme.css +22 -0
  272. package/dist/chunks/anthropic-messages-M3SMXACA.js +0 -8
  273. package/dist/chunks/api-GM53PHIL-GFHEXXE6.js +0 -4
  274. package/dist/chunks/azure-openai-responses-76YWXHSB.js +0 -4
  275. package/dist/chunks/bedrock-converse-stream-5UPX4NTQ.js +0 -58
  276. package/dist/chunks/child-runner-3GHOWGZP.js +0 -4
  277. package/dist/chunks/chunk-2ZNLUY2U.js +0 -128
  278. package/dist/chunks/chunk-3F6WW7HR.js +0 -13
  279. package/dist/chunks/chunk-3OKHUVEM.js +0 -7
  280. package/dist/chunks/chunk-3YHOCPQU.js +0 -10
  281. package/dist/chunks/chunk-4EX2JJWB.js +0 -4
  282. package/dist/chunks/chunk-4LLH5OWM.js +0 -10
  283. package/dist/chunks/chunk-52T37Y47.js +0 -8
  284. package/dist/chunks/chunk-7MU2AKNM.js +0 -4
  285. package/dist/chunks/chunk-AAA3UBIS.js +0 -4
  286. package/dist/chunks/chunk-ASYQHJVQ.js +0 -9
  287. package/dist/chunks/chunk-BKHDWCRT.js +0 -79
  288. package/dist/chunks/chunk-CQLH4UVX.js +0 -4
  289. package/dist/chunks/chunk-CVC66CFV.js +0 -33
  290. package/dist/chunks/chunk-D6UA4BZC.js +0 -19
  291. package/dist/chunks/chunk-DGMNI4AO.js +0 -4
  292. package/dist/chunks/chunk-DHSA5ACV.js +0 -125
  293. package/dist/chunks/chunk-DPQPXBTP.js +0 -68
  294. package/dist/chunks/chunk-DXBSQXJL.js +0 -18
  295. package/dist/chunks/chunk-E7ZMYIY6.js +0 -30
  296. package/dist/chunks/chunk-EQITBTJC.js +0 -10
  297. package/dist/chunks/chunk-EXJA5RIX.js +0 -357
  298. package/dist/chunks/chunk-FF7UELTU.js +0 -4
  299. package/dist/chunks/chunk-FH74NME3.js +0 -115
  300. package/dist/chunks/chunk-FOQ7VLIL.js +0 -17
  301. package/dist/chunks/chunk-FX6MOGLR.js +0 -11
  302. package/dist/chunks/chunk-G2V65UBA.js +0 -4
  303. package/dist/chunks/chunk-HGPBHTVD.js +0 -6
  304. package/dist/chunks/chunk-J5DVLUKY.js +0 -6
  305. package/dist/chunks/chunk-JW2HFMTF.js +0 -4
  306. package/dist/chunks/chunk-KDYEGGMW.js +0 -4
  307. package/dist/chunks/chunk-KIGMAATV.js +0 -23
  308. package/dist/chunks/chunk-KIU5FAPY.js +0 -5
  309. package/dist/chunks/chunk-KIWMQPH7.js +0 -739
  310. package/dist/chunks/chunk-L6VCIGWS.js +0 -11
  311. package/dist/chunks/chunk-LACGULCN.js +0 -10
  312. package/dist/chunks/chunk-LMSQZ6TQ.js +0 -4
  313. package/dist/chunks/chunk-MEPASGPP.js +0 -6
  314. package/dist/chunks/chunk-MFAEUHMV.js +0 -28
  315. package/dist/chunks/chunk-NAA7GF6Q.js +0 -5
  316. package/dist/chunks/chunk-NKDMKRSB.js +0 -68
  317. package/dist/chunks/chunk-NKXV32S6.js +0 -4
  318. package/dist/chunks/chunk-NVX5IPRN.js +0 -4
  319. package/dist/chunks/chunk-O3JW2F7D.js +0 -8
  320. package/dist/chunks/chunk-OE4KH3NJ.js +0 -4
  321. package/dist/chunks/chunk-OISO5JXB.js +0 -4
  322. package/dist/chunks/chunk-OPYXNSMY.js +0 -4
  323. package/dist/chunks/chunk-OSEIQ7SS.js +0 -4
  324. package/dist/chunks/chunk-P52RMIYX.js +0 -6
  325. package/dist/chunks/chunk-PBJ5MPPX.js +0 -60
  326. package/dist/chunks/chunk-PZMGBKUR.js +0 -13
  327. package/dist/chunks/chunk-PZMXHA6X.js +0 -9
  328. package/dist/chunks/chunk-Q7CE3UIE.js +0 -133
  329. package/dist/chunks/chunk-QBKCAIJG.js +0 -4
  330. package/dist/chunks/chunk-QEOFEETJ.js +0 -4
  331. package/dist/chunks/chunk-QUUEQRIT.js +0 -4
  332. package/dist/chunks/chunk-RA6HKFBV.js +0 -4
  333. package/dist/chunks/chunk-REPYBMQS.js +0 -4
  334. package/dist/chunks/chunk-SKHLZ6XY.js +0 -9
  335. package/dist/chunks/chunk-TAWLERZA.js +0 -4
  336. package/dist/chunks/chunk-TWAEABGG.js +0 -52
  337. package/dist/chunks/chunk-TZFLHVOQ.js +0 -7
  338. package/dist/chunks/chunk-UD3NMUHR.js +0 -12
  339. package/dist/chunks/chunk-UNVEZI57.js +0 -4
  340. package/dist/chunks/chunk-VQUPKMDR.js +0 -4
  341. package/dist/chunks/chunk-W25TB3PU.js +0 -4
  342. package/dist/chunks/chunk-W5LGYSPZ.js +0 -4
  343. package/dist/chunks/chunk-WEZWKMYU.js +0 -4
  344. package/dist/chunks/chunk-XAJLZR7C.js +0 -28
  345. package/dist/chunks/chunk-XH6FMP3N.js +0 -71
  346. package/dist/chunks/chunk-XSRZHN63.js +0 -4
  347. package/dist/chunks/chunk-Y3GFB5XM.js +0 -8
  348. package/dist/chunks/chunk-YG7OEPR2.js +0 -6
  349. package/dist/chunks/chunk-YHIWOGVL.js +0 -4
  350. package/dist/chunks/chunk-YKKEI5GI.js +0 -4
  351. package/dist/chunks/chunk-YZSHTWNM.js +0 -92
  352. package/dist/chunks/chunk-Z4H3VDHI.js +0 -4
  353. package/dist/chunks/cli-5DBTRMHU.js +0 -53
  354. package/dist/chunks/client-XOGYH5UR.js +0 -4
  355. package/dist/chunks/cloudflare-workers-ai-system-one-32JCFHI3.js +0 -4
  356. package/dist/chunks/config-DJSQI77S-335IXHSM.js +0 -4
  357. package/dist/chunks/context-VCQH5OB6.js +0 -4
  358. package/dist/chunks/cost-PGGFI7QJ.js +0 -5
  359. package/dist/chunks/dist-PUKMZ7GW.js +0 -4
  360. package/dist/chunks/easter-egg-3d-MO4MOEVF.js +0 -4
  361. package/dist/chunks/es5-VNTQPCKX.js +0 -4
  362. package/dist/chunks/file-7BN7RCAY.js +0 -4
  363. package/dist/chunks/gateway-UCRPMR75.js +0 -36
  364. package/dist/chunks/github-copilot-HAI2DA62.js +0 -4
  365. package/dist/chunks/google-generative-ai-2VXWLHWI.js +0 -4
  366. package/dist/chunks/google-vertex-UA36QP2U.js +0 -4
  367. package/dist/chunks/init-HA7FAQ73.js +0 -4
  368. package/dist/chunks/kimi-coding-HMJRKCPA.js +0 -4
  369. package/dist/chunks/local-client-stop-SQRU7ZZM.js +0 -4
  370. package/dist/chunks/meta-KY3LNFV2.js +0 -4
  371. package/dist/chunks/mistral-conversations-34F66L3O.js +0 -7
  372. package/dist/chunks/model-resolver-N3DTAQ2S.js +0 -4
  373. package/dist/chunks/openai-codex-responses-ZBVHREB3.js +0 -12
  374. package/dist/chunks/openai-completions-VVIB26SH.js +0 -9
  375. package/dist/chunks/openai-responses-735XA2ZX.js +0 -6
  376. package/dist/chunks/openrouter-images-3IKETHAC.js +0 -4
  377. package/dist/chunks/pi-messages-I3E4ZFHA.js +0 -10
  378. package/dist/chunks/radius-HXRZVBDB.js +0 -4
  379. package/dist/chunks/remote-ops-BALZYKH6.js +0 -14
  380. package/dist/chunks/runner-PLVZDGHB.js +0 -4
  381. package/dist/chunks/runtime-6YLTA2ZD.js +0 -4
  382. package/dist/chunks/schedule-cli-OLASBBYJ.js +0 -4
  383. package/dist/chunks/slack-WAGSPZUX.js +0 -4
  384. package/dist/chunks/start-ui-http-QALT7C3P.js +0 -43
  385. package/dist/chunks/subagent-E3UC7ZHC.js +0 -4
  386. package/dist/chunks/tool-shims-Q6P6UXVC.js +0 -4
  387. package/dist/chunks/typesafe-system-one-6ULACYD4.js +0 -4
  388. package/dist/chunks/ui-board-4GYW6KKW.js +0 -5
  389. package/dist/chunks/ui-decision-U2FXSEC2.js +0 -4
  390. package/dist/chunks/ui-view-O7PLANT7.js +0 -4
  391. package/dist/chunks/virtual-modules-IDC5YKZJ.js +0 -4
  392. package/dist/chunks/waitpoint-2FGQBIAC.js +0 -5
  393. package/dist/chunks/workers-XN4PSTH6.js +0 -4
  394. package/vendor/aistatus/gateway-cli.js +0 -21
  395. package/vendor/pi/examples/extensions/sandbox/index.ts +0 -321
  396. package/vendor/pi/examples/extensions/sandbox/package-lock.json +0 -92
  397. package/vendor/pi/examples/extensions/sandbox/package.json +0 -19
  398. package/web/dist/assets/index-BHZpFXhc.js +0 -525
  399. package/web/dist/assets/index-DqWMdMkh.css +0 -1
  400. package/web/dist/assets/pdf-worker-Hp15W1QJ.js +0 -57
  401. package/web/dist/assets/pdf.worker.min-DnhTvCwe.js +0 -55
@@ -1,11 +0,0 @@
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{Q as p}from"./chunk-QUUEQRIT.js";import{accessSync as w,constants as m}from"node:fs";import{delimiter as u,join as x,win32 as c}from"node:path";import{spawn as y,spawnSync as d}from"child_process";function g(e){let o=c.normalize(e).toLowerCase(),t=process.env.SystemRoot;return t?/^[a-z]:[\\/]/i.test(t)?["System32","Sysnative"].some(n=>o===c.join(t,n,"bash.exe").toLowerCase()):!1:/^[a-z]:\\windows\\(?:system32|sysnative)\\bash\.exe$/.test(o)}function i(e){return g(e)?{shell:e,args:["-s"],commandTransport:"stdin"}:{shell:e,args:["-c"]}}function r(e){try{return w(e,m.F_OK),!0}catch{return!1}}function l(e){if(process.platform==="win32"){try{let o=d("where",[e],{encoding:"utf-8",timeout:5e3,windowsHide:!0});if(o.status===0&&o.stdout){let t=o.stdout.trim().split(/\r?\n/)[0];if(t&&r(t))return t}}catch{}return null}try{let o=d("which",[e],{encoding:"utf-8",timeout:5e3});if(o.status===0&&o.stdout){let t=o.stdout.trim().split(/\r?\n/)[0];if(t)return t}}catch{}return null}function E(e){if(e){if(r(e))return i(e);throw new Error(`Custom shell path not found: ${e}`)}if(process.platform==="win32"){let t=[],n=process.env.ProgramFiles;n&&t.push(`${n}\\Git\\bin\\bash.exe`);let f=process.env["ProgramFiles(x86)"];f&&t.push(`${f}\\Git\\bin\\bash.exe`);for(let s of t)if(r(s))return i(s);let a=l("bash.exe");if(a)return i(a);throw new Error(`No bash shell found. Options:
5
- 1. Install Git for Windows: https://git-scm.com/download/win
6
- 2. Add your bash to PATH (Cygwin, MSYS2, etc.)
7
- 3. Set shellPath in settings.json
8
-
9
- Searched Git Bash in:
10
- ${t.map(s=>` ${s}`).join(`
11
- `)}`)}if(r("/bin/bash"))return i("/bin/bash");let o=l("bash");return o?i(o):{shell:"sh",args:["-c"]}}var P=["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-Command"];function B(){if(process.platform!=="win32")throw new Error("The powershell tool is only available on Windows.");let e=l("pwsh.exe"),o=process.env.ProgramFiles;if(!e&&o){let n=c.join(o,"PowerShell","7","pwsh.exe");r(n)&&(e=n)}e??=l("powershell.exe");let t=process.env.SystemRoot;if(!e&&t){let n=c.join(t,"System32","WindowsPowerShell","v1.0","powershell.exe");r(n)&&(e=n)}if(!e)throw new Error("No PowerShell executable found. Install PowerShell or add powershell.exe/pwsh.exe to PATH.");return{shell:e,args:[...P]}}function k(){let e=p(),o=Object.keys(process.env).find(s=>s.toLowerCase()==="path")??"PATH",t=process.env[o]??"",a=t.split(u).filter(Boolean).includes(e)?t:[e,t].filter(Boolean).join(u);return{...process.env,[o]:a}}function L(e){return e.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFF9-\uFFFB]/g,"")}var h=new Set;function D(e){h.add(e)}function j(e){h.delete(e)}function I(){for(let e of h)S(e);h.clear()}function S(e){if(process.platform==="win32")try{y(x(process.env.SystemRoot||"C:\\Windows","System32","taskkill.exe"),["/F","/T","/PID",String(e)],{stdio:"ignore",detached:!0,windowsHide:!0}).once("error",()=>{})}catch{}else try{process.kill(-e,"SIGKILL")}catch{try{process.kill(e,"SIGKILL")}catch{}}}export{E as a,B as b,k as c,L as d,D as e,j as f,I as g,S as h};
@@ -1,4 +0,0 @@
1
- import { createRequire as __cortexCreateRequire } from 'node:module';
2
- const require = __cortexCreateRequire(import.meta.url);
3
- const __cortexPackageRoot = new URL("../../", import.meta.url);
4
- function k(t,n){if(n+8>t.length)return 1;let e=(t[n]<<8|t[n+1])===18761,r=i=>e?t[i]|t[i+1]<<8:t[i]<<8|t[i+1],o=(i=>e?t[i]|t[i+1]<<8|t[i+2]<<16|t[i+3]<<24:(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])>>>0)(n+4),c=n+o;if(c+2>t.length)return 1;let f=r(c);for(let i=0;i<f;i++){let l=c+2+i*12;if(l+12>t.length)return 1;if(r(l)===274){let h=r(l+8);return h>=1&&h<=8?h:1}}return 1}function L(t){let n=2;for(;n<t.length-1;){if(t[n]!==255)return-1;let u=t[n+1];if(u===255){n++;continue}if(u===225){if(n+4>=t.length)return-1;let r=n+4;if(r+6>t.length)return-1;if(W(t,r))return r+6}if(n+4>t.length)return-1;let e=t[n+2]<<8|t[n+3];n+=2+e}return-1}function v(t){let n=12;for(;n+8<=t.length;){let u=String.fromCharCode(t[n],t[n+1],t[n+2],t[n+3]),e=t[n+4]|t[n+5]<<8|t[n+6]<<16|t[n+7]<<24,r=n+8;if(u==="EXIF")return r+e>t.length?-1:e>=6&&W(t,r)?r+6:r;n=r+e+e%2}return-1}function W(t,n){return t[n]===69&&t[n+1]===120&&t[n+2]===105&&t[n+3]===102&&t[n+4]===0&&t[n+5]===0}function A(t){let n=-1;return t.length>=2&&t[0]===255&&t[1]===216?n=L(t):t.length>=12&&t[0]===82&&t[1]===73&&t[2]===70&&t[3]===70&&t[8]===87&&t[9]===69&&t[10]===66&&t[11]===80&&(n=v(t)),n===-1?1:k(t,n)}function P(t,n,u){let e=n.get_width(),r=n.get_height(),a=n.get_raw_pixels(),o=new Uint8Array(a.length);for(let c=0;c<r;c++)for(let f=0;f<e;f++){let i=(c*e+f)*4,l=u(f,c,e,r)*4;o[l]=a[i],o[l+1]=a[i+1],o[l+2]=a[i+2],o[l+3]=a[i+3]}return new t.PhotonImage(o,r,e)}function I(t,n,u){let e=A(u);if(e===1)return n;switch(e){case 2:return t.fliph(n),n;case 3:return t.fliph(n),t.flipv(n),n;case 4:return t.flipv(n),n;case 5:{let r=P(t,n,(a,o,c,f)=>a*f+(f-1-o));return t.fliph(r),r}case 6:return P(t,n,(r,a,o,c)=>r*c+(c-1-a));case 7:{let r=P(t,n,(a,o,c,f)=>(c-1-a)*f+o);return t.fliph(r),r}case 8:return P(t,n,(r,a,o,c)=>(o-1-r)*c+a);default:return n}}import{createRequire as N}from"module";import*as w from"path";import{fileURLToPath as U}from"url";var B=N(new URL("vendor/pi/dist/utils/photon.js",__cortexPackageRoot).href),m=B("fs"),O="photon_rs_bg.wasm",p=null,E=null;function q(t){return typeof t=="string"?t:t instanceof URL?U(t):null}function C(){let t=w.dirname(process.execPath);return[w.join(t,O),w.join(t,"photon",O),w.join(process.cwd(),O)]}function D(){let t=m.readFileSync.bind(m),n=C(),u=m,e=((...r)=>{let[a,o]=r;if(q(a)?.endsWith(O))try{return t(...r)}catch(f){let i=f;if(i?.code&&i.code!=="ENOENT")throw f;for(let l of n)if(m.existsSync(l))return o===void 0?t(l):t(l,o);throw f}return t(...r)});try{u.readFileSync=e}catch{Object.defineProperty(m,"readFileSync",{value:e,writable:!0,configurable:!0})}return()=>{try{u.readFileSync=t}catch{Object.defineProperty(m,"readFileSync",{value:t,writable:!0,configurable:!0})}}}async function M(){return p||E||(E=(async()=>{let t=D();try{return p=await import("@silvia-odwyer/photon-node"),p}catch{return p=null,p}finally{t()}})(),E)}var V="pi:image-resize-response",Q=4.5*1024*1024,X={maxWidth:2e3,maxHeight:2e3,maxBytes:Q,jpegQuality:80};function T(t,n){let u=Buffer.from(t).toString("base64");return{data:u,encodedSize:Buffer.byteLength(u,"utf-8"),mimeType:n}}async function y(t,n,u){let e={...X,...u},r=Math.ceil(t.byteLength/3)*4,a=await M();if(!a)return null;let o;try{let z=function(F,S,_){let x=a.resize(o,F,S,a.SamplingFilter.Lanczos3);try{let R=[T(x.get_bytes(),"image/png")];for(let H of _)R.push(T(x.get_bytes_jpeg(H),"image/jpeg"));return R}finally{x.free()}},c=a.PhotonImage.new_from_byteslice(t);o=I(a,c,t),o!==c&&c.free();let f=o.get_width(),i=o.get_height(),l=n.split("/")[1]??"png";if(f<=e.maxWidth&&i<=e.maxHeight&&r<e.maxBytes)return{data:Buffer.from(t).toString("base64"),mimeType:n||`image/${l}`,originalWidth:f,originalHeight:i,width:f,height:i,wasResized:!1};let h=f,g=i;h>e.maxWidth&&(g=Math.round(g*e.maxWidth/h),h=e.maxWidth),g>e.maxHeight&&(h=Math.round(h*e.maxHeight/g),g=e.maxHeight);let j=Array.from(new Set([e.jpegQuality,85,70,55,40])),d=h,s=g;for(;;){let F=z(d,s,j);for(let x of F)if(x.encodedSize<e.maxBytes)return{data:x.data,mimeType:x.mimeType,originalWidth:f,originalHeight:i,width:d,height:s,wasResized:!0};if(d===1&&s===1)break;let S=d===1?1:Math.max(1,Math.floor(d*.75)),_=s===1?1:Math.max(1,Math.floor(s*.75));if(S===d&&_===s)break;d=S,s=_}return null}catch{return null}finally{o&&o.free()}}export{I as a,M as b,V as c,y as d};
@@ -1,6 +0,0 @@
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 _}from"./chunk-EQIMHXC4.js";import{f as g,h as b}from"./chunk-RA6HKFBV.js";import{G as h,d as S,h as a,m as p}from"./chunk-QUUEQRIT.js";import{e as I}from"./chunk-WHC7AYZD.js";var k=I(_(),1);import{existsSync as E,mkdirSync as O,readFileSync as A,writeFileSync as J}from"node:fs";import{homedir as G}from"node:os";import{dirname as y,join as m}from"node:path";var q=["settings.json","mcp.json","extensions","skills","prompts","themes","SYSTEM.md","APPEND_SYSTEM.md"];function v(e){return S(a(e))}function B(e,t){let r=v(t);for(;;){let n=e[r];if(n===!0||n===!1)return{path:r,decision:n};let o=y(r);if(o===r)return null;r=o}}function L(e){let t=v(e),r=y(t);return r===t?void 0:r}function te(e,t){let r=v(e),n=[{label:"Trust",trusted:!0,updates:[{path:r,decision:!0}],savedPath:r}],o=L(e);return o!==void 0&&n.push({label:`Trust parent folder (${o})`,trusted:!0,updates:[{path:o,decision:!0},{path:r,decision:null}],savedPath:o}),t?.includeSessionOnly&&n.push({label:"Trust (this session only)",trusted:!0,updates:[]}),n.push({label:"Do not trust",trusted:!1,updates:[{path:r,decision:!1}],savedPath:r}),t?.includeSessionOnly&&n.push({label:"Do not trust (this session only)",trusted:!1,updates:[]}),n}function j(e){if(!E(e))return{};let t;try{t=JSON.parse(p(A(e,"utf-8")))}catch(n){let o=n instanceof Error?n.message:String(n);throw new Error(`Failed to read trust store ${e}: ${o}`)}if(typeof t!="object"||t===null||Array.isArray(t))throw new Error(`Invalid trust store ${e}: expected an object`);let r={};for(let[n,o]of Object.entries(t)){if(o!==!0&&o!==!1&&o!==null)throw new Error(`Invalid trust store ${e}: value for ${JSON.stringify(n)} must be true, false, or null`);r[n]=o}return r}function U(e,t){let r={};for(let n of Object.keys(t).sort()){let o=t[n];(o===!0||o===!1||o===null)&&(r[n]=o)}O(y(e),{recursive:!0}),J(e,`${JSON.stringify(r,null,2)}
5
- `,"utf-8")}function Y(e){let t=y(e);O(t,{recursive:!0});let r=10,n=20,o;for(let i=1;i<=r;i++)try{return k.default.lockSync(t,{realpath:!1,lockfilePath:`${e}.lock`})}catch(s){if((typeof s=="object"&&s!==null&&"code"in s?String(s.code):void 0)!=="ELOCKED"||i===r)throw s;o=s;let c=Date.now();for(;Date.now()-c<n;);}throw o instanceof Error?o:new Error("Failed to acquire trust store lock")}function P(e,t){let r=Y(e);try{return t()}finally{r()}}function ne(e){let t=S(a(process.env.HOME||G())),r=m(t,".agents","skills"),n=S(a(e)),o=m(n,h);if(q.some(i=>E(m(o,i))))return!0;for(;;){let i=m(n,".agents","skills");if(i!==r&&E(i))return!0;let s=y(n);if(s===n)return!1;n=s}}var C=class{trustPath;constructor(t){this.trustPath=m(a(t),"trust.json")}get(t){return this.getEntry(t)?.decision??null}getEntry(t){return P(this.trustPath,()=>{let r=j(this.trustPath);return B(r,t)})}set(t,r){this.setMany([{path:t,decision:r}])}setMany(t){P(this.trustPath,()=>{let r=j(this.trustPath);for(let{path:n,decision:o}of t){let i=v(n);o===null?delete r[i]:r[i]=o}U(this.trustPath,r)})}};import{spawn as z}from"node:child_process";function ie(e){let[t,r]=process.platform==="darwin"?["open",[e]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]];z(t,r,{stdio:"ignore",detached:!0}).on("error",()=>{}).unref()}import{existsSync as w,mkdirSync as H,readFileSync as N,writeFileSync as K}from"node:fs";import{dirname as Q,join as D}from"node:path";var M=["enabled","exposure","toolExposure"];function F(e){return e.command===void 0&&e.url===void 0&&e.type===void 0}function l(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function T(e,t,r){let{servers:n,errors:o}=r;if(!w(e))return;let i;try{i=JSON.parse(p(N(e,"utf8")))}catch(s){o.push(`${e}: ${s instanceof Error?s.message:String(s)}`);return}if(!l(i)||i.mcpServers!==void 0&&!l(i.mcpServers)){o.push(`${e}: expected an object with an "mcpServers" object`);return}typeof i.autoEnableCodemode=="boolean"?r.autoEnableCodemode=i.autoEnableCodemode:i.autoEnableCodemode!==void 0&&o.push(`${e}: autoEnableCodemode must be a boolean`);for(let[s,u]of Object.entries(i.mcpServers??{})){if(t==="project"&&l(u)&&F(u)){let d=n.get(s),R=Object.keys(u).filter(f=>!M.includes(f));if(!d)o.push(`${e}: server "${s}" needs "command" or "url", or a global server to override`);else if(R.length>0)o.push(`${e}: server "${s}": an override can only set ${M.join(", ")}`);else{let f=b(s,{...d.config,...u});typeof f=="string"?o.push(`${e}: ${f}`):n.set(s,{...d,config:f,override:e})}continue}let c=b(s,u);if(typeof c=="string"){o.push(`${e}: ${c}`);continue}let x=[...n.keys()].find(d=>d!==s&&g(d)===g(s));if(x){o.push(`${e}: server "${s}" conflicts with "${x}"`);continue}if(t==="project"&&"url"in c&&c.auth){o.push(`${e}: server "${s}": auth is only allowed in the global mcp.json`);continue}n.set(s,{name:s,config:c,source:e,scope:t})}}function me(e){let t={servers:new Map,errors:[]};T(D(e.agentDir,"mcp.json"),"global",t);let r=e.projectTrusted?D(e.cwd,h,"mcp.json"):void 0;return r&&T(r,"project",t),{servers:[...t.servers.values()],...t.autoEnableCodemode===void 0?{}:{autoEnableCodemode:t.autoEnableCodemode},errors:t.errors,...r?{projectConfig:r}:{}}}function ye(e,t,r,n={}){$(e,(o,i)=>{let s=o?.[t];if(s===void 0&&n.override&&(s={},i.mcpServers={...o,[t]:s}),!l(s))throw new Error(`${e} does not define MCP server "${t}"`);let u=F(s);return r.enabled!==void 0&&(r.enabled&&!u?delete s.enabled:s.enabled=r.enabled),r.exposure!==void 0&&(r.exposure==="codemode"&&!u?delete s.exposure:s.exposure=r.exposure),!0})}function Se(e,t,r){let n=!1;return $(e,(o,i)=>{let s=o??{};return n=s[t]!==void 0,s[t]=r,i.mcpServers=s,!0}),n}function he(e,t){if(!w(e))return!1;let r=!1;return $(e,n=>!n||n[t]===void 0?!1:(delete n[t],r=!0,!0)),r}function $(e,t){let r=w(e)?p(N(e,"utf8")):void 0,n=r===void 0?{}:JSON.parse(r);if(!l(n)||n.mcpServers!==void 0&&!l(n.mcpServers))throw new Error(`${e}: expected an object with an "mcpServers" object`);let o=l(n.mcpServers)?n.mcpServers:void 0;if(!t(o,n))return;let i=r&&/^([ \t]+)\S/m.exec(r)?.[1]||" ";H(Q(e),{recursive:!0}),K(e,`${JSON.stringify(n,null,i)}
6
- `)}export{te as a,ne as b,C as c,ie as d,me as e,ye as f,Se as g,he as h};
@@ -1,6 +0,0 @@
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 g,c as A,e as L}from"./chunk-WHC7AYZD.js";var N=A((ue,k)=>{k.exports={name:"dotenv",version:"16.6.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var C=A((fe,d)=>{var T=g("fs"),m=g("path"),$=g("os"),Y=g("crypto"),G=N(),R=G.version,K=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function F(e){let t={},n=e.toString();n=n.replace(/\r\n?/mg,`
5
- `);let o;for(;(o=K.exec(n))!=null;){let c=o[1],r=o[2]||"";r=r.trim();let a=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),a==='"'&&(r=r.replace(/\\n/g,`
6
- `),r=r.replace(/\\r/g,"\r")),t[c]=r}return t}function W(e){e=e||{};let t=j(e);e.path=t;let n=l.configDotenv(e);if(!n.parsed){let a=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw a.code="MISSING_DATA",a}let o=x(e).split(","),c=o.length,r;for(let a=0;a<c;a++)try{let i=o[a].trim(),f=M(n,i);r=l.decrypt(f.ciphertext,f.key);break}catch(i){if(a+1>=c)throw i}return l.parse(r)}function U(e){console.log(`[dotenv@${R}][WARN] ${e}`)}function _(e){console.log(`[dotenv@${R}][DEBUG] ${e}`)}function b(e){console.log(`[dotenv@${R}] ${e}`)}function x(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function M(e,t){let n;try{n=new URL(t)}catch(i){if(i.code==="ERR_INVALID_URL"){let f=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw f.code="INVALID_DOTENV_KEY",f}throw i}let o=n.password;if(!o){let i=new Error("INVALID_DOTENV_KEY: Missing key part");throw i.code="INVALID_DOTENV_KEY",i}let c=n.searchParams.get("environment");if(!c){let i=new Error("INVALID_DOTENV_KEY: Missing environment part");throw i.code="INVALID_DOTENV_KEY",i}let r=`DOTENV_VAULT_${c.toUpperCase()}`,a=e.parsed[r];if(!a){let i=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${r} in your .env.vault file.`);throw i.code="NOT_FOUND_DOTENV_ENVIRONMENT",i}return{ciphertext:a,key:o}}function j(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let n of e.path)T.existsSync(n)&&(t=n.endsWith(".vault")?n:`${n}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=m.resolve(process.cwd(),".env.vault");return T.existsSync(t)?t:null}function w(e){return e[0]==="~"?m.join($.homedir(),e.slice(1)):e}function X(e){let t=!!(e&&e.debug),n=e&&"quiet"in e?e.quiet:!0;(t||!n)&&b("Loading env from encrypted .env.vault");let o=l._parseVault(e),c=process.env;return e&&e.processEnv!=null&&(c=e.processEnv),l.populate(c,o,e),{parsed:o}}function q(e){let t=m.resolve(process.cwd(),".env"),n="utf8",o=!!(e&&e.debug),c=e&&"quiet"in e?e.quiet:!0;e&&e.encoding?n=e.encoding:o&&_("No encoding is specified. UTF-8 is used by default");let r=[t];if(e&&e.path)if(!Array.isArray(e.path))r=[w(e.path)];else{r=[];for(let h of e.path)r.push(w(h))}let a,i={};for(let h of r)try{let p=l.parse(T.readFileSync(h,{encoding:n}));l.populate(i,p,e)}catch(p){o&&_(`Failed to load ${h} ${p.message}`),a=p}let f=process.env;if(e&&e.processEnv!=null&&(f=e.processEnv),l.populate(f,i,e),o||!c){let h=Object.keys(i).length,p=[];for(let I of r)try{let v=m.relative(process.cwd(),I);p.push(v)}catch(v){o&&_(`Failed to load ${I} ${v.message}`),a=v}b(`injecting env (${h}) from ${p.join(",")}`)}return a?{parsed:i,error:a}:{parsed:i}}function B(e){if(x(e).length===0)return l.configDotenv(e);let t=j(e);return t?l._configVault(e):(U(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),l.configDotenv(e))}function H(e,t){let n=Buffer.from(t.slice(-64),"hex"),o=Buffer.from(e,"base64"),c=o.subarray(0,12),r=o.subarray(-16);o=o.subarray(12,-16);try{let a=Y.createDecipheriv("aes-256-gcm",n,c);return a.setAuthTag(r),`${a.update(o)}${a.final()}`}catch(a){let i=a instanceof RangeError,f=a.message==="Invalid key length",h=a.message==="Unsupported state or unable to authenticate data";if(i||f){let p=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw p.code="INVALID_DOTENV_KEY",p}else if(h){let p=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw p.code="DECRYPTION_FAILED",p}else throw a}}function J(e,t,n={}){let o=!!(n&&n.debug),c=!!(n&&n.override);if(typeof t!="object"){let r=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw r.code="OBJECT_REQUIRED",r}for(let r of Object.keys(t))Object.prototype.hasOwnProperty.call(e,r)?(c===!0&&(e[r]=t[r]),o&&_(c===!0?`"${r}" is already defined and WAS overwritten`:`"${r}" is already defined and was NOT overwritten`)):e[r]=t[r]}var l={configDotenv:q,_configVault:X,_parseVault:W,config:B,decrypt:H,parse:F,populate:J};d.exports.configDotenv=l.configDotenv;d.exports._configVault=l._configVault;d.exports._parseVault=l._parseVault;d.exports.config=l.config;d.exports.decrypt=l.decrypt;d.exports.parse=l.parse;d.exports.populate=l.populate;d.exports=l});import*as O from"fs";import*as s from"path";import*as y from"os";import{fileURLToPath as oe}from"url";var V=L(C(),1);import{readFileSync as Q}from"node:fs";import{homedir as z}from"node:os";import*as E from"node:path";var Z=9880;function ee(e){if(e===void 0)return;let t=Number(e);if(!/^\d+$/.test(e.trim())||!Number.isInteger(t)||t<1||t>65535)throw new Error("CORTEX_GATEWAY_PORT must be an integer from 1 to 65535");return t}function te(e){if(e!==void 0){if(!E.isAbsolute(e))throw new Error("CORTEX_GATEWAY_HOME must be an absolute path");return E.resolve(e)}}function re(e,t,n){let o=ee(e.CORTEX_GATEWAY_PORT??t.CORTEX_GATEWAY_PORT),c=o??Z,r=te(e.CORTEX_GATEWAY_HOME??t.CORTEX_GATEWAY_HOME),a=E.join(r??n,".aistatus");return{port:c,portOverride:o,home:r,aistatusDir:a,configPath:E.join(a,"gateway.yaml"),url:`http://127.0.0.1:${c}`}}function P(e,t=process.env,n=z()){let o={};try{o=(0,V.parse)(Q(E.join(e,".env")))}catch(c){if(c.code!=="ENOENT")throw c}return re(t,o,n)}function Ee(e,t){return e.portOverride??t??e.port}var ne=s.dirname(oe(new URL("dist/core/paths.js",__cortexPackageRoot).href)),S=s.resolve(ne,"..",".."),me=s.join(S,"defaults");var Oe=S;var u=process.env.CORTEX_HOME?s.resolve(process.env.CORTEX_HOME):s.join(y.homedir(),".cortex");function se(){let e=process.env.CORTEX_AGENT_CWD;if(!e)return u;let t=s.resolve(e);if(!s.isAbsolute(e)||!O.existsSync(t)||!O.statSync(t).isDirectory())throw new Error(`CORTEX_AGENT_CWD must be an absolute path to an existing directory: ${e}`);return t}var ae=se();function ce(e){return s.resolve(e??ae)}function De(e){return ce(e?.workspaceDir??void 0)}var ie=P(s.join(u,"config")),Te=ie.aistatusDir,Re=s.join(u,"config"),D=s.join(u,"data"),ye=s.join(D,"claude"),Ie=s.join(y.homedir(),".claude"),Ae=s.join(D,"daemon.pid"),Ne=s.join(D,"daemon-child.pid"),we=s.join(D,".restart"),le=s.join(u,"context"),be=process.env.CORTEX_PROJECTS_DIR?s.resolve(process.env.CORTEX_PROJECTS_DIR):s.join(le,"projects"),pe=s.join(u,"tmp"),xe=s.join(u,"workspaces");function je(e){let t="workspace/";if(!e.startsWith(t))return null;let n=e.slice(t.length),o=s.resolve(pe),c=s.resolve(o,n);return c!==o&&!c.startsWith(o+s.sep)?null:c}var Ce=s.join(u,"plugins"),Ve=s.join(u,"prompts"),Pe=s.join(u,"hooks"),Se=s.join(u,"logs");export{C as a,Ee as b,S as c,me as d,Oe as e,u as f,ae as g,ce as h,De as i,ie as j,Te as k,Re as l,D as m,ye as n,Ie as o,Ae as p,Ne as q,we as r,le as s,be as t,pe as u,xe as v,je as w,Ce as x,Ve as y,Pe as z,Se as A};
@@ -1,4 +0,0 @@
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{f as s,m as i}from"./chunk-J5DVLUKY.js";import*as n from"fs";import*as r from"path";var l=r.join(i,"client-pids.json");function f(){return r.join(s,"client","current","client.mjs")}function o(){try{return JSON.parse(n.readFileSync(l,"utf8"))}catch{return{}}}function u(t){n.mkdirSync(i,{recursive:!0}),n.writeFileSync(l,JSON.stringify(t,null,2))}function p(t){return o()[t]}function d(t,e){let c=o();c[t]=e,u(c)}function m(t){let e=o();delete e[t],u(e)}function h(t){return!!t&&!t.ssh&&!t.clientCommand&&t.clientConnection!=="ssh-reverse"}export{f as a,o as b,p as c,d,m as e,h as f};
@@ -1,4 +0,0 @@
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 n}from"./chunk-6R73ICDB.js";var a=function(_,E){return typeof _=="string"&&/^\.\.?\//.test(_)?_.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,I,t,i,r){return I?E?".jsx":".js":t&&(!i||!r)?e:t+i+"."+r.toLowerCase()+"js"}):_},A=null,s=null,N=null,O=_=>import(a(_)),T="node:fs",c="node:os",K="node:path";typeof process<"u"&&(process.versions?.node||process.versions?.bun)&&(O(T).then(_=>{A=_.existsSync}),O(c).then(_=>{s=_.homedir}),O(K).then(_=>{N=_.join}));var P="ANTHROPIC_AUTH_TOKEN",C="ANTHROPIC_OAUTH_TOKEN",R="ANTHROPIC_API_KEY",d="ANTHROPIC_FEDERATION_RULE_ID",p="ANTHROPIC_ORGANIZATION_ID",L="ANTHROPIC_SERVICE_ACCOUNT_ID",S="ANTHROPIC_IDENTITY_TOKEN_FILE",D="ANTHROPIC_WORKSPACE_ID",o=null;function l(_){let E=_?.GOOGLE_APPLICATION_CREDENTIALS;if(E)return A?A(E):!1;if(o===null){if(!A||!s||!N)return typeof process<"u"&&(process.versions?.node||process.versions?.bun)||(o=!1),!1;let e=n("GOOGLE_APPLICATION_CREDENTIALS",_);e?o=A(e):o=A(N(s(),".config","gcloud","application_default_credentials.json"))}return o}function u(_){if(_==="github-copilot")return["COPILOT_GITHUB_TOKEN"];if(_==="anthropic")return[P,C,R];let e={"ant-ling":"ANT_LING_API_KEY","qwen-token-plan":"QWEN_TOKEN_PLAN_API_KEY","qwen-token-plan-cn":"QWEN_TOKEN_PLAN_CN_API_KEY","qwen-token-plan-individual":"QWEN_TOKEN_PLAN_API_KEY",openai:"OPENAI_API_KEY",azure:"AZURE_OPENAI_API_KEY",nvidia:"NVIDIA_API_KEY",deepseek:"DEEPSEEK_API_KEY",google:"GEMINI_API_KEY","google-vertex":"GOOGLE_CLOUD_API_KEY",groq:"GROQ_API_KEY",cerebras:"CEREBRAS_API_KEY",xai:"XAI_API_KEY",typesafe:"TYPESAFE_API_KEY",radius:"RADIUS_API_KEY",openrouter:"OPENROUTER_API_KEY","vercel-ai-gateway":"AI_GATEWAY_API_KEY",zai:"ZAI_API_KEY","zai-coding-cn":"ZAI_CODING_CN_API_KEY",mistral:"MISTRAL_API_KEY",minimax:"MINIMAX_API_KEY","minimax-cn":"MINIMAX_CN_API_KEY",moonshotai:"MOONSHOT_API_KEY","moonshotai-cn":"MOONSHOT_API_KEY",huggingface:"HF_TOKEN",fireworks:"FIREWORKS_API_KEY",together:"TOGETHER_API_KEY",baseten:"BASETEN_API_KEY",opencode:"OPENCODE_API_KEY","opencode-go":"OPENCODE_API_KEY","kimi-coding":"KIMI_API_KEY",meta:"META_API_KEY","cloudflare-workers-ai":"CLOUDFLARE_API_KEY","cloudflare-ai-gateway":"CLOUDFLARE_API_KEY",xiaomi:"XIAOMI_API_KEY","xiaomi-token-plan-cn":"XIAOMI_TOKEN_PLAN_CN_API_KEY","xiaomi-token-plan-ams":"XIAOMI_TOKEN_PLAN_AMS_API_KEY","xiaomi-token-plan-sgp":"XIAOMI_TOKEN_PLAN_SGP_API_KEY"}[_];return e?[e]:void 0}function f(_,E){let e=u(_);if(!e)return;let I=e.filter(t=>!!n(t,E));return I.length>0?I:void 0}function x(_,E){let e=f(_,E);if(e?.[0]){let I=_==="anthropic"?e.find(t=>t!==P):e[0];if(I)return n(I,E)}if(_==="google-vertex"){let I=l(E),t=!!(n("GOOGLE_CLOUD_PROJECT",E)||n("GCLOUD_PROJECT",E)),i=!!n("GOOGLE_CLOUD_LOCATION",E);if(I&&t&&i)return"<authenticated>"}if(_==="amazon-bedrock"&&(n("AWS_PROFILE",E)||n("AWS_ACCESS_KEY_ID",E)&&n("AWS_SECRET_ACCESS_KEY",E)||n("AWS_BEARER_TOKEN_BEDROCK",E)||n("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",E)||n("AWS_CONTAINER_CREDENTIALS_FULL_URI",E)||n("AWS_WEB_IDENTITY_TOKEN_FILE",E)))return"<authenticated>"}export{P as a,C as b,R as c,d,p as e,L as f,S as g,D as h,f as i,x as j};