@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,137 @@
|
|
|
1
|
+
const WEB_SEARCH_SOURCES_INCLUDE = "web_search_call.action.sources";
|
|
2
|
+
function hasProviderResponsesShape(payload) {
|
|
3
|
+
return Boolean(payload && typeof payload === "object" && "input" in payload);
|
|
4
|
+
}
|
|
5
|
+
function hasWebSearchTool(tools) {
|
|
6
|
+
return tools.some((tool) => {
|
|
7
|
+
if (!tool || typeof tool !== "object")
|
|
8
|
+
return false;
|
|
9
|
+
const type = tool.type;
|
|
10
|
+
return type === "web_search_preview" || type === "web_search";
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function isValidDomainFilter(value) {
|
|
14
|
+
const domain = value.trim();
|
|
15
|
+
return domain.length > 0 && !domain.includes("://") && !/[/?#\s]/.test(domain);
|
|
16
|
+
}
|
|
17
|
+
function normalizedDomainFilters(values) {
|
|
18
|
+
const domains = values?.map((value) => value.trim()).filter(isValidDomainFilter) ?? [];
|
|
19
|
+
return domains.length > 0 ? domains : undefined;
|
|
20
|
+
}
|
|
21
|
+
function normalizedLocation(location) {
|
|
22
|
+
if (!location)
|
|
23
|
+
return undefined;
|
|
24
|
+
const country = location.country?.trim();
|
|
25
|
+
const region = location.region?.trim();
|
|
26
|
+
const city = location.city?.trim();
|
|
27
|
+
const timezone = location.timezone?.trim();
|
|
28
|
+
if (!country && !region && !city && !timezone)
|
|
29
|
+
return undefined;
|
|
30
|
+
return {
|
|
31
|
+
type: "approximate",
|
|
32
|
+
...(country ? { country } : {}),
|
|
33
|
+
...(region ? { region } : {}),
|
|
34
|
+
...(city ? { city } : {}),
|
|
35
|
+
...(timezone ? { timezone } : {}),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function normalizeOpenAiWebSearchConfig(options) {
|
|
39
|
+
const allowedDomains = normalizedDomainFilters(options?.allowedDomains);
|
|
40
|
+
const blockedDomains = normalizedDomainFilters(options?.blockedDomains);
|
|
41
|
+
const userLocation = normalizedLocation(options?.userLocation);
|
|
42
|
+
return {
|
|
43
|
+
external_web_access: options?.externalWebAccess ?? true,
|
|
44
|
+
search_context_size: options?.searchContextSize ?? "medium",
|
|
45
|
+
include_sources: options?.includeSources ?? true,
|
|
46
|
+
...(allowedDomains || blockedDomains
|
|
47
|
+
? {
|
|
48
|
+
filters: {
|
|
49
|
+
...(allowedDomains ? { allowed_domains: allowedDomains } : {}),
|
|
50
|
+
...(blockedDomains ? { blocked_domains: blockedDomains } : {}),
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
: {}),
|
|
54
|
+
...(userLocation ? { user_location: userLocation } : {}),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function buildOpenAiWebSearchProviderTool(config) {
|
|
58
|
+
const tool = {
|
|
59
|
+
type: "web_search",
|
|
60
|
+
external_web_access: config.external_web_access,
|
|
61
|
+
};
|
|
62
|
+
if (config.search_context_size)
|
|
63
|
+
tool.search_context_size = config.search_context_size;
|
|
64
|
+
if (config.user_location)
|
|
65
|
+
tool.user_location = config.user_location;
|
|
66
|
+
if (config.filters?.allowed_domains?.length || config.filters?.blocked_domains?.length) {
|
|
67
|
+
tool.filters = {
|
|
68
|
+
...(config.filters.allowed_domains?.length ? { allowed_domains: config.filters.allowed_domains } : {}),
|
|
69
|
+
...(config.filters.blocked_domains?.length ? { blocked_domains: config.filters.blocked_domains } : {}),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
return tool;
|
|
73
|
+
}
|
|
74
|
+
function addOpenAiWebSearchSourcesInclude(payload, config) {
|
|
75
|
+
if (!config.include_sources)
|
|
76
|
+
return {};
|
|
77
|
+
const include = Array.isArray(payload.include) ? [...payload.include] : [];
|
|
78
|
+
if (!include.includes(WEB_SEARCH_SOURCES_INCLUDE))
|
|
79
|
+
include.push(WEB_SEARCH_SOURCES_INCLUDE);
|
|
80
|
+
return { include };
|
|
81
|
+
}
|
|
82
|
+
export function addOpenAiWebSearchProviderTool(payload, config) {
|
|
83
|
+
if (!hasProviderResponsesShape(payload))
|
|
84
|
+
return payload;
|
|
85
|
+
const tools = Array.isArray(payload.tools) ? [...payload.tools] : [];
|
|
86
|
+
if (hasWebSearchTool(tools))
|
|
87
|
+
return payload;
|
|
88
|
+
return {
|
|
89
|
+
...payload,
|
|
90
|
+
...addOpenAiWebSearchSourcesInclude(payload, config),
|
|
91
|
+
tools: [...tools, buildOpenAiWebSearchProviderTool(config)],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const openAiWebSearchAdapter = {
|
|
95
|
+
provider: "openai",
|
|
96
|
+
createExtension(options) {
|
|
97
|
+
const config = normalizeOpenAiWebSearchConfig(options);
|
|
98
|
+
return (pi) => {
|
|
99
|
+
pi.on("before_agent_start", (event) => ({
|
|
100
|
+
systemPrompt: [
|
|
101
|
+
event.systemPrompt,
|
|
102
|
+
"# Native Web Search",
|
|
103
|
+
"web_search is available as a Pibo native tool through the OpenAI provider adapter. Use it when current or externally sourced information is needed.",
|
|
104
|
+
].join("\n\n"),
|
|
105
|
+
}));
|
|
106
|
+
pi.on("before_provider_request", (event) => addOpenAiWebSearchProviderTool(event.payload, config));
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
const WEB_SEARCH_PROVIDER_ADAPTERS = {
|
|
111
|
+
openai: openAiWebSearchAdapter,
|
|
112
|
+
};
|
|
113
|
+
export function getWebSearchProviderAdapter(provider) {
|
|
114
|
+
return WEB_SEARCH_PROVIDER_ADAPTERS[provider];
|
|
115
|
+
}
|
|
116
|
+
export function createWebSearchProviderExtension(providerTool) {
|
|
117
|
+
return getWebSearchProviderAdapter(providerTool.provider).createExtension(providerTool.options);
|
|
118
|
+
}
|
|
119
|
+
export function isWebSearchProviderTool(tool) {
|
|
120
|
+
return tool.providerTool?.kind === "web_search";
|
|
121
|
+
}
|
|
122
|
+
export function createWebSearchToolProfile(options = {}) {
|
|
123
|
+
return {
|
|
124
|
+
name: "web_search",
|
|
125
|
+
description: "Searches the web through the configured provider adapter.",
|
|
126
|
+
providerTool: {
|
|
127
|
+
kind: "web_search",
|
|
128
|
+
provider: "openai",
|
|
129
|
+
options: {
|
|
130
|
+
externalWebAccess: true,
|
|
131
|
+
searchContextSize: "medium",
|
|
132
|
+
includeSources: true,
|
|
133
|
+
...options,
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
}
|
package/dist/web/auth.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createUnauthenticatedError } from "../auth/types.js";
|
|
2
|
+
export async function getWebAuthSession(context, request) {
|
|
3
|
+
return context.auth?.getSession(request.headers);
|
|
4
|
+
}
|
|
5
|
+
export async function requireWebSession(context, request) {
|
|
6
|
+
const authSession = await getWebAuthSession(context, request);
|
|
7
|
+
if (!authSession)
|
|
8
|
+
throw createUnauthenticatedError();
|
|
9
|
+
return { authSession, ownerScope: `user:${authSession.identity.userId}` };
|
|
10
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { createServer } from "node:http";
|
|
2
|
+
import { PiboAuthError } from "../auth/types.js";
|
|
3
|
+
import { requireWebSession } from "./auth.js";
|
|
4
|
+
import { PiboWebHttpError, nodeRequestToWebRequest, responseHtml, responseJson, sendWebResponse } from "./http.js";
|
|
5
|
+
export const DEFAULT_WEB_CHANNEL_HOST = "127.0.0.1";
|
|
6
|
+
export const DEFAULT_WEB_CHANNEL_PORT = 4788;
|
|
7
|
+
export const WEB_CHANNEL_NAME = "web-host";
|
|
8
|
+
function redirect(location) {
|
|
9
|
+
return new Response(null, {
|
|
10
|
+
status: 302,
|
|
11
|
+
headers: { location },
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function matchPrefix(pathname, prefix) {
|
|
15
|
+
return pathname === prefix || pathname.startsWith(`${prefix}/`);
|
|
16
|
+
}
|
|
17
|
+
function notFound() {
|
|
18
|
+
return responseJson({ error: "Not found" }, { status: 404 });
|
|
19
|
+
}
|
|
20
|
+
function createAppContext(channelContext) {
|
|
21
|
+
return {
|
|
22
|
+
channelContext,
|
|
23
|
+
requireSession(input) {
|
|
24
|
+
return requireWebSession(channelContext, input.request);
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function firstHeaderValue(value) {
|
|
29
|
+
const raw = Array.isArray(value) ? value[0] : value;
|
|
30
|
+
return raw?.split(",")[0]?.trim() || undefined;
|
|
31
|
+
}
|
|
32
|
+
function isLoopbackAddress(address) {
|
|
33
|
+
return address === "::1" || address === "127.0.0.1" || address?.startsWith("127.") === true || address?.startsWith("::ffff:127.") === true;
|
|
34
|
+
}
|
|
35
|
+
function createRequestBaseURL(nodeRequest, host, port) {
|
|
36
|
+
if (isLoopbackAddress(nodeRequest.socket.remoteAddress)) {
|
|
37
|
+
const forwardedHost = firstHeaderValue(nodeRequest.headers["x-forwarded-host"]);
|
|
38
|
+
const forwardedProto = firstHeaderValue(nodeRequest.headers["x-forwarded-proto"]);
|
|
39
|
+
if (forwardedHost && (forwardedProto === "http" || forwardedProto === "https")) {
|
|
40
|
+
return `${forwardedProto}://${forwardedHost}`;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return `http://${nodeRequest.headers.host ?? `${host}:${port}`}`;
|
|
44
|
+
}
|
|
45
|
+
function createCanonicalRedirect(request, canonicalBaseURL) {
|
|
46
|
+
if (!canonicalBaseURL || (request.method !== "GET" && request.method !== "HEAD"))
|
|
47
|
+
return undefined;
|
|
48
|
+
const url = new URL(request.url);
|
|
49
|
+
const canonical = new URL(canonicalBaseURL);
|
|
50
|
+
if (url.origin === canonical.origin)
|
|
51
|
+
return undefined;
|
|
52
|
+
if (url.pathname !== "/" && !matchPrefix(url.pathname, "/apps") && !matchPrefix(url.pathname, "/api/auth")) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
return redirect(new URL(`${url.pathname}${url.search}`, canonical.origin).toString());
|
|
56
|
+
}
|
|
57
|
+
export function createWebHostChannel(options = {}) {
|
|
58
|
+
const host = options.host ?? DEFAULT_WEB_CHANNEL_HOST;
|
|
59
|
+
const port = options.port ?? DEFAULT_WEB_CHANNEL_PORT;
|
|
60
|
+
let server;
|
|
61
|
+
let context;
|
|
62
|
+
const requireContext = () => {
|
|
63
|
+
if (!context)
|
|
64
|
+
throw new Error("Web channel is not started");
|
|
65
|
+
return context;
|
|
66
|
+
};
|
|
67
|
+
const handleAuthRequest = async (request) => {
|
|
68
|
+
const auth = requireContext().auth;
|
|
69
|
+
if (!auth?.handleRequest) {
|
|
70
|
+
return responseJson({ error: "Auth service does not expose HTTP routes" }, { status: 500 });
|
|
71
|
+
}
|
|
72
|
+
return auth.handleRequest(request);
|
|
73
|
+
};
|
|
74
|
+
const handleRequest = async (nodeRequest, nodeResponse) => {
|
|
75
|
+
try {
|
|
76
|
+
const baseURL = createRequestBaseURL(nodeRequest, host, port);
|
|
77
|
+
const request = await nodeRequestToWebRequest(nodeRequest, baseURL);
|
|
78
|
+
const url = new URL(request.url);
|
|
79
|
+
const canonicalRedirect = createCanonicalRedirect(request, options.canonicalBaseURL);
|
|
80
|
+
if (canonicalRedirect) {
|
|
81
|
+
await sendWebResponse(nodeResponse, canonicalRedirect);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (url.pathname.startsWith("/api/auth/")) {
|
|
85
|
+
await sendWebResponse(nodeResponse, await handleAuthRequest(request));
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const ctx = requireContext();
|
|
89
|
+
const apps = ctx.getWebApps();
|
|
90
|
+
const app = apps.find((candidate) => matchPrefix(url.pathname, candidate.mountPath) || matchPrefix(url.pathname, candidate.apiPrefix));
|
|
91
|
+
if (app) {
|
|
92
|
+
const response = await app.handleRequest(request, createAppContext(ctx));
|
|
93
|
+
await sendWebResponse(nodeResponse, response ?? notFound());
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (url.pathname === "/" && apps[0]) {
|
|
97
|
+
await sendWebResponse(nodeResponse, redirect(apps[0].mountPath));
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (url.pathname === "/") {
|
|
101
|
+
await sendWebResponse(nodeResponse, responseHtml("<!doctype html><title>Pibo</title><p>No web apps registered.</p>"));
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
await sendWebResponse(nodeResponse, notFound());
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
const status = error instanceof PiboAuthError || error instanceof PiboWebHttpError ? error.statusCode : 500;
|
|
108
|
+
await sendWebResponse(nodeResponse, responseJson({ error: error instanceof Error ? error.message : String(error) }, { status }));
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
return {
|
|
112
|
+
name: WEB_CHANNEL_NAME,
|
|
113
|
+
kind: "web",
|
|
114
|
+
description: "Same-origin HTTP host for pibo web apps and auth routes.",
|
|
115
|
+
auth: { mode: "required" },
|
|
116
|
+
async start(channelContext) {
|
|
117
|
+
if (server)
|
|
118
|
+
return;
|
|
119
|
+
context = channelContext;
|
|
120
|
+
server = createServer((request, response) => {
|
|
121
|
+
void handleRequest(request, response);
|
|
122
|
+
});
|
|
123
|
+
await new Promise((resolve, reject) => {
|
|
124
|
+
server.once("error", reject);
|
|
125
|
+
server.listen(port, host, () => {
|
|
126
|
+
server.off("error", reject);
|
|
127
|
+
resolve();
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
const address = this.getAddress();
|
|
131
|
+
if (address && options.announce !== false) {
|
|
132
|
+
console.error(`pibo web host listening on http://${address.host}:${address.port}`);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
async stop() {
|
|
136
|
+
context = undefined;
|
|
137
|
+
if (server) {
|
|
138
|
+
await new Promise((resolve, reject) => {
|
|
139
|
+
server.close((error) => (error ? reject(error) : resolve()));
|
|
140
|
+
});
|
|
141
|
+
server = undefined;
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
getAddress() {
|
|
145
|
+
const address = server?.address();
|
|
146
|
+
if (!address || typeof address === "string")
|
|
147
|
+
return undefined;
|
|
148
|
+
return { host: address.address, port: address.port };
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
}
|
package/dist/web/http.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export const MAX_WEB_REQUEST_BODY_BYTES = 4 * 1024 * 1024;
|
|
2
|
+
export class PiboWebHttpError extends Error {
|
|
3
|
+
statusCode;
|
|
4
|
+
constructor(message, statusCode) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.statusCode = statusCode;
|
|
7
|
+
this.name = "PiboWebHttpError";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export function responseJson(payload, init = {}) {
|
|
11
|
+
return new Response(JSON.stringify(payload), {
|
|
12
|
+
...init,
|
|
13
|
+
headers: {
|
|
14
|
+
"content-type": "application/json; charset=utf-8",
|
|
15
|
+
...init.headers,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export function responseHtml(html, init = {}) {
|
|
20
|
+
return new Response(html, {
|
|
21
|
+
...init,
|
|
22
|
+
headers: {
|
|
23
|
+
"content-type": "text/html; charset=utf-8",
|
|
24
|
+
...init.headers,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export async function readJsonBody(request) {
|
|
29
|
+
try {
|
|
30
|
+
const body = await request.json();
|
|
31
|
+
if (!body || typeof body !== "object")
|
|
32
|
+
throw new PiboWebHttpError("Invalid JSON body", 400);
|
|
33
|
+
return body;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
throw new PiboWebHttpError("Invalid JSON body", 400);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export async function nodeRequestToWebRequest(request, baseURL) {
|
|
40
|
+
const url = new URL(request.url ?? "/", baseURL);
|
|
41
|
+
const headers = new Headers();
|
|
42
|
+
for (const [key, value] of Object.entries(request.headers)) {
|
|
43
|
+
if (Array.isArray(value)) {
|
|
44
|
+
for (const entry of value)
|
|
45
|
+
headers.append(key, entry);
|
|
46
|
+
}
|
|
47
|
+
else if (value !== undefined) {
|
|
48
|
+
headers.set(key, value);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
let body;
|
|
52
|
+
if (request.method !== "GET" && request.method !== "HEAD") {
|
|
53
|
+
const chunks = [];
|
|
54
|
+
let receivedBytes = 0;
|
|
55
|
+
for await (const chunk of request) {
|
|
56
|
+
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
57
|
+
receivedBytes += buffer.length;
|
|
58
|
+
if (receivedBytes > MAX_WEB_REQUEST_BODY_BYTES) {
|
|
59
|
+
throw new PiboWebHttpError("Request body too large", 413);
|
|
60
|
+
}
|
|
61
|
+
chunks.push(buffer);
|
|
62
|
+
}
|
|
63
|
+
body = Buffer.concat(chunks);
|
|
64
|
+
}
|
|
65
|
+
return new Request(url, {
|
|
66
|
+
method: request.method,
|
|
67
|
+
headers,
|
|
68
|
+
body,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
export async function sendWebResponse(response, webResponse) {
|
|
72
|
+
const headers = {};
|
|
73
|
+
const setCookie = webResponse.headers.getSetCookie?.();
|
|
74
|
+
webResponse.headers.forEach((value, key) => {
|
|
75
|
+
if (key.toLowerCase() !== "set-cookie") {
|
|
76
|
+
headers[key] = value;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
if (setCookie?.length) {
|
|
80
|
+
headers["set-cookie"] = setCookie;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
const setCookieHeader = webResponse.headers.get("set-cookie");
|
|
84
|
+
if (setCookieHeader) {
|
|
85
|
+
headers["set-cookie"] = setCookieHeader;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
response.writeHead(webResponse.status, headers);
|
|
89
|
+
if (!webResponse.body) {
|
|
90
|
+
response.end();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const reader = webResponse.body.getReader();
|
|
94
|
+
const cancel = () => {
|
|
95
|
+
void reader.cancel();
|
|
96
|
+
};
|
|
97
|
+
response.once("close", cancel);
|
|
98
|
+
try {
|
|
99
|
+
while (true) {
|
|
100
|
+
const { done, value } = await reader.read();
|
|
101
|
+
if (done)
|
|
102
|
+
break;
|
|
103
|
+
response.write(Buffer.from(value));
|
|
104
|
+
}
|
|
105
|
+
response.end();
|
|
106
|
+
}
|
|
107
|
+
finally {
|
|
108
|
+
response.off("close", cancel);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pasko70/pibo",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Minimal TypeScript wrapper around Pi Coding Agent.",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"context",
|
|
9
|
+
".codex/skills/pi-agent-harness/SKILL.md",
|
|
10
|
+
".codex/skills/pi-agent-harness/agents/openai.yaml",
|
|
11
|
+
"README.md",
|
|
12
|
+
"src/mcp/LICENSE.mcp-cli"
|
|
13
|
+
],
|
|
14
|
+
"bin": {
|
|
15
|
+
"pibo": "dist/bin/pibo.js"
|
|
16
|
+
},
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=24"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"dev": "tsx src/bin/pibo.ts",
|
|
22
|
+
"profile": "tsx src/bin/pibo.ts profile",
|
|
23
|
+
"tui": "tsx src/bin/pibo.ts tui",
|
|
24
|
+
"tui:routed": "tsx src/bin/pibo.ts tui:routed",
|
|
25
|
+
"tui:gateway": "tsx src/bin/pibo.ts tui gateway-producer",
|
|
26
|
+
"gateway": "tsx src/bin/pibo.ts gateway",
|
|
27
|
+
"gateway:web": "npm run web-ui:build && tsx src/bin/pibo.ts gateway:web",
|
|
28
|
+
"client": "tsx src/bin/pibo.ts client",
|
|
29
|
+
"chat-ui:build": "vite build --config src/apps/chat-ui/vite.config.ts",
|
|
30
|
+
"chat-ui:typecheck": "tsc -p src/apps/chat-ui/tsconfig.json --noEmit",
|
|
31
|
+
"context-files-ui:build": "vite build --config src/apps/context-files-ui/vite.config.ts",
|
|
32
|
+
"context-files-ui:typecheck": "tsc -p src/apps/context-files-ui/tsconfig.json --noEmit",
|
|
33
|
+
"web-ui:build": "npm run chat-ui:build && npm run context-files-ui:build",
|
|
34
|
+
"build": "tsc -p tsconfig.json && npm run web-ui:build",
|
|
35
|
+
"start": "node dist/bin/pibo.js",
|
|
36
|
+
"test": "npm run build && node --test test/*.test.mjs",
|
|
37
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && npm run chat-ui:typecheck && npm run context-files-ui:typecheck",
|
|
38
|
+
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
|
|
39
|
+
"prepack": "npm run build"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@mariozechner/pi-ai": "^0.70.2",
|
|
43
|
+
"@mariozechner/pi-coding-agent": "^0.70.2",
|
|
44
|
+
"@mdxeditor/editor": "^3.55.0",
|
|
45
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
46
|
+
"@tailwindcss/vite": "^4.2.4",
|
|
47
|
+
"@tanstack/react-query": "^5.100.7",
|
|
48
|
+
"@tanstack/react-router": "^1.168.25",
|
|
49
|
+
"@tanstack/react-start": "^1.167.50",
|
|
50
|
+
"@uiw/react-json-view": "^2.0.0-alpha.41",
|
|
51
|
+
"better-auth": "^1.6.9",
|
|
52
|
+
"commander": "^14.0.3",
|
|
53
|
+
"lexical": "^0.35.0",
|
|
54
|
+
"lucide-react": "^0.545.0",
|
|
55
|
+
"prismjs": "^1.30.0",
|
|
56
|
+
"react": "^19.2.5",
|
|
57
|
+
"react-dom": "^19.2.5",
|
|
58
|
+
"react-markdown": "^10.1.0",
|
|
59
|
+
"remark-gfm": "^4.0.1",
|
|
60
|
+
"tailwindcss": "^4.2.4"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@tanstack/router-plugin": "^1.167.28",
|
|
64
|
+
"@types/node": "^25.6.0",
|
|
65
|
+
"@types/prismjs": "^1.26.6",
|
|
66
|
+
"@types/react": "^19.2.14",
|
|
67
|
+
"@types/react-dom": "^19.2.3",
|
|
68
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
69
|
+
"tsx": "^4.21.0",
|
|
70
|
+
"typescript": "^6.0.3",
|
|
71
|
+
"vite": "^8.0.10",
|
|
72
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|