g1t/packages/contracts/src/runner.ts

32 lines1,164 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";
3import type { Attempt } from "./work";
4
g1t agents: model menu and optional AI Gateway routing5/** A model a g1t agent can run on, as offered to the person starting it. */
6export type AgentModel = {
7 /** Stable name used in requests, e.g. `balanced`. */
8 id: string;
9 label: string;
10 description: string;
11};
12
Hosted agents: sandboxes on Cloudflare Containers started from an intent13export type RunHostedInput = {
14 /** How many agents to race on the intent, each in its own sandbox. */
15 count: number;
16 /** Extra guidance appended to the intent's brief for these runs. */
17 instructions?: string;
g1t agents: model menu and optional AI Gateway routing18 /** One of the offered model ids; the first offered when absent. */
19 model?: string;
Hosted agents: sandboxes on Cloudflare Containers started from an intent20};
21
22/** Hosted agents: sandboxes on g1t that work on an intent. */
23export interface RunnerApi {
g1t agents: model menu and optional AI Gateway routing24 /** The models this viewer may run g1t agents on; empty if they may not. */
25 models(viewer: Viewer): Promise<AgentModel[]>;
Hosted agents: sandboxes on Cloudflare Containers started from an intent26 /**
27 * Starts `count` attempts on the intent, each run by an agent in its own
28 * sandbox. Returns as soon as the sandboxes are starting; progress shows
29 * up in each attempt's session.
30 */
31 run(actor: User, intentId: string, input: RunHostedInput): Promise<Result<Attempt[]>>;
32}