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

Initial g1t: services, event bus, intents and attempts1/**
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.
Initial g1t: services, event bus, intents and attempts5 *
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";
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step15import type { 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
Initial g1t: services, event bus, intents and attempts86export type EventPayloads = {
87 "repo.created": { repoId: string; namespace: string; name: string; isPrivate: boolean };
Issues and pull requests replace intents and attempts88 "repo.forked": { repoId: string; sourceRepoId: string; pullId: string };
Events service in Rust, with RFC 3339 times and accurate push events89 /**
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 /**
Events service in Rust, with RFC 3339 times and accurate push events177 * 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 */
Mission control counts people's direct pushes to the default branch180 /** `before` is where the ref pointed before; absent for a new branch or tag. */
181 "git.push": { repoId: string; ref: string; before?: string; after: string; defaultBranch: boolean };
g1t is the stored author of what it opens; the person who asked is requested_by and keeps the author's rights182 /**
183 * `author` is who opened it: g1t, for one its agent filed while at work,
184 * with `requestedBy` the person it was working for. Every issue and pull
185 * request event carries both.
186 */
187 "issue.opened": {
188 issueId: string;
189 repoId: string;
190 number: number;
191 title: string;
192 author?: { id: string; username: string };
193 requestedBy?: { id: string; username: string };
194 };
Issues and pull requests replace intents and attempts195 "issue.updated": { issueId: string; repoId: string; number: number };
Events: review requests, assignments, stops and deployments are published196 /** The people an issue is assigned to changed; `assignees` is the new set, `added` those newly assigned. */
197 "issue.assigned": { issueId: string; repoId: string; number: number; assignees: string[]; added?: string[] };
Issues and pull requests replace intents and attempts198 /** `resolvedBy` is the number of the pull request whose merge closed it. */
199 "issue.closed": {
200 issueId: string;
201 repoId: string;
202 number: number;
203 reason: "completed" | "not_planned";
204 resolvedBy?: number;
205 };
206 "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 rights207 /**
208 * `issue` is the number of the issue the pull request is for. `author` is
209 * who opened it: g1t, for a change g1t made, with `requestedBy` the person
210 * who asked for it.
211 */
212 "pull.opened": {
213 pullId: string;
214 repoId: string;
215 number: number;
216 issue?: number;
217 agent: string;
218 author?: { id: string; username: string };
219 requestedBy?: { id: string; username: string };
220 };
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step221 /** `confidence`, on a g1t agent's change once g1t has worked it out, is on every pull request event. */
222 "pull.ready": { pullId: string; repoId: string; number: number; issue?: number; confidence?: Confidence };
Acceptance checks in sandboxes, line comments and review verdicts223 /** 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 step224 "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 shell225 /** 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 step226 "pull.merge_requested": { pullId: string; repoId: string; number: number; issue?: number; confidence?: Confidence };
227 "pull.closed": { pullId: string; repoId: string; number: number; issue?: number; confidence?: Confidence };
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts228 /** A closed pull request was opened again. `commit` is its head. */
229 "pull.reopened": { pullId: string; repoId: string; number: number; issue?: number; commit?: string; confidence?: Confidence };
230 /** A pull request that was ready for review was turned back into a draft. */
231 "pull.converted_to_draft": { pullId: string; repoId: string; number: number; issue?: number; confidence?: Confidence };
Events: review requests, assignments, stops and deployments are published232 /** People were assigned to a pull request: `assignees` is the new set, `added` those newly assigned. */
233 "pull.assigned": { pullId: string; repoId: string; number: number; issue?: number; assignees: string[]; added: string[] };
234 /** 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 bar235 "pull.review_requested": {
236 pullId: string;
237 repoId: string;
238 number: number;
239 issue?: number;
240 reviewers?: string[];
241 /** Teams asked: `team` is `workspace/slug`, `notified` who is told, `assigned` who review assignment picked. */
242 teams?: TeamRequested[];
243 /** Asked because they own files it changes (its CODEOWNERS file). */
244 codeOwners?: boolean;
245 };
246 "pull.review_request_removed": {
247 pullId: string;
248 repoId: string;
249 number: number;
250 issue?: number;
251 reviewers?: string[];
252 teams?: TeamRequested[];
253 };
Events: review requests, assignments, stops and deployments are published254 /** g1t stopped seeing a pull request through until a person steps in; `detail` says why. */
255 "pull.stalled": { pullId: string; repoId: string; number: number; issue?: number; detail: string };
256 /** A pull request g1t had stopped on is going again. */
257 "pull.resumed": { pullId: string; repoId: string; number: number; issue?: number };
Agents and memory, checks and conflicts, profiles, slug renames, custom domains258 /**
259 * The pull request's head or its target moved and the files both changed
260 * overlap: a sandbox should find out whether it still merges cleanly.
261 * `commit` is its head.
262 */
263 "pull.mergecheck": { pullId: string; repoId: string; number: number; issue?: number; commit: string };
264 /** Whether the pull request merges cleanly was settled. */
265 "pull.mergeability": { pullId: string; repoId: string; number: number; issue?: number };
Agents asked while not at work are woken to answer266 /** Another agent asked the agent on a pull request, which was not at work, a question or handed it work. */
267 "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 step268 "pull.merged": { pullId: string; repoId: string; number: number; issue?: number; commit: string; confidence?: Confidence };
Acceptance checks in sandboxes, line comments and review verdicts269 /** A run of the acceptance checks finished. `commit` is what was checked. */
270 "checks.completed": {
271 pullId: string;
272 repoId: string;
273 number: number;
274 status: "passed" | "failed" | "errored";
275 commit: string;
276 };
Merge checks: statuses and check runs on every commit277 /** A status was set on a commit through the API. */
278 "status.created": StatusEventData;
279 /** A check run was reported on a commit through the API, completed, asked to run again, or had one of its buttons pressed (`requestedAction`). */
280 "check_run.created": CheckRunEventData;
281 "check_run.completed": CheckRunEventData;
282 "check_run.rerequested": CheckRunEventData;
283 "check_run.requested_action": CheckRunEventData;
284 /** A reporter's check runs on a commit all completed, or it was asked to run them again. */
285 "check_suite.completed": CheckSuiteEventData;
286 "check_suite.rerequested": CheckSuiteEventData;
Agents as a team: lifecycle, merge queue, billing and a new shell287 /** A g1t agent finished reviewing a pull request; no verdict if it could not. */
288 "review.completed": {
289 pullId: string;
290 repoId: string;
291 number: number;
292 verdict?: "approve" | "request_changes";
293 };
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look294 /** A person was given a role on one repository directly, had it changed, or lost it. `role` is null once removed. */
295 "repo.collaborator_added": RepoCollaboratorData;
296 "repo.collaborator_removed": RepoCollaboratorData;
297 "repo.collaborator_role_changed": RepoCollaboratorData;
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar298 /** A team of a workspace was created, changed (`changes` says what) or deleted. */
299 "team.created": TeamChangedData;
300 "team.edited": TeamChangedData;
301 "team.deleted": TeamChangedData;
302 /** Someone joined a team, had their role in it changed, or left it. */
303 "team.member_added": TeamChangedData;
304 "team.member_role_changed": TeamChangedData;
305 "team.member_removed": TeamChangedData;
306 /** A team was given a role on a repository, had it changed, or lost it. */
307 "team.repo_added": TeamChangedData;
308 "team.repo_role_changed": TeamChangedData;
309 "team.repo_removed": TeamChangedData;
Agents as a team: lifecycle, merge queue, billing and a new shell310 /** A repository's merge queue gained, lost or settled an entry. */
311 "queue.changed": { repoId: string };
What happened across an outcome, as a feed beside its graph312 /** `number` is the issue or pull request commented on. */
Agents as a team: lifecycle, merge queue, billing and a new shell313 "comment.created": {
314 commentId: string;
315 repoId: string;
316 number: number;
317 /** Set when the comment is on a pull request. */
318 pullId?: string;
319 /** Set when the comment is a review. */
320 verdict?: Verdict;
321 };
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts322 /** A comment's text changed; `changes.body.from` is what it said before. */
323 "comment.edited": {
324 commentId: string;
325 repoId: string;
326 number: number;
327 /** Set when the comment is on a pull request. */
328 pullId?: string;
329 changes: { body: { from: string } };
330 };
331 /** A comment was deleted; `comment` is the comment as it was. */
332 "comment.deleted": {
333 commentId: string;
334 repoId: string;
335 number: number;
336 /** Set when the comment was on a pull request. */
337 pullId?: string;
338 comment: {
339 id: string;
340 body: string;
341 author: { id: string; username: string };
342 createdAt: string;
343 path: string | null;
344 line: number | null;
345 };
346 };
Issues and pull requests replace intents and attempts347 "session.appended": { pullId: string; repoId: string; number: number; count: number };
Agents and memory, checks and conflicts, profiles, slug renames, custom domains348 /**
Events: review requests, assignments, stops and deployments are published349 * A build of a project finished, for production or one pull request's
350 * preview (`number`). `path` is the deployment's page on the site;
351 * `recovered`, on a success, says the build before it failed.
352 */
353 "deployment.succeeded": DeploymentEventData;
354 "deployment.failed": DeploymentEventData;
355 /**
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97356 * A deployment was made, wherever it runs: reported through the API, by
357 * a g1t Actions job with an `environment:`, or a g1t.page build. Its
358 * `payload` is left out: read the deployment for it.
359 */
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts360 "deployment.created": { repoId: string; deployment: Omit<RepoDeployment, "payload">; causedByJob?: string };
361 /**
362 * A deployment has a new status; `deployment` is as it is now.
363 * `causedByJob` (as on every event a workflow job's token causes) is the
364 * run whose job made it, so no workflow starts for it.
365 */
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97366 "deployment_status.created": {
367 repoId: string;
368 deployment: Omit<RepoDeployment, "payload">;
369 deploymentStatus: DeploymentStatus;
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts370 causedByJob?: string;
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97371 };
372 /**
Merge Actions: cross-repo workflows and actions, release and deployment triggers, step timeouts373 * A release changed, one event per GitHub release activity it amounts
374 * to: made (`created`; a published one is also `published`, and
375 * `released` or `prereleased`), a draft published, edited, made a draft
376 * again (`unpublished`) or deleted. `release` is as it is now (as it was,
377 * for `release.deleted`).
378 */
379 "release.created": ReleaseEventData;
380 "release.published": ReleaseEventData;
381 "release.released": ReleaseEventData;
382 "release.prereleased": ReleaseEventData;
383 "release.edited": ReleaseEventData;
384 "release.unpublished": ReleaseEventData;
385 "release.deleted": ReleaseEventData;
386 /**
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member387 * A package version was published, such as an image pushed by
388 * `docker push`. `tags` are the tags that now point to it; `repoId` (and
389 * the event's) is the repository the package is linked to, if any.
390 */
391 "package.published": PackageEventData & { version: string; digest: string; size: number; tags: string[] };
392 /** One version of a package was deleted, with the tags that pointed to it. */
393 "package.version_deleted": PackageEventData & { version: string; digest: string };
394 /** A package was deleted with every version it had. */
395 "package.deleted": PackageEventData;
396 /** A package became public or private. */
397 "package.visibility_changed": PackageEventData & { visibility: "public" | "private" };
398 /**
Agents and memory, checks and conflicts, profiles, slug renames, custom domains399 * A workspace's slug changed from `from` to `to`. Services that store a
400 * slug move their rows to the workspace's *current* slug (see
401 * `currentWorkspaceSlug`), so a repeated or late delivery after a second
402 * rename still lands in the right place.
403 */
404 "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 API405 /**
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look406 * A repository moved from workspace `from` to `to`, keeping its id and
407 * name. Services that store its path or its workspace's slug move those
408 * rows to its *current* path (ask repos `path_by_id`), so a repeated or
409 * late delivery after a second transfer still lands in the right place.
410 */
411 "repo.transferred": { repoId: string; name: string; from: string; to: string };
412 /**
413 * A workspace is gone. Services drop what they keep for it alone; ledgers,
414 * invoices and the audit log stay under its slug, which is never reused.
415 */
416 "workspace.deleted": { workspaceId: string; slug: string };
417 /**
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member418 * An owner deleted a workspace; staff can restore it until `purgeAfter`,
419 * and nobody can reach it meanwhile. Services hide what they keep for it
420 * and stop what runs for it, keeping their rows: repos deletes its
421 * repositories softly (`repo.deleted` with `withWorkspace`), deployments
422 * pauses its apps, search drops it. `workspace.restored` undoes exactly
423 * that; `workspace.deleted` follows once `purgeAfter` passes. `by` is the
424 * owner's username.
425 */
426 "workspace.deleting": { workspaceId: string; slug: string; by: string; purgeAfter: string };
427 /**
428 * Staff brought a deleted workspace back with its members and tokens.
429 * Services undo what they did on `workspace.deleting`, and only that.
430 */
431 "workspace.restored": { workspaceId: string; slug: string };
432 /**
Agents get guardrails, run credentials, an audit log, a context hub, repository instructions and mentions; security upkeep; snake_case API433 * A memory was added, changed, reviewed or forgotten. No text: ask the
434 * work service for it by id. `repoId` is the project's, or null for the
435 * workspace's memory. `status` is `deleted` once forgotten.
436 */
437 "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 look438 /**
439 * A sandbox was stopped because it looked like it was mining: CPU pinned
440 * with little I/O and no progress, or a miner seen by name. For g1t's
441 * staff, in sudo; published with no `repoId` so it never reaches a
442 * repository's timeline or webhooks. `metrics` is what the sandbox
443 * measured (`Verdict` in crates/runner abuse.rs), or null if it could
444 * not say.
445 */
446 "abuse.flagged": {
447 workspace: string;
448 repo: string | null;
449 /** The agent run, when the sandbox had one. */
450 run: string | null;
451 /** What the sandbox was for: agent, checks, queue, actions, deploy... */
452 kind: string;
453 sandbox: string;
454 metrics: Record<string, unknown> | null;
455 };
Initial g1t: services, event bus, intents and attempts456};
457
458export type EventType = keyof EventPayloads;
459
460export type G1tEvent<T extends EventType = EventType> = {
461 [K in T]: {
462 id: string;
463 type: K;
464 /** The service that published it. */
465 source: string;
Events service in Rust, with RFC 3339 times and accurate push events466 /** RFC 3339. */
467 time: string;
Initial g1t: services, event bus, intents and attempts468 /** The repo the event concerns, used to scope timelines and deliveries. */
469 repoId: string | null;
470 /** The user or agent that caused it, if any. */
471 actor: string | null;
472 data: EventPayloads[K];
473 };
474}[T];
475
476/** What a publisher supplies; the bus fills in `id` and `time`. */
477export type NewEvent<T extends EventType = EventType> = {
478 [K in T]: Omit<G1tEvent<K>, "id" | "time">;
479}[T];
480
481export type EventQuery = {
482 repoId?: string;
483 types?: EventType[];
484 /** Return events older than this event id. */
485 before?: string;
486 limit?: number;
487};
488
489/** The event bus and its durable log. */
490export interface EventsApi {
491 publish(events: NewEvent[]): Promise<void>;
492 /** Newest first. */
493 list(query: EventQuery): Promise<G1tEvent[]>;
494}

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