claude-flow 1.0.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/LICENSE +21 -0
- package/README.md +612 -0
- package/bin/claude-flow +0 -0
- package/bin/claude-flow-simple +0 -0
- package/bin/claude-flow-typecheck +0 -0
- package/deno.json +84 -0
- package/package.json +45 -0
- package/scripts/check-links.ts +274 -0
- package/scripts/check-performance-regression.ts +168 -0
- package/scripts/claude-sparc.sh +562 -0
- package/scripts/coverage-report.ts +692 -0
- package/scripts/demo-task-system.ts +224 -0
- package/scripts/install.js +72 -0
- package/scripts/test-batch-tasks.ts +29 -0
- package/scripts/test-coordination-features.ts +238 -0
- package/scripts/test-mcp.ts +251 -0
- package/scripts/test-runner.ts +571 -0
- package/scripts/validate-examples.ts +288 -0
- package/src/cli/cli-core.ts +273 -0
- package/src/cli/commands/agent.ts +83 -0
- package/src/cli/commands/config.ts +442 -0
- package/src/cli/commands/help.ts +765 -0
- package/src/cli/commands/index.ts +963 -0
- package/src/cli/commands/mcp.ts +191 -0
- package/src/cli/commands/memory.ts +74 -0
- package/src/cli/commands/monitor.ts +403 -0
- package/src/cli/commands/session.ts +595 -0
- package/src/cli/commands/start.ts +156 -0
- package/src/cli/commands/status.ts +345 -0
- package/src/cli/commands/task.ts +79 -0
- package/src/cli/commands/workflow.ts +763 -0
- package/src/cli/completion.ts +553 -0
- package/src/cli/formatter.ts +310 -0
- package/src/cli/index.ts +211 -0
- package/src/cli/main.ts +23 -0
- package/src/cli/repl.ts +1050 -0
- package/src/cli/simple-cli.js +211 -0
- package/src/cli/simple-cli.ts +211 -0
- package/src/coordination/README.md +400 -0
- package/src/coordination/advanced-scheduler.ts +487 -0
- package/src/coordination/circuit-breaker.ts +366 -0
- package/src/coordination/conflict-resolution.ts +490 -0
- package/src/coordination/dependency-graph.ts +475 -0
- package/src/coordination/index.ts +63 -0
- package/src/coordination/manager.ts +460 -0
- package/src/coordination/messaging.ts +290 -0
- package/src/coordination/metrics.ts +585 -0
- package/src/coordination/resources.ts +322 -0
- package/src/coordination/scheduler.ts +390 -0
- package/src/coordination/work-stealing.ts +224 -0
- package/src/core/config.ts +627 -0
- package/src/core/event-bus.ts +186 -0
- package/src/core/json-persistence.ts +183 -0
- package/src/core/logger.ts +262 -0
- package/src/core/orchestrator-fixed.ts +312 -0
- package/src/core/orchestrator.ts +1234 -0
- package/src/core/persistence.ts +276 -0
- package/src/mcp/auth.ts +438 -0
- package/src/mcp/claude-flow-tools.ts +1280 -0
- package/src/mcp/load-balancer.ts +510 -0
- package/src/mcp/router.ts +240 -0
- package/src/mcp/server.ts +548 -0
- package/src/mcp/session-manager.ts +418 -0
- package/src/mcp/tools.ts +180 -0
- package/src/mcp/transports/base.ts +21 -0
- package/src/mcp/transports/http.ts +457 -0
- package/src/mcp/transports/stdio.ts +254 -0
- package/src/memory/backends/base.ts +22 -0
- package/src/memory/backends/markdown.ts +283 -0
- package/src/memory/backends/sqlite.ts +329 -0
- package/src/memory/cache.ts +238 -0
- package/src/memory/indexer.ts +238 -0
- package/src/memory/manager.ts +572 -0
- package/src/terminal/adapters/base.ts +29 -0
- package/src/terminal/adapters/native.ts +504 -0
- package/src/terminal/adapters/vscode.ts +340 -0
- package/src/terminal/manager.ts +308 -0
- package/src/terminal/pool.ts +271 -0
- package/src/terminal/session.ts +250 -0
- package/src/terminal/vscode-bridge.ts +242 -0
- package/src/utils/errors.ts +231 -0
- package/src/utils/helpers.ts +476 -0
- package/src/utils/types.ts +493 -0
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration management commands
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Command } from '@cliffy/command';
|
|
6
|
+
import { colors } from '@cliffy/ansi/colors';
|
|
7
|
+
import { Confirm } from '@cliffy/prompt';
|
|
8
|
+
import { configManager } from '../../core/config.ts';
|
|
9
|
+
import { deepMerge } from '../../utils/helpers.ts';
|
|
10
|
+
|
|
11
|
+
export const configCommand = new Command()
|
|
12
|
+
.description('Manage Claude-Flow configuration')
|
|
13
|
+
.action(() => {
|
|
14
|
+
configCommand.showHelp();
|
|
15
|
+
})
|
|
16
|
+
.command('show', new Command()
|
|
17
|
+
.description('Show current configuration')
|
|
18
|
+
.option('--format <format:string>', 'Output format (json, yaml)', { default: 'json' })
|
|
19
|
+
.option('--diff', 'Show only differences from defaults')
|
|
20
|
+
.option('--profile', 'Include profile information')
|
|
21
|
+
.action(async (options: any) => {
|
|
22
|
+
if (options.diff) {
|
|
23
|
+
const diff = configManager.getDiff();
|
|
24
|
+
console.log(JSON.stringify(diff, null, 2));
|
|
25
|
+
} else if (options.profile) {
|
|
26
|
+
const exported = configManager.export();
|
|
27
|
+
console.log(JSON.stringify(exported, null, 2));
|
|
28
|
+
} else {
|
|
29
|
+
const config = configManager.get();
|
|
30
|
+
|
|
31
|
+
if (options.format === 'json') {
|
|
32
|
+
console.log(JSON.stringify(config, null, 2));
|
|
33
|
+
} else {
|
|
34
|
+
console.log(colors.yellow('YAML format not yet implemented'));
|
|
35
|
+
console.log(JSON.stringify(config, null, 2));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}),
|
|
39
|
+
)
|
|
40
|
+
.command('get', new Command()
|
|
41
|
+
.description('Get a specific configuration value')
|
|
42
|
+
.arguments('<path:string>')
|
|
43
|
+
.action(async (options: any, path: string) => {
|
|
44
|
+
const value = configManager.getValue(path);
|
|
45
|
+
|
|
46
|
+
if (value === undefined) {
|
|
47
|
+
console.error(colors.red(`Configuration path not found: ${path}`));
|
|
48
|
+
Deno.exit(1);
|
|
49
|
+
} else {
|
|
50
|
+
console.log(JSON.stringify(value, null, 2));
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
)
|
|
54
|
+
.command('set', new Command()
|
|
55
|
+
.description('Set a configuration value')
|
|
56
|
+
.arguments('<path:string> <value:string>')
|
|
57
|
+
.option('--type <type:string>', 'Value type (string, number, boolean, json)', { default: 'auto' })
|
|
58
|
+
.action(async (options: any, path: string, value: string) => {
|
|
59
|
+
try {
|
|
60
|
+
let parsedValue: any;
|
|
61
|
+
|
|
62
|
+
switch (options.type) {
|
|
63
|
+
case 'string':
|
|
64
|
+
parsedValue = value;
|
|
65
|
+
break;
|
|
66
|
+
case 'number':
|
|
67
|
+
parsedValue = parseFloat(value);
|
|
68
|
+
if (isNaN(parsedValue)) {
|
|
69
|
+
throw new Error('Invalid number format');
|
|
70
|
+
}
|
|
71
|
+
break;
|
|
72
|
+
case 'boolean':
|
|
73
|
+
parsedValue = value.toLowerCase() === 'true';
|
|
74
|
+
break;
|
|
75
|
+
case 'json':
|
|
76
|
+
parsedValue = JSON.parse(value);
|
|
77
|
+
break;
|
|
78
|
+
default:
|
|
79
|
+
// Auto-detect type
|
|
80
|
+
try {
|
|
81
|
+
parsedValue = JSON.parse(value);
|
|
82
|
+
} catch {
|
|
83
|
+
parsedValue = value;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
configManager.set(path, parsedValue);
|
|
88
|
+
console.log(colors.green('✓'), `Set ${path} = ${JSON.stringify(parsedValue)}`);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
console.error(colors.red('Failed to set configuration:'), (error as Error).message);
|
|
91
|
+
Deno.exit(1);
|
|
92
|
+
}
|
|
93
|
+
}),
|
|
94
|
+
)
|
|
95
|
+
.command('reset', new Command()
|
|
96
|
+
.description('Reset configuration to defaults')
|
|
97
|
+
.option('--confirm', 'Skip confirmation prompt')
|
|
98
|
+
.action(async (options: any) => {
|
|
99
|
+
if (!options.confirm) {
|
|
100
|
+
const confirmed = await Confirm.prompt({
|
|
101
|
+
message: 'Reset configuration to defaults?',
|
|
102
|
+
default: false,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
if (!confirmed) {
|
|
106
|
+
console.log(colors.gray('Reset cancelled'));
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
configManager.reset();
|
|
112
|
+
console.log(colors.green('✓ Configuration reset to defaults'));
|
|
113
|
+
}),
|
|
114
|
+
)
|
|
115
|
+
.command('init', new Command()
|
|
116
|
+
.description('Initialize a new configuration file')
|
|
117
|
+
.arguments('[output-file:string]')
|
|
118
|
+
.option('--force', 'Overwrite existing file')
|
|
119
|
+
.option('--template <template:string>', 'Use configuration template', { default: 'default' })
|
|
120
|
+
.action(async (options: any, outputFile: string = 'claude-flow.config.json') => {
|
|
121
|
+
try {
|
|
122
|
+
// Check if file exists
|
|
123
|
+
try {
|
|
124
|
+
await Deno.stat(outputFile);
|
|
125
|
+
if (!options.force) {
|
|
126
|
+
console.error(colors.red(`File already exists: ${outputFile}`));
|
|
127
|
+
console.log(colors.gray('Use --force to overwrite'));
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
} catch {
|
|
131
|
+
// File doesn't exist, which is what we want
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const config = getConfigTemplate(options.template);
|
|
135
|
+
await Deno.writeTextFile(outputFile, JSON.stringify(config, null, 2));
|
|
136
|
+
|
|
137
|
+
console.log(colors.green('✓'), `Configuration file created: ${outputFile}`);
|
|
138
|
+
console.log(colors.gray(`Template: ${options.template}`));
|
|
139
|
+
} catch (error) {
|
|
140
|
+
console.error(colors.red('Failed to create configuration file:'), (error as Error).message);
|
|
141
|
+
Deno.exit(1);
|
|
142
|
+
}
|
|
143
|
+
}),
|
|
144
|
+
)
|
|
145
|
+
.command('validate', new Command()
|
|
146
|
+
.description('Validate a configuration file')
|
|
147
|
+
.arguments('<config-file:string>')
|
|
148
|
+
.option('--strict', 'Use strict validation')
|
|
149
|
+
.action(async (options: any, configFile: string) => {
|
|
150
|
+
try {
|
|
151
|
+
await configManager.load(configFile);
|
|
152
|
+
console.log(colors.green('✓'), 'Configuration is valid');
|
|
153
|
+
|
|
154
|
+
if (options.strict) {
|
|
155
|
+
const schema = configManager.getSchema();
|
|
156
|
+
console.log(colors.gray('Schema validation passed'));
|
|
157
|
+
}
|
|
158
|
+
} catch (error) {
|
|
159
|
+
console.error(colors.red('✗'), 'Configuration validation failed:');
|
|
160
|
+
console.error((error as Error).message);
|
|
161
|
+
Deno.exit(1);
|
|
162
|
+
}
|
|
163
|
+
}),
|
|
164
|
+
)
|
|
165
|
+
.command('profile', new Command()
|
|
166
|
+
.description('Manage configuration profiles')
|
|
167
|
+
.action(() => {
|
|
168
|
+
console.log(colors.gray('Usage: config profile <list|save|load|delete> [options]'));
|
|
169
|
+
})
|
|
170
|
+
.command('list', new Command()
|
|
171
|
+
.description('List all configuration profiles')
|
|
172
|
+
.action(async () => {
|
|
173
|
+
try {
|
|
174
|
+
const profiles = await configManager.listProfiles();
|
|
175
|
+
const currentProfile = configManager.getCurrentProfile();
|
|
176
|
+
|
|
177
|
+
if (profiles.length === 0) {
|
|
178
|
+
console.log(colors.gray('No profiles found'));
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
console.log(colors.cyan.bold(`Configuration Profiles (${profiles.length})`));
|
|
183
|
+
console.log('─'.repeat(40));
|
|
184
|
+
|
|
185
|
+
for (const profile of profiles) {
|
|
186
|
+
const indicator = profile === currentProfile ? colors.green('● ') : ' ';
|
|
187
|
+
console.log(`${indicator}${profile}`);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (currentProfile) {
|
|
191
|
+
console.log();
|
|
192
|
+
console.log(colors.gray(`Current: ${currentProfile}`));
|
|
193
|
+
}
|
|
194
|
+
} catch (error) {
|
|
195
|
+
console.error(colors.red('Failed to list profiles:'), (error as Error).message);
|
|
196
|
+
}
|
|
197
|
+
}),
|
|
198
|
+
)
|
|
199
|
+
.command('save', new Command()
|
|
200
|
+
.description('Save current configuration as a profile')
|
|
201
|
+
.arguments('<profile-name:string>')
|
|
202
|
+
.option('--force', 'Overwrite existing profile')
|
|
203
|
+
.action(async (options: any, profileName: string) => {
|
|
204
|
+
try {
|
|
205
|
+
const existing = await configManager.getProfile(profileName);
|
|
206
|
+
if (existing && !options.force) {
|
|
207
|
+
console.error(colors.red(`Profile '${profileName}' already exists`));
|
|
208
|
+
console.log(colors.gray('Use --force to overwrite'));
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
await configManager.saveProfile(profileName);
|
|
213
|
+
console.log(colors.green('✓'), `Profile '${profileName}' saved`);
|
|
214
|
+
} catch (error) {
|
|
215
|
+
console.error(colors.red('Failed to save profile:'), (error as Error).message);
|
|
216
|
+
}
|
|
217
|
+
}),
|
|
218
|
+
)
|
|
219
|
+
.command('load', new Command()
|
|
220
|
+
.description('Load a configuration profile')
|
|
221
|
+
.arguments('<profile-name:string>')
|
|
222
|
+
.action(async (options: any, profileName: string) => {
|
|
223
|
+
try {
|
|
224
|
+
await configManager.applyProfile(profileName);
|
|
225
|
+
console.log(colors.green('✓'), `Profile '${profileName}' loaded`);
|
|
226
|
+
} catch (error) {
|
|
227
|
+
console.error(colors.red('Failed to load profile:'), (error as Error).message);
|
|
228
|
+
}
|
|
229
|
+
}),
|
|
230
|
+
)
|
|
231
|
+
.command('delete', new Command()
|
|
232
|
+
.description('Delete a configuration profile')
|
|
233
|
+
.arguments('<profile-name:string>')
|
|
234
|
+
.option('--force', 'Skip confirmation prompt')
|
|
235
|
+
.action(async (options: any, profileName: string) => {
|
|
236
|
+
try {
|
|
237
|
+
if (!options.force) {
|
|
238
|
+
const confirmed = await Confirm.prompt({
|
|
239
|
+
message: `Delete profile '${profileName}'?`,
|
|
240
|
+
default: false,
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
if (!confirmed) {
|
|
244
|
+
console.log(colors.gray('Delete cancelled'));
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
await configManager.deleteProfile(profileName);
|
|
250
|
+
console.log(colors.green('✓'), `Profile '${profileName}' deleted`);
|
|
251
|
+
} catch (error) {
|
|
252
|
+
console.error(colors.red('Failed to delete profile:'), (error as Error).message);
|
|
253
|
+
}
|
|
254
|
+
}),
|
|
255
|
+
)
|
|
256
|
+
.command('show', new Command()
|
|
257
|
+
.description('Show profile configuration')
|
|
258
|
+
.arguments('<profile-name:string>')
|
|
259
|
+
.action(async (options: any, profileName: string) => {
|
|
260
|
+
try {
|
|
261
|
+
const profile = await configManager.getProfile(profileName);
|
|
262
|
+
if (!profile) {
|
|
263
|
+
console.error(colors.red(`Profile '${profileName}' not found`));
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
console.log(JSON.stringify(profile, null, 2));
|
|
268
|
+
} catch (error) {
|
|
269
|
+
console.error(colors.red('Failed to show profile:'), (error as Error).message);
|
|
270
|
+
}
|
|
271
|
+
}),
|
|
272
|
+
),
|
|
273
|
+
)
|
|
274
|
+
.command('export', new Command()
|
|
275
|
+
.description('Export configuration')
|
|
276
|
+
.arguments('<output-file:string>')
|
|
277
|
+
.option('--include-defaults', 'Include default values')
|
|
278
|
+
.action(async (options: any, outputFile: string) => {
|
|
279
|
+
try {
|
|
280
|
+
let data;
|
|
281
|
+
if (options.includeDefaults) {
|
|
282
|
+
data = configManager.export();
|
|
283
|
+
} else {
|
|
284
|
+
data = {
|
|
285
|
+
version: '1.0.0',
|
|
286
|
+
exported: new Date().toISOString(),
|
|
287
|
+
profile: configManager.getCurrentProfile(),
|
|
288
|
+
config: configManager.getDiff(),
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
await Deno.writeTextFile(outputFile, JSON.stringify(data, null, 2));
|
|
293
|
+
console.log(colors.green('✓'), `Configuration exported to ${outputFile}`);
|
|
294
|
+
} catch (error) {
|
|
295
|
+
console.error(colors.red('Failed to export configuration:'), (error as Error).message);
|
|
296
|
+
}
|
|
297
|
+
}),
|
|
298
|
+
)
|
|
299
|
+
.command('import', new Command()
|
|
300
|
+
.description('Import configuration')
|
|
301
|
+
.arguments('<input-file:string>')
|
|
302
|
+
.option('--merge', 'Merge with current configuration')
|
|
303
|
+
.action(async (options: any, inputFile: string) => {
|
|
304
|
+
try {
|
|
305
|
+
const content = await Deno.readTextFile(inputFile);
|
|
306
|
+
const data = JSON.parse(content);
|
|
307
|
+
|
|
308
|
+
if (options.merge) {
|
|
309
|
+
const current = configManager.get();
|
|
310
|
+
data.config = deepMerge(current as unknown as Record<string, unknown>, data.config) as any;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
configManager.import(data);
|
|
314
|
+
console.log(colors.green('✓'), 'Configuration imported successfully');
|
|
315
|
+
|
|
316
|
+
if (data.profile) {
|
|
317
|
+
console.log(colors.gray(`Profile: ${data.profile}`));
|
|
318
|
+
}
|
|
319
|
+
} catch (error) {
|
|
320
|
+
console.error(colors.red('Failed to import configuration:'), (error as Error).message);
|
|
321
|
+
}
|
|
322
|
+
}),
|
|
323
|
+
)
|
|
324
|
+
.command('schema', new Command()
|
|
325
|
+
.description('Show configuration schema')
|
|
326
|
+
.option('--path <path:string>', 'Show schema for specific path')
|
|
327
|
+
.action(async (options: any) => {
|
|
328
|
+
const schema = configManager.getSchema();
|
|
329
|
+
|
|
330
|
+
if (options.path) {
|
|
331
|
+
const value = getValueByPath(schema, options.path);
|
|
332
|
+
if (value === undefined) {
|
|
333
|
+
console.error(colors.red(`Schema path not found: ${options.path}`));
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
console.log(JSON.stringify(value, null, 2));
|
|
337
|
+
} else {
|
|
338
|
+
console.log(JSON.stringify(schema, null, 2));
|
|
339
|
+
}
|
|
340
|
+
}),
|
|
341
|
+
);
|
|
342
|
+
|
|
343
|
+
function getValueByPath(obj: any, path: string): any {
|
|
344
|
+
const parts = path.split('.');
|
|
345
|
+
let current = obj;
|
|
346
|
+
|
|
347
|
+
for (const part of parts) {
|
|
348
|
+
if (current && typeof current === 'object' && part in current) {
|
|
349
|
+
current = current[part];
|
|
350
|
+
} else {
|
|
351
|
+
return undefined;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
return current;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function getConfigTemplate(templateName: string): any {
|
|
359
|
+
const templates: Record<string, any> = {
|
|
360
|
+
default: configManager.get(),
|
|
361
|
+
development: {
|
|
362
|
+
...configManager.get(),
|
|
363
|
+
logging: {
|
|
364
|
+
level: 'debug',
|
|
365
|
+
format: 'text',
|
|
366
|
+
destination: 'console',
|
|
367
|
+
},
|
|
368
|
+
orchestrator: {
|
|
369
|
+
maxConcurrentAgents: 5,
|
|
370
|
+
taskQueueSize: 50,
|
|
371
|
+
healthCheckInterval: 10000,
|
|
372
|
+
shutdownTimeout: 10000,
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
production: {
|
|
376
|
+
...configManager.get(),
|
|
377
|
+
logging: {
|
|
378
|
+
level: 'info',
|
|
379
|
+
format: 'json',
|
|
380
|
+
destination: 'file',
|
|
381
|
+
},
|
|
382
|
+
orchestrator: {
|
|
383
|
+
maxConcurrentAgents: 20,
|
|
384
|
+
taskQueueSize: 500,
|
|
385
|
+
healthCheckInterval: 60000,
|
|
386
|
+
shutdownTimeout: 60000,
|
|
387
|
+
},
|
|
388
|
+
memory: {
|
|
389
|
+
backend: 'hybrid',
|
|
390
|
+
cacheSizeMB: 500,
|
|
391
|
+
syncInterval: 30000,
|
|
392
|
+
conflictResolution: 'crdt',
|
|
393
|
+
retentionDays: 90,
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
minimal: {
|
|
397
|
+
orchestrator: {
|
|
398
|
+
maxConcurrentAgents: 1,
|
|
399
|
+
taskQueueSize: 10,
|
|
400
|
+
healthCheckInterval: 30000,
|
|
401
|
+
shutdownTimeout: 30000,
|
|
402
|
+
},
|
|
403
|
+
terminal: {
|
|
404
|
+
type: 'auto',
|
|
405
|
+
poolSize: 1,
|
|
406
|
+
recycleAfter: 5,
|
|
407
|
+
healthCheckInterval: 60000,
|
|
408
|
+
commandTimeout: 300000,
|
|
409
|
+
},
|
|
410
|
+
memory: {
|
|
411
|
+
backend: 'sqlite',
|
|
412
|
+
cacheSizeMB: 10,
|
|
413
|
+
syncInterval: 10000,
|
|
414
|
+
conflictResolution: 'timestamp',
|
|
415
|
+
retentionDays: 7,
|
|
416
|
+
},
|
|
417
|
+
coordination: {
|
|
418
|
+
maxRetries: 1,
|
|
419
|
+
retryDelay: 2000,
|
|
420
|
+
deadlockDetection: false,
|
|
421
|
+
resourceTimeout: 30000,
|
|
422
|
+
messageTimeout: 15000,
|
|
423
|
+
},
|
|
424
|
+
mcp: {
|
|
425
|
+
transport: 'stdio',
|
|
426
|
+
port: 3000,
|
|
427
|
+
tlsEnabled: false,
|
|
428
|
+
},
|
|
429
|
+
logging: {
|
|
430
|
+
level: 'warn',
|
|
431
|
+
format: 'text',
|
|
432
|
+
destination: 'console',
|
|
433
|
+
},
|
|
434
|
+
},
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
if (!(templateName in templates)) {
|
|
438
|
+
throw new Error(`Unknown template: ${templateName}. Available: ${Object.keys(templates).join(', ')}`);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
return templates[templateName];
|
|
442
|
+
}
|