@@ -42,19 +42,37 @@ await coordinator.initialize({
4242#### Agent Registration
4343
4444``` typescript
45- import { PlannerAgent , ExplorerAgent , PrAgent } from ' @lytics/dev-agent-subagents' ;
45+ import {
46+ PlannerAgent ,
47+ ExplorerAgent ,
48+ GitHubAgent ,
49+ PrAgent
50+ } from ' @lytics/dev-agent-subagents' ;
51+ import { RepositoryIndexer } from ' @lytics/dev-agent-core' ;
52+
53+ // Initialize code indexer (required for Explorer and GitHub agents)
54+ const codeIndexer = new RepositoryIndexer ({
55+ repositoryPath: ' /path/to/repo' ,
56+ vectorStorePath: ' /path/to/.dev-agent/vectors' ,
57+ });
58+ await codeIndexer .initialize ();
4659
4760// Register agents
4861coordinator .registerAgent (new PlannerAgent ());
4962coordinator .registerAgent (new ExplorerAgent ());
63+ coordinator .registerAgent (new GitHubAgent ({
64+ repositoryPath: ' /path/to/repo' ,
65+ codeIndexer ,
66+ storagePath: ' /path/to/.github-index' ,
67+ }));
5068coordinator .registerAgent (new PrAgent ());
5169
5270// Check registered agents
5371const agents = coordinator .getAgentNames ();
54- // => ['planner', 'explorer', 'pr']
72+ // => ['planner', 'explorer', 'github', ' pr']
5573
56- const plannerConfig = coordinator .getAgentConfig (' planner ' );
57- // => { name: 'planner ', capabilities: ['plan ', 'break-down-tasks '] }
74+ const githubConfig = coordinator .getAgentConfig (' github ' );
75+ // => { name: 'github ', capabilities: ['github-index ', 'github-search', 'github-context', 'github-related '] }
5876```
5977
6078#### Message Routing
@@ -390,24 +408,33 @@ import {
390408 SubagentCoordinator ,
391409 PlannerAgent ,
392410 ExplorerAgent ,
411+ GitHubAgent ,
393412 CoordinatorLogger ,
394413} from ' @lytics/dev-agent-subagents' ;
414+ import { RepositoryIndexer } from ' @lytics/dev-agent-core' ;
395415
396416async function main() {
397417 // 1. Initialize logger
398418 const logger = new CoordinatorLogger (' dev-agent' , ' info' );
399419
400- // 2. Initialize coordinator
401- const coordinator = new SubagentCoordinator ();
402- await coordinator .initialize ({
420+ // 2. Initialize code indexer
421+ const codeIndexer = new RepositoryIndexer ({
403422 repositoryPath: ' /path/to/repo' ,
404423 vectorStorePath: ' /path/to/.dev-agent/vectors' ,
405- maxConcurrentTasks: 5 ,
406424 });
425+ await codeIndexer .initialize ();
426+
427+ // 3. Initialize coordinator
428+ const coordinator = new SubagentCoordinator ();
407429
408- // 3 . Register agents
430+ // 4 . Register agents
409431 coordinator .registerAgent (new PlannerAgent ());
410432 coordinator .registerAgent (new ExplorerAgent ());
433+ coordinator .registerAgent (new GitHubAgent ({
434+ repositoryPath: ' /path/to/repo' ,
435+ codeIndexer ,
436+ storagePath: ' /path/to/.github-index' ,
437+ }));
411438
412439 logger .info (' Coordinator ready' , {
413440 agents: coordinator .getAgentNames (),
@@ -450,12 +477,35 @@ async function main() {
450477 }
451478 }
452479
453- // 6. Check system stats
480+ // 6. Search GitHub for related context
481+ const githubResponse = await coordinator .sendMessage ({
482+ id: ' github-001' ,
483+ type: ' request' ,
484+ sender: ' user' ,
485+ recipient: ' github' ,
486+ payload: {
487+ action: ' search' ,
488+ query: ' rate limiting implementation' ,
489+ searchOptions: { limit: 5 },
490+ },
491+ timestamp: Date .now (),
492+ priority: 7 ,
493+ });
494+
495+ if (githubResponse ?.payload .results ) {
496+ logger .info (' GitHub context found' , {
497+ count: githubResponse .payload .results .length ,
498+ results: githubResponse .payload .results ,
499+ });
500+ }
501+
502+ // 7. Check system stats
454503 const stats = coordinator .getStats ();
455504 logger .info (' System stats' , stats );
456505
457- // 7. Shutdown gracefully
458- await coordinator .shutdown ();
506+ // 8. Shutdown gracefully
507+ await coordinator .stop ();
508+ await codeIndexer .close ();
459509}
460510
461511main ().catch (console .error );
0 commit comments