Add real-time developer messaging via NATS
- Add SendMessageTool for sending messages to other devs
- Add ReceiveMessagesTool for receiving messages
- Auto-detect sender role from workspace path (admin-dev/api-dev/web-dev)
- Messages published to NATS channels: dev.messages.{role}
- Enable real-time communication between Claude instances
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4,24 +4,26 @@ import { FileWriteTool } from './builtin/FileWriteTool';
|
||||
import { FileListTool } from './builtin/FileListTool';
|
||||
import { SystemCommandTool } from './builtin/SystemCommandTool';
|
||||
import { HttpRequestTool } from './builtin/HttpRequestTool';
|
||||
import { SendMessageTool, ReceiveMessagesTool } from './builtin/messaging';
|
||||
import { NatsClient } from '../nats/NatsClient';
|
||||
|
||||
export * from './base/ToolHandler';
|
||||
|
||||
// Registry of all built-in tools
|
||||
export const builtinTools: ToolHandler[] = [
|
||||
new FileReadTool(),
|
||||
new FileWriteTool(),
|
||||
new FileListTool(),
|
||||
new SystemCommandTool(),
|
||||
new HttpRequestTool(),
|
||||
];
|
||||
|
||||
export function createBuiltinTools(): Map<string, ToolHandler> {
|
||||
export function createBuiltinTools(natsClient: NatsClient): Map<string, ToolHandler> {
|
||||
const tools = new Map<string, ToolHandler>();
|
||||
|
||||
for (const tool of builtinTools) {
|
||||
tools.set(tool.name, tool);
|
||||
}
|
||||
|
||||
|
||||
// File operation tools
|
||||
tools.set('file_read', new FileReadTool());
|
||||
tools.set('file_write', new FileWriteTool());
|
||||
tools.set('file_list', new FileListTool());
|
||||
|
||||
// System tools
|
||||
tools.set('system_command', new SystemCommandTool());
|
||||
tools.set('http_request', new HttpRequestTool());
|
||||
|
||||
// Messaging tools (require NATS client)
|
||||
tools.set('send_message', new SendMessageTool(natsClient));
|
||||
tools.set('receive_messages', new ReceiveMessagesTool(natsClient));
|
||||
|
||||
return tools;
|
||||
}
|
||||
Reference in New Issue
Block a user