nodebench-mcp 1.0.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.
Files changed (65) hide show
  1. package/README.md +237 -0
  2. package/dist/__tests__/tools.test.d.ts +1 -0
  3. package/dist/__tests__/tools.test.js +402 -0
  4. package/dist/__tests__/tools.test.js.map +1 -0
  5. package/dist/db.d.ts +4 -0
  6. package/dist/db.js +198 -0
  7. package/dist/db.js.map +1 -0
  8. package/dist/index.d.ts +19 -0
  9. package/dist/index.js +237 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/tools/documentTools.d.ts +5 -0
  12. package/dist/tools/documentTools.js +524 -0
  13. package/dist/tools/documentTools.js.map +1 -0
  14. package/dist/tools/documentationTools.d.ts +12 -0
  15. package/dist/tools/documentationTools.js +647 -0
  16. package/dist/tools/documentationTools.js.map +1 -0
  17. package/dist/tools/evalTools.d.ts +6 -0
  18. package/dist/tools/evalTools.js +335 -0
  19. package/dist/tools/evalTools.js.map +1 -0
  20. package/dist/tools/financialTools.d.ts +10 -0
  21. package/dist/tools/financialTools.js +403 -0
  22. package/dist/tools/financialTools.js.map +1 -0
  23. package/dist/tools/flywheelTools.d.ts +6 -0
  24. package/dist/tools/flywheelTools.js +366 -0
  25. package/dist/tools/flywheelTools.js.map +1 -0
  26. package/dist/tools/githubTools.d.ts +12 -0
  27. package/dist/tools/githubTools.js +432 -0
  28. package/dist/tools/githubTools.js.map +1 -0
  29. package/dist/tools/learningTools.d.ts +6 -0
  30. package/dist/tools/learningTools.js +199 -0
  31. package/dist/tools/learningTools.js.map +1 -0
  32. package/dist/tools/memoryTools.d.ts +5 -0
  33. package/dist/tools/memoryTools.js +137 -0
  34. package/dist/tools/memoryTools.js.map +1 -0
  35. package/dist/tools/metaTools.d.ts +7 -0
  36. package/dist/tools/metaTools.js +837 -0
  37. package/dist/tools/metaTools.js.map +1 -0
  38. package/dist/tools/planningTools.d.ts +5 -0
  39. package/dist/tools/planningTools.js +147 -0
  40. package/dist/tools/planningTools.js.map +1 -0
  41. package/dist/tools/qualityGateTools.d.ts +6 -0
  42. package/dist/tools/qualityGateTools.js +347 -0
  43. package/dist/tools/qualityGateTools.js.map +1 -0
  44. package/dist/tools/reconTools.d.ts +8 -0
  45. package/dist/tools/reconTools.js +729 -0
  46. package/dist/tools/reconTools.js.map +1 -0
  47. package/dist/tools/searchTools.d.ts +5 -0
  48. package/dist/tools/searchTools.js +145 -0
  49. package/dist/tools/searchTools.js.map +1 -0
  50. package/dist/tools/uiCaptureTools.d.ts +8 -0
  51. package/dist/tools/uiCaptureTools.js +339 -0
  52. package/dist/tools/uiCaptureTools.js.map +1 -0
  53. package/dist/tools/verificationTools.d.ts +6 -0
  54. package/dist/tools/verificationTools.js +472 -0
  55. package/dist/tools/verificationTools.js.map +1 -0
  56. package/dist/tools/visionTools.d.ts +12 -0
  57. package/dist/tools/visionTools.js +553 -0
  58. package/dist/tools/visionTools.js.map +1 -0
  59. package/dist/tools/webTools.d.ts +12 -0
  60. package/dist/tools/webTools.js +443 -0
  61. package/dist/tools/webTools.js.map +1 -0
  62. package/dist/types.d.ts +16 -0
  63. package/dist/types.js +2 -0
  64. package/dist/types.js.map +1 -0
  65. package/package.json +66 -0
