@triedotdev/mcp 1.0.154 → 1.0.156

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 (115) hide show
  1. package/dist/{autonomy-config-RKLZW4XL.js → autonomy-config-FSERX3O3.js} +4 -4
  2. package/dist/{chat-store-O3IJ5PMN.js → chat-store-JNGNTDSN.js} +4 -4
  3. package/dist/{chunk-L4FODDDB.js → chunk-5BYSJ7XT.js} +2 -2
  4. package/dist/{chunk-LFNH3CSN.js → chunk-5TRCQAOE.js} +4 -4
  5. package/dist/{chunk-CBAMZERA.js → chunk-ACU2RJUJ.js} +2 -2
  6. package/dist/{chunk-LJISDV3A.js → chunk-CYKJIQNG.js} +13 -13
  7. package/dist/{chunk-EMJ7RVWB.js → chunk-EJKVKVWM.js} +18 -18
  8. package/dist/chunk-EJKVKVWM.js.map +1 -0
  9. package/dist/{chunk-ALSCZ7WR.js → chunk-FNZPMR62.js} +14 -3
  10. package/dist/chunk-FNZPMR62.js.map +1 -0
  11. package/dist/{chunk-UL337UDQ.js → chunk-FQ45QP5A.js} +2 -2
  12. package/dist/{chunk-FTOF3FHT.js → chunk-GDWA3CH3.js} +3 -3
  13. package/dist/{chunk-4ZAFQEP6.js → chunk-IRZXBQVQ.js} +4 -4
  14. package/dist/{chunk-3CYMLM35.js → chunk-JVMBCWKS.js} +2 -2
  15. package/dist/{chunk-JKEEQAG2.js → chunk-KDHN2ZQE.js} +2 -2
  16. package/dist/chunk-KDHN2ZQE.js.map +1 -0
  17. package/dist/{chunk-QAM5X5HM.js → chunk-LGDZXKC5.js} +107 -53
  18. package/dist/chunk-LGDZXKC5.js.map +1 -0
  19. package/dist/{chunk-NVZZUUEU.js → chunk-LR46VMIE.js} +5 -5
  20. package/dist/{chunk-XD2HKZVB.js → chunk-ME2OERF5.js} +2 -2
  21. package/dist/{chunk-FXZAABXO.js → chunk-OLNZJ3XV.js} +2 -2
  22. package/dist/{chunk-2LAJKFWU.js → chunk-OMR4YCBS.js} +2 -2
  23. package/dist/{chunk-OWSGJUUR.js → chunk-OMZSQAQ2.js} +6 -6
  24. package/dist/{chunk-YEQXKKZQ.js → chunk-Q5EKA5YA.js} +2 -2
  25. package/dist/{chunk-Z2E7X4WI.js → chunk-SSNOHUHY.js} +7 -7
  26. package/dist/{chunk-WO7CC5FH.js → chunk-SY6KQG44.js} +2 -2
  27. package/dist/{chunk-T7UAH7GE.js → chunk-T63OHG4Q.js} +2 -2
  28. package/dist/{chunk-KYKADM7P.js → chunk-TN5WEKWI.js} +2 -2
  29. package/dist/{chunk-KLMJKM63.js → chunk-VR4VWXXU.js} +3 -3
  30. package/dist/chunk-VR4VWXXU.js.map +1 -0
  31. package/dist/{chunk-JYWGYUKX.js → chunk-VUL52BQL.js} +6 -6
  32. package/dist/chunk-VUL52BQL.js.map +1 -0
  33. package/dist/{chunk-7F2R2ITA.js → chunk-VVITXIHN.js} +2 -2
  34. package/dist/{chunk-HD5H7YSW.js → chunk-Y4B3VEL7.js} +2 -2
  35. package/dist/{chunk-OVSYTWUU.js → chunk-ZBXW244P.js} +2 -2
  36. package/dist/cli/create-agent.js +2 -2
  37. package/dist/cli/main.js +86 -40
  38. package/dist/cli/main.js.map +1 -1
  39. package/dist/cli/yolo-daemon.js +39 -25
  40. package/dist/cli/yolo-daemon.js.map +1 -1
  41. package/dist/{client-ZHOLZTRW.js → client-NJPZE5JT.js} +4 -4
  42. package/dist/{codebase-index-N37NDF2A.js → codebase-index-VAPF32XX.js} +4 -4
  43. package/dist/{fast-analyzer-U6URGNQT.js → fast-analyzer-CRWPDN6C.js} +6 -6
  44. package/dist/github-ingester-TFBDUDIY.js +11 -0
  45. package/dist/{goal-manager-5QDITJKE.js → goal-manager-D6XKE3FY.js} +8 -8
  46. package/dist/{goal-validator-FU5QWDQT.js → goal-validator-4E5ZLCDH.js} +7 -7
  47. package/dist/graph-B3NA4S7I.js +10 -0
  48. package/dist/{hypothesis-JURDWVDC.js → hypothesis-RI3Q33JB.js} +8 -8
  49. package/dist/incident-index-EFNUSGWL.js +11 -0
  50. package/dist/index.js +29 -29
  51. package/dist/{insight-store-AMEP5PPF.js → insight-store-EC4PLSAW.js} +4 -4
  52. package/dist/{issue-store-RM3XLLKG.js → issue-store-DUR5UTYK.js} +5 -5
  53. package/dist/{ledger-PLE3C3X4.js → ledger-ZTR63P3L.js} +4 -4
  54. package/dist/linear-ingester-PLES2BRS.js +11 -0
  55. package/dist/{output-manager-FX4V7ERT.js → output-manager-JNMEAXFO.js} +3 -3
  56. package/dist/{progress-PAYTY7BF.js → progress-SRQ2V3BP.js} +2 -2
  57. package/dist/tiered-storage-SUYPBYJL.js +12 -0
  58. package/dist/trie-agent-GL3VQPCD.js +27 -0
  59. package/dist/{vibe-code-signatures-J4GD4JOV.js → vibe-code-signatures-F6URTBW3.js} +3 -3
  60. package/dist/{vulnerability-signatures-EIKOHFPK.js → vulnerability-signatures-T7SKHORW.js} +3 -3
  61. package/package.json +1 -1
  62. package/dist/chunk-ALSCZ7WR.js.map +0 -1
  63. package/dist/chunk-EMJ7RVWB.js.map +0 -1
  64. package/dist/chunk-JKEEQAG2.js.map +0 -1
  65. package/dist/chunk-JYWGYUKX.js.map +0 -1
  66. package/dist/chunk-KLMJKM63.js.map +0 -1
  67. package/dist/chunk-QAM5X5HM.js.map +0 -1
  68. package/dist/github-ingester-AR5A4RAC.js +0 -11
  69. package/dist/graph-JO7GG65P.js +0 -10
  70. package/dist/incident-index-7CAXUNTL.js +0 -11
  71. package/dist/linear-ingester-NHFMKJBZ.js +0 -11
  72. package/dist/tiered-storage-3TUUR3L2.js +0 -12
  73. package/dist/trie-agent-QHPS4C5Z.js +0 -27
  74. /package/dist/{autonomy-config-RKLZW4XL.js.map → autonomy-config-FSERX3O3.js.map} +0 -0
  75. /package/dist/{chat-store-O3IJ5PMN.js.map → chat-store-JNGNTDSN.js.map} +0 -0
  76. /package/dist/{chunk-L4FODDDB.js.map → chunk-5BYSJ7XT.js.map} +0 -0
  77. /package/dist/{chunk-LFNH3CSN.js.map → chunk-5TRCQAOE.js.map} +0 -0
  78. /package/dist/{chunk-CBAMZERA.js.map → chunk-ACU2RJUJ.js.map} +0 -0
  79. /package/dist/{chunk-LJISDV3A.js.map → chunk-CYKJIQNG.js.map} +0 -0
  80. /package/dist/{chunk-UL337UDQ.js.map → chunk-FQ45QP5A.js.map} +0 -0
  81. /package/dist/{chunk-FTOF3FHT.js.map → chunk-GDWA3CH3.js.map} +0 -0
  82. /package/dist/{chunk-4ZAFQEP6.js.map → chunk-IRZXBQVQ.js.map} +0 -0
  83. /package/dist/{chunk-3CYMLM35.js.map → chunk-JVMBCWKS.js.map} +0 -0
  84. /package/dist/{chunk-NVZZUUEU.js.map → chunk-LR46VMIE.js.map} +0 -0
  85. /package/dist/{chunk-XD2HKZVB.js.map → chunk-ME2OERF5.js.map} +0 -0
  86. /package/dist/{chunk-FXZAABXO.js.map → chunk-OLNZJ3XV.js.map} +0 -0
  87. /package/dist/{chunk-2LAJKFWU.js.map → chunk-OMR4YCBS.js.map} +0 -0
  88. /package/dist/{chunk-OWSGJUUR.js.map → chunk-OMZSQAQ2.js.map} +0 -0
  89. /package/dist/{chunk-YEQXKKZQ.js.map → chunk-Q5EKA5YA.js.map} +0 -0
  90. /package/dist/{chunk-Z2E7X4WI.js.map → chunk-SSNOHUHY.js.map} +0 -0
  91. /package/dist/{chunk-WO7CC5FH.js.map → chunk-SY6KQG44.js.map} +0 -0
  92. /package/dist/{chunk-T7UAH7GE.js.map → chunk-T63OHG4Q.js.map} +0 -0
  93. /package/dist/{chunk-KYKADM7P.js.map → chunk-TN5WEKWI.js.map} +0 -0
  94. /package/dist/{chunk-7F2R2ITA.js.map → chunk-VVITXIHN.js.map} +0 -0
  95. /package/dist/{chunk-HD5H7YSW.js.map → chunk-Y4B3VEL7.js.map} +0 -0
  96. /package/dist/{chunk-OVSYTWUU.js.map → chunk-ZBXW244P.js.map} +0 -0
  97. /package/dist/{client-ZHOLZTRW.js.map → client-NJPZE5JT.js.map} +0 -0
  98. /package/dist/{codebase-index-N37NDF2A.js.map → codebase-index-VAPF32XX.js.map} +0 -0
  99. /package/dist/{fast-analyzer-U6URGNQT.js.map → fast-analyzer-CRWPDN6C.js.map} +0 -0
  100. /package/dist/{github-ingester-AR5A4RAC.js.map → github-ingester-TFBDUDIY.js.map} +0 -0
  101. /package/dist/{goal-manager-5QDITJKE.js.map → goal-manager-D6XKE3FY.js.map} +0 -0
  102. /package/dist/{goal-validator-FU5QWDQT.js.map → goal-validator-4E5ZLCDH.js.map} +0 -0
  103. /package/dist/{graph-JO7GG65P.js.map → graph-B3NA4S7I.js.map} +0 -0
  104. /package/dist/{hypothesis-JURDWVDC.js.map → hypothesis-RI3Q33JB.js.map} +0 -0
  105. /package/dist/{incident-index-7CAXUNTL.js.map → incident-index-EFNUSGWL.js.map} +0 -0
  106. /package/dist/{insight-store-AMEP5PPF.js.map → insight-store-EC4PLSAW.js.map} +0 -0
  107. /package/dist/{issue-store-RM3XLLKG.js.map → issue-store-DUR5UTYK.js.map} +0 -0
  108. /package/dist/{ledger-PLE3C3X4.js.map → ledger-ZTR63P3L.js.map} +0 -0
  109. /package/dist/{linear-ingester-NHFMKJBZ.js.map → linear-ingester-PLES2BRS.js.map} +0 -0
  110. /package/dist/{output-manager-FX4V7ERT.js.map → output-manager-JNMEAXFO.js.map} +0 -0
  111. /package/dist/{progress-PAYTY7BF.js.map → progress-SRQ2V3BP.js.map} +0 -0
  112. /package/dist/{tiered-storage-3TUUR3L2.js.map → tiered-storage-SUYPBYJL.js.map} +0 -0
  113. /package/dist/{trie-agent-QHPS4C5Z.js.map → trie-agent-GL3VQPCD.js.map} +0 -0
  114. /package/dist/{vibe-code-signatures-J4GD4JOV.js.map → vibe-code-signatures-F6URTBW3.js.map} +0 -0
  115. /package/dist/{vulnerability-signatures-EIKOHFPK.js.map → vulnerability-signatures-T7SKHORW.js.map} +0 -0
