@triedotdev/mcp 1.0.140 → 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
@@ -57,6 +57,10 @@ npm install -g trie
57
57
  # Set up in your project
58
58
  cd your-project
59
59
  trie init
60
+
61
+ # Configure integrations
62
+ trie setup # Show setup guide
63
+ trie setup slack <webhook> # Set up Slack notifications
60
64
  ```
61
65
 
62
66
  ### 2. Start Teaching Trie
@@ -581,12 +585,22 @@ Note: VS Code extension is coming soon.
581
585
 
582
586
  ```bash
583
587
  trie init # Set up Trie in your project
588
+ trie setup # Show setup guide with integration status
584
589
  trie tell # Report incidents (extracts decisions, facts, blockers)
585
590
  trie status # View project health and memory stats
586
591
  trie learn # Train Trie from history or feedback
587
592
  trie gotcha # Predict problems with current changes
588
593
  ```
589
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
+
590
604
  ### Memory Management
591
605
 
592
606
  ```bash
@@ -668,12 +682,18 @@ Create .trie/config.json:
668
682
 
669
683
  Installed automatically with trie init:
670
684
 
671
- pre-commit - Quick scan of staged files
672
- post-commit - Update context graph
673
- 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)
674
688
 
675
- 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
+ ```
676
695
 
696
+ **Bypass Methods:**
677
697
  ```bash
678
698
  git push --no-verify # Skip all hooks
679
699
  TRIE_BYPASS=1 git push # Skip Trie but log bypass
@@ -683,9 +703,23 @@ TRIE_BYPASS=1 git push # Skip Trie but log bypass
683
703
 
684
704
  Trie sends notifications to Slack for team collaboration:
685
705
 
686
- **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:**
687
719
  1. Create a Slack webhook: https://api.slack.com/apps
688
- 2. Add to `.trie/config.json`:
720
+ 2. Run: `trie setup slack <webhook-url> [#channel]`
721
+
722
+ Or manually add to `.trie/config.json`:
689
723
 
690
724
  ```json
691
725
  {
@@ -706,10 +740,11 @@ Trie sends notifications to Slack for team collaboration:
706
740
 
707
741
  **What Trie sends to Slack:**
708
742
  - Decision extractions from incidents
709
- - Active blockers
743
+ - Active blockers
710
744
  - Risk predictions from gotcha
711
745
  - Daily/weekly team summaries
712
746
  - Critical decision changes
747
+ - Auto-escalation notifications
713
748
 
714
749
  ## CI/CD Integration
715
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