ai-code-map 0.1.0-alpha.2 → 0.1.0-alpha.3

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/dist/index.d.ts CHANGED
@@ -1,14 +1,5 @@
1
- import ts from 'typescript';
2
1
  import { z } from 'zod';
3
-
4
- declare const SCHEMA_VERSION: 4;
5
- declare const CONFIG_VERSION: 1;
6
- declare const ANALYZER_VERSION = "0.4.0";
7
-
8
- declare class CodeMapError extends Error {
9
- readonly code: string;
10
- constructor(code: string, message: string, options?: ErrorOptions);
11
- }
2
+ import ts from 'typescript';
12
3
 
13
4
  declare const JsonValueSchema: z.ZodJSONSchema;
14
5
  type JsonValue = z.infer<typeof JsonValueSchema>;
@@ -1073,6 +1064,170 @@ interface Analyzer {
1073
1064
  scan(options?: ScanOptions): Promise<ScanResult>;
1074
1065
  }
1075
1066
 
1067
+ interface SymbolSearchOptions {
1068
+ limit?: number;
1069
+ }
1070
+ interface SymbolSearchMatch {
1071
+ id: string;
1072
+ name: string;
1073
+ kind: SymbolKind;
1074
+ file: string;
1075
+ range: SourceRange;
1076
+ /** Normalized query words not found in a partial word match. */
1077
+ unmatchedTerms?: string[];
1078
+ }
1079
+ interface SymbolSearchResult {
1080
+ query: string;
1081
+ total: number;
1082
+ truncated: boolean;
1083
+ matches: SymbolSearchMatch[];
1084
+ }
1085
+ declare function findSymbols(map: CodeMap, query: string, options?: SymbolSearchOptions): SymbolSearchResult;
1086
+
1087
+ interface ContextOptions {
1088
+ root: string;
1089
+ /** Shared source-line budget, 1..2000; default 800. */
1090
+ maxLines?: number;
1091
+ /** Shared source-character budget including line separators, 256..64000; default 32000. */
1092
+ maxChars?: number;
1093
+ /** Maximum search matches to expand, 1..5; default 3. */
1094
+ seeds?: number;
1095
+ }
1096
+ interface ContextSnippet {
1097
+ file: string;
1098
+ startLine: number;
1099
+ endLine: number;
1100
+ source: string;
1101
+ }
1102
+ interface ContextOmission {
1103
+ id: string;
1104
+ file: string;
1105
+ startLine: number;
1106
+ endLine: number;
1107
+ }
1108
+ interface ContextResult {
1109
+ query: string;
1110
+ matches: SymbolSearchMatch[];
1111
+ moreMatches: number;
1112
+ selected: {
1113
+ id: string;
1114
+ role: "match" | "neighbor";
1115
+ }[];
1116
+ snippets: ContextSnippet[];
1117
+ omitted: ContextOmission[];
1118
+ fileReferences: {
1119
+ file: string;
1120
+ line: number;
1121
+ }[];
1122
+ tests: {
1123
+ file: string;
1124
+ line: number;
1125
+ }[];
1126
+ omittedNavigation: number;
1127
+ usedLines: number;
1128
+ usedChars: number;
1129
+ limits: {
1130
+ maxLines: number;
1131
+ maxChars: number;
1132
+ seeds: number;
1133
+ };
1134
+ }
1135
+ /** Expand matches and small outgoing dependencies into bounded current source. */
1136
+ declare function buildSourceContext(map: CodeMap, query: string, options: ContextOptions): Promise<ContextResult>;
1137
+ declare function formatSourceContext(result: ContextResult): string;
1138
+
1139
+ interface ReadNavigationLink {
1140
+ direction: "outgoing" | "incoming";
1141
+ type: RelationType;
1142
+ id: string;
1143
+ file: string;
1144
+ startLine: number;
1145
+ endLine: number;
1146
+ classification: "exact" | "framework-derived";
1147
+ }
1148
+ interface ReadNavigation {
1149
+ links: ReadNavigationLink[];
1150
+ /** Exact incoming call sites in paths named *.test.*, *.spec.* or __tests__/. */
1151
+ tests: {
1152
+ file: string;
1153
+ line: number;
1154
+ }[];
1155
+ /** Unique eligible neighbors/sites excluded by the row or character limits. */
1156
+ omittedLinks: number;
1157
+ omittedTests: number;
1158
+ }
1159
+
1160
+ interface ReadSourceOptions {
1161
+ root: string;
1162
+ /** Maximum source lines per page; integer 1..200, default 80. */
1163
+ limit?: number;
1164
+ /** Zero-based offset within the symbol's window, including two context lines. */
1165
+ offset?: number;
1166
+ }
1167
+ interface ReadSourceResult {
1168
+ id: string;
1169
+ file: string;
1170
+ symbolRange: SourceRange;
1171
+ startLine: number;
1172
+ endLine: number;
1173
+ source: string;
1174
+ truncated: boolean;
1175
+ nextOffset?: number;
1176
+ /** Bounded direct links and test call sites, present only at offset zero. */
1177
+ navigation?: ReadNavigation;
1178
+ }
1179
+ /** Read current source using an exact map ID, never a fuzzy selector. */
1180
+ declare function readSymbolSource(map: CodeMap, id: string, options: ReadSourceOptions): Promise<ReadSourceResult>;
1181
+
1182
+ interface ProjectMapView {
1183
+ project: string;
1184
+ counts: {
1185
+ files: number;
1186
+ symbols: number;
1187
+ endpoints: number;
1188
+ relationGroups: number;
1189
+ relationRecords: number;
1190
+ };
1191
+ files: {
1192
+ ref: string;
1193
+ id: string;
1194
+ path: string;
1195
+ }[];
1196
+ symbols: {
1197
+ ref: string;
1198
+ id: string;
1199
+ name: string;
1200
+ kind: SymbolKind;
1201
+ file: string;
1202
+ range: SourceRange;
1203
+ }[];
1204
+ endpoints: {
1205
+ ref: string;
1206
+ id: string;
1207
+ }[];
1208
+ relations: {
1209
+ from: string;
1210
+ type: RelationType;
1211
+ classification: RelationEvidenceClassification;
1212
+ targets: {
1213
+ ref: string;
1214
+ count: number;
1215
+ }[];
1216
+ }[];
1217
+ }
1218
+ /** Complete structural projection; no source text or per-occurrence evidence. */
1219
+ declare function buildProjectMap(map: CodeMap): ProjectMapView;
1220
+ declare function formatProjectMap(map: ProjectMapView): string;
1221
+
1222
+ declare const SCHEMA_VERSION: 4;
1223
+ declare const CONFIG_VERSION: 1;
1224
+ declare const ANALYZER_VERSION = "0.4.0";
1225
+
1226
+ declare class CodeMapError extends Error {
1227
+ readonly code: string;
1228
+ constructor(code: string, message: string, options?: ErrorOptions);
1229
+ }
1230
+
1076
1231
  interface InitOptions extends LoadCodeMapOptions {
1077
1232
  force?: boolean;
1078
1233
  }