@@ -3,41 +3,41 @@ import {
3
3
  InteractiveDashboard,
4
4
  StreamingManager,
5
5
  TrieWatchTool
6
- } from "../chunk-QAM5X5HM.js";
7
- import "../chunk-3CYMLM35.js";
8
- import "../chunk-LJISDV3A.js";
9
- import "../chunk-YEQXKKZQ.js";
10
- import "../chunk-KLMJKM63.js";
11
- import "../chunk-LFNH3CSN.js";
12
- import "../chunk-NVZZUUEU.js";
13
- import "../chunk-T7UAH7GE.js";
6
+ } from "../chunk-LGDZXKC5.js";
7
+ import "../chunk-JVMBCWKS.js";
8
+ import "../chunk-CYKJIQNG.js";
9
+ import "../chunk-Q5EKA5YA.js";
10
+ import "../chunk-VR4VWXXU.js";
11
+ import "../chunk-5TRCQAOE.js";
12
+ import "../chunk-LR46VMIE.js";
13
+ import "../chunk-T63OHG4Q.js";
14
14
  import {
15
15
  isTrieInitialized
16
- } from "../chunk-EMJ7RVWB.js";
17
- import "../chunk-FTOF3FHT.js";
18
- import "../chunk-KYKADM7P.js";
16
+ } from "../chunk-EJKVKVWM.js";
17
+ import "../chunk-GDWA3CH3.js";
18
+ import "../chunk-TN5WEKWI.js";
19
19
  import "../chunk-ZV2K6M7T.js";
