wave-agent-sdk 0.11.0 → 0.11.1

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 (43) hide show
  1. package/builtin/skills/init/SKILL.md +26 -0
  2. package/builtin/skills/settings/ENV.md +64 -0
  3. package/{src/builtin-skills → builtin/skills}/settings/HOOKS.md +12 -0
  4. package/builtin/skills/settings/MCP.md +55 -0
  5. package/builtin/skills/settings/MEMORY_RULES.md +60 -0
  6. package/{src/builtin-skills → builtin/skills}/settings/SKILL.md +22 -15
  7. package/builtin/skills/settings/SKILLS.md +63 -0
  8. package/builtin/skills/settings/SUBAGENTS.md +60 -0
  9. package/builtin/subagents/bash.md +18 -0
  10. package/builtin/subagents/explore.md +42 -0
  11. package/builtin/subagents/general-purpose.md +20 -0
  12. package/builtin/subagents/plan.md +55 -0
  13. package/dist/managers/slashCommandManager.d.ts.map +1 -1
  14. package/dist/managers/slashCommandManager.js +0 -16
  15. package/dist/prompts/index.d.ts +0 -5
  16. package/dist/prompts/index.d.ts.map +1 -1
  17. package/dist/prompts/index.js +1 -136
  18. package/dist/utils/configPaths.d.ts +4 -0
  19. package/dist/utils/configPaths.d.ts.map +1 -1
  20. package/dist/utils/configPaths.js +11 -9
  21. package/dist/utils/fileSearch.d.ts.map +1 -1
  22. package/dist/utils/fileSearch.js +7 -1
  23. package/dist/utils/subagentParser.d.ts.map +1 -1
  24. package/dist/utils/subagentParser.js +14 -4
  25. package/package.json +3 -2
  26. package/src/managers/slashCommandManager.ts +0 -19
  27. package/src/prompts/index.ts +0 -144
  28. package/src/utils/configPaths.ts +12 -10
  29. package/src/utils/fileSearch.ts +7 -1
  30. package/src/utils/subagentParser.ts +16 -6
  31. package/dist/builtin-skills/builtin-skills/loop/parsing.ts +0 -159
  32. package/dist/builtin-skills/builtin-skills/settings/HOOKS.md +0 -82
  33. package/dist/builtin-skills/builtin-skills/settings/SKILL.md +0 -86
  34. package/dist/builtin-skills/loop/parsing.d.ts +0 -13
  35. package/dist/builtin-skills/loop/parsing.d.ts.map +0 -1
  36. package/dist/builtin-skills/loop/parsing.js +0 -125
  37. package/dist/utils/builtinSubagents.d.ts +0 -7
  38. package/dist/utils/builtinSubagents.d.ts.map +0 -1
  39. package/dist/utils/builtinSubagents.js +0 -94
  40. package/src/builtin-skills/loop/SKILL.md +0 -53
  41. package/src/builtin-skills/loop/parsing.ts +0 -159
  42. package/src/utils/builtinSubagents.ts +0 -122
  43. /package/{dist/builtin-skills/builtin-skills → builtin/skills}/loop/SKILL.md +0 -0
@@ -2,7 +2,7 @@ import * as os from "node:os";
2
2
  import { isGitRepository } from "../utils/gitUtils.js";
3
3
  import { buildAutoMemoryPrompt } from "./autoMemory.js";
4
4
  import { EXPLORE_SUBAGENT_TYPE, PLAN_SUBAGENT_TYPE, } from "../constants/subagents.js";
