wave-agent-sdk 1.0.9 → 1.0.10

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 (63) hide show
  1. package/dist/builtin/index.d.ts +1 -0
  2. package/dist/builtin/index.js +20 -0
  3. package/dist/builtin/plugins.d.ts +1 -0
  4. package/dist/builtin/plugins.js +225 -0
  5. package/dist/builtin/skills/artifact.d.ts +1 -0
  6. package/dist/builtin/skills/artifact.js +18 -0
  7. package/dist/builtin/skills/code-review.d.ts +1 -0
  8. package/{builtin/skills/code-review/SKILL.md → dist/builtin/skills/code-review.js} +23 -19
  9. package/dist/builtin/skills/deep-research.d.ts +1 -0
  10. package/{builtin/skills/deep-research/SKILL.md → dist/builtin/skills/deep-research.js} +18 -14
  11. package/dist/builtin/skills/init.d.ts +1 -0
  12. package/{builtin/skills/init/SKILL.md → dist/builtin/skills/init.js} +6 -3
  13. package/dist/builtin/skills/loop.d.ts +1 -0
  14. package/dist/builtin/skills/loop.js +83 -0
  15. package/dist/builtin/skills/settings.d.ts +1 -0
  16. package/dist/builtin/skills/settings.js +1224 -0
  17. package/dist/builtin/skills/simplify.d.ts +1 -0
  18. package/{builtin/skills/simplify/SKILL.md → dist/builtin/skills/simplify.js} +7 -3
  19. package/dist/builtin/subagents.d.ts +1 -0
  20. package/dist/builtin/subagents.js +164 -0
  21. package/dist/managers/aiManager.js +18 -1
  22. package/dist/managers/mcpManager.js +1 -1
  23. package/dist/managers/messageManager.d.ts +6 -0
  24. package/dist/managers/messageManager.js +33 -0
  25. package/dist/managers/subagentManager.d.ts +8 -0
  26. package/dist/managers/subagentManager.js +57 -2
  27. package/dist/tools/editTool.js +1 -0
  28. package/dist/tools/readTool.js +6 -3
  29. package/dist/tools/types.d.ts +1 -0
  30. package/dist/tools/writeTool.js +1 -0
  31. package/dist/types/messaging.d.ts +1 -0
  32. package/dist/utils/builtinEmbed.d.ts +21 -0
  33. package/dist/utils/builtinEmbed.js +53 -0
  34. package/dist/utils/configPaths.d.ts +0 -1
  35. package/dist/utils/configPaths.js +5 -26
  36. package/dist/utils/convertMessagesForAPI.js +21 -2
  37. package/dist/utils/messageOperations.d.ts +1 -0
  38. package/dist/utils/toolImagePersistence.d.ts +25 -0
  39. package/dist/utils/toolImagePersistence.js +56 -0
  40. package/package.json +1 -3
  41. package/builtin/plugins/sdd/.wave-plugin/plugin.json +0 -8
  42. package/builtin/plugins/sdd/hooks/hooks.json +0 -14
  43. package/builtin/plugins/sdd/scripts/session-start.js +0 -24
  44. package/builtin/plugins/sdd/scripts/spec-count.js +0 -77
  45. package/builtin/plugins/sdd/skills/specify/SKILL.md +0 -47
  46. package/builtin/plugins/sdd/skills/specify/templates/spec-template.md +0 -47
  47. package/builtin/skills/artifact/SKILL.md +0 -14
  48. package/builtin/skills/loop/SKILL.md +0 -79
  49. package/builtin/skills/settings/ENV.md +0 -78
  50. package/builtin/skills/settings/HOOKS.md +0 -227
  51. package/builtin/skills/settings/MCP.md +0 -137
  52. package/builtin/skills/settings/MEMORY.md +0 -76
  53. package/builtin/skills/settings/MODELS.md +0 -119
  54. package/builtin/skills/settings/PERMISSIONS.md +0 -88
  55. package/builtin/skills/settings/PLUGINS.md +0 -171
  56. package/builtin/skills/settings/SKILL.md +0 -132
  57. package/builtin/skills/settings/SKILLS.md +0 -107
  58. package/builtin/skills/settings/SUBAGENTS.md +0 -77
  59. package/builtin/subagents/bash.md +0 -19
  60. package/builtin/subagents/explore.md +0 -43
  61. package/builtin/subagents/general-purpose.md +0 -20
  62. package/builtin/subagents/plan.md +0 -56
  63. package/builtin/subagents/vision.md +0 -18
