@triedotdev/mcp 1.0.115 → 1.0.116

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.
Files changed (65) hide show
  1. package/dist/{autonomy-config-JXB7WCZ2.js → autonomy-config-QA6ATWLJ.js} +3 -3
  2. package/dist/{chunk-ZYKEILVK.js → chunk-2764RZVV.js} +305 -86
  3. package/dist/chunk-2764RZVV.js.map +1 -0
  4. package/dist/{chunk-R4AAPFXC.js → chunk-45Y5TLQZ.js} +2 -2
  5. package/dist/{chunk-R4AAPFXC.js.map → chunk-45Y5TLQZ.js.map} +1 -1
  6. package/dist/{chunk-KRH642MT.js → chunk-4BGAVEO6.js} +2 -2
  7. package/dist/{chunk-NS2MSZMB.js → chunk-55CBWOEZ.js} +2 -2
  8. package/dist/{chunk-YR4BMGYO.js → chunk-7Q6I2CB4.js} +2 -2
  9. package/dist/{chunk-TKMV7JKN.js → chunk-DFHMB44X.js} +2 -2
  10. package/dist/{chunk-D3EXBJE2.js → chunk-FNW7Z7ZS.js} +5 -5
  11. package/dist/{chunk-DZREHOGW.js → chunk-I7XKF5XD.js} +5 -5
  12. package/dist/{chunk-2SIFK7OW.js → chunk-IQBHPTV7.js} +4 -4
  13. package/dist/{chunk-AOFYU6T3.js → chunk-OMCEUJ5I.js} +12 -12
  14. package/dist/{chunk-55DOQNHJ.js → chunk-PRFHN2X6.js} +4 -4
  15. package/dist/{chunk-MVNJPJBK.js → chunk-SRQ4DNOP.js} +5 -5
  16. package/dist/{chunk-2GIAROBF.js → chunk-WHIQAGB7.js} +2 -2
  17. package/dist/{chunk-SWSK7ANT.js → chunk-WRGSH5RT.js} +2 -2
  18. package/dist/{chunk-6LXSA2OZ.js → chunk-Y52SNUW5.js} +3 -3
  19. package/dist/{chunk-I2GFI3AM.js → chunk-ZEXMMTIQ.js} +2 -2
  20. package/dist/cli/create-agent.js +1 -1
  21. package/dist/cli/main.js +66 -32
  22. package/dist/cli/main.js.map +1 -1
  23. package/dist/cli/yolo-daemon.js +14 -14
  24. package/dist/{client-7XZHCMD3.js → client-PMKE26IV.js} +3 -3
  25. package/dist/{goal-manager-LMS6ZJB7.js → goal-manager-JKTNFJQE.js} +7 -7
  26. package/dist/goal-validator-YSNN23D4.js +62 -0
  27. package/dist/goal-validator-YSNN23D4.js.map +1 -0
  28. package/dist/{graph-U5JWSAB5.js → graph-PAUZ5EMP.js} +3 -3
  29. package/dist/guardian-agent-UY2G56FT.js +25 -0
  30. package/dist/{hypothesis-KGC3P54C.js → hypothesis-RUCJ74X7.js} +7 -7
  31. package/dist/{incident-index-PNIVT47T.js → incident-index-ZCDSJ42L.js} +3 -3
  32. package/dist/index.js +65 -128
  33. package/dist/index.js.map +1 -1
  34. package/dist/{ledger-SR6OEBLO.js → ledger-JMPGJGLB.js} +3 -3
  35. package/package.json +1 -1
  36. package/dist/auto-fix-apply-PCAHWLXF.js +0 -10
  37. package/dist/chunk-DJ2YAGHK.js +0 -50
  38. package/dist/chunk-DJ2YAGHK.js.map +0 -1
  39. package/dist/chunk-ZYKEILVK.js.map +0 -1
  40. package/dist/goal-validator-T5HEYBC5.js +0 -186
  41. package/dist/goal-validator-T5HEYBC5.js.map +0 -1
  42. package/dist/guardian-agent-EXP7APLC.js +0 -25
  43. package/dist/ledger-SR6OEBLO.js.map +0 -1
  44. /package/dist/{auto-fix-apply-PCAHWLXF.js.map → autonomy-config-QA6ATWLJ.js.map} +0 -0
  45. /package/dist/{chunk-KRH642MT.js.map → chunk-4BGAVEO6.js.map} +0 -0
  46. /package/dist/{chunk-NS2MSZMB.js.map → chunk-55CBWOEZ.js.map} +0 -0
  47. /package/dist/{chunk-YR4BMGYO.js.map → chunk-7Q6I2CB4.js.map} +0 -0
  48. /package/dist/{chunk-TKMV7JKN.js.map → chunk-DFHMB44X.js.map} +0 -0
  49. /package/dist/{chunk-D3EXBJE2.js.map → chunk-FNW7Z7ZS.js.map} +0 -0
  50. /package/dist/{chunk-DZREHOGW.js.map → chunk-I7XKF5XD.js.map} +0 -0
  51. /package/dist/{chunk-2SIFK7OW.js.map → chunk-IQBHPTV7.js.map} +0 -0
  52. /package/dist/{chunk-AOFYU6T3.js.map → chunk-OMCEUJ5I.js.map} +0 -0
  53. /package/dist/{chunk-55DOQNHJ.js.map → chunk-PRFHN2X6.js.map} +0 -0
  54. /package/dist/{chunk-MVNJPJBK.js.map → chunk-SRQ4DNOP.js.map} +0 -0
  55. /package/dist/{chunk-2GIAROBF.js.map → chunk-WHIQAGB7.js.map} +0 -0
  56. /package/dist/{chunk-SWSK7ANT.js.map → chunk-WRGSH5RT.js.map} +0 -0
  57. /package/dist/{chunk-6LXSA2OZ.js.map → chunk-Y52SNUW5.js.map} +0 -0
  58. /package/dist/{chunk-I2GFI3AM.js.map → chunk-ZEXMMTIQ.js.map} +0 -0
  59. /package/dist/{autonomy-config-JXB7WCZ2.js.map → client-PMKE26IV.js.map} +0 -0
  60. /package/dist/{client-7XZHCMD3.js.map → goal-manager-JKTNFJQE.js.map} +0 -0
  61. /package/dist/{goal-manager-LMS6ZJB7.js.map → graph-PAUZ5EMP.js.map} +0 -0
  62. /package/dist/{graph-U5JWSAB5.js.map → guardian-agent-UY2G56FT.js.map} +0 -0
  63. /package/dist/{guardian-agent-EXP7APLC.js.map → hypothesis-RUCJ74X7.js.map} +0 -0
  64. /package/dist/{hypothesis-KGC3P54C.js.map → incident-index-ZCDSJ42L.js.map} +0 -0
  65. /package/dist/{incident-index-PNIVT47T.js.map → ledger-JMPGJGLB.js.map} +0 -0
