@coreyuan/vector-mind 1.0.48 → 1.0.52
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/README.md +146 -394
- package/dist/activity-log.d.ts +19 -0
- package/dist/activity-log.js +106 -0
- package/dist/activity-log.js.map +1 -0
- package/dist/builtin-conventions.d.ts +2 -1
- package/dist/builtin-conventions.js +7 -2
- package/dist/builtin-conventions.js.map +1 -1
- package/dist/builtin-instructions.d.ts +1 -1
- package/dist/builtin-instructions.js +1 -1
- package/dist/builtin-instructions.js.map +1 -1
- package/dist/config.d.ts +28 -0
- package/dist/config.js +189 -0
- package/dist/config.js.map +1 -0
- package/dist/database-runtime.d.ts +54 -0
- package/dist/database-runtime.js +512 -0
- package/dist/database-runtime.js.map +1 -0
- package/dist/development-warnings.d.ts +93 -0
- package/dist/development-warnings.js +589 -0
- package/dist/development-warnings.js.map +1 -0
- package/dist/file-indexing.d.ts +22 -0
- package/dist/file-indexing.js +243 -0
- package/dist/file-indexing.js.map +1 -0
- package/dist/grep.d.ts +64 -0
- package/dist/grep.js +475 -0
- package/dist/grep.js.map +1 -0
- package/dist/index.js +167 -6884
- package/dist/index.js.map +1 -1
- package/dist/large-file-split.d.ts +29 -0
- package/dist/large-file-split.js +146 -0
- package/dist/large-file-split.js.map +1 -0
- package/dist/memory-maintenance.d.ts +80 -0
- package/dist/memory-maintenance.js +537 -0
- package/dist/memory-maintenance.js.map +1 -0
- package/dist/memory-mutations.d.ts +23 -0
- package/dist/memory-mutations.js +83 -0
- package/dist/memory-mutations.js.map +1 -0
- package/dist/memory-recall.d.ts +93 -0
- package/dist/memory-recall.js +796 -0
- package/dist/memory-recall.js.map +1 -0
- package/dist/path-filters.d.ts +1 -0
- package/dist/path-filters.js +27 -0
- package/dist/path-filters.js.map +1 -0
- package/dist/path-rules.d.ts +12 -0
- package/dist/path-rules.js +208 -0
- package/dist/path-rules.js.map +1 -0
- package/dist/pending-changes.d.ts +22 -0
- package/dist/pending-changes.js +166 -0
- package/dist/pending-changes.js.map +1 -0
- package/dist/project-files.d.ts +66 -0
- package/dist/project-files.js +215 -0
- package/dist/project-files.js.map +1 -0
- package/dist/root.d.ts +15 -0
- package/dist/root.js +191 -0
- package/dist/root.js.map +1 -0
- package/dist/rtk-tools.d.ts +20 -0
- package/dist/rtk-tools.js +318 -0
- package/dist/rtk-tools.js.map +1 -0
- package/dist/server-instructions.d.ts +1 -0
- package/dist/server-instructions.js +88 -0
- package/dist/server-instructions.js.map +1 -0
- package/dist/symbols.d.ts +2 -0
- package/dist/symbols.js +159 -0
- package/dist/symbols.js.map +1 -0
- package/dist/token-savings.d.ts +40 -0
- package/dist/token-savings.js +50 -0
- package/dist/token-savings.js.map +1 -0
- package/dist/tool-catalog.d.ts +18 -0
- package/dist/tool-catalog.js +243 -0
- package/dist/tool-catalog.js.map +1 -0
- package/dist/tool-handlers/context-recovery.d.ts +6 -0
- package/dist/tool-handlers/context-recovery.js +319 -0
- package/dist/tool-handlers/context-recovery.js.map +1 -0
- package/dist/tool-handlers/context.d.ts +34 -0
- package/dist/tool-handlers/context.js +2 -0
- package/dist/tool-handlers/context.js.map +1 -0
- package/dist/tool-handlers/diagnostics.d.ts +8 -0
- package/dist/tool-handlers/diagnostics.js +114 -0
- package/dist/tool-handlers/diagnostics.js.map +1 -0
- package/dist/tool-handlers/files.d.ts +8 -0
- package/dist/tool-handlers/files.js +493 -0
- package/dist/tool-handlers/files.js.map +1 -0
- package/dist/tool-handlers/large-files.d.ts +4 -0
- package/dist/tool-handlers/large-files.js +139 -0
- package/dist/tool-handlers/large-files.js.map +1 -0
- package/dist/tool-handlers/maintenance.d.ts +4 -0
- package/dist/tool-handlers/maintenance.js +160 -0
- package/dist/tool-handlers/maintenance.js.map +1 -0
- package/dist/tool-handlers/memory-diagnostics.d.ts +5 -0
- package/dist/tool-handlers/memory-diagnostics.js +509 -0
- package/dist/tool-handlers/memory-diagnostics.js.map +1 -0
- package/dist/tool-handlers/memory.d.ts +6 -0
- package/dist/tool-handlers/memory.js +334 -0
- package/dist/tool-handlers/memory.js.map +1 -0
- package/dist/tool-handlers/notes-decisions.d.ts +7 -0
- package/dist/tool-handlers/notes-decisions.js +169 -0
- package/dist/tool-handlers/notes-decisions.js.map +1 -0
- package/dist/tool-handlers/requirements.d.ts +7 -0
- package/dist/tool-handlers/requirements.js +357 -0
- package/dist/tool-handlers/requirements.js.map +1 -0
- package/dist/tool-handlers.d.ts +4 -0
- package/dist/tool-handlers.js +105 -0
- package/dist/tool-handlers.js.map +1 -0
- package/dist/tool-output.d.ts +213 -0
- package/dist/tool-output.js +278 -0
- package/dist/tool-output.js.map +1 -0
- package/dist/tool-schemas.d.ts +434 -0
- package/dist/tool-schemas.js +328 -0
- package/dist/tool-schemas.js.map +1 -0
- package/dist/types.d.ts +61 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/docs/capability-matrix.md +43 -0
- package/package.json +11 -10
- package/skills/vector-mind-autopilot/SKILL.md +149 -0
- package/skills/vector-mind-autopilot/references/claude-desktop-mcp-config.json +9 -0
- package/skills/vector-mind-autopilot/references/claude-project-instructions.md +47 -0
- package/skills/vector-mind-autopilot/references/universal-system-prompt.md +78 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
function oneLine(input, max = 120) {
|
|
6
|
+
const normalized = String(input ?? "").replace(/\s+/g, " ").trim();
|
|
7
|
+
if (normalized.length <= max)
|
|
8
|
+
return normalized;
|
|
9
|
+
return `${normalized.slice(0, Math.max(0, max - 1))}…`;
|
|
10
|
+
}
|
|
11
|
+
function shellQuoteArg(arg) {
|
|
12
|
+
if (/^[A-Za-z0-9_./:@%+=,-]+$/.test(arg))
|
|
13
|
+
return arg;
|
|
14
|
+
if (process.platform === "win32")
|
|
15
|
+
return `"${arg.replace(/"/g, '\\"')}"`;
|
|
16
|
+
return `'${arg.replace(/'/g, "'\\''")}'`;
|
|
17
|
+
}
|
|
18
|
+
function getPackageRtkShimPath() {
|
|
19
|
+
try {
|
|
20
|
+
const currentDir = path.dirname(fileURLToPath(import.meta.url));
|
|
21
|
+
const candidate = path.join(currentDir, "rtk-shim.js");
|
|
22
|
+
if (fs.existsSync(candidate))
|
|
23
|
+
return candidate;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
// import.meta.url may be unavailable only in unexpected runtimes.
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
function runRtkProbe(spec) {
|
|
31
|
+
const argsPrefix = spec.execArgsPrefix ?? [];
|
|
32
|
+
const env = { ...process.env, VECTORMIND_RTK_NO_AUTO_INSTALL: "1", ...(spec.execEnv ?? {}) };
|
|
33
|
+
const result = spawnSync(spec.execCommand, [...argsPrefix, "--version"], {
|
|
34
|
+
encoding: "utf8",
|
|
35
|
+
timeout: 120_000,
|
|
36
|
+
windowsHide: true,
|
|
37
|
+
shell: spec.execShell ?? false,
|
|
38
|
+
env,
|
|
39
|
+
});
|
|
40
|
+
if (result.status === 0) {
|
|
41
|
+
const gain = spawnSync(spec.execCommand, [...argsPrefix, "gain"], {
|
|
42
|
+
encoding: "utf8",
|
|
43
|
+
timeout: 120_000,
|
|
44
|
+
windowsHide: true,
|
|
45
|
+
shell: spec.execShell ?? false,
|
|
46
|
+
env,
|
|
47
|
+
});
|
|
48
|
+
let resolvedPath = spec.path;
|
|
49
|
+
if (spec.source === "path") {
|
|
50
|
+
const whereCommand = process.platform === "win32" ? "where.exe" : "which";
|
|
51
|
+
const whereResult = spawnSync(whereCommand, ["rtk"], {
|
|
52
|
+
encoding: "utf8",
|
|
53
|
+
timeout: 2000,
|
|
54
|
+
windowsHide: true,
|
|
55
|
+
});
|
|
56
|
+
resolvedPath = whereResult.status === 0 ? oneLine(whereResult.stdout, 240) : resolvedPath;
|
|
57
|
+
}
|
|
58
|
+
const gainText = `${gain.stdout}${gain.stderr}`.trim();
|
|
59
|
+
return {
|
|
60
|
+
available: gain.status === 0,
|
|
61
|
+
command: spec.displayCommand,
|
|
62
|
+
version: `${result.stdout}${result.stderr}`.trim(),
|
|
63
|
+
gain_ok: gain.status === 0,
|
|
64
|
+
gain_preview: oneLine(gainText, 240),
|
|
65
|
+
path: resolvedPath,
|
|
66
|
+
source: spec.source,
|
|
67
|
+
exec_command: spec.execCommand,
|
|
68
|
+
exec_args_prefix: argsPrefix,
|
|
69
|
+
exec_shell: spec.execShell ?? false,
|
|
70
|
+
note: gain.status === 0
|
|
71
|
+
? spec.source === "package_shim"
|
|
72
|
+
? `Prefer prefixing shell commands with ${spec.displayCommand} for compact outputs. This is VectorMind's bundled RTK shim; first run auto-installs/caches rtk-ai/rtk if needed.`
|
|
73
|
+
: "Prefer prefixing shell commands with rtk for compact outputs, e.g. rtk git status / rtk npm run build / rtk rg pattern ."
|
|
74
|
+
: spec.source === "package_shim"
|
|
75
|
+
? "VectorMind's bundled RTK shim exists, but `gain` failed. Check npm/cache or set VECTORMIND_RTK_REAL to an existing rtk-ai/rtk binary."
|
|
76
|
+
: "An rtk binary exists, but `rtk gain` failed. This may be the wrong rtk project. Use install_rtk with uninstall_wrong_cargo_rtk=true only when you intentionally want to replace it.",
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
export function detectRtk() {
|
|
82
|
+
const pathProbe = runRtkProbe({
|
|
83
|
+
source: "path",
|
|
84
|
+
displayCommand: "rtk",
|
|
85
|
+
execCommand: "rtk",
|
|
86
|
+
execShell: process.platform === "win32",
|
|
87
|
+
});
|
|
88
|
+
if (pathProbe?.available)
|
|
89
|
+
return pathProbe;
|
|
90
|
+
const shimPath = getPackageRtkShimPath();
|
|
91
|
+
if (shimPath) {
|
|
92
|
+
const displayCommand = `node ${shellQuoteArg(shimPath)}`;
|
|
93
|
+
const shimProbe = runRtkProbe({
|
|
94
|
+
source: "package_shim",
|
|
95
|
+
displayCommand,
|
|
96
|
+
execCommand: process.execPath,
|
|
97
|
+
execArgsPrefix: [shimPath],
|
|
98
|
+
execEnv: { VECTORMIND_RTK_NO_AUTO_INSTALL: "1" },
|
|
99
|
+
path: shimPath,
|
|
100
|
+
});
|
|
101
|
+
if (shimProbe)
|
|
102
|
+
return shimProbe;
|
|
103
|
+
}
|
|
104
|
+
if (pathProbe)
|
|
105
|
+
return pathProbe;
|
|
106
|
+
return {
|
|
107
|
+
available: false,
|
|
108
|
+
command: shimPath ? `node ${shellQuoteArg(shimPath)}` : "rtk",
|
|
109
|
+
path: shimPath ?? undefined,
|
|
110
|
+
source: shimPath ? "package_shim" : undefined,
|
|
111
|
+
note: shimPath
|
|
112
|
+
? "rtk was not found on PATH, and VectorMind's bundled RTK shim could not verify rtk gain without auto-installing. VectorMind compact MCP output still works; use install_rtk(dry_run=false) explicitly or set VECTORMIND_RTK_REAL."
|
|
113
|
+
: "rtk was not found on PATH and the package RTK shim is unavailable. VectorMind compact MCP output still works; install rtk explicitly to compact shell command output too.",
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function commandExists(command) {
|
|
117
|
+
const probe = process.platform === "win32" ? "where.exe" : "which";
|
|
118
|
+
const result = spawnSync(probe, [command], { encoding: "utf8", timeout: 2000, windowsHide: true });
|
|
119
|
+
return result.status === 0;
|
|
120
|
+
}
|
|
121
|
+
function runInstallStep(command, args, timeoutMs) {
|
|
122
|
+
const result = spawnSync(command, args, {
|
|
123
|
+
encoding: "utf8",
|
|
124
|
+
timeout: timeoutMs,
|
|
125
|
+
windowsHide: true,
|
|
126
|
+
shell: false,
|
|
127
|
+
});
|
|
128
|
+
const output = `${result.stdout ?? ""}${result.stderr ?? ""}`.trim();
|
|
129
|
+
return {
|
|
130
|
+
command: [command, ...args].join(" "),
|
|
131
|
+
status: result.status,
|
|
132
|
+
ok: result.status === 0,
|
|
133
|
+
output: oneLine(output, 1200),
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function runDetectedRtkStep(detected, args, timeoutMs) {
|
|
137
|
+
const execCommand = detected.exec_command ?? "rtk";
|
|
138
|
+
const argsPrefix = detected.exec_args_prefix ?? [];
|
|
139
|
+
const result = spawnSync(execCommand, [...argsPrefix, ...args], {
|
|
140
|
+
encoding: "utf8",
|
|
141
|
+
timeout: timeoutMs,
|
|
142
|
+
windowsHide: true,
|
|
143
|
+
shell: detected.exec_shell ?? (execCommand === "rtk" && process.platform === "win32"),
|
|
144
|
+
});
|
|
145
|
+
const output = `${result.stdout ?? ""}${result.stderr ?? ""}`.trim();
|
|
146
|
+
return {
|
|
147
|
+
command: [detected.command, ...args].join(" "),
|
|
148
|
+
status: result.status,
|
|
149
|
+
ok: result.status === 0,
|
|
150
|
+
output: oneLine(output, 1200),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function appendRtkInitStep(steps, detected, init, timeoutMs) {
|
|
154
|
+
if (init === "none")
|
|
155
|
+
return;
|
|
156
|
+
if (init === "global_no_patch")
|
|
157
|
+
steps.push(runDetectedRtkStep(detected, ["init", "-g", "--no-patch"], timeoutMs));
|
|
158
|
+
if (init === "global_auto_patch")
|
|
159
|
+
steps.push(runDetectedRtkStep(detected, ["init", "-g", "--auto-patch"], timeoutMs));
|
|
160
|
+
if (init === "global_hook_only") {
|
|
161
|
+
steps.push(runDetectedRtkStep(detected, ["init", "-g", "--hook-only", "--no-patch"], timeoutMs));
|
|
162
|
+
}
|
|
163
|
+
if (init === "local")
|
|
164
|
+
steps.push(runDetectedRtkStep(detected, ["init"], timeoutMs));
|
|
165
|
+
if (init === "codex_global")
|
|
166
|
+
steps.push(runDetectedRtkStep(detected, ["init", "-g", "--codex"], timeoutMs));
|
|
167
|
+
if (init === "codex_local")
|
|
168
|
+
steps.push(runDetectedRtkStep(detected, ["init", "--codex"], timeoutMs));
|
|
169
|
+
}
|
|
170
|
+
function chooseRtkInstallMethod(method) {
|
|
171
|
+
if (method !== "auto")
|
|
172
|
+
return method;
|
|
173
|
+
if (process.platform === "darwin" && commandExists("brew"))
|
|
174
|
+
return "brew";
|
|
175
|
+
if (commandExists("cargo"))
|
|
176
|
+
return "cargo";
|
|
177
|
+
return "shell_script";
|
|
178
|
+
}
|
|
179
|
+
function buildRtkInstallPlan(args) {
|
|
180
|
+
const method = chooseRtkInstallMethod(args.method);
|
|
181
|
+
const commands = [];
|
|
182
|
+
const notes = [];
|
|
183
|
+
if (args.uninstall_wrong_cargo_rtk) {
|
|
184
|
+
commands.push("cargo uninstall rtk");
|
|
185
|
+
notes.push("Only use uninstall_wrong_cargo_rtk after verifying the existing rtk is the wrong Cargo package.");
|
|
186
|
+
}
|
|
187
|
+
if (method === "brew") {
|
|
188
|
+
commands.push("brew install rtk");
|
|
189
|
+
}
|
|
190
|
+
else if (method === "cargo") {
|
|
191
|
+
commands.push("cargo install --git https://github.com/rtk-ai/rtk");
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
if (process.platform === "win32") {
|
|
195
|
+
notes.push("shell_script install is Linux/macOS-oriented; on Windows prefer method=cargo after installing Rust/Cargo.");
|
|
196
|
+
commands.push("cargo install --git https://github.com/rtk-ai/rtk");
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
commands.push("curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/master/install.sh | sh");
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
commands.push("rtk --version");
|
|
203
|
+
commands.push("rtk gain");
|
|
204
|
+
if (args.init === "global_no_patch")
|
|
205
|
+
commands.push("rtk init -g --no-patch");
|
|
206
|
+
if (args.init === "global_auto_patch")
|
|
207
|
+
commands.push("rtk init -g --auto-patch");
|
|
208
|
+
if (args.init === "global_hook_only")
|
|
209
|
+
commands.push("rtk init -g --hook-only --no-patch");
|
|
210
|
+
if (args.init === "local")
|
|
211
|
+
commands.push("rtk init");
|
|
212
|
+
if (args.init === "codex_global")
|
|
213
|
+
commands.push("rtk init -g --codex");
|
|
214
|
+
if (args.init === "codex_local")
|
|
215
|
+
commands.push("rtk init --codex");
|
|
216
|
+
if (args.init !== "none") {
|
|
217
|
+
notes.push("rtk init may modify Claude/RTK configuration. Use init=none for binary-only installation.");
|
|
218
|
+
}
|
|
219
|
+
return { method, commands, notes };
|
|
220
|
+
}
|
|
221
|
+
export function installRtk(args) {
|
|
222
|
+
const detectedBefore = detectRtk();
|
|
223
|
+
const plan = buildRtkInstallPlan(args);
|
|
224
|
+
const steps = [];
|
|
225
|
+
const notes = [...plan.notes];
|
|
226
|
+
if (detectedBefore.available) {
|
|
227
|
+
notes.push("rtk is already installed and verified with `rtk gain`; installation skipped.");
|
|
228
|
+
if (!args.dry_run && args.init !== "none") {
|
|
229
|
+
appendRtkInitStep(steps, detectedBefore, args.init, args.timeout_ms);
|
|
230
|
+
}
|
|
231
|
+
return {
|
|
232
|
+
ok: true,
|
|
233
|
+
dry_run: args.dry_run,
|
|
234
|
+
already_available: true,
|
|
235
|
+
method: plan.method,
|
|
236
|
+
commands: plan.commands,
|
|
237
|
+
notes,
|
|
238
|
+
steps,
|
|
239
|
+
detected_before: detectedBefore,
|
|
240
|
+
detected_after: detectedBefore,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
if (args.dry_run) {
|
|
244
|
+
notes.push("dry_run=true: no command was executed. Call install_rtk with dry_run=false to install.");
|
|
245
|
+
return {
|
|
246
|
+
ok: true,
|
|
247
|
+
dry_run: true,
|
|
248
|
+
already_available: false,
|
|
249
|
+
method: plan.method,
|
|
250
|
+
commands: plan.commands,
|
|
251
|
+
notes,
|
|
252
|
+
steps,
|
|
253
|
+
detected_before: detectedBefore,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
if (plan.method === "brew") {
|
|
257
|
+
steps.push(runInstallStep("brew", ["install", "rtk"], args.timeout_ms));
|
|
258
|
+
}
|
|
259
|
+
else if (plan.method === "cargo") {
|
|
260
|
+
if (args.uninstall_wrong_cargo_rtk) {
|
|
261
|
+
steps.push(runInstallStep("cargo", ["uninstall", "rtk"], args.timeout_ms));
|
|
262
|
+
}
|
|
263
|
+
steps.push(runInstallStep("cargo", ["install", "--git", "https://github.com/rtk-ai/rtk"], args.timeout_ms));
|
|
264
|
+
}
|
|
265
|
+
else if (process.platform === "win32") {
|
|
266
|
+
notes.push("Windows fallback uses Cargo because the upstream shell installer targets POSIX shells.");
|
|
267
|
+
if (args.uninstall_wrong_cargo_rtk) {
|
|
268
|
+
steps.push(runInstallStep("cargo", ["uninstall", "rtk"], args.timeout_ms));
|
|
269
|
+
}
|
|
270
|
+
steps.push(runInstallStep("cargo", ["install", "--git", "https://github.com/rtk-ai/rtk"], args.timeout_ms));
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
const script = "curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/master/install.sh | sh";
|
|
274
|
+
steps.push(runInstallStep("sh", ["-c", script], args.timeout_ms));
|
|
275
|
+
}
|
|
276
|
+
const detectedAfterInstall = detectRtk();
|
|
277
|
+
if (detectedAfterInstall.available && args.init !== "none") {
|
|
278
|
+
appendRtkInitStep(steps, detectedAfterInstall, args.init, args.timeout_ms);
|
|
279
|
+
}
|
|
280
|
+
const detectedAfter = detectRtk();
|
|
281
|
+
return {
|
|
282
|
+
ok: detectedAfter.available,
|
|
283
|
+
dry_run: false,
|
|
284
|
+
already_available: false,
|
|
285
|
+
method: plan.method,
|
|
286
|
+
commands: plan.commands,
|
|
287
|
+
notes,
|
|
288
|
+
steps,
|
|
289
|
+
detected_before: detectedBefore,
|
|
290
|
+
detected_after: detectedAfter,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
export function compactInstallRtkText(data) {
|
|
294
|
+
const lines = [];
|
|
295
|
+
lines.push(`install_rtk ok=${data.ok} dry_run=${data.dry_run} already_available=${data.already_available} method=${data.method}`);
|
|
296
|
+
lines.push(`before available=${data.detected_before.available} version=${data.detected_before.version ?? "none"} gain_ok=${data.detected_before.gain_ok ?? false}`);
|
|
297
|
+
if (data.detected_after) {
|
|
298
|
+
lines.push(`after available=${data.detected_after.available} version=${data.detected_after.version ?? "none"} gain_ok=${data.detected_after.gain_ok ?? false}`);
|
|
299
|
+
}
|
|
300
|
+
if (data.commands.length) {
|
|
301
|
+
lines.push("commands:");
|
|
302
|
+
for (const command of data.commands)
|
|
303
|
+
lines.push(`- ${command}`);
|
|
304
|
+
}
|
|
305
|
+
if (data.steps.length) {
|
|
306
|
+
lines.push("steps:");
|
|
307
|
+
for (const step of data.steps) {
|
|
308
|
+
lines.push(`- ${step.ok ? "ok" : "fail"} [${step.status ?? "null"}] ${step.command}: ${oneLine(step.output, 240)}`);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
if (data.notes.length) {
|
|
312
|
+
lines.push("notes:");
|
|
313
|
+
for (const note of data.notes)
|
|
314
|
+
lines.push(`- ${note}`);
|
|
315
|
+
}
|
|
316
|
+
return lines.join("\n");
|
|
317
|
+
}
|
|
318
|
+
//# sourceMappingURL=rtk-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rtk-tools.js","sourceRoot":"","sources":["../src/rtk-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAKzC,SAAS,OAAO,CAAC,KAAgC,EAAE,GAAG,GAAG,GAAG;IAC1D,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACnE,IAAI,UAAU,CAAC,MAAM,IAAI,GAAG;QAAE,OAAO,UAAU,CAAC;IAChD,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CA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string;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { BUILTIN_ARCHITECTURE_AND_CODE_ORGANIZATION_INSTRUCTIONS, BUILTIN_DESTRUCTIVE_OPERATION_GUARD_INSTRUCTIONS, BUILTIN_FRONTEND_OUTPUT_PURITY_INSTRUCTIONS, BUILTIN_GIT_COMMIT_SUMMARY_INSTRUCTIONS, BUILTIN_LOW_OVERHEAD_WORKFLOW_INSTRUCTIONS, BUILTIN_PAYLOAD_GUARD_INSTRUCTIONS, BUILTIN_PLAN_LITE_INSTRUCTIONS, BUILTIN_REQUIREMENT_BOUNDARY_AND_MODULARITY_INSTRUCTIONS, BUILTIN_THREAD_HANDOFF_SWITCH_INSTRUCTIONS, BUILTIN_WRITE_POLICY_INSTRUCTIONS, } from "./builtin-instructions.js";
|
|
2
|
+
export function buildServerInstructions() {
|
|
3
|
+
return [
|
|
4
|
+
"VectorMind MCP is available in this session. Use it to avoid guessing project context.",
|
|
5
|
+
"Development guideline scope: VectorMind instructions define development conventions, project-memory conventions, code-organization conventions, and delivery-quality expectations.",
|
|
6
|
+
"VectorMind autonomy floor: tool outputs are contextual evidence and quality signals only; they must not reduce the model's reasoning, decision-making, creativity, or implementation ability. If context is incomplete or conflicts with directly observed repository facts, inspect further and use model judgment.",
|
|
7
|
+
"Project root resolution order: tool argument project_root (recommended for clients without roots/list), then VECTORMIND_ROOT (avoid hardcoding in global config), then MCP roots/list (best-effort; falls back quickly if unsupported), then process.cwd() (so start your MCP client in the project directory for per-project isolation).",
|
|
8
|
+
"If root_source is fallback, file watching/indexing is disabled (pass project_root to enable per-project tracking).",
|
|
9
|
+
"",
|
|
10
|
+
"Built-in write-operation quality policy:",
|
|
11
|
+
BUILTIN_WRITE_POLICY_INSTRUCTIONS,
|
|
12
|
+
"",
|
|
13
|
+
"Built-in task-list / Plan-Lite quality policy:",
|
|
14
|
+
BUILTIN_PLAN_LITE_INSTRUCTIONS,
|
|
15
|
+
"",
|
|
16
|
+
"Built-in destructive-operation quality guard:",
|
|
17
|
+
BUILTIN_DESTRUCTIVE_OPERATION_GUARD_INSTRUCTIONS,
|
|
18
|
+
"",
|
|
19
|
+
"Built-in architecture and code-organization quality policy:",
|
|
20
|
+
BUILTIN_ARCHITECTURE_AND_CODE_ORGANIZATION_INSTRUCTIONS,
|
|
21
|
+
"",
|
|
22
|
+
"Built-in requirement boundary and modularity quality policy:",
|
|
23
|
+
BUILTIN_REQUIREMENT_BOUNDARY_AND_MODULARITY_INSTRUCTIONS,
|
|
24
|
+
"",
|
|
25
|
+
"Built-in frontend output-purity quality policy:",
|
|
26
|
+
BUILTIN_FRONTEND_OUTPUT_PURITY_INSTRUCTIONS,
|
|
27
|
+
"",
|
|
28
|
+
"Built-in git commit summary quality policy:",
|
|
29
|
+
BUILTIN_GIT_COMMIT_SUMMARY_INSTRUCTIONS,
|
|
30
|
+
"",
|
|
31
|
+
"Built-in low-overhead execution and heavy-thread quality policy:",
|
|
32
|
+
BUILTIN_LOW_OVERHEAD_WORKFLOW_INSTRUCTIONS,
|
|
33
|
+
"",
|
|
34
|
+
"Built-in payload / oversized-thread quality guard:",
|
|
35
|
+
BUILTIN_PAYLOAD_GUARD_INSTRUCTIONS,
|
|
36
|
+
"",
|
|
37
|
+
"Built-in thread handoff / switch-gate quality policy:",
|
|
38
|
+
BUILTIN_THREAD_HANDOFF_SWITCH_INSTRUCTIONS,
|
|
39
|
+
"",
|
|
40
|
+
"Required VectorMind call chain for development work:",
|
|
41
|
+
"- Start/resume: call bootstrap_context with project_root and a short query unless the task is purely execution-first and all targets are already known.",
|
|
42
|
+
"- Before edits: call start_requirement for the current user request, then call preflight_change_scope with the planned files/modules before changing files.",
|
|
43
|
+
"- During edits: if preflight_change_scope says safe_to_edit=false, narrow the plan first. If it returns huge_file_modularization_required, use plan_large_file_split, mechanical_modularization, and record_large_file_split before normal feature work.",
|
|
44
|
+
"- After edits: call get_pending_changes, then sync_change_intent with what changed and why.",
|
|
45
|
+
"- Newer decision wins: when the user changes/reverses a rule, call upsert_decision and supersede_memory/upsert_decision supersedes fields so old memories do not override the current rule.",
|
|
46
|
+
"- Milestone/end: update project summary or add durable notes/conventions, and complete_requirement when the requirement is done.",
|
|
47
|
+
"",
|
|
48
|
+
"VectorMind workflow:",
|
|
49
|
+
"- Tool outputs are compact by default. Pass format=json only when you need full structured data.",
|
|
50
|
+
"- On every new conversation/session for analysis/design/development work: call bootstrap_context({ project_root, query: <current goal> }) first (or at least get_brain_dump({ project_root })) to restore compact context and retrieve relevant matches from the local memory store (FTS/token/LIKE).",
|
|
51
|
+
" - Output is compact by default. Use include_content=true only when you truly need full text (it increases tokens).",
|
|
52
|
+
" - bootstrap_context/get_brain_dump always include a small recency anchor named current_context (latest active requirements, recent notes, and recent change intents) in addition to query matches; tune output size with: requirements_limit/changes_limit/notes_limit/decisions_limit/current_context_limit, preview_chars, pending_limit/pending_offset.",
|
|
53
|
+
" - Prefer read_memory_item({ project_root, id, offset, limit }) to fetch full text on demand instead of returning large content in other tool outputs.",
|
|
54
|
+
"- For pure execution-first tasks with explicit targets (for example compile/build/run/launch/package/publish/test rerun), you may skip retrieval and go straight to the minimum necessary shell or host tools unless code/context lookup is actually needed to unblock execution.",
|
|
55
|
+
"- If rtk is installed or VectorMind's bundled RTK shim is verified (detect_rtk with gain_ok=true), prefix shell commands with the command returned by detect_rtk. Usually this is rtk (rtk git status, rtk npm run build, rtk rg ...); in npx/MCP-only installs it may be a package shim command such as node <...>/rtk-shim.js.",
|
|
56
|
+
"- If rtk is missing and the user asks to install it, use install_rtk first with dry_run=true to show the exact commands; execute with dry_run=false only when the user explicitly asks to install/init.",
|
|
57
|
+
"- To read local Codex skill/prompt/rule files (for example SKILL.md under CODEX_HOME or AGENTS_HOME), prefer read_codex_text_file({ path }) instead of assuming another local-file MCP resource server exists.",
|
|
58
|
+
"- For project file/directory browsing, prefer list_project_files({ project_root, path, recursive?, max_depth? }) over shelling out to Get-ChildItem/ls. It respects ignore rules and keeps output bounded.",
|
|
59
|
+
"- For small/medium raw file reads, prefer read_file_text({ project_root, path, offset?, max_chars? }) over Get-Content -Raw. Use read_file_lines({ project_root, path, from_line?/to_line? }) when you need deterministic line ranges or the file may be large.",
|
|
60
|
+
"- For raw repo text search with exact file+line+col matches, prefer grep({ project_root, query: <pattern> }). It uses ripgrep against real project files when available, applies built-in noise filters, and only falls back to indexed search if ripgrep is unavailable.",
|
|
61
|
+
"- To read a bounded segment of a file, prefer read_file_lines({ project_root, path: <file>, from_line/to_line or total_count }) over unbounded file reads.",
|
|
62
|
+
"- BEFORE editing code: call start_requirement({ project_root, title, background }) to set the active requirement.",
|
|
63
|
+
" - When the user names a narrow feature/domain, pass scope_allow/allowed_paths and scope_deny/denied_paths when useful. These are generic project-specific scope boundaries, not business-specific built-ins.",
|
|
64
|
+
" - When the user request has explicit bullets, acceptance points, or numbered items, pass requirement_items so planned changes can be mapped back to the user's actual request.",
|
|
65
|
+
"- BEFORE editing once target files/modules are known: call preflight_change_scope({ project_root, intent, files/planned_files, optional scope_allow/scope_deny/allowed_paths/denied_paths }). If ok=false/safe_to_edit=false or it returns development_warnings, stop before editing and narrow the plan unless the user explicitly expands the requirement.",
|
|
66
|
+
" - For explicit requirements, pass planned_changes with requirement_refs before editing. If a change is only mechanical/test/build/formatting support, mark supporting_change=true instead of inventing a new requirement.",
|
|
67
|
+
" - If a tool output includes project_context_advisory or cross_project_reference, treat that project as separate context. If the current requirement belongs to another project_root, use it only as read-only external evidence unless the user explicitly switches the target project.",
|
|
68
|
+
"- Treat the active requirement as the only change boundary. Do not add extra business behavior, new flows, new fields, new interfaces, or touch completed/related features unless the user explicitly asked or the change is strictly necessary.",
|
|
69
|
+
"- Do not keep piling new feature code into a large single file. Prefer small modules/services/components; if an implementation file is already large, split it before adding more responsibilities.",
|
|
70
|
+
"- If preflight_change_scope/read_file_lines/grep/query_codebase/get_pending_changes/sync_change_intent returns huge_file_modularization_required, do not continue normal feature work. Call plan_large_file_split, perform mechanical modularization with real module names/directories, never create generated/parts/partN files, then call record_large_file_split before resuming normal feature work. Only use preflight_change_scope(change_mode='mechanical_modularization') for the split itself; use change_mode='emergency_hotfix' only for the smallest urgent fix and still record why the split was deferred.",
|
|
71
|
+
"- AFTER editing + saving: call get_pending_changes({ project_root }) to see unsynced files, then call sync_change_intent({ project_root, intent, files? }). (You can omit files to auto-link all pending changes.)",
|
|
72
|
+
"- If preflight_change_scope, read_file_lines, grep, query_codebase, get_pending_changes, or sync_change_intent returns development_warnings, address those warnings before continuing or explain why the current requirement truly needs that scope.",
|
|
73
|
+
"- After major milestones/decisions: call upsert_project_summary({ project_root, summary }) and/or add_note({ project_root, ... }) to persist durable context locally.",
|
|
74
|
+
"- When a requirement or user decision changes/reverses an older behavior, call upsert_decision({ project_root, key, title, content, supersedes_req_ids?/supersedes_memory_ids? }) and/or supersede_memory({ project_root, ... }). Current decisions are shown in bootstrap_context/get_brain_dump and superseded memories are hidden from default semantic recall so stale requirements do not override newer facts.",
|
|
75
|
+
"- If the user states a durable project convention (build commands, frameworks, naming rules, output paths): call upsert_convention({ project_root, key, content, tags }) so it is applied in future sessions.",
|
|
76
|
+
"- When you need full text for a specific note/summary/match: call read_memory_item({ project_root, id, offset, limit }) and page through it.",
|
|
77
|
+
"- When asked to locate code (class/function/type): call query_codebase({ project_root, query }) instead of guessing.",
|
|
78
|
+
"- When you need to recall relevant context from history/code/docs: call semantic_search({ project_root, query, ... }) instead of guessing. It uses local FTS/token/LIKE recall so recent explicit wording and durable decisions stay visible without remote model loading.",
|
|
79
|
+
"- To understand the order of related decisions/requirements/changes, use memory_timeline({ project_root, ... }) as read-only evidence; do not let old timeline entries override newer observed facts or current decisions.",
|
|
80
|
+
"- For long sessions or handoffs, create_checkpoint({ project_root, title, summary }) stores a local waypoint, and restore_checkpoint_context({ project_root, checkpoint_id }) reads it back without mutating active requirements or model judgment.",
|
|
81
|
+
"- Optional low-risk diagnostics: use analyze_memory_conflicts({ project_root, ... }), memory_quality_report({ project_root, ... }), or compare_checkpoint_context({ project_root, ... }) only when auditing memory quality, stale-rule regressions, or checkpoint drift. These tools are read-only evidence and must not expand the current requirement or replace model judgment.",
|
|
82
|
+
"- VectorMind automatically runs small, throttled memory maintenance to compact old completed history and prune stale indexes in long-lived projects. For large repos that feel slow, call maintain_memory({ project_root, dry_run: true }) first, then maintain_memory({ project_root, dry_run: false }) if the plan looks correct.",
|
|
83
|
+
"- Use get_token_savings({ format: 'compact' }) when you need to verify how many tokens VectorMind compact outputs saved.",
|
|
84
|
+
"",
|
|
85
|
+
"If tool output conflicts with assumptions, treat it as evidence, then verify against current user instructions, directly observed repository facts, and model judgment; newer/direct evidence wins over stale memory.",
|
|
86
|
+
].join("\n");
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=server-instructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../src/server-instructions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uDAAuD,EACvD,gDAAgD,EAChD,2CAA2C,EAC3C,uCAAuC,EACvC,0CAA0C,EAC1C,kCAAkC,EAClC,8BAA8B,EAC9B,wDAAwD,EACxD,0CAA0C,EAC1C,iCAAiC,GAClC,MAAM,2BAA2B,CAAC;AACnC,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,wFAAwF;QACxF,oLAAoL;QACpL,sTAAsT;QACtT,2UAA2U;QAC3U,oHAAoH;QACpH,EAAE;QACF,0CAA0C;QAC1C,iCAAiC;QACjC,EAAE;QACF,gDAAgD;QAChD,8BAA8B;QAC9B,EAAE;QACF,+CAA+C;QAC/C,gDAAgD;QAChD,EAAE;QACF,6DAA6D;QAC7D,uDAAuD;QACvD,EAAE;QACF,8DAA8D;QAC9D,wDAAwD;QACxD,EAAE;QACF,iDAAiD;QACjD,2CAA2C;QAC3C,EAAE;QACF,6CAA6C;QAC7C,uCAAuC;QACvC,EAAE;QACF,kEAAkE;QAClE,0CAA0C;QAC1C,EAAE;QACF,oDAAoD;QACpD,kCAAkC;QAClC,EAAE;QACF,uDAAuD;QACvD,0CAA0C;QAC1C,EAAE;QACF,sDAAsD;QACtD,yJAAyJ;QACzJ,6JAA6J;QAC7J,0PAA0P;QAC1P,6FAA6F;QAC7F,6LAA6L;QAC7L,kIAAkI;QAClI,EAAE;QACF,sBAAsB;QACtB,kGAAkG;QAClG,uSAAuS;QACvS,sHAAsH;QACtH,8VAA8V;QAC9V,yJAAyJ;QACzJ,mRAAmR;QACnR,kUAAkU;QAClU,yMAAyM;QACzM,gNAAgN;QAChN,4MAA4M;QAC5M,iQAAiQ;QACjQ,2QAA2Q;QAC3Q,4JAA4J;QAC5J,mHAAmH;QACnH,gNAAgN;QAChN,kLAAkL;QAClL,8VAA8V;QAC9V,6NAA6N;QAC7N,2RAA2R;QAC3R,kPAAkP;QAClP,qMAAqM;QACrM,2lBAA2lB;QAC3lB,oNAAoN;QACpN,sPAAsP;QACtP,uKAAuK;QACvK,sZAAsZ;QACtZ,+MAA+M;QAC/M,8IAA8I;QAC9I,sHAAsH;QACtH,4QAA4Q;QAC5Q,4NAA4N;QAC5N,qPAAqP;QACrP,oXAAoX;QACpX,qUAAqU;QACrU,0HAA0H;QAC1H,EAAE;QACF,uNAAuN;KACxN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
package/dist/symbols.js
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
export function extractSymbols(filePath, content) {
|
|
3
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
4
|
+
if (ext === ".py")
|
|
5
|
+
return extractPythonSymbols(content);
|
|
6
|
+
if (ext === ".rs")
|
|
7
|
+
return extractRustSymbols(content);
|
|
8
|
+
if (ext === ".go")
|
|
9
|
+
return extractGoSymbols(content);
|
|
10
|
+
if (ext === ".ts" ||
|
|
11
|
+
ext === ".tsx" ||
|
|
12
|
+
ext === ".js" ||
|
|
13
|
+
ext === ".jsx" ||
|
|
14
|
+
ext === ".mjs" ||
|
|
15
|
+
ext === ".cjs") {
|
|
16
|
+
return extractJsTsSymbols(content);
|
|
17
|
+
}
|
|
18
|
+
return extractCLikeSymbols(content);
|
|
19
|
+
}
|
|
20
|
+
function extractJsTsSymbols(content) {
|
|
21
|
+
const symbols = [];
|
|
22
|
+
const lines = content.split(/\r?\n/);
|
|
23
|
+
for (const line of lines) {
|
|
24
|
+
const trimmed = line.trim();
|
|
25
|
+
if (!trimmed)
|
|
26
|
+
continue;
|
|
27
|
+
if (trimmed.startsWith("//"))
|
|
28
|
+
continue;
|
|
29
|
+
let match;
|
|
30
|
+
match = trimmed.match(/^(export\s+)?(default\s+)?class\s+([A-Za-z_$][\w$]*)/);
|
|
31
|
+
if (match) {
|
|
32
|
+
symbols.push({ name: match[3], type: "class", signature: trimmed });
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
match = trimmed.match(/^(export\s+)?(async\s+)?function\s+([A-Za-z_$][\w$]*)\s*\(/);
|
|
36
|
+
if (match) {
|
|
37
|
+
symbols.push({ name: match[3], type: "function", signature: trimmed });
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
match = trimmed.match(/^(export\s+)?interface\s+([A-Za-z_$][\w$]*)\b/);
|
|
41
|
+
if (match) {
|
|
42
|
+
symbols.push({ name: match[2], type: "interface", signature: trimmed });
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
match = trimmed.match(/^(export\s+)?type\s+([A-Za-z_$][\w$]*)\s*=/);
|
|
46
|
+
if (match) {
|
|
47
|
+
symbols.push({ name: match[2], type: "type", signature: trimmed });
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
match = trimmed.match(/^(export\s+)?enum\s+([A-Za-z_$][\w$]*)\b/);
|
|
51
|
+
if (match) {
|
|
52
|
+
symbols.push({ name: match[2], type: "enum", signature: trimmed });
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
match = trimmed.match(/^(export\s+)?const\s+([A-Za-z_$][\w$]*)\s*=\s*(async\s*)?\(.*=>/);
|
|
56
|
+
if (match) {
|
|
57
|
+
symbols.push({ name: match[2], type: "function", signature: trimmed });
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
match = trimmed.match(/^(export\s+)?const\s+([A-Za-z_$][\w$]*)\s*=\s*(async\s*)?function\s*\(/);
|
|
61
|
+
if (match) {
|
|
62
|
+
symbols.push({ name: match[2], type: "function", signature: trimmed });
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return symbols;
|
|
67
|
+
}
|
|
68
|
+
function extractPythonSymbols(content) {
|
|
69
|
+
const symbols = [];
|
|
70
|
+
const lines = content.split(/\r?\n/);
|
|
71
|
+
for (const line of lines) {
|
|
72
|
+
const trimmed = line.trim();
|
|
73
|
+
if (!trimmed || trimmed.startsWith("#"))
|
|
74
|
+
continue;
|
|
75
|
+
let match;
|
|
76
|
+
match = trimmed.match(/^class\s+([A-Za-z_][\w]*)\b/);
|
|
77
|
+
if (match) {
|
|
78
|
+
symbols.push({ name: match[1], type: "class", signature: trimmed });
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
match = trimmed.match(/^(async\s+)?def\s+([A-Za-z_][\w]*)\s*\(/);
|
|
82
|
+
if (match) {
|
|
83
|
+
symbols.push({ name: match[2], type: "function", signature: trimmed });
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return symbols;
|
|
88
|
+
}
|
|
89
|
+
function extractRustSymbols(content) {
|
|
90
|
+
const symbols = [];
|
|
91
|
+
const lines = content.split(/\r?\n/);
|
|
92
|
+
for (const line of lines) {
|
|
93
|
+
const trimmed = line.trim();
|
|
94
|
+
if (!trimmed || trimmed.startsWith("//"))
|
|
95
|
+
continue;
|
|
96
|
+
let match;
|
|
97
|
+
match = trimmed.match(/^(pub\s+)?(struct|enum|trait)\s+([A-Za-z_][\w]*)\b/);
|
|
98
|
+
if (match) {
|
|
99
|
+
symbols.push({ name: match[3], type: match[2], signature: trimmed });
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
match = trimmed.match(/^(pub\s+)?fn\s+([A-Za-z_][\w]*)\s*\(/);
|
|
103
|
+
if (match) {
|
|
104
|
+
symbols.push({ name: match[2], type: "function", signature: trimmed });
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return symbols;
|
|
109
|
+
}
|
|
110
|
+
function extractGoSymbols(content) {
|
|
111
|
+
const symbols = [];
|
|
112
|
+
const lines = content.split(/\r?\n/);
|
|
113
|
+
for (const line of lines) {
|
|
114
|
+
const trimmed = line.trim();
|
|
115
|
+
if (!trimmed || trimmed.startsWith("//"))
|
|
116
|
+
continue;
|
|
117
|
+
let match;
|
|
118
|
+
match = trimmed.match(/^type\s+([A-Za-z_][\w]*)\s+(struct|interface)\b/);
|
|
119
|
+
if (match) {
|
|
120
|
+
symbols.push({ name: match[1], type: match[2], signature: trimmed });
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
match = trimmed.match(/^func\s+([A-Za-z_][\w]*)\s*\(/);
|
|
124
|
+
if (match) {
|
|
125
|
+
symbols.push({ name: match[1], type: "function", signature: trimmed });
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
match = trimmed.match(/^func\s+\([^)]*\)\s+([A-Za-z_][\w]*)\s*\(/);
|
|
129
|
+
if (match) {
|
|
130
|
+
symbols.push({ name: match[1], type: "method", signature: trimmed });
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return symbols;
|
|
135
|
+
}
|
|
136
|
+
function extractCLikeSymbols(content) {
|
|
137
|
+
const symbols = [];
|
|
138
|
+
const lines = content.split(/\r?\n/);
|
|
139
|
+
for (const line of lines) {
|
|
140
|
+
const trimmed = line.trim();
|
|
141
|
+
if (!trimmed)
|
|
142
|
+
continue;
|
|
143
|
+
if (trimmed.startsWith("//") || trimmed.startsWith("/*") || trimmed.startsWith("*"))
|
|
144
|
+
continue;
|
|
145
|
+
let match;
|
|
146
|
+
match = trimmed.match(/^(class|struct|interface|enum)\s+([A-Za-z_][\w]*)\b/);
|
|
147
|
+
if (match) {
|
|
148
|
+
symbols.push({ name: match[2], type: match[1], signature: trimmed });
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
match = trimmed.match(/^[A-Za-z_][\w:<>,\s\*&]*\s+([A-Za-z_][\w]*)\s*\(/);
|
|
152
|
+
if (match) {
|
|
153
|
+
symbols.push({ name: match[1], type: "function", signature: trimmed });
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return symbols;
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=symbols.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbols.js","sourceRoot":"","sources":["../src/symbols.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,MAAM,UAAU,cAAc,CAAC,QAAgB,EAAE,OAAe;IAC9D,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IACjD,IAAI,GAAG,KAAK,KAAK;QAAE,OAAO,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACxD,IAAI,GAAG,KAAK,KAAK;QAAE,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACtD,IAAI,GAAG,KAAK,KAAK;QAAE,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACpD,IACE,GAAG,KAAK,KAAK;QACb,GAAG,KAAK,MAAM;QACd,GAAG,KAAK,KAAK;QACb,GAAG,KAAK,MAAM;QACd,GAAG,KAAK,MAAM;QACd,GAAG,KAAK,MAAM,EACd,CAAC;QACD,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AAED,SA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