Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.67.1"
".": "0.68.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 94
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-63df0e3eb49d4874724f380b650693d90e071a41748bc163e93236b72a342883.yml
openapi_spec_hash: eb5df67593bd1c4a5c8d1082f24d73fb
config_hash: 95facb8cef59b5a1b05763b871bf6a4b
configured_endpoints: 97
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5f33221208c1febba343daf570f73a5086f150a9b128df045ebddc3fe2c86607.yml
openapi_spec_hash: 0aea07130ddbe43a665a13a68231e2ca
config_hash: 2363f563f42501d2b1587a4f64bdccaf
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 0.68.0 (2025-11-19)

Full Changelog: [v0.67.1...v0.68.0](https://github.com/runloopai/api-client-ts/compare/v0.67.1...v0.68.0)

### Features

* **blueprint:** adds queued state ([c8f5e0b](https://github.com/runloopai/api-client-ts/commit/c8f5e0b01cbd2fd573403b7d9b61816efce03b1f))
* **blueprints:** Cleanup the BuildContext API ([#6407](https://github.com/runloopai/api-client-ts/issues/6407))\n\nTest ([8bd1c44](https://github.com/runloopai/api-client-ts/commit/8bd1c4468565effadc66b8524594daa5761938a4))
* **blueprints:** prevent deletion of blueprints with dependent snapshots ([f52eb9a](https://github.com/runloopai/api-client-ts/commit/f52eb9aedc5d9317a2ab27952c13b0f2b2172339))
* **devbox:** adding devbox execution std out / err last n lines ([#643](https://github.com/runloopai/api-client-ts/issues/643)) ([71de54c](https://github.com/runloopai/api-client-ts/commit/71de54c13bca60f3057e8c8ed2b8e5e531fffc9f))
* **object:** Added ability to give objects a Time To Live, after which they are automatically deleted.\nfeat(blueprints): Added the ability to attach objects as build contexts that can be referenced in your Dockerfile. ([0ee5067](https://github.com/runloopai/api-client-ts/commit/0ee50676c734c536a8d1b5c25ef19d154da1f121))
* **streaming:** harden SSE timeout recovery ([#645](https://github.com/runloopai/api-client-ts/issues/645)) ([cb249a7](https://github.com/runloopai/api-client-ts/commit/cb249a7d2c854a28e3932f35b2ad98dd30c8737b))


### Bug Fixes

* **file-mount:** client side validation for file_mount size checks ([#639](https://github.com/runloopai/api-client-ts/issues/639)) ([30e7123](https://github.com/runloopai/api-client-ts/commit/30e712315740c393c21dbfe34e4d2611dca0d0dc))
* **snapshot:** added "deleted" status to DevboxSnapshotStatus enum \n fix(storage-object): added ObjectState enum, fixed createObject() to appropriately type content_type and state as the respective enums ([5f8b203](https://github.com/runloopai/api-client-ts/commit/5f8b2031aa38ff9a87e3554c9e5100189ea448e2))

## 0.67.1 (2025-11-05)

Full Changelog: [v0.67.0...v0.67.1](https://github.com/runloopai/api-client-ts/compare/v0.67.0...v0.67.1)
Expand Down
15 changes: 15 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Types:

- <code><a href="./src/resources/shared.ts">AfterIdle</a></code>
- <code><a href="./src/resources/shared.ts">AgentMountParameters</a></code>
- <code><a href="./src/resources/shared.ts">AgentSource</a></code>
- <code><a href="./src/resources/shared.ts">CodeMountParameters</a></code>
- <code><a href="./src/resources/shared.ts">LaunchParameters</a></code>
- <code><a href="./src/resources/shared.ts">Mount</a></code>
Expand Down Expand Up @@ -41,6 +42,20 @@ Methods:
- <code title="post /v1/benchmarks/runs/{id}/complete">client.benchmarks.runs.<a href="./src/resources/benchmarks/runs.ts">complete</a>(id) -> BenchmarkRunView</code>
- <code title="get /v1/benchmarks/runs/{id}/scenario_runs">client.benchmarks.runs.<a href="./src/resources/benchmarks/runs.ts">listScenarioRuns</a>(id, { ...params }) -> ScenarioRunViewsBenchmarkRunsCursorIDPage</code>

# Agents

Types:

- <code><a href="./src/resources/agents.ts">AgentCreateParameters</a></code>
- <code><a href="./src/resources/agents.ts">AgentListView</a></code>
- <code><a href="./src/resources/agents.ts">AgentView</a></code>

Methods:

- <code title="post /v1/agents">client.agents.<a href="./src/resources/agents.ts">create</a>({ ...params }) -> AgentView</code>
- <code title="get /v1/agents/{id}">client.agents.<a href="./src/resources/agents.ts">retrieve</a>(id) -> AgentView</code>
- <code title="get /v1/agents">client.agents.<a href="./src/resources/agents.ts">list</a>({ ...params }) -> AgentViewsAgentsCursorIDPage</code>

# Blueprints

Types:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@runloop/api-client",
"version": "0.67.1",
"version": "0.68.0",
"description": "The official TypeScript library for the Runloop API",
"author": "Runloop <support@runloop.ai>",
"types": "dist/sdk.d.ts",
Expand Down
31 changes: 31 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import * as Core from './core';
import * as Errors from './error';
import * as Pagination from './pagination';
import {
type AgentsCursorIDPageParams,
AgentsCursorIDPageResponse,
type BenchmarkRunsCursorIDPageParams,
BenchmarkRunsCursorIDPageResponse,
type BenchmarksCursorIDPageParams,
Expand All @@ -28,6 +30,15 @@ import {
} from './pagination';
import * as Uploads from './uploads';
import * as API from './resources/index';
import {
AgentCreateParameters,
AgentCreateParams,
AgentListParams,
AgentListView,
AgentView,
AgentViewsAgentsCursorIDPage,
Agents,
} from './resources/agents';
import {
BlueprintBuildFromInspectionParameters,
BlueprintBuildLog,
Expand Down Expand Up @@ -289,6 +300,7 @@ export class Runloop extends Core.APIClient {
}

benchmarks: API.Benchmarks = new API.Benchmarks(this);
agents: API.Agents = new API.Agents(this);
blueprints: API.Blueprints = new API.Blueprints(this);
devboxes: API.Devboxes = new API.Devboxes(this);
scenarios: API.Scenarios = new API.Scenarios(this);
Expand Down Expand Up @@ -341,6 +353,8 @@ export class Runloop extends Core.APIClient {

Runloop.Benchmarks = Benchmarks;
Runloop.BenchmarkViewsBenchmarksCursorIDPage = BenchmarkViewsBenchmarksCursorIDPage;
Runloop.Agents = Agents;
Runloop.AgentViewsAgentsCursorIDPage = AgentViewsAgentsCursorIDPage;
Runloop.Blueprints = Blueprints;
Runloop.BlueprintViewsBlueprintsCursorIDPage = BlueprintViewsBlueprintsCursorIDPage;
Runloop.Devboxes = Devboxes;
Expand Down Expand Up @@ -387,6 +401,12 @@ export declare namespace Runloop {
type BenchmarksCursorIDPageResponse as BenchmarksCursorIDPageResponse,
};

export import AgentsCursorIDPage = Pagination.AgentsCursorIDPage;
export {
type AgentsCursorIDPageParams as AgentsCursorIDPageParams,
type AgentsCursorIDPageResponse as AgentsCursorIDPageResponse,
};

export import BenchmarkRunsCursorIDPage = Pagination.BenchmarkRunsCursorIDPage;
export {
type BenchmarkRunsCursorIDPageParams as BenchmarkRunsCursorIDPageParams,
Expand Down Expand Up @@ -434,6 +454,16 @@ export declare namespace Runloop {
type BenchmarkStartRunParams as BenchmarkStartRunParams,
};

export {
Agents as Agents,
type AgentCreateParameters as AgentCreateParameters,
type AgentListView as AgentListView,
type AgentView as AgentView,
AgentViewsAgentsCursorIDPage as AgentViewsAgentsCursorIDPage,
type AgentCreateParams as AgentCreateParams,
type AgentListParams as AgentListParams,
};

export {
Blueprints as Blueprints,
type BlueprintBuildFromInspectionParameters as BlueprintBuildFromInspectionParameters,
Expand Down Expand Up @@ -561,6 +591,7 @@ export declare namespace Runloop {

export type AfterIdle = API.AfterIdle;
export type AgentMountParameters = API.AgentMountParameters;
export type AgentSource = API.AgentSource;
export type CodeMountParameters = API.CodeMountParameters;
export type LaunchParameters = API.LaunchParameters;
export type Mount = API.Mount;
Expand Down
74 changes: 74 additions & 0 deletions src/pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,80 @@ export class BenchmarksCursorIDPage<Item extends { id: string }>
}
}

export interface AgentsCursorIDPageResponse<Item> {
agents: Array<Item>;

has_more: boolean;

total_count: number;
}

export interface AgentsCursorIDPageParams {
starting_after?: string;

limit?: number;
}

export class AgentsCursorIDPage<Item extends { id: string }>
extends AbstractPage<Item>
implements AgentsCursorIDPageResponse<Item>
{
agents: Array<Item>;

has_more: boolean;

total_count: number;

constructor(
client: APIClient,
response: Response,
body: AgentsCursorIDPageResponse<Item>,
options: FinalRequestOptions,
) {
super(client, response, body, options);

this.agents = body.agents || [];
this.has_more = body.has_more || false;
this.total_count = body.total_count || 0;
}

getPaginatedItems(): Item[] {
return this.agents ?? [];
}

override hasNextPage(): boolean {
if (this.has_more === false) {
return false;
}

return super.hasNextPage();
}

// @deprecated Please use `nextPageInfo()` instead
nextPageParams(): Partial<AgentsCursorIDPageParams> | null {
const info = this.nextPageInfo();
if (!info) return null;
if ('params' in info) return info.params;
const params = Object.fromEntries(info.url.searchParams);
if (!Object.keys(params).length) return null;
return params;
}

nextPageInfo(): PageInfo | null {
const agents = this.getPaginatedItems();
if (!agents.length) {
return null;
}

const id = agents[agents.length - 1]?.id;
if (!id) {
return null;
}

return { params: { starting_after: id } };
}
}

export interface BenchmarkRunsCursorIDPageResponse<Item> {
runs: Array<Item>;

Expand Down
156 changes: 156 additions & 0 deletions src/resources/agents.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as Shared from './shared';
import { AgentsCursorIDPage, type AgentsCursorIDPageParams } from '../pagination';

export class Agents extends APIResource {
/**
* Create a new Agent with a name and optional public visibility. The Agent will be
* assigned a unique ID.
*/
create(body: AgentCreateParams, options?: Core.RequestOptions): Core.APIPromise<AgentView> {
return this._client.post('/v1/agents', { body, ...options });
}

/**
* Retrieve a specific Agent by its unique identifier.
*/
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<AgentView> {
return this._client.get(`/v1/agents/${id}`, options);
}

/**
* List all Agents for the authenticated account with pagination support.
*/
list(
query?: AgentListParams,
options?: Core.RequestOptions,
): Core.PagePromise<AgentViewsAgentsCursorIDPage, AgentView>;
list(options?: Core.RequestOptions): Core.PagePromise<AgentViewsAgentsCursorIDPage, AgentView>;
list(
query: AgentListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.PagePromise<AgentViewsAgentsCursorIDPage, AgentView> {
if (isRequestOptions(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/v1/agents', AgentViewsAgentsCursorIDPage, { query, ...options });
}
}

export class AgentViewsAgentsCursorIDPage extends AgentsCursorIDPage<AgentView> {}

/**
* Parameters for creating a new Agent.
*/
export interface AgentCreateParameters {
/**
* The name of the Agent.
*/
name: string;

/**
* The source configuration for the Agent.
*/
source?: Shared.AgentSource | null;
}
Comment on lines +49 to +59
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Replace the duplicated AgentCreateParameters interface with a type alias to the existing AgentCreateParams to avoid redundant/contradictory type definitions. [maintainability]

Severity Level: Minor ⚠️

Suggested change
export interface AgentCreateParameters {
/**
* The name of the Agent.
*/
name: string;
/**
* The source configuration for the Agent.
*/
source?: Shared.AgentSource | null;
}
export type AgentCreateParameters = AgentCreateParams;
Why it matters? ⭐

The file currently defines two identical shapes: AgentCreateParameters (interface) and AgentCreateParams (interface). I confirmed both exist in src/resources/agents.ts. Making AgentCreateParameters a type alias to AgentCreateParams removes redundant duplicate definitions and prevents them from drifting apart in the future. The alias preserves the public type name and is fully compatible with the existing namespace re-exports in this file, so this is a safe, maintainability-focused change.

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** src/resources/agents.ts
**Line:** 49:59
**Comment:**
	*Maintainability: Replace the duplicated `AgentCreateParameters` interface with a type alias to the existing `AgentCreateParams` to avoid redundant/contradictory type definitions.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.


/**
* A paginated list of Agents.
*/
export interface AgentListView {
/**
* The list of Agents.
*/
agents: Array<AgentView>;

/**
* Whether there are more Agents to fetch.
*/
has_more: boolean;

/**
* The count of remaining Agents.
*/
remaining_count: number;

/**
* The total count of Agents.
*/
total_count: number;
}

/**
* An Agent represents a registered AI agent entity.
*/
export interface AgentView {
/**
* The unique identifier of the Agent.
*/
id: string;

/**
* The creation time of the Agent (Unix timestamp milliseconds).
*/
create_time_ms: number;

/**
* Whether the Agent is publicly accessible.
*/
is_public: boolean;

/**
* The name of the Agent.
*/
name: string;

/**
* The source configuration for the Agent.
*/
source?: Shared.AgentSource | null;
}

export interface AgentCreateParams {
/**
* The name of the Agent.
*/
name: string;

/**
* The source configuration for the Agent.
*/
source?: Shared.AgentSource | null;
}

export interface AgentListParams extends AgentsCursorIDPageParams {
/**
* Filter agents by public visibility.
*/
is_public?: boolean;

/**
* Filter agents by name (partial match supported).
*/
name?: string;

/**
* Search by agent ID or name.
*/
search?: string;
}

Agents.AgentViewsAgentsCursorIDPage = AgentViewsAgentsCursorIDPage;

export declare namespace Agents {
export {
type AgentCreateParameters as AgentCreateParameters,
type AgentListView as AgentListView,
type AgentView as AgentView,
AgentViewsAgentsCursorIDPage as AgentViewsAgentsCursorIDPage,
type AgentCreateParams as AgentCreateParams,
type AgentListParams as AgentListParams,
};
}
Loading