@triedotdev/mcp 1.0.149 → 1.0.154

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 (125) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +150 -36
  3. package/dist/{autonomy-config-ZCOSTMPD.js → autonomy-config-RKLZW4XL.js} +4 -4
  4. package/dist/{chat-store-OJLJCJFI.js → chat-store-O3IJ5PMN.js} +4 -4
  5. package/dist/{chunk-IXO4G4D3.js → chunk-2LAJKFWU.js} +2 -2
  6. package/dist/{chunk-23RJT5WT.js → chunk-3CYMLM35.js} +2 -2
  7. package/dist/{chunk-QH77RQB3.js → chunk-4ZAFQEP6.js} +5 -6
  8. package/dist/chunk-4ZAFQEP6.js.map +1 -0
  9. package/dist/{chunk-SH7H3WRU.js → chunk-7F2R2ITA.js} +4 -4
  10. package/dist/{chunk-SH7H3WRU.js.map → chunk-7F2R2ITA.js.map} +1 -1
  11. package/dist/{chunk-FG467PDD.js → chunk-ALSCZ7WR.js} +2 -2
  12. package/dist/{chunk-YOJGSRZK.js → chunk-CBAMZERA.js} +2 -2
  13. package/dist/{chunk-53KUI7RQ.js → chunk-EMJ7RVWB.js} +38 -13
  14. package/dist/{chunk-53KUI7RQ.js.map → chunk-EMJ7RVWB.js.map} +1 -1
  15. package/dist/{chunk-NKHO34UZ.js → chunk-FTOF3FHT.js} +3 -3
  16. package/dist/{chunk-LD7ZEFNY.js → chunk-FXZAABXO.js} +2 -2
  17. package/dist/{chunk-ZUEAHFSY.js → chunk-HD5H7YSW.js} +313 -61
  18. package/dist/chunk-HD5H7YSW.js.map +1 -0
  19. package/dist/{chunk-APMV77PU.js → chunk-JKEEQAG2.js} +1 -1
  20. package/dist/chunk-JKEEQAG2.js.map +1 -0
  21. package/dist/{chunk-FH335WL5.js → chunk-JYWGYUKX.js} +2 -2
  22. package/dist/{chunk-TIMIKBY2.js → chunk-KLMJKM63.js} +2 -2
  23. package/dist/{chunk-4C67GV3O.js → chunk-KYKADM7P.js} +2 -2
  24. package/dist/{chunk-CU5VDH6F.js → chunk-L4FODDDB.js} +2 -2
  25. package/dist/{chunk-ILGMFND2.js → chunk-LFNH3CSN.js} +4 -4
  26. package/dist/{chunk-GAL7OIYU.js → chunk-LJISDV3A.js} +15 -15
  27. package/dist/{chunk-72KSLD7A.js → chunk-NVZZUUEU.js} +5 -5
  28. package/dist/{chunk-7OJ6JIPL.js → chunk-OVSYTWUU.js} +7 -150
  29. package/dist/chunk-OVSYTWUU.js.map +1 -0
  30. package/dist/{chunk-B2AHQ2IR.js → chunk-OWSGJUUR.js} +12 -12
  31. package/dist/{chunk-HYNDXZAU.js → chunk-QAM5X5HM.js} +1535 -90
  32. package/dist/chunk-QAM5X5HM.js.map +1 -0
  33. package/dist/{chunk-OTQEFXHU.js → chunk-T7UAH7GE.js} +2 -2
  34. package/dist/{chunk-FPEMP54L.js → chunk-UL337UDQ.js} +2 -2
  35. package/dist/{chunk-F4NJ4CBP.js → chunk-WO7CC5FH.js} +2 -2
  36. package/dist/{chunk-5KJ4UJOY.js → chunk-XD2HKZVB.js} +2 -2
  37. package/dist/{chunk-V7AY2EJO.js → chunk-YEQXKKZQ.js} +2 -2
  38. package/dist/{chunk-ZDDE442Q.js → chunk-Z2E7X4WI.js} +8 -8
  39. package/dist/{chunk-ZDDE442Q.js.map → chunk-Z2E7X4WI.js.map} +1 -1
  40. package/dist/cli/create-agent.js +9 -41
  41. package/dist/cli/create-agent.js.map +1 -1
  42. package/dist/cli/main.js +58 -96
  43. package/dist/cli/main.js.map +1 -1
  44. package/dist/cli/yolo-daemon.js +65 -28
  45. package/dist/cli/yolo-daemon.js.map +1 -1
  46. package/dist/{client-INNE2GGZ.js → client-ZHOLZTRW.js} +4 -4
  47. package/dist/{codebase-index-FMIULFZQ.js → codebase-index-N37NDF2A.js} +4 -4
  48. package/dist/{fast-analyzer-CTT3MCPE.js → fast-analyzer-U6URGNQT.js} +6 -6
  49. package/dist/github-ingester-AR5A4RAC.js +11 -0
  50. package/dist/{goal-manager-IGUMDGCA.js → goal-manager-5QDITJKE.js} +8 -8
  51. package/dist/{goal-validator-DV6DRSGF.js → goal-validator-FU5QWDQT.js} +7 -7
  52. package/dist/graph-JO7GG65P.js +10 -0
  53. package/dist/{hypothesis-O72ZLVOW.js → hypothesis-JURDWVDC.js} +8 -8
  54. package/dist/incident-index-7CAXUNTL.js +11 -0
  55. package/dist/index.js +136 -1740
  56. package/dist/index.js.map +1 -1
  57. package/dist/{insight-store-Q62UGMTF.js → insight-store-AMEP5PPF.js} +4 -4
  58. package/dist/{issue-store-4FPABLC6.js → issue-store-RM3XLLKG.js} +5 -5
  59. package/dist/{ledger-43SIVE7X.js → ledger-PLE3C3X4.js} +14 -6
  60. package/dist/linear-ingester-NHFMKJBZ.js +11 -0
  61. package/dist/{output-manager-DZO5LGSG.js → output-manager-FX4V7ERT.js} +3 -3
  62. package/dist/{progress-PQVEM7BR.js → progress-PAYTY7BF.js} +2 -2
  63. package/dist/tiered-storage-3TUUR3L2.js +12 -0
  64. package/dist/trie-agent-QHPS4C5Z.js +27 -0
  65. package/dist/{vibe-code-signatures-ELEWJFGZ.js → vibe-code-signatures-J4GD4JOV.js} +3 -3
  66. package/dist/{vulnerability-signatures-EIJQX2TS.js → vulnerability-signatures-EIKOHFPK.js} +3 -3
  67. package/package.json +4 -6
  68. package/dist/chunk-7OJ6JIPL.js.map +0 -1
  69. package/dist/chunk-APMV77PU.js.map +0 -1
  70. package/dist/chunk-G76DYVGX.js +0 -136
  71. package/dist/chunk-G76DYVGX.js.map +0 -1
  72. package/dist/chunk-HYNDXZAU.js.map +0 -1
  73. package/dist/chunk-QH77RQB3.js.map +0 -1
  74. package/dist/chunk-ZUEAHFSY.js.map +0 -1
  75. package/dist/comprehension-46F7ZNKL.js +0 -821
  76. package/dist/comprehension-46F7ZNKL.js.map +0 -1
  77. package/dist/github-ingester-J2ZFYXVE.js +0 -11
  78. package/dist/graph-J4OGTYCO.js +0 -10
  79. package/dist/incident-index-BWW2UEY7.js +0 -11
  80. package/dist/linear-ingester-JRDQAIAA.js +0 -11
  81. package/dist/tiered-storage-VZL7KK64.js +0 -12
  82. package/dist/trie-agent-ET3DAP5Y.js +0 -27
  83. package/dist/workers/agent-worker.d.ts +0 -2
  84. package/dist/workers/agent-worker.js +0 -28
  85. package/dist/workers/agent-worker.js.map +0 -1
  86. /package/dist/{autonomy-config-ZCOSTMPD.js.map → autonomy-config-RKLZW4XL.js.map} +0 -0
  87. /package/dist/{chat-store-OJLJCJFI.js.map → chat-store-O3IJ5PMN.js.map} +0 -0
  88. /package/dist/{chunk-IXO4G4D3.js.map → chunk-2LAJKFWU.js.map} +0 -0
  89. /package/dist/{chunk-23RJT5WT.js.map → chunk-3CYMLM35.js.map} +0 -0
  90. /package/dist/{chunk-FG467PDD.js.map → chunk-ALSCZ7WR.js.map} +0 -0
  91. /package/dist/{chunk-YOJGSRZK.js.map → chunk-CBAMZERA.js.map} +0 -0
  92. /package/dist/{chunk-NKHO34UZ.js.map → chunk-FTOF3FHT.js.map} +0 -0
  93. /package/dist/{chunk-LD7ZEFNY.js.map → chunk-FXZAABXO.js.map} +0 -0
  94. /package/dist/{chunk-FH335WL5.js.map → chunk-JYWGYUKX.js.map} +0 -0
  95. /package/dist/{chunk-TIMIKBY2.js.map → chunk-KLMJKM63.js.map} +0 -0
  96. /package/dist/{chunk-4C67GV3O.js.map → chunk-KYKADM7P.js.map} +0 -0
  97. /package/dist/{chunk-CU5VDH6F.js.map → chunk-L4FODDDB.js.map} +0 -0
  98. /package/dist/{chunk-ILGMFND2.js.map → chunk-LFNH3CSN.js.map} +0 -0
  99. /package/dist/{chunk-GAL7OIYU.js.map → chunk-LJISDV3A.js.map} +0 -0
  100. /package/dist/{chunk-72KSLD7A.js.map → chunk-NVZZUUEU.js.map} +0 -0
  101. /package/dist/{chunk-B2AHQ2IR.js.map → chunk-OWSGJUUR.js.map} +0 -0
  102. /package/dist/{chunk-OTQEFXHU.js.map → chunk-T7UAH7GE.js.map} +0 -0
  103. /package/dist/{chunk-FPEMP54L.js.map → chunk-UL337UDQ.js.map} +0 -0
  104. /package/dist/{chunk-F4NJ4CBP.js.map → chunk-WO7CC5FH.js.map} +0 -0
  105. /package/dist/{chunk-5KJ4UJOY.js.map → chunk-XD2HKZVB.js.map} +0 -0
  106. /package/dist/{chunk-V7AY2EJO.js.map → chunk-YEQXKKZQ.js.map} +0 -0
  107. /package/dist/{client-INNE2GGZ.js.map → client-ZHOLZTRW.js.map} +0 -0
  108. /package/dist/{codebase-index-FMIULFZQ.js.map → codebase-index-N37NDF2A.js.map} +0 -0
  109. /package/dist/{fast-analyzer-CTT3MCPE.js.map → fast-analyzer-U6URGNQT.js.map} +0 -0
  110. /package/dist/{github-ingester-J2ZFYXVE.js.map → github-ingester-AR5A4RAC.js.map} +0 -0
  111. /package/dist/{goal-manager-IGUMDGCA.js.map → goal-manager-5QDITJKE.js.map} +0 -0
  112. /package/dist/{goal-validator-DV6DRSGF.js.map → goal-validator-FU5QWDQT.js.map} +0 -0
  113. /package/dist/{graph-J4OGTYCO.js.map → graph-JO7GG65P.js.map} +0 -0
  114. /package/dist/{hypothesis-O72ZLVOW.js.map → hypothesis-JURDWVDC.js.map} +0 -0
  115. /package/dist/{incident-index-BWW2UEY7.js.map → incident-index-7CAXUNTL.js.map} +0 -0
  116. /package/dist/{insight-store-Q62UGMTF.js.map → insight-store-AMEP5PPF.js.map} +0 -0
  117. /package/dist/{issue-store-4FPABLC6.js.map → issue-store-RM3XLLKG.js.map} +0 -0
  118. /package/dist/{ledger-43SIVE7X.js.map → ledger-PLE3C3X4.js.map} +0 -0
  119. /package/dist/{linear-ingester-JRDQAIAA.js.map → linear-ingester-NHFMKJBZ.js.map} +0 -0
  120. /package/dist/{output-manager-DZO5LGSG.js.map → output-manager-FX4V7ERT.js.map} +0 -0
  121. /package/dist/{progress-PQVEM7BR.js.map → progress-PAYTY7BF.js.map} +0 -0
  122. /package/dist/{tiered-storage-VZL7KK64.js.map → tiered-storage-3TUUR3L2.js.map} +0 -0
  123. /package/dist/{trie-agent-ET3DAP5Y.js.map → trie-agent-QHPS4C5Z.js.map} +0 -0
  124. /package/dist/{vibe-code-signatures-ELEWJFGZ.js.map → vibe-code-signatures-J4GD4JOV.js.map} +0 -0
  125. /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-HYNDXZAU.js";