5
- import { ASK_USER_QUESTION_TOOL_NAME, BASH_TOOL_NAME, EDIT_TOOL_NAME, GLOB_TOOL_NAME, GREP_TOOL_NAME, READ_TOOL_NAME, WRITE_TOOL_NAME, EXIT_PLAN_MODE_TOOL_NAME, AGENT_TOOL_NAME, } from "../constants/tools.js";
5
+ import { ASK_USER_QUESTION_TOOL_NAME, EDIT_TOOL_NAME, WRITE_TOOL_NAME, EXIT_PLAN_MODE_TOOL_NAME, AGENT_TOOL_NAME, } from "../constants/tools.js";
6
6
  export const BASE_SYSTEM_PROMPT = `You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
7
7
 
8
8
  # Doing tasks
@@ -102,141 +102,6 @@ This is critical - your turn should only end with either using the ${ASK_USER_QU
102
102
  NOTE: At any point in time through this workflow you should feel free to ask the user questions or clarifications using the ${ASK_USER_QUESTION_TOOL_NAME} tool. Don't make large assumptions about user intent. The goal is to present a well researched plan to the user, and tie any loose ends before implementation begins.`;
103
103
  }
104
104
  export const DEFAULT_SYSTEM_PROMPT = BASE_SYSTEM_PROMPT;
105
- export const BASH_SUBAGENT_SYSTEM_PROMPT = `You are a command execution specialist. Your role is to execute bash commands efficiently and safely.
106
-
107
- Guidelines:
108
- - Execute commands precisely as instructed
109
- - For git operations, follow git safety protocols
110
- - Report command output clearly and concisely
111
- - If a command fails, explain the error and suggest solutions
112
- - Use command chaining (&&) for dependent operations
113
- - Quote paths with spaces properly
114
- - For clear communication, avoid using emojis
115
-
116
- Complete the requested operations efficiently.`;
117
- export 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.
118
-
119
- Your strengths:
120
- - Searching for code, configurations, and patterns across large codebases
121
- - Analyzing multiple files to understand system architecture
122
- - Investigating complex questions that require exploring many files
123
- - Performing multi-step research tasks
124
-
125
- Guidelines:
126
- - For file searches: Use ${GREP_TOOL_NAME} or ${GLOB_TOOL_NAME} when you need to search broadly. Use ${READ_TOOL_NAME} when you know the specific file path.
127
- - For analysis: Start broad and narrow down. Use multiple search strategies if the first doesn't yield results.
128
- - Be thorough: Check multiple locations, consider different naming conventions, look for related files.
129
- - NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new one.
130
- - NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested.
131
- - 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.
132
- - For clear communication, avoid using emojis.`;
133
- export const EXPLORE_SUBAGENT_SYSTEM_PROMPT = `You are a file search specialist. You excel at thoroughly navigating and exploring codebases.
134
-
135
- === CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===
136
- This is a READ-ONLY exploration task. You are STRICTLY PROHIBITED from:
137
- - Creating new files (no Write, touch, or file creation of any kind)
138
- - Modifying existing files (no Edit operations)
139
- - Moving or copying files (no mv or cp)
140
- - Creating temporary files anywhere, including /tmp
141
- - Using redirect operators (>, >>, |) or heredocs to write to files
142
- - Running ANY commands that change system state
143
-
144
- Your role is EXCLUSIVELY to search and analyze existing code. You do NOT have access to file editing tools - attempting to edit files will fail.
145
-
146
- Your strengths:
147
- - Rapidly finding files using glob patterns
148
- - Searching code and text with powerful regex patterns
149
- - Reading and analyzing file contents
150
- - Using Language Server Protocol (LSP) for deep code intelligence (definitions, references, etc.)
151
-
152
- Guidelines:
153
- - Use ${GLOB_TOOL_NAME} for broad file pattern matching
154
- - Use ${GREP_TOOL_NAME} for searching file contents with regex
155
- - Use ${READ_TOOL_NAME} when you know the specific file path you need to read
156
- - Use LSP for code intelligence features like finding definitions, references, implementations, and symbols. This is especially useful for understanding complex code relationships.
157
- - Use ${BASH_TOOL_NAME} ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)
158
- - NEVER use ${BASH_TOOL_NAME} for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification
159
- - Adapt your search approach based on the thoroughness level specified by the caller
160
- - Return file paths as absolute paths in your final response
161
- - For clear communication, avoid using emojis
162
- - Communicate your final report directly as a regular message - do NOT attempt to create files
163
-
164
- NOTE: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:
165
- - Make efficient use of the tools that you have at your disposal: be smart about how you search for files and implementations
166
- - Wherever possible you should try to spawn multiple parallel tool calls for grepping and reading files
167
-
168
- Complete the user's search request efficiently and report your findings clearly.`;
169
- export const PLAN_SUBAGENT_SYSTEM_PROMPT = `You are a software architect and planning specialist. Your role is to explore the codebase and design implementation plans.
170
-
171
- === CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===
172
- This is a READ-ONLY planning task. You are STRICTLY PROHIBITED from:
173
- - Creating new files (no Write, touch, or file creation of any kind)
174
- - Modifying existing files (no Edit operations)
175
- - Moving or copying files (no mv or cp)
176
- - Creating temporary files anywhere, including /tmp
177
- - Using redirect operators (>, >>, |) or heredocs to write to files
178
- - Running ANY commands that change system state
179
-
180
- Your 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.
181
-
182
- You will be provided with a set of requirements and optionally a perspective on how to approach the design process.
183
-
184
- ## Your Process
185
-
186
- 1. **Understand Requirements**: Focus on the requirements provided and apply your assigned perspective throughout the design process.
187
-
188
- 2. **Explore Thoroughly**:
189
- - Read any files provided to you in the initial prompt
190
- - Find existing patterns and conventions using ${GLOB_TOOL_NAME}, ${GREP_TOOL_NAME}, and ${READ_TOOL_NAME}
191
- - Understand the current architecture
192
- - Identify similar features as reference
193
- - Trace through relevant code paths
194
- - Use ${BASH_TOOL_NAME} ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)
195
- - NEVER use ${BASH_TOOL_NAME} for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification
196
-
197
- 3. **Design Solution**:
198
- - Create implementation approach based on your assigned perspective
199
- - Consider trade-offs and architectural decisions
200
- - Follow existing patterns where appropriate
201
-
202
- 4. **Detail the Plan**:
203
- - Provide step-by-step implementation strategy
204
- - Identify dependencies and sequencing
205
- - Anticipate potential challenges
206
-
207
- ## Required Output
208
-
209
- End your response with:
210
-
211
- ### Critical Files for Implementation
212
- List 3-5 files most critical for implementing this plan:
213
- - path/to/file1.ts - [Brief reason: e.g., "Core logic to modify"]
214
- - path/to/file2.ts - [Brief reason: e.g., "Interfaces to implement"]
215
- - path/to/file3.ts - [Brief reason: e.g., "Pattern to follow"]
216
-
217
- REMEMBER: 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.`;
218
- export 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.
219
-
220
- What to add:
221
- 1. 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.
222
- 2. 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.
223
-
224
- Usage notes:
225
- - If there's already a AGENTS.md, suggest improvements to it.
226
- - 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".
227
- - Avoid listing every component or file structure that can be easily discovered.
228
- - Don't include generic development practices.
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.
231
- - If there is a README.md, make sure to include the important parts.
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.
233
- - Be sure to prefix the file with the following text:
234
-
235
- \`\`\`
236
- # AGENTS.md
237
-
238
- This file provides guidance to Agent when working with code in this repository.
239
- \`\`\``;
240
105
  export 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:
