wave-agent-sdk 0.0.6 → 0.0.8

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 (180) hide show
  1. package/dist/agent.d.ts +32 -20
  2. package/dist/agent.d.ts.map +1 -1
  3. package/dist/agent.js +209 -24
  4. package/dist/constants/events.d.ts +28 -0
  5. package/dist/constants/events.d.ts.map +1 -0
  6. package/dist/constants/events.js +27 -0
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +2 -0
  10. package/dist/managers/aiManager.d.ts +34 -1
  11. package/dist/managers/aiManager.d.ts.map +1 -1
  12. package/dist/managers/aiManager.js +248 -132
  13. package/dist/managers/backgroundBashManager.d.ts.map +1 -1
  14. package/dist/managers/backgroundBashManager.js +7 -6
  15. package/dist/managers/hookManager.d.ts +13 -16
  16. package/dist/managers/hookManager.d.ts.map +1 -1
  17. package/dist/managers/hookManager.js +81 -44
  18. package/dist/managers/liveConfigManager.d.ts +58 -0
  19. package/dist/managers/liveConfigManager.d.ts.map +1 -0
  20. package/dist/managers/liveConfigManager.js +160 -0
  21. package/dist/managers/messageManager.d.ts +41 -24
  22. package/dist/managers/messageManager.d.ts.map +1 -1
  23. package/dist/managers/messageManager.js +168 -49
  24. package/dist/managers/slashCommandManager.d.ts.map +1 -1
  25. package/dist/managers/slashCommandManager.js +9 -3
  26. package/dist/managers/subagentManager.d.ts +51 -0
  27. package/dist/managers/subagentManager.d.ts.map +1 -1
  28. package/dist/managers/subagentManager.js +190 -19
  29. package/dist/services/aiService.d.ts +13 -5
  30. package/dist/services/aiService.d.ts.map +1 -1
  31. package/dist/services/aiService.js +350 -74
  32. package/dist/services/configurationWatcher.d.ts +120 -0
  33. package/dist/services/configurationWatcher.d.ts.map +1 -0
  34. package/dist/services/configurationWatcher.js +439 -0
  35. package/dist/services/fileWatcher.d.ts +69 -0
  36. package/dist/services/fileWatcher.d.ts.map +1 -0
  37. package/dist/services/fileWatcher.js +213 -0
  38. package/dist/services/hook.d.ts +91 -9
  39. package/dist/services/hook.d.ts.map +1 -1
  40. package/dist/services/hook.js +393 -43
  41. package/dist/services/jsonlHandler.d.ts +62 -0
  42. package/dist/services/jsonlHandler.d.ts.map +1 -0
  43. package/dist/services/jsonlHandler.js +257 -0
  44. package/dist/services/memory.d.ts +9 -0
  45. package/dist/services/memory.d.ts.map +1 -1
  46. package/dist/services/memory.js +81 -12
  47. package/dist/services/memoryStore.d.ts +81 -0
  48. package/dist/services/memoryStore.d.ts.map +1 -0
  49. package/dist/services/memoryStore.js +200 -0
  50. package/dist/services/session.d.ts +64 -49
  51. package/dist/services/session.d.ts.map +1 -1
  52. package/dist/services/session.js +310 -132
  53. package/dist/tools/bashTool.d.ts.map +1 -1
  54. package/dist/tools/bashTool.js +5 -4
  55. package/dist/tools/deleteFileTool.d.ts.map +1 -1
  56. package/dist/tools/deleteFileTool.js +2 -1
  57. package/dist/tools/editTool.d.ts.map +1 -1
  58. package/dist/tools/editTool.js +3 -2
  59. package/dist/tools/multiEditTool.d.ts.map +1 -1
  60. package/dist/tools/multiEditTool.js +4 -3
  61. package/dist/tools/readTool.d.ts.map +1 -1
  62. package/dist/tools/readTool.js +2 -1
  63. package/dist/tools/todoWriteTool.d.ts.map +1 -1
  64. package/dist/tools/todoWriteTool.js +3 -10
  65. package/dist/tools/writeTool.d.ts.map +1 -1
  66. package/dist/tools/writeTool.js +5 -6
  67. package/dist/types/commands.d.ts +4 -0
  68. package/dist/types/commands.d.ts.map +1 -1
  69. package/dist/types/core.d.ts +35 -0
  70. package/dist/types/core.d.ts.map +1 -1
  71. package/dist/types/environment.d.ts +42 -0
  72. package/dist/types/environment.d.ts.map +1 -0
  73. package/dist/types/environment.js +21 -0
  74. package/dist/types/hooks.d.ts +8 -2
  75. package/dist/types/hooks.d.ts.map +1 -1
  76. package/dist/types/hooks.js +8 -2
  77. package/dist/types/index.d.ts +2 -0
  78. package/dist/types/index.d.ts.map +1 -1
  79. package/dist/types/index.js +2 -0
  80. package/dist/types/memoryStore.d.ts +82 -0
  81. package/dist/types/memoryStore.d.ts.map +1 -0
  82. package/dist/types/memoryStore.js +7 -0
  83. package/dist/types/messaging.d.ts +21 -9
  84. package/dist/types/messaging.d.ts.map +1 -1
  85. package/dist/types/messaging.js +5 -1
  86. package/dist/types/session.d.ts +20 -0
  87. package/dist/types/session.d.ts.map +1 -0
  88. package/dist/types/session.js +7 -0
  89. package/dist/utils/bashHistory.d.ts.map +1 -1
  90. package/dist/utils/bashHistory.js +27 -26
  91. package/dist/utils/cacheControlUtils.d.ts +121 -0
  92. package/dist/utils/cacheControlUtils.d.ts.map +1 -0
  93. package/dist/utils/cacheControlUtils.js +367 -0
  94. package/dist/utils/commandPathResolver.d.ts +52 -0
  95. package/dist/utils/commandPathResolver.d.ts.map +1 -0
  96. package/dist/utils/commandPathResolver.js +145 -0
  97. package/dist/utils/configPaths.d.ts +85 -0
  98. package/dist/utils/configPaths.d.ts.map +1 -0
  99. package/dist/utils/configPaths.js +121 -0
  100. package/dist/utils/configResolver.d.ts +37 -10
  101. package/dist/utils/configResolver.d.ts.map +1 -1
  102. package/dist/utils/configResolver.js +127 -23
  103. package/dist/utils/constants.d.ts +1 -1
  104. package/dist/utils/constants.js +1 -1
  105. package/dist/utils/convertMessagesForAPI.d.ts.map +1 -1
  106. package/dist/utils/convertMessagesForAPI.js +8 -13
  107. package/dist/utils/customCommands.d.ts.map +1 -1
  108. package/dist/utils/customCommands.js +66 -21
  109. package/dist/utils/fileUtils.d.ts +15 -0
  110. package/dist/utils/fileUtils.d.ts.map +1 -0
  111. package/dist/utils/fileUtils.js +61 -0
  112. package/dist/utils/globalLogger.d.ts +102 -0
  113. package/dist/utils/globalLogger.d.ts.map +1 -0
  114. package/dist/utils/globalLogger.js +136 -0
  115. package/dist/utils/hookMatcher.d.ts +1 -6
  116. package/dist/utils/hookMatcher.d.ts.map +1 -1
  117. package/dist/utils/mcpUtils.d.ts.map +1 -1
  118. package/dist/utils/mcpUtils.js +25 -3
  119. package/dist/utils/messageOperations.d.ts +27 -27
  120. package/dist/utils/messageOperations.d.ts.map +1 -1
  121. package/dist/utils/messageOperations.js +46 -36
  122. package/dist/utils/pathEncoder.d.ts +104 -0
  123. package/dist/utils/pathEncoder.d.ts.map +1 -0
  124. package/dist/utils/pathEncoder.js +272 -0
  125. package/dist/utils/subagentParser.d.ts.map +1 -1
  126. package/dist/utils/subagentParser.js +2 -1
  127. package/dist/utils/tokenCalculation.d.ts +26 -0
  128. package/dist/utils/tokenCalculation.d.ts.map +1 -0
  129. package/dist/utils/tokenCalculation.js +36 -0
  130. package/package.json +6 -3
  131. package/src/agent.ts +301 -37
  132. package/src/constants/events.ts +38 -0
  133. package/src/index.ts +2 -0
  134. package/src/managers/aiManager.ts +325 -173
  135. package/src/managers/backgroundBashManager.ts +7 -6
  136. package/src/managers/hookManager.ts +106 -84
  137. package/src/managers/liveConfigManager.ts +248 -0
  138. package/src/managers/messageManager.ts +237 -100
  139. package/src/managers/slashCommandManager.ts +9 -7
  140. package/src/managers/subagentManager.ts +284 -22
  141. package/src/services/aiService.ts +474 -83
  142. package/src/services/configurationWatcher.ts +622 -0
  143. package/src/services/fileWatcher.ts +301 -0
  144. package/src/services/hook.ts +538 -47
  145. package/src/services/jsonlHandler.ts +319 -0
  146. package/src/services/memory.ts +92 -12
  147. package/src/services/memoryStore.ts +279 -0
  148. package/src/services/session.ts +381 -157
  149. package/src/tools/bashTool.ts +5 -4
  150. package/src/tools/deleteFileTool.ts +2 -1
  151. package/src/tools/editTool.ts +3 -2
  152. package/src/tools/multiEditTool.ts +4 -3
  153. package/src/tools/readTool.ts +2 -1
  154. package/src/tools/todoWriteTool.ts +3 -11
  155. package/src/tools/writeTool.ts +7 -6
  156. package/src/types/commands.ts +6 -0
  157. package/src/types/core.ts +44 -0
  158. package/src/types/environment.ts +60 -0
  159. package/src/types/hooks.ts +21 -8
  160. package/src/types/index.ts +2 -0
  161. package/src/types/memoryStore.ts +94 -0
  162. package/src/types/messaging.ts +21 -10
  163. package/src/types/session.ts +25 -0
  164. package/src/utils/bashHistory.ts +27 -27
  165. package/src/utils/cacheControlUtils.ts +540 -0
  166. package/src/utils/commandPathResolver.ts +189 -0
  167. package/src/utils/configPaths.ts +163 -0
  168. package/src/utils/configResolver.ts +182 -22
  169. package/src/utils/constants.ts +1 -1
  170. package/src/utils/convertMessagesForAPI.ts +8 -14
  171. package/src/utils/customCommands.ts +90 -22
  172. package/src/utils/fileUtils.ts +65 -0
  173. package/src/utils/globalLogger.ts +145 -0
  174. package/src/utils/hookMatcher.ts +1 -12
  175. package/src/utils/mcpUtils.ts +34 -3
  176. package/src/utils/messageOperations.ts +77 -60
  177. package/src/utils/pathEncoder.ts +379 -0
  178. package/src/utils/subagentParser.ts +2 -1
  179. package/src/utils/tokenCalculation.ts +43 -0
  180. package/src/types/index.ts.backup +0 -357
