@kenkaiiii/ggcoder 5.86.2 → 5.87.0

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.
Files changed (96) hide show
  1. package/README.md +23 -31
  2. package/assets/skills/bulletproof/SKILL.md +2 -0
  3. package/assets/skills/compliance-guard/SKILL.md +1 -1
  4. package/assets/skills/lean/SKILL.md +2 -0
  5. package/dist/app-sidecar/progress-manager.d.ts +2 -20
  6. package/dist/app-sidecar/progress-manager.js +2 -15
  7. package/dist/app-sidecar/progress-manager.js.map +1 -1
  8. package/dist/app-sidecar/royale.d.ts +26 -24
  9. package/dist/app-sidecar/royale.js +85 -187
  10. package/dist/app-sidecar/royale.js.map +1 -1
  11. package/dist/app-sidecar.js +32 -40
  12. package/dist/app-sidecar.js.map +1 -1
  13. package/dist/core/autopilot-gate.js +2 -3
  14. package/dist/core/autopilot-gate.js.map +1 -1
  15. package/dist/core/bundled-agents.js +7 -27
  16. package/dist/core/bundled-agents.js.map +1 -1
  17. package/dist/core/checklist-items.d.ts +0 -8
  18. package/dist/core/checklist-items.js +0 -8
  19. package/dist/core/checklist-items.js.map +1 -1
  20. package/dist/core/code-retrieval.d.ts +1 -1
  21. package/dist/core/code-retrieval.js +2 -2
  22. package/dist/core/code-retrieval.js.map +1 -1
  23. package/dist/core/mcp/deferred-catalog.d.ts +1 -1
  24. package/dist/core/mcp/deferred-catalog.js +1 -1
  25. package/dist/core/skills.d.ts +6 -0
  26. package/dist/core/skills.js +11 -3
  27. package/dist/core/skills.js.map +1 -1
  28. package/dist/core/subagent-policy.d.ts +6 -0
  29. package/dist/core/subagent-policy.js +21 -2
  30. package/dist/core/subagent-policy.js.map +1 -1
  31. package/dist/core/subagent-receipt.d.ts +2 -2
  32. package/dist/core/subagent-receipt.js +5 -8
  33. package/dist/core/subagent-receipt.js.map +1 -1
  34. package/dist/core/threat-feed.js +10 -4
  35. package/dist/core/threat-feed.js.map +1 -1
  36. package/dist/core/trophies/catalog-more.js +0 -20
  37. package/dist/core/trophies/catalog-more.js.map +1 -1
  38. package/dist/core/trophies/engine.js +0 -4
  39. package/dist/core/trophies/engine.js.map +1 -1
  40. package/dist/core/trophies/types.d.ts +1 -1
  41. package/dist/core/trophies/types.js +0 -2
  42. package/dist/core/trophies/types.js.map +1 -1
  43. package/dist/goals-agent/goal-team.js +3 -4
  44. package/dist/goals-agent/goal-team.js.map +1 -1
  45. package/dist/modes/acp-mode.js +0 -1
  46. package/dist/modes/acp-mode.js.map +1 -1
  47. package/dist/tools/index.d.ts +0 -2
  48. package/dist/tools/index.js +0 -6
  49. package/dist/tools/index.js.map +1 -1
  50. package/dist/tools/operations.js +1 -1
  51. package/dist/tools/operations.js.map +1 -1
  52. package/dist/tools/prompt-hints.js +0 -6
  53. package/dist/tools/prompt-hints.js.map +1 -1
  54. package/dist/tools/skill.js +11 -5
  55. package/dist/tools/skill.js.map +1 -1
  56. package/dist/tools/tool-tiers.d.ts +2 -1
  57. package/dist/tools/tool-tiers.js +2 -3
  58. package/dist/tools/tool-tiers.js.map +1 -1
  59. package/dist/ui/components/SkillsOverlay.js +2 -1
  60. package/dist/ui/components/SkillsOverlay.js.map +1 -1
  61. package/package.json +6 -5
  62. package/assets/skills/clarify/SKILL.md +0 -39
  63. package/assets/skills/code-review/SKILL.md +0 -82
  64. package/assets/skills/code-review/references/agent-diffs.md +0 -27
  65. package/assets/skills/code-review/references/tests.md +0 -19
  66. package/assets/skills/evidence-led-ui/LICENSES.md +0 -79
  67. package/assets/skills/evidence-led-ui/SKILL.md +0 -95
  68. package/assets/skills/evidence-led-ui/references/anti-defaults.md +0 -110
  69. package/assets/skills/evidence-led-ui/references/archetypes.md +0 -97
  70. package/assets/skills/evidence-led-ui/references/craft-rulings.md +0 -242
  71. package/assets/skills/evidence-led-ui/references/direction.md +0 -116
  72. package/assets/skills/evidence-led-ui/references/methodology.md +0 -64
  73. package/assets/skills/evidence-led-ui/references/observed-patterns.md +0 -68
  74. package/assets/skills/evidence-led-ui/references/production-contract.md +0 -148
  75. package/assets/skills/evidence-led-ui/references/provenance.md +0 -142
  76. package/assets/skills/evidence-led-ui/references/quality-rubric.md +0 -126
  77. package/assets/skills/evidence-led-ui/references/ui-libraries.md +0 -30
  78. package/assets/skills/refactoring/SKILL.md +0 -72
  79. package/assets/skills/refactoring/references/agent-pitfalls.md +0 -46
  80. package/assets/skills/refactoring/references/legacy.md +0 -70
  81. package/assets/skills/refactoring/references/smells.md +0 -71
  82. package/assets/skills/root-cause/SKILL.md +0 -46
  83. package/assets/skills/shared-language/SKILL.md +0 -32
  84. package/assets/skills/tdd/SKILL.md +0 -42
  85. package/dist/app-sidecar/royale-bug.d.ts +0 -19
  86. package/dist/app-sidecar/royale-bug.js +0 -112
  87. package/dist/app-sidecar/royale-bug.js.map +0 -1
  88. package/dist/app-sidecar/royale-deploy.d.ts +0 -5
  89. package/dist/app-sidecar/royale-deploy.js +0 -76
  90. package/dist/app-sidecar/royale-deploy.js.map +0 -1
  91. package/dist/tools/code-nav.d.ts +0 -29
  92. package/dist/tools/code-nav.js +0 -299
  93. package/dist/tools/code-nav.js.map +0 -1
  94. package/dist/tools/search-code.d.ts +0 -10
  95. package/dist/tools/search-code.js +0 -90
  96. package/dist/tools/search-code.js.map +0 -1