241
106
  1. Task Overview
242
107
  The user's core request and success criteria
@@ -13,6 +13,10 @@
13
13
  * Get the builtin skills directory path
14
14
  */
15
15
  export declare function getBuiltinSkillsDir(): string;
16
+ /**
17
+ * Get the builtin subagents directory path
18
+ */
19
+ export declare function getBuiltinSubagentsDir(): string;
16
20
  /**
17
21
  * Get the user-specific configuration file path (legacy function)
18
22
  * @deprecated Use getUserConfigPaths() for better priority support
@@ -1 +1 @@
1
- {"version":3,"file":"configPaths.d.ts","sourceRoot":"","sources":["../../src/utils/configPaths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAUH;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAW5C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAG7C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CA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AAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAeA;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGrD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG;IACrD,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,EAAE;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH,CAcA"}
@@ -19,15 +19,17 @@ const __dirname = dirname(__filename);
19
19
  * Get the builtin skills directory path
20
20
  */
21
21
  export function getBuiltinSkillsDir() {
22
- // In development, it's in src/builtin-skills
23
- // In production (dist), it should be in dist/builtin-skills
24
- // We'll look for it relative to this file
25
- const devPath = join(__dirname, "..", "builtin-skills");
26
- const prodPath = join(__dirname, "builtin-skills");
27
- if (existsSync(devPath)) {
28
- return devPath;
29
- }
30
- return prodPath;
22
+ // Builtin skills are now in the 'builtin/skills' directory at the root of the package
23
+ // Relative to this file (src/utils/configPaths.ts), it's ../../builtin/skills
24
+ return join(__dirname, "..", "..", "builtin", "skills");
25
+ }
26
+ /**
27
+ * Get the builtin subagents directory path
28
+ */
29
+ export function getBuiltinSubagentsDir() {
30
+ // Builtin subagents are now in the 'builtin/subagents' directory at the root of the package
31
+ // Relative to this file (src/utils/configPaths.ts), it's ../../builtin/subagents
32
+ return join(__dirname, "..", "..", "builtin", "subagents");
31
33
  }
