@triedotdev/mcp 1.0.139 → 1.0.141

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 CHANGED
@@ -1,12 +1,13 @@
1
- # Trie: Governance for Teams That Ship with AI
1
+ # Trie: Trainable AI agent with a cryptographic governance ledger and portable context for AI-generated codebases.
2
2
 
3
- **The ledger that keeps your work compliant when agents and humans ship together—so you ship the right thing every time.**
3
+
4
+ **The ledger that keeps your work compliant when agents and humans ship together.**
4
5
 
5
6
  [![Download Workspace](https://img.shields.io/badge/Download-Trie%20Workspace-blue)](https://www.trie.dev) [![Follow on X](https://img.shields.io/badge/Follow-@louiskishfy-1DA1F2?logo=x)](https://x.com/louiskishfy)
6
7
 
7
8
  ## What Trie Does
8
9
 
9
- Trie maintains a **decision ledger** that governs work across agents and humans:
10
+ Trie is a trainable AI agent that maintains a ledger that governs work across agents and humans:
10
11
 
11
12
  - **Autonomous Operation**: Run `trie watch` and the agent monitors your codebase 24/7
12
13
  - **Intelligent Extraction**: Automatically extracts decisions, facts, blockers from every change
@@ -20,7 +21,7 @@ The ledger learns from every incident, decision, and fix. When you ship, Trie re
20
21
 
21
22
  **The problem**: When work happens across Cursor, Claude Code, VS Code, the terminal, and CI/CD, context fragments. An agent makes a decision in one tool; a human forgets it in another. Each environment has its own memory—or none at all. You burn tokens re-explaining the same constraints, or worse, ship code that violates decisions made elsewhere.
22
23
 
23
- **The solution**: Trie stores important information in a **cryptographic governance ledger**—a tamper-evident, append-only chain of blocks. Every decision, incident, fix, and tradeoff gets written to the ledger. Because the ledger lives in your `.trie/` folder and syncs across your team, **every tool reads from the same source of truth**. Cursor, Claude, the CLI, and CI/CD all query the same blocks. No more context loss. No more conflicting memories. The ledger is the shared brain that keeps agents and humans aligned across every tool you use.
24
+ **The solution**: Trie stores important information in a cryptographic governance ledgera tamper-evident, append-only chain of blocks. Every decision, incident, fix, and tradeoff gets written to the ledger. Because the ledger lives in your `.trie/` folder and syncs across your team, every tool reads from the same source of truth. Cursor, Claude, the CLI, and CI/CD all query the same blocks. No more context loss. No more conflicting memories. The ledger is the shared brain that keeps agents and humans aligned across every tool you use.
24
25
 
25
26
  ## Goal
26
27
 
@@ -56,6 +57,10 @@ npm install -g trie
56
57
  # Set up in your project
57
58
  cd your-project
58
59
  trie init
60
+
61
+ # Configure integrations
62
+ trie setup # Show setup guide
63
+ trie setup slack <webhook> # Set up Slack notifications
59
64
  ```
60
65
 
61
66
  ### 2. Start Teaching Trie
@@ -580,12 +585,22 @@ Note: VS Code extension is coming soon.
580
585
 
581
586
  ```bash
582
587
  trie init # Set up Trie in your project
588
+ trie setup # Show setup guide with integration status
583
589
  trie tell # Report incidents (extracts decisions, facts, blockers)
584
590
  trie status # View project health and memory stats
585
591
  trie learn # Train Trie from history or feedback
586
592
  trie gotcha # Predict problems with current changes
587
593
  ```
588
594
 
595
+ ### Setup & Configuration
596
+
597
+ ```bash
598
+ trie setup # Show setup guide with status
599
+ trie setup slack # Show Slack setup guide
600
+ trie setup slack <webhook-url> [channel] # Configure Slack integration
601
+ trie setup test-slack # Test Slack connection
602
+ ```
603
+
589
604
  ### Memory Management
590
605
 
591
606
  ```bash
@@ -667,12 +682,18 @@ Create .trie/config.json:
667
682
 
668
683
  Installed automatically with trie init:
669
684
 
670
- pre-commit - Quick scan of staged files
671
- post-commit - Update context graph
672
- pre-push - Block critical issues (can be bypassed)
685
+ - **pre-commit** - Quick scan of staged files
686
+ - **post-commit** - Update context graph
687
+ - **pre-push** - Block critical issues (can be bypassed)
673
688
 
674
- To bypass:
689
+ **Hook Commands** (called automatically by Git):
690
+ ```bash
691
+ trie pre-commit # Scan staged files, block on critical issues
692
+ trie post-commit # Update context graph after commit
693
+ trie pre-push # Block push on critical issues
694
+ ```
675
695
 
696
+ **Bypass Methods:**
676
697
  ```bash
677
698
  git push --no-verify # Skip all hooks
678
699
  TRIE_BYPASS=1 git push # Skip Trie but log bypass
@@ -682,9 +703,23 @@ TRIE_BYPASS=1 git push # Skip Trie but log bypass
682
703
 
683
704
  Trie sends notifications to Slack for team collaboration:
684
705
 
685
- **Setup:**
706
+ **Quick Setup:**
707
+ ```bash
708
+ # Show setup guide
709
+ trie setup slack
710
+
711
+ # Configure webhook
712
+ trie setup slack <webhook-url> [#channel]
713
+
714
+ # Test integration
715
+ trie setup test-slack
716
+ ```
717
+
718
+ **Manual Setup:**
686
719
  1. Create a Slack webhook: https://api.slack.com/apps
687
- 2. Add to `.trie/config.json`:
720
+ 2. Run: `trie setup slack <webhook-url> [#channel]`
721
+
722
+ Or manually add to `.trie/config.json`:
688
723
 
689
724
  ```json
690
725
  {
@@ -705,10 +740,11 @@ Trie sends notifications to Slack for team collaboration:
705
740
 
706
741
  **What Trie sends to Slack:**
707
742
  - Decision extractions from incidents
708
- - Active blockers
743
+ - Active blockers
709
744
  - Risk predictions from gotcha
710
745
  - Daily/weekly team summaries
711
746
  - Critical decision changes
747
+ - Auto-escalation notifications
712
748
 
713
749
  ## CI/CD Integration
714
750
 
@@ -9,9 +9,10 @@ import {
9
9
  } from "./chunk-3MUCUZ46.js";
10
10
  import {
11
11
  GotchaPredictor,
12
+ SlackIntegration,
12
13
  findCrossProjectPatterns,
13
14
  recordToGlobalMemory
14
- } from "./chunk-UOSTOLU7.js";
15
+ } from "./chunk-M5R6DZQY.js";
15
16
  import {
16
17
  ContextGraph
17
18
  } from "./chunk-FH335WL5.js";
@@ -355,360 +356,6 @@ function getRiskPredictor(projectPath) {
355
356
  return predictor;
356
357
  }
357
358
 
358
- // src/integrations/slack.ts
359
- var SlackIntegration = class {
360
- constructor(config) {
361
- this.config = config;
362
- }
363
- /**
364
- * Send scan completion notification
365
- */
366
- async sendScanNotification(_issues, priorityReport, repositoryName, branch = "main") {
367
- const { urgent, high, medium, low } = priorityReport;
368
- const statusEmoji = urgent.length > 0 ? "[URGENT]" : high.length > 0 ? "[HIGH]" : "[OK]";
369
- const message = {
370
- blocks: [
371
- {
372
- type: "section",
373
- text: {
374
- type: "mrkdwn",
375
- text: `${statusEmoji} *Trie Security Scan Complete*
376
- *Repository:* ${repositoryName} (${branch})`
377
- }
378
- },
379
- {
380
- type: "section",
381
- fields: [
382
- {
383
- type: "mrkdwn",
384
- text: `*Urgent:* ${urgent.length}`
385
- },
386
- {
387
- type: "mrkdwn",
388
- text: `*High:* ${high.length}`
389
- },
390
- {
391
- type: "mrkdwn",
392
- text: `*Medium:* ${medium.length}`
393
- },
394
- {
395
- type: "mrkdwn",
396
- text: `*\u{1F539} Low:* ${low.length}`
397
- }
398
- ]
399
- }
400
- ],
401
- attachments: []
402
- };
403
- if (urgent.length > 0) {
404
- const urgentDetails = urgent.slice(0, 5).map(
405
- (group) => `\u2022 ${group.description} (${group.count} instances)`
406
- ).join("\n");
407
- message.attachments.push({
408
- color: "danger",
409
- title: "Urgent Issues - Immediate Action Required",
410
- text: urgentDetails,
411
- footer: urgent.length > 5 ? `... and ${urgent.length - 5} more urgent issues` : void 0
412
- });
413
- }
414
- if (high.length > 0) {
415
- const highDetails = high.slice(0, 3).map(
416
- (group) => `\u2022 ${group.description} (${group.count} instances)`
417
- ).join("\n");
418
- message.attachments.push({
419
- color: "warning",
420
- title: "High Priority Issues",
421
- text: highDetails,
422
- footer: high.length > 3 ? `... and ${high.length - 3} more high priority issues` : void 0
423
- });
424
- }
425
- if (priorityReport.recommendations.length > 0) {
426
- message.attachments.push({
427
- color: "good",
428
- title: "Recommendations",
429
- text: priorityReport.recommendations.slice(0, 3).join("\n")
430
- });
431
- }
432
- await this.sendMessage(message);
433
- }
434
- /**
435
- * Send critical issue alert
436
- */
437
- async sendCriticalAlert(issues, repositoryName) {
438
- const message = {
439
- text: `CRITICAL SECURITY ALERT: ${repositoryName}`,
440
- blocks: [
441
- {
442
- type: "section",
443
- text: {
444
- type: "mrkdwn",
445
- text: `*CRITICAL SECURITY ALERT*
446
- *Repository:* ${repositoryName}
447
- *Critical Issues:* ${issues.length}`
448
- }
449
- }
450
- ],
451
- attachments: issues.slice(0, 5).map((issue) => ({
452
- color: "danger",
453
- title: `${issue.file}:${issue.line || "?"}`,
454
- text: issue.issue.slice(0, 200),
455
- fields: [
456
- {
457
- title: "Fix",
458
- value: issue.fix.slice(0, 100),
459
- short: false
460
- }
461
- ],
462
- footer: `Agent: ${issue.agent}`,
463
- ts: Math.floor(Date.now() / 1e3)
464
- }))
465
- };
466
- if (issues.length > 5) {
467
- message.attachments.push({
468
- color: "danger",
469
- text: `... and ${issues.length - 5} more critical issues. View full report for details.`
470
- });
471
- }
472
- await this.sendMessage(message);
473
- }
474
- /**
475
- * Send team notification
476
- */
477
- async sendTeamNotification(notification) {
478
- const emoji = this.getNotificationEmoji(notification.type);
479
- const message = {
480
- blocks: [
481
- {
482
- type: "section",
483
- text: {
484
- type: "mrkdwn",
485
- text: `${emoji} *${notification.title}*
486
- ${notification.message}`
487
- }
488
- }
489
- ]
490
- };
491
- if (notification.type === "assignment" && notification.data) {
492
- const { assignment, issue } = notification.data;
493
- message.attachments = [{
494
- color: this.getAssignmentColor(assignment.priority),
495
- fields: [
496
- {
497
- title: "Priority",
498
- value: assignment.priority.toUpperCase(),
499
- short: true
500
- },
501
- {
502
- title: "Due Date",
503
- value: assignment.dueDate ? new Date(assignment.dueDate).toLocaleDateString() : "Not set",
504
- short: true
505
- },
506
- {
507
- title: "File",
508
- value: issue.file,
509
- short: false
510
- }
511
- ]
512
- }];
513
- }
514
- await this.sendMessage(message);
515
- }
516
- /**
517
- * Send daily/weekly team summary
518
- */
519
- async sendTeamSummary(period, stats) {
520
- const emoji = period === "daily" ? "[DAILY]" : "[WEEKLY]";
521
- const title = `${emoji} ${period.charAt(0).toUpperCase() + period.slice(1)} Security Summary`;
522
- const message = {
523
- blocks: [
524
- {
525
- type: "section",
526
- text: {
527
- type: "mrkdwn",
528
- text: `*${title}*`
529
- }
530
- },
531
- {
532
- type: "section",
533
- fields: [
534
- {
535
- type: "mrkdwn",
536
- text: `*New Issues:* ${stats.newIssues}`
537
- },
538
- {
539
- type: "mrkdwn",
540
- text: `*\u2705 Resolved:* ${stats.resolvedIssues}`
541
- },
542
- {
543
- type: "mrkdwn",
544
- text: `*Overdue:* ${stats.overdueIssues}`
545
- },
546
- {
547
- type: "mrkdwn",
548
- text: `*Net Change:* ${stats.resolvedIssues - stats.newIssues > 0 ? "+" : ""}${stats.resolvedIssues - stats.newIssues}`
549
- }
550
- ]
551
- }
552
- ],
553
- attachments: []
554
- };
555
- if (stats.topCategories.length > 0) {
556
- const categoriesText = stats.topCategories.slice(0, 5).map((cat) => `\u2022 ${cat.category}: ${cat.count}`).join("\n");
557
- message.attachments.push({
558
- color: "good",
559
- title: "Top Issue Categories",
560
- text: categoriesText
561
- });
562
- }
563
- if (stats.topContributors.length > 0) {
564
- const contributorsText = stats.topContributors.slice(0, 5).map((contrib) => `\u2022 ${contrib.name}: ${contrib.resolved} resolved`).join("\n");
565
- message.attachments.push({
566
- color: "good",
567
- title: "Top Contributors",
568
- text: contributorsText
569
- });
570
- }
571
- await this.sendMessage(message);
572
- }
573
- /**
574
- * Send bulk fix notification
575
- */
576
- async sendBulkFixNotification(fixedGroups, totalFixed, repositoryName) {
577
- const message = {
578
- blocks: [
579
- {
580
- type: "section",
581
- text: {
582
- type: "mrkdwn",
583
- text: `*Bulk Fix Applied*
584
- *Repository:* ${repositoryName}
585
- *Issues Fixed:* ${totalFixed}`
586
- }
587
- }
588
- ],
589
- attachments: [{
590
- color: "good",
591
- title: "\u{1F527} Fixed Issue Groups",
592
- text: fixedGroups.map(
593
- (group) => `\u2022 ${group.description} (${group.count} instances)`
594
- ).join("\n")
595
- }]
596
- };
597
- await this.sendMessage(message);
598
- }
599
- /**
600
- * Send escalation notification
601
- */
602
- async sendEscalationNotification(overdueAssignments) {
603
- const message = {
604
- text: "OVERDUE ISSUE ESCALATION",
605
- blocks: [
606
- {
607
- type: "section",
608
- text: {
609
- type: "mrkdwn",
610
- text: `*Overdue Issue Escalation*
611
- ${overdueAssignments.length} issues are overdue and require attention.`
612
- }
613
- }
614
- ],
615
- attachments: overdueAssignments.map((assignment) => ({
616
- color: "warning",
617
- title: `Issue ${assignment.issueId}`,
618
- fields: [
619
- {
620
- title: "Assignee",
621
- value: assignment.assignee,
622
- short: true
623
- },
624
- {
625
- title: "Days Overdue",
626
- value: assignment.daysOverdue.toString(),
627
- short: true
628
- },
629
- {
630
- title: "Priority",
631
- value: assignment.priority.toUpperCase(),
632
- short: true
633
- }
634
- ]
635
- }))
636
- };
637
- await this.sendMessage(message);
638
- }
639
- /**
640
- * Send message to Slack
641
- */
642
- async sendMessage(message) {
643
- const payload = {
644
- ...message,
645
- channel: this.config.channel || message.channel,
646
- username: this.config.username || "Trie Security Bot",
647
- icon_emoji: this.config.iconEmoji || ":shield:"
648
- };
649
- try {
650
- const response = await fetch(this.config.webhookUrl, {
651
- method: "POST",
652
- headers: {
653
- "Content-Type": "application/json"
654
- },
655
- body: JSON.stringify(payload)
656
- });
657
- if (!response.ok) {
658
- throw new Error(`Slack API error: ${response.status} ${response.statusText}`);
659
- }
660
- } catch (error) {
661
- console.error("Failed to send Slack notification:", error);
662
- throw error;
663
- }
664
- }
665
- /**
666
- * Get emoji for notification type
667
- */
668
- getNotificationEmoji(type) {
669
- const emojis = {
670
- assignment: "[ASSIGN]",
671
- escalation: "[ESCALATE]",
672
- completion: "[DONE]",
673
- reminder: "[REMIND]"
674
- };
675
- return emojis[type] ?? "[NOTIFY]";
676
- }
677
- /**
678
- * Get color for assignment priority
679
- */
680
- getAssignmentColor(priority) {
681
- const colors = {
682
- urgent: "danger",
683
- high: "warning",
684
- medium: "good",
685
- low: "#36a64f"
686
- };
687
- return colors[priority] ?? "good";
688
- }
689
- /**
690
- * Test Slack connection
691
- */
692
- async testConnection() {
693
- try {
694
- await this.sendMessage({
695
- text: "Trie Slack Integration Test",
696
- blocks: [{
697
- type: "section",
698
- text: {
699
- type: "mrkdwn",
700
- text: "*Trie Slack Integration Test*\nIf you see this message, the integration is working correctly!"
701
- }
702
- }]
703
- });
704
- return true;
705
- } catch (error) {
706
- console.error("Slack connection test failed:", error);
707
- return false;
708
- }
709
- }
710
- };
711
-
712
359
  // src/agent/escalation.ts
713
360
  var DEFAULT_CONFIG2 = {
714
361
  enabled: true,
@@ -2163,4 +1810,4 @@ export {
2163
1810
  TrieAgent,
2164
1811
  getTrieAgent
2165
1812
  };
2166
- //# sourceMappingURL=chunk-OQ4A3RDY.js.map
1813
+ //# sourceMappingURL=chunk-LHPWSUVT.js.map