@pasko70/pibo 2.0.0 → 2.2.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/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 +616 -0
- package/dist/agent-runtimes/omp/auth.js +109 -0
- package/dist/agent-runtimes/omp/client.js +460 -0
- package/dist/agent-runtimes/omp/config.js +188 -0
- package/dist/agent-runtimes/omp/history.js +108 -0
- package/dist/agent-runtimes/omp/host-tools.js +201 -0
- package/dist/agent-runtimes/omp/models.js +86 -0
- package/dist/agent-runtimes/omp/process.js +299 -0
- package/dist/agent-runtimes/omp/protocol-types.js +17 -0
- package/dist/agent-runtimes/omp/resource-delivery.js +228 -0
- package/dist/agent-runtimes/omp/thread.js +141 -0
- package/dist/agent-runtimes/omp/turn.js +325 -0
- 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 +20 -7
- package/dist/apps/chat/chat-files.js +19 -6
- package/dist/apps/chat/chat-request-normalizers.js +13 -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-DxEGebCR.js → chat-ui/assets/dist-BB8loWTa.js} +1 -1
- package/dist/apps/chat-ui/assets/dist-BJ-TIk3N.js +1 -0
- package/dist/apps/chat-ui/assets/dist-CBPDkWd4.js +1 -0
- package/dist/apps/chat-ui/assets/dist-CHInEWhr.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-B7gXtTZC.js → chat-ui/assets/dist-CwS16H7k.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-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/{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/{dist-sZgJkWZb.js → dist-nU3BVpFi.js} +1 -1
- 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-CQuka3bs.js +226 -0
- package/dist/apps/chat-ui/assets/index-DUXboQnI.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-CF1-9PKU.css +2 -0
- package/dist/apps/chat-vscode-web/assets/index-Dp1TzeRL.js +41 -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.0.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 +8 -0
- package/dist/core/sensitive-data-redaction.js +36 -0
- package/dist/core/session-model.js +1 -0
- package/dist/core/session-router.js +219 -29
- package/dist/data/pibo-store.js +5 -1
- package/dist/gateway/server.js +9 -0
- package/dist/index.js +1 -1
- package/dist/plugins/builtin.js +4 -2
- package/dist/plugins/context-files.js +11 -0
- package/dist/plugins/omp.js +57 -0
- package/dist/plugins/registry.js +1 -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/vscode-artifacts/pibo-vscode-ext-2.0.0.vsix +0 -0
- /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),
|
|
@@ -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;
|
|
@@ -650,6 +657,7 @@ export function createAgentInput(body) {
|
|
|
650
657
|
description: normalizeAgentDescription(body.description),
|
|
651
658
|
runtimeInstanceId: normalizeAgentRuntimeInstanceId(body.runtimeInstanceId),
|
|
652
659
|
runtimeOptions: normalizeAgentRuntimeOptions(body.runtimeOptions),
|
|
660
|
+
nativeSubagents: normalizeNativeSubagents(body.nativeSubagents),
|
|
653
661
|
nativeTools: normalizeNameArray(body.nativeTools, "nativeTools"),
|
|
654
662
|
skills: normalizeNameArray(body.skills, "skills"),
|
|
655
663
|
contextFiles: normalizeNameArray(body.contextFiles, "contextFiles"),
|
|
@@ -681,6 +689,11 @@ export function createAgentUpdate(body) {
|
|
|
681
689
|
update.runtimeInstanceId = normalizeAgentRuntimeInstanceId(body.runtimeInstanceId);
|
|
682
690
|
if (body.runtimeOptions !== undefined)
|
|
683
691
|
update.runtimeOptions = normalizeAgentRuntimeOptions(body.runtimeOptions);
|
|
692
|
+
if (body.nativeSubagents !== undefined) {
|
|
693
|
+
update.nativeSubagents = body.nativeSubagents === null
|
|
694
|
+
? null
|
|
695
|
+
: normalizeNativeSubagents(body.nativeSubagents);
|
|
696
|
+
}
|
|
684
697
|
if (body.nativeTools !== undefined)
|
|
685
698
|
update.nativeTools = normalizeNameArray(body.nativeTools, "nativeTools");
|
|
686
699
|
if (body.skills !== undefined)
|
|
@@ -2,7 +2,7 @@ import { createHash, randomUUID } from "node:crypto";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import { monitorEventLoopDelay } from "node:perf_hooks";
|
|
4
4
|
import { PiboSteeringUnavailableError } from "../../core/events.js";
|
|
5
|
-
import { PI_AGENT_RUNTIME_CAPABILITIES } from "../../agent-runtimes/pi/adapter.js";
|
|
5
|
+
import { PI_AGENT_RUNTIME_CAPABILITIES, PI_PROTOCOL_VERSION, } from "../../agent-runtimes/pi/adapter.js";
|
|
6
6
|
import { AgentRuntimeBindingMissingError } from "../../agent-runtime/errors.js";
|
|
7
7
|
import { buildPortableRuntimeContextSnapshot, profileWithRuntimeInstance, uniqueRuntimeDiagnostics, } from "../../agent-runtime/context-build.js";
|
|
8
8
|
import { PiboRuntimeResourceService } from "../../agent-runtime/resource-service.js";
|
|
@@ -46,7 +46,7 @@ import { prepareWebAnnotationMessageAttachments } from "../../web-annotations/at
|
|
|
46
46
|
import { createDefaultWebAnnotationStore } from "../../web-annotations/store.js";
|
|
47
47
|
import { CHAT_WEB_MOUNT_PATH, isChatAppPath, responseBuiltChatAsset, responseBuiltChatPublicFile, responseChatAppShell, isVscodeAppPath, responseBuiltVscodeAsset, responseVscodeAppShell } from "./static-assets.js";
|
|
48
48
|
import { executeProviderAuthAction, isProviderAuthAction, providerAuthActionResponse, readProviderAuthCatalog, } from "./provider-auth-actions.js";
|
|
49
|
-
import { prepareChatFileAttachments, resolveDownloadPath, responseChatFileDownload, saveUploadedChatFiles } from "./chat-files.js";
|
|
49
|
+
import { ensurePrivateChatUploadDirectory, prepareChatFileAttachments, resolveDownloadPath, responseChatFileDownload, saveUploadedChatFiles } from "./chat-files.js";
|
|
50
50
|
import { chatSettingsRoute, chatSettingsRouteInvalidatesBootstrapCatalog, chatSettingsRouteRequiresSameOrigin, handleChatSettingsRoute, } from "./chat-settings-routes.js";
|
|
51
51
|
import { chatCapabilityRoute, chatCapabilityRouteRequiresSameOrigin, handleChatCapabilityRoute, } from "./chat-capability-routes.js";
|
|
52
52
|
import { chatUserSkillRoute, chatUserSkillRouteRequiresSameOrigin, handleChatUserSkillRoute, syncChatUserSkills, } from "./chat-user-skill-routes.js";
|
|
@@ -907,6 +907,7 @@ function serializeCustomAgents(agents, context) {
|
|
|
907
907
|
const RUNTIME_PROFILE_UPDATE_FIELDS = new Set([
|
|
908
908
|
"runtimeInstanceId",
|
|
909
909
|
"runtimeOptions",
|
|
910
|
+
"nativeSubagents",
|
|
910
911
|
"nativeTools",
|
|
911
912
|
"skills",
|
|
912
913
|
"contextFiles",
|
|
@@ -930,6 +931,32 @@ const RUNTIME_PROFILE_UPDATE_FIELDS = new Set([
|
|
|
930
931
|
function customAgentUpdateAffectsRuntime(update) {
|
|
931
932
|
return Object.keys(update).some((field) => RUNTIME_PROFILE_UPDATE_FIELDS.has(field));
|
|
932
933
|
}
|
|
934
|
+
function normalizeCreateRuntimeFeatureOverrides(input, context) {
|
|
935
|
+
const runtime = context.channelContext.getCapabilityCatalog?.().agentRuntimes
|
|
936
|
+
?.find((candidate) => candidate.id === input.runtimeInstanceId);
|
|
937
|
+
if (!runtime)
|
|
938
|
+
return input;
|
|
939
|
+
return {
|
|
940
|
+
...input,
|
|
941
|
+
...(runtime.capabilities.contextDiscovery.configurable
|
|
942
|
+
? { autoContextFiles: input.autoContextFiles }
|
|
943
|
+
: { autoContextFiles: true }),
|
|
944
|
+
...(runtime.capabilities.nativeSubagents.configurable
|
|
945
|
+
? { nativeSubagents: input.nativeSubagents }
|
|
946
|
+
: { nativeSubagents: undefined }),
|
|
947
|
+
};
|
|
948
|
+
}
|
|
949
|
+
function normalizeUpdateRuntimeFeatureOverrides(input, runtimeInstanceId, context) {
|
|
950
|
+
const runtime = context.channelContext.getCapabilityCatalog?.().agentRuntimes
|
|
951
|
+
?.find((candidate) => candidate.id === runtimeInstanceId);
|
|
952
|
+
if (!runtime)
|
|
953
|
+
return input;
|
|
954
|
+
return {
|
|
955
|
+
...input,
|
|
956
|
+
...(runtime.capabilities.contextDiscovery.configurable ? {} : { autoContextFiles: true }),
|
|
957
|
+
...(runtime.capabilities.nativeSubagents.configurable ? {} : { nativeSubagents: null }),
|
|
958
|
+
};
|
|
959
|
+
}
|
|
933
960
|
async function requireValidCustomAgentRuntime(agent, context) {
|
|
934
961
|
const profile = createCustomAgentRuntimeValidationProfile(agent);
|
|
935
962
|
let diagnostics;
|
|
@@ -2376,7 +2403,7 @@ async function resolveContextBuildRuntime(context, runtimeInstanceId) {
|
|
|
2376
2403
|
transport: "embedded",
|
|
2377
2404
|
capabilities: structuredClone(PI_AGENT_RUNTIME_CAPABILITIES),
|
|
2378
2405
|
configSchema: { type: "object", additionalProperties: false },
|
|
2379
|
-
protocol: { name: "pi-sdk", supportedRange:
|
|
2406
|
+
protocol: { name: "pi-sdk", supportedRange: PI_PROTOCOL_VERSION },
|
|
2380
2407
|
diagnostics: [],
|
|
2381
2408
|
};
|
|
2382
2409
|
}
|
|
@@ -3324,6 +3351,7 @@ async function sendChatMessage(input) {
|
|
|
3324
3351
|
return responseJson({ output, event: accepted });
|
|
3325
3352
|
}
|
|
3326
3353
|
export function createChatWebApp(options = {}) {
|
|
3354
|
+
ensurePrivateChatUploadDirectory();
|
|
3327
3355
|
const defaultProfile = options.defaultProfile ?? "base";
|
|
3328
3356
|
const dataStore = createDataStore(options);
|
|
3329
3357
|
const eventLoopDelay = monitorEventLoopDelay({ resolution: 20 });
|
|
@@ -3367,6 +3395,7 @@ export function createChatWebApp(options = {}) {
|
|
|
3367
3395
|
workflowPromptAssetStore: new ChatWorkflowPromptAssetStore(dataStore),
|
|
3368
3396
|
telemetryRetentionMaintenance: {},
|
|
3369
3397
|
};
|
|
3398
|
+
let disposed = false;
|
|
3370
3399
|
const requireSession = (request, context) => context.requireSession({
|
|
3371
3400
|
request,
|
|
3372
3401
|
});
|
|
@@ -3374,6 +3403,21 @@ export function createChatWebApp(options = {}) {
|
|
|
3374
3403
|
name: CHAT_WEB_APP_NAME,
|
|
3375
3404
|
mountPath: CHAT_WEB_MOUNT_PATH,
|
|
3376
3405
|
apiPrefix: CHAT_WEB_API_PREFIX,
|
|
3406
|
+
dispose() {
|
|
3407
|
+
if (disposed)
|
|
3408
|
+
return;
|
|
3409
|
+
disposed = true;
|
|
3410
|
+
state.unsubscribe?.();
|
|
3411
|
+
state.unsubscribe = undefined;
|
|
3412
|
+
state.subscribedContext = undefined;
|
|
3413
|
+
state.eventLoopDelay.disable();
|
|
3414
|
+
state.projectService.close();
|
|
3415
|
+
state.agentStore.close();
|
|
3416
|
+
state.reliabilityStore.close();
|
|
3417
|
+
state.cronStore.close();
|
|
3418
|
+
state.loopStore.close();
|
|
3419
|
+
state.dataStore.close();
|
|
3420
|
+
},
|
|
3377
3421
|
async handleRequest(request, context) {
|
|
3378
3422
|
const url = new URL(request.url);
|
|
3379
3423
|
if (isTelemetryRetentionMaintenanceDue({ state: state.telemetryRetentionMaintenance })) {
|
|
@@ -4245,7 +4289,7 @@ export function createChatWebApp(options = {}) {
|
|
|
4245
4289
|
requireSameOriginJsonRequest(request);
|
|
4246
4290
|
const webSession = await requireSession(request, context);
|
|
4247
4291
|
const body = await readJsonBody(request);
|
|
4248
|
-
const input = createAgentInput(body);
|
|
4292
|
+
const input = normalizeCreateRuntimeFeatureOverrides(createAgentInput(body), context);
|
|
4249
4293
|
requireAgentProfileNameAvailable(state, context, input.displayName);
|
|
4250
4294
|
await requireValidCustomAgentRuntime(previewCustomAgentCreate(input), context);
|
|
4251
4295
|
const agent = state.agentStore.create(input);
|
|
@@ -4259,7 +4303,8 @@ export function createChatWebApp(options = {}) {
|
|
|
4259
4303
|
const webSession = await requireSession(request, context);
|
|
4260
4304
|
const existing = requireSharedAgent(state.agentStore.get(patchAgentId));
|
|
4261
4305
|
const body = await readJsonBody(request);
|
|
4262
|
-
const
|
|
4306
|
+
const rawUpdate = createAgentUpdate(body);
|
|
4307
|
+
const update = normalizeUpdateRuntimeFeatureOverrides(rawUpdate, rawUpdate.runtimeInstanceId ?? existing.runtimeInstanceId, context);
|
|
4263
4308
|
const archived = normalizeAgentArchived(body.archived);
|
|
4264
4309
|
if (update.displayName)
|
|
4265
4310
|
requireAgentProfileNameAvailable(state, context, update.displayName, existing.id);
|
|
@@ -4487,6 +4532,9 @@ export function createChatWebApp(options = {}) {
|
|
|
4487
4532
|
if (body.state !== undefined && body.state !== "unbound" && body.state !== "bound") {
|
|
4488
4533
|
throw new PiboWebHttpError("state must be unbound or bound", 400);
|
|
4489
4534
|
}
|
|
4535
|
+
if (body.startFresh !== undefined && typeof body.startFresh !== "boolean") {
|
|
4536
|
+
throw new PiboWebHttpError("startFresh must be a boolean", 400);
|
|
4537
|
+
}
|
|
4490
4538
|
const locator = body.locator;
|
|
4491
4539
|
const locatorKinds = new Set(["local-file", "local-directory", "uri", "remote", "adapter-resolved"]);
|
|
4492
4540
|
if (locator !== undefined
|
|
@@ -4502,6 +4550,7 @@ export function createChatWebApp(options = {}) {
|
|
|
4502
4550
|
nativeSessionId: typeof body.nativeSessionId === "string" && body.nativeSessionId.trim() ? body.nativeSessionId.trim() : undefined,
|
|
4503
4551
|
state: body.state,
|
|
4504
4552
|
locator: locator,
|
|
4553
|
+
startFresh: body.startFresh === true,
|
|
4505
4554
|
expectedRevision: Number(body.expectedRevision),
|
|
4506
4555
|
});
|
|
4507
4556
|
const updated = context.channelContext.getSession(selectedSession.id);
|
|
@@ -4511,7 +4560,7 @@ export function createChatWebApp(options = {}) {
|
|
|
4511
4560
|
}
|
|
4512
4561
|
catch (error) {
|
|
4513
4562
|
const message = error instanceof Error ? error.message : String(error);
|
|
4514
|
-
const status = /concurrently|idle/i.test(message) ? 409 : 400;
|
|
4563
|
+
const status = /concurrently|idle|quiescing/i.test(message) ? 409 : 400;
|
|
4515
4564
|
throw new PiboWebHttpError(message, status);
|
|
4516
4565
|
}
|
|
4517
4566
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={"+":[`conjugate`,`add`],"−":[`negate`,`subtract`],"×":[`signOf`,`multiply`],"÷":[`reciprocal`,`divide`],"⌈":[`ceiling`,`greaterOf`],"⌊":[`floor`,`lesserOf`],"∣":[`absolute`,`residue`],"⍳":[`indexGenerate`,`indexOf`],"?":[`roll`,`deal`],"⋆":[`exponentiate`,`toThePowerOf`],"⍟":[`naturalLog`,`logToTheBase`],"○":[`piTimes`,`circularFuncs`],"!":[`factorial`,`binomial`],"⌹":[`matrixInverse`,`matrixDivide`],"<":[null,`lessThan`],"≤":[null,`lessThanOrEqual`],"=":[null,`equals`],">":[null,`greaterThan`],"≥":[null,`greaterThanOrEqual`],"≠":[null,`notEqual`],"≡":[`depth`,`match`],"≢":[null,`notMatch`],"∈":[`enlist`,`membership`],"⍷":[null,`find`],"∪":[`unique`,`union`],"∩":[null,`intersection`],"∼":[`not`,`without`],"∨":[null,`or`],"∧":[null,`and`],"⍱":[null,`nor`],"⍲":[null,`nand`],"⍴":[`shapeOf`,`reshape`],",":[`ravel`,`catenate`],"⍪":[null,`firstAxisCatenate`],"⌽":[`reverse`,`rotate`],"⊖":[`axis1Reverse`,`axis1Rotate`],"⍉":[`transpose`,null],"↑":[`first`,`take`],"↓":[null,`drop`],"⊂":[`enclose`,`partitionWithAxis`],"⊃":[`diclose`,`pick`],"⌷":[null,`index`],"⍋":[`gradeUp`,null],"⍒":[`gradeDown`,null],"⊤":[`encode`,null],"⊥":[`decode`,null],"⍕":[`format`,`formatByExample`],"⍎":[`execute`,null],"⊣":[`stop`,`left`],"⊢":[`pass`,`right`]},t=/[\.\/⌿⍀¨⍣]/,n=/⍬/,r=/[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/,i=/←/,a=/[⍝#].*$/,o=function(e){var t=!1;return function(n){return t=n,n
|
|
1
|
+
var e={"+":[`conjugate`,`add`],"−":[`negate`,`subtract`],"×":[`signOf`,`multiply`],"÷":[`reciprocal`,`divide`],"⌈":[`ceiling`,`greaterOf`],"⌊":[`floor`,`lesserOf`],"∣":[`absolute`,`residue`],"⍳":[`indexGenerate`,`indexOf`],"?":[`roll`,`deal`],"⋆":[`exponentiate`,`toThePowerOf`],"⍟":[`naturalLog`,`logToTheBase`],"○":[`piTimes`,`circularFuncs`],"!":[`factorial`,`binomial`],"⌹":[`matrixInverse`,`matrixDivide`],"<":[null,`lessThan`],"≤":[null,`lessThanOrEqual`],"=":[null,`equals`],">":[null,`greaterThan`],"≥":[null,`greaterThanOrEqual`],"≠":[null,`notEqual`],"≡":[`depth`,`match`],"≢":[null,`notMatch`],"∈":[`enlist`,`membership`],"⍷":[null,`find`],"∪":[`unique`,`union`],"∩":[null,`intersection`],"∼":[`not`,`without`],"∨":[null,`or`],"∧":[null,`and`],"⍱":[null,`nor`],"⍲":[null,`nand`],"⍴":[`shapeOf`,`reshape`],",":[`ravel`,`catenate`],"⍪":[null,`firstAxisCatenate`],"⌽":[`reverse`,`rotate`],"⊖":[`axis1Reverse`,`axis1Rotate`],"⍉":[`transpose`,null],"↑":[`first`,`take`],"↓":[null,`drop`],"⊂":[`enclose`,`partitionWithAxis`],"⊃":[`diclose`,`pick`],"⌷":[null,`index`],"⍋":[`gradeUp`,null],"⍒":[`gradeDown`,null],"⊤":[`encode`,null],"⊥":[`decode`,null],"⍕":[`format`,`formatByExample`],"⍎":[`execute`,null],"⊣":[`stop`,`left`],"⊢":[`pass`,`right`]},t=/[\.\/⌿⍀¨⍣]/,n=/⍬/,r=/[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/,i=/←/,a=/[⍝#].*$/,o=function(e){var t=!1;return function(n){return t=n,n!==e||t===`\\`}},s={name:`apl`,startState:function(){return{prev:!1,func:!1,op:!1,string:!1,escape:!1}},token:function(s,c){var l;return s.eatSpace()?null:(l=s.next(),l===`"`||l===`'`?(s.eatWhile(o(l)),s.next(),c.prev=!0,`string`):/[\[{\(]/.test(l)?(c.prev=!1,null):/[\]}\)]/.test(l)?(c.prev=!0,null):n.test(l)?(c.prev=!1,`atom`):/[¯\d]/.test(l)?(c.func?(c.func=!1,c.prev=!1):c.prev=!0,s.eatWhile(/[\w\.]/),`number`):t.test(l)||i.test(l)?`operator`:r.test(l)?(c.func=!0,c.prev=!1,e[l]?`variableName.function.standard`:`variableName.function`):a.test(l)?(s.skipToEnd(),`comment`):l===`∘`&&s.peek()===`.`?(s.next(),`variableName.function`):(s.eatWhile(/[\w\$_]/),c.prev=!0,`keyword`))}};export{s as apl};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){var t=e.match(/^\s*\S/);return e.skipToEnd(),t?`error`:null}var t={name:`asciiarmor`,token:function(t,n){var r;if(n.state==`top`)return t.sol()&&(r=t.match(/^-----BEGIN (.*)?-----\s*$/))?(n.state=`headers`,n.type=r[1],`tag`):e(t);if(n.state==`headers`){if(t.sol()&&t.match(/^\w+:/))return n.state=`header`,`atom`;var i=e(t);return i&&(n.state=`body`),i}if(n.state==`header`)return t.skipToEnd(),n.state=`headers`,`string`;if(n.state==`body`)return t.sol()&&(r=t.match(/^-----END (.*)?-----\s*$/))?r[1]==n.type?(n.state=`end`,`tag`):`error`:t.eatWhile(/[A-Za-z0-9+\/=]/)?null:(t.next(),`error`);if(n.state==`end`)return e(t)},blankLine:function(e){e.state==`headers`&&(e.state=`body`)},startState:function(){return{state:`top`,type:null}}};export{t as asciiArmor};
|
package/dist/apps/{context-files-ui/assets/asn1-Bg4FbdCg.js → chat-ui/assets/asn1-DCl_8MCW.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){for(var t={},n=e.split(` `),r=0;r<n.length;++r)t[n[r]]=!0;return t}var t={keywords:e(`DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS MINACCESS MAXACCESS REVISION STATUS DESCRIPTION SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY IMPLIED EXPORTS`),cmipVerbs:e(`ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE`),compareTypes:e(`OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL TEXTUAL-CONVENTION`),status:e(`current deprecated mandatory obsolete`),tags:e(`APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS UNIVERSAL`),storage:e(`BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING UTCTime InterfaceIndex IANAifType CMIP-Attribute REAL PACKAGE PACKAGES IpAddress PhysAddress NetworkAddress BITS BMPString TimeStamp TimeTicks TruthValue RowStatus DisplayString GeneralString GraphicString IA5String NumericString PrintableString SnmpAdminString TeletexString UTF8String VideotexString VisibleString StringStore ISO646String T61String UniversalString Unsigned32 Integer32 Gauge Gauge32 Counter Counter32 Counter64`),modifier:e(`ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS DEFINED`),accessTypes:e(`not-accessible accessible-for-notify read-only read-create read-write`),multiLineStrings:!0};function n(e){var n=e.keywords||t.keywords,r=e.cmipVerbs||t.cmipVerbs,i=e.compareTypes||t.compareTypes,a=e.status||t.status,o=e.tags||t.tags,s=e.storage||t.storage,c=e.modifier||t.modifier,l=e.accessTypes||t.accessTypes,u=e.multiLineStrings||t.multiLineStrings,d=e.indentStatements!==!1,f=/[\|\^]/,p;function m(e,t){var u=e.next();if(u==`"`||u==`'`)return t.tokenize=h(u),t.tokenize(e,t);if(/[\[\]\(\){}:=,;]/.test(u))return p=u,`punctuation`;if(u==`-`&&e.eat(`-`))return e.skipToEnd(),`comment`;if(/\d/.test(u))return e.eatWhile(/[\w\.]/),`number`;if(f.test(u))return e.eatWhile(f),`operator`;e.eatWhile(/[\w\-]/);var d=e.current();return n.propertyIsEnumerable(d)?`keyword`:r.propertyIsEnumerable(d)?`variableName`:i.propertyIsEnumerable(d)?`atom`:a.propertyIsEnumerable(d)?`comment`:o.propertyIsEnumerable(d)?`typeName`:s.propertyIsEnumerable(d)||c.propertyIsEnumerable(d)||l.propertyIsEnumerable(d)?`modifier`:`variableName`}function h(e){return function(t,n){for(var r=!1,i,a=!1;(i=t.next())!=null;){if(i==e&&!r){var o=t.peek();o&&(o=o.toLowerCase(),(o==`b`||o==`h`||o==`o`)&&t.next()),a=!0;break}r=!r&&i==`\\`}return(a||!(r||u))&&(n.tokenize=null),`string`}}function g(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function _(e,t,n){var r=e.indented;return e.context&&e.context.type==`statement`&&(r=e.context.indented),e.context=new g(r,t,n,null,e.context)}function v(e){var t=e.context.type;return(t==`)`||t==`]`||t==`}`)&&(e.indented=e.context.indented),e.context=e.context.prev}return{name:`asn1`,startState:function(){return{tokenize:null,context:new g(-2,0,`top`,!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(n.align
|
|
1
|
+
function e(e){for(var t={},n=e.split(` `),r=0;r<n.length;++r)t[n[r]]=!0;return t}var t={keywords:e(`DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS MINACCESS MAXACCESS REVISION STATUS DESCRIPTION SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY IMPLIED EXPORTS`),cmipVerbs:e(`ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE`),compareTypes:e(`OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL TEXTUAL-CONVENTION`),status:e(`current deprecated mandatory obsolete`),tags:e(`APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS UNIVERSAL`),storage:e(`BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING UTCTime InterfaceIndex IANAifType CMIP-Attribute REAL PACKAGE PACKAGES IpAddress PhysAddress NetworkAddress BITS BMPString TimeStamp TimeTicks TruthValue RowStatus DisplayString GeneralString GraphicString IA5String NumericString PrintableString SnmpAdminString TeletexString UTF8String VideotexString VisibleString StringStore ISO646String T61String UniversalString Unsigned32 Integer32 Gauge Gauge32 Counter Counter32 Counter64`),modifier:e(`ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS DEFINED`),accessTypes:e(`not-accessible accessible-for-notify read-only read-create read-write`),multiLineStrings:!0};function n(e){var n=e.keywords||t.keywords,r=e.cmipVerbs||t.cmipVerbs,i=e.compareTypes||t.compareTypes,a=e.status||t.status,o=e.tags||t.tags,s=e.storage||t.storage,c=e.modifier||t.modifier,l=e.accessTypes||t.accessTypes,u=e.multiLineStrings||t.multiLineStrings,d=e.indentStatements!==!1,f=/[\|\^]/,p;function m(e,t){var u=e.next();if(u==`"`||u==`'`)return t.tokenize=h(u),t.tokenize(e,t);if(/[\[\]\(\){}:=,;]/.test(u))return p=u,`punctuation`;if(u==`-`&&e.eat(`-`))return e.skipToEnd(),`comment`;if(/\d/.test(u))return e.eatWhile(/[\w\.]/),`number`;if(f.test(u))return e.eatWhile(f),`operator`;e.eatWhile(/[\w\-]/);var d=e.current();return n.propertyIsEnumerable(d)?`keyword`:r.propertyIsEnumerable(d)?`variableName`:i.propertyIsEnumerable(d)?`atom`:a.propertyIsEnumerable(d)?`comment`:o.propertyIsEnumerable(d)?`typeName`:s.propertyIsEnumerable(d)||c.propertyIsEnumerable(d)||l.propertyIsEnumerable(d)?`modifier`:`variableName`}function h(e){return function(t,n){for(var r=!1,i,a=!1;(i=t.next())!=null;){if(i==e&&!r){var o=t.peek();o&&(o=o.toLowerCase(),(o==`b`||o==`h`||o==`o`)&&t.next()),a=!0;break}r=!r&&i==`\\`}return(a||!(r||u))&&(n.tokenize=null),`string`}}function g(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function _(e,t,n){var r=e.indented;return e.context&&e.context.type==`statement`&&(r=e.context.indented),e.context=new g(r,t,n,null,e.context)}function v(e){var t=e.context.type;return(t==`)`||t==`]`||t==`}`)&&(e.indented=e.context.indented),e.context=e.context.prev}return{name:`asn1`,startState:function(){return{tokenize:null,context:new g(-2,0,`top`,!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(n.align??(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;p=null;var r=(t.tokenize||m)(e,t);if(r==`comment`)return r;if(n.align??(n.align=!0),(p==`;`||p==`:`||p==`,`)&&n.type==`statement`)v(t);else if(p==`{`)_(t,e.column(),`}`);else if(p==`[`)_(t,e.column(),`]`);else if(p==`(`)_(t,e.column(),`)`);else if(p==`}`){for(;n.type==`statement`;)n=v(t);for(n.type==`}`&&(n=v(t));n.type==`statement`;)n=v(t)}else p==n.type?v(t):d&&((n.type==`}`||n.type==`top`)&&p!=`;`||n.type==`statement`&&p==`newstatement`)&&_(t,e.column(),`statement`);return t.startOfLine=!1,r},languageData:{indentOnInput:/^\s*[{}]$/,commentTokens:{line:`--`}}}}export{n as asn1};
|