src / index.ts
/**
* @file index.ts
* Main entry point for the Persistent Memory plugin.
*/
import { toolsProvider } from "./toolsProvider";
import { configSchematics } from "./config";
import { type PluginContext } from "./pluginTypes";
/**
* Exported as a named function 'main' to match the entry point's expectation:
* import("./../src/index.ts").then(async module => { return await module.main(pluginContext); })
*/
export async function main(ctx: PluginContext) {
// Register the configuration UI
ctx.withConfigSchematics(configSchematics);
// Register the tool provider
ctx.withToolsProvider(async (ctl) => {
const tools = await toolsProvider(ctl);
if (!tools) {
throw new Error("toolsProvider returned null or undefined");
}
return tools;
});
console.log("[Persistent Memory] Plugin initialized successfully.");
}