@@ -0,0 +1,213 @@
1
+ /**
2
+ * File Watcher Service
3
+ *
4
+ * Provides robust cross-platform file watching using Chokidar library.
5
+ * Handles file watching with debouncing, error recovery, and graceful fallbacks.
6
+ */
7
+ import * as chokidar from "chokidar";
8
+ import { EventEmitter } from "events";
9
+ import { FILE_WATCHER_EVENTS } from "../constants/events.js";
10
+ export class FileWatcherService extends EventEmitter {
11
+ constructor(logger, config) {
12
+ super();
13
+ this.watchers = new Map();
14
+ this.globalWatcher = null;
15
+ this.logger = logger;
16
+ this.defaultConfig = {
17
+ stabilityThreshold: 300,
18
+ pollInterval: 100,
19
+ maxRetries: 3,
20
+ fallbackPolling: false,
21
+ ignoreTempFiles: true,
22
+ ...config,
23
+ };
24
+ }
25
+ /**
26
+ * Start watching a file
27
+ * Maps to FR-010: Handle file deletion, creation, and modification
28
+ */
29
+ async watchFile(path, callback) {
30
+ try {
31
+ if (this.watchers.has(path)) {
32
+ // Add callback to existing watcher
33
+ const entry = this.watchers.get(path);
34
+ entry.callbacks.add(callback);
35
+ return;
36
+ }
37
+ // Create new watcher entry
38
+ const entry = {
39
+ path,
40
+ watcher: null,
41
+ isActive: false,
42
+ lastEvent: Date.now(),
43
+ errorCount: 0,
44
+ lastError: undefined,
45
+ callbacks: new Set([callback]),
46
+ config: { ...this.defaultConfig },
47
+ };
48
+ this.watchers.set(path, entry);
49
+ await this.initializeWatcher(entry);
50
+ }
51
+ catch (error) {
52
+ this.logger?.error(`Live Config: Failed to watch file ${path}: ${error.message}`);
53
+ throw error;
54
+ }
55
+ }
56
+ /**
57
+ * Stop watching a file
58
+ * Resource cleanup
59
+ */
60
+ async unwatchFile(path) {
61
+ const entry = this.watchers.get(path);
62
+ if (!entry)
63
+ return;
64
+ try {
65
+ if (entry.watcher) {
66
+ entry.watcher.unwatch(path);
67
+ }
68
+ this.watchers.delete(path);
69
+ this.logger?.info(`Live Config: Stopped watching file: ${path}`);
70
+ }
71
+ catch (error) {
72
+ this.logger?.warn(`Live Config: Error unwatching file ${path}: ${error.message}`);
73
+ }
74
+ }
75
+ /**
76
+ * Get watcher status
77
+ * Maps to FR-012: Handle watcher initialization failures
78
+ */
79
+ getWatcherStatus(path) {
80
+ const entry = this.watchers.get(path);
81
+ if (!entry)
82
+ return null;
83
+ return {
84
+ isActive: entry.isActive,
85
+ path: entry.path,
86
+ method: entry.errorCount > 0
87
+ ? "failed"
88
+ : entry.config.fallbackPolling
89
+ ? "polling"
90
+ : "native",
91
+ errorCount: entry.errorCount,
92
+ lastError: entry.lastError,
93
+ lastEvent: entry.lastEvent > 0
94
+ ? {
95
+ type: FILE_WATCHER_EVENTS.CHANGE,
96
+ path: entry.path,
97
+ timestamp: entry.lastEvent,
98
+ }
99
+ : undefined,
100
+ };
101
+ }
102
+ /**
103
+ * Get all watcher statuses
104
+ * For monitoring and debugging
105
+ */
106
+ getAllWatcherStatuses() {
107
+ return Array.from(this.watchers.keys())
108
+ .map((path) => this.getWatcherStatus(path))
109
+ .filter((status) => status !== null);
110
+ }
111
+ /**
112
+ * Configure watcher behavior
113
+ * Runtime configuration updates
114
+ */
115
+ updateConfig(config) {
116
+ this.defaultConfig = { ...this.defaultConfig, ...config };
117
+ // Update existing watchers with new config
118
+ for (const entry of this.watchers.values()) {
119
+ entry.config = { ...entry.config, ...config };
120
+ }
121
+ }
122
+ /**
123
+ * Cleanup all watchers
124
+ */
125
+ async cleanup() {
126
+ const paths = Array.from(this.watchers.keys());
127
+ await Promise.all(paths.map((path) => this.unwatchFile(path)));
128
+ if (this.globalWatcher) {
129
+ await this.globalWatcher.close();
130
+ this.globalWatcher = null;
131
+ }
132
+ }
133
+ async initializeWatcher(entry) {
134
+ try {
135
+ // Initialize global watcher if needed
136
+ if (!this.globalWatcher) {
137
+ this.globalWatcher = chokidar.watch([], {
138
+ persistent: true,
139
+ ignoreInitial: true,
140
+ awaitWriteFinish: {
141
+ stabilityThreshold: entry.config.stabilityThreshold,
142
+ pollInterval: entry.config.pollInterval,
143
+ },
144
+ usePolling: entry.config.fallbackPolling,
145
+ interval: entry.config.pollInterval,
146
+ });
147
+ this.setupGlobalWatcherEvents();
148
+ }
149
+ // Add path to global watcher
150
+ this.globalWatcher.add(entry.path);
151
+ entry.watcher = this.globalWatcher;
152
+ entry.isActive = true;
153
+ entry.errorCount = 0;
154
+ this.logger?.info(`Live Config: Started watching file: ${entry.path}`);
155
+ }
156
+ catch (error) {
157
+ entry.errorCount++;
158
+ entry.isActive = false;
159
+ entry.lastError = error.message;
160
+ this.logger?.error(`Live Config: Failed to initialize watcher for ${entry.path}: ${error.message}`);
161
+ // Try fallback polling if not already using it
162
+ if (!entry.config.fallbackPolling &&
163
+ entry.errorCount < entry.config.maxRetries) {
164
+ this.logger?.info(`Live Config: Attempting polling fallback for ${entry.path}`);
165
+ entry.config.fallbackPolling = true;
166
+ await this.initializeWatcher(entry);
167
+ }
168
+ else {
169
+ throw error;
170
+ }
171
+ }
172
+ }
173
+ setupGlobalWatcherEvents() {
174
+ if (!this.globalWatcher)
175
+ return;
176
+ this.globalWatcher.on(FILE_WATCHER_EVENTS.CHANGE, (filePath, stats) => {
177
+ this.handleFileEvent(FILE_WATCHER_EVENTS.CHANGE, filePath, stats);
178
+ });
179
+ this.globalWatcher.on("add", (filePath, stats) => {
180
+ this.handleFileEvent(FILE_WATCHER_EVENTS.CREATE, filePath, stats);
181
+ });
182
+ this.globalWatcher.on("unlink", (filePath) => {
183
+ this.handleFileEvent(FILE_WATCHER_EVENTS.DELETE, filePath);
184
+ });
185
+ this.globalWatcher.on("error", (err) => {
186
+ const error = err instanceof Error ? err : new Error(String(err));
187
+ this.logger?.error(`Live Config: File watcher error: ${error.message}`);
188
+ this.emit("watcherError", error);
189
+ });
190
+ }
191
+ handleFileEvent(type, filePath, stats) {
192
+ const entry = this.watchers.get(filePath);
193
+ if (!entry)
194
+ return;
195
+ const event = {
196
+ type,
197
+ path: filePath,
198
+ timestamp: Date.now(),
199
+ size: stats?.size,
200
+ };
201
+ entry.lastEvent = event.timestamp;
202
+ // Notify all callbacks for this file
203
+ for (const callback of entry.callbacks) {
204
+ try {
205
+ callback(event);
206
+ }
207
+ catch (error) {
208
+ this.logger?.error(`Live Config: Error in file watch callback for ${filePath}: ${error.message}`);
209
+ }
210
+ }
211
+ this.logger?.debug(`Live Config: File ${type} event for ${filePath}`);
212
+ }
213
+ }
@@ -4,53 +4,135 @@
4
4
  * Consolidated hook services providing both execution and configuration functionality.
