@triedotdev/mcp 1.0.25 → 1.0.27

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.
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  CustomAgent,
3
3
  getAgentRegistry
4
- } from "./chunk-D76HY4QN.js";
4
+ } from "./chunk-3724RQC3.js";
5
+ import {
6
+ ProgressReporter
7
+ } from "./chunk-ARUHDATG.js";
5
8
  import {
6
9
  getWorkingDirectory
7
10
  } from "./chunk-IMFD4SJC.js";
8
- import {
9
- ProgressReporter
10
- } from "./chunk-27F4RHXA.js";
11
11
  import {
12
12
  getVulnerabilityStats,
13
13
  getVulnerabilityTrie,
@@ -23,7 +23,7 @@ import {
23
23
  // src/tools/scan.ts
24
24
  import { readFile as readFile8, readdir as readdir2, writeFile as writeFile3 } from "fs/promises";
25
25
  import { existsSync as existsSync5 } from "fs";
26
- import { basename as basename6, isAbsolute, resolve as resolve2, join as join5, extname as extname3 } from "path";
26
+ import { basename as basename6, isAbsolute, resolve as resolve2, join as join6, extname as extname3 } from "path";
27
27
 
28
28
  // src/orchestrator/context-analyzer.ts
29
29
  import { readFile } from "fs/promises";
@@ -1271,7 +1271,8 @@ var ParallelExecutor = class {
1271
1271
  }
1272
1272
  }
1273
1273
  async executeTaskInWorker(task) {
1274
- const workerUrl = new URL("../workers/agent-worker.js", import.meta.url);
1274
+ const distDir = new URL(".", import.meta.url);
1275
+ const workerUrl = new URL("workers/agent-worker.js", distDir);
1275
1276
  return new Promise((resolve4, reject) => {
1276
1277
  const worker = new Worker(workerUrl, {
1277
1278
  workerData: {
@@ -4582,12 +4583,12 @@ var InteractiveDashboard = class {
4582
4583
  // src/config/loader.ts
4583
4584
  import { readFile as readFile7 } from "fs/promises";
4584
4585
  import { existsSync as existsSync4 } from "fs";
4585
- import { join as join4 } from "path";
4586
+ import { join as join5 } from "path";
4586
4587
 
4587
4588
  // src/config/validation.ts
4588
4589
  import { z } from "zod";
4589
- import { existsSync as existsSync3 } from "fs";
4590
- import { resolve } from "path";
4590
+ import { existsSync as existsSync3, readFileSync } from "fs";
4591
+ import { resolve, join as join4 } from "path";
4591
4592
  var API_KEY_PATTERNS = {
4592
4593
  anthropic: /^sk-ant-api\d{2}-[\w-]{95}$/,
4593
4594
  openai: /^sk-[\w]{48}$/,
@@ -4697,12 +4698,22 @@ var ConfigValidator = class {
4697
4698
  errors.push(`\u{1F6A8} Security risk: API key in client-side environment variable: ${envVar}`);
4698
4699
  }
4699
4700
  }
4700
- const anthropicKey = process.env.ANTHROPIC_API_KEY;
4701
+ let anthropicKey = process.env.ANTHROPIC_API_KEY;
4702
+ if (!anthropicKey) {
4703
+ try {
4704
+ const configPath = join4(getWorkingDirectory(void 0, true), ".trie", "config.json");
4705
+ if (existsSync3(configPath)) {
4706
+ const config = JSON.parse(readFileSync(configPath, "utf-8"));
4707
+ anthropicKey = config.apiKeys?.anthropic;
4708
+ }
4709
+ } catch {
4710
+ }
4711
+ }
4701
4712
  if (anthropicKey && !API_KEY_PATTERNS.anthropic.test(anthropicKey)) {
4702
4713
  errors.push("ANTHROPIC_API_KEY does not match expected format");
4703
4714
  }
4704
- if (!process.env.ANTHROPIC_API_KEY) {
4705
- warnings.push("ANTHROPIC_API_KEY not set - AI features will be disabled");
4715
+ if (!anthropicKey) {
4716
+ warnings.push("ANTHROPIC_API_KEY not set - AI features will be disabled. Set in environment, .trie/config.json, or .env file");
4706
4717
  }
4707
4718
  if (!process.env.GITHUB_TOKEN && process.env.CI) {
4708
4719
  warnings.push("GITHUB_TOKEN not set - GitHub integration disabled");
@@ -4842,8 +4853,26 @@ var ConfigValidator = class {
4842
4853
  const securityIssues = [];
4843
4854
  const optimizations = [];
4844
4855
  let score = 100;
4845
- if (!config.apiKeys?.anthropic && !process.env.ANTHROPIC_API_KEY) {
4846
- suggestions.push("Add ANTHROPIC_API_KEY to enable AI-powered analysis for better issue detection");
4856
+ let hasApiKey = Boolean(config.apiKeys?.anthropic || process.env.ANTHROPIC_API_KEY);
4857
+ if (!hasApiKey) {
4858
+ try {
4859
+ const workDir = getWorkingDirectory(void 0, true);
4860
+ const envFiles = [".env", ".env.local", ".env.production"];
4861
+ for (const envFile of envFiles) {
4862
+ const envPath = join4(workDir, envFile);
4863
+ if (existsSync3(envPath)) {
4864
+ const envContent = readFileSync(envPath, "utf-8");
4865
+ if (envContent.includes("ANTHROPIC_API_KEY=")) {
4866
+ hasApiKey = true;
4867
+ break;
4868
+ }
4869
+ }
4870
+ }
4871
+ } catch {
4872
+ }
4873
+ }
4874
+ if (!hasApiKey) {
4875
+ suggestions.push("Add ANTHROPIC_API_KEY to enable AI-powered analysis for better issue detection. Set in environment, .trie/config.json, or .env file");
4847
4876
  score -= 10;
4848
4877
  }
4849
4878
  if (config.agents?.parallel === false) {
@@ -4908,7 +4937,7 @@ var DEFAULT_CONFIG = {
4908
4937
  // src/config/loader.ts
4909
4938
  async function loadConfig() {
4910
4939
  const validator = new ConfigValidator();
4911
- const configPath = join4(getWorkingDirectory(void 0, true), ".trie", "config.json");
4940
+ const configPath = join5(getWorkingDirectory(void 0, true), ".trie", "config.json");
4912
4941
  try {
4913
4942
  if (!existsSync4(configPath)) {
4914
4943
  return DEFAULT_CONFIG;
@@ -6345,7 +6374,7 @@ ${issue.fix}
6345
6374
  const entries = await readdir2(currentDir, { withFileTypes: true });
6346
6375
  for (const entry of entries) {
6347
6376
  if (files.length >= maxFiles) break;
6348
- const fullPath = join5(currentDir, entry.name);
6377
+ const fullPath = join6(currentDir, entry.name);
6349
6378
  if (entry.isDirectory()) {
6350
6379
  if (!SKIP_DIRS.has(entry.name) && !entry.name.startsWith(".")) {
6351
6380
  await walk(fullPath);
@@ -6370,7 +6399,7 @@ ${issue.fix}
6370
6399
  return files;
6371
6400
  }
6372
6401
  async loadTeamMembers(workDir) {
6373
- const teamConfigPath = join5(workDir, ".trie", "team.json");
6402
+ const teamConfigPath = join6(workDir, ".trie", "team.json");
6374
6403
  if (!existsSync5(teamConfigPath)) {
6375
6404
  return [];
6376
6405
  }
@@ -7664,4 +7693,4 @@ export {
7664
7693
  getSystemPrompt,
7665
7694
  TrieFixTool
7666
7695
  };
7667
- //# sourceMappingURL=chunk-FJH3GQJN.js.map
7696
+ //# sourceMappingURL=chunk-IHJAAT6L.js.map