package/dist/cli/main.js CHANGED
@@ -1,7 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- applyAutoFix
4
- } from "../chunk-DJ2YAGHK.js";
5
2
  import {
6
3
  LinearIngester,
7
4
  completeBootstrap,
@@ -14,14 +11,14 @@ import {
14
11
  needsBootstrap,
15
12
  projectInfoExists,
16
13
  saveConfig
17
- } from "../chunk-TKMV7JKN.js";
14
+ } from "../chunk-DFHMB44X.js";
18
15
  import {
19
16
  getAutonomyConfig,
20
17
  recordBypass,
21
18
  shouldAutoFix,
22
19
  shouldBlockPush,
23
20
  trackIssueOccurrence
24
- } from "../chunk-I2GFI3AM.js";
21
+ } from "../chunk-ZEXMMTIQ.js";
25
22
  import {
26
23
  LearningEngine,
27
24
  exportToJson,
@@ -37,7 +34,7 @@ import {
37
34
  isTrieInitialized,
38
35
  perceiveCurrentChanges,
39
36
  reasonAboutChangesHumanReadable
40
- } from "../chunk-MVNJPJBK.js";
37
+ } from "../chunk-SRQ4DNOP.js";
41
38
  import {
42
39
  GotchaPredictor,
43
40
  findCrossProjectPatterns,
@@ -45,8 +42,8 @@ import {
45
42
  listTrackedProjects,
46
43
  searchGlobalPatterns,
47
44
  updateGlobalMemoryMd
48
- } from "../chunk-D3EXBJE2.js";
49
- import "../chunk-SWSK7ANT.js";
45
+ } from "../chunk-FNW7Z7ZS.js";
46
+ import "../chunk-WRGSH5RT.js";
50
47
  import {
51
48
  getDailyLogs,
52
49
  getMemoryStats,
@@ -54,26 +51,26 @@ import {
54
51
  markIssueResolved,
55
52
  purgeIssues,
56
53
  searchIssues
57
- } from "../chunk-55DOQNHJ.js";
54
+ } from "../chunk-PRFHN2X6.js";
58
55
  import {
59
56
  getGuardianState
60
- } from "../chunk-KRH642MT.js";
57
+ } from "../chunk-4BGAVEO6.js";
61
58
  import "../chunk-F4NJ4CBP.js";
62
59
  import "../chunk-IXO4G4D3.js";
