comprehende 0.1.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 +94 -0
- package/dist/cli/args.d.ts +20 -0
- package/dist/cli/args.js +89 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/commands.d.ts +12 -0
- package/dist/cli/commands.js +40 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +102 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/git/blame.d.ts +8 -0
- package/dist/git/blame.js +36 -0
- package/dist/git/blame.js.map +1 -0
- package/dist/git/diff.d.ts +13 -0
- package/dist/git/diff.js +332 -0
- package/dist/git/diff.js.map +1 -0
- package/dist/git/exec.d.ts +10 -0
- package/dist/git/exec.js +53 -0
- package/dist/git/exec.js.map +1 -0
- package/dist/git/log.d.ts +8 -0
- package/dist/git/log.js +26 -0
- package/dist/git/log.js.map +1 -0
- package/dist/git/repo.d.ts +7 -0
- package/dist/git/repo.js +45 -0
- package/dist/git/repo.js.map +1 -0
- package/dist/git/show.d.ts +2 -0
- package/dist/git/show.js +18 -0
- package/dist/git/show.js.map +1 -0
- package/dist/package-root.d.ts +2 -0
- package/dist/package-root.js +25 -0
- package/dist/package-root.js.map +1 -0
- package/dist/review/coverage.d.ts +20 -0
- package/dist/review/coverage.js +56 -0
- package/dist/review/coverage.js.map +1 -0
- package/dist/review/effort.d.ts +1 -0
- package/dist/review/effort.js +17 -0
- package/dist/review/effort.js.map +1 -0
- package/dist/review/generate.d.ts +20 -0
- package/dist/review/generate.js +290 -0
- package/dist/review/generate.js.map +1 -0
- package/dist/schema/blame-runs.d.ts +14 -0
- package/dist/schema/blame-runs.js +18 -0
- package/dist/schema/blame-runs.js.map +1 -0
- package/dist/schema/hunk-meta.d.ts +26 -0
- package/dist/schema/hunk-meta.js +107 -0
- package/dist/schema/hunk-meta.js.map +1 -0
- package/dist/schema/hunk-patch.d.ts +2 -0
- package/dist/schema/hunk-patch.js +49 -0
- package/dist/schema/hunk-patch.js.map +1 -0
- package/dist/schema/identity.d.ts +3 -0
- package/dist/schema/identity.js +7 -0
- package/dist/schema/identity.js.map +1 -0
- package/dist/schema/parse.d.ts +13 -0
- package/dist/schema/parse.js +258 -0
- package/dist/schema/parse.js.map +1 -0
- package/dist/schema/skill-paths.d.ts +7 -0
- package/dist/schema/skill-paths.js +11 -0
- package/dist/schema/skill-paths.js.map +1 -0
- package/dist/schema/types.d.ts +73 -0
- package/dist/schema/types.js +4 -0
- package/dist/schema/types.js.map +1 -0
- package/dist/server/http.d.ts +12 -0
- package/dist/server/http.js +270 -0
- package/dist/server/http.js.map +1 -0
- package/dist/ui/assets/abap-BdImnpbu.js +1 -0
- package/dist/ui/assets/actionscript-3-B3316cI-.js +1 -0
- package/dist/ui/assets/ada-bCR0ucgS.js +1 -0
- package/dist/ui/assets/ahk-CsyLZFj1.js +1 -0
- package/dist/ui/assets/ahk2-8Zs4aa1G.js +1 -0
- package/dist/ui/assets/andromeeda-C4gqWexZ.js +1 -0
- package/dist/ui/assets/angular-html-DA-rfuFy.js +1 -0
- package/dist/ui/assets/angular-ts-BrjP3tb8.js +1 -0
- package/dist/ui/assets/apache-Pmp26Uib.js +1 -0
- package/dist/ui/assets/apex-DhZFqWV2.js +1 -0
- package/dist/ui/assets/apl-CORt7UWP.js +1 -0
- package/dist/ui/assets/applescript-Co6uUVPk.js +1 -0
- package/dist/ui/assets/ara-BRHolxvo.js +1 -0
- package/dist/ui/assets/asciidoc-CSVQ5wI8.js +1 -0
- package/dist/ui/assets/asm-D_Q5rh1f.js +1 -0
- package/dist/ui/assets/astro-HNnZUWAn.js +1 -0
- package/dist/ui/assets/aurora-x-D-2ljcwZ.js +1 -0
- package/dist/ui/assets/awk-DMzUqQB5.js +1 -0
- package/dist/ui/assets/ayu-dark-DYE7WIF3.js +1 -0
- package/dist/ui/assets/ayu-light-BA47KaF1.js +1 -0
- package/dist/ui/assets/ayu-mirage-32ctXXKs.js +1 -0
- package/dist/ui/assets/ballerina-BFfxhgS-.js +1 -0
- package/dist/ui/assets/bat-CickPsom.js +1 -0
- package/dist/ui/assets/beancount-k_qm7-4y.js +1 -0
- package/dist/ui/assets/berry-uYugtg8r.js +1 -0
- package/dist/ui/assets/bibtex-CHM0blh-.js +1 -0
- package/dist/ui/assets/bicep-Bmn6On1c.js +1 -0
- package/dist/ui/assets/bird2-Bx8U0n9b.js +1 -0
- package/dist/ui/assets/blade-2xfisSek.js +1 -0
- package/dist/ui/assets/bsl-DlhNcFeZ.js +1 -0
- package/dist/ui/assets/c-BIGW1oBm.js +1 -0
- package/dist/ui/assets/c3-Dp5svz6Z.js +1 -0
- package/dist/ui/assets/cadence-Bv_4Rxtq.js +1 -0
- package/dist/ui/assets/cairo-KRGpt6FW.js +1 -0
- package/dist/ui/assets/catppuccin-frappe-CZL1YF0i.js +1 -0
- package/dist/ui/assets/catppuccin-latte-DH-8KZSZ.js +1 -0
- package/dist/ui/assets/catppuccin-macchiato-B7yYVSCf.js +1 -0
- package/dist/ui/assets/catppuccin-mocha-Ct7hS0mc.js +1 -0
- package/dist/ui/assets/chapel-DTp_pixX.js +1 -0
- package/dist/ui/assets/clarity-Dn5IMItf.js +1 -0
- package/dist/ui/assets/clojure-P80f7IUj.js +1 -0
- package/dist/ui/assets/cmake-D1j8_8rp.js +1 -0
- package/dist/ui/assets/cobol-nBiQ_Alo.js +1 -0
- package/dist/ui/assets/codeowners-Bp6g37R7.js +1 -0
- package/dist/ui/assets/codeql-DsOJ9woJ.js +1 -0
- package/dist/ui/assets/coffee-Ch7k5sss.js +1 -0
- package/dist/ui/assets/common-lisp-Cg-RD9OK.js +1 -0
- package/dist/ui/assets/coq-C7JzOVbR.js +1 -0
- package/dist/ui/assets/cpp-BMRokrvK.js +1 -0
- package/dist/ui/assets/crystal-DGywbUpC.js +1 -0
- package/dist/ui/assets/csharp-DSvCPggb.js +1 -0
- package/dist/ui/assets/css-CLj8gQPS.js +1 -0
- package/dist/ui/assets/csv-fuZLfV_i.js +1 -0
- package/dist/ui/assets/cue-D82EKSYY.js +1 -0
- package/dist/ui/assets/cypher-COkxafJQ.js +1 -0
- package/dist/ui/assets/d-85-TOEBH.js +1 -0
- package/dist/ui/assets/dark-plus-C3mMm8J8.js +1 -0
- package/dist/ui/assets/dart-bE4Kk8sk.js +1 -0
- package/dist/ui/assets/dax-CEL-wOlO.js +1 -0
- package/dist/ui/assets/desktop-BmXAJ9_W.js +1 -0
- package/dist/ui/assets/diff-D97Zzqfu.js +1 -0
- package/dist/ui/assets/docker-BcOcwvcX.js +1 -0
- package/dist/ui/assets/dotenv-Da5cRb03.js +1 -0
- package/dist/ui/assets/dracula-BzJJZx-M.js +1 -0
- package/dist/ui/assets/dracula-soft-BXkSAIEj.js +1 -0
- package/dist/ui/assets/dream-maker-BtqSS_iP.js +1 -0
- package/dist/ui/assets/edge-FbVlp4U3.js +1 -0
- package/dist/ui/assets/elixir-CkH2-t6x.js +1 -0
- package/dist/ui/assets/elm-DbKCFpqz.js +1 -0
- package/dist/ui/assets/emacs-lisp-C_m_b--Z.js +1 -0
- package/dist/ui/assets/erb-DXfck5VN.js +1 -0
- package/dist/ui/assets/erlang-DsQrWhSR.js +1 -0
- package/dist/ui/assets/everforest-dark-BgDCqdQA.js +1 -0
- package/dist/ui/assets/everforest-light-C8M2exoo.js +1 -0
- package/dist/ui/assets/fennel-BYunw83y.js +1 -0
- package/dist/ui/assets/fish-BvzEVeQv.js +1 -0
- package/dist/ui/assets/fluent-C4IJs8-o.js +1 -0
- package/dist/ui/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
- package/dist/ui/assets/fortran-free-form-BxgE0vQu.js +1 -0
- package/dist/ui/assets/fsharp-CXgrBDvD.js +1 -0
- package/dist/ui/assets/gdresource-TyuKm33G.js +1 -0
- package/dist/ui/assets/gdscript-DqcFQ5yU.js +1 -0
- package/dist/ui/assets/gdshader-DkwncUOv.js +1 -0
- package/dist/ui/assets/genie-D0YGMca9.js +1 -0
- package/dist/ui/assets/gherkin-DyxjwDmM.js +1 -0
- package/dist/ui/assets/git-commit-F4YmCXRG.js +1 -0
- package/dist/ui/assets/git-rebase-r7XF79zn.js +1 -0
- package/dist/ui/assets/github-dark-DHJKELXO.js +1 -0
- package/dist/ui/assets/github-dark-default-Cuk6v7N8.js +1 -0
- package/dist/ui/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
- package/dist/ui/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
- package/dist/ui/assets/github-light-DAi9KRSo.js +1 -0
- package/dist/ui/assets/github-light-default-D7oLnXFd.js +1 -0
- package/dist/ui/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
- package/dist/ui/assets/gleam-BspZqrRM.js +1 -0
- package/dist/ui/assets/glimmer-js-ByusRIyA.js +1 -0
- package/dist/ui/assets/glimmer-ts-BfAWNZQY.js +1 -0
- package/dist/ui/assets/glsl-DplSGwfg.js +1 -0
- package/dist/ui/assets/gn-n2N0HUVH.js +1 -0
- package/dist/ui/assets/gnuplot-DdkO51Og.js +1 -0
- package/dist/ui/assets/go-C27-OAKa.js +1 -0
- package/dist/ui/assets/graphql-ChdNCCLP.js +1 -0
- package/dist/ui/assets/groovy-gcz8RCvz.js +1 -0
- package/dist/ui/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
- package/dist/ui/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
- package/dist/ui/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
- package/dist/ui/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
- package/dist/ui/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
- package/dist/ui/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
- package/dist/ui/assets/hack-BWmVpMyf.js +1 -0
- package/dist/ui/assets/haml-D5jkg6IW.js +1 -0
- package/dist/ui/assets/handlebars-BpdQsYii.js +1 -0
- package/dist/ui/assets/haskell-Df6bDoY_.js +1 -0
- package/dist/ui/assets/haxe-CfZj7gIn.js +1 -0
- package/dist/ui/assets/hcl-BWvSN4gD.js +1 -0
- package/dist/ui/assets/hjson-D5-asLiD.js +1 -0
- package/dist/ui/assets/hlsl-D3lLCCz7.js +1 -0
- package/dist/ui/assets/horizon-BUw7H-hv.js +1 -0
- package/dist/ui/assets/horizon-bright-CUuTKBJd.js +1 -0
- package/dist/ui/assets/houston-DnULxvSX.js +1 -0
- package/dist/ui/assets/html-derivative-DlHx6ybY.js +1 -0
- package/dist/ui/assets/html-pp8916En.js +1 -0
- package/dist/ui/assets/http-jrhK8wxY.js +1 -0
- package/dist/ui/assets/hurl-irOxFIW8.js +1 -0
- package/dist/ui/assets/hxml-2-FPmUDs.js +1 -0
- package/dist/ui/assets/hy-DFXneXwc.js +1 -0
- package/dist/ui/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
- package/dist/ui/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
- package/dist/ui/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
- package/dist/ui/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
- package/dist/ui/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/dist/ui/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- package/dist/ui/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
- package/dist/ui/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
- package/dist/ui/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
- package/dist/ui/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
- package/dist/ui/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-cyrillic-400-normal-BTotfTJu.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-cyrillic-400-normal-DZqxrq2p.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-cyrillic-500-normal-ByOcLdNv.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-cyrillic-500-normal-CocWQlwt.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-cyrillic-600-normal-71GNu3SW.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-cyrillic-600-normal-BGq0mW3O.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-cyrillic-ext-400-normal-Dsrv2Tcn.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-cyrillic-ext-400-normal-g30qAdWV.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-cyrillic-ext-500-normal-Cs5J6C77.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-cyrillic-ext-500-normal-DB5PtV2g.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-cyrillic-ext-600-normal-Bz0x94Yp.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-cyrillic-ext-600-normal-DUMzJB7m.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-greek-400-normal-D9ESIMu3.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-greek-400-normal-_efipK4i.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-greek-500-normal-CuWXN6rf.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-greek-500-normal-JMMifIXV.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-greek-600-normal-D-CqTdkO.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-greek-600-normal-DzTrcv_p.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-latin-ext-400-normal-C5H60-Va.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-latin-ext-400-normal-RBey6euL.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-latin-ext-500-normal-D0aIdm-b.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-latin-ext-500-normal-DakdToA3.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-latin-ext-600-normal-DIrixKbi.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-latin-ext-600-normal-DOrvGEcy.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-vietnamese-400-normal-DG4YqDda.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-vietnamese-400-normal-fK1oJ5dG.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-vietnamese-500-normal-BEb3_waV.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-vietnamese-500-normal-e4dixQRQ.woff2 +0 -0
- package/dist/ui/assets/ibm-plex-sans-vietnamese-600-normal-DgdngZtN.woff +0 -0
- package/dist/ui/assets/ibm-plex-sans-vietnamese-600-normal-DpPYBSTl.woff2 +0 -0
- package/dist/ui/assets/imba-DGztddWO.js +1 -0
- package/dist/ui/assets/index-BCZwzr3E.js +1585 -0
- package/dist/ui/assets/index-DsGDgUsX.css +1 -0
- package/dist/ui/assets/ini-BEwlwnbL.js +1 -0
- package/dist/ui/assets/java-CylS5w8V.js +1 -0
- package/dist/ui/assets/javascript-wDzz0qaB.js +1 -0
- package/dist/ui/assets/jinja-f2NsQr07.js +1 -0
- package/dist/ui/assets/jison-wvAkD_A8.js +1 -0
- package/dist/ui/assets/json-Cp-IABpG.js +1 -0
- package/dist/ui/assets/json5-C9tS-k6U.js +1 -0
- package/dist/ui/assets/jsonc-Des-eS-w.js +1 -0
- package/dist/ui/assets/jsonl-DcaNXYhu.js +1 -0
- package/dist/ui/assets/jsonnet-DFQXde-d.js +1 -0
- package/dist/ui/assets/jssm-C2t-YnRu.js +1 -0
- package/dist/ui/assets/jsx-g9-lgVsj.js +1 -0
- package/dist/ui/assets/julia-5Bft2YPA.js +1 -0
- package/dist/ui/assets/just-Cwhn7H3k.js +1 -0
- package/dist/ui/assets/kanagawa-dragon-BuwD2xS4.js +1 -0
- package/dist/ui/assets/kanagawa-lotus-C3DzagqV.js +1 -0
- package/dist/ui/assets/kanagawa-wave-DFGoQZhC.js +1 -0
- package/dist/ui/assets/kdl-DV7GczEv.js +1 -0
- package/dist/ui/assets/kotlin-BdnUsdx6.js +1 -0
- package/dist/ui/assets/kusto-wEQ09or8.js +1 -0
- package/dist/ui/assets/laserwave-DUszq2jm.js +1 -0
- package/dist/ui/assets/latex-D5pSuvFb.js +1 -0
- package/dist/ui/assets/lean-BZvkOJ9d.js +1 -0
- package/dist/ui/assets/less-B1dDrJ26.js +1 -0
- package/dist/ui/assets/light-plus-B7mTdjB0.js +1 -0
- package/dist/ui/assets/liquid-C0sCDyMI.js +1 -0
- package/dist/ui/assets/llvm-BZoOZj88.js +1 -0
- package/dist/ui/assets/log-2UxHyX5q.js +1 -0
- package/dist/ui/assets/logo-BtOb2qkB.js +1 -0
- package/dist/ui/assets/lua-BaeVxFsk.js +1 -0
- package/dist/ui/assets/luau-BnpPk5vE.js +1 -0
- package/dist/ui/assets/make-CHLpvVh8.js +1 -0
- package/dist/ui/assets/markdown-Cvjx9yec.js +1 -0
- package/dist/ui/assets/marko-DjSrsDqO.js +1 -0
- package/dist/ui/assets/material-theme-D5KoaKCx.js +1 -0
- package/dist/ui/assets/material-theme-darker-BfHTSMKl.js +1 -0
- package/dist/ui/assets/material-theme-lighter-B0m2ddpp.js +1 -0
- package/dist/ui/assets/material-theme-ocean-CyktbL80.js +1 -0
- package/dist/ui/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
- package/dist/ui/assets/matlab-D7o27uSR.js +1 -0
- package/dist/ui/assets/mdc-D1_yUvq7.js +1 -0
- package/dist/ui/assets/mdx-Cmh6b_Ma.js +1 -0
- package/dist/ui/assets/mermaid-CQcHuHx7.js +1 -0
- package/dist/ui/assets/min-dark-CafNBF8u.js +1 -0
- package/dist/ui/assets/min-light-CTRr51gU.js +1 -0
- package/dist/ui/assets/mipsasm-CKIfxQSi.js +1 -0
- package/dist/ui/assets/mojo-DJz3ZmWd.js +1 -0
- package/dist/ui/assets/monokai-BRVnQi9A.js +1 -0
- package/dist/ui/assets/moonbit-CHtswR0a.js +1 -0
- package/dist/ui/assets/move-el3G9tDJ.js +1 -0
- package/dist/ui/assets/narrat-DRg8JJMk.js +1 -0
- package/dist/ui/assets/nextflow-C-mBbutL.js +1 -0
- package/dist/ui/assets/nextflow-groovy-vE_lwT2v.js +1 -0
- package/dist/ui/assets/nginx-BpAMiNFr.js +1 -0
- package/dist/ui/assets/night-owl-C39BiMTA.js +1 -0
- package/dist/ui/assets/night-owl-light-CMTm3GFP.js +1 -0
- package/dist/ui/assets/nim-BIad80T-.js +1 -0
- package/dist/ui/assets/nix-CwoSXNpI.js +1 -0
- package/dist/ui/assets/nord-Ddv68eIx.js +1 -0
- package/dist/ui/assets/nsis-BlV79W_Q.js +1 -0
- package/dist/ui/assets/nushell-D3jzshHO.js +1 -0
- package/dist/ui/assets/objective-c-DXmwc3jG.js +1 -0
- package/dist/ui/assets/objective-cpp-CLxacb5B.js +1 -0
- package/dist/ui/assets/ocaml-C0hk2d4L.js +1 -0
- package/dist/ui/assets/odin-BBf5iR-q.js +1 -0
- package/dist/ui/assets/one-dark-pro-DVMEJ2y_.js +1 -0
- package/dist/ui/assets/one-light-C3Wv6jpd.js +1 -0
- package/dist/ui/assets/openscad-C4EeE6gA.js +1 -0
- package/dist/ui/assets/org-DM6o9KBp.js +1 -0
- package/dist/ui/assets/pascal-D93ZcfNL.js +1 -0
- package/dist/ui/assets/perl-B9cMNwum.js +1 -0
- package/dist/ui/assets/php-Csjmro_R.js +1 -0
- package/dist/ui/assets/pierre-dark-CyvmCCZW.js +1 -0
- package/dist/ui/assets/pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js +1 -0
- package/dist/ui/assets/pierre-dark-soft-BHGpRqa4.js +1 -0
- package/dist/ui/assets/pierre-dark-tritanopia-Beq2gCRQ.js +1 -0
- package/dist/ui/assets/pierre-dark-vibrant-BWBVywrn.js +1 -0
- package/dist/ui/assets/pierre-light-480U9XYS.js +1 -0
- package/dist/ui/assets/pierre-light-protanopia-deuteranopia-CaVOBURG.js +1 -0
- package/dist/ui/assets/pierre-light-soft-CVdyfjmI.js +1 -0
- package/dist/ui/assets/pierre-light-tritanopia-B4_gpKOM.js +1 -0
- package/dist/ui/assets/pierre-light-vibrant-DdTDNdfJ.js +1 -0
- package/dist/ui/assets/pkl-u5AG7uiY.js +1 -0
- package/dist/ui/assets/plastic-3e1v2bzS.js +1 -0
- package/dist/ui/assets/plsql-ChMvpjG-.js +1 -0
- package/dist/ui/assets/po-BTJTHyun.js +1 -0
- package/dist/ui/assets/poimandres-CS3Unz2-.js +1 -0
- package/dist/ui/assets/polar-C0HS_06l.js +1 -0
- package/dist/ui/assets/postcss-CXtECtnM.js +1 -0
- package/dist/ui/assets/powerquery-CEu0bR-o.js +1 -0
- package/dist/ui/assets/powershell-BmBUJMz7.js +1 -0
- package/dist/ui/assets/prisma-Vru482bI.js +1 -0
- package/dist/ui/assets/prolog-CbFg5uaA.js +1 -0
- package/dist/ui/assets/proto-C7zT0LnQ.js +1 -0
- package/dist/ui/assets/pug-DKIMFp6K.js +1 -0
- package/dist/ui/assets/puppet-BMWR74SV.js +1 -0
- package/dist/ui/assets/purescript-CklMAg4u.js +1 -0
- package/dist/ui/assets/python-B6aJPvgy.js +1 -0
- package/dist/ui/assets/qml-3beO22l8.js +1 -0
- package/dist/ui/assets/qmldir-C8lEn-DE.js +1 -0
- package/dist/ui/assets/qss-IeuSbFQv.js +1 -0
- package/dist/ui/assets/r-Cf5RLm7j.js +1 -0
- package/dist/ui/assets/racket-BqYA7rlc.js +1 -0
- package/dist/ui/assets/raku-DXvB9xmW.js +1 -0
- package/dist/ui/assets/razor-BjBPvh-w.js +1 -0
- package/dist/ui/assets/rbs-CpoqiR4B.js +1 -0
- package/dist/ui/assets/red-hvxz__6c.js +1 -0
- package/dist/ui/assets/reg-C-SQnVFl.js +1 -0
- package/dist/ui/assets/regexp-CDVJQ6XC.js +1 -0
- package/dist/ui/assets/rel-C3B-1QV4.js +1 -0
- package/dist/ui/assets/riscv-BM1_JUlF.js +1 -0
- package/dist/ui/assets/ron-D8l8udqQ.js +1 -0
- package/dist/ui/assets/rose-pine-5qJOZa0Y.js +1 -0
- package/dist/ui/assets/rose-pine-dawn-zx0QlTCp.js +1 -0
- package/dist/ui/assets/rose-pine-moon-C9pEdX9L.js +1 -0
- package/dist/ui/assets/rosmsg-BJDFO7_C.js +1 -0
- package/dist/ui/assets/rst-bs7f0vWN.js +1 -0
- package/dist/ui/assets/ruby-C0TQ7zu5.js +1 -0
- package/dist/ui/assets/rust-B1yitclQ.js +1 -0
- package/dist/ui/assets/sas-DEy46yEz.js +1 -0
- package/dist/ui/assets/sass-Cj5Yp3dK.js +1 -0
- package/dist/ui/assets/scala-CqE71os6.js +1 -0
- package/dist/ui/assets/scheme-C98Dy4si.js +1 -0
- package/dist/ui/assets/scss-D5BDwBP9.js +1 -0
- package/dist/ui/assets/sdbl-DVxCFoDh.js +1 -0
- package/dist/ui/assets/shaderlab-Dg9Lc6iA.js +1 -0
- package/dist/ui/assets/shellscript-Yzrsuije.js +1 -0
- package/dist/ui/assets/shellsession-BADoaaVG.js +1 -0
- package/dist/ui/assets/slack-dark-BthQWCQV.js +1 -0
- package/dist/ui/assets/slack-ochin-DqwNpetd.js +1 -0
- package/dist/ui/assets/smalltalk-BOQMe2GC.js +1 -0
- package/dist/ui/assets/smithy-cds9vsN8.js +1 -0
- package/dist/ui/assets/snazzy-light-Bw305WKR.js +1 -0
- package/dist/ui/assets/solarized-dark-CpvCGNkr.js +1 -0
- package/dist/ui/assets/solarized-light-Dlz6yCKv.js +1 -0
- package/dist/ui/assets/solidity-DijEV5ha.js +1 -0
- package/dist/ui/assets/source-serif-4-cyrillic-400-normal-B8Z6Jvzv.woff +0 -0
- package/dist/ui/assets/source-serif-4-cyrillic-400-normal-C44pakCn.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-cyrillic-600-normal-BDP5YDHD.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-cyrillic-600-normal-DFnC3vAY.woff +0 -0
- package/dist/ui/assets/source-serif-4-cyrillic-ext-400-normal-CWV284fw.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-cyrillic-ext-400-normal-DLkyKLvH.woff +0 -0
- package/dist/ui/assets/source-serif-4-cyrillic-ext-600-normal-D_E8FDgP.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-cyrillic-ext-600-normal-DiT2IGQm.woff +0 -0
- package/dist/ui/assets/source-serif-4-greek-400-normal-BccYJ-vZ.woff +0 -0
- package/dist/ui/assets/source-serif-4-greek-400-normal-Cw5-AHNN.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-greek-600-normal-DdRkKr-1.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-greek-600-normal-DhXQw1Kl.woff +0 -0
- package/dist/ui/assets/source-serif-4-latin-400-normal-DJ5YJwmz.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-latin-400-normal-Dn3IlU-Z.woff +0 -0
- package/dist/ui/assets/source-serif-4-latin-600-normal-DMD1h6_f.woff +0 -0
- package/dist/ui/assets/source-serif-4-latin-600-normal-DouSKlru.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-latin-ext-400-normal-CEpydyUl.woff +0 -0
- package/dist/ui/assets/source-serif-4-latin-ext-400-normal-Cp7z-ARB.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-latin-ext-600-normal-0sIUyHMO.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-latin-ext-600-normal-C6NNqpJh.woff +0 -0
- package/dist/ui/assets/source-serif-4-vietnamese-400-normal-BbG3LG1A.woff2 +0 -0
- package/dist/ui/assets/source-serif-4-vietnamese-400-normal-DR1UuFon.woff +0 -0
- package/dist/ui/assets/source-serif-4-vietnamese-600-normal-B0WJbuqT.woff +0 -0
- package/dist/ui/assets/source-serif-4-vietnamese-600-normal-CznyfUKR.woff2 +0 -0
- package/dist/ui/assets/soy-8wufbnw4.js +1 -0
- package/dist/ui/assets/sparql-rVzFXLq3.js +1 -0
- package/dist/ui/assets/splunk-BtCnVYZw.js +1 -0
- package/dist/ui/assets/sql-CRqJ_cUM.js +1 -0
- package/dist/ui/assets/ssh-config-_ykCGR6B.js +1 -0
- package/dist/ui/assets/stata-DI20mbqo.js +1 -0
- package/dist/ui/assets/stylus-BEDo0Tqx.js +1 -0
- package/dist/ui/assets/surrealql-Cjom0U5J.js +1 -0
- package/dist/ui/assets/svelte-Cy7k_4gC.js +1 -0
- package/dist/ui/assets/swift-C2oV4EkX.js +1 -0
- package/dist/ui/assets/synthwave-84-CbfX1IO0.js +1 -0
- package/dist/ui/assets/system-verilog-0hqHdDBg.js +1 -0
- package/dist/ui/assets/systemd-4A_iFExJ.js +1 -0
- package/dist/ui/assets/talonscript-CkByrt1z.js +1 -0
- package/dist/ui/assets/tasl-QIJgUcNo.js +1 -0
- package/dist/ui/assets/tcl-dwOrl1Do.js +1 -0
- package/dist/ui/assets/templ-DhtptRzy.js +1 -0
- package/dist/ui/assets/terraform-BETggiCN.js +1 -0
- package/dist/ui/assets/tex-D96PA37w.js +1 -0
- package/dist/ui/assets/tokyo-night-hegEt444.js +1 -0
- package/dist/ui/assets/toml-vGWfd6FD.js +1 -0
- package/dist/ui/assets/ts-tags-D351s5mN.js +1 -0
- package/dist/ui/assets/tsv-B_m7g4N7.js +1 -0
- package/dist/ui/assets/tsx-COt5Ahok.js +1 -0
- package/dist/ui/assets/turtle-BsS91CYL.js +1 -0
- package/dist/ui/assets/twig-27uCiNez.js +1 -0
- package/dist/ui/assets/typescript-BPQ3VLAy.js +1 -0
- package/dist/ui/assets/typespec-CAFt9gP4.js +1 -0
- package/dist/ui/assets/typst-BUadGCkm.js +1 -0
- package/dist/ui/assets/v-BGw2Nkan.js +1 -0
- package/dist/ui/assets/vala-CsfeWuGM.js +1 -0
- package/dist/ui/assets/vb-Cu-pLBUe.js +1 -0
- package/dist/ui/assets/verilog-nZwndyjY.js +1 -0
- package/dist/ui/assets/vesper-DRje8inN.js +1 -0
- package/dist/ui/assets/vhdl-CeAyd5Ju.js +1 -0
- package/dist/ui/assets/viml-CJc9bBzg.js +1 -0
- package/dist/ui/assets/vitesse-black-Bkuqu6BP.js +1 -0
- package/dist/ui/assets/vitesse-dark-D0r3Knsf.js +1 -0
- package/dist/ui/assets/vitesse-light-CVO1_9PV.js +1 -0
- package/dist/ui/assets/vue-BqiEGhQt.js +1 -0
- package/dist/ui/assets/vue-html-AaS7Mt5G.js +1 -0
- package/dist/ui/assets/vue-vine-BoDAl6tE.js +1 -0
- package/dist/ui/assets/vyper-CDx5xZoG.js +1 -0
- package/dist/ui/assets/wasm-CG6Dc4jp.js +1 -0
- package/dist/ui/assets/wasm-MzD3tlZU.js +1 -0
- package/dist/ui/assets/wenyan-BV7otONQ.js +1 -0
- package/dist/ui/assets/wgsl-Dx-B1_4e.js +1 -0
- package/dist/ui/assets/wikitext-BhOHFoWU.js +1 -0
- package/dist/ui/assets/wit-5i3qLPDT.js +1 -0
- package/dist/ui/assets/wolfram-lXgVvXCa.js +1 -0
- package/dist/ui/assets/worker-DsKBD11i.js +156 -0
- package/dist/ui/assets/xml-sdJ4AIDG.js +1 -0
- package/dist/ui/assets/xsl-CtQFsRM5.js +1 -0
- package/dist/ui/assets/yaml-Buea-lGh.js +1 -0
- package/dist/ui/assets/zenscript-DVFEvuxE.js +1 -0
- package/dist/ui/assets/zig-VOosw3JB.js +1 -0
- package/dist/ui/index.html +13 -0
- package/package.json +74 -0
- package/skills/comprehende/SKILL.md +68 -0
- package/skills/comprehende/references/example.md +55 -0
- package/skills/comprehende/references/review.schema.json +92 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { isReviewSize, REVIEW_SIZES } from "./types.js";
|
|
2
|
+
const DOCUMENT_KEYS = new Set(["version", "source", "size", "walkthrough", "tickets", "groups"]);
|
|
3
|
+
const SOURCE_KEYS = new Set(["baseRef", "headRef", "range"]);
|
|
4
|
+
const TICKET_KEYS = new Set(["id", "url", "title"]);
|
|
5
|
+
const GROUP_KEYS = new Set(["id", "title", "summary", "lookFor", "dependsOn", "suggestedOrder", "hunkRefs"]);
|
|
6
|
+
const HUNK_KEYS = new Set(["path", "oldPath", "oldStart", "oldLines", "newStart", "newLines"]);
|
|
7
|
+
export function parseReviewDocument(input) {
|
|
8
|
+
const errors = [];
|
|
9
|
+
if (!isRecord(input)) {
|
|
10
|
+
return { ok: false, errors: ["review document must be a JSON object"] };
|
|
11
|
+
}
|
|
12
|
+
extraKeys(input, DOCUMENT_KEYS, "document", errors);
|
|
13
|
+
if (input.version !== 1) {
|
|
14
|
+
errors.push("version must be 1");
|
|
15
|
+
}
|
|
16
|
+
const source = parseSource(input.source, errors);
|
|
17
|
+
const size = parseSize(input.size, errors);
|
|
18
|
+
const tickets = parseTickets(input.tickets, errors);
|
|
19
|
+
const groups = parseGroups(input.groups, errors);
|
|
20
|
+
const walkthrough = input.walkthrough === undefined ? undefined : requiredString(input.walkthrough, "walkthrough", errors);
|
|
21
|
+
if (errors.length > 0 || source === undefined || size === undefined) {
|
|
22
|
+
return { ok: false, errors };
|
|
23
|
+
}
|
|
24
|
+
const document = {
|
|
25
|
+
version: 1,
|
|
26
|
+
source,
|
|
27
|
+
size,
|
|
28
|
+
groups,
|
|
29
|
+
};
|
|
30
|
+
if (walkthrough !== undefined) {
|
|
31
|
+
document.walkthrough = walkthrough;
|
|
32
|
+
}
|
|
33
|
+
if (tickets !== undefined) {
|
|
34
|
+
document.tickets = tickets;
|
|
35
|
+
}
|
|
36
|
+
return { ok: true, document };
|
|
37
|
+
}
|
|
38
|
+
export function parseReviewJson(text) {
|
|
39
|
+
let value;
|
|
40
|
+
try {
|
|
41
|
+
value = JSON.parse(text);
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return { ok: false, errors: ["review document is not valid JSON"] };
|
|
45
|
+
}
|
|
46
|
+
return parseReviewDocument(value);
|
|
47
|
+
}
|
|
48
|
+
function parseSize(value, errors) {
|
|
49
|
+
if (isReviewSize(value)) {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
errors.push(`size must be one of ${REVIEW_SIZES.join(", ")}`);
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
function parseSource(value, errors) {
|
|
56
|
+
if (!isRecord(value)) {
|
|
57
|
+
errors.push("source must be an object");
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
extraKeys(value, SOURCE_KEYS, "source", errors);
|
|
61
|
+
const baseRef = requiredString(value.baseRef, "source.baseRef", errors);
|
|
62
|
+
const headRef = requiredString(value.headRef, "source.headRef", errors);
|
|
63
|
+
let range;
|
|
64
|
+
if (value.range !== undefined) {
|
|
65
|
+
range = requiredString(value.range, "source.range", errors);
|
|
66
|
+
}
|
|
67
|
+
if (baseRef === undefined || headRef === undefined) {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
const source = { baseRef, headRef };
|
|
71
|
+
if (range !== undefined) {
|
|
72
|
+
source.range = range;
|
|
73
|
+
}
|
|
74
|
+
return source;
|
|
75
|
+
}
|
|
76
|
+
function parseTickets(value, errors) {
|
|
77
|
+
if (value === undefined) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
if (!Array.isArray(value)) {
|
|
81
|
+
errors.push("tickets must be an array");
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
const tickets = [];
|
|
85
|
+
value.forEach((item, i) => {
|
|
86
|
+
if (!isRecord(item)) {
|
|
87
|
+
errors.push(`tickets[${i}] must be an object`);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
extraKeys(item, TICKET_KEYS, `tickets[${i}]`, errors);
|
|
91
|
+
const id = requiredString(item.id, `tickets[${i}].id`, errors);
|
|
92
|
+
if (id === undefined) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const ticket = { id };
|
|
96
|
+
if (item.url !== undefined) {
|
|
97
|
+
const url = requiredString(item.url, `tickets[${i}].url`, errors);
|
|
98
|
+
if (url !== undefined) {
|
|
99
|
+
ticket.url = url;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (item.title !== undefined) {
|
|
103
|
+
const title = requiredString(item.title, `tickets[${i}].title`, errors);
|
|
104
|
+
if (title !== undefined) {
|
|
105
|
+
ticket.title = title;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
tickets.push(ticket);
|
|
109
|
+
});
|
|
110
|
+
return tickets;
|
|
111
|
+
}
|
|
112
|
+
function parseGroups(value, errors) {
|
|
113
|
+
if (!Array.isArray(value)) {
|
|
114
|
+
errors.push("groups must be an array");
|
|
115
|
+
return [];
|
|
116
|
+
}
|
|
117
|
+
const ids = new Set();
|
|
118
|
+
const groups = [];
|
|
119
|
+
value.forEach((item, i) => {
|
|
120
|
+
if (!isRecord(item)) {
|
|
121
|
+
errors.push(`groups[${i}] must be an object`);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
extraKeys(item, GROUP_KEYS, `groups[${i}]`, errors);
|
|
125
|
+
const id = requiredString(item.id, `groups[${i}].id`, errors);
|
|
126
|
+
const title = requiredString(item.title, `groups[${i}].title`, errors);
|
|
127
|
+
const summary = requiredString(item.summary, `groups[${i}].summary`, errors, { allowEmpty: true });
|
|
128
|
+
const suggestedOrder = requiredNumber(item.suggestedOrder, `groups[${i}].suggestedOrder`, errors);
|
|
129
|
+
const hunkRefs = parseHunkRefs(item.hunkRefs, `groups[${i}].hunkRefs`, errors);
|
|
130
|
+
const lookFor = parseStringList(item.lookFor, `groups[${i}].lookFor`, errors);
|
|
131
|
+
const dependsOn = parseStringList(item.dependsOn, `groups[${i}].dependsOn`, errors);
|
|
132
|
+
if (id === undefined || title === undefined || summary === undefined || suggestedOrder === undefined) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (ids.has(id)) {
|
|
136
|
+
errors.push(`duplicate group id "${id}"`);
|
|
137
|
+
}
|
|
138
|
+
ids.add(id);
|
|
139
|
+
const group = { id, title, summary, suggestedOrder, hunkRefs };
|
|
140
|
+
if (lookFor !== undefined) {
|
|
141
|
+
group.lookFor = lookFor;
|
|
142
|
+
}
|
|
143
|
+
if (dependsOn !== undefined) {
|
|
144
|
+
group.dependsOn = dependsOn;
|
|
145
|
+
}
|
|
146
|
+
groups.push(group);
|
|
147
|
+
});
|
|
148
|
+
const known = new Set(groups.map((group) => group.id));
|
|
149
|
+
for (const group of groups) {
|
|
150
|
+
for (const dep of group.dependsOn ?? []) {
|
|
151
|
+
if (dep === group.id) {
|
|
152
|
+
errors.push(`groups id "${group.id}" depends on itself`);
|
|
153
|
+
}
|
|
154
|
+
else if (!known.has(dep)) {
|
|
155
|
+
errors.push(`groups id "${group.id}" dependsOn unknown group "${dep}"`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return groups;
|
|
160
|
+
}
|
|
161
|
+
function parseHunkRefs(value, label, errors) {
|
|
162
|
+
if (!Array.isArray(value)) {
|
|
163
|
+
errors.push(`${label} must be an array`);
|
|
164
|
+
return [];
|
|
165
|
+
}
|
|
166
|
+
const refs = [];
|
|
167
|
+
value.forEach((item, i) => {
|
|
168
|
+
const ref = parseHunkRef(item, `${label}[${i}]`, errors);
|
|
169
|
+
if (ref !== undefined) {
|
|
170
|
+
refs.push(ref);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
return refs;
|
|
174
|
+
}
|
|
175
|
+
export function parseHunkRef(value, label, errors) {
|
|
176
|
+
if (!isRecord(value)) {
|
|
177
|
+
errors.push(`${label} must be an object`);
|
|
178
|
+
return undefined;
|
|
179
|
+
}
|
|
180
|
+
extraKeys(value, HUNK_KEYS, label, errors);
|
|
181
|
+
const path = requiredString(value.path, `${label}.path`, errors);
|
|
182
|
+
const oldStart = requiredInt(value.oldStart, `${label}.oldStart`, errors);
|
|
183
|
+
const oldLines = requiredInt(value.oldLines, `${label}.oldLines`, errors);
|
|
184
|
+
const newStart = requiredInt(value.newStart, `${label}.newStart`, errors);
|
|
185
|
+
const newLines = requiredInt(value.newLines, `${label}.newLines`, errors);
|
|
186
|
+
let oldPath;
|
|
187
|
+
if (value.oldPath !== undefined) {
|
|
188
|
+
oldPath = requiredString(value.oldPath, `${label}.oldPath`, errors);
|
|
189
|
+
}
|
|
190
|
+
if (path === undefined ||
|
|
191
|
+
oldStart === undefined ||
|
|
192
|
+
oldLines === undefined ||
|
|
193
|
+
newStart === undefined ||
|
|
194
|
+
newLines === undefined) {
|
|
195
|
+
return undefined;
|
|
196
|
+
}
|
|
197
|
+
const ref = { path, oldStart, oldLines, newStart, newLines };
|
|
198
|
+
if (oldPath !== undefined) {
|
|
199
|
+
ref.oldPath = oldPath;
|
|
200
|
+
}
|
|
201
|
+
return ref;
|
|
202
|
+
}
|
|
203
|
+
function parseStringList(value, label, errors) {
|
|
204
|
+
if (value === undefined) {
|
|
205
|
+
return undefined;
|
|
206
|
+
}
|
|
207
|
+
if (!Array.isArray(value)) {
|
|
208
|
+
errors.push(`${label} must be an array of strings`);
|
|
209
|
+
return undefined;
|
|
210
|
+
}
|
|
211
|
+
const items = [];
|
|
212
|
+
value.forEach((item, i) => {
|
|
213
|
+
const text = requiredString(item, `${label}[${i}]`, errors);
|
|
214
|
+
if (text !== undefined) {
|
|
215
|
+
items.push(text);
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
return items;
|
|
219
|
+
}
|
|
220
|
+
function extraKeys(value, allowed, label, errors) {
|
|
221
|
+
for (const key of Object.keys(value)) {
|
|
222
|
+
if (!allowed.has(key)) {
|
|
223
|
+
errors.push(`${label} has unknown field "${key}" (review documents may not store patch text or file contents)`);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function requiredString(value, label, errors, opts) {
|
|
228
|
+
if (typeof value !== "string") {
|
|
229
|
+
errors.push(`${label} must be a string`);
|
|
230
|
+
return undefined;
|
|
231
|
+
}
|
|
232
|
+
if (!opts?.allowEmpty && value.trim() === "") {
|
|
233
|
+
errors.push(`${label} must be a non-empty string`);
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
return value;
|
|
237
|
+
}
|
|
238
|
+
function requiredNumber(value, label, errors) {
|
|
239
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
240
|
+
errors.push(`${label} must be a finite number`);
|
|
241
|
+
return undefined;
|
|
242
|
+
}
|
|
243
|
+
return value;
|
|
244
|
+
}
|
|
245
|
+
function requiredInt(value, label, errors) {
|
|
246
|
+
const n = requiredNumber(value, label, errors);
|
|
247
|
+
if (n === undefined) {
|
|
248
|
+
return undefined;
|
|
249
|
+
}
|
|
250
|
+
if (!Number.isInteger(n) || n < 0) {
|
|
251
|
+
errors.push(`${label} must be a non-negative integer`);
|
|
252
|
+
return undefined;
|
|
253
|
+
}
|
|
254
|
+
return n;
|
|
255
|
+
}
|
|
256
|
+
function isRecord(value) {
|
|
257
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
258
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/schema/parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAwG,MAAM,YAAY,CAAC;AAc9J,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AACjG,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;AAC7D,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AACpD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,CAAC,CAAC,CAAC;AAC7G,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;AAE/F,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,EAAE,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IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { findPackageRoot } from "../package-root.js";
|
|
3
|
+
export function skillPaths(root = findPackageRoot()) {
|
|
4
|
+
return {
|
|
5
|
+
canonicalSchema: join(root, "src/schema/review.schema.json"),
|
|
6
|
+
publishedSkill: join(root, "skills/comprehende"),
|
|
7
|
+
installedSkill: join(root, ".agents/skills/comprehende"),
|
|
8
|
+
publishedSchema: join(root, "skills/comprehende/references/review.schema.json"),
|
|
9
|
+
installedSchema: join(root, ".agents/skills/comprehende/references/review.schema.json"),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-paths.js","sourceRoot":"","sources":["../../src/schema/skill-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,UAAU,UAAU,CAAC,IAAI,GAAG,eAAe,EAAE;IACjD,OAAO;QACL,eAAe,EAAE,IAAI,CAAC,IAAI,EAAE,+BAA+B,CAAC;QAC5D,cAAc,EAAE,IAAI,CAAC,IAAI,EAAE,oBAAoB,CAAC;QAChD,cAAc,EAAE,IAAI,CAAC,IAAI,EAAE,4BAA4B,CAAC;QACxD,eAAe,EAAE,IAAI,CAAC,IAAI,EAAE,kDAAkD,CAAC;QAC/E,eAAe,EAAE,IAAI,CAAC,IAAI,EAAE,0DAA0D,CAAC;KACxF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export declare const REVIEW_SIZES: readonly ["trivial", "small", "medium", "large", "very-large"];
|
|
2
|
+
export type ReviewSize = (typeof REVIEW_SIZES)[number];
|
|
3
|
+
export declare function isReviewSize(value: unknown): value is ReviewSize;
|
|
4
|
+
export type ReviewDocument = {
|
|
5
|
+
version: 1;
|
|
6
|
+
source: ReviewSource;
|
|
7
|
+
/** Human review burden of this change, not file or hunk count. */
|
|
8
|
+
size: ReviewSize;
|
|
9
|
+
walkthrough?: string;
|
|
10
|
+
tickets?: Ticket[];
|
|
11
|
+
groups: ReviewGroup[];
|
|
12
|
+
};
|
|
13
|
+
export type ReviewSource = {
|
|
14
|
+
baseRef: string;
|
|
15
|
+
headRef: string;
|
|
16
|
+
range?: string;
|
|
17
|
+
};
|
|
18
|
+
export type Ticket = {
|
|
19
|
+
id: string;
|
|
20
|
+
url?: string;
|
|
21
|
+
title?: string;
|
|
22
|
+
};
|
|
23
|
+
export type ReviewGroup = {
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
/** One sentence: what this layer is and why it exists. */
|
|
27
|
+
summary: string;
|
|
28
|
+
/** Scannable bullets of what to look at. Not a paragraph. */
|
|
29
|
+
lookFor?: string[];
|
|
30
|
+
/** Earlier layer ids this one depends on. */
|
|
31
|
+
dependsOn?: string[];
|
|
32
|
+
suggestedOrder: number;
|
|
33
|
+
hunkRefs: HunkRef[];
|
|
34
|
+
};
|
|
35
|
+
export type HunkRef = {
|
|
36
|
+
path: string;
|
|
37
|
+
oldPath?: string;
|
|
38
|
+
oldStart: number;
|
|
39
|
+
oldLines: number;
|
|
40
|
+
newStart: number;
|
|
41
|
+
newLines: number;
|
|
42
|
+
};
|
|
43
|
+
export type HunkIndex = {
|
|
44
|
+
source: ReviewSource;
|
|
45
|
+
hunks: HunkRef[];
|
|
46
|
+
skipped: SkippedFile[];
|
|
47
|
+
};
|
|
48
|
+
export type SkippedFile = {
|
|
49
|
+
path: string;
|
|
50
|
+
reason: "binary";
|
|
51
|
+
};
|
|
52
|
+
export type DiffLineKind = "ctx" | "add" | "del";
|
|
53
|
+
export type DiffLine = {
|
|
54
|
+
kind: DiffLineKind;
|
|
55
|
+
oldNumber: number | null;
|
|
56
|
+
newNumber: number | null;
|
|
57
|
+
text: string;
|
|
58
|
+
};
|
|
59
|
+
export type LiveHunk = HunkRef & {
|
|
60
|
+
header: string;
|
|
61
|
+
lines: DiffLine[];
|
|
62
|
+
patch: string;
|
|
63
|
+
};
|
|
64
|
+
export type FileStatus = "added" | "deleted" | "modified" | "renamed";
|
|
65
|
+
export type DiffFile = {
|
|
66
|
+
path: string;
|
|
67
|
+
oldPath?: string;
|
|
68
|
+
status: FileStatus;
|
|
69
|
+
binary: boolean;
|
|
70
|
+
headerPatch: string;
|
|
71
|
+
patch: string;
|
|
72
|
+
hunks: LiveHunk[];
|
|
73
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/schema/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAU,CAAC;AAI3F,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,YAAkC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC1F,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Server } from "node:http";
|
|
2
|
+
export type ServeOptions = {
|
|
3
|
+
cwd: string;
|
|
4
|
+
dataPath: string;
|
|
5
|
+
port: number;
|
|
6
|
+
};
|
|
7
|
+
export type RunningServer = {
|
|
8
|
+
server: Server;
|
|
9
|
+
port: number;
|
|
10
|
+
url: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function startServer(opts: ServeOptions): Promise<RunningServer>;
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { createServer } from "node:http";
|
|
2
|
+
import { createReadStream, existsSync, statSync } from "node:fs";
|
|
3
|
+
import { extname, join, resolve } from "node:path";
|
|
4
|
+
import { coverReview } from "../review/coverage.js";
|
|
5
|
+
import { fileLanguage, filePatchFromGit, readHunkIndex, resolveSource, toHunkRef } from "../git/diff.js";
|
|
6
|
+
import { listCommits } from "../git/log.js";
|
|
7
|
+
import { blameFile } from "../git/blame.js";
|
|
8
|
+
import { showFile } from "../git/show.js";
|
|
9
|
+
import { GitError } from "../git/exec.js";
|
|
10
|
+
import { mergeBase } from "../git/repo.js";
|
|
11
|
+
import { loadDocument } from "../cli/commands.js";
|
|
12
|
+
import { findPackageRoot } from "../package-root.js";
|
|
13
|
+
const MIME = {
|
|
14
|
+
".html": "text/html; charset=utf-8",
|
|
15
|
+
".js": "text/javascript; charset=utf-8",
|
|
16
|
+
".css": "text/css; charset=utf-8",
|
|
17
|
+
".json": "application/json; charset=utf-8",
|
|
18
|
+
".svg": "image/svg+xml",
|
|
19
|
+
".map": "application/json; charset=utf-8",
|
|
20
|
+
".woff2": "font/woff2",
|
|
21
|
+
};
|
|
22
|
+
export async function startServer(opts) {
|
|
23
|
+
const uiRoot = join(findPackageRoot(), "dist/ui");
|
|
24
|
+
const server = createServer((req, res) => {
|
|
25
|
+
void handle(req, res, opts, uiRoot);
|
|
26
|
+
});
|
|
27
|
+
await new Promise((resolve, reject) => {
|
|
28
|
+
server.listen(opts.port, "127.0.0.1", () => resolve());
|
|
29
|
+
server.once("error", reject);
|
|
30
|
+
});
|
|
31
|
+
const address = server.address();
|
|
32
|
+
if (address === null || typeof address === "string") {
|
|
33
|
+
throw new Error("server failed to bind 127.0.0.1");
|
|
34
|
+
}
|
|
35
|
+
const url = `http://127.0.0.1:${address.port}`;
|
|
36
|
+
return { server, port: address.port, url };
|
|
37
|
+
}
|
|
38
|
+
async function handle(req, res, opts, uiRoot) {
|
|
39
|
+
try {
|
|
40
|
+
const host = req.headers.host ?? `127.0.0.1:${opts.port}`;
|
|
41
|
+
const url = new URL(req.url ?? "/", `http://${host}`);
|
|
42
|
+
if (req.method !== "GET") {
|
|
43
|
+
json(res, 405, { error: "method not allowed" });
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (url.pathname === "/api/health") {
|
|
47
|
+
json(res, 200, { ok: true });
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (url.pathname === "/api/review") {
|
|
51
|
+
json(res, 200, await reviewPayload(opts));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (url.pathname === "/api/hunks") {
|
|
55
|
+
json(res, 200, await hunksPayload(opts, url.searchParams.get("group")));
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (url.pathname === "/api/file") {
|
|
59
|
+
json(res, 200, await filePayload(opts, url.searchParams));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (url.pathname === "/api/blame") {
|
|
63
|
+
json(res, 200, await blamePayload(opts, url.searchParams));
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
await serveStatic(res, uiRoot, url.pathname);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
const status = error instanceof HttpError ? error.status : 500;
|
|
70
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
71
|
+
const extra = error instanceof GitError ? { stderr: error.stderr } : {};
|
|
72
|
+
json(res, status, { error: message, ...extra });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
class HttpError extends Error {
|
|
76
|
+
status;
|
|
77
|
+
constructor(status, message) {
|
|
78
|
+
super(message);
|
|
79
|
+
this.status = status;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
async function reviewPayload(opts) {
|
|
83
|
+
const document = await loadDocument(opts.dataPath);
|
|
84
|
+
const resolved = await resolveSource(opts.cwd, document.source.baseRef, document.source.headRef);
|
|
85
|
+
const { files, coverage } = await coverReview(opts.cwd, document);
|
|
86
|
+
const index = await readHunkIndex(opts.cwd, document.source.baseRef, document.source.headRef);
|
|
87
|
+
const commits = await listCommits(opts.cwd, document.source.baseRef, document.source.headRef);
|
|
88
|
+
return {
|
|
89
|
+
document,
|
|
90
|
+
resolved: {
|
|
91
|
+
baseRef: document.source.baseRef,
|
|
92
|
+
headRef: document.source.headRef,
|
|
93
|
+
range: document.source.range ?? `${document.source.baseRef}...${document.source.headRef}`,
|
|
94
|
+
baseSha: resolved.baseSha,
|
|
95
|
+
headSha: resolved.headSha,
|
|
96
|
+
},
|
|
97
|
+
coverage: {
|
|
98
|
+
totalHunks: coverage.totalHunks,
|
|
99
|
+
assignedHunks: coverage.assignedHunks,
|
|
100
|
+
unassignedCount: coverage.unassigned.length,
|
|
101
|
+
staleCount: coverage.stale.length,
|
|
102
|
+
},
|
|
103
|
+
groups: coverage.groups
|
|
104
|
+
.slice()
|
|
105
|
+
.sort((a, b) => a.group.suggestedOrder - b.group.suggestedOrder || a.group.id.localeCompare(b.group.id))
|
|
106
|
+
.map((group) => ({
|
|
107
|
+
id: group.group.id,
|
|
108
|
+
title: group.group.title,
|
|
109
|
+
summary: group.group.summary,
|
|
110
|
+
lookFor: group.group.lookFor ?? [],
|
|
111
|
+
dependsOn: group.group.dependsOn ?? [],
|
|
112
|
+
suggestedOrder: group.group.suggestedOrder,
|
|
113
|
+
hunkCount: group.hunks.length,
|
|
114
|
+
staleCount: group.stale.length,
|
|
115
|
+
files: uniquePaths(group.hunks),
|
|
116
|
+
})),
|
|
117
|
+
unassigned: {
|
|
118
|
+
hunkCount: coverage.unassigned.length,
|
|
119
|
+
files: uniquePaths(coverage.unassigned),
|
|
120
|
+
},
|
|
121
|
+
stale: coverage.stale,
|
|
122
|
+
files: files.map((file) => ({
|
|
123
|
+
path: file.path,
|
|
124
|
+
oldPath: file.oldPath,
|
|
125
|
+
status: file.status,
|
|
126
|
+
binary: file.binary,
|
|
127
|
+
hunkCount: file.hunks.length,
|
|
128
|
+
})),
|
|
129
|
+
skipped: index.skipped,
|
|
130
|
+
commits,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
async function hunksPayload(opts, groupId) {
|
|
134
|
+
if (groupId === null || groupId === "") {
|
|
135
|
+
throw new HttpError(400, "missing group query");
|
|
136
|
+
}
|
|
137
|
+
const document = await loadDocument(opts.dataPath);
|
|
138
|
+
const { files, coverage } = await coverReview(opts.cwd, document);
|
|
139
|
+
if (groupId === "unassigned") {
|
|
140
|
+
return serializeLayer(files, coverage.unassigned);
|
|
141
|
+
}
|
|
142
|
+
const group = coverage.groups.find((item) => item.group.id === groupId);
|
|
143
|
+
if (group === undefined) {
|
|
144
|
+
throw new HttpError(404, `unknown group "${groupId}"`);
|
|
145
|
+
}
|
|
146
|
+
return serializeLayer(files, group.hunks);
|
|
147
|
+
}
|
|
148
|
+
function serializeLayer(files, hunks) {
|
|
149
|
+
const groups = [];
|
|
150
|
+
for (const hunk of hunks) {
|
|
151
|
+
const existing = groups.find((group) => group.file.path === hunk.path);
|
|
152
|
+
if (existing !== undefined) {
|
|
153
|
+
existing.hunks.push(hunk);
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
const file = files.find((item) => item.path === hunk.path);
|
|
157
|
+
if (file === undefined) {
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
groups.push({ file, hunks: [hunk] });
|
|
161
|
+
}
|
|
162
|
+
const serializedFiles = groups.map(({ file, hunks: fileHunks }) => {
|
|
163
|
+
const next = {
|
|
164
|
+
path: file.path,
|
|
165
|
+
patch: filePatchFromGit(file, fileHunks),
|
|
166
|
+
hunks: fileHunks.map(serializeHunk),
|
|
167
|
+
};
|
|
168
|
+
if (file.oldPath !== undefined) {
|
|
169
|
+
next.oldPath = file.oldPath;
|
|
170
|
+
}
|
|
171
|
+
return next;
|
|
172
|
+
});
|
|
173
|
+
return { hunks: hunks.map(serializeHunk), files: serializedFiles };
|
|
174
|
+
}
|
|
175
|
+
async function filePayload(opts, params) {
|
|
176
|
+
const path = requiredQuery(params, "path");
|
|
177
|
+
const side = params.get("side") === "old" ? "old" : "new";
|
|
178
|
+
const document = await loadDocument(opts.dataPath);
|
|
179
|
+
const { files } = await coverReview(opts.cwd, document);
|
|
180
|
+
const file = findFile(files, path);
|
|
181
|
+
const lookup = side === "old" ? (file.oldPath ?? file.path) : file.path;
|
|
182
|
+
if (side === "old" && file.status === "added") {
|
|
183
|
+
throw new HttpError(404, "file did not exist on the base side");
|
|
184
|
+
}
|
|
185
|
+
if (side === "new" && file.status === "deleted") {
|
|
186
|
+
throw new HttpError(404, "file does not exist on the head side");
|
|
187
|
+
}
|
|
188
|
+
const ref = side === "old" ? await mergeBase(opts.cwd, document.source.baseRef, document.source.headRef) : document.source.headRef;
|
|
189
|
+
try {
|
|
190
|
+
const content = await showFile(opts.cwd, ref, lookup);
|
|
191
|
+
return { path: lookup, ref, side, content, language: fileLanguage(lookup) };
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
throw new HttpError(404, error instanceof Error ? error.message : "file not found");
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
async function blamePayload(opts, params) {
|
|
198
|
+
const path = requiredQuery(params, "path");
|
|
199
|
+
const side = params.get("side") === "old" ? "old" : "new";
|
|
200
|
+
const document = await loadDocument(opts.dataPath);
|
|
201
|
+
const { files } = await coverReview(opts.cwd, document);
|
|
202
|
+
const file = findFile(files, path);
|
|
203
|
+
const lookup = side === "old" ? (file.oldPath ?? file.path) : file.path;
|
|
204
|
+
if (side === "old" && file.status === "added") {
|
|
205
|
+
throw new HttpError(404, "file did not exist on the base side");
|
|
206
|
+
}
|
|
207
|
+
if (side === "new" && file.status === "deleted") {
|
|
208
|
+
throw new HttpError(404, "file does not exist on the head side");
|
|
209
|
+
}
|
|
210
|
+
const ref = side === "old" ? await mergeBase(opts.cwd, document.source.baseRef, document.source.headRef) : document.source.headRef;
|
|
211
|
+
try {
|
|
212
|
+
const lines = await blameFile(opts.cwd, ref, lookup);
|
|
213
|
+
return { path: lookup, ref, side, lines };
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
throw new HttpError(404, error instanceof Error ? error.message : "blame not available");
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
function findFile(files, path) {
|
|
220
|
+
const file = files.find((item) => item.path === path || item.oldPath === path);
|
|
221
|
+
if (file === undefined) {
|
|
222
|
+
throw new HttpError(404, `path is not in the live diff: ${path}`);
|
|
223
|
+
}
|
|
224
|
+
return file;
|
|
225
|
+
}
|
|
226
|
+
function requiredQuery(params, name) {
|
|
227
|
+
const value = params.get(name);
|
|
228
|
+
if (value === null || value === "") {
|
|
229
|
+
throw new HttpError(400, `missing ${name}`);
|
|
230
|
+
}
|
|
231
|
+
return value;
|
|
232
|
+
}
|
|
233
|
+
function serializeHunk(hunk) {
|
|
234
|
+
return {
|
|
235
|
+
...toHunkRef(hunk),
|
|
236
|
+
header: hunk.header,
|
|
237
|
+
language: fileLanguage(hunk.path),
|
|
238
|
+
lines: hunk.lines,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
function uniquePaths(hunks) {
|
|
242
|
+
return [...new Set(hunks.map((hunk) => hunk.path))];
|
|
243
|
+
}
|
|
244
|
+
function json(res, status, body) {
|
|
245
|
+
const payload = `${JSON.stringify(body)}\n`;
|
|
246
|
+
res.writeHead(status, {
|
|
247
|
+
"content-type": "application/json; charset=utf-8",
|
|
248
|
+
"cache-control": "no-store",
|
|
249
|
+
"content-length": Buffer.byteLength(payload),
|
|
250
|
+
});
|
|
251
|
+
res.end(payload);
|
|
252
|
+
}
|
|
253
|
+
async function serveStatic(res, uiRoot, pathname) {
|
|
254
|
+
if (!existsSync(uiRoot)) {
|
|
255
|
+
throw new HttpError(503, "UI is missing from this install. Reinstall comprehende from npm, or from a git checkout run `pnpm build`.");
|
|
256
|
+
}
|
|
257
|
+
const relative = pathname === "/" ? "index.html" : pathname.replace(/^\/+/, "");
|
|
258
|
+
const uiAbs = resolve(uiRoot);
|
|
259
|
+
const candidate = resolve(uiRoot, relative);
|
|
260
|
+
if (candidate !== uiAbs && !candidate.startsWith(`${uiAbs}/`)) {
|
|
261
|
+
throw new HttpError(400, "invalid path");
|
|
262
|
+
}
|
|
263
|
+
const filePath = existsSync(candidate) && statSync(candidate).isFile() ? candidate : join(uiRoot, "index.html");
|
|
264
|
+
const stream = createReadStream(filePath);
|
|
265
|
+
res.writeHead(200, {
|
|
266
|
+
"content-type": MIME[extname(filePath)] ?? "application/octet-stream",
|
|
267
|
+
"cache-control": pathname.startsWith("/assets/") ? "public, max-age=31536000, immutable" : "no-store",
|
|
268
|
+
});
|
|
269
|
+
stream.pipe(res);
|
|
270
|
+
}
|