5
5
  * Combines hook command execution and settings management into a single module.
6
6
  */
7
- import { type HookExecutionContext, type HookExecutionResult, type HookExecutionOptions, type ExtendedHookExecutionContext, type PartialHookConfiguration } from "../types/hooks.js";
7
+ import { type HookExecutionContext, type HookExecutionResult, type HookExecutionOptions, type ExtendedHookExecutionContext, type WaveConfiguration, type PartialHookConfiguration } from "../types/hooks.js";
8
+ import { type EnvironmentValidationResult, type MergedEnvironmentContext, type EnvironmentMergeOptions } from "../types/environment.js";
8
9
  /**
9
10
  * Execute a single hook command
10
11
  */
11
- export declare function executeCommand(command: string, context: HookExecutionContext | ExtendedHookExecutionContext, options?: HookExecutionOptions): Promise<HookExecutionResult>;
12
+ export declare function executeCommand(command: string, context: HookExecutionContext | ExtendedHookExecutionContext, options?: HookExecutionOptions, additionalEnvVars?: Record<string, string>): Promise<HookExecutionResult>;
12
13
  /**
13
14
  * Execute multiple commands in sequence
14
15
  */
15
- export declare function executeCommands(commands: string[], context: HookExecutionContext | ExtendedHookExecutionContext, options?: HookExecutionOptions): Promise<HookExecutionResult[]>;
16
+ export declare function executeCommands(commands: string[], context: HookExecutionContext | ExtendedHookExecutionContext, options?: HookExecutionOptions, additionalEnvVars?: Record<string, string>): Promise<HookExecutionResult[]>;
16
17
  /**
17
18
  * Validate command safety (basic checks)
18
19
  */
