@triedotdev/mcp 1.0.79 → 1.0.81
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 +91 -20
- package/dist/{agent-smith-XGYNJUCJ.js → agent-smith-MCKGNWPL.js} +3 -3
- package/dist/{agent-smith-runner-QHYGVRNR.js → agent-smith-runner-GP5HLL7E.js} +3 -3
- package/dist/{chunk-LNLLZQWH.js → chunk-2BXLPYHR.js} +604 -138
- package/dist/chunk-2BXLPYHR.js.map +1 -0
- package/dist/{chunk-35FAFFHE.js → chunk-75J4HQTD.js} +2 -2
- package/dist/{chunk-RRDDAD5N.js → chunk-7OVM6KEY.js} +34 -7
- package/dist/chunk-7OVM6KEY.js.map +1 -0
- package/dist/chunk-B7CLAOEK.js +532 -0
- package/dist/chunk-B7CLAOEK.js.map +1 -0
- package/dist/{chunk-Z7N7KDK3.js → chunk-DCJKNE2L.js} +2 -1
- package/dist/{chunk-P6VLSYXN.js → chunk-EWIEXQES.js} +2 -2
- package/dist/{chunk-53URTRWH.js → chunk-FW435YKY.js} +300 -440
- package/dist/chunk-FW435YKY.js.map +1 -0
- package/dist/{chunk-UPKBO5EM.js → chunk-MVWRFARH.js} +137 -559
- package/dist/chunk-MVWRFARH.js.map +1 -0
- package/dist/{chunk-EWQF6INU.js → chunk-TBRU735C.js} +2 -2
- package/dist/{chunk-AIC4HOOQ.js → chunk-U5P3O5G5.js} +3 -3
- package/dist/{chunk-6QKDEGWR.js → chunk-WGECLUDQ.js} +4 -4
- package/dist/chunk-WGECLUDQ.js.map +1 -0
- package/dist/{chunk-3RKY55HZ.js → chunk-YKG4KIY7.js} +673 -83
- package/dist/chunk-YKG4KIY7.js.map +1 -0
- package/dist/cli/main.js +296 -64
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/yolo-daemon.js +12 -11
- package/dist/cli/yolo-daemon.js.map +1 -1
- package/dist/{goal-manager-NI4LJ2SX.js → goal-manager-NHPEUWFY.js} +4 -4
- package/dist/guardian-agent-GWYDNLWC.js +21 -0
- package/dist/index.js +115 -50
- package/dist/index.js.map +1 -1
- package/dist/{issue-store-MULGOF6B.js → issue-store-RKJVOKSJ.js} +2 -2
- package/dist/ui/memory-viewer.html +4 -4
- package/dist/ui/pr-review.html +4 -4
- package/dist/ui/scan-dashboard.html +4 -4
- package/dist/ui/visual-qa.html +4 -4
- package/dist/workers/agent-worker.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-3RKY55HZ.js.map +0 -1
- package/dist/chunk-53URTRWH.js.map +0 -1
- package/dist/chunk-6QKDEGWR.js.map +0 -1
- package/dist/chunk-LNLLZQWH.js.map +0 -1
- package/dist/chunk-RRDDAD5N.js.map +0 -1
- package/dist/chunk-UPKBO5EM.js.map +0 -1
- package/dist/guardian-agent-R5HX7UWJ.js +0 -17
- /package/dist/{agent-smith-XGYNJUCJ.js.map → agent-smith-MCKGNWPL.js.map} +0 -0
- /package/dist/{agent-smith-runner-QHYGVRNR.js.map → agent-smith-runner-GP5HLL7E.js.map} +0 -0
- /package/dist/{chunk-35FAFFHE.js.map → chunk-75J4HQTD.js.map} +0 -0
- /package/dist/{chunk-Z7N7KDK3.js.map → chunk-DCJKNE2L.js.map} +0 -0
- /package/dist/{chunk-P6VLSYXN.js.map → chunk-EWIEXQES.js.map} +0 -0
- /package/dist/{chunk-EWQF6INU.js.map → chunk-TBRU735C.js.map} +0 -0
- /package/dist/{chunk-AIC4HOOQ.js.map → chunk-U5P3O5G5.js.map} +0 -0
- /package/dist/{goal-manager-NI4LJ2SX.js.map → goal-manager-NHPEUWFY.js.map} +0 -0
- /package/dist/{guardian-agent-R5HX7UWJ.js.map → guardian-agent-GWYDNLWC.js.map} +0 -0
- /package/dist/{issue-store-MULGOF6B.js.map → issue-store-RKJVOKSJ.js.map} +0 -0
package/dist/cli/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
ContextGraph,
|
|
4
3
|
IncidentIndex,
|
|
5
|
-
|
|
4
|
+
LearningEngine,
|
|
5
|
+
LinearIngester,
|
|
6
6
|
completeBootstrap,
|
|
7
7
|
exportToJson,
|
|
8
8
|
formatFriendlyError,
|
|
@@ -17,18 +17,31 @@ import {
|
|
|
17
17
|
shouldAutoFix,
|
|
18
18
|
shouldBlockPush,
|
|
19
19
|
trackIssueOccurrence
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-FW435YKY.js";
|
|
21
21
|
import {
|
|
22
22
|
SKILL_CATEGORIES,
|
|
23
23
|
detectStack,
|
|
24
24
|
getSkillCategories,
|
|
25
25
|
getSkillsByCategory,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
getStagedChanges,
|
|
27
|
+
getUncommittedChanges,
|
|
28
|
+
isTrieInitialized,
|
|
29
|
+
loadConfig,
|
|
30
|
+
saveConfig
|
|
31
|
+
} from "../chunk-2BXLPYHR.js";
|
|
32
|
+
import {
|
|
33
|
+
ContextGraph,
|
|
34
|
+
GotchaPredictor
|
|
35
|
+
} from "../chunk-B7CLAOEK.js";
|
|
36
|
+
import "../chunk-FCMAQSV7.js";
|
|
28
37
|
import {
|
|
29
38
|
getGuardianState
|
|
30
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-75J4HQTD.js";
|
|
31
40
|
import {
|
|
41
|
+
formatAuditLog,
|
|
42
|
+
getAuditStatistics,
|
|
43
|
+
getRecentAuditLogs,
|
|
44
|
+
getSkillAuditLogs,
|
|
32
45
|
initProjectInfo,
|
|
33
46
|
installSkill,
|
|
34
47
|
listInstalledSkills,
|
|
@@ -37,18 +50,18 @@ import {
|
|
|
37
50
|
projectInfoExists,
|
|
38
51
|
recordSkillInstalled,
|
|
39
52
|
removeSkill
|
|
40
|
-
} from "../chunk-
|
|
53
|
+
} from "../chunk-YKG4KIY7.js";
|
|
41
54
|
import {
|
|
42
55
|
findCrossProjectPatterns,
|
|
43
56
|
getGlobalMemoryStats,
|
|
44
57
|
listTrackedProjects,
|
|
45
58
|
searchGlobalPatterns,
|
|
46
59
|
updateGlobalMemoryMd
|
|
47
|
-
} from "../chunk-
|
|
60
|
+
} from "../chunk-EWIEXQES.js";
|
|
48
61
|
import "../chunk-SH2JIQLB.js";
|
|
49
62
|
import "../chunk-6NLHFIYA.js";
|
|
50
|
-
import "../chunk-
|
|
51
|
-
import "../chunk-
|
|
63
|
+
import "../chunk-TBRU735C.js";
|
|
64
|
+
import "../chunk-DCJKNE2L.js";
|
|
52
65
|
import {
|
|
53
66
|
getDailyLogs,
|
|
54
67
|
getMemoryStats,
|
|
@@ -56,7 +69,7 @@ import {
|
|
|
56
69
|
markIssueResolved,
|
|
57
70
|
purgeIssues,
|
|
58
71
|
searchIssues
|
|
59
|
-
} from "../chunk-
|
|
72
|
+
} from "../chunk-WGECLUDQ.js";
|
|
60
73
|
import {
|
|
61
74
|
getWorkingDirectory
|
|
62
75
|
} from "../chunk-CM7EHNQK.js";
|
|
@@ -621,7 +634,7 @@ async function handleStats() {
|
|
|
621
634
|
if (cap.isAtCap) {
|
|
622
635
|
console.log("\n\u26A0\uFE0F CAPACITY WARNING");
|
|
623
636
|
console.log(` Memory is at maximum capacity (${cap.current}/${cap.max}, ${cap.percentFull}%)`);
|
|
624
|
-
console.log(" New issues are
|
|
637
|
+
console.log(" New repeats are deduplicated. Older issues are compacted into summaries, and if still over cap the oldest/lowest-value issues are pruned.");
|
|
625
638
|
console.log("\n To free up space:");
|
|
626
639
|
console.log(" trie memory purge smart - Remove resolved & old low-priority (recommended)");
|
|
627
640
|
console.log(" trie memory purge resolved - Remove all resolved issues");
|
|
@@ -1813,30 +1826,6 @@ async function handleReconcileCommand(args) {
|
|
|
1813
1826
|
}
|
|
1814
1827
|
}
|
|
1815
1828
|
|
|
1816
|
-
// src/cli/ok.ts
|
|
1817
|
-
async function handleOkCommand(args) {
|
|
1818
|
-
const helpful = true;
|
|
1819
|
-
const noteText = args.join(" ").trim();
|
|
1820
|
-
const tool = new TrieFeedbackTool();
|
|
1821
|
-
const input = noteText ? { helpful, note: noteText } : { helpful };
|
|
1822
|
-
const result = await tool.execute(input);
|
|
1823
|
-
if (result?.content?.[0]?.text) {
|
|
1824
|
-
console.log(result.content[0].text);
|
|
1825
|
-
}
|
|
1826
|
-
}
|
|
1827
|
-
|
|
1828
|
-
// src/cli/bad.ts
|
|
1829
|
-
async function handleBadCommand(args) {
|
|
1830
|
-
const helpful = false;
|
|
1831
|
-
const noteText = args.join(" ").trim();
|
|
1832
|
-
const tool = new TrieFeedbackTool();
|
|
1833
|
-
const input = noteText ? { helpful, note: noteText } : { helpful };
|
|
1834
|
-
const result = await tool.execute(input);
|
|
1835
|
-
if (result?.content?.[0]?.text) {
|
|
1836
|
-
console.log(result.content[0].text);
|
|
1837
|
-
}
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
1829
|
// src/cli/quiet.ts
|
|
1841
1830
|
import fs3 from "fs";
|
|
1842
1831
|
import path5 from "path";
|
|
@@ -2028,6 +2017,228 @@ ${pc4.bold("REQUIRED SECRETS:")}
|
|
|
2028
2017
|
console.log(pc4.dim(" \u2022 Recognizes recurring patterns"));
|
|
2029
2018
|
}
|
|
2030
2019
|
|
|
2020
|
+
// src/cli/audit.ts
|
|
2021
|
+
async function handleAuditCommand(args) {
|
|
2022
|
+
const [cmd, ...rest] = args;
|
|
2023
|
+
switch (cmd) {
|
|
2024
|
+
case "logs":
|
|
2025
|
+
case "list": {
|
|
2026
|
+
const limit = rest[0] ? parseInt(rest[0], 10) : 20;
|
|
2027
|
+
const logs = await getRecentAuditLogs(limit);
|
|
2028
|
+
if (logs.length === 0) {
|
|
2029
|
+
console.log("\nNo audit logs found.");
|
|
2030
|
+
console.log("Audit logs are created when skills are executed during scans.\n");
|
|
2031
|
+
return;
|
|
2032
|
+
}
|
|
2033
|
+
console.log(`
|
|
2034
|
+
Recent Skill Executions (last ${logs.length}):
|
|
2035
|
+
`);
|
|
2036
|
+
for (const log of logs) {
|
|
2037
|
+
console.log(formatAuditLog(log));
|
|
2038
|
+
console.log("");
|
|
2039
|
+
}
|
|
2040
|
+
break;
|
|
2041
|
+
}
|
|
2042
|
+
case "skill": {
|
|
2043
|
+
if (!rest[0]) {
|
|
2044
|
+
console.log("Usage: trie audit skill <skill-name>");
|
|
2045
|
+
console.log("");
|
|
2046
|
+
console.log("View audit logs for a specific skill.");
|
|
2047
|
+
return;
|
|
2048
|
+
}
|
|
2049
|
+
const skillName = rest[0];
|
|
2050
|
+
const logs = await getSkillAuditLogs(skillName);
|
|
2051
|
+
if (logs.length === 0) {
|
|
2052
|
+
console.log(`
|
|
2053
|
+
No audit logs found for skill: ${skillName}
|
|
2054
|
+
`);
|
|
2055
|
+
return;
|
|
2056
|
+
}
|
|
2057
|
+
console.log(`
|
|
2058
|
+
Audit Logs for ${skillName} (${logs.length} executions):
|
|
2059
|
+
`);
|
|
2060
|
+
for (const log of logs) {
|
|
2061
|
+
console.log(formatAuditLog(log));
|
|
2062
|
+
console.log("");
|
|
2063
|
+
}
|
|
2064
|
+
break;
|
|
2065
|
+
}
|
|
2066
|
+
case "stats":
|
|
2067
|
+
case "statistics": {
|
|
2068
|
+
const stats = await getAuditStatistics();
|
|
2069
|
+
console.log("\n\u{1F4CA} Audit Statistics\n");
|
|
2070
|
+
console.log(`Total executions: ${stats.totalExecutions}`);
|
|
2071
|
+
console.log(` \u2705 Successful: ${stats.successfulExecutions}`);
|
|
2072
|
+
console.log(` \u274C Failed: ${stats.failedExecutions}`);
|
|
2073
|
+
console.log("");
|
|
2074
|
+
console.log(`Unique skills executed: ${stats.uniqueSkills}`);
|
|
2075
|
+
console.log("");
|
|
2076
|
+
console.log(`Commands executed: ${stats.totalCommands}`);
|
|
2077
|
+
if (stats.blockedCommands > 0) {
|
|
2078
|
+
console.log(` \u26A0\uFE0F Blocked: ${stats.blockedCommands}`);
|
|
2079
|
+
}
|
|
2080
|
+
console.log("");
|
|
2081
|
+
console.log(`Network calls: ${stats.totalNetworkCalls}`);
|
|
2082
|
+
if (stats.blockedNetworkCalls > 0) {
|
|
2083
|
+
console.log(` \u26A0\uFE0F Blocked: ${stats.blockedNetworkCalls}`);
|
|
2084
|
+
}
|
|
2085
|
+
console.log("");
|
|
2086
|
+
if (stats.blockedCommands > 0 || stats.blockedNetworkCalls > 0) {
|
|
2087
|
+
console.log("\u26A0\uFE0F Some operations were blocked by security policies.");
|
|
2088
|
+
console.log('Run "trie audit logs" to see details.\n');
|
|
2089
|
+
}
|
|
2090
|
+
break;
|
|
2091
|
+
}
|
|
2092
|
+
default: {
|
|
2093
|
+
console.log(`
|
|
2094
|
+
Audit - View security audit logs
|
|
2095
|
+
|
|
2096
|
+
Trie logs all skill operations for security auditing. View what
|
|
2097
|
+
skills have executed, what commands they ran, and any blocked operations.
|
|
2098
|
+
|
|
2099
|
+
Commands:
|
|
2100
|
+
trie audit logs [count] Show recent audit logs (default: 20)
|
|
2101
|
+
trie audit skill <name> Show logs for a specific skill
|
|
2102
|
+
trie audit stats Show audit statistics
|
|
2103
|
+
|
|
2104
|
+
Examples:
|
|
2105
|
+
trie audit logs 50 Show last 50 executions
|
|
2106
|
+
trie audit skill security Show all executions of security skill
|
|
2107
|
+
trie audit stats View overall statistics
|
|
2108
|
+
|
|
2109
|
+
Audit logs are stored in .trie/audit/ and include:
|
|
2110
|
+
\u2022 Skill name and source
|
|
2111
|
+
\u2022 Commands executed
|
|
2112
|
+
\u2022 Network calls made
|
|
2113
|
+
\u2022 Files accessed/modified
|
|
2114
|
+
\u2022 Any blocked operations
|
|
2115
|
+
`);
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
|
|
2120
|
+
// src/cli/linear.ts
|
|
2121
|
+
async function handleLinearCommand(args) {
|
|
2122
|
+
try {
|
|
2123
|
+
const subcommand = args[0]?.toLowerCase();
|
|
2124
|
+
const workDir = getWorkingDirectory(void 0, true);
|
|
2125
|
+
if (subcommand === "auth") {
|
|
2126
|
+
const apiKey = args[1];
|
|
2127
|
+
if (!apiKey) {
|
|
2128
|
+
console.log("Usage: trie linear auth <your-linear-api-key>");
|
|
2129
|
+
return;
|
|
2130
|
+
}
|
|
2131
|
+
const config = await loadConfig();
|
|
2132
|
+
if (!config.apiKeys) {
|
|
2133
|
+
config.apiKeys = {};
|
|
2134
|
+
}
|
|
2135
|
+
config.apiKeys.linear = apiKey;
|
|
2136
|
+
await saveConfig(config);
|
|
2137
|
+
console.log("Linear API key saved successfully.");
|
|
2138
|
+
return;
|
|
2139
|
+
}
|
|
2140
|
+
if (subcommand === "sync") {
|
|
2141
|
+
const graph = new ContextGraph(workDir);
|
|
2142
|
+
const ingester = new LinearIngester(workDir, graph);
|
|
2143
|
+
console.log("Syncing Linear tickets...");
|
|
2144
|
+
await ingester.syncTickets();
|
|
2145
|
+
console.log("Linear tickets synced successfully.");
|
|
2146
|
+
return;
|
|
2147
|
+
}
|
|
2148
|
+
console.log("Usage:");
|
|
2149
|
+
console.log(" trie linear auth <api-key> Save Linear API key");
|
|
2150
|
+
console.log(" trie linear sync Sync active tickets");
|
|
2151
|
+
} catch (error) {
|
|
2152
|
+
const friendly = formatFriendlyError(error);
|
|
2153
|
+
console.error(friendly.userMessage);
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
// src/cli/gotcha.ts
|
|
2158
|
+
import picocolors from "picocolors";
|
|
2159
|
+
async function handleGotchaCommand(args) {
|
|
2160
|
+
try {
|
|
2161
|
+
const workDir = getWorkingDirectory(void 0, true);
|
|
2162
|
+
const graph = new ContextGraph(workDir);
|
|
2163
|
+
const predictor = new GotchaPredictor(workDir, graph);
|
|
2164
|
+
const engine = new LearningEngine(workDir, graph);
|
|
2165
|
+
console.log('Analyzing current changes for "gotchas"...');
|
|
2166
|
+
const staged = await getStagedChanges(workDir);
|
|
2167
|
+
const uncommitted = await getUncommittedChanges(workDir);
|
|
2168
|
+
const allChanges = [...staged, ...uncommitted].map((c) => c.path);
|
|
2169
|
+
const uniqueFiles = Array.from(new Set(allChanges));
|
|
2170
|
+
if (uniqueFiles.length === 0) {
|
|
2171
|
+
console.log("No changes detected to analyze.");
|
|
2172
|
+
return;
|
|
2173
|
+
}
|
|
2174
|
+
const gotchas = await predictor.predictGotchas(uniqueFiles);
|
|
2175
|
+
if (gotchas.length === 0) {
|
|
2176
|
+
console.log(picocolors.green('\u2713 No "gotchas" predicted for your current changes.'));
|
|
2177
|
+
return;
|
|
2178
|
+
}
|
|
2179
|
+
console.log(picocolors.yellow(`
|
|
2180
|
+
Found ${gotchas.length} potential "gotchas":
|
|
2181
|
+
`));
|
|
2182
|
+
for (const gotcha of gotchas) {
|
|
2183
|
+
const color = gotcha.riskLevel === "critical" ? picocolors.red : gotcha.riskLevel === "high" ? picocolors.yellow : picocolors.blue;
|
|
2184
|
+
console.log(color(`[${gotcha.riskLevel.toUpperCase()}] ${gotcha.message}`));
|
|
2185
|
+
const explanation = await predictor.synthesizeGotchaExplanation(gotcha);
|
|
2186
|
+
if (explanation !== gotcha.message) {
|
|
2187
|
+
console.log(picocolors.dim(` ${explanation}`));
|
|
2188
|
+
}
|
|
2189
|
+
console.log(picocolors.cyan(` \u{1F4A1} Recommendation: ${gotcha.recommendation}`));
|
|
2190
|
+
console.log("");
|
|
2191
|
+
}
|
|
2192
|
+
} catch (error) {
|
|
2193
|
+
const friendly = formatFriendlyError(error);
|
|
2194
|
+
console.error(friendly.userMessage);
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
// src/cli/learn.ts
|
|
2199
|
+
import picocolors2 from "picocolors";
|
|
2200
|
+
async function handleLearnCommand(args) {
|
|
2201
|
+
try {
|
|
2202
|
+
const workDir = getWorkingDirectory(void 0, true);
|
|
2203
|
+
const engine = new LearningEngine(workDir);
|
|
2204
|
+
const firstArg = args[0]?.toLowerCase();
|
|
2205
|
+
if (firstArg === "ok" || firstArg === "good") {
|
|
2206
|
+
const note = args.slice(1).join(" ");
|
|
2207
|
+
const staged = await getStagedChanges(workDir);
|
|
2208
|
+
const files = staged.map((s) => s.path);
|
|
2209
|
+
await engine.learn({
|
|
2210
|
+
manualFeedback: { helpful: true, files, note }
|
|
2211
|
+
});
|
|
2212
|
+
console.log(picocolors2.green("\u{1F44D} Learned that this pattern is good."));
|
|
2213
|
+
if (files.length > 0) {
|
|
2214
|
+
console.log(picocolors2.dim(` Linked to: ${files.join(", ")}`));
|
|
2215
|
+
}
|
|
2216
|
+
return;
|
|
2217
|
+
}
|
|
2218
|
+
if (firstArg === "bad" || firstArg === "wrong") {
|
|
2219
|
+
const note = args.slice(1).join(" ");
|
|
2220
|
+
const staged = await getStagedChanges(workDir);
|
|
2221
|
+
const files = staged.map((s) => s.path);
|
|
2222
|
+
await engine.learn({
|
|
2223
|
+
manualFeedback: { helpful: false, files, note }
|
|
2224
|
+
});
|
|
2225
|
+
console.log(picocolors2.yellow("\u{1F44E} Learned that this pattern is problematic."));
|
|
2226
|
+
if (files.length > 0) {
|
|
2227
|
+
console.log(picocolors2.dim(` Linked to: ${files.join(", ")}`));
|
|
2228
|
+
}
|
|
2229
|
+
return;
|
|
2230
|
+
}
|
|
2231
|
+
console.log(picocolors2.cyan("Scanning history for implicit failure signals (reverts/fixes)..."));
|
|
2232
|
+
const results = await engine.learn({ limit: 50 });
|
|
2233
|
+
const implicit = results.find((r) => r.source === "git-history");
|
|
2234
|
+
console.log(picocolors2.green(`\u2713 Learned ${implicit?.learned ?? 0} new cases from your git history.`));
|
|
2235
|
+
console.log(picocolors2.dim(" Trie will now use these precedents to predict future gotchas."));
|
|
2236
|
+
} catch (error) {
|
|
2237
|
+
const friendly = formatFriendlyError(error);
|
|
2238
|
+
console.error(friendly.userMessage);
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2031
2242
|
// src/cli/main.ts
|
|
2032
2243
|
var __filename2 = fileURLToPath(import.meta.url);
|
|
2033
2244
|
var __dirname2 = dirname(__filename2);
|
|
@@ -2072,14 +2283,18 @@ COMMANDS:
|
|
|
2072
2283
|
check Run risk check before pushing
|
|
2073
2284
|
|
|
2074
2285
|
tell "<incident>" Report an incident ("users can't log in")
|
|
2075
|
-
|
|
2076
|
-
|
|
2286
|
+
learn Train Trie from git history or feedback (alias: train)
|
|
2287
|
+
ok Mark current pattern as good (alias: learn ok)
|
|
2288
|
+
bad Mark current pattern as bad (alias: learn bad)
|
|
2077
2289
|
quiet Snooze nudges for 1 hour
|
|
2078
2290
|
|
|
2079
2291
|
checkpoint Save work context to .trie/ (aliases: cp, save)
|
|
2292
|
+
linear sync Sync active tickets from Linear
|
|
2293
|
+
gotcha Predict problems with current changes (alias: predict)
|
|
2080
2294
|
reconcile Reconcile context graph from JSON backup
|
|
2081
2295
|
|
|
2082
2296
|
skills Manage external skills from skills.sh
|
|
2297
|
+
audit View security audit logs
|
|
2083
2298
|
memory Search and manage issue memory
|
|
2084
2299
|
project View/manage project info (.trie/PROJECT.md)
|
|
2085
2300
|
agents List all available agents
|
|
@@ -2100,13 +2315,15 @@ EXAMPLES:
|
|
|
2100
2315
|
trie scan --agents security,privacy # Scan with specific agents
|
|
2101
2316
|
|
|
2102
2317
|
trie tell "users couldn't log in" # Report an incident
|
|
2103
|
-
trie ok #
|
|
2104
|
-
trie bad #
|
|
2318
|
+
trie ok # Mark current pattern as good
|
|
2319
|
+
trie bad # Mark current pattern as bad
|
|
2105
2320
|
trie quiet # Snooze nudges for 1 hour
|
|
2106
2321
|
|
|
2322
|
+
trie linear sync # Sync active tickets from Linear
|
|
2323
|
+
trie learn # Scan history for precedents
|
|
2324
|
+
trie gotcha # Predict for current changes
|
|
2325
|
+
|
|
2107
2326
|
trie check # Risk check before pushing
|
|
2108
|
-
trie checkpoint "finished auth" # Save work context
|
|
2109
|
-
trie checkpoint list # List recent checkpoints
|
|
2110
2327
|
|
|
2111
2328
|
trie skills add vercel-labs/agent-skills react-best-practices
|
|
2112
2329
|
trie memory search "SQL injection"
|
|
@@ -2115,6 +2332,7 @@ EXAMPLES:
|
|
|
2115
2332
|
trie ci # Generate CI workflow with memory caching
|
|
2116
2333
|
|
|
2117
2334
|
MCP TOOLS (use via Cursor/Claude Desktop):
|
|
2335
|
+
trie_linear_sync Sync active tickets from Linear
|
|
2118
2336
|
trie_scan Intelligent scan with agent selection
|
|
2119
2337
|
trie_fix Generate high-confidence fix prompts
|
|
2120
2338
|
trie_explain Explain code, issues, or changes
|
|
@@ -2149,43 +2367,43 @@ function showSetup() {
|
|
|
2149
2367
|
\u2551 Trie Agent Setup \u2551
|
|
2150
2368
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
2151
2369
|
|
|
2152
|
-
|
|
2370
|
+
STEP 1: API Keys
|
|
2371
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
2372
|
+
Trie can work offline, but performs best with these keys:
|
|
2373
|
+
|
|
2374
|
+
1. ANTHROPIC_API_KEY (Required for AI analysis)
|
|
2375
|
+
Get it: https://console.anthropic.com/
|
|
2376
|
+
|
|
2377
|
+
2. LINEAR_API_KEY (Required for JIT defect prediction)
|
|
2378
|
+
Get it: https://linear.app/settings/api
|
|
2153
2379
|
|
|
2154
|
-
|
|
2380
|
+
Set them in your environment (~/.zshrc) or MCP config:
|
|
2381
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
2382
|
+
export LINEAR_API_KEY=lin_api_...
|
|
2383
|
+
|
|
2384
|
+
STEP 2: Configure for your AI tool
|
|
2155
2385
|
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
2156
2386
|
|
|
2157
2387
|
For CLAUDE CODE:
|
|
2158
2388
|
claude mcp add Trie -- npx @triedotdev/mcp
|
|
2159
2389
|
|
|
2160
|
-
Or add to ~/.claude/settings.json:
|
|
2161
|
-
{
|
|
2162
|
-
"mcpServers": {
|
|
2163
|
-
"Trie": {
|
|
2164
|
-
"command": "node",
|
|
2165
|
-
"args": ["/path/to/@triedotdev/mcp/dist/index.js"]
|
|
2166
|
-
}
|
|
2167
|
-
}
|
|
2168
|
-
}
|
|
2169
|
-
|
|
2170
2390
|
For CURSOR (~/.cursor/mcp.json):
|
|
2171
2391
|
{
|
|
2172
2392
|
"mcpServers": {
|
|
2173
2393
|
"Trie": {
|
|
2174
|
-
"command": "
|
|
2175
|
-
"args": ["
|
|
2394
|
+
"command": "npx",
|
|
2395
|
+
"args": ["-y", "@triedotdev/mcp"],
|
|
2396
|
+
"env": {
|
|
2397
|
+
"ANTHROPIC_API_KEY": "your-key-here",
|
|
2398
|
+
"LINEAR_API_KEY": "your-key-here"
|
|
2399
|
+
}
|
|
2176
2400
|
}
|
|
2177
2401
|
}
|
|
2178
2402
|
}
|
|
2179
2403
|
|
|
2180
|
-
STEP 2: Restart your AI tool
|
|
2181
|
-
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
2182
|
-
Restart Claude Code or Cursor to load the MCP configuration.
|
|
2183
|
-
|
|
2184
2404
|
STEP 3: Start scanning!
|
|
2185
2405
|
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
2186
2406
|
Ask your AI assistant: "Scan this with Trie" or "Use trie_scan"
|
|
2187
|
-
|
|
2188
|
-
Need help? https://github.com/Trie-OS/Trie-Agent/issues
|
|
2189
2407
|
`);
|
|
2190
2408
|
}
|
|
2191
2409
|
function listAgents() {
|
|
@@ -2421,6 +2639,9 @@ function main() {
|
|
|
2421
2639
|
case "skill":
|
|
2422
2640
|
handleSkillsCommand(restArgs);
|
|
2423
2641
|
break;
|
|
2642
|
+
case "audit":
|
|
2643
|
+
handleAuditCommand(restArgs);
|
|
2644
|
+
break;
|
|
2424
2645
|
case "version":
|
|
2425
2646
|
case "--version":
|
|
2426
2647
|
case "-v":
|
|
@@ -2458,13 +2679,17 @@ function main() {
|
|
|
2458
2679
|
case "reconcile":
|
|
2459
2680
|
handleReconcileCommand(restArgs);
|
|
2460
2681
|
break;
|
|
2682
|
+
case "learn":
|
|
2683
|
+
case "train":
|
|
2684
|
+
handleLearnCommand(restArgs);
|
|
2685
|
+
break;
|
|
2461
2686
|
case "ok":
|
|
2462
2687
|
case "thumbs-up":
|
|
2463
|
-
|
|
2688
|
+
handleLearnCommand(["ok", ...restArgs]);
|
|
2464
2689
|
break;
|
|
2465
2690
|
case "bad":
|
|
2466
2691
|
case "thumbs-down":
|
|
2467
|
-
|
|
2692
|
+
handleLearnCommand(["bad", ...restArgs]);
|
|
2468
2693
|
break;
|
|
2469
2694
|
case "quiet":
|
|
2470
2695
|
case "snooze":
|
|
@@ -2484,6 +2709,13 @@ function main() {
|
|
|
2484
2709
|
case "ci-setup":
|
|
2485
2710
|
handleCISetupCommand(restArgs);
|
|
2486
2711
|
break;
|
|
2712
|
+
case "linear":
|
|
2713
|
+
handleLinearCommand(restArgs);
|
|
2714
|
+
break;
|
|
2715
|
+
case "gotcha":
|
|
2716
|
+
case "predict":
|
|
2717
|
+
handleGotchaCommand(restArgs);
|
|
2718
|
+
break;
|
|
2487
2719
|
default:
|
|
2488
2720
|
if (command.startsWith("-")) {
|
|
2489
2721
|
const { spawn } = __require("child_process");
|