flagon-io/g1t

public

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t/apps/web/app/routes/repo/audit-live.ts

19 lines768 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Agents get guardrails, run credentials, an audit log, a context hub, repository instructions and mentions; security upkeep; snake_case API1/**
2 * What a project's agent runs did, from the workspace's audit log, as
3 * JSON: for the Agent panel on a pull request. Members only; anyone else
4 * gets an empty list.
5 */
6import type { Route } from "./+types/audit-live";
7import { runAudit } from "../../lib/audit.server";
8import { getViewer } from "../../lib/session.server";
9
10export async function loader({ params, context, request }: Route.LoaderArgs) {
11 const viewer = getViewer(context);
12 const runIds = new URL(request.url).searchParams
13 .getAll("run")
14 .map((id) => id.trim())
15 .filter((id) => /^[A-Za-z0-9_-]{1,64}$/.test(id))
16 .slice(0, 20);
17 const entries = await runAudit(viewer, params.owner, runIds);
18 return Response.json({ entries }, { headers: { "cache-control": "no-store" } });
19}