19
20
  export declare function isCommandSafe(command: string): boolean;
20
21
  /**
21
- * Get the user-specific hooks configuration file path
22
+ * Validate environment variable configuration
23
+ */
24
+ export declare function validateEnvironmentConfig(env: unknown, configPath?: string): EnvironmentValidationResult;
25
+ /**
26
+ * Merge environment configurations with project taking precedence over user
27
+ */
28
+ export declare function mergeEnvironmentConfig(userEnv: Record<string, string> | undefined, projectEnv: Record<string, string> | undefined, options?: EnvironmentMergeOptions): MergedEnvironmentContext;
29
+ /**
30
+ * Get the user-specific hooks configuration file path (legacy function)
31
+ * @deprecated Use getUserConfigPaths() from configPaths.ts for better priority support
22
32
  */
23
33
  export declare function getUserHooksConfigPath(): string;
24
34
  /**
25
- * Get the project-specific hooks configuration file path
35
+ * Get the project-specific hooks configuration file path (legacy function)
36
+ * @deprecated Use getProjectConfigPaths() from configPaths.ts for better priority support
26
37
  */
27
38
  export declare function getProjectHooksConfigPath(workdir: string): string;
28
39
  /**
29
- * Load hooks configuration from a JSON file
40
+ * Get the user-specific hooks configuration file paths in priority order
41
+ * @deprecated Use getUserConfigPaths() from configPaths.ts directly
42
+ */
43
+ export declare function getUserHooksConfigPaths(): string[];
44
+ /**
45
+ * Get the project-specific hooks configuration file paths in priority order
46
+ * @deprecated Use getProjectConfigPaths() from configPaths.ts directly
47
+ */
48
+ export declare function getProjectHooksConfigPaths(workdir: string): string[];
49
+ /**
50
+ * Load Wave configuration from a JSON file with graceful fallback
51
+ * This version is optimized for live reload scenarios where invalid config should not crash the system
52
+ */
53
+ export declare function loadWaveConfigFromFileWithFallback(filePath: string, previousValidConfig?: WaveConfiguration | null): {
54
+ config: WaveConfiguration | null;
55
+ error?: string;
56
+ usedFallback: boolean;
57
+ };
58
+ /**
59
+ * Load Wave configuration from multiple file paths in priority order
60
+ * Returns the first valid configuration found, or null if none exist
61
+ */
62
+ export declare function loadWaveConfigFromFiles(filePaths: string[]): WaveConfiguration | null;
63
+ /**
64
+ * Load Wave configuration from multiple file paths with graceful fallback
65
+ * Returns the first valid configuration found with fallback support
66
+ */
67
+ export declare function loadWaveConfigFromFilesWithFallback(filePaths: string[], previousValidConfig?: WaveConfiguration | null): {
68
+ config: WaveConfiguration | null;
69
+ error?: string;
70
+ usedFallback: boolean;
71
+ usedPath?: string;
72
+ };
73
+ /**
74
+ * Load and merge Wave configuration with graceful fallback for live reload
75
+ * Provides error recovery by falling back to previous valid configuration
76
+ */
77
+ export declare function loadMergedWaveConfigWithFallback(workdir: string, previousValidConfig?: WaveConfiguration | null): {
78
+ config: WaveConfiguration | null;
79
+ errors: string[];
80
+ usedFallback: boolean;
81
+ };
82
+ /**
83
+ * Load Wave configuration from a JSON file
84
+ * Supports both hooks and environment variables with proper validation
85
+ */
86
+ export declare function loadWaveConfigFromFile(filePath: string): WaveConfiguration | null;
87
+ /**
88
+ * Load hooks configuration from a JSON file (legacy function)
30
89
  */
