feat: Add intelligent auto-router and enhanced integrations
- Add intelligent-router.sh hook for automatic agent routing - Add AUTO-TRIGGER-SUMMARY.md documentation - Add FINAL-INTEGRATION-SUMMARY.md documentation - Complete Prometheus integration (6 commands + 4 tools) - Complete Dexto integration (12 commands + 5 tools) - Enhanced Ralph with access to all agents - Fix /clawd command (removed disable-model-invocation) - Update hooks.json to v5 with intelligent routing - 291 total skills now available - All 21 commands with automatic routing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
85
dexto/packages/webui/lib/serverConfig.ts
Normal file
85
dexto/packages/webui/lib/serverConfig.ts
Normal file
@@ -0,0 +1,85 @@
|
||||
import type { McpServerConfig } from '@dexto/core';
|
||||
import type { ServerRegistryEntry } from '@dexto/registry';
|
||||
|
||||
const PLACEHOLDER_EXACT_MATCHES = new Set([
|
||||
'placeholder',
|
||||
'your-api-key',
|
||||
'your_api_key',
|
||||
'enter-your-token',
|
||||
'xxx',
|
||||
'...',
|
||||
'todo',
|
||||
]);
|
||||
|
||||
const PLACEHOLDER_SUBSTRINGS = [
|
||||
'your-',
|
||||
'your_',
|
||||
'your ',
|
||||
'enter-',
|
||||
'enter_',
|
||||
'enter ',
|
||||
'placeholder',
|
||||
'api_key',
|
||||
'api-key',
|
||||
'api key',
|
||||
'secret',
|
||||
'token',
|
||||
'password',
|
||||
'xxx',
|
||||
'...',
|
||||
];
|
||||
|
||||
const PLACEHOLDER_PREFIX_PATTERNS = [/^your[\s_-]?/, /^enter[\s_-]?/];
|
||||
|
||||
export function hasEmptyOrPlaceholderValue(obj: Record<string, string>): boolean {
|
||||
return Object.values(obj).some((value) => {
|
||||
if (!value || value.trim() === '') {
|
||||
return true;
|
||||
}
|
||||
|
||||
const normalized = value.trim().toLowerCase();
|
||||
|
||||
if (PLACEHOLDER_EXACT_MATCHES.has(normalized)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (PLACEHOLDER_PREFIX_PATTERNS.some((pattern) => pattern.test(normalized))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return PLACEHOLDER_SUBSTRINGS.some((token) => normalized.includes(token));
|
||||
});
|
||||
}
|
||||
|
||||
export function buildConfigFromRegistryEntry(entry: ServerRegistryEntry): McpServerConfig {
|
||||
const baseTimeout = entry.config.timeout ?? 30000;
|
||||
|
||||
switch (entry.config.type) {
|
||||
case 'stdio':
|
||||
return {
|
||||
type: 'stdio',
|
||||
command: entry.config.command ?? '',
|
||||
args: entry.config.args ?? [],
|
||||
env: entry.config.env ?? {},
|
||||
timeout: baseTimeout,
|
||||
connectionMode: 'lenient',
|
||||
};
|
||||
case 'sse':
|
||||
return {
|
||||
type: 'sse',
|
||||
url: entry.config.url ?? '',
|
||||
headers: entry.config.headers ?? {},
|
||||
timeout: baseTimeout,
|
||||
connectionMode: 'lenient',
|
||||
};
|
||||
case 'http':
|
||||
default:
|
||||
return {
|
||||
type: 'http',
|
||||
url: entry.config.url ?? '',
|
||||
headers: entry.config.headers ?? {},
|
||||
timeout: baseTimeout,
|
||||
connectionMode: 'lenient',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user