scip-query 0.6.4 → 0.6.5

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.
Files changed (196) hide show
  1. package/README.md +31 -29
  2. package/dist/augment-vue-worker.js +2 -0
  3. package/dist/chunk-2ZGHRI2A.js +5 -0
  4. package/dist/chunk-32R4VYYA.js +2 -0
  5. package/dist/chunk-3UB2DPLP.js +2 -0
  6. package/dist/chunk-4X7C236P.js +84 -0
  7. package/dist/chunk-5LQ6CVX3.js +2 -0
  8. package/dist/chunk-5YYMKE3G.js +70 -0
  9. package/dist/chunk-7LSCW7NF.js +6 -0
  10. package/dist/chunk-7X7FLQC5.js +2 -0
  11. package/dist/chunk-A5UNS4DR.js +4 -0
  12. package/dist/chunk-BNCTPTVX.js +2 -0
  13. package/dist/{chunk-CGAO6FHN.js → chunk-C5BFS23M.js} +2 -2
  14. package/dist/{chunk-OOMAS234.js → chunk-DRLWW74T.js} +2 -2
  15. package/dist/chunk-EB5IVUNU.js +2 -0
  16. package/dist/{chunk-ZE3BTHTS.js → chunk-ERRUE5G4.js} +4 -4
  17. package/dist/chunk-F4KR22Z2.js +2 -0
  18. package/dist/chunk-FG6A6ZUP.js +2 -0
  19. package/dist/chunk-FHSD5RKF.js +19 -0
  20. package/dist/chunk-FVVEIGP3.js +5 -0
  21. package/dist/chunk-GBDZY73J.js +2 -0
  22. package/dist/{chunk-4TYGGOLO.js → chunk-H4DXD2FB.js} +1 -1
  23. package/dist/chunk-HUASU3AD.js +71 -0
  24. package/dist/chunk-IJWIYZO5.js +2 -0
  25. package/dist/chunk-K6H3XJQW.js +7 -0
  26. package/dist/{chunk-KYT47WU2.js → chunk-KAM4C6ZD.js} +1 -1
  27. package/dist/{chunk-IDCWMWWP.js → chunk-KTCODJNQ.js} +3 -3
  28. package/dist/chunk-LJ2YWNQF.js +2 -0
  29. package/dist/chunk-LT2CPEQ4.js +2 -0
  30. package/dist/chunk-M5QTG55L.js +2 -0
  31. package/dist/chunk-MKFH7QJG.js +7 -0
  32. package/dist/chunk-MO32JMOD.js +12 -0
  33. package/dist/chunk-MO65UK5V.js +6 -0
  34. package/dist/chunk-MTK3JAJT.js +2 -0
  35. package/dist/{chunk-6UJ5PXER.js → chunk-MXWC53GJ.js} +4 -4
  36. package/dist/{chunk-IVT2U2BV.js → chunk-OQZF2DQJ.js} +3 -3
  37. package/dist/chunk-PBFMZKXE.js +6 -0
  38. package/dist/{chunk-LAXFZ3UW.js → chunk-PFMGJ4BR.js} +4 -4
  39. package/dist/{chunk-QID23O53.js → chunk-PK4U6NWP.js} +2 -2
  40. package/dist/{chunk-GALIM3IE.js → chunk-Q2ALKKSE.js} +4 -4
  41. package/dist/chunk-QFCK6WV2.js +39 -0
  42. package/dist/chunk-QFZE73XF.js +84 -0
  43. package/dist/chunk-QRYEOK3M.js +2 -0
  44. package/dist/{chunk-LORWXBOO.js → chunk-RKTDEIHF.js} +1 -1
  45. package/dist/chunk-ROWAEEOD.js +2 -0
  46. package/dist/chunk-RT5PV5JQ.js +7 -0
  47. package/dist/chunk-TLRA5TR6.js +2 -0
  48. package/dist/chunk-U5MVUPOO.js +2 -0
  49. package/dist/chunk-URUVLDM7.js +29 -0
  50. package/dist/chunk-WHGCGENP.js +16 -0
  51. package/dist/chunk-WIIZF5FP.js +2 -0
  52. package/dist/chunk-WNMAH3P7.js +2 -0
  53. package/dist/chunk-XV3XUZ3X.js +11 -0
  54. package/dist/chunk-YDKWDTAW.js +2 -0
  55. package/dist/{chunk-5OVBASGY.js → chunk-YDNCX5PF.js} +2 -2
  56. package/dist/chunk-YU25IHJX.js +90 -0
  57. package/dist/{chunk-AW3QJT4O.js → chunk-Z5CTXSWT.js} +3 -3
  58. package/dist/chunk-ZFCQQ4B5.js +2 -0
  59. package/dist/chunk-ZHHMG4UC.js +114 -0
  60. package/dist/cli.js +487 -388
  61. package/dist/{db-DKhNQ75l.d.ts → db-BZPa7dzJ.d.ts} +19 -9
  62. package/dist/index.d.ts +221 -13
  63. package/dist/index.js +45 -31
  64. package/dist/postinstall.js +1 -1
  65. package/dist/queries/affected.d.ts +1 -1
  66. package/dist/queries/affected.js +1 -1
  67. package/dist/queries/bottlenecks.d.ts +1 -1
  68. package/dist/queries/bottlenecks.js +1 -1
  69. package/dist/queries/by-kind.d.ts +1 -1
  70. package/dist/queries/by-kind.js +1 -1
  71. package/dist/queries/call-graph.d.ts +1 -1
  72. package/dist/queries/call-graph.js +1 -1
  73. package/dist/queries/change-surface.d.ts +1 -1
  74. package/dist/queries/change-surface.js +1 -1
  75. package/dist/queries/code.d.ts +1 -1
  76. package/dist/queries/code.js +1 -1
  77. package/dist/queries/complexity-hotspots.d.ts +1 -1
  78. package/dist/queries/complexity-hotspots.js +1 -1
  79. package/dist/queries/complexity.d.ts +1 -1
  80. package/dist/queries/complexity.js +1 -1
  81. package/dist/queries/convergence.d.ts +1 -1
  82. package/dist/queries/convergence.js +1 -1
  83. package/dist/queries/coupling.d.ts +1 -1
  84. package/dist/queries/coupling.js +1 -1
  85. package/dist/queries/cycles.d.ts +1 -1
  86. package/dist/queries/cycles.js +1 -1
  87. package/dist/queries/dataflow.d.ts +1 -1
  88. package/dist/queries/dataflow.js +1 -1
  89. package/dist/queries/dead.d.ts +1 -1
  90. package/dist/queries/dead.js +1 -1
  91. package/dist/queries/deep-chains.d.ts +1 -1
  92. package/dist/queries/deep-chains.js +1 -1
  93. package/dist/queries/deps.d.ts +1 -1
  94. package/dist/queries/deps.js +1 -1
  95. package/dist/queries/diff-impact.d.ts +1 -1
  96. package/dist/queries/diff-impact.js +1 -1
  97. package/dist/queries/drift-policy.d.ts +6 -0
  98. package/dist/queries/drift-policy.js +2 -0
  99. package/dist/queries/drift.d.ts +1 -1
  100. package/dist/queries/drift.js +1 -1
  101. package/dist/queries/extract-candidates.d.ts +1 -1
  102. package/dist/queries/extract-candidates.js +1 -1
  103. package/dist/queries/fan.d.ts +1 -1
  104. package/dist/queries/fan.js +1 -1
  105. package/dist/queries/files.d.ts +1 -1
  106. package/dist/queries/files.js +1 -1
  107. package/dist/queries/health.d.ts +1 -1
  108. package/dist/queries/health.js +1 -1
  109. package/dist/queries/hierarchy.d.ts +1 -1
  110. package/dist/queries/hierarchy.js +1 -1
  111. package/dist/queries/hotspots.d.ts +1 -1
  112. package/dist/queries/hotspots.js +1 -1
  113. package/dist/queries/imports.d.ts +1 -1
  114. package/dist/queries/imports.js +1 -1
  115. package/dist/queries/index.d.ts +1 -1
  116. package/dist/queries/index.js +1 -1
  117. package/dist/queries/isolated.d.ts +1 -1
  118. package/dist/queries/isolated.js +1 -1
  119. package/dist/queries/members.d.ts +1 -1
  120. package/dist/queries/members.js +1 -1
  121. package/dist/queries/methods.d.ts +1 -1
  122. package/dist/queries/methods.js +1 -1
  123. package/dist/queries/outline.d.ts +1 -1
  124. package/dist/queries/outline.js +1 -1
  125. package/dist/queries/passthrough-candidates.d.ts +1 -1
  126. package/dist/queries/passthrough-candidates.js +1 -1
  127. package/dist/queries/redundant-reexports.d.ts +1 -1
  128. package/dist/queries/redundant-reexports.js +1 -1
  129. package/dist/queries/refs.d.ts +1 -1
  130. package/dist/queries/refs.js +1 -1
  131. package/dist/queries/similar-chains.d.ts +1 -1
  132. package/dist/queries/similar-chains.js +1 -1
  133. package/dist/queries/similar-files.d.ts +1 -1
  134. package/dist/queries/similar-files.js +1 -1
  135. package/dist/queries/similar-signatures.d.ts +1 -1
  136. package/dist/queries/similar-signatures.js +1 -1
  137. package/dist/queries/similar.d.ts +1 -1
  138. package/dist/queries/similar.js +1 -1
  139. package/dist/queries/slice.d.ts +1 -1
  140. package/dist/queries/slice.js +1 -1
  141. package/dist/queries/stale-abstractions.d.ts +1 -1
  142. package/dist/queries/stale-abstractions.js +1 -1
  143. package/dist/queries/stats.d.ts +1 -1
  144. package/dist/queries/stats.js +1 -1
  145. package/dist/queries/surface.d.ts +1 -1
  146. package/dist/queries/surface.js +1 -1
  147. package/dist/queries/symbols.d.ts +1 -1
  148. package/dist/queries/symbols.js +1 -1
  149. package/dist/queries/system.d.ts +1 -1
  150. package/dist/queries/system.js +1 -1
  151. package/dist/queries/trace.d.ts +1 -1
  152. package/dist/queries/trace.js +1 -1
  153. package/dist/queries/wrapper-candidates.d.ts +1 -1
  154. package/dist/queries/wrapper-candidates.js +1 -1
  155. package/dist/reindex-worker.js +10 -63
  156. package/package.json +4 -2
  157. package/dist/chunk-2DQK2IDZ.js +0 -19
  158. package/dist/chunk-4HCKXL7T.js +0 -6
  159. package/dist/chunk-4Q2D5BMS.js +0 -2
  160. package/dist/chunk-5IM4IQ6N.js +0 -2
  161. package/dist/chunk-5NSYCQWM.js +0 -6
  162. package/dist/chunk-6QKHOBC6.js +0 -2
  163. package/dist/chunk-6U5UHIRD.js +0 -5
  164. package/dist/chunk-AQFXC7CF.js +0 -2
  165. package/dist/chunk-BSONDC3H.js +0 -7
  166. package/dist/chunk-ECT6SOBO.js +0 -2
  167. package/dist/chunk-FFE3RZ65.js +0 -2
  168. package/dist/chunk-FT4WPAEX.js +0 -65
  169. package/dist/chunk-G6HYVVRV.js +0 -2
  170. package/dist/chunk-GVVKLMXG.js +0 -10
  171. package/dist/chunk-HVM6SQPQ.js +0 -2
  172. package/dist/chunk-IJO2HZFL.js +0 -2
  173. package/dist/chunk-INPQVQ6O.js +0 -12
  174. package/dist/chunk-JSBWVSES.js +0 -39
  175. package/dist/chunk-MFVPKCS5.js +0 -2
  176. package/dist/chunk-MWCN46ZX.js +0 -89
  177. package/dist/chunk-N3Z2SJCR.js +0 -2
  178. package/dist/chunk-NKU7Z242.js +0 -8
  179. package/dist/chunk-P6IUCZA3.js +0 -24
  180. package/dist/chunk-PM3GTZ4I.js +0 -2
  181. package/dist/chunk-QL5MJOVA.js +0 -84
  182. package/dist/chunk-QWFK4QOQ.js +0 -2
  183. package/dist/chunk-RBYC6PHE.js +0 -2
  184. package/dist/chunk-TS7E5XBZ.js +0 -29
  185. package/dist/chunk-TUC6IWTY.js +0 -2
  186. package/dist/chunk-USMVRM6F.js +0 -2
  187. package/dist/chunk-VTZPTRKS.js +0 -7
  188. package/dist/chunk-WUYKGQSK.js +0 -2
  189. package/dist/chunk-X7LOLGYY.js +0 -2
  190. package/dist/chunk-XGOEZVMA.js +0 -7
  191. package/dist/chunk-Y6NOLG4X.js +0 -70
  192. package/dist/chunk-YVQ7CIKO.js +0 -6
  193. package/dist/chunk-ZIFKQQW2.js +0 -4
  194. package/dist/chunk-ZOR6FW74.js +0 -2
  195. package/dist/chunk-ZPZLVFJQ.js +0 -41
  196. package/dist/chunk-ZZ3F6P3X.js +0 -2
