@triedotdev/mcp 1.0.138 → 1.0.140
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 +184 -38
- package/dist/{autonomy-config-TZ6HF4FA.js → autonomy-config-ZCOSTMPD.js} +2 -2
- package/dist/{chunk-X3F5QDER.js → chunk-4O2KRHK4.js} +934 -132
- package/dist/chunk-4O2KRHK4.js.map +1 -0
- package/dist/{chunk-J5EMP4XW.js → chunk-5KJ4UJOY.js} +9 -4
- package/dist/chunk-5KJ4UJOY.js.map +1 -0
- package/dist/chunk-62POBLFC.js +1925 -0
- package/dist/chunk-62POBLFC.js.map +1 -0
- package/dist/{chunk-GFFUDJMK.js → chunk-75ADWWUF.js} +13 -13
- package/dist/chunk-75ADWWUF.js.map +1 -0
- package/dist/{chunk-D3AS5LY7.js → chunk-7OJ6JIPL.js} +39 -604
- package/dist/chunk-7OJ6JIPL.js.map +1 -0
- package/dist/{chunk-3RRXWX3V.js → chunk-AF2APASP.js} +38 -4
- package/dist/{chunk-3RRXWX3V.js.map → chunk-AF2APASP.js.map} +1 -1
- package/dist/{chunk-QSWUPSLK.js → chunk-FH335WL5.js} +9 -1
- package/dist/chunk-FH335WL5.js.map +1 -0
- package/dist/{chunk-Y32FM3MR.js → chunk-FPEMP54L.js} +21 -15
- package/dist/chunk-FPEMP54L.js.map +1 -0
- package/dist/{chunk-EDDT4ZIH.js → chunk-GXF6JOCN.js} +21 -323
- package/dist/chunk-GXF6JOCN.js.map +1 -0
- package/dist/chunk-LD7ZEFNY.js +132 -0
- package/dist/chunk-LD7ZEFNY.js.map +1 -0
- package/dist/chunk-NKHO34UZ.js +467 -0
- package/dist/chunk-NKHO34UZ.js.map +1 -0
- package/dist/{chunk-YOKQ25IW.js → chunk-OQ4A3RDY.js} +14 -14
- package/dist/{chunk-6LLH3TBZ.js → chunk-UOSTOLU7.js} +12 -12
- package/dist/{chunk-67GSG2ST.js → chunk-XTTZAQWJ.js} +18 -15
- package/dist/chunk-XTTZAQWJ.js.map +1 -0
- package/dist/{chunk-FOCXXIXY.js → chunk-YEIJW6X6.js} +2 -2
- package/dist/chunk-YOJGSRZK.js +216 -0
- package/dist/chunk-YOJGSRZK.js.map +1 -0
- package/dist/cli/main.js +573 -59
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/yolo-daemon.js +15 -13
- package/dist/cli/yolo-daemon.js.map +1 -1
- package/dist/{client-JTU5TRLB.js → client-INNE2GGZ.js} +2 -2
- package/dist/{codebase-index-FNJ4GCBE.js → codebase-index-5SEOESWM.js} +3 -3
- package/dist/fast-analyzer-AYLZB5TW.js +216 -0
- package/dist/fast-analyzer-AYLZB5TW.js.map +1 -0
- package/dist/github-ingester-J2ZFYXVE.js +11 -0
- package/dist/{goal-manager-6BJQ36AH.js → goal-manager-ZBWKWEML.js} +3 -3
- package/dist/{goal-validator-GISXYANK.js → goal-validator-HNXXUCPW.js} +3 -3
- package/dist/{graph-X2FMRQLG.js → graph-J4OGTYCO.js} +2 -2
- package/dist/{hypothesis-K3KQJOXJ.js → hypothesis-JCUMZKTG.js} +3 -3
- package/dist/index.js +1090 -108
- package/dist/index.js.map +1 -1
- package/dist/{issue-store-BO5OWLJW.js → issue-store-LZWZIGM7.js} +2 -2
- package/dist/linear-ingester-JRDQAIAA.js +11 -0
- package/dist/linear-ingester-JRDQAIAA.js.map +1 -0
- package/dist/{trie-agent-XMSGMD7E.js → trie-agent-M6PHM6UD.js} +10 -10
- package/dist/trie-agent-M6PHM6UD.js.map +1 -0
- package/package.json +15 -8
- package/dist/chunk-67GSG2ST.js.map +0 -1
- package/dist/chunk-D3AS5LY7.js.map +0 -1
- package/dist/chunk-EDDT4ZIH.js.map +0 -1
- package/dist/chunk-GFFUDJMK.js.map +0 -1
- package/dist/chunk-J5EMP4XW.js.map +0 -1
- package/dist/chunk-QSWUPSLK.js.map +0 -1
- package/dist/chunk-X3F5QDER.js.map +0 -1
- package/dist/chunk-Y32FM3MR.js.map +0 -1
- package/dist/chunk-Z2P4WST6.js +0 -883
- package/dist/chunk-Z2P4WST6.js.map +0 -1
- /package/dist/{autonomy-config-TZ6HF4FA.js.map → autonomy-config-ZCOSTMPD.js.map} +0 -0
- /package/dist/{chunk-YOKQ25IW.js.map → chunk-OQ4A3RDY.js.map} +0 -0
- /package/dist/{chunk-6LLH3TBZ.js.map → chunk-UOSTOLU7.js.map} +0 -0
- /package/dist/{chunk-FOCXXIXY.js.map → chunk-YEIJW6X6.js.map} +0 -0
- /package/dist/{client-JTU5TRLB.js.map → client-INNE2GGZ.js.map} +0 -0
- /package/dist/{codebase-index-FNJ4GCBE.js.map → codebase-index-5SEOESWM.js.map} +0 -0
- /package/dist/{goal-manager-6BJQ36AH.js.map → github-ingester-J2ZFYXVE.js.map} +0 -0
- /package/dist/{goal-validator-GISXYANK.js.map → goal-manager-ZBWKWEML.js.map} +0 -0
- /package/dist/{graph-X2FMRQLG.js.map → goal-validator-HNXXUCPW.js.map} +0 -0
- /package/dist/{hypothesis-K3KQJOXJ.js.map → graph-J4OGTYCO.js.map} +0 -0
- /package/dist/{issue-store-BO5OWLJW.js.map → hypothesis-JCUMZKTG.js.map} +0 -0
- /package/dist/{trie-agent-XMSGMD7E.js.map → issue-store-LZWZIGM7.js.map} +0 -0
package/dist/cli/yolo-daemon.js
CHANGED
|
@@ -3,33 +3,35 @@ import {
|
|
|
3
3
|
InteractiveDashboard,
|
|
4
4
|
StreamingManager,
|
|
5
5
|
TrieScanTool
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-YOKQ25IW.js";
|
|
6
|
+
} from "../chunk-4O2KRHK4.js";
|
|
8
7
|
import "../chunk-23RJT5WT.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-OQ4A3RDY.js";
|
|
9
|
+
import "../chunk-YEIJW6X6.js";
|
|
10
|
+
import "../chunk-XTTZAQWJ.js";
|
|
11
11
|
import "../chunk-3MUCUZ46.js";
|
|
12
12
|
import {
|
|
13
13
|
isTrieInitialized
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-GXF6JOCN.js";
|
|
15
|
+
import "../chunk-NKHO34UZ.js";
|
|
15
16
|
import "../chunk-4C67GV3O.js";
|
|
16
17
|
import "../chunk-ZV2K6M7T.js";
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-UOSTOLU7.js";
|
|
19
|
+
import "../chunk-FH335WL5.js";
|
|
20
|
+
import "../chunk-75ADWWUF.js";
|
|
21
|
+
import "../chunk-FPEMP54L.js";
|
|
20
22
|
import "../chunk-LT6VUZG2.js";
|
|
23
|
+
import "../chunk-62POBLFC.js";
|
|
24
|
+
import "../chunk-4MJ52WBH.js";
|
|
25
|
+
import "../chunk-43X6JBEM.js";
|
|
21
26
|
import "../chunk-F4NJ4CBP.js";
|
|
22
27
|
import "../chunk-IXO4G4D3.js";
|
|
23
28
|
import "../chunk-6NLHFIYA.js";
|
|
24
29
|
import "../chunk-FG467PDD.js";
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-TIMIKBY2.js";
|
|
27
|
-
import "../chunk-Z2P4WST6.js";
|
|
28
|
-
import "../chunk-4MJ52WBH.js";
|
|
29
|
-
import "../chunk-43X6JBEM.js";
|
|
30
|
+
import "../chunk-5KJ4UJOY.js";
|
|
30
31
|
import {
|
|
31
32
|
getWorkingDirectory
|
|
32
33
|
} from "../chunk-SH7H3WRU.js";
|
|
34
|
+
import "../chunk-TIMIKBY2.js";
|
|
33
35
|
import {
|
|
34
36
|
isInteractiveMode,
|
|
35
37
|
setInteractiveMode
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/yolo-daemon.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Trie Watch - File Watcher & Scanner\n * \n * Watches a directory and reports issues as they occur.\n * Also handles one-shot scanning via --once flag.\n * \n * Usage:\n * trie watch [options] # Watch for changes\n * trie scan [options] # Scan once and exit\n * \n * See `trie watch --help` for all options.\n */\n\nimport { watch, existsSync, statSync, readFileSync } from 'fs';\nimport { readdir } from 'fs/promises';\nimport { join, extname, basename, resolve } from 'path';\nimport { TrieScanTool } from '../tools/scan.js';\nimport { StreamingManager } from '../utils/streaming.js';\nimport { InteractiveDashboard } from './interactive-dashboard.js';\nimport { getWorkingDirectory } from '../utils/workspace.js';\nimport { isInteractiveMode, setInteractiveMode } from '../utils/progress.js';\nimport { isTrieInitialized } from '../utils/trie-init.js';\n\n// File extensions to watch\nconst WATCH_EXTENSIONS = new Set([\n '.ts', '.tsx', '.js', '.jsx', '.mjs',\n '.vue', '.svelte', '.astro',\n '.py', '.go', '.rs'\n]);\n\n// Directories to skip\nconst SKIP_DIRS = new Set([\n 'node_modules', '.git', 'dist', 'build', '.next', '.nuxt',\n 'coverage', '.turbo', '.cache', '__pycache__', '.venv'\n]);\n\ninterface DaemonConfig {\n directory: string;\n debounceMs: number;\n jsonOutput: boolean;\n runOnce: boolean;\n format?: 'text' | 'json';\n output?: string;\n parallel?: boolean;\n cache?: boolean;\n maxConcurrency?: number;\n streaming?: boolean;\n interactive?: boolean;\n workers?: boolean;\n timeoutMs?: number;\n files?: string[];\n /** Comma-separated list of scouts to run (e.g., \"security,legal\") */\n forceScouts?: string[];\n /** User count for cost estimation (default: 250) */\n userCount?: number;\n}\n\ninterface DaemonStats {\n filesScanned: number;\n issuesFound: number;\n errors: number;\n startTime: number;\n}\n\nclass WatchDaemon {\n private config: DaemonConfig;\n private stats: DaemonStats;\n private scanTool = new TrieScanTool();\n private watchers: Map<string, ReturnType<typeof watch>> = new Map();\n private pendingFiles: Set<string> = new Set();\n private debounceTimer: NodeJS.Timeout | null = null;\n private isProcessing = false;\n private streamingManager: StreamingManager | undefined = undefined;\n private dashboard: InteractiveDashboard | undefined = undefined;\n\n constructor(config: DaemonConfig) {\n this.config = config;\n this.stats = {\n filesScanned: 0,\n issuesFound: 0,\n errors: 0,\n startTime: Date.now()\n };\n }\n\n /**\n * Start the daemon\n */\n async start(): Promise<void> {\n // Enable global interactive mode when TTY and not explicitly disabled\n if (this.config.interactive !== false && process.stdout.isTTY) {\n setInteractiveMode(true);\n }\n if (!isTrieInitialized(this.config.directory)) {\n if (!isInteractiveMode()) {\n console.error('Trie is not initialized for this project.');\n console.error('Run `trie init` first.');\n }\n process.exit(1);\n }\n\n this.log('info', 'Starting Trie Agent', {\n directory: this.config.directory,\n debounceMs: this.config.debounceMs\n });\n if (!isInteractiveMode()) {\n console.error('\\nYour Trie agent is watching over your codebase.\\n');\n }\n\n // Validate directory\n if (!existsSync(this.config.directory)) {\n this.log('error', 'Directory not found', { directory: this.config.directory });\n process.exit(1);\n }\n\n // Start interactive dashboard if enabled\n if (isInteractiveMode()) {\n this.streamingManager = new StreamingManager();\n this.dashboard = new InteractiveDashboard();\n this.streamingManager.subscribe(update => this.dashboard?.handleStreamUpdate(update));\n await this.dashboard.start();\n this.streamingManager.reportWatchStatus({\n watching: !this.config.runOnce,\n directories: 0,\n debounceMs: this.config.debounceMs\n });\n }\n\n // Run initial scan\n this.log('info', 'Running initial scan...');\n await this.runScan(this.config.files);\n\n // If run-once mode, exit after initial scan\n if (this.config.runOnce) {\n this.log('info', 'Run-once mode: exiting after initial scan', { ...this.stats });\n process.exit(this.stats.issuesFound > 0 ? 1 : 0);\n }\n\n // Start watching\n await this.watchDirectory(this.config.directory);\n this.streamingManager?.reportWatchStatus({\n watching: true,\n directories: this.watchers.size,\n debounceMs: this.config.debounceMs\n });\n this.log('info', 'Watching for changes...', { \n directories: this.watchers.size \n });\n\n // Handle graceful shutdown\n process.on('SIGINT', () => this.shutdown('SIGINT'));\n process.on('SIGTERM', () => this.shutdown('SIGTERM'));\n }\n\n /**\n * Run a scan on all files or specific files\n */\n private async runScan(files?: string[]): Promise<void> {\n try {\n const scanArgs: Record<string, unknown> = files\n ? { files }\n : { directory: this.config.directory };\n\n if (this.config.format) scanArgs.format = this.config.format;\n if (this.config.output) scanArgs.output = this.config.output;\n if (this.config.parallel !== undefined) scanArgs.parallel = this.config.parallel;\n if (this.config.cache !== undefined) scanArgs.cache = this.config.cache;\n if (this.config.maxConcurrency) scanArgs.maxConcurrency = this.config.maxConcurrency;\n if (this.config.streaming !== undefined) scanArgs.streaming = this.config.streaming;\n if (this.config.interactive !== undefined) scanArgs.interactive = this.config.interactive;\n if (this.config.workers !== undefined) scanArgs.workers = this.config.workers;\n if (this.config.timeoutMs) scanArgs.timeoutMs = this.config.timeoutMs;\n if (this.config.forceScouts) scanArgs.forceAgents = this.config.forceScouts;\n if (this.dashboard && typeof this.dashboard.getAgentConfig === 'function') {\n const agentConfig = this.dashboard.getAgentConfig();\n scanArgs.parallel = agentConfig.performance.parallel;\n scanArgs.cache = agentConfig.performance.cache;\n scanArgs.maxConcurrency = agentConfig.performance.maxConcurrency;\n scanArgs.timeoutMs = agentConfig.performance.timeoutMs;\n scanArgs.workers = agentConfig.performance.workers;\n scanArgs.streaming = agentConfig.performance.streaming;\n }\n\n if (this.streamingManager) scanArgs.streamingManager = this.streamingManager;\n if (this.dashboard) scanArgs.dashboard = this.dashboard;\n\n const result = await this.scanTool.execute(scanArgs);\n const resultText = result.content?.[0]?.text || '';\n\n // PRINT THE FULL REPORT TO STDOUT (for terminal/chat display)\n if (resultText && this.config.runOnce && !isInteractiveMode()) {\n console.log(resultText);\n }\n\n // Parse results - try multiple patterns to extract issue count\n let issueCount = 0;\n if (this.config.format === 'json' && this.config.output && existsSync(this.config.output)) {\n try {\n const report = JSON.parse(readFileSync(this.config.output, 'utf-8'));\n issueCount = report?.results?.totalIssues ?? 0;\n } catch {\n issueCount = 0;\n }\n } else {\n // Try multiple patterns to catch issue counts\n const patterns = [\n /(\\d+)\\s+actionable\\s+issues?\\s+found/i, // \"30 actionable issues found\"\n /(\\d+)\\s+Issues?\\s+Found/i, // \"30 Issues Found\"\n /Found\\s+(\\d+)\\s+issues?/i, // \"Found 30 issues\"\n /\\[COMPLETE\\]\\s+(\\d+)\\s+issues?/i, // \"[COMPLETE] 30 issues\"\n /(\\d+)\\s+total/i, // \"30 total\" (fallback)\n ];\n \n for (const pattern of patterns) {\n const match = resultText.match(pattern);\n if (match && match[1]) {\n issueCount = parseInt(match[1], 10);\n break;\n }\n }\n }\n\n this.stats.filesScanned += files?.length || 1;\n this.stats.issuesFound += issueCount;\n\n // Don't log \"No issues found\" after a full scan that displayed a report\n // The report already shows the issue count prominently\n if (issueCount > 0) {\n // Parse severity breakdown for additional logging\n const criticalMatch = resultText.match(/(\\d+)\\s+critical/i);\n const seriousMatch = resultText.match(/(\\d+)\\s+serious|(\\d+)\\s+important/i);\n\n if (criticalMatch && criticalMatch[1] && parseInt(criticalMatch[1], 10) > 0) {\n this.log('error', 'Critical issues detected', { count: parseInt(criticalMatch[1], 10) });\n }\n if (seriousMatch && (seriousMatch[1] || seriousMatch[2])) {\n const count = parseInt(seriousMatch[1] || seriousMatch[2] || '0', 10);\n if (count > 0) {\n this.log('warn', 'Serious issues detected', { count });\n }\n }\n }\n // NOTE: Removed the \"No issues found\" log because it was confusing\n // when printed after a full scan report that already shows issue counts\n } catch (error) {\n this.stats.errors++;\n this.log('error', 'Scan failed', { \n error: error instanceof Error ? error.message : String(error) \n });\n }\n }\n\n /**\n * Watch a directory recursively\n */\n private async watchDirectory(dir: string): Promise<void> {\n if (!existsSync(dir)) return;\n\n try {\n const stat = statSync(dir);\n if (!stat.isDirectory()) return;\n\n const dirName = basename(dir);\n if (SKIP_DIRS.has(dirName) || dirName.startsWith('.')) return;\n\n // Watch this directory\n const watcher = watch(dir, { persistent: true }, (_eventType, filename) => {\n if (!filename) return;\n\n const fullPath = join(dir, filename);\n const ext = extname(filename).toLowerCase();\n\n if (!WATCH_EXTENSIONS.has(ext)) return;\n if (!existsSync(fullPath)) return;\n\n this.pendingFiles.add(fullPath);\n this.streamingManager?.reportWatchChange(fullPath);\n this.scheduleProcessing();\n });\n\n this.watchers.set(dir, watcher);\n\n // Recursively watch subdirectories\n const entries = await readdir(dir, { withFileTypes: true });\n for (const entry of entries) {\n if (entry.isDirectory()) {\n await this.watchDirectory(join(dir, entry.name));\n }\n }\n } catch (error) {\n // Skip inaccessible directories\n }\n }\n\n /**\n * Schedule processing of pending files (debounced)\n */\n private scheduleProcessing(): void {\n if (this.debounceTimer) {\n clearTimeout(this.debounceTimer);\n }\n\n this.debounceTimer = setTimeout(() => {\n this.processPendingFiles();\n }, this.config.debounceMs);\n }\n\n /**\n * Process all pending files\n */\n private async processPendingFiles(): Promise<void> {\n if (this.isProcessing || this.pendingFiles.size === 0) return;\n\n this.isProcessing = true;\n const files = Array.from(this.pendingFiles);\n this.pendingFiles.clear();\n\n this.log('info', 'Processing changed files', { \n count: files.length,\n files: files.map(f => basename(f))\n });\n\n await this.runScan(files);\n this.isProcessing = false;\n }\n\n\n /**\n * Log a message\n */\n private log(level: 'info' | 'warn' | 'error', message: string, data?: Record<string, unknown>): void {\n const timestamp = new Date().toISOString();\n const uptime = Math.round((Date.now() - this.stats.startTime) / 1000);\n\n // Suppress human-readable logs when interactive dashboard is active\n if (!this.config.jsonOutput && isInteractiveMode()) {\n return;\n }\n\n if (this.config.jsonOutput) {\n console.log(JSON.stringify({\n timestamp,\n level,\n message,\n uptime,\n ...data,\n stats: this.stats\n }));\n } else {\n const levelEmoji = { info: '[i]', warn: '[!]', error: '[X]' }[level];\n const dataStr = data ? ` ${JSON.stringify(data)}` : '';\n console.log(`[${timestamp}] ${levelEmoji} ${message}${dataStr}`);\n }\n }\n\n /**\n * Graceful shutdown\n */\n private shutdown(signal: string): void {\n this.log('info', 'Shutting down', { signal, stats: this.stats });\n\n // Close all watchers\n for (const watcher of this.watchers.values()) {\n watcher.close();\n }\n\n // Clear timers\n if (this.debounceTimer) {\n clearTimeout(this.debounceTimer);\n }\n\n if (this.streamingManager) {\n this.streamingManager.reportWatchStatus({\n watching: false,\n directories: 0\n });\n }\n if (this.dashboard) {\n this.dashboard.stop();\n }\n\n process.exit(0);\n }\n}\n\n/**\n * Parse command line arguments\n */\nfunction parseArgs(): DaemonConfig {\n const args = process.argv.slice(2);\n const config: DaemonConfig = {\n // Silent mode for initial workspace detection (TUI will handle display)\n directory: getWorkingDirectory(undefined, true),\n debounceMs: 1000,\n jsonOutput: false,\n runOnce: false,\n // Default to interactive mode for TTY terminals\n interactive: process.stdout.isTTY === true\n };\n\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n const nextArg = args[i + 1];\n\n switch (arg) {\n case '--dir':\n case '-d':\n config.directory = resolve(nextArg || '.');\n i++;\n break;\n case '--debounce':\n case '-D':\n config.debounceMs = parseInt(nextArg || '1000', 10);\n i++;\n break;\n case '--json':\n config.jsonOutput = true;\n break;\n case '--format':\n if (nextArg) {\n config.format = nextArg === 'json' ? 'json' : 'text';\n i++;\n }\n break;\n case '--output':\n if (nextArg) {\n config.output = nextArg;\n i++;\n }\n break;\n case '--parallel':\n config.parallel = true;\n break;\n case '--no-parallel':\n config.parallel = false;\n break;\n case '--cache':\n config.cache = true;\n break;\n case '--no-cache':\n config.cache = false;\n break;\n case '--force-rescan':\n case '--force':\n config.cache = false; // Force rescan by disabling cache\n break;\n case '--max-concurrency':\n config.maxConcurrency = parseInt(nextArg || '4', 10);\n i++;\n break;\n case '--streaming':\n config.streaming = true;\n break;\n case '--no-streaming':\n config.streaming = false;\n break;\n case '--interactive':\n config.interactive = true;\n break;\n case '--no-interactive':\n config.interactive = false;\n break;\n case '--workers':\n config.workers = true;\n break;\n case '--no-workers':\n config.workers = false;\n break;\n case '--timeout':\n config.timeoutMs = parseInt(nextArg || '120000', 10);\n i++;\n break;\n case '--files':\n if (nextArg) {\n config.files = nextArg.split(',').map(f => f.trim()).filter(Boolean);\n i++;\n }\n break;\n case '--scouts':\n case '--agents': // Alias for backward compatibility\n if (nextArg) {\n config.forceScouts = nextArg.split(',').map(s => s.trim()).filter(Boolean);\n i++;\n }\n break;\n case '--once':\n config.runOnce = true;\n break;\n case '--users':\n case '-u':\n config.userCount = parseInt(nextArg || '250', 10);\n i++;\n break;\n case '--help':\n case '-h':\n console.log(`\nTrie Agent - File Watcher & Scanner\n\nUSAGE:\n trie watch [options] Watch for changes and scan continuously\n trie scan [options] Scan once and exit\n\nOPTIONS:\n --dir, -d <path> Directory to watch/scan (default: current directory)\n --debounce, -D <ms> Debounce time in ms (default: 1000)\n --scouts <list> Comma-separated scouts to run (e.g., security,legal)\n --agents <list> Alias for --scouts (backward compatibility)\n --files <list> Comma-separated file list to scan\n --users, -u <count> User count for cost estimation (default: 250)\n\nOUTPUT:\n --json Output as JSON (for log aggregation)\n --format <text|json> Scan output format\n --output <path> Output file path for json format\n\nPERFORMANCE:\n --parallel Enable parallel execution\n --no-parallel Disable parallel execution\n --cache Enable result caching\n --no-cache Disable result caching\n --force-rescan Force rescan (bypasses cache, same as --no-cache)\n --max-concurrency <n> Max parallel scouts\n --streaming Enable streaming updates\n --no-streaming Disable streaming updates\n --workers Use worker threads for scouts\n --no-workers Disable worker threads\n --timeout <ms> Scout timeout in ms\n\nDISPLAY:\n --interactive Enable interactive dashboard (default for TTY)\n --no-interactive Disable interactive dashboard (for CI/scripts)\n\nEXAMPLES:\n trie watch # Watch current directory\n trie scan # Scan once and exit\n trie scan --scouts security,legal # Scan with specific scouts\n trie scan --users 1000 --industry fintech # Scale for fintech with 1K users\n trie watch --no-interactive # CI mode: watch without dashboard\n trie scan --json --output report.json\n`);\n process.exit(0);\n }\n }\n\n return config;\n}\n\n// Run the daemon\nconst config = parseArgs();\nconst daemon = new WatchDaemon(config);\ndaemon.start().catch(error => {\n if (!process.stdout.isTTY || process.argv.includes('--non-interactive')) {\n console.error('Failed to start daemon:', error);\n }\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,SAAS,OAAO,YAAY,UAAU,oBAAoB;AAC1D,SAAS,eAAe;AACxB,SAAS,MAAM,SAAS,UAAU,eAAe;AASjD,IAAM,mBAAmB,oBAAI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;AACO,gBAAQ,KAAK,CAAC;AAAA,IAClB;AAAA,EACF;AAEA,SAAOA;AACT;AAGA,IAAM,SAAS,UAAU;AACzB,IAAM,SAAS,IAAI,YAAY,MAAM;AACrC,OAAO,MAAM,EAAE,MAAM,WAAS;AAC5B,MAAI,CAAC,QAAQ,OAAO,SAAS,QAAQ,KAAK,SAAS,mBAAmB,GAAG;AACvE,YAAQ,MAAM,2BAA2B,KAAK;AAAA,EAChD;AACA,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["config"]}
|
|
1
|
+
{"version":3,"sources":["../../src/cli/yolo-daemon.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Trie Watch - File Watcher & Scanner\n * \n * Watches a directory and reports issues as they occur.\n * Also handles one-shot scanning via --once flag.\n * \n * Usage:\n * trie watch [options] # Watch for changes\n * trie scan [options] # Scan once and exit\n * \n * See `trie watch --help` for all options.\n */\n\nimport { watch, existsSync, statSync, readFileSync } from 'fs';\nimport { readdir } from 'fs/promises';\nimport { join, extname, basename, resolve } from 'path';\nimport { TrieScanTool } from '../tools/scan.js';\nimport { StreamingManager } from '../utils/streaming.js';\nimport { InteractiveDashboard } from './interactive-dashboard.js';\nimport { getWorkingDirectory } from '../utils/workspace.js';\nimport { isInteractiveMode, setInteractiveMode } from '../utils/progress.js';\nimport { isTrieInitialized } from '../utils/trie-init.js';\n\n// File extensions to watch\nconst WATCH_EXTENSIONS = new Set([\n '.ts', '.tsx', '.js', '.jsx', '.mjs',\n '.vue', '.svelte', '.astro',\n '.py', '.go', '.rs'\n]);\n\n// Directories to skip\nconst SKIP_DIRS = new Set([\n 'node_modules', '.git', 'dist', 'build', '.next', '.nuxt',\n 'coverage', '.turbo', '.cache', '__pycache__', '.venv'\n]);\n\ninterface DaemonConfig {\n directory: string;\n debounceMs: number;\n jsonOutput: boolean;\n runOnce: boolean;\n format?: 'text' | 'json';\n output?: string;\n parallel?: boolean;\n cache?: boolean;\n maxConcurrency?: number;\n streaming?: boolean;\n interactive?: boolean;\n workers?: boolean;\n timeoutMs?: number;\n files?: string[];\n /** Comma-separated list of scouts to run (e.g., \"security,legal\") */\n forceScouts?: string[];\n /** User count for cost estimation (default: 250) */\n userCount?: number;\n}\n\ninterface DaemonStats {\n filesScanned: number;\n issuesFound: number;\n errors: number;\n startTime: number;\n}\n\nclass WatchDaemon {\n private config: DaemonConfig;\n private stats: DaemonStats;\n private scanTool = new TrieScanTool();\n private watchers: Map<string, ReturnType<typeof watch>> = new Map();\n private pendingFiles: Set<string> = new Set();\n private debounceTimer: NodeJS.Timeout | null = null;\n private isProcessing = false;\n private streamingManager: StreamingManager | undefined = undefined;\n private dashboard: InteractiveDashboard | undefined = undefined;\n\n constructor(config: DaemonConfig) {\n this.config = config;\n this.stats = {\n filesScanned: 0,\n issuesFound: 0,\n errors: 0,\n startTime: Date.now()\n };\n }\n\n /**\n * Start the daemon\n */\n async start(): Promise<void> {\n // Enable global interactive mode when TTY and not explicitly disabled\n if (this.config.interactive !== false && process.stdout.isTTY) {\n setInteractiveMode(true);\n }\n if (!isTrieInitialized(this.config.directory)) {\n if (!isInteractiveMode()) {\n console.error('Trie is not initialized for this project.');\n console.error('Run `trie init` first.');\n }\n process.exit(1);\n }\n\n this.log('info', 'Starting Trie Agent', {\n directory: this.config.directory,\n debounceMs: this.config.debounceMs\n });\n if (!isInteractiveMode()) {\n console.error('\\nYour Trie agent is watching over your codebase.\\n');\n }\n\n // Validate directory\n if (!existsSync(this.config.directory)) {\n this.log('error', 'Directory not found', { directory: this.config.directory });\n process.exit(1);\n }\n\n // Start interactive dashboard if enabled\n if (isInteractiveMode()) {\n this.streamingManager = new StreamingManager();\n this.dashboard = new InteractiveDashboard();\n this.streamingManager.subscribe(update => this.dashboard?.handleStreamUpdate(update));\n await this.dashboard.start();\n this.streamingManager.reportWatchStatus({\n watching: !this.config.runOnce,\n directories: 0,\n debounceMs: this.config.debounceMs\n });\n }\n\n // Run initial scan\n this.log('info', 'Running initial scan...');\n await this.runScan(this.config.files);\n\n // If run-once mode, exit after initial scan\n if (this.config.runOnce) {\n this.log('info', 'Run-once mode: exiting after initial scan', { ...this.stats });\n process.exit(this.stats.issuesFound > 0 ? 1 : 0);\n }\n\n // Start watching\n await this.watchDirectory(this.config.directory);\n this.streamingManager?.reportWatchStatus({\n watching: true,\n directories: this.watchers.size,\n debounceMs: this.config.debounceMs\n });\n this.log('info', 'Watching for changes...', { \n directories: this.watchers.size \n });\n\n // Handle graceful shutdown\n process.on('SIGINT', () => this.shutdown('SIGINT'));\n process.on('SIGTERM', () => this.shutdown('SIGTERM'));\n }\n\n /**\n * Run a scan on all files or specific files\n */\n private async runScan(files?: string[]): Promise<void> {\n try {\n const scanArgs: Record<string, unknown> = files\n ? { files }\n : { directory: this.config.directory };\n\n if (this.config.format) scanArgs.format = this.config.format;\n if (this.config.output) scanArgs.output = this.config.output;\n if (this.config.parallel !== undefined) scanArgs.parallel = this.config.parallel;\n if (this.config.cache !== undefined) scanArgs.cache = this.config.cache;\n if (this.config.maxConcurrency) scanArgs.maxConcurrency = this.config.maxConcurrency;\n if (this.config.streaming !== undefined) scanArgs.streaming = this.config.streaming;\n if (this.config.interactive !== undefined) scanArgs.interactive = this.config.interactive;\n if (this.config.workers !== undefined) scanArgs.workers = this.config.workers;\n if (this.config.timeoutMs) scanArgs.timeoutMs = this.config.timeoutMs;\n if (this.config.forceScouts) scanArgs.forceAgents = this.config.forceScouts;\n if (this.dashboard && typeof this.dashboard.getAgentConfig === 'function') {\n const agentConfig = this.dashboard.getAgentConfig();\n scanArgs.parallel = agentConfig.performance.parallel;\n scanArgs.cache = agentConfig.performance.cache;\n scanArgs.maxConcurrency = agentConfig.performance.maxConcurrency;\n scanArgs.timeoutMs = agentConfig.performance.timeoutMs;\n scanArgs.workers = agentConfig.performance.workers;\n scanArgs.streaming = agentConfig.performance.streaming;\n }\n\n if (this.streamingManager) scanArgs.streamingManager = this.streamingManager;\n if (this.dashboard) scanArgs.dashboard = this.dashboard;\n\n const result = await this.scanTool.execute(scanArgs);\n const resultText = result.content?.[0]?.text || '';\n\n // PRINT THE FULL REPORT TO STDOUT (for terminal/chat display)\n if (resultText && this.config.runOnce && !isInteractiveMode()) {\n console.log(resultText);\n }\n\n // Parse results - try multiple patterns to extract issue count\n let issueCount = 0;\n if (this.config.format === 'json' && this.config.output && existsSync(this.config.output)) {\n try {\n const report = JSON.parse(readFileSync(this.config.output, 'utf-8'));\n issueCount = report?.results?.totalIssues ?? 0;\n } catch {\n issueCount = 0;\n }\n } else {\n // Try multiple patterns to catch issue counts\n const patterns = [\n /(\\d+)\\s+actionable\\s+issues?\\s+found/i, // \"30 actionable issues found\"\n /(\\d+)\\s+Issues?\\s+Found/i, // \"30 Issues Found\"\n /Found\\s+(\\d+)\\s+issues?/i, // \"Found 30 issues\"\n /\\[COMPLETE\\]\\s+(\\d+)\\s+issues?/i, // \"[COMPLETE] 30 issues\"\n /(\\d+)\\s+total/i, // \"30 total\" (fallback)\n ];\n \n for (const pattern of patterns) {\n const match = resultText.match(pattern);\n if (match && match[1]) {\n issueCount = parseInt(match[1], 10);\n break;\n }\n }\n }\n\n this.stats.filesScanned += files?.length || 1;\n this.stats.issuesFound += issueCount;\n\n // Don't log \"No issues found\" after a full scan that displayed a report\n // The report already shows the issue count prominently\n if (issueCount > 0) {\n // Parse severity breakdown for additional logging\n const criticalMatch = resultText.match(/(\\d+)\\s+critical/i);\n const seriousMatch = resultText.match(/(\\d+)\\s+serious|(\\d+)\\s+important/i);\n\n if (criticalMatch && criticalMatch[1] && parseInt(criticalMatch[1], 10) > 0) {\n this.log('error', 'Critical issues detected', { count: parseInt(criticalMatch[1], 10) });\n }\n if (seriousMatch && (seriousMatch[1] || seriousMatch[2])) {\n const count = parseInt(seriousMatch[1] || seriousMatch[2] || '0', 10);\n if (count > 0) {\n this.log('warn', 'Serious issues detected', { count });\n }\n }\n }\n // NOTE: Removed the \"No issues found\" log because it was confusing\n // when printed after a full scan report that already shows issue counts\n } catch (error) {\n this.stats.errors++;\n this.log('error', 'Scan failed', { \n error: error instanceof Error ? error.message : String(error) \n });\n }\n }\n\n /**\n * Watch a directory recursively\n */\n private async watchDirectory(dir: string): Promise<void> {\n if (!existsSync(dir)) return;\n\n try {\n const stat = statSync(dir);\n if (!stat.isDirectory()) return;\n\n const dirName = basename(dir);\n if (SKIP_DIRS.has(dirName) || dirName.startsWith('.')) return;\n\n // Watch this directory\n const watcher = watch(dir, { persistent: true }, (_eventType, filename) => {\n if (!filename) return;\n\n const fullPath = join(dir, filename);\n const ext = extname(filename).toLowerCase();\n\n if (!WATCH_EXTENSIONS.has(ext)) return;\n if (!existsSync(fullPath)) return;\n\n this.pendingFiles.add(fullPath);\n this.streamingManager?.reportWatchChange(fullPath);\n this.scheduleProcessing();\n });\n\n this.watchers.set(dir, watcher);\n\n // Recursively watch subdirectories\n const entries = await readdir(dir, { withFileTypes: true });\n for (const entry of entries) {\n if (entry.isDirectory()) {\n await this.watchDirectory(join(dir, entry.name));\n }\n }\n } catch (error) {\n // Skip inaccessible directories\n }\n }\n\n /**\n * Schedule processing of pending files (debounced)\n */\n private scheduleProcessing(): void {\n if (this.debounceTimer) {\n clearTimeout(this.debounceTimer);\n }\n\n this.debounceTimer = setTimeout(() => {\n this.processPendingFiles();\n }, this.config.debounceMs);\n }\n\n /**\n * Process all pending files\n */\n private async processPendingFiles(): Promise<void> {\n if (this.isProcessing || this.pendingFiles.size === 0) return;\n\n this.isProcessing = true;\n const files = Array.from(this.pendingFiles);\n this.pendingFiles.clear();\n\n this.log('info', 'Processing changed files', { \n count: files.length,\n files: files.map(f => basename(f))\n });\n\n await this.runScan(files);\n this.isProcessing = false;\n }\n\n\n /**\n * Log a message\n */\n private log(level: 'info' | 'warn' | 'error', message: string, data?: Record<string, unknown>): void {\n const timestamp = new Date().toISOString();\n const uptime = Math.round((Date.now() - this.stats.startTime) / 1000);\n\n // Suppress human-readable logs when interactive dashboard is active\n if (!this.config.jsonOutput && isInteractiveMode()) {\n return;\n }\n\n if (this.config.jsonOutput) {\n console.log(JSON.stringify({\n timestamp,\n level,\n message,\n uptime,\n ...data,\n stats: this.stats\n }));\n } else {\n const levelEmoji = { info: '[i]', warn: '[!]', error: '[X]' }[level];\n const dataStr = data ? ` ${JSON.stringify(data)}` : '';\n console.log(`[${timestamp}] ${levelEmoji} ${message}${dataStr}`);\n }\n }\n\n /**\n * Graceful shutdown\n */\n private shutdown(signal: string): void {\n this.log('info', 'Shutting down', { signal, stats: this.stats });\n\n // Close all watchers\n for (const watcher of this.watchers.values()) {\n watcher.close();\n }\n\n // Clear timers\n if (this.debounceTimer) {\n clearTimeout(this.debounceTimer);\n }\n\n if (this.streamingManager) {\n this.streamingManager.reportWatchStatus({\n watching: false,\n directories: 0\n });\n }\n if (this.dashboard) {\n this.dashboard.stop();\n }\n\n process.exit(0);\n }\n}\n\n/**\n * Parse command line arguments\n */\nfunction parseArgs(): DaemonConfig {\n const args = process.argv.slice(2);\n const config: DaemonConfig = {\n // Silent mode for initial workspace detection (TUI will handle display)\n directory: getWorkingDirectory(undefined, true),\n debounceMs: 1000,\n jsonOutput: false,\n runOnce: false,\n // Default to interactive mode for TTY terminals\n interactive: process.stdout.isTTY === true\n };\n\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n const nextArg = args[i + 1];\n\n switch (arg) {\n case '--dir':\n case '-d':\n config.directory = resolve(nextArg || '.');\n i++;\n break;\n case '--debounce':\n case '-D':\n config.debounceMs = parseInt(nextArg || '1000', 10);\n i++;\n break;\n case '--json':\n config.jsonOutput = true;\n break;\n case '--format':\n if (nextArg) {\n config.format = nextArg === 'json' ? 'json' : 'text';\n i++;\n }\n break;\n case '--output':\n if (nextArg) {\n config.output = nextArg;\n i++;\n }\n break;\n case '--parallel':\n config.parallel = true;\n break;\n case '--no-parallel':\n config.parallel = false;\n break;\n case '--cache':\n config.cache = true;\n break;\n case '--no-cache':\n config.cache = false;\n break;\n case '--force-rescan':\n case '--force':\n config.cache = false; // Force rescan by disabling cache\n break;\n case '--max-concurrency':\n config.maxConcurrency = parseInt(nextArg || '4', 10);\n i++;\n break;\n case '--streaming':\n config.streaming = true;\n break;\n case '--no-streaming':\n config.streaming = false;\n break;\n case '--interactive':\n config.interactive = true;\n break;\n case '--no-interactive':\n config.interactive = false;\n break;\n case '--workers':\n config.workers = true;\n break;\n case '--no-workers':\n config.workers = false;\n break;\n case '--timeout':\n config.timeoutMs = parseInt(nextArg || '120000', 10);\n i++;\n break;\n case '--files':\n if (nextArg) {\n config.files = nextArg.split(',').map(f => f.trim()).filter(Boolean);\n i++;\n }\n break;\n case '--scouts':\n case '--agents': // Alias for backward compatibility\n if (nextArg) {\n config.forceScouts = nextArg.split(',').map(s => s.trim()).filter(Boolean);\n i++;\n }\n break;\n case '--once':\n config.runOnce = true;\n break;\n case '--users':\n case '-u':\n config.userCount = parseInt(nextArg || '250', 10);\n i++;\n break;\n case '--help':\n case '-h':\n console.log(`\nTrie Agent - File Watcher & Scanner\n\nUSAGE:\n trie watch [options] Watch for changes and scan continuously\n trie scan [options] Scan once and exit\n\nOPTIONS:\n --dir, -d <path> Directory to watch/scan (default: current directory)\n --debounce, -D <ms> Debounce time in ms (default: 1000)\n --scouts <list> Comma-separated scouts to run (e.g., security,legal)\n --agents <list> Alias for --scouts (backward compatibility)\n --files <list> Comma-separated file list to scan\n --users, -u <count> User count for cost estimation (default: 250)\n\nOUTPUT:\n --json Output as JSON (for log aggregation)\n --format <text|json> Scan output format\n --output <path> Output file path for json format\n\nPERFORMANCE:\n --parallel Enable parallel execution\n --no-parallel Disable parallel execution\n --cache Enable result caching\n --no-cache Disable result caching\n --force-rescan Force rescan (bypasses cache, same as --no-cache)\n --max-concurrency <n> Max parallel scouts\n --streaming Enable streaming updates\n --no-streaming Disable streaming updates\n --workers Use worker threads for scouts\n --no-workers Disable worker threads\n --timeout <ms> Scout timeout in ms\n\nDISPLAY:\n --interactive Enable interactive dashboard (default for TTY)\n --no-interactive Disable interactive dashboard (for CI/scripts)\n\nEXAMPLES:\n trie watch # Watch current directory\n trie scan # Scan once and exit\n trie scan --scouts security,legal # Scan with specific scouts\n trie scan --users 1000 --industry fintech # Scale for fintech with 1K users\n trie watch --no-interactive # CI mode: watch without dashboard\n trie scan --json --output report.json\n`);\n process.exit(0);\n }\n }\n\n return config;\n}\n\n// Run the daemon\nconst config = parseArgs();\nconst daemon = new WatchDaemon(config);\ndaemon.start().catch(error => {\n if (!process.stdout.isTTY || process.argv.includes('--non-interactive')) {\n console.error('Failed to start daemon:', error);\n }\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,SAAS,OAAO,YAAY,UAAU,oBAAoB;AAC1D,SAAS,eAAe;AACxB,SAAS,MAAM,SAAS,UAAU,eAAe;AASjD,IAAM,mBAAmB,oBAAI,IAAI;AAAA,EAC/B;AAAA,EAAO;AAAA,EAAQ;AAAA,EAAO;AAAA,EAAQ;AAAA,EAC9B;AAAA,EAAQ;AAAA,EAAW;AAAA,EACnB;AAAA,EAAO;AAAA,EAAO;AAChB,CAAC;AAGD,IAAM,YAAY,oBAAI,IAAI;AAAA,EACxB;AAAA,EAAgB;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAS;AAAA,EAClD;AAAA,EAAY;AAAA,EAAU;AAAA,EAAU;AAAA,EAAe;AACjD,CAAC;AA8BD,IAAM,cAAN,MAAkB;AAAA,EACR;AAAA,EACA;AAAA,EACA,WAAW,IAAI,aAAa;AAAA,EAC5B,WAAkD,oBAAI,IAAI;AAAA,EAC1D,eAA4B,oBAAI,IAAI;AAAA,EACpC,gBAAuC;AAAA,EACvC,eAAe;AAAA,EACf,mBAAiD;AAAA,EACjD,YAA8C;AAAA,EAEtD,YAAYA,SAAsB;AAChC,SAAK,SAASA;AACd,SAAK,QAAQ;AAAA,MACX,cAAc;AAAA,MACd,aAAa;AAAA,MACb,QAAQ;AAAA,MACR,WAAW,KAAK,IAAI;AAAA,IACtB;AAAA,EACF;AAAA;AA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OAAO,OAAO;AACzE;AAAA,QACF;AACA;AAAA,MACF,KAAK;AACH,QAAAA,QAAO,UAAU;AACjB;AAAA,MACF,KAAK;AAAA,MACL,KAAK;AACH,QAAAA,QAAO,YAAY,SAAS,WAAW,OAAO,EAAE;AAChD;AACA;AAAA,MACF,KAAK;AAAA,MACL,KAAK;AACH,gBAAQ,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CA4CnB;AACO,gBAAQ,KAAK,CAAC;AAAA,IAClB;AAAA,EACF;AAEA,SAAOA;AACT;AAGA,IAAM,SAAS,UAAU;AACzB,IAAM,SAAS,IAAI,YAAY,MAAM;AACrC,OAAO,MAAM,EAAE,MAAM,WAAS;AAC5B,MAAI,CAAC,QAAQ,OAAO,SAAS,QAAQ,KAAK,SAAS,mBAAmB,GAAG;AACvE,YAAQ,MAAM,2BAA2B,KAAK;AAAA,EAChD;AACA,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["config"]}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
saveKeyToKeychain,
|
|
10
10
|
setAPIKey,
|
|
11
11
|
tryGetClient
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FPEMP54L.js";
|
|
13
13
|
import "./chunk-SH7H3WRU.js";
|
|
14
14
|
import "./chunk-APMV77PU.js";
|
|
15
15
|
import "./chunk-DGUM43GV.js";
|
|
@@ -25,4 +25,4 @@ export {
|
|
|
25
25
|
setAPIKey,
|
|
26
26
|
tryGetClient
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=client-
|
|
28
|
+
//# sourceMappingURL=client-INNE2GGZ.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CodebaseIndex
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-6NLHFIYA.js";
|
|
3
|
+
} from "./chunk-AF2APASP.js";
|
|
5
4
|
import "./chunk-43X6JBEM.js";
|
|
5
|
+
import "./chunk-6NLHFIYA.js";
|
|
6
6
|
import "./chunk-SH7H3WRU.js";
|
|
7
7
|
import "./chunk-APMV77PU.js";
|
|
8
8
|
import "./chunk-DGUM43GV.js";
|
|
9
9
|
export {
|
|
10
10
|
CodebaseIndex
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=codebase-index-
|
|
12
|
+
//# sourceMappingURL=codebase-index-5SEOESWM.js.map
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CodebaseIndex
|
|
3
|
+
} from "./chunk-AF2APASP.js";
|
|
4
|
+
import "./chunk-43X6JBEM.js";
|
|
5
|
+
import "./chunk-6NLHFIYA.js";
|
|
6
|
+
import "./chunk-SH7H3WRU.js";
|
|
7
|
+
import "./chunk-APMV77PU.js";
|
|
8
|
+
import "./chunk-DGUM43GV.js";
|
|
9
|
+
|
|
10
|
+
// src/agent/fast-analyzer.ts
|
|
11
|
+
async function analyzeFilesRapidly(goals, projectPath, options = {}) {
|
|
12
|
+
const startTime = Date.now();
|
|
13
|
+
const { maxFiles = 50, enableSmartBatching = true, onProgress } = options;
|
|
14
|
+
const codebaseIndex = new CodebaseIndex(projectPath);
|
|
15
|
+
onProgress?.("Optimizing analysis cache...");
|
|
16
|
+
await preIndexRecentFiles(codebaseIndex, projectPath, maxFiles * 2);
|
|
17
|
+
const filesToAnalyze = await getSmartFileSelection(projectPath, maxFiles);
|
|
18
|
+
if (filesToAnalyze.length === 0) {
|
|
19
|
+
return {
|
|
20
|
+
violations: [],
|
|
21
|
+
cacheHitRatio: 1,
|
|
22
|
+
filesAnalyzed: 0,
|
|
23
|
+
timeMs: Date.now() - startTime
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const cacheResults = await performRapidCacheLookup(codebaseIndex, filesToAnalyze, goals);
|
|
27
|
+
const cacheHitRatio = cacheResults.cacheHits / filesToAnalyze.length;
|
|
28
|
+
onProgress?.(`Cache hit ratio: ${Math.round(cacheHitRatio * 100)}% (${cacheResults.cacheHits}/${filesToAnalyze.length})`);
|
|
29
|
+
let newViolations = [];
|
|
30
|
+
if (cacheResults.filesToScan.length > 0) {
|
|
31
|
+
if (enableSmartBatching) {
|
|
32
|
+
newViolations = await analyzeWithSmartBatching(
|
|
33
|
+
codebaseIndex,
|
|
34
|
+
cacheResults.filesToScan,
|
|
35
|
+
goals,
|
|
36
|
+
projectPath,
|
|
37
|
+
onProgress
|
|
38
|
+
);
|
|
39
|
+
} else {
|
|
40
|
+
const { checkFilesForGoalViolations } = await import("./goal-validator-HNXXUCPW.js");
|
|
41
|
+
newViolations = await checkFilesForGoalViolations(
|
|
42
|
+
goals,
|
|
43
|
+
projectPath,
|
|
44
|
+
cacheResults.filesToScan,
|
|
45
|
+
onProgress
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
await codebaseIndex.save();
|
|
50
|
+
return {
|
|
51
|
+
violations: [...cacheResults.cachedViolations, ...newViolations],
|
|
52
|
+
cacheHitRatio,
|
|
53
|
+
filesAnalyzed: filesToAnalyze.length,
|
|
54
|
+
timeMs: Date.now() - startTime
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
async function preIndexRecentFiles(codebaseIndex, projectPath, maxFiles) {
|
|
58
|
+
if (!codebaseIndex.isEmpty()) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const { glob } = await import("glob");
|
|
62
|
+
const { stat } = await import("fs/promises");
|
|
63
|
+
const pattern = `${projectPath}/**/*.{ts,tsx,js,jsx,py,go,rs,java,c,cpp,h,hpp,cs,rb,php,css,scss,html,vue,svelte,astro}`;
|
|
64
|
+
const allFiles = await glob(pattern, {
|
|
65
|
+
ignore: ["**/node_modules/**", "**/dist/**", "**/build/**", "**/.git/**", "**/.trie/**", "**/coverage/**"],
|
|
66
|
+
nodir: true
|
|
67
|
+
});
|
|
68
|
+
const withStats = await Promise.all(
|
|
69
|
+
allFiles.map(async (f) => {
|
|
70
|
+
try {
|
|
71
|
+
const stats = await stat(f);
|
|
72
|
+
return { file: f, mtime: stats.mtime.getTime() };
|
|
73
|
+
} catch {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
);
|
|
78
|
+
const recentFiles = withStats.filter((f) => f !== null).sort((a, b) => b.mtime - a.mtime).slice(0, maxFiles).map((f) => f.file);
|
|
79
|
+
const indexPromises = recentFiles.map(async (filePath) => {
|
|
80
|
+
let relativePath = filePath;
|
|
81
|
+
if (filePath.toLowerCase().startsWith(projectPath.toLowerCase() + "/")) {
|
|
82
|
+
relativePath = filePath.slice(projectPath.length + 1);
|
|
83
|
+
}
|
|
84
|
+
return codebaseIndex.indexFile(relativePath);
|
|
85
|
+
});
|
|
86
|
+
await Promise.all(indexPromises);
|
|
87
|
+
}
|
|
88
|
+
async function getSmartFileSelection(projectPath, maxFiles) {
|
|
89
|
+
const { glob } = await import("glob");
|
|
90
|
+
const { stat } = await import("fs/promises");
|
|
91
|
+
const pattern = `${projectPath}/**/*.{ts,tsx,js,jsx,py,go,rs,java,c,cpp,h,hpp,cs,rb,php}`;
|
|
92
|
+
const allFiles = await glob(pattern, {
|
|
93
|
+
ignore: ["**/node_modules/**", "**/dist/**", "**/build/**", "**/.git/**", "**/.trie/**", "**/coverage/**"],
|
|
94
|
+
nodir: true
|
|
95
|
+
});
|
|
96
|
+
const scoredFiles = await Promise.all(
|
|
97
|
+
allFiles.map(async (filePath) => {
|
|
98
|
+
try {
|
|
99
|
+
const stats = await stat(filePath);
|
|
100
|
+
let score = 0;
|
|
101
|
+
const daysSinceModified = (Date.now() - stats.mtime.getTime()) / (1e3 * 60 * 60 * 24);
|
|
102
|
+
score += Math.max(0, 100 - daysSinceModified);
|
|
103
|
+
const ext = filePath.split(".").pop()?.toLowerCase() || "";
|
|
104
|
+
const typeScores = {
|
|
105
|
+
"ts": 50,
|
|
106
|
+
"tsx": 50,
|
|
107
|
+
"js": 40,
|
|
108
|
+
"jsx": 40,
|
|
109
|
+
"py": 30,
|
|
110
|
+
"go": 30,
|
|
111
|
+
"rs": 30,
|
|
112
|
+
"java": 25
|
|
113
|
+
};
|
|
114
|
+
score += typeScores[ext] || 10;
|
|
115
|
+
const sizeKB = stats.size / 1024;
|
|
116
|
+
if (sizeKB < 5) score -= 20;
|
|
117
|
+
else if (sizeKB > 500) score -= 30;
|
|
118
|
+
else score += 20;
|
|
119
|
+
return { file: filePath, score };
|
|
120
|
+
} catch {
|
|
121
|
+
return { file: filePath, score: 0 };
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
);
|
|
125
|
+
return scoredFiles.sort((a, b) => b.score - a.score).slice(0, maxFiles).map((f) => f.file);
|
|
126
|
+
}
|
|
127
|
+
async function performRapidCacheLookup(codebaseIndex, files, goals) {
|
|
128
|
+
const cachedViolations = [];
|
|
129
|
+
const filesToScan = [];
|
|
130
|
+
let cacheHits = 0;
|
|
131
|
+
for (const filePath of files) {
|
|
132
|
+
let relativePath = filePath;
|
|
133
|
+
if (filePath.toLowerCase().startsWith(filePath.split("/").slice(0, -1).join("/").toLowerCase() + "/")) {
|
|
134
|
+
relativePath = filePath.split("/").pop() || filePath;
|
|
135
|
+
}
|
|
136
|
+
const hasChanged = await codebaseIndex.hasChanged(relativePath);
|
|
137
|
+
if (hasChanged) {
|
|
138
|
+
await codebaseIndex.indexFile(relativePath);
|
|
139
|
+
filesToScan.push(filePath);
|
|
140
|
+
} else {
|
|
141
|
+
let foundCachedResult = false;
|
|
142
|
+
for (const goal of goals) {
|
|
143
|
+
const cached = codebaseIndex.getCachedViolations(relativePath, goal.id);
|
|
144
|
+
if (cached && cached.length > 0) {
|
|
145
|
+
const violation = cached[0];
|
|
146
|
+
if (violation && violation.found) {
|
|
147
|
+
cachedViolations.push({
|
|
148
|
+
file: relativePath,
|
|
149
|
+
message: `Goal "${goal.description}" violated: ${violation.details || "Cached violation"} [${violation.confidence || 90}% confidence]`,
|
|
150
|
+
severity: "warning"
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
foundCachedResult = true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (foundCachedResult) {
|
|
157
|
+
cacheHits++;
|
|
158
|
+
} else {
|
|
159
|
+
filesToScan.push(filePath);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return { cachedViolations, filesToScan, cacheHits };
|
|
164
|
+
}
|
|
165
|
+
async function analyzeWithSmartBatching(codebaseIndex, filesToScan, goals, projectPath, onProgress) {
|
|
166
|
+
const adaptiveBatchSize = Math.min(10, filesToScan.length);
|
|
167
|
+
const totalBatches = Math.ceil(filesToScan.length / adaptiveBatchSize);
|
|
168
|
+
const allViolations = [];
|
|
169
|
+
for (let i = 0; i < totalBatches; i++) {
|
|
170
|
+
const start = i * adaptiveBatchSize;
|
|
171
|
+
const end = Math.min(start + adaptiveBatchSize, filesToScan.length);
|
|
172
|
+
const batchFiles = filesToScan.slice(start, end);
|
|
173
|
+
onProgress?.(`Fast analysis (${i + 1}/${totalBatches}): ${batchFiles.length} files...`);
|
|
174
|
+
const { checkFilesForGoalViolations } = await import("./goal-validator-HNXXUCPW.js");
|
|
175
|
+
const batchResults = await checkFilesForGoalViolations(
|
|
176
|
+
goals,
|
|
177
|
+
projectPath,
|
|
178
|
+
batchFiles,
|
|
179
|
+
void 0
|
|
180
|
+
// Don't pass progress callback to avoid nested messages
|
|
181
|
+
);
|
|
182
|
+
allViolations.push(...batchResults);
|
|
183
|
+
for (const violation of batchResults) {
|
|
184
|
+
const relativePath = violation.file.includes("/") ? violation.file.split("/").pop() || violation.file : violation.file;
|
|
185
|
+
const goalMatch = violation.message.match(/Goal "([^"]+)"/);
|
|
186
|
+
if (goalMatch) {
|
|
187
|
+
const goalDesc = goalMatch[1];
|
|
188
|
+
const goal = goals.find((g) => g.description === goalDesc);
|
|
189
|
+
if (goal) {
|
|
190
|
+
codebaseIndex.setCachedViolations(relativePath, goal.id, [{
|
|
191
|
+
goalId: goal.id,
|
|
192
|
+
goalDescription: goal.description,
|
|
193
|
+
found: true,
|
|
194
|
+
details: violation.message,
|
|
195
|
+
confidence: 90,
|
|
196
|
+
timestamp: Date.now()
|
|
197
|
+
}]);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return allViolations;
|
|
203
|
+
}
|
|
204
|
+
async function getAnalysisStats(projectPath) {
|
|
205
|
+
const codebaseIndex = new CodebaseIndex(projectPath);
|
|
206
|
+
return {
|
|
207
|
+
indexedFiles: codebaseIndex.getFileCount(),
|
|
208
|
+
cacheSize: `${Math.round(codebaseIndex.getCacheSize() / 1024)}KB`,
|
|
209
|
+
lastUpdated: codebaseIndex.getLastUpdated()
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
export {
|
|
213
|
+
analyzeFilesRapidly,
|
|
214
|
+
getAnalysisStats
|
|
215
|
+
};
|
|
216
|
+
//# sourceMappingURL=fast-analyzer-AYLZB5TW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/agent/fast-analyzer.ts"],"sourcesContent":["/**\n * Fast Analyzer - Optimized file analysis using RAG and caching\n *\n * This module provides blazing-fast file analysis by:\n * 1. Leveraging the CodebaseIndex aggressively\n * 2. Using semantic search on cached violations\n * 3. Smart batch sizing based on cache hit ratio\n * 4. Pre-emptive indexing of likely-to-be-analyzed files\n */\n\nimport { CodebaseIndex } from '../context/codebase-index.js';\nimport type { Goal } from './project-state.js';\n\nexport interface FastAnalysisOptions {\n maxFiles?: number;\n enableSmartBatching?: boolean;\n enableSemanticSearch?: boolean;\n onProgress?: (message: string) => void;\n}\n\nexport interface FastAnalysisResult {\n violations: Array<{ file: string; message: string; severity: 'critical' | 'warning' | 'info' }>;\n cacheHitRatio: number;\n filesAnalyzed: number;\n timeMs: number;\n}\n\n/**\n * Fast path for common analysis patterns\n */\nexport async function analyzeFilesRapidly(\n goals: Goal[],\n projectPath: string,\n options: FastAnalysisOptions = {}\n): Promise<FastAnalysisResult> {\n const startTime = Date.now();\n const { maxFiles = 50, enableSmartBatching = true, onProgress } = options;\n\n // Initialize codebase index\n const codebaseIndex = new CodebaseIndex(projectPath);\n\n // Smart pre-indexing: index recently modified files first\n onProgress?.('Optimizing analysis cache...');\n await preIndexRecentFiles(codebaseIndex, projectPath, maxFiles * 2);\n\n // Get files to analyze with intelligent selection\n const filesToAnalyze = await getSmartFileSelection(projectPath, maxFiles);\n\n if (filesToAnalyze.length === 0) {\n return {\n violations: [],\n cacheHitRatio: 1.0,\n filesAnalyzed: 0,\n timeMs: Date.now() - startTime\n };\n }\n\n // Fast cache lookup first\n const cacheResults = await performRapidCacheLookup(codebaseIndex, filesToAnalyze, goals);\n const cacheHitRatio = cacheResults.cacheHits / filesToAnalyze.length;\n\n onProgress?.(`Cache hit ratio: ${Math.round(cacheHitRatio * 100)}% (${cacheResults.cacheHits}/${filesToAnalyze.length})`);\n\n // Only analyze files that aren't cached\n let newViolations: any[] = [];\n if (cacheResults.filesToScan.length > 0) {\n if (enableSmartBatching) {\n newViolations = await analyzeWithSmartBatching(\n codebaseIndex,\n cacheResults.filesToScan,\n goals,\n projectPath,\n onProgress\n );\n } else {\n // Fallback to existing batch logic\n const { checkFilesForGoalViolations } = await import('./goal-validator.js');\n newViolations = await checkFilesForGoalViolations(\n goals,\n projectPath,\n cacheResults.filesToScan,\n onProgress\n );\n }\n }\n\n await codebaseIndex.save();\n\n return {\n violations: [...cacheResults.cachedViolations, ...newViolations],\n cacheHitRatio,\n filesAnalyzed: filesToAnalyze.length,\n timeMs: Date.now() - startTime\n };\n}\n\n/**\n * Pre-index recently modified files to improve cache hits\n */\nasync function preIndexRecentFiles(\n codebaseIndex: CodebaseIndex,\n projectPath: string,\n maxFiles: number\n): Promise<void> {\n if (!codebaseIndex.isEmpty()) {\n return; // Already has index\n }\n\n const { glob } = await import('glob');\n const { stat } = await import('fs/promises');\n\n const pattern = `${projectPath}/**/*.{ts,tsx,js,jsx,py,go,rs,java,c,cpp,h,hpp,cs,rb,php,css,scss,html,vue,svelte,astro}`;\n const allFiles = await glob(pattern, {\n ignore: ['**/node_modules/**', '**/dist/**', '**/build/**', '**/.git/**', '**/.trie/**', '**/coverage/**'],\n nodir: true,\n });\n\n // Sort by modification time\n const withStats = await Promise.all(\n allFiles.map(async (f) => {\n try {\n const stats = await stat(f);\n return { file: f, mtime: stats.mtime.getTime() };\n } catch {\n return null;\n }\n })\n );\n\n const recentFiles = withStats\n .filter((f): f is { file: string; mtime: number } => f !== null)\n .sort((a, b) => b.mtime - a.mtime)\n .slice(0, maxFiles)\n .map((f) => f.file);\n\n // Index files in parallel for speed\n const indexPromises = recentFiles.map(async (filePath) => {\n let relativePath = filePath;\n if (filePath.toLowerCase().startsWith(projectPath.toLowerCase() + '/')) {\n relativePath = filePath.slice(projectPath.length + 1);\n }\n return codebaseIndex.indexFile(relativePath);\n });\n\n await Promise.all(indexPromises);\n}\n\n/**\n * Intelligent file selection based on git changes, file types, and size\n */\nasync function getSmartFileSelection(projectPath: string, maxFiles: number): Promise<string[]> {\n const { glob } = await import('glob');\n const { stat } = await import('fs/promises');\n\n // Start with recently modified files\n const pattern = `${projectPath}/**/*.{ts,tsx,js,jsx,py,go,rs,java,c,cpp,h,hpp,cs,rb,php}`;\n const allFiles = await glob(pattern, {\n ignore: ['**/node_modules/**', '**/dist/**', '**/build/**', '**/.git/**', '**/.trie/**', '**/coverage/**'],\n nodir: true,\n });\n\n // Score files by relevance\n const scoredFiles = await Promise.all(\n allFiles.map(async (filePath) => {\n try {\n const stats = await stat(filePath);\n let score = 0;\n\n // Recency score (higher for recently modified)\n const daysSinceModified = (Date.now() - stats.mtime.getTime()) / (1000 * 60 * 60 * 24);\n score += Math.max(0, 100 - daysSinceModified);\n\n // File type score (higher for important types)\n const ext = filePath.split('.').pop()?.toLowerCase() || '';\n const typeScores: Record<string, number> = {\n 'ts': 50, 'tsx': 50, 'js': 40, 'jsx': 40,\n 'py': 30, 'go': 30, 'rs': 30, 'java': 25\n };\n score += typeScores[ext] || 10;\n\n // Size score (prefer medium-sized files)\n const sizeKB = stats.size / 1024;\n if (sizeKB < 5) score -= 20; // Too small, likely not important\n else if (sizeKB > 500) score -= 30; // Too large, likely generated\n else score += 20; // Good size\n\n return { file: filePath, score };\n } catch {\n return { file: filePath, score: 0 };\n }\n })\n );\n\n return scoredFiles\n .sort((a, b) => b.score - a.score)\n .slice(0, maxFiles)\n .map(f => f.file);\n}\n\n/**\n * Rapid cache lookup for all goals across all files\n */\nasync function performRapidCacheLookup(\n codebaseIndex: CodebaseIndex,\n files: string[],\n goals: Goal[]\n): Promise<{\n cachedViolations: any[];\n filesToScan: string[];\n cacheHits: number;\n}> {\n const cachedViolations: any[] = [];\n const filesToScan: string[] = [];\n let cacheHits = 0;\n\n for (const filePath of files) {\n let relativePath = filePath;\n if (filePath.toLowerCase().startsWith(filePath.split('/').slice(0, -1).join('/').toLowerCase() + '/')) {\n relativePath = filePath.split('/').pop() || filePath;\n }\n\n const hasChanged = await codebaseIndex.hasChanged(relativePath);\n\n if (hasChanged) {\n // File changed - needs scanning\n await codebaseIndex.indexFile(relativePath);\n filesToScan.push(filePath);\n } else {\n // Check cache for all goals\n let foundCachedResult = false;\n\n for (const goal of goals) {\n const cached = codebaseIndex.getCachedViolations(relativePath, goal.id);\n if (cached && cached.length > 0) {\n const violation = cached[0];\n if (violation && violation.found) {\n cachedViolations.push({\n file: relativePath,\n message: `Goal \"${goal.description}\" violated: ${violation.details || 'Cached violation'} [${violation.confidence || 90}% confidence]`,\n severity: 'warning' as const,\n });\n }\n foundCachedResult = true;\n }\n }\n\n if (foundCachedResult) {\n cacheHits++;\n } else {\n // No cache for this file - needs scanning\n filesToScan.push(filePath);\n }\n }\n }\n\n return { cachedViolations, filesToScan, cacheHits };\n}\n\n/**\n * Smart batching that adjusts batch size based on cache performance\n */\nasync function analyzeWithSmartBatching(\n codebaseIndex: CodebaseIndex,\n filesToScan: string[],\n goals: Goal[],\n projectPath: string,\n onProgress?: (message: string) => void\n): Promise<any[]> {\n // Start with smaller batches for faster feedback\n const adaptiveBatchSize = Math.min(10, filesToScan.length);\n const totalBatches = Math.ceil(filesToScan.length / adaptiveBatchSize);\n\n const allViolations: any[] = [];\n\n for (let i = 0; i < totalBatches; i++) {\n const start = i * adaptiveBatchSize;\n const end = Math.min(start + adaptiveBatchSize, filesToScan.length);\n const batchFiles = filesToScan.slice(start, end);\n\n onProgress?.(`Fast analysis (${i + 1}/${totalBatches}): ${batchFiles.length} files...`);\n\n // Use existing analysis but with smaller batches\n const { checkFilesForGoalViolations } = await import('./goal-validator.js');\n const batchResults = await checkFilesForGoalViolations(\n goals,\n projectPath,\n batchFiles,\n undefined // Don't pass progress callback to avoid nested messages\n );\n\n allViolations.push(...batchResults);\n\n // Cache results immediately for next time\n for (const violation of batchResults) {\n const relativePath = violation.file.includes('/')\n ? violation.file.split('/').pop() || violation.file\n : violation.file;\n\n // Extract goal from violation message\n const goalMatch = violation.message.match(/Goal \"([^\"]+)\"/);\n if (goalMatch) {\n const goalDesc = goalMatch[1];\n const goal = goals.find(g => g.description === goalDesc);\n if (goal) {\n codebaseIndex.setCachedViolations(relativePath, goal.id, [{\n goalId: goal.id,\n goalDescription: goal.description,\n found: true,\n details: violation.message,\n confidence: 90,\n timestamp: Date.now()\n }]);\n }\n }\n }\n }\n\n return allViolations;\n}\n\n/**\n * Get analysis stats for debugging/monitoring\n */\nexport async function getAnalysisStats(projectPath: string): Promise<{\n indexedFiles: number;\n cacheSize: string;\n lastUpdated: string | null;\n}> {\n const codebaseIndex = new CodebaseIndex(projectPath);\n\n return {\n indexedFiles: codebaseIndex.getFileCount(),\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77PU.js";
|
|
7
|
+
import "./chunk-DGUM43GV.js";
|
|
8
|
+
export {
|
|
9
|
+
GitHubIngester
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=github-ingester-J2ZFYXVE.js.map
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
calculateAdaptiveScanFrequency,
|
|
5
5
|
clearGoalManagers,
|
|
6
6
|
getGoalManager
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YEIJW6X6.js";
|
|
8
8
|
import "./chunk-3MUCUZ46.js";
|
|
9
9
|
import "./chunk-LT6VUZG2.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-62POBLFC.js";
|
|
11
11
|
import "./chunk-4MJ52WBH.js";
|
|
12
12
|
import "./chunk-43X6JBEM.js";
|
|
13
13
|
import "./chunk-SH7H3WRU.js";
|
|
@@ -20,4 +20,4 @@ export {
|
|
|
20
20
|
clearGoalManagers,
|
|
21
21
|
getGoalManager
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=goal-manager-
|
|
23
|
+
//# sourceMappingURL=goal-manager-ZBWKWEML.js.map
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
measureInitialGoalValue,
|
|
5
5
|
recordGoalViolationCaught,
|
|
6
6
|
recordGoalViolationFixed
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-75ADWWUF.js";
|
|
8
8
|
import "./chunk-LT6VUZG2.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-62POBLFC.js";
|
|
10
10
|
import "./chunk-4MJ52WBH.js";
|
|
11
11
|
import "./chunk-43X6JBEM.js";
|
|
12
12
|
import "./chunk-SH7H3WRU.js";
|
|
@@ -19,4 +19,4 @@ export {
|
|
|
19
19
|
recordGoalViolationCaught,
|
|
20
20
|
recordGoalViolationFixed
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=goal-validator-
|
|
22
|
+
//# sourceMappingURL=goal-validator-HNXXUCPW.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ContextGraph
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FH335WL5.js";
|
|
4
4
|
import "./chunk-SH7H3WRU.js";
|
|
5
5
|
import "./chunk-APMV77PU.js";
|
|
6
6
|
import "./chunk-DGUM43GV.js";
|
|
7
7
|
export {
|
|
8
8
|
ContextGraph
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=graph-
|
|
10
|
+
//# sourceMappingURL=graph-J4OGTYCO.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
clearHypothesisEngines,
|
|
4
4
|
gatherEvidenceForHypothesis,
|
|
5
5
|
getHypothesisEngine
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XTTZAQWJ.js";
|
|
7
7
|
import "./chunk-3MUCUZ46.js";
|
|
8
8
|
import "./chunk-LT6VUZG2.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-62POBLFC.js";
|
|
10
10
|
import "./chunk-4MJ52WBH.js";
|
|
11
11
|
import "./chunk-43X6JBEM.js";
|
|
12
12
|
import "./chunk-SH7H3WRU.js";
|
|
@@ -18,4 +18,4 @@ export {
|
|
|
18
18
|
gatherEvidenceForHypothesis,
|
|
19
19
|
getHypothesisEngine
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=hypothesis-
|
|
21
|
+
//# sourceMappingURL=hypothesis-JCUMZKTG.js.map
|