@@ -5,6 +5,7 @@ import { Devbox } from './sdk/devbox';
55import { Blueprint , type CreateParams as BlueprintCreateParams } from './sdk/blueprint' ;
66import { Snapshot } from './sdk/snapshot' ;
77import { StorageObject } from './sdk/storage-object' ;
8+ import { Agent } from './sdk/agent' ;
89
910// Import types used in this file
1011import type {
@@ -15,6 +16,7 @@ import type {
1516} from './resources/devboxes/devboxes' ;
1617import type { BlueprintListParams } from './resources/blueprints' ;
1718import type { ObjectCreateParams , ObjectListParams } from './resources/objects' ;
19+ import type { AgentCreateParams , AgentListParams } from './resources/agents' ;
1820import { PollingOptions } from './lib/polling' ;
1921
2022export * from './index' ;
@@ -48,6 +50,7 @@ type ContentType = ObjectCreateParams['content_type'];
4850 * - `blueprint` - {@link BlueprintOps}
4951 * - `snapshot` - {@link SnapshotOps}
5052 * - `storageObject` - {@link StorageObjectOps}
53+ * - `agent` - {@link AgentOps}
5154 *
5255 * See the documentation for each Operations class for more details.
5356 *
@@ -109,6 +112,15 @@ export class RunloopSDK {
109112 */
110113 public readonly storageObject : StorageObjectOps ;
111114
115+ /**
116+ * **Agent Operations** - {@link AgentOps} for creating and accessing {@link Agent} class instances.
117+ *
118+ * Agents are registered AI agent entities that can be mounted into devboxes. Agents can be sourced
119+ * from npm, pip, git repositories, or object storage, and provide reusable agent code that can be
120+ * shared across multiple devboxes. Use these operations to create new agents or get existing ones by ID.
121+ */
122+ public readonly agent : AgentOps ;
123+
112124 /**
113125 * Creates a new RunloopSDK instance.
114126 * @param {ClientOptions } [options] - Optional client configuration options.
@@ -119,6 +131,7 @@ export class RunloopSDK {
119131 this . blueprint = new BlueprintOps ( this . api ) ;
120132 this . snapshot = new SnapshotOps ( this . api ) ;
121133 this . storageObject = new StorageObjectOps ( this . api ) ;
134+ this . agent = new AgentOps ( this . api ) ;
122135 }
123136}
124137
@@ -615,6 +628,75 @@ export class StorageObjectOps {
615628 }
616629}
617630
631+ /**
632+ * Agent SDK interface for managing agents.
633+ *
634+ * ## Overview
635+ *
636+ * The `AgentOps` class provides a high-level abstraction for managing AI agent entities.
637+ * Agents can be sourced from npm, pip, git repositories, or object storage, and mounted
638+ * into devboxes for execution.
639+ *
640+ * ## Usage
641+ *
642+ * This interface is accessed via {@link RunloopSDK.agent}. You should construct
643+ * a {@link RunloopSDK} instance and use it from there:
644+ *
645+ * @example
646+ * ```typescript
647+ * const sdk = new RunloopSDK();
648+ * const agent = await sdk.agent.create({
649+ * name: 'my-npm-agent',
650+ * source: {
651+ * type: 'npm',
652+ * npm: { package_name: '@my -org/agent' }
653+ * }
654+ * });
655+ * const devbox = await agent.createDevbox({
656+ * name: 'devbox-with-agent',
657+ * agent_path: '/home/user/agent'
658+ * });
659+ * ```
660+ */
661+ export class AgentOps {
662+ /**
663+ * @private
664+ */
665+ constructor ( private client : RunloopAPI ) { }
666+
667+ /**
668+ * Create a new agent.
669+ *
670+ * @param {AgentCreateParams } params - Parameters for creating the agent.
671+ * @param {Core.RequestOptions } [options] - Request options.
672+ * @returns {Promise<Agent> } An {@link Agent} instance.
673+ */
674+ async create ( params : AgentCreateParams , options ?: Core . RequestOptions ) : Promise < Agent > {
675+ return Agent . create ( this . client , params , options ) ;
676+ }
677+
678+ /**
679+ * Get an agent object by its ID.
680+ *
681+ * @param {string } id - The ID of the agent.
682+ * @returns {Agent } An {@link Agent} instance.
683+ */
684+ fromId ( id : string ) : Agent {
685+ return Agent . fromId ( this . client , id ) ;
686+ }
687+
688+ /**
689+ * List all agents with optional filters.
690+ *
691+ * @param {AgentListParams } [params] - Optional filter parameters.
692+ * @param {Core.RequestOptions } [options] - Request options.
693+ * @returns {Promise<Agent[]> } An array of {@link Agent} instances.
694+ */
695+ async list ( params ?: AgentListParams , options ?: Core . RequestOptions ) : Promise < Agent [ ] > {
696+ return Agent . list ( this . client , params , options ) ;
697+ }
698+ }
699+
618700// @deprecated Use {@link RunloopSDK} instead.
619701/**
620702 * @deprecated Use {@link RunloopSDK} instead.
@@ -634,10 +716,12 @@ export declare namespace RunloopSDK {
634716 BlueprintOps as BlueprintOps ,
635717 SnapshotOps as SnapshotOps ,
636718 StorageObjectOps as StorageObjectOps ,
719+ AgentOps as AgentOps ,
637720 Devbox as Devbox ,
638721 Blueprint as Blueprint ,
639722 Snapshot as Snapshot ,
640723 StorageObject as StorageObject ,
724+ Agent as Agent ,
641725 } ;
642726}
643727// Export SDK classes from sdk/sdk.ts - these are separate from RunloopSDK to avoid circular dependencies
@@ -650,6 +734,7 @@ export {
650734 Blueprint ,
651735 Snapshot ,
652736 StorageObject ,
737+ Agent ,
653738 Execution ,
654739 ExecutionResult ,
655740} from './sdk/index' ;
0 commit comments