@triedotdev/mcp 1.0.151 → 1.0.155

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 (114) hide show
  1. package/README.md +34 -6
  2. package/dist/{autonomy-config-3APNC6QF.js → autonomy-config-RKLZW4XL.js} +4 -4
  3. package/dist/{chat-store-HMTDL7I2.js → chat-store-O3IJ5PMN.js} +4 -4
  4. package/dist/{chunk-IXO4G4D3.js → chunk-2LAJKFWU.js} +2 -2
  5. package/dist/{chunk-F7BMFOZ6.js → chunk-3CYMLM35.js} +2 -2
  6. package/dist/{chunk-ED7PLRQA.js → chunk-4ZAFQEP6.js} +4 -4
  7. package/dist/{chunk-4TQQP7JD.js → chunk-7F2R2ITA.js} +2 -2
  8. package/dist/{chunk-SU3WCAC4.js → chunk-BUA5PQJY.js} +1487 -49
  9. package/dist/chunk-BUA5PQJY.js.map +1 -0
  10. package/dist/{chunk-V3O7C2LY.js → chunk-CBAMZERA.js} +2 -2
  11. package/dist/{chunk-G7Q23IGF.js → chunk-EMJ7RVWB.js} +9 -9
  12. package/dist/{chunk-TU7D5DEW.js → chunk-FTOF3FHT.js} +3 -3
  13. package/dist/{chunk-3KZBC3RJ.js → chunk-FXZAABXO.js} +2 -2
  14. package/dist/{chunk-TWPX6PHF.js → chunk-HD5H7YSW.js} +2 -2
  15. package/dist/{chunk-APMV77PU.js → chunk-JKEEQAG2.js} +1 -1
  16. package/dist/chunk-JKEEQAG2.js.map +1 -0
  17. package/dist/{chunk-TWQPOVRA.js → chunk-JYWGYUKX.js} +2 -2
  18. package/dist/{chunk-TIMIKBY2.js → chunk-KLMJKM63.js} +2 -2
  19. package/dist/{chunk-TCNCNWGV.js → chunk-KYKADM7P.js} +2 -2
  20. package/dist/{chunk-GLY76TSI.js → chunk-L4FODDDB.js} +2 -2
  21. package/dist/{chunk-JIS2OCZR.js → chunk-LFNH3CSN.js} +4 -4
  22. package/dist/{chunk-74R4XSFB.js → chunk-NVZZUUEU.js} +5 -5
  23. package/dist/{chunk-REHKDCI6.js → chunk-OVSYTWUU.js} +2 -2
  24. package/dist/{chunk-IFBEAOHH.js → chunk-RY57G46E.js} +6 -6
  25. package/dist/{chunk-ABY2R7OK.js → chunk-T7UAH7GE.js} +2 -2
  26. package/dist/{chunk-OJXFQRUE.js → chunk-UL337UDQ.js} +2 -2
  27. package/dist/{chunk-F4NJ4CBP.js → chunk-WO7CC5FH.js} +2 -2
  28. package/dist/{chunk-4UDBGYI3.js → chunk-X64XFVAY.js} +13 -13
  29. package/dist/{chunk-QQG42HCI.js → chunk-XD2HKZVB.js} +2 -2
  30. package/dist/{chunk-LNUMECBJ.js → chunk-XUGUKSKO.js} +10 -2
  31. package/dist/chunk-XUGUKSKO.js.map +1 -0
  32. package/dist/{chunk-WOTLY5NA.js → chunk-YEQXKKZQ.js} +2 -2
  33. package/dist/{chunk-7HYOJ4Q7.js → chunk-Z2E7X4WI.js} +7 -7
  34. package/dist/cli/create-agent.js +2 -2
  35. package/dist/cli/main.js +86 -40
  36. package/dist/cli/main.js.map +1 -1
  37. package/dist/cli/yolo-daemon.js +78 -27
  38. package/dist/cli/yolo-daemon.js.map +1 -1
  39. package/dist/{client-5L64D5SQ.js → client-ZHOLZTRW.js} +4 -4
  40. package/dist/{codebase-index-OOE7OAHP.js → codebase-index-N37NDF2A.js} +4 -4
  41. package/dist/{fast-analyzer-FMU3X4AZ.js → fast-analyzer-U6URGNQT.js} +6 -6
  42. package/dist/github-ingester-AR5A4RAC.js +11 -0
  43. package/dist/{goal-manager-VTBFFYN4.js → goal-manager-5QDITJKE.js} +8 -8
  44. package/dist/{goal-validator-EM5XVWVC.js → goal-validator-FU5QWDQT.js} +7 -7
  45. package/dist/graph-JO7GG65P.js +10 -0
  46. package/dist/{hypothesis-4UPE7KXU.js → hypothesis-JURDWVDC.js} +8 -8
  47. package/dist/incident-index-7CAXUNTL.js +11 -0
  48. package/dist/index.js +57 -1466
  49. package/dist/index.js.map +1 -1
  50. package/dist/{insight-store-QEEUQR5L.js → insight-store-AMEP5PPF.js} +4 -4
  51. package/dist/{issue-store-C6XYENE5.js → issue-store-RM3XLLKG.js} +5 -5
  52. package/dist/{ledger-VNA4DX3Z.js → ledger-PLE3C3X4.js} +4 -4
  53. package/dist/linear-ingester-NHFMKJBZ.js +11 -0
  54. package/dist/{output-manager-DZO5LGSG.js → output-manager-FX4V7ERT.js} +3 -3
  55. package/dist/{progress-PQVEM7BR.js → progress-PAYTY7BF.js} +2 -2
  56. package/dist/tiered-storage-SQDVZM2M.js +12 -0
  57. package/dist/trie-agent-TLOJ2UFS.js +27 -0
  58. package/dist/{vibe-code-signatures-ELEWJFGZ.js → vibe-code-signatures-J4GD4JOV.js} +3 -3
  59. package/dist/{vulnerability-signatures-EIJQX2TS.js → vulnerability-signatures-EIKOHFPK.js} +3 -3
  60. package/package.json +1 -1
  61. package/dist/chunk-APMV77PU.js.map +0 -1
  62. package/dist/chunk-LNUMECBJ.js.map +0 -1
  63. package/dist/chunk-SU3WCAC4.js.map +0 -1
  64. package/dist/github-ingester-C66ZRUYC.js +0 -11
  65. package/dist/graph-26JPZ3DF.js +0 -10
  66. package/dist/incident-index-H6APJ4S3.js +0 -11
  67. package/dist/linear-ingester-WIUBWF55.js +0 -11
  68. package/dist/tiered-storage-P6Z3NV2Q.js +0 -12
  69. package/dist/trie-agent-GJJJCL6P.js +0 -27
  70. /package/dist/{autonomy-config-3APNC6QF.js.map → autonomy-config-RKLZW4XL.js.map} +0 -0
  71. /package/dist/{chat-store-HMTDL7I2.js.map → chat-store-O3IJ5PMN.js.map} +0 -0
  72. /package/dist/{chunk-IXO4G4D3.js.map → chunk-2LAJKFWU.js.map} +0 -0
  73. /package/dist/{chunk-F7BMFOZ6.js.map → chunk-3CYMLM35.js.map} +0 -0
  74. /package/dist/{chunk-ED7PLRQA.js.map → chunk-4ZAFQEP6.js.map} +0 -0
  75. /package/dist/{chunk-4TQQP7JD.js.map → chunk-7F2R2ITA.js.map} +0 -0
  76. /package/dist/{chunk-V3O7C2LY.js.map → chunk-CBAMZERA.js.map} +0 -0
  77. /package/dist/{chunk-G7Q23IGF.js.map → chunk-EMJ7RVWB.js.map} +0 -0
  78. /package/dist/{chunk-TU7D5DEW.js.map → chunk-FTOF3FHT.js.map} +0 -0
  79. /package/dist/{chunk-3KZBC3RJ.js.map → chunk-FXZAABXO.js.map} +0 -0
  80. /package/dist/{chunk-TWPX6PHF.js.map → chunk-HD5H7YSW.js.map} +0 -0
  81. /package/dist/{chunk-TWQPOVRA.js.map → chunk-JYWGYUKX.js.map} +0 -0
  82. /package/dist/{chunk-TIMIKBY2.js.map → chunk-KLMJKM63.js.map} +0 -0
  83. /package/dist/{chunk-TCNCNWGV.js.map → chunk-KYKADM7P.js.map} +0 -0
  84. /package/dist/{chunk-GLY76TSI.js.map → chunk-L4FODDDB.js.map} +0 -0
  85. /package/dist/{chunk-JIS2OCZR.js.map → chunk-LFNH3CSN.js.map} +0 -0
  86. /package/dist/{chunk-74R4XSFB.js.map → chunk-NVZZUUEU.js.map} +0 -0
  87. /package/dist/{chunk-REHKDCI6.js.map → chunk-OVSYTWUU.js.map} +0 -0
  88. /package/dist/{chunk-IFBEAOHH.js.map → chunk-RY57G46E.js.map} +0 -0
  89. /package/dist/{chunk-ABY2R7OK.js.map → chunk-T7UAH7GE.js.map} +0 -0
  90. /package/dist/{chunk-OJXFQRUE.js.map → chunk-UL337UDQ.js.map} +0 -0
  91. /package/dist/{chunk-F4NJ4CBP.js.map → chunk-WO7CC5FH.js.map} +0 -0
  92. /package/dist/{chunk-4UDBGYI3.js.map → chunk-X64XFVAY.js.map} +0 -0
  93. /package/dist/{chunk-QQG42HCI.js.map → chunk-XD2HKZVB.js.map} +0 -0
  94. /package/dist/{chunk-WOTLY5NA.js.map → chunk-YEQXKKZQ.js.map} +0 -0
  95. /package/dist/{chunk-7HYOJ4Q7.js.map → chunk-Z2E7X4WI.js.map} +0 -0
  96. /package/dist/{client-5L64D5SQ.js.map → client-ZHOLZTRW.js.map} +0 -0
  97. /package/dist/{codebase-index-OOE7OAHP.js.map → codebase-index-N37NDF2A.js.map} +0 -0
  98. /package/dist/{fast-analyzer-FMU3X4AZ.js.map → fast-analyzer-U6URGNQT.js.map} +0 -0
  99. /package/dist/{github-ingester-C66ZRUYC.js.map → github-ingester-AR5A4RAC.js.map} +0 -0
  100. /package/dist/{goal-manager-VTBFFYN4.js.map → goal-manager-5QDITJKE.js.map} +0 -0
  101. /package/dist/{goal-validator-EM5XVWVC.js.map → goal-validator-FU5QWDQT.js.map} +0 -0
  102. /package/dist/{graph-26JPZ3DF.js.map → graph-JO7GG65P.js.map} +0 -0
  103. /package/dist/{hypothesis-4UPE7KXU.js.map → hypothesis-JURDWVDC.js.map} +0 -0
  104. /package/dist/{incident-index-H6APJ4S3.js.map → incident-index-7CAXUNTL.js.map} +0 -0
  105. /package/dist/{insight-store-QEEUQR5L.js.map → insight-store-AMEP5PPF.js.map} +0 -0
  106. /package/dist/{issue-store-C6XYENE5.js.map → issue-store-RM3XLLKG.js.map} +0 -0
  107. /package/dist/{ledger-VNA4DX3Z.js.map → ledger-PLE3C3X4.js.map} +0 -0
  108. /package/dist/{linear-ingester-WIUBWF55.js.map → linear-ingester-NHFMKJBZ.js.map} +0 -0
  109. /package/dist/{output-manager-DZO5LGSG.js.map → output-manager-FX4V7ERT.js.map} +0 -0
  110. /package/dist/{progress-PQVEM7BR.js.map → progress-PAYTY7BF.js.map} +0 -0
  111. /package/dist/{tiered-storage-P6Z3NV2Q.js.map → tiered-storage-SQDVZM2M.js.map} +0 -0
  112. /package/dist/{trie-agent-GJJJCL6P.js.map → trie-agent-TLOJ2UFS.js.map} +0 -0
  113. /package/dist/{vibe-code-signatures-ELEWJFGZ.js.map → vibe-code-signatures-J4GD4JOV.js.map} +0 -0
  114. /package/dist/{vulnerability-signatures-EIJQX2TS.js.map → vulnerability-signatures-EIKOHFPK.js.map} +0 -0
