@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,61 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { findPiPackage } from "./store.js";
|
|
3
|
+
export function getPiPackageRuntimeOptions(cwd, profile) {
|
|
4
|
+
const diagnostics = [];
|
|
5
|
+
const additionalExtensionPaths = [];
|
|
6
|
+
for (const selected of profile.piPackages.filter((pkg) => pkg.enabled !== false)) {
|
|
7
|
+
const registered = findPiPackage(selected.id, cwd);
|
|
8
|
+
if (!registered) {
|
|
9
|
+
diagnostics.push({
|
|
10
|
+
type: "error",
|
|
11
|
+
message: `Selected Pi package "${selected.id}" is not registered in Pibo.`,
|
|
12
|
+
});
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
if (!registered.enabled) {
|
|
16
|
+
diagnostics.push({
|
|
17
|
+
type: "warning",
|
|
18
|
+
message: `Selected Pi package "${registered.name}" is globally disabled in Pibo and was not loaded.`,
|
|
19
|
+
});
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
if (registered.installStatus === "error") {
|
|
23
|
+
diagnostics.push({
|
|
24
|
+
type: "error",
|
|
25
|
+
message: `Selected Pi package "${registered.name}" is in error state and was skipped.`,
|
|
26
|
+
});
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const runtimePath = registered.installPath ?? (registered.installSpec.startsWith("/") ? registered.installSpec : undefined);
|
|
30
|
+
if (!runtimePath) {
|
|
31
|
+
diagnostics.push({
|
|
32
|
+
type: "warning",
|
|
33
|
+
message: `Selected Pi package "${registered.name}" is not installed and was skipped.`,
|
|
34
|
+
});
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
if (!existsSync(runtimePath)) {
|
|
38
|
+
diagnostics.push({
|
|
39
|
+
type: "error",
|
|
40
|
+
message: `Selected Pi package "${registered.name}" path does not exist: ${runtimePath}`,
|
|
41
|
+
});
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
additionalExtensionPaths.push(runtimePath);
|
|
45
|
+
diagnostics.push({
|
|
46
|
+
type: "info",
|
|
47
|
+
message: `Loaded Pi package ${registered.name} (${registered.resourceTypes.join(", ") || "resources pending"})`,
|
|
48
|
+
});
|
|
49
|
+
for (const diagnostic of registered.diagnostics) {
|
|
50
|
+
if (diagnostic.type === "error") {
|
|
51
|
+
diagnostics.push({ type: "warning", message: `Pi package ${registered.name}: ${diagnostic.message}` });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
resourceLoaderOptions: {
|
|
57
|
+
additionalExtensionPaths: [...new Set(additionalExtensionPaths)],
|
|
58
|
+
},
|
|
59
|
+
diagnostics,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
const STORE_VERSION = 1;
|
|
4
|
+
export function defaultPiPackageStorePath(cwd = process.cwd()) {
|
|
5
|
+
return resolve(cwd, ".pibo/pi-packages.json");
|
|
6
|
+
}
|
|
7
|
+
export function ensurePiPackageStorage(cwd = process.cwd()) {
|
|
8
|
+
mkdirSync(resolve(cwd, ".pibo/pi-packages/npm"), { recursive: true });
|
|
9
|
+
mkdirSync(resolve(cwd, ".pibo/pi-packages/git"), { recursive: true });
|
|
10
|
+
mkdirSync(resolve(cwd, ".pibo/pi-packages/local"), { recursive: true });
|
|
11
|
+
}
|
|
12
|
+
export function loadPiPackageStore(path = defaultPiPackageStorePath()) {
|
|
13
|
+
if (!existsSync(path))
|
|
14
|
+
return { version: STORE_VERSION, packages: [] };
|
|
15
|
+
const parsed = JSON.parse(readFileSync(path, "utf-8"));
|
|
16
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
17
|
+
throw new Error(`Invalid Pi package store at ${path}`);
|
|
18
|
+
}
|
|
19
|
+
const data = parsed;
|
|
20
|
+
if (data.version !== STORE_VERSION || !Array.isArray(data.packages)) {
|
|
21
|
+
throw new Error(`Unsupported Pi package store at ${path}`);
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
version: STORE_VERSION,
|
|
25
|
+
packages: data.packages.map(sanitizeStoredPackage),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export function savePiPackageStore(data, path = defaultPiPackageStorePath()) {
|
|
29
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
30
|
+
writeFileSync(path, `${JSON.stringify({ version: STORE_VERSION, packages: data.packages }, null, 2)}\n`, "utf-8");
|
|
31
|
+
}
|
|
32
|
+
export function listPiPackages(cwd = process.cwd()) {
|
|
33
|
+
return loadPiPackageStore(defaultPiPackageStorePath(cwd)).packages;
|
|
34
|
+
}
|
|
35
|
+
export function findPiPackage(nameOrId, cwd = process.cwd()) {
|
|
36
|
+
const lookup = nameOrId.trim();
|
|
37
|
+
return listPiPackages(cwd).find((pkg) => (pkg.id === lookup ||
|
|
38
|
+
pkg.name === lookup ||
|
|
39
|
+
pkg.source === lookup ||
|
|
40
|
+
pkg.installSpec === lookup));
|
|
41
|
+
}
|
|
42
|
+
export function upsertPiPackage(pkg, cwd = process.cwd()) {
|
|
43
|
+
ensurePiPackageStorage(cwd);
|
|
44
|
+
const path = defaultPiPackageStorePath(cwd);
|
|
45
|
+
const data = loadPiPackageStore(path);
|
|
46
|
+
const now = new Date().toISOString();
|
|
47
|
+
const existingIndex = data.packages.findIndex((candidate) => candidate.id === pkg.id || candidate.name === pkg.name || candidate.source === pkg.source);
|
|
48
|
+
const existing = existingIndex >= 0 ? data.packages[existingIndex] : undefined;
|
|
49
|
+
const next = existing && existing.installStatus === "installed" && pkg.installStatus === "error"
|
|
50
|
+
? {
|
|
51
|
+
...existing,
|
|
52
|
+
diagnostics: mergeDiagnostics(existing.diagnostics, [
|
|
53
|
+
{ type: "warning", message: `Latest package refresh failed; keeping previous installed record for ${existing.name}.` },
|
|
54
|
+
...pkg.diagnostics,
|
|
55
|
+
]),
|
|
56
|
+
updatedAt: now,
|
|
57
|
+
}
|
|
58
|
+
: {
|
|
59
|
+
...pkg,
|
|
60
|
+
enabled: existing?.enabled ?? pkg.enabled !== false,
|
|
61
|
+
addedAt: existing ? existing.addedAt : pkg.addedAt ?? now,
|
|
62
|
+
updatedAt: now,
|
|
63
|
+
};
|
|
64
|
+
if (existingIndex >= 0)
|
|
65
|
+
data.packages[existingIndex] = next;
|
|
66
|
+
else
|
|
67
|
+
data.packages.push(next);
|
|
68
|
+
data.packages.sort((left, right) => left.name.localeCompare(right.name));
|
|
69
|
+
savePiPackageStore(data, path);
|
|
70
|
+
return next;
|
|
71
|
+
}
|
|
72
|
+
export function removePiPackage(nameOrId, cwd = process.cwd()) {
|
|
73
|
+
const path = defaultPiPackageStorePath(cwd);
|
|
74
|
+
const data = loadPiPackageStore(path);
|
|
75
|
+
const lookup = nameOrId.trim();
|
|
76
|
+
const index = data.packages.findIndex((pkg) => (pkg.id === lookup ||
|
|
77
|
+
pkg.name === lookup ||
|
|
78
|
+
pkg.source === lookup ||
|
|
79
|
+
pkg.installSpec === lookup));
|
|
80
|
+
if (index < 0)
|
|
81
|
+
return undefined;
|
|
82
|
+
const [removed] = data.packages.splice(index, 1);
|
|
83
|
+
savePiPackageStore(data, path);
|
|
84
|
+
return removed;
|
|
85
|
+
}
|
|
86
|
+
export function setPiPackageEnabled(nameOrId, enabled, cwd = process.cwd()) {
|
|
87
|
+
const path = defaultPiPackageStorePath(cwd);
|
|
88
|
+
const data = loadPiPackageStore(path);
|
|
89
|
+
const lookup = nameOrId.trim();
|
|
90
|
+
const index = data.packages.findIndex((pkg) => pkg.id === lookup || pkg.name === lookup || pkg.source === lookup);
|
|
91
|
+
if (index < 0)
|
|
92
|
+
return undefined;
|
|
93
|
+
const next = {
|
|
94
|
+
...data.packages[index],
|
|
95
|
+
enabled,
|
|
96
|
+
updatedAt: new Date().toISOString(),
|
|
97
|
+
};
|
|
98
|
+
data.packages[index] = next;
|
|
99
|
+
savePiPackageStore(data, path);
|
|
100
|
+
return next;
|
|
101
|
+
}
|
|
102
|
+
function sanitizeStoredPackage(value) {
|
|
103
|
+
const candidate = value;
|
|
104
|
+
if (!candidate || typeof candidate !== "object")
|
|
105
|
+
throw new Error("Invalid Pi package entry");
|
|
106
|
+
if (typeof candidate.name !== "string" || typeof candidate.source !== "string" || typeof candidate.installSpec !== "string") {
|
|
107
|
+
throw new Error("Invalid Pi package entry");
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
id: typeof candidate.id === "string" && candidate.id.trim() ? candidate.id.trim() : candidate.name.trim(),
|
|
111
|
+
name: candidate.name.trim(),
|
|
112
|
+
description: stringOrUndefined(candidate.description),
|
|
113
|
+
source: candidate.source.trim(),
|
|
114
|
+
installSpec: candidate.installSpec.trim(),
|
|
115
|
+
version: stringOrUndefined(candidate.version),
|
|
116
|
+
repositoryUrl: stringOrUndefined(candidate.repositoryUrl),
|
|
117
|
+
resourceTypes: uniqueResourceTypes(candidate.resourceTypes),
|
|
118
|
+
extensionPaths: stringArray(candidate.extensionPaths),
|
|
119
|
+
skillNames: stringArray(candidate.skillNames),
|
|
120
|
+
promptNames: stringArray(candidate.promptNames),
|
|
121
|
+
themeNames: stringArray(candidate.themeNames),
|
|
122
|
+
discoveredToolNames: stringArray(candidate.discoveredToolNames),
|
|
123
|
+
installStatus: installStatus(candidate),
|
|
124
|
+
installPath: stringOrUndefined(candidate.installPath),
|
|
125
|
+
enabled: candidate.enabled !== false,
|
|
126
|
+
diagnostics: Array.isArray(candidate.diagnostics) ? candidate.diagnostics.flatMap((diagnostic) => {
|
|
127
|
+
if (!diagnostic || typeof diagnostic !== "object")
|
|
128
|
+
return [];
|
|
129
|
+
const item = diagnostic;
|
|
130
|
+
if (item.type !== "info" && item.type !== "warning" && item.type !== "error")
|
|
131
|
+
return [];
|
|
132
|
+
if (typeof item.message !== "string" || !item.message.trim())
|
|
133
|
+
return [];
|
|
134
|
+
return [{ type: item.type, message: item.message.trim() }];
|
|
135
|
+
}) : [],
|
|
136
|
+
addedAt: stringOrUndefined(candidate.addedAt) ?? new Date().toISOString(),
|
|
137
|
+
updatedAt: stringOrUndefined(candidate.updatedAt) ?? new Date().toISOString(),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function installStatus(candidate) {
|
|
141
|
+
if (candidate.installStatus === "registered" ||
|
|
142
|
+
candidate.installStatus === "installed" ||
|
|
143
|
+
candidate.installStatus === "missing" ||
|
|
144
|
+
candidate.installStatus === "error") {
|
|
145
|
+
return candidate.installStatus;
|
|
146
|
+
}
|
|
147
|
+
return candidate.installed === true ? "installed" : "registered";
|
|
148
|
+
}
|
|
149
|
+
function mergeDiagnostics(left, right) {
|
|
150
|
+
const seen = new Set();
|
|
151
|
+
const merged = [];
|
|
152
|
+
for (const diagnostic of [...left, ...right]) {
|
|
153
|
+
const key = `${diagnostic.type}\0${diagnostic.message}`;
|
|
154
|
+
if (seen.has(key))
|
|
155
|
+
continue;
|
|
156
|
+
seen.add(key);
|
|
157
|
+
merged.push(diagnostic);
|
|
158
|
+
}
|
|
159
|
+
return merged;
|
|
160
|
+
}
|
|
161
|
+
function stringOrUndefined(value) {
|
|
162
|
+
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
163
|
+
}
|
|
164
|
+
function stringArray(value) {
|
|
165
|
+
if (!Array.isArray(value))
|
|
166
|
+
return undefined;
|
|
167
|
+
const strings = [...new Set(value.filter((item) => typeof item === "string" && item.trim().length > 0).map((item) => item.trim()))];
|
|
168
|
+
return strings.length ? strings : undefined;
|
|
169
|
+
}
|
|
170
|
+
function uniqueResourceTypes(value) {
|
|
171
|
+
if (!Array.isArray(value))
|
|
172
|
+
return [];
|
|
173
|
+
const allowed = new Set(["extension", "skill", "prompt", "theme"]);
|
|
174
|
+
return [...new Set(value.filter((item) => typeof item === "string" && allowed.has(item)))];
|
|
175
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createBetterAuthService } from "../auth/better-auth.js";
|
|
2
|
+
import { definePiboPlugin } from "./registry.js";
|
|
3
|
+
export function createPiboBetterAuthPlugin(options = {}) {
|
|
4
|
+
return definePiboPlugin({
|
|
5
|
+
id: "pibo.better-auth",
|
|
6
|
+
name: "Pibo Better Auth",
|
|
7
|
+
register(api) {
|
|
8
|
+
api.registerAuthService(createBetterAuthService(options));
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { createPiboGatewayToolProfiles } from "../gateway/tool.js";
|
|
2
|
+
import { InitialSessionContextBuilder } from "../core/profiles.js";
|
|
3
|
+
import { parsePiboThinkingLevel } from "../core/thinking.js";
|
|
4
|
+
import { createWebSearchToolProfile } from "../tools/web-search.js";
|
|
5
|
+
import { piboCodexCompatPlugin } from "./codex-compat.js";
|
|
6
|
+
import { definePiboPlugin, PiboPluginRegistry } from "./registry.js";
|
|
7
|
+
const GATEWAY_PROFILE_TOOLS = ["pibo_gateway_send"];
|
|
8
|
+
const RUN_YIELD_QA_SUBAGENTS = ["qa-researcher", "qa-reviewer"];
|
|
9
|
+
function getObjectParams(event) {
|
|
10
|
+
const params = "params" in event ? event.params : undefined;
|
|
11
|
+
if (!params || typeof params !== "object" || Array.isArray(params))
|
|
12
|
+
return undefined;
|
|
13
|
+
return params;
|
|
14
|
+
}
|
|
15
|
+
function requireForkParams(event) {
|
|
16
|
+
const params = getObjectParams(event);
|
|
17
|
+
if (!params || typeof params.entryId !== "string" || params.entryId.length === 0) {
|
|
18
|
+
throw new Error("session.fork requires params.entryId");
|
|
19
|
+
}
|
|
20
|
+
return { entryId: params.entryId };
|
|
21
|
+
}
|
|
22
|
+
function requireTreeNavigateParams(event) {
|
|
23
|
+
const raw = getObjectParams(event);
|
|
24
|
+
if (!raw || typeof raw.entryId !== "string" || raw.entryId.length === 0) {
|
|
25
|
+
throw new Error("session.tree_navigate requires params.entryId");
|
|
26
|
+
}
|
|
27
|
+
const params = { entryId: raw.entryId };
|
|
28
|
+
if (typeof raw.summarize === "boolean")
|
|
29
|
+
params.summarize = raw.summarize;
|
|
30
|
+
if (typeof raw.customInstructions === "string")
|
|
31
|
+
params.customInstructions = raw.customInstructions;
|
|
32
|
+
if (typeof raw.replaceInstructions === "boolean")
|
|
33
|
+
params.replaceInstructions = raw.replaceInstructions;
|
|
34
|
+
if (typeof raw.label === "string")
|
|
35
|
+
params.label = raw.label;
|
|
36
|
+
return params;
|
|
37
|
+
}
|
|
38
|
+
function requireSwitchParams(event) {
|
|
39
|
+
const raw = getObjectParams(event);
|
|
40
|
+
if (!raw || typeof raw.sessionFile !== "string" || raw.sessionFile.length === 0) {
|
|
41
|
+
throw new Error("session.switch requires params.sessionFile");
|
|
42
|
+
}
|
|
43
|
+
const params = { sessionFile: raw.sessionFile };
|
|
44
|
+
if (typeof raw.cwdOverride === "string")
|
|
45
|
+
params.cwdOverride = raw.cwdOverride;
|
|
46
|
+
return params;
|
|
47
|
+
}
|
|
48
|
+
function getThinkingParams(event) {
|
|
49
|
+
const raw = getObjectParams(event);
|
|
50
|
+
if (!raw || raw.level === undefined)
|
|
51
|
+
return {};
|
|
52
|
+
if (typeof raw.level !== "string")
|
|
53
|
+
throw new Error("thinking requires params.level to be a string");
|
|
54
|
+
return { level: parsePiboThinkingLevel(raw.level) };
|
|
55
|
+
}
|
|
56
|
+
function createBaseProfileBuilder(profileName, context) {
|
|
57
|
+
return new InitialSessionContextBuilder(profileName)
|
|
58
|
+
.addSkill(context.getSkill("pi-agent-harness"));
|
|
59
|
+
}
|
|
60
|
+
export const piboCorePlugin = definePiboPlugin({
|
|
61
|
+
id: "pibo.core",
|
|
62
|
+
name: "Pibo Core",
|
|
63
|
+
register(api) {
|
|
64
|
+
api.registerSkill({
|
|
65
|
+
name: "pi-agent-harness",
|
|
66
|
+
path: ".codex/skills/pi-agent-harness/SKILL.md",
|
|
67
|
+
});
|
|
68
|
+
api.registerTool(createWebSearchToolProfile());
|
|
69
|
+
api.registerSubagents([
|
|
70
|
+
{
|
|
71
|
+
name: "qa-researcher",
|
|
72
|
+
description: "QA helper subagent for run-yield testing. Use it for small research or inspection tasks.",
|
|
73
|
+
targetProfile: "pibo-minimal",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "qa-reviewer",
|
|
77
|
+
description: "QA reviewer subagent for run-yield testing. Use it for independent review or validation tasks.",
|
|
78
|
+
targetProfile: "pibo-minimal",
|
|
79
|
+
},
|
|
80
|
+
]);
|
|
81
|
+
api.registerProfile({
|
|
82
|
+
name: "pibo-minimal",
|
|
83
|
+
aliases: ["minimal"],
|
|
84
|
+
description: "Minimal pibo profile with the harness skill.",
|
|
85
|
+
create(context) {
|
|
86
|
+
return createBaseProfileBuilder("pibo-minimal", context)
|
|
87
|
+
.createSession();
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
api.registerProfile({
|
|
91
|
+
name: "pibo-run-yield-qa",
|
|
92
|
+
aliases: ["run-yield-qa", "yield-qa"],
|
|
93
|
+
description: "QA profile with two simple subagents for testing yielded run control.",
|
|
94
|
+
create(context) {
|
|
95
|
+
return createBaseProfileBuilder("pibo-run-yield-qa", context)
|
|
96
|
+
.withToolPackages({ runControl: true })
|
|
97
|
+
.addSubagents(context.getSubagents(RUN_YIELD_QA_SUBAGENTS))
|
|
98
|
+
.createSession();
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
api.registerGatewayAction({
|
|
102
|
+
name: "status",
|
|
103
|
+
description: "Return current session status.",
|
|
104
|
+
slashCommands: ["status"],
|
|
105
|
+
execute(context) {
|
|
106
|
+
return context.getStatus();
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
api.registerGatewayAction({
|
|
110
|
+
name: "session_id",
|
|
111
|
+
description: "Return the routed Pibo session id.",
|
|
112
|
+
slashCommands: ["session"],
|
|
113
|
+
execute(context) {
|
|
114
|
+
return { piboSessionId: context.piboSessionId };
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
api.registerGatewayAction({
|
|
118
|
+
name: "clear_queue",
|
|
119
|
+
description: "Clear queued messages that have not started yet.",
|
|
120
|
+
slashCommands: ["clear"],
|
|
121
|
+
execute(context) {
|
|
122
|
+
return { cleared: context.clearQueue() };
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
api.registerGatewayAction({
|
|
126
|
+
name: "abort",
|
|
127
|
+
description: "Abort the active Pi agent run.",
|
|
128
|
+
slashCommands: ["abort"],
|
|
129
|
+
async execute(context) {
|
|
130
|
+
await context.abort();
|
|
131
|
+
return { aborted: true };
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
api.registerGatewayAction({
|
|
135
|
+
name: "dispose",
|
|
136
|
+
description: "Dispose the routed session runtime.",
|
|
137
|
+
hidden: true,
|
|
138
|
+
async execute(context) {
|
|
139
|
+
await context.dispose();
|
|
140
|
+
return { disposed: true };
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
api.registerGatewayAction({
|
|
144
|
+
name: "thinking",
|
|
145
|
+
description: "Cycle or set the routed Pi thinking level.",
|
|
146
|
+
slashCommands: ["thinking"],
|
|
147
|
+
execute(context, event) {
|
|
148
|
+
const params = getThinkingParams(event);
|
|
149
|
+
return params.level ? context.setThinkingLevel(params.level) : context.cycleThinkingLevel();
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
api.registerGatewayAction({
|
|
153
|
+
name: "session.current",
|
|
154
|
+
description: "Return the active Pi session metadata for this routed session.",
|
|
155
|
+
slashCommands: ["session-current"],
|
|
156
|
+
execute(context) {
|
|
157
|
+
return context.getCurrentSession();
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
api.registerGatewayAction({
|
|
161
|
+
name: "session.list",
|
|
162
|
+
description: "List persisted Pi sessions for this workspace.",
|
|
163
|
+
slashCommands: ["sessions"],
|
|
164
|
+
execute(context) {
|
|
165
|
+
return context.listSessions();
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
api.registerGatewayAction({
|
|
169
|
+
name: "session.fork_candidates",
|
|
170
|
+
description: "Return user messages that can be used as fork targets.",
|
|
171
|
+
slashCommands: ["fork-candidates"],
|
|
172
|
+
execute(context) {
|
|
173
|
+
return { messages: context.getForkCandidates() };
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
api.registerGatewayAction({
|
|
177
|
+
name: "session.fork",
|
|
178
|
+
description: "Fork before a selected user message and create a visible Pibo session for the fork.",
|
|
179
|
+
async execute(context, event) {
|
|
180
|
+
const params = requireForkParams(event);
|
|
181
|
+
return await context.forkSession(params.entryId);
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
api.registerGatewayAction({
|
|
185
|
+
name: "session.clone",
|
|
186
|
+
description: "Clone the current leaf and create a visible Pibo session for the clone.",
|
|
187
|
+
slashCommands: ["clone"],
|
|
188
|
+
execute(context) {
|
|
189
|
+
return context.cloneSession();
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
api.registerGatewayAction({
|
|
193
|
+
name: "session.tree",
|
|
194
|
+
description: "Return the current Pi session tree and active leaf.",
|
|
195
|
+
slashCommands: ["tree"],
|
|
196
|
+
execute(context) {
|
|
197
|
+
return context.getSessionTree();
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
api.registerGatewayAction({
|
|
201
|
+
name: "session.tree_navigate",
|
|
202
|
+
description: "Move the current Pi session leaf to a selected tree entry.",
|
|
203
|
+
async execute(context, event) {
|
|
204
|
+
return await context.navigateSessionTree(requireTreeNavigateParams(event));
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
api.registerGatewayAction({
|
|
208
|
+
name: "session.switch",
|
|
209
|
+
description: "Switch the active Pi session to a persisted session file.",
|
|
210
|
+
async execute(context, event) {
|
|
211
|
+
return await context.switchSession(requireSwitchParams(event));
|
|
212
|
+
},
|
|
213
|
+
});
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
export const piboGatewayProducerPlugin = definePiboPlugin({
|
|
217
|
+
id: "pibo.gateway-producer",
|
|
218
|
+
name: "Pibo Gateway Producer",
|
|
219
|
+
register(api) {
|
|
220
|
+
api.registerTools(createPiboGatewayToolProfiles());
|
|
221
|
+
api.registerProfile({
|
|
222
|
+
name: "pibo-gateway-producer",
|
|
223
|
+
aliases: ["gateway-producer"],
|
|
224
|
+
description: "Pibo profile that can send messages through the local gateway.",
|
|
225
|
+
create(context) {
|
|
226
|
+
return createBaseProfileBuilder("pibo-gateway-producer", context)
|
|
227
|
+
.addTools(context.getTools(GATEWAY_PROFILE_TOOLS))
|
|
228
|
+
.createSession();
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
},
|
|
232
|
+
});
|
|
233
|
+
export function createDefaultPiboPlugins() {
|
|
234
|
+
return [piboCorePlugin, piboCodexCompatPlugin];
|
|
235
|
+
}
|
|
236
|
+
export function createGatewayProducerPiboPluginRegistry() {
|
|
237
|
+
return PiboPluginRegistry.create({
|
|
238
|
+
plugins: [piboCorePlugin, piboGatewayProducerPlugin, piboCodexCompatPlugin],
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
export function createDefaultPiboPluginRegistry() {
|
|
242
|
+
return PiboPluginRegistry.create({ plugins: createDefaultPiboPlugins() });
|
|
243
|
+
}
|
|
244
|
+
export function createDefaultPiboProfile() {
|
|
245
|
+
return createDefaultPiboPluginRegistry().createProfile("pibo-minimal");
|
|
246
|
+
}
|
|
247
|
+
export function createGatewayProducerPiboProfile() {
|
|
248
|
+
return createGatewayProducerPiboPluginRegistry().createProfile("pibo-gateway-producer");
|
|
249
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createChatWebApp } from "../apps/chat/web-app.js";
|
|
2
|
+
import { definePiboPlugin } from "./registry.js";
|
|
3
|
+
export function createPiboChatWebPlugin(options = {}) {
|
|
4
|
+
return definePiboPlugin({
|
|
5
|
+
id: "pibo.chat-web",
|
|
6
|
+
name: "Pibo Chat Web",
|
|
7
|
+
register(api) {
|
|
8
|
+
api.registerWebApp(createChatWebApp(options));
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { dirname, resolve } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { InitialSessionContextBuilder } from "../core/profiles.js";
|
|
4
|
+
import { definePiboPlugin } from "./registry.js";
|
|
5
|
+
const CODEX_COMPAT_TOOL_NAMES = [
|
|
6
|
+
"apply_patch",
|
|
7
|
+
"web_search",
|
|
8
|
+
"view_image",
|
|
9
|
+
];
|
|
10
|
+
const CODEX_COMPAT_REGISTERED_TOOL_NAMES = [
|
|
11
|
+
"apply_patch",
|
|
12
|
+
"view_image",
|
|
13
|
+
];
|
|
14
|
+
const CODEX_COMPAT_SUBAGENTS = ["default", "explorer", "worker"];
|
|
15
|
+
const CODEX_BASE_PROMPT_CONTEXT_FILE_KEY = "Codex Base Prompt";
|
|
16
|
+
const PROJECT_ROOT = dirname(dirname(dirname(fileURLToPath(import.meta.url))));
|
|
17
|
+
const CODEX_BASE_PROMPT_CONTEXT_FILE_PATH = resolve(PROJECT_ROOT, "context/codex-base-prompt.md");
|
|
18
|
+
const toolDescriptions = {
|
|
19
|
+
apply_patch: "Applies a Codex-style patch to workspace files.",
|
|
20
|
+
view_image: "Reads a local image path and returns it for visual inspection.",
|
|
21
|
+
};
|
|
22
|
+
export const piboCodexCompatPlugin = definePiboPlugin({
|
|
23
|
+
id: "pibo.codex-compat",
|
|
24
|
+
name: "Pibo Codex Compatibility",
|
|
25
|
+
register(api) {
|
|
26
|
+
for (const name of CODEX_COMPAT_REGISTERED_TOOL_NAMES) {
|
|
27
|
+
api.registerTool({
|
|
28
|
+
name,
|
|
29
|
+
description: toolDescriptions[name],
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
api.registerContextFile({
|
|
33
|
+
key: CODEX_BASE_PROMPT_CONTEXT_FILE_KEY,
|
|
34
|
+
label: "Codex Base Prompt",
|
|
35
|
+
path: CODEX_BASE_PROMPT_CONTEXT_FILE_PATH,
|
|
36
|
+
});
|
|
37
|
+
api.registerSubagents([
|
|
38
|
+
{
|
|
39
|
+
name: "default",
|
|
40
|
+
description: "General delegated Codex-compatible child agent.",
|
|
41
|
+
targetProfile: "codex-compat-openai-web",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "explorer",
|
|
45
|
+
description: "Read-focused delegated agent for scoped codebase questions.",
|
|
46
|
+
targetProfile: "codex-compat-openai-web",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "worker",
|
|
50
|
+
description: "Execution-focused delegated agent for bounded implementation work.",
|
|
51
|
+
targetProfile: "codex-compat-openai-web",
|
|
52
|
+
},
|
|
53
|
+
]);
|
|
54
|
+
api.registerProfile({
|
|
55
|
+
name: "codex-compat-openai-web",
|
|
56
|
+
aliases: ["codex"],
|
|
57
|
+
description: "Codex-compatible Pibo profile with native provider-backed web_search.",
|
|
58
|
+
create(context) {
|
|
59
|
+
return new InitialSessionContextBuilder("codex-compat-openai-web")
|
|
60
|
+
.withBuiltinToolNames(["read", "edit", "write"])
|
|
61
|
+
.withToolPackages({
|
|
62
|
+
codexCompat: true,
|
|
63
|
+
runControl: true,
|
|
64
|
+
})
|
|
65
|
+
.addTools(context.getTools(CODEX_COMPAT_TOOL_NAMES))
|
|
66
|
+
.addSubagents(context.getSubagents(CODEX_COMPAT_SUBAGENTS))
|
|
67
|
+
.addContextFile(context.getContextFile(CODEX_BASE_PROMPT_CONTEXT_FILE_KEY))
|
|
68
|
+
.createSession();
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
});
|