@a1st/aix-core 0.5.1 → 0.7.0
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/README.md +1 -1
- package/dist/agents/parser.d.ts.map +1 -1
- package/dist/agents/parser.js +3 -2
- package/dist/agents/parser.js.map +1 -1
- package/dist/direct-install.d.ts +8 -1
- package/dist/direct-install.d.ts.map +1 -1
- package/dist/direct-install.js +48 -6
- package/dist/direct-install.js.map +1 -1
- package/dist/editors/adapters/antigravity.d.ts +32 -0
- package/dist/editors/adapters/antigravity.d.ts.map +1 -0
- package/dist/editors/adapters/antigravity.js +94 -0
- package/dist/editors/adapters/antigravity.js.map +1 -0
- package/dist/editors/adapters/base.d.ts +34 -3
- package/dist/editors/adapters/base.d.ts.map +1 -1
- package/dist/editors/adapters/base.js +195 -35
- package/dist/editors/adapters/base.js.map +1 -1
- package/dist/editors/adapters/claude-code.d.ts +3 -1
- package/dist/editors/adapters/claude-code.d.ts.map +1 -1
- package/dist/editors/adapters/claude-code.js +5 -3
- package/dist/editors/adapters/claude-code.js.map +1 -1
- package/dist/editors/adapters/codex.d.ts +3 -1
- package/dist/editors/adapters/codex.d.ts.map +1 -1
- package/dist/editors/adapters/codex.js +7 -5
- package/dist/editors/adapters/codex.js.map +1 -1
- package/dist/editors/adapters/copilot.d.ts +3 -1
- package/dist/editors/adapters/copilot.d.ts.map +1 -1
- package/dist/editors/adapters/copilot.js +13 -3
- package/dist/editors/adapters/copilot.js.map +1 -1
- package/dist/editors/adapters/cursor.d.ts +3 -1
- package/dist/editors/adapters/cursor.d.ts.map +1 -1
- package/dist/editors/adapters/cursor.js +5 -3
- package/dist/editors/adapters/cursor.js.map +1 -1
- package/dist/editors/adapters/grok.d.ts +33 -0
- package/dist/editors/adapters/grok.d.ts.map +1 -0
- package/dist/editors/adapters/grok.js +121 -0
- package/dist/editors/adapters/grok.js.map +1 -0
- package/dist/editors/adapters/index.d.ts +2 -1
- package/dist/editors/adapters/index.d.ts.map +1 -1
- package/dist/editors/adapters/index.js +2 -1
- package/dist/editors/adapters/index.js.map +1 -1
- package/dist/editors/adapters/opencode.d.ts +3 -1
- package/dist/editors/adapters/opencode.d.ts.map +1 -1
- package/dist/editors/adapters/opencode.js +7 -3
- package/dist/editors/adapters/opencode.js.map +1 -1
- package/dist/editors/adapters/windsurf.d.ts +5 -2
- package/dist/editors/adapters/windsurf.d.ts.map +1 -1
- package/dist/editors/adapters/windsurf.js +8 -5
- package/dist/editors/adapters/windsurf.js.map +1 -1
- package/dist/editors/adapters/zed.d.ts +3 -1
- package/dist/editors/adapters/zed.d.ts.map +1 -1
- package/dist/editors/adapters/zed.js +6 -4
- package/dist/editors/adapters/zed.js.map +1 -1
- package/dist/editors/import.d.ts +4 -5
- package/dist/editors/import.d.ts.map +1 -1
- package/dist/editors/import.js +6 -5
- package/dist/editors/import.js.map +1 -1
- package/dist/editors/index.d.ts +6 -5
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +4 -3
- package/dist/editors/index.js.map +1 -1
- package/dist/editors/install.d.ts +9 -4
- package/dist/editors/install.d.ts.map +1 -1
- package/dist/editors/install.js +27 -10
- package/dist/editors/install.js.map +1 -1
- package/dist/editors/remove.d.ts +51 -3
- package/dist/editors/remove.d.ts.map +1 -1
- package/dist/editors/remove.js +226 -6
- package/dist/editors/remove.js.map +1 -1
- package/dist/editors/section-managed-markdown.d.ts +1 -1
- package/dist/editors/section-managed-markdown.js +1 -1
- package/dist/editors/strategies/{gemini → antigravity}/hooks.d.ts +3 -3
- package/dist/editors/strategies/antigravity/hooks.d.ts.map +1 -0
- package/dist/editors/strategies/{gemini → antigravity}/hooks.js +25 -38
- package/dist/editors/strategies/antigravity/hooks.js.map +1 -0
- package/dist/editors/strategies/antigravity/index.d.ts +5 -0
- package/dist/editors/strategies/antigravity/index.d.ts.map +1 -0
- package/dist/editors/strategies/antigravity/index.js +5 -0
- package/dist/editors/strategies/antigravity/index.js.map +1 -0
- package/dist/editors/strategies/{gemini → antigravity}/mcp.d.ts +4 -4
- package/dist/editors/strategies/antigravity/mcp.d.ts.map +1 -0
- package/dist/editors/strategies/antigravity/mcp.js +49 -0
- package/dist/editors/strategies/antigravity/mcp.js.map +1 -0
- package/dist/editors/strategies/antigravity/prompts.d.ts +20 -0
- package/dist/editors/strategies/antigravity/prompts.d.ts.map +1 -0
- package/dist/editors/strategies/antigravity/prompts.js +42 -0
- package/dist/editors/strategies/antigravity/prompts.js.map +1 -0
- package/dist/editors/strategies/antigravity/rules.d.ts +19 -0
- package/dist/editors/strategies/antigravity/rules.d.ts.map +1 -0
- package/dist/editors/strategies/antigravity/rules.js +90 -0
- package/dist/editors/strategies/antigravity/rules.js.map +1 -0
- package/dist/editors/strategies/claude-code/hooks.d.ts.map +1 -1
- package/dist/editors/strategies/claude-code/hooks.js +9 -5
- package/dist/editors/strategies/claude-code/hooks.js.map +1 -1
- package/dist/editors/strategies/claude-code/index.d.ts +2 -0
- package/dist/editors/strategies/claude-code/index.d.ts.map +1 -1
- package/dist/editors/strategies/claude-code/index.js +2 -0
- package/dist/editors/strategies/claude-code/index.js.map +1 -1
- package/dist/editors/strategies/claude-code/marketplaces.d.ts +14 -0
- package/dist/editors/strategies/claude-code/marketplaces.d.ts.map +1 -0
- package/dist/editors/strategies/claude-code/marketplaces.js +71 -0
- package/dist/editors/strategies/claude-code/marketplaces.js.map +1 -0
- package/dist/editors/strategies/claude-code/mcp.d.ts.map +1 -1
- package/dist/editors/strategies/claude-code/mcp.js +3 -24
- package/dist/editors/strategies/claude-code/mcp.js.map +1 -1
- package/dist/editors/strategies/claude-code/plugins.d.ts +14 -0
- package/dist/editors/strategies/claude-code/plugins.d.ts.map +1 -0
- package/dist/editors/strategies/claude-code/plugins.js +37 -0
- package/dist/editors/strategies/claude-code/plugins.js.map +1 -0
- package/dist/editors/strategies/codex/hooks.d.ts.map +1 -1
- package/dist/editors/strategies/codex/hooks.js +44 -10
- package/dist/editors/strategies/codex/hooks.js.map +1 -1
- package/dist/editors/strategies/codex/mcp.d.ts.map +1 -1
- package/dist/editors/strategies/codex/mcp.js +123 -34
- package/dist/editors/strategies/codex/mcp.js.map +1 -1
- package/dist/editors/strategies/copilot/index.d.ts +2 -0
- package/dist/editors/strategies/copilot/index.d.ts.map +1 -1
- package/dist/editors/strategies/copilot/index.js +2 -0
- package/dist/editors/strategies/copilot/index.js.map +1 -1
- package/dist/editors/strategies/copilot/marketplaces.d.ts +15 -0
- package/dist/editors/strategies/copilot/marketplaces.d.ts.map +1 -0
- package/dist/editors/strategies/copilot/marketplaces.js +44 -0
- package/dist/editors/strategies/copilot/marketplaces.js.map +1 -0
- package/dist/editors/strategies/copilot/mcp.d.ts.map +1 -1
- package/dist/editors/strategies/copilot/mcp.js +5 -59
- package/dist/editors/strategies/copilot/mcp.js.map +1 -1
- package/dist/editors/strategies/copilot/plugins.d.ts +15 -0
- package/dist/editors/strategies/copilot/plugins.d.ts.map +1 -0
- package/dist/editors/strategies/copilot/plugins.js +41 -0
- package/dist/editors/strategies/copilot/plugins.js.map +1 -0
- package/dist/editors/strategies/cursor/index.d.ts +2 -0
- package/dist/editors/strategies/cursor/index.d.ts.map +1 -1
- package/dist/editors/strategies/cursor/index.js +2 -0
- package/dist/editors/strategies/cursor/index.js.map +1 -1
- package/dist/editors/strategies/cursor/marketplaces.d.ts +13 -0
- package/dist/editors/strategies/cursor/marketplaces.d.ts.map +1 -0
- package/dist/editors/strategies/cursor/marketplaces.js +39 -0
- package/dist/editors/strategies/cursor/marketplaces.js.map +1 -0
- package/dist/editors/strategies/cursor/plugins.d.ts +13 -0
- package/dist/editors/strategies/cursor/plugins.d.ts.map +1 -0
- package/dist/editors/strategies/cursor/plugins.js +36 -0
- package/dist/editors/strategies/cursor/plugins.js.map +1 -0
- package/dist/editors/strategies/grok/hooks.d.ts +14 -0
- package/dist/editors/strategies/grok/hooks.d.ts.map +1 -0
- package/dist/editors/strategies/grok/hooks.js +190 -0
- package/dist/editors/strategies/grok/hooks.js.map +1 -0
- package/dist/editors/strategies/grok/index.d.ts +5 -0
- package/dist/editors/strategies/grok/index.d.ts.map +1 -0
- package/dist/editors/strategies/grok/index.js +5 -0
- package/dist/editors/strategies/grok/index.js.map +1 -0
- package/dist/editors/strategies/grok/mcp.d.ts +19 -0
- package/dist/editors/strategies/grok/mcp.d.ts.map +1 -0
- package/dist/editors/strategies/grok/mcp.js +60 -0
- package/dist/editors/strategies/grok/mcp.js.map +1 -0
- package/dist/editors/strategies/grok/prompts.d.ts +24 -0
- package/dist/editors/strategies/grok/prompts.d.ts.map +1 -0
- package/dist/editors/strategies/grok/prompts.js +46 -0
- package/dist/editors/strategies/grok/prompts.js.map +1 -0
- package/dist/editors/strategies/grok/rules.d.ts +20 -0
- package/dist/editors/strategies/grok/rules.d.ts.map +1 -0
- package/dist/editors/strategies/grok/rules.js +41 -0
- package/dist/editors/strategies/grok/rules.js.map +1 -0
- package/dist/editors/strategies/index.d.ts +8 -7
- package/dist/editors/strategies/index.d.ts.map +1 -1
- package/dist/editors/strategies/index.js +7 -6
- package/dist/editors/strategies/index.js.map +1 -1
- package/dist/editors/strategies/opencode/index.d.ts +1 -0
- package/dist/editors/strategies/opencode/index.d.ts.map +1 -1
- package/dist/editors/strategies/opencode/index.js +1 -0
- package/dist/editors/strategies/opencode/index.js.map +1 -1
- package/dist/editors/strategies/opencode/mcp.d.ts.map +1 -1
- package/dist/editors/strategies/opencode/mcp.js +7 -12
- package/dist/editors/strategies/opencode/mcp.js.map +1 -1
- package/dist/editors/strategies/opencode/plugins.d.ts +15 -0
- package/dist/editors/strategies/opencode/plugins.d.ts.map +1 -0
- package/dist/editors/strategies/opencode/plugins.js +52 -0
- package/dist/editors/strategies/opencode/plugins.js.map +1 -0
- package/dist/editors/strategies/shared/agents.d.ts +1 -0
- package/dist/editors/strategies/shared/agents.d.ts.map +1 -1
- package/dist/editors/strategies/shared/agents.js +2 -2
- package/dist/editors/strategies/shared/agents.js.map +1 -1
- package/dist/editors/strategies/shared/global-mcp.d.ts +10 -0
- package/dist/editors/strategies/shared/global-mcp.d.ts.map +1 -1
- package/dist/editors/strategies/shared/global-mcp.js +6 -0
- package/dist/editors/strategies/shared/global-mcp.js.map +1 -1
- package/dist/editors/strategies/shared/hook-paths.d.ts +16 -0
- package/dist/editors/strategies/shared/hook-paths.d.ts.map +1 -0
- package/dist/editors/strategies/shared/hook-paths.js +30 -0
- package/dist/editors/strategies/shared/hook-paths.js.map +1 -0
- package/dist/editors/strategies/shared/index.d.ts +5 -0
- package/dist/editors/strategies/shared/index.d.ts.map +1 -1
- package/dist/editors/strategies/shared/index.js +5 -0
- package/dist/editors/strategies/shared/index.js.map +1 -1
- package/dist/editors/strategies/shared/mcp-import-utils.d.ts +7 -0
- package/dist/editors/strategies/shared/mcp-import-utils.d.ts.map +1 -0
- package/dist/editors/strategies/shared/mcp-import-utils.js +16 -0
- package/dist/editors/strategies/shared/mcp-import-utils.js.map +1 -0
- package/dist/editors/strategies/shared/native-skills.d.ts +2 -0
- package/dist/editors/strategies/shared/native-skills.d.ts.map +1 -1
- package/dist/editors/strategies/shared/native-skills.js +14 -9
- package/dist/editors/strategies/shared/native-skills.js.map +1 -1
- package/dist/editors/strategies/shared/no-marketplaces.d.ts +13 -0
- package/dist/editors/strategies/shared/no-marketplaces.d.ts.map +1 -0
- package/dist/editors/strategies/shared/no-marketplaces.js +19 -0
- package/dist/editors/strategies/shared/no-marketplaces.js.map +1 -0
- package/dist/editors/strategies/shared/no-plugins.d.ts +13 -0
- package/dist/editors/strategies/shared/no-plugins.d.ts.map +1 -0
- package/dist/editors/strategies/shared/no-plugins.js +19 -0
- package/dist/editors/strategies/shared/no-plugins.js.map +1 -0
- package/dist/editors/strategies/shared/plugin-compatibility.d.ts +33 -0
- package/dist/editors/strategies/shared/plugin-compatibility.d.ts.map +1 -0
- package/dist/editors/strategies/shared/plugin-compatibility.js +134 -0
- package/dist/editors/strategies/shared/plugin-compatibility.js.map +1 -0
- package/dist/editors/strategies/shared/plugin-paths.d.ts +20 -0
- package/dist/editors/strategies/shared/plugin-paths.d.ts.map +1 -0
- package/dist/editors/strategies/shared/plugin-paths.js +62 -0
- package/dist/editors/strategies/shared/plugin-paths.js.map +1 -0
- package/dist/editors/strategies/shared/pointer-skills.d.ts.map +1 -1
- package/dist/editors/strategies/shared/pointer-skills.js +9 -9
- package/dist/editors/strategies/shared/pointer-skills.js.map +1 -1
- package/dist/editors/strategies/shared/skill-directory.d.ts +3 -0
- package/dist/editors/strategies/shared/skill-directory.d.ts.map +1 -0
- package/dist/editors/strategies/shared/skill-directory.js +80 -0
- package/dist/editors/strategies/shared/skill-directory.js.map +1 -0
- package/dist/editors/strategies/shared/standard-mcp.d.ts +34 -0
- package/dist/editors/strategies/shared/standard-mcp.d.ts.map +1 -1
- package/dist/editors/strategies/shared/standard-mcp.js +76 -30
- package/dist/editors/strategies/shared/standard-mcp.js.map +1 -1
- package/dist/editors/strategies/types.d.ts +56 -1
- package/dist/editors/strategies/types.d.ts.map +1 -1
- package/dist/editors/strategies/windsurf/hooks.d.ts.map +1 -1
- package/dist/editors/strategies/windsurf/hooks.js +4 -1
- package/dist/editors/strategies/windsurf/hooks.js.map +1 -1
- package/dist/editors/strategies/windsurf/mcp.d.ts.map +1 -1
- package/dist/editors/strategies/windsurf/mcp.js +40 -55
- package/dist/editors/strategies/windsurf/mcp.js.map +1 -1
- package/dist/editors/strategies/windsurf/rules.d.ts +1 -0
- package/dist/editors/strategies/windsurf/rules.d.ts.map +1 -1
- package/dist/editors/strategies/windsurf/rules.js +4 -0
- package/dist/editors/strategies/windsurf/rules.js.map +1 -1
- package/dist/editors/strategies/zed/mcp.d.ts.map +1 -1
- package/dist/editors/strategies/zed/mcp.js +19 -29
- package/dist/editors/strategies/zed/mcp.js.map +1 -1
- package/dist/editors/types.d.ts +36 -4
- package/dist/editors/types.d.ts.map +1 -1
- package/dist/editors/types.js +53 -1
- package/dist/editors/types.js.map +1 -1
- package/dist/format-error.d.ts.map +1 -1
- package/dist/format-error.js +1 -3
- package/dist/format-error.js.map +1 -1
- package/dist/fs/safe-rm.d.ts.map +1 -1
- package/dist/fs/safe-rm.js +17 -1
- package/dist/fs/safe-rm.js.map +1 -1
- package/dist/global/processor.d.ts.map +1 -1
- package/dist/global/processor.js +19 -21
- package/dist/global/processor.js.map +1 -1
- package/dist/global/types.d.ts +5 -0
- package/dist/global/types.d.ts.map +1 -1
- package/dist/mcp/env.d.ts +7 -0
- package/dist/mcp/env.d.ts.map +1 -1
- package/dist/mcp/env.js +10 -1
- package/dist/mcp/env.js.map +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/merge.d.ts +11 -2
- package/dist/merge.d.ts.map +1 -1
- package/dist/merge.js +41 -0
- package/dist/merge.js.map +1 -1
- package/dist/reference-resolver.d.ts +1 -1
- package/dist/reference-resolver.d.ts.map +1 -1
- package/dist/reference-resolver.js +1 -0
- package/dist/reference-resolver.js.map +1 -1
- package/dist/skills/parser.d.ts.map +1 -1
- package/dist/skills/parser.js +2 -2
- package/dist/skills/parser.js.map +1 -1
- package/dist/skills/resolvers/git.d.ts.map +1 -1
- package/dist/skills/resolvers/git.js +46 -1
- package/dist/skills/resolvers/git.js.map +1 -1
- package/dist/skills/validate.d.ts.map +1 -1
- package/dist/skills/validate.js +8 -0
- package/dist/skills/validate.js.map +1 -1
- package/dist/state/tracker.d.ts +18 -0
- package/dist/state/tracker.d.ts.map +1 -1
- package/dist/state/tracker.js +31 -0
- package/dist/state/tracker.js.map +1 -1
- package/dist/state/types.d.ts +4 -2
- package/dist/state/types.d.ts.map +1 -1
- package/dist/type-guards.d.ts +6 -0
- package/dist/type-guards.d.ts.map +1 -0
- package/dist/type-guards.js +8 -0
- package/dist/type-guards.js.map +1 -0
- package/package.json +1 -1
- package/dist/editors/adapters/gemini.d.ts +0 -45
- package/dist/editors/adapters/gemini.d.ts.map +0 -1
- package/dist/editors/adapters/gemini.js +0 -144
- package/dist/editors/adapters/gemini.js.map +0 -1
- package/dist/editors/strategies/gemini/hooks.d.ts.map +0 -1
- package/dist/editors/strategies/gemini/hooks.js.map +0 -1
- package/dist/editors/strategies/gemini/index.d.ts +0 -5
- package/dist/editors/strategies/gemini/index.d.ts.map +0 -1
- package/dist/editors/strategies/gemini/index.js +0 -5
- package/dist/editors/strategies/gemini/index.js.map +0 -1
- package/dist/editors/strategies/gemini/mcp.d.ts.map +0 -1
- package/dist/editors/strategies/gemini/mcp.js +0 -73
- package/dist/editors/strategies/gemini/mcp.js.map +0 -1
- package/dist/editors/strategies/gemini/prompts.d.ts +0 -34
- package/dist/editors/strategies/gemini/prompts.d.ts.map +0 -1
- package/dist/editors/strategies/gemini/prompts.js +0 -92
- package/dist/editors/strategies/gemini/prompts.js.map +0 -1
- package/dist/editors/strategies/gemini/rules.d.ts +0 -19
- package/dist/editors/strategies/gemini/rules.d.ts.map +0 -1
- package/dist/editors/strategies/gemini/rules.js +0 -51
- package/dist/editors/strategies/gemini/rules.js.map +0 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { PluginsConfig, McpServerConfig } from '@a1st/aix-schema';
|
|
2
|
+
import type { PluginsStrategy } from '../types.js';
|
|
3
|
+
export interface UnpackedPluginComponents {
|
|
4
|
+
skills: Record<string, {
|
|
5
|
+
path: string;
|
|
6
|
+
}>;
|
|
7
|
+
mcp: Record<string, McpServerConfig>;
|
|
8
|
+
rules: Record<string, {
|
|
9
|
+
content: string;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Discovers and unpacks plugin components (skills, MCP servers, rules) from a local
|
|
14
|
+
* plugin directory so editors without native plugin systems can consume them.
|
|
15
|
+
*/
|
|
16
|
+
export declare function unpackPluginDirectory(pluginName: string, pluginDir: string): Promise<UnpackedPluginComponents>;
|
|
17
|
+
/**
|
|
18
|
+
* Unpacks all configured local plugins into their composite parts.
|
|
19
|
+
*/
|
|
20
|
+
export declare function unpackAllPlugins(plugins: PluginsConfig, projectRoot: string): Promise<UnpackedPluginComponents>;
|
|
21
|
+
/**
|
|
22
|
+
* Compatibility plugins strategy for editors lacking native plugin systems
|
|
23
|
+
* (e.g., Windsurf, Zed, Codex, Antigravity, Grok). Reports support as true
|
|
24
|
+
* because components are unpacked into native skills, MCP, and rules.
|
|
25
|
+
*/
|
|
26
|
+
export declare class PluginCompatibilityStrategy implements PluginsStrategy {
|
|
27
|
+
isSupported(): boolean;
|
|
28
|
+
isCompatibility(): boolean;
|
|
29
|
+
formatConfig(_plugins: PluginsConfig): string;
|
|
30
|
+
getConfigPath(): string;
|
|
31
|
+
getUnsupportedPlugins(_plugins: PluginsConfig): string[];
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=plugin-compatibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-compatibility.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/shared/plugin-compatibility.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD,MAAM,WAAW,wBAAwB;IACtC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACzC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7C;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACxC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GACjB,OAAO,CAAC,wBAAwB,CAAC,CA0EnC;AAoCD;;GAEG;AACH,wBAAsB,gBAAgB,CACnC,OAAO,EAAE,aAAa,EACtB,WAAW,EAAE,MAAM,GACnB,OAAO,CAAC,wBAAwB,CAAC,CAgCnC;AAED;;;;GAIG;AACH,qBAAa,2BAA4B,YAAW,eAAe;IAChE,WAAW,IAAI,OAAO;IAItB,eAAe,IAAI,OAAO;IAI1B,YAAY,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM;IAI7C,aAAa,IAAI,MAAM;IAIvB,qBAAqB,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,EAAE;CAG1D"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { join, resolve } from 'pathe';
|
|
2
|
+
import { parseJsonc } from '@a1st/aix-schema';
|
|
3
|
+
import { getRuntimeAdapter } from '../../../runtime/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Discovers and unpacks plugin components (skills, MCP servers, rules) from a local
|
|
6
|
+
* plugin directory so editors without native plugin systems can consume them.
|
|
7
|
+
*/
|
|
8
|
+
export async function unpackPluginDirectory(pluginName, pluginDir) {
|
|
9
|
+
const fs = getRuntimeAdapter().fs, result = {
|
|
10
|
+
skills: {},
|
|
11
|
+
mcp: {},
|
|
12
|
+
rules: {},
|
|
13
|
+
};
|
|
14
|
+
try {
|
|
15
|
+
if (!fs.existsSync(pluginDir)) {
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
// 1. Discover skills: check <pluginDir>/skills or <pluginDir>/SKILL.md
|
|
19
|
+
const skillsDir = join(pluginDir, 'skills'), rootSkillFile = join(pluginDir, 'SKILL.md');
|
|
20
|
+
if (fs.existsSync(skillsDir)) {
|
|
21
|
+
const entries = await fs.readdir(skillsDir, { withFileTypes: true });
|
|
22
|
+
for (const entry of entries) {
|
|
23
|
+
if (!entry.isDirectory()) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const skillSubdir = join(skillsDir, entry.name), skillFile = join(skillSubdir, 'SKILL.md');
|
|
27
|
+
if (fs.existsSync(skillFile)) {
|
|
28
|
+
result.skills[`${pluginName}-${entry.name}`] = { path: skillSubdir };
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else if (fs.existsSync(rootSkillFile)) {
|
|
33
|
+
result.skills[pluginName] = { path: pluginDir };
|
|
34
|
+
}
|
|
35
|
+
// 2. Discover MCP servers: check <pluginDir>/.mcp.json or <pluginDir>/mcp.json
|
|
36
|
+
const mcpCandidates = ['.mcp.json', 'mcp.json'], existingMcpFile = mcpCandidates.map((c) => join(pluginDir, c)).find((p) => fs.existsSync(p));
|
|
37
|
+
if (existingMcpFile) {
|
|
38
|
+
const raw = await fs.readFile(existingMcpFile, 'utf-8'), parsed = parseJsonc(raw), servers = (parsed.data?.mcpServers ?? parsed.data?.servers ?? parsed.data);
|
|
39
|
+
for (const [serverName, serverConfig] of Object.entries(servers ?? {})) {
|
|
40
|
+
if (typeof serverConfig === 'object' && serverConfig !== null) {
|
|
41
|
+
result.mcp[`${pluginName}-${serverName}`] = serverConfig;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// 3. Discover rules: check <pluginDir>/rules/*.md
|
|
46
|
+
const rulesDir = join(pluginDir, 'rules');
|
|
47
|
+
if (fs.existsSync(rulesDir)) {
|
|
48
|
+
const entries = await fs.readdir(rulesDir, { withFileTypes: true }), ruleEntries = entries.filter((e) => e.isFile() && (e.name.endsWith('.md') || e.name.endsWith('.mdc')));
|
|
49
|
+
await Promise.all(ruleEntries.map(async (entry) => {
|
|
50
|
+
const rulePath = join(rulesDir, entry.name), content = await fs.readFile(rulePath, 'utf-8'), ruleName = entry.name.replace(/\.(md|mdc)$/, '');
|
|
51
|
+
result.rules[`${pluginName}-${ruleName}`] = { content };
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
// Graceful fallback on unreadable directories
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Resolves local filesystem path for a plugin entry if applicable.
|
|
62
|
+
*/
|
|
63
|
+
function resolvePluginLocalPath(value, projectRoot) {
|
|
64
|
+
if (typeof value === 'string' && (value.startsWith('.') || value.startsWith('/'))) {
|
|
65
|
+
return resolve(projectRoot, value);
|
|
66
|
+
}
|
|
67
|
+
if (typeof value !== 'object' || value === null) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
const obj = value;
|
|
71
|
+
if (obj.enabled === false) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
if (typeof obj.source === 'string' && (obj.source.startsWith('.') || obj.source.startsWith('/'))) {
|
|
75
|
+
return resolve(projectRoot, obj.source);
|
|
76
|
+
}
|
|
77
|
+
if (typeof obj.source === 'object' &&
|
|
78
|
+
obj.source !== null &&
|
|
79
|
+
'path' in obj.source &&
|
|
80
|
+
typeof obj.source.path === 'string') {
|
|
81
|
+
return resolve(projectRoot, obj.source.path);
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Unpacks all configured local plugins into their composite parts.
|
|
87
|
+
*/
|
|
88
|
+
export async function unpackAllPlugins(plugins, projectRoot) {
|
|
89
|
+
const aggregated = {
|
|
90
|
+
skills: {},
|
|
91
|
+
mcp: {},
|
|
92
|
+
rules: {},
|
|
93
|
+
};
|
|
94
|
+
const pluginTasks = [];
|
|
95
|
+
for (const [name, value] of Object.entries(plugins)) {
|
|
96
|
+
if (value === false) {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const sourcePath = resolvePluginLocalPath(value, projectRoot);
|
|
100
|
+
if (sourcePath) {
|
|
101
|
+
pluginTasks.push({ name, sourcePath });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const unpackedList = await Promise.all(pluginTasks.map(({ name, sourcePath }) => unpackPluginDirectory(name, sourcePath)));
|
|
105
|
+
for (const unpacked of unpackedList) {
|
|
106
|
+
Object.assign(aggregated.skills, unpacked.skills);
|
|
107
|
+
Object.assign(aggregated.mcp, unpacked.mcp);
|
|
108
|
+
Object.assign(aggregated.rules, unpacked.rules);
|
|
109
|
+
}
|
|
110
|
+
return aggregated;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Compatibility plugins strategy for editors lacking native plugin systems
|
|
114
|
+
* (e.g., Windsurf, Zed, Codex, Antigravity, Grok). Reports support as true
|
|
115
|
+
* because components are unpacked into native skills, MCP, and rules.
|
|
116
|
+
*/
|
|
117
|
+
export class PluginCompatibilityStrategy {
|
|
118
|
+
isSupported() {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
isCompatibility() {
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
formatConfig(_plugins) {
|
|
125
|
+
return '';
|
|
126
|
+
}
|
|
127
|
+
getConfigPath() {
|
|
128
|
+
return '';
|
|
129
|
+
}
|
|
130
|
+
getUnsupportedPlugins(_plugins) {
|
|
131
|
+
return [];
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=plugin-compatibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-compatibility.js","sourceRoot":"","sources":["../../../../src/editors/strategies/shared/plugin-compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAQ9D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACxC,UAAkB,EAClB,SAAiB;IAEjB,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAC,EAAE,EAC3B,MAAM,GAA6B;QAChC,MAAM,EAAE,EAAE;QACV,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,EAAE;KACX,CAAC;IAER,IAAI,CAAC;QACF,IAAI,CAAC,EAAE,CAAC,UAA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AM,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC5C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,UAAU,CAAC;AACrB,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,2BAA2B;IACrC,WAAW;QACR,OAAO,IAAI,CAAC;IACf,CAAC;IAED,eAAe;QACZ,OAAO,IAAI,CAAC;IACf,CAAC;IAED,YAAY,CAAC,QAAuB;QACjC,OAAO,EAAE,CAAC;IACb,CAAC;IAED,aAAa;QACV,OAAO,EAAE,CAAC;IACb,CAAC;IAED,qBAAqB,CAAC,QAAuB;QAC1C,OAAO,EAAE,CAAC;IACb,CAAC;CACH"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PluginsStrategy, MarketplacesStrategy } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve where an editor keeps its plugins config for the requested scope, or `undefined`
|
|
4
|
+
* if it has no plugins config file at that scope.
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolvePluginsConfigPath(strategy: PluginsStrategy, configDir: string, targetScope: 'project' | 'user', projectRoot?: string): string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Resolve where an editor keeps its marketplace config for the requested scope, or `undefined`
|
|
9
|
+
* if it has no marketplace config file at that scope.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveMarketplacesConfigPath(strategy: MarketplacesStrategy, configDir: string, targetScope: 'project' | 'user', projectRoot?: string): string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the editor supports plugins config at the requested scope.
|
|
14
|
+
*/
|
|
15
|
+
export declare function hasPluginsConfigPath(strategy: PluginsStrategy, targetScope: 'project' | 'user'): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the editor supports marketplace config at the requested scope.
|
|
18
|
+
*/
|
|
19
|
+
export declare function hasMarketplacesConfigPath(strategy: MarketplacesStrategy, targetScope: 'project' | 'user'): boolean;
|
|
20
|
+
//# sourceMappingURL=plugin-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-paths.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/shared/plugin-paths.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEzE;;;GAGG;AACH,wBAAgB,wBAAwB,CACrC,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,SAAS,GAAG,MAAM,EAC/B,WAAW,CAAC,EAAE,MAAM,GACpB,MAAM,GAAG,SAAS,CAoBpB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC1C,QAAQ,EAAE,oBAAoB,EAC9B,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,SAAS,GAAG,MAAM,EAC/B,WAAW,CAAC,EAAE,MAAM,GACpB,MAAM,GAAG,SAAS,CAoBpB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CACjC,QAAQ,EAAE,eAAe,EACzB,WAAW,EAAE,SAAS,GAAG,MAAM,GAC/B,OAAO,CAYT;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACtC,QAAQ,EAAE,oBAAoB,EAC9B,WAAW,EAAE,SAAS,GAAG,MAAM,GAC/B,OAAO,CAQT"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { join } from 'pathe';
|
|
2
|
+
import { getRuntimeAdapter } from '../../../runtime/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resolve where an editor keeps its plugins config for the requested scope, or `undefined`
|
|
5
|
+
* if it has no plugins config file at that scope.
|
|
6
|
+
*/
|
|
7
|
+
export function resolvePluginsConfigPath(strategy, configDir, targetScope, projectRoot) {
|
|
8
|
+
if (!strategy.isSupported()) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
if (targetScope === 'user') {
|
|
12
|
+
const globalPath = strategy.getGlobalConfigPath?.();
|
|
13
|
+
return globalPath ? join(getRuntimeAdapter().os.homedir(), globalPath) : undefined;
|
|
14
|
+
}
|
|
15
|
+
const relPath = strategy.getConfigPath?.(targetScope);
|
|
16
|
+
if (!relPath) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
const baseDir = strategy.isProjectRootConfig?.() && projectRoot ? projectRoot : configDir;
|
|
20
|
+
return join(baseDir, relPath);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Resolve where an editor keeps its marketplace config for the requested scope, or `undefined`
|
|
24
|
+
* if it has no marketplace config file at that scope.
|
|
25
|
+
*/
|
|
26
|
+
export function resolveMarketplacesConfigPath(strategy, configDir, targetScope, projectRoot) {
|
|
27
|
+
if (!strategy.isSupported()) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
if (targetScope === 'user') {
|
|
31
|
+
const globalPath = strategy.getGlobalConfigPath?.();
|
|
32
|
+
return globalPath ? join(getRuntimeAdapter().os.homedir(), globalPath) : undefined;
|
|
33
|
+
}
|
|
34
|
+
const relPath = strategy.getConfigPath?.(targetScope);
|
|
35
|
+
if (!relPath) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const baseDir = strategy.isProjectRootConfig?.() && projectRoot ? projectRoot : configDir;
|
|
39
|
+
return join(baseDir, relPath);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Whether the editor supports plugins config at the requested scope.
|
|
43
|
+
*/
|
|
44
|
+
export function hasPluginsConfigPath(strategy, targetScope) {
|
|
45
|
+
if (!strategy.isSupported()) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
if (strategy.isCompatibility?.()) {
|
|
49
|
+
return targetScope === 'project';
|
|
50
|
+
}
|
|
51
|
+
return Boolean(targetScope === 'user' ? strategy.getGlobalConfigPath?.() : strategy.getConfigPath?.(targetScope));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Whether the editor supports marketplace config at the requested scope.
|
|
55
|
+
*/
|
|
56
|
+
export function hasMarketplacesConfigPath(strategy, targetScope) {
|
|
57
|
+
if (!strategy.isSupported()) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
return Boolean(targetScope === 'user' ? strategy.getGlobalConfigPath?.() : strategy.getConfigPath?.(targetScope));
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=plugin-paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-paths.js","sourceRoot":"","sources":["../../../../src/editors/strategies/shared/plugin-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG9D;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CACrC,QAAyB,EACzB,SAAiB,EACjB,WAA+B,EAC/B,WAAoB;IAEpB,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IACpB,CAAC;IAED,IAAI,WAAW,KAAK,MAAM,EAAE,CAAC;QAC1B,MAAM,UAAU,GAAG,QAAQ,CAAC,mBAAmB,EAAE,EAAE,CAAC;QAEpD,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACtF,CAAC;IAED,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC,WAAW,CAAC,CAAC;IAEtD,IAAI,CAAC,OAAO,EAAE,CAAC;QACZ,OAAO,SAAS,CAAC;IACpB,CAAC;IAED,MAAM,OAAO,GAAG,QAAQ,CAAC,mBAAmB,EAAE,EAAE,IAAI,WAAW,CAAC,CAAC,CAAC,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,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,WAAW,CAAC,CACnG,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CACtC,QAA8B,EAC9B,WAA+B;IAE/B,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IAChB,CAAC;IAED,OAAO,OAAO,CACX,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,WAAW,CAAC,CACnG,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pointer-skills.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/shared/pointer-skills.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI7D;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,cAAc;IACzD,YAAY,IAAI,MAAM;IAItB,oBAAoB,IAAI,SAAS,MAAM,EAAE;IAIzC,mBAAmB,IAAI,SAAS,MAAM,EAAE;IAIxC,QAAQ,IAAI,OAAO;IAIb,aAAa,CAChB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EAChC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;KAAO,GACpE,OAAO,CAAC,UAAU,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"pointer-skills.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/shared/pointer-skills.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI7D;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,cAAc;IACzD,YAAY,IAAI,MAAM;IAItB,oBAAoB,IAAI,SAAS,MAAM,EAAE;IAIzC,mBAAmB,IAAI,SAAS,MAAM,EAAE;IAIxC,QAAQ,IAAI,OAAO;IAIb,aAAa,CAChB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EAChC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;KAAO,GACpE,OAAO,CAAC,UAAU,EAAE,CAAC;IA8BxB,kBAAkB,CACf,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EAChC,OAAO,GAAE;QAAE,WAAW,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;KAAO,GAClD,UAAU,EAAE;CA+DjB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import pMap from 'p-map';
|
|
2
|
-
import { join
|
|
3
|
-
import { safeRm } from '../../../fs/safe-rm.js';
|
|
2
|
+
import { join } from 'pathe';
|
|
4
3
|
import { getRuntimeAdapter } from '../../../runtime/index.js';
|
|
4
|
+
import { getReplacementAction, replaceSkillDirectory } from './skill-directory.js';
|
|
5
5
|
/**
|
|
6
6
|
* Pointer skills strategy for editors without native Agent Skills support (currently Zed).
|
|
7
7
|
* Copies skills to `.aix/skills/` and generates pointer rules that tell the AI where to find the
|
|
@@ -23,17 +23,17 @@ export class PointerSkillsStrategy {
|
|
|
23
23
|
async installSkills(skills, projectRoot, options = {}) {
|
|
24
24
|
const entries = Array.from(skills.entries()), installRoot = options.targetScope === 'user' ? getRuntimeAdapter().os.homedir() : projectRoot;
|
|
25
25
|
const changes = await pMap(entries, async ([name, skill]) => {
|
|
26
|
-
const aixSkillDir = join(installRoot, '.aix', 'skills', name)
|
|
26
|
+
const aixSkillDir = join(installRoot, '.aix', 'skills', name);
|
|
27
|
+
let action;
|
|
27
28
|
if (!options.dryRun) {
|
|
28
|
-
await
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
await getRuntimeAdapter().fs.cp(skill.basePath, aixSkillDir, { recursive: true, force: true });
|
|
29
|
+
action = await replaceSkillDirectory(skill.basePath, aixSkillDir);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
action = await getReplacementAction(aixSkillDir);
|
|
33
33
|
}
|
|
34
34
|
return {
|
|
35
35
|
path: aixSkillDir,
|
|
36
|
-
action
|
|
36
|
+
action,
|
|
37
37
|
content: `[skill directory: ${skill.basePath}]`,
|
|
38
38
|
isDirectory: true,
|
|
39
39
|
category: 'skill',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pointer-skills.js","sourceRoot":"","sources":["../../../../src/editors/strategies/shared/pointer-skills.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,OAAO,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"pointer-skills.js","sourceRoot":"","sources":["../../../../src/editors/strategies/shared/pointer-skills.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,OAAO,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAI7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAEnF;;;;GAIG;AACH,MAAM,OAAO,qBAAqB;IAC/B,YAAY;QACT,OAAO,aAAa,CAAC;IACxB,CAAC;IAED,oBAAoB;QACjB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,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC/D,QAAQ,CAAC,IAAI,CAAC,OAAO,GAAG,OAAO,KAAK,EAAE,CAAC,CAAC;gBAC3C,CAAC;YACJ,CAAC;YAED,mCAAmC;YACnC,QAAQ,CAAC,IAAI,CACV,EAAE,EACF,aAAa,EACb,EAAE,EACF,gCAAgC,SAAS,8DAA8D,EACvG,EAAE,EACF,oBAAoB,EACpB,EAAE,EACF,yBAAyB,SAAS,aAAa,EAC/C,oBAAoB,SAAS,4BAA4B,EACzD,uBAAuB,SAAS,+BAA+B,EAC/D,EAAE,EACF,oFAAoF,CACtF,CAAC;YAEF,KAAK,CAAC,IAAI,CAAC;gBACR,IAAI,EAAE,SAAS,IAAI,EAAE;gBACrB,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC5B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;aAChC,CAAC,CAAC;QACN,CAAC;QAED,OAAO,KAAK,CAAC;IAChB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-directory.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/shared/skill-directory.ts"],"names":[],"mappings":"AA0BA,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAUrF;AAED,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAwC7G"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { basename, dirname, join, normalize } from 'pathe';
|
|
2
|
+
import { safeRm } from '../../../fs/safe-rm.js';
|
|
3
|
+
import { getRuntimeAdapter } from '../../../runtime/index.js';
|
|
4
|
+
const replacementLocks = new Map();
|
|
5
|
+
/**
|
|
6
|
+
* Serialize replacements that target the same destination so concurrent installs from multiple
|
|
7
|
+
* editors cannot interleave each other's staging and backup renames.
|
|
8
|
+
*/
|
|
9
|
+
async function withReplacementLock(destination, task) {
|
|
10
|
+
const key = normalize(destination), gate = (replacementLocks.get(key) ?? Promise.resolve()).then(() => task());
|
|
11
|
+
replacementLocks.set(key, gate.catch(() => { }));
|
|
12
|
+
return gate;
|
|
13
|
+
}
|
|
14
|
+
export async function getReplacementAction(path) {
|
|
15
|
+
try {
|
|
16
|
+
await getRuntimeAdapter().fs.lstat(path);
|
|
17
|
+
return 'update';
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (isMissingPathError(error)) {
|
|
21
|
+
return 'create';
|
|
22
|
+
}
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export async function replaceSkillDirectory(source, destination) {
|
|
27
|
+
return withReplacementLock(destination, async () => {
|
|
28
|
+
const adapter = getRuntimeAdapter(), action = await getReplacementAction(destination), parentDir = dirname(destination), transactionID = adapter.crypto.randomUUID(), stagingPath = join(parentDir, `.${basename(destination)}.${transactionID}.staging`), backupPath = join(parentDir, `.${basename(destination)}.${transactionID}.backup`);
|
|
29
|
+
await adapter.fs.mkdir(parentDir, { recursive: true });
|
|
30
|
+
await safeRm(stagingPath, { force: true });
|
|
31
|
+
await safeRm(backupPath, { force: true });
|
|
32
|
+
try {
|
|
33
|
+
await adapter.fs.cp(source, stagingPath, { recursive: true, force: true });
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
await safeRm(stagingPath, { force: true });
|
|
37
|
+
throw new Error(`Failed to stage skill directory from "${source}" to "${destination}": ${formatError(error)}`, {
|
|
38
|
+
cause: error,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
let originalMoved = false;
|
|
42
|
+
try {
|
|
43
|
+
if (action === 'update') {
|
|
44
|
+
await adapter.fs.rename(destination, backupPath);
|
|
45
|
+
originalMoved = true;
|
|
46
|
+
}
|
|
47
|
+
await adapter.fs.rename(stagingPath, destination);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
await restoreSkillDirectory(adapter, { destination, stagingPath, backupPath, originalMoved });
|
|
51
|
+
throw new Error(`Failed to replace skill directory at "${destination}": ${formatError(error)}`, {
|
|
52
|
+
cause: error,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
await safeRm(backupPath, { force: true });
|
|
56
|
+
return action;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
async function restoreSkillDirectory(adapter, transaction) {
|
|
60
|
+
const { destination, stagingPath, backupPath, originalMoved } = transaction;
|
|
61
|
+
await safeRm(stagingPath, { force: true });
|
|
62
|
+
if (!originalMoved) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
await safeRm(destination, { force: true });
|
|
66
|
+
await adapter.fs.rename(backupPath, destination);
|
|
67
|
+
}
|
|
68
|
+
function isMissingPathError(error) {
|
|
69
|
+
return isErrnoException(error) && error.code === 'ENOENT';
|
|
70
|
+
}
|
|
71
|
+
function isErrnoException(error) {
|
|
72
|
+
return error instanceof Error && 'code' in error;
|
|
73
|
+
}
|
|
74
|
+
function formatError(error) {
|
|
75
|
+
if (error instanceof Error) {
|
|
76
|
+
return error.message;
|
|
77
|
+
}
|
|
78
|
+
return String(error);
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=skill-directory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-directory.js","sourceRoot":"","sources":["../../../../src/editors/strategies/shared/skill-directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAS9D,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA4B,CAAC;AAE7D;;;GAGG;AACH,K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AE,EAAE;gBAC7F,KAAK,EAAE,KAAK;aACd,CAAC,CAAC;QACN,CAAC;QAED,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1C,OAAO,MAAM,CAAC;IACjB,CAAC,CAAC,CAAC;AACN,CAAC;AAED,KAAK,UAAU,qBAAqB,CACjC,OAA6C,EAC7C,WAAwC;IAExC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,WAAW,CAAC;IAE5E,MAAM,MAAM,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAE3C,IAAI,CAAC,aAAa,EAAE,CAAC;QAClB,OAAO;IACV,CAAC;IAED,MAAM,MAAM,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,MAAM,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAc;IACvC,OAAO,gBAAgB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC7D,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc;IACrC,OAAO,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,CAAC;AACpD,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IAChC,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC,OAAO,CAAC;IACxB,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
import type { McpServerConfig } from '@a1st/aix-schema';
|
|
2
2
|
import type { McpStrategy } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Values some editors write in each entry's `type` field to name the transport. Claude Code
|
|
5
|
+
* uses `stdio` and `http`; GitHub Copilot uses `local` and `http`.
|
|
6
|
+
*/
|
|
7
|
+
export interface TransportTypeNames {
|
|
8
|
+
readonly stdio: string;
|
|
9
|
+
readonly http: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* How one editor's entries differ from the common shape.
|
|
13
|
+
*/
|
|
14
|
+
export interface StandardServerEntryOptions {
|
|
15
|
+
/** Transport names for the `type` field. Omit for the editors that have no such field. */
|
|
16
|
+
readonly transportTypes?: TransportTypeNames;
|
|
17
|
+
/**
|
|
18
|
+
* Keys that can hold a remote server's endpoint, most preferred first. The first is the one
|
|
19
|
+
* written; reading accepts any of them. Gemini CLI names its streamable HTTP endpoint
|
|
20
|
+
* `httpUrl` and Windsurf documents `serverUrl`, while most editors use `url`.
|
|
21
|
+
*/
|
|
22
|
+
readonly urlKeys?: readonly string[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build one `mcpServers` entry in the shape shared by Cursor, Claude Code, Gemini CLI,
|
|
26
|
+
* GitHub Copilot, Windsurf, and Zed: `command` with optional `args` and `env` for stdio
|
|
27
|
+
* servers, a URL with optional `headers` for remote ones. Empty maps and arrays are left out
|
|
28
|
+
* so the written config stays shorthand.
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildStandardServerEntry(serverConfig: McpServerConfig, options?: StandardServerEntryOptions): Record<string, unknown>;
|
|
31
|
+
/**
|
|
32
|
+
* Read one `mcpServers` entry written in the shape produced by
|
|
33
|
+
* {@link buildStandardServerEntry}. Returns null when the entry names neither a command nor a
|
|
34
|
+
* URL, so each caller can word its own "unknown format" warning.
|
|
35
|
+
*/
|
|
36
|
+
export declare function parseStandardServerEntry(server: unknown, options?: StandardServerEntryOptions): McpServerConfig | null;
|
|
3
37
|
/**
|
|
4
38
|
* Standard MCP strategy used by Cursor. Uses `mcp.json` with a `mcpServers` object. Claude Code
|
|
5
39
|
* extends this with {@link ClaudeCodeMcpStrategy} for its `.mcp.json` (dot-prefixed) filename.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-mcp.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/shared/standard-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"standard-mcp.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/shared/standard-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACxC,0FAA0F;IAC1F,QAAQ,CAAC,cAAc,CAAC,EAAE,kBAAkB,CAAC;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAID;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACrC,YAAY,EAAE,eAAe,EAC7B,OAAO,GAAE,0BAA+B,GACxC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA8BzB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACrC,MAAM,EAAE,OAAO,EACf,OAAO,GAAE,0BAA+B,GACxC,eAAe,GAAG,IAAI,CAiCxB;AAiBD;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,WAAW;IACpD,WAAW,IAAI,OAAO;IAItB,aAAa,IAAI,MAAM;IAIvB,mBAAmB,IAAI,OAAO;IAI9B,sBAAsB,IAAI,MAAM,GAAG,IAAI;IAIvC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,MAAM;IAc1D,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG;QACpC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QACrC,QAAQ,EAAE,MAAM,EAAE,CAAC;KACrB;CAwBH"}
|
|
@@ -1,3 +1,74 @@
|
|
|
1
|
+
import { isRecord } from '../../../type-guards.js';
|
|
2
|
+
import { parseStringRecord } from './mcp-import-utils.js';
|
|
3
|
+
const DEFAULT_URL_KEYS = ['url'];
|
|
4
|
+
/**
|
|
5
|
+
* Build one `mcpServers` entry in the shape shared by Cursor, Claude Code, Gemini CLI,
|
|
6
|
+
* GitHub Copilot, Windsurf, and Zed: `command` with optional `args` and `env` for stdio
|
|
7
|
+
* servers, a URL with optional `headers` for remote ones. Empty maps and arrays are left out
|
|
8
|
+
* so the written config stays shorthand.
|
|
9
|
+
*/
|
|
10
|
+
export function buildStandardServerEntry(serverConfig, options = {}) {
|
|
11
|
+
const server = {}, transportTypes = options.transportTypes;
|
|
12
|
+
if ('command' in serverConfig) {
|
|
13
|
+
if (transportTypes) {
|
|
14
|
+
server.type = transportTypes.stdio;
|
|
15
|
+
}
|
|
16
|
+
server.command = serverConfig.command;
|
|
17
|
+
if (serverConfig.args && serverConfig.args.length > 0) {
|
|
18
|
+
server.args = serverConfig.args;
|
|
19
|
+
}
|
|
20
|
+
if (serverConfig.env && Object.keys(serverConfig.env).length > 0) {
|
|
21
|
+
server.env = serverConfig.env;
|
|
22
|
+
}
|
|
23
|
+
return server;
|
|
24
|
+
}
|
|
25
|
+
if (transportTypes) {
|
|
26
|
+
server.type = transportTypes.http;
|
|
27
|
+
}
|
|
28
|
+
server[options.urlKeys?.[0] ?? DEFAULT_URL_KEYS[0]] = serverConfig.url;
|
|
29
|
+
if (serverConfig.headers && Object.keys(serverConfig.headers).length > 0) {
|
|
30
|
+
server.headers = serverConfig.headers;
|
|
31
|
+
}
|
|
32
|
+
return server;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Read one `mcpServers` entry written in the shape produced by
|
|
36
|
+
* {@link buildStandardServerEntry}. Returns null when the entry names neither a command nor a
|
|
37
|
+
* URL, so each caller can word its own "unknown format" warning.
|
|
38
|
+
*/
|
|
39
|
+
export function parseStandardServerEntry(server, options = {}) {
|
|
40
|
+
if (!isRecord(server)) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
if (typeof server.command === 'string') {
|
|
44
|
+
const parsed = { command: server.command }, env = parseStringRecord(server.env);
|
|
45
|
+
if (Array.isArray(server.args) && server.args.length > 0) {
|
|
46
|
+
parsed.args = server.args.map(String);
|
|
47
|
+
}
|
|
48
|
+
if (env) {
|
|
49
|
+
parsed.env = env;
|
|
50
|
+
}
|
|
51
|
+
return parsed;
|
|
52
|
+
}
|
|
53
|
+
const url = getRemoteUrl(server, options.urlKeys ?? DEFAULT_URL_KEYS);
|
|
54
|
+
if (url) {
|
|
55
|
+
const parsed = { url }, headers = parseStringRecord(server.headers);
|
|
56
|
+
if (headers) {
|
|
57
|
+
parsed.headers = headers;
|
|
58
|
+
}
|
|
59
|
+
return parsed;
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
function getRemoteUrl(server, urlKeys) {
|
|
64
|
+
for (const key of urlKeys) {
|
|
65
|
+
const value = server[key];
|
|
66
|
+
if (typeof value === 'string' && value) {
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
1
72
|
/**
|
|
2
73
|
* Standard MCP strategy used by Cursor. Uses `mcp.json` with a `mcpServers` object. Claude Code
|
|
3
74
|
* extends this with {@link ClaudeCodeMcpStrategy} for its `.mcp.json` (dot-prefixed) filename.
|
|
@@ -21,19 +92,7 @@ export class StandardMcpStrategy {
|
|
|
21
92
|
if (serverConfig.enabled === false) {
|
|
22
93
|
continue;
|
|
23
94
|
}
|
|
24
|
-
|
|
25
|
-
const server = { command: serverConfig.command };
|
|
26
|
-
if (serverConfig.args && serverConfig.args.length > 0) {
|
|
27
|
-
server.args = serverConfig.args;
|
|
28
|
-
}
|
|
29
|
-
if (serverConfig.env && Object.keys(serverConfig.env).length > 0) {
|
|
30
|
-
server.env = serverConfig.env;
|
|
31
|
-
}
|
|
32
|
-
mcpServers[name] = server;
|
|
33
|
-
}
|
|
34
|
-
else if ('url' in serverConfig) {
|
|
35
|
-
mcpServers[name] = { url: serverConfig.url };
|
|
36
|
-
}
|
|
95
|
+
mcpServers[name] = buildStandardServerEntry(serverConfig);
|
|
37
96
|
}
|
|
38
97
|
return JSON.stringify({ mcpServers }, null, 2) + '\n';
|
|
39
98
|
}
|
|
@@ -42,25 +101,12 @@ export class StandardMcpStrategy {
|
|
|
42
101
|
try {
|
|
43
102
|
const config = JSON.parse(content), servers = config.mcpServers ?? {};
|
|
44
103
|
for (const [name, server] of Object.entries(servers)) {
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
const serverConfig = {
|
|
48
|
-
command: String(s.command),
|
|
49
|
-
};
|
|
50
|
-
if (Array.isArray(s.args) && s.args.length > 0) {
|
|
51
|
-
serverConfig.args = s.args.map(String);
|
|
52
|
-
}
|
|
53
|
-
if (typeof s.env === 'object' && s.env !== null && Object.keys(s.env).length > 0) {
|
|
54
|
-
serverConfig.env = Object.fromEntries(Object.entries(s.env).map(([k, v]) => [k, String(v)]));
|
|
55
|
-
}
|
|
56
|
-
mcp[name] = serverConfig;
|
|
57
|
-
}
|
|
58
|
-
else if (s.url) {
|
|
59
|
-
mcp[name] = { url: String(s.url) };
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
104
|
+
const serverConfig = parseStandardServerEntry(server);
|
|
105
|
+
if (!serverConfig) {
|
|
62
106
|
warnings.push(`Skipping MCP server "${name}": unknown format`);
|
|
107
|
+
continue;
|
|
63
108
|
}
|
|
109
|
+
mcp[name] = serverConfig;
|
|
64
110
|
}
|
|
65
111
|
}
|
|
66
112
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-mcp.js","sourceRoot":"","sources":["../../../../src/editors/strategies/shared/standard-mcp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"standard-mcp.js","sourceRoot":"","sources":["../../../../src/editors/strategies/shared/standard-mcp.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAyB1D,MAAM,gBAAgB,GAAG,CAAE,KAAK,CAAW,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CACrC,YAA6B,EAC7B,UAAsC,EAAE;IAExC,MAAM,MAAM,GAA4B,EAAE,EACpC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAE9C,IAAI,SAAS,IAAI,YAAY,EAAE,CAAC;QAC7B,IAAI,cAAc,EAAE,CAAC;YAClB,MAAM,CAAC,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC;QACtC,CAAC;QACD,MAAM,CAAC,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC;QAEtC,IAAI,YAAY,CAAC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrD,MAAM,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;QACnC,CAAC;QACD,IAAI,YAAY,CAAC,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChE,MAAM,CAAC,GAAG,GAAG,YAAY,CAAC,GAAG,CAAC;QACjC,CAAC;QAED,OAAO,MAAM,CAAC;IACjB,CAAC;IAED,IAAI,cAAc,EAAE,CAAC;QAClB,MAAM,CAAC,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;IACrC,CAAC;IACD,MAAM,CAAC,OAAO,CAA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