import { registerBrowserAgentActRoutes } from "./agent.act.js";
import { registerBrowserAgentDebugRoutes } from "./agent.debug.js";
import { registerBrowserAgentSnapshotRoutes } from "./agent.snapshot.js";
import { registerBrowserAgentStorageRoutes } from "./agent.storage.js";
// Adapter to make express.Express compatible with BrowserRouteRegistrar
function createExpressAdapter(app) {
    return {
        get: (path, handler) => app.get(path, handler),
        post: (path, handler) => app.post(path, handler),
        delete: (path, handler) => app.delete(path, handler),
    };
}
export function registerBrowserAgentRoutes(app, ctx) {
    // If app is express.Express, wrap it; otherwise use it directly
    const registrar = "use" in app ? createExpressAdapter(app) : app;
    registerBrowserAgentSnapshotRoutes(registrar, ctx);
    registerBrowserAgentActRoutes(registrar, ctx);
    registerBrowserAgentDebugRoutes(registrar, ctx);
    registerBrowserAgentStorageRoutes(registrar, ctx);
}
