@mthanh/vespercli 2.0.1 → 2.2.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.
- package/README.md +54 -11
- package/assets/CATALOG.md +14 -0
- package/assets/claude/.claude-plugin/marketplace.json +21 -15
- package/assets/claude/.claude-plugin/plugin.json +1 -1
- package/assets/claude/agents/workspace-learner.md +1 -1
- package/assets/claude/orchestration.md.tpl +1 -1
- package/assets/claude/packs/backend/.claude-plugin/plugin.json +1 -1
- package/assets/claude/packs/docs/.claude-plugin/plugin.json +1 -1
- package/assets/claude/packs/frontend/.claude-plugin/plugin.json +1 -1
- package/assets/claude/packs/graphify/.claude-plugin/plugin.json +10 -0
- package/assets/claude/packs/graphify/skills/agent-fundamentals/SKILL.md +89 -0
- package/assets/claude/packs/graphify/skills/agent-fundamentals/references/codebase-query.md +95 -0
- package/assets/claude/packs/graphify/skills/agent-fundamentals/references/terminal-discipline.md +94 -0
- package/assets/claude/packs/graphify/skills/agent-fundamentals/references/tool-usage-patterns.md +67 -0
- package/assets/claude/packs/graphify/skills/graphify-research/SKILL.md +101 -0
- package/assets/claude/packs/integrations/.claude-plugin/plugin.json +1 -1
- package/assets/claude/packs/playwright/.claude-plugin/plugin.json +1 -1
- package/assets/claude/packs/polyglot/.claude-plugin/plugin.json +1 -1
- package/assets/claude/packs/styles/.claude-plugin/plugin.json +1 -1
- package/assets/claude/vesper-orchestrator.md +2 -2
- package/assets/copilot/agents/workspace-learner.agent.md +1 -1
- package/assets/copilot/packs/graphify/skills/graphify-research/SKILL.md +101 -0
- package/assets/hooks/pre-commit +1 -1
- package/assets/manifest.json +3 -0
- package/assets/opencode/vesper-plugin.js +120 -0
- package/dist/cli.min.js +134 -99
- package/dist/opencode-render.js +254 -0
- package/package.json +2 -2
- package/scripts/packs-layout.test.js +23 -2
- package/src/mcp/vesper-indexing/dist/indexer/chunker.js +83 -2
- package/src/mcp/vesper-indexing/dist/indexer/chunker.js.map +1 -1
- package/src/mcp/vesper-indexing/package-lock.json +2 -2
- package/src/mcp/vesper-indexing/package.json +1 -1
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
// src/cli/utils/opencode-render.js
|
|
2
|
+
var CORE_PLUGIN_NAME = "vesper";
|
|
3
|
+
var OPENCODE_AGENT_DIR_RELATIVE = ".opencode/agents";
|
|
4
|
+
var MODEL_PROVIDER_PREFIX = "anthropic/";
|
|
5
|
+
var CLAUDE_TO_OPENCODE_TOOLS = Object.freeze({
|
|
6
|
+
Read: "read",
|
|
7
|
+
Write: "edit",
|
|
8
|
+
Edit: "edit",
|
|
9
|
+
MultiEdit: "edit",
|
|
10
|
+
NotebookEdit: "edit",
|
|
11
|
+
Bash: "bash",
|
|
12
|
+
Grep: "grep",
|
|
13
|
+
Glob: "glob",
|
|
14
|
+
LS: "list",
|
|
15
|
+
WebFetch: "webfetch",
|
|
16
|
+
WebSearch: "websearch",
|
|
17
|
+
Task: "task",
|
|
18
|
+
Agent: "task",
|
|
19
|
+
TodoWrite: "todowrite",
|
|
20
|
+
TodoRead: "todowrite",
|
|
21
|
+
AskUserQuestion: "question",
|
|
22
|
+
Skill: "skill"
|
|
23
|
+
});
|
|
24
|
+
var OPENCODE_GATED_PERMISSIONS = Object.freeze([
|
|
25
|
+
"read",
|
|
26
|
+
"edit",
|
|
27
|
+
"glob",
|
|
28
|
+
"grep",
|
|
29
|
+
"bash",
|
|
30
|
+
"task",
|
|
31
|
+
"todowrite",
|
|
32
|
+
"webfetch",
|
|
33
|
+
"websearch",
|
|
34
|
+
"question"
|
|
35
|
+
]);
|
|
36
|
+
function sanitizeMcpName(value) {
|
|
37
|
+
return String(value).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
38
|
+
}
|
|
39
|
+
function agentId(name, plugin = CORE_PLUGIN_NAME) {
|
|
40
|
+
return `${plugin || CORE_PLUGIN_NAME}:${name}`;
|
|
41
|
+
}
|
|
42
|
+
function mapModel(model) {
|
|
43
|
+
const m = String(model ?? "").trim();
|
|
44
|
+
if (!m || m === "inherit")
|
|
45
|
+
return void 0;
|
|
46
|
+
if (m.includes("/"))
|
|
47
|
+
return m;
|
|
48
|
+
if (m.startsWith("claude-"))
|
|
49
|
+
return `${MODEL_PROVIDER_PREFIX}${m}`;
|
|
50
|
+
return void 0;
|
|
51
|
+
}
|
|
52
|
+
function normalizeToolList(tools) {
|
|
53
|
+
if (tools === null || tools === void 0)
|
|
54
|
+
return null;
|
|
55
|
+
const list = Array.isArray(tools) ? tools : String(tools).split(",");
|
|
56
|
+
const names = list.map((s) => String(s).trim()).filter(Boolean);
|
|
57
|
+
return names.length ? names : null;
|
|
58
|
+
}
|
|
59
|
+
function mapTools(tools) {
|
|
60
|
+
const names = normalizeToolList(tools);
|
|
61
|
+
if (names === null)
|
|
62
|
+
return { permission: {}, unmapped: [], restricted: false };
|
|
63
|
+
const allowed = /* @__PURE__ */ new Set();
|
|
64
|
+
const mcpGlobs = /* @__PURE__ */ new Set();
|
|
65
|
+
const unmapped = [];
|
|
66
|
+
for (const tool of names) {
|
|
67
|
+
const mcp = /^mcp__(.+?)__(.+)$/.exec(tool);
|
|
68
|
+
if (mcp) {
|
|
69
|
+
mcpGlobs.add(`${sanitizeMcpName(mcp[1])}_*`);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const key = CLAUDE_TO_OPENCODE_TOOLS[tool];
|
|
73
|
+
if (key)
|
|
74
|
+
allowed.add(key);
|
|
75
|
+
else
|
|
76
|
+
unmapped.push(tool);
|
|
77
|
+
}
|
|
78
|
+
const permission = {};
|
|
79
|
+
for (const key of OPENCODE_GATED_PERMISSIONS)
|
|
80
|
+
permission[key] = allowed.has(key) ? "allow" : "deny";
|
|
81
|
+
for (const key of allowed)
|
|
82
|
+
if (!(key in permission))
|
|
83
|
+
permission[key] = "allow";
|
|
84
|
+
for (const glob of [...mcpGlobs].sort())
|
|
85
|
+
permission[glob] = "allow";
|
|
86
|
+
return { permission, unmapped, restricted: true };
|
|
87
|
+
}
|
|
88
|
+
function splitFrontmatter(text) {
|
|
89
|
+
const src = String(text ?? "").replace(/\r\n/g, "\n");
|
|
90
|
+
const m = /^---\n([\s\S]*?)\n---(?:\n|$)/.exec(src);
|
|
91
|
+
if (!m)
|
|
92
|
+
return { raw: "", body: src };
|
|
93
|
+
return { raw: m[1], body: src.slice(m[0].length) };
|
|
94
|
+
}
|
|
95
|
+
function scalar(value) {
|
|
96
|
+
const s = String(value).trim();
|
|
97
|
+
if (s.startsWith('"') && s.endsWith('"') && s.length >= 2) {
|
|
98
|
+
try {
|
|
99
|
+
return JSON.parse(s);
|
|
100
|
+
} catch {
|
|
101
|
+
return s.slice(1, -1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (s.startsWith("'") && s.endsWith("'") && s.length >= 2)
|
|
105
|
+
return s.slice(1, -1).replace(/''/g, "'");
|
|
106
|
+
return s;
|
|
107
|
+
}
|
|
108
|
+
function parseFrontmatter(raw) {
|
|
109
|
+
const out = {};
|
|
110
|
+
const lines = String(raw ?? "").replace(/\r\n/g, "\n").split("\n");
|
|
111
|
+
for (let i = 0; i < lines.length; i++) {
|
|
112
|
+
const line = lines[i];
|
|
113
|
+
if (!line.trim() || /^\s*#/.test(line))
|
|
114
|
+
continue;
|
|
115
|
+
const m = /^([A-Za-z0-9_-]+):\s*(.*)$/.exec(line);
|
|
116
|
+
if (!m)
|
|
117
|
+
continue;
|
|
118
|
+
const key = m[1];
|
|
119
|
+
const value = m[2].trim();
|
|
120
|
+
if (/^[>|]-?$/.test(value)) {
|
|
121
|
+
const block = [];
|
|
122
|
+
while (i + 1 < lines.length && (/^\s+\S/.test(lines[i + 1]) || lines[i + 1].trim() === ""))
|
|
123
|
+
block.push(lines[++i].trim());
|
|
124
|
+
while (block.length && block[block.length - 1] === "")
|
|
125
|
+
block.pop();
|
|
126
|
+
out[key] = value.startsWith(">") ? block.join(" ").replace(/\s+/g, " ") : block.join("\n");
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (value === "") {
|
|
130
|
+
const items = [];
|
|
131
|
+
while (i + 1 < lines.length && /^\s*-\s/.test(lines[i + 1]))
|
|
132
|
+
items.push(scalar(lines[++i].replace(/^\s*-\s*/, "")));
|
|
133
|
+
out[key] = items.length ? items : "";
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
if (value.startsWith("[") && value.endsWith("]")) {
|
|
137
|
+
out[key] = value.slice(1, -1).split(",").map((s) => scalar(s)).filter((s) => s !== "");
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
out[key] = scalar(value);
|
|
141
|
+
}
|
|
142
|
+
return out;
|
|
143
|
+
}
|
|
144
|
+
function parseAgentMarkdown(text) {
|
|
145
|
+
const { raw, body } = splitFrontmatter(text);
|
|
146
|
+
return { frontmatter: parseFrontmatter(raw), body };
|
|
147
|
+
}
|
|
148
|
+
function yamlKey(key) {
|
|
149
|
+
return /^[A-Za-z_][A-Za-z0-9_-]*$/.test(key) ? key : JSON.stringify(key);
|
|
150
|
+
}
|
|
151
|
+
function renderFrontmatter({ description, mode, model, permission }) {
|
|
152
|
+
const lines = ["---", `description: ${JSON.stringify(description)}`, `mode: ${mode}`];
|
|
153
|
+
if (model)
|
|
154
|
+
lines.push(`model: ${model}`);
|
|
155
|
+
if (permission && Object.keys(permission).length) {
|
|
156
|
+
lines.push("permission:");
|
|
157
|
+
for (const [key, action] of Object.entries(permission))
|
|
158
|
+
lines.push(` ${yamlKey(key)}: ${action}`);
|
|
159
|
+
}
|
|
160
|
+
lines.push("---");
|
|
161
|
+
return lines.join("\n");
|
|
162
|
+
}
|
|
163
|
+
function convertClaudeAgent({ name, frontmatter = {}, body = "", plugin = CORE_PLUGIN_NAME } = {}) {
|
|
164
|
+
if (!name || typeof name !== "string")
|
|
165
|
+
throw new Error("convertClaudeAgent: `name` is required");
|
|
166
|
+
const fm = frontmatter && typeof frontmatter === "object" ? frontmatter : {};
|
|
167
|
+
const description = String(fm.description ?? "").replace(/\s+/g, " ").trim() || `Vesper specialist: ${name}`;
|
|
168
|
+
const model = mapModel(fm.model);
|
|
169
|
+
const { permission, unmapped, restricted } = mapTools(fm.tools);
|
|
170
|
+
const text = String(body ?? "");
|
|
171
|
+
const config = { description, mode: "subagent" };
|
|
172
|
+
if (model)
|
|
173
|
+
config.model = model;
|
|
174
|
+
if (restricted)
|
|
175
|
+
config.permission = permission;
|
|
176
|
+
config.prompt = text;
|
|
177
|
+
const markdown = `${renderFrontmatter({ description, mode: "subagent", model, permission: restricted ? permission : void 0 })}
|
|
178
|
+
${text}`;
|
|
179
|
+
return { id: agentId(name, plugin), name, plugin: plugin || CORE_PLUGIN_NAME, markdown, config, unmapped };
|
|
180
|
+
}
|
|
181
|
+
var ORCHESTRATOR_RULES = Object.freeze([
|
|
182
|
+
[".claude/rules/vesper-orchestrator.md", "the orchestrator playbook (delegation law, purpose router, pipelines, degraded mode, host-mismatch warning)"],
|
|
183
|
+
[".claude/rules/vesper-orchestration.md", "the team roster + task-management config (the single authority for which `vesper:<name>` specialist fills which role)"],
|
|
184
|
+
[".claude/rules/vesper-context.md", "the slim project whitepaper (architecture, domain model, workflows, freshness)"]
|
|
185
|
+
]);
|
|
186
|
+
var DEFAULT_ORCHESTRATOR_DESCRIPTION = "Vesper super-orchestrator \u2014 the primary agent of a Vesper-managed project on OpenCode. Routes every request to the specialist team per the always-on orchestrator playbook and team roster in `.claude/rules/`.";
|
|
187
|
+
function renderOrchestratorAgent({ source, description } = {}) {
|
|
188
|
+
let desc = description;
|
|
189
|
+
if (!desc && source)
|
|
190
|
+
desc = parseAgentMarkdown(source).frontmatter.description;
|
|
191
|
+
desc = String(desc || DEFAULT_ORCHESTRATOR_DESCRIPTION).replace(/\s+/g, " ").trim();
|
|
192
|
+
const body = [
|
|
193
|
+
"# Vesper (Super Orchestrator) \u2014 OpenCode primary agent",
|
|
194
|
+
"",
|
|
195
|
+
"You are Vesper, the super-orchestrator for this project. Your complete operating playbook \u2014",
|
|
196
|
+
"the mandatory delegation law, the purpose router, every pipeline, the degraded-mode carve-out",
|
|
197
|
+
"and the host-mismatch warning \u2014 is the **always-on rules** `opencode.json` loads through",
|
|
198
|
+
"`instructions` into every session:",
|
|
199
|
+
"",
|
|
200
|
+
...ORCHESTRATOR_RULES.map(([path, what]) => `- \`${path}\` \u2014 ${what}.`),
|
|
201
|
+
"",
|
|
202
|
+
"This agent file is intentionally thin: it exists so `opencode.json` `default_agent:",
|
|
203
|
+
'"vesper-orchestrator"` resolves a real primary agent. All behavior lives in the rules above \u2014',
|
|
204
|
+
"follow them exactly. Do not restate or override them here.",
|
|
205
|
+
"",
|
|
206
|
+
"Specialists are delegated to by their namespaced names (`vesper:<name>` for the core catalog,",
|
|
207
|
+
"`vesper-<pack>:<name>` for an enabled pack), registered by the Vesper plugin",
|
|
208
|
+
"(`.opencode/plugins/vesper.js`) from the installed `@mthanh/vespercli` package \u2014 or, when",
|
|
209
|
+
'`vesper.agentsMode` is `"files"`, from the generated `.opencode/agents/<id>.md` files. The',
|
|
210
|
+
"committed maintenance skills resolve from `.claude/skills/` and are invoked unqualified",
|
|
211
|
+
"(`/reinit`, `/compact-knowledge`, `/revalidate-knowledge`, `/revalidate-team`).",
|
|
212
|
+
""
|
|
213
|
+
].join("\n");
|
|
214
|
+
return `${renderFrontmatter({ description: desc, mode: "primary" })}
|
|
215
|
+
|
|
216
|
+
${body}`;
|
|
217
|
+
}
|
|
218
|
+
var opencode_render_default = {
|
|
219
|
+
CORE_PLUGIN_NAME,
|
|
220
|
+
OPENCODE_AGENT_DIR_RELATIVE,
|
|
221
|
+
CLAUDE_TO_OPENCODE_TOOLS,
|
|
222
|
+
OPENCODE_GATED_PERMISSIONS,
|
|
223
|
+
ORCHESTRATOR_RULES,
|
|
224
|
+
agentId,
|
|
225
|
+
mapModel,
|
|
226
|
+
mapTools,
|
|
227
|
+
normalizeToolList,
|
|
228
|
+
sanitizeMcpName,
|
|
229
|
+
splitFrontmatter,
|
|
230
|
+
parseFrontmatter,
|
|
231
|
+
parseAgentMarkdown,
|
|
232
|
+
convertClaudeAgent,
|
|
233
|
+
renderOrchestratorAgent
|
|
234
|
+
};
|
|
235
|
+
export {
|
|
236
|
+
CLAUDE_TO_OPENCODE_TOOLS,
|
|
237
|
+
CORE_PLUGIN_NAME,
|
|
238
|
+
DEFAULT_ORCHESTRATOR_DESCRIPTION,
|
|
239
|
+
MODEL_PROVIDER_PREFIX,
|
|
240
|
+
OPENCODE_AGENT_DIR_RELATIVE,
|
|
241
|
+
OPENCODE_GATED_PERMISSIONS,
|
|
242
|
+
ORCHESTRATOR_RULES,
|
|
243
|
+
agentId,
|
|
244
|
+
convertClaudeAgent,
|
|
245
|
+
opencode_render_default as default,
|
|
246
|
+
mapModel,
|
|
247
|
+
mapTools,
|
|
248
|
+
normalizeToolList,
|
|
249
|
+
parseAgentMarkdown,
|
|
250
|
+
parseFrontmatter,
|
|
251
|
+
renderOrchestratorAgent,
|
|
252
|
+
sanitizeMcpName,
|
|
253
|
+
splitFrontmatter
|
|
254
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mthanh/vespercli",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Vesper Agent Suite — CLI to manage AI agents, prompts, instructions, and skills for GitHub Copilot (VS Code) and Claude Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/cli/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"test": "vitest run",
|
|
30
30
|
"test:unit": "vitest run",
|
|
31
31
|
"test:watch": "vitest",
|
|
32
|
-
"build:cli": "esbuild src/cli/index.js --bundle --platform=node --format=esm --minify --outfile=dist/cli.min.js --external:@inquirer/prompts --external:commander --external:picocolors --external:strip-json-comments",
|
|
32
|
+
"build:cli": "esbuild src/cli/index.js --bundle --platform=node --format=esm --minify --outfile=dist/cli.min.js --external:@inquirer/prompts --external:commander --external:picocolors --external:strip-json-comments && esbuild src/cli/utils/opencode-render.js --bundle --platform=node --format=esm --outfile=dist/opencode-render.js",
|
|
33
33
|
"build:mcp": "cd src/mcp/vesper-indexing && npm install && npm run build",
|
|
34
34
|
"build": "npm run build:cli && npm run build:mcp",
|
|
35
35
|
"eval": "node scripts/eval-orchestrator.js",
|
|
@@ -27,8 +27,8 @@ const manifest = JSON.parse(readFileSync(join(ASSETS_DIR, 'manifest.json'), 'utf
|
|
|
27
27
|
const marketplace = JSON.parse(readFileSync(join(ASSETS_DIR, 'claude', '.claude-plugin', 'marketplace.json'), 'utf-8'));
|
|
28
28
|
|
|
29
29
|
describe('pack plugins and the marketplace', () => {
|
|
30
|
-
it('ships the
|
|
31
|
-
expect(await listPackNames()).toEqual(['backend', 'docs', 'frontend', 'integrations', 'playwright', 'polyglot', 'styles']);
|
|
30
|
+
it('ships the eight decided packs — the six stack packs plus the opt-in styles and graphify packs (kills: a pack dir dropped or renamed)', async () => {
|
|
31
|
+
expect(await listPackNames()).toEqual(['backend', 'docs', 'frontend', 'graphify', 'integrations', 'playwright', 'polyglot', 'styles']);
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
it('every pack has a valid plugin.json named vesper-<pack> at the package version (kills: a stale pack version)', async () => {
|
|
@@ -105,6 +105,8 @@ describe('the manifest carries the pack of every asset', () => {
|
|
|
105
105
|
expect(s['github-actions-to-gitlab-ci']).toBe('integrations');
|
|
106
106
|
expect(s['i-have-adhd']).toBe('styles');
|
|
107
107
|
expect(s.ponytail).toBe('styles');
|
|
108
|
+
// The opt-in graphify pack ships Vesper's own skill only (graphify is an external tool).
|
|
109
|
+
expect(s['graphify-research']).toBe('graphify');
|
|
108
110
|
expect(Object.values(a).filter((p) => p === 'core')).toHaveLength(18);
|
|
109
111
|
expect(Object.values(s).filter((p) => p === 'core')).toHaveLength(20);
|
|
110
112
|
});
|
|
@@ -159,6 +161,25 @@ describe('epic J — third-party skills are pack content with an UPSTREAM.json',
|
|
|
159
161
|
expect(manifest.packs).toContain('styles');
|
|
160
162
|
});
|
|
161
163
|
|
|
164
|
+
it('the graphify pack is skills-only, opt-in, Vesper-authored (no UPSTREAM.json — the tool is external) and listed in the marketplace (kills: graphify vendored or wired as core)', async () => {
|
|
165
|
+
const children = (await readdir(join(ASSETS_DIR, 'claude', 'packs', 'graphify'))).sort();
|
|
166
|
+
expect(children).toEqual(['.claude-plugin', 'skills']);
|
|
167
|
+
expect((await readdir(join(ASSETS_DIR, 'claude', 'packs', 'graphify', 'skills'))).sort()).toEqual(['agent-fundamentals', 'graphify-research']);
|
|
168
|
+
expect(existsSync(join(ASSETS_DIR, 'claude', 'packs', 'graphify', 'skills', 'graphify-research', UPSTREAM_RECORD_FILE))).toBe(false);
|
|
169
|
+
const plugin = JSON.parse(await readFile(join(ASSETS_DIR, 'claude', 'packs', 'graphify', '.claude-plugin', 'plugin.json'), 'utf-8'));
|
|
170
|
+
expect(plugin).toMatchObject({ name: 'vesper-graphify', version: PKG_VERSION });
|
|
171
|
+
expect(plugin.description).toMatch(/opt-in/);
|
|
172
|
+
expect(plugin.description).toMatch(/external tool/);
|
|
173
|
+
expect(marketplace.plugins.find((p) => p.name === 'vesper-graphify')).toMatchObject({ source: './packs/graphify', version: PKG_VERSION });
|
|
174
|
+
expect(manifest.packs).toContain('graphify');
|
|
175
|
+
const skill = await readFile(join(ASSETS_DIR, 'claude', 'packs', 'graphify', 'skills', 'graphify-research', 'SKILL.md'), 'utf-8');
|
|
176
|
+
for (const must of ['query_graph', 'get_neighbors', 'shortest_path', 'get_pr_impact', 'EXTRACTED', 'INFERRED', 'AMBIGUOUS', 'GRAPH_REPORT.md', 'graphify update .', 'vesper_search', 'src/cli/utils/packs.js']) {
|
|
177
|
+
expect(skill, must).toContain(must);
|
|
178
|
+
}
|
|
179
|
+
// The Copilot twin is generated and committed like every pack skill.
|
|
180
|
+
expect(existsSync(join(ASSETS_DIR, 'copilot', 'packs', 'graphify', 'skills', 'graphify-research', 'SKILL.md'))).toBe(true);
|
|
181
|
+
});
|
|
182
|
+
|
|
162
183
|
it('strict: a third-party skill in the CORE tree, or one without a valid record / LICENSE, is an error (kills: unchecked records)', async () => {
|
|
163
184
|
const fx = await mkdtemp(join(tmpdir(), 'vesper-packs-tp-'));
|
|
164
185
|
try {
|
|
@@ -134,13 +134,21 @@ function chunkJavaScript(content, _filePath) {
|
|
|
134
134
|
walk.simple(ast, visitors);
|
|
135
135
|
// If we found some chunks via AST, use them
|
|
136
136
|
if (chunks.length > 0) {
|
|
137
|
+
// Everything the named pass left out — top-level statements, code inside
|
|
138
|
+
// `describe()`/`test()` callbacks, functions shorter than MIN_CHUNK_LINES —
|
|
139
|
+
// still has to be searchable. Cover those gaps with anonymous block chunks
|
|
140
|
+
// (type "block", name null) so they are found by search but never listed
|
|
141
|
+
// as symbols.
|
|
142
|
+
const gapChunks = chunkUncoveredRanges(ast, chunks, lines);
|
|
137
143
|
// Split any chunks that are too large
|
|
138
|
-
return chunks
|
|
144
|
+
return [...chunks, ...gapChunks]
|
|
145
|
+
.flatMap((chunk) => {
|
|
139
146
|
if (chunk.endLine - chunk.startLine > MAX_CHUNK_LINES) {
|
|
140
147
|
return splitLargeChunk(chunk, lines);
|
|
141
148
|
}
|
|
142
149
|
return chunk;
|
|
143
|
-
})
|
|
150
|
+
})
|
|
151
|
+
.sort((a, b) => a.startLine - b.startLine || a.endLine - b.endLine);
|
|
144
152
|
}
|
|
145
153
|
}
|
|
146
154
|
catch {
|
|
@@ -149,6 +157,79 @@ function chunkJavaScript(content, _filePath) {
|
|
|
149
157
|
// Fallback: if AST parsing failed or found nothing useful
|
|
150
158
|
return chunkByLines(content);
|
|
151
159
|
}
|
|
160
|
+
/** Top-level statement kinds that carry no code worth indexing on their own. */
|
|
161
|
+
const NON_SUBSTANTIVE_TOP_LEVEL = new Set(['ImportDeclaration', 'ExportAllDeclaration', 'EmptyStatement']);
|
|
162
|
+
/**
|
|
163
|
+
* Mark the lines of every top-level statement that holds real code (anything
|
|
164
|
+
* but imports, re-exports, bare `export { a, b }` lists and directives).
|
|
165
|
+
* Comments and blank lines between declarations are never marked, so a gap
|
|
166
|
+
* made only of those is skipped.
|
|
167
|
+
*/
|
|
168
|
+
function markSubstantiveLines(ast, lineCount) {
|
|
169
|
+
const substantive = new Array(lineCount + 1).fill(false);
|
|
170
|
+
for (const node of ast.body) {
|
|
171
|
+
if (!node.loc)
|
|
172
|
+
continue;
|
|
173
|
+
if (NON_SUBSTANTIVE_TOP_LEVEL.has(node.type))
|
|
174
|
+
continue;
|
|
175
|
+
if (node.type === 'ExportNamedDeclaration' && !node.declaration)
|
|
176
|
+
continue;
|
|
177
|
+
if (node.type === 'ExpressionStatement' && node.directive !== undefined)
|
|
178
|
+
continue;
|
|
179
|
+
for (let line = node.loc.start.line; line <= node.loc.end.line; line++) {
|
|
180
|
+
substantive[line] = true;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return substantive;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Chunk the line ranges no named chunk covers.
|
|
187
|
+
*
|
|
188
|
+
* A gap is emitted as a single `block` chunk (split later by the caller when it
|
|
189
|
+
* exceeds MAX_CHUNK_LINES) trimmed to its first and last substantive top-level
|
|
190
|
+
* statement, and only when it holds at least one — so a file of named
|
|
191
|
+
* declarations separated by blank lines, comments or imports gains nothing.
|
|
192
|
+
*/
|
|
193
|
+
function chunkUncoveredRanges(ast, named, lines) {
|
|
194
|
+
const lineCount = lines.length;
|
|
195
|
+
const covered = new Array(lineCount + 1).fill(false);
|
|
196
|
+
for (const chunk of named) {
|
|
197
|
+
for (let line = chunk.startLine; line <= chunk.endLine; line++) {
|
|
198
|
+
covered[line] = true;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const substantive = markSubstantiveLines(ast, lineCount);
|
|
202
|
+
const gaps = [];
|
|
203
|
+
let line = 1;
|
|
204
|
+
while (line <= lineCount) {
|
|
205
|
+
if (covered[line]) {
|
|
206
|
+
line++;
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
let end = line;
|
|
210
|
+
while (end + 1 <= lineCount && !covered[end + 1])
|
|
211
|
+
end++;
|
|
212
|
+
// Trim the gap to its first and last substantive line, so the chunk starts
|
|
213
|
+
// at real code (not at the imports, comments or blank lines around it).
|
|
214
|
+
let start = line;
|
|
215
|
+
let last = end;
|
|
216
|
+
while (start <= last && !substantive[start])
|
|
217
|
+
start++;
|
|
218
|
+
while (last >= start && !substantive[last])
|
|
219
|
+
last--;
|
|
220
|
+
if (start <= last) {
|
|
221
|
+
gaps.push({
|
|
222
|
+
type: 'block',
|
|
223
|
+
name: null,
|
|
224
|
+
startLine: start,
|
|
225
|
+
endLine: last,
|
|
226
|
+
content: extractLines(lines, start, last),
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
line = end + 1;
|
|
230
|
+
}
|
|
231
|
+
return gaps;
|
|
232
|
+
}
|
|
152
233
|
/**
|
|
153
234
|
* Split a large chunk into smaller pieces
|
|
154
235
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunker.js","sourceRoot":"","sources":["../../indexer/chunker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,OAAO,EACN,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,sBAAsB,GACtB,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,QAAgB,EAAE,OAAe;IAC1D,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,CAAC;IAErD,mDAAmD;IACnD,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG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AC;gBACX,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,IAAI;gBACV,SAAS,EAAE,CAAC;gBACZ,OAAO,EAAE,KAAK,CAAC,MAAM;gBACrB,OAAO;aACP,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;IAED,0BAA0B;IAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,mBAAmB,GAAG,sBAAsB,EAAE,CAAC;QACrF,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,CAAC;QACxB,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,mBAAmB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAChE,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAExD,IAAI,YAAY,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,GAAG,SAAS,GAAG,CAAC,IAAI,eAAe,EAAE,CAAC;YAClF,MAAM,CAAC,IAAI,CAAC;gBACX,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,IAAI;gBACV,SAAS;gBACT,OAAO;gBACP,OAAO,EAAE,YAAY;aACrB,CAAC,CAAC;QACJ,CAAC;QAED,IAAI,OAAO,IAAI,KAAK,CAAC,MAAM;YAAE,MAAM;IACpC,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vesper/indexing",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@vesper/indexing",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.6.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@modelcontextprotocol/sdk": "^1.12.0",
|