g1t/apps/web/app/routes/repo/blob.tsx
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.
| Initial g1t: services, event bus, intents and attempts | 1 | import type { Route } from "./+types/blob"; |
| 2 | import { BlobView } from "../../components/repo-view"; | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 3 | import { highlight, highlightLines } from "../../lib/highlight.server"; |
| Rust repos service with shipping; pull requests kept in the model | 4 | import { repos } from "../../lib/services.server"; |
| Initial g1t: services, event bus, intents and attempts | 5 | import { getViewer, unwrap } from "../../lib/session.server"; |
| 6 | ||
| 7 | export function meta({ params }: Route.MetaArgs) { | |
| 8 | return [{ title: `${params["*"]} · ${params.owner}/${params.repo} · g1t` }]; | |
| 9 | } | |
| 10 | ||
| Agents as a team: lifecycle, merge queue, billing and a new shell | 11 | export async function loader({ params, context, request }: Route.LoaderArgs) { |
| 12 | const viewer = getViewer(context); | |
| Initial g1t: services, event bus, intents and attempts | 13 | const path = { namespace: params.owner, name: params.repo }; |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 14 | const file = params["*"] ?? ""; |
| 15 | const wantsBlame = new URL(request.url).searchParams.has("blame"); | |
| 16 | const [found, blame] = await Promise.all([ | |
| 17 | repos.blob(path, viewer, params.ref, file), | |
| 18 | wantsBlame ? repos.blame(path, viewer, params.ref, file) : null, | |
| 19 | ]); | |
| 20 | const blob = unwrap(found); | |
| 21 | if (blame?.ok && blob.text != null) { | |
| 22 | return { | |
| 23 | blob, | |
| 24 | html: null, | |
| 25 | blame: { blame: blame.value, lines: await highlightLines(blob.path, blob.text) }, | |
| 26 | }; | |
| 27 | } | |
| API and MCP server, Rust identity service, registration, site redesign | 28 | return { |
| 29 | blob, | |
| 30 | html: blob.text == null ? null : await highlight(blob.path, blob.text), | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 31 | blame: null, |
| API and MCP server, Rust identity service, registration, site redesign | 32 | }; |
| Initial g1t: services, event bus, intents and attempts | 33 | } |
| 34 | ||
| 35 | export default function Blob({ loaderData }: Route.ComponentProps) { | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 36 | return <BlobView blob={loaderData.blob} html={loaderData.html} blame={loaderData.blame} />; |
| Initial g1t: services, event bus, intents and attempts | 37 | } |