@triedotdev/mcp 1.0.15 → 1.0.17
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 +48 -2
- package/dist/{chunk-NJXF26W7.js → chunk-ENCH27CT.js} +1359 -2
- package/dist/chunk-ENCH27CT.js.map +1 -0
- package/dist/cli/yolo-daemon.js +1 -1
- package/dist/index.js +305 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/chunk-NJXF26W7.js.map +0 -1
package/dist/cli/yolo-daemon.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
getAgentRegistry,
|
|
13
13
|
getPrompt,
|
|
14
14
|
getSystemPrompt
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ENCH27CT.js";
|
|
16
16
|
import "./chunk-3CS6Z2SL.js";
|
|
17
17
|
import "./chunk-4OGYWKMD.js";
|
|
18
18
|
import "./chunk-MR755QGT.js";
|
|
@@ -20,7 +20,7 @@ import "./chunk-6NLHFIYA.js";
|
|
|
20
20
|
import "./chunk-DGUM43GV.js";
|
|
21
21
|
|
|
22
22
|
// src/index.ts
|
|
23
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
23
|
+
import { Server as Server2 } from "@modelcontextprotocol/sdk/server/index.js";
|
|
24
24
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
25
25
|
import {
|
|
26
26
|
CallToolRequestSchema,
|
|
@@ -2080,7 +2080,11 @@ var AGENT_TO_AI_TYPE = {
|
|
|
2080
2080
|
"test": "test",
|
|
2081
2081
|
"trie_clean": "vibe",
|
|
2082
2082
|
"super-reviewer": "pr_review",
|
|
2083
|
-
"agent-smith": "agent-smith"
|
|
2083
|
+
"agent-smith": "agent-smith",
|
|
2084
|
+
"performance": "performance",
|
|
2085
|
+
"e2e": "e2e",
|
|
2086
|
+
"visual-qa": "visual_qa",
|
|
2087
|
+
"data-flow": "data_flow"
|
|
2084
2088
|
};
|
|
2085
2089
|
var TrieAgentTool = class {
|
|
2086
2090
|
agentRegistry = getAgentRegistry();
|
|
@@ -2938,18 +2942,31 @@ var TrieListAgentsTool = class {
|
|
|
2938
2942
|
);
|
|
2939
2943
|
const validCustomAgents = customAgents.filter(Boolean);
|
|
2940
2944
|
const builtinAgents = includeBuiltin ? [
|
|
2945
|
+
// Security & Compliance
|
|
2941
2946
|
{ name: "security", displayName: "Security Agent", category: "security", isCustom: false },
|
|
2942
2947
|
{ name: "privacy", displayName: "Privacy Agent", category: "privacy", isCustom: false },
|
|
2948
|
+
{ name: "soc2", displayName: "SOC 2 Agent", category: "compliance", isCustom: false },
|
|
2943
2949
|
{ name: "legal", displayName: "Legal Agent", category: "compliance", isCustom: false },
|
|
2950
|
+
// Code Quality
|
|
2951
|
+
{ name: "software-architect", displayName: "Architecture Agent", category: "architecture", isCustom: false },
|
|
2952
|
+
{ name: "bug-finding", displayName: "Bug Finding Agent", category: "quality", isCustom: false },
|
|
2944
2953
|
{ name: "typecheck", displayName: "TypeCheck Agent", category: "quality", isCustom: false },
|
|
2945
|
-
{ name: "
|
|
2954
|
+
{ name: "trie-clean", displayName: "Clean Agent", category: "ai-code", isCustom: false },
|
|
2955
|
+
{ name: "data-flow", displayName: "Data Flow Agent", category: "quality", isCustom: false },
|
|
2956
|
+
// Design & UX
|
|
2957
|
+
{ name: "design-engineer", displayName: "Design Engineer Agent", category: "design", isCustom: false },
|
|
2946
2958
|
{ name: "accessibility", displayName: "Accessibility Agent", category: "accessibility", isCustom: false },
|
|
2947
|
-
{ name: "
|
|
2948
|
-
{ name: "
|
|
2959
|
+
{ name: "user-testing", displayName: "UX Agent", category: "ux", isCustom: false },
|
|
2960
|
+
{ name: "visual-qa", displayName: "Visual QA Agent", category: "visual", isCustom: false },
|
|
2961
|
+
// DevOps & Testing
|
|
2949
2962
|
{ name: "devops", displayName: "DevOps Agent", category: "devops", isCustom: false },
|
|
2950
|
-
{ name: "
|
|
2951
|
-
{ name: "
|
|
2952
|
-
{ name: "
|
|
2963
|
+
{ name: "test", displayName: "Test Agent", category: "testing", isCustom: false },
|
|
2964
|
+
{ name: "e2e", displayName: "E2E Agent", category: "testing", isCustom: false },
|
|
2965
|
+
{ name: "performance", displayName: "Performance Agent", category: "performance", isCustom: false },
|
|
2966
|
+
// Review & Explanation
|
|
2967
|
+
{ name: "super-reviewer", displayName: "Super Reviewer", category: "review", isCustom: false },
|
|
2968
|
+
{ name: "agent-smith", displayName: "Agent Smith", category: "review", isCustom: false },
|
|
2969
|
+
{ name: "comprehension", displayName: "Comprehension Agent", category: "communication", isCustom: false }
|
|
2953
2970
|
] : [];
|
|
2954
2971
|
let response = `# \u{1F916} Registered Agents
|
|
2955
2972
|
|
|
@@ -3412,6 +3429,238 @@ ${fileChange.diff}
|
|
|
3412
3429
|
}
|
|
3413
3430
|
};
|
|
3414
3431
|
|
|
3432
|
+
// src/tools/visual-qa-browser.ts
|
|
3433
|
+
import { chromium } from "playwright";
|
|
3434
|
+
import { createServer } from "net";
|
|
3435
|
+
var DEFAULT_VIEWPORTS = [
|
|
3436
|
+
{ name: "mobile", width: 375, height: 812 },
|
|
3437
|
+
// iPhone X
|
|
3438
|
+
{ name: "tablet", width: 768, height: 1024 },
|
|
3439
|
+
// iPad
|
|
3440
|
+
{ name: "desktop", width: 1440, height: 900 }
|
|
3441
|
+
// Standard desktop
|
|
3442
|
+
];
|
|
3443
|
+
async function findOpenPort() {
|
|
3444
|
+
const commonPorts = [3e3, 3001, 5173, 5174, 4200, 8080, 8e3, 8888, 5e3, 4e3];
|
|
3445
|
+
for (const port of commonPorts) {
|
|
3446
|
+
const isOpen = await checkPort(port);
|
|
3447
|
+
if (isOpen) {
|
|
3448
|
+
return port;
|
|
3449
|
+
}
|
|
3450
|
+
}
|
|
3451
|
+
return null;
|
|
3452
|
+
}
|
|
3453
|
+
async function checkPort(port) {
|
|
3454
|
+
return new Promise((resolve5) => {
|
|
3455
|
+
const server2 = createServer();
|
|
3456
|
+
server2.once("error", (err) => {
|
|
3457
|
+
if (err.code === "EADDRINUSE") {
|
|
3458
|
+
resolve5(true);
|
|
3459
|
+
} else {
|
|
3460
|
+
resolve5(false);
|
|
3461
|
+
}
|
|
3462
|
+
});
|
|
3463
|
+
server2.once("listening", () => {
|
|
3464
|
+
server2.close();
|
|
3465
|
+
resolve5(false);
|
|
3466
|
+
});
|
|
3467
|
+
server2.listen(port, "127.0.0.1");
|
|
3468
|
+
});
|
|
3469
|
+
}
|
|
3470
|
+
async function captureScreenshots(url, viewports, options) {
|
|
3471
|
+
let browser = null;
|
|
3472
|
+
const screenshots = [];
|
|
3473
|
+
try {
|
|
3474
|
+
browser = await chromium.launch({
|
|
3475
|
+
headless: true
|
|
3476
|
+
});
|
|
3477
|
+
for (const viewport of viewports) {
|
|
3478
|
+
const page = await browser.newPage({
|
|
3479
|
+
viewport: { width: viewport.width, height: viewport.height }
|
|
3480
|
+
});
|
|
3481
|
+
try {
|
|
3482
|
+
await page.goto(url, {
|
|
3483
|
+
waitUntil: "networkidle",
|
|
3484
|
+
timeout: 3e4
|
|
3485
|
+
});
|
|
3486
|
+
if (options.waitForSelector) {
|
|
3487
|
+
await page.waitForSelector(options.waitForSelector, { timeout: 1e4 });
|
|
3488
|
+
}
|
|
3489
|
+
if (options.waitMs) {
|
|
3490
|
+
await page.waitForTimeout(options.waitMs);
|
|
3491
|
+
}
|
|
3492
|
+
const screenshotBuffer = await page.screenshot({
|
|
3493
|
+
fullPage: true,
|
|
3494
|
+
type: "png"
|
|
3495
|
+
});
|
|
3496
|
+
screenshots.push({
|
|
3497
|
+
viewport: viewport.name,
|
|
3498
|
+
width: viewport.width,
|
|
3499
|
+
height: viewport.height,
|
|
3500
|
+
base64: screenshotBuffer.toString("base64"),
|
|
3501
|
+
mimeType: "image/png"
|
|
3502
|
+
});
|
|
3503
|
+
} finally {
|
|
3504
|
+
await page.close();
|
|
3505
|
+
}
|
|
3506
|
+
}
|
|
3507
|
+
} finally {
|
|
3508
|
+
if (browser) {
|
|
3509
|
+
await browser.close();
|
|
3510
|
+
}
|
|
3511
|
+
}
|
|
3512
|
+
return screenshots;
|
|
3513
|
+
}
|
|
3514
|
+
async function runVisualQA(options = {}) {
|
|
3515
|
+
let url = options.url;
|
|
3516
|
+
if (!url) {
|
|
3517
|
+
const port = options.port || await findOpenPort();
|
|
3518
|
+
if (!port) {
|
|
3519
|
+
return {
|
|
3520
|
+
success: false,
|
|
3521
|
+
url: "",
|
|
3522
|
+
screenshots: [],
|
|
3523
|
+
error: "No running dev server found. Please provide a URL or start your dev server on a common port (3000, 5173, 8080, etc.)",
|
|
3524
|
+
analysisPrompt: ""
|
|
3525
|
+
};
|
|
3526
|
+
}
|
|
3527
|
+
url = `http://localhost:${port}`;
|
|
3528
|
+
}
|
|
3529
|
+
const viewports = options.viewports || DEFAULT_VIEWPORTS;
|
|
3530
|
+
try {
|
|
3531
|
+
console.error(`\u{1F4F8} Visual QA: Capturing screenshots from ${url}`);
|
|
3532
|
+
console.error(` Viewports: ${viewports.map((v) => `${v.name} (${v.width}x${v.height})`).join(", ")}`);
|
|
3533
|
+
const screenshots = await captureScreenshots(url, viewports, {
|
|
3534
|
+
waitForSelector: options.waitForSelector,
|
|
3535
|
+
waitMs: options.waitMs
|
|
3536
|
+
});
|
|
3537
|
+
console.error(` \u2713 Captured ${screenshots.length} screenshots`);
|
|
3538
|
+
const analysisPrompt = buildAnalysisPrompt(url, screenshots);
|
|
3539
|
+
return {
|
|
3540
|
+
success: true,
|
|
3541
|
+
url,
|
|
3542
|
+
screenshots,
|
|
3543
|
+
analysisPrompt
|
|
3544
|
+
};
|
|
3545
|
+
} catch (error) {
|
|
3546
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
3547
|
+
if (errorMessage.includes("net::ERR_CONNECTION_REFUSED")) {
|
|
3548
|
+
return {
|
|
3549
|
+
success: false,
|
|
3550
|
+
url,
|
|
3551
|
+
screenshots: [],
|
|
3552
|
+
error: `Cannot connect to ${url}. Is your dev server running?`,
|
|
3553
|
+
analysisPrompt: ""
|
|
3554
|
+
};
|
|
3555
|
+
}
|
|
3556
|
+
if (errorMessage.includes("Executable doesn't exist")) {
|
|
3557
|
+
return {
|
|
3558
|
+
success: false,
|
|
3559
|
+
url,
|
|
3560
|
+
screenshots: [],
|
|
3561
|
+
error: "Playwright browsers not installed. Run: npx playwright install chromium",
|
|
3562
|
+
analysisPrompt: ""
|
|
3563
|
+
};
|
|
3564
|
+
}
|
|
3565
|
+
return {
|
|
3566
|
+
success: false,
|
|
3567
|
+
url,
|
|
3568
|
+
screenshots: [],
|
|
3569
|
+
error: `Screenshot capture failed: ${errorMessage}`,
|
|
3570
|
+
analysisPrompt: ""
|
|
3571
|
+
};
|
|
3572
|
+
}
|
|
3573
|
+
}
|
|
3574
|
+
function buildAnalysisPrompt(url, screenshots) {
|
|
3575
|
+
const viewportList = screenshots.map((s) => `- ${s.viewport}: ${s.width}x${s.height}`).join("\n");
|
|
3576
|
+
return `## Visual QA Analysis
|
|
3577
|
+
|
|
3578
|
+
I've captured screenshots of **${url}** at ${screenshots.length} viewports:
|
|
3579
|
+
|
|
3580
|
+
${viewportList}
|
|
3581
|
+
|
|
3582
|
+
Please analyze these screenshots for:
|
|
3583
|
+
|
|
3584
|
+
### Layout Issues
|
|
3585
|
+
- Overlapping elements or text
|
|
3586
|
+
- Content overflow or clipping
|
|
3587
|
+
- Broken layouts at specific breakpoints
|
|
3588
|
+
- Misaligned elements
|
|
3589
|
+
- Unexpected gaps or spacing
|
|
3590
|
+
|
|
3591
|
+
### Responsive Design
|
|
3592
|
+
- Mobile navigation issues
|
|
3593
|
+
- Text too small to read on mobile
|
|
3594
|
+
- Touch targets too small (<44px)
|
|
3595
|
+
- Horizontal scrolling on mobile
|
|
3596
|
+
- Content not adapting to viewport
|
|
3597
|
+
|
|
3598
|
+
### Visual Polish
|
|
3599
|
+
- Inconsistent spacing or alignment
|
|
3600
|
+
- Poor color contrast (text hard to read)
|
|
3601
|
+
- Broken images or missing assets
|
|
3602
|
+
- Loading states stuck/visible
|
|
3603
|
+
- Z-index issues (elements overlapping incorrectly)
|
|
3604
|
+
|
|
3605
|
+
### Accessibility
|
|
3606
|
+
- Missing focus indicators
|
|
3607
|
+
- Color-only information
|
|
3608
|
+
- Text over images without sufficient contrast
|
|
3609
|
+
- Very small text (<12px)
|
|
3610
|
+
|
|
3611
|
+
### General Quality
|
|
3612
|
+
- Does it look professional?
|
|
3613
|
+
- Is the hierarchy clear?
|
|
3614
|
+
- Are interactive elements obvious?
|
|
3615
|
+
- Any obvious bugs or glitches?
|
|
3616
|
+
|
|
3617
|
+
For each issue found:
|
|
3618
|
+
1. **Viewport**: Which viewport(s) affected
|
|
3619
|
+
2. **Location**: Where on the page
|
|
3620
|
+
3. **Issue**: What's wrong
|
|
3621
|
+
4. **Severity**: Critical/Serious/Moderate/Low
|
|
3622
|
+
5. **Fix**: How to resolve it
|
|
3623
|
+
|
|
3624
|
+
If the UI looks good, say so! Note what's working well.`;
|
|
3625
|
+
}
|
|
3626
|
+
function formatMCPResponse(result) {
|
|
3627
|
+
if (!result.success) {
|
|
3628
|
+
return {
|
|
3629
|
+
content: [{
|
|
3630
|
+
type: "text",
|
|
3631
|
+
text: `# Visual QA Failed
|
|
3632
|
+
|
|
3633
|
+
${result.error}
|
|
3634
|
+
|
|
3635
|
+
## Troubleshooting
|
|
3636
|
+
|
|
3637
|
+
1. Make sure your dev server is running
|
|
3638
|
+
2. Try: \`trie_visual_qa url:"http://localhost:3000"\`
|
|
3639
|
+
3. If Playwright isn't installed: \`npx playwright install chromium\``
|
|
3640
|
+
}]
|
|
3641
|
+
};
|
|
3642
|
+
}
|
|
3643
|
+
const content = [];
|
|
3644
|
+
content.push({
|
|
3645
|
+
type: "text",
|
|
3646
|
+
text: result.analysisPrompt
|
|
3647
|
+
});
|
|
3648
|
+
for (const screenshot of result.screenshots) {
|
|
3649
|
+
content.push({
|
|
3650
|
+
type: "text",
|
|
3651
|
+
text: `
|
|
3652
|
+
### ${screenshot.viewport} (${screenshot.width}x${screenshot.height})
|
|
3653
|
+
`
|
|
3654
|
+
});
|
|
3655
|
+
content.push({
|
|
3656
|
+
type: "image",
|
|
3657
|
+
data: screenshot.base64,
|
|
3658
|
+
mimeType: screenshot.mimeType
|
|
3659
|
+
});
|
|
3660
|
+
}
|
|
3661
|
+
return { content };
|
|
3662
|
+
}
|
|
3663
|
+
|
|
3415
3664
|
// src/utils/ai-tool-detector.ts
|
|
3416
3665
|
function detectAITool() {
|
|
3417
3666
|
if (process.env.CLAUDE_CODE_VERSION || process.env.CLAUDE_CODE) {
|
|
@@ -3561,7 +3810,7 @@ function mergeConfig(defaults, user) {
|
|
|
3561
3810
|
}
|
|
3562
3811
|
|
|
3563
3812
|
// src/index.ts
|
|
3564
|
-
var server = new
|
|
3813
|
+
var server = new Server2(
|
|
3565
3814
|
{
|
|
3566
3815
|
name: "trie",
|
|
3567
3816
|
version: "1.0.0",
|
|
@@ -3956,6 +4205,32 @@ var tools = [
|
|
|
3956
4205
|
}
|
|
3957
4206
|
}
|
|
3958
4207
|
},
|
|
4208
|
+
// Browser-based Visual QA with screenshots
|
|
4209
|
+
{
|
|
4210
|
+
name: "visual_qa_browser",
|
|
4211
|
+
description: "Capture screenshots of your app at mobile/tablet/desktop viewports for visual QA. Auto-detects running dev servers or specify a URL. Returns images for Claude Vision analysis.",
|
|
4212
|
+
inputSchema: {
|
|
4213
|
+
type: "object",
|
|
4214
|
+
properties: {
|
|
4215
|
+
url: {
|
|
4216
|
+
type: "string",
|
|
4217
|
+
description: "URL to screenshot (e.g., http://localhost:3000). If not provided, auto-detects running dev server."
|
|
4218
|
+
},
|
|
4219
|
+
port: {
|
|
4220
|
+
type: "number",
|
|
4221
|
+
description: "Specific port to check if no URL provided"
|
|
4222
|
+
},
|
|
4223
|
+
waitForSelector: {
|
|
4224
|
+
type: "string",
|
|
4225
|
+
description: 'CSS selector to wait for before capturing (e.g., ".main-content")'
|
|
4226
|
+
},
|
|
4227
|
+
waitMs: {
|
|
4228
|
+
type: "number",
|
|
4229
|
+
description: "Additional milliseconds to wait after page load"
|
|
4230
|
+
}
|
|
4231
|
+
}
|
|
4232
|
+
}
|
|
4233
|
+
},
|
|
3959
4234
|
// Custom agent creation tools (two-step process - no API key needed!)
|
|
3960
4235
|
{
|
|
3961
4236
|
name: "create_agent",
|
|
@@ -4180,6 +4455,23 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
4180
4455
|
return await agentTool.execute({ ...args, agent: "trie_clean" });
|
|
4181
4456
|
case "soc2":
|
|
4182
4457
|
return await agentTool.execute({ ...args, agent: "soc2" });
|
|
4458
|
+
// New agents (inspired by Turkey Build)
|
|
4459
|
+
case "performance":
|
|
4460
|
+
case "perf":
|
|
4461
|
+
return await agentTool.execute({ ...args, agent: "performance" });
|
|
4462
|
+
case "e2e":
|
|
4463
|
+
return await agentTool.execute({ ...args, agent: "e2e" });
|
|
4464
|
+
case "visual_qa":
|
|
4465
|
+
case "visual":
|
|
4466
|
+
return await agentTool.execute({ ...args, agent: "visual-qa" });
|
|
4467
|
+
case "visual_qa_browser": {
|
|
4468
|
+
const visualArgs = args;
|
|
4469
|
+
const result = await runVisualQA(visualArgs);
|
|
4470
|
+
return formatMCPResponse(result);
|
|
4471
|
+
}
|
|
4472
|
+
case "data_flow":
|
|
4473
|
+
case "dataflow":
|
|
4474
|
+
return await agentTool.execute({ ...args, agent: "data-flow" });
|
|
4183
4475
|
// Custom agent creation tools (two-step process)
|
|
4184
4476
|
case "create_agent":
|
|
4185
4477
|
return await createAgentTool.execute(args);
|
|
@@ -4443,8 +4735,9 @@ function showStartupBanner(agentCount, aiTool) {
|
|
|
4443
4735
|
}
|
|
4444
4736
|
async function main() {
|
|
4445
4737
|
const aiTool = detectAITool();
|
|
4446
|
-
|
|
4447
|
-
const
|
|
4738
|
+
await loadConfig();
|
|
4739
|
+
const registry = getAgentRegistry();
|
|
4740
|
+
const agentCount = registry.getAllAgents().length;
|
|
4448
4741
|
showStartupBanner(agentCount, aiTool.name);
|
|
4449
4742
|
const transport = new StdioServerTransport();
|
|
4450
4743
|
await server.connect(transport);
|