@@ -1,227 +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
- - `WorktreeRemove`: Triggered before a worktree is removed (e.g., via ExitWorktree with `action: "remove"`). Non-blocking. Fires **before** the worktree directory is deleted so hooks can still read files inside it. The hook receives `worktree_path` in the JSON input. Useful for cleanup tasks (e.g., `docker compose -p $(basename "$worktree_path") down`).
17
- - `CwdChanged`: Triggered when the working directory changes (e.g., entering/exiting a worktree). Non-blocking.
18
- - `SessionStart`: Triggered during session initialization. Hooks can inject `additionalContext` and `initialUserMessage` via stdout.
19
- - `SessionEnd`: Triggered during agent destruction (fire-and-forget, non-blocking). Useful for cleanup, resource teardown, and analytics.
20
- - `PreCompact`: Triggered before conversation compaction. Hook stdout is captured as additional instructions and merged into the compaction prompt.
21
- - `PostCompact`: Triggered after conversation compaction completes. Receives the compact summary text.
22
-
23
- ## Hook Configuration Structure
24
-
25
- Hooks are configured in the `hooks` field of `settings.json`. Each event can have multiple hook configurations.
26
-
27
- ```json
28
- {
29
- "hooks": {
30
- "PreToolUse": [
31
- {
32
- "matcher": "Write",
33
- "hooks": [
34
- {
35
- "command": "pnpm lint",
36
- "description": "Run lint before writing files"
37
- }
38
- ]
39
- }
40
- ],
41
- "PermissionRequest": [
42
- {
43
- "matcher": "Bash",
44
- "hooks": [
45
- {
46
- "command": "echo \"Permission requested for Bash tool\" >> hooks.log",
47
- "description": "Log permission requests for Bash"
48
- }
49
- ]
50
- }
51
- ]
52
- }
53
- }
54
- ```
55
-
56
- ## Hook Configuration Fields
57
-
58
- - `matcher`: (Optional) A pattern to match against the tool name (e.g., "Write", "Read*", "/^Edit/"). Only applicable for `PreToolUse`, `PostToolUse`, and `PermissionRequest`.
59
- - `hooks`: An array of hook commands to execute.
60
- - `command`: The shell command to execute.
61
- - `description`: A brief description of the hook's purpose.
62
- - `async`: (Optional) Whether the hook should run in the background without blocking (default: `false`).
63
- - `timeout`: (Optional) Maximum execution time in seconds (default: `600`).
64
-
65
- ## Hook Input JSON
66
-
67
- 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.
68
-
69
- ### Common Fields
70
- - `session_id`: The current session ID.
71
- - `transcript_path`: Path to the session transcript file (JSON).
72
- - `cwd`: The current working directory.
73
- - `hook_event_name`: The name of the triggering event.
74
-
75
- ### Event-Specific Fields
76
- - `tool_name`: (PreToolUse, PostToolUse, PermissionRequest) The name of the tool.
77
- - `tool_input`: (PreToolUse, PostToolUse, PermissionRequest) The input parameters passed to the tool.
78
- - `tool_response`: (PostToolUse) The result of the tool execution.
79
- - `user_prompt`: (UserPromptSubmit) The text submitted by the user.
80
- - `subagent_type`: (If executed by a subagent) The type of the subagent.
81
- - `name`: (WorktreeCreate) The name of the new worktree.
82
- - `worktree_path`: (WorktreeRemove) The absolute path of the worktree about to be removed. Derive the worktree name with `basename "$worktree_path"`.
83
- - `old_cwd`: (CwdChanged) The previous working directory.
84
- - `new_cwd`: (CwdChanged) The new working directory.
85
- - `compact_instructions`: (PreCompact) Custom instructions for the compaction, if any.
86
- - `compact_summary`: (PostCompact) The AI-generated compaction summary text.
87
- - `source`: (SessionStart) The session start source: `"startup"`, `"resume"`, or `"compact"`.
88
- - `agent_type`: (SessionStart) The agent type identifier.
89
- - `end_source`: (SessionEnd) The session end source: `"exit"`, `"stop"`, or `"compact"`.
90
-
91
- ## Hook Exit Codes
92
-
93
- Hooks can communicate status and control Wave's behavior using exit codes:
94
-
95
- - **Exit 0**: Success. Wave continues its normal execution.
96
- - **Exit 2**: Blocking Error. Wave blocks the current operation and provides feedback based on the event:
97
- - `UserPromptSubmit`: Blocks prompt processing and shows `stderr` as a user error.
98
- - `PreToolUse`: Blocks tool execution and provides `stderr` to the agent as feedback.
99
- - `PostToolUse`: Appends `stderr` to the tool result as feedback for the agent.
100
- - `Stop`: Blocks the stop operation and provides `stderr` to the agent.
101
- - `WorktreeCreate` / `WorktreeRemove` / `CwdChanged` / `PreCompact` / `PostCompact`: Shows `stderr` in an error block, but does not block the operation.
102
- - `SessionStart` / `SessionEnd`: Shows `stderr` in an error block, but does not block startup or shutdown.
103
- - **Other Exits (e.g., Exit 1)**: Non-blocking error. Wave continues execution but shows `stderr` as a warning to the user.
104
-
105
- ## SessionStart Hooks
106
-
107
- `SessionStart` hooks fire during session initialization. They can inject context and messages into the session via stdout.
108
-
109
- ### Stdout Processing
110
-
111
- Hook stdout is processed as follows:
112
- - If stdout is valid JSON with `hookSpecificOutput.additionalContext` (Claude Code format), that value is injected as additional context.
113
- - If stdout is valid JSON with `initialUserMessage` at the top level, that value is injected as the initial user message.
114
- - If stdout is not JSON, the entire output is appended as additional context.
115
-
116
- Example hook output:
117
- ```json
118
- {"hookSpecificOutput": {"hookEventName": "SessionStart", "additionalContext": "User prefers concise responses"}, "initialUserMessage": "Here is my current task..."}
119
- ```
120
-
121
- ### Example Configuration
122
- ```json
123
- {
124
- "hooks": {
125
- "SessionStart": [
126
- {
127
- "hooks": [
128
- {
129
- "command": "echo '{\"hookSpecificOutput\": {\"hookEventName\": \"SessionStart\", \"additionalContext\": \"Project uses pnpm and TypeScript\"}}'",
130
- "description": "Inject project context at session start"
131
- }
132
- ]
133
- }
134
- ]
135
- }
136
- }
137
- ```
138
-
139
- ## SessionEnd Hooks
140
-
141
- `SessionEnd` hooks fire during agent destruction (fire-and-forget, non-blocking). They are useful for cleanup tasks, resource teardown, and analytics.
142
-
143
- ### Input
144
- SessionEnd hooks receive `end_source` in the JSON input indicating how the session ended:
145
- - `"exit"`: User exited the session
146
- - `"stop"`: Session was explicitly stopped
147
- - `"compact"`: Session was compacted
148
-
149
- ### Example Configuration
150
- ```json
151
- {
152
- "hooks": {
153
- "SessionEnd": [
154
- {
155
- "hooks": [
156
- {
157
- "command": "echo '{\"session_id\": \"$WAVE_SESSION_ID\"}' >> /tmp/session-analytics.log",
158
- "description": "Log session end for analytics",
159
- "async": true
160
- }
161
- ]
162
- }
163
- ]
164
- }
165
- }
166
- ```
167
-
168
- ## WorktreeRemove Hooks
169
-
170
- `WorktreeRemove` hooks fire **before** the worktree directory is deleted, so they can still read files inside it. They are non-blocking (Notification type): the hook never replaces `git worktree remove` itself. Useful for cleaning up external resources that were provisioned for the worktree (databases, containers, etc.).
171
-
172
- ### Input
173
- WorktreeRemove hooks receive `worktree_path` in the JSON input (alongside the common fields `session_id`, `transcript_path`, `cwd`, `hook_event_name`). The worktree name can be derived via `basename "$worktree_path"`.
174
-
175
- ### Example Configuration
176
- ```json
177
- {
178
- "hooks": {
179
- "WorktreeRemove": [
180
- {
181
- "hooks": [
182
- {
183
- "command": "worktree_path=$(jq -r '.worktree_path') && docker compose -p \"$(basename \"$worktree_path\")\" down || true",
184
- "description": "Tear down the worktree's docker compose project before removal"
185
- }
186
- ]
187
- }
188
- ]
189
- }
190
- }
191
- ```
192
-
193
- ## Live Reload
194
-
195
- Hook configurations support **live reload**. When you modify hooks in `settings.json`, the changes take effect immediately without restarting Wave.
196
-
197
- ## Plugin Hooks
198
-
199
- When hooks are registered via a **plugin**, Wave automatically:
200
-
201
- 1. Substitutes `${WAVE_PLUGIN_ROOT}` with the plugin's directory path in the command string
202
- 2. Injects `WAVE_PLUGIN_ROOT` as an environment variable into the hook process
203
-
204
- ```json
205
- {
206
- "hooks": {
207
- "WorktreeCreate": [
208
- {
209
- "hooks": [
210
- {
211
- "command": "${WAVE_PLUGIN_ROOT}/scripts/setup-worktree.sh"
212
- }
213
- ]
214
- }
215
- ]
216
- }
217
- }
218
- ```
219
-
220
- The shell also receives `WAVE_PLUGIN_ROOT` as an env var, so `$WAVE_PLUGIN_ROOT` works in the hook script itself.
221
-
222
- ## Best Practices
223
-
224
- - **Keep hooks fast**: Long-running hooks can slow down your workflow unless they are `async`.
225
- - **Use descriptive names**: Help yourself and others understand what each hook does.
226
- - **Test your hooks**: Run the commands manually first to ensure they work as expected.
227
- - **Use local overrides**: For machine-specific hooks, use `.wave/settings.local.json`.
@@ -1,137 +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
- - `type`: (Optional) The transport type: `"stdio"`, `"sse"`, or `"http"`. If omitted, Wave infers the type from other fields (URL → `"http"`, command → `"stdio"`). Set explicitly for clarity and to avoid the default behavior.
36
- - `command`: (For stdio) The executable to run (e.g., `npx`, `uvx`, `python`, `node`).
37
- - `args`: (For stdio) An array of command-line arguments for the executable.
38
- - `env`: (Optional) A record of environment variables for the server process.
39
- - `url`: (For `sse`/`http`) The endpoint URL of a remote MCP server.
40
- - `headers`: (For `sse`/`http`) A record of HTTP headers to send with requests (e.g., `{"Authorization": "Bearer token"}`).
41
-
42
- ## Transport Types
43
-
44
- Wave supports three MCP transport types. When `type` is not specified, Wave uses the following defaults:
45
- - If `url` is provided → defaults to `"http"` (Streamable HTTP)
46
- - If `command` is provided → defaults to `"stdio"`
47
-
48
- ### stdio
49
-
50
- The server is launched as a local subprocess. Use for locally installed MCP servers.
51
-
52
- ```json
53
- {
54
- "mcpServers": {
55
- "sqlite": {
56
- "type": "stdio",
57
- "command": "uvx",
58
- "args": ["mcp-server-sqlite", "--db-path", "/path/to/db"]
59
- }
60
- }
61
- }
62
- ```
63
-
64
- ### http (Streamable HTTP)
65
-
66
- The recommended transport for remote servers. Uses the MCP Streamable HTTP protocol.
67
-
68
- ```json
69
- {
70
- "mcpServers": {
71
- "remote-api": {
72
- "type": "http",
73
- "url": "https://mcp-server.example.com/mcp",
74
- "headers": {
75
- "Authorization": "Bearer your-token"
76
- }
77
- }
78
- }
79
- }
80
- ```
81
-
82
- ### sse (Server-Sent Events)
83
-
84
- Legacy transport for remote servers that only support SSE. Use `"http"` for new servers unless the server requires SSE.
85
-
86
- ```json
87
- {
88
- "mcpServers": {
89
- "legacy-server": {
90
- "type": "sse",
91
- "url": "https://mcp-server.example.com/sse"
92
- }
93
- }
94
- }
95
- ```
96
-
97
- > **Note**: When `type` is not specified, URL-based servers default to `"http"` with no SSE fallback. If you need SSE, set `type: "sse"` explicitly.
98
-
99
- ## Using MCP Tools
100
-
101
- 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:
102
-
103
- `mcp__[serverName]__[toolName]`
104
-
105
- For example, if you have a server named `sqlite` with a tool named `query`, it will be available as `mcp__sqlite__query`.
106
-
107
- ## Permissions for MCP Tools
108
-
109
- 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.
110
-
111
- ## Plugin MCP Servers
112
-
113
- 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).
114
-
115
- ```json
116
- {
117
- "mcpServers": {
118
- "my-plugin-server": {
119
- "command": "${WAVE_PLUGIN_ROOT}/bin/mcp-server",
120
- "args": ["--config", "${WAVE_PLUGIN_ROOT}/config/server.json"]
121
- }
122
- }
123
- }
124
- ```
125
-
126
- Your MCP server code can also read `WAVE_PLUGIN_ROOT` as an environment variable:
127
-
128
- ```ts
129
- // Inside your MCP server (e.g., a Node.js script)
130
- const pluginRoot = process.env.WAVE_PLUGIN_ROOT;
131
- ```
132
-
133
- ## Troubleshooting
134
-
135
- - **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.
136
- - **Tool Availability**: If a tool is not appearing, ensure the server is running and the `.mcp.json` configuration is correct.
137
- - **Logs**: MCP server `stderr` is often used for logging and can be helpful for debugging connection issues.
@@ -1,76 +0,0 @@
1
- # Wave Memory
2
-
3
- Wave provides multiple memory layers to give the agent context-specific instructions and knowledge. Memory files are standard Markdown files loaded automatically at startup.
4
-
5
- ## Memory Layers
6
-
7
- Wave looks for memory in the following locations, loaded in order of increasing priority:
8
-
9
- 1. **User Memory**: `~/.wave/AGENTS.md` — Global instructions across all projects
10
- 2. **Project Memory**: `AGENTS.md` in the project root — Project-specific instructions
11
- 3. **Memory Rules**: `.wave/rules/*.md` and `~/.wave/rules/*.md` — Modular, path-scoped rules (see below)
12
-
13
- > `CLAUDE.md` is also supported as a fallback for both user and project memory, for compatibility with existing repositories.
14
-
15
- ## User Memory
16
-
17
- Stored at `~/.wave/AGENTS.md`. Use it for cross-project preferences and global instructions, e.g. "always write tests for new features", "prefer functional style".
18
-
19
- ## Project Memory
20
-
21
- ### Project Memory File
22
-
23
- The `AGENTS.md` file in the project root is the primary project-level memory. It is checked into the repository and shared with all contributors. Use it for:
24
-
25
- - Build and test commands (e.g. "use pnpm not npm")
26
- - Project structure and architecture conventions
27
- - Coding standards and patterns
28
-
29
- ### Memory Rules
30
-
31
- Memory rules are modular Markdown files that provide path-scoped instructions. They are discovered in:
32
-
33
- - **Project scope**: `.wave/rules/*.md` (checked into the repo)
34
- - **User scope**: `~/.wave/rules/*.md` (personal, not shared)
35
-
36
- Each file can optionally include YAML frontmatter to scope rules to specific file paths:
37
-
38
- ```markdown
39
- ---
40
- paths:
41
- - "src/api/**/*.ts"
42
- - "src/services/**/*.ts"
43
- ---
44
-
45
- # API and Service Guidelines
46
-
47
- - Always use `async/await` for asynchronous operations.
48
- - Use `Zod` for input validation.
49
- ```
50
-
51
- #### YAML Frontmatter Fields
52
-
53
- - `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.
54
- - `priority`: (Optional) A number controlling rule precedence. Higher priority rules override lower ones on conflict.
55
-
56
- #### How Memory Rules are Loaded
57
-
58
- - Wave recursively discovers all `.md` files in `.wave/rules/` and `~/.wave/rules/`.
59
- - **Path-specific activation**: If a rule has a `paths` field, it is only included in the agent's context when a file being read or modified matches the glob patterns.
60
- - **Unconditional rules**: Rules without a `paths` field are always active.
61
- - **Priority**: Project-level rules take priority over user-level rules if there is a conflict.
62
-
63
- #### Best Practices
64
-
65
- - **Keep rules focused**: Create separate files for different topics (e.g. `testing.md`, `ui-components.md`).
66
- - **Leverage path scoping**: Use the `paths` field to keep the agent's context window clean and relevant.
67
- - **Share with your team**: Commit `.wave/rules/` to your git repository.
68
-
69
- ## Auto-Memory
70
-
71
- In addition to manual memory files, Wave has an **auto-memory** feature that automatically extracts and remembers important information across sessions. This is stored in `~/.wave/projects/<project-id>/memory/MEMORY.md`.
72
-
73
- You can control auto-memory in `settings.json`:
74
-
75
- - `autoMemoryEnabled`: Enable or disable auto-memory (default: `true`).
76
- - `autoMemoryFrequency`: Frequency of auto-memory extraction turns (default: `1`).
@@ -1,119 +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
- "options": {
14
- "thinking": {
15
- "type": "enabled",
16
- "budget_tokens": 1024
17
- },
18
- "temperature": 1.0
19
- }
20
- },
21
- "o3-mini": {
22
- "options": {
23
- "reasoning_effort": "high"
24
- }
25
- },
26
- "gpt-4o": {
27
- "options": {
28
- "temperature": 0.5
29
- }
30
- }
31
- }
32
- }
33
- ```
34
-
35
- ## Supported Parameters
36
-
37
- Generation parameters are nested under the `options` field within each model's configuration. Wave supports passing arbitrary parameters to the underlying AI provider. Common parameters include:
38
-
39
- - `temperature`: Controls randomness (0.0 to 2.0).
40
- - `maxTokens`: Maximum number of tokens to generate in the response.
41
- - `reasoning_effort`: (OpenAI specific) Controls the reasoning effort for models like `o1` and `o3-mini`. Values: `low`, `medium`, `high`.
42
- - `thinking`: (Claude specific) Configures the thinking/reasoning capabilities for Claude 3.7+ models.
43
- - `type`: `"enabled"` or `"disabled"`.
44
- - `budget_tokens`: Maximum tokens to use for thinking.
45
-
46
- ## Model Capabilities
47
-
48
- Wave needs to know whether a model supports certain features. Instead of guessing from the model name, you declare these explicitly via the `capabilities` field. Note that `capabilities` is set at the top level of the model configuration, **not** inside the `options` field — `options` is reserved for generation parameters only.
49
-
50
- - `vision` (default: `true`): Whether the model can accept image inputs. When `false`, images are stripped and replaced with text placeholders.
51
- - `promptCaching` (default: `false`): Whether the model supports ephemeral prompt caching (e.g., Anthropic's `cache_control` markers). When `true`, Wave injects cache markers on the system prompt and last user message.
52
-
53
- ```json
54
- {
55
- "models": {
56
- "claude-3-7-sonnet-20250219": {
57
- "capabilities": {
58
- "vision": true,
59
- "promptCaching": true
60
- }
61
- },
62
- "deepseek-r1": {
63
- "capabilities": {
64
- "vision": false,
65
- "promptCaching": false
66
- }
67
- }
68
- }
69
- }
70
- ```
71
-
72
- You can also set `capabilities` at the top level of `settings.json` to apply to the default model:
73
-
74
- ```json
75
- {
76
- "capabilities": {
77
- "vision": true,
78
- "promptCaching": false
79
- }
80
- }
81
- ```
82
-
83
- ## Unsetting Default Parameters
84
-
85
- If a model does not support a default parameter (like `temperature` for some reasoning models), you can explicitly set it to `null` inside the `options` field to ensure it is not sent to the provider.
86
-
87
- ```json
88
- {
89
- "models": {
90
- "o1-preview": {
91
- "options": {
92
- "temperature": null
93
- }
94
- }
95
- }
96
- }
97
- ```
98
-
99
- ## Global Model Selection
100
-
101
- You can also set the default models Wave uses via environment variables in `settings.json`:
102
-
103
- ```json
104
- {
105
- "env": {
106
- "WAVE_MODEL": "gemini-3-flash",
107
- "WAVE_FAST_MODEL": "gemini-2.5-flash",
108
- "WAVE_VISION_MODEL": "qwen-vl-max",
109
- "WAVE_MAX_INPUT_TOKENS": "100000",
110
- "WAVE_MAX_OUTPUT_TOKENS": "4096"
111
- }
112
- }
113
- ```
114
-
115
- `WAVE_VISION_MODEL` names a vision-capable model for the built-in `vision` subagent. Setting it registers the subagent, whose frontmatter `model: visionModel` resolves to this value — so a fast non-vision main model can delegate image recognition. Leave it unset to disable the built-in `vision` subagent.
116
-
117
- ## Live Reload
118
-
119
- 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,88 +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
- ### Rule Syntax
54
-
55
- Rules use the format `ToolName(pattern)`. The wildcard `*` has different semantics depending on the tool type:
56
-
57
- **Bash rules** — `*` matches everything including `/` (regex-style):
58
-
59
- ```json
60
- { "allow": ["Bash(git status*)", "Bash(npm run *)"] }
61
- ```
62
-
63
- - `Bash(git status*)` matches `git status`, `git status -s`, `git status --short`
64
- - `Bash(npm run *)` matches `npm run build`, `npm run test:unit`
65
- - `*` → `.*` regex conversion, so `Bash(node */scripts/*.mjs*)` matches `node plugins/code2cwspec/scripts/check-manifest.mjs`
66
-
67
- **File tool rules** (`Read`, `Write`, `Edit`) — `*` does NOT cross `/` (glob-style, use `**` for directories):
68
-
69
- ```json
70
- { "allow": ["Read(**/*.env)", "Write(src/**/*.ts)"] }
71
- ```
72
-
73
- - `Read(*.env)` matches `local.env` but NOT `config/local.env`
74
- - `Read(**/*.env)` matches `local.env`, `config/local.env`, `a/b/c.env`
75
- - Uses `minimatch` glob semantics
76
-
77
- | Tool | `*` matches `/`? | Semantics | Example |
78
- | :--- | :--- | :--- | :--- |
79
- | `Bash(...)` | Yes | Regex `.*` | `Bash(npm *)` → any npm command |
80
- | `Read(...)` | No | Glob (use `**`) | `Read(**/*.env)` → any depth `.env` |
81
- | `Write(...)` | No | Glob (use `**`) | `Write(src/**/*.ts)` → any `.ts` in src |
82
- | `Edit(...)` | No | Glob (use `**`) | `Edit(**/*.json)` → any `.json` |
83
-
84
- ## Managing Permissions via CLI
85
-
86
- You can also manage permissions directly through the Wave interface:
87
- - When Wave asks for permission, you can select "Always allow" to add a rule to your `settings.local.json`.
88
- - You can ask Wave to "Update my permission mode to acceptEdits".