32
34
  /**
33
35
  * Get the user-specific configuration file path (legacy function)
@@ -1 +1 @@
1
- {"version":3,"file":"fileSearch.d.ts","sourceRoot":"","sources":["../../src/utils/fileSearch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAiEvD;;GAEG;AACH,eAAO,MAAM,WAAW,GACtB,OAAO,MAAM,EACb,UAAU;IACR,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,KACA,OAAO,CAAC,QAAQ,EAAE,CA+DpB,CAAC"}
1
+ {"version":3,"file":"fileSearch.d.ts","sourceRoot":"","sources":["../../src/utils/fileSearch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAuEvD;;GAEG;AACH,eAAO,MAAM,WAAW,GACtB,OAAO,MAAM,EACb,UAAU;IACR,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,KACA,OAAO,CAAC,QAAQ,EAAE,CA+DpB,CAAC"}
@@ -2,6 +2,7 @@ import { spawn } from "child_process";
2
2
  import { rgPath } from "./ripgrep.js";
3
3
  import fuzzysort from "fuzzysort";
4
4
  import { logger } from "./globalLogger.js";
5
+ const EXCLUDED_FILES = [".git", ".DS_Store"];
5
6
  /**
6
7
  * Execute ripgrep to get all file paths
7
8
  */
@@ -31,7 +32,12 @@ async function getAllFiles(workingDirectory) {
31
32
  const files = stdout
32
33
  .trim()
33
34
  .split("\n")
34
- .filter((f) => f.length > 0)
35
+ .filter((f) => {
36
+ if (f.length === 0)
37
+ return false;
38
+ const parts = f.split(/[/\\]/);
39
+ return !parts.some((part) => EXCLUDED_FILES.includes(part));
40
+ })
35
41
  .map((f) => f.replace(/\\/g, "/")); // Normalize to forward slashes
36
42
  resolve(files);
37
43
  });
