wave-agent-sdk 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.d.ts +92 -23
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +340 -137
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/managers/aiManager.d.ts +14 -36
- package/dist/managers/aiManager.d.ts.map +1 -1
- package/dist/managers/aiManager.js +74 -77
- package/dist/managers/backgroundBashManager.d.ts.map +1 -1
- package/dist/managers/backgroundBashManager.js +4 -3
- package/dist/managers/hookManager.d.ts +3 -8
- package/dist/managers/hookManager.d.ts.map +1 -1
- package/dist/managers/hookManager.js +39 -29
- package/dist/managers/liveConfigManager.d.ts +55 -18
- package/dist/managers/liveConfigManager.d.ts.map +1 -1
- package/dist/managers/liveConfigManager.js +372 -90
- package/dist/managers/lspManager.d.ts +43 -0
- package/dist/managers/lspManager.d.ts.map +1 -0
- package/dist/managers/lspManager.js +326 -0
- package/dist/managers/messageManager.d.ts +8 -16
- package/dist/managers/messageManager.d.ts.map +1 -1
- package/dist/managers/messageManager.js +52 -74
- package/dist/managers/permissionManager.d.ts +66 -0
- package/dist/managers/permissionManager.d.ts.map +1 -0
- package/dist/managers/permissionManager.js +208 -0
- package/dist/managers/skillManager.d.ts +1 -0
- package/dist/managers/skillManager.d.ts.map +1 -1
- package/dist/managers/skillManager.js +2 -1
- package/dist/managers/slashCommandManager.d.ts.map +1 -1
- package/dist/managers/slashCommandManager.js +0 -1
- package/dist/managers/subagentManager.d.ts +8 -23
- package/dist/managers/subagentManager.d.ts.map +1 -1
- package/dist/managers/subagentManager.js +97 -117
- package/dist/managers/toolManager.d.ts +38 -1
- package/dist/managers/toolManager.d.ts.map +1 -1
- package/dist/managers/toolManager.js +66 -2
- package/dist/services/aiService.d.ts +3 -1
- package/dist/services/aiService.d.ts.map +1 -1
- package/dist/services/aiService.js +123 -30
- package/dist/services/configurationService.d.ts +116 -0
- package/dist/services/configurationService.d.ts.map +1 -0
- package/dist/services/configurationService.js +585 -0
- package/dist/services/fileWatcher.d.ts.map +1 -1
- package/dist/services/fileWatcher.js +5 -6
- package/dist/services/hook.d.ts +7 -124
- package/dist/services/hook.d.ts.map +1 -1
- package/dist/services/hook.js +46 -458
- package/dist/services/jsonlHandler.d.ts +24 -15
- package/dist/services/jsonlHandler.d.ts.map +1 -1
- package/dist/services/jsonlHandler.js +67 -88
- package/dist/services/memory.d.ts +0 -9
- package/dist/services/memory.d.ts.map +1 -1
- package/dist/services/memory.js +2 -49
- package/dist/services/session.d.ts +82 -33
- package/dist/services/session.d.ts.map +1 -1
- package/dist/services/session.js +275 -181
- package/dist/tools/bashTool.d.ts.map +1 -1
- package/dist/tools/bashTool.js +72 -13
- package/dist/tools/deleteFileTool.d.ts.map +1 -1
- package/dist/tools/deleteFileTool.js +25 -0
- package/dist/tools/editTool.d.ts.map +1 -1
- package/dist/tools/editTool.js +30 -6
- package/dist/tools/lspTool.d.ts +6 -0
- package/dist/tools/lspTool.d.ts.map +1 -0
- package/dist/tools/lspTool.js +589 -0
- package/dist/tools/multiEditTool.d.ts.map +1 -1
- package/dist/tools/multiEditTool.js +26 -7
- package/dist/tools/readTool.d.ts.map +1 -1
- package/dist/tools/readTool.js +111 -2
- package/dist/tools/skillTool.js +2 -2
- package/dist/tools/todoWriteTool.d.ts.map +1 -1
- package/dist/tools/todoWriteTool.js +23 -0
- package/dist/tools/types.d.ts +11 -8
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/writeTool.d.ts.map +1 -1
- package/dist/tools/writeTool.js +25 -9
- package/dist/types/commands.d.ts +0 -1
- package/dist/types/commands.d.ts.map +1 -1
- package/dist/types/config.d.ts +4 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/configuration.d.ts +69 -0
- package/dist/types/configuration.d.ts.map +1 -0
- package/dist/types/configuration.js +8 -0
- package/dist/types/core.d.ts +10 -0
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/environment.d.ts +41 -0
- package/dist/types/environment.d.ts.map +1 -1
- package/dist/types/fileSearch.d.ts +5 -0
- package/dist/types/fileSearch.d.ts.map +1 -0
- package/dist/types/fileSearch.js +1 -0
- package/dist/types/hooks.d.ts +11 -2
- package/dist/types/hooks.d.ts.map +1 -1
- package/dist/types/hooks.js +1 -7
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +5 -0
- package/dist/types/lsp.d.ts +90 -0
- package/dist/types/lsp.d.ts.map +1 -0
- package/dist/types/lsp.js +4 -0
- package/dist/types/messaging.d.ts +6 -11
- package/dist/types/messaging.d.ts.map +1 -1
- package/dist/types/permissions.d.ts +35 -0
- package/dist/types/permissions.d.ts.map +1 -0
- package/dist/types/permissions.js +12 -0
- package/dist/types/session.d.ts +1 -6
- package/dist/types/session.d.ts.map +1 -1
- package/dist/types/skills.d.ts +1 -0
- package/dist/types/skills.d.ts.map +1 -1
- package/dist/types/tools.d.ts +35 -0
- package/dist/types/tools.d.ts.map +1 -0
- package/dist/types/tools.js +4 -0
- package/dist/utils/abortUtils.d.ts +34 -0
- package/dist/utils/abortUtils.d.ts.map +1 -0
- package/dist/utils/abortUtils.js +92 -0
- package/dist/utils/bashHistory.d.ts +4 -0
- package/dist/utils/bashHistory.d.ts.map +1 -1
- package/dist/utils/bashHistory.js +21 -4
- package/dist/utils/builtinSubagents.d.ts +7 -0
- package/dist/utils/builtinSubagents.d.ts.map +1 -0
- package/dist/utils/builtinSubagents.js +65 -0
- package/dist/utils/cacheControlUtils.d.ts +8 -33
- package/dist/utils/cacheControlUtils.d.ts.map +1 -1
- package/dist/utils/cacheControlUtils.js +83 -126
- package/dist/utils/constants.d.ts +0 -12
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +1 -13
- package/dist/utils/convertMessagesForAPI.d.ts +2 -1
- package/dist/utils/convertMessagesForAPI.d.ts.map +1 -1
- package/dist/utils/convertMessagesForAPI.js +33 -14
- package/dist/utils/fileSearch.d.ts +14 -0
- package/dist/utils/fileSearch.d.ts.map +1 -0
- package/dist/utils/fileSearch.js +88 -0
- package/dist/utils/fileUtils.d.ts +14 -2
- package/dist/utils/fileUtils.d.ts.map +1 -1
- package/dist/utils/fileUtils.js +101 -17
- package/dist/utils/globalLogger.d.ts +0 -14
- package/dist/utils/globalLogger.d.ts.map +1 -1
- package/dist/utils/globalLogger.js +0 -16
- package/dist/utils/largeOutputHandler.d.ts +15 -0
- package/dist/utils/largeOutputHandler.d.ts.map +1 -0
- package/dist/utils/largeOutputHandler.js +40 -0
- package/dist/utils/markdownParser.d.ts.map +1 -1
- package/dist/utils/markdownParser.js +1 -17
- package/dist/utils/messageOperations.d.ts +1 -11
- package/dist/utils/messageOperations.d.ts.map +1 -1
- package/dist/utils/messageOperations.js +7 -24
- package/dist/utils/pathEncoder.d.ts +4 -0
- package/dist/utils/pathEncoder.d.ts.map +1 -1
- package/dist/utils/pathEncoder.js +16 -9
- package/dist/utils/subagentParser.d.ts +2 -2
- package/dist/utils/subagentParser.d.ts.map +1 -1
- package/dist/utils/subagentParser.js +10 -7
- package/dist/utils/tokenEstimator.d.ts +39 -0
- package/dist/utils/tokenEstimator.d.ts.map +1 -0
- package/dist/utils/tokenEstimator.js +55 -0
- package/package.json +5 -8
- package/src/agent.ts +460 -216
- package/src/index.ts +2 -0
- package/src/managers/aiManager.ts +107 -111
- package/src/managers/backgroundBashManager.ts +4 -3
- package/src/managers/hookManager.ts +44 -39
- package/src/managers/liveConfigManager.ts +524 -138
- package/src/managers/lspManager.ts +434 -0
- package/src/managers/messageManager.ts +73 -103
- package/src/managers/permissionManager.ts +276 -0
- package/src/managers/skillManager.ts +3 -1
- package/src/managers/slashCommandManager.ts +1 -2
- package/src/managers/subagentManager.ts +116 -159
- package/src/managers/toolManager.ts +95 -3
- package/src/services/aiService.ts +207 -26
- package/src/services/configurationService.ts +762 -0
- package/src/services/fileWatcher.ts +5 -6
- package/src/services/hook.ts +50 -631
- package/src/services/jsonlHandler.ts +84 -100
- package/src/services/memory.ts +2 -59
- package/src/services/session.ts +338 -213
- package/src/tools/bashTool.ts +89 -16
- package/src/tools/deleteFileTool.ts +36 -0
- package/src/tools/editTool.ts +41 -7
- package/src/tools/lspTool.ts +760 -0
- package/src/tools/multiEditTool.ts +37 -8
- package/src/tools/readTool.ts +125 -2
- package/src/tools/skillTool.ts +2 -2
- package/src/tools/todoWriteTool.ts +33 -1
- package/src/tools/types.ts +15 -9
- package/src/tools/writeTool.ts +36 -10
- package/src/types/commands.ts +0 -1
- package/src/types/config.ts +5 -0
- package/src/types/configuration.ts +73 -0
- package/src/types/core.ts +11 -0
- package/src/types/environment.ts +44 -0
- package/src/types/fileSearch.ts +4 -0
- package/src/types/hooks.ts +14 -11
- package/src/types/index.ts +5 -0
- package/src/types/lsp.ts +96 -0
- package/src/types/messaging.ts +8 -13
- package/src/types/permissions.ts +48 -0
- package/src/types/session.ts +3 -8
- package/src/types/skills.ts +1 -0
- package/src/types/tools.ts +38 -0
- package/src/utils/abortUtils.ts +118 -0
- package/src/utils/bashHistory.ts +28 -4
- package/src/utils/builtinSubagents.ts +71 -0
- package/src/utils/cacheControlUtils.ts +106 -171
- package/src/utils/constants.ts +1 -16
- package/src/utils/convertMessagesForAPI.ts +38 -14
- package/src/utils/fileSearch.ts +107 -0
- package/src/utils/fileUtils.ts +114 -19
- package/src/utils/globalLogger.ts +0 -17
- package/src/utils/largeOutputHandler.ts +55 -0
- package/src/utils/markdownParser.ts +1 -19
- package/src/utils/messageOperations.ts +7 -35
- package/src/utils/pathEncoder.ts +24 -9
- package/src/utils/subagentParser.ts +11 -8
- package/src/utils/tokenEstimator.ts +68 -0
- package/dist/constants/events.d.ts +0 -28
- package/dist/constants/events.d.ts.map +0 -1
- package/dist/constants/events.js +0 -27
- package/dist/services/configurationWatcher.d.ts +0 -120
- package/dist/services/configurationWatcher.d.ts.map +0 -1
- package/dist/services/configurationWatcher.js +0 -439
- package/dist/services/memoryStore.d.ts +0 -81
- package/dist/services/memoryStore.d.ts.map +0 -1
- package/dist/services/memoryStore.js +0 -200
- package/dist/types/memoryStore.d.ts +0 -82
- package/dist/types/memoryStore.d.ts.map +0 -1
- package/dist/types/memoryStore.js +0 -7
- package/dist/utils/configResolver.d.ts +0 -65
- package/dist/utils/configResolver.d.ts.map +0 -1
- package/dist/utils/configResolver.js +0 -210
- package/src/constants/events.ts +0 -38
- package/src/services/configurationWatcher.ts +0 -622
- package/src/services/memoryStore.ts +0 -279
- package/src/types/memoryStore.ts +0 -94
- package/src/utils/configResolver.ts +0 -302
package/dist/services/hook.d.ts
CHANGED
|
@@ -1,138 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Hook Services
|
|
2
|
+
* Hook Execution Services
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Provides hook command execution functionality and hook-specific configuration loading.
|
|
5
|
+
* This module focuses on hook execution while delegating general Wave configuration
|
|
6
|
+
* management to ConfigurationService.
|
|
6
7
|
*/
|
|
7
|
-
import { type HookExecutionContext, type HookExecutionResult, type HookExecutionOptions, type ExtendedHookExecutionContext
|
|
8
|
-
import { type EnvironmentValidationResult, type MergedEnvironmentContext, type EnvironmentMergeOptions } from "../types/environment.js";
|
|
8
|
+
import { type HookExecutionContext, type HookExecutionResult, type HookExecutionOptions, type ExtendedHookExecutionContext } from "../types/hooks.js";
|
|
9
9
|
/**
|
|
10
10
|
* Execute a single hook command
|
|
11
11
|
*/
|
|
12
|
-
export declare function executeCommand(command: string, context: HookExecutionContext | ExtendedHookExecutionContext, options?: HookExecutionOptions
|
|
12
|
+
export declare function executeCommand(command: string, context: HookExecutionContext | ExtendedHookExecutionContext, options?: HookExecutionOptions): Promise<HookExecutionResult>;
|
|
13
13
|
/**
|
|
14
14
|
* Execute multiple commands in sequence
|
|
15
15
|
*/
|
|
16
|
-
export declare function executeCommands(commands: string[], context: HookExecutionContext | ExtendedHookExecutionContext, options?: HookExecutionOptions
|
|
16
|
+
export declare function executeCommands(commands: string[], context: HookExecutionContext | ExtendedHookExecutionContext, options?: HookExecutionOptions): Promise<HookExecutionResult[]>;
|
|
17
17
|
/**
|
|
18
18
|
* Validate command safety (basic checks)
|
|
19
19
|
*/
|
|
20
20
|
export declare function isCommandSafe(command: string): boolean;
|
|
21
|
-
/**
|
|
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
|
|
32
|
-
*/
|
|
33
|
-
export declare function getUserHooksConfigPath(): string;
|
|
34
|
-
/**
|
|
35
|
-
* Get the project-specific hooks configuration file path (legacy function)
|
|
36
|
-
* @deprecated Use getProjectConfigPaths() from configPaths.ts for better priority support
|
|
37
|
-
*/
|
|
38
|
-
export declare function getProjectHooksConfigPath(workdir: string): string;
|
|
39
|
-
/**
|
|
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)
|
|
89
|
-
*/
|
|
90
|
-
export declare function loadHooksConfigFromFile(filePath: string): PartialHookConfiguration | null;
|
|
91
|
-
/**
|
|
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)
|
|
103
|
-
*/
|
|
104
|
-
export declare function loadUserHooksConfig(): PartialHookConfiguration | null;
|
|
105
|
-
/**
|
|
106
|
-
* Load project-specific hooks configuration (legacy function)
|
|
107
|
-
*/
|
|
108
|
-
export declare function loadProjectHooksConfig(workdir: string): PartialHookConfiguration | null;
|
|
109
|
-
/**
|
|
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)
|
|
117
|
-
*/
|
|
118
|
-
export declare function loadMergedHooksConfig(workdir: string): PartialHookConfiguration | null;
|
|
119
|
-
/**
|
|
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
|
|
123
|
-
*/
|
|
124
|
-
export declare function hasHooksConfiguration(workdir: string): boolean;
|
|
125
|
-
/**
|
|
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
|
|
129
|
-
*/
|
|
130
|
-
export declare function getHooksConfigurationInfo(workdir: string): {
|
|
131
|
-
hasUser: boolean;
|
|
132
|
-
hasProject: boolean;
|
|
133
|
-
paths: string[];
|
|
134
|
-
userPaths: string[];
|
|
135
|
-
projectPaths: string[];
|
|
136
|
-
existingPaths: string[];
|
|
137
|
-
};
|
|
138
21
|
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/services/hook.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/services/hook.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EAElC,MAAM,mBAAmB,CAAC;AAyE3B;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,oBAAoB,GAAG,4BAA4B,EAC5D,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC,CA4H9B;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAAE,EAClB,OAAO,EAAE,oBAAoB,GAAG,4BAA4B,EAC5D,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAchC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAsBtD"}
|