| 1 | import type { User, Viewer } from "./identity"; |
| 2 | import type { Result } from "./result"; |
| 3 | import type { RepoPath } from "./repos"; |
| 4 | import type { Pull } from "./work"; |
| 5 | |
| 6 | /** A model a g1t agent can run on, as offered to the person starting it. */ |
| 7 | export type AgentModel = { |
| 8 | /** Stable name used in requests, e.g. `balanced`. */ |
| 9 | id: string; |
| 10 | label: string; |
| 11 | description: string; |
| 12 | /** The model behind it, by its public name, e.g. `Claude Sonnet 5.5`. */ |
| 13 | modelName: string; |
| 14 | }; |
| 15 | |
| 16 | export type RunHostedInput = { |
| 17 | /** How many agents to put on the issue, each in its own sandbox. */ |
| 18 | count: number; |
| 19 | /** Extra guidance given to the agents along with the issue. */ |
| 20 | instructions?: string; |
| 21 | /** One of the offered model ids; the first offered when absent. */ |
| 22 | model?: string; |
| 23 | }; |
| 24 | |
| 25 | /** Hosted agents: sandboxes on g1t that work on an issue. */ |
| 26 | export interface RunnerApi { |
| 27 | /** The models this viewer may run g1t agents on; empty if they may not. */ |
| 28 | models(viewer: Viewer): Promise<AgentModel[]>; |
| 29 | /** |
| 30 | * 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. |
| 33 | */ |
| 34 | run(actor: User, repo: RepoPath, issue: number, input: RunHostedInput): Promise<Result<Pull[]>>; |
| 35 | } |