wave-agent-sdk 1.0.4 → 1.0.6
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 +23 -1
- package/dist/agent.js +34 -4
- package/dist/managers/aiManager.d.ts +36 -0
- package/dist/managers/aiManager.js +240 -8
- package/dist/managers/messageManager.d.ts +1 -3
- package/dist/managers/messageManager.js +19 -9
- package/dist/managers/slashCommandManager.js +28 -0
- package/dist/managers/subagentManager.d.ts +0 -2
- package/dist/services/session.js +2 -9
- package/dist/telemetry/instrumentation.d.ts +1 -1
- package/dist/telemetry/instrumentation.js +57 -28
- package/dist/tools/bashTool.js +16 -6
- package/dist/tools/grepTool.js +11 -3
- package/dist/types/index.d.ts +3 -0
- package/dist/types/messaging.d.ts +2 -0
- package/dist/utils/containerSetup.js +0 -3
- package/dist/utils/messageOperations.d.ts +10 -1
- package/dist/utils/messageOperations.js +19 -1
- package/dist/utils/notificationXml.js +5 -0
- package/dist/utils/ripgrep.d.ts +4 -4
- package/dist/utils/ripgrep.js +4 -27
- package/package.json +20 -8
- package/bin/rg +0 -79
- package/dist/managers/forkedAgentManager.d.ts +0 -50
- package/dist/managers/forkedAgentManager.js +0 -130
- package/scripts/install_ripgrep.js +0 -111
- package/scripts/postinstall.js +0 -38
- package/src/agent.ts +0 -1271
- package/src/constants/subagents.ts +0 -4
- package/src/constants/toolLimits.ts +0 -15
- package/src/constants/tools.ts +0 -24
- package/src/core/plugin.ts +0 -237
- package/src/core/session.ts +0 -9
- package/src/index.ts +0 -38
- package/src/managers/MemoryRuleManager.ts +0 -198
- package/src/managers/aiManager.ts +0 -2429
- package/src/managers/backgroundTaskManager.ts +0 -480
- package/src/managers/bangManager.ts +0 -119
- package/src/managers/cronManager.ts +0 -401
- package/src/managers/foregroundTaskManager.ts +0 -30
- package/src/managers/forkedAgentManager.ts +0 -216
- package/src/managers/hookManager.ts +0 -1089
- package/src/managers/liveConfigManager.ts +0 -445
- package/src/managers/lspManager.ts +0 -470
- package/src/managers/mcpManager.ts +0 -1010
- package/src/managers/messageManager.ts +0 -1180
- package/src/managers/messageQueue.ts +0 -157
- package/src/managers/permissionManager.ts +0 -1140
- package/src/managers/planManager.ts +0 -112
- package/src/managers/pluginManager.ts +0 -330
- package/src/managers/pluginScopeManager.ts +0 -124
- package/src/managers/reversionManager.ts +0 -178
- package/src/managers/skillManager.ts +0 -578
- package/src/managers/slashCommandManager.ts +0 -564
- package/src/managers/subagentManager.ts +0 -915
- package/src/managers/toolManager.ts +0 -489
- package/src/managers/workflowManager.ts +0 -493
- package/src/prompts/autoMemory.ts +0 -33
- package/src/prompts/autoMemoryExtraction.ts +0 -146
- package/src/prompts/index.ts +0 -506
- package/src/prompts/planModeReminders.ts +0 -126
- package/src/services/GitService.ts +0 -131
- package/src/services/MarketplaceService.ts +0 -1052
- package/src/services/MemoryRuleService.ts +0 -71
- package/src/services/aiService.ts +0 -919
- package/src/services/authService.ts +0 -565
- package/src/services/autoMemoryService.ts +0 -280
- package/src/services/configurationService.ts +0 -1520
- package/src/services/fileWatcher.ts +0 -319
- package/src/services/hook.ts +0 -348
- package/src/services/initializationService.ts +0 -357
- package/src/services/interactionService.ts +0 -229
- package/src/services/jsonlHandler.ts +0 -295
- package/src/services/memory.ts +0 -234
- package/src/services/pluginLoader.ts +0 -252
- package/src/services/remoteSettingsService.ts +0 -366
- package/src/services/reversionService.ts +0 -122
- package/src/services/session.ts +0 -922
- package/src/services/taskManager.ts +0 -321
- package/src/telemetry/events.ts +0 -65
- package/src/telemetry/instrumentation.ts +0 -499
- package/src/telemetry/sessionTracing.ts +0 -348
- package/src/tools/agentTool.ts +0 -322
- package/src/tools/askUserQuestion.ts +0 -160
- package/src/tools/bashTool.ts +0 -621
- package/src/tools/buildTool.ts +0 -61
- package/src/tools/cronCreateTool.ts +0 -161
- package/src/tools/cronDeleteTool.ts +0 -51
- package/src/tools/cronListTool.ts +0 -47
- package/src/tools/editTool.ts +0 -313
- package/src/tools/enterPlanMode.ts +0 -124
- package/src/tools/enterWorktreeTool.ts +0 -190
- package/src/tools/exitPlanMode.ts +0 -139
- package/src/tools/exitWorktreeTool.ts +0 -236
- package/src/tools/globTool.ts +0 -167
- package/src/tools/grepTool.ts +0 -399
- package/src/tools/lspTool.ts +0 -883
- package/src/tools/readTool.ts +0 -426
- package/src/tools/skillTool.ts +0 -248
- package/src/tools/taskManagementTools.ts +0 -574
- package/src/tools/taskStopTool.ts +0 -78
- package/src/tools/types.ts +0 -137
- package/src/tools/webFetchTool.ts +0 -373
- package/src/tools/workflowTool.ts +0 -205
- package/src/tools/writeTool.ts +0 -267
- package/src/types/agent.ts +0 -128
- package/src/types/auth.ts +0 -19
- package/src/types/commands.ts +0 -30
- package/src/types/config.ts +0 -43
- package/src/types/configuration.ts +0 -168
- package/src/types/core.ts +0 -105
- package/src/types/cron.ts +0 -13
- package/src/types/environment.ts +0 -106
- package/src/types/fileSearch.ts +0 -4
- package/src/types/history.ts +0 -7
- package/src/types/hooks.ts +0 -256
- package/src/types/index.ts +0 -41
- package/src/types/lsp.ts +0 -98
- package/src/types/marketplace.ts +0 -71
- package/src/types/mcp.ts +0 -43
- package/src/types/memoryRule.ts +0 -31
- package/src/types/messaging.ts +0 -114
- package/src/types/permissions.ts +0 -80
- package/src/types/plugins.ts +0 -39
- package/src/types/processes.ts +0 -99
- package/src/types/reversion.ts +0 -29
- package/src/types/session.ts +0 -12
- package/src/types/skills.ts +0 -108
- package/src/types/tasks.ts +0 -13
- package/src/types/telemetry.ts +0 -98
- package/src/types/tools.ts +0 -44
- package/src/types/workflow.ts +0 -6
- package/src/utils/abortUtils.ts +0 -118
- package/src/utils/atomicWrite.ts +0 -61
- package/src/utils/bashParser.ts +0 -899
- package/src/utils/cacheControlUtils.ts +0 -426
- package/src/utils/commandArgumentParser.ts +0 -161
- package/src/utils/commandPathResolver.ts +0 -88
- package/src/utils/configPaths.ts +0 -220
- package/src/utils/configValidator.ts +0 -100
- package/src/utils/constants.ts +0 -39
- package/src/utils/container.ts +0 -92
- package/src/utils/containerSetup.ts +0 -371
- package/src/utils/convertMessagesForAPI.ts +0 -326
- package/src/utils/cronTasks.ts +0 -128
- package/src/utils/cronTasksLock.ts +0 -182
- package/src/utils/cronToHuman.ts +0 -99
- package/src/utils/customCommands.ts +0 -95
- package/src/utils/editUtils.ts +0 -20
- package/src/utils/fileFormat.ts +0 -40
- package/src/utils/fileSearch.ts +0 -151
- package/src/utils/fileUtils.ts +0 -223
- package/src/utils/gitUtils.ts +0 -315
- package/src/utils/globalLogger.ts +0 -128
- package/src/utils/groupMessagesByApiRound.ts +0 -121
- package/src/utils/hookMatcher.ts +0 -176
- package/src/utils/markdownParser.ts +0 -317
- package/src/utils/mcpUtils.ts +0 -138
- package/src/utils/messageOperations.ts +0 -641
- package/src/utils/modelCapabilities.ts +0 -30
- package/src/utils/nameGenerator.ts +0 -99
- package/src/utils/notificationXml.ts +0 -57
- package/src/utils/openaiClient.ts +0 -251
- package/src/utils/parseCronExpression.ts +0 -78
- package/src/utils/path.ts +0 -72
- package/src/utils/pathEncoder.ts +0 -400
- package/src/utils/pathSafety.ts +0 -40
- package/src/utils/promptHistory.ts +0 -168
- package/src/utils/ripgrep.ts +0 -35
- package/src/utils/shellResolver.ts +0 -190
- package/src/utils/skillParser.ts +0 -246
- package/src/utils/stringUtils.ts +0 -156
- package/src/utils/subagentParser.ts +0 -279
- package/src/utils/taskReminder.ts +0 -96
- package/src/utils/tokenCalculation.ts +0 -43
- package/src/utils/tokenEstimate.ts +0 -34
- package/src/utils/toolResultStorage.ts +0 -117
- package/src/utils/worktreeSession.ts +0 -26
- package/src/utils/worktreeUtils.ts +0 -786
- package/src/workflow/budgetTracker.ts +0 -34
- package/src/workflow/concurrencyLimiter.ts +0 -47
- package/src/workflow/journal.ts +0 -95
- package/src/workflow/progressReporter.ts +0 -141
- package/src/workflow/runState.ts +0 -65
- package/src/workflow/scriptRuntime.ts +0 -274
- package/src/workflow/structuredOutput.ts +0 -123
- package/src/workflow/types.ts +0 -101
- package/src/workflow/workflowApis.ts +0 -410
- package/vendor/ripgrep/linux-aarch64/rg +0 -0
- package/vendor/ripgrep/linux-x86_64/rg +0 -0
- package/vendor/ripgrep/macos-aarch64/rg +0 -0
- package/vendor/ripgrep/macos-x86_64/rg +0 -0
- package/vendor/ripgrep/windows-aarch64/rg.exe +0 -0
- package/vendor/ripgrep/windows-x86_64/rg.exe +0 -0
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { exec } from "child_process";
|
|
2
|
-
import { promisify } from "util";
|
|
3
|
-
|
|
4
|
-
const execAsync = promisify(exec);
|
|
5
|
-
|
|
6
|
-
export class GitService {
|
|
7
|
-
private getTimeout(): number {
|
|
8
|
-
const envTimeout = process.env.WAVE_PLUGIN_GIT_TIMEOUT_MS;
|
|
9
|
-
if (envTimeout) {
|
|
10
|
-
const parsed = parseInt(envTimeout, 10);
|
|
11
|
-
if (!isNaN(parsed)) {
|
|
12
|
-
return parsed;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return 120000; // Default 120 seconds
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Checks if git is installed and available in the system path
|
|
20
|
-
*/
|
|
21
|
-
async isGitAvailable(): Promise<boolean> {
|
|
22
|
-
try {
|
|
23
|
-
await execAsync("git --version");
|
|
24
|
-
return true;
|
|
25
|
-
} catch {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Clones a Git repository to a local path
|
|
32
|
-
*/
|
|
33
|
-
async clone(
|
|
34
|
-
urlOrRepo: string,
|
|
35
|
-
targetPath: string,
|
|
36
|
-
ref?: string,
|
|
37
|
-
): Promise<void> {
|
|
38
|
-
if (process.env.VITEST && !process.env.ALLOW_REAL_GIT) {
|
|
39
|
-
throw new Error(
|
|
40
|
-
`Real git clone is disabled in tests. URL: ${urlOrRepo}, Path: ${targetPath}`,
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
if (!(await this.isGitAvailable())) {
|
|
44
|
-
throw new Error(
|
|
45
|
-
"Git is not installed or not found in PATH. Please install Git to use Git/GitHub marketplaces.",
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
let url = urlOrRepo;
|
|
50
|
-
if (
|
|
51
|
-
!urlOrRepo.startsWith("http://") &&
|
|
52
|
-
!urlOrRepo.startsWith("https://") &&
|
|
53
|
-
!urlOrRepo.startsWith("git@") &&
|
|
54
|
-
!urlOrRepo.startsWith("ssh://")
|
|
55
|
-
) {
|
|
56
|
-
// Assume GitHub repo format: owner/repo
|
|
57
|
-
url = `https://github.com/${urlOrRepo}.git`;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
try {
|
|
61
|
-
const refArgs = ref ? `-b "${ref}"` : "--depth 1";
|
|
62
|
-
await execAsync(`git clone ${refArgs} "${url}" "${targetPath}"`, {
|
|
63
|
-
env: { ...process.env, LC_ALL: "C" },
|
|
64
|
-
timeout: this.getTimeout(),
|
|
65
|
-
});
|
|
66
|
-
} catch (error) {
|
|
67
|
-
throw this.handleGitError(urlOrRepo, error);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Pulls the latest changes in a local repository
|
|
73
|
-
*/
|
|
74
|
-
async pull(targetPath: string): Promise<void> {
|
|
75
|
-
if (process.env.VITEST && !process.env.ALLOW_REAL_GIT) {
|
|
76
|
-
throw new Error(
|
|
77
|
-
`Real git pull is disabled in tests. Path: ${targetPath}`,
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
if (!(await this.isGitAvailable())) {
|
|
81
|
-
throw new Error(
|
|
82
|
-
"Git is not installed or not found in PATH. Please install Git to use Git/GitHub marketplaces.",
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
try {
|
|
86
|
-
await execAsync(`git -C "${targetPath}" pull`, {
|
|
87
|
-
env: { ...process.env, LC_ALL: "C" },
|
|
88
|
-
timeout: this.getTimeout(),
|
|
89
|
-
});
|
|
90
|
-
} catch (error) {
|
|
91
|
-
throw this.handleGitError(targetPath, error);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
private handleGitError(context: string, error: unknown): Error {
|
|
96
|
-
const stderr = (error as { stderr?: string })?.stderr || "";
|
|
97
|
-
const message = (error as Error)?.message || String(error);
|
|
98
|
-
const killed = (error as { killed?: boolean })?.killed || false;
|
|
99
|
-
|
|
100
|
-
if (message.includes("ETIMEDOUT") || killed) {
|
|
101
|
-
return new Error(
|
|
102
|
-
`Git operation timed out after ${this.getTimeout() / 1000}s. The repository may be too large or the network is slow. You can increase the timeout by setting the WAVE_PLUGIN_GIT_TIMEOUT_MS environment variable.`,
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (
|
|
107
|
-
stderr.includes("Repository not found") ||
|
|
108
|
-
stderr.includes("not found")
|
|
109
|
-
) {
|
|
110
|
-
return new Error(
|
|
111
|
-
`Repository "${context}" not found. It might be private or doesn't exist.`,
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
if (stderr.includes("Could not read from remote repository")) {
|
|
115
|
-
return new Error(
|
|
116
|
-
`Could not access repository "${context}". Please check your internet connection and permissions.`,
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
if (stderr.includes("Authentication failed")) {
|
|
120
|
-
return new Error(`Authentication failed for repository "${context}".`);
|
|
121
|
-
}
|
|
122
|
-
if (stderr.includes("rate limit")) {
|
|
123
|
-
return new Error(`GitHub rate limit exceeded. Please try again later.`);
|
|
124
|
-
}
|
|
125
|
-
if (stderr.includes("not a git repository")) {
|
|
126
|
-
return new Error(`The path "${context}" is not a valid git repository.`);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return new Error(`Git operation failed for "${context}": ${message}`);
|
|
130
|
-
}
|
|
131
|
-
}
|