scip-query 0.12.0 → 0.13.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 +1 -0
- package/dist/{chunk-ECVXWZ4Q.js → chunk-27HMTUJE.js} +2 -2
- package/dist/{chunk-2LQWMYG4.js → chunk-27XEGMCT.js} +2 -2
- package/dist/{chunk-NKT5EMEX.js → chunk-2TPCIPYA.js} +2 -2
- package/dist/{chunk-ZOIPAYRP.js → chunk-2XRXEIRK.js} +2 -2
- package/dist/{chunk-Q3B3FNCU.js → chunk-3AMWF6V5.js} +2 -2
- package/dist/{chunk-BVNO67DB.js → chunk-3H5OSDF7.js} +2 -2
- package/dist/{chunk-D64L53WX.js → chunk-43GKP6LI.js} +2 -2
- package/dist/{chunk-F5BJSNU5.js → chunk-44P4SJFN.js} +2 -2
- package/dist/{chunk-T7VQG55Q.js → chunk-5JRMZMLM.js} +2 -2
- package/dist/{chunk-72MFTCU5.js → chunk-5VY3RIEI.js} +2 -2
- package/dist/{chunk-D7J6GZAG.js → chunk-6JUAGXR4.js} +2 -2
- package/dist/{chunk-NQ75OVUU.js → chunk-6KDOYKCB.js} +2 -2
- package/dist/chunk-6KMTPNZL.js +3 -0
- package/dist/{chunk-TTMKELT7.js → chunk-72FR7KEZ.js} +2 -2
- package/dist/{chunk-FXG3PHVW.js → chunk-7COVQPQQ.js} +6 -6
- package/dist/{chunk-MBKJ7GHT.js → chunk-7TVFPOD7.js} +2 -2
- package/dist/{chunk-M72ZFN6E.js → chunk-A6KSEIRN.js} +2 -2
- package/dist/{chunk-52Q4JFDW.js → chunk-AAMURYOK.js} +2 -2
- package/dist/{chunk-XEMQUN3Z.js → chunk-BP7S6V3M.js} +2 -2
- package/dist/{chunk-ETU2I5JM.js → chunk-BRBF3E5X.js} +2 -2
- package/dist/{chunk-V7CVBPWX.js → chunk-BUNDZ6K2.js} +2 -2
- package/dist/{chunk-NAH5EAZS.js → chunk-BZXE3HO4.js} +2 -2
- package/dist/{chunk-AZLKLZ5S.js → chunk-CXQQOXSI.js} +2 -2
- package/dist/{chunk-RIQED5OU.js → chunk-EDSD3VJK.js} +2 -2
- package/dist/chunk-EVZSAR3S.js +2 -0
- package/dist/{chunk-L2CX5GHZ.js → chunk-GMOEX7EV.js} +2 -2
- package/dist/{chunk-O3WDE26W.js → chunk-GUDKRIGW.js} +2 -2
- package/dist/{chunk-MKM7NBZK.js → chunk-GULVO6NF.js} +2 -2
- package/dist/{chunk-V3Z3IOWO.js → chunk-GY3HAWUA.js} +2 -2
- package/dist/{chunk-G2UBOONK.js → chunk-HV27H2V2.js} +2 -2
- package/dist/chunk-HZZQKNVE.js +2 -0
- package/dist/{chunk-T6NGEV5I.js → chunk-I4R3SNMR.js} +2 -2
- package/dist/{chunk-UAHZ57BR.js → chunk-IMQFJ53K.js} +2 -2
- package/dist/{chunk-NJJ7AS4F.js → chunk-IUSSGHJO.js} +2 -2
- package/dist/{chunk-OVMUVXKQ.js → chunk-JJUX2OAP.js} +2 -2
- package/dist/chunk-JZBGTSAB.js +13 -0
- package/dist/{chunk-YPKBZ77R.js → chunk-K5N5RNGM.js} +2 -2
- package/dist/{chunk-OSWF3HSF.js → chunk-K7SPOJHZ.js} +2 -2
- package/dist/{chunk-BCNT6ODA.js → chunk-KSJ544IV.js} +2 -2
- package/dist/{chunk-HSU3M25J.js → chunk-KYB7FPXT.js} +2 -2
- package/dist/{chunk-ORBRX2QJ.js → chunk-LY7NMOBW.js} +2 -2
- package/dist/{chunk-CW3KZ7UF.js → chunk-M7EEHYSU.js} +2 -2
- package/dist/{chunk-U7I373V4.js → chunk-N23FT4EZ.js} +2 -2
- package/dist/{chunk-ZRIOGL7F.js → chunk-N2OTJWC2.js} +2 -2
- package/dist/{chunk-PH7ZFK6L.js → chunk-NCVFKOLB.js} +2 -2
- package/dist/{chunk-2QGE5AEP.js → chunk-NOKUZU56.js} +2 -2
- package/dist/{chunk-BP2NAIAZ.js → chunk-OXTM2RX3.js} +2 -2
- package/dist/{chunk-RA5MTIOO.js → chunk-PEHDARNC.js} +2 -2
- package/dist/chunk-PESEPWZO.js +2 -0
- package/dist/{chunk-LFM3O5KX.js → chunk-PMY4UFGV.js} +2 -2
- package/dist/{chunk-H7NSJ7L2.js → chunk-Q7PWDXL5.js} +2 -2
- package/dist/{chunk-FBCOFKEC.js → chunk-QVGFVRKD.js} +2 -2
- package/dist/{chunk-Q7S2DADC.js → chunk-QYOPMTZ6.js} +2 -2
- package/dist/{chunk-VYF5HA76.js → chunk-QZOAOLLZ.js} +2 -2
- package/dist/{chunk-NLMRJ7SI.js → chunk-R7U2I55B.js} +2 -2
- package/dist/{chunk-64PRNLKP.js → chunk-RLB6SG25.js} +2 -2
- package/dist/{chunk-MJKJMWIM.js → chunk-SFDVBARK.js} +2 -2
- package/dist/{chunk-B4VYXRCQ.js → chunk-TYCZ7S4I.js} +2 -2
- package/dist/{chunk-4D54JIU3.js → chunk-U3VMUDXJ.js} +2 -2
- package/dist/chunk-UHPWZCYQ.js +3 -0
- package/dist/{chunk-OPE5YXFE.js → chunk-V5W7H7V4.js} +2 -2
- package/dist/{chunk-YDDGCJJG.js → chunk-WMO2VZZK.js} +2 -2
- package/dist/chunk-WPZPB42I.js +2 -0
- package/dist/{chunk-EXKLAEB4.js → chunk-X3DTIEMU.js} +2 -2
- package/dist/chunk-X5C43YVI.js +2 -0
- package/dist/{chunk-IRJDYTNZ.js → chunk-XC2PJOVM.js} +2 -2
- package/dist/{chunk-Z3IPJKJP.js → chunk-XDESMVOL.js} +2 -2
- package/dist/{chunk-KSUZS77X.js → chunk-XZBLZHXL.js} +2 -2
- package/dist/{chunk-7ITCOJGD.js → chunk-YQKECTPV.js} +2 -2
- package/dist/chunk-YTVKPJXW.js +2 -0
- package/dist/{chunk-75X52JTA.js → chunk-ZEO4CXQR.js} +2 -2
- package/dist/cli.js +256 -244
- package/dist/index.js +1 -1
- 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.js +1 -1
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +34 -0
- package/dist/queries/decorative-checkers.js +2 -0
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +3 -0
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +33 -0
- package/dist/queries/not-implemented.js +2 -0
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.js +1 -1
- 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/test-quality.d.ts +56 -0
- package/dist/queries/test-quality.js +2 -0
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +23 -1
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/runtime.js +1 -1
- package/docs/COMMAND_REFERENCE.md +4 -1
- package/docs/analyzer-inventory.md +16 -0
- package/package.json +14 -2
- package/skills/_shared/SKILL.md +4 -1
- package/skills/scip-calibrate/SKILL.md +124 -0
- package/skills/scip-calibrate/agents/openai.yaml +4 -0
- package/skills/scip-integrity-audit/SKILL.md +32 -0
- package/skills/scip-tla-model-system/SKILL.md +7 -9
- package/dist/chunk-EDB7Y442.js +0 -2
- package/dist/chunk-EZ5WDZ2Q.js +0 -3
- package/dist/chunk-H2NMIZFD.js +0 -2
- package/dist/chunk-HXXMPYEF.js +0 -2
- package/dist/chunk-PXHPCWX5.js +0 -2
- package/dist/chunk-T2FQ4GHD.js +0 -9
package/dist/chunk-T2FQ4GHD.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{A as R,B as We,C as he,D as He,E as Je,c as je,d as De,e as _,f as Oe,g as Me,h as ve,i as B,j as $e,k as H,l as Ue,m as qe,n as Be,o as L,p as J,q as A,r as me,s as de,t as S,u as fe,v as ze,w as ge,x as Q,y as G,z as Ve}from"./chunk-ISLWJ4PY.js";import{b as W,i as Se,m as K,o as X,p as k}from"./chunk-WS3Z6W3M.js";import{b as ne}from"./chunk-GNG622H3.js";import{a as we,c as q,f as re}from"./chunk-7S5E7KWT.js";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _t(e){return e.replace(/'''[\s\S]*?'''/g,w).replace(/"""[\s\S]*?"""/g,w).replace(/#.*$/gm,w).replace(/\/\/.*$/gm,w).replace(/\/\*[\s\S]*?\*\//g,w).replace(/`(?:\\[\s\S]|[^`])*`/g,w).replace(/'(?:\\.|[^'\\\r\n])*'/g,w).replace(/"(?:\\.|[^"\\\r\n])*"/g,w)}function w(e){return e.replace(/[^\r\n]/g," ")}var $n=re("stripped-lines",{clearGroups:["whole-project","source-file"]});we({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{se=null,Y=""},clearFile:()=>{se=null,Y=""}});var se=null,Y="";function Rt(e){return se===e||(se=e,Y=_t(e)),Y}function j(e,r,t){let n=Rt(e);return`${n.slice(0,r)}${" ".repeat(t-r)}${n.slice(t)}`}function x(e,r){return new RegExp(`\\b${O(r)}\\b`,"m").test(e)}function z(e,r){let t=new Set,n=new RegExp(`\\b${O(r)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function xe(e){let r=0;for(let t of e)t==="("&&(r+=1),t===")"&&(r-=1);return r}var Et=new Set(["identifier","type_identifier","field_identifier"]),Tt=new Set(["identifier"]),Ft=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),Lt=new Set(["rust","python"]),At=/\{([^{}]*)\}/g,kt=/\b([A-Za-z_][\w]*)\b/g;function Ke(e,r){return wt(r).has(e.type)}function Xe(e,r){return Lt.has(r)&&e.type==="string_content"}function ye(e){let r=0;for(let n of e.values()){let s=n[n.length-1];s!==void 0&&s>r&&(r=s)}let t=new Array(r+1);for(let n=0;n<=r;n+=1)t[n]=new Set;for(let[n,s]of e)for(let o of s)t[o].add(n);return t}function wt(e){return e==="rust"?Et:e==="python"?Tt:Ft}function Qe(e,r){let t=e.startPosition.row;for(let n of e.text.matchAll(At)){let s=n[1]??"";for(let o of s.matchAll(kt))o[1]&&r(o[1],t)}}var jt=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],Dt=/^#!?\[\s*serde\s*\(/,Ot=/^#!?\[\s*schemars\s*\(/,Mt=/^#!?\[\s*validate\s*\(/,vt=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function Ge(e,r,t){if(r!=="typescript"&&r!=="tsx"&&r!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let s=he(n);if(!s||!vt.has(s))return;let o=e.namedChildren.find(c=>c.type==="arguments");if(!o)return;let i=o.namedChild(0);if(!i||i.type!=="string")return;let a=i.namedChildren.find(c=>c.type==="string_fragment");a&&t.add(a.text)}function Ye(e,r){let t=Dt.test(e),n=Ot.test(e),s=Mt.test(e);if(!(!t&&!n&&!s))for(let o of jt){o.lastIndex=0;let i;for(;(i=o.exec(e))!==null;){let a=i[1],c=a.split("::").pop()??a;c==="is_none"&&/\bOption\b/.test(a)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(a)||c&&r.add(c)}}}function Ze(e,r){let t=new Map,n=(i,a)=>{if(i===a)return;let c=t.get(i);c||(c=new Set,t.set(i,c)),c.add(a)},s=r==="python"?new Set(["identifier"]):new Set(["type_identifier"]),o=(i,a)=>{let c=l=>{s.has(l.type)&&l.text!==a&&n(l.text,a);for(let p of l.children)c(p)};for(let l of i.children)c(l)};if(r==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let a=i.namedChildren.find(l=>l.type==="type_identifier")?.text;if(!a)continue;let c=i.namedChildren.find(l=>l.type==="field_declaration_list"||l.type==="enum_variant_list"||l.type==="ordered_field_declaration_list");c&&o(c,a),i.type==="type_item"&&o(i,a)}else if(r==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let a=i.namedChildren.find(l=>l.type==="identifier")?.text;if(!a)continue;let c=i.namedChildren.find(l=>l.type==="block");if(c)for(let l of c.descendantsOfType("type"))for(let p of l.descendantsOfType("identifier"))p.text!==a&&n(p.text,a)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let a=i.namedChildren.find(c=>c.type==="type_identifier")?.text;a&&o(i,a)}return t}var $t=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),be=new Set(["catch","comment","def","defprotocol","defrecord","deftype","defmethod","defmacro","defmacro-","defn","defn-","do","doseq","dotimes","fn","for","if","let","loop","ns","quote","recur","throw","try","extend-protocol","extend-type","when","when-let","when-not"]);function et(e){let r=[],t=[],n=[],s=new Map,o=[],i=0,a=0,c=(l,p)=>{let u=s.get(l);if(!u){s.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)};for(;a<e.length;){let l=e[a];if(l===`
|
|
2
|
-
`){i+=1,a+=1;continue}if(/\s|,/.test(l)){a+=1;continue}if(l===";"){a=ie(e,a);continue}if(l==='"'){let h=ee(e,a,i);i=h.line,a=h.index;continue}if(l==="("||l==="["||l==="{"){o.push({kind:l,startLine:i,endLine:i,headTokens:[],tokens:[],children:[]}),a+=1;continue}if(l===")"||l==="]"||l==="}"){let h=o.pop();h&&(h.endLine=i,Ut(h,{callables:r,callSites:t,clojureMembers:n,recordIdentifier:c}),o[o.length-1]?.children.push(h)),a+=1;continue}if(Ne(l)){a+=1;continue}let p=i,u=a;for(;a<e.length&&!Ie(e[a]);)a+=1;let m=e.slice(u,a);if(!m)continue;let d={text:m,line:p};qt(o[o.length-1],d),c(N(m),p)}return{language:"clojure",callables:r,callSites:t,clojureMembers:n,typeContainerMap:new Map,identifierLineMap:s,identifiersByLine:Ht(s),fileIdentifiers:new Set(s.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function Ut(e,r){if(e.kind!=="("||e.headTokens.length===0)return;let t=e.headTokens[0],n=N(t.text),s=$t.get(t.text);if(s){let i=e.headTokens[1];if(i){let a=N(i.text);r.recordIdentifier(a,i.line),r.callables.push({name:a,startLine:e.startLine,endLine:e.endLine,paramCount:0,params:[],paramsEndLine:i.line,isLiteralPassthrough:!1,clojureKind:s})}}if(Bt(e,r),!n||be.has(t.text)||be.has(n)||n.startsWith(":"))return;let o=Wt(t.text);r.callSites.push({calleeLeaf:o.leaf,calleeQualifier:o.qualifier,calleeText:o.text,memberAccess:!1,line:t.line})}function qt(e,r){e&&(e.headTokens.length<2&&e.headTokens.push(r),e.tokens.length<200&&e.tokens.push(r))}function Bt(e,r){let t=N(e.tokens[0]?.text??"");if(t==="defprotocol"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of oe(e))Z(r,n,"protocol",s,"protocol-method");return}if(t==="defrecord"||t==="deftype"){let n=N(e.tokens[1]?.text??"");if(!n)return;let s=t==="defrecord"?"record":"type",o=t==="defrecord"?"record-method":"type-method";for(let i of oe(e))Z(r,n,s,i,o);return}if(t==="extend-type"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of oe(e))Z(r,n,"extension",s,"extension-method");return}if(t==="extend-protocol"){let n=N(e.tokens[1]?.text??"");for(let s of oe(e)){n&&Z(r,n,"extension",s,"extension-method");let o=Vt(e,s.startLine);o&&o!==n&&Z(r,o,"extension",s,"extension-method")}}}function oe(e){return e.children.filter(zt)}function zt(e){if(e.kind!=="(")return!1;let r=N(e.tokens[0]?.text??"");return!!(r&&!be.has(r)&&!r.startsWith(":"))}function Z(e,r,t,n,s){let o=n.tokens[0],i=N(o?.text??"");!o||!i||(e.recordIdentifier(i,o.line),e.clojureMembers.push({ownerName:r,ownerKind:t,memberName:i,memberKind:s,startLine:n.startLine,endLine:n.endLine}))}function Vt(e,r){let t=null;for(let n=2;n<e.tokens.length;n+=1){let s=e.tokens[n];if(s.line>r)break;let o=N(s.text);o&&!o.startsWith(":")&&(t=o)}return t}function N(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function Wt(e){let r=e.replace(/^#?['`~@]+/,""),t=r.lastIndexOf("/"),n=N(r);if(t<=0)return{leaf:n,text:r};let s=r.slice(0,t);return{leaf:n,qualifier:s,text:r}}function ie(e,r){let t=r;for(;t<e.length&&e[t]!==`
|
|
3
|
-
`;)t+=1;return t}function ee(e,r,t){let n=r+1,s=t;for(;n<e.length;){let o=e[n];if(o==="\\"){n+=2;continue}if(o===`
|
|
4
|
-
`&&(s+=1),n+=1,o==='"')break}return{index:n,line:s}}function Ne(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function Ie(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function Ht(e){let r=[];for(let[t,n]of e)for(let s of n)r[s]??=new Set,r[s].add(t);return r}var Jt=re("source-facts",{clearGroups:["whole-project","source-file"]}),Ce=K({kind:"source-facts",invalidation:X("source-facts"),serialize:Gt,deserialize:Yt});function T(e,r){return Kt(e,r).facts}function Kt(e,r){let t=k(e,r);if(!t)return{facts:null};let n=Xt(e,r,t);return n?Jt.get(e,r,t,()=>Qt(e,r,n,t)):{facts:null}}function Xt(e,r,t){return G(r)?Ve(e,r,t)?.language??null:Q(r)}function Qt(e,r,t,n){let s=W(e,r,n),o=Ce.read(e,r,s);if(o&&o.language===t)return{facts:o};if(t==="clojure"){let c=et(n);return Ce.write(e,r,s,c),{facts:c}}let i=R(e,r);if(!i)return{facts:null,unavailable:{language:t,reason:"parser-unavailable"}};let a=rr(i,t);return Ce.write(e,r,s,a),{facts:a}}function Gt(e){let r={language:e.language,callables:e.callables,callSites:e.callSites,clojureMembers:e.clojureMembers,typeContainerMap:[...e.typeContainerMap.entries()].map(([t,n])=>[t,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(r)}function Yt(e){try{let r=JSON.parse(e);if(r.language==="clojure"&&(r.clojureMembers===void 0||r.callSites.some(n=>n.calleeText===void 0)))return null;let t=new Map(r.identifierLineMap);return{language:r.language,callables:r.callables,callSites:r.callSites,clojureMembers:r.clojureMembers??[],typeContainerMap:new Map(r.typeContainerMap.map(([n,s])=>[n,new Set(s)])),identifierLineMap:t,identifiersByLine:ye(t),fileIdentifiers:new Set(t.keys()),rustAttrReferencedNames:new Set(r.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(r.crossLanguageDispatchNames)}}catch{return null}}function Zt(e,r,t,n){let s=T(e,r);return s?tr(s,t,n)?.isLiteralPassthrough??!0:!0}function er(e,r){return r.relativePath.includes(".clj-kondo/hooks/")?!0:T(e,r.relativePath)?.callables.find(n=>n.startLine===r.startLine&&n.endLine===r.endLine)?.clojureKind==="macro"}function tr(e,r,t){return e.callables.find(n=>n.startLine===r&&n.endLine===t)??null}function rr(e,r){let t=[],n=[],s=new Set,o=new Set,i=new Map,a=(l,p)=>{let u=i.get(l);if(!u){i.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)},c=l=>{let p=He(l,r);p&&t.push(p);let u=We(l,r);u&&n.push(u),Ge(l,r,o),r==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&Ye(l.text,s),Ke(l,r)&&a(l.text,l.startPosition.row),Xe(l,r)&&Qe(l,a);for(let m of l.children)c(m)};return c(e.rootNode),{language:r,callables:t,callSites:n,clojureMembers:[],typeContainerMap:Ze(e,r),identifierLineMap:i,identifiersByLine:ye(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:s,crossLanguageDispatchNames:o}}var tt=new Set(["rust","typescript","tsx","javascript","python","clojure"]);function nr(e,r){let t=T(e,r);return!t||!tt.has(t.language)?null:t.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function sr(e,r){let t=T(e,r);return!t||!tt.has(t.language)?null:t.callSites}function or(e,r){return T(e,r)?.typeContainerMap??new Map}function ir(e,r,t={}){let n=T(e,r);if(!n)return[];let s=[];if(t.includeCrossLanguageDispatchNames)for(let o of n.crossLanguageDispatchNames)s.push({name:o,kind:"cross-language-dispatch",occurrences:1});if(t.includeRustAttributeNames&&n.language==="rust")for(let o of n.rustAttrReferencedNames)s.push({name:o,kind:"rust-attribute",occurrences:1});return s}import{basename as rt}from"path";var ar=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function y(e){let r=[],t=0,n=0;for(let s=0;s<e.length;s++){let o=e[s];(o==="{"||o==="["||o==="(")&&t++,(o==="}"||o==="]"||o===")")&&t--,o===","&&t===0&&(r.push(e.slice(n,s)),n=s+1)}return r.push(e.slice(n)),r}function b(e,r){for(let t of e.namedChildren)if(t.type===r)return t;return null}function g(e,r){let t=new Set,n=(s,o)=>{let i=o||r.has(s.type);!i&&ar.has(s.type)&&t.add(s.text);for(let a of s.children)n(a,i)};return n(e.rootNode,!1),t}function E(e,r,t,n,s,o,i){return{importedName:s,localName:o,sourcePath:i??S(e,n,Be(r)),kind:"named",used:x(t,o),usedMembers:[]}}function f(e,r,t,n,s="named",o={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function F(e,r,t,n,s="named",o=[],i={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n,usedMembers:o,isTypeOnly:i.isTypeOnly}}function M(e,r){return{importedName:e,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function v(e,r,t={}){return{importedName:e,localName:t.localName??null,sourcePath:r,kind:"namespace",used:t.used??!0,usedMembers:t.usedMembers??[],isTypeOnly:t.isTypeOnly}}function I(e,r,t){let n=[];for(let s of e.matchAll(r)){let o=s[0];if(!o||typeof s.index!="number")continue;let i=j(e,s.index,s.index+o.length);for(let a of t(s,i))n.push(a)}return n}function C(e,r,t,n){let s=R(e,r);if(s){let o=t(s);if(o)return o}return n()}function ae(e,r,t,n){let s=R(e,r),o=Q(r),i=o?t[o]:void 0;return s&&i?i(s):n()}function nt(e,r,t){return C(e,r,n=>lr(e,r,n),()=>cr(e,r,t))}function cr(e,r,t){return I(t,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(n,s)=>{let o=n[1]?.trim();if(!o)return[];let i=rt(o).replace(/\.[^.]+$/,"");return[F(o,i,de(e,r,o),x(s,i))]})}function lr(e,r,t){let n=g(t,new Set(["preproc_include"])),s=[];for(let o of t.rootNode.descendantsOfType("preproc_include")){let i=null;for(let c of o.namedChildren){if(c.type==="system_lib_string"){i=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){i=c.namedChildren.find(p=>p.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=rt(i).replace(/\.[^.]+$/,"");s.push(f(i,a,de(e,r,i),n))}return s}var pr=new Set([":require",":require-macros",":use"]),Re=String.raw`A-Za-z0-9_$*+!?.<>=-`;function ot(e,r,t){let n=Nr(t);if(!n)return[];let s=br(t,n.start,n.end),o=[];for(let i of n.children.slice(2)){if(i.type!=="list"||i.children.length===0)continue;let a=P(i.children[0]);if(a){if(pr.has(a)){for(let c of dr(i.children.slice(1)))o.push(...mr(e,c,s));continue}if(a===":import")for(let c of gr(i.children.slice(1)))o.push(c)}}return o}function ur(e){return e.type==="list"&&P(e.children[0])==="ns"}function mr(e,r,t){let n=ze(e,r.namespace),s=r.alias??r.namespace,o=hr(t,s),i=[{importedName:r.namespace,localName:s,sourcePath:n,kind:"namespace",used:r.refers.length>0||r.referAll||o.length>0||xr(t,r.namespace),usedMembers:o}];r.referAll&&i.push({importedName:"*",localName:null,sourcePath:n,kind:"side-effect",used:!0,usedMembers:[]});for(let a of r.refers)i.push({importedName:a,localName:a,sourcePath:n,kind:"named",used:yr(t,a),usedMembers:[]});return i}function dr(e){return e.flatMap(r=>ce(r,null))}function ce(e,r){if(e.type==="atom")return e.text.startsWith(":")?[]:[{namespace:_e(r,e.text),alias:null,refers:[],referAll:!1}];if(e.type==="vector")return e.children.length>0&&P(e.children[0])===null?e.children.flatMap(t=>ce(t,r)):fr(e,r);if(e.type==="list"&&e.children.length>0){let t=P(e.children[0]);return t?!t||t.startsWith(":")?[]:e.children.slice(1).flatMap(n=>ce(n,_e(r,t))):e.children.flatMap(n=>ce(n,r))}return[]}function fr(e,r){let t=P(e.children[0]);if(!t||t.startsWith(":"))return[];let n={namespace:_e(r,t),alias:null,refers:[],referAll:!1};for(let s=1;s<e.children.length;s+=1){let o=P(e.children[s]);if(!o?.startsWith(":"))continue;let i=e.children[s+1];if((o===":as"||o===":as-alias")&&i){n.alias=P(i),s+=1;continue}o===":refer"&&i&&(P(i)===":all"?n.referAll=!0:(i.type==="vector"||i.type==="list")&&n.refers.push(...i.children.map(P).filter(Sr)),s+=1)}return[n]}function gr(e){let r=[];for(let t of e){if(t.type==="atom"){let s=t.text.split(".").pop()??t.text;r.push(F(s,s,null,!0));continue}if(t.type!=="vector")continue;let n=P(t.children[0]);if(n)for(let s of t.children.slice(1)){let o=P(s);o&&r.push(F(`${n}.${o}`,o,null,!0))}}return r}function _e(e,r){return e?`${e}.${r}`:r}function P(e){return e?.type==="atom"?e.text:null}function Sr(e){return!!(e&&!e.startsWith(":"))}function hr(e,r){let t=new Set,n=new RegExp(`${Ee()}${O(r)}\\s*/\\s*([${Re}]+)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function xr(e,r){return new RegExp(`${Ee()}${O(r)}\\s*/`,"m").test(e)}function yr(e,r){return new RegExp(`${Ee()}${O(r)}(?![${Re}])`,"m").test(e)}function Ee(){return`(?<![${Re}])`}function br(e,r,t){let n="",s=0;for(;s<e.length;){if(s>=r&&s<t){n+=e[s]===`
|
|
5
|
-
`?`
|
|
6
|
-
`:" ",s+=1;continue}let o=e[s];if(o===";"){let i=ie(e,s);n+=st(e.slice(s,i)),s=i;continue}if(o==='"'){let i=ee(e,s,0).index;n+=st(e.slice(s,i)),s=i;continue}n+=o,s+=1}return n}function Nr(e){let r=0;for(;r<e.length&&(r=Te(e,r),!(r>=e.length));){let t=le(e,r);if(!t){r+=1;continue}if(ur(t.form))return t.form;r=t.index}return null}function le(e,r){let t=Te(e,r);if(e.startsWith("#?@",t)||e.startsWith("#?",t))return Ir(e,t);if(e.startsWith("#_",t)){let s=le(e,t+2);return s?{form:{type:"atom",text:"",start:t,end:s.index},index:s.index}:null}for(;Ne(e[t]);)t+=1;let n=e[t];return n?n==="("?Pe(e,t,"list",")"):n==="["?Pe(e,t,"vector","]"):n==="{"?Pe(e,t,"map","}"):n==='"'?{form:{type:"atom",text:"",start:t,end:ee(e,t,0).index},index:ee(e,t,0).index}:Pr(e,t):null}function Ir(e,r){let t=e.startsWith("#?@",r)?3:2,n=le(e,r+t);return n?{form:{type:"list",children:n.form.type==="list"||n.form.type==="vector"||n.form.type==="map"?Cr(n.form.children):[],start:r,end:n.index},index:n.index}:null}function Cr(e){let r=[];for(let t=0;t<e.length;t+=2){let n=P(e[t]),s=e[t+1];n?.startsWith(":")&&s&&r.push(s)}return r}function Pe(e,r,t,n){let s=[],o=r+1;for(;o<e.length;){if(o=Te(e,o),e[o]===n)return{form:{type:t,children:s,start:r,end:o+1},index:o+1};let i=le(e,o);if(!i){o+=1;continue}i.form.type==="atom"&&i.form.text===""||s.push(i.form),o=i.index}return{form:{type:t,children:s,start:r,end:e.length},index:e.length}}function Pr(e,r){let t=r;for(;t<e.length&&!Ie(e[t]);)t+=1;return{form:{type:"atom",text:e.slice(r,t),start:r,end:t},index:t}}function Te(e,r){let t=r;for(;t<e.length;){let n=e[t];if(/\s|,/.test(n)){t+=1;continue}if(n===";"){t=ie(e,t);continue}break}return t}function st(e){return e.replace(/[^\r\n]/g," ")}function it(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=s[1]?.trim(),i=s[2]?.trim()??null,a=s[0];if(!o||!a||typeof s.index!="number")continue;let c=j(t,s.index,s.index+a.length);n.push({importedName:o,localName:i,sourcePath:fe(e,r,o),kind:i?"namespace":"side-effect",used:i?x(c,i):!0,usedMembers:i?z(c,i):[]})}return n}function at(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=s[1]?.trim();o&&n.push({specifier:o,sourcePath:fe(e,r,o)})}return n}function ct(e,r,t){return ae(e,r,{csharp:n=>Rr(e,r,n),vb:n=>_r(e,r,n)},()=>{let n=qe(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return I(t,n,(s,o)=>{let i=s[1]?.trim();if(!i)return[];let[a,c]=i.split(/\s*=\s*/),l=!!c,p=(l?c:a)?.trim()??i,u=p.split(".").pop()??p,m=l?a?.trim()??u:u;return[E(e,r,o,p,u,m,S(e,p,B))]})})}function _r(e,r,t){let n=g(t,new Set(["imports_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(m=>m.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],c=i.length>1?i[0]:null,l=a.text,p=l.split(".").pop()??l,u=c?.text??p;s.push(f(p,u,S(e,l,B),n,c?"namespace":"named"))}return s}function Rr(e,r,t){let n=g(t,new Set(["using_directive"])),s=[];for(let o of t.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,c;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],c=i[1]):c=i[i.length-1];let l=c.text,p=l.split(".").pop()??l,u=a?.text??p;s.push(f(p,u,S(e,l,B),n,a?"namespace":"named"))}return s}var Er=q("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function lt(e,r){return Er.get(e,r,()=>{let t=new Set,n=k(e,r);if(!n)return t;let o=n.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))t.add(i[0]);return t})}function Fe(e,r,t){return C(e,r,n=>Fr(e,r,n),()=>Tr(e,r,t))}function Tr(e,r,t){return Ur(t).flatMap(n=>qr(e,r,n.clause,n.specifier,n.start,n.end,t))}function Fr(e,r,t){let n=Lr(e,r,t),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))s.push(...Ar(e,r,t,o,n));return s}function Lr(e,r,t){let n=g(t,new Set(["import_statement"]));if(G(r))for(let s of lt(e,r))n.add(s);return n}function Ar(e,r,t,n,s){let o=Or(n);if(!o)return[];let i=L(e,r,o),a=b(n,"import_clause");return a?kr(t,a,i,s,Mr(n.text)):[M("*",i)]}function kr(e,r,t,n,s){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(wr(i.text,t,n,s));else if(i.type==="namespace_import"){let a=jr(e,i,t,n,s);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Dr(i,t,n,s));return o}function wr(e,r,t,n){return f("default",e,r,t,"default",{isTypeOnly:n})}function jr(e,r,t,n,s){let i=b(r,"identifier")?.text??"";if(!i)return null;let a=$r(e,i);return v("*",t,{localName:i,usedMembers:a,isTypeOnly:s,used:a.length>0||n.has(i)})}function Dr(e,r,t,n){let s=[];for(let o of e.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let c=i.text,l=a?.text??c;s.push(f(c,l,r,t,"named",{isTypeOnly:n||vr(o.text)}))}return s}function Or(e){let r=b(e,"string");if(!r)return null;let t=b(r,"string_fragment");return t?t.text:null}function Mr(e){return/^\s*import\s+type\b/.test(e)}function vr(e){return/^\s*type\b/.test(e.trim())}function $r(e,r){let t=new Set;for(let n of e.rootNode.descendantsOfType("member_expression")){let s=n.namedChild(0),o=n.namedChild(1);!s||!o||s.type!=="identifier"||s.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&t.add(o.text)}return[...t]}function Ur(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(t)){let o=s[0],i=s[1],a=s[2];!o||!a||typeof s.index!="number"||r.push({clause:i,specifier:a,start:s.index,end:s.index+o.length})}let n=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(n)){let o=s[0],i=s[1];!o||!i||typeof s.index!="number"||r.push({clause:null,specifier:i,start:s.index,end:s.index+o.length})}return r.sort((s,o)=>s.start-o.start)}function qr(e,r,t,n,s,o,i){let a=L(e,r,n),c=j(i,s,o);return t?Br(t).map(p=>({...p,sourcePath:a})).map(p=>{if(p.kind==="namespace"){let u=z(c,p.localName);return v(p.importedName,p.sourcePath,{localName:p.localName,usedMembers:u,used:u.length>0||x(c,p.localName),isTypeOnly:p.isTypeOnly})}return p.kind==="side-effect"?M(p.importedName,p.sourcePath):F(p.importedName,p.localName??"",p.sourcePath,p.localName?x(c,p.localName):!1,p.kind,[],{isTypeOnly:p.isTypeOnly})}):[M("*",a)]}function Br(e){let r=e.trim(),t=/^type\b/.test(r),n=r.replace(/^type\s+/,""),[s,o]=zr(n),i=[];return s&&i.push(...pt(s,t)),o&&i.push(...pt(o,t)),i}function pt(e,r){let t=e.trim();if(!t)return[];if(t.startsWith("{")){let n=t.slice(1,-1).trim();return n?y(n).map(s=>{let o=s.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[c,l]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(l??c).trim(),kind:"named",isTypeOnly:i}}):[]}return t.startsWith("* as ")?[{importedName:"*",localName:t.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:t,kind:"default",isTypeOnly:r}]}function zr(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];if(n==="{"&&r++,n==="}"&&r--,n===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function Le(e,r,t){let n=R(e,r);return n?Xr(e,r,n):Vr(e,r,t)}function Vr(e,r,t){return[...Wr(e,r,t),...Hr(e,r,t),...Jr(e,r,t)]}function Wr(e,r,t){let n=[],s=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",c=y(i).map(u=>Kr(u.trim())).filter(u=>!!u),l=V(t,o.index),p=V(t,o.index+o[0].length-1);n.push({kind:"named",sourcePath:L(e,r,a),names:c,startLine:l,endLine:p})}return n}function Hr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[2]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star-as",sourcePath:L(e,r,i),names:[],startLine:a,endLine:c})}return n}function Jr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star",sourcePath:L(e,r,i),names:[],startLine:a,endLine:c})}return n}function Kr(e){if(!e)return null;let r=e.replace(/^type\s+/,"").trim();if(!r)return null;let t=r.match(/^(\w+)\s+as\s+(\w+)$/);if(t)return t[2]??null;let n=r.match(/^(\w+)$/);return n?n[1]??null:null}function V(e,r){let t=0;for(let n=0;n<r&&n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function Xr(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("export_statement")){let o=Qr(e,r,s);if(o===void 0)continue;let i=s.startPosition.row,a=s.endPosition.row,c=Gr(s,o,i,a);n.push(c)}return n}function Qr(e,r,t){let n=b(t,"string");if(!n)return;let s=b(n,"string_fragment");if(s)return L(e,r,s.text)}function Gr(e,r,t,n){let s=b(e,"export_clause");if(s){let i=[];for(let a of s.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),l=a.namedChild(1);c&&i.push((l??c).text)}return{kind:"named",sourcePath:r,names:i,startLine:t,endLine:n}}return b(e,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:t,endLine:n}:{kind:"star",sourcePath:r,names:[],startLine:t,endLine:n}}function ut(e,r,t){return ae(e,r,{java:n=>Yr(e,r,n),kotlin:n=>Zr(e,r,n),scala:n=>en(e,r,n)},()=>I(t,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(n,s)=>{let o=n[1]?.trim();return o?tn(e,r,o,s):[]}))}function Yr(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(u=>u.type==="asterisk"),c=o.namedChildren.find(u=>u.type==="scoped_identifier")??o.namedChildren.find(u=>u.type==="identifier");if(!c)continue;let l=c.text;if(i){s.push(v("*",S(e,l,_)));continue}let p=l.split(".").pop()??l;s.push(f(p,p,S(e,l,_),n))}return s}function Zr(e,r,t){let n=g(t,new Set(["import_header","import_list"])),s=[];for(let o of t.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"),c=o.namedChildren.find(d=>d.type==="import_alias");if(a){s.push(v("*",S(e,i.text,_)));continue}let l=i.text,p=l.split(".").pop()??l,m=c?.namedChild(0)?.text??p;s.push(f(p,m,S(e,l,_),n))}return s}function en(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(u=>u.type==="namespace_selectors"||u.type==="namespace_wildcard"),a=o.namedChildren.filter(u=>u!==i&&(u.type==="identifier"||u.type==="stable_identifier")),c=a.map(u=>u.text).join(".");if(!c)continue;if(i?.type==="namespace_wildcard"){s.push(v("*",S(e,c,_)));continue}if(i?.type==="namespace_selectors"){for(let u of i.namedChildren)if(u.type==="arrow_renamed_identifier"){let[m,d]=u.namedChildren;if(!m)continue;let h=m.text,$=d?.text??h;if(h==="_")continue;s.push(f(h,$,S(e,`${c}.${h}`,_),n))}else if(u.type==="identifier"){let m=u.text;s.push(f(m,m,S(e,`${c}.${m}`,_),n))}continue}let l=a[a.length-1]?.text??c,p=a.slice(0,-1).map(u=>u.text).join(".")||c;s.push(f(l,l,S(e,p&&a.length>1?`${p}.${l}`:c,_),n))}return s}function tn(e,r,t,n){if(t.includes("{")&&t.includes("}")){let s=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),o=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),p=c?.trim();if(!p||p==="_")return[];let u=(l??p.split(".").pop()??p).trim(),m=p==="_"?s:`${s}.${p}`.replace(/\.\./g,".");return[E(e,r,n,m,p,u)]})}return[E(e,r,n,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function dt(e,r,t){return C(e,r,n=>rn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.split(/\s+as\s+/i),p=c?.trim()??a,u=p.split("\\").pop()??p,m=(l??u).trim();return[E(e,r,s,p,u,m,S(e,p.replace(/\\/g,"."),H))]}):[]}))}function rn(e,r,t){let n=g(t,new Set(["namespace_use_declaration"])),s=[],o=(i,a,c)=>{s.push(f(a,c,S(e,i.replace(/\\/g,"."),H),n))};for(let i of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=i.namedChildren.find(l=>l.type==="namespace_name")?.text??"";for(let l of a.namedChildren){if(l.type!=="namespace_use_clause")continue;let{importedName:p,localName:u,qualified:m}=mt(l,c);p&&o(m,p,u)}continue}for(let c of i.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:p,qualified:u}=mt(c,"");l&&o(u,l,p)}}return s}function mt(e,r){let t=e.namedChildren.find(l=>l.type==="qualified_name"),n=e.namedChildren.filter(l=>l.type==="name"),s="";t?s=t.text:n.length>=1&&(s=n[0].text);let o=t&&n.length>0?n[n.length-1]:null,i=s.split("\\").pop()??s,a=o?.text??i,c=r?`${r}\\${s}`:s;return{importedName:i,localName:a,qualified:c}}function gt(e,r,t){return C(e,r,n=>nn(e,r,n),()=>on(t).flatMap(n=>cn(e,r,n,t)))}function nn(e,r,t){let n=g(t,new Set(["import_statement","import_from_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=ft(i);if(!a)continue;let c=J(e,r,a.qualifiedName);s.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:n.has(a.localName),usedMembers:[]})}for(let o of t.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=sn(i);if(a===null)continue;let c=J(e,r,a);for(let l=1;l<o.namedChildCount;l+=1){let p=o.namedChild(l);if(p.type==="wildcard_import"){s.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let u=ft(p);u&&s.push({importedName:u.qualifiedName,localName:u.localName,sourcePath:c,kind:"named",used:n.has(u.localName),usedMembers:[]})}}return s}function ft(e){if(e.type==="aliased_import"){let r=e.namedChild(0),t=e.namedChild(1);return!r||!t?null:{qualifiedName:r.text,localName:t.text}}if(e.type==="dotted_name"){let r=e.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function sn(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=b(e,"import_prefix")?.text??"",t=b(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function on(e){let r=e.split(`
|
|
7
|
-
`),t=[],n=0;for(let s=0;s<r.length;s++){let o=r[s],i=o.trimStart(),a=n;if(n+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let c=o,l=a+o.length,p=xe(o);for(;s+1<r.length&&(p>0||c.trimEnd().endsWith("\\"));){s++;let m=r[s];c+=`
|
|
8
|
-
${m}`,l+=1+m.length,p+=xe(m),n+=m.length+1}let u=an(c);u&&t.push({...u,start:a,end:l})}return t}function an(e){let r=e.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let t=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!t)return null;let n=t[2].trim();return n.startsWith("(")&&n.endsWith(")")&&(n=n.slice(1,-1).trim()),{kind:"from",module:t[1],clause:n}}function cn(e,r,t,n){let s=j(n,t.start,t.end),o=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return y(o).flatMap(c=>{let l=c.trim().replace(/,$/,"");if(!l)return[];let[p,u]=l.split(/\s+as\s+/),m=p.trim(),d=(u??m.split(".")[0]??m).trim(),h=J(e,r,m),$=z(s,d);return[{importedName:m,localName:d,sourcePath:h,kind:"namespace",used:x(s,d)||$.length>0,usedMembers:$}]});let i=t.module?J(e,r,t.module):null,a=[];for(let c of y(o)){let l=c.trim().replace(/,$/,"");if(!l)continue;if(l==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[p,u]=l.split(/\s+as\s+/),m=(u??p).trim();a.push({importedName:p.trim(),localName:m,sourcePath:i,kind:"named",used:x(s,m),usedMembers:[]})}return a}import{basename as ln}from"path";function St(e,r,t){return C(e,r,n=>un(e,r,n),()=>pn(e,r,t))}function pn(e,r,t){return I(t,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,s)=>{let o=n[1],i=n[2];if(!o||!i)return[];let a=o==="require_relative"?me(e,r,i):null;if(a){let c=ht(i);return[F(c,c,a,x(s,c))]}return[M(i,a)]})}function un(e,r,t){let n=g(t,new Set([])),s=[],o=new Set(["require","require_relative","load"]);for(let i of t.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let l=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let u=l.namedChildren.find(d=>d.type==="string_content")?.text;if(!u)continue;let m=a.text==="require_relative"?me(e,r,u):null;if(m){let d=ht(u);s.push(f(d,d,m,n))}else s.push(M(u,m))}return s}function ht(e){return Je(ln(e).replace(/\.[^.]+$/,""),/_/)}function xt(e,r,t){return C(e,r,n=>mn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?dn(e,r,o,s):[]}))}function mn(e,r,t){let n=g(t,new Set(["use_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of te(i,"")){if(!a.importedName||a.importedName==="*")continue;let c=A(e,r,a.qualifiedName)??A(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));s.push(f(a.importedName,a.localName,c,n))}}return s}function te(e,r){switch(e.type){case"identifier":case"super":case"self":case"crate":{let t=e.text;return[{qualifiedName:pe(r,t),importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,n=t.split("::").pop()??t;return[{qualifiedName:pe(r,t),importedName:n,localName:n}]}case"scoped_use_list":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=pe(r,t.text),o=[];for(let i of n.namedChildren)o.push(...te(i,s));return o}case"use_list":{let t=[];for(let n of e.namedChildren)t.push(...te(n,r));return t}case"use_as_clause":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=te(t,r),o=n.text;return s.map(i=>({...i,localName:o}))}case"use_wildcard":{let t=e.namedChild(0),n=t?t.text:"";return[{qualifiedName:pe(r,`${n}::*`),importedName:"*",localName:"*"}]}default:return[]}}function pe(e,r){return e?r?`${e}::${r}`:e:r}function dn(e,r,t,n){let s=t.trim();if(s.includes("{")&&s.includes("}")){let p=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),u=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return y(u).flatMap(m=>{let d=m.trim();if(!d||d==="self")return[];let[h,$]=d.split(/\s+as\s+/),U=h?.trim();if(!U)return[];let Ct=($??U.split("::").pop()??U).trim(),Pt=`${p}::${U}`.replace(/::::/g,"::");return[E(e,r,n,Pt,U.split("::").pop()??U,Ct,A(e,r,p))]})}let[o,i]=s.split(/\s+as\s+/),a=o?.trim()??s,c=(i??a.split("::").pop()??a).trim(),l=A(e,r,a)??A(e,r,a.split("::").slice(0,-1).join("::"));return[E(e,r,n,a,a.split("::").pop()??a,c,l)]}function yt(e,r,t){let n=R(e,r);if(n)return fn(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&s.push(...Sn(e,r,i))}return s}function fn(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("use_declaration")){if(!gn(s))continue;let o=s.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of te(o,""))i.importedName&&n.push(Ae(e,r,i.qualifiedName))}return n}function gn(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Sn(e,r,t){let n=t.trim();if(n.includes("{")&&n.includes("}")){let s=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),o=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${s}::${c?.trim()??a}`.replace(/::::/g,"::");return[Ae(e,r,l)]})}return[Ae(e,r,n)]}function Ae(e,r,t){return{specifier:t,sourcePath:A(e,r,t)??A(e,r,t.split("::").slice(0,-1).join("::"))}}function D({language:e,extensions:r,imports:t,parseImports:n}){return{language:e,extensions:r,capabilities:{imports:t},parseImports:n}}function bt(e,r){let t=r.toLowerCase();for(let n of e)for(let s of n.extensions)if(t.endsWith(s))return n;return null}var hn={language:"javascript",extensions:je,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:Fe,parseReExports:Le},xn=D({language:"python",extensions:De,imports:"ast-with-regex-fallback",parseImports:gt}),yn=D({language:"jvm",extensions:_,imports:"ast-dispatch-with-regex-fallback",parseImports:ut}),bn={language:"rust",extensions:Oe,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:xt,parseExports:yt},Nn=D({language:"ruby",extensions:Me,imports:"ast-with-regex-fallback",parseImports:St}),In=D({language:"c/cpp",extensions:ve,imports:"ast-with-regex-fallback",parseImports:nt}),Cn=D({language:"dotnet",extensions:B,imports:"ast-dispatch-with-regex-fallback",parseImports:ct}),Pn={language:"dart",extensions:$e,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:it,parseExports:at},_n=D({language:"php",extensions:H,imports:"ast-with-regex-fallback",parseImports:dt}),Rn=D({language:"clojure",extensions:Ue,imports:"regex-only",parseImports:ot}),En=[hn,xn,yn,bn,Nn,In,Cn,Pn,_n,Rn];function ue(e){return bt(En,e)}var ke={clearGroups:["whole-project","source-file"]},Tn=q("source-imports",ke),Fn=q("source-exports",ke),Ln=q("source-reexports",ke),Nt=K({kind:"source-imports",invalidation:X("source-imports"),serialize:An,deserialize:kn}),It=K({kind:"source-reexports",invalidation:X("source-reexports"),serialize:wn,deserialize:jn});function zo(e,r){let t=ne(r);return Ln.get(e,t,()=>{let n=ue(t);if(!n?.parseReExports)return[];let s=k(e,t);if(!s)return[];let o=W(e,t,s),i=ge(e),a=It.read(e,t,o);if(a?.resolutionFingerprint===i)return a.reExports;let c=n.parseReExports(e,t,s);return It.write(e,t,o,{resolutionFingerprint:i,reExports:c}),c})}function Vo(e,r){let t=ne(r);return Tn.get(e,t,()=>{let n=ue(t);if(!n)return[];let s=k(e,t);if(!s)return[];let o=W(e,t,s),i=ge(e),a=Nt.read(e,t,o);if(a?.resolutionFingerprint===i)return a.imports;let c=n.parseImports(e,t,s);return Nt.write(e,t,o,{resolutionFingerprint:i,imports:c}),c})}function Wo(e,r){let t=ne(r);return Fn.get(e,t,()=>{let n=ue(t);if(!n?.parseExports)return[];let s=k(e,t);return s?n.parseExports(e,t,s):[]})}function An(e){return JSON.stringify(e)}function kn(e){try{let r=JSON.parse(e);return!Se(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.imports)?null:{resolutionFingerprint:r.resolutionFingerprint,imports:r.imports}}catch{return null}}function wn(e){return JSON.stringify(e)}function jn(e){try{let r=JSON.parse(e);return!Se(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.reExports)?null:{resolutionFingerprint:r.resolutionFingerprint,reExports:r.reExports}}catch{return null}}export{O as a,_t as b,xe as c,T as d,Kt as e,Zt as f,er as g,nr as h,sr as i,or as j,ir as k,zo as l,Vo as m,Wo as n};
|
|
9
|
-
//# sourceMappingURL=chunk-T2FQ4GHD.js.map
|