6
- import "../chunk-23RJT5WT.js";
7
- import "../chunk-GAL7OIYU.js";
8
- import "../chunk-TIMIKBY2.js";
9
- import "../chunk-ILGMFND2.js";
10
- import "../chunk-72KSLD7A.js";
11
- import "../chunk-OTQEFXHU.js";
4
+ StreamingManager,
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";
12
14
  import {
13
15
  isTrieInitialized
14
- } from "../chunk-53KUI7RQ.js";
15
- import "../chunk-NKHO34UZ.js";
16
- import "../chunk-4C67GV3O.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-B2AHQ2IR.js";
19
- import "../chunk-FG467PDD.js";
20
- import "../chunk-FH335WL5.js";
21
- import "../chunk-ZDDE442Q.js";
22
- import "../chunk-FPEMP54L.js";
23
- import "../chunk-CU5VDH6F.js";
24
- import "../chunk-QH77RQB3.js";
25
- import "../chunk-EFWVF6TI.js";
26
- import "../chunk-F4NJ4CBP.js";
27
- import "../chunk-IXO4G4D3.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";
28
27
  import "../chunk-6NLHFIYA.js";
29
- import "../chunk-5KJ4UJOY.js";
30
- import "../chunk-ZUEAHFSY.js";
28
+ import "../chunk-ALSCZ7WR.js";
29
+ import "../chunk-XD2HKZVB.js";
30
+ import "../chunk-4ZAFQEP6.js";
31
+ import "../chunk-EFWVF6TI.js";
32
+ import "../chunk-HD5H7YSW.js";
31
33
  import "../chunk-43X6JBEM.js";
