@pasko70/pibo 1.0.0
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/.codex/skills/pi-agent-harness/SKILL.md +319 -0
- package/.codex/skills/pi-agent-harness/agents/openai.yaml +4 -0
- package/README.md +318 -0
- package/context/codex-base-prompt.md +144 -0
- package/context/pibo-compaction-prompt.md +100 -0
- package/context/pibo-system-prompt.md +17 -0
- package/dist/apps/chat/agent-profiles.js +26 -0
- package/dist/apps/chat/agent-store.js +336 -0
- package/dist/apps/chat/event-log.js +307 -0
- package/dist/apps/chat/read-model.js +218 -0
- package/dist/apps/chat/rooms.js +321 -0
- package/dist/apps/chat/session-metadata.js +14 -0
- package/dist/apps/chat/stream.js +122 -0
- package/dist/apps/chat/trace.js +1182 -0
- package/dist/apps/chat/web-app.js +2569 -0
- package/dist/apps/chat-ui/assets/apl-BxEMbctQ.js +1 -0
- package/dist/apps/chat-ui/assets/asciiarmor-eFjeGRuZ.js +1 -0
- package/dist/apps/chat-ui/assets/asn1-Cfx-0pt9.js +1 -0
- package/dist/apps/chat-ui/assets/asterisk-B5BHTsBr.js +1 -0
- package/dist/apps/chat-ui/assets/brainfuck-CAA2xofr.js +1 -0
- package/dist/apps/chat-ui/assets/clike-BoDCOLzN.js +1 -0
- package/dist/apps/chat-ui/assets/clojure-kVFSWX0o.js +1 -0
- package/dist/apps/chat-ui/assets/cmake-BUPAhezI.js +1 -0
- package/dist/apps/chat-ui/assets/cobol-BfgHZgup.js +1 -0
- package/dist/apps/chat-ui/assets/coffeescript-G1Pe_1AZ.js +1 -0
- package/dist/apps/chat-ui/assets/commonlisp-B3N0CjHn.js +1 -0
- package/dist/apps/chat-ui/assets/crystal-C15ndaGM.js +1 -0
- package/dist/apps/chat-ui/assets/css-BqOeyZOV.js +1 -0
- package/dist/apps/chat-ui/assets/cypher-KjIKv-wW.js +1 -0
- package/dist/apps/chat-ui/assets/d-BlT5AEC-.js +1 -0
- package/dist/apps/chat-ui/assets/diff-oF98tbqj.js +1 -0
- package/dist/apps/chat-ui/assets/dist--55mTWk3.js +1 -0
- package/dist/apps/chat-ui/assets/dist-B5rcjVCj.js +1 -0
- package/dist/apps/chat-ui/assets/dist-BPv5MdlL.js +1 -0
- package/dist/apps/chat-ui/assets/dist-BZ39rB1W.js +1 -0
- package/dist/apps/chat-ui/assets/dist-BsedZGJo.js +1 -0
- package/dist/apps/chat-ui/assets/dist-BvO6SpaM.js +9 -0
- package/dist/apps/chat-ui/assets/dist-C5YJOwhH.js +1 -0
- package/dist/apps/chat-ui/assets/dist-C5oXtFSP.js +1 -0
- package/dist/apps/chat-ui/assets/dist-CG_gRSwv.js +23 -0
- package/dist/apps/chat-ui/assets/dist-CKM5j-iy.js +1 -0
- package/dist/apps/chat-ui/assets/dist-CUp9us2q.js +1 -0
- package/dist/apps/chat-ui/assets/dist-CZ9T4Cly.js +1 -0
- package/dist/apps/chat-ui/assets/dist-D4HhiFWB.js +6 -0
- package/dist/apps/chat-ui/assets/dist-DHE-yBLH.js +1 -0
- package/dist/apps/chat-ui/assets/dist-DSKQpPaz.js +1 -0
- package/dist/apps/chat-ui/assets/dist-L1B-KWZO.js +1 -0
- package/dist/apps/chat-ui/assets/dist-SVPsM5Oi.js +13 -0
- package/dist/apps/chat-ui/assets/dist-Zqt9kNG9.js +1 -0
- package/dist/apps/chat-ui/assets/dist-_DPv0-QF.js +1 -0
- package/dist/apps/chat-ui/assets/dist-_oM7g0eh.js +11 -0
- package/dist/apps/chat-ui/assets/dist-laadbMWg.js +1 -0
- package/dist/apps/chat-ui/assets/dist-nFui3f-r.js +2 -0
- package/dist/apps/chat-ui/assets/dist-tGfufz3b.js +1 -0
- package/dist/apps/chat-ui/assets/dockerfile-CUaqzcqp.js +1 -0
- package/dist/apps/chat-ui/assets/dtd-VCA9yr61.js +1 -0
- package/dist/apps/chat-ui/assets/dylan-O-V5Dw5W.js +1 -0
- package/dist/apps/chat-ui/assets/ebnf-SPmdBkvT.js +1 -0
- package/dist/apps/chat-ui/assets/ecl-ChfCttfI.js +1 -0
- package/dist/apps/chat-ui/assets/eiffel-cB9EbjeN.js +1 -0
- package/dist/apps/chat-ui/assets/elm-BTiVflBU.js +1 -0
- package/dist/apps/chat-ui/assets/erlang-egf0TXFm.js +1 -0
- package/dist/apps/chat-ui/assets/factor-C2tAxNob.js +1 -0
- package/dist/apps/chat-ui/assets/fcl-BiCjh1tj.js +1 -0
- package/dist/apps/chat-ui/assets/forth-C4kDGW6u.js +1 -0
- package/dist/apps/chat-ui/assets/fortran-DzkLaPnd.js +1 -0
- package/dist/apps/chat-ui/assets/gas-DMOxskQF.js +1 -0
- package/dist/apps/chat-ui/assets/gherkin-BPxBpp-k.js +1 -0
- package/dist/apps/chat-ui/assets/groovy-CkEnc0ZY.js +1 -0
- package/dist/apps/chat-ui/assets/haskell-Dadpo9-w.js +1 -0
- package/dist/apps/chat-ui/assets/haxe-CDNZL9MW.js +1 -0
- package/dist/apps/chat-ui/assets/http-jy9Zxxt3.js +1 -0
- package/dist/apps/chat-ui/assets/idl-CGSB6iiy.js +1 -0
- package/dist/apps/chat-ui/assets/index-BdcqTugD.js +151 -0
- package/dist/apps/chat-ui/assets/index-Dk-opWl3.css +1 -0
- package/dist/apps/chat-ui/assets/javascript-DSlzRUd8.js +1 -0
- package/dist/apps/chat-ui/assets/julia-DTiF9v6R.js +1 -0
- package/dist/apps/chat-ui/assets/livescript-Ci8Xxna6.js +1 -0
- package/dist/apps/chat-ui/assets/lua-eVxIrt9t.js +1 -0
- package/dist/apps/chat-ui/assets/mathematica-Da3grj36.js +1 -0
- package/dist/apps/chat-ui/assets/mbox-BWBMSafM.js +1 -0
- package/dist/apps/chat-ui/assets/mirc-CtHu9S1B.js +1 -0
- package/dist/apps/chat-ui/assets/mllike-wTFlPWXS.js +1 -0
- package/dist/apps/chat-ui/assets/modelica-cKbQ0UXu.js +1 -0
- package/dist/apps/chat-ui/assets/mscgen-C5pXQCMK.js +1 -0
- package/dist/apps/chat-ui/assets/mumps-CKBHkOQq.js +1 -0
- package/dist/apps/chat-ui/assets/nginx-B00AiQel.js +1 -0
- package/dist/apps/chat-ui/assets/nsis-SMDwKltR.js +1 -0
- package/dist/apps/chat-ui/assets/ntriples-B_36EBV0.js +1 -0
- package/dist/apps/chat-ui/assets/octave-BXPjzAif.js +1 -0
- package/dist/apps/chat-ui/assets/oz-Dedpat1M.js +1 -0
- package/dist/apps/chat-ui/assets/pascal-CMcUg72K.js +1 -0
- package/dist/apps/chat-ui/assets/perl-DoVTbnzt.js +1 -0
- package/dist/apps/chat-ui/assets/pig-CULXT1YV.js +1 -0
- package/dist/apps/chat-ui/assets/powershell-Cv5Uhf6b.js +1 -0
- package/dist/apps/chat-ui/assets/properties-CQ1C2P-M.js +1 -0
- package/dist/apps/chat-ui/assets/protobuf-SRlvzrl6.js +1 -0
- package/dist/apps/chat-ui/assets/pug-Bo3wfL-f.js +1 -0
- package/dist/apps/chat-ui/assets/puppet-ClSqCGj6.js +1 -0
- package/dist/apps/chat-ui/assets/python-C2_X1GpX.js +1 -0
- package/dist/apps/chat-ui/assets/q-B_6Gdyzl.js +1 -0
- package/dist/apps/chat-ui/assets/r-BD07NGED.js +1 -0
- package/dist/apps/chat-ui/assets/rolldown-runtime-S-ySWqyJ.js +1 -0
- package/dist/apps/chat-ui/assets/rpm-CRu5Z2Jl.js +1 -0
- package/dist/apps/chat-ui/assets/ruby-dZPnOz8h.js +1 -0
- package/dist/apps/chat-ui/assets/sas-S2t8_sDI.js +1 -0
- package/dist/apps/chat-ui/assets/scheme-WcyFWLW2.js +1 -0
- package/dist/apps/chat-ui/assets/shell-DUelnYSh.js +1 -0
- package/dist/apps/chat-ui/assets/sieve-jDjlVhNh.js +1 -0
- package/dist/apps/chat-ui/assets/simple-mode-CL04yRVp.js +1 -0
- package/dist/apps/chat-ui/assets/smalltalk-ddWDYy10.js +1 -0
- package/dist/apps/chat-ui/assets/solr-C7rQhLuW.js +1 -0
- package/dist/apps/chat-ui/assets/sparql--fPCCgVd.js +1 -0
- package/dist/apps/chat-ui/assets/spreadsheet-DjthqD5G.js +1 -0
- package/dist/apps/chat-ui/assets/sql-D_dieYbr.js +1 -0
- package/dist/apps/chat-ui/assets/stex-rHcFYcA0.js +1 -0
- package/dist/apps/chat-ui/assets/stylus-DxF70RNr.js +1 -0
- package/dist/apps/chat-ui/assets/swift-T0hDoOb-.js +1 -0
- package/dist/apps/chat-ui/assets/tcl-Dlzy1mPk.js +1 -0
- package/dist/apps/chat-ui/assets/textile-Dy5rFZe5.js +1 -0
- package/dist/apps/chat-ui/assets/tiddlywiki-DQP1OymS.js +1 -0
- package/dist/apps/chat-ui/assets/tiki-0vOj3DB2.js +1 -0
- package/dist/apps/chat-ui/assets/toml-DEltN0lI.js +1 -0
- package/dist/apps/chat-ui/assets/troff-CRbBpEqY.js +1 -0
- package/dist/apps/chat-ui/assets/ttcn-M5q1nLKg.js +1 -0
- package/dist/apps/chat-ui/assets/ttcn-cfg-Rmw9NWq9.js +1 -0
- package/dist/apps/chat-ui/assets/turtle-BCDWhJK0.js +1 -0
- package/dist/apps/chat-ui/assets/vb-QQ7LGlOz.js +1 -0
- package/dist/apps/chat-ui/assets/vbscript-BiSEdUzz.js +1 -0
- package/dist/apps/chat-ui/assets/velocity-CzMg5_6w.js +1 -0
- package/dist/apps/chat-ui/assets/verilog-BJOO83gk.js +1 -0
- package/dist/apps/chat-ui/assets/vhdl-ed4zAZAA.js +1 -0
- package/dist/apps/chat-ui/assets/webidl-Ddy6hbV6.js +1 -0
- package/dist/apps/chat-ui/assets/xquery-Bw1zwhh6.js +1 -0
- package/dist/apps/chat-ui/assets/yacas-DZdTXy3s.js +1 -0
- package/dist/apps/chat-ui/assets/z80-DMG02_YV.js +1 -0
- package/dist/apps/chat-ui/index.html +15 -0
- package/dist/apps/context-files-ui/assets/apl-14BqhLYK.js +1 -0
- package/dist/apps/context-files-ui/assets/asciiarmor-WLvjqI7d.js +1 -0
- package/dist/apps/context-files-ui/assets/asn1-Bg4FbdCg.js +1 -0
- package/dist/apps/context-files-ui/assets/asterisk-B2MO-X4d.js +1 -0
- package/dist/apps/context-files-ui/assets/brainfuck-CV9kufud.js +1 -0
- package/dist/apps/context-files-ui/assets/clike-CjmcUpt6.js +1 -0
- package/dist/apps/context-files-ui/assets/clojure-De3QGfx6.js +1 -0
- package/dist/apps/context-files-ui/assets/cmake-i2VDNaRq.js +1 -0
- package/dist/apps/context-files-ui/assets/cobol-BwO6DF08.js +1 -0
- package/dist/apps/context-files-ui/assets/coffeescript-BtivDvRz.js +1 -0
- package/dist/apps/context-files-ui/assets/commonlisp-DFkEQdLP.js +1 -0
- package/dist/apps/context-files-ui/assets/crystal-CU0NkcVL.js +1 -0
- package/dist/apps/context-files-ui/assets/css-CbMZAQ1W.js +1 -0
- package/dist/apps/context-files-ui/assets/cypher-Dke5QOzv.js +1 -0
- package/dist/apps/context-files-ui/assets/d-TPqSVaHM.js +1 -0
- package/dist/apps/context-files-ui/assets/diff-B365LSoZ.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-B5PTVnox.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-B5ZAfwf5.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-BJW3917N.js +11 -0
- package/dist/apps/context-files-ui/assets/dist-BkUONE3N.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-CKQF1zEu.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-CwbH_3RN.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-CxRLRmMx.js +2 -0
- package/dist/apps/context-files-ui/assets/dist-D1KyNDg5.js +13 -0
- package/dist/apps/context-files-ui/assets/dist-DFi2YGux.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-DKoyMSNr.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-DLMjd26T.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-DQXzt2Ng.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-DotDq_kD.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-DyfSeBMu.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-MyZgX9K2.js +9 -0
- package/dist/apps/context-files-ui/assets/dist-QQuDy4KA.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-YwR9dpb-.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-dTBsFYAl.js +1 -0
- package/dist/apps/context-files-ui/assets/dockerfile-CJb2sekW.js +1 -0
- package/dist/apps/context-files-ui/assets/dtd-CBMymJ7O.js +1 -0
- package/dist/apps/context-files-ui/assets/dylan-08Azy1NK.js +1 -0
- package/dist/apps/context-files-ui/assets/ebnf-Dkum_1J8.js +1 -0
- package/dist/apps/context-files-ui/assets/ecl-dhxjHL8y.js +1 -0
- package/dist/apps/context-files-ui/assets/eiffel-C446m6dI.js +1 -0
- package/dist/apps/context-files-ui/assets/elm-po1E9de0.js +1 -0
- package/dist/apps/context-files-ui/assets/erlang-BD5LkVkR.js +1 -0
- package/dist/apps/context-files-ui/assets/factor-B2EMQZkP.js +1 -0
- package/dist/apps/context-files-ui/assets/fcl-DkEOamHd.js +1 -0
- package/dist/apps/context-files-ui/assets/forth-dCg2_HVB.js +1 -0
- package/dist/apps/context-files-ui/assets/fortran-3ZpXLFh1.js +1 -0
- package/dist/apps/context-files-ui/assets/gas-DMmxLZRI.js +1 -0
- package/dist/apps/context-files-ui/assets/gherkin-DUSFg2R6.js +1 -0
- package/dist/apps/context-files-ui/assets/groovy-Cmduloe1.js +1 -0
- package/dist/apps/context-files-ui/assets/haskell-Cyr255R9.js +1 -0
- package/dist/apps/context-files-ui/assets/haxe-BJVKtprM.js +1 -0
- package/dist/apps/context-files-ui/assets/http-DszHFpc-.js +1 -0
- package/dist/apps/context-files-ui/assets/idl-Cati9Nrv.js +1 -0
- package/dist/apps/context-files-ui/assets/index-BwRDoHMC.css +1 -0
- package/dist/apps/context-files-ui/assets/index-GwvjXytt.js +202 -0
- package/dist/apps/context-files-ui/assets/javascript-C5pDVaoP.js +1 -0
- package/dist/apps/context-files-ui/assets/julia-DlqY1cTU.js +1 -0
- package/dist/apps/context-files-ui/assets/livescript-C6p8-2W1.js +1 -0
- package/dist/apps/context-files-ui/assets/lua-BxuTHaF7.js +1 -0
- package/dist/apps/context-files-ui/assets/mathematica-nDHZUMJT.js +1 -0
- package/dist/apps/context-files-ui/assets/mbox-DAaR0Hcz.js +1 -0
- package/dist/apps/context-files-ui/assets/mirc-CCA0FRfl.js +1 -0
- package/dist/apps/context-files-ui/assets/mllike-Cw3Iccsb.js +1 -0
- package/dist/apps/context-files-ui/assets/modelica-Czx80fNR.js +1 -0
- package/dist/apps/context-files-ui/assets/mscgen-BmfuTbzG.js +1 -0
- package/dist/apps/context-files-ui/assets/mumps-Ds_ZaumL.js +1 -0
- package/dist/apps/context-files-ui/assets/nginx-D9M2PQ4U.js +1 -0
- package/dist/apps/context-files-ui/assets/nsis-DOo3SJmd.js +1 -0
- package/dist/apps/context-files-ui/assets/ntriples-DLHGTvHs.js +1 -0
- package/dist/apps/context-files-ui/assets/octave-8jj96JiC.js +1 -0
- package/dist/apps/context-files-ui/assets/oz-BmMq7iC4.js +1 -0
- package/dist/apps/context-files-ui/assets/pascal-BgMr6XpT.js +1 -0
- package/dist/apps/context-files-ui/assets/perl-D6YJObi_.js +1 -0
- package/dist/apps/context-files-ui/assets/pig-nx7uchs8.js +1 -0
- package/dist/apps/context-files-ui/assets/powershell-B4IPkVxR.js +1 -0
- package/dist/apps/context-files-ui/assets/properties-CoavQdLC.js +1 -0
- package/dist/apps/context-files-ui/assets/protobuf-D5EWhcmc.js +1 -0
- package/dist/apps/context-files-ui/assets/pug-QU72BPAa.js +1 -0
- package/dist/apps/context-files-ui/assets/puppet-B_0GFuyD.js +1 -0
- package/dist/apps/context-files-ui/assets/python-Cs7sNzy_.js +1 -0
- package/dist/apps/context-files-ui/assets/q-BIB9pPtI.js +1 -0
- package/dist/apps/context-files-ui/assets/r-CN5s4f3o.js +1 -0
- package/dist/apps/context-files-ui/assets/rpm-Ct_Ck8mQ.js +1 -0
- package/dist/apps/context-files-ui/assets/ruby-BVPradRk.js +1 -0
- package/dist/apps/context-files-ui/assets/sas-DN4j74IF.js +1 -0
- package/dist/apps/context-files-ui/assets/scheme-CvNgHAnh.js +1 -0
- package/dist/apps/context-files-ui/assets/shell-BjiMLAaM.js +1 -0
- package/dist/apps/context-files-ui/assets/sieve-C2U1O5Z4.js +1 -0
- package/dist/apps/context-files-ui/assets/simple-mode-DnMbQuKW.js +1 -0
- package/dist/apps/context-files-ui/assets/smalltalk-DkYwYufV.js +1 -0
- package/dist/apps/context-files-ui/assets/solr-BopnSD-v.js +1 -0
- package/dist/apps/context-files-ui/assets/sparql-Cpg3YQfd.js +1 -0
- package/dist/apps/context-files-ui/assets/spreadsheet-kRxtVt9J.js +1 -0
- package/dist/apps/context-files-ui/assets/sql-DYI2GwJR.js +1 -0
- package/dist/apps/context-files-ui/assets/stex-BCRT8IJ3.js +1 -0
- package/dist/apps/context-files-ui/assets/stylus-CARoeVE9.js +1 -0
- package/dist/apps/context-files-ui/assets/swift-DKNaLAK6.js +1 -0
- package/dist/apps/context-files-ui/assets/tcl-CQyXkgMH.js +1 -0
- package/dist/apps/context-files-ui/assets/textile-Yg_UWn-t.js +1 -0
- package/dist/apps/context-files-ui/assets/tiddlywiki-dqVbkfX4.js +1 -0
- package/dist/apps/context-files-ui/assets/tiki-CC_ic8g0.js +1 -0
- package/dist/apps/context-files-ui/assets/toml-B7gGzVkJ.js +1 -0
- package/dist/apps/context-files-ui/assets/troff-Bq3z6oAu.js +1 -0
- package/dist/apps/context-files-ui/assets/ttcn-GvRgs2AT.js +1 -0
- package/dist/apps/context-files-ui/assets/ttcn-cfg-CGCXz7Vo.js +1 -0
- package/dist/apps/context-files-ui/assets/turtle-CwIpz2yy.js +1 -0
- package/dist/apps/context-files-ui/assets/vb-BmcHUM2C.js +1 -0
- package/dist/apps/context-files-ui/assets/vbscript-Cs9dylre.js +1 -0
- package/dist/apps/context-files-ui/assets/velocity-CBWU0VCy.js +1 -0
- package/dist/apps/context-files-ui/assets/verilog-DVCHmufx.js +1 -0
- package/dist/apps/context-files-ui/assets/vhdl-BGDk4f1d.js +1 -0
- package/dist/apps/context-files-ui/assets/webidl-egXQEWlC.js +1 -0
- package/dist/apps/context-files-ui/assets/xquery-5f0hn7cg.js +1 -0
- package/dist/apps/context-files-ui/assets/yacas-DNs9XkmQ.js +1 -0
- package/dist/apps/context-files-ui/assets/z80-B7Dfb4UO.js +1 -0
- package/dist/apps/context-files-ui/index.html +14 -0
- package/dist/auth/better-auth.js +129 -0
- package/dist/auth/types.js +14 -0
- package/dist/bin/pibo.js +3 -0
- package/dist/channels/types.js +1 -0
- package/dist/cli-errors.js +18 -0
- package/dist/cli.js +264 -0
- package/dist/config/config.js +167 -0
- package/dist/core/base-prompt.js +104 -0
- package/dist/core/codex-compat.js +44 -0
- package/dist/core/compaction-prompt.js +258 -0
- package/dist/core/events.js +1 -0
- package/dist/core/profiles.js +138 -0
- package/dist/core/routed-session.js +538 -0
- package/dist/core/runtime.js +323 -0
- package/dist/core/session-router.js +437 -0
- package/dist/core/system-prompt-template.js +56 -0
- package/dist/core/thinking.js +9 -0
- package/dist/core/workspace.js +5 -0
- package/dist/debug/events.js +92 -0
- package/dist/debug/index.js +631 -0
- package/dist/debug/session.js +200 -0
- package/dist/debug/sql.js +238 -0
- package/dist/debug/stores.js +49 -0
- package/dist/debug/trace.js +245 -0
- package/dist/env.js +32 -0
- package/dist/gateway/client.js +200 -0
- package/dist/gateway/protocol.js +46 -0
- package/dist/gateway/request.js +146 -0
- package/dist/gateway/server.js +221 -0
- package/dist/gateway/tool.js +69 -0
- package/dist/gateway/web.js +80 -0
- package/dist/index.js +23 -0
- package/dist/local/client.js +77 -0
- package/dist/local/extension.js +548 -0
- package/dist/local/tui.js +25 -0
- package/dist/mcp/agent-context.js +123 -0
- package/dist/mcp/client.js +332 -0
- package/dist/mcp/commands/call.js +146 -0
- package/dist/mcp/commands/grep.js +145 -0
- package/dist/mcp/commands/info.js +71 -0
- package/dist/mcp/commands/list.js +94 -0
- package/dist/mcp/config-command.js +217 -0
- package/dist/mcp/config.js +440 -0
- package/dist/mcp/daemon-client.js +266 -0
- package/dist/mcp/daemon.js +327 -0
- package/dist/mcp/errors.js +287 -0
- package/dist/mcp/index.js +431 -0
- package/dist/mcp/output.js +171 -0
- package/dist/mcp/python-runtime.js +131 -0
- package/dist/mcp/registry.js +116 -0
- package/dist/mcp/version.js +5 -0
- package/dist/pi-packages/cli.js +92 -0
- package/dist/pi-packages/installer.js +70 -0
- package/dist/pi-packages/metadata.js +231 -0
- package/dist/pi-packages/runtime.js +61 -0
- package/dist/pi-packages/store.js +175 -0
- package/dist/pi-packages/types.js +1 -0
- package/dist/plugins/better-auth.js +11 -0
- package/dist/plugins/builtin.js +249 -0
- package/dist/plugins/chat-web.js +11 -0
- package/dist/plugins/codex-compat.js +72 -0
- package/dist/plugins/context-files-store.js +354 -0
- package/dist/plugins/context-files.js +999 -0
- package/dist/plugins/core-tools.js +94 -0
- package/dist/plugins/example.js +67 -0
- package/dist/plugins/registry.js +368 -0
- package/dist/plugins/remote-agent.js +9 -0
- package/dist/plugins/types.js +1 -0
- package/dist/plugins/web.js +11 -0
- package/dist/reliability/store.js +759 -0
- package/dist/remote/channel.js +176 -0
- package/dist/remote/client.js +92 -0
- package/dist/remote/examples/tui-controller.js +263 -0
- package/dist/remote/protocol.js +55 -0
- package/dist/remote/session-client.js +189 -0
- package/dist/runs/registry.js +323 -0
- package/dist/runs/tools.js +185 -0
- package/dist/sessions/bindings.js +41 -0
- package/dist/sessions/sqlite-store.js +154 -0
- package/dist/sessions/store.js +125 -0
- package/dist/shared/trace-order.js +83 -0
- package/dist/subagents/tool.js +63 -0
- package/dist/tools/browser-use-cdp.js +207 -0
- package/dist/tools/browser-use-leases.js +338 -0
- package/dist/tools/browser-use-wrapper.js +338 -0
- package/dist/tools/codex-compat.js +85 -0
- package/dist/tools/desktop-env.js +90 -0
- package/dist/tools/guides.js +276 -0
- package/dist/tools/index.js +366 -0
- package/dist/tools/python-runtime.js +154 -0
- package/dist/tools/registry.js +107 -0
- package/dist/tools/web-search.js +137 -0
- package/dist/web/auth.js +10 -0
- package/dist/web/channel.js +151 -0
- package/dist/web/http.js +110 -0
- package/dist/web/types.js +1 -0
- package/package.json +74 -0
- package/src/mcp/LICENSE.mcp-cli +21 -0
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, statSync } from "node:fs";
|
|
3
|
+
import { dirname, resolve } from "node:path";
|
|
4
|
+
import { DatabaseSync } from "node:sqlite";
|
|
5
|
+
function readLegacyManagedStore(storePath) {
|
|
6
|
+
if (!existsSync(storePath))
|
|
7
|
+
return { files: [] };
|
|
8
|
+
const parsed = JSON.parse(readFileSync(storePath, "utf8"));
|
|
9
|
+
if (!Array.isArray(parsed.files))
|
|
10
|
+
return { files: [] };
|
|
11
|
+
return {
|
|
12
|
+
files: parsed.files.flatMap((file) => {
|
|
13
|
+
if (!file || typeof file !== "object")
|
|
14
|
+
return [];
|
|
15
|
+
const candidate = file;
|
|
16
|
+
if (typeof candidate.key !== "string" || typeof candidate.path !== "string")
|
|
17
|
+
return [];
|
|
18
|
+
const label = typeof candidate.label === "string" && candidate.label.trim() ? candidate.label.trim() : candidate.key;
|
|
19
|
+
const scope = candidate.scope === "agent" ? "agent" : "global";
|
|
20
|
+
const agentProfileName = scope === "agent" && typeof candidate.agentProfileName === "string"
|
|
21
|
+
? candidate.agentProfileName
|
|
22
|
+
: undefined;
|
|
23
|
+
if (scope === "agent" && !agentProfileName)
|
|
24
|
+
return [];
|
|
25
|
+
return [{
|
|
26
|
+
key: candidate.key,
|
|
27
|
+
label,
|
|
28
|
+
path: candidate.path,
|
|
29
|
+
scope,
|
|
30
|
+
...(agentProfileName ? { agentProfileName } : {}),
|
|
31
|
+
}];
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function fileRowToRecord(row) {
|
|
36
|
+
return {
|
|
37
|
+
key: row.key,
|
|
38
|
+
label: row.label,
|
|
39
|
+
managedPath: row.managed_path,
|
|
40
|
+
scope: row.scope,
|
|
41
|
+
sourceType: row.source_type,
|
|
42
|
+
...(row.agent_profile_name ? { agentProfileName: row.agent_profile_name } : {}),
|
|
43
|
+
...(row.active_revision_id ? { activeRevisionId: row.active_revision_id } : {}),
|
|
44
|
+
...(row.source_ref ? { sourceRef: row.source_ref } : {}),
|
|
45
|
+
...(row.source_hash ? { sourceHash: row.source_hash } : {}),
|
|
46
|
+
createdAt: row.created_at,
|
|
47
|
+
updatedAt: row.updated_at,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function revisionRowToRecord(row) {
|
|
51
|
+
return {
|
|
52
|
+
id: row.id,
|
|
53
|
+
contextFileKey: row.context_file_key,
|
|
54
|
+
kind: row.kind,
|
|
55
|
+
contentHash: row.content_hash,
|
|
56
|
+
content: row.content,
|
|
57
|
+
createdAt: row.created_at,
|
|
58
|
+
...(row.actor_id ? { actorId: row.actor_id } : {}),
|
|
59
|
+
...(row.based_on_revision_id ? { basedOnRevisionId: row.based_on_revision_id } : {}),
|
|
60
|
+
...(row.source_hash_at_creation ? { sourceHashAtCreation: row.source_hash_at_creation } : {}),
|
|
61
|
+
...(row.note ? { note: row.note } : {}),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export class ContextFileMetadataStore {
|
|
65
|
+
legacyStorePath;
|
|
66
|
+
db;
|
|
67
|
+
constructor(path, legacyStorePath) {
|
|
68
|
+
this.legacyStorePath = legacyStorePath;
|
|
69
|
+
const resolvedPath = resolve(path);
|
|
70
|
+
mkdirSync(dirname(resolvedPath), { recursive: true });
|
|
71
|
+
this.db = new DatabaseSync(resolvedPath);
|
|
72
|
+
this.db.exec("PRAGMA busy_timeout = 5000");
|
|
73
|
+
this.db.exec("PRAGMA journal_mode = WAL");
|
|
74
|
+
this.db.exec(`
|
|
75
|
+
CREATE TABLE IF NOT EXISTS context_files (
|
|
76
|
+
key TEXT PRIMARY KEY,
|
|
77
|
+
label TEXT NOT NULL,
|
|
78
|
+
managed_path TEXT NOT NULL,
|
|
79
|
+
scope TEXT NOT NULL,
|
|
80
|
+
source_type TEXT NOT NULL,
|
|
81
|
+
agent_profile_name TEXT,
|
|
82
|
+
active_revision_id TEXT,
|
|
83
|
+
source_ref TEXT,
|
|
84
|
+
source_hash TEXT,
|
|
85
|
+
created_at TEXT NOT NULL,
|
|
86
|
+
updated_at TEXT NOT NULL
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
CREATE INDEX IF NOT EXISTS idx_context_files_scope
|
|
90
|
+
ON context_files(scope, updated_at);
|
|
91
|
+
|
|
92
|
+
CREATE TABLE IF NOT EXISTS context_file_revisions (
|
|
93
|
+
id TEXT PRIMARY KEY,
|
|
94
|
+
context_file_key TEXT NOT NULL,
|
|
95
|
+
kind TEXT NOT NULL,
|
|
96
|
+
content_hash TEXT NOT NULL,
|
|
97
|
+
content TEXT NOT NULL,
|
|
98
|
+
created_at TEXT NOT NULL,
|
|
99
|
+
actor_id TEXT,
|
|
100
|
+
based_on_revision_id TEXT,
|
|
101
|
+
source_hash_at_creation TEXT,
|
|
102
|
+
note TEXT
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
CREATE INDEX IF NOT EXISTS idx_context_file_revisions_key
|
|
106
|
+
ON context_file_revisions(context_file_key, created_at DESC);
|
|
107
|
+
`);
|
|
108
|
+
this.migrateLegacyStore();
|
|
109
|
+
}
|
|
110
|
+
listFiles() {
|
|
111
|
+
const rows = this.db.prepare("SELECT * FROM context_files ORDER BY updated_at DESC").all();
|
|
112
|
+
return rows.map(fileRowToRecord);
|
|
113
|
+
}
|
|
114
|
+
getFile(key) {
|
|
115
|
+
const row = this.db.prepare("SELECT * FROM context_files WHERE key = ?").get(key);
|
|
116
|
+
return row ? fileRowToRecord(row) : undefined;
|
|
117
|
+
}
|
|
118
|
+
createFile(input) {
|
|
119
|
+
const createdAt = input.createdAt ?? new Date().toISOString();
|
|
120
|
+
const updatedAt = input.updatedAt ?? createdAt;
|
|
121
|
+
this.db
|
|
122
|
+
.prepare(`
|
|
123
|
+
INSERT INTO context_files (
|
|
124
|
+
key,
|
|
125
|
+
label,
|
|
126
|
+
managed_path,
|
|
127
|
+
scope,
|
|
128
|
+
source_type,
|
|
129
|
+
agent_profile_name,
|
|
130
|
+
active_revision_id,
|
|
131
|
+
source_ref,
|
|
132
|
+
source_hash,
|
|
133
|
+
created_at,
|
|
134
|
+
updated_at
|
|
135
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
136
|
+
`)
|
|
137
|
+
.run(input.key, input.label, input.managedPath, input.scope, "managed", input.agentProfileName ?? null, null, input.sourceRef ?? null, input.sourceHash ?? null, createdAt, updatedAt);
|
|
138
|
+
const record = this.getFile(input.key);
|
|
139
|
+
if (!record)
|
|
140
|
+
throw new Error(`Failed to create context file record "${input.key}"`);
|
|
141
|
+
return record;
|
|
142
|
+
}
|
|
143
|
+
updateFile(input) {
|
|
144
|
+
this.db
|
|
145
|
+
.prepare(`
|
|
146
|
+
UPDATE context_files SET
|
|
147
|
+
label = ?,
|
|
148
|
+
managed_path = ?,
|
|
149
|
+
scope = ?,
|
|
150
|
+
source_type = ?,
|
|
151
|
+
agent_profile_name = ?,
|
|
152
|
+
active_revision_id = ?,
|
|
153
|
+
source_ref = ?,
|
|
154
|
+
source_hash = ?,
|
|
155
|
+
created_at = ?,
|
|
156
|
+
updated_at = ?
|
|
157
|
+
WHERE key = ?
|
|
158
|
+
`)
|
|
159
|
+
.run(input.label, input.managedPath, input.scope, "managed", input.agentProfileName ?? null, input.activeRevisionId ?? null, input.sourceRef ?? null, input.sourceHash ?? null, input.createdAt, input.updatedAt, input.key);
|
|
160
|
+
const record = this.getFile(input.key);
|
|
161
|
+
if (!record)
|
|
162
|
+
throw new Error(`Failed to update context file record "${input.key}"`);
|
|
163
|
+
return record;
|
|
164
|
+
}
|
|
165
|
+
deleteFile(key) {
|
|
166
|
+
this.db.exec("BEGIN");
|
|
167
|
+
try {
|
|
168
|
+
this.db.prepare("DELETE FROM context_file_revisions WHERE context_file_key = ?").run(key);
|
|
169
|
+
this.db.prepare("DELETE FROM context_files WHERE key = ?").run(key);
|
|
170
|
+
this.db.exec("COMMIT");
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
this.db.exec("ROLLBACK");
|
|
174
|
+
throw error;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
appendRevision(input) {
|
|
178
|
+
const id = `rev_${randomUUID()}`;
|
|
179
|
+
const createdAt = input.createdAt ?? new Date().toISOString();
|
|
180
|
+
this.db
|
|
181
|
+
.prepare(`
|
|
182
|
+
INSERT INTO context_file_revisions (
|
|
183
|
+
id,
|
|
184
|
+
context_file_key,
|
|
185
|
+
kind,
|
|
186
|
+
content_hash,
|
|
187
|
+
content,
|
|
188
|
+
created_at,
|
|
189
|
+
actor_id,
|
|
190
|
+
based_on_revision_id,
|
|
191
|
+
source_hash_at_creation,
|
|
192
|
+
note
|
|
193
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
194
|
+
`)
|
|
195
|
+
.run(id, input.contextFileKey, input.kind, input.contentHash, input.content, createdAt, input.actorId ?? null, input.basedOnRevisionId ?? null, input.sourceHashAtCreation ?? null, input.note ?? null);
|
|
196
|
+
const revision = this.getRevision(id);
|
|
197
|
+
if (!revision)
|
|
198
|
+
throw new Error(`Failed to create context file revision "${id}"`);
|
|
199
|
+
return revision;
|
|
200
|
+
}
|
|
201
|
+
getRevision(id) {
|
|
202
|
+
const row = this.db.prepare("SELECT * FROM context_file_revisions WHERE id = ?").get(id);
|
|
203
|
+
return row ? revisionRowToRecord(row) : undefined;
|
|
204
|
+
}
|
|
205
|
+
listRevisions(contextFileKey) {
|
|
206
|
+
const rows = this.db
|
|
207
|
+
.prepare("SELECT * FROM context_file_revisions WHERE context_file_key = ? ORDER BY created_at DESC")
|
|
208
|
+
.all(contextFileKey);
|
|
209
|
+
return rows.map(revisionRowToRecord);
|
|
210
|
+
}
|
|
211
|
+
findLatestSourceSnapshot(contextFileKey, sourceHash) {
|
|
212
|
+
const row = sourceHash
|
|
213
|
+
? this.db
|
|
214
|
+
.prepare(`
|
|
215
|
+
SELECT * FROM context_file_revisions
|
|
216
|
+
WHERE context_file_key = ? AND kind = 'source-snapshot' AND content_hash = ?
|
|
217
|
+
ORDER BY created_at DESC
|
|
218
|
+
LIMIT 1
|
|
219
|
+
`)
|
|
220
|
+
.get(contextFileKey, sourceHash)
|
|
221
|
+
: this.db
|
|
222
|
+
.prepare(`
|
|
223
|
+
SELECT * FROM context_file_revisions
|
|
224
|
+
WHERE context_file_key = ? AND kind = 'source-snapshot'
|
|
225
|
+
ORDER BY created_at DESC
|
|
226
|
+
LIMIT 1
|
|
227
|
+
`)
|
|
228
|
+
.get(contextFileKey);
|
|
229
|
+
return row ? revisionRowToRecord(row) : undefined;
|
|
230
|
+
}
|
|
231
|
+
close() {
|
|
232
|
+
this.db.close();
|
|
233
|
+
}
|
|
234
|
+
migrateLegacyStore() {
|
|
235
|
+
if (!this.legacyStorePath)
|
|
236
|
+
return;
|
|
237
|
+
const count = this.db.prepare("SELECT COUNT(*) AS count FROM context_files").get();
|
|
238
|
+
if (Number(count.count) > 0)
|
|
239
|
+
return;
|
|
240
|
+
const legacyStore = readLegacyManagedStore(this.legacyStorePath);
|
|
241
|
+
if (legacyStore.files.length === 0)
|
|
242
|
+
return;
|
|
243
|
+
this.db.exec("BEGIN");
|
|
244
|
+
try {
|
|
245
|
+
for (const file of legacyStore.files) {
|
|
246
|
+
const resolvedPath = resolve(file.path);
|
|
247
|
+
const createdAt = existsSync(resolvedPath)
|
|
248
|
+
? statSync(resolvedPath).mtime.toISOString()
|
|
249
|
+
: new Date().toISOString();
|
|
250
|
+
this.db
|
|
251
|
+
.prepare(`
|
|
252
|
+
INSERT INTO context_files (
|
|
253
|
+
key,
|
|
254
|
+
label,
|
|
255
|
+
managed_path,
|
|
256
|
+
scope,
|
|
257
|
+
source_type,
|
|
258
|
+
agent_profile_name,
|
|
259
|
+
active_revision_id,
|
|
260
|
+
source_ref,
|
|
261
|
+
source_hash,
|
|
262
|
+
created_at,
|
|
263
|
+
updated_at
|
|
264
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
265
|
+
`)
|
|
266
|
+
.run(file.key, file.label, resolvedPath, file.scope, "managed", file.agentProfileName ?? null, null, null, null, createdAt, createdAt);
|
|
267
|
+
if (!existsSync(resolvedPath))
|
|
268
|
+
continue;
|
|
269
|
+
const content = readFileSync(resolvedPath, "utf8");
|
|
270
|
+
const contentHash = hashContextFileContent(content);
|
|
271
|
+
const revisionId = `rev_${randomUUID()}`;
|
|
272
|
+
this.db
|
|
273
|
+
.prepare(`
|
|
274
|
+
INSERT INTO context_file_revisions (
|
|
275
|
+
id,
|
|
276
|
+
context_file_key,
|
|
277
|
+
kind,
|
|
278
|
+
content_hash,
|
|
279
|
+
content,
|
|
280
|
+
created_at,
|
|
281
|
+
actor_id,
|
|
282
|
+
based_on_revision_id,
|
|
283
|
+
source_hash_at_creation,
|
|
284
|
+
note
|
|
285
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
286
|
+
`)
|
|
287
|
+
.run(revisionId, file.key, "working", contentHash, content, createdAt, null, null, null, "Legacy managed file import");
|
|
288
|
+
this.db
|
|
289
|
+
.prepare("UPDATE context_files SET active_revision_id = ?, updated_at = ? WHERE key = ?")
|
|
290
|
+
.run(revisionId, createdAt, file.key);
|
|
291
|
+
}
|
|
292
|
+
this.db.exec("COMMIT");
|
|
293
|
+
}
|
|
294
|
+
catch (error) {
|
|
295
|
+
this.db.exec("ROLLBACK");
|
|
296
|
+
throw error;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
export function hashContextFileContent(content) {
|
|
301
|
+
return `sha256:${createHash("sha256").update(content).digest("hex")}`;
|
|
302
|
+
}
|
|
303
|
+
function splitLines(content) {
|
|
304
|
+
return content.split("\n");
|
|
305
|
+
}
|
|
306
|
+
export function buildContextFileDiff(baseContent, targetContent) {
|
|
307
|
+
const baseLines = splitLines(baseContent);
|
|
308
|
+
const targetLines = splitLines(targetContent);
|
|
309
|
+
const rows = baseLines.length;
|
|
310
|
+
const cols = targetLines.length;
|
|
311
|
+
const lcs = Array.from({ length: rows + 1 }, () => Array(cols + 1).fill(0));
|
|
312
|
+
for (let left = rows - 1; left >= 0; left -= 1) {
|
|
313
|
+
for (let right = cols - 1; right >= 0; right -= 1) {
|
|
314
|
+
lcs[left][right] = baseLines[left] === targetLines[right]
|
|
315
|
+
? lcs[left + 1][right + 1] + 1
|
|
316
|
+
: Math.max(lcs[left + 1][right], lcs[left][right + 1]);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
const chunks = [];
|
|
320
|
+
let left = 0;
|
|
321
|
+
let right = 0;
|
|
322
|
+
while (left < rows && right < cols) {
|
|
323
|
+
if (baseLines[left] === targetLines[right]) {
|
|
324
|
+
pushDiffChunk(chunks, "equal", baseLines[left]);
|
|
325
|
+
left += 1;
|
|
326
|
+
right += 1;
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
if (lcs[left + 1][right] >= lcs[left][right + 1]) {
|
|
330
|
+
pushDiffChunk(chunks, "remove", baseLines[left]);
|
|
331
|
+
left += 1;
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
pushDiffChunk(chunks, "add", targetLines[right]);
|
|
335
|
+
right += 1;
|
|
336
|
+
}
|
|
337
|
+
while (left < rows) {
|
|
338
|
+
pushDiffChunk(chunks, "remove", baseLines[left]);
|
|
339
|
+
left += 1;
|
|
340
|
+
}
|
|
341
|
+
while (right < cols) {
|
|
342
|
+
pushDiffChunk(chunks, "add", targetLines[right]);
|
|
343
|
+
right += 1;
|
|
344
|
+
}
|
|
345
|
+
return chunks;
|
|
346
|
+
}
|
|
347
|
+
function pushDiffChunk(chunks, type, line) {
|
|
348
|
+
const previous = chunks[chunks.length - 1];
|
|
349
|
+
if (previous && previous.type === type) {
|
|
350
|
+
previous.lines.push(line);
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
chunks.push({ type, lines: [line] });
|
|
354
|
+
}
|