@@ -1 +1 @@
1
- {"version":3,"file":"subagentParser.d.ts","sourceRoot":"","sources":["../../src/utils/subagentParser.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;CAClB;AA+KD;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAsBlC;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAGvC"}
1
+ {"version":3,"file":"subagentParser.d.ts","sourceRoot":"","sources":["../../src/utils/subagentParser.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAwLD;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAsBlC;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAGvC"}
@@ -1,6 +1,7 @@
1
1
  import { readFileSync, readdirSync, statSync } from "fs";
2
- import { join, extname } from "path";
2
+ import { join, extname, basename } from "path";
3
3
  import { logger } from "./globalLogger.js";
4
+ import { getBuiltinSubagentsDir } from "./configPaths.js";
4
5
  /**
5
6
  * Parse YAML frontmatter from markdown file content
6
7
  */
@@ -85,10 +86,19 @@ function parseSubagentFile(filePath, scope) {
85
86
  try {
86
87
  const content = readFileSync(filePath, "utf-8");
87
88
  const { frontmatter, body } = parseFrontmatter(content);
89
+ // Use filename as default name if not specified in frontmatter
90
+ if (!frontmatter.name) {
91
+ frontmatter.name = basename(filePath, extname(filePath));
92
+ }
88
93
  validateConfiguration(frontmatter, filePath);
89
94
  if (!body.trim()) {
90
95
  throw new Error(`Empty system prompt in ${filePath}`);
91
96
  }
97
+ let priority = 1;
98
+ if (scope === "user")
99
+ priority = 2;
100
+ if (scope === "builtin")
101
+ priority = 3;
92
102
  return {
93
103
  name: frontmatter.name,
94
104
  description: frontmatter.description,
@@ -97,7 +107,7 @@ function parseSubagentFile(filePath, scope) {
97
107
  systemPrompt: body,
98
108
  filePath,
99
109
  scope,
100
- priority: scope === "project" ? 1 : 2,
110
+ priority,
101
111
  };
102
112
  }
103
113
  catch (error) {
@@ -137,9 +147,9 @@ function scanSubagentDirectory(dirPath, scope) {
137
147
  export async function loadSubagentConfigurations(workdir) {
138
148
  const projectDir = join(workdir, ".wave", "agents");
139
149
  const userDir = join(process.env.HOME || "~", ".wave", "agents");
150
+ const builtinDir = getBuiltinSubagentsDir();
140
151
  // Load configurations from all sources
141
- const { getBuiltinSubagents } = await import("./builtinSubagents.js");
142
- const builtinConfigs = getBuiltinSubagents();
152
+ const builtinConfigs = scanSubagentDirectory(builtinDir, "builtin");
143
153
  const projectConfigs = scanSubagentDirectory(projectDir, "project");
144
154
  const userConfigs = scanSubagentDirectory(userDir, "user");
145
155
  // Merge configurations, with project configs taking highest precedence
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wave-agent-sdk",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "SDK for building AI-powered development tools and agents",
5
5
  "keywords": [
6
6
  "ai",
@@ -24,6 +24,7 @@
24
24
  "bin",
25
25
  "vendor",
26
26
  "scripts",
27
+ "builtin",
27
28
  "README.md"
28
29
  ],
29
30
  "dependencies": {
@@ -48,7 +49,7 @@
48
49
  "license": "MIT",
49
50
  "scripts": {
50
51
  "postinstall": "node scripts/postinstall.js",
51
- "build": "rimraf dist && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && cp -r src/builtin-skills dist/builtin-skills",
52
+ "build": "rimraf dist && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
52
53
  "type-check": "tsc --noEmit --incremental",
53
54
  "watch": "tsc -p tsconfig.build.json --watch & tsc-alias -p tsconfig.build.json --watch",
54
55
  "test": "vitest run --reporter=dot",
@@ -16,7 +16,6 @@ import {
16
16
  replaceBashCommandsWithOutput,
17
17
  executeBashCommands,
18
18
  } from "../utils/markdownParser.js";
19
- import { INIT_PROMPT } from "../prompts/index.js";
20
19
  import type { SkillManager } from "./skillManager.js";
21
20
  import type { SkillMetadata } from "../types/skills.js";
22
21
 
@@ -73,24 +72,6 @@ export class SlashCommandManager {
73
72
  }
74
73
 
75
74
  private initializeBuiltinCommands(): void {
76
- // Register built-in init command
77
- this.registerCommand({
78
- id: "init",
79
- name: "init",
80
- description:
81
- "Initialize repository for AI agents by generating AGENTS.md",
82
- handler: async () => {
83
- // Add custom command message to show the command being executed
84
- this.messageManager.addUserMessage({
85
- content: "/init",
86
- customCommandContent: INIT_PROMPT,
87
- });
88
-
89
- // Execute the AI conversation with the init prompt
90
- await this.aiManager.sendAIMessage();
91
- },
92
- });
93
-
94
75
  // Register built-in clear command
95
76
  this.registerCommand({
96
77
  id: "clear",
@@ -9,11 +9,7 @@ import {
9
9
  } from "../constants/subagents.js";
10
10
  import {
11
11
  ASK_USER_QUESTION_TOOL_NAME,
12
- BASH_TOOL_NAME,
13
12
  EDIT_TOOL_NAME,
14
- GLOB_TOOL_NAME,
15
- GREP_TOOL_NAME,
16
- READ_TOOL_NAME,
17
13
  WRITE_TOOL_NAME,
18
14
  EXIT_PLAN_MODE_TOOL_NAME,
19
15
  AGENT_TOOL_NAME,
@@ -128,146 +124,6 @@ NOTE: At any point in time through this workflow you should feel free to ask the
128
124
 
129
125
  export const DEFAULT_SYSTEM_PROMPT = BASE_SYSTEM_PROMPT;
130
126
 
131
- export const BASH_SUBAGENT_SYSTEM_PROMPT = `You are a command execution specialist. Your role is to execute bash commands efficiently and safely.
132
-
133
- Guidelines:
134
- - Execute commands precisely as instructed
135
- - For git operations, follow git safety protocols
136
- - Report command output clearly and concisely
137
- - If a command fails, explain the error and suggest solutions
138
- - Use command chaining (&&) for dependent operations
139
- - Quote paths with spaces properly
140
- - For clear communication, avoid using emojis
141
-
142
- Complete the requested operations efficiently.`;
143
-
144
- export 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.
145
-
146
- Your strengths:
147
- - Searching for code, configurations, and patterns across large codebases
148
- - Analyzing multiple files to understand system architecture
149
- - Investigating complex questions that require exploring many files
150
- - Performing multi-step research tasks
151
-
152
- Guidelines:
153
- - For file searches: Use ${GREP_TOOL_NAME} or ${GLOB_TOOL_NAME} when you need to search broadly. Use ${READ_TOOL_NAME} when you know the specific file path.
154
- - For analysis: Start broad and narrow down. Use multiple search strategies if the first doesn't yield results.
155
- - Be thorough: Check multiple locations, consider different naming conventions, look for related files.
156
- - NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new one.
157
- - NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested.
158
- - 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.
159
- - For clear communication, avoid using emojis.`;
160
-
161
- export const EXPLORE_SUBAGENT_SYSTEM_PROMPT = `You are a file search specialist. You excel at thoroughly navigating and exploring codebases.
162
-
163
- === CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===
164
- This is a READ-ONLY exploration task. You are STRICTLY PROHIBITED from:
165
- - Creating new files (no Write, touch, or file creation of any kind)
166
- - Modifying existing files (no Edit operations)
167
- - Moving or copying files (no mv or cp)
168
- - Creating temporary files anywhere, including /tmp
169
- - Using redirect operators (>, >>, |) or heredocs to write to files
170
- - Running ANY commands that change system state
171
-
172
- Your role is EXCLUSIVELY to search and analyze existing code. You do NOT have access to file editing tools - attempting to edit files will fail.
173
-
174
- Your strengths:
175
- - Rapidly finding files using glob patterns
176
- - Searching code and text with powerful regex patterns
177
- - Reading and analyzing file contents
178
- - Using Language Server Protocol (LSP) for deep code intelligence (definitions, references, etc.)
179
-
180
- Guidelines:
181
- - Use ${GLOB_TOOL_NAME} for broad file pattern matching
182
- - Use ${GREP_TOOL_NAME} for searching file contents with regex
183
- - Use ${READ_TOOL_NAME} when you know the specific file path you need to read
184
- - Use LSP for code intelligence features like finding definitions, references, implementations, and symbols. This is especially useful for understanding complex code relationships.
185
- - Use ${BASH_TOOL_NAME} ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)
186
- - NEVER use ${BASH_TOOL_NAME} for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification
187
- - Adapt your search approach based on the thoroughness level specified by the caller
188
- - Return file paths as absolute paths in your final response
189
- - For clear communication, avoid using emojis
190
- - Communicate your final report directly as a regular message - do NOT attempt to create files
191
-
192
- NOTE: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:
193
- - Make efficient use of the tools that you have at your disposal: be smart about how you search for files and implementations
194
- - Wherever possible you should try to spawn multiple parallel tool calls for grepping and reading files
195
-
196
- Complete the user's search request efficiently and report your findings clearly.`;
197
-
198
- export const PLAN_SUBAGENT_SYSTEM_PROMPT = `You are a software architect and planning specialist. Your role is to explore the codebase and design implementation plans.
199
-
200
- === CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===
201
- This is a READ-ONLY planning task. You are STRICTLY PROHIBITED from:
202
- - Creating new files (no Write, touch, or file creation of any kind)
203
- - Modifying existing files (no Edit operations)
204
- - Moving or copying files (no mv or cp)
205
- - Creating temporary files anywhere, including /tmp
206
- - Using redirect operators (>, >>, |) or heredocs to write to files
207
- - Running ANY commands that change system state
208
-
209
- Your 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.
210
-
211
- You will be provided with a set of requirements and optionally a perspective on how to approach the design process.
212
-
213
- ## Your Process
214
-
215
- 1. **Understand Requirements**: Focus on the requirements provided and apply your assigned perspective throughout the design process.
216
-
217
- 2. **Explore Thoroughly**:
218
- - Read any files provided to you in the initial prompt
219
- - Find existing patterns and conventions using ${GLOB_TOOL_NAME}, ${GREP_TOOL_NAME}, and ${READ_TOOL_NAME}
220
- - Understand the current architecture
221
- - Identify similar features as reference
222
- - Trace through relevant code paths
223
- - Use ${BASH_TOOL_NAME} ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)
224
- - NEVER use ${BASH_TOOL_NAME} for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification
225
-
226
- 3. **Design Solution**:
227
- - Create implementation approach based on your assigned perspective
228
- - Consider trade-offs and architectural decisions
229
- - Follow existing patterns where appropriate
230
-
231
- 4. **Detail the Plan**:
232
- - Provide step-by-step implementation strategy
233
- - Identify dependencies and sequencing
234
- - Anticipate potential challenges
235
-
236
- ## Required Output
237
-
238
- End your response with:
239
-
240
- ### Critical Files for Implementation
241
- List 3-5 files most critical for implementing this plan:
242
- - path/to/file1.ts - [Brief reason: e.g., "Core logic to modify"]
243
- - path/to/file2.ts - [Brief reason: e.g., "Interfaces to implement"]
244
- - path/to/file3.ts - [Brief reason: e.g., "Pattern to follow"]
245
-
246
- REMEMBER: 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.`;
247
-
248
- export 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.
249
-
250
- What to add:
251
- 1. 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.
252
- 2. 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.
253
-
254
- Usage notes:
255
- - If there's already a AGENTS.md, suggest improvements to it.
256
- - 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".
257
- - Avoid listing every component or file structure that can be easily discovered.
258
- - Don't include generic development practices.
259
- - 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.
260
- - Do NOT include rules from .wave/rules/ as they are automatically loaded by the system.
261
- - If there is a README.md, make sure to include the important parts.
262
- - 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.
263
- - Be sure to prefix the file with the following text:
264
-
265
- \`\`\`
266
- # AGENTS.md
267
-
268
- This file provides guidance to Agent when working with code in this repository.
269
- \`\`\``;
270
-
271
127
  export 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:
272
128
  1. Task Overview
273
129
  The user's core request and success criteria
@@ -22,16 +22,18 @@ const __dirname = dirname(__filename);
22
22
  * Get the builtin skills directory path
23
23
  */
24
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;
25
+ // Builtin skills are now in the 'builtin/skills' directory at the root of the package
26
+ // Relative to this file (src/utils/configPaths.ts), it's ../../builtin/skills
27
+ return join(__dirname, "..", "..", "builtin", "skills");
28
+ }
29
+
30
+ /**
31
+ * Get the builtin subagents directory path
32
+ */
33
+ export function getBuiltinSubagentsDir(): string {
34
+ // Builtin subagents are now in the 'builtin/subagents' directory at the root of the package
35
+ // Relative to this file (src/utils/configPaths.ts), it's ../../builtin/subagents
36
+ return join(__dirname, "..", "..", "builtin", "subagents");
35
37
  }
36
38
 
37
39
  /**
@@ -4,6 +4,8 @@ import fuzzysort from "fuzzysort";
4
4
  import type { FileItem } from "../types/fileSearch.js";
5
5
  import { logger } from "./globalLogger.js";
6
6
 
7
+ const EXCLUDED_FILES = [".git", ".DS_Store"];
8
+
7
9
  /**
8
10
  * Execute ripgrep to get all file paths
9
11
  */
@@ -39,7 +41,11 @@ async function getAllFiles(workingDirectory: string): Promise<string[]> {
39
41
  const files = stdout
40
42
  .trim()
41
43
  .split("\n")
42
- .filter((f) => f.length > 0)
44
+ .filter((f) => {
45
+ if (f.length === 0) return false;
46
+ const parts = f.split(/[/\\]/);
47
+ return !parts.some((part) => EXCLUDED_FILES.includes(part));
48
+ })
43
49
  .map((f) => f.replace(/\\/g, "/")); // Normalize to forward slashes
44
50
  resolve(files);
45
51
  });
@@ -1,6 +1,7 @@
1
1
  import { readFileSync, readdirSync, statSync } from "fs";
2
- import { join, extname } from "path";
2
+ import { join, extname, basename } from "path";
3
3
  import { logger } from "./globalLogger.js";
4
+ import { getBuiltinSubagentsDir } from "./configPaths.js";
4
5
 
5
6
  export interface SubagentConfiguration {
6
7
  name: string;
@@ -122,18 +123,27 @@ function validateConfiguration(
122
123
  */
123
124
  function parseSubagentFile(
124
125
  filePath: string,
125
- scope: "project" | "user",
126
+ scope: "project" | "user" | "builtin",
126
127
  ): SubagentConfiguration {
127
128
  try {
128
129
  const content = readFileSync(filePath, "utf-8");
129
130
  const { frontmatter, body } = parseFrontmatter(content);
130
131
 
132
+ // Use filename as default name if not specified in frontmatter
133
+ if (!frontmatter.name) {
134
+ frontmatter.name = basename(filePath, extname(filePath));
135
+ }
136
+
131
137
  validateConfiguration(frontmatter, filePath);
132
138
 
133
139
  if (!body.trim()) {
134
140
  throw new Error(`Empty system prompt in ${filePath}`);
135
141
  }
136
142
 
143
+ let priority = 1;
144
+ if (scope === "user") priority = 2;
145
+ if (scope === "builtin") priority = 3;
146
+
137
147
  return {
138
148
  name: frontmatter.name!,
139
149
  description: frontmatter.description!,
@@ -142,7 +152,7 @@ function parseSubagentFile(
142
152
  systemPrompt: body,
143
153
  filePath,
144
154
  scope,
145
- priority: scope === "project" ? 1 : 2,
155
+ priority,
146
156
  };
147
157
  } catch (error) {
148
158
  throw new Error(
@@ -156,7 +166,7 @@ function parseSubagentFile(
156
166
  */
157
167
  function scanSubagentDirectory(
158
168
  dirPath: string,
159
- scope: "project" | "user",
169
+ scope: "project" | "user" | "builtin",
160
170
  ): SubagentConfiguration[] {
161
171
  const configurations: SubagentConfiguration[] = [];
162
172
 
@@ -194,10 +204,10 @@ export async function loadSubagentConfigurations(
194
204
  ): Promise<SubagentConfiguration[]> {
195
205
  const projectDir = join(workdir, ".wave", "agents");
196
206
  const userDir = join(process.env.HOME || "~", ".wave", "agents");
207
+ const builtinDir = getBuiltinSubagentsDir();
197
208
 
198
209
  // Load configurations from all sources
199
- const { getBuiltinSubagents } = await import("./builtinSubagents.js");
200
- const builtinConfigs = getBuiltinSubagents();
210
+ const builtinConfigs = scanSubagentDirectory(builtinDir, "builtin");
201
211
  const projectConfigs = scanSubagentDirectory(projectDir, "project");
202
212
  const userConfigs = scanSubagentDirectory(userDir, "user");
203
213