@rynx-ai/server 0.1.11-beta.3 → 0.1.11-beta.30
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/control-api.d.ts +16 -4
- package/dist/control-api.js +676 -83
- package/dist/control-web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/control-web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/control-web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/control-web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/control-web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/control-web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/control-web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/control-web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/control-web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/control-web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/control-web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/control-web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/control-web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/control-web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/control-web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/control-web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/control-web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/control-web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/control-web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/control-web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/control-web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/control-web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/control-web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/control-web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/control-web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/control-web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/control-web/assets/abap-BdImnpbu.js +1 -0
- package/dist/control-web/assets/abnfDiagram-VRR7QNED-COu02MlJ.js +1 -0
- package/dist/control-web/assets/actionscript-3-CoDkCxhg.js +1 -0
- package/dist/control-web/assets/ada-bCR0ucgS.js +1 -0
- package/dist/control-web/assets/andromeeda-C4gqWexZ.js +1 -0
- package/dist/control-web/assets/angular-html-CU67Zn6k.js +1 -0
- package/dist/control-web/assets/angular-ts-BwZT4LLn.js +1 -0
- package/dist/control-web/assets/apache-Pmp26Uib.js +1 -0
- package/dist/control-web/assets/apex-D8_7TLub.js +1 -0
- package/dist/control-web/assets/apl-dKokRX4l.js +1 -0
- package/dist/control-web/assets/applescript-Co6uUVPk.js +1 -0
- package/dist/control-web/assets/ara-BRHolxvo.js +1 -0
- package/dist/control-web/assets/arc-DqiFeYAM.js +1 -0
- package/dist/control-web/assets/architectureDiagram-ZJ3FMSHR-BWFGgUV4.js +36 -0
- package/dist/control-web/assets/asciidoc-Ve4PFQV2.js +1 -0
- package/dist/control-web/assets/asm-D_Q5rh1f.js +1 -0
- package/dist/control-web/assets/astro-CbQHKStN.js +1 -0
- package/dist/control-web/assets/aurora-x-D-2ljcwZ.js +1 -0
- package/dist/control-web/assets/awk-DMzUqQB5.js +1 -0
- package/dist/control-web/assets/ayu-dark-DYE7WIF3.js +1 -0
- package/dist/control-web/assets/ayu-light-BA47KaF1.js +1 -0
- package/dist/control-web/assets/ayu-mirage-32ctXXKs.js +1 -0
- package/dist/control-web/assets/ballerina-BFfxhgS-.js +1 -0
- package/dist/control-web/assets/bat-BkioyH1T.js +1 -0
- package/dist/control-web/assets/beancount-k_qm7-4y.js +1 -0
- package/dist/control-web/assets/berry-uYugtg8r.js +1 -0
- package/dist/control-web/assets/bibtex-CHM0blh-.js +1 -0
- package/dist/control-web/assets/bicep-Bmn6On1c.js +1 -0
- package/dist/control-web/assets/bird2-DPOp833l.js +1 -0
- package/dist/control-web/assets/blade-D4QpJJKB.js +1 -0
- package/dist/control-web/assets/blockDiagram-677ZJIJ3-ZC0bXDzB.js +132 -0
- package/dist/control-web/assets/bsl-BO_Y6i37.js +1 -0
- package/dist/control-web/assets/c-BIGW1oBm.js +1 -0
- package/dist/control-web/assets/c3-eo99z4R2.js +1 -0
- package/dist/control-web/assets/c4Diagram-LMCZKHZV-Uupq5I-s.js +10 -0
- package/dist/control-web/assets/cadence-Bv_4Rxtq.js +1 -0
- package/dist/control-web/assets/cairo-KRGpt6FW.js +1 -0
- package/dist/control-web/assets/catppuccin-frappe-DFWUc33u.js +1 -0
- package/dist/control-web/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
- package/dist/control-web/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
- package/dist/control-web/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
- package/dist/control-web/assets/channel-3HG15wfa.js +1 -0
- package/dist/control-web/assets/chunk-2Q5K7J3B-C77vwuDM.js +1 -0
- package/dist/control-web/assets/chunk-32BRIVSS-BkfLE_TX.js +1 -0
- package/dist/control-web/assets/chunk-5VM5RSS4-By6zfDWW.js +15 -0
- package/dist/control-web/assets/chunk-EX3LRPZG-CO439p_3.js +231 -0
- package/dist/control-web/assets/chunk-JWPE2WC7-B9BPEwug.js +1 -0
- package/dist/control-web/assets/chunk-MOJQB5TN-CYKygWZz.js +88 -0
- package/dist/control-web/assets/chunk-RYQCIY6F-ug-An4HG.js +1 -0
- package/dist/control-web/assets/chunk-V7JOEXUC-3UFQGnKX.js +206 -0
- package/dist/control-web/assets/chunk-VR4S4FIN-DjspjYUb.js +1 -0
- package/dist/control-web/assets/chunk-XXDRQBXY-3znnutie.js +1 -0
- package/dist/control-web/assets/clarity-D53aC0YG.js +1 -0
- package/dist/control-web/assets/classDiagram-OUVF2IWQ-WmU4L9YT.js +1 -0
- package/dist/control-web/assets/classDiagram-v2-EOCWNBFH-WmU4L9YT.js +1 -0
- package/dist/control-web/assets/clojure-P80f7IUj.js +1 -0
- package/dist/control-web/assets/cmake-D1j8_8rp.js +1 -0
- package/dist/control-web/assets/cobol-nwyudZeR.js +1 -0
- package/dist/control-web/assets/codeowners-Bp6g37R7.js +1 -0
- package/dist/control-web/assets/codeql-DsOJ9woJ.js +1 -0
- package/dist/control-web/assets/coffee-Ch7k5sss.js +1 -0
- package/dist/control-web/assets/common-lisp-Cg-RD9OK.js +1 -0
- package/dist/control-web/assets/coq-DkFqJrB1.js +1 -0
- package/dist/control-web/assets/cose-bilkent-JH36ORCC-Dr28goCd.js +1 -0
- package/dist/control-web/assets/cpp-CofmeUqb.js +1 -0
- package/dist/control-web/assets/crystal-tKQVLTB8.js +1 -0
- package/dist/control-web/assets/csharp-COcwbKMJ.js +1 -0
- package/dist/control-web/assets/css-DPfMkruS.js +1 -0
- package/dist/control-web/assets/csv-fuZLfV_i.js +1 -0
- package/dist/control-web/assets/cue-D82EKSYY.js +1 -0
- package/dist/control-web/assets/cynefin-VYW2F7L2-Be5uJhnw.js +178 -0
- package/dist/control-web/assets/cynefinDiagram-TSTJHNR4-BLxtSvL6.js +62 -0
- package/dist/control-web/assets/cypher-COkxafJQ.js +1 -0
- package/dist/control-web/assets/cytoscape.esm-DTSO7Bv0.js +331 -0
- package/dist/control-web/assets/d-85-TOEBH.js +1 -0
- package/dist/control-web/assets/dagre-VKFMJZFB-DPRuDV5p.js +4 -0
- package/dist/control-web/assets/dark-plus-C3mMm8J8.js +1 -0
- package/dist/control-web/assets/dart-CF10PKvl.js +1 -0
- package/dist/control-web/assets/dax-CEL-wOlO.js +1 -0
- package/dist/control-web/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/control-web/assets/desktop-BmXAJ9_W.js +1 -0
- package/dist/control-web/assets/diagram-FQU43EPY-Cybg22U0.js +3 -0
- package/dist/control-web/assets/diagram-G47NLZAW-CGeIKUfW.js +24 -0
- package/dist/control-web/assets/diagram-NH7WQ7WH-BJq5MBRm.js +24 -0
- package/dist/control-web/assets/diagram-OA4YK3LP-DquOQGwg.js +30 -0
- package/dist/control-web/assets/diagram-WEI45ONY-Cblb4xP2.js +41 -0
- package/dist/control-web/assets/diff-D97Zzqfu.js +1 -0
- package/dist/control-web/assets/docker-BcOcwvcX.js +1 -0
- package/dist/control-web/assets/dotenv-Da5cRb03.js +1 -0
- package/dist/control-web/assets/dracula-BzJJZx-M.js +1 -0
- package/dist/control-web/assets/dracula-soft-BXkSAIEj.js +1 -0
- package/dist/control-web/assets/dream-maker-BtqSS_iP.js +1 -0
- package/dist/control-web/assets/ebnfDiagram-CCIWWBDH-CQjHiOqj.js +1 -0
- package/dist/control-web/assets/edge-BkV0erSs.js +1 -0
- package/dist/control-web/assets/elixir-CDX3lj18.js +1 -0
- package/dist/control-web/assets/elm-DbKCFpqz.js +1 -0
- package/dist/control-web/assets/emacs-lisp-C9XAeP06.js +1 -0
- package/dist/control-web/assets/erDiagram-Q63AITRT-Bspr3uKJ.js +85 -0
- package/dist/control-web/assets/erb-B12qg9BL.js +1 -0
- package/dist/control-web/assets/erlang-DsQrWhSR.js +1 -0
- package/dist/control-web/assets/everforest-dark-BgDCqdQA.js +1 -0
- package/dist/control-web/assets/everforest-light-C8M2exoo.js +1 -0
- package/dist/control-web/assets/fennel-BYunw83y.js +1 -0
- package/dist/control-web/assets/fish-BvzEVeQv.js +1 -0
- package/dist/control-web/assets/flowDiagram-23GEKE2U-CxcZyBA-.js +156 -0
- package/dist/control-web/assets/fluent-C4IJs8-o.js +1 -0
- package/dist/control-web/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
- package/dist/control-web/assets/fortran-free-form-BxgE0vQu.js +1 -0
- package/dist/control-web/assets/fsharp-CXgrBDvD.js +1 -0
- package/dist/control-web/assets/ganttDiagram-NO4QXBWP-qBdh7A-P.js +292 -0
- package/dist/control-web/assets/gdresource-BOOCDP_w.js +1 -0
- package/dist/control-web/assets/gdscript-C5YyOfLZ.js +1 -0
- package/dist/control-web/assets/gdshader-DkwncUOv.js +1 -0
- package/dist/control-web/assets/genie-D0YGMca9.js +1 -0
- package/dist/control-web/assets/gherkin-DyxjwDmM.js +1 -0
- package/dist/control-web/assets/git-commit-F4YmCXRG.js +1 -0
- package/dist/control-web/assets/git-rebase-r7XF79zn.js +1 -0
- package/dist/control-web/assets/gitGraphDiagram-IHSO6WYX-BTYub2KT.js +106 -0
- package/dist/control-web/assets/github-dark-DHJKELXO.js +1 -0
- package/dist/control-web/assets/github-dark-default-Cuk6v7N8.js +1 -0
- package/dist/control-web/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
- package/dist/control-web/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
- package/dist/control-web/assets/github-light-DAi9KRSo.js +1 -0
- package/dist/control-web/assets/github-light-default-D7oLnXFd.js +1 -0
- package/dist/control-web/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
- package/dist/control-web/assets/gleam-BspZqrRM.js +1 -0
- package/dist/control-web/assets/glimmer-js-Rg0-pVw9.js +1 -0
- package/dist/control-web/assets/glimmer-ts-U6CK756n.js +1 -0
- package/dist/control-web/assets/glsl-DplSGwfg.js +1 -0
- package/dist/control-web/assets/gn-n2N0HUVH.js +1 -0
- package/dist/control-web/assets/gnuplot-DdkO51Og.js +1 -0
- package/dist/control-web/assets/go-CxLEBnE3.js +1 -0
- package/dist/control-web/assets/graph-C9eacEi8.js +1 -0
- package/dist/control-web/assets/graphql-ChdNCCLP.js +1 -0
- package/dist/control-web/assets/groovy-gcz8RCvz.js +1 -0
- package/dist/control-web/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
- package/dist/control-web/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
- package/dist/control-web/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
- package/dist/control-web/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
- package/dist/control-web/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
- package/dist/control-web/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
- package/dist/control-web/assets/hack-CaT9iCJl.js +1 -0
- package/dist/control-web/assets/haml-B8DHNrY2.js +1 -0
- package/dist/control-web/assets/handlebars-BL8al0AC.js +1 -0
- package/dist/control-web/assets/haskell-Df6bDoY_.js +1 -0
- package/dist/control-web/assets/haxe-CzTSHFRz.js +1 -0
- package/dist/control-web/assets/hcl-BWvSN4gD.js +1 -0
- package/dist/control-web/assets/{highlighted-body-OFNGDK62-DWWsUtHF.js → highlighted-body-OFNGDK62-DyksUrwu.js} +1 -1
- package/dist/control-web/assets/hjson-D5-asLiD.js +1 -0
- package/dist/control-web/assets/hlsl-D3lLCCz7.js +1 -0
- package/dist/control-web/assets/horizon-BUw7H-hv.js +1 -0
- package/dist/control-web/assets/horizon-bright-Cn-bp-IR.js +1 -0
- package/dist/control-web/assets/houston-DnULxvSX.js +1 -0
- package/dist/control-web/assets/html-GMplVEZG.js +1 -0
- package/dist/control-web/assets/html-derivative-BFtXZ54Q.js +1 -0
- package/dist/control-web/assets/http-jrhK8wxY.js +1 -0
- package/dist/control-web/assets/hurl-irOxFIW8.js +1 -0
- package/dist/control-web/assets/hxml-Bvhsp5Yf.js +1 -0
- package/dist/control-web/assets/hy-DFXneXwc.js +1 -0
- package/dist/control-web/assets/imba-DGztddWO.js +1 -0
- package/dist/control-web/assets/index-B9SAq_63.js +718 -0
- package/dist/control-web/assets/index-BDaSctIT.js +153 -0
- package/dist/control-web/assets/index-CtaYRNgJ.css +32 -0
- package/dist/control-web/assets/infoDiagram-FWYZ7A6U-ChbQR3Zo.js +2 -0
- package/dist/control-web/assets/ini-BEwlwnbL.js +1 -0
- package/dist/control-web/assets/init-Gi6I4Gst.js +1 -0
- package/dist/control-web/assets/ishikawaDiagram-FXEZZL3T-C-4_qGzn.js +70 -0
- package/dist/control-web/assets/java-CylS5w8V.js +1 -0
- package/dist/control-web/assets/javascript-wDzz0qaB.js +1 -0
- package/dist/control-web/assets/jinja-4LBKfQ-Z.js +1 -0
- package/dist/control-web/assets/jison-wvAkD_A8.js +1 -0
- package/dist/control-web/assets/journeyDiagram-5HDEW3XC-B090zN18.js +139 -0
- package/dist/control-web/assets/json-Cp-IABpG.js +1 -0
- package/dist/control-web/assets/json5-C9tS-k6U.js +1 -0
- package/dist/control-web/assets/jsonc-Des-eS-w.js +1 -0
- package/dist/control-web/assets/jsonl-DcaNXYhu.js +1 -0
- package/dist/control-web/assets/jsonnet-DFQXde-d.js +1 -0
- package/dist/control-web/assets/jssm-C2t-YnRu.js +1 -0
- package/dist/control-web/assets/jsx-g9-lgVsj.js +1 -0
- package/dist/control-web/assets/julia-CxzCAyBv.js +1 -0
- package/dist/control-web/assets/just-Cw27pwNe.js +1 -0
- package/dist/control-web/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
- package/dist/control-web/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
- package/dist/control-web/assets/kanagawa-wave-DWedfzmr.js +1 -0
- package/dist/control-web/assets/kanban-definition-HUTT4EX6-RlTcRbPs.js +89 -0
- package/dist/control-web/assets/kdl-DV7GczEv.js +1 -0
- package/dist/control-web/assets/kotlin-BdnUsdx6.js +1 -0
- package/dist/control-web/assets/kusto-DZf3V79B.js +1 -0
- package/dist/control-web/assets/laserwave-DUszq2jm.js +1 -0
- package/dist/control-web/assets/latex-CWtU0Tv5.js +1 -0
- package/dist/control-web/assets/layout-DEXfKzaS.js +1 -0
- package/dist/control-web/assets/lean-BZvkOJ9d.js +1 -0
- package/dist/control-web/assets/less-B1dDrJ26.js +1 -0
- package/dist/control-web/assets/light-plus-B7mTdjB0.js +1 -0
- package/dist/control-web/assets/linear-DTuNxDqu.js +1 -0
- package/dist/control-web/assets/liquid-DYVedYrR.js +1 -0
- package/dist/control-web/assets/llvm-DjAJT7YJ.js +1 -0
- package/dist/control-web/assets/log-2UxHyX5q.js +1 -0
- package/dist/control-web/assets/logo-BtOb2qkB.js +1 -0
- package/dist/control-web/assets/lua-BaeVxFsk.js +1 -0
- package/dist/control-web/assets/luau-C-HG3fhB.js +1 -0
- package/dist/control-web/assets/make-CHLpvVh8.js +1 -0
- package/dist/control-web/assets/map-Czzmt4hB.js +1 -0
- package/dist/control-web/assets/markdown-Cvjx9yec.js +1 -0
- package/dist/control-web/assets/marko-CnJfTvn9.js +1 -0
- package/dist/control-web/assets/material-theme-D5KoaKCx.js +1 -0
- package/dist/control-web/assets/material-theme-darker-BfHTSMKl.js +1 -0
- package/dist/control-web/assets/material-theme-lighter-B0m2ddpp.js +1 -0
- package/dist/control-web/assets/material-theme-ocean-CyktbL80.js +1 -0
- package/dist/control-web/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
- package/dist/control-web/assets/matlab-D7o27uSR.js +1 -0
- package/dist/control-web/assets/mdc-BMNejdWA.js +1 -0
- package/dist/control-web/assets/mdx-Cmh6b_Ma.js +1 -0
- package/dist/control-web/assets/mermaid-GHXKKRXX-BYZTj3zW.css +1 -0
- package/dist/control-web/assets/mermaid-GHXKKRXX-BkcV3dgg.js +710 -0
- package/dist/control-web/assets/mermaid-mWjccvbQ.js +1 -0
- package/dist/control-web/assets/min-dark-CafNBF8u.js +1 -0
- package/dist/control-web/assets/min-light-CTRr51gU.js +1 -0
- package/dist/control-web/assets/mindmap-definition-LN4V7U3C-DYby41E9.js +96 -0
- package/dist/control-web/assets/mipsasm-CKIfxQSi.js +1 -0
- package/dist/control-web/assets/mojo-rZm6bMo-.js +1 -0
- package/dist/control-web/assets/monokai-D4h5O-jR.js +1 -0
- package/dist/control-web/assets/moonbit-_H4v1dQx.js +1 -0
- package/dist/control-web/assets/move-IF9eRakj.js +1 -0
- package/dist/control-web/assets/narrat-DRg8JJMk.js +1 -0
- package/dist/control-web/assets/nextflow-Zz6hmt5N.js +1 -0
- package/dist/control-web/assets/nextflow-groovy-BeH2EWoN.js +1 -0
- package/dist/control-web/assets/nginx-BpAMiNFr.js +1 -0
- package/dist/control-web/assets/night-owl-C39BiMTA.js +1 -0
- package/dist/control-web/assets/night-owl-light-CMTm3GFP.js +1 -0
- package/dist/control-web/assets/nim-CVrawwO9.js +1 -0
- package/dist/control-web/assets/nix-CwoSXNpI.js +1 -0
- package/dist/control-web/assets/nord-Ddv68eIx.js +1 -0
- package/dist/control-web/assets/nushell-Cz2AlsmD.js +1 -0
- package/dist/control-web/assets/objective-c-DXmwc3jG.js +1 -0
- package/dist/control-web/assets/objective-cpp-CLxacb5B.js +1 -0
- package/dist/control-web/assets/ocaml-C0hk2d4L.js +1 -0
- package/dist/control-web/assets/odin-BBf5iR-q.js +1 -0
- package/dist/control-web/assets/one-dark-pro-DVMEJ2y_.js +1 -0
- package/dist/control-web/assets/one-light-C3Wv6jpd.js +1 -0
- package/dist/control-web/assets/openscad-C4EeE6gA.js +1 -0
- package/dist/control-web/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/control-web/assets/pascal-D93ZcfNL.js +1 -0
- package/dist/control-web/assets/pegDiagram-2B236MQR-CPK6GaEv.js +1 -0
- package/dist/control-web/assets/perl-C0TMdlhV.js +1 -0
- package/dist/control-web/assets/php-Dhbhpdrm.js +1 -0
- package/dist/control-web/assets/pieDiagram-ENE6RG2P-DLCmXuji.js +39 -0
- package/dist/control-web/assets/pkl-u5AG7uiY.js +1 -0
- package/dist/control-web/assets/plastic-3e1v2bzS.js +1 -0
- package/dist/control-web/assets/plsql-ChMvpjG-.js +1 -0
- package/dist/control-web/assets/po-BTJTHyun.js +1 -0
- package/dist/control-web/assets/poimandres-CS3Unz2-.js +1 -0
- package/dist/control-web/assets/polar-C0HS_06l.js +1 -0
- package/dist/control-web/assets/postcss-CXtECtnM.js +1 -0
- package/dist/control-web/assets/powerquery-CEu0bR-o.js +1 -0
- package/dist/control-web/assets/powershell-Dpen1YoG.js +1 -0
- package/dist/control-web/assets/prisma-Dd19v3D-.js +1 -0
- package/dist/control-web/assets/prolog-CbFg5uaA.js +1 -0
- package/dist/control-web/assets/proto-C7zT0LnQ.js +1 -0
- package/dist/control-web/assets/pug-CGlum2m_.js +1 -0
- package/dist/control-web/assets/puppet-BMWR74SV.js +1 -0
- package/dist/control-web/assets/purescript-CklMAg4u.js +1 -0
- package/dist/control-web/assets/python-B6aJPvgy.js +1 -0
- package/dist/control-web/assets/qml-3beO22l8.js +1 -0
- package/dist/control-web/assets/qmldir-C8lEn-DE.js +1 -0
- package/dist/control-web/assets/qss-IeuSbFQv.js +1 -0
- package/dist/control-web/assets/quadrantDiagram-ABIIQ3AL-RIS8r7CA.js +7 -0
- package/dist/control-web/assets/r-Dspwwk_N.js +1 -0
- package/dist/control-web/assets/racket-BqYA7rlc.js +1 -0
- package/dist/control-web/assets/railroadDiagram-RFXS5EU6-B1HB7xsg.js +1 -0
- package/dist/control-web/assets/raku-DXvB9xmW.js +1 -0
- package/dist/control-web/assets/razor-Uh8Bk_45.js +1 -0
- package/dist/control-web/assets/red-bN70gL4F.js +1 -0
- package/dist/control-web/assets/reg-C-SQnVFl.js +1 -0
- package/dist/control-web/assets/regexp-CDVJQ6XC.js +1 -0
- package/dist/control-web/assets/rel-C3B-1QV4.js +1 -0
- package/dist/control-web/assets/requirementDiagram-TGXJPOKE-Inh_4hU0.js +84 -0
- package/dist/control-web/assets/riscv-BM1_JUlF.js +1 -0
- package/dist/control-web/assets/ron-D8l8udqQ.js +1 -0
- package/dist/control-web/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
- package/dist/control-web/assets/rose-pine-moon-D4_iv3hh.js +1 -0
- package/dist/control-web/assets/rose-pine-qdsjHGoJ.js +1 -0
- package/dist/control-web/assets/rosmsg-BJDFO7_C.js +1 -0
- package/dist/control-web/assets/rst-BrH8l1NY.js +1 -0
- package/dist/control-web/assets/ruby-Dw2BHqvy.js +1 -0
- package/dist/control-web/assets/rust-B1yitclQ.js +1 -0
- package/dist/control-web/assets/sankeyDiagram-HTMAVEWB-DPF33kPB.js +40 -0
- package/dist/control-web/assets/sas-cz2c8ADy.js +1 -0
- package/dist/control-web/assets/sass-Cj5Yp3dK.js +1 -0
- package/dist/control-web/assets/scala-C151Ov-r.js +1 -0
- package/dist/control-web/assets/scheme-C98Dy4si.js +1 -0
- package/dist/control-web/assets/scss-OYdSNvt2.js +1 -0
- package/dist/control-web/assets/sdbl-DVxCFoDh.js +1 -0
- package/dist/control-web/assets/sequenceDiagram-DBY2YBRQ-iywKWoYc.js +162 -0
- package/dist/control-web/assets/shaderlab-Dg9Lc6iA.js +1 -0
- package/dist/control-web/assets/shellscript-Yzrsuije.js +1 -0
- package/dist/control-web/assets/shellsession-BADoaaVG.js +1 -0
- package/dist/control-web/assets/sizeCapture-X5ZJPWSS-DlnHubz9.js +1 -0
- package/dist/control-web/assets/slack-dark-BthQWCQV.js +1 -0
- package/dist/control-web/assets/slack-ochin-DqwNpetd.js +1 -0
- package/dist/control-web/assets/smalltalk-BERRCDM3.js +1 -0
- package/dist/control-web/assets/snazzy-light-Bw305WKR.js +1 -0
- package/dist/control-web/assets/solarized-dark-DXbdFlpD.js +1 -0
- package/dist/control-web/assets/solarized-light-L9t79GZl.js +1 -0
- package/dist/control-web/assets/solidity-rGO070M0.js +1 -0
- package/dist/control-web/assets/soy-Brmx7dQM.js +1 -0
- package/dist/control-web/assets/sparql-rVzFXLq3.js +1 -0
- package/dist/control-web/assets/splunk-BtCnVYZw.js +1 -0
- package/dist/control-web/assets/sql-BLtJtn59.js +1 -0
- package/dist/control-web/assets/ssh-config-_ykCGR6B.js +1 -0
- package/dist/control-web/assets/stata-BH5u7GGu.js +1 -0
- package/dist/control-web/assets/stateDiagram-2N3HPSRC-CShzll2N.js +1 -0
- package/dist/control-web/assets/stateDiagram-v2-6OUMAXLB-Cdx0fWna.js +1 -0
- package/dist/control-web/assets/stylus-BEDo0Tqx.js +1 -0
- package/dist/control-web/assets/surrealql-Bq5Q-fJD.js +1 -0
- package/dist/control-web/assets/svelte-C_ipcX3V.js +1 -0
- package/dist/control-web/assets/swift-D82vCrfD.js +1 -0
- package/dist/control-web/assets/swimlanes-5IMT3BWC-CxlQpFBv.js +2 -0
- package/dist/control-web/assets/swimlanesDiagram-G3AALYLV-CoX0jnUu.js +8 -0
- package/dist/control-web/assets/synthwave-84-CbfX1IO0.js +1 -0
- package/dist/control-web/assets/system-verilog-CnnmHF94.js +1 -0
- package/dist/control-web/assets/systemd-4A_iFExJ.js +1 -0
- package/dist/control-web/assets/talonscript-CkByrt1z.js +1 -0
- package/dist/control-web/assets/tasl-QIJgUcNo.js +1 -0
- package/dist/control-web/assets/tcl-dwOrl1Do.js +1 -0
- package/dist/control-web/assets/templ-P3uqSqPl.js +1 -0
- package/dist/control-web/assets/terraform-BETggiCN.js +1 -0
- package/dist/control-web/assets/tex-idrVyKtj.js +1 -0
- package/dist/control-web/assets/timeline-definition-FHXFAJF6-Dlx59Xc3.js +120 -0
- package/dist/control-web/assets/tokyo-night-hegEt444.js +1 -0
- package/dist/control-web/assets/toml-vGWfd6FD.js +1 -0
- package/dist/control-web/assets/ts-tags-zn1MmPIZ.js +1 -0
- package/dist/control-web/assets/tsv-B_m7g4N7.js +1 -0
- package/dist/control-web/assets/tsx-COt5Ahok.js +1 -0
- package/dist/control-web/assets/turtle-BsS91CYL.js +1 -0
- package/dist/control-web/assets/twig-DNn4PbVi.js +1 -0
- package/dist/control-web/assets/typescript-BPQ3VLAy.js +1 -0
- package/dist/control-web/assets/typespec-BGHnOYBU.js +1 -0
- package/dist/control-web/assets/typst-DHCkPAjA.js +1 -0
- package/dist/control-web/assets/v-BcVCzyr7.js +1 -0
- package/dist/control-web/assets/vala-CsfeWuGM.js +1 -0
- package/dist/control-web/assets/vb-D17OF-Vu.js +1 -0
- package/dist/control-web/assets/vennDiagram-L72KCM5P-DLsv4i_t.js +34 -0
- package/dist/control-web/assets/verilog-BQ8w6xss.js +1 -0
- package/dist/control-web/assets/vesper-DU1UobuO.js +1 -0
- package/dist/control-web/assets/vhdl-CeAyd5Ju.js +1 -0
- package/dist/control-web/assets/viml-CJc9bBzg.js +1 -0
- package/dist/control-web/assets/vitesse-black-Bkuqu6BP.js +1 -0
- package/dist/control-web/assets/vitesse-dark-D0r3Knsf.js +1 -0
- package/dist/control-web/assets/vitesse-light-CVO1_9PV.js +1 -0
- package/dist/control-web/assets/vue-DN_0RTcg.js +1 -0
- package/dist/control-web/assets/vue-html-AaS7Mt5G.js +1 -0
- package/dist/control-web/assets/vue-vine-CQOfvN7w.js +1 -0
- package/dist/control-web/assets/vyper-CDx5xZoG.js +1 -0
- package/dist/control-web/assets/wardleyDiagram-EHGQE667-BazV8fpH.js +78 -0
- package/dist/control-web/assets/wasm-CG6Dc4jp.js +1 -0
- package/dist/control-web/assets/wasm-MzD3tlZU.js +1 -0
- package/dist/control-web/assets/wenyan-BV7otONQ.js +1 -0
- package/dist/control-web/assets/wgsl-Dx-B1_4e.js +1 -0
- package/dist/control-web/assets/wikitext-BhOHFoWU.js +1 -0
- package/dist/control-web/assets/wit-5i3qLPDT.js +1 -0
- package/dist/control-web/assets/wolfram-lXgVvXCa.js +1 -0
- package/dist/control-web/assets/xml-sdJ4AIDG.js +1 -0
- package/dist/control-web/assets/xsl-CtQFsRM5.js +1 -0
- package/dist/control-web/assets/xychartDiagram-FW5EYKEG-Bx9uDlYu.js +7 -0
- package/dist/control-web/assets/yaml-Buea-lGh.js +1 -0
- package/dist/control-web/assets/zenscript-DVFEvuxE.js +1 -0
- package/dist/control-web/assets/zig-VOosw3JB.js +1 -0
- package/dist/control-web/index.html +2 -2
- package/dist/control-web-dist.d.ts +1 -1
- package/dist/control-web-dist.js +4 -2
- package/dist/machine-session-service.d.ts +82 -15
- package/dist/machine-session-service.js +670 -80
- package/dist/remote-runtime-dispatcher.d.ts +1 -1
- package/dist/remote-runtime-dispatcher.js +16 -1
- package/dist/remote-runtime-session-projection.js +5 -0
- package/dist/server.d.ts +24 -7
- package/dist/server.js +207 -46
- package/dist/session-portal.d.ts +42 -0
- package/dist/session-portal.js +746 -0
- package/dist/session-runtime-index.d.ts +2 -6
- package/dist/session-runtime-index.js +70 -38
- package/dist/terminal-ws.js +8 -6
- package/package.json +7 -7
- package/dist/control-web/assets/index-BnX7NWJX.js +0 -689
- package/dist/control-web/assets/index-CUoWRX2i.css +0 -32
- package/dist/control-web/assets/mermaid-GHXKKRXX-C1fxAgiw.js +0 -131
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
* Direct adapters can therefore expose the same behavior without copying state
|
|
8
8
|
* into a Control Plane database.
|
|
9
9
|
*/
|
|
10
|
-
import { createHash
|
|
11
|
-
import {
|
|
10
|
+
import { createHash } from "node:crypto";
|
|
11
|
+
import { open, realpath, stat } from "node:fs/promises";
|
|
12
|
+
import { basename, extname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
13
|
+
import { SESSION_PROVIDER_IDS, getRuntimeProfile, isSessionProviderId, newSessionId, normalizeSessionTitle, } from "@rynx-ai/core";
|
|
12
14
|
import { REMOTE_RUNTIME_SESSION_DEFAULT_PAGE_SIZE, REMOTE_RUNTIME_SESSION_MAX_CURSOR_CHARS, REMOTE_RUNTIME_SESSION_MAX_ID_CHARS, REMOTE_RUNTIME_SESSION_MAX_PAGE_SIZE, } from "@rynx-ai/protocol/remote-runtime-rpc";
|
|
13
15
|
const DEFAULT_LIST_LIMIT = REMOTE_RUNTIME_SESSION_DEFAULT_PAGE_SIZE;
|
|
14
16
|
const MAX_LIST_LIMIT = REMOTE_RUNTIME_SESSION_MAX_PAGE_SIZE;
|
|
@@ -31,10 +33,12 @@ export class MachineSessionServiceInputError extends Error {
|
|
|
31
33
|
export class MachineSessionServiceFailure extends Error {
|
|
32
34
|
code;
|
|
33
35
|
detail;
|
|
34
|
-
|
|
36
|
+
runtimeFailure;
|
|
37
|
+
constructor(code, message, detail, runtimeFailure) {
|
|
35
38
|
super(message);
|
|
36
39
|
this.code = code;
|
|
37
40
|
this.detail = detail;
|
|
41
|
+
this.runtimeFailure = runtimeFailure;
|
|
38
42
|
this.name = "MachineSessionServiceFailure";
|
|
39
43
|
}
|
|
40
44
|
}
|
|
@@ -52,6 +56,7 @@ export class MachineSessionService {
|
|
|
52
56
|
pendingDeliveries = new Map();
|
|
53
57
|
cancelledPendingDeliveries = new Set();
|
|
54
58
|
forkTasks = new Map();
|
|
59
|
+
sessionMutationTails = new Map();
|
|
55
60
|
constructor(ports, options = {}) {
|
|
56
61
|
this.ports = ports;
|
|
57
62
|
this.maxListLimit = boundedInteger(options.maxListLimit ?? MAX_LIST_LIMIT, 1, MAX_LIST_LIMIT, "maxListLimit");
|
|
@@ -159,11 +164,18 @@ export class MachineSessionService {
|
|
|
159
164
|
const statusCache = new Map();
|
|
160
165
|
const { agents } = await this.agentOptions();
|
|
161
166
|
const [providers, launchAgents] = await Promise.all([
|
|
162
|
-
Promise.all(SESSION_PROVIDER_IDS.map(async (provider) =>
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
+
Promise.all(SESSION_PROVIDER_IDS.map(async (provider) => {
|
|
168
|
+
const execution = this.ports.execution;
|
|
169
|
+
const models = execution?.listModels
|
|
170
|
+
? await execution.listModels(provider).catch(() => [])
|
|
171
|
+
: undefined;
|
|
172
|
+
return {
|
|
173
|
+
id: provider,
|
|
174
|
+
name: getRuntimeProfile(provider).displayName,
|
|
175
|
+
...await this.runtimeReadiness(provider, statusCache),
|
|
176
|
+
...(models === undefined ? {} : { models }),
|
|
177
|
+
};
|
|
178
|
+
})),
|
|
167
179
|
Promise.all(agents.map(async (agent) => {
|
|
168
180
|
const execution = this.ports.execution;
|
|
169
181
|
if (!execution) {
|
|
@@ -192,6 +204,97 @@ export class MachineSessionService {
|
|
|
192
204
|
]);
|
|
193
205
|
return { providers, agents: launchAgents };
|
|
194
206
|
}
|
|
207
|
+
/** Read the effective model defaults used for the next turn. */
|
|
208
|
+
async executionSettings(sessionIdInput) {
|
|
209
|
+
const sessionId = validOpaqueToken(sessionIdInput, "sessionId", MAX_SESSION_ID_CHARS);
|
|
210
|
+
const meta = this.ports.registry.get(sessionId);
|
|
211
|
+
if (!meta) {
|
|
212
|
+
throw new MachineSessionServiceFailure("not_found", "session not found");
|
|
213
|
+
}
|
|
214
|
+
return executionSettingsResult(meta.execution);
|
|
215
|
+
}
|
|
216
|
+
/** Replace the defaults for the next new Turn. Codex-lineage Providers keep
|
|
217
|
+
* their live runner: the host applies changed native thread settings under
|
|
218
|
+
* its injection lock immediately before the next `turn/start`. Claude still
|
|
219
|
+
* needs an idle cold resume because its live CLI has no confirmed settings
|
|
220
|
+
* update boundary. Provider CLIs own model availability validation. */
|
|
221
|
+
async updateExecutionSettings(input) {
|
|
222
|
+
const sessionId = validOpaqueToken(input.sessionId, "sessionId", MAX_SESSION_ID_CHARS);
|
|
223
|
+
const modelId = input.model === null ? null : validRequiredText(input.model, "model");
|
|
224
|
+
const reasoningEffort = input.reasoningEffort === null
|
|
225
|
+
? null
|
|
226
|
+
: validRequiredText(input.reasoningEffort, "reasoningEffort");
|
|
227
|
+
return this.withSessionMutation(sessionId, async () => {
|
|
228
|
+
const meta = this.ports.registry.get(sessionId);
|
|
229
|
+
if (!meta) {
|
|
230
|
+
throw new MachineSessionServiceFailure("not_found", "session not found");
|
|
231
|
+
}
|
|
232
|
+
await this.assertNotForkReserved(sessionId);
|
|
233
|
+
const nextExecution = await this.replaceExecutionSettings(sessionId, meta, { model: modelId, reasoningEffort }, input.collaborationMode);
|
|
234
|
+
return executionSettingsResult(nextExecution);
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
async replaceExecutionSettings(sessionId, meta, selection, collaborationMode) {
|
|
238
|
+
if (meta.execution.provider === "claude") {
|
|
239
|
+
const runtime = this.ports.runtimeState.snapshot(sessionId);
|
|
240
|
+
const pendingMessage = await this.ports.pendingMessages?.get(sessionId);
|
|
241
|
+
if (runtime.status !== "idle" ||
|
|
242
|
+
runtime.activeResponseIds.length > 0 ||
|
|
243
|
+
runtime.pendingInteractions.length > 0 ||
|
|
244
|
+
pendingMessage) {
|
|
245
|
+
throw new MachineSessionServiceFailure("failed_precondition", "Claude Session must be idle before changing model settings");
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
const executionPort = this.requireExecution();
|
|
249
|
+
const nextExecution = {
|
|
250
|
+
...structuredClone(meta.execution),
|
|
251
|
+
model: selection.model,
|
|
252
|
+
reasoningEffort: selection.reasoningEffort,
|
|
253
|
+
...(meta.execution.provider !== "claude" && collaborationMode !== undefined
|
|
254
|
+
? { collaborationMode }
|
|
255
|
+
: {}),
|
|
256
|
+
};
|
|
257
|
+
if (meta.execution.provider !== "claude" && collaborationMode !== undefined) {
|
|
258
|
+
const updateMode = executionPort.runner.updateCollaborationMode;
|
|
259
|
+
if (!updateMode) {
|
|
260
|
+
const message = "This Runtime does not support live collaboration-mode updates";
|
|
261
|
+
throw new MachineSessionServiceFailure("failed_precondition", message, message, {
|
|
262
|
+
message,
|
|
263
|
+
code: "collaboration_mode_unavailable",
|
|
264
|
+
statusCode: 409,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
// Omnigent parity: native state is authoritative. Do not make a failed
|
|
268
|
+
// toggle survive reload when the loaded thread rejected it.
|
|
269
|
+
try {
|
|
270
|
+
await updateMode.call(executionPort.runner, sessionId, collaborationMode);
|
|
271
|
+
}
|
|
272
|
+
catch (error) {
|
|
273
|
+
const failure = liveSessionFailureFrom(error);
|
|
274
|
+
const message = collaborationModeFailureMessage(meta.execution.provider, failure, error instanceof Error ? error.message : "Native collaboration mode update failed");
|
|
275
|
+
throw new MachineSessionServiceFailure("failed_precondition", message, message, failure ? { ...failure, message } : undefined);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
this.ports.registry.setExecution(sessionId, nextExecution);
|
|
279
|
+
if (nextExecution.provider === "claude") {
|
|
280
|
+
executionPort.runner.stopRunner(sessionId);
|
|
281
|
+
}
|
|
282
|
+
return nextExecution;
|
|
283
|
+
}
|
|
284
|
+
/** Persist a mode changed from the native TUI before its reflected event is
|
|
285
|
+
* fanned out to Web clients. Unknown/deleted and Claude Sessions are ignored. */
|
|
286
|
+
recordNativeCollaborationMode(sessionIdInput, mode) {
|
|
287
|
+
const sessionId = validOpaqueToken(sessionIdInput, "sessionId", MAX_SESSION_ID_CHARS);
|
|
288
|
+
const meta = this.ports.registry.get(sessionId);
|
|
289
|
+
if (!meta || meta.execution.provider === "claude")
|
|
290
|
+
return;
|
|
291
|
+
if (meta.execution.collaborationMode === mode)
|
|
292
|
+
return;
|
|
293
|
+
this.ports.registry.setExecution(sessionId, {
|
|
294
|
+
...structuredClone(meta.execution),
|
|
295
|
+
collaborationMode: mode,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
195
298
|
/** Create target-owned Session identity from one Agent preset or direct Provider. */
|
|
196
299
|
async create(input) {
|
|
197
300
|
return this.withAdmission(() => this.createAdmitted(input));
|
|
@@ -223,6 +326,7 @@ export class MachineSessionService {
|
|
|
223
326
|
...target,
|
|
224
327
|
...(input.model === undefined ? {} : { model: input.model }),
|
|
225
328
|
...(input.reasoningEffort === undefined ? {} : { reasoningEffort: input.reasoningEffort }),
|
|
329
|
+
...(input.permissionPreset === undefined ? {} : { permissionPreset: input.permissionPreset }),
|
|
226
330
|
cwd: workspace.cwd,
|
|
227
331
|
});
|
|
228
332
|
const sessionId = newSessionId();
|
|
@@ -395,8 +499,122 @@ export class MachineSessionService {
|
|
|
395
499
|
async sendMessage(sessionIdInput, messageInput) {
|
|
396
500
|
return this.withAdmission(() => this.sendMessageAdmitted(sessionIdInput, messageInput));
|
|
397
501
|
}
|
|
398
|
-
|
|
502
|
+
/** Start a turn and return only that response's canonical event stream. */
|
|
503
|
+
async startRun(sessionIdInput, messageInput, options = {}) {
|
|
504
|
+
return this.withAdmission(async () => {
|
|
505
|
+
const sessionId = validOpaqueToken(sessionIdInput, "sessionId", MAX_SESSION_ID_CHARS);
|
|
506
|
+
const meta = this.ports.registry.get(sessionId);
|
|
507
|
+
if (!meta)
|
|
508
|
+
throw new MachineSessionServiceFailure("not_found", "Session not found");
|
|
509
|
+
const subscription = this.ports.events.subscribe(sessionId)[Symbol.asyncIterator]();
|
|
510
|
+
let unsteer;
|
|
511
|
+
let ownsTurn = false;
|
|
512
|
+
const activateTurn = () => {
|
|
513
|
+
if (ownsTurn)
|
|
514
|
+
return;
|
|
515
|
+
ownsTurn = true;
|
|
516
|
+
if (!options.signal?.aborted) {
|
|
517
|
+
unsteer = options.steer?.subscribe((text) => {
|
|
518
|
+
void this.requireExecution().runner.injectMessage(sessionId, text);
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
const interrupt = () => {
|
|
523
|
+
if (ownsTurn)
|
|
524
|
+
void this.ports.interruption.interrupt(sessionId);
|
|
525
|
+
};
|
|
526
|
+
try {
|
|
527
|
+
options.signal?.addEventListener("abort", interrupt, { once: true });
|
|
528
|
+
const result = await this.sendMessageAdmitted(sessionId, messageInput, options.signal, activateTurn, true, options.collaborationMode
|
|
529
|
+
? { collaborationMode: options.collaborationMode }
|
|
530
|
+
: undefined);
|
|
531
|
+
if (!result.responseId) {
|
|
532
|
+
throw new MachineSessionServiceFailure("outcome_unknown", "run was already accepted but its response stream is unavailable");
|
|
533
|
+
}
|
|
534
|
+
const responseId = result.responseId;
|
|
535
|
+
const replayItems = result.replayed
|
|
536
|
+
? (await this.ports.log.snapshot(sessionId)).filter((item) => item.responseId === responseId)
|
|
537
|
+
: [];
|
|
538
|
+
const replayedItemIds = new Set(replayItems.map((item) => item.id));
|
|
539
|
+
const replayWasActive = this.ports.runtimeState
|
|
540
|
+
.snapshot(sessionId)
|
|
541
|
+
.activeResponseIds.includes(responseId);
|
|
542
|
+
if (result.replayed && !replayWasActive) {
|
|
543
|
+
throw new MachineSessionServiceFailure("outcome_unknown", "run was already accepted but its terminal event is no longer available");
|
|
544
|
+
}
|
|
545
|
+
if (result.replayed) {
|
|
546
|
+
activateTurn();
|
|
547
|
+
if (options.signal?.aborted) {
|
|
548
|
+
await this.ports.interruption.interrupt(sessionId).catch(() => false);
|
|
549
|
+
throw abortReason(options.signal);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
const runExecution = result.operationExecution ?? {
|
|
553
|
+
model: meta.execution.model,
|
|
554
|
+
reasoningEffort: meta.execution.reasoningEffort,
|
|
555
|
+
};
|
|
556
|
+
const model = runExecution.model;
|
|
557
|
+
const generator = (async function* () {
|
|
558
|
+
try {
|
|
559
|
+
if (result.replayed) {
|
|
560
|
+
yield {
|
|
561
|
+
type: "response.created",
|
|
562
|
+
sessionId,
|
|
563
|
+
responseId,
|
|
564
|
+
model: model ?? "unknown",
|
|
565
|
+
};
|
|
566
|
+
for (const item of replayItems)
|
|
567
|
+
yield replaySessionItem(item);
|
|
568
|
+
}
|
|
569
|
+
while (true) {
|
|
570
|
+
const next = await subscription.next();
|
|
571
|
+
if (next.done)
|
|
572
|
+
return;
|
|
573
|
+
const event = next.value;
|
|
574
|
+
if (sessionEventResponseId(event) !== responseId)
|
|
575
|
+
continue;
|
|
576
|
+
const itemId = sessionEventItemId(event);
|
|
577
|
+
if (itemId && replayedItemIds.has(itemId))
|
|
578
|
+
continue;
|
|
579
|
+
yield event;
|
|
580
|
+
if (event.type === "response.completed" || event.type === "response.failed")
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
finally {
|
|
585
|
+
options.signal?.removeEventListener("abort", interrupt);
|
|
586
|
+
unsteer?.();
|
|
587
|
+
await subscription.return?.();
|
|
588
|
+
}
|
|
589
|
+
})();
|
|
590
|
+
const provider = meta.execution.provider;
|
|
591
|
+
return {
|
|
592
|
+
responseId,
|
|
593
|
+
provider,
|
|
594
|
+
model: runExecution.model,
|
|
595
|
+
authSource: provider === "traex"
|
|
596
|
+
? "traex_cli"
|
|
597
|
+
: provider === "claude"
|
|
598
|
+
? "claude_cli"
|
|
599
|
+
: "codex_cli",
|
|
600
|
+
generator,
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
catch (error) {
|
|
604
|
+
options.signal?.removeEventListener("abort", interrupt);
|
|
605
|
+
unsteer?.();
|
|
606
|
+
await subscription.return?.();
|
|
607
|
+
throw error;
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
async sendMessageAdmitted(sessionIdInput, messageInput, signal, onTurnOwned, includeResponseId = false, turnOptions) {
|
|
399
612
|
const sessionId = validOpaqueToken(sessionIdInput, "sessionId", MAX_SESSION_ID_CHARS);
|
|
613
|
+
return this.withSessionMutation(sessionId, () => this.sendMessageAdmittedSerial(sessionId, messageInput, signal, onTurnOwned, includeResponseId, turnOptions));
|
|
614
|
+
}
|
|
615
|
+
async sendMessageAdmittedSerial(sessionId, messageInput, signal, onTurnOwned, includeResponseId = false, turnOptions) {
|
|
616
|
+
if (signal?.aborted)
|
|
617
|
+
throw abortReason(signal);
|
|
400
618
|
await this.assertNotForkReserved(sessionId);
|
|
401
619
|
const request = typeof messageInput === "string"
|
|
402
620
|
? { message: messageInput }
|
|
@@ -412,7 +630,24 @@ export class MachineSessionService {
|
|
|
412
630
|
if (hasContent && (!Array.isArray(request.content) || request.content.length === 0)) {
|
|
413
631
|
throw new MachineSessionServiceInputError("content must be a non-empty array");
|
|
414
632
|
}
|
|
415
|
-
|
|
633
|
+
let meta = this.ports.registry.get(sessionId);
|
|
634
|
+
const executionSelection = normalizeRunExecutionSelection(request.execution);
|
|
635
|
+
if (executionSelection && !meta) {
|
|
636
|
+
throw new MachineSessionServiceFailure("not_found", "session not found");
|
|
637
|
+
}
|
|
638
|
+
const requestedOperationExecution = executionSelection && meta
|
|
639
|
+
? {
|
|
640
|
+
selection: executionSelection,
|
|
641
|
+
snapshot: {
|
|
642
|
+
model: executionSelection.model !== undefined
|
|
643
|
+
? executionSelection.model
|
|
644
|
+
: meta.execution.model,
|
|
645
|
+
reasoningEffort: executionSelection.reasoningEffort !== undefined
|
|
646
|
+
? executionSelection.reasoningEffort
|
|
647
|
+
: meta.execution.reasoningEffort,
|
|
648
|
+
},
|
|
649
|
+
}
|
|
650
|
+
: undefined;
|
|
416
651
|
const consoleMeta = meta?.source === "console" ? meta : undefined;
|
|
417
652
|
let prepared;
|
|
418
653
|
const needsPreparedOperation = hasContent || request.clientMessageId !== undefined;
|
|
@@ -428,14 +663,24 @@ export class MachineSessionService {
|
|
|
428
663
|
}
|
|
429
664
|
prepared = await resources.prepareInput(sessionId, hasContent
|
|
430
665
|
? request.content
|
|
431
|
-
: [{ type: "input_text", text: request.message }], request.clientMessageId);
|
|
666
|
+
: [{ type: "input_text", text: request.message }], request.clientMessageId, ...(requestedOperationExecution ? [requestedOperationExecution] : []));
|
|
432
667
|
if (prepared.operationState === "injecting" ||
|
|
433
668
|
prepared.operationState === "outcome_unknown") {
|
|
434
669
|
throw new MachineSessionServiceFailure("outcome_unknown", "message delivery outcome is unknown");
|
|
435
670
|
}
|
|
436
671
|
if (prepared.operationState === "injected" ||
|
|
437
672
|
prepared.operationState === "mirrored") {
|
|
438
|
-
return {
|
|
673
|
+
return {
|
|
674
|
+
ok: true,
|
|
675
|
+
injected: true,
|
|
676
|
+
...(includeResponseId && prepared.responseId
|
|
677
|
+
? { responseId: prepared.responseId }
|
|
678
|
+
: {}),
|
|
679
|
+
...(prepared.operationExecution
|
|
680
|
+
? { operationExecution: prepared.operationExecution }
|
|
681
|
+
: {}),
|
|
682
|
+
replayed: true,
|
|
683
|
+
};
|
|
439
684
|
}
|
|
440
685
|
}
|
|
441
686
|
else {
|
|
@@ -449,108 +694,123 @@ export class MachineSessionService {
|
|
|
449
694
|
title: request.message,
|
|
450
695
|
};
|
|
451
696
|
}
|
|
697
|
+
const operationExecution = prepared.operationExecution ?? requestedOperationExecution?.snapshot;
|
|
698
|
+
if (operationExecution &&
|
|
699
|
+
meta &&
|
|
700
|
+
(operationExecution.model !== meta.execution.model ||
|
|
701
|
+
operationExecution.reasoningEffort !== meta.execution.reasoningEffort)) {
|
|
702
|
+
const nextExecution = await this.replaceExecutionSettings(sessionId, meta, operationExecution);
|
|
703
|
+
meta = { ...meta, execution: nextExecution };
|
|
704
|
+
}
|
|
452
705
|
if (consoleMeta && !consoleMeta.title) {
|
|
453
706
|
this.ports.registry.setTitle(sessionId, synthesizeSessionTitle(prepared.title));
|
|
454
707
|
}
|
|
455
708
|
const resources = this.ports.resources;
|
|
709
|
+
if (signal?.aborted) {
|
|
710
|
+
if (request.clientMessageId) {
|
|
711
|
+
await resources?.markMessageFailedNotStarted(sessionId, request.clientMessageId, "run was cancelled before injection");
|
|
712
|
+
}
|
|
713
|
+
throw abortReason(signal);
|
|
714
|
+
}
|
|
456
715
|
if (request.clientMessageId) {
|
|
457
716
|
await resources?.markMessageInjecting(sessionId, request.clientMessageId);
|
|
458
717
|
}
|
|
459
|
-
const responseId = this.ports.publishEvent ? `resp_${randomUUID()}` : undefined;
|
|
460
|
-
if (responseId) {
|
|
461
|
-
await this.ports.publishEvent(sessionId, {
|
|
462
|
-
type: "session.input.consumed",
|
|
463
|
-
item: {
|
|
464
|
-
id: newSessionItemId("message"),
|
|
465
|
-
sessionId,
|
|
466
|
-
position: 0,
|
|
467
|
-
responseId,
|
|
468
|
-
status: "completed",
|
|
469
|
-
createdAt: Date.now(),
|
|
470
|
-
type: "message",
|
|
471
|
-
data: {
|
|
472
|
-
role: "user",
|
|
473
|
-
content: prepared.input.content.map((part) => part.type === "text"
|
|
474
|
-
? { type: "input_text", text: part.text }
|
|
475
|
-
: { ...part.resource }),
|
|
476
|
-
},
|
|
477
|
-
},
|
|
478
|
-
});
|
|
479
|
-
await this.ports.publishEvent(sessionId, {
|
|
480
|
-
type: "session.status",
|
|
481
|
-
sessionId,
|
|
482
|
-
responseId,
|
|
483
|
-
status: "running",
|
|
484
|
-
statusKind: "startup",
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
const abandonResponseHandoff = responseId
|
|
488
|
-
? this.ports.runtimeState.beginResponseHandoff?.(sessionId, responseId)
|
|
489
|
-
: undefined;
|
|
490
|
-
const clearStartup = async (status) => {
|
|
491
|
-
if (!responseId)
|
|
492
|
-
return;
|
|
493
|
-
await this.ports.publishEvent(sessionId, {
|
|
494
|
-
type: "session.status",
|
|
495
|
-
sessionId,
|
|
496
|
-
responseId,
|
|
497
|
-
status,
|
|
498
|
-
});
|
|
499
|
-
};
|
|
500
718
|
let execution;
|
|
501
719
|
try {
|
|
502
720
|
execution = await this.ensureLiveSession(sessionId, meta);
|
|
503
721
|
}
|
|
504
722
|
catch (error) {
|
|
505
|
-
abandonResponseHandoff?.();
|
|
506
|
-
await clearStartup("idle");
|
|
507
723
|
if (request.clientMessageId) {
|
|
508
724
|
await resources?.markMessageFailedNotStarted(sessionId, request.clientMessageId, error instanceof Error ? error.message : String(error));
|
|
509
725
|
}
|
|
510
726
|
throw error;
|
|
511
727
|
}
|
|
512
|
-
|
|
728
|
+
if (signal?.aborted) {
|
|
729
|
+
if (request.clientMessageId) {
|
|
730
|
+
await resources?.markMessageFailedNotStarted(sessionId, request.clientMessageId, "run was cancelled before injection");
|
|
731
|
+
}
|
|
732
|
+
throw abortReason(signal);
|
|
733
|
+
}
|
|
734
|
+
let result;
|
|
513
735
|
try {
|
|
514
|
-
const
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
736
|
+
const injectionInput = needsPreparedOperation ? prepared.input : request.message;
|
|
737
|
+
result = turnOptions
|
|
738
|
+
? await execution.runner.injectMessage(sessionId, injectionInput, turnOptions)
|
|
739
|
+
: await execution.runner.injectMessage(sessionId, injectionInput);
|
|
518
740
|
}
|
|
519
741
|
catch (error) {
|
|
520
|
-
|
|
521
|
-
|
|
742
|
+
const failure = execution.runner.lastLiveSessionFailure?.(sessionId)
|
|
743
|
+
?? liveSessionFailureFrom(error);
|
|
744
|
+
const reason = failure?.message
|
|
745
|
+
?? (error instanceof Error ? error.message : String(error));
|
|
522
746
|
if (request.clientMessageId) {
|
|
523
|
-
await Promise.resolve(resources?.markMessageOutcomeUnknown(sessionId, request.clientMessageId,
|
|
747
|
+
await Promise.resolve(resources?.markMessageOutcomeUnknown(sessionId, request.clientMessageId, reason)).catch(() => undefined);
|
|
524
748
|
}
|
|
525
|
-
throw new MachineSessionServiceFailure("outcome_unknown", "live injection outcome is unknown");
|
|
749
|
+
throw new MachineSessionServiceFailure("outcome_unknown", "live injection outcome is unknown", reason, failure);
|
|
526
750
|
}
|
|
751
|
+
const outcome = result.outcome;
|
|
527
752
|
if (outcome === "failed") {
|
|
528
|
-
|
|
529
|
-
|
|
753
|
+
const failure = execution.runner.lastLiveSessionFailure?.(sessionId);
|
|
754
|
+
const reason = failure?.message
|
|
755
|
+
?? execution.runner.lastLiveSessionError?.(sessionId)
|
|
756
|
+
?? `live injection ${outcome}`;
|
|
530
757
|
if (request.clientMessageId) {
|
|
531
|
-
await resources?.markMessageOutcomeUnknown(sessionId, request.clientMessageId,
|
|
758
|
+
await resources?.markMessageOutcomeUnknown(sessionId, request.clientMessageId, reason);
|
|
532
759
|
}
|
|
533
|
-
throw new MachineSessionServiceFailure("outcome_unknown", `live injection ${outcome}
|
|
760
|
+
throw new MachineSessionServiceFailure("outcome_unknown", `live injection ${outcome}`, reason, failure);
|
|
534
761
|
}
|
|
535
|
-
if (outcome !== "injected") {
|
|
536
|
-
|
|
537
|
-
|
|
762
|
+
if (outcome !== "injected" && outcome !== "steered") {
|
|
763
|
+
const failure = execution.runner.lastLiveSessionFailure?.(sessionId);
|
|
764
|
+
const reason = failure?.message
|
|
765
|
+
?? execution.runner.lastLiveSessionError?.(sessionId)
|
|
766
|
+
?? `live injection ${outcome}`;
|
|
538
767
|
if (request.clientMessageId) {
|
|
539
|
-
await resources?.markMessageFailedNotStarted(sessionId, request.clientMessageId,
|
|
768
|
+
await resources?.markMessageFailedNotStarted(sessionId, request.clientMessageId, reason);
|
|
540
769
|
}
|
|
541
|
-
throw new MachineSessionServiceFailure("failed_precondition", `live injection ${outcome}
|
|
770
|
+
throw new MachineSessionServiceFailure("failed_precondition", `live injection ${outcome}`, reason, failure);
|
|
771
|
+
}
|
|
772
|
+
onTurnOwned?.();
|
|
773
|
+
if (signal?.aborted) {
|
|
774
|
+
await this.ports.interruption.interrupt(sessionId).catch(() => false);
|
|
775
|
+
if (request.clientMessageId) {
|
|
776
|
+
await Promise.resolve(resources?.markMessageInjected(sessionId, request.clientMessageId, result.responseId ? { responseId: result.responseId } : undefined)).catch(() => undefined);
|
|
777
|
+
}
|
|
778
|
+
throw abortReason(signal);
|
|
542
779
|
}
|
|
543
|
-
await clearStartup("running");
|
|
544
780
|
if (request.clientMessageId) {
|
|
545
781
|
try {
|
|
546
|
-
await resources?.markMessageInjected(sessionId, request.clientMessageId);
|
|
782
|
+
await resources?.markMessageInjected(sessionId, request.clientMessageId, result.responseId ? { responseId: result.responseId } : undefined);
|
|
547
783
|
}
|
|
548
784
|
catch {
|
|
549
785
|
await Promise.resolve(resources?.markMessageOutcomeUnknown(sessionId, request.clientMessageId, "message state could not be persisted after injection")).catch(() => undefined);
|
|
550
786
|
throw new MachineSessionServiceFailure("outcome_unknown", "message was injected but its delivery state could not be persisted");
|
|
551
787
|
}
|
|
552
788
|
}
|
|
553
|
-
return {
|
|
789
|
+
return {
|
|
790
|
+
ok: true,
|
|
791
|
+
injected: true,
|
|
792
|
+
...(includeResponseId && result.responseId ? { responseId: result.responseId } : {}),
|
|
793
|
+
...(operationExecution ? { operationExecution } : {}),
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
async withSessionMutation(sessionId, action) {
|
|
797
|
+
const previous = this.sessionMutationTails.get(sessionId);
|
|
798
|
+
let release;
|
|
799
|
+
const tail = new Promise((resolve) => {
|
|
800
|
+
release = resolve;
|
|
801
|
+
});
|
|
802
|
+
this.sessionMutationTails.set(sessionId, tail);
|
|
803
|
+
if (previous)
|
|
804
|
+
await previous;
|
|
805
|
+
try {
|
|
806
|
+
return await action();
|
|
807
|
+
}
|
|
808
|
+
finally {
|
|
809
|
+
release();
|
|
810
|
+
if (this.sessionMutationTails.get(sessionId) === tail) {
|
|
811
|
+
this.sessionMutationTails.delete(sessionId);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
554
814
|
}
|
|
555
815
|
resourcePolicy(sessionIdInput) {
|
|
556
816
|
const sessionId = this.requireResourceSession(sessionIdInput);
|
|
@@ -580,6 +840,62 @@ export class MachineSessionService {
|
|
|
580
840
|
const sessionId = this.requireResourceSession(input.sessionId);
|
|
581
841
|
return this.requireResources().deleteResource({ ...input, sessionId });
|
|
582
842
|
}
|
|
843
|
+
async resolveResourcePath(sessionIdInput, resourceId) {
|
|
844
|
+
const sessionId = this.requireResourceSession(sessionIdInput);
|
|
845
|
+
const resolve = this.requireResources().resolveCommittedLocalPath;
|
|
846
|
+
if (!resolve) {
|
|
847
|
+
throw new MachineSessionServiceFailure("failed_precondition", "Session resource paths are unavailable");
|
|
848
|
+
}
|
|
849
|
+
return resolve.call(this.requireResources(), sessionId, resourceId);
|
|
850
|
+
}
|
|
851
|
+
async getFile(input) {
|
|
852
|
+
const resolved = await this.resolveSessionItemFile(input);
|
|
853
|
+
return { file: resolved.metadata };
|
|
854
|
+
}
|
|
855
|
+
async readFile(input) {
|
|
856
|
+
const resolved = await this.resolveSessionItemFile(input);
|
|
857
|
+
return this.readResolvedFile(resolved, input);
|
|
858
|
+
}
|
|
859
|
+
async getWorkspaceFile(input) {
|
|
860
|
+
const resolved = await this.resolveSessionWorkspaceFile(input);
|
|
861
|
+
return { file: resolved.metadata };
|
|
862
|
+
}
|
|
863
|
+
async readWorkspaceFile(input) {
|
|
864
|
+
const resolved = await this.resolveSessionWorkspaceFile(input);
|
|
865
|
+
return this.readResolvedFile(resolved, input);
|
|
866
|
+
}
|
|
867
|
+
async readResolvedFile(resolved, input) {
|
|
868
|
+
if (resolved.metadata.version !== input.version) {
|
|
869
|
+
throw new MachineSessionServiceFailure("conflict", "Session file changed while it was being read");
|
|
870
|
+
}
|
|
871
|
+
if (input.offset >= resolved.metadata.byteLength) {
|
|
872
|
+
return { data: "", offset: input.offset, eof: true };
|
|
873
|
+
}
|
|
874
|
+
const length = Math.min(input.length, resolved.metadata.byteLength - input.offset);
|
|
875
|
+
const file = await open(resolved.path, "r");
|
|
876
|
+
try {
|
|
877
|
+
const openedStat = await file.stat();
|
|
878
|
+
if (!openedStat.isFile() ||
|
|
879
|
+
sessionFileVersion(resolved.path, openedStat) !== resolved.metadata.version) {
|
|
880
|
+
throw new MachineSessionServiceFailure("conflict", "Session file changed while it was being read");
|
|
881
|
+
}
|
|
882
|
+
const buffer = Buffer.allocUnsafe(length);
|
|
883
|
+
const { bytesRead } = await file.read(buffer, 0, length, input.offset);
|
|
884
|
+
const completedStat = await file.stat();
|
|
885
|
+
if (sessionFileVersion(resolved.path, completedStat) !== resolved.metadata.version) {
|
|
886
|
+
throw new MachineSessionServiceFailure("conflict", "Session file changed while it was being read");
|
|
887
|
+
}
|
|
888
|
+
const nextOffset = input.offset + bytesRead;
|
|
889
|
+
return {
|
|
890
|
+
data: buffer.subarray(0, bytesRead).toString("base64"),
|
|
891
|
+
offset: nextOffset,
|
|
892
|
+
eof: nextOffset >= resolved.metadata.byteLength,
|
|
893
|
+
};
|
|
894
|
+
}
|
|
895
|
+
finally {
|
|
896
|
+
await file.close();
|
|
897
|
+
}
|
|
898
|
+
}
|
|
583
899
|
/** Persist the first task while login/onboarding owns the Provider TUI. The
|
|
584
900
|
* delivery worker starts the pane now, waits for a real native thread, then
|
|
585
901
|
* injects exactly once. `failed` is fenced as outcome_unknown and never retried. */
|
|
@@ -627,7 +943,8 @@ export class MachineSessionService {
|
|
|
627
943
|
request.execution.runner.ensureLiveSession.bind(request.execution.runner);
|
|
628
944
|
const started = await start(sessionId, request.options);
|
|
629
945
|
if (!started) {
|
|
630
|
-
|
|
946
|
+
const failure = request.execution.runner.lastLiveSessionFailure?.(sessionId);
|
|
947
|
+
throw new MachineSessionServiceFailure("failed_precondition", `Provider terminal unavailable (${request.liveRuntime})`, failure?.message ?? request.execution.runner.lastLiveSessionError?.(sessionId), failure);
|
|
631
948
|
}
|
|
632
949
|
return { ok: true };
|
|
633
950
|
}
|
|
@@ -635,7 +952,8 @@ export class MachineSessionService {
|
|
|
635
952
|
const request = await this.liveSessionRequest(sessionId, meta);
|
|
636
953
|
const live = await request.execution.runner.ensureLiveSession(sessionId, request.options);
|
|
637
954
|
if (!live) {
|
|
638
|
-
|
|
955
|
+
const failure = request.execution.runner.lastLiveSessionFailure?.(sessionId);
|
|
956
|
+
throw new MachineSessionServiceFailure("failed_precondition", `live session unavailable (${request.liveRuntime})`, failure?.message ?? request.execution.runner.lastLiveSessionError?.(sessionId), failure);
|
|
639
957
|
}
|
|
640
958
|
return request.execution;
|
|
641
959
|
}
|
|
@@ -682,6 +1000,101 @@ export class MachineSessionService {
|
|
|
682
1000
|
}
|
|
683
1001
|
return { ok: true };
|
|
684
1002
|
}
|
|
1003
|
+
async resolveSessionItemFile(input) {
|
|
1004
|
+
const sessionId = this.requireResourceSession(input.sessionId);
|
|
1005
|
+
const item = await this.ports.log.get(sessionId, input.itemId);
|
|
1006
|
+
if (!item) {
|
|
1007
|
+
throw new MachineSessionServiceFailure("not_found", "Session item was not found");
|
|
1008
|
+
}
|
|
1009
|
+
let reference;
|
|
1010
|
+
let type;
|
|
1011
|
+
if (item.type === "message" && item.data.role === "user") {
|
|
1012
|
+
const part = item.data.content[input.partIndex];
|
|
1013
|
+
if (!part || (part.type !== "input_image" && part.type !== "input_file")) {
|
|
1014
|
+
throw new MachineSessionServiceFailure("not_found", "Session item file was not found");
|
|
1015
|
+
}
|
|
1016
|
+
reference = part;
|
|
1017
|
+
type = part.type;
|
|
1018
|
+
}
|
|
1019
|
+
else if (item.type === "function_call_output" && input.partIndex === 0) {
|
|
1020
|
+
if (!item.data.generatedImage) {
|
|
1021
|
+
throw new MachineSessionServiceFailure("not_found", "Session item file was not found");
|
|
1022
|
+
}
|
|
1023
|
+
reference = item.data.generatedImage;
|
|
1024
|
+
type = "generated_image";
|
|
1025
|
+
}
|
|
1026
|
+
else {
|
|
1027
|
+
throw new MachineSessionServiceFailure("not_found", "Session item file was not found");
|
|
1028
|
+
}
|
|
1029
|
+
if (!("path" in reference) || !reference.path || !isAbsolute(reference.path)) {
|
|
1030
|
+
throw new MachineSessionServiceFailure("not_found", "Session item is not path-backed");
|
|
1031
|
+
}
|
|
1032
|
+
try {
|
|
1033
|
+
const canonicalPath = await realpath(reference.path);
|
|
1034
|
+
const fileStat = await stat(canonicalPath);
|
|
1035
|
+
if (!fileStat.isFile() || fileStat.size < 1) {
|
|
1036
|
+
throw new MachineSessionServiceFailure("not_found", "Session item path is not a file");
|
|
1037
|
+
}
|
|
1038
|
+
const modifiedAt = Math.max(0, Math.trunc(fileStat.mtimeMs));
|
|
1039
|
+
const version = sessionFileVersion(canonicalPath, fileStat);
|
|
1040
|
+
return {
|
|
1041
|
+
path: canonicalPath,
|
|
1042
|
+
metadata: {
|
|
1043
|
+
itemId: item.id,
|
|
1044
|
+
partIndex: input.partIndex,
|
|
1045
|
+
type,
|
|
1046
|
+
filename: reference.filename || basename(canonicalPath),
|
|
1047
|
+
mediaType: reference.mediaType,
|
|
1048
|
+
byteLength: fileStat.size,
|
|
1049
|
+
modifiedAt,
|
|
1050
|
+
version,
|
|
1051
|
+
},
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
catch (error) {
|
|
1055
|
+
if (error instanceof MachineSessionServiceFailure)
|
|
1056
|
+
throw error;
|
|
1057
|
+
throw new MachineSessionServiceFailure("not_found", "Session item file is unavailable", error instanceof Error ? error.message : String(error));
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
async resolveSessionWorkspaceFile(input) {
|
|
1061
|
+
const sessionId = this.requireResourceSession(input.sessionId);
|
|
1062
|
+
const session = this.ports.registry.get(sessionId);
|
|
1063
|
+
try {
|
|
1064
|
+
const workspaceRoot = await realpath(session.workspace.cwd);
|
|
1065
|
+
const requestedPath = isAbsolute(input.path)
|
|
1066
|
+
? input.path
|
|
1067
|
+
: resolve(workspaceRoot, input.path);
|
|
1068
|
+
const canonicalPath = await realpath(requestedPath);
|
|
1069
|
+
const workspaceRelative = relative(workspaceRoot, canonicalPath);
|
|
1070
|
+
if (!workspaceRelative ||
|
|
1071
|
+
workspaceRelative === ".." ||
|
|
1072
|
+
workspaceRelative.startsWith(`..${sep}`) ||
|
|
1073
|
+
isAbsolute(workspaceRelative)) {
|
|
1074
|
+
throw new MachineSessionServiceFailure("not_found", "Session workspace file was not found");
|
|
1075
|
+
}
|
|
1076
|
+
const fileStat = await stat(canonicalPath);
|
|
1077
|
+
if (!fileStat.isFile()) {
|
|
1078
|
+
throw new MachineSessionServiceFailure("not_found", "Session workspace path is not a file");
|
|
1079
|
+
}
|
|
1080
|
+
return {
|
|
1081
|
+
path: canonicalPath,
|
|
1082
|
+
metadata: {
|
|
1083
|
+
path: input.path,
|
|
1084
|
+
filename: basename(canonicalPath),
|
|
1085
|
+
mediaType: workspaceFileMediaType(canonicalPath),
|
|
1086
|
+
byteLength: fileStat.size,
|
|
1087
|
+
modifiedAt: Math.max(0, Math.trunc(fileStat.mtimeMs)),
|
|
1088
|
+
version: sessionFileVersion(canonicalPath, fileStat),
|
|
1089
|
+
},
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
catch (error) {
|
|
1093
|
+
if (error instanceof MachineSessionServiceFailure)
|
|
1094
|
+
throw error;
|
|
1095
|
+
throw new MachineSessionServiceFailure("not_found", "Session workspace file is unavailable", error instanceof Error ? error.message : String(error));
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
685
1098
|
requireAgents() {
|
|
686
1099
|
if (!this.ports.agents) {
|
|
687
1100
|
throw new MachineSessionServiceFailure("failed_precondition", "session agent options are unavailable");
|
|
@@ -770,8 +1183,8 @@ export class MachineSessionService {
|
|
|
770
1183
|
current.message !== pending.message)
|
|
771
1184
|
return;
|
|
772
1185
|
injectionAttempted = true;
|
|
773
|
-
const outcome = await execution.runner.injectMessage(sessionId, pending.message);
|
|
774
|
-
if (outcome === "injected") {
|
|
1186
|
+
const { outcome } = await execution.runner.injectMessage(sessionId, pending.message);
|
|
1187
|
+
if (outcome === "injected" || outcome === "steered") {
|
|
775
1188
|
await Promise.resolve(pendingStore.delete(sessionId)).catch(async () => {
|
|
776
1189
|
await Promise.resolve(pendingStore.markOutcomeUnknown(sessionId)).catch(() => undefined);
|
|
777
1190
|
});
|
|
@@ -997,6 +1410,14 @@ function sessionSummary(id, meta, log, runtimeState, pendingState) {
|
|
|
997
1410
|
updatedAt: validTimestamp(updatedAt, "updatedAt"),
|
|
998
1411
|
};
|
|
999
1412
|
}
|
|
1413
|
+
function executionSettingsResult(execution) {
|
|
1414
|
+
return {
|
|
1415
|
+
provider: execution.provider,
|
|
1416
|
+
model: execution.model,
|
|
1417
|
+
reasoningEffort: execution.reasoningEffort,
|
|
1418
|
+
collaborationMode: execution.collaborationMode ?? null,
|
|
1419
|
+
};
|
|
1420
|
+
}
|
|
1000
1421
|
function compareMetaRecency(left, right) {
|
|
1001
1422
|
const leftTime = validTimestamp(left.updatedAt ?? left.createdAt, "updatedAt");
|
|
1002
1423
|
const rightTime = validTimestamp(right.updatedAt ?? right.createdAt, "updatedAt");
|
|
@@ -1066,6 +1487,9 @@ function cancellableWatch(sessionId, iterator, signal) {
|
|
|
1066
1487
|
function cloneRuntimeSnapshot(snapshot) {
|
|
1067
1488
|
return {
|
|
1068
1489
|
status: snapshot.status,
|
|
1490
|
+
...(snapshot.backgroundTaskCount === undefined
|
|
1491
|
+
? {}
|
|
1492
|
+
: { backgroundTaskCount: snapshot.backgroundTaskCount }),
|
|
1069
1493
|
activeResponseIds: [...snapshot.activeResponseIds],
|
|
1070
1494
|
pendingInteractions: snapshot.pendingInteractions.map((pending) => ({
|
|
1071
1495
|
responseId: pending.responseId,
|
|
@@ -1073,6 +1497,115 @@ function cloneRuntimeSnapshot(snapshot) {
|
|
|
1073
1497
|
})),
|
|
1074
1498
|
};
|
|
1075
1499
|
}
|
|
1500
|
+
function sessionEventResponseId(event) {
|
|
1501
|
+
if ("responseId" in event && typeof event.responseId === "string")
|
|
1502
|
+
return event.responseId;
|
|
1503
|
+
if ("item" in event && event.item && typeof event.item.responseId === "string") {
|
|
1504
|
+
return event.item.responseId;
|
|
1505
|
+
}
|
|
1506
|
+
return undefined;
|
|
1507
|
+
}
|
|
1508
|
+
function sessionEventItemId(event) {
|
|
1509
|
+
return "item" in event && event.item && typeof event.item.id === "string"
|
|
1510
|
+
? event.item.id
|
|
1511
|
+
: undefined;
|
|
1512
|
+
}
|
|
1513
|
+
function replaySessionItem(item) {
|
|
1514
|
+
if (item.type === "message" && item.data.role === "user") {
|
|
1515
|
+
return { type: "session.input.consumed", item };
|
|
1516
|
+
}
|
|
1517
|
+
if (item.type === "interaction_request") {
|
|
1518
|
+
return {
|
|
1519
|
+
type: "session.interaction.requested",
|
|
1520
|
+
sessionId: item.sessionId,
|
|
1521
|
+
responseId: item.responseId,
|
|
1522
|
+
interaction: item.data.interaction,
|
|
1523
|
+
item,
|
|
1524
|
+
};
|
|
1525
|
+
}
|
|
1526
|
+
if (item.type === "interaction_resolution" &&
|
|
1527
|
+
item.data.status === "resolved" &&
|
|
1528
|
+
item.data.resolution) {
|
|
1529
|
+
return {
|
|
1530
|
+
type: "session.interaction.resolved",
|
|
1531
|
+
sessionId: item.sessionId,
|
|
1532
|
+
responseId: item.responseId,
|
|
1533
|
+
interactionId: item.data.interactionId,
|
|
1534
|
+
resolution: item.data.resolution,
|
|
1535
|
+
item,
|
|
1536
|
+
};
|
|
1537
|
+
}
|
|
1538
|
+
if (item.type === "interaction_resolution" &&
|
|
1539
|
+
(item.data.status === "cancelled" || item.data.status === "expired")) {
|
|
1540
|
+
const reason = item.data.reason ?? (item.data.status === "expired" ? "expired" : undefined);
|
|
1541
|
+
return {
|
|
1542
|
+
type: "session.interaction.cancelled",
|
|
1543
|
+
sessionId: item.sessionId,
|
|
1544
|
+
responseId: item.responseId,
|
|
1545
|
+
interactionId: item.data.interactionId,
|
|
1546
|
+
...(reason ? { reason } : {}),
|
|
1547
|
+
item,
|
|
1548
|
+
};
|
|
1549
|
+
}
|
|
1550
|
+
return { type: "response.output_item.done", responseId: item.responseId, item };
|
|
1551
|
+
}
|
|
1552
|
+
function normalizeRunExecutionSelection(value) {
|
|
1553
|
+
if (value === undefined)
|
|
1554
|
+
return undefined;
|
|
1555
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
1556
|
+
throw new MachineSessionServiceInputError("execution must be an object");
|
|
1557
|
+
}
|
|
1558
|
+
if (Object.keys(value).some((key) => key !== "model" && key !== "reasoningEffort")) {
|
|
1559
|
+
throw new MachineSessionServiceInputError("execution has unknown fields");
|
|
1560
|
+
}
|
|
1561
|
+
const selection = {};
|
|
1562
|
+
if (Object.prototype.hasOwnProperty.call(value, "model")) {
|
|
1563
|
+
selection.model = value.model === null
|
|
1564
|
+
? null
|
|
1565
|
+
: validRequiredText(value.model, "execution.model");
|
|
1566
|
+
}
|
|
1567
|
+
if (Object.prototype.hasOwnProperty.call(value, "reasoningEffort")) {
|
|
1568
|
+
selection.reasoningEffort = value.reasoningEffort === null
|
|
1569
|
+
? null
|
|
1570
|
+
: validRequiredText(value.reasoningEffort, "execution.reasoningEffort");
|
|
1571
|
+
}
|
|
1572
|
+
return selection;
|
|
1573
|
+
}
|
|
1574
|
+
function abortReason(signal) {
|
|
1575
|
+
if (signal.reason instanceof Error)
|
|
1576
|
+
return signal.reason;
|
|
1577
|
+
const error = new Error("run was cancelled");
|
|
1578
|
+
error.name = "AbortError";
|
|
1579
|
+
return error;
|
|
1580
|
+
}
|
|
1581
|
+
function liveSessionFailureFrom(error) {
|
|
1582
|
+
if (!error || typeof error !== "object")
|
|
1583
|
+
return undefined;
|
|
1584
|
+
const candidate = error;
|
|
1585
|
+
if (typeof candidate.message !== "string" ||
|
|
1586
|
+
typeof candidate.code !== "string" ||
|
|
1587
|
+
typeof candidate.statusCode !== "number")
|
|
1588
|
+
return undefined;
|
|
1589
|
+
return {
|
|
1590
|
+
message: candidate.message,
|
|
1591
|
+
code: candidate.code,
|
|
1592
|
+
statusCode: candidate.statusCode,
|
|
1593
|
+
};
|
|
1594
|
+
}
|
|
1595
|
+
/** Turn structured native mode failures into actionable, Provider-specific
|
|
1596
|
+
* messages before the Direct Runtime adapter crosses the process boundary.
|
|
1597
|
+
* Unstructured failures keep their original text and remain subject to the
|
|
1598
|
+
* adapter's normal redaction policy. */
|
|
1599
|
+
function collaborationModeFailureMessage(provider, failure, fallback) {
|
|
1600
|
+
const providerLabel = provider === "traex" ? "TraeX" : "Codex";
|
|
1601
|
+
if (failure?.code === "native_session_not_live") {
|
|
1602
|
+
return `No live ${providerLabel} runner is available. Reconnect this Session and try again.`;
|
|
1603
|
+
}
|
|
1604
|
+
if (failure?.code === "native_thread_not_ready") {
|
|
1605
|
+
return `${providerLabel} is still loading its native thread. Reconnect this Session and try again.`;
|
|
1606
|
+
}
|
|
1607
|
+
return failure?.message ?? fallback;
|
|
1608
|
+
}
|
|
1076
1609
|
function requestLimit(value, fallback, maximum, field) {
|
|
1077
1610
|
return value === undefined ? Math.min(fallback, maximum) : boundedInteger(value, 1, maximum, field);
|
|
1078
1611
|
}
|
|
@@ -1091,6 +1624,15 @@ function validOpaqueToken(value, field, maximum) {
|
|
|
1091
1624
|
}
|
|
1092
1625
|
return value;
|
|
1093
1626
|
}
|
|
1627
|
+
function validRequiredText(value, field) {
|
|
1628
|
+
if (typeof value !== "string" || value.trim().length === 0 || value.length > 512) {
|
|
1629
|
+
throw new MachineSessionServiceInputError(`${field} must be a non-empty string of at most 512 characters`);
|
|
1630
|
+
}
|
|
1631
|
+
if (/[\u0000-\u001f\u007f]/.test(value)) {
|
|
1632
|
+
throw new MachineSessionServiceInputError(`${field} contains invalid control characters`);
|
|
1633
|
+
}
|
|
1634
|
+
return value.trim();
|
|
1635
|
+
}
|
|
1094
1636
|
function validTimestamp(value, field) {
|
|
1095
1637
|
if (typeof value !== "string" || !Number.isFinite(Date.parse(value))) {
|
|
1096
1638
|
throw new MachineSessionServiceInputError(`${field} must be a valid timestamp`);
|
|
@@ -1103,6 +1645,54 @@ function timestampFromEpoch(value, field) {
|
|
|
1103
1645
|
}
|
|
1104
1646
|
return new Date(value).toISOString();
|
|
1105
1647
|
}
|
|
1648
|
+
function sessionFileVersion(path, fileStat) {
|
|
1649
|
+
return createHash("sha256")
|
|
1650
|
+
.update(`${path}\0${fileStat.dev}\0${fileStat.ino}\0${fileStat.size}\0${fileStat.mtimeMs}\0${fileStat.ctimeMs}`)
|
|
1651
|
+
.digest("hex");
|
|
1652
|
+
}
|
|
1653
|
+
function workspaceFileMediaType(path) {
|
|
1654
|
+
switch (extname(path).toLowerCase()) {
|
|
1655
|
+
case ".png": return "image/png";
|
|
1656
|
+
case ".jpg":
|
|
1657
|
+
case ".jpeg": return "image/jpeg";
|
|
1658
|
+
case ".webp": return "image/webp";
|
|
1659
|
+
case ".gif": return "image/gif";
|
|
1660
|
+
case ".svg": return "image/svg+xml";
|
|
1661
|
+
case ".pdf": return "application/pdf";
|
|
1662
|
+
case ".json": return "application/json";
|
|
1663
|
+
case ".html":
|
|
1664
|
+
case ".htm": return "text/html";
|
|
1665
|
+
case ".css": return "text/css";
|
|
1666
|
+
case ".js":
|
|
1667
|
+
case ".mjs":
|
|
1668
|
+
case ".cjs": return "text/javascript";
|
|
1669
|
+
case ".md":
|
|
1670
|
+
case ".mdx": return "text/markdown";
|
|
1671
|
+
case ".csv": return "text/csv";
|
|
1672
|
+
case ".tsv": return "text/tab-separated-values";
|
|
1673
|
+
case ".txt":
|
|
1674
|
+
case ".log":
|
|
1675
|
+
case ".ts":
|
|
1676
|
+
case ".tsx":
|
|
1677
|
+
case ".jsx":
|
|
1678
|
+
case ".py":
|
|
1679
|
+
case ".go":
|
|
1680
|
+
case ".rs":
|
|
1681
|
+
case ".java":
|
|
1682
|
+
case ".c":
|
|
1683
|
+
case ".cc":
|
|
1684
|
+
case ".cpp":
|
|
1685
|
+
case ".h":
|
|
1686
|
+
case ".hpp":
|
|
1687
|
+
case ".sh":
|
|
1688
|
+
case ".zsh":
|
|
1689
|
+
case ".bash":
|
|
1690
|
+
case ".yaml":
|
|
1691
|
+
case ".yml":
|
|
1692
|
+
case ".toml": return "text/plain";
|
|
1693
|
+
default: return "application/octet-stream";
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1106
1696
|
function jsonByteLength(value) {
|
|
1107
1697
|
return Buffer.byteLength(JSON.stringify(value), "utf8");
|
|
1108
1698
|
}
|