scip-query 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +171 -1132
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-NSTZMBAB.js → chunk-2EC4JTHC.js} +2 -2
- package/dist/{chunk-ZXFTC5ET.js → chunk-46ILZVMX.js} +2 -2
- package/dist/chunk-4A4JFNWG.js +2 -0
- package/dist/{chunk-GAQGJ52J.js → chunk-4B7YLRXX.js} +2 -2
- package/dist/chunk-64UY7VTR.js +63 -0
- package/dist/chunk-66ORT3LS.js +2 -0
- package/dist/{chunk-QPRIYXH4.js → chunk-6G76D2YM.js} +2 -2
- package/dist/{chunk-VUBQBW7H.js → chunk-6P5W4U6G.js} +2 -2
- package/dist/chunk-6ZFKI5EP.js +40 -0
- package/dist/{chunk-ZNUPGRPR.js → chunk-7I6KNKE3.js} +2 -2
- package/dist/{chunk-23YIGCYF.js → chunk-7TYJD45F.js} +5 -5
- package/dist/chunk-7UZWNW4E.js +2 -0
- package/dist/{chunk-4STLJYHI.js → chunk-AGW2MVIO.js} +2 -2
- package/dist/chunk-APLCSDXL.js +4 -0
- package/dist/chunk-BCFED24F.js +2 -0
- package/dist/chunk-CVRXOP6M.js +3 -0
- package/dist/chunk-D43L5PQF.js +2 -0
- package/dist/chunk-DJTJ3DLZ.js +7 -0
- package/dist/chunk-EAU4RDFG.js +2 -0
- package/dist/{chunk-BI4F6GXI.js → chunk-EKP7XJ6L.js} +2 -2
- package/dist/{chunk-33SSUPCB.js → chunk-EM2PPDN7.js} +2 -2
- package/dist/{chunk-ROOHENEP.js → chunk-FIPE5AQT.js} +2 -2
- package/dist/chunk-FTBT4RP2.js +7 -0
- package/dist/{chunk-WPLKHAH7.js → chunk-GD7XRHSV.js} +2 -2
- package/dist/{chunk-WJQY2LGT.js → chunk-GMEBYEMU.js} +2 -2
- package/dist/chunk-GTZAU7OL.js +2 -0
- package/dist/chunk-HVGNOUYP.js +2 -0
- package/dist/chunk-HVXIXDLV.js +2 -0
- package/dist/{chunk-KJ3ZJIE5.js → chunk-I7OTKWNY.js} +2 -2
- package/dist/{chunk-2JEFS2YJ.js → chunk-JAMU6FLN.js} +2 -2
- package/dist/chunk-JTCEWV7Q.js +2 -0
- package/dist/chunk-K4Z3FCUJ.js +6 -0
- package/dist/{chunk-FD37DBTD.js → chunk-K6YIGVL7.js} +2 -2
- package/dist/chunk-MKE7SEEX.js +2 -0
- package/dist/chunk-N5D5ZCBW.js +7 -0
- package/dist/{chunk-ROZNBWIF.js → chunk-NGLRXEWN.js} +2 -2
- package/dist/{chunk-J6Z5YKGQ.js → chunk-NK7TQQG4.js} +2 -2
- package/dist/chunk-NOVKLH2F.js +2 -0
- package/dist/chunk-OIMM7KMI.js +2 -0
- package/dist/chunk-OQSV6OS2.js +2 -0
- package/dist/chunk-PBGTMPJ7.js +2 -0
- package/dist/{chunk-ARBZM2NF.js → chunk-PCMVXWDC.js} +4 -4
- package/dist/{chunk-U75WH4XG.js → chunk-PE4EJOLN.js} +2 -2
- package/dist/chunk-PLFYFZX3.js +2 -0
- package/dist/{chunk-A2AVLALL.js → chunk-QYQXPPDI.js} +2 -2
- package/dist/{chunk-3OUC276S.js → chunk-RCRK4E7E.js} +2 -2
- package/dist/chunk-RIXOMSOR.js +20 -0
- package/dist/chunk-SB6I6O3P.js +2 -0
- package/dist/{chunk-KNA6Z7JB.js → chunk-SDGCKEB7.js} +2 -2
- package/dist/chunk-SLOIQKY7.js +2 -0
- package/dist/chunk-SOGLYIJ4.js +62 -0
- package/dist/chunk-SSINY7HL.js +4 -0
- package/dist/{chunk-563HLCDW.js → chunk-TFO4OMJZ.js} +2 -2
- package/dist/chunk-TH4JVC34.js +71 -0
- package/dist/chunk-TQTVM27C.js +6 -0
- package/dist/{chunk-LDV2B7ET.js → chunk-TR5AU6A5.js} +2 -2
- package/dist/{chunk-WODJHE6Z.js → chunk-UQE3DSXY.js} +2 -2
- package/dist/{chunk-72JOIFXL.js → chunk-UUDYI3FF.js} +2 -2
- package/dist/chunk-VDZL45XI.js +2 -0
- package/dist/{chunk-QWJBIBE6.js → chunk-VN6B6HFB.js} +2 -2
- package/dist/{chunk-DFK54IRN.js → chunk-WC43FMAB.js} +2 -2
- package/dist/chunk-WEJYUS5O.js +2 -0
- package/dist/chunk-WQFOZIID.js +4 -0
- package/dist/chunk-XBFLIGWU.js +3 -0
- package/dist/chunk-XSZ5NC4O.js +2 -0
- package/dist/{chunk-2IYEIFPP.js → chunk-Z2AJQ7VA.js} +2 -2
- package/dist/chunk-ZIIQ55VK.js +2 -0
- package/dist/chunk-ZJ737ZMD.js +2 -0
- package/dist/cli.js +171 -174
- package/dist/health-C6r2VgpA.d.ts +234 -0
- package/dist/index.d.ts +16 -30
- package/dist/index.js +1 -1
- package/dist/postinstall.js +4 -4
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +66 -0
- package/dist/queries/cleanup-plan.js +2 -0
- package/dist/queries/co-change.d.ts +42 -0
- package/dist/queries/co-change.js +2 -0
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +52 -0
- package/dist/queries/diff-gate.js +2 -0
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +69 -0
- package/dist/queries/doc-drift.js +2 -0
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/health.d.ts +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/index.d.ts +38 -2
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +1 -0
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +65 -0
- package/dist/queries/plan-context.js +2 -0
- package/dist/queries/recent-duplicates.d.ts +48 -0
- package/dist/queries/recent-duplicates.js +2 -0
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +58 -0
- package/dist/queries/self-audit.js +2 -0
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +6 -0
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/unused-params.d.ts +38 -0
- package/dist/queries/unused-params.js +2 -0
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +1 -1
- package/dist/reindex.js +16 -16
- package/dist/runtime.d.ts +3 -2
- package/dist/runtime.js +2 -2
- package/package.json +34 -1
- package/skills/concrete-plan/SKILL.md +37 -7
- package/skills/scip-ai-cleanup/SKILL.md +145 -0
- package/skills/scip-debloat/SKILL.md +37 -7
- package/skills/scip-explore/SKILL.md +22 -9
- package/skills/scip-language-playbook/SKILL.md +4 -4
- package/skills/scip-maintainability/SKILL.md +264 -0
- package/skills/scip-verify/SKILL.md +2 -2
- package/dist/chunk-3GNFUVFA.js +0 -2
- package/dist/chunk-5TT47UMX.js +0 -44
- package/dist/chunk-6H2XIIPY.js +0 -71
- package/dist/chunk-7H4RJ4MC.js +0 -2
- package/dist/chunk-7O4MJYIW.js +0 -63
- package/dist/chunk-7OX2O53H.js +0 -62
- package/dist/chunk-BOVNTAKQ.js +0 -3
- package/dist/chunk-CKIO6SVS.js +0 -2
- package/dist/chunk-D6Z67MZL.js +0 -2
- package/dist/chunk-FOQQDXE7.js +0 -2
- package/dist/chunk-IODTPF5H.js +0 -20
- package/dist/chunk-JB4PUN5S.js +0 -40
- package/dist/chunk-JTXKS5GK.js +0 -3
- package/dist/chunk-KJ6CW6EK.js +0 -2
- package/dist/chunk-MDAYGS6T.js +0 -2
- package/dist/chunk-NHDPYW7O.js +0 -2
- package/dist/chunk-NKJKI6SE.js +0 -2
- package/dist/chunk-NYEMZHUC.js +0 -6
- package/dist/chunk-OHEIZWIA.js +0 -4
- package/dist/chunk-QAEDNTY7.js +0 -2
- package/dist/chunk-QE6MGGUY.js +0 -2
- package/dist/chunk-RCJEFQOK.js +0 -4
- package/dist/chunk-TGK5DFBJ.js +0 -2
- package/dist/chunk-TRNAQABL.js +0 -7
- package/dist/chunk-V53J46BX.js +0 -2
- package/dist/chunk-XO6R3X5J.js +0 -2
- package/dist/chunk-YSZNAG4G.js +0 -2
- package/dist/health-x7B4Xu_6.d.ts +0 -119
package/dist/chunk-7OX2O53H.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import{a as h,k as S}from"./chunk-5TT47UMX.js";import{a as y}from"./chunk-NHDPYW7O.js";import{a as x}from"./chunk-NN3O7TPH.js";var F={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function u(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 n=t[0],r=t[1],i=e.slice(n.length+1+r.length+1),s;if(i.startsWith("`")){let l=i.indexOf("`",1);l===-1?(s=i.slice(1),i=""):(s=i.slice(1,l),i=i.slice(l+2))}else{let l=i.indexOf(" ");l===-1?(s=i,i=""):(s=i.slice(0,l),i=i.slice(l+1))}let o,a=i.indexOf(" ");a===-1?(o=i,i=""):(o=i.slice(0,a),i=i.slice(a+1));let c=C(i);return{scheme:n,manager:r,packageName:s,version:o,descriptors:c,raw:e}}function m(e){let t=u(e);if("kind"in t)return null;for(let n=t.descriptors.length-2;n>=0;n--){let r=t.descriptors[n];if(r?.suffix==="type")return r.name}return null}function C(e){let t=[],n=0;for(;n<e.length;){if(e[n]==="["){let s=e.indexOf("]",n+1);if(s===-1){t.push({name:e.slice(n+1),suffix:"type-param"});break}t.push({name:e.slice(n+1,s),suffix:"type-param"}),n=s+1;continue}if(e[n]==="("&&(t.length===0||n===0||D(e[n-1]))){let s=e.indexOf(")",n+1);if(s!==-1&&e[s+1]!=="."){t.push({name:e.slice(n+1,s),suffix:"parameter"}),n=s+1;continue}}let r;if(e[n]==="`"){let s=e.indexOf("`",n+1);if(s===-1){r=e.slice(n+1),t.push({name:r,suffix:"term"});break}r=e.slice(n+1,s),n=s+1}else{let s=n;for(;n<e.length&&!D(e[n]);)n++;r=e.slice(s,n)}if(n>=e.length){r&&t.push({name:r,suffix:"term"});break}let i=e[n];if(i==="("){let s=e.indexOf(")",n+1);s!==-1&&e[s+1]==="."?(t.push({name:r,suffix:"method"}),n=s+2):s!==-1?(t.push({name:r,suffix:"method"}),n=s+1):(t.push({name:r,suffix:"term"}),n++)}else{let s=F[i];s&&t.push({name:r,suffix:s}),n+=1}}return t}function D(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function _(e){let t=u(e);if("kind"in t&&t.kind==="local")return`local:${t.id}`;let n=t;if(n.descriptors.length===0)return n.raw;let r=[];for(let i of n.descriptors){let s=w(i);s&&r.push(s)}return r.join(":")}function w(e){let t=e.suffix==="namespace"?A(e.name):e.name;return t?e.suffix==="method"?`${t}()`:t:""}function A(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 L(e){let t=u(e);if("kind"in t&&t.kind==="local")return t.id;let n=t;return n.descriptors.length===0?"":n.descriptors[n.descriptors.length-1].name}function f(e){let t=u(e);if("kind"in t&&t.kind==="local")return null;let n=t;return n.descriptors[n.descriptors.length-1]?.suffix??null}function ne(e){return e.endsWith("().")||f(e)==="method"}function I(e){let t=f(e);return t==="method"||t==="term"}function te(e){return f(e)==="namespace"}var T=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function ie(e){return T.test(e)}var Q=new Set(["test","tests","_tests"]);function re(e){let t=u(e);if("kind"in t)return!1;for(let n=0;n<t.descriptors.length-1;n+=1){let r=t.descriptors[n];if(r?.suffix==="namespace"&&r.name&&Q.has(r.name))return!0}return!1}function se(e,t){let n=u(e),r=u(t);if("kind"in n||"kind"in r)return!1;let i=n.descriptors,s=r.descriptors;if(s.length!==i.length+1)return!1;for(let o=0;o<i.length;o++){let a=i[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function oe(e,t){let n=u(e),r=u(t);if("kind"in n||"kind"in r)return!1;let i=n.descriptors,s=r.descriptors;if(s.length<=i.length)return!1;for(let o=0;o<i.length;o++){let a=i[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function le(e,t){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path, gs.display_name, gs.documentation
|
|
2
|
-
FROM global_symbols gs
|
|
3
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
4
|
-
JOIN documents d ON der.document_id = d.id
|
|
5
|
-
WHERE ${t.where}
|
|
6
|
-
${e.pathExclusionsFor("d")}
|
|
7
|
-
${M(t.orderBy)}
|
|
8
|
-
${k(t.limit)}`,...t.params??[])}function ce(e,t){return e.all(`SELECT
|
|
9
|
-
gs.id,
|
|
10
|
-
gs.symbol,
|
|
11
|
-
c.document_id,
|
|
12
|
-
MIN(c.start_line) AS start_line,
|
|
13
|
-
MAX(c.end_line) AS end_line,
|
|
14
|
-
d.relative_path,
|
|
15
|
-
gs.display_name,
|
|
16
|
-
gs.documentation
|
|
17
|
-
FROM global_symbols gs
|
|
18
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
19
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
20
|
-
JOIN documents d ON c.document_id = d.id
|
|
21
|
-
WHERE m.role = 1
|
|
22
|
-
AND ${t.where}
|
|
23
|
-
${e.pathExclusionsFor("d")}
|
|
24
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
|
|
25
|
-
${M(t.orderBy)}
|
|
26
|
-
${k(t.limit)}`,...t.params??[])}function M(e){return e?`ORDER BY ${e}`:""}function k(e){return typeof e=="number"?`LIMIT ${e}`:""}function N(e){return!e||!e.trim()?null:e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim()||null}function O(e){if(!e)return null;let t=R(e);if(t)return t.replace(/\n/g," ");let n=e.indexOf("|");if(n===-1)return e.replace(/\n/g," ");let r=e.slice(n+1);return(R(r)??r).replace(/\n/g," ")}function R(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function P(e){if(m(e.symbol)!==null)return!1;let n=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(n)}function $(e,t,n={}){let r=new Map;for(let s of t)e.length>0&&!P(s)||r.set(s.id,s);for(let s of e)r.set(s.id,s);let i=[...r.values()];return n.sort?i.sort((s,o)=>s.start_line-o.start_line||s.end_line-o.end_line||s.symbol.localeCompare(o.symbol)):i}var E=y("file-definitions");function Se(e,t){E.invalidate(e,t)}function b(e,t){return E.get(e,t,()=>{let n=$(B(e,t),j(e,t),{sort:!0});return H(e,t,n.map(J))})}function B(e,t){return e.all(`SELECT
|
|
27
|
-
gs.id,
|
|
28
|
-
gs.symbol,
|
|
29
|
-
der.document_id,
|
|
30
|
-
der.start_line,
|
|
31
|
-
der.end_line,
|
|
32
|
-
d.relative_path,
|
|
33
|
-
gs.display_name,
|
|
34
|
-
gs.kind,
|
|
35
|
-
gs.documentation,
|
|
36
|
-
gs.enclosing_symbol
|
|
37
|
-
FROM global_symbols gs
|
|
38
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
39
|
-
JOIN documents d ON der.document_id = d.id
|
|
40
|
-
WHERE d.relative_path = ?
|
|
41
|
-
${e.symbolNoiseFor("gs")}
|
|
42
|
-
ORDER BY der.start_line, der.end_line`,t)}function j(e,t){return e.all(`SELECT
|
|
43
|
-
gs.id,
|
|
44
|
-
gs.symbol,
|
|
45
|
-
c.document_id,
|
|
46
|
-
MIN(c.start_line) AS start_line,
|
|
47
|
-
MAX(c.end_line) AS end_line,
|
|
48
|
-
d.relative_path,
|
|
49
|
-
gs.display_name,
|
|
50
|
-
gs.kind,
|
|
51
|
-
gs.documentation,
|
|
52
|
-
gs.enclosing_symbol
|
|
53
|
-
FROM global_symbols gs
|
|
54
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
55
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
56
|
-
JOIN documents d ON c.document_id = d.id
|
|
57
|
-
WHERE d.relative_path = ?
|
|
58
|
-
AND m.role = 1
|
|
59
|
-
${e.symbolNoiseFor("gs")}
|
|
60
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
61
|
-
ORDER BY start_line, end_line`,t)}function J(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,endLine:e.end_line,relativePath:e.relative_path,leaf:L(e.symbol),parentTypeName:m(e.symbol),isFunctionLike:I(e.symbol),isTypeLike:f(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function De(e,t={}){return W(e,t.scope)}function W(e,t){return x(e,{scope:t,includeIgnored:!1}).flatMap(n=>b(e,n)).filter(n=>!e.isIgnored(n.relativePath))}function _e(e,t,n={}){if(t.length===0)return[];let r=t.flatMap(i=>b(e,i)).filter(i=>!e.isIgnored(i.relativePath));return n.onlyDocumented&&(r=r.filter(i=>i.documentation!==null&&i.documentation!=="")),n.sort&&(r=r.sort((i,s)=>i.relativePath.localeCompare(s.relativePath)||i.startLine-s.startLine||i.endLine-s.endLine)),r.map(i=>({startLine:i.startLine,endLine:i.endLine,symbol:i.symbol,shortName:_(i.symbol),signature:N(O(i.documentation)),relativePath:i.relativePath,enclosingSymbol:i.enclosingSymbol}))}function Le(e,t){let n=null;for(let r of e)r.startLine>t||r.endLine<t||(!n||r.endLine-r.startLine<n.endLine-n.startLine)&&(n=r);return n}function Ie(e,t){let n=b(e,t.relative_path).find(r=>r.symbolId===t.id);return n?{symbolId:n.symbolId,symbol:n.symbol,documentId:n.documentId,startLine:n.startLine,endLine:n.endLine,relativePath:n.relativePath}:{symbolId:t.id,symbol:t.symbol,documentId:t.document_id,startLine:t.start_line,endLine:t.end_line,relativePath:t.relative_path}}function H(e,t,n){let r=h(e,t),i=S(e,t);return i?G(n,i,r):r?z(n,r):n}function z(e,t){let n=t.split(/\r?\n/),r=Y(e,n),i=U(e,r),s=Z(i,n);return X(e,s)}function Y(e,t){let n=e.some(i=>g(i.symbol))?V(t):null,r=new Map;for(let i of e)r.set(i.symbolId,K(t,n,i));return r}function U(e,t){return e.filter(n=>g(n.symbol)).map(n=>({definition:n,startLine:t.get(n.symbolId)??n.startLine})).sort((n,r)=>n.startLine-r.startLine||n.definition.startLine-r.definition.startLine||n.definition.symbol.localeCompare(r.definition.symbol))}function Z(e,t){let n=new Map;for(let r=0;r<e.length;r+=1){let i=e[r],s=e[r+1],o=s?Math.max(i.startLine,s.startLine-1):t.length-1;n.set(i.definition.symbolId,{startLine:i.startLine,endLine:q(t,i.definition,i.startLine,o)})}return n}function X(e,t){return e.map(n=>{let r=t.get(n.symbolId);return r?{...n,startLine:r.startLine,endLine:r.endLine}:n})}function G(e,t,n=null){let r=new Map;for(let i of t){let s=r.get(i.name);s?s.push(i):r.set(i.name,[i])}return e.map(i=>{if(!g(i.symbol)||!i.leaf)return v(i,n);let s=r.get(i.leaf);if(!s||s.length===0)return v(i,n);let o=s[0],a=Math.abs(o.startLine-i.startLine);for(let c=1;c<s.length;c+=1){let l=s[c],d=Math.abs(l.startLine-i.startLine);d<a&&(o=l,a=d)}return{...i,startLine:o.startLine,endLine:o.endLine}})}function v(e,t){if(!t||!e.leaf||f(e.symbol)!=="term"||m(e.symbol)!==null)return e;let n=e.leaf.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${n}\\b`),s=t.split(/\r?\n/).findIndex(o=>r.test(o));return s>=0?{...e,startLine:s,endLine:s}:e}function K(e,t,n){if(!g(n.symbol))return n.startLine;let r=Math.max(0,Math.min(n.startLine,e.length-1));if(!t)return r;let i=t.get(n.leaf);if(!i||i.length===0)return r;let s=null;for(let o of i){let a=Math.abs(o-n.startLine);(!s||a<s.distance)&&(s={line:o,distance:a})}return s?.line??r}function V(e){let t=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,n=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,r=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,i=/\b([A-Za-z_$][\w$]*)\s*\(/g,s=new Map,o=(a,c)=>{let l=s.get(a);if(!l){s.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let d of c.matchAll(t))d[1]&&o(d[1],a);for(let d of c.matchAll(n))d[1]&&o(d[1],a);let l=c.match(r);l?.[1]&&o(l[1],a);for(let d of c.matchAll(i))d[1]&&o(d[1],a)}return s}function q(e,t,n,r){let i=Math.max(n,Math.min(e.length-1,r)),s=Math.max(n,Math.min(i,t.endLine)),o=0,a=0,c=!1;for(let l=n;l<=i;l+=1){let d=ee(e[l]??"");for(let p of d)p==="{"?(o+=1,c=!0):p==="}"?o=Math.max(0,o-1):p==="("?a+=1:p===")"&&(a=Math.max(0,a-1));if(c&&o===0||!c&&a===0&&l>=s)return l}return s}function ee(e){let t="",n=null,r=!1;for(let i=0;i<e.length;i+=1){let s=e[i],o=e[i+1];if(!n&&s==="/"&&o==="/"){t+=" ".repeat(e.length-i);break}if(n){if(r){r=!1,t+=" ";continue}if(s==="\\"){r=!0,t+=" ";continue}s===n&&(n=null),t+=" ";continue}if(s==='"'||s==="'"||s==="`"){n=s,t+=" ";continue}t+=s}return t}function g(e){return e.includes("().")}function Re(e){let t=u(e);if("kind"in t)return[];let n=[];for(let r=t.descriptors.length-2;r>=0;r-=1){let i=t.descriptors[r];i?.suffix==="type"&&i.name&&n.push(i.name)}return n}export{u as a,m as b,_ as c,L as d,f as e,ne as f,I as g,te as h,ie as i,re as j,se as k,oe as l,le as m,ce as n,N as o,O as p,$ as q,Se as r,b as s,De as t,W as u,_e as v,Le as w,Ie as x,Re as y};
|
|
62
|
-
//# sourceMappingURL=chunk-7OX2O53H.js.map
|
package/dist/chunk-BOVNTAKQ.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{b as v,c as j}from"./chunk-NHDPYW7O.js";import{a as P}from"./chunk-NN3O7TPH.js";function b(t){return t.replace(/'''[\s\S]*?'''/g,f).replace(/"""[\s\S]*?"""/g,f).replace(/#.*$/gm,f).replace(/\/\/.*$/gm,f).replace(/\/\*[\s\S]*?\*\//g,f).replace(/`(?:\\[\s\S]|[^`])*`/g,f).replace(/'(?:\\.|[^'\\\r\n])*'/g,f).replace(/"(?:\\.|[^"\\\r\n])*"/g,f)}function f(t){return t.replace(/[^\r\n]/g," ")}var D=j("stripped-lines");function _t(t,n,e){return D.get(t,n,e,()=>b(e).split(`
|
|
2
|
-
`))}function Tt(t){D.invalidateAll(t),_=null,E=""}function Dt(t,n){D.invalidate(t,n),_=null,E=""}var _=null,E="";function Y(t){return _===t||(_=t,E=b(t)),E}function Rt(t,n,e){let r=Y(t);return`${r.slice(0,n)}${" ".repeat(e-n)}${r.slice(e)}`}function $t(t,n){return new RegExp(`\\b${w(n)}\\b`,"m").test(t)}function yt(t,n){let e=new Set,r=new RegExp(`\\b${w(n)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let o of t.matchAll(r)){let s=o[1];s&&e.add(s)}return[...e]}function w(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ct(t){let n=0;for(let e of t)e==="("&&(n+=1),e===")"&&(n-=1);return n}import{existsSync as T}from"fs";import{basename as G,dirname as S,extname as p,join as g,relative as h,resolve as u}from"path";var K=v("indexed-paths"),m=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],X=[".py",".pyi"],k=[".java",".scala",".kt",".kts"],A=[".rs"],L=[".rb"],W=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],H=[".cs",".vb"],U=[".dart"],J=[".php"],Q=new Set(m),R=new Set(X),M=new Set(k),$=new Set(A),y=new Set(L),B=new Set(W),F=new Set(H),C=new Set(U),z=new Set(J),Z=[{extensions:m,lookup:Q},{extensions:X,lookup:R},{extensions:k,lookup:M},{extensions:A,lookup:$},{extensions:L,lookup:y},{extensions:W,lookup:B},{extensions:H,lookup:F},{extensions:U,lookup:C},{extensions:J,lookup:z}];function x(t,n){return n.has(p(t).toLowerCase())}function q(t){return x(t,R)}function tt(t){return x(t,M)}function nt(t){return x(t,$)}function et(t){return x(t,y)}function rt(t){return x(t,B)}function ot(t){return x(t,F)}function wt(t){return p(t).toLowerCase()===".vb"}function st(t){return x(t,C)}function it(t){return x(t,z)}function ct(t){let n=p(t).toLowerCase();for(let e of Z)if(e.lookup.has(n))return e.extensions;return m}function at(t){return tt(t)||ot(t)||it(t)}function Xt(t,n,e){return q(n)?ut(t,n,e):nt(n)?gt(t,n,e):et(n)?pt(t,n,e):rt(n)?ft(t,n,e):at(n)?St(t,e.replace(/\\/g,"."),ct(n)):st(n)?xt(t,n,e):lt(t,n,e)}function lt(t,n,e){if(!e.startsWith(".")&&!e.startsWith("/"))return null;let r=S(g(t.config.projectRoot,n)),o=u(r,e),s=N(t);for(let c of Nt(o)){let a=d(h(t.config.projectRoot,c));if(s.has(a)||T(c))return a}return d(h(t.config.projectRoot,o))}function ut(t,n,e){let r=N(t),o;if(e.startsWith(".")){let s=e.match(/^(\.+)(.*)$/);if(!s)return null;let c=s[1].length,a=s[2].replace(/^\./,""),i=S(g(t.config.projectRoot,n));for(let l=1;l<c;l++)i=S(i);o=a?u(i,a.replace(/\./g,"/")):i}else o=u(t.config.projectRoot,e.replace(/\./g,"/"));for(let s of dt(o)){let c=d(h(t.config.projectRoot,s));if(r.has(c)||T(s))return c}return null}function gt(t,n,e){if(!e)return null;let r=e.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=S(g(t.config.projectRoot,n)),s;return r.startsWith("crate::")?s=u(t.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=u(o,r.slice(6).replace(/::/g,"/")):s=u(S(o),r.slice(7).replace(/::/g,"/")),O(t,Et(s))}function pt(t,n,e){let r=S(g(t.config.projectRoot,n)),o=u(r,e);return O(t,ht(o))}function ft(t,n,e){let r=S(g(t.config.projectRoot,n)),o=[u(r,e),u(t.config.projectRoot,e),u(t.config.projectRoot,"include",e),u(t.config.projectRoot,"src",e)];return O(t,o)}function St(t,n,e){let r=N(t),o=n.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),c=o.split(".").pop()??o;for(let i of e){let l=`${s}${i}`,I=[...r].find(V=>V.endsWith(l));if(I)return I}for(let i of e){let l=[...r].find(I=>G(I)===`${c}${i}`);if(l)return l}let a=[...r].filter(i=>e.includes(p(i).toLowerCase())).filter(i=>i.includes(`/${s}/`)||i.includes(`/${c}/`)).sort((i,l)=>i.localeCompare(l));return a.length===1?a[0]:null}function xt(t,n,e){let r=N(t);if(e.startsWith("package:")){let c=e.slice(8),a=c.indexOf("/");if(a<0)return null;let i=c.slice(a+1),l=d(i.startsWith("lib/")?i:`lib/${i}`);return r.has(l)?l:null}let o=S(g(t.config.projectRoot,n)),s=u(o,e);for(let c of mt(s)){let a=d(h(t.config.projectRoot,c));if(r.has(a)||T(c))return a}return null}function dt(t){let n=p(t);return R.has(n)?[t]:[`${t}.py`,`${t}.pyi`,g(t,"__init__.py"),g(t,"__init__.pyi")]}function O(t,n){let e=N(t);for(let r of n){let o=d(h(t.config.projectRoot,r));if(e.has(o)||T(r))return o}return null}function Et(t){let n=p(t);return $.has(n)?[t]:[`${t}.rs`,g(t,"mod.rs")]}function ht(t){let n=p(t);return y.has(n)?[t]:[`${t}.rb`,g(t,"index.rb")]}function mt(t){let n=p(t);return C.has(n)?[t]:[`${t}.dart`,t]}function Nt(t){let n=p(t),e=new Set;if(n){e.add(t);for(let r of m)e.add(t.slice(0,-n.length)+r)}else for(let r of m)e.add(`${t}${r}`),e.add(g(t,`index${r}`));return[...e]}function N(t){return K.get(t,()=>new Set(P(t,{includeIgnored:!1}).map(d)))}function d(t){return t.replace(/\\/g,"/")}export{m as a,X as b,k as c,A as d,L as e,W as f,H as g,U as h,J as i,wt as j,ct as k,Xt as l,ut as m,gt as n,pt as o,ft as p,St as q,xt as r,d as s,b as t,_t as u,Tt as v,Dt as w,Rt as x,$t as y,yt as z,w as A,Ct as B};
|
|
3
|
-
//# sourceMappingURL=chunk-BOVNTAKQ.js.map
|
package/dist/chunk-CKIO6SVS.js
DELETED
package/dist/chunk-D6Z67MZL.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as ae}from"./chunk-MX6F756F.js";import{a as K,b as C}from"./chunk-QAEDNTY7.js";import{d as A,e as j,f as O,g as B,h as H}from"./chunk-NKJKI6SE.js";import{b as N}from"./chunk-IODTPF5H.js";import{b as re,d as te}from"./chunk-ARBZM2NF.js";import{c as Y,d as Q,e as X,f as Z,h as v,l as ee,m as ne}from"./chunk-JB4PUN5S.js";import{a as R}from"./chunk-7O4MJYIW.js";import{b as T,d as w,e as M}from"./chunk-RCJEFQOK.js";import{v as L,w as _}from"./chunk-BOVNTAKQ.js";import{c as U,f as G,g as W,h as $,i as V,j as q,r as z,s as J,y as h}from"./chunk-7OX2O53H.js";import{b as I,c as F,h as k,i as E}from"./chunk-5TT47UMX.js";import{a as y}from"./chunk-NN3O7TPH.js";function ie(e){let n=new Map,r=t=>{let a=n.get(t);if(a)return a;let s=K(e,t);return a={ranges:s.map(i=>({startLine:i.startLine,endLine:i.endLine})),containers:new Set(s.map(i=>i.containerName).filter(i=>!!i))},n.set(t,a),a};return(t,a,s,i)=>{let l=r(t);for(let c of l.ranges)if(a>=c.startLine&&a<=c.endLine)return!0;if(i&&l.containers.has(i))return!0;for(let c of h(s))if(l.containers.has(c))return!0;return!1}}function oe(e){N(e),te(e),ee(e)}var Re=[{kind:"symbol-evidence",clearDatabase:oe},{kind:"semantic-provider",clearDatabase:R},{kind:"identifier-index",clearDatabase:Y,clearFile:Q},{kind:"language-parser",clearDatabase:w,clearFile:M},{kind:"source-stripper",clearDatabase:L,clearFile:_},{kind:"ast-tree",clearDatabase:k,clearFile:E},{kind:"source-text",clearDatabase:I,clearFile:F},{kind:"definition-catalog",clearFile:z}],se=["symbol-evidence","identifier-index","language-parser","source-stripper","ast-tree","source-text"],ce=["identifier-index","language-parser","source-stripper","ast-tree","source-text"];function le(e,n){let r=new Set(n.kinds);for(let t of Re)r.has(t.kind)&&(n.scope.kind==="database"?t.clearDatabase?.(e):t.clearFile?.(e,Ce(n.scope.relativePath)))}function en(e,n={}){le(e,{scope:{kind:"database"},kinds:n.semanticProvider===!0?[...se,"semantic-provider"]:se})}function D(e,n,r={}){le(e,{scope:{kind:"file",relativePath:n},kinds:r.definitions===!0?[...ce,"definition-catalog"]:ce})}function Ce(e){return e.replace(/\\/g,"/")}function de(e,n){return n.isIgnoredPath(e.relativePath)?m("ignored-file"):$(e.symbol)?m("module-like-symbol"):ue(e.symbol)?!e.isFunctionLike&&e.enclosingSymbol&&ue(e.enclosingSymbol)?m("nested-non-callable-value"):!n.includeTests&&!x(e.relativePath)?m("test-file"):!n.includeTests&&n.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName)?m("excluded-file-region"):V(e.symbol)?m("rust-trait-impl-member"):q(e.symbol)?m("rust-test-module"):!n.includeMembers&&!xe(e)?m("member"):e.endLine-e.startLine+1<n.minLoc?m("below-min-loc"):{accepted:!0}:m("non-value-symbol")}function x(e){return[...new Set([...B,...H])].every(r=>!De(e,r))}function m(e){return{accepted:!1,rejectionReason:e}}function De(e,n){return new RegExp(`^${n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/%/g,".*").replace(/_/g,".")}$`).test(e)}function ue(e){return W(e)||e.endsWith("().")||e.endsWith(".")}function xe(e){return G(e.symbol)||h(e.symbol).length===0}function me(){return new Map}function fe(e,n,r){let t=new Map;for(let a of X(e,r))e.isIgnored(a.relative_path)||n.has(a.relative_path)||S(t,a.symbol_id,a.relative_path,a.ref_count,"scip-mention");return t}function pe(e,n,r){let t=new Set;for(let a of Z(e,n))e.isIgnored(a.relative_path)||r.has(a.relative_path)||t.add(a.symbol_id);return t}function P(e,n){let r=e.get(n);if(!r)return!1;for(let t of r.values())if(t.occurrences>0)return!0;return!1}function ge(e){return e?.occurrences??0}function S(e,n,r,t,a="source-fallback"){if(t<=0)return;let s=ye(e,n,r);s.occurrences+=t,s.sources.add(a)}function be(e,n,r,t,a){if(t<=0)return;let s=ye(e,n,r);s.occurrences=Math.max(t,s.occurrences),s.sources.add(a)}function ye(e,n,r){let t=e.get(n);t||(t=new Map,e.set(n,t));let a=t.get(r);return a||(a={occurrences:0,sources:new Set},t.set(r,a)),a}function Dn(e,n={}){let{scope:r,minLoc:t=1,includeTests:a=!1,skipBarrels:s=!1,includeMembers:i=!1,deadCodeOnly:l=!1,scanLimit:c,semantic:d=!0}=n,o=ae(Pe(e,{scope:r,minLoc:t,includeTests:a,includeMembers:i}),c),u=s?new Set(A(e)):new Set,p=l?me():fe(e,u,o.map(f=>f.symbolId)),g=l?pe(e,o.map(f=>f.symbolId),u):new Set,b=l?o.filter(f=>!g.has(f.symbolId)):o;l?ke(e,b,p,u):_e(e,b,p,u);let Se=l?b.filter(f=>!P(p,f.symbolId)):o;Ne(e,Se,p,{includeTests:a,inactiveBarrelPaths:u,includeSemantic:!l&&d});let ve=l?b.filter(f=>!P(p,f.symbolId)):o;return Le(e,Ie(ve,p))}function Pe(e,n){let r=ie(e),t=[];for(let a of y(e,{scope:n.scope}))try{for(let s of J(e,a))de(s,{minLoc:n.minLoc,includeTests:n.includeTests,includeMembers:n.includeMembers,isIgnoredPath:l=>e.isIgnored(l),isExcludedRegion:r}).accepted&&t.push(s)}finally{D(e,a,{definitions:!0})}return t}function Ie(e,n){return e.map(r=>Fe(r,n)).filter(r=>r.cross_file_refs===0).sort((r,t)=>t.loc-r.loc||r.relative_path.localeCompare(t.relative_path)||r.start_line-t.start_line)}function Fe(e,n){let r=n.get(e.symbolId)??new Map,t=ge(r.get(e.relativePath)),a=0;for(let[s,i]of r)s!==e.relativePath&&(a+=i.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,same_file_refs:t,cross_file_refs:a}}function Le(e,n){let r=[],t=0,a=0,s=0;for(let i of n){if(e.isIgnored(i.relative_path)||j(e,i.relative_path)||O(e,i.symbol,i.relative_path))continue;let l=i.same_file_refs===0?"dead-code":"file-internal";l==="dead-code"?t++:a++,s+=i.loc,r.push({relativePath:i.relative_path,startLine:i.start_line,endLine:i.end_line,loc:i.loc,symbol:i.symbol,shortName:U(i.symbol),sameFileRefs:i.same_file_refs,kind:l})}return{symbols:r,totalCount:r.length,deadCodeCount:t,fileInternalCount:a,totalLoc:s}}function _e(e,n,r,t){if(n.length===0)return;let a=new C(e),s=new Set(n.map(c=>c.symbolId)),i=new Set(n.map(c=>c.leaf).filter(Boolean)),l=new Set(a.sourceFiles());for(let c of y(e))l.add(c);a.scanSourceReferences({paths:l,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:i,skipPath:c=>t.has(c)},c=>{s.has(c.target.symbolId)&&(we(e,c)||S(r,c.target.symbolId,c.sourceFile,Me(c),"source-fallback"))})}function ke(e,n,r,t){if(n.length===0)return;let a=new C(e),s=Ee(n),i=new Set(a.sourceFiles());for(let o of y(e))i.add(o);let l=new Set(s.keys()),c=new Map,d=o=>{let u=c.get(o);return u||(u=ne(e,o),c.set(o,u)),u};a.scanSourceReferences({paths:i,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:l,skipPath:o=>t.has(o),resolveTargets:({sourceFile:o,name:u,kind:p})=>{let g=s.get(u);return g?Te(o,u,g,d(o),{permissive:p!=="cross-language-dispatch"}):[]},afterPath:o=>{c.delete(o),D(e,o)}},o=>{let u=o.kind==="identifier"&&o.sourceFile===o.target.relativePath?Math.max(0,o.occurrences-1):o.occurrences;o.kind==="identifier"&&he(e,{sourceFile:o.sourceFile,name:o.name,target:o.target,occurrences:u})||S(r,o.target.symbolId,o.sourceFile,u,"source-fallback")})}function Ee(e){let n=new Map;for(let r of e){if(!r.leaf)continue;let t=n.get(r.leaf)??[];t.push(r),n.set(r.leaf,t)}return n}function Te(e,n,r,t,a){let s=r.filter(c=>c.relativePath===e);if(s.length>0)return s;let i=t.get(n);if(i)for(let c of i){let d=r.filter(o=>v(c,o.relativePath));if(d.length>0)return d}let l=new Set;for(let c of t.values())for(let d of c)l.add(d);for(let c of l){let d=r.filter(o=>v(c,o.relativePath));if(d.length>0&&d.length===r.length)return d}return a.permissive?[...r]:[]}function we(e,n){return n.kind==="cross-language-dispatch"&&n.target.relativePath===n.sourceFile?!0:n.kind==="identifier"&&he(e,n)}function Me(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function he(e,n){return n.occurrences>1?!1:T(e,n.sourceFile).some(r=>r.used||r.sourcePath!==n.target.relativePath?!1:r.importedName===n.name||r.localName===n.name)}function Ne(e,n,r,t){for(let a of n){let s=re(e,a,{semantic:t.includeSemantic!==!1});if(s.length!==0)for(let i of s){let l=i.file;l===a.relativePath||e.isIgnored(l)||t.inactiveBarrelPaths.has(l)||!t.includeTests&&!x(l)||be(r,a.symbolId,l,1,"caller-map")}}}export{en as a,Dn as b};
|
|
2
|
-
//# sourceMappingURL=chunk-D6Z67MZL.js.map
|
package/dist/chunk-FOQQDXE7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as m}from"./chunk-MX6F756F.js";import{a as g,b}from"./chunk-ARBZM2NF.js";import{r as y}from"./chunk-JB4PUN5S.js";import{a as c}from"./chunk-ZNUPGRPR.js";import{c as t}from"./chunk-7OX2O53H.js";function R(l,n,r={}){let o=c(l,n);if(!o)return null;let a=[{file:o.relativePath,line:o.startLine}],i=y(l,o,{semantic:r.semantic}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?t(e.enclosingSymbol):"(top-level)"})),{producers:f,consumers:s}=S(l,o,i,{semantic:r.semantic!==!1});return{symbol:o.symbol,shortName:t(o.symbol),relativePath:o.relativePath,definitionSites:a.filter(e=>!l.isIgnored(e.file)),usageSites:i,producers:f.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:t(e.symbol),file:e.file})),consumers:s.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":t(e.symbol),file:e.file}))}}function S(l,n,r,o){let a=m(g(l,n,{limit:30,semantic:o.semantic}).map(s=>({symbol:s.symbol,file:s.file}))),i=m(b(l,n,{limit:30,semantic:o.semantic})),f=i.length>0?i:m(r.map(s=>({symbol:s.enclosingSymbol==="(top-level)"?s.file:s.enclosingSymbol,file:s.file})));return{producers:a,consumers:f}}export{R as a};
|
|
2
|
-
//# sourceMappingURL=chunk-FOQQDXE7.js.map
|
package/dist/chunk-IODTPF5H.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{b as c}from"./chunk-RCJEFQOK.js";import{a as d}from"./chunk-NHDPYW7O.js";import{a}from"./chunk-NN3O7TPH.js";var g=d("file-dep-graph");function _(e,i){return g.get(e,i??"",()=>{let s=new Map,n=new Set(a(e,{includeIgnored:!1})),r=(t,o)=>m(e,s,n,t,o);for(let t of l(e,i))r(t.from_file,t.to_file);for(let t of n)if(!(i&&!t.includes(i)))for(let o of c(e,t))o.sourcePath&&r(t,o.sourcePath);return s})}function l(e,i){let s=i?`AND d1.relative_path LIKE '%${i}%'`:"";return e.all(`SELECT DISTINCT
|
|
2
|
-
d1.relative_path AS from_file,
|
|
3
|
-
d2.relative_path AS to_file
|
|
4
|
-
FROM mentions m
|
|
5
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
-
JOIN documents d1 ON c.document_id = d1.id
|
|
7
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
8
|
-
JOIN (
|
|
9
|
-
SELECT m2.symbol_id, c2.document_id
|
|
10
|
-
FROM mentions m2
|
|
11
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
12
|
-
WHERE m2.role = 1
|
|
13
|
-
GROUP BY m2.symbol_id
|
|
14
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
15
|
-
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
16
|
-
WHERE d1.id != d2.id
|
|
17
|
-
AND m.role != 1
|
|
18
|
-
${e.pathExclusionsFor("d1","d2")}
|
|
19
|
-
${s}`)}function m(e,i,s,n,r){if(n===r||e.isIgnored(n)||e.isIgnored(r)||!s.has(r))return;let t=i.get(n);t||(t=new Set,i.set(n,t)),t.add(r)}function h(e){g.invalidateAll(e)}export{_ as a,h as b};
|
|
20
|
-
//# sourceMappingURL=chunk-IODTPF5H.js.map
|
package/dist/chunk-JB4PUN5S.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{c as $}from"./chunk-7O4MJYIW.js";import{c as R}from"./chunk-ZNUPGRPR.js";import{b as y}from"./chunk-RCJEFQOK.js";import{A as O,t as A,u as T}from"./chunk-BOVNTAKQ.js";import{c as L}from"./chunk-KJ6CW6EK.js";import{d,s as h,w as _}from"./chunk-7OX2O53H.js";import{a as p,e as m,j as P}from"./chunk-5TT47UMX.js";import{a as S,b as k}from"./chunk-NHDPYW7O.js";var X=new Set(["identifier","type_identifier","field_identifier"]),q=new Set(["identifier"]),ee=new Set(["identifier","property_identifier","type_identifier"]),ne=new Set(["rust","python"]),te=/\{([^{}]*)\}/g,ie=/\b([A-Za-z_][\w]*)\b/g;function I(e,t,i,n={}){if(!i)return[];let r=p(e,t);if(!r)return[];if(r.indexOf(i)===-1)return[];if(m(t))return(D(e,t).get(i)??[]).filter(f=>!B(f,n));let o=T(e,t,r),s=new RegExp(`\\b${O(i)}\\b`),a=[];for(let c=0;c<o.length;c++)B(c,n)||s.test(o[c]??"")&&a.push(c);return a}function B(e,t){return typeof t.excludeStartLine=="number"&&typeof t.excludeEndLine=="number"&&e>=t.excludeStartLine&&e<=t.excludeEndLine}var x=S("file-identifiers");function H(e,t){return x.get(e,t,()=>new Set(D(e,t).keys()))}var N=S("file-ident-lines");function D(e,t){return N.get(e,t,()=>re(e,t))}var v=S("file-idents-by-line");function Se(e,t){return v.get(e,t,()=>{let i=D(e,t),n=0;for(let o of i.values()){let s=o[o.length-1];s!==void 0&&s>n&&(n=s)}let r=new Array(n+1);for(let o=0;o<=n;o+=1)r[o]=new Set;for(let[o,s]of i)for(let a of s)r[a].add(o);return r})}function ye(e){x.invalidateAll(e),N.invalidateAll(e),v.invalidateAll(e)}function he(e,t){x.invalidate(e,t),N.invalidate(e,t),v.invalidate(e,t)}function re(e,t){let i=new Map,n=(a,c)=>{let l=i.get(a);if(!l){i.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};if(m(t)){let a=P(e,t);if(a){let c=m(t),l=c==="rust"?X:c==="python"?q:ee,f=u=>{if(l.has(u.type)&&n(u.text,u.startPosition.row),c&&ne.has(c)&&u.type==="string_content"){let E=u.startPosition.row;for(let K of u.text.matchAll(te)){let V=K[1]??"";for(let F of V.matchAll(ie))F[1]&&n(F[1],E)}}for(let E of u.children)f(E)};return f(a.rootNode),i}}let r=p(e,t);if(!r)return i;let o=A(r).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let a=0;a<o.length;a+=1){let c=o[a]??"";for(let l of c.matchAll(s))l[1]&&n(l[1],a)}return i}function j(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function g(e,t){return j(e)===j(t)}function J(e,t){let i=new Map;for(let n of y(e,t)){if(!n.sourcePath)continue;let r=n.localName??n.importedName;if(r&&G(i,r,n.sourcePath),n.kind==="namespace")for(let o of n.usedMembers)G(i,o,n.sourcePath)}return i}function G(e,t,i){let n=e.get(t);n||(n=new Set,e.set(t,n)),n.add(i)}function Le(e,t){return C(e,t,i=>{let n=i?`AND m.symbol_id IN (${i.map(()=>"?").join(",")})`:"";return e.all(`SELECT
|
|
2
|
-
m.symbol_id,
|
|
3
|
-
d.relative_path,
|
|
4
|
-
COUNT(*) AS ref_count
|
|
5
|
-
FROM mentions m
|
|
6
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
7
|
-
JOIN documents d ON c.document_id = d.id
|
|
8
|
-
WHERE m.role != 1
|
|
9
|
-
${n}
|
|
10
|
-
${e.pathExclusionsFor("d")}
|
|
11
|
-
GROUP BY m.symbol_id, d.relative_path`,...i??[])})}function xe(e,t){return C(e,t,i=>{let n=i?`AND m.symbol_id IN (${i.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path
|
|
12
|
-
FROM mentions m
|
|
13
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
14
|
-
JOIN documents d ON c.document_id = d.id
|
|
15
|
-
WHERE m.role != 1
|
|
16
|
-
${n}
|
|
17
|
-
${e.pathExclusionsFor("d")}`,...i??[])}).filter(i=>i.symbol_id!==null)}function Y(e,t){return C(e,t,i=>{let n=i?`AND m.symbol_id IN (${i.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
|
|
18
|
-
c.start_line AS chunk_start, c.end_line AS chunk_end
|
|
19
|
-
FROM mentions m
|
|
20
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
21
|
-
JOIN documents d ON c.document_id = d.id
|
|
22
|
-
WHERE m.role != 1
|
|
23
|
-
${n}
|
|
24
|
-
${e.pathExclusionsFor("d")}
|
|
25
|
-
ORDER BY d.relative_path, c.start_line`,...i??[])})}function C(e,t,i){if(!t)return i();if(t.length===0)return[];let n=[];for(let r=0;r<t.length;r+=750)n.push(...i(t.slice(r,r+750)));return n}function Fe(e,t){let i=z(e);return i?t.filter(n=>z(n.file)===i):t}function ke(e,t,i,n){let r=i.find(o=>o.file===t);if(r)return r;if(n){let o=new Set(y(e,t).map(s=>s.sourcePath).filter(s=>!!s));for(let s of i)for(let a of o)if(g(a,s.file))return s;return null}return i.length===1?i[0]:null}function z(e){let t=m(e);return t?t==="typescript"||t==="tsx"||t==="javascript"?"javascript-family":t:null}var U=k("global-leaf-index");function w(e){return U.get(e,()=>{let t=e.all(`SELECT gs.id, gs.symbol,
|
|
26
|
-
COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
|
|
27
|
-
FROM global_symbols gs
|
|
28
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
29
|
-
LEFT JOIN documents der_doc ON der_doc.id = der.document_id
|
|
30
|
-
LEFT JOIN (
|
|
31
|
-
SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
|
|
32
|
-
FROM mentions m
|
|
33
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
34
|
-
JOIN documents d ON c.document_id = d.id
|
|
35
|
-
WHERE m.role = 1
|
|
36
|
-
GROUP BY m.symbol_id
|
|
37
|
-
) mention_doc ON mention_doc.symbol_id = gs.id
|
|
38
|
-
WHERE 1 = 1
|
|
39
|
-
${e.symbolNoiseFor("gs")}`),i=new Map;for(let n of t){if(!n.relative_path||e.isIgnored(n.relative_path))continue;let r=d(n.symbol);if(!r)continue;let o=i.get(r);o||(o=[],i.set(r,o)),o.some(s=>s.symbolId===n.id)||o.push({symbol:n.symbol,symbolId:n.id,file:n.relative_path})}return i})}function Ae(e){U.invalidate(e)}function M(e,t,i){let n=w(e).get(i);if(!n||n.length===0)return[];if(n.length===1)return[b(n[0])];let r=n.filter(c=>c.file===t);if(r.length>0)return r.map(b);let o=J(e,t),s=o.get(i);if(s)for(let c of s){let l=n.filter(f=>g(c,f.file));if(l.length>0)return l.map(b)}let a=new Set;for(let c of o.values())for(let l of c)a.add(l);for(let c of a){let l=n.filter(f=>g(c,f.file));if(l.length>0&&l.length===n.length)return l.map(b)}return[]}function Ue(e,t,i){let n=M(e,t,i);if(n.length>0)return n;let r=w(e).get(i);return!r||r.length===0?[]:r.map(b)}function Z(e,t,i={}){let n=R(e,t);if(!n)return[];let r=d(n.symbol);if(!r)return[];if(i.semantic!==!1){let s=$(e,{...n,leaf:r,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let a=new Map;for(let c of s){let l=a.get(c.file)??[];l.push(c.line),a.set(c.file,l)}return W(e,a)}}let o=new Map;for(let s of L(e)){let a=p(e,s);if(!a||a.indexOf(r)===-1||s!==n.relativePath&&!M(e,s,r).some(f=>f.symbolId===n.symbolId))continue;let c=I(e,s,r,s===n.relativePath?{excludeStartLine:n.startLine,excludeEndLine:n.endLine}:{});c.length>0&&o.set(s,c)}return W(e,o)}function We(e,t){let i=new Map;for(let o of t){if(!o.leaf)continue;let s=i.get(o.leaf)??[];s.push(o),i.set(o.leaf,s)}if(i.size===0)return new Map;let n=new Set(t.map(o=>o.symbolId)),r=new Map;for(let o of L(e)){let s=H(e,o);if(s.size!==0){for(let a of s)if(i.has(a))for(let c of M(e,o,a)){if(!n.has(c.symbolId)||o===c.relativePath)continue;let l=r.get(c.symbolId);l||(l=new Set,r.set(c.symbolId,l)),l.add(o)}}}return r}function b(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function W(e,t){let i=[],n=new Set;for(let[r,o]of t){let s=h(e,r);for(let a of o){let c=_(s,a),l=`${r}|${a}|${c?.symbol??""}`;n.has(l)||(n.add(l),i.push({file:r,line:a,enclosingSymbol:c?.symbol??null}))}}return i}function oe(e,t){let i=ue(e,t);return i?me(e,ce(e,i.match,i.identifier)):[]}function nn(e,t,i={}){return se(e,t,i).map(n=>({file:n.file,line:n.line,enclosingSymbol:n.enclosingSymbol}))}function se(e,t,i={}){let n=Z(e,t,{semantic:i.semantic}),r=n.length>0?Q(n,"source-attribution"):Q(oe(e,t),"scip-reference-chunk");return i.includeIgnored===!0?r:r.filter(o=>!e.isIgnored(o.file))}function Q(e,t){return e.map(i=>({...i,provenance:t}))}function ce(e,t,i){let n=new Map;for(let[r,o]of ae(e,t.symbolId))n.set(r,le(e,r,o,t,i));return n}function ae(e,t){let i=new Map;for(let n of Y(e,[t])){if(e.isIgnored(n.relative_path))continue;let r=i.get(n.relative_path);r||(r=[],i.set(n.relative_path,r)),r.push({start_line:n.chunk_start,end_line:n.chunk_end})}return i}function le(e,t,i,n,r){let o=t===n.relativePath?{excludeStartLine:n.startLine,excludeEndLine:n.endLine}:{},s=r?I(e,t,r,o):[];return i.flatMap(a=>fe(s,a))}function fe(e,t){let i=e.filter(n=>n>=t.start_line&&n<=t.end_line);return i.length>0?i:[t.start_line]}function ue(e,t){let i=R(e,t);return i?{match:i,identifier:d(i.symbol)||null}:null}function me(e,t){let i=[],n=new Set;for(let[r,o]of t){let s=h(e,r);for(let a of o){let c=_(s,a),l=`${r}|${a}|${c?.symbol??""}`;n.has(l)||(n.add(l),i.push({file:r,line:a,enclosingSymbol:c?.symbol??null}))}}return i}export{D as a,Se as b,ye as c,he as d,Le as e,xe as f,Y as g,g as h,Fe as i,ke as j,w as k,Ae as l,J as m,M as n,Ue as o,We as p,oe as q,nn as r};
|
|
40
|
-
//# sourceMappingURL=chunk-JB4PUN5S.js.map
|
package/dist/chunk-JTXKS5GK.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-RCJEFQOK.js";import{d as x}from"./chunk-7OX2O53H.js";import{a as d,e as g,j as y}from"./chunk-5TT47UMX.js";import{a as u}from"./chunk-NHDPYW7O.js";var C=u("definition-consumer-file-usage");function I(e,t,n){return e.callerFileMap(t,{semantic:n.semantic,sourceFallback:n.sourceFallback})}function P(e,t,n){let i=[],r=0,s=0,p=x(t.symbol);for(let a of n)D(e,a,t.relativePath,p)?r++:S(e,a,p)?s++:i.push(a);return{realConsumers:i,barrelConsumers:r,importOnlyConsumers:s}}function S(e,t,n){if(!n)return!1;let i=g(t);if(!i)return!1;let r=C.get(e,t,()=>v(e,t,i));return r.importedLeaves.has(n)&&!r.usedLeaves.has(n)}function j(e){C.invalidateAll(e)}function v(e,t,n){let i=new Set,r=new Set,s=y(e,t);if(!s)return{importedLeaves:i,usedLeaves:r};let p=n==="rust"?new Set(["use_declaration"]):n==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),a=(o,f)=>{let c=f||p.has(o.type);(o.type==="identifier"||o.type==="type_identifier"||o.type==="property_identifier"||o.type==="field_identifier")&&(c?i.add(o.text):r.add(o.text));for(let l of o.children)a(l,c)};return a(s.rootNode,!1),{importedLeaves:i,usedLeaves:r}}function D(e,t,n,i){if(!i)return!1;let r=d(e,t);if(!r)return!1;let s=b(e,t);if(s.length===0)return!1;let p=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${p}\\b`),o=r.split(`
|
|
2
|
-
`),f=0;for(let c=0;c<o.length;c++){if(!a.test(o[c]??""))continue;if(f++,!s.find(m=>m.startLine<=c&&c<=m.endLine))return!1}return f>0}export{I as a,P as b,S as c,j as d};
|
|
3
|
-
//# sourceMappingURL=chunk-JTXKS5GK.js.map
|
package/dist/chunk-KJ6CW6EK.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./chunk-NHDPYW7O.js";import{a as S}from"./chunk-NN3O7TPH.js";import{readdirSync as x}from"fs";import{extname as l,join as f}from"path";var m=[".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"],j=[".vue"],p=new Set(m.map(t=>t.toLowerCase())),g=[...p].sort().join(","),y=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function w(t,o={}){let s=o.includeIndexed??!0,i=o.includeAuxiliary??!0,e=o.extensions?.map(c=>c.toLowerCase()),r=e?new Set(e):p,u=e?[...r].sort().join(","):g,n=`${s?"1":"0"}|${i?"1":"0"}|${u}`;return h.get(t,n,()=>{let c=new Set;if(s)for(let a of S(t,{includeIgnored:!1}))r.has(l(a).toLowerCase())&&c.add(a);if(i)for(let a of E(t.config.projectRoot,r))t.isIgnored(a)||c.add(a);return[...c].sort()})}var h=d("source-files");function E(t,o){let s=new Set,i=e=>{let r=e?f(t,e):t,u;try{u=x(r,{withFileTypes:!0})}catch{return}for(let n of u)if(!y.has(n.name)){if(n.isDirectory()){i(e?`${e}/${n.name}`:n.name);continue}o.has(l(n.name).toLowerCase())&&s.add(e?`${e}/${n.name}`:n.name)}};return i(""),s}export{j as a,y as b,w as c};
|
|
2
|
-
//# sourceMappingURL=chunk-KJ6CW6EK.js.map
|
package/dist/chunk-MDAYGS6T.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b}from"./chunk-DFK54IRN.js";import{l as u,v as f}from"./chunk-7OX2O53H.js";function S(a,p){let L=b(a,p),o=f(a,L,{sort:!0});if(o.length===0)return[];let i=o.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,children:[]})),s=new Map;for(let e of i)s.set(e.symbol,e);let c=[];for(let e=0;e<o.length;e++){let r=o[e],n=i[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of i)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!u(t.symbol,n.symbol))continue;let d=t.endLine-t.startLine;d<m&&(m=d,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
|
|
2
|
-
//# sourceMappingURL=chunk-MDAYGS6T.js.map
|
package/dist/chunk-NHDPYW7O.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function l(o){let t=new WeakMap,r=a=>{let e=t.get(a);return e||(e=new Map,t.set(a,e)),e};return{get(a,e,i){let n=r(a);if(n.has(e))return n.get(e);let c=i();return n.set(e,c),c},invalidate(a,e){t.get(a)?.delete(e)},invalidateAll(a){t.delete(a)},size(a){return t.get(a)?.size??0}}}function p(o){let t=new WeakMap;return{get(r,a){let e=t.get(r);if(e)return e.value;let i=a();return t.set(r,{value:i}),i},invalidate(r){t.delete(r)},has(r){return t.has(r)}}}function b(o){let t=new WeakMap,r=a=>{let e=t.get(a);return e||(e=new Map,t.set(a,e)),e};return{get(a,e,i,n){let c=r(a),s=c.get(e);if(s&&s.source===i)return s.value;let u=n();return c.set(e,{source:i,value:u}),u},invalidate(a,e){t.get(a)?.delete(e)},invalidateAll(a){t.delete(a)}}}export{l as a,p as b,b as c};
|
|
2
|
-
//# sourceMappingURL=chunk-NHDPYW7O.js.map
|
package/dist/chunk-NKJKI6SE.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as p}from"./chunk-IODTPF5H.js";import{c as a}from"./chunk-KJ6CW6EK.js";import{b as f}from"./chunk-NHDPYW7O.js";function c(t){let r=o(t);return x(r)?"test":S(r)?"worker":y(r)?"entry":P(r)?"barrel":"source"}function _(t){return c(t)==="barrel"}function g(t){return h.get(t,()=>{let r=p(t),e=a(t).filter(s=>{let u=c(s);return u==="entry"||u==="worker"}),n=new Set,i=new Set;for(;e.length>0;){let s=e.shift();if(!n.has(s)){n.add(s),c(s)==="barrel"&&i.add(s);for(let u of r.get(s)??[])n.has(u)||e.push(u)}}return i})}var h=f("live-barrels");function b(t,r){return g(t).has(o(r))}function w(t){let r=g(t);return a(t).filter(e=>_(e)&&!r.has(e))}function D(t,r){let e=c(r);return e==="entry"||e==="worker"||b(t,r)}function E(t,r,e){let n=t.config.entryRoots;if(!n)return!1;let i=o(e);return!!(n.files?.some(s=>o(s)===i)||n.pathPrefixes?.some(s=>i.startsWith(o(s)))||n.qualifiedVars?.some(s=>$(r,s))||n.symbolPatterns?.some(s=>{try{return new RegExp(s).test(r)}catch{return!1}}))}var v=["%/__tests__/%","%.test.%","%.spec.%","%/test/%","%/tests/%","%_test.%","%_spec.%","%/test_%.%","%/spec_%.%"],B=["%/test-utils/%"];function x(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function S(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function y(t){let r=t.split("/"),e=r[r.length-1]??t;return e==="cli.ts"||e==="cli.js"||e==="postinstall.ts"||e==="postinstall.js"||e==="main.ts"||e==="main.js"||e==="main.rs"||e==="main.go"||e==="main.py"||e==="build.rs"||e==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:e==="index.ts"||e==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:r.length<=2:!1}function P(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function o(t){return t.replace(/\\/g,"/")}function $(t,r){let e=r.lastIndexOf("/");if(e<0)return!1;let n=r.slice(0,e),i=r.slice(e+1);return t.includes(l(n)+"/")&&t.includes(l(i)+".")}function l(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{c as a,_ as b,b as c,w as d,D as e,E as f,v as g,B as h};
|
|
2
|
-
//# sourceMappingURL=chunk-NKJKI6SE.js.map
|
package/dist/chunk-NYEMZHUC.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as F,b as y,d as R,e as T}from"./chunk-RKTDEIHF.js";import{c as N}from"./chunk-MX6F756F.js";import{b as k}from"./chunk-QAEDNTY7.js";import{a as M}from"./chunk-ARBZM2NF.js";import{a as A}from"./chunk-ZNUPGRPR.js";import{c as p,d as P,g as w,j as q}from"./chunk-7OX2O53H.js";import{a as z}from"./chunk-5TT47UMX.js";function ae(i,t,e={}){let{minSimilarity:s=.4,limit:r=20}=e,a=U(i,t,{semantic:e.semantic!==!1});if(!a)return[];if(!w(a.symbol))return[];let n=V(i,a,s,{scanLimit:e.scanLimit,semantic:e.semantic!==!1});return n.length>0?n.slice(0,r):K(i,t,{minSimilarity:s,limit:r})}function V(i,t,e,s){let r=v(i,{minCallees:3,excludeSymbol:t.symbol,scanLimit:s.scanLimit,semantic:s.semantic}),a=R([t,...r].map(o=>o.callees)),n=[];for(let o of r){if(o.callees.size<3)continue;let l=$(t,o,a,{minSimilarity:e,requireSignificantShared:1,requireSharedCount:0});l&&n.push(l)}return n.sort((o,l)=>l.similarity-o.similarity),n}function $(i,t,e,s){let{similarity:r,significantShared:a}=T(i.callees,t.callees,e);if(r<s.minSimilarity)return null;let n=F(i.callees,t.callees).size;if(a.length<s.requireSignificantShared&&n<s.requireSharedCount)return null;let o=a.length>0?a:[...F(i.callees,t.callees)];return{symbolA:i.symbol,shortNameA:p(i.symbol),fileA:i.file,symbolB:t.symbol,shortNameB:p(t.symbol),fileB:t.file,similarity:r,similarityBasis:"callees",sharedCallees:o.map(p),uniqueToA:[...y(i.callees,t.callees)].map(p),uniqueToB:[...y(t.callees,i.callees)].map(p)}}function le(i,t={}){let{minSimilarity:e=.5,limit:s=20,scope:r,minCallees:a=4,crossFileOnly:n=!1,scanLimit:o}=t,l=v(i,{minCallees:a,scope:r,scanLimit:o,semantic:t.semantic!==!1}),c=R(l.map(m=>m.callees)),u=new Map;for(let m of l)for(let f of m.callees)u.set(f,(u.get(f)??0)+1);let h=Math.max(8,Math.ceil(Math.sqrt(l.length))),x=new Map;for(let m=0;m<l.length;m+=1)for(let f of l[m].callees){if((u.get(f)??0)>h)continue;let g=x.get(f);g||(g=[],x.set(f,g)),g.push(m)}let C=[],L=new Set;e:for(let m=0;m<l.length;m+=1){let f=l[m],g=new Set;for(let D of f.callees){let S=x.get(D);if(S)for(let b of S)b>m&&g.add(b)}for(let D of g){let S=`${m}|${D}`;if(L.has(S))continue;L.add(S);let b=l[D];if(n&&f.file===b.file)continue;if(f.paramCount>=0&&b.paramCount>=0){let _=Math.abs(f.paramCount-b.paramCount),O=Math.max(2,Math.ceil(Math.max(f.paramCount,b.paramCount)*.5));if(_>O)continue}let B=$(f,b,c,{minSimilarity:e,requireSignificantShared:2,requireSharedCount:4});if(B&&(C.push(B),C.length>s*5))break e}}return C.sort((m,f)=>f.similarity-m.similarity),C.slice(0,s)}var Z=["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 U(i,t,e){let s=A(i,t),r=new k(i);if(!s)return null;let a=M(i,s,{semantic:e.semantic});return{symbol:s.symbol,file:s.relativePath,callees:E(a.map(n=>n.symbol)),paramCount:r.callableSignature(s)?.paramCount??-1}}function v(i,t){let{minCallees:e,scope:s,excludeSymbol:r,scanLimit:a}=t,n=new k(i),o=N(n.productionCallableDefinitions({scope:s,minLoc:5,excludeSymbol:r,sortByLocDesc:typeof a=="number"&&a>0}),a),l=n.calleeMap(o,{semantic:t.semantic!==!1});return o.map(c=>({symbol:c.symbol,file:c.relativePath,callees:E((l.get(c.symbolId)??[]).map(u=>u.symbol)),paramCount:n.callableSignature(c)?.paramCount??-1})).filter(c=>c.callees.size>=e)}function E(i){return new Set([...i].filter(t=>!W(t)))}function W(i){return Z.some(t=>i.includes(t))}function K(i,t,e){let s=G(i,t);if(!s||s.tokens.size<3)return[];let r=e.minSimilarity>=.5?e.minSimilarity:.3,a=[];for(let n of J(i)){if(n.symbol===s.symbol||n.tokens.size<3)continue;let o=F(s.tokens,n.tokens);if(o.size<2)continue;let l=new Set([...s.tokens,...n.tokens]),c=l.size>0?o.size/l.size:0;c<r||a.push({symbolA:s.symbol,shortNameA:p(s.symbol),fileA:s.file,symbolB:n.symbol,shortNameB:p(n.symbol),fileB:n.file,similarity:c,similarityBasis:"source-tokens",sharedCallees:[...o].sort(),uniqueToA:[...y(s.tokens,n.tokens)].sort(),uniqueToB:[...y(n.tokens,s.tokens)].sort()})}return a.sort((n,o)=>o.similarity-n.similarity||n.shortNameB.localeCompare(o.shortNameB)),a.slice(0,e.limit)}function G(i,t){let e=A(i,t);if(!e||!w(e.symbol))return null;let s=H(i,e);return s?{symbol:e.symbol,file:e.relativePath,tokens:s}:null}function H(i,t){let e=P(t.symbol),s=I(i,t.relativePath,t.startLine,t.endLine,e),r=j(s,e);return r.size>0?r:null}function J(i){let t=new k(i);return t.scopedDefinitions().filter(e=>e.isFunctionLike).filter(e=>t.fileKind(e.relativePath)!=="test").filter(e=>!q(e.symbol)).map(e=>({symbol:e.symbol,file:e.relativePath,tokens:j(I(i,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)})).filter(e=>e.tokens.size>0)}function I(i,t,e,s,r){let a=z(i,t);if(!a)return"";let n=a.split(`
|
|
2
|
-
`);if(s>=e&&s-e<=12)return n.slice(e,s+1).join(`
|
|
3
|
-
`);let o=[new RegExp(`\\bdef\\s+${d(r)}\\b`),new RegExp(`\\bfun\\s+${d(r)}\\b`),new RegExp(`\\bfn\\s+${d(r)}\\b`),new RegExp(`\\bfunction\\s+${d(r)}\\b`),new RegExp(`\\b${d(r)}\\s*\\(`)],l=n.findIndex(c=>o.some(u=>u.test(c)));if(l>=0){let c=l;for(let u=l+1;u<n.length&&u<=l+8;u++){let h=n[u]??"";if(u>l&&X(h)||(c=u,h.trim()===""&&u>l+1))break}return n.slice(l,c+1).join(`
|
|
4
|
-
`)}return n.slice(e,Math.min(n.length,e+8)).join(`
|
|
5
|
-
`)}function j(i,t){if(!i)return new Set;let e=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"]),s=Q(t),a=i.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(n=>n.trim()).filter(n=>n.length>1).filter(n=>!e.has(n)).filter(n=>!s.has(n));return new Set(a)}function Q(i){return new Set(i.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(t=>t.toLowerCase()).filter(t=>t.length>1))}function X(i){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(i)}function d(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{ae as a,le as b};
|
|
6
|
-
//# sourceMappingURL=chunk-NYEMZHUC.js.map
|
package/dist/chunk-OHEIZWIA.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as h,b as v,c as P}from"./chunk-JTXKS5GK.js";import{a as b,c as L}from"./chunk-MX6F756F.js";import{b as D}from"./chunk-QAEDNTY7.js";import{a as I,c as S,d as p}from"./chunk-7OX2O53H.js";import{a as y,m as x}from"./chunk-5TT47UMX.js";function ie(t,n){let{scope:e,minLoc:i=3,maxLoc:s=80,limit:r=30,includeLowConfidence:c=!1,scanLimit:l}=n??{},d=n?.semantic!==!1,a=new D(t),f=a.scopedDefinitions(e),u=V(a,e),g=L($(t,a,f,{minLoc:i,maxLoc:s}).sort((o,m)=>b(m)-b(o)||o.relativePath.localeCompare(m.relativePath)),l),F=A(a,g,{semantic:d}),k=O(t,a,f,g,{semantic:d}),R=B(g);return N(t,g,F,R).filter(o=>!k.has(o.definition.symbolId)).filter(o=>!o.transitivelyReachable).filter(o=>o.realConsumers.length<=1).filter(o=>!(o.realConsumers.length===0&&o.barrelConsumers>0)).filter(o=>Z(o.definition,o.realConsumers.length,u)).map(o=>j(t,o)).filter(o=>c||o.confidence!=="low").sort((o,m)=>{let C={high:0,medium:1,low:2};return C[o.confidence]-C[m.confidence]||m.loc-o.loc||o.file.localeCompare(m.file)||o.startLine-m.startLine}).slice(0,r)}function $(t,n,e,i){return e.filter(s=>s.isTypeLike&&b(s)>=i.minLoc).filter(s=>b(s)<=i.maxLoc).filter(s=>!t.isIgnored(s.relativePath)).filter(s=>!H(s.symbol)).filter(s=>!n.hasSuppressionComment(s))}function A(t,n,e){return h(t,n,{semantic:e.semantic})}function B(t){let n=new Map;for(let e of t){let i=n.get(e.relativePath);i||(i=new Map,n.set(e.relativePath,i));let s=p(e.symbol);s&&i.set(s,e)}return n}function N(t,n,e,i){return n.map(s=>{let c=[...e.get(s.symbolId)??new Set].filter(u=>u!==s.relativePath&&!t.isIgnored(u)),{realConsumers:l,barrelConsumers:d,importOnlyConsumers:a}=v(t,s,c),f=_(t,s,e,i);return{definition:s,realConsumers:l,barrelConsumers:d+a,transitivelyReachable:f}})}function j(t,n){let e=w(t,n.definition.relativePath,n.definition.startLine),i=T(n.definition.relativePath)?!0:q(t,n.definition),{confidence:s,reason:r}=G(n.realConsumers.length,e,i);return{symbol:n.definition.symbol,shortName:S(n.definition.symbol),file:n.definition.relativePath,startLine:n.definition.startLine,endLine:n.definition.endLine,loc:b(n.definition),consumers:n.realConsumers.length,barrelConsumers:n.barrelConsumers,kind:e,definerUsesType:i,confidence:s,reason:r}}function O(t,n,e,i,s){let r=W(t,U(e),i),c=r.map(a=>a.singleton);if(r.length===0)return new Set;let l=h(n,c,{semantic:s.semantic}),d=new Set;for(let{singleton:a,classId:f}of r)E(t,a,l)&&d.add(f);return d}function U(t){let n=new Map;for(let e of t){let i=p(e.symbol);i&&n.set(M(e.relativePath,i),e)}return n}function W(t,n,e){let i=[];for(let s of e){let r=z(t,n,s);r&&i.push({singleton:r,classId:s.symbolId})}return i}function z(t,n,e){if(w(t,e.relativePath,e.startLine)!=="class")return null;let i=p(e.symbol);if(!i)return null;let s=K(t,e.relativePath,i);return s?n.get(M(e.relativePath,s))??null:null}function E(t,n,e){let i=p(n.symbol),s=e.get(n.symbolId);return!i||!s?!1:[...s].some(r=>r!==n.relativePath&&!t.isIgnored(r)&&!P(t,r,i))}function M(t,n){return`${t}\0${n}`}function K(t,n,e){let i=y(t,n);if(!i)return null;let s=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${s}\\s*\\(`);return i.match(r)?.[1]??null}function V(t,n){return new Set(t.scopedDefinitions(n).filter(e=>e.isFunctionLike).map(e=>e.relativePath))}function H(t){let n=I(t);if("kind"in n)return!1;let e=n.descriptors;if(e.length<2)return!1;let i=e[e.length-1],s=e[e.length-2];return i?.suffix==="type"&&s?.suffix==="type"}function T(t){let e=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(e==="types"||e.endsWith("-types")||e==="models"||e==="schema"||e==="common"||e==="protocol"||e==="proto"||e==="dto"||e==="mod"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t))}function Z(t,n,e){return!(T(t.relativePath)&&n>0||n===0&&e.has(t.relativePath))}function _(t,n,e,i){let s=x(t,n.relativePath),r=p(n.symbol);if(!r)return!1;let c=s.get(r);if(!c||c.size===0)return!1;let l=i.get(n.relativePath);if(!l)return!1;for(let d of c){let a=l.get(d);if(!a)continue;let f=e.get(a.symbolId);if(f){for(let u of f)if(u!==n.relativePath&&!t.isIgnored(u))return!0}}return!1}function w(t,n,e){let i=y(t,n);if(!i)return"other";let s=i.split(`
|
|
2
|
-
`),r=Math.max(0,e-2),c=Math.min(s.length-1,e+2);for(let l=r;l<=c;l++){let a=(s[l]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(a))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(a))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(a))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(a))return"enum"}return"other"}function q(t,n){let e=y(t,n.relativePath);if(!e)return!1;let i=p(n.symbol);if(!i)return!1;let s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b${s}\\b`),c=e.split(`
|
|
3
|
-
`);for(let l=0;l<c.length;l++)if(!(l>=n.startLine&&l<=n.endLine)&&r.test(c[l]??""))return!0;return!1}function G(t,n,e){return t===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:t===1&&n==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:t===1&&!e?{confidence:"high",reason:"1 consumer + defining file never uses it \u2014 type belongs with its consumer"}:{confidence:"medium",reason:"1 consumer \u2014 single-use abstraction"}}export{ie as a};
|
|
4
|
-
//# sourceMappingURL=chunk-OHEIZWIA.js.map
|
package/dist/chunk-QAEDNTY7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as C,e as P}from"./chunk-NKJKI6SE.js";import{a as v}from"./chunk-IODTPF5H.js";import{c as Y}from"./chunk-ARBZM2NF.js";import{a as K,g as W,i as z,j as B,k as $,n as L,o as J,p as X}from"./chunk-JB4PUN5S.js";import{d as U}from"./chunk-7O4MJYIW.js";import{c as F}from"./chunk-KJ6CW6EK.js";import{f as T,g as H,i as V,j as O,s as j,t as G,u as q}from"./chunk-7OX2O53H.js";import{d as R,e as p,f as I,g as A,j as S,l as M,n as x,o as N}from"./chunk-5TT47UMX.js";import{a as _}from"./chunk-NN3O7TPH.js";var h=new WeakMap;function Ke(e,t){let i=p(t);return i==="rust"?pe(e,t):i==="typescript"||i==="tsx"||i==="javascript"?fe(e,t):[]}var ue=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]);function fe(e,t){let i=S(e,t);if(!i)return[];let o=h.get(i);if(o)return o;let r=/(^|\/)(pages|app)\/.+\.(tsx?|jsx?)$/.test(t)||/(^|\/)(layout|page|loading|error|not-found|head|template|default)\.(tsx?|jsx?)$/.test(t),n=/(^|\/)src\/(pages|views|routes)\/.+\.(tsx?|jsx?|vue)$/.test(t),s=!1,c=i.rootNode;for(let l of c.namedChildren){if(l.type!=="expression_statement")continue;let u=l.namedChild(0);if(!u||u.type!=="call_expression")continue;let f=u.namedChild(0);if(!f)continue;let d=f.type==="member_expression"?f.namedChild(f.namedChildCount-1)?.text:f.text;if(d&&ue.has(d)){s=!0;break}}let a=[];s&&a.push({startLine:0,endLine:c.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"}),(r||n)&&a.push({startLine:0,endLine:c.endPosition.row,reason:r?"Next.js / Remix route file":"Vite/Vue route component"});for(let l of c.namedChildren){let u=null,f=null;if(l.type==="function_declaration")u=l.namedChild(0)?.text??null,f=l;else if(l.type==="export_statement"){let d=l.namedChild(0);d?.type==="function_declaration"&&(u=d.namedChild(0)?.text??null,f=d)}else if(l.type==="lexical_declaration"){let d=l.namedChild(0);if(d?.type==="variable_declarator"){let b=d.namedChild(0)?.text,m=d.namedChild(1);b&&(m?.type==="arrow_function"||m?.type==="function_expression")&&(u=b,f=d)}}u&&/^use[A-Z]/.test(u)&&f&&a.push({startLine:f.startPosition.row,endLine:f.endPosition.row,reason:"React custom hook (use*)"})}return a.push(...ee(i,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),h.set(i,a),a}var de=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function me(e){return de.test(e)}function ee(e,t,i){let o=[],r=n=>{if(t.has(n.type)&&n.parent){let c=n.parent.children,a=-1;for(let l=0;l<c.length;l+=1)if(c[l].startIndex===n.startIndex&&c[l].type===n.type){a=l;break}if(a>0)for(let l=a-1;l>=0;l-=1){let u=c[l];if(i.has(u.type)){if(me(u.text)){o.push({startLine:n.startPosition.row,endLine:n.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(u.type==="attribute_item"||u.type==="inner_attribute_item"))break}}for(let s of n.namedChildren)r(s)};return r(e.rootNode),o}function pe(e,t){let i=S(e,t);if(!i)return[];let o=h.get(i);if(o)return o;let r=[],n=be(i);return n?(h.set(i,n),n):(te(i.rootNode,r,!1,!1),r.push(...ee(i,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),r.push(...Re(i.rootNode)),h.set(i,r),r)}function be(e){return xe(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)"}]:null}function te(e,t,i,o){let r=i,n=o;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(n=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)"})),e.type==="function_item"||e.type==="function_signature_item"?ye(e,t,i,o):o&&_e(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?ge(e,t,i):e.type==="mod_item"&&w(e).some(s=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(s))&&(r=!0);for(let s of e.namedChildren)te(s,t,r,n)}function ye(e,t,i,o){let r=w(e),n=null;o?n="trait impl method (dynamic dispatch)":i&&(n="inside #[cfg(test)] mod");for(let s of r){let c=Se(s);if(c){n=c;break}if(ne(s)){n="#[allow(dead_code)]";break}}n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:n})}function ge(e,t,i){let o=w(e),r=e.namedChildren.find(n=>n.type==="type_identifier")?.text;o.some(he)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:r}),o.some(ne)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:r}),i&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:r})}function w(e){let t=e.parent;if(!t)return[];let i=t.children,o=-1;for(let n=0;n<i.length;n+=1)if(i[n].startIndex===e.startIndex&&i[n].type===e.type){o=n;break}if(o<=0)return[];let r=[];for(let n=o-1;n>=0;n-=1){let s=i[n];if(s.type==="attribute_item"||s.type==="inner_attribute_item")r.push(s.text);else{if(s.type==="line_comment"||s.type==="block_comment")continue;break}}return r}function Se(e){return/#\[\s*tauri::command\b/.test(e)?"#[tauri::command]":/#\[\s*command\b/.test(e)?"#[command]":/#\[\s*test\b/.test(e)?"#[test]":/#\[\s*bench\b/.test(e)?"#[bench]":/#\[\s*tokio::test\b/.test(e)?"#[tokio::test]":/#\[\s*async_std::test\b/.test(e)?"#[async_std::test]":/#\[\s*wasm_bindgen\b/.test(e)?"#[wasm_bindgen]":/#\[\s*no_mangle\b/.test(e)?"#[no_mangle]":/#\[\s*napi\b/.test(e)?"#[napi]":/#\[\s*pyfunction\b/.test(e)?"#[pyfunction]":/#\[\s*pymethod\b/.test(e)?"#[pymethod]":/#\[\s*pyo3\b/.test(e)?"#[pyo3]":/#\[\s*cfg\s*\(\s*test\s*\)/.test(e)?"#[cfg(test)]":/#\[\s*doc\s*\(\s*hidden\s*\)/.test(e)?"#[doc(hidden)]":null}function he(e){return/#\[\s*derive\s*\(/.test(e)?/\bSerialize\b/.test(e)||/\bDeserialize\b/.test(e)||/\bFromRow\b/.test(e)||/\bDeriveEntityModel\b/.test(e)||/\bIntoSchema\b/.test(e)||/\bToSchema\b/.test(e)||/\bDeriveValueType\b/.test(e)||/\bsqlx::FromRow\b/.test(e)||/\bError\b/.test(e)||/\bthiserror::Error\b/.test(e):!1}function ne(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function _e(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function Re(e){let t=ke(e);if(t.size===0)return[];let i=[];for(let o of e.descendantsOfType("mod_item")){let r=o.childForFieldName("name")?.text;r&&t.has(r)&&i.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:r})}return i}function xe(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let i=e.namedChild(t);if(!i||i.type!=="line_comment"&&i.type!=="block_comment")break;if(/@generated\b/.test(i.text)||/This file is .*generated\b/i.test(i.text)||/Code generated by/i.test(i.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(i.text)||/openapi-generator/i.test(i.text)&&/Generated by/i.test(i.text))return!0}return!1}var Ce=[{key:"default",re:/\bdefault\s*=\s*"([^"]+)"/g},{key:"with",re:/\bwith\s*=\s*"([^"]+)"/g},{key:"serialize_with",re:/\bserialize_with\s*=\s*"([^"]+)"/g},{key:"deserialize_with",re:/\bdeserialize_with\s*=\s*"([^"]+)"/g},{key:"skip_serializing_if",re:/\bskip_serializing_if\s*=\s*"([^"]+)"/g},{key:"getter",re:/\bgetter\s*=\s*"([^"]+)"/g},{key:"rename_all_with",re:/\brename_all_with\s*=\s*"([^"]+)"/g},{key:"schema_with",re:/\bschema_with\s*=\s*"([^"]+)"/g}],ie=/^#!?\[\s*serde\s*\(/,Le=/^#!?\[\s*schemars\s*\(/,we=/^#!?\[\s*validate\s*\(/,Z=/\bwith\s*=\s*"([^"]+)"/g;function g(e,t){return x(e,t,Ee,()=>new Set,(i,o,r)=>{if(o==="rust"){for(let n of i.rootNode.descendantsOfType("attribute_item"))Q(n.text,r);for(let n of i.rootNode.descendantsOfType("inner_attribute_item"))Q(n.text,r)}})??new Set}var Ee=new WeakMap;function Q(e,t){let i=ie.test(e),o=Le.test(e),r=we.test(e);if(!(!i&&!o&&!r))for(let{re:n}of Ce){n.lastIndex=0;let s;for(;(s=n.exec(e))!==null;){let c=s[1],a=c.split("::").pop()??c;a==="is_none"&&/\bOption\b/.test(c)||a==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(c)||a&&t.add(a)}}}function ke(e){let t=new Set;for(let i of e.descendantsOfType("attribute_item")){if(!ie.test(i.text))continue;Z.lastIndex=0;let o;for(;(o=Z.exec(i.text))!==null;){let r=o[1],n=r.split("::").pop()??r;n&&t.add(n)}}return t}var De=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function re(e,t){return x(e,t,Ie,()=>new Set,(i,o,r)=>{if(!(o!=="typescript"&&o!=="tsx"&&o!=="javascript"))for(let n of i.rootNode.descendantsOfType("call_expression")){let s=n.namedChild(0);if(!s)continue;let c=N(s);if(!c||!De.has(c))continue;let a=n.namedChildren.find(f=>f.type==="arguments");if(!a)continue;let l=a.namedChild(0);if(!l||l.type!=="string")continue;let u=l.namedChildren.find(f=>f.type==="string_fragment");u&&r.add(u.text)}})??new Set}var Ie=new WeakMap;function oe(e,t,i={}){let o=new Map;if(t&&t.length===0)return o;let r=_(e,{includeIgnored:!1}),n=$(e),s=t??G(e),c=new Set(s.map(a=>a.symbolId));return Ae(e,o,r,n,c),Me(e,o,s,c),Pe(e,o,r,n,c),i.semantic!==!1&&He(o,U(e,Te(s))),o}function Ae(e,t,i,o,r){for(let n of i){if(!p(n))continue;let s=M(e,n);if(s)for(let c of s){let a=z(n,o.get(c.calleeLeaf)??[]);if(!a||a.length===0)continue;let l=B(e,n,a,c.memberAccess);l&&r.has(l.symbolId)&&l.file!==n&&E(t,l.symbolId,n)}}}function Me(e,t,i,o){let r=ve(i);for(let n of Ne(e,o))e.isIgnored(n.relative_path)||Fe(n,r.get(n.symbol_id))||E(t,n.symbol_id,n.relative_path)}function Ne(e,t){return W(e,t?[...t]:void 0)}function ve(e){let t=new Map;for(let i of e)t.set(i.symbolId,{docId:i.documentId,startLine:i.startLine,endLine:i.endLine});return t}function Fe(e,t){return!!t&&t.docId===e.document_id&&e.chunk_start>=t.startLine&&e.chunk_end<=t.endLine}function Pe(e,t,i,o,r){for(let n of i){if(p(n)!=="rust")continue;let s=g(e,n);if(s.size!==0)for(let c of s){let a=o.get(c);if(a)for(let l of a)r.has(l.symbolId)&&l.file!==n&&E(t,l.symbolId,n)}}}function E(e,t,i){let o=e.get(t);o||(o=new Set,e.set(t,o)),o.add(i)}function Te(e){return e.filter(t=>"relativePath"in t&&"symbol"in t&&"leaf"in t)}function He(e,t){for(let[i,o]of t){let r=e.get(i);r||(r=new Set,e.set(i,r));for(let n of o)r.add(n)}}var se=new WeakMap;function ae(e,t,i,o){let r=p(t);if(!r)return null;let n=S(e,t);if(!n)return null;let s=se.get(n);return s||(s=Ve(n,r),se.set(n,s)),s.get(`${i}:${o}`)??null}function Ve(e,t){let i=A(t),o=new Map,r=n=>{if(i.has(n.type)){let s=n.namedChildren.find(a=>a.type==="parameters"||a.type==="formal_parameters"),c=0;if(s)for(let a of s.namedChildren)a.type==="comment"||a.type==="line_comment"||a.type==="block_comment"||(c+=1);o.set(`${n.startPosition.row}:${n.endPosition.row}`,{paramCount:c})}for(let s of n.children)r(s)};return r(e.rootNode),o}function le(e,t,i){let o=t.identifierResolution==="strict"?L:J;for(let r of t.paths){let n=p(r);if(!(!n&&!(t.includeVueSfc&&I(r)))&&!e.isIgnored(r)&&!t.skipPath?.(r))try{let s=(a,l,u,f)=>{if(t.candidateNames&&!t.candidateNames.has(a))return;let d=t.resolveTargets?t.resolveTargets({sourceFile:r,name:a,kind:l,defaultTargets:f}):f();for(let b of d)i({sourceFile:r,name:a,target:b,occurrences:u,kind:l})},c=K(e,r);for(let[a,l]of c)s(a,"identifier",l.length,()=>o(e,r,a));if(t.includeCrossLanguageDispatchNames)for(let a of re(e,r))s(a,"cross-language-dispatch",1,()=>L(e,r,a));if(t.includeRustAttributeNames&&n==="rust")for(let a of g(e,r))s(a,"rust-attribute",1,()=>o(e,r,a))}finally{t.afterPath?.(r)}}}var ce=class{constructor(t){this.db=t}db;scopedDefinitions(t){return q(this.db,t)}definitionsForFile(t){return j(this.db,t)}productionCallableDefinitions(t={}){let{scope:i,minLoc:o=1,maxLoc:r=Number.POSITIVE_INFINITY,excludeSymbol:n,excludeEntrySurfaces:s=!1,excludeTypesFiles:c=!1,requireFunctionLikeSymbol:a=!1,requireCallableSymbol:l=!1,excludeRustTraitImplMembers:u=!1,includeSuppressed:f=!1,sortByLocDesc:d=!1}=t,b=[];for(let m of this.scopedDefinitions(i)){let y=m.relativePath;if(this.db.isIgnored(y)||s&&P(this.db,y)||!Oe(m,{requireFunctionLikeSymbol:a,requireCallableSymbol:l})||n!==void 0&&m.symbol===n)continue;let D=k(m);D<o||D>r||c&&je(y)||u&&V(m.symbol)||C(y)!=="test"&&(O(m.symbol)||!f&&R(this.db,y,m.startLine)||b.push(m))}return d?b.sort((m,y)=>k(y)-k(m)):b}calleeMap(t,i={}){return Y(this.db,t,i)}crossFileCallerMap(t,i={}){return oe(this.db,t,i)}sourceFallbackCallerFiles(t){return X(this.db,t)}callerFileMap(t,i={}){let o=this.crossFileCallerMap(t,{semantic:i.semantic});return i.sourceFallback===!1?o:Ge(o,this.sourceFallbackCallerFiles(t))}frameworkReferencedSymbolIds(t){let i=new Map;for(let r of t){if(!r.leaf)continue;let n=i.get(r.leaf)??[];n.push(r.symbolId),i.set(r.leaf,n)}let o=new Set;for(let r of _(this.db,{includeIgnored:!1}))if(p(r)==="rust")for(let n of g(this.db,r))for(let s of i.get(n)??[])o.add(s);return o}symbolsWithNonSelfCallees(t,i={}){if(t.length===0)return new Set;let o=new Map(t.map(n=>[n.symbolId,n.symbol])),r=this.calleeMap(t,i);return new Set([...r.entries()].filter(([n,s])=>{let c=o.get(n);return s.some(a=>a.symbol!==c)}).map(([n])=>n))}fileDependencyGraph(t){return v(this.db,t)}fileKind(t){return C(t)}hasSuppressionComment(t){return R(this.db,t.relativePath,t.startLine)}sourceFiles(){return F(this.db)}scanSourceReferences(t,i){le(this.db,t,i)}callableSignature(t){return ae(this.db,t.relativePath,t.startLine,t.endLine)}};function Oe(e,t){return t.requireCallableSymbol?T(e.symbol):t.requireFunctionLikeSymbol?H(e.symbol):e.isFunctionLike}function k(e){return e.endLine-e.startLine+1}function je(e){return(e.split("/").pop()??"").includes("types")}function Ge(e,t){let i=new Map;for(let[o,r]of e)i.set(o,new Set(r));for(let[o,r]of t){let n=i.get(o)??new Set;for(let s of r)n.add(s);i.set(o,n)}return i}export{Ke as a,ce as b};
|
|
2
|
-
//# sourceMappingURL=chunk-QAEDNTY7.js.map
|
package/dist/chunk-QE6MGGUY.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as d}from"./chunk-RKTDEIHF.js";import{a}from"./chunk-IODTPF5H.js";function F(n,i={}){let{minSimilarity:f=.5,limit:t=20,scope:o,filePattern:s}=i,p=i.minDeps??(s?1:3),e=g(n,{scope:o,minDeps:p}),u=[];if(s){let r=e.find(l=>l.file.includes(s));if(!r)return[];for(let l of e){if(l.file===r.file)continue;let c=m(r,l,f);c&&u.push(c)}}else for(let r=0;r<e.length;r++){for(let l=r+1;l<e.length;l++){let c=m(e[r],e[l],f);c&&u.push(c)}if(u.length>t*5)break}return u.sort((r,l)=>l.similarity-r.similarity),u.slice(0,t)}function g(n,i){let{scope:f,minDeps:t}=i,o=a(n,f),s=h(o),p=[];for(let[e,u]of o)u.size>=t&&p.push({file:e,deps:new Set([...u].filter(r=>!s.has(r)))});return p}function h(n){let i=new Set,f=n.size;if(f===0)return i;let t=new Map;for(let o of n.values())for(let s of o)t.set(s,(t.get(s)??0)+1);for(let[o,s]of t)s>=5&&s/f>.3&&i.add(o);return i}function m(n,i,f){let t=new Set;for(let e of n.deps)i.deps.has(e)&&t.add(e);if(t.size<3||n.deps.size<4||i.deps.size<4)return null;let o=d(n.deps,i.deps);if(o<f)return null;let s=[];for(let e of n.deps)i.deps.has(e)||s.push(e);let p=[];for(let e of i.deps)n.deps.has(e)||p.push(e);return{fileA:n.file,fileB:i.file,similarity:o,sharedDeps:[...t],uniqueToA:s,uniqueToB:p}}export{F as a};
|
|
2
|
-
//# sourceMappingURL=chunk-QE6MGGUY.js.map
|
package/dist/chunk-RCJEFQOK.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{B as Y,a as se,b as ne,c as b,d as oe,e as ie,f as ae,g as L,h as pe,i as U,j as ce,k as me,l as E,m as F,n as T,o as V,p as H,q as S,r as Q,s as W,x as C,y as h,z as M}from"./chunk-BOVNTAKQ.js";import{a as j,e as le,f as ue,j as R}from"./chunk-5TT47UMX.js";import{a as w}from"./chunk-NHDPYW7O.js";import{basename as de}from"path";var Ae=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function x(t){let r=[],e=0,s=0;for(let n=0;n<t.length;n++){let o=t[n];(o==="{"||o==="["||o==="(")&&e++,(o==="}"||o==="]"||o===")")&&e--,o===","&&e===0&&(r.push(t.slice(s,n)),s=n+1)}return r.push(t.slice(s)),r}function y(t,r){for(let e of t.namedChildren)if(e.type===r)return e;return null}function g(t,r){let e=new Set,s=(n,o)=>{let i=o||r.has(n.type);!i&&Ae.has(n.type)&&e.add(n.text);for(let a of n.children)s(a,i)};return s(t.rootNode,!1),e}function P(t,r,e,s,n,o,i){return{importedName:n,localName:o,sourcePath:i??S(t,s,me(r)),kind:"named",used:h(e,o),usedMembers:[]}}function f(t,r,e,s,n="named",o={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function $(t,r,e,s,n="named",o=[],i={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s,usedMembers:o,isTypeOnly:i.isTypeOnly}}function D(t,r){return{importedName:t,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function O(t,r,e={}){return{importedName:t,localName:e.localName??null,sourcePath:r,kind:"namespace",used:e.used??!0,usedMembers:e.usedMembers??[],isTypeOnly:e.isTypeOnly}}function N(t,r,e){let s=[];for(let n of t.matchAll(r)){let o=n[0];if(!o||typeof n.index!="number")continue;let i=C(t,n.index,n.index+o.length);for(let a of e(n,i))s.push(a)}return s}function I(t,r,e,s){let n=R(t,r);if(n){let o=e(n);if(o)return o}return s()}function X(t,r,e,s){let n=R(t,r),o=le(r),i=o?e[o]:void 0;return n&&i?i(n):s()}function fe(t,r,e){return I(t,r,s=>we(t,r,s),()=>ve(t,r,e))}function ve(t,r,e){return N(e,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(s,n)=>{let o=s[1]?.trim();if(!o)return[];let i=de(o).replace(/\.[^.]+$/,"");return[$(o,i,H(t,r,o),h(n,i))]})}function we(t,r,e){let s=g(e,new Set(["preproc_include"])),n=[];for(let o of e.rootNode.descendantsOfType("preproc_include")){let i=null;for(let p of o.namedChildren){if(p.type==="system_lib_string"){i=p.text.replace(/^<|>$/g,"");break}if(p.type==="string_literal"){i=p.namedChildren.find(c=>c.type==="string_content")?.text??p.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=de(i).replace(/\.[^.]+$/,"");n.push(f(i,a,H(t,r,i),s))}return n}function ge(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=n[1]?.trim(),i=n[2]?.trim()??null,a=n[0];if(!o||!a||typeof n.index!="number")continue;let p=C(e,n.index,n.index+a.length);s.push({importedName:o,localName:i,sourcePath:Q(t,r,o),kind:i?"namespace":"side-effect",used:i?h(p,i):!0,usedMembers:i?M(p,i):[]})}return s}function Se(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=n[1]?.trim();o&&s.push({specifier:o,sourcePath:Q(t,r,o)})}return s}function he(t,r,e){return X(t,r,{csharp:s=>je(t,r,s),vb:s=>Le(t,r,s)},()=>{let s=ce(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return N(e,s,(n,o)=>{let i=n[1]?.trim();if(!i)return[];let[a,p]=i.split(/\s*=\s*/),m=!!p,c=(m?p:a)?.trim()??i,l=c.split(".").pop()??c,u=m?a?.trim()??l:l;return[P(t,r,o,c,l,u,S(t,c,L))]})})}function Le(t,r,e){let s=g(e,new Set(["imports_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(u=>u.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],p=i.length>1?i[0]:null,m=a.text,c=m.split(".").pop()??m,l=p?.text??c;n.push(f(c,l,S(t,m,L),s,p?"namespace":"named"))}return n}function je(t,r,e){let s=g(e,new Set(["using_directive"])),n=[];for(let o of e.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,p;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],p=i[1]):p=i[i.length-1];let m=p.text,c=m.split(".").pop()??m,l=a?.text??c;n.push(f(c,l,S(t,m,L),s,a?"namespace":"named"))}return n}var Me=w("vue-non-script-identifiers");function xe(t,r){return Me.get(t,r,()=>{let e=new Set,s=j(t,r);if(!s)return e;let o=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))e.add(i[0]);return e})}function K(t,r,e){return I(t,r,s=>qe(t,r,s),()=>$e(t,r,e))}function $e(t,r,e){return Ye(e).flatMap(s=>Ke(t,r,s.clause,s.specifier,s.start,s.end,e))}function qe(t,r,e){let s=Ue(t,r,e),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))n.push(...Fe(t,r,e,o,s));return n}function Ue(t,r,e){let s=g(e,new Set(["import_statement"]));if(ue(r))for(let n of xe(t,r))s.add(n);return s}function Fe(t,r,e,s,n){let o=ze(s);if(!o)return[];let i=E(t,r,o),a=y(s,"import_clause");return a?We(e,a,i,n,Ve(s.text)):[D("*",i)]}function We(t,r,e,s,n){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(Je(i.text,e,s,n));else if(i.type==="namespace_import"){let a=Xe(t,i,e,s,n);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Be(i,e,s,n));return o}function Je(t,r,e,s){return f("default",t,r,e,"default",{isTypeOnly:s})}function Xe(t,r,e,s,n){let i=y(r,"identifier")?.text??"";if(!i)return null;let a=Qe(t,i);return O("*",e,{localName:i,usedMembers:a,isTypeOnly:n,used:a.length>0||s.has(i)})}function Be(t,r,e,s){let n=[];for(let o of t.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let p=i.text,m=a?.text??p;n.push(f(p,m,r,e,"named",{isTypeOnly:s||He(o.text)}))}return n}function ze(t){let r=y(t,"string");if(!r)return null;let e=y(r,"string_fragment");return e?e.text:null}function Ve(t){return/^\s*import\s+type\b/.test(t)}function He(t){return/^\s*type\b/.test(t.trim())}function Qe(t,r){let e=new Set;for(let s of t.rootNode.descendantsOfType("member_expression")){let n=s.namedChild(0),o=s.namedChild(1);!n||!o||n.type!=="identifier"||n.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&e.add(o.text)}return[...e]}function Ye(t){let r=[],e=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(e)){let o=n[0],i=n[1],a=n[2];!o||!a||typeof n.index!="number"||r.push({clause:i,specifier:a,start:n.index,end:n.index+o.length})}let s=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(s)){let o=n[0],i=n[1];!o||!i||typeof n.index!="number"||r.push({clause:null,specifier:i,start:n.index,end:n.index+o.length})}return r.sort((n,o)=>n.start-o.start)}function Ke(t,r,e,s,n,o,i){let a=E(t,r,s),p=C(i,n,o);return e?Ze(e).map(c=>({...c,sourcePath:a})).map(c=>{if(c.kind==="namespace"){let l=M(p,c.localName);return O(c.importedName,c.sourcePath,{localName:c.localName,usedMembers:l,used:l.length>0||h(p,c.localName),isTypeOnly:c.isTypeOnly})}return c.kind==="side-effect"?D(c.importedName,c.sourcePath):$(c.importedName,c.localName??"",c.sourcePath,c.localName?h(p,c.localName):!1,c.kind,[],{isTypeOnly:c.isTypeOnly})}):[D("*",a)]}function Ze(t){let r=t.trim(),e=/^type\b/.test(r),s=r.replace(/^type\s+/,""),[n,o]=Ge(s),i=[];return n&&i.push(...ye(n,e)),o&&i.push(...ye(o,e)),i}function ye(t,r){let e=t.trim();if(!e)return[];if(e.startsWith("{")){let s=e.slice(1,-1).trim();return s?x(s).map(n=>{let o=n.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[p,m]=a.split(/\s+as\s+/);return{importedName:p.trim(),localName:(m??p).trim(),kind:"named",isTypeOnly:i}}):[]}return e.startsWith("* as ")?[{importedName:"*",localName:e.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:e,kind:"default",isTypeOnly:r}]}function Ge(t){let r=0;for(let e=0;e<t.length;e++){let s=t[e];if(s==="{"&&r++,s==="}"&&r--,s===","&&r===0)return[t.slice(0,e).trim(),t.slice(e+1).trim()]}return[t.trim(),null]}function Z(t,r,e){let s=R(t,r);return s?ot(t,r,s):et(t,r,e)}function et(t,r,e){return[...tt(t,r,e),...rt(t,r,e),...st(t,r,e)]}function tt(t,r,e){let s=[],n=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",p=x(i).map(l=>nt(l.trim())).filter(l=>!!l),m=q(e,o.index),c=q(e,o.index+o[0].length-1);s.push({kind:"named",sourcePath:E(t,r,a),names:p,startLine:m,endLine:c})}return s}function rt(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[2]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star-as",sourcePath:E(t,r,i),names:[],startLine:a,endLine:p})}return s}function st(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star",sourcePath:E(t,r,i),names:[],startLine:a,endLine:p})}return s}function nt(t){if(!t)return null;let r=t.replace(/^type\s+/,"").trim();if(!r)return null;let e=r.match(/^(\w+)\s+as\s+(\w+)$/);if(e)return e[2]??null;let s=r.match(/^(\w+)$/);return s?s[1]??null:null}function q(t,r){let e=0;for(let s=0;s<r&&s<t.length;s++)t.charCodeAt(s)===10&&e++;return e}function ot(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("export_statement")){let o=it(t,r,n);if(o===void 0)continue;let i=n.startPosition.row,a=n.endPosition.row,p=at(n,o,i,a);s.push(p)}return s}function it(t,r,e){let s=y(e,"string");if(!s)return;let n=y(s,"string_fragment");if(n)return E(t,r,n.text)}function at(t,r,e,s){let n=y(t,"export_clause");if(n){let i=[];for(let a of n.namedChildren){if(a.type!=="export_specifier")continue;let p=a.namedChild(0),m=a.namedChild(1);p&&i.push((m??p).text)}return{kind:"named",sourcePath:r,names:i,startLine:e,endLine:s}}return y(t,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:e,endLine:s}:{kind:"star",sourcePath:r,names:[],startLine:e,endLine:s}}function Ne(t,r,e){return X(t,r,{java:s=>pt(t,r,s),kotlin:s=>ct(t,r,s),scala:s=>mt(t,r,s)},()=>N(e,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(s,n)=>{let o=s[1]?.trim();return o?lt(t,r,o,n):[]}))}function pt(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(l=>l.type==="asterisk"),p=o.namedChildren.find(l=>l.type==="scoped_identifier")??o.namedChildren.find(l=>l.type==="identifier");if(!p)continue;let m=p.text;if(i){n.push(O("*",S(t,m,b)));continue}let c=m.split(".").pop()??m;n.push(f(c,c,S(t,m,b),s))}return n}function ct(t,r,e){let s=g(e,new Set(["import_header","import_list"])),n=[];for(let o of e.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(d=>d.type==="identifier");if(!i)continue;let a=o.namedChildren.some(d=>d.type==="wildcard_import"),p=o.namedChildren.find(d=>d.type==="import_alias");if(a){n.push(O("*",S(t,i.text,b)));continue}let m=i.text,c=m.split(".").pop()??m,u=p?.namedChild(0)?.text??c;n.push(f(c,u,S(t,m,b),s))}return n}function mt(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(l=>l.type==="namespace_selectors"||l.type==="namespace_wildcard"),a=o.namedChildren.filter(l=>l!==i&&(l.type==="identifier"||l.type==="stable_identifier")),p=a.map(l=>l.text).join(".");if(!p)continue;if(i?.type==="namespace_wildcard"){n.push(O("*",S(t,p,b)));continue}if(i?.type==="namespace_selectors"){for(let l of i.namedChildren)if(l.type==="arrow_renamed_identifier"){let[u,d]=l.namedChildren;if(!u)continue;let _=u.text,A=d?.text??_;if(_==="_")continue;n.push(f(_,A,S(t,`${p}.${_}`,b),s))}else if(l.type==="identifier"){let u=l.text;n.push(f(u,u,S(t,`${p}.${u}`,b),s))}continue}let m=a[a.length-1]?.text??p,c=a.slice(0,-1).map(l=>l.text).join(".")||p;n.push(f(m,m,S(t,c&&a.length>1?`${c}.${m}`:p,b),s))}return n}function lt(t,r,e,s){if(e.includes("{")&&e.includes("}")){let n=e.slice(0,e.indexOf("{")).replace(/\.$/,"").trim(),o=e.slice(e.indexOf("{")+1,e.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,m]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),c=p?.trim();if(!c||c==="_")return[];let l=(m??c.split(".").pop()??c).trim(),u=c==="_"?n:`${n}.${c}`.replace(/\.\./g,".");return[P(t,r,s,u,c,l)]})}return[P(t,r,s,e,e.split(".").pop()??e,e.split(".").pop()??e)]}function be(t,r,e){return I(t,r,s=>ut(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?x(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,m]=a.split(/\s+as\s+/i),c=p?.trim()??a,l=c.split("\\").pop()??c,u=(m??l).trim();return[P(t,r,n,c,l,u,S(t,c.replace(/\\/g,"."),U))]}):[]}))}function ut(t,r,e){let s=g(e,new Set(["namespace_use_declaration"])),n=[],o=(i,a,p)=>{n.push(f(a,p,S(t,i.replace(/\\/g,"."),U),s))};for(let i of e.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(p=>p.type==="namespace_use_group");if(a){let p=i.namedChildren.find(m=>m.type==="namespace_name")?.text??"";for(let m of a.namedChildren){if(m.type!=="namespace_use_clause")continue;let{importedName:c,localName:l,qualified:u}=Ie(m,p);c&&o(u,c,l)}continue}for(let p of i.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:m,localName:c,qualified:l}=Ie(p,"");m&&o(l,m,c)}}return n}function Ie(t,r){let e=t.namedChildren.find(m=>m.type==="qualified_name"),s=t.namedChildren.filter(m=>m.type==="name"),n="";e?n=e.text:s.length>=1&&(n=s[0].text);let o=e&&s.length>0?s[s.length-1]:null,i=n.split("\\").pop()??n,a=o?.text??i,p=r?`${r}\\${n}`:n;return{importedName:i,localName:a,qualified:p}}function _e(t,r,e){return I(t,r,s=>dt(t,r,s),()=>gt(e).flatMap(s=>ht(t,r,s,e)))}function dt(t,r,e){let s=g(e,new Set(["import_statement","import_from_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=Pe(i);if(!a)continue;let p=F(t,r,a.qualifiedName);n.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:p,kind:"namespace",used:s.has(a.localName),usedMembers:[]})}for(let o of e.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=ft(i);if(a===null)continue;let p=F(t,r,a);for(let m=1;m<o.namedChildCount;m+=1){let c=o.namedChild(m);if(c.type==="wildcard_import"){n.push({importedName:"*",localName:null,sourcePath:p,kind:"side-effect",used:!0,usedMembers:[]});continue}let l=Pe(c);l&&n.push({importedName:l.qualifiedName,localName:l.localName,sourcePath:p,kind:"named",used:s.has(l.localName),usedMembers:[]})}}return n}function Pe(t){if(t.type==="aliased_import"){let r=t.namedChild(0),e=t.namedChild(1);return!r||!e?null:{qualifiedName:r.text,localName:e.text}}if(t.type==="dotted_name"){let r=t.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return t.type==="identifier"?{qualifiedName:t.text,localName:t.text}:null}function ft(t){if(t.type==="dotted_name")return t.text;if(t.type==="relative_import"){let r=y(t,"import_prefix")?.text??"",e=y(t,"dotted_name")?.text??"";return`${r}${e}`}return null}function gt(t){let r=t.split(`
|
|
2
|
-
`),e=[],s=0;for(let n=0;n<r.length;n++){let o=r[n],i=o.trimStart(),a=s;if(s+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let p=o,m=a+o.length,c=Y(o);for(;n+1<r.length&&(c>0||p.trimEnd().endsWith("\\"));){n++;let u=r[n];p+=`
|
|
3
|
-
${u}`,m+=1+u.length,c+=Y(u),s+=u.length+1}let l=St(p);l&&e.push({...l,start:a,end:m})}return e}function St(t){let r=t.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let e=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!e)return null;let s=e[2].trim();return s.startsWith("(")&&s.endsWith(")")&&(s=s.slice(1,-1).trim()),{kind:"from",module:e[1],clause:s}}function ht(t,r,e,s){let n=C(s,e.start,e.end),o=e.clause.replace(/\n/g," ").trim();if(e.kind==="import")return x(o).flatMap(p=>{let m=p.trim().replace(/,$/,"");if(!m)return[];let[c,l]=m.split(/\s+as\s+/),u=c.trim(),d=(l??u.split(".")[0]??u).trim(),_=F(t,r,u),A=M(n,d);return[{importedName:u,localName:d,sourcePath:_,kind:"namespace",used:h(n,d)||A.length>0,usedMembers:A}]});let i=e.module?F(t,r,e.module):null,a=[];for(let p of x(o)){let m=p.trim().replace(/,$/,"");if(!m)continue;if(m==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[c,l]=m.split(/\s+as\s+/),u=(l??c).trim();a.push({importedName:c.trim(),localName:u,sourcePath:i,kind:"named",used:h(n,u),usedMembers:[]})}return a}import{basename as xt}from"path";function Ee(t,r,e){return I(t,r,s=>Nt(t,r,s),()=>yt(t,r,e))}function yt(t,r,e){return N(e,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(s,n)=>{let o=s[1],i=s[2];if(!o||!i)return[];let a=o==="require_relative"?V(t,r,i):null;if(a){let p=Te(i);return[$(p,p,a,h(n,p))]}return[D(i,a)]})}function Nt(t,r,e){let s=g(e,new Set([])),n=[],o=new Set(["require","require_relative","load"]);for(let i of e.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let m=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!m||m.type!=="string")continue;let l=m.namedChildren.find(d=>d.type==="string_content")?.text;if(!l)continue;let u=a.text==="require_relative"?V(t,r,l):null;if(u){let d=Te(l);n.push(f(d,d,u,s))}else n.push(D(l,u))}return n}function Te(t){return xt(t).replace(/\.[^.]+$/,"").split("_").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")}function Ce(t,r,e){return I(t,r,s=>It(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?bt(t,r,o,n):[]}))}function It(t,r,e){let s=g(e,new Set(["use_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of J(i,"")){if(!a.importedName||a.importedName==="*")continue;let p=T(t,r,a.qualifiedName)??T(t,r,a.qualifiedName.split("::").slice(0,-1).join("::"));n.push(f(a.importedName,a.localName,p,s))}}return n}function J(t,r){switch(t.type){case"identifier":case"super":case"self":case"crate":{let e=t.text;return[{qualifiedName:B(r,e),importedName:e,localName:e}]}case"scoped_identifier":{let e=t.text,s=e.split("::").pop()??e;return[{qualifiedName:B(r,e),importedName:s,localName:s}]}case"scoped_use_list":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=B(r,e.text),o=[];for(let i of s.namedChildren)o.push(...J(i,n));return o}case"use_list":{let e=[];for(let s of t.namedChildren)e.push(...J(s,r));return e}case"use_as_clause":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=J(e,r),o=s.text;return n.map(i=>({...i,localName:o}))}case"use_wildcard":{let e=t.namedChild(0),s=e?e.text:"";return[{qualifiedName:B(r,`${s}::*`),importedName:"*",localName:"*"}]}default:return[]}}function B(t,r){return t?r?`${t}::${r}`:t:r}function bt(t,r,e,s){let n=e.trim();if(n.includes("{")&&n.includes("}")){let c=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),l=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return x(l).flatMap(u=>{let d=u.trim();if(!d||d==="self")return[];let[_,A]=d.split(/\s+as\s+/),v=_?.trim();if(!v)return[];let Oe=(A??v.split("::").pop()??v).trim(),ke=`${c}::${v}`.replace(/::::/g,"::");return[P(t,r,s,ke,v.split("::").pop()??v,Oe,T(t,r,c))]})}let[o,i]=n.split(/\s+as\s+/),a=o?.trim()??n,p=(i??a.split("::").pop()??a).trim(),m=T(t,r,a)??T(t,r,a.split("::").slice(0,-1).join("::"));return[P(t,r,s,a,a.split("::").pop()??a,p,m)]}function Re(t,r,e){let s=R(t,r);if(s)return Pt(t,r,s);let n=[];for(let o of e.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&n.push(...Et(t,r,i))}return n}function Pt(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("use_declaration")){if(!_t(n))continue;let o=n.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of J(o,""))i.importedName&&s.push(G(t,r,i.qualifiedName))}return s}function _t(t){for(let r of t.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Et(t,r,e){let s=e.trim();if(s.includes("{")&&s.includes("}")){let n=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),o=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[p]=a.split(/\s+as\s+/),m=`${n}::${p?.trim()??a}`.replace(/::::/g,"::");return[G(t,r,m)]})}return[G(t,r,s)]}function G(t,r,e){return{specifier:e,sourcePath:T(t,r,e)??T(t,r,e.split("::").slice(0,-1).join("::"))}}function k({language:t,extensions:r,imports:e,parseImports:s}){return{language:t,extensions:r,capabilities:{imports:e},parseImports:s}}function De(t,r){let e=r.toLowerCase();for(let s of t)for(let n of s.extensions)if(e.endsWith(n))return s;return null}var Tt={language:"javascript",extensions:se,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:K,parseReExports:Z},Ct=k({language:"python",extensions:ne,imports:"ast-with-regex-fallback",parseImports:_e}),Rt=k({language:"jvm",extensions:b,imports:"ast-dispatch-with-regex-fallback",parseImports:Ne}),Dt={language:"rust",extensions:oe,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:Ce,parseExports:Re},Ot=k({language:"ruby",extensions:ie,imports:"ast-with-regex-fallback",parseImports:Ee}),kt=k({language:"c/cpp",extensions:ae,imports:"ast-with-regex-fallback",parseImports:fe}),At=k({language:"dotnet",extensions:L,imports:"ast-dispatch-with-regex-fallback",parseImports:he}),vt={language:"dart",extensions:pe,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:ge,parseExports:Se},wt=k({language:"php",extensions:U,imports:"ast-with-regex-fallback",parseImports:be}),Lt=[Tt,Ct,Rt,Dt,Ot,kt,At,vt,wt];function z(t){return De(Lt,t)}var ee=w("source-imports"),te=w("source-exports"),re=w("source-reexports");function Yr(t,r){let e=W(r);return re.get(t,e,()=>{let s=z(e);if(!s?.parseReExports)return[];let n=j(t,e);return n?s.parseReExports(t,e,n):[]})}function Kr(t,r){let e=W(r);return ee.get(t,e,()=>{let s=z(e);if(!s)return[];let n=j(t,e);return n?s.parseImports(t,e,n):[]})}function Zr(t,r){let e=W(r);return te.get(t,e,()=>{let s=z(e);if(!s?.parseExports)return[];let n=j(t,e);return n?s.parseExports(t,e,n):[]})}function Gr(t){ee.invalidateAll(t),te.invalidateAll(t),re.invalidateAll(t)}function es(t,r){let e=W(r);ee.invalidate(t,e),te.invalidate(t,e),re.invalidate(t,e)}export{Yr as a,Kr as b,Zr as c,Gr as d,es as e};
|
|
4
|
-
//# sourceMappingURL=chunk-RCJEFQOK.js.map
|
package/dist/chunk-TGK5DFBJ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as i}from"./chunk-MX6F756F.js";import{a,b as m}from"./chunk-ARBZM2NF.js";import{a as r}from"./chunk-ZNUPGRPR.js";import{c as s}from"./chunk-7OX2O53H.js";function h(t,n,c={}){let e=r(t,n);if(!e)return null;let o=c.semantic!==!1,y=m(t,e,{limit:50,semantic:o}),b=i(a(t,e,{limit:50,additive:!0,callableOnly:!0,semantic:o}));return{symbol:e.symbol,shortName:s(e.symbol),callers:y.map(l=>({symbol:l.symbol,shortName:s(l.symbol),file:l.file})),callees:b.map(l=>({symbol:l.symbol,shortName:s(l.symbol),file:l.file}))}}export{h as a};
|
|
2
|
-
//# sourceMappingURL=chunk-TGK5DFBJ.js.map
|
package/dist/chunk-TRNAQABL.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as D,b as L}from"./chunk-JTXKS5GK.js";import{a as M}from"./chunk-V76FCF5F.js";import{a as C,b as F}from"./chunk-MX6F756F.js";import{b as I}from"./chunk-QAEDNTY7.js";import{a as b}from"./chunk-JB4PUN5S.js";import{c as f,d,j as p,w as g}from"./chunk-7OX2O53H.js";import{basename as c,extname as m}from"path";function q(t,n){let{scope:e,maxLoc:r=15,limit:a=30,scanLimit:o}=n??{},i=new I(t),s=k(i.fileDependencyGraph(e));return M({candidates:()=>x(i,e,r),orderCandidates:F,scanLimit:o,prepare:l=>({callerFileMap:D(i,l,{semantic:n?.semantic!==!1}),reverseFanIn:s}),evaluate:(l,u)=>h(t,i,l,u),orderResults:(l,u)=>u.callerFanIn-l.callerFanIn||u.loc-l.loc,limit:a})}function h(t,n,e,r){let a=S(t,n,e,r.callerFileMap);if(a.length!==1)return null;let o=a[0],i=y(t,e.symbolId,o);if(!i)return null;let s=v(n,t,o,e.symbol,i);if(s&&p(s.symbol))return null;let l=P(r.callerFileMap,r.reverseFanIn,o,s);return l<=3?null:{symbol:e.symbol,shortName:f(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:C(e),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?f(s.symbol):c(o),callerFanIn:l}}function x(t,n,e){return t.productionCallableDefinitions({scope:n,minLoc:2,maxLoc:e,requireFunctionLikeSymbol:!0})}function S(t,n,e,r){let a=c(e.relativePath,m(e.relativePath)),o=[...r.get(e.symbolId)??[]].filter(i=>i!==e.relativePath).filter(i=>c(i,m(i))!==a).filter(i=>{let s=n.fileKind(i);return s!=="barrel"&&s!=="entry"&&s!=="test"});return L(t,e,o).realConsumers}function y(t,n,e){return t.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 v(t,n,e,r,a){let o=t.definitionsForFile(e),i=_(n,e,r,a.start_line,a.end_line);return g(o,i)}function P(t,n,e,r){if(r?.isFunctionLike){let a=[...t.get(r.symbolId)??[]].filter(o=>o!==r.relativePath);if(a.length>0)return a.length}return N(n,e)}function _(t,n,e,r,a){let o=d(e);if(!o)return r;let i=b(t,n).get(o);if(!i||i.length===0)return r;for(let s of i)if(s>=r&&s<=a)return s;return r}function k(t){let n=new Map;for(let[e,r]of t){n.has(e)||n.set(e,n.get(e)??0);for(let a of r)n.set(a,(n.get(a)??0)+1)}return n}function N(t,n){let e=t.get(n)??0;if(e>0)return e;let r=c(n,m(n)),a=0;for(let[o,i]of t)o!==n&&c(o,m(o))===r&&i>a&&(a=i);return a}export{q as a};
|
|
7
|
-
//# sourceMappingURL=chunk-TRNAQABL.js.map
|
package/dist/chunk-V53J46BX.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as a}from"./chunk-QAEDNTY7.js";import{a as i}from"./chunk-ZNUPGRPR.js";import{c as s,e as o,k as m}from"./chunk-7OX2O53H.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-V53J46BX.js.map
|
package/dist/chunk-XO6R3X5J.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as b,c as p}from"./chunk-MX6F756F.js";import{b as g}from"./chunk-QAEDNTY7.js";import{c as d}from"./chunk-7OX2O53H.js";function M(n,l={}){let{scope:e,minLoc:s=10,minCallees:o=6,limit:t=20,scanLimit:i}=l,r=new g(n),c=r.productionCallableDefinitions({scope:e,minLoc:s,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),f=p(c,i),h=r.calleeMap(f,{semantic:l.semantic!==!1}),m=[];for(let a of f){let u=S(a,h.get(a.symbolId)??[],o);u&&m.push(u)}return m.sort((a,u)=>u.clusters.length-a.clusters.length||u.loc-a.loc),m.slice(0,t)}function S(n,l,e){let s=new Set(l.map(r=>r.symbol));if(s.size<e)return null;let o=C(s,l),t=y(s,o);if(t.length<2)return null;let i=x(t,o);return i.length===0?null:{symbol:n.symbol,shortName:d(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:b(n),totalCallees:s.size,clusters:i}}function C(n,l){let e=new Map;for(let o of n)e.set(o,new Set);let s=new Map;for(let o of l){let t=s.get(o.chunkId);t||(t=new Set,s.set(o.chunkId,t)),t.add(o.symbol)}for(let o of s.values()){let t=[...o];for(let i=0;i<t.length;i++)for(let r=i+1;r<t.length;r++)e.get(t[i]).add(t[r]),e.get(t[r]).add(t[i])}return e}function y(n,l){let e=new Set,s=[];for(let o of n){if(e.has(o))continue;let t=new Set,i=[o];for(;i.length>0;){let r=i.pop();if(!e.has(r)){e.add(r),t.add(r);for(let c of l.get(r)??[])e.has(c)||i.push(c)}}s.push(t)}return s}function x(n,l){return n.filter(e=>e.size>=3).map(e=>L(e,n,l)).filter(e=>e.isolation>.5).sort((e,s)=>s.isolation-e.isolation)}function L(n,l,e){let s=new Set;for(let r of l)if(r!==n)for(let c of r)s.add(c);let o=0;for(let r of n)for(let c of e.get(r)??[])s.has(c)&&o++;let t=n.size*s.size,i=t>0?1-o/t:1;return{callees:[...n].map(d),isolation:i}}export{M as a};
|
|
2
|
-
//# sourceMappingURL=chunk-XO6R3X5J.js.map
|
package/dist/chunk-YSZNAG4G.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as f}from"./chunk-MX6F756F.js";import{b}from"./chunk-QAEDNTY7.js";import{a as c,b as u}from"./chunk-ARBZM2NF.js";import{c as l}from"./chunk-7OX2O53H.js";function w(o,e={}){let{limit:r=20,scope:s,minFanIn:i=2,minFanOut:n=2,scanLimit:a}=e,p=new b(o);return f(p.productionCallableDefinitions({scope:s,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof a=="number"&&a>0}),a).map(t=>y(o,t,e.semantic!==!1)).filter(t=>t.fanIn>=i&&t.fanOut>=n).sort((t,m)=>m.score-t.score||m.fanIn-t.fanIn).slice(0,r)}function y(o,e,r){let s=new Set(u(o,e,{limit:500,semantic:r}).map(n=>n.file)).size,i=new Set(c(o,e,{limit:500,semantic:r}).filter(n=>n.file!==e.relativePath).map(n=>`${n.symbol}|${n.file}`)).size;return{symbol:e.symbol,shortName:l(e.symbol),fanIn:s,fanOut:i,score:s*i,definedIn:e.relativePath}}export{w as a};
|
|
2
|
-
//# sourceMappingURL=chunk-YSZNAG4G.js.map
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { S as ScipDatabase } from './db-DdTPetj5.js';
|
|
2
|
-
import { stats } from './queries/stats.js';
|
|
3
|
-
|
|
4
|
-
interface CountLocSummary {
|
|
5
|
-
count: number;
|
|
6
|
-
loc: number;
|
|
7
|
-
}
|
|
8
|
-
interface StaleSummary extends CountLocSummary {
|
|
9
|
-
unused: number;
|
|
10
|
-
singleUse: number;
|
|
11
|
-
}
|
|
12
|
-
interface DriftSummary {
|
|
13
|
-
count: number;
|
|
14
|
-
unusedImports: number;
|
|
15
|
-
layerViolations: number;
|
|
16
|
-
}
|
|
17
|
-
interface ComplexitySummary {
|
|
18
|
-
top: Array<{
|
|
19
|
-
symbol: string;
|
|
20
|
-
score: number;
|
|
21
|
-
}>;
|
|
22
|
-
extremeCount: number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface HealthAction {
|
|
26
|
-
category: string;
|
|
27
|
-
description: string;
|
|
28
|
-
effort: 'low' | 'medium' | 'high';
|
|
29
|
-
impact: 'low' | 'medium' | 'high';
|
|
30
|
-
count: number;
|
|
31
|
-
locRecoverable: number;
|
|
32
|
-
}
|
|
33
|
-
interface HealthReport {
|
|
34
|
-
score: number;
|
|
35
|
-
overview: {
|
|
36
|
-
documents: number;
|
|
37
|
-
symbols: number;
|
|
38
|
-
indexSizeBytes: number;
|
|
39
|
-
};
|
|
40
|
-
findings: {
|
|
41
|
-
deadSymbols: number;
|
|
42
|
-
deadLoc: number;
|
|
43
|
-
isolatedSymbols: number;
|
|
44
|
-
isolatedLoc: number;
|
|
45
|
-
cycles: number;
|
|
46
|
-
similarPairs: number;
|
|
47
|
-
extractionCandidates: number;
|
|
48
|
-
wrappers: number;
|
|
49
|
-
passthroughs: number;
|
|
50
|
-
staleTypes: number;
|
|
51
|
-
driftedFiles: number;
|
|
52
|
-
complexityHotspotCount: number;
|
|
53
|
-
};
|
|
54
|
-
actions: HealthAction[];
|
|
55
|
-
topComplexity: Array<{
|
|
56
|
-
symbol: string;
|
|
57
|
-
score: number;
|
|
58
|
-
}>;
|
|
59
|
-
warnings?: string[];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
declare const HEALTH_PHASES: readonly ["overview", "dead", "isolated", "cycles", "similar", "extract-candidates", "wrapper-candidates", "passthrough-candidates", "stale-abstractions", "drift", "complexity-hotspots"];
|
|
63
|
-
type HealthPhaseName = typeof HEALTH_PHASES[number];
|
|
64
|
-
type HealthPhaseResult = {
|
|
65
|
-
phase: 'overview';
|
|
66
|
-
statsResult: ReturnType<typeof stats>;
|
|
67
|
-
warnings: string[];
|
|
68
|
-
} | {
|
|
69
|
-
phase: 'dead';
|
|
70
|
-
dead: CountLocSummary;
|
|
71
|
-
} | {
|
|
72
|
-
phase: 'isolated';
|
|
73
|
-
isolated: CountLocSummary;
|
|
74
|
-
} | {
|
|
75
|
-
phase: 'cycles';
|
|
76
|
-
realCycleCount: number;
|
|
77
|
-
} | {
|
|
78
|
-
phase: 'similar';
|
|
79
|
-
similarCount: number;
|
|
80
|
-
} | {
|
|
81
|
-
phase: 'extract-candidates';
|
|
82
|
-
extractCount: number;
|
|
83
|
-
} | {
|
|
84
|
-
phase: 'wrapper-candidates';
|
|
85
|
-
wrappers: CountLocSummary;
|
|
86
|
-
} | {
|
|
87
|
-
phase: 'passthrough-candidates';
|
|
88
|
-
passthroughs: CountLocSummary;
|
|
89
|
-
} | {
|
|
90
|
-
phase: 'stale-abstractions';
|
|
91
|
-
stale: StaleSummary;
|
|
92
|
-
} | {
|
|
93
|
-
phase: 'drift';
|
|
94
|
-
drift: DriftSummary;
|
|
95
|
-
} | {
|
|
96
|
-
phase: 'complexity-hotspots';
|
|
97
|
-
complexity: ComplexitySummary;
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* Single composite health report that runs all de-bloat analyses
|
|
101
|
-
* and produces a prioritized action list.
|
|
102
|
-
*
|
|
103
|
-
* The scoring formula accounts for common false positives:
|
|
104
|
-
* - Entry points (CLI, workers, barrels) appearing as "dead code"
|
|
105
|
-
* - Typed result interfaces with 1 consumer (normal for APIs)
|
|
106
|
-
* - Consistent import patterns across sibling modules (not duplication)
|
|
107
|
-
* - Barrel and orchestrator files deviating from sibling patterns (expected)
|
|
108
|
-
*/
|
|
109
|
-
declare function health(db: ScipDatabase, opts?: {
|
|
110
|
-
scope?: string;
|
|
111
|
-
full?: boolean;
|
|
112
|
-
}): HealthReport;
|
|
113
|
-
declare function healthPhase(db: ScipDatabase, phase: HealthPhaseName, opts?: {
|
|
114
|
-
scope?: string;
|
|
115
|
-
full?: boolean;
|
|
116
|
-
}): HealthPhaseResult;
|
|
117
|
-
declare function healthReportFromPhases(phaseResults: HealthPhaseResult[]): HealthReport;
|
|
118
|
-
|
|
119
|
-
export { HEALTH_PHASES as H, type HealthAction as a, type HealthReport as b, healthPhase as c, healthReportFromPhases as d, type HealthPhaseName as e, health as h };
|