Skip to content
1,409 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.

Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running1//! The OpenAPI document, generated from the same list the routes are.
2//!
3//! The docs site builds its API reference from a copy of this document,
4//! `apps/docs/src/data/openapi.json`. A test keeps the copy current: run
5//! `G1T_WRITE_OPENAPI=1 cargo test -p g1t-api openapi` to rewrite it.
6
7use g1t_contracts::scopes::scope_for;
8use serde_json::{Map, Value, json};
9
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb9710use crate::about::AboutOp;
The artifacts service is services/artifacts, the Worker g1t-artifacts, bound as ARTIFACTS by the API, the site and the agents; its live rooms move to it with a Durable Object transfer from g1t-docs-service, and its database, bucket, indexes and queue keep their names. The git store's binding and settings are GITSTORE, its ops scripts gitstore-*, and workflow run artifacts keep their compatible API under run_artifacts modules. The deploy tool puts a Worker that has never deployed before the Workers in its stage that bind to it, and the deploy guide gives the cutover runbook.11use crate::run_artifacts::ArtifactsOp;
Merge branch 'worktree-agent-a3b9b1f730f55b5bf'12use crate::caches::CachesOp;
Merge GitHub pull request #8 (claude/cool-newton-7nm8r9): Docker deployments on g1t.page behind a switch that stays off until Cloudflare's container APIs are checked live, workflows a workspace manages in its repositories, tarball and zipball downloads, refs/pull/* kept to g1t alone, framework detection for g1t.page builds, and a workflow's event payload matching GitHub's.13use crate::archives::ArchiveOp;
Merge branch 'worktree-agent-a5a5de74d8863d554' into worktree-agent-a16631325aecf58ca14use crate::deploy_keys::DeployKeysOp;
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb9715use crate::deployments::DeploymentsOp;
Projects have Observability: their requests, logs, traces, metrics and errors, from apps on g1t.page with nothing to set up, and from software anywhere else over OpenTelemetry.16use crate::telemetry::TelemetryOp;
Merge packages: roles, Actions access, source label, soft delete, API17use crate::packages::PackagesOp;
Merge main into Artifacts Phase 218use crate::folios::FoliosOp;
Merge branch 'worktree-agent-a6ec0a89d7fe7a9ae'19use crate::coordination::CoordinationOp;
Merge branch 'worktree-agent-a3abfcce648e87dca'20use crate::protection::ProtectionOp;
API and MCP for a workspace's personal access token rules, members' tokens and approvals21use crate::token_policy::TokenOp;
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running22use crate::operations::Op;
Merge checks: statuses and check runs on every commit23use crate::checks::ChecksOp;
Merge rulesets: branch and tag rules, agent-first, enforced on push and merge24use crate::rules::RulesOp;
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar25use crate::security::SecurityOp;
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running26use crate::rest::{ROUTES, Route};
27
28/// The sections of the API reference: a name, what it covers, and its
29/// operations in the order a reader meets them.
30const SECTIONS: &[(&str, &str, &[Op])] = &[
31 (
32 "Accounts",
33 "Signing in from a tool, who a token acts as, and your email addresses.",
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)34 &[Op::Whoami, Op::ListEmails, Op::AddEmail, Op::ConfirmEmail, Op::RemoveEmail, Op::UpdateEmailSettings],
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running35 ),
36 (
API: notifications over REST and MCP, with notifications scopes37 "Notifications",
38 "Your inbox: a thread for each thing you were told about (an issue, a pull request, a workflow on a branch, a deployment), why you were told, and what you subscribe to and watch. Your own: personal tokens and sessions only.",
39 &[
40 Op::ListNotifications,
41 Op::MarkNotificationsRead,
42 Op::GetNotificationThread,
43 Op::MarkThreadRead,
44 Op::MarkThreadDone,
45 Op::SaveThread,
46 Op::SnoozeThread,
47 Op::GetThreadSubscription,
48 Op::SetThreadSubscription,
49 Op::DeleteThreadSubscription,
50 Op::GetRepoSubscription,
51 Op::SetRepoSubscription,
52 Op::DeleteRepoSubscription,
53 Op::ListWatchedRepos,
54 ],
55 ),
56 (
API: pinned projects over REST and MCP57 "Pinned projects",
58 "The projects you keep at the top of a workspace's sidebar, in your order, up to eight a workspace. Your own: personal tokens and sessions only.",
59 &[Op::ListPinnedProjects, Op::PinProject, Op::UnpinProject, Op::ReorderPinnedProjects],
60 ),
61 (
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb9762 "Projects",
63 "A project is what a workspace builds and runs, from a repository or a root directory in one. Each says what it is, where it runs and where to find it: its homepage, docs and other links.",
64 &[Op::ListProjects, Op::GetProject, Op::UpdateProject],
65 ),
66 (
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running67 "Workspaces",
68 "A workspace owns repositories and is the first part of their address. People and agents work in workspaces.",
g1t coordinates the work and the person's own sessions do it: Ask g1t reads g1t with the same tools any agent gets, answers in one conversation shared with the @g1t direct message in Chat, and hands work to sessions in the person's own harness, whose subagents g1t records, ties to issues and pull requests, and lets see each other.69 &[Op::GetWorkspace, Op::CreateWorkspace, Op::UpdateWorkspace, Op::DeleteWorkspace, Op::GetWorkspaceActivity],
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running70 ),
71 (
API and MCP for a workspace's personal access token rules, members' tokens and approvals72 "Personal access tokens",
One kind of access token; presence and status; usernames keep their case; the tour is a miniature of the real app; icons for password managers73 "A workspace's rules for its members' personal access tokens: whether tokens made for all of a member's workspaces reach it, whether tokens may be made for it alone and wait for an owner's approval, and how long a token may last; the tokens that reach it, approving or denying the ones that wait, and revoking one there. Owners only, as people.",
API and MCP for a workspace's personal access token rules, members' tokens and approvals74 &[
75 Op::Tokens(TokenOp::GetTokenPolicy),
76 Op::Tokens(TokenOp::SetTokenPolicy),
77 Op::Tokens(TokenOp::ListMemberTokens),
78 Op::Tokens(TokenOp::ListTokenRequests),
79 Op::Tokens(TokenOp::ReviewTokenRequest),
80 Op::Tokens(TokenOp::RevokeMemberToken),
81 ],
82 ),
83 (
Merge main (membership, two-factor, GitHub repo roles) into tokens84 "Members",
85 "A workspace's members and owners: who belongs to it, their roles (owner or member, with billing manager and security manager on top), handing it to another member, and leaving it.",
86 &[Op::ListMembers, Op::UpdateMember, Op::RemoveMember, Op::TransferOwnership, Op::LeaveWorkspace],
87 ),
88 (
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running89 "Invites",
Anyone on g1t can invite a friend again: Invite a friend, in the account menu with how many are left beside it, opens Settings → Invites to g1t with a dialog for their email address and a note. The friend gets an email from them whose link opens sign-up with the address filled in and, because it came from that email, confirmed; their account starts with a workspace of its own, and the page lists every invite sent with where it stands (Pending, confirming their email, Joined as @them), with Copy link, Send again and Revoke on each. It is word of mouth, never a gate: sign-ups stay open to everyone, nothing asks for an invite, and running out says friends can still sign up without one.90 "Inviting a friend to g1t by email, inviting people into a workspace by username or email, and answering the invitations to workspaces sent to you. Anyone can sign up for g1t without an invite.",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running91 &[
Anyone on g1t can invite a friend again: Invite a friend, in the account menu with how many are left beside it, opens Settings → Invites to g1t with a dialog for their email address and a note. The friend gets an email from them whose link opens sign-up with the address filled in and, because it came from that email, confirmed; their account starts with a workspace of its own, and the page lists every invite sent with where it stands (Pending, confirming their email, Joined as @them), with Copy link, Send again and Revoke on each. It is word of mouth, never a gate: sign-ups stay open to everyone, nothing asks for an invite, and running out says friends can still sign up without one.92 Op::ListInvites,
93 Op::CreateInvite,
94 Op::RevokeInvite,
95 Op::ResendInvite,
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running96 Op::ListWorkspaceInvites,
97 Op::InviteMember,
98 Op::RevokeWorkspaceInvite,
Merge workspace invitations: nobody joins a workspace without saying yes, people are found by username, your own invites can bring someone in, and nobody is left without a workspace (identity 0040)99 Op::ListInvitations,
100 Op::AcceptInvitation,
101 Op::DeclineInvitation,
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running102 ],
103 ),
104 (
Usage, Billing settings and prepaid AI credit; fixes from the UX audit105 "Billing",
Billing, integrations, security and identity no longer serve g1t's own agents. Billing stops metering agent runs, model tokens and AI Gateway requests, drops its model catalogue and price-keeper model prices, and stops selling AI credit, which only ever paid for those; credit bought earlier still pays toward what is owed. A usage report, statement or invoice that holds an old agent or model meter shows it as "Other usage" rather than failing, and the get_ai_credit and buy_ai_credit API operations and MCP billing actions go. Integrations no longer connects model providers or routes models, and no longer assigns imported issues or alerts to g1t; a model provider already connected can still be disconnected. Security drops "Fix with g1t". Identity no longer creates agent tokens or puts agents on teams, a team's lead is a person, and run credentials are issued only for checks, the merge queue, merge checks, deployments and bumps; tokens and credentials already issued keep working until they expire. The reserved names g1t and g1t-agent stay reserved. No tables are dropped.106 "A workspace's usage, its budget and its invoices. Members read them; owners change the budget, as people. A run's token never changes billing.",
Usage, Billing settings and prepaid AI credit; fixes from the UX audit107 &[
108 Op::GetUsage,
109 Op::GetBudget,
110 Op::SetBudget,
111 Op::ListInvoices,
112 Op::GetBillingDetails,
113 ],
114 ),
115 (
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running116 "Repositories",
Merge GitHub pull request #8 (claude/cool-newton-7nm8r9): Docker deployments on g1t.page behind a switch that stays off until Cloudflare's container APIs are checked live, workflows a workspace manages in its repositories, tarball and zipball downloads, refs/pull/* kept to g1t alone, framework detection for g1t.page builds, and a workflow's event payload matching GitHub's.117 "A repository, how it handles pull requests, and its timeline: renaming, archiving, moving and deleting it; and its files at a branch, tag or commit as a tarball or zipball.",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running118 &[
119 Op::ListRepos,
120 Op::CreateRepo,
121 Op::GetRepo,
g1t coordinates the work and the person's own sessions do it: Ask g1t reads g1t with the same tools any agent gets, answers in one conversation shared with the @g1t direct message in Chat, and hands work to sessions in the person's own harness, whose subagents g1t records, ties to issues and pull requests, and lets see each other.122 Op::GetContents,
123 Op::ListCommits,
Merge GitHub pull request #8 (claude/cool-newton-7nm8r9): Docker deployments on g1t.page behind a switch that stays off until Cloudflare's container APIs are checked live, workflows a workspace manages in its repositories, tarball and zipball downloads, refs/pull/* kept to g1t alone, framework detection for g1t.page builds, and a workflow's event payload matching GitHub's.124 Op::Archives(ArchiveOp::DownloadTarball),
125 Op::Archives(ArchiveOp::DownloadZipball),
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running126 Op::UpdateRepo,
127 Op::RenameRepo,
128 Op::RenameBranch,
The Branches page does things to branches now. It has tabs (Overview, Yours, Active, Stale, All, kept in the address as ?tab=) and search; Overview shows the default branch, then the first five of your branches, the active ones and the stale ones, each linking to the rest. Each branch is a row with its name in a code chip with a copy button, who made its latest commit and when, that commit's checks, behind and ahead counts with bars drawn against the largest shown, and its pull request (the open one, else the newest merged or closed) with its state; on a phone the columns fold under the name. Yours is branches whose latest commit is the viewer's; stale is no commit in 90 days.129 Op::CreateBranch,
130 Op::DeleteBranch,
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running131 Op::SetRepoVisibility,
132 Op::ArchiveRepo,
133 Op::UnarchiveRepo,
134 Op::TransferRepo,
135 Op::DeleteRepo,
136 Op::ListDeletedRepos,
137 Op::RestoreRepo,
138 Op::PurgeRepo,
139 Op::GetRepoSettings,
140 Op::UpdateRepoSettings,
141 Op::ListCheckNames,
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar142 Op::GetCodeownersErrors,
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running143 Op::ListEvents,
144 ],
145 ),
146 (
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97147 "Repository insights",
148 "What a repository's default branch says about it, read in the background and kept by commit: the languages it is written in, who made it, and its license.",
149 &[Op::About(AboutOp::GetLanguages), Op::About(AboutOp::ListContributors), Op::About(AboutOp::GetLicense)],
150 ),
151 (
152 "Stars",
153 "Starring a repository, to keep it and to say you like it: who starred one, and what you starred.",
154 &[
155 Op::About(AboutOp::ListStargazers),
156 Op::About(AboutOp::ListStarred),
157 Op::About(AboutOp::CheckStarred),
158 Op::About(AboutOp::Star),
159 Op::About(AboutOp::Unstar),
160 ],
161 ),
162 (
163 "Releases",
164 "A release is a tag published with a title and notes. The latest is the newest published one that is neither a draft nor a prerelease.",
165 &[
166 Op::About(AboutOp::ListReleases),
167 Op::About(AboutOp::CreateRelease),
168 Op::About(AboutOp::GetLatestRelease),
169 Op::About(AboutOp::GetReleaseByTag),
170 Op::About(AboutOp::GetRelease),
171 Op::About(AboutOp::UpdateRelease),
172 Op::About(AboutOp::DeleteRelease),
173 ],
174 ),
175 (
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running176 "Access",
Merge branch 'worktree-agent-a5a5de74d8863d554' into worktree-agent-a16631325aecf58ca177 "Who can do what in a repository: repository roles, people given a role on one repository (outside collaborators when they are not members), invitations, a workspace's base permission, and deploy keys: SSH keys that reach one repository.",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running178 &[
179 Op::ListCollaborators,
180 Op::AddCollaborator,
181 Op::UpdateCollaborator,
182 Op::RemoveCollaborator,
183 Op::GetCollaboratorPermission,
184 Op::ListRepoInvitations,
185 Op::RevokeRepoInvitation,
186 Op::ListMyRepoInvitations,
187 Op::AcceptRepoInvitation,
188 Op::DeclineRepoInvitation,
189 Op::SetBasePermission,
190 Op::ListOutsideCollaborators,
Merge branch 'worktree-agent-a5a5de74d8863d554' into worktree-agent-a16631325aecf58ca191 Op::DeployKeys(DeployKeysOp::ListDeployKeys),
192 Op::DeployKeys(DeployKeysOp::GetDeployKey),
193 Op::DeployKeys(DeployKeysOp::CreateDeployKey),
194 Op::DeployKeys(DeployKeysOp::DeleteDeployKey),
Merge branch 'mirroring' into artifacts-mode195 ],
196 ),
197 (
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar198 "Teams",
199 "Groups of a workspace's members: given a role on repositories together, mentioned together as @workspace/team, and asked to review together. Any member may create a team; the workspace's owners and the team's maintainers manage it.",
200 &[
201 Op::ListTeams,
202 Op::CreateTeam,
203 Op::GetTeam,
204 Op::UpdateTeam,
205 Op::DeleteTeam,
206 Op::ListTeamMembers,
207 Op::SetTeamMember,
208 Op::RemoveTeamMember,
209 Op::ListChildTeams,
210 Op::ListTeamRepos,
211 Op::SetTeamRepo,
212 Op::RemoveTeamRepo,
213 Op::SetTeamReviewAssignment,
214 Op::ListUserTeams,
215 ],
216 ),
217 (
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running218 "Security",
219 "Secrets found in what is pushed and in a repository's history, and dependencies with known vulnerabilities: listing the alerts, and dismissing or reopening them.",
220 &[Op::ListSecurityAlerts, Op::DismissSecurityAlert, Op::ReopenSecurityAlert],
221 ),
222 (
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar223 "Secret scanning",
224 "Secrets found in pushes and history, where each one is, pushing past push protection with a reason (and asking for approval when the workspace delegates bypasses), checking with a secret's issuer whether it still works, and custom patterns.",
225 &[
226 Op::Security(SecurityOp::ListSecretAlerts),
227 Op::Security(SecurityOp::GetSecretAlert),
228 Op::Security(SecurityOp::UpdateSecretAlert),
229 Op::Security(SecurityOp::ListSecretLocations),
230 Op::Security(SecurityOp::BypassPushProtection),
231 Op::Security(SecurityOp::CheckSecretValidity),
232 Op::Security(SecurityOp::ListBypassRequests),
233 Op::Security(SecurityOp::ReviewBypassRequest),
234 Op::Security(SecurityOp::ListCustomPatterns),
235 Op::Security(SecurityOp::CreateCustomPattern),
236 Op::Security(SecurityOp::UpdateCustomPattern),
237 Op::Security(SecurityOp::DeleteCustomPattern),
238 Op::Security(SecurityOp::DryRunCustomPattern),
239 ],
240 ),
241 (
242 "Code scanning",
243 "Results of static analysis tools, uploaded as SARIF: alerts on the default branch, the analyses that made them, uploads, and putting g1t on an alert to fix it.",
244 &[
245 Op::Security(SecurityOp::ListCodeAlerts),
246 Op::Security(SecurityOp::GetCodeAlert),
247 Op::Security(SecurityOp::UpdateCodeAlert),
248 Op::Security(SecurityOp::ListAnalyses),
249 Op::Security(SecurityOp::UploadSarif),
250 Op::Security(SecurityOp::GetSarifUpload),
251 ],
252 ),
253 (
254 "Supply chain",
255 "What a repository depends on: vulnerability alerts, the dependency graph, an SPDX SBOM of it, and comparing two commits' dependencies as dependency review does.",
256 &[
257 Op::Security(SecurityOp::ListVulnerabilityAlerts),
258 Op::Security(SecurityOp::GetVulnerabilityAlert),
259 Op::Security(SecurityOp::UpdateVulnerabilityAlert),
260 Op::Security(SecurityOp::GetDependencyGraph),
261 Op::Security(SecurityOp::GetSbom),
262 Op::Security(SecurityOp::CompareDependencies),
263 ],
264 ),
265 (
266 "Security settings",
267 "When pull request checks fail, dependency review's policy, delegated bypass and validity checks, and a workspace's security overview.",
268 &[
269 Op::Security(SecurityOp::GetSettings),
270 Op::Security(SecurityOp::UpdateSettings),
271 Op::Security(SecurityOp::GetWorkspaceSettings),
272 Op::Security(SecurityOp::UpdateWorkspaceSettings),
273 Op::Security(SecurityOp::GetOverview),
274 ],
275 ),
276 (
Merge remote-tracking branch 'origin/claude/cool-newton-7nm8r9' into claude/cool-newton-7nm8r9277 "Security advisories",
278 "What a repository says about vulnerabilities in what it ships: advisories drafted, published and withdrawn by its maintainers, and the vulnerability reports people send them privately when the repository takes them.",
279 &[
280 Op::Security(SecurityOp::ListAdvisories),
281 Op::Security(SecurityOp::CreateAdvisory),
282 Op::Security(SecurityOp::GetAdvisory),
283 Op::Security(SecurityOp::UpdateAdvisory),
284 Op::Security(SecurityOp::SetAdvisoryState),
285 Op::Security(SecurityOp::ListReports),
286 Op::Security(SecurityOp::ReportVulnerability),
287 Op::Security(SecurityOp::ReviewReport),
288 ],
289 ),
290 (
Merge rulesets: branch and tag rules, agent-first, enforced on push and merge291 "Rules",
292 "Rulesets: what may happen to a repository's branches and tags and what a pull request needs before it merges, for a repository or across a workspace; the rules that hold for one branch; and how they judged each push and merge, with insights.",
293 &[
294 Op::Rules(RulesOp::ListRepoRulesets),
295 Op::Rules(RulesOp::CreateRepoRuleset),
296 Op::Rules(RulesOp::GetRepoRuleset),
297 Op::Rules(RulesOp::UpdateRepoRuleset),
298 Op::Rules(RulesOp::DeleteRepoRuleset),
299 Op::Rules(RulesOp::GetBranchRules),
300 Op::Rules(RulesOp::ListRuleEvaluations),
301 Op::Rules(RulesOp::ListWorkspaceRulesets),
302 Op::Rules(RulesOp::CreateWorkspaceRuleset),
303 Op::Rules(RulesOp::GetWorkspaceRuleset),
304 Op::Rules(RulesOp::UpdateWorkspaceRuleset),
305 Op::Rules(RulesOp::DeleteWorkspaceRuleset),
306 Op::Rules(RulesOp::ListWorkspaceRuleEvaluations),
307 ],
308 ),
309 (
Merge checks: statuses and check runs on every commit310 "Checks",
311 "What CI, integrations and g1t Actions say about a commit, in the shapes CI tools already send: statuses (a state per context) and check runs (a lifecycle, a conclusion, a Markdown report, annotations on lines and buttons), grouped per reporter into check suites. g1t Actions jobs are check runs too. Required checks are met by either.",
312 &[
313 Op::Checks(ChecksOp::CreateCommitStatus),
314 Op::Checks(ChecksOp::ListCommitStatuses),
315 Op::Checks(ChecksOp::GetCombinedStatus),
316 Op::Checks(ChecksOp::CreateCheckRun),
317 Op::Checks(ChecksOp::UpdateCheckRun),
318 Op::Checks(ChecksOp::GetCheckRun),
319 Op::Checks(ChecksOp::ListCheckRunAnnotations),
320 Op::Checks(ChecksOp::RerequestCheckRun),
321 Op::Checks(ChecksOp::ListCheckRunsForRef),
322 Op::Checks(ChecksOp::ListCheckSuitesForRef),
323 Op::Checks(ChecksOp::GetCheckSuite),
324 Op::Checks(ChecksOp::RerequestCheckSuite),
325 ],
326 ),
327 (
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running328 "Issues",
329 "What should change in a repository, with labels and comments. Issues and pull requests share one sequence of numbers.",
330 &[
331 Op::ListIssues,
332 Op::CreateIssue,
333 Op::GetIssue,
334 Op::UpdateIssue,
335 Op::CloseIssue,
336 Op::ReopenIssue,
337 Op::AddComment,
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts338 Op::EditComment,
339 Op::DeleteComment,
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar340 Op::ListIssueLabels,
341 Op::AddIssueLabels,
342 Op::SetIssueLabels,
343 Op::RemoveIssueLabels,
344 ],
345 ),
346 (
Merge branch 'worktree-agent-a6ec0a89d7fe7a9ae'347 "Claims and work",
348 "Coordinating work on issues: an advisory, expiring claim that says you are on one (never a lock), handing it off with a note, and everything an agent needs before starting on an issue in one call. What an issue is blocked by is set with update_issue.",
349 &[
350 Op::Coordination(CoordinationOp::GetWork),
351 Op::Coordination(CoordinationOp::ClaimIssue),
352 Op::Coordination(CoordinationOp::ReleaseClaim),
353 Op::Coordination(CoordinationOp::HandOffIssue),
354 Op::Coordination(CoordinationOp::ListClaims),
355 ],
356 ),
357 (
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar358 "Labels and milestones",
359 "A repository's labels, which issues and pull requests carry by name, and its milestones, which gather them under a goal and a due date.",
360 &[
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running361 Op::ListLabels,
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar362 Op::CreateLabel,
363 Op::UpdateLabel,
364 Op::DeleteLabel,
365 Op::AddDefaultLabels,
366 Op::ListMilestones,
367 Op::CreateMilestone,
368 Op::GetMilestone,
369 Op::UpdateMilestone,
370 Op::DeleteMilestone,
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running371 ],
372 ),
373 (
374 "Pull requests",
375 "A proposed change in its own fork or on a branch. Several can be made for one issue; the one merged resolves it.",
376 &[
377 Op::ListPullRequests,
378 Op::CreatePullRequest,
379 Op::GetPullRequest,
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar380 Op::UpdatePullRequest,
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running381 Op::GetPullRequestChanges,
382 Op::MarkPullRequestReady,
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts383 Op::ConvertPullRequestToDraft,
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar384 Op::RequestReviewers,
385 Op::RemoveRequestedReviewers,
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running386 Op::ReviewPullRequest,
387 Op::MergePullRequest,
388 Op::ClosePullRequest,
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts389 Op::ReopenPullRequest,
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running390 Op::GetMergeQueue,
391 ],
392 ),
393 (
394 "Sessions",
g1t coordinates the work and the person's own sessions do it: Ask g1t reads g1t with the same tools any agent gets, answers in one conversation shared with the @g1t direct message in Chat, and hands work to sessions in the person's own harness, whose subagents g1t records, ties to issues and pull requests, and lets see each other.395 "Who is working on what, and how a pull request was made. A session is one run of your own harness (a Claude Code session, a Codex run) on a repository: started once, kept alive by heartbeats, attached to an issue and a pull request, and recording prompts, reasoning, the tools that ran, the skills used and what it touched. Each subagent is a session of its own under the one that started it. A pull request's session shows what was recorded on it. A session can also be started on an issue in your own Claude, on the workspace's Anthropic account.",
Merge branch 'worktree-agent-a6ec0a89d7fe7a9ae'396 &[
397 Op::Coordination(CoordinationOp::StartSession),
398 Op::Coordination(CoordinationOp::UpdateSession),
399 Op::Coordination(CoordinationOp::EndSession),
400 Op::Coordination(CoordinationOp::GetSession),
401 Op::Coordination(CoordinationOp::ListSessions),
402 Op::Coordination(CoordinationOp::RecordSessionEntries),
g1t coordinates the work and the person's own sessions do it: Ask g1t reads g1t with the same tools any agent gets, answers in one conversation shared with the @g1t direct message in Chat, and hands work to sessions in the person's own harness, whose subagents g1t records, ties to issues and pull requests, and lets see each other.403 Op::Coordination(CoordinationOp::StartAgentSession),
Merge branch 'worktree-agent-a6ec0a89d7fe7a9ae'404 Op::ReadSession,
405 Op::RecordSession,
406 ],
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running407 ),
408 (
Merge branch 'worktree-agent-ab8033ab973f8d99a'409 "Decisions and why",
410 "Decision records: why the work is the way it is, and how sure that is (claimed, tested by a check or the merge queue, or approved by a person). And why a line of code is the way it is: its commit, pull request, issue, decisions and session.",
411 &[Op::ListDecisions, Op::RecordDecision, Op::Why],
412 ),
413 (
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running414 "Memory",
The API and MCP server no longer offer g1t's own agents. g1t is what your coding agents work against, not an agent of its own, so the operations that drove hosted agents are gone: messaging an agent on a pull request (message_agent, take_messages, answer_message), assigning or delegating an issue to g1t (assign_issue, delegate), plans (plan_work, get_plan, apply_plan), the context hub (search_context, get_entity), model routes, agents' computers, AI Gateway requests, "Fix with g1t" on a security alert, and every Customize route (marketplaces, plugins, connectors). The callbacks the agent sandbox reported through (/agent-runs/*, /runs/:id/usage, /plans/:id, /reviews/:id) go with them, update_repo_settings stops accepting agent_review, max_revisions and hold_low_confidence, import_issue stops accepting assign, and an old agent token with no run behind it is refused.415 "What agents and people learned that the next agent should know, for one project or across a workspace. Members only; never a secret.",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running416 &[Op::Remember, Op::Recall],
417 ),
418 (
419 "Search",
420 "One search across all of g1t: repositories, code, issues, pull requests, people and workspaces. Public content for everyone, and private content in workspaces you belong to.",
421 &[Op::Search],
422 ),
423 (
424 "Actions",
Merge branch 'worktree-agent-a3b9b1f730f55b5bf'425 "GitHub Actions workflows in .g1t/workflows, their runs, their jobs' logs, their artifacts, and the repository's actions/cache entries.",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running426 &[
427 Op::ListWorkflows,
Merge branch 'worktree-agent-a4db4b523bb973765'428 Op::GetWorkflow,
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running429 Op::ListWorkflowRuns,
430 Op::GetWorkflowRun,
431 Op::GetJobLogs,
432 Op::DispatchWorkflow,
433 Op::CancelWorkflowRun,
434 Op::RerunWorkflowRun,
435 Op::UpdateWorkflow,
Actions: OIDC tokens, the toolkit's cache and artifact services, and artifacts in R2436 Op::Artifacts(ArtifactsOp::ListArtifacts),
437 Op::Artifacts(ArtifactsOp::ListRunArtifacts),
438 Op::Artifacts(ArtifactsOp::GetArtifact),
439 Op::Artifacts(ArtifactsOp::DownloadArtifact),
440 Op::Artifacts(ArtifactsOp::DeleteArtifact),
441 Op::Artifacts(ArtifactsOp::GetArtifactRetention),
442 Op::Artifacts(ArtifactsOp::SetArtifactRetention),
Merge branch 'worktree-agent-a3b9b1f730f55b5bf'443 Op::Caches(CachesOp::ListCaches),
444 Op::Caches(CachesOp::GetCacheUsage),
445 Op::Caches(CachesOp::DeleteCachesByKey),
446 Op::Caches(CachesOp::DeleteCache),
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running447 ],
448 ),
449 (
Merge packages: roles, Actions access, source label, soft delete, API450 "Packages",
451 "A workspace's packages in every registry: their versions and download counts, deleting and restoring them within 30 days, their visibility and repository, the people and teams with a role on them, and which repositories' workflows may use them (Manage Actions access). A package is named by its type and its name, URL-encoded where it holds a slash.",
452 &[
453 Op::Packages(PackagesOp::ListPackages),
454 Op::Packages(PackagesOp::GetPackage),
455 Op::Packages(PackagesOp::UpdatePackage),
456 Op::Packages(PackagesOp::DeletePackage),
457 Op::Packages(PackagesOp::RestorePackage),
458 Op::Packages(PackagesOp::ListVersions),
459 Op::Packages(PackagesOp::GetVersion),
460 Op::Packages(PackagesOp::DeleteVersion),
461 Op::Packages(PackagesOp::RestoreVersion),
462 Op::Packages(PackagesOp::LinkPackage),
463 Op::Packages(PackagesOp::UnlinkPackage),
464 Op::Packages(PackagesOp::ListAccess),
465 Op::Packages(PackagesOp::SetAccess),
466 Op::Packages(PackagesOp::RemoveAccess),
467 Op::Packages(PackagesOp::ListActionsAccess),
468 Op::Packages(PackagesOp::SetActionsAccess),
469 Op::Packages(PackagesOp::RemoveActionsAccess),
470 ],
471 ),
472 (
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97473 "Deployments",
474 "A repository's deployments wherever they run: reported from any CI with these routes, made by g1t Actions jobs with an `environment:`, or built on g1t.page. Each has statuses, shows on its commit as the check `deploy / <environment>`, and belongs to an environment.",
475 &[
476 Op::Deployments(DeploymentsOp::ListDeployments),
477 Op::Deployments(DeploymentsOp::CreateDeployment),
478 Op::Deployments(DeploymentsOp::GetDeployment),
479 Op::Deployments(DeploymentsOp::ListDeploymentStatuses),
480 Op::Deployments(DeploymentsOp::CreateDeploymentStatus),
481 Op::Deployments(DeploymentsOp::ListEnvironments),
482 Op::Deployments(DeploymentsOp::GetEnvironment),
Merge branch 'worktree-agent-a4d35ee70c50683d0' into claude/cool-newton-7nm8r9483 Op::Deployments(DeploymentsOp::StartDeploymentBuild),
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97484 ],
485 ),
486 (
Projects have Observability: their requests, logs, traces, metrics and errors, from apps on g1t.page with nothing to set up, and from software anywhere else over OpenTelemetry.487 "Observability",
488 "What a project's running software did: its requests, logs, traces, grouped errors and metrics, from its apps on g1t.page with nothing to set up and from OpenTelemetry (OTLP over HTTP) sent from anywhere with an ingest token. Reading needs a role of your own on the project's repository; resolving errors, Triage; settings, ingest tokens, exports and usage, Admin.",
489 &[
490 Op::Telemetry(TelemetryOp::GetOverview),
491 Op::Telemetry(TelemetryOp::ListRequests),
492 Op::Telemetry(TelemetryOp::GetRequest),
493 Op::Telemetry(TelemetryOp::ListLogs),
494 Op::Telemetry(TelemetryOp::ListTraces),
495 Op::Telemetry(TelemetryOp::GetTrace),
496 Op::Telemetry(TelemetryOp::ListErrors),
497 Op::Telemetry(TelemetryOp::UpdateError),
498 Op::Telemetry(TelemetryOp::ListMetrics),
499 Op::Telemetry(TelemetryOp::GetMetric),
500 Op::Telemetry(TelemetryOp::GetSettings),
501 Op::Telemetry(TelemetryOp::UpdateSettings),
502 Op::Telemetry(TelemetryOp::ListTokens),
503 Op::Telemetry(TelemetryOp::CreateToken),
504 Op::Telemetry(TelemetryOp::DeleteToken),
505 Op::Telemetry(TelemetryOp::ListExports),
506 Op::Telemetry(TelemetryOp::CreateExport),
507 Op::Telemetry(TelemetryOp::UpdateExport),
508 Op::Telemetry(TelemetryOp::DeleteExport),
509 Op::Telemetry(TelemetryOp::GetUsage),
510 ],
511 ),
512 (
Merge branch 'worktree-agent-a3abfcce648e87dca'513 "Run protection",
514 "What keeps workflow runs safe: environments' protection rules (required reviewers, a wait timer, which branches may deploy) and the reviews of the jobs they hold, approving a pull request's run from outside, what a job's token gets when its workflow writes no `permissions:`, and repository_dispatch, which a job's own token may send.",
515 &[
516 Op::Protection(ProtectionOp::UpdateEnvironment),
517 Op::Protection(ProtectionOp::DeleteEnvironment),
518 Op::Protection(ProtectionOp::GetPendingDeployments),
519 Op::Protection(ProtectionOp::ReviewPendingDeployments),
520 Op::Protection(ProtectionOp::ApproveWorkflowRun),
521 Op::Protection(ProtectionOp::GetWorkflowPermissions),
522 Op::Protection(ProtectionOp::SetWorkflowPermissions),
523 Op::Protection(ProtectionOp::GetForkPrApproval),
524 Op::Protection(ProtectionOp::SetForkPrApproval),
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts525 Op::Protection(ProtectionOp::GetActionsAccess),
526 Op::Protection(ProtectionOp::SetActionsAccess),
Merge branch 'worktree-agent-a3abfcce648e87dca'527 Op::Protection(ProtectionOp::CreateRepositoryDispatch),
528 Op::Protection(ProtectionOp::GetWorkspaceWorkflowPermissions),
529 Op::Protection(ProtectionOp::SetWorkspaceWorkflowPermissions),
Merge GitHub pull request #8 (claude/cool-newton-7nm8r9): Docker deployments on g1t.page behind a switch that stays off until Cloudflare's container APIs are checked live, workflows a workspace manages in its repositories, tarball and zipball downloads, refs/pull/* kept to g1t alone, framework detection for g1t.page builds, and a workflow's event payload matching GitHub's.530 Op::Protection(ProtectionOp::ListWorkspaceManagedWorkflows),
531 Op::Protection(ProtectionOp::CreateWorkspaceManagedWorkflow),
532 Op::Protection(ProtectionOp::UpdateWorkspaceManagedWorkflow),
533 Op::Protection(ProtectionOp::DeleteWorkspaceManagedWorkflow),
Merge branch 'worktree-agent-a3abfcce648e87dca'534 ],
535 ),
536 (
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running537 "Secrets and variables",
538 "Values that workflows and deployments read, per repository or for a whole workspace, with a row per environment.",
539 &[
540 Op::ListActionsSecrets,
541 Op::SetActionsSecret,
542 Op::DeleteActionsSecret,
543 Op::ListActionsVariables,
544 Op::SetActionsVariable,
545 Op::DeleteActionsVariable,
546 ],
547 ),
548 (
549 "Runners",
The API and MCP server no longer offer g1t's own agents. g1t is what your coding agents work against, not an agent of its own, so the operations that drove hosted agents are gone: messaging an agent on a pull request (message_agent, take_messages, answer_message), assigning or delegating an issue to g1t (assign_issue, delegate), plans (plan_work, get_plan, apply_plan), the context hub (search_context, get_entity), model routes, agents' computers, AI Gateway requests, "Fix with g1t" on a security alert, and every Customize route (marketplaces, plugins, connectors). The callbacks the agent sandbox reported through (/agent-runs/*, /runs/:id/usage, /plans/:id, /reviews/:id) go with them, update_repo_settings stops accepting agent_review, max_revisions and hold_low_confidence, import_issue stops accepting assign, and an old agent token with no run behind it is refused.550 "Self-hosted runners: your own machines, which run your workflow jobs for $0 of g1t compute. They register with a short-lived token and only ever connect out.",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running551 &[
552 Op::ListRunners,
553 Op::CreateRunnerRegistrationToken,
554 Op::RemoveRunner,
555 Op::ListRunnerGroups,
556 Op::CreateRunnerGroup,
557 Op::UpdateRunnerGroup,
558 Op::DeleteRunnerGroup,
559 Op::GetRunnerSettings,
560 Op::UpdateRunnerSettings,
Every agent can have its own computer. A session that needs one wakes it: a home of its own on g1t cloud, one per agent and never shared, where it runs commands, reads and writes files and keeps what it made, with each session working in its own folder under a shared home; after ten idle minutes it sleeps, its home kept as a snapshot and restored when it wakes, and Reset wipes the home while memory and artifacts stay. Its shell and files are abilities with the usual choices, Alone, Alone when asked, Ask first or Never, offered only inside sessions and never to a chat reply; every command shows on the session with its output, and the agent's new Computer tab shows the state, the disk used of the five gigabytes included, the recent commands, and Wake, Put to sleep and Reset. Machine time counts only while it is awake, on the sandbox lines of the ledger that name the agent and who asked, held to the same spend caps as the session; the disk itself costs nothing in this version. The runner gained a long-lived supervisor that answers the computer's requests inside the container, and the runner service a computer per agent that keeps its snapshot in the agent homes bucket when one is attached, and says so when none is. The REST API and the agent tool can read a computer, wake it, put it to sleep and reset it. The agents, abilities, sessions, runners, billing and deploy guides say how it works and what an operator sets up; pinning a computer to your own runner, its browser and take-over come next.561 ],
562 ),
563 (
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running564 "Webhooks",
565 "Signed HTTPS requests sent to your own address as things happen, for a repository or a whole workspace.",
566 &[
567 Op::ListWebhooks,
568 Op::CreateWebhook,
569 Op::UpdateWebhook,
570 Op::DeleteWebhook,
571 Op::PingWebhook,
572 Op::ListWebhookDeliveries,
573 Op::RedeliverWebhook,
574 ],
575 ),
576 (
577 "Integrations",
The contracts no longer describe g1t's own agents, and workspaces can keep their AI providers. Every consumer had already stopped using them, so the TypeScript and Rust contracts drop the workspace-agent, ability, look, skill-library, context, runner-agent and mention modules, the chat and docs RPCs agents posted and read through, the folio agent methods, the agent_waiting notification, agent.asked and memory.changed events, AI credit, token and gateway billing types, model routes and sessions, team agents, agent tokens, plan, review, message and confidence types, command rules, cost caps and confidence rules. The agents:run and models:* scopes are no longer offered by any preset, OAuth default or permission form, but a stored token or grant that names them still reads; and the removed operations are gone from the scope table, so the API's check that every operation has exactly one scope is strict again. What stored data needs in order to parse (old run and credential kinds, an agent team lead, retired rules and webhook events, old guardrail and integration settings) still parses, and a run's token is still PrincipalKind::Agent, which now means a run's token and the @g1t rows written before. The customize, marketplace, skills and claude-plugin contracts stay only until the mobile app drops its Customize screens.578 "A workspace's connections to outside systems: AI providers, alert sources and issue trackers.",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running579 &[
580 Op::ListIntegrations,
581 Op::ConnectIntegration,
AI Gateway: OpenAI's format, open models, and your own providers582 Op::UpdateIntegration,
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running583 Op::DisconnectIntegration,
584 Op::TestIntegration,
585 Op::GetContext,
586 Op::ImportIssue,
Merge remote-tracking branch 'origin/claude/cool-newton-7nm8r9' into claude/cool-newton-7nm8r9587 ],
588 ),
589 (
Merge main into Artifacts Phase 2590 "Artifacts",
591 "A workspace's docs, slides, designs and dashboards (Artifacts mode): listing and searching the ones you can open, reading and editing their content in Markdown, making, moving, trashing and restoring them, their versions, and who can open them. Each answers for your own role on it. Not workflow runs' artifacts, which are under Actions. Slides, designs and dashboards answer that they are not here yet.",
592 &[
593 Op::Folios(FoliosOp::List),
594 Op::Folios(FoliosOp::Search),
595 Op::Folios(FoliosOp::Get),
596 Op::Folios(FoliosOp::GetContent),
597 Op::Folios(FoliosOp::ListVersions),
598 Op::Folios(FoliosOp::GetAccess),
599 Op::Folios(FoliosOp::ListTemplates),
600 Op::Folios(FoliosOp::ListSpaces),
601 Op::Folios(FoliosOp::QueryDataset),
602 Op::Folios(FoliosOp::Create),
603 Op::Folios(FoliosOp::Update),
604 Op::Folios(FoliosOp::Edit),
605 Op::Folios(FoliosOp::Trash),
606 Op::Folios(FoliosOp::Restore),
607 Op::Folios(FoliosOp::RestoreVersion),
608 Op::Folios(FoliosOp::SetAccess),
609 Op::Folios(FoliosOp::Purge),
610 ],
611 ),
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running612];
613
614/// The section of the API reference an operation is listed under.
615fn tag(op: Op) -> &'static str {
616 SECTIONS
617 .iter()
618 .find(|(_, _, ops)| ops.contains(&op))
619 .map_or("Repositories", |(name, _, _)| name)
620}
621
622/// What an operation's page is called, as a short sentence.
623fn title(op: Op) -> &'static str {
624 match op {
625 Op::Whoami => "Get the current user",
Merge branch 'worktree-agent-ad7c6d88d93adc817'626 Op::GetWorkspace => "Get a workspace",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running627 Op::CreateWorkspace => "Create a workspace",
628 Op::DeleteWorkspace => "Delete a workspace",
629 Op::UpdateWorkspace => "Update a workspace",
Merge main (membership, two-factor, GitHub repo roles) into tokens630 Op::ListMembers => "List a workspace's members",
631 Op::UpdateMember => "Change a member's role",
632 Op::RemoveMember => "Remove a member",
633 Op::TransferOwnership => "Transfer a workspace's ownership",
634 Op::LeaveWorkspace => "Leave a workspace",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running635 Op::ListEmails => "List your email addresses",
636 Op::AddEmail => "Add an email address",
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)637 Op::ConfirmEmail => "Confirm an email address",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running638 Op::RemoveEmail => "Remove an email address",
639 Op::UpdateEmailSettings => "Change your email settings",
Anyone on g1t can invite a friend again: Invite a friend, in the account menu with how many are left beside it, opens Settings → Invites to g1t with a dialog for their email address and a note. The friend gets an email from them whose link opens sign-up with the address filled in and, because it came from that email, confirmed; their account starts with a workspace of its own, and the page lists every invite sent with where it stands (Pending, confirming their email, Joined as @them), with Copy link, Send again and Revoke on each. It is word of mouth, never a gate: sign-ups stay open to everyone, nothing asks for an invite, and running out says friends can still sign up without one.640 Op::ListInvites => "List your invites to g1t",
641 Op::CreateInvite => "Invite a friend to g1t",
642 Op::RevokeInvite => "Revoke an invite to g1t",
643 Op::ResendInvite => "Send an invite to g1t again",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running644 Op::ListWorkspaceInvites => "List a workspace's invites",
645 Op::InviteMember => "Invite someone to a workspace",
Merge workspace invitations: nobody joins a workspace without saying yes, people are found by username, your own invites can bring someone in, and nobody is left without a workspace (identity 0040)646 Op::ListInvitations => "List your workspace invitations",
647 Op::AcceptInvitation => "Accept a workspace invitation",
648 Op::DeclineInvitation => "Decline a workspace invitation",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running649 Op::RevokeWorkspaceInvite => "Revoke a workspace's invite",
650 Op::TransferRepo => "Transfer a repository",
651 Op::RenameRepo => "Rename a repository",
652 Op::RenameBranch => "Rename a branch",
The Branches page does things to branches now. It has tabs (Overview, Yours, Active, Stale, All, kept in the address as ?tab=) and search; Overview shows the default branch, then the first five of your branches, the active ones and the stale ones, each linking to the rest. Each branch is a row with its name in a code chip with a copy button, who made its latest commit and when, that commit's checks, behind and ahead counts with bars drawn against the largest shown, and its pull request (the open one, else the newest merged or closed) with its state; on a phone the columns fold under the name. Yours is branches whose latest commit is the viewer's; stale is no commit in 90 days.653 Op::CreateBranch => "Create a branch",
654 Op::DeleteBranch => "Delete a branch",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running655 Op::ArchiveRepo => "Archive a repository",
656 Op::UnarchiveRepo => "Unarchive a repository",
657 Op::SetRepoVisibility => "Change a repository's visibility",
658 Op::DeleteRepo => "Delete a repository",
659 Op::ListDeletedRepos => "List recently deleted repositories",
660 Op::RestoreRepo => "Restore a deleted repository",
661 Op::PurgeRepo => "Purge a deleted repository",
662 Op::ListRepos => "List repositories",
663 Op::GetRepo => "Get a repository",
664 Op::CreateRepo => "Create a repository",
665 Op::UpdateRepo => "Update a repository",
666 Op::GetRepoSettings => "Get repository settings",
667 Op::UpdateRepoSettings => "Update repository settings",
668 Op::ListCheckNames => "List check names",
669 Op::GetMergeQueue => "Get the merge queue",
670 Op::Remember => "Remember something",
671 Op::Recall => "Recall memory",
672 Op::Search => "Search g1t",
673 Op::ListIssues => "List issues",
674 Op::GetIssue => "Get an issue",
675 Op::CreateIssue => "Create an issue",
676 Op::UpdateIssue => "Update an issue",
677 Op::CloseIssue => "Close an issue",
678 Op::ReopenIssue => "Reopen an issue",
679 Op::ListLabels => "List labels",
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar680 Op::CreateLabel => "Create a label",
681 Op::UpdateLabel => "Update a label",
682 Op::DeleteLabel => "Delete a label",
683 Op::AddDefaultLabels => "Add the default labels",
684 Op::ListIssueLabels => "List an issue's labels",
685 Op::AddIssueLabels => "Add labels to an issue",
686 Op::SetIssueLabels => "Set an issue's labels",
687 Op::RemoveIssueLabels => "Remove labels from an issue",
688 Op::ListMilestones => "List milestones",
689 Op::GetMilestone => "Get a milestone",
690 Op::CreateMilestone => "Create a milestone",
691 Op::UpdateMilestone => "Update a milestone",
692 Op::DeleteMilestone => "Delete a milestone",
693 Op::UpdatePullRequest => "Update a pull request",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running694 Op::AddComment => "Add a comment",
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts695 Op::EditComment => "Edit a comment",
696 Op::DeleteComment => "Delete a comment",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running697 Op::ReviewPullRequest => "Review a pull request",
698 Op::ListPullRequests => "List pull requests",
699 Op::GetPullRequest => "Get a pull request",
700 Op::CreatePullRequest => "Create a pull request",
701 Op::RecordSession => "Record session entries",
702 Op::ReadSession => "Read a session",
Merge branch 'worktree-agent-ab8033ab973f8d99a'703 Op::RecordDecision => "Record a decision",
704 Op::ListDecisions => "List a pull request's decisions",
705 Op::Why => "Explain a line",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running706 Op::MarkPullRequestReady => "Mark a pull request ready",
707 Op::ClosePullRequest => "Close a pull request",
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts708 Op::ReopenPullRequest => "Reopen a pull request",
709 Op::ConvertPullRequestToDraft => "Convert a pull request to a draft",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running710 Op::GetPullRequestChanges => "Get a pull request's changes",
711 Op::MergePullRequest => "Merge a pull request",
712 Op::ListEvents => "List repository events",
713 Op::ListIntegrations => "List integrations",
714 Op::ConnectIntegration => "Connect an integration",
AI Gateway: OpenAI's format, open models, and your own providers715 Op::UpdateIntegration => "Update an integration",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running716 Op::DisconnectIntegration => "Disconnect an integration",
717 Op::TestIntegration => "Test an integration",
718 Op::GetContext => "Look up a ticket",
719 Op::ImportIssue => "Import an issue",
720 Op::ListWebhooks => "List webhooks",
721 Op::CreateWebhook => "Create a webhook",
722 Op::UpdateWebhook => "Update a webhook",
723 Op::DeleteWebhook => "Delete a webhook",
724 Op::PingWebhook => "Ping a webhook",
725 Op::ListWebhookDeliveries => "List webhook deliveries",
726 Op::RedeliverWebhook => "Redeliver a webhook delivery",
727 Op::ListWorkflows => "List workflows",
Merge branch 'worktree-agent-a4db4b523bb973765'728 Op::GetWorkflow => "Get a workflow",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running729 Op::ListWorkflowRuns => "List workflow runs",
730 Op::GetWorkflowRun => "Get a workflow run",
731 Op::GetJobLogs => "Get a job's log",
732 Op::DispatchWorkflow => "Run a workflow",
733 Op::CancelWorkflowRun => "Cancel a workflow run",
734 Op::RerunWorkflowRun => "Re-run a workflow run",
735 Op::UpdateWorkflow => "Turn a workflow on or off",
736 Op::ListActionsSecrets => "List secrets",
737 Op::SetActionsSecret => "Set a secret",
738 Op::DeleteActionsSecret => "Delete a secret",
739 Op::ListActionsVariables => "List variables",
740 Op::SetActionsVariable => "Set a variable",
741 Op::DeleteActionsVariable => "Delete a variable",
742 Op::ListRunners => "List self-hosted runners",
743 Op::ListRunnerGroups => "List runner groups",
744 Op::GetRunnerSettings => "Get runner settings",
745 Op::CreateRunnerRegistrationToken => "Create a runner registration token",
746 Op::RemoveRunner => "Remove a self-hosted runner",
747 Op::CreateRunnerGroup => "Create a runner group",
748 Op::UpdateRunnerGroup => "Change a runner group",
749 Op::DeleteRunnerGroup => "Delete a runner group",
750 Op::UpdateRunnerSettings => "Change runner settings",
751 Op::ListCollaborators => "List who has access",
752 Op::AddCollaborator => "Add a collaborator",
753 Op::UpdateCollaborator => "Change a collaborator's role",
754 Op::RemoveCollaborator => "Remove a collaborator",
755 Op::GetCollaboratorPermission => "Get someone's permission",
756 Op::ListRepoInvitations => "List a repository's invitations",
757 Op::RevokeRepoInvitation => "Revoke a repository invitation",
758 Op::ListMyRepoInvitations => "List your repository invitations",
759 Op::AcceptRepoInvitation => "Accept a repository invitation",
760 Op::DeclineRepoInvitation => "Decline a repository invitation",
761 Op::SetBasePermission => "Set the base permission",
762 Op::ListOutsideCollaborators => "List outside collaborators",
763 Op::ListSecurityAlerts => "List security alerts",
764 Op::DismissSecurityAlert => "Dismiss a security alert",
765 Op::ReopenSecurityAlert => "Reopen a security alert",
API: notifications over REST and MCP, with notifications scopes766 Op::ListNotifications => "List notifications",
767 Op::MarkNotificationsRead => "Mark notifications read",
768 Op::GetNotificationThread => "Get a thread",
769 Op::MarkThreadRead => "Mark a thread read",
770 Op::MarkThreadDone => "Mark a thread done",
771 Op::SaveThread => "Save a thread",
772 Op::SnoozeThread => "Snooze a thread",
773 Op::GetThreadSubscription => "Get a thread subscription",
774 Op::SetThreadSubscription => "Set a thread subscription",
775 Op::DeleteThreadSubscription => "Unsubscribe from a thread",
776 Op::GetRepoSubscription => "Get how you watch a repository",
777 Op::SetRepoSubscription => "Watch a repository",
778 Op::DeleteRepoSubscription => "Stop watching a repository",
779 Op::ListWatchedRepos => "List repositories you watch",
API: pinned projects over REST and MCP780 Op::ListPinnedProjects => "List your pinned projects",
Usage, Billing settings and prepaid AI credit; fixes from the UX audit781 Op::GetUsage => "Get a workspace's usage",
782 Op::GetBudget => "Get a workspace's budget",
783 Op::SetBudget => "Change a workspace's budget",
784 Op::ListInvoices => "List a workspace's invoices",
785 Op::GetBillingDetails => "Get a workspace's billing details",
API: pinned projects over REST and MCP786 Op::PinProject => "Pin a project",
787 Op::UnpinProject => "Unpin a project",
788 Op::ReorderPinnedProjects => "Reorder your pinned projects",
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97789 Op::ListProjects => "List a workspace's projects",
g1t coordinates the work and the person's own sessions do it: Ask g1t reads g1t with the same tools any agent gets, answers in one conversation shared with the @g1t direct message in Chat, and hands work to sessions in the person's own harness, whose subagents g1t records, ties to issues and pull requests, and lets see each other.790 Op::GetWorkspaceActivity => "Get a workspace's activity",
791 Op::GetContents => "Get repository contents",
792 Op::ListCommits => "List commits",
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97793 Op::GetProject => "Get a project",
794 Op::UpdateProject => "Update a project",
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar795 Op::ListTeams => "List teams",
796 Op::GetTeam => "Get a team",
797 Op::CreateTeam => "Create a team",
798 Op::UpdateTeam => "Update a team",
799 Op::DeleteTeam => "Delete a team",
800 Op::ListTeamMembers => "List a team's members",
801 Op::SetTeamMember => "Add or change a team member",
802 Op::RemoveTeamMember => "Remove a team member",
803 Op::ListChildTeams => "List child teams",
804 Op::ListTeamRepos => "List a team's repositories",
805 Op::SetTeamRepo => "Give a team a role on a repository",
806 Op::RemoveTeamRepo => "Remove a team from a repository",
807 Op::SetTeamReviewAssignment => "Set a team's review assignment",
808 Op::ListUserTeams => "List someone's teams",
809 Op::RequestReviewers => "Request reviewers",
810 Op::RemoveRequestedReviewers => "Remove requested reviewers",
811 Op::GetCodeownersErrors => "List CODEOWNERS errors",
812 Op::Security(op) => op.title(),
Merge rulesets: branch and tag rules, agent-first, enforced on push and merge813 Op::Rules(op) => op.title(),
Merge checks: statuses and check runs on every commit814 Op::Checks(op) => op.title(),
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97815 Op::About(op) => op.title(),
816 Op::Deployments(op) => op.title(),
Projects have Observability: their requests, logs, traces, metrics and errors, from apps on g1t.page with nothing to set up, and from software anywhere else over OpenTelemetry.817 Op::Telemetry(op) => op.title(),
Merge branch 'worktree-agent-a3abfcce648e87dca'818 Op::Protection(op) => op.title(),
API and MCP for a workspace's personal access token rules, members' tokens and approvals819 Op::Tokens(op) => op.title(),
Actions: OIDC tokens, the toolkit's cache and artifact services, and artifacts in R2820 Op::Artifacts(op) => op.title(),
Merge branch 'worktree-agent-a3b9b1f730f55b5bf'821 Op::Caches(op) => op.title(),
Merge GitHub pull request #8 (claude/cool-newton-7nm8r9): Docker deployments on g1t.page behind a switch that stays off until Cloudflare's container APIs are checked live, workflows a workspace manages in its repositories, tarball and zipball downloads, refs/pull/* kept to g1t alone, framework detection for g1t.page builds, and a workflow's event payload matching GitHub's.822 Op::Archives(op) => op.title(),
Merge branch 'worktree-agent-a5a5de74d8863d554' into worktree-agent-a16631325aecf58ca823 Op::DeployKeys(op) => op.title(),
Merge packages: roles, Actions access, source label, soft delete, API824 Op::Packages(op) => op.title(),
Merge main into Artifacts Phase 2825 Op::Folios(op) => op.title(),
Merge branch 'worktree-agent-a6ec0a89d7fe7a9ae'826 Op::Coordination(op) => op.title(),
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running827 }
828}
829
830/// Why an operation can be refused with `402 payment_required`, if it
The API and MCP server no longer offer g1t's own agents. g1t is what your coding agents work against, not an agent of its own, so the operations that drove hosted agents are gone: messaging an agent on a pull request (message_agent, take_messages, answer_message), assigning or delegating an issue to g1t (assign_issue, delegate), plans (plan_work, get_plan, apply_plan), the context hub (search_context, get_entity), model routes, agents' computers, AI Gateway requests, "Fix with g1t" on a security alert, and every Customize route (marketplaces, plugins, connectors). The callbacks the agent sandbox reported through (/agent-runs/*, /runs/:id/usage, /plans/:id, /reviews/:id) go with them, update_repo_settings stops accepting agent_review, max_revisions and hold_low_confidence, import_issue stops accepting assign, and an old agent token with no run behind it is refused.831/// can: the ones that make a repository private in a workspace, when a
832/// free workspace's private storage has no room for it.
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running833fn may_need_payment(op: Op) -> Option<&'static str> {
834 match op {
835 Op::UpdateRepo | Op::SetRepoVisibility | Op::TransferRepo => Some(
836 "A free workspace's private storage has no room for this private repository.",
837 ),
838 _ => None,
839 }
840}
841
842/// What the reference says beyond each operation's own description, keyed
843/// by operation id, written by hand from what the services return: `notes`
844/// (Markdown, added to the description) and example `params` (path),
845/// `query`, `request` (body) and `response`.
846const REFERENCE: &str = include_str!("reference.json");
847
848fn examples() -> Map<String, Value> {
849 match serde_json::from_str(REFERENCE) {
850 Ok(Value::Object(examples)) => examples,
851 _ => Map::new(),
852 }
853}
854
855/// `/repos/:owner/:name` as OpenAPI writes it: `/repos/{owner}/{name}`.
856fn openapi_path(route: &Route) -> String {
857 route
858 .path
859 .split('/')
860 .map(|segment| match segment.strip_prefix(':') {
861 Some(name) => format!("{{{name}}}"),
862 None => segment.to_owned(),
863 })
864 .collect::<Vec<_>>()
865 .join("/")
866}
867
868fn error_response(description: &str) -> Value {
869 json!({
870 "description": description,
871 "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } },
872 })
873}
874
875/// A parameter in the path or the query, described by the operation's
876/// input schema where it has the same name.
877fn parameter(name: &str, place: &str, required: bool, schema: Option<&Value>) -> Value {
878 let mut schema = schema.cloned().unwrap_or_else(|| json!({ "type": "string" }));
879 let description = match name {
880 "owner" => Some(Value::from("The workspace that owns the repository.")),
881 "name" => Some(Value::from("The repository's name.")),
882 _ => schema.as_object_mut().and_then(|schema| schema.remove("description")),
883 };
884 let mut parameter = json!({
885 "name": name,
886 "in": place,
887 "required": required,
888 "schema": schema,
889 });
890 if let Some(description) = description {
891 parameter["description"] = description;
892 }
893 parameter
894}
895
896/// The operation id of a route. An operation reached at a workspace's
897/// address as well as a repository's is documented once for each, with its
898/// own id; GitHub's alternative addresses for one operation keep GitHub's
899/// names.
900fn operation_id(route: &Route) -> String {
901 let op = route.op;
902 let base = match (route.method, route.path.rsplit('/').next().unwrap_or_default()) {
903 ("PUT", "enable") => "enable_workflow".to_owned(),
904 ("PUT", "disable") => "disable_workflow".to_owned(),
905 ("POST", "rerun-failed-jobs") => "rerun_failed_jobs".to_owned(),
Merge Actions runs: summaries, attempts and re-runs, graceful cancel, log downloads, badges (actions 0009)906 ("POST", "rerun") if route.path.contains("/jobs/:job/") => "rerun_job".to_owned(),
907 ("POST", "force-cancel") => "force_cancel_workflow_run".to_owned(),
908 ("GET", ":attempt") => "get_workflow_run_attempt".to_owned(),
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running909 ("PATCH", ":setting") => "update_actions_variable".to_owned(),
910 ("GET", "runs") if route.path.contains("/workflows/:workflow/") => "list_runs_of_workflow".to_owned(),
API: notifications over REST and MCP, with notifications scopes911 // One repository's notifications, and an issue's subscription by
912 // its number rather than a thread's id.
913 (_, "notifications") if route.path.starts_with("/repos/") => match op {
914 Op::ListNotifications => "list_repo_notifications".to_owned(),
915 _ => "mark_repo_notifications_read".to_owned(),
916 },
917 (method, "subscription") if route.path.contains("/issues/:number/") => match method {
918 "GET" => "get_issue_subscription".to_owned(),
919 "PUT" => "set_issue_subscription".to_owned(),
920 _ => "delete_issue_subscription".to_owned(),
921 },
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar922 // One label off an issue, by its name in the path.
923 ("DELETE", ":label") if route.path.contains("/issues/:number/") => "remove_issue_label".to_owned(),
API: notifications over REST and MCP, with notifications scopes924 ("DELETE", "saved") => "unsave_thread".to_owned(),
925 ("DELETE", "snooze") => "unsnooze_thread".to_owned(),
Merge branch 'worktree-agent-ab8033ab973f8d99a'926 // An issue's decisions, by its number.
927 ("GET", "decisions") if route.path.contains("/issues/:number/") => "list_issue_decisions".to_owned(),
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running928 _ => op.name().to_owned(),
929 };
930 if route.path.starts_with("/workspaces/") && ROUTES.iter().any(|other| other.op == op && other.path.starts_with("/repos/")) {
931 format!("{base}_for_workspace")
932 } else {
933 base
934 }
935}
936
937/// The summary of a route: its operation's title, or for one of GitHub's
938/// alternative addresses, what that address does.
939fn summary(route: &Route, id: &str) -> String {
940 let base = match id.trim_end_matches("_for_workspace") {
941 "enable_workflow" => "Turn a workflow on",
942 "disable_workflow" => "Turn a workflow off",
943 "rerun_failed_jobs" => "Re-run failed jobs",
Merge Actions runs: summaries, attempts and re-runs, graceful cancel, log downloads, badges (actions 0009)944 "rerun_job" => "Re-run a job",
945 "force_cancel_workflow_run" => "Force-cancel a workflow run",
946 "get_workflow_run_attempt" => "Get a workflow run attempt",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running947 "update_actions_variable" => "Update a variable",
948 "list_runs_of_workflow" => "List a workflow's runs",
API: notifications over REST and MCP, with notifications scopes949 "list_repo_notifications" => "List a repository's notifications",
950 "mark_repo_notifications_read" => "Mark a repository's notifications read",
951 "get_issue_subscription" => "Get your subscription to an issue",
952 "set_issue_subscription" => "Subscribe to an issue",
953 "delete_issue_subscription" => "Unsubscribe from an issue",
954 "unsave_thread" => "Unsave a thread",
955 "unsnooze_thread" => "Bring a snoozed thread back",
Merge branch 'worktree-agent-ab8033ab973f8d99a'956 "list_issue_decisions" => "List an issue's decisions",
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running957 _ => title(route.op),
958 };
959 if id.ends_with("_for_workspace") {
960 format!("{base} for a workspace")
961 } else {
962 base.to_owned()
963 }
964}
965
966fn operation(route: &Route) -> Value {
967 let op = route.op;
968 let path_params: Vec<&str> = route.params().collect();
Merge checks: statuses and check runs on every commit969 // `owner` and `name` in the path stand for the operation's `repo` input,
970 // so a `name` in the body, such as a check run's, is the body's own.
971 let stands_for_repo =
972 |name: &str| matches!(name, "owner" | "name") && path_params.contains(&"owner") && path_params.contains(&"name");
973 let covered = |name: &str| name == "repo" || (path_params.contains(&name) && !stands_for_repo(name));
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running974 let all_properties = op.properties();
975 let mut properties = all_properties.clone();
976 properties.retain(|name, _| !covered(name));
977 let required: Vec<String> = op
978 .required()
979 .into_iter()
980 .filter(|name| !covered(name))
981 .collect();
982
983 let mut parameters: Vec<Value> = path_params
984 .iter()
Merge checks: statuses and check runs on every commit985 .map(|name| parameter(name, "path", true, if stands_for_repo(name) { None } else { all_properties.get(*name) }))
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running986 .collect();
987 let mut body = Value::Null;
988 if route.method == "GET" {
989 for (name, key) in route.query {
990 parameters.push(parameter(
991 name,
992 "query",
993 required.iter().any(|required| required == key),
994 properties.get(*key),
995 ));
996 }
997 } else if !properties.is_empty() {
998 let mut schema = json!({ "type": "object", "properties": properties });
999 if !required.is_empty() {
1000 schema["required"] = json!(required);
1001 }
1002 body = json!({
1003 "required": !required.is_empty(),
1004 "content": { "application/json": { "schema": schema } },
1005 });
1006 }
1007
1008 let id = operation_id(route);
1009 let mut responses = Map::new();
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts1010 if route.no_content() {
1011 responses.insert("204".into(), json!({ "description": "Success. There is no body." }));
1012 } else {
1013 responses.insert(
1014 "200".into(),
1015 json!({
1016 "description": "Success.",
1017 "content": { "application/json": { "schema": {} } },
1018 }),
1019 );
1020 }
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running1021 responses.insert(
1022 "401".into(),
1023 error_response("A token is required, or the one sent is not valid."),
1024 );
1025 if let Some(reason) = may_need_payment(op) {
1026 responses.insert("402".into(), error_response(reason));
1027 }
1028 responses.insert(
1029 "403".into(),
1030 error_response("Signed in, but not allowed to do this: the role you have is not enough, or the token lacks the scope it needs, which `needed_scope` names."),
1031 );
1032 if !matches!(op, Op::Whoami | Op::ListRepos | Op::Search) {
1033 responses.insert("404".into(), error_response("It does not exist, or you cannot see it."));
1034 }
1035 if route.method != "GET" {
1036 responses.insert(
1037 "409".into(),
1038 error_response("The request conflicts with the current state."),
1039 );
1040 }
1041 if op != Op::Whoami {
1042 responses.insert("422".into(), error_response("The input is not valid."));
1043 }
1044 // Public data can be read without a token; everything else needs one.
1045 let scope: Vec<&str> = scope_for(op.name()).map(|scope| scope.as_str()).into_iter().collect();
1046 let security = if op.needs_user() {
1047 json!([{ "token": scope }])
1048 } else {
1049 json!([{ "token": scope }, {}])
1050 };
1051 let (tool, action) = crate::tools::TOOLS
1052 .iter()
1053 .find_map(|tool| {
1054 tool.actions
1055 .iter()
1056 .find(|action| action.op == op)
1057 .map(|action| (tool.name, action.name))
1058 })
1059 .unwrap_or_default();
1060 let mut described = json!({
1061 "operationId": id,
1062 "tags": [tag(op)],
1063 "summary": summary(route, &id),
1064 "description": op.description(),
1065 "x-operation": op.name(),
1066 "x-mcp-tool": tool,
1067 "x-mcp-action": action,
1068 "x-scope": scope.first().copied(),
1069 "security": security,
1070 "parameters": parameters,
1071 "responses": responses,
1072 });
1073 if !body.is_null() {
1074 described["requestBody"] = body;
1075 }
1076 described
1077}
1078
1079/// Entries for device sign-in, which is not an operation.
1080fn onboarding() -> Map<String, Value> {
1081 let paths = json!({
1082 "/device/code": {
1083 "post": {
1084 "operationId": "device_code",
1085 "tags": ["Accounts"],
1086 "summary": "Start signing in",
1087 "description": "Begins a device sign-in. Show the person `verification_uri_complete` and have them open it in a browser, where they sign in or register and approve the code. Then poll `/device/token`.",
1088 "security": [],
1089 "requestBody": {
1090 "content": { "application/json": { "schema": {
1091 "type": "object",
1092 "properties": {
1093 "client_name": {
1094 "type": "string",
1095 "description": "What is asking, shown to the person approving. For example, Claude Code.",
1096 },
1097 },
1098 } } },
1099 },
1100 "responses": { "200": {
1101 "description": "The codes for this sign-in.",
1102 "content": { "application/json": { "schema": {
1103 "type": "object",
1104 "properties": {
1105 "device_code": { "type": "string", "description": "Secret. Send it to /device/token." },
1106 "user_code": { "type": "string", "description": "Shown to the person, like WDJB-MJHT." },
1107 "verification_uri": { "type": "string" },
1108 "verification_uri_complete": {
1109 "type": "string",
1110 "description": "The link to give the person; it carries the code.",
1111 },
1112 "expires_in": { "type": "integer", "description": "Seconds until the codes expire." },
1113 "interval": { "type": "integer", "description": "Seconds to wait between polls." },
1114 },
1115 } } },
1116 } },
1117 },
1118 },
1119 "/device/token": {
1120 "post": {
1121 "operationId": "device_token",
1122 "tags": ["Accounts"],
1123 "summary": "Finish signing in",
1124 "description": "Asks whether the person has approved. Poll no faster than the interval. The token is returned once.",
1125 "security": [],
1126 "requestBody": {
1127 "required": true,
1128 "content": { "application/json": { "schema": {
1129 "type": "object",
1130 "required": ["device_code"],
1131 "properties": { "device_code": { "type": "string" } },
1132 } } },
1133 },
1134 "responses": { "200": {
1135 "description": "The state of the sign-in.",
1136 "content": { "application/json": { "schema": {
1137 "type": "object",
1138 "required": ["status"],
1139 "properties": {
1140 "status": { "type": "string", "enum": ["pending", "approved", "denied", "expired"] },
1141 "token": { "type": "string", "description": "Present when approved." },
Cards you act on in chat; agents comment and review as themselves; names shown cleanly; commits on the calendar1142 "username": { "type": "string", "description": "Lowercased: what the account is found and linked by." },
1143 "display_username": { "type": "string", "description": "The username as its owner wrote it; the same as username when they chose no case." },
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running1144 "verified": {
1145 "type": "boolean",
1146 "description": "Whether the account's email is confirmed.",
1147 },
1148 },
1149 } } },
1150 } },
1151 },
1152 },
1153 });
1154 match paths {
1155 Value::Object(paths) => paths,
1156 _ => Map::new(),
1157 }
1158}
1159
1160
1161/// Puts each operation's examples, where it has them, into its request
1162/// and response. Path and query values go under `x-example-params` and
1163/// `x-example-query`, which tools that build a request can use.
1164fn attach_examples(paths: &mut Map<String, Value>) {
1165 let examples = examples();
1166 for methods in paths.values_mut() {
1167 let Some(methods) = methods.as_object_mut() else { continue };
1168 for operation in methods.values_mut() {
1169 let id = operation["operationId"].as_str().unwrap_or_default().to_owned();
1170 let name = operation["x-operation"].as_str().unwrap_or_default().to_owned();
1171 let Some(example) = examples.get(&id).or_else(|| examples.get(&name)) else {
1172 continue;
1173 };
1174 if let Some(notes) = example.get("notes").and_then(Value::as_str) {
1175 let description = operation["description"].as_str().unwrap_or_default();
1176 operation["description"] = json!(format!("{description}\n\n{notes}"));
1177 }
1178 if let Some(response) = example.get("response") {
1179 let content = &mut operation["responses"]["200"]["content"]["application/json"];
1180 if content.is_object() {
1181 content["example"] = response.clone();
1182 }
1183 }
1184 if let Some(request) = example.get("request") {
1185 let content = &mut operation["requestBody"]["content"]["application/json"];
1186 if content.is_object() {
1187 content["example"] = request.clone();
1188 }
1189 }
1190 for (key, extension) in [("params", "x-example-params"), ("query", "x-example-query")] {
1191 if let Some(values) = example.get(key) {
1192 operation[extension] = values.clone();
1193 }
1194 }
1195 }
1196 }
1197}
1198
1199pub fn document() -> Value {
1200 let mut paths = onboarding();
1201 for route in ROUTES {
1202 let entry = paths
1203 .entry(openapi_path(route))
1204 .or_insert_with(|| json!({}));
1205 entry[route.method.to_lowercase()] = operation(route);
1206 }
1207 attach_examples(&mut paths);
1208 let tags: Vec<Value> = SECTIONS
1209 .iter()
1210 .map(|(name, description, ops)| {
1211 json!({
1212 "name": name,
1213 "description": description,
1214 // The section's operations in reading order, by MCP tool name.
1215 "x-tools": ops.iter().map(|op| op.name()).collect::<Vec<_>>(),
1216 })
1217 })
1218 .collect();
1219 let codes = ["unauthenticated", "payment_required", "forbidden", "not_found", "conflict", "invalid"];
1220 json!({
1221 "openapi": "3.1.0",
1222 "info": {
1223 "title": "g1t API",
1224 "version": "1",
1225 "description": "The REST API for g1t, a git forge built for agents. The same operations are available to agents as MCP tools at https://mcp.g1t.sh. Every name in a request or response body is `snake_case`; names you chose, such as a workflow's inputs or a secret's name, are returned as you wrote them.",
1226 "license": { "name": "MIT", "identifier": "MIT" },
1227 },
1228 "servers": [{ "url": "https://api.g1t.sh" }],
1229 "security": [{ "token": [] }, {}],
1230 "tags": tags,
1231 "paths": paths,
1232 "components": {
1233 "securitySchemes": {
1234 "token": {
1235 "type": "http",
1236 "scheme": "bearer",
1237 "description": "An access token, `g1t_…`. Public data needs none. Each operation names the scope a token needs for it; see https://docs.g1t.sh/guides/authentication/#scopes.",
1238 },
1239 },
1240 "schemas": {
1241 "Error": {
1242 "type": "object",
1243 "required": ["error"],
1244 "properties": {
1245 "error": {
1246 "type": "object",
1247 "required": ["code", "message"],
1248 "properties": {
1249 "code": { "type": "string", "enum": codes },
1250 "message": { "type": "string" },
1251 "needed_scope": {
1252 "type": "string",
1253 "description": "On a 403 for an access token without the scope the call needs: that scope, such as `issues:write`.",
1254 },
1255 },
1256 },
1257 },
1258 },
1259 },
1260 },
1261 })
1262}
1263
1264#[cfg(test)]
1265mod tests {
1266 use super::*;
1267
1268 #[test]
1269 fn every_route_is_documented_once() {
1270 let document = document();
1271 let mut ids = Vec::new();
1272 for (_, methods) in document["paths"].as_object().unwrap() {
1273 for (_, operation) in methods.as_object().unwrap() {
1274 ids.push(operation["operationId"].as_str().unwrap().to_owned());
1275 }
1276 }
1277 for op in Op::ALL {
1278 assert_eq!(
1279 ids.iter().filter(|id| *id == op.name()).count(),
1280 1,
1281 "{}",
1282 op.name()
1283 );
1284 }
1285 let mut unique = ids.clone();
1286 unique.sort();
1287 unique.dedup();
1288 assert_eq!(unique.len(), ids.len(), "operation ids repeat");
1289 }
1290
1291 #[test]
1292 fn path_and_query_inputs_are_not_repeated_in_the_body() {
1293 let document = document();
1294 let merge = &document["paths"]["/repos/{owner}/{name}/pulls/{number}/merge"]["post"];
1295 let body = &merge["requestBody"]["content"]["application/json"]["schema"]["properties"];
1296 assert!(body.get("keep_issue_open").is_some());
1297 assert!(body.get("repo").is_none() && body.get("number").is_none());
1298 let list = &document["paths"]["/repos"]["get"];
1299 assert_eq!(list["parameters"][0]["name"], "q");
1300 assert!(list.get("requestBody").is_none());
1301 }
1302
1303 #[test]
1304 fn every_operation_is_in_one_section() {
1305 for op in Op::ALL {
1306 let sections = SECTIONS
1307 .iter()
1308 .filter(|(_, _, ops)| ops.contains(&op))
1309 .count();
1310 assert_eq!(sections, 1, "{}", op.name());
1311 }
1312 }
1313
1314 #[test]
1315 fn titles_read_as_sentences() {
1316 assert_eq!(title(Op::CreateIssue), "Create an issue");
1317 assert_eq!(title(Op::Whoami), "Get the current user");
1318 }
1319
1320 #[test]
1321 fn every_operation_has_an_example_response() {
1322 let examples = examples();
1323 assert!(!examples.is_empty(), "reference.json does not parse");
1324 let document = document();
1325 let mut known = Vec::new();
1326 for (path, methods) in document["paths"].as_object().unwrap() {
1327 for (method, operation) in methods.as_object().unwrap() {
1328 known.push(operation["operationId"].as_str().unwrap().to_owned());
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts1329 // Nothing to show for a success without a body.
1330 if operation["responses"]["204"].is_object() {
1331 continue;
1332 }
Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running1333 let example = &operation["responses"]["200"]["content"]["application/json"]["example"];
1334 assert!(!example.is_null(), "{method} {path} has no example response");
1335 }
1336 }
1337 for id in examples.keys() {
1338 assert!(known.contains(id), "reference.json names {id}, which is not an operation");
1339 }
1340 }
1341
1342 #[test]
1343 fn example_requests_send_only_what_the_body_takes() {
1344 let document = document();
1345 for (path, methods) in document["paths"].as_object().unwrap() {
1346 for (method, operation) in methods.as_object().unwrap() {
1347 let content = &operation["requestBody"]["content"]["application/json"];
1348 let Some(example) = content["example"].as_object() else { continue };
1349 let properties = &content["schema"]["properties"];
1350 for key in example.keys() {
1351 assert!(!properties[key].is_null(), "{method} {path}: {key} is not in the body");
1352 }
1353 }
1354 }
1355 }
1356
1357 /// The docs site's copy of the document. Run with `G1T_WRITE_OPENAPI=1`
1358 /// to rewrite it after changing an operation.
1359 #[test]
1360 fn the_docs_copy_is_current() {
1361 let path = concat!(env!("CARGO_MANIFEST_DIR"), "/../docs/src/data/openapi.json");
1362 let current = serde_json::to_string_pretty(&document()).unwrap() + "\n";
1363 if std::env::var_os("G1T_WRITE_OPENAPI").is_some() {
1364 std::fs::write(path, &current).unwrap();
1365 return;
1366 }
1367 let copy = std::fs::read_to_string(path).unwrap_or_default().replace("\r\n", "\n");
1368 assert!(
1369 copy == current,
1370 "apps/docs/src/data/openapi.json is out of date: run G1T_WRITE_OPENAPI=1 cargo test -p g1t-api openapi"
1371 );
1372 }
1373
1374 /// The reference shows responses as they are sent: `snake_case`.
1375 #[test]
1376 fn example_responses_are_snake_case() {
1377 let document = document();
1378 for (path, methods) in document["paths"].as_object().unwrap() {
1379 for (method, operation) in methods.as_object().unwrap() {
1380 let example = &operation["responses"]["200"]["content"]["application/json"]["example"];
1381 let leaked = g1t_kit::wire::camel_case_keys(example);
1382 assert!(leaked.is_empty(), "{method} {path} shows {leaked:?}");
1383 }
1384 }
1385 }
1386
1387 /// Examples never hold anything that reads as a real credential, which
1388 /// secret scanners rightly flag in a public repository: they end in `…`
1389 /// after the prefix, as `whsec_…` and `g1t_…` do.
1390 #[test]
1391 fn examples_hold_no_real_looking_secrets() {
1392 let prefixes = ["whsec_", "g1t_", "g1tr_", "g1trt_", "sk_live_", "sk_test_", "ghp_", "github_pat_", "xoxb-", "AKIA"];
1393 for (line, text) in REFERENCE.lines().enumerate() {
1394 for prefix in prefixes {
1395 let mut rest = text;
1396 while let Some(at) = rest.find(prefix) {
1397 let after = &rest[at + prefix.len()..];
1398 let run = after.chars().take_while(|c| c.is_ascii_alphanumeric()).count();
1399 assert!(
1400 run < 12,
1401 "reference.json line {}: `{prefix}` followed by {run} characters reads as a real secret; write `{prefix}…`",
1402 line + 1
1403 );
1404 rest = after;
1405 }
1406 }
1407 }
1408 }
1409}

This file's history is long; its oldest lines are credited to the oldest commit read.