20
- import "../chunk-OWSGJUUR.js";
21
- import "../chunk-JYWGYUKX.js";
22
- import "../chunk-Z2E7X4WI.js";
23
- import "../chunk-UL337UDQ.js";
24
- import "../chunk-L4FODDDB.js";
25
- import "../chunk-WO7CC5FH.js";
26
- import "../chunk-2LAJKFWU.js";
20
+ import "../chunk-OMZSQAQ2.js";
21
+ import "../chunk-VUL52BQL.js";
22
+ import "../chunk-SSNOHUHY.js";
23
+ import "../chunk-FQ45QP5A.js";
24
+ import "../chunk-5BYSJ7XT.js";
25
+ import "../chunk-SY6KQG44.js";
26
+ import "../chunk-OMR4YCBS.js";
27
27
  import "../chunk-6NLHFIYA.js";
28
- import "../chunk-ALSCZ7WR.js";
29
- import "../chunk-XD2HKZVB.js";
30
- import "../chunk-4ZAFQEP6.js";
28
+ import "../chunk-FNZPMR62.js";
29
+ import "../chunk-ME2OERF5.js";
30
+ import "../chunk-IRZXBQVQ.js";
31
31
  import "../chunk-EFWVF6TI.js";
32
- import "../chunk-HD5H7YSW.js";
32
+ import "../chunk-Y4B3VEL7.js";
33
33
  import "../chunk-43X6JBEM.js";
34
34
  import {
35
35
  getWorkingDirectory
36
- } from "../chunk-7F2R2ITA.js";
36
+ } from "../chunk-VVITXIHN.js";
37
37
  import {
38
38
  isInteractiveMode,
39
39
  setInteractiveMode
40
- } from "../chunk-JKEEQAG2.js";
40
+ } from "../chunk-KDHN2ZQE.js";
41
41
  import "../chunk-DGUM43GV.js";
42
42
 
43
43
  // src/cli/yolo-daemon.ts
