wave-agent-sdk 1.0.8 → 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 (74) 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/backgroundTaskManager.js +52 -4
  23. package/dist/managers/mcpManager.js +1 -1
  24. package/dist/managers/messageManager.d.ts +6 -0
  25. package/dist/managers/messageManager.js +33 -0
  26. package/dist/managers/skillManager.d.ts +13 -0
  27. package/dist/managers/skillManager.js +30 -0
  28. package/dist/managers/subagentManager.d.ts +8 -0
  29. package/dist/managers/subagentManager.js +57 -2
  30. package/dist/managers/toolManager.d.ts +8 -0
  31. package/dist/managers/toolManager.js +11 -0
  32. package/dist/services/artifactAvailability.d.ts +3 -1
  33. package/dist/services/artifactAvailability.js +9 -1
  34. package/dist/services/remoteSettingsService.js +2 -0
  35. package/dist/tools/bashTool.js +13 -2
  36. package/dist/tools/editTool.js +8 -2
  37. package/dist/tools/readTool.js +6 -3
  38. package/dist/tools/types.d.ts +1 -0
  39. package/dist/tools/writeTool.js +1 -0
  40. package/dist/types/messaging.d.ts +1 -0
  41. package/dist/utils/builtinEmbed.d.ts +21 -0
  42. package/dist/utils/builtinEmbed.js +53 -0
  43. package/dist/utils/configPaths.d.ts +0 -1
  44. package/dist/utils/configPaths.js +5 -26
  45. package/dist/utils/containerSetup.js +8 -0
  46. package/dist/utils/convertMessagesForAPI.js +21 -2
  47. package/dist/utils/encoding.d.ts +28 -0
  48. package/dist/utils/encoding.js +99 -0
  49. package/dist/utils/messageOperations.d.ts +1 -0
  50. package/dist/utils/toolImagePersistence.d.ts +25 -0
  51. package/dist/utils/toolImagePersistence.js +56 -0
  52. package/package.json +1 -3
  53. package/builtin/plugins/sdd/.wave-plugin/plugin.json +0 -8
  54. package/builtin/plugins/sdd/hooks/hooks.json +0 -14
  55. package/builtin/plugins/sdd/scripts/session-start.js +0 -24
  56. package/builtin/plugins/sdd/scripts/spec-count.js +0 -77
  57. package/builtin/plugins/sdd/skills/specify/SKILL.md +0 -47
  58. package/builtin/plugins/sdd/skills/specify/templates/spec-template.md +0 -47
  59. package/builtin/skills/loop/SKILL.md +0 -79
  60. package/builtin/skills/settings/ENV.md +0 -78
  61. package/builtin/skills/settings/HOOKS.md +0 -227
  62. package/builtin/skills/settings/MCP.md +0 -137
  63. package/builtin/skills/settings/MEMORY.md +0 -76
  64. package/builtin/skills/settings/MODELS.md +0 -119
  65. package/builtin/skills/settings/PERMISSIONS.md +0 -88
  66. package/builtin/skills/settings/PLUGINS.md +0 -171
  67. package/builtin/skills/settings/SKILL.md +0 -125
  68. package/builtin/skills/settings/SKILLS.md +0 -107
  69. package/builtin/skills/settings/SUBAGENTS.md +0 -77
  70. package/builtin/subagents/bash.md +0 -19
  71. package/builtin/subagents/explore.md +0 -43
  72. package/builtin/subagents/general-purpose.md +0 -20
  73. package/builtin/subagents/plan.md +0 -56
  74. package/builtin/subagents/vision.md +0 -18
