wave-agent-sdk 0.9.3 → 0.9.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/core/plugin.d.ts +4 -0
- package/dist/core/plugin.d.ts.map +1 -1
- package/dist/core/plugin.js +6 -0
- package/dist/managers/permissionManager.d.ts.map +1 -1
- package/dist/managers/permissionManager.js +13 -1
- package/dist/managers/pluginManager.d.ts.map +1 -1
- package/dist/managers/pluginManager.js +4 -0
- package/dist/managers/skillManager.d.ts.map +1 -1
- package/dist/managers/skillManager.js +3 -1
- package/dist/managers/slashCommandManager.d.ts.map +1 -1
- package/dist/managers/slashCommandManager.js +0 -8
- package/dist/services/GitService.d.ts.map +1 -1
- package/dist/services/GitService.js +6 -0
- package/dist/services/MarketplaceService.d.ts +11 -1
- package/dist/services/MarketplaceService.d.ts.map +1 -1
- package/dist/services/MarketplaceService.js +68 -3
- package/dist/services/pluginLoader.d.ts.map +1 -1
- package/dist/services/pluginLoader.js +1 -6
- package/dist/types/commands.d.ts +0 -1
- package/dist/types/commands.d.ts.map +1 -1
- package/dist/types/marketplace.d.ts +1 -0
- package/dist/types/marketplace.d.ts.map +1 -1
- package/dist/utils/bashParser.d.ts.map +1 -1
- package/dist/utils/bashParser.js +7 -0
- package/package.json +1 -1
- package/src/core/plugin.ts +7 -0
- package/src/managers/permissionManager.ts +13 -1
- package/src/managers/pluginManager.ts +6 -0
- package/src/managers/skillManager.ts +4 -1
- package/src/managers/slashCommandManager.ts +0 -16
- package/src/services/GitService.ts +10 -0
- package/src/services/MarketplaceService.ts +95 -3
- package/src/services/pluginLoader.ts +1 -7
- package/src/types/commands.ts +0 -3
- package/src/types/marketplace.ts +1 -0
- package/src/utils/bashParser.ts +7 -0
package/dist/core/plugin.d.ts
CHANGED
|
@@ -35,6 +35,10 @@ export declare class PluginCore {
|
|
|
35
35
|
* Updates an installed plugin to the latest version from its marketplace
|
|
36
36
|
*/
|
|
37
37
|
updatePlugin(pluginId: string): Promise<InstalledPlugin>;
|
|
38
|
+
/**
|
|
39
|
+
* Toggles auto-update for a marketplace
|
|
40
|
+
*/
|
|
41
|
+
toggleAutoUpdate(name: string, enabled: boolean): Promise<void>;
|
|
38
42
|
/**
|
|
39
43
|
* Lists all plugins from all registered marketplaces with their installation and enabled status
|
|
40
44
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/core/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAE3B;;;;;GAKG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,OAAO,CAAS;gBAEZ,OAAO,GAAE,MAAsB;IAoB3C;;OAEG;IACG,aAAa,CACjB,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,KAAK,GACZ,OAAO,CAAC,eAAe,CAAC;IAS3B;;OAEG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKtD;;;OAGG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAMnE;;;OAGG;IACG,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAMpE;;OAEG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAI9D;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC;Q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AI,OAAO,CAAC,wBAAwB,CAAC;IAI9D;;OAEG;IACH,uBAAuB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAIlD;;OAEG;IACG,uBAAuB,CAC3B,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,mBAAmB,CAAC;IAM/B;;OAEG;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"}
|
package/dist/core/plugin.js
CHANGED
|
@@ -67,6 +67,12 @@ export class PluginCore {
|
|
|
67
67
|
async updatePlugin(pluginId) {
|
|
68
68
|
return await this.marketplaceService.updatePlugin(pluginId);
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Toggles auto-update for a marketplace
|
|
72
|
+
*/
|
|
73
|
+
async toggleAutoUpdate(name, enabled) {
|
|
74
|
+
await this.marketplaceService.toggleAutoUpdate(name, enabled);
|
|
75
|
+
}
|
|
70
76
|
/**
|
|
71
77
|
* Lists all plugins from all registered marketplaces with their installation and enabled status
|
|
72
78
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissionManager.d.ts","sourceRoot":"","sources":["../../src/managers/permissionManager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAgBhD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"permissionManager.d.ts","sourceRoot":"","sources":["../../src/managers/permissionManager.ts"],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AE,cAAc,EAC9B,QAAQ,CAAC,EAAE,kBAAkB,EAC7B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,qBAAqB;IAgFxB;;OAEG;IACH,OAAO,CAAC,WAAW;IA0EnB;;OAEG;IACH,OAAO,CAAC,eAAe;IAiGvB;;;;;;;OAOG;IACI,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE;IAmFjE;;;OAGG;IACU,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CA4C5D"}
|
|
@@ -17,7 +17,18 @@ const DEFAULT_ALLOWED_RULES = [
|
|
|
17
17
|
"Bash(git diff*)",
|
|
18
18
|
"Bash(git log*)",
|
|
19
19
|
"Bash(git show*)",
|
|
20
|
-
"Bash(git branch
|
|
20
|
+
"Bash(git branch)",
|
|
21
|
+
"Bash(git branch --list*)",
|
|
22
|
+
"Bash(git branch -a*)",
|
|
23
|
+
"Bash(git branch -r*)",
|
|
24
|
+
"Bash(git branch --show-current*)",
|
|
25
|
+
"Bash(git branch --merged*)",
|
|
26
|
+
"Bash(git branch --no-merged*)",
|
|
27
|
+
"Bash(git branch --contains*)",
|
|
28
|
+
"Bash(git branch --no-contains*)",
|
|
29
|
+
"Bash(git branch --verbose*)",
|
|
30
|
+
"Bash(git branch -v*)",
|
|
31
|
+
"Bash(git branch -vv*)",
|
|
21
32
|
"Bash(git tag*)",
|
|
22
33
|
"Bash(git remote*)",
|
|
23
34
|
"Bash(git ls-files*)",
|
|
@@ -27,6 +38,7 @@ const DEFAULT_ALLOWED_RULES = [
|
|
|
27
38
|
"Bash(git cat-file*)",
|
|
28
39
|
"Bash(git count-objects*)",
|
|
29
40
|
"Bash(echo*)",
|
|
41
|
+
"Bash(ls*)",
|
|
30
42
|
"Bash(which*)",
|
|
31
43
|
"Bash(type*)",
|
|
32
44
|
"Bash(hostname*)",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pluginManager.d.ts","sourceRoot":"","sources":["../../src/managers/pluginManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAUzD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAED,qBAAa,aAAa;IAMtB,OAAO,CAAC,SAAS;IALnB,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,cAAc,CAA0B;gBAGtC,SAAS,EAAE,SAAS,EAC5B,OAAO,EAAE,oBAAoB;IAM/B,OAAO,KAAK,YAAY,GAEvB;IAED,OAAO,KAAK,WAAW,GAEtB;IAED,OAAO,KAAK,UAAU,GAErB;IAED,OAAO,KAAK,UAAU,GAErB;IAED,OAAO,KAAK,mBAAmB,GAE9B;IAED,OAAO,KAAK,oBAAoB,GAE/B;IAED;;OAEG;IACH,oBAAoB,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAInE;;OAEG;YACW,oBAAoB;
|
|
1
|
+
{"version":3,"file":"pluginManager.d.ts","sourceRoot":"","sources":["../../src/managers/pluginManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAUzD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAED,qBAAa,aAAa;IAMtB,OAAO,CAAC,SAAS;IALnB,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,cAAc,CAA0B;gBAGtC,SAAS,EAAE,SAAS,EAC5B,OAAO,EAAE,oBAAoB;IAM/B,OAAO,KAAK,YAAY,GAEvB;IAED,OAAO,KAAK,WAAW,GAEtB;IAED,OAAO,KAAK,UAAU,GAErB;IAED,OAAO,KAAK,UAAU,GAErB;IAED,OAAO,KAAK,mBAAmB,GAE9B;IAED,OAAO,KAAK,oBAAoB,GAE/B;IAED;;OAEG;IACH,oBAAoB,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAInE;;OAEG;YACW,oBAAoB;IAqElC;;OAEG;YACW,gBAAgB;IAyD9B;;;OAGG;IACG,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBzD;;OAEG;IACH,UAAU,IAAI,MAAM,EAAE;IAItB;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAG5C"}
|
|
@@ -43,6 +43,10 @@ export class PluginManager {
|
|
|
43
43
|
this.enabledPlugins = this.configurationService.getMergedEnabledPlugins(this.workdir);
|
|
44
44
|
}
|
|
45
45
|
const marketplaceService = new MarketplaceService();
|
|
46
|
+
// Trigger auto-update for marketplaces
|
|
47
|
+
if (!process.env.VITEST) {
|
|
48
|
+
await marketplaceService.autoUpdateAll();
|
|
49
|
+
}
|
|
46
50
|
let installedRegistry = await marketplaceService.getInstalledPlugins();
|
|
47
51
|
const knownMarketplaces = await marketplaceService.listMarketplaces();
|
|
48
52
|
// Identify missing enabled plugins and auto-install them if marketplace is known
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skillManager.d.ts","sourceRoot":"","sources":["../../src/managers/skillManager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EACb,KAAK,EAGL,aAAa,EACb,sBAAs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C;AAGlD;;GAEG;AACH,qBAAa,YAAY;IAUrB,OAAO,CAAC,SAAS;IATnB,OAAO,CAAC,kBAAkB,CAAS;IACnC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,OAAO,CAAS;IAExB,OAAO,CAAC,aAAa,CAAoC;IACzD,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,WAAW,CAAS;gBAGlB,SAAS,EAAE,SAAS,EAC5B,OAAO,GAAE,mBAAwB;IAQnC;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAoCjC;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,kBAAkB,IAAI,aAAa,EAAE;IAQrC;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAQzD;;;OAGG;IACG,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAgBzD;;OAEG;YACW,cAAc;IAkB5B;;OAEG;YACW,uBAAuB;IA8ErC;;OAEG;YACW,oBAAoB;IAkBlC;;OAEG;IACG,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC;QAC/C,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,sBAAsB,CAAC;QACjC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;KACzB,CAAC;IA4CF;;OAEG;YACW,mBAAmB;IA4BjC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAc7B;;OAEG;IACH,oBAAoB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI;CAqB5C"}
|
|
@@ -239,7 +239,9 @@ export class SkillManager {
|
|
|
239
239
|
let mainContent = contentMatch ? contentMatch[1].trim() : skill.content;
|
|
240
240
|
// 1. Substitute parameters ($1, $ARGUMENTS, etc.)
|
|
241
241
|
mainContent = substituteCommandParameters(mainContent, argsString);
|
|
242
|
-
// 2.
|
|
242
|
+
// 2. Substitute ${WAVE_SKILL_DIR} with the skill's directory path
|
|
243
|
+
mainContent = mainContent.replace(/\$\{WAVE_SKILL_DIR\}/g, skill.skillPath);
|
|
244
|
+
// 3. Parse and execute bash commands (!`command`)
|
|
243
245
|
const { commands } = parseBashCommands(mainContent);
|
|
244
246
|
if (commands.length > 0) {
|
|
245
247
|
const results = await executeBashCommands(commands, this.workdir);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slashCommandManager.d.ts","sourceRoot":"","sources":["../../src/managers/slashCommandManager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAQ1E,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAQlD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIxD,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,mBAAmB;IAO5B,OAAO,CAAC,SAAS;IANnB,OAAO,CAAC,QAAQ,CAAmC;IACnD,OAAO,CAAC,cAAc,CAAyC;IAC/D,OAAO,CAAC,eAAe,CAAqB;IAC5C,OAAO,CAAC,OAAO,CAAS;gBAGd,SAAS,EAAE,SAAS,EAC5B,OAAO,EAAE,0BAA0B;IAK9B,UAAU,IAAI,IAAI;IAKzB,OAAO,KAAK,cAAc,GAEzB;IAED,OAAO,KAAK,SAAS,GAEpB;IAED,OAAO,KAAK,qBAAqB,GAEhC;IAED,OAAO,KAAK,WAAW,GAEtB;IAED,OAAO,KAAK,YAAY,GAEvB;IAED,OAAO,CAAC,yBAAyB;IAoBjC;;OAEG;IACH,OAAO,CAAC,kBAAkB;
|
|
1
|
+
{"version":3,"file":"slashCommandManager.d.ts","sourceRoot":"","sources":["../../src/managers/slashCommandManager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAA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AAC,KAAK,EAAE,MAAM,GAAG;QAClD,OAAO,EAAE,OAAO,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;IAeD;;OAEG;IACI,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAI7C;;OAEG;IACI,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAI1E;;OAEG;IACI,iBAAiB,IAAI,kBAAkB,EAAE;IAIhD;;OAEG;YACW,+BAA+B;IAiD7C;;OAEG;IACI,mBAAmB,IAAI,IAAI;CAInC"}
|
|
@@ -66,10 +66,6 @@ export class SlashCommandManager {
|
|
|
66
66
|
handler: async (args) => {
|
|
67
67
|
// Substitute parameters in the command content
|
|
68
68
|
let processedContent = command.content;
|
|
69
|
-
// Substitute $WAVE_PLUGIN_ROOT placeholder for plugin commands
|
|
70
|
-
if (command.pluginPath) {
|
|
71
|
-
processedContent = processedContent.replace(/\$WAVE_PLUGIN_ROOT/g, command.pluginPath);
|
|
72
|
-
}
|
|
73
69
|
if (args) {
|
|
74
70
|
processedContent = substituteCommandParameters(processedContent, args);
|
|
75
71
|
}
|
|
@@ -150,10 +146,6 @@ export class SlashCommandManager {
|
|
|
150
146
|
handler: async (args) => {
|
|
151
147
|
// Substitute parameters in the command content
|
|
152
148
|
let processedContent = command.content;
|
|
153
|
-
// Substitute $WAVE_PLUGIN_ROOT placeholder for plugin commands
|
|
154
|
-
if (command.pluginPath) {
|
|
155
|
-
processedContent = processedContent.replace(/\$WAVE_PLUGIN_ROOT/g, command.pluginPath);
|
|
156
|
-
}
|
|
157
149
|
if (args) {
|
|
158
150
|
processedContent = substituteCommandParameters(processedContent, args);
|
|
159
151
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitService.d.ts","sourceRoot":"","sources":["../../src/services/GitService.ts"],"names":[],"mappings":"AAKA,qBAAa,UAAU;IACrB;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IASxC;;OAEG;IACG,KAAK,CACT,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"GitService.d.ts","sourceRoot":"","sources":["../../src/services/GitService.ts"],"names":[],"mappings":"AAKA,qBAAa,UAAU;IACrB;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IASxC;;OAEG;IACG,KAAK,CACT,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC;IAiChB;;OAEG;IACG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB7C,OAAO,CAAC,cAAc;CA6BvB"}
|
|
@@ -18,6 +18,9 @@ export class GitService {
|
|
|
18
18
|
* Clones a Git repository to a local path
|
|
19
19
|
*/
|
|
20
20
|
async clone(urlOrRepo, targetPath, ref) {
|
|
21
|
+
if (process.env.VITEST && !process.env.ALLOW_REAL_GIT) {
|
|
22
|
+
throw new Error(`Real git clone is disabled in tests. URL: ${urlOrRepo}, Path: ${targetPath}`);
|
|
23
|
+
}
|
|
21
24
|
if (!(await this.isGitAvailable())) {
|
|
22
25
|
throw new Error("Git is not installed or not found in PATH. Please install Git to use Git/GitHub marketplaces.");
|
|
23
26
|
}
|
|
@@ -43,6 +46,9 @@ export class GitService {
|
|
|
43
46
|
* Pulls the latest changes in a local repository
|
|
44
47
|
*/
|
|
45
48
|
async pull(targetPath) {
|
|
49
|
+
if (process.env.VITEST && !process.env.ALLOW_REAL_GIT) {
|
|
50
|
+
throw new Error(`Real git pull is disabled in tests. Path: ${targetPath}`);
|
|
51
|
+
}
|
|
46
52
|
if (!(await this.isGitAvailable())) {
|
|
47
53
|
throw new Error("Git is not installed or not found in PATH. Please install Git to use Git/GitHub marketplaces.");
|
|
48
54
|
}
|
|
@@ -58,7 +58,17 @@ export declare class MarketplaceService {
|
|
|
58
58
|
/**
|
|
59
59
|
* Updates a specific marketplace or all marketplaces
|
|
60
60
|
*/
|
|
61
|
-
updateMarketplace(name?: string
|
|
61
|
+
updateMarketplace(name?: string, options?: {
|
|
62
|
+
updatePlugins?: boolean;
|
|
63
|
+
}): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Automatically updates all marketplaces that have auto-update enabled
|
|
66
|
+
*/
|
|
67
|
+
autoUpdateAll(): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Toggles auto-update for a marketplace
|
|
70
|
+
*/
|
|
71
|
+
toggleAutoUpdate(name: string, enabled: boolean): Promise<void>;
|
|
62
72
|
/**
|
|
63
73
|
* Installs a plugin from a marketplace
|
|
64
74
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarketplaceService.d.ts","sourceRoot":"","sources":["../../src/services/MarketplaceService.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AAGjC;;;;;GAKG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,qBAAqB,CAAS;IACtC,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"MarketplaceService.d.ts","sourceRoot":"","sources":["../../src/services/MarketplaceService.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,eAAe,EACf,wBAAwB,EACxB,mBAA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;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBpC;;OAEG;IACG,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAUrE;;OAEG;IACG,aAAa,CACjB,mBAAmB,EAAE,MAAM,EAC3B,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,eAAe,CAAC;IA0H3B;;OAEG;IACG,eAAe,CACnB,mBAAmB,EAAE,MAAM,EAC3B,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC;IAqChB;;OAEG;IACG,YAAY,CAAC,mBAAmB,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;CAI1E"}
|
|
@@ -172,6 +172,7 @@ export class MarketplaceService {
|
|
|
172
172
|
source: isFullUrl
|
|
173
173
|
? { source: "git", url: urlOrRepo, ref }
|
|
174
174
|
: { source: "github", repo: urlOrRepo, ref },
|
|
175
|
+
autoUpdate: false,
|
|
175
176
|
};
|
|
176
177
|
}
|
|
177
178
|
else {
|
|
@@ -187,6 +188,7 @@ export class MarketplaceService {
|
|
|
187
188
|
marketplace = {
|
|
188
189
|
name: manifest.name,
|
|
189
190
|
source: { source: "directory", path: absolutePath },
|
|
191
|
+
autoUpdate: false,
|
|
190
192
|
};
|
|
191
193
|
}
|
|
192
194
|
const registry = await this.getKnownMarketplaces();
|
|
@@ -229,7 +231,7 @@ export class MarketplaceService {
|
|
|
229
231
|
/**
|
|
230
232
|
* Updates a specific marketplace or all marketplaces
|
|
231
233
|
*/
|
|
232
|
-
async updateMarketplace(name) {
|
|
234
|
+
async updateMarketplace(name, options) {
|
|
233
235
|
const registry = await this.getKnownMarketplaces();
|
|
234
236
|
const toUpdate = name
|
|
235
237
|
? registry.marketplaces.filter((m) => m.name === name)
|
|
@@ -248,10 +250,45 @@ export class MarketplaceService {
|
|
|
248
250
|
continue;
|
|
249
251
|
}
|
|
250
252
|
const targetPath = this.getMarketplacePath(marketplace);
|
|
251
|
-
|
|
253
|
+
if (existsSync(targetPath)) {
|
|
254
|
+
await this.gitService.pull(targetPath);
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
let url;
|
|
258
|
+
if (marketplace.source.source === "github") {
|
|
259
|
+
url = marketplace.source.repo;
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
url = marketplace.source.url;
|
|
263
|
+
}
|
|
264
|
+
await this.gitService.clone(url, targetPath, marketplace.source.ref);
|
|
265
|
+
}
|
|
252
266
|
}
|
|
253
267
|
// For directory source, we just re-validate the manifest
|
|
254
|
-
await this.loadMarketplaceManifest(this.getMarketplacePath(marketplace));
|
|
268
|
+
const manifest = await this.loadMarketplaceManifest(this.getMarketplacePath(marketplace));
|
|
269
|
+
if (options?.updatePlugins) {
|
|
270
|
+
const installedRegistry = await this.getInstalledPlugins();
|
|
271
|
+
const pluginsToUpdate = installedRegistry.plugins.filter((p) => p.marketplace === marketplace.name);
|
|
272
|
+
for (const plugin of pluginsToUpdate) {
|
|
273
|
+
const pluginEntry = manifest.plugins.find((p) => p.name === plugin.name);
|
|
274
|
+
if (!pluginEntry) {
|
|
275
|
+
console.warn(`Plugin "${plugin.name}" no longer found in marketplace "${marketplace.name}". Uninstalling...`);
|
|
276
|
+
try {
|
|
277
|
+
await this.uninstallPlugin(`${plugin.name}@${plugin.marketplace}`, plugin.projectPath);
|
|
278
|
+
}
|
|
279
|
+
catch (error) {
|
|
280
|
+
console.error(`Failed to uninstall orphaned plugin "${plugin.name}" from marketplace "${marketplace.name}":`, error);
|
|
281
|
+
}
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
try {
|
|
285
|
+
await this.installPlugin(`${plugin.name}@${plugin.marketplace}`, plugin.projectPath);
|
|
286
|
+
}
|
|
287
|
+
catch (error) {
|
|
288
|
+
console.error(`Failed to update plugin "${plugin.name}" from marketplace "${marketplace.name}":`, error);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
255
292
|
}
|
|
256
293
|
catch (error) {
|
|
257
294
|
const msg = `Failed to update marketplace "${marketplace.name}": ${error instanceof Error ? error.message : String(error)}`;
|
|
@@ -263,6 +300,33 @@ export class MarketplaceService {
|
|
|
263
300
|
throw new Error(`Some marketplaces failed to update:\n${errors.join("\n")}`);
|
|
264
301
|
}
|
|
265
302
|
}
|
|
303
|
+
/**
|
|
304
|
+
* Automatically updates all marketplaces that have auto-update enabled
|
|
305
|
+
*/
|
|
306
|
+
async autoUpdateAll() {
|
|
307
|
+
const registry = await this.getKnownMarketplaces();
|
|
308
|
+
const toAutoUpdate = registry.marketplaces.filter((m) => m.autoUpdate);
|
|
309
|
+
for (const marketplace of toAutoUpdate) {
|
|
310
|
+
try {
|
|
311
|
+
await this.updateMarketplace(marketplace.name, { updatePlugins: true });
|
|
312
|
+
}
|
|
313
|
+
catch (error) {
|
|
314
|
+
console.error(`Auto-update failed for marketplace "${marketplace.name}":`, error);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Toggles auto-update for a marketplace
|
|
320
|
+
*/
|
|
321
|
+
async toggleAutoUpdate(name, enabled) {
|
|
322
|
+
const registry = await this.getKnownMarketplaces();
|
|
323
|
+
const marketplace = registry.marketplaces.find((m) => m.name === name);
|
|
324
|
+
if (!marketplace) {
|
|
325
|
+
throw new Error(`Marketplace ${name} not found`);
|
|
326
|
+
}
|
|
327
|
+
marketplace.autoUpdate = enabled;
|
|
328
|
+
await this.saveKnownMarketplaces(registry);
|
|
329
|
+
}
|
|
266
330
|
/**
|
|
267
331
|
* Installs a plugin from a marketplace
|
|
268
332
|
*/
|
|
@@ -398,4 +462,5 @@ MarketplaceService.BUILTIN_MARKETPLACE = {
|
|
|
398
462
|
source: "github",
|
|
399
463
|
repo: "netease-lcap/wave-plugins-official",
|
|
400
464
|
},
|
|
465
|
+
autoUpdate: true,
|
|
401
466
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pluginLoader.d.ts","sourceRoot":"","sources":["../../src/services/pluginLoader.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,SAAS,EACT,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAI3B,qBAAa,YAAY;IACvB;;;OAGG;WACU,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IA6CtE;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,EAAE;
|
|
1
|
+
{"version":3,"file":"pluginLoader.d.ts","sourceRoot":"","sources":["../../src/services/pluginLoader.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,SAAS,EACT,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAI3B,qBAAa,YAAY;IACvB;;;OAGG;WACU,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IA6CtE;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,EAAE;IAK7D;;;OAGG;WACU,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAsC7D;;OAEG;WACU,aAAa,CACxB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAUjC;;OAEG;WACU,aAAa,CACxB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAUjC;;OAEG;WACU,eAAe,CAC1B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC;IAUhD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;CAgBhC"}
|
|
@@ -45,12 +45,7 @@ export class PluginLoader {
|
|
|
45
45
|
*/
|
|
46
46
|
static loadCommands(pluginPath) {
|
|
47
47
|
const commandsPath = path.join(pluginPath, "commands");
|
|
48
|
-
|
|
49
|
-
// Attach plugin path to each command for WAVE_PLUGIN_ROOT support
|
|
50
|
-
return commands.map((command) => ({
|
|
51
|
-
...command,
|
|
52
|
-
pluginPath,
|
|
53
|
-
}));
|
|
48
|
+
return scanCommandsDirectory(commandsPath);
|
|
54
49
|
}
|
|
55
50
|
/**
|
|
56
51
|
* Load skills from a plugin's skills directory
|
package/dist/types/commands.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/types/commands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/types/commands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EA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,eAAO,MAAM,kBAAkB,UAa9B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"bashParser.d.ts","sourceRoot":"","sources":["../../src/utils/bashParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAmH1D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA2CpD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAuHzD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAsC7D;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,UAa9B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA8L7D"}
|
package/dist/utils/bashParser.js
CHANGED
|
@@ -424,6 +424,13 @@ export function getSmartPrefix(command) {
|
|
|
424
424
|
"stash",
|
|
425
425
|
];
|
|
426
426
|
if (safeGitSubcommands.includes(subCommand)) {
|
|
427
|
+
if (subCommand === "branch") {
|
|
428
|
+
// Check for destructive flags
|
|
429
|
+
const destructiveFlags = ["-d", "-D", "--delete"];
|
|
430
|
+
if (tokens.some((t) => destructiveFlags.includes(t))) {
|
|
431
|
+
return null;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
427
434
|
prefixParts.push(subCommand);
|
|
428
435
|
return prefixParts.join(" ");
|
|
429
436
|
}
|
package/package.json
CHANGED
package/src/core/plugin.ts
CHANGED
|
@@ -96,6 +96,13 @@ export class PluginCore {
|
|
|
96
96
|
return await this.marketplaceService.updatePlugin(pluginId);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Toggles auto-update for a marketplace
|
|
101
|
+
*/
|
|
102
|
+
async toggleAutoUpdate(name: string, enabled: boolean): Promise<void> {
|
|
103
|
+
await this.marketplaceService.toggleAutoUpdate(name, enabled);
|
|
104
|
+
}
|
|
105
|
+
|
|
99
106
|
/**
|
|
100
107
|
* Lists all plugins from all registered marketplaces with their installation and enabled status
|
|
101
108
|
*/
|
|
@@ -41,7 +41,18 @@ const DEFAULT_ALLOWED_RULES = [
|
|
|
41
41
|
"Bash(git diff*)",
|
|
42
42
|
"Bash(git log*)",
|
|
43
43
|
"Bash(git show*)",
|
|
44
|
-
"Bash(git branch
|
|
44
|
+
"Bash(git branch)",
|
|
45
|
+
"Bash(git branch --list*)",
|
|
46
|
+
"Bash(git branch -a*)",
|
|
47
|
+
"Bash(git branch -r*)",
|
|
48
|
+
"Bash(git branch --show-current*)",
|
|
49
|
+
"Bash(git branch --merged*)",
|
|
50
|
+
"Bash(git branch --no-merged*)",
|
|
51
|
+
"Bash(git branch --contains*)",
|
|
52
|
+
"Bash(git branch --no-contains*)",
|
|
53
|
+
"Bash(git branch --verbose*)",
|
|
54
|
+
"Bash(git branch -v*)",
|
|
55
|
+
"Bash(git branch -vv*)",
|
|
45
56
|
"Bash(git tag*)",
|
|
46
57
|
"Bash(git remote*)",
|
|
47
58
|
"Bash(git ls-files*)",
|
|
@@ -51,6 +62,7 @@ const DEFAULT_ALLOWED_RULES = [
|
|
|
51
62
|
"Bash(git cat-file*)",
|
|
52
63
|
"Bash(git count-objects*)",
|
|
53
64
|
"Bash(echo*)",
|
|
65
|
+
"Bash(ls*)",
|
|
54
66
|
"Bash(which*)",
|
|
55
67
|
"Bash(type*)",
|
|
56
68
|
"Bash(hostname*)",
|
|
@@ -73,6 +73,12 @@ export class PluginManager {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
const marketplaceService = new MarketplaceService();
|
|
76
|
+
|
|
77
|
+
// Trigger auto-update for marketplaces
|
|
78
|
+
if (!process.env.VITEST) {
|
|
79
|
+
await marketplaceService.autoUpdateAll();
|
|
80
|
+
}
|
|
81
|
+
|
|
76
82
|
let installedRegistry = await marketplaceService.getInstalledPlugins();
|
|
77
83
|
const knownMarketplaces = await marketplaceService.listMarketplaces();
|
|
78
84
|
|
|
@@ -323,7 +323,10 @@ export class SkillManager {
|
|
|
323
323
|
// 1. Substitute parameters ($1, $ARGUMENTS, etc.)
|
|
324
324
|
mainContent = substituteCommandParameters(mainContent, argsString);
|
|
325
325
|
|
|
326
|
-
// 2.
|
|
326
|
+
// 2. Substitute ${WAVE_SKILL_DIR} with the skill's directory path
|
|
327
|
+
mainContent = mainContent.replace(/\$\{WAVE_SKILL_DIR\}/g, skill.skillPath);
|
|
328
|
+
|
|
329
|
+
// 3. Parse and execute bash commands (!`command`)
|
|
327
330
|
const { commands } = parseBashCommands(mainContent);
|
|
328
331
|
if (commands.length > 0) {
|
|
329
332
|
const results = await executeBashCommands(commands, this.workdir);
|
|
@@ -108,14 +108,6 @@ export class SlashCommandManager {
|
|
|
108
108
|
// Substitute parameters in the command content
|
|
109
109
|
let processedContent = command.content;
|
|
110
110
|
|
|
111
|
-
// Substitute $WAVE_PLUGIN_ROOT placeholder for plugin commands
|
|
112
|
-
if (command.pluginPath) {
|
|
113
|
-
processedContent = processedContent.replace(
|
|
114
|
-
/\$WAVE_PLUGIN_ROOT/g,
|
|
115
|
-
command.pluginPath,
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
111
|
if (args) {
|
|
120
112
|
processedContent = substituteCommandParameters(
|
|
121
113
|
processedContent,
|
|
@@ -226,14 +218,6 @@ export class SlashCommandManager {
|
|
|
226
218
|
// Substitute parameters in the command content
|
|
227
219
|
let processedContent = command.content;
|
|
228
220
|
|
|
229
|
-
// Substitute $WAVE_PLUGIN_ROOT placeholder for plugin commands
|
|
230
|
-
if (command.pluginPath) {
|
|
231
|
-
processedContent = processedContent.replace(
|
|
232
|
-
/\$WAVE_PLUGIN_ROOT/g,
|
|
233
|
-
command.pluginPath,
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
221
|
if (args) {
|
|
238
222
|
processedContent = substituteCommandParameters(
|
|
239
223
|
processedContent,
|
|
@@ -24,6 +24,11 @@ export class GitService {
|
|
|
24
24
|
targetPath: string,
|
|
25
25
|
ref?: string,
|
|
26
26
|
): Promise<void> {
|
|
27
|
+
if (process.env.VITEST && !process.env.ALLOW_REAL_GIT) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
`Real git clone is disabled in tests. URL: ${urlOrRepo}, Path: ${targetPath}`,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
27
32
|
if (!(await this.isGitAvailable())) {
|
|
28
33
|
throw new Error(
|
|
29
34
|
"Git is not installed or not found in PATH. Please install Git to use Git/GitHub marketplaces.",
|
|
@@ -55,6 +60,11 @@ export class GitService {
|
|
|
55
60
|
* Pulls the latest changes in a local repository
|
|
56
61
|
*/
|
|
57
62
|
async pull(targetPath: string): Promise<void> {
|
|
63
|
+
if (process.env.VITEST && !process.env.ALLOW_REAL_GIT) {
|
|
64
|
+
throw new Error(
|
|
65
|
+
`Real git pull is disabled in tests. Path: ${targetPath}`,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
58
68
|
if (!(await this.isGitAvailable())) {
|
|
59
69
|
throw new Error(
|
|
60
70
|
"Git is not installed or not found in PATH. Please install Git to use Git/GitHub marketplaces.",
|
|
@@ -31,6 +31,7 @@ export class MarketplaceService {
|
|
|
31
31
|
source: "github",
|
|
32
32
|
repo: "netease-lcap/wave-plugins-official",
|
|
33
33
|
},
|
|
34
|
+
autoUpdate: true,
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
constructor() {
|
|
@@ -241,6 +242,7 @@ export class MarketplaceService {
|
|
|
241
242
|
source: isFullUrl
|
|
242
243
|
? { source: "git", url: urlOrRepo, ref }
|
|
243
244
|
: { source: "github", repo: urlOrRepo, ref },
|
|
245
|
+
autoUpdate: false,
|
|
244
246
|
};
|
|
245
247
|
} else {
|
|
246
248
|
// Local directory format
|
|
@@ -257,6 +259,7 @@ export class MarketplaceService {
|
|
|
257
259
|
marketplace = {
|
|
258
260
|
name: manifest.name,
|
|
259
261
|
source: { source: "directory", path: absolutePath },
|
|
262
|
+
autoUpdate: false,
|
|
260
263
|
};
|
|
261
264
|
}
|
|
262
265
|
|
|
@@ -311,7 +314,10 @@ export class MarketplaceService {
|
|
|
311
314
|
/**
|
|
312
315
|
* Updates a specific marketplace or all marketplaces
|
|
313
316
|
*/
|
|
314
|
-
async updateMarketplace(
|
|
317
|
+
async updateMarketplace(
|
|
318
|
+
name?: string,
|
|
319
|
+
options?: { updatePlugins?: boolean },
|
|
320
|
+
): Promise<void> {
|
|
315
321
|
const registry = await this.getKnownMarketplaces();
|
|
316
322
|
const toUpdate = name
|
|
317
323
|
? registry.marketplaces.filter((m) => m.name === name)
|
|
@@ -336,12 +342,66 @@ export class MarketplaceService {
|
|
|
336
342
|
continue;
|
|
337
343
|
}
|
|
338
344
|
const targetPath = this.getMarketplacePath(marketplace);
|
|
339
|
-
|
|
345
|
+
if (existsSync(targetPath)) {
|
|
346
|
+
await this.gitService.pull(targetPath);
|
|
347
|
+
} else {
|
|
348
|
+
let url: string;
|
|
349
|
+
if (marketplace.source.source === "github") {
|
|
350
|
+
url = marketplace.source.repo;
|
|
351
|
+
} else {
|
|
352
|
+
url = marketplace.source.url;
|
|
353
|
+
}
|
|
354
|
+
await this.gitService.clone(
|
|
355
|
+
url,
|
|
356
|
+
targetPath,
|
|
357
|
+
marketplace.source.ref,
|
|
358
|
+
);
|
|
359
|
+
}
|
|
340
360
|
}
|
|
341
361
|
// For directory source, we just re-validate the manifest
|
|
342
|
-
await this.loadMarketplaceManifest(
|
|
362
|
+
const manifest = await this.loadMarketplaceManifest(
|
|
343
363
|
this.getMarketplacePath(marketplace),
|
|
344
364
|
);
|
|
365
|
+
|
|
366
|
+
if (options?.updatePlugins) {
|
|
367
|
+
const installedRegistry = await this.getInstalledPlugins();
|
|
368
|
+
const pluginsToUpdate = installedRegistry.plugins.filter(
|
|
369
|
+
(p) => p.marketplace === marketplace.name,
|
|
370
|
+
);
|
|
371
|
+
for (const plugin of pluginsToUpdate) {
|
|
372
|
+
const pluginEntry = manifest.plugins.find(
|
|
373
|
+
(p) => p.name === plugin.name,
|
|
374
|
+
);
|
|
375
|
+
if (!pluginEntry) {
|
|
376
|
+
console.warn(
|
|
377
|
+
`Plugin "${plugin.name}" no longer found in marketplace "${marketplace.name}". Uninstalling...`,
|
|
378
|
+
);
|
|
379
|
+
try {
|
|
380
|
+
await this.uninstallPlugin(
|
|
381
|
+
`${plugin.name}@${plugin.marketplace}`,
|
|
382
|
+
plugin.projectPath,
|
|
383
|
+
);
|
|
384
|
+
} catch (error) {
|
|
385
|
+
console.error(
|
|
386
|
+
`Failed to uninstall orphaned plugin "${plugin.name}" from marketplace "${marketplace.name}":`,
|
|
387
|
+
error,
|
|
388
|
+
);
|
|
389
|
+
}
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
try {
|
|
393
|
+
await this.installPlugin(
|
|
394
|
+
`${plugin.name}@${plugin.marketplace}`,
|
|
395
|
+
plugin.projectPath,
|
|
396
|
+
);
|
|
397
|
+
} catch (error) {
|
|
398
|
+
console.error(
|
|
399
|
+
`Failed to update plugin "${plugin.name}" from marketplace "${marketplace.name}":`,
|
|
400
|
+
error,
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
345
405
|
} catch (error) {
|
|
346
406
|
const msg = `Failed to update marketplace "${marketplace.name}": ${error instanceof Error ? error.message : String(error)}`;
|
|
347
407
|
console.error(msg);
|
|
@@ -356,6 +416,38 @@ export class MarketplaceService {
|
|
|
356
416
|
}
|
|
357
417
|
}
|
|
358
418
|
|
|
419
|
+
/**
|
|
420
|
+
* Automatically updates all marketplaces that have auto-update enabled
|
|
421
|
+
*/
|
|
422
|
+
async autoUpdateAll(): Promise<void> {
|
|
423
|
+
const registry = await this.getKnownMarketplaces();
|
|
424
|
+
const toAutoUpdate = registry.marketplaces.filter((m) => m.autoUpdate);
|
|
425
|
+
|
|
426
|
+
for (const marketplace of toAutoUpdate) {
|
|
427
|
+
try {
|
|
428
|
+
await this.updateMarketplace(marketplace.name, { updatePlugins: true });
|
|
429
|
+
} catch (error) {
|
|
430
|
+
console.error(
|
|
431
|
+
`Auto-update failed for marketplace "${marketplace.name}":`,
|
|
432
|
+
error,
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Toggles auto-update for a marketplace
|
|
440
|
+
*/
|
|
441
|
+
async toggleAutoUpdate(name: string, enabled: boolean): Promise<void> {
|
|
442
|
+
const registry = await this.getKnownMarketplaces();
|
|
443
|
+
const marketplace = registry.marketplaces.find((m) => m.name === name);
|
|
444
|
+
if (!marketplace) {
|
|
445
|
+
throw new Error(`Marketplace ${name} not found`);
|
|
446
|
+
}
|
|
447
|
+
marketplace.autoUpdate = enabled;
|
|
448
|
+
await this.saveKnownMarketplaces(registry);
|
|
449
|
+
}
|
|
450
|
+
|
|
359
451
|
/**
|
|
360
452
|
* Installs a plugin from a marketplace
|
|
361
453
|
*/
|
|
@@ -67,13 +67,7 @@ export class PluginLoader {
|
|
|
67
67
|
*/
|
|
68
68
|
static loadCommands(pluginPath: string): CustomSlashCommand[] {
|
|
69
69
|
const commandsPath = path.join(pluginPath, "commands");
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
// Attach plugin path to each command for WAVE_PLUGIN_ROOT support
|
|
73
|
-
return commands.map((command) => ({
|
|
74
|
-
...command,
|
|
75
|
-
pluginPath,
|
|
76
|
-
}));
|
|
70
|
+
return scanCommandsDirectory(commandsPath);
|
|
77
71
|
}
|
|
78
72
|
|
|
79
73
|
/**
|
package/src/types/commands.ts
CHANGED
package/src/types/marketplace.ts
CHANGED
package/src/utils/bashParser.ts
CHANGED
|
@@ -470,6 +470,13 @@ export function getSmartPrefix(command: string): string | null {
|
|
|
470
470
|
];
|
|
471
471
|
|
|
472
472
|
if (safeGitSubcommands.includes(subCommand)) {
|
|
473
|
+
if (subCommand === "branch") {
|
|
474
|
+
// Check for destructive flags
|
|
475
|
+
const destructiveFlags = ["-d", "-D", "--delete"];
|
|
476
|
+
if (tokens.some((t) => destructiveFlags.includes(t))) {
|
|
477
|
+
return null;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
473
480
|
prefixParts.push(subCommand);
|
|
474
481
|
return prefixParts.join(" ");
|
|
475
482
|
}
|