@@ -95,7 +95,7 @@ var WatchDaemon = class {
95
95
  */
96
96
  async start() {
97
97
  const hasInteractiveTTY = process.stdout.isTTY === true && process.stdin.isTTY === true && typeof process.stdin.setRawMode === "function";
98
- if (this.config.interactive !== false && hasInteractiveTTY) {
98
+ if (this.config.interactive !== false && hasInteractiveTTY && !this.config.once) {
99
99
  setInteractiveMode(true);
100
100
  }
101
101
  if (!isTrieInitialized(this.config.directory)) {
@@ -105,6 +105,10 @@ var WatchDaemon = class {
105
105
  }
106
106
  process.exit(1);
107
107
  }
108
+ if (this.config.once) {
109
+ console.log("Pre-commit mode detected - hook should query ledger directly");
110
+ process.exit(0);
111
+ }
108
112
  this.log("info", "Starting Trie Watch", {
109
113
  directory: this.config.directory,
110
114
  debounceMs: this.config.debounceMs
@@ -344,6 +348,16 @@ function parseArgs() {
344
348
  break;
345
349
  case "--once":
346
350
  config2.interactive = false;
351
+ config2.once = true;
352
+ break;
353
+ case "--staged-only":
354
+ config2.stagedOnly = true;
355
+ break;
356
+ case "--fail-on":
357
+ if (nextArg && ["never", "critical", "serious"].includes(nextArg)) {
358
+ config2.failOn = nextArg;
359
+ i++;
360
+ }
347
361
  break;
348
362
  case "--workers":
349
363
  config2.workers = true;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cli/yolo-daemon.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Trie Watch - File Watcher\n * \n * Watches a directory for changes and checks for goal violations.\n * \n * Usage:\n * trie watch [options] # Watch for changes\n * \n * See `trie watch --help` for all options.\n */\n\nimport { watch, existsSync, statSync } from 'fs';\nimport { readdir } from 'fs/promises';\nimport { join, extname, basename, resolve } from 'path';\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';\nimport { TrieWatchTool } from '../tools/watch.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 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 /** 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 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 private trieWatchTool: TrieWatchTool;\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 this.trieWatchTool = new TrieWatchTool();\n }\n\n /**\n * Start the daemon\n */\n async start(): Promise<void> {\n // Enable global interactive mode only when:\n // 1. Both stdout AND stdin are TTY\n // 2. stdin supports setRawMode (required by Ink)\n // (git hooks/CI often have non-TTY stdin, and some terminals don't support raw mode)\n const hasInteractiveTTY =\n process.stdout.isTTY === true && \n process.stdin.isTTY === true &&\n typeof process.stdin.setRawMode === 'function';\n if (this.config.interactive !== false && hasInteractiveTTY) {\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 Watch', {\n directory: this.config.directory,\n debounceMs: this.config.debounceMs\n });\n if (!isInteractiveMode()) {\n console.error('\\nTrie is watching for goal violations.\\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: true,\n directories: 0,\n debounceMs: this.config.debounceMs\n });\n }\n\n // Initialize the TrieWatchTool for goal checking\n await this.trieWatchTool.execute({\n action: 'start',\n directory: this.config.directory,\n debounceMs: this.config.debounceMs\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 * 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 try {\n // Trigger goal violation checking via TrieWatchTool\n // The tool handles AI-powered goal checking, priority scoring, caching, etc.\n const result = await this.trieWatchTool.execute({\n action: 'status'\n });\n\n // Extract issues from the result\n const statusMatch = result.content?.[0]?.text?.match(/Issues Found: (\\d+)/);\n if (statusMatch && statusMatch[1]) {\n const issuesFound = parseInt(statusMatch[1], 10);\n this.stats.issuesFound += issuesFound;\n \n if (issuesFound > 0) {\n this.log('info', 'Goal violations detected', { \n count: issuesFound,\n files: files.length \n });\n }\n }\n } catch (error) {\n this.log('error', 'Failed to check for goal violations', { \n error: error instanceof Error ? error.message : String(error)\n });\n this.stats.errors++;\n }\n \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 async shutdown(signal: string): Promise<void> {\n this.log('info', 'Shutting down', { signal, stats: this.stats });\n\n // Stop the TrieWatchTool\n try {\n await this.trieWatchTool.execute({ action: 'stop' });\n } catch (error) {\n // Ignore errors during shutdown\n }\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 // 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 '--once':\n // One-shot mode (e.g. pre-commit hook): never use interactive dashboard\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 '--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 Watch - File Watcher\n\nUSAGE:\n trie watch [options] Watch for changes\n\nOPTIONS:\n --dir, -d <path> Directory to watch (default: current directory)\n --debounce, -D <ms> Debounce time in ms (default: 1000)\n --users, -u <count> User count for cost estimation (default: 250)\n\nOUTPUT:\n --json Output as JSON (for log aggregation)\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 watch --no-interactive # CI mode: watch without dashboard\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAAS,OAAO,YAAY,gBAAgB;AAC5C,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;AA2BD,IAAM,cAAN,MAAkB;AAAA,EACR;AAAA,EACA;AAAA,EACA,WAAkD,oBAAI,IAAI;AAAA,EAC1D,eAA4B,oBAAI,IAAI;AAAA,EACpC,gBAAuC;AAAA,EACvC,eAAe;AAAA,EACf,mBAAiD;AAAA,EACjD,YAA8C;AAAA,EAC9C;AAAA,EAER,YAAYA,SAAsB;AAChC,SAAK,SAASA;AACd,SAAK,QAAQ;AAAA,MACX,cAAc;AAAA,MACd,aAAa;AAAA,MACb,QAAQ;AAAA,MACR,WAAW,KAAK,IAAI;AAAA,IACtB;AACA,SAAK,gBAAgB,IAAI,cAAc;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,QAAuB;AAK3B,UAAM,oBACJ,QAAQ,OAAO,UAAU,QACzB,QAAQ,MAAM,UAAU,QACxB,OAAO,QAAQ,MAAM,eAAe;AACtC,QAAI,KAAK,OAAO,gBAAgB,SAAS,mBAAmB;AAC1D,yBAAmB,IAAI;AAAA,IACz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AAO,QAAQ,QAAQ,MAAM,GAAG,EAAE,IAAI,OAAK,EAAE,KAAK,CAAC,EAAE,OAAO,OAAO;AACnE;AAAA,QACF;AACA;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,CAqBnB;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\n * \n * Watches a directory for changes and checks for goal violations.\n * \n * Usage:\n * trie watch [options] # Watch for changes\n * \n * See `trie watch --help` for all options.\n */\n\nimport { watch, existsSync, statSync } from 'fs';\nimport { readdir } from 'fs/promises';\nimport { join, extname, basename, resolve } from 'path';\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';\nimport { TrieWatchTool } from '../tools/watch.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 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 /** User count for cost estimation (default: 250) */\n userCount?: number;\n /** Run once and exit (for pre-commit hooks) */\n once?: boolean;\n /** Only scan staged files (for pre-commit hooks) */\n stagedOnly?: boolean;\n /** Exit code to use on failure: 'never', 'critical', 'serious' */\n failOn?: 'never' | 'critical' | 'serious';\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 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 private trieWatchTool: TrieWatchTool;\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 this.trieWatchTool = new TrieWatchTool();\n }\n\n /**\n * Start the daemon\n */\n async start(): Promise<void> {\n // Enable global interactive mode only when:\n // 1. Both stdout AND stdin are TTY\n // 2. stdin supports setRawMode (required by Ink)\n // (git hooks/CI often have non-TTY stdin, and some terminals don't support raw mode)\n const hasInteractiveTTY =\n process.stdout.isTTY === true && \n process.stdin.isTTY === true &&\n typeof process.stdin.setRawMode === 'function';\n if (this.config.interactive !== false && hasInteractiveTTY && !this.config.once) {\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 // If in once mode (pre-commit hook), just exit - the hook itself queries the ledger\n if (this.config.once) {\n console.log('Pre-commit mode detected - hook should query ledger directly');\n process.exit(0);\n }\n\n this.log('info', 'Starting Trie Watch', {\n directory: this.config.directory,\n debounceMs: this.config.debounceMs\n });\n if (!isInteractiveMode()) {\n console.error('\\nTrie is watching for goal violations.\\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: true,\n directories: 0,\n debounceMs: this.config.debounceMs\n });\n }\n\n // Initialize the TrieWatchTool for goal checking\n await this.trieWatchTool.execute({\n action: 'start',\n directory: this.config.directory,\n debounceMs: this.config.debounceMs\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 * 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 try {\n // Trigger goal violation checking via TrieWatchTool\n // The tool handles AI-powered goal checking, priority scoring, caching, etc.\n const result = await this.trieWatchTool.execute({\n action: 'status'\n });\n\n // Extract issues from the result\n const statusMatch = result.content?.[0]?.text?.match(/Issues Found: (\\d+)/);\n if (statusMatch && statusMatch[1]) {\n const issuesFound = parseInt(statusMatch[1], 10);\n this.stats.issuesFound += issuesFound;\n \n if (issuesFound > 0) {\n this.log('info', 'Goal violations detected', { \n count: issuesFound,\n files: files.length \n });\n }\n }\n } catch (error) {\n this.log('error', 'Failed to check for goal violations', { \n error: error instanceof Error ? error.message : String(error)\n });\n this.stats.errors++;\n }\n \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 async shutdown(signal: string): Promise<void> {\n this.log('info', 'Shutting down', { signal, stats: this.stats });\n\n // Stop the TrieWatchTool\n try {\n await this.trieWatchTool.execute({ action: 'stop' });\n } catch (error) {\n // Ignore errors during shutdown\n }\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 // 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 '--once':\n // One-shot mode (e.g. pre-commit hook): never use interactive dashboard\n config.interactive = false;\n config.once = true;\n break;\n case '--staged-only':\n // Only check staged files (for pre-commit hooks)\n config.stagedOnly = true;\n break;\n case '--fail-on':\n if (nextArg && ['never', 'critical', 'serious'].includes(nextArg)) {\n config.failOn = nextArg as 'never' | 'critical' | 'serious';\n i++;\n }\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 '--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 Watch - File Watcher\n\nUSAGE:\n trie watch [options] Watch for changes\n\nOPTIONS:\n --dir, -d <path> Directory to watch (default: current directory)\n --debounce, -D <ms> Debounce time in ms (default: 1000)\n --users, -u <count> User count for cost estimation (default: 250)\n\nOUTPUT:\n --json Output as JSON (for log aggregation)\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 watch --no-interactive # CI mode: watch without dashboard\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAAS,OAAO,YAAY,gBAAgB;AAC5C,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;AAiCD,IAAM,cAAN,MAAkB;AAAA,EACR;AAAA,EACA;AAAA,EACA,WAAkD,oBAAI,IAAI;AAAA,EAC1D,eAA4B,oBAAI,IAAI;AAAA,EACpC,gBAAuC;AAAA,EACvC,eAAe;AAAA,EACf,mBAAiD;AAAA,EACjD,YAA8C;AAAA,EAC9C;AAAA,EAER,YAAYA,SAAsB;AAChC,SAAK,SAASA;AACd,SAAK,QAAQ;AAAA,MACX,cAAc;AAAA,MACd,aAAa;AAAA,MACb,QAAQ;AAAA,MACR,WAAW,KAAK,IAAI;AAAA,IACtB;AACA,SAAK,gBAAgB,IAAI,cAAc;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,QAAuB;AAK3B,UAAM,oBACJ,QAAQ,OAAO,UAAU,QACzB,QAAQ,MAAM,UAAU,QACxB,OAAO,QAAQ,MAAM,eAAe;AACtC,QAAI,KAAK,OAAO,gBAAgB,SAAS,qBAAqB,CAAC,KAAK,OAAO,MAAM;AAC/E,yBAAmB,IAAI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C,SAAS,YAAY,SAAS,EAAE,SAAS,OAAO,GAAG;AACjE,UAAAA,QAAO,SAAS;AAChB;AAAA,QACF;AACA;AAAA,MACF,KAAK;AACH,QAAAA,QAAO,UAAU;AACjB;AAAA,MACF,KAAK;AACH,QAAAA,QAAO,UAAU;AACjB;AAAA,MACF,KAAK;AACH,QAAAA,QAAO,YAAY,SAAS,WAAW,UAAU,EAAE;AACnD;AACA;AAAA,MACF,KAAK;AACH,YAAI,SAAS;AACX,UAAAA,QAAO,QAAQ,QAAQ,MAAM,GAAG,EAAE,IAAI,OAAK,EAAE,KAAK,CAAC,EAAE,OAAO,OAAO;AACnE;AAAA,QACF;AACA;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,CAqBnB;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,9 +9,9 @@ import {
9
9
  saveKeyToKeychain,
10
10
  setAPIKey,
11
11
  tryGetClient
12
- } from "./chunk-UL337UDQ.js";
13
- import "./chunk-7F2R2ITA.js";
14
- import "./chunk-JKEEQAG2.js";
12
+ } from "./chunk-FQ45QP5A.js";
13
+ import "./chunk-VVITXIHN.js";
14
+ import "./chunk-KDHN2ZQE.js";
15
15
  import "./chunk-DGUM43GV.js";
16
16
  export {
17
17
  analyzeCodeIssues,
@@ -25,4 +25,4 @@ export {
25
25
  setAPIKey,
26
26
  tryGetClient
27
27
  };
28
- //# sourceMappingURL=client-ZHOLZTRW.js.map
28
+ //# sourceMappingURL=client-NJPZE5JT.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  CodebaseIndex
3
- } from "./chunk-YEQXKKZQ.js";
3
+ } from "./chunk-Q5EKA5YA.js";
4
4
  import "./chunk-6NLHFIYA.js";
5
5
  import "./chunk-43X6JBEM.js";
6
- import "./chunk-7F2R2ITA.js";
7
- import "./chunk-JKEEQAG2.js";
6
+ import "./chunk-VVITXIHN.js";
7
+ import "./chunk-KDHN2ZQE.js";
8
8
  import "./chunk-DGUM43GV.js";
9
9
  export {
10
10
  CodebaseIndex
11
11
  };
12
- //# sourceMappingURL=codebase-index-N37NDF2A.js.map
12
+ //# sourceMappingURL=codebase-index-VAPF32XX.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  CodebaseIndex
3
- } from "./chunk-YEQXKKZQ.js";
3
+ } from "./chunk-Q5EKA5YA.js";
4
4
  import "./chunk-6NLHFIYA.js";
5
5
  import "./chunk-43X6JBEM.js";
6
- import "./chunk-7F2R2ITA.js";
7
- import "./chunk-JKEEQAG2.js";
6
+ import "./chunk-VVITXIHN.js";
7
+ import "./chunk-KDHN2ZQE.js";
8
8
  import "./chunk-DGUM43GV.js";
9
9
 
10
10
  // src/agent/fast-analyzer.ts
@@ -37,7 +37,7 @@ async function analyzeFilesRapidly(goals, projectPath, options = {}) {
37
37
  onProgress
38
38
  );
39
39
  } else {
40
- const { checkFilesForGoalViolations } = await import("./goal-validator-FU5QWDQT.js");
40
+ const { checkFilesForGoalViolations } = await import("./goal-validator-4E5ZLCDH.js");
41
41
  newViolations = await checkFilesForGoalViolations(
42
42
  goals,
43
43
  projectPath,
@@ -171,7 +171,7 @@ async function analyzeWithSmartBatching(codebaseIndex, filesToScan, goals, proje
171
171
  const end = Math.min(start + adaptiveBatchSize, filesToScan.length);
172
172
  const batchFiles = filesToScan.slice(start, end);
173
173
  onProgress?.(`Fast analysis (${i + 1}/${totalBatches}): ${batchFiles.length} files...`);
174
- const { checkFilesForGoalViolations } = await import("./goal-validator-FU5QWDQT.js");
174
+ const { checkFilesForGoalViolations } = await import("./goal-validator-4E5ZLCDH.js");
175
175
  const batchResults = await checkFilesForGoalViolations(
176
176
  goals,
177
177
  projectPath,
@@ -213,4 +213,4 @@ export {
213
213
  analyzeFilesRapidly,
214
214
  getAnalysisStats
215
215
  };
216
- //# sourceMappingURL=fast-analyzer-U6URGNQT.js.map
216
+ //# sourceMappingURL=fast-analyzer-CRWPDN6C.js.map
@@ -0,0 +1,11 @@
1
+ import {
2
+ GitHubIngester
3
+ } from "./chunk-ACU2RJUJ.js";
4
+ import "./chunk-GDWA3CH3.js";
5
+ import "./chunk-VVITXIHN.js";
6
+ import "./chunk-KDHN2ZQE.js";
7
+ import "./chunk-DGUM43GV.js";
8
+ export {
9
+ GitHubIngester
10
+ };
11
+ //# sourceMappingURL=github-ingester-TFBDUDIY.js.map
@@ -4,15 +4,15 @@ import {
4
4
  calculateAdaptiveScanFrequency,
5
5
  clearGoalManagers,
6
6
  getGoalManager
7
- } from "./chunk-LFNH3CSN.js";
8
- import "./chunk-T7UAH7GE.js";
9
- import "./chunk-L4FODDDB.js";
10
- import "./chunk-4ZAFQEP6.js";
7
+ } from "./chunk-5TRCQAOE.js";
8
+ import "./chunk-T63OHG4Q.js";
9
+ import "./chunk-5BYSJ7XT.js";
10
+ import "./chunk-IRZXBQVQ.js";
11
11
  import "./chunk-EFWVF6TI.js";
12
- import "./chunk-HD5H7YSW.js";
12
+ import "./chunk-Y4B3VEL7.js";
13
13
  import "./chunk-43X6JBEM.js";
14
- import "./chunk-7F2R2ITA.js";
15
- import "./chunk-JKEEQAG2.js";
14
+ import "./chunk-VVITXIHN.js";
15
+ import "./chunk-KDHN2ZQE.js";
16
16
  import "./chunk-DGUM43GV.js";
17
17
  export {
18
18
  GoalManager,
@@ -21,4 +21,4 @@ export {
21
21
  clearGoalManagers,
22
22
  getGoalManager
23
23
  };
24
- //# sourceMappingURL=goal-manager-5QDITJKE.js.map
24
+ //# sourceMappingURL=goal-manager-D6XKE3FY.js.map
@@ -4,14 +4,14 @@ import {
4
4
  measureInitialGoalValue,
5
5
  recordGoalViolationCaught,
6
6
  recordGoalViolationFixed
7
- } from "./chunk-Z2E7X4WI.js";
8
- import "./chunk-L4FODDDB.js";
9
- import "./chunk-4ZAFQEP6.js";
7
+ } from "./chunk-SSNOHUHY.js";
8
+ import "./chunk-5BYSJ7XT.js";
9
+ import "./chunk-IRZXBQVQ.js";
10
10
  import "./chunk-EFWVF6TI.js";
11
- import "./chunk-HD5H7YSW.js";
11
+ import "./chunk-Y4B3VEL7.js";
12
12
  import "./chunk-43X6JBEM.js";
13
- import "./chunk-7F2R2ITA.js";
14
- import "./chunk-JKEEQAG2.js";
13
+ import "./chunk-VVITXIHN.js";
14
+ import "./chunk-KDHN2ZQE.js";
15
15
  import "./chunk-DGUM43GV.js";
16
16
  export {
17
17
  checkFilesForGoalViolations,
@@ -20,4 +20,4 @@ export {
20
20
  recordGoalViolationCaught,
21
21
  recordGoalViolationFixed
22
22
  };
23
- //# sourceMappingURL=goal-validator-FU5QWDQT.js.map
23
+ //# sourceMappingURL=goal-validator-4E5ZLCDH.js.map
@@ -0,0 +1,10 @@
1
+ import {
2
+ ContextGraph
3
+ } from "./chunk-VUL52BQL.js";
4
+ import "./chunk-VVITXIHN.js";
5
+ import "./chunk-KDHN2ZQE.js";
6
+ import "./chunk-DGUM43GV.js";
7
+ export {
8
+ ContextGraph
9
+ };
10
+ //# sourceMappingURL=graph-B3NA4S7I.js.map
@@ -3,15 +3,15 @@ import {
3
3
  clearHypothesisEngines,
4
4
  gatherEvidenceForHypothesis,
5
5
  getHypothesisEngine
6
- } from "./chunk-NVZZUUEU.js";
7
- import "./chunk-T7UAH7GE.js";
8
- import "./chunk-L4FODDDB.js";
9
- import "./chunk-4ZAFQEP6.js";
6
+ } from "./chunk-LR46VMIE.js";
7
+ import "./chunk-T63OHG4Q.js";
8
+ import "./chunk-5BYSJ7XT.js";
9
+ import "./chunk-IRZXBQVQ.js";
10
10
  import "./chunk-EFWVF6TI.js";
11
- import "./chunk-HD5H7YSW.js";
11
+ import "./chunk-Y4B3VEL7.js";
12
12
  import "./chunk-43X6JBEM.js";
13
- import "./chunk-7F2R2ITA.js";
14
- import "./chunk-JKEEQAG2.js";
13
+ import "./chunk-VVITXIHN.js";
14
+ import "./chunk-KDHN2ZQE.js";
15
15
  import "./chunk-DGUM43GV.js";
16
16
  export {
17
17
  HypothesisEngine,
@@ -19,4 +19,4 @@ export {
19
19
  gatherEvidenceForHypothesis,
20
20
  getHypothesisEngine
21
21
  };
22
- //# sourceMappingURL=hypothesis-JURDWVDC.js.map
22
+ //# sourceMappingURL=hypothesis-RI3Q33JB.js.map
@@ -0,0 +1,11 @@
1
+ import {
2
+ IncidentIndex
3
+ } from "./chunk-TN5WEKWI.js";
4
+ import "./chunk-6NLHFIYA.js";
5
+ import "./chunk-VVITXIHN.js";
6
+ import "./chunk-KDHN2ZQE.js";
7
+ import "./chunk-DGUM43GV.js";
8
+ export {
9
+ IncidentIndex
10
+ };
11
+ //# sourceMappingURL=incident-index-EFNUSGWL.js.map
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  GitHubIngester
4
- } from "./chunk-CBAMZERA.js";
4
+ } from "./chunk-ACU2RJUJ.js";
5
5
  import {
6
6
  appendToSection,
7
7
  completeBootstrap,
@@ -19,10 +19,10 @@ import {
19
19
  needsBootstrap,
20
20
  projectInfoExists,
21
21
  updateProjectSection
22
- } from "./chunk-OVSYTWUU.js";
22
+ } from "./chunk-ZBXW244P.js";
23
23
  import {
24
24
  LinearIngester
25
- } from "./chunk-FXZAABXO.js";
25
+ } from "./chunk-OLNZJ3XV.js";
26
26
  import {
27
27
  GitHubBranchesTool,
28
28
  TrieCheckTool,
@@ -42,44 +42,44 @@ import {
42
42
  getPrompt,
43
43
  getSystemPrompt,
44
44
  handleCheckpointTool
45
- } from "./chunk-QAM5X5HM.js";
46
- import "./chunk-3CYMLM35.js";
47
- import "./chunk-LJISDV3A.js";
45
+ } from "./chunk-LGDZXKC5.js";
46
+ import "./chunk-JVMBCWKS.js";
47
+ import "./chunk-CYKJIQNG.js";
48
48
  import {
49
49
  CodebaseIndex
50
- } from "./chunk-YEQXKKZQ.js";
51
- import "./chunk-KLMJKM63.js";
52
- import "./chunk-LFNH3CSN.js";
53
- import "./chunk-NVZZUUEU.js";
54
- import "./chunk-T7UAH7GE.js";
50
+ } from "./chunk-Q5EKA5YA.js";
51
+ import "./chunk-VR4VWXXU.js";
52
+ import "./chunk-5TRCQAOE.js";
53
+ import "./chunk-LR46VMIE.js";
54
+ import "./chunk-T63OHG4Q.js";
55
55
  import {
56
56
  exportToJson,
57
57
  formatFriendlyError,
58
58
  importFromJson,
59
59
  isTrieInitialized
60
- } from "./chunk-EMJ7RVWB.js";
60
+ } from "./chunk-EJKVKVWM.js";
61
61
  import {
62
62
  loadConfig
63
- } from "./chunk-FTOF3FHT.js";
64
- import "./chunk-KYKADM7P.js";
63
+ } from "./chunk-GDWA3CH3.js";
64
+ import "./chunk-TN5WEKWI.js";
65
65
  import "./chunk-ZV2K6M7T.js";
