local-diff-reviewer 0.1.0 → 1.0.1
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/README.md +4 -2
- package/dist/cli/start.js +21 -5
- package/dist/web/assets/{arc-CR7lDgfr.js → arc-DfZYUaz4.js} +1 -1
- package/dist/web/assets/{architectureDiagram-3BPJPVTR-B-Kf98tI.js → architectureDiagram-3BPJPVTR-Un1C7dX5.js} +1 -1
- package/dist/web/assets/{blockDiagram-GPEHLZMM-C6G2D8zB.js → blockDiagram-GPEHLZMM-DoE66LOm.js} +1 -1
- package/dist/web/assets/{c4Diagram-AAUBKEIU-B8Z0vFGi.js → c4Diagram-AAUBKEIU-Ch17mKwl.js} +1 -1
- package/dist/web/assets/channel-tS6_tEZH.js +1 -0
- package/dist/web/assets/{chunk-2J33WTMH-BJYcz9p6.js → chunk-2J33WTMH-DsTTzQ06.js} +1 -1
- package/dist/web/assets/{chunk-3OPIFGDE-CadWbiuZ.js → chunk-3OPIFGDE-C4BFnYAe.js} +1 -1
- package/dist/web/assets/{chunk-4BX2VUAB-p5TBPKfa.js → chunk-4BX2VUAB-CBYOekG6.js} +1 -1
- package/dist/web/assets/{chunk-55IACEB6-Cd7Tpfqt.js → chunk-55IACEB6-bkX7IfWj.js} +1 -1
- package/dist/web/assets/{chunk-5ZQYHXKU-rVi82pOk.js → chunk-5ZQYHXKU-DmYX07rl.js} +1 -1
- package/dist/web/assets/{chunk-727SXJPM-DCK60o1J.js → chunk-727SXJPM-myW6yB1O.js} +1 -1
- package/dist/web/assets/{chunk-AQP2D5EJ-DsaTBCmF.js → chunk-AQP2D5EJ-fa_HpDkc.js} +1 -1
- package/dist/web/assets/{chunk-BSJP7CBP-Bhh_dCA1.js → chunk-BSJP7CBP-NpOkPl8K.js} +1 -1
- package/dist/web/assets/{chunk-CSCIHK7Q-BTxAxDrY.js → chunk-CSCIHK7Q-jWMYsJiR.js} +1 -1
- package/dist/web/assets/{chunk-FMBD7UC4-DlFkGqeu.js → chunk-FMBD7UC4-BuB89xp8.js} +1 -1
- package/dist/web/assets/{chunk-KSCS5N6A-BYPjHZNn.js → chunk-KSCS5N6A-BvSsBz45.js} +1 -1
- package/dist/web/assets/{chunk-L5ZTLDWV-BMFnPCzP.js → chunk-L5ZTLDWV-Cslvwh3t.js} +1 -1
- package/dist/web/assets/{chunk-LZXEDZCA-BKhHYjKh.js → chunk-LZXEDZCA-lDGN1tUz.js} +2 -2
- package/dist/web/assets/{chunk-ND2GUHAM-7KRXvqPH.js → chunk-ND2GUHAM-DGtWurFf.js} +1 -1
- package/dist/web/assets/{chunk-NZK2D7GU-C2gmfVLG.js → chunk-NZK2D7GU-BhN9qm2L.js} +1 -1
- package/dist/web/assets/{chunk-O5CBEL6O-BDgBHpRo.js → chunk-O5CBEL6O-DPNhEfdl.js} +1 -1
- package/dist/web/assets/chunk-QZHKN3VN-MdvGD9q1.js +1 -0
- package/dist/web/assets/chunk-WU5MYG2G-Cot-8ei2.js +1 -0
- package/dist/web/assets/{chunk-XPW4576I-CNcwF46w.js → chunk-XPW4576I-BRb6pBFA.js} +1 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-Ba9dn90z.js +1 -0
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-AkPgLlFm.js +1 -0
- package/dist/web/assets/{cose-bilkent-S5V4N54A-DGxrNo18.js → cose-bilkent-S5V4N54A-DP7aCqjn.js} +1 -1
- package/dist/web/assets/{dagre-BM42HDAG-DgS2nVEP.js → dagre-BM42HDAG-DW8OoOF9.js} +1 -1
- package/dist/web/assets/{diagram-2AECGRRQ-CZ3HTlHq.js → diagram-2AECGRRQ-Dhr52Lcq.js} +1 -1
- package/dist/web/assets/{diagram-5GNKFQAL-Q7ELSmIM.js → diagram-5GNKFQAL-00RS5q-p.js} +1 -1
- package/dist/web/assets/{diagram-KO2AKTUF-E5adO5kX.js → diagram-KO2AKTUF-CV1YsijI.js} +1 -1
- package/dist/web/assets/{diagram-LMA3HP47-DckjoLmV.js → diagram-LMA3HP47-Cu6hlhhL.js} +1 -1
- package/dist/web/assets/{diagram-OG6HWLK6-C6IV8tgf.js → diagram-OG6HWLK6-f8Aglkk5.js} +1 -1
- package/dist/web/assets/{dist-BBL8i-qs.js → dist-BbvzfnQH.js} +1 -1
- package/dist/web/assets/{erDiagram-TEJ5UH35-CtdFt0tH.js → erDiagram-TEJ5UH35-BOpwL6Hq.js} +1 -1
- package/dist/web/assets/{flowDiagram-I6XJVG4X-Cj3R7yTy.js → flowDiagram-I6XJVG4X-JpfaqfMd.js} +1 -1
- package/dist/web/assets/{ganttDiagram-6RSMTGT7-Bb6ylSyS.js → ganttDiagram-6RSMTGT7-_07N56My.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-PVQCEYII-DJHSJ07v.js → gitGraphDiagram-PVQCEYII-CW2hqk_8.js} +1 -1
- package/dist/web/assets/{index-Byh7XaFy.js → index-CxFV1WHQ.js} +2 -2
- package/dist/web/assets/{infoDiagram-5YYISTIA-1xrP_FxB.js → infoDiagram-5YYISTIA-B35H3DgZ.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-DxyBX-lT.js → ishikawaDiagram-YF4QCWOH-DxVWMRSB.js} +1 -1
- package/dist/web/assets/{journeyDiagram-JHISSGLW-DMcyhQOZ.js → journeyDiagram-JHISSGLW-C__VorSx.js} +1 -1
- package/dist/web/assets/{kanban-definition-UN3LZRKU-qZQpCEuA.js → kanban-definition-UN3LZRKU-BKSCqg5P.js} +1 -1
- package/dist/web/assets/{line-BJ3a5kXp.js → line-SFaTyCgO.js} +1 -1
- package/dist/web/assets/{linear-WojM0Myz.js → linear-CCDSib_A.js} +1 -1
- package/dist/web/assets/{mermaid-parser.core-CXQdsx5L.js → mermaid-parser.core-B4q5D_X_.js} +1 -1
- package/dist/web/assets/{mermaid.core-D-XPCWky.js → mermaid.core-DiPBDfaO.js} +3 -3
- package/dist/web/assets/{mindmap-definition-RKZ34NQL-B3OxgBPA.js → mindmap-definition-RKZ34NQL-BJZedUBK.js} +1 -1
- package/dist/web/assets/{pieDiagram-4H26LBE5-Div1l6Q1.js → pieDiagram-4H26LBE5-DtkdCUA9.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-W4KKPZXB-CeXbRhNe.js → quadrantDiagram-W4KKPZXB-Cks8DI1_.js} +1 -1
- package/dist/web/assets/{requirementDiagram-4Y6WPE33-BlGgeVCv.js → requirementDiagram-4Y6WPE33-DIJqz1Ht.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-5OEKKPKP-BhwjPB4q.js → sankeyDiagram-5OEKKPKP-waqn6y15.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-3UESZ5HK-DNHlWYtx.js → sequenceDiagram-3UESZ5HK-Cyzxtc0o.js} +1 -1
- package/dist/web/assets/{src-Bn2XKj5Y.js → src-DboPYYAM.js} +1 -1
- package/dist/web/assets/{stateDiagram-AJRCARHV-CdZgtb-A.js → stateDiagram-AJRCARHV-BIfp7CSY.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-CBvj4HDj.js +1 -0
- package/dist/web/assets/{timeline-definition-PNZ67QCA-Ch-1WuO4.js → timeline-definition-PNZ67QCA-5e-cw7ns.js} +1 -1
- package/dist/web/assets/{vennDiagram-CIIHVFJN-BU0olyYI.js → vennDiagram-CIIHVFJN-H4TiL4fv.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-YWT4CUSO-DXFmQa94.js → wardleyDiagram-YWT4CUSO-C9je1Qmh.js} +1 -1
- package/dist/web/assets/{xychartDiagram-2RQKCTM6-BY6dYn-A.js → xychartDiagram-2RQKCTM6-CbnF4TLC.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +12 -2
- package/dist/web/assets/channel-BLQGEX2L.js +0 -1
- package/dist/web/assets/chunk-QZHKN3VN-BGdvirFT.js +0 -1
- package/dist/web/assets/chunk-WU5MYG2G-VXAyXnrB.js +0 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-DGbdorsF.js +0 -1
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-CdJT8iZ_.js +0 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-C5vqR8l5.js +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# diff-review
|
|
2
2
|
|
|
3
|
+

|
|
4
|
+
|
|
3
5
|
AI chat 里的本地代码审查工具。可以直接用 CLI 打开,也可以安装成 agent skill。
|
|
4
6
|
|
|
5
7
|
## Quick Start
|
|
@@ -20,7 +22,7 @@ local-diff-reviewer
|
|
|
20
22
|
Enable use from AI agents:
|
|
21
23
|
|
|
22
24
|
```bash
|
|
23
|
-
npx skills add
|
|
25
|
+
npx skills add Mone-Lee/diff-review
|
|
24
26
|
```
|
|
25
27
|
|
|
26
28
|
## 功能边界
|
|
@@ -108,7 +110,7 @@ local-diff-reviewer HEAD~1 HEAD
|
|
|
108
110
|
安装 skill:
|
|
109
111
|
|
|
110
112
|
```bash
|
|
111
|
-
npx skills add
|
|
113
|
+
npx skills add Mone-Lee/diff-review
|
|
112
114
|
```
|
|
113
115
|
|
|
114
116
|
skill 会从目标 workspace 运行 `npx local-diff-reviewer [args...]`。
|
package/dist/cli/start.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// src/cli/start.ts
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
5
|
import { existsSync as existsSync2 } from "node:fs";
|
|
6
|
-
import { dirname as dirname2, join as join4, resolve } from "node:path";
|
|
6
|
+
import { dirname as dirname2, join as join4, resolve as resolve2 } from "node:path";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
|
|
9
9
|
// src/server/storage.ts
|
|
@@ -513,7 +513,7 @@ function binaryAddedDiff(path) {
|
|
|
513
513
|
// src/server/index.ts
|
|
514
514
|
import express from "express";
|
|
515
515
|
import { existsSync } from "node:fs";
|
|
516
|
-
import { join as join3 } from "node:path";
|
|
516
|
+
import { join as join3, normalize as normalize2, resolve, sep } from "node:path";
|
|
517
517
|
|
|
518
518
|
// src/core/markdown-source-map.ts
|
|
519
519
|
import GithubSlugger from "github-slugger";
|
|
@@ -649,6 +649,22 @@ async function startServer(state, port = 4966) {
|
|
|
649
649
|
next(error);
|
|
650
650
|
}
|
|
651
651
|
});
|
|
652
|
+
app.get("/api/markdown-asset", (req, res) => {
|
|
653
|
+
const relativePath = String(req.query.path ?? "").trim();
|
|
654
|
+
if (!relativePath) {
|
|
655
|
+
res.status(400).json({ error: "Asset path is required" });
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
const repoRoot = resolve(state.session.repoRoot);
|
|
659
|
+
const normalizedRelativePath = normalize2(relativePath);
|
|
660
|
+
const absolutePath = resolve(repoRoot, normalizedRelativePath);
|
|
661
|
+
const inRepo = absolutePath === repoRoot || absolutePath.startsWith(`${repoRoot}${sep}`);
|
|
662
|
+
if (!inRepo || !existsSync(absolutePath)) {
|
|
663
|
+
res.status(404).json({ error: "Asset not found" });
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
res.sendFile(absolutePath);
|
|
667
|
+
});
|
|
652
668
|
app.get("/api/threads", async (_req, res, next) => {
|
|
653
669
|
try {
|
|
654
670
|
res.json(await readComments(state.session.repoRoot));
|
|
@@ -844,11 +860,11 @@ async function startServer(state, port = 4966) {
|
|
|
844
860
|
app.use((error, _req, res, _next) => {
|
|
845
861
|
res.status(500).json({ error: error.message });
|
|
846
862
|
});
|
|
847
|
-
return new Promise((
|
|
863
|
+
return new Promise((resolve3) => {
|
|
848
864
|
const server = app.listen(port, "127.0.0.1", () => {
|
|
849
865
|
const address = server.address();
|
|
850
866
|
const actualPort = typeof address === "object" && address ? address.port : port;
|
|
851
|
-
|
|
867
|
+
resolve3(`http://127.0.0.1:${actualPort}`);
|
|
852
868
|
});
|
|
853
869
|
});
|
|
854
870
|
}
|
|
@@ -861,7 +877,7 @@ function selectPromptThreads(threads, scope) {
|
|
|
861
877
|
}
|
|
862
878
|
|
|
863
879
|
// src/cli/start.ts
|
|
864
|
-
var packageRoot =
|
|
880
|
+
var packageRoot = resolve2(dirname2(fileURLToPath(import.meta.url)), "../..");
|
|
865
881
|
var builtWebDist = join4(packageRoot, "dist", "web");
|
|
866
882
|
async function main() {
|
|
867
883
|
const { dev, reviewArgs, comments } = parseCliOptions(process.argv.slice(2));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./path-BJQEcSo7.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-
|
|
1
|
+
import{n as e,t}from"./path-BJQEcSo7.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-BbvzfnQH.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,t,n,r,i,a,o){var c=e-n,l=t-r,u=(o?a:-a)/d(c*c+l*l),f=u*l,p=-u*c,m=e+f,h=t+p,g=n+f,_=r+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=i-a,w=m*_-g*h,T=(x<0?-1:1)*d(s(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(i/C-1),y11:D*(i/C-1)}}function x(){var s=m,x=h,S=e(0),C=null,w=g,T=_,E=v,D=null,O=t(k);function k(){var e,t,m=+s.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-r,_=T.apply(this,arguments)-r,v=l(_-g),k=_>g;if(D||=e=O(),h<m&&(t=h,h=m,m=t),!(h>1e-12))D.moveTo(0,0);else if(v>c-1e-12)D.moveTo(h*u(g),h*a(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*u(_),m*a(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):d(m*m+h*h)),R=p(l(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=o(L/m*a(I)),W=o(L/h*a(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*u(A),K=h*a(A),q=m*u(N),J=m*a(N);if(R>1e-12){var Y=h*u(j),X=h*a(j),Z=m*u(M),Q=m*a(M),$;if(v<i)if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/a(f((ee*ne+te*re)/(d(ee*ee+te*te)*d(ne*ne+re*re)))/2),ae=d($[0]*$[0]+$[1]*$[1]);z=p(R,(m-ae)/(ie-1)),B=p(R,(h-ae)/(ie+1))}else z=B=0}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,h,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,n(H.y11,H.x11),n(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,m,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,n(H.y11,H.x11),n(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),e)return D=null,e+``||null}return k.centroid=function(){var e=(+s.apply(this,arguments)+ +x.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-i/2;return[u(t)*e,a(t)*e]},k.innerRadius=function(t){return arguments.length?(s=typeof t==`function`?t:e(+t),k):s},k.outerRadius=function(t){return arguments.length?(x=typeof t==`function`?t:e(+t),k):x},k.cornerRadius=function(t){return arguments.length?(S=typeof t==`function`?t:e(+t),k):S},k.padRadius=function(t){return arguments.length?(C=t==null?null:typeof t==`function`?t:e(+t),k):C},k.startAngle=function(t){return arguments.length?(w=typeof t==`function`?t:e(+t),k):w},k.endAngle=function(t){return arguments.length?(T=typeof t==`function`?t:e(+t),k):T},k.padAngle=function(t){return arguments.length?(E=typeof t==`function`?t:e(+t),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
|