@@ -0,0 +1,366 @@
1
+ /**
2
+ * Flywheel tools — compose the 6-Phase Verification (inner loop) with
3
+ * Eval-Driven Development (outer loop) into the AI Flywheel.
4
+ */
5
+ import { getDb, genId } from "../db.js";
6
+ export const flywheelTools = [
7
+ {
8
+ name: "get_flywheel_status",
9
+ description: "Get the current state of both loops (Verification inner loop and Eval outer loop) and how they connect. Shows active verification cycles, recent eval trends, and cross-loop connections.",
10
+ inputSchema: {
11
+ type: "object",
12
+ properties: {
13
+ includeHistory: {
14
+ type: "boolean",
15
+ description: "Include recent completed cycles and eval runs (default false)",
16
+ },
17
+ },
18
+ },
19
+ handler: async (args) => {
20
+ const db = getDb();
21
+ const includeHistory = args.includeHistory ?? false;
22
+ // Inner loop: verification cycles
23
+ const activeCycles = db
24
+ .prepare("SELECT id, title, current_phase, status, created_at FROM verification_cycles WHERE status = 'active' ORDER BY created_at DESC")
25
+ .all();
26
+ const recentCompleted = includeHistory
27
+ ? db
28
+ .prepare("SELECT id, title, updated_at as completed_at FROM verification_cycles WHERE status = 'completed' ORDER BY updated_at DESC LIMIT 10")
29
+ .all()
30
+ : [];
31
+ // Gap counts for active cycles
32
+ for (const cycle of activeCycles) {
33
+ const gaps = db
34
+ .prepare("SELECT severity, COUNT(*) as count FROM gaps WHERE cycle_id = ? AND status = 'open' GROUP BY severity")
35
+ .all(cycle.id);
36
+ cycle.gapCounts = {};
37
+ for (const g of gaps)
38
+ cycle.gapCounts[g.severity] = g.count;
39
+ }
40
+ // Outer loop: eval runs
41
+ const recentRuns = db
42
+ .prepare("SELECT id, name, status, summary, created_at FROM eval_runs ORDER BY created_at DESC LIMIT 10")
43
+ .all();
44
+ const parsedRuns = recentRuns.map((r) => {
45
+ let summary = { passRate: 0, avgScore: 0 };
46
+ try {
47
+ if (r.summary)
48
+ summary = JSON.parse(r.summary);
49
+ }
50
+ catch {
51
+ /* ignore */
52
+ }
53
+ return {
54
+ runId: r.id,
55
+ name: r.name,
56
+ status: r.status,
57
+ passRate: summary.passRate,
58
+ avgScore: summary.avgScore,
59
+ };
60
+ });
61
+ // Trend detection
62
+ const completedRuns = parsedRuns.filter((r) => r.passRate !== undefined && r.passRate > 0);
63
+ let trend = {
64
+ direction: "insufficient_data",
65
+ delta: 0,
66
+ };
67
+ if (completedRuns.length >= 2) {
68
+ const latest = completedRuns[0].passRate;
69
+ const previous = completedRuns[1].passRate;
70
+ const delta = Math.round((latest - previous) * 100) / 100;
71
+ trend = {
72
+ direction: delta > 0 ? "improving" : delta < 0 ? "regressing" : "stable",
73
+ delta,
74
+ };
75
+ }
76
+ // Cross-loop connections
77
+ const learningsFromVerification = db
78
+ .prepare("SELECT COUNT(*) as count FROM learnings WHERE source_cycle IS NOT NULL")
79
+ .get()?.count ?? 0;
80
+ const totalLearnings = db.prepare("SELECT COUNT(*) as count FROM learnings").get()
81
+ ?.count ?? 0;
82
+ return {
83
+ innerLoop: {
84
+ activeCycles: activeCycles.map((c) => ({
85
+ cycleId: c.id,
86
+ title: c.title,
87
+ currentPhase: c.current_phase,
88
+ gapCounts: c.gapCounts,
89
+ })),
90
+ recentCompleted,
91
+ },
92
+ outerLoop: {
93
+ recentRuns: parsedRuns,
94
+ trend,
95
+ },
96
+ connections: {
97
+ learningsFromVerification,
98
+ totalLearnings,
99
+ },
100
+ };
101
+ },
102
+ },
103
+ {
104
+ name: "promote_to_eval",
105
+ description: "Take findings from a completed verification cycle and promote them into eval test cases. This is how the inner loop feeds the outer loop: Phase 4 test results become eval cases, Phase 5 checklists become scoring rubrics, Phase 6 edge cases become adversarial eval cases.",
106
+ inputSchema: {
107
+ type: "object",
108
+ properties: {
109
+ cycleId: {
110
+ type: "string",
111
+ description: "Completed verification cycle to promote from",
112
+ },
113
+ evalRunName: {
114
+ type: "string",
115
+ description: "Name for the new eval run",
116
+ },
117
+ cases: {
118
+ type: "array",
119
+ description: "Eval cases derived from the verification cycle",
120
+ items: {
121
+ type: "object",
122
+ properties: {
123
+ input: { type: "string" },
124
+ intent: { type: "string" },
125
+ expected: { type: "string" },
126
+ },
127
+ required: ["input", "intent"],
128
+ },
129
+ },
130
+ },
131
+ required: ["cycleId", "evalRunName", "cases"],
132
+ },
133
+ handler: async (args) => {
134
+ const { cycleId, evalRunName, cases } = args;
135
+ if (!cases || cases.length === 0)
136
+ throw new Error("At least one eval case is required");
137
+ const db = getDb();
138
+ // Verify cycle exists
139
+ const cycle = db
140
+ .prepare("SELECT * FROM verification_cycles WHERE id = ?")
141
+ .get(cycleId);
142
+ if (!cycle)
143
+ throw new Error(`Cycle not found: ${cycleId}`);
144
+ const runId = genId("eval");
145
+ const now = new Date().toISOString();
146
+ db.prepare("INSERT INTO eval_runs (id, name, description, status, created_at) VALUES (?, ?, ?, 'running', ?)").run(runId, evalRunName, `Promoted from verification cycle: ${cycle.title} (${cycleId})`, now);
147
+ const insertCase = db.prepare("INSERT INTO eval_cases (id, run_id, input, intent, expected) VALUES (?, ?, ?, ?, ?)");
148
+ const caseIds = [];
149
+ for (const c of cases) {
150
+ const caseId = genId("case");
151
+ insertCase.run(caseId, runId, c.input, c.intent, c.expected ?? null);
152
+ caseIds.push(caseId);
153
+ }
154
+ return {
155
+ evalRunId: runId,
156
+ caseCount: cases.length,
157
+ caseIds,
158
+ sourceCycleId: cycleId,
159
+ message: "Verification findings promoted to eval suite. Record results with record_eval_result, then finalize with complete_eval_run.",
160
+ };
161
+ },
162
+ },
163
+ {
164
+ name: "trigger_investigation",
165
+ description: "When an eval run shows regression, trigger a new verification cycle to investigate. This is how the outer loop feeds the inner loop: regressions trigger 6-phase investigations.",
166
+ inputSchema: {
167
+ type: "object",
168
+ properties: {
169
+ evalRunId: {
170
+ type: "string",
171
+ description: "The eval run that showed regression",
172
+ },
173
+ regressionDescription: {
174
+ type: "string",
175
+ description: "What regressed and hypothesis about why",
176
+ },
177
+ },
178
+ required: ["evalRunId", "regressionDescription"],
179
+ },
180
+ handler: async (args) => {
181
+ const { evalRunId, regressionDescription } = args;
182
+ const db = getDb();
183
+ // Verify eval run exists
184
+ const evalRun = db
185
+ .prepare("SELECT * FROM eval_runs WHERE id = ?")
186
+ .get(evalRunId);
187
+ if (!evalRun)
188
+ throw new Error(`Eval run not found: ${evalRunId}`);
189
+ const cycleId = genId("cycle");
190
+ const now = new Date().toISOString();
191
+ const title = `Investigation: ${regressionDescription}`;
192
+ const description = `Triggered by eval regression in run "${evalRun.name}" (${evalRunId}). ${regressionDescription}`;
193
+ db.prepare("INSERT INTO verification_cycles (id, title, description, status, current_phase, created_at, updated_at) VALUES (?, ?, ?, 'active', 1, ?, ?)").run(cycleId, title, description, now, now);
194
+ // Create all 6 phases
195
+ const phaseNames = [
196
+ "context_gathering",
197
+ "gap_analysis",
198
+ "implementation",
199
+ "testing",
200
+ "self_verify",
201
+ "document",
202
+ ];
203
+ const insertPhase = db.prepare("INSERT INTO verification_phases (id, cycle_id, phase_number, phase_name, status, started_at) VALUES (?, ?, ?, ?, ?, ?)");
204
+ for (let i = 0; i < phaseNames.length; i++) {
205
+ insertPhase.run(genId("phase"), cycleId, i + 1, phaseNames[i], i === 0 ? "in_progress" : "pending", i === 0 ? now : null);
206
+ }
207
+ return {
208
+ cycleId,
209
+ title,
210
+ linkedEvalRun: evalRunId,
211
+ phase1Instructions: `Phase 1: Context Gathering — Investigate the regression.
212
+ The eval run "${evalRun.name}" showed regression. Research:
213
+ - What changed since the baseline eval?
214
+ - Which test cases failed that previously passed?
215
+ - Is this a code change, upstream API change, or data drift?
216
+
217
+ Start by calling search_learnings to check for known related issues.`,
218
+ };
219
+ },
220
+ },
221
+ {
222
+ name: "run_mandatory_flywheel",
223
+ description: "Enforce the mandatory 6-step AI Flywheel verification after any non-trivial change. All 6 steps must pass before work is considered done. Skipping is only allowed for trivial changes (typo, comment, config) with explicit justification. Real-world example: a variety-check dead-code bug was only caught by running this process after smoke tests passed.",
224
+ inputSchema: {
225
+ type: "object",
226
+ properties: {
227
+ target: {
228
+ type: "string",
229
+ description: "What changed (e.g., 'auth migration', 'variety check pipeline')",
230
+ },
231
+ cycleId: {
232
+ type: "string",
233
+ description: "Optional: link to a verification cycle",
234
+ },
235
+ steps: {
236
+ type: "array",
237
+ description: "The 6 mandatory steps. All must be present: static_analysis, happy_path_test, failure_path_test, gap_analysis, fix_and_reverify, deploy_and_document",
238
+ items: {
239
+ type: "object",
240
+ properties: {
241
+ stepName: {
242
+ type: "string",
243
+ enum: [
244
+ "static_analysis",
245
+ "happy_path_test",
246
+ "failure_path_test",
247
+ "gap_analysis",
248
+ "fix_and_reverify",
249
+ "deploy_and_document",
250
+ ],
251
+ },
252
+ passed: { type: "boolean" },
253
+ output: {
254
+ type: "string",
255
+ description: "Step output or notes",
256
+ },
257
+ },
258
+ required: ["stepName", "passed"],
259
+ },
260
+ },
261
+ skipJustification: {
262
+ type: "string",
263
+ description: "Only if skipping all 6 steps: explain why this change is trivial (typo fix, comment update, config tweak)",
264
+ },
265
+ },
266
+ required: ["target"],
267
+ },
268
+ handler: async (args) => {
269
+ const { target, cycleId, steps, skipJustification } = args;
270
+ const db = getDb();
271
+ const now = new Date().toISOString();
272
+ // Skip path
273
+ if (skipJustification && (!steps || steps.length === 0)) {
274
+ const gateRunId = genId("gate");
275
+ db.prepare("INSERT INTO quality_gate_runs (id, gate_name, target, passed, score, total_rules, failures, rule_results, created_at) VALUES (?, 'mandatory_flywheel', ?, 1, 1.0, 0, '[]', ?, ?)").run(gateRunId, target, JSON.stringify({
276
+ skipped: true,
277
+ justification: skipJustification,
278
+ }), now);
279
+ return {
280
+ gateRunId,
281
+ passed: true,
282
+ skipped: true,
283
+ justification: skipJustification,
284
+ guidance: "Flywheel skipped for trivial change. If the change has any behavioral impact, re-run with all 6 steps.",
285
+ };
286
+ }
287
+ // Validate steps
288
+ if (!steps || steps.length === 0) {
289
+ throw new Error("Either provide all 6 mandatory steps or a skipJustification for trivial changes. The 6 required steps are: static_analysis, happy_path_test, failure_path_test, gap_analysis, fix_and_reverify, deploy_and_document.");
290
+ }
291
+ const REQUIRED_STEPS = [
292
+ "static_analysis",
293
+ "happy_path_test",
294
+ "failure_path_test",
295
+ "gap_analysis",
296
+ "fix_and_reverify",
297
+ "deploy_and_document",
298
+ ];
299
+ const providedNames = steps.map((s) => s.stepName);
300
+ const missing = REQUIRED_STEPS.filter((r) => !providedNames.includes(r));
301
+ if (missing.length > 0) {
302
+ throw new Error(`Missing required steps: ${missing.join(", ")}. All 6 steps must be reported.`);
303
+ }
304
+ // Validate cycle exists if provided
305
+ if (cycleId) {
306
+ const cycle = db
307
+ .prepare("SELECT id FROM verification_cycles WHERE id = ?")
308
+ .get(cycleId);
309
+ if (!cycle)
310
+ throw new Error(`Verification cycle not found: ${cycleId}`);
311
+ }
312
+ // Build results
313
+ const ruleResults = {};
314
+ const failures = [];
315
+ let firstFailure = null;
316
+ for (const step of steps) {
317
+ ruleResults[step.stepName] = step.passed;
318
+ if (!step.passed) {
319
+ failures.push(step.stepName);
320
+ if (!firstFailure)
321
+ firstFailure = step.stepName;
322
+ }
323
+ }
324
+ const allPassed = failures.length === 0;
325
+ const score = Math.round(((REQUIRED_STEPS.length - failures.length) /
326
+ REQUIRED_STEPS.length) *
327
+ 100) / 100;
328
+ const gateRunId = genId("gate");
329
+ db.prepare("INSERT INTO quality_gate_runs (id, gate_name, target, passed, score, total_rules, failures, rule_results, created_at) VALUES (?, 'mandatory_flywheel', ?, ?, ?, 6, ?, ?, ?)").run(gateRunId, target, allPassed ? 1 : 0, score, JSON.stringify(failures), JSON.stringify(ruleResults), now);
330
+ let guidance;
331
+ if (allPassed) {
332
+ guidance =
333
+ "Flywheel verification complete. All 6 mandatory steps passed. Work is ready to ship.";
334
+ }
335
+ else {
336
+ guidance = `Failed at ${firstFailure}. Fix the issue and re-run ALL 6 steps from scratch (not just the failed step). Remember: the variety-check dead-code bug was only caught because the full flywheel was re-run after initial smoke tests passed.`;
337
+ }
338
+ return {
339
+ gateRunId,
340
+ target,
341
+ passed: allPassed,
342
+ score,
343
+ totalSteps: 6,
344
+ passedCount: REQUIRED_STEPS.length - failures.length,
345
+ failures,
346
+ firstFailure,
347
+ ruleResults,
348
+ linkedCycleId: cycleId ?? null,
349
+ guidance,
350
+ ...(allPassed
351
+ ? {
352
+ _contributeBack: {
353
+ instruction: "All 6 steps passed. Record what you learned so the knowledge base grows automatically:",
354
+ actions: [
355
+ "record_learning — for edge cases, gotchas, or patterns found during verification",
356
+ "log_recon_finding — for any SDK/API/framework discoveries",
357
+ "search_all_knowledge — check existing knowledge before your next task",
358
+ ],
359
+ },
360
+ }
361
+ : {}),
362
+ };
363
+ },
364
+ },
365
+ ];
366
+ //# sourceMappingURL=flywheelTools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flywheelTools.js","sourceRoot":"","sources":["../../src/tools/flywheelTools.ts"],"names":[],"mapp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oBACX,CAAC,CAAC;wBACE,eAAe,EAAE;4BACf,WAAW,EACT,wFAAwF;4BAC1F,OAAO,EAAE;gCACP,kFAAkF;gCAClF,2DAA2D;gCAC3D,uEAAuE;6BACxE;yBACF;qBACF;oBACH,CAAC,CAAC,EAAE,CAAC;aACR,CAAC;QACJ,CAAC;KACF;CACF,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * GitHub tools — Repository search and analysis.
3
+ * Enables agents to discover and analyze GitHub repositories for learning patterns,
4
+ * finding prior art, and understanding tech stacks.
5
+ *
6
+ * - search_github: Search repositories by topic, language, stars
7
+ * - analyze_repo: Analyze a repo's structure, tech stack, and patterns
8
+ *
9
+ * Uses GitHub REST API. GITHUB_TOKEN optional but recommended for higher rate limits.
10
+ */
11
+ import type { McpTool } from "../types.js";
12
+ export declare const githubTools: McpTool[];