infiniloom-node 0.4.4 → 0.4.6
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/index.d.ts
CHANGED
|
@@ -1043,6 +1043,181 @@ export declare function getChangedSymbolsAsync(path: string, fromRef: string, to
|
|
|
1043
1043
|
export declare function getTestsForFileAsync(path: string, filePath: string): Promise<Array<string>>
|
|
1044
1044
|
/** Async version of getCallSites */
|
|
1045
1045
|
export declare function getCallSitesAsync(path: string, symbolName: string): Promise<Array<CallSite>>
|
|
1046
|
+
/** Options for filtering changed symbols (Feature #6) */
|
|
1047
|
+
export interface ChangedSymbolsFilter {
|
|
1048
|
+
/**
|
|
1049
|
+
* Filter by symbol kinds: "function", "method", "class", etc.
|
|
1050
|
+
* If specified, only symbols of these kinds are returned.
|
|
1051
|
+
*/
|
|
1052
|
+
kinds?: Array<string>
|
|
1053
|
+
/** Exclude specific kinds (e.g., exclude "import" to skip import statements) */
|
|
1054
|
+
excludeKinds?: Array<string>
|
|
1055
|
+
}
|
|
1056
|
+
/** A symbol with change type information (Feature #7) */
|
|
1057
|
+
export interface ChangedSymbolInfo {
|
|
1058
|
+
/** Symbol ID */
|
|
1059
|
+
id: number
|
|
1060
|
+
/** Symbol name */
|
|
1061
|
+
name: string
|
|
1062
|
+
/** Symbol kind (function, class, method, etc.) */
|
|
1063
|
+
kind: string
|
|
1064
|
+
/** File path containing the symbol */
|
|
1065
|
+
file: string
|
|
1066
|
+
/** Start line number */
|
|
1067
|
+
line: number
|
|
1068
|
+
/** End line number */
|
|
1069
|
+
endLine: number
|
|
1070
|
+
/** Function/method signature */
|
|
1071
|
+
signature?: string
|
|
1072
|
+
/** Visibility (public, private, etc.) */
|
|
1073
|
+
visibility: string
|
|
1074
|
+
/** Change type: "added", "modified", or "deleted" */
|
|
1075
|
+
changeType: string
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Get symbols that were changed in a diff with filtering and change type (Features #6 & #7)
|
|
1079
|
+
*
|
|
1080
|
+
* Enhanced version of getChangedSymbols that supports filtering by symbol kind
|
|
1081
|
+
* and returns change type (added, modified, deleted) for each symbol.
|
|
1082
|
+
*
|
|
1083
|
+
* # Arguments
|
|
1084
|
+
* * `path` - Path to repository root
|
|
1085
|
+
* * `from_ref` - Starting commit/branch (e.g., "main", "HEAD~1")
|
|
1086
|
+
* * `to_ref` - Ending commit/branch (e.g., "HEAD", "feature-branch")
|
|
1087
|
+
* * `filter` - Optional filter for symbol kinds
|
|
1088
|
+
*
|
|
1089
|
+
* # Returns
|
|
1090
|
+
* Array of symbols with change type that were modified in the diff
|
|
1091
|
+
*
|
|
1092
|
+
* # Example
|
|
1093
|
+
* ```javascript
|
|
1094
|
+
* const { getChangedSymbolsFiltered, buildIndex } = require('infiniloom-node');
|
|
1095
|
+
*
|
|
1096
|
+
* buildIndex('./my-repo');
|
|
1097
|
+
* const changed = getChangedSymbolsFiltered('./my-repo', 'main', 'HEAD', {
|
|
1098
|
+
* kinds: ['function', 'method'], // Only functions and methods
|
|
1099
|
+
* excludeKinds: ['import'] // Skip import statements
|
|
1100
|
+
* });
|
|
1101
|
+
* for (const s of changed) {
|
|
1102
|
+
* console.log(`${s.changeType}: ${s.kind} ${s.name} in ${s.file}`);
|
|
1103
|
+
* }
|
|
1104
|
+
* ```
|
|
1105
|
+
*/
|
|
1106
|
+
export declare function getChangedSymbolsFiltered(path: string, fromRef: string, toRef: string, filter?: ChangedSymbolsFilter | undefined | null): Array<ChangedSymbolInfo>
|
|
1107
|
+
/** A caller in the transitive call chain (Feature #8) */
|
|
1108
|
+
export interface TransitiveCallerInfo {
|
|
1109
|
+
/** Symbol name */
|
|
1110
|
+
name: string
|
|
1111
|
+
/** Symbol kind */
|
|
1112
|
+
kind: string
|
|
1113
|
+
/** File path */
|
|
1114
|
+
file: string
|
|
1115
|
+
/** Line number */
|
|
1116
|
+
line: number
|
|
1117
|
+
/** Depth from the target symbol (1 = direct caller, 2 = caller of caller, etc.) */
|
|
1118
|
+
depth: number
|
|
1119
|
+
/** Call path from this caller to the target (e.g., ["main", "process", "validate", "target"]) */
|
|
1120
|
+
callPath: Array<string>
|
|
1121
|
+
}
|
|
1122
|
+
/** Options for transitive callers query */
|
|
1123
|
+
export interface TransitiveCallersOptions {
|
|
1124
|
+
/** Maximum depth to traverse (default: 3) */
|
|
1125
|
+
maxDepth?: number
|
|
1126
|
+
/** Maximum number of results (default: 100) */
|
|
1127
|
+
maxResults?: number
|
|
1128
|
+
}
|
|
1129
|
+
/**
|
|
1130
|
+
* Get all functions that eventually call a symbol (Feature #8)
|
|
1131
|
+
*
|
|
1132
|
+
* Traverses the call graph to find all direct and indirect callers
|
|
1133
|
+
* of the specified symbol, up to a maximum depth.
|
|
1134
|
+
*
|
|
1135
|
+
* # Arguments
|
|
1136
|
+
* * `path` - Path to repository root
|
|
1137
|
+
* * `symbol_name` - Name of the symbol to find callers for
|
|
1138
|
+
* * `options` - Optional query options
|
|
1139
|
+
*
|
|
1140
|
+
* # Returns
|
|
1141
|
+
* Array of callers with their depth and call path
|
|
1142
|
+
*
|
|
1143
|
+
* # Example
|
|
1144
|
+
* ```javascript
|
|
1145
|
+
* const { getTransitiveCallers, buildIndex } = require('infiniloom-node');
|
|
1146
|
+
*
|
|
1147
|
+
* buildIndex('./my-repo');
|
|
1148
|
+
* const callers = getTransitiveCallers('./my-repo', 'validateInput', { maxDepth: 3 });
|
|
1149
|
+
* for (const c of callers) {
|
|
1150
|
+
* console.log(`Depth ${c.depth}: ${c.name} -> ${c.callPath.join(' -> ')}`);
|
|
1151
|
+
* }
|
|
1152
|
+
* ```
|
|
1153
|
+
*/
|
|
1154
|
+
export declare function getTransitiveCallers(path: string, symbolName: string, options?: TransitiveCallersOptions | undefined | null): Array<TransitiveCallerInfo>
|
|
1155
|
+
/** A call site with surrounding context (Feature #9) */
|
|
1156
|
+
export interface CallSiteWithContext {
|
|
1157
|
+
/** Name of the calling function/method */
|
|
1158
|
+
caller: string
|
|
1159
|
+
/** Name of the function/method being called */
|
|
1160
|
+
callee: string
|
|
1161
|
+
/** File containing the call */
|
|
1162
|
+
file: string
|
|
1163
|
+
/** Line number of the call (1-indexed) */
|
|
1164
|
+
line: number
|
|
1165
|
+
/** Column number of the call (0-indexed, if available) */
|
|
1166
|
+
column?: number
|
|
1167
|
+
/** Caller symbol ID */
|
|
1168
|
+
callerId: number
|
|
1169
|
+
/** Callee symbol ID */
|
|
1170
|
+
calleeId: number
|
|
1171
|
+
/** Code context around the call site (configurable number of lines) */
|
|
1172
|
+
context?: string
|
|
1173
|
+
/** Start line of context */
|
|
1174
|
+
contextStartLine?: number
|
|
1175
|
+
/** End line of context */
|
|
1176
|
+
contextEndLine?: number
|
|
1177
|
+
}
|
|
1178
|
+
/** Options for call sites with context */
|
|
1179
|
+
export interface CallSitesContextOptions {
|
|
1180
|
+
/** Number of lines of context before the call (default: 3) */
|
|
1181
|
+
linesBefore?: number
|
|
1182
|
+
/** Number of lines of context after the call (default: 3) */
|
|
1183
|
+
linesAfter?: number
|
|
1184
|
+
}
|
|
1185
|
+
/**
|
|
1186
|
+
* Get call sites with surrounding code context (Feature #9)
|
|
1187
|
+
*
|
|
1188
|
+
* Enhanced version of getCallSites that includes the surrounding code
|
|
1189
|
+
* for each call site, useful for AI-powered code review.
|
|
1190
|
+
*
|
|
1191
|
+
* # Arguments
|
|
1192
|
+
* * `path` - Path to repository root
|
|
1193
|
+
* * `symbol_name` - Name of the symbol to find call sites for
|
|
1194
|
+
* * `options` - Optional context options
|
|
1195
|
+
*
|
|
1196
|
+
* # Returns
|
|
1197
|
+
* Array of call sites with code context
|
|
1198
|
+
*
|
|
1199
|
+
* # Example
|
|
1200
|
+
* ```javascript
|
|
1201
|
+
* const { getCallSitesWithContext, buildIndex } = require('infiniloom-node');
|
|
1202
|
+
*
|
|
1203
|
+
* buildIndex('./my-repo');
|
|
1204
|
+
* const sites = getCallSitesWithContext('./my-repo', 'authenticate', {
|
|
1205
|
+
* linesBefore: 5,
|
|
1206
|
+
* linesAfter: 5
|
|
1207
|
+
* });
|
|
1208
|
+
* for (const site of sites) {
|
|
1209
|
+
* console.log(`Call in ${site.file}:${site.line}`);
|
|
1210
|
+
* console.log(site.context);
|
|
1211
|
+
* }
|
|
1212
|
+
* ```
|
|
1213
|
+
*/
|
|
1214
|
+
export declare function getCallSitesWithContext(path: string, symbolName: string, options?: CallSitesContextOptions | undefined | null): Array<CallSiteWithContext>
|
|
1215
|
+
/** Async version of getChangedSymbolsFiltered */
|
|
1216
|
+
export declare function getChangedSymbolsFilteredAsync(path: string, fromRef: string, toRef: string, filter?: ChangedSymbolsFilter | undefined | null): Promise<Array<ChangedSymbolInfo>>
|
|
1217
|
+
/** Async version of getTransitiveCallers */
|
|
1218
|
+
export declare function getTransitiveCallersAsync(path: string, symbolName: string, options?: TransitiveCallersOptions | undefined | null): Promise<Array<TransitiveCallerInfo>>
|
|
1219
|
+
/** Async version of getCallSitesWithContext */
|
|
1220
|
+
export declare function getCallSitesWithContextAsync(path: string, symbolName: string, options?: CallSitesContextOptions | undefined | null): Promise<Array<CallSiteWithContext>>
|
|
1046
1221
|
/** Infiniloom class for advanced usage */
|
|
1047
1222
|
export declare class Infiniloom {
|
|
1048
1223
|
/**
|
package/index.js
CHANGED
|
@@ -310,7 +310,7 @@ if (!nativeBinding) {
|
|
|
310
310
|
throw new Error(`Failed to load native binding`)
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
const { pack, scan, scanWithOptions, countTokens, Infiniloom, semanticCompress, isGitRepo, GitRepo, scanSecurity, buildIndex, indexStatus, findSymbol, getCallers, getCallees, getReferences, getCallGraph, findSymbolAsync, getCallersAsync, getCalleesAsync, getReferencesAsync, getCallGraphAsync, chunk, analyzeImpact, getDiffContext, packAsync, scanAsync, buildIndexAsync, chunkAsync, analyzeImpactAsync, getDiffContextAsync, getSymbolsInFile, getSymbolSource, getChangedSymbols, getTestsForFile, getCallSites, getSymbolsInFileAsync, getSymbolSourceAsync, getChangedSymbolsAsync, getTestsForFileAsync, getCallSitesAsync } = nativeBinding
|
|
313
|
+
const { pack, scan, scanWithOptions, countTokens, Infiniloom, semanticCompress, isGitRepo, GitRepo, scanSecurity, buildIndex, indexStatus, findSymbol, getCallers, getCallees, getReferences, getCallGraph, findSymbolAsync, getCallersAsync, getCalleesAsync, getReferencesAsync, getCallGraphAsync, chunk, analyzeImpact, getDiffContext, packAsync, scanAsync, buildIndexAsync, chunkAsync, analyzeImpactAsync, getDiffContextAsync, getSymbolsInFile, getSymbolSource, getChangedSymbols, getTestsForFile, getCallSites, getSymbolsInFileAsync, getSymbolSourceAsync, getChangedSymbolsAsync, getTestsForFileAsync, getCallSitesAsync, getChangedSymbolsFiltered, getTransitiveCallers, getCallSitesWithContext, getChangedSymbolsFilteredAsync, getTransitiveCallersAsync, getCallSitesWithContextAsync } = nativeBinding
|
|
314
314
|
|
|
315
315
|
module.exports.pack = pack
|
|
316
316
|
module.exports.scan = scan
|
|
@@ -352,3 +352,9 @@ module.exports.getSymbolSourceAsync = getSymbolSourceAsync
|
|
|
352
352
|
module.exports.getChangedSymbolsAsync = getChangedSymbolsAsync
|
|
353
353
|
module.exports.getTestsForFileAsync = getTestsForFileAsync
|
|
354
354
|
module.exports.getCallSitesAsync = getCallSitesAsync
|
|
355
|
+
module.exports.getChangedSymbolsFiltered = getChangedSymbolsFiltered
|
|
356
|
+
module.exports.getTransitiveCallers = getTransitiveCallers
|
|
357
|
+
module.exports.getCallSitesWithContext = getCallSitesWithContext
|
|
358
|
+
module.exports.getChangedSymbolsFilteredAsync = getChangedSymbolsFilteredAsync
|
|
359
|
+
module.exports.getTransitiveCallersAsync = getTransitiveCallersAsync
|
|
360
|
+
module.exports.getCallSitesWithContextAsync = getCallSitesWithContextAsync
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|