agent-switchboard 0.2.2 → 0.3.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 +68 -42
- package/dist/agents/registry.d.ts +0 -6
- package/dist/agents/registry.js +3 -13
- package/dist/agents/registry.js.map +1 -1
- package/dist/agents/trae.d.ts +16 -0
- package/dist/agents/trae.js +36 -0
- package/dist/agents/trae.js.map +1 -0
- package/dist/commands/distribution.d.ts +3 -4
- package/dist/commands/distribution.js +18 -116
- package/dist/commands/distribution.js.map +1 -1
- package/dist/config/application-config.d.ts +1 -1
- package/dist/config/application-config.js +2 -10
- package/dist/config/application-config.js.map +1 -1
- package/dist/config/mcp-config.js +1 -3
- package/dist/config/mcp-config.js.map +1 -1
- package/dist/config/paths.d.ts +24 -3
- package/dist/config/paths.js +63 -5
- package/dist/config/paths.js.map +1 -1
- package/dist/config/schemas.d.ts +331 -43
- package/dist/config/schemas.js +109 -15
- package/dist/config/schemas.js.map +1 -1
- package/dist/config/switchboard-config.js +0 -1
- package/dist/config/switchboard-config.js.map +1 -1
- package/dist/extensions/api.d.ts +49 -0
- package/dist/extensions/api.js +41 -0
- package/dist/extensions/api.js.map +1 -0
- package/dist/extensions/loader.d.ts +17 -0
- package/dist/extensions/loader.js +73 -0
- package/dist/extensions/loader.js.map +1 -0
- package/dist/hooks/distribution.js +1 -16
- package/dist/hooks/distribution.js.map +1 -1
- package/dist/index.js +59 -113
- package/dist/index.js.map +1 -1
- package/dist/library/distribute-bundle.js +1 -19
- package/dist/library/distribute-bundle.js.map +1 -1
- package/dist/library/fs.d.ts +12 -0
- package/dist/library/fs.js +81 -0
- package/dist/library/fs.js.map +1 -1
- package/dist/library/sources.d.ts +6 -1
- package/dist/library/sources.js +73 -16
- package/dist/library/sources.js.map +1 -1
- package/dist/rules/agents.d.ts +0 -4
- package/dist/rules/agents.js +0 -8
- package/dist/rules/agents.js.map +1 -1
- package/dist/rules/distribution.d.ts +1 -2
- package/dist/rules/distribution.js +20 -71
- package/dist/rules/distribution.js.map +1 -1
- package/dist/skills/distribution.d.ts +0 -22
- package/dist/skills/distribution.js +84 -157
- package/dist/skills/distribution.js.map +1 -1
- package/dist/skills/importer.js +2 -33
- package/dist/skills/importer.js.map +1 -1
- package/dist/subagents/codex-distribute.d.ts +13 -0
- package/dist/subagents/codex-distribute.js +273 -0
- package/dist/subagents/codex-distribute.js.map +1 -0
- package/dist/subagents/distribution.d.ts +3 -4
- package/dist/subagents/distribution.js +30 -410
- package/dist/subagents/distribution.js.map +1 -1
- package/dist/targets/builtin/claude-code.d.ts +2 -0
- package/dist/targets/builtin/claude-code.js +73 -0
- package/dist/targets/builtin/claude-code.js.map +1 -0
- package/dist/targets/builtin/claude-desktop.d.ts +2 -0
- package/dist/targets/builtin/claude-desktop.js +10 -0
- package/dist/targets/builtin/claude-desktop.js.map +1 -0
- package/dist/targets/builtin/codex.d.ts +3 -0
- package/dist/targets/builtin/codex.js +57 -0
- package/dist/targets/builtin/codex.js.map +1 -0
- package/dist/targets/builtin/common.d.ts +22 -0
- package/dist/targets/builtin/common.js +55 -0
- package/dist/targets/builtin/common.js.map +1 -0
- package/dist/targets/builtin/cursor.d.ts +2 -0
- package/dist/targets/builtin/cursor.js +95 -0
- package/dist/targets/builtin/cursor.js.map +1 -0
- package/dist/targets/builtin/gemini.d.ts +2 -0
- package/dist/targets/builtin/gemini.js +62 -0
- package/dist/targets/builtin/gemini.js.map +1 -0
- package/dist/targets/builtin/index.d.ts +10 -0
- package/dist/targets/builtin/index.js +19 -0
- package/dist/targets/builtin/index.js.map +1 -0
- package/dist/targets/builtin/opencode.d.ts +2 -0
- package/dist/targets/builtin/opencode.js +67 -0
- package/dist/targets/builtin/opencode.js.map +1 -0
- package/dist/targets/builtin/trae.d.ts +3 -0
- package/dist/targets/builtin/trae.js +54 -0
- package/dist/targets/builtin/trae.js.map +1 -0
- package/dist/targets/dsl/compiler.d.ts +13 -0
- package/dist/targets/dsl/compiler.js +215 -0
- package/dist/targets/dsl/compiler.js.map +1 -0
- package/dist/targets/dsl/index.d.ts +2 -0
- package/dist/targets/dsl/index.js +3 -0
- package/dist/targets/dsl/index.js.map +1 -0
- package/dist/targets/dsl/transforms.d.ts +77 -0
- package/dist/targets/dsl/transforms.js +159 -0
- package/dist/targets/dsl/transforms.js.map +1 -0
- package/dist/targets/init.d.ts +14 -0
- package/dist/targets/init.js +28 -0
- package/dist/targets/init.js.map +1 -0
- package/dist/targets/registry.d.ts +36 -0
- package/dist/targets/registry.js +97 -0
- package/dist/targets/registry.js.map +1 -0
- package/dist/targets/types.d.ts +91 -0
- package/dist/targets/types.js +28 -0
- package/dist/targets/types.js.map +1 -0
- package/dist/ui/plugin-ui.d.ts +1 -1
- package/dist/ui/plugin-ui.js +5 -12
- package/dist/ui/plugin-ui.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,17 +30,17 @@ Library entries are agent-agnostic Markdown files (or directories for skills, JS
|
|
|
30
30
|
|
|
31
31
|
## Compatibility
|
|
32
32
|
|
|
33
|
-
| Feature | Claude Code | Codex | Cursor | Gemini | OpenCode | Claude Desktop |
|
|
34
|
-
|
|
35
|
-
| MCP servers | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
|
36
|
-
| Project-level MCP| ✓ | ✓ | ✓ | ✓ | ✓ | |
|
|
37
|
-
| Rules | ✓ | ✓ | ✓ mdc | ✓ | ✓ | |
|
|
38
|
-
| Commands | ✓ | ✓\* | ✓ | ✓ | ✓ | |
|
|
39
|
-
| Agents | ✓ |
|
|
40
|
-
| Skills | ✓ | ✓ | ✓ | ✓ | ✓ | |
|
|
41
|
-
| Hooks | ✓ | | | | | |
|
|
42
|
-
|
|
43
|
-
\* Codex commands use deprecated `~/.codex/prompts/`; prefer skills instead.
|
|
33
|
+
| Feature | Claude Code | Codex | Cursor | Gemini | OpenCode | Trae | Claude Desktop |
|
|
34
|
+
|:-----------------|:-----------:|:-----:|:------:|:------:|:--------:|:----:|:--------------:|
|
|
35
|
+
| MCP servers | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
|
36
|
+
| Project-level MCP| ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
|
|
37
|
+
| Rules | ✓ | ✓ | ✓ mdc | ✓ | ✓ | ✓ | |
|
|
38
|
+
| Commands | ✓ | ✓\* | ✓ | ✓ | ✓ | | |
|
|
39
|
+
| Agents | ✓ | ✓ | ✓ | | ✓ | | |
|
|
40
|
+
| Skills | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
|
|
41
|
+
| Hooks | ✓ | | | | | | |
|
|
42
|
+
|
|
43
|
+
\* Codex commands use deprecated `~/.codex/prompts/`; prefer skills instead. Trae column applies to both `trae` and `trae-cn` variants.
|
|
44
44
|
|
|
45
45
|
Cursor rules are composed into a single `asb-rules.mdc` file at `~/.cursor/rules/` with `alwaysApply: true`.
|
|
46
46
|
|
|
@@ -94,8 +94,8 @@ Library content lives under `~/.agent-switchboard/` and agent configs are update
|
|
|
94
94
|
| `asb plugin list` | List all discovered plugins and their states |
|
|
95
95
|
| `asb plugin info <ref>` | Show plugin details and components |
|
|
96
96
|
| `asb plugin enable <ref>` | Enable a plugin |
|
|
97
|
-
| `asb plugin disable <ref>` |
|
|
98
|
-
| `asb plugin uninstall <ref>` |
|
|
97
|
+
| `asb plugin disable <ref>` | Remove a plugin from the enabled list |
|
|
98
|
+
| `asb plugin uninstall <ref>` | Alias for `disable` |
|
|
99
99
|
| `asb plugin marketplace add` | Add a plugin source (local path or git URL) |
|
|
100
100
|
| `asb plugin marketplace remove` | Remove a plugin source |
|
|
101
101
|
| `asb plugin marketplace list` | List configured plugin sources |
|
|
@@ -121,21 +121,18 @@ includeDelimiters = false
|
|
|
121
121
|
[commands]
|
|
122
122
|
enabled = ["docs", "deploy"]
|
|
123
123
|
|
|
124
|
+
[plugins]
|
|
125
|
+
enabled = ["context7", "plugin-a@team-lib"]
|
|
126
|
+
|
|
124
127
|
[plugins.sources]
|
|
125
|
-
context7 = "/path/to/context7-plugin"
|
|
126
128
|
team-lib = "https://github.com/org/team-library"
|
|
127
|
-
|
|
128
|
-
[plugins.enabled]
|
|
129
|
-
context7 = true
|
|
130
|
-
"plugin-a@team-lib" = true
|
|
131
|
-
"plugin-b@team-lib" = false
|
|
132
129
|
```
|
|
133
130
|
|
|
134
|
-
Supported application IDs: `claude-code`, `claude-desktop`, `codex`, `cursor`, `gemini`, `opencode`.
|
|
131
|
+
Supported application IDs: `claude-code`, `claude-desktop`, `codex`, `cursor`, `gemini`, `opencode`, `trae`, `trae-cn`.
|
|
135
132
|
|
|
136
|
-
|
|
133
|
+
All entry-level sections (`rules`, `commands`, `agents`, `skills`, `hooks`, `plugins`) use `enabled = [...]` where array order defines composition priority. Plugin references in `enabled` arrays use `plugin:bareId` or `plugin@source:bareId` syntax.
|
|
137
134
|
|
|
138
|
-
`[plugins.
|
|
135
|
+
The `[plugins.sources]` sub-table declares explicit plugin locations. Local plugins in `~/.asb/plugins/` are auto-discovered without configuration.
|
|
139
136
|
|
|
140
137
|
### Per-Application Overrides
|
|
141
138
|
|
|
@@ -225,6 +222,8 @@ The interactive selector lets you **reorder** snippets. For most agents, rules a
|
|
|
225
222
|
| Cursor | `~/.cursor/rules/asb-rules.mdc` | `<project>/.cursor/rules/asb-rules.mdc` |
|
|
226
223
|
| Gemini | `~/.gemini/AGENTS.md` | `<project>/.gemini/AGENTS.md` |
|
|
227
224
|
| OpenCode | `~/.config/opencode/AGENTS.md` | `<project>/AGENTS.md` |
|
|
225
|
+
| Trae | `~/.trae/user_rules/asb-rules.md` | `<project>/.trae/rules/asb-rules.md` |
|
|
226
|
+
| Trae-CN | `~/.trae-cn/user_rules/asb-rules.md` | `<project>/.trae/rules/asb-rules.md` |
|
|
228
227
|
|
|
229
228
|
### Commands
|
|
230
229
|
|
|
@@ -245,7 +244,7 @@ Same format as commands, stored in `~/.agent-switchboard/agents/`.
|
|
|
245
244
|
asb agent load claude-code # import from ~/.claude/agents/
|
|
246
245
|
```
|
|
247
246
|
|
|
248
|
-
Platforms: `claude-code`, `
|
|
247
|
+
Platforms: `claude-code`, `codex`, `cursor`, `opencode`.
|
|
249
248
|
|
|
250
249
|
### Skills
|
|
251
250
|
|
|
@@ -283,35 +282,62 @@ Bundle scripts are copied to `~/.claude/hooks/asb/<id>/` and the `${HOOK_DIR}` p
|
|
|
283
282
|
|
|
284
283
|
## Plugins
|
|
285
284
|
|
|
286
|
-
|
|
285
|
+
A plugin bundles related capabilities (rules, commands, agents, skills, hooks, MCP servers) into a single directory that can be enabled/disabled as a unit. Instead of managing dozens of individual files in `~/.agent-switchboard/`, you point ASB at a plugin and get all its components at once.
|
|
286
|
+
|
|
287
|
+
### Plugin Structure
|
|
288
|
+
|
|
289
|
+
A plugin is a directory with component subdirectories and an optional manifest:
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
my-plugin/
|
|
293
|
+
├── .claude-plugin/
|
|
294
|
+
│ └── plugin.json # optional metadata (name, version, description)
|
|
295
|
+
├── rules/ # rule .md files
|
|
296
|
+
├── commands/ # command .md files
|
|
297
|
+
├── agents/ # agent .md files
|
|
298
|
+
├── skills/ # skill subdirectories (each with SKILL.md)
|
|
299
|
+
├── hooks/ # hook .json files or bundles
|
|
300
|
+
└── .mcp.json # MCP server definitions
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
No manifest is required. A bare directory with just `rules/` and `skills/` subdirectories works as an informal plugin. Adding `.claude-plugin/plugin.json` provides name, version, and description metadata. This format is compatible with Claude Code's plugin system (see `docs/claude-marketplace-format.md` for the full spec).
|
|
304
|
+
|
|
305
|
+
### Sources
|
|
306
|
+
|
|
307
|
+
Plugin sources are declared in `[plugins.sources]`:
|
|
308
|
+
|
|
309
|
+
```toml
|
|
310
|
+
[plugins.sources]
|
|
311
|
+
my-plugin = "/path/to/my-plugin"
|
|
312
|
+
team-lib = "https://github.com/org/team-library"
|
|
313
|
+
mono-sub = "https://github.com/org/monorepo/tree/main/plugins/my-plugin"
|
|
314
|
+
```
|
|
287
315
|
|
|
288
|
-
|
|
289
|
-
- **Git URL** -- a GitHub repository (cloned automatically)
|
|
290
|
-
- **GitHub tree URL** -- a subdirectory within a monorepo
|
|
316
|
+
Local plugins placed in `~/.asb/plugins/` are auto-discovered without explicit configuration.
|
|
291
317
|
|
|
292
318
|
ASB auto-detects two source kinds:
|
|
293
319
|
|
|
294
|
-
| Kind | Detection | Structure
|
|
295
|
-
|
|
296
|
-
| `marketplace` | Contains `.claude-plugin/marketplace.json` | Multiple plugins, each in its own subdirectory
|
|
297
|
-
| `plugin` | Everything else | Single plugin
|
|
320
|
+
| Kind | Detection | Structure |
|
|
321
|
+
|:--------------|:-------------------------------------------|:-----------------------------------------------|
|
|
322
|
+
| `marketplace` | Contains `.claude-plugin/marketplace.json` | Multiple plugins, each in its own subdirectory |
|
|
323
|
+
| `plugin` | Everything else | Single plugin (with or without `plugin.json`) |
|
|
298
324
|
|
|
299
|
-
|
|
325
|
+
### CLI
|
|
300
326
|
|
|
301
327
|
```bash
|
|
302
|
-
asb plugin marketplace add /path/to/my-plugin #
|
|
303
|
-
asb plugin marketplace add https://github.com/org/repo # git
|
|
304
|
-
asb plugin marketplace list
|
|
305
|
-
asb plugin marketplace remove my-plugin
|
|
306
|
-
|
|
307
|
-
asb plugin enable context7 # activate
|
|
308
|
-
asb plugin disable context7 #
|
|
309
|
-
asb plugin uninstall context7 #
|
|
328
|
+
asb plugin marketplace add /path/to/my-plugin # register source
|
|
329
|
+
asb plugin marketplace add https://github.com/org/repo # git source
|
|
330
|
+
asb plugin marketplace list # list sources
|
|
331
|
+
asb plugin marketplace remove my-plugin # remove source
|
|
332
|
+
|
|
333
|
+
asb plugin enable context7 # activate (all components enter distribution)
|
|
334
|
+
asb plugin disable context7 # remove from the enabled list
|
|
335
|
+
asb plugin uninstall context7 # alias for disable
|
|
310
336
|
asb plugin list # show all discovered plugins
|
|
311
|
-
asb plugin info context7 # show plugin details
|
|
337
|
+
asb plugin info context7 # show plugin details + components
|
|
312
338
|
```
|
|
313
339
|
|
|
314
|
-
|
|
340
|
+
Enabled plugin components are expanded into entry-level `enabled` arrays during `asb sync`. Components appear with a namespace prefix (e.g. `context7:docs-researcher`) and can be individually controlled via per-application overrides.
|
|
315
341
|
|
|
316
342
|
## Sync
|
|
317
343
|
|
|
@@ -15,9 +15,3 @@ export declare function getAgentById(id: string): AgentAdapter;
|
|
|
15
15
|
* @returns Array of agent IDs
|
|
16
16
|
*/
|
|
17
17
|
export declare function supportedAgentIds(): string[];
|
|
18
|
-
/**
|
|
19
|
-
* Register a new agent adapter
|
|
20
|
-
* Used for dynamic registration or testing
|
|
21
|
-
* @param adapter - Agent adapter to register
|
|
22
|
-
*/
|
|
23
|
-
export declare function registerAgent(adapter: AgentAdapter): void;
|
package/dist/agents/registry.js
CHANGED
|
@@ -8,6 +8,7 @@ import { CodexAgent } from './codex.js';
|
|
|
8
8
|
import { CursorAgent } from './cursor.js';
|
|
9
9
|
import { GeminiAgent } from './gemini.js';
|
|
10
10
|
import { OpencodeAgent } from './opencode.js';
|
|
11
|
+
import { TraeAgent } from './trae.js';
|
|
11
12
|
/**
|
|
12
13
|
* Registry of all available agent adapters
|
|
13
14
|
* Add new adapters here when implemented
|
|
@@ -19,6 +20,8 @@ const agents = [
|
|
|
19
20
|
new CursorAgent(),
|
|
20
21
|
new GeminiAgent(),
|
|
21
22
|
new OpencodeAgent(),
|
|
23
|
+
new TraeAgent('trae'),
|
|
24
|
+
new TraeAgent('trae-cn'),
|
|
22
25
|
];
|
|
23
26
|
/**
|
|
24
27
|
* Get an agent adapter by its ID
|
|
@@ -40,17 +43,4 @@ export function getAgentById(id) {
|
|
|
40
43
|
export function supportedAgentIds() {
|
|
41
44
|
return agents.map((a) => a.id);
|
|
42
45
|
}
|
|
43
|
-
/**
|
|
44
|
-
* Register a new agent adapter
|
|
45
|
-
* Used for dynamic registration or testing
|
|
46
|
-
* @param adapter - Agent adapter to register
|
|
47
|
-
*/
|
|
48
|
-
export function registerAgent(adapter) {
|
|
49
|
-
// Check if already registered
|
|
50
|
-
const exists = agents.find((a) => a.id === adapter.id);
|
|
51
|
-
if (exists) {
|
|
52
|
-
throw new Error(`Agent ${adapter.id} is already registered`);
|
|
53
|
-
}
|
|
54
|
-
agents.push(adapter);
|
|
55
|
-
}
|
|
56
46
|
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/agents/registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/agents/registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,GAAmB;IAC7B,IAAI,eAAe,EAAE;IACrB,IAAI,kBAAkB,EAAE;IACxB,IAAI,UAAU,EAAE;IAChB,IAAI,WAAW,EAAE;IACjB,IAAI,WAAW,EAAE;IACjB,IAAI,aAAa,EAAE;IACnB,IAAI,SAAS,CAAC,MAAM,CAAC;IACrB,IAAI,SAAS,CAAC,SAAS,CAAC;CACzB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,EAAU;IACrC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,sBAAsB,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,uBAAuB,iBAAiB,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAChG,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type TraeVariant } from '../config/paths.js';
|
|
2
|
+
import type { McpServer } from '../config/schemas.js';
|
|
3
|
+
import type { AgentAdapter } from './adapter.js';
|
|
4
|
+
export declare class TraeAgent implements AgentAdapter {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
private readonly variant;
|
|
7
|
+
constructor(variant: TraeVariant);
|
|
8
|
+
configPath(): string;
|
|
9
|
+
projectConfigPath(projectRoot: string): string;
|
|
10
|
+
applyConfig(config: {
|
|
11
|
+
mcpServers: Record<string, Omit<McpServer, 'enabled'>>;
|
|
12
|
+
}): void;
|
|
13
|
+
applyProjectConfig(projectRoot: string, config: {
|
|
14
|
+
mcpServers: Record<string, Omit<McpServer, 'enabled'>>;
|
|
15
|
+
}): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { getProjectTraeDir, getTraeConfigPath } from '../config/paths.js';
|
|
4
|
+
import { loadJsonFile, mergeMcpIntoAgent, sanitizeServerKeys, saveJsonFile, } from './json-utils.js';
|
|
5
|
+
export class TraeAgent {
|
|
6
|
+
id;
|
|
7
|
+
variant;
|
|
8
|
+
constructor(variant) {
|
|
9
|
+
this.variant = variant;
|
|
10
|
+
this.id = variant;
|
|
11
|
+
}
|
|
12
|
+
configPath() {
|
|
13
|
+
return getTraeConfigPath(this.variant);
|
|
14
|
+
}
|
|
15
|
+
projectConfigPath(projectRoot) {
|
|
16
|
+
return path.join(getProjectTraeDir(projectRoot), 'mcp.json');
|
|
17
|
+
}
|
|
18
|
+
applyConfig(config) {
|
|
19
|
+
const configPath = this.configPath();
|
|
20
|
+
const agentConfig = loadJsonFile(configPath, { mcpServers: {} });
|
|
21
|
+
const servers = sanitizeServerKeys(config.mcpServers);
|
|
22
|
+
const merged = mergeMcpIntoAgent(agentConfig, servers);
|
|
23
|
+
saveJsonFile(configPath, merged);
|
|
24
|
+
}
|
|
25
|
+
applyProjectConfig(projectRoot, config) {
|
|
26
|
+
const configPath = this.projectConfigPath(projectRoot);
|
|
27
|
+
const existing = loadJsonFile(configPath, { mcpServers: {} });
|
|
28
|
+
const servers = sanitizeServerKeys(config.mcpServers);
|
|
29
|
+
const merged = mergeMcpIntoAgent(existing, servers);
|
|
30
|
+
const dir = path.dirname(configPath);
|
|
31
|
+
if (!fs.existsSync(dir))
|
|
32
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
33
|
+
saveJsonFile(configPath, merged);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=trae.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trae.js","sourceRoot":"","sources":["../../src/agents/trae.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,M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CAAC,QAAQ,EAAE,OAAiC,CAAC,CAAC;QAC9E,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACrC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAChE,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { ConfigScope } from '../config/scope.js';
|
|
2
2
|
import { type DistributeOutcome } from '../library/distribute.js';
|
|
3
|
-
export type CommandPlatform = 'claude-code' | 'codex' | 'cursor' | 'gemini' | 'opencode';
|
|
4
3
|
export interface CommandDistributionResult {
|
|
5
|
-
platform:
|
|
4
|
+
platform: string;
|
|
6
5
|
filePath: string;
|
|
7
6
|
status: 'written' | 'skipped' | 'error';
|
|
8
7
|
reason?: string;
|
|
9
8
|
error?: string;
|
|
10
9
|
}
|
|
11
|
-
export type CommandDistributionOutcome = DistributeOutcome<
|
|
12
|
-
export declare function resolveCommandFilePath(platform:
|
|
10
|
+
export type CommandDistributionOutcome = DistributeOutcome<string>;
|
|
11
|
+
export declare function resolveCommandFilePath(platform: string, id: string, scope?: ConfigScope): string;
|
|
13
12
|
export declare function distributeCommands(scope?: ConfigScope): CommandDistributionOutcome;
|
|
@@ -1,123 +1,25 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { stringify as toToml } from '@iarna/toml';
|
|
3
|
-
import { getClaudeDir, getCodexDir, getCursorDir, getGeminiDir, getOpencodePath, getProjectClaudeDir, getProjectCursorDir, getProjectGeminiDir, getProjectOpencodePath, } from '../config/paths.js';
|
|
4
2
|
import { distributeLibrary, } from '../library/distribute.js';
|
|
5
3
|
import { loadLibraryStateSectionForApplication } from '../library/state.js';
|
|
6
|
-
import {
|
|
4
|
+
import { getTargetById, getTargetsForSection } from '../targets/registry.js';
|
|
7
5
|
import { loadCommandLibrary } from './library.js';
|
|
8
|
-
/**
|
|
9
|
-
* Map platform to agent ID for per-agent configuration lookup
|
|
10
|
-
*/
|
|
11
|
-
function platformToAgentId(platform) {
|
|
12
|
-
return platform;
|
|
13
|
-
}
|
|
14
6
|
export function resolveCommandFilePath(platform, id, scope) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const projectRoot = scope?.project?.trim();
|
|
19
|
-
switch (platform) {
|
|
20
|
-
case 'claude-code': {
|
|
21
|
-
if (projectRoot && projectRoot.length > 0) {
|
|
22
|
-
return path.join(getProjectClaudeDir(projectRoot), 'commands');
|
|
23
|
-
}
|
|
24
|
-
return path.join(getClaudeDir(), 'commands');
|
|
25
|
-
}
|
|
26
|
-
case 'codex': {
|
|
27
|
-
return path.join(getCodexDir(), 'prompts');
|
|
28
|
-
}
|
|
29
|
-
case 'cursor': {
|
|
30
|
-
if (projectRoot && projectRoot.length > 0) {
|
|
31
|
-
return path.join(getProjectCursorDir(projectRoot), 'commands');
|
|
32
|
-
}
|
|
33
|
-
return path.join(getCursorDir(), 'commands');
|
|
34
|
-
}
|
|
35
|
-
case 'gemini': {
|
|
36
|
-
if (projectRoot && projectRoot.length > 0) {
|
|
37
|
-
return path.join(getProjectGeminiDir(projectRoot), 'commands');
|
|
38
|
-
}
|
|
39
|
-
return path.join(getGeminiDir(), 'commands');
|
|
40
|
-
}
|
|
41
|
-
case 'opencode': {
|
|
42
|
-
if (projectRoot && projectRoot.length > 0) {
|
|
43
|
-
return getProjectOpencodePath(projectRoot, 'command');
|
|
44
|
-
}
|
|
45
|
-
return getOpencodePath('command');
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function getCommandFilename(platform, id) {
|
|
50
|
-
return platform === 'gemini' ? `${id}.toml` : `${id}.md`;
|
|
51
|
-
}
|
|
52
|
-
function buildFrontmatterForClaude(entry) {
|
|
53
|
-
const base = {};
|
|
54
|
-
if (entry.metadata.description)
|
|
55
|
-
base.description = entry.metadata.description;
|
|
56
|
-
const extras = entry.metadata.extras;
|
|
57
|
-
const cc = extras?.['claude-code'] ?? undefined;
|
|
58
|
-
if (cc && typeof cc === 'object') {
|
|
59
|
-
for (const [k, v] of Object.entries(cc))
|
|
60
|
-
base[k] = v;
|
|
61
|
-
}
|
|
62
|
-
return base;
|
|
63
|
-
}
|
|
64
|
-
function buildFrontmatterForOpencode(entry) {
|
|
65
|
-
const extras = entry.metadata.extras;
|
|
66
|
-
const opencode = extras?.opencode ?? undefined;
|
|
67
|
-
const base = {};
|
|
68
|
-
if (entry.metadata.description)
|
|
69
|
-
base.description = entry.metadata.description;
|
|
70
|
-
if (opencode && typeof opencode === 'object') {
|
|
71
|
-
for (const [k, v] of Object.entries(opencode))
|
|
72
|
-
base[k] = v;
|
|
73
|
-
}
|
|
74
|
-
return base;
|
|
75
|
-
}
|
|
76
|
-
function renderForPlatform(platform, entry) {
|
|
77
|
-
switch (platform) {
|
|
78
|
-
case 'claude-code': {
|
|
79
|
-
const fm = buildFrontmatterForClaude(entry);
|
|
80
|
-
return wrapFrontmatter(fm, entry.content);
|
|
81
|
-
}
|
|
82
|
-
case 'codex': {
|
|
83
|
-
const desc = entry.metadata.description?.trim();
|
|
84
|
-
const header = desc && desc.length > 0 ? `<!-- ${desc} -->\n\n` : '';
|
|
85
|
-
return (`<!-- [deprecated] Codex custom prompts are deprecated. Consider migrating to skills: https://developers.openai.com/codex/skills -->\n\n` +
|
|
86
|
-
`${header}${entry.content.trimStart()}`);
|
|
87
|
-
}
|
|
88
|
-
case 'gemini': {
|
|
89
|
-
const extras = entry.metadata.extras;
|
|
90
|
-
const g = extras?.gemini ?? undefined;
|
|
91
|
-
const obj = {
|
|
92
|
-
prompt: entry.content.trimStart(),
|
|
93
|
-
};
|
|
94
|
-
if (entry.metadata.description)
|
|
95
|
-
obj.description = entry.metadata.description;
|
|
96
|
-
if (g && typeof g === 'object') {
|
|
97
|
-
for (const [k, v] of Object.entries(g))
|
|
98
|
-
obj[k] = v;
|
|
99
|
-
}
|
|
100
|
-
// biome-ignore lint/suspicious/noExplicitAny: TOML stringify expects JSON-like values; cast is safe here
|
|
101
|
-
return toToml(obj);
|
|
102
|
-
}
|
|
103
|
-
case 'opencode': {
|
|
104
|
-
const fm = buildFrontmatterForOpencode(entry);
|
|
105
|
-
return wrapFrontmatter(fm, entry.content);
|
|
106
|
-
}
|
|
107
|
-
case 'cursor': {
|
|
108
|
-
return `${entry.content.trimEnd()}\n`;
|
|
109
|
-
}
|
|
7
|
+
const target = getTargetById(platform);
|
|
8
|
+
if (!target?.commands) {
|
|
9
|
+
throw new Error(`Unknown command platform: ${platform}`);
|
|
110
10
|
}
|
|
11
|
+
const h = target.commands;
|
|
12
|
+
return path.join(h.resolveTargetDir(scope), h.getFilename(id));
|
|
111
13
|
}
|
|
112
14
|
export function distributeCommands(scope) {
|
|
113
15
|
const entries = loadCommandLibrary();
|
|
114
16
|
const byId = new Map(entries.map((e) => [e.id, e]));
|
|
115
|
-
const
|
|
116
|
-
|
|
17
|
+
const targets = getTargetsForSection('commands');
|
|
18
|
+
const handlerMap = new Map(targets.map((t) => [t.id, t.commands]));
|
|
19
|
+
const platforms = targets.map((t) => t.id);
|
|
117
20
|
const cleanup = {
|
|
118
|
-
resolveTargetDir: (p) =>
|
|
21
|
+
resolveTargetDir: (p) => handlerMap.get(p).resolveTargetDir(scope),
|
|
119
22
|
extractId: (filename) => {
|
|
120
|
-
// Try both extensions since we don't know platform in extractId
|
|
121
23
|
if (filename.endsWith('.toml'))
|
|
122
24
|
return filename.slice(0, -5);
|
|
123
25
|
if (filename.endsWith('.md'))
|
|
@@ -125,10 +27,8 @@ export function distributeCommands(scope) {
|
|
|
125
27
|
return null;
|
|
126
28
|
},
|
|
127
29
|
};
|
|
128
|
-
// Filter entries based on per-agent configuration
|
|
129
30
|
const filterSelected = (platform, _allEntries) => {
|
|
130
|
-
const
|
|
131
|
-
const state = loadLibraryStateSectionForApplication('commands', agentId, scope);
|
|
31
|
+
const state = loadLibraryStateSectionForApplication('commands', platform, scope);
|
|
132
32
|
const activeIds = state.enabled;
|
|
133
33
|
const selected = [];
|
|
134
34
|
for (const id of activeIds) {
|
|
@@ -140,19 +40,21 @@ export function distributeCommands(scope) {
|
|
|
140
40
|
};
|
|
141
41
|
const outcome = distributeLibrary({
|
|
142
42
|
section: 'commands',
|
|
143
|
-
selected: entries,
|
|
43
|
+
selected: entries,
|
|
144
44
|
platforms,
|
|
145
|
-
resolveFilePath: (p, e) =>
|
|
146
|
-
|
|
45
|
+
resolveFilePath: (p, e) => {
|
|
46
|
+
const h = handlerMap.get(p);
|
|
47
|
+
return path.join(h.resolveTargetDir(scope), h.getFilename(e.id));
|
|
48
|
+
},
|
|
49
|
+
render: (p, e) => handlerMap.get(p).render(e),
|
|
147
50
|
getId: (e) => e.id,
|
|
148
51
|
cleanup,
|
|
149
52
|
scope,
|
|
150
53
|
filterSelected,
|
|
151
54
|
});
|
|
152
|
-
// Warn about Codex custom prompts deprecation
|
|
153
55
|
const codexWrites = outcome.results.filter((r) => r.platform === 'codex' && r.status === 'written');
|
|
154
56
|
if (codexWrites.length > 0) {
|
|
155
|
-
console.warn(
|
|
57
|
+
console.warn('[codex] Custom prompts are deprecated. Consider migrating to skills: https://developers.openai.com/codex/skills');
|
|
156
58
|
}
|
|
157
59
|
return outcome;
|
|
158
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distribution.js","sourceRoot":"","sources":["../../src/commands/distribution.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"distribution.js","sourceRoot":"","sources":["../../src/commands/distribution.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAIL,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qCAAqC,EAAE,MAAM,qBA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QACnE,CAAC;QACD,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9C,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE;QAClB,OAAO;QACP,KAAK;QACL,cAAc;KACf,CAA8C,CAAC;IAEhD,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CACxC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC,MAAM,KAAK,SAAS,CACxD,CAAC;IACF,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CACV,iHAAiH,CAClH,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -38,7 +38,7 @@ export declare function getApplicationsWithOverrides(config: SwitchboardConfig):
|
|
|
38
38
|
/**
|
|
39
39
|
* Resolve the effective enabled list for a section, merging:
|
|
40
40
|
* 1. Global `config.<section>.enabled`
|
|
41
|
-
* 2. Plugin expansion: `config.plugins.enabled`
|
|
41
|
+
* 2. Plugin expansion: `config.plugins.enabled` -> PluginIndex.expand -> per-section IDs
|
|
42
42
|
* 3. Plugin exclude: `config.plugins.exclude.<section>` removals
|
|
43
43
|
* 4. Per-application overrides (`add`/`remove`/`enabled`)
|
|
44
44
|
*
|
|
@@ -82,18 +82,10 @@ export function getApplicationsWithOverrides(config) {
|
|
|
82
82
|
return result;
|
|
83
83
|
}
|
|
84
84
|
// ── Plugin-aware effective config ──────────────────────────────────
|
|
85
|
-
/**
|
|
86
|
-
* Get enabled plugin refs from `plugins.enabled` boolean map (true keys only).
|
|
87
|
-
*/
|
|
88
|
-
function getEnabledPluginRefs(config) {
|
|
89
|
-
return Object.entries(config.plugins.enabled)
|
|
90
|
-
.filter(([, v]) => v === true)
|
|
91
|
-
.map(([k]) => k);
|
|
92
|
-
}
|
|
93
85
|
/**
|
|
94
86
|
* Resolve the effective enabled list for a section, merging:
|
|
95
87
|
* 1. Global `config.<section>.enabled`
|
|
96
|
-
* 2. Plugin expansion: `config.plugins.enabled`
|
|
88
|
+
* 2. Plugin expansion: `config.plugins.enabled` -> PluginIndex.expand -> per-section IDs
|
|
97
89
|
* 3. Plugin exclude: `config.plugins.exclude.<section>` removals
|
|
98
90
|
* 4. Per-application overrides (`add`/`remove`/`enabled`)
|
|
99
91
|
*
|
|
@@ -104,7 +96,7 @@ export function resolveEffectiveSectionConfig(section, appId, scope) {
|
|
|
104
96
|
const layerOptions = scopeToLayerOptions(scope);
|
|
105
97
|
const { config } = loadMergedSwitchboardConfig(layerOptions);
|
|
106
98
|
const globalEnabled = [...config[section].enabled];
|
|
107
|
-
const enabledPluginRefs =
|
|
99
|
+
const { enabled: enabledPluginRefs } = config.plugins;
|
|
108
100
|
let merged;
|
|
109
101
|
if (enabledPluginRefs.length > 0) {
|
|
110
102
|
const index = buildPluginIndex(scope);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-config.js","sourceRoot":"","sources":["../../src/config/application-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,gBAAgB,EAA+B,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAGlE,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAQjD;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CACvC,IAAc,EACd,QAA+B;IAE/B,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAE3B,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpD,OAAO,QAAQ,CAAC,OAAO,CAAC;IAC1B,CAAC;IAED,IAAI,MAAM,GA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CAAC;QACvC,MAAM,WAAW,GAAI,OAAyB,EAAE,CAAC,aAAa,CAAC,CAAC;QAChE,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1C,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;YACxC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,aAAa,CAAC;IACzB,CAAC;IAED,MAAM,QAAQ,GAAG,sBAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAChE,OAAO;QACL,OAAO,EAAE,yBAAyB,CAAC,MAAM,EAAE,QAAQ,CAAC;KACrD,CAAC;AACJ,CAAC"}
|
|
@@ -62,9 +62,7 @@ export function loadMcpConfigWithPlugins() {
|
|
|
62
62
|
if (pluginIndex.mcpServers.length === 0)
|
|
63
63
|
return base;
|
|
64
64
|
const config = loadSwitchboardConfig();
|
|
65
|
-
const enabledPlugins = new Set(
|
|
66
|
-
.filter(([, v]) => v === true)
|
|
67
|
-
.map(([k]) => k));
|
|
65
|
+
const enabledPlugins = new Set(config.plugins.enabled);
|
|
68
66
|
const merged = { ...base.mcpServers };
|
|
69
67
|
for (const ps of pluginIndex.mcpServers) {
|
|
70
68
|
if (!(ps.serverId in merged) && enabledPlugins.has(ps.pluginId)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-config.js","sourceRoot":"","sources":["../../src/config/mcp-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAA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C,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;YACzD,MAAM,MAAM,GAAG,MAAiC,CAAC;YACjD,IAAI,SAAS,IAAI,MAAM,EAAE,CAAC;gBACxB,OAAO,MAAM,CAAC,OAAO,CAAC;gBACtB,OAAO,GAAG,IAAI,CAAC;YACjB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,KAAK,CAAC;QACf,CAAC;QAED,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5D,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjF,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CACb,wDAAwD,UAAU,KAAK,KAAK,CAAC,OAAO,EAAE,CACvF,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/config/paths.d.ts
CHANGED
|
@@ -55,9 +55,15 @@ export declare function getSkillsDir(): string;
|
|
|
55
55
|
*/
|
|
56
56
|
export declare function getHooksDir(): string;
|
|
57
57
|
/**
|
|
58
|
-
* Returns the directory
|
|
59
|
-
*
|
|
60
|
-
|
|
58
|
+
* Returns the plugins directory (~/.asb/plugins/).
|
|
59
|
+
* Local plugin sources can be placed here and referenced by short name.
|
|
60
|
+
*/
|
|
61
|
+
export declare function getPluginsDir(): string;
|
|
62
|
+
/**
|
|
63
|
+
* Returns the directory for remote source clones (~/.asb/plugins/.cache/).
|
|
64
|
+
* Migrates transparently from the legacy ~/.asb/marketplaces/ location.
|
|
65
|
+
* Without namespace: returns the base cache dir.
|
|
66
|
+
* With namespace: returns the namespace-specific dir.
|
|
61
67
|
*/
|
|
62
68
|
export declare function getSourceCacheDir(namespace?: string): string;
|
|
63
69
|
/**
|
|
@@ -95,4 +101,19 @@ export declare function getProjectOpencodePath(projectRoot: string, ...segments:
|
|
|
95
101
|
export declare function getClaudeJsonPath(): string;
|
|
96
102
|
export declare function getCodexConfigPath(): string;
|
|
97
103
|
export declare function getGeminiSettingsPath(): string;
|
|
104
|
+
export type TraeVariant = 'trae' | 'trae-cn';
|
|
105
|
+
/**
|
|
106
|
+
* Returns the VS Code-style User data directory for Trae.
|
|
107
|
+
* MCP config (mcp.json) and settings.json live here.
|
|
108
|
+
* - macOS: ~/Library/Application Support/{Trae|Trae CN}/
|
|
109
|
+
* - Linux: ~/.config/{Trae|Trae CN}/
|
|
110
|
+
* - Windows: %APPDATA%/{Trae|Trae CN}/
|
|
111
|
+
*/
|
|
112
|
+
export declare function getTraeUserDataDir(variant: TraeVariant): string;
|
|
113
|
+
/** Global MCP config: <UserDataDir>/User/mcp.json */
|
|
114
|
+
export declare function getTraeConfigPath(variant: TraeVariant): string;
|
|
115
|
+
/** Dotdir for rules and extensions: ~/.trae or ~/.trae-cn */
|
|
116
|
+
export declare function getTraeDataDir(variant: TraeVariant): string;
|
|
117
|
+
/** Project-scoped Trae directory (shared by both variants) */
|
|
118
|
+
export declare function getProjectTraeDir(projectRoot: string): string;
|
|
98
119
|
export declare function getClaudeDesktopConfigPath(): string;
|