@cesarandreslopez/occ 0.8.8 → 0.8.10

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.
@@ -0,0 +1,173 @@
1
+ /**
2
+ * Token-budgeted, importance-ranked repo map / pack.
3
+ *
4
+ * `buildRepoMap` ranks the graph (see `rank.ts`), then greedily admits the
5
+ * highest-ranked files until a token budget is hit — shedding low-rank symbols
6
+ * or shrinking content (partial admission) rather than dropping a whole file
7
+ * when it nearly fits. Two modes:
8
+ * - `map` — Aider-style: top symbol signatures per file (cheap context).
9
+ * - `pack` — Repomix-style: file content, optionally compressed to the
10
+ * architecturally-significant section via `extractKeySection`.
11
+ *
12
+ * Token counting is injected (`countTokens`) so a real BPE tokenizer can
13
+ * enforce an exact budget; it defaults to the language-aware heuristic.
14
+ */
15
+ import { z } from 'zod';
16
+ import type { CodebaseIndex } from './types.js';
17
+ export declare const RepoMapFormatSchema: z.ZodEnum<{
18
+ json: "json";
19
+ markdown: "markdown";
20
+ xml: "xml";
21
+ plain: "plain";
22
+ }>;
23
+ export type RepoMapFormat = z.infer<typeof RepoMapFormatSchema>;
24
+ export declare const RepoMapModeSchema: z.ZodEnum<{
25
+ map: "map";
26
+ pack: "pack";
27
+ }>;
28
+ export type RepoMapMode = z.infer<typeof RepoMapModeSchema>;
29
+ /** Opt-in query/path focus. Absent or empty → global structural rank only (no behavior change). */
30
+ export declare const RepoMapFocusSchema: z.ZodObject<{
31
+ query: z.ZodOptional<z.ZodString>;
32
+ paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
33
+ graphDepth: z.ZodOptional<z.ZodNumber>;
34
+ }, z.core.$strip>;
35
+ export type RepoMapFocus = z.infer<typeof RepoMapFocusSchema>;
36
+ export declare const RepoMapOptionsSchema: z.ZodObject<{
37
+ tokenBudget: z.ZodNumber;
38
+ mode: z.ZodOptional<z.ZodEnum<{
39
+ map: "map";
40
+ pack: "pack";
41
+ }>>;
42
+ format: z.ZodOptional<z.ZodEnum<{
43
+ json: "json";
44
+ markdown: "markdown";
45
+ xml: "xml";
46
+ plain: "plain";
47
+ }>>;
48
+ compress: z.ZodOptional<z.ZodBoolean>;
49
+ maxSymbolsPerFile: z.ZodOptional<z.ZodNumber>;
50
+ rank: z.ZodOptional<z.ZodObject<{
51
+ damping: z.ZodOptional<z.ZodNumber>;
52
+ maxIterations: z.ZodOptional<z.ZodNumber>;
53
+ epsilon: z.ZodOptional<z.ZodNumber>;
54
+ edgeWeights: z.ZodOptional<z.ZodObject<{
55
+ imports: z.ZodOptional<z.ZodNumber>;
56
+ calls: z.ZodOptional<z.ZodNumber>;
57
+ inherits: z.ZodOptional<z.ZodNumber>;
58
+ }, z.core.$strip>>;
59
+ biasExports: z.ZodOptional<z.ZodBoolean>;
60
+ includeExternal: z.ZodOptional<z.ZodBoolean>;
61
+ }, z.core.$strip>>;
62
+ focus: z.ZodOptional<z.ZodObject<{
63
+ query: z.ZodOptional<z.ZodString>;
64
+ paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
65
+ graphDepth: z.ZodOptional<z.ZodNumber>;
66
+ }, z.core.$strip>>;
67
+ }, z.core.$strip>;
68
+ type RepoMapSerializableOptions = z.infer<typeof RepoMapOptionsSchema>;
69
+ /** Runtime options. `countTokens` is a function, so it lives here, off the Zod schema. */
70
+ export interface RepoMapOptions extends RepoMapSerializableOptions {
71
+ countTokens?: (text: string) => number;
72
+ }
73
+ export declare const RepoMapSymbolSchema: z.ZodObject<{
74
+ name: z.ZodString;
75
+ kind: z.ZodString;
76
+ signature: z.ZodString;
77
+ line: z.ZodOptional<z.ZodNumber>;
78
+ exported: z.ZodBoolean;
79
+ jsdoc: z.ZodOptional<z.ZodString>;
80
+ }, z.core.$strip>;
81
+ export type RepoMapSymbol = z.infer<typeof RepoMapSymbolSchema>;
82
+ export declare const RepoMapEntrySchema: z.ZodObject<{
83
+ relativePath: z.ZodString;
84
+ path: z.ZodString;
85
+ language: z.ZodString;
86
+ score: z.ZodNumber;
87
+ normalizedScore: z.ZodNumber;
88
+ symbols: z.ZodArray<z.ZodObject<{
89
+ name: z.ZodString;
90
+ kind: z.ZodString;
91
+ signature: z.ZodString;
92
+ line: z.ZodOptional<z.ZodNumber>;
93
+ exported: z.ZodBoolean;
94
+ jsdoc: z.ZodOptional<z.ZodString>;
95
+ }, z.core.$strip>>;
96
+ content: z.ZodOptional<z.ZodString>;
97
+ contentReason: z.ZodOptional<z.ZodString>;
98
+ tokens: z.ZodNumber;
99
+ droppedSymbols: z.ZodNumber;
100
+ focusScore: z.ZodOptional<z.ZodNumber>;
101
+ focusReasons: z.ZodOptional<z.ZodArray<z.ZodString>>;
102
+ }, z.core.$strip>;
103
+ export type RepoMapEntry = z.infer<typeof RepoMapEntrySchema>;
104
+ /** Echoed focus selector plus how many files the focus touched. */
105
+ export declare const RepoMapFocusResultSchema: z.ZodObject<{
106
+ query: z.ZodOptional<z.ZodString>;
107
+ paths: z.ZodArray<z.ZodString>;
108
+ matchedFiles: z.ZodNumber;
109
+ }, z.core.$strip>;
110
+ export type RepoMapFocusResult = z.infer<typeof RepoMapFocusResultSchema>;
111
+ export declare const RepoMapResultSchema: z.ZodObject<{
112
+ mode: z.ZodEnum<{
113
+ map: "map";
114
+ pack: "pack";
115
+ }>;
116
+ format: z.ZodEnum<{
117
+ json: "json";
118
+ markdown: "markdown";
119
+ xml: "xml";
120
+ plain: "plain";
121
+ }>;
122
+ tokenizer: z.ZodOptional<z.ZodString>;
123
+ tokenBudget: z.ZodNumber;
124
+ tokensUsed: z.ZodNumber;
125
+ totalFiles: z.ZodNumber;
126
+ entries: z.ZodArray<z.ZodObject<{
127
+ relativePath: z.ZodString;
128
+ path: z.ZodString;
129
+ language: z.ZodString;
130
+ score: z.ZodNumber;
131
+ normalizedScore: z.ZodNumber;
132
+ symbols: z.ZodArray<z.ZodObject<{
133
+ name: z.ZodString;
134
+ kind: z.ZodString;
135
+ signature: z.ZodString;
136
+ line: z.ZodOptional<z.ZodNumber>;
137
+ exported: z.ZodBoolean;
138
+ jsdoc: z.ZodOptional<z.ZodString>;
139
+ }, z.core.$strip>>;
140
+ content: z.ZodOptional<z.ZodString>;
141
+ contentReason: z.ZodOptional<z.ZodString>;
142
+ tokens: z.ZodNumber;
143
+ droppedSymbols: z.ZodNumber;
144
+ focusScore: z.ZodOptional<z.ZodNumber>;
145
+ focusReasons: z.ZodOptional<z.ZodArray<z.ZodString>>;
146
+ }, z.core.$strip>>;
147
+ droppedFiles: z.ZodNumber;
148
+ droppedSymbols: z.ZodNumber;
149
+ truncated: z.ZodBoolean;
150
+ rankIterations: z.ZodNumber;
151
+ rankConverged: z.ZodBoolean;
152
+ focus: z.ZodOptional<z.ZodObject<{
153
+ query: z.ZodOptional<z.ZodString>;
154
+ paths: z.ZodArray<z.ZodString>;
155
+ matchedFiles: z.ZodNumber;
156
+ }, z.core.$strip>>;
157
+ }, z.core.$strip>;
158
+ export type RepoMapResult = z.infer<typeof RepoMapResultSchema>;
159
+ /**
160
+ * Render one symbol as a readable declaration line. The stored `signature` is
161
+ * the nameless callable form (`(params) => Return`), so we re-attach the name
162
+ * and a kind keyword to produce e.g. `export function foo(a: number): void`.
163
+ */
164
+ export declare function repoMapSignatureLine(symbol: RepoMapSymbol): string;
165
+ /**
166
+ * Markdown serialization of a single entry. Shared between token measurement
167
+ * (here) and the markdown renderer in `output.ts`, so the enforced budget
168
+ * matches the emitted document exactly.
169
+ */
170
+ export declare function repoMapEntryToMarkdown(entry: RepoMapEntry, mode: RepoMapMode): string;
171
+ /** Build a token-budgeted, importance-ranked repo map (or pack) from an index. */
172
+ export declare function buildRepoMap(index: CodebaseIndex, options: RepoMapOptions): RepoMapResult;
173
+ export {};
@@ -0,0 +1,344 @@
1
+ /**
2
+ * Token-budgeted, importance-ranked repo map / pack.
3
+ *
4
+ * `buildRepoMap` ranks the graph (see `rank.ts`), then greedily admits the
5
+ * highest-ranked files until a token budget is hit — shedding low-rank symbols
6
+ * or shrinking content (partial admission) rather than dropping a whole file
7
+ * when it nearly fits. Two modes:
8
+ * - `map` — Aider-style: top symbol signatures per file (cheap context).
9
+ * - `pack` — Repomix-style: file content, optionally compressed to the
10
+ * architecturally-significant section via `extractKeySection`.
11
+ *
12
+ * Token counting is injected (`countTokens`) so a real BPE tokenizer can
13
+ * enforce an exact budget; it defaults to the language-aware heuristic.
14
+ */
15
+ import { z } from 'zod';
16
+ import { estimateTokenCount } from '../tokens.js';
17
+ import { extractKeySection } from './query.js';
18
+ import { toNormalizedSymbolKind } from './types.js';
19
+ import { rankNodes, RankOptionsSchema } from './rank.js';
20
+ import { computeFocusScores } from './focus.js';
21
+ export const RepoMapFormatSchema = z.enum(['markdown', 'xml', 'json', 'plain']);
22
+ export const RepoMapModeSchema = z.enum(['map', 'pack']);
23
+ /** Opt-in query/path focus. Absent or empty → global structural rank only (no behavior change). */
24
+ export const RepoMapFocusSchema = z.object({
25
+ query: z.string().optional(),
26
+ paths: z.array(z.string()).optional(),
27
+ graphDepth: z.number().int().nonnegative().optional(),
28
+ });
29
+ export const RepoMapOptionsSchema = z.object({
30
+ tokenBudget: z.number().int().positive(),
31
+ mode: RepoMapModeSchema.optional(),
32
+ format: RepoMapFormatSchema.optional(),
33
+ compress: z.boolean().optional(),
34
+ maxSymbolsPerFile: z.number().int().positive().optional(),
35
+ rank: RankOptionsSchema.optional(),
36
+ focus: RepoMapFocusSchema.optional(),
37
+ });
38
+ export const RepoMapSymbolSchema = z.object({
39
+ name: z.string(),
40
+ kind: z.string(),
41
+ signature: z.string(),
42
+ line: z.number().optional(),
43
+ exported: z.boolean(),
44
+ jsdoc: z.string().optional(),
45
+ });
46
+ export const RepoMapEntrySchema = z.object({
47
+ relativePath: z.string(),
48
+ path: z.string(),
49
+ language: z.string(),
50
+ score: z.number(),
51
+ normalizedScore: z.number(),
52
+ symbols: z.array(RepoMapSymbolSchema),
53
+ content: z.string().optional(),
54
+ contentReason: z.string().optional(),
55
+ tokens: z.number(),
56
+ droppedSymbols: z.number(),
57
+ /** 0–100 focus relevance (present only when a focus is active). */
58
+ focusScore: z.number().optional(),
59
+ /** Human-readable reasons this file matched the focus. */
60
+ focusReasons: z.array(z.string()).optional(),
61
+ });
62
+ /** Echoed focus selector plus how many files the focus touched. */
63
+ export const RepoMapFocusResultSchema = z.object({
64
+ query: z.string().optional(),
65
+ paths: z.array(z.string()),
66
+ matchedFiles: z.number(),
67
+ });
68
+ export const RepoMapResultSchema = z.object({
69
+ mode: RepoMapModeSchema,
70
+ format: RepoMapFormatSchema,
71
+ tokenizer: z.string().optional(),
72
+ tokenBudget: z.number(),
73
+ tokensUsed: z.number(),
74
+ totalFiles: z.number(),
75
+ entries: z.array(RepoMapEntrySchema),
76
+ droppedFiles: z.number(),
77
+ droppedSymbols: z.number(),
78
+ truncated: z.boolean(),
79
+ rankIterations: z.number(),
80
+ rankConverged: z.boolean(),
81
+ focus: RepoMapFocusResultSchema.optional(),
82
+ });
83
+ const APPROX_CHARS_PER_TOKEN = 4;
84
+ const DEFAULT_COMPRESS_CHARS = 4_000;
85
+ // Focus blend: `combined = global * 0.35 + focus * 0.65`. The focus score is
86
+ // normalized against a FIXED saturation (not a per-run max) so a strong query
87
+ // hit stays high even when another file has a huge path score.
88
+ const FOCUS_SATURATION = 10;
89
+ const FOCUS_GLOBAL_WEIGHT = 0.35;
90
+ const FOCUS_RELEVANCE_WEIGHT = 0.65;
91
+ function round1(value) {
92
+ return Math.round(value * 10) / 10;
93
+ }
94
+ /** A focus is active only if it carries a non-blank query term or path. */
95
+ function isFocusActive(focus) {
96
+ if (focus == null)
97
+ return false;
98
+ if ((focus.query ?? '').trim().length > 0)
99
+ return true;
100
+ return (focus.paths ?? []).some((value) => value.trim().length > 0);
101
+ }
102
+ function symbolKey(parts) {
103
+ return [parts.type, parts.name, parts.line ?? '', parts.containerName ?? ''].join('|');
104
+ }
105
+ /** Order ranked symbols of a file: exported first, then by descending rank. */
106
+ function orderedSymbolsForFile(file, rankedByPath) {
107
+ const byKey = new Map();
108
+ for (const symbol of file.symbols) {
109
+ byKey.set(symbolKey({ type: symbol.type, name: symbol.name, line: symbol.line, containerName: symbol.containerName }), symbol);
110
+ }
111
+ const seen = new Set();
112
+ const built = [];
113
+ for (const node of rankedByPath) {
114
+ const key = symbolKey({ type: node.type, name: node.name, line: node.line, containerName: node.containerName });
115
+ const symbol = byKey.get(key);
116
+ if (!symbol || seen.has(key))
117
+ continue;
118
+ seen.add(key);
119
+ built.push({
120
+ name: symbol.name,
121
+ kind: toNormalizedSymbolKind(symbol.type, symbol.containerName),
122
+ signature: symbol.fullSignature ?? symbol.signature ?? symbol.name,
123
+ line: symbol.line,
124
+ exported: symbol.exported ?? false,
125
+ jsdoc: symbol.jsdoc,
126
+ });
127
+ }
128
+ // Stable partition: exported first, preserving the rank order within each group.
129
+ const exported = built.filter((symbol) => symbol.exported);
130
+ const rest = built.filter((symbol) => !symbol.exported);
131
+ return [...exported, ...rest];
132
+ }
133
+ /**
134
+ * Render one symbol as a readable declaration line. The stored `signature` is
135
+ * the nameless callable form (`(params) => Return`), so we re-attach the name
136
+ * and a kind keyword to produce e.g. `export function foo(a: number): void`.
137
+ */
138
+ export function repoMapSignatureLine(symbol) {
139
+ const prefix = symbol.exported ? 'export ' : '';
140
+ const sig = symbol.signature;
141
+ if (symbol.kind === 'function' || symbol.kind === 'method') {
142
+ const keyword = symbol.kind === 'method' ? '' : 'function ';
143
+ const body = sig.startsWith('(') ? `${symbol.name}${sig}` : (sig && sig !== symbol.name ? sig : `${symbol.name}()`);
144
+ return `${prefix}${keyword}${body}`;
145
+ }
146
+ const kindWord = symbol.kind === 'type' ? 'type' : symbol.kind;
147
+ if (sig && sig !== symbol.name && !sig.startsWith('(')) {
148
+ return `${prefix}${kindWord} ${symbol.name} ${sig}`;
149
+ }
150
+ return `${prefix}${kindWord} ${symbol.name}`;
151
+ }
152
+ /**
153
+ * Markdown serialization of a single entry. Shared between token measurement
154
+ * (here) and the markdown renderer in `output.ts`, so the enforced budget
155
+ * matches the emitted document exactly.
156
+ */
157
+ export function repoMapEntryToMarkdown(entry, mode) {
158
+ const lines = [`## ${entry.relativePath} (score ${entry.normalizedScore.toFixed(1)})`];
159
+ if (mode === 'pack' && entry.content != null) {
160
+ if (entry.contentReason)
161
+ lines.push(`<!-- ${entry.contentReason} -->`);
162
+ lines.push('```' + entry.language);
163
+ lines.push(entry.content);
164
+ lines.push('```');
165
+ }
166
+ else {
167
+ for (const symbol of entry.symbols)
168
+ lines.push(`- ${repoMapSignatureLine(symbol)}`);
169
+ }
170
+ return lines.join('\n');
171
+ }
172
+ function buildContentEntry(file, charBudget) {
173
+ try {
174
+ const section = extractKeySection(file, Math.max(charBudget, 200));
175
+ return { content: section.content, reason: section.reason };
176
+ }
177
+ catch {
178
+ return null;
179
+ }
180
+ }
181
+ /** Build a token-budgeted, importance-ranked repo map (or pack) from an index. */
182
+ export function buildRepoMap(index, options) {
183
+ const mode = options.mode ?? 'map';
184
+ const format = options.format ?? 'markdown';
185
+ const compress = options.compress ?? false;
186
+ const countTokens = options.countTokens ?? estimateTokenCount;
187
+ const budget = options.tokenBudget;
188
+ const ranking = rankNodes(index, options.rank);
189
+ const fileByPath = new Map();
190
+ for (const file of index.files)
191
+ fileByPath.set(file.path, file);
192
+ const rankedSymbolsByPath = new Map();
193
+ for (const node of ranking.nodes) {
194
+ if (node.type === 'file' || node.type === 'module')
195
+ continue;
196
+ const list = rankedSymbolsByPath.get(node.path);
197
+ if (list)
198
+ list.push(node);
199
+ else
200
+ rankedSymbolsByPath.set(node.path, [node]);
201
+ }
202
+ // Focus (opt-in): blend per-file relevance with the global structural rank and
203
+ // re-sort the admission order. The greedy loop below only depends on iteration
204
+ // order, so this is the entire behavioral change — budgeting is untouched.
205
+ const focus = options.focus;
206
+ let orderedFileScores = ranking.fileScores;
207
+ let focusByPath;
208
+ let focusResult;
209
+ if (isFocusActive(focus)) {
210
+ focusByPath = computeFocusScores(index, focus);
211
+ const focusScores = focusByPath;
212
+ orderedFileScores = [...ranking.fileScores]
213
+ .map((fileScore) => {
214
+ const focusNormalized = Math.min(1, (focusScores.get(fileScore.path)?.score ?? 0) / FOCUS_SATURATION);
215
+ const globalNormalized = fileScore.normalizedScore / 100;
216
+ return { fileScore, combined: globalNormalized * FOCUS_GLOBAL_WEIGHT + focusNormalized * FOCUS_RELEVANCE_WEIGHT };
217
+ })
218
+ .sort((a, b) => b.combined - a.combined)
219
+ .map((item) => item.fileScore);
220
+ focusResult = {
221
+ query: (focus.query ?? '').trim() || undefined,
222
+ paths: (focus.paths ?? []).map((value) => value.trim()).filter(Boolean),
223
+ matchedFiles: [...focusByPath.values()].filter((entry) => entry.score > 0).length,
224
+ };
225
+ }
226
+ const entries = [];
227
+ let tokensUsed = 0;
228
+ let droppedFiles = 0;
229
+ let droppedSymbols = 0;
230
+ for (const fileScore of orderedFileScores) {
231
+ const file = fileByPath.get(fileScore.path);
232
+ if (!file)
233
+ continue;
234
+ const remaining = budget - tokensUsed;
235
+ if (remaining <= 0) {
236
+ droppedFiles++;
237
+ continue;
238
+ }
239
+ let symbols = orderedSymbolsForFile(file, rankedSymbolsByPath.get(file.path) ?? []);
240
+ if (options.maxSymbolsPerFile != null && symbols.length > options.maxSymbolsPerFile) {
241
+ droppedSymbols += symbols.length - options.maxSymbolsPerFile;
242
+ symbols = symbols.slice(0, options.maxSymbolsPerFile);
243
+ }
244
+ let content;
245
+ let contentReason;
246
+ if (mode === 'pack') {
247
+ const charBudget = compress
248
+ ? Math.min(DEFAULT_COMPRESS_CHARS, remaining * APPROX_CHARS_PER_TOKEN)
249
+ : remaining * APPROX_CHARS_PER_TOKEN;
250
+ const built = buildContentEntry(file, charBudget);
251
+ if (built) {
252
+ content = built.content;
253
+ contentReason = built.reason;
254
+ }
255
+ }
256
+ // Map mode with no symbols carries no information — skip it.
257
+ if (mode === 'map' && symbols.length === 0)
258
+ continue;
259
+ if (mode === 'pack' && content == null && symbols.length === 0)
260
+ continue;
261
+ const makeEntry = (entrySymbols, entryContent) => {
262
+ const entry = {
263
+ relativePath: file.relativePath,
264
+ path: file.path,
265
+ language: file.language,
266
+ score: fileScore.score,
267
+ normalizedScore: fileScore.normalizedScore,
268
+ symbols: entrySymbols,
269
+ content: entryContent,
270
+ contentReason: entryContent != null ? contentReason : undefined,
271
+ tokens: 0,
272
+ droppedSymbols: 0,
273
+ };
274
+ // Focus metadata stays OUT of `repoMapEntryToMarkdown`, so token budgeting
275
+ // is identical whether or not a focus is active.
276
+ if (focusByPath) {
277
+ const fileFocus = focusByPath.get(file.path);
278
+ entry.focusScore = round1(Math.min(1, (fileFocus?.score ?? 0) / FOCUS_SATURATION) * 100);
279
+ if (fileFocus && fileFocus.reasons.length > 0)
280
+ entry.focusReasons = fileFocus.reasons;
281
+ }
282
+ entry.tokens = countTokens(repoMapEntryToMarkdown(entry, mode));
283
+ return entry;
284
+ };
285
+ let entry = makeEntry(symbols, content);
286
+ if (tokensUsed + entry.tokens <= budget) {
287
+ tokensUsed += entry.tokens;
288
+ entries.push(entry);
289
+ continue;
290
+ }
291
+ // Partial admission — shrink until it fits or the file must be dropped.
292
+ if (mode === 'pack' && content != null) {
293
+ const shrunkBudget = Math.max(200, Math.floor((budget - tokensUsed) * APPROX_CHARS_PER_TOKEN * 0.9));
294
+ const shrunk = buildContentEntry(file, shrunkBudget);
295
+ if (shrunk) {
296
+ content = shrunk.content;
297
+ contentReason = shrunk.reason;
298
+ entry = makeEntry(symbols, content);
299
+ }
300
+ }
301
+ else {
302
+ // map mode: drop lowest-ranked symbols from the tail until it fits.
303
+ let kept = symbols.length;
304
+ while (kept > 0) {
305
+ const trial = makeEntry(symbols.slice(0, kept));
306
+ if (tokensUsed + trial.tokens <= budget) {
307
+ entry = trial;
308
+ break;
309
+ }
310
+ kept--;
311
+ }
312
+ if (kept === 0) {
313
+ droppedFiles++;
314
+ droppedSymbols += symbols.length;
315
+ continue;
316
+ }
317
+ droppedSymbols += symbols.length - kept;
318
+ entry.droppedSymbols = symbols.length - kept;
319
+ }
320
+ if (tokensUsed + entry.tokens <= budget) {
321
+ tokensUsed += entry.tokens;
322
+ entries.push(entry);
323
+ }
324
+ else {
325
+ droppedFiles++;
326
+ droppedSymbols += entry.symbols.length;
327
+ }
328
+ }
329
+ return {
330
+ mode,
331
+ format,
332
+ tokenBudget: budget,
333
+ tokensUsed,
334
+ totalFiles: ranking.fileScores.length,
335
+ entries,
336
+ droppedFiles,
337
+ droppedSymbols,
338
+ truncated: droppedFiles > 0 || droppedSymbols > 0,
339
+ rankIterations: ranking.iterations,
340
+ rankConverged: ranking.converged,
341
+ focus: focusResult,
342
+ };
343
+ }
344
+ //# sourceMappingURL=map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.js","sourceRoot":"","sources":["../../../src/code/map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAqD,MAAM,WAAW,CAAC;AAC5G,OAAO,EAAE,kBAAkB,EAAkB,MAAM,YAAY,CAAC;AAEhE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAGhF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAGzD,mGAAmG;AACnG,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,C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MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;gBAChD,IAAI,UAAU,GAAG,KAAK,CAAC,MAAM,IAAI,MAAM,EAAE,CAAC;oBACxC,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;gBACR,CAAC;gBACD,IAAI,EAAE,CAAC;YACT,CAAC;YACD,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;gBACf,YAAY,EAAE,CAAC;gBACf,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;gBACjC,SAAS;YACX,CAAC;YACD,cAAc,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;YACxC,KAAK,CAAC,cAAc,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;QAC/C,CAAC;QAED,IAAI,UAAU,GAAG,KAAK,CAAC,MAAM,IAAI,MAAM,EAAE,CAAC;YACxC,UAAU,IAAI,KAAK,CAAC,MAAM,CAAC;YAC3B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,YAAY,EAAE,CAAC;YACf,cAAc,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QACzC,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI;QACJ,MAAM;QACN,WAAW,EAAE,MAAM;QACnB,UAAU;QACV,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;QACrC,OAAO;QACP,YAAY;QACZ,cAAc;QACd,SAAS,EAAE,YAAY,GAAG,CAAC,IAAI,cAAc,GAAG,CAAC;QACjD,cAAc,EAAE,OAAO,CAAC,UAAU;QAClC,aAAa,EAAE,OAAO,CAAC,SAAS;QAChC,KAAK,EAAE,WAAW;KACnB,CAAC;AACJ,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { CallChain, ClassTreeAnalysis, CodeCommandPayload, CodeSearchResult, ContentMatch, DependencyAnalysis, RelationMatch } from './types.js';
2
2
  import type { FusedSearchResult, ModuleCoupling } from './query.js';
3
+ import { type RepoMapResult } from './map.js';
3
4
  export declare function formatPayloadJson(payload: CodeCommandPayload): string;
4
5
  export declare function formatSearchResults(title: string, results: CodeSearchResult[], ci?: boolean): string;
5
6
  export declare function formatContentResults(results: ContentMatch[], ci?: boolean): string;
@@ -9,3 +10,7 @@ export declare function formatClassTree(result: ClassTreeAnalysis | null, ci?: b
9
10
  export declare function formatChains(chains: CallChain[], ci?: boolean): string;
10
11
  export declare function formatFusedResults(results: FusedSearchResult[], ci?: boolean): string;
11
12
  export declare function formatModuleCoupling(result: ModuleCoupling, ci?: boolean): string;
13
+ export declare function formatRepoMapMarkdown(result: RepoMapResult): string;
14
+ export declare function formatRepoMapPlain(result: RepoMapResult): string;
15
+ export declare function formatRepoMapXml(result: RepoMapResult): string;
16
+ export declare function renderRepoMap(result: RepoMapResult): string;