@@ -1121,7 +1276,13 @@ declare function computeManifestIntegrityHash(manifest: ManifestRecord): string;
1121
1276
  declare function checkFreshness(options?: LoadCodeMapOptions): Promise<FreshnessResult>;
1122
1277
 
1123
1278
  declare function showSymbol(map: CodeMap, selector: string): ShowResult;
1124
- declare function formatShowResult(result: ShowResult): string;
1279
+ interface ShowFormatOptions {
1280
+ /** Preserve the verbose text view. JSON and showSymbol always retain full records. */
1281
+ full?: boolean;
1282
+ /** Total relation groups across the compact view; integer 1..50, default 12. */
1283
+ limit?: number;
1284
+ }
1285
+ declare function formatShowResult(result: ShowResult, options?: ShowFormatOptions): string;
1125
1286
 
1126
1287
  declare class CoreAnalyzer implements FrameworkAnalyzer {
1127
1288
  readonly name = "typescript-node";
@@ -1175,4 +1336,4 @@ declare class TypeScriptSemanticResolver implements SemanticResolver {
1175
1336
  }
1176
1337
  declare function createTypeScriptSemanticResolver(): SemanticResolver;
1177
1338
 
1178
- export { ANALYZER_VERSION, type AnalysisContext, type AnalysisContribution, type Analyzer, type ArtifactIntegrityRecord, ArtifactIntegrityRecordSchema, CONFIG_VERSION, type CodeMap, type CodeMapConfig, CodeMapError, CodeMapSchema, type CompilerUnitRecord, CompilerUnitRecordSchema, ConfigSchema, CoreAnalyzer, type DiagnosticCode, type DiagnosticRecord, DiagnosticRecordSchema, type DiagnosticSeverity, type ExportRecord, type ExternalOperation, type ExternalOperationKind, FallbackParserAdapter, type FileRecord, FileRecordSchema, type Framework, type FrameworkAnalyzer, type FrameworkSelection, type FreshnessResult, type FreshnessStatus, GitIgnoreAdapter, type IgnoreAdapter, type ImportRecord, type ImportSpecifierRecord, type InitOptions, type InitResult, type JsonPrimitive, type JsonValue, type Language, type LoadCodeMapOptions, type ManifestRecord, ManifestRecordSchema, ManypkgWorkspaceDiscovery, type MapCounts, NestJsAnalyzer, NextJsAnalyzer, type ProducerRecord, ProducerRecordSchema, type ProjectRecord, ProjectRecordSchema, ReactAnalyzer, type RelationEvidenceClassification, type RelationOrigin, type RelationRecord, RelationRecordSchema, type RelationType, SCHEMA_VERSION, type ScanChanges, type ScanOptions, type ScanResult, type SemanticInputObservation, type SemanticInputRecord, SemanticInputRecordSchema, type SemanticModuleResolution, type SemanticResolution, type SemanticResolveInput, type SemanticResolver, type ShowResult, type SourceRange, type SymbolKind, type SymbolRecord, SymbolRecordSchema, type SyntaxFact, type SyntaxFactKind, type SyntaxIssue, type SyntaxParseInput, type SyntaxParseResult, type SyntaxParserAdapter, type SyntaxSummary, TypeScriptParserAdapter, TypeScriptSemanticResolver, type WorkspaceDiscovery, type WorkspaceDiscoveryResult, type WorkspacePackage, buildOverview, checkFreshness, computeManifestIntegrityHash, createAnalyzer, createDefaultConfig, createGitIgnoreAdapter, createTypeScriptParserAdapter, createTypeScriptSemanticResolver, createWorkspaceDiscovery, findProjectRoot, formatShowResult, initProject, loadCodeMap, scanProject, showSymbol };
1339
+ export { ANALYZER_VERSION, type AnalysisContext, type AnalysisContribution, type Analyzer, type ArtifactIntegrityRecord, ArtifactIntegrityRecordSchema, CONFIG_VERSION, type CodeMap, type CodeMapConfig, CodeMapError, CodeMapSchema, type CompilerUnitRecord, CompilerUnitRecordSchema, ConfigSchema, type ContextOmission, type ContextOptions, type ContextResult, type ContextSnippet, CoreAnalyzer, type DiagnosticCode, type DiagnosticRecord, DiagnosticRecordSchema, type DiagnosticSeverity, type ExportRecord, type ExternalOperation, type ExternalOperationKind, FallbackParserAdapter, type FileRecord, FileRecordSchema, type Framework, type FrameworkAnalyzer, type FrameworkSelection, type FreshnessResult, type FreshnessStatus, GitIgnoreAdapter, type IgnoreAdapter, type ImportRecord, type ImportSpecifierRecord, type InitOptions, type InitResult, type JsonPrimitive, type JsonValue, type Language, type LoadCodeMapOptions, type ManifestRecord, ManifestRecordSchema, ManypkgWorkspaceDiscovery, type MapCounts, NestJsAnalyzer, NextJsAnalyzer, type ProducerRecord, ProducerRecordSchema, type ProjectMapView, type ProjectRecord, ProjectRecordSchema, ReactAnalyzer, type ReadNavigation, type ReadNavigationLink, type ReadSourceOptions, type ReadSourceResult, type RelationEvidenceClassification, type RelationOrigin, type RelationRecord, RelationRecordSchema, type RelationType, SCHEMA_VERSION, type ScanChanges, type ScanOptions, type ScanResult, type SemanticInputObservation, type SemanticInputRecord, SemanticInputRecordSchema, type SemanticModuleResolution, type SemanticResolution, type SemanticResolveInput, type SemanticResolver, type ShowFormatOptions, type ShowResult, type SourceRange, type SymbolKind, type SymbolRecord, SymbolRecordSchema, type SymbolSearchMatch, type SymbolSearchOptions, type SymbolSearchResult, type SyntaxFact, type SyntaxFactKind, type SyntaxIssue, type SyntaxParseInput, type SyntaxParseResult, type SyntaxParserAdapter, type SyntaxSummary, TypeScriptParserAdapter, TypeScriptSemanticResolver, type WorkspaceDiscovery, type WorkspaceDiscoveryResult, type WorkspacePackage, buildOverview, buildProjectMap, buildSourceContext, checkFreshness, computeManifestIntegrityHash, createAnalyzer, createDefaultConfig, createGitIgnoreAdapter, createTypeScriptParserAdapter, createTypeScriptSemanticResolver, createWorkspaceDiscovery, findProjectRoot, findSymbols, formatProjectMap, formatShowResult, formatSourceContext, initProject, loadCodeMap, readSymbolSource, scanProject, showSymbol };