wave-agent-sdk 0.14.0 → 0.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/builtin/skills/settings/HOOKS.md +69 -0
  2. package/builtin/skills/settings/PLUGINS.md +171 -0
  3. package/builtin/skills/settings/SKILL.md +8 -3
  4. package/dist/agent.d.ts +2 -2
  5. package/dist/agent.d.ts.map +1 -1
  6. package/dist/agent.js +12 -3
  7. package/dist/core/plugin.d.ts +2 -2
  8. package/dist/core/plugin.d.ts.map +1 -1
  9. package/dist/core/plugin.js +7 -7
  10. package/dist/managers/aiManager.d.ts +6 -6
  11. package/dist/managers/aiManager.d.ts.map +1 -1
  12. package/dist/managers/aiManager.js +122 -59
  13. package/dist/managers/backgroundTaskManager.d.ts.map +1 -1
  14. package/dist/managers/backgroundTaskManager.js +28 -30
  15. package/dist/managers/hookManager.d.ts +16 -1
  16. package/dist/managers/hookManager.d.ts.map +1 -1
  17. package/dist/managers/hookManager.js +97 -8
  18. package/dist/managers/messageManager.d.ts +19 -4
  19. package/dist/managers/messageManager.d.ts.map +1 -1
  20. package/dist/managers/messageManager.js +63 -18
  21. package/dist/managers/pluginManager.d.ts.map +1 -1
  22. package/dist/managers/pluginManager.js +1 -1
  23. package/dist/prompts/index.d.ts +1 -1
  24. package/dist/prompts/index.d.ts.map +1 -1
  25. package/dist/prompts/index.js +1 -1
  26. package/dist/services/MarketplaceService.d.ts +42 -12
  27. package/dist/services/MarketplaceService.d.ts.map +1 -1
  28. package/dist/services/MarketplaceService.js +225 -105
  29. package/dist/services/aiService.d.ts +3 -3
  30. package/dist/services/aiService.d.ts.map +1 -1
  31. package/dist/services/aiService.js +7 -7
  32. package/dist/services/configurationService.d.ts +17 -1
  33. package/dist/services/configurationService.d.ts.map +1 -1
  34. package/dist/services/configurationService.js +104 -0
  35. package/dist/services/hook.d.ts.map +1 -1
  36. package/dist/services/hook.js +15 -0
  37. package/dist/services/initializationService.d.ts.map +1 -1
  38. package/dist/services/initializationService.js +24 -1
  39. package/dist/services/interactionService.js +1 -1
  40. package/dist/services/pluginLoader.d.ts.map +1 -1
  41. package/dist/services/pluginLoader.js +7 -1
  42. package/dist/services/session.d.ts +1 -1
  43. package/dist/services/session.js +7 -7
  44. package/dist/services/taskManager.d.ts +1 -1
  45. package/dist/services/taskManager.js +1 -1
  46. package/dist/types/configuration.d.ts +7 -0
  47. package/dist/types/configuration.d.ts.map +1 -1
  48. package/dist/types/core.d.ts +1 -1
  49. package/dist/types/core.d.ts.map +1 -1
  50. package/dist/types/hooks.d.ts +9 -1
  51. package/dist/types/hooks.d.ts.map +1 -1
  52. package/dist/types/hooks.js +2 -0
  53. package/dist/types/marketplace.d.ts +2 -0
  54. package/dist/types/marketplace.d.ts.map +1 -1
  55. package/dist/types/messaging.d.ts +3 -3
  56. package/dist/types/messaging.d.ts.map +1 -1
  57. package/dist/utils/convertMessagesForAPI.d.ts +1 -1
  58. package/dist/utils/convertMessagesForAPI.js +7 -7
  59. package/dist/utils/groupMessagesByApiRound.d.ts +1 -1
  60. package/dist/utils/groupMessagesByApiRound.js +6 -6
  61. package/dist/utils/messageOperations.d.ts.map +1 -1
  62. package/dist/utils/messageOperations.js +3 -3
  63. package/package.json +1 -1
  64. package/src/agent.ts +16 -3
  65. package/src/core/plugin.ts +13 -7
  66. package/src/managers/aiManager.ts +142 -63
  67. package/src/managers/backgroundTaskManager.ts +33 -42
  68. package/src/managers/hookManager.ts +125 -10
  69. package/src/managers/messageManager.ts +76 -22
  70. package/src/managers/pluginManager.ts +4 -1
  71. package/src/prompts/index.ts +1 -1
  72. package/src/services/MarketplaceService.ts +301 -111
  73. package/src/services/aiService.ts +11 -11
  74. package/src/services/configurationService.ts +131 -0
  75. package/src/services/hook.ts +17 -0
  76. package/src/services/initializationService.ts +33 -1
  77. package/src/services/interactionService.ts +1 -1
  78. package/src/services/pluginLoader.ts +7 -1
  79. package/src/services/session.ts +7 -7
  80. package/src/services/taskManager.ts +1 -1
  81. package/src/types/configuration.ts +8 -0
  82. package/src/types/core.ts +1 -1
  83. package/src/types/hooks.ts +16 -2
  84. package/src/types/marketplace.ts +2 -0
  85. package/src/types/messaging.ts +3 -3
  86. package/src/utils/convertMessagesForAPI.ts +8 -8
  87. package/src/utils/groupMessagesByApiRound.ts +6 -6
  88. package/src/utils/messageOperations.ts +3 -5
