agent-switchboard 0.1.3 → 0.1.5
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 +56 -12
- package/dist/agents/json-utils.js +5 -2
- package/dist/agents/json-utils.js.map +1 -1
- package/dist/commands/distribution.d.ts +3 -2
- package/dist/commands/distribution.js +28 -9
- package/dist/commands/distribution.js.map +1 -1
- package/dist/commands/inventory.d.ts +2 -1
- package/dist/commands/inventory.js +2 -2
- package/dist/commands/inventory.js.map +1 -1
- package/dist/config/layered-config.d.ts +27 -0
- package/dist/config/layered-config.js +132 -0
- package/dist/config/layered-config.js.map +1 -0
- package/dist/config/paths.d.ts +14 -4
- package/dist/config/paths.js +30 -6
- package/dist/config/paths.js.map +1 -1
- package/dist/config/schemas.d.ts +225 -23
- package/dist/config/schemas.js +41 -8
- package/dist/config/schemas.js.map +1 -1
- package/dist/config/scope.d.ts +6 -0
- package/dist/config/scope.js +17 -0
- package/dist/config/scope.js.map +1 -0
- package/dist/config/switchboard-config.d.ts +9 -1
- package/dist/config/switchboard-config.js +7 -22
- package/dist/config/switchboard-config.js.map +1 -1
- package/dist/index.js +218 -44
- package/dist/index.js.map +1 -1
- package/dist/library/distribute.d.ts +2 -0
- package/dist/library/distribute.js +2 -2
- package/dist/library/distribute.js.map +1 -1
- package/dist/library/state.d.ts +4 -3
- package/dist/library/state.js +40 -43
- package/dist/library/state.js.map +1 -1
- package/dist/rules/composer.d.ts +2 -1
- package/dist/rules/composer.js +9 -3
- package/dist/rules/composer.js.map +1 -1
- package/dist/rules/distribution.d.ts +3 -2
- package/dist/rules/distribution.js +32 -10
- package/dist/rules/distribution.js.map +1 -1
- package/dist/rules/inventory.d.ts +2 -1
- package/dist/rules/inventory.js +2 -2
- package/dist/rules/inventory.js.map +1 -1
- package/dist/rules/state.d.ts +4 -3
- package/dist/rules/state.js +39 -44
- package/dist/rules/state.js.map +1 -1
- package/dist/subagents/distribution.d.ts +3 -2
- package/dist/subagents/distribution.js +24 -7
- package/dist/subagents/distribution.js.map +1 -1
- package/dist/subagents/inventory.d.ts +2 -1
- package/dist/subagents/inventory.js +2 -2
- package/dist/subagents/inventory.js.map +1 -1
- package/dist/ui/command-ui.d.ts +2 -1
- package/dist/ui/command-ui.js +2 -1
- package/dist/ui/command-ui.js.map +1 -1
- package/dist/ui/fuzzy-multi-select.d.ts +18 -0
- package/dist/ui/fuzzy-multi-select.js +276 -0
- package/dist/ui/fuzzy-multi-select.js.map +1 -0
- package/dist/ui/library-selector.d.ts +2 -0
- package/dist/ui/library-selector.js +46 -30
- package/dist/ui/library-selector.js.map +1 -1
- package/dist/ui/rule-ui.d.ts +2 -1
- package/dist/ui/rule-ui.js +66 -54
- package/dist/ui/rule-ui.js.map +1 -1
- package/dist/ui/subagent-ui.d.ts +2 -1
- package/dist/ui/subagent-ui.js +2 -1
- package/dist/ui/subagent-ui.js.map +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -60,6 +60,40 @@ Toggle `rules.includeDelimiters` to `true` if you want each snippet surrounded b
|
|
|
60
60
|
|
|
61
61
|
Run `agent-switchboard mcp` again after updating the list.
|
|
62
62
|
|
|
63
|
+
### Layered configuration & scope
|
|
64
|
+
|
|
65
|
+
Agent Switchboard merges configuration from three TOML layers (higher priority wins):
|
|
66
|
+
|
|
67
|
+
- **User default**: `<ASB_HOME>/config.toml`
|
|
68
|
+
- **Profile**: `<ASB_HOME>/<profile>.toml`
|
|
69
|
+
- **Project**: `<project>/.asb.toml`
|
|
70
|
+
|
|
71
|
+
Every layer can define `[commands]`, `[subagents]`, and `[rules]` `active` lists. Use profiles to share team presets and project files to override per repository. The CLI honors these layers via scope flags:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Profile only
|
|
75
|
+
agent-switchboard command -p team
|
|
76
|
+
|
|
77
|
+
# Project only
|
|
78
|
+
agent-switchboard rule --project /path/to/repo
|
|
79
|
+
|
|
80
|
+
# Merge profile + project
|
|
81
|
+
agent-switchboard subagent -p team --project /path/to/repo
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`ASB_HOME` still defaults to `~/.agent-switchboard` but can be overridden through the environment variable.
|
|
85
|
+
|
|
86
|
+
Project-aware outputs (when using `--project <path>`):
|
|
87
|
+
- Rules: Codex writes `<project>/AGENTS.md`. Gemini writes `<project>/GEMINI.md` (or `<project>/AGENTS.md` if you configured Gemini CLI to read it). OpenCode writes `<project>/AGENTS.md`.
|
|
88
|
+
- Commands (project-level supported):
|
|
89
|
+
- Claude Code → `<project>/.claude/commands/`
|
|
90
|
+
- Gemini → `<project>/.gemini/commands/`
|
|
91
|
+
- OpenCode → `<project>/.opencode/command/`
|
|
92
|
+
- Codex → global only (`~/.codex/prompts/`)
|
|
93
|
+
- Subagents (project-level supported):
|
|
94
|
+
- Claude Code → `<project>/.claude/agents/`
|
|
95
|
+
- OpenCode → `<project>/.opencode/agent/`
|
|
96
|
+
|
|
63
97
|
## Rule Library
|
|
64
98
|
|
|
65
99
|
Rule snippets live in `~/.agent-switchboard/rules/` (respects `ASB_HOME`). Each snippet is a Markdown file and can include YAML frontmatter with `title`, `description`, `tags`, and `requires` fields. Example:
|
|
@@ -77,16 +111,16 @@ Keep commit messages scoped to the change.
|
|
|
77
111
|
|
|
78
112
|
### Selecting and Ordering Rules
|
|
79
113
|
|
|
80
|
-
Use the interactive selector to choose the active snippets and adjust their order:
|
|
114
|
+
Use the interactive selector (arrow keys, `Space` to toggle, just start typing to fuzzy filter) to choose the active snippets and adjust their order:
|
|
81
115
|
|
|
82
116
|
```bash
|
|
83
|
-
agent-switchboard rule
|
|
117
|
+
agent-switchboard rule [-p <profile>] [--project <path>]
|
|
84
118
|
```
|
|
85
119
|
|
|
86
|
-
Once confirmed, Agent Switchboard composes the merged Markdown, stores the active order, and writes the document to:
|
|
120
|
+
The selected order is saved back to the highest-priority layer (project, profile, then user) before distribution. Once confirmed, Agent Switchboard composes the merged Markdown, stores the active order, and writes the document to:
|
|
87
121
|
- `~/.claude/CLAUDE.md`
|
|
88
|
-
- `~/.codex/AGENTS.md`
|
|
89
|
-
- `~/.gemini/
|
|
122
|
+
- `~/.codex/AGENTS.md` (or `<project>/AGENTS.md` with `--project`)
|
|
123
|
+
- `~/.gemini/GEMINI.md`
|
|
90
124
|
- `~/.config/opencode/AGENTS.md` (or `%APPDATA%/opencode/AGENTS.md` on Windows)
|
|
91
125
|
|
|
92
126
|
Unsupportive agents such as Claude Desktop and Cursor are reported and left untouched. If you rerun the selector without changing the order, the tool refreshes the destination files to overwrite any manual edits.
|
|
@@ -96,7 +130,7 @@ Unsupportive agents such as Claude Desktop and Cursor are reported and left unto
|
|
|
96
130
|
See the full inventory, activation state, and per-agent sync timestamps:
|
|
97
131
|
|
|
98
132
|
```bash
|
|
99
|
-
agent-switchboard rule list
|
|
133
|
+
agent-switchboard rule list [-p <profile>] [--project <path>]
|
|
100
134
|
```
|
|
101
135
|
|
|
102
136
|
## Command Library
|
|
@@ -121,10 +155,10 @@ agent-switchboard command load <platform> [path] [-r]
|
|
|
121
155
|
### Select and Distribute
|
|
122
156
|
|
|
123
157
|
```bash
|
|
124
|
-
agent-switchboard command
|
|
158
|
+
agent-switchboard command [-p <profile>] [--project <path>]
|
|
125
159
|
```
|
|
126
160
|
|
|
127
|
-
|
|
161
|
+
The selector supports fuzzy filtering—type any part of a title, ID, or model name to narrow the list. Confirming selections saves them back into the highest-priority configuration layer before distribution. Adapters then write each selected command to the corresponding platform output in your user home (platform defaults), using the file format that platform expects. The frontmatter consists of the global `description` (if present) plus `extras.<platform>` written as-is.
|
|
128
162
|
|
|
129
163
|
Files are only rewritten when content changes.
|
|
130
164
|
|
|
@@ -132,7 +166,7 @@ Files are only rewritten when content changes.
|
|
|
132
166
|
|
|
133
167
|
```bash
|
|
134
168
|
# Inventory
|
|
135
|
-
agent-switchboard command list
|
|
169
|
+
agent-switchboard command list [-p <profile>] [--project <path>]
|
|
136
170
|
```
|
|
137
171
|
|
|
138
172
|
## Subagent Library
|
|
@@ -153,17 +187,27 @@ agent-switchboard subagent load <platform> [path] [-r]
|
|
|
153
187
|
### Select and Distribute
|
|
154
188
|
|
|
155
189
|
```bash
|
|
156
|
-
agent-switchboard subagent
|
|
190
|
+
agent-switchboard subagent [-p <profile>] [--project <path>]
|
|
157
191
|
```
|
|
158
192
|
|
|
159
|
-
|
|
193
|
+
Type to fuzzy filter the list, then confirm to persist the selection into the active configuration layer. Adapters write each selected subagent to the corresponding platform output in your user home (platform defaults), using the file format that platform expects. The frontmatter consists of the global `description` (if present) plus `extras.<platform>` written as-is. Platforms that do not accept subagent files are skipped with a hint.
|
|
160
194
|
|
|
161
195
|
### Inventory
|
|
162
196
|
|
|
163
197
|
```bash
|
|
164
|
-
agent-switchboard subagent list
|
|
198
|
+
agent-switchboard subagent list [-p <profile>] [--project <path>]
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Sync
|
|
202
|
+
|
|
203
|
+
After curating your `active` lists in the selectors, run the unified sync command to push rules, commands, and subagents to every supported agent directory:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
agent-switchboard sync [-p <profile>] [--project <path>]
|
|
165
207
|
```
|
|
166
208
|
|
|
209
|
+
The command merges the layered configuration, prints a warning that files will be overwritten without diffs, and rewrites the target files for each platform in place. Use profiles or project scopes to preview changes before applying them globally.
|
|
210
|
+
|
|
167
211
|
## Environment
|
|
168
212
|
|
|
169
213
|
- `ASB_HOME`: overrides `~/.agent-switchboard` for library/state files.
|
|
@@ -13,9 +13,12 @@ export function saveJsonFile(filePath, data) {
|
|
|
13
13
|
fs.writeFileSync(filePath, json, 'utf-8');
|
|
14
14
|
}
|
|
15
15
|
export function mergeMcpIntoAgent(agentConfig, mcpServers) {
|
|
16
|
-
if (Object.keys(mcpServers).length === 0)
|
|
17
|
-
return agentConfig;
|
|
18
16
|
const merged = { ...agentConfig };
|
|
17
|
+
// Empty selection means "disable all": clear the map to {}
|
|
18
|
+
if (Object.keys(mcpServers).length === 0) {
|
|
19
|
+
merged.mcpServers = {};
|
|
20
|
+
return merged;
|
|
21
|
+
}
|
|
19
22
|
if (!merged.mcpServers) {
|
|
20
23
|
merged.mcpServers = {};
|
|
21
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-utils.js","sourceRoot":"","sources":["../../src/agents/json-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AAIzB,MAAM,UAAU,YAAY,CAAmB,QAAgB,EAAE,QAAW;IAC1E,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC9C,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAM,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,QAAgB,EAAE,IAAY;IACzD,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;IAClD,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,WAA4B,EAC5B,UAAkC;IAElC,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC
|
|
1
|
+
{"version":3,"file":"json-utils.js","sourceRoot":"","sources":["../../src/agents/json-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AAIzB,MAAM,UAAU,YAAY,CAAmB,QAAgB,EAAE,QAAW;IAC1E,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC9C,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAM,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,QAAgB,EAAE,IAAY;IACzD,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;IAClD,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,WAA4B,EAC5B,UAAkC;IAElC,MAAM,MAAM,GAAoB,EAAE,GAAG,WAAW,EAAE,CAAC;IAEnD,2DAA2D;IAC3D,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,MAAM,CAAC,UAAU,GAAG,EAAE,CAAC;QACvB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACvB,MAAM,CAAC,UAAU,GAAG,EAAE,CAAC;IACzB,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC;IAEjC,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACxD,MAAM,QAAQ,GAAI,MAAM,CAAC,IAAI,CAA6B,IAAI,EAAE,CAAC;QACjE,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,GAAG,MAAM,EAAE,CAAC;IAC5C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ConfigScope } from '../config/scope.js';
|
|
1
2
|
import { type DistributeOutcome } from '../library/distribute.js';
|
|
2
3
|
export type CommandPlatform = 'claude-code' | 'codex' | 'gemini' | 'opencode';
|
|
3
4
|
export interface CommandDistributionResult {
|
|
@@ -8,5 +9,5 @@ export interface CommandDistributionResult {
|
|
|
8
9
|
error?: string;
|
|
9
10
|
}
|
|
10
11
|
export type CommandDistributionOutcome = DistributeOutcome<CommandPlatform>;
|
|
11
|
-
export declare function resolveCommandFilePath(platform: CommandPlatform, id: string): string;
|
|
12
|
-
export declare function distributeCommands(): CommandDistributionOutcome;
|
|
12
|
+
export declare function resolveCommandFilePath(platform: CommandPlatform, id: string, scope?: ConfigScope): string;
|
|
13
|
+
export declare function distributeCommands(scope?: ConfigScope): CommandDistributionOutcome;
|
|
@@ -1,20 +1,38 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { stringify as toToml } from '@iarna/toml';
|
|
3
|
-
import { getClaudeDir, getCodexDir, getGeminiDir, getOpencodePath } from '../config/paths.js';
|
|
3
|
+
import { getClaudeDir, getCodexDir, getGeminiDir, getOpencodePath, getProjectClaudeDir, getProjectGeminiDir, getProjectOpencodePath, } from '../config/paths.js';
|
|
4
4
|
import { distributeLibrary, } from '../library/distribute.js';
|
|
5
5
|
import { loadLibraryStateSection } from '../library/state.js';
|
|
6
6
|
import { wrapFrontmatter } from '../util/frontmatter.js';
|
|
7
7
|
import { loadCommandLibrary } from './library.js';
|
|
8
|
-
export function resolveCommandFilePath(platform, id) {
|
|
8
|
+
export function resolveCommandFilePath(platform, id, scope) {
|
|
9
|
+
const projectRoot = scope?.project?.trim();
|
|
9
10
|
switch (platform) {
|
|
10
|
-
case 'claude-code':
|
|
11
|
+
case 'claude-code': {
|
|
12
|
+
// Project-level supported: .claude/commands/
|
|
13
|
+
if (projectRoot && projectRoot.length > 0) {
|
|
14
|
+
return path.join(getProjectClaudeDir(projectRoot), 'commands', `${id}.md`);
|
|
15
|
+
}
|
|
11
16
|
return path.join(getClaudeDir(), 'commands', `${id}.md`);
|
|
12
|
-
|
|
17
|
+
}
|
|
18
|
+
case 'codex': {
|
|
19
|
+
// Project-level prompts not supported (per docs): always global
|
|
13
20
|
return path.join(getCodexDir(), 'prompts', `${id}.md`);
|
|
14
|
-
|
|
21
|
+
}
|
|
22
|
+
case 'gemini': {
|
|
23
|
+
// Project-level supported: .gemini/commands/
|
|
24
|
+
if (projectRoot && projectRoot.length > 0) {
|
|
25
|
+
return path.join(getProjectGeminiDir(projectRoot), 'commands', `${id}.toml`);
|
|
26
|
+
}
|
|
15
27
|
return path.join(getGeminiDir(), 'commands', `${id}.toml`);
|
|
16
|
-
|
|
28
|
+
}
|
|
29
|
+
case 'opencode': {
|
|
30
|
+
// Project-level supported: .opencode/command/
|
|
31
|
+
if (projectRoot && projectRoot.length > 0) {
|
|
32
|
+
return getProjectOpencodePath(projectRoot, 'command', `${id}.md`);
|
|
33
|
+
}
|
|
17
34
|
return getOpencodePath('command', `${id}.md`);
|
|
35
|
+
}
|
|
18
36
|
}
|
|
19
37
|
}
|
|
20
38
|
function buildFrontmatterForClaude(entry) {
|
|
@@ -73,9 +91,9 @@ function renderForPlatform(platform, entry) {
|
|
|
73
91
|
}
|
|
74
92
|
}
|
|
75
93
|
}
|
|
76
|
-
export function distributeCommands() {
|
|
94
|
+
export function distributeCommands(scope) {
|
|
77
95
|
const entries = loadCommandLibrary();
|
|
78
|
-
const state = loadLibraryStateSection('commands');
|
|
96
|
+
const state = loadLibraryStateSection('commands', scope);
|
|
79
97
|
const activeIds = state.active;
|
|
80
98
|
const byId = new Map(entries.map((e) => [e.id, e]));
|
|
81
99
|
const selected = [];
|
|
@@ -89,8 +107,9 @@ export function distributeCommands() {
|
|
|
89
107
|
section: 'commands',
|
|
90
108
|
selected,
|
|
91
109
|
platforms,
|
|
92
|
-
resolveFilePath: (p, e) => resolveCommandFilePath(p, e.id),
|
|
110
|
+
resolveFilePath: (p, e) => resolveCommandFilePath(p, e.id, scope),
|
|
93
111
|
render: (p, e) => renderForPlatform(p, e),
|
|
112
|
+
scope,
|
|
94
113
|
});
|
|
95
114
|
}
|
|
96
115
|
//# sourceMappingURL=distribution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distribution.js","sourceRoot":"","sources":["../../src/commands/distribution.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"distribution.js","sourceRoot":"","sources":["../../src/commands/distribution.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAGL,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAqB,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAcrE,MAAM,UAAU,sBAAsB,CACpC,QAAyB,EACzB,EAAU,EACV,KAAmB;IAEnB,MAAM,WAAW,GAAG,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3C,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,aAAa,CAAC,CAAC,CAAC;YACnB,6CAA6C;YAC7C,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC1C,OAAO,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YAC7E,CAAC;YACD,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,CAAC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,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAmB,EAAE,CAAC;IACpC,KAAK,MAAM,EAAE,IAAI,SAAS,EAAE,CAAC;QAC3B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACvB,IAAI,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;IAED,MAAM,SAAS,GAAsB,CAAC,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IAEpF,OAAO,iBAAiB,CAAgC;QACtD,OAAO,EAAE,UAAU;QACnB,QAAQ;QACR,SAAS;QACT,eAAe,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC;QACjE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC;QACzC,KAAK;KACN,CAAuD,CAAC;AAC3D,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ConfigScope } from '../config/scope.js';
|
|
1
2
|
import { type SectionState } from '../library/state.js';
|
|
2
3
|
export interface CommandInventoryRow {
|
|
3
4
|
id: string;
|
|
@@ -13,4 +14,4 @@ export interface CommandInventory {
|
|
|
13
14
|
entries: CommandInventoryRow[];
|
|
14
15
|
state: SectionState;
|
|
15
16
|
}
|
|
16
|
-
export declare function buildCommandInventory(): CommandInventory;
|
|
17
|
+
export declare function buildCommandInventory(scope?: ConfigScope): CommandInventory;
|
|
@@ -11,9 +11,9 @@ function sortInactive(entries) {
|
|
|
11
11
|
return aLabel.localeCompare(bLabel);
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
export function buildCommandInventory() {
|
|
14
|
+
export function buildCommandInventory(scope) {
|
|
15
15
|
const entries = loadCommandLibrary();
|
|
16
|
-
const state = loadLibraryStateSection('commands');
|
|
16
|
+
const state = loadLibraryStateSection('commands', scope);
|
|
17
17
|
const byId = new Map(entries.map((e) => [e.id, e]));
|
|
18
18
|
const rows = [];
|
|
19
19
|
const seen = new Set();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inventory.js","sourceRoot":"","sources":["../../src/commands/inventory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inventory.js","sourceRoot":"","sources":["../../src/commands/inventory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAqB,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAqB,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAkBrE,SAAS,YAAY,CAAC,OAAuB;IAC3C,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAChC,MAAM,KAAK,GAAG,CAAC,CAAC,QAAmC,CAAC;QACpD,MAAM,KAAK,GAAG,CAAC,CAAC,QAAmC,CAAC;QACpD,MAAM,MAAM,GAAG,KAAK,CAAC,KAAgB,CAAC;QACtC,MAAM,MAAM,GAAG,KAAK,CAAC,KAAgB,CAAC;QACtC,MAAM,MAAM,GAAG,CACb,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CACvE,CAAC,WAAW,EAAE,CAAC;QAChB,MAAM,MAAM,GAAG,CACb,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CACvE,CAAC,WAAW,EAAE,CAAC;QAChB,OAAO,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,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,CAAC,GAAG,EAAE;gBACX,MAAM,MAAM,GAAG,CAAC,CAAC,QAAQ,CAAC,MAA6C,CAAC;gBACxE,MAAM,EAAE,GAAI,MAAM,EAAE,CAAC,aAAa,CAA6B,IAAI,SAAS,CAAC;gBAC7E,MAAM,CAAC,GAAG,EAAE,EAAE,KAAsC,CAAC;gBACrD,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YACjE,CAAC,CAAC,EAAE;YACJ,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;YACnE,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,IAAI;YACX,QAAQ,EAAE,CAAC,CAAC,QAAQ;SACrB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type SwitchboardConfig, type SwitchboardConfigLayer } from './schemas.js';
|
|
2
|
+
export interface ConfigLayerLoadResult {
|
|
3
|
+
path: string;
|
|
4
|
+
exists: boolean;
|
|
5
|
+
config: SwitchboardConfigLayer;
|
|
6
|
+
}
|
|
7
|
+
export interface LoadConfigLayersOptions {
|
|
8
|
+
profile?: string | null;
|
|
9
|
+
projectPath?: string | null;
|
|
10
|
+
}
|
|
11
|
+
export interface ConfigLayers {
|
|
12
|
+
user: ConfigLayerLoadResult;
|
|
13
|
+
profile?: ConfigLayerLoadResult;
|
|
14
|
+
project?: ConfigLayerLoadResult;
|
|
15
|
+
}
|
|
16
|
+
export type ConfigLayerKind = 'user' | 'profile' | 'project';
|
|
17
|
+
export declare function loadConfigLayers(options?: LoadConfigLayersOptions): ConfigLayers;
|
|
18
|
+
export declare function mergeConfigLayers(layers: ConfigLayers): Record<string, unknown>;
|
|
19
|
+
export declare function buildMergedSwitchboardConfig(layers: ConfigLayers): SwitchboardConfig;
|
|
20
|
+
export declare function loadMergedSwitchboardConfig(options?: LoadConfigLayersOptions): {
|
|
21
|
+
layers: ConfigLayers;
|
|
22
|
+
config: SwitchboardConfig;
|
|
23
|
+
};
|
|
24
|
+
export interface UpdateConfigLayerOptions extends LoadConfigLayersOptions {
|
|
25
|
+
target?: ConfigLayerKind;
|
|
26
|
+
}
|
|
27
|
+
export declare function updateConfigLayer(mutator: (layer: SwitchboardConfigLayer) => SwitchboardConfigLayer, options?: UpdateConfigLayerOptions): ConfigLayerLoadResult;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { parse, stringify } from '@iarna/toml';
|
|
4
|
+
import { getProfileConfigPath, getProjectConfigPath, getSwitchboardConfigPath } from './paths.js';
|
|
5
|
+
import { switchboardConfigLayerSchema, switchboardConfigSchema, } from './schemas.js';
|
|
6
|
+
function isPlainObject(value) {
|
|
7
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
8
|
+
}
|
|
9
|
+
function readLayerFile(filePath) {
|
|
10
|
+
if (!fs.existsSync(filePath)) {
|
|
11
|
+
return { path: filePath, exists: false, config: {} };
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
15
|
+
const parsed = content.trim().length === 0 ? {} : parse(content);
|
|
16
|
+
const validated = switchboardConfigLayerSchema.parse(parsed && typeof parsed === 'object' ? parsed : {});
|
|
17
|
+
return { path: filePath, exists: true, config: validated };
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (error instanceof Error) {
|
|
21
|
+
throw new Error(`Failed to load configuration from ${filePath}: ${error.message}`);
|
|
22
|
+
}
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function loadConfigLayers(options) {
|
|
27
|
+
const userPath = getSwitchboardConfigPath();
|
|
28
|
+
const user = readLayerFile(userPath);
|
|
29
|
+
let profile;
|
|
30
|
+
const profileName = options?.profile?.trim();
|
|
31
|
+
if (profileName) {
|
|
32
|
+
const profilePath = getProfileConfigPath(profileName);
|
|
33
|
+
profile = readLayerFile(profilePath);
|
|
34
|
+
}
|
|
35
|
+
let project;
|
|
36
|
+
const projectRoot = options?.projectPath?.trim();
|
|
37
|
+
if (projectRoot) {
|
|
38
|
+
const projectPath = getProjectConfigPath(projectRoot);
|
|
39
|
+
project = readLayerFile(projectPath);
|
|
40
|
+
}
|
|
41
|
+
return { user, profile, project };
|
|
42
|
+
}
|
|
43
|
+
function mergeDeep(target, source) {
|
|
44
|
+
for (const [key, value] of Object.entries(source)) {
|
|
45
|
+
if (typeof value === 'undefined')
|
|
46
|
+
continue;
|
|
47
|
+
if (Array.isArray(value)) {
|
|
48
|
+
target[key] = [...value];
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (isPlainObject(value)) {
|
|
52
|
+
const current = target[key];
|
|
53
|
+
const base = isPlainObject(current) ? current : {};
|
|
54
|
+
const clone = { ...base };
|
|
55
|
+
mergeDeep(clone, value);
|
|
56
|
+
target[key] = clone;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
target[key] = value;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export function mergeConfigLayers(layers) {
|
|
63
|
+
const merged = {};
|
|
64
|
+
mergeDeep(merged, layers.user.config);
|
|
65
|
+
if (layers.profile) {
|
|
66
|
+
mergeDeep(merged, layers.profile.config);
|
|
67
|
+
}
|
|
68
|
+
if (layers.project) {
|
|
69
|
+
mergeDeep(merged, layers.project.config);
|
|
70
|
+
}
|
|
71
|
+
return merged;
|
|
72
|
+
}
|
|
73
|
+
export function buildMergedSwitchboardConfig(layers) {
|
|
74
|
+
const merged = mergeConfigLayers(layers);
|
|
75
|
+
return switchboardConfigSchema.parse(merged);
|
|
76
|
+
}
|
|
77
|
+
export function loadMergedSwitchboardConfig(options) {
|
|
78
|
+
const layers = loadConfigLayers(options);
|
|
79
|
+
const config = buildMergedSwitchboardConfig(layers);
|
|
80
|
+
return { layers, config };
|
|
81
|
+
}
|
|
82
|
+
function defaultWritableLayer(options) {
|
|
83
|
+
const project = options?.projectPath?.trim();
|
|
84
|
+
if (project && project.length > 0)
|
|
85
|
+
return 'project';
|
|
86
|
+
const profile = options?.profile?.trim();
|
|
87
|
+
if (profile && profile.length > 0)
|
|
88
|
+
return 'profile';
|
|
89
|
+
return 'user';
|
|
90
|
+
}
|
|
91
|
+
function resolveLayerPath(kind, options) {
|
|
92
|
+
switch (kind) {
|
|
93
|
+
case 'user':
|
|
94
|
+
return getSwitchboardConfigPath();
|
|
95
|
+
case 'profile': {
|
|
96
|
+
const profile = options?.profile?.trim();
|
|
97
|
+
if (!profile) {
|
|
98
|
+
throw new Error('Profile name is required to write profile configuration.');
|
|
99
|
+
}
|
|
100
|
+
return getProfileConfigPath(profile);
|
|
101
|
+
}
|
|
102
|
+
case 'project': {
|
|
103
|
+
const project = options?.projectPath?.trim();
|
|
104
|
+
if (!project) {
|
|
105
|
+
throw new Error('Project path is required to write project configuration.');
|
|
106
|
+
}
|
|
107
|
+
return getProjectConfigPath(project);
|
|
108
|
+
}
|
|
109
|
+
default:
|
|
110
|
+
return getSwitchboardConfigPath();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function writeLayerFile(filePath, config) {
|
|
114
|
+
const dir = path.dirname(filePath);
|
|
115
|
+
if (!fs.existsSync(dir)) {
|
|
116
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
117
|
+
}
|
|
118
|
+
const portable = JSON.parse(JSON.stringify(config));
|
|
119
|
+
// biome-ignore lint/suspicious/noExplicitAny: TOML stringify requires JsonMap typing
|
|
120
|
+
const content = stringify(portable);
|
|
121
|
+
fs.writeFileSync(filePath, content, 'utf-8');
|
|
122
|
+
}
|
|
123
|
+
export function updateConfigLayer(mutator, options) {
|
|
124
|
+
const targetKind = options?.target ?? defaultWritableLayer(options);
|
|
125
|
+
const filePath = resolveLayerPath(targetKind, options);
|
|
126
|
+
const current = readLayerFile(filePath);
|
|
127
|
+
const draft = JSON.parse(JSON.stringify(current.config));
|
|
128
|
+
const next = switchboardConfigLayerSchema.parse(mutator(draft));
|
|
129
|
+
writeLayerFile(filePath, next);
|
|
130
|
+
return readLayerFile(filePath);
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=layered-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layered-config.js","sourceRoot":"","sources":["../../src/config/layered-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAClG,OAAO,EAGL,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAqBtB,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,aAAa,CAAC,QAAgB;IACrC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACvD,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE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AC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAChE,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC/B,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC"}
|
package/dist/config/paths.d.ts
CHANGED
|
@@ -27,13 +27,18 @@ export declare function getMcpConfigPath(): string;
|
|
|
27
27
|
*/
|
|
28
28
|
export declare function getSwitchboardConfigPath(): string;
|
|
29
29
|
/**
|
|
30
|
-
* Returns the absolute path to
|
|
30
|
+
* Returns the absolute path to a profile-specific configuration file located under ASB_HOME.
|
|
31
|
+
* Example: ~/.agent-switchboard/team.toml
|
|
31
32
|
*/
|
|
32
|
-
export declare function
|
|
33
|
+
export declare function getProfileConfigPath(profileName: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Returns the absolute path to a project-scoped configuration file (.asb.toml).
|
|
36
|
+
*/
|
|
37
|
+
export declare function getProjectConfigPath(projectRoot: string): string;
|
|
33
38
|
/**
|
|
34
|
-
* Returns the absolute path to the rule
|
|
39
|
+
* Returns the absolute path to the rule snippets directory
|
|
35
40
|
*/
|
|
36
|
-
export declare function
|
|
41
|
+
export declare function getRulesDir(): string;
|
|
37
42
|
/**
|
|
38
43
|
* Returns the absolute path to the commands library directory
|
|
39
44
|
*/
|
|
@@ -53,6 +58,11 @@ export declare function getCodexDir(): string;
|
|
|
53
58
|
export declare function getGeminiDir(): string;
|
|
54
59
|
export declare function getOpencodeRoot(): string;
|
|
55
60
|
export declare function getOpencodePath(...segments: string[]): string;
|
|
61
|
+
/** Project-scoped platform roots (used when --project is set and platform supports project-level files) */
|
|
62
|
+
export declare function getProjectClaudeDir(projectRoot: string): string;
|
|
63
|
+
export declare function getProjectGeminiDir(projectRoot: string): string;
|
|
64
|
+
export declare function getProjectOpencodeRoot(projectRoot: string): string;
|
|
65
|
+
export declare function getProjectOpencodePath(projectRoot: string, ...segments: string[]): string;
|
|
56
66
|
/** Config file helpers */
|
|
57
67
|
export declare function getClaudeJsonPath(): string;
|
|
58
68
|
export declare function getCodexConfigPath(): string;
|
package/dist/config/paths.js
CHANGED
|
@@ -41,16 +41,27 @@ export function getSwitchboardConfigPath() {
|
|
|
41
41
|
return path.join(getConfigDir(), 'config.toml');
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
* Returns the absolute path to
|
|
44
|
+
* Returns the absolute path to a profile-specific configuration file located under ASB_HOME.
|
|
45
|
+
* Example: ~/.agent-switchboard/team.toml
|
|
45
46
|
*/
|
|
46
|
-
export function
|
|
47
|
-
|
|
47
|
+
export function getProfileConfigPath(profileName) {
|
|
48
|
+
const trimmed = profileName.trim();
|
|
49
|
+
if (trimmed.length === 0) {
|
|
50
|
+
throw new Error('Profile name must be a non-empty string.');
|
|
51
|
+
}
|
|
52
|
+
return path.join(getConfigDir(), `${trimmed}.toml`);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Returns the absolute path to a project-scoped configuration file (.asb.toml).
|
|
56
|
+
*/
|
|
57
|
+
export function getProjectConfigPath(projectRoot) {
|
|
58
|
+
return path.join(path.resolve(projectRoot), '.asb.toml');
|
|
48
59
|
}
|
|
49
60
|
/**
|
|
50
|
-
* Returns the absolute path to the rule
|
|
61
|
+
* Returns the absolute path to the rule snippets directory
|
|
51
62
|
*/
|
|
52
|
-
export function
|
|
53
|
-
return path.join(getConfigDir(), '
|
|
63
|
+
export function getRulesDir() {
|
|
64
|
+
return path.join(getConfigDir(), 'rules');
|
|
54
65
|
}
|
|
55
66
|
/**
|
|
56
67
|
* Returns the absolute path to the commands library directory
|
|
@@ -93,6 +104,19 @@ export function getOpencodeRoot() {
|
|
|
93
104
|
export function getOpencodePath(...segments) {
|
|
94
105
|
return path.join(getOpencodeRoot(), ...segments);
|
|
95
106
|
}
|
|
107
|
+
/** Project-scoped platform roots (used when --project is set and platform supports project-level files) */
|
|
108
|
+
export function getProjectClaudeDir(projectRoot) {
|
|
109
|
+
return path.join(path.resolve(projectRoot), '.claude');
|
|
110
|
+
}
|
|
111
|
+
export function getProjectGeminiDir(projectRoot) {
|
|
112
|
+
return path.join(path.resolve(projectRoot), '.gemini');
|
|
113
|
+
}
|
|
114
|
+
export function getProjectOpencodeRoot(projectRoot) {
|
|
115
|
+
return path.join(path.resolve(projectRoot), '.opencode');
|
|
116
|
+
}
|
|
117
|
+
export function getProjectOpencodePath(projectRoot, ...segments) {
|
|
118
|
+
return path.join(getProjectOpencodeRoot(projectRoot), ...segments);
|
|
119
|
+
}
|
|
96
120
|
/** Config file helpers */
|
|
97
121
|
export function getClaudeJsonPath() {
|
|
98
122
|
return path.join(getAgentsHome(), '.claude.json');
|
package/dist/config/paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/config/paths.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY;IAC1B,wBAAwB;IACxB,2GAA2G;IAC3G,2DAA2D;IAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC7C,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,OAAO,CAAC;IAClD,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,oBAAoB,CAAC,CAAC;AACvD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,UAAU,CAAC,CAAC;AAC/C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB;IACtC,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,aAAa,CAAC,CAAC;AAClD,CAAC;AAED
|
|
1
|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