Skip to content
67 linesCodeBlameRaw

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 and memory, checks and conflicts, profiles, slug renames, custom domains1import { data } from "react-router";
2
3import type { Route } from "./+types/memory";
4import { page } from "../../lib/meta";
5import { AddMemory, MemoryList, memoryAction } from "../../components/memory";
6import { agents } from "../../lib/services.server";
7import { assertSameOrigin, getViewer, requireUser, roleIn, unwrap } from "../../lib/session.server";
The site is built from its shared components: one Button with its variants and sizes, one Badge, Card for every panel, Alert for notices, Kbd for keys, Table for the security tables, and Avatar, Command, Progress, ScrollArea, ToggleGroup, Collapsible and Accordion in the kit; raw buttons, hand-drawn cards and pills and per-file button class lists are gone, outline buttons stand the same height as filled ones, and the phone's Ask g1t loses its tile. Every page was compared pixel by pixel before and after.8import { Card } from "../../components/ui/card";
Agents and memory, checks and conflicts, profiles, slug renames, custom domains9
10export function meta({ params, ...args }: Route.MetaArgs) {
11 return page(args, { title: `Workspace memory · ${params.owner} · g1t` });
12}
13
14export async function loader({ params, context }: Route.LoaderArgs) {
15 const viewer = getViewer(context);
16 if (!roleIn(viewer, params.owner)) throw data(null, { status: 404 });
17 const memories = await agents.listMemories(viewer, params.owner);
18 return { workspace: unwrap(memories).workspace };
19}
20
21export async function action({ params, context, request }: Route.ActionArgs) {
22 assertSameOrigin(request);
23 const user = requireUser(context, request);
24 return memoryAction(agents, user, params.owner, null, await request.formData());
25}
26
27export default function WorkspaceMemory({ loaderData, params }: Route.ComponentProps) {
28 const { workspace } = loaderData;
29 const action = `/${params.owner}/-/memory`;
30 return (
31 <div className="space-y-8">
32 <div className="grid gap-3 text-sm sm:grid-cols-2">
The site is built from its shared components: one Button with its variants and sizes, one Badge, Card for every panel, Alert for notices, Kbd for keys, Table for the security tables, and Avatar, Command, Progress, ScrollArea, ToggleGroup, Collapsible and Accordion in the kit; raw buttons, hand-drawn cards and pills and per-file button class lists are gone, outline buttons stand the same height as filled ones, and the phone's Ask g1t loses its tile. Every page was compared pixel by pixel before and after.33 <Card className="p-4">
Agents and memory, checks and conflicts, profiles, slug renames, custom domains34 <p className="font-medium">Here: true in every project</p>
35 <p className="mt-1 text-muted">
36 "We use pnpm everywhere." "Staging lives at staging.example.com." "Every service logs
37 JSON to stdout." What an agent in any project should know.
38 </p>
The site is built from its shared components: one Button with its variants and sizes, one Badge, Card for every panel, Alert for notices, Kbd for keys, Table for the security tables, and Avatar, Command, Progress, ScrollArea, ToggleGroup, Collapsible and Accordion in the kit; raw buttons, hand-drawn cards and pills and per-file button class lists are gone, outline buttons stand the same height as filled ones, and the phone's Ask g1t loses its tile. Every page was compared pixel by pixel before and after.39 </Card>
40 <Card className="p-4">
Agents and memory, checks and conflicts, profiles, slug renames, custom domains41 <p className="font-medium">In a project: true of its code</p>
42 <p className="mt-1 text-muted">
43 How to build and test it, its conventions and its traps. Each project keeps its own under
44 Agents, Memory.
45 </p>
The site is built from its shared components: one Button with its variants and sizes, one Badge, Card for every panel, Alert for notices, Kbd for keys, Table for the security tables, and Avatar, Command, Progress, ScrollArea, ToggleGroup, Collapsible and Accordion in the kit; raw buttons, hand-drawn cards and pills and per-file button class lists are gone, outline buttons stand the same height as filled ones, and the phone's Ask g1t loses its tile. Every page was compared pixel by pixel before and after.46 </Card>
Agents and memory, checks and conflicts, profiles, slug renames, custom domains47 </div>
48
49 <AddMemory scope="workspace" action={action} placeholder="We use pnpm everywhere, never npm or yarn." />
50
51 <section>
52 <div className="flex items-baseline justify-between">
53 <h2 className="text-sm font-medium">What the workspace remembers</h2>
54 <span className="text-xs text-muted">{workspace.length} kept</span>
55 </div>
56 <div className="mt-3">
57 <MemoryList
58 memories={workspace}
59 action={action}
60 editable
61 empty="Nothing yet. Agents add what holds across projects as they learn it, and so can you."
62 />
63 </div>
64 </section>
65 </div>
66 );
67}