32
34
  import {
33
35
  getWorkingDirectory
34
- } from "../chunk-SH7H3WRU.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) {
94
99
  setInteractiveMode(true);
95
100
  }
96
101
  if (!isTrieInitialized(this.config.directory)) {
@@ -122,6 +127,11 @@ var WatchDaemon = class {
122
127
  debounceMs: this.config.debounceMs
123
128
  });
124
129
  }
130
+ await this.trieWatchTool.execute({
131
+ action: "start",
132
+ directory: this.config.directory,
133
+ debounceMs: this.config.debounceMs
134
+ });
125
135
  await this.watchDirectory(this.config.directory);
126
136
  this.streamingManager?.reportWatchStatus({
127
137
  watching: true,
@@ -187,7 +197,27 @@ var WatchDaemon = class {
187
197
  count: files.length,
188
198
  files: files.map((f) => basename(f))
189
199
  });
190
- this.log("info", "File changes detected", { files: files.length });
200
+ try {
201
+ const result = await this.trieWatchTool.execute({
202
+ action: "status"
203
+ });
204
+ const statusMatch = result.content?.[0]?.text?.match(/Issues Found: (\d+)/);
205
+ if (statusMatch && statusMatch[1]) {
206
+ const issuesFound = parseInt(statusMatch[1], 10);
207
+ this.stats.issuesFound += issuesFound;
208
+ if (issuesFound > 0) {
209
+ this.log("info", "Goal violations detected", {
210
+ count: issuesFound,
211
+ files: files.length
212
+ });
213
+ }
214
+ }
215
+ } catch (error) {
216
+ this.log("error", "Failed to check for goal violations", {
217
+ error: error instanceof Error ? error.message : String(error)
218
+ });
219
+ this.stats.errors++;
220
+ }
191
221
  this.isProcessing = false;
192
222
  }