@@ -91,6 +91,7 @@ interface ParsedSourceImport {
91
91
  kind: 'named' | 'default' | 'namespace' | 'side-effect';
92
92
  used: boolean;
93
93
  usedMembers: string[];
94
+ isTypeOnly?: boolean;
94
95
  }
95
96
  /**
96
97
  * A single export-from binding parsed out of a source file. Used by the
@@ -417,13 +418,15 @@ interface SimilarSymbolResult {
417
418
  symbolB: string;
418
419
  shortNameB: string;
419
420
  fileB: string;
420
- /** Jaccard similarity of callee sets (0-1) */
421
+ /** Similarity score (0-1). Basis says what evidence was compared. */
421
422
  similarity: number;
422
- /** Callees shared by both symbols */
423
+ /** Evidence used for similarity: call graph callees or lexical source tokens. */
424
+ similarityBasis?: 'callees' | 'source-tokens';
425
+ /** Shared callees or source tokens, depending on similarityBasis. */
423
426
  sharedCallees: string[];
424
- /** Callees unique to A */
427
+ /** Callees or source tokens unique to A, depending on similarityBasis. */
425
428
  uniqueToA: string[];
426
- /** Callees unique to B */
429
+ /** Callees or source tokens unique to B, depending on similarityBasis. */
427
430
  uniqueToB: string[];
