wave-agent-sdk 0.10.0 → 0.10.2
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 +6 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +2 -0
- package/dist/core/session.d.ts +1 -1
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/managers/aiManager.d.ts.map +1 -1
- package/dist/managers/aiManager.js +1 -0
- package/dist/managers/backgroundTaskManager.d.ts +3 -0
- package/dist/managers/backgroundTaskManager.d.ts.map +1 -1
- package/dist/managers/backgroundTaskManager.js +3 -0
- package/dist/managers/messageManager.d.ts +1 -6
- package/dist/managers/messageManager.d.ts.map +1 -1
- package/dist/managers/messageManager.js +0 -6
- package/dist/managers/permissionManager.d.ts +1 -1
- package/dist/managers/permissionManager.d.ts.map +1 -1
- package/dist/managers/permissionManager.js +47 -10
- package/dist/managers/skillManager.d.ts +17 -2
- package/dist/managers/skillManager.d.ts.map +1 -1
- package/dist/managers/skillManager.js +93 -21
- package/dist/managers/slashCommandManager.d.ts.map +1 -1
- package/dist/managers/slashCommandManager.js +7 -1
- package/dist/managers/toolManager.d.ts.map +1 -1
- package/dist/managers/toolManager.js +1 -0
- package/dist/prompts/index.d.ts +1 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +1 -0
- package/dist/services/configurationService.d.ts.map +1 -1
- package/dist/services/configurationService.js +1 -0
- package/dist/services/fileWatcher.d.ts.map +1 -1
- package/dist/services/fileWatcher.js +27 -15
- package/dist/services/session.d.ts +16 -2
- package/dist/services/session.d.ts.map +1 -1
- package/dist/services/session.js +110 -7
- package/dist/tools/askUserQuestion.d.ts.map +1 -1
- package/dist/tools/askUserQuestion.js +8 -1
- package/dist/tools/bashTool.d.ts.map +1 -1
- package/dist/tools/bashTool.js +4 -4
- package/dist/tools/editTool.d.ts.map +1 -1
- package/dist/tools/editTool.js +1 -1
- package/dist/tools/exitPlanMode.d.ts.map +1 -1
- package/dist/tools/exitPlanMode.js +3 -1
- package/dist/tools/grepTool.d.ts.map +1 -1
- package/dist/tools/grepTool.js +1 -1
- package/dist/tools/lspTool.d.ts.map +1 -1
- package/dist/tools/lspTool.js +47 -15
- package/dist/tools/taskOutputTool.d.ts.map +1 -1
- package/dist/tools/taskOutputTool.js +22 -5
- package/dist/tools/types.d.ts +3 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/writeTool.d.ts.map +1 -1
- package/dist/tools/writeTool.js +1 -1
- package/dist/types/agent.d.ts +2 -0
- package/dist/types/agent.d.ts.map +1 -1
- package/dist/types/configuration.d.ts +2 -0
- package/dist/types/configuration.d.ts.map +1 -1
- package/dist/types/permissions.d.ts +2 -0
- package/dist/types/permissions.d.ts.map +1 -1
- package/dist/types/skills.d.ts +4 -2
- package/dist/types/skills.d.ts.map +1 -1
- package/dist/utils/bashParser.d.ts.map +1 -1
- package/dist/utils/bashParser.js +50 -0
- package/dist/utils/configPaths.d.ts +6 -0
- package/dist/utils/configPaths.d.ts.map +1 -1
- package/dist/utils/configPaths.js +23 -2
- package/dist/utils/containerSetup.d.ts.map +1 -1
- package/dist/utils/containerSetup.js +4 -1
- package/dist/utils/gitUtils.d.ts +6 -0
- package/dist/utils/gitUtils.d.ts.map +1 -1
- package/dist/utils/gitUtils.js +22 -0
- package/package.json +1 -1
- package/src/agent.ts +18 -2
- package/src/builtin-skills/settings/HOOKS.md +95 -0
- package/src/builtin-skills/settings/SKILL.md +86 -0
- package/src/core/session.ts +2 -0
- package/src/managers/aiManager.ts +1 -0
- package/src/managers/backgroundTaskManager.ts +11 -1
- package/src/managers/messageManager.ts +1 -9
- package/src/managers/permissionManager.ts +51 -9
- package/src/managers/skillManager.ts +111 -25
- package/src/managers/slashCommandManager.ts +8 -1
- package/src/managers/toolManager.ts +1 -0
- package/src/prompts/index.ts +1 -0
- package/src/services/configurationService.ts +1 -0
- package/src/services/fileWatcher.ts +33 -17
- package/src/services/session.ts +124 -7
- package/src/tools/askUserQuestion.ts +10 -0
- package/src/tools/bashTool.ts +4 -3
- package/src/tools/editTool.ts +1 -0
- package/src/tools/exitPlanMode.ts +4 -1
- package/src/tools/grepTool.ts +2 -1
- package/src/tools/lspTool.ts +99 -9
- package/src/tools/taskOutputTool.ts +25 -6
- package/src/tools/types.ts +4 -0
- package/src/tools/writeTool.ts +1 -0
- package/src/types/agent.ts +2 -0
- package/src/types/configuration.ts +2 -0
- package/src/types/permissions.ts +2 -0
- package/src/types/skills.ts +4 -2
- package/src/utils/bashParser.ts +54 -0
- package/src/utils/configPaths.ts +28 -2
- package/src/utils/containerSetup.ts +4 -1
- package/src/utils/gitUtils.ts +22 -0
package/src/utils/configPaths.ts
CHANGED
|
@@ -10,9 +10,29 @@
|
|
|
10
10
|
* - Project configs override user configs (existing behavior)
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { join } from "path";
|
|
13
|
+
import { join, dirname } from "path";
|
|
14
14
|
import { homedir } from "os";
|
|
15
15
|
import { existsSync } from "fs";
|
|
16
|
+
import { fileURLToPath } from "url";
|
|
17
|
+
|
|
18
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
19
|
+
const __dirname = dirname(__filename);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Get the builtin skills directory path
|
|
23
|
+
*/
|
|
24
|
+
export function getBuiltinSkillsDir(): string {
|
|
25
|
+
// In development, it's in src/builtin-skills
|
|
26
|
+
// In production (dist), it should be in dist/builtin-skills
|
|
27
|
+
// We'll look for it relative to this file
|
|
28
|
+
const devPath = join(__dirname, "..", "builtin-skills");
|
|
29
|
+
const prodPath = join(__dirname, "builtin-skills");
|
|
30
|
+
|
|
31
|
+
if (existsSync(devPath)) {
|
|
32
|
+
return devPath;
|
|
33
|
+
}
|
|
34
|
+
return prodPath;
|
|
35
|
+
}
|
|
16
36
|
|
|
17
37
|
/**
|
|
18
38
|
* Get the user-specific configuration file path (legacy function)
|
|
@@ -62,15 +82,18 @@ export function getProjectConfigPaths(workdir: string): string[] {
|
|
|
62
82
|
export function getAllConfigPaths(workdir: string): {
|
|
63
83
|
userPaths: string[];
|
|
64
84
|
projectPaths: string[];
|
|
85
|
+
builtinPaths: string[];
|
|
65
86
|
allPaths: string[];
|
|
66
87
|
} {
|
|
67
88
|
const userPaths = getUserConfigPaths();
|
|
68
89
|
const projectPaths = getProjectConfigPaths(workdir);
|
|
90
|
+
const builtinPaths = [join(getBuiltinSkillsDir(), "settings", "SKILL.md")];
|
|
69
91
|
|
|
70
92
|
return {
|
|
71
93
|
userPaths,
|
|
72
94
|
projectPaths,
|
|
73
|
-
|
|
95
|
+
builtinPaths,
|
|
96
|
+
allPaths: [...userPaths, ...projectPaths, ...builtinPaths],
|
|
74
97
|
};
|
|
75
98
|
}
|
|
76
99
|
|
|
@@ -81,17 +104,20 @@ export function getAllConfigPaths(workdir: string): {
|
|
|
81
104
|
export function getExistingConfigPaths(workdir: string): {
|
|
82
105
|
userPaths: string[];
|
|
83
106
|
projectPaths: string[];
|
|
107
|
+
builtinPaths: string[];
|
|
84
108
|
existingPaths: string[];
|
|
85
109
|
} {
|
|
86
110
|
const allPaths = getAllConfigPaths(workdir);
|
|
87
111
|
|
|
88
112
|
const existingUserPaths = allPaths.userPaths.filter(existsSync);
|
|
89
113
|
const existingProjectPaths = allPaths.projectPaths.filter(existsSync);
|
|
114
|
+
const existingBuiltinPaths = allPaths.builtinPaths.filter(existsSync);
|
|
90
115
|
const allExistingPaths = allPaths.allPaths.filter(existsSync);
|
|
91
116
|
|
|
92
117
|
return {
|
|
93
118
|
userPaths: existingUserPaths,
|
|
94
119
|
projectPaths: existingProjectPaths,
|
|
120
|
+
builtinPaths: existingBuiltinPaths,
|
|
95
121
|
existingPaths: allExistingPaths,
|
|
96
122
|
};
|
|
97
123
|
}
|
|
@@ -147,7 +147,10 @@ export function setupAgentContainer(
|
|
|
147
147
|
const hookManager = new HookManager(container, workdir);
|
|
148
148
|
container.register("HookManager", hookManager);
|
|
149
149
|
|
|
150
|
-
const skillManager = new SkillManager(container, {
|
|
150
|
+
const skillManager = new SkillManager(container, {
|
|
151
|
+
workdir,
|
|
152
|
+
watch: options.watchSkills ?? true,
|
|
153
|
+
});
|
|
151
154
|
container.register("SkillManager", skillManager);
|
|
152
155
|
|
|
153
156
|
container.register(
|
package/src/utils/gitUtils.ts
CHANGED
|
@@ -59,6 +59,28 @@ export function getGitCommonDir(cwd: string): string {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Get the main repository root directory (the first worktree in the list)
|
|
64
|
+
* @param cwd Working directory
|
|
65
|
+
* @returns Main repository root path
|
|
66
|
+
*/
|
|
67
|
+
export function getGitMainRepoRoot(cwd: string): string {
|
|
68
|
+
try {
|
|
69
|
+
const output = execSync("git worktree list --porcelain", {
|
|
70
|
+
cwd,
|
|
71
|
+
encoding: "utf8",
|
|
72
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
73
|
+
}).trim();
|
|
74
|
+
const lines = output.split("\n");
|
|
75
|
+
if (lines.length > 0 && lines[0].startsWith("worktree ")) {
|
|
76
|
+
return lines[0].substring("worktree ".length).trim();
|
|
77
|
+
}
|
|
78
|
+
return getGitRepoRoot(cwd);
|
|
79
|
+
} catch {
|
|
80
|
+
return getGitRepoRoot(cwd);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
62
84
|
/**
|
|
63
85
|
* Get the default remote branch (e.g., origin/main)
|
|
64
86
|
* @param cwd Working directory
|