refactor(boltbot): decouple EigenCloud provider, audit-only mode

This commit is contained in:
duy 2026-01-29 16:14:22 -08:00
parent 1382694aaa
commit 9e6e431c59
2 changed files with 9 additions and 12 deletions

View File

@ -1,6 +1,5 @@
import type { MoltbotPluginApi } from "clawdbot/plugin-sdk";
import { emptyPluginConfigSchema } from "clawdbot/plugin-sdk";
import { eigenCloudProvider } from "./src/provider.js";
import { createActionLogger } from "./src/action-logger.js";
import { createReceiptStore } from "./src/receipt-store.js";
import { registerBoltbotApi } from "./src/api.js";
@ -8,13 +7,11 @@ import { registerDashboardRoutes } from "./src/dashboard-serve.js";
export default {
id: "boltbot",
name: "Boltbot — Trustless Hosting",
description: "EigenCloud verification layer for Moltbot",
name: "Boltbot — Audit Dashboard",
description: "Tool-call audit trail and verification dashboard for Moltbot",
configSchema: emptyPluginConfigSchema(),
register(api: MoltbotPluginApi) {
api.registerProvider(eigenCloudProvider);
const store = createReceiptStore(process.env.BOLTBOT_RECEIPT_BACKEND);
const logger = createActionLogger(store);
api.on("after_tool_call", logger);

View File

@ -25,7 +25,7 @@ describe("boltbot plugin integration", () => {
const mod = await import("../../index.js");
const plugin = mod.default;
expect(plugin.id).toBe("boltbot");
expect(plugin.name).toBe("Boltbot — Trustless Hosting");
expect(plugin.name).toBe("Boltbot — Audit Dashboard");
});
it("register wires provider, hook, and routes", async () => {
@ -46,20 +46,20 @@ describe("boltbot plugin integration", () => {
plugin.register(mockApi as any);
// REQ-1: Provider registered
expect(registered.providers).toHaveLength(1);
expect(registered.providers[0].id).toBe("eigencloud");
// No provider in audit-only mode
expect(registered.providers).toHaveLength(0);
// REQ-3: after_tool_call hook registered
// after_tool_call hook registered
expect(registered.hooks).toHaveLength(1);
expect(registered.hooks[0].name).toBe("after_tool_call");
// REQ-7: 3 HTTP routes registered
expect(registered.routes).toHaveLength(3);
// 4 HTTP routes: receipts, receipt, stats, dashboard
expect(registered.routes).toHaveLength(4);
const paths = registered.routes.map((r: any) => r.path);
expect(paths).toContain("/boltbot/receipts");
expect(paths).toContain("/boltbot/receipt");
expect(paths).toContain("/boltbot/stats");
expect(paths).toContain("/boltbot/dashboard");
});
it("after_tool_call hook fires and creates receipt", async () => {