nodebench-mcp 2.28.0 → 2.31.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 +86 -0
- package/dist/db.js +69 -0
- package/dist/db.js.map +1 -1
- package/dist/engine/conformance.d.ts +31 -0
- package/dist/engine/conformance.js +81 -0
- package/dist/engine/conformance.js.map +1 -0
- package/dist/engine/contextBridge.d.ts +67 -0
- package/dist/engine/contextBridge.js +392 -0
- package/dist/engine/contextBridge.js.map +1 -0
- package/dist/engine/server.d.ts +23 -0
- package/dist/engine/server.js +481 -0
- package/dist/engine/server.js.map +1 -0
- package/dist/engine/session.d.ts +55 -0
- package/dist/engine/session.js +139 -0
- package/dist/engine/session.js.map +1 -0
- package/dist/index.js +113 -11
- package/dist/index.js.map +1 -1
- package/dist/sandboxApi.d.ts +20 -0
- package/dist/sandboxApi.js +99 -0
- package/dist/sandboxApi.js.map +1 -0
- package/dist/tools/contextSandboxTools.d.ts +15 -0
- package/dist/tools/contextSandboxTools.js +469 -0
- package/dist/tools/contextSandboxTools.js.map +1 -0
- package/dist/tools/contextTools.d.ts +11 -0
- package/dist/tools/contextTools.js +175 -0
- package/dist/tools/contextTools.js.map +1 -0
- package/dist/tools/designGovernanceTools.d.ts +20 -0
- package/dist/tools/designGovernanceTools.js +872 -0
- package/dist/tools/designGovernanceTools.js.map +1 -0
- package/dist/tools/openclawTools.d.ts +1 -0
- package/dist/tools/openclawTools.js +780 -0
- package/dist/tools/openclawTools.js.map +1 -1
- package/dist/tools/progressiveDiscoveryTools.js +3 -3
- package/dist/tools/progressiveDiscoveryTools.js.map +1 -1
- package/dist/tools/researchOptimizerTools.d.ts +17 -0
- package/dist/tools/researchOptimizerTools.js +454 -0
- package/dist/tools/researchOptimizerTools.js.map +1 -0
- package/dist/tools/scraplingTools.d.ts +15 -0
- package/dist/tools/scraplingTools.js +278 -0
- package/dist/tools/scraplingTools.js.map +1 -0
- package/dist/tools/thompsonProtocolTools.d.ts +58 -0
- package/dist/tools/thompsonProtocolTools.js +864 -0
- package/dist/tools/thompsonProtocolTools.js.map +1 -0
- package/dist/tools/toolRegistry.js +625 -0
- package/dist/tools/toolRegistry.js.map +1 -1
- package/dist/toolsetRegistry.js +14 -0
- package/dist/toolsetRegistry.js.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Engine Context Tools — MCP tools for querying accumulated engine knowledge.
|
|
3
|
+
*
|
|
4
|
+
* 4 tools in the `engine_context` domain:
|
|
5
|
+
* - get_engine_context_health: Overall health of accumulated knowledge
|
|
6
|
+
* - get_workflow_history: Past runs with scores for a given workflow
|
|
7
|
+
* - archive_content: Save content to archive (prevents repetition)
|
|
8
|
+
* - search_content_archive: FTS5 search past content by theme/title
|
|
9
|
+
*/
|
|
10
|
+
import { getContextHealth, getWorkflowHistory, archiveContent, searchContentArchive, } from "../engine/contextBridge.js";
|
|
11
|
+
export const contextTools = [
|
|
12
|
+
// ── get_engine_context_health ──────────────────────────────────────
|
|
13
|
+
{
|
|
14
|
+
name: "get_engine_context_health",
|
|
15
|
+
description: "Returns accumulated knowledge health: learnings count + freshness, conformance trend direction (improving/stable/regressing), recent run scores, content archive size, and workflow coverage. Use to understand how much context the engine has built up over time.",
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {},
|
|
19
|
+
},
|
|
20
|
+
handler: async () => {
|
|
21
|
+
try {
|
|
22
|
+
const health = getContextHealth();
|
|
23
|
+
return {
|
|
24
|
+
...health,
|
|
25
|
+
_hint: health.learningsCount === 0
|
|
26
|
+
? "No learnings recorded yet. Run workflows via the engine to accumulate context."
|
|
27
|
+
: `${health.learningsCount} learnings accumulated. Trend: ${health.trendDirection}.`,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
return { error: err.message ?? String(err), _hint: "Context tables may not exist yet. Start the engine to initialize." };
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
// ── get_workflow_history ───────────────────────────────────────────
|
|
36
|
+
{
|
|
37
|
+
name: "get_workflow_history",
|
|
38
|
+
description: "Returns past runs for a specific workflow with scores, grades, step counts, and durations. Use to track conformance improvements over time and identify regression patterns.",
|
|
39
|
+
inputSchema: {
|
|
40
|
+
type: "object",
|
|
41
|
+
properties: {
|
|
42
|
+
workflow: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "Workflow name (e.g., 'content_pipeline', 'fix_bug', 'new_feature')",
|
|
45
|
+
},
|
|
46
|
+
limit: {
|
|
47
|
+
type: "number",
|
|
48
|
+
description: "Max results to return (default: 10)",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
required: ["workflow"],
|
|
52
|
+
},
|
|
53
|
+
handler: async (args) => {
|
|
54
|
+
const workflow = String(args.workflow ?? "");
|
|
55
|
+
if (!workflow)
|
|
56
|
+
return { error: "workflow is required" };
|
|
57
|
+
const limit = typeof args.limit === "number" ? args.limit : 10;
|
|
58
|
+
try {
|
|
59
|
+
const history = getWorkflowHistory(workflow, limit);
|
|
60
|
+
return {
|
|
61
|
+
workflow,
|
|
62
|
+
runs: history,
|
|
63
|
+
totalRuns: history.length,
|
|
64
|
+
_hint: history.length === 0
|
|
65
|
+
? `No runs found for "${workflow}". Run this workflow via the engine API to start tracking.`
|
|
66
|
+
: `${history.length} runs found. Latest score: ${history[0].score} (${history[0].grade}).`,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
return { error: err.message ?? String(err) };
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
// ── archive_content ───────────────────────────────────────────────
|
|
75
|
+
{
|
|
76
|
+
name: "archive_content",
|
|
77
|
+
description: "Save generated content to the archive for deduplication and theme tracking. Prevents the engine from regenerating similar content. Supports digest, post, report, and brief content types.",
|
|
78
|
+
inputSchema: {
|
|
79
|
+
type: "object",
|
|
80
|
+
properties: {
|
|
81
|
+
title: {
|
|
82
|
+
type: "string",
|
|
83
|
+
description: "Content title",
|
|
84
|
+
},
|
|
85
|
+
content_type: {
|
|
86
|
+
type: "string",
|
|
87
|
+
enum: ["digest", "post", "report", "brief"],
|
|
88
|
+
description: "Type of content",
|
|
89
|
+
},
|
|
90
|
+
digest: {
|
|
91
|
+
type: "string",
|
|
92
|
+
description: "Short summary/digest of the content",
|
|
93
|
+
},
|
|
94
|
+
themes: {
|
|
95
|
+
type: "array",
|
|
96
|
+
items: { type: "string" },
|
|
97
|
+
description: "Themes/topics covered (for deduplication)",
|
|
98
|
+
},
|
|
99
|
+
workflow: {
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "Workflow that generated this content (optional)",
|
|
102
|
+
},
|
|
103
|
+
full_content: {
|
|
104
|
+
type: "string",
|
|
105
|
+
description: "Full content body (optional, for storage)",
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
required: ["title", "content_type", "digest", "themes"],
|
|
109
|
+
},
|
|
110
|
+
handler: async (args) => {
|
|
111
|
+
const title = String(args.title ?? "");
|
|
112
|
+
const contentType = String(args.content_type ?? "");
|
|
113
|
+
const digest = String(args.digest ?? "");
|
|
114
|
+
const themes = Array.isArray(args.themes) ? args.themes.map(String) : [];
|
|
115
|
+
if (!title || !contentType || !digest) {
|
|
116
|
+
return { error: "title, content_type, and digest are required" };
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
archiveContent(title, contentType, digest, themes, args.workflow ? String(args.workflow) : undefined, args.full_content ? String(args.full_content) : undefined);
|
|
120
|
+
return {
|
|
121
|
+
archived: true,
|
|
122
|
+
title,
|
|
123
|
+
contentType,
|
|
124
|
+
themeCount: themes.length,
|
|
125
|
+
_hint: "Content archived. Future workflows will see these themes to avoid repetition.",
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
return { error: err.message ?? String(err) };
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
// ── search_content_archive ────────────────────────────────────────
|
|
134
|
+
{
|
|
135
|
+
name: "search_content_archive",
|
|
136
|
+
description: "Search past content by theme, title, or keywords using FTS5 full-text search. Use before generating new content to check what's already been covered and avoid repetition.",
|
|
137
|
+
inputSchema: {
|
|
138
|
+
type: "object",
|
|
139
|
+
properties: {
|
|
140
|
+
query: {
|
|
141
|
+
type: "string",
|
|
142
|
+
description: "Search query (FTS5 syntax supported, or plain keywords)",
|
|
143
|
+
},
|
|
144
|
+
content_type: {
|
|
145
|
+
type: "string",
|
|
146
|
+
enum: ["digest", "post", "report", "brief"],
|
|
147
|
+
description: "Filter by content type (optional)",
|
|
148
|
+
},
|
|
149
|
+
limit: {
|
|
150
|
+
type: "number",
|
|
151
|
+
description: "Max results (default: 10)",
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
handler: async (args) => {
|
|
156
|
+
const query = String(args.query ?? "");
|
|
157
|
+
const contentType = args.content_type ? String(args.content_type) : undefined;
|
|
158
|
+
const limit = typeof args.limit === "number" ? args.limit : 10;
|
|
159
|
+
try {
|
|
160
|
+
const results = searchContentArchive(query, contentType, limit);
|
|
161
|
+
return {
|
|
162
|
+
results,
|
|
163
|
+
totalFound: results.length,
|
|
164
|
+
_hint: results.length === 0
|
|
165
|
+
? "No matching content found. This topic hasn't been covered yet."
|
|
166
|
+
: `Found ${results.length} matching items. Check themes to avoid overlap.`,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
catch (err) {
|
|
170
|
+
return { error: err.message ?? String(err) };
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
];
|
|
175
|
+
//# sourceMappingURL=contextTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextTools.js","sourceRoot":"","sources":["../../src/tools/contextTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EACL,gBAAgB,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P,UAAU,EAAE,OAAO,CAAC,MAAM;oBAC1B,KAAK,EAAE,OAAO,CAAC,MAAM,KAAK,CAAC;wBACzB,CAAC,CAAC,gEAAgE;wBAClE,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,iDAAiD;iBAC7E,CAAC;YACJ,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAClB,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/C,CAAC;QACH,CAAC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design Governance Tools — Automated design spec enforcement for MCP agents.
|
|
3
|
+
*
|
|
4
|
+
* Provides three tools for agents to query the design system spec, check
|
|
5
|
+
* individual files for compliance, and scan an entire src/ tree for violations.
|
|
6
|
+
*
|
|
7
|
+
* Patterns are inlined (not imported from the frontend src/ directory) because
|
|
8
|
+
* this is a CommonJS-ish Node.js MCP server that can't reach into the
|
|
9
|
+
* frontend build. The canonical source of truth is:
|
|
10
|
+
* - src/design-governance/defaultSpec.ts
|
|
11
|
+
* - scripts/ui/designLinter.mjs
|
|
12
|
+
* Keep this file in sync when updating banned patterns.
|
|
13
|
+
*
|
|
14
|
+
* 3 tools:
|
|
15
|
+
* - get_design_spec: Return the full governance spec as structured JSON
|
|
16
|
+
* - check_design_compliance: Lint a single file for violations
|
|
17
|
+
* - get_design_violations: Scan entire src/ tree, grouped + sorted
|
|
18
|
+
*/
|
|
19
|
+
import type { McpTool } from "../types.js";
|
|
20
|
+
export declare const designGovernanceTools: McpTool[];
|