/** * createPlugin() — the public entry point for building np-agent plugins. * * Usage: * createPlugin({ * async execute(req) { * // do work * return { success: true, data: { ... } }; * } * }).start(); */ import type { PluginHandler, Plugin } from "./types"; import { loadManifest } from "./internal/manifest"; import { startGrpcServer } from "./internal/grpc-server"; export function createPlugin(handler: PluginHandler): Plugin { return { start() { const manifest = loadManifest(); startGrpcServer(handler, manifest); }, }; }