g1t/packages/contracts/src/runner.ts

22 lines832 bytesCodeBlame
1import type { User, Viewer } from "./identity";
2import type { Result } from "./result";
3import type { Attempt } from "./work";
4
5export type RunHostedInput = {
6 /** How many agents to race on the intent, each in its own sandbox. */
7 count: number;
8 /** Extra guidance appended to the intent's brief for these runs. */
9 instructions?: string;
10};
11
12/** Hosted agents: sandboxes on g1t that work on an intent. */
13export interface RunnerApi {
14 /** Whether this viewer may start hosted agents. */
15 available(viewer: Viewer): Promise<boolean>;
16 /**
17 * Starts `count` attempts on the intent, each run by an agent in its own
18 * sandbox. Returns as soon as the sandboxes are starting; progress shows
19 * up in each attempt's session.
20 */
21 run(actor: User, intentId: string, input: RunHostedInput): Promise<Result<Attempt[]>>;
22}