@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,245 @@
|
|
|
1
|
+
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { os } from "../../../core/modules/os/index.js";
|
|
5
|
+
import { environmentForPath, runEnvironmentCommand } from "../environments/index.js";
|
|
6
|
+
import { integrationConfig } from "../integration-store/index.js";
|
|
7
|
+
import { gitlabAccessToken, gitlabBaseUrl } from "../gitlab/index.js";
|
|
8
|
+
import { HttpError } from "../http/index.js";
|
|
9
|
+
import { git, serializeGitWrite } from "./git.js";
|
|
10
|
+
import { projectBranches } from "./git-branches.js";
|
|
11
|
+
/** Network operations wait for the remote, not just for the local command. */
|
|
12
|
+
const TIMEOUT = 120_000;
|
|
13
|
+
function httpsHost(remote) {
|
|
14
|
+
try {
|
|
15
|
+
const url = new URL(remote);
|
|
16
|
+
return url.protocol === "https:" ? url.hostname.toLowerCase() : null;
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** Credentials of a matching integration; a self-hosted GitLab token never follows a gitlab.com link. */
|
|
23
|
+
async function credentialsFor(root, remote, push) {
|
|
24
|
+
const url = (await git(root, ["remote", "get-url", ...(push ? ["--push"] : []), remote]).catch(() => "")).trim();
|
|
25
|
+
const host = httpsHost(url);
|
|
26
|
+
if (!host)
|
|
27
|
+
return undefined;
|
|
28
|
+
if (host === "github.com") {
|
|
29
|
+
const config = await integrationConfig("github");
|
|
30
|
+
const token = config.enabled ? config.credentials.token || "" : "";
|
|
31
|
+
return token
|
|
32
|
+
? { username: "x-access-token", tokenEnv: "PROJECTOR_GITHUB_TOKEN", token }
|
|
33
|
+
: undefined;
|
|
34
|
+
}
|
|
35
|
+
const config = await integrationConfig("gitlab");
|
|
36
|
+
if (!config.enabled || !config.credentials.token)
|
|
37
|
+
return undefined;
|
|
38
|
+
let base;
|
|
39
|
+
let configured;
|
|
40
|
+
try {
|
|
41
|
+
base = gitlabBaseUrl(config.settings.url);
|
|
42
|
+
configured = new URL(base).hostname.toLowerCase();
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
base = "https://gitlab.com";
|
|
46
|
+
configured = "gitlab.com";
|
|
47
|
+
}
|
|
48
|
+
if (host !== configured)
|
|
49
|
+
return undefined;
|
|
50
|
+
// A gitlab.com alias must not receive a token meant for a private instance.
|
|
51
|
+
if (host === "gitlab.com" && configured !== "gitlab.com")
|
|
52
|
+
return undefined;
|
|
53
|
+
const token = await gitlabAccessToken(base, config.credentials).catch(() => config.credentials.token || "");
|
|
54
|
+
return token ? { username: "oauth2", tokenEnv: "PROJECTOR_GITLAB_TOKEN", token } : undefined;
|
|
55
|
+
}
|
|
56
|
+
function assertToken(token) {
|
|
57
|
+
if (token.includes("\n") || token.includes("\r"))
|
|
58
|
+
throw new HttpError(409, "Некорректный токен интеграции");
|
|
59
|
+
}
|
|
60
|
+
function quote(shellWord) {
|
|
61
|
+
return `'${shellWord.replaceAll("'", "'\\''")}'`;
|
|
62
|
+
}
|
|
63
|
+
const containerScript = (auth) => String.raw `cat > /tmp/projector-askpass <<'PROJECTOR_ASKPASS'
|
|
64
|
+
#!/bin/sh
|
|
65
|
+
case "$1" in
|
|
66
|
+
*Username*) printf "%s\n" ${quote(auth.username)} ;;
|
|
67
|
+
*) printf "%s\n" "$${auth.tokenEnv}" ;;
|
|
68
|
+
esac
|
|
69
|
+
PROJECTOR_ASKPASS
|
|
70
|
+
chmod 700 /tmp/projector-askpass
|
|
71
|
+
export GIT_ASKPASS=/tmp/projector-askpass GIT_TERMINAL_PROMPT=0
|
|
72
|
+
exec /usr/bin/git --literal-pathspecs -c credential.helper= -c http.followRedirects=false -C /workspace "$@"`;
|
|
73
|
+
async function runInEnvironment(environment, args, auth) {
|
|
74
|
+
const helper = await mkdtemp(join(tmpdir(), "projector-git-"));
|
|
75
|
+
const credentials = auth ? join(helper, "credentials") : undefined;
|
|
76
|
+
try {
|
|
77
|
+
if (auth && credentials) {
|
|
78
|
+
assertToken(auth.token);
|
|
79
|
+
await writeFile(credentials, `${auth.tokenEnv}=${auth.token}\n`, { mode: 0o600 });
|
|
80
|
+
await os.tools.restrictToOwner(credentials);
|
|
81
|
+
}
|
|
82
|
+
const command = auth
|
|
83
|
+
? [
|
|
84
|
+
"/bin/bash",
|
|
85
|
+
"--noprofile",
|
|
86
|
+
"--norc",
|
|
87
|
+
"-c",
|
|
88
|
+
containerScript(auth),
|
|
89
|
+
"projector-git",
|
|
90
|
+
...args,
|
|
91
|
+
]
|
|
92
|
+
: ["/usr/bin/git", "--literal-pathspecs", "-C", "/workspace", ...args];
|
|
93
|
+
return (await runEnvironmentCommand(environment, command, TIMEOUT, undefined, credentials))
|
|
94
|
+
.stdout;
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
await rm(helper, { recursive: true, force: true });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/** Runs a network command with the matching integration token; the token stays out of argv and errors. */
|
|
101
|
+
async function runRemote(root, args, remote, push = false) {
|
|
102
|
+
const auth = await credentialsFor(root, remote, push);
|
|
103
|
+
const environment = await environmentForPath(root);
|
|
104
|
+
if (environment)
|
|
105
|
+
return runInEnvironment(environment, args, auth);
|
|
106
|
+
if (!auth)
|
|
107
|
+
return git(root, args, { timeout: TIMEOUT, env: { GIT_TERMINAL_PROMPT: "0" } });
|
|
108
|
+
assertToken(auth.token);
|
|
109
|
+
const helper = await mkdtemp(join(tmpdir(), "projector-git-"));
|
|
110
|
+
try {
|
|
111
|
+
const script = os.tools.gitAskpass(auth);
|
|
112
|
+
const askpass = join(helper, script.filename);
|
|
113
|
+
await writeFile(askpass, script.contents, { mode: 0o700 });
|
|
114
|
+
return await git(root, ["-c", "credential.helper=", "-c", "http.followRedirects=false", ...args], {
|
|
115
|
+
timeout: TIMEOUT,
|
|
116
|
+
env: {
|
|
117
|
+
GIT_ASKPASS: askpass,
|
|
118
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
119
|
+
[auth.tokenEnv]: auth.token,
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
finally {
|
|
124
|
+
await rm(helper, { recursive: true, force: true });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function redact(text) {
|
|
128
|
+
return text
|
|
129
|
+
.replace(/(https?:\/\/)[^\s/@]+@/gi, "$1***@")
|
|
130
|
+
.replace(/([?&](?:token|access_token|private_token)=)[^\s&]+/gi, "$1***");
|
|
131
|
+
}
|
|
132
|
+
async function run(root, args, remote, push = false) {
|
|
133
|
+
try {
|
|
134
|
+
return await runRemote(root, args, remote, push);
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
const raw = String(error?.stderr ?? (error instanceof Error ? error.message : error));
|
|
138
|
+
const lines = redact(raw)
|
|
139
|
+
.split("\n")
|
|
140
|
+
.map((line) => line.trim())
|
|
141
|
+
.filter(Boolean)
|
|
142
|
+
.slice(0, 6)
|
|
143
|
+
.join("\n");
|
|
144
|
+
throw new HttpError(409, lines || "Операция Git не выполнена");
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
async function currentBranch(root) {
|
|
148
|
+
const branches = await projectBranches(root);
|
|
149
|
+
if (!branches.available)
|
|
150
|
+
throw new HttpError(404, "Здесь нет Git-репозитория");
|
|
151
|
+
const current = branches.branches.find((branch) => branch.current);
|
|
152
|
+
if (!current || branches.detached)
|
|
153
|
+
throw new HttpError(409, "Сначала переключитесь на ветку, а не на отдельный коммит");
|
|
154
|
+
return { branches, current };
|
|
155
|
+
}
|
|
156
|
+
/** The configured remote of a branch; push may use a separate pushRemote or remote.pushDefault. */
|
|
157
|
+
async function remoteOf(root, branches, branch, action) {
|
|
158
|
+
const config = (key) => git(root, ["config", "--get", key])
|
|
159
|
+
.then((value) => value.trim())
|
|
160
|
+
.catch(() => "");
|
|
161
|
+
const fallback = branches.remotes.includes("origin") ? "origin" : branches.remotes[0];
|
|
162
|
+
const remote = action === "push"
|
|
163
|
+
? (await config(`branch.${branch.name}.pushRemote`)) ||
|
|
164
|
+
(await config("remote.pushDefault")) ||
|
|
165
|
+
(await config(`branch.${branch.name}.remote`)) ||
|
|
166
|
+
fallback
|
|
167
|
+
: (await config(`branch.${branch.name}.remote`)) || fallback;
|
|
168
|
+
if (!remote || !branches.remotes.includes(remote))
|
|
169
|
+
throw new HttpError(409, "У репозитория нет удалённого репозитория для этой ветки");
|
|
170
|
+
return remote;
|
|
171
|
+
}
|
|
172
|
+
// One network operation per repository; the index queue stays separate for quick local work.
|
|
173
|
+
const pendingNetwork = new Map();
|
|
174
|
+
async function serializeNetwork(root, operation) {
|
|
175
|
+
const key = (await git(root, ["rev-parse", "--absolute-git-dir"]).catch(() => root)).trim();
|
|
176
|
+
const previous = pendingNetwork.get(key);
|
|
177
|
+
const current = (async () => {
|
|
178
|
+
await previous?.catch(() => { });
|
|
179
|
+
return operation();
|
|
180
|
+
})();
|
|
181
|
+
pendingNetwork.set(key, current);
|
|
182
|
+
try {
|
|
183
|
+
return await current;
|
|
184
|
+
}
|
|
185
|
+
finally {
|
|
186
|
+
if (pendingNetwork.get(key) === current)
|
|
187
|
+
pendingNetwork.delete(key);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
export async function mutateProjectSync(root, action) {
|
|
191
|
+
if (!["fetch", "pull", "push"].includes(action))
|
|
192
|
+
throw new HttpError(400, "Неизвестное действие синхронизации");
|
|
193
|
+
const operation = action;
|
|
194
|
+
const { branches, current } = await currentBranch(root);
|
|
195
|
+
const remote = await remoteOf(root, branches, current, operation);
|
|
196
|
+
if (operation === "pull") {
|
|
197
|
+
if (!current.upstream || current.gone)
|
|
198
|
+
throw new HttpError(409, "У ветки нет upstream. Отправьте ветку, чтобы создать его");
|
|
199
|
+
return serializeNetwork(root, () => serializeGitWrite(root, async () => {
|
|
200
|
+
const output = await run(root, ["pull", "--ff-only"], remote);
|
|
201
|
+
const fresh = await projectBranches(root);
|
|
202
|
+
const upToDate = /already up[ -]to[ -]date|уже актуально/i.test(output);
|
|
203
|
+
return {
|
|
204
|
+
action: operation,
|
|
205
|
+
branches: fresh,
|
|
206
|
+
message: upToDate ? "Уже актуально" : "Изменения получены",
|
|
207
|
+
};
|
|
208
|
+
}));
|
|
209
|
+
}
|
|
210
|
+
if (operation === "fetch") {
|
|
211
|
+
return serializeNetwork(root, async () => {
|
|
212
|
+
await run(root, ["fetch", "--prune", remote], remote);
|
|
213
|
+
return {
|
|
214
|
+
action: operation,
|
|
215
|
+
branches: await projectBranches(root),
|
|
216
|
+
message: "Удалённые ветки обновлены",
|
|
217
|
+
};
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
return serializeNetwork(root, async () => {
|
|
221
|
+
// A missing or deleted upstream is published again, like «Publish branch» in an editor.
|
|
222
|
+
const publish = !current.upstream || current.gone;
|
|
223
|
+
const ahead = current.ahead;
|
|
224
|
+
const merge = publish
|
|
225
|
+
? ""
|
|
226
|
+
: (await git(root, ["config", "--get", `branch.${current.name}.merge`]).catch(() => "")).trim();
|
|
227
|
+
const target = merge.startsWith("refs/heads/")
|
|
228
|
+
? merge.slice("refs/heads/".length)
|
|
229
|
+
: current.name;
|
|
230
|
+
const args = publish
|
|
231
|
+
? ["push", "--set-upstream", remote, current.name]
|
|
232
|
+
: ["push", remote, `${current.name}:${target}`];
|
|
233
|
+
await run(root, args, remote, true);
|
|
234
|
+
const fresh = await projectBranches(root);
|
|
235
|
+
return {
|
|
236
|
+
action: operation,
|
|
237
|
+
branches: fresh,
|
|
238
|
+
message: publish
|
|
239
|
+
? `Ветка ${current.name} опубликована`
|
|
240
|
+
: ahead > 0
|
|
241
|
+
? `Отправлено коммитов: ${ahead}`
|
|
242
|
+
: "Нечего отправлять",
|
|
243
|
+
};
|
|
244
|
+
});
|
|
245
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { HttpError } from "../http/index.js";
|
|
2
|
+
import { LARGE_FILE_BYTES, MAX_TEXT_BYTES, isExcludedPath, treePageRange, } from "../../../core/modules/workspace/index.js";
|
|
3
|
+
import { git, gitBytes, gitText } from "./git.js";
|
|
4
|
+
import { excludePatterns } from "./files-exclude.js";
|
|
5
|
+
import { imageType, isRasterImage } from "./files.js";
|
|
6
|
+
import { MAX_BYTES, validatePath } from "./paths.js";
|
|
7
|
+
const COMMIT = /^[0-9a-f]{7,40}$/i;
|
|
8
|
+
export async function resolveRevision(root, rev) {
|
|
9
|
+
if (!COMMIT.test(rev))
|
|
10
|
+
throw new HttpError(400, "Некорректный хеш коммита");
|
|
11
|
+
const full = (await git(root, ["rev-parse", "--verify", "--quiet", `${rev}^{commit}`]).catch(() => "")).trim();
|
|
12
|
+
if (!full)
|
|
13
|
+
throw new HttpError(404, "Коммит не найден");
|
|
14
|
+
return full;
|
|
15
|
+
}
|
|
16
|
+
export function validateRelativePath(path) {
|
|
17
|
+
validatePath(path);
|
|
18
|
+
if (path.includes("\\"))
|
|
19
|
+
throw new HttpError(403, "Некорректный путь");
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Directory of a committed tree. Git names entries relative to the project folder, so the same
|
|
23
|
+
* paging and exclusion contract as the working tree applies; only the source of the listing differs.
|
|
24
|
+
*/
|
|
25
|
+
export async function listProjectGitTree(root, rev, path = "", params = {}) {
|
|
26
|
+
const commit = await resolveRevision(root, rev);
|
|
27
|
+
validateRelativePath(path);
|
|
28
|
+
const args = ["ls-tree", "-z", commit];
|
|
29
|
+
// A trailing slash asks git for the contents of the directory, not the directory entry itself.
|
|
30
|
+
if (path)
|
|
31
|
+
args.push("--", `${path}/`);
|
|
32
|
+
const raw = await git(root, args);
|
|
33
|
+
const patterns = await excludePatterns();
|
|
34
|
+
const entries = [];
|
|
35
|
+
for (const row of raw.split("\0")) {
|
|
36
|
+
if (!row)
|
|
37
|
+
continue;
|
|
38
|
+
const tab = row.indexOf("\t");
|
|
39
|
+
if (tab < 0)
|
|
40
|
+
continue;
|
|
41
|
+
const [mode = "", type = ""] = row.slice(0, tab).split(" ");
|
|
42
|
+
const entryPath = row.slice(tab + 1);
|
|
43
|
+
if (!entryPath || isExcludedPath(entryPath, patterns))
|
|
44
|
+
continue;
|
|
45
|
+
const name = entryPath.split("/").at(-1);
|
|
46
|
+
if (!name)
|
|
47
|
+
continue;
|
|
48
|
+
entries.push({
|
|
49
|
+
name,
|
|
50
|
+
path: entryPath,
|
|
51
|
+
directory: type === "tree",
|
|
52
|
+
...(mode === "100755" ? { executable: true } : {}),
|
|
53
|
+
...(type === "commit" ? { disabled: true } : {}),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
entries.sort((a, b) => Number(b.directory) - Number(a.directory) || a.name.localeCompare(b.name));
|
|
57
|
+
let page;
|
|
58
|
+
try {
|
|
59
|
+
page = treePageRange(entries, path, params);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
throw new HttpError(400, error instanceof Error ? error.message : "Неверная страница");
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
entries: entries.slice(page.offset, page.end),
|
|
66
|
+
truncated: page.nextOffset !== null,
|
|
67
|
+
total: page.total,
|
|
68
|
+
nextOffset: page.nextOffset,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Text of a committed file; the answer is always read-only. */
|
|
72
|
+
/** Raw image bytes of a committed file; raster images are shown by URL, SVG is read as text. */
|
|
73
|
+
export async function readProjectGitImage(root, rev, path) {
|
|
74
|
+
validateRelativePath(path);
|
|
75
|
+
const type = imageType(path);
|
|
76
|
+
if (!type)
|
|
77
|
+
throw new HttpError(415, "Поддерживаются только изображения");
|
|
78
|
+
const commit = await resolveRevision(root, rev);
|
|
79
|
+
const prefix = (await git(root, ["rev-parse", "--show-prefix"])).trim();
|
|
80
|
+
const spec = `${commit}:${prefix}${path}`;
|
|
81
|
+
const kind = (await git(root, ["cat-file", "-t", spec]).catch(() => "")).trim();
|
|
82
|
+
if (kind !== "blob")
|
|
83
|
+
throw new HttpError(404, "Изображение не найдено в этом коммите");
|
|
84
|
+
const size = Number((await git(root, ["cat-file", "-s", spec])).trim());
|
|
85
|
+
const limit = 8 * MAX_BYTES;
|
|
86
|
+
if (!Number.isSafeInteger(size) || size < 0)
|
|
87
|
+
throw new HttpError(404, "Изображение не найдено в этом коммите");
|
|
88
|
+
if (size > limit)
|
|
89
|
+
throw new HttpError(413, "Изображение больше 8 МБ");
|
|
90
|
+
return { type, content: await gitBytes(root, ["show", spec], limit + 1) };
|
|
91
|
+
}
|
|
92
|
+
export async function readProjectGitFile(root, rev, path, options = {}) {
|
|
93
|
+
const commit = await resolveRevision(root, rev);
|
|
94
|
+
validateRelativePath(path);
|
|
95
|
+
if (!path)
|
|
96
|
+
throw new HttpError(400, "Выберите файл");
|
|
97
|
+
const prefix = (await git(root, ["rev-parse", "--show-prefix"])).trim();
|
|
98
|
+
const spec = `${commit}:${prefix}${path}`;
|
|
99
|
+
const type = (await git(root, ["cat-file", "-t", spec]).catch(() => "")).trim();
|
|
100
|
+
if (!type)
|
|
101
|
+
throw new HttpError(404, "Файл не найден в этом коммите");
|
|
102
|
+
if (type !== "blob")
|
|
103
|
+
throw new HttpError(400, "Выберите файл");
|
|
104
|
+
const size = Number((await git(root, ["cat-file", "-s", spec])).trim());
|
|
105
|
+
if (!Number.isSafeInteger(size) || size < 0)
|
|
106
|
+
throw new HttpError(404, "Файл не найден в этом коммите");
|
|
107
|
+
if (isRasterImage(path)) {
|
|
108
|
+
if (size > 8 * MAX_BYTES)
|
|
109
|
+
throw new HttpError(413, "Изображение больше 8 МБ");
|
|
110
|
+
return { path, content: "", image: true, readonly: true, size };
|
|
111
|
+
}
|
|
112
|
+
if (size > MAX_TEXT_BYTES)
|
|
113
|
+
throw new HttpError(413, `Файл больше ${MAX_TEXT_BYTES / 1024 / 1024} МБ: редактор не сможет его открыть`);
|
|
114
|
+
if (options.ask && size >= LARGE_FILE_BYTES)
|
|
115
|
+
return { path, content: "", large: size, readonly: true };
|
|
116
|
+
try {
|
|
117
|
+
return { path, content: await gitText(root, commit, path), readonly: true, size };
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
if (error instanceof HttpError && error.status === 415)
|
|
121
|
+
return { path, content: "", binary: true, size, readonly: true };
|
|
122
|
+
if (error instanceof HttpError)
|
|
123
|
+
throw error;
|
|
124
|
+
throw new HttpError(404, "Файл не найден в этом коммите");
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { os } from "../../../core/modules/os/index.js";
|
|
2
|
+
import { environmentForPath, runEnvironmentCommand } from "../environments/index.js";
|
|
3
|
+
import { lstat, realpath } from "node:fs/promises";
|
|
4
|
+
import { HttpError } from "../http/index.js";
|
|
5
|
+
import { githubRepositoryFromRemote } from "../../../core/modules/github/index.js";
|
|
6
|
+
import { GITLAB_DEFAULT_INSTANCE, gitlabRepositoryFromRemote, normalizeGitlabInstance, normalizeGitlabProjectPath, } from "../../../core/modules/gitlab/index.js";
|
|
7
|
+
import { integrationConfig } from "../integration-store/index.js";
|
|
8
|
+
import { gitlabBaseUrl } from "../gitlab/index.js";
|
|
9
|
+
import { MAX_BYTES, decode, exec, location, pathExcluded, validatePath } from "./paths.js";
|
|
10
|
+
import { isExcludedPath } from "../../../core/modules/workspace/index.js";
|
|
11
|
+
import { excludePatterns } from "./files-exclude.js";
|
|
12
|
+
import { mutateProjectEntry, mutationLocation, readProjectFile } from "./files.js";
|
|
13
|
+
import { MAX_TEXT_BYTES } from "../../../core/modules/workspace/index.js";
|
|
14
|
+
export async function git(root, args, options = {}) {
|
|
15
|
+
const settings = typeof options === "number" ? { maxBuffer: options } : options;
|
|
16
|
+
const maxBuffer = settings.maxBuffer ?? 4 * MAX_BYTES;
|
|
17
|
+
const timeout = settings.timeout ?? 10_000;
|
|
18
|
+
const project = await environmentForPath(root);
|
|
19
|
+
if (project)
|
|
20
|
+
return (await runEnvironmentCommand(project, [
|
|
21
|
+
"/usr/bin/git",
|
|
22
|
+
"--literal-pathspecs",
|
|
23
|
+
"-c",
|
|
24
|
+
"core.hooksPath=/dev/null",
|
|
25
|
+
"-C",
|
|
26
|
+
"/workspace",
|
|
27
|
+
...args,
|
|
28
|
+
], timeout)).stdout;
|
|
29
|
+
return (await exec("git", ["--literal-pathspecs", "-C", root, ...args], {
|
|
30
|
+
windowsHide: true,
|
|
31
|
+
maxBuffer,
|
|
32
|
+
timeout,
|
|
33
|
+
env: {
|
|
34
|
+
...process.env,
|
|
35
|
+
GIT_OPTIONAL_LOCKS: "0",
|
|
36
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
37
|
+
...settings.env,
|
|
38
|
+
},
|
|
39
|
+
})).stdout;
|
|
40
|
+
}
|
|
41
|
+
/** Binary output of a read-only Git command; text commands still use `git`. */
|
|
42
|
+
export async function gitBytes(root, args, maxBuffer = 8 * MAX_BYTES) {
|
|
43
|
+
const project = await environmentForPath(root);
|
|
44
|
+
if (project)
|
|
45
|
+
throw new HttpError(501, "Изображения из контейнера пока недоступны");
|
|
46
|
+
return (await exec("git", ["--literal-pathspecs", "-C", root, ...args], {
|
|
47
|
+
windowsHide: true,
|
|
48
|
+
maxBuffer,
|
|
49
|
+
timeout: 10000,
|
|
50
|
+
encoding: "buffer",
|
|
51
|
+
env: { ...process.env, GIT_OPTIONAL_LOCKS: "0" },
|
|
52
|
+
})).stdout;
|
|
53
|
+
}
|
|
54
|
+
/** `owner/repository` when the project's `origin` points at GitHub, otherwise null. */
|
|
55
|
+
export async function projectGithubRepository(root) {
|
|
56
|
+
const remote = await git(root, ["remote", "get-url", "origin"]).catch(() => "");
|
|
57
|
+
return githubRepositoryFromRemote(remote);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* GitLab instance and project path when the project's `origin` points at GitLab, otherwise null.
|
|
61
|
+
* A self-hosted remote is accepted only for the configured instance; the install prefix of that
|
|
62
|
+
* instance is removed from the path, and credentials of the remote never leave this function.
|
|
63
|
+
*/
|
|
64
|
+
export async function projectGitlabRepository(root) {
|
|
65
|
+
const remote = await git(root, ["remote", "get-url", "origin"]).catch(() => "");
|
|
66
|
+
const repository = gitlabRepositoryFromRemote(remote);
|
|
67
|
+
if (!repository)
|
|
68
|
+
return null;
|
|
69
|
+
let configured = GITLAB_DEFAULT_INSTANCE;
|
|
70
|
+
let configuredHost = GITLAB_DEFAULT_INSTANCE;
|
|
71
|
+
let prefix = "";
|
|
72
|
+
try {
|
|
73
|
+
const base = new URL(gitlabBaseUrl((await integrationConfig("gitlab")).settings.url));
|
|
74
|
+
configured = normalizeGitlabInstance(base.origin);
|
|
75
|
+
// SSH and scp remotes carry no web port, so the host alone identifies the same instance.
|
|
76
|
+
configuredHost = normalizeGitlabInstance(base.hostname);
|
|
77
|
+
prefix = base.pathname.replace(/^\/+|\/+$/g, "");
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// An unusable setting must not break local projects: only gitlab.com stays reachable.
|
|
81
|
+
}
|
|
82
|
+
if (repository.instance !== configured &&
|
|
83
|
+
repository.instance !== configuredHost &&
|
|
84
|
+
repository.instance !== GITLAB_DEFAULT_INSTANCE)
|
|
85
|
+
return null;
|
|
86
|
+
// SSH remotes name the host without the web port; canonical links use the configured instance.
|
|
87
|
+
const instance = repository.instance === configuredHost ? configured : repository.instance;
|
|
88
|
+
let path = repository.path;
|
|
89
|
+
if (prefix &&
|
|
90
|
+
(repository.instance === configured || repository.instance === configuredHost) &&
|
|
91
|
+
path.startsWith(`${prefix}/`))
|
|
92
|
+
path = path.slice(prefix.length + 1);
|
|
93
|
+
try {
|
|
94
|
+
return { instance, path: normalizeGitlabProjectPath(path) };
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export async function projectGit(root) {
|
|
101
|
+
try {
|
|
102
|
+
await git(root, ["rev-parse", "--show-toplevel"]);
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return { available: false, branch: "", changes: [] };
|
|
106
|
+
}
|
|
107
|
+
const prefix = (await git(root, ["rev-parse", "--show-prefix"])).trim();
|
|
108
|
+
const branch = (await git(root, ["symbolic-ref", "--short", "HEAD"]).catch(() => git(root, ["rev-parse", "--short", "HEAD"]))).trim();
|
|
109
|
+
const rows = (await git(root, ["status", "--porcelain=v1", "-z", "--untracked-files=all", "--", "."])).split("\0");
|
|
110
|
+
const changes = [];
|
|
111
|
+
for (let i = 0; i < rows.length; i++) {
|
|
112
|
+
const row = rows[i];
|
|
113
|
+
if (!row)
|
|
114
|
+
continue;
|
|
115
|
+
const path = row.slice(3);
|
|
116
|
+
const rename = /[RC]/.test(row.slice(0, 2));
|
|
117
|
+
const original = rename ? rows[++i] : undefined;
|
|
118
|
+
if (!path.startsWith(prefix))
|
|
119
|
+
continue;
|
|
120
|
+
if (path.slice(prefix.length).split("/").includes(".projector-trash"))
|
|
121
|
+
continue;
|
|
122
|
+
changes.push({
|
|
123
|
+
path: path.slice(prefix.length),
|
|
124
|
+
originalPath: original?.startsWith(prefix) ? original.slice(prefix.length) : undefined,
|
|
125
|
+
index: row[0],
|
|
126
|
+
worktree: row[1],
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
await Promise.all(changes.map(async (change) => {
|
|
130
|
+
change.executable = await location(root, change.path)
|
|
131
|
+
.then((full) => lstat(full).then((info) => info.isFile() && os.tools.isExecutableFile(change.path, info.mode)))
|
|
132
|
+
.catch(() => false);
|
|
133
|
+
}));
|
|
134
|
+
return { available: true, branch, changes };
|
|
135
|
+
}
|
|
136
|
+
// Serialize index writes even when multiple SDK clients act at once.
|
|
137
|
+
const pendingGitWrites = new Map();
|
|
138
|
+
/** Runs a write after the pending ones of the same repository finished. */
|
|
139
|
+
export async function serializeGitWrite(root, write) {
|
|
140
|
+
const repository = (await git(root, ["rev-parse", "--absolute-git-dir"])).trim();
|
|
141
|
+
const previous = pendingGitWrites.get(repository);
|
|
142
|
+
const operation = (async () => {
|
|
143
|
+
await previous?.catch(() => { });
|
|
144
|
+
return write();
|
|
145
|
+
})();
|
|
146
|
+
pendingGitWrites.set(repository, operation);
|
|
147
|
+
try {
|
|
148
|
+
return await operation;
|
|
149
|
+
}
|
|
150
|
+
finally {
|
|
151
|
+
if (pendingGitWrites.get(repository) === operation)
|
|
152
|
+
pendingGitWrites.delete(repository);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
export async function mutateProjectGit(root, action, selection) {
|
|
156
|
+
if (!["stage", "unstage", "discard"].includes(action))
|
|
157
|
+
throw new HttpError(400, "Неизвестное действие Git");
|
|
158
|
+
const paths = [...new Set(Array.isArray(selection) ? selection : [selection])];
|
|
159
|
+
if (!paths.length || paths.length > 10000)
|
|
160
|
+
throw new HttpError(400, "Укажите файлы Git");
|
|
161
|
+
for (const path of paths) {
|
|
162
|
+
validatePath(path);
|
|
163
|
+
if (!path || path.includes("\\") || (await pathExcluded(path)))
|
|
164
|
+
throw new HttpError(403, "Выберите файл проекта");
|
|
165
|
+
}
|
|
166
|
+
const base = await realpath(root);
|
|
167
|
+
return serializeGitWrite(base, async () => {
|
|
168
|
+
const overview = await projectGit(base);
|
|
169
|
+
const selected = paths.map((path) => {
|
|
170
|
+
const change = overview.changes.find((entry) => entry.path === path);
|
|
171
|
+
if (!change)
|
|
172
|
+
throw new HttpError(404, "Изменение больше не найдено. Обновите Git.");
|
|
173
|
+
return change;
|
|
174
|
+
});
|
|
175
|
+
const indexPaths = new Set(paths);
|
|
176
|
+
const patterns = await excludePatterns();
|
|
177
|
+
// Validate the entire selection before changing the shared index.
|
|
178
|
+
for (const change of selected) {
|
|
179
|
+
let ancestor = change.path;
|
|
180
|
+
while (ancestor) {
|
|
181
|
+
try {
|
|
182
|
+
await mutationLocation(base, ancestor);
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
if (error.code !== "ENOENT")
|
|
187
|
+
throw error;
|
|
188
|
+
ancestor = ancestor.split("/").slice(0, -1).join("/");
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const conflict = change.index === "U" ||
|
|
192
|
+
change.worktree === "U" ||
|
|
193
|
+
["AA", "DD"].includes(change.index + change.worktree);
|
|
194
|
+
if (action !== "stage" && conflict)
|
|
195
|
+
throw new HttpError(409, "Сначала разрешите конфликт слияния");
|
|
196
|
+
if (action === "unstage") {
|
|
197
|
+
if ([" ", "?"].includes(change.index))
|
|
198
|
+
throw new HttpError(409, "Нет изменений Staged");
|
|
199
|
+
if (change.index === "R") {
|
|
200
|
+
if (!change.originalPath)
|
|
201
|
+
throw new HttpError(409, "Переименование пересекает границу проекта. Откройте корень репозитория.");
|
|
202
|
+
validatePath(change.originalPath);
|
|
203
|
+
if (isExcludedPath(change.originalPath, patterns))
|
|
204
|
+
throw new HttpError(403, "Недоступный путь Git");
|
|
205
|
+
indexPaths.add(change.originalPath);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
else if (change.worktree === " ")
|
|
209
|
+
throw new HttpError(409, "Нет рабочих изменений");
|
|
210
|
+
}
|
|
211
|
+
if (action === "stage")
|
|
212
|
+
await git(base, ["add", "--", ...paths]);
|
|
213
|
+
else if (action === "unstage") {
|
|
214
|
+
const hasHead = await git(base, ["rev-parse", "--verify", "HEAD"]).then(() => true, () => false);
|
|
215
|
+
await git(base, hasHead
|
|
216
|
+
? ["restore", "--staged", "--", ...indexPaths]
|
|
217
|
+
: ["rm", "--cached", "-f", "--", ...indexPaths]);
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
const tracked = selected
|
|
221
|
+
.filter((change) => change.index !== "?")
|
|
222
|
+
.map((change) => change.path);
|
|
223
|
+
if (tracked.length)
|
|
224
|
+
await git(base, ["restore", "--worktree", "--", ...tracked]);
|
|
225
|
+
for (const change of selected)
|
|
226
|
+
if (change.index === "?")
|
|
227
|
+
await mutateProjectEntry(base, "delete", change.path);
|
|
228
|
+
}
|
|
229
|
+
return projectGit(base);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
export async function gitText(root, ref, path) {
|
|
233
|
+
validatePath(path);
|
|
234
|
+
const prefix = (await git(root, ["rev-parse", "--show-prefix"])).trim();
|
|
235
|
+
const value = await git(root, ["show", `${ref}:${prefix}${path}`], MAX_TEXT_BYTES);
|
|
236
|
+
return decode(Buffer.from(value));
|
|
237
|
+
}
|
|
238
|
+
export async function projectComparison(root, path, staged) {
|
|
239
|
+
validatePath(path);
|
|
240
|
+
const overview = await projectGit(root);
|
|
241
|
+
const change = overview.changes.find((item) => item.path === path);
|
|
242
|
+
if (!change)
|
|
243
|
+
throw new HttpError(404, "Изменение больше не найдено. Обновите Git.");
|
|
244
|
+
if (change.index === "U" ||
|
|
245
|
+
change.worktree === "U" ||
|
|
246
|
+
["AA", "DD"].includes(change.index + change.worktree))
|
|
247
|
+
throw new HttpError(409, "Конфликт слияния. Откройте файл в дереве, чтобы просмотреть маркеры конфликта.");
|
|
248
|
+
const status = staged ? change.index : change.worktree;
|
|
249
|
+
if (status === " ")
|
|
250
|
+
throw new HttpError(404, "Изменение больше не найдено");
|
|
251
|
+
const untracked = change.index === "?";
|
|
252
|
+
const originalPath = staged ? (change.originalPath ?? path) : path;
|
|
253
|
+
const original = untracked || status === "A" ? "" : await gitText(root, staged ? "HEAD" : "", originalPath);
|
|
254
|
+
const modified = status === "D"
|
|
255
|
+
? ""
|
|
256
|
+
: staged
|
|
257
|
+
? await gitText(root, "", path)
|
|
258
|
+
: (await readProjectFile(root, path)).content;
|
|
259
|
+
return { path, original, modified, staged };
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Index version of a tracked file for editor gutter decorations. Like VS Code,
|
|
263
|
+
* staged changes are not marked and untracked files have no gutter.
|
|
264
|
+
*/
|
|
265
|
+
export async function projectGutter(root, path) {
|
|
266
|
+
validatePath(path);
|
|
267
|
+
const unavailable = { available: false, original: "" };
|
|
268
|
+
try {
|
|
269
|
+
await git(root, ["rev-parse", "--show-toplevel"]);
|
|
270
|
+
await git(root, ["ls-files", "--error-unmatch", "--", path]);
|
|
271
|
+
return { available: true, original: await git(root, ["show", `:./${path}`]) };
|
|
272
|
+
}
|
|
273
|
+
catch {
|
|
274
|
+
return unavailable;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
// Paths (relative to `dir`) that git ignores; empty when git or the repository is missing.
|
|
3
|
+
export function ignoredPaths(dir, names) {
|
|
4
|
+
if (!names.length)
|
|
5
|
+
return Promise.resolve(new Set());
|
|
6
|
+
return new Promise((done) => {
|
|
7
|
+
const child = spawn("git", ["-C", dir, "check-ignore", "-z", "--stdin"], {
|
|
8
|
+
windowsHide: true,
|
|
9
|
+
stdio: ["pipe", "pipe", "ignore"],
|
|
10
|
+
env: { ...process.env, GIT_OPTIONAL_LOCKS: "0" },
|
|
11
|
+
});
|
|
12
|
+
let out = "";
|
|
13
|
+
const timer = setTimeout(() => child.kill(), 5000);
|
|
14
|
+
child.stdout.on("data", (chunk) => (out += chunk));
|
|
15
|
+
child.on("error", () => done(new Set()));
|
|
16
|
+
child.on("close", () => {
|
|
17
|
+
clearTimeout(timer);
|
|
18
|
+
done(new Set(out.split("\0").filter(Boolean)));
|
|
19
|
+
});
|
|
20
|
+
child.stdin.on("error", () => { });
|
|
21
|
+
child.stdin.end(names.join("\0") + "\0");
|
|
22
|
+
});
|
|
23
|
+
}
|