@triedotdev/mcp 1.0.50 → 1.0.51
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 +545 -406
- package/dist/agent-smith-BECRZH73.js +12 -0
- package/dist/{agent-smith-runner-3AWGEOZC.js → agent-smith-runner-LZRXM2Q2.js} +7 -7
- package/dist/agent-smith-runner-LZRXM2Q2.js.map +1 -0
- package/dist/{chunk-3SQK2RKF.js → chunk-A43476GB.js} +9 -9
- package/dist/chunk-A43476GB.js.map +1 -0
- package/dist/{chunk-IMFD4SJC.js → chunk-ASGSTVVF.js} +1 -1
- package/dist/chunk-ASGSTVVF.js.map +1 -0
- package/dist/chunk-C3AS5OXW.js +1177 -0
- package/dist/chunk-C3AS5OXW.js.map +1 -0
- package/dist/chunk-IEFAQFDQ.js +2061 -0
- package/dist/chunk-IEFAQFDQ.js.map +1 -0
- package/dist/{chunk-GLC62PGD.js → chunk-KB5ZN6K2.js} +2 -2
- package/dist/{chunk-37U65YW7.js → chunk-TOE75CFZ.js} +1855 -206
- package/dist/chunk-TOE75CFZ.js.map +1 -0
- package/dist/{chunk-GERAB55E.js → chunk-YKUCIKTU.js} +94 -1259
- package/dist/chunk-YKUCIKTU.js.map +1 -0
- package/dist/cli/create-agent.js +2 -2
- package/dist/cli/main.js +406 -68
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/yolo-daemon.js +5 -5
- package/dist/comprehension-46F7ZNKL.js +821 -0
- package/dist/comprehension-46F7ZNKL.js.map +1 -0
- package/dist/index.js +448 -123
- package/dist/index.js.map +1 -1
- package/dist/workers/agent-worker.js +10 -11
- package/dist/workers/agent-worker.js.map +1 -1
- package/package.json +3 -1
- package/dist/agent-smith-RVXIMAL6.js +0 -11
- package/dist/agent-smith-runner-3AWGEOZC.js.map +0 -1
- package/dist/chunk-37U65YW7.js.map +0 -1
- package/dist/chunk-3SQK2RKF.js.map +0 -1
- package/dist/chunk-6T7S77U7.js +0 -852
- package/dist/chunk-6T7S77U7.js.map +0 -1
- package/dist/chunk-GERAB55E.js.map +0 -1
- package/dist/chunk-IMFD4SJC.js.map +0 -1
- package/dist/chunk-PZDQIFKO.js +0 -1598
- package/dist/chunk-PZDQIFKO.js.map +0 -1
- /package/dist/{agent-smith-RVXIMAL6.js.map → agent-smith-BECRZH73.js.map} +0 -0
- /package/dist/{chunk-GLC62PGD.js.map → chunk-KB5ZN6K2.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -3,28 +3,34 @@ import {
|
|
|
3
3
|
listCustomAgents,
|
|
4
4
|
loadAgentConfig,
|
|
5
5
|
parseDocument
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KB5ZN6K2.js";
|
|
7
7
|
import {
|
|
8
|
+
ContextGraph,
|
|
9
|
+
IncidentIndex,
|
|
10
|
+
TrieFeedbackTool,
|
|
8
11
|
completeBootstrap,
|
|
12
|
+
exportToJson,
|
|
13
|
+
formatFriendlyError,
|
|
9
14
|
getLastCheckpoint,
|
|
15
|
+
importFromJson,
|
|
10
16
|
initializeBootstrapFiles,
|
|
11
17
|
listCheckpoints,
|
|
12
18
|
loadBootstrapContext,
|
|
13
19
|
loadRules,
|
|
14
20
|
loadTeamInfo,
|
|
15
21
|
needsBootstrap,
|
|
22
|
+
perceiveCurrentChanges,
|
|
23
|
+
reasonAboutChangesHumanReadable,
|
|
16
24
|
saveCheckpoint
|
|
17
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-IEFAQFDQ.js";
|
|
18
26
|
import {
|
|
19
27
|
TrieScanTool,
|
|
20
28
|
loadConfig
|
|
21
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-YKUCIKTU.js";
|
|
30
|
+
import "./chunk-C3AS5OXW.js";
|
|
22
31
|
import {
|
|
23
32
|
CRITICAL_REVIEW_CHECKLIST,
|
|
24
|
-
|
|
25
|
-
getAgentRegistry
|
|
26
|
-
} from "./chunk-37U65YW7.js";
|
|
27
|
-
import {
|
|
33
|
+
SuperReviewerSkill,
|
|
28
34
|
appendToSection,
|
|
29
35
|
findCrossProjectPatterns,
|
|
30
36
|
findSimilarIssues,
|
|
@@ -35,6 +41,7 @@ import {
|
|
|
35
41
|
getProjectSection,
|
|
36
42
|
getProjectSections,
|
|
37
43
|
getRecentIssues,
|
|
44
|
+
getSkillRegistry,
|
|
38
45
|
initProjectInfo,
|
|
39
46
|
listInstalledSkills,
|
|
40
47
|
listTrackedProjects,
|
|
@@ -45,12 +52,12 @@ import {
|
|
|
45
52
|
searchGlobalPatterns,
|
|
46
53
|
searchIssues,
|
|
47
54
|
updateProjectSection
|
|
48
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-TOE75CFZ.js";
|
|
49
56
|
import "./chunk-3CS6Z2SL.js";
|
|
50
|
-
import "./chunk-
|
|
57
|
+
import "./chunk-A43476GB.js";
|
|
51
58
|
import {
|
|
52
59
|
getWorkingDirectory
|
|
53
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-ASGSTVVF.js";
|
|
54
61
|
import "./chunk-MR755QGT.js";
|
|
55
62
|
import "./chunk-6NLHFIYA.js";
|
|
56
63
|
import "./chunk-DGUM43GV.js";
|
|
@@ -2485,12 +2492,12 @@ trie_test action:"run" files:["src/utils.test.ts"]
|
|
|
2485
2492
|
// src/tools/register-agent.ts
|
|
2486
2493
|
var TrieRegisterAgentTool = class {
|
|
2487
2494
|
async execute(args) {
|
|
2488
|
-
const { name, path } = args;
|
|
2495
|
+
const { name, path: path3 } = args;
|
|
2489
2496
|
return {
|
|
2490
2497
|
content: [
|
|
2491
2498
|
{
|
|
2492
2499
|
type: "text",
|
|
2493
|
-
text: `\u{1F916} Register agent tool called with name: ${name}, path: ${
|
|
2500
|
+
text: `\u{1F916} Register agent tool called with name: ${name}, path: ${path3}
|
|
2494
2501
|
|
|
2495
2502
|
TODO: Implement register agent functionality`
|
|
2496
2503
|
}
|
|
@@ -2500,10 +2507,9 @@ TODO: Implement register agent functionality`
|
|
|
2500
2507
|
};
|
|
2501
2508
|
|
|
2502
2509
|
// src/tools/watch.ts
|
|
2503
|
-
import { watch } from "fs";
|
|
2510
|
+
import { watch, existsSync as existsSync4, readFileSync } from "fs";
|
|
2504
2511
|
import { stat } from "fs/promises";
|
|
2505
2512
|
import { join as join2, extname as extname4, basename as basename2 } from "path";
|
|
2506
|
-
import { existsSync as existsSync4 } from "fs";
|
|
2507
2513
|
var WATCH_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
2508
2514
|
".ts",
|
|
2509
2515
|
".tsx",
|
|
@@ -2537,7 +2543,9 @@ var TrieWatchTool = class {
|
|
|
2537
2543
|
scanDebounceTimer: null,
|
|
2538
2544
|
issueCache: /* @__PURE__ */ new Map(),
|
|
2539
2545
|
totalIssuesFound: 0,
|
|
2540
|
-
filesScanned: 0
|
|
2546
|
+
filesScanned: 0,
|
|
2547
|
+
nudgedFiles: /* @__PURE__ */ new Set(),
|
|
2548
|
+
nudges: []
|
|
2541
2549
|
};
|
|
2542
2550
|
watchers = /* @__PURE__ */ new Map();
|
|
2543
2551
|
async execute(args) {
|
|
@@ -2551,6 +2559,8 @@ var TrieWatchTool = class {
|
|
|
2551
2559
|
return this.getStatus();
|
|
2552
2560
|
case "issues":
|
|
2553
2561
|
return this.getCurrentIssues();
|
|
2562
|
+
case "nudges":
|
|
2563
|
+
return this.getNudges();
|
|
2554
2564
|
default:
|
|
2555
2565
|
return {
|
|
2556
2566
|
content: [{
|
|
@@ -2573,6 +2583,8 @@ var TrieWatchTool = class {
|
|
|
2573
2583
|
this.state.issueCache.clear();
|
|
2574
2584
|
this.state.totalIssuesFound = 0;
|
|
2575
2585
|
this.state.filesScanned = 0;
|
|
2586
|
+
this.state.nudgedFiles.clear();
|
|
2587
|
+
this.state.nudges = [];
|
|
2576
2588
|
console.error("\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501");
|
|
2577
2589
|
console.error("\u{1F441}\uFE0F TRIE AGENT - AUTONOMOUS WATCH MODE");
|
|
2578
2590
|
console.error("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n");
|
|
@@ -2681,10 +2693,41 @@ ${initialResult.content?.[0]?.text || "Initial scan complete."}`
|
|
|
2681
2693
|
for (const file of files) {
|
|
2682
2694
|
this.state.lastScan.set(file, Date.now());
|
|
2683
2695
|
}
|
|
2696
|
+
this.maybeNudge(files, resultText);
|
|
2684
2697
|
} catch (error) {
|
|
2685
2698
|
console.error(`\u274C Scan error: ${error}`);
|
|
2686
2699
|
}
|
|
2687
2700
|
}
|
|
2701
|
+
isQuiet() {
|
|
2702
|
+
const projectPath = getWorkingDirectory(void 0, true);
|
|
2703
|
+
const quietPath = join2(projectPath, ".trie", "quiet.json");
|
|
2704
|
+
try {
|
|
2705
|
+
const raw = readFileSync(quietPath, "utf-8");
|
|
2706
|
+
const data = JSON.parse(raw);
|
|
2707
|
+
const until = new Date(data.until).getTime();
|
|
2708
|
+
return Date.now() < until;
|
|
2709
|
+
} catch {
|
|
2710
|
+
return false;
|
|
2711
|
+
}
|
|
2712
|
+
}
|
|
2713
|
+
maybeNudge(files, resultText) {
|
|
2714
|
+
if (this.isQuiet()) return;
|
|
2715
|
+
const risky = /HIGH RISK|CRITICAL|🛑|🔴/i.test(resultText);
|
|
2716
|
+
if (!risky) return;
|
|
2717
|
+
for (const file of files) {
|
|
2718
|
+
if (this.state.nudgedFiles.has(file)) continue;
|
|
2719
|
+
this.state.nudgedFiles.add(file);
|
|
2720
|
+
const payload = {
|
|
2721
|
+
file,
|
|
2722
|
+
message: `Heads up: ${basename2(file)} looks risky. Pause and run targeted tests before pushing.`,
|
|
2723
|
+
severity: "high",
|
|
2724
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
2725
|
+
};
|
|
2726
|
+
this.state.nudges.push(payload);
|
|
2727
|
+
console.error(`
|
|
2728
|
+
\u{1F6E1}\uFE0F ${payload.message}`);
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2688
2731
|
stopWatching() {
|
|
2689
2732
|
if (!this.state.isRunning) {
|
|
2690
2733
|
return {
|
|
@@ -2732,6 +2775,9 @@ Use \`trie_watch start\` to begin autonomous scanning.`
|
|
|
2732
2775
|
const ago = Math.round((Date.now() - time) / 1e3);
|
|
2733
2776
|
return `- \`${basename2(file)}\` (${ago}s ago)`;
|
|
2734
2777
|
}).join("\n");
|
|
2778
|
+
const recentNudges = this.state.nudges.slice(-3).map(
|
|
2779
|
+
(n) => `- ${basename2(n.file)} [${n.severity}] @ ${n.timestamp}`
|
|
2780
|
+
).join("\n");
|
|
2735
2781
|
return {
|
|
2736
2782
|
content: [{
|
|
2737
2783
|
type: "text",
|
|
@@ -2746,12 +2792,34 @@ Use \`trie_watch start\` to begin autonomous scanning.`
|
|
|
2746
2792
|
### Recently Scanned:
|
|
2747
2793
|
${recentScans || "(none yet)"}
|
|
2748
2794
|
|
|
2795
|
+
### Recent Nudges:
|
|
2796
|
+
${recentNudges || "(none)"}
|
|
2797
|
+
|
|
2749
2798
|
### Commands:
|
|
2750
2799
|
- \`trie_watch issues\` - Get all issues found
|
|
2800
|
+
- \`trie_watch nudges\` - Get recent nudges (structured)
|
|
2751
2801
|
- \`trie_watch stop\` - Stop watching`
|
|
2752
2802
|
}]
|
|
2753
2803
|
};
|
|
2754
2804
|
}
|
|
2805
|
+
getNudges() {
|
|
2806
|
+
return {
|
|
2807
|
+
content: [
|
|
2808
|
+
{
|
|
2809
|
+
type: "text",
|
|
2810
|
+
text: `\u{1F6E1}\uFE0F Recent nudges (${this.state.nudges.length} this session)
|
|
2811
|
+
` + (this.state.nudges.length ? this.state.nudges.map(
|
|
2812
|
+
(n) => `- ${basename2(n.file)} [${n.severity}] @ ${n.timestamp}
|
|
2813
|
+
${n.message}`
|
|
2814
|
+
).join("\n") : "(none)")
|
|
2815
|
+
},
|
|
2816
|
+
{
|
|
2817
|
+
type: "json",
|
|
2818
|
+
json: this.state.nudges
|
|
2819
|
+
}
|
|
2820
|
+
]
|
|
2821
|
+
};
|
|
2822
|
+
}
|
|
2755
2823
|
getCurrentIssues() {
|
|
2756
2824
|
return {
|
|
2757
2825
|
content: [{
|
|
@@ -3077,7 +3145,7 @@ var SKIP_DIRS2 = /* @__PURE__ */ new Set([
|
|
|
3077
3145
|
".cache"
|
|
3078
3146
|
]);
|
|
3079
3147
|
var TrieAgentTool = class {
|
|
3080
|
-
agentRegistry =
|
|
3148
|
+
agentRegistry = getSkillRegistry();
|
|
3081
3149
|
customSkillsLoaded = false;
|
|
3082
3150
|
/**
|
|
3083
3151
|
* Ensure custom skills are loaded before using the registry
|
|
@@ -3095,17 +3163,17 @@ var TrieAgentTool = class {
|
|
|
3095
3163
|
}
|
|
3096
3164
|
await this.ensureCustomSkillsLoaded();
|
|
3097
3165
|
if (!agent) {
|
|
3098
|
-
return this.
|
|
3166
|
+
return this.listSkills();
|
|
3099
3167
|
}
|
|
3100
|
-
const agentInstance = this.agentRegistry.
|
|
3168
|
+
const agentInstance = this.agentRegistry.getSkill(agent);
|
|
3101
3169
|
if (!agentInstance) {
|
|
3102
3170
|
return {
|
|
3103
3171
|
content: [{
|
|
3104
3172
|
type: "text",
|
|
3105
|
-
text: `\u274C
|
|
3173
|
+
text: `\u274C Skill not found: ${agent}
|
|
3106
3174
|
|
|
3107
|
-
Available
|
|
3108
|
-
${this.agentRegistry.
|
|
3175
|
+
Available skills:
|
|
3176
|
+
${this.agentRegistry.getSkillNames().map((n) => `- ${n}`).join("\n")}`
|
|
3109
3177
|
}]
|
|
3110
3178
|
};
|
|
3111
3179
|
}
|
|
@@ -3132,13 +3200,13 @@ ${this.agentRegistry.getAgentNames().map((n) => `- ${n}`).join("\n")}`
|
|
|
3132
3200
|
};
|
|
3133
3201
|
}
|
|
3134
3202
|
const startTime = Date.now();
|
|
3135
|
-
return this.
|
|
3203
|
+
return this.runSkillScan(agentInstance, validFiles, startTime, output);
|
|
3136
3204
|
}
|
|
3137
3205
|
/**
|
|
3138
3206
|
* Run agent scan using the new hybrid AI system
|
|
3139
3207
|
* All agents now use scan() which has pattern detection + optional AI enhancement
|
|
3140
3208
|
*/
|
|
3141
|
-
async
|
|
3209
|
+
async runSkillScan(agentInstance, files, startTime, _outputMode) {
|
|
3142
3210
|
console.error(`
|
|
3143
3211
|
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501`);
|
|
3144
3212
|
console.error(`\u{1F50D} Running ${agentInstance.name.toUpperCase()} analysis`);
|
|
@@ -3154,37 +3222,18 @@ ${this.agentRegistry.getAgentNames().map((n) => `- ${n}`).join("\n")}`
|
|
|
3154
3222
|
return {
|
|
3155
3223
|
content: [{
|
|
3156
3224
|
type: "text",
|
|
3157
|
-
text: await this.
|
|
3225
|
+
text: await this.formatSkillResult(agentInstance.name, result.issues, files, executionTime)
|
|
3158
3226
|
}]
|
|
3159
3227
|
};
|
|
3160
3228
|
} catch (error) {
|
|
3161
3229
|
return {
|
|
3162
3230
|
content: [{
|
|
3163
3231
|
type: "text",
|
|
3164
|
-
text: `\u274C
|
|
3232
|
+
text: `\u274C Skill error: ${error instanceof Error ? error.message : String(error)}`
|
|
3165
3233
|
}]
|
|
3166
3234
|
};
|
|
3167
3235
|
}
|
|
3168
3236
|
}
|
|
3169
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3170
|
-
_generateKnowledgeSuggestions(followUps, agentName) {
|
|
3171
|
-
if (followUps.length === 0) {
|
|
3172
|
-
return "";
|
|
3173
|
-
}
|
|
3174
|
-
let output = `
|
|
3175
|
-
## \u{1F517} Suggested Follow-ups
|
|
3176
|
-
|
|
3177
|
-
`;
|
|
3178
|
-
for (const followUp of followUps) {
|
|
3179
|
-
output += `- ${followUp}
|
|
3180
|
-
`;
|
|
3181
|
-
}
|
|
3182
|
-
if (agentName === "security") {
|
|
3183
|
-
output += `- **CVE Check**: Run \`trie_security lookup:"cve" query:"[library-name]"\` to check for vulnerabilities
|
|
3184
|
-
`;
|
|
3185
|
-
}
|
|
3186
|
-
return output;
|
|
3187
|
-
}
|
|
3188
3237
|
handleKnowledgeLookup(lookup) {
|
|
3189
3238
|
const result = lookupKnowledge({
|
|
3190
3239
|
type: lookup.type,
|
|
@@ -3198,26 +3247,26 @@ ${this.agentRegistry.getAgentNames().map((n) => `- ${n}`).join("\n")}`
|
|
|
3198
3247
|
}]
|
|
3199
3248
|
};
|
|
3200
3249
|
}
|
|
3201
|
-
|
|
3202
|
-
const
|
|
3203
|
-
const
|
|
3204
|
-
const command = this.
|
|
3250
|
+
listSkills() {
|
|
3251
|
+
const skills = this.agentRegistry.getSkillDescriptions();
|
|
3252
|
+
const skillList = skills.map((a) => {
|
|
3253
|
+
const command = this.getSkillCommand(a.name);
|
|
3205
3254
|
return `| \`${command}\` | \u{1F50D}\u{1F916} ${a.name} | ${a.description} |`;
|
|
3206
3255
|
}).join("\n");
|
|
3207
3256
|
return {
|
|
3208
3257
|
content: [{
|
|
3209
3258
|
type: "text",
|
|
3210
|
-
text: `# \u{1F916} Available
|
|
3259
|
+
text: `# \u{1F916} Available Skills
|
|
3211
3260
|
|
|
3212
|
-
| Command |
|
|
3261
|
+
| Command | Skill | Description |
|
|
3213
3262
|
|---------|-------|-------------|
|
|
3214
|
-
${
|
|
3263
|
+
${skillList}
|
|
3215
3264
|
|
|
3216
3265
|
**Legend:** \u{1F50D}\u{1F916} = Pattern detection + AI enhancement (if ANTHROPIC_API_KEY is set)
|
|
3217
3266
|
|
|
3218
3267
|
## Usage
|
|
3219
3268
|
|
|
3220
|
-
### Run a specific
|
|
3269
|
+
### Run a specific skill:
|
|
3221
3270
|
\`\`\`
|
|
3222
3271
|
trie_security # Security vulnerabilities
|
|
3223
3272
|
trie_privacy # Privacy/GDPR compliance
|
|
@@ -3241,14 +3290,14 @@ trie_security lookup:{type:"cve", query:"lodash"}
|
|
|
3241
3290
|
trie_security lookup:{type:"docs", query:"XSS prevention", context:{framework:"react"}}
|
|
3242
3291
|
\`\`\`
|
|
3243
3292
|
|
|
3244
|
-
### Run all
|
|
3293
|
+
### Run all skills:
|
|
3245
3294
|
\`\`\`
|
|
3246
3295
|
trie_scan # Full scan with smart triaging
|
|
3247
3296
|
\`\`\``
|
|
3248
3297
|
}]
|
|
3249
3298
|
};
|
|
3250
3299
|
}
|
|
3251
|
-
|
|
3300
|
+
getSkillCommand(agentName) {
|
|
3252
3301
|
const commandMap = {
|
|
3253
3302
|
"security": "trie_security",
|
|
3254
3303
|
"privacy": "trie_privacy",
|
|
@@ -3263,14 +3312,14 @@ trie_scan # Full scan with smart triaging
|
|
|
3263
3312
|
"comprehension": "trie_explain",
|
|
3264
3313
|
"test": "trie_test"
|
|
3265
3314
|
};
|
|
3266
|
-
return commandMap[agentName] || `trie_scan --
|
|
3315
|
+
return commandMap[agentName] || `trie_scan --skill ${agentName}`;
|
|
3267
3316
|
}
|
|
3268
|
-
async
|
|
3317
|
+
async formatSkillResult(agentName, issues, files, executionTime) {
|
|
3269
3318
|
const critical = issues.filter((i) => i.severity === "critical").length;
|
|
3270
3319
|
const serious = issues.filter((i) => i.severity === "serious").length;
|
|
3271
3320
|
const moderate = issues.filter((i) => i.severity === "moderate").length;
|
|
3272
3321
|
const low = issues.filter((i) => i.severity === "low").length;
|
|
3273
|
-
const agentEmoji = this.
|
|
3322
|
+
const agentEmoji = this.getSkillEmoji(agentName);
|
|
3274
3323
|
let output = `
|
|
3275
3324
|
`;
|
|
3276
3325
|
output += `# ${agentEmoji} ${agentName.toUpperCase()} SCAN
|
|
@@ -3371,7 +3420,7 @@ ${issue.fix}
|
|
|
3371
3420
|
return null;
|
|
3372
3421
|
}
|
|
3373
3422
|
}
|
|
3374
|
-
|
|
3423
|
+
getSkillEmoji(agentName) {
|
|
3375
3424
|
const emojis = {
|
|
3376
3425
|
"security": "\u{1F512}",
|
|
3377
3426
|
"privacy": "\u{1F464}",
|
|
@@ -3981,7 +4030,7 @@ import { existsSync as existsSync7 } from "fs";
|
|
|
3981
4030
|
import { join as join5, basename as basename5, resolve as resolve5, isAbsolute as isAbsolute5 } from "path";
|
|
3982
4031
|
import { execSync } from "child_process";
|
|
3983
4032
|
var TriePRReviewTool = class {
|
|
3984
|
-
agent = new
|
|
4033
|
+
agent = new SuperReviewerSkill();
|
|
3985
4034
|
async execute(args) {
|
|
3986
4035
|
const {
|
|
3987
4036
|
pr,
|
|
@@ -4166,7 +4215,7 @@ Usage:
|
|
|
4166
4215
|
const headerLine = lines[0] || "";
|
|
4167
4216
|
const pathMatch = headerLine.match(/a\/(.+?) b\/(.+)/);
|
|
4168
4217
|
if (!pathMatch || !pathMatch[2]) continue;
|
|
4169
|
-
const
|
|
4218
|
+
const path3 = pathMatch[2];
|
|
4170
4219
|
const diff = `diff --git ${fileDiff}`;
|
|
4171
4220
|
let additions = 0;
|
|
4172
4221
|
let deletions = 0;
|
|
@@ -4177,7 +4226,7 @@ Usage:
|
|
|
4177
4226
|
deletions++;
|
|
4178
4227
|
}
|
|
4179
4228
|
}
|
|
4180
|
-
files.push({ path, diff, additions, deletions });
|
|
4229
|
+
files.push({ path: path3, diff, additions, deletions });
|
|
4181
4230
|
}
|
|
4182
4231
|
return files;
|
|
4183
4232
|
}
|
|
@@ -4609,11 +4658,16 @@ var TrieInitTool = class {
|
|
|
4609
4658
|
}
|
|
4610
4659
|
return context.injectedContent;
|
|
4611
4660
|
}
|
|
4612
|
-
const
|
|
4613
|
-
workDir
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4661
|
+
const initOptions = {
|
|
4662
|
+
workDir
|
|
4663
|
+
};
|
|
4664
|
+
if (params.force !== void 0) {
|
|
4665
|
+
initOptions.force = params.force;
|
|
4666
|
+
}
|
|
4667
|
+
if (params.skipBootstrap !== void 0) {
|
|
4668
|
+
initOptions.skipBootstrap = params.skipBootstrap;
|
|
4669
|
+
}
|
|
4670
|
+
const result = await initializeBootstrapFiles(initOptions);
|
|
4617
4671
|
const lines = [
|
|
4618
4672
|
"# Trie Workspace Initialized",
|
|
4619
4673
|
""
|
|
@@ -4686,13 +4740,20 @@ var TrieMemorySearchTool = class {
|
|
|
4686
4740
|
if (!params.query) {
|
|
4687
4741
|
return "Missing required parameter: query";
|
|
4688
4742
|
}
|
|
4689
|
-
const
|
|
4743
|
+
const searchOptions = {
|
|
4690
4744
|
workDir,
|
|
4691
|
-
limit: params.limit || 10
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
}
|
|
4745
|
+
limit: params.limit || 10
|
|
4746
|
+
};
|
|
4747
|
+
if (params.severity !== void 0) {
|
|
4748
|
+
searchOptions.severity = params.severity;
|
|
4749
|
+
}
|
|
4750
|
+
if (params.agent !== void 0) {
|
|
4751
|
+
searchOptions.agent = params.agent;
|
|
4752
|
+
}
|
|
4753
|
+
if (params.includeResolved !== void 0) {
|
|
4754
|
+
searchOptions.includeResolved = params.includeResolved;
|
|
4755
|
+
}
|
|
4756
|
+
const results = await searchIssues(params.query, searchOptions);
|
|
4696
4757
|
if (results.length === 0) {
|
|
4697
4758
|
return `No issues found matching "${params.query}"`;
|
|
4698
4759
|
}
|
|
@@ -4886,13 +4947,18 @@ async function handleCheckpointTool(input) {
|
|
|
4886
4947
|
const workDir = getWorkingDirectory(void 0, true);
|
|
4887
4948
|
switch (input.action) {
|
|
4888
4949
|
case "save": {
|
|
4889
|
-
const
|
|
4890
|
-
message: input.message,
|
|
4891
|
-
notes: input.notes,
|
|
4950
|
+
const saveOptions = {
|
|
4892
4951
|
files: input.files || [],
|
|
4893
4952
|
workDir,
|
|
4894
4953
|
createdBy: "mcp"
|
|
4895
|
-
}
|
|
4954
|
+
};
|
|
4955
|
+
if (input.message !== void 0) {
|
|
4956
|
+
saveOptions.message = input.message;
|
|
4957
|
+
}
|
|
4958
|
+
if (input.notes !== void 0) {
|
|
4959
|
+
saveOptions.notes = input.notes;
|
|
4960
|
+
}
|
|
4961
|
+
const checkpoint = await saveCheckpoint(saveOptions);
|
|
4896
4962
|
return `# Checkpoint Saved
|
|
4897
4963
|
|
|
4898
4964
|
**ID:** ${checkpoint.id}
|
|
@@ -4934,6 +5000,182 @@ ${checkpoint.files.length > 0 ? `**Files:** ${checkpoint.files.join(", ")}` : ""
|
|
|
4934
5000
|
}
|
|
4935
5001
|
}
|
|
4936
5002
|
|
|
5003
|
+
// src/tools/check.ts
|
|
5004
|
+
var TrieCheckTool = class {
|
|
5005
|
+
async execute(input = {}) {
|
|
5006
|
+
try {
|
|
5007
|
+
const workDir = input.directory || getWorkingDirectory(void 0, true);
|
|
5008
|
+
let files = input.files;
|
|
5009
|
+
if (!files || files.length === 0) {
|
|
5010
|
+
const perception = await perceiveCurrentChanges(workDir);
|
|
5011
|
+
files = perception.diffSummary.files.map((f) => f.filePath);
|
|
5012
|
+
}
|
|
5013
|
+
if (!files || files.length === 0) {
|
|
5014
|
+
return {
|
|
5015
|
+
content: [{
|
|
5016
|
+
type: "text",
|
|
5017
|
+
text: "No changes detected. Provide files or make a change."
|
|
5018
|
+
}]
|
|
5019
|
+
};
|
|
5020
|
+
}
|
|
5021
|
+
const mode = input.mode ?? "full";
|
|
5022
|
+
const runAgents = mode === "full";
|
|
5023
|
+
const reasoning = await reasonAboutChangesHumanReadable(workDir, files, {
|
|
5024
|
+
runAgents,
|
|
5025
|
+
scanContext: { config: { timeoutMs: mode === "quick" ? 15e3 : 6e4 } }
|
|
5026
|
+
});
|
|
5027
|
+
const summary = [
|
|
5028
|
+
`Risk: ${reasoning.original.riskLevel.toUpperCase()} (${reasoning.original.shouldBlock ? "block" : "allow"})`,
|
|
5029
|
+
`Explanation: ${reasoning.original.explanation}`,
|
|
5030
|
+
`Recommendation: ${reasoning.original.recommendation}`,
|
|
5031
|
+
`Plain summary: ${reasoning.summary}`,
|
|
5032
|
+
`What I found: ${reasoning.whatIFound}`,
|
|
5033
|
+
`How bad: ${reasoning.howBad}`,
|
|
5034
|
+
`What to do: ${reasoning.whatToDo}`
|
|
5035
|
+
].join("\n");
|
|
5036
|
+
return {
|
|
5037
|
+
content: [{
|
|
5038
|
+
type: "text",
|
|
5039
|
+
text: summary
|
|
5040
|
+
}]
|
|
5041
|
+
};
|
|
5042
|
+
} catch (error) {
|
|
5043
|
+
const friendly = formatFriendlyError(error);
|
|
5044
|
+
return { content: [{ type: "text", text: friendly.userMessage }] };
|
|
5045
|
+
}
|
|
5046
|
+
}
|
|
5047
|
+
};
|
|
5048
|
+
|
|
5049
|
+
// src/tools/tell.ts
|
|
5050
|
+
import path from "path";
|
|
5051
|
+
function escalateRisk(level) {
|
|
5052
|
+
if (level === "low") return "medium";
|
|
5053
|
+
if (level === "medium") return "high";
|
|
5054
|
+
if (level === "high") return "critical";
|
|
5055
|
+
return "critical";
|
|
5056
|
+
}
|
|
5057
|
+
function extractFilePathsFromDescription(description) {
|
|
5058
|
+
const matches = description.match(/[\\w./_-]+\\.(ts|tsx|js|jsx|mjs|cjs)/gi);
|
|
5059
|
+
if (!matches) return [];
|
|
5060
|
+
const unique = /* @__PURE__ */ new Set();
|
|
5061
|
+
matches.forEach((m) => unique.add(m.replace(/^\.\/+/, "")));
|
|
5062
|
+
return Array.from(unique);
|
|
5063
|
+
}
|
|
5064
|
+
var TrieTellTool = class {
|
|
5065
|
+
async execute(input) {
|
|
5066
|
+
try {
|
|
5067
|
+
const description = input.description?.trim();
|
|
5068
|
+
if (!description) {
|
|
5069
|
+
return { content: [{ type: "text", text: "description is required" }] };
|
|
5070
|
+
}
|
|
5071
|
+
const projectPath = input.directory || getWorkingDirectory(void 0, true);
|
|
5072
|
+
const graph = new ContextGraph(projectPath);
|
|
5073
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
5074
|
+
const change = (await graph.getRecentChanges(1))[0];
|
|
5075
|
+
const linkedFiles = /* @__PURE__ */ new Set();
|
|
5076
|
+
const incident = await graph.addNode("incident", {
|
|
5077
|
+
description,
|
|
5078
|
+
severity: "major",
|
|
5079
|
+
affectedUsers: null,
|
|
5080
|
+
duration: null,
|
|
5081
|
+
timestamp: now,
|
|
5082
|
+
resolved: false,
|
|
5083
|
+
resolution: null,
|
|
5084
|
+
fixChangeId: change?.id ?? null,
|
|
5085
|
+
reportedVia: "manual"
|
|
5086
|
+
});
|
|
5087
|
+
if (change) {
|
|
5088
|
+
await graph.addEdge(change.id, incident.id, "leadTo");
|
|
5089
|
+
await graph.addEdge(incident.id, change.id, "causedBy");
|
|
5090
|
+
for (const filePath of change.data.files) {
|
|
5091
|
+
linkedFiles.add(filePath);
|
|
5092
|
+
const fileNode = await graph.getNode("file", path.resolve(projectPath, filePath));
|
|
5093
|
+
if (fileNode) {
|
|
5094
|
+
const data = fileNode.data;
|
|
5095
|
+
await graph.updateNode("file", fileNode.id, {
|
|
5096
|
+
incidentCount: (data.incidentCount ?? 0) + 1,
|
|
5097
|
+
riskLevel: escalateRisk(data.riskLevel)
|
|
5098
|
+
});
|
|
5099
|
+
}
|
|
5100
|
+
}
|
|
5101
|
+
}
|
|
5102
|
+
const mentionedFiles = extractFilePathsFromDescription(description);
|
|
5103
|
+
mentionedFiles.forEach((f) => linkedFiles.add(f));
|
|
5104
|
+
const incidentIndex = new IncidentIndex(graph, projectPath);
|
|
5105
|
+
incidentIndex.addIncidentToTrie(incident, Array.from(linkedFiles));
|
|
5106
|
+
await exportToJson(graph);
|
|
5107
|
+
return {
|
|
5108
|
+
content: [{
|
|
5109
|
+
type: "text",
|
|
5110
|
+
text: `Incident recorded${change ? ` and linked to change ${change.id}` : ""}.`
|
|
5111
|
+
}]
|
|
5112
|
+
};
|
|
5113
|
+
} catch (error) {
|
|
5114
|
+
const friendly = formatFriendlyError(error);
|
|
5115
|
+
return { content: [{ type: "text", text: friendly.userMessage }] };
|
|
5116
|
+
}
|
|
5117
|
+
}
|
|
5118
|
+
};
|
|
5119
|
+
|
|
5120
|
+
// src/tools/reconcile.ts
|
|
5121
|
+
import path2 from "path";
|
|
5122
|
+
async function removeOrphanEdges(graph) {
|
|
5123
|
+
const nodes = await graph.listNodes();
|
|
5124
|
+
const ids = new Set(nodes.map((n) => n.id));
|
|
5125
|
+
const edges = await graph.listEdges();
|
|
5126
|
+
let removed = 0;
|
|
5127
|
+
for (const edge of edges) {
|
|
5128
|
+
if (!ids.has(edge.from_id) || !ids.has(edge.to_id)) {
|
|
5129
|
+
await graph.deleteEdge(edge.id);
|
|
5130
|
+
removed++;
|
|
5131
|
+
}
|
|
5132
|
+
}
|
|
5133
|
+
return removed;
|
|
5134
|
+
}
|
|
5135
|
+
var TrieReconcileTool = class {
|
|
5136
|
+
async execute(input = {}) {
|
|
5137
|
+
try {
|
|
5138
|
+
const projectPath = input.directory || getWorkingDirectory(void 0, true);
|
|
5139
|
+
const sourcePath = input.source ?? path2.join(projectPath, ".trie", "context.json");
|
|
5140
|
+
const graph = new ContextGraph(projectPath);
|
|
5141
|
+
await importFromJson(graph, "", sourcePath);
|
|
5142
|
+
const removed = await removeOrphanEdges(graph);
|
|
5143
|
+
return {
|
|
5144
|
+
content: [{
|
|
5145
|
+
type: "text",
|
|
5146
|
+
text: `Reconciled context from ${sourcePath}. Removed ${removed} orphaned edges.`
|
|
5147
|
+
}]
|
|
5148
|
+
};
|
|
5149
|
+
} catch (error) {
|
|
5150
|
+
const friendly = formatFriendlyError(error);
|
|
5151
|
+
return { content: [{ type: "text", text: friendly.userMessage }] };
|
|
5152
|
+
}
|
|
5153
|
+
}
|
|
5154
|
+
};
|
|
5155
|
+
|
|
5156
|
+
// src/tools/context.ts
|
|
5157
|
+
var TrieContextTool = class {
|
|
5158
|
+
async execute(input = {}) {
|
|
5159
|
+
try {
|
|
5160
|
+
const workDir = input.directory || getWorkingDirectory(void 0, true);
|
|
5161
|
+
const graph = new ContextGraph(workDir);
|
|
5162
|
+
const snapshot = await graph.getSnapshot();
|
|
5163
|
+
await exportToJson(graph);
|
|
5164
|
+
const summary = `Nodes: ${snapshot.nodes.length}, Edges: ${snapshot.edges.length}, Exported: ${snapshot.exported_at}`;
|
|
5165
|
+
return {
|
|
5166
|
+
content: [{
|
|
5167
|
+
type: "text",
|
|
5168
|
+
text: summary
|
|
5169
|
+
}],
|
|
5170
|
+
data: snapshot
|
|
5171
|
+
};
|
|
5172
|
+
} catch (error) {
|
|
5173
|
+
const friendly = formatFriendlyError(error);
|
|
5174
|
+
return { content: [{ type: "text", text: friendly.userMessage }] };
|
|
5175
|
+
}
|
|
5176
|
+
}
|
|
5177
|
+
};
|
|
5178
|
+
|
|
4937
5179
|
// src/server/tool-registry.ts
|
|
4938
5180
|
var TrieCheckpointTool = class {
|
|
4939
5181
|
async execute(input) {
|
|
@@ -4966,6 +5208,13 @@ var ToolRegistry = class {
|
|
|
4966
5208
|
this.tools.set("init", new TrieInitTool());
|
|
4967
5209
|
this.tools.set("memory", new TrieMemorySearchTool());
|
|
4968
5210
|
this.tools.set("checkpoint", new TrieCheckpointTool());
|
|
5211
|
+
this.tools.set("check", new TrieCheckTool());
|
|
5212
|
+
this.tools.set("tell", new TrieTellTool());
|
|
5213
|
+
this.tools.set("reconcile", new TrieReconcileTool());
|
|
5214
|
+
this.tools.set("context", new TrieContextTool());
|
|
5215
|
+
this.tools.set("feedback", new TrieFeedbackTool());
|
|
5216
|
+
this.tools.set("ok", new TrieFeedbackTool());
|
|
5217
|
+
this.tools.set("bad", new TrieFeedbackTool());
|
|
4969
5218
|
}
|
|
4970
5219
|
defineToolSchemas() {
|
|
4971
5220
|
this.definitions = [
|
|
@@ -5113,6 +5362,70 @@ var ToolRegistry = class {
|
|
|
5113
5362
|
required: ["type", "target"]
|
|
5114
5363
|
}
|
|
5115
5364
|
},
|
|
5365
|
+
{
|
|
5366
|
+
name: "trie_feedback",
|
|
5367
|
+
description: "Record quick feedback about a warning or suggestion (thumbs up/down). Alias: trie_ok, trie_bad",
|
|
5368
|
+
inputSchema: {
|
|
5369
|
+
type: "object",
|
|
5370
|
+
properties: {
|
|
5371
|
+
helpful: { type: "boolean", description: "true for \u{1F44D}, false for \u{1F44E}" },
|
|
5372
|
+
target: { type: "string", description: "Optional file or item being rated" },
|
|
5373
|
+
note: { type: "string", description: "Optional short note about why" },
|
|
5374
|
+
files: {
|
|
5375
|
+
type: "array",
|
|
5376
|
+
items: { type: "string" },
|
|
5377
|
+
description: "Optional related files (absolute or relative)"
|
|
5378
|
+
},
|
|
5379
|
+
directory: { type: "string", description: "Working directory (defaults to auto-detected)" }
|
|
5380
|
+
},
|
|
5381
|
+
required: ["helpful"]
|
|
5382
|
+
}
|
|
5383
|
+
},
|
|
5384
|
+
{
|
|
5385
|
+
name: "trie_check",
|
|
5386
|
+
description: "Run Trie risk check on current changes. Modes: quick, full, offline.",
|
|
5387
|
+
inputSchema: {
|
|
5388
|
+
type: "object",
|
|
5389
|
+
properties: {
|
|
5390
|
+
directory: { type: "string" },
|
|
5391
|
+
files: { type: "array", items: { type: "string" } },
|
|
5392
|
+
mode: { type: "string", enum: ["quick", "full", "offline"] }
|
|
5393
|
+
}
|
|
5394
|
+
}
|
|
5395
|
+
},
|
|
5396
|
+
{
|
|
5397
|
+
name: "trie_tell",
|
|
5398
|
+
description: "Report an incident so Trie can learn.",
|
|
5399
|
+
inputSchema: {
|
|
5400
|
+
type: "object",
|
|
5401
|
+
properties: {
|
|
5402
|
+
description: { type: "string" },
|
|
5403
|
+
directory: { type: "string" }
|
|
5404
|
+
},
|
|
5405
|
+
required: ["description"]
|
|
5406
|
+
}
|
|
5407
|
+
},
|
|
5408
|
+
{
|
|
5409
|
+
name: "trie_reconcile",
|
|
5410
|
+
description: "Re-sync context graph from context.json and clean orphaned edges.",
|
|
5411
|
+
inputSchema: {
|
|
5412
|
+
type: "object",
|
|
5413
|
+
properties: {
|
|
5414
|
+
directory: { type: "string" },
|
|
5415
|
+
source: { type: "string" }
|
|
5416
|
+
}
|
|
5417
|
+
}
|
|
5418
|
+
},
|
|
5419
|
+
{
|
|
5420
|
+
name: "trie_context",
|
|
5421
|
+
description: "Return current context snapshot (nodes/edges) and export context.json.",
|
|
5422
|
+
inputSchema: {
|
|
5423
|
+
type: "object",
|
|
5424
|
+
properties: {
|
|
5425
|
+
directory: { type: "string" }
|
|
5426
|
+
}
|
|
5427
|
+
}
|
|
5428
|
+
},
|
|
5116
5429
|
{
|
|
5117
5430
|
name: "trie_test",
|
|
5118
5431
|
description: "Generate or reason about tests. Alias: test",
|
|
@@ -5531,7 +5844,7 @@ import { readdir as readdir2, readFile as readFile6 } from "fs/promises";
|
|
|
5531
5844
|
import { existsSync as existsSync8 } from "fs";
|
|
5532
5845
|
import { join as join6 } from "path";
|
|
5533
5846
|
var ResourceManager = class {
|
|
5534
|
-
|
|
5847
|
+
skillRegistry = getSkillRegistry();
|
|
5535
5848
|
/**
|
|
5536
5849
|
* Get all available resources dynamically
|
|
5537
5850
|
*/
|
|
@@ -5557,9 +5870,9 @@ var ResourceManager = class {
|
|
|
5557
5870
|
mimeType: "application/json"
|
|
5558
5871
|
},
|
|
5559
5872
|
{
|
|
5560
|
-
uri: "trie://
|
|
5561
|
-
name: "Available
|
|
5562
|
-
description: "List of all available Trie
|
|
5873
|
+
uri: "trie://skills",
|
|
5874
|
+
name: "Available Skills",
|
|
5875
|
+
description: "List of all available Trie skills (built-in and custom)",
|
|
5563
5876
|
mimeType: "application/json"
|
|
5564
5877
|
},
|
|
5565
5878
|
{
|
|
@@ -5581,9 +5894,9 @@ var ResourceManager = class {
|
|
|
5581
5894
|
mimeType: "application/json"
|
|
5582
5895
|
},
|
|
5583
5896
|
{
|
|
5584
|
-
uri: "trie://skills",
|
|
5897
|
+
uri: "trie://skills/installed",
|
|
5585
5898
|
name: "Installed Skills",
|
|
5586
|
-
description: "External skills installed from skills.sh that
|
|
5899
|
+
description: "External skills installed from skills.sh that the guardian can apply",
|
|
5587
5900
|
mimeType: "application/json"
|
|
5588
5901
|
},
|
|
5589
5902
|
{
|
|
@@ -5618,7 +5931,7 @@ var ResourceManager = class {
|
|
|
5618
5931
|
}
|
|
5619
5932
|
);
|
|
5620
5933
|
resources.push(...await this.getScanReportResources());
|
|
5621
|
-
resources.push(...await this.
|
|
5934
|
+
resources.push(...await this.getCustomSkillResources());
|
|
5622
5935
|
return resources;
|
|
5623
5936
|
}
|
|
5624
5937
|
async getScanReportResources() {
|
|
@@ -5636,14 +5949,14 @@ var ResourceManager = class {
|
|
|
5636
5949
|
return [];
|
|
5637
5950
|
}
|
|
5638
5951
|
}
|
|
5639
|
-
async
|
|
5952
|
+
async getCustomSkillResources() {
|
|
5640
5953
|
try {
|
|
5641
|
-
await this.
|
|
5642
|
-
const
|
|
5643
|
-
return
|
|
5644
|
-
uri: `trie://skills/custom/${
|
|
5645
|
-
name: `Custom Skill: ${
|
|
5646
|
-
description:
|
|
5954
|
+
await this.skillRegistry.loadCustomSkills();
|
|
5955
|
+
const customSkills = this.skillRegistry.getCustomSkills();
|
|
5956
|
+
return customSkills.map((skill) => ({
|
|
5957
|
+
uri: `trie://skills/custom/${skill.name}`,
|
|
5958
|
+
name: `Custom Skill: ${skill.name}`,
|
|
5959
|
+
description: skill.description,
|
|
5647
5960
|
mimeType: "application/json"
|
|
5648
5961
|
}));
|
|
5649
5962
|
} catch {
|
|
@@ -5664,11 +5977,11 @@ var ResourceManager = class {
|
|
|
5664
5977
|
if (parsedUri === "context/state") {
|
|
5665
5978
|
return await this.getContextStateResource(uri);
|
|
5666
5979
|
}
|
|
5667
|
-
if (parsedUri === "
|
|
5668
|
-
return await this.
|
|
5980
|
+
if (parsedUri === "skills") {
|
|
5981
|
+
return await this.getBuiltInSkillsResource(uri);
|
|
5669
5982
|
}
|
|
5670
|
-
if (parsedUri.startsWith("
|
|
5671
|
-
return await this.
|
|
5983
|
+
if (parsedUri.startsWith("skills/custom/")) {
|
|
5984
|
+
return await this.getCustomSkillResource(uri, parsedUri);
|
|
5672
5985
|
}
|
|
5673
5986
|
if (parsedUri === "config") {
|
|
5674
5987
|
return await this.getConfigResource(uri);
|
|
@@ -5679,8 +5992,8 @@ var ResourceManager = class {
|
|
|
5679
5992
|
if (parsedUri === "signatures") {
|
|
5680
5993
|
return await this.getSignaturesResource(uri);
|
|
5681
5994
|
}
|
|
5682
|
-
if (parsedUri === "skills") {
|
|
5683
|
-
return await this.
|
|
5995
|
+
if (parsedUri === "skills/installed") {
|
|
5996
|
+
return await this.getInstalledSkillsResource(uri);
|
|
5684
5997
|
}
|
|
5685
5998
|
if (parsedUri === "bootstrap") {
|
|
5686
5999
|
return await this.getBootstrapResource(uri);
|
|
@@ -5856,18 +6169,18 @@ This information is automatically available to Claude Code, Cursor, and other AI
|
|
|
5856
6169
|
}]
|
|
5857
6170
|
};
|
|
5858
6171
|
}
|
|
5859
|
-
async
|
|
5860
|
-
await this.
|
|
5861
|
-
const
|
|
6172
|
+
async getBuiltInSkillsResource(uri) {
|
|
6173
|
+
await this.skillRegistry.loadCustomSkills();
|
|
6174
|
+
const skills = this.skillRegistry.getSkillDescriptions();
|
|
5862
6175
|
return {
|
|
5863
6176
|
contents: [{
|
|
5864
6177
|
uri,
|
|
5865
6178
|
mimeType: "application/json",
|
|
5866
6179
|
text: JSON.stringify({
|
|
5867
|
-
|
|
5868
|
-
builtinCount:
|
|
5869
|
-
customCount:
|
|
5870
|
-
|
|
6180
|
+
totalSkills: skills.length,
|
|
6181
|
+
builtinCount: skills.filter((a) => !a.isCustom).length,
|
|
6182
|
+
customCount: skills.filter((a) => a.isCustom).length,
|
|
6183
|
+
skills: skills.map((a) => ({
|
|
5871
6184
|
name: a.name,
|
|
5872
6185
|
description: a.description,
|
|
5873
6186
|
type: a.isCustom ? "custom" : "builtin"
|
|
@@ -5876,12 +6189,12 @@ This information is automatically available to Claude Code, Cursor, and other AI
|
|
|
5876
6189
|
}]
|
|
5877
6190
|
};
|
|
5878
6191
|
}
|
|
5879
|
-
async
|
|
5880
|
-
const
|
|
5881
|
-
await this.
|
|
5882
|
-
const metadata = this.
|
|
6192
|
+
async getCustomSkillResource(uri, parsedUri) {
|
|
6193
|
+
const skillName = parsedUri.replace("skills/custom/", "");
|
|
6194
|
+
await this.skillRegistry.loadCustomSkills();
|
|
6195
|
+
const metadata = this.skillRegistry.getCustomSkillMetadata(skillName);
|
|
5883
6196
|
if (!metadata) {
|
|
5884
|
-
throw new Error(`Custom
|
|
6197
|
+
throw new Error(`Custom skill not found: ${skillName}`);
|
|
5885
6198
|
}
|
|
5886
6199
|
return {
|
|
5887
6200
|
contents: [{
|
|
@@ -5954,7 +6267,7 @@ This information is automatically available to Claude Code, Cursor, and other AI
|
|
|
5954
6267
|
}]
|
|
5955
6268
|
};
|
|
5956
6269
|
}
|
|
5957
|
-
async
|
|
6270
|
+
async getInstalledSkillsResource(uri) {
|
|
5958
6271
|
const skills = await listInstalledSkills();
|
|
5959
6272
|
const state = await loadContextState();
|
|
5960
6273
|
const skillsWithUsage = skills.map((skill) => {
|
|
@@ -6443,6 +6756,18 @@ var RequestHandlers = class {
|
|
|
6443
6756
|
return await this.toolRegistry.getTool("init").execute(args);
|
|
6444
6757
|
case "memory":
|
|
6445
6758
|
return await this.toolRegistry.getTool("memory").execute(args);
|
|
6759
|
+
case "check":
|
|
6760
|
+
return await this.toolRegistry.getTool("check").execute(args);
|
|
6761
|
+
case "tell":
|
|
6762
|
+
return await this.toolRegistry.getTool("tell").execute(args);
|
|
6763
|
+
case "feedback":
|
|
6764
|
+
case "ok":
|
|
6765
|
+
case "bad":
|
|
6766
|
+
return await this.toolRegistry.getTool("feedback").execute(args);
|
|
6767
|
+
case "reconcile":
|
|
6768
|
+
return await this.toolRegistry.getTool("reconcile").execute(args);
|
|
6769
|
+
case "context":
|
|
6770
|
+
return await this.toolRegistry.getTool("context").execute(args);
|
|
6446
6771
|
case "checkpoint":
|
|
6447
6772
|
case "cp":
|
|
6448
6773
|
case "save":
|
|
@@ -6510,7 +6835,7 @@ var RequestHandlers = class {
|
|
|
6510
6835
|
"**Most common:**",
|
|
6511
6836
|
"- `trie` (no args) \u2014 show this menu",
|
|
6512
6837
|
'- `trie` with `{ action: "scan", files?: [], directory?: "" }` \u2014 auto triage & scan',
|
|
6513
|
-
'- `trie` with `{ action: "security", files?: [] }` \u2014 single-
|
|
6838
|
+
'- `trie` with `{ action: "security", files?: [] }` \u2014 single-skill run (any skill name works)',
|
|
6514
6839
|
'- `trie` with `{ action: "agent_smith" }` \u2014 aggressive AI-pattern hunter',
|
|
6515
6840
|
"",
|
|
6516
6841
|
"**Other actions:**",
|
|
@@ -6522,10 +6847,10 @@ var RequestHandlers = class {
|
|
|
6522
6847
|
'- `action: "list_skills"` \u2014 list all skills (external + custom)',
|
|
6523
6848
|
'- `action: "visual_qa_browser"` \u2014 screenshots for visual QA',
|
|
6524
6849
|
"",
|
|
6525
|
-
"**Built-in
|
|
6850
|
+
"**Built-in skills:**",
|
|
6526
6851
|
"`security`, `privacy`, `legal`, `accessibility`, `design`, `architecture`, `bugs`, `ux`, `types`, `devops`, `clean`, `soc2`, `performance`, `e2e`, `visual_qa`, `data_flow`",
|
|
6527
6852
|
"",
|
|
6528
|
-
"**Special
|
|
6853
|
+
"**Special skills:**",
|
|
6529
6854
|
"`agent_smith` \u2014 35 vibe code hunters with cross-file detection",
|
|
6530
6855
|
"`super_reviewer` \u2014 Interactive PR review with cross-examination",
|
|
6531
6856
|
"",
|
|
@@ -6535,16 +6860,16 @@ var RequestHandlers = class {
|
|
|
6535
6860
|
};
|
|
6536
6861
|
}
|
|
6537
6862
|
async handleAgentSmith(smithArgs) {
|
|
6538
|
-
const {
|
|
6863
|
+
const { AgentSmithSkill } = await import("./agent-smith-BECRZH73.js");
|
|
6539
6864
|
if (smithArgs.clear_memory) {
|
|
6540
|
-
const smith = new
|
|
6865
|
+
const smith = new AgentSmithSkill();
|
|
6541
6866
|
const result = await smith.clearMemory();
|
|
6542
6867
|
return {
|
|
6543
6868
|
content: [{ type: "text", text: result.message }]
|
|
6544
6869
|
};
|
|
6545
6870
|
}
|
|
6546
6871
|
if (smithArgs.show_stats) {
|
|
6547
|
-
const smith = new
|
|
6872
|
+
const smith = new AgentSmithSkill();
|
|
6548
6873
|
const stats = await smith.getMemoryStats();
|
|
6549
6874
|
return {
|
|
6550
6875
|
content: [{
|
|
@@ -6563,7 +6888,7 @@ var RequestHandlers = class {
|
|
|
6563
6888
|
}]
|
|
6564
6889
|
};
|
|
6565
6890
|
}
|
|
6566
|
-
const agentSmithRunner = await import("./agent-smith-runner-
|
|
6891
|
+
const agentSmithRunner = await import("./agent-smith-runner-LZRXM2Q2.js");
|
|
6567
6892
|
return await agentSmithRunner.runAgentSmith(smithArgs);
|
|
6568
6893
|
}
|
|
6569
6894
|
};
|
|
@@ -6614,7 +6939,7 @@ var MCPServer = class {
|
|
|
6614
6939
|
/**
|
|
6615
6940
|
* Show startup banner
|
|
6616
6941
|
*/
|
|
6617
|
-
showStartupBanner(
|
|
6942
|
+
showStartupBanner(skillCount, aiTool) {
|
|
6618
6943
|
console.error(`
|
|
6619
6944
|
\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
|
|
6620
6945
|
\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D
|
|
@@ -6622,17 +6947,17 @@ var MCPServer = class {
|
|
|
6622
6947
|
\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D
|
|
6623
6948
|
\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
|
|
6624
6949
|
\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
6625
|
-
Your central registry for
|
|
6950
|
+
Your central registry for the guardian and its skills
|
|
6626
6951
|
|
|
6627
6952
|
by Louis Kishfy
|
|
6628
6953
|
|
|
6629
6954
|
Download the Trie workspace: https://www.trie.dev
|
|
6630
6955
|
Follow me on X: https://x.com/louiskishfy
|
|
6631
6956
|
|
|
6632
|
-
${
|
|
6957
|
+
${skillCount} skills ready | ${aiTool}
|
|
6633
6958
|
|
|
6634
6959
|
Quick Start:
|
|
6635
|
-
\u2022 "Scan this code" - Run all relevant
|
|
6960
|
+
\u2022 "Scan this code" - Run all relevant skills
|
|
6636
6961
|
\u2022 "Run trie_security" - Security scan only
|
|
6637
6962
|
\u2022 "Run trie_soc2" - SOC 2 compliance check
|
|
6638
6963
|
\u2022 "Use trie_list_skills" - See all skills
|
|
@@ -6648,9 +6973,9 @@ var MCPServer = class {
|
|
|
6648
6973
|
try {
|
|
6649
6974
|
const aiTool = detectAITool();
|
|
6650
6975
|
await loadConfig();
|
|
6651
|
-
const registry =
|
|
6652
|
-
const
|
|
6653
|
-
this.showStartupBanner(
|
|
6976
|
+
const registry = getSkillRegistry();
|
|
6977
|
+
const skillCount = registry.getAllSkills().length;
|
|
6978
|
+
this.showStartupBanner(skillCount, aiTool.name);
|
|
6654
6979
|
const transport = new StdioServerTransport();
|
|
6655
6980
|
await this.server.connect(transport);
|
|
6656
6981
|
} catch (error) {
|