Skip to content
546 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.

API and MCP server in Rust; a public index at the API root1/**
2 * Every state change in g1t is published as an event. Services react to
3 * each other through events rather than direct calls, and the same stream
Sidebar: the panels really slide4 * feeds timelines, webhooks and workflows.
API and MCP server in Rust; a public index at the API root5 *
6 * The envelope follows CloudEvents: `type` says what happened, `subject`
7 * says to what, `data` is the type-specific payload.
8 */
Agents as a team: lifecycle, merge queue, billing and a new shell9
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts10import type { Release } from "./about";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look11import type { RepoRole } from "./access";
Merge checks: statuses and check runs on every commit12import type { CheckRunEventData, CheckSuiteEventData, StatusEventData } from "./checks";
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb9713import type { DeploymentStatus, RepoDeployment } from "./deployments";
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar14import type { TeamRole, TeamVisibility } from "./teams";
Cards you act on in chat; agents comment and review as themselves; names shown cleanly; commits on the calendar15import type { AgentRef, Confidence, Verdict } from "./work";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look16
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member17/** What every `package.*` event names. */
18export type PackageEventData = {
19 packageId: string;
20 workspace: string;
21 ecosystem: string;
22 name: string;
23 repoId: string | null;
24};
25
Events: review requests, assignments, stops and deployments are published26/** What `deployment.succeeded` and `deployment.failed` carry. */
27export type DeploymentEventData = {
28 deploymentId: string;
29 projectId: string;
30 repoId: string;
31 workspace: string;
32 project: string;
33 kind: "production" | "preview";
34 branch: string | null;
35 number: number | null;
36 commit: string;
37 path: string;
38 error: string | null;
39 recovered: boolean;
40 /** A username, or `g1t`. */
41 triggeredBy: string;
42};
43
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts44/** What every `release.*` event carries. */
45export type ReleaseEventData = {
46 releaseId: string;
47 repoId: string;
48 tagName: string;
49 release: Release;
50 /** On `release.edited`: what the title and notes were before. */
51 changes?: { name?: { from: string | null }; body?: { from: string } };
52 /** Set when a workflow job's token made the change: the run's id. */
53 causedByJob?: string;
54};
55
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look56/** The payload of the `repo.collaborator_*` events. */
57export type RepoCollaboratorData = {
58 repoId: string;
59 namespace: string;
60 name: string;
61 username: string;
62 role: RepoRole | null;
63 previousRole: RepoRole | null;
64};
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar65/** A team asked to review a pull request. */
66export type TeamRequested = { team: string; notified: string[]; assigned: string[] };
67
68/** The payload of the `team.*` events; each sets the fields that apply. */
69export type TeamChangedData = {
70 workspace: string;
71 teamId: string;
72 team: string;
73 name: string;
74 visibility: TeamVisibility | null;
75 parent?: string;
76 changes?: string[];
77 username?: string;
78 role?: TeamRole;
79 previousRole?: TeamRole;
80 repoId?: string;
81 repo?: string;
82 repoRole?: RepoRole;
83 previousRepoRole?: RepoRole;
84};
85
API and MCP server in Rust; a public index at the API root86export type EventPayloads = {
87 "repo.created": { repoId: string; namespace: string; name: string; isPrivate: boolean };
88 "repo.forked": { repoId: string; sourceRepoId: string; pullId: string };
89 /**
Search across all of g1t, Explore, and a command palette90 * A repository's description, topics or visibility changed.
91 * `visibilityChanged` says whether it went public or private, which
92 * `repo.visibility_changed` also announces on its own.
93 */
94 "repo.updated": { repoId: string; namespace: string; name: string; isPrivate: boolean; visibilityChanged: boolean };
95 "repo.visibility_changed": { repoId: string; isPrivate: boolean };
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look96 /**
97 * A repository's name changed within its workspace `namespace`, from
98 * `from` to `to`, keeping its id. A path change like `repo.transferred`:
99 * services move rows kept under its path to its *current* path (see
100 * `repoMove`, `currentMovedPath`).
101 */
102 "repo.renamed": { repoId: string; namespace: string; from: string; to: string };
103 /**
104 * A repository was deleted. It is hidden and git refuses it, but it can
105 * be restored until `purgeAfter`: services stop what runs for it and hide
106 * it, and keep their rows until `repo.purged`.
107 */
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member108 "repo.deleted": {
109 repoId: string;
110 namespace: string;
111 name: string;
112 isPrivate: boolean;
113 purgeAfter: string;
114 /** It went with its workspace (`workspace.deleting`); deployments leaves it to that. */
115 withWorkspace?: boolean;
116 };
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look117 /** A deleted repository is back, as it was. Services start again what they stopped. */
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member118 "repo.restored": {
119 repoId: string;
120 namespace: string;
121 name: string;
122 isPrivate: boolean;
123 /** It came back with its workspace (`workspace.restored`). */
124 withWorkspace?: boolean;
125 };
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look126 /**
127 * A deleted repository is gone for good, its git data with it. Services
128 * drop every row they keep for it, except a workspace's history (ledgers,
129 * invoices, the audit log).
130 */
131 "repo.purged": { repoId: string; namespace: string; name: string };
132 /**
133 * A repository was archived (read-only: pushes, merges, agents and
134 * workflows refused; issues and pull requests locked; deployments keep
135 * serving), or unarchived.
136 */
137 "repo.archived": { repoId: string; namespace: string; name: string; archived: true };
138 "repo.unarchived": { repoId: string; namespace: string; name: string; archived: false };
139 /** The default branch is now `to`; `renamed` when `from` was renamed to it. */
140 "repo.default_branch_changed": { repoId: string; from: string; to: string; renamed: boolean };
141 /** A branch was renamed. Pull requests from it follow. */
142 "branch.renamed": { repoId: string; from: string; to: string; defaultBranch: boolean };
Search across all of g1t, Explore, and a command palette143 /** An account was made, or changed what its profile shows. Ask identity for the profile. */
144 "user.updated": { username: string };
Merge account deletion: soft delete for 30 days, staff restore and purge, ghost for what remains (identity 0037)145 /**
146 * An account was deleted, by the person or by g1t's staff; staff can
147 * restore it until `purgeAfter`. Its sessions, tokens and keys have ended
148 * and it has left every workspace. Services stop what they do for it and
149 * keep their rows; `user.restored` undoes that, and `user.deleted` follows
150 * once `purgeAfter` passes.
151 */
152 "user.deleting": { userId: string; username: string; byStaff: boolean; purgeAfter: string };
153 /** Staff brought a deleted account back. Services undo what they did on `user.deleting`. */
154 "user.restored": { userId: string; username: string };
155 /**
156 * An account is gone for good. Services drop what they keep for it alone
157 * and show what it wrote as `ghost` (`GHOST_USERNAME`, `GHOST_ID`).
158 * Ledgers, invoices and audit logs keep its username, which is never given
159 * to anyone again.
160 */
161 "user.deleted": { userId: string; username: string };
Search across all of g1t, Explore, and a command palette162 /** A workspace was made, or its name, description or icon changed. */
163 "workspace.updated": { workspaceId: string; slug: string };
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look164 /** Someone, or g1t staff, made an invite. Never the code or the address. */
165 "invite.created": { inviteId: string; inviterId: string | null; workspaceId: string | null; bound: boolean };
166 /** An invite was used: by a new account, or by an account joining a workspace. */
167 "invite.redeemed": {
168 inviteId: string;
169 userId: string;
170 inviterId: string | null;
171 workspaceId: string | null;
172 createdAccount: boolean;
173 };
174 /** Someone asked for access while registration is invite-only. The address is not in the event. */
175 "waitlist.requested": { entryId: string };
Search across all of g1t, Explore, and a command palette176 /**
API and MCP server in Rust; a public index at the API root177 * One branch moved by a push. `ref` is the full ref, `after` the commit it
178 * points to now, and `defaultBranch` whether it is the default branch.
179 */
g1t is the stored author of what it opens; the person who asked is requested_by and keeps the author's rights180 /**
Merge leftovers: plan activity filtered in the query, pushes counted by account, ghost during the deletion window, profile time zones (identity 0039)181 * `before` is where the ref pointed before; absent for a new branch or
182 * tag. `causedByJob` is set when a workflow job's token pushed: the run's id.
183 */
184 "git.push": { repoId: string; ref: string; before?: string; after: string; defaultBranch: boolean; causedByJob?: string };
185 /**
g1t is the stored author of what it opens; the person who asked is requested_by and keeps the author's rights186 * `author` is who opened it: g1t, for one its agent filed while at work,
187 * with `requestedBy` the person it was working for. Every issue and pull
188 * request event carries both.
189 */
190 "issue.opened": {
191 issueId: string;
192 repoId: string;
193 number: number;
194 title: string;
195 author?: { id: string; username: string };
196 requestedBy?: { id: string; username: string };
197 };
API and MCP server in Rust; a public index at the API root198 "issue.updated": { issueId: string; repoId: string; number: number };
Events: review requests, assignments, stops and deployments are published199 /** The people an issue is assigned to changed; `assignees` is the new set, `added` those newly assigned. */
200 "issue.assigned": { issueId: string; repoId: string; number: number; assignees: string[]; added?: string[] };
API and MCP server in Rust; a public index at the API root201 /** `resolvedBy` is the number of the pull request whose merge closed it. */
202 "issue.closed": {
203 issueId: string;
204 repoId: string;
205 number: number;
206 reason: "completed" | "not_planned";
207 resolvedBy?: number;
208 };
209 "issue.reopened": { issueId: string; repoId: string; number: number };
g1t is the stored author of what it opens; the person who asked is requested_by and keeps the author's rights210 /**
211 * `issue` is the number of the issue the pull request is for. `author` is
212 * who opened it: g1t, for a change g1t made, with `requestedBy` the person
213 * who asked for it.
214 */
215 "pull.opened": {
216 pullId: string;
217 repoId: string;
218 number: number;
219 issue?: number;
220 agent: string;
221 author?: { id: string; username: string };
222 requestedBy?: { id: string; username: string };
223 };
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step224 /** `confidence`, on a g1t agent's change once g1t has worked it out, is on every pull request event. */
225 "pull.ready": { pullId: string; repoId: string; number: number; issue?: number; confidence?: Confidence };
Acceptance checks in sandboxes, line comments and review verdicts226 /** A push moved the head of a pull request that is ready for review. */
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step227 "pull.updated": { pullId: string; repoId: string; number: number; issue?: number; commit: string; confidence?: Confidence };
Agents as a team: lifecycle, merge queue, billing and a new shell228 /** A merge was asked for while the pull request was behind; it has to catch up first. */
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step229 "pull.merge_requested": { pullId: string; repoId: string; number: number; issue?: number; confidence?: Confidence };
230 "pull.closed": { pullId: string; repoId: string; number: number; issue?: number; confidence?: Confidence };
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts231 /** A closed pull request was opened again. `commit` is its head. */
232 "pull.reopened": { pullId: string; repoId: string; number: number; issue?: number; commit?: string; confidence?: Confidence };
233 /** A pull request that was ready for review was turned back into a draft. */
234 "pull.converted_to_draft": { pullId: string; repoId: string; number: number; issue?: number; confidence?: Confidence };
Events: review requests, assignments, stops and deployments are published235 /** People were assigned to a pull request: `assignees` is the new set, `added` those newly assigned. */
236 "pull.assigned": { pullId: string; repoId: string; number: number; issue?: number; assignees: string[]; added: string[] };
237 /** Reviewers were asked for a pull request (`reviewers`), or no longer are. */
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar238 "pull.review_requested": {
239 pullId: string;
240 repoId: string;
241 number: number;
242 issue?: number;
243 reviewers?: string[];
244 /** Teams asked: `team` is `workspace/slug`, `notified` who is told, `assigned` who review assignment picked. */
245 teams?: TeamRequested[];
246 /** Asked because they own files it changes (its CODEOWNERS file). */
247 codeOwners?: boolean;
248 };
249 "pull.review_request_removed": {
250 pullId: string;
251 repoId: string;
252 number: number;
253 issue?: number;
254 reviewers?: string[];
255 teams?: TeamRequested[];
256 };
Events: review requests, assignments, stops and deployments are published257 /** g1t stopped seeing a pull request through until a person steps in; `detail` says why. */
258 "pull.stalled": { pullId: string; repoId: string; number: number; issue?: number; detail: string };
259 /** A pull request g1t had stopped on is going again. */
260 "pull.resumed": { pullId: string; repoId: string; number: number; issue?: number };
Agents and memory, checks and conflicts, profiles, slug renames, custom domains261 /**
262 * The pull request's head or its target moved and the files both changed
263 * overlap: a sandbox should find out whether it still merges cleanly.
264 * `commit` is its head.
265 */
266 "pull.mergecheck": { pullId: string; repoId: string; number: number; issue?: number; commit: string };
267 /** Whether the pull request merges cleanly was settled. */
268 "pull.mergeability": { pullId: string; repoId: string; number: number; issue?: number };
Agents asked while not at work are woken to answer269 /** Another agent asked the agent on a pull request, which was not at work, a question or handed it work. */
270 "agent.asked": { pullId: string; repoId: string; number: number; issue?: number };
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step271 "pull.merged": { pullId: string; repoId: string; number: number; issue?: number; commit: string; confidence?: Confidence };
Acceptance checks in sandboxes, line comments and review verdicts272 /** A run of the acceptance checks finished. `commit` is what was checked. */
273 "checks.completed": {
274 pullId: string;
275 repoId: string;
276 number: number;
277 status: "passed" | "failed" | "errored";
278 commit: string;
279 };
Merge checks: statuses and check runs on every commit280 /** A status was set on a commit through the API. */
281 "status.created": StatusEventData;
282 /** A check run was reported on a commit through the API, completed, asked to run again, or had one of its buttons pressed (`requestedAction`). */
283 "check_run.created": CheckRunEventData;
284 "check_run.completed": CheckRunEventData;
285 "check_run.rerequested": CheckRunEventData;
286 "check_run.requested_action": CheckRunEventData;
287 /** A reporter's check runs on a commit all completed, or it was asked to run them again. */
288 "check_suite.completed": CheckSuiteEventData;
289 "check_suite.rerequested": CheckSuiteEventData;
Agents as a team: lifecycle, merge queue, billing and a new shell290 /** A g1t agent finished reviewing a pull request; no verdict if it could not. */
291 "review.completed": {
292 pullId: string;
293 repoId: string;
294 number: number;
295 verdict?: "approve" | "request_changes";
296 };
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look297 /** A person was given a role on one repository directly, had it changed, or lost it. `role` is null once removed. */
298 "repo.collaborator_added": RepoCollaboratorData;
299 "repo.collaborator_removed": RepoCollaboratorData;
300 "repo.collaborator_role_changed": RepoCollaboratorData;
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar301 /** A team of a workspace was created, changed (`changes` says what) or deleted. */
302 "team.created": TeamChangedData;
303 "team.edited": TeamChangedData;
304 "team.deleted": TeamChangedData;
305 /** Someone joined a team, had their role in it changed, or left it. */
306 "team.member_added": TeamChangedData;
307 "team.member_role_changed": TeamChangedData;
308 "team.member_removed": TeamChangedData;
309 /** A team was given a role on a repository, had it changed, or lost it. */
310 "team.repo_added": TeamChangedData;
311 "team.repo_role_changed": TeamChangedData;
312 "team.repo_removed": TeamChangedData;
Agents as a team: lifecycle, merge queue, billing and a new shell313 /** A repository's merge queue gained, lost or settled an entry. */
314 "queue.changed": { repoId: string };
What happened across an outcome, as a feed beside its graph315 /** `number` is the issue or pull request commented on. */
Agents as a team: lifecycle, merge queue, billing and a new shell316 "comment.created": {
317 commentId: string;
318 repoId: string;
319 number: number;
320 /** Set when the comment is on a pull request. */
321 pullId?: string;
322 /** Set when the comment is a review. */
323 verdict?: Verdict;
Cards you act on in chat; agents comment and review as themselves; names shown cleanly; commits on the calendar324 /**
325 * Set when one of the workspace's agents wrote it, as itself; the
326 * event's actor is then the person it acted for (`actingFor`).
327 */
328 agent?: AgentRef;
329 actingFor?: { id: string; username: string };
330 /** An agent's review: its verdict is advisory and counts toward nothing. */
331 advisory?: boolean;
Agents as a team: lifecycle, merge queue, billing and a new shell332 };
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts333 /** A comment's text changed; `changes.body.from` is what it said before. */
334 "comment.edited": {
335 commentId: string;
336 repoId: string;
337 number: number;
338 /** Set when the comment is on a pull request. */
339 pullId?: string;
340 changes: { body: { from: string } };
341 };
342 /** A comment was deleted; `comment` is the comment as it was. */
343 "comment.deleted": {
344 commentId: string;
345 repoId: string;
346 number: number;
347 /** Set when the comment was on a pull request. */
348 pullId?: string;
349 comment: {
350 id: string;
351 body: string;
352 author: { id: string; username: string };
353 createdAt: string;
354 path: string | null;
355 line: number | null;
356 };
357 };
API and MCP server in Rust; a public index at the API root358 "session.appended": { pullId: string; repoId: string; number: number; count: number };
Agents and memory, checks and conflicts, profiles, slug renames, custom domains359 /**
Events: review requests, assignments, stops and deployments are published360 * A build of a project finished, for production or one pull request's
361 * preview (`number`). `path` is the deployment's page on the site;
362 * `recovered`, on a success, says the build before it failed.
363 */
364 "deployment.succeeded": DeploymentEventData;
365 "deployment.failed": DeploymentEventData;
366 /**
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97367 * A deployment was made, wherever it runs: reported through the API, by
368 * a g1t Actions job with an `environment:`, or a g1t.page build. Its
369 * `payload` is left out: read the deployment for it.
370 */
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts371 "deployment.created": { repoId: string; deployment: Omit<RepoDeployment, "payload">; causedByJob?: string };
372 /**
373 * A deployment has a new status; `deployment` is as it is now.
374 * `causedByJob` (as on every event a workflow job's token causes) is the
375 * run whose job made it, so no workflow starts for it.
376 */
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97377 "deployment_status.created": {
378 repoId: string;
379 deployment: Omit<RepoDeployment, "payload">;
380 deploymentStatus: DeploymentStatus;
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts381 causedByJob?: string;
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97382 };
383 /**
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts384 * A release changed, one event per GitHub release activity it amounts
385 * to: made (`created`; a published one is also `published`, and
386 * `released` or `prereleased`), a draft published, edited, made a draft
387 * again (`unpublished`) or deleted. `release` is as it is now (as it was,
388 * for `release.deleted`).
389 */
390 "release.created": ReleaseEventData;
391 "release.published": ReleaseEventData;
392 "release.released": ReleaseEventData;
393 "release.prereleased": ReleaseEventData;
394 "release.edited": ReleaseEventData;
395 "release.unpublished": ReleaseEventData;
396 "release.deleted": ReleaseEventData;
397 /**
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member398 * A package version was published, such as an image pushed by
399 * `docker push`. `tags` are the tags that now point to it; `repoId` (and
400 * the event's) is the repository the package is linked to, if any.
401 */
402 "package.published": PackageEventData & { version: string; digest: string; size: number; tags: string[] };
403 /** One version of a package was deleted, with the tags that pointed to it. */
404 "package.version_deleted": PackageEventData & { version: string; digest: string };
405 /** A package was deleted with every version it had. */
406 "package.deleted": PackageEventData;
407 /** A package became public or private. */
408 "package.visibility_changed": PackageEventData & { visibility: "public" | "private" };
409 /**
Agents and memory, checks and conflicts, profiles, slug renames, custom domains410 * A workspace's slug changed from `from` to `to`. Services that store a
411 * slug move their rows to the workspace's *current* slug (see
412 * `currentWorkspaceSlug`), so a repeated or late delivery after a second
413 * rename still lands in the right place.
414 */
415 "workspace.renamed": { workspaceId: string; from: string; to: string };
Agents get guardrails, run credentials, an audit log, a context hub, repository instructions and mentions; security upkeep; snake_case API416 /**
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look417 * A repository moved from workspace `from` to `to`, keeping its id and
418 * name. Services that store its path or its workspace's slug move those
419 * rows to its *current* path (ask repos `path_by_id`), so a repeated or
420 * late delivery after a second transfer still lands in the right place.
421 */
422 "repo.transferred": { repoId: string; name: string; from: string; to: string };
423 /**
424 * A workspace is gone. Services drop what they keep for it alone; ledgers,
425 * invoices and the audit log stay under its slug, which is never reused.
426 */
427 "workspace.deleted": { workspaceId: string; slug: string };
428 /**
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member429 * An owner deleted a workspace; staff can restore it until `purgeAfter`,
430 * and nobody can reach it meanwhile. Services hide what they keep for it
431 * and stop what runs for it, keeping their rows: repos deletes its
432 * repositories softly (`repo.deleted` with `withWorkspace`), deployments
433 * pauses its apps, search drops it. `workspace.restored` undoes exactly
434 * that; `workspace.deleted` follows once `purgeAfter` passes. `by` is the
435 * owner's username.
436 */
437 "workspace.deleting": { workspaceId: string; slug: string; by: string; purgeAfter: string };
438 /**
439 * Staff brought a deleted workspace back with its members and tokens.
440 * Services undo what they did on `workspace.deleting`, and only that.
441 */
442 "workspace.restored": { workspaceId: string; slug: string };
443 /**
Agents get guardrails, run credentials, an audit log, a context hub, repository instructions and mentions; security upkeep; snake_case API444 * A memory was added, changed, reviewed or forgotten. No text: ask the
445 * work service for it by id. `repoId` is the project's, or null for the
446 * workspace's memory. `status` is `deleted` once forgotten.
447 */
448 "memory.changed": { memoryId: string; workspace: string; status: "candidate" | "kept" | "dismissed" | "deleted" };
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look449 /**
450 * A sandbox was stopped because it looked like it was mining: CPU pinned
451 * with little I/O and no progress, or a miner seen by name. For g1t's
452 * staff, in sudo; published with no `repoId` so it never reaches a
453 * repository's timeline or webhooks. `metrics` is what the sandbox
454 * measured (`Verdict` in crates/runner abuse.rs), or null if it could
455 * not say.
456 */
457 "abuse.flagged": {
458 workspace: string;
459 repo: string | null;
460 /** The agent run, when the sandbox had one. */
461 run: string | null;
462 /** What the sandbox was for: agent, checks, queue, actions, deploy... */
463 kind: string;
464 sandbox: string;
465 metrics: Record<string, unknown> | null;
466 };
Docs know what code they describe; a project's docs folder in Docs; Docs events; files on any S3 store467 /**
468 * Docs (services/docs): a page was made. Published with no `repoId`, so
469 * a page (which may be in a private space) never reaches a repository's
470 * timeline or webhooks; `actor` is the user's or agent's id. Readers
471 * check access with the docs service before showing anything of it.
472 */
473 "doc.page.created": DocPageEventData;
474 /**
475 * A page's content changed: at most once per page every ten minutes of
476 * editing (when its history records a version), and for every agent
477 * edit, accepted suggestion and restore. `authors` are member keys
478 * (`user:<id>`, `agent:<id>`) of everyone whose changes are in it.
479 */
480 "doc.page.updated": DocPageEventData & { versionId: string; kind: "edit" | "agent" | "suggestion" | "restore"; authors: string[] };
481 /** A page went to the trash (with every page under it; one event for the page asked about). */
482 "doc.page.archived": DocPageEventData;
483 /**
484 * A page became possibly out of date: a merged pull request or a push to
485 * a repository's default branch changed code it cites. `repoId` is in
486 * `data`, not on the event, for the same reason as above. `owners` are
487 * member keys; an agent that owns the page can update it
488 * (`stalePagesForAgent` in docs.ts).
489 */
490 "doc.page.stale": DocPageEventData & { repoId: string; repo: string; commit: string; pull: number | null; paths: string[]; owners: string[] };
491};
492
493/** What every `doc.page.*` event carries. */
494export type DocPageEventData = {
495 workspace: string;
496 workspaceId: string;
497 pageId: string;
498 spaceId: string;
499 title: string;
500 /** The page's address on the site. */
501 path: string;
API and MCP server in Rust; a public index at the API root502};
503
504export type EventType = keyof EventPayloads;
505
506export type G1tEvent<T extends EventType = EventType> = {
507 [K in T]: {
508 id: string;
509 type: K;
510 /** The service that published it. */
511 source: string;
512 /** RFC 3339. */
513 time: string;
514 /** The repo the event concerns, used to scope timelines and deliveries. */
515 repoId: string | null;
516 /** The user or agent that caused it, if any. */
517 actor: string | null;
518 data: EventPayloads[K];
519 };
520}[T];
521
522/** What a publisher supplies; the bus fills in `id` and `time`. */
523export type NewEvent<T extends EventType = EventType> = {
524 [K in T]: Omit<G1tEvent<K>, "id" | "time">;
525}[T];
526
527export type EventQuery = {
528 repoId?: string;
529 types?: EventType[];
530 /** Return events older than this event id. */
531 before?: string;
Merge leftovers: plan activity filtered in the query, pushes counted by account, ghost during the deletion window, profile time zones (identity 0039)532 /** Only events by this account id. */
533 actor?: string;
534 /** Only events about these issues or pull requests (`number`, or the `issue` a comment or review is on). */
535 numbers?: number[];
536 /** Only events at or after this RFC 3339 time. */
537 since?: string;
API and MCP server in Rust; a public index at the API root538 limit?: number;
539};
540
541/** The event bus and its durable log. */
542export interface EventsApi {
543 publish(events: NewEvent[]): Promise<void>;
544 /** Newest first. */
545 list(query: EventQuery): Promise<G1tEvent[]>;
546}

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