@@ -13,6 +13,8 @@ Wave supports the following hook events:
13
13
  - `Stop`: Triggered when Wave finishes its response cycle (no more tool calls).
14
14
  - `SubagentStop`: Triggered when a subagent finishes its response cycle.
15
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.
16
18
 
17
19
  ## Hook Configuration Structure
18
20
 
@@ -73,6 +75,9 @@ Wave provides detailed context to hook processes via `stdin` as a JSON object. T
73
75
  - `user_prompt`: (UserPromptSubmit) The text submitted by the user.
74
76
  - `subagent_type`: (If executed by a subagent) The type of the subagent.
75
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"`.
76
81
 
77
82
  ## Hook Exit Codes
78
83
 
@@ -84,8 +89,72 @@ Hooks can communicate status and control Wave's behavior using exit codes:
84
89
  - `PreToolUse`: Blocks tool execution and provides `stderr` to the agent as feedback.
85
90
  - `PostToolUse`: Appends `stderr` to the tool result as feedback for the agent.
86
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.
87
93
  - **Other Exits (e.g., Exit 1)**: Non-blocking error. Wave continues execution but shows `stderr` as a warning to the user.
88
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
+
89
158
  ## Live Reload
90
159
 
91
160
  Hook configurations support **live reload**. When you modify hooks in `settings.json`, the changes take effect immediately without restarting Wave.
@@ -0,0 +1,171 @@
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).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: settings
3
- description: Manage Wave settings and get guidance on settings.json, hooks, environment variables, permissions, MCP servers, memory rules, skills, and subagents. Use this when the user wants to view, update, or learn how to configure Wave.
3
+ description: Manage Wave settings and get guidance on settings.json, hooks, environment variables, permissions, MCP servers, memory rules, skills, subagents, plugins, and plugin marketplaces. Use this when the user wants to view, update, or learn how to configure Wave.
4
4
  ---
5
5
 
6
6
  # Wave Settings Skill
@@ -23,7 +23,7 @@ Wave looks for `settings.json` in three scopes:
23
23
  ## Common Settings
24
24
 
25
25
  ### 1. Hooks
26
- Hooks allow you to automate tasks when certain events occur (e.g., `WorktreeCreate`, `TaskStart`).
26
+ Hooks allow you to automate tasks when certain events occur (e.g., `PreToolUse`, `PostToolUse`, `SessionStart`, `SessionEnd`).
27
27
  For detailed hook configuration, see [HOOKS.md](${WAVE_SKILL_DIR}/HOOKS.md).
28
28
 
29
29
  ### 2. Environment Variables
@@ -92,7 +92,9 @@ Delegate tasks to specialized AI personalities.
92
92
  For detailed guidance on creating subagents, see [SUBAGENTS.md](${WAVE_SKILL_DIR}/SUBAGENTS.md).
93
93
 
94
94
  ### 9. Plugins
95
- Enable or disable plugins via `enabledPlugins`. Plugin skills, hooks, MCP servers, and LSP servers can reference their parent plugin's directory using the `${WAVE_PLUGIN_ROOT}` placeholder. Wave substitutes `${WAVE_PLUGIN_ROOT}` with the plugin's directory path at load time (same as `${WAVE_SKILL_DIR}`), and also injects `WAVE_PLUGIN_ROOT` as an environment variable into the spawned process.
95
+
96
+ Plugins bundle skills, hooks, MCP servers, LSP servers, and commands into a reusable package. You can install plugins locally or from a marketplace.
97
+ For detailed guidance on creating plugins and marketplaces, see [PLUGINS.md](${WAVE_SKILL_DIR}/PLUGINS.md).
96
98
 
