@triedotdev/mcp 1.0.114 → 1.0.115
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/{autonomy-config-O4H3Z7YV.js → autonomy-config-JXB7WCZ2.js} +2 -2
- package/dist/{chunk-DRDEEF6G.js → chunk-I2GFI3AM.js} +13 -1
- package/dist/chunk-I2GFI3AM.js.map +1 -0
- package/dist/{chunk-4SBZXIMG.js → chunk-ZYKEILVK.js} +364 -520
- package/dist/chunk-ZYKEILVK.js.map +1 -0
- package/dist/cli/main.js +7 -7
- package/dist/cli/yolo-daemon.js +1 -1
- package/dist/{goal-validator-7UPLOVAZ.js → goal-validator-T5HEYBC5.js} +39 -37
- package/dist/goal-validator-T5HEYBC5.js.map +1 -0
- package/dist/index.js +116 -59
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-4SBZXIMG.js.map +0 -1
- package/dist/chunk-DRDEEF6G.js.map +0 -1
- package/dist/goal-validator-7UPLOVAZ.js.map +0 -1
- /package/dist/{autonomy-config-O4H3Z7YV.js.map → autonomy-config-JXB7WCZ2.js.map} +0 -0
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
shouldAutoFix,
|
|
11
11
|
shouldBlockPush,
|
|
12
12
|
trackIssueOccurrence
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-I2GFI3AM.js";
|
|
14
14
|
import "./chunk-R4AAPFXC.js";
|
|
15
15
|
import "./chunk-APMV77PU.js";
|
|
16
16
|
import "./chunk-DGUM43GV.js";
|
|
@@ -27,4 +27,4 @@ export {
|
|
|
27
27
|
shouldBlockPush,
|
|
28
28
|
trackIssueOccurrence
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=autonomy-config-
|
|
30
|
+
//# sourceMappingURL=autonomy-config-JXB7WCZ2.js.map
|
|
@@ -48,6 +48,14 @@ var DEFAULT_AUTONOMY_CONFIG = {
|
|
|
48
48
|
},
|
|
49
49
|
windowMs: 24 * 60 * 60 * 1e3
|
|
50
50
|
// 24 hours
|
|
51
|
+
},
|
|
52
|
+
aiWatcher: {
|
|
53
|
+
enabled: true,
|
|
54
|
+
hourlyTokenLimit: 5e4,
|
|
55
|
+
scanCooldownSec: 30,
|
|
56
|
+
cleanFileCooldownSec: 300,
|
|
57
|
+
maxFilesPerScan: 5,
|
|
58
|
+
maxCharsPerFile: 4e3
|
|
51
59
|
}
|
|
52
60
|
};
|
|
53
61
|
|
|
@@ -110,6 +118,10 @@ function mergeWithDefaults(partial) {
|
|
|
110
118
|
...DEFAULT_AUTONOMY_CONFIG.progressiveEscalation.thresholds,
|
|
111
119
|
...partial.progressiveEscalation?.thresholds || {}
|
|
112
120
|
}
|
|
121
|
+
},
|
|
122
|
+
aiWatcher: {
|
|
123
|
+
...DEFAULT_AUTONOMY_CONFIG.aiWatcher,
|
|
124
|
+
...partial.aiWatcher || {}
|
|
113
125
|
}
|
|
114
126
|
};
|
|
115
127
|
}
|
|
@@ -325,4 +337,4 @@ export {
|
|
|
325
337
|
getAutonomyConfig,
|
|
326
338
|
clearConfigCache
|
|
327
339
|
};
|
|
328
|
-
//# sourceMappingURL=chunk-
|
|
340
|
+
//# sourceMappingURL=chunk-I2GFI3AM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/autonomy-config.ts","../src/types/autonomy.ts"],"sourcesContent":["/**\n * Autonomy Configuration Loader\n * \n * Loads, saves, and manages autonomy settings from .trie/config.json\n */\n\nimport { readFile, writeFile, mkdir } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\nimport { getTrieDirectory } from './workspace.js';\nimport type { \n AutonomyConfig, \n IssueOccurrence,\n AutoFixAction,\n PushBlockResult \n} from '../types/autonomy.js';\nimport { DEFAULT_AUTONOMY_CONFIG } from '../types/autonomy.js';\nimport { createHash } from 'crypto';\n\n// ============================================================================\n// Config Loading/Saving\n// ============================================================================\n\n/**\n * Load autonomy config from .trie/config.json\n */\nexport async function loadAutonomyConfig(projectPath: string): Promise<AutonomyConfig> {\n const configPath = join(getTrieDirectory(projectPath), 'config.json');\n \n try {\n if (!existsSync(configPath)) {\n return { ...DEFAULT_AUTONOMY_CONFIG };\n }\n \n const content = await readFile(configPath, 'utf-8');\n const config = JSON.parse(content);\n \n // Merge with defaults to ensure all fields exist\n return mergeWithDefaults(config.autonomy || {});\n } catch (error) {\n console.error('Failed to load autonomy config:', error);\n return { ...DEFAULT_AUTONOMY_CONFIG };\n }\n}\n\n/**\n * Save autonomy config to .trie/config.json\n */\nexport async function saveAutonomyConfig(\n projectPath: string, \n autonomyConfig: Partial<AutonomyConfig>\n): Promise<void> {\n const configPath = join(getTrieDirectory(projectPath), 'config.json');\n const trieDir = getTrieDirectory(projectPath);\n \n try {\n // Ensure .trie directory exists\n if (!existsSync(trieDir)) {\n await mkdir(trieDir, { recursive: true });\n }\n \n // Load existing config\n let fullConfig: Record<string, unknown> = {};\n if (existsSync(configPath)) {\n const content = await readFile(configPath, 'utf-8');\n fullConfig = JSON.parse(content);\n }\n \n // Merge autonomy config\n fullConfig.autonomy = mergeWithDefaults(autonomyConfig);\n \n // Save atomically\n const tempPath = configPath + '.tmp';\n await writeFile(tempPath, JSON.stringify(fullConfig, null, 2));\n await writeFile(configPath, JSON.stringify(fullConfig, null, 2));\n \n } catch (error) {\n console.error('Failed to save autonomy config:', error);\n throw error;\n }\n}\n\n/**\n * Merge partial config with defaults\n */\nfunction mergeWithDefaults(partial: Partial<AutonomyConfig>): AutonomyConfig {\n return {\n level: partial.level ?? DEFAULT_AUTONOMY_CONFIG.level,\n autoCheck: {\n ...DEFAULT_AUTONOMY_CONFIG.autoCheck,\n ...(partial.autoCheck || {}),\n },\n autoFix: {\n ...DEFAULT_AUTONOMY_CONFIG.autoFix,\n ...(partial.autoFix || {}),\n },\n pushBlocking: {\n ...DEFAULT_AUTONOMY_CONFIG.pushBlocking,\n ...(partial.pushBlocking || {}),\n },\n progressiveEscalation: {\n ...DEFAULT_AUTONOMY_CONFIG.progressiveEscalation,\n ...(partial.progressiveEscalation || {}),\n thresholds: {\n ...DEFAULT_AUTONOMY_CONFIG.progressiveEscalation.thresholds,\n ...(partial.progressiveEscalation?.thresholds || {}),\n },\n },\n aiWatcher: {\n ...DEFAULT_AUTONOMY_CONFIG.aiWatcher,\n ...(partial.aiWatcher || {}),\n },\n };\n}\n\n// ============================================================================\n// Issue Occurrence Tracking (for progressive escalation)\n// ============================================================================\n\nconst occurrenceCache = new Map<string, Map<string, IssueOccurrence>>();\n\n/**\n * Get occurrence tracker for a project\n */\nasync function getOccurrences(projectPath: string): Promise<Map<string, IssueOccurrence>> {\n if (occurrenceCache.has(projectPath)) {\n return occurrenceCache.get(projectPath)!;\n }\n \n const occurrencesPath = join(getTrieDirectory(projectPath), 'memory', 'occurrences.json');\n const occurrences = new Map<string, IssueOccurrence>();\n \n try {\n if (existsSync(occurrencesPath)) {\n const content = await readFile(occurrencesPath, 'utf-8');\n const data = JSON.parse(content);\n for (const [hash, occ] of Object.entries(data)) {\n occurrences.set(hash, occ as IssueOccurrence);\n }\n }\n } catch {\n // Start fresh\n }\n \n occurrenceCache.set(projectPath, occurrences);\n return occurrences;\n}\n\n/**\n * Save occurrences to disk\n */\nasync function saveOccurrences(projectPath: string): Promise<void> {\n const occurrences = occurrenceCache.get(projectPath);\n if (!occurrences) return;\n \n const occurrencesPath = join(getTrieDirectory(projectPath), 'memory', 'occurrences.json');\n const memoryDir = join(getTrieDirectory(projectPath), 'memory');\n \n try {\n if (!existsSync(memoryDir)) {\n await mkdir(memoryDir, { recursive: true });\n }\n \n const data: Record<string, IssueOccurrence> = {};\n for (const [hash, occ] of occurrences.entries()) {\n data[hash] = occ;\n }\n \n await writeFile(occurrencesPath, JSON.stringify(data, null, 2));\n } catch (error) {\n console.error('Failed to save occurrences:', error);\n }\n}\n\n/**\n * Create a hash for an issue (for deduplication)\n */\nexport function createIssueHash(file: string, line: number | undefined, issueType: string): string {\n const input = `${file}:${line || 0}:${issueType}`;\n return createHash('md5').update(input).digest('hex').slice(0, 12);\n}\n\n/**\n * Track an issue occurrence\n */\nexport async function trackIssueOccurrence(\n projectPath: string,\n file: string,\n line: number | undefined,\n issueType: string,\n config: AutonomyConfig\n): Promise<IssueOccurrence> {\n const occurrences = await getOccurrences(projectPath);\n const hash = createIssueHash(file, line, issueType);\n const now = Date.now();\n \n let occurrence = occurrences.get(hash);\n \n if (occurrence) {\n // Check if within time window\n const windowMs = config.progressiveEscalation.windowMs;\n if (now - occurrence.firstSeen > windowMs) {\n // Reset if outside window\n occurrence = {\n hash,\n firstSeen: now,\n lastSeen: now,\n count: 1,\n escalationLevel: 'suggest',\n notified: false,\n bypassed: false,\n bypassHistory: occurrence.bypassHistory, // Keep bypass history\n };\n } else {\n // Increment within window\n occurrence.lastSeen = now;\n occurrence.count++;\n \n // Update escalation level\n const thresholds = config.progressiveEscalation.thresholds;\n if (occurrence.count >= thresholds.block) {\n occurrence.escalationLevel = 'block';\n } else if (occurrence.count >= thresholds.escalate) {\n occurrence.escalationLevel = 'escalate';\n } else if (occurrence.count >= thresholds.autoCheck) {\n occurrence.escalationLevel = 'autoCheck';\n }\n }\n } else {\n // New occurrence\n occurrence = {\n hash,\n firstSeen: now,\n lastSeen: now,\n count: 1,\n escalationLevel: 'suggest',\n notified: false,\n bypassed: false,\n bypassHistory: [],\n };\n }\n \n occurrences.set(hash, occurrence);\n await saveOccurrences(projectPath);\n \n return occurrence;\n}\n\n/**\n * Get escalation level for an issue\n */\nexport async function getEscalationLevel(\n projectPath: string,\n file: string,\n line: number | undefined,\n issueType: string\n): Promise<IssueOccurrence['escalationLevel']> {\n const occurrences = await getOccurrences(projectPath);\n const hash = createIssueHash(file, line, issueType);\n \n const occurrence = occurrences.get(hash);\n return occurrence?.escalationLevel ?? 'suggest';\n}\n\n/**\n * Record a bypass\n */\nexport async function recordBypass(\n projectPath: string,\n file: string,\n line: number | undefined,\n issueType: string,\n method: string,\n reason?: string\n): Promise<void> {\n const occurrences = await getOccurrences(projectPath);\n const hash = createIssueHash(file, line, issueType);\n \n const occurrence = occurrences.get(hash);\n if (occurrence) {\n occurrence.bypassed = true;\n occurrence.bypassHistory.push({\n timestamp: Date.now(),\n method,\n ...(reason !== undefined ? { reason } : {}),\n });\n await saveOccurrences(projectPath);\n }\n}\n\n// ============================================================================\n// Auto-fix Helpers\n// ============================================================================\n\n/**\n * Check if a fix should be auto-applied based on config\n */\nexport function shouldAutoFix(\n fix: AutoFixAction,\n config: AutonomyConfig\n): boolean {\n if (!config.autoFix.enabled) {\n return false;\n }\n \n // Check if category is allowed\n const allowedCategories = config.autoFix.categories as string[];\n if (!allowedCategories.includes(fix.category) && \n !allowedCategories.includes('all')) {\n return false;\n }\n \n // Check if specific fix type is allowed\n if (config.autoFix.allowedFixTypes.length > 0 &&\n !config.autoFix.allowedFixTypes.includes(fix.type)) {\n return false;\n }\n \n // Check confidence threshold (require high confidence for auto-fix)\n if (fix.confidence < 0.9) {\n return false;\n }\n \n return true;\n}\n\n/**\n * Group fixes by file for batch application\n */\nexport function groupFixesByFile(fixes: AutoFixAction[]): Map<string, AutoFixAction[]> {\n const grouped = new Map<string, AutoFixAction[]>();\n \n for (const fix of fixes) {\n const existing = grouped.get(fix.file) || [];\n existing.push(fix);\n grouped.set(fix.file, existing);\n }\n \n return grouped;\n}\n\n// ============================================================================\n// Push Blocking Helpers\n// ============================================================================\n\n/**\n * Check if push should be blocked\n */\nexport function shouldBlockPush(\n issues: Array<{ severity: string; file: string; line?: number; issue: string }>,\n config: AutonomyConfig\n): PushBlockResult {\n if (!config.pushBlocking.enabled) {\n return {\n blocked: false,\n blockingIssues: [],\n bypassed: false,\n };\n }\n \n // Find blocking issues\n const blockingIssues = issues.filter(issue => \n config.pushBlocking.blockOn.includes(issue.severity as 'critical' | 'serious' | 'moderate')\n );\n \n if (blockingIssues.length === 0) {\n return {\n blocked: false,\n blockingIssues: [],\n bypassed: false,\n };\n }\n \n // Check for bypass\n const envBypass = process.env.TRIE_BYPASS === '1' || process.env.TRIE_BYPASS === 'true';\n \n if (envBypass && config.pushBlocking.allowBypass) {\n return {\n blocked: false,\n blockingIssues,\n bypassed: true,\n bypassMethod: 'env',\n };\n }\n \n // Build bypass instructions\n const bypassInstructions = buildBypassInstructions(config);\n \n return {\n blocked: true,\n reason: `${blockingIssues.length} ${blockingIssues[0]?.severity || 'critical'} issue(s) must be fixed before pushing`,\n blockingIssues,\n bypassInstructions,\n bypassed: false,\n };\n}\n\n/**\n * Build bypass instructions based on config\n */\nfunction buildBypassInstructions(config: AutonomyConfig): string {\n const instructions: string[] = [];\n \n if (config.pushBlocking.bypassMethods.includes('env')) {\n instructions.push('• Set TRIE_BYPASS=1 to bypass: TRIE_BYPASS=1 git push');\n }\n \n if (config.pushBlocking.bypassMethods.includes('flag')) {\n instructions.push('• Use --no-verify flag: git push --no-verify');\n }\n \n if (config.pushBlocking.bypassMethods.includes('confirm')) {\n instructions.push('• Run: trie bypass --confirm to bypass this push');\n }\n \n return instructions.join('\\n');\n}\n\n// ============================================================================\n// Singleton Config Cache\n// ============================================================================\n\nconst configCache = new Map<string, { config: AutonomyConfig; loadedAt: number }>();\nconst CACHE_TTL = 60000; // 1 minute\n\n/**\n * Get autonomy config with caching\n */\nexport async function getAutonomyConfig(projectPath: string): Promise<AutonomyConfig> {\n const cached = configCache.get(projectPath);\n \n if (cached && Date.now() - cached.loadedAt < CACHE_TTL) {\n return cached.config;\n }\n \n const config = await loadAutonomyConfig(projectPath);\n configCache.set(projectPath, { config, loadedAt: Date.now() });\n \n return config;\n}\n\n/**\n * Clear config cache (for testing or after config changes)\n */\nexport function clearConfigCache(): void {\n configCache.clear();\n occurrenceCache.clear();\n}\n","/**\n * Autonomy Configuration Types\n * \n * Controls how autonomous Trie behaves:\n * - Auto-check: Run full checks when issues detected\n * - Auto-fix: Apply fixes with human confirmation\n * - Push blocking: Block git push on critical issues\n * - Progressive escalation: Escalate based on occurrence count\n */\n\n/**\n * Overall autonomy level\n */\nexport type AutonomyLevel = \n | 'passive' // Only report, never act\n | 'suggest' // Suggest actions, don't execute\n | 'proactive' // Auto-check, ask before fixing\n | 'aggressive'; // Auto-check, auto-fix trivial, block on critical\n\n/**\n * Auto-check configuration\n */\nexport interface AutoCheckConfig {\n /** Enable auto-running full checks */\n enabled: boolean;\n /** Issue count threshold to trigger auto-check */\n threshold: number;\n /** Always trigger on critical issues */\n onCritical: boolean;\n /** Cooldown between auto-checks (ms) */\n cooldownMs: number;\n}\n\n/**\n * Auto-fix configuration\n */\nexport interface AutoFixConfig {\n /** Enable auto-fix suggestions */\n enabled: boolean;\n /** Always ask user before applying fixes (human-in-the-loop) */\n askFirst: boolean;\n /** Categories of fixes to auto-apply */\n categories: ('trivial' | 'safe' | 'moderate' | 'all')[];\n /** Specific fix types to auto-apply */\n allowedFixTypes: string[];\n}\n\n/**\n * Push blocking configuration\n */\nexport interface PushBlockingConfig {\n /** Enable push blocking */\n enabled: boolean;\n /** Allow user to bypass with flag */\n allowBypass: boolean;\n /** Severities that trigger blocking */\n blockOn: ('critical' | 'serious' | 'moderate')[];\n /** Bypass methods */\n bypassMethods: ('env' | 'flag' | 'confirm')[];\n /** Log bypasses for audit */\n logBypasses: boolean;\n}\n\n/**\n * Progressive escalation thresholds\n */\nexport interface ProgressiveEscalationConfig {\n /** Enable progressive escalation */\n enabled: boolean;\n /** Thresholds for different actions */\n thresholds: {\n /** First occurrence: suggest fix */\n suggest: number;\n /** N occurrences: auto-run full check */\n autoCheck: number;\n /** N occurrences: escalate to Slack/email */\n escalate: number;\n /** N occurrences: block until fixed */\n block: number;\n };\n /** Time window for counting occurrences (ms) */\n windowMs: number;\n}\n\n/**\n * AI Watcher configuration -- controls the Claude-powered file watcher\n */\nexport interface AIWatcherConfig {\n /** Enable AI-powered file watching */\n enabled: boolean;\n /** Max tokens to spend per hour on AI scans */\n hourlyTokenLimit: number;\n /** Minimum seconds between AI scans */\n scanCooldownSec: number;\n /** Seconds before re-scanning a file that was clean */\n cleanFileCooldownSec: number;\n /** Max files to include in a single AI scan */\n maxFilesPerScan: number;\n /** Max characters to send per file */\n maxCharsPerFile: number;\n}\n\n/**\n * Full autonomy configuration\n */\nexport interface AutonomyConfig {\n /** Overall autonomy level (can be overridden by specific settings) */\n level: AutonomyLevel;\n /** Auto-check settings */\n autoCheck: AutoCheckConfig;\n /** Auto-fix settings */\n autoFix: AutoFixConfig;\n /** Push blocking settings */\n pushBlocking: PushBlockingConfig;\n /** Progressive escalation settings */\n progressiveEscalation: ProgressiveEscalationConfig;\n /** AI watcher settings (Claude-powered file scanning) */\n aiWatcher: AIWatcherConfig;\n}\n\n/**\n * Default autonomy configuration - proactive but safe\n */\nexport const DEFAULT_AUTONOMY_CONFIG: AutonomyConfig = {\n level: 'proactive',\n autoCheck: {\n enabled: true,\n threshold: 5,\n onCritical: true,\n cooldownMs: 30000, // 30 seconds\n },\n autoFix: {\n enabled: true,\n askFirst: true, // Always ask (human-in-the-loop)\n categories: ['trivial', 'safe'],\n allowedFixTypes: [\n 'remove-console-log',\n 'remove-debugger',\n 'remove-emoji',\n 'remove-unused-import',\n 'add-missing-await',\n 'fix-typo',\n ],\n },\n pushBlocking: {\n enabled: true,\n allowBypass: true,\n blockOn: ['critical'],\n bypassMethods: ['env', 'flag', 'confirm'],\n logBypasses: true,\n },\n progressiveEscalation: {\n enabled: true,\n thresholds: {\n suggest: 1,\n autoCheck: 3,\n escalate: 5,\n block: 10,\n },\n windowMs: 24 * 60 * 60 * 1000, // 24 hours\n },\n aiWatcher: {\n enabled: true,\n hourlyTokenLimit: 50_000,\n scanCooldownSec: 30,\n cleanFileCooldownSec: 300,\n maxFilesPerScan: 5,\n maxCharsPerFile: 4000,\n },\n};\n\n/**\n * Issue occurrence tracking for progressive escalation\n */\nexport interface IssueOccurrence {\n /** Issue hash (file + line + type) */\n hash: string;\n /** First seen timestamp */\n firstSeen: number;\n /** Last seen timestamp */\n lastSeen: number;\n /** Total occurrence count */\n count: number;\n /** Current escalation level */\n escalationLevel: 'suggest' | 'autoCheck' | 'escalate' | 'block';\n /** Whether user has been notified at current level */\n notified: boolean;\n /** Whether issue has been bypassed */\n bypassed: boolean;\n /** Bypass history */\n bypassHistory: Array<{\n timestamp: number;\n method: string;\n reason?: string;\n }>;\n}\n\n/**\n * Auto-fix action\n */\nexport interface AutoFixAction {\n /** Unique ID for this fix */\n id: string;\n /** File to fix */\n file: string;\n /** Line number */\n line?: number;\n /** Original code */\n original: string;\n /** Fixed code */\n fixed: string;\n /** Type of fix */\n type: 'remove-console-log' | 'remove-debugger' | 'remove-emoji' | 'remove-unused-import' | \n 'add-missing-await' | 'fix-typo' | 'goal-violation' | 'custom' | string;\n /** Category of fix */\n category: 'trivial' | 'safe' | 'moderate' | 'risky' | 'goal-violation';\n /** Description of what the fix does */\n description: string;\n /** Confidence in the fix (0-1) */\n confidence: number;\n}\n\n/**\n * Push block result\n */\nexport interface PushBlockResult {\n /** Whether push is blocked */\n blocked: boolean;\n /** Reason for blocking */\n reason?: string;\n /** Issues causing the block */\n blockingIssues: Array<{\n file: string;\n line?: number;\n severity: string;\n issue: string;\n }>;\n /** Bypass instructions */\n bypassInstructions?: string;\n /** Whether user chose to bypass */\n bypassed: boolean;\n /** Bypass method used */\n bypassMethod?: string;\n}\n"],"mappings":";;;;;AAMA,SAAS,UAAU,WAAW,aAAa;AAC3C,SAAS,kBAAkB;AAC3B,SAAS,YAAY;;;ACmHd,IAAM,0BAA0C;AAAA,EACrD,OAAO;AAAA,EACP,WAAW;AAAA,IACT,SAAS;AAAA,IACT,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,YAAY;AAAA;AAAA,EACd;AAAA,EACA,SAAS;AAAA,IACP,SAAS;AAAA,IACT,UAAU;AAAA;AAAA,IACV,YAAY,CAAC,WAAW,MAAM;AAAA,IAC9B,iBAAiB;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,c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