@pasko70/pibo 2.1.1 → 2.2.1
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/dist/agent-runtime/capabilities.js +68 -0
- package/dist/agent-runtime/context-build.js +13 -5
- package/dist/agent-runtime/portable-history.js +526 -0
- package/dist/agent-runtime/profile-validation.js +13 -7
- package/dist/agent-runtime/resource-files.js +26 -10
- package/dist/agent-runtime/resource-service.js +216 -13
- package/dist/agent-runtimes/codex-native/adapter.js +38 -1
- package/dist/agent-runtimes/codex-native/auth.js +24 -3
- package/dist/agent-runtimes/codex-native/portable-history.js +73 -0
- package/dist/agent-runtimes/codex-native/process.js +38 -27
- package/dist/agent-runtimes/codex-native/resource-delivery.js +39 -16
- package/dist/agent-runtimes/codex-native/turn.js +68 -5
- package/dist/agent-runtimes/omp/adapter.js +43 -8
- package/dist/agent-runtimes/omp/process.js +26 -10
- package/dist/agent-runtimes/omp/resource-delivery.js +150 -84
- package/dist/agent-runtimes/pi/adapter.js +32 -1
- package/dist/agent-runtimes/pi/auth.js +34 -29
- package/dist/agent-runtimes/pi/credentials.js +43 -0
- package/dist/agent-runtimes/pi/model-catalog.js +7 -3
- package/dist/agent-runtimes/pi/portable-history.js +99 -0
- package/dist/agent-runtimes/pi/routed-session.js +1 -1
- package/dist/agent-runtimes/pi/runtime.js +31 -15
- package/dist/apps/chat/agent-profiles.js +1 -0
- package/dist/apps/chat/agent-store.js +31 -11
- package/dist/apps/chat/chat-files.js +19 -6
- package/dist/apps/chat/chat-request-normalizers.js +19 -0
- package/dist/apps/chat/trace.js +5 -0
- package/dist/apps/chat/web-app.js +55 -6
- package/dist/apps/chat-ui/assets/{apl-14BqhLYK.js → apl-gfMMiTNf.js} +1 -1
- package/dist/apps/chat-ui/assets/asciiarmor-C_eisQCp.js +1 -0
- package/dist/apps/{context-files-ui/assets/asn1-Bg4FbdCg.js → chat-ui/assets/asn1-DCl_8MCW.js} +1 -1
- package/dist/apps/{context-files-ui/assets/asterisk-B2MO-X4d.js → chat-ui/assets/asterisk-BEn0Cwpx.js} +1 -1
- package/dist/apps/chat-ui/assets/clike-D_6L3tnO.js +1 -0
- package/dist/apps/chat-ui/assets/cmake-84nbDH0I.js +1 -0
- package/dist/apps/chat-ui/assets/cobol-DHLQUbN7.js +1 -0
- package/dist/apps/chat-ui/assets/coffeescript-De_zI4J0.js +1 -0
- package/dist/apps/chat-ui/assets/commonlisp-DgAKBe0r.js +1 -0
- package/dist/apps/chat-ui/assets/crystal-Bsdphhtm.js +1 -0
- package/dist/apps/chat-ui/assets/css-CnaYoQib.js +1 -0
- package/dist/apps/chat-ui/assets/{d-TPqSVaHM.js → d-DWkQyNnU.js} +1 -1
- package/dist/apps/{context-files-ui/assets/dist-B7gXtTZC.js → chat-ui/assets/dist-B7DmqUNk.js} +1 -1
- package/dist/apps/chat-ui/assets/dist-BJ-TIk3N.js +1 -0
- package/dist/apps/chat-ui/assets/dist-BxYxDl5K.js +1 -0
- package/dist/apps/chat-ui/assets/dist-CqM4On9D.js +13 -0
- package/dist/apps/chat-ui/assets/dist-CswnpKik.js +1 -0
- package/dist/apps/{context-files-ui/assets/dist-DxEGebCR.js → chat-ui/assets/dist-CvYwol1J.js} +1 -1
- package/dist/apps/chat-ui/assets/dist-DHvUPfrF.js +1 -0
- package/dist/apps/chat-ui/assets/dist-DLJCGrGQ.js +1 -0
- package/dist/apps/chat-ui/assets/{dist-DLMjd26T.js → dist-DMiglryg.js} +1 -1
- package/dist/apps/chat-ui/assets/dist-DTeLDijr.js +9 -0
- package/dist/apps/chat-ui/assets/{dist-DKoyMSNr.js → dist-DpF08Yd7.js} +1 -1
- package/dist/apps/chat-ui/assets/dist-Dx7GMMHU.js +1 -0
- package/dist/apps/chat-ui/assets/dist-LCx98fA_.js +11 -0
- package/dist/apps/chat-ui/assets/{dist-DotDq_kD.js → dist-RKTRnzGb.js} +1 -1
- package/dist/apps/chat-ui/assets/dist-S3zJGntM.js +1 -0
- package/dist/apps/chat-ui/assets/{dist-sZgJkWZb.js → dist-SF43opz6.js} +1 -1
- package/dist/apps/{context-files-ui/assets/dist-BkUONE3N.js → chat-ui/assets/dist-XVYGiB-c.js} +1 -1
- package/dist/apps/chat-ui/assets/dist-eddbbGyw.js +1 -0
- package/dist/apps/chat-ui/assets/dist-fPhZsAUX.js +1 -0
- package/dist/apps/chat-ui/assets/dist-mpRGeo_R.js +2 -0
- package/dist/apps/chat-ui/assets/{dockerfile-CJb2sekW.js → dockerfile-DJkHQgkl.js} +1 -1
- package/dist/apps/chat-ui/assets/{dylan-08Azy1NK.js → dylan-BCDoL_-p.js} +1 -1
- package/dist/apps/chat-ui/assets/{ecl-dhxjHL8y.js → ecl-BVIeWmwY.js} +1 -1
- package/dist/apps/{context-files-ui/assets/erlang-BD5LkVkR.js → chat-ui/assets/erlang-BV0c4Hdn.js} +1 -1
- package/dist/apps/chat-ui/assets/{factor-B2EMQZkP.js → factor-LKH5gN8L.js} +1 -1
- package/dist/apps/chat-ui/assets/groovy-CUpZ7dEl.js +1 -0
- package/dist/apps/chat-ui/assets/{haxe-BJVKtprM.js → haxe-DjVOVvNP.js} +1 -1
- package/dist/apps/chat-ui/assets/index-2qGRr2cm.js +226 -0
- package/dist/apps/chat-ui/assets/index-QkfBrh9Q.css +1 -0
- package/dist/apps/chat-ui/assets/javascript-DoL9Wb-Q.js +1 -0
- package/dist/apps/chat-ui/assets/{lua-BxuTHaF7.js → lua-CiA1ziua.js} +1 -1
- package/dist/apps/chat-ui/assets/{mumps-Ds_ZaumL.js → mumps-BSzj6Xyz.js} +1 -1
- package/dist/apps/{context-files-ui/assets/nsis-DOo3SJmd.js → chat-ui/assets/nsis-CfSuhXs5.js} +1 -1
- package/dist/apps/chat-ui/assets/{ntriples-DLHGTvHs.js → ntriples-B9h1VB_g.js} +1 -1
- package/dist/apps/chat-ui/assets/perl-BkSkiI9m.js +1 -0
- package/dist/apps/chat-ui/assets/{powershell-B4IPkVxR.js → powershell-BcIto6Sf.js} +1 -1
- package/dist/apps/{context-files-ui/assets/pug-QU72BPAa.js → chat-ui/assets/pug-Gsm0M45u.js} +1 -1
- package/dist/apps/chat-ui/assets/puppet-BZyAS7I4.js +1 -0
- package/dist/apps/chat-ui/assets/python-B_1Jd8HM.js +1 -0
- package/dist/apps/chat-ui/assets/r-CxDmU1I4.js +1 -0
- package/dist/apps/chat-ui/assets/ruby-BjXV7-Qa.js +1 -0
- package/dist/apps/chat-ui/assets/scheme-D9qYN0V5.js +1 -0
- package/dist/apps/chat-ui/assets/{shell-BjiMLAaM.js → shell-DwuoZtxw.js} +1 -1
- package/dist/apps/chat-ui/assets/{simple-mode-DnMbQuKW.js → simple-mode-DXiLM1-G.js} +1 -1
- package/dist/apps/chat-ui/assets/sql-DuQMFDvy.js +1 -0
- package/dist/apps/chat-ui/assets/{stex-BCRT8IJ3.js → stex-DNzd62Q_.js} +1 -1
- package/dist/apps/chat-ui/assets/{stylus-CARoeVE9.js → stylus-BOVgKnng.js} +1 -1
- package/dist/apps/chat-ui/assets/textile-C4jVoHG1.js +1 -0
- package/dist/apps/chat-ui/assets/tiki-AK6FwT8q.js +1 -0
- package/dist/apps/chat-ui/assets/toml-BPTmHmyx.js +1 -0
- package/dist/apps/chat-ui/assets/{ttcn-GvRgs2AT.js → ttcn-PPSTk1ow.js} +1 -1
- package/dist/apps/chat-ui/assets/{ttcn-cfg-CGCXz7Vo.js → ttcn-cfg-2b4Gb5sE.js} +1 -1
- package/dist/apps/chat-ui/assets/turtle-Cx3rYX2g.js +1 -0
- package/dist/apps/chat-ui/assets/{verilog-DVCHmufx.js → verilog-7LoJAqYT.js} +1 -1
- package/dist/apps/chat-ui/assets/vhdl-kS471soi.js +1 -0
- package/dist/apps/{context-files-ui/assets/xquery-5f0hn7cg.js → chat-ui/assets/xquery-BKJx4mf9.js} +1 -1
- package/dist/apps/chat-ui/assets/z80-Co3PbHdE.js +1 -0
- package/dist/apps/chat-ui/index.html +5 -3
- package/dist/apps/chat-vscode-web/assets/index-C0sMILFt.js +41 -0
- package/dist/apps/chat-vscode-web/assets/index-CF1-9PKU.css +2 -0
- package/dist/apps/chat-vscode-web/index.html +2 -2
- package/dist/apps/context-files-ui/assets/{apl-14BqhLYK.js → apl-gfMMiTNf.js} +1 -1
- package/dist/apps/context-files-ui/assets/asciiarmor-C_eisQCp.js +1 -0
- package/dist/apps/{chat-ui/assets/asn1-Bg4FbdCg.js → context-files-ui/assets/asn1-DCl_8MCW.js} +1 -1
- package/dist/apps/{chat-ui/assets/asterisk-B2MO-X4d.js → context-files-ui/assets/asterisk-BEn0Cwpx.js} +1 -1
- package/dist/apps/context-files-ui/assets/clike-D_6L3tnO.js +1 -0
- package/dist/apps/context-files-ui/assets/cmake-84nbDH0I.js +1 -0
- package/dist/apps/context-files-ui/assets/cobol-DHLQUbN7.js +1 -0
- package/dist/apps/context-files-ui/assets/coffeescript-De_zI4J0.js +1 -0
- package/dist/apps/context-files-ui/assets/commonlisp-DgAKBe0r.js +1 -0
- package/dist/apps/context-files-ui/assets/crystal-Bsdphhtm.js +1 -0
- package/dist/apps/context-files-ui/assets/css-CnaYoQib.js +1 -0
- package/dist/apps/context-files-ui/assets/{d-TPqSVaHM.js → d-DWkQyNnU.js} +1 -1
- package/dist/apps/{chat-ui/assets/dist-C6LPDFXU.js → context-files-ui/assets/dist-BAqbgxUS.js} +1 -1
- package/dist/apps/context-files-ui/assets/dist-BJ-TIk3N.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-BcauuFwf.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-BecMXs79.js +1 -0
- package/dist/apps/context-files-ui/assets/{dist-C-Jm45P4.js → dist-Ci2NSlf1.js} +1 -1
- package/dist/apps/context-files-ui/assets/dist-CqM4On9D.js +13 -0
- package/dist/apps/context-files-ui/assets/dist-CswnpKik.js +1 -0
- package/dist/apps/{chat-ui/assets/dist-I26VB0QO.js → context-files-ui/assets/dist-D-xpsbZI.js} +1 -1
- package/dist/apps/context-files-ui/assets/dist-DHvUPfrF.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-DLJCGrGQ.js +1 -0
- package/dist/apps/context-files-ui/assets/{dist-DLMjd26T.js → dist-DMiglryg.js} +1 -1
- package/dist/apps/context-files-ui/assets/dist-DTeLDijr.js +9 -0
- package/dist/apps/context-files-ui/assets/{dist-DKoyMSNr.js → dist-DpF08Yd7.js} +1 -1
- package/dist/apps/context-files-ui/assets/dist-LCx98fA_.js +11 -0
- package/dist/apps/context-files-ui/assets/{dist-DotDq_kD.js → dist-RKTRnzGb.js} +1 -1
- package/dist/apps/context-files-ui/assets/dist-S3zJGntM.js +1 -0
- package/dist/apps/{chat-ui/assets/dist-BkUONE3N.js → context-files-ui/assets/dist-XVYGiB-c.js} +1 -1
- package/dist/apps/context-files-ui/assets/dist-eddbbGyw.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-fPhZsAUX.js +1 -0
- package/dist/apps/context-files-ui/assets/dist-mpRGeo_R.js +2 -0
- package/dist/apps/context-files-ui/assets/{dockerfile-CJb2sekW.js → dockerfile-DJkHQgkl.js} +1 -1
- package/dist/apps/context-files-ui/assets/{dylan-08Azy1NK.js → dylan-BCDoL_-p.js} +1 -1
- package/dist/apps/context-files-ui/assets/{ecl-dhxjHL8y.js → ecl-BVIeWmwY.js} +1 -1
- package/dist/apps/{chat-ui/assets/erlang-BD5LkVkR.js → context-files-ui/assets/erlang-BV0c4Hdn.js} +1 -1
- package/dist/apps/context-files-ui/assets/{factor-B2EMQZkP.js → factor-LKH5gN8L.js} +1 -1
- package/dist/apps/context-files-ui/assets/groovy-CUpZ7dEl.js +1 -0
- package/dist/apps/context-files-ui/assets/{haxe-BJVKtprM.js → haxe-DjVOVvNP.js} +1 -1
- package/dist/apps/context-files-ui/assets/index-CkWXlBNn.js +191 -0
- package/dist/apps/context-files-ui/assets/{index-Cs4XQITe.css → index-D8TsUizd.css} +1 -1
- package/dist/apps/context-files-ui/assets/javascript-DoL9Wb-Q.js +1 -0
- package/dist/apps/context-files-ui/assets/{lua-BxuTHaF7.js → lua-CiA1ziua.js} +1 -1
- package/dist/apps/context-files-ui/assets/{mumps-Ds_ZaumL.js → mumps-BSzj6Xyz.js} +1 -1
- package/dist/apps/{chat-ui/assets/nsis-DOo3SJmd.js → context-files-ui/assets/nsis-CfSuhXs5.js} +1 -1
- package/dist/apps/context-files-ui/assets/{ntriples-DLHGTvHs.js → ntriples-B9h1VB_g.js} +1 -1
- package/dist/apps/context-files-ui/assets/perl-BkSkiI9m.js +1 -0
- package/dist/apps/context-files-ui/assets/{powershell-B4IPkVxR.js → powershell-BcIto6Sf.js} +1 -1
- package/dist/apps/{chat-ui/assets/pug-QU72BPAa.js → context-files-ui/assets/pug-Gsm0M45u.js} +1 -1
- package/dist/apps/context-files-ui/assets/puppet-BZyAS7I4.js +1 -0
- package/dist/apps/context-files-ui/assets/python-B_1Jd8HM.js +1 -0
- package/dist/apps/context-files-ui/assets/r-CxDmU1I4.js +1 -0
- package/dist/apps/context-files-ui/assets/ruby-BjXV7-Qa.js +1 -0
- package/dist/apps/context-files-ui/assets/scheme-D9qYN0V5.js +1 -0
- package/dist/apps/context-files-ui/assets/{shell-BjiMLAaM.js → shell-DwuoZtxw.js} +1 -1
- package/dist/apps/context-files-ui/assets/{simple-mode-DnMbQuKW.js → simple-mode-DXiLM1-G.js} +1 -1
- package/dist/apps/context-files-ui/assets/sql-DuQMFDvy.js +1 -0
- package/dist/apps/context-files-ui/assets/{stex-BCRT8IJ3.js → stex-DNzd62Q_.js} +1 -1
- package/dist/apps/context-files-ui/assets/{stylus-CARoeVE9.js → stylus-BOVgKnng.js} +1 -1
- package/dist/apps/context-files-ui/assets/textile-C4jVoHG1.js +1 -0
- package/dist/apps/context-files-ui/assets/tiki-AK6FwT8q.js +1 -0
- package/dist/apps/context-files-ui/assets/toml-BPTmHmyx.js +1 -0
- package/dist/apps/context-files-ui/assets/{ttcn-GvRgs2AT.js → ttcn-PPSTk1ow.js} +1 -1
- package/dist/apps/context-files-ui/assets/{ttcn-cfg-CGCXz7Vo.js → ttcn-cfg-2b4Gb5sE.js} +1 -1
- package/dist/apps/context-files-ui/assets/turtle-Cx3rYX2g.js +1 -0
- package/dist/apps/context-files-ui/assets/{verilog-DVCHmufx.js → verilog-7LoJAqYT.js} +1 -1
- package/dist/apps/context-files-ui/assets/vhdl-kS471soi.js +1 -0
- package/dist/apps/{chat-ui/assets/xquery-5f0hn7cg.js → context-files-ui/assets/xquery-BKJx4mf9.js} +1 -1
- package/dist/apps/context-files-ui/assets/z80-Co3PbHdE.js +1 -0
- package/dist/apps/context-files-ui/index.html +5 -3
- package/dist/apps/vscode-artifacts/latest.vsix +0 -0
- package/dist/apps/vscode-artifacts/pibo-vscode-ext-2.2.1.vsix +0 -0
- package/dist/auth/better-auth.js +223 -30
- package/dist/auth/cli.js +10 -1
- package/dist/auth/machine-keys.js +8 -4
- package/dist/auth/openai-codex-usage.js +4 -4
- package/dist/cli-session/fakeSessionSource.js +2 -2
- package/dist/cli-session/localSessionSource.js +2 -2
- package/dist/cli.js +3 -1
- package/dist/config/config.js +9 -4
- package/dist/core/compaction-prompt.js +3 -1
- package/dist/core/context-build.js +1 -0
- package/dist/core/pibo-home.js +24 -1
- package/dist/core/private-path.js +146 -0
- package/dist/core/profiles.js +17 -3
- package/dist/core/sensitive-data-redaction.js +36 -0
- package/dist/core/session-model.js +1 -0
- package/dist/core/session-router.js +226 -30
- package/dist/data/pibo-store.js +5 -1
- package/dist/gateway/server.js +9 -0
- package/dist/plugins/context-files.js +11 -0
- package/dist/plugins/registry.js +3 -0
- package/dist/providers/openai-gpt56.js +0 -11
- package/dist/reliability/store.js +5 -1
- package/dist/resources/lifecycle.js +13 -3
- package/dist/runs/resource-isolation.js +159 -8
- package/dist/runs/tools.js +44 -1
- package/dist/sessions/pibo-data-store.js +3 -0
- package/dist/tools/codex-browser-node-repl.js +4 -2
- package/dist/tools/codex-browser.js +1 -1
- package/dist/tools/codex-image-generation.js +4 -4
- package/dist/tools/runtime/node-backend.js +4 -1
- package/dist/tools/runtime/python-backend.js +4 -1
- package/dist/web-annotations/api.js +22 -2
- package/npm-shrinkwrap.json +16707 -0
- package/package.json +19 -14
- package/dist/apps/chat-ui/assets/asciiarmor-WLvjqI7d.js +0 -1
- package/dist/apps/chat-ui/assets/clike-CjmcUpt6.js +0 -1
- package/dist/apps/chat-ui/assets/cmake-i2VDNaRq.js +0 -1
- package/dist/apps/chat-ui/assets/cobol-BwO6DF08.js +0 -1
- package/dist/apps/chat-ui/assets/coffeescript-BtivDvRz.js +0 -1
- package/dist/apps/chat-ui/assets/commonlisp-DFkEQdLP.js +0 -1
- package/dist/apps/chat-ui/assets/crystal-CU0NkcVL.js +0 -1
- package/dist/apps/chat-ui/assets/css-CbMZAQ1W.js +0 -1
- package/dist/apps/chat-ui/assets/dist-9v2ZXT6V.js +0 -11
- package/dist/apps/chat-ui/assets/dist-B1LVAytl.js +0 -9
- package/dist/apps/chat-ui/assets/dist-B5PTVnox.js +0 -1
- package/dist/apps/chat-ui/assets/dist-B5ZAfwf5.js +0 -1
- package/dist/apps/chat-ui/assets/dist-D1KyNDg5.js +0 -13
- package/dist/apps/chat-ui/assets/dist-DVtXxfHc.js +0 -1
- package/dist/apps/chat-ui/assets/dist-DW4Qrfbd.js +0 -2
- package/dist/apps/chat-ui/assets/dist-DmbsHdMC.js +0 -1
- package/dist/apps/chat-ui/assets/dist-DyvwuSFO.js +0 -1
- package/dist/apps/chat-ui/assets/dist-QQuDy4KA.js +0 -1
- package/dist/apps/chat-ui/assets/dist-RtHbJRPV.js +0 -1
- package/dist/apps/chat-ui/assets/groovy-Cmduloe1.js +0 -1
- package/dist/apps/chat-ui/assets/index-BPbNvcZe.css +0 -1
- package/dist/apps/chat-ui/assets/index-CIOf2uL2.js +0 -237
- package/dist/apps/chat-ui/assets/javascript-C5pDVaoP.js +0 -1
- package/dist/apps/chat-ui/assets/perl-D6YJObi_.js +0 -1
- package/dist/apps/chat-ui/assets/puppet-B_0GFuyD.js +0 -1
- package/dist/apps/chat-ui/assets/python-Cs7sNzy_.js +0 -1
- package/dist/apps/chat-ui/assets/r-CN5s4f3o.js +0 -1
- package/dist/apps/chat-ui/assets/ruby-BVPradRk.js +0 -1
- package/dist/apps/chat-ui/assets/scheme-CvNgHAnh.js +0 -1
- package/dist/apps/chat-ui/assets/sql-DYI2GwJR.js +0 -1
- package/dist/apps/chat-ui/assets/textile-Yg_UWn-t.js +0 -1
- package/dist/apps/chat-ui/assets/tiki-CC_ic8g0.js +0 -1
- package/dist/apps/chat-ui/assets/toml-B7gGzVkJ.js +0 -1
- package/dist/apps/chat-ui/assets/turtle-CwIpz2yy.js +0 -1
- package/dist/apps/chat-ui/assets/vhdl-BGDk4f1d.js +0 -1
- package/dist/apps/chat-ui/assets/z80-B7Dfb4UO.js +0 -1
- package/dist/apps/chat-vscode-web/assets/index-1ivRyjFs.js +0 -41
- package/dist/apps/chat-vscode-web/assets/index-Dupu1DzQ.css +0 -2
- package/dist/apps/context-files-ui/assets/asciiarmor-WLvjqI7d.js +0 -1
- package/dist/apps/context-files-ui/assets/clike-CjmcUpt6.js +0 -1
- package/dist/apps/context-files-ui/assets/cmake-i2VDNaRq.js +0 -1
- package/dist/apps/context-files-ui/assets/cobol-BwO6DF08.js +0 -1
- package/dist/apps/context-files-ui/assets/coffeescript-BtivDvRz.js +0 -1
- package/dist/apps/context-files-ui/assets/commonlisp-DFkEQdLP.js +0 -1
- package/dist/apps/context-files-ui/assets/crystal-CU0NkcVL.js +0 -1
- package/dist/apps/context-files-ui/assets/css-CbMZAQ1W.js +0 -1
- package/dist/apps/context-files-ui/assets/dist-B5PTVnox.js +0 -1
- package/dist/apps/context-files-ui/assets/dist-B5ZAfwf5.js +0 -1
- package/dist/apps/context-files-ui/assets/dist-BD262Ouw.js +0 -1
- package/dist/apps/context-files-ui/assets/dist-BKuGdcnX.js +0 -9
- package/dist/apps/context-files-ui/assets/dist-CHdx1Jri.js +0 -1
- package/dist/apps/context-files-ui/assets/dist-CULMH-fB.js +0 -11
- package/dist/apps/context-files-ui/assets/dist-Cjq6RWEt.js +0 -1
- package/dist/apps/context-files-ui/assets/dist-CntqFySz.js +0 -1
- package/dist/apps/context-files-ui/assets/dist-D1KyNDg5.js +0 -13
- package/dist/apps/context-files-ui/assets/dist-QQuDy4KA.js +0 -1
- package/dist/apps/context-files-ui/assets/dist-kPuQud7t.js +0 -2
- package/dist/apps/context-files-ui/assets/groovy-Cmduloe1.js +0 -1
- package/dist/apps/context-files-ui/assets/index-DZWsbuvg.js +0 -202
- package/dist/apps/context-files-ui/assets/javascript-C5pDVaoP.js +0 -1
- package/dist/apps/context-files-ui/assets/perl-D6YJObi_.js +0 -1
- package/dist/apps/context-files-ui/assets/puppet-B_0GFuyD.js +0 -1
- package/dist/apps/context-files-ui/assets/python-Cs7sNzy_.js +0 -1
- package/dist/apps/context-files-ui/assets/r-CN5s4f3o.js +0 -1
- package/dist/apps/context-files-ui/assets/ruby-BVPradRk.js +0 -1
- package/dist/apps/context-files-ui/assets/scheme-CvNgHAnh.js +0 -1
- package/dist/apps/context-files-ui/assets/sql-DYI2GwJR.js +0 -1
- package/dist/apps/context-files-ui/assets/textile-Yg_UWn-t.js +0 -1
- package/dist/apps/context-files-ui/assets/tiki-CC_ic8g0.js +0 -1
- package/dist/apps/context-files-ui/assets/toml-B7gGzVkJ.js +0 -1
- package/dist/apps/context-files-ui/assets/turtle-CwIpz2yy.js +0 -1
- package/dist/apps/context-files-ui/assets/vhdl-BGDk4f1d.js +0 -1
- package/dist/apps/context-files-ui/assets/z80-B7Dfb4UO.js +0 -1
- /package/dist/apps/chat-ui/assets/{brainfuck-CV9kufud.js → brainfuck-D5EjA2JK.js} +0 -0
- /package/dist/apps/chat-ui/assets/{clojure-De3QGfx6.js → clojure-BflJGmDX.js} +0 -0
- /package/dist/apps/chat-ui/assets/{cypher-Dke5QOzv.js → cypher-p9eYesGn.js} +0 -0
- /package/dist/apps/chat-ui/assets/{diff-B365LSoZ.js → diff-ChtP43wD.js} +0 -0
- /package/dist/apps/chat-ui/assets/{dtd-CBMymJ7O.js → dtd-DTF72YNO.js} +0 -0
- /package/dist/apps/chat-ui/assets/{ebnf-Dkum_1J8.js → ebnf-D4c0_ac3.js} +0 -0
- /package/dist/apps/chat-ui/assets/{eiffel-C446m6dI.js → eiffel-BEjRio4Q.js} +0 -0
- /package/dist/apps/chat-ui/assets/{elm-po1E9de0.js → elm-Cshzl8qu.js} +0 -0
- /package/dist/apps/chat-ui/assets/{fcl-DkEOamHd.js → fcl-ClOhbFR7.js} +0 -0
- /package/dist/apps/chat-ui/assets/{forth-dCg2_HVB.js → forth-Cezjo90N.js} +0 -0
- /package/dist/apps/chat-ui/assets/{fortran-3ZpXLFh1.js → fortran-Bt6PBEDR.js} +0 -0
- /package/dist/apps/chat-ui/assets/{gas-DMmxLZRI.js → gas-BHEdbvp9.js} +0 -0
- /package/dist/apps/chat-ui/assets/{gherkin-DUSFg2R6.js → gherkin-oBAE_ms0.js} +0 -0
- /package/dist/apps/chat-ui/assets/{haskell-Cyr255R9.js → haskell-BRsoo5mP.js} +0 -0
- /package/dist/apps/chat-ui/assets/{http-DszHFpc-.js → http-CLVgA2GD.js} +0 -0
- /package/dist/apps/chat-ui/assets/{idl-Cati9Nrv.js → idl-BUZw3wgd.js} +0 -0
- /package/dist/apps/chat-ui/assets/{julia-DlqY1cTU.js → julia-CQfgDRfP.js} +0 -0
- /package/dist/apps/chat-ui/assets/{livescript-C6p8-2W1.js → livescript-BXxG0Yva.js} +0 -0
- /package/dist/apps/chat-ui/assets/{mathematica-nDHZUMJT.js → mathematica-u8YMmbU0.js} +0 -0
- /package/dist/apps/chat-ui/assets/{mbox-DAaR0Hcz.js → mbox-BEMVcqjs.js} +0 -0
- /package/dist/apps/chat-ui/assets/{mirc-CCA0FRfl.js → mirc-C9zpzAZU.js} +0 -0
- /package/dist/apps/chat-ui/assets/{mllike-Cw3Iccsb.js → mllike-B45xgp2S.js} +0 -0
- /package/dist/apps/chat-ui/assets/{modelica-Czx80fNR.js → modelica-CqHI_q-D.js} +0 -0
- /package/dist/apps/chat-ui/assets/{mscgen-BmfuTbzG.js → mscgen-qgSLujhx.js} +0 -0
- /package/dist/apps/chat-ui/assets/{nginx-D9M2PQ4U.js → nginx-BMaDbqW3.js} +0 -0
- /package/dist/apps/chat-ui/assets/{octave-8jj96JiC.js → octave-D2Q8cUp1.js} +0 -0
- /package/dist/apps/chat-ui/assets/{oz-BmMq7iC4.js → oz-BwTct_5T.js} +0 -0
- /package/dist/apps/chat-ui/assets/{pascal-BgMr6XpT.js → pascal-Dp_KdFgX.js} +0 -0
- /package/dist/apps/chat-ui/assets/{pig-nx7uchs8.js → pig-AF4Hwhju.js} +0 -0
- /package/dist/apps/chat-ui/assets/{properties-CoavQdLC.js → properties-C357ku5U.js} +0 -0
- /package/dist/apps/chat-ui/assets/{protobuf-D5EWhcmc.js → protobuf-D1ij_kNL.js} +0 -0
- /package/dist/apps/chat-ui/assets/{q-BIB9pPtI.js → q-B9NhS7L_.js} +0 -0
- /package/dist/apps/chat-ui/assets/{rpm-Ct_Ck8mQ.js → rpm-gpDK5sbt.js} +0 -0
- /package/dist/apps/chat-ui/assets/{sas-DN4j74IF.js → sas-C2OyD2Y6.js} +0 -0
- /package/dist/apps/chat-ui/assets/{sieve-C2U1O5Z4.js → sieve-BAxa3IjF.js} +0 -0
- /package/dist/apps/chat-ui/assets/{smalltalk-DkYwYufV.js → smalltalk-BLp5-jwC.js} +0 -0
- /package/dist/apps/chat-ui/assets/{solr-BopnSD-v.js → solr-BBopId9w.js} +0 -0
- /package/dist/apps/chat-ui/assets/{sparql-Cpg3YQfd.js → sparql-Dz-mlCAC.js} +0 -0
- /package/dist/apps/chat-ui/assets/{spreadsheet-kRxtVt9J.js → spreadsheet-CTIncYxj.js} +0 -0
- /package/dist/apps/chat-ui/assets/{swift-DKNaLAK6.js → swift-DKB6_1j6.js} +0 -0
- /package/dist/apps/chat-ui/assets/{tcl-CQyXkgMH.js → tcl-BGfruO1u.js} +0 -0
- /package/dist/apps/chat-ui/assets/{tiddlywiki-dqVbkfX4.js → tiddlywiki-VlUiK86J.js} +0 -0
- /package/dist/apps/chat-ui/assets/{troff-Bq3z6oAu.js → troff-C2dAgh7P.js} +0 -0
- /package/dist/apps/chat-ui/assets/{vb-BmcHUM2C.js → vb-BthdM_4N.js} +0 -0
- /package/dist/apps/chat-ui/assets/{vbscript-Cs9dylre.js → vbscript-D9f6rSsU.js} +0 -0
- /package/dist/apps/chat-ui/assets/{velocity-CBWU0VCy.js → velocity-CqftRsjg.js} +0 -0
- /package/dist/apps/chat-ui/assets/{webidl-egXQEWlC.js → webidl-D5jiJvOU.js} +0 -0
- /package/dist/apps/chat-ui/assets/{yacas-DNs9XkmQ.js → yacas-CXXgtw0p.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{brainfuck-CV9kufud.js → brainfuck-D5EjA2JK.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{clojure-De3QGfx6.js → clojure-BflJGmDX.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{cypher-Dke5QOzv.js → cypher-p9eYesGn.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{diff-B365LSoZ.js → diff-ChtP43wD.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{dtd-CBMymJ7O.js → dtd-DTF72YNO.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{ebnf-Dkum_1J8.js → ebnf-D4c0_ac3.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{eiffel-C446m6dI.js → eiffel-BEjRio4Q.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{elm-po1E9de0.js → elm-Cshzl8qu.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{fcl-DkEOamHd.js → fcl-ClOhbFR7.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{forth-dCg2_HVB.js → forth-Cezjo90N.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{fortran-3ZpXLFh1.js → fortran-Bt6PBEDR.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{gas-DMmxLZRI.js → gas-BHEdbvp9.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{gherkin-DUSFg2R6.js → gherkin-oBAE_ms0.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{haskell-Cyr255R9.js → haskell-BRsoo5mP.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{http-DszHFpc-.js → http-CLVgA2GD.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{idl-Cati9Nrv.js → idl-BUZw3wgd.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{julia-DlqY1cTU.js → julia-CQfgDRfP.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{livescript-C6p8-2W1.js → livescript-BXxG0Yva.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{mathematica-nDHZUMJT.js → mathematica-u8YMmbU0.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{mbox-DAaR0Hcz.js → mbox-BEMVcqjs.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{mirc-CCA0FRfl.js → mirc-C9zpzAZU.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{mllike-Cw3Iccsb.js → mllike-B45xgp2S.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{modelica-Czx80fNR.js → modelica-CqHI_q-D.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{mscgen-BmfuTbzG.js → mscgen-qgSLujhx.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{nginx-D9M2PQ4U.js → nginx-BMaDbqW3.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{octave-8jj96JiC.js → octave-D2Q8cUp1.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{oz-BmMq7iC4.js → oz-BwTct_5T.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{pascal-BgMr6XpT.js → pascal-Dp_KdFgX.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{pig-nx7uchs8.js → pig-AF4Hwhju.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{properties-CoavQdLC.js → properties-C357ku5U.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{protobuf-D5EWhcmc.js → protobuf-D1ij_kNL.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{q-BIB9pPtI.js → q-B9NhS7L_.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{rpm-Ct_Ck8mQ.js → rpm-gpDK5sbt.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{sas-DN4j74IF.js → sas-C2OyD2Y6.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{sieve-C2U1O5Z4.js → sieve-BAxa3IjF.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{smalltalk-DkYwYufV.js → smalltalk-BLp5-jwC.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{solr-BopnSD-v.js → solr-BBopId9w.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{sparql-Cpg3YQfd.js → sparql-Dz-mlCAC.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{spreadsheet-kRxtVt9J.js → spreadsheet-CTIncYxj.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{swift-DKNaLAK6.js → swift-DKB6_1j6.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{tcl-CQyXkgMH.js → tcl-BGfruO1u.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{tiddlywiki-dqVbkfX4.js → tiddlywiki-VlUiK86J.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{troff-Bq3z6oAu.js → troff-C2dAgh7P.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{vb-BmcHUM2C.js → vb-BthdM_4N.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{vbscript-Cs9dylre.js → vbscript-D9f6rSsU.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{velocity-CBWU0VCy.js → velocity-CqftRsjg.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{webidl-egXQEWlC.js → webidl-D5jiJvOU.js} +0 -0
- /package/dist/apps/context-files-ui/assets/{yacas-DNs9XkmQ.js → yacas-CXXgtw0p.js} +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
function timestamp(createdAt) {
|
|
2
|
+
const parsed = Date.parse(createdAt);
|
|
3
|
+
return Number.isFinite(parsed) ? parsed : Date.now();
|
|
4
|
+
}
|
|
5
|
+
function textContent(entry) {
|
|
6
|
+
if (entry.type === "session_info")
|
|
7
|
+
return entry.name;
|
|
8
|
+
if (typeof entry.content === "string")
|
|
9
|
+
return entry.content;
|
|
10
|
+
return entry.content.flatMap((part) => {
|
|
11
|
+
if (part.type === "text" || part.type === "reasoning")
|
|
12
|
+
return [part.text];
|
|
13
|
+
return [];
|
|
14
|
+
}).join("\n");
|
|
15
|
+
}
|
|
16
|
+
function toolArguments(value) {
|
|
17
|
+
if (value && typeof value === "object" && !Array.isArray(value))
|
|
18
|
+
return value;
|
|
19
|
+
return value === undefined ? {} : { value };
|
|
20
|
+
}
|
|
21
|
+
function assistantMessage(entry) {
|
|
22
|
+
const content = [];
|
|
23
|
+
if (typeof entry.content === "string") {
|
|
24
|
+
if (entry.content)
|
|
25
|
+
content.push({ type: "text", text: entry.content });
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
for (const part of entry.content) {
|
|
29
|
+
if (part.type === "text")
|
|
30
|
+
content.push({ type: "text", text: part.text });
|
|
31
|
+
if (part.type === "tool_call") {
|
|
32
|
+
content.push({
|
|
33
|
+
type: "toolCall",
|
|
34
|
+
id: part.toolCallId,
|
|
35
|
+
name: part.toolName,
|
|
36
|
+
arguments: toolArguments(part.input),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (content.length === 0)
|
|
42
|
+
return undefined;
|
|
43
|
+
return {
|
|
44
|
+
role: "assistant",
|
|
45
|
+
content,
|
|
46
|
+
api: "openai-responses",
|
|
47
|
+
provider: "pibo-portable-history",
|
|
48
|
+
model: "portable-history",
|
|
49
|
+
usage: {
|
|
50
|
+
input: 0,
|
|
51
|
+
output: 0,
|
|
52
|
+
cacheRead: 0,
|
|
53
|
+
cacheWrite: 0,
|
|
54
|
+
totalTokens: 0,
|
|
55
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
|
|
56
|
+
},
|
|
57
|
+
stopReason: content.some((part) => part.type === "toolCall") ? "toolUse" : "stop",
|
|
58
|
+
timestamp: timestamp(entry.createdAt),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function portableMessage(entry) {
|
|
62
|
+
if (entry.type === "session_info") {
|
|
63
|
+
return {
|
|
64
|
+
role: "user",
|
|
65
|
+
content: `[Pibo portable session information]\n${entry.name}`,
|
|
66
|
+
timestamp: timestamp(entry.createdAt),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (entry.role === "assistant")
|
|
70
|
+
return assistantMessage(entry);
|
|
71
|
+
if (entry.role === "tool") {
|
|
72
|
+
return {
|
|
73
|
+
role: "toolResult",
|
|
74
|
+
toolCallId: entry.toolCallId ?? entry.id,
|
|
75
|
+
toolName: entry.toolName ?? "tool",
|
|
76
|
+
content: [{ type: "text", text: textContent(entry) }],
|
|
77
|
+
details: entry.result,
|
|
78
|
+
isError: entry.isError === true || entry.status === "error",
|
|
79
|
+
timestamp: timestamp(entry.createdAt),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const text = textContent(entry);
|
|
83
|
+
if (!text)
|
|
84
|
+
return undefined;
|
|
85
|
+
return {
|
|
86
|
+
role: "user",
|
|
87
|
+
content: entry.role === "system"
|
|
88
|
+
? `[Pibo portable system context]\n${text}`
|
|
89
|
+
: text,
|
|
90
|
+
timestamp: timestamp(entry.createdAt),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export function importPortableHistoryIntoPi(sessionManager, history) {
|
|
94
|
+
for (const entry of history.entries) {
|
|
95
|
+
const message = portableMessage(entry);
|
|
96
|
+
if (message)
|
|
97
|
+
sessionManager.appendMessage(message);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -959,7 +959,7 @@ export class RoutedSession {
|
|
|
959
959
|
}
|
|
960
960
|
async setModel(model) {
|
|
961
961
|
this.assertActive();
|
|
962
|
-
const resolved = this.runtime.session.
|
|
962
|
+
const resolved = this.runtime.session.modelRuntime.getModel(model.provider, model.id);
|
|
963
963
|
if (!resolved)
|
|
964
964
|
throw new Error(`Unknown model ${model.provider}/${model.id}`);
|
|
965
965
|
await this.runtime.session.setModel(resolved);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { realpathSync } from "node:fs";
|
|
1
2
|
import { readFile } from "node:fs/promises";
|
|
2
3
|
import { isAbsolute, resolve } from "node:path";
|
|
3
|
-
import {
|
|
4
|
+
import { createAgentSessionFromServices, createAgentSessionRuntime, createAgentSessionServices, createBashToolDefinition, getAgentDir, InteractiveMode, ModelRegistry, SessionManager, } from "@earendil-works/pi-coding-agent";
|
|
4
5
|
import { DEFAULT_BUILTIN_TOOL_NAMES, InitialSessionContext, } from "../../core/profiles.js";
|
|
5
6
|
import { loadPiboModelDefaults, selectRequestedModelProfile, selectRequestedThinkingLevel } from "../../core/model-defaults.js";
|
|
6
7
|
import { createDefaultPiboProfile } from "../../core/default-profile.js";
|
|
@@ -81,13 +82,26 @@ function createSessionContextFile(context) {
|
|
|
81
82
|
].join("\n"),
|
|
82
83
|
};
|
|
83
84
|
}
|
|
85
|
+
function contextFileIdentity(path) {
|
|
86
|
+
if (path.includes("://"))
|
|
87
|
+
return path;
|
|
88
|
+
let canonical;
|
|
89
|
+
try {
|
|
90
|
+
canonical = realpathSync(path);
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
canonical = resolve(path);
|
|
94
|
+
}
|
|
95
|
+
return process.platform === "win32" ? canonical.toLowerCase() : canonical;
|
|
96
|
+
}
|
|
84
97
|
function mergeContextFiles(base, additional) {
|
|
85
98
|
const seen = new Set();
|
|
86
99
|
const merged = [];
|
|
87
100
|
for (const contextFile of [...base, ...additional]) {
|
|
88
|
-
|
|
101
|
+
const identity = contextFileIdentity(contextFile.path);
|
|
102
|
+
if (seen.has(identity))
|
|
89
103
|
continue;
|
|
90
|
-
seen.add(
|
|
104
|
+
seen.add(identity);
|
|
91
105
|
merged.push(contextFile);
|
|
92
106
|
}
|
|
93
107
|
return merged;
|
|
@@ -178,12 +192,11 @@ export async function createPiboRuntime(options = {}) {
|
|
|
178
192
|
const profile = options.profile ?? createDefaultPiboProfile();
|
|
179
193
|
const agentDir = getAgentDir();
|
|
180
194
|
const sessionManager = await createSessionManager(cwd, profile, options.persistSession !== false);
|
|
181
|
-
const authStorage = AuthStorage.create();
|
|
182
195
|
const createRuntime = async ({ cwd: runtimeCwd, agentDir: runtimeAgentDir, sessionManager: runtimeSessionManager, sessionStartEvent, }) => {
|
|
183
196
|
const contextGuardRecovery = createPiboAssistantContextGuardRecovery();
|
|
184
197
|
const resourceContextFiles = options.resources?.getContextContributions()
|
|
185
|
-
.flatMap((contribution) => contribution.content === undefined ? [] : [{
|
|
186
|
-
path: contribution.
|
|
198
|
+
.flatMap((contribution) => contribution.content === undefined || contribution.nativeDiscovered ? [] : [{
|
|
199
|
+
path: contribution.sourcePath ?? contribution.path ?? contribution.materializedPath ?? contribution.id,
|
|
187
200
|
content: contribution.content,
|
|
188
201
|
}]);
|
|
189
202
|
const contextFiles = resourceContextFiles ?? await loadContextFiles(runtimeCwd, profile.contextFiles);
|
|
@@ -200,7 +213,7 @@ export async function createPiboRuntime(options = {}) {
|
|
|
200
213
|
const services = await createAgentSessionServices({
|
|
201
214
|
cwd: runtimeCwd,
|
|
202
215
|
agentDir: runtimeAgentDir,
|
|
203
|
-
|
|
216
|
+
modelRuntime: options.modelRuntime,
|
|
204
217
|
resourceLoaderOptions: {
|
|
205
218
|
...piPackageOptions.resourceLoaderOptions,
|
|
206
219
|
additionalSkillPaths: skillPaths,
|
|
@@ -223,10 +236,11 @@ export async function createPiboRuntime(options = {}) {
|
|
|
223
236
|
});
|
|
224
237
|
runtimeSettingsManager = services.settingsManager;
|
|
225
238
|
applyPiboRuntimeRetryDefaults(services.settingsManager, options.retryDefaults);
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
239
|
+
const modelRegistry = new ModelRegistry(services.modelRuntime);
|
|
240
|
+
registerOpenAiGpt56Models(modelRegistry);
|
|
241
|
+
registerMiniMaxProvider(modelRegistry);
|
|
242
|
+
registerGlmProvider(modelRegistry);
|
|
243
|
+
registerQwenTokenPlanProvider(modelRegistry);
|
|
230
244
|
const ownsLocalRuntimeRegistry = options.runtimeToolController === undefined && profile.tools.some(isEnabledRuntimeTool);
|
|
231
245
|
const localRuntimeRegistry = ownsLocalRuntimeRegistry ? new RuntimeSessionRegistry({ cwd: runtimeCwd }) : undefined;
|
|
232
246
|
const runtimeToolController = options.runtimeToolController
|
|
@@ -286,7 +300,7 @@ export async function createPiboRuntime(options = {}) {
|
|
|
286
300
|
services,
|
|
287
301
|
sessionManager: runtimeSessionManager,
|
|
288
302
|
sessionStartEvent,
|
|
289
|
-
model: resolveProfileModel(profile,
|
|
303
|
+
model: resolveProfileModel(profile, modelRegistry, runtimeCwd, modelDefaults, options.activeModel),
|
|
290
304
|
thinkingLevel: options.thinkingLevel ?? selectRequestedThinkingLevel(profile, modelDefaults),
|
|
291
305
|
customTools,
|
|
292
306
|
noTools: profile.builtinTools === "disabled" ? "builtin" : undefined,
|
|
@@ -355,15 +369,15 @@ function mergePriorAfterToolCallResult(context, prior) {
|
|
|
355
369
|
},
|
|
356
370
|
};
|
|
357
371
|
}
|
|
358
|
-
function resolveProfileModel(profile,
|
|
372
|
+
function resolveProfileModel(profile, modelRegistry, cwd, modelDefaults, activeModel) {
|
|
359
373
|
const requestedModel = activeModel ? { ...activeModel } : selectRequestedModelProfile(profile, modelDefaults ?? loadPiboModelDefaults(cwd));
|
|
360
374
|
if (!requestedModel)
|
|
361
375
|
return undefined;
|
|
362
|
-
const model =
|
|
376
|
+
const model = modelRegistry.find(requestedModel.provider, requestedModel.id);
|
|
363
377
|
if (!model) {
|
|
364
378
|
throw new Error(`Profile "${profile.profileName}" requests unknown model ${requestedModel.provider}/${requestedModel.id}.`);
|
|
365
379
|
}
|
|
366
|
-
if (!
|
|
380
|
+
if (!modelRegistry.hasConfiguredAuth(model)) {
|
|
367
381
|
throw new Error(`Profile "${profile.profileName}" requires configured auth for ${requestedModel.provider}/${requestedModel.id}.`);
|
|
368
382
|
}
|
|
369
383
|
return model;
|
|
@@ -386,6 +400,7 @@ export async function inspectPiboProfile(options = {}) {
|
|
|
386
400
|
builtinTools: profile.builtinTools,
|
|
387
401
|
builtinToolNames: profile.builtinToolNames,
|
|
388
402
|
autoContextFiles: profile.autoContextFiles,
|
|
403
|
+
nativeSubagents: profile.nativeSubagents,
|
|
389
404
|
toolPackages: profile.toolPackages,
|
|
390
405
|
});
|
|
391
406
|
const hasEnabledSubagents = profile.subagents.some((subagent) => subagent.enabled !== false);
|
|
@@ -432,6 +447,7 @@ export async function inspectPiboProfile(options = {}) {
|
|
|
432
447
|
builtinTools: profile.builtinTools,
|
|
433
448
|
builtinToolNames: [...profile.builtinToolNames],
|
|
434
449
|
autoContextFiles: profile.autoContextFiles,
|
|
450
|
+
nativeSubagents: profile.nativeSubagents,
|
|
435
451
|
toolPackages: { ...profile.toolPackages },
|
|
436
452
|
skills: resourceLoader.getSkills().skills.map((skill) => ({
|
|
437
453
|
name: skill.name,
|
|
@@ -55,6 +55,7 @@ function createCustomAgentBuilder(agent) {
|
|
|
55
55
|
.withBuiltinTools(agent.builtinTools)
|
|
56
56
|
.withBuiltinToolNames(agent.builtinToolNames)
|
|
57
57
|
.withAutoContextFiles(agent.autoContextFiles)
|
|
58
|
+
.withNativeSubagents(agent.nativeSubagents)
|
|
58
59
|
.withMcpServers(agent.mcpServers)
|
|
59
60
|
.withPiPackages(agent.piPackages.map((id) => ({ id })))
|
|
60
61
|
.withToolPackages({ runControl: agent.runControl, goalControl: agent.goalControl ?? true });
|
|
@@ -18,6 +18,7 @@ export function previewCustomAgentCreate(input, options = {}) {
|
|
|
18
18
|
description: input.description,
|
|
19
19
|
runtimeInstanceId: sanitizeRuntimeInstanceId(input.runtimeInstanceId),
|
|
20
20
|
runtimeOptions: cloneRuntimeOptions(input.runtimeOptions),
|
|
21
|
+
nativeSubagents: sanitizeBoolean(input.nativeSubagents),
|
|
21
22
|
nativeTools: [...(input.nativeTools ?? [])],
|
|
22
23
|
skills: [...(input.skills ?? [])],
|
|
23
24
|
contextFiles: [...(input.contextFiles ?? [])],
|
|
@@ -34,7 +35,7 @@ export function previewCustomAgentCreate(input, options = {}) {
|
|
|
34
35
|
subagentFast: sanitizeBoolean(input.subagentFast),
|
|
35
36
|
builtinTools: input.builtinTools ?? "default",
|
|
36
37
|
builtinToolNames: sanitizeBuiltinToolNames(input.builtinToolNames),
|
|
37
|
-
autoContextFiles: input.autoContextFiles ?? true,
|
|
38
|
+
autoContextFiles: sanitizeBoolean(input.autoContextFiles) ?? true,
|
|
38
39
|
runControl: input.runControl ?? false,
|
|
39
40
|
goalControl: input.goalControl ?? true,
|
|
40
41
|
createdAt: now,
|
|
@@ -50,6 +51,7 @@ export function previewCustomAgentUpdate(existing, input, options = {}) {
|
|
|
50
51
|
description: input.description === undefined ? existing.description : input.description,
|
|
51
52
|
runtimeInstanceId: input.runtimeInstanceId === undefined ? existing.runtimeInstanceId : sanitizeRuntimeInstanceId(input.runtimeInstanceId),
|
|
52
53
|
runtimeOptions: input.runtimeOptions === undefined ? existing.runtimeOptions : cloneRuntimeOptions(input.runtimeOptions),
|
|
54
|
+
nativeSubagents: input.nativeSubagents === undefined ? existing.nativeSubagents : sanitizeBoolean(input.nativeSubagents),
|
|
53
55
|
nativeTools: input.nativeTools ? [...input.nativeTools] : existing.nativeTools,
|
|
54
56
|
skills: input.skills ? [...input.skills] : existing.skills,
|
|
55
57
|
contextFiles: input.contextFiles ? [...input.contextFiles] : existing.contextFiles,
|
|
@@ -66,7 +68,9 @@ export function previewCustomAgentUpdate(existing, input, options = {}) {
|
|
|
66
68
|
subagentFast: input.subagentFast === undefined ? existing.subagentFast : sanitizeBoolean(input.subagentFast),
|
|
67
69
|
builtinTools: input.builtinTools ?? existing.builtinTools,
|
|
68
70
|
builtinToolNames: input.builtinToolNames ? sanitizeBuiltinToolNames(input.builtinToolNames) : existing.builtinToolNames,
|
|
69
|
-
autoContextFiles: input.autoContextFiles
|
|
71
|
+
autoContextFiles: input.autoContextFiles === undefined
|
|
72
|
+
? existing.autoContextFiles
|
|
73
|
+
: sanitizeBoolean(input.autoContextFiles) ?? true,
|
|
70
74
|
runControl: input.runControl ?? existing.runControl,
|
|
71
75
|
goalControl: input.goalControl ?? existing.goalControl,
|
|
72
76
|
updatedAt: options.now ?? new Date().toISOString(),
|
|
@@ -91,6 +95,7 @@ export class CustomAgentStore {
|
|
|
91
95
|
description TEXT,
|
|
92
96
|
runtime_instance_id TEXT NOT NULL DEFAULT 'pi',
|
|
93
97
|
runtime_options_json TEXT NOT NULL DEFAULT '{}',
|
|
98
|
+
native_subagents INTEGER,
|
|
94
99
|
native_tools_json TEXT NOT NULL,
|
|
95
100
|
skills_json TEXT NOT NULL,
|
|
96
101
|
context_files_json TEXT NOT NULL,
|
|
@@ -119,6 +124,7 @@ export class CustomAgentStore {
|
|
|
119
124
|
this.migrateProfileAliasTable();
|
|
120
125
|
this.migrateArchivedAtColumn();
|
|
121
126
|
this.migrateAutoContextFilesColumn();
|
|
127
|
+
this.migrateNativeSubagentsColumn();
|
|
122
128
|
this.migrateMcpServersColumn();
|
|
123
129
|
this.migrateRuntimeColumns();
|
|
124
130
|
this.migratePiPackagesColumn();
|
|
@@ -170,6 +176,7 @@ export class CustomAgentStore {
|
|
|
170
176
|
description = ?,
|
|
171
177
|
runtime_instance_id = ?,
|
|
172
178
|
runtime_options_json = ?,
|
|
179
|
+
native_subagents = ?,
|
|
173
180
|
native_tools_json = ?,
|
|
174
181
|
skills_json = ?,
|
|
175
182
|
context_files_json = ?,
|
|
@@ -192,7 +199,7 @@ export class CustomAgentStore {
|
|
|
192
199
|
updated_at = ?
|
|
193
200
|
WHERE id = ?
|
|
194
201
|
`)
|
|
195
|
-
.run(updated.profileName, updated.displayName, updated.description ?? null, updated.runtimeInstanceId, JSON.stringify(updated.runtimeOptions), JSON.stringify(updated.nativeTools), JSON.stringify(updated.skills), JSON.stringify(updated.contextFiles), JSON.stringify(sanitizeSubagents(updated.subagents)), JSON.stringify(updated.mcpServers), JSON.stringify(updated.piPackages), updated.mainModel ? JSON.stringify(updated.mainModel) : null, updated.subagentModel ? JSON.stringify(updated.subagentModel) : null, updated.thinkingLevel ?? null, updated.mainThinkingLevel ?? null, updated.subagentThinkingLevel ?? null, serializeBoolean(updated.fast), serializeBoolean(updated.mainFast), serializeBoolean(updated.subagentFast), updated.builtinTools, JSON.stringify(updated.builtinToolNames), updated.autoContextFiles ? 1 : 0, updated.runControl ? 1 : 0, updated.goalControl ? 1 : 0, updated.updatedAt, id);
|
|
202
|
+
.run(updated.profileName, updated.displayName, updated.description ?? null, updated.runtimeInstanceId, JSON.stringify(updated.runtimeOptions), serializeBoolean(updated.nativeSubagents), JSON.stringify(updated.nativeTools), JSON.stringify(updated.skills), JSON.stringify(updated.contextFiles), JSON.stringify(sanitizeSubagents(updated.subagents)), JSON.stringify(updated.mcpServers), JSON.stringify(updated.piPackages), updated.mainModel ? JSON.stringify(updated.mainModel) : null, updated.subagentModel ? JSON.stringify(updated.subagentModel) : null, updated.thinkingLevel ?? null, updated.mainThinkingLevel ?? null, updated.subagentThinkingLevel ?? null, serializeBoolean(updated.fast), serializeBoolean(updated.mainFast), serializeBoolean(updated.subagentFast), updated.builtinTools, JSON.stringify(updated.builtinToolNames), updated.autoContextFiles ? 1 : 0, updated.runControl ? 1 : 0, updated.goalControl ? 1 : 0, updated.updatedAt, id);
|
|
196
203
|
return this.get(id);
|
|
197
204
|
}
|
|
198
205
|
setArchived(id, archived) {
|
|
@@ -224,6 +231,7 @@ export class CustomAgentStore {
|
|
|
224
231
|
description,
|
|
225
232
|
runtime_instance_id,
|
|
226
233
|
runtime_options_json,
|
|
234
|
+
native_subagents,
|
|
227
235
|
native_tools_json,
|
|
228
236
|
skills_json,
|
|
229
237
|
context_files_json,
|
|
@@ -246,9 +254,9 @@ export class CustomAgentStore {
|
|
|
246
254
|
created_at,
|
|
247
255
|
updated_at,
|
|
248
256
|
archived_at
|
|
249
|
-
) VALUES (${Array.from({ length:
|
|
257
|
+
) VALUES (${Array.from({ length: 29 }, () => "?").join(", ")})
|
|
250
258
|
`)
|
|
251
|
-
.run(agent.id, agent.profileName, agent.displayName, agent.description ?? null, agent.runtimeInstanceId, JSON.stringify(agent.runtimeOptions), JSON.stringify(agent.nativeTools), JSON.stringify(agent.skills), JSON.stringify(agent.contextFiles), JSON.stringify(sanitizeSubagents(agent.subagents)), JSON.stringify(agent.mcpServers), JSON.stringify(agent.piPackages), agent.mainModel ? JSON.stringify(agent.mainModel) : null, agent.subagentModel ? JSON.stringify(agent.subagentModel) : null, agent.thinkingLevel ?? null, agent.mainThinkingLevel ?? null, agent.subagentThinkingLevel ?? null, serializeBoolean(agent.fast), serializeBoolean(agent.mainFast), serializeBoolean(agent.subagentFast), agent.builtinTools, JSON.stringify(agent.builtinToolNames), agent.autoContextFiles ? 1 : 0, agent.runControl ? 1 : 0, agent.goalControl ? 1 : 0, agent.createdAt, agent.updatedAt, agent.archivedAt ?? null);
|
|
259
|
+
.run(agent.id, agent.profileName, agent.displayName, agent.description ?? null, agent.runtimeInstanceId, JSON.stringify(agent.runtimeOptions), serializeBoolean(agent.nativeSubagents), JSON.stringify(agent.nativeTools), JSON.stringify(agent.skills), JSON.stringify(agent.contextFiles), JSON.stringify(sanitizeSubagents(agent.subagents)), JSON.stringify(agent.mcpServers), JSON.stringify(agent.piPackages), agent.mainModel ? JSON.stringify(agent.mainModel) : null, agent.subagentModel ? JSON.stringify(agent.subagentModel) : null, agent.thinkingLevel ?? null, agent.mainThinkingLevel ?? null, agent.subagentThinkingLevel ?? null, serializeBoolean(agent.fast), serializeBoolean(agent.mainFast), serializeBoolean(agent.subagentFast), agent.builtinTools, JSON.stringify(agent.builtinToolNames), agent.autoContextFiles ? 1 : 0, agent.runControl ? 1 : 0, agent.goalControl ? 1 : 0, agent.createdAt, agent.updatedAt, agent.archivedAt ?? null);
|
|
252
260
|
}
|
|
253
261
|
requireProfileNameAvailable(profileName, currentId) {
|
|
254
262
|
const row = this.db.prepare("SELECT id FROM chat_agents WHERE profile_name = ?").get(profileName);
|
|
@@ -347,11 +355,15 @@ export class CustomAgentStore {
|
|
|
347
355
|
}
|
|
348
356
|
}
|
|
349
357
|
migrateAutoContextFilesColumn() {
|
|
350
|
-
|
|
351
|
-
if (!columns.has("auto_context_files")) {
|
|
358
|
+
if (!this.tableColumns().has("auto_context_files")) {
|
|
352
359
|
this.db.prepare("ALTER TABLE chat_agents ADD COLUMN auto_context_files INTEGER NOT NULL DEFAULT 1").run();
|
|
353
360
|
}
|
|
354
361
|
}
|
|
362
|
+
migrateNativeSubagentsColumn() {
|
|
363
|
+
if (!this.tableColumns().has("native_subagents")) {
|
|
364
|
+
this.db.prepare("ALTER TABLE chat_agents ADD COLUMN native_subagents INTEGER").run();
|
|
365
|
+
}
|
|
366
|
+
}
|
|
355
367
|
migrateMcpServersColumn() {
|
|
356
368
|
const columns = new Set(this.db.prepare("PRAGMA table_info(chat_agents)").all().map((column) => column.name));
|
|
357
369
|
if (!columns.has("mcp_servers_json")) {
|
|
@@ -564,6 +576,7 @@ function agentFromRow(row, profileAliases) {
|
|
|
564
576
|
description: row.description ?? undefined,
|
|
565
577
|
runtimeInstanceId: sanitizeRuntimeInstanceId(row.runtime_instance_id),
|
|
566
578
|
runtimeOptions: parseRuntimeOptions(row.runtime_options_json),
|
|
579
|
+
nativeSubagents: parseBoolean(row.native_subagents),
|
|
567
580
|
nativeTools: parseStringArray(row.native_tools_json),
|
|
568
581
|
skills: parseStringArray(row.skills_json),
|
|
569
582
|
contextFiles: parseStringArray(row.context_files_json),
|
|
@@ -669,12 +682,13 @@ function parseModelProfile(value) {
|
|
|
669
682
|
}
|
|
670
683
|
}
|
|
671
684
|
function sanitizeModelProfile(value) {
|
|
672
|
-
if (!value)
|
|
685
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
673
686
|
return undefined;
|
|
674
|
-
|
|
687
|
+
const candidate = value;
|
|
688
|
+
if (typeof candidate.provider !== "string" || typeof candidate.id !== "string")
|
|
675
689
|
return undefined;
|
|
676
|
-
const provider =
|
|
677
|
-
const id =
|
|
690
|
+
const provider = candidate.provider.trim();
|
|
691
|
+
const id = candidate.id.trim();
|
|
678
692
|
if (!provider || !id)
|
|
679
693
|
return undefined;
|
|
680
694
|
return { provider, id };
|
|
@@ -692,6 +706,12 @@ function sanitizeSubagents(value) {
|
|
|
692
706
|
};
|
|
693
707
|
if (typeof candidate.description === "string")
|
|
694
708
|
subagent.description = candidate.description;
|
|
709
|
+
const model = sanitizeModelProfile(candidate.model);
|
|
710
|
+
if (model)
|
|
711
|
+
subagent.model = model;
|
|
712
|
+
const thinkingLevel = sanitizeThinkingLevel(candidate.thinkingLevel);
|
|
713
|
+
if (thinkingLevel)
|
|
714
|
+
subagent.thinkingLevel = thinkingLevel;
|
|
695
715
|
if (typeof candidate.timeoutMs === "number")
|
|
696
716
|
subagent.timeoutMs = candidate.timeoutMs;
|
|
697
717
|
if (typeof candidate.maxDepth === "number")
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { createReadStream, existsSync, mkdirSync, statSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { createReadStream, existsSync, mkdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { basename, extname, isAbsolute, relative, resolve } from "node:path";
|
|
3
|
-
import os from "node:os";
|
|
4
3
|
import { Readable } from "node:stream";
|
|
4
|
+
import { piboHomePath } from "../../core/pibo-home.js";
|
|
5
|
+
import { protectPrivateDirectorySync, protectPrivateFileSync } from "../../core/private-path.js";
|
|
5
6
|
import { PiboWebHttpError } from "../../web/http.js";
|
|
6
|
-
export const CHAT_UPLOAD_DIR =
|
|
7
|
+
export const CHAT_UPLOAD_DIR = piboHomePath("uploads");
|
|
7
8
|
const CHAT_FILE_ATTACHMENT_LIMIT = 10;
|
|
8
9
|
export function prepareChatFileAttachments(input) {
|
|
9
10
|
const paths = normalizeChatFileAttachmentPaths(input.attachmentPaths);
|
|
@@ -18,6 +19,11 @@ export function prepareChatFileAttachments(input) {
|
|
|
18
19
|
messageText: modelContext ? `${input.messageText.trimEnd()}\n\n${modelContext}` : input.messageText,
|
|
19
20
|
};
|
|
20
21
|
}
|
|
22
|
+
export function ensurePrivateChatUploadDirectory() {
|
|
23
|
+
mkdirSync(CHAT_UPLOAD_DIR, { recursive: true, mode: 0o700 });
|
|
24
|
+
protectPrivateDirectorySync(CHAT_UPLOAD_DIR);
|
|
25
|
+
return CHAT_UPLOAD_DIR;
|
|
26
|
+
}
|
|
21
27
|
export async function saveUploadedChatFiles(request) {
|
|
22
28
|
const form = await request.formData();
|
|
23
29
|
const files = [];
|
|
@@ -27,7 +33,7 @@ export async function saveUploadedChatFiles(request) {
|
|
|
27
33
|
}
|
|
28
34
|
if (!files.length)
|
|
29
35
|
throw new PiboWebHttpError("No files were uploaded", 400);
|
|
30
|
-
|
|
36
|
+
ensurePrivateChatUploadDirectory();
|
|
31
37
|
const saved = [];
|
|
32
38
|
for (const file of files) {
|
|
33
39
|
const name = sanitizeUploadFilename(file.name);
|
|
@@ -77,7 +83,7 @@ function normalizeChatFileAttachmentPaths(value) {
|
|
|
77
83
|
if (absolutePath.length > 4096)
|
|
78
84
|
throw new PiboWebHttpError("uploaded file path is too long", 400);
|
|
79
85
|
if (!isPathInsideUploadDir(absolutePath))
|
|
80
|
-
throw new PiboWebHttpError("Attached uploads must be under
|
|
86
|
+
throw new PiboWebHttpError("Attached uploads must be under the configured Pibo uploads directory", 400);
|
|
81
87
|
if (!seen.has(absolutePath)) {
|
|
82
88
|
seen.add(absolutePath);
|
|
83
89
|
paths.push(absolutePath);
|
|
@@ -131,7 +137,14 @@ function writeUploadedChatFile(filename, bytes) {
|
|
|
131
137
|
for (let index = 0; index < 10_000; index += 1) {
|
|
132
138
|
const targetPath = uploadPathForIndex(filename, index);
|
|
133
139
|
try {
|
|
134
|
-
writeFileSync(targetPath, bytes, { flag: "wx" });
|
|
140
|
+
writeFileSync(targetPath, bytes, { flag: "wx", mode: 0o600 });
|
|
141
|
+
try {
|
|
142
|
+
protectPrivateFileSync(targetPath);
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
rmSync(targetPath, { force: true });
|
|
146
|
+
throw error;
|
|
147
|
+
}
|
|
135
148
|
return targetPath;
|
|
136
149
|
}
|
|
137
150
|
catch (error) {
|
|
@@ -227,6 +227,13 @@ export function normalizeAutoContextFiles(value) {
|
|
|
227
227
|
throw new PiboWebHttpError("autoContextFiles must be a boolean", 400);
|
|
228
228
|
return value;
|
|
229
229
|
}
|
|
230
|
+
export function normalizeNativeSubagents(value) {
|
|
231
|
+
if (value === undefined || value === null)
|
|
232
|
+
return undefined;
|
|
233
|
+
if (typeof value !== "boolean")
|
|
234
|
+
throw new PiboWebHttpError("nativeSubagents must be a boolean", 400);
|
|
235
|
+
return value;
|
|
236
|
+
}
|
|
230
237
|
export function normalizeRunControl(value) {
|
|
231
238
|
if (value === undefined)
|
|
232
239
|
return false;
|
|
@@ -370,6 +377,12 @@ export function normalizeAgentSubagents(value) {
|
|
|
370
377
|
const description = normalizeAgentDescription(raw.description);
|
|
371
378
|
if (description)
|
|
372
379
|
subagent.description = description;
|
|
380
|
+
const model = normalizeModelProfile(raw.model, "subagent model");
|
|
381
|
+
if (model)
|
|
382
|
+
subagent.model = model;
|
|
383
|
+
const thinkingLevel = normalizeThinkingLevel(raw.thinkingLevel, "subagent thinkingLevel");
|
|
384
|
+
if (thinkingLevel)
|
|
385
|
+
subagent.thinkingLevel = thinkingLevel;
|
|
373
386
|
if (raw.timeoutMs !== undefined) {
|
|
374
387
|
if (typeof raw.timeoutMs !== "number" || !Number.isFinite(raw.timeoutMs) || raw.timeoutMs <= 0) {
|
|
375
388
|
throw new PiboWebHttpError("subagent timeoutMs must be a positive number", 400);
|
|
@@ -650,6 +663,7 @@ export function createAgentInput(body) {
|
|
|
650
663
|
description: normalizeAgentDescription(body.description),
|
|
651
664
|
runtimeInstanceId: normalizeAgentRuntimeInstanceId(body.runtimeInstanceId),
|
|
652
665
|
runtimeOptions: normalizeAgentRuntimeOptions(body.runtimeOptions),
|
|
666
|
+
nativeSubagents: normalizeNativeSubagents(body.nativeSubagents),
|
|
653
667
|
nativeTools: normalizeNameArray(body.nativeTools, "nativeTools"),
|
|
654
668
|
skills: normalizeNameArray(body.skills, "skills"),
|
|
655
669
|
contextFiles: normalizeNameArray(body.contextFiles, "contextFiles"),
|
|
@@ -681,6 +695,11 @@ export function createAgentUpdate(body) {
|
|
|
681
695
|
update.runtimeInstanceId = normalizeAgentRuntimeInstanceId(body.runtimeInstanceId);
|
|
682
696
|
if (body.runtimeOptions !== undefined)
|
|
683
697
|
update.runtimeOptions = normalizeAgentRuntimeOptions(body.runtimeOptions);
|
|
698
|
+
if (body.nativeSubagents !== undefined) {
|
|
699
|
+
update.nativeSubagents = body.nativeSubagents === null
|
|
700
|
+
? null
|
|
701
|
+
: normalizeNativeSubagents(body.nativeSubagents);
|
|
702
|
+
}
|
|
684
703
|
if (body.nativeTools !== undefined)
|
|
685
704
|
update.nativeTools = normalizeNameArray(body.nativeTools, "nativeTools");
|
|
686
705
|
if (body.skills !== undefined)
|
package/dist/apps/chat/trace.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { PI_HISTORY_PAGE_MAX_BYTES, PI_HISTORY_SCAN_MAX_BYTES, PI_HISTORY_TAIL_MAX_BYTES, listPiHistorySessions, loadPiHistoryFastMetadata, loadPiHistoryMetadata, piSessionEntriesToAgentRuntimeHistoryEntries, readPiTranscriptHistoryPage, readPiTranscriptTailEntries, } from "../../agent-runtimes/pi/history.js";
|
|
3
|
+
import { isPiboThinkingLevel } from "../../core/thinking.js";
|
|
3
4
|
import { buildTraceViewFromEvents, traceNodesFromHistoryEntries } from "../../shared/trace-engine.js";
|
|
4
5
|
import { isChatWebSessionArchived } from "./session-metadata.js";
|
|
5
6
|
import { workflowSessionKindFromMetadata } from "../../sessions/workflow-session-kind.js";
|
|
@@ -26,6 +27,7 @@ export async function buildSessionNodes(sessions, indexItems, _cwd = process.cwd
|
|
|
26
27
|
originId: session.originId,
|
|
27
28
|
profile: session.profile,
|
|
28
29
|
activeModel: session.activeModel,
|
|
30
|
+
initialThinkingLevel: thinkingLevelValue(session.metadata?.initialThinkingLevel),
|
|
29
31
|
subagentName: stringValue(session.metadata?.subagentName),
|
|
30
32
|
workflowSessionKind: workflowSessionKindFromMetadata(session.metadata),
|
|
31
33
|
title: createSessionTitle(session, historyMetadataFromInspection(inspection)),
|
|
@@ -263,6 +265,9 @@ function historyMessageText(entry) {
|
|
|
263
265
|
function stringValue(value) {
|
|
264
266
|
return typeof value === "string" ? value : undefined;
|
|
265
267
|
}
|
|
268
|
+
function thinkingLevelValue(value) {
|
|
269
|
+
return typeof value === "string" && isPiboThinkingLevel(value) ? value : undefined;
|
|
270
|
+
}
|
|
266
271
|
// Pi compatibility exports. Normal Chat Web history resolves through the selected runtime adapter.
|
|
267
272
|
export async function loadPiSessionMetadata(session, cwd = process.cwd()) {
|
|
268
273
|
return await loadPiHistoryMetadata(session.runtimeBinding?.nativeSessionId ?? session.piSessionId, cwd);
|