@triedotdev/mcp 1.0.51 → 1.0.52

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/dist/cli/main.js CHANGED
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  ContextGraph,
4
4
  IncidentIndex,
5
- MissingAPIKeyError,
6
5
  SKILL_CATEGORIES,
7
6
  TrieFeedbackTool,
8
7
  completeBootstrap,
8
+ detectStack,
9
9
  exportToJson,
10
10
  formatFriendlyError,
11
11
  getSkillCategories,
@@ -16,7 +16,7 @@ import {
16
16
  needsBootstrap,
17
17
  perceiveCurrentChanges,
18
18
  reasonAboutChangesHumanReadable
19
- } from "../chunk-IEFAQFDQ.js";
19
+ } from "../chunk-WCHIJDCD.js";
20
20
  import "../chunk-C3AS5OXW.js";
21
21
  import {
22
22
  findCrossProjectPatterns,
@@ -175,6 +175,34 @@ async function handleSkillsCommand(args) {
175
175
  }
176
176
  break;
177
177
  }
178
+ case "suggest":
179
+ case "recommended": {
180
+ const workDir = getWorkingDirectory(void 0, true);
181
+ const stack = await detectStack(workDir);
182
+ if (stack.suggestedSkills.length === 0) {
183
+ console.log("");
184
+ console.log("No specific skill recommendations for your stack.");
185
+ console.log("");
186
+ console.log("Browse all skills:");
187
+ console.log(" trie skills list categories");
188
+ console.log(" https://skills.sh");
189
+ return;
190
+ }
191
+ console.log("");
192
+ console.log("Suggested Skills (based on your stack):");
193
+ console.log("");
194
+ if (stack.framework) console.log(` Detected: ${stack.framework}`);
195
+ if (stack.language) console.log(` Language: ${stack.language}`);
196
+ if (stack.database) console.log(` Database: ${stack.database}`);
197
+ console.log("");
198
+ for (const skill of stack.suggestedSkills) {
199
+ console.log(` trie skills add ${skill}`);
200
+ }
201
+ console.log("");
202
+ console.log("Install any skill with: trie skills add <source> <name>");
203
+ console.log("Browse all skills: https://skills.sh");
204
+ break;
205
+ }
178
206
  case "info": {
179
207
  if (!rest[0]) {
180
208
  console.log("Usage: trie-agent skills info <skill-name>");
@@ -215,6 +243,7 @@ Skills are NOT agents - they are knowledge/instructions that the
215
243
  skill-review agent applies during code review.
216
244
 
217
245
  Commands:
246
+ trie skills suggest Show skills for your stack
218
247
  trie skills add <source> [name] Install a skill
219
248
  trie skills list List installed skills
220
249
  trie skills list <category> Browse skills by category
@@ -364,7 +393,7 @@ async function handleInitCommand(args) {
364
393
  \u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2551
365
394
  \u2551 \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u2551
366
395
  \u2551 \u2551
367
- \u2551 Your central registry for agents and skills \u2551
396
+ \u2551 Your guardian agent and skills registry \u2551
368
397
  \u2551 \u2551
369
398
  \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\u255D
370
399
 
@@ -379,16 +408,26 @@ async function handleInitCommand(args) {
379
408
  force,
380
409
  skipBootstrap
381
410
  });
382
- if (result.created.length > 0) {
383
- console.log("Created files:");
384
- for (const file of result.created) {
385
- console.log(` + .trie/${file}`);
386
- }
387
- }
388
- if (result.skipped.length > 0 && !force) {
389
- console.log("\nSkipped (already exist):");
411
+ const isReInit = result.created.length === 0 && result.skipped.length > 0;
412
+ if (isReInit && !force) {
413
+ console.log("Trie is already initialized in this project.\n");
414
+ console.log("Your files:");
390
415
  for (const file of result.skipped) {
391
- console.log(` - .trie/${file}`);
416
+ console.log(` \u2713 .trie/${file}`);
417
+ }
418
+ console.log("\nTo reset and recreate files: trie init --force");
419
+ } else {
420
+ if (result.created.length > 0) {
421
+ console.log("Created files:");
422
+ for (const file of result.created) {
423
+ console.log(` + .trie/${file}`);
424
+ }
425
+ }
426
+ if (result.skipped.length > 0 && !force) {
427
+ console.log("\nSkipped (already exist):");
428
+ for (const file of result.skipped) {
429
+ console.log(` - .trie/${file}`);
430
+ }
392
431
  }
393
432
  }
394
433
  console.log("\nDetected Stack:");
@@ -404,7 +443,7 @@ async function handleInitCommand(args) {
404
443
  console.log(` trie skills add ${skill}`);
405
444
  }
406
445
  if (result.stack.suggestedSkills.length > 5) {
407
- console.log(` ... and ${result.stack.suggestedSkills.length - 5} more (run "trie init" again to see all)`);
446
+ console.log(` ... and ${result.stack.suggestedSkills.length - 5} more: trie skills suggest`);
408
447
  }
409
448
  }
410
449
  const categories = getSkillCategories();
@@ -416,11 +455,19 @@ async function handleInitCommand(args) {
416
455
  console.log(` trie skills list categories # see all ${categories.length} categories`);
417
456
  console.log("\nBrowse all skills: https://skills.sh");
418
457
  console.log(`
419
- Next Steps:
420
- 1. Edit .trie/PROJECT.md with your project description
421
- 2. Define coding standards in .trie/RULES.md
422
- 3. Run "trie scan" to analyze your codebase
423
- 4. Run "trie init complete" when setup is done
458
+ Quick Start:
459
+ 1. trie scan # Analyze your codebase now
460
+ 2. trie watch # Start the guardian (watches + nudges as you code)
461
+ 3. trie tell "what broke" # Teach Trie about past incidents
462
+
463
+ The guardian agent is now active via git hooks (pre-commit, pre-push).
464
+ For real-time nudges while coding, run "trie watch" in a terminal.
465
+
466
+ Customize Later:
467
+ - .trie/PROJECT.md \u2014 Describe your project for better context
468
+ - .trie/RULES.md \u2014 Define coding standards Trie should enforce
469
+
470
+ Run "trie help" to see all available commands.
424
471
  `);
425
472
  const hooks = installGitHooks(workDir);
426
473
  if (hooks.length > 0) {
@@ -433,9 +480,17 @@ Next Steps:
433
480
  }
434
481
  ensureGitignore(workDir);
435
482
  if (!process.env.ANTHROPIC_API_KEY) {
436
- const msg = new MissingAPIKeyError().userMessage;
437
483
  console.log(`
438
- Warning: ${msg}`);
484
+ Note: Running in pattern-only mode. For AI-powered analysis, set your API key:
485
+
486
+ This session only:
487
+ export ANTHROPIC_API_KEY=sk-ant-...
488
+
489
+ Persist in shell config (~/.zshrc or ~/.bashrc):
490
+ echo 'export ANTHROPIC_API_KEY=sk-ant-...' >> ~/.zshrc
491
+ source ~/.zshrc
492
+
493
+ Or add to your MCP config for Cursor/Claude Code (see README).`);
439
494
  }
440
495
  } catch (error) {
441
496
  const friendly = formatFriendlyError(error);
@@ -881,59 +936,56 @@ USAGE:
881
936
  trie-agent <command> [options]
882
937
 
883
938
  COMMANDS:
884
- help Show this help message
885
- init Initialize bootstrap files (.trie/RULES.md, etc.)
886
- setup Configure API key and environment
939
+ init Initialize Trie in your project
887
940
  scan Scan codebase once and exit
888
- checkpoint Save context without running a scan
889
- watch Watch for changes and scan continuously
890
- agents List all available agents
941
+ watch Start the guardian (watches + nudges as you code)
942
+ check Run risk check before pushing
943
+ tell "<incident>" Report an incident ("users can't log in")
944
+ ok Mark last warning as helpful (thumbs up)
945
+ bad Mark last warning as not helpful (thumbs down)
946
+ quiet Snooze nudges for 1 hour
947
+
891
948
  skills Manage external skills from skills.sh
892
- project View/manage project info (.trie/PROJECT.md)
893
949
  memory Search and manage issue memory
950
+ project View/manage project info (.trie/PROJECT.md)
951
+ agents List all available agents
952
+ setup Configure API key and environment
953
+
894
954
  agent-smith Run Agent Smith (35 vibe code hunters)
895
955
  super-reviewer Run interactive PR review
956
+
957
+ help Show this help message
896
958
  version Show version information
897
959
 
898
960
  EXAMPLES:
899
- # First time setup
900
- trie-agent setup
901
-
902
- # Scan your project once
903
- trie-agent scan
961
+ # Initialize Trie in your project
962
+ trie init
904
963
 
905
- # Watch mode (scan on file changes)
906
- trie-agent watch
964
+ # Start the guardian (watches + nudges as you code)
965
+ trie watch
907
966
 
908
- # Scan specific directory
909
- trie-agent scan --dir ./src
967
+ # Scan your codebase now
968
+ trie scan
910
969
 
911
- # Scan with custom user count for cost estimation
912
- trie-agent scan --users 10000
970
+ # Report an incident to teach Trie
971
+ trie tell "users couldn't log in after my last push"
913
972
 
914
- # Initialize project info file
915
- trie-agent project init
973
+ # Give feedback on warnings
974
+ trie ok # Warning was helpful
975
+ trie bad # Warning was noise
916
976
 
917
- # View project info
918
- trie-agent project
977
+ # Check before pushing (also runs via git hooks)
978
+ trie check
919
979
 
920
- # Install a skill from GitHub
921
- trie-agent skills add vercel-labs/agent-skills react-best-practices
922
-
923
- # List installed skills
924
- trie-agent skills list
925
-
926
- # Initialize bootstrap files
927
- trie-agent init
928
-
929
- # Search issue memory
930
- trie-agent memory search "SQL injection"
980
+ # Install skills from skills.sh
981
+ trie skills add vercel-labs/agent-skills react-best-practices
931
982
 
932
- # Run Agent Smith (vibe code hunter)
933
- trie-agent agent-smith
983
+ # Search your incident memory
984
+ trie memory search "SQL injection"
934
985
 
935
- # Run interactive PR review
936
- trie-agent super-reviewer
986
+ # Run specialized scans
987
+ trie agent-smith # 35 vibe code hunters
988
+ trie super-reviewer # Interactive PR review
937
989
 
938
990
  MCP TOOLS (use via Cursor/Claude Desktop):
939
991
  trie_scan Intelligent scan with agent selection