Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
"supertest": "^7.0.0",
"ts-jest": "29.1.4",
"ts-node": "10.9.2",
"typescript": "5.4.5"
"typescript": "^5.4.5"
}
}
12 changes: 8 additions & 4 deletions backend/src/agents/registry.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/**
* Agent startup and registration manager.
*
*
* Instantiates all agents and handles their self-registration on startup.
* This class is distinct from the {@link AgentRegistry} interface in
* `types/agent.ts`, which is the look-up interface used by the coordinator
* to resolve agents by type.
*/

import { ResearchAgent } from './research/research';
Expand All @@ -13,9 +16,10 @@ import { ReportAgent } from './report';
export interface AgentRegistryConfig {
apiBaseUrl?: string;
autoRegister?: boolean;

}

export class AgentRegistry {
export class AgentStartupRegistry {
private readonly agents: Array<{
instance: any;
capability: string;
Expand Down Expand Up @@ -104,12 +108,12 @@ export class AgentRegistry {
}

// Default singleton instance for easy usage
export const globalAgentRegistry = new AgentRegistry();
export const globalAgentRegistry = new AgentStartupRegistry();

/**
* Initialize all agents - call this on app startup.
*/
export async function initializeAgents(config?: AgentRegistryConfig): Promise<void> {
const registry = config ? new AgentRegistry(config) : globalAgentRegistry;
const registry = config ? new AgentStartupRegistry(config) : globalAgentRegistry;
await registry.initialize();
}
Loading