@triedotdev/mcp 1.0.169 → 1.0.171
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 +62 -540
- package/dist/chunk-2YXOBNKW.js +619 -0
- package/dist/chunk-2YXOBNKW.js.map +1 -0
- package/dist/chunk-QR64Y5TI.js +363 -0
- package/dist/chunk-QR64Y5TI.js.map +1 -0
- package/dist/cli/main.d.ts +0 -15
- package/dist/cli/main.js +356 -3098
- package/dist/cli/main.js.map +1 -1
- package/dist/index.js +2 -34
- package/dist/index.js.map +1 -1
- package/dist/server/mcp-server.js +2 -34
- package/package.json +8 -31
- package/dist/autonomy-config-FSERX3O3.js +0 -30
- package/dist/autonomy-config-FSERX3O3.js.map +0 -1
- package/dist/chat-store-JNGNTDSN.js +0 -15
- package/dist/chat-store-JNGNTDSN.js.map +0 -1
- package/dist/chunk-2HF65EHQ.js +0 -311
- package/dist/chunk-2HF65EHQ.js.map +0 -1
- package/dist/chunk-3XR6WVAW.js +0 -4011
- package/dist/chunk-3XR6WVAW.js.map +0 -1
- package/dist/chunk-43X6JBEM.js +0 -36
- package/dist/chunk-43X6JBEM.js.map +0 -1
- package/dist/chunk-6NLHFIYA.js +0 -344
- package/dist/chunk-6NLHFIYA.js.map +0 -1
- package/dist/chunk-7IO4YUI3.js +0 -1827
- package/dist/chunk-7IO4YUI3.js.map +0 -1
- package/dist/chunk-AHD2CBQ7.js +0 -846
- package/dist/chunk-AHD2CBQ7.js.map +0 -1
- package/dist/chunk-BUTOP5EB.js +0 -931
- package/dist/chunk-BUTOP5EB.js.map +0 -1
- package/dist/chunk-DGUM43GV.js +0 -11
- package/dist/chunk-DGUM43GV.js.map +0 -1
- package/dist/chunk-EFWVF6TI.js +0 -267
- package/dist/chunk-EFWVF6TI.js.map +0 -1
- package/dist/chunk-F6WFNUAY.js +0 -216
- package/dist/chunk-F6WFNUAY.js.map +0 -1
- package/dist/chunk-FBNURWRY.js +0 -662
- package/dist/chunk-FBNURWRY.js.map +0 -1
- package/dist/chunk-FQ45QP5A.js +0 -361
- package/dist/chunk-FQ45QP5A.js.map +0 -1
- package/dist/chunk-FVRO5RN3.js +0 -1306
- package/dist/chunk-FVRO5RN3.js.map +0 -1
- package/dist/chunk-G2TGF6TR.js +0 -573
- package/dist/chunk-G2TGF6TR.js.map +0 -1
- package/dist/chunk-G3I7SZLW.js +0 -354
- package/dist/chunk-G3I7SZLW.js.map +0 -1
- package/dist/chunk-GTKYBOXL.js +0 -700
- package/dist/chunk-GTKYBOXL.js.map +0 -1
- package/dist/chunk-HVCDY3AK.js +0 -850
- package/dist/chunk-HVCDY3AK.js.map +0 -1
- package/dist/chunk-I2O5OYQT.js +0 -727
- package/dist/chunk-I2O5OYQT.js.map +0 -1
- package/dist/chunk-JVMBCWKS.js +0 -348
- package/dist/chunk-JVMBCWKS.js.map +0 -1
- package/dist/chunk-KCUOWRPX.js +0 -816
- package/dist/chunk-KCUOWRPX.js.map +0 -1
- package/dist/chunk-KDHN2ZQE.js +0 -313
- package/dist/chunk-KDHN2ZQE.js.map +0 -1
- package/dist/chunk-ME2OERF5.js +0 -345
- package/dist/chunk-ME2OERF5.js.map +0 -1
- package/dist/chunk-OBQ74FOU.js +0 -27
- package/dist/chunk-OBQ74FOU.js.map +0 -1
- package/dist/chunk-Q5EKA5YA.js +0 -254
- package/dist/chunk-Q5EKA5YA.js.map +0 -1
- package/dist/chunk-Q63FFI6D.js +0 -132
- package/dist/chunk-Q63FFI6D.js.map +0 -1
- package/dist/chunk-SASNMSB5.js +0 -12597
- package/dist/chunk-SASNMSB5.js.map +0 -1
- package/dist/chunk-T63OHG4Q.js +0 -440
- package/dist/chunk-T63OHG4Q.js.map +0 -1
- package/dist/chunk-TN5WEKWI.js +0 -173
- package/dist/chunk-TN5WEKWI.js.map +0 -1
- package/dist/chunk-VUL52BQL.js +0 -402
- package/dist/chunk-VUL52BQL.js.map +0 -1
- package/dist/chunk-VVITXIHN.js +0 -189
- package/dist/chunk-VVITXIHN.js.map +0 -1
- package/dist/chunk-WCN7S3EI.js +0 -14
- package/dist/chunk-WCN7S3EI.js.map +0 -1
- package/dist/chunk-XPZZFPBZ.js +0 -491
- package/dist/chunk-XPZZFPBZ.js.map +0 -1
- package/dist/chunk-ZJF5FTBX.js +0 -1396
- package/dist/chunk-ZJF5FTBX.js.map +0 -1
- package/dist/chunk-ZV2K6M7T.js +0 -74
- package/dist/chunk-ZV2K6M7T.js.map +0 -1
- package/dist/cli/create-agent.d.ts +0 -1
- package/dist/cli/create-agent.js +0 -1050
- package/dist/cli/create-agent.js.map +0 -1
- package/dist/cli/yolo-daemon.d.ts +0 -1
- package/dist/cli/yolo-daemon.js +0 -421
- package/dist/cli/yolo-daemon.js.map +0 -1
- package/dist/client-NJPZE5JT.js +0 -28
- package/dist/client-NJPZE5JT.js.map +0 -1
- package/dist/codebase-index-VAPF32XX.js +0 -12
- package/dist/codebase-index-VAPF32XX.js.map +0 -1
- package/dist/fast-analyzer-3GCCZMLK.js +0 -216
- package/dist/fast-analyzer-3GCCZMLK.js.map +0 -1
- package/dist/git-EO5SRFMN.js +0 -28
- package/dist/git-EO5SRFMN.js.map +0 -1
- package/dist/github-ingester-ZOKK6GRS.js +0 -11
- package/dist/github-ingester-ZOKK6GRS.js.map +0 -1
- package/dist/goal-manager-QUKX2W6C.js +0 -25
- package/dist/goal-manager-QUKX2W6C.js.map +0 -1
- package/dist/goal-validator-2SFSKKVU.js +0 -24
- package/dist/goal-validator-2SFSKKVU.js.map +0 -1
- package/dist/graph-B3NA4S7I.js +0 -10
- package/dist/graph-B3NA4S7I.js.map +0 -1
- package/dist/hypothesis-KCPBR652.js +0 -23
- package/dist/hypothesis-KCPBR652.js.map +0 -1
- package/dist/incident-index-EFNUSGWL.js +0 -11
- package/dist/incident-index-EFNUSGWL.js.map +0 -1
- package/dist/insight-store-EC4PLSAW.js +0 -22
- package/dist/insight-store-EC4PLSAW.js.map +0 -1
- package/dist/issue-store-YAXTNRRY.js +0 -36
- package/dist/issue-store-YAXTNRRY.js.map +0 -1
- package/dist/ledger-TWZTGDFA.js +0 -58
- package/dist/ledger-TWZTGDFA.js.map +0 -1
- package/dist/linear-ingester-XXPAZZRW.js +0 -11
- package/dist/linear-ingester-XXPAZZRW.js.map +0 -1
- package/dist/output-manager-RVJ37XKA.js +0 -13
- package/dist/output-manager-RVJ37XKA.js.map +0 -1
- package/dist/parse-goal-violation-SACGFG3C.js +0 -8
- package/dist/parse-goal-violation-SACGFG3C.js.map +0 -1
- package/dist/pattern-discovery-F7LU5K6E.js +0 -8
- package/dist/pattern-discovery-F7LU5K6E.js.map +0 -1
- package/dist/progress-SRQ2V3BP.js +0 -18
- package/dist/progress-SRQ2V3BP.js.map +0 -1
- package/dist/project-state-AHPA77SM.js +0 -28
- package/dist/project-state-AHPA77SM.js.map +0 -1
- package/dist/sync-M2FSWPBC.js +0 -12
- package/dist/sync-M2FSWPBC.js.map +0 -1
- package/dist/terminal-spawn-5YXDMUCF.js +0 -157
- package/dist/terminal-spawn-5YXDMUCF.js.map +0 -1
- package/dist/tiered-storage-DYNC5CQ6.js +0 -13
- package/dist/tiered-storage-DYNC5CQ6.js.map +0 -1
- package/dist/trie-agent-I3HAHY2G.js +0 -26
- package/dist/trie-agent-I3HAHY2G.js.map +0 -1
- package/dist/ui/chat.html +0 -1014
- package/dist/ui/goals.html +0 -967
- package/dist/ui/hypotheses.html +0 -1011
- package/dist/ui/ledger.html +0 -954
- package/dist/ui/nudges.html +0 -995
- package/dist/vibe-code-signatures-5ZULYP3D.js +0 -987
- package/dist/vibe-code-signatures-5ZULYP3D.js.map +0 -1
- package/dist/vulnerability-signatures-2URZSXAQ.js +0 -983
- package/dist/vulnerability-signatures-2URZSXAQ.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,602 +1,124 @@
|
|
|
1
|
-
# Trie
|
|
1
|
+
# Trie MCP
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**CLI + MCP tools for Cursor and Claude Code.** A bridge that extends your AI assistant with Trie cloud context—signals, documents, ledger, and graph—so it has the right context before editing.
|
|
4
4
|
|
|
5
5
|
[](https://www.trie.dev) [](https://x.com/louiskishfy)
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## What is Trie?
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
[Trie](https://trie.dev) is a product governance platform that captures governance and insights automatically from conversations, commits, design files, and support threads. It builds a shared ledger from your team's work—integrations so everyone has context before shipping changes.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- Linear tracks tasks, not decisions or reasoning
|
|
13
|
-
- GitHub shows changes, not why they were made
|
|
14
|
-
- Slack/Discord: context vanishes in chat history
|
|
15
|
-
- No tool tells you if today's change conflicts with yesterday's decision
|
|
11
|
+
## How it works with trie.dev
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
This package connects your local AI assistant (Cursor, Claude Code) to your **trie.dev account**. You sign in with `trie login`, which opens a browser to authorize the CLI. Once authenticated, the MCP server pulls context from your **human and agent teams' graph** on the fly—signals, documents, ledger, and graph—and exposes it as tools your AI can call while you work.
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
- **Governance ledger** - Decision memory with Git-backed audit trail and digital signatures
|
|
24
|
-
- **Cross-tool context** - Same ledger in Cursor, CLI, CI/CD—no coordination needed
|
|
25
|
-
|
|
26
|
-
Think of it as **double-entry bookkeeping for code decisions**—tamper-evident accountability that works with Git and your existing workflow.
|
|
15
|
+
- **Accounts**: Sign up at [trie.dev](https://trie.dev). Free accounts are available.
|
|
16
|
+
- **Teams**: If you're on a team, `trie teams list` and `trie teams switch <teamId>` let you choose which workspace the MCP uses.
|
|
17
|
+
- **Live context**: Context is fetched from your trie.dev workspace as your AI needs it—both human team activity and agent-generated insights flow into the graph in real time.
|
|
18
|
+
- **Local storage**: Auth tokens and account config (team, email) are stored in `~/.trie/` on your machine—keychain-backed where available. Cloud data (signals, graph, documents) is only held in memory during the session and never written to disk.
|
|
27
19
|
|
|
28
20
|
## Quick Start
|
|
29
21
|
|
|
30
22
|
### Install
|
|
31
23
|
|
|
32
24
|
```bash
|
|
33
|
-
npm install -g
|
|
34
|
-
cd your-project
|
|
35
|
-
trie init
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Basic Workflow
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
# 1. Report incidents as they happen
|
|
42
|
-
trie tell "Users can't log in after password reset"
|
|
43
|
-
|
|
44
|
-
# 2. Start autonomous monitoring
|
|
45
|
-
trie watch
|
|
46
|
-
|
|
47
|
-
# 3. Before pushing, check for risks
|
|
48
|
-
trie gotcha
|
|
49
|
-
|
|
50
|
-
# 4. Learn from your git history
|
|
51
|
-
trie learn
|
|
52
|
-
|
|
53
|
-
# 5. Give feedback
|
|
54
|
-
trie ok # Prediction was helpful
|
|
55
|
-
trie bad # Prediction was wrong
|
|
25
|
+
npm install -g @triedotdev/mcp
|
|
56
26
|
```
|
|
57
27
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
### 1. Autonomous Monitoring (`trie watch`)
|
|
61
|
-
|
|
62
|
-
Real-time agent that monitors your codebase and enforces custom rules:
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
# Set any quality rule you want enforced
|
|
66
|
-
trie goal add "No console.log statements in production"
|
|
67
|
-
trie goal add "All API endpoints must have rate limiting"
|
|
68
|
-
trie goal add "We never truncate text in UI components"
|
|
69
|
-
|
|
70
|
-
# Start watching
|
|
71
|
-
trie watch
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
**Features:**
|
|
75
|
-
- **Interactive dashboard** with goals, memory, and analysis activity
|
|
76
|
-
- **AI-powered goal checking** using semantic understanding (not just keywords)
|
|
77
|
-
- **AI-powered Gotcha Prediction** - Automatically analyzes changed files for potential problems using Claude
|
|
78
|
-
- **AI-powered Learning** - Learns from git history (fix/revert commits) every 10 file changes
|
|
79
|
-
- **Signal extraction** - Extracts governance decisions, facts, and blockers from code changes
|
|
80
|
-
- **Token-aware** to manage AI costs
|
|
81
|
-
- **Smart caching** to avoid duplicate scans
|
|
82
|
-
- **Real-time nudges** when violations are detected
|
|
83
|
-
|
|
84
|
-
**How AI integration works in watch mode:**
|
|
85
|
-
1. When files change, AI extracts structured signals (governance, facts, blockers)
|
|
86
|
-
2. Gotcha Predictor analyzes changes for potential problems using Claude Sonnet 4
|
|
87
|
-
3. Learning Engine periodically learns from git history to improve predictions
|
|
88
|
-
4. All findings are stored in the governance ledger for future reference
|
|
89
|
-
|
|
90
|
-
Run in background with screen or tmux:
|
|
91
|
-
```bash
|
|
92
|
-
screen -S trie-watch
|
|
93
|
-
trie watch
|
|
94
|
-
# Detach: Ctrl+A then D
|
|
95
|
-
# Reattach: screen -r trie-watch
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### 2. AI-Powered Predictive Analysis (`trie gotcha`)
|
|
99
|
-
|
|
100
|
-
Uses Claude (Anthropic) to predict problems before you ship, combining:
|
|
101
|
-
- **AI code analysis** - Semantic understanding of bugs, security issues, and anti-patterns
|
|
102
|
-
- **Governance context** - Relevant decisions and blockers from the ledger
|
|
103
|
-
- **Historical incidents** - Past regressions in the same files
|
|
104
|
-
- **Active tickets** - Linear tickets that might conflict
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
# Check current changes for risks (requires ANTHROPIC_API_KEY)
|
|
108
|
-
trie gotcha
|
|
109
|
-
|
|
110
|
-
# Connect to Linear for JIT defect prediction
|
|
111
|
-
trie linear auth <your-api-key>
|
|
112
|
-
trie linear sync
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
**How it works:**
|
|
116
|
-
1. Analyzes changed files with Claude Sonnet 4
|
|
117
|
-
2. Checks against governance decisions and active blockers
|
|
118
|
-
3. Searches for similar past incidents
|
|
119
|
-
4. Returns structured predictions with risk levels and recommendations
|
|
120
|
-
5. Falls back gracefully if AI unavailable
|
|
121
|
-
|
|
122
|
-
### 3. Governance Ledger
|
|
123
|
-
|
|
124
|
-
Tamper-evident record of all decisions, incidents, and fixes:
|
|
125
|
-
|
|
126
|
-
**Architecture:**
|
|
127
|
-
- **Governance ledger** (`.trie/memory/ledger.json`) - Append-only chain with Ed25519 signatures
|
|
128
|
-
- **Issue memory** (`.trie/memory/issues.json`) - Fast searchable cache
|
|
129
|
-
|
|
130
|
-
**Key properties:**
|
|
131
|
-
- Never deleted, only corrected (full audit trail)
|
|
132
|
-
- Digital signatures prove who (human or agent) created each entry
|
|
133
|
-
- Auto-commits to Git for distributed backup
|
|
134
|
-
- Works across Cursor, CLI, CI/CD—same ledger everywhere
|
|
135
|
-
|
|
136
|
-
**Setup signing:**
|
|
137
|
-
```bash
|
|
138
|
-
trie keys generate # Generate Ed25519 signing key
|
|
139
|
-
trie keys status # Check if signing is configured
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
**Ledger commands:**
|
|
143
|
-
```bash
|
|
144
|
-
trie ledger verify # Validate chain integrity
|
|
145
|
-
trie ledger history # Show blocks with author attribution
|
|
146
|
-
trie ledger stats # Block counts, entries, severity breakdown
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
**Corrections (not deletions):**
|
|
150
|
-
```bash
|
|
151
|
-
# Mark false positive
|
|
152
|
-
trie ledger correct <entry-id> -r "Expected behavior" -t false-positive
|
|
153
|
-
|
|
154
|
-
# Mark as fixed
|
|
155
|
-
trie ledger correct <entry-id> -r "Fixed in commit abc123"
|
|
156
|
-
|
|
157
|
-
# View correction stats
|
|
158
|
-
trie ledger corrections
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
## Integrations
|
|
162
|
-
|
|
163
|
-
| Integration | Setup | Purpose |
|
|
164
|
-
|-------------|-------|---------|
|
|
165
|
-
| **Linear** | `trie linear auth <key>` | JIT defect prediction from active tickets |
|
|
166
|
-
| **GitHub** | Set `GITHUB_TOKEN` env var | Sync PRs and issues into context graph |
|
|
167
|
-
| **Slack** | `trie setup slack <webhook>` | Team notifications for critical issues |
|
|
168
|
-
| **Cursor Cloud** | Set `CURSOR_API_KEY` | Verified automated fixes via cloud agent |
|
|
169
|
-
|
|
170
|
-
### Linear Integration
|
|
28
|
+
### Login
|
|
171
29
|
|
|
172
30
|
```bash
|
|
173
|
-
trie
|
|
174
|
-
trie linear sync
|
|
31
|
+
trie login
|
|
175
32
|
```
|
|
176
33
|
|
|
177
|
-
|
|
34
|
+
This opens a browser to sign in at trie.dev and authorize the CLI. After login, the MCP server can access your team's cloud context.
|
|
178
35
|
|
|
179
|
-
###
|
|
36
|
+
### MCP Setup (Cursor / Claude Code)
|
|
180
37
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
```bash
|
|
184
|
-
# Via MCP (Cursor/Claude)
|
|
185
|
-
trie_github_sync
|
|
186
|
-
trie_github_branches # See which branch has latest updates
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
Requires `GITHUB_TOKEN` (repo scope for private repos, public_repo for public).
|
|
190
|
-
|
|
191
|
-
### Slack Integration
|
|
192
|
-
|
|
193
|
-
```bash
|
|
194
|
-
# Show setup guide
|
|
195
|
-
trie setup slack
|
|
196
|
-
|
|
197
|
-
# Configure webhook
|
|
198
|
-
trie setup slack <webhook-url> [#channel]
|
|
199
|
-
|
|
200
|
-
# Test connection
|
|
201
|
-
trie setup test-slack
|
|
202
|
-
```
|
|
38
|
+
Add to your MCP settings:
|
|
203
39
|
|
|
204
|
-
Or manually add to `.trie/config.json`:
|
|
205
40
|
```json
|
|
206
41
|
{
|
|
207
|
-
"
|
|
208
|
-
"
|
|
209
|
-
"
|
|
210
|
-
"
|
|
211
|
-
"
|
|
42
|
+
"mcpServers": {
|
|
43
|
+
"trie": {
|
|
44
|
+
"command": "trie",
|
|
45
|
+
"args": ["mcp"],
|
|
46
|
+
"env": {}
|
|
212
47
|
}
|
|
213
48
|
}
|
|
214
49
|
}
|
|
215
50
|
```
|
|
216
51
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
Dispatch high-risk issues to Cursor's cloud for verified, test-passing fixes:
|
|
220
|
-
|
|
221
|
-
```bash
|
|
222
|
-
# Via MCP
|
|
223
|
-
trie_cloud_fix action:configure apiKey:"key-..."
|
|
224
|
-
trie_cloud_fix action:dispatch issueIds:["issue-1"]
|
|
225
|
-
|
|
226
|
-
# Force cloud dispatch (bypass triage)
|
|
227
|
-
trie_cloud_fix action:dispatch forceCloud:true
|
|
228
|
-
|
|
229
|
-
# Ad-hoc dispatch
|
|
230
|
-
trie_cloud_fix action:dispatch file:"src/auth.ts" issue:"SQL injection" fix:"Use parameterized queries"
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
The cloud agent runs in an isolated VM, applies the fix, runs tests, captures screenshots, and opens a PR.
|
|
234
|
-
|
|
235
|
-
### Pipeline View
|
|
236
|
-
|
|
237
|
-
See work across Linear, GitHub, and Trie in one place:
|
|
238
|
-
|
|
239
|
-
```bash
|
|
240
|
-
# Via MCP
|
|
241
|
-
trie_pipeline # Full status: tickets, PRs, issues
|
|
242
|
-
trie_pipeline action:coverage # Only Trie issues with no ticket/PR
|
|
243
|
-
trie_pipeline action:create_tickets issueIds:["id1","id2"] # Open tickets
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
## AI Tool Integration (MCP)
|
|
247
|
-
|
|
248
|
-
Trie provides Model Context Protocol tools for Claude, Cursor, and AI assistants.
|
|
249
|
-
|
|
250
|
-
### Setup for Cursor/Claude
|
|
251
|
-
|
|
252
|
-
Add to your MCP settings:
|
|
52
|
+
If you use `npx` instead of a global install:
|
|
253
53
|
|
|
254
54
|
```json
|
|
255
55
|
{
|
|
256
56
|
"mcpServers": {
|
|
257
57
|
"trie": {
|
|
258
|
-
"command": "
|
|
259
|
-
"args": ["mcp"],
|
|
260
|
-
"env": {
|
|
261
|
-
"ANTHROPIC_API_KEY": "your-api-key",
|
|
262
|
-
"LINEAR_API_KEY": "your-key",
|
|
263
|
-
"GITHUB_TOKEN": "your-token",
|
|
264
|
-
"CURSOR_API_KEY": "your-cursor-key"
|
|
265
|
-
}
|
|
58
|
+
"command": "npx",
|
|
59
|
+
"args": ["-y", "@triedotdev/mcp", "mcp"],
|
|
60
|
+
"env": {}
|
|
266
61
|
}
|
|
267
62
|
}
|
|
268
63
|
}
|
|
269
64
|
```
|
|
270
65
|
|
|
271
|
-
###
|
|
272
|
-
|
|
273
|
-
**Core:**
|
|
274
|
-
- `trie_tell` - Report incidents and extract structured signals
|
|
275
|
-
- `trie_check` - Quick risk assessment
|
|
276
|
-
- `trie_watch` - Start/stop autonomous monitoring
|
|
277
|
-
- `trie_memory` - Search incident history
|
|
278
|
-
- `trie_fix` - Apply fixes (use `action:route` to see triage plan)
|
|
279
|
-
- `trie_cloud_fix` - Dispatch to Cursor cloud agent
|
|
280
|
-
|
|
281
|
-
**Integrations:**
|
|
282
|
-
- `trie_linear_sync` - Sync active Linear tickets
|
|
283
|
-
- `trie_github_sync` - Sync open PRs and issues
|
|
284
|
-
- `trie_github_branches` - Fetch branches with latest commits
|
|
285
|
-
- `trie_pipeline` - Consolidated view of tickets, PRs, issues
|
|
286
|
-
|
|
287
|
-
**Query Tools (Targeted Context):**
|
|
288
|
-
- `trie_get_governance` - Query decisions with filters
|
|
289
|
-
- `trie_get_blockers` - Get active blockers only
|
|
290
|
-
- `trie_get_nudges` - Get unresolved goal violations
|
|
291
|
-
- `trie_get_related_governance` - Find related context
|
|
292
|
-
- `trie_query_context` - Natural language queries across all signals
|
|
293
|
-
|
|
294
|
-
**Why query tools matter**: Instead of dumping everything into context, agents ask for exactly what they need. This prevents context pollution and keeps agents focused.
|
|
295
|
-
|
|
296
|
-
## Advanced Features
|
|
297
|
-
|
|
298
|
-
<details>
|
|
299
|
-
<summary><b>Goals & Custom Rules</b></summary>
|
|
300
|
-
|
|
301
|
-
Set improvement goals that are actively enforced in real-time:
|
|
66
|
+
### Proactive Warnings
|
|
302
67
|
|
|
303
68
|
```bash
|
|
304
|
-
|
|
305
|
-
trie goal add "No hardcoded API keys"
|
|
306
|
-
trie goal add "All async functions must handle errors"
|
|
307
|
-
trie goal add "Every TODO must have a ticket reference"
|
|
308
|
-
|
|
309
|
-
# View progress
|
|
310
|
-
trie goal list
|
|
311
|
-
|
|
312
|
-
# Get unresolved violations
|
|
313
|
-
trie_get_nudges # Via MCP
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
Goals use AI-powered semantic understanding to catch violations, not just keyword matching.
|
|
317
|
-
|
|
318
|
-
</details>
|
|
319
|
-
|
|
320
|
-
<details>
|
|
321
|
-
<summary><b>Fix Triage System</b></summary>
|
|
322
|
-
|
|
323
|
-
Trie routes each issue to one of three fix strategies:
|
|
324
|
-
|
|
325
|
-
| Strategy | When | Action |
|
|
326
|
-
|----------|------|--------|
|
|
327
|
-
| **inline-auto** | Trivial fixes (score < 0) | Apply automatically |
|
|
328
|
-
| **local-ai** | Moderate risk (score 0–3) | `trie_fix` — local AI applies fix |
|
|
329
|
-
| **cloud-agent** | High risk (score ≥ 4) | `trie_cloud_fix` — Cursor cloud agent |
|
|
330
|
-
|
|
331
|
-
See routing plan before applying:
|
|
332
|
-
```bash
|
|
333
|
-
trie_fix action:route
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
</details>
|
|
337
|
-
|
|
338
|
-
<details>
|
|
339
|
-
<summary><b>Team Sync (Shared Ledger)</b></summary>
|
|
340
|
-
|
|
341
|
-
Sync ledger blocks across your team:
|
|
342
|
-
|
|
343
|
-
```bash
|
|
344
|
-
trie sync init # Initialize shared storage
|
|
345
|
-
trie sync pull # Pull shared updates
|
|
346
|
-
trie sync push # Push local changes
|
|
347
|
-
trie sync status # Show sync state
|
|
348
|
-
trie sync hooks --install # Install auto-sync git hooks
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
The shared ledger lives in `.trie-shared/` with hot/cold storage tiers and automatic compression.
|
|
352
|
-
|
|
353
|
-
</details>
|
|
354
|
-
|
|
355
|
-
<details>
|
|
356
|
-
<summary><b>Memory Management</b></summary>
|
|
357
|
-
|
|
358
|
-
```bash
|
|
359
|
-
# Search incident history
|
|
360
|
-
trie memory search "authentication"
|
|
361
|
-
trie memory stats
|
|
362
|
-
trie memory recent
|
|
363
|
-
|
|
364
|
-
# Clean up old issues (doesn't affect immutable ledger)
|
|
365
|
-
trie memory purge smart # Remove resolved & old low-priority
|
|
366
|
-
trie memory purge resolved # All resolved issues
|
|
367
|
-
trie memory purge old # Older than 90 days
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
</details>
|
|
371
|
-
|
|
372
|
-
<details>
|
|
373
|
-
<summary><b>Git Hooks</b></summary>
|
|
374
|
-
|
|
375
|
-
Installed automatically with `trie init`:
|
|
376
|
-
|
|
377
|
-
- **pre-commit** - Scan staged files, block on critical issues
|
|
378
|
-
- **post-commit** - Update context graph
|
|
379
|
-
- **pre-push** - Block push on critical issues
|
|
380
|
-
|
|
381
|
-
**Bypass methods:**
|
|
382
|
-
```bash
|
|
383
|
-
git push --no-verify # Skip all hooks
|
|
384
|
-
TRIE_BYPASS=1 git push # Skip Trie but log bypass
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
</details>
|
|
388
|
-
|
|
389
|
-
## How It Works
|
|
390
|
-
|
|
391
|
-
### Memory Architecture
|
|
392
|
-
|
|
393
|
-
Trie maintains two complementary memory systems:
|
|
394
|
-
|
|
395
|
-
**1. Governance Ledger** (`.trie/memory/ledger.json`)
|
|
396
|
-
- Append-only chain with Ed25519 signatures
|
|
397
|
-
- Tamper-evident, never deleted (only corrected)
|
|
398
|
-
- Used for: audit trail, compliance, gotcha predictions
|
|
399
|
-
- Auto-commits to Git for distributed backup
|
|
400
|
-
|
|
401
|
-
**2. Issue Memory** (`.trie/memory/issues.json`)
|
|
402
|
-
- Fast searchable cache of detected issues
|
|
403
|
-
- Can be compacted and purged
|
|
404
|
-
- Used for: pattern recognition, quick queries
|
|
405
|
-
- Links back to ledger via `ledgerBlockHash`
|
|
406
|
-
|
|
407
|
-
Both systems sync across your team and travel with your codebase via Git.
|
|
408
|
-
|
|
409
|
-
### Trie-Based Autocomplete
|
|
410
|
-
|
|
411
|
-
Trie uses prefix trees (tries) for fast O(m) autocomplete on ledger data:
|
|
412
|
-
|
|
413
|
-
**Ledger Trie** (`src/trie/ledger-trie.ts`)
|
|
414
|
-
- Indexes governance tags for discovery (e.g., "auth" → "auth", "authentication", "authorization")
|
|
415
|
-
- Indexes file paths from governance for quick lookups
|
|
416
|
-
- Indexes agent names for history queries
|
|
417
|
-
- Integrated into tiered storage for instant autocomplete
|
|
418
|
-
|
|
419
|
-
**Usage in MCP:**
|
|
420
|
-
- Agents can autocomplete tags when querying governance
|
|
421
|
-
- Fast prefix search on file paths and agent names
|
|
422
|
-
- Makes the ledger more discoverable and navigable
|
|
423
|
-
|
|
424
|
-
### File Structure
|
|
425
|
-
|
|
426
|
-
```
|
|
427
|
-
your-project/
|
|
428
|
-
├── .trie/
|
|
429
|
-
│ ├── memory/
|
|
430
|
-
│ │ ├── ledger.json # Governance ledger (cryptographic chain)
|
|
431
|
-
│ │ └── issues.json # Issue cache
|
|
432
|
-
│ ├── warm/
|
|
433
|
-
│ │ └── decisions.db # SQLite database for structured queries
|
|
434
|
-
│ ├── context.json # Project knowledge graph
|
|
435
|
-
│ ├── config.json # Settings
|
|
436
|
-
│ └── keys/ # Ed25519 signing keys (never committed)
|
|
437
|
-
├── .trie-shared/ # Shared ledger for team sync (optional)
|
|
438
|
-
│ ├── active/
|
|
439
|
-
│ ├── archived/
|
|
440
|
-
│ └── ledger-manifest.json
|
|
441
|
-
└── .git/
|
|
442
|
-
```
|
|
443
|
-
|
|
444
|
-
### Signal Extraction & AI Analysis
|
|
445
|
-
|
|
446
|
-
Trie uses AI throughout for intelligent analysis:
|
|
447
|
-
|
|
448
|
-
**Signal Extraction** (`signal-extractor.ts`)
|
|
449
|
-
Instead of dumping raw logs into context, Trie extracts structured signals:
|
|
450
|
-
|
|
451
|
-
**Input:** Incident report, commit, conversation
|
|
452
|
-
**Extraction:** AI (Claude Haiku/Sonnet) pulls out structured data:
|
|
453
|
-
- **Governance**: "Chose bcrypt over sha256 for password hashing"
|
|
454
|
-
- **Facts**: "Stripe requires TLS 1.2+ for EU transactions"
|
|
455
|
-
- **Blockers**: "Missing VAT validation blocks EU checkout"
|
|
456
|
-
- **Questions**: "Should we cache session tokens?"
|
|
457
|
-
|
|
458
|
-
**Storage:** Goes to queryable database with trie-based indexing
|
|
459
|
-
**Query:** Agents ask for targeted context via autocomplete, not everything at once
|
|
460
|
-
|
|
461
|
-
**AI-Powered Learning** (`learning-engine.ts`)
|
|
462
|
-
- Analyzes git `fix` and `revert` commits to understand root causes
|
|
463
|
-
- Extracts patterns and categories (logic-error, null-check, race-condition)
|
|
464
|
-
- Stores lessons in the ledger for future predictions
|
|
465
|
-
- Falls back gracefully if AI unavailable
|
|
466
|
-
|
|
467
|
-
**AI-Powered Gotcha** (`gotcha-predictor.ts`)
|
|
468
|
-
- Analyzes code semantically for bugs and security issues
|
|
469
|
-
- Considers governance context and active blockers
|
|
470
|
-
- Returns structured predictions with risk levels
|
|
471
|
-
- Uses Claude Sonnet 4 for deep code understanding
|
|
472
|
-
|
|
473
|
-
This prevents context pollution and keeps agents focused on relevant signals.
|
|
474
|
-
|
|
475
|
-
## CLI Reference
|
|
476
|
-
|
|
477
|
-
### Basic Commands
|
|
478
|
-
|
|
479
|
-
```bash
|
|
480
|
-
trie init # Set up Trie in your project
|
|
481
|
-
trie status # View project health and memory stats
|
|
482
|
-
trie tell # Report incidents (extracts decisions, facts, blockers)
|
|
483
|
-
trie gotcha # Predict problems with current changes
|
|
484
|
-
trie learn # Train from git history or feedback
|
|
485
|
-
trie watch # Start interactive monitoring dashboard
|
|
486
|
-
```
|
|
487
|
-
|
|
488
|
-
### Goals
|
|
489
|
-
|
|
490
|
-
```bash
|
|
491
|
-
trie goal add "<goal>" # Set improvement goal
|
|
492
|
-
trie goal list # View progress
|
|
69
|
+
trie init
|
|
493
70
|
```
|
|
494
71
|
|
|
495
|
-
|
|
72
|
+
This adds Cursor rules and CLAUDE.md guidance so your AI assistant calls `trie_check_file` before editing files and reads `trie://context` at conversation start.
|
|
496
73
|
|
|
497
|
-
|
|
498
|
-
trie memory search "query" # Search incident history
|
|
499
|
-
trie memory stats # View statistics
|
|
500
|
-
trie memory recent # Recent issues
|
|
501
|
-
trie memory purge smart # Clean up old/resolved
|
|
502
|
-
```
|
|
74
|
+
## CLI Commands
|
|
503
75
|
|
|
504
|
-
|
|
76
|
+
| Command | Description |
|
|
77
|
+
|---------|-------------|
|
|
78
|
+
| `trie init` | Add Cursor/Claude rules for proactive file checks |
|
|
79
|
+
| `trie login` | Sign in via browser (OAuth) |
|
|
80
|
+
| `trie logout` | Revoke session |
|
|
81
|
+
| `trie teams [list\|switch <teamId>]` | List or switch teams |
|
|
82
|
+
| `trie pull [context\|graph\|signals\|documents\|ledger\|all]` | Fetch cloud data (JSON) |
|
|
83
|
+
| `trie status` | Show auth and cache status |
|
|
505
84
|
|
|
506
|
-
|
|
507
|
-
trie ledger verify # Validate chain integrity
|
|
508
|
-
trie ledger history # Show blocks with authors
|
|
509
|
-
trie ledger stats # Block counts, entries, severity
|
|
510
|
-
trie ledger correct <id> # Mark entry as corrected
|
|
511
|
-
trie ledger corrections # View correction stats
|
|
512
|
-
```
|
|
85
|
+
## MCP Tools
|
|
513
86
|
|
|
514
|
-
|
|
87
|
+
| Tool | Description |
|
|
88
|
+
|------|-------------|
|
|
89
|
+
| `trie_context` | Consolidated context: hot zones, graph summary, recent signals/documents |
|
|
90
|
+
| `trie_check_file` | Risk assessment for a file (incidents, alerts, decisions) |
|
|
91
|
+
| `trie_graph` | Read ANT graph from cloud |
|
|
92
|
+
| `trie_signals` | Read signals feed |
|
|
93
|
+
| `trie_documents` | Read cloud documents |
|
|
94
|
+
| `trie_ledger` | Read cloud ledger entries |
|
|
95
|
+
| `trie_search` | Natural language search over cloud context |
|
|
515
96
|
|
|
516
|
-
|
|
517
|
-
trie sync init # Initialize shared ledger
|
|
518
|
-
trie sync pull # Pull from shared storage
|
|
519
|
-
trie sync push # Push to shared storage
|
|
520
|
-
trie sync status # Show sync state
|
|
521
|
-
trie sync hooks --install # Install auto-sync git hooks
|
|
522
|
-
```
|
|
97
|
+
## MCP Resources
|
|
523
98
|
|
|
524
|
-
|
|
99
|
+
| URI | Description |
|
|
100
|
+
|-----|-------------|
|
|
101
|
+
| `trie://context` | Consolidated context with hot zones and active signals |
|
|
102
|
+
| `trie://graph` | Raw ANT graph from cloud |
|
|
525
103
|
|
|
526
|
-
|
|
527
|
-
trie keys generate # Generate Ed25519 signing key
|
|
528
|
-
trie keys status # Check if signing is configured
|
|
529
|
-
trie keys public # Get your public key
|
|
530
|
-
```
|
|
104
|
+
**Usage:** Have your AI assistant read `trie://context` at conversation start and call `trie_check_file` before editing high-risk files.
|
|
531
105
|
|
|
532
|
-
|
|
106
|
+
## Configuration
|
|
533
107
|
|
|
534
|
-
|
|
535
|
-
trie ok # Pattern is good
|
|
536
|
-
trie bad # Pattern is bad
|
|
537
|
-
trie pause # Disable warnings for 1 hour
|
|
538
|
-
```
|
|
108
|
+
Auth and config are stored locally (keychain-backed where available). The API base URL defaults to `https://trie-api.vercel.app` and can be overridden with `TRIE_API_BASE_URL`.
|
|
539
109
|
|
|
540
|
-
|
|
110
|
+
## Development
|
|
541
111
|
|
|
542
112
|
```bash
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
trie linear auth <key> # Configure Linear
|
|
547
|
-
trie linear sync # Sync Linear tickets
|
|
548
|
-
```
|
|
549
|
-
|
|
550
|
-
## Configuration
|
|
551
|
-
|
|
552
|
-
Create `.trie/config.json`:
|
|
553
|
-
|
|
554
|
-
```json
|
|
555
|
-
{
|
|
556
|
-
"scanOptions": {
|
|
557
|
-
"maxConcurrency": 4,
|
|
558
|
-
"timeoutMs": 30000
|
|
559
|
-
},
|
|
560
|
-
"integrations": {
|
|
561
|
-
"slack": {
|
|
562
|
-
"enabled": true,
|
|
563
|
-
"webhook": "https://hooks.slack.com/...",
|
|
564
|
-
"channel": "#security"
|
|
565
|
-
}
|
|
566
|
-
},
|
|
567
|
-
"autoEscalation": {
|
|
568
|
-
"enabled": true,
|
|
569
|
-
"quietHours": { "start": "21:00", "end": "08:00" }
|
|
570
|
-
}
|
|
571
|
-
}
|
|
113
|
+
npm install
|
|
114
|
+
npm run build
|
|
115
|
+
npm test
|
|
572
116
|
```
|
|
573
117
|
|
|
574
|
-
## Troubleshooting
|
|
575
|
-
|
|
576
|
-
**Trie not finding issues**: You haven't taught Trie about your patterns yet. Use `trie tell` to report incidents.
|
|
577
|
-
|
|
578
|
-
**Memory queries returning empty**: Report incidents with `trie tell` or run `trie learn` to extract from git history.
|
|
579
|
-
|
|
580
|
-
**Query tools not working**: Make sure you've initialized with `trie init` and have `ANTHROPIC_API_KEY` set.
|
|
581
|
-
|
|
582
|
-
**Hooks not working**: Reinstall with `trie init`. Check write permissions to `.git/hooks/`.
|
|
583
|
-
|
|
584
|
-
**Goals showing but not detecting violations**: Goals may not be active in project state. Run `trie goal add "<goal>"` to activate.
|
|
585
|
-
|
|
586
|
-
**Quick start:**
|
|
587
|
-
1. Fork and clone the repository
|
|
588
|
-
2. `npm install`
|
|
589
|
-
3. Copy `.env.example` to `.env.local` and add API keys
|
|
590
|
-
4. `npm run build`
|
|
591
|
-
5. `npm test`
|
|
592
|
-
|
|
593
118
|
**Before submitting:**
|
|
594
|
-
-
|
|
595
|
-
-
|
|
596
|
-
-
|
|
597
|
-
- Update docs for new features
|
|
598
|
-
- Never commit secrets or API keys
|
|
599
|
-
|
|
119
|
+
- Tests pass (`npm test`)
|
|
120
|
+
- Typecheck passes (`npm run typecheck`)
|
|
121
|
+
- Lint passes (`npm run lint`)
|
|
600
122
|
|
|
601
123
|
## License
|
|
602
124
|
|