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.
| GitHub Actions on g1t, part three: .g1t/workflows, the pages, the docs | 1 | import type { ActionsApi } from "./actions"; |
| Billing accounts, terms and enterprises; g1t is no longer free | 2 | import type { BillingAdminApi, BillingApi } from "./billing"; |
| Deployments: a preview for every pull request, production on g1t.page | 3 | import type { DeploymentsApi } from "./deployments"; |
| Projects: what a workspace builds and runs, first on every page | 4 | import type { ProjectsApi } from "./projects"; |
| Events service in Rust, with RFC 3339 times and accurate push events | 5 | import type { EventsApi } from "./events"; |
| Billing on Stripe's pages, month-end charges, warnings; sudo by workspace | 6 | import type { IdentityAdminApi, IdentityApi } from "./identity"; |
| Integrations: your own model provider, alerts that open issues, tickets agents read | 7 | import type { IntegrationsApi } from "./integrations"; |
| Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member | 8 | import type { PackagesApi } from "./packages"; |
| Webhooks: every event, to your own addresses, signed and retried | 9 | import type { WebhooksApi } from "./webhooks"; |
| Rust repos service with shipping; pull requests kept in the model | 10 | import type { ReposApi } from "./repos"; |
| Work service in Rust, with RFC 3339 timestamps | 11 | import type { WorkApi } from "./work"; |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 12 | import type { RunnersApi } from "./runners"; |
| API and MCP server, Rust identity service, registration, site redesign | 13 | |
| 14 | /** A service binding, as far as these clients need it. */ | |
| 15 | export type ServiceBinding = { | |
| 16 | fetch(input: string, init?: RequestInit): Promise<Response>; | |
| 17 | }; | |
| 18 | ||
| 19 | /** | |
| 20 | * Calls a method on a service that speaks the JSON protocol used by the | |
| 21 | * Rust services: `POST /rpc/<method>` with the arguments as the body. | |
| 22 | */ | |
| 23 | async function rpc<T>( | |
| 24 | service: ServiceBinding, | |
| 25 | method: string, | |
| 26 | args: object, | |
| 27 | ): Promise<T> { | |
| 28 | // The hostname is ignored; a service binding always reaches its service. | |
| 29 | const response = await service.fetch(`https://service/rpc/${method}`, { | |
| 30 | method: "POST", | |
| 31 | headers: { "content-type": "application/json" }, | |
| 32 | body: JSON.stringify(args), | |
| 33 | }); | |
| 34 | if (!response.ok) { | |
| 35 | throw new Error(`${method} failed with status ${response.status}`); | |
| 36 | } | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 37 | return (await response.json()) as T; |
| API and MCP server, Rust identity service, registration, site redesign | 38 | } |
| 39 | ||
| 40 | export function identityClient(service: ServiceBinding): IdentityApi { | |
| 41 | const call = <T>(method: string, args: object) => rpc<T>(service, method, args); | |
| 42 | return { | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 43 | register: (username, email, password, inviteCode, client) => |
| 44 | call("register", { username, email, password, invite_code: inviteCode ?? null, client: client ?? null }), | |
| 45 | signIn: (username, password, client) => call("sign_in", { username, password, client: client ?? null }), | |
| API and MCP server, Rust identity service, registration, site redesign | 46 | signOut: (sessionToken) => call("sign_out", { sessionToken }), |
| Email verification, password reset, and Git for AI scale positioning | 47 | resendVerification: (user) => call("resend_verification", { user }), |
| 48 | verifyEmail: (token) => call("verify_email", { token }), | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 49 | requestPasswordReset: (email, client) => call("request_password_reset", { email, client: client ?? null }), |
| Email verification, password reset, and Git for AI scale positioning | 50 | resetPassword: (token, password) => |
| 51 | call("reset_password", { token, password }), | |
| Device sign-in replaces registering and minting tokens over the API | 52 | deviceStart: (clientName) => call("device_start", { clientName }), |
| 53 | deviceLookup: (userCode) => call("device_lookup", { userCode }), | |
| 54 | deviceResolve: (userCode, user, approve) => | |
| 55 | call("device_resolve", { userCode, user, approve }), | |
| 56 | deviceClaim: (deviceCode) => call("device_claim", { deviceCode }), | |
| OAuth 2.1 sign-in for MCP clients and other applications | 57 | oauthAuthorize: (user, approval) => call("oauth_authorize", { user, ...approval }), |
| 58 | oauthExchange: (code, codeVerifier, clientId, redirectUri) => | |
| 59 | call("oauth_exchange", { code, codeVerifier, clientId, redirectUri }), | |
| 60 | oauthRefresh: (refreshToken, clientId) => | |
| 61 | call("oauth_refresh", { refreshToken, clientId }), | |
| 62 | listOAuthGrants: (user) => call("list_oauth_grants", { user }), | |
| 63 | revokeOAuthGrant: (user, id) => call("revoke_oauth_grant", { user, id }), | |
| Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step | 64 | updateOAuthGrant: (user, id, grant) => |
| 65 | call("update_oauth_grant", { user, id, scopes: grant.scopes }), | |
| Workspaces own repositories | 66 | createWorkspace: (user, slug, name) => call("create_workspace", { user, slug, name }), |
| 67 | getWorkspace: (slug) => call("get_workspace", { slug }), | |
| Merge branch 'worktree-agent-a2013627e5ea4ab13' | 68 | workspaceResidency: (slug) => call("workspace_residency", { slug }), |
| 69 | setWorkspaceResidency: (actor, slug, residency) => call("set_workspace_residency", { actor, slug, residency }), | |
| Workspaces own repositories | 70 | listMembers: (slug, viewer) => call("list_members", { slug, viewer }), |
| 71 | addMember: (actor, slug, username) => call("add_member", { actor, slug, username }), | |
| 72 | removeMember: (actor, slug, username) => | |
| 73 | call("remove_member", { actor, slug, username }), | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 74 | updateWorkspace: (actor, slug, details) => |
| 75 | call("update_workspace", { actor, slug, ...details }), | |
| Agents and memory, checks and conflicts, profiles, slug renames, custom domains | 76 | renameWorkspace: (actor, slug, newSlug) => call("rename_workspace", { actor, slug, newSlug }), |
| 77 | checkWorkspaceRename: (actor, slug, newSlug) => | |
| 78 | call("check_workspace_rename", { actor, slug, newSlug }), | |
| 79 | resolveSlug: (slug) => call("resolve_slug", { slug }), | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 80 | deleteWorkspace: (actor, slug, confirm) => call("delete_workspace", { actor, slug, confirm }), |
| 81 | checkWorkspaceDeletion: (actor, slug) => call("check_workspace_deletion", { actor, slug }), | |
| Workspace names and icons, and a component kit for every control | 82 | setWorkspaceAvatar: (actor, slug, image) => call("set_workspace_avatar", { actor, slug, image }), |
| 83 | setUserAvatar: (user, image) => call("set_user_avatar", { user, image }), | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 84 | listWorkspaceTokens: (slug, viewer) => call("list_workspace_tokens", { slug, viewer }), |
| Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step | 85 | createWorkspaceToken: (actor, slug, name, grant) => |
| 86 | call("create_workspace_token", { | |
| 87 | actor, | |
| 88 | slug, | |
| 89 | name, | |
| 90 | scopes: grant?.scopes ?? null, | |
| 91 | ttl_seconds: grant?.ttlSeconds ?? null, | |
| 92 | }), | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 93 | removeWorkspaceToken: (actor, slug, id) => |
| 94 | call("remove_workspace_token", { actor, slug, id }), | |
| API and MCP server, Rust identity service, registration, site redesign | 95 | userForSession: (sessionToken) => call("user_for_session", { sessionToken }), |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 96 | registration: () => call("registration", {}), |
| 97 | listInvites: (user) => call("list_invites", { user }), | |
| 98 | createInvite: (user, options = {}) => | |
| 99 | call("create_invite", { user, email: options.email ?? null, workspace: options.workspace ?? null }), | |
| 100 | revokeInvite: (user, id) => call("revoke_invite", { user, id }), | |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 101 | checkInvite: (code, client, options = {}) => |
| 102 | call("check_invite", { | |
| 103 | code, | |
| 104 | client: client ?? null, | |
| 105 | viewer: options.viewer ?? null, | |
| 106 | any_status: options.anyStatus ?? false, | |
| 107 | }), | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 108 | acceptInvite: (user, code) => call("accept_invite", { user, code }), |
| 109 | inviteMember: (actor, slug, email) => call("invite_member", { actor, slug, email }), | |
| 110 | workspaceInvites: (slug, viewer) => call("workspace_invites", { slug, viewer }), | |
| 111 | revokeWorkspaceInvite: (actor, slug, id) => call("revoke_workspace_invite", { actor, slug, id }), | |
| 112 | requestAccess: (email, about, client) => call("request_access", { email, about, client: client ?? null }), | |
| API and MCP server, Rust identity service, registration, site redesign | 113 | userForGitCredentials: (username, secret) => |
| 114 | call("user_for_git_credentials", { username, secret }), | |
| 115 | userForAccessToken: (token) => call("user_for_access_token", { token }), | |
| 116 | userForSshKey: (fingerprint) => call("user_for_ssh_key", { fingerprint }), | |
| 117 | userByUsername: (username) => call("user_by_username", { username }), | |
| What happened across an outcome, as a feed beside its graph | 118 | usernames: (ids) => call("usernames", { ids }), |
| Agents and memory, checks and conflicts, profiles, slug renames, custom domains | 119 | profile: (username) => call("profile", { username }), |
| 120 | updateProfile: (actor, fields) => call("update_profile", { actor, ...fields }), | |
| 121 | profileWorkspaces: (username, viewer, publicIn) => | |
| 122 | call("profile_workspaces", { username, viewer, public: publicIn }), | |
| API and MCP server, Rust identity service, registration, site redesign | 123 | listSshKeys: (user) => call("list_ssh_keys", { user }), |
| 124 | addSshKey: (user, title, publicKey) => | |
| 125 | call("add_ssh_key", { user, title, publicKey }), | |
| 126 | removeSshKey: (user, id) => call("remove_ssh_key", { user, id }), | |
| 127 | listAccessTokens: (user) => call("list_access_tokens", { user }), | |
| Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step | 128 | createAccessToken: (user, name, ttlSeconds, grant) => |
| 129 | call("create_access_token", { | |
| 130 | user, | |
| 131 | name, | |
| 132 | ttlSeconds, | |
| 133 | scopes: grant?.scopes ?? null, | |
| 134 | listed: grant?.listed ?? false, | |
| 135 | }), | |
| 136 | updateAccessToken: (user, id, grant) => | |
| 137 | call("update_access_token", { user, id, scopes: grant.scopes }), | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 138 | createAgentToken: (onBehalfOf, scope, ttlSeconds) => |
| 139 | call("create_agent_token", { onBehalfOf, scope, ttlSeconds }), | |
| API and MCP server, Rust identity service, registration, site redesign | 140 | removeAccessToken: (user, id) => call("remove_access_token", { user, id }), |
| Agents get guardrails, run credentials, an audit log, a context hub, repository instructions and mentions; security upkeep; snake_case API | 141 | createRunCredential: (input) => call("create_run_credential", input), |
| 142 | bindRunCredentials: (tokenHashes, runId) => call("bind_run_credentials", { tokenHashes, runId }), | |
| 143 | revokeRunCredentials: (target) => call("revoke_run_credentials", target), | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 144 | // Who has access to a repository; see access.ts. |
| 145 | repoAccess: (owner, name, viewer) => call("repo_access", { viewer, path: { namespace: owner, name } }), | |
| 146 | addCollaborator: (actor, owner, name, invitee, role) => | |
| 147 | call("add_collaborator", { actor, path: { namespace: owner, name }, invitee, role }), | |
| 148 | setCollaboratorRole: (actor, owner, name, username, role) => | |
| 149 | call("set_collaborator_role", { actor, path: { namespace: owner, name }, username, role }), | |
| 150 | removeCollaborator: (actor, owner, name, username) => | |
| 151 | call("remove_collaborator", { actor, path: { namespace: owner, name }, username }), | |
| 152 | collaboratorPermission: (viewer, owner, name, username) => | |
| 153 | call("collaborator_permission", { viewer, path: { namespace: owner, name }, username }), | |
| 154 | myRepoInvitations: (user) => call("my_repo_invitations", { user }), | |
| 155 | respondRepoInvitation: (user, id, accept) => call("respond_repo_invitation", { user, id, accept }), | |
| 156 | revokeRepoInvitation: (actor, owner, name, id) => | |
| 157 | call("revoke_repo_invitation", { actor, path: { namespace: owner, name }, id }), | |
| 158 | setBasePermission: (actor, slug, base) => call("set_base_permission", { actor, slug, base_permission: base }), | |
| 159 | outsideCollaborators: (viewer, slug) => call("outside_collaborators", { viewer, slug }), | |
| API and MCP server, Rust identity service, registration, site redesign | 160 | }; |
| 161 | } | |
| Rust repos service with shipping; pull requests kept in the model | 162 | |
| Agents and memory, checks and conflicts, profiles, slug renames, custom domains | 163 | /** |
| 164 | * The slug a renamed workspace has now, for a `workspace.renamed` handler: | |
| 165 | * asked of identity by the workspace's id, so that renames delivered twice | |
| 166 | * or out of order converge. Falls back to the event's `to`. | |
| 167 | */ | |
| 168 | export async function currentWorkspaceSlug( | |
| 169 | identity: ServiceBinding, | |
| 170 | renamed: { workspaceId: string; to: string }, | |
| 171 | ): Promise<string> { | |
| 172 | const names = await identityClient(identity).usernames([renamed.workspaceId]); | |
| 173 | return names[renamed.workspaceId] ?? renamed.to; | |
| 174 | } | |
| 175 | ||
| 176 | /** The slugs whose rows move to `current`: the two a rename names, less `current`. */ | |
| 177 | export function staleSlugs(renamed: { from: string; to: string }, current: string): string[] { | |
| 178 | return [...new Set([renamed.from, renamed.to])].filter((slug) => slug !== current); | |
| 179 | } | |
| 180 | ||
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 181 | /** |
| 182 | * Where a transferred repository is now, as `namespace/name`, for a | |
| 183 | * `repo.transferred` handler: asked of repos by id, so transfers delivered | |
| 184 | * twice or out of order converge. Falls back to the event's destination. | |
| 185 | */ | |
| 186 | export async function currentRepoPath( | |
| 187 | repos: ServiceBinding, | |
| 188 | transferred: { repoId: string; name: string; to: string }, | |
| 189 | ): Promise<string> { | |
| 190 | const path = await rpc<{ namespace: string; name: string } | null>(repos, "path_by_id", { id: transferred.repoId }); | |
| 191 | return path ? `${path.namespace}/${path.name}` : `${transferred.to}/${transferred.name}`; | |
| 192 | } | |
| 193 | ||
| 194 | /** The paths whose rows move to `current`: the two a transfer names, less `current`. */ | |
| 195 | export function stalePaths(transferred: { name: string; from: string; to: string }, current: string): string[] { | |
| 196 | return [...new Set([transferred.from, transferred.to].map((ns) => `${ns}/${transferred.name}`))].filter( | |
| 197 | (path) => path !== current, | |
| 198 | ); | |
| 199 | } | |
| 200 | ||
| 201 | /** | |
| 202 | * A repository's path change, from `repo.transferred` or `repo.renamed`, | |
| 203 | * read the same way: the two paths (`namespace/name`) the event names, old | |
| 204 | * then new. Null for any other event. | |
| 205 | */ | |
| 206 | export type RepoMove = { repoId: string; paths: [string, string] }; | |
| 207 | ||
| 208 | export function repoMove(event: { type: string; data: unknown }): RepoMove | null { | |
| 209 | const data = event.data as Record<string, string>; | |
| 210 | if (event.type === "repo.transferred") { | |
| 211 | return { repoId: data.repoId!, paths: [`${data.from}/${data.name}`, `${data.to}/${data.name}`] }; | |
| 212 | } | |
| 213 | if (event.type === "repo.renamed") { | |
| 214 | return { repoId: data.repoId!, paths: [`${data.namespace}/${data.from}`, `${data.namespace}/${data.to}`] }; | |
| 215 | } | |
| 216 | return null; | |
| 217 | } | |
| 218 | ||
| 219 | /** | |
| 220 | * Where a moved repository is now, as `namespace/name`: asked of repos by | |
| 221 | * id, so moves delivered twice or out of order converge. Falls back to the | |
| 222 | * event's new path. | |
| 223 | */ | |
| 224 | export async function currentMovedPath(repos: ServiceBinding, move: RepoMove): Promise<string> { | |
| 225 | const path = await rpc<{ namespace: string; name: string } | null>(repos, "path_by_id", { id: move.repoId }); | |
| 226 | return path ? `${path.namespace}/${path.name}` : move.paths[1]; | |
| 227 | } | |
| 228 | ||
| 229 | /** The paths whose rows move to `current`: the two a move names, less `current`. */ | |
| 230 | export function staleMovedPaths(move: RepoMove, current: string): string[] { | |
| 231 | return [...new Set(move.paths)].filter((path) => path !== current); | |
| 232 | } | |
| 233 | ||
| Billing on Stripe's pages, month-end charges, warnings; sudo by workspace | 234 | /** Staff-only identity. Only sudo binds to it; see `IdentityAdminApi`. */ |
| 235 | export function identityAdminClient(service: ServiceBinding): IdentityAdminApi { | |
| 236 | const call = <T>(method: string, args: object) => rpc<T>(service, method, args); | |
| 237 | return { | |
| 238 | workspaces: (query) => call("admin_workspaces", { query: query ?? null }), | |
| 239 | workspace: (slug) => call("admin_workspace", { slug }), | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 240 | waitlist: (query, status) => call("admin_waitlist", { query: query ?? null, status: status ?? null }), |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 241 | waitlistPending: () => call("admin_waitlist_pending", {}), |
| 242 | decideWaitlist: (id, approve, staff, note) => call("admin_decide_waitlist", { id, approve, staff, note: note ?? null }), | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 243 | invites: (query) => call("admin_invites", { query: query ?? null }), |
| 244 | revokeInvite: (id, staff) => call("admin_revoke_invite", { id, staff }), | |
| 245 | mintInvite: (email, staff) => call("admin_mint_invite", { email, staff }), | |
| 246 | grantInvites: (target, name, amount, note, staff) => | |
| 247 | call("admin_grant_invites", { target, name, amount, note, staff }), | |
| 248 | inviteTree: (username) => call("admin_invite_tree", { username }), | |
| 249 | workspaceInvites: (slug) => call("admin_workspace_invites", { slug }), | |
| Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member | 250 | deletedWorkspaces: () => call("admin_deleted_workspaces", {}), |
| 251 | restoreWorkspace: (workspaceId, staff) => call("admin_restore_workspace", { workspaceId, staff }), | |
| 252 | purgeWorkspace: (workspaceId, staff, confirm) => call("admin_purge_workspace", { workspaceId, staff, confirm }), | |
| Billing on Stripe's pages, month-end charges, warnings; sudo by workspace | 253 | }; |
| 254 | } | |
| 255 | ||
| Rust repos service with shipping; pull requests kept in the model | 256 | export function reposClient(service: ServiceBinding): ReposApi { |
| 257 | const call = <T>(method: string, args: object) => rpc<T>(service, method, args); | |
| 258 | return { | |
| 259 | get: (path, viewer) => call("get", { path, viewer }), | |
| 260 | getById: (id, viewer) => call("get_by_id", { id, viewer }), | |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 261 | readable: (ids, viewer) => call("readable", { ids, viewer }), |
| Agents and memory, checks and conflicts, profiles, slug renames, custom domains | 262 | publicNamespaces: (ownerId) => call("public_namespaces", { ownerId }), |
| Rust repos service with shipping; pull requests kept in the model | 263 | list: (viewer, options = {}) => call("list", { viewer, ...options }), |
| 264 | create: (owner, input) => call("create", { owner, ...input }), | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 265 | update: (actor, path, changes) => call("update", { actor, path, ...changes }), |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 266 | transfer: (actor, path, to) => call("transfer", { actor, path, to }), |
| 267 | delete: (actor, path, confirm) => call("delete", { actor, path, confirm }), | |
| 268 | deleted: (viewer, namespace) => call("deleted", { viewer, namespace }), | |
| 269 | restore: (actor, path) => call("restore", { actor, path }), | |
| 270 | purge: (actor, path, confirm) => call("purge", { actor, path, confirm }), | |
| 271 | rename: (actor, path, name) => call("rename", { actor, path, name }), | |
| 272 | archive: (actor, path, archived) => call("archive", { actor, path, archived }), | |
| 273 | setVisibility: (actor, path, isPrivate, confirm) => call("set_visibility", { actor, path, isPrivate, confirm }), | |
| 274 | setDefaultBranch: (actor, path, branch) => call("set_default_branch", { actor, path, branch }), | |
| 275 | renameBranch: (actor, path, from, to) => call("rename_branch", { actor, path, from, to }), | |
| 276 | resolveBranch: (repoId, branch) => call("resolve_branch", { repoId, branch }), | |
| 277 | statusById: (id) => call("status_by_id", { id }), | |
| Merge branch 'worktree-agent-a2013627e5ea4ab13' | 278 | storageOptions: () => call("storage_options", {}), |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 279 | resolvePath: (path) => call("resolve_path", { path }), |
| Rust repos service with shipping; pull requests kept in the model | 280 | tree: (path, viewer, ref, treePath) => |
| 281 | call("tree", { path, viewer, ref, treePath }), | |
| 282 | blob: (path, viewer, ref, filePath) => | |
| 283 | call("blob", { path, viewer, ref, filePath }), | |
| 284 | log: (path, viewer, ref, limit) => call("log", { path, viewer, ref, limit }), | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 285 | blame: (path, viewer, ref, filePath) => call("blame", { path, viewer, ref, filePath }), |
| Issues and pull requests replace intents and attempts | 286 | forkForPull: (sourceId, pullId, actor) => |
| 287 | call("fork_for_pull", { sourceId, pullId, actor }), | |
| Rust repos service with shipping; pull requests kept in the model | 288 | gitAccess: (path, viewer, service) => |
| 289 | call("git_access", { path, viewer, service }), | |
| Pull requests from branches | 290 | branches: (path, viewer) => call("branches", { path, viewer }), |
| Branches and Tags pages, each file's last commit, and the branch menu on files | 291 | lastCommits: (path, viewer, ref, treePath) => call("last_commits", { path, viewer, ref, treePath }), |
| 292 | tags: (path, viewer) => call("tags", { path, viewer }), | |
| Download ZIP from the Code button; a slimmer lifecycle panel; agent steps say what was done, not sandbox paths | 293 | listFiles: (repoId, ref, limit) => call("list_files", { repoId, ref, skipDirs: [], limit }), |
| 294 | rawBlobs: (repoId, hashes, maxBytes) => call("raw_blobs", { repoId, hashes, maxBytes }), | |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 295 | commitFile: (repo, actor, file) => call("commit_file", { repo, actor, ...file }), |
| Pull requests from branches | 296 | land: (sourceId, actor, branch) => call("land", { sourceId, actor, branch }), |
| 297 | compare: (repoId, viewer, base, head) => call("compare", { repoId, viewer, base, head }), | |
| Merge branch 'worktree-agent-ac5b181a013e54348' | 298 | claimBackups: (limit, maxRunning) => call("claim_backups", { limit, maxRunning }), |
| 299 | // The sandbox's own calls are snake_case (they come through the API). | |
| 300 | failBackup: (jobId, token, error) => call("backup_fail", { job_id: jobId, token, error }), | |
| Rust repos service with shipping; pull requests kept in the model | 301 | }; |
| 302 | } | |
| Work service in Rust, with RFC 3339 timestamps | 303 | |
| 304 | export function workClient(service: ServiceBinding): WorkApi { | |
| 305 | const call = <T>(method: string, args: object) => rpc<T>(service, method, args); | |
| 306 | return { | |
| Issues and pull requests replace intents and attempts | 307 | openIssue: (actor, repo, input) => call("open_issue", { actor, repo, ...input }), |
| Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step | 308 | delegateIssue: (actor, repo, input) => call("delegate_issue", { actor, repo, ...input }), |
| Issues and pull requests replace intents and attempts | 309 | listIssues: (repo, viewer, filter = {}) => call("list_issues", { repo, viewer, ...filter }), |
| 310 | getIssue: (repo, number, viewer) => call("get_issue", { repo, number, viewer }), | |
| 311 | updateIssue: (actor, repo, number, input) => | |
| 312 | call("update_issue", { actor, repo, number, ...input }), | |
| 313 | closeIssue: (actor, repo, number, reason) => | |
| 314 | call("close_issue", { actor, repo, number, reason }), | |
| 315 | reopenIssue: (actor, repo, number) => call("reopen_issue", { actor, repo, number }), | |
| 316 | listLabels: (repo, viewer) => call("list_labels", { repo, viewer }), | |
| 317 | counts: (repo, viewer) => call("counts", { repo, viewer }), | |
| Acceptance checks in sandboxes, line comments and review verdicts | 318 | addComment: (actor, repo, number, comment) => |
| 319 | call("add_comment", { actor, repo, number, ...comment }), | |
| 320 | startChecks: (pullId) => call("start_checks", { pullId }), | |
| 321 | reportChecks: (runId, token, report) => | |
| 322 | call("report_checks", { runId, token, ...report }), | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 323 | startReview: (pullId) => call("start_review", { pullId }), |
| 324 | failReview: (runId, token, error) => call("report_review", { runId, token, error }), | |
| Agents and memory, checks and conflicts, profiles, slug renames, custom domains | 325 | startMergecheck: (pullId) => call("start_mergecheck", { pullId }), |
| 326 | failMergecheck: (pullId, token, error) => call("report_mergecheck", { pullId, token, error }), | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 327 | advance: (pullId) => call("advance", { pullId }), |
| 328 | stall: (pullId, reason) => call("stall", { pullId, reason }), | |
| 329 | managedPulls: (repoId) => call("managed_pulls", { repoId }), | |
| 330 | queue: (repo, viewer) => call("queue", { repo, viewer }), | |
| 331 | queueBuild: (repoId) => call("queue_build", { repoId }), | |
| 332 | failQueue: (entryId, token, error) => call("report_queue", { entryId, token, error }), | |
| 333 | removeFromQueue: (actor, repo, number) => call("remove_from_queue", { actor, repo, number }), | |
| Usage, like a hosting provider's: what agents cost, per day, task, repository and pull request | 334 | messageAgent: (actor, repo, number, body) => call("message_agent", { actor, repo, number, body }), |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 335 | catchUpJob: (pullId) => call("catch_up_job", { pullId }), |
| Agents asked while not at work are woken to answer | 336 | wakeForMessages: (pullId) => call("wake_for_messages", { pullId }), |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 337 | getSettings: (repo, viewer) => call("get_settings", { repo, viewer }), |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 338 | seenChecks: (repo, viewer) => call("seen_checks", { repo, viewer }), |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 339 | updateSettings: (actor, repo, settings) => |
| 340 | call("update_settings", { actor, repo, settings }), | |
| Issues and pull requests replace intents and attempts | 341 | openPull: (actor, repo, input) => call("open_pull", { actor, repo, ...input }), |
| 342 | listPulls: (repo, viewer, state) => call("list_pulls", { repo, viewer, state }), | |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 343 | pullsForRepos: (repoIds, viewer, limit) => call("pulls_for_repos", { repoIds, viewer, limit }), |
| Issues and pull requests replace intents and attempts | 344 | getPull: (repo, number, viewer) => call("get_pull", { repo, number, viewer }), |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 345 | updatePull: (actor, repo, number, changes) => |
| 346 | call("update_pull", { actor, repo, number, ...changes }), | |
| Catching up with main takes seconds when the two sides touched different files | 347 | catchUpPull: (actor, repo, number) => call("catch_up_pull", { actor, repo, number }), |
| Issues and pull requests replace intents and attempts | 348 | readyPull: (actor, repo, number, summary) => |
| 349 | call("ready_pull", { actor, repo, number, summary }), | |
| 350 | closePull: (actor, repo, number) => call("close_pull", { actor, repo, number }), | |
| Acceptance checks in sandboxes, line comments and review verdicts | 351 | mergePull: (actor, repo, number, options = {}) => |
| 352 | call("merge_pull", { actor, repo, number, ...options }), | |
| Issues and pull requests replace intents and attempts | 353 | listActivePulls: (viewer) => call("list_active_pulls", { viewer }), |
| Agents and memory, checks and conflicts, profiles, slug renames, custom domains | 354 | byAuthor: (username, viewer, filter = {}) => call("by_author", { username, viewer, ...filter }), |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 355 | startPlan: (actor, repo, brief) => call("start_plan", { actor, repo, brief }), |
| 356 | failPlan: (planId, token, error) => call("report_plan", { planId, token, error }), | |
| 357 | getPlan: (repo, viewer, id) => call("get_plan", { repo, viewer, id }), | |
| 358 | listPlans: (repo, viewer) => call("list_plans", { repo, viewer }), | |
| 359 | applyPlan: (actor, repo, id, options = {}) => | |
| 360 | call("apply_plan", { actor, repo, id, ...options }), | |
| 361 | queueIssue: (actor, repo, number, queued) => | |
| 362 | call("queue_issue", { actor, repo, number, queued }), | |
| 363 | readyIssues: (repoId) => call("ready_issues", { repoId }), | |
| 364 | listAssignedIssues: (viewer) => call("list_assigned_issues", { viewer }), | |
| Issues and pull requests replace intents and attempts | 365 | appendSession: (actor, repo, number, entries) => |
| 366 | call("append_session", { actor, repo, number, entries }), | |
| 367 | readSession: (repo, number, viewer, afterSeq = 0) => | |
| 368 | call("read_session", { repo, number, viewer, afterSeq }), | |
| Work service in Rust, with RFC 3339 timestamps | 369 | }; |
| 370 | } | |
| Events service in Rust, with RFC 3339 times and accurate push events | 371 | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 372 | export function billingClient(service: ServiceBinding): BillingApi { |
| 373 | const call = <T>(method: string, args: object) => rpc<T>(service, method, args); | |
| 374 | return { | |
| 375 | status: () => call("status", {}), | |
| 376 | account: (workspace, viewer) => call("account", { workspace, viewer }), | |
| 377 | ledger: (workspace, viewer) => call("ledger", { workspace, viewer }), | |
| The statement is a month at a time, a line per kind of charge | 378 | statement: (workspace, viewer, month = null, group = "day") => call("statement", { workspace, viewer, month, group }), |
| 379 | statementEntries: (workspace, viewer, filter) => | |
| 380 | call("statement_entries", { | |
| 381 | workspace, | |
| 382 | viewer, | |
| 383 | month: filter.month, | |
| 384 | kind: filter.kind, | |
| 385 | day: filter.day ?? null, | |
| 386 | project: filter.project ?? null, | |
| 387 | before: filter.before ?? null, | |
| 388 | }), | |
| Usage, like a hosting provider's: what agents cost, per day, task, repository and pull request | 389 | usage: (workspace, viewer, since) => call("usage", { workspace, viewer, since }), |
| Mission control shows model usage, yours and the workspace's: tokens, cost, active days, cache share, each day, and the mix | 390 | tokenUsage: (workspace, viewer, options = {}) => |
| 391 | call("token_usage", { workspace, viewer, person: options.person ?? null, days: options.days ?? null }), | |
| 392 | recordTokens: (usage) => call("record_tokens", usage), | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 393 | checkout: (actor, workspace, amountCents, returnUrl, method = "card") => |
| 394 | call("checkout", { actor, workspace, amountCents, returnUrl, method }), | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 395 | confirm: (workspace, viewer, session) => call("confirm", { workspace, viewer, session }), |
| 396 | canStart: (workspace) => call("can_start", { workspace }), | |
| A free allowance on g1t's models, so anyone can try its agents | 397 | trial: (workspace, exempt) => call("trial", { workspace, exempt }), |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 398 | startRun: (run) => call("start_run", run), |
| Paid features: a workspace turns on Deployments with a monthly plan | 399 | features: (workspace, viewer) => call("features", { workspace, viewer }), |
| 400 | subscribe: (actor, workspace, feature, returnUrl) => | |
| 401 | call("subscribe", { actor, workspace, feature, returnUrl }), | |
| 402 | confirmSubscription: (workspace, viewer, session) => | |
| 403 | call("confirm_subscription", { workspace, viewer, session }), | |
| 404 | cancelSubscription: (actor, workspace, feature, resume = false) => | |
| 405 | call("cancel_subscription", { actor, workspace, feature, resume }), | |
| 406 | hasFeature: (workspace, feature) => call("has_feature", { workspace, feature }), | |
| 407 | chargeFeature: (charge) => call("charge_feature", charge), | |
| Billing on Stripe's pages, month-end charges, warnings; sudo by workspace | 408 | billingPortal: (actor, workspace, returnUrl) => call("billing_portal", { actor, workspace, return_url: returnUrl }), |
| Every sandbox is metered by the second | 409 | recordSandbox: (usage) => call("record_sandbox", usage), |
| Usage limits: unpaid usage can only go so far | 410 | limit: (workspace, viewer) => call("limit", { workspace, viewer }), |
| 411 | checkLimit: (workspace) => call("check_limit", { workspace }), | |
| Prices keep themselves current with what g1t pays | 412 | prices: () => call("prices", {}), |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 413 | notePending: (workspace, source, costMicros, detail = null) => call("note_pending", { workspace, source, costMicros, detail }), |
| 414 | usageMeters: (workspace, viewer) => call("usage_meters", { workspace, viewer }), | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 415 | setSpendLimit: (actor, workspace, spendLimitMicros, useFullLimit = false, raiseOnce = false) => |
| 416 | call("set_spend_limit", { actor, workspace, spendLimitMicros, use_full_limit: useFullLimit, raise_once: raiseOnce }), | |
| Two limits, real invoices, trust that grows by itself, sales signals | 417 | invoices: (workspace, viewer) => call("invoices", { workspace, viewer }), |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 418 | entitlements: (workspace) => call("entitlements", { workspace }), |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 419 | reserve: (reservation) => call("reserve", reservation), |
| 420 | settle: (reservationId, actualMicros) => call("settle", { reservationId, actualMicros }), | |
| 421 | cardCheck: (actor, workspace, returnUrl) => call("card_check", { actor, workspace, returnUrl }), | |
| 422 | confirmCardCheck: (workspace, viewer, session) => call("confirm_card_check", { workspace, viewer, session }), | |
| 423 | requestLimit: (actor, workspace, request) => call("request_limit", { actor, workspace, ...request }), | |
| 424 | limitRequests: (workspace, viewer) => call("limit_requests", { workspace, viewer }), | |
| 425 | confirmSpike: (actor, workspace, keepGoing) => call("confirm_spike", { actor, workspace, keepGoing }), | |
| 426 | setCaps: (actor, workspace, caps) => call("set_caps", { actor, workspace, ...caps }), | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 427 | }; |
| 428 | } | |
| 429 | ||
| Billing accounts, terms and enterprises; g1t is no longer free | 430 | export function billingAdminClient(service: ServiceBinding): BillingAdminApi { |
| 431 | const call = <T>(method: string, args: object) => rpc<T>(service, method, args); | |
| 432 | return { | |
| 433 | accounts: (query) => call("admin_accounts", { query: query ?? null }), | |
| 434 | account: (id) => call("admin_account", { id }), | |
| 435 | setTerms: (id, terms, by) => call("admin_set_terms", { id, terms, by }), | |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 436 | setAllowances: (id, allowances, note, by) => call("admin_set_allowances", { id, allowances, note, by }), |
| Billing accounts, terms and enterprises; g1t is no longer free | 437 | createEnterprise: (name, workspaces, by) => call("admin_create_enterprise", { name, workspaces, by }), |
| 438 | attach: (workspace, account, by) => call("admin_attach", { workspace, account, by }), | |
| 439 | credit: (workspace, amountMicros, note, by) => call("admin_credit", { workspace, amount_micros: amountMicros, note, by }), | |
| Billing on Stripe's pages, month-end charges, warnings; sudo by workspace | 440 | billingLink: (workspace, by) => call("admin_billing_link", { workspace, by }), |
| Stripe's webhook secret is a Worker secret, STRIPE_WEBHOOK_SECRET, from a destination made in Stripe's dashboard | 441 | stripe: (fix = false, by) => call("admin_stripe", { fix, by: by ?? null }), |
| Stripe webhooks, enterprise invoices, and sudo for both | 442 | enterpriseBilling: (id, email, by) => call("admin_enterprise_billing", { id, email, by }), |
| 443 | invoiceEnterprise: (id, by) => call("admin_invoice_enterprise", { id, by }), | |
| 444 | accountsFor: (workspaces) => call("admin_accounts", { query: null, workspaces }), | |
| Two limits, real invoices, trust that grows by itself, sales signals | 445 | signals: () => call("admin_signals", {}), |
| 446 | overview: () => call("admin_overview", {}), | |
| 447 | sales: (workspace) => call("admin_sales", { workspace }), | |
| 448 | setSales: (workspace, record, by) => | |
| 449 | call("admin_set_sales", { | |
| 450 | workspace, | |
| 451 | stage: record.stage, | |
| 452 | owner: record.owner ?? null, | |
| 453 | next_step: record.nextStep ?? null, | |
| 454 | next_at: record.nextAt ?? null, | |
| 455 | by, | |
| 456 | }), | |
| 457 | addNote: (workspace, text, by) => call("admin_add_note", { workspace, text, by }), | |
| 458 | workspaceInvoices: (workspace) => call("admin_workspace_invoices", { workspace }), | |
| Billing lists every invoice and every staff change; signals carry follow-ups | 459 | allInvoices: (filter = {}) => call("admin_invoices", { status: filter.status ?? null, month: filter.month ?? null }), |
| 460 | audit: (filter = {}) => | |
| 461 | call("admin_audit", { by: filter.by ?? null, action: filter.action ?? null, before: filter.before ?? null }), | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 462 | limitRequests: (status = "open") => call("admin_limit_requests", { status }), |
| 463 | decideLimitRequest: (id, decision, amountMicros, note, by) => | |
| 464 | call("admin_decide_limit_request", { id, decision, amount_micros: amountMicros, note, by }), | |
| 465 | overages: () => call("admin_overages", {}), | |
| 466 | goodwill: (workspace, amountMicros, reason, by, day = null) => | |
| 467 | call("admin_goodwill", { workspace, amount_micros: amountMicros, reason, by, day }), | |
| 468 | velocity: () => call("admin_velocity", {}), | |
| 469 | recordPayment: (workspace, amountMicros, reference, note, by) => | |
| 470 | call("admin_record_payment", { workspace, amount_micros: amountMicros, reference, note, by }), | |
| Git storage hardened, pages in tens of milliseconds, honest security alerts, and costs reconciled daily | 471 | costs: (days) => call("admin_costs", { days: days ?? null }), |
| 472 | costAlerts: () => call("admin_cost_alerts", {}), | |
| Spend caps: a monthly budget for comped workspaces and a daily breaker on what g1t pays | 473 | spendCaps: () => call("admin_spend_caps", {}), |
| 474 | liftBreaker: (note, by) => call("admin_lift_breaker", { note, by }), | |
| Git storage hardened, pages in tens of milliseconds, honest security alerts, and costs reconciled daily | 475 | decideProposal: (id, decision, note, by) => call("admin_decide_proposal", { id, decision, note, by }), |
| 476 | setCostSettings: (settings, by) => call("admin_set_cost_settings", { settings, by }), | |
| 477 | setCostMapping: (mapping, by) => | |
| 478 | call("admin_set_cost_mapping", { | |
| 479 | product: mapping.product, | |
| 480 | meter: mapping.meter, | |
| 481 | bucket: mapping.bucket ?? "", | |
| 482 | price_meter: mapping.priceMeter ?? null, | |
| 483 | own_meter: mapping.ownMeter ?? null, | |
| 484 | scale_to_own: mapping.scaleToOwn ?? false, | |
| 485 | drift_percent: mapping.driftPercent ?? null, | |
| 486 | note: mapping.note ?? "", | |
| 487 | remove: mapping.remove ?? false, | |
| 488 | by, | |
| 489 | }), | |
| 490 | runCosts: (by) => call("admin_run_costs", { by }), | |
| Billing accounts, terms and enterprises; g1t is no longer free | 491 | }; |
| 492 | } | |
| 493 | ||
| Events service in Rust, with RFC 3339 times and accurate push events | 494 | export function eventsClient(service: ServiceBinding): EventsApi { |
| 495 | const call = <T>(method: string, args: object) => rpc<T>(service, method, args); | |
| 496 | return { | |
| 497 | publish: (events) => call("publish", { events }), | |
| 498 | list: (query) => call("list", query), | |
| 499 | }; | |
| 500 | } | |
| Integrations: your own model provider, alerts that open issues, tickets agents read | 501 | |
| 502 | export function integrationsClient(service: ServiceBinding): IntegrationsApi { | |
| 503 | const call = <T>(method: string, args: object) => rpc<T>(service, method, args); | |
| 504 | return { | |
| 505 | list: (workspace, viewer) => call("list", { workspace, viewer }), | |
| 506 | connect: (actor, workspace, input) => call("connect", { actor, workspace, ...input }), | |
| 507 | update: (actor, workspace, id, input) => call("update", { actor, workspace, id, ...input }), | |
| 508 | disconnect: (actor, workspace, id) => call("disconnect", { actor, workspace, id }), | |
| 509 | test: (actor, workspace, id) => call("test", { actor, workspace, id }), | |
| 510 | deliveries: (workspace, viewer, id) => call("deliveries", { workspace, viewer, id }), | |
| 511 | resolve: (workspace, viewer, reference) => call("resolve", { workspace, viewer, reference }), | |
| 512 | references: (workspace, text, limit) => call("references", { workspace, text, limit }), | |
| 513 | import: (actor, repo, reference, assign) => call("import", { actor, repo, reference, assign }), | |
| 514 | links: (repo, number) => call("links", { repo, number }), | |
| 515 | modelProvider: (workspace) => call("model_provider", { workspace }), | |
| 516 | openModelSession: (run) => call("open_model_session", run), | |
| 517 | modelUpstream: (token) => call("model_upstream", { token }), | |
| Git storage hardened, pages in tens of milliseconds, honest security alerts, and costs reconciled daily | 518 | closeModelSessions: (tokenHashes) => call("close_model_sessions", { token_hashes: tokenHashes }), |
| Models per workspace: several providers, routed by kind of work | 519 | routes: (workspace, viewer) => call("routes", { workspace, viewer }), |
| 520 | setRoutes: (actor, workspace, routes) => call("set_routes", { actor, workspace, routes }), | |
| Integrations: your own model provider, alerts that open issues, tickets agents read | 521 | }; |
| 522 | } | |
| Webhooks: every event, to your own addresses, signed and retried | 523 | |
| 524 | export function webhooksClient(service: ServiceBinding): WebhooksApi { | |
| 525 | const call = <T>(method: string, args: object) => rpc<T>(service, method, args); | |
| 526 | return { | |
| 527 | list: (viewer, owner) => call("list", { viewer, ...owner }), | |
| 528 | create: (actor, owner, input) => call("create", { actor, ...owner, ...input }), | |
| 529 | update: (actor, owner, id, input) => call("update", { actor, ...owner, id, ...input }), | |
| 530 | delete: (actor, owner, id) => call("delete", { actor, ...owner, id }), | |
| 531 | ping: (actor, owner, id) => call("ping", { actor, ...owner, id }), | |
| 532 | deliveries: (viewer, owner, id) => call("deliveries", { viewer, ...owner, id }), | |
| 533 | redeliver: (actor, owner, deliveryId) => call("redeliver", { actor, ...owner, deliveryId }), | |
| 534 | }; | |
| 535 | } | |
| Automations: rules in .g1t/automations that act when something happens | 536 | |
| GitHub Actions on g1t, part three: .g1t/workflows, the pages, the docs | 537 | export function actionsClient(service: ServiceBinding): ActionsApi { |
| 538 | const call = <T>(method: string, args: object) => rpc<T>(service, method, args); | |
| 539 | return { | |
| 540 | workflows: (repo, viewer) => call("workflows", { repo, viewer }), | |
| 541 | runs: (repo, viewer, filter = {}) => call("runs", { repo, viewer, ...filter }), | |
| 542 | run: (repo, viewer, id) => call("run", { repo, viewer, id }), | |
| 543 | logs: (repo, viewer, job, after = 0) => call("logs", { repo, viewer, job, after }), | |
| 544 | dispatch: (actor, repo, workflow, ref, inputs) => call("dispatch", { actor, repo, workflow, ref, inputs }), | |
| 545 | cancel: (actor, repo, id) => call("cancel", { actor, repo, id }), | |
| 546 | rerun: (actor, repo, id, failedOnly = false) => call("rerun", { actor, repo, id, failed_only: failedOnly }), | |
| 547 | setWorkflowEnabled: (actor, repo, workflow, enabled) => | |
| 548 | call("set_workflow_enabled", { actor, repo, workflow, enabled }), | |
| 549 | settings: (actor, owner, kind) => call("settings", { actor, ...owner, kind }), | |
| Secrets and variables: one list, rows per environment, for workflows and deployments | 550 | setSetting: (actor, owner, kind, name, value, options = {}) => |
| 551 | call("set_setting", { actor, ...owner, kind, name, value, ...options }), | |
| 552 | deleteSetting: (actor, owner, kind, name, id) => call("delete_setting", { actor, ...owner, kind, name, id }), | |
| GitHub Actions on g1t, part three: .g1t/workflows, the pages, the docs | 553 | }; |
| 554 | } | |
| 555 | ||
| Deployments: a preview for every pull request, production on g1t.page | 556 | |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 557 | /** Self-hosted runners, kept by the actions service. */ |
| 558 | export function runnersClient(service: ServiceBinding): RunnersApi { | |
| 559 | const call = <T>(method: string, args: object) => rpc<T>(service, method, args); | |
| 560 | return { | |
| 561 | stuck: (viewer) => call("stuck_jobs", { viewer }), | |
| 562 | list: (actor, owner) => call("runners", { actor, ...owner }), | |
| 563 | createToken: (actor, owner, group) => call("create_registration_token", { actor, ...owner, group }), | |
| 564 | remove: (actor, owner, id) => call("remove_runner", { actor, ...owner, id }), | |
| 565 | groups: (actor, workspace) => call("runner_groups", { actor, workspace }), | |
| 566 | setGroup: (actor, workspace, group) => call("set_runner_group", { actor, workspace, ...group }), | |
| 567 | deleteGroup: (actor, workspace, id) => call("delete_runner_group", { actor, workspace, id }), | |
| 568 | settings: (actor, owner) => call("runner_settings", { actor, ...owner }), | |
| 569 | setSettings: (actor, owner, change) => call("set_runner_settings", { actor, ...owner, ...change }), | |
| 570 | }; | |
| 571 | } | |
| 572 | ||
| Deployments: a preview for every pull request, production on g1t.page | 573 | export function deploymentsClient(service: ServiceBinding): DeploymentsApi { |
| 574 | const call = <T>(method: string, args: object) => rpc<T>(service, method, args); | |
| 575 | return { | |
| Projects: what a workspace builds and runs, first on every page | 576 | settings: (project, viewer) => call("settings", { project, viewer }), |
| 577 | updateSettings: (actor, project, changes) => call("update_settings", { actor, project, changes }), | |
| 578 | list: (project, viewer) => call("list", { project, viewer }), | |
| 579 | get: (project, id, viewer) => call("get", { project, id, viewer }), | |
| 580 | redeploy: (actor, project, branch) => call("redeploy", { actor, project, branch }), | |
| 581 | takeDown: (actor, project, branch) => call("take_down", { actor, project, branch }), | |
| Project dependencies: addresses, preview stacks, Affects, and agents who know | 582 | stack: (actor, project, branch) => call("stack", { actor, project, branch }), |
| Projects: what a workspace builds and runs, first on every page | 583 | overview: (workspace, viewer) => call("overview", { workspace, viewer }), |
| Deployments: a preview for every pull request, production on g1t.page | 584 | usage: (workspace, viewer) => call("usage", { workspace, viewer }), |
| Agents and memory, checks and conflicts, profiles, slug renames, custom domains | 585 | domains: (project, viewer) => call("domains", { project, viewer }), |
| 586 | addDomain: (actor, project, hostname, options = {}) => | |
| 587 | call("add_domain", { actor, project, hostname, twin: !!options.twin }), | |
| 588 | removeDomain: (actor, project, id) => call("remove_domain", { actor, project, id }), | |
| 589 | refreshDomain: (actor, project, id) => call("refresh_domain", { actor, project, id }), | |
| Deployments: a preview for every pull request, production on g1t.page | 590 | }; |
| 591 | } | |
| Projects: what a workspace builds and runs, first on every page | 592 | |
| Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member | 593 | /** Packages: the registries beside the code (services/packages). */ |
| 594 | export function packagesClient(service: ServiceBinding): PackagesApi { | |
| 595 | const call = <T>(method: string, args: object) => rpc<T>(service, method, args); | |
| 596 | return { | |
| 597 | list: (workspace, viewer, filter = {}) => | |
| 598 | call("list_packages", { | |
| 599 | workspace, | |
| 600 | viewer, | |
| 601 | ecosystem: filter.ecosystem ?? null, | |
| 602 | repo_id: filter.repoId ?? null, | |
| 603 | query: filter.query ?? null, | |
| 604 | }), | |
| 605 | get: (workspace, ecosystem, name, viewer) => call("get_package", { workspace, ecosystem, name, viewer }), | |
| 606 | deleteVersion: (actor, workspace, ecosystem, name, version, surface) => | |
| 607 | call("delete_version", { actor, workspace, ecosystem, name, version, surface: surface ?? null }), | |
| 608 | deletePackage: (actor, workspace, ecosystem, name, surface) => | |
| 609 | call("delete_package", { actor, workspace, ecosystem, name, surface: surface ?? null }), | |
| 610 | set: (actor, workspace, ecosystem, name, change, surface) => | |
| 611 | call("set_package", { | |
| 612 | actor, | |
| 613 | workspace, | |
| 614 | ecosystem, | |
| 615 | name, | |
| 616 | visibility: change.visibility ?? null, | |
| 617 | link: change.link ?? null, | |
| 618 | unlink: change.unlink ?? false, | |
| 619 | surface: surface ?? null, | |
| 620 | }), | |
| 621 | storage: (workspace) => call("storage", { workspace }), | |
| 622 | storageAll: () => call("storage_all", {}), | |
| Composer from the workspace's own repositories, and go get from g1t.sh | 623 | syncComposer: (repoId) => call("sync_composer", { repo_id: repoId }), |
| Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member | 624 | }; |
| 625 | } | |
| 626 | ||
| Projects: what a workspace builds and runs, first on every page | 627 | export function projectsClient(service: ServiceBinding): ProjectsApi { |
| 628 | const call = <T>(method: string, args: object) => rpc<T>(service, method, args); | |
| 629 | return { | |
| 630 | list: (workspace, viewer) => call("list", { workspace, viewer }), | |
| 631 | get: (workspace, slug, viewer) => call("get", { workspace, slug, viewer }), | |
| 632 | byRepo: (repoId) => call("by_repo", { repoId }), | |
| 633 | create: (actor, workspace, input) => call("create", { actor, workspace, input }), | |
| 634 | update: (actor, workspace, slug, changes) => call("update", { actor, workspace, slug, changes }), | |
| A project is an app or a library: libraries show their package and how to ship a release, not production | 635 | deploymentsChanged: (projectId, enabled) => call("deployments_changed", { projectId, enabled }), |
| Project dependencies: addresses, preview stacks, Affects, and agents who know | 636 | dependencies: (workspace, slug, viewer) => call("dependencies", { workspace, slug, viewer }), |
| 637 | addDependency: (actor, workspace, slug, on, as) => call("add_dependency", { actor, workspace, slug, on, as }), | |
| 638 | removeDependency: (actor, workspace, slug, on) => call("remove_dependency", { actor, workspace, slug, on }), | |
| 639 | graph: (projectId) => call("graph", { projectId }), | |
| Projects: what a workspace builds and runs, first on every page | 640 | }; |
| 641 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.