66
66
  import {
67
67
  findCrossProjectPatterns,
68
68
  getGlobalMemoryStats,
69
69
  listTrackedProjects,
70
70
  searchGlobalPatterns
71
- } from "./chunk-OWSGJUUR.js";
71
+ } from "./chunk-OMZSQAQ2.js";
72
72
  import {
73
73
  ContextGraph
74
- } from "./chunk-JYWGYUKX.js";
75
- import "./chunk-Z2E7X4WI.js";
76
- import "./chunk-UL337UDQ.js";
77
- import "./chunk-L4FODDDB.js";
78
- import "./chunk-WO7CC5FH.js";
79
- import "./chunk-2LAJKFWU.js";
74
+ } from "./chunk-VUL52BQL.js";
75
+ import "./chunk-SSNOHUHY.js";
76
+ import "./chunk-FQ45QP5A.js";
77
+ import "./chunk-5BYSJ7XT.js";
78
+ import "./chunk-SY6KQG44.js";
79
+ import "./chunk-OMR4YCBS.js";
80
80
  import "./chunk-6NLHFIYA.js";
81
- import "./chunk-ALSCZ7WR.js";
82
- import "./chunk-XD2HKZVB.js";
81
+ import "./chunk-FNZPMR62.js";
82
+ import "./chunk-ME2OERF5.js";
83
83
  import {
84
84
  findSimilarIssues,
85
85
  getMemoryStats,
@@ -87,19 +87,19 @@ import {
87
87
  markIssueResolved,
88
88
  purgeIssues,
89
89
  searchIssues
90
- } from "./chunk-4ZAFQEP6.js";
90
+ } from "./chunk-IRZXBQVQ.js";
91
91
  import "./chunk-EFWVF6TI.js";