193
223
  /**
@@ -217,8 +247,12 @@ var WatchDaemon = class {
217
247
  /**
218
248
  * Graceful shutdown
219
249
  */
220
- shutdown(signal) {
250
+ async shutdown(signal) {
221
251
  this.log("info", "Shutting down", { signal, stats: this.stats });
252
+ try {
253
+ await this.trieWatchTool.execute({ action: "stop" });
254
+ } catch (error) {
255
+ }
222
256
  for (const watcher of this.watchers.values()) {
223
257
  watcher.close();
224
258
  }
@@ -308,6 +342,9 @@ function parseArgs() {
308
342
  case "--no-interactive":
309
343
  config2.interactive = false;
310
344
  break;
345
+ case "--once":
346
+ config2.interactive = false;
347
+ break;
311
348
  case "--workers":
312
349
  config2.workers = true;
313
350
  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,gBAAuC;AAAA,EACvC,eAAe;AAAA,EACf,mBAAiD;AAAA,EACjD,YAA8C;AAAA,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AS,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}\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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ACF,KAAK;AACH,QAAAA,QAAO,cAAc;AACrB;AAAA,MACF,KAAK;AAEH,QAAAA,QAAO,cAAc;AACrB;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-FPEMP54L.js";
13
- import "./chunk-SH7H3WRU.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-INNE2GGZ.js.map
28
+ //# sourceMappingURL=client-ZHOLZTRW.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  CodebaseIndex
3
- } from "./chunk-V7AY2EJO.js";
3
+ } from "./chunk-YEQXKKZQ.js";
4
4
  import "./chunk-6NLHFIYA.js";
