scip-query 0.10.7 → 0.10.8
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 -1
- package/dist/{chunk-WVRTGVHJ.js → chunk-24S6MYOC.js} +2 -2
- package/dist/{chunk-CQEJU32R.js → chunk-2H57MJLI.js} +2 -2
- package/dist/{chunk-RISLKTKQ.js → chunk-2YI45TNM.js} +2 -2
- package/dist/{chunk-TDBTVMHY.js → chunk-3FYGJ2GY.js} +2 -2
- package/dist/chunk-4TMJDHC6.js +5 -0
- package/dist/{chunk-LQSLW7K7.js → chunk-5G5VI7J4.js} +2 -2
- package/dist/{chunk-UJEVABIR.js → chunk-5GVOJOBL.js} +2 -2
- package/dist/{chunk-GRZRMELG.js → chunk-5SMUKUV5.js} +2 -2
- package/dist/{chunk-XYI7XRZC.js → chunk-63MSELOP.js} +2 -2
- package/dist/{chunk-DBTL56LR.js → chunk-6BNOACLT.js} +2 -2
- package/dist/{chunk-PTKQNPWX.js → chunk-6EO3E3IP.js} +2 -2
- package/dist/{chunk-NIGHS7UP.js → chunk-6N6QTGSD.js} +2 -2
- package/dist/{chunk-OZUJ3VZS.js → chunk-6TDOT7B3.js} +2 -2
- package/dist/{chunk-QR337MAA.js → chunk-7KJBH4IP.js} +2 -2
- package/dist/{chunk-7AOMEMOA.js → chunk-7XWXGANX.js} +2 -2
- package/dist/{chunk-27FU2KX7.js → chunk-AA7L7GKI.js} +2 -2
- package/dist/chunk-AETMKBZR.js +40 -0
- package/dist/{chunk-MJXJ56LG.js → chunk-ANIOISCE.js} +2 -2
- package/dist/{chunk-OWXN6ZS5.js → chunk-B4EHYG6M.js} +2 -2
- package/dist/{chunk-S7DNZ6IW.js → chunk-BEUQVBE3.js} +2 -2
- package/dist/{chunk-SXESPZUX.js → chunk-BJG67TCR.js} +2 -2
- package/dist/{chunk-OT6CDRKC.js → chunk-BJWNO6BU.js} +2 -2
- package/dist/chunk-BTCASU5J.js +3 -0
- package/dist/{chunk-UBDFQBSE.js → chunk-BWL2ECGQ.js} +2 -2
- package/dist/{chunk-FXWV2V7K.js → chunk-BZ53S4ZN.js} +2 -2
- package/dist/{chunk-MHATKJ3J.js → chunk-C6BYNIH4.js} +2 -2
- package/dist/chunk-COUFCH64.js +2 -0
- package/dist/{chunk-OFO7BIRK.js → chunk-E2CCBFLR.js} +2 -2
- package/dist/{chunk-GOWLZ4NA.js → chunk-EBIQY3RK.js} +2 -2
- package/dist/{chunk-ZUTV7DDX.js → chunk-EKECQP6Z.js} +2 -2
- package/dist/{chunk-72QDTW5U.js → chunk-FGTHPJON.js} +2 -2
- package/dist/{chunk-EPPCGQUI.js → chunk-FHWEEQVO.js} +2 -2
- package/dist/{chunk-H6RLM7D7.js → chunk-FKUCFCLU.js} +2 -2
- package/dist/chunk-FVA3NH4P.js +2 -0
- package/dist/{chunk-VA3FJ3AY.js → chunk-GZQID3FS.js} +2 -2
- package/dist/{chunk-QVS4SYAX.js → chunk-I274B3B3.js} +2 -2
- package/dist/{chunk-KUIIQPDA.js → chunk-J6ADQKQA.js} +2 -2
- package/dist/{chunk-J43GIAVM.js → chunk-JRUKS66S.js} +2 -2
- package/dist/{chunk-PQ6QG3EX.js → chunk-JUIAOOK7.js} +2 -2
- package/dist/{chunk-YNLK3G63.js → chunk-JYSAYZNX.js} +2 -2
- package/dist/{chunk-DOZ2X6TS.js → chunk-K7VBTWNR.js} +2 -2
- package/dist/{chunk-JOGZKF5W.js → chunk-KLXVEBVC.js} +2 -2
- package/dist/{chunk-IL2EVPYP.js → chunk-KZYHFI2X.js} +2 -2
- package/dist/{chunk-FRIASDLG.js → chunk-L4QKEQ4S.js} +2 -2
- package/dist/{chunk-KT2ZO3CE.js → chunk-LGX2Y4BA.js} +2 -2
- package/dist/{chunk-QMH2D6S5.js → chunk-LWTML2AN.js} +2 -2
- package/dist/{chunk-OMGE3V2Q.js → chunk-MEKSFV6H.js} +2 -2
- package/dist/{chunk-QPTVFG4O.js → chunk-N7F5UM6J.js} +2 -2
- package/dist/{chunk-GKRRO3WC.js → chunk-NWFSC356.js} +2 -2
- package/dist/{chunk-WMIQMXSK.js → chunk-Q34NWRPP.js} +2 -2
- package/dist/{chunk-FPYQA7JK.js → chunk-QDGKE5HN.js} +2 -2
- package/dist/{chunk-XBIF45WK.js → chunk-RHKMQNFI.js} +2 -2
- package/dist/{chunk-U73YFD3P.js → chunk-RSKOYTSY.js} +2 -2
- package/dist/{chunk-G2CGUNQU.js → chunk-RY7CAOJF.js} +2 -2
- package/dist/{chunk-YOCYR7KJ.js → chunk-S7YOLFLX.js} +2 -2
- package/dist/{chunk-GIOT3O6P.js → chunk-SHM5D3DQ.js} +2 -2
- package/dist/chunk-SOGKYB5I.js +8 -0
- package/dist/{chunk-733EF5FD.js → chunk-T633QLYF.js} +2 -2
- package/dist/{chunk-IA7Q6HVP.js → chunk-VAXDTQHE.js} +2 -2
- package/dist/{chunk-FXI3AAKO.js → chunk-VFLHKRTW.js} +2 -2
- package/dist/{chunk-5LM7RJMQ.js → chunk-VMPB52FG.js} +2 -2
- package/dist/{chunk-WXMVK53S.js → chunk-VXT7WVIN.js} +2 -2
- package/dist/{chunk-TJXOD4IK.js → chunk-X3BJUFSN.js} +2 -2
- package/dist/{chunk-EOUTP32Q.js → chunk-X3Z4MLVL.js} +2 -2
- package/dist/chunk-XPOZO76D.js +2 -0
- package/dist/{chunk-M3YEHOCD.js → chunk-XWC67C3Q.js} +2 -2
- package/dist/{chunk-MFWAZFYD.js → chunk-YNSVAJR6.js} +2 -2
- package/dist/chunk-YWOOQ4FF.js +2 -0
- package/dist/{chunk-EW64FEJL.js → chunk-ZDR4VTOP.js} +2 -2
- package/dist/{chunk-5JXH6VGF.js → chunk-ZL52RLDK.js} +2 -2
- package/dist/{chunk-XAYARHNF.js → chunk-ZMU6IWDK.js} +2 -2
- package/dist/cli.js +190 -190
- package/dist/index.js +1 -1
- package/dist/postinstall.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/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/drift.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.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.d.ts +9 -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-imports.js +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/runtime.js +1 -1
- package/docs/COMMAND_REFERENCE.md +1 -1
- package/package.json +1 -1
- package/skills/scip-hyper-optimization/SKILL.md +97 -0
- package/skills/scip-hyper-optimization/agents/openai.yaml +4 -0
- package/skills/scip-query/SKILL.md +4 -0
- package/dist/chunk-3C4NIBY5.js +0 -2
- package/dist/chunk-5MHQI4RR.js +0 -3
- package/dist/chunk-BZ2RRK7Y.js +0 -8
- package/dist/chunk-CMXD5VC4.js +0 -2
- package/dist/chunk-FKYPOK7P.js +0 -5
- package/dist/chunk-HDBQHJNY.js +0 -2
- package/dist/chunk-LONIY5FF.js +0 -2
- package/dist/chunk-W2TIXAGN.js +0 -40
package/dist/queries/system.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-BJWNO6BU.js";import"../chunk-LGX2Y4BA.js";import"../chunk-T633QLYF.js";import"../chunk-X3BJUFSN.js";import"../chunk-JM72FNGA.js";import"../chunk-6TDOT7B3.js";import"../chunk-YZA6PPZL.js";import"../chunk-BTCASU5J.js";import"../chunk-DS6QEB3G.js";import"../chunk-C6ROZBJA.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as system};
|
|
2
2
|
//# sourceMappingURL=system.js.map
|
package/dist/queries/trace.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-FGTHPJON.js";import"../chunk-AETMKBZR.js";import"../chunk-RSKOYTSY.js";import"../chunk-T633QLYF.js";import"../chunk-RY7CAOJF.js";import"../chunk-3LQFMQPY.js";import"../chunk-X3BJUFSN.js";import"../chunk-JM72FNGA.js";import"../chunk-6TDOT7B3.js";import"../chunk-YZA6PPZL.js";import"../chunk-BTCASU5J.js";import"../chunk-DS6QEB3G.js";import"../chunk-C6ROZBJA.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as trace};
|
|
2
2
|
//# sourceMappingURL=trace.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-MEKSFV6H.js";import"../chunk-LGX2Y4BA.js";import"../chunk-RSKOYTSY.js";import"../chunk-T633QLYF.js";import"../chunk-RY7CAOJF.js";import"../chunk-3LQFMQPY.js";import"../chunk-X3BJUFSN.js";import"../chunk-JM72FNGA.js";import"../chunk-6TDOT7B3.js";import"../chunk-YZA6PPZL.js";import"../chunk-BTCASU5J.js";import"../chunk-DS6QEB3G.js";import"../chunk-C6ROZBJA.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{b as importedBy,a as imports,c as unusedImports};
|
|
2
2
|
//# sourceMappingURL=unused-imports.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-S7YOLFLX.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-XPOZO76D.js";import"../chunk-ANIOISCE.js";import"../chunk-BGBBVSH4.js";import"../chunk-YNSVAJR6.js";import"../chunk-ZMU6IWDK.js";import"../chunk-AETMKBZR.js";import"../chunk-RSKOYTSY.js";import"../chunk-T633QLYF.js";import"../chunk-2YI45TNM.js";import"../chunk-RY7CAOJF.js";import"../chunk-3LQFMQPY.js";import"../chunk-X3BJUFSN.js";import"../chunk-JM72FNGA.js";import"../chunk-6TDOT7B3.js";import"../chunk-YZA6PPZL.js";import"../chunk-BTCASU5J.js";import"../chunk-DS6QEB3G.js";import"../chunk-C6ROZBJA.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as unusedParams};
|
|
2
2
|
//# sourceMappingURL=unused-params.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-2H57MJLI.js";import"../chunk-BZ53S4ZN.js";import"../chunk-PVZMPG5I.js";import"../chunk-YWOOQ4FF.js";import"../chunk-YZA6PPZL.js";import"../chunk-DS6QEB3G.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueComponentDuplicates};
|
|
2
2
|
//# sourceMappingURL=vue-component-duplicates.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-EKECQP6Z.js";import"../chunk-BZ53S4ZN.js";import"../chunk-PVZMPG5I.js";import"../chunk-YWOOQ4FF.js";import"../chunk-YZA6PPZL.js";import"../chunk-DS6QEB3G.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueComposableCandidates};
|
|
2
2
|
//# sourceMappingURL=vue-composable-candidates.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-I274B3B3.js";import"../chunk-VFLHKRTW.js";import"../chunk-LM5SHAN4.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-XPOZO76D.js";import"../chunk-ANIOISCE.js";import"../chunk-BGBBVSH4.js";import"../chunk-YNSVAJR6.js";import"../chunk-ZMU6IWDK.js";import"../chunk-AETMKBZR.js";import"../chunk-RSKOYTSY.js";import"../chunk-T633QLYF.js";import"../chunk-2YI45TNM.js";import"../chunk-RY7CAOJF.js";import"../chunk-3LQFMQPY.js";import"../chunk-X3BJUFSN.js";import"../chunk-JM72FNGA.js";import"../chunk-6TDOT7B3.js";import"../chunk-YZA6PPZL.js";import"../chunk-BTCASU5J.js";import"../chunk-DS6QEB3G.js";import"../chunk-C6ROZBJA.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as wrapperCandidates};
|
|
2
2
|
//# sourceMappingURL=wrapper-candidates.js.map
|
package/dist/runtime.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{c as I,d as M,e as E}from"./chunk-ONPCQ2PM.js";import{a as C}from"./chunk-UUBMFL3F.js";import{readFileSync as $,writeFileSync as D,existsSync as R,mkdirSync as _}from"fs";import{isAbsolute as oe,join as c,relative as ae,resolve as P}from"path";import{createHash as A}from"crypto";import{homedir as N}from"os";var g=".scipquery.json",W={enabled:!1,debounceMs:3e4,cooldownMs:6e4,gitPollMs:2e3,autoRefresh:!0,ignore:[]};function m(i){let e=c(i,g);if(!R(e))return{};try{let t=$(e,"utf-8");return JSON.parse(t)}catch(t){let r=t instanceof Error?t.message:String(t);throw t instanceof SyntaxError?new Error(`invalid ${g} at ${e}: ${r}`,{cause:t}):new Error(`unable to read ${g} at ${e}: ${r}`,{cause:t})}}function j(i){return{...W,...i.watch}}function G(i,e){let t=process.env.SCIP_QUERY_CACHE_DIR;if(t)return f(t);if(e?.dbPath)return f(P(i,e.dbPath));let s=process.env.XDG_CACHE_HOME||c(N(),".cache"),n=A("sha256").update(P(i)).digest("hex").slice(0,12),a=c(s,"scip-query","projects",n);return f(a)}function y(i,e){let t=G(i,e);return{cacheDir:t,dbPath:c(t,"index.db"),indexPath:c(t,"index.scip"),metaPath:c(t,"meta.json")}}function F(i,e){let t=c(i,g);return R(t)||D(t,JSON.stringify({languages:e,watch:{enabled:!1,debounceMs:3e4,cooldownMs:6e4,gitPollMs:2e3,autoRefresh:!0}},null,2)+`
|
|
2
|
-
`),t}function f(i){return _(i,{recursive:!0}),i}import{execFileSync as O,fork as L}from"child_process";import{statSync as U,watch as H}from"fs";import{join as q,relative as X}from"path";import B from"ignore";var x=class{projectRoot;config;watchConfig;languages;pnpmWorkspaces;typescriptProjectMode;typescriptProjects;indexerConcurrency;onStatus;onReindexComplete;onError;status={state:"idle"};debounceTimer=null;cooldownTimer=null;dirty=!1;changedFiles=0;pendingTrigger=null;reindexInFlight=!1;lastReindexEnd=0;fsWatchers=[];gitPollTimer=null;lastGitState=null;gitignoreFilter;extraIgnore;stopped=!1;constructor(e){this.projectRoot=e.projectRoot,this.config=e.config,this.watchConfig=j(e.config),this.languages=e.languages,this.pnpmWorkspaces=e.config.indexer?.typescript?.pnpmWorkspaces??!1,this.typescriptProjectMode=e.config.indexer?.typescript?.projectMode,this.typescriptProjects=e.config.indexer?.typescript?.projects,this.indexerConcurrency=e.config.indexerConcurrency,this.onStatus=e.onStatus??(()=>{}),this.onReindexComplete=e.onReindexComplete??(()=>{}),this.onError=e.onError??(t=>console.error(t.message)),this.gitignoreFilter=C(e.projectRoot),this.extraIgnore=B(),this.watchConfig.ignore.length>0&&this.extraIgnore.add(this.watchConfig.ignore)}start(){this.stopped=!1,this.setStatus({state:"idle"}),this.startGitStatePolling();try{let e=H(this.projectRoot,{recursive:!0},(t,r)=>{r&&!this.stopped&&this.handleFileChange(r)});this.fsWatchers.push(e)}catch{this.onError(new Error("Failed to start file watcher. On Linux, you may need to increase inotify limits: sysctl -w fs.inotify.max_user_watches=524288"))}}stop(){this.stopped=!0;for(let e of this.fsWatchers)e.close();this.fsWatchers=[],this.clearDebounceTimer(),this.clearCooldownTimer(),this.clearGitPollTimer(),this.setStatus({state:"idle"})}handleFileChange(e){let t=X(this.projectRoot,q(this.projectRoot,e));t===".git"||t.startsWith(".git/")||this.gitignoreFilter.isIgnored(t)||this.extraIgnore.ignores(t)||e.endsWith("index.db")||e.endsWith("index.scip")||e.endsWith("index.db.tmp")||this.scheduleReindex({kind:"watch-source",detail:t})}scheduleReindex(e){if(this.pendingTrigger=z(this.pendingTrigger,e),this.changedFiles++,this.reindexInFlight){this.dirty=!0,this.setStatus({state:"indexing",startedAt:this.status.startedAt});return}if(this.status.state==="cooldown"){this.dirty=!0,this.setStatus({state:"cooldown",until:this.status.until,dirty:!0});return}this.clearDebounceTimer();let t=Date.now()+this.watchConfig.debounceMs;this.setStatus({state:"waiting",changedFiles:this.changedFiles,reindexAt:t}),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.triggerReindex()},this.watchConfig.debounceMs)}triggerReindex(){if(this.reindexInFlight||this.stopped)return;let e=Date.now()-this.lastReindexEnd;if(this.lastReindexEnd>0&&e<this.watchConfig.cooldownMs){let s=this.watchConfig.cooldownMs-e;this.dirty=!0;let n=Date.now()+s;this.setStatus({state:"cooldown",until:n,dirty:!0}),this.cooldownTimer=setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped&&(this.dirty=!1,this.triggerReindex())},s);return}this.reindexInFlight=!0,this.dirty=!1,this.changedFiles=0;let t=this.pendingTrigger??{kind:"watch-source"};this.pendingTrigger=null;let r=Date.now();this.setStatus({state:"indexing",startedAt:r}),this.runReindex(t).then(s=>{if(this.reindexInFlight=!1,this.lastReindexEnd=Date.now(),this.onReindexComplete(s),this.dirty&&!this.stopped){let n=Date.now()+this.watchConfig.cooldownMs;this.setStatus({state:"cooldown",until:n,dirty:!0}),this.cooldownTimer=setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped?(this.dirty=!1,this.triggerReindex()):this.setStatus({state:"idle"})},this.watchConfig.cooldownMs)}else this.setStatus({state:"idle"})}).catch(s=>{this.reindexInFlight=!1,this.lastReindexEnd=Date.now(),this.onError(s instanceof Error?s:new Error(String(s))),this.setStatus({state:"idle"})})}runReindex(e){return new Promise((t,r)=>{let s=Date.now(),n=m(this.projectRoot),a=Object.keys(n).length>0?n:this.config,h=y(this.projectRoot,a),l=a.indexer?.typescript,o=L(new URL("./reindex-worker.js",import.meta.url).pathname,[],{detached:!0,env:{...process.env,SCIP_REINDEX_PROJECT_ROOT:this.projectRoot,SCIP_REINDEX_OUTPUT_SCIP:h.indexPath,SCIP_REINDEX_OUTPUT_DB:h.dbPath,SCIP_REINDEX_LANGUAGES:(a.languages??this.languages)?.join(",")??"",SCIP_REINDEX_INDEXER_CONCURRENCY:String(a.indexerConcurrency??this.indexerConcurrency??""),SCIP_REINDEX_PNPM_WORKSPACES:l?.pnpmWorkspaces??this.pnpmWorkspaces?"1":"",SCIP_REINDEX_TYPESCRIPT_CONFIG:JSON.stringify({projectMode:l?.projectMode??this.typescriptProjectMode,projects:l?.projects??this.typescriptProjects??[]}),SCIP_REINDEX_TRIGGER_KIND:e.kind,SCIP_REINDEX_TRIGGER_DETAIL:e.detail??""},stdio:"pipe"});o.on("exit",p=>{p===0?t(Date.now()-s):r(new Error(`Reindex worker exited with code ${p}`))}),o.on("error",r)})}setStatus(e){this.status=e,this.onStatus(e)}clearDebounceTimer(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}clearCooldownTimer(){this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null)}startGitStatePolling(){this.lastGitState=this.readGitState(),this.lastGitState&&(this.gitPollTimer=setInterval(()=>this.pollGitState(),this.watchConfig.gitPollMs),this.gitPollTimer.unref?.())}pollGitState(){let e=this.lastGitState,t=this.readGitState();if(!e||!t||this.stopped){this.lastGitState=t;return}this.lastGitState=t;let r=e.head!==t.head,s=e.indexPath!==t.indexPath||e.indexMtimeMs!==t.indexMtimeMs||e.indexSize!==t.indexSize;r&&s?this.scheduleReindex({kind:"watch-git-state",detail:"HEAD and index changed"}):r?this.scheduleReindex({kind:"watch-git-head",detail:"HEAD changed"}):s&&this.scheduleReindex({kind:"watch-git-index",detail:t.indexPath??"index changed"})}readGitState(){let e=T(this.projectRoot,["rev-parse","--git-path","index"]);if(!e)return null;let t={head:T(this.projectRoot,["rev-parse","--verify","HEAD"]),indexPath:e};try{let r=U(e);t.indexMtimeMs=r.mtimeMs,t.indexSize=r.size}catch{t.indexMtimeMs=void 0,t.indexSize=void 0}return t}clearGitPollTimer(){this.gitPollTimer&&(clearInterval(this.gitPollTimer),this.gitPollTimer=null)}};function T(i,e){try{return O("git",["-C",i,...e],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function z(i,e){return i?i.kind===e.kind?i.detail===e.detail?i:{kind:i.kind,detail:"multiple changes"}:{kind:"watch-git-state",detail:`${i.kind}, ${e.kind}`}:e}import{existsSync as S,mkdirSync as J,symlinkSync as K,readlinkSync as V,unlinkSync as Y}from"fs";import{join as d,dirname as k,resolve as v}from"path";import{homedir as w,platform as Q}from"os";import{fileURLToPath as Z}from"url";var ee=Q()==="win32",te=["scip-query","scip-query-setup","scip-adoption","scip-health-audit","scip-health-improve","scip-api-impact","concrete-plan","scip-ai-cleanup","scip-debug","scip-explore","scip-triage-issue","scip-diagram","scip-debloat","scip-doc-reconcile","scip-directory-architecture","scip-maintainability","scip-react-maintainability","scip-vue-maintainability","scip-verify","scip-language-playbook"];function ie(i={}){let e=i.quiet?()=>{}:console.log,t=Z(import.meta.url),r=v(k(t),"..","skills"),s=[d(w(),".claude","skills"),d(w(),".codex","skills"),d(w(),".agents","skills")],n={installed:[],skipped:[],alreadyLinked:[]};for(let a of s){let h=k(a);if(!S(h))continue;J(a,{recursive:!0});let l=re(a);for(let o of te){let p=d(r,o),u=d(a,o);if(!S(p)){n.skipped.push(`${l}/${o}`);continue}if(S(u)){try{let b=V(u);if(v(b)===v(p)){n.alreadyLinked.push(`${l}/${o}`),e(` ok: ${o} \u2192 ${l} (already linked)`);continue}}catch{n.skipped.push(`${l}/${o}`),e(` skip: ${o} \u2192 ${l} (exists, not a symlink)`);continue}Y(u)}K(p,u,ee?"junction":"dir"),n.installed.push(`${l}/${o}`),e(` done: ${o} \u2192 ${l}`)}}return n}function re(i){return i.includes(".codex")?"Codex":i.includes(".agents")?"Agents":"Claude"}export{x as Watcher,M as getScipVersion,F as initProjectConfig,ie as installSkills,I as isScipInstalled,m as loadProjectConfig,E as printScipInstallInstructions,y as resolveIndexPaths};
|
|
2
|
+
`),t}function f(i){return _(i,{recursive:!0}),i}import{execFileSync as O,fork as L}from"child_process";import{statSync as U,watch as H}from"fs";import{join as q,relative as X}from"path";import B from"ignore";var x=class{projectRoot;config;watchConfig;languages;pnpmWorkspaces;typescriptProjectMode;typescriptProjects;indexerConcurrency;onStatus;onReindexComplete;onError;status={state:"idle"};debounceTimer=null;cooldownTimer=null;dirty=!1;changedFiles=0;pendingTrigger=null;reindexInFlight=!1;lastReindexEnd=0;fsWatchers=[];gitPollTimer=null;lastGitState=null;gitignoreFilter;extraIgnore;stopped=!1;constructor(e){this.projectRoot=e.projectRoot,this.config=e.config,this.watchConfig=j(e.config),this.languages=e.languages,this.pnpmWorkspaces=e.config.indexer?.typescript?.pnpmWorkspaces??!1,this.typescriptProjectMode=e.config.indexer?.typescript?.projectMode,this.typescriptProjects=e.config.indexer?.typescript?.projects,this.indexerConcurrency=e.config.indexerConcurrency,this.onStatus=e.onStatus??(()=>{}),this.onReindexComplete=e.onReindexComplete??(()=>{}),this.onError=e.onError??(t=>console.error(t.message)),this.gitignoreFilter=C(e.projectRoot),this.extraIgnore=B(),this.watchConfig.ignore.length>0&&this.extraIgnore.add(this.watchConfig.ignore)}start(){this.stopped=!1,this.setStatus({state:"idle"}),this.startGitStatePolling();try{let e=H(this.projectRoot,{recursive:!0},(t,r)=>{r&&!this.stopped&&this.handleFileChange(r)});this.fsWatchers.push(e)}catch{this.onError(new Error("Failed to start file watcher. On Linux, you may need to increase inotify limits: sysctl -w fs.inotify.max_user_watches=524288"))}}stop(){this.stopped=!0;for(let e of this.fsWatchers)e.close();this.fsWatchers=[],this.clearDebounceTimer(),this.clearCooldownTimer(),this.clearGitPollTimer(),this.setStatus({state:"idle"})}handleFileChange(e){let t=X(this.projectRoot,q(this.projectRoot,e));t===".git"||t.startsWith(".git/")||this.gitignoreFilter.isIgnored(t)||this.extraIgnore.ignores(t)||e.endsWith("index.db")||e.endsWith("index.scip")||e.endsWith("index.db.tmp")||this.scheduleReindex({kind:"watch-source",detail:t})}scheduleReindex(e){if(this.pendingTrigger=z(this.pendingTrigger,e),this.changedFiles++,this.reindexInFlight){this.dirty=!0,this.setStatus({state:"indexing",startedAt:this.status.startedAt});return}if(this.status.state==="cooldown"){this.dirty=!0,this.setStatus({state:"cooldown",until:this.status.until,dirty:!0});return}this.clearDebounceTimer();let t=Date.now()+this.watchConfig.debounceMs;this.setStatus({state:"waiting",changedFiles:this.changedFiles,reindexAt:t}),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.triggerReindex()},this.watchConfig.debounceMs)}triggerReindex(){if(this.reindexInFlight||this.stopped)return;let e=Date.now()-this.lastReindexEnd;if(this.lastReindexEnd>0&&e<this.watchConfig.cooldownMs){let s=this.watchConfig.cooldownMs-e;this.dirty=!0;let n=Date.now()+s;this.setStatus({state:"cooldown",until:n,dirty:!0}),this.cooldownTimer=setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped&&(this.dirty=!1,this.triggerReindex())},s);return}this.reindexInFlight=!0,this.dirty=!1,this.changedFiles=0;let t=this.pendingTrigger??{kind:"watch-source"};this.pendingTrigger=null;let r=Date.now();this.setStatus({state:"indexing",startedAt:r}),this.runReindex(t).then(s=>{if(this.reindexInFlight=!1,this.lastReindexEnd=Date.now(),this.onReindexComplete(s),this.dirty&&!this.stopped){let n=Date.now()+this.watchConfig.cooldownMs;this.setStatus({state:"cooldown",until:n,dirty:!0}),this.cooldownTimer=setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped?(this.dirty=!1,this.triggerReindex()):this.setStatus({state:"idle"})},this.watchConfig.cooldownMs)}else this.setStatus({state:"idle"})}).catch(s=>{this.reindexInFlight=!1,this.lastReindexEnd=Date.now(),this.onError(s instanceof Error?s:new Error(String(s))),this.setStatus({state:"idle"})})}runReindex(e){return new Promise((t,r)=>{let s=Date.now(),n=m(this.projectRoot),a=Object.keys(n).length>0?n:this.config,h=y(this.projectRoot,a),l=a.indexer?.typescript,o=L(new URL("./reindex-worker.js",import.meta.url).pathname,[],{detached:!0,env:{...process.env,SCIP_REINDEX_PROJECT_ROOT:this.projectRoot,SCIP_REINDEX_OUTPUT_SCIP:h.indexPath,SCIP_REINDEX_OUTPUT_DB:h.dbPath,SCIP_REINDEX_LANGUAGES:(a.languages??this.languages)?.join(",")??"",SCIP_REINDEX_INDEXER_CONCURRENCY:String(a.indexerConcurrency??this.indexerConcurrency??""),SCIP_REINDEX_PNPM_WORKSPACES:l?.pnpmWorkspaces??this.pnpmWorkspaces?"1":"",SCIP_REINDEX_TYPESCRIPT_CONFIG:JSON.stringify({projectMode:l?.projectMode??this.typescriptProjectMode,projects:l?.projects??this.typescriptProjects??[]}),SCIP_REINDEX_TRIGGER_KIND:e.kind,SCIP_REINDEX_TRIGGER_DETAIL:e.detail??""},stdio:"pipe"});o.on("exit",p=>{p===0?t(Date.now()-s):r(new Error(`Reindex worker exited with code ${p}`))}),o.on("error",r)})}setStatus(e){this.status=e,this.onStatus(e)}clearDebounceTimer(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}clearCooldownTimer(){this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null)}startGitStatePolling(){this.lastGitState=this.readGitState(),this.lastGitState&&(this.gitPollTimer=setInterval(()=>this.pollGitState(),this.watchConfig.gitPollMs),this.gitPollTimer.unref?.())}pollGitState(){let e=this.lastGitState,t=this.readGitState();if(!e||!t||this.stopped){this.lastGitState=t;return}this.lastGitState=t;let r=e.head!==t.head,s=e.indexPath!==t.indexPath||e.indexMtimeMs!==t.indexMtimeMs||e.indexSize!==t.indexSize;r&&s?this.scheduleReindex({kind:"watch-git-state",detail:"HEAD and index changed"}):r?this.scheduleReindex({kind:"watch-git-head",detail:"HEAD changed"}):s&&this.scheduleReindex({kind:"watch-git-index",detail:t.indexPath??"index changed"})}readGitState(){let e=T(this.projectRoot,["rev-parse","--git-path","index"]);if(!e)return null;let t={head:T(this.projectRoot,["rev-parse","--verify","HEAD"]),indexPath:e};try{let r=U(e);t.indexMtimeMs=r.mtimeMs,t.indexSize=r.size}catch{t.indexMtimeMs=void 0,t.indexSize=void 0}return t}clearGitPollTimer(){this.gitPollTimer&&(clearInterval(this.gitPollTimer),this.gitPollTimer=null)}};function T(i,e){try{return O("git",["-C",i,...e],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function z(i,e){return i?i.kind===e.kind?i.detail===e.detail?i:{kind:i.kind,detail:"multiple changes"}:{kind:"watch-git-state",detail:`${i.kind}, ${e.kind}`}:e}import{existsSync as S,mkdirSync as J,symlinkSync as K,readlinkSync as V,unlinkSync as Y}from"fs";import{join as d,dirname as k,resolve as v}from"path";import{homedir as w,platform as Q}from"os";import{fileURLToPath as Z}from"url";var ee=Q()==="win32",te=["scip-query","scip-query-setup","scip-adoption","scip-health-audit","scip-health-improve","scip-hyper-optimization","scip-api-impact","concrete-plan","scip-ai-cleanup","scip-debug","scip-explore","scip-triage-issue","scip-diagram","scip-debloat","scip-doc-reconcile","scip-directory-architecture","scip-maintainability","scip-react-maintainability","scip-vue-maintainability","scip-verify","scip-language-playbook"];function ie(i={}){let e=i.quiet?()=>{}:console.log,t=Z(import.meta.url),r=v(k(t),"..","skills"),s=[d(w(),".claude","skills"),d(w(),".codex","skills"),d(w(),".agents","skills")],n={installed:[],skipped:[],alreadyLinked:[]};for(let a of s){let h=k(a);if(!S(h))continue;J(a,{recursive:!0});let l=re(a);for(let o of te){let p=d(r,o),u=d(a,o);if(!S(p)){n.skipped.push(`${l}/${o}`);continue}if(S(u)){try{let b=V(u);if(v(b)===v(p)){n.alreadyLinked.push(`${l}/${o}`),e(` ok: ${o} \u2192 ${l} (already linked)`);continue}}catch{n.skipped.push(`${l}/${o}`),e(` skip: ${o} \u2192 ${l} (exists, not a symlink)`);continue}Y(u)}K(p,u,ee?"junction":"dir"),n.installed.push(`${l}/${o}`),e(` done: ${o} \u2192 ${l}`)}}return n}function re(i){return i.includes(".codex")?"Codex":i.includes(".agents")?"Agents":"Claude"}export{x as Watcher,M as getScipVersion,F as initProjectConfig,ie as installSkills,I as isScipInstalled,m as loadProjectConfig,E as printScipInstallInstructions,y as resolveIndexPaths};
|
|
3
3
|
//# sourceMappingURL=runtime.js.map
|
|
@@ -116,7 +116,7 @@ This syntax summary is generated from the CLI command descriptors. Keep workflow
|
|
|
116
116
|
| Command | Description | Options |
|
|
117
117
|
|---|---|---|
|
|
118
118
|
| `bench` | Benchmark indexing and command runtimes for this repository | `--json`<br>`--cold-index`<br>`--include-heavy`<br>`--command <cmd>`<br>`--timeout-ms <n>` |
|
|
119
|
-
| `install-skills` | Install skills (scip-query, scip-query-setup, scip-adoption, scip-health-audit, scip-health-improve, scip-api-impact, concrete-plan, scip-ai-cleanup, scip-debug, scip-explore, scip-triage-issue, scip-diagram, scip-debloat, scip-doc-reconcile, scip-directory-architecture, scip-maintainability, scip-react-maintainability, scip-vue-maintainability, scip-verify, scip-language-playbook) into Claude Code, Codex, and shared agent roots | - |
|
|
119
|
+
| `install-skills` | Install skills (scip-query, scip-query-setup, scip-adoption, scip-health-audit, scip-health-improve, scip-hyper-optimization, scip-api-impact, concrete-plan, scip-ai-cleanup, scip-debug, scip-explore, scip-triage-issue, scip-diagram, scip-debloat, scip-doc-reconcile, scip-directory-architecture, scip-maintainability, scip-react-maintainability, scip-vue-maintainability, scip-verify, scip-language-playbook) into Claude Code, Codex, and shared agent roots | - |
|
|
120
120
|
| `setup-hooks` | Install or refresh project-local Codex and Claude Code lifecycle hooks | `--json` |
|
|
121
121
|
| `check-deps` | Check whether scip-query and the detected language indexers are actually runnable | - |
|
|
122
122
|
| `capabilities` | Report which evidence and verification capabilities are available in this project | `--json` |
|
package/package.json
CHANGED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scip-hyper-optimization
|
|
3
|
+
description: Run scientific performance optimization campaigns with scip-query evidence, command ledgers, and benchmark corpora. Use when the user asks to hyper optimize, make commands blazing fast, speed up a CLI/tool/app, benchmark regressions, or compare targeted tuning against radically different implementations.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SCIP Hyper Optimization
|
|
7
|
+
Use this skill to make a command, workflow, service, page, or tool as fast as
|
|
8
|
+
feasibly possible without changing its observable result. Hyper optimization is
|
|
9
|
+
a bounded campaign that improves runtime, memory use, or computational cost
|
|
10
|
+
against objective measurements; every accepted change is proven by a repeatable
|
|
11
|
+
benchmark and unchanged output.
|
|
12
|
+
|
|
13
|
+
A measurement harness is the repeatable set of commands, fixtures, corpora,
|
|
14
|
+
environment notes, and result documents used to decide whether performance
|
|
15
|
+
changed. A command ledger is the living document for one target: what it
|
|
16
|
+
returns, what code runs, where time is spent, what was tried, and what evidence
|
|
17
|
+
accepted or rejected each idea.
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
|
|
21
|
+
1. Do not optimize until a measurement harness exists or has been created.
|
|
22
|
+
2. Use scip-query for code understanding: `status`, `plan-context`, `trace`,
|
|
23
|
+
`call-graph`, `code`, `dataflow`, `complexity`, `diff-impact`, `diff-gate`.
|
|
24
|
+
3. Capture representative inputs, required output behavior, and correctness
|
|
25
|
+
checks before editing.
|
|
26
|
+
4. Measure cold and warm paths when both matter; record exact commands, corpus,
|
|
27
|
+
elapsed time, repetitions, and outliers.
|
|
28
|
+
5. Work both tracks: tune the current pipeline and evaluate radically different
|
|
29
|
+
algorithms or data models that preserve the same result.
|
|
30
|
+
6. Keep only changes that improve real workloads without reducing accuracy,
|
|
31
|
+
diagnostics, safety checks, or supported inputs.
|
|
32
|
+
|
|
33
|
+
## Phase 0: Measurement Harness
|
|
34
|
+
If the target repository is not already a reliable scip-query workspace, invoke
|
|
35
|
+
`scip-query-setup` first. Do not run setup-ci in this workflow.
|
|
36
|
+
|
|
37
|
+
Create or update a benchmark note before code changes. Prefer the repo's
|
|
38
|
+
existing convention; otherwise use
|
|
39
|
+
`docs/benchmarks/YYYY-MM-DD-<target>-baseline.md`. Include target, machine/date
|
|
40
|
+
context, corpus or fixture list, cold/warm/correctness commands, baseline
|
|
41
|
+
timings, output-contract evidence, and slowest stages.
|
|
42
|
+
|
|
43
|
+
Choose the measurement mechanism from the target's real workload. For app
|
|
44
|
+
paths, use the app's benchmark, test, route smoke, build, profiler, load test,
|
|
45
|
+
or timing script; if none exists, create the smallest repeatable timing command.
|
|
46
|
+
For scip-query command, detector, or indexer targets, benchmark the relevant
|
|
47
|
+
command matrix:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
scip-query bench --json
|
|
51
|
+
scip-query bench --json --cold-index --include-heavy --timeout-ms 600000
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Phase 1: Command Ledger
|
|
55
|
+
Create one ledger per target:
|
|
56
|
+
`docs/benchmarks/YYYY-MM-DD-<target>-ledger.md`. Include Output Contract,
|
|
57
|
+
Current Pipeline, Measurements, Current-Pipeline Optimizations, Alternative
|
|
58
|
+
Designs, and Decisions.
|
|
59
|
+
|
|
60
|
+
## Phase 2: Trace Current Behavior
|
|
61
|
+
Trace the target end to end and write the actual path into the ledger:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
scip-query status --capabilities
|
|
65
|
+
# If stale, missing, or unknown: scip-query reindex
|
|
66
|
+
scip-query plan-context <entry-symbol-or-file>
|
|
67
|
+
scip-query trace <entry-symbol>
|
|
68
|
+
scip-query call-graph <entry-symbol>
|
|
69
|
+
scip-query code <entry-symbol>
|
|
70
|
+
scip-query dataflow <entry-symbol>
|
|
71
|
+
scip-query complexity <hot-symbol>
|
|
72
|
+
scip-query change-surface <touched-file> --json --full
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Record input parsing, lookups, database queries, graph traversal, source scans,
|
|
76
|
+
semantic calls, cache reads/writes, rendering, and verification.
|
|
77
|
+
|
|
78
|
+
## Phase 3: Find Speedups
|
|
79
|
+
For the current pipeline, look for repeated work, broad scans, N+1 lookups,
|
|
80
|
+
uncached pure work, avoidable source or semantic reads, large arrays, late
|
|
81
|
+
filters, batchable per-file work, and safe parallelism.
|
|
82
|
+
|
|
83
|
+
For alternative designs, restate the output contract first. Ask whether SQLite
|
|
84
|
+
can answer directly, an index/cache/precomputed table can move work out of the
|
|
85
|
+
hot path, batch queries can replace loops, a cheap pruning stage can precede
|
|
86
|
+
exact work, or workers can run independent phases safely.
|
|
87
|
+
|
|
88
|
+
## Phase 4: Implement and Verify
|
|
89
|
+
Make the smallest reversible change that tests one performance hypothesis.
|
|
90
|
+
Update the ledger with hypothesis, changed files/symbols, before/after timings,
|
|
91
|
+
output comparison, tests, and gates.
|
|
92
|
+
|
|
93
|
+
Run the narrow correctness check, benchmark cases, `scip-query diff-impact
|
|
94
|
+
--json`, and `scip-query diff-gate --json`; reindex first if freshness is not
|
|
95
|
+
proven. Also run postchecks matching the change type. End with starting time,
|
|
96
|
+
final time, percentage change, accepted changes, rejected ideas, remaining
|
|
97
|
+
bottlenecks, and the next target.
|
|
@@ -41,6 +41,7 @@ When the user asks you to build, change, or fix something non-trivial:
|
|
|
41
41
|
| Assess a public API, route, CLI, config, schema, or boundary change | `scip-api-impact` | `scip-query surface <module>`, `scip-query affected <symbol>`, `scip-query co-change <file>` |
|
|
42
42
|
| Pick high-signal commands for an unfamiliar language | `scip-language-playbook` | — |
|
|
43
43
|
| Benchmark indexing, command runtime, or detector performance | `scip-query` | `scip-query bench --json`, `scip-query bench --cold-index --include-heavy` |
|
|
44
|
+
| Hyper-optimize a command, workflow, indexer, detector, or app path with benchmark ledgers and alternative designs | `scip-hyper-optimization` | `scip-query bench --json`, `scip-query plan-context <target>`, command-specific correctness checks |
|
|
44
45
|
| Adopt or bootstrap scip-query in a repository | `scip-adoption` | `scip-query setup --json`, `scip-query check-deps`, `scip-query capability-matrix --json` |
|
|
45
46
|
| Verify work you just finished (any implementation, refactor, or extraction) | `scip-verify` | `scip-query status --capabilities`, `scip-query diff-gate --json` |
|
|
46
47
|
| Confirm post-setup health signals before cleanup | `scip-health-audit` | `scip-query health --json --full`, `scip-query diff-gate --json` |
|
|
@@ -63,6 +64,9 @@ Use these boundaries before loading a specialist skill:
|
|
|
63
64
|
- `scip-health-improve` is the autonomous campaign. Use it when the user asks
|
|
64
65
|
to raise/maximize the health score, keep working with minimal interaction, or
|
|
65
66
|
get the repo as clean as reasonably possible.
|
|
67
|
+
- `scip-hyper-optimization` is the benchmark-led performance campaign. Use it
|
|
68
|
+
when the user asks to make a command, detector, indexer, workflow, or app path
|
|
69
|
+
as fast as possible while preserving output.
|
|
66
70
|
- `scip-debloat` is a bloat audit and cleanup plan. Use it when the user wants
|
|
67
71
|
dead code, duplication, unnecessary abstractions, wrappers, or structural
|
|
68
72
|
waste found and prioritized, but has not asked for a score-maxing campaign.
|
package/dist/chunk-3C4NIBY5.js
DELETED
package/dist/chunk-5MHQI4RR.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as f,b as h,e as m,g as x,i as N}from"./chunk-DS6QEB3G.js";import{c as y}from"./chunk-A536TEU4.js";import{f as g}from"./chunk-7S5E7KWT.js";import{extname as S}from"path";var R={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"};function p(e){return R[S(e).toLowerCase()]??null}function k(e){return S(e).toLowerCase()===".vue"}import{extname as B}from"path";import{parse as $}from"@vue/compiler-sfc";function v(e){let t=$(e),n=t.descriptor.scriptSetup??t.descriptor.script;if(!n||n.src)return null;let s=x(n.lang??null);return s?{body:n.content,startLine:Math.max(0,n.loc.start.line-1),language:s}:null}var b=g("ast-trees",{clearGroups:["whole-project","source-file"]});function _(e,t){if(k(t))return E(e,t);let n=p(t);if(!n)return null;let s=f(e,t);return s?b.get(e,t,s,()=>m(n,s)):null}function E(e,t){let n=f(e,t);return n?b.get(e,t,n,()=>{let s=v(n);if(!s)return null;let r=`
|
|
2
|
-
`.repeat(s.startLine)+s.body;return m(s.language,r)}):null}var O=[".tsx",".jsx"],C=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),J=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),P=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),D=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),V=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),q=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),I=new Set(["children","className","false","key","null","style","true","undefined"]),Z=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]);function Le(e,t={}){let n=y(e,{extensions:O}).filter(r=>!t.scope||r.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(r=>z(e,r)).filter(r=>(t.minJsxTokens===void 0||r.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||r.behaviorTokens.size>=t.minBehaviorTokens))}function z(e,t){let n=t.replace(/\\/g,"/"),s=H(n);if(!s)return[];let r=_(e,n);if(!r)return[];let o=h(e,n).length;return M(r.rootNode,s).filter(a=>a.kind==="hook"||A(a.bodyNode)).map(a=>{let l=Q(a.bodyNode),u=ne(a.bodyNode,s);return{file:n,name:a.name,kind:a.kind,startLine:a.node.startPosition.row,endLine:a.node.endPosition.row,loc:Math.max(1,a.node.endPosition.row-a.node.startPosition.row+1),fileLines:o,jsxTokens:l.tokens,behaviorTokens:u.tokens,componentNames:c(l.componentNames),nativeTags:c(l.nativeTags),propNames:c(l.propNames),eventNames:c(l.eventNames),hookNames:c(u.hookNames),requestNames:c(u.requestNames),stateNames:c(u.stateNames),effectNames:c(u.effectNames),handlerNames:c(u.handlerNames)}})}function H(e){let t=B(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:p(e)}function M(e,t){let n=[],s=new Set,r=o=>{let i=K(o);if(i&&!U(o)){let a=`${i.name}:${i.node.startIndex}:${i.node.endIndex}`;s.has(a)||(s.add(a),n.push(i));return}for(let a of o.namedChildren)r(a)};return(t==="tsx"||t==="javascript")&&r(e),n}function K(e){if(e.type==="function_declaration"){let o=j(e);return!o||!L(o)?null:{name:o,kind:w(o),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),s=d(t);if(!s||!n||!L(s))return null;let r=W(n);return r?{name:s,kind:w(s),node:e,bodyNode:r}:null}function L(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function w(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function W(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=G(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(r=>r.type==="arguments")?.namedChildren.find(r=>r.type==="arrow_function"||r.type==="function_expression")??null}function U(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function j(e){return d(e.childForFieldName("name")??e.namedChild(0))}function G(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function A(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(A)}function Q(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=s=>{s.type==="jsx_opening_element"||s.type==="jsx_self_closing_element"?X(s,t):s.type==="jsx_expression"?Y(s,t):s.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let r of s.namedChildren)n(r)};return n(e),t}function X(e,t){let n=ee(e),s=!1;if(n){let r=T(n);s=ie(r),s?(t.componentNames.add(r),t.tokens.add(`component:${r}`)):(t.nativeTags.add(r),t.tokens.add(`native:${r}`))}for(let r of e.namedChildren)if(r.type==="jsx_attribute"){let o=te(r);if(!o)continue;let i=T(o);if(i.startsWith("on")&&i.length>2){let a=i.slice(2).replace(/^[A-Z]/,l=>l.toLowerCase());t.eventNames.add(a),t.tokens.add(`event:${a}`)}else Z.has(i)||(t.propNames.add(i),t.tokens.add(`${s?"prop":"native-prop"}:${i}`))}else r.type==="jsx_spread_attribute"&&t.tokens.add("prop:spread")}function Y(e,t){let n=e.text;(n.includes("&&")||n.includes("?"))&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let s of ce(n))I.has(s)||t.tokens.add(`binding:${s}`)}function ee(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function te(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function ne(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},s=r=>{if(r.type==="call_expression"){let o=N(r,t);o&&se(o.calleeLeaf,n)}else if(r.type==="variable_declarator")oe(r,n);else if(r.type==="function_declaration"){let o=j(r);o&&F(o,n)}for(let o of r.namedChildren)s(o)};return s(e),n}function se(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!C.has(e)&&!D.has(e)&&t.tokens.add(`hook:${e}`)),C.has(e)&&t.tokens.add(`react-hook:${e}`),J.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),P.has(e)&&t.tokens.add(`state-hook:${e}`),re(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function re(e){if(V.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function oe(e,t){let n=e.childForFieldName("name")??e.namedChild(0),s=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&s?.text.includes("useState")){let o=n.namedChildren.find(a=>d(a)),i=d(o);i&&(t.stateNames.add(i),t.tokens.add(`state:${i}`))}let r=d(n);r&&F(r,t)}function F(e,t){let n=ae(e);!n||!q.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function ae(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function ie(e){return/^[A-Z]/.test(e)||e.includes(".")}function T(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function d(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function ce(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let s=n[0];t.includes(s)||t.push(s)}return t}function c(e){return[...e].sort()}export{p as a,k as b,v as c,_ as d,Le as e};
|
|
3
|
-
//# sourceMappingURL=chunk-5MHQI4RR.js.map
|
package/dist/chunk-BZ2RRK7Y.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{d as D,e as A,g as H}from"./chunk-FKYPOK7P.js";import{d as L}from"./chunk-HDBQHJNY.js";import{b as w,d as _,h as T,i as E}from"./chunk-FPYQA7JK.js";import{a as N}from"./chunk-LONIY5FF.js";import{c as b,d as F}from"./chunk-JM72FNGA.js";var V=5;function re(e,t={}){let{base:a="HEAD",minContainment:o=.7,minCallees:r=3,minSiteCoverage:n=.4,maxHelpers:c=Number.POSITIVE_INFINITY,limit:m=20,scanLimit:g}=t,f=t.semantic!==!1,s=t.diffPlan??_(e,{base:a}),l={available:s.note!==w,base:a,changedFiles:s.changedFiles,helpersChecked:0,skipped:[],findings:[]};if(!l.available||s.changedFiles.length===0)return l;let x=new N(e),k=new Set(s.changedFiles),$=new Map(s.renamedFiles.map(i=>[i.to,i.from])),z=t.baseContentAt??T(e.config.projectRoot,a,E(s)),h=X(x,k,$,z);if(h.length===0)return l;let R=h.slice(0,c);h.length>c&&(l.note=`helper scoring capped at ${c} of ${h.length} new symbols`);let j=D(e,{minCallees:Math.min(3,r),scanLimit:g,semantic:f}),M=A(j),q=x.calleeMap(R,{semantic:f}),B=R.map(i=>({def:i,callees:H((q.get(i.symbolId)??[]).map(p=>p.symbol))}));for(let{def:i,callees:p}of B){let d=b(i.symbol);if(p.size<r){l.skipped.push({helperShortName:d,helperFile:i.relativePath,reason:`fewer than ${r} meaningful callees \u2014 too small to score`});continue}let P=W(p,M);if(P===0){l.skipped.push({helperShortName:d,helperFile:i.relativePath,reason:"helper callee pattern is all project-wide infrastructure \u2014 too generic to score"});continue}let C=Y(e,i.symbolId);if(C.length===0){l.skipped.push({helperShortName:d,helperFile:i.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}l.helpersChecked+=1;let I=G({candidateIndex:M,changed:k,helperCallees:p,helperFile:i.relativePath,helperSymbol:i.symbol,minContainment:o,minSiteCoverage:n,migratedFiles:C});I.length!==0&&(I.sort((u,S)=>O(S.migrationScope)-O(u.migrationScope)||S.containment-u.containment||S.siteCoverage-u.siteCoverage||u.file.localeCompare(S.file)),l.findings.push({helperSymbol:i.symbol,helperShortName:d,helperFile:i.relativePath,helperShape:"specific-callee-cluster",helperCalleeCount:p.size,specificHelperCalleeCount:P,migratedFiles:C.sort(),leftovers:I.slice(0,V)}))}return l.findings.sort((i,p)=>(p.leftovers[0]?.containment??0)-(i.leftovers[0]?.containment??0)||i.helperFile.localeCompare(p.helperFile)),l.findings=l.findings.slice(0,m),l}function G(e){let t=[],a=J(e.helperSymbol,e.helperFile,e.migratedFiles),o=new Set;for(let r of e.helperCallees)for(let n of e.candidateIndex.candidateIndexesByCallee.get(r)??[])o.add(n);for(let r of o){let n=e.candidateIndex.corpus[r];if(n.symbol===e.helperSymbol||e.changed.has(n.file)||n.callees.has(e.helperSymbol))continue;let c=L(e.helperCallees,n.callees);if(c<e.minContainment)continue;let m=[...e.helperCallees].filter(s=>n.callees.has(s)),g=n.callees.size===0?0:m.length/n.callees.size;if(g<e.minSiteCoverage||!m.some(s=>(e.candidateIndex.docFreq.get(s)??0)<=e.candidateIndex.ubiquityThreshold))continue;let f=K(a,n.symbol,n.file);t.push({symbol:n.symbol,shortName:b(n.symbol),file:n.file,...f,containment:c,siteCoverage:g,uniqueSiteCalleeCount:Math.max(0,n.callees.size-m.length),sharedCallees:m.map(b).sort()})}return t}function O(e){return e==="same-scope"?2:e==="unknown"?1:0}function J(e,t,a){let o=new Set([...y(t),...v(F(e))]);for(let r of a)for(let n of y(r))o.add(n);return o}function K(e,t,a){let o=new Set([...y(a),...v(F(t))]);if(e.size===0||o.size===0)return{migrationScope:"unknown",migrationScopeReasons:["insufficient path/name tokens to infer migration scope"]};let r=[...o].filter(n=>e.has(n)).sort();return r.length>0?{migrationScope:"same-scope",migrationScopeReasons:[`shares migration-scope token(s): ${r.slice(0,5).join(", ")}`]}:{migrationScope:"possible-subtype",migrationScopeReasons:["no path/name tokens shared with the helper or already migrated files"]}}var U=new Set(["app","apps","common","component","components","helper","helpers","index","lib","package","packages","page","pages","route","routes","service","services","shared","spec","src","test","tests","util","utils"]);function y(e){return v(e.replace(/\.[^.]+$/,""))}function v(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(t=>t.length>1&&!U.has(t))}function W(e,t){let a=0;for(let o of e)(t.docFreq.get(o)??0)<=t.ubiquityThreshold&&(a+=1);return a}function X(e,t,a,o){return e.productionCallableDefinitions({requireFunctionLikeSymbol:!0}).filter(r=>{if(!t.has(r.relativePath))return!1;let n=a.get(r.relativePath)??r.relativePath,c=o(n);return c===null||!new RegExp(`\\b${Z(r.leaf)}\\b`).test(c)})}function Y(e,t){return e.all(`SELECT DISTINCT ref_d.relative_path
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
5
|
-
WHERE m.symbol_id = ?
|
|
6
|
-
AND m.role != 1
|
|
7
|
-
${e.pathExclusionsFor("ref_d")}`,t).map(o=>o.relative_path)}function Z(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{re as a};
|
|
8
|
-
//# sourceMappingURL=chunk-BZ2RRK7Y.js.map
|
package/dist/chunk-CMXD5VC4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as Z}from"./chunk-B75HZHUP.js";import{a as v}from"./chunk-LONIY5FF.js";import{b as B,e as W,f as U,g as H}from"./chunk-MJXJ56LG.js";import{a as J}from"./chunk-MFWAZFYD.js";import{c as V,d as q,f as E,k as G}from"./chunk-W2TIXAGN.js";import{e as z}from"./chunk-U73YFD3P.js";import{b as F}from"./chunk-G2CGUNQU.js";import{f as K,m as x}from"./chunk-TJXOD4IK.js";import{c as k,f as T,g as M,h as A,i as O,j}from"./chunk-JM72FNGA.js";import{a as N,d as _}from"./chunk-5MHQI4RR.js";import{a as P}from"./chunk-DS6QEB3G.js";import{a as g}from"./chunk-64MNV6AB.js";import{b as S}from"./chunk-7S5E7KWT.js";var h=new WeakMap;function $(e,t){let n=N(t);return n==="rust"?Re(e,t):n==="typescript"||n==="tsx"||n==="javascript"?ye(e,t):[]}var me=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),pe=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,be=/\buse[A-Z][A-Za-z0-9_$]*/;function ye(e,t){let n=P(e,t);if(!n||!ge(n))return[];let r=_(e,t);if(!r)return[];let o=h.get(r);if(o)return o;let i=!1,s=r.rootNode;for(let c of s.namedChildren){if(c.type!=="expression_statement")continue;let l=c.namedChild(0);if(!l||l.type!=="call_expression")continue;let a=l.namedChild(0);if(!a)continue;let d=a.type==="member_expression"?a.namedChild(a.namedChildCount-1)?.text:a.text;if(d&&me.has(d)){i=!0;break}}let u=[];i&&u.push({startLine:0,endLine:s.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"});for(let c of s.namedChildren){let l=null,a=null;if(c.type==="function_declaration")l=c.namedChild(0)?.text??null,a=c;else if(c.type==="export_statement"){let d=c.namedChild(0);d?.type==="function_declaration"&&(l=d.namedChild(0)?.text??null,a=d)}else if(c.type==="lexical_declaration"){let d=c.namedChild(0);if(d?.type==="variable_declarator"){let m=d.namedChild(0)?.text,b=d.namedChild(1);m&&(b?.type==="arrow_function"||b?.type==="function_expression")&&(l=m,a=d)}}l&&/^use[A-Z]/.test(l)&&a&&u.push({startLine:a.startPosition.row,endLine:a.endPosition.row,reason:"React custom hook (use*)"})}return u.push(...Q(r,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),h.set(r,u),u}function ge(e){return e.includes("scip-query")||pe.test(e)||be.test(e)}var he=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function xe(e){return he.test(e)}function Q(e,t,n){let r=[],o=i=>{if(t.has(i.type)&&i.parent){let u=i.parent.children,c=-1;for(let l=0;l<u.length;l+=1)if(u[l].startIndex===i.startIndex&&u[l].type===i.type){c=l;break}if(c>0)for(let l=c-1;l>=0;l-=1){let a=u[l];if(n.has(a.type)){if(xe(a.text)){r.push({startLine:i.startPosition.row,endLine:i.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(a.type==="attribute_item"||a.type==="inner_attribute_item"))break}}for(let s of i.namedChildren)o(s)};return o(e.rootNode),r}function Re(e,t){let n=_(e,t);if(!n)return[];let r=h.get(n);if(r)return r;let o=[],i=Se(n);return i?(h.set(n,i),i):(Y(n.rootNode,o,!1,!1),o.push(...Q(n,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"]))),o.push(...Ie(n.rootNode)),h.set(n,o),o)}function Se(e){return Pe(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)"}]:null}function Y(e,t,n,r){let o=n,i=r;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")&&(i=!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"?_e(e,t,n,r):r&&we(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"?Ee(e,t,n):e.type==="mod_item"&&C(e).some(s=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(s))&&(o=!0);for(let s of e.namedChildren)Y(s,t,o,i)}function _e(e,t,n,r){let o=C(e),i=null;r?i="trait impl method (dynamic dispatch)":n&&(i="inside #[cfg(test)] mod");for(let s of o){let u=Ce(s);if(u){i=u;break}if(ee(s)){i="#[allow(dead_code)]";break}}i&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:i})}function Ee(e,t,n){let r=C(e),o=e.namedChildren.find(i=>i.type==="type_identifier")?.text;r.some(Le)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:o}),r.some(ee)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:o}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:o})}function C(e){let t=e.parent;if(!t)return[];let n=t.children,r=-1;for(let i=0;i<n.length;i+=1)if(n[i].startIndex===e.startIndex&&n[i].type===e.type){r=i;break}if(r<=0)return[];let o=[];for(let i=r-1;i>=0;i-=1){let s=n[i];if(s.type==="attribute_item"||s.type==="inner_attribute_item")o.push(s.text);else{if(s.type==="line_comment"||s.type==="block_comment")continue;break}}return o}var ve=[{re:/#\[\s*tauri::command\b/,reason:"#[tauri::command]"},{re:/#\[\s*command\b/,reason:"#[command]"},{re:/#\[\s*test\b/,reason:"#[test]"},{re:/#\[\s*bench\b/,reason:"#[bench]"},{re:/#\[\s*tokio::test\b/,reason:"#[tokio::test]"},{re:/#\[\s*async_std::test\b/,reason:"#[async_std::test]"},{re:/#\[\s*wasm_bindgen\b/,reason:"#[wasm_bindgen]"},{re:/#\[\s*no_mangle\b/,reason:"#[no_mangle]"},{re:/#\[\s*napi\b/,reason:"#[napi]"},{re:/#\[\s*pyfunction\b/,reason:"#[pyfunction]"},{re:/#\[\s*pymethod\b/,reason:"#[pymethod]"},{re:/#\[\s*pyo3\b/,reason:"#[pyo3]"},{re:/#\[\s*cfg\s*\(\s*test\s*\)/,reason:"#[cfg(test)]"},{re:/#\[\s*doc\s*\(\s*hidden\s*\)/,reason:"#[doc(hidden)]"}];function Ce(e){return ve.find(({re:t})=>t.test(e))?.reason??null}var De=[/\bSerialize\b/,/\bDeserialize\b/,/\bFromRow\b/,/\bsqlx::FromRow\b/,/\bDeriveEntityModel\b/,/\bIntoSchema\b/,/\bToSchema\b/,/\bDeriveValueType\b/,/\bError\b/,/\bthiserror::Error\b/];function Le(e){return/#\[\s*derive\s*\(/.test(e)?De.some(t=>t.test(e)):!1}function ee(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function we(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function Ie(e){let t=Fe(e);if(t.size===0)return[];let n=[];for(let r of e.descendantsOfType("mod_item")){let o=r.childForFieldName("name")?.text;o&&t.has(o)&&n.push({startLine:r.startPosition.row,endLine:r.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:o})}return n}function Pe(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var Ne=/^#!?\[\s*serde\s*\(/,X=/\bwith\s*=\s*"([^"]+)"/g;function Fe(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){if(!Ne.test(n.text))continue;X.lastIndex=0;let r;for(;(r=X.exec(n.text))!==null;){let o=r[1],i=o.split("::").pop()??o;i&&t.add(i)}}return t}function te(e){let t=new Map,n=r=>{let o=t.get(r);if(o)return o;let i=$(e,r);return o={ranges:i.map(s=>({startLine:s.startLine,endLine:s.endLine})),containers:new Set(i.map(s=>s.containerName).filter(s=>!!s))},t.set(r,o),o};return(r,o,i,s)=>{let u=n(r);for(let c of u.ranges)if(o>=c.startLine&&o<=c.endLine)return!0;if(s&&u.containers.has(s))return!0;for(let c of x(i))if(u.containers.has(c))return!0;return!1}}function et(e,t={}){S(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function D(e,t,n={}){S(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function re(e,t){return t.isIgnoredPath(e.relativePath)?p("ignored-file"):A(e.symbol)?p("module-like-symbol"):ne(e.symbol)?!e.isFunctionLike&&e.enclosingSymbol&&ne(e.enclosingSymbol)?p("nested-non-callable-value"):!t.includeTests&&!L(e.relativePath)?p("test-file"):!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName)?p("excluded-file-region"):O(e.symbol)?p("rust-trait-impl-member"):j(e.symbol)?p("rust-test-module"):!t.includeMembers&&!ke(e)?p("member"):e.endLine-e.startLine+1<t.minLoc?p("below-min-loc"):{accepted:!0}:p("non-value-symbol")}function L(e){return B(e)!=="test"}function p(e){return{accepted:!1,rejectionReason:e}}function ne(e){return M(e)||e.endsWith("().")||e.endsWith(".")}function ke(e){return T(e.symbol)||x(e.symbol).length===0}function oe(){return new Map}function ie(e,t,n){let r=new Map;for(let o of V(e,n))e.isIgnored(o.relative_path)||t.has(o.relative_path)||R(r,o.symbol_id,o.relative_path,o.ref_count,"scip-mention");return r}function se(e,t,n){let r=new Set;for(let o of q(e,t))e.isIgnored(o.relative_path)||n.has(o.relative_path)||r.add(o.symbol_id);return r}function w(e,t){let n=e.get(t);if(!n)return!1;for(let r of n.values())if(r.occurrences>0)return!0;return!1}function I(e,t,n){let r=e.get(t);if(!r)return!1;for(let[o,i]of r)if(o!==n&&i.occurrences>0)return!0;return!1}function ae(e){return e?.occurrences??0}function R(e,t,n,r,o="source-fallback"){if(r<=0)return;let i=le(e,t,n);i.occurrences+=r,i.sources.add(o)}function ce(e,t,n,r,o){if(r<=0)return;let i=le(e,t,n);i.occurrences=Math.max(r,i.occurrences),i.sources.add(o)}function le(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let o=r.get(n);return o||(o={occurrences:0,sources:new Set},r.set(n,o)),o}var Te=3e3,Me=1e3;function Et(e,t={}){let{scope:n,minLoc:r=1,includeTests:o=!1,skipBarrels:i=!1,includeMembers:s=!1,deadCodeOnly:u=!1,scanLimit:c,semantic:l=!0}=t,a=Z(Ae(e,{scope:n,minLoc:r,includeTests:o,includeMembers:s}),c),d=i?new Set(W(e)):new Set,m=u?oe():ie(e,d,a.map(f=>f.symbolId)),b=u?se(e,a.map(f=>f.symbolId),d):new Set,y=u?a.filter(f=>!b.has(f.symbolId)):a.filter(f=>!I(m,f.symbolId,f.relativePath));u?Ue(e,y,m,d):We(e,y,m,d);let de=u?y.filter(f=>!w(m,f.symbolId)):y.filter(f=>!I(m,f.symbolId,f.relativePath));ze(e,de,m,{includeTests:o,inactiveBarrelPaths:d,includeSemantic:!u&&l});let fe=u?y.filter(f=>!w(m,f.symbolId)):a;return Be(e,Oe(fe,m))}function Ae(e,t){let n=te(e),r=[];for(let o of g(e,{scope:t.scope}))try{for(let i of K(e,o))re(i,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:u=>e.isIgnored(u),isExcludedRegion:n}).accepted&&r.push(i)}finally{D(e,o,{definitions:!0})}return r}function Oe(e,t){return e.map(n=>je(n,t)).filter(n=>n.cross_file_refs===0).sort((n,r)=>r.loc-n.loc||n.relative_path.localeCompare(r.relative_path)||n.start_line-r.start_line)}function je(e,t){let n=t.get(e.symbolId)??new Map,r=ae(n.get(e.relativePath)),o=0;for(let[i,s]of n)i!==e.relativePath&&(o+=s.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:r,cross_file_refs:o}}function Be(e,t){let n=[],r=0,o=0,i=0;for(let s of t){if(e.isIgnored(s.relative_path)||U(e,s.relative_path)||H(e,s.symbol,s.relative_path))continue;let u=s.same_file_refs===0?"dead-code":"file-internal";u==="dead-code"?r++:o++,i+=s.loc,n.push({relativePath:s.relative_path,startLine:s.start_line,endLine:s.end_line,loc:s.loc,symbol:s.symbol,shortName:k(s.symbol),sameFileRefs:s.same_file_refs,kind:u})}return{symbols:n,counts:{total:n.length,deadCode:r,fileInternal:o,loc:i},totalCount:n.length,deadCodeCount:r,fileInternalCount:o,totalLoc:i}}function We(e,t,n,r){if(t.length===0)return;let o=new v(e),i=new Set(t.map(c=>c.symbolId)),s=new Set(t.map(c=>c.leaf).filter(Boolean)),u=new Set(o.sourceFiles());for(let c of g(e))u.add(c);o.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:s,skipPath:c=>r.has(c)},c=>{i.has(c.target.symbolId)&&(Ve(e,c)||R(n,c.target.symbolId,c.sourceFile,qe(c),"source-fallback"))})}function Ue(e,t,n,r){if(t.length===0)return;let o=new v(e),i=He(t),s=new Set(o.sourceFiles());for(let a of g(e))s.add(a);let u=new Set(i.keys()),c=new Map,l=a=>{let d=c.get(a);return d||(d=G(e,a),c.set(a,d)),d};o.scanSourceReferences({paths:s,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:a=>r.has(a),resolveTargets:({sourceFile:a,name:d,kind:m})=>{let b=i.get(d);return b?Ke(a,d,b,l(a),{permissive:m!=="cross-language-dispatch"}):[]},afterPath:a=>{c.delete(a),D(e,a)}},a=>{let d=a.kind==="identifier"&&a.sourceFile===a.target.relativePath?Math.max(0,a.occurrences-1):a.occurrences;a.kind==="identifier"&&ue(e,{sourceFile:a.sourceFile,name:a.name,target:a.target,occurrences:d})||R(n,a.target.symbolId,a.sourceFile,d,"source-fallback")})}function He(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let r=t.get(n.leaf)??[];r.push(n),t.set(n.leaf,r)}return t}function Ke(e,t,n,r,o){let i=n.filter(c=>c.relativePath===e);if(i.length>0)return i;if(!o.permissive&&n.length===1)return[...n];let s=r.get(t);if(s)for(let c of s){let l=n.filter(a=>E(c,a.relativePath));if(l.length>0)return l}let u=new Set;for(let c of r.values())for(let l of c)u.add(l);for(let c of u){let l=n.filter(a=>E(c,a.relativePath));if(l.length>0&&l.length===n.length)return l}return o.permissive?[...n]:[]}function Ve(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&ue(e,t)}function qe(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function ue(e,t){return t.occurrences>1?!1:F(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function ze(e,t,n,r){let o=r.includeSemantic!==!1,i=o&&t.length>=Te&&g(e).length>=Me,s=(c,l)=>{l===c.relativePath||e.isIgnored(l)||r.inactiveBarrelPaths.has(l)||!r.includeTests&&!L(l)||ce(n,c.symbolId,l,1,"caller-map")};for(let c of t){let l=J(e,c,{semantic:o&&!i});if(l.length!==0)for(let a of l)s(c,a.file)}if(!i)return;let u=z(e,t);for(let c of t){let l=u.get(c.symbolId);if(l)for(let a of l)s(c,a)}}export{et as a,Et as b};
|
|
2
|
-
//# sourceMappingURL=chunk-CMXD5VC4.js.map
|
package/dist/chunk-FKYPOK7P.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as L,b as C,e as q,f as B,g as v,h as z}from"./chunk-HDBQHJNY.js";import{b as M}from"./chunk-B75HZHUP.js";import{a as x}from"./chunk-LONIY5FF.js";import{a as A}from"./chunk-XAYARHNF.js";import{a as I}from"./chunk-733EF5FD.js";import{c as p,d as w,g as R}from"./chunk-JM72FNGA.js";import{b as N}from"./chunk-DS6QEB3G.js";import{d as h}from"./chunk-7S5E7KWT.js";function Te(e,n,i={}){let{minSimilarity:t=.4,limit:s=20}=i,r=J(e,n,{semantic:i.semantic!==!1});if(!r)return[];if(!R(r.symbol))return[];let o=X(e,r,t,{scanLimit:i.scanLimit,semantic:i.semantic!==!1});return o.length>0?o.slice(0,s):ae(e,n,{minSimilarity:t,limit:s})}function X(e,n,i,t){let s=P(e,{minCallees:3,scanLimit:t.scanLimit,semantic:t.semantic}),r=re(n,s),o=q([n,...s.corpus].map(l=>l.callees)),a=v(o),c=[];for(let l of r){if(l.callees.size<3)continue;let m=O(n,l,o,{minSimilarity:i,requireSignificantShared:1,requireSharedCount:0,medianIdf:a});m&&c.push(m)}return c.sort((l,m)=>m.similarity-l.similarity),c}function O(e,n,i,t){let{similarity:s,significantShared:r,trivialShared:o}=z(e.callees,n.callees,i,{medianIdf:t.medianIdf});if(s<t.minSimilarity)return null;let a=r.length+o.length;if(r.length<t.requireSignificantShared&&a<t.requireSharedCount)return null;let c=r.length>0?r:o,l=G(c,"callees");return{symbolA:e.symbol,shortNameA:p(e.symbol),fileA:e.file,symbolB:n.symbol,shortNameB:p(n.symbol),fileB:n.file,similarity:s,similarityBasis:"callees",sharedCallees:c.map(p),uniqueToA:[...C(e.callees,n.callees)].map(p),uniqueToB:[...C(n.callees,e.callees)].map(p),...l}}function Ne(e,n={}){let{minSimilarity:i=.5,limit:t=20,scope:s,minCallees:r=4,crossFileOnly:o=!1,scanLimit:a}=n,c=P(e,{minCallees:r,scope:s,scanLimit:a,semantic:n.semantic!==!1}),l=c.corpus,m=[],y=0;for(let d=0;d<l.length;d+=1){let f=l[d],b=new Set;for(let S of f.callees){let u=c.candidateIndexesByCallee.get(S);if(u)for(let g of u)g>d&&b.add(g)}for(let S of b){let u=l[S];if(o&&f.file===u.file)continue;if(f.paramCount>=0&&u.paramCount>=0){let k=Math.abs(f.paramCount-u.paramCount),H=Math.max(2,Math.ceil(Math.max(f.paramCount,u.paramCount)*.5));if(k>H)continue}let g=O(f,u,c.idfWeights,{minSimilarity:i,requireSignificantShared:2,requireSharedCount:4,medianIdf:c.medianIdf});g&&(Q(m,g,t,y),y+=1)}}return m.sort((d,f)=>f.result.similarity-d.result.similarity||d.order-f.order),m.map(d=>d.result)}function Q(e,n,i,t){if(i<=0)return;if(e.length<i){e.push({result:n,order:t});return}let s=0;for(let o=1;o<e.length;o+=1){let a=e[o],c=e[s];(a.result.similarity<c.result.similarity||a.result.similarity===c.result.similarity&&a.order>c.order)&&(s=o)}let r=e[s];n.similarity<=r.result.similarity||(e[s]={result:n,order:t})}var Y=["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 J(e,n,i){let t=I(e,n),s=new x(e);if(!t)return null;let r=A(e,t,{semantic:i.semantic});return{symbol:t.symbol,file:t.relativePath,callees:j(r.map(o=>o.symbol)),paramCount:s.callableSignature(t)?.paramCount??-1}}var ee=h("callee-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),ne=h("callee-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function ie(e,n){let{minCallees:i,scope:t,excludeSymbol:s,scanLimit:r}=n,o=n.semantic!==!1,a=ee.get(e,()=>new Map),c=`${i}|${t??""}|${r??""}|${o}`,l=a.get(c);return l||(l=se(e,{minCallees:i,scope:t,scanLimit:r,semantic:o}),a.set(c,l)),s===void 0?l:l.filter(m=>m.symbol!==s)}function P(e,n){let{minCallees:i,scope:t,scanLimit:s}=n,r=n.semantic!==!1,o=ne.get(e,()=>new Map),a=`${i}|${t??""}|${s??""}|${r}`,c=o.get(a);return c||(c=te(ie(e,{minCallees:i,scope:t,scanLimit:s,semantic:r})),o.set(a,c)),c}function te(e){let n=new Map;for(let r of e)for(let o of r.callees)n.set(o,(n.get(o)??0)+1);let i=Math.max(8,Math.ceil(Math.sqrt(e.length))),t=B(n,e.length),s=new Map;for(let r=0;r<e.length;r+=1){let o=e[r];for(let a of o.callees){if((n.get(a)??0)>i)continue;let c=s.get(a);c||(c=[],s.set(a,c)),c.push(r)}}return{corpus:e,candidateIndexesByCallee:s,docFreq:n,idfWeights:t,medianIdf:v(t),ubiquityThreshold:i}}function re(e,n){let i=new Map;for(let t of e.callees)for(let s of n.candidateIndexesByCallee.get(t)??[]){let r=n.corpus[s];r.symbol!==e.symbol&&i.set(r.symbol,r)}return i.size>0?[...i.values()]:n.corpus.filter(t=>t.symbol!==e.symbol)}function se(e,n){let{minCallees:i,scope:t,scanLimit:s,semantic:r}=n,o=new x(e),a=M(o.productionCallableDefinitions({scope:t,minLoc:5,sortByLocDesc:typeof s=="number"&&s>0}),s),c=o.calleeMap(a,{semantic:r});return a.map(l=>({symbol:l.symbol,file:l.relativePath,callees:j((c.get(l.symbolId)??[]).map(m=>m.symbol)),paramCount:o.callableSignature(l)?.paramCount??-1})).filter(l=>l.callees.size>=i)}function j(e){return new Set([...e].filter(n=>!oe(n)))}function oe(e){return Y.some(n=>e.includes(n))}function ae(e,n,i){let t=ue(e,n);if(!t||t.tokens.size<3)return[];let s=i.minSimilarity>=.5?i.minSimilarity:.3,r=[],o=ye(t,be(e));for(let a of o){if(a.symbol===t.symbol||a.tokens.size<3)continue;let c=L(t.tokens,a.tokens);if(c.size<2)continue;let l=new Set([...t.tokens,...a.tokens]),m=l.size>0?c.size/l.size:0;m<s||r.push({symbolA:t.symbol,shortNameA:p(t.symbol),fileA:t.file,symbolB:a.symbol,shortNameB:p(a.symbol),fileB:a.file,similarity:m,similarityBasis:"source-tokens",sharedCallees:[...c].sort(),uniqueToA:[...C(t.tokens,a.tokens)].sort(),uniqueToB:[...C(a.tokens,t.tokens)].sort(),...G([...c],"source-tokens")})}return r.sort((a,c)=>c.similarity-a.similarity||a.shortNameB.localeCompare(c.shortNameB)),r.slice(0,i.limit)}function G(e,n){let i=e.flatMap(E),t=e.flatMap(u=>$(u,n)),s=D(i,U),r=D(i,V),o=D(t,T),a=[...new Set(t.filter(_))],c=e.filter(u=>{let g=$(u,n);return g.some(k=>T.has(k))&&g.some(_)}).length,l=[];s.length>0&&l.push(`access/query scaffolding: ${s.slice(0,5).join(", ")}`),r.length>0&&l.push(`framework/generic scaffolding: ${r.slice(0,5).join(", ")}`),o.length>0&&l.push(`domain behavior verbs: ${o.slice(0,5).join(", ")}`),o.length>0&&a.length>0&&l.push(`domain-specific terms: ${a.slice(0,5).join(", ")}`);let m=n==="source-tokens"&&i.length>0&&i.every(u=>K.has(u));m&&l.push("shared source tokens are generic scaffolding");let y=o.length>0&&a.length>0,d=s.length+r.length>0,f=n==="callees"&&y&&e.length>=4&&a.length>=4&&c>=2,b=f?"domain-behavior":y?d?"mixed":"domain-behavior":s.length>0?"access-query-scaffolding":r.length>0||m?"framework-scaffolding":"structural-overlap";b==="structural-overlap"&&e.length>0&&l.push(`shared ${n} overlap has no recognized domain or scaffolding category`);let S=b==="domain-behavior"&&(e.length>=3||f)?"direct":"signal";return{evidenceClass:b,actionTier:S,evidenceClassReasons:l,recommendation:le(b,S)}}function le(e,n){return n==="direct"?"Shared domain behavior looks concrete; review for an extract/reuse opportunity.":e==="mixed"?"Shared evidence mixes domain behavior with scaffolding; review semantics before extracting anything.":e==="access-query-scaffolding"?"Shared evidence is mostly access/query scaffolding; compare product semantics before reusing code.":e==="structural-overlap"?"Shared structure has no domain or scaffolding classification; inspect names and behavior before reusing code.":"Shared evidence is mostly framework or generic scaffolding; treat as a contextual signal."}function D(e,n){return[...new Set(e.filter(i=>n.has(i)))]}function E(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1)}function $(e,n){if(n==="source-tokens")return E(e);let i=w(e);return E(i.length>0?i:ce(e))}function ce(e){return e.replace(/[()`]/g," ").replace(/\.[a-z][a-z0-9]+(?=\s|$)/gi," ").split(/[:/\\\s]+/).map(t=>t.trim()).filter(t=>/[A-Za-z]/.test(t)).at(-1)?.replace(/\.$/,"")??e}function _(e){return e.length>3&&!T.has(e)&&!U.has(e)&&!V.has(e)&&!K.has(e)&&!me.has(e)}var T=new Set(["archive","assign","book","cancel","create","delete","ensure","export","import","notify","persist","publish","restore","schedule","send","set","submit","sync","update","upload","validate","write"]),U=new Set(["access","auth","authorize","cache","context","db","find","get","guard","list","permission","permissions","prisma","query","request","response","role","route","session","sql","where"]),V=new Set(["bytes","computed","crypto","describe","effect","expect","fetch","filter","hex","hook","json","map","mounted","on","promise","random","react","reduce","ref","render","state","test","token","trim","uuid","vue","watch"]),K=new Set(["bytes","crypto","data","false","get","hex","id","key","map","name","num","random","result","secret","set","string","to","token","true","type","value"]),me=new Set(["best","backend","conflict","database","effect","effects","error","errors","frontend","found","helpers","javascript","module","modules","scip","shared","source","typescript","utils","with","workflow","workflows"]);function ue(e,n){let i=I(e,n);if(!i||!R(i.symbol))return null;let t=fe(e,i);return t?{symbol:i.symbol,file:i.relativePath,tokens:t}:null}function fe(e,n){let i=w(n.symbol),t=W(e,n.relativePath,n.startLine,n.endLine,i),s=Z(t,i);return s.size>0?s:null}var de=h("source-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),ge=h("source-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function pe(e){return de.get(e,()=>he(e))}function be(e){return ge.get(e,()=>Se(pe(e)))}function Se(e){let n=new Map;for(let s of e)for(let r of s.tokens)n.set(r,(n.get(r)??0)+1);let i=Math.max(8,Math.ceil(Math.sqrt(e.length))),t=new Map;for(let s of e)for(let r of s.tokens){if((n.get(r)??0)>i)continue;let o=t.get(r);o||(o=[],t.set(r,o)),o.push(s)}return{corpus:e,candidateByToken:t,docFreq:n,ubiquityThreshold:i}}function ye(e,n){let i=new Map;for(let t of e.tokens)for(let s of n.candidateByToken.get(t)??[])s.symbol!==e.symbol&&i.set(s.symbol,s);return i.size>0?[...i.values()]:n.corpus.filter(t=>t.symbol!==e.symbol)}function he(e){return new x(e).productionCallableDefinitions().map(i=>({symbol:i.symbol,file:i.relativePath,tokens:Z(W(e,i.relativePath,i.startLine,i.endLine,i.leaf),i.leaf)})).filter(i=>i.tokens.size>0)}function W(e,n,i,t,s){let r=N(e,n);if(r.length===0)return"";if(t>=i&&t-i<=12)return r.slice(i,t+1).join(`
|
|
2
|
-
`);let o=[new RegExp(`\\bdef\\s+${F(s)}\\b`),new RegExp(`\\bfun\\s+${F(s)}\\b`),new RegExp(`\\bfn\\s+${F(s)}\\b`),new RegExp(`\\bfunction\\s+${F(s)}\\b`),new RegExp(`\\b${F(s)}\\s*\\(`)],a=r.findIndex(c=>o.some(l=>l.test(c)));if(a>=0){let c=a;for(let l=a+1;l<r.length&&l<=a+8;l++){let m=r[l]??"";if(l>a&&Fe(m)||(c=l,m.trim()===""&&l>a+1))break}return r.slice(a,c+1).join(`
|
|
3
|
-
`)}return r.slice(i,Math.min(r.length,i+8)).join(`
|
|
4
|
-
`)}function Z(e,n){if(!e)return new Set;let i=new Set(["public","private","protected","final","static","class","def","fun","fn","function","return","string","bool","boolean","void","unit","self","this","new","const","let","var","end","pub"]),t=Ce(n),r=e.replace(/["'`]/g," ").replace(/\b\d+\b/g," NUM ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9_]+/g," ").replace(/_/g," ").toLowerCase().split(/\s+/).map(o=>o.trim()).filter(o=>o.length>1).filter(o=>!i.has(o)).filter(o=>!t.has(o));return new Set(r)}function Ce(e){return new Set(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(n=>n.toLowerCase()).filter(n=>n.length>1))}function Fe(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}function F(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{Te as a,Ne as b,Q as c,ie as d,te as e,re as f,j as g,G as h};
|
|
5
|
-
//# sourceMappingURL=chunk-FKYPOK7P.js.map
|
package/dist/chunk-HDBQHJNY.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function g(n,t){let e=new Set;for(let r of n)t.has(r)&&e.add(r);return e}function p(n,t){let e=new Set;for(let r of n)t.has(r)||e.add(r);return e}function S(n,t){if(n.size===0&&t.size===0)return 0;let e=0;for(let o of n)t.has(o)&&(e+=1);let r=n.size+t.size-e;return r===0?0:e/r}function M(n,t){if(n.size===0)return 0;let e=0;for(let r of n)t.has(r)&&(e+=1);return e/n.size}function b(n){let t=n.length;if(t===0)return new Map;let e=new Map;for(let r of n)for(let o of r)e.set(o,(e.get(o)??0)+1);return m(e,t)}function m(n,t){if(t<=0)return new Map;let e=new Map;for(let[r,o]of n)o>0&&e.set(r,Math.log(t/o));return e}function l(n){let t=[...n.values()].sort((r,o)=>r-o);if(t.length===0)return 0;let e=Math.floor(t.length/2);return t.length%2===0?(t[e-1]+t[e])/2:t[e]}function w(n,t,e,r={}){let o=0,u=0,c=0,d=r.medianIdf??l(e),a=[],f=[];for(let s of n){let i=e.get(s)??0;u+=i*i,t.has(s)&&(o+=i*i,i>=d?a.push(s):f.push(s))}if(a.length===0&&f.length===0)return{similarity:0,significantShared:[],trivialShared:[]};for(let s of t){let i=e.get(s)??0;c+=i*i}let T=Math.sqrt(u)*Math.sqrt(c),h=T>0?o/T:0;return a.sort((s,i)=>(e.get(i)??0)-(e.get(s)??0)),{similarity:h,significantShared:a,trivialShared:f}}export{g as a,p as b,S as c,M as d,b as e,m as f,l as g,w as h};
|
|
2
|
-
//# sourceMappingURL=chunk-HDBQHJNY.js.map
|
package/dist/chunk-LONIY5FF.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as y,f as E,g as q}from"./chunk-MJXJ56LG.js";import{a as g}from"./chunk-BGBBVSH4.js";import{b as O,c as H,d as W}from"./chunk-MFWAZFYD.js";import{c as G}from"./chunk-XAYARHNF.js";import{a as j,j as B,l as F,m as V}from"./chunk-W2TIXAGN.js";import{a as k}from"./chunk-RISLKTKQ.js";import{f as K,h as S}from"./chunk-TJXOD4IK.js";import{f as P,g as N,i as A,j as w}from"./chunk-JM72FNGA.js";import{a as M,f as p}from"./chunk-OZUJ3VZS.js";import{a as b,b as L}from"./chunk-5MHQI4RR.js";import{a as C,d}from"./chunk-DS6QEB3G.js";import{c as T}from"./chunk-A536TEU4.js";import{a as v}from"./chunk-64MNV6AB.js";function Y(t,e,r){let a=e.identifierResolution==="strict"?F:V;for(let n of e.paths)if(!(!b(n)&&!(e.includeVueSfc&&L(n)))&&!t.isIgnored(n)&&!e.skipPath?.(n))try{if(e.candidateNames&&!B(C(t,n),e.candidateNames))continue;let l=(i,c,R,m)=>{if(e.candidateNames&&!e.candidateNames.has(i))return;let h=e.resolveTargets?e.resolveTargets({sourceFile:n,name:i,kind:c,defaultTargets:m}):m();for(let D of h)r({sourceFile:n,name:i,target:D,occurrences:R,kind:c})},f=j(t,n);for(let[i,c]of f)l(i,"identifier",c.length,()=>a(t,n,i));for(let i of p(t,n,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let c=i.kind==="cross-language-dispatch"?()=>F(t,n,i.name):()=>a(t,n,i.name);l(i.name,i.kind,i.occurrences,c)}}finally{e.afterPath?.(n)}}function _(t,e={}){let{scope:r,minLoc:a=1,maxLoc:n=Number.POSITIVE_INFINITY,excludeSymbol:o,excludeEntrySurfaces:l=!1,excludeTypesFiles:f=!1,excludeRootedSymbols:i=!1,requireFunctionLikeSymbol:c=!1,requireCallableSymbol:R=!1,excludeRustTraitImplMembers:m=!1,includeSuppressed:h=!1,sortByLocDesc:D=!1}=e,I=[];for(let s of S(t,r)){let u=s.relativePath;if(t.isIgnored(u)||l&&E(t,u)||!J(s,{requireFunctionLikeSymbol:c,requireCallableSymbol:R})||o!==void 0&&s.symbol===o)continue;let x=g(s);x<a||x>n||f&&Q(u)||i&&q(t,s.symbol,u)||m&&A(s.symbol)||y(u)!=="test"&&(w(s.symbol)||!h&&d(t,u,s.startLine)||I.push(s))}return D?I.sort((s,u)=>g(u)-g(s)):I}function J(t,e){return e.requireCallableSymbol?P(t.symbol):e.requireFunctionLikeSymbol?N(t.symbol):t.isFunctionLike}function Q(t){return(t.split("/").pop()??"").includes("types")}var z=class{constructor(e){this.db=e}db;scopedDefinitions(e){return S(this.db,e)}definitionsForFile(e){return K(this.db,e)}productionCallableDefinitions(e={}){return _(this.db,e)}calleeMap(e,r={}){return G(this.db,e,r)}crossFileCallerMap(e,r={}){return O(this.db,e,r)}sourceFallbackCallerFiles(e){return H(this.db,e)}callerFileMap(e,r={}){return W(this.db,e,r)}frameworkReferencedSymbolIds(e){let r=new Map;for(let n of e){if(!n.leaf)continue;let o=r.get(n.leaf)??[];o.push(n.symbolId),r.set(n.leaf,o)}let a=new Set;for(let n of v(this.db,{includeIgnored:!1}))if(b(n)==="rust")for(let{name:o}of p(this.db,n,{includeRustAttributeNames:!0}))for(let l of r.get(o)??[])a.add(l);return a}symbolsWithNonSelfCallees(e,r={}){if(e.length===0)return new Set;let a=new Map(e.map(o=>[o.symbolId,o.symbol])),n=this.calleeMap(e,r);return new Set([...n.entries()].filter(([o,l])=>{let f=a.get(o);return l.some(i=>i.symbol!==f)}).map(([o])=>o))}fileDependencyGraph(e){return k(this.db,e)}fileKind(e){return y(e)}hasSuppressionComment(e){return d(this.db,e.relativePath,e.startLine)}sourceFiles(){return T(this.db)}scanSourceReferences(e,r){Y(this.db,e,r)}callableSignature(e){let r=M(this.db,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);return r?{paramCount:r.paramCount}:null}};export{z as a};
|
|
2
|
-
//# sourceMappingURL=chunk-LONIY5FF.js.map
|
package/dist/chunk-W2TIXAGN.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{d as w}from"./chunk-U73YFD3P.js";import{c as _}from"./chunk-733EF5FD.js";import{b as S}from"./chunk-G2CGUNQU.js";import{u as M}from"./chunk-3LQFMQPY.js";import{f as y,k as h}from"./chunk-TJXOD4IK.js";import{d as m}from"./chunk-JM72FNGA.js";import{a as b}from"./chunk-OZUJ3VZS.js";import{a as D}from"./chunk-5MHQI4RR.js";import{a as u}from"./chunk-DS6QEB3G.js";import{c as I}from"./chunk-A536TEU4.js";import{c as g,d as N}from"./chunk-7S5E7KWT.js";function R(e,r,n,t={}){if(!n)return[];let i=u(e,r);return i?i.indexOf(n)===-1?[]:(L(e,r).get(n)??[]).filter(o=>!H(o,t)):[]}function H(e,r){return typeof r.excludeStartLine=="number"&&typeof r.excludeEndLine=="number"&&e>=r.excludeStartLine&&e<=r.excludeEndLine}var J=g("file-identifiers",{clearGroups:["whole-project","source-file"]});function v(e,r){let n=b(e,r);return n?n.fileIdentifiers:J.get(e,r,()=>new Set(L(e,r).keys()))}var z=g("file-ident-lines",{clearGroups:["whole-project","source-file"]});function L(e,r){let n=b(e,r);return n?n.identifierLineMap:z.get(e,r,()=>U(e,r))}var Z=g("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function ce(e,r){let n=b(e,r);return n?n.identifiersByLine:Z.get(e,r,()=>{let t=L(e,r),i=0;for(let o of t.values()){let c=o[o.length-1];c!==void 0&&c>i&&(i=c)}let s=new Array(i+1);for(let o=0;o<=i;o+=1)s[o]=new Set;for(let[o,c]of t)for(let a of c)s[a].add(o);return s})}function U(e,r){let n=new Map,t=(c,a)=>{let l=n.get(c);if(!l){n.set(c,[a]);return}l[l.length-1]!==a&&l.push(a)},i=u(e,r);if(!i)return n;let s=M(i).split(/\r?\n/),o=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<s.length;c+=1){let a=s[c]??"";for(let l of a.matchAll(o))l[1]&&t(l[1],c)}return n}function k(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function d(e,r){return k(e)===k(r)}function A(e,r){let n=new Map;for(let t of S(e,r)){if(!t.sourcePath)continue;let i=t.localName??t.importedName;if(i&&F(n,i,t.sourcePath),t.kind==="namespace")for(let s of t.usedMembers)F(n,s,t.sourcePath)}return n}function F(e,r,n){let t=e.get(r);t||(t=new Set,e.set(r,t)),t.add(n)}function me(e,r){return E(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.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
|
-
${t}
|
|
10
|
-
${e.pathExclusionsFor("d")}
|
|
11
|
-
GROUP BY m.symbol_id, d.relative_path`,...n??[])})}function de(e,r){return E(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.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
|
-
${t}
|
|
17
|
-
${e.pathExclusionsFor("d")}`,...n??[])}).filter(n=>n.symbol_id!==null)}function O(e,r){return E(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.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
|
-
${t}
|
|
24
|
-
${e.pathExclusionsFor("d")}
|
|
25
|
-
ORDER BY d.relative_path, c.start_line`,...n??[])})}function E(e,r,n){if(!r)return n();if(r.length===0)return[];let t=[];for(let i=0;i<r.length;i+=750)t.push(...n(r.slice(i,i+750)));return t}function _e(e,r){let n=T(e);return n?r.filter(t=>T(t.file)===n):r}function Re(e,r,n,t){let i=n.find(s=>s.file===r);if(i)return i;if(t){let s=new Set(S(e,r).map(o=>o.sourcePath).filter(o=>!!o));for(let o of n)for(let c of s)if(d(c,o.file))return o;return null}return n.length===1?n[0]:null}function T(e){let r=D(e);return r?r==="typescript"||r==="tsx"||r==="javascript"?"javascript-family":r:null}var W=N("global-leaf-index",{clearGroups:["whole-project"]});function x(e){return W.get(e,()=>{let r=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")}`),n=new Map;for(let t of r){if(!t.relative_path||e.isIgnored(t.relative_path))continue;let i=m(t.symbol);if(!i)continue;let s=n.get(i);s||(s=[],n.set(i,s)),s.some(o=>o.symbolId===t.id)||s.push({symbol:t.symbol,symbolId:t.id,file:t.relative_path})}return n})}var P=/[A-Za-z_$][A-Za-z0-9_$]*/g,Y=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function $(e,r){if(r.size===0)return!0;let n=[],t=!1;for(let s of r)s&&(t=!0,Y.test(s)||n.push(s));if(!t)return!0;P.lastIndex=0;let i;for(;(i=P.exec(e))!==null;)if(r.has(i[0]))return!0;for(let s of n)if(e.includes(s))return!0;return!1}function C(e,r,n){let t=x(e).get(n);if(!t||t.length===0)return[];if(t.length===1)return[p(t[0])];let i=t.filter(a=>a.file===r);if(i.length>0)return i.map(p);let s=A(e,r),o=s.get(n);if(o)for(let a of o){let l=t.filter(f=>d(a,f.file));if(l.length>0)return l.map(p)}let c=new Set;for(let a of s.values())for(let l of a)c.add(l);for(let a of c){let l=t.filter(f=>d(a,f.file));if(l.length>0&&l.length===t.length)return l.map(p)}return[]}function Oe(e,r,n){let t=C(e,r,n);if(t.length>0)return t;let i=x(e).get(n);return!i||i.length===0?[]:i.map(p)}function B(e,r,n={}){let t=_(e,r);if(!t)return[];let i=m(t.symbol);if(!i)return[];if(n.semantic!==!1){let o=w(e,{...t,leaf:i,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(o.length>0){let c=new Map;for(let a of o){let l=c.get(a.file)??[];l.push(a.line),c.set(a.file,l)}return j(e,c)}}let s=new Map;for(let o of I(e)){let c=u(e,o);if(!c||c.indexOf(i)===-1||o!==t.relativePath&&!C(e,o,i).some(f=>f.symbolId===t.symbolId))continue;let a=R(e,o,i,o===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{});a.length>0&&s.set(o,a)}return j(e,s)}function Te(e,r){let n=new Map;for(let o of r){if(!o.leaf)continue;let c=n.get(o.leaf)??[];c.push(o),n.set(o.leaf,c)}if(n.size===0)return new Map;let t=new Set(r.map(o=>o.symbolId)),i=new Set(n.keys()),s=new Map;for(let o of I(e)){if(!$(u(e,o),i))continue;let c=v(e,o);if(c.size!==0){for(let a of c)if(n.has(a))for(let l of C(e,o,a)){if(!t.has(l.symbolId)||o===l.relativePath)continue;let f=s.get(l.symbolId);f||(f=new Set,s.set(l.symbolId,f)),f.add(o)}}}return s}function p(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function j(e,r){let n=[],t=new Set;for(let[i,s]of r){let o=y(e,i);for(let c of s){let a=h(o,c),l=`${i}|${c}|${a?.symbol??""}`;t.has(l)||(t.add(l),n.push({file:i,line:c,enclosingSymbol:a?.symbol??null}))}}return n}function Q(e,r){let n=ne(e,r);return n?te(e,X(e,n.match,n.identifier)):[]}function ze(e,r,n={}){return V(e,r,n).map(t=>({file:t.file,line:t.line,enclosingSymbol:t.enclosingSymbol}))}function V(e,r,n={}){let t=B(e,r,{semantic:n.semantic}),i=t.length>0?G(t,"source-attribution"):G(Q(e,r),"scip-reference-chunk");return n.includeIgnored===!0?i:i.filter(s=>!e.isIgnored(s.file))}function G(e,r){return e.map(n=>({...n,provenance:r}))}function X(e,r,n){let t=new Map;for(let[i,s]of q(e,r.symbolId))t.set(i,K(e,i,s,r,n));return t}function q(e,r){let n=new Map;for(let t of O(e,[r])){if(e.isIgnored(t.relative_path))continue;let i=n.get(t.relative_path);i||(i=[],n.set(t.relative_path,i)),i.push({start_line:t.chunk_start,end_line:t.chunk_end})}return n}function K(e,r,n,t,i){let s=r===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{},o=i?R(e,r,i,s):[];return n.flatMap(c=>ee(o,c))}function ee(e,r){let n=e.filter(t=>t>=r.start_line&&t<=r.end_line);return n.length>0?n:[r.start_line]}function ne(e,r){let n=_(e,r);return n?{match:n,identifier:m(n.symbol)||null}:null}function te(e,r){let n=[],t=new Set;for(let[i,s]of r){let o=y(e,i);for(let c of s){let a=h(o,c),l=`${i}|${c}|${a?.symbol??""}`;t.has(l)||(t.add(l),n.push({file:i,line:c,enclosingSymbol:a?.symbol??null}))}}return n}export{L as a,ce as b,me as c,de as d,O as e,d as f,_e as g,Re as h,x as i,$ as j,A as k,C as l,Oe as m,Te as n,Q as o,ze as p};
|
|
40
|
-
//# sourceMappingURL=chunk-W2TIXAGN.js.map
|