92
92
  import {
93
93
  runShellCommandSync
94
- } from "./chunk-HD5H7YSW.js";
94
+ } from "./chunk-Y4B3VEL7.js";
95
95
  import "./chunk-43X6JBEM.js";
96
96
  import {
97
97
  getTrieDirectory,
98
98
  getWorkingDirectory
99
- } from "./chunk-7F2R2ITA.js";
99
+ } from "./chunk-VVITXIHN.js";
100
100
  import {
101
101
  isInteractiveMode
102
- } from "./chunk-JKEEQAG2.js";
102
+ } from "./chunk-KDHN2ZQE.js";
103
103
  import "./chunk-DGUM43GV.js";
104
104
 
105
105
  // src/server/mcp-server.ts
@@ -3243,8 +3243,8 @@ This information is automatically available to Claude Code, Cursor, and other AI
3243
3243
  }
3244
3244
  }
3245
3245
  async getSignaturesResource(uri) {
3246
- const { getVulnerabilityStats } = await import("./vulnerability-signatures-EIKOHFPK.js");
3247
- const { getVibeCodeStats } = await import("./vibe-code-signatures-J4GD4JOV.js");
3246
+ const { getVulnerabilityStats } = await import("./vulnerability-signatures-T7SKHORW.js");
3247
+ const { getVibeCodeStats } = await import("./vibe-code-signatures-F6URTBW3.js");
3248
3248
  const vulnStats = getVulnerabilityStats();
3249
3249
  const vibeStats = getVibeCodeStats();
3250
3250
  return {
@@ -5,11 +5,11 @@ import {
5
5
  InsightStoreDataSchema,
6
6
  clearInsightStores,
7
7
  getInsightStore
8
- } from "./chunk-T7UAH7GE.js";
8
+ } from "./chunk-T63OHG4Q.js";
9
9
  import "./chunk-EFWVF6TI.js";
10
10
  import "./chunk-43X6JBEM.js";
11
- import "./chunk-7F2R2ITA.js";
12
- import "./chunk-JKEEQAG2.js";
11
+ import "./chunk-VVITXIHN.js";
12
+ import "./chunk-KDHN2ZQE.js";
13
13
  import "./chunk-DGUM43GV.js";
14
14
  export {
15
15
  InsightDetailsSchema,
@@ -19,4 +19,4 @@ export {
19
19
  clearInsightStores,
20
20
  getInsightStore
21
21
  };
22
- //# sourceMappingURL=insight-store-AMEP5PPF.js.map
22
+ //# sourceMappingURL=insight-store-EC4PLSAW.js.map
@@ -11,12 +11,12 @@ import {
11
11
  resolveGoalViolation,
12
12
  searchIssues,
13
13
  storeIssues
14
- } from "./chunk-4ZAFQEP6.js";
14
+ } from "./chunk-IRZXBQVQ.js";
15
15
  import "./chunk-EFWVF6TI.js";
16
- import "./chunk-HD5H7YSW.js";
16
+ import "./chunk-Y4B3VEL7.js";
17
17
  import "./chunk-43X6JBEM.js";
18
- import "./chunk-7F2R2ITA.js";
19
- import "./chunk-JKEEQAG2.js";
18
+ import "./chunk-VVITXIHN.js";
19
+ import "./chunk-KDHN2ZQE.js";
20
20
  import "./chunk-DGUM43GV.js";
21
21
  export {
22
22
  autoResolveIssues,
@@ -32,4 +32,4 @@ export {
32
32
  searchIssues,
33
33
  storeIssues
34
34
  };
35
- //# sourceMappingURL=issue-store-RM3XLLKG.js.map
35
+ //# sourceMappingURL=issue-store-DUR5UTYK.js.map
@@ -20,10 +20,10 @@ import {
20
20
  verifyBlockSignatures,
21
21
  verifyLedger,
22
22
  verifyLedgerEntry
23
- } from "./chunk-HD5H7YSW.js";
23
+ } from "./chunk-Y4B3VEL7.js";
24
24
  import "./chunk-43X6JBEM.js";
25
- import "./chunk-7F2R2ITA.js";
26
- import "./chunk-JKEEQAG2.js";
25
+ import "./chunk-VVITXIHN.js";
26
+ import "./chunk-KDHN2ZQE.js";
27
27
  import "./chunk-DGUM43GV.js";
28
28
  export {
29
29
  appendIssuesToLedger,
@@ -48,4 +48,4 @@ export {
48
48
  verifyLedger,
49
49
  verifyLedgerEntry
50
50
  };
51
- //# sourceMappingURL=ledger-PLE3C3X4.js.map
51
+ //# sourceMappingURL=ledger-ZTR63P3L.js.map
@@ -0,0 +1,11 @@
1
+ import {
2
+ LinearIngester
3
+ } from "./chunk-OLNZJ3XV.js";
4
+ import "./chunk-GDWA3CH3.js";
5
+ import "./chunk-VVITXIHN.js";
6
+ import "./chunk-KDHN2ZQE.js";
7
+ import "./chunk-DGUM43GV.js";
8
+ export {
9
+ LinearIngester
10
+ };
11
+ //# sourceMappingURL=linear-ingester-PLES2BRS.js.map
@@ -2,12 +2,12 @@ import {
2
2
  getOutputManager,
3
3
  output,
4
4
  resetOutputManager
5
- } from "./chunk-KLMJKM63.js";
6
- import "./chunk-JKEEQAG2.js";
5
+ } from "./chunk-VR4VWXXU.js";
6
+ import "./chunk-KDHN2ZQE.js";
7
7
  import "./chunk-DGUM43GV.js";
8
8
  export {
9
9
  getOutputManager,
10
10
  output,
11
11
  resetOutputManager
12
12
  };
13
- //# sourceMappingURL=output-manager-FX4V7ERT.js.map
13
+ //# sourceMappingURL=output-manager-JNMEAXFO.js.map
@@ -5,7 +5,7 @@ import {
5
5
  isInteractiveMode,
6
6
  resetProgressReporter,
7
7
  setInteractiveMode
8
- } from "./chunk-JKEEQAG2.js";
8
+ } from "./chunk-KDHN2ZQE.js";
9
9
  import "./chunk-DGUM43GV.js";
10
10
  export {
11
11
  AgentProgressReporter,
@@ -15,4 +15,4 @@ export {
15
15
  resetProgressReporter,
16
16
  setInteractiveMode
17
17
  };
18
- //# sourceMappingURL=progress-PAYTY7BF.js.map
18
+ //# sourceMappingURL=progress-SRQ2V3BP.js.map