wave-agent-sdk 0.15.2 → 0.15.4
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/managers/skillManager.d.ts.map +1 -1
- package/dist/managers/skillManager.js +21 -8
- package/dist/prompts/index.js +1 -1
- package/dist/services/configurationService.d.ts.map +1 -1
- package/dist/services/configurationService.js +0 -1
- package/dist/types/configuration.d.ts +0 -2
- package/dist/types/configuration.d.ts.map +1 -1
- package/dist/utils/builtinSkills.d.ts +7 -0
- package/dist/utils/builtinSkills.d.ts.map +1 -0
- package/dist/utils/builtinSkills.js +149 -0
- package/dist/utils/configPaths.d.ts +0 -10
- package/dist/utils/configPaths.d.ts.map +1 -1
- package/dist/utils/configPaths.js +2 -25
- package/dist/utils/subagentParser.d.ts +5 -0
- package/dist/utils/subagentParser.d.ts.map +1 -1
- package/dist/utils/subagentParser.js +155 -3
- package/package.json +1 -2
- package/src/managers/skillManager.ts +21 -11
- package/src/prompts/index.ts +1 -1
- package/src/services/configurationService.ts +0 -1
- package/src/types/configuration.ts +0 -2
- package/src/utils/builtinSkills.ts +158 -0
- package/src/utils/configPaths.ts +2 -30
- package/src/utils/subagentParser.ts +160 -3
- package/builtin/skills/init/SKILL.md +0 -28
- package/builtin/skills/loop/SKILL.md +0 -79
- package/builtin/skills/settings/ENV.md +0 -69
- package/builtin/skills/settings/HOOKS.md +0 -192
- package/builtin/skills/settings/MCP.md +0 -92
- package/builtin/skills/settings/MEMORY_RULES.md +0 -60
- package/builtin/skills/settings/MODELS.md +0 -71
- package/builtin/skills/settings/PERMISSIONS.md +0 -57
- package/builtin/skills/settings/PLUGINS.md +0 -171
- package/builtin/skills/settings/SKILL.md +0 -121
- package/builtin/skills/settings/SKILLS.md +0 -105
- package/builtin/skills/settings/SUBAGENTS.md +0 -77
- package/builtin/subagents/bash.md +0 -19
- package/builtin/subagents/explore.md +0 -43
- package/builtin/subagents/general-purpose.md +0 -20
- package/builtin/subagents/plan.md +0 -56
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# Wave Environment Variables Configuration
|
|
2
|
-
|
|
3
|
-
Environment variables allow you to customize Wave's behavior, configure AI models, and provide context to hooks and tools. This document provides detailed guidance on how to configure environment variables in `settings.json`.
|
|
4
|
-
|
|
5
|
-
## The `env` Field
|
|
6
|
-
|
|
7
|
-
Environment variables are configured in the `env` field of `settings.json`. It is a simple key-value pair of strings.
|
|
8
|
-
|
|
9
|
-
```json
|
|
10
|
-
{
|
|
11
|
-
"env": {
|
|
12
|
-
"WAVE_MODEL": "gemini-3-flash",
|
|
13
|
-
"MY_CUSTOM_VAR": "some-value"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Supported `WAVE_*` Environment Variables
|
|
19
|
-
|
|
20
|
-
Wave uses several environment variables to control its core functionality.
|
|
21
|
-
|
|
22
|
-
| Variable | Description | Default |
|
|
23
|
-
| :--- | :--- | :--- |
|
|
24
|
-
| `WAVE_API_KEY` | API key for the AI gateway. | - |
|
|
25
|
-
| `WAVE_BASE_URL` | Base URL for the AI gateway. | - |
|
|
26
|
-
| `WAVE_CUSTOM_HEADERS` | Custom HTTP headers for the AI gateway (JSON string). | - |
|
|
27
|
-
| `WAVE_MODEL` | The primary AI model to use for the agent. | `gemini-3-flash` |
|
|
28
|
-
| `WAVE_FAST_MODEL` | The fast AI model to use for quick tasks. | `gemini-2.5-flash` |
|
|
29
|
-
| `WAVE_MAX_INPUT_TOKENS` | Maximum number of input tokens allowed. | `96000` |
|
|
30
|
-
| `WAVE_MAX_OUTPUT_TOKENS` | Maximum number of output tokens allowed. | `8192` |
|
|
31
|
-
| `WAVE_DISABLE_AUTO_MEMORY` | Set to `1` or `true` to disable the auto-memory feature. | `false` |
|
|
32
|
-
| `WAVE_TASK_LIST_ID` | Explicitly set the task list ID for the session. | (Session ID) |
|
|
33
|
-
| `WAVE_PROMPT_CACHE_REGEX` | Regex pattern to match model names that support prompt caching. Models matching this pattern will have cache control markers applied. | `claude` |
|
|
34
|
-
|
|
35
|
-
## Configuration Scopes
|
|
36
|
-
|
|
37
|
-
Environment variables can be set in different scopes, with the following precedence (highest to lowest):
|
|
38
|
-
|
|
39
|
-
1. **Local Scope**: `.wave/settings.local.json` (Local overrides, ignored by git)
|
|
40
|
-
2. **Project Scope**: `.wave/settings.json` (Project-specific settings, shared via git)
|
|
41
|
-
3. **User Scope**: `~/.wave/settings.json` (Global settings for all projects)
|
|
42
|
-
4. **System Environment**: Variables set in your shell (e.g., `export WAVE_API_KEY=...`)
|
|
43
|
-
|
|
44
|
-
## Custom Environment Variables
|
|
45
|
-
|
|
46
|
-
You can also define custom environment variables in the `env` field. These variables will be available to:
|
|
47
|
-
|
|
48
|
-
- **Hooks**: Any shell command executed as a hook will have these variables in its environment.
|
|
49
|
-
- **Tools**: Tools like `Bash` will have access to these variables.
|
|
50
|
-
|
|
51
|
-
Example:
|
|
52
|
-
```json
|
|
53
|
-
{
|
|
54
|
-
"env": {
|
|
55
|
-
"PROJECT_NAME": "my-awesome-project",
|
|
56
|
-
"DEPLOY_TARGET": "staging"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Live Reload
|
|
62
|
-
|
|
63
|
-
Environment variables configured in `settings.json` support **live reload**. When you modify the `env` field in any `settings.json` file (user, project, or local scope), the changes take effect immediately without requiring a Wave session restart.
|
|
64
|
-
|
|
65
|
-
## Best Practices
|
|
66
|
-
|
|
67
|
-
- **Use Local Overrides for Secrets**: Never commit sensitive information like `WAVE_API_KEY` to `settings.json`. Use `settings.local.json` instead.
|
|
68
|
-
- **Standard Naming**: Use uppercase and underscores for environment variable names (e.g., `MY_VARIABLE`).
|
|
69
|
-
- **Avoid Overriding System Variables**: Be careful not to override standard system variables like `PATH` or `HOME` unless you have a specific reason to do so.
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
# Wave Hooks Configuration
|
|
2
|
-
|
|
3
|
-
Hooks allow you to automate tasks when certain events occur in Wave. This document provides detailed guidance on how to configure hooks in `settings.json`.
|
|
4
|
-
|
|
5
|
-
## Hook Events
|
|
6
|
-
|
|
7
|
-
Wave supports the following hook events:
|
|
8
|
-
|
|
9
|
-
- `PreToolUse`: Triggered before a tool is executed.
|
|
10
|
-
- `PostToolUse`: Triggered after a tool has finished executing.
|
|
11
|
-
- `UserPromptSubmit`: Triggered when a user submits a prompt.
|
|
12
|
-
- `PermissionRequest`: Triggered when Wave requests permission to use a tool.
|
|
13
|
-
- `Stop`: Triggered when Wave finishes its response cycle (no more tool calls).
|
|
14
|
-
- `SubagentStop`: Triggered when a subagent finishes its response cycle.
|
|
15
|
-
- `WorktreeCreate`: Triggered when a new worktree is created.
|
|
16
|
-
- `SessionStart`: Triggered during session initialization. Hooks can inject `additionalContext` and `initialUserMessage` via stdout.
|
|
17
|
-
- `SessionEnd`: Triggered during agent destruction (fire-and-forget, non-blocking). Useful for cleanup, resource teardown, and analytics.
|
|
18
|
-
|
|
19
|
-
## Hook Configuration Structure
|
|
20
|
-
|
|
21
|
-
Hooks are configured in the `hooks` field of `settings.json`. Each event can have multiple hook configurations.
|
|
22
|
-
|
|
23
|
-
```json
|
|
24
|
-
{
|
|
25
|
-
"hooks": {
|
|
26
|
-
"PreToolUse": [
|
|
27
|
-
{
|
|
28
|
-
"matcher": "Write",
|
|
29
|
-
"hooks": [
|
|
30
|
-
{
|
|
31
|
-
"command": "pnpm lint",
|
|
32
|
-
"description": "Run lint before writing files"
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
"PermissionRequest": [
|
|
38
|
-
{
|
|
39
|
-
"matcher": "Bash",
|
|
40
|
-
"hooks": [
|
|
41
|
-
{
|
|
42
|
-
"command": "echo \"Permission requested for Bash tool\" >> hooks.log",
|
|
43
|
-
"description": "Log permission requests for Bash"
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Hook Configuration Fields
|
|
53
|
-
|
|
54
|
-
- `matcher`: (Optional) A pattern to match against the tool name (e.g., "Write", "Read*", "/^Edit/"). Only applicable for `PreToolUse`, `PostToolUse`, and `PermissionRequest`.
|
|
55
|
-
- `hooks`: An array of hook commands to execute.
|
|
56
|
-
- `command`: The shell command to execute.
|
|
57
|
-
- `description`: A brief description of the hook's purpose.
|
|
58
|
-
- `async`: (Optional) Whether the hook should run in the background without blocking (default: `false`).
|
|
59
|
-
- `timeout`: (Optional) Maximum execution time in seconds (default: `600`).
|
|
60
|
-
|
|
61
|
-
## Hook Input JSON
|
|
62
|
-
|
|
63
|
-
Wave provides detailed context to hook processes via `stdin` as a JSON object. This allows hooks to make informed decisions based on the current state.
|
|
64
|
-
|
|
65
|
-
### Common Fields
|
|
66
|
-
- `session_id`: The current session ID.
|
|
67
|
-
- `transcript_path`: Path to the session transcript file (JSON).
|
|
68
|
-
- `cwd`: The current working directory.
|
|
69
|
-
- `hook_event_name`: The name of the triggering event.
|
|
70
|
-
|
|
71
|
-
### Event-Specific Fields
|
|
72
|
-
- `tool_name`: (PreToolUse, PostToolUse, PermissionRequest) The name of the tool.
|
|
73
|
-
- `tool_input`: (PreToolUse, PostToolUse, PermissionRequest) The input parameters passed to the tool.
|
|
74
|
-
- `tool_response`: (PostToolUse) The result of the tool execution.
|
|
75
|
-
- `user_prompt`: (UserPromptSubmit) The text submitted by the user.
|
|
76
|
-
- `subagent_type`: (If executed by a subagent) The type of the subagent.
|
|
77
|
-
- `name`: (WorktreeCreate) The name of the new worktree.
|
|
78
|
-
- `source`: (SessionStart) The session start source: `"startup"`, `"resume"`, or `"compact"`.
|
|
79
|
-
- `agent_type`: (SessionStart) The agent type identifier.
|
|
80
|
-
- `end_source`: (SessionEnd) The session end source: `"exit"`, `"stop"`, or `"compact"`.
|
|
81
|
-
|
|
82
|
-
## Hook Exit Codes
|
|
83
|
-
|
|
84
|
-
Hooks can communicate status and control Wave's behavior using exit codes:
|
|
85
|
-
|
|
86
|
-
- **Exit 0**: Success. Wave continues its normal execution.
|
|
87
|
-
- **Exit 2**: Blocking Error. Wave blocks the current operation and provides feedback based on the event:
|
|
88
|
-
- `UserPromptSubmit`: Blocks prompt processing and shows `stderr` as a user error.
|
|
89
|
-
- `PreToolUse`: Blocks tool execution and provides `stderr` to the agent as feedback.
|
|
90
|
-
- `PostToolUse`: Appends `stderr` to the tool result as feedback for the agent.
|
|
91
|
-
- `Stop`: Blocks the stop operation and provides `stderr` to the agent.
|
|
92
|
-
- `SessionStart` / `SessionEnd`: Shows `stderr` in an error block, but does not block startup or shutdown.
|
|
93
|
-
- **Other Exits (e.g., Exit 1)**: Non-blocking error. Wave continues execution but shows `stderr` as a warning to the user.
|
|
94
|
-
|
|
95
|
-
## SessionStart Hooks
|
|
96
|
-
|
|
97
|
-
`SessionStart` hooks fire during session initialization. They can inject context and messages into the session via stdout.
|
|
98
|
-
|
|
99
|
-
### Stdout Processing
|
|
100
|
-
|
|
101
|
-
Hook stdout is processed as follows:
|
|
102
|
-
- If stdout is valid JSON with `hookSpecificOutput.additionalContext` (Claude Code format), that value is injected as additional context.
|
|
103
|
-
- If stdout is valid JSON with `initialUserMessage` at the top level, that value is injected as the initial user message.
|
|
104
|
-
- If stdout is not JSON, the entire output is appended as additional context.
|
|
105
|
-
|
|
106
|
-
Example hook output:
|
|
107
|
-
```json
|
|
108
|
-
{"hookSpecificOutput": {"hookEventName": "SessionStart", "additionalContext": "User prefers concise responses"}, "initialUserMessage": "Here is my current task..."}
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### Example Configuration
|
|
112
|
-
```json
|
|
113
|
-
{
|
|
114
|
-
"hooks": {
|
|
115
|
-
"SessionStart": [
|
|
116
|
-
{
|
|
117
|
-
"hooks": [
|
|
118
|
-
{
|
|
119
|
-
"command": "echo '{\"hookSpecificOutput\": {\"hookEventName\": \"SessionStart\", \"additionalContext\": \"Project uses pnpm and TypeScript\"}}'",
|
|
120
|
-
"description": "Inject project context at session start"
|
|
121
|
-
}
|
|
122
|
-
]
|
|
123
|
-
}
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
## SessionEnd Hooks
|
|
130
|
-
|
|
131
|
-
`SessionEnd` hooks fire during agent destruction (fire-and-forget, non-blocking). They are useful for cleanup tasks, resource teardown, and analytics.
|
|
132
|
-
|
|
133
|
-
### Input
|
|
134
|
-
SessionEnd hooks receive `end_source` in the JSON input indicating how the session ended:
|
|
135
|
-
- `"exit"`: User exited the session
|
|
136
|
-
- `"stop"`: Session was explicitly stopped
|
|
137
|
-
- `"compact"`: Session was compacted
|
|
138
|
-
|
|
139
|
-
### Example Configuration
|
|
140
|
-
```json
|
|
141
|
-
{
|
|
142
|
-
"hooks": {
|
|
143
|
-
"SessionEnd": [
|
|
144
|
-
{
|
|
145
|
-
"hooks": [
|
|
146
|
-
{
|
|
147
|
-
"command": "echo '{\"session_id\": \"$WAVE_SESSION_ID\"}' >> /tmp/session-analytics.log",
|
|
148
|
-
"description": "Log session end for analytics",
|
|
149
|
-
"async": true
|
|
150
|
-
}
|
|
151
|
-
]
|
|
152
|
-
}
|
|
153
|
-
]
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
## Live Reload
|
|
159
|
-
|
|
160
|
-
Hook configurations support **live reload**. When you modify hooks in `settings.json`, the changes take effect immediately without restarting Wave.
|
|
161
|
-
|
|
162
|
-
## Plugin Hooks
|
|
163
|
-
|
|
164
|
-
When hooks are registered via a **plugin**, Wave automatically:
|
|
165
|
-
|
|
166
|
-
1. Substitutes `${WAVE_PLUGIN_ROOT}` with the plugin's directory path in the command string
|
|
167
|
-
2. Injects `WAVE_PLUGIN_ROOT` as an environment variable into the hook process
|
|
168
|
-
|
|
169
|
-
```json
|
|
170
|
-
{
|
|
171
|
-
"hooks": {
|
|
172
|
-
"WorktreeCreate": [
|
|
173
|
-
{
|
|
174
|
-
"hooks": [
|
|
175
|
-
{
|
|
176
|
-
"command": "${WAVE_PLUGIN_ROOT}/scripts/setup-worktree.sh"
|
|
177
|
-
}
|
|
178
|
-
]
|
|
179
|
-
}
|
|
180
|
-
]
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
The shell also receives `WAVE_PLUGIN_ROOT` as an env var, so `$WAVE_PLUGIN_ROOT` works in the hook script itself.
|
|
186
|
-
|
|
187
|
-
## Best Practices
|
|
188
|
-
|
|
189
|
-
- **Keep hooks fast**: Long-running hooks can slow down your workflow unless they are `async`.
|
|
190
|
-
- **Use descriptive names**: Help yourself and others understand what each hook does.
|
|
191
|
-
- **Test your hooks**: Run the commands manually first to ensure they work as expected.
|
|
192
|
-
- **Use local overrides**: For machine-specific hooks, use `.wave/settings.local.json`.
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
# Model Context Protocol (MCP) Configuration
|
|
2
|
-
|
|
3
|
-
The Model Context Protocol (MCP) allows Wave to connect to external servers that provide additional tools and context. This document explains how to configure and use MCP servers in Wave.
|
|
4
|
-
|
|
5
|
-
## Configuration File: `.mcp.json`
|
|
6
|
-
|
|
7
|
-
MCP servers are configured in a `.mcp.json` file. Wave looks for this file in your project root:
|
|
8
|
-
|
|
9
|
-
1. **Project Scope**: `.mcp.json` in your project root (Project-specific MCP servers)
|
|
10
|
-
|
|
11
|
-
## Configuration Structure
|
|
12
|
-
|
|
13
|
-
The `.mcp.json` file contains a list of MCP server configurations.
|
|
14
|
-
|
|
15
|
-
```json
|
|
16
|
-
{
|
|
17
|
-
"mcpServers": {
|
|
18
|
-
"sqlite": {
|
|
19
|
-
"command": "uvx",
|
|
20
|
-
"args": ["mcp-server-sqlite", "--db-path", "/path/to/your/database.db"]
|
|
21
|
-
},
|
|
22
|
-
"github": {
|
|
23
|
-
"command": "npx",
|
|
24
|
-
"args": ["-y", "@modelcontextprotocol/server-github"],
|
|
25
|
-
"env": {
|
|
26
|
-
"GITHUB_PERSONAL_ACCESS_TOKEN": "your-token-here"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Fields for each server:
|
|
34
|
-
|
|
35
|
-
- `command`: (For stdio) The executable to run (e.g., `npx`, `uvx`, `python`, `node`).
|
|
36
|
-
- `args`: (For stdio) An array of command-line arguments for the executable.
|
|
37
|
-
- `env`: (Optional) A record of environment variables for the server process.
|
|
38
|
-
- `url`: (For SSE) The endpoint URL of a remote MCP server (e.g., `https://example.com/sse`).
|
|
39
|
-
|
|
40
|
-
## Remote MCP Servers (SSE)
|
|
41
|
-
|
|
42
|
-
Wave also supports connecting to remote MCP servers via SSE (Server-Sent Events).
|
|
43
|
-
|
|
44
|
-
```json
|
|
45
|
-
{
|
|
46
|
-
"mcpServers": {
|
|
47
|
-
"remote-server": {
|
|
48
|
-
"url": "https://mcp-server.example.com/sse"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Using MCP Tools
|
|
55
|
-
|
|
56
|
-
Once configured, Wave will automatically connect to the MCP servers when it starts. Tools provided by these servers will be available to the agent with a prefix:
|
|
57
|
-
|
|
58
|
-
`mcp__[serverName]__[toolName]`
|
|
59
|
-
|
|
60
|
-
For example, if you have a server named `sqlite` with a tool named `query`, it will be available as `mcp__sqlite__query`.
|
|
61
|
-
|
|
62
|
-
## Permissions for MCP Tools
|
|
63
|
-
|
|
64
|
-
By default, MCP tools require user permission before execution. When you grant permission, you can choose to "Allow always" for a specific tool. These persistent rules are stored in your `settings.json` under the `permissions` field.
|
|
65
|
-
|
|
66
|
-
## Plugin MCP Servers
|
|
67
|
-
|
|
68
|
-
When MCP servers are registered via a **plugin**, Wave automatically injects the `WAVE_PLUGIN_ROOT` environment variable into the server process. Additionally, `${WAVE_PLUGIN_ROOT}` in the `command`, `args`, and `env` fields is substituted with the plugin's directory path before the server is spawned (matching Claude Code's `${CLAUDE_PLUGIN_ROOT}` behavior).
|
|
69
|
-
|
|
70
|
-
```json
|
|
71
|
-
{
|
|
72
|
-
"mcpServers": {
|
|
73
|
-
"my-plugin-server": {
|
|
74
|
-
"command": "${WAVE_PLUGIN_ROOT}/bin/mcp-server",
|
|
75
|
-
"args": ["--config", "${WAVE_PLUGIN_ROOT}/config/server.json"]
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
Your MCP server code can also read `WAVE_PLUGIN_ROOT` as an environment variable:
|
|
82
|
-
|
|
83
|
-
```ts
|
|
84
|
-
// Inside your MCP server (e.g., a Node.js script)
|
|
85
|
-
const pluginRoot = process.env.WAVE_PLUGIN_ROOT;
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## Troubleshooting
|
|
89
|
-
|
|
90
|
-
- **Server Connection**: If a server fails to connect, Wave will log an error. You can check the status of MCP servers by asking the agent.
|
|
91
|
-
- **Tool Availability**: If a tool is not appearing, ensure the server is running and the `.mcp.json` configuration is correct.
|
|
92
|
-
- **Logs**: MCP server `stderr` is often used for logging and can be helpful for debugging connection issues.
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Wave Memory Rules Configuration
|
|
2
|
-
|
|
3
|
-
Memory rules allow you to provide context-specific instructions and guidelines to the agent. This document explains how to create and manage memory rules in Wave.
|
|
4
|
-
|
|
5
|
-
## What are Memory Rules?
|
|
6
|
-
|
|
7
|
-
Memory rules are Markdown files that contain instructions for the agent. They are used to:
|
|
8
|
-
- Enforce coding styles and conventions.
|
|
9
|
-
- Provide project-specific context (e.g., "always use pnpm").
|
|
10
|
-
- Define architectural patterns and best practices.
|
|
11
|
-
- Share common knowledge across the team.
|
|
12
|
-
|
|
13
|
-
## Creating Memory Rules
|
|
14
|
-
|
|
15
|
-
Wave looks for memory rules in the following locations:
|
|
16
|
-
|
|
17
|
-
1. **User Scope**: `~/.wave/rules/*.md` (Global memory rules)
|
|
18
|
-
2. **Project Scope**: `.wave/rules/*.md` (Project-specific memory rules)
|
|
19
|
-
3. **Project Root**: `AGENTS.md` (Legacy project-level memory rules)
|
|
20
|
-
|
|
21
|
-
### File Structure
|
|
22
|
-
|
|
23
|
-
A memory rule file is a standard Markdown file. It can optionally include YAML frontmatter to scope the rules to specific file paths.
|
|
24
|
-
|
|
25
|
-
```markdown
|
|
26
|
-
---
|
|
27
|
-
paths:
|
|
28
|
-
- "src/api/**/*.ts"
|
|
29
|
-
- "src/services/**/*.ts"
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
# API and Service Guidelines
|
|
33
|
-
|
|
34
|
-
- Always use `async/await` for asynchronous operations.
|
|
35
|
-
- Use `Zod` for input validation.
|
|
36
|
-
- Follow the repository pattern for data access.
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### YAML Frontmatter Fields
|
|
40
|
-
|
|
41
|
-
- `paths`: (Optional) A list of glob patterns. The rules in this file will only be active when the agent is working with files that match these patterns. If omitted, the rules are always active.
|
|
42
|
-
|
|
43
|
-
## How Memory Rules are Loaded
|
|
44
|
-
|
|
45
|
-
Wave automatically discovers and loads all `.md` files in the `.wave/rules/` directory and its immediate subdirectories.
|
|
46
|
-
|
|
47
|
-
- **Path-Specific Activation**: If a memory rule has a `paths` field, it is only included in the agent's context if *any* file currently being read or modified matches the glob patterns.
|
|
48
|
-
- **Union of Rules**: If multiple files are in context, Wave activates the union of all matching memory rules.
|
|
49
|
-
- **Priority**: Project-level memory rules take priority over user-level memory rules if there is a conflict.
|
|
50
|
-
|
|
51
|
-
## Best Practices
|
|
52
|
-
|
|
53
|
-
- **Keep rules focused**: Create separate files for different topics (e.g., `testing.md`, `ui-components.md`).
|
|
54
|
-
- **Use clear instructions**: Write rules in a way that is easy for the agent to understand and follow.
|
|
55
|
-
- **Leverage path scoping**: Use the `paths` field to keep the agent's context window clean and relevant.
|
|
56
|
-
- **Share rules with your team**: Commit `.wave/rules/` to your git repository to ensure everyone on the team has the same context.
|
|
57
|
-
|
|
58
|
-
## Auto-Memory
|
|
59
|
-
|
|
60
|
-
In addition to manual memory rules, Wave also has an **auto-memory** feature that automatically remembers important information across sessions. This is stored in `~/.wave/projects/<project-id>/memory/MEMORY.md`. You can disable this feature in `settings.json` by setting `"autoMemoryEnabled": false`.
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
# Model Configuration
|
|
2
|
-
|
|
3
|
-
Wave allows you to configure model-specific parameters directly in your `settings.json`. This gives you fine-grained control over reasoning quality, token cost, and latency for different models.
|
|
4
|
-
|
|
5
|
-
## Model Overrides
|
|
6
|
-
|
|
7
|
-
You can define overrides for specific models in the `models` field. The key should be the exact model name used by Wave.
|
|
8
|
-
|
|
9
|
-
```json
|
|
10
|
-
{
|
|
11
|
-
"models": {
|
|
12
|
-
"claude-3-7-sonnet-20250219": {
|
|
13
|
-
"thinking": {
|
|
14
|
-
"type": "enabled",
|
|
15
|
-
"budget_tokens": 1024
|
|
16
|
-
},
|
|
17
|
-
"temperature": 1.0
|
|
18
|
-
},
|
|
19
|
-
"o3-mini": {
|
|
20
|
-
"reasoning_effort": "high"
|
|
21
|
-
},
|
|
22
|
-
"gpt-4o": {
|
|
23
|
-
"temperature": 0.5
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Supported Parameters
|
|
30
|
-
|
|
31
|
-
Wave supports passing arbitrary parameters to the underlying AI provider. Common parameters include:
|
|
32
|
-
|
|
33
|
-
- `temperature`: Controls randomness (0.0 to 2.0).
|
|
34
|
-
- `maxTokens`: Maximum number of tokens to generate in the response.
|
|
35
|
-
- `reasoning_effort`: (OpenAI specific) Controls the reasoning effort for models like `o1` and `o3-mini`. Values: `low`, `medium`, `high`.
|
|
36
|
-
- `thinking`: (Claude specific) Configures the thinking/reasoning capabilities for Claude 3.7+ models.
|
|
37
|
-
- `type`: `"enabled"` or `"disabled"`.
|
|
38
|
-
- `budget_tokens`: Maximum tokens to use for thinking.
|
|
39
|
-
|
|
40
|
-
## Unsetting Default Parameters
|
|
41
|
-
|
|
42
|
-
If a model does not support a default parameter (like `temperature` for some reasoning models), you can explicitly set it to `null` to ensure it is not sent to the provider.
|
|
43
|
-
|
|
44
|
-
```json
|
|
45
|
-
{
|
|
46
|
-
"models": {
|
|
47
|
-
"o1-preview": {
|
|
48
|
-
"temperature": null
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Global Model Selection
|
|
55
|
-
|
|
56
|
-
You can also set the default models Wave uses via environment variables in `settings.json`:
|
|
57
|
-
|
|
58
|
-
```json
|
|
59
|
-
{
|
|
60
|
-
"env": {
|
|
61
|
-
"WAVE_MODEL": "gemini-3-flash",
|
|
62
|
-
"WAVE_FAST_MODEL": "gemini-2.5-flash",
|
|
63
|
-
"WAVE_MAX_INPUT_TOKENS": "100000",
|
|
64
|
-
"WAVE_MAX_OUTPUT_TOKENS": "4096"
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Live Reload
|
|
70
|
-
|
|
71
|
-
Model configurations support **live reload**. When you modify the `models` field or model-related environment variables in `settings.json`, the changes take effect immediately without restarting Wave.
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# Tool Permissions & Safe Zone
|
|
2
|
-
|
|
3
|
-
Wave includes a robust permission system to protect your system while allowing the AI to be productive. This system is centered around the "Safe Zone" and configurable permission modes.
|
|
4
|
-
|
|
5
|
-
## The Safe Zone
|
|
6
|
-
|
|
7
|
-
The Safe Zone is a set of directories where Wave is allowed to perform potentially sensitive operations (like editing or writing files) with reduced friction.
|
|
8
|
-
|
|
9
|
-
By default, the Safe Zone includes:
|
|
10
|
-
- The current project directory.
|
|
11
|
-
- The Wave configuration directories (`~/.wave/` and `.wave/`).
|
|
12
|
-
- The system temporary directory.
|
|
13
|
-
|
|
14
|
-
You can extend the Safe Zone by adding `additionalDirectories` to your `permissions` configuration in `settings.json`.
|
|
15
|
-
|
|
16
|
-
## Permission Modes
|
|
17
|
-
|
|
18
|
-
The `permissionMode` setting determines how Wave handles requests to use restricted tools (e.g., `Bash`, `Edit`, `Write`, `AskUserQuestion`).
|
|
19
|
-
|
|
20
|
-
| Mode | Description |
|
|
21
|
-
| :--- | :--- |
|
|
22
|
-
| `default` | **Recommended.** Wave will ask for your permission before using any restricted tool. |
|
|
23
|
-
| `bypassPermissions` | **Use with caution.** Wave will execute all tools without asking for permission. |
|
|
24
|
-
| `acceptEdits` | Wave will automatically allow `Edit` and `Write` operations within the Safe Zone. It will still ask for permission for `Bash` and operations outside the Safe Zone. |
|
|
25
|
-
| `plan` | Restricted mode for editing the plan file (usually internal). |
|
|
26
|
-
| `dontAsk` | Wave will automatically deny all restricted tools without asking. This is the most restrictive mode. |
|
|
27
|
-
|
|
28
|
-
### Example Configuration
|
|
29
|
-
|
|
30
|
-
```json
|
|
31
|
-
{
|
|
32
|
-
"permissions": {
|
|
33
|
-
"permissionMode": "default",
|
|
34
|
-
"additionalDirectories": ["/home/user/my-exports"],
|
|
35
|
-
"allow": ["ls -R", "git status"],
|
|
36
|
-
"deny": ["rm -rf"]
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Allow and Deny Rules
|
|
42
|
-
|
|
43
|
-
You can pre-approve or explicitly forbid specific operations using `allow` and `deny` rules.
|
|
44
|
-
|
|
45
|
-
- **`allow`**: An array of string patterns (e.g., bash commands or file paths) that are always permitted.
|
|
46
|
-
- **`deny`**: An array of string patterns that are always forbidden.
|
|
47
|
-
|
|
48
|
-
When a tool is called, Wave checks:
|
|
49
|
-
1. If the operation matches a `deny` rule, it is rejected.
|
|
50
|
-
2. If the operation matches an `allow` rule, it is permitted.
|
|
51
|
-
3. If no rules match, the behavior depends on the `permissionMode`.
|
|
52
|
-
|
|
53
|
-
## Managing Permissions via CLI
|
|
54
|
-
|
|
55
|
-
You can also manage permissions directly through the Wave interface:
|
|
56
|
-
- When Wave asks for permission, you can select "Always allow" to add a rule to your `settings.local.json`.
|
|
57
|
-
- You can ask Wave to "Update my permission mode to acceptEdits".
|