scip-query 0.17.0 → 0.17.2
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/CHANGELOG.md +23 -0
- package/README.md +19 -0
- package/dist/{chunk-ZMD4O5UP.js → chunk-2A7LUMZP.js} +2 -2
- package/dist/{chunk-VCOAUTSI.js → chunk-4H7T7FIM.js} +2 -2
- package/dist/{chunk-LC57FSPX.js → chunk-4QBRVI7D.js} +2 -2
- package/dist/chunk-4XTPZ5CR.js +9 -0
- package/dist/chunk-6AITNECC.js +928 -0
- package/dist/chunk-6JSTKSZH.js +3 -0
- package/dist/{chunk-A4KRWTXD.js → chunk-7LERNHDG.js} +2 -2
- package/dist/{chunk-75H6GOND.js → chunk-7ROLM67J.js} +2 -2
- package/dist/{chunk-EPDV3SQD.js → chunk-7VR5TNOI.js} +2 -2
- package/dist/chunk-A2GX3PYV.js +5 -0
- package/dist/{chunk-KYUYAWKA.js → chunk-APCXCRED.js} +2 -2
- package/dist/{chunk-H4SMB657.js → chunk-ATC4MEVA.js} +2 -2
- package/dist/chunk-AWYKDRYV.js +2 -0
- package/dist/{chunk-PYOZHG6A.js → chunk-AY44MGWS.js} +2 -2
- package/dist/{chunk-7MT6UM4D.js → chunk-BEGHYHOQ.js} +2 -2
- package/dist/{chunk-JJAH2VLD.js → chunk-BPMBOZAN.js} +2 -2
- package/dist/{chunk-3EBDPBBU.js → chunk-C7MBQSIC.js} +2 -2
- package/dist/{chunk-KAOWSWEX.js → chunk-CHJ3QROR.js} +2 -2
- package/dist/{chunk-VT2KFEPG.js → chunk-CVWX24IY.js} +2 -2
- package/dist/chunk-DJI446FQ.js +18 -0
- package/dist/{chunk-6G3GQWTK.js → chunk-ELLPMCWA.js} +2 -2
- package/dist/{chunk-42YU6TEB.js → chunk-FVLZB54V.js} +2 -2
- package/dist/{chunk-VPVAQRHM.js → chunk-G6DDSHMD.js} +2 -2
- package/dist/{chunk-OP5JXGDV.js → chunk-IG6X65MG.js} +2 -2
- package/dist/{chunk-KZ2LZBQT.js → chunk-IKMOYFUM.js} +2 -2
- package/dist/{chunk-Y3DG4J6A.js → chunk-IS7DZ7TB.js} +2 -2
- package/dist/{chunk-HGO3D2JD.js → chunk-J7IMQRCU.js} +2 -2
- package/dist/{chunk-J4HK7PQS.js → chunk-K4XL4HOK.js} +2 -2
- package/dist/{chunk-5ODF4JGH.js → chunk-K53GNKY3.js} +2 -2
- package/dist/{chunk-5N5ZC566.js → chunk-K65T4TJS.js} +2 -2
- package/dist/{chunk-YD7GGLGE.js → chunk-KA7RMBVU.js} +2 -2
- package/dist/{chunk-7CHIAMKS.js → chunk-KJOKTZUE.js} +2 -2
- package/dist/chunk-KSD6IWF4.js +38 -0
- package/dist/{chunk-OQRMCT2N.js → chunk-LEKXKHIQ.js} +5 -5
- package/dist/{chunk-KTZACYL6.js → chunk-LFPQFRCX.js} +2 -2
- package/dist/{chunk-Y5BOEWAE.js → chunk-LL5NQB5V.js} +2 -2
- package/dist/{chunk-MVFNACWB.js → chunk-MBVHEPHQ.js} +2 -2
- package/dist/{chunk-KO2TFDIP.js → chunk-MFIA6EIT.js} +2 -2
- package/dist/{chunk-PVXSHZLW.js → chunk-N3JH45WR.js} +2 -2
- package/dist/{chunk-QNCVN5EH.js → chunk-NJD4C5G5.js} +3 -3
- package/dist/{chunk-JUADXGUH.js → chunk-NJTIAQY7.js} +2 -2
- package/dist/{chunk-LG33DNTZ.js → chunk-NX2YAXVQ.js} +2 -2
- package/dist/{chunk-VDHEX6YO.js → chunk-O5A7BTMA.js} +2 -2
- package/dist/{chunk-JYBF5CPE.js → chunk-O7NA5FCA.js} +2 -2
- package/dist/{chunk-U3JW5AYG.js → chunk-OINSINYW.js} +2 -2
- package/dist/{chunk-JVTMRIKU.js → chunk-OQFA2SUQ.js} +2 -2
- package/dist/{chunk-DQYG5JHT.js → chunk-OQFPCIXO.js} +2 -2
- package/dist/{chunk-ABRWGVC6.js → chunk-P6FOIU7O.js} +2 -2
- package/dist/{chunk-NJBARXRO.js → chunk-PQD7P6WB.js} +2 -2
- package/dist/{chunk-OP5RO2CF.js → chunk-Q4GKL4CC.js} +2 -2
- package/dist/{chunk-TL2IXVGH.js → chunk-ROMKXEUM.js} +2 -2
- package/dist/{chunk-CYDOV3AQ.js → chunk-RUV4KHWA.js} +2 -2
- package/dist/{chunk-34RCSYMZ.js → chunk-S22ICAWV.js} +2 -2
- package/dist/chunk-SALRDXWM.js +121 -0
- package/dist/chunk-SON6DQNK.js +7 -0
- package/dist/{chunk-SREWDA7Q.js → chunk-SSGACGAD.js} +2 -2
- package/dist/{chunk-PA2MQKXD.js → chunk-SUYCF4SX.js} +2 -2
- package/dist/chunk-SXDXR5FH.js +2 -0
- package/dist/{chunk-TR7C5HOC.js → chunk-T4P27T6S.js} +2 -2
- package/dist/{chunk-BBBZB5WY.js → chunk-U4G4UYLB.js} +2 -2
- package/dist/{chunk-IK2NG76R.js → chunk-W7FNZKX5.js} +2 -2
- package/dist/chunk-WD3PAQJT.js +10 -0
- package/dist/{chunk-AQ34B63A.js → chunk-XLJORP6N.js} +2 -2
- package/dist/chunk-XTF6ELXT.js +3 -0
- package/dist/{chunk-7Z5UT44B.js → chunk-YMFHC5J2.js} +2 -2
- package/dist/{chunk-WH65EY7U.js → chunk-YYYERNQL.js} +2 -2
- package/dist/chunk-Z4MCFCGX.js +3 -0
- package/dist/cli.js +3 -1528
- package/dist/command-descriptors-7UUURHWT.js +599 -0
- package/dist/direct-navigation-CVCFER5G.js +3 -0
- package/dist/index.js +1 -1
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +2 -0
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +2 -0
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +22 -22
- package/dist/reindex.js +36 -36
- package/dist/runtime.d.ts +2 -0
- package/dist/runtime.js +1 -1
- package/dist/watch-server.js +4 -4
- package/docs/COMMAND_REFERENCE.md +3 -0
- package/package.json +2 -1
- package/skills/scip-tla-model-system/SKILL.md +10 -8
- package/dist/chunk-2HCWAL42.js +0 -3
- package/dist/chunk-GRHA5NGF.js +0 -2
- package/dist/chunk-HV4N3UBV.js +0 -10
- package/dist/chunk-KLFCCRI7.js +0 -21
- package/dist/chunk-L7UITWFE.js +0 -120
- package/dist/chunk-QVZSWLLZ.js +0 -2
- package/dist/chunk-RSZ4KX4B.js +0 -7
- package/dist/chunk-RZEVUYMG.js +0 -2
- package/dist/chunk-TCOWAGR2.js +0 -38
- package/dist/chunk-X566NT42.js +0 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
1
|
+
import{a as s}from"./chunk-K65T4TJS.js";function m(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d2.relative_path
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d1 ON c.document_id = d1.id
|
|
@@ -30,4 +30,4 @@ import{a as s}from"./chunk-5N5ZC566.js";function m(e,d){let i=s(e,d);return i?e.
|
|
|
30
30
|
WHERE d2.relative_path = ?
|
|
31
31
|
AND d1.relative_path != ?
|
|
32
32
|
ORDER BY d1.relative_path`,i,i).filter(t=>!e.isIgnored(t.relative_path)).map(t=>({relativePath:t.relative_path})):[]}export{m as a,o as b};
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-SUYCF4SX.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as F}from"./chunk-O7NA5FCA.js";import{a as B}from"./chunk-7ROLM67J.js";import{a as j}from"./chunk-XLJORP6N.js";import{a as y}from"./chunk-CHJ3QROR.js";import{a as z}from"./chunk-H4T2AST4.js";import{a as $}from"./chunk-IS7DZ7TB.js";import{a as v,b as G}from"./chunk-SUYCF4SX.js";import{b as k}from"./chunk-AWYKDRYV.js";import{a as T}from"./chunk-4XTPZ5CR.js";import{a as E}from"./chunk-P6FOIU7O.js";import{a as I}from"./chunk-WD3PAQJT.js";import{a as H}from"./chunk-KJOKTZUE.js";import{a as O}from"./chunk-W7FNZKX5.js";import{s as A}from"./chunk-M2TRDR25.js";function ne(n,e,o={}){let i=o.impactDepth??3,r=o.sliceDepth??3,c=o.semantic,a=!N(e),u=a?l("trace",e,()=>j(n,e,{semantic:c}),t=>({definitions:t.definitions.length,references:t.referencedBy.length})):{definitions:[],referencedBy:[]},s=a?l("call-graph",e,()=>H(n,e,{semantic:c}),t=>({callers:t?.callers.length??0,callees:t?.callees.length??0})):null,d=a?l("complexity",e,()=>E(n,e,{semantic:c}),t=>({callees:t?.calleeCount??0})):null,g=a?l("dataflow",e,()=>$(n,e,{semantic:c}),t=>({references:t?.usageSites.length??0,producers:t?.producers.length??0,consumers:t?.consumers.length??0})):null,C=a?l("backward-slice",e,()=>y(n,e,{direction:"backward",maxDepth:r,semantic:c}),t=>({maxDepth:r,connectedSymbols:t?.connectedSymbols.length??0})):null,x=a?l("forward-slice",e,()=>y(n,e,{direction:"forward",maxDepth:r,semantic:c}),t=>({maxDepth:r,connectedSymbols:t?.connectedSymbols.length??0})):null,R=a?l("affected",e,()=>I(n,e,{maxDepth:i,scope:o.scope}),t=>({maxDepth:i,affectedSymbols:t.length})):[],h=l("change-surface",e,()=>O(n,e,{semantic:c}),t=>({symbols:t?.symbols.length??0,externalConsumers:t?.totalExternalConsumers??0})),p=l("system",e,()=>B(n,e),t=>({files:t.files.length,symbols:t.symbols.length})),m=p.files.length===1,b=l("deps",e,()=>m?p.dependsOn.map(t=>({relativePath:t})):v(n,e),t=>({files:t.length,reusedSystem:m})),S=l("rdeps",e,()=>m?p.dependedOnBy.map(t=>({relativePath:t})):G(n,e),t=>({files:t.length,reusedSystem:m})),w=l("surface",e,()=>F(n,e),t=>({consumers:t.length})),f={symbol:u.definitions.length>0||u.referencedBy.length>0||s!==null||d!==null||g!==null||C!==null||x!==null||R.length>0,file:h!==null||b.length>0||S.length>0,module:p.files.length>0||p.symbols.length>0||w.length>0},D=[];!f.symbol&&!f.file&&!f.module&&D.push("No symbol, file, or module matched target.");let P=h?.file??u.definitions[0]?.relativePath??null;return{target:e,matched:f,history:l("history",P??e,()=>L(n,P,o.gitHead)),trace:u,callGraph:s,complexity:d,dataflow:g,backwardSlice:C,forwardSlice:x,affected:R,changeSurface:h,deps:b,rdeps:S,system:p,surface:w,warnings:D}}function l(n,e,o,i=()=>({})){let r;return A(`plan-context.${n}`,()=>(r=o(),r),()=>({target:e,...i(r)}))}function L(n,e,o){let i={available:!1,file:e,churn:null,coChangePartners:[],suppressionsInFile:0};if(!e)return i;let r=T(n,o?{head:o}:{}),c=l("history.churn",e,()=>r.fileChurn(),s=>({files:s?.size??0}));if(!c)return i;let a=l("history.co-change",e,()=>k(n,e,{limit:5,...o?{head:o}:{}}),s=>({commits:s.commitsAnalyzed,partners:s.findings.length})),u=l("history.suppressions",e,()=>z(n).byFile.get(e)??0,s=>({suppressions:s}));return{available:!0,file:e,churn:c.get(e)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:a.findings.map(s=>({file:s.fileA===e?s.fileB:s.fileA,together:s.together,confidence:s.confidence,subjectContext:s.subjectContext})),suppressionsInFile:u}}function N(n){return n.includes("/")||n.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(n)}export{ne as a};
|
|
2
|
+
//# sourceMappingURL=chunk-SXDXR5FH.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b}from"./chunk-K65T4TJS.js";import{m as d,x as f}from"./chunk-7XP7ZRSI.js";function S(a,g){let p=b(a,g),i=f(a,p,{sort:!0});if(i.length===0)return[];let o=i.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,signature:e.signature,children:[]})),s=new Map;for(let e of o)s.set(e.symbol,e);let c=[];for(let e=0;e<i.length;e++){let r=i[e],n=o[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of o)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!d(t.symbol,n.symbol))continue;let u=t.endLine-t.startLine;u<m&&(m=u,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-T4P27T6S.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as C}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as C}from"./chunk-RUV4KHWA.js";import{m as v}from"./chunk-MBVHEPHQ.js";import{f as O,i as x,m as T}from"./chunk-NJD4C5G5.js";import{d as A}from"./chunk-7XP7ZRSI.js";import{f as b}from"./chunk-JLZUM476.js";import{B as g}from"./chunk-TLTLJ4SW.js";function H(e,n={}){let{samples:o=50,scope:r,maxDisagreements:u=5}=n,l=new C(e),a=B(l.productionCallableDefinitions({scope:r,minLoc:2,requireFunctionLikeSymbol:!0}),o),c=K(e,a);if(a.length===0||!c)return{available:!1,sampleSize:a.length,oracleCoverage:0,scores:[],topDisagreements:[]};let t={references:P(),callees:P()},i=[],f=0,m=c==="semantic"?T(e,a):new Map,I=c==="source"?E(e,l,a):null;for(let s of a){let p=S(s,c==="semantic"?x(e,s).map(d=>d.file):[...I?.referencesBySymbolId.get(s.symbolId)??[]]),j=S(s,c==="semantic"?(m.get(s.symbolId)??[]).map(d=>d.file):[...I?.calleesBySymbolId.get(s.symbolId)??[]]);f+=1;let L=S(s,v(e,s).map(d=>d.file)),k=S(s,(l.calleeMap([s],{semantic:!1}).get(s.symbolId)??[]).map(d=>d.file)),w=y(c,"references"),R=y(c,"callees");Q(t.references,s,"references",L,p,w,i),Q(t.callees,s,"callees",k,j,R,i)}return i.sort((s,p)=>p.cheapOnly.length+p.oracleOnly.length-(s.cheapOnly.length+s.oracleOnly.length)),{available:!0,sampleSize:a.length,oracleCoverage:a.length>0?D(f/a.length):0,oracleKind:c,scores:["references","callees"].map(s=>F(s,t[s],c)),topDisagreements:i.slice(0,u)}}function P(){return{comparedSymbols:0,agreed:0,cheapTotal:0,oracleTotal:0,skippedOraclePartial:0}}function B(e,n){let o=[...e].sort((l,a)=>l.symbolId-a.symbolId);if(o.length<=n)return o;let r=o.length/n,u=[];for(let l=0;l<n;l++)u.push(o[Math.floor(l*r)]);return u}function K(e,n){let o=n[0];if(!o)return null;if(h(e,o))return"source";try{if(O(e).capability("semantic-references",o.relativePath).available)return"semantic"}catch{}return n.some(r=>h(e,r))?"source":null}function S(e,n){let o=new Set;for(let r of n)r!==e.relativePath&&o.add(r);return o}function Q(e,n,o,r,u,l,a){if(!l&&u.size===0){e.skippedOraclePartial+=1;return}e.comparedSymbols+=1,e.cheapTotal+=r.size,e.oracleTotal+=u.size;let c=[],t=[];for(let i of r)u.has(i)?e.agreed+=1:c.push(i);for(let i of u)r.has(i)||t.push(i);(c.length>0||t.length>0)&&a.push({symbol:A(n.symbol),question:o,cheapOnly:c,oracleOnly:t})}var z={references:!0,callees:!1};function F(e,n,o){let r=n.oracleTotal>0?n.agreed/n.oracleTotal:1,u=n.cheapTotal-n.agreed,l=y(o,e);return{question:e,comparedSymbols:n.comparedSymbols,precision:l&&n.cheapTotal>0?D(n.agreed/n.cheapTotal):null,recall:D(r),unverified:u,skippedOraclePartial:n.skippedOraclePartial}}function y(e,n){return e==="semantic"?z[n]:!1}function h(e,n){return g(n.relativePath)==="clojure"&&b(e,n.relativePath)!==null}function E(e,n,o){let r=new Map,u=new Map,l=o.filter(t=>h(e,t)),a=new Map;for(let t of l){let i=a.get(t.leaf)??[];i.push(t),a.set(t.leaf,i)}for(let t of n.sourceFiles()){if(g(t)!=="clojure")continue;let i=b(e,t);if(i)for(let f of i.fileIdentifiers)for(let m of a.get(f)??[])M(r,m.symbolId,t)}let c=new Map;for(let t of n.scopedDefinitions()){if(g(t.relativePath)!=="clojure")continue;let i=c.get(t.leaf)??[];i.push(t),c.set(t.leaf,i)}for(let t of l){let i=b(e,t.relativePath);if(i){for(let f of i.callSites)if(!(f.line<t.startLine||f.line>t.endLine))for(let m of c.get(f.calleeLeaf)??[])M(u,t.symbolId,m.relativePath)}}return{referencesBySymbolId:r,calleesBySymbolId:u}}function M(e,n,o){let r=e.get(n);if(r){r.add(o);return}e.set(n,new Set([o]))}function D(e){return Math.round(e*1e3)/1e3}export{H as a};
|
|
2
|
+
//# sourceMappingURL=chunk-U4G4UYLB.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-K65T4TJS.js";import{a as d}from"./chunk-RUV4KHWA.js";import{j as c}from"./chunk-NJD4C5G5.js";import{d as u}from"./chunk-7XP7ZRSI.js";function L(e,n,i={}){let t=f(e,n);if(!t)return null;let r=h(e,t);if(!r||e.isIgnored(r.relative_path))return null;let s=[],m=0,l=g(e,r.relative_path),p=i.semantic===!1?new Map:c(e,l);for(let o of l){let a=S(e,r,o,p.get(o.symbolId)??new Set);m+=a,s.push({symbol:o.symbol,shortName:u(o.symbol),startLine:o.startLine,endLine:o.endLine,externalConsumers:a,riskLevel:b(a)})}return{file:r.relative_path,symbols:s,totalExternalConsumers:m}}function h(e,n){return e.get(`SELECT id, relative_path FROM documents
|
|
2
2
|
WHERE relative_path = ?
|
|
3
3
|
${e.pathExclusionsFor("documents")}
|
|
4
4
|
LIMIT 1`,n)??null}function g(e,n){return new d(e).definitionsForFile(n).sort((i,t)=>i.startLine-t.startLine||i.endLine-t.endLine)}function S(e,n,i,t){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
|
|
@@ -8,4 +8,4 @@ import{a as f}from"./chunk-5N5ZC566.js";import{a as d}from"./chunk-CYDOV3AQ.js";
|
|
|
8
8
|
WHERE m.symbol_id = ?
|
|
9
9
|
AND m.role != 1
|
|
10
10
|
AND c.document_id != ?`,i.symbolId,n.id);return new Set([...r.map(s=>s.relative_path),...[...t].filter(s=>s!==n.relative_path)]).size}function b(e){return e>10?"high":e>0?"medium":"low"}export{L as a};
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-W7FNZKX5.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{d as D}from"./chunk-KSD6IWF4.js";import{a as M,c as N}from"./chunk-6JSTKSZH.js";import{d as b,f as g,s as I,z as S}from"./chunk-7XP7ZRSI.js";import{B as p}from"./chunk-TLTLJ4SW.js";function E(o,n,l={}){let{maxDepth:u=5,scope:m}=l,r=M(o,n);if(!r)return[];let a=[],d=new Set([r.symbolId]),c=new Set,i=[r];for(let e=1;e<=u&&i.length!==0;e++){let t=[],f=D(o,i,{limit:500});for(let y of i)for(let s of R(o,y,m,f.get(y.symbolId)??[])){let h=`${s.file}|${s.shortName}`;if(s.symbolId!==null){if(d.has(s.symbolId))continue;d.add(s.symbolId)}else if(c.has(h))continue;c.add(h),a.push({symbol:s.symbol,shortName:s.shortName,file:s.file,depth:e}),s.symbolId!==null&&s.symbolMatch&&t.push(s.symbolMatch)}i=t}return a.sort((e,t)=>e.depth-t.depth||e.file.localeCompare(t.file)),a}function R(o,n,l,u){let m=u.filter(e=>!o.isIgnored(e.file)).filter(e=>!l||e.file.includes(l)),r=new Set(m.map(e=>e.file)),a=[];for(let e of w(o,n,l)){if(r.has(e))continue;let t=I(o,e),f=t.length>0?S(t,t[0].startLine):null;a.push({symbol:f?.symbol??e,file:e})}let d=[...m,...a],c=[],i=new Set;for(let e of d){let t=N(o,e.symbol);if(!t){let y=`${e.file}|${e.symbol}`;if(i.has(y))continue;i.add(y),c.push({symbolId:null,symbol:e.symbol,shortName:b(e.symbol),file:e.file,symbolMatch:null});continue}if(t.symbolId===n.symbolId||o.isIgnored(t.relativePath)||!A(t))continue;let f=`${t.symbolId}|${t.relativePath}`;i.has(f)||(i.add(f),c.push({symbolId:t.symbolId,symbol:t.symbol,shortName:b(t.symbol),file:t.relativePath,symbolMatch:t}))}return c}function w(o,n,l){let u=l?"AND consumer_d.relative_path LIKE ?":"",m=[n.symbolId,n.documentId];return l&&m.push(`%${l}%`),new Set(o.all(`SELECT DISTINCT consumer_d.relative_path
|
|
2
|
+
FROM mentions m
|
|
3
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
+
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
5
|
+
WHERE m.symbol_id = ?
|
|
6
|
+
AND m.role != 1
|
|
7
|
+
AND c.document_id != ?
|
|
8
|
+
${o.pathExclusionsFor("consumer_d")}
|
|
9
|
+
${u}`,...m).map(r=>r.relative_path).filter(r=>!o.isIgnored(r)))}function A(o){if(o.symbol.startsWith("scip-clojure ")||p(o.relativePath)==="clojure")return!0;let n=g(o.symbol);return n==="method"||n==="type"||o.symbol.endsWith("().")}export{E as a};
|
|
10
|
+
//# sourceMappingURL=chunk-WD3PAQJT.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as f}from"./chunk-
|
|
1
|
+
import{m as f}from"./chunk-MBVHEPHQ.js";import{a as d}from"./chunk-6JSTKSZH.js";import{d as s,h as u,p as m,q as g}from"./chunk-7XP7ZRSI.js";import{y as c}from"./chunk-M2TRDR25.js";function E(e,r,i={}){let n=d(e,r);if(!n)return{definitions:[],referencedBy:[]};let t=e.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",n.symbolId),a=g(t?.documentation??null),o=e.isIgnored(n.relativePath)?[]:[{relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,signature:y(a,t?.display_name??null,n.symbol),source:S(e,n.relativePath,n.startLine,n.endLine)}],b=f(e,n,{semantic:i.semantic}).map(l=>({relativePath:l.file,line:l.line,enclosingSymbol:l.enclosingSymbol,enclosingShort:l.enclosingSymbol?s(l.enclosingSymbol):"(top-level)"}));return{definitions:o,referencedBy:b}}function S(e,r,i,n){let t=c(e,r);if(!t)return null;let o=t.split(`
|
|
2
2
|
`).slice(i,n+1).join(`
|
|
3
3
|
`).trimEnd();return o.length>0?o:null}function y(e,r,i){let n=m(e);if(n&&!p(n))return n;let t=(r??"").trim();return t?u(i)&&!t.endsWith("()")?`${t}()`:t:s(i)}function p(e){return e.startsWith("undefined")||e.includes("|")||e.includes("```")}export{E as a};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-XLJORP6N.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{Fc as B,Gc as j,Q as S,R as A,Tc as _,Uc as z,Y as k,Z as x,_c as M,b as P,ga as D,ja as T,sc as b,tc as E,uc as W}from"./chunk-6AITNECC.js";import{existsSync as F,lstatSync as C,readFileSync as G,readdirSync as J,realpathSync as O,rmSync as I,statSync as U}from"fs";import{join as f,resolve as m,sep as N}from"path";var K=3600*1e3,X=2*1024*1024*1024,Z=300*1e3;function ee(t){let e=t.leases.filter(r=>r.managed&&!r.live&&!r.busy),o=Y(t.leases,t.locks),n={};for(let r of t.generations)o.has(r.generationId)||(n[r.generationId]=r.unreferencedAt??t.nowMs);let s=t.generations.filter(r=>!o.has(r.generationId)).sort((r,c)=>n[r.generationId]-n[c.generationId]||r.generationId.localeCompare(c.generationId)),i=new Set;for(let r of s)t.nowMs-n[r.generationId]>=t.policy.generationTtlMs&&i.add(r.generationId);let p=t.generations.filter(r=>!i.has(r.generationId)).reduce((r,c)=>r+c.size,0);for(let r of s){if(p<=t.policy.budgetBytes)break;i.has(r.generationId)||(i.add(r.generationId),p-=r.size)}for(let r of i)delete n[r];return{deleteWorktrees:e,deleteGenerations:t.generations.filter(r=>i.has(r.generationId)),deleteLocks:t.locks.filter(r=>!r.live),deleteTemporaries:t.temporaries.filter(r=>!r.live),protectedGenerationIds:[...o].sort(),unreferencedSince:n}}function Y(t,e){let o=new Set(t.filter(n=>n.managed&&(n.live||n.busy)).flatMap(n=>[n.lease.baseGenerationId,n.lease.activeGenerationId]).filter(n=>n!==void 0));for(let n of e)n.live&&o.add(n.generationId);return o}function ue(t,e,o={}){if(!W())return{kind:"disabled"};let n=k(t);if(!n)return{kind:"unavailable"};let s=f(b(),"repositories",n.repositoryId);if(!F(s))return{kind:"unavailable"};let i=(o.now??Date.now)(),p=f(s,"gc-state.json"),r=V(p);if(!o.force&&r&&i-Date.parse(r.lastSweepAt)<Z)return{kind:"throttled",sweptAt:r.lastSweepAt};let c=B(s,{now:()=>i});if(!c)return{kind:"busy"};try{let a=q(t,s,n.repositoryId,r?.unreferencedSince??{}),l=ee({nowMs:i,...a,policy:{generationTtlMs:o.policy?.generationTtlMs??K,budgetBytes:o.policy?.budgetBytes??X}}),u=0,y=0;for(let d of l.deleteWorktrees){if(!H(d.lease))continue;let L=j(f(d.lease.localCacheDir,"cache-lifecycle.lock"));if(L)try{if(R(d.lease,!0))continue;try{T({projectRoot:d.lease.projectRoot,cacheDir:d.lease.localCacheDir,cliVersion:e})}catch{continue}if(R(d.lease,!0))continue;I(d.lease.localCacheDir,{recursive:!0,force:!0}),I(d.leasePath,{force:!0}),y+=1}finally{L.release()}}for(let d of l.deleteLocks)I(d.path,{force:!0});for(let d of l.deleteTemporaries)I(d.path,{recursive:!0,force:!0});for(let d of l.deleteGenerations)I(d.path,{recursive:!0,force:!0}),u+=d.size;P(f(s,"evidence.db"));let g={kind:"swept",sweptAt:new Date(i).toISOString(),deletedWorktrees:y,deletedGenerations:l.deleteGenerations.length,deletedBytes:u,protectedGenerations:l.protectedGenerationIds.length},h={version:1,lastSweepAt:g.sweptAt,unreferencedSince:l.unreferencedSince,lastResult:g};return A(p,h,{spacing:2,trailingNewline:!0}),g}catch(a){return{kind:"failed",error:a instanceof Error?a.message:String(a)}}finally{c.release()}}function fe(t,e,o){let n=_(t,o.dbPath,e);if(n)return{state:"bypassed",reason:n,localCacheDir:o.cacheDir,generations:0,generationBytes:0,protectedGenerations:0,unreferencedGenerations:0,unreferencedBytes:0,temporaryGenerations:0,sharedEvidence:{exists:!1,bytes:0}};let s=k(t);if(!s)return{state:"unavailable",reason:"Git worktree identity is unavailable",localCacheDir:o.cacheDir,generations:0,generationBytes:0,protectedGenerations:0,unreferencedGenerations:0,unreferencedBytes:0,temporaryGenerations:0,sharedEvidence:{exists:!1,bytes:0}};let i=f(b(),"repositories",s.repositoryId),p=Q(f(i,"worktrees",`${s.worktreeId}.json`)),r=V(f(i,"gc-state.json")),c=q(t,i,s.repositoryId,r?.unreferencedSince??{}),a=Y(c.leases,c.locks),l=c.generations.filter(h=>!a.has(h.generationId)),u=c.generations.reduce((h,d)=>h+d.size,0),y=z(t,e),g=0;return y&&(g=te(y)),{state:"managed",repositoryId:s.repositoryId,worktreeId:s.worktreeId,localCacheDir:o.cacheDir,...p?{baseGenerationId:p.baseGenerationId,activeGenerationId:p.activeGenerationId,lastAction:p.lastAction,reason:p.lastReason,lastSeenAt:p.lastSeenAt}:{},generations:c.generations.length,generationBytes:u,protectedGenerations:c.generations.filter(h=>a.has(h.generationId)).length,unreferencedGenerations:l.length,unreferencedBytes:l.reduce((h,d)=>h+d.size,0),temporaryGenerations:c.temporaries.length,sharedEvidence:{path:y,exists:g>0,bytes:g},cleanup:r?.lastResult}}function te(t){return[t,`${t}-wal`,`${t}-shm`].reduce((e,o)=>{try{return e+U(o).size}catch{return e}},0)}function q(t,e,o,n){let s=new Set(x(t).map(a=>m(a.path))),i=[];for(let a of v(f(e,"worktrees"))){if(!a.endsWith(".json"))continue;let l=f(e,"worktrees",a),u=Q(l);if(!u)continue;let y=m(u.projectRoot);i.push({leasePath:l,lease:u,managed:u.repositoryId===o&&H(u),live:s.has(y)||F(y),busy:R(u)})}let p=[];for(let a of v(f(e,"locks"))){let l=/^([a-f0-9]{64})\.lock$/.exec(a);if(!l)continue;let u=f(e,"locks",a),y=w(u),g=y!==void 0&&S(y),h=l[1];p.push({generationId:h,path:u,live:g})}let r=[],c=[];for(let a of v(f(e,"generations"))){let l=/^\.tmp-(\d+)-/.exec(a);if(l){let g=f(e,"generations",a),h=Number(l[1]);try{c.push({path:g,size:$(g),live:Number.isSafeInteger(h)&&S(h)})}catch{}continue}if(!/^[a-f0-9]{64}$/.test(a))continue;let u=f(e,"generations",a),y;try{y=C(u)}catch{continue}!y.isDirectory()||y.isSymbolicLink()||r.push({generationId:a,path:u,size:$(u),...n[a]===void 0?{}:{unreferencedAt:n[a]}})}return{leases:i,generations:r,locks:p,temporaries:c}}function H(t){if(t.ownershipChecksum!==M(t)||m(t.localCacheDir)!==m(E(t.projectRoot)))return!1;let e=m(b()),o=m(f(e,"projects")),n=m(t.localCacheDir);if(!n.startsWith(`${o}${N}`))return!1;try{let s=C(e),i=C(o),p=C(n);if(!s.isDirectory()||s.isSymbolicLink()||!i.isDirectory()||i.isSymbolicLink()||!p.isDirectory()||p.isSymbolicLink())return!1;let r=O(o);return O(n).startsWith(`${r}${N}`)}catch{return!1}}function R(t,e=!1){for(let n of e?["index.lock"]:["index.lock","cache-lifecycle.lock"]){let s=w(f(t.localCacheDir,n));if(s!==void 0&&S(s))return!0}let o=w(D(t.localCacheDir).lockPath);return o!==void 0&&S(o)}function Q(t){try{let e=JSON.parse(G(t,"utf8"));return e.version!==1||typeof e.repositoryId!="string"||typeof e.worktreeId!="string"||typeof e.projectRoot!="string"||e.treeOid!==void 0&&typeof e.treeOid!="string"||typeof e.localCacheDir!="string"||e.baseGenerationId!==void 0&&typeof e.baseGenerationId!="string"||e.activeGenerationId!==void 0&&typeof e.activeGenerationId!="string"||typeof e.ownershipChecksum!="string"||!/^[a-f0-9]{64}$/.test(e.ownershipChecksum)||typeof e.lastAction!="string"||e.lastReason!==void 0&&typeof e.lastReason!="string"||typeof e.lastSeenAt!="string"?null:e}catch{return null}}function w(t){try{let e=JSON.parse(G(t,"utf8"));return typeof e.pid=="number"&&Number.isSafeInteger(e.pid)&&e.pid>0?e.pid:void 0}catch{return}}function V(t){try{let e=JSON.parse(G(t,"utf8"));return e.version!==1||typeof e.lastSweepAt!="string"||!Number.isFinite(Date.parse(e.lastSweepAt))||!e.unreferencedSince||typeof e.unreferencedSince!="object"||!e.lastResult?null:e}catch{return null}}function v(t){try{return J(t)}catch{return[]}}function $(t){let e=0,o=[t];for(;o.length>0;){let n=o.pop();for(let s of J(n,{withFileTypes:!0})){let i=f(n,s.name);s.isDirectory()?o.push(i):s.isFile()&&(e+=U(i).size)}}return e}export{ue as a,fe as b};
|
|
3
|
+
//# sourceMappingURL=chunk-XTF6ELXT.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as _}from"./chunk-
|
|
1
|
+
import{a as _}from"./chunk-K65T4TJS.js";import{a as r}from"./chunk-6JSTKSZH.js";import{a as l}from"./chunk-QEIGJJBC.js";import{d as c}from"./chunk-7XP7ZRSI.js";function y(n,o){let e=r(n,o);if(!e)return[];let i=n.get(`SELECT COUNT(DISTINCT c.document_id) AS file_count
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN (
|
|
@@ -70,4 +70,4 @@ import{a as _}from"./chunk-5N5ZC566.js";import{a as r}from"./chunk-2HCWAL42.js";
|
|
|
70
70
|
GROUP BY d.id
|
|
71
71
|
ORDER BY symbol_count DESC
|
|
72
72
|
LIMIT ?`,...m,e).filter(t=>!n.isIgnored(t.relative_path)).map(t=>({name:t.relative_path,count:t.symbol_count}))}export{y as a,b,p as c,I as d};
|
|
73
|
-
//# sourceMappingURL=chunk-
|
|
73
|
+
//# sourceMappingURL=chunk-YMFHC5J2.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as S}from"./chunk-
|
|
1
|
+
import{a as S}from"./chunk-RUV4KHWA.js";import{b as D}from"./chunk-5CJ6AQN7.js";import{h as v}from"./chunk-NJD4C5G5.js";import{p as y}from"./chunk-JLZUM476.js";import{a as b}from"./chunk-64MNV6AB.js";import p from"path";var w={analysis:new Set(["domain","source","storage","symbols"]),core:new Set(["analysis","domain","resolution","source","storage","symbols"]),domain:new Set([]),instrumentation:new Set([]),"language-parsers":new Set(["core","domain","resolution","source","storage"]),queries:new Set(["analysis","core","domain","language-parsers","resolution","semantic","source","storage","symbols"]),reindex:new Set(["domain","language-parsers","resolution","runtime","semantic","source","storage","symbols"]),resolution:new Set(["domain","source","storage","symbols"]),runtime:new Set(["core","domain","language-parsers","queries","reindex","resolution","semantic","source","storage","symbols","tla"]),semantic:new Set(["core","domain","language-parsers","reindex","resolution","runtime","source","storage","symbols"]),source:new Set(["core","domain","resolution","storage"]),storage:new Set(["analysis","domain","queries","source"]),symbols:new Set(["analysis","core","domain","language-parsers","resolution","semantic","source","storage"]),tla:new Set(["core","domain","queries","source","storage","symbols"])};function f(e){let t=e.replace(/\\/g,"/").split("/").filter(Boolean);return t.length<=1?"(root)":t.length>=3&&["src","lib","app","server","client"].includes(t[0])?`${t[0]}/${t[1]}`:t[0]}function h(e,n){if(e===n)return"ok";let t=g(e),i=g(n);return t&&i?!m(t)||!m(i)?null:P(t,i)?"ok":"violation":E(e,n)}function k(e,n){let t=g(f(e)),i=g(f(n));return!!t&&!!i&&m(t)&&m(i)}function R(e,n){let t=g(e),i=g(n);return!!t&&!!i&&(!m(t)||!m(i))}function g(e){return/^src\/([^/]+)$/.exec(e)?.[1]??null}function P(e,n){return n==="instrumentation"||n==="domain"?!0:e==="domain"?!1:w[e]?.has(n)??!1}function m(e){return Object.hasOwn(w,e)}function E(e,n){if(n==="shared")return"ok";let t={app:new Set(["core","shared","ui"]),core:new Set(["shared"]),infra:new Set(["core","shared"]),ui:new Set(["core","shared"])};return t[e]?t[e].has(n)?"ok":"violation":null}function re(e,n){let{scope:t,minDeviation:i=5,limit:r=50}=n??{},a=n?.semantic!==!1,c=n?.includePatternDeviations===!0,s=new S(e).fileDependencyGraph(t),l=F([...I(e,s,{scope:t,semantic:a}),...M(s),...c?N(s,i):[]]);return r<=0||l.results.length<=r?l:{...l,results:l.results.slice(0,r),totalResults:l.results.length}}function I(e,n,t){let i=T(e,t.scope),r=[],a=new Set;for(let[o,s]of n){if(d(o))continue;let l=i.get(o)??new Set;for(let u of s)d(u)||l.has(u)||_(e,o,u,t)||(r.push({file:o,dep:u}),a.add(o))}a.size>0&&B(e,i,{paths:[...a]});let c=[];for(let{file:o,dep:s}of r)(i.get(o)??new Set).has(s)||c.push({file:o,kind:"unused-import",description:`Depends on ${s} but references none of its symbols`,dep:s,actionTier:"direct",evidenceReasons:[`dependency edge exists from ${o} to ${s}`,"no semantic, source, type-only, side-effect, or Vue-template usage survived the conservative skip gates"],recommendation:"Remove the unused import or dependency edge after running the project checks."});return c}function _(e,n,t,i){return J(e,n,t)||z(e,n,t)||V(t)||W(e,n,t)||K(t)?!0:i.semantic&&C(e,n,t)}function M(e){let n=[],t=U(e);for(let[i,r]of e){if(d(i))continue;let a=f(i);for(let c of r){if(d(c))continue;let o=f(c);if(a===o)continue;let s=h(a,o),l=s===null&&R(a,o),u=s?"explicit":l?"unknown-layer":"inferred";if((l?"violation":s??t.get(`${a}->${o}`))==="violation"){let $=u==="explicit"?"direct":"signal";n.push({file:i,kind:"layer-violation",description:`Imports from ${o}/ (${c}) \u2014 may cross architectural boundary`,dep:c,detail:`${a}/ should not depend on ${o}/`,actionTier:$,policyBasis:u,evidenceReasons:[`dependency edge exists from ${i} to ${c}`,O(u,a,o)],recommendation:u==="explicit"?"Move the dependency behind an allowed layer boundary or document a policy change.":u==="unknown-layer"?"Add a layer policy entry before treating this as a boundary violation.":"Review whether this is a real boundary break or an intentional exception before moving code."})}}}return n}function O(e,n,t){return e==="explicit"?`explicit layer policy rejects ${n}/ -> ${t}/`:e==="unknown-layer"?`source layer policy has no entry for ${n}/ -> ${t}/`:`rare cross-layer edge ${n}/ -> ${t}/ is inferred as a violation`}function N(e,n){let t=[];for(let[i,r]of A(e)){let a=r.filter(o=>!d(o));if(a.length<n)continue;let c=L(e,a);for(let o of a)for(let s of e.get(o)??[])d(s)||(c.get(s)??0)===1&&p.dirname(s)!==i&&p.dirname(s)!==p.dirname(i)&&(k(o,s)||t.push({file:o,kind:"pattern-deviation",description:`Only file in ${i}/ that depends on ${s}`,dep:s,actionTier:"signal",evidenceReasons:[`${a.length} sibling file(s) in ${i}/ were compared`,`${o} is the only non-skipped sibling depending on ${s}`],recommendation:"Review sibling ownership before changing this import; unique dependency shape can be intentional specialization."}))}return t}function F(e){return{results:e,unusedImports:e.filter(n=>n.kind==="unused-import").length,layerViolations:e.filter(n=>n.kind==="layer-violation").length,patternDeviations:e.filter(n=>n.kind==="pattern-deviation").length}}function A(e){let n=new Map;for(let t of e.keys()){let i=p.dirname(t),r=n.get(i);r||(r=[],n.set(i,r)),r.push(t)}return n}function L(e,n){let t=new Map;for(let i of n)for(let r of e.get(i)??[])d(r)||t.set(r,(t.get(r)??0)+1);return t}function T(e,n){let t=new Map;return j(e,t,n),t}function j(e,n,t){for(let i of q(e,t))x(e,n,i.from_file,i.to_file)}function q(e,n){let t=n?"AND d1.relative_path LIKE ?":"",i=n?[`%${n}%`]:[];return e.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d1 ON c.document_id = d1.id
|
|
@@ -15,4 +15,4 @@ import{a as S}from"./chunk-CYDOV3AQ.js";import{b as D}from"./chunk-5CJ6AQN7.js";
|
|
|
15
15
|
AND m.role != 1
|
|
16
16
|
${e.pathExclusionsFor("d1","d2")}
|
|
17
17
|
${t}`,...i)}function B(e,n,t={}){new S(e).scanSourceReferences({paths:t.paths??b(e,{includeIgnored:!1}),includeRustAttributeNames:!0,identifierResolution:"permissive"},r=>{r.target.relativePath!==r.sourceFile&&(e.isIgnored(r.target.relativePath)||x(e,n,r.sourceFile,r.target.relativePath))})}function x(e,n,t,i){if(e.isIgnored(t)||e.isIgnored(i))return;let r=n.get(t);r||(r=new Set,n.set(t,r)),r.add(i)}function U(e){let n=new Map;for(let[i,r]of e){if(d(i))continue;let a=f(i);for(let c of r){if(d(c))continue;let o=f(c);if(a===o||h(a,o))continue;let s=`${a}->${o}`;n.set(s,(n.get(s)??0)+1)}}let t=new Map;for(let[i,r]of n)t.set(i,r<=2?"violation":"ok");return t}function V(e){return e.includes("types")||e.endsWith(".d.ts")}function C(e,n,t){let i=v(e,n).filter(r=>r.sourcePath===t);return i.length>0&&i.some(r=>r.isUsed)}function J(e,n,t){let i=y(e,n).filter(r=>r.sourcePath===t);return i.length>0&&i.some(r=>r.used)}function z(e,n,t){let i=y(e,n).filter(r=>r.sourcePath===t);return i.length>0&&i.every(r=>r.isTypeOnly===!0)}function K(e){return e.endsWith(".vue")}function W(e,n,t){let i=y(e,n).filter(r=>r.sourcePath===t);return i.length===0?!1:i.every(r=>r.kind==="side-effect"||r.kind==="namespace"&&r.usedMembers.length===0&&!r.used)}function d(e){let n=D(e);return!!(n==="entry"||n==="barrel"||n==="test"||n==="worker"||H(p.basename(e)))}function H(e){return!!(e==="index.ts"||e==="index.js"||e==="cli.ts"||e==="main.ts"||e==="main.rs"||e.includes("worker.")||e.includes("postinstall.")||e==="health.ts"||e==="health.js")}export{re as a};
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
18
|
+
//# sourceMappingURL=chunk-YYYERNQL.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{execFileSync as h}from"child_process";import{platform as x}from"os";var R=x()==="win32";function $(t){let e=R?"where":"which";try{return h(e,[t],{stdio:"pipe"}),!0}catch{return!1}}import{spawnSync as C}from"child_process";import{createHash as D}from"crypto";import{existsSync as W,lstatSync as v,realpathSync as b}from"fs";import{dirname as w,isAbsolute as E,join as I,resolve as a}from"path";var p={run(t,e){let r=G(t,e);return r.kind==="success"?r.output:void 0},runResult:G},O=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],k=/^[0-9a-f]{40,64}$/;function J(t,e=p){let r=e.runResult(t,O);if(r.kind==="success"){let i=T(r.output);if(i)return A(i,e)}return N(t,e)}function T(t){let e=t.split(`
|
|
2
|
+
`).map(f=>f.trim());if(e.length!==5)return;let[r,i,n,o,s]=e;if(!r||!i||!n||!o||!s||!k.test(o)||!k.test(s))return;let u=d(r);return{root:u,gitDir:d(c(u,i)),commonDir:d(c(u,n)),headCommit:o,treeOid:s}}function A(t,e){let r=e.run(t.root,["status","--porcelain=v1","-z","--untracked-files=all"]);return r===void 0?void 0:{...y(t.root,t.gitDir),commonDir:t.commonDir,repositoryId:m("repository",t.commonDir),headCommit:t.headCommit,treeOid:t.treeOid,clean:r.length===0}}function N(t,e){let r=_(t,e);if(r.kind!=="worktree")return;let i=r.identity,n=i.projectRoot,o=e.run(n,["rev-parse","--git-common-dir"])?.trim();if(!o)return;let s=d(c(n,o)),u=l(e.run(n,["rev-parse","--verify","HEAD"])),f=l(e.run(n,["rev-parse","--verify","HEAD^{tree}"])),g=e.run(n,["status","--porcelain=v1","-z","--untracked-files=all"]);if(g!==void 0)return{...i,commonDir:s,repositoryId:m("repository",s),headCommit:u,treeOid:f,clean:g.length===0}}function _(t,e=p){let r=e.runResult(t,["rev-parse","--show-toplevel"]);if(r.kind==="not-repository")return{kind:"non-git"};if(r.kind==="error")return r;let i=r.output.trim();if(!i)return{kind:"error",message:"Git returned an empty worktree root."};let n=d(i),o=e.run(n,["rev-parse","--absolute-git-dir"])?.trim();if(!o)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=d(c(n,o));return{kind:"worktree",identity:y(n,s)}}function y(t,e){return{projectRoot:t,gitDir:e,worktreeId:m("worktree",`${t}\0${e}`)}}function j(t,e,r=p){return l(r.run(t,e))}function c(t,e){return E(e)?e:a(t,e)}function d(t){try{return b(t)}catch{return a(t)}}function m(t,e){return D("sha256").update(`${t}\0${e}`).digest("hex").slice(0,24)}function l(t){return t?.trim()||void 0}function G(t,e){let r=C("git",["-C",t,...e],{encoding:"utf-8",env:{...process.env,LC_ALL:"C"},maxBuffer:52428800,stdio:["ignore","pipe","pipe"]});if(r.status===0)return{kind:"success",output:r.stdout.trimEnd()};let n=(typeof r.stderr=="string"?r.stderr.trim():"")||r.error?.message||`git exited with status ${r.status??"unknown"}`,o=r.error?.code;return(/not a git repository/i.test(n)||o==="ENOENT"&&W(a(t)))&&!S(t)?{kind:"not-repository"}:{kind:"error",message:n}}function S(t){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let e=a(t);for(;;){try{return v(I(e,".git")),!0}catch(i){let n=i.code;if(n!=="ENOENT"&&n!=="ENOTDIR")return!0}let r=w(e);if(r===e)return!1;e=r}}export{$ as a,J as b,j as c,c as d,d as e};
|
|
3
|
+
//# sourceMappingURL=chunk-Z4MCFCGX.js.map
|