63
60
  import {
64
61
  ContextGraph
65
- } from "../chunk-NS2MSZMB.js";
62
+ } from "../chunk-55CBWOEZ.js";
66
63
  import {
67
64
  IncidentIndex
68
- } from "../chunk-2GIAROBF.js";
65
+ } from "../chunk-WHIQAGB7.js";
69
66
  import "../chunk-6NLHFIYA.js";
70
67
  import "../chunk-ZV2K6M7T.js";
71
- import "../chunk-YR4BMGYO.js";
68
+ import "../chunk-7Q6I2CB4.js";
72
69
  import "../chunk-43X6JBEM.js";
73
70
  import {
74
71
  getTrieDirectory,
75
72
  getWorkingDirectory
76
- } from "../chunk-R4AAPFXC.js";
73
+ } from "../chunk-45Y5TLQZ.js";
77
74
  import "../chunk-APMV77PU.js";
78
75
  import {
79
76
  __require
@@ -859,10 +856,47 @@ function collectIssuesForBlocking(reasoning) {
859
856
  }
860
857
 
861
858
  // src/cli/auto-fix.ts
862
- import { readFile } from "fs/promises";
863
- import { existsSync } from "fs";
859
+ import { readFile as readFile2 } from "fs/promises";
860
+ import { existsSync as existsSync2 } from "fs";
864
861
  import { createInterface } from "readline";
865
862
  import pc2 from "picocolors";
863
+
864
+ // src/utils/auto-fix-apply.ts
865
+ import { readFile, writeFile } from "fs/promises";
866
+ import { existsSync } from "fs";
867
+ async function applyAutoFix(fix) {
868
+ try {
869
+ if (!existsSync(fix.file)) {
870
+ return false;
871
+ }
872
+ const content = await readFile(fix.file, "utf-8");
873
+ const lines = content.split("\n");
874
+ if (fix.line === void 0 || fix.line < 1 || fix.line > lines.length) {
875
+ return false;
876
+ }
877
+ const lineIndex = fix.line - 1;
878
+ let newContent;
879
+ if (fix.type === "remove-console-log" || fix.type === "remove-debugger" || fix.fixed === "") {
880
+ lines.splice(lineIndex, 1);
881
+ newContent = lines.join("\n");
882
+ } else if (fix.type === "remove-emoji") {
883
+ const emojiPattern = /[\u{1F300}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/gu;
884
+ lines[lineIndex] = lines[lineIndex].replace(emojiPattern, "");
885
+ newContent = lines.join("\n");
886
+ } else if (fix.fixed) {
887
+ lines[lineIndex] = fix.fixed;
888
+ newContent = lines.join("\n");
889
+ } else {
890
+ return false;
891
+ }
892
+ await writeFile(fix.file, newContent);
893
+ return true;
894
+ } catch {
895
+ return false;
896
+ }
897
+ }
898
+
899
+ // src/cli/auto-fix.ts
866
900
  function detectAutoFixes(issues) {
867
901
  const fixes = [];
868
902
  for (const issue of issues) {
@@ -937,11 +971,11 @@ function displayFixPreview(fix, index, total) {
937
971
  async function loadFixContent(fixes) {
938
972
  const enrichedFixes = [];
939
973
  for (const fix of fixes) {
940
- if (!fix.line || !existsSync(fix.file)) {
974
+ if (!fix.line || !existsSync2(fix.file)) {
941
975
  continue;
942
976
  }
943
977
  try {
944
- const content = await readFile(fix.file, "utf-8");
978
+ const content = await readFile2(fix.file, "utf-8");
945
979
  const lines = content.split("\n");
946
980
  const originalLine = lines[fix.line - 1];
947
981
  if (originalLine) {
@@ -1612,7 +1646,7 @@ async function handleQuietCommand() {
1612
1646
  }
1613
1647
 
1614
1648
  // src/cli/ci.ts
1615
- import { writeFileSync, existsSync as existsSync2, mkdirSync } from "fs";
1649
+ import { writeFileSync, existsSync as existsSync3, mkdirSync } from "fs";
1616
1650
  import { join } from "path";
1617
1651
  import pc4 from "picocolors";
1618
1652
  var WORKFLOW_TEMPLATE = `# Trie Security Scan with Memory Persistence
@@ -1754,13 +1788,13 @@ ${pc4.bold("REQUIRED SECRETS:")}
1754
1788
  console.log(pc4.dim("\nRun without --dry-run to create the file."));
1755
1789
  return;
1756
1790
  }
1757
- if (existsSync2(workflowPath)) {
1791
+ if (existsSync3(workflowPath)) {
1758
1792
  console.log(pc4.yellow("Workflow already exists: .github/workflows/trie-scan.yml"));
1759
1793
  console.log(pc4.dim(" Run with --dry-run to preview what would be written."));
1760
1794
  console.log(pc4.dim(" Delete the existing file to regenerate."));
1761
1795
  return;
1762
1796
  }
1763
- if (!existsSync2(workflowsDir)) {
1797
+ if (!existsSync3(workflowsDir)) {
1764
1798
  mkdirSync(workflowsDir, { recursive: true });
1765
1799
  }
1766
1800
  writeFileSync(workflowPath, template);
@@ -2006,21 +2040,21 @@ async function handleLearnCommand(args) {
2006
2040
  }
2007
2041
 
2008
2042
  // src/cli/patterns.ts
2009
- import { readFile as readFile3, writeFile as writeFile2 } from "fs/promises";
2010
- import { existsSync as existsSync4 } from "fs";
2043
+ import { readFile as readFile4, writeFile as writeFile3 } from "fs/promises";
2044
+ import { existsSync as existsSync5 } from "fs";
2011
2045
  import { basename as basename2 } from "path";
2012
2046
  import picocolors3 from "picocolors";
2013
2047
 
2014
2048
  // src/patterns/saved-patterns.ts
2015
2049
  import { createHash } from "crypto";
2016
- import { readFile as readFile2, writeFile } from "fs/promises";
2017
- import { existsSync as existsSync3 } from "fs";
2050
+ import { readFile as readFile3, writeFile as writeFile2 } from "fs/promises";
2051
+ import { existsSync as existsSync4 } from "fs";
2018
2052
  import { join as join2, basename } from "path";
2019
2053
  async function loadSavedPatterns(workDir) {
2020
2054
  const patternsPath = join2(getTrieDirectory(workDir), "saved-patterns.json");
2021
2055
  try {
2022
- if (existsSync3(patternsPath)) {
2023
- const content = await readFile2(patternsPath, "utf-8");
2056
+ if (existsSync4(patternsPath)) {
2057
+ const content = await readFile3(patternsPath, "utf-8");
2024
2058
  return JSON.parse(content);
2025
2059
  }
2026
2060
  } catch {
@@ -2031,7 +2065,7 @@ async function savePatternsToProject(patterns, workDir) {
2031
2065
  const { mkdir } = await import("fs/promises");
2032
2066
  const patternsPath = join2(getTrieDirectory(workDir), "saved-patterns.json");
2033
2067
  await mkdir(getTrieDirectory(workDir), { recursive: true });
2034
- await writeFile(patternsPath, JSON.stringify(patterns, null, 2));
2068
+ await writeFile2(patternsPath, JSON.stringify(patterns, null, 2));
2035
2069
  }
2036
2070
  async function savePatternToProject(pattern, workDir) {
2037
2071
  const patterns = await loadSavedPatterns(workDir);
@@ -2067,7 +2101,7 @@ function detectPatternType(target, workDir) {
2067
2101
  return "detection-rule";
2068
2102
  }
2069
2103
  const fullPath = join2(workDir, target);
2070
- if (existsSync3(fullPath) || target.includes("/") || target.includes("*") || target.endsWith(".ts") || target.endsWith(".js")) {
2104
+ if (existsSync4(fullPath) || target.includes("/") || target.includes("*") || target.endsWith(".ts") || target.endsWith(".js")) {
2071
2105
  return "file-structure";
2072
2106
  }
2073
2107
  return "code-pattern";
@@ -2225,7 +2259,7 @@ async function handleExportPatterns(args, workDir) {
2225
2259
  exportedFrom: basename2(workDir),
2226
2260
  patterns
2227
2261
  };
2228
- await writeFile2(outputPath, JSON.stringify(exportData, null, 2));
2262
+ await writeFile3(outputPath, JSON.stringify(exportData, null, 2));
2229
2263
  console.log(picocolors3.green(`\u2713 Exported ${patterns.length} patterns to ${outputPath}`));
2230
2264
  console.log(picocolors3.dim(` Import to another project with: trie patterns import ${outputPath}`));
2231
2265
  }
@@ -2235,11 +2269,11 @@ async function handleImportPatterns(args, workDir) {
2235
2269
  console.error(picocolors3.red("Usage: trie patterns import <path-to-patterns.json>"));
2236
2270
  process.exit(1);
2237
2271
  }
2238
- if (!existsSync4(inputPath)) {
2272
+ if (!existsSync5(inputPath)) {
2239
2273
  console.error(picocolors3.red(`File not found: ${inputPath}`));
2240
2274
  process.exit(1);
2241
2275
  }
2242
- const content = await readFile3(inputPath, "utf-8");
2276
+ const content = await readFile4(inputPath, "utf-8");
2243
2277
  const importData = JSON.parse(content);
2244
2278
  if (!importData.patterns || !Array.isArray(importData.patterns)) {
2245
2279
  console.error(picocolors3.red("Invalid pattern file format."));