@@ -1,41 +1,43 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  InteractiveDashboard,
4
- StreamingManager
5
- } from "../chunk-SU3WCAC4.js";
6
- import "../chunk-F7BMFOZ6.js";
7
- import "../chunk-4UDBGYI3.js";
8
- import "../chunk-TIMIKBY2.js";
9
- import "../chunk-JIS2OCZR.js";
10
- import "../chunk-74R4XSFB.js";
11
- import "../chunk-ABY2R7OK.js";
4
+ StreamingManager,
5
+ TrieWatchTool
6
+ } from "../chunk-BUA5PQJY.js";
7
+ import "../chunk-3CYMLM35.js";
8
+ import "../chunk-X64XFVAY.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";
12
14
  import {
13
15
  isTrieInitialized
14
- } from "../chunk-G7Q23IGF.js";
15
- import "../chunk-TU7D5DEW.js";
16
- import "../chunk-TCNCNWGV.js";
16
+ } from "../chunk-EMJ7RVWB.js";
17
+ import "../chunk-FTOF3FHT.js";
18
+ import "../chunk-KYKADM7P.js";
17
19
  import "../chunk-ZV2K6M7T.js";
18
- import "../chunk-IFBEAOHH.js";
19
- import "../chunk-TWQPOVRA.js";
20
- import "../chunk-7HYOJ4Q7.js";
21
- import "../chunk-OJXFQRUE.js";
22
- import "../chunk-GLY76TSI.js";
23
- import "../chunk-F4NJ4CBP.js";
24
- import "../chunk-IXO4G4D3.js";
20
+ import "../chunk-RY57G46E.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";
25
27
  import "../chunk-6NLHFIYA.js";