31
90
  export declare function loadHooksConfigFromFile(filePath: string): PartialHookConfiguration | null;
32
91
  /**
33
- * Load user-specific hooks configuration
92
+ * Load user-specific Wave configuration
93
+ * Checks .local.json first, then falls back to .json
94
+ */
95
+ export declare function loadUserWaveConfig(): WaveConfiguration | null;
96
+ /**
97
+ * Load project-specific Wave configuration
98
+ * Checks .local.json first, then falls back to .json
99
+ */
100
+ export declare function loadProjectWaveConfig(workdir: string): WaveConfiguration | null;
101
+ /**
102
+ * Load user-specific hooks configuration (legacy function)
34
103
  */
35
104
  export declare function loadUserHooksConfig(): PartialHookConfiguration | null;
36
105
  /**
37
- * Load project-specific hooks configuration
106
+ * Load project-specific hooks configuration (legacy function)
38
107
  */
39
108
  export declare function loadProjectHooksConfig(workdir: string): PartialHookConfiguration | null;
40
109
  /**
41
- * Load and merge hooks configuration from both user and project sources
110
+ * Load and merge Wave configuration from both user and project sources
111
+ * Project configuration takes precedence over user configuration
112
+ * Checks .local.json files first, then falls back to .json files
113
+ */
114
+ export declare function loadMergedWaveConfig(workdir: string): WaveConfiguration | null;
115
+ /**
116
+ * Load and merge hooks configuration from both user and project sources (legacy function)
42
117
  */
43
118
  export declare function loadMergedHooksConfig(workdir: string): PartialHookConfiguration | null;
44
119
  /**
45
120
  * Check if hooks configuration exists (user or project)
121
+ * Checks both .local.json and .json variants
122
+ * @deprecated Use hasAnyConfig() from configPaths.ts for better functionality
46
123
  */
47
124
  export declare function hasHooksConfiguration(workdir: string): boolean;
48
125
  /**
49
126
  * Get hooks configuration information for debugging
127
+ * Includes both .local.json and .json variants
128
+ * @deprecated Use getConfigurationInfo() from configPaths.ts for better functionality
50
129
  */
51
130
  export declare function getHooksConfigurationInfo(workdir: string): {
52
131
  hasUser: boolean;
53
132
  hasProject: boolean;
54
133
  paths: string[];
134
+ userPaths: string[];
135
+ projectPaths: string[];
136
+ existingPaths: string[];
55
137
  };
56
138
  //# sourceMappingURL=hook.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/services/hook.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EAGjC,KAAK,wBAAwB,EAG9B,MAAM,mBAAmB,CAAC;AA6C3B;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,oBAAoB,GAAG,4BAA4B,EAC5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