/** * `opensip graph symbol-index --out ` — emit a symbol-index * JSON artifact suitable for agent consumption (e.g., feeding into a * coding LLM's context, or piping into another tool). * * Schema: * { * "version": "1.0", * "tool": "graph", * "generatedAt": "", * "symbols": { * "": [ * { "qualifiedName", "filePath", "line", "column", * "kind", "visibility", "bodyHash" }, * ... * ] * }, * "fileSymbols": { * "": ["", ...] * } * } * * Bidirectional like codeindex (name→file and file→names), but enriched * with kind/visibility/bodyHash since we already have that data. */ import type { Catalog } from '../types.js'; import type { ToolCliContext } from '@opensip-cli/core'; /** Options for {@link executeSymbolIndex} — the `opensip graph index` command. */ export interface SymbolIndexCommandOptions { readonly cwd: string; readonly out: string; /** * When true, run the graph pipeline first to refresh the persisted catalog * (Q7: build path). When false/absent, query the existing catalog only. */ readonly build?: boolean; } /** One symbol occurrence in the index — its location, kind, visibility, and body hash. */ export interface SymbolEntry { readonly qualifiedName: string; readonly filePath: string; readonly line: number; readonly column: number; readonly kind: string; readonly visibility: string; readonly bodyHash: string; } /** * The bidirectional symbol-index JSON artifact: `symbols` maps a simple name to * its occurrences ({@link SymbolEntry}), `fileSymbols` maps a file path to the * names it declares. Written to `--out` for agent / downstream-tool consumption. */ export interface SymbolIndexArtifact { readonly version: '1.0'; readonly tool: 'graph'; readonly generatedAt: string; readonly symbols: Record; readonly fileSymbols: Record; } /** * Execute `opensip graph index`: resolve the catalog (optionally rebuilding it * first when `opts.build` is set), serialize it to a {@link SymbolIndexArtifact} * via {@link buildArtifact}, and write the JSON to `opts.out`. */ export declare function executeSymbolIndex(opts: SymbolIndexCommandOptions, cli: ToolCliContext): Promise; /** * The pure symbol-entry core: flatten every non-`module-init` occurrence in the * catalog into a flat {@link SymbolEntry} list (the keyless counterpart to * {@link buildArtifact}). This is the CLI `graph symbol-index` artifact * projection; MCP audit search uses `@opensip-cli/graph/read` * `searchSymbolOccurrences`, which projects the richer GraphSymbolRef shape * (source/package/test/generated metadata the artifact intentionally omits). * Both consume catalog occurrences. No CLI side effects — data → data. */ export declare function buildSymbolIndexEntries(catalog: Catalog): SymbolEntry[]; /** * Project a {@link Catalog} into the serializable {@link SymbolIndexArtifact}, * building both the name→occurrences and file→names maps in one pass. */ export declare function buildArtifact(catalog: Catalog): SymbolIndexArtifact; //# sourceMappingURL=symbol-index.d.ts.map