@ai-projector/ide 0.0.0-stage → 0.11.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/LICENSE +21 -0
- package/README.md +35 -2
- package/bin/install-desktop +17 -0
- package/bin/install-desktop.cmd +11 -0
- package/bin/projector +22 -0
- package/bin/projector.cmd +11 -0
- package/dist/assets/CodeViewer-BAgvP3Yx.js +1 -0
- package/dist/assets/CodeViewer-QIU6uQDH.css +1 -0
- package/dist/assets/DiscussionView-83kZBzfq.js +2 -0
- package/dist/assets/DiscussionView-kEJZ0OhC.css +1 -0
- package/dist/assets/EditorSettings-CPklwfT-.js +13 -0
- package/dist/assets/EditorSettings-DVhn0sGg.css +1 -0
- package/dist/assets/HtmlViewer-C3Mf1IEK.css +1 -0
- package/dist/assets/HtmlViewer-CGHhO9bM.js +2 -0
- package/dist/assets/ImageViewport-BXN_-Ztv.css +1 -0
- package/dist/assets/ImageViewport-lPITcKgO.js +1 -0
- package/dist/assets/IssueView-CfdeTTKs.js +1 -0
- package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/assets/MarkdownViewer-3VG5ygRT.css +1 -0
- package/dist/assets/MarkdownViewer-DKZvt6XG.js +2 -0
- package/dist/assets/PullRequestView-Bce3nQML.js +3 -0
- package/dist/assets/PullRequestView-F_M37BOq.css +1 -0
- package/dist/assets/ReleaseView-BKH8Kb3T.css +1 -0
- package/dist/assets/ReleaseView-DO-R7ktE.js +2 -0
- package/dist/assets/SplitPanes-BJR26w00.css +1 -0
- package/dist/assets/SplitPanes-DR126xV8.js +1 -0
- package/dist/assets/SvgViewer-CEIl2Ob2.js +2 -0
- package/dist/assets/SvgViewer-DyAp20sd.css +1 -0
- package/dist/assets/TerminalView-CDAJ5gmT.js +16 -0
- package/dist/assets/TerminalView-DnkOpsvR.css +1 -0
- package/dist/assets/TrackerDetail-CV0Qqzx3.js +1 -0
- package/dist/assets/TrackerDetail-OFp4ONUm.css +1 -0
- package/dist/assets/UiPanel-CND7Qs_n.js +1 -0
- package/dist/assets/UiPanel-CS77nWcC.css +1 -0
- package/dist/assets/UiViewerPage-BOvnLith.css +1 -0
- package/dist/assets/UiViewerPage-z_s1uFHO.js +2 -0
- package/dist/assets/VisualMarkdownEditor-CcbKSvtd.css +1 -0
- package/dist/assets/VisualMarkdownEditor-CwwWF0eb.js +1069 -0
- package/dist/assets/_plugin-vue_export-helper-C4wFX7Eq.js +24 -0
- package/dist/assets/apl-gfMMiTNf.js +1 -0
- package/dist/assets/asciiarmor-C_eisQCp.js +1 -0
- package/dist/assets/asn1-DCl_8MCW.js +1 -0
- package/dist/assets/asterisk-BEn0Cwpx.js +1 -0
- package/dist/assets/brainfuck-D5EjA2JK.js +1 -0
- package/dist/assets/clike-xvONpD0Z.js +1 -0
- package/dist/assets/clojure-BflJGmDX.js +1 -0
- package/dist/assets/cmake-84nbDH0I.js +1 -0
- package/dist/assets/cobol-DHLQUbN7.js +1 -0
- package/dist/assets/coffeescript-De_zI4J0.js +1 -0
- package/dist/assets/commonlisp-DgAKBe0r.js +1 -0
- package/dist/assets/compiler-dom.esm-bundler-B0iuTsih.js +9 -0
- package/dist/assets/crystal-Bl6YKCG_.js +1 -0
- package/dist/assets/css-CnaYoQib.js +1 -0
- package/dist/assets/cypher-p9eYesGn.js +1 -0
- package/dist/assets/d-DWkQyNnU.js +1 -0
- package/dist/assets/diff-ChtP43wD.js +1 -0
- package/dist/assets/dist-23D313r2.js +13 -0
- package/dist/assets/dist-9YLT-RM-.js +11 -0
- package/dist/assets/dist-9guQ6tUS.js +1 -0
- package/dist/assets/dist-B1XyTjRF.js +1 -0
- package/dist/assets/dist-BA_HKdx1.js +2 -0
- package/dist/assets/dist-BVEl6uFx.js +1 -0
- package/dist/assets/dist-B_hKnsNE.js +1 -0
- package/dist/assets/dist-BnsBZm0f.js +1 -0
- package/dist/assets/dist-Br4AY_oy.js +1 -0
- package/dist/assets/dist-BuiJgwGF.js +9 -0
- package/dist/assets/dist-C-1XYtJO.js +1 -0
- package/dist/assets/dist-C1mn-4rn.js +1 -0
- package/dist/assets/dist-CRLdLpSX.js +2 -0
- package/dist/assets/dist-CpgyHBvu.js +1 -0
- package/dist/assets/dist-CrRIwgTS.js +1 -0
- package/dist/assets/dist-CxoUUhWx.js +1 -0
- package/dist/assets/dist-CyRvGpIP.js +1 -0
- package/dist/assets/dist-Dqsd8MyB.js +1 -0
- package/dist/assets/dist-DrZek4TY.js +1 -0
- package/dist/assets/dist-DzAS050M.js +23 -0
- package/dist/assets/dist-NMUsQt1c.js +1 -0
- package/dist/assets/dist-b78ZWHZy.js +1 -0
- package/dist/assets/dist-dwBOnDaY.js +2 -0
- package/dist/assets/dist-gPzXCSJV.js +6 -0
- package/dist/assets/dist-p1Xy77w3.js +1 -0
- package/dist/assets/dist-tNJpR9Y1.js +1 -0
- package/dist/assets/dockerfile-DJkHQgkl.js +1 -0
- package/dist/assets/dtd-DTF72YNO.js +1 -0
- package/dist/assets/dylan-S7ucR4pR.js +1 -0
- package/dist/assets/ebnf-D4c0_ac3.js +1 -0
- package/dist/assets/ecl-BVIeWmwY.js +1 -0
- package/dist/assets/editor-theme-DuQQ8n56.js +1 -0
- package/dist/assets/eiffel-BEjRio4Q.js +1 -0
- package/dist/assets/elm-Cshzl8qu.js +1 -0
- package/dist/assets/erlang-BV0c4Hdn.js +1 -0
- package/dist/assets/events.worker-C2Opu9Sc.js +1 -0
- package/dist/assets/external-link-BFTqPI03.js +1 -0
- package/dist/assets/factor-LKH5gN8L.js +1 -0
- package/dist/assets/fcl-ClOhbFR7.js +1 -0
- package/dist/assets/forth-D6RzAl64.js +1 -0
- package/dist/assets/fortran-Bt6PBEDR.js +1 -0
- package/dist/assets/gas-BHEdbvp9.js +1 -0
- package/dist/assets/gherkin-oBAE_ms0.js +1 -0
- package/dist/assets/github-emoji-C2UmmDoA.js +169 -0
- package/dist/assets/github-emoji-qJihbtN6.css +1 -0
- package/dist/assets/groovy-CUrWKPia.js +1 -0
- package/dist/assets/haskell-BRsoo5mP.js +1 -0
- package/dist/assets/haxe-DjVOVvNP.js +1 -0
- package/dist/assets/http-CLVgA2GD.js +1 -0
- package/dist/assets/hub-rvbmNftk.js +1 -0
- package/dist/assets/idl-BUZw3wgd.js +1 -0
- package/dist/assets/javascript-lS2r2ifg.js +1 -0
- package/dist/assets/julia-CQfgDRfP.js +1 -0
- package/dist/assets/livescript-BXxG0Yva.js +1 -0
- package/dist/assets/lua-DPCEkfD_.js +1 -0
- package/dist/assets/main-CgMl4Qjs.css +1 -0
- package/dist/assets/main-DEEGhxlk.js +186 -0
- package/dist/assets/mathematica-u8YMmbU0.js +1 -0
- package/dist/assets/mbox-BEMVcqjs.js +1 -0
- package/dist/assets/mirc-C9zpzAZU.js +1 -0
- package/dist/assets/mllike-B45xgp2S.js +1 -0
- package/dist/assets/modelica-CqHI_q-D.js +1 -0
- package/dist/assets/mscgen-qgSLujhx.js +1 -0
- package/dist/assets/mumps-BSzj6Xyz.js +1 -0
- package/dist/assets/nginx-C-ORUuei.js +1 -0
- package/dist/assets/nsis-viPvXFiq.js +1 -0
- package/dist/assets/ntriples-CzMBulkp.js +1 -0
- package/dist/assets/octave-D2Q8cUp1.js +1 -0
- package/dist/assets/oz-BwTct_5T.js +1 -0
- package/dist/assets/pascal-Dp_KdFgX.js +1 -0
- package/dist/assets/perl-BkSkiI9m.js +1 -0
- package/dist/assets/pig-AF4Hwhju.js +1 -0
- package/dist/assets/powershell-D8WpQPaX.js +1 -0
- package/dist/assets/preload-helper-BLdHbfdN.js +1 -0
- package/dist/assets/properties-C357ku5U.js +1 -0
- package/dist/assets/protobuf-D1ij_kNL.js +1 -0
- package/dist/assets/pug-BqCHZ5xT.js +1 -0
- package/dist/assets/puppet-BZyAS7I4.js +1 -0
- package/dist/assets/python-B_1Jd8HM.js +1 -0
- package/dist/assets/q-B9NhS7L_.js +1 -0
- package/dist/assets/r-CxDmU1I4.js +1 -0
- package/dist/assets/rpm-gpDK5sbt.js +1 -0
- package/dist/assets/ruby-ChfNwlCY.js +1 -0
- package/dist/assets/sas-C2OyD2Y6.js +1 -0
- package/dist/assets/scheme-D9qYN0V5.js +1 -0
- package/dist/assets/shared.esm-bundler-EUzHGNqQ.js +2 -0
- package/dist/assets/shared.worker-DpKROrNH.js +1 -0
- package/dist/assets/shell-DwuoZtxw.js +1 -0
- package/dist/assets/sieve-tLWDfEkZ.js +1 -0
- package/dist/assets/simple-mode-DXiLM1-G.js +1 -0
- package/dist/assets/smalltalk-BLp5-jwC.js +1 -0
- package/dist/assets/solr-B78wSQJQ.js +1 -0
- package/dist/assets/sparql-Dz-mlCAC.js +1 -0
- package/dist/assets/spreadsheet-CTIncYxj.js +1 -0
- package/dist/assets/sql-DuQMFDvy.js +1 -0
- package/dist/assets/stex-DNzd62Q_.js +1 -0
- package/dist/assets/styles-C07CLvbW.js +2 -0
- package/dist/assets/styles-CX3Ni7dk.css +1 -0
- package/dist/assets/stylus-BOVgKnng.js +1 -0
- package/dist/assets/swift-DKB6_1j6.js +1 -0
- package/dist/assets/tcl-BGfruO1u.js +1 -0
- package/dist/assets/textile-C4jVoHG1.js +1 -0
- package/dist/assets/tiddlywiki-VlUiK86J.js +1 -0
- package/dist/assets/tiki-CvUEFusT.js +1 -0
- package/dist/assets/toml-BPTmHmyx.js +1 -0
- package/dist/assets/troff-C2dAgh7P.js +1 -0
- package/dist/assets/ttcn-PPSTk1ow.js +1 -0
- package/dist/assets/ttcn-cfg-2b4Gb5sE.js +1 -0
- package/dist/assets/turtle-Cx3rYX2g.js +1 -0
- package/dist/assets/vb-BthdM_4N.js +1 -0
- package/dist/assets/vbscript-D9f6rSsU.js +1 -0
- package/dist/assets/velocity-CqftRsjg.js +1 -0
- package/dist/assets/verilog-CjI9Y6RI.js +1 -0
- package/dist/assets/vhdl-kS471soi.js +1 -0
- package/dist/assets/webidl-D5jiJvOU.js +1 -0
- package/dist/assets/xquery-BKJx4mf9.js +1 -0
- package/dist/assets/yacas-CXXgtw0p.js +1 -0
- package/dist/assets/z80-Co3PbHdE.js +1 -0
- package/dist/favicon.svg +5 -0
- package/dist/file-icons/LICENSE-lucide.txt +43 -0
- package/dist/file-icons/NOTICE.md +8 -0
- package/dist/file-icons/icons/archive.svg +1 -0
- package/dist/file-icons/icons/assets.svg +1 -0
- package/dist/file-icons/icons/audio.svg +1 -0
- package/dist/file-icons/icons/c.svg +1 -0
- package/dist/file-icons/icons/components.svg +1 -0
- package/dist/file-icons/icons/config.svg +1 -0
- package/dist/file-icons/icons/cpp.svg +1 -0
- package/dist/file-icons/icons/css.svg +1 -0
- package/dist/file-icons/icons/database.svg +1 -0
- package/dist/file-icons/icons/docker.svg +1 -0
- package/dist/file-icons/icons/env.svg +1 -0
- package/dist/file-icons/icons/executable.svg +1 -0
- package/dist/file-icons/icons/file.svg +1 -0
- package/dist/file-icons/icons/folder-open.svg +1 -0
- package/dist/file-icons/icons/folder.svg +1 -0
- package/dist/file-icons/icons/font.svg +1 -0
- package/dist/file-icons/icons/git.svg +1 -0
- package/dist/file-icons/icons/go.svg +1 -0
- package/dist/file-icons/icons/graphql.svg +1 -0
- package/dist/file-icons/icons/html.svg +1 -0
- package/dist/file-icons/icons/ignore.svg +1 -0
- package/dist/file-icons/icons/image.svg +1 -0
- package/dist/file-icons/icons/java.svg +1 -0
- package/dist/file-icons/icons/javascript.svg +1 -0
- package/dist/file-icons/icons/json.svg +1 -0
- package/dist/file-icons/icons/kotlin.svg +1 -0
- package/dist/file-icons/icons/license.svg +1 -0
- package/dist/file-icons/icons/lock.svg +1 -0
- package/dist/file-icons/icons/markdown.svg +1 -0
- package/dist/file-icons/icons/package.svg +1 -0
- package/dist/file-icons/icons/php.svg +1 -0
- package/dist/file-icons/icons/python.svg +1 -0
- package/dist/file-icons/icons/react.svg +1 -0
- package/dist/file-icons/icons/ruby.svg +1 -0
- package/dist/file-icons/icons/rust.svg +1 -0
- package/dist/file-icons/icons/sass.svg +1 -0
- package/dist/file-icons/icons/shell.svg +1 -0
- package/dist/file-icons/icons/source.svg +1 -0
- package/dist/file-icons/icons/svelte.svg +1 -0
- package/dist/file-icons/icons/swift.svg +1 -0
- package/dist/file-icons/icons/tests.svg +1 -0
- package/dist/file-icons/icons/toml.svg +1 -0
- package/dist/file-icons/icons/typescript.svg +1 -0
- package/dist/file-icons/icons/video.svg +1 -0
- package/dist/file-icons/icons/vite.svg +1 -0
- package/dist/file-icons/icons/vue.svg +1 -0
- package/dist/file-icons/icons/yaml.svg +1 -0
- package/dist/file-icons/theme.json +572 -0
- package/dist/file-icons/theme.schema.json +137 -0
- package/dist/github.svg +1 -0
- package/dist/gitlab.svg +1 -0
- package/dist/hub.html +19 -0
- package/dist/icons/apple-touch-icon.png +0 -0
- package/dist/icons/icon-192.png +0 -0
- package/dist/icons/icon-512.png +0 -0
- package/dist/icons/maskable-512.png +0 -0
- package/dist/index.html +39 -0
- package/dist/manifest.webmanifest +37 -0
- package/dist/sw.js +81 -0
- package/package.json +61 -3
- package/packages/cli/app/agent-host.js +163 -0
- package/packages/cli/app/desktop.js +77 -0
- package/packages/cli/app/fix-node-pty.js +52 -0
- package/packages/cli/app/import-companion-key.js +57 -0
- package/packages/cli/app/install-desktop.js +4 -0
- package/packages/cli/app/launch.js +134 -0
- package/packages/cli/app/restart.js +32 -0
- package/packages/cli/commands/logs.js +10 -0
- package/packages/cli/commands/open.js +49 -0
- package/packages/cli/commands/projects.js +18 -0
- package/packages/cli/commands/run.js +39 -0
- package/packages/cli/commands/search.js +19 -0
- package/packages/cli/commands/server.js +32 -0
- package/packages/cli/commands/status.js +42 -0
- package/packages/cli/common/output.js +13 -0
- package/packages/cli/modules/api/index.js +60 -0
- package/packages/cli/modules/arguments/index.js +188 -0
- package/packages/cli/modules/command-runtime/index.js +24 -0
- package/packages/cli/modules/projects/index.js +118 -0
- package/packages/cli/modules/server/index.js +226 -0
- package/packages/cli/modules/server-process/index.js +204 -0
- package/packages/core/modules/agent-features/index.js +8 -0
- package/packages/core/modules/agent-judge/index.js +73 -0
- package/packages/core/modules/agent-read/index.js +25 -0
- package/packages/core/modules/agent-role/index.js +187 -0
- package/packages/core/modules/agent-task/contract.js +34 -0
- package/packages/core/modules/agent-task/index.js +1 -0
- package/packages/core/modules/agent-widgets/bars/index.js +11 -0
- package/packages/core/modules/agent-widgets/button/index.js +19 -0
- package/packages/core/modules/agent-widgets/card/index.js +13 -0
- package/packages/core/modules/agent-widgets/checks/index.js +19 -0
- package/packages/core/modules/agent-widgets/chips/index.js +15 -0
- package/packages/core/modules/agent-widgets/columns/index.js +12 -0
- package/packages/core/modules/agent-widgets/donut/index.js +11 -0
- package/packages/core/modules/agent-widgets/field/index.js +39 -0
- package/packages/core/modules/agent-widgets/form/index.js +18 -0
- package/packages/core/modules/agent-widgets/git-info/index.js +29 -0
- package/packages/core/modules/agent-widgets/image/index.js +22 -0
- package/packages/core/modules/agent-widgets/inline-icon/index.js +45 -0
- package/packages/core/modules/agent-widgets/input/index.js +16 -0
- package/packages/core/modules/agent-widgets/intelligent-form/index.js +32 -0
- package/packages/core/modules/agent-widgets/line/index.js +12 -0
- package/packages/core/modules/agent-widgets/row/index.js +11 -0
- package/packages/core/modules/agent-widgets/safe-secret-show/index.js +21 -0
- package/packages/core/modules/agent-widgets/slider/index.js +18 -0
- package/packages/core/modules/agent-widgets/stat/index.js +16 -0
- package/packages/core/modules/agent-widgets/steps/index.js +14 -0
- package/packages/core/modules/agent-widgets/tab/index.js +12 -0
- package/packages/core/modules/agent-widgets/tabs/index.js +24 -0
- package/packages/core/modules/agents-integration/claude/index.js +1 -0
- package/packages/core/modules/agents-integration/codex/index.js +1 -0
- package/packages/core/modules/agents-integration/cursor/index.js +1 -0
- package/packages/core/modules/agents-integration/kimi/index.js +1 -0
- package/packages/core/modules/agents-integration/opencode/index.js +1 -0
- package/packages/core/modules/app-paths/index.js +14 -0
- package/packages/core/modules/app-paths/logs.js +194 -0
- package/packages/core/modules/app-paths/network-mode.js +24 -0
- package/packages/core/modules/app-paths/paths.js +40 -0
- package/packages/core/modules/app-paths/server-mode.js +18 -0
- package/packages/core/modules/appearance/index.js +35 -0
- package/packages/core/modules/browser/index.js +86 -0
- package/packages/core/modules/devcontainer/classify.js +101 -0
- package/packages/core/modules/devcontainer/contract.js +1 -0
- package/packages/core/modules/devcontainer/index.js +1 -0
- package/packages/core/modules/directories/contract.js +1 -0
- package/packages/core/modules/directories/index.js +1 -0
- package/packages/core/modules/docker/contract.js +1 -0
- package/packages/core/modules/docker/index.js +1 -0
- package/packages/core/modules/editor-themes/index.js +17 -0
- package/packages/core/modules/environment/index.js +1 -0
- package/packages/core/modules/file-icons/contract.js +177 -0
- package/packages/core/modules/file-icons/index.js +1 -0
- package/packages/core/modules/github/index.js +23 -0
- package/packages/core/modules/gitlab/index.js +164 -0
- package/packages/core/modules/hub/index.js +1 -0
- package/packages/core/modules/hub/protocol.js +19 -0
- package/packages/core/modules/ide/agent-command.js +48 -0
- package/packages/core/modules/ide/command-help.js +73 -0
- package/packages/core/modules/ide/commands.js +191 -0
- package/packages/core/modules/ide/index.js +6 -0
- package/packages/core/modules/ide/keybinding-editor.js +34 -0
- package/packages/core/modules/ide/keybindings.js +45 -0
- package/packages/core/modules/ide/palette.js +33 -0
- package/packages/core/modules/ide/safety.js +10 -0
- package/packages/core/modules/launcher/actions.js +5 -0
- package/packages/core/modules/launcher/index.js +5 -0
- package/packages/core/modules/launcher/launcher-model.js +236 -0
- package/packages/core/modules/launcher/launcher.js +76 -0
- package/packages/core/modules/launcher/query.js +42 -0
- package/packages/core/modules/network-mode/index.js +3 -0
- package/packages/core/modules/network-mode/network-mode.js +8 -0
- package/packages/core/modules/os/bash.js +11 -0
- package/packages/core/modules/os/contract.js +1 -0
- package/packages/core/modules/os/index.js +3 -0
- package/packages/core/modules/os/modules/darwin/catalog.js +108 -0
- package/packages/core/modules/os/modules/darwin/directories.js +40 -0
- package/packages/core/modules/os/modules/darwin/docker.js +15 -0
- package/packages/core/modules/os/modules/darwin/gtk.js +6 -0
- package/packages/core/modules/os/modules/darwin/helper.swift +172 -0
- package/packages/core/modules/os/modules/darwin/index.js +12 -0
- package/packages/core/modules/os/modules/darwin/install-desktop.js +135 -0
- package/packages/core/modules/os/modules/darwin/processes.js +97 -0
- package/packages/core/modules/os/modules/darwin/resident.js +235 -0
- package/packages/core/modules/os/modules/darwin/secrets.js +53 -0
- package/packages/core/modules/os/modules/darwin/shell.js +105 -0
- package/packages/core/modules/os/modules/darwin/shortcut.js +61 -0
- package/packages/core/modules/os/modules/darwin/tools.js +52 -0
- package/packages/core/modules/os/modules/darwin/windows.js +135 -0
- package/packages/core/modules/os/modules/linux/bus.js +48 -0
- package/packages/core/modules/os/modules/linux/catalog.js +47 -0
- package/packages/core/modules/os/modules/linux/directories.js +49 -0
- package/packages/core/modules/os/modules/linux/docker.js +48 -0
- package/packages/core/modules/os/modules/linux/index.js +53 -0
- package/packages/core/modules/os/modules/linux/install-desktop.js +66 -0
- package/packages/core/modules/os/modules/linux/processes.js +85 -0
- package/packages/core/modules/os/modules/linux/resident.js +139 -0
- package/packages/core/modules/os/modules/linux/secrets.js +118 -0
- package/packages/core/modules/os/modules/linux/shortcut.js +124 -0
- package/packages/core/modules/os/modules/linux/tools.js +14 -0
- package/packages/core/modules/os/modules/linux/tray.js +190 -0
- package/packages/core/modules/os/modules/linux/windows.js +187 -0
- package/packages/core/modules/os/modules/windows/agent-process.js +60 -0
- package/packages/core/modules/os/modules/windows/alert.js +20 -0
- package/packages/core/modules/os/modules/windows/catalog.js +91 -0
- package/packages/core/modules/os/modules/windows/color-scheme.js +26 -0
- package/packages/core/modules/os/modules/windows/directories.js +101 -0
- package/packages/core/modules/os/modules/windows/docker.js +17 -0
- package/packages/core/modules/os/modules/windows/git.js +42 -0
- package/packages/core/modules/os/modules/windows/hwnd.js +275 -0
- package/packages/core/modules/os/modules/windows/index.js +28 -0
- package/packages/core/modules/os/modules/windows/install-desktop.js +140 -0
- package/packages/core/modules/os/modules/windows/kill-tree.js +26 -0
- package/packages/core/modules/os/modules/windows/processes.js +300 -0
- package/packages/core/modules/os/modules/windows/ps.js +73 -0
- package/packages/core/modules/os/modules/windows/resident-pipe.js +206 -0
- package/packages/core/modules/os/modules/windows/resident.js +286 -0
- package/packages/core/modules/os/modules/windows/secrets.js +110 -0
- package/packages/core/modules/os/modules/windows/shell.js +288 -0
- package/packages/core/modules/os/modules/windows/shortcut.js +82 -0
- package/packages/core/modules/os/modules/windows/tools.js +273 -0
- package/packages/core/modules/os/modules/windows/windows.js +133 -0
- package/packages/core/modules/os/os.js +175 -0
- package/packages/core/modules/os/session-env.js +11 -0
- package/packages/core/modules/os-posix/agent-process.js +105 -0
- package/packages/core/modules/os-posix/contract.js +1 -0
- package/packages/core/modules/os-posix/git.js +26 -0
- package/packages/core/modules/os-posix/index.js +4 -0
- package/packages/core/modules/os-posix/tools.js +258 -0
- package/packages/core/modules/os-posix/xdg.js +8 -0
- package/packages/core/modules/project/contract.js +1 -0
- package/packages/core/modules/project/index.js +1 -0
- package/packages/core/modules/project/ref.js +126 -0
- package/packages/core/modules/server-mode/index.js +3 -0
- package/packages/core/modules/server-mode/server-mode.js +13 -0
- package/packages/core/modules/terminal/contract.js +1 -0
- package/packages/core/modules/terminal/index.js +1 -0
- package/packages/core/modules/usage-analytics/index.js +80 -0
- package/packages/core/modules/widget-catalog/guide.js +76 -0
- package/packages/core/modules/widget-catalog/index.js +219 -0
- package/packages/core/modules/workspace/changes.js +114 -0
- package/packages/core/modules/workspace/contract.js +1 -0
- package/packages/core/modules/workspace/file-size.js +12 -0
- package/packages/core/modules/workspace/files-exclude.js +119 -0
- package/packages/core/modules/workspace/git-decorations.js +4 -0
- package/packages/core/modules/workspace/git-graph.js +35 -0
- package/packages/core/modules/workspace/index.js +11 -0
- package/packages/core/modules/workspace/paths.js +16 -0
- package/packages/core/modules/workspace/pipeline-status.js +86 -0
- package/packages/core/modules/workspace/pull-requests.js +1 -0
- package/packages/core/modules/workspace/pull-status.js +56 -0
- package/packages/core/modules/workspace/scope.js +34 -0
- package/packages/core/modules/workspace/search.js +28 -0
- package/packages/core/modules/workspace/tree-page.js +25 -0
- package/packages/server/app/agents.js +30 -0
- package/packages/server/app/api.js +159 -0
- package/packages/server/app/claude-runner.js +17 -0
- package/packages/server/app/dev-plugin.js +76 -0
- package/packages/server/app/dev-runtime.js +119 -0
- package/packages/server/app/features.js +35 -0
- package/packages/server/app/plugin.js +140 -0
- package/packages/server/app/projector-runner.js +15 -0
- package/packages/server/app/runtime-contract.js +1 -0
- package/packages/server/app/standalone.js +42 -0
- package/packages/server/app/static.js +57 -0
- package/packages/server/app/widgets-mcp.js +36 -0
- package/packages/server/app/widgets.js +54 -0
- package/packages/server/middlewares/local-origin.js +4 -0
- package/packages/server/modules/access/access.js +118 -0
- package/packages/server/modules/access/connections.js +36 -0
- package/packages/server/modules/access/http.js +93 -0
- package/packages/server/modules/access/hub.js +19 -0
- package/packages/server/modules/access/index.js +6 -0
- package/packages/server/modules/access/lan-url.js +21 -0
- package/packages/server/modules/access/password.js +68 -0
- package/packages/server/modules/access/session.js +38 -0
- package/packages/server/modules/agent/agent-host.js +46 -0
- package/packages/server/modules/agent/agent-runs.js +162 -0
- package/packages/server/modules/agent/attachments.js +88 -0
- package/packages/server/modules/agent/backend.js +1 -0
- package/packages/server/modules/agent/chat-archive.js +67 -0
- package/packages/server/modules/agent/command-bridge.js +94 -0
- package/packages/server/modules/agent/controls.js +10 -0
- package/packages/server/modules/agent/event-streams.js +40 -0
- package/packages/server/modules/agent/history-store.js +320 -0
- package/packages/server/modules/agent/history.js +160 -0
- package/packages/server/modules/agent/hosted-process.js +279 -0
- package/packages/server/modules/agent/hosted-run.js +85 -0
- package/packages/server/modules/agent/hosted-runner.js +126 -0
- package/packages/server/modules/agent/index.js +35 -0
- package/packages/server/modules/agent/injection.js +14 -0
- package/packages/server/modules/agent/jobs-diff.js +114 -0
- package/packages/server/modules/agent/jobs-files.js +65 -0
- package/packages/server/modules/agent/jobs-followup.js +66 -0
- package/packages/server/modules/agent/jobs-live.js +180 -0
- package/packages/server/modules/agent/jobs-store.js +59 -0
- package/packages/server/modules/agent/jobs-worktree.js +161 -0
- package/packages/server/modules/agent/jobs.js +316 -0
- package/packages/server/modules/agent/judge-store.js +21 -0
- package/packages/server/modules/agent/lens-request.js +34 -0
- package/packages/server/modules/agent/queue-store.js +21 -0
- package/packages/server/modules/agent/recent-chats.js +63 -0
- package/packages/server/modules/agent/registry.js +108 -0
- package/packages/server/modules/agent/replay.js +84 -0
- package/packages/server/modules/agent/request.js +132 -0
- package/packages/server/modules/agent/role-store.js +21 -0
- package/packages/server/modules/agent/run-hub.js +105 -0
- package/packages/server/modules/agent/run-request.js +208 -0
- package/packages/server/modules/agent/secret-show.js +108 -0
- package/packages/server/modules/agent/side-request.js +142 -0
- package/packages/server/modules/agent/usage-history.js +62 -0
- package/packages/server/modules/agent/worktrees.js +136 -0
- package/packages/server/modules/agent-features/catalog.js +18 -0
- package/packages/server/modules/agent-features/index.js +2 -0
- package/packages/server/modules/agent-features/store.js +172 -0
- package/packages/server/modules/agent-mcp/index.js +106 -0
- package/packages/server/modules/agent-roles/index.js +3 -0
- package/packages/server/modules/agent-roles/project.js +231 -0
- package/packages/server/modules/agent-roles/runtime.js +68 -0
- package/packages/server/modules/agent-roles/store.js +190 -0
- package/packages/server/modules/agents/acp/acp-backend.js +320 -0
- package/packages/server/modules/agents/acp/acp-client.js +153 -0
- package/packages/server/modules/agents/acp/acp-controls.js +179 -0
- package/packages/server/modules/agents/acp/acp-dialect.js +82 -0
- package/packages/server/modules/agents/acp/acp-elicitation.js +135 -0
- package/packages/server/modules/agents/acp/acp-events.js +340 -0
- package/packages/server/modules/agents/acp/acp-process.js +78 -0
- package/packages/server/modules/agents/acp/acp-programs.js +11 -0
- package/packages/server/modules/agents/acp/acp-tools.js +208 -0
- package/packages/server/modules/agents/acp/index.js +4 -0
- package/packages/server/modules/agents/acp/mcp-config.js +100 -0
- package/packages/server/modules/agents/claude-code/claude-code-backend.js +342 -0
- package/packages/server/modules/agents/claude-code/claude-code-checkpoints.js +97 -0
- package/packages/server/modules/agents/claude-code/claude-code-env.js +46 -0
- package/packages/server/modules/agents/claude-code/claude-code-events.js +299 -0
- package/packages/server/modules/agents/claude-code/claude-code-input.js +97 -0
- package/packages/server/modules/agents/claude-code/claude-code-replay.js +71 -0
- package/packages/server/modules/agents/claude-code/claude-code-sessions.js +207 -0
- package/packages/server/modules/agents/claude-code/claude-code-times.js +42 -0
- package/packages/server/modules/agents/claude-code/index.js +2 -0
- package/packages/server/modules/agents/claude-code/questions.js +51 -0
- package/packages/server/modules/agents/codex/dialect.js +130 -0
- package/packages/server/modules/agents/codex/forms.js +24 -0
- package/packages/server/modules/agents/codex/index.js +17 -0
- package/packages/server/modules/agents/cursor/dialect.js +66 -0
- package/packages/server/modules/agents/cursor/images.js +12 -0
- package/packages/server/modules/agents/cursor/index.js +30 -0
- package/packages/server/modules/agents/cursor/plan.js +44 -0
- package/packages/server/modules/agents/cursor/questions.js +37 -0
- package/packages/server/modules/agents/cursor/selection.js +29 -0
- package/packages/server/modules/agents/cursor/task.js +32 -0
- package/packages/server/modules/agents/cursor/todos.js +69 -0
- package/packages/server/modules/agents/ide-mcp/config.js +40 -0
- package/packages/server/modules/agents/ide-mcp/index.js +1 -0
- package/packages/server/modules/agents/ide-mcp/server.js +154 -0
- package/packages/server/modules/agents/kimi/dialect.js +18 -0
- package/packages/server/modules/agents/kimi/index.js +11 -0
- package/packages/server/modules/agents/opencode/dialect.js +232 -0
- package/packages/server/modules/agents/opencode/index.js +21 -0
- package/packages/server/modules/agents/opencode/read.js +46 -0
- package/packages/server/modules/agents/opencode/sessions.js +69 -0
- package/packages/server/modules/agents/projector/agent-lens.js +110 -0
- package/packages/server/modules/agents/projector/agent-tools.js +290 -0
- package/packages/server/modules/agents/projector/answer-doctor.js +32 -0
- package/packages/server/modules/agents/projector/form-doctor.js +33 -0
- package/packages/server/modules/agents/projector/index.js +12 -0
- package/packages/server/modules/agents/projector/project-instructions.js +34 -0
- package/packages/server/modules/agents/projector/projector-backend.js +350 -0
- package/packages/server/modules/agents/projector/projector-budget.js +70 -0
- package/packages/server/modules/agents/projector/projector-compaction.js +128 -0
- package/packages/server/modules/agents/projector/projector-controls.js +70 -0
- package/packages/server/modules/agents/projector/projector-guard.js +196 -0
- package/packages/server/modules/agents/projector/projector-history.js +87 -0
- package/packages/server/modules/agents/projector/projector-hooks.js +201 -0
- package/packages/server/modules/agents/projector/projector-input.js +40 -0
- package/packages/server/modules/agents/projector/projector-mcp-config.js +1 -0
- package/packages/server/modules/agents/projector/projector-mcp.js +119 -0
- package/packages/server/modules/agents/projector/projector-memory.js +92 -0
- package/packages/server/modules/agents/projector/projector-retry.js +52 -0
- package/packages/server/modules/agents/projector/projector-review.js +40 -0
- package/packages/server/modules/agents/projector/projector-side.js +56 -0
- package/packages/server/modules/agents/projector/projector-skills.js +143 -0
- package/packages/server/modules/agents/projector/projector-task.js +235 -0
- package/packages/server/modules/agents/projector/projector-usage.js +19 -0
- package/packages/server/modules/agents/projector/projector-web-search.js +76 -0
- package/packages/server/modules/agents/projector/projector-web.js +172 -0
- package/packages/server/modules/agents/projector/prompts.js +46 -0
- package/packages/server/modules/agents/projector/secrets/secret-destination.js +226 -0
- package/packages/server/modules/agents/projector/secrets/secret-show.js +23 -0
- package/packages/server/modules/agents/projector/secrets/secret-tools.js +124 -0
- package/packages/server/modules/agents/projector/tool-spec.js +4 -0
- package/packages/server/modules/agents/projector/tool-specs.js +167 -0
- package/packages/server/modules/agents/projector/widgets.js +4 -0
- package/packages/server/modules/agents/widgets-mcp/config.js +34 -0
- package/packages/server/modules/agents/widgets-mcp/index.js +1 -0
- package/packages/server/modules/agents-integration/_/usage-cache.js +19 -0
- package/packages/server/modules/agents-integration/claude/client.js +33 -0
- package/packages/server/modules/agents-integration/claude/index.js +1 -0
- package/packages/server/modules/agents-integration/claude/usage.js +49 -0
- package/packages/server/modules/agents-integration/codex/cli.js +86 -0
- package/packages/server/modules/agents-integration/codex/index.js +1 -0
- package/packages/server/modules/agents-integration/codex/usage.js +45 -0
- package/packages/server/modules/agents-integration/cursor/client.js +40 -0
- package/packages/server/modules/agents-integration/cursor/credentials.js +34 -0
- package/packages/server/modules/agents-integration/cursor/index.js +1 -0
- package/packages/server/modules/agents-integration/cursor/usage.js +59 -0
- package/packages/server/modules/agents-integration/kimi/client.js +48 -0
- package/packages/server/modules/agents-integration/kimi/credential-config.js +167 -0
- package/packages/server/modules/agents-integration/kimi/credentials.js +261 -0
- package/packages/server/modules/agents-integration/kimi/index.js +1 -0
- package/packages/server/modules/agents-integration/kimi/usage.js +149 -0
- package/packages/server/modules/agents-integration/opencode/client.js +30 -0
- package/packages/server/modules/agents-integration/opencode/credentials.js +36 -0
- package/packages/server/modules/agents-integration/opencode/index.js +1 -0
- package/packages/server/modules/agents-integration/opencode/usage.js +47 -0
- package/packages/server/modules/appearance/index.js +38 -0
- package/packages/server/modules/browser/cookies.js +112 -0
- package/packages/server/modules/browser/guard.js +55 -0
- package/packages/server/modules/browser/index.js +2 -0
- package/packages/server/modules/browser/key.js +34 -0
- package/packages/server/modules/browser/proxy.js +255 -0
- package/packages/server/modules/browser/rewrite.js +82 -0
- package/packages/server/modules/devcontainer/discovery.js +85 -0
- package/packages/server/modules/devcontainer/exec.js +81 -0
- package/packages/server/modules/devcontainer/index.js +4 -0
- package/packages/server/modules/devcontainer/launch.js +51 -0
- package/packages/server/modules/devcontainer/state.js +68 -0
- package/packages/server/modules/devcontainer/trust.js +41 -0
- package/packages/server/modules/directories/directories.js +34 -0
- package/packages/server/modules/directories/index.js +1 -0
- package/packages/server/modules/docker/actions.js +121 -0
- package/packages/server/modules/docker/daemon.js +72 -0
- package/packages/server/modules/docker/index.js +4 -0
- package/packages/server/modules/docker/settings.js +127 -0
- package/packages/server/modules/docker/snapshot.js +105 -0
- package/packages/server/modules/environments/execution.js +125 -0
- package/packages/server/modules/environments/index.js +3 -0
- package/packages/server/modules/environments/reconcile.js +62 -0
- package/packages/server/modules/environments/settings.js +58 -0
- package/packages/server/modules/events/implementation.js +85 -0
- package/packages/server/modules/events/index.js +1 -0
- package/packages/server/modules/folder-picker/index.js +1 -0
- package/packages/server/modules/folder-picker/pick-folder.js +2 -0
- package/packages/server/modules/git-import/clone.js +47 -0
- package/packages/server/modules/git-import/container.js +57 -0
- package/packages/server/modules/git-import/import.js +82 -0
- package/packages/server/modules/git-import/index.js +4 -0
- package/packages/server/modules/git-import/jobs.js +68 -0
- package/packages/server/modules/github/api.js +260 -0
- package/packages/server/modules/github/browser.js +185 -0
- package/packages/server/modules/github/clone.js +55 -0
- package/packages/server/modules/github/container.js +15 -0
- package/packages/server/modules/github/discussions.js +141 -0
- package/packages/server/modules/github/emojis.js +14 -0
- package/packages/server/modules/github/history.js +205 -0
- package/packages/server/modules/github/index.js +11 -0
- package/packages/server/modules/github/issues.js +81 -0
- package/packages/server/modules/github/navigation.js +35 -0
- package/packages/server/modules/github/pipelines.js +266 -0
- package/packages/server/modules/github/pulls.js +111 -0
- package/packages/server/modules/github/releases.js +241 -0
- package/packages/server/modules/gitlab/api.js +257 -0
- package/packages/server/modules/gitlab/base.js +24 -0
- package/packages/server/modules/gitlab/blob-search.js +110 -0
- package/packages/server/modules/gitlab/browser.js +296 -0
- package/packages/server/modules/gitlab/clone.js +78 -0
- package/packages/server/modules/gitlab/compare.js +68 -0
- package/packages/server/modules/gitlab/connection.js +55 -0
- package/packages/server/modules/gitlab/container.js +15 -0
- package/packages/server/modules/gitlab/history.js +127 -0
- package/packages/server/modules/gitlab/icon.js +67 -0
- package/packages/server/modules/gitlab/index.js +14 -0
- package/packages/server/modules/gitlab/issues.js +61 -0
- package/packages/server/modules/gitlab/merge-requests.js +287 -0
- package/packages/server/modules/gitlab/navigation.js +187 -0
- package/packages/server/modules/gitlab/oauth.js +250 -0
- package/packages/server/modules/gitlab/pipelines.js +240 -0
- package/packages/server/modules/gitlab/releases.js +226 -0
- package/packages/server/modules/gitlab/search.js +75 -0
- package/packages/server/modules/gitlab/trackers.js +96 -0
- package/packages/server/modules/http/download.js +50 -0
- package/packages/server/modules/http/http.js +8 -0
- package/packages/server/modules/http/index.js +2 -0
- package/packages/server/modules/hub/connector.js +114 -0
- package/packages/server/modules/hub/hub.js +142 -0
- package/packages/server/modules/hub/index.js +1 -0
- package/packages/server/modules/ide/editor-settings.js +37 -0
- package/packages/server/modules/ide/index.js +3 -0
- package/packages/server/modules/ide/keybindings.js +37 -0
- package/packages/server/modules/ide/mcp-bridge.js +150 -0
- package/packages/server/modules/instance/index.js +2 -0
- package/packages/server/modules/instance/instance.js +50 -0
- package/packages/server/modules/integration-store/index.js +2 -0
- package/packages/server/modules/integration-store/list.js +12 -0
- package/packages/server/modules/integration-store/store.js +141 -0
- package/packages/server/modules/judge/approval.js +35 -0
- package/packages/server/modules/judge/index.js +3 -0
- package/packages/server/modules/judge/settings.js +35 -0
- package/packages/server/modules/judge/verdict.js +141 -0
- package/packages/server/modules/launcher/browse.js +29 -0
- package/packages/server/modules/launcher/folders.js +138 -0
- package/packages/server/modules/launcher/hosted-search.js +43 -0
- package/packages/server/modules/launcher/index.js +12 -0
- package/packages/server/modules/launcher/launcher.js +352 -0
- package/packages/server/modules/launcher/potential.js +70 -0
- package/packages/server/modules/launcher/project-entries.js +165 -0
- package/packages/server/modules/network/eu-context.js +29 -0
- package/packages/server/modules/network/index.js +1 -0
- package/packages/server/modules/openai-gateway/config.js +125 -0
- package/packages/server/modules/openai-gateway/gateway.js +178 -0
- package/packages/server/modules/openai-gateway/index.js +7 -0
- package/packages/server/modules/preferences/index.js +7 -0
- package/packages/server/modules/preferences/preferences.js +142 -0
- package/packages/server/modules/processes/index.js +6 -0
- package/packages/server/modules/processes/processes.js +174 -0
- package/packages/server/modules/project-presentation/implementation.js +130 -0
- package/packages/server/modules/project-presentation/index.js +1 -0
- package/packages/server/modules/project-widgets/index.js +210 -0
- package/packages/server/modules/projects/discovery.js +179 -0
- package/packages/server/modules/projects/favicon.js +180 -0
- package/packages/server/modules/projects/index.js +11 -0
- package/packages/server/modules/projects/inspect.js +148 -0
- package/packages/server/modules/projects/remote-icon.js +39 -0
- package/packages/server/modules/projects/store.js +41 -0
- package/packages/server/modules/projects/types.js +1 -0
- package/packages/server/modules/providers/atomic-file.js +29 -0
- package/packages/server/modules/providers/balance.js +125 -0
- package/packages/server/modules/providers/index.js +15 -0
- package/packages/server/modules/providers/kinds.js +24 -0
- package/packages/server/modules/providers/model-list.js +16 -0
- package/packages/server/modules/providers/models.js +124 -0
- package/packages/server/modules/providers/openai-client.js +40 -0
- package/packages/server/modules/providers/provider-seeds.js +39 -0
- package/packages/server/modules/providers/provider-store.js +317 -0
- package/packages/server/modules/providers/quiet-model.js +36 -0
- package/packages/server/modules/providers/secret-obfuscation.js +48 -0
- package/packages/server/modules/providers/thinking.js +105 -0
- package/packages/server/modules/providers/types.js +1 -0
- package/packages/server/modules/restart/index.js +1 -0
- package/packages/server/modules/restart/restart.js +56 -0
- package/packages/server/modules/secrets/index.js +1 -0
- package/packages/server/modules/secrets/vault.js +51 -0
- package/packages/server/modules/spend/index.js +2 -0
- package/packages/server/modules/spend/ledger.js +82 -0
- package/packages/server/modules/spend/store.js +92 -0
- package/packages/server/modules/terminal/drop-files.js +42 -0
- package/packages/server/modules/terminal/index.js +15 -0
- package/packages/server/modules/terminal/link-files.js +44 -0
- package/packages/server/modules/terminal/scenario-folder.js +20 -0
- package/packages/server/modules/terminal/session-state.js +85 -0
- package/packages/server/modules/terminal/socket.js +159 -0
- package/packages/server/modules/terminal/terminal-activity.js +56 -0
- package/packages/server/modules/terminal/terminal-file.js +32 -0
- package/packages/server/modules/terminal/terminal-mouse.js +29 -0
- package/packages/server/modules/terminal/terminal.js +308 -0
- package/packages/server/modules/terminal/terminate.js +68 -0
- package/packages/server/modules/terminal-control/control.js +75 -0
- package/packages/server/modules/terminal-control/handlers.js +10 -0
- package/packages/server/modules/terminal-control/index.js +3 -0
- package/packages/server/modules/terminal-control/shared-socket.js +319 -0
- package/packages/server/modules/terminal-control/socket.js +153 -0
- package/packages/server/modules/transport/implementation.js +24 -0
- package/packages/server/modules/transport/index.js +2 -0
- package/packages/server/modules/transport/router.js +16 -0
- package/packages/server/modules/transport/types.js +1 -0
- package/packages/server/modules/usage-analytics/index.js +4 -0
- package/packages/server/modules/usage-analytics/limits.js +144 -0
- package/packages/server/modules/usage-analytics/overview.js +117 -0
- package/packages/server/modules/usage-analytics/providers.js +120 -0
- package/packages/server/modules/usage-analytics/store.js +152 -0
- package/packages/server/modules/window/desktop.js +24 -0
- package/packages/server/modules/window/index.js +8 -0
- package/packages/server/modules/window/window.js +86 -0
- package/packages/server/modules/workspace/archive.py +109 -0
- package/packages/server/modules/workspace/external-files.js +22 -0
- package/packages/server/modules/workspace/files-exclude.js +73 -0
- package/packages/server/modules/workspace/files.js +332 -0
- package/packages/server/modules/workspace/find-paths.js +92 -0
- package/packages/server/modules/workspace/git-branches.js +159 -0
- package/packages/server/modules/workspace/git-compare.js +121 -0
- package/packages/server/modules/workspace/git-history.js +182 -0
- package/packages/server/modules/workspace/git-sync.js +245 -0
- package/packages/server/modules/workspace/git-tree.js +126 -0
- package/packages/server/modules/workspace/git.js +276 -0
- package/packages/server/modules/workspace/ignored.js +23 -0
- package/packages/server/modules/workspace/import.js +190 -0
- package/packages/server/modules/workspace/index.js +15 -0
- package/packages/server/modules/workspace/paths.js +38 -0
- package/packages/server/modules/workspace/reveal.js +14 -0
- package/packages/server/modules/workspace/search.js +136 -0
- package/packages/server/modules/workspace/site.js +62 -0
- package/packages/server/modules/workspace/watcher.js +176 -0
- package/packages/server/routes/api/agent-answer-repair.js +35 -0
- package/packages/server/routes/api/agent-chats.js +77 -0
- package/packages/server/routes/api/agent-features.js +36 -0
- package/packages/server/routes/api/agent-form-repair.js +35 -0
- package/packages/server/routes/api/agent-hooks.js +35 -0
- package/packages/server/routes/api/agent-jobs.js +322 -0
- package/packages/server/routes/api/agent-judge.js +33 -0
- package/packages/server/routes/api/agent-lens.js +27 -0
- package/packages/server/routes/api/agent-mcp.js +41 -0
- package/packages/server/routes/api/agent-memory.js +33 -0
- package/packages/server/routes/api/agent-project-roles.js +112 -0
- package/packages/server/routes/api/agent-project-widgets.js +67 -0
- package/packages/server/routes/api/agent-roles.js +106 -0
- package/packages/server/routes/api/agent-secret-show.js +87 -0
- package/packages/server/routes/api/agent-side.js +70 -0
- package/packages/server/routes/api/agent-skills.js +31 -0
- package/packages/server/routes/api/agent-web.js +27 -0
- package/packages/server/routes/api/agent-worktrees.js +49 -0
- package/packages/server/routes/api/agent.js +269 -0
- package/packages/server/routes/api/analytics.js +21 -0
- package/packages/server/routes/api/app/hide.js +12 -0
- package/packages/server/routes/api/app/mode.js +49 -0
- package/packages/server/routes/api/app/network.js +54 -0
- package/packages/server/routes/api/app/open.js +33 -0
- package/packages/server/routes/api/app/quit.js +14 -0
- package/packages/server/routes/api/app/restart.js +18 -0
- package/packages/server/routes/api/appearance.js +70 -0
- package/packages/server/routes/api/browser.js +27 -0
- package/packages/server/routes/api/claude.js +15 -0
- package/packages/server/routes/api/codex.js +15 -0
- package/packages/server/routes/api/cursor.js +15 -0
- package/packages/server/routes/api/directories.js +16 -0
- package/packages/server/routes/api/docker.js +74 -0
- package/packages/server/routes/api/events.js +25 -0
- package/packages/server/routes/api/health.js +20 -0
- package/packages/server/routes/api/hub.js +26 -0
- package/packages/server/routes/api/ide/commands.js +72 -0
- package/packages/server/routes/api/ide/editor.js +37 -0
- package/packages/server/routes/api/ide/files-exclude.js +37 -0
- package/packages/server/routes/api/ide/keybindings.js +37 -0
- package/packages/server/routes/api/inspect.js +21 -0
- package/packages/server/routes/api/integrations/[...action].js +201 -0
- package/packages/server/routes/api/integrations/github-browse.js +190 -0
- package/packages/server/routes/api/kimi.js +15 -0
- package/packages/server/routes/api/launcher/icon.js +16 -0
- package/packages/server/routes/api/launcher/launch.js +27 -0
- package/packages/server/routes/api/launcher/search.js +20 -0
- package/packages/server/routes/api/launcher/settings.js +68 -0
- package/packages/server/routes/api/openai.js +94 -0
- package/packages/server/routes/api/opencode.js +15 -0
- package/packages/server/routes/api/pick-folder.js +12 -0
- package/packages/server/routes/api/preview-icon.js +21 -0
- package/packages/server/routes/api/projects/[id]/index.js +240 -0
- package/packages/server/routes/api/projects/[id]/site.js +59 -0
- package/packages/server/routes/api/projects/[id]/terminals.js +38 -0
- package/packages/server/routes/api/projects/[id]/workspace-read.js +126 -0
- package/packages/server/routes/api/projects/[id]/workspace.js +147 -0
- package/packages/server/routes/api/projects/index.js +62 -0
- package/packages/server/routes/api/providers/active.js +12 -0
- package/packages/server/routes/api/providers/balance.js +15 -0
- package/packages/server/routes/api/providers/models.js +19 -0
- package/packages/server/routes/api/providers.js +23 -0
- package/packages/server/routes/api/status.js +11 -0
- package/resources/icons/128.png +0 -0
- package/resources/icons/16.png +0 -0
- package/resources/icons/256.png +0 -0
- package/resources/icons/32.png +0 -0
- package/resources/icons/48.png +0 -0
- package/resources/icons/512.png +0 -0
- package/resources/icons/64.png +0 -0
- package/resources/icons/projector.svg +5 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { realpath, writeFile, rm } from "node:fs/promises";
|
|
3
|
+
import { os } from "../../../core/modules/os/index.js";
|
|
4
|
+
import { runEnvironmentCommand } from "../environments/index.js";
|
|
5
|
+
import { HttpError } from "../http/index.js";
|
|
6
|
+
const cloneScript = (username, tokenEnv) => String.raw `cat > /tmp/askpass <<'ASKPASS'
|
|
7
|
+
#!/bin/sh
|
|
8
|
+
case "$1" in
|
|
9
|
+
*Username*) printf "%s\n" "${username}" ;;
|
|
10
|
+
*) printf "%s\n" "$${tokenEnv}" ;;
|
|
11
|
+
esac
|
|
12
|
+
ASKPASS
|
|
13
|
+
chmod 700 /tmp/askpass
|
|
14
|
+
export GIT_ASKPASS=/tmp/askpass GIT_TERMINAL_PROMPT=0
|
|
15
|
+
exec git -c credential.helper= -c core.hooksPath=/dev/null -c http.followRedirects=false clone -- "$1" /workspace/checkout`;
|
|
16
|
+
/**
|
|
17
|
+
* HTTPS clone inside the project's Docker environment. The credential reaches the container only
|
|
18
|
+
* through a 0600 `--env-file`, and the URL stays an argument so no token appears in the command.
|
|
19
|
+
*/
|
|
20
|
+
export async function cloneInContainer({ url, staging, token, environment, signal, username, tokenEnv, id, failure, }) {
|
|
21
|
+
if (token.includes("\n") || token.includes("\r"))
|
|
22
|
+
throw new HttpError(400, failure);
|
|
23
|
+
const credentials = join(staging, ".clone-credentials");
|
|
24
|
+
await writeFile(credentials, `${tokenEnv}=${token}\n`, { mode: 0o600 });
|
|
25
|
+
await os.tools.restrictToOwner(credentials);
|
|
26
|
+
const project = {
|
|
27
|
+
id,
|
|
28
|
+
name: url,
|
|
29
|
+
path: await realpath(staging),
|
|
30
|
+
url: "",
|
|
31
|
+
icon: "",
|
|
32
|
+
mode: "server",
|
|
33
|
+
commands: [],
|
|
34
|
+
defaultCommandId: "",
|
|
35
|
+
createdAt: new Date().toISOString(),
|
|
36
|
+
environment: { ...environment, network: "bridge", ports: [] },
|
|
37
|
+
};
|
|
38
|
+
try {
|
|
39
|
+
await runEnvironmentCommand(project, [
|
|
40
|
+
"/bin/bash",
|
|
41
|
+
"--noprofile",
|
|
42
|
+
"--norc",
|
|
43
|
+
"-c",
|
|
44
|
+
cloneScript(username, tokenEnv),
|
|
45
|
+
"projector-clone",
|
|
46
|
+
url,
|
|
47
|
+
], 300_000, signal, credentials);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
if (signal?.aborted)
|
|
51
|
+
throw error;
|
|
52
|
+
throw new HttpError(400, failure);
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
await rm(credentials, { force: true });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { mkdir, mkdtemp, rm, lstat, realpath } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
|
+
import { os } from "../../../core/modules/os/index.js";
|
|
5
|
+
import { HttpError } from "../http/index.js";
|
|
6
|
+
import { expandPath, inspectProject, loadProjects, updateProjects } from "../projects/index.js";
|
|
7
|
+
const imports = new Set();
|
|
8
|
+
/** Moves the finished checkout into place without ever overwriting an existing folder. */
|
|
9
|
+
async function publish(checkout, destination) {
|
|
10
|
+
try {
|
|
11
|
+
await os.tools.publishDirectory(checkout, destination);
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
if (error.code === "EEXIST")
|
|
15
|
+
throw new HttpError(409, "Папка уже существует");
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Host-independent import: claims the destination, clones into staging, describes the project
|
|
21
|
+
* and registers it. Nothing is installed or run; existing folders are never overwritten.
|
|
22
|
+
*/
|
|
23
|
+
export async function importRepository({ directory: base, segments, clone, environment, hooks = {}, }) {
|
|
24
|
+
const directory = expandPath(base);
|
|
25
|
+
const destination = join(directory, ...segments);
|
|
26
|
+
if (imports.has(destination))
|
|
27
|
+
throw new HttpError(409, "Этот репозиторий уже импортируется");
|
|
28
|
+
imports.add(destination);
|
|
29
|
+
let staging = "";
|
|
30
|
+
try {
|
|
31
|
+
if ((await loadProjects()).some((project) => project.path === destination))
|
|
32
|
+
throw new HttpError(409, "Проект уже добавлен");
|
|
33
|
+
if (await lstat(destination).catch((error) => {
|
|
34
|
+
if (error.code === "ENOENT")
|
|
35
|
+
return null;
|
|
36
|
+
throw error;
|
|
37
|
+
}))
|
|
38
|
+
throw new HttpError(409, "Папка уже существует. Добавьте её как локальный проект или выберите другую папку импорта");
|
|
39
|
+
const parent = join(directory, ...segments.slice(0, -1));
|
|
40
|
+
await mkdir(parent, { recursive: true });
|
|
41
|
+
staging = await mkdtemp(join(parent, ".projector-import-"));
|
|
42
|
+
const checkout = join(staging, "checkout");
|
|
43
|
+
hooks.signal?.throwIfAborted();
|
|
44
|
+
hooks.phase?.("cloning");
|
|
45
|
+
await clone({ staging, checkout });
|
|
46
|
+
hooks.signal?.throwIfAborted();
|
|
47
|
+
hooks.phase?.("finishing");
|
|
48
|
+
let draft;
|
|
49
|
+
if (await lstat(join(checkout, "package.json")).catch(() => null)) {
|
|
50
|
+
draft = await inspectProject(checkout);
|
|
51
|
+
draft.icon = draft.icon ? draft.icon.replace(checkout, destination) : "";
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
const command = { id: randomUUID(), name: "git status", cmd: "git status" };
|
|
55
|
+
draft = {
|
|
56
|
+
name: segments[segments.length - 1],
|
|
57
|
+
url: "",
|
|
58
|
+
icon: "",
|
|
59
|
+
mode: "server",
|
|
60
|
+
commands: [command],
|
|
61
|
+
defaultCommandId: command.id,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
await publish(checkout, destination);
|
|
65
|
+
const project = {
|
|
66
|
+
...draft,
|
|
67
|
+
path: await realpath(destination),
|
|
68
|
+
environment,
|
|
69
|
+
id: randomUUID(),
|
|
70
|
+
createdAt: new Date().toISOString(),
|
|
71
|
+
};
|
|
72
|
+
await updateProjects((projects) => {
|
|
73
|
+
projects.unshift(project);
|
|
74
|
+
});
|
|
75
|
+
return { project };
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
imports.delete(destination);
|
|
79
|
+
if (staging)
|
|
80
|
+
await rm(staging, { recursive: true, force: true });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { HttpError } from "../http/index.js";
|
|
3
|
+
const MESSAGES = {
|
|
4
|
+
queued: "В очереди",
|
|
5
|
+
preparing: "Проверяю Docker и образ",
|
|
6
|
+
pulling: "Скачиваю образ Docker",
|
|
7
|
+
cloning: "Клонирую репозиторий",
|
|
8
|
+
finishing: "Добавляю проект",
|
|
9
|
+
done: "Готово",
|
|
10
|
+
cancelled: "Клонирование отменено",
|
|
11
|
+
};
|
|
12
|
+
const FINISHED = new Set(["done", "error", "cancelled"]);
|
|
13
|
+
const KEEP = 20;
|
|
14
|
+
const jobs = new Map();
|
|
15
|
+
const active = (entry) => !FINISHED.has(entry.job.phase);
|
|
16
|
+
function prune() {
|
|
17
|
+
const finished = [...jobs.values()].filter((entry) => !active(entry));
|
|
18
|
+
for (const entry of finished.slice(0, Math.max(0, finished.length - KEEP)))
|
|
19
|
+
jobs.delete(entry.job.id);
|
|
20
|
+
}
|
|
21
|
+
/** Starts a clone in the background; the caller polls `cloneJob` and may `cancelCloneJob`. */
|
|
22
|
+
export function startCloneJob(body, run) {
|
|
23
|
+
const repository = typeof body.repository === "string" ? body.repository : "";
|
|
24
|
+
const controller = new AbortController();
|
|
25
|
+
const job = {
|
|
26
|
+
id: randomUUID(),
|
|
27
|
+
repository,
|
|
28
|
+
phase: "queued",
|
|
29
|
+
message: MESSAGES.queued,
|
|
30
|
+
startedAt: Date.now(),
|
|
31
|
+
};
|
|
32
|
+
const entry = { job, controller };
|
|
33
|
+
jobs.set(job.id, entry);
|
|
34
|
+
const set = (phase, message = MESSAGES[phase] ?? "") => {
|
|
35
|
+
// The first terminal state wins: a late phase update must not resurrect a cancelled job.
|
|
36
|
+
if (!FINISHED.has(job.phase))
|
|
37
|
+
Object.assign(job, { phase, message });
|
|
38
|
+
};
|
|
39
|
+
void run(body, { signal: controller.signal, phase: set })
|
|
40
|
+
.then(({ project }) => {
|
|
41
|
+
if (controller.signal.aborted)
|
|
42
|
+
return;
|
|
43
|
+
job.project = project;
|
|
44
|
+
set("done");
|
|
45
|
+
})
|
|
46
|
+
.catch((error) => {
|
|
47
|
+
if (controller.signal.aborted)
|
|
48
|
+
set("cancelled");
|
|
49
|
+
else
|
|
50
|
+
set("error", error.message || "Не удалось клонировать репозиторий");
|
|
51
|
+
})
|
|
52
|
+
.finally(prune);
|
|
53
|
+
return job;
|
|
54
|
+
}
|
|
55
|
+
export function cloneJob(id) {
|
|
56
|
+
const entry = jobs.get(id);
|
|
57
|
+
if (!entry)
|
|
58
|
+
throw new HttpError(404, "Задача клонирования не найдена");
|
|
59
|
+
return entry.job;
|
|
60
|
+
}
|
|
61
|
+
export function cancelCloneJob(id) {
|
|
62
|
+
const entry = jobs.get(id);
|
|
63
|
+
if (!entry)
|
|
64
|
+
throw new HttpError(404, "Задача клонирования не найдена");
|
|
65
|
+
if (active(entry))
|
|
66
|
+
entry.controller.abort();
|
|
67
|
+
return entry.job;
|
|
68
|
+
}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { os } from "../../../core/modules/os/index.js";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { integrationConfig, updateIntegration, revealIntegrationToken, fieldText as text, } from "../integration-store/index.js";
|
|
4
|
+
import { randomUUID } from "node:crypto";
|
|
5
|
+
import { HttpError } from "../http/index.js";
|
|
6
|
+
import { expandPath } from "../projects/index.js";
|
|
7
|
+
export const DEFAULT_DIRECTORY = join(os.homeDirectory(), "Projects");
|
|
8
|
+
const sessions = new Map();
|
|
9
|
+
export function repositoryName(value) {
|
|
10
|
+
const name = text(value)
|
|
11
|
+
.replace(/^https:\/\/github\.com\//, "")
|
|
12
|
+
.replace(/\/$/, "")
|
|
13
|
+
.replace(/\.git$/, "");
|
|
14
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9-]*\/[A-Za-z0-9_.-]+$/.test(name) ||
|
|
15
|
+
[".", ".."].includes(name.split("/")[1]))
|
|
16
|
+
throw new HttpError(400, "Укажите owner/repository или ссылку github.com");
|
|
17
|
+
return name;
|
|
18
|
+
}
|
|
19
|
+
/** One raw REST response; redirects stay manual for endpoints that answer with a signed link (job logs). */
|
|
20
|
+
export async function githubResponse(path, token = "", init = {}) {
|
|
21
|
+
return fetch(`https://api.github.com${path}`, {
|
|
22
|
+
...init,
|
|
23
|
+
headers: {
|
|
24
|
+
...(token ? { Authorization: `Bearer ${token}` } : {}),
|
|
25
|
+
Accept: "application/vnd.github+json",
|
|
26
|
+
"X-GitHub-Api-Version": "2022-11-28",
|
|
27
|
+
"User-Agent": "Projector",
|
|
28
|
+
...init.headers,
|
|
29
|
+
},
|
|
30
|
+
signal: AbortSignal.timeout(30_000),
|
|
31
|
+
redirect: init.redirect ?? "error",
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
export async function github(path, token = "") {
|
|
35
|
+
const response = await githubResponse(path, token);
|
|
36
|
+
if (!response.ok)
|
|
37
|
+
throw new HttpError([401, 403, 404, 409, 429].includes(response.status) ? response.status : 400, response.status === 401
|
|
38
|
+
? "Авторизация GitHub истекла. Войдите снова"
|
|
39
|
+
: response.status === 404
|
|
40
|
+
? "Репозиторий не найден или нет доступа"
|
|
41
|
+
: `GitHub вернул ${response.status}. Проверьте права доступа и лимит API`);
|
|
42
|
+
return (await response.json());
|
|
43
|
+
}
|
|
44
|
+
/** GraphQL v4: Discussions exist only there, and it answers only to a signed-in token. */
|
|
45
|
+
export async function githubGraphql(query, variables, token) {
|
|
46
|
+
if (!token)
|
|
47
|
+
throw new HttpError(401, "Для Discussions войдите в GitHub: GraphQL API работает только с токеном");
|
|
48
|
+
const response = await fetch("https://api.github.com/graphql", {
|
|
49
|
+
method: "POST",
|
|
50
|
+
headers: {
|
|
51
|
+
Authorization: `Bearer ${token}`,
|
|
52
|
+
"Content-Type": "application/json",
|
|
53
|
+
"User-Agent": "Projector",
|
|
54
|
+
},
|
|
55
|
+
body: JSON.stringify({ query, variables }),
|
|
56
|
+
signal: AbortSignal.timeout(30_000),
|
|
57
|
+
redirect: "error",
|
|
58
|
+
});
|
|
59
|
+
if (!response.ok)
|
|
60
|
+
throw new HttpError([401, 403, 429].includes(response.status) ? response.status : 400, response.status === 401
|
|
61
|
+
? "Авторизация GitHub истекла. Войдите снова"
|
|
62
|
+
: `GitHub вернул ${response.status}. Проверьте права доступа и лимит API`);
|
|
63
|
+
const body = (await response.json());
|
|
64
|
+
if (body.errors?.length || !body.data) {
|
|
65
|
+
const notFound = body.errors?.some((error) => error.type === "NOT_FOUND");
|
|
66
|
+
throw new HttpError(notFound ? 404 : 400, notFound
|
|
67
|
+
? "Репозиторий или обсуждение не найдены или нет доступа"
|
|
68
|
+
: "GitHub отклонил запрос Discussions");
|
|
69
|
+
}
|
|
70
|
+
return body.data;
|
|
71
|
+
}
|
|
72
|
+
async function oauth(path, body) {
|
|
73
|
+
const response = await fetch(`https://github.com/login/${path}`, {
|
|
74
|
+
method: "POST",
|
|
75
|
+
headers: { Accept: "application/json", "Content-Type": "application/x-www-form-urlencoded" },
|
|
76
|
+
body: new URLSearchParams(body),
|
|
77
|
+
signal: AbortSignal.timeout(30_000),
|
|
78
|
+
redirect: "error",
|
|
79
|
+
});
|
|
80
|
+
if (!response.ok)
|
|
81
|
+
throw new HttpError(400, `GitHub OAuth вернул ${response.status}`);
|
|
82
|
+
return await response.json();
|
|
83
|
+
}
|
|
84
|
+
export async function authorized() {
|
|
85
|
+
const config = await integrationConfig("github");
|
|
86
|
+
if (!config.enabled)
|
|
87
|
+
throw new HttpError(400, "Включите интеграцию GitHub в настройках");
|
|
88
|
+
if (!config.credentials.token)
|
|
89
|
+
throw new HttpError(401, "Войдите в GitHub в настройках интеграции");
|
|
90
|
+
return config;
|
|
91
|
+
}
|
|
92
|
+
export async function githubStatus() {
|
|
93
|
+
const config = await integrationConfig("github");
|
|
94
|
+
return {
|
|
95
|
+
id: "github",
|
|
96
|
+
name: "GitHub",
|
|
97
|
+
description: "Импорт репозиториев в локальный каталог проектов",
|
|
98
|
+
enabled: config.enabled,
|
|
99
|
+
settings: {
|
|
100
|
+
clientId: config.settings.clientId ?? "",
|
|
101
|
+
directory: config.settings.directory || DEFAULT_DIRECTORY,
|
|
102
|
+
},
|
|
103
|
+
connected: !!config.credentials.token,
|
|
104
|
+
account: config.credentials.login || null,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export const revealGithubToken = () => revealIntegrationToken("github");
|
|
108
|
+
export async function configureGithub(body) {
|
|
109
|
+
if (typeof body.enabled !== "boolean")
|
|
110
|
+
throw new HttpError(400, "Укажите состояние интеграции");
|
|
111
|
+
const directory = text(body.directory);
|
|
112
|
+
if (!directory)
|
|
113
|
+
throw new HttpError(400, "Укажите папку для импорта");
|
|
114
|
+
const clientId = text(body.clientId);
|
|
115
|
+
await updateIntegration("github", (config) => ({
|
|
116
|
+
...config,
|
|
117
|
+
enabled: body.enabled,
|
|
118
|
+
settings: { clientId, directory: expandPath(directory) },
|
|
119
|
+
}));
|
|
120
|
+
sessions.clear();
|
|
121
|
+
return githubStatus();
|
|
122
|
+
}
|
|
123
|
+
async function connect(token, expectedClientId, sessionId) {
|
|
124
|
+
if (!token || /[\r\n]/.test(token))
|
|
125
|
+
throw new HttpError(400, "Укажите корректный токен GitHub");
|
|
126
|
+
const account = await github("/user", token);
|
|
127
|
+
await updateIntegration("github", (config) => {
|
|
128
|
+
if ((sessionId && !sessions.has(sessionId)) ||
|
|
129
|
+
!config.enabled ||
|
|
130
|
+
(expectedClientId !== undefined && config.settings.clientId !== expectedClientId))
|
|
131
|
+
throw new HttpError(400, "Настройки изменились. Начните авторизацию заново");
|
|
132
|
+
return { ...config, credentials: { token, login: account.login } };
|
|
133
|
+
});
|
|
134
|
+
sessions.clear();
|
|
135
|
+
return githubStatus();
|
|
136
|
+
}
|
|
137
|
+
export async function connectGithub(body) {
|
|
138
|
+
return connect(text(body.token));
|
|
139
|
+
}
|
|
140
|
+
export async function disconnectGithub() {
|
|
141
|
+
sessions.clear();
|
|
142
|
+
await updateIntegration("github", (config) => ({ ...config, credentials: {} }));
|
|
143
|
+
return githubStatus();
|
|
144
|
+
}
|
|
145
|
+
export async function beginGithubLogin() {
|
|
146
|
+
const config = await integrationConfig("github");
|
|
147
|
+
if (!config.enabled || !config.settings.clientId)
|
|
148
|
+
throw new HttpError(400, "Включите GitHub и сохраните Client ID OAuth App с Device Flow");
|
|
149
|
+
const data = await oauth("device/code", { client_id: config.settings.clientId, scope: "repo" });
|
|
150
|
+
if (data.error ||
|
|
151
|
+
!data.device_code ||
|
|
152
|
+
!data.user_code ||
|
|
153
|
+
data.verification_uri !== "https://github.com/login/device")
|
|
154
|
+
throw new HttpError(400, "Не удалось начать вход. Проверьте Client ID и включение Device Flow в OAuth App");
|
|
155
|
+
sessions.clear();
|
|
156
|
+
const session = {
|
|
157
|
+
id: randomUUID(),
|
|
158
|
+
code: data.device_code,
|
|
159
|
+
clientId: config.settings.clientId,
|
|
160
|
+
expiresAt: Date.now() + Number(data.expires_in) * 1000,
|
|
161
|
+
interval: Number(data.interval) || 5,
|
|
162
|
+
nextPoll: 0,
|
|
163
|
+
};
|
|
164
|
+
session.nextPoll = Date.now() + session.interval * 1000;
|
|
165
|
+
sessions.set(session.id, session);
|
|
166
|
+
return {
|
|
167
|
+
id: session.id,
|
|
168
|
+
userCode: data.user_code,
|
|
169
|
+
verificationUri: data.verification_uri,
|
|
170
|
+
expiresAt: session.expiresAt,
|
|
171
|
+
interval: session.interval,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
export async function pollGithubLogin(body) {
|
|
175
|
+
const session = sessions.get(text(body.id));
|
|
176
|
+
if (!session || session.expiresAt <= Date.now()) {
|
|
177
|
+
if (session)
|
|
178
|
+
sessions.delete(session.id);
|
|
179
|
+
throw new HttpError(400, "Код входа истёк. Начните авторизацию заново");
|
|
180
|
+
}
|
|
181
|
+
if (Date.now() < session.nextPoll)
|
|
182
|
+
return {
|
|
183
|
+
pending: true,
|
|
184
|
+
interval: Math.max(1, Math.ceil((session.nextPoll - Date.now()) / 1000)),
|
|
185
|
+
};
|
|
186
|
+
session.nextPoll = Date.now() + 30_000;
|
|
187
|
+
const data = await oauth("oauth/access_token", {
|
|
188
|
+
client_id: session.clientId,
|
|
189
|
+
device_code: session.code,
|
|
190
|
+
grant_type: "urn:ietf:params:oauth:grant-type:device_code",
|
|
191
|
+
});
|
|
192
|
+
if (sessions.get(session.id) !== session)
|
|
193
|
+
throw new HttpError(400, "Авторизация отменена");
|
|
194
|
+
if (data.error === "authorization_pending" || data.error === "slow_down") {
|
|
195
|
+
if (data.error === "slow_down")
|
|
196
|
+
session.interval += 5;
|
|
197
|
+
session.nextPoll = Date.now() + session.interval * 1000;
|
|
198
|
+
return { pending: true, interval: session.interval };
|
|
199
|
+
}
|
|
200
|
+
if (!data.access_token) {
|
|
201
|
+
sessions.delete(session.id);
|
|
202
|
+
}
|
|
203
|
+
if (!data.access_token)
|
|
204
|
+
throw new HttpError(400, data.error === "access_denied"
|
|
205
|
+
? "Вход отменён в GitHub"
|
|
206
|
+
: "Не удалось завершить вход. Попробуйте снова");
|
|
207
|
+
return {
|
|
208
|
+
pending: false,
|
|
209
|
+
integration: await connect(data.access_token, session.clientId, session.id),
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
export async function githubRepositories(page) {
|
|
213
|
+
const config = await authorized();
|
|
214
|
+
if (!Number.isInteger(page) || page < 1 || page > 1000)
|
|
215
|
+
throw new HttpError(400, "Неверная страница");
|
|
216
|
+
const repos = await github(`/user/repos?per_page=50&page=${page}&sort=updated&affiliation=owner,collaborator,organization_member`, config.credentials.token);
|
|
217
|
+
return {
|
|
218
|
+
repositories: repos.map((repo) => ({
|
|
219
|
+
fullName: repo.full_name,
|
|
220
|
+
description: repo.description,
|
|
221
|
+
private: repo.private,
|
|
222
|
+
url: repo.html_url,
|
|
223
|
+
})),
|
|
224
|
+
page,
|
|
225
|
+
hasMore: repos.length === 50,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Launcher search over repositories. Empty text lists the account's most recently updated repositories;
|
|
230
|
+
* `owner/part` narrows to one owner. Public search works without a token.
|
|
231
|
+
*/
|
|
232
|
+
export async function searchGithubRepositories(text) {
|
|
233
|
+
const config = await integrationConfig("github");
|
|
234
|
+
const token = config.enabled ? config.credentials.token || "" : "";
|
|
235
|
+
const query = text.trim();
|
|
236
|
+
if (!query) {
|
|
237
|
+
if (!token)
|
|
238
|
+
throw new HttpError(401, "Войдите в GitHub в настройках интеграции");
|
|
239
|
+
return (await githubRepositories(1)).repositories.slice(0, 10).map((repo) => ({
|
|
240
|
+
fullName: repo.fullName,
|
|
241
|
+
description: repo.description ?? "",
|
|
242
|
+
private: repo.private,
|
|
243
|
+
}));
|
|
244
|
+
}
|
|
245
|
+
const slash = query.indexOf("/");
|
|
246
|
+
const owner = slash > 0 ? query.slice(0, slash) : "";
|
|
247
|
+
const rest = slash > 0 ? query.slice(slash + 1) : query;
|
|
248
|
+
if (owner && !/^[A-Za-z0-9][A-Za-z0-9-]*$/.test(owner))
|
|
249
|
+
throw new HttpError(400, "Неверное имя владельца");
|
|
250
|
+
const terms = rest.replace(/[^\w.\- ]/g, " ").trim();
|
|
251
|
+
const q = owner
|
|
252
|
+
? `${terms ? `${terms} in:name ` : ""}user:${owner}`
|
|
253
|
+
: `${terms} in:name,description`;
|
|
254
|
+
const found = await github(`/search/repositories?q=${encodeURIComponent(q)}&per_page=10`, token);
|
|
255
|
+
return found.items.map((repo) => ({
|
|
256
|
+
fullName: repo.full_name,
|
|
257
|
+
description: repo.description ?? "",
|
|
258
|
+
private: repo.private,
|
|
259
|
+
}));
|
|
260
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { github, githubGraphql, repositoryName } from "./api.js";
|
|
2
|
+
import { integrationConfig } from "../integration-store/index.js";
|
|
3
|
+
import { HttpError } from "../http/index.js";
|
|
4
|
+
import { fetchRemoteIcon, HTML_FILES, remoteIconCandidates } from "../projects/index.js";
|
|
5
|
+
export async function githubReader(repository) {
|
|
6
|
+
const name = repositoryName(repository);
|
|
7
|
+
const config = await integrationConfig("github");
|
|
8
|
+
const token = config.enabled ? config.credentials.token || "" : "";
|
|
9
|
+
return (path) => github(`/repos/${name}${path}`, token);
|
|
10
|
+
}
|
|
11
|
+
/** GraphQL counterpart of `githubReader`: variables carry `owner` and `name` of the repository. */
|
|
12
|
+
export async function githubGraphqlReader(repository) {
|
|
13
|
+
const [owner, name] = repositoryName(repository).split("/");
|
|
14
|
+
const config = await integrationConfig("github");
|
|
15
|
+
const token = config.enabled ? config.credentials.token || "" : "";
|
|
16
|
+
return (query, variables = {}) => githubGraphql(query, { owner, name, ...variables }, token);
|
|
17
|
+
}
|
|
18
|
+
function objectId(sha) {
|
|
19
|
+
if (!/^[a-f0-9]{40}$/.test(sha))
|
|
20
|
+
throw new HttpError(400, "Неверный Git object ID");
|
|
21
|
+
return sha;
|
|
22
|
+
}
|
|
23
|
+
export async function browseGithubRepository(repository, ref = "") {
|
|
24
|
+
const get = await githubReader(repository);
|
|
25
|
+
const repo = await get("");
|
|
26
|
+
const branch = ref || repo.default_branch;
|
|
27
|
+
const license = repo.license?.spdx_id && repo.license.spdx_id !== "NOASSERTION"
|
|
28
|
+
? repo.license.spdx_id
|
|
29
|
+
: repo.license?.name || "";
|
|
30
|
+
const result = {
|
|
31
|
+
fullName: repo.full_name,
|
|
32
|
+
description: repo.description || "",
|
|
33
|
+
branch,
|
|
34
|
+
private: repo.private,
|
|
35
|
+
owner: repo.owner?.login || repo.full_name.split("/")[0] || "",
|
|
36
|
+
avatarUrl: repo.owner?.avatar_url || "",
|
|
37
|
+
htmlUrl: repo.html_url || `https://github.com/${repo.full_name}`,
|
|
38
|
+
defaultBranch: repo.default_branch,
|
|
39
|
+
stars: repo.stargazers_count ?? 0,
|
|
40
|
+
forks: repo.forks_count ?? 0,
|
|
41
|
+
watchers: repo.subscribers_count ?? 0,
|
|
42
|
+
openIssues: repo.open_issues_count ?? 0,
|
|
43
|
+
language: repo.language || "",
|
|
44
|
+
license,
|
|
45
|
+
homepage: repo.homepage || "",
|
|
46
|
+
topics: Array.isArray(repo.topics) ? repo.topics : [],
|
|
47
|
+
createdAt: repo.created_at || "",
|
|
48
|
+
updatedAt: repo.updated_at || "",
|
|
49
|
+
};
|
|
50
|
+
try {
|
|
51
|
+
const commit = await get(`/commits/${encodeURIComponent(branch)}`);
|
|
52
|
+
return { ...result, commit: commit.sha, tree: commit.commit.tree.sha, empty: false };
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
if (!ref &&
|
|
56
|
+
error instanceof HttpError &&
|
|
57
|
+
(error.status === 409 || (error.status === 404 && repo.size === 0)))
|
|
58
|
+
return { ...result, commit: "", tree: "", empty: true };
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export async function browseGithubTree(repository, sha) {
|
|
63
|
+
objectId(sha);
|
|
64
|
+
const get = await githubReader(repository);
|
|
65
|
+
const data = await get(`/git/trees/${sha}`);
|
|
66
|
+
return {
|
|
67
|
+
entries: data.tree
|
|
68
|
+
.map((entry) => ({
|
|
69
|
+
name: entry.path,
|
|
70
|
+
sha: entry.sha,
|
|
71
|
+
type: entry.type,
|
|
72
|
+
mode: entry.mode,
|
|
73
|
+
size: entry.size ?? 0,
|
|
74
|
+
}))
|
|
75
|
+
.sort((a, b) => Number(b.type === "tree") - Number(a.type === "tree") || a.name.localeCompare(b.name)),
|
|
76
|
+
truncated: data.truncated,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const LIMIT = 5 * 1024 * 1024;
|
|
80
|
+
const IMAGE_MIME = {
|
|
81
|
+
png: "image/png",
|
|
82
|
+
jpg: "image/jpeg",
|
|
83
|
+
jpeg: "image/jpeg",
|
|
84
|
+
gif: "image/gif",
|
|
85
|
+
webp: "image/webp",
|
|
86
|
+
avif: "image/avif",
|
|
87
|
+
ico: "image/x-icon",
|
|
88
|
+
svg: "image/svg+xml",
|
|
89
|
+
};
|
|
90
|
+
export async function browseGithubFile(repository, sha, path) {
|
|
91
|
+
objectId(sha);
|
|
92
|
+
const get = await githubReader(repository);
|
|
93
|
+
const blob = await get(`/git/blobs/${sha}`);
|
|
94
|
+
if (blob.size > LIMIT)
|
|
95
|
+
throw new HttpError(413, "Просмотр файлов больше 5 MiB пока недоступен");
|
|
96
|
+
if (blob.encoding !== "base64")
|
|
97
|
+
throw new HttpError(400, "GitHub вернул неподдерживаемую кодировку");
|
|
98
|
+
const bytes = Buffer.from(blob.content, "base64");
|
|
99
|
+
const extension = path.split(".").pop()?.toLowerCase() || "";
|
|
100
|
+
const mime = IMAGE_MIME[extension];
|
|
101
|
+
const content = bytes.toString("utf8");
|
|
102
|
+
const binary = bytes.includes(0) || !Buffer.from(content).equals(bytes);
|
|
103
|
+
return {
|
|
104
|
+
content: binary ? "" : content,
|
|
105
|
+
image: mime ? `data:${mime};base64,${bytes.toString("base64")}` : null,
|
|
106
|
+
binary,
|
|
107
|
+
size: bytes.length,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
export async function browseGithubCommitAsset(repository, commit, path) {
|
|
111
|
+
objectId(commit);
|
|
112
|
+
const get = await githubReader(repository);
|
|
113
|
+
const info = await get(`/git/commits/${commit}`);
|
|
114
|
+
return browseGithubAsset(repository, info.tree.sha, path);
|
|
115
|
+
}
|
|
116
|
+
async function githubBlobAsset(repository, sha, path) {
|
|
117
|
+
const file = await browseGithubFile(repository, sha, path);
|
|
118
|
+
if (!file.image)
|
|
119
|
+
throw new HttpError(400, "Неподдерживаемое изображение");
|
|
120
|
+
const [header, content] = file.image.split(",");
|
|
121
|
+
return { mime: header.slice(5).split(";")[0], bytes: Buffer.from(content, "base64") };
|
|
122
|
+
}
|
|
123
|
+
export async function browseGithubAsset(repository, root, path) {
|
|
124
|
+
objectId(root);
|
|
125
|
+
const parts = path.split("/");
|
|
126
|
+
if (parts.some((part) => !part || part === "." || part === "..") ||
|
|
127
|
+
path.includes("\\") ||
|
|
128
|
+
path.includes("\0"))
|
|
129
|
+
throw new HttpError(400, "Неверный путь изображения");
|
|
130
|
+
let sha = root;
|
|
131
|
+
for (const [index, name] of parts.entries()) {
|
|
132
|
+
const data = await browseGithubTree(repository, sha);
|
|
133
|
+
const entry = data.entries.find((item) => item.name === name);
|
|
134
|
+
if (!entry)
|
|
135
|
+
throw new HttpError(404, "Изображение не найдено");
|
|
136
|
+
if (index < parts.length - 1) {
|
|
137
|
+
if (entry.type !== "tree")
|
|
138
|
+
throw new HttpError(404, "Папка не найдена");
|
|
139
|
+
sha = entry.sha;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
if (entry.type !== "blob" || entry.mode === "120000")
|
|
143
|
+
throw new HttpError(400, "Выберите изображение");
|
|
144
|
+
if (entry.size > LIMIT)
|
|
145
|
+
throw new HttpError(413, "Изображение больше 5 MiB");
|
|
146
|
+
return githubBlobAsset(repository, entry.sha, path);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
throw new HttpError(404, "Изображение не найдено");
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Project logo from the repository itself: an icon linked by its HTML pages or one of the usual
|
|
153
|
+
* favicon/logo files. `null` means the repository has no such file.
|
|
154
|
+
*/
|
|
155
|
+
export async function browseGithubIcon(repository, ref = "") {
|
|
156
|
+
const get = await githubReader(repository);
|
|
157
|
+
const repo = await get("");
|
|
158
|
+
const avatar = await fetchRemoteIcon(repo.owner?.avatar_url || "");
|
|
159
|
+
if (avatar)
|
|
160
|
+
return avatar;
|
|
161
|
+
const branch = ref || repo.default_branch || "";
|
|
162
|
+
if (!branch)
|
|
163
|
+
return null;
|
|
164
|
+
const head = await get(`/commits/${encodeURIComponent(branch)}`);
|
|
165
|
+
const tree = head.commit.tree.sha;
|
|
166
|
+
const data = await get(`/git/trees/${tree}?recursive=1`);
|
|
167
|
+
const blobs = new Map();
|
|
168
|
+
for (const entry of data.tree)
|
|
169
|
+
if (entry.type === "blob")
|
|
170
|
+
blobs.set(entry.path, { sha: entry.sha, size: entry.size });
|
|
171
|
+
const pages = [];
|
|
172
|
+
for (const path of HTML_FILES) {
|
|
173
|
+
const entry = blobs.get(path);
|
|
174
|
+
if (!entry || (entry.size ?? 0) > 512 * 1024)
|
|
175
|
+
continue;
|
|
176
|
+
const file = await browseGithubFile(repository, entry.sha, path).catch(() => null);
|
|
177
|
+
if (file && !file.binary)
|
|
178
|
+
pages.push({ path, content: file.content });
|
|
179
|
+
}
|
|
180
|
+
const iconPath = remoteIconCandidates(pages, new Set(blobs.keys()))[0];
|
|
181
|
+
if (!iconPath)
|
|
182
|
+
return null;
|
|
183
|
+
const entry = blobs.get(iconPath);
|
|
184
|
+
return entry ? githubBlobAsset(repository, entry.sha, iconPath) : null;
|
|
185
|
+
}
|