// baserow's tools — baserow's own code (novox/hq ADR 0039). They import baserow's own client // (../client) and plug into the mesh through the sdk's tool harness. Editing them rebuilds baserow // and nothing else. Absent credentials yield no tools rather than a failure. import { registerModuleTools, type ToolDefinition } from "@novox/mesh-sdk/tools"; import { BaserowClient } from "../client.js"; export function getBaserowTools(baserow: BaserowClient): ToolDefinition[] { return [ { name: "baserow_list_databases", description: "List the Baserow applications (databases) the configured account can see.", input: {}, run: async () => ({ applications: await baserow.listApplications() }), }, { name: "baserow_list_rows", description: "List rows in a Baserow table by its numeric id.", input: { table_id: { type: "number", description: "the numeric table id" }, size: { type: "number", description: "max rows to return (default 100)" }, }, run: async (args) => { const tableId = Number(args.table_id); const size = args.size ? Number(args.size) : 100; return { rows: await baserow.listRows(tableId, size) }; }, }, ]; } registerModuleTools("baserow", (env) => { try { return getBaserowTools(BaserowClient.fromEnv(env)); } catch { return []; } });