@@ -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".
@@ -1,171 +0,0 @@
1
- # Wave Plugins & Plugin Marketplaces
2
-
3
- This guide covers creating plugins, publishing plugin marketplaces, and installing plugins from marketplaces.
4
-
5
- ## Plugins
6
-
7
- Plugins bundle skills, hooks, MCP servers, LSP servers, and slash commands into a reusable package.
8
-
9
- ### Creating a Plugin
10
-
11
- A plugin is any directory containing a `.wave-plugin/plugin.json` manifest:
12
-
13
- ```json
14
- {
15
- "name": "my-plugin",
16
- "description": "A plugin that adds code review capabilities",
17
- "version": "1.0.0",
18
- "author": {
19
- "name": "Your Name"
20
- }
21
- }
22
- ```
23
-
24
- Plugin name must match `^[a-z0-9-]+$` (lowercase letters, numbers, hyphens only).
25
-
26
- Place resources in standard directories within the plugin:
27
-
28
- | Directory / File | Purpose |
29
- |-----------------|---------|
30
- | `skills/` | Skill directories, each containing a `SKILL.md` file |
31
- | `commands/` | Custom slash command definitions |
32
- | `hooks/hooks.json` | Hook configuration |
33
- | `.lsp.json` | LSP server configuration |
34
- | `.mcp.json` | MCP server configuration |
35
-
36
- Only `plugin.json` should exist in `.wave-plugin/` — any other files there will cause a validation error.
37
-
38
- ### Installing a Plugin Locally
39
-
40
- Add a plugin directly in `settings.json`:
41
-
42
- ```json
43
- {
44
- "plugins": [
45
- {
46
- "type": "local",
47
- "path": "/path/to/my-plugin"
48
- }
49
- ]
50
- }
51
- ```
52
-
53
- ### `${WAVE_PLUGIN_ROOT}` Placeholder
54
-
55
- Plugin skills, hooks, MCP servers, and LSP servers can reference their parent plugin's directory using `${WAVE_PLUGIN_ROOT}`. Wave substitutes this placeholder with the plugin's absolute directory path at load time, and also injects `WAVE_PLUGIN_ROOT` as an environment variable into spawned processes.
56
-
57
- Example hook command:
58
- ```json
59
- {
60
- "hooks": {
61
- "SessionStart": [
62
- {
63
- "hooks": [
64
- {
65
- "type": "command",
66
- "command": "\"${WAVE_PLUGIN_ROOT}/hooks/session-start\"",
67
- "async": false
68
- }
69
- ]
70
- }
71
- ]
72
- }
73
- }
74
- ```
75
-
76
- ## Plugin Marketplaces
77
-
78
- A plugin marketplace is a git repository containing a `.wave-plugin/marketplace.json` that lists available plugins.
79
-
80
- ### Marketplace Manifest
81
-
82
- ```json
83
- {
84
- "name": "my-plugins",
85
- "owner": {
86
- "name": "Your Name"
87
- },
88
- "plugins": [
89
- {
90
- "name": "review-plugin",
91
- "description": "Adds a /review command for code reviews",
92
- "source": "./plugins/review-plugin"
93
- },
94
- {
95
- "name": "remote-plugin",
96
- "description": "Plugin hosted on a remote git repo",
97
- "source": "https://github.com/user/remote-plugin.git"
98
- }
99
- ]
100
- }
101
- ```
102
-
103
- - `source` can be a **relative path** (resolved from the marketplace repo root) or a **git URL** (`https://`, `git@`, `ssh://`) for remote repos.
104
- - Each plugin at its source path must have its own `.wave-plugin/plugin.json` manifest.
105
-
106
- ### Registering a Marketplace
107
-
108
- Add a marketplace in `settings.json`:
109
-
110
- ```json
111
- {
112
- "marketplaces": {
113
- "my-plugins": {
114
- "source": {
115
- "source": "github",
116
- "repo": "user/my-plugins"
117
- }
118
- }
119
- }
120
- }
121
- ```
122
-
123
- **Source types:**
124
-
125
- | Type | Format | Example |
126
- |------|--------|---------|
127
- | GitHub | `{ "source": "github", "repo": "owner/repo", "ref": "branch" }` | Clones from `github.com/owner/repo` |
128
- | Git URL | `{ "source": "git", "url": "https://...", "ref": "branch" }` | Clones from any git remote |
129
- | Directory | `{ "source": "directory", "path": "/local/path" }` | Uses a local directory |
130
-
131
- ### Installing from a Marketplace
132
-
133
- Install a plugin using the format `plugin-name@marketplace-name`:
134
-
135
- ```
136
- /install-plugin my-plugin@my-plugins
137
- ```
138
-
139
- Wave clones the marketplace repo, reads the manifest, and copies the plugin to its cache directory.
140
-
141
- ### Creating a Plugin Marketplace
142
-
143
- 1. Create a git repository
144
- 2. Add `.wave-plugin/marketplace.json` at the root
145
- 3. Add plugin directories with their own `.wave-plugin/plugin.json`
146
- 4. Register the marketplace in your `settings.json` using a github, git, or directory source
147
- 5. Plugins are cloned to the cache directory on install
148
-
149
- ### Updating Plugins
150
-
151
- Marketplaces with `autoUpdate: true` are checked for updates on startup:
152
-
153
- ```json
154
- {
155
- "marketplaces": {
156
- "my-plugins": {
157
- "source": { "source": "github", "repo": "user/my-plugins" },
158
- "autoUpdate": true
159
- }
160
- }
161
- }
162
- ```
163
-
164
- ### Marketplace Scopes
165
-
166
- Marketplace declarations can be scoped:
167
- - **User scope**: `~/.wave/settings.json` — available in all projects
168
- - **Project scope**: `.wave/settings.json` — available in this project only
169
- - **Local scope**: `.wave/settings.local.json` — not committed to git
170
-
171
- Later scopes override earlier ones (local > project > user).