Recorder
Lovable
Lovable apps run their AI work in Supabase Edge Functions. Add the TypeScript recorder, keep the events in a table in your own Supabase project, and download them with one command.
- Copy
harness-recorder.tsintosupabase/functions/_shared/. - Create the
harness_eventstable (below), with row level security and no policies. - Buffer each run's events and insert them once at the end of the function.
- Download the last 30 days with psql.
Table
create table harness_events (id bigint generated always as identity primary key,
ts timestamptz not null default now(), event jsonb not null);
alter table harness_events enable row level security;Edge function
import { Recorder, usageFrom } from "../_shared/harness-recorder.ts";
const lines: string[] = [];
const run = new Recorder("book-pipeline", "1.4.0", (l) => lines.push(l)).startRun(jobId);
const step = run.agent("writer", "prompts/writer@7", "google/gemini-3.1-pro");
const resp = await fetch(GATEWAY_URL, { method: "POST", headers, body }).then((r) => r.json());
step.modelCall(usageFrom(resp)); step.finish("ok"); run.finish("completed");
await supabase.from("harness_events").insert(lines.map((l) => ({ event: JSON.parse(l) })));Download (you run this)
psql "$SUPABASE_DB_URL" -At -c "select event::text from harness_events where ts > now() - interval '30 days' order by ts" > .harness/runs/supabase.jsonlWhere the log lands
In your own Supabase project.
How it reaches the harness
You download it with psql and your database URL.
Without the table, the recorder falls back to console.log, which shows up in the Edge Function logs.