g1t/packages/contracts/src/runner.ts

40 lines1,560 bytesCodeBlame

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.

Hosted agents: sandboxes on Cloudflare Containers started from an intent1import type { User, Viewer } from "./identity";
2import type { Result } from "./result";
Issues and pull requests replace intents and attempts3import type { RepoPath } from "./repos";
4import type { Pull } from "./work";
Hosted agents: sandboxes on Cloudflare Containers started from an intent5
g1t agents: model menu and optional AI Gateway routing6/** A model a g1t agent can run on, as offered to the person starting it. */
7export type AgentModel = {
8 /** Stable name used in requests, e.g. `balanced`. */
9 id: string;
10 label: string;
11 description: string;
Show the model behind each choice; toolchains in the sandbox12 /** The model behind it, by its public name, e.g. `Claude Sonnet 5.5`. */
13 modelName: string;
g1t agents: model menu and optional AI Gateway routing14};
15
Hosted agents: sandboxes on Cloudflare Containers started from an intent16export type RunHostedInput = {
Issues and pull requests replace intents and attempts17 /** How many agents to put on the issue, each in its own sandbox. */
Hosted agents: sandboxes on Cloudflare Containers started from an intent18 count: number;
Issues and pull requests replace intents and attempts19 /** Extra guidance given to the agents along with the issue. */
Hosted agents: sandboxes on Cloudflare Containers started from an intent20 instructions?: string;
g1t agents: model menu and optional AI Gateway routing21 /** One of the offered model ids; the first offered when absent. */
22 model?: string;
Hosted agents: sandboxes on Cloudflare Containers started from an intent23};
24
Acceptance checks in sandboxes, line comments and review verdicts25/** Sandboxes on g1t: agents that work on an issue, and acceptance checks. */
Hosted agents: sandboxes on Cloudflare Containers started from an intent26export interface RunnerApi {
g1t agents: model menu and optional AI Gateway routing27 /** The models this viewer may run g1t agents on; empty if they may not. */
28 models(viewer: Viewer): Promise<AgentModel[]>;
Hosted agents: sandboxes on Cloudflare Containers started from an intent29 /**
Issues and pull requests replace intents and attempts30 * Opens `count` draft pull requests for the issue, each made by an agent
31 * in its own sandbox. Returns as soon as the sandboxes are starting;
32 * progress shows up in each pull request's session.
Hosted agents: sandboxes on Cloudflare Containers started from an intent33 */
Issues and pull requests replace intents and attempts34 run(actor: User, repo: RepoPath, issue: number, input: RunHostedInput): Promise<Result<Pull[]>>;
Acceptance checks in sandboxes, line comments and review verdicts35 /**
36 * Runs the acceptance checks of a pull request again. Whoever opened it,
37 * or a member of the repository's workspace, may ask.
38 */
39 recheck(actor: User, repo: RepoPath, number: number): Promise<Result<boolean>>;
Hosted agents: sandboxes on Cloudflare Containers started from an intent40}