@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.
- package/LICENSE +255 -21
- package/README.md +36 -7
- package/THIRD_PARTY_NOTICES.txt +1990 -593
- package/defaults/hooks/cortex-hook-api.mjs +2 -1
- package/defaults/hooks/quota-stop.mjs +37 -0
- package/defaults/plugins/cortex-system/skills/client-manage/SKILL.md +23 -15
- package/defaults/prompts/clean-workspace.md +5 -0
- package/dist/agent-adapter/claude/remote-mcp-proxy.js +1 -1
- package/dist/chunks/agent-runner-LVZVKBZX.js +4 -0
- package/dist/chunks/anthropic-messages-TT6454AA.js +8 -0
- package/dist/chunks/azure-openai-responses-52LR2XZD.js +4 -0
- package/dist/chunks/bedrock-converse-stream-EOZGYUNY.js +60 -0
- package/dist/chunks/bowser-MLGGLXTZ.js +20 -0
- package/dist/chunks/child-runner-SMG2VOU5.js +4 -0
- package/dist/chunks/chunk-24DH4IR5.js +4 -0
- package/dist/chunks/chunk-25XKBRDT.js +70 -0
- package/dist/chunks/chunk-2ABET62E.js +23 -0
- package/dist/chunks/chunk-2BVUA256.js +4 -0
- package/dist/chunks/{chunk-LEUENXI2.js → chunk-2WFL62UO.js} +1 -1
- package/dist/chunks/{chunk-OZGBWAT2.js → chunk-2YTYYG4K.js} +1 -1
- package/dist/chunks/chunk-335SSANX.js +4 -0
- package/dist/chunks/chunk-377OPTXX.js +17 -0
- package/dist/chunks/chunk-3EZNVLBF.js +129 -0
- package/dist/chunks/chunk-3O6ZG5HA.js +7 -0
- package/dist/chunks/{chunk-6AKUD3CF.js → chunk-3XLHL5YT.js} +1 -1
- package/dist/chunks/chunk-4HRI75GU.js +4 -0
- package/dist/chunks/chunk-4JBYLRPM.js +57 -0
- package/dist/chunks/chunk-4KKV7VKE.js +4 -0
- package/dist/chunks/chunk-4KQHDDC5.js +4 -0
- package/dist/chunks/chunk-4SWD4JMP.js +33 -0
- package/dist/chunks/chunk-52VCLZS5.js +4 -0
- package/dist/chunks/chunk-54P7TSY3.js +10 -0
- package/dist/chunks/chunk-5DVSAXOI.js +7 -0
- package/dist/chunks/chunk-5F3A62YS.js +4 -0
- package/dist/chunks/{chunk-XNSSUVT6.js → chunk-5FHETFZM.js} +1 -1
- package/dist/chunks/{chunk-A34TDMIC.js → chunk-5LBLRAHS.js} +1 -1
- package/dist/chunks/chunk-5UYVNA3W.js +4 -0
- package/dist/chunks/chunk-6G3OYMCV.js +21 -0
- package/dist/chunks/chunk-7GGPYU5E.js +30 -0
- package/dist/chunks/chunk-7TYSMLUV.js +4 -0
- package/dist/chunks/chunk-7W7VYUTK.js +5 -0
- package/dist/chunks/chunk-AXYAZTTN.js +6 -0
- package/dist/chunks/{chunk-BGVHA2D4.js → chunk-B3NB243Z.js} +1 -1
- package/dist/chunks/chunk-BKYP6AGM.js +8 -0
- package/dist/chunks/chunk-BVEDNESB.js +4 -0
- package/dist/chunks/chunk-BWDJS6A4.js +12 -0
- package/dist/chunks/chunk-C6YVF7EI.js +4 -0
- package/dist/chunks/chunk-CEJIYYVE.js +15 -0
- package/dist/chunks/chunk-CI2RHH74.js +50 -0
- package/dist/chunks/chunk-CMSOOLJB.js +4 -0
- package/dist/chunks/chunk-CSVTYYLP.js +4 -0
- package/dist/chunks/chunk-DE5EGVKG.js +6 -0
- package/dist/chunks/{chunk-E6BYRULL.js → chunk-DK3RPZOQ.js} +1 -1
- package/dist/chunks/{chunk-YPK2CAIZ.js → chunk-DK4UCK7L.js} +1 -1
- package/dist/chunks/chunk-DYLBVUAU.js +4 -0
- package/dist/chunks/chunk-FDC2GRBK.js +27 -0
- package/dist/chunks/chunk-FE7HH5JS.js +18 -0
- package/dist/chunks/chunk-FYD57YRO.js +436 -0
- package/dist/chunks/chunk-G264APQN.js +5 -0
- package/dist/chunks/chunk-G4JYZFEO.js +11 -0
- package/dist/chunks/chunk-GFFM56U2.js +4 -0
- package/dist/chunks/chunk-GOS3P7KS.js +132 -0
- package/dist/chunks/chunk-HVN37UXD.js +4 -0
- package/dist/chunks/chunk-IA6IODY3.js +4 -0
- package/dist/chunks/{chunk-HU6UIDEJ.js → chunk-IGZWZP7Z.js} +1 -1
- package/dist/chunks/{chunk-NR6U3WIZ.js → chunk-IJ7XFQMI.js} +1 -1
- package/dist/chunks/chunk-IMMGYDAB.js +6 -0
- package/dist/chunks/chunk-IOWBF7UK.js +10 -0
- package/dist/chunks/{chunk-HALUQ7ZF.js → chunk-ITGCWQFK.js} +1 -1
- package/dist/chunks/chunk-IVZ7QUEG.js +4 -0
- package/dist/chunks/{chunk-YAEVYJAR.js → chunk-IWY2HIFK.js} +1 -1
- package/dist/chunks/{chunk-KGJZAYQD.js → chunk-J7OBATRN.js} +1 -1
- package/dist/chunks/{chunk-QWAQHHRS.js → chunk-JGUEIW2W.js} +1 -1
- package/dist/chunks/chunk-JKL3AK5D.js +106 -0
- package/dist/chunks/chunk-JZ7U7RUK.js +351 -0
- package/dist/chunks/chunk-KJUQCCB5.js +4 -0
- package/dist/chunks/chunk-KST6OY76.js +10 -0
- package/dist/chunks/chunk-KZSAFVSY.js +129 -0
- package/dist/chunks/chunk-LD2ZSH3M.js +903 -0
- package/dist/chunks/chunk-LE6QPXN6.js +7 -0
- package/dist/chunks/chunk-LEAV3FFG.js +4 -0
- package/dist/chunks/chunk-LIIZI3HY.js +5 -0
- package/dist/chunks/chunk-LP72AF56.js +45 -0
- package/dist/chunks/{chunk-FXDIR3SQ.js → chunk-MJQ2D2OP.js} +1 -1
- package/dist/chunks/{chunk-6LZK4DDH.js → chunk-NHHR4DCF.js} +1 -1
- package/dist/chunks/chunk-NW4GW47L.js +4 -0
- package/dist/chunks/chunk-OALEJ6FG.js +60 -0
- package/dist/chunks/chunk-OIV4DIMB.js +4 -0
- package/dist/chunks/chunk-OJ37ZWBG.js +4 -0
- package/dist/chunks/chunk-OZXMPBUX.js +4 -0
- package/dist/chunks/{chunk-3THJYAEF.js → chunk-PG7452XE.js} +1 -1
- package/dist/chunks/chunk-PJCUB7YJ.js +4 -0
- package/dist/chunks/chunk-PTS3J4DQ.js +6 -0
- package/dist/chunks/{chunk-PXS5SHOV.js → chunk-PVVEEBUU.js} +1 -1
- package/dist/chunks/chunk-Q7BZLPBU.js +8 -0
- package/dist/chunks/{chunk-FOJQXLL2.js → chunk-QC66ZXPP.js} +1 -1
- package/dist/chunks/chunk-QXFWIL4C.js +4 -0
- package/dist/chunks/{chunk-PFMEUFJ7.js → chunk-R2CCD4OF.js} +1 -1
- package/dist/chunks/chunk-R6CGBSTC.js +22 -0
- package/dist/chunks/chunk-RG5GP4RB.js +5 -0
- package/dist/chunks/{chunk-D3NXKK2L.js → chunk-RW2F2QNP.js} +1 -1
- package/dist/chunks/{models-L5VF4I5O-XXNJYQMQ.js → chunk-RWPO3NZ3.js} +1 -1
- package/dist/chunks/chunk-SAJD4EKE.js +10 -0
- package/dist/chunks/chunk-SDUS2H3E.js +4 -0
- package/dist/chunks/chunk-SIHGKM4E.js +4 -0
- package/dist/chunks/chunk-SKHFU5DI.js +4 -0
- package/dist/chunks/{chunk-STUHNKQS.js → chunk-SM45TH22.js} +1 -1
- package/dist/chunks/chunk-T54CZKNJ.js +6 -0
- package/dist/chunks/chunk-TKFFQNAP.js +19 -0
- package/dist/chunks/chunk-TMV2ZDOI.js +18 -0
- package/dist/chunks/chunk-TRXLIL7V.js +4 -0
- package/dist/chunks/{chunk-SUFW24P4.js → chunk-UEEW2R4E.js} +1 -1
- package/dist/chunks/chunk-UHXPRU6G.js +10 -0
- package/dist/chunks/chunk-UPQVWHZ3.js +4 -0
- package/dist/chunks/{chunk-JERCOLY3.js → chunk-V35MFAUQ.js} +4 -6
- package/dist/chunks/chunk-V7K3KNDM.js +4 -0
- package/dist/chunks/chunk-VHX2GHBF.js +4 -0
- package/dist/chunks/chunk-VOAKRJ4R.js +4 -0
- package/dist/chunks/{chunk-X2GYYRVM.js → chunk-VW7TLY3P.js} +1 -1
- package/dist/chunks/chunk-W34AK4SK.js +65 -0
- package/dist/chunks/{chunk-REBNWCKI.js → chunk-WU7RNAZD.js} +1 -1
- package/dist/chunks/chunk-WZC4TDDM.js +6 -0
- package/dist/chunks/chunk-WZYS2HAK.js +4 -0
- package/dist/chunks/chunk-X2TKJ7KR.js +11 -0
- package/dist/chunks/{chunk-H2FP6DG4.js → chunk-X5ND4H4P.js} +1 -1
- package/dist/chunks/{chunk-4U7XXM4W.js → chunk-Y3AOGNDT.js} +1 -1
- package/dist/chunks/chunk-Y6DGVTKM.js +6 -0
- package/dist/chunks/{chunk-KENCMLRE.js → chunk-YAEHSSR4.js} +1 -1
- package/dist/chunks/chunk-YWPBE5LP.js +4 -0
- package/dist/chunks/chunk-ZAVX7G2M.js +15 -0
- package/dist/chunks/chunk-ZD2M73XA.js +19 -0
- package/dist/chunks/chunk-ZD4O6NPV.js +4 -0
- package/dist/chunks/chunk-ZNAMETPQ.js +4 -0
- package/dist/chunks/chunk-ZY6N5LVQ.js +4 -0
- package/dist/chunks/chunk-ZYQ4TDTT.js +81 -0
- package/dist/chunks/cli-VB2N7HEK.js +55 -0
- package/dist/chunks/cloudflare-workers-ai-system-one-YKU742EC.js +4 -0
- package/dist/chunks/context-CI2FKEQE.js +4 -0
- package/dist/chunks/cost-CZRRSIUF.js +5 -0
- package/dist/chunks/dist-QCNQN6DY.js +4 -0
- package/dist/chunks/easter-egg-3d-XR5S2O3T.js +4 -0
- package/dist/chunks/{event-streams-3JSFPOTZ.js → event-streams-AVE4MSS6.js} +1 -1
- package/dist/chunks/{execution-repo-ZLJTBWFC.js → execution-repo-5TLV2NM4.js} +1 -1
- package/dist/chunks/{executions-6ARGR3IO.js → executions-I3UUIGSL.js} +1 -1
- package/dist/chunks/file-Y5G56IUT.js +4 -0
- package/dist/chunks/github-copilot-BRU2SRRZ.js +4 -0
- package/dist/chunks/google-generative-ai-ZF5QEUZV.js +4 -0
- package/dist/chunks/google-vertex-4PJZZI3Y.js +4 -0
- package/dist/chunks/init-A6GY656J.js +4 -0
- package/dist/chunks/{install-cli-4IZCSDFZ.js → install-cli-FALWKQYO.js} +1 -1
- package/dist/chunks/{interaction-ask-G5T3H3CG.js → interaction-ask-O5HGF6CH.js} +1 -1
- package/dist/chunks/{interaction-plan-E5V42MUP.js → interaction-plan-JTVDN3BC.js} +1 -1
- package/dist/chunks/kimi-coding-ZCIBMDZ6.js +4 -0
- package/dist/chunks/{llama-cpp-classify-OTXZWCMW.js → llama-cpp-classify-NRUXAIGQ.js} +3 -3
- package/dist/chunks/local-client-stop-RS4AHNF4.js +4 -0
- package/dist/chunks/{memory-cli-PYOILNN5.js → memory-cli-DIT4DQF3.js} +1 -1
- package/dist/chunks/meta-JQH66YU7.js +4 -0
- package/dist/chunks/mistral-conversations-CXHOECUV.js +7 -0
- package/dist/chunks/model-resolver-GIBPYRKP.js +4 -0
- package/dist/chunks/monitor-Z2HKNY5E.js +4 -0
- package/dist/chunks/{node-PTK2HCDV.js → node-DAO3SX7O.js} +1 -1
- package/dist/chunks/{openai-codex-2REL6UQU.js → openai-codex-JULCKICT.js} +1 -1
- package/dist/chunks/openai-codex-responses-U6DGMGDK.js +12 -0
- package/dist/chunks/openai-completions-PP4XLLOM.js +9 -0
- package/dist/chunks/{openai-decisions-2N6ZRPZC.js → openai-decisions-JU6QQKEM.js} +1 -1
- package/dist/chunks/openai-responses-2SG757TL.js +6 -0
- package/dist/chunks/openrouter-images-32M7YZWC.js +4 -0
- package/dist/chunks/pi-messages-VSINMXN4.js +10 -0
- package/dist/chunks/radius-THYKWV4E.js +4 -0
- package/dist/chunks/remote-ops-2WBEFQ3E.js +14 -0
- package/dist/chunks/runner-5MKMRTIN.js +4 -0
- package/dist/chunks/runtime-DST3H5JP.js +4 -0
- package/dist/chunks/schedule-cli-V7Y2BBVY.js +4 -0
- package/dist/chunks/slack-R7SEJYMY.js +4 -0
- package/dist/chunks/start-ui-http-7K5JOLPU.js +43 -0
- package/dist/chunks/subagent-Z5IQ4L54.js +4 -0
- package/dist/chunks/{time-KEHDQT6K.js → time-P6PE52WL.js} +1 -1
- package/dist/chunks/tool-shims-YCXZWTST.js +4 -0
- package/dist/chunks/typesafe-system-one-M2DABJSZ.js +4 -0
- package/dist/chunks/ui-board-HQIE4RZG.js +5 -0
- package/dist/chunks/ui-decision-YBZDS4YW.js +4 -0
- package/dist/chunks/{ui-file-GVH53O3X.js → ui-file-SRD4ILBS.js} +1 -1
- package/dist/chunks/ui-view-Z25MTZT7.js +4 -0
- package/dist/chunks/virtual-modules-H4DXPJZB.js +4 -0
- package/dist/chunks/waitpoint-M6JZBSLT.js +5 -0
- package/dist/chunks/workers-SQ2R32TK.js +4 -0
- package/dist/client-bundle/client.mjs +273 -93
- package/dist/client-bundle/manifest.json +2 -2
- package/dist/core/pi-sdk.js +1 -1
- package/dist/domain/auth/cc-auth-cli.js +1 -1
- package/dist/domain/mcp/bundled-server.js +1 -1
- package/dist/domain/mcp/feishu/client.js +4 -0
- package/dist/entry/app.js +151 -559
- package/dist/entry/browser-cli.js +10 -10
- package/dist/entry/cli.js +1 -1
- package/dist/entry/cortex-cli.js +1 -1
- package/dist/entry/daemon.js +4 -4
- package/dist/entry/hook-cli.js +2 -2
- package/dist/entry/production-app-bootstrap.js +1 -1
- package/dist/entry/production-evidence-export-cli.js +1 -1
- package/dist/entry/signal-cli.js +2 -2
- package/dist/tui/index.js +41 -41
- package/package.json +3 -3
- package/vendor/pi/CHANGELOG.md +330 -0
- package/vendor/pi/dist/codemode-worker.js +2 -0
- package/vendor/pi/dist/core/export-html/ansi-to-html.js +57 -20
- package/vendor/pi/dist/core/export-html/template.css +9 -0
- package/vendor/pi/dist/core/export-html/template.js +166 -46
- package/vendor/pi/dist/core/export-html/tool-renderer.js +5 -3
- package/vendor/pi/dist/core/extensions/loader.js +1 -1
- package/vendor/pi/dist/extensions/codemode/execute.js +15 -13
- package/vendor/pi/dist/modes/interactive/theme/theme.js +36 -23
- package/vendor/pi/dist/utils/image-resize-worker.js +1 -1
- package/vendor/pi/dist/utils/image-resize.js +1 -1
- package/vendor/pi/docs/cli.md +35 -12
- package/vendor/pi/docs/custom-provider.md +2 -0
- package/vendor/pi/docs/environment-variables.md +2 -0
- package/vendor/pi/docs/extensions.md +3192 -225
- package/vendor/pi/docs/keybindings.md +2 -2
- package/vendor/pi/docs/llama-cpp.md +27 -19
- package/vendor/pi/docs/mcp.md +6 -4
- package/vendor/pi/docs/message-types.md +1 -1
- package/vendor/pi/docs/models-configuration.md +9 -3
- package/vendor/pi/docs/models.md +2 -1
- package/vendor/pi/docs/nvidia-rtx-llama-cpp.md +5 -5
- package/vendor/pi/docs/packages.md +24 -0
- package/vendor/pi/docs/prompt-templates.md +1 -1
- package/vendor/pi/docs/providers.md +4 -2
- package/vendor/pi/docs/quickstart.md +7 -3
- package/vendor/pi/docs/rpc-commands.md +1 -1
- package/vendor/pi/docs/rpc.md +4 -2
- package/vendor/pi/docs/sessions.md +17 -3
- package/vendor/pi/docs/settings.md +6 -5
- package/vendor/pi/docs/slash-commands.md +3 -2
- package/vendor/pi/docs/terminal-setup.md +3 -1
- package/vendor/pi/docs/tmux.md +6 -0
- package/vendor/pi/docs/tui.md +4 -0
- package/vendor/pi/docs/windows.md +27 -0
- package/vendor/pi/examples/extensions/README.md +2 -1
- package/vendor/pi/examples/extensions/custom-provider-anthropic/index.ts +27 -31
- package/vendor/pi/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/vendor/pi/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/vendor/pi/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/vendor/pi/examples/extensions/debug-provider.ts +2 -2
- package/vendor/pi/examples/extensions/gondolin/index.ts +4 -7
- package/vendor/pi/examples/extensions/gondolin/package-lock.json +19 -29
- package/vendor/pi/examples/extensions/gondolin/package.json +2 -2
- package/vendor/pi/examples/extensions/plan-mode/index.ts +23 -13
- package/vendor/pi/examples/extensions/plan-mode/utils.ts +42 -16
- package/vendor/pi/examples/extensions/preset.ts +2 -0
- package/vendor/pi/examples/extensions/reload-runtime.ts +17 -5
- package/vendor/pi/examples/extensions/subagent/README.md +14 -11
- package/vendor/pi/examples/extensions/subagent/index.ts +392 -171
- package/vendor/pi/examples/extensions/todo.ts +7 -0
- package/vendor/pi/examples/extensions/tools.ts +2 -0
- package/vendor/pi/examples/extensions/with-deps/package-lock.json +2 -2
- package/vendor/pi/examples/extensions/with-deps/package.json +1 -1
- package/vendor/pi/examples/tsconfig.json +208 -0
- package/vendor/pi/package.json +15 -16
- package/vendor/pi/schemas/models.schema.json +66 -37
- package/vendor/pi/schemas/settings.schema.json +18 -1
- package/vendor/pi-ai/bedrock.js +1 -1
- package/vendor/pi-ai/oauth-load.js +1 -1
- package/web/dist/assets/{board-math-css-BPXakv_3.js → board-math-css-DKX6FcUS.js} +1 -1
- package/web/dist/assets/index-D11wi0uG.js +540 -0
- package/web/dist/assets/index-JedYumhY.css +1 -0
- package/web/dist/assets/{index-WCm6wwmM.js → index-jl30Gy8P.js} +1 -1
- package/web/dist/assets/pdf-worker-DdZgk2mV.js +57 -0
- package/web/dist/assets/pdf.worker.min-Bz_KHX45.js +55 -0
- package/web/dist/index.html +2 -2
- package/web/dist/theme.css +22 -0
- package/dist/chunks/anthropic-messages-M3SMXACA.js +0 -8
- package/dist/chunks/api-GM53PHIL-GFHEXXE6.js +0 -4
- package/dist/chunks/azure-openai-responses-76YWXHSB.js +0 -4
- package/dist/chunks/bedrock-converse-stream-5UPX4NTQ.js +0 -58
- package/dist/chunks/child-runner-3GHOWGZP.js +0 -4
- package/dist/chunks/chunk-2ZNLUY2U.js +0 -128
- package/dist/chunks/chunk-3F6WW7HR.js +0 -13
- package/dist/chunks/chunk-3OKHUVEM.js +0 -7
- package/dist/chunks/chunk-3YHOCPQU.js +0 -10
- package/dist/chunks/chunk-4EX2JJWB.js +0 -4
- package/dist/chunks/chunk-4LLH5OWM.js +0 -10
- package/dist/chunks/chunk-52T37Y47.js +0 -8
- package/dist/chunks/chunk-7MU2AKNM.js +0 -4
- package/dist/chunks/chunk-AAA3UBIS.js +0 -4
- package/dist/chunks/chunk-ASYQHJVQ.js +0 -9
- package/dist/chunks/chunk-BKHDWCRT.js +0 -79
- package/dist/chunks/chunk-CQLH4UVX.js +0 -4
- package/dist/chunks/chunk-CVC66CFV.js +0 -33
- package/dist/chunks/chunk-D6UA4BZC.js +0 -19
- package/dist/chunks/chunk-DGMNI4AO.js +0 -4
- package/dist/chunks/chunk-DHSA5ACV.js +0 -125
- package/dist/chunks/chunk-DPQPXBTP.js +0 -68
- package/dist/chunks/chunk-DXBSQXJL.js +0 -18
- package/dist/chunks/chunk-E7ZMYIY6.js +0 -30
- package/dist/chunks/chunk-EQITBTJC.js +0 -10
- package/dist/chunks/chunk-EXJA5RIX.js +0 -357
- package/dist/chunks/chunk-FF7UELTU.js +0 -4
- package/dist/chunks/chunk-FH74NME3.js +0 -115
- package/dist/chunks/chunk-FOQ7VLIL.js +0 -17
- package/dist/chunks/chunk-FX6MOGLR.js +0 -11
- package/dist/chunks/chunk-G2V65UBA.js +0 -4
- package/dist/chunks/chunk-HGPBHTVD.js +0 -6
- package/dist/chunks/chunk-J5DVLUKY.js +0 -6
- package/dist/chunks/chunk-JW2HFMTF.js +0 -4
- package/dist/chunks/chunk-KDYEGGMW.js +0 -4
- package/dist/chunks/chunk-KIGMAATV.js +0 -23
- package/dist/chunks/chunk-KIU5FAPY.js +0 -5
- package/dist/chunks/chunk-KIWMQPH7.js +0 -739
- package/dist/chunks/chunk-L6VCIGWS.js +0 -11
- package/dist/chunks/chunk-LACGULCN.js +0 -10
- package/dist/chunks/chunk-LMSQZ6TQ.js +0 -4
- package/dist/chunks/chunk-MEPASGPP.js +0 -6
- package/dist/chunks/chunk-MFAEUHMV.js +0 -28
- package/dist/chunks/chunk-NAA7GF6Q.js +0 -5
- package/dist/chunks/chunk-NKDMKRSB.js +0 -68
- package/dist/chunks/chunk-NKXV32S6.js +0 -4
- package/dist/chunks/chunk-NVX5IPRN.js +0 -4
- package/dist/chunks/chunk-O3JW2F7D.js +0 -8
- package/dist/chunks/chunk-OE4KH3NJ.js +0 -4
- package/dist/chunks/chunk-OISO5JXB.js +0 -4
- package/dist/chunks/chunk-OPYXNSMY.js +0 -4
- package/dist/chunks/chunk-OSEIQ7SS.js +0 -4
- package/dist/chunks/chunk-P52RMIYX.js +0 -6
- package/dist/chunks/chunk-PBJ5MPPX.js +0 -60
- package/dist/chunks/chunk-PZMGBKUR.js +0 -13
- package/dist/chunks/chunk-PZMXHA6X.js +0 -9
- package/dist/chunks/chunk-Q7CE3UIE.js +0 -133
- package/dist/chunks/chunk-QBKCAIJG.js +0 -4
- package/dist/chunks/chunk-QEOFEETJ.js +0 -4
- package/dist/chunks/chunk-QUUEQRIT.js +0 -4
- package/dist/chunks/chunk-RA6HKFBV.js +0 -4
- package/dist/chunks/chunk-REPYBMQS.js +0 -4
- package/dist/chunks/chunk-SKHLZ6XY.js +0 -9
- package/dist/chunks/chunk-TAWLERZA.js +0 -4
- package/dist/chunks/chunk-TWAEABGG.js +0 -52
- package/dist/chunks/chunk-TZFLHVOQ.js +0 -7
- package/dist/chunks/chunk-UD3NMUHR.js +0 -12
- package/dist/chunks/chunk-UNVEZI57.js +0 -4
- package/dist/chunks/chunk-VQUPKMDR.js +0 -4
- package/dist/chunks/chunk-W25TB3PU.js +0 -4
- package/dist/chunks/chunk-W5LGYSPZ.js +0 -4
- package/dist/chunks/chunk-WEZWKMYU.js +0 -4
- package/dist/chunks/chunk-XAJLZR7C.js +0 -28
- package/dist/chunks/chunk-XH6FMP3N.js +0 -71
- package/dist/chunks/chunk-XSRZHN63.js +0 -4
- package/dist/chunks/chunk-Y3GFB5XM.js +0 -8
- package/dist/chunks/chunk-YG7OEPR2.js +0 -6
- package/dist/chunks/chunk-YHIWOGVL.js +0 -4
- package/dist/chunks/chunk-YKKEI5GI.js +0 -4
- package/dist/chunks/chunk-YZSHTWNM.js +0 -92
- package/dist/chunks/chunk-Z4H3VDHI.js +0 -4
- package/dist/chunks/cli-5DBTRMHU.js +0 -53
- package/dist/chunks/client-XOGYH5UR.js +0 -4
- package/dist/chunks/cloudflare-workers-ai-system-one-32JCFHI3.js +0 -4
- package/dist/chunks/config-DJSQI77S-335IXHSM.js +0 -4
- package/dist/chunks/context-VCQH5OB6.js +0 -4
- package/dist/chunks/cost-PGGFI7QJ.js +0 -5
- package/dist/chunks/dist-PUKMZ7GW.js +0 -4
- package/dist/chunks/easter-egg-3d-MO4MOEVF.js +0 -4
- package/dist/chunks/es5-VNTQPCKX.js +0 -4
- package/dist/chunks/file-7BN7RCAY.js +0 -4
- package/dist/chunks/gateway-UCRPMR75.js +0 -36
- package/dist/chunks/github-copilot-HAI2DA62.js +0 -4
- package/dist/chunks/google-generative-ai-2VXWLHWI.js +0 -4
- package/dist/chunks/google-vertex-UA36QP2U.js +0 -4
- package/dist/chunks/init-HA7FAQ73.js +0 -4
- package/dist/chunks/kimi-coding-HMJRKCPA.js +0 -4
- package/dist/chunks/local-client-stop-SQRU7ZZM.js +0 -4
- package/dist/chunks/meta-KY3LNFV2.js +0 -4
- package/dist/chunks/mistral-conversations-34F66L3O.js +0 -7
- package/dist/chunks/model-resolver-N3DTAQ2S.js +0 -4
- package/dist/chunks/openai-codex-responses-ZBVHREB3.js +0 -12
- package/dist/chunks/openai-completions-VVIB26SH.js +0 -9
- package/dist/chunks/openai-responses-735XA2ZX.js +0 -6
- package/dist/chunks/openrouter-images-3IKETHAC.js +0 -4
- package/dist/chunks/pi-messages-I3E4ZFHA.js +0 -10
- package/dist/chunks/radius-HXRZVBDB.js +0 -4
- package/dist/chunks/remote-ops-BALZYKH6.js +0 -14
- package/dist/chunks/runner-PLVZDGHB.js +0 -4
- package/dist/chunks/runtime-6YLTA2ZD.js +0 -4
- package/dist/chunks/schedule-cli-OLASBBYJ.js +0 -4
- package/dist/chunks/slack-WAGSPZUX.js +0 -4
- package/dist/chunks/start-ui-http-QALT7C3P.js +0 -43
- package/dist/chunks/subagent-E3UC7ZHC.js +0 -4
- package/dist/chunks/tool-shims-Q6P6UXVC.js +0 -4
- package/dist/chunks/typesafe-system-one-6ULACYD4.js +0 -4
- package/dist/chunks/ui-board-4GYW6KKW.js +0 -5
- package/dist/chunks/ui-decision-U2FXSEC2.js +0 -4
- package/dist/chunks/ui-view-O7PLANT7.js +0 -4
- package/dist/chunks/virtual-modules-IDC5YKZJ.js +0 -4
- package/dist/chunks/waitpoint-2FGQBIAC.js +0 -5
- package/dist/chunks/workers-XN4PSTH6.js +0 -4
- package/vendor/aistatus/gateway-cli.js +0 -21
- package/vendor/pi/examples/extensions/sandbox/index.ts +0 -321
- package/vendor/pi/examples/extensions/sandbox/package-lock.json +0 -92
- package/vendor/pi/examples/extensions/sandbox/package.json +0 -19
- package/web/dist/assets/index-BHZpFXhc.js +0 -525
- package/web/dist/assets/index-DqWMdMkh.css +0 -1
- package/web/dist/assets/pdf-worker-Hp15W1QJ.js +0 -57
- package/web/dist/assets/pdf.worker.min-DnhTvCwe.js +0 -55
package/web/dist/index.html
CHANGED
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
|
|
18
18
|
rel="stylesheet"
|
|
19
19
|
/>
|
|
20
|
-
<script type="module" crossorigin src="/assets/index-
|
|
21
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
20
|
+
<script type="module" crossorigin src="/assets/index-D11wi0uG.js"></script>
|
|
21
|
+
<link rel="stylesheet" crossorigin href="/assets/index-JedYumhY.css">
|
|
22
22
|
</head>
|
|
23
23
|
<body>
|
|
24
24
|
<div id="root"></div>
|
package/web/dist/theme.css
CHANGED
|
@@ -286,6 +286,18 @@
|
|
|
286
286
|
--m-fail-border: #eed3d0;
|
|
287
287
|
--m-gray: oklch(calc(0.961 + 0.45 * var(--bg-light)) calc(0.0041 * var(--bg-chroma)) var(--bg-hue));
|
|
288
288
|
--m-gray-ink: var(--proto-muted-2);
|
|
289
|
+
|
|
290
|
+
/* Chart categorical palette (Stats page): eight slots in fixed order plus the neutral remainder
|
|
291
|
+
grey. Each theme has its own validated steps; a chart never cycles or derives a ninth hue. */
|
|
292
|
+
--viz-1: #2a78d6;
|
|
293
|
+
--viz-2: #eb6834;
|
|
294
|
+
--viz-3: #1baf7a;
|
|
295
|
+
--viz-4: #eda100;
|
|
296
|
+
--viz-5: #e87ba4;
|
|
297
|
+
--viz-6: #008300;
|
|
298
|
+
--viz-7: #4a3aa7;
|
|
299
|
+
--viz-8: #e34948;
|
|
300
|
+
--viz-other: #b4b6c2;
|
|
289
301
|
}
|
|
290
302
|
|
|
291
303
|
[data-theme='dark'] {
|
|
@@ -466,6 +478,16 @@
|
|
|
466
478
|
--m-fail-border: #4a2e2b;
|
|
467
479
|
--m-gray: oklch(calc(0.288 + 0.45 * var(--bg-light)) calc(0.018 * var(--bg-chroma)) var(--bg-hue));
|
|
468
480
|
--m-gray-ink: var(--proto-muted-2);
|
|
481
|
+
|
|
482
|
+
--viz-1: #3987e5;
|
|
483
|
+
--viz-2: #d95926;
|
|
484
|
+
--viz-3: #199e70;
|
|
485
|
+
--viz-4: #c98500;
|
|
486
|
+
--viz-5: #d55181;
|
|
487
|
+
--viz-6: #008300;
|
|
488
|
+
--viz-7: #9085e9;
|
|
489
|
+
--viz-8: #e66767;
|
|
490
|
+
--viz-other: #5d5f6b;
|
|
469
491
|
}
|
|
470
492
|
|
|
471
493
|
/* ── Glass level ──────────────────────────────────────────────────────────────
|
|
@@ -1,8 +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{d as Z,e as Q,f as X,g as ee,h as te}from"./chunk-KDYEGGMW.js";import{a as ie,b as ae}from"./chunk-BGYR4ID3.js";import{a as se}from"./chunk-23PRJECN.js";import{a as oe,d as re,g as ce,i as le,m as ue,n as pe,o as de}from"./chunk-QBKCAIJG.js";import{J as L,o as K,p as V,s as G,u as E,y as J}from"./chunk-PZMGBKUR.js";import{a as w}from"./chunk-6R73ICDB.js";import{b as z,c as $,d as Y}from"./chunk-SKHLZ6XY.js";import{d as O}from"./chunk-D6VMBA4C.js";import{a as T}from"./chunk-USBJFDJ6.js";import{a as ne}from"./chunk-K4NTZEDJ.js";import{h as N}from"./chunk-6AKUD3CF.js";import"./chunk-OSEIQ7SS.js";import{b as q}from"./chunk-CXT5IR5T.js";import{m as P}from"./chunk-X2GYYRVM.js";import"./chunk-WHC7AYZD.js";function fe(e,o){return e||(w("PI_CACHE_RETENTION",o)==="long"?"long":"short")}function Te(e,o,n){let r=fe(o,n);if(r==="none")return{retention:r};let i=r==="long"&&C(e).supportsLongCacheRetention?"1h":void 0;return{retention:r,cacheControl:{type:"ephemeral",...i&&{ttl:i}}}}var be="2.1.280",we=["Read","Write","Edit","Bash","Grep","Glob","AskUserQuestion","EnterPlanMode","ExitPlanMode","KillShell","NotebookEdit","Skill","Task","TaskOutput","TodoWrite","WebFetch","WebSearch"],ve=new Map(we.map(e=>[e.toLowerCase(),e])),H=e=>ve.get(e.toLowerCase())??e,Ce=(e,o)=>{if(o&&o.length>0){let n=e.toLowerCase(),r=o.find(i=>i.name.toLowerCase()===n);if(r)return r.name}return e};function j(e){return{type:"image",source:{type:"base64",media_type:e.mimeType,data:e.data}}}function Re(e){if(!e.some(i=>i.type==="image"))return T(e.map(i=>i.text).join(`
|
|
5
|
-
`));let n=e.map(i=>i.type==="text"?{type:"text",text:T(i.text)}:j(i));return n.some(i=>i.type==="text")||n.unshift({type:"text",text:"(see attached image)"}),n}var Ee="fine-grained-tool-streaming-2025-05-14",Se="interleaved-thinking-2025-05-14",Ie="server-side-fallback-2026-07-01",Ae="mid-conversation-output-config-2026-07-01",Me="thinking-binding-controls-2026-08-01",Oe="inline-tools-2026-09-15",Ne={name:"__pi_deferred_placeholder__",description:"Reserved placeholder. Never available. Never call this.",input_schema:{type:"object",properties:{},required:[]},defer_loading:!0};function Le(e){return(e.compat?.allowedFallbackModels?.length??0)>0}function C(e){let o=e.provider==="openrouter"||e.baseUrl.includes("openrouter.ai");return{supportsEagerToolInputStreaming:e.compat?.supportsEagerToolInputStreaming??!0,supportsLongCacheRetention:e.compat?.supportsLongCacheRetention??!0,sendSessionAffinityHeaders:e.compat?.sendSessionAffinityHeaders??o,sessionAffinityFormat:e.compat?.sessionAffinityFormat??(o?"openrouter":void 0),supportsCacheControlOnTools:e.compat?.supportsCacheControlOnTools??!0,supportsTemperature:e.compat?.supportsTemperature??!0,allowEmptySignature:e.compat?.allowEmptySignature??!1,supportsStrictTools:e.compat?.supportsStrictTools??!1,supportsMidConvoSystemMessages:e.compat?.supportsMidConvoSystemMessages??!1,supportsMidConvoToolChanges:e.compat?.supportsMidConvoToolChanges??!1}}function D(...e){let o={};for(let n of e)n&&Object.assign(o,n);return o}function B(e,o){if(!e)return!1;let n=o.toLowerCase();for(let[r,i]of Object.entries(e))if(r.toLowerCase()===n&&i!==null&&i.trim().length>0)return!0;return!1}function ge(e,o){return!!e||B(o,"authorization")||B(o,"x-api-key")||B(o,"cf-aig-authorization")}function he(e,o,n){if(!ge(o,n))throw new Error(`No API key for provider: ${e}`)}var v=class extends P{_shouldResolveDefaultCredentials(){return!1}};function me(e,o,n,r){if(e.provider!=="anthropic"||ge(o,n))return;let i=w(Z,r),l=w(Q,r),t=w(ee,r);if(!(!i||!l||!t))return{organization_id:l,workspace_id:w(te,r),authentication:{type:"oidc_federation",federation_rule_id:i,service_account_id:w(X,r),identity_token:{source:"file",path:t}}}}var S,Pe=new Set(["message_start","message_delta","message_stop","content_block_start","content_block_delta","content_block_stop"]);function _e(e){if(!e.event&&e.data.length===0)return null;let o={event:e.event,data:e.data.join(`
|
|
6
|
-
`),raw:[...e.raw]};return e.event=null,e.data=[],e.raw=[],o}function F(e,o){if(e==="")return _e(o);if(o.raw.push(e),e.startsWith(":"))return null;let n=e.indexOf(":"),r=n===-1?e:e.slice(0,n),i=n===-1?"":e.slice(n+1);return i.startsWith(" ")&&(i=i.slice(1)),r==="event"?o.event=i:r==="data"&&o.data.push(i),null}function De(e){let o=e.indexOf("\r"),n=e.indexOf(`
|
|
7
|
-
`);return o===-1?n:n===-1?o:Math.min(o,n)}function I(e){let o=De(e);if(o===-1)return null;let n=o+1;return e[o]==="\r"&&e[n]===`
|
|
8
|
-
`&&(n+=1),{line:e.slice(0,o),rest:e.slice(n)}}async function*Be(e,o){let n=e.getReader(),r=new TextDecoder,i={event:null,data:[],raw:[]},l="";try{for(;;){if(o?.aborted)throw new Error("Request was aborted");let{value:d,done:y}=await n.read();if(y)break;l+=r.decode(d,{stream:!0});let f=I(l);for(;f;){l=f.rest;let p=F(f.line,i);p&&(yield p),f=I(l)}}l+=r.decode();let t=I(l);for(;t;){l=t.rest;let d=F(t.line,i);d&&(yield d),t=I(l)}if(l.length>0){let d=F(l,i);d&&(yield d)}let h=_e(i);h&&(yield h)}finally{n.releaseLock()}}async function*Fe(e,o){if(!e.body)throw new Error("Attempted to iterate over an Anthropic response with no body");let n=!1,r=!1;for await(let i of Be(e.body,o)){if(i.event==="error")throw new Error(i.data);if(Pe.has(i.event??""))try{let l=z(i.data);l.type==="message_start"?n=!0:l.type==="message_stop"&&(r=!0),yield l}catch(l){let t=l instanceof Error?l.message:String(l);throw new Error(`Could not parse Anthropic SSE event ${i.event}: ${t}; data=${i.data}; raw=${i.raw.join("\\n")}`)}}if(n&&!r)throw new Error("Anthropic stream ended before message_stop")}var U=(e,o,n)=>{let r=new q,i=J(o,C(e).supportsMidConvoSystemMessages),l=E(i.messages);return(async()=>{let t={role:"assistant",content:[],api:e.api,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{let h,d,y=e,f;if(n?.client)h=n.client,d=!1;else{let s=n?.apiKey,a=me(e,s,n?.headers,n?.env);a||he(e.provider,s,n?.headers);let c;if(e.provider==="github-copilot"){let R=ie(i.messages);c=ae({messages:i.messages,hasImages:R})}let b=fe(n?.cacheRetention,n?.env)==="none"?void 0:n?.sessionId,k=je(e,s,n?.headers,n?.fetch,c,b,a,n?.identity);h=k.client,d=k.isOAuthToken}let p={...n?.signal?{signal:n.signal}:{},...n?.timeoutMs!==void 0?{timeout:n.timeoutMs}:{},maxRetries:0},g=!1,_;for(;;){n?.signal?.throwIfAborted();let s=qe(e,i,d,n,g);s.providerThinkingLevel&&(t.providerThinkingLevel=s.providerThinkingLevel);let a=s.params,c=await n?.onPayload?.(a,e);c!==void 0&&(a={...c,stream:!0});try{_=await se(()=>h.beta.messages.create(a,p).asResponse(),{maxRetries:n?.maxRetries,maxRetryDelayMs:n?.maxRetryDelayMs,signal:n?.signal});break}catch(m){if(n?.signal?.aborted||g||!s.hasPreferredStrictTools||!(m instanceof P.APIError)||m.status!==400||m.type!=="invalid_request_error"||!["The compiled grammar is too large","Too many strict tools (","Schemas contains too many parameters with union types ("].some(b=>m.message.includes(b)))throw m;g=!0,O(t,{type:"anthropic_strict_tools_fallback",timestamp:Date.now(),error:{message:m.message},details:{reason:"strict_tool_limits_exceeded"}})}}await n?.onResponse?.({status:_.status,headers:ne(_.headers)},e),r.push({type:"start",partial:t});let u=t.content;for await(let s of Fe(_,n?.signal))if(await n?.onProviderStreamEvent?.(s,e),s.type==="message_start"){t.responseId=s.message.id;let a=s.message.input_transformations;Array.isArray(a)&&(f=a);let c=s.message.model;c!==e.id&&(t.responseModel=c);let m=c===e.id?void 0:e.compat?.allowedFallbackModels?.find(b=>b.provider===e.provider&&b.model===c)?.cost;y=m?{...e,id:c,cost:m}:e,t.usage.input=s.message.usage.input_tokens||0,t.usage.output=s.message.usage.output_tokens||0,t.usage.cacheRead=s.message.usage.cache_read_input_tokens||0,t.usage.cacheWrite=s.message.usage.cache_creation_input_tokens||0,t.usage.cacheWrite1h=s.message.usage.cache_creation?.ephemeral_1h_input_tokens||0,t.usage.totalTokens=t.usage.input+t.usage.output+t.usage.cacheRead+t.usage.cacheWrite,L(y,t.usage)}else if(s.type==="content_block_start"){if(s.content_block.type==="fallback"){if(t.content.length>0)throw new Error("Anthropic performed an unsupported mid-output model fallback");continue}if(s.content_block.type==="text"){let a={type:"text",text:s.content_block.text??"",index:s.index};t.content.push(a),r.push({type:"text_start",contentIndex:t.content.length-1,partial:t})}else if(s.content_block.type==="thinking"){let a={type:"thinking",thinking:s.content_block.thinking??"",thinkingSignature:s.content_block.signature??"",index:s.index};t.content.push(a),r.push({type:"thinking_start",contentIndex:t.content.length-1,partial:t})}else if(s.content_block.type==="redacted_thinking"){let a={type:"thinking",thinking:"[Reasoning redacted]",thinkingSignature:s.content_block.data,redacted:!0,index:s.index};t.content.push(a),r.push({type:"thinking_start",contentIndex:t.content.length-1,partial:t})}else if(s.content_block.type==="tool_use"){let a={type:"toolCall",id:s.content_block.id,name:d?Ce(s.content_block.name,l):s.content_block.name,arguments:s.content_block.input??{},partialJson:"",index:s.index};t.content.push(a),r.push({type:"toolcall_start",contentIndex:t.content.length-1,partial:t})}}else if(s.type==="content_block_delta"){if(s.delta.type==="text_delta"){let a=u.findIndex(m=>m.index===s.index),c=u[a];c&&c.type==="text"&&(c.text+=s.delta.text,r.push({type:"text_delta",contentIndex:a,delta:s.delta.text,partial:t}))}else if(s.delta.type==="thinking_delta"){let a=u.findIndex(m=>m.index===s.index),c=u[a];c&&c.type==="thinking"&&(c.thinking+=s.delta.thinking,r.push({type:"thinking_delta",contentIndex:a,delta:s.delta.thinking,partial:t}))}else if(s.delta.type==="input_json_delta"){let a=u.findIndex(m=>m.index===s.index),c=u[a];c&&c.type==="toolCall"&&(c.partialJson+=s.delta.partial_json,c.arguments=Y(c.partialJson),r.push({type:"toolcall_delta",contentIndex:a,delta:s.delta.partial_json,partial:t}))}else if(s.delta.type==="signature_delta"){let a=u.findIndex(m=>m.index===s.index),c=u[a];c&&c.type==="thinking"&&(c.thinkingSignature=c.thinkingSignature||"",c.thinkingSignature+=s.delta.signature)}}else if(s.type==="content_block_stop"){let a=u.findIndex(m=>m.index===s.index),c=u[a];c&&(delete c.index,c.type==="text"?r.push({type:"text_end",contentIndex:a,content:c.text,partial:t}):c.type==="thinking"?r.push({type:"thinking_end",contentIndex:a,content:c.thinking,partial:t}):c.type==="toolCall"&&(Object.assign(c,$(c.partialJson)),delete c.partialJson,r.push({type:"toolcall_end",contentIndex:a,toolCall:c,partial:t})))}else if(s.type==="message_delta"){let a=s.input_transformations;if(Array.isArray(a)&&(f=a),s.delta.stop_reason){t.rawStopReason=s.delta.stop_reason;let c=et(s.delta.stop_reason,s.delta.stop_details);t.stopReason=c.stopReason,c.errorMessage&&(t.errorMessage=c.errorMessage)}if(s.usage){s.usage.input_tokens!=null&&(t.usage.input=s.usage.input_tokens),s.usage.output_tokens!=null&&(t.usage.output=s.usage.output_tokens),s.usage.cache_read_input_tokens!=null&&(t.usage.cacheRead=s.usage.cache_read_input_tokens),s.usage.cache_creation_input_tokens!=null&&(t.usage.cacheWrite=s.usage.cache_creation_input_tokens);let c=s.usage.cache_creation;c?.ephemeral_1h_input_tokens!=null&&(t.usage.cacheWrite1h=c.ephemeral_1h_input_tokens);let m=s.usage.output_tokens_details?.thinking_tokens;m!=null&&(t.usage.reasoning=m)}t.usage.totalTokens=t.usage.input+t.usage.output+t.usage.cacheRead+t.usage.cacheWrite,L(y,t.usage)}if(n?.signal?.aborted)throw new Error("Request was aborted");if(t.stopReason==="pending")throw new Error("Anthropic stream ended without a stop reason");if(t.stopReason==="aborted"||t.stopReason==="error")throw new Error(t.errorMessage||"An unknown error occurred");f&&f.length>0&&O(t,{type:"anthropic_input_transformations",timestamp:Date.now(),details:{transformations:f.map(s=>({type:s.type??void 0,path:s.path??void 0,reason:s.reason??void 0}))}}),r.push({type:"done",reason:t.stopReason,message:t}),r.end()}catch(h){for(let d of t.content)delete d.index,delete d.partialJson;t.stopReason=n?.signal?.aborted?"aborted":"error",t.errorMessage=h instanceof Error?h.message:JSON.stringify(h),r.push({type:"error",reason:t.stopReason,error:t}),r.end()}})(),r};function Ue(e,o){let n=o?e.thinkingLevelMap?.[o]:void 0;if(typeof n=="string")return n;switch(o){case"minimal":case"low":return"low";case"medium":return"medium";case"high":return"high";default:return"high"}}var yt=(e,o,n)=>{me(e,n?.apiKey,n?.headers,n?.env)||he(e.provider,n?.apiKey,n?.headers);let r={...le(e,o,n,n?.apiKey),toolChoice:n?.toolChoice};if(!n?.reasoning)return U(e,o,{...r,thinkingEnabled:!1});if(e.compat?.forceAdaptiveThinking===!0){let t=Ue(e,n.reasoning);return U(e,o,{...r,thinkingEnabled:!0,effort:t})}let i=ue(r.maxTokens,e.maxTokens,n.reasoning,n.thinkingBudgets),l=ce(e,o,i.maxTokens);return U(e,o,{...r,maxTokens:l,thinkingEnabled:!0,thinkingBudgetTokens:Math.min(i.thinkingBudget,Math.max(0,l-1024))})};function He(e){return e.includes("sk-ant-oat")}function je(e,o,n,r,i,l,t,h){if(e.provider==="github-copilot")return{client:new v({apiKey:null,authToken:o??null,baseURL:e.baseUrl,dangerouslyAllowBrowser:!0,fetch:r,defaultHeaders:D(N(e,h),{accept:"application/json","anthropic-dangerous-direct-browser-access":"true"},e.headers,i,n)}),isOAuthToken:!1};if(o&&He(o))return{client:new v({apiKey:null,authToken:o,baseURL:e.baseUrl,dangerouslyAllowBrowser:!0,fetch:r,defaultHeaders:D({accept:"application/json","anthropic-dangerous-direct-browser-access":"true","user-agent":`claude-cli/${be}`,"x-app":"cli"},e.headers,n)}),isOAuthToken:!0};let d=C(e),y={};if(l&&d.sendSessionAffinityHeaders){let g=d.sessionAffinityFormat==="openrouter"?"x-session-id":"x-session-affinity";y[g]=l}let f=D(N(e,h),{accept:"application/json","anthropic-dangerous-direct-browser-access":"true"},y,e.headers,n);if(t){let g=JSON.stringify([e.baseUrl,t]);if(S?.key!==g||S.fetch!==r){let _=new v({apiKey:null,authToken:null,config:t,baseURL:e.baseUrl,dangerouslyAllowBrowser:!0,fetch:r});S={key:g,fetch:r,client:_}}return{client:S.client.withOptions({defaultHeaders:f}),isOAuthToken:!1}}return{client:new v({apiKey:o??null,authToken:null,baseURL:e.baseUrl,dangerouslyAllowBrowser:!0,fetch:r,defaultHeaders:f}),isOAuthToken:!1}}function We(e,o,n,r,i){let l;for(let h of[e.headers,i?.headers])for(let[d,y]of Object.entries(h??{}))d.toLowerCase()==="anthropic-beta"&&(l=y);if(l===null)return[];if(l!==void 0)return[...new Set(l.split(",").map(h=>h.trim()).filter(h=>h.length>0))];let t=[];return n&&t.push("claude-code-20250219","oauth-2025-04-20"),$e(e,o)&&t.push(Ee),e.reasoning&&i?.thinkingEnabled===!0&&(i.interleavedThinking??!0)&&e.compat?.forceAdaptiveThinking!==!0&&t.push(Se),Le(e)&&t.push(Ie),e.compat?.supportsMidConvoEffort===!0&&t.push(Ae,Me),r&&t.push(Oe),[...new Set(t)]}function qe(e,o,n,r,i=!1){let{cacheControl:l}=Te(e,r?.cacheRetention,r?.env),t=C(e),h=G(o.messages),d=h?K(h):"",y=de(o.messages,e,Ke),f=h?y.slice(1):y,p=!1,g=(x,ye)=>{let W=Xe(x,n,t.supportsEagerToolInputStreaming,t.supportsStrictTools,ye,i);return W.some((ke,xe)=>{let M=x[xe].constrainedSampling;return ke.strict===!0&&M&&M.type==="json_schema"&&M.strict==="prefer"})&&(p=!0),W},_=h?.toolsAdded??[],u=t.supportsMidConvoSystemMessages&&t.supportsMidConvoToolChanges&&_.length>0,s=e.reasoning&&r?.thinkingEnabled===!1&&e.thinkingLevelMap?.off!==null,a=e.compat?.supportsMidConvoEffort===!0&&!s,c=Ge(f,n,l,t.allowEmptySignature,a?e.provider:void 0,u?g:void 0),m=r?.effort??"high",b=We(e,o,n,u,r),k={model:e.id,messages:a?ze(c,m):c.messages,max_tokens:r?.maxTokens??e.maxTokens,stream:!0,...b.length>0?{betas:b}:{}};n?(k.system=[{type:"text",text:"You are Claude Code, Anthropic's official CLI for Claude.",...l?{cache_control:l}:{}}],d&&k.system.push({type:"text",text:T(d),...l?{cache_control:l}:{}})):d&&(k.system=[{type:"text",text:T(d),...l?{cache_control:l}:{}}]),r?.temperature!==void 0&&!r?.thinkingEnabled&&e.compat?.supportsMidConvoEffort!==!0&&t.supportsTemperature&&(k.temperature=r.temperature);let R=t.supportsCacheControlOnTools?l:void 0;if(u)k.tools=[...g(_,R),Ne];else{let x=E(o.messages);x.length>0&&(k.tools=g(x,R))}if(s)k.thinking={type:"disabled"};else if(a)k.thinking={type:"adaptive",display:r?.thinkingDisplay??"summarized",block_binding:{prefix_mismatch_behavior:"drop_block"}},k.output_config={effort:"high"};else if(e.reasoning&&r?.thinkingEnabled){let x=r.thinkingDisplay??"summarized";e.compat?.forceAdaptiveThinking===!0?(k.thinking={type:"adaptive",display:x},r.effort&&(k.output_config={effort:r.effort})):k.thinking={type:"enabled",budget_tokens:r.thinkingBudgetTokens||1024,display:x}}if(r?.metadata){let x=r.metadata.user_id;typeof x=="string"&&(k.metadata={user_id:x})}r?.toolChoice&&(typeof r.toolChoice=="string"?k.tool_choice={type:r.toolChoice}:k.tool_choice=r.toolChoice);let A=e.compat?.allowedFallbackModels;return A&&A.length>0&&(k.fallbacks=A.map(x=>({model:x.model}))),{params:k,hasPreferredStrictTools:p,providerThinkingLevel:a?m:void 0}}function Ke(e){return e.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,64)}function Ve(e,o=e.content){return{type:"tool_result",tool_use_id:e.toolCallId,content:Re(o),is_error:e.isError}}function Ge(e,o,n,r=!1,i,l){let t=[],h=new Map,d=[],y=()=>{t.push(...d),d.length=0};for(let f=0;f<e.length;f++){let p=e[f];if(p.role==="system"){let g=V(p),_=[];if(g.length>0&&_.push({type:"text",text:T(g)}),l){let u=p.toolsAdded??[],s=new Set(u.map(a=>a.name));for(let a of p.toolsRemoved??[])s.has(a.name)||_.push({type:"tool_removal",tool:{type:"tool_reference",name:o?H(a.name):a.name}});for(let a of l(u))_.push({type:"tool_addition",tool:{type:"tool_definition",definition:a}})}_.length>0&&d.push({role:"system",content:_})}else if(p.role==="user")if(typeof p.content=="string")p.content.trim().length>0&&t.push({role:"user",content:T(p.content)});else{let _=p.content.map(u=>u.type==="text"?{type:"text",text:T(u.text)}:j(u)).filter(u=>u.type==="text"?u.text.trim().length>0:!0);if(_.length===0)continue;t.push({role:"user",content:_})}else if(p.role==="assistant"){y();let g=[];for(let u of p.content)if(u.type==="text"){if(u.text.trim().length===0)continue;g.push({type:"text",text:T(u.text)})}else if(u.type==="thinking"){if(u.redacted){g.push({type:"redacted_thinking",data:u.thinkingSignature});continue}let s=u.thinkingSignature,a=!!s&&s.trim().length>0;if(u.thinking.trim().length===0&&!a)continue;a?g.push({type:"thinking",thinking:T(u.thinking),signature:s}):g.push(r?{type:"thinking",thinking:T(u.thinking),signature:""}:{type:"text",text:T(u.thinking)})}else u.type==="toolCall"&&g.push({type:"tool_use",id:u.id,name:o?H(u.name):u.name,input:u.arguments??{}});if(g.length===0)continue;let _=t.length;t.push({role:"assistant",content:g}),i!==void 0&&p.api==="anthropic-messages"&&p.provider===i&&Je(p.providerThinkingLevel)&&h.set(_,p.providerThinkingLevel)}else if(p.role==="toolResult"){let g=[],_=[],u=f;for(;u<e.length&&e[u].role==="toolResult";){let s=e[u],a=pe(s);g.push(Ve(s,a?.content)),a&&_.push({type:"text",text:a.caption},...a.images.map(j)),u++}f=u-1,t.push({role:"user",content:[...g,..._]})}}if(y(),n&&t.length>0){let f=t[t.length-1];if(f.role==="user"||f.role==="system")if(Array.isArray(f.content)){let p=f.content[f.content.length-1];p&&(p.type==="text"||p.type==="image"||p.type==="tool_result"||p.type==="tool_addition"||p.type==="tool_removal")&&(p.cache_control=n)}else typeof f.content=="string"&&(f.content=[{type:"text",text:f.content,cache_control:n}])}return{messages:t,assistantLevels:h}}function Je(e){return e==="low"||e==="medium"||e==="high"||e==="xhigh"||e==="max"}function ze(e,o){let n=[];for(let r=0;r<e.messages.length;r++){let i=e.assistantLevels.get(r);i!==void 0&&n.push({role:"system",content:[],output_config:{effort:i}}),n.push(e.messages[r])}return n.push({role:"system",content:[],output_config:{effort:o}}),n}function $e(e,o){return E(o.messages).length>0&&!C(e).supportsEagerToolInputStreaming}var Ye=new Set(["minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","maxItems","uniqueItems","minContains","maxContains","minProperties","maxProperties"]),Ze=new Set(["date-time","time","date","duration","email","hostname","uri","ipv4","ipv6","uuid"]),Qe=(e,o)=>Ye.has(e)?!0:e==="minItems"?o!==0&&o!==1:e==="format"?typeof o!="string"||!Ze.has(o):!1;function Xe(e,o,n,r,i,l=!1){return e?e.map((t,h)=>{let d=t.constrainedSampling,y=l&&d&&d.type==="json_schema"&&d.strict==="prefer"?void 0:re(t,r,Qe),f=oe(t,y),p=f,g={type:"object",properties:p.properties??{},required:p.required??[]},_=y===!0?{...f,...g}:g;return{name:o?H(t.name):t.name,description:t.description,...n?{eager_input_streaming:!0}:{},...y===!0?{strict:!0}:{},input_schema:_,...i&&h===e.length-1?{cache_control:i}:{}}}):[]}function et(e,o){switch(e){case"end_turn":return{stopReason:"stop"};case"max_tokens":return{stopReason:"length"};case"tool_use":return{stopReason:"toolUse"};case"refusal":return{stopReason:"error",errorMessage:o?.explanation||"The model refused to complete the request"};case"pause_turn":return{stopReason:"stop"};case"stop_sequence":return{stopReason:"stop"};case"sensitive":return{stopReason:"error",errorMessage:"Provider stopped with: sensitive"};default:throw new Error(`Unhandled stop reason: ${e}`)}}export{U as stream,yt as streamSimple};
|
|
@@ -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{b as h}from"./chunk-OISO5JXB.js";import{a as u,c as i,d as m}from"./chunk-XSRZHN63.js";import"./chunk-WHC7AYZD.js";var P={anthropic:"anthropic",openai:"openai",google:"google",openrouter:"openrouter",deepseek:"deepseek",mistral:"mistral",mistralai:"mistral",xai:"xai","x-ai":"xai",groq:"groq",together:"together",moonshot:"moonshot",moonshotai:"moonshot",qwen:"qwen"};function n(e){let t=(e??"").trim().toLowerCase();return P[t]??t}function c(e){let t=(e??"").trim();return t.includes("/")?n(t.split("/",1)[0]):null}var y="https://aistatus.cc",A=class{baseUrl;timeoutMs;constructor(e=y,t=3){this.baseUrl=e.replace(/\/+$/,""),this.timeoutMs=t*1e3}async checkProvider(e){let t=await this.get("/api/check",{provider:e});return this.parseCheck(t)}async checkModel(e){let t=await this.get("/api/check",{model:e});return this.parseCheck(t)}async acheckProvider(e){return this.checkProvider(e)}async acheckModel(e){return this.checkModel(e)}async providers(){let e=await this.get("/api/providers");return(Array.isArray(e.providers)?e.providers:[]).map(o=>this.parseProviderStatus(o)).filter(o=>o!==null)}async model(e){try{let t=await this.get(`/api/models/${encodeURIComponent(e)}`);return this.parseModel(t)}catch(t){if(t instanceof u&&t.status===404)return null;throw t}}async searchModels(e){let t=await this.get("/api/models",{q:e});return(Array.isArray(t.models)?t.models:[]).map(s=>this.parseModel(s)).filter(s=>s!==null)}async get(e,t){let o=new URL(`${this.baseUrl}${e}`);if(t)for(let[s,a]of Object.entries(t))a!==void 0&&o.searchParams.set(s,a);return m(o.toString(),{timeoutMs:this.timeoutMs})}parseCheck(e){let t=r(e.model)??null,o=n(r(e.provider)??r(e.slug)??c(t)??"")||"",s=l(r(e.status)??r(e.providerStatus)??f(e.available)),a=Array.isArray(e.alternatives)?e.alternatives.map(p=>E(p)).filter(p=>p!==null):[];return new h({provider:o,status:s,statusDetail:r(e.statusDetail)??r(e.providerStatusDetail)??null,model:t,alternatives:a})}parseProviderStatus(e){return i(e)?{slug:n(r(e.slug)??""),name:r(e.name)??r(e.slug)??"",status:l(r(e.status)),statusDetail:r(e.statusDetail)??null,modelCount:d(e.modelCount)}:null}parseModel(e){if(!i(e))return null;let t=i(e.pricing)?e.pricing:{},o=i(e.provider)?e.provider:{};return{id:r(e.id)??"",name:r(e.name)??"",providerSlug:n(r(o.slug)??c(r(e.id)??"")??""),contextLength:d(e.context_length),modality:r(e.modality)??"text->text",promptPrice:g(t.prompt),completionPrice:g(t.completion)}}};function E(e){if(!i(e))return null;let t=r(e.suggestedModel)??r(e.model)??r(e.id)??"",o=n(r(e.slug)??r(e.provider)??c(t)??"");return{slug:o,name:r(e.name)??o,status:l(r(e.status)??r(e.providerStatus)??f(e.available)),suggestedModel:t}}function f(e){if(e===!0)return"operational";if(e===!1)return"down"}function l(e){switch(e){case"operational":return"operational";case"degraded":return"degraded";case"down":return"down";default:return"unknown"}}function r(e){return typeof e=="string"?e:void 0}function d(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let t=Number(e);return Number.isFinite(t)?t:0}return 0}function g(e){return d(e)}export{A as StatusAPI};
|
|
@@ -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 P,c as C}from"./chunk-ZNZFWSPH.js";import{a as k,b as _,c as x,d as z}from"./chunk-DXBSQXJL.js";import{a as b}from"./chunk-XIECJESP.js";import"./chunk-V3AQJSWR.js";import{b as E}from"./chunk-CVC66CFV.js";import{a as M}from"./chunk-23PRJECN.js";import{a as O,b as I}from"./chunk-FF7UELTU.js";import{f as d,h as S,i as w}from"./chunk-QBKCAIJG.js";import{C as l,F as R,L as T,y as v}from"./chunk-PZMGBKUR.js";import"./chunk-6R73ICDB.js";import"./chunk-SKHLZ6XY.js";import"./chunk-D6VMBA4C.js";import"./chunk-USBJFDJ6.js";import{a as A}from"./chunk-K4NTZEDJ.js";import{h as y}from"./chunk-6AKUD3CF.js";import"./chunk-OSEIQ7SS.js";import{b as h}from"./chunk-CXT5IR5T.js";import"./chunk-WHC7AYZD.js";var N=new Set(["openai","openai-codex","opencode","azure"]),G=16;function D(r){return I(O(r),"Azure OpenAI API error")}var K=(r,a,e)=>{let t=new h,p=v(a,r.compat?.supportsMidConvoSystemMessages);return(async()=>{let n=P(r,e),s={role:"assistant",content:[],api:"azure-openai-responses",provider:r.provider,model:r.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{let i=e?.apiKey;if(!i)throw new Error(`No API key for provider: ${r.provider}`);let c=q(r,i,e),o=d(l(p.messages),r.compat?.supportsOpenAIGrammarTools??!1),m=U(r,p,e,n,o),u=await e?.onPayload?.(m,r);u!==void 0&&(m=u);let f={...e?.signal?{signal:e.signal}:{},...e?.timeoutMs!==void 0?{timeout:e.timeoutMs}:{},maxRetries:0},{data:L,response:g}=await M(()=>c.responses.create(m,f).withResponse(),{maxRetries:e?.maxRetries,maxRetryDelayMs:e?.maxRetryDelayMs,signal:e?.signal});if(await e?.onResponse?.({status:g.status,headers:A(g.headers)},r),t.push({type:"start",partial:s}),await z(L,s,t,r,{onProviderStreamEvent:e?.onProviderStreamEvent,grammarToolInputProperties:o}),e?.signal?.aborted)throw new Error("Request was aborted");if(s.stopReason==="pending")throw new Error("Azure OpenAI Responses stream ended without a stop reason");if(s.stopReason==="aborted"||s.stopReason==="error")throw new Error(s.errorMessage||"An unknown error occurred");t.push({type:"done",reason:s.stopReason,message:s}),t.end()}catch(i){for(let c of s.content)delete c.index,delete c.partialJson,delete c.customInput;s.stopReason=e?.signal?.aborted?"aborted":"error",s.errorMessage=D(i),t.push({type:"error",reason:s.stopReason,error:s}),t.end()}})(),t},re=(r,a,e)=>{let t=e?.apiKey;if(!t)throw new Error(`No API key for provider: ${r.provider}`);let p={...w(r,a,e,t),toolChoice:e?.toolChoice},n=e?.reasoning?T(r,e.reasoning):void 0;return K(r,a,{...p,reasoningEffort:n==="off"?void 0:n})};function q(r,a,e){let t={...y(r,e?.identity),...r.headers};e?.headers&&Object.assign(t,e.headers);let{baseUrl:p,apiVersion:n}=C(r,e);return new E({apiKey:a,apiVersion:n,dangerouslyAllowBrowser:!0,fetch:e?.fetch,defaultHeaders:t,baseURL:p})}function U(r,a,e,t,p=d(l(a.messages),r.compat?.supportsOpenAIGrammarTools??!1)){let n=r.compat?.supportsAdditionalTools??!1,s=r.compat?.supportsToolSearch??!1,i=R(a.messages,k({supportsMidConvoSystemMessages:r.compat?.supportsMidConvoSystemMessages??!1,supportsAdditionalTools:n,supportsToolSearch:s})),c=_(r,a,N,{grammarToolInputProperties:p,supportsMidConvoSystemMessages:r.compat?.supportsMidConvoSystemMessages??!1,supportsAdditionalTools:n,supportsToolSearch:s,toolOptions:{supportsStrictMode:r.compat?.supportsStrictMode??!0,supportsOpenAIGrammarTools:r.compat?.supportsOpenAIGrammarTools??!1}}),o={model:t,input:c,stream:!0,prompt_cache_key:b(e?.sessionId),store:!1};e?.maxTokens&&(o.max_output_tokens=Math.max(e.maxTokens,G)),e?.temperature!==void 0&&(o.temperature=e?.temperature),i.requestTools.length>0&&(o.tools=x(i.requestTools,{supportsStrictMode:r.compat?.supportsStrictMode??!0,supportsOpenAIGrammarTools:r.compat?.supportsOpenAIGrammarTools??!1})),e?.toolChoice!==void 0&&(o.tool_choice=e.toolChoice);let m=e?.reasoningEffort??(e?.reasoningSummary?"medium":void 0);if(r.reasoning)if(m){let f=e?.reasoningEffort?r.thinkingLevelMap?.[e.reasoningEffort]??e.reasoningEffort:m;o.reasoning={effort:f,summary:e?.reasoningSummary||"auto"},o.include=["reasoning.encrypted_content"]}else r.thinkingLevelMap?.off!==null&&(o.reasoning={effort:r.thinkingLevelMap?.off??"none"});let u=S(r,m??"off",e?.samplingParams);return u&&Object.assign(o,u),o}export{K as stream,re as streamSimple};
|