g1t/apps/web/app/lib/opened-by.ts

22 lines863 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.

g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent1import type { Pull } from "@g1t/contracts";
2
3/** g1t's own name: its agent's, and the system's. */
4export const G1T = "g1t";
5
6/**
7 * Whether g1t's own agent made a pull request: in a fork of its own, not
8 * on a branch someone pushed.
9 */
10export function madeByG1t(pull: Pick<Pull, "agent" | "branch">): boolean {
11 return pull.agent === G1T && !pull.branch;
12}
13
14/**
g1t is the stored author of what it opens; the person who asked is requested_by and keeps the author's rights15 * Who opened an issue or a pull request, and who asked g1t for it, as
16 * stored: g1t for what it made or filed, with the person it was for as
17 * `requestedBy`; anyone else's, theirs alone. Who may change it is the
18 * same pair read the other way round: `workOwner` in the contracts.
g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent19 */
g1t is the stored author of what it opens; the person who asked is requested_by and keeps the author's rights20export function openedBy(item: Pick<Pull, "author" | "requestedBy">): { name: string; requestedBy: string | null } {
21 return { name: item.author.username, requestedBy: item.requestedBy?.username ?? null };
g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent22}