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.
| Project settings say who created the project, by name | 1 | /** |
| 2 | * Who may do what with a project's deployments: each method's capability | |
| 3 | * on the project's repository. Seeing deployments takes Read; deploying, | |
| 4 | * redeploying and taking an app down spend compute and take Write (`run`); | |
| 5 | * deployment settings and domains take Admin (`manage_integrations`). | |
| 6 | * Types only, so the table is tested apart from the service. | |
| 7 | */ | |
| 8 | ||
| 9 | import type { Capability, Project, RepoRef, User } from "@g1t/contracts"; | |
| 10 | ||
| 11 | export const NEEDS = { | |
| 12 | settings: "read", | |
| 13 | list: "read", | |
| 14 | get: "read", | |
| 15 | listDomains: "read", | |
| 16 | redeploy: "run", | |
| 17 | takeDown: "run", | |
| 18 | updateSettings: "manage_integrations", | |
| 19 | addDomain: "manage_integrations", | |
| 20 | removeDomain: "manage_integrations", | |
| 21 | refreshDomain: "manage_integrations", | |
| 22 | } as const satisfies Record<string, Capability>; | |
| 23 | ||
| 24 | export type Method = keyof typeof NEEDS; | |
| 25 | ||
| Merge main into rm-agents: mirroring removal, open signups, free-tier limits, the g1t CLI and runner fixes, with the agent removal kept. The CLI's table of operations is regenerated from the API without the agent, customize and AI credit operations; no CLI command used them. | 26 | /** The repository a project's permission comes from. */ |
| Project settings say who created the project, by name | 27 | export function repoRef(project: Project): RepoRef { |
| Merge main into rm-agents: mirroring removal, open signups, free-tier limits, the g1t CLI and runner fixes, with the agent removal kept. The CLI's table of operations is regenerated from the API without the agent, customize and AI credit operations; no CLI command used them. | 28 | return { id: project.source.repoId, namespace: project.source.repo.namespace, isPrivate: project.private }; |
| Project settings say who created the project, by name | 29 | } |
| 30 | ||
| 31 | /** | |
| 32 | * Whether whoever a pull request is for is trusted with a project's secrets | |
| Chat, artifacts and notifications no longer serve g1t's own agents. Direct messages and conversation invites take people only, and a space or folio is shared with people and teams. Chat stops waking agents, drops the RPCs agents posted, read, searched and handed off through, and stops answering buttons on agent cards; old cards keep their links. An agent's old messages still show, under its saved name or as "A deleted agent". Artifacts drops the folio and docs RPCs agents read and edited pages with, and an old agent member of a space can still be removed. Notifications drop "an agent is waiting on you". A deployment no longer trusts a pull request with secrets just because g1t's agent opened it, and the sign-up card no longer promises a team of agents. | 33 | * without asking what they may do: only g1t's own system work. A pull |
| 34 | * request g1t's former agent opened is its requester's (`workOwner`), or, | |
| 35 | * when nobody asked for it, trusted no further than anyone else: they are | |
| Project settings say who created the project, by name | 36 | * asked about like anyone else. |
| 37 | */ | |
| 38 | export function trustedOutright(owner: Pick<User, "kind">): boolean { | |
| Chat, artifacts and notifications no longer serve g1t's own agents. Direct messages and conversation invites take people only, and a space or folio is shared with people and teams. Chat stops waking agents, drops the RPCs agents posted, read, searched and handed off through, and stops answering buttons on agent cards; old cards keep their links. An agent's old messages still show, under its saved name or as "A deleted agent". Artifacts drops the folio and docs RPCs agents read and edited pages with, and an old agent member of a space can still be removed. Notifications drop "an agent is waiting on you". A deployment no longer trusts a pull request with secrets just because g1t's agent opened it, and the sign-up card no longer promises a team of agents. | 39 | return owner.kind === "system"; |
| Project settings say who created the project, by name | 40 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.