main
1import { Tool, ToolRegistry } from "./types.js";
2import { createStatusTool } from "./status.js";
3import { createOrgmodeTool } from "./orgmode.js";
4import { createResearchTool } from "./research.js";
5import { createWebSearchTool } from "./websearch.js";
6import { Config } from "../config.js";
7
8export function createToolRegistry(config: Config): ToolRegistry {
9 const tools = new Map<string, Tool>();
10
11 const registry: ToolRegistry = {
12 tools,
13 register: (tool: Tool) => {
14 tools.set(tool.name, tool);
15 },
16 get: (name: string) => tools.get(name),
17 list: () => Array.from(tools.values()),
18 getSchemas: () =>
19 Array.from(tools.values()).map((t) => ({
20 name: t.name,
21 description: t.description,
22 parameters: t.parameters,
23 })),
24 };
25
26 // Register default tools
27 registry.register(createStatusTool());
28 registry.register(createOrgmodeTool(config.paths.inboxPath));
29 registry.register(createResearchTool());
30 registry.register(createWebSearchTool());
31
32 return registry;
33}
34
35export type { Tool, ToolRegistry } from "./types.js";