scip-query 0.10.1 → 0.10.3
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 +2 -2
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-24PFLKFK.js → chunk-3KLLFNT4.js} +2 -2
- package/dist/{chunk-UIWAZ2NT.js → chunk-3UVJJ6Z7.js} +1 -1
- package/dist/chunk-3UW7VM4H.js +62 -0
- package/dist/chunk-3ZYF3ELZ.js +2 -0
- package/dist/{chunk-6YKJSETN.js → chunk-47UA45TU.js} +2 -2
- package/dist/chunk-4HOMAEDD.js +2 -0
- package/dist/{chunk-5VB3WU7K.js → chunk-4ZUJJRWT.js} +2 -2
- package/dist/{chunk-LWPEZ4FP.js → chunk-5FOPAXWY.js} +2 -2
- package/dist/{chunk-CCB45WDY.js → chunk-5M4TYWVI.js} +2 -2
- package/dist/{chunk-PV4CEDIL.js → chunk-5QJXH6ZL.js} +5 -5
- package/dist/{chunk-NN3O7TPH.js → chunk-64MNV6AB.js} +1 -1
- package/dist/{chunk-LWWZBABT.js → chunk-77YBOOYT.js} +2 -2
- package/dist/chunk-7ADUXFRZ.js +2 -0
- package/dist/chunk-7KCSELEV.js +2 -0
- package/dist/{chunk-GZXXBDJA.js → chunk-7OHWPJ5N.js} +2 -2
- package/dist/{chunk-BJ7OHKB5.js → chunk-7S5E7KWT.js} +1 -1
- package/dist/chunk-A3VNUGKJ.js +2 -0
- package/dist/{chunk-CMGOXDVP.js → chunk-A4L36SZS.js} +2 -2
- package/dist/{chunk-5D3BT4B4.js → chunk-AUVBR62P.js} +2 -2
- package/dist/chunk-AW4N6MGC.js +18 -0
- package/dist/{chunk-65UWNXEH.js → chunk-B6MJ5VQV.js} +2 -2
- package/dist/chunk-BKDXBJDQ.js +2 -0
- package/dist/{chunk-WZVTADY7.js → chunk-C2QSK7E7.js} +1 -1
- package/dist/chunk-C3MZZ2ZN.js +2 -0
- package/dist/{chunk-GTNPPGZJ.js → chunk-CAWSSEVM.js} +2 -2
- package/dist/chunk-CFL2CNIF.js +10 -0
- package/dist/{chunk-E55WCTLH.js → chunk-CJJP64OC.js} +2 -2
- package/dist/{chunk-ADKQX2OY.js → chunk-CRU42NJU.js} +2 -2
- package/dist/chunk-CSWZFD46.js +2 -0
- package/dist/{chunk-QOFKVNFE.js → chunk-CTCAF3YA.js} +2 -2
- package/dist/{chunk-YVQUQIBM.js → chunk-D322LMSA.js} +2 -2
- package/dist/{chunk-IJYWCB57.js → chunk-DAI74TJU.js} +2 -2
- package/dist/chunk-DE7MA6OD.js +3 -0
- package/dist/chunk-DJMK4DBL.js +2 -0
- package/dist/{chunk-FVX4GEAC.js → chunk-E44ZMVNA.js} +2 -2
- package/dist/{chunk-MESUJJVQ.js → chunk-E7KERP7E.js} +2 -2
- package/dist/{chunk-YIE5FZAF.js → chunk-EOZIZWW4.js} +2 -2
- package/dist/{chunk-XGGTESMN.js → chunk-ERHOS6AW.js} +2 -2
- package/dist/{chunk-5HDYAOSF.js → chunk-ESG4HBEF.js} +2 -2
- package/dist/{chunk-HCQ7J2N5.js → chunk-EWC3UK4V.js} +3 -3
- package/dist/chunk-EYLXU575.js +2 -0
- package/dist/chunk-FIB4JPEX.js +2 -0
- package/dist/chunk-FNRPGGVI.js +2 -0
- package/dist/{chunk-QUKZ77A6.js → chunk-FOQHUKNZ.js} +2 -2
- package/dist/{chunk-QH5GTVVB.js → chunk-FUPDW5AC.js} +2 -2
- package/dist/{chunk-B3HMRQDA.js → chunk-G3WGZU5Q.js} +2 -2
- package/dist/chunk-GLJAAKDW.js +4 -0
- package/dist/{chunk-TUAPDKBI.js → chunk-GS33KGAY.js} +2 -2
- package/dist/{chunk-623UQCVG.js → chunk-GZCQTZLK.js} +2 -2
- package/dist/{chunk-SA6B3EGD.js → chunk-HVTYSC26.js} +2 -2
- package/dist/chunk-I7TSQZ3J.js +4 -0
- package/dist/{chunk-R7S3UCDR.js → chunk-ICXVNWMI.js} +2 -2
- package/dist/chunk-JM72FNGA.js +2 -0
- package/dist/{chunk-DRU74YUM.js → chunk-KPHKX4LP.js} +1 -1
- package/dist/chunk-KRGBLZT2.js +7 -0
- package/dist/{chunk-YYCQQBMG.js → chunk-LPLGJ4HO.js} +2 -2
- package/dist/chunk-MUULWXSJ.js +2 -0
- package/dist/chunk-MZ7APUFN.js +3 -0
- package/dist/{chunk-LYS4SMAQ.js → chunk-NNDYO2DX.js} +2 -2
- package/dist/{chunk-ATGRITZP.js → chunk-NP5HYVLX.js} +4 -4
- package/dist/{chunk-MHAQXOZY.js → chunk-NVFERV4U.js} +2 -2
- package/dist/{chunk-LWYIGRHR.js → chunk-NXIAHE7F.js} +1 -1
- package/dist/chunk-O3OKSF6O.js +2 -0
- package/dist/chunk-O4L4AB3T.js +2 -0
- package/dist/{chunk-TMS4JPWY.js → chunk-OBBDKQAG.js} +2 -2
- package/dist/chunk-OLD6PBU6.js +7 -0
- package/dist/{chunk-5BZOSICN.js → chunk-PFOCOG57.js} +1 -1
- package/dist/{chunk-CFLYMEUS.js → chunk-PVZMPG5I.js} +1 -1
- package/dist/{chunk-T67R7V5I.js → chunk-QLNGUWR7.js} +2 -2
- package/dist/chunk-QSXQT3NE.js +2 -0
- package/dist/{chunk-6TWFT4Y5.js → chunk-QVCCLDZI.js} +2 -2
- package/dist/{chunk-PNN3D4BE.js → chunk-RHTJBYZ5.js} +2 -2
- package/dist/chunk-SPE4YCOT.js +7 -0
- package/dist/{chunk-4N7LFYSD.js → chunk-TM6GVHA6.js} +2 -2
- package/dist/chunk-TO54DY4O.js +2 -0
- package/dist/{chunk-HQHFMPLJ.js → chunk-UMNENNTX.js} +2 -2
- package/dist/chunk-UQJGTVHV.js +5 -0
- package/dist/{chunk-TKDJQ2WD.js → chunk-UUBMFL3F.js} +1 -1
- package/dist/chunk-VAA5FFIW.js +2 -0
- package/dist/chunk-X474LKJX.js +2 -0
- package/dist/chunk-X7ZY6FFF.js +4 -0
- package/dist/{chunk-RNLUCQJB.js → chunk-YQH353VA.js} +2 -2
- package/dist/{chunk-44JOJLMO.js → chunk-YTR4CO5S.js} +2 -2
- package/dist/chunk-YUOAAR24.js +2 -0
- package/dist/chunk-YVLHL6KQ.js +8 -0
- package/dist/{chunk-ADTG377O.js → chunk-YYD245WG.js} +2 -2
- package/dist/{chunk-I6PTB2CM.js → chunk-Z4VHYJ5U.js} +2 -2
- package/dist/chunk-ZFMPHDAT.js +4 -0
- package/dist/chunk-ZQLO2SCU.js +6 -0
- package/dist/chunk-ZSLT7NWQ.js +61 -0
- package/dist/cli.js +242 -225
- package/dist/{config-types-Bok4jrO3.d.ts → config-types-Bj4sh28g.d.ts} +8 -0
- package/dist/{db-BkFlkzI3.d.ts → db-CTarohbZ.d.ts} +1 -1
- package/dist/git-history-Dao3_Pu9.d.ts +12 -0
- package/dist/{health-CbGMdRPg.d.ts → health-Bx0x1HAG.d.ts} +23 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/postinstall.js +1 -1
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +6 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +37 -3
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +2 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +2 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +2 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +6 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +2 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +10 -3
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +6 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +2 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +53 -3
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +2 -2
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +20 -3
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +10 -3
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.d.ts +11 -3
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +2 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +14 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +17 -15
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +51 -0
- package/dist/queries/locality-candidates.js +2 -0
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +8 -3
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +4 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +2 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +9 -3
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +9 -3
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +25 -3
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +7 -3
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +24 -3
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +2 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +10 -3
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/unused-imports.d.ts +4 -0
- package/dist/queries/unused-imports.js +2 -0
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +2 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +9 -3
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +9 -3
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +6 -3
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +1 -1
- package/dist/reindex.d.ts +1 -1
- package/dist/reindex.js +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +2 -2
- package/docs/COMMAND_REFERENCE.md +3 -2
- package/docs/analyzer-inventory.md +162 -0
- package/docs/analyzer-validation-ledger.md +262 -0
- package/docs/analyzer-validation-protocol.md +192 -0
- package/docs/locality-analyzer-design.md +193 -0
- package/package.json +14 -3
- package/skills/scip-directory-architecture/SKILL.md +178 -0
- package/skills/scip-maintainability/SKILL.md +1 -1
- package/skills/scip-query/SKILL.md +2 -1
- package/skills/scip-query-setup/SKILL.md +118 -0
- package/skills/scip-react-maintainability/SKILL.md +1 -1
- package/skills/scip-vue-maintainability/SKILL.md +1 -1
- package/dist/chunk-23FVN4Y5.js +0 -2
- package/dist/chunk-27KPKLRJ.js +0 -7
- package/dist/chunk-2NLK4INB.js +0 -2
- package/dist/chunk-2XKAMW6B.js +0 -61
- package/dist/chunk-332L7SRO.js +0 -2
- package/dist/chunk-4EAANIWC.js +0 -2
- package/dist/chunk-5ALI77D7.js +0 -3
- package/dist/chunk-5IDEQEM4.js +0 -4
- package/dist/chunk-62NMBOA5.js +0 -2
- package/dist/chunk-64LH2QUP.js +0 -62
- package/dist/chunk-6U4EODW3.js +0 -2
- package/dist/chunk-A2GVUCZR.js +0 -8
- package/dist/chunk-DBIG4QAJ.js +0 -2
- package/dist/chunk-DMLPJ75B.js +0 -2
- package/dist/chunk-DTERBKUE.js +0 -7
- package/dist/chunk-F4PKYBQB.js +0 -2
- package/dist/chunk-JTRY2YRJ.js +0 -2
- package/dist/chunk-L77GXANO.js +0 -6
- package/dist/chunk-LT6GJ27X.js +0 -10
- package/dist/chunk-LUBKUISI.js +0 -2
- package/dist/chunk-LVYXX7ZW.js +0 -2
- package/dist/chunk-LXM7AHQG.js +0 -4
- package/dist/chunk-LY6NRJPJ.js +0 -2
- package/dist/chunk-N2T2GPYQ.js +0 -2
- package/dist/chunk-OB6PEVI3.js +0 -2
- package/dist/chunk-R42LZMLX.js +0 -2
- package/dist/chunk-RGDUIMNE.js +0 -3
- package/dist/chunk-RYBMW2EN.js +0 -2
- package/dist/chunk-TTGWDUJ4.js +0 -5
- package/dist/chunk-UVK3SL4Z.js +0 -2
- package/dist/chunk-W3PQRAI4.js +0 -2
- package/dist/chunk-WWFBDM5Y.js +0 -2
- package/dist/chunk-Y33GRQK6.js +0 -18
- package/dist/chunk-YISMWW66.js +0 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as C}from"./chunk-
|
|
1
|
+
import{d as C}from"./chunk-FUPDW5AC.js";import{c as _}from"./chunk-MZ7APUFN.js";import{b as S}from"./chunk-FOQHUKNZ.js";import{t as M}from"./chunk-CRU42NJU.js";import{f as y,k as h}from"./chunk-3UW7VM4H.js";import{d as f}from"./chunk-JM72FNGA.js";import{a as b}from"./chunk-QLNGUWR7.js";import{a as v}from"./chunk-EWC3UK4V.js";import{a as m}from"./chunk-D322LMSA.js";import{c as I}from"./chunk-OBBDKQAG.js";import{c as g,d as D}from"./chunk-7S5E7KWT.js";function R(e,r,n,t={}){if(!n)return[];let i=m(e,r);return i?i.indexOf(n)===-1?[]:(L(e,r).get(n)??[]).filter(s=>!B(s,t)):[]}function B(e,r){return typeof r.excludeStartLine=="number"&&typeof r.excludeEndLine=="number"&&e>=r.excludeStartLine&&e<=r.excludeEndLine}var G=g("file-identifiers",{clearGroups:["whole-project","source-file"]});function w(e,r){let n=b(e,r);return n?n.fileIdentifiers:G.get(e,r,()=>new Set(L(e,r).keys()))}var H=g("file-ident-lines",{clearGroups:["whole-project","source-file"]});function L(e,r){let n=b(e,r);return n?n.identifierLineMap:H.get(e,r,()=>z(e,r))}var J=g("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function ie(e,r){let n=b(e,r);return n?n.identifiersByLine:J.get(e,r,()=>{let t=L(e,r),i=0;for(let s of t.values()){let c=s[s.length-1];c!==void 0&&c>i&&(i=c)}let o=new Array(i+1);for(let s=0;s<=i;s+=1)o[s]=new Set;for(let[s,c]of t)for(let a of c)o[a].add(s);return o})}function z(e,r){let n=new Map,t=(c,a)=>{let l=n.get(c);if(!l){n.set(c,[a]);return}l[l.length-1]!==a&&l.push(a)},i=m(e,r);if(!i)return n;let o=M(i).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<o.length;c+=1){let a=o[c]??"";for(let l of a.matchAll(s))l[1]&&t(l[1],c)}return n}function k(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function d(e,r){return k(e)===k(r)}function O(e,r){let n=new Map;for(let t of S(e,r)){if(!t.sourcePath)continue;let i=t.localName??t.importedName;if(i&&F(n,i,t.sourcePath),t.kind==="namespace")for(let o of t.usedMembers)F(n,o,t.sourcePath)}return n}function F(e,r,n){let t=e.get(r);t||(t=new Set,e.set(r,t)),t.add(n)}function le(e,r){return E(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT
|
|
2
2
|
m.symbol_id,
|
|
3
3
|
d.relative_path,
|
|
4
4
|
COUNT(*) AS ref_count
|
|
@@ -37,4 +37,4 @@ import{d as C}from"./chunk-QH5GTVVB.js";import{c as _}from"./chunk-5ALI77D7.js";
|
|
|
37
37
|
) mention_doc ON mention_doc.symbol_id = gs.id
|
|
38
38
|
WHERE 1 = 1
|
|
39
39
|
${e.symbolNoiseFor("gs")}`),n=new Map;for(let t of r){if(!t.relative_path||e.isIgnored(t.relative_path))continue;let i=f(t.symbol);if(!i)continue;let o=n.get(i);o||(o=[],n.set(i,o)),o.some(s=>s.symbolId===t.id)||o.push({symbol:t.symbol,symbolId:t.id,file:t.relative_path})}return n})}function N(e,r,n){let t=x(e).get(n);if(!t||t.length===0)return[];if(t.length===1)return[p(t[0])];let i=t.filter(a=>a.file===r);if(i.length>0)return i.map(p);let o=O(e,r),s=o.get(n);if(s)for(let a of s){let l=t.filter(u=>d(a,u.file));if(l.length>0)return l.map(p)}let c=new Set;for(let a of o.values())for(let l of a)c.add(l);for(let a of c){let l=t.filter(u=>d(a,u.file));if(l.length>0&&l.length===t.length)return l.map(p)}return[]}function Ce(e,r,n){let t=N(e,r,n);if(t.length>0)return t;let i=x(e).get(n);return!i||i.length===0?[]:i.map(p)}function $(e,r,n={}){let t=_(e,r);if(!t)return[];let i=f(t.symbol);if(!i)return[];if(n.semantic!==!1){let s=C(e,{...t,leaf:i,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let c=new Map;for(let a of s){let l=c.get(a.file)??[];l.push(a.line),c.set(a.file,l)}return P(e,c)}}let o=new Map;for(let s of I(e)){let c=m(e,s);if(!c||c.indexOf(i)===-1||s!==t.relativePath&&!N(e,s,i).some(u=>u.symbolId===t.symbolId))continue;let a=R(e,s,i,s===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{});a.length>0&&o.set(s,a)}return P(e,o)}function we(e,r){let n=new Map;for(let o of r){if(!o.leaf)continue;let s=n.get(o.leaf)??[];s.push(o),n.set(o.leaf,s)}if(n.size===0)return new Map;let t=new Set(r.map(o=>o.symbolId)),i=new Map;for(let o of I(e)){let s=w(e,o);if(s.size!==0){for(let c of s)if(n.has(c))for(let a of N(e,o,c)){if(!t.has(a.symbolId)||o===a.relativePath)continue;let l=i.get(a.symbolId);l||(l=new Set,i.set(a.symbolId,l)),l.add(o)}}}return i}function p(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function P(e,r){let n=[],t=new Set;for(let[i,o]of r){let s=y(e,i);for(let c of o){let a=h(s,c),l=`${i}|${c}|${a?.symbol??""}`;t.has(l)||(t.add(l),n.push({file:i,line:c,enclosingSymbol:a?.symbol??null}))}}return n}function Y(e,r){let n=q(e,r);return n?K(e,Q(e,n.match,n.identifier)):[]}function je(e,r,n={}){return Z(e,r,n).map(t=>({file:t.file,line:t.line,enclosingSymbol:t.enclosingSymbol}))}function Z(e,r,n={}){let t=$(e,r,{semantic:n.semantic}),i=t.length>0?j(t,"source-attribution"):j(Y(e,r),"scip-reference-chunk");return n.includeIgnored===!0?i:i.filter(o=>!e.isIgnored(o.file))}function j(e,r){return e.map(n=>({...n,provenance:r}))}function Q(e,r,n){let t=new Map;for(let[i,o]of U(e,r.symbolId))t.set(i,V(e,i,o,r,n));return t}function U(e,r){let n=new Map;for(let t of A(e,[r])){if(e.isIgnored(t.relative_path))continue;let i=n.get(t.relative_path);i||(i=[],n.set(t.relative_path,i)),i.push({start_line:t.chunk_start,end_line:t.chunk_end})}return n}function V(e,r,n,t,i){let o=r===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{},s=i?R(e,r,i,o):[];return n.flatMap(c=>X(s,c))}function X(e,r){let n=e.filter(t=>t>=r.start_line&&t<=r.end_line);return n.length>0?n:[r.start_line]}function q(e,r){let n=_(e,r);return n?{match:n,identifier:f(n.symbol)||null}:null}function K(e,r){let n=[],t=new Set;for(let[i,o]of r){let s=y(e,i);for(let c of o){let a=h(s,c),l=`${i}|${c}|${a?.symbol??""}`;t.has(l)||(t.add(l),n.push({file:i,line:c,enclosingSymbol:a?.symbol??null}))}}return n}export{L as a,ie as b,le as c,fe as d,A as e,d as f,Se as g,ye as h,x as i,O as j,N as k,Ce as l,we as m,Y as n,je as o};
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
40
|
+
//# sourceMappingURL=chunk-HVTYSC26.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as ee}from"./chunk-NNDYO2DX.js";import{a as X}from"./chunk-YVLHL6KQ.js";import{a as y}from"./chunk-B32FX5KB.js";import{a as Q}from"./chunk-SPE4YCOT.js";import{a as J}from"./chunk-ZFMPHDAT.js";import{a as Z}from"./chunk-C2QSK7E7.js";import{a as W,b as Y}from"./chunk-UQJGTVHV.js";import{a as U}from"./chunk-G3WGZU5Q.js";import{a as V}from"./chunk-DE7MA6OD.js";import{a as q}from"./chunk-7KCSELEV.js";import{b as I,c as P,f as H}from"./chunk-NP5HYVLX.js";import{a as _,d as z}from"./chunk-GLJAAKDW.js";import{a as O}from"./chunk-AW4N6MGC.js";import{b as E}from"./chunk-C3MZZ2ZN.js";import{a as F,c as N,d as K,e as B}from"./chunk-EYLXU575.js";import{g as L}from"./chunk-KRGBLZT2.js";import{a as M}from"./chunk-CJJP64OC.js";import{a as j}from"./chunk-3ZYF3ELZ.js";import{f as w,g as D}from"./chunk-ZQLO2SCU.js";import{d as $,e as G}from"./chunk-JM72FNGA.js";import{createHash as ye}from"crypto";import{existsSync as x,readFileSync as oe}from"fs";import{existsSync as se,readFileSync as ae,writeFileSync as ce}from"fs";import{isAbsolute as le,join as fe}from"path";var de=75e3,ue=5e3,he=2500;function ge(e){let i=Z(e);return i.symbols>=de||i.documents>=ue?he:void 0}var pe=".scipquery-baseline.json";function k(e,i){return i&&le(i)?i:fe(e.config.projectRoot,i??pe)}function ne(e,i={}){let{scope:n}=i,r=ge(e),o=[],s=E(e,{scope:n,...y.dead,scanLimit:r});for(let t of s.symbols)w(e,t.relativePath)||D(e,t.symbol,t.relativePath)||t.kind==="dead-code"&&o.push(`dead:${t.relativePath}:${t.shortName}`);for(let t of U(e,{scope:n,...y.isolated,scanLimit:r}))w(e,t.relativePath)||D(e,t.symbol,t.relativePath)||o.push(`isolated:${t.relativePath}:${t.shortName}`);for(let t of M(e,{scope:n}))t.kind==="real"&&o.push(`cycle:${me(t.path)}`);for(let t of Y(e,{scope:n,...y.similar,scanLimit:r}))o.push(`similar:${[t.symbolA,t.symbolB].sort().join("|")}`);for(let t of q(e,{scope:n,...y.extract,scanLimit:r}))o.push(`extract:${t.relativePath}:${t.shortName}`);for(let t of Q(e,{scope:n,...y.wrappers,scanLimit:r}))o.push(`wrapper:${t.file}:${t.shortName}`);for(let t of V(e,{scope:n,...y.passthroughs,scanLimit:r}))o.push(`passthrough:${t.file}:${t.shortName}`);for(let t of J(e,{scope:n,...y.stale,scanLimit:r}))o.push(`stale:${t.file}:${t.shortName}`);for(let t of O(e,{scope:n,...y.drift}).results)t.kind!=="pattern-deviation"&&o.push(`drift:${t.kind}:${t.file}:${t.dep}`);return[...new Set(o)].sort()}function me(e){if(e.length===0)return"";let i=0;for(let n=1;n<e.length;n++)e[n]<e[i]&&(i=n);return[...e.slice(i),...e.slice(0,i)].join(">")}function $n(e,i={}){let n=ne(e,{scope:i.scope}),r=k(e,i.path);return ce(r,JSON.stringify({version:1,findings:n},null,2)+`
|
|
2
|
+
`),{path:r,findingCount:n.length}}function ie(e,i={}){let n=k(e,i.path);if(!se(n))throw new Error(`No baseline found at ${n}. Create one with: scip-query health --write-baseline`);let r=JSON.parse(ae(n,"utf-8")),o=new Set(r.findings??[]),s=ne(e,{scope:i.scope}),t=new Set(s);return{baselinePath:n,baselineCount:o.size,current:s,newFindings:s.filter(c=>!o.has(c)),fixedFindings:[...o].filter(c=>!t.has(c))}}var Bn=["echo","incomplete-migration","co-change-partner","doc-reference","unused-params","new-dead","baseline"];function Mn(e,i={}){let n=i.base??"HEAD",{minTogether:r=6,minConfidence:o=.6,maxEchoChecks:s=Number.POSITIVE_INFINITY,maxHelpers:t=Number.POSITIVE_INFINITY,minSimilarity:c=.8}=i,a=new Set(i.skip??[]),f=P(e,{base:n}),g=I(e,{base:n,plan:f}),u=g.changedFiles,d=new Set(u),l=new Set(f.changedFileLines),m=Xe(e.config.projectRoot,n,f),h={base:n,changedFiles:u,changedSymbols:g.changedSymbols.length,checksRun:[],skipped:[],suppressed:[],findings:[],rootCauseGroups:[],note:g.summary.note};if(u.length===0)return h;let p=(b,S)=>{if(a.has(b)){h.skipped.push({check:b,reason:"skipped via --skip"});return}S()};return p("echo",()=>De(e,g.changedSymbols,d,m,s,c,h)),p("incomplete-migration",()=>je(e,n,f,t,h)),p("co-change-partner",()=>Ee(e,d,r,o,h)),p("doc-reference",()=>Me(e,d,l,f.changedRanges,h)),p("unused-params",()=>Je(e,u,h)),p("new-dead",()=>Ze(e,g.changedSymbols,m,h)),p("baseline",()=>tn(e,h)),$e(h,e.config.suppressions??[]),h.rootCauseGroups=be(h.findings),h}function be(e){let i=new Map;for(let n of e){let r=n.groupKey??`${n.check}:${n.id}`,o=i.get(r);o||(o={groupKey:r,check:n.check,severity:n.severity,actionTier:n.actionTier,sourceAnalyzer:n.sourceAnalyzer,rootCauseKey:n.rootCauseKey,count:0,findingIds:[],files:new Set,relatedFiles:new Set,message:n.message,remediation:n.remediation},i.set(r,o)),o.count+=1,o.findingIds.push(n.id),o.severity=Ce(o.severity,n.severity),o.actionTier=Se(o.actionTier,n.actionTier),n.file&&o.files.add(n.file);for(let s of n.relatedFiles??[])o.relatedFiles.add(s)}return[...i.values()].map(n=>({...n,files:[...n.files].sort(),relatedFiles:[...n.relatedFiles].sort()})).sort((n,r)=>r.count-n.count||T(r.severity)-T(n.severity)||n.groupKey.localeCompare(r.groupKey))}function Ce(e,i){return T(i)>T(e)?i:e}function T(e){return e==="error"?2:e==="warning"?1:0}function Se(e,i){return e?i&&te(i)>te(e)?i:e:i}function te(e){return e==="direct"?2:e==="signal"?1:0}function $e(e,i){if(i.length===0||e.findings.length===0)return;let n=[];for(let r of e.findings){let o=i.find(s=>we(s,r));o?e.suppressed.push({finding:r,suppression:o}):n.push(r)}e.findings=n}function we(e,i){return!e.reason||e.reason.trim()===""||e.expiresAt&&Date.parse(e.expiresAt)<=Date.now()||e.id&&e.id!==i.id||e.check&&e.check!==i.check||e.file&&e.file!==i.file?!1:!!(e.id||e.check)}function De(e,i,n,r,o,s,t){t.checksRun.push("echo");for(let c of i.slice(0,o)){if(r(c))continue;let a=W(e,c.symbol,{minSimilarity:s,limit:5}),f=[];for(let l of a){let m=l.fileA===c.file?l.fileB:l.fileA,h=l.fileA===c.file?l.shortNameB:l.shortNameA,p=l.fileA===c.file?l.symbolB:l.symbolA;n.has(m)||f.push({otherFile:m,otherShort:h,otherSymbol:p,similarity:l.similarity,similarityBasis:l.similarityBasis??"callees",sharedEvidence:l.sharedCallees})}if(f.length===0)continue;let g=f[0],u=C("echo",c.symbol,c.file,...f.map(l=>`${l.otherSymbol}|${l.otherFile}`).sort()),d=ke(c,f);t.findings.push({id:u,groupKey:u,actionTier:d,check:"echo",severity:"warning",evidence:"heuristic",confidence:g.similarity,file:c.file,symbol:c.symbol,relatedFiles:[...new Set(f.map(l=>l.otherFile))].sort(),message:xe(c,f),why:Ae(c,f),remediation:Ge(d,c.shortName,g.otherShort),suppressionHint:`scip-query: ignore echo ${u} -- <reason>`})}i.length>o&&t.skipped.push({check:"echo",reason:`echo check capped at ${o} of ${i.length} changed symbols`})}function ke(e,i){return i.some(r=>Re(e.symbol,r))?"direct":"signal"}function Re(e,i){if(i.similarityBasis!=="source-tokens"||i.similarity<.98||i.sharedEvidence.length>8)return!1;let n=$(e),r=$(i.otherSymbol);return!n||!r?!1:n===r?!0:ve(i.sharedEvidence)?!1:Te(n,r)}function Te(e,i){let n=re(e),r=re(i);if(n.length===0||r.length===0)return!1;let o=new Set(r),s=n.filter(t=>o.has(t)).length;return s>=2&&s/Math.min(n.length,r.length)>=.5}function re(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(i=>i.toLowerCase()).filter(i=>i.length>=2)}var Fe=new Set(["bytes","crypto","hex","num","random","secret","to","token"]);function ve(e){return e.length>=3&&e.every(i=>Fe.has(i.toLowerCase()))}function xe(e,i){let n=i[0],r=Math.round(n.similarity*100);return i.length===1?`${e.shortName} (${e.file}) is ${r}% similar to established ${n.otherShort} (${n.otherFile})`:`${e.shortName} (${e.file}) resembles ${i.length} established symbol(s); strongest is ${r}% similar to ${n.otherShort} (${n.otherFile})`}function Ae(e,i){let n=[`${e.shortName} was changed in this diff.`];for(let r of i.slice(0,3))n.push(`${r.otherShort} is outside this diff and scored ${Math.round(r.similarity*100)}% similar by ${r.similarityBasis} evidence.`),n.push(`Shared evidence: ${r.sharedEvidence.slice(0,5).join(", ")||"(none listed)"}.`);return i.length>3&&n.push(`${i.length-3} additional similar match(es) grouped into this finding.`),n}function Ge(e,i,n){return e==="direct"?`Extract or reuse the shared behavior with ${n}, or keep the duplicate with a suppression reason.`:`Review whether ${i} is intentionally parallel to the established implementation(s); extract shared behavior only if the product semantics match.`}function je(e,i,n,r,o){let s=X(e,{base:i,maxHelpers:r,diffPlan:n});if(!s.available){o.skipped.push({check:"incomplete-migration",reason:"no git history"});return}o.checksRun.push("incomplete-migration"),s.note&&o.skipped.push({check:"incomplete-migration",reason:s.note});for(let t of s.findings){let c=t.leftovers.map(l=>`${l.shortName} (${l.file}, ${Math.round(l.containment*100)}% helper / ${Math.round(l.siteCoverage*100)}% site, ${l.migrationScope})`).join(", "),a=t.leftovers.map(l=>`${l.shortName}: ${l.migrationScope} (${l.migrationScopeReasons[0]})`).join("; "),f=[...t.migratedFiles,...t.leftovers.map(l=>l.file)],g=t.leftovers.length===0?void 0:Math.max(...t.leftovers.map(l=>Math.min(l.containment,l.siteCoverage))),u=t.leftovers.some(l=>l.migrationScope==="possible-subtype"),d=C("incomplete-migration",t.helperSymbol,t.helperFile,f.join("|"));o.findings.push({id:d,check:"incomplete-migration",severity:"warning",evidence:"heuristic",confidence:g,file:t.helperFile,symbol:t.helperSymbol,relatedFiles:f,message:`new helper ${t.helperShortName} (${t.helperFile}) is wired into ${t.migratedFiles.length} file(s), but ${t.leftovers.length} similar un-migrated site(s) remain: ${c}`,why:[`${t.helperShortName} is new in this diff and already referenced by ${t.migratedFiles.join(", ")}.`,`Helper shape: ${t.helperShape}; ${t.specificHelperCalleeCount}/${t.helperCalleeCount} helper callees are specific enough to score.`,`Unchanged site(s) still contain the helper's callee pattern: ${c}.`,`Migration scope hints: ${a}.`],remediation:u?`Migrate same-scope sites to ${t.helperShortName}; review possible subtype/variant sites before applying the helper.`:`Migrate the remaining sites to ${t.helperShortName}, or confirm they are intentionally different.`,suppressionHint:`scip-query: ignore incomplete-migration ${d} -- <reason>`})}}function Ee(e,i,n,r,o){let s=L(e,i,{minTogether:n,minConfidence:0,maxFilesPerCommit:20});if(!s){o.skipped.push({check:"co-change-partner",reason:"no git history"});return}o.checksRun.push("co-change-partner");let t=new Set,c;for(let a of s){let f=i.has(a.fileA),g=i.has(a.fileB);if(f===g)continue;let u=f?a.fileA:a.fileB,d=f?a.fileB:a.fileA,l=f?a.changesA:a.changesB,m=l>0?a.together/l:0;if(m<r||F(d)||F(u)||!x(`${e.config.projectRoot}/${d}`))continue;let h=`${u}|${d}`;if(t.has(h))continue;t.add(h);let p=C("co-change-partner",u,d,String(a.together)),b=N(u,d),S=K({fileA:u,fileB:d,together:a.together,confidence:m,commitScope:a.commitScope,recency:a.recency,subjectContext:a.subjectContext},b,(c??=B(e))(u,d)),A=[u,d].sort().join("|");o.findings.push({id:p,check:"co-change-partner",severity:"warning",evidence:"change-graph",actionTier:"signal",groupKey:`co-change-partner:${A}`,confidence:m,file:u,relatedFiles:[d],sourceAnalyzer:"co-change",rootCauseKey:A,partnerClass:b.partnerClass,partnerClassReasons:b.reasons,commitScope:a.commitScope,recency:a.recency,focusedTogether:a.focusedTogether,broadTogether:a.broadTogether,broadCommitRatio:a.broadCommitRatio,lastTogetherAt:a.lastTogetherAt,recentTogether:a.recentTogether,subjectContext:a.subjectContext,...S?{declaredCouplingSuggestion:S}:{},message:`${u} changed, but ${d} did not \u2014 they change together ${a.together}x (${Math.round(m*100)}% of the time)`,why:[`${u} is in this diff and ${d} is not.`,`Git history shows ${a.together} co-change(s), which is ${Math.round(m*100)}% of changes to the edited side.`,`History context: ${Le(a)}.`,`Subject context: ${Ne(a.subjectContext)}.`,...Ke(a),`Partner class: ${b.partnerClass} (${b.reasons.join("; ")}).`],remediation:S?`Update ${d} alongside this change, declare the coupling "${S.name}", or confirm the coupling no longer holds.`:`Update ${d} alongside this change, or confirm the coupling no longer holds.`,suppressionHint:`scip-query: ignore co-change-partner ${p} -- <reason>`})}}function Le(e){return`${e.commitScope}/${e.recency}; ${e.focusedTogether} focused, ${e.broadTogether} broad-sweep (${Math.round(e.broadCommitRatio*100)}% broad), ${e.recentTogether} recent, last ${Be(e.lastTogetherAt)}`}function Ne(e){let i=e.subjectLabels.length>0?e.subjectLabels.slice(0,5).join(", "):"none inferred",n=e.issueRefs.length>0?e.issueRefs.slice(0,5).join(", "):"none",r=e.sampleSubjects.length>0?e.sampleSubjects.slice(0,3).map(o=>`"${o}"`).join("; "):"none";return`labels ${i}; refs ${n}; samples ${r}; external issue/PR labels ${e.externalIssueLabelStatus}`}function Ke(e){let i=[];return e.commitScope==="broad-sweep"&&i.push("Broad-sweep history is weaker than focused co-edits; confirm this is a real coordination contract."),e.recency==="stale"&&i.push("The pair has no co-change in the recent history window; confirm the coupling still holds."),i}function Be(e){return e<=0?"unknown":new Date(e*1e3).toISOString().slice(0,10)}function Me(e,i,n,r,o){o.checksRun.push("doc-reference");let s=Oe(e,i,r);if(s.size!==0)for(let t of z(e,s)){if(n.has(t.doc))continue;let c=t.citedClaims.length>0?t.citedClaims:Pe(e,t.doc,t.cited),a=Ie(c),f=C("doc-reference",t.doc,t.cited.join("|"));o.findings.push({id:f,check:"doc-reference",severity:"warning",evidence:"change-graph",actionTier:a.actionTier,confidence:1,file:t.doc,relatedFiles:t.cited,citationKind:a.citationKind,citationKindReasons:a.reasons,citedClaims:c,message:`${t.doc} cites ${t.cited.join(", ")} as ${_e(a.citationKind)} \u2014 changed in this diff, doc untouched`,why:[`${t.cited.join(", ")} changed in this diff.`,`${t.doc} cites the changed file(s) but was not updated in the same diff.`,...a.reasons.map(g=>`Citation kind evidence: ${g}`)],remediation:ze(a.citationKind,t.doc),suppressionHint:`scip-query: ignore doc-reference ${f} -- <reason>`})}}function Ie(e){let i=e.join(`
|
|
3
|
+
`).toLowerCase(),n=[],r=v(i,[".scipquery","declaredcouplings","suppression","suppressions","config","configuration","json"]);if(r.length>0)return n.push(`configuration/example terms near citation: ${r.join(", ")}`),{citationKind:"configuration-example",actionTier:"support",reasons:n};let o=v(i,["accepted","intentional","intentionally","retained","historical"]);if(o.length>0)return n.push(`intentional-record terms near citation: ${o.join(", ")}`),{citationKind:"intentional-record",actionTier:"support",reasons:n};let s=v(i,["command","cli","usage","example","run","workflow"]);return s.length>0?(n.push(`guide/reference terms near citation: ${s.join(", ")}`),{citationKind:"guide-reference",actionTier:"signal",reasons:n}):(n.push(e.length>0?"citation appears in prose without config or guide markers":"citation context unavailable"),{citationKind:"behavioral-claim",actionTier:"direct",reasons:n})}function Pe(e,i,n){let r;try{r=oe(`${e.config.projectRoot}/${i}`,"utf-8").split(/\r?\n/)}catch{return[]}let o=n.flatMap(He),s=[];for(let t=0;t<r.length;t+=1){let c=r[t]??"";o.some(a=>c.includes(a))&&s.push(_(r,t))}return s}function He(e){let i=e.split("/");return[e,`./${e}`,i.slice(-3).join("/"),i.slice(-2).join("/")].filter((n,r,o)=>n.length>0&&o.indexOf(n)===r)}function v(e,i){return i.filter(n=>e.includes(n))}function _e(e){switch(e){case"behavioral-claim":return"a behavioral doc claim";case"configuration-example":return"a configuration example";case"guide-reference":return"a guide reference";case"intentional-record":return"an intentional record"}}function ze(e,i){switch(e){case"behavioral-claim":return`Re-read ${i} and update the behavioral claim or citation.`;case"configuration-example":return`Verify the configuration example in ${i} still points at the intended file; update only if the example target changed.`;case"guide-reference":return`Verify the guide reference in ${i} still sends readers to the right implementation or command surface.`;case"intentional-record":return`Verify the intentional citation in ${i} is still meant to name this file.`}}function Oe(e,i,n){let r=qe(n),o=new Set;for(let s of i)Ue(e,s,r.get(s)??[])&&o.add(s);return o}function qe(e){let i=new Map;for(let n of e){let r=i.get(n.file)??[];r.push(n),i.set(n.file,r)}return i}function Ue(e,i,n){if(n.length===0)return!1;if(!Ve.test(i))return!0;let r=`${e.config.projectRoot}/${i}`;if(!x(r))return!0;let o=oe(r,"utf-8").split(/\r?\n/),s=We(o);for(let t of n)for(let c=t.startLine;c<=t.endLine;c+=1)if((o[c]??"").trim()!==""&&!s.has(c))return!0;return!1}var Ve=/\.(?:[cm]?[jt]sx?)$/i;function We(e){let i=new Set,n=!1;for(let r=0;r<e.length;r+=1){let o=e[r].trim();!n&&Ye(o)&&(n=!0),n&&(i.add(r),o.endsWith(";")&&(n=!1))}return i}function Ye(e){return/^import(?:\s|$)/.test(e)||/^export(?:\s+type)?\s+(?:\*|\{)/.test(e)}function Je(e,i,n){n.checksRun.push("unused-params");for(let r of ee(e,{files:i,limit:50})){let o=C("unused-params",r.symbol,r.file,r.unusedTrailing.join("|"));n.findings.push({id:o,check:"unused-params",severity:"warning",evidence:"heuristic",confidence:.85,file:r.file,startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,message:`${r.shortName} (${r.file}) has trailing unused parameter(s): ${r.unusedTrailing.join(", ")}`,why:[`${r.shortName} is in a changed file.`,`The trailing parameter(s) ${r.unusedTrailing.join(", ")} are not referenced in the function body.`],remediation:"Drop the unused trailing parameters and their call-site arguments.",suppressionHint:`scip-query: ignore unused-params ${o} -- <reason>`})}}function Ze(e,i,n,r){r.checksRun.push("new-dead");let o=new j(e);for(let s of i){if(n(s)||s.fanIn>0||o.fileKind(s.file)==="test"||w(e,s.file)||D(e,s.symbol,s.file)||Qe(s.symbol))continue;let t=C("new-dead",s.symbol,s.file);r.findings.push({id:t,check:"new-dead",severity:"warning",evidence:"graph-fact",confidence:.9,file:s.file,symbol:s.symbol,message:`${s.shortName} (${s.file}) was changed but has zero indexed consumers`,why:[`${s.shortName} is a changed production symbol.`,"The index reports zero consumers for this symbol.","The symbol is not in a detected entry surface or configured live root."],remediation:"Wire it up, or remove it before it becomes permanent dead code.",suppressionHint:`scip-query: ignore new-dead ${t} -- <reason>`})}}function Qe(e){if(G(e)!=="type")return!1;let i=$(e);return i.startsWith("_Assert")||i.startsWith("Assert")}function Xe(e,i,n){let r=new Map(n.renamedFiles.map(s=>[s.to,s.from])),o=new Map;return s=>{let t=r.get(s.file)??s.file,c=$(s.symbol);if(!c)return!1;let a=o.get(t);return a===void 0&&(a=H(e,i,t),o.set(t,a)),a!==null&&en(a,c)}}function en(e,i){return new RegExp(`\\b${nn(i)}\\b`).test(e)}function nn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tn(e,i){if(!x(k(e))){i.skipped.push({check:"baseline",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}i.checksRun.push("baseline");let n=ie(e);for(let r of n.newFindings){let o=rn(r),s=C("baseline",r);i.findings.push({id:s,groupKey:`baseline:${o.sourceAnalyzer}:${o.rootCauseKey}`,check:"baseline",severity:"error",evidence:"baseline",actionTier:o.actionTier,confidence:1,file:o.file,relatedFiles:o.relatedFiles.length>0?o.relatedFiles:void 0,sourceAnalyzer:o.sourceAnalyzer,rootCauseKey:o.rootCauseKey,message:`new ${o.label} vs committed baseline: ${r}`,why:["A committed health baseline exists.","The current health result contains a finding not present in that baseline.",`Underlying analyzer: ${o.sourceAnalyzer}.`,`Inherited action tier: ${o.actionTier}.`,`Root cause key: ${o.rootCauseKey}.`,...o.why],remediation:o.remediation,suppressionHint:`scip-query: ignore baseline ${s} -- <reason>`})}}function rn(e){let[i,n]=R(e,":"),r=i||"unknown",o=(s={})=>{let t=s.actionTier??on(r);return{sourceAnalyzer:r,actionTier:t,rootCauseKey:s.rootCauseKey??(n||e),label:s.label??`${r} finding`,relatedFiles:s.relatedFiles??[],why:s.why??[],remediation:s.remediation??sn(t,r),file:s.file}};if(!n)return o({rootCauseKey:e,why:["Baseline identity did not include analyzer payload."]});if(["dead","isolated","extract","wrapper","passthrough","stale"].includes(r)){let[s,t]=R(n,":");return o({file:s,relatedFiles:s?[s]:[],rootCauseKey:t?`${s}:${t}`:n,label:`${r} finding`,why:t?[`Baseline subject: ${t}.`]:[]})}if(r==="cycle"){let s=n.split(">").filter(Boolean);return o({relatedFiles:s,rootCauseKey:n,label:"cycle finding",why:s.length>0?[`Cycle path: ${s.join(" > ")}.`]:[]})}if(r==="similar"){let s=n.split("|").filter(Boolean);return o({relatedFiles:[],rootCauseKey:n,label:"similarity finding",why:s.length>0?[`Similar symbols: ${s.join(" | ")}.`]:[]})}if(r==="drift"){let[s,t]=R(n,":"),[c,a]=R(t,":");return o({actionTier:s==="unused-import"?"direct":"signal",file:c,relatedFiles:[...new Set([c,a].filter(Boolean))],rootCauseKey:n,label:`${s||"drift"} finding`,why:[...s?[`Drift kind: ${s}.`]:[],...a?[`Related dependency: ${a}.`]:[]]})}return o({why:["Baseline analyzer prefix is not recognized by this diff-gate version."]})}function on(e){switch(e){case"dead":case"isolated":case"cycle":case"passthrough":return"direct";case"similar":case"extract":case"wrapper":case"stale":return"signal";default:return"signal"}}function sn(e,i){return e==="direct"?`Fix the new ${i} baseline finding, or knowingly accept it via health --write-baseline.`:`Review the new ${i} baseline signal; fix it if it reflects real debt, or knowingly accept it via health --write-baseline.`}function R(e,i){let n=e.indexOf(i);return n<0?[e,""]:[e.slice(0,n),e.slice(n+i.length)]}function C(e,...i){return`SQ${ye("sha256").update([e,...i].join("\0")).digest("hex").slice(0,12).toUpperCase()}`}export{ne as a,$n as b,ie as c,Bn as d,Mn as e,Xe as f};
|
|
4
|
+
//# sourceMappingURL=chunk-I7TSQZ3J.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as m}from"./chunk-
|
|
1
|
+
import{b as m}from"./chunk-CTCAF3YA.js";import{i as o}from"./chunk-3UW7VM4H.js";function h(t,l){let s=m(t,l);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let d=s.map(()=>"?").join(", "),i=t.all(`SELECT relative_path FROM documents
|
|
2
2
|
WHERE relative_path IN (${d})
|
|
3
3
|
ORDER BY relative_path`,...s).map(e=>e.relative_path).filter(e=>!t.isIgnored(e)),n=o(t,i,{onlyDocumented:!0,sort:!0}).map(({relativePath:e,...c})=>c),a=t.all(`SELECT DISTINCT d2.relative_path
|
|
4
4
|
FROM mentions m
|
|
@@ -32,4 +32,4 @@ import{b as m}from"./chunk-QOFKVNFE.js";import{u as o}from"./chunk-64LH2QUP.js";
|
|
|
32
32
|
WHERE d2.relative_path IN (${d})
|
|
33
33
|
AND d1.relative_path NOT IN (${d})
|
|
34
34
|
ORDER BY d1.relative_path`,...s,...s).map(e=>e.relative_path).filter(e=>!t.isIgnored(e));return{files:i,symbols:n,dependsOn:a,dependedOnBy:r}}export{h as a};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-ICXVNWMI.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var d={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function l(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let t=e.split(" ");if(t.length<4)return{scheme:t[0]??"",manager:t[1]??"",packageName:t[2]??"",version:"",descriptors:[],raw:e};let s=t[0],i=t[1],r=e.slice(s.length+1+i.length+1),n;if(r.startsWith("`")){let f=r.indexOf("`",1);f===-1?(n=r.slice(1),r=""):(n=r.slice(1,f),r=r.slice(f+2))}else{let f=r.indexOf(" ");f===-1?(n=r,r=""):(n=r.slice(0,f),r=r.slice(f+1))}let o,c=r.indexOf(" ");c===-1?(o=r,r=""):(o=r.slice(0,c),r=r.slice(c+1));let a=m(r);return{scheme:s,manager:i,packageName:n,version:o,descriptors:a,raw:e}}function b(e){let t=l(e);if("kind"in t)return null;for(let s=t.descriptors.length-2;s>=0;s--){let i=t.descriptors[s];if(i?.suffix==="type")return i.name}return null}function m(e){let t=[],s=0;for(;s<e.length;){if(e[s]==="["){let n=e.indexOf("]",s+1);if(n===-1){t.push({name:e.slice(s+1),suffix:"type-param"});break}t.push({name:e.slice(s+1,n),suffix:"type-param"}),s=n+1;continue}if(e[s]==="("&&(t.length===0||s===0||u(e[s-1]))){let n=e.indexOf(")",s+1);if(n!==-1&&e[n+1]!=="."){t.push({name:e.slice(s+1,n),suffix:"parameter"}),s=n+1;continue}}let i;if(e[s]==="`"){let n=e.indexOf("`",s+1);if(n===-1){i=e.slice(s+1),t.push({name:i,suffix:"term"});break}i=e.slice(s+1,n),s=n+1}else{let n=s;for(;s<e.length&&!u(e[s]);)s++;i=e.slice(n,s)}if(s>=e.length){i&&t.push({name:i,suffix:"term"});break}let r=e[s];if(r==="("){let n=e.indexOf(")",s+1);n!==-1&&e[n+1]==="."?(t.push({name:i,suffix:"method"}),s=n+2):n!==-1?(t.push({name:i,suffix:"method"}),s=n+1):(t.push({name:i,suffix:"term"}),s++)}else{let n=d[r];n&&t.push({name:i,suffix:n}),s+=1}}return t}function u(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function y(e){let t=l(e);if("kind"in t&&t.kind==="local")return`local:${t.id}`;let s=t;if(s.descriptors.length===0)return s.raw;let i=[];for(let r of s.descriptors){let n=g(r);n&&i.push(n)}return i.join(":")}function g(e){let t=e.suffix==="namespace"?x(e.name):e.name;return t?e.suffix==="method"?`${t}()`:t:""}function x(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function k(e){let t=l(e);if("kind"in t&&t.kind==="local")return t.id;let s=t;return s.descriptors.length===0?"":s.descriptors[s.descriptors.length-1].name}function p(e){let t=l(e);if("kind"in t&&t.kind==="local")return null;let s=t;return s.descriptors[s.descriptors.length-1]?.suffix??null}function D(e){return e.endsWith("().")||p(e)==="method"}function $(e){let t=p(e);return t==="method"||t==="term"}function T(e){return p(e)==="namespace"}var h=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function M(e){return h.test(e)}var S=new Set(["test","tests","_tests"]);function O(e){let t=l(e);if("kind"in t)return!1;for(let s=0;s<t.descriptors.length-1;s+=1){let i=t.descriptors[s];if(i?.suffix==="namespace"&&i.name&&S.has(i.name))return!0}return!1}function j(e,t){let s=l(e),i=l(t);if("kind"in s||"kind"in i)return!1;let r=s.descriptors,n=i.descriptors;if(n.length!==r.length+1)return!1;for(let o=0;o<r.length;o++){let c=r[o],a=n[o];if(c.name!==a.name||c.suffix!==a.suffix)return!1}return!0}function I(e,t){let s=l(e),i=l(t);if("kind"in s||"kind"in i)return!1;let r=s.descriptors,n=i.descriptors;if(n.length<=r.length)return!1;for(let o=0;o<r.length;o++){let c=r[o],a=n[o];if(c.name!==a.name||c.suffix!==a.suffix)return!1}return!0}export{l as a,b,y as c,k as d,p as e,D as f,$ as g,T as h,M as i,O as j,j as k,I as l};
|
|
2
|
+
//# sourceMappingURL=chunk-JM72FNGA.js.map
|
|
@@ -68,4 +68,4 @@ Thumbs.db
|
|
|
68
68
|
JOIN documents d ON d.id = der.document_id
|
|
69
69
|
ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
|
|
70
70
|
`).all(),r=new Map;for(let n of t){let i=r.get(n.relativePath);i||(i={containingByLine:new Map,starts:[]},r.set(n.relativePath,i)),i.starts.push({line:n.startLine,symbolId:n.symbolId});for(let o=n.startLine;o<=n.endLine;o++)i.containingByLine.set(o,n.symbolId)}for(let n of r.values())n.starts.sort((i,o)=>i.line-o.line);return r}function Ee(e,t,r){let n=0,i=e.length-1;for(;n<=i;){let s=Math.floor((n+i)/2);e[s].line<t?n=s+1:i=s-1}let o=null;for(let s of[i,n]){let a=e[s];if(!a)continue;let u=Math.abs(a.line-t);u>r||(!o||u<o.distance)&&(o={distance:u,symbolId:a.symbolId})}return o?.symbolId??null}function j(e,t){let r=Pe(t),n=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),i=new Map;return{get(o){if(i.has(o))return i.get(o)??null;let s=Ne(n,r,t,o);return i.set(o,s),s}}}function _(e,t,r,n,i){if(e.fileName.endsWith(".vue")){let o=n.language.scripts.get(e.fileName),s=o?.generated?.languagePlugin.typescript?.getServiceScript(o.generated.root)?.code;if(o&&s){let a=n.language.maps.get(s,o);if(R(a,e.textSpan.start)!==null)return r.get(e.fileName)}return e.fileName.startsWith(i)?r.get(e.fileName):null}return t(e)}function*M(e){let t=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,r=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),n;for(;n=t.exec(e);){let i=n[0];r.has(i)||(yield{text:i,start:n.index,end:n.index+i.length})}}function G(e,t){for(let[r]of e.toGeneratedLocation(t,n=>!!n.navigation))return r;return null}function R(e,t){let r=e;for(let[n]of r.toSourceLocation(t,i=>!!i.navigation))return n;return null}function we(e,t){let r=0,n=e.lineStarts.length-1;for(;r<=n;){let o=Math.floor((r+n)/2);e.lineStarts[o]<=t?r=o+1:n=o-1}let i=Math.max(0,n);return{line:i,character:t-e.lineStarts[i]}}function $(e,t){return f(e,t).startsWith("node_modules/")}function f(e,t){return Ce(e,t).replaceAll("\\","/")}function Oe(e){switch(Ve(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function W(){let e=new Map;return{get(t){if(e.has(t))return e.get(t)??null;try{let r=v(t,"utf-8"),n={text:r,lineStarts:Ae(r)};return e.set(t,n),n}catch{return e.set(t,null),null}},positionAt:we}}function Ae(e){let t=[0];for(let r=0;r<e.length;r++)e.charCodeAt(r)===10&&t.push(r+1);return t}function Pe(e){try{let t=JSON.parse(v(A(e,"package.json"),"utf-8"));return{name:t.name??"workspace",version:t.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function Ne(e,t,r,n){let i=f(r,n),o=je(t.name,t.version,i);return e.get(o)?.id??null}function je(e,t,r){let n=r.split("/").map(i=>`\`${i.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${t} ${n}/default.`}function Kt(e){let t=Me(e.projectRoot,e.tsconfig),r=new _e(e.dbPath,{readonly:!0});try{let n=Ge({db:r,projectRoot:e.projectRoot,configPath:t,vueSymbolLookup:j(r,e.projectRoot)});return $e({vueFiles:e.vueFiles??[],tasks:e.tasks,...n})}finally{r.close()}}function Ge(e){let t=W();return{projectRoot:e.projectRoot,context:P(e.projectRoot,e.configPath),symbolLookup:N(e.db,e.projectRoot,t),vueSymbolLookup:e.vueSymbolLookup,sourceReader:t}}function $e(e){let t=[],r=0,n=e.tasks??e.vueFiles.map(i=>({fileName:i,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let i of n){let o=We(e,i);t.push(...o.occurrences),r+=o.skippedReferences}return{occurrences:t,skippedReferences:r}}function We(e,t){let r=e.context.language.scripts.get(t.fileName),n=r?.generated?.languagePlugin.typescript?.getServiceScript(r.generated.root)?.code;if(!r||!n)return{occurrences:[],skippedReferences:t.countFileSkip?1:0};let i=e.sourceReader.get(t.fileName);if(!i)return{occurrences:[],skippedReferences:t.countFileSkip?1:0};let o=e.context.language.maps.get(n,r),s=f(e.projectRoot,t.fileName),a=[...M(i.text)],u={tokens:a.filter(c=>c.start>=t.startOffset&&c.start<t.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:Ke(a),processedStarts:new Set};return He({...e,fileName:t.fileName,sourceInfo:i,sourceFile:s,map:o,tokenContext:u})}function He(e){let t=[],r=0;for(let n of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(n.start))continue;let i=G(e.map,n.start);if(i===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,i+1)??[]).find(u=>!$(e.projectRoot,u.fileName));if(!s){r++;continue}let a=_(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(a===null){r++;continue}H(t,e.sourceReader,e.sourceInfo,e.sourceFile,n,a),e.tokenContext.processedStarts.add(n.start),Ue(t,e,n,i,a)}return{occurrences:t,skippedReferences:r}}function Ue(e,t,r,n,i){if(!((t.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let o of Be(t.context.languageService,t.fileName,n+1,t.map,r,t.tokenContext.tokenByStart)){if(t.tokenContext.processedStarts.has(o))continue;let s=t.tokenContext.tokenByStart.get(o);s&&(H(e,t.sourceReader,t.sourceInfo,t.sourceFile,s,i),t.tokenContext.processedStarts.add(o))}}function H(e,t,r,n,i,o){let s=t.positionAt(r,i.start);e.push({sourceFile:n,sourceLine:s.line,sourceStartChar:s.character,sourceEndChar:s.character+i.text.length,symbolId:o})}function Ke(e){let t=new Map;for(let r of e)t.set(r.text,(t.get(r.text)??0)+1);return t}function Be(e,t,r,n,i,o){let s=e.getDocumentHighlights?.(t,r,[t])??[],a=[];for(let u of s)if(u.fileName===t)for(let c of u.highlightSpans){let l=Je(n,c.textSpan.start,o,i.text);l!==null&&a.push(l)}return a}function Je(e,t,r,n){let i=r.get(t);if(i?.text===n)return i.start;let o=R(e,t);if(o===null)return null;let s=r.get(o);return s?.text===n?s.start:null}export{St as a,Ct as b,Kt as c};
|
|
71
|
-
//# sourceMappingURL=chunk-
|
|
71
|
+
//# sourceMappingURL=chunk-KPHKX4LP.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{d as y}from"./chunk-7S5E7KWT.js";import{execFileSync as H}from"child_process";var F=2e3,E=50,j=8,M=3,D=2160*60*60,L=/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i,O=3,B=/#\d+|\b[A-Z][A-Z0-9]+-\d+\b/g,I=/^([a-z][a-z0-9-]+)(?:\([^)]+\))?!?:/i;function S(e){let t=y(e,{clearGroups:["whole-project"]});return(n,r)=>{let i=v(n.config.projectRoot);if(!i)return null;let s=t.has(n)?t.get(n,()=>({head:"",value:null})):null;return s&&s.head===i?s.value:(t.invalidate(n),t.get(n,()=>({head:i,value:r(n.config.projectRoot,i)})).value)}}var N=S("git-commit-history");function x(e){return N(e,k)}function v(e){try{return A(e,["rev-parse","HEAD"]).trim()||null}catch{return null}}function A(e,t){return H("git",["-C",e,...t],{encoding:"utf-8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"]})}function k(e,t){let n;try{n=A(e,["log","--no-merges","--name-only","-n",String(F),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let r=[],i=0;for(let s of n.split("")){if(s.trim()==="")continue;let a=s.indexOf(`
|
|
2
|
+
`),d=a>=0?s.slice(0,a):s,[g,f,C]=d.split("\0");if(!g||!f)continue;let c=a>=0?s.slice(a+1).split(`
|
|
3
|
+
`).map(o=>o.trim()).filter(o=>o!==""):[];if(c.length>E){i+=1;continue}r.push({hash:g,timestamp:Number(f)||0,subject:C??"",files:c})}return{head:t,commits:r,skippedBulkCommits:i}}function z(e){return L.test(e.subject)}function Y(e){let t=x(e);if(!t)return null;let n=new Map;for(let r of t.commits){let i=z(r);for(let s of r.files){let a=n.get(s)??{changes:0,fixChanges:0,lastChangedAt:0};a.changes+=1,i&&(a.fixChanges+=1),r.timestamp>a.lastChangedAt&&(a.lastChangedAt=r.timestamp),n.set(s,a)}}return n}function ee(e){let t=x(e);if(!t||t.commits.length===0)return null;let n=t.commits.map(r=>r.files.length).filter(r=>r>0).sort((r,i)=>r-i);return n.length===0?null:{medianFilesPerCommit:R(n,.5),p90FilesPerCommit:R(n,.9),commitsAnalyzed:n.length}}function R(e,t){let n=Math.min(e.length-1,Math.floor(e.length*t));return e[n]}var G=S("git-tracked-files");function te(e){return G(e,t=>{try{let n=A(t,["ls-files"]);return new Set(n.split(`
|
|
4
|
+
`).map(r=>r.trim()).filter(r=>r!==""))}catch{return null}})}var U=S("git-file-adds");function ne(e){return U(e,t=>J(t))}function J(e){let t;try{t=A(e,["log","--no-merges","--diff-filter=A","--name-only","-n",String(F),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let n=new Map,r=-1;for(let i of t.split("")){if(i.trim()==="")continue;r+=1;let s=i.indexOf(`
|
|
5
|
+
`),a=s>=0?i.slice(0,s):i,[,d]=a.split("\0"),g=Number(d)||0;if(!(s<0))for(let f of i.slice(s+1).split(`
|
|
6
|
+
`)){let C=f.trim();C!==""&&n.set(C,{commitsAgo:r,addedAt:g})}}return n}function re(e,t={}){let n=x(e);return n?P(n,t):null}function oe(e,t,n={}){let r=x(e);return r?t.size===0?[]:P(r,n,t):null}function P(e,t,n){let{minTogether:r=4,minConfidence:i=.6,maxFilesPerCommit:s=E}=t,a=new Map,d=new Map,g=0;for(let c of e.commits){let o=[...new Set(c.files)].sort();if(o.length>s)continue;c.timestamp>g&&(g=c.timestamp);let u=V(o),p=n===void 0||o.some(l=>n.has(l));for(let l of o)a.set(l,(a.get(l)??0)+1);if(p)for(let l=0;l<o.length;l++)for(let h=l+1;h<o.length;h++){if(n&&!n.has(o[l])&&!n.has(o[h]))continue;let b=`${o[l]}\0${o[h]}`,m=d.get(b)??{together:0,focusedTogether:0,broadTogether:0,lastTogetherAt:0,timestamps:[],subjects:[]};m.together+=1,u?m.broadTogether+=1:m.focusedTogether+=1,c.timestamp>m.lastTogetherAt&&(m.lastTogetherAt=c.timestamp),m.timestamps.push(c.timestamp),m.subjects.push(c.subject),d.set(b,m)}}let f=[],C=g-D;for(let[c,o]of d){let u=o.together;if(u<r)continue;let[p,l]=c.split("\0"),h=a.get(p)??u,b=a.get(l)??u,m=Math.max(u/h,u/b);if(m<i)continue;let _=o.broadTogether/u,T=o.timestamps.filter(w=>w>=C).length;f.push({fileA:p,fileB:l,together:u,confidence:m,changesA:h,changesB:b,focusedTogether:o.focusedTogether,broadTogether:o.broadTogether,broadCommitRatio:_,lastTogetherAt:o.lastTogetherAt,recentTogether:T,commitScope:W(o.broadTogether,u),recency:T>0?"recent":"stale",subjectContext:X(o.subjects)})}return f.sort((c,o)=>o.together-c.together||o.confidence-c.confidence||c.fileA.localeCompare(o.fileA)),f}function V(e){return e.length>=j?!0:K(e).size>=M}function K(e){let t=new Set;for(let n of e){let r=n.indexOf("/");t.add(r>=0?n.slice(0,r):".")}return t}function W(e,t){return e===0?"focused":e/t>=.5?"broad-sweep":"mixed"}function X(e){let t=new Set,n=[],r=[];for(let i of e){!r.includes(i)&&r.length<O&&r.push(i);for(let s of Z(i))t.add(s);for(let s of i.match(B)??[])n.includes(s)||n.push(s)}return{subjectLabels:[...t].sort(),issueRefs:n,sampleSubjects:r,externalIssueLabelStatus:"unavailable"}}function Z(e){let t=new Set,n=I.exec(e)?.[1]?.toLowerCase();return n&&t.add($(n)),/\b(?:feat|feature)\b/i.test(e)&&t.add("feature"),/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i.test(e)&&t.add("fix"),/\b(?:docs?|documentation|guide|readme)\b/i.test(e)&&t.add("docs"),/\brefactor(?:ing|ed)?\b/i.test(e)&&t.add("refactor"),/\btests?\b/i.test(e)&&t.add("test"),/\b(?:release|version|v\d+\.\d+)\b/i.test(e)&&t.add("release"),/\bchore\b/i.test(e)&&t.add("chore"),/\bbuild\b/i.test(e)&&t.add("build"),/\bci\b/i.test(e)&&t.add("ci"),/\bperf(?:ormance)?\b/i.test(e)&&t.add("perf"),[...t]}function $(e){return e==="feat"?"feature":e}export{x as a,Y as b,ee as c,te as d,ne as e,re as f,oe as g};
|
|
7
|
+
//# sourceMappingURL=chunk-KRGBLZT2.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-CTCAF3YA.js";import{a as h}from"./chunk-MZ7APUFN.js";import{c as p}from"./chunk-JM72FNGA.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let l=h(t,e);return l?R(t,l,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),l;try{l=f(r,"utf-8")}catch{return null}let n=l.split(`
|
|
2
2
|
`),c=Math.max(0,e.startLine-a),i=Math.min(n.length-1,e.endLine+a),u=n.slice(c,i+1).join(`
|
|
3
3
|
`);return{symbol:e.symbol,shortName:p(e.symbol),relativePath:e.relativePath,startLine:c,endLine:i,language:s?.language??v(e.relativePath),source:u}}function j(t,e,a,s,r){let l=m(t,e);if(!l)return null;let n=t.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",l);if(!n)return null;let c=d(t.config.projectRoot,n.relative_path),i;try{i=f(c,"utf-8")}catch{return null}let u=i.split(`
|
|
4
4
|
`),o=Math.max(0,a-1-r),g=Math.min(u.length-1,s-1+r),b=u.slice(o,g+1).join(`
|
|
5
5
|
`);return{symbol:`${n.relative_path}:${a}-${s}`,shortName:`${n.relative_path}:${a}-${s}`,relativePath:n.relative_path,startLine:o,endLine:g,language:n.language??v(n.relative_path),source:b}}function v(t){switch(y(t).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{M as a};
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
6
|
+
//# sourceMappingURL=chunk-LPLGJ4HO.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as p}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-3ZYF3ELZ.js";import{a as f}from"./chunk-GZCQTZLK.js";import{a as c}from"./chunk-YTR4CO5S.js";import{c as m}from"./chunk-JM72FNGA.js";function k(o,n={}){let{limit:s=20,scope:i,minFanIn:r=2,minFanOut:a=2,scanLimit:e}=n,u=new b(o);return p(u.productionCallableDefinitions({scope:i,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof e=="number"&&e>0}),e).map(t=>d(o,t,n.semantic!==!1)).filter(t=>t.fanIn>=r&&t.fanOut>=a).sort((t,l)=>l.score-t.score||l.fanIn-t.fanIn).slice(0,s)}function d(o,n,s){let i=new Set(f(o,n,{limit:500,semantic:s}).map(e=>e.file)).size,r=new Set(c(o,n,{limit:500,semantic:s}).filter(e=>e.file!==n.relativePath).map(e=>`${e.symbol}|${e.file}`)).size,a=i*r;return{symbol:n.symbol,shortName:m(n.symbol),fanIn:i,fanOut:r,score:a,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${i} incoming file(s) reference this symbol`,`${r} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${a} (fan-in * fan-out)`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{k as a};
|
|
2
|
+
//# sourceMappingURL=chunk-MUULWXSJ.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as y,b as d,e as w,l as f}from"./chunk-3UW7VM4H.js";import{b as D,c as $,d as Q,f as v,g as A,h as N}from"./chunk-JM72FNGA.js";function re(e,n){let t=Z(e,n.trim());if(t)return t;let i=q(e,n);if(i)return i;let o=F(e,n);return o||j(e,n)}function F(e,n){let t=x(n),i=I(t);if(!i)return null;let o=`%${i.path}%`,r=i.leaf,c=O(e,o,r,t)[0];return c?f(e,c):null}function O(e,n,t,i){let o=w([],[...z(e,n,t),...W(e,n,t)]).filter(r=>!e.isIgnored(r.relative_path)).filter(r=>h(r,i)>1);return o.sort((r,a)=>h(a,i)-h(r,i)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.start_line-a.start_line||r.symbol.localeCompare(a.symbol)),o}function z(e,n,t){return y(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function W(e,n,t){return d(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function j(e,n){let t=x(n),i=U(n),o=H(e,i),r=V(o,n,t);if(r&&!e.isIgnored(r.relative_path))return f(e,r);let a=null;for(let c of o){if(e.isIgnored(c.relative_path))continue;let l=J(c,n,t,i);l<=0||(!a||l>a.score)&&(a={row:c,score:l})}return a?f(e,a.row):null}function q(e,n){let t=n.match(/^(.+):(\d+)-(\d+)$/);if(!t)return null;let[,i,o,r]=t,a=Math.max(0,parseInt(o,10)-1),c=Math.max(a,parseInt(r,10)-1),l=T(e,i,a,c)??X(e,i,a,c);return l&&!e.isIgnored(l.relative_path)?f(e,l):null}function T(e,n,t,i){return y(e,{where:"d.relative_path LIKE ? AND der.start_line <= ? AND der.end_line >= ?",params:[`%${n}%`,t,i],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function X(e,n,t,i){return d(e,{where:"d.relative_path LIKE ? AND c.start_line <= ? AND c.end_line >= ?",params:[`%${n}%`,t,i],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function Z(e,n){let i=y(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line",limit:1})[0]??d(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line",limit:1})[0];return!i||e.isIgnored(i.relative_path)?null:f(e,i)}function ae(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=G(e,n.symbolId)[0];return t?f(e,t):null}function G(e,n){let t=y(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),i=d(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return w(t,i)}function H(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),i=n.flatMap(c=>{let l=`%${c}%`;return[l,l,l]}),o=t.join(`
|
|
2
|
+
AND `),r=y(e,{where:o,params:i,limit:200}),a=d(e,{where:o,params:i,limit:200});return w(r,a)}function J(e,n,t,i){let o=n.trim(),r=t,a=r.replace(/\(\)$/,""),c=n.toLowerCase(),l=t.toLowerCase(),S=l.replace(/\(\)$/,""),k=e.symbol,C=$(e.symbol),b=Q(e.symbol),E=e.display_name??"",g=e.symbol.toLowerCase(),u=C.toLowerCase(),m=b.toLowerCase(),R=E.toLowerCase(),p=e.relative_path.toLowerCase(),K=/[/:.]/.test(t),M=I(t),_=M?.leaf.toLowerCase(),s=0;return(k===o||k===r)&&(s+=1150),(C===o||C===r)&&(s+=1100),E===a&&(s+=1180),b===a&&(s+=1160),(`${b}()`===o||`${b}()`===r)&&(s+=955),(g===c||g===l)&&(s+=1e3),(u===c||u===l)&&(s+=950),(p===c||p===l)&&(s+=925),(p.endsWith(`/${l}`)||p.endsWith(`/${c}`))&&(s+=875),R===S&&(s+=850),m===S&&(s+=825),(`${m}()`===c||`${m}()`===l)&&(s+=820),(u.endsWith(`:${l}`)||u.endsWith(`:${S}`)||u.endsWith(`:${S}()`))&&(s+=800),g.includes(l)&&(s+=120),u.includes(l)&&(s+=140),p.includes(l)&&(s+=140),R.includes(l)&&(s+=110),i.every(B=>{let L=B.toLowerCase();return g.includes(L)||u.includes(L)||p.includes(L)||R.includes(L)})&&(s+=100+i.length*15),M&&p.includes(M.path.toLowerCase())&&(s+=360,_&&(m===_||`${m}()`===_||`${m}()`==`${_}()`)&&(s+=700),v(e.symbol)&&(s+=180)),A(e.symbol)&&m===S&&(s+=60),!K&&N(e.symbol)&&(s-=160),s-=Math.min(50,Math.max(0,e.end_line-e.start_line)),s}function I(e){let n=e.trim().replace(/\\/g,"/"),t=n.lastIndexOf("/");if(t<=0||t===n.length-1)return null;let i=n.slice(t+1).replace(/\(\)$/,"");return!i||i.includes(".")?null:{path:n.slice(0,t),leaf:i}}function x(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function U(e){let n=x(e),t=n.split(/[^A-Za-z0-9_]+/).map(i=>i.trim()).filter(i=>i.length>0);return t.length>0?[...new Set(t)]:[n]}function V(e,n,t){let i=n.trim(),o=e.filter(r=>{let a=$(r.symbol),c=(r.display_name??"").trim();return r.symbol===i||a===i||a===t||c===i||c===t||`${c}()`===i||h(r,t)>1||r.relative_path===i});return o.length===0?null:(o.sort((r,a)=>h(a,t)-h(r,t)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.relative_path.localeCompare(a.relative_path)||r.symbol.localeCompare(a.symbol)),o[0]??null)}function h(e,n){let t=I(n);if(!t)return 0;let i=e.relative_path.toLowerCase(),o=Q(e.symbol).toLowerCase(),r=t.path.toLowerCase(),a=t.leaf.toLowerCase();return i.includes(r)?o!==a?1:v(e.symbol)?D(e.symbol)===null?5:4:D(e.symbol)===null?3:2:0}export{re as a,Z as b,ae as c};
|
|
3
|
+
//# sourceMappingURL=chunk-MZ7APUFN.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as b}from"./chunk-PFOCOG57.js";import{a as g}from"./chunk-3ZYF3ELZ.js";import{a as d}from"./chunk-HVTYSC26.js";import{c as p}from"./chunk-JM72FNGA.js";import{a as c}from"./chunk-QLNGUWR7.js";import{a as o}from"./chunk-EWC3UK4V.js";function T(t,r={}){let{scope:l,limit:s=30,scanLimit:f}=r,u=r.files===void 0?null:new Set(r.files),L=new g(t);return b({candidates:()=>L.productionCallableDefinitions({scope:l,minLoc:2,excludeRootedSymbols:!0,requireFunctionLikeSymbol:!0}).filter(e=>h(e.relativePath)&&(u===null||u.has(e.relativePath))),scanLimit:f,evaluate:e=>{let n=c(t,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);if(!n||n.params.length===0||n.params.some(a=>!a.simple)||n.paramsEndLine>=n.endLine)return null;let y=d(t,e.relativePath),m=[];for(let a=n.params.length-1;a>=0;a--){let i=n.params[a];if(i.name===""||i.name.startsWith("_")||P(y.get(i.name),n.paramsEndLine,n.endLine))break;m.unshift(i.name)}return m.length===0?null:{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,paramCount:n.paramCount,unusedTrailing:m}},orderResults:(e,n)=>n.unusedTrailing.length-e.unusedTrailing.length||e.file.localeCompare(n.file)||e.startLine-n.startLine,limit:s})}function h(t){let r=o(t);return r==="typescript"||r==="tsx"||r==="javascript"}function P(t,r,l){return t?t.some(s=>s>r&&s<=l):!1}export{T as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NNDYO2DX.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{a as S}from"./chunk-
|
|
2
|
-
`)).map(s=>s.trim()).filter(s=>s.length>0))]}function k(e,n){let t=d("git",["diff","--unified=0",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--unified=0","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4});return _([...L(t),...L(i)])}function z(e,n,t){try{return d("git",["show",`${n}:./${t}`],{encoding:"utf-8",cwd:e,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function B(e,n,t){
|
|
1
|
+
import{a as S}from"./chunk-3ZYF3ELZ.js";import{e as b}from"./chunk-FUPDW5AC.js";import{c as p,f as h,h as y}from"./chunk-JM72FNGA.js";import{execFileSync as d}from"child_process";import{existsSync as x,readFileSync as N}from"fs";import{basename as C}from"path";var v="Unable to compute git diff.";function le(e,n={}){let t=n.plan??P(e,n);return t.note?A(t.note,t.changedFileLines):t.changedFiles.length===0?O(t.changedFileLines):T(t.changedFiles,[E(e,t.changedFiles,t.changedFiles,t.changedRanges)])}function P(e,n={}){let{base:t="HEAD"}=n;try{let i=$(e.config.projectRoot,t),r=J(e,i),s=G(e,k(e.config.projectRoot,t));return{changedFileLines:i,changedFiles:r,changedRanges:s,renamedFiles:B(e.config.projectRoot,t,r),note:i.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:v}}}function E(e,n,t,i=[]){let r=new S(e),s=new Set(t),a=q(i),l=[],m=new Map,f=n.flatMap(o=>r.definitionsForFile(o)).filter(ee).filter(o=>V(o,a)).sort((o,u)=>o.relativePath.localeCompare(u.relativePath)||o.startLine-u.startLine),c=f.map(o=>o.symbolId),g=K(e,c),w=Q(e,c,t),M=b(e,f.filter(o=>g.get(o.symbolId)===0));for(let o of f)j(e,o,s,l,m,M.get(o.symbolId)??new Set,g.get(o.symbolId)??0,w.get(o.symbolId)??new Set);return{changedSymbols:l,consumerEntries:[...m.entries()].map(([o,u])=>({file:o,symbols:[...u].sort()}))}}function T(e,n){let t=new Map,i=n.flatMap(s=>s.changedSymbols);for(let s of n)for(let a of s.consumerEntries){let l=t.get(a.file);l||(l=new Set,t.set(a.file,l));for(let m of a.symbols)l.add(m)}let r=X(t);return{changedFiles:[...e],changedSymbols:i,affectedConsumers:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:i.length,totalAffectedFiles:r.length}}}function A(e,n=[]){return{changedFiles:n,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:n.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function O(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function $(e,n){let t=d("git",["diff","--name-only",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--name-only","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4}),r=d("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([t,i,r].flatMap(s=>s.split(`
|
|
2
|
+
`)).map(s=>s.trim()).filter(s=>s.length>0))]}function k(e,n){let t=d("git",["diff","--unified=0",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--unified=0","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4});return _([...L(t),...L(i)])}function z(e,n,t){try{return d("git",["show",`${n}:./${t}`],{encoding:"utf-8",cwd:e,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function B(e,n,t){if(t.length===0)return[];let i=new Map,r=new Set;for(let a of U(e,n))t.includes(a.to)&&(i.set(a.to,a),r.add(a.from));let s=W(e,n);if(s.length===0)return[...i.values()].sort((a,l)=>a.to.localeCompare(l.to));for(let a of t){if(i.has(a)||!x(`${e}/${a}`))continue;let l=s.filter(c=>!r.has(c)).filter(c=>C(c)===C(a));if(l.length===0)continue;let m=N(`${e}/${a}`,"utf-8"),f=l.map(c=>({from:c,to:a,similarity:H(z(e,n,c)??"",m)})).sort((c,g)=>g.similarity-c.similarity)[0];f&&f.similarity>=.45&&(i.set(a,f),r.add(f.from))}return[...i.values()].sort((a,l)=>a.to.localeCompare(l.to))}function W(e,n){let t=d("git",["diff","--name-only","--diff-filter=D",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--name-only","--diff-filter=D","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([...R(t),...R(i)])]}function U(e,n){let t=d("git",["diff","--name-status","--find-renames",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--name-status","--find-renames","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4});return[...t.split(`
|
|
3
3
|
`),...i.split(`
|
|
4
4
|
`)].map(r=>r.trim()).filter(r=>r.startsWith("R")).map(r=>r.split(" ")).filter(r=>r.length>=3).map(([r,s,a])=>({from:s,to:a,similarity:Number(r.slice(1))/100}))}function H(e,n){let t=new Set(I(e)),i=new Set(I(n));if(t.size===0&&i.size===0)return 1;if(t.size===0||i.size===0)return 0;let r=0;for(let s of t)i.has(s)&&(r+=1);return 2*r/(t.size+i.size)}function I(e){return e.match(/[A-Za-z_$][\w$]*|[{}()[\].,]/g)??[]}function R(e){return e.split(`
|
|
5
5
|
`).map(n=>n.trim()).filter(n=>n.length>0)}function J(e,n){let t=F(e),i=[];for(let r of n){let s=t(r);s&&!e.isIgnored(s)&&i.push(s)}return i}function G(e,n){let t=F(e),i=[];for(let r of n){let s=t(r.file);s&&!e.isIgnored(s)&&i.push({...r,file:s})}return _(i)}function F(e){let n=e.all(`SELECT relative_path FROM documents
|
|
6
6
|
ORDER BY id`).map(i=>i.relative_path),t=new Map(n.map(i=>[i,i]));return i=>{let r=i.replace(/\\/g,"/"),s=t.get(r);return s||(n.find(a=>a.endsWith(r))??null)}}function L(e){let n=[],t=null;for(let i of e.split(`
|
|
7
|
-
`)){if(i.startsWith("+++ ")){t=Y(i.slice(4).trim());continue}if(!t||!i.startsWith("@@ "))continue;let r=/@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/.exec(i);if(!r)continue;let s=Math.max(0,Number(r[1])-1),a=r[2]===void 0?1:Number(r[2]);n.push({file:t,startLine:s,endLine:Math.max(s,s+Math.max(a,1)-1)})}return n}function Y(e){return e==="/dev/null"?null:e.startsWith("a/")||e.startsWith("b/")?e.slice(2):e}function _(e){let n=new Set,t=[];for(let i of e){let r=`${i.file}:${i.startLine}:${i.endLine}`;n.has(r)||(n.add(r),t.push(i))}return t}function q(e){let n=new Map;for(let t of e){let i=n.get(t.file);i||(i=[],n.set(t.file,i)),i.push(t)}return n}function V(e,n){let t=n.get(e.relativePath);return!t||t.length===0?!0:t.some(i=>Z(e.startLine,e.endLine,i.startLine,i.endLine))}function Z(e,n,t,i){return e<=i&&t<=n}function j(e,n,t,i,r,s,a,
|
|
7
|
+
`)){if(i.startsWith("+++ ")){t=Y(i.slice(4).trim());continue}if(!t||!i.startsWith("@@ "))continue;let r=/@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/.exec(i);if(!r)continue;let s=Math.max(0,Number(r[1])-1),a=r[2]===void 0?1:Number(r[2]);n.push({file:t,startLine:s,endLine:Math.max(s,s+Math.max(a,1)-1)})}return n}function Y(e){return e==="/dev/null"?null:e.startsWith("a/")||e.startsWith("b/")?e.slice(2):e}function _(e){let n=new Set,t=[];for(let i of e){let r=`${i.file}:${i.startLine}:${i.endLine}`;n.has(r)||(n.add(r),t.push(i))}return t}function q(e){let n=new Map;for(let t of e){let i=n.get(t.file);i||(i=[],n.set(t.file,i)),i.push(t)}return n}function V(e,n){let t=n.get(e.relativePath);return!t||t.length===0?!0:t.some(i=>Z(e.startLine,e.endLine,i.startLine,i.endLine))}function Z(e,n,t,i){return e<=i&&t<=n}function j(e,n,t,i,r,s,a,l){let m=Math.max(a,s.size);if(!ne(n,m))return;let f=p(n.symbol);i.push({symbol:n.symbol,shortName:f,file:n.relativePath,startLine:n.startLine,endLine:n.endLine,fanIn:m});for(let c of l)D(e,t,r,c,f);for(let c of s)D(e,t,r,c,f)}function K(e,n){if(n.length===0)return new Map;let t=e.all(`SELECT m.symbol_id, COUNT(DISTINCT c.document_id) AS fan_in
|
|
8
8
|
FROM mentions m
|
|
9
9
|
JOIN chunks c ON m.chunk_id = c.id
|
|
10
10
|
WHERE m.symbol_id IN (${n.map(()=>"?").join(",")})
|
|
@@ -17,4 +17,4 @@ import{a as S}from"./chunk-W3PQRAI4.js";import{e as b}from"./chunk-QH5GTVVB.js";
|
|
|
17
17
|
AND m.role != 1
|
|
18
18
|
AND ref_d.relative_path NOT IN (${t.map(()=>"?").join(",")})
|
|
19
19
|
${e.pathExclusionsFor("ref_d")}`,...n,...t),r=new Map;for(let s of i){let a=r.get(s.symbol_id);a||(a=new Set,r.set(s.symbol_id,a)),a.add(s.relative_path)}return r}function D(e,n,t,i,r){if(e.isIgnored(i)||n.has(i))return;let s=t.get(i);s||(s=new Set,t.set(i,s)),s.add(r)}function X(e){return[...e.entries()].map(([n,t])=>({file:n,consumedSymbols:t.size})).sort((n,t)=>t.consumedSymbols-n.consumedSymbols)}function ee(e){return!(y(e.symbol)||e.parentTypeName!==null&&!h(e.symbol))}function ne(e,n){return h(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&n>0}export{v as a,le as b,P as c,E as d,T as e,z as f};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-NP5HYVLX.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-3ZYF3ELZ.js";import{a as i}from"./chunk-MZ7APUFN.js";import{c as s,e as o,k as m}from"./chunk-JM72FNGA.js";function L(t,l){let r=i(t,l);return r?new a(t).definitionsForFile(r.relativePath).filter(e=>e.symbol!==r.symbol).filter(e=>m(r.symbol,e.symbol)).sort((e,n)=>e.startLine-n.startLine||e.endLine-n.endLine).map(e=>({symbol:e.symbol,shortName:s(e.symbol),startLine:e.startLine,endLine:e.endLine,kind:o(e.symbol)??"unknown"})):[]}export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NVFERV4U.js.map
|
|
@@ -2,4 +2,4 @@ import{execFileSync as p}from"child_process";import{platform as u}from"os";var g
|
|
|
2
2
|
`),console.log("Or download manually:")):console.log("Download from:"),console.log(e?` ${e.url}
|
|
3
3
|
`:` https://github.com/sourcegraph/scip/releases/tag/${a}
|
|
4
4
|
`),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function $(e){if(l()==="darwin"&&n("brew")){e("Installing scip CLI via Homebrew...");try{if(t("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`Homebrew install failed: ${i}`)}}if(n("go")){e("Installing scip CLI via go install...");try{if(t("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via go install"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`go install failed: ${i}`)}}return e("Could not auto-install scip CLI."),e("Install manually from: https://github.com/sourcegraph/scip/releases"),!1}export{n as a,x as b,C as c,S as d,$ as e};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-NXIAHE7F.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as l}from"./chunk-ERHOS6AW.js";function v(e,t={}){let{minTotalLines:n=800,minTemplateLines:i=300,minScriptLines:a=300,minStyleLines:r=500,limit:o=20,scope:m,scanLimit:p,filePattern:u}=t;return l(e,{scope:m,scanLimit:p}).filter(s=>!u||s.file.includes(u)).map(s=>L(s,{minTotalLines:n,minTemplateLines:i,minScriptLines:a,minStyleLines:r})).filter(s=>s!==null).sort((s,c)=>c.totalLines-s.totalLines||s.file.localeCompare(c.file)).slice(0,o)}function L(e,t){let n=[];if(e.totalLines>=t.minTotalLines&&n.push(`${e.totalLines} total component line(s)`),e.templateLines>=t.minTemplateLines&&n.push(`${e.templateLines} template line(s)`),e.scriptLines>=t.minScriptLines&&n.push(`${e.scriptLines} script line(s)`),e.styleLines>=t.minStyleLines&&n.push(`${e.styleLines} style line(s)`),n.length===0)return null;let i=b(e),a=g(e,t,i),r=x(e.file),o=V(i,r);return{file:e.file,totalLines:e.totalLines,sfcLines:e.sfcLines,templateLines:e.templateLines,scriptLines:e.scriptLines,styleLines:e.styleLines,externalScriptLines:e.externalScriptLines,externalScriptPaths:e.externalScriptPaths,customBlockLines:e.customBlockLines,dominantPressure:i,pressureKinds:a,contextKind:r,recommendationKind:o,recommendation:d(o,r),reasons:n,loc:e.totalLines}}function b(e){let t=[{axis:"template",lines:e.templateLines},{axis:"script",lines:e.scriptLines-e.externalScriptLines},{axis:"style",lines:e.styleLines},{axis:"external-script",lines:e.externalScriptLines},{axis:"custom-block",lines:e.customBlockLines}];return t.sort((n,i)=>i.lines-n.lines),t[0]?.lines?t[0].axis:"total"}function g(e,t,n){let i=[];return e.totalLines>=t.minTotalLines&&(i.push("total"),n!=="total"&&i.push(n)),e.templateLines>=t.minTemplateLines&&i.push("template"),e.scriptLines>=t.minScriptLines&&i.push("script"),e.styleLines>=t.minStyleLines&&i.push("style"),(e.externalScriptLines>=t.minScriptLines||n==="external-script")&&i.push("external-script"),e.customBlockLines>0&&n==="custom-block"&&i.push("custom-block"),[...new Set(i.length>0?i:[n])]}function x(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).some(i=>w.has(i))||/(?:view|page|route)\.vue$/i.test(e)||/(?:^|\/)(views|pages|routes)\//i.test(e)?"route-page":"component"}function V(e,t){return e==="style"?"style-decomposition":e==="template"?"template-decomposition":e==="external-script"?"external-script-boundary":e==="custom-block"?"custom-block-review":t==="route-page"?"route-page-decomposition":e==="script"?"script-behavior-extraction":"total-size-review"}function d(e,t){switch(e){case"template-decomposition":return t==="route-page"?"Split route template sections into named panels before extracting script behavior.":"Split repeated template sections into named presentational components.";case"script-behavior-extraction":return"Extract independent script behavior into composables, controllers, or feature modules.";case"style-decomposition":return"Review UI/style decomposition; move repeated styling to component or style primitives, not composables.";case"external-script-boundary":return"Review the external script boundary and split controller/composable modules by workflow.";case"custom-block-review":return"Review custom block ownership before splitting template or script code.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"total-size-review":return"Review the largest block first, then split by the dominant reason to change."}}var w=new Set(["landing","page","pages","route","routes","view","views"]);export{v as a};
|
|
2
|
+
//# sourceMappingURL=chunk-O3OKSF6O.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as V}from"./chunk-PVZMPG5I.js";import{a as v,b,c as R}from"./chunk-3UVJJ6Z7.js";import{c as B}from"./chunk-ERHOS6AW.js";function L(e,s={}){let{minSimilarity:i=.45,minSharedBehaviors:t=6,limit:n=20,scope:a,scanLimit:l,filePattern:c}=s,h=B(e,{scope:a,minBehaviorTokens:Math.max(3,t),scanLimit:l}).map(o=>({file:o.file,tokens:o.behaviorTokens,profile:o}));return V({profiles:h,limit:n,filePattern:c,compare:(o,r)=>w(o,r,i,t),sort:(o,r)=>r.similarity-o.similarity||o.fileA.localeCompare(r.fileA)||o.fileB.localeCompare(r.fileB)})}function w(e,s,i,t){let n=v(e.tokens,s.tokens);if(n.size<t||!q(n))return null;let a=P(e.tokens,s.tokens);if(a<i)return null;let l=d(n,"composable:"),c=d(n,"store:"),h=d(n,"reactivity:"),o=d(n,"lifecycle:"),r=d(n,"request:"),f=d(n,"function:"),g=d(n,"function-verb:"),p=d(n,"template-binding:"),C=d(n,"template-event:"),m=k({sharedComposables:l,sharedStores:c,sharedReactivity:h,sharedLifecycle:o,sharedRequests:r,sharedFunctions:f,sharedFunctionVerbs:g,sharedBindings:p,sharedTemplateEvents:C});return{fileA:e.file,fileB:s.file,similarity:a,sharedTokens:y(n),sharedComposables:l,sharedStores:c,sharedReactivity:h,sharedLifecycle:o,sharedRequests:r,sharedFunctions:f,sharedFunctionVerbs:g,sharedBindings:p,sharedTemplateEvents:C,evidenceClass:m.evidenceClass,actionTier:m.actionTier,evidenceClassReasons:m.reasons,recommendation:m.recommendation,uniqueToA:y(b(e.tokens,s.tokens)).slice(0,25),uniqueToB:y(b(s.tokens,e.tokens)).slice(0,25),reason:$({sharedComposables:l,sharedStores:c,sharedRequests:r,sharedLifecycle:o,sharedFunctions:f,sharedFunctionVerbs:g,sharedBindings:p}),locA:e.profile.totalLines,locB:s.profile.totalLines}}function k(e){let s=[],i=[],t=[];e.sharedReactivity.length&&i.push(`shared reactivity primitive: ${e.sharedReactivity.join(", ")}`),e.sharedLifecycle.length&&i.push(`shared lifecycle primitive: ${e.sharedLifecycle.join(", ")}`),u(e.sharedComposables,"shared composable",s,t),u(e.sharedStores,"shared store",s,t),u(e.sharedRequests,"shared request",s,i),u(e.sharedFunctions,"shared function",s,i),u(e.sharedFunctionVerbs,"shared action verb",s,i),u(e.sharedBindings,"shared binding",s,i),u(e.sharedTemplateEvents,"shared template event",s,i);let n=s.length>0,a=i.length>0,l=t.length>0,c=n?a||l?"mixed":"domain-behavior":l?"shared-abstraction":"generic-workflow-scaffolding";return{actionTier:c==="domain-behavior"||c==="mixed"?"signal":"support",evidenceClass:c,reasons:[...s,...t,...i].slice(0,6),recommendation:A(c)}}function u(e,s,i,t){let n=[],a=[];for(let l of e)S(l)?n.push(l):a.push(l);n.length&&i.push(`${s} has domain term(s): ${n.slice(0,6).join(", ")}`),a.length&&t.push(`${s} is generic workflow: ${a.slice(0,6).join(", ")}`)}function S(e){return T(e).filter(i=>!F.has(i)).length>0}function T(e){return e.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function A(e){switch(e){case"domain-behavior":return"Review for a shared composable, store, or feature module around the named domain behavior.";case"mixed":return"Separate generic Vue mechanics from domain-specific behavior before extracting a composable.";case"shared-abstraction":return"Review the existing composable/store usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct composable-extraction evidence."}}function P(e,s){if(e.size===0||s.size===0)return 0;let t=v(e,s).size/Math.min(e.size,s.size);return Math.max(R(e,s),t)}function q(e){let s=0,i=0,t=0,n=0,a=0,l=0,c=0;for(let r of e)r.startsWith("composable:")?s+=1:r.startsWith("store:")?i+=1:r.startsWith("request:")?t+=1:r.startsWith("lifecycle:")?n+=1:r.startsWith("function:")?a+=1:r.startsWith("reactivity:")?l+=1:(r.startsWith("function-verb:")||r.startsWith("template-binding:")||r.startsWith("template-event:"))&&(c+=1);let h=s+i,o=h+t+n+a+c;return t>=1&&o>=4||n>=1&&a>=2&&o>=4||h>=2&&(t>=1||a>=2)&&o>=5||a>=2&&l>=1&&o>=4}function $(e){let s=[];return e.sharedComposables.length&&s.push(`shared composables: ${e.sharedComposables.join(", ")}`),e.sharedStores.length&&s.push(`shared stores: ${e.sharedStores.join(", ")}`),e.sharedRequests.length&&s.push(`shared request helpers: ${e.sharedRequests.join(", ")}`),e.sharedLifecycle.length&&s.push(`shared lifecycle: ${e.sharedLifecycle.join(", ")}`),e.sharedFunctions.length&&s.push(`shared functions: ${e.sharedFunctions.slice(0,6).join(", ")}`),e.sharedFunctionVerbs.length&&s.push(`shared action verbs: ${e.sharedFunctionVerbs.slice(0,6).join(", ")}`),e.sharedBindings.length&&s.push(`shared template bindings: ${e.sharedBindings.slice(0,6).join(", ")}`),s.join("; ")||"shared Vue behavior profile"}function d(e,s){return[...e].filter(i=>i.startsWith(s)).map(i=>i.slice(s.length)).sort()}function y(e){return[...e].sort()}var F=new Set(["add","apply","cancel","change","clear","close","composable","create","data","delete","draft","edit","error","fetch","filter","form","item","items","load","loading","name","open","reactive","ref","refresh","remove","request","reset","resource","row","rows","save","saving","search","select","selected","store","submit","toggle","update","use","value","watch"]);export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-O4L4AB3T.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-64MNV6AB.js";import{c as l}from"./chunk-7S5E7KWT.js";import{readdirSync as g}from"fs";import{execFileSync as p}from"child_process";import{extname as d,join as m}from"path";var x=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],O=[".vue"],S=new Set(x.map(e=>e.toLowerCase())),y=[...S].sort().join(","),h=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function F(e,n={}){let s=n.includeIndexed??!0,r=n.includeAuxiliary??!0,t=n.extensions?.map(c=>c.toLowerCase()),o=t?new Set(t):S,u=t?[...o].sort().join(","):y,i=`${s?"1":"0"}|${r?"1":"0"}|${u}`;return E.get(e,i,()=>{let c=new Set;if(s)for(let a of f(e,{includeIgnored:!1}))o.has(d(a).toLowerCase())&&c.add(a);if(r)for(let a of _(e.config.projectRoot,o))e.isIgnored(a)||s&&c.has(a)||c.add(a);return[...c].sort()})}var E=l("source-files",{clearGroups:[]});function _(e,n){return I(e,n)??v(e,n)}function I(e,n){try{let s=p("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,stdio:["ignore","pipe","ignore"]}),r=new Set;for(let t of s.split(`
|
|
2
2
|
`)){let o=t.trim();o&&n.has(d(o).toLowerCase())&&r.add(o)}return r}catch{return null}}function v(e,n){let s=new Set,r=t=>{let o=t?m(e,t):e,u;try{u=g(o,{withFileTypes:!0})}catch{return}for(let i of u)if(!h.has(i.name)){if(i.isDirectory()){r(t?`${t}/${i.name}`:i.name);continue}n.has(d(i.name).toLowerCase())&&s.add(t?`${t}/${i.name}`:i.name)}};return r(""),s}export{O as a,h as b,F as c};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-OBBDKQAG.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{b as k}from"./chunk-C3MZZ2ZN.js";import{a as D}from"./chunk-3ZYF3ELZ.js";import{f as y,g as v}from"./chunk-ZQLO2SCU.js";import{n as S}from"./chunk-HVTYSC26.js";import{f as L}from"./chunk-3UW7VM4H.js";import{c as h}from"./chunk-JM72FNGA.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||y(e,l.relativePath)||v(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(y(e,t.relativePath)||v(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
|
|
2
|
+
FROM global_symbols gs
|
|
3
|
+
JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
4
|
+
JOIN documents d ON d.id = der.document_id
|
|
5
|
+
WHERE gs.symbol = ?
|
|
6
|
+
LIMIT 1`,n);return s?L(e,s.relative_path).find(c=>c.symbol===n)??null:null}function B(e,n,s){let c=S(e,n);if(c.length===0)return{removable:!1,blockingFiles:[]};let a=new Set;for(let f of c)f.file===n.relativePath&&f.line>=n.startLine&&f.line<=n.endLine||s.contains(f.file,f.line)||a.add(f.file);return{removable:a.size===0,blockingFiles:[...a]}}function C(e,n,s,c){let a=[...s].sort((i,o)=>i.file.localeCompare(o.file)||i.startLine-o.startLine),f=new Set(a.map(i=>i.file)),t=[];for(let i of f){let o=L(e,i);o.length>0&&o.every(m=>c.contains(i,m.startLine))&&t.push(i)}return{depth:n,entries:a.map(({definition:i,...o})=>o),loc:a.reduce((i,o)=>i+o.loc,0),filesEmptied:t.sort()}}var P=class{ranges=new Map;add(n){let s=this.ranges.get(n.file)??[];s.push({start:n.startLine,end:n.endLine}),this.ranges.set(n.file,s)}contains(n,s){let c=this.ranges.get(n);return c?c.some(a=>s>=a.start&&s<=a.end):!1}};export{z as a,P as b};
|
|
7
|
+
//# sourceMappingURL=chunk-OLD6PBU6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{b as d}from"./chunk-B75HZHUP.js";function u(e){let i=e.orderCandidates?[...e.candidates()].sort(e.orderCandidates):e.candidates(),a=d(i,e.scanLimit),r=e.prepare?.(a)??void 0,t=[];for(let s of a){let n=e.evaluate(s,r);n&&t.push(n)}return e.orderResults&&t.sort(e.orderResults),typeof e.limit=="number"?t.slice(0,e.limit):t}export{u as a};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-PFOCOG57.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
function f(e){let t=[];if(e.filePattern){let r=e.profiles.find(i=>i.file.includes(e.filePattern));if(!r)return[];for(let i of e.profiles){if(i.file===r.file)continue;let l=e.compare(r,i);l&&t.push(l)}}else{let r=typeof e.overrunFactor=="number"&&Number.isFinite(e.limit)?e.limit*e.overrunFactor:Number.POSITIVE_INFINITY;for(let i=0;i<e.profiles.length;i+=1){for(let l=i+1;l<e.profiles.length;l+=1){let n=e.compare(e.profiles[i],e.profiles[l]);n&&t.push(n)}if(t.length>r)break}}return t.sort(e.sort??((r,i)=>i.similarity-r.similarity)),t.slice(0,e.limit)}export{f as a};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-PVZMPG5I.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as C}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as C}from"./chunk-ERHOS6AW.js";import{a as m,b as d,c as L,d as g}from"./chunk-EWC3UK4V.js";import{a as h,i as A,j as S}from"./chunk-D322LMSA.js";import{b as x,c as _,d as N}from"./chunk-A4L36SZS.js";import{f as b}from"./chunk-7S5E7KWT.js";var k=new Set(["identifier","type_identifier","field_identifier"]),v=new Set(["identifier"]),B=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),V=new Set(["rust","python"]),j=/\{([^{}]*)\}/g,O=/\b([A-Za-z_][\w]*)\b/g;function F(e,t){return P(t).has(e.type)}function R(e,t){return V.has(t)&&e.type==="string_content"}function y(e){let t=0;for(let n of e.values()){let c=n[n.length-1];c!==void 0&&c>t&&(t=c)}let r=new Array(t+1);for(let n=0;n<=t;n+=1)r[n]=new Set;for(let[n,c]of e)for(let u of c)r[u].add(n);return r}function P(e){return e==="rust"?k:e==="python"?v:B}function w(e,t){let r=e.startPosition.row;for(let n of e.text.matchAll(j)){let c=n[1]??"";for(let u of c.matchAll(O))u[1]&&t(u[1],r)}}var H=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],z=/^#!?\[\s*serde\s*\(/,U=/^#!?\[\s*schemars\s*\(/,G=/^#!?\[\s*validate\s*\(/,K=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function T(e,t,r){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let c=S(n);if(!c||!K.has(c))return;let u=e.namedChildren.find(i=>i.type==="arguments");if(!u)return;let a=u.namedChild(0);if(!a||a.type!=="string")return;let o=a.namedChildren.find(i=>i.type==="string_fragment");o&&r.add(o.text)}function D(e,t){let r=z.test(e),n=U.test(e),c=G.test(e);if(!(!r&&!n&&!c))for(let u of H){u.lastIndex=0;let a;for(;(a=u.exec(e))!==null;){let o=a[1],i=o.split("::").pop()??o;i==="is_none"&&/\bOption\b/.test(o)||i==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(o)||i&&t.add(i)}}}function E(e,t){let r=new Map,n=(a,o)=>{if(a===o)return;let i=r.get(a);i||(i=new Set,r.set(a,i)),i.add(o)},c=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),u=(a,o)=>{let i=s=>{c.has(s.type)&&s.text!==o&&n(s.text,o);for(let l of s.children)i(l)};for(let s of a.children)i(s)};if(t==="rust")for(let a of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let o=a.namedChildren.find(s=>s.type==="type_identifier")?.text;if(!o)continue;let i=a.namedChildren.find(s=>s.type==="field_declaration_list"||s.type==="enum_variant_list"||s.type==="ordered_field_declaration_list");i&&u(i,o),a.type==="type_item"&&u(a,o)}else if(t==="python")for(let a of e.rootNode.descendantsOfType("class_definition")){let o=a.namedChildren.find(s=>s.type==="identifier")?.text;if(!o)continue;let i=a.namedChildren.find(s=>s.type==="block");if(i)for(let s of i.descendantsOfType("type"))for(let l of s.descendantsOfType("identifier"))l.text!==o&&n(l.text,o)}else for(let a of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let o=a.namedChildren.find(i=>i.type==="type_identifier")?.text;o&&u(a,o)}return r}var Y=b("source-facts",{clearGroups:["whole-project","source-file"]});function f(e,t){let r=h(e,t);if(!r)return null;let n=J(t,r);return n?Y.get(e,t,r,()=>Q(e,t,n,r)):null}function J(e,t){return d(e)?L(t)?.language??null:m(e)}function Q(e,t,r,n){let c=x(e,t,n),u=_(e,"source-facts",t,c);if(u){let i=q(u);if(i&&i.language===r)return i}let a=g(e,t);if(!a)return null;let o=$(a,r);return N(e,"source-facts",t,c,Z(o)),o}function Z(e){let t={language:e.language,callables:e.callables,callSites:e.callSites,typeContainerMap:[...e.typeContainerMap.entries()].map(([r,n])=>[r,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(t)}function q(e){try{let t=JSON.parse(e),r=new Map(t.identifierLineMap);return{language:t.language,callables:t.callables,callSites:t.callSites,typeContainerMap:new Map(t.typeContainerMap.map(([n,c])=>[n,new Set(c)])),identifierLineMap:r,identifiersByLine:y(r),fileIdentifiers:new Set(r.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function W(e,t,r,n){let c=f(e,t);return c?X(c,r,n)?.isLiteralPassthrough??!0:!0}function X(e,t,r){return e.callables.find(n=>n.startLine===t&&n.endLine===r)??null}function $(e,t){let r=[],n=[],c=new Set,u=new Set,a=new Map,o=(s,l)=>{let p=a.get(s);if(!p){a.set(s,[l]);return}p[p.length-1]!==l&&p.push(l)},i=s=>{let l=C(s,t);l&&r.push(l);let p=A(s,t);p&&n.push(p),T(s,t,u),t==="rust"&&(s.type==="attribute_item"||s.type==="inner_attribute_item")&&D(s.text,c),F(s,t)&&o(s.text,s.startPosition.row),R(s,t)&&w(s,o);for(let M of s.children)i(M)};return i(e.rootNode),{language:t,callables:r,callSites:n,typeContainerMap:E(e,t),identifierLineMap:a,identifiersByLine:y(a),fileIdentifiers:new Set(a.keys()),rustAttrReferencedNames:c,crossLanguageDispatchNames:u}}var I=new Set(["rust","typescript","tsx","javascript","python"]);function ee(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function te(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callSites}function re(e,t){return f(e,t)?.typeContainerMap??new Map}function ne(e,t,r={}){let n=f(e,t);if(!n)return[];let c=[];if(r.includeCrossLanguageDispatchNames)for(let u of n.crossLanguageDispatchNames)c.push({name:u,kind:"cross-language-dispatch",occurrences:1});if(r.includeRustAttributeNames&&n.language==="rust")for(let u of n.rustAttrReferencedNames)c.push({name:u,kind:"rust-attribute",occurrences:1});return c}export{f as a,W as b,ee as c,te as d,re as e,ne as f};
|
|
2
|
+
//# sourceMappingURL=chunk-QLNGUWR7.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e as l}from"./chunk-EWC3UK4V.js";function S(e,n={}){let{minComponentLines:o=300,minFileLines:t=800,minJsxTokens:r=80,minBehaviorTokens:a=40,limit:m=20,scope:c,scanLimit:p,filePattern:i}=n;return l(e,{scope:c,scanLimit:p}).filter(s=>s.kind==="component").filter(s=>!i||s.file.includes(i)||s.name.includes(i)).map(s=>g(s,{minComponentLines:o,minFileLines:t,minJsxTokens:r,minBehaviorTokens:a})).filter(s=>s!==null).sort((s,u)=>u.componentLines-s.componentLines||u.fileLines-s.fileLines||s.file.localeCompare(u.file)).slice(0,m)}function g(e,n){let o=[];e.loc>=n.minComponentLines&&o.push(`${e.loc} component line(s)`);let t=Math.max(80,Math.floor(n.minComponentLines/2));if(e.fileLines>=n.minFileLines&&e.loc>=t&&o.push(`${e.fileLines} file line(s)`),e.jsxTokens.size>=n.minJsxTokens&&o.push(`${e.jsxTokens.size} JSX structure token(s)`),e.behaviorTokens.size>=n.minBehaviorTokens&&o.push(`${e.behaviorTokens.size} behavior token(s)`),o.length===0)return null;let r=x(e),a=C(e,n,r),m=f(e),c=b(r,a,m);return{file:e.file,component:e.name,componentLines:e.loc,fileLines:e.fileLines,jsxTokens:e.jsxTokens.size,behaviorTokens:e.behaviorTokens.size,dominantPressure:r,pressureKinds:a,contextKind:m,recommendationKind:c,recommendation:R(c,m),reasons:o,loc:e.loc}}function x(e){let n=[{axis:"component",value:e.loc},{axis:"file",value:e.fileLines},{axis:"jsx-structure",value:e.jsxTokens.size*3},{axis:"hook-behavior",value:e.behaviorTokens.size*4}];return n.sort((o,t)=>t.value-o.value),n[0]?.axis??"component"}function C(e,n,o){let t=[];e.loc>=n.minComponentLines&&t.push("component");let r=Math.max(80,Math.floor(n.minComponentLines/2));return e.fileLines>=n.minFileLines&&e.loc>=r&&t.push("file"),e.jsxTokens.size>=n.minJsxTokens&&t.push("jsx-structure"),e.behaviorTokens.size>=n.minBehaviorTokens&&t.push("hook-behavior"),[...new Set(t.length>0?t:[o])]}function f(e){let n=e.file.split(/[\\/]+/).filter(Boolean),o=n.slice(0,-1).map(i=>i.toLowerCase()),t=(n.at(-1)??e.name).replace(/\.[^.]+$/,""),r=`${t} ${e.name}`.split(/[^A-Za-z0-9]+/).filter(Boolean).map(i=>i.toLowerCase()),a=o.findIndex(i=>v.has(i)),m=a>=0&&o.slice(a+1).some(i=>h.has(i)),c=d(t)||d(e.name);return/(?:Page|Route|Screen|View)$/.test(t)||/(?:Page|Route|Screen|View)$/.test(e.name)||r.some(i=>k.has(i))||a>=0&&!m&&!c?"route-page":"component"}function d(e){let n=e.split(/[^A-Za-z0-9]+/).filter(Boolean).map(o=>o.toLowerCase());return n.at(-1)&&L.has(n.at(-1))?!0:[...L].some(o=>e.endsWith(T(o)))}function b(e,n,o){return e==="hook-behavior"?"behavior-extraction":o==="route-page"?"route-page-decomposition":n.includes("hook-behavior")?"behavior-extraction":n.includes("jsx-structure")?"jsx-decomposition":n.includes("file")?"file-decomposition":e==="jsx-structure"?"jsx-decomposition":e==="file"&&!n.includes("component")?"file-decomposition":"component-decomposition"}function R(e,n){switch(e){case"behavior-extraction":return"Extract independent state, effects, requests, or handlers into hooks, controllers, or feature modules.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"jsx-decomposition":return n==="route-page"?"Split page JSX into named layout sections before extracting behavior.":"Split repeated JSX sections into named presentational components.";case"file-decomposition":return"Review file-level decomposition; split colocated panels or helpers before changing behavior.";case"component-decomposition":return"Review component boundaries around props, state ownership, and independently changing UI sections."}}var h=new Set(["component","components","panel","panels","partial","partials"]),L=new Set(["banner","button","card","dialog","drawer","filter","form","grid","header","item","list","menu","modal","nav","panel","picker","rail","row","section","selector","shell","sidebar","table","toolbar"]),v=new Set(["landing","page","pages","route","routes","screen","screens","view","views"]),k=new Set(["landing","page","route","screen","view"]);function T(e){return e.charAt(0).toUpperCase()+e.slice(1)}export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-QSXQT3NE.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c}from"./chunk-AUVBR62P.js";function j(e,s={}){let{minSimilarity:t=.5,limit:n=15,scope:i,minChainLength:r=3,maxChainLength:l=8}=s,a=c(e,i),o=y(a,r,l);if(o.length===0)return[];let f=d(o);return f.length<2?[]:S(x(f,t,n),n)}function d(e){let s=m(e),t=[];for(let n of e){let i=n.filter(r=>!s.has(r));i.length>=2&&t.push({original:n,filtered:i})}return t}function m(e){let{nodeFreq:s,tailFreq:t}=p(e),n=e.length*.9,i=e.length*.8,r=new Set;for(let[a,o]of s)o>n&&r.add(a);for(let[a,o]of t)o>i&&r.add(a);let l=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let a of s.keys()){let o=a.split("/").pop()??"";l.includes(o)&&r.add(a)}return r}function p(e){let s=new Map,t=new Map;for(let n of e){let i=new Set;for(let r of n)i.has(r)||(s.set(r,(s.get(r)??0)+1),i.add(r));for(let r=Math.max(0,n.length-2);r<n.length;r++)t.set(n[r],(t.get(n[r])??0)+1)}return{nodeFreq:s,tailFreq:t}}function x(e,s,t){let n=[];for(let i=0;i<e.length;i++){for(let r=i+1;r<e.length;r++){let l=b(e[i],e[r],s);l&&n.push(l)}if(n.length>t*10)break}return n.sort((i,r)=>Math.abs(r.similarity-i.similarity)>.01?r.similarity-i.similarity:i.divergencePoints.length-r.divergencePoints.length),n}function b(e,s,t){if(!C(e.filtered,s.filtered))return null;let{distance:n,ops:i}=A(e.filtered,s.filtered),r=Math.max(e.filtered.length,s.filtered.length);if(r===0)return null;let l=1-n/r;if(l<t||n===0)return null;let a=i.filter(f=>f.type==="substitute").map(f=>({index:f.indexA,nodeA:e.filtered[f.indexA],nodeB:s.filtered[f.indexB]}));return a.length===0||i.filter(f=>f.type==="match").length<2?null:{chainA:e.original,chainB:s.original,similarity:l,editDistance:n,divergencePoints:a,commonPrefix:F(e.original,s.original),commonSuffix:B(e.original,s.original)}}function C(e,s){let t=new Set(e);return s.some(n=>t.has(n))}function S(e,s){let t=[];for(let n of e)if(t.some(r=>h(n.chainA,r.chainA)&&h(n.chainB,r.chainB))||t.push(n),t.length>=s)break;return t}function y(e,s,t){let n=[];for(let r of e.keys()){if(n.length>=500)break;g(e,r,[r],new Set([r]),s,t,n,500)}return n}function g(e,s,t,n,i,r,l,a){if(l.length>=a)return;if(t.length>=r){t.length>=i&&l.push([...t]);return}let o=e.get(s);if(!o||o.size===0){t.length>=i&&l.push([...t]);return}let f=!1;for(let u of o)if(!n.has(u)&&(n.add(u),t.push(u),g(e,u,t,n,i,r,l,a),t.pop(),n.delete(u),f=!0,l.length>=a))return;!f&&t.length>=i&&l.push([...t])}function A(e,s){let t=e.length,n=s.length,i=Array.from({length:t+1},()=>Array(n+1).fill(0));for(let o=0;o<=t;o++)i[o][0]=o;for(let o=0;o<=n;o++)i[0][o]=o;for(let o=1;o<=t;o++)for(let f=1;f<=n;f++)e[o-1]===s[f-1]?i[o][f]=i[o-1][f-1]:i[o][f]=1+Math.min(i[o-1][f],i[o][f-1],i[o-1][f-1]);let r=[],l=t,a=n;for(;l>0||a>0;)l>0&&a>0&&e[l-1]===s[a-1]?(r.unshift({type:"match",indexA:l-1,indexB:a-1}),l--,a--):l>0&&a>0&&i[l][a]===i[l-1][a-1]+1?(r.unshift({type:"substitute",indexA:l-1,indexB:a-1}),l--,a--):a>0&&i[l][a]===i[l][a-1]+1?(r.unshift({type:"insert",indexA:l,indexB:a-1}),a--):(r.unshift({type:"delete",indexA:l-1,indexB:a}),l--);return{distance:i[t][n],ops:r}}function F(e,s){let t=[];for(let n=0;n<Math.min(e.length,s.length)&&e[n]===s[n];n++)t.push(e[n]);return t}function B(e,s){let t=[],n=e.length-1,i=s.length-1;for(;n>=0&&i>=0&&e[n]===s[i];)t.unshift(e[n]),n--,i--;return t}function h(e,s){if(e.length>s.length)return!1;let t=s.join("\u2192"),n=e.join("\u2192");return t.includes(n)}export{j as a};
|
|
2
|
+
//# sourceMappingURL=chunk-QVCCLDZI.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as y}from"./chunk-FOQHUKNZ.js";import{d as b}from"./chunk-JM72FNGA.js";import{a as d,d as g}from"./chunk-EWC3UK4V.js";import{b as u}from"./chunk-D322LMSA.js";import{c as m}from"./chunk-7S5E7KWT.js";var x=m("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]});function E(n,e,r){return n.callerFileMap(e,{semantic:r.semantic,sourceFallback:r.sourceFallback})}function I(n,e,r){let i=[],t=0,s=0,p=b(e.symbol);for(let a of r)v(n,a,e.relativePath,p)?t++:S(n,a,p)?s++:i.push(a);return{realConsumers:i,barrelConsumers:t,importOnlyConsumers:s}}function S(n,e,r){if(!r)return!1;let i=d(e);if(!i)return!1;let t=x.get(n,e,()=>C(n,e,i));return t.importedLeaves.has(r)&&!t.usedLeaves.has(r)}function C(n,e,r){let i=new Set,t=new Set,s=g(n,e);if(!s)return{importedLeaves:i,usedLeaves:t};let p=r==="rust"?new Set(["use_declaration"]):r==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),a=(o,c)=>{let l=c||p.has(o.type);(o.type==="identifier"||o.type==="type_identifier"||o.type==="property_identifier"||o.type==="field_identifier")&&(l?i.add(o.text):t.add(o.text));for(let f of o.children)a(f,l)};return a(s.rootNode,!1),{importedLeaves:i,usedLeaves:t}}function v(n,e,r,i){if(!i)return!1;let t=u(n,e);if(t.length===0)return!1;let s=y(n,e);if(s.length===0)return!1;let p=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${p}\\b`),o=0;for(let c=0;c<t.length;c++){if(!a.test(t[c]??""))continue;if(o++,!s.find(f=>f.startLine<=c&&c<=f.endLine))return!1}return o>0}export{E as a,I as b,S as c};
|
|
2
|
+
//# sourceMappingURL=chunk-RHTJBYZ5.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as L,b as M}from"./chunk-RHTJBYZ5.js";import{a as F}from"./chunk-VAA5FFIW.js";import{a as D}from"./chunk-PFOCOG57.js";import{a as x}from"./chunk-B75HZHUP.js";import{a as h}from"./chunk-3ZYF3ELZ.js";import{a as C}from"./chunk-BGBBVSH4.js";import{a as I}from"./chunk-HVTYSC26.js";import{k as b}from"./chunk-3UW7VM4H.js";import{c as f,d as p,j as g}from"./chunk-JM72FNGA.js";import{basename as u,extname as d}from"path";function K(r,n){let{scope:e,maxLoc:t=15,limit:a=30,scanLimit:o}=n??{},i=new h(r),l=E(i.fileDependencyGraph(e));return D({candidates:()=>v(i,e,t),orderCandidates:x,scanLimit:o,prepare:s=>({callerFileMap:L(i,s,{semantic:n?.semantic!==!1}),reverseFanIn:l}),evaluate:(s,c)=>S(r,i,s,c),orderResults:(s,c)=>c.callerFanIn-s.callerFanIn||c.loc-s.loc,limit:a})}function S(r,n,e,t){let a=y(r,n,e,t.callerFileMap);if(a.length!==1)return null;let o=a[0],i=P(r,e.symbolId,o);if(!i)return null;let l=w(n,r,o,e.symbol,i);if(l&&g(l.symbol))return null;let{fanIn:s,source:c}=_(t.callerFileMap,t.reverseFanIn,o,l);if(c==="function"?s<=3:s<=5)return null;let m=j(r,e,o,l);return{symbol:e.symbol,shortName:f(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:C(e),singleCaller:l?.symbol??"",singleCallerShort:l?.isFunctionLike?f(l.symbol):u(o),callerFanIn:s,actionTier:m.length>0?"signal":"direct",boundaryEvidence:m}}function v(r,n,e){return r.productionCallableDefinitions({scope:n,minLoc:2,maxLoc:e,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0})}function y(r,n,e,t){let a=u(e.relativePath,d(e.relativePath)),o=[...t.get(e.symbolId)??[]].filter(i=>i!==e.relativePath).filter(i=>u(i,d(i))!==a).filter(i=>{let l=n.fileKind(i);return l!=="barrel"&&l!=="entry"&&l!=="test"});return M(r,e,o).realConsumers}function P(r,n,e){return r.get(`SELECT c.start_line, c.end_line
|
|
2
|
+
FROM mentions m
|
|
3
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
+
JOIN documents d ON c.document_id = d.id
|
|
5
|
+
WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
|
|
6
|
+
LIMIT 1`,n,e)}function w(r,n,e,t,a){let o=r.definitionsForFile(e),i=k(n,e,t,a.start_line,a.end_line);return b(o,i)}function _(r,n,e,t){if(t?.isFunctionLike){let a=[...r.get(t.symbolId)??[]].filter(o=>o!==t.relativePath);if(a.length>0)return{fanIn:a.length,source:"function"}}return{fanIn:N(n,e),source:"file"}}function k(r,n,e,t,a){let o=p(e);if(!o)return t;let i=I(r,n).get(o);if(!i||i.length===0)return t;for(let l of i)if(l>=t&&l<=a)return l;return t}function E(r){let n=new Map;for(let[e,t]of r){n.has(e)||n.set(e,n.get(e)??0);for(let a of t)n.set(a,(n.get(a)??0)+1)}return n}function N(r,n){let e=r.get(n)??0;if(e>0)return e;let t=u(n,d(n)),a=0;for(let[o,i]of r)o!==n&&u(o,d(o))===t&&i>a&&(a=i);return a}function j(r,n,e,t){return F(r,n.relativePath,n.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:f(n.symbol)},{label:"caller name",value:t?.symbol?f(t.symbol):u(e)},{label:"wrapper path",value:n.relativePath},{label:"caller path",value:e}])}export{K as a};
|
|
7
|
+
//# sourceMappingURL=chunk-SPE4YCOT.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-CTCAF3YA.js";import{a as d}from"./chunk-3ZYF3ELZ.js";import{e as c}from"./chunk-FUPDW5AC.js";import{c as u}from"./chunk-JM72FNGA.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-QOFKVNFE.js";import{a as d}from"./chunk-W3PQRAI4.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-TM6GVHA6.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as y}from"./chunk-PVZMPG5I.js";import{a as k,b as p,c as H}from"./chunk-3UVJJ6Z7.js";import{e as v}from"./chunk-EWC3UK4V.js";function x(e,s={}){let{minSimilarity:r=.45,minSharedBehaviors:a=6,limit:t=20,scope:c,scanLimit:i,filePattern:l}=s,d=v(e,{scope:c,minBehaviorTokens:Math.max(3,a),scanLimit:i}).map(o=>({file:o.file,component:o.name,tokens:o.behaviorTokens,profile:o}));return y({profiles:d,limit:t,filePattern:l,compare:(o,n)=>b(o,n,r,a),sort:(o,n)=>n.similarity-o.similarity||o.fileA.localeCompare(n.fileA)||o.componentA.localeCompare(n.componentA)||o.fileB.localeCompare(n.fileB)||o.componentB.localeCompare(n.componentB)})}function b(e,s,r,a){let t=k(e.tokens,s.tokens);if(t.size<a||!T(t))return null;let c=S(e.tokens,s.tokens);if(c<r)return null;let i=h(t,"hook:"),l=h(t,"react-hook:"),d=h(t,"effect:"),o=h(t,"state:"),n=h(t,"request:"),u=h(t,"handler:"),g=h(t,"handler-verb:"),m=A({sharedHooks:i,sharedReactHooks:l,sharedEffects:d,sharedState:o,sharedRequests:n,sharedHandlers:u,sharedHandlerVerbs:g});return{fileA:e.file,componentA:e.component,fileB:s.file,componentB:s.component,similarity:c,sharedTokens:R(t),sharedHooks:i,sharedReactHooks:l,sharedEffects:d,sharedState:o,sharedRequests:n,sharedHandlers:u,sharedHandlerVerbs:g,evidenceClass:m.evidenceClass,actionTier:m.actionTier,evidenceClassReasons:m.reasons,recommendation:m.recommendation,uniqueToA:R(p(e.tokens,s.tokens)).slice(0,25),uniqueToB:R(p(s.tokens,e.tokens)).slice(0,25),reason:E({sharedHooks:i,sharedReactHooks:l,sharedEffects:d,sharedState:o,sharedRequests:n,sharedHandlers:u,sharedHandlerVerbs:g}),locA:e.profile.loc,locB:s.profile.loc}}function A(e){let s=[],r=[],a=[];e.sharedReactHooks.length&&r.push(`shared React primitives: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&r.push(`shared lifecycle primitive: ${e.sharedEffects.join(", ")}`),f(e.sharedHooks,"shared hook",s,a),f(e.sharedRequests,"shared request",s,r),f(e.sharedState,"shared state",s,r),f(e.sharedHandlers,"shared handler",s,r),f(e.sharedHandlerVerbs,"shared action verb",s,r);let t=s.length>0,c=r.length>0,i=a.length>0,l=t?c||i?"mixed":"domain-behavior":i?"shared-abstraction":"generic-workflow-scaffolding",d=l==="domain-behavior"||l==="mixed"?"signal":"support",o=[...s,...a,...r].slice(0,6);return{actionTier:d,evidenceClass:l,reasons:o,recommendation:w(l)}}function f(e,s,r,a){let t=[],c=[];for(let i of e)B(i)?t.push(i):c.push(i);t.length&&r.push(`${s} has domain term(s): ${t.slice(0,6).join(", ")}`),c.length&&a.push(`${s} is generic workflow: ${c.slice(0,6).join(", ")}`)}function B(e){return C(e).filter(r=>!P.has(r)).length>0}function C(e){return e.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/^use(?=[A-Z])/,"").replace(/^handle(?=[A-Z])/,"").replace(/^is(?=[A-Z])/,"").replace(/^has(?=[A-Z])/,"").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function w(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct hook-extraction evidence."}}function S(e,s){if(e.size===0||s.size===0)return 0;let a=k(e,s).size/Math.min(e.size,s.size);return Math.max(H(e,s),a)}function T(e){let s=0,r=0,a=0,t=0,c=0,i=0,l=0;for(let n of e)n.startsWith("hook:")?s+=1:n.startsWith("react-hook:")?r+=1:n.startsWith("effect:")?a+=1:n.startsWith("request:")?t+=1:n.startsWith("handler:")||n.startsWith("handler-verb:")?c+=1:n.startsWith("state:")?i+=1:n.startsWith("state-hook:")&&(l+=1);let d=i+l,o=s+r+a+t+c+d;return t>=1&&o>=4||s>=1&&(t>=1||i>=1||c>=2)&&o>=5||i>=1&&c>=2&&(a>=1||r>=2)&&o>=5}function E(e){let s=[];return e.sharedHooks.length&&s.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&s.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&s.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&s.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&s.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&s.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&s.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),s.join("; ")||"shared React behavior profile"}function h(e,s){return[...e].filter(r=>r.startsWith(s)).map(r=>r.slice(s.length)).sort()}function R(e){return[...e].sort()}var P=new Set(["add","apply","async","callback","cancel","change","clear","close","create","data","delete","draft","edit","effect","error","fetch","filter","form","handle","has","is","item","items","load","loader","loading","memo","name","open","reducer","refresh","ref","remove","request","reset","resource","row","rows","save","saving","search","select","selected","state","store","submit","toggle","update","use","value"]);export{x as a};
|
|
2
|
+
//# sourceMappingURL=chunk-TO54DY4O.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-PVZMPG5I.js";import{a as p,b as l,c as f}from"./chunk-3UVJJ6Z7.js";import{e as m}from"./chunk-EWC3UK4V.js";function v(n,t={}){let{minSimilarity:o=.62,minTokens:e=8,limit:a=20,scope:g,scanLimit:d,filePattern:h}=t,k=m(n,{scope:g,minJsxTokens:e,scanLimit:d}).filter(i=>i.kind==="component").map(i=>({file:i.file,component:i.name,tokens:i.jsxTokens,profile:i}));return u({profiles:k,limit:a,filePattern:h,compare:(i,r)=>P(i,r,o),sort:(i,r)=>r.similarity-i.similarity||i.fileA.localeCompare(r.fileA)||i.componentA.localeCompare(r.componentA)||i.fileB.localeCompare(r.fileB)||i.componentB.localeCompare(r.componentB)})}function P(n,t,o){let e=p(n.tokens,t.tokens);if(e.size<6||!B(e))return null;let a=f(n.tokens,t.tokens);return a<o?null:{fileA:n.file,componentA:n.component,fileB:t.file,componentB:t.component,similarity:a,sharedTokens:c(e),sharedComponents:s(e,"component:"),sharedNativeTags:s(e,"native:"),sharedProps:s(e,"prop:"),sharedEvents:s(e,"event:"),sharedBindings:s(e,"binding:"),uniqueToA:c(l(n.tokens,t.tokens)).slice(0,25),uniqueToB:c(l(t.tokens,n.tokens)).slice(0,25),locA:n.profile.loc,locB:t.profile.loc}}function B(n){let t=0,o=0;for(let e of n)e.startsWith("component:")&&(t+=1),(e.startsWith("prop:")||e.startsWith("event:")||e.startsWith("native:")||e.startsWith("jsx:"))&&(o+=1);return t>=1||o>=4}function s(n,t){return[...n].filter(o=>o.startsWith(t)).map(o=>o.slice(t.length)).sort()}function c(n){return[...n].sort()}export{v as a};
|
|
2
|
+
//# sourceMappingURL=chunk-UMNENNTX.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as T,b as x,e as N,f as _}from"./chunk-3UVJJ6Z7.js";import{b as z}from"./chunk-B75HZHUP.js";import{a as v}from"./chunk-3ZYF3ELZ.js";import{a as $}from"./chunk-YTR4CO5S.js";import{a as I}from"./chunk-MZ7APUFN.js";import{c as d,d as E,g as D}from"./chunk-JM72FNGA.js";import{b as B}from"./chunk-D322LMSA.js";import{d as F}from"./chunk-7S5E7KWT.js";function Ae(e,n,i={}){let{minSimilarity:t=.4,limit:r=20}=i,s=ie(e,n,{semantic:i.semantic!==!1});if(!s)return[];if(!D(s.symbol))return[];let o=J(e,s,t,{scanLimit:i.scanLimit,semantic:i.semantic!==!1});return o.length>0?o.slice(0,r):me(e,n,{minSimilarity:t,limit:r})}function J(e,n,i,t){let r=se(e,{minCallees:3,scanLimit:t.scanLimit,semantic:t.semantic}),s=ae(n,r),o=N([n,...r.corpus].map(l=>l.callees)),a=[];for(let l of s){if(l.callees.size<3)continue;let c=j(n,l,o,{minSimilarity:i,requireSignificantShared:1,requireSharedCount:0});c&&a.push(c)}return a.sort((l,c)=>c.similarity-l.similarity),a}function j(e,n,i,t){let{similarity:r,significantShared:s}=_(e.callees,n.callees,i);if(r<t.minSimilarity)return null;let o=T(e.callees,n.callees).size;if(s.length<t.requireSignificantShared&&o<t.requireSharedCount)return null;let a=s.length>0?s:[...T(e.callees,n.callees)],l=K(a,"callees");return{symbolA:e.symbol,shortNameA:d(e.symbol),fileA:e.file,symbolB:n.symbol,shortNameB:d(n.symbol),fileB:n.file,similarity:r,similarityBasis:"callees",sharedCallees:a.map(d),uniqueToA:[...x(e.callees,n.callees)].map(d),uniqueToB:[...x(n.callees,e.callees)].map(d),...l}}function qe(e,n={}){let{minSimilarity:i=.5,limit:t=20,scope:r,minCallees:s=4,crossFileOnly:o=!1,scanLimit:a}=n,l=G(e,{minCallees:s,scope:r,scanLimit:a,semantic:n.semantic!==!1}),c=N(l.map(m=>m.callees)),f=new Map;for(let m of l)for(let u of m.callees)f.set(u,(f.get(u)??0)+1);let w=Math.max(8,Math.ceil(Math.sqrt(l.length))),y=new Map;for(let m=0;m<l.length;m+=1)for(let u of l[m].callees){if((f.get(u)??0)>w)continue;let g=y.get(u);g||(g=[],y.set(u,g)),g.push(m)}let S=[],b=0,h=new Set;for(let m=0;m<l.length;m+=1){let u=l[m],g=new Set;for(let R of u.callees){let C=y.get(R);if(C)for(let p of C)p>m&&g.add(p)}for(let R of g){let C=`${m}|${R}`;if(h.has(C))continue;h.add(C);let p=l[R];if(o&&u.file===p.file)continue;if(u.paramCount>=0&&p.paramCount>=0){let Q=Math.abs(u.paramCount-p.paramCount),Y=Math.max(2,Math.ceil(Math.max(u.paramCount,p.paramCount)*.5));if(Q>Y)continue}let L=j(u,p,c,{minSimilarity:i,requireSignificantShared:2,requireSharedCount:4});L&&(ee(S,L,t,b),b+=1)}}return S.sort((m,u)=>u.result.similarity-m.result.similarity||m.order-u.order),S.map(m=>m.result)}function ee(e,n,i,t){if(i<=0)return;if(e.length<i){e.push({result:n,order:t});return}let r=0;for(let o=1;o<e.length;o+=1){let a=e[o],l=e[r];(a.result.similarity<l.result.similarity||a.result.similarity===l.result.similarity&&a.order>l.order)&&(r=o)}let s=e[r];n.similarity<=s.result.similarity||(e[r]={result:n,order:t})}var ne=["ScipDatabase#all","ScipDatabase#get","ScipDatabase#prepare","ScipDatabase#pathExclusionsFor","ScipDatabase#isIgnored","ScipDatabase#symbolNoiseFor","PerDbValue#get","PerDbValue#has",":storage:db:ScipDatabase:all",":storage:db:ScipDatabase:get",":storage:db:ScipDatabase:prepare",":storage:db:ScipDatabase:pathExclusionsFor",":storage:db:ScipDatabase:isIgnored",":storage:db:ScipDatabase:symbolNoiseFor",":storage:per-db-cache:PerDbValue:get",":storage:per-db-cache:PerDbValue:has"];function ie(e,n,i){let t=I(e,n),r=new v(e);if(!t)return null;let s=$(e,t,{semantic:i.semantic});return{symbol:t.symbol,file:t.relativePath,callees:U(s.map(o=>o.symbol)),paramCount:r.callableSignature(t)?.paramCount??-1}}var te=F("callee-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),re=F("callee-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function G(e,n){let{minCallees:i,scope:t,excludeSymbol:r,scanLimit:s}=n,o=n.semantic!==!1,a=te.get(e,()=>new Map),l=`${i}|${t??""}|${s??""}|${o}`,c=a.get(l);return c||(c=le(e,{minCallees:i,scope:t,scanLimit:s,semantic:o}),a.set(l,c)),r===void 0?c:c.filter(f=>f.symbol!==r)}function se(e,n){let{minCallees:i,scope:t,scanLimit:r}=n,s=n.semantic!==!1,o=re.get(e,()=>new Map),a=`${i}|${t??""}|${r??""}|${s}`,l=o.get(a);return l||(l=oe(G(e,{minCallees:i,scope:t,scanLimit:r,semantic:s})),o.set(a,l)),l}function oe(e){let n=new Map;for(let r of e)for(let s of r.callees)n.set(s,(n.get(s)??0)+1);let i=Math.max(8,Math.ceil(Math.sqrt(e.length))),t=new Map;for(let r of e)for(let s of r.callees){if((n.get(s)??0)>i)continue;let o=t.get(s);o||(o=[],t.set(s,o)),o.push(r)}return{corpus:e,candidateByCallee:t,docFreq:n,ubiquityThreshold:i}}function ae(e,n){let i=new Map;for(let t of e.callees)for(let r of n.candidateByCallee.get(t)??[])r.symbol!==e.symbol&&i.set(r.symbol,r);return i.size>0?[...i.values()]:n.corpus.filter(t=>t.symbol!==e.symbol)}function le(e,n){let{minCallees:i,scope:t,scanLimit:r,semantic:s}=n,o=new v(e),a=z(o.productionCallableDefinitions({scope:t,minLoc:5,sortByLocDesc:typeof r=="number"&&r>0}),r),l=o.calleeMap(a,{semantic:s});return a.map(c=>({symbol:c.symbol,file:c.relativePath,callees:U((l.get(c.symbolId)??[]).map(f=>f.symbol)),paramCount:o.callableSignature(c)?.paramCount??-1})).filter(c=>c.callees.size>=i)}function U(e){return new Set([...e].filter(n=>!ce(n)))}function ce(e){return ne.some(n=>e.includes(n))}function me(e,n,i){let t=pe(e,n);if(!t||t.tokens.size<3)return[];let r=i.minSimilarity>=.5?i.minSimilarity:.3,s=[],o=Fe(t,he(e));for(let a of o){if(a.symbol===t.symbol||a.tokens.size<3)continue;let l=T(t.tokens,a.tokens);if(l.size<2)continue;let c=new Set([...t.tokens,...a.tokens]),f=c.size>0?l.size/c.size:0;f<r||s.push({symbolA:t.symbol,shortNameA:d(t.symbol),fileA:t.file,symbolB:a.symbol,shortNameB:d(a.symbol),fileB:a.file,similarity:f,similarityBasis:"source-tokens",sharedCallees:[...l].sort(),uniqueToA:[...x(t.tokens,a.tokens)].sort(),uniqueToB:[...x(a.tokens,t.tokens)].sort(),...K([...l],"source-tokens")})}return s.sort((a,l)=>l.similarity-a.similarity||a.shortNameB.localeCompare(l.shortNameB)),s.slice(0,i.limit)}function K(e,n){let i=e.flatMap(A),t=e.flatMap(m=>O(m,n)),r=M(i,V),s=M(i,Z),o=M(t,q),a=[...new Set(t.filter(P))],l=e.filter(m=>{let u=O(m,n);return u.some(g=>q.has(g))&&u.some(P)}).length,c=[];r.length>0&&c.push(`access/query scaffolding: ${r.slice(0,5).join(", ")}`),s.length>0&&c.push(`framework/generic scaffolding: ${s.slice(0,5).join(", ")}`),o.length>0&&c.push(`domain behavior verbs: ${o.slice(0,5).join(", ")}`),o.length>0&&a.length>0&&c.push(`domain-specific terms: ${a.slice(0,5).join(", ")}`);let f=n==="source-tokens"&&i.length>0&&i.every(m=>H.has(m));f&&c.push("shared source tokens are generic scaffolding");let w=o.length>0&&a.length>0,y=r.length+s.length>0,S=n==="callees"&&w&&e.length>=4&&a.length>=4&&l>=2,b=S?"domain-behavior":w?y?"mixed":"domain-behavior":r.length>0?"access-query-scaffolding":s.length>0||f?"framework-scaffolding":"structural-overlap";b==="structural-overlap"&&e.length>0&&c.push(`shared ${n} overlap has no recognized domain or scaffolding category`);let h=b==="domain-behavior"&&(e.length>=3||S)?"direct":"signal";return{evidenceClass:b,actionTier:h,evidenceClassReasons:c,recommendation:ue(b,h)}}function ue(e,n){return n==="direct"?"Shared domain behavior looks concrete; review for an extract/reuse opportunity.":e==="mixed"?"Shared evidence mixes domain behavior with scaffolding; review semantics before extracting anything.":e==="access-query-scaffolding"?"Shared evidence is mostly access/query scaffolding; compare product semantics before reusing code.":e==="structural-overlap"?"Shared structure has no domain or scaffolding classification; inspect names and behavior before reusing code.":"Shared evidence is mostly framework or generic scaffolding; treat as a contextual signal."}function M(e,n){return[...new Set(e.filter(i=>n.has(i)))]}function A(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1)}function O(e,n){if(n==="source-tokens")return A(e);let i=E(e);return A(i.length>0?i:fe(e))}function fe(e){return e.replace(/[()`]/g," ").replace(/\.[a-z][a-z0-9]+(?=\s|$)/gi," ").split(/[:/\\\s]+/).map(t=>t.trim()).filter(t=>/[A-Za-z]/.test(t)).at(-1)?.replace(/\.$/,"")??e}function P(e){return e.length>3&&!q.has(e)&&!V.has(e)&&!Z.has(e)&&!H.has(e)&&!ge.has(e)}var q=new Set(["archive","assign","book","cancel","create","delete","ensure","export","import","notify","persist","publish","restore","schedule","send","set","submit","sync","update","upload","validate","write"]),V=new Set(["access","auth","authorize","cache","context","db","find","get","guard","list","permission","permissions","prisma","query","request","response","role","route","session","sql","where"]),Z=new Set(["bytes","computed","crypto","describe","effect","expect","fetch","filter","hex","hook","json","map","mounted","on","promise","random","react","reduce","ref","render","state","test","token","trim","uuid","vue","watch"]),H=new Set(["bytes","crypto","data","false","get","hex","id","key","map","name","num","random","result","secret","set","string","to","token","true","type","value"]),ge=new Set(["best","backend","conflict","database","effect","effects","error","errors","frontend","found","helpers","javascript","module","modules","scip","shared","source","typescript","utils","with","workflow","workflows"]);function pe(e,n){let i=I(e,n);if(!i||!D(i.symbol))return null;let t=de(e,i);return t?{symbol:i.symbol,file:i.relativePath,tokens:t}:null}function de(e,n){let i=E(n.symbol),t=W(e,n.relativePath,n.startLine,n.endLine,i),r=X(t,i);return r.size>0?r:null}var be=F("source-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),Se=F("source-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function ye(e){return be.get(e,()=>xe(e))}function he(e){return Se.get(e,()=>Ce(ye(e)))}function Ce(e){let n=new Map;for(let r of e)for(let s of r.tokens)n.set(s,(n.get(s)??0)+1);let i=Math.max(8,Math.ceil(Math.sqrt(e.length))),t=new Map;for(let r of e)for(let s of r.tokens){if((n.get(s)??0)>i)continue;let o=t.get(s);o||(o=[],t.set(s,o)),o.push(r)}return{corpus:e,candidateByToken:t,docFreq:n,ubiquityThreshold:i}}function Fe(e,n){let i=new Map;for(let t of e.tokens)for(let r of n.candidateByToken.get(t)??[])r.symbol!==e.symbol&&i.set(r.symbol,r);return i.size>0?[...i.values()]:n.corpus.filter(t=>t.symbol!==e.symbol)}function xe(e){return new v(e).productionCallableDefinitions().map(i=>({symbol:i.symbol,file:i.relativePath,tokens:X(W(e,i.relativePath,i.startLine,i.endLine,i.leaf),i.leaf)})).filter(i=>i.tokens.size>0)}function W(e,n,i,t,r){let s=B(e,n);if(s.length===0)return"";if(t>=i&&t-i<=12)return s.slice(i,t+1).join(`
|
|
2
|
+
`);let o=[new RegExp(`\\bdef\\s+${k(r)}\\b`),new RegExp(`\\bfun\\s+${k(r)}\\b`),new RegExp(`\\bfn\\s+${k(r)}\\b`),new RegExp(`\\bfunction\\s+${k(r)}\\b`),new RegExp(`\\b${k(r)}\\s*\\(`)],a=s.findIndex(l=>o.some(c=>c.test(l)));if(a>=0){let l=a;for(let c=a+1;c<s.length&&c<=a+8;c++){let f=s[c]??"";if(c>a&&we(f)||(l=c,f.trim()===""&&c>a+1))break}return s.slice(a,l+1).join(`
|
|
3
|
+
`)}return s.slice(i,Math.min(s.length,i+8)).join(`
|
|
4
|
+
`)}function X(e,n){if(!e)return new Set;let i=new Set(["public","private","protected","final","static","class","def","fun","fn","function","return","string","bool","boolean","void","unit","self","this","new","const","let","var","end","pub"]),t=ke(n),s=e.replace(/["'`]/g," ").replace(/\b\d+\b/g," NUM ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9_]+/g," ").replace(/_/g," ").toLowerCase().split(/\s+/).map(o=>o.trim()).filter(o=>o.length>1).filter(o=>!i.has(o)).filter(o=>!t.has(o));return new Set(s)}function ke(e){return new Set(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(n=>n.toLowerCase()).filter(n=>n.length>1))}function we(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}function k(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{Ae as a,qe as b,ee as c,G as d,oe as e,ae as f,U as g,K as h};
|
|
5
|
+
//# sourceMappingURL=chunk-UQJGTVHV.js.map
|
|
@@ -56,4 +56,4 @@ Thumbs.db
|
|
|
56
56
|
# Type definitions (often noise in queries)
|
|
57
57
|
*.d.ts
|
|
58
58
|
`;function f(r,e,n){let t=m(e,n);if(!t)return!1;try{return r.ignores(t)}catch{return!1}}function m(r,e){if(!e||e===".")return null;if(!g(e)&&!e.startsWith(".."))return e.replaceAll("\\","/");let n=g(e)?e:v(r,e),t=u(r,n).replaceAll("\\","/");return!t||t==="."||t.startsWith("..")?null:t}export{F as a};
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-UUBMFL3F.js.map
|