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.
| Cargo on g1t.sh: a sparse registry per workspace, cargo publish/add/yank/search with a g1t token; npm rows show their version | 1 | import type { User, Viewer } from "./identity"; |
| 2 | import type { RepoPath } from "./repos"; | |
| 3 | import type { Result } from "./result"; | |
| 4 | ||
| 5 | /** | |
| 6 | * Events, delivered to the addresses a repository or a workspace registers. | |
| 7 | * Mirrors `crates/contracts/src/webhooks.rs`. | |
| 8 | */ | |
| 9 | ||
| 10 | /** Every event a webhook can be sent, in the order people are shown them. */ | |
| 11 | export const EVENT_TYPES = [ | |
| 12 | "git.push", | |
| Merge branch 'worktree-agent-a8b78c62188153aa3' into claude/cool-newton-7nm8r9 | 13 | "git.deleted", |
| Cargo on g1t.sh: a sparse registry per workspace, cargo publish/add/yank/search with a g1t token; npm rows show their version | 14 | "branch.renamed", |
| 15 | "repo.created", | |
| 16 | "repo.forked", | |
| 17 | "repo.updated", | |
| 18 | "repo.visibility_changed", | |
| 19 | "repo.renamed", | |
| 20 | "repo.transferred", | |
| 21 | "repo.default_branch_changed", | |
| 22 | "repo.archived", | |
| 23 | "repo.unarchived", | |
| 24 | "repo.deleted", | |
| 25 | "repo.restored", | |
| 26 | "repo.purged", | |
| 27 | "repo.collaborator_added", | |
| 28 | "repo.collaborator_removed", | |
| 29 | "repo.collaborator_role_changed", | |
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 30 | "team.created", |
| 31 | "team.edited", | |
| 32 | "team.deleted", | |
| 33 | "team.member_added", | |
| 34 | "team.member_role_changed", | |
| 35 | "team.member_removed", | |
| 36 | "team.repo_added", | |
| 37 | "team.repo_role_changed", | |
| 38 | "team.repo_removed", | |
| @g1t welcomes you when you join a workspace, and that is the one introduction any agent makes. Identity now says when a person becomes a member, workspace.member_joined, by invitation, by an invite code, or by creating the workspace, and webhooks can hear it; the agents service hears it too, and for anyone who joined, never the creator, the workspace's @g1t opens your direct message and says in its own voice who it is, what to ask it, how agents answer, and where things are, once per person per workspace and charged to @g1t like any reply, with a fixed welcome when no model can be used. The agents, workspaces, authentication and webhooks guides say so. | 39 | "workspace.member_joined", |
| Merge rulesets: branch and tag rules, agent-first, enforced on push and merge | 40 | "ruleset.created", |
| 41 | "ruleset.updated", | |
| 42 | "ruleset.deleted", | |
| Cargo on g1t.sh: a sparse registry per workspace, cargo publish/add/yank/search with a g1t token; npm rows show their version | 43 | "issue.opened", |
| 44 | "issue.updated", | |
| 45 | "issue.assigned", | |
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 46 | "issue.labeled", |
| 47 | "issue.unlabeled", | |
| 48 | "issue.milestoned", | |
| 49 | "issue.demilestoned", | |
| Cargo on g1t.sh: a sparse registry per workspace, cargo publish/add/yank/search with a g1t token; npm rows show their version | 50 | "issue.closed", |
| 51 | "issue.reopened", | |
| 52 | "comment.created", | |
| Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts | 53 | "comment.edited", |
| 54 | "comment.deleted", | |
| Cargo on g1t.sh: a sparse registry per workspace, cargo publish/add/yank/search with a g1t token; npm rows show their version | 55 | "pull.opened", |
| 56 | "pull.ready", | |
| 57 | "pull.updated", | |
| 58 | "pull.merge_requested", | |
| 59 | "pull.merged", | |
| 60 | "pull.closed", | |
| Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts | 61 | "pull.reopened", |
| 62 | "pull.converted_to_draft", | |
| Events: review requests, assignments, stops and deployments are published | 63 | "pull.assigned", |
| 64 | "pull.review_requested", | |
| 65 | "pull.review_request_removed", | |
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 66 | "pull.labeled", |
| 67 | "pull.unlabeled", | |
| 68 | "pull.milestoned", | |
| 69 | "pull.demilestoned", | |
| 70 | "pull.base_changed", | |
| Events: review requests, assignments, stops and deployments are published | 71 | "pull.stalled", |
| 72 | "pull.resumed", | |
| Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts | 73 | "release.created", |
| 74 | "release.published", | |
| 75 | "release.released", | |
| 76 | "release.prereleased", | |
| 77 | "release.edited", | |
| 78 | "release.unpublished", | |
| 79 | "release.deleted", | |
| Cargo on g1t.sh: a sparse registry per workspace, cargo publish/add/yank/search with a g1t token; npm rows show their version | 80 | "checks.completed", |
| Merge checks: statuses and check runs on every commit | 81 | "status.created", |
| 82 | "check_run.created", | |
| 83 | "check_run.completed", | |
| 84 | "check_run.rerequested", | |
| 85 | "check_run.requested_action", | |
| 86 | "check_suite.completed", | |
| 87 | "check_suite.rerequested", | |
| Cargo on g1t.sh: a sparse registry per workspace, cargo publish/add/yank/search with a g1t token; npm rows show their version | 88 | "workflow.completed", |
| Events: review requests, assignments, stops and deployments are published | 89 | "deployment.succeeded", |
| 90 | "deployment.failed", | |
| Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97 | 91 | "deployment.created", |
| 92 | "deployment_status.created", | |
| Cargo on g1t.sh: a sparse registry per workspace, cargo publish/add/yank/search with a g1t token; npm rows show their version | 93 | "queue.changed", |
| 94 | "session.appended", | |
| The work service coordinates work on a repository: sessions of people's own harnesses (start is idempotent on the harness's session id, every update or batch of entries is a heartbeat that renews the session's claims, a session reads as idle after 15 minutes and ends as timed_out after 2 hours), session entries recorded once per key and shown in the pull request's session when the session is on one (session_entries is rebuilt so an entry can belong to a session alone), advisory expiring claims on issues that are never locks (claiming tells you who else is on it and what the issue is blocked by; release, hand-off with a note, and expiry noticed on the next read), a writer for blocked_by on update_issue that refuses other repositories' numbers, the issue itself and cycles, and get_work, which gathers an issue's definition of done, claims, sessions, pull requests with their checks, mergeability, overlaps and queue place, blockers, the issues it blocks, decisions and recent coordination events. It publishes session.started, session.ended, work.claimed, work.released, work.claim_expired, work.handoff_requested, dependency.changed (when blocked_by changes, and when a blocker closes or has its pull request merged) and overlap.detected (once for each side when a push or a new pull request starts an overlap, again only after it cleared), and the contracts and the TypeScript mirror list them. | 95 | "session.started", |
| 96 | "session.ended", | |
| 97 | "work.claimed", | |
| 98 | "work.released", | |
| 99 | "work.claim_expired", | |
| 100 | "work.handoff_requested", | |
| 101 | "dependency.changed", | |
| 102 | "overlap.detected", | |
| Cargo on g1t.sh: a sparse registry per workspace, cargo publish/add/yank/search with a g1t token; npm rows show their version | 103 | "package.published", |
| 104 | "package.version_deleted", | |
| 105 | "package.deleted", | |
| 106 | "package.visibility_changed", | |
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 107 | "secret_scanning_alert.created", |
| 108 | "secret_scanning_alert.fixed", | |
| 109 | "secret_scanning_alert.dismissed", | |
| 110 | "secret_scanning_alert.reopened", | |
| 111 | "secret_scanning.bypass_requested", | |
| 112 | "secret_scanning.bypass_reviewed", | |
| 113 | "code_scanning_alert.created", | |
| 114 | "code_scanning_alert.fixed", | |
| 115 | "code_scanning_alert.dismissed", | |
| 116 | "code_scanning_alert.reopened", | |
| 117 | "vulnerability_alert.created", | |
| 118 | "vulnerability_alert.fixed", | |
| 119 | "vulnerability_alert.dismissed", | |
| Merge remote-tracking branch 'origin/claude/cool-newton-7nm8r9' into claude/cool-newton-7nm8r9 | 120 | "secret_scanning_alert.summary", |
| 121 | "code_scanning_alert.summary", | |
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 122 | "vulnerability_alert.reopened", |
| Merge remote-tracking branch 'origin/claude/cool-newton-7nm8r9' into claude/cool-newton-7nm8r9 | 123 | "vulnerability_alert.summary", |
| 124 | "security_advisory.published", | |
| 125 | "security_advisory.withdrawn", | |
| 126 | "security_advisory.reported", | |
| Cargo on g1t.sh: a sparse registry per workspace, cargo publish/add/yank/search with a g1t token; npm rows show their version | 127 | ] as const; |
| 128 | ||
| 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. | 129 | /** |
| 130 | * Event types webhooks were once offered that g1t no longer sends (from | |
| 131 | * g1t's own agents, since removed). A webhook saved with one still reads; | |
| 132 | * saving its list again leaves them out. Mirrors `RETIRED_EVENT_TYPES`. | |
| 133 | */ | |
| 134 | export const RETIRED_EVENT_TYPES: readonly string[] = ["agent.asked", "review.completed"]; | |
| 135 | ||
| Cargo on g1t.sh: a sparse registry per workspace, cargo publish/add/yank/search with a g1t token; npm rows show their version | 136 | export type Hook = { |
| 137 | id: string; | |
| 138 | scope: "repo" | "workspace"; | |
| 139 | workspace: string; | |
| 140 | /** For a repository's webhook: `owner/name`. */ | |
| 141 | repo: string | null; | |
| 142 | url: string; | |
| 143 | /** Event types, or `["*"]` for all. */ | |
| 144 | events: string[]; | |
| 145 | active: boolean; | |
| 146 | secretHint: string; | |
| 147 | createdBy: string; | |
| 148 | createdAt: string; | |
| 149 | lastStatus: "delivered" | "pending" | "failed" | null; | |
| 150 | lastDeliveredAt: string | null; | |
| 151 | }; | |
| 152 | ||
| 153 | export type HookDelivery = { | |
| 154 | id: string; | |
| 155 | hookId: string; | |
| 156 | eventId: string; | |
| 157 | event: string; | |
| 158 | status: "pending" | "delivered" | "failed"; | |
| 159 | attempts: number; | |
| 160 | responseStatus: number | null; | |
| 161 | responseBody: string | null; | |
| 162 | error: string | null; | |
| 163 | durationMs: number | null; | |
| 164 | /** The JSON that was sent. */ | |
| 165 | payload: string; | |
| 166 | createdAt: string; | |
| 167 | deliveredAt: string | null; | |
| 168 | nextAttemptAt: string | null; | |
| 169 | }; | |
| 170 | ||
| 171 | /** A repository's webhooks, or with `repo` left out, the workspace's own. */ | |
| 172 | export type HookOwner = { workspace: string; repo?: RepoPath }; | |
| 173 | ||
| 174 | export interface WebhooksApi { | |
| 175 | list(viewer: Viewer, owner: HookOwner): Promise<Result<Hook[]>>; | |
| 176 | create( | |
| 177 | actor: User, | |
| 178 | owner: HookOwner, | |
| 179 | input: { url: string; events?: string[]; secret?: string }, | |
| 180 | ): Promise<Result<{ hook: Hook; secret: string | null }>>; | |
| 181 | update(actor: User, owner: HookOwner, id: string, input: { url?: string; events?: string[]; active?: boolean }): Promise<Result<Hook>>; | |
| 182 | delete(actor: User, owner: HookOwner, id: string): Promise<Result<boolean>>; | |
| 183 | ping(actor: User, owner: HookOwner, id: string): Promise<Result<HookDelivery>>; | |
| 184 | deliveries(viewer: Viewer, owner: HookOwner, id: string): Promise<Result<HookDelivery[]>>; | |
| 185 | redeliver(actor: User, owner: HookOwner, deliveryId: string): Promise<Result<HookDelivery>>; | |
| 186 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.