wave-agent-sdk 0.10.1 → 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/backgroundTaskManager.d.ts +3 -0
- package/dist/managers/backgroundTaskManager.d.ts.map +1 -1
- package/dist/managers/backgroundTaskManager.js +3 -0
- package/dist/managers/permissionManager.d.ts.map +1 -1
- package/dist/managers/permissionManager.js +33 -4
- 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 -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 +9 -2
- package/dist/services/session.d.ts.map +1 -1
- package/dist/services/session.js +77 -7
- package/dist/tools/bashTool.js +3 -3
- 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 +1 -0
- package/dist/tools/types.d.ts.map +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/skills.d.ts +4 -2
- package/dist/types/skills.d.ts.map +1 -1
- 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 +1 -0
- package/src/managers/backgroundTaskManager.ts +11 -1
- package/src/managers/permissionManager.ts +33 -4
- package/src/managers/skillManager.ts +111 -25
- package/src/managers/slashCommandManager.ts +8 -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 +83 -7
- package/src/tools/bashTool.ts +3 -3
- package/src/tools/exitPlanMode.ts +3 -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 +2 -0
- package/src/types/agent.ts +2 -0
- package/src/types/configuration.ts +2 -0
- package/src/types/skills.ts +4 -2
- package/src/utils/configPaths.ts +28 -2
- package/src/utils/containerSetup.ts +4 -1
- package/src/utils/gitUtils.ts +22 -0
package/dist/agent.d.ts
CHANGED
|
@@ -67,6 +67,9 @@ export declare class Agent {
|
|
|
67
67
|
stdout: string;
|
|
68
68
|
stderr: string;
|
|
69
69
|
status: string;
|
|
70
|
+
outputPath?: string;
|
|
71
|
+
type: string;
|
|
72
|
+
exitCode?: number;
|
|
70
73
|
} | null;
|
|
71
74
|
/** Kill background bash shell */
|
|
72
75
|
killBackgroundShell(id: string): boolean;
|
|
@@ -75,6 +78,9 @@ export declare class Agent {
|
|
|
75
78
|
stdout: string;
|
|
76
79
|
stderr: string;
|
|
77
80
|
status: string;
|
|
81
|
+
outputPath?: string;
|
|
82
|
+
type: string;
|
|
83
|
+
exitCode?: number;
|
|
78
84
|
} | null;
|
|
79
85
|
/** Stop background task */
|
|
80
86
|
stopBackgroundTask(id: string): boolean;
|
package/dist/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,YAAY,EACZ,kBAAkB,EAElB,YAAY,EACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,OAAO,EAEP,eAAe,EACf,aAAa,EACb,WAAW,EACX,KAAK,EACL,cAAc,EACd,cAAc,EACf,MAAM,kBAAkB,CAAC;AAY1B,qBAAa,KAAK;IAChB,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,SAAS,CAAY;IAE7B,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,qBAAqB,CAAwB;IACrD,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,mBAAmB,CAAsB;IACjD,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,qBAAqB,CAAwB;IACrD,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,oBAA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
|
}
|
|
325
325
|
// Cleanup subagent manager
|
|
326
326
|
this.subagentManager.cleanup();
|
|
327
|
+
// Cleanup skill manager
|
|
328
|
+
await this.skillManager.destroy();
|
|
327
329
|
// Cleanup live configuration reload
|
|
328
330
|
try {
|
|
329
331
|
await this.liveConfigManager.shutdown();
|
package/dist/core/session.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { listSessions, truncateContent, loadSessionFromJsonl, loadFullMessageThread, deleteSession, } from "../services/session.js";
|
|
1
|
+
export { listSessions, listAllSessions, truncateContent, loadSessionFromJsonl, loadFullMessageThread, deleteSession, } from "../services/session.js";
|
|
2
2
|
export type { SessionMetadata, SessionData } from "../services/session.js";
|
|
3
3
|
//# sourceMappingURL=session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,GACd,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,GACd,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/core/session.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { listSessions, truncateContent, loadSessionFromJsonl, loadFullMessageThread, deleteSession, } from "../services/session.js";
|
|
1
|
+
export { listSessions, listAllSessions, truncateContent, loadSessionFromJsonl, loadFullMessageThread, deleteSession, } from "../services/session.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,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MAAM,GACd;QACD,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,IAAI;IAoCD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IA+B7B,OAAO,IAAI,IAAI;CAUvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissionManager.d.ts","sourceRoot":"","sources":["../../src/managers/permissionManager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAgBhD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"permissionManager.d.ts","sourceRoot":"","sources":["../../src/managers/permissionManager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAgBhD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AA4DlD,MAAM,WAAW,wBAAwB;IACvC,uDAAuD;IACvD,qBAAqB,CAAC,EAAE,cAAc,CAAC;IACvC,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,8DAA8D;IAC9D,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,iCAAiC;IACjC,OAAO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irections, hasWriteRedirections, getSmartPrefix, DANGEROUS_COMMANDS, } from "../utils/bashParser.js";
|
|
12
12
|
import { isPathInside } from "../utils/pathSafety.js";
|
|
13
13
|
import { BASH_TOOL_NAME, EDIT_TOOL_NAME, WRITE_TOOL_NAME, READ_TOOL_NAME, } from "../constants/tools.js";
|
|
14
|
-
const SAFE_COMMANDS = [
|
|
14
|
+
const SAFE_COMMANDS = [
|
|
15
|
+
"cd",
|
|
16
|
+
"ls",
|
|
17
|
+
"pwd",
|
|
18
|
+
"true",
|
|
19
|
+
"false",
|
|
20
|
+
"grep",
|
|
21
|
+
"rg",
|
|
22
|
+
"cat",
|
|
23
|
+
"head",
|
|
24
|
+
"tail",
|
|
25
|
+
"wc",
|
|
26
|
+
];
|
|
15
27
|
const DEFAULT_ALLOWED_RULES = [
|
|
16
28
|
"Bash(git status*)",
|
|
17
29
|
"Bash(git diff*)",
|
|
@@ -45,7 +57,12 @@ const DEFAULT_ALLOWED_RULES = [
|
|
|
45
57
|
"Bash(whoami*)",
|
|
46
58
|
"Bash(date*)",
|
|
47
59
|
"Bash(uptime*)",
|
|
48
|
-
"Bash(
|
|
60
|
+
"Bash(grep*)",
|
|
61
|
+
"Bash(rg*)",
|
|
62
|
+
"Bash(cat*)",
|
|
63
|
+
"Bash(head*)",
|
|
64
|
+
"Bash(tail*)",
|
|
65
|
+
"Bash(wc*)",
|
|
49
66
|
];
|
|
50
67
|
import { logger } from "../utils/globalLogger.js";
|
|
51
68
|
export class PermissionManager {
|
|
@@ -492,7 +509,13 @@ export class PermissionManager {
|
|
|
492
509
|
if (cmd === "pwd" ||
|
|
493
510
|
cmd === "true" ||
|
|
494
511
|
cmd === "false" ||
|
|
495
|
-
cmd === "ls"
|
|
512
|
+
cmd === "ls" ||
|
|
513
|
+
cmd === "grep" ||
|
|
514
|
+
cmd === "rg" ||
|
|
515
|
+
cmd === "cat" ||
|
|
516
|
+
cmd === "head" ||
|
|
517
|
+
cmd === "tail" ||
|
|
518
|
+
cmd === "wc") {
|
|
496
519
|
return true;
|
|
497
520
|
}
|
|
498
521
|
if (workdir) {
|
|
@@ -570,7 +593,13 @@ export class PermissionManager {
|
|
|
570
593
|
if (cmd === "pwd" ||
|
|
571
594
|
cmd === "true" ||
|
|
572
595
|
cmd === "false" ||
|
|
573
|
-
cmd === "ls"
|
|
596
|
+
cmd === "ls" ||
|
|
597
|
+
cmd === "grep" ||
|
|
598
|
+
cmd === "rg" ||
|
|
599
|
+
cmd === "cat" ||
|
|
600
|
+
cmd === "head" ||
|
|
601
|
+
cmd === "tail" ||
|
|
602
|
+
cmd === "wc") {
|
|
574
603
|
isSafe = true;
|
|
575
604
|
}
|
|
576
605
|
else {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { EventEmitter } from "events";
|
|
1
2
|
import type { SkillManagerOptions, SkillMetadata, Skill, SkillToolArgs, SkillInvocationContext } from "../types/index.js";
|
|
2
3
|
import { Container } from "../utils/container.js";
|
|
3
4
|
/**
|
|
4
5
|
* Manages skill discovery and loading
|
|
5
6
|
*/
|
|
6
|
-
export declare class SkillManager {
|
|
7
|
+
export declare class SkillManager extends EventEmitter {
|
|
7
8
|
private container;
|
|
8
9
|
private personalSkillsPath;
|
|
9
10
|
private scanTimeout;
|
|
@@ -11,11 +12,25 @@ export declare class SkillManager {
|
|
|
11
12
|
private skillMetadata;
|
|
12
13
|
private skillContent;
|
|
13
14
|
private initialized;
|
|
15
|
+
private fileWatcher;
|
|
16
|
+
private watchEnabled;
|
|
14
17
|
constructor(container: Container, options?: SkillManagerOptions);
|
|
15
18
|
/**
|
|
16
19
|
* Initialize the skill manager by discovering available skills
|
|
17
20
|
*/
|
|
18
21
|
initialize(): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Refresh skills by re-discovering them
|
|
24
|
+
*/
|
|
25
|
+
private refreshSkills;
|
|
26
|
+
/**
|
|
27
|
+
* Setup file watcher for skill directories
|
|
28
|
+
*/
|
|
29
|
+
private setupWatcher;
|
|
30
|
+
/**
|
|
31
|
+
* Cleanup resources
|
|
32
|
+
*/
|
|
33
|
+
destroy(): Promise<void>;
|
|
19
34
|
/**
|
|
20
35
|
* Check if the skill manager is initialized
|
|
21
36
|
*/
|
|
@@ -34,7 +49,7 @@ export declare class SkillManager {
|
|
|
34
49
|
*/
|
|
35
50
|
loadSkill(skillName: string): Promise<Skill | null>;
|
|
36
51
|
/**
|
|
37
|
-
* Discover skills in
|
|
52
|
+
* Discover skills in builtin, personal and project directories
|
|
38
53
|
*/
|
|
39
54
|
private discoverSkills;
|
|
40
55
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skillManager.d.ts","sourceRoot":"","sources":["../../src/managers/skillManager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EACb,KAAK,EAGL,aAAa,EACb,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"skillManager.d.ts","sourceRoot":"","sources":["../../src/managers/skillManager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EACb,KAAK,EAGL,aAAa,EACb,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAU3B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD;;GAEG;AACH,qBAAa,YAAa,SAAQ,YAAY;IAY1C,OAAO,CAAC,SAAS;IAXnB,OAAO,CAAC,kBAAkB,CAAS;IACnC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,OAAO,CAAS;IAExB,OAAO,CAAC,aAAa,CAAoC;IACzD,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,WAAW,CAAmC;IACtD,OAAO,CAAC,YAAY,CAAU;gBAGpB,SAAS,EAAE,SAAS,EAC5B,OAAO,GAAE,mBAAw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
|
4
|
+
import { EventEmitter } from "events";
|
|
5
|
+
import { FileWatcherService } from "../services/fileWatcher.js";
|
|
4
6
|
import { parseSkillFile, formatSkillError } from "../utils/skillParser.js";
|
|
5
7
|
import { substituteCommandParameters } from "../utils/commandArgumentParser.js";
|
|
6
8
|
import { parseBashCommands, replaceBashCommandsWithOutput, executeBashCommands, } from "../utils/markdownParser.js";
|
|
9
|
+
import { getBuiltinSkillsDir } from "../utils/configPaths.js";
|
|
7
10
|
import { logger } from "../utils/globalLogger.js";
|
|
8
11
|
/**
|
|
9
12
|
* Manages skill discovery and loading
|
|
10
13
|
*/
|
|
11
|
-
export class SkillManager {
|
|
14
|
+
export class SkillManager extends EventEmitter {
|
|
12
15
|
constructor(container, options = {}) {
|
|
16
|
+
super();
|
|
13
17
|
this.container = container;
|
|
14
18
|
this.skillMetadata = new Map();
|
|
15
19
|
this.skillContent = new Map();
|
|
16
20
|
this.initialized = false;
|
|
21
|
+
this.fileWatcher = null;
|
|
17
22
|
this.personalSkillsPath =
|
|
18
23
|
options.personalSkillsPath || join(homedir(), ".wave", "skills");
|
|
19
24
|
this.scanTimeout = options.scanTimeout || 5000;
|
|
20
25
|
this.workdir = options.workdir || process.cwd();
|
|
26
|
+
this.watchEnabled = options.watch ?? false;
|
|
21
27
|
}
|
|
22
28
|
/**
|
|
23
29
|
* Initialize the skill manager by discovering available skills
|
|
@@ -25,23 +31,9 @@ export class SkillManager {
|
|
|
25
31
|
async initialize() {
|
|
26
32
|
logger?.debug("Initializing SkillManager...");
|
|
27
33
|
try {
|
|
28
|
-
|
|
29
|
-
this.
|
|
30
|
-
|
|
31
|
-
const discovery = await this.discoverSkills();
|
|
32
|
-
// Store discovered skill metadata
|
|
33
|
-
discovery.personalSkills.forEach((skill, name) => {
|
|
34
|
-
this.skillMetadata.set(name, skill);
|
|
35
|
-
});
|
|
36
|
-
discovery.projectSkills.forEach((skill, name) => {
|
|
37
|
-
this.skillMetadata.set(name, skill);
|
|
38
|
-
});
|
|
39
|
-
// Log any discovery errors
|
|
40
|
-
if (discovery.errors.length > 0) {
|
|
41
|
-
logger?.warn(`Found ${discovery.errors.length} skill discovery errors`);
|
|
42
|
-
discovery.errors.forEach((error) => {
|
|
43
|
-
logger?.warn(`Skill error in ${error.skillPath}: ${error.message}`);
|
|
44
|
-
});
|
|
34
|
+
await this.refreshSkills();
|
|
35
|
+
if (this.watchEnabled && !this.fileWatcher) {
|
|
36
|
+
await this.setupWatcher();
|
|
45
37
|
}
|
|
46
38
|
this.initialized = true;
|
|
47
39
|
logger?.debug(`SkillManager initialized with ${this.skillMetadata.size} skills`);
|
|
@@ -51,6 +43,71 @@ export class SkillManager {
|
|
|
51
43
|
throw error;
|
|
52
44
|
}
|
|
53
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Refresh skills by re-discovering them
|
|
48
|
+
*/
|
|
49
|
+
async refreshSkills() {
|
|
50
|
+
// Clear existing data before discovery
|
|
51
|
+
this.skillMetadata.clear();
|
|
52
|
+
this.skillContent.clear();
|
|
53
|
+
const discovery = await this.discoverSkills();
|
|
54
|
+
// Store discovered skill metadata
|
|
55
|
+
discovery.builtinSkills.forEach((skill, name) => {
|
|
56
|
+
this.skillMetadata.set(name, skill);
|
|
57
|
+
});
|
|
58
|
+
discovery.personalSkills.forEach((skill, name) => {
|
|
59
|
+
this.skillMetadata.set(name, skill);
|
|
60
|
+
});
|
|
61
|
+
discovery.projectSkills.forEach((skill, name) => {
|
|
62
|
+
this.skillMetadata.set(name, skill);
|
|
63
|
+
});
|
|
64
|
+
// Log any discovery errors
|
|
65
|
+
if (discovery.errors.length > 0) {
|
|
66
|
+
logger?.warn(`Found ${discovery.errors.length} skill discovery errors`);
|
|
67
|
+
discovery.errors.forEach((error) => {
|
|
68
|
+
logger?.warn(`Skill error in ${error.skillPath}: ${error.message}`);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
this.emit("refreshed", Array.from(this.skillMetadata.values()));
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Setup file watcher for skill directories
|
|
75
|
+
*/
|
|
76
|
+
async setupWatcher() {
|
|
77
|
+
if (this.fileWatcher) {
|
|
78
|
+
await this.fileWatcher.cleanup();
|
|
79
|
+
}
|
|
80
|
+
this.fileWatcher = new FileWatcherService(logger);
|
|
81
|
+
const pathsToWatch = [
|
|
82
|
+
this.personalSkillsPath,
|
|
83
|
+
join(this.workdir, ".wave", "skills"),
|
|
84
|
+
];
|
|
85
|
+
logger?.debug(`Setting up skill watcher for: ${pathsToWatch.join(", ")}`);
|
|
86
|
+
for (const pathToWatch of pathsToWatch) {
|
|
87
|
+
await this.fileWatcher.watchFile(pathToWatch, async (event) => {
|
|
88
|
+
if (event.path.endsWith("SKILL.md") ||
|
|
89
|
+
event.type === "delete" ||
|
|
90
|
+
event.type === "create") {
|
|
91
|
+
logger?.debug(`Skill change detected (${event.type}): ${event.path}. Refreshing skills...`);
|
|
92
|
+
try {
|
|
93
|
+
await this.refreshSkills();
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
logger?.error("Failed to refresh skills after change:", error);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Cleanup resources
|
|
104
|
+
*/
|
|
105
|
+
async destroy() {
|
|
106
|
+
if (this.fileWatcher) {
|
|
107
|
+
await this.fileWatcher.cleanup();
|
|
108
|
+
this.fileWatcher = null;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
54
111
|
/**
|
|
55
112
|
* Check if the skill manager is initialized
|
|
56
113
|
*/
|
|
@@ -93,15 +150,21 @@ export class SkillManager {
|
|
|
93
150
|
return null;
|
|
94
151
|
}
|
|
95
152
|
/**
|
|
96
|
-
* Discover skills in
|
|
153
|
+
* Discover skills in builtin, personal and project directories
|
|
97
154
|
*/
|
|
98
155
|
async discoverSkills() {
|
|
156
|
+
const builtinCollection = await this.discoverSkillCollection(getBuiltinSkillsDir(), "builtin");
|
|
99
157
|
const personalCollection = await this.discoverSkillCollection(this.personalSkillsPath, "personal");
|
|
100
158
|
const projectCollection = await this.discoverSkillCollection(this.workdir, "project");
|
|
101
159
|
return {
|
|
160
|
+
builtinSkills: builtinCollection.skills,
|
|
102
161
|
personalSkills: personalCollection.skills,
|
|
103
162
|
projectSkills: projectCollection.skills,
|
|
104
|
-
errors: [
|
|
163
|
+
errors: [
|
|
164
|
+
...builtinCollection.errors,
|
|
165
|
+
...personalCollection.errors,
|
|
166
|
+
...projectCollection.errors,
|
|
167
|
+
],
|
|
105
168
|
};
|
|
106
169
|
}
|
|
107
170
|
/**
|
|
@@ -114,7 +177,16 @@ export class SkillManager {
|
|
|
114
177
|
skills: new Map(),
|
|
115
178
|
errors: [],
|
|
116
179
|
};
|
|
117
|
-
|
|
180
|
+
let skillsPath;
|
|
181
|
+
if (type === "personal") {
|
|
182
|
+
skillsPath = basePath;
|
|
183
|
+
}
|
|
184
|
+
else if (type === "builtin") {
|
|
185
|
+
skillsPath = basePath;
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
skillsPath = join(basePath, ".wave", "skills");
|
|
189
|
+
}
|
|
118
190
|
try {
|
|
119
191
|
const skillDirs = await this.findSkillDirectories(skillsPath);
|
|
120
192
|
logger?.debug(`Found ${skillDirs.length} potential skill directories in ${skillsPath}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slashCommandManager.d.ts","sourceRoot":"","sources":["../../src/managers/slashCommandManager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAQ1E,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAQlD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIxD,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,mBAAmB;IAO5B,OAAO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I,IAAI;IAWnC;;OAEG;IACI,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAInD;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAIzB;;OAEG;IACI,WAAW,IAAI,YAAY,EAAE;IAIpC;;OAEG;IACI,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAI9D;;OAEG;IACU,cAAc,CACzB,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,OAAO,CAAC;IAenB;;;OAGG;IACI,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG;QAClD,OAAO,EAAE,OAAO,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;IAeD;;OAEG;IACI,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAI7C;;OAEG;IACI,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAI1E;;OAEG;IACI,iBAAiB,IAAI,kBAAkB,EAAE;IAIhD;;OAEG;YACW,+BAA+B;IAsD7C;;OAEG;IACI,mBAAmB,IAAI,IAAI;CAInC"}
|
|
@@ -14,6 +14,13 @@ export class SlashCommandManager {
|
|
|
14
14
|
initialize() {
|
|
15
15
|
this.initializeBuiltinCommands();
|
|
16
16
|
this.loadCustomCommands();
|
|
17
|
+
// Listen for skill refreshes and update skill commands
|
|
18
|
+
const skillManager = this.container.get("SkillManager");
|
|
19
|
+
if (skillManager) {
|
|
20
|
+
skillManager.on("refreshed", (skills) => {
|
|
21
|
+
this.registerSkillCommands(skills);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
17
24
|
}
|
|
18
25
|
get messageManager() {
|
|
19
26
|
return this.container.get("MessageManager");
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const BASH_SUBAGENT_SYSTEM_PROMPT = "You are a command execution
|
|
|
7
7
|
export declare const GENERAL_PURPOSE_SYSTEM_PROMPT = "You are an agent. Given the user's message, you should use the tools available to complete the task. Do what has been asked; nothing more, nothing less. When you complete the task simply respond with a detailed writeup.\n\nYour strengths:\n- Searching for code, configurations, and patterns across large codebases\n- Analyzing multiple files to understand system architecture\n- Investigating complex questions that require exploring many files\n- Performing multi-step research tasks\n\nGuidelines:\n- For file searches: Use Grep or Glob when you need to search broadly. Use Read when you know the specific file path.\n- For analysis: Start broad and narrow down. Use multiple search strategies if the first doesn't yield results.\n- Be thorough: Check multiple locations, consider different naming conventions, look for related files.\n- NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new one.\n- NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested.\n- In your final response always share relevant file names and code snippets. Any file paths you return in your response MUST be absolute. Do NOT use relative paths.\n- For clear communication, avoid using emojis.";
|
|
8
8
|
export declare const EXPLORE_SUBAGENT_SYSTEM_PROMPT = "You are a file search specialist. You excel at thoroughly navigating and exploring codebases.\n\t\n\t=== CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===\n\tThis is a READ-ONLY exploration task. You are STRICTLY PROHIBITED from:\n\t- Creating new files (no Write, touch, or file creation of any kind)\n\t- Modifying existing files (no Edit operations)\n\t- Moving or copying files (no mv or cp)\n\t- Creating temporary files anywhere, including /tmp\n\t- Using redirect operators (>, >>, |) or heredocs to write to files\n\t- Running ANY commands that change system state\n\t\n\tYour role is EXCLUSIVELY to search and analyze existing code. You do NOT have access to file editing tools - attempting to edit files will fail.\n\t\n\tYour strengths:\n\t- Rapidly finding files using glob patterns\n\t- Searching code and text with powerful regex patterns\n\t- Reading and analyzing file contents\n\t- Using Language Server Protocol (LSP) for deep code intelligence (definitions, references, etc.)\n\t\n\tGuidelines:\n\t- Use Glob for broad file pattern matching\n\t- Use Grep for searching file contents with regex\n\t- Use Read when you know the specific file path you need to read\n\t- Use LSP for code intelligence features like finding definitions, references, implementations, and symbols. This is especially useful for understanding complex code relationships.\n\t- Use Bash ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)\n\t- NEVER use Bash for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification\n\t- Adapt your search approach based on the thoroughness level specified by the caller\n\t- Return file paths as absolute paths in your final response\n\t- For clear communication, avoid using emojis\n\t- Communicate your final report directly as a regular message - do NOT attempt to create files\n\t\n\tNOTE: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:\n\t- Make efficient use of the tools that you have at your disposal: be smart about how you search for files and implementations\n\t- Wherever possible you should try to spawn multiple parallel tool calls for grepping and reading files\n\t\n\tComplete the user's search request efficiently and report your findings clearly.";
|
|
9
9
|
export declare const PLAN_SUBAGENT_SYSTEM_PROMPT = "You are a software architect and planning specialist. Your role is to explore the codebase and design implementation plans.\n\n=== CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===\nThis is a READ-ONLY planning task. You are STRICTLY PROHIBITED from:\n- Creating new files (no Write, touch, or file creation of any kind)\n- Modifying existing files (no Edit operations)\n- Moving or copying files (no mv or cp)\n- Creating temporary files anywhere, including /tmp\n- Using redirect operators (>, >>, |) or heredocs to write to files\n- Running ANY commands that change system state\n\nYour role is EXCLUSIVELY to explore the codebase and design implementation plans. You do NOT have access to file editing tools - attempting to edit files will fail.\n\nYou will be provided with a set of requirements and optionally a perspective on how to approach the design process.\n\n## Your Process\n\n1. **Understand Requirements**: Focus on the requirements provided and apply your assigned perspective throughout the design process.\n\n2. **Explore Thoroughly**:\n - Read any files provided to you in the initial prompt\n - Find existing patterns and conventions using Glob, Grep, and Read\n - Understand the current architecture\n - Identify similar features as reference\n - Trace through relevant code paths\n - Use Bash ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)\n - NEVER use Bash for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification\n\n3. **Design Solution**:\n - Create implementation approach based on your assigned perspective\n - Consider trade-offs and architectural decisions\n - Follow existing patterns where appropriate\n\n4. **Detail the Plan**:\n - Provide step-by-step implementation strategy\n - Identify dependencies and sequencing\n - Anticipate potential challenges\n\n## Required Output\n\nEnd your response with:\n\n### Critical Files for Implementation\nList 3-5 files most critical for implementing this plan:\n- path/to/file1.ts - [Brief reason: e.g., \"Core logic to modify\"]\n- path/to/file2.ts - [Brief reason: e.g., \"Interfaces to implement\"]\n- path/to/file3.ts - [Brief reason: e.g., \"Pattern to follow\"]\n\nREMEMBER: You can ONLY explore and plan. You CANNOT and MUST NOT write, edit, or modify any files. You do NOT have access to file editing tools.";
|
|
10
|
-
export declare const INIT_PROMPT = "Please analyze this codebase and create a AGENTS.md file, which will be given to future instances of Agent to operate in this repository.\n\nWhat to add:\n1. Commands that will be commonly used, such as how to build, lint, and run tests. Include the necessary commands to develop in this codebase, such as how to run a single test.\n2. High-level code architecture and structure so that future instances can be productive more quickly. Focus on the \"big picture\" architecture that requires reading multiple files to understand.\n\nUsage notes:\n- If there's already a AGENTS.md, suggest improvements to it.\n- When you make the initial AGENTS.md, do not repeat yourself and do not include obvious instructions like \"Provide helpful error messages to users\", \"Write unit tests for all new utilities\", \"Never include sensitive information (API keys, tokens) in code or commits\".\n- Avoid listing every component or file structure that can be easily discovered.\n- Don't include generic development practices.\n- If there are Cursor rules (in .cursor/rules/ or .cursorrules) or Copilot rules (in .github/copilot-instructions.md), make sure to include the important parts.\n- If there is a README.md, make sure to include the important parts.\n- Do not make up information such as \"Common Development Tasks\", \"Tips for Development\", \"Support and Documentation\" unless this is expressly included in other files that you read.\n- Be sure to prefix the file with the following text:\n\n```\n# AGENTS.md\n\nThis file provides guidance to Agent when working with code in this repository.\n```";
|
|
10
|
+
export declare const INIT_PROMPT = "Please analyze this codebase and create a AGENTS.md file, which will be given to future instances of Agent to operate in this repository.\n\nWhat to add:\n1. Commands that will be commonly used, such as how to build, lint, and run tests. Include the necessary commands to develop in this codebase, such as how to run a single test.\n2. High-level code architecture and structure so that future instances can be productive more quickly. Focus on the \"big picture\" architecture that requires reading multiple files to understand.\n\nUsage notes:\n- If there's already a AGENTS.md, suggest improvements to it.\n- When you make the initial AGENTS.md, do not repeat yourself and do not include obvious instructions like \"Provide helpful error messages to users\", \"Write unit tests for all new utilities\", \"Never include sensitive information (API keys, tokens) in code or commits\".\n- Avoid listing every component or file structure that can be easily discovered.\n- Don't include generic development practices.\n- If there are Cursor rules (in .cursor/rules/ or .cursorrules) or Copilot rules (in .github/copilot-instructions.md), make sure to include the important parts.\n- Do NOT include rules from .wave/rules/ as they are automatically loaded by the system.\n- If there is a README.md, make sure to include the important parts.\n- Do not make up information such as \"Common Development Tasks\", \"Tips for Development\", \"Support and Documentation\" unless this is expressly included in other files that you read.\n- Be sure to prefix the file with the following text:\n\n```\n# AGENTS.md\n\nThis file provides guidance to Agent when working with code in this repository.\n```";
|
|
11
11
|
export declare const COMPRESS_MESSAGES_SYSTEM_PROMPT = "You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:\n1. Task Overview\nThe user's core request and success criteria\nAny clarifications or constraints they specified\n2. Current State\nWhat has been completed so far\nFiles created, modified, or analyzed (with paths if relevant)\nKey outputs or artifacts produced\n3. Important Discoveries\nTechnical constraints or requirements uncovered\nDecisions made and their rationale\nErrors encountered and how they were resolved\nWhat approaches were tried that didn't work (and why)\n4. Next Steps\nSpecific actions needed to complete the task\nAny blockers or open questions to resolve\nPriority order if multiple steps remain\n5. Context to Preserve\nUser preferences or style requirements\nDomain-specific details that aren't obvious\nAny promises made to the user\nBe concise but complete\u2014err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.\nWrap your summary in <summary></summary> tags.";
|
|
12
12
|
export declare function buildSystemPrompt(basePrompt: string | undefined, tools: ToolPlugin[], options?: {
|
|
13
13
|
workdir?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAmB/C,eAAO,MAAM,kBAAkB,g9DAU+J,CAAC;AAE/L,eAAO,MAAM,WAAW,qvBAIqH,CAAC;AAE9I,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,OAAO,EACnB,UAAU,GAAE,OAAe,GAC1B,MAAM,CAmFR;AAED,eAAO,MAAM,qBAAqB,g9DAAqB,CAAC;AAExD,eAAO,MAAM,2BAA2B,igBAWO,CAAC;AAEhD,eAAO,MAAM,6BAA6B,izCAeK,CAAC;AAEhD,eAAO,MAAM,8BAA8B,mzEAmCuC,CAAC;AAEnF,eAAO,MAAM,2BAA2B,q3EAgDyG,CAAC;AAElJ,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAmB/C,eAAO,MAAM,kBAAkB,g9DAU+J,CAAC;AAE/L,eAAO,MAAM,WAAW,qvBAIqH,CAAC;AAE9I,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,OAAO,EACnB,UAAU,GAAE,OAAe,GAC1B,MAAM,CAmFR;AAED,eAAO,MAAM,qBAAqB,g9DAAqB,CAAC;AAExD,eAAO,MAAM,2BAA2B,igBAWO,CAAC;AAEhD,eAAO,MAAM,6BAA6B,izCAeK,CAAC;AAEhD,eAAO,MAAM,8BAA8B,mzEAmCuC,CAAC;AAEnF,eAAO,MAAM,2BAA2B,q3EAgDyG,CAAC;AAElJ,eAAO,MAAM,WAAW,4pDAqBjB,CAAC;AAER,eAAO,MAAM,+BAA+B,20CAsBG,CAAC;AAEhD,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,KAAK,EAAE,UAAU,EAAE,EACnB,OAAO,GAAE;IACP,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE;QACT,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC;IACF,UAAU,CAAC,EAAE;QACX,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACE,GACL,MAAM,CA6CR"}
|
package/dist/prompts/index.js
CHANGED
|
@@ -227,6 +227,7 @@ Usage notes:
|
|
|
227
227
|
- Avoid listing every component or file structure that can be easily discovered.
|
|
228
228
|
- Don't include generic development practices.
|
|
229
229
|
- If there are Cursor rules (in .cursor/rules/ or .cursorrules) or Copilot rules (in .github/copilot-instructions.md), make sure to include the important parts.
|
|
230
|
+
- Do NOT include rules from .wave/rules/ as they are automatically loaded by the system.
|
|
230
231
|
- If there is a README.md, make sure to include the important parts.
|
|
231
232
|
- Do not make up information such as "Common Development Tasks", "Tips for Development", "Support and Documentation" unless this is expressly included in other files that you read.
|
|
232
233
|
- Be sure to prefix the file with the following text:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurationService.d.ts","sourceRoot":"","sources":["../../src/services/configurationService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EACV,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,EACN,MAAM,2BAA2B,CAAC;AAOnC,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAE7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,aAAa,EACb,WAAW,EAGX,cAAc,EACd,YAAY,EACb,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAAE,aAAa,EA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,wBAAwB,IAAI,OAAO;IAiBnC;;;;;OAKG;IACH,sBAAsB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM;IAyBzD;;OAEG;IACH,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB;
|
|
1
|
+
{"version":3,"file":"configurationService.d.ts","sourceRoot":"","sources":["../../src/services/configurationService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EACV,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,EACN,MAAM,2BAA2B,CAAC;AAOnC,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAE7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,aAAa,EACb,WAAW,EAGX,cAAc,EACd,YAAY,EACb,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAGvC;;;;;GAKG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,oBAAoB,CAAkC;IAC9D,OAAO,CAAC,GAAG,CAA8B;IACzC,OAAO,CAAC,OAAO,CAAoB;IAEnC;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAMvC;;OAEG;IACG,uBAAuB,CAC3B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,uBAAuB,CAAC;IA4DnC;;OAEG;IACH,qBAAqB,CAAC,MAAM,EAAE,iBAAiB,GAAG,gBAAgB;IAoJlE;;OAEG;IACH,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB;IAwC7D;;;OAGG;IACH,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAIrD;;OAEG;IACH,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAQ5C;;;;;;;;;;OAUG;IACH,o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B,OAAO,CAAC,wBAAwB;IAoChC,OAAO,CAAC,eAAe;CAoCxB"}
|
|
@@ -48,7 +48,7 @@ export class FileWatcherService extends EventEmitter {
|
|
|
48
48
|
await this.initializeWatcher(entry);
|
|
49
49
|
}
|
|
50
50
|
catch (error) {
|
|
51
|
-
this.logger?.error(`
|
|
51
|
+
this.logger?.error(`FileWatcher: Failed to watch file ${path}: ${error.message}`);
|
|
52
52
|
throw error;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -67,7 +67,7 @@ export class FileWatcherService extends EventEmitter {
|
|
|
67
67
|
this.watchers.delete(path);
|
|
68
68
|
}
|
|
69
69
|
catch (error) {
|
|
70
|
-
this.logger?.warn(`
|
|
70
|
+
this.logger?.warn(`FileWatcher: Error unwatching file ${path}: ${error.message}`);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
@@ -143,7 +143,7 @@ export class FileWatcherService extends EventEmitter {
|
|
|
143
143
|
entry.errorCount++;
|
|
144
144
|
entry.isActive = false;
|
|
145
145
|
entry.lastError = error.message;
|
|
146
|
-
this.logger?.error(`
|
|
146
|
+
this.logger?.error(`FileWatcher: Failed to initialize watcher for ${entry.path}: ${error.message}`);
|
|
147
147
|
// Try fallback polling if not already using it
|
|
148
148
|
if (!entry.config.fallbackPolling &&
|
|
149
149
|
entry.errorCount < entry.config.maxRetries) {
|
|
@@ -167,30 +167,42 @@ export class FileWatcherService extends EventEmitter {
|
|
|
167
167
|
this.globalWatcher.on("unlink", (filePath) => {
|
|
168
168
|
this.handleFileEvent("delete", filePath);
|
|
169
169
|
});
|
|
170
|
+
this.globalWatcher.on("addDir", (dirPath) => {
|
|
171
|
+
this.handleFileEvent("create", dirPath);
|
|
172
|
+
});
|
|
173
|
+
this.globalWatcher.on("unlinkDir", (dirPath) => {
|
|
174
|
+
this.handleFileEvent("delete", dirPath);
|
|
175
|
+
});
|
|
170
176
|
this.globalWatcher.on("error", (err) => {
|
|
171
177
|
const error = err instanceof Error ? err : new Error(String(err));
|
|
172
|
-
this.logger?.error(`
|
|
178
|
+
this.logger?.error(`FileWatcher: File watcher error: ${error.message}`);
|
|
173
179
|
this.emit("watcherError", error);
|
|
174
180
|
});
|
|
175
181
|
}
|
|
176
182
|
handleFileEvent(type, filePath, stats) {
|
|
177
|
-
const entry = this.watchers.get(filePath);
|
|
178
|
-
if (!entry)
|
|
179
|
-
return;
|
|
180
183
|
const event = {
|
|
181
184
|
type,
|
|
182
185
|
path: filePath,
|
|
183
186
|
timestamp: Date.now(),
|
|
184
187
|
size: stats?.size,
|
|
185
188
|
};
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
189
|
+
// Notify all watchers that match the path or are parents of the path
|
|
190
|
+
for (const [watchedPath, entry] of this.watchers.entries()) {
|
|
191
|
+
if (filePath === watchedPath ||
|
|
192
|
+
filePath.startsWith(watchedPath + "/") ||
|
|
193
|
+
// Handle cases where the watched path might be a file and we get an event for it
|
|
194
|
+
// (already covered by filePath === watchedPath)
|
|
195
|
+
false) {
|
|
196
|
+
entry.lastEvent = event.timestamp;
|
|
197
|
+
// Notify all callbacks for this watcher
|
|
198
|
+
for (const callback of entry.callbacks) {
|
|
199
|
+
try {
|
|
200
|
+
callback(event);
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
this.logger?.error(`FileWatcher: Error in file watch callback for ${watchedPath} (event on ${filePath}): ${error.message}`);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
194
206
|
}
|
|
195
207
|
}
|
|
196
208
|
}
|
|
@@ -131,6 +131,12 @@ export declare function listSessions(workdir: string): Promise<SessionMetadata[]
|
|
|
131
131
|
* @returns Promise that resolves to array of session metadata objects
|
|
132
132
|
*/
|
|
133
133
|
export declare function listSessionsFromJsonl(workdir: string): Promise<SessionMetadata[]>;
|
|
134
|
+
/**
|
|
135
|
+
* List all sessions across all project directories
|
|
136
|
+
*
|
|
137
|
+
* @returns Promise that resolves to array of session metadata objects
|
|
138
|
+
*/
|
|
139
|
+
export declare function listAllSessions(): Promise<SessionMetadata[]>;
|
|
134
140
|
/**
|
|
135
141
|
* Clean up expired sessions older than 14 days based on file modification time
|
|
136
142
|
*
|
|
@@ -168,9 +174,10 @@ export declare function getFirstMessageContent(sessionId: string, workdir: strin
|
|
|
168
174
|
*/
|
|
169
175
|
export declare function deleteSession(sessionId: string, workdir: string, sessionType?: "main" | "subagent"): Promise<void>;
|
|
170
176
|
/**
|
|
171
|
-
* Truncate content to a maximum length, adding ellipsis if truncated
|
|
177
|
+
* Truncate content to a maximum length, adding ellipsis if truncated.
|
|
178
|
+
* Also replaces real newlines with the literal string "\n".
|
|
172
179
|
* @param content - The content to truncate
|
|
173
|
-
* @param maxLength - Maximum length before truncation (default:
|
|
180
|
+
* @param maxLength - Maximum length before truncation (default: 100)
|
|
174
181
|
* @returns Truncated content with ellipsis if needed
|
|
175
182
|
*/
|
|
176
183
|
export declare function truncateContent(content: string, maxLength?: number): string;
|