97
99
  ### 10. Other Settings
98
100
  - `language`: Preferred language for agent communication (e.g., `"en"`, `"zh"`).
@@ -112,5 +114,8 @@ You can ask me to:
112
114
  - "How do I define a new subagent?"
113
115
  - "How do I set max input tokens?"
114
116
  - "How do I change the model?"
117
+ - "How do I create a Wave plugin?"
118
+ - "How do I set up a plugin marketplace?"
119
+ - "How do I install a plugin from a marketplace?"
115
120
 
116
121
  I will guide you through the process and ensure your configuration is valid.
package/dist/agent.d.ts CHANGED
@@ -79,8 +79,8 @@ export declare class Agent {
79
79
  getCombinedMemory(): Promise<string>;
80
80
  /** Get AI loading status */
81
81
  get isLoading(): boolean;
82
- /** Get message compression status */
83
- get isCompressing(): boolean;
82
+ /** Get message compaction status */
83
+ get isCompacting(): boolean;
84
84
  /** Get bash command execution status */
85
85
  get isCommandRunning(): boolean;
86
86
  /** Get queued messages */
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAYA,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAO9E,OAAO,EACL,YAAY,EACZ,kBAAkB,EAElB,YAAY,EACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,OAAO,EAEP,eAAe,EACf,aAAa,EACb,WAAW,EACX,KAAK,EACL,cAAc,EAC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;IACI,mBAAmB,CACxB,UAAU,EAAE,MAAM,GACjB,OAAO,+BAA+B,EAAE,gBAAgB,GAAG,IAAI;IAIlE;;OAEG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;CACF"}
package/dist/agent.js CHANGED
@@ -203,9 +203,9 @@ export class Agent {
203
203
  get isLoading() {
204
204
  return this.aiManager.isLoading;
205
205
  }
206
- /** Get message compression status */
207
- get isCompressing() {
208
- return this.aiManager.getIsCompressing();
206
+ /** Get message compaction status */
207
+ get isCompacting() {
208
+ return this.aiManager.getIsCompacting();
209
209
  }
210
210
  /** Get bash command execution status */
211
211
  get isCommandRunning() {
@@ -461,6 +461,15 @@ export class Agent {
461
461
  await Promise.allSettled(this.pendingNotificationPromises);
462
462
  this.pendingNotificationPromises = [];
463
463
  }
464
+ // Fire SessionEnd hooks (fire-and-forget, don't block shutdown)
465
+ try {
466
+ const sessionId = this.messageManager.getSessionId();
467
+ const transcriptPath = this.messageManager.getTranscriptPath();
468
+ await this.hookManager.executeSessionEndHooks("stop", sessionId, transcriptPath);
469
+ }
470
+ catch (error) {
471
+ this.logger?.warn(`SessionEnd hooks failed: ${error.message}`);
472
+ }
464
473
  await this.messageManager.saveSession();
465
474
  this.abortAIMessage(); // This will abort tools including Agent tool (subagents)
466
475
  this.abortBashCommand();
@@ -49,11 +49,11 @@ export declare class PluginCore {
49
49
  /**
50
50
  * Adds a new marketplace
51
51
  */
52
- addMarketplace(input: string): Promise<KnownMarketplace>;
52
+ addMarketplace(input: string, scope?: Scope): Promise<KnownMarketplace>;
53
53
  /**
54
54
  * Removes a marketplace by name
55
55
  */
56
- removeMarketplace(name: string): Promise<void>;
56
+ removeMarketplace(name: string, scope?: Scope): Promise<void>;
57
57
  /**
58
58
  * Updates a specific marketplace or all marketplaces
59
59
  */
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/core/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,EACL,eAAe,E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;IACH,kBAAkB,CAAC,WAAW,EAAE,gBAAgB,GAAG,MAAM;IAIzD;;OAEG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI;IAI/C;;OAEG;IACG,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAOzE"}
@@ -14,7 +14,7 @@ export class PluginCore {
14
14
  this.workdir = workdir;
15
15
  this.container = new Container();
16
16
  this.configurationService = new ConfigurationService();
17
- this.marketplaceService = new MarketplaceService();
17
+ this.marketplaceService = new MarketplaceService(this.workdir, this.configurationService);
18
18
  // Wire up ConfigurationService in the container for PluginManager to use
19
19
  this.container.register("ConfigurationService", this.configurationService);
20
20
  this.pluginManager = new PluginManager(this.container, {
@@ -83,7 +83,7 @@ export class PluginCore {
83
83
  const allMarketplacePlugins = [];
84
84
  for (const m of marketplaces) {
85
85
  try {
86
- const manifest = await this.marketplaceService.loadMarketplaceManifest(this.marketplaceService.getMarketplacePath(m));
86
+ const manifest = await this.marketplaceService.loadMarketplaceManifest(this.marketplaceService.getMarketplacePath(m.source));
87
87
  manifest.plugins.forEach((p) => {
88
88
  const pluginId = `${p.name}@${m.name}`;
89
89
  const installed = installedPlugins.plugins.find((ip) => ip.name === p.name && ip.marketplace === m.name);
@@ -110,14 +110,14 @@ export class PluginCore {
110
110
  /**
111
111
  * Adds a new marketplace
112
112
  */
113
- async addMarketplace(input) {
114
- return await this.marketplaceService.addMarketplace(input);
113
+ async addMarketplace(input, scope = "user") {
114
+ return await this.marketplaceService.addMarketplace(input, scope);
115
115
  }
116
116
  /**
117
117
  * Removes a marketplace by name
118
118
  */
119
- async removeMarketplace(name) {
120
- await this.marketplaceService.removeMarketplace(name);
119
+ async removeMarketplace(name, scope) {
120
+ await this.marketplaceService.removeMarketplace(name, scope);
121
121
  }
122
122
  /**
123
123
  * Updates a specific marketplace or all marketplaces
@@ -153,7 +153,7 @@ export class PluginCore {
153
153
  * Resolves the local path for a marketplace
154
154
  */
155
155
  getMarketplacePath(marketplace) {
156
- return this.marketplaceService.getMarketplacePath(marketplace);
156
+ return this.marketplaceService.getMarketplacePath(marketplace.source);
157
157
  }
158
158
  /**
159
159
  * Finds the scope where a plugin is currently enabled/disabled
@@ -1,7 +1,7 @@
1
1
  import type { GatewayConfig, ModelConfig, Usage } from "../types/index.js";
2
2
  import { Container } from "../utils/container.js";
3
3
  export interface AIManagerCallbacks {
4
- onCompressionStateChange?: (isCompressing: boolean) => void;
4
+ onCompactionStateChange?: (isCompacting: boolean) => void;
5
5
  onUsageAdded?: (usage: Usage) => void;
6
6
  onCwdChange?: (newCwd: string) => void;
7
7
  }
@@ -28,7 +28,7 @@ export declare class AIManager {
28
28
  private stream;
29
29
  private modelOverride?;
30
30
  private _onCwdChange?;
31
- private consecutiveCompressionFailures;
31
+ private consecutiveCompactionFailures;
32
32
  constructor(container: Container, options: AIManagerOptions);
33
33
  private get toolManager();
34
34
  private get messageManager();
@@ -47,7 +47,7 @@ export declare class AIManager {
47
47
  getWorkdir(): string;
48
48
  getOriginalWorkdir(): string;
49
49
  setOnCwdChange(callback: (newCwd: string) => void): void;
50
- private isCompressing;
50
+ private isCompacting;
51
51
  private callbacks;
52
52
  /**
53
53
  * Get filtered tool configuration based on tools list
@@ -56,9 +56,9 @@ export declare class AIManager {
56
56
  setIsLoading(isLoading: boolean): void;
57
57
  abortAIMessage(): void;
58
58
  private generateCompactParams;
59
- private handleTokenUsageAndCompression;
60
- getIsCompressing(): boolean;
61
- setIsCompressing(isCompressing: boolean): void;
59
+ private handleTokenUsageAndCompaction;
60
+ getIsCompacting(): boolean;
61
+ setIsCompacting(isCompacting: boolean): void;
62
62
  private get subagentManager();
63
63
  private get skillManager();
64
64
  sendAIMessage(options?: {
@@ -1 +1 @@
1
- {"version":3,"file":"aiManager.d.ts","sourceRoot":"","sources":["../../src/managers/aiManager.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,a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