428
431
  }
429
432
  interface SimilarFileResult {
@@ -693,6 +696,8 @@ interface ScipQueryConfig {
693
696
  entryRoots?: EntryRootsConfig;
694
697
  /** Paths to .gitignore files to load for filtering */
695
698
  gitignorePaths?: string[];
699
+ /** Optional semantic-provider configuration */
700
+ semantic?: SemanticConfig;
696
701
  }
697
702
  interface ProjectConfig {
698
703
  /** Override which languages to index (default: auto-detect) */
@@ -705,6 +710,15 @@ interface ProjectConfig {
705
710
  dbPath?: string;
706
711
  /** Project-specific externally-live roots for dead-code filtering */
707
712
  entryRoots?: EntryRootsConfig;
713
+ /** Optional semantic-provider configuration */
714
+ semantic?: SemanticConfig;
715
+ }
716
+ interface SemanticConfig {
717
+ typescript?: TypeScriptSemanticConfig;
718
+ }
719
+ interface TypeScriptSemanticConfig {
720
+ /** Explicit tsconfig paths, relative to project root unless absolute */
721
+ tsconfigs?: string[];
708
722
  }
709
723
  interface EntryRootsConfig {
710
724
  /** Any symbol defined in these path prefixes is externally live */
@@ -814,11 +828,7 @@ declare class ScipDatabase {
814
828
  all<T = Record<string, unknown>>(sql: string, ...params: unknown[]): T[];
815
829
  /** Run a raw SQL query and return the first row */
816
830
  get<T = Record<string, unknown>>(sql: string, ...params: unknown[]): T | undefined;
817
- /** Get the database file size in bytes */
818
- sizeBytes(): number;
819
- /** Get the last modification time of the database file */
820
- lastModified(): Date | null;
821
831
  close(): void;
822
832
  }
823
833
 
824
- export { type DeadSymbolResult as $, type AffectedResult as A, type BottleneckResult as B, type CallGraphResult as C, type DataflowResult as D, type ExtractCandidate as E, type FanResult as F, type SimilarChainResult as G, type HealthReport as H, type ImportResult as I, type StaleAbstraction as J, type SliceResult as K, type SimilarSignatureGroup as L, type MemberResult as M, type ScipSymbol as N, type OutlineNode as O, type PassthroughCandidate as P, type ScipLocalSymbol as Q, type RedundantReexport as R, ScipDatabase as S, type TraceResult as T, type UnusedImportResult as U, type SupportedLanguage as V, type WrapperCandidate as W, type IndexerConfig as X, type ProjectConfig as Y, type WatcherStatus as Z, type ChangeSurfaceEntry as _, type ByKindResult as a, type DescriptorSuffix as a0, type DocumentPathCandidate as a1, type DriftResult as a2, type EntryRootsConfig as a3, type HealthAction as a4, type IndexedDefinition as a5, type IndexerOverrides as a6, type InstallMethod as a7, type ParsedReExport as a8, type ParsedSourceExport as a9, type ParsedSourceImport as aa, type ReferenceSite as ab, type ScipDescriptor as ac, type ScipQueryConfig as ad, type SymbolLocation as ae, type SymbolMatch as af, type WatchConfig as ag, createGitignoreFilter as ah, type ChangeSurfaceResult as b, type CodeResult as c, type ComplexityHotspot as d, type ComplexityResult as e, type ConvergenceResult as f, type CouplingResult as g, type CycleResult as h, type DeadOptions as i, type DeadSummary as j, type DeepChainResult as k, type DepResult as l, type DiffImpactResult as m, type DriftSummary as n, type FileResult as o, type HierarchyNode as p, type HotspotResult as q, type IsolatedResult as r, type MethodResult as s, type StatsResult as t, type SymbolResult as u, type RefResult as v, type SystemResult as w, type SurfaceResult as x, type SimilarSymbolResult as y, type SimilarFileResult as z };
834
+ export { type ProjectConfig as $, type AffectedResult as A, type BottleneckResult as B, type CallGraphResult as C, type DataflowResult as D, type ExtractCandidate as E, type FanResult as F, type StaleAbstraction as G, type HealthReport as H, type ImportResult as I, type SliceResult as J, type RedundantReexport as K, type SimilarSignatureGroup as L, type MemberResult as M, type SymbolMatch as N, type OutlineNode as O, type PassthroughCandidate as P, type SymbolLocation as Q, type RefResult as R, ScipDatabase as S, type TraceResult as T, type UnusedImportResult as U, type IndexedDefinition as V, type WrapperCandidate as W, type ScipSymbol as X, type ScipLocalSymbol as Y, type SupportedLanguage as Z, type IndexerConfig as _, type ByKindResult as a, type WatcherStatus as a0, type ChangeSurfaceEntry as a1, type DeadSymbolResult as a2, type DescriptorSuffix as a3, type DocumentPathCandidate as a4, type DriftResult as a5, type EntryRootsConfig as a6, type HealthAction as a7, type IndexerOverrides as a8, type InstallMethod as a9, type ParsedReExport as aa, type ParsedSourceExport as ab, type ParsedSourceImport as ac, type ReferenceSite as ad, type ScipDescriptor as ae, type ScipQueryConfig as af, type SemanticConfig as ag, type TypeScriptSemanticConfig as ah, type WatchConfig as ai, createGitignoreFilter as aj, type ChangeSurfaceResult as b, type CodeResult as c, type ComplexityHotspot as d, type ComplexityResult as e, type ConvergenceResult as f, type CouplingResult as g, type CycleResult as h, type DeadOptions as i, type DeadSummary as j, type DeepChainResult as k, type DepResult as l, type DiffImpactResult as m, type DriftSummary as n, type FileResult as o, type HierarchyNode as p, type HotspotResult as q, type IsolatedResult as r, type MethodResult as s, type StatsResult as t, type SymbolResult as u, type SystemResult as v, type SurfaceResult as w, type SimilarSymbolResult as x, type SimilarFileResult as y, type SimilarChainResult as z };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { N as ScipSymbol, Q as ScipLocalSymbol, V as SupportedLanguage, X as IndexerConfig, Y as ProjectConfig, Z as WatcherStatus } from './db-DKhNQ75l.js';
2
- export { A as AffectedResult, B as BottleneckResult, a as ByKindResult, C as CallGraphResult, _ as ChangeSurfaceEntry, b as ChangeSurfaceResult, c as CodeResult, d as ComplexityHotspot, e as ComplexityResult, f as ConvergenceResult, g as CouplingResult, h as CycleResult, D as DataflowResult, i as DeadOptions, j as DeadSummary, $ as DeadSymbolResult, k as DeepChainResult, l as DepResult, a0 as DescriptorSuffix, m as DiffImpactResult, a1 as DocumentPathCandidate, a2 as DriftResult, n as DriftSummary, a3 as EntryRootsConfig, E as ExtractCandidate, F as FanResult, o as FileResult, a4 as HealthAction, H as HealthReport, p as HierarchyNode, q as HotspotResult, I as ImportResult, a5 as IndexedDefinition, a6 as IndexerOverrides, a7 as InstallMethod, r as IsolatedResult, M as MemberResult, s as MethodResult, O as OutlineNode, a8 as ParsedReExport, a9 as ParsedSourceExport, aa as ParsedSourceImport, P as PassthroughCandidate, R as RedundantReexport, v as RefResult, ab as ReferenceSite, S as ScipDatabase, ac as ScipDescriptor, ad as ScipQueryConfig, G as SimilarChainResult, z as SimilarFileResult, L as SimilarSignatureGroup, y as SimilarSymbolResult, K as SliceResult, J as StaleAbstraction, t as StatsResult, x as SurfaceResult, ae as SymbolLocation, af as SymbolMatch, u as SymbolResult, w as SystemResult, T as TraceResult, U as UnusedImportResult, ag as WatchConfig, W as WrapperCandidate, ah as createGitignoreFilter } from './db-DKhNQ75l.js';
1
+ import { S as ScipDatabase, N as SymbolMatch, Q as SymbolLocation, V as IndexedDefinition, X as ScipSymbol, Y as ScipLocalSymbol, Z as SupportedLanguage, _ as IndexerConfig, $ as ProjectConfig, a0 as WatcherStatus } from './db-BZPa7dzJ.js';
2
+ export { A as AffectedResult, B as BottleneckResult, a as ByKindResult, C as CallGraphResult, a1 as ChangeSurfaceEntry, b as ChangeSurfaceResult, c as CodeResult, d as ComplexityHotspot, e as ComplexityResult, f as ConvergenceResult, g as CouplingResult, h as CycleResult, D as DataflowResult, i as DeadOptions, j as DeadSummary, a2 as DeadSymbolResult, k as DeepChainResult, l as DepResult, a3 as DescriptorSuffix, m as DiffImpactResult, a4 as DocumentPathCandidate, a5 as DriftResult, n as DriftSummary, a6 as EntryRootsConfig, E as ExtractCandidate, F as FanResult, o as FileResult, a7 as HealthAction, H as HealthReport, p as HierarchyNode, q as HotspotResult, I as ImportResult, a8 as IndexerOverrides, a9 as InstallMethod, r as IsolatedResult, M as MemberResult, s as MethodResult, O as OutlineNode, aa as ParsedReExport, ab as ParsedSourceExport, ac as ParsedSourceImport, P as PassthroughCandidate, K as RedundantReexport, R as RefResult, ad as ReferenceSite, ae as ScipDescriptor, af as ScipQueryConfig, ag as SemanticConfig, z as SimilarChainResult, y as SimilarFileResult, L as SimilarSignatureGroup, x as SimilarSymbolResult, J as SliceResult, G as StaleAbstraction, t as StatsResult, w as SurfaceResult, u as SymbolResult, v as SystemResult, T as TraceResult, ah as TypeScriptSemanticConfig, U as UnusedImportResult, ai as WatchConfig, W as WrapperCandidate, aj as createGitignoreFilter } from './db-BZPa7dzJ.js';
3
3
  export { stats } from './queries/stats.js';
4
4
  export { files } from './queries/files.js';
5
5
  export { symbols } from './queries/symbols.js';
@@ -46,6 +46,216 @@ export { similarSignatures } from './queries/similar-signatures.js';
46
46
  import { Index } from '@c4312/scip';
47
47
  import 'better-sqlite3';
48
48
 
49
+ /**
50
+ * File classifier — one place to decide what role a source file plays.
51
+ *
52
+ * Multiple queries (dead, health, cycles, drift) all need to ask
53
+ * questions like "is this a test file?", "is this an entry point?",
54
+ * "is this a barrel?" Pre-this-module each query had its own answer
55
+ * with subtle divergences. classifyFile gives every query one
56
+ * consistent verdict.
57
+ *
58
+ * `FileKind` is closed — when a future contributor adds a kind they
59
+ * edit the type, and the compiler forces every consumer's switch to
60
+ * handle it.
61
+ */
62
+
63
+ type FileKind = 'entry' | 'barrel' | 'worker' | 'test' | 'source';
64
+ /**
65
+ * Classify a file by role. Pure pattern matching — doesn't need a DB.
66
+ * For "is this barrel reachable?" use `isLiveBarrel(db, file)` instead.
67
+ */
68
+ declare function classifyFile(file: string): FileKind;
69
+
70
+ /**
71
+ * reference-graph — bulk caller/callee maps and reference-site
72
+ * resolution.
73
+ *
74
+ * Where to get what:
75
+ * Reference lines (where is this used?):
76
+ * - Primary: `getSourceReferenceSites` — cross-file identifier
77
+ * scan (re-exported from identifier-attribution).
78
+ * Returns [] when the leaf name is ambiguous.
79
+ * - Fallback: `getResolvedReferenceSites` — mention-resolved
80
+ * chunks with in-chunk line refinement. Always
81
+ * returns a result when the symbol has mentions.
82
+ * Do NOT read `chunks.start_line` as the "line of a reference"; a
83
+ * chunk spans many source lines.
84
+ *
85
+ * Bulk graph builders:
86
+ * - `buildCalleeMap(db, defs)` — for each definition, the symbols
87
+ * it calls (AST + chunk merged).
88
+ * - `buildCrossFileCallerMap(db, defs?)` — reverse: symbolId →
89
+ * set of files that reference it.
90
+ * - `buildCallerRowsMap(db)` — symbolId → list of caller
91
+ * (symbol, file) rows, cached once per DB.
92
+ * - `getCalleeRowsForSymbol` / `getCallerRowsForSymbol` — narrow
93
+ * single-symbol views over the bulk maps.
94
+ *
95
+ * File-dependency graph:
96
+ * - `buildFileDepGraph(db, scope?)` — file → set of files it
97
+ * imports/references.
98
+ *
99
+ * Layer position: top of the layering — uses path-resolver,
100
+ * symbol-lookup, and definition-catalog. Identifier-attribution sits
101
+ * alongside (re-exported here as `getSourceReferenceSites` /
102
+ * `buildSourceFallbackCallerFiles` so callers don't have to learn a
103
+ * second module name).
104
+ */
105
+
106
+ declare function buildFileDepGraph(db: ScipDatabase, scope?: string): Map<string, Set<string>>;
107
+ /**
108
+ * Bulk callee map: for each definition in the list, find every symbol it
109
+ * actually calls.
110
+ *
111
+ * For files with tree-sitter support (Rust, TS/JS, Python), we use AST
112
+ * call_expression / new_expression nodes — every callsite is exact, every
113
+ * attribution is to the precise enclosing function.
114
+ *
115
+ * For files without AST support (Java, JVM, Ruby, .NET, Dart, PHP, C/C++),
116
+ * we fall back to chunk-level SCIP mentions.
117
+ *
118
+ * `opts.additive`:
119
+ * - false (default, "call-strict"): AST is the ground truth for AST files;
120
+ * chunk attribution is NOT unioned in. Use for callee fingerprints,
121
+ * extract/passthrough analysis, callGraph — anywhere you need exact
122
+ * "what does this function call" without false positives from chunk
123
+ * attribution placing a mention in the wrong enclosing function.
124
+ * - true ("union with chunks"): merges both paths. Use for liveness
125
+ * checks (isolated, "has any callee at all") where ambiguous-leaf
126
+ * callees that AST resolution skips would otherwise produce false
127
+ * positives.
128
+ */
129
+ declare function buildCalleeMap(db: ScipDatabase, definitions: ReadonlyArray<SymbolMatch>, opts?: {
130
+ additive?: boolean;
131
+ }): Map<number, Array<{
132
+ symbol: string;
133
+ file: string;
134
+ chunkId: number;
135
+ }>>;
136
+ /**
137
+ * Bulk caller map: symbolId → set of distinct files that reference the
138
+ * symbol.
139
+ *
140
+ * For files with tree-sitter support, callers come from AST call_expression
141
+ * nodes — each callsite resolves to a real symbol via the global leaf index
142
+ * with same-file preference. For non-AST files, callers come from SCIP's
143
+ * mentions table (chunk-level) with self-reference filtering.
144
+ *
145
+ * If `definitions` is supplied, references that fall inside the symbol's own
146
+ * defining file are treated as potential self-references and only counted
147
+ * when they originate from a different document.
148
+ */
149
+ declare function buildCrossFileCallerMap(db: ScipDatabase, definitions?: ReadonlyArray<SymbolLocation>): Map<number, Set<string>>;
150
+
151
+ /**
152
+ * Identifier-attribution module — one owner of "given a textual identifier
153
+ * hit in file F, which SCIP symbol(s) does it refer to?"
154
+ *
155
+ * Pre-this-module the same logic lived in four places (sourceCandidateLines,
156
+ * importAttributedCandidateLines, buildSourceFallbackCallerFiles inner loop,
157
+ * dead.ts:resolveLeaf) with subtle drift. Bug fixes in one site silently
158
+ * coexisted with the bug in the others. The Vue support and interface-
159
+ * dispatch fixes from earlier had to touch all four sites separately.
160
+ *
161
+ * The forward call (`attributeIdentifier`) is the core. The inverse views
162
+ * (`findReferences`, `findCallerFiles`) build on it.
163
+ *
164
+ * The disambiguation policy — same-file > direct import > interface-dispatch
165
+ * (all candidates in same imported file) > empty — is owned here. Callers
166
+ * receive the answer, not raw candidates.
167
+ */
168
+
169
+ interface SymbolRef {
170
+ symbolId: number;
171
+ symbol: string;
172
+ /** Defining file of the symbol. */
173
+ relativePath: string;
174
+ }
175
+ /**
176
+ * What symbol(s) does identifier `name` in file `file` refer to?
177
+ *
178
+ * Returns the symbols this textual hit reasonably resolves to. May
179
+ * return >1 entry when an interface and one or more impls all live
180
+ * in the same imported file (runtime dispatch could land on any).
181
+ * Returns [] when the leaf is ambiguous and no disambiguation
182
+ * signal applies.
183
+ */
184
+ declare function attributeIdentifier(db: ScipDatabase, file: string, identifier: string): SymbolRef[];
185
+ /**
186
+ * For each symbol in `candidates`, which files reference it?
187
+ *
188
+ * Bulk variant of `findReferences` — one file walk credits every
189
+ * candidate-leaf hit in the file at once, instead of N walks per
190
+ * candidate. Used by the dead-code source-fallback path.
191
+ */
192
+ declare function findCallerFiles(db: ScipDatabase, candidates: ReadonlyArray<IndexedDefinition>): Map<number, Set<string>>;
193
+
194
+ interface CallableSignature {
195
+ paramCount: number;
196
+ }
197
+ /**
198
+ * Pull a function's parameter count from the AST. Used by similar-pair
199
+ * filtering to avoid declaring a 1-arg helper similar to a 7-arg orchestrator
200
+ * just because they happen to share infrastructure callees.
201
+ *
202
+ * On first call per file, walks the entire AST once and indexes every
203
+ * callable's signature by (startLine, endLine). Subsequent calls are O(1)
204
+ * Map lookups — critical when called for thousands of candidates.
205
+ */
206
+ declare function getCallableSignature(db: ScipDatabase, relativePath: string, startLine: number, endLine: number): CallableSignature | null;
207
+
208
+ type SourceReferenceKind = 'identifier' | 'cross-language-dispatch' | 'rust-attribute';
209
+ type SourceReferenceTarget = ReturnType<typeof attributeIdentifier>[number];
210
+ interface SourceReferenceHit {
211
+ sourceFile: string;
212
+ name: string;
213
+ target: SourceReferenceTarget;
214
+ occurrences: number;
215
+ kind: SourceReferenceKind;
216
+ }
217
+ interface ScanSourceReferencesOptions {
218
+ paths: Iterable<string>;
219
+ includeVueSfc?: boolean;
220
+ includeCrossLanguageDispatchNames?: boolean;
221
+ includeRustAttributeNames?: boolean;
222
+ identifierResolution?: 'strict' | 'permissive';
223
+ skipPath?: (relativePath: string) => boolean;
224
+ }
225
+ declare function scanSourceReferences(db: ScipDatabase, opts: ScanSourceReferencesOptions, visit: (hit: SourceReferenceHit) => void): void;
226
+
227
+ interface ProductionCallableDefinitionsOptions {
228
+ scope?: string;
229
+ minLoc?: number;
230
+ maxLoc?: number;
231
+ excludeSymbol?: string;
232
+ excludeEntrySurfaces?: boolean;
233
+ excludeTypesFiles?: boolean;
234
+ excludeRustTraitImplMembers?: boolean;
235
+ includeSuppressed?: boolean;
236
+ requireFunctionLikeSymbol?: boolean;
237
+ requireCallableSymbol?: boolean;
238
+ sortByLocDesc?: boolean;
239
+ }
240
+ declare class ProjectIndex {
241
+ private readonly db;
242
+ constructor(db: ScipDatabase);
243
+ scopedDefinitions(scope?: string): IndexedDefinition[];
244
+ definitionsForFile(relativePath: string): IndexedDefinition[];
245
+ productionCallableDefinitions(opts?: ProductionCallableDefinitionsOptions): IndexedDefinition[];
246
+ calleeMap(definitions: ReadonlyArray<SymbolMatch>, opts?: {
247
+ additive?: boolean;
248
+ }): ReturnType<typeof buildCalleeMap>;
249
+ crossFileCallerMap(definitions?: ReadonlyArray<SymbolMatch>): ReturnType<typeof buildCrossFileCallerMap>;
250
+ sourceFallbackCallerFiles(definitions: ReadonlyArray<IndexedDefinition>): ReturnType<typeof findCallerFiles>;
251
+ fileDependencyGraph(scope?: string): ReturnType<typeof buildFileDepGraph>;
252
+ fileKind(relativePath: string): ReturnType<typeof classifyFile>;
253
+ hasSuppressionComment(definition: Pick<IndexedDefinition, 'relativePath' | 'startLine'>): boolean;
254
+ sourceFiles(): string[];
255
+ scanSourceReferences(opts: Parameters<typeof scanSourceReferences>[1], visit: Parameters<typeof scanSourceReferences>[2]): void;
256
+ callableSignature(definition: Pick<IndexedDefinition, 'relativePath' | 'startLine' | 'endLine'>): ReturnType<typeof getCallableSignature>;
257
+ }
258
+
49
259
  /**
50
260
  * Parse a SCIP symbol string into its structured components.
51
261
  * Works for any SCIP-indexed language (TypeScript, Java, Rust, Python, etc.)
@@ -188,6 +398,12 @@ interface ReindexOptions {
188
398
  pnpmWorkspaces?: boolean;
189
399
  /** Skip auto-install prompts */
190
400
  skipAutoInstall?: boolean;
401
+ /** Reuse an existing index when tracked source inputs are unchanged (default true). */
402
+ skipIfUnchanged?: boolean;
403
+ /** Permit a partial index when some detected/requested languages fail (default false). */
404
+ allowPartial?: boolean;
405
+ /** Number of language indexers to run at once (default: conservative auto). */
406
+ indexerConcurrency?: number;
191
407
  }
192
408
  interface ReindexResult {
193
409
  /** Languages that were successfully indexed. */
@@ -195,6 +411,8 @@ interface ReindexResult {
195
411
  indexPath: string;
196
412
  dbPath: string;
197
413
  durationMs: number;
414
+ /** True when existing SCIP/SQLite outputs were reused because inputs were unchanged. */
415
+ reused: boolean;
198
416
  /**
199
417
  * Languages detected in the project but skipped because their indexer
200
418
  * could not be located, installed, or run. Each entry includes the reason.
@@ -215,16 +433,6 @@ declare function reindex(opts: ReindexOptions): Promise<ReindexResult>;
215
433
  * Returns defaults for anything not specified.
216
434
  */
217
435
  declare function loadProjectConfig(projectRoot: string): ProjectConfig;
218
- /**
219
- * Resolve the cache directory for a project's SCIP index.
220
- *
221
- * Default: ~/.cache/scip-query/projects/<hash>/
222
- * Override: project config dbPath, or SCIP_QUERY_DB_PATH env var
223
- *
224
- * The hash is derived from the absolute project path so each
225
- * project gets its own isolated index storage.
226
- */
227
- declare function resolveCacheDir(projectRoot: string, config?: ProjectConfig): string;
228
436
  /**
229
437
  * Resolve all paths for a project's index files.
230
438
  */
@@ -307,4 +515,4 @@ declare function installSkills(opts?: {
307
515
  quiet?: boolean;
308
516
  }): InstallSkillsResult;
309
517
 
310
- export { INDEXER_CONFIGS, IndexerConfig, ProjectConfig, ScipLocalSymbol, ScipSymbol, SupportedLanguage, Watcher, WatcherStatus, augmentAuxiliaryDocuments, augmentVueResolvedReferences, detectLanguages, getIndexerConfig, getScipVersion, initProjectConfig, installSkills, isBinaryAvailable, isIndexerInstalled, isScipInstalled, leafName, loadProjectConfig, mergeScipFiles, mergeScipIndexes, parseSymbol, printScipInstallInstructions, reindex, resolveCacheDir, resolveIndexPaths, shortenSymbol, tryInstallIndexer, tryInstallScipCli };
518
+ export { INDEXER_CONFIGS, IndexedDefinition, IndexerConfig, ProjectConfig, ProjectIndex, ScipDatabase, ScipLocalSymbol, ScipSymbol, SupportedLanguage, SymbolLocation, SymbolMatch, Watcher, WatcherStatus, augmentAuxiliaryDocuments, augmentVueResolvedReferences, detectLanguages, getIndexerConfig, getScipVersion, initProjectConfig, installSkills, isBinaryAvailable, isIndexerInstalled, isScipInstalled, leafName, loadProjectConfig, mergeScipFiles, mergeScipIndexes, parseSymbol, printScipInstallInstructions, reindex, resolveIndexPaths, shortenSymbol, tryInstallIndexer, tryInstallScipCli };