AST scanner
function runASTScanner(rootDir: string, options?: RunAstScannerOptions): AstMethodResult[]RunAstScannerOptions
| Field | Description |
|---|---|
getAllTsFilesOptions | Controls which directories/files are discovered (skips node_modules, dist, etc., by default). |
compilerOptions | Extra options merged over the parsed tsconfig.json (or SDK defaults when no config exists). |
files | When set, build the TypeScript program from only these files (tests / narrow scans). |
expandParamTypes | When true, expands object/union shapes in parameter type strings. |
expandParamTypesOptions | Tuning knobs (maxDepth, maxProps, maxUnion, maxLen). |
Output
An array of scanner rows containing className, fnName, optional paramsFromAst, declaredReturnFromAst, and label/type tuples merged by mergeASTIntoRegistry.
Typical flow
- Host registers functions (
@Cat,cat, …). runASTScannerreads sources.mergeASTIntoRegistryupdates existing registry keys.
For the Socket.IO host path, attachCatRPC runs this orchestration internally when building the catalog (via scanRoots and nested bootstrap options). The standalone bootstrap helper is optional tooling with an embedded WebSocket.