@colbymchenry/codegraph-darwin-x64 0.9.5 → 0.9.7
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/lib/dist/bin/codegraph.js +10 -25
- package/lib/dist/bin/codegraph.js.map +1 -1
- package/lib/dist/context/formatter.d.ts.map +1 -1
- package/lib/dist/context/formatter.js +25 -6
- package/lib/dist/context/formatter.js.map +1 -1
- package/lib/dist/context/index.d.ts.map +1 -1
- package/lib/dist/context/index.js +31 -0
- package/lib/dist/context/index.js.map +1 -1
- package/lib/dist/db/queries.d.ts +75 -0
- package/lib/dist/db/queries.d.ts.map +1 -1
- package/lib/dist/db/queries.js +213 -3
- package/lib/dist/db/queries.js.map +1 -1
- package/lib/dist/extraction/generated-detection.d.ts +30 -0
- package/lib/dist/extraction/generated-detection.d.ts.map +1 -0
- package/lib/dist/extraction/generated-detection.js +80 -0
- package/lib/dist/extraction/generated-detection.js.map +1 -0
- package/lib/dist/extraction/grammars.d.ts +1 -1
- package/lib/dist/extraction/grammars.d.ts.map +1 -1
- package/lib/dist/extraction/grammars.js +15 -0
- package/lib/dist/extraction/grammars.js.map +1 -1
- package/lib/dist/extraction/index.js +4 -4
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.js +45 -0
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
- package/lib/dist/extraction/languages/csharp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/csharp.js +2 -1
- package/lib/dist/extraction/languages/csharp.js.map +1 -1
- package/lib/dist/extraction/languages/go.d.ts.map +1 -1
- package/lib/dist/extraction/languages/go.js +12 -0
- package/lib/dist/extraction/languages/go.js.map +1 -1
- package/lib/dist/extraction/languages/java.d.ts.map +1 -1
- package/lib/dist/extraction/languages/java.js +6 -0
- package/lib/dist/extraction/languages/java.js.map +1 -1
- package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
- package/lib/dist/extraction/languages/kotlin.js +6 -0
- package/lib/dist/extraction/languages/kotlin.js.map +1 -1
- package/lib/dist/extraction/mybatis-extractor.d.ts +48 -0
- package/lib/dist/extraction/mybatis-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/mybatis-extractor.js +198 -0
- package/lib/dist/extraction/mybatis-extractor.js.map +1 -0
- package/lib/dist/extraction/tree-sitter-types.d.ts +10 -0
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.d.ts +58 -0
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.js +393 -9
- package/lib/dist/extraction/tree-sitter.js.map +1 -1
- package/lib/dist/extraction/wasm-runtime-flags.d.ts.map +1 -1
- package/lib/dist/extraction/wasm-runtime-flags.js +1 -0
- package/lib/dist/extraction/wasm-runtime-flags.js.map +1 -1
- package/lib/dist/index.d.ts +32 -1
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +49 -1
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/installer/config-writer.d.ts +7 -8
- package/lib/dist/installer/config-writer.d.ts.map +1 -1
- package/lib/dist/installer/config-writer.js +7 -27
- package/lib/dist/installer/config-writer.js.map +1 -1
- package/lib/dist/installer/index.d.ts +3 -20
- package/lib/dist/installer/index.d.ts.map +1 -1
- package/lib/dist/installer/index.js +8 -39
- package/lib/dist/installer/index.js.map +1 -1
- package/lib/dist/installer/instructions-template.d.ts +11 -21
- package/lib/dist/installer/instructions-template.d.ts.map +1 -1
- package/lib/dist/installer/instructions-template.js +12 -56
- package/lib/dist/installer/instructions-template.js.map +1 -1
- package/lib/dist/installer/targets/antigravity.d.ts +57 -0
- package/lib/dist/installer/targets/antigravity.d.ts.map +1 -0
- package/lib/dist/installer/targets/antigravity.js +308 -0
- package/lib/dist/installer/targets/antigravity.js.map +1 -0
- package/lib/dist/installer/targets/claude.d.ts +10 -1
- package/lib/dist/installer/targets/claude.d.ts.map +1 -1
- package/lib/dist/installer/targets/claude.js +25 -40
- package/lib/dist/installer/targets/claude.js.map +1 -1
- package/lib/dist/installer/targets/codex.d.ts.map +1 -1
- package/lib/dist/installer/targets/codex.js +15 -13
- package/lib/dist/installer/targets/codex.js.map +1 -1
- package/lib/dist/installer/targets/cursor.d.ts.map +1 -1
- package/lib/dist/installer/targets/cursor.js +9 -38
- package/lib/dist/installer/targets/cursor.js.map +1 -1
- package/lib/dist/installer/targets/gemini.d.ts +26 -0
- package/lib/dist/installer/targets/gemini.d.ts.map +1 -0
- package/lib/dist/installer/targets/gemini.js +167 -0
- package/lib/dist/installer/targets/gemini.js.map +1 -0
- package/lib/dist/installer/targets/hermes.d.ts.map +1 -1
- package/lib/dist/installer/targets/hermes.js +57 -3
- package/lib/dist/installer/targets/hermes.js.map +1 -1
- package/lib/dist/installer/targets/kiro.d.ts +27 -0
- package/lib/dist/installer/targets/kiro.d.ts.map +1 -0
- package/lib/dist/installer/targets/kiro.js +178 -0
- package/lib/dist/installer/targets/kiro.js.map +1 -0
- package/lib/dist/installer/targets/opencode.d.ts.map +1 -1
- package/lib/dist/installer/targets/opencode.js +15 -13
- package/lib/dist/installer/targets/opencode.js.map +1 -1
- package/lib/dist/installer/targets/registry.d.ts.map +1 -1
- package/lib/dist/installer/targets/registry.js +6 -0
- package/lib/dist/installer/targets/registry.js.map +1 -1
- package/lib/dist/installer/targets/types.d.ts +1 -16
- package/lib/dist/installer/targets/types.d.ts.map +1 -1
- package/lib/dist/mcp/engine.d.ts +6 -1
- package/lib/dist/mcp/engine.d.ts.map +1 -1
- package/lib/dist/mcp/engine.js +9 -4
- package/lib/dist/mcp/engine.js.map +1 -1
- package/lib/dist/mcp/server-instructions.d.ts +1 -1
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
- package/lib/dist/mcp/server-instructions.js +2 -0
- package/lib/dist/mcp/server-instructions.js.map +1 -1
- package/lib/dist/mcp/tools.d.ts +31 -0
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +556 -55
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.d.ts +2 -2
- package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.js +235 -29
- package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
- package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/java.js +270 -1
- package/lib/dist/resolution/frameworks/java.js.map +1 -1
- package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/nestjs.js +324 -0
- package/lib/dist/resolution/frameworks/nestjs.js.map +1 -1
- package/lib/dist/resolution/go-module.d.ts +26 -0
- package/lib/dist/resolution/go-module.d.ts.map +1 -0
- package/lib/dist/resolution/go-module.js +78 -0
- package/lib/dist/resolution/go-module.js.map +1 -0
- package/lib/dist/resolution/import-resolver.d.ts +28 -0
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
- package/lib/dist/resolution/import-resolver.js +571 -4
- package/lib/dist/resolution/import-resolver.js.map +1 -1
- package/lib/dist/resolution/index.d.ts +10 -0
- package/lib/dist/resolution/index.d.ts.map +1 -1
- package/lib/dist/resolution/index.js +117 -0
- package/lib/dist/resolution/index.js.map +1 -1
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
- package/lib/dist/resolution/name-matcher.js +212 -0
- package/lib/dist/resolution/name-matcher.js.map +1 -1
- package/lib/dist/resolution/types.d.ts +29 -0
- package/lib/dist/resolution/types.d.ts.map +1 -1
- package/lib/dist/sync/git-hooks.d.ts.map +1 -1
- package/lib/dist/sync/git-hooks.js +2 -0
- package/lib/dist/sync/git-hooks.js.map +1 -1
- package/lib/dist/sync/index.d.ts +1 -1
- package/lib/dist/sync/index.d.ts.map +1 -1
- package/lib/dist/sync/index.js +2 -1
- package/lib/dist/sync/index.js.map +1 -1
- package/lib/dist/sync/watcher.d.ts +10 -0
- package/lib/dist/sync/watcher.d.ts.map +1 -1
- package/lib/dist/sync/watcher.js +28 -4
- package/lib/dist/sync/watcher.js.map +1 -1
- package/lib/dist/sync/worktree.d.ts.map +1 -1
- package/lib/dist/sync/worktree.js +1 -0
- package/lib/dist/sync/worktree.js.map +1 -1
- package/lib/dist/types.d.ts +1 -1
- package/lib/dist/types.d.ts.map +1 -1
- package/lib/dist/types.js +2 -0
- package/lib/dist/types.js.map +1 -1
- package/lib/node_modules/.package-lock.json +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/lib/dist/installer/claude-md-template.d.ts +0 -14
- package/lib/dist/installer/claude-md-template.d.ts.map +0 -1
- package/lib/dist/installer/claude-md-template.js +0 -21
- package/lib/dist/installer/claude-md-template.js.map +0 -1
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Kiro CLI / IDE target. Writes:
|
|
4
|
+
*
|
|
5
|
+
* - MCP server entry to `~/.kiro/settings/mcp.json` (global) or
|
|
6
|
+
* `./.kiro/settings/mcp.json` (local). Standard `mcpServers.codegraph`
|
|
7
|
+
* shape, same as Claude / Cursor / Gemini.
|
|
8
|
+
* - Instructions to `~/.kiro/steering/codegraph.md` (global) or
|
|
9
|
+
* `./.kiro/steering/codegraph.md` (local). Kiro's "steering" system
|
|
10
|
+
* loads every `*.md` file in the steering dir as agent context, so
|
|
11
|
+
* a dedicated `codegraph.md` is the natural surface — we own the
|
|
12
|
+
* whole file outright (no marker-based merging needed) and delete
|
|
13
|
+
* it on uninstall.
|
|
14
|
+
*
|
|
15
|
+
* No permissions concept — Kiro gates tool invocations through its own
|
|
16
|
+
* UI prompts rather than an external allowlist. `autoAllow` is silently
|
|
17
|
+
* ignored.
|
|
18
|
+
*
|
|
19
|
+
* Paths are identical on macOS / Linux / Windows because Kiro resolves
|
|
20
|
+
* its config root from `os.homedir()` on all three (Windows `~` →
|
|
21
|
+
* `%USERPROFILE%\.kiro`).
|
|
22
|
+
*
|
|
23
|
+
* Docs: https://kiro.dev/docs/cli/mcp/
|
|
24
|
+
* https://kiro.dev/docs/cli/steering/
|
|
25
|
+
*/
|
|
26
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
27
|
+
if (k2 === undefined) k2 = k;
|
|
28
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
29
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
30
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
31
|
+
}
|
|
32
|
+
Object.defineProperty(o, k2, desc);
|
|
33
|
+
}) : (function(o, m, k, k2) {
|
|
34
|
+
if (k2 === undefined) k2 = k;
|
|
35
|
+
o[k2] = m[k];
|
|
36
|
+
}));
|
|
37
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
38
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
39
|
+
}) : function(o, v) {
|
|
40
|
+
o["default"] = v;
|
|
41
|
+
});
|
|
42
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
43
|
+
var ownKeys = function(o) {
|
|
44
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
45
|
+
var ar = [];
|
|
46
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
47
|
+
return ar;
|
|
48
|
+
};
|
|
49
|
+
return ownKeys(o);
|
|
50
|
+
};
|
|
51
|
+
return function (mod) {
|
|
52
|
+
if (mod && mod.__esModule) return mod;
|
|
53
|
+
var result = {};
|
|
54
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
55
|
+
__setModuleDefault(result, mod);
|
|
56
|
+
return result;
|
|
57
|
+
};
|
|
58
|
+
})();
|
|
59
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
+
exports.kiroTarget = void 0;
|
|
61
|
+
const fs = __importStar(require("fs"));
|
|
62
|
+
const path = __importStar(require("path"));
|
|
63
|
+
const os = __importStar(require("os"));
|
|
64
|
+
const shared_1 = require("./shared");
|
|
65
|
+
function configDir(loc) {
|
|
66
|
+
return loc === 'global'
|
|
67
|
+
? path.join(os.homedir(), '.kiro')
|
|
68
|
+
: path.join(process.cwd(), '.kiro');
|
|
69
|
+
}
|
|
70
|
+
function mcpJsonPath(loc) {
|
|
71
|
+
return path.join(configDir(loc), 'settings', 'mcp.json');
|
|
72
|
+
}
|
|
73
|
+
function steeringPath(loc) {
|
|
74
|
+
return path.join(configDir(loc), 'steering', 'codegraph.md');
|
|
75
|
+
}
|
|
76
|
+
class KiroTarget {
|
|
77
|
+
id = 'kiro';
|
|
78
|
+
displayName = 'Kiro';
|
|
79
|
+
docsUrl = 'https://kiro.dev/docs/cli/mcp/';
|
|
80
|
+
supportsLocation(_loc) {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
detect(loc) {
|
|
84
|
+
const file = mcpJsonPath(loc);
|
|
85
|
+
const config = (0, shared_1.readJsonFile)(file);
|
|
86
|
+
const alreadyConfigured = !!config.mcpServers?.codegraph;
|
|
87
|
+
const installed = loc === 'global'
|
|
88
|
+
? fs.existsSync(configDir('global')) || fs.existsSync(file)
|
|
89
|
+
: fs.existsSync(file) || fs.existsSync(configDir('local'));
|
|
90
|
+
return { installed, alreadyConfigured, configPath: file };
|
|
91
|
+
}
|
|
92
|
+
install(loc, _opts) {
|
|
93
|
+
const files = [];
|
|
94
|
+
files.push(writeMcpEntry(loc));
|
|
95
|
+
// The steering doc is no longer written — the codegraph usage
|
|
96
|
+
// guidance ships in the MCP server's `initialize` response (issue
|
|
97
|
+
// #529). Delete a `codegraph.md` a previous install created so an
|
|
98
|
+
// upgrade self-heals.
|
|
99
|
+
const steeringCleanup = removeSteeringEntry(loc);
|
|
100
|
+
if (steeringCleanup.action === 'removed')
|
|
101
|
+
files.push(steeringCleanup);
|
|
102
|
+
return {
|
|
103
|
+
files,
|
|
104
|
+
// The IDE-only enable-MCP step is load-bearing: Kiro IDE ships
|
|
105
|
+
// with MCP support disabled by default, so even a valid
|
|
106
|
+
// `~/.kiro/settings/mcp.json` at the documented path is ignored
|
|
107
|
+
// until the user flips the toggle. Kiro CLI reads the same file
|
|
108
|
+
// without a gate, so we call out which audience this applies to.
|
|
109
|
+
notes: [
|
|
110
|
+
'Restart Kiro for MCP changes to take effect.',
|
|
111
|
+
'Kiro IDE: also enable MCP in Settings (search "MCP" → "Enabled"). Kiro CLI users can skip this step.',
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
uninstall(loc) {
|
|
116
|
+
const files = [];
|
|
117
|
+
const file = mcpJsonPath(loc);
|
|
118
|
+
const config = (0, shared_1.readJsonFile)(file);
|
|
119
|
+
if (config.mcpServers?.codegraph) {
|
|
120
|
+
delete config.mcpServers.codegraph;
|
|
121
|
+
if (Object.keys(config.mcpServers).length === 0) {
|
|
122
|
+
delete config.mcpServers;
|
|
123
|
+
}
|
|
124
|
+
(0, shared_1.writeJsonFile)(file, config);
|
|
125
|
+
files.push({ path: file, action: 'removed' });
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
files.push({ path: file, action: 'not-found' });
|
|
129
|
+
}
|
|
130
|
+
files.push(removeSteeringEntry(loc));
|
|
131
|
+
return { files };
|
|
132
|
+
}
|
|
133
|
+
printConfig(loc) {
|
|
134
|
+
const target = mcpJsonPath(loc);
|
|
135
|
+
const snippet = JSON.stringify({ mcpServers: { codegraph: (0, shared_1.getMcpServerConfig)() } }, null, 2);
|
|
136
|
+
return `# Add to ${target}\n\n${snippet}\n`;
|
|
137
|
+
}
|
|
138
|
+
describePaths(loc) {
|
|
139
|
+
return [mcpJsonPath(loc), steeringPath(loc)];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function writeMcpEntry(loc) {
|
|
143
|
+
const file = mcpJsonPath(loc);
|
|
144
|
+
const dir = path.dirname(file);
|
|
145
|
+
if (!fs.existsSync(dir))
|
|
146
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
147
|
+
const existing = (0, shared_1.readJsonFile)(file);
|
|
148
|
+
const before = existing.mcpServers?.codegraph;
|
|
149
|
+
const after = (0, shared_1.getMcpServerConfig)();
|
|
150
|
+
if ((0, shared_1.jsonDeepEqual)(before, after)) {
|
|
151
|
+
return { path: file, action: 'unchanged' };
|
|
152
|
+
}
|
|
153
|
+
const action = before ? 'updated' : (fs.existsSync(file) ? 'updated' : 'created');
|
|
154
|
+
if (!existing.mcpServers)
|
|
155
|
+
existing.mcpServers = {};
|
|
156
|
+
existing.mcpServers.codegraph = after;
|
|
157
|
+
(0, shared_1.writeJsonFile)(file, existing);
|
|
158
|
+
return { path: file, action };
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Delete the steering file we own. If a user has hand-edited the file
|
|
162
|
+
* out of recognition we still remove it — codegraph.md is a name we
|
|
163
|
+
* claim, and a partial install leaving the file behind is worse than
|
|
164
|
+
* a clean delete. Used by both install (self-heal on upgrade — see
|
|
165
|
+
* issue #529) and uninstall.
|
|
166
|
+
*/
|
|
167
|
+
function removeSteeringEntry(loc) {
|
|
168
|
+
const file = steeringPath(loc);
|
|
169
|
+
if (!fs.existsSync(file))
|
|
170
|
+
return { path: file, action: 'not-found' };
|
|
171
|
+
try {
|
|
172
|
+
fs.unlinkSync(file);
|
|
173
|
+
}
|
|
174
|
+
catch { /* ignore */ }
|
|
175
|
+
return { path: file, action: 'removed' };
|
|
176
|
+
}
|
|
177
|
+
exports.kiroTarget = new KiroTarget();
|
|
178
|
+
//# sourceMappingURL=kiro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kiro.js","sourceRoot":"","sources":["../../../src/installer/targets/kiro.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;;;;;;;;;;;;;;;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AAI,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAC7C,CAAC;IACD,MAAM,MAAM,GACV,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACrE,IAAI,CAAC,QAAQ,CAAC,UAAU;QAAE,QAAQ,CAAC,UAAU,GAAG,EAAE,CAAC;IACnD,QAAQ,CAAC,UAAU,CAAC,SAAS,GAAG,KAAK,CAAC;IACtC,IAAA,sBAAa,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC9B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAChC,CAAC;AAED;;;;;;GAMG;AACH,SAAS,mBAAmB,CAAC,GAAa;IACxC,MAAM,IAAI,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IACrE,IAAI,CAAC;QAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;IACnD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAC3C,CAAC;AAEY,QAAA,UAAU,GAAgB,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/opencode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH,OAAO,EACL,WAAW,EAKZ,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/opencode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH,OAAO,EACL,WAAW,EAKZ,MAAM,SAAS,CAAC;AAwMjB,eAAO,MAAM,cAAc,EAAE,WAAkC,CAAC"}
|
|
@@ -139,7 +139,12 @@ class OpencodeTarget {
|
|
|
139
139
|
install(loc, _opts) {
|
|
140
140
|
const files = [];
|
|
141
141
|
files.push(writeMcpEntry(loc));
|
|
142
|
-
|
|
142
|
+
// AGENTS.md is no longer written — the codegraph usage guidance
|
|
143
|
+
// ships in the MCP server's `initialize` response (issue #529).
|
|
144
|
+
// Strip a block a previous install left so an upgrade self-heals.
|
|
145
|
+
const instrCleanup = removeInstructionsEntry(loc);
|
|
146
|
+
if (instrCleanup.action === 'removed')
|
|
147
|
+
files.push(instrCleanup);
|
|
143
148
|
return { files };
|
|
144
149
|
}
|
|
145
150
|
uninstall(loc) {
|
|
@@ -171,9 +176,7 @@ class OpencodeTarget {
|
|
|
171
176
|
files.push({ path: file, action: 'removed' });
|
|
172
177
|
}
|
|
173
178
|
}
|
|
174
|
-
|
|
175
|
-
const instrAction = (0, shared_1.removeMarkedSection)(instr, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
|
|
176
|
-
files.push({ path: instr, action: instrAction });
|
|
179
|
+
files.push(removeInstructionsEntry(loc));
|
|
177
180
|
return { files };
|
|
178
181
|
}
|
|
179
182
|
printConfig(loc) {
|
|
@@ -220,16 +223,15 @@ function writeMcpEntry(loc) {
|
|
|
220
223
|
(0, shared_1.atomicWriteFileSync)(file, updated);
|
|
221
224
|
return { path: file, action: existed ? 'updated' : 'created' };
|
|
222
225
|
}
|
|
223
|
-
|
|
226
|
+
/**
|
|
227
|
+
* Strip the marker-delimited CodeGraph block from AGENTS.md if a prior
|
|
228
|
+
* install wrote one. Used by both install (self-heal on upgrade) and
|
|
229
|
+
* uninstall — see issue #529.
|
|
230
|
+
*/
|
|
231
|
+
function removeInstructionsEntry(loc) {
|
|
224
232
|
const file = instructionsPath(loc);
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
228
|
-
const action = (0, shared_1.replaceOrAppendMarkedSection)(file, instructions_template_1.INSTRUCTIONS_TEMPLATE, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
|
|
229
|
-
const mapped = action === 'created' ? 'created'
|
|
230
|
-
: action === 'unchanged' ? 'unchanged'
|
|
231
|
-
: 'updated';
|
|
232
|
-
return { path: file, action: mapped };
|
|
233
|
+
const action = (0, shared_1.removeMarkedSection)(file, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
|
|
234
|
+
return { path: file, action };
|
|
233
235
|
}
|
|
234
236
|
exports.opencodeTarget = new OpencodeTarget();
|
|
235
237
|
//# sourceMappingURL=opencode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../../src/installer/targets/opencode.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,+CAAuE;AAQvE,
|
|
1
|
+
{"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../../src/installer/targets/opencode.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,+CAAuE;AAQvE,qCAIkB;AAClB,oEAGkC;AAElC,SAAS,eAAe;IACtB,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,IA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C;IAED,+DAA+D;IAC/D,4BAA4B;IAC5B,MAAM,KAAK,GAAG,IAAA,qBAAM,EAAC,IAAI,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE,KAAK,EAAE;QACtD,iBAAiB,EAAE,UAAU;KAC9B,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,IAAA,yBAAU,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACxC,IAAA,4BAAmB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAEnC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AACjE,CAAC;AAED;;;;GAIG;AACH,SAAS,uBAAuB,CAAC,GAAa;IAC5C,MAAM,IAAI,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,IAAA,4BAAmB,EAAC,IAAI,EAAE,+CAAuB,EAAE,6CAAqB,CAAC,CAAC;IACzF,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAChC,CAAC;AAEY,QAAA,cAAc,GAAgB,IAAI,cAAc,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAU1D,eAAO,MAAM,WAAW,EAAE,SAAS,WAAW,EAS5C,CAAC;AAEH,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAE7D;AAED,wBAAgB,aAAa,IAAI,QAAQ,EAAE,CAE1C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC9C,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;CAC9C,CAAC,CAKD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,WAAW,EAAE,CAyB7E"}
|
|
@@ -18,12 +18,18 @@ const cursor_1 = require("./cursor");
|
|
|
18
18
|
const codex_1 = require("./codex");
|
|
19
19
|
const opencode_1 = require("./opencode");
|
|
20
20
|
const hermes_1 = require("./hermes");
|
|
21
|
+
const gemini_1 = require("./gemini");
|
|
22
|
+
const antigravity_1 = require("./antigravity");
|
|
23
|
+
const kiro_1 = require("./kiro");
|
|
21
24
|
exports.ALL_TARGETS = Object.freeze([
|
|
22
25
|
claude_1.claudeTarget,
|
|
23
26
|
cursor_1.cursorTarget,
|
|
24
27
|
codex_1.codexTarget,
|
|
25
28
|
opencode_1.opencodeTarget,
|
|
26
29
|
hermes_1.hermesTarget,
|
|
30
|
+
gemini_1.geminiTarget,
|
|
31
|
+
antigravity_1.antigravityTarget,
|
|
32
|
+
kiro_1.kiroTarget,
|
|
27
33
|
]);
|
|
28
34
|
function getTarget(id) {
|
|
29
35
|
return exports.ALL_TARGETS.find((t) => t.id === id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/installer/targets/registry.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/installer/targets/registry.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAuBH,8BAEC;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,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;QACrE,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;QACrC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACpC,CAAC;IAED,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClE,MAAM,QAAQ,GAAkB,EAAE,CAAC;IACnC,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;QACrB,MAAM,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;QACxB,IAAI,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;YACnB,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,IAAI,KAAK,CACb,2BAA2B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,KAAK,iCAAiC,CAChG,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -17,7 +17,7 @@ export type Location = 'global' | 'local';
|
|
|
17
17
|
* lookup. New targets add a value here when they're added to the
|
|
18
18
|
* registry. Keep these short and lowercase.
|
|
19
19
|
*/
|
|
20
|
-
export type TargetId = 'claude' | 'cursor' | 'codex' | 'opencode' | 'hermes';
|
|
20
|
+
export type TargetId = 'claude' | 'cursor' | 'codex' | 'opencode' | 'hermes' | 'gemini' | 'antigravity' | 'kiro';
|
|
21
21
|
/**
|
|
22
22
|
* Result of `target.detect(location)`.
|
|
23
23
|
*
|
|
@@ -97,20 +97,5 @@ export interface AgentTarget {
|
|
|
97
97
|
printConfig(loc: Location): string;
|
|
98
98
|
/** Filesystem paths this target would write to at this location. */
|
|
99
99
|
describePaths(loc: Location): string[];
|
|
100
|
-
/**
|
|
101
|
-
* Optional. Write any project-local surfaces this target needs in
|
|
102
|
-
* order to work fully when its MCP config is configured globally.
|
|
103
|
-
* Called by `codegraph init` to bootstrap new projects without
|
|
104
|
-
* forcing the user to re-run `codegraph install` per project.
|
|
105
|
-
*
|
|
106
|
-
* Most targets need nothing here — their global config is complete.
|
|
107
|
-
* Cursor is the notable exception: its rules system
|
|
108
|
-
* (`.cursor/rules/*.mdc`) is project-scoped only, and is what makes
|
|
109
|
-
* Cursor's agent prefer codegraph over its built-in grep.
|
|
110
|
-
*
|
|
111
|
-
* Must be idempotent. Targets that have nothing project-local omit
|
|
112
|
-
* the method entirely.
|
|
113
|
-
*/
|
|
114
|
-
wireProjectSurfaces?(): WriteResult;
|
|
115
100
|
}
|
|
116
101
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE1C;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,QAAQ,GAAG,QAAQ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AAM,CAAC;IACnC,oEAAoE;IACpE,aAAa,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,EAAE,CAAC;CACxC"}
|
package/lib/dist/mcp/engine.d.ts
CHANGED
|
@@ -79,7 +79,12 @@ export declare class MCPEngine {
|
|
|
79
79
|
/**
|
|
80
80
|
* Reconcile the index with the current filesystem once, right after open —
|
|
81
81
|
* catches edits, adds, deletes, and `git pull`/`checkout` changes made while
|
|
82
|
-
* no watcher was running.
|
|
82
|
+
* no watcher was running. Runs in the background, but the returned promise
|
|
83
|
+
* is pushed into the ToolHandler as a one-shot gate so the *first* tool
|
|
84
|
+
* call awaits completion before serving (without this, a tool call that
|
|
85
|
+
* races past sync returns rows for files that no longer exist on disk —
|
|
86
|
+
* and the per-file staleness banner can't help because `getPendingFiles()`
|
|
87
|
+
* is populated by the watcher, not by catch-up).
|
|
83
88
|
*/
|
|
84
89
|
private catchUpSync;
|
|
85
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/mcp/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;GAKG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,WAAW,CAAc;IAIjC,OAAO,CAAC,WAAW,CAAuB;IAE1C,OAAO,CAAC,WAAW,CAA8B;IACjD,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,IAAI,CAA6B;IACzC,OAAO,CAAC,MAAM,CAAS;gBAEX,IAAI,GAAE,gBAAqB;IAKvC;;;;;OAKG;IACH,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAK7C,0EAA0E;IAC1E,cAAc,IAAI,MAAM,GA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B1B;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IA+CrB;;;;;;;;;OASG;IACH,OAAO,CAAC,WAAW;CAiBpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAM5E"}
|
package/lib/dist/mcp/engine.js
CHANGED
|
@@ -179,8 +179,7 @@ class MCPEngine {
|
|
|
179
179
|
this.toolHandler.setDefaultProjectHint(searchFrom);
|
|
180
180
|
const resolvedRoot = (0, index_1.findNearestCodeGraphRoot)(searchFrom);
|
|
181
181
|
if (!resolvedRoot) {
|
|
182
|
-
// No .codegraph/ above searchFrom
|
|
183
|
-
// still discover one later via roots/list.
|
|
182
|
+
// No .codegraph/ above searchFrom. Sessions may still discover one later via roots/list
|
|
184
183
|
this.projectPath = searchFrom;
|
|
185
184
|
return;
|
|
186
185
|
}
|
|
@@ -244,13 +243,18 @@ class MCPEngine {
|
|
|
244
243
|
/**
|
|
245
244
|
* Reconcile the index with the current filesystem once, right after open —
|
|
246
245
|
* catches edits, adds, deletes, and `git pull`/`checkout` changes made while
|
|
247
|
-
* no watcher was running.
|
|
246
|
+
* no watcher was running. Runs in the background, but the returned promise
|
|
247
|
+
* is pushed into the ToolHandler as a one-shot gate so the *first* tool
|
|
248
|
+
* call awaits completion before serving (without this, a tool call that
|
|
249
|
+
* races past sync returns rows for files that no longer exist on disk —
|
|
250
|
+
* and the per-file staleness banner can't help because `getPendingFiles()`
|
|
251
|
+
* is populated by the watcher, not by catch-up).
|
|
248
252
|
*/
|
|
249
253
|
catchUpSync() {
|
|
250
254
|
const cg = this.cg;
|
|
251
255
|
if (!cg)
|
|
252
256
|
return;
|
|
253
|
-
|
|
257
|
+
const p = cg
|
|
254
258
|
.sync()
|
|
255
259
|
.then((result) => {
|
|
256
260
|
const changed = result.filesAdded + result.filesModified + result.filesRemoved;
|
|
@@ -262,6 +266,7 @@ class MCPEngine {
|
|
|
262
266
|
const msg = err instanceof Error ? err.message : String(err);
|
|
263
267
|
process.stderr.write(`[CodeGraph MCP] Catch-up sync failed: ${msg}\n`);
|
|
264
268
|
});
|
|
269
|
+
this.toolHandler.setCatchUpGate(p);
|
|
265
270
|
}
|
|
266
271
|
}
|
|
267
272
|
exports.MCPEngine = MCPEngine;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/mcp/engine.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/mcp/engine.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4PH,4CAMC;AAhQD,kDAA+D;AAC/D,kCAA8C;AAC9C,mCAAsC;AAWtC;;;;;GAKG;AACH,MAAa,SAAS;IACZ,EAAE,GAAqB,IAAI,CAAC;IAC5B,WAAW,CAAc;IACjC,uEAAuE;IACvE,qEAAqE;IACrE,iEAAiE;IACzD,WAAW,GAAkB,IAAI,CAAC;IAC1C,2EAA2E;IACnE,WAAW,GAAyB,IAAI,CAAC;IACzC,cAAc,GAAG,KAAK,CAAC;IACvB,IAAI,CAA6B;IACjC,MAAM,GAAG,KAAK,CAAC;IAEvB,YAAY,OAAyB,EAAE;QACrC,IAAI,CAAC,IAAI,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;QAC1C,IAAI,CAAC,WAAW,GAAG,IAAI,mBAAW,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACH,kBAAkB,CAAC,WAAmB;QACpC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;IACtD,CAAC;IAED,0EAA0E;I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GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,yCAAyC,GAAG,IAAI,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;QACL,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;CACF;AAxND,8BAwNC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,gBAAgB,CAAC,GAAuB;IACtD,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;QAAE,OAAO,SAAS,CAAC;IAC1C,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAClE,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,KAAK;QAAE,OAAO,SAAS,CAAC;IAC3C,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
* burn tokens. Reference only tools that exist on `main`; gate any
|
|
16
16
|
* conditional tools behind feature checks if/when they ship.
|
|
17
17
|
*/
|
|
18
|
-
export declare const SERVER_INSTRUCTIONS = "# Codegraph \u2014 code intelligence over an indexed knowledge graph\n\nCodegraph is a SQLite knowledge graph of every symbol, edge, and file\nin the workspace. Reads are sub-millisecond; the index lags writes by\nabout a second through the file watcher. Consult it BEFORE writing or\nediting code, not during.\n\n## Answer directly \u2014 don't delegate exploration\n\nFor \"how does X work\", architecture, trace, or where-is-X questions,\nanswer DIRECTLY using 2-3 codegraph calls: `codegraph_context` first,\nthen ONE `codegraph_explore` for the source of the symbols it surfaces.\nCodegraph IS the pre-built search index \u2014 so delegating the lookup to a\nseparate file-reading sub-task/agent, or running your own grep + read\nloop, repeats work codegraph already did and costs more for the same\nanswer. Reach for raw Read/Grep only to confirm a specific detail\ncodegraph didn't cover. A direct codegraph answer is typically a handful\nof calls; a grep/read exploration is dozens.\n\n## Tool selection by intent\n\n- **\"What is the symbol named X?\"** \u2192 `codegraph_search`\n- **\"What's the deal with this task / feature / area?\"** \u2192 `codegraph_context` (PRIMARY \u2014 composes search + node + callers + callees in one call)\n- **\"How does X reach/become Y? / trace the flow / the path from X to Y\"** \u2192 `codegraph_trace` (ONE call returns the whole call path, including dynamic-dispatch hops \u2014 callbacks, React re-render, JSX children \u2014 that grep can't follow)\n- **\"What calls this?\"** \u2192 `codegraph_callers`\n- **\"What does this call?\"** \u2192 `codegraph_callees`\n- **\"What would changing this break?\"** \u2192 `codegraph_impact`\n- **\"Show me this symbol's source / signature / docstring.\"** \u2192 `codegraph_node`\n- **\"Show me several related symbols' source / survey an area.\"** \u2192 `codegraph_explore` (ONE capped call; prefer over many codegraph_node/Read)\n- **\"What's in directory X?\"** \u2192 `codegraph_files`\n- **\"Is the index ready / what's its size?\"** \u2192 `codegraph_status`\n\n## Common chains\n\n- **Flow / \"how does X reach Y\"**: `codegraph_trace` from\u2192to FIRST \u2014 one call returns the entire path with dynamic-dispatch hops bridged. Then ONE `codegraph_explore` for the hop bodies if you need them. Do NOT reconstruct the path with `codegraph_search` + `codegraph_callers` \u2014 that's exactly what trace does in a single call.\n- **Onboarding**: `codegraph_context` first. If still unclear, `codegraph_explore` for breadth, then `codegraph_node` on specific symbols.\n- **Refactor planning**: `codegraph_search` \u2192 `codegraph_callers` \u2192 `codegraph_impact`. The blast-radius answer comes from impact, not from walking callers manually.\n- **Debugging a regression**: `codegraph_callers` of the suspected symbol; widen with `codegraph_impact` if an unexpected call appears.\n\n## Anti-patterns\n\n- **Don't grep first** when looking up a symbol by name \u2014 `codegraph_search` is faster and returns kind + location + signature.\n- **Don't chain `codegraph_search` + `codegraph_node`** when you just want context \u2014 `codegraph_context` is one round-trip.\n- **Don't loop `codegraph_node` over many symbols** \u2014 one `codegraph_explore` call returns them all grouped by file, while each separate call re-reads the whole context and costs far more. Use `codegraph_node` for a single symbol.\n- **After editing, check the staleness banner.** When a tool response starts with \"\u26A0\uFE0F Some files referenced below were edited since the last index sync\u2026\", the listed files are pending re-index \u2014 Read those specific files for accurate content. Every file NOT in that banner is fresh, so still trust codegraph. `codegraph_status` also lists pending files under \"Pending sync\".\n\n## Limitations\n\n- Index lags file writes by ~1 second.\n- Cross-file resolution is best-effort name matching; ambiguous calls may return multiple candidates.\n- No live correctness validation \u2014 that's still the TypeScript compiler / test suite / linter's job. Codegraph supplements those with structural context they don't have.\n";
|
|
18
|
+
export declare const SERVER_INSTRUCTIONS = "# Codegraph \u2014 code intelligence over an indexed knowledge graph\n\nCodegraph is a SQLite knowledge graph of every symbol, edge, and file\nin the workspace. Reads are sub-millisecond; the index lags writes by\nabout a second through the file watcher. Consult it BEFORE writing or\nediting code, not during.\n\n## Answer directly \u2014 don't delegate exploration\n\nFor \"how does X work\", architecture, trace, or where-is-X questions,\nanswer DIRECTLY using 2-3 codegraph calls: `codegraph_context` first,\nthen ONE `codegraph_explore` for the source of the symbols it surfaces.\nCodegraph IS the pre-built search index \u2014 so delegating the lookup to a\nseparate file-reading sub-task/agent, or running your own grep + read\nloop, repeats work codegraph already did and costs more for the same\nanswer. Reach for raw Read/Grep only to confirm a specific detail\ncodegraph didn't cover. A direct codegraph answer is typically a handful\nof calls; a grep/read exploration is dozens.\n\n## Tool selection by intent\n\n- **\"What is the symbol named X?\"** \u2192 `codegraph_search`\n- **\"What's the deal with this task / feature / area?\"** \u2192 `codegraph_context` (PRIMARY \u2014 composes search + node + callers + callees in one call)\n- **\"How does X reach/become Y? / trace the flow / the path from X to Y\"** \u2192 `codegraph_trace` (ONE call returns the whole call path, including dynamic-dispatch hops \u2014 callbacks, React re-render, JSX children \u2014 that grep can't follow)\n- **\"What calls this?\"** \u2192 `codegraph_callers`\n- **\"What does this call?\"** \u2192 `codegraph_callees`\n- **\"What would changing this break?\"** \u2192 `codegraph_impact`\n- **\"Show me this symbol's source / signature / docstring.\"** \u2192 `codegraph_node`\n- **\"Show me several related symbols' source / survey an area.\"** \u2192 `codegraph_explore` (ONE capped call; prefer over many codegraph_node/Read)\n- **\"What's in directory X?\"** \u2192 `codegraph_files`\n- **\"Is the index ready / what's its size?\"** \u2192 `codegraph_status`\n\n## Common chains\n\n- **Flow / \"how does X reach Y\"**: `codegraph_trace` from\u2192to FIRST \u2014 one call returns the entire path with dynamic-dispatch hops bridged. Then ONE `codegraph_explore` for the hop bodies if you need them. Do NOT reconstruct the path with `codegraph_search` + `codegraph_callers` \u2014 that's exactly what trace does in a single call.\n- **Onboarding**: `codegraph_context` first. If still unclear, `codegraph_explore` for breadth, then `codegraph_node` on specific symbols.\n- **Refactor planning**: `codegraph_search` \u2192 `codegraph_callers` \u2192 `codegraph_impact`. The blast-radius answer comes from impact, not from walking callers manually.\n- **Debugging a regression**: `codegraph_callers` of the suspected symbol; widen with `codegraph_impact` if an unexpected call appears.\n\n## Anti-patterns\n\n- **Trust codegraph's results \u2014 don't re-verify them with grep.** They come from a full AST parse; re-checking with grep is slower, less accurate, and wastes context.\n- **Don't grep first** when looking up a symbol by name \u2014 `codegraph_search` is faster and returns kind + location + signature.\n- **Don't chain `codegraph_search` + `codegraph_node`** when you just want context \u2014 `codegraph_context` is one round-trip.\n- **Don't loop `codegraph_node` over many symbols** \u2014 one `codegraph_explore` call returns them all grouped by file, while each separate call re-reads the whole context and costs far more. Use `codegraph_node` for a single symbol.\n- **After editing, check the staleness banner.** When a tool response starts with \"\u26A0\uFE0F Some files referenced below were edited since the last index sync\u2026\", the listed files are pending re-index \u2014 Read those specific files for accurate content. Every file NOT in that banner is fresh, so still trust codegraph. `codegraph_status` also lists pending files under \"Pending sync\".\n\n## Limitations\n\n- If a tool reports the project isn't initialized, `.codegraph/` doesn't exist yet \u2014 offer to run `codegraph init -i` to build the index.\n- Index lags file writes by ~1 second.\n- Cross-file resolution is best-effort name matching; ambiguous calls may return multiple candidates.\n- No live correctness validation \u2014 that's still the TypeScript compiler / test suite / linter's job. Codegraph supplements those with structural context they don't have.\n";
|
|
19
19
|
//# sourceMappingURL=server-instructions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB,m3IAqD/B,CAAC"}
|
|
@@ -59,6 +59,7 @@ of calls; a grep/read exploration is dozens.
|
|
|
59
59
|
|
|
60
60
|
## Anti-patterns
|
|
61
61
|
|
|
62
|
+
- **Trust codegraph's results — don't re-verify them with grep.** They come from a full AST parse; re-checking with grep is slower, less accurate, and wastes context.
|
|
62
63
|
- **Don't grep first** when looking up a symbol by name — \`codegraph_search\` is faster and returns kind + location + signature.
|
|
63
64
|
- **Don't chain \`codegraph_search\` + \`codegraph_node\`** when you just want context — \`codegraph_context\` is one round-trip.
|
|
64
65
|
- **Don't loop \`codegraph_node\` over many symbols** — one \`codegraph_explore\` call returns them all grouped by file, while each separate call re-reads the whole context and costs far more. Use \`codegraph_node\` for a single symbol.
|
|
@@ -66,6 +67,7 @@ of calls; a grep/read exploration is dozens.
|
|
|
66
67
|
|
|
67
68
|
## Limitations
|
|
68
69
|
|
|
70
|
+
- If a tool reports the project isn't initialized, \`.codegraph/\` doesn't exist yet — offer to run \`codegraph init -i\` to build the index.
|
|
69
71
|
- Index lags file writes by ~1 second.
|
|
70
72
|
- Cross-file resolution is best-effort name matching; ambiguous calls may return multiple candidates.
|
|
71
73
|
- No live correctness validation — that's still the TypeScript compiler / test suite / linter's job. Codegraph supplements those with structural context they don't have.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,mBAAmB,GAAG
|
|
1
|
+
{"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDlC,CAAC"}
|
package/lib/dist/mcp/tools.d.ts
CHANGED
|
@@ -50,6 +50,15 @@ export interface ExploreOutputBudget {
|
|
|
50
50
|
includeCompletenessSignal: boolean;
|
|
51
51
|
/** Include the explore-budget reminder at the end. */
|
|
52
52
|
includeBudgetNote: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Hard-drop test/spec/icon/i18n files from the relevant-file set unless
|
|
55
|
+
* the query itself mentions tests. Today they're only deprioritized in
|
|
56
|
+
* the sort, which on tiny repos still lets one slip into the top N (e.g.
|
|
57
|
+
* cobra's `command_test.go` displaced `args.go` and contributed ~10KB of
|
|
58
|
+
* pure noise to "How does cobra parse commands?"). Off by default; on
|
|
59
|
+
* for the very-tiny tier where one slip dominates the budget.
|
|
60
|
+
*/
|
|
61
|
+
excludeLowValueFiles: boolean;
|
|
53
62
|
}
|
|
54
63
|
export declare function getExploreOutputBudget(fileCount: number): ExploreOutputBudget;
|
|
55
64
|
/**
|
|
@@ -113,11 +122,20 @@ export declare class ToolHandler {
|
|
|
113
122
|
private projectCache;
|
|
114
123
|
private defaultProjectHint;
|
|
115
124
|
private worktreeMismatchCache;
|
|
125
|
+
private catchUpGate;
|
|
116
126
|
constructor(cg: CodeGraph | null);
|
|
117
127
|
/**
|
|
118
128
|
* Update the default CodeGraph instance (e.g. after lazy initialization)
|
|
119
129
|
*/
|
|
120
130
|
setDefaultCodeGraph(cg: CodeGraph): void;
|
|
131
|
+
/**
|
|
132
|
+
* Engine-only: register the catch-up sync promise so the next `execute()`
|
|
133
|
+
* call awaits it before serving. The handler swallows rejections (the
|
|
134
|
+
* engine logs them) so a sync failure never propagates as a tool error;
|
|
135
|
+
* we still want to serve a best-effort result over the same potentially-
|
|
136
|
+
* stale data, which is what would have happened without the gate.
|
|
137
|
+
*/
|
|
138
|
+
setCatchUpGate(p: Promise<void> | null): void;
|
|
121
139
|
/**
|
|
122
140
|
* Record the directory the server tried to resolve the default project from.
|
|
123
141
|
* Used only to make the "no default project" error actionable.
|
|
@@ -219,6 +237,19 @@ export declare class ToolHandler {
|
|
|
219
237
|
* Handle codegraph_context
|
|
220
238
|
*/
|
|
221
239
|
private handleContext;
|
|
240
|
+
/**
|
|
241
|
+
* Detect a flow-style task ("how does X reach Y", "trace the path from A to B")
|
|
242
|
+
* and pre-run trace between the most likely endpoints, returning the trace
|
|
243
|
+
* body to splice into the context response. Returns '' for non-flow queries
|
|
244
|
+
* or when no plausible endpoint pair can be extracted.
|
|
245
|
+
*
|
|
246
|
+
* Conservative by design: only fires when the task has both a clear flow
|
|
247
|
+
* keyword AND at least two distinct PascalCase / camelCase identifiers.
|
|
248
|
+
* False positives waste a graph query; false negatives just fall back to
|
|
249
|
+
* the agent calling trace itself (existing path-proximity wiring handles
|
|
250
|
+
* disambiguation either way).
|
|
251
|
+
*/
|
|
252
|
+
private maybeInlineFlowTrace;
|
|
222
253
|
/**
|
|
223
254
|
* Heuristic to detect if a query looks like a feature request
|
|
224
255
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,SAAuC,MAAM,UAAU,CAAC;AAO/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":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