@luci-dev/mcp 0.0.0-stage → 0.5.1
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/LICENSE +21 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +14 -0
- package/dist/bin.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +9 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +29 -0
- package/dist/server.js.map +1 -0
- package/dist/tools.d.ts +43 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +446 -0
- package/dist/tools.js.map +1 -0
- package/package.json +29 -3
- package/README.md +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lucas
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":""}
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
|
+
import { PRODUCT } from '@luci-dev/format';
|
|
4
|
+
import { createServer } from './server.js';
|
|
5
|
+
// stdout carries the protocol, so anything for people goes to stderr
|
|
6
|
+
try {
|
|
7
|
+
await createServer().connect(new StdioServerTransport());
|
|
8
|
+
process.stderr.write(`${PRODUCT.mcpServer} is running on stdio for ${process.cwd()}\n`);
|
|
9
|
+
}
|
|
10
|
+
catch (err) {
|
|
11
|
+
process.stderr.write(`${PRODUCT.mcpServer} failed to start: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,qEAAqE;AACrE,IAAI,CAAC;IACH,MAAM,YAAY,EAAE,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;IACzD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,SAAS,4BAA4B,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC1F,CAAC;AAAC,OAAO,GAAG,EAAE,CAAC;IACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,SAAS,qBAAqB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACpH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACpH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { type ToolDeps } from './tools.js';
|
|
3
|
+
/** This package's version, from its package.json. */
|
|
4
|
+
export declare function serverVersion(): string;
|
|
5
|
+
/** The defaults the `luci-mcp` binary uses: the library plus the user's personal skills, and the current folder. */
|
|
6
|
+
export declare const defaultDeps: (cwd?: string) => ToolDeps;
|
|
7
|
+
/** An MCP server with every Luci tool registered. Connect it to a transport to serve. */
|
|
8
|
+
export declare function createServer(deps?: ToolDeps): McpServer;
|
|
9
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE9D,qDAAqD;AACrD,wBAAgB,aAAa,IAAI,MAAM,CAOtC;AAED,oHAAoH;AACpH,eAAO,MAAM,WAAW,SAAS,MAAM,KAAmB,QAAkE,CAAC;AAE7H,yFAAyF;AACzF,wBAAgB,YAAY,CAAC,IAAI,GAAE,QAAwB,GAAG,SAAS,CAgBtE"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { PRODUCT } from '@luci-dev/format';
|
|
4
|
+
import { SkillRegistry } from '@luci-dev/skills';
|
|
5
|
+
import { TOOLS, handleTool } from './tools.js';
|
|
6
|
+
/** This package's version, from its package.json. */
|
|
7
|
+
export function serverVersion() {
|
|
8
|
+
try {
|
|
9
|
+
const pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
|
|
10
|
+
return typeof pkg.version === 'string' ? pkg.version : '0.0.0';
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return '0.0.0';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/** The defaults the `luci-mcp` binary uses: the library plus the user's personal skills, and the current folder. */
|
|
17
|
+
export const defaultDeps = (cwd = process.cwd()) => ({ registry: new SkillRegistry({ user: true }), cwd });
|
|
18
|
+
/** An MCP server with every Luci tool registered. Connect it to a transport to serve. */
|
|
19
|
+
export function createServer(deps = defaultDeps()) {
|
|
20
|
+
const server = new McpServer({ name: PRODUCT.mcpServer, version: serverVersion() }, {
|
|
21
|
+
capabilities: { tools: {} },
|
|
22
|
+
instructions: `${PRODUCT.name} keeps this project's memory and skills on the user's machine. Start with get_project_context (and get_active_task when resuming). Load skills with load_project_skills only when the task needs them. Tools that write say so; call them only after the user agrees.`
|
|
23
|
+
});
|
|
24
|
+
for (const tool of TOOLS) {
|
|
25
|
+
server.registerTool(tool.name, { description: tool.description, inputSchema: tool.input, annotations: tool.annotations }, async (args) => handleTool(tool.name, args, deps));
|
|
26
|
+
}
|
|
27
|
+
return server;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAiB,MAAM,YAAY,CAAC;AAE9D,qDAAqD;AACrD,MAAM,UAAU,aAAa;IAC3B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAA0B,CAAC;QACtH,OAAO,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IACjE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC;AAED,oHAAoH;AACpH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAG,GAAW,OAAO,CAAC,GAAG,EAAE,EAAY,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,aAAa,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;AAE7H,yFAAyF;AACzF,MAAM,UAAU,YAAY,CAAC,IAAI,GAAa,WAAW,EAAE;IACzD,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B,EAAE,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,EACrD;QACE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QAC3B,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,uQAAuQ;KACrS,CACF,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,CAAC,YAAY,CACjB,IAAI,CAAC,IAAI,EACT,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EACzF,KAAK,EAAE,IAAa,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAC3D,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CodeMap } from '@luci-dev/brain';
|
|
3
|
+
import { type SkillSource } from '@luci-dev/skills';
|
|
4
|
+
export interface ToolDeps {
|
|
5
|
+
/** The skill library: Luci's library plus the user's personal one. */
|
|
6
|
+
registry: SkillSource;
|
|
7
|
+
/** The default project folder when a call gives no projectPath. */
|
|
8
|
+
cwd: string;
|
|
9
|
+
/** The user's Global Brain (default ~/.luci/brain). */
|
|
10
|
+
globalBrainDir?: string;
|
|
11
|
+
/** Makes the code map runner for a project (tests replace it so no real Graphify runs). */
|
|
12
|
+
codeMap?: (projectDir: string) => CodeMap;
|
|
13
|
+
/** How often watch_feedback looks for new notes, in ms (default 1000; tests use less). */
|
|
14
|
+
watchPollMs?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface ToolResult {
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
content: {
|
|
19
|
+
type: 'text';
|
|
20
|
+
text: string;
|
|
21
|
+
}[];
|
|
22
|
+
isError?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface ToolAnnotations {
|
|
25
|
+
readOnlyHint?: boolean;
|
|
26
|
+
destructiveHint?: boolean;
|
|
27
|
+
idempotentHint?: boolean;
|
|
28
|
+
openWorldHint?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface LuciTool {
|
|
31
|
+
name: string;
|
|
32
|
+
description: string;
|
|
33
|
+
input: z.ZodRawShape;
|
|
34
|
+
annotations: ToolAnnotations;
|
|
35
|
+
call(args: unknown, deps: ToolDeps): Promise<ToolResult>;
|
|
36
|
+
}
|
|
37
|
+
/** watch_feedback waits this long by default, and at most this long (v0.2 watch mode). */
|
|
38
|
+
export declare const WATCH_DEFAULT_SECONDS = 120;
|
|
39
|
+
export declare const WATCH_MAX_SECONDS = 600;
|
|
40
|
+
export declare const TOOLS: readonly LuciTool[];
|
|
41
|
+
/** Run one tool. Unknown tools, invalid input and failures come back as error results, never as throws. */
|
|
42
|
+
export declare function handleTool(name: string, args: unknown, deps: ToolDeps): Promise<ToolResult>;
|
|
43
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAEL,OAAO,EAmBR,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAc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O,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAQjG"}
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tools `luci-mcp` serves (B11). Each tool is a name, a description, a Zod input
|
|
3
|
+
* shape and a handler; `handleTool` validates the input and runs the handler, so tests
|
|
4
|
+
* call tools directly without a transport. Tools that write say so in their description
|
|
5
|
+
* and in their annotations, and they never create .luci/ except initialize_project.
|
|
6
|
+
*/
|
|
7
|
+
import fs from 'node:fs';
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { MEMORY_FILES, PROPOSAL_TARGETS, PRODUCT, formatProposal } from '@luci-dev/format';
|
|
11
|
+
import { DETAIL_LEVELS, FEEDBACK_STATUSES, formatFeedbackPrompt, layoutChangeText, sourceText as feedbackSourceText } from '@luci-dev/format/feedback';
|
|
12
|
+
import { buildLayoutTree, compareComponentFiles, formatCheckRun, formatCheckRunWithNotes, formatCompareReport, formatLayoutTree, parseCapture, readComponentFile } from '@luci-dev/format/capture';
|
|
13
|
+
import { CODE_MAP_SETUP_HINT, CodeMap, CheckStore, crawlSite, DesignStore, FeedbackStore, MemoryEngine, detectProject, findProjectRoot, locateGraph, mapFreshness, readGraphStats, initProject, intakeDocs, loadProjectContext, memoryDir, memoryPath, proposeCaptureRule, readActiveTask, startProject } from '@luci-dev/brain';
|
|
14
|
+
import { SkillDiscovery, SkillOrchestrator, addPack, describeTrust, loadPacks, loadProjectSkillsForTask, packReasons, packSkills, removePack, selectSkills, trustLevel, writeCatalog } from '@luci-dev/skills';
|
|
15
|
+
const text = (value) => ({ content: [{ type: 'text', text: value }] });
|
|
16
|
+
const json = (value) => text(JSON.stringify(value, null, 2));
|
|
17
|
+
const error = (message) => ({ isError: true, content: [{ type: 'text', text: message }] });
|
|
18
|
+
const READ = { readOnlyHint: true, openWorldHint: false };
|
|
19
|
+
/** watch_feedback waits this long by default, and at most this long (v0.2 watch mode). */
|
|
20
|
+
export const WATCH_DEFAULT_SECONDS = 120;
|
|
21
|
+
export const WATCH_MAX_SECONDS = 600;
|
|
22
|
+
const WRITE = { readOnlyHint: false, destructiveHint: false, openWorldHint: false };
|
|
23
|
+
function tool(name, description, input, annotations, run) {
|
|
24
|
+
const schema = z.object(input);
|
|
25
|
+
return {
|
|
26
|
+
name,
|
|
27
|
+
description,
|
|
28
|
+
input,
|
|
29
|
+
annotations,
|
|
30
|
+
async call(args, deps) {
|
|
31
|
+
const parsed = schema.safeParse(args ?? {});
|
|
32
|
+
if (!parsed.success)
|
|
33
|
+
return error(`Invalid input for ${name}:\n${z.prettifyError(parsed.error)}`);
|
|
34
|
+
return run(parsed.data, deps);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const projectPath = z.string().optional().describe('Project folder (defaults to the folder the server was started in)');
|
|
39
|
+
const target = (args, deps) => path.resolve(deps.cwd, args.projectPath ?? '.');
|
|
40
|
+
const targetRoot = (args, deps) => findProjectRoot(target(args, deps)).root;
|
|
41
|
+
const notInitialized = (dir) => error(`No ${PRODUCT.projectDir}/ in ${dir}. Ask the user to run \`${PRODUCT.command} init\` there (or call initialize_project once they agree). Nothing was written.`);
|
|
42
|
+
const hasMemory = (dir) => fs.existsSync(memoryDir(findProjectRoot(dir).root));
|
|
43
|
+
const hints = (dir) => {
|
|
44
|
+
if (!fs.existsSync(path.join(dir, 'package.json')))
|
|
45
|
+
return {};
|
|
46
|
+
const info = detectProject(dir);
|
|
47
|
+
return { dependencies: info.dependencies, framework: info.framework };
|
|
48
|
+
};
|
|
49
|
+
const brainOptions = (deps) => (deps.globalBrainDir ? { globalBrainDir: deps.globalBrainDir } : {});
|
|
50
|
+
const brief = (s) => ({ id: s.id, name: s.name, category: s.category, description: s.description, trust: trustLevel(s) });
|
|
51
|
+
const slug = (value) => value.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '').slice(0, 50) || 'proposal';
|
|
52
|
+
const today = () => new Date().toISOString().slice(0, 10);
|
|
53
|
+
export const TOOLS = [
|
|
54
|
+
tool('get_project_context', `Everything ${PRODUCT.name} knows about the project, validated: stack, goal, the project's own rules, commands, the active task, selected skills (short entries, not full text), skill packs, code map and Global Brain location, plus warnings. Call this first when starting work in a project.`, { projectPath }, READ, async (args, deps) => json(await loadProjectContext(target(args, deps), { registry: deps.registry, ...brainOptions(deps) }))),
|
|
55
|
+
tool('get_active_task', `The current task (${PRODUCT.projectDir}/${MEMORY_FILES.activeTask}) while its status is active: the task, which skill files to open and why, and acceptance criteria. Call this when resuming work so the user does not have to brief you again.`, { projectPath }, READ, (args, deps) => {
|
|
56
|
+
const root = targetRoot(args, deps);
|
|
57
|
+
const dir = target(args, deps);
|
|
58
|
+
const task = readActiveTask(dir);
|
|
59
|
+
if (!task)
|
|
60
|
+
return text(`No active task in ${dir}. Ask the user what to work on.`);
|
|
61
|
+
if (task.status !== 'active') {
|
|
62
|
+
return text(`${task.file} has status "${task.status}", so it is not the current task. Ask the user what to work on; \`${PRODUCT.command} task done\` archives it.`);
|
|
63
|
+
}
|
|
64
|
+
return text(fs.readFileSync(path.join(root, task.file), 'utf8'));
|
|
65
|
+
}),
|
|
66
|
+
tool('get_project_status', `Resume a project (like \`${PRODUCT.command} start\`): refreshes the project's summary of the user's Global Brain, then reports the checks, the active task, goal, rules and skills. Writes only the generated summary ${PRODUCT.projectDir}/${MEMORY_FILES.globalBrainSummary}.`, { projectPath }, { ...WRITE, idempotentHint: true }, async (args, deps) => {
|
|
67
|
+
const dir = target(args, deps);
|
|
68
|
+
const report = await startProject(dir, { registry: deps.registry, ...brainOptions(deps) });
|
|
69
|
+
return report.initialized ? json(report) : notInitialized(dir);
|
|
70
|
+
}),
|
|
71
|
+
tool('analyze_project', 'Detect the project from its files: framework, languages, package manager, UI libraries, testing tools, commands and which agents are set up. Reads only.', { projectPath }, READ, (args, deps) => json(detectProject(target(args, deps)))),
|
|
72
|
+
tool('get_project_graph', `The project's code map (Graphify): where it is, its size, and whether code changed since it was built (a stale map can miss recent code; read changed files directly). With update: true it builds or refreshes the map with Graphify if installed, writing only graphify-out/. It never installs anything; \`${PRODUCT.command} map --install\` does, run by the user.`, { projectPath, update: z.boolean().optional().describe('Build or refresh the map (only call after the user agrees; it can take a minute)') }, { ...WRITE, idempotentHint: true }, async (args, deps) => {
|
|
73
|
+
const dir = target(args, deps);
|
|
74
|
+
if (args.update) {
|
|
75
|
+
const result = await (deps.codeMap ?? ((d) => new CodeMap({ projectRoot: d })))(dir).generate({ targetDir: dir, force: true });
|
|
76
|
+
if (result.skipped)
|
|
77
|
+
return error(`${result.summary} Ask the user whether they want it; it is optional.`);
|
|
78
|
+
}
|
|
79
|
+
const paths = locateGraph(dir);
|
|
80
|
+
if (!paths)
|
|
81
|
+
return json({ available: false, hint: CODE_MAP_SETUP_HINT });
|
|
82
|
+
const rel = (p) => path.relative(dir, p).replace(/\\/g, '/');
|
|
83
|
+
return json({
|
|
84
|
+
available: true,
|
|
85
|
+
json: rel(paths.jsonPath),
|
|
86
|
+
report: fs.existsSync(paths.reportPath) ? rel(paths.reportPath) : null,
|
|
87
|
+
...(readGraphStats(paths.jsonPath) ?? { nodeCount: 0, edgeCount: 0 }),
|
|
88
|
+
freshness: mapFreshness(dir)
|
|
89
|
+
});
|
|
90
|
+
}),
|
|
91
|
+
tool('list_skills', `List the skills in the ${PRODUCT.name} library (and the user's personal library), with trust levels.`, { category: z.string().optional().describe('Only skills in this category') }, READ, async (args, deps) => {
|
|
92
|
+
const all = await deps.registry.getAllSkills();
|
|
93
|
+
const skills = args.category ? all.filter(s => s.category === args.category) : all;
|
|
94
|
+
return json(skills.map(s => ({ ...brief(s), author: s.author, frameworks: s.frameworks })));
|
|
95
|
+
}),
|
|
96
|
+
tool('search_skills', 'Search the skill library by relevance to a query.', {
|
|
97
|
+
query: z.string().describe('Search words or a task'),
|
|
98
|
+
category: z.string().optional().describe('Only skills in this category'),
|
|
99
|
+
framework: z.string().optional().describe('Only skills for this framework')
|
|
100
|
+
}, READ, async (args, deps) => {
|
|
101
|
+
const results = await new SkillDiscovery(deps.registry).search(args.query, {
|
|
102
|
+
limit: 10,
|
|
103
|
+
...(args.category ? { category: args.category } : {}),
|
|
104
|
+
...(args.framework ? { framework: args.framework } : {})
|
|
105
|
+
});
|
|
106
|
+
return json(results.map(brief));
|
|
107
|
+
}),
|
|
108
|
+
tool('get_skill', 'One skill by name: its metadata, trust level and full instructions.', { id: z.string().describe('Skill name, e.g. accessibility-baseline') }, READ, async (args, deps) => {
|
|
109
|
+
const skill = await deps.registry.getSkill(args.id);
|
|
110
|
+
if (!skill)
|
|
111
|
+
return error(`Skill not found: ${args.id}. search_skills finds skills by topic.`);
|
|
112
|
+
// `content` is read on demand (not an enumerable field), so it is added explicitly
|
|
113
|
+
return json({ ...skill, trust: trustLevel(skill), trustNote: describeTrust(skill), content: skill.content });
|
|
114
|
+
}),
|
|
115
|
+
tool('recommend_skills', 'The library skills that fit a task, each with the reason it was chosen, and the order to use them in. Returns none when nothing fits. Reads only.', {
|
|
116
|
+
taskPrompt: z.string().describe('The task'),
|
|
117
|
+
framework: z.string().optional().describe('Target framework, e.g. react, nextjs, vue'),
|
|
118
|
+
projectPath
|
|
119
|
+
}, READ, async (args, deps) => {
|
|
120
|
+
const projectHints = hints(target(args, deps));
|
|
121
|
+
return json(await new SkillOrchestrator(deps.registry).recommend(args.taskPrompt, { ...projectHints, ...(args.framework ? { framework: args.framework } : {}) }));
|
|
122
|
+
}),
|
|
123
|
+
tool('load_skills', 'Full instructions of the library skills that closely match a task, within a token budget. Skills that do the same job (e.g. two animation libraries) are not loaded together: the one the project already depends on wins. Returns nothing when no skill fits.', {
|
|
124
|
+
taskPrompt: z.string().describe('The task'),
|
|
125
|
+
projectPath,
|
|
126
|
+
tokenBudget: z.number().int().positive().optional().describe('Max tokens of full skill instructions (default 8000)')
|
|
127
|
+
}, READ, async (args, deps) => {
|
|
128
|
+
const loaded = await new SkillOrchestrator(deps.registry).loadSkillsForTask(args.taskPrompt, hints(target(args, deps)), args.tokenBudget ? { tokenBudget: args.tokenBudget } : {});
|
|
129
|
+
const leftOut = loaded.excludedSkills.length ? `\n## Left out\n${loaded.excludedSkills.map(e => `- ${e.id}: ${e.reason}`).join('\n')}\n` : '';
|
|
130
|
+
return text(loaded.formattedInstructions + leftOut);
|
|
131
|
+
}),
|
|
132
|
+
tool('get_project_skills', `The skills chosen for this project (${PRODUCT.projectDir}/${MEMORY_FILES.skillsLock} and ${PRODUCT.projectDir}/${MEMORY_FILES.skills}/): name, summary, why chosen, size and file path. Does not load full instructions.`, { projectPath }, READ, async (args, deps) => {
|
|
133
|
+
const ctx = await loadProjectContext(target(args, deps), { registry: deps.registry, ...brainOptions(deps) });
|
|
134
|
+
return json({ selected: ctx.skills.selected, project: ctx.skills.project, warnings: ctx.warnings });
|
|
135
|
+
}),
|
|
136
|
+
tool('load_project_skills', 'Full instructions of only those project skills that closely match the current task, within a token budget. Returns nothing when no project skill fits.', {
|
|
137
|
+
taskPrompt: z.string().describe('The task you are about to do'),
|
|
138
|
+
projectPath,
|
|
139
|
+
tokenBudget: z.number().int().positive().optional().describe('Max tokens of full skill instructions (default 8000)')
|
|
140
|
+
}, READ, async (args, deps) => {
|
|
141
|
+
const dir = targetRoot(args, deps);
|
|
142
|
+
if (!hasMemory(dir))
|
|
143
|
+
return notInitialized(dir);
|
|
144
|
+
const loaded = await loadProjectSkillsForTask(dir, deps.registry, args.taskPrompt, args.tokenBudget ? { tokenBudget: args.tokenBudget } : {});
|
|
145
|
+
return text(loaded.formattedInstructions);
|
|
146
|
+
}),
|
|
147
|
+
tool('select_project_skills', `Add library skills to the project (${PRODUCT.projectDir}/${MEMORY_FILES.skillsLock}) and refresh the skill catalog. Only call this after the user agrees to use these skills in the project.`, {
|
|
148
|
+
ids: z.array(z.string()).min(1).describe('Skill names to add'),
|
|
149
|
+
reason: z.string().optional().describe('Why the project needs them'),
|
|
150
|
+
projectPath
|
|
151
|
+
}, WRITE, async (args, deps) => {
|
|
152
|
+
const dir = targetRoot(args, deps);
|
|
153
|
+
if (!hasMemory(dir))
|
|
154
|
+
return notInitialized(dir);
|
|
155
|
+
const result = await selectSkills(dir, deps.registry, args.ids, args.reason ?? '');
|
|
156
|
+
await writeCatalog(dir, deps.registry);
|
|
157
|
+
return json(result);
|
|
158
|
+
}),
|
|
159
|
+
tool('list_skill_packs', 'Skill packs (curated skill sets): which fit this project and why, which are added, and the skills each would add here. Reads only.', { projectPath }, READ, async (args, deps) => {
|
|
160
|
+
const dir = target(args, deps);
|
|
161
|
+
const info = detectProject(dir);
|
|
162
|
+
const ctx = await loadProjectContext(dir, { registry: deps.registry, ...brainOptions(deps) });
|
|
163
|
+
const added = new Set(ctx.packs.added);
|
|
164
|
+
const packs = [];
|
|
165
|
+
for (const pack of loadPacks()) {
|
|
166
|
+
const { skills, missing } = await packSkills(pack, info, deps.registry);
|
|
167
|
+
packs.push({
|
|
168
|
+
name: pack.name,
|
|
169
|
+
title: pack.title,
|
|
170
|
+
description: pack.description,
|
|
171
|
+
added: added.has(pack.name),
|
|
172
|
+
fits: packReasons(pack, info, { projectDir: dir, goal: ctx.goal ?? '' }),
|
|
173
|
+
skills,
|
|
174
|
+
missing
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
return json({ packs });
|
|
178
|
+
}),
|
|
179
|
+
...['add', 'remove'].map(action => tool(`${action}_skill_packs`, action === 'add'
|
|
180
|
+
? `Add skill packs to the project (their skills go to ${PRODUCT.projectDir}/${MEMORY_FILES.skillsLock}, tagged with the pack). Only call this after the user agrees to add these packs.`
|
|
181
|
+
: 'Remove skill packs from the project. Skills another pack still uses, and skills chosen by hand, stay. Only call this after the user agrees.', { names: z.array(z.string()).min(1).describe('Pack names, from list_skill_packs'), projectPath }, action === 'add' ? WRITE : { ...WRITE, destructiveHint: true }, async (args, deps) => {
|
|
182
|
+
const dir = targetRoot(args, deps);
|
|
183
|
+
if (!hasMemory(dir))
|
|
184
|
+
return notInitialized(dir);
|
|
185
|
+
const byName = new Map(loadPacks().map(p => [p.name, p]));
|
|
186
|
+
const unknown = args.names.filter(n => !byName.has(n));
|
|
187
|
+
if (unknown.length)
|
|
188
|
+
return error(`Unknown pack(s): ${unknown.join(', ')}. Packs: ${[...byName.keys()].join(', ')}`);
|
|
189
|
+
const info = detectProject(dir);
|
|
190
|
+
const results = {};
|
|
191
|
+
for (const name of args.names) {
|
|
192
|
+
const pack = byName.get(name);
|
|
193
|
+
results[name] = action === 'add' ? await addPack(dir, deps.registry, pack, info) : removePack(dir, name);
|
|
194
|
+
}
|
|
195
|
+
await writeCatalog(dir, deps.registry);
|
|
196
|
+
return json(results);
|
|
197
|
+
})),
|
|
198
|
+
tool('update_project_memory', `Record a decision the user confirmed as a decision record in ${PRODUCT.projectDir}/${MEMORY_FILES.decisions}/. Only for decisions the user agreed to; for a rule or lesson you would like kept, use propose_memory.`, {
|
|
199
|
+
category: z.string().min(1).describe('Area, e.g. Architecture, Testing, Performance, UI/UX'),
|
|
200
|
+
decision: z.string().min(1).describe('The decision, in one sentence'),
|
|
201
|
+
context: z.string().min(1).describe('Why it was decided'),
|
|
202
|
+
projectPath
|
|
203
|
+
}, WRITE, (args, deps) => {
|
|
204
|
+
const dir = targetRoot(args, deps);
|
|
205
|
+
if (!hasMemory(dir))
|
|
206
|
+
return notInitialized(dir);
|
|
207
|
+
const file = new MemoryEngine(brainOptions(deps)).recordProjectDecision(dir, args);
|
|
208
|
+
return text(`Recorded the decision in ${file}: [${args.category}] ${args.decision}`);
|
|
209
|
+
}),
|
|
210
|
+
tool('propose_memory', `Propose a rule, convention or lesson for the project. It is written to ${PRODUCT.projectDir}/${MEMORY_FILES.proposedMemory}/ for the user to accept or delete; rules.md, context.md and playbook.md are never edited by agents.`, {
|
|
211
|
+
topic: z.string().min(1).describe('A short title'),
|
|
212
|
+
whatHappened: z.string().min(1).describe('The situation that taught this'),
|
|
213
|
+
proposed: z.string().min(1).describe('The rule, convention or note to keep'),
|
|
214
|
+
belongsIn: z.enum(PROPOSAL_TARGETS).describe('Where it would go once accepted'),
|
|
215
|
+
projectPath
|
|
216
|
+
}, WRITE, (args, deps) => {
|
|
217
|
+
const dir = targetRoot(args, deps);
|
|
218
|
+
if (!hasMemory(dir))
|
|
219
|
+
return notInitialized(dir);
|
|
220
|
+
const folder = path.join(memoryDir(dir), MEMORY_FILES.proposedMemory);
|
|
221
|
+
fs.mkdirSync(folder, { recursive: true });
|
|
222
|
+
const base = `${today()}-${slug(args.topic)}`;
|
|
223
|
+
let file = path.join(folder, `${base}.md`);
|
|
224
|
+
for (let n = 2; fs.existsSync(file); n++)
|
|
225
|
+
file = path.join(folder, `${base}-${n}.md`);
|
|
226
|
+
const { projectPath: _ignored, ...proposal } = args;
|
|
227
|
+
fs.writeFileSync(file, formatProposal(proposal), 'utf8');
|
|
228
|
+
const rel = memoryPath(`${MEMORY_FILES.proposedMemory}/${path.basename(file)}`);
|
|
229
|
+
return text(`Proposed in ${rel}. Tell the user it is waiting for their review.`);
|
|
230
|
+
}),
|
|
231
|
+
tool('intake_docs', `Fit a PRD and supporting docs (Markdown or text) into project memory, like \`${PRODUCT.command} intake\`: empty goal, architecture and conventions sections of context.md are filled; candidate rules, non-goals, acceptance criteria, decisions and a pointer to each doc become proposals in ${PRODUCT.projectDir}/${MEMORY_FILES.proposedMemory}/ for the user to review. Nothing a person wrote is replaced. Only call this after the user agrees; use dryRun to show the plan first.`, {
|
|
232
|
+
files: z.array(z.string()).min(1).describe('Doc paths, relative to the project or absolute'),
|
|
233
|
+
dryRun: z.boolean().optional().describe('Report what would be written; write nothing'),
|
|
234
|
+
projectPath
|
|
235
|
+
}, WRITE, (args, deps) => {
|
|
236
|
+
const dir = target(args, deps);
|
|
237
|
+
if (!hasMemory(dir))
|
|
238
|
+
return notInitialized(dir);
|
|
239
|
+
const report = intakeDocs(dir, args.files, { dryRun: Boolean(args.dryRun) });
|
|
240
|
+
return report.docs.length ? json(report) : error(`No doc could be read:\n${report.errors.join('\n')}`);
|
|
241
|
+
}),
|
|
242
|
+
tool('initialize_project', `Set the project up with ${PRODUCT.name}: create ${PRODUCT.projectDir}/ (memory, starter skills, skill catalog) and the ${PRODUCT.name} section of each agent's instruction file; files someone edited are kept. Only call this after the user agrees. Use dryRun to show what would be written.`, { projectPath, dryRun: z.boolean().optional().describe('Report what would be written; write nothing') }, WRITE, async (args, deps) => json(await initProject(target(args, deps), { registry: deps.registry, dryRun: Boolean(args.dryRun), ...brainOptions(deps) }))),
|
|
243
|
+
tool('get_global_brain', "The user's Global Brain: their confirmed preferences, design principles and coding standards across all projects, by file. Creates it from the defaults the first time; never changes a file the user has.", {}, { ...WRITE, idempotentHint: true }, (_args, deps) => json(new MemoryEngine(brainOptions(deps)).getGlobalBrain())),
|
|
244
|
+
// Feedback (FR30, changed 13 Nov 2026 at the user's request: read only; the person marks notes done
|
|
245
|
+
// in the toolbar, no agent writes them)
|
|
246
|
+
tool('list_feedback', `UI feedback notes the person left on their running app with Luci's dev toolbar (${PRODUCT.projectDir}/${MEMORY_FILES.feedback}/). By default the ones not done yet, each with its ID (P2-A3), comment, intent, priority, selector, text, source file, components and any layout steps. Reads only: the person marks notes done themselves.`, {
|
|
247
|
+
status: z.enum(['open', 'all', ...FEEDBACK_STATUSES]).optional().describe('Which items: "open" (default), "all", or one status'),
|
|
248
|
+
projectPath
|
|
249
|
+
}, READ, (args, deps) => {
|
|
250
|
+
const store = new FeedbackStore(targetRoot(args, deps));
|
|
251
|
+
if (!store.available)
|
|
252
|
+
return notInitialized(store.projectDir);
|
|
253
|
+
const which = args.status ?? 'open';
|
|
254
|
+
const items = which === 'all' ? store.list() : which === 'open' ? store.open() : store.list({ status: [which] });
|
|
255
|
+
if (!items.length)
|
|
256
|
+
return text(which === 'open' ? 'No open feedback. The person can add some with the dev toolbar.' : `No feedback items with status "${which}".`);
|
|
257
|
+
return json(items.map(feedbackBrief));
|
|
258
|
+
}),
|
|
259
|
+
tool('get_feedback_prompt', `The UI feedback notes not done yet as one page-grouped prompt: every note with its ID, grouped by page with route and source file, and how to report when done. Work through every page and report every ID in your answer; the person checks your work and marks notes done in their toolbar. Reads only.`, {
|
|
260
|
+
detail: z.enum(DETAIL_LEVELS).optional().describe('compact: selector and text; standard (default): + source file and components; detailed: + computed styles'),
|
|
261
|
+
projectPath
|
|
262
|
+
}, READ, (args, deps) => {
|
|
263
|
+
const store = new FeedbackStore(targetRoot(args, deps));
|
|
264
|
+
if (!store.available)
|
|
265
|
+
return notInitialized(store.projectDir);
|
|
266
|
+
const items = store.open();
|
|
267
|
+
if (!items.length)
|
|
268
|
+
return text('No open feedback. The person can add some with the dev toolbar.');
|
|
269
|
+
return text(formatFeedbackPrompt(items, { detail: args.detail ?? 'standard' }));
|
|
270
|
+
}),
|
|
271
|
+
tool('watch_feedback', `Watch mode: wait while the person leaves new UI feedback notes with the dev toolbar, then return the new ones as one page-grouped prompt, as soon as there are any. Waits up to \`seconds\` (default ${WATCH_DEFAULT_SECONDS}, at most ${WATCH_MAX_SECONDS}); when nothing comes it says so, and you call it again to keep watching. Pass \`since\` from the previous answer so no note is missed or repeated. Apply each batch, report its IDs, then watch again. Reads only.`, {
|
|
272
|
+
seconds: z.number().int().min(1).max(WATCH_MAX_SECONDS).optional().describe(`How long to wait for new notes (default ${WATCH_DEFAULT_SECONDS})`),
|
|
273
|
+
since: z.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/).optional().describe('Only notes added after this time (ISO, UTC), as the previous answer gives it; default: from now'),
|
|
274
|
+
detail: z.enum(DETAIL_LEVELS).optional().describe('compact, standard (default) or detailed'),
|
|
275
|
+
projectPath
|
|
276
|
+
}, READ, async (args, deps) => {
|
|
277
|
+
const store = new FeedbackStore(targetRoot(args, deps));
|
|
278
|
+
if (!store.available)
|
|
279
|
+
return notInitialized(store.projectDir);
|
|
280
|
+
const since = args.since ?? new Date().toISOString();
|
|
281
|
+
const seconds = args.seconds ?? WATCH_DEFAULT_SECONDS;
|
|
282
|
+
const deadline = Date.now() + seconds * 1000;
|
|
283
|
+
const poll = deps.watchPollMs ?? 1000;
|
|
284
|
+
for (;;) {
|
|
285
|
+
// New notes not copied or done yet; their files are written whole, so a read never sees half a note
|
|
286
|
+
const fresh = store.list({ status: ['pending'] }).filter(i => i.createdAt > since);
|
|
287
|
+
if (fresh.length) {
|
|
288
|
+
const next = fresh.reduce((m, i) => (i.createdAt > m ? i.createdAt : m), since);
|
|
289
|
+
return text(`${formatFeedbackPrompt(fresh, { detail: args.detail ?? 'standard' })}\nWatching: after this, call watch_feedback again with since "${next}" for the next notes.\n`);
|
|
290
|
+
}
|
|
291
|
+
const left = deadline - Date.now();
|
|
292
|
+
if (left <= 0)
|
|
293
|
+
return text(`No new feedback notes in ${seconds} second${seconds === 1 ? '' : 's'}. Call watch_feedback again with since "${since}" to keep watching.`);
|
|
294
|
+
await new Promise(r => setTimeout(r, Math.min(poll, left)));
|
|
295
|
+
}
|
|
296
|
+
}),
|
|
297
|
+
// Design captures saved from the toolbar into the project
|
|
298
|
+
tool('list_captures', `Design captures saved into this project (${PRODUCT.projectDir}/${MEMORY_FILES.design}/): components, text, colors, spacing, systems, whole pages and basket exports, measured from live pages, and the project's own design baseline (project.system.typography/color/spacing.design.md, method authored: the values and tokens its stylesheets already have; reuse them). Read one with get_capture before building or restyling UI it describes. Reads only.`, { projectPath }, READ, (args, deps) => {
|
|
299
|
+
const store = new DesignStore(targetRoot(args, deps));
|
|
300
|
+
if (!store.available)
|
|
301
|
+
return notInitialized(store.projectDir);
|
|
302
|
+
const files = store.list();
|
|
303
|
+
return files.length ? json(files) : text('No design captures saved in this project yet.');
|
|
304
|
+
}),
|
|
305
|
+
tool('get_capture', 'One saved design capture (a .design.md file from list_captures), as written. Use its values, tokens, states and image slots as the reference; the "Your instructions" section, when present, is the person\'s own request.', { file: z.string().min(1).describe('File name from list_captures, e.g. example-com.component.card.design.md'), projectPath }, READ, (args, deps) => {
|
|
306
|
+
const store = new DesignStore(targetRoot(args, deps));
|
|
307
|
+
if (!store.available)
|
|
308
|
+
return notInitialized(store.projectDir);
|
|
309
|
+
const content = store.read(args.file);
|
|
310
|
+
return content === null ? error(`No capture named ${args.file}. list_captures shows the saved ones.`) : text(content);
|
|
311
|
+
}),
|
|
312
|
+
tool('get_design_checks', `The latest design checks from the dev toolbar (v0.4, automatic design check): each built component checked against its design file, re-checked by the toolbar whenever the page changes (after your edits reload it), with every difference left. Use it after changing a component the person is checking, to see whether it now matches; when differences remain, fix them and read this again. Reads only (${PRODUCT.projectDir}/${MEMORY_FILES.design}/checks.json).`, { projectPath }, READ, (args, deps) => {
|
|
313
|
+
const root = targetRoot(args, deps);
|
|
314
|
+
const store = new CheckStore(root);
|
|
315
|
+
if (!store.available)
|
|
316
|
+
return notInitialized(store.projectDir);
|
|
317
|
+
const runs = store.list();
|
|
318
|
+
if (!runs.length)
|
|
319
|
+
return text('No design checks yet. The person runs one with the dev toolbar (Capture, Check), and the toolbar sends each run here.');
|
|
320
|
+
const feedback = new FeedbackStore(root);
|
|
321
|
+
const openNotes = feedback.available ? feedback.open().filter(i => i.check) : [];
|
|
322
|
+
return text(`# Design checks: ${runs.length}\n\n${runs.map(r => formatCheckRunWithNotes(r, openNotes)).join('\n\n')}\n`);
|
|
323
|
+
}),
|
|
324
|
+
tool('compare_captures', 'Compare two saved component captures (from list_captures), part by part: parts, styles, state changes, motion and accessibility. Returns every value that differs as a table (What, A, B), values compared by meaning (any color notation, lengths within half a pixel). Reads only.', {
|
|
325
|
+
a: z.string().min(1).describe('First component capture, e.g. example-com.component.button.design.md'),
|
|
326
|
+
b: z.string().min(1).describe('Second component capture'),
|
|
327
|
+
projectPath
|
|
328
|
+
}, READ, (args, deps) => {
|
|
329
|
+
const store = new DesignStore(targetRoot(args, deps));
|
|
330
|
+
if (!store.available)
|
|
331
|
+
return notInitialized(store.projectDir);
|
|
332
|
+
const [a, b] = [store.read(args.a), store.read(args.b)];
|
|
333
|
+
if (a === null || b === null)
|
|
334
|
+
return error(`No capture named ${a === null ? args.a : args.b}. list_captures shows the saved ones.`);
|
|
335
|
+
const result = compareComponentFiles(a, b);
|
|
336
|
+
return result.ok ? text(formatCompareReport(result.value, { a: args.a, b: args.b })) : error(result.error);
|
|
337
|
+
}),
|
|
338
|
+
tool('get_layout_tree', 'Get the computed hierarchical layout tree of a saved component or section capture (from list_captures). Returns the parent/child flex and grid layout relationships, directions, alignment, and gaps as a formatted tree outline. Reads only.', {
|
|
339
|
+
file: z.string().min(1).describe('A component or section capture file name, e.g. example-com.component.card.design.md'),
|
|
340
|
+
projectPath
|
|
341
|
+
}, READ, (args, deps) => {
|
|
342
|
+
const store = new DesignStore(targetRoot(args, deps));
|
|
343
|
+
if (!store.available)
|
|
344
|
+
return notInitialized(store.projectDir);
|
|
345
|
+
const content = store.read(args.file);
|
|
346
|
+
if (content === null)
|
|
347
|
+
return error(`No capture named ${args.file}. list_captures shows the saved ones.`);
|
|
348
|
+
const parsed = parseCapture(content);
|
|
349
|
+
if (!parsed.ok)
|
|
350
|
+
return error(`Could not parse ${args.file}: ${parsed.error}`);
|
|
351
|
+
if (parsed.value.meta.scope !== 'component' && parsed.value.meta.scope !== 'section') {
|
|
352
|
+
return error(`${args.file} is a ${parsed.value.meta.scope} capture; only components and sections have a layout tree.`);
|
|
353
|
+
}
|
|
354
|
+
if (parsed.value.sections['Layout Tree']) {
|
|
355
|
+
return text(`# Layout Tree: ${args.file}\n\n${parsed.value.sections['Layout Tree']}`);
|
|
356
|
+
}
|
|
357
|
+
const comp = readComponentFile(content);
|
|
358
|
+
if (comp.ok) {
|
|
359
|
+
const tree = buildLayoutTree(comp.value.parts.map((p, i) => ({
|
|
360
|
+
part: p.part,
|
|
361
|
+
element: p.element,
|
|
362
|
+
depth: i === 0 ? 0 : 1
|
|
363
|
+
})));
|
|
364
|
+
if (tree)
|
|
365
|
+
return text(`# Layout Tree: ${args.file}\n\n${formatLayoutTree(tree)}`);
|
|
366
|
+
}
|
|
367
|
+
return text(`No layout tree found in ${args.file}.`);
|
|
368
|
+
}),
|
|
369
|
+
tool('propose_capture_rule', `Propose a project rule from a saved component capture: one line for rules.md ("Build every primary button like ${PRODUCT.projectDir}/${MEMORY_FILES.design}/<file>: ...") with its key values and state changes, written to ${PRODUCT.projectDir}/${MEMORY_FILES.proposedMemory}/ for the user to accept or delete. rules.md is never edited. Only when the user asks to make a capture a rule.`, { file: z.string().min(1).describe('A component capture from list_captures, e.g. example-com.component.primary-button.design.md'), projectPath }, WRITE, (args, deps) => {
|
|
370
|
+
const dir = targetRoot(args, deps);
|
|
371
|
+
if (!hasMemory(dir))
|
|
372
|
+
return notInitialized(dir);
|
|
373
|
+
try {
|
|
374
|
+
const rule = proposeCaptureRule(dir, args.file);
|
|
375
|
+
return text(`${rule.existed ? 'Already waiting for review' : 'Proposed'} in ${rule.path}:\n${rule.proposal.proposed}\nTell the user it is waiting for their review: they keep it by moving the line into rules.md.`);
|
|
376
|
+
}
|
|
377
|
+
catch (err) {
|
|
378
|
+
return error(err instanceof Error ? err.message : String(err));
|
|
379
|
+
}
|
|
380
|
+
}),
|
|
381
|
+
tool('crawl_site_design', 'Crawl a list of routes or URLs of a site in one pass, extract typography, color and spacing systems from each page, and merge them into a unified site-level design system. Saves site systems into .luci/design/ and writes root DESIGN.md when stitch is true.', {
|
|
382
|
+
urls: z.array(z.string().min(1)).min(1).describe('URLs or routes to crawl, e.g. ["http://localhost:3000/", "/pricing", "/blog"]'),
|
|
383
|
+
base: z.string().optional().describe('Base URL if relative routes are given, e.g. "http://localhost:3000"'),
|
|
384
|
+
stitch: z.boolean().optional().describe('Write root DESIGN.md in Google Stitch format (default: true)'),
|
|
385
|
+
projectPath
|
|
386
|
+
}, WRITE, async (args, deps) => {
|
|
387
|
+
const root = targetRoot(args, deps);
|
|
388
|
+
if (!hasMemory(root))
|
|
389
|
+
return notInitialized(root);
|
|
390
|
+
try {
|
|
391
|
+
const res = await crawlSite({
|
|
392
|
+
urls: args.urls,
|
|
393
|
+
base: args.base,
|
|
394
|
+
stitch: args.stitch ?? true,
|
|
395
|
+
projectRoot: root
|
|
396
|
+
});
|
|
397
|
+
const summary = [
|
|
398
|
+
`Crawled ${res.crawled.filter(c => !c.error).length} of ${res.pages.length} pages of ${res.site}:`,
|
|
399
|
+
res.typography ? ` Typography: ${res.typography.roles.length} roles, ${res.typography.families.length} families` : null,
|
|
400
|
+
res.color ? ` Color: ${res.color.roles.length} roles, ${res.color.tokens.length} tokens` : null,
|
|
401
|
+
res.spacing ? ` Spacing: ${res.spacing.scale.length} scale values${res.spacing.baseUnit ? `, base unit ${res.spacing.baseUnit.px}px` : ''}` : null,
|
|
402
|
+
res.conflicts.length ? `\nConflicts across pages (${res.conflicts.length}):\n${res.conflicts.map(c => ` - [${c.type}] ${c.conflict.what}`).join('\n')}` : null,
|
|
403
|
+
res.written.length ? `\nSaved:\n${res.written.map(w => ` ${w}`).join('\n')}` : null
|
|
404
|
+
].filter(Boolean).join('\n');
|
|
405
|
+
return text(summary);
|
|
406
|
+
}
|
|
407
|
+
catch (err) {
|
|
408
|
+
return error(err instanceof Error ? err.message : String(err));
|
|
409
|
+
}
|
|
410
|
+
})
|
|
411
|
+
];
|
|
412
|
+
/** What an agent needs of an item to act on it. */
|
|
413
|
+
function feedbackBrief(i) {
|
|
414
|
+
return {
|
|
415
|
+
id: i.ref,
|
|
416
|
+
status: i.status,
|
|
417
|
+
page: i.page.route,
|
|
418
|
+
...(i.page.source ? { pageSource: i.page.source } : {}),
|
|
419
|
+
intent: i.intent,
|
|
420
|
+
priority: i.priority,
|
|
421
|
+
comment: i.comment,
|
|
422
|
+
selector: i.target.selector,
|
|
423
|
+
element: i.target.element,
|
|
424
|
+
...(i.target.text ? { text: i.target.text } : {}),
|
|
425
|
+
...(i.target.selectedText ? { selectedText: i.target.selectedText } : {}),
|
|
426
|
+
...(i.target.source ? { source: feedbackSourceText(i.target.source) } : {}),
|
|
427
|
+
...(i.target.components?.length ? { components: i.target.components.join(' > ') } : {}),
|
|
428
|
+
...(i.layout ? { layout: { plannedAtWidth: i.layout.viewport.width, changes: i.layout.changes.map(layoutChangeText) } } : {}),
|
|
429
|
+
...(i.thread.length ? { thread: i.thread.map(m => `${m.from}: ${m.text}`) } : {}),
|
|
430
|
+
...(i.resolution ? { resolution: i.resolution } : {})
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
const BY_NAME = new Map(TOOLS.map(t => [t.name, t]));
|
|
434
|
+
/** Run one tool. Unknown tools, invalid input and failures come back as error results, never as throws. */
|
|
435
|
+
export async function handleTool(name, args, deps) {
|
|
436
|
+
const found = BY_NAME.get(name);
|
|
437
|
+
if (!found)
|
|
438
|
+
return error(`Unknown tool: ${name}. Tools: ${TOOLS.map(t => t.name).join(', ')}`);
|
|
439
|
+
try {
|
|
440
|
+
return await found.call(args, deps);
|
|
441
|
+
}
|
|
442
|
+
catch (err) {
|
|
443
|
+
return error(`${name} failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,UAAU,IAAI,kBAAkB,EAAqB,MAAM,2BAA2B,CAAC;AAC1K,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,cAAc,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,YAA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AC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACtF,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luci-dev/mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "The Luci MCP server (luci-mcp): project memory and skills for agents over stdio. Local only.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=18"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"luci-mcp": "./dist/bin.js"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@luci-dev/brain": "0.5.1",
|
|
24
|
+
"@luci-dev/format": "0.5.1",
|
|
25
|
+
"@luci-dev/skills": "0.5.1",
|
|
26
|
+
"@modelcontextprotocol/sdk": "1.32.2",
|
|
27
|
+
"zod": "4.6.7"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
}
|
|
6
32
|
}
|
package/README.md
DELETED