5
5
  import "./chunk-43X6JBEM.js";
6
- import "./chunk-SH7H3WRU.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-FMIULFZQ.js.map
12
+ //# sourceMappingURL=codebase-index-N37NDF2A.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  CodebaseIndex
3
- } from "./chunk-V7AY2EJO.js";
3
+ } from "./chunk-YEQXKKZQ.js";
4
4
  import "./chunk-6NLHFIYA.js";
5
5
  import "./chunk-43X6JBEM.js";
6
- import "./chunk-SH7H3WRU.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-DV6DRSGF.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-DV6DRSGF.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-CTT3MCPE.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-ILGMFND2.js";
8
- import "./chunk-OTQEFXHU.js";
9
- import "./chunk-CU5VDH6F.js";
10
- import "./chunk-QH77RQB3.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-ZUEAHFSY.js";
12
+ import "./chunk-HD5H7YSW.js";
13
13
  import "./chunk-43X6JBEM.js";
14
- import "./chunk-SH7H3WRU.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-IGUMDGCA.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-ZDDE442Q.js";
8
- import "./chunk-CU5VDH6F.js";
9
- import "./chunk-QH77RQB3.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-ZUEAHFSY.js";
11
+ import "./chunk-HD5H7YSW.js";
12
12
  import "./chunk-43X6JBEM.js";
13
- import "./chunk-SH7H3WRU.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-DV6DRSGF.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-72KSLD7A.js";
7
- import "./chunk-OTQEFXHU.js";
8
- import "./chunk-CU5VDH6F.js";
9
- import "./chunk-QH77RQB3.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-ZUEAHFSY.js";
11
+ import "./chunk-HD5H7YSW.js";
12
12
  import "./chunk-43X6JBEM.js";
13
- import "./chunk-SH7H3WRU.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-O72ZLVOW.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