Mirror the postgres-consumer shape (keycloak/nextcloud): requires the backing service(s), binds/secrets for the delivered credential, and a server container that reads it from an interpolated env file. - baserow: consumes postgres-database + redis-cache; tooled (dormant until an account is configured, like gitea's token). - letta: consumes postgres-database; tooled, live via a mesh-minted server-password injected into both server and runtime. - invoicing: consumes mongodb-database + s3-bucket; plain two-container service (app + api), no tools. Digests pinned for baserow and letta; invoicing keeps private-registry tags (DIGEST-UNRESOLVED). redis-cache and mongodb-database consumer shapes are inferred (no prior consumer in the catalog). Claude-Session: https://claude.ai/code/session_01LrgweAeERJYBg88c5cKDzF
39 lines
1.4 KiB
TypeScript
39 lines
1.4 KiB
TypeScript
// 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 [];
|
|
}
|
|
});
|