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.
| Chat and workspace agents: channels, DMs and named agents you talk to | 1 | import { Code2, MessagesSquare } from "lucide-react"; |
| 2 | import { Link, data } from "react-router"; | |
| 3 | ||
| 4 | import type { Route } from "./+types/code-access"; | |
| 5 | import { page } from "../../lib/meta"; | |
| 6 | import { identity } from "../../lib/services.server"; | |
| 7 | import { requireUser, roleIn } from "../../lib/session.server"; | |
| 8 | ||
| 9 | export function meta({ params, ...args }: Route.MetaArgs) { | |
| 10 | return page(args, { title: `Code access · ${params.owner} · g1t` }); | |
| 11 | } | |
| 12 | ||
| 13 | /** | |
| 14 | * What a member without Code access sees in place of a repository, an | |
| The docs folder is gone, and what it held lives where people read it: how a self-hosted g1t runs and how to deploy g1t to Cloudflare are pages on docs.g1t.sh under Run g1t yourself, and speed, rate limits and operating g1t.sh are sections of CONTRIBUTING.md; code that cited a file in docs/ now points to the page or section that covers it, or says what it means itself, and applied migrations and the runner images are left as they were. | 15 | * issue, a pull request or a project list: what it was, and who to ask. |
| Chat and workspace agents: channels, DMs and named agents you talk to | 16 | */ |
| 17 | export async function loader({ params, context, request }: Route.LoaderArgs) { | |
| 18 | const viewer = requireUser(context, request); | |
| 19 | if (!roleIn(viewer, params.owner)) throw data(null, { status: 404 }); | |
| 20 | const members = await identity.listMembers(params.owner, viewer).catch(() => null); | |
| 21 | const owners = members?.ok ? members.value.filter((m) => m.role === "owner").slice(0, 4).map((m) => m.username) : []; | |
| 22 | const from = new URL(request.url).searchParams.get("from"); | |
| 23 | // Only a path on this site, shown as text. | |
| 24 | return { owners, from: from && /^\/[^/]/.test(from) ? from.split("?")[0] : null }; | |
| 25 | } | |
| 26 | ||
| 27 | export default function CodeAccess({ loaderData, params }: Route.ComponentProps) { | |
| 28 | const { owners, from } = loaderData; | |
| 29 | const what = from ? from.split("/").filter(Boolean).slice(1).join("/") : null; | |
| 30 | return ( | |
| 31 | <div className="mx-auto max-w-lg py-10 text-center"> | |
| 32 | <span className="mx-auto flex size-12 items-center justify-center rounded-xl border border-line bg-surface text-muted"> | |
| 33 | <Code2 size={22} /> | |
| 34 | </span> | |
| 35 | <h1 className="mt-5 text-2xl font-semibold tracking-tight">Ask an owner for Code access</h1> | |
| 36 | <p className="mt-2 text-[0.9375rem] leading-relaxed text-muted"> | |
| 37 | {what ? ( | |
| 38 | <> | |
| 39 | <span className="font-mono text-fg-soft">{what}</span> is part of Code in {params.owner}. | |
| 40 | </> | |
| 41 | ) : ( | |
| 42 | <>This is part of Code in {params.owner}.</> | |
| 43 | )}{" "} | |
| g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them. | 44 | Your membership includes Chat, Artifacts, Agents and Notifications. An owner can turn on Code access for you. |
| Chat and workspace agents: channels, DMs and named agents you talk to | 45 | </p> |
| 46 | {owners.length > 0 && ( | |
| 47 | <p className="mt-4 text-sm text-muted"> | |
| 48 | Owners:{" "} | |
| 49 | {owners.map((owner, index) => ( | |
| 50 | <span key={owner}> | |
| 51 | {index > 0 && ", "} | |
| 52 | <Link to={`/u/${owner}`} className="font-medium text-fg hover:text-accent"> | |
| 53 | @{owner} | |
| 54 | </Link> | |
| 55 | </span> | |
| 56 | ))} | |
| 57 | </p> | |
| 58 | )} | |
| 59 | <div className="mt-8 flex justify-center gap-2"> | |
| 60 | <Link | |
| 61 | to={`/${params.owner}/-/chat`} | |
| 62 | className="inline-flex h-9 items-center gap-2 rounded-md bg-accent px-3.5 text-sm font-medium text-bg transition-colors hover:bg-accent-hover" | |
| 63 | > | |
| 64 | <MessagesSquare size={15} /> | |
| 65 | Back to Chat | |
| 66 | </Link> | |
| 67 | <Link | |
| g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them. | 68 | to={`/${params.owner}/-/today`} |
| Chat and workspace agents: channels, DMs and named agents you talk to | 69 | className="inline-flex h-9 items-center rounded-md border border-line px-3.5 text-sm font-medium text-fg/90 transition-colors hover:border-line-strong hover:bg-surface" |
| 70 | > | |
| g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them. | 71 | Today |
| Chat and workspace agents: channels, DMs and named agents you talk to | 72 | </Link> |
| 73 | </div> | |
| 74 | <p className="mt-6 text-xs text-faint">Agents can still explain how things work and what changed; they never show source code.</p> | |
| 75 | </div> | |
| 76 | ); | |
| 77 | } |