Main entry point: - create-hooks.ts, create-tools.ts, create-managers.ts - plugin-interface.ts: plugin interface types - plugin/ directory: plugin lifecycle modules Config handler: - agent-config-handler.ts, command-config-handler.ts - tool-config-handler.ts, mcp-config-handler.ts - provider-config-handler.ts, category-config-resolver.ts - agent-priority-order.ts, prometheus-agent-config-builder.ts - plugin-components-loader.ts
24 lines
580 B
TypeScript
24 lines
580 B
TypeScript
const CORE_AGENT_ORDER = ["sisyphus", "hephaestus", "prometheus", "atlas"] as const;
|
|
|
|
export function reorderAgentsByPriority(
|
|
agents: Record<string, unknown>,
|
|
): Record<string, unknown> {
|
|
const ordered: Record<string, unknown> = {};
|
|
const seen = new Set<string>();
|
|
|
|
for (const key of CORE_AGENT_ORDER) {
|
|
if (Object.prototype.hasOwnProperty.call(agents, key)) {
|
|
ordered[key] = agents[key];
|
|
seen.add(key);
|
|
}
|
|
}
|
|
|
|
for (const [key, value] of Object.entries(agents)) {
|
|
if (!seen.has(key)) {
|
|
ordered[key] = value;
|
|
}
|
|
}
|
|
|
|
return ordered;
|
|
}
|