Skip to content

Commit 99f6268

Browse files
authored
Merge pull request #4 from runloopai/wall/remove-benchmark-sdk
feat(sdk)!: remove hosted scenario and scorer wrappers
2 parents d4e9f2f + 4200332 commit 99f6268

29 files changed

Lines changed: 6 additions & 3370 deletions

‎README.md‎

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Why teams pick Runloop:
1010
- **A real machine, not just a code runner.** Full filesystem, shell, background processes, and public URLs for ports.
1111
- **Fast repeat starts.** Blueprints and disk snapshots boot pre-built environments instead of reinstalling dependencies.
1212
- **Built for production.** SOC 2 compliant, with bring-your-own-cloud deployment on AWS, GCP, and Azure.
13-
- **Evaluation built in.** Scenarios, scorers, and benchmarks let you measure agent performance on the same platform you run it on.
1413

1514
## Installation
1615

@@ -103,8 +102,6 @@ The SDK provides object-oriented interfaces for all major Runloop resources:
103102
- **[`runloop.storageObject`](https://runloopai.github.io/api-client-ts/stable/classes/sdk.StorageObjectOps.html)** - Storage object management (upload, download, list objects)
104103
- **[`runloop.agent`](https://runloopai.github.io/api-client-ts/stable/classes/sdk.AgentOps.html)** - Agent management (create, list agents from npm/pip/git)
105104
- **[`runloop.axon`](https://runloopai.github.io/api-client-ts/stable/classes/sdk.AxonOps.html)** - [Beta] Axon management (create, publish events, subscribe via SSE)
106-
- **[`runloop.scenario`](https://runloopai.github.io/api-client-ts/stable/classes/sdk.ScenarioOps.html)** - Scenario management (list scenarios, start runs)
107-
- **[`runloop.scorer`](https://runloopai.github.io/api-client-ts/stable/classes/sdk.ScorerOps.html)** - Scorer management (create, list, update)
108105
- **[`runloop.networkPolicy`](https://runloopai.github.io/api-client-ts/stable/classes/sdk.NetworkPolicyOps.html)** - Network policy management (create, list, update egress rules)
109106
- **[`runloop.gatewayConfig`](https://runloopai.github.io/api-client-ts/stable/classes/sdk.GatewayConfigOps.html)** - Gateway config management (create, list API proxy configurations)
110107
- **[`runloop.mcpConfig`](https://runloopai.github.io/api-client-ts/stable/classes/sdk.McpConfigOps.html)** - MCP config management (create, list MCP server configurations)
@@ -152,54 +149,6 @@ console.log(logs.logs);
152149
const devbox = await blueprint.createDevbox({ name: 'my-devbox' });
153150
```
154151

155-
### Scorers
156-
157-
Scorers are custom scoring functions used to evaluate scenario outputs. Create scorers via `runloop.scorer.create()`, then update them with the returned `Scorer` instance:
158-
159-
```typescript
160-
import { RunloopSDK } from '@runloop/api-client';
161-
162-
const runloop = new RunloopSDK();
163-
164-
const scorer = await runloop.scorer.create({
165-
type: 'my_scorer',
166-
bash_script: 'echo "1.0"',
167-
});
168-
169-
await scorer.update({ bash_script: 'echo "0.5"' });
170-
```
171-
172-
### Scenarios
173-
174-
Scenarios define tasks with a well defined starting environment, task evaluation scorer and an optional reference solution. Use `runloop.scenario.fromId()` to get a scenario, then `scenario.run()` to start a run with your agent mounted:
175-
176-
```typescript
177-
const scenario = runloop.scenario.fromId('scn_123');
178-
const run = await scenario.run({
179-
run_name: 'my-run',
180-
runProfile: {
181-
mounts: [
182-
{
183-
type: 'agent_mount',
184-
agent_id: 'agt_123',
185-
agent_path: '/home/user/agent',
186-
},
187-
],
188-
},
189-
});
190-
await run.devbox.cmd.exec('python /home/user/agent/main.py');
191-
await run.scoreAndComplete();
192-
```
193-
194-
### Benchmarks
195-
196-
Benchmarks are collections of scenarios for evaluating AI agents. Access via `runloop.api.benchmarks`:
197-
198-
```typescript
199-
const benchmarks = await runloop.api.benchmarks.listPublic();
200-
const definitions = await runloop.api.benchmarks.definitions('benchmark_id');
201-
```
202-
203152
## Migration from API Client
204153

205154
If you're currently using the legacy API, migration is straightforward:

‎llms.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
- Always use `RunloopSDK` as the entry point (not legacy `Runloop` default export)
2626
- Prefer SDK methods (`sdk.devbox`, `sdk.blueprint`, etc.) for object-oriented patterns and convenience
27-
- For resources without SDK coverage (e.g., benchmarks), use `sdk.api.*` as a fallback
27+
- For resources without SDK coverage, use `sdk.api.*` as a fallback
2828
- Use `sdk.devbox.create()` to create devboxes; they auto-await readiness
2929
- Use `devbox.suspend()` plus `devbox.awaitSuspended()` when you want to park a devbox and preserve its disk state, then use `devbox.resume()` to bring the same devbox back to `running`
3030
- Use `devbox.snapshotDisk()` to capture a reusable disk baseline and `snapshot.createDevbox()` or `sdk.devbox.createFromSnapshot(snapshot.id, ...)` to branch multiple devboxes from that same state
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2-
31
export const workerPath = require.resolve('./code-tool-worker.mjs');

‎src/resources/scenarios/runs.ts‎

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import * as Core from '../../core';
66
import * as ScenariosAPI from './scenarios';
77
import { ScenarioRunViewsBenchmarkRunsCursorIDPage } from './scenarios';
88
import { type BenchmarkRunsCursorIDPageParams } from '../../pagination';
9-
import { LongPollRequestOptions, poll, resolveLongPollTimeoutMs } from '@runloop/api-client/lib/polling';
10-
import { RunloopError } from '../..';
119
import { type Response } from '../../_shims/index';
1210

1311
export class Runs extends APIResource {
@@ -75,65 +73,6 @@ export class Runs extends APIResource {
7573
score(id: string, options?: Core.RequestOptions): Core.APIPromise<ScenariosAPI.ScenarioRunView> {
7674
return this._client.post(`/v1/scenarios/runs/${id}/score`, options);
7775
}
78-
79-
/**
80-
* Wait for a scenario run to finish scoring.
81-
* Polls the scenario run status until it reaches a terminal state.
82-
*/
83-
async awaitScored(
84-
id: string,
85-
options?: LongPollRequestOptions<ScenariosAPI.ScenarioRunView>,
86-
): Promise<ScenariosAPI.ScenarioRunView> {
87-
const pollTimeoutMs = resolveLongPollTimeoutMs(options);
88-
const { longPoll: _lp, polling, signal, ...requestOptions } = options ?? {};
89-
const finalResult = await poll(
90-
() => this.retrieve(id, requestOptions),
91-
() => this.retrieve(id, requestOptions),
92-
{
93-
...polling,
94-
signal,
95-
...(pollTimeoutMs !== undefined ? { timeoutMs: pollTimeoutMs } : {}),
96-
shouldStop: (result) => {
97-
return result.state !== 'scoring';
98-
},
99-
},
100-
);
101-
102-
// Check if the run was scored successfully, otherwise throw an error
103-
if (finalResult.state !== 'scored') {
104-
throw new RunloopError(
105-
`Scenario run ${id} failed to transition to scored state. Final state: ${finalResult.state}`,
106-
);
107-
}
108-
109-
return finalResult;
110-
}
111-
112-
/**
113-
* Score a scenario run and wait for it to finish scoring.
114-
* This is a convenience method that combines score() and awaitScoring().
115-
*/
116-
async scoreAndAwait(
117-
id: string,
118-
options?: LongPollRequestOptions<ScenariosAPI.ScenarioRunView>,
119-
): Promise<ScenariosAPI.ScenarioRunView> {
120-
const { longPoll, polling, signal, ...requestOptions } = options ?? {};
121-
const run = await this.score(id, requestOptions);
122-
return this.awaitScored(run.id, { ...requestOptions, longPoll, polling, signal });
123-
}
124-
125-
/**
126-
* Score a scenario run, wait for scoring to complete, and then complete the run.
127-
* This is a convenience method that combines scoreAndAwait() and complete().
128-
*/
129-
async scoreAndComplete(
130-
id: string,
131-
options?: LongPollRequestOptions<ScenariosAPI.ScenarioRunView>,
132-
): Promise<ScenariosAPI.ScenarioRunView> {
133-
const { longPoll, polling, signal, ...requestOptions } = options ?? {};
134-
const scoredRun = await this.scoreAndAwait(id, { ...requestOptions, longPoll, polling, signal });
135-
return this.complete(scoredRun.id, requestOptions);
136-
}
13776
}
13877

13978
export interface RunListParams extends BenchmarkRunsCursorIDPageParams {

‎src/resources/scenarios/scenarios.ts‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import {
2323
ScenariosCursorIDPage,
2424
type ScenariosCursorIDPageParams,
2525
} from '../../pagination';
26-
import { LongPollRequestOptions } from '@runloop/api-client/lib/polling';
27-
import { DevboxView } from '../devboxes';
2826

2927
export class Scenarios extends APIResource {
3028
runs: RunsAPI.Runs = new RunsAPI.Runs(this._client);
@@ -125,19 +123,6 @@ export class Scenarios extends APIResource {
125123
startRun(body: ScenarioStartRunParams, options?: Core.RequestOptions): Core.APIPromise<ScenarioRunView> {
126124
return this._client.post('/v1/scenarios/start_run', { body, ...options });
127125
}
128-
129-
/**
130-
* Start a new ScenarioRun and wait for its environment to be ready.
131-
* This is a convenience method that combines startRun() and awaitReady() on the devbox.
132-
*/
133-
async startRunAndAwaitEnvReady(
134-
body: ScenarioStartRunParams,
135-
options?: LongPollRequestOptions<DevboxView>,
136-
): Promise<ScenarioRunView> {
137-
const run = await this.startRun(body, options);
138-
await this._client.devboxes.awaitRunning(run.devbox_id, options);
139-
return run;
140-
}
141126
}
142127

143128
export class ScenarioViewsScenariosCursorIDPage extends ScenariosCursorIDPage<ScenarioView> {}

‎src/resources/shared.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -522,11 +522,6 @@ export interface ResumeTriggers {
522522
http?: boolean | null;
523523
}
524524

525-
/**
526-
* Configuration profile for scenario/benchmark runs.
527-
*
528-
* @category Shared Types
529-
*/
530525
export interface RunProfile {
531526
/**
532527
* Mapping of Environment Variable to Value. May be shown in devbox logging.

0 commit comments

Comments
 (0)