@@ -1,299 +0,0 @@
1
- import path from "node:path";
2
- import { fileURLToPath } from "node:url";
3
- import { z } from "zod";
4
- import { resolvePath, toPosixPath } from "./path-utils.js";
5
- import { localOperations } from "./operations.js";
6
- const CodeNavParams = z.object({
7
- op: z
8
- .enum(["definition", "references", "symbols", "hover"])
9
- .describe("symbols = file outline; hover = type/signature"),
10
- file: z.string(),
11
- line: z.number().int().min(1).optional().describe("Not needed when `symbol` is given"),
12
- column: z.number().int().min(1).optional(),
13
- symbol: z.string().optional().describe("Symbol name"),
14
- max_results: z.number().int().min(1).optional().describe("Default 60"),
15
- });
16
- const DEFAULT_MAX_RESULTS = 60;
17
- const MAX_SNIPPET_LENGTH = 160;
18
- const MAX_HOVER_LENGTH = 1200;
19
- /**
20
- * LSP SymbolKind, for the outline. Numbers are the wire values; the names are
21
- * what a reader of the tool output actually wants to see.
22
- */
23
- const SYMBOL_KIND_NAMES = {
24
- 1: "file",
25
- 2: "module",
26
- 3: "namespace",
27
- 4: "package",
28
- 5: "class",
29
- 6: "method",
30
- 7: "property",
31
- 8: "field",
32
- 9: "constructor",
33
- 10: "enum",
34
- 11: "interface",
35
- 12: "function",
36
- 13: "variable",
37
- 14: "constant",
38
- 15: "string",
39
- 16: "number",
40
- 17: "boolean",
41
- 18: "array",
42
- 19: "object",
43
- 20: "key",
44
- 21: "null",
45
- 22: "enum-member",
46
- 23: "struct",
47
- 24: "event",
48
- 25: "operator",
49
- 26: "type-parameter",
50
- };
51
- /**
52
- * Semantic code navigation, backed by the project's language server.
53
- *
54
- * One tool with an `op` enum rather than four tools: each tool in the live set
55
- * costs a full JSON schema on every request, and four near-identical schemas
56
- * would spend the budget this harness is trying to save.
57
- *
58
- * Rename is deliberately absent. A workspace-wide rename that half-applies is
59
- * worse than no rename at all, and nothing here can roll one back.
60
- */
61
- export function createCodeNavTool(cwd, lspManager, ops = localOperations) {
62
- return {
63
- name: "code_nav",
64
- description: "Language server: exact definition, references (callers), file outline, type.",
65
- parameters: CodeNavParams,
66
- async execute({ op, file, line, column, symbol, max_results }) {
67
- if (!lspManager) {
68
- return "code_nav is unavailable: language-server support is disabled for this session. Use grep or code_search instead.";
69
- }
70
- const maxResults = max_results ?? DEFAULT_MAX_RESULTS;
71
- const absolute = resolvePath(cwd, file);
72
- let content;
73
- try {
74
- content = await ops.readFile(absolute);
75
- }
76
- catch (error) {
77
- return `Cannot read ${toPosixPath(path.relative(cwd, absolute))}: ${error instanceof Error ? error.message : String(error)}`;
78
- }
79
- const lines = content.split("\n");
80
- if (op === "symbols") {
81
- const outcome = await lspManager.documentSymbols(absolute, content);
82
- if (outcome.kind !== "ok")
83
- return describeFailure(outcome, cwd, op);
84
- return formatSymbols(outcome.value, symbol, maxResults);
85
- }
86
- const position = resolvePosition(lines, line, column, symbol);
87
- if (typeof position === "string")
88
- return position;
89
- if (op === "hover") {
90
- const outcome = await lspManager.hover(absolute, content, position);
91
- if (outcome.kind !== "ok")
92
- return describeFailure(outcome, cwd, op);
93
- const text = outcome.value.trim();
94
- if (!text)
95
- return `No hover information at ${describeSite(cwd, absolute, position)}.`;
96
- return text.length > MAX_HOVER_LENGTH
97
- ? `${text.slice(0, MAX_HOVER_LENGTH)}\n… [hover truncated]`
98
- : text;
99
- }
100
- const outcome = op === "definition"
101
- ? await lspManager.definition(absolute, content, position)
102
- : await lspManager.references(absolute, content, position);
103
- if (outcome.kind !== "ok")
104
- return describeFailure(outcome, cwd, op);
105
- const locations = await formatLocations(outcome.value, cwd, ops, maxResults, op, absolute, position);
106
- return outcome.warning ? `${outcome.warning}\n\n${locations}` : locations;
107
- },
108
- };
109
- }
110
- /**
111
- * Turn a 1-based line (+ optional column or symbol name) into an LSP position.
112
- * Returning a string means the request cannot be built at all, which is a
113
- * clearer answer than sending the server a position that resolves to nothing.
114
- */
115
- /**
116
- * First line where `symbol` appears as a whole word, preferring real code.
117
- *
118
- * Comment lines are skipped: a doc comment mentioning the name carries no
119
- * resolvable symbol, so the server answers nothing there and the caller would
120
- * read that empty reply as "no references". A comment-only hit is still
121
- * returned as a last resort, which beats claiming the name is absent.
122
- */
123
- function findSymbolLine(lines, symbol) {
124
- const word = new RegExp(`\\b${symbol.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\b`);
125
- let commentHit;
126
- for (let i = 0; i < lines.length; i++) {
127
- if (!word.test(lines[i]))
128
- continue;
129
- const trimmed = lines[i].trim();
130
- if (/^(\/\/|\/\*|\*|#)/.test(trimmed)) {
131
- commentHit ??= i + 1;
132
- continue;
133
- }
134
- return i + 1;
135
- }
136
- return commentHit;
137
- }
138
- function resolvePosition(lines, line, column, symbol) {
139
- if (line === undefined) {
140
- // You almost always know the NAME and not the line. Requiring both forced a
141
- // grep round-trip before every single call, so `symbol` alone is enough:
142
- // any occurrence resolves, since the server walks from a reference to its
143
- // declaration anyway.
144
- if (!symbol) {
145
- return 'Pass `symbol` (its name) or `line` (1-based) so I know what to resolve. op: "symbols" needs neither.';
146
- }
147
- const found = findSymbolLine(lines, symbol);
148
- if (found === undefined) {
149
- return `\`${symbol}\` does not appear in this file. Check the name, or pass \`line\` directly.`;
150
- }
151
- line = found;
152
- }
153
- if (line > lines.length) {
154
- return `Line ${line} is past the end of the file (${lines.length} lines).`;
155
- }
156
- const text = lines[line - 1] ?? "";
157
- if (column !== undefined)
158
- return { line: line - 1, character: column - 1 };
159
- if (symbol) {
160
- const index = text.indexOf(symbol);
161
- if (index === -1) {
162
- return `\`${symbol}\` does not appear on line ${line}. Pass \`column\`, or the line where it does appear.`;
163
- }
164
- return { line: line - 1, character: index };
165
- }
166
- // No column and no name: aim at the first non-whitespace character, which is
167
- // the identifier far more often than column 1 is.
168
- const firstNonSpace = text.search(/\S/);
169
- return { line: line - 1, character: firstNonSpace === -1 ? 0 : firstNonSpace };
170
- }
171
- function describeSite(cwd, absolute, position) {
172
- return `${toPosixPath(path.relative(cwd, absolute))}:${position.line + 1}:${position.character + 1}`;
173
- }
174
- /**
175
- * Render a non-`ok` outcome as an instruction, not an absence. "No references
176
- * found" and "no language server installed" are opposite facts, and conflating
177
- * them makes the model confidently delete live code.
178
- */
179
- function describeFailure(outcome, cwd, op) {
180
- const rel = toPosixPath(path.relative(cwd, outcome.filePath)) || outcome.filePath;
181
- switch (outcome.kind) {
182
- case "unsupported":
183
- return outcome.serverId
184
- ? `The ${outcome.serverId} language server does not implement \`${op}\`. Fall back to code_search or grep.`
185
- : `No language server is configured for ${rel}. Fall back to code_search or grep.`;
186
- case "unavailable":
187
- return `No language server is installed for ${rel}${outcome.serverId ? ` (expected: ${outcome.serverId})` : ""}. Install it to enable code_nav, or fall back to code_search or grep.`;
188
- case "timeout":
189
- return `The language server did not answer \`${op}\` for ${rel} in time. It may still be indexing — retry once, then fall back to grep.`;
190
- default:
191
- return `The language server failed on \`${op}\` for ${rel}${outcome.message ? `: ${outcome.message}` : ""}. Fall back to code_search or grep.`;
192
- }
193
- }
194
- /**
195
- * Ancestor kinds that make a nested symbol part of a file's STRUCTURE rather
196
- * than an implementation detail: a method inside a class belongs in an outline,
197
- * a `const` inside a function body does not.
198
- */
199
- const STRUCTURAL_CONTAINER_KINDS = new Set([
200
- 1, // file
201
- 2, // module
202
- 3, // namespace
203
- 4, // package
204
- 5, // class
205
- 10, // enum
206
- 11, // interface
207
- 23, // struct
208
- ]);
209
- /**
210
- * Is this symbol part of the file's outline, or noise from inside a body?
211
- *
212
- * Language servers return the FULL symbol tree, so an unfiltered outline buries
213
- * the eight declarations you wanted under every loop counter, local `const` and
214
- * nested object-literal key in the file. Measured on a real 300-line source
215
- * file: 89 symbols, with the truncation limit reached before the last real
216
- * function was ever printed — the outline actively hid what it exists to show.
217
- *
218
- * A symbol survives only when every ancestor is structural. Servers that send
219
- * flat `SymbolInformation` report no ancestor kinds at all; those pass through,
220
- * since that shape is already a top-level list.
221
- */
222
- function isOutlineSymbol(entry) {
223
- return entry.containerKinds.every((kind) => STRUCTURAL_CONTAINER_KINDS.has(kind));
224
- }
225
- function formatSymbols(symbols, filter, maxResults) {
226
- // Document order, not server order. An outline is read against the file, but
227
- // tsserver groups its reply by name, so line numbers arrived scrambled
228
- // (22, 63, 51, 78…) and the outline could not be followed top to bottom.
229
- const outline = symbols
230
- .filter(isOutlineSymbol)
231
- .slice()
232
- .sort((a, b) => a.range.start.line - b.range.start.line ||
233
- a.range.start.character - b.range.start.character);
234
- const matched = filter
235
- ? outline.filter((s) => s.name.toLowerCase().includes(filter.toLowerCase()))
236
- : outline;
237
- if (matched.length === 0) {
238
- return filter ? `No symbol matching \`${filter}\` in this file.` : "No symbols in this file.";
239
- }
240
- const shown = matched.slice(0, maxResults);
241
- const lines = shown.map((entry) => {
242
- const qualified = [...entry.containers, entry.name].join(".");
243
- const kind = SYMBOL_KIND_NAMES[entry.kind] ?? "symbol";
244
- const detail = entry.detail ? ` ${entry.detail}` : "";
245
- return `${entry.range.start.line + 1}:${entry.range.start.character + 1} — ${kind} ${qualified}${detail}`;
246
- });
247
- if (matched.length > shown.length) {
248
- lines.push(`… ${matched.length - shown.length} more symbol(s) not shown`);
249
- }
250
- return lines.join("\n");
251
- }
252
- async function formatLocations(locations, cwd, ops, maxResults, op, originFile, position) {
253
- if (locations.length === 0) {
254
- return op === "definition"
255
- ? `No definition found for the symbol at ${describeSite(cwd, originFile, position)}.`
256
- : `No references found for the symbol at ${describeSite(cwd, originFile, position)}.`;
257
- }
258
- const shown = locations.slice(0, maxResults);
259
- // One read per distinct file, not per location: a hot symbol produces many
260
- // hits in the same file and re-reading it per hit is the whole cost.
261
- const sourceCache = new Map();
262
- const lines = [];
263
- for (const location of shown) {
264
- const absolute = fileFromUri(location.uri);
265
- const rel = toPosixPath(path.relative(cwd, absolute)) || absolute;
266
- let source = sourceCache.get(absolute);
267
- if (source === undefined) {
268
- try {
269
- source = (await ops.readFile(absolute)).split("\n");
270
- }
271
- catch {
272
- source = null;
273
- }
274
- sourceCache.set(absolute, source);
275
- }
276
- const snippetRaw = source?.[location.range.start.line]?.trim() ?? "";
277
- const snippet = snippetRaw.length > MAX_SNIPPET_LENGTH
278
- ? `${snippetRaw.slice(0, MAX_SNIPPET_LENGTH)}…`
279
- : snippetRaw;
280
- const site = `${rel}:${location.range.start.line + 1}:${location.range.start.character + 1}`;
281
- lines.push(snippet ? `${site} — ${snippet}` : site);
282
- }
283
- if (locations.length > shown.length) {
284
- lines.push(`… ${locations.length - shown.length} more result(s) not shown — raise max_results to see them`);
285
- }
286
- return lines.join("\n");
287
- }
288
- /** `file://` URI → filesystem path, tolerating servers that send a bare path. */
289
- function fileFromUri(uri) {
290
- if (!uri.startsWith("file://"))
291
- return uri;
292
- try {
293
- return fileURLToPath(uri);
294
- }
295
- catch {
296
- return decodeURIComponent(uri.replace(/^file:\/\//, ""));
297
- }
298
- }
299
- //# s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E,IAAI,EAAE,IAAI,EAAE,CAAC;QACrE,MAAM,OAAO,GACX,UAAU,CAAC,MAAM,GAAG,kBAAkB;YACpC,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,GAAG;YAC/C,CAAC,CAAC,UAAU,CAAC;QACjB,MAAM,IAAI,GAAG,GAAG,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,EAAE,CAAC;QAC7F,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,MAAM,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,SAAS,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QACpC,KAAK,CAAC,IAAI,CACR,KAAK,SAAS,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,2DAA2D,CAChG,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,iFAAiF;AACjF,SAAS,WAAW,CAAC,GAAW;IAC9B,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,GAAG,CAAC;IAC3C,IAAI,CAAC;QACH,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
@@ -1,10 +0,0 @@
1
- import { z } from "zod";
2
- import type { AgentTool } from "@kenkaiiii/gg-agent";
3
- import { type ToolOperations } from "./operations.js";
4
- declare const SearchCodeParams: z.ZodObject<{
5
- query: z.ZodString;
6
- path: z.ZodOptional<z.ZodString>;
7
- max_results: z.ZodOptional<z.ZodNumber>;
8
- }, z.core.$strip>;
9
- export declare function createSearchCodeTool(cwd: string, ops?: ToolOperations): AgentTool<typeof SearchCodeParams>;
10
- export {};
@@ -1,90 +0,0 @@
1
- import fs from "node:fs/promises";
2
- import path from "node:path";
3
- import { z } from "zod";
4
- import { resolvePath, toPosixPath } from "./path-utils.js";
5
- import { truncateTail } from "./truncate.js";
6
- import { localOperations } from "./operations.js";
7
- import { chunkFile, bm25Rank, CHUNKABLE_EXTENSIONS } from "../core/code-retrieval.js";
8
- const SearchCodeParams = z.object({
9
- query: z.string(),
10
- path: z.string().optional(),
11
- max_results: z.number().int().min(1).optional().describe("Default 8"),
12
- });
13
- const DEFAULT_MAX_RESULTS = 8;
14
- /** Every language with a symbol chunker; anything else has no symbols to rank. */
15
- const SOURCE_GLOB = `**/*.{${CHUNKABLE_EXTENSIONS.join(",")}}`;
16
- const MAX_CANDIDATE_FILES = 5000;
17
- export function createSearchCodeTool(cwd, ops = localOperations) {
18
- return {
19
- name: "code_search",
20
- description: "Find functions/classes by what they do; returns whole symbols.",
21
- parameters: SearchCodeParams,
22
- async execute({ query, path: searchPath, max_results }) {
23
- const dir = searchPath ? resolvePath(cwd, searchPath) : cwd;
24
- const maxResults = max_results ?? DEFAULT_MAX_RESULTS;
25
- const fg = await import("fast-glob");
26
- const ignore = await import("ignore");
27
- const ig = ignore.default();
28
- ig.add(await loadGitignore(dir));
29
- const entries = await fg.default(SOURCE_GLOB, {
30
- cwd: dir,
31
- dot: false,
32
- onlyFiles: true,
33
- ignore: ["**/node_modules/**", "**/.git/**"],
34
- suppressErrors: true,
35
- followSymbolicLinks: false,
36
- });
37
- const files = entries.filter((entry) => !ig.ignores(entry)).slice(0, MAX_CANDIDATE_FILES);
38
- if (files.length === 0) {
39
- return "No indexable source files here. code_search covers TypeScript/JavaScript, Python, Go, Rust, Java and C# — use grep for other languages.";
40
- }
41
- const chunks = [];
42
- for (const entry of files) {
43
- const abs = path.join(dir, entry);
44
- let source;
45
- try {
46
- source = await ops.readFile(abs);
47
- }
48
- catch {
49
- continue; // unreadable file — skip
50
- }
51
- // cwd-relative so headers are stable regardless of `path` scope, and
52
- // forward-slashed so the `file:line → symbol` headers the model reads
53
- // (and echoes back into read/edit calls) are identical on every OS.
54
- const rel = toPosixPath(path.relative(cwd, abs));
55
- for (const chunk of chunkFile(rel, source))
56
- chunks.push(chunk);
57
- }
58
- if (chunks.length === 0) {
59
- return `No top-level symbols found in ${files.length} TS/JS file(s) under ${toPosixPath(path.relative(cwd, dir)) || "."}.`;
60
- }
61
- const ranked = bm25Rank(query, chunks, maxResults);
62
- if (ranked.length === 0) {
63
- return `No matching symbols found for "${query}".`;
64
- }
65
- const body = ranked
66
- .map((c) => `// ${c.file}:${c.startLine} → ${c.symbol}\n${c.text}`)
67
- .join("\n\n");
68
- const result = truncateTail(body);
69
- if (result.truncated) {
70
- return (`${result.content}\n\n` +
71
- `[Truncated: showing ${result.keptLines} of ${result.totalLines} lines. ` +
72
- `Lower max_results or refine the query for fewer chunks.]`);
73
- }
74
- return body;
75
- },
76
- };
77
- }
78
- async function loadGitignore(dir) {
79
- try {
80
- const content = await fs.readFile(path.join(dir, ".gitignore"), "utf-8");
81
- return content
82
- .split("\n")
83
- .map((l) => l.trim())
84
- .filter((l) => l && !l.startsWith("#"));
85
- }
86
- catch {
87
- return [];
88
- }
89
- }
90
- //# sourceMappingURL=search-code.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-code.js","sourceRoot":"","sources":["../../src/tools/search-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EA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