14 lines
627 B
TypeScript
14 lines
627 B
TypeScript
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
import { registerWebSearchConfigCommand } from "./src/commands/web-search-config.ts";
|
|
import { createWebSearchRuntime } from "./src/runtime.ts";
|
|
import { createWebFetchTool } from "./src/tools/web-fetch.ts";
|
|
import { createWebSearchTool } from "./src/tools/web-search.ts";
|
|
|
|
export default function webSearch(pi: ExtensionAPI) {
|
|
const runtime = createWebSearchRuntime();
|
|
|
|
pi.registerTool(createWebSearchTool({ executeSearch: runtime.search }));
|
|
pi.registerTool(createWebFetchTool({ executeFetch: runtime.fetch }));
|
|
registerWebSearchConfigCommand(pi);
|
|
}
|