26
- import "../chunk-LNUMECBJ.js";
27
- import "../chunk-QQG42HCI.js";
28
- import "../chunk-ED7PLRQA.js";
28
+ import "../chunk-XUGUKSKO.js";
29
+ import "../chunk-XD2HKZVB.js";
30
+ import "../chunk-4ZAFQEP6.js";
29
31
  import "../chunk-EFWVF6TI.js";
30
- import "../chunk-TWPX6PHF.js";
32
+ import "../chunk-HD5H7YSW.js";
31
33
  import "../chunk-43X6JBEM.js";
32
34
  import {
33
35
  getWorkingDirectory
34
- } from "../chunk-4TQQP7JD.js";
36
+ } from "../chunk-7F2R2ITA.js";
35
37
  import {
36
38
  isInteractiveMode,
37
39
  setInteractiveMode
38
- } from "../chunk-APMV77PU.js";
40
+ } from "../chunk-JKEEQAG2.js";
39
41
  import "../chunk-DGUM43GV.js";
40
42
 
41
43
  // src/cli/yolo-daemon.ts
@@ -77,6 +79,7 @@ var WatchDaemon = class {
77
79
  isProcessing = false;
78
80
  streamingManager = void 0;
79
81
  dashboard = void 0;
82
+ trieWatchTool;
80
83
  constructor(config2) {
81
84
  this.config = config2;
82
85
  this.stats = {
@@ -85,12 +88,14 @@ var WatchDaemon = class {
85
88
  errors: 0,
86
89
  startTime: Date.now()
87
90
  };
91
+ this.trieWatchTool = new TrieWatchTool();
88
92
  }
89
93
  /**
90
94
  * Start the daemon
91
95
  */
92
96
  async start() {
93
- if (this.config.interactive !== false && process.stdout.isTTY) {
97
+ const hasInteractiveTTY = process.stdout.isTTY === true && process.stdin.isTTY === true && typeof process.stdin.setRawMode === "function";
98
+ if (this.config.interactive !== false && hasInteractiveTTY && !this.config.once) {
94
99
  setInteractiveMode(true);
95
100
  }
96
101
  if (!isTrieInitialized(this.config.directory)) {
@@ -100,6 +105,10 @@ var WatchDaemon = class {
100
105
  }
101
106
  process.exit(1);
102
107
  }
108
+ if (this.config.once) {
109
+ console.log("Pre-commit mode detected - hook should query ledger directly");
110
+ process.exit(0);
111
+ }
103
112
  this.log("info", "Starting Trie Watch", {
104
113
  directory: this.config.directory,
105
114
  debounceMs: this.config.debounceMs
@@ -122,6 +131,11 @@ var WatchDaemon = class {
122
131
  debounceMs: this.config.debounceMs
123
132
  });
124
133
  }
134
+ await this.trieWatchTool.execute({
135
+ action: "start",
136
+ directory: this.config.directory,
137
+ debounceMs: this.config.debounceMs
138
+ });
125
139
  await this.watchDirectory(this.config.directory);
126
140
  this.streamingManager?.reportWatchStatus({
127
141
  watching: true,
@@ -187,7 +201,27 @@ var WatchDaemon = class {
187
201
  count: files.length,
188
202
  files: files.map((f) => basename(f))
189
203
  });
190
- this.log("info", "File changes detected", { files: files.length });
204
+ try {
205
+ const result = await this.trieWatchTool.execute({
206
+ action: "status"
207
+ });
208
+ const statusMatch = result.content?.[0]?.text?.match(/Issues Found: (\d+)/);
209
+ if (statusMatch && statusMatch[1]) {
210
+ const issuesFound = parseInt(statusMatch[1], 10);
211
+ this.stats.issuesFound += issuesFound;
212
+ if (issuesFound > 0) {
213
+ this.log("info", "Goal violations detected", {
214
+ count: issuesFound,
215
+ files: files.length
216
+ });
217
+ }
218
+ }
219
+ } catch (error) {
220
+ this.log("error", "Failed to check for goal violations", {
221
+ error: error instanceof Error ? error.message : String(error)
222
+ });
223
+ this.stats.errors++;
224
+ }
191
225
  this.isProcessing = false;
192
226
  }
193
227
  /**
@@ -217,8 +251,12 @@ var WatchDaemon = class {
217
251
  /**
218
252
  * Graceful shutdown
219
253
  */
220
- shutdown(signal) {
254
+ async shutdown(signal) {
221
255
  this.log("info", "Shutting down", { signal, stats: this.stats });
256
+ try {
257
+ await this.trieWatchTool.execute({ action: "stop" });
258
+ } catch (error) {
259
+ }
222
260
  for (const watcher of this.watchers.values()) {
223
261
  watcher.close();
224
262
  }
@@ -308,6 +346,19 @@ function parseArgs() {
308
346
  case "--no-interactive":
309
347
  config2.interactive = false;
310
348
  break;
349
+ case "--once":
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
+ }
361
+ break;
311
362
  case "--workers":
312
363
  config2.workers = true;
313
364
  break;
@@ -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';\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\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 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 // 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 // TODO: Check for goal violations\n // For now, just log that files changed\n this.log('info', 'File changes detected', { files: files.length });\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 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 // 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 '--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;AAQjD,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,g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B;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;A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ACF,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-OJXFQRUE.js";
13
- import "./chunk-4TQQP7JD.js";
14
- import "./chunk-APMV77PU.js";
12
+ } from "./chunk-UL337UDQ.js";
13
+ import "./chunk-7F2R2ITA.js";
14
+ import "./chunk-JKEEQAG2.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-5L64D5SQ.js.map
28
+ //# sourceMappingURL=client-ZHOLZTRW.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  CodebaseIndex
3
- } from "./chunk-WOTLY5NA.js";
3
+ } from "./chunk-YEQXKKZQ.js";
4
4
  import "./chunk-6NLHFIYA.js";
5
5
  import "./chunk-43X6JBEM.js";
6
- import "./chunk-4TQQP7JD.js";
7
- import "./chunk-APMV77PU.js";
6
+ import "./chunk-7F2R2ITA.js";
7
+ import "./chunk-JKEEQAG2.js";
8
8
  import "./chunk-DGUM43GV.js";
9
9
  export {
10
10
  CodebaseIndex
11
11
  };
12
- //# sourceMappingURL=codebase-index-OOE7OAHP.js.map
12
+ //# sourceMappingURL=codebase-index-N37NDF2A.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  CodebaseIndex
3
- } from "./chunk-WOTLY5NA.js";
3
+ } from "./chunk-YEQXKKZQ.js";
4
4
  import "./chunk-6NLHFIYA.js";
5
5
  import "./chunk-43X6JBEM.js";
6
- import "./chunk-4TQQP7JD.js";
7
- import "./chunk-APMV77PU.js";
6
+ import "./chunk-7F2R2ITA.js";
7
+ import "./chunk-JKEEQAG2.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-EM5XVWVC.js");
40
+ const { checkFilesForGoalViolations } = await import("./goal-validator-FU5QWDQT.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-EM5XVWVC.js");
174
+ const { checkFilesForGoalViolations } = await import("./goal-validator-FU5QWDQT.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-FMU3X4AZ.js.map
216
+ //# sourceMappingURL=fast-analyzer-U6URGNQT.js.map
@@ -0,0 +1,11 @@
1
+ import {
2
+ GitHubIngester
3
+ } from "./chunk-CBAMZERA.js";
4
+ import "./chunk-FTOF3FHT.js";
5
+ import "./chunk-7F2R2ITA.js";
6
+ import "./chunk-JKEEQAG2.js";
7
+ import "./chunk-DGUM43GV.js";
8
+ export {
9
+ GitHubIngester
10
+ };
11
+ //# sourceMappingURL=github-ingester-AR5A4RAC.js.map
@@ -4,15 +4,15 @@ import {
4
4
  calculateAdaptiveScanFrequency,
5
5
  clearGoalManagers,
6
6
  getGoalManager
7
- } from "./chunk-JIS2OCZR.js";
8
- import "./chunk-ABY2R7OK.js";
9
- import "./chunk-GLY76TSI.js";
10
- import "./chunk-ED7PLRQA.js";
7
+ } from "./chunk-LFNH3CSN.js";
8
+ import "./chunk-T7UAH7GE.js";
9
+ import "./chunk-L4FODDDB.js";
10
+ import "./chunk-4ZAFQEP6.js";
11
11
  import "./chunk-EFWVF6TI.js";
12
- import "./chunk-TWPX6PHF.js";
12
+ import "./chunk-HD5H7YSW.js";
13
13
  import "./chunk-43X6JBEM.js";
14
- import "./chunk-4TQQP7JD.js";
15
- import "./chunk-APMV77PU.js";
14
+ import "./chunk-7F2R2ITA.js";
15
+ import "./chunk-JKEEQAG2.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-VTBFFYN4.js.map
24
+ //# sourceMappingURL=goal-manager-5QDITJKE.js.map
@@ -4,14 +4,14 @@ import {
4
4
  measureInitialGoalValue,
5
5
  recordGoalViolationCaught,
6
6
  recordGoalViolationFixed
7
- } from "./chunk-7HYOJ4Q7.js";
8
- import "./chunk-GLY76TSI.js";
9
- import "./chunk-ED7PLRQA.js";
7
+ } from "./chunk-Z2E7X4WI.js";
8
+ import "./chunk-L4FODDDB.js";
9
+ import "./chunk-4ZAFQEP6.js";
10
10
  import "./chunk-EFWVF6TI.js";
11
- import "./chunk-TWPX6PHF.js";
11
+ import "./chunk-HD5H7YSW.js";
12
12
  import "./chunk-43X6JBEM.js";
13
- import "./chunk-4TQQP7JD.js";
14
- import "./chunk-APMV77PU.js";
13
+ import "./chunk-7F2R2ITA.js";
14
+ import "./chunk-JKEEQAG2.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-EM5XVWVC.js.map
23
+ //# sourceMappingURL=goal-validator-FU5QWDQT.js.map
@@ -0,0 +1,10 @@
1
+ import {
2
+ ContextGraph
3
+ } from "./chunk-JYWGYUKX.js";
4
+ import "./chunk-7F2R2ITA.js";
5
+ import "./chunk-JKEEQAG2.js";
6
+ import "./chunk-DGUM43GV.js";
7
+ export {
8
+ ContextGraph
9
+ };
10
+ //# sourceMappingURL=graph-JO7GG65P.js.map
@@ -3,15 +3,15 @@ import {
3
3
  clearHypothesisEngines,
4
4
  gatherEvidenceForHypothesis,
5
5
  getHypothesisEngine
6
- } from "./chunk-74R4XSFB.js";
7
- import "./chunk-ABY2R7OK.js";
8
- import "./chunk-GLY76TSI.js";
9
- import "./chunk-ED7PLRQA.js";
6
+ } from "./chunk-NVZZUUEU.js";
7
+ import "./chunk-T7UAH7GE.js";
8
+ import "./chunk-L4FODDDB.js";
9
+ import "./chunk-4ZAFQEP6.js";
10
10
  import "./chunk-EFWVF6TI.js";
11
- import "./chunk-TWPX6PHF.js";
11
+ import "./chunk-HD5H7YSW.js";
12
12
  import "./chunk-43X6JBEM.js";
13
- import "./chunk-4TQQP7JD.js";
14
- import "./chunk-APMV77PU.js";
13
+ import "./chunk-7F2R2ITA.js";
14
+ import "./chunk-JKEEQAG2.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-4UPE7KXU.js.map
22
+ //# sourceMappingURL=hypothesis-JURDWVDC.js.map
@@ -0,0 +1,11 @@
1
+ import {
2
+ IncidentIndex
3
+ } from "./chunk-KYKADM7P.js";
4
+ import "./chunk-6NLHFIYA.js";
5
+ import "./chunk-7F2R2ITA.js";
6
+ import "./chunk-JKEEQAG2.js";
7
+ import "./chunk-DGUM43GV.js";
8
+ export {
9
+ IncidentIndex
10
+ };
11
+ //# sourceMappingURL=incident-index-7CAXUNTL.js.map