Textbook repo-per-table layout with a migration runner, pragma config, and a test-db helper — every repo has a matching .test.ts. Copy the structure wholesale as the local-persistence pattern for any Cobalt agent that shouldn't reach for Supabase.
// Source: https://github.com/danielwpz/pokoclaw | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import { eq } from "drizzle-orm";
import { toCanonicalUtcIsoTimestamp } from "@/src/shared/time.js";
import type { StorageDb } from "@/src/storage/db/client.js";
import { agents } from "@/src/storage/schema/tables.js";
import type { Agent, NewAgent } from "@/src/storage/schema/types.js";
export interface CreateAgentInput {
id: string;
conversationId: string;
mainAgentId?: string | null;
kind: string;
displayName?: string | null;
description?: string | null;
workdir?: string | null;
policyProfile?: string | null;
defaultModel?: string | null;
status?: string;
cre
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key