@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,85 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { extname, isAbsolute, resolve } from "node:path";
|
|
4
|
+
import { StringEnum, Type } from "@mariozechner/pi-ai";
|
|
5
|
+
import { defineTool } from "@mariozechner/pi-coding-agent";
|
|
6
|
+
function resolveCwd(baseCwd, workdir) {
|
|
7
|
+
if (!workdir || workdir.trim().length === 0)
|
|
8
|
+
return baseCwd;
|
|
9
|
+
return isAbsolute(workdir) ? workdir : resolve(baseCwd, workdir);
|
|
10
|
+
}
|
|
11
|
+
function mimeTypeForPath(path) {
|
|
12
|
+
switch (extname(path).toLowerCase()) {
|
|
13
|
+
case ".jpg":
|
|
14
|
+
case ".jpeg":
|
|
15
|
+
return "image/jpeg";
|
|
16
|
+
case ".webp":
|
|
17
|
+
return "image/webp";
|
|
18
|
+
case ".gif":
|
|
19
|
+
return "image/gif";
|
|
20
|
+
default:
|
|
21
|
+
return "image/png";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function createCodexCompatToolDefinitions() {
|
|
25
|
+
const applyPatch = defineTool({
|
|
26
|
+
name: "apply_patch",
|
|
27
|
+
label: "Apply Patch",
|
|
28
|
+
description: "Applies a Codex-style patch to files in the workspace.",
|
|
29
|
+
promptSnippet: "Use apply_patch for manual file edits by passing the complete patch text.",
|
|
30
|
+
executionMode: "sequential",
|
|
31
|
+
parameters: Type.Object({
|
|
32
|
+
patch: Type.String({ description: "Patch text starting with *** Begin Patch and ending with *** End Patch." }),
|
|
33
|
+
workdir: Type.Optional(Type.String({ description: "Working directory. Defaults to the runtime cwd." })),
|
|
34
|
+
}),
|
|
35
|
+
async execute(_toolCallId, params, signal, _onUpdate, ctx) {
|
|
36
|
+
const cwd = resolveCwd(ctx.cwd, params.workdir);
|
|
37
|
+
const result = await new Promise((resolveApply, reject) => {
|
|
38
|
+
const child = spawn("apply_patch", [], { cwd, env: process.env, stdio: "pipe" });
|
|
39
|
+
let output = "";
|
|
40
|
+
const abort = () => child.kill("SIGTERM");
|
|
41
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
42
|
+
child.stdout.on("data", (chunk) => {
|
|
43
|
+
output += String(chunk);
|
|
44
|
+
});
|
|
45
|
+
child.stderr.on("data", (chunk) => {
|
|
46
|
+
output += String(chunk);
|
|
47
|
+
});
|
|
48
|
+
child.once("error", reject);
|
|
49
|
+
child.once("close", (exitCode) => {
|
|
50
|
+
signal?.removeEventListener("abort", abort);
|
|
51
|
+
resolveApply({ exitCode, output });
|
|
52
|
+
});
|
|
53
|
+
child.stdin.end(params.patch);
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
content: [{ type: "text", text: result.output }],
|
|
57
|
+
details: { exitCode: result.exitCode, cwd },
|
|
58
|
+
isError: result.exitCode !== 0,
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
const viewImage = defineTool({
|
|
63
|
+
name: "view_image",
|
|
64
|
+
label: "View Image",
|
|
65
|
+
description: "Reads a local image file and returns it as an inline image result.",
|
|
66
|
+
promptSnippet: "Use view_image to inspect a local image path when visual details matter.",
|
|
67
|
+
executionMode: "parallel",
|
|
68
|
+
parameters: Type.Object({
|
|
69
|
+
path: Type.String({ description: "Local filesystem path to an image file." }),
|
|
70
|
+
detail: Type.Optional(StringEnum(["original"], { description: "Use original resolution when set." })),
|
|
71
|
+
}),
|
|
72
|
+
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
73
|
+
const path = resolveCwd(ctx.cwd, params.path);
|
|
74
|
+
const data = await readFile(path);
|
|
75
|
+
return {
|
|
76
|
+
content: [{ type: "image", data: data.toString("base64"), mimeType: mimeTypeForPath(path) }],
|
|
77
|
+
details: { path, detail: params.detail },
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
return [
|
|
82
|
+
applyPatch,
|
|
83
|
+
viewImage,
|
|
84
|
+
];
|
|
85
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { existsSync, readdirSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
export function hasDesktopDisplay(desktop) {
|
|
4
|
+
return Boolean(desktop.display || desktop.waylandDisplay);
|
|
5
|
+
}
|
|
6
|
+
function getRuntimeDir() {
|
|
7
|
+
if (process.env.XDG_RUNTIME_DIR)
|
|
8
|
+
return process.env.XDG_RUNTIME_DIR;
|
|
9
|
+
if (typeof process.getuid !== 'function')
|
|
10
|
+
return undefined;
|
|
11
|
+
return `/run/user/${process.getuid()}`;
|
|
12
|
+
}
|
|
13
|
+
function findXDisplay() {
|
|
14
|
+
if (process.env.DISPLAY)
|
|
15
|
+
return process.env.DISPLAY;
|
|
16
|
+
if (!existsSync('/tmp/.X11-unix/X0'))
|
|
17
|
+
return undefined;
|
|
18
|
+
return ':0';
|
|
19
|
+
}
|
|
20
|
+
function findWaylandDisplay(runtimeDir) {
|
|
21
|
+
if (process.env.WAYLAND_DISPLAY)
|
|
22
|
+
return process.env.WAYLAND_DISPLAY;
|
|
23
|
+
if (!runtimeDir)
|
|
24
|
+
return undefined;
|
|
25
|
+
if (existsSync(join(runtimeDir, 'wayland-0')))
|
|
26
|
+
return 'wayland-0';
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
function findXauthority(runtimeDir) {
|
|
30
|
+
if (process.env.XAUTHORITY)
|
|
31
|
+
return process.env.XAUTHORITY;
|
|
32
|
+
if (!runtimeDir || !existsSync(runtimeDir))
|
|
33
|
+
return undefined;
|
|
34
|
+
let authFile;
|
|
35
|
+
try {
|
|
36
|
+
authFile = readdirSync(runtimeDir).find((name) => name.startsWith('.mutter-Xwaylandauth.'));
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
return authFile ? join(runtimeDir, authFile) : undefined;
|
|
42
|
+
}
|
|
43
|
+
export function detectDesktopEnv() {
|
|
44
|
+
if (process.platform !== 'linux')
|
|
45
|
+
return {};
|
|
46
|
+
const xdgRuntimeDir = getRuntimeDir();
|
|
47
|
+
const display = findXDisplay();
|
|
48
|
+
const waylandDisplay = findWaylandDisplay(xdgRuntimeDir);
|
|
49
|
+
const xauthority = findXauthority(xdgRuntimeDir);
|
|
50
|
+
const dbusPath = xdgRuntimeDir ? join(xdgRuntimeDir, 'bus') : undefined;
|
|
51
|
+
const dbusSessionBusAddress = process.env.DBUS_SESSION_BUS_ADDRESS ??
|
|
52
|
+
(dbusPath && existsSync(dbusPath) ? `unix:path=${dbusPath}` : undefined);
|
|
53
|
+
return {
|
|
54
|
+
display,
|
|
55
|
+
waylandDisplay,
|
|
56
|
+
xauthority,
|
|
57
|
+
xdgRuntimeDir,
|
|
58
|
+
dbusSessionBusAddress,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export function getDesktopProcessEnv() {
|
|
62
|
+
const desktop = detectDesktopEnv();
|
|
63
|
+
const env = {};
|
|
64
|
+
if (desktop.display)
|
|
65
|
+
env.DISPLAY = desktop.display;
|
|
66
|
+
if (desktop.waylandDisplay)
|
|
67
|
+
env.WAYLAND_DISPLAY = desktop.waylandDisplay;
|
|
68
|
+
if (desktop.xauthority)
|
|
69
|
+
env.XAUTHORITY = desktop.xauthority;
|
|
70
|
+
if (desktop.xdgRuntimeDir)
|
|
71
|
+
env.XDG_RUNTIME_DIR = desktop.xdgRuntimeDir;
|
|
72
|
+
if (desktop.dbusSessionBusAddress)
|
|
73
|
+
env.DBUS_SESSION_BUS_ADDRESS = desktop.dbusSessionBusAddress;
|
|
74
|
+
return env;
|
|
75
|
+
}
|
|
76
|
+
export function printDesktopEnvStatus(indent = ' ') {
|
|
77
|
+
const desktop = detectDesktopEnv();
|
|
78
|
+
if (hasDesktopDisplay(desktop)) {
|
|
79
|
+
const parts = [
|
|
80
|
+
desktop.display ? `DISPLAY=${desktop.display}` : undefined,
|
|
81
|
+
desktop.waylandDisplay ? `WAYLAND_DISPLAY=${desktop.waylandDisplay}` : undefined,
|
|
82
|
+
desktop.xauthority ? `XAUTHORITY=${desktop.xauthority}` : undefined,
|
|
83
|
+
].filter(Boolean);
|
|
84
|
+
console.log(`${indent}desktop: detected (${parts.join(', ')})`);
|
|
85
|
+
console.log(`${indent}headed browser: available after applying pibo tools env`);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
console.log(`${indent}desktop: not detected`);
|
|
89
|
+
console.log(`${indent}warning: headed browser mode is unavailable; use headless mode or start a desktop display first.`);
|
|
90
|
+
}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
export const BROWSER_USE_GUIDE = {
|
|
2
|
+
name: 'browser-use',
|
|
3
|
+
description: 'Local browser automation with the browser-use CLI.',
|
|
4
|
+
content: `---
|
|
5
|
+
name: browser-use
|
|
6
|
+
description: Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, or extract information from web pages.
|
|
7
|
+
allowed-tools: Bash(browser-use:*)
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Browser Automation with browser-use CLI
|
|
11
|
+
|
|
12
|
+
The browser-use command provides persistent browser automation. A background daemon keeps the browser open across commands, so repeated commands are fast.
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
Initialize one persistent browser-use shell by applying the Pibo tool environment once:
|
|
17
|
+
|
|
18
|
+
\`\`\`bash
|
|
19
|
+
eval "$(pibo tools env browser-use)"
|
|
20
|
+
browser-use doctor
|
|
21
|
+
\`\`\`
|
|
22
|
+
|
|
23
|
+
Inside the Pibo source repo, use \`eval "$(npm run --silent dev -- tools env browser-use)"\` instead. Keep running later \`browser-use\` commands in that same shell; a new shell needs the one-time initialization again. If command substitution is not available, run the env command and apply the printed exports manually. On Linux, it includes detected desktop variables such as \`DISPLAY\`, \`WAYLAND_DISPLAY\`, and \`XAUTHORITY\` when a local desktop is available.
|
|
24
|
+
|
|
25
|
+
The Pibo tool environment wraps \`browser-use\`: when a new browser daemon session is started, it starts a Pibo-managed persistent Chrome profile named \`PIBo\` with CDP and connects Browser Use to it. This avoids Browser Use's normal temporary profile copy, so sign-ins made in that profile stay on disk. Pass \`--fresh-profile\` to start a fresh temporary browser profile instead.
|
|
26
|
+
|
|
27
|
+
## Core Workflow
|
|
28
|
+
|
|
29
|
+
1. Navigate: \`browser-use --headed --session NAME open <url>\` when a desktop is available; otherwise use \`browser-use --session NAME open <url>\`
|
|
30
|
+
2. Inspect: \`browser-use state\`
|
|
31
|
+
3. Interact with indices from state: \`browser-use click 5\`, \`browser-use input 3 "text"\`
|
|
32
|
+
4. Verify: \`browser-use state\`, \`browser-use get value <index>\`, \`browser-use eval "js"\`, or \`browser-use screenshot\`
|
|
33
|
+
5. Repeat while the browser stays open
|
|
34
|
+
|
|
35
|
+
Run browser-mutating commands one at a time per session. Do not issue parallel \`click\`, \`input\`, \`open\`, \`eval\`, or \`screenshot\` calls against the same session.
|
|
36
|
+
|
|
37
|
+
If a command fails, run \`browser-use close\` first to clear the session, then retry.
|
|
38
|
+
|
|
39
|
+
After navigation, submit, keypress navigation, major DOM changes, or scroll on complex pages, run \`state\` again before reusing element indices.
|
|
40
|
+
|
|
41
|
+
## Browser Modes
|
|
42
|
+
|
|
43
|
+
\`\`\`bash
|
|
44
|
+
browser-use --headed open <url> # Starts Pibo-managed persistent PIBo Chrome via CDP
|
|
45
|
+
browser-use --fresh-profile open <url> # Starts a fresh temporary browser profile
|
|
46
|
+
browser-use connect # Connect to local Chrome via CDP
|
|
47
|
+
browser-use --profile "Default" open <url> # Upstream profile mode; Browser Use may copy it to a temp dir
|
|
48
|
+
\`\`\`
|
|
49
|
+
|
|
50
|
+
## Commands
|
|
51
|
+
|
|
52
|
+
\`\`\`bash
|
|
53
|
+
# Navigation
|
|
54
|
+
browser-use open <url>
|
|
55
|
+
browser-use back
|
|
56
|
+
browser-use scroll down
|
|
57
|
+
browser-use scroll up
|
|
58
|
+
browser-use switch <index>
|
|
59
|
+
browser-use close-tab [index]
|
|
60
|
+
|
|
61
|
+
# Page state
|
|
62
|
+
browser-use state
|
|
63
|
+
browser-use screenshot [path.png]
|
|
64
|
+
browser-use screenshot --full path.png
|
|
65
|
+
|
|
66
|
+
# Interactions
|
|
67
|
+
browser-use click <index>
|
|
68
|
+
browser-use click <x> <y>
|
|
69
|
+
browser-use type "text"
|
|
70
|
+
browser-use input <index> "text"
|
|
71
|
+
browser-use input <index> ""
|
|
72
|
+
browser-use keys "Enter"
|
|
73
|
+
browser-use keys "Control+a"
|
|
74
|
+
browser-use select <index> "option"
|
|
75
|
+
browser-use upload <index> <path>
|
|
76
|
+
browser-use hover <index>
|
|
77
|
+
browser-use dblclick <index>
|
|
78
|
+
browser-use rightclick <index>
|
|
79
|
+
|
|
80
|
+
# Data extraction
|
|
81
|
+
browser-use eval "js code"
|
|
82
|
+
browser-use get title
|
|
83
|
+
browser-use get html
|
|
84
|
+
browser-use get html --selector "h1"
|
|
85
|
+
browser-use get text <index>
|
|
86
|
+
browser-use get value <index>
|
|
87
|
+
browser-use get attributes <index>
|
|
88
|
+
browser-use get bbox <index>
|
|
89
|
+
|
|
90
|
+
# Wait
|
|
91
|
+
browser-use wait selector "css"
|
|
92
|
+
browser-use wait text "Success"
|
|
93
|
+
|
|
94
|
+
# Cookies
|
|
95
|
+
browser-use cookies get
|
|
96
|
+
browser-use cookies get --url <url>
|
|
97
|
+
browser-use cookies set <name> <value>
|
|
98
|
+
browser-use cookies clear
|
|
99
|
+
browser-use cookies export <file>
|
|
100
|
+
browser-use cookies import <file>
|
|
101
|
+
|
|
102
|
+
# Session
|
|
103
|
+
browser-use close
|
|
104
|
+
browser-use sessions
|
|
105
|
+
browser-use close --all
|
|
106
|
+
\`\`\`
|
|
107
|
+
|
|
108
|
+
## Authenticated Browsing
|
|
109
|
+
|
|
110
|
+
For the Pibo Chat Web App, prefer an isolated authenticated lease when multiple agents may use the browser at the same time:
|
|
111
|
+
|
|
112
|
+
\`\`\`bash
|
|
113
|
+
eval "$(pibo tools browser-use lease acquire --app pibo-chat --owner "$USER")"
|
|
114
|
+
browser-use state
|
|
115
|
+
\`\`\`
|
|
116
|
+
|
|
117
|
+
The lease exports \`BROWSER_USE_HOME\`, \`PIBO_BROWSER_USE_SESSION\`, \`PIBO_BROWSER_USE_CHROME_USER_DATA_DIR\`, and \`PIBO_BROWSER_USE_DEFAULT_PROFILE\`. The Pibo browser-use wrapper uses \`PIBO_BROWSER_USE_SESSION\` as the default session, so later commands can omit \`--session\` in that shell.
|
|
118
|
+
|
|
119
|
+
Before acquiring leases, prepare one authenticated template profile:
|
|
120
|
+
|
|
121
|
+
\`\`\`bash
|
|
122
|
+
eval "$(pibo tools browser-use auth-template env)"
|
|
123
|
+
browser-use --headed open http://4788.192.168.0.204.sslip.io/apps/chat
|
|
124
|
+
\`\`\`
|
|
125
|
+
|
|
126
|
+
Sign in once in that template browser, then close it before agents acquire leases. Inspect and clean up leases with:
|
|
127
|
+
|
|
128
|
+
\`\`\`bash
|
|
129
|
+
pibo tools browser-use lease list
|
|
130
|
+
pibo tools browser-use lease release <lease-id>
|
|
131
|
+
pibo tools browser-use lease reap-stale
|
|
132
|
+
\`\`\`
|
|
133
|
+
|
|
134
|
+
If a shared legacy session is already available, inspect it before navigating:
|
|
135
|
+
|
|
136
|
+
\`\`\`bash
|
|
137
|
+
browser-use --session pibo-auth state
|
|
138
|
+
\`\`\`
|
|
139
|
+
|
|
140
|
+
If \`pibo-auth\` is unavailable and must be recreated, the default wrapper behavior is enough:
|
|
141
|
+
|
|
142
|
+
\`\`\`bash
|
|
143
|
+
browser-use --headed --session pibo-auth open http://4788.192.168.0.204.sslip.io/apps/chat
|
|
144
|
+
\`\`\`
|
|
145
|
+
|
|
146
|
+
For low-level Chat Web debugging, prefer an already-open authenticated browser over launching a new profile. Start by listing CDP targets:
|
|
147
|
+
|
|
148
|
+
\`\`\`bash
|
|
149
|
+
npm run dev -- tools browser-use targets
|
|
150
|
+
npm run dev -- tools browser-use attach-chat
|
|
151
|
+
curl -s http://127.0.0.1:56663/json/list
|
|
152
|
+
\`\`\`
|
|
153
|
+
|
|
154
|
+
Inspect Chat Web targets and pick the one that is authenticated and has a composer textarea. \`attach-chat\` prints shell exports for the best existing authenticated Chat target. If Browser Use cannot attach cleanly or MCP resources are unavailable, use the target \`webSocketDebuggerUrl\` from \`targets\`, \`attach-chat\`, or \`/json/list\` and direct CDP \`Runtime.evaluate\`, \`Network\`, and DOM inspection.
|
|
155
|
+
|
|
156
|
+
For authenticated sites, the default Pibo wrapper path is the persistent path. Use \`profile list\` only to inspect available Chrome profiles:
|
|
157
|
+
|
|
158
|
+
\`\`\`bash
|
|
159
|
+
browser-use profile list
|
|
160
|
+
\`\`\`
|
|
161
|
+
|
|
162
|
+
To intentionally use a real local Chrome user data directory instead of the Pibo-managed one, set \`PIBO_BROWSER_USE_CHROME_USER_DATA_DIR\` before starting the session.
|
|
163
|
+
|
|
164
|
+
If \`browser-use connect\` cannot find Chrome, ask the user whether they want to relaunch Chrome with remote debugging or use a managed Chromium profile.
|
|
165
|
+
|
|
166
|
+
## Tips
|
|
167
|
+
|
|
168
|
+
1. Apply \`eval "$(pibo tools env browser-use)"\` once per persistent shell before using the CLI from Pibo, then reuse that shell.
|
|
169
|
+
2. Always run \`state\` before using element indices.
|
|
170
|
+
3. Re-run \`state\` after navigation or large DOM changes because element indices can change.
|
|
171
|
+
4. For forms, verify inputs with \`get value <index>\`; \`state\` does not always show current text values.
|
|
172
|
+
5. For large pages, prefer \`get html --selector\`, \`get text <index>\`, or \`eval\` over dumping the full page with \`state\`.
|
|
173
|
+
6. Use \`--headed\` when debugging browser behavior if the env output includes a display.
|
|
174
|
+
7. Sessions persist until \`browser-use close\`.
|
|
175
|
+
8. Use \`--session NAME\` for separate browser sessions.
|
|
176
|
+
9. Wrap long waits or JavaScript-heavy mutations with an external timeout, for example \`timeout 30s browser-use --session NAME wait text "Success"\`.
|
|
177
|
+
10. Prefer \`--json\` for machine-readable \`get\` and \`sessions\` results.
|
|
178
|
+
11. \`select\` confirms the visible option text, while \`get value\` returns the underlying option value.
|
|
179
|
+
12. Avoid \`browser-use --version\`; this CLI does not support it.
|
|
180
|
+
13. Avoid \`extract\`; it is listed by the CLI but is not implemented in this version.
|
|
181
|
+
`,
|
|
182
|
+
};
|
|
183
|
+
export const REMOTE_BROWSER_GUIDE = {
|
|
184
|
+
name: 'remote-browser',
|
|
185
|
+
description: 'Browser automation workflow for sandboxed or remote agents.',
|
|
186
|
+
content: `---
|
|
187
|
+
name: remote-browser
|
|
188
|
+
description: Controls a browser from a sandboxed or remote machine. Use when the agent has no local GUI and needs to navigate websites, interact with web pages, take screenshots, or expose local dev servers via tunnels.
|
|
189
|
+
allowed-tools: Bash(browser-use:*)
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
# Browser Automation for Sandboxed Agents
|
|
193
|
+
|
|
194
|
+
This guide is for agents running in a sandbox, CI, cloud VM, or remote coding environment.
|
|
195
|
+
|
|
196
|
+
## Prerequisites
|
|
197
|
+
|
|
198
|
+
Initialize one persistent browser-use shell by applying the Pibo tool environment once:
|
|
199
|
+
|
|
200
|
+
\`\`\`bash
|
|
201
|
+
eval "$(pibo tools env browser-use)"
|
|
202
|
+
browser-use doctor
|
|
203
|
+
\`\`\`
|
|
204
|
+
|
|
205
|
+
Inside the Pibo source repo, use \`eval "$(npm run --silent dev -- tools env browser-use)"\` instead. Keep running later \`browser-use\` commands in that same shell; a new shell needs the one-time initialization again. If command substitution is not available, run the env command and apply the printed exports manually. On Linux, this lets Browser Use see a local desktop session when one exists.
|
|
206
|
+
|
|
207
|
+
## Core Workflow
|
|
208
|
+
|
|
209
|
+
1. Navigate: \`browser-use --headed --session NAME open <url>\` when a desktop is available; otherwise use \`browser-use --session NAME open <url>\`
|
|
210
|
+
2. Inspect: \`browser-use state\`
|
|
211
|
+
3. Interact with indices from state: \`browser-use click 5\`, \`browser-use input 3 "text"\`
|
|
212
|
+
4. Verify: \`browser-use state\`, \`browser-use get value <index>\`, \`browser-use eval "js"\`, or \`browser-use screenshot\`
|
|
213
|
+
5. Cleanup: \`browser-use close\`
|
|
214
|
+
|
|
215
|
+
Run browser-mutating commands one at a time per session. Use separate session names for parallel workflows.
|
|
216
|
+
After navigation, submit, keypress navigation, major DOM changes, or scroll on complex pages, run \`state\` again before reusing element indices.
|
|
217
|
+
|
|
218
|
+
## Browser Modes
|
|
219
|
+
|
|
220
|
+
\`\`\`bash
|
|
221
|
+
browser-use open <url>
|
|
222
|
+
browser-use --headed open <url>
|
|
223
|
+
browser-use connect
|
|
224
|
+
browser-use --cdp-url ws://localhost:9222/devtools/browser/... open <url>
|
|
225
|
+
\`\`\`
|
|
226
|
+
|
|
227
|
+
## Commands
|
|
228
|
+
|
|
229
|
+
\`\`\`bash
|
|
230
|
+
browser-use open <url>
|
|
231
|
+
browser-use back
|
|
232
|
+
browser-use state
|
|
233
|
+
browser-use screenshot [path.png]
|
|
234
|
+
browser-use click <index>
|
|
235
|
+
browser-use input <index> "text"
|
|
236
|
+
browser-use keys "Enter"
|
|
237
|
+
browser-use wait selector "css"
|
|
238
|
+
browser-use wait text "Success"
|
|
239
|
+
browser-use get html
|
|
240
|
+
browser-use eval "document.title"
|
|
241
|
+
browser-use switch <index>
|
|
242
|
+
browser-use close-tab [index]
|
|
243
|
+
browser-use close
|
|
244
|
+
\`\`\`
|
|
245
|
+
|
|
246
|
+
## Exposing Local Dev Servers
|
|
247
|
+
|
|
248
|
+
\`\`\`bash
|
|
249
|
+
browser-use tunnel <port>
|
|
250
|
+
browser-use tunnel list
|
|
251
|
+
browser-use open <tunnel-url>
|
|
252
|
+
browser-use tunnel stop <port>
|
|
253
|
+
\`\`\`
|
|
254
|
+
|
|
255
|
+
Tunnels are independent from browser sessions and can persist after \`browser-use close\`.
|
|
256
|
+
|
|
257
|
+
## Multiple Sessions
|
|
258
|
+
|
|
259
|
+
\`\`\`bash
|
|
260
|
+
browser-use --session agent-a open https://example.com
|
|
261
|
+
browser-use --session agent-b open https://example.org
|
|
262
|
+
\`\`\`
|
|
263
|
+
|
|
264
|
+
Use named sessions when multiple agents or workflows need separate browsers.
|
|
265
|
+
|
|
266
|
+
## Troubleshooting
|
|
267
|
+
|
|
268
|
+
- Browser will not start: run \`browser-use close\`, then retry.
|
|
269
|
+
- Element not found: run \`browser-use scroll down\`, then \`browser-use state\`.
|
|
270
|
+
- Form value unclear: use \`browser-use get value <index>\`.
|
|
271
|
+
- Large page state is noisy: use \`get html --selector\`, \`get text <index>\`, or \`eval\`.
|
|
272
|
+
- Need to debug visually: use \`--headed\`.
|
|
273
|
+
- Long wait hangs: wrap the command with \`timeout 30s\`.
|
|
274
|
+
- Tunnel not working: run \`browser-use tunnel list\`.
|
|
275
|
+
`,
|
|
276
|
+
};
|