@@ -6,6 +6,7 @@ import { Blueprint, type CreateParams as BlueprintCreateParams } from './sdk/blu
66import { Snapshot } from './sdk/snapshot' ;
77import { StorageObject } from './sdk/storage-object' ;
88import { Agent } from './sdk/agent' ;
9+ import { Axon } from './sdk/axon' ;
910import { Scorer } from './sdk/scorer' ;
1011import { NetworkPolicy } from './sdk/network-policy' ;
1112import { GatewayConfig } from './sdk/gateway-config' ;
@@ -23,6 +24,7 @@ import type {
2324import type { BlueprintListParams } from './resources/blueprints' ;
2425import type { ObjectCreateParams , ObjectListParams } from './resources/objects' ;
2526import type { AgentCreateParams , AgentListParams } from './resources/agents' ;
27+ import type { AxonCreateParams } from './resources/axons' ;
2628import type { ScorerCreateParams , ScorerListParams } from './resources/scenarios/scorers' ;
2729import type { NetworkPolicyCreateParams , NetworkPolicyListParams } from './resources/network-policies' ;
2830import type { GatewayConfigCreateParams , GatewayConfigListParams } from './resources/gateway-configs' ;
@@ -369,6 +371,7 @@ type ContentType = ObjectCreateParams['content_type'];
369371 * - `snapshot` - {@link SnapshotOps}
370372 * - `storageObject` - {@link StorageObjectOps}
371373 * - `agent` - {@link AgentOps}
374+ * - `axon` - {@link AxonOps}
372375 * - `scorer` - {@link ScorerOps}
373376 * - `networkPolicy` - {@link NetworkPolicyOps}
374377 * - `gatewayConfig` - {@link GatewayConfigOps}
@@ -433,6 +436,15 @@ export class RunloopSDK {
433436 */
434437 public readonly agent : AgentOps ;
435438
439+ /**
440+ * **Axon Operations** - {@link AxonOps} for creating and accessing {@link Axon} class instances.
441+ *
442+ * [Beta] Axons are event communication channels that support publishing events and subscribing
443+ * to event streams via server-sent events (SSE). Use these operations to create new axons,
444+ * get existing ones by ID, or list all active axons.
445+ */
446+ public readonly axon : AxonOps ;
447+
436448 /**
437449 * **Scorer Operations** - {@link ScorerOps} for creating and accessing {@link Scorer} class instances.
438450 *
@@ -494,6 +506,7 @@ export class RunloopSDK {
494506 this . snapshot = new SnapshotOps ( this . api ) ;
495507 this . storageObject = new StorageObjectOps ( this . api ) ;
496508 this . agent = new AgentOps ( this . api ) ;
509+ this . axon = new AxonOps ( this . api ) ;
497510 this . scorer = new ScorerOps ( this . api ) ;
498511 this . networkPolicy = new NetworkPolicyOps ( this . api ) ;
499512 this . gatewayConfig = new GatewayConfigOps ( this . api ) ;
@@ -1484,6 +1497,82 @@ export class AgentOps {
14841497 }
14851498}
14861499
1500+ /**
1501+ * [Beta] Axon SDK interface for managing axons.
1502+ *
1503+ * @category Axon
1504+ *
1505+ * @remarks
1506+ * ## Overview
1507+ *
1508+ * The `AxonOps` class provides a high-level abstraction for managing axons,
1509+ * which are event communication channels. Axons support publishing events
1510+ * and subscribing to event streams via server-sent events (SSE).
1511+ *
1512+ * ## Usage
1513+ *
1514+ * This interface is accessed via {@link RunloopSDK.axon}. You should construct
1515+ * a {@link RunloopSDK} instance and use it from there:
1516+ *
1517+ * @example
1518+ * ```typescript
1519+ * const runloop = new RunloopSDK();
1520+ * const axon = await runloop.axon.create();
1521+ *
1522+ * // Publish an event
1523+ * await axon.publish({
1524+ * event_type: 'task_complete',
1525+ * origin: 'AGENT_EVENT',
1526+ * payload: JSON.stringify({ result: 'success' }),
1527+ * source: 'my-agent',
1528+ * });
1529+ *
1530+ * // Subscribe to events
1531+ * const stream = await axon.subscribeSse();
1532+ * for await (const event of stream) {
1533+ * console.log(event.event_type, event.payload);
1534+ * }
1535+ * ```
1536+ */
1537+ export class AxonOps {
1538+ /**
1539+ * @private
1540+ */
1541+ constructor ( private client : RunloopAPI ) { }
1542+
1543+ /**
1544+ * [Beta] Create a new axon.
1545+ *
1546+ * @param {AxonCreateParams } [params] - Parameters for creating the axon.
1547+ * @param {Core.RequestOptions } [options] - Request options.
1548+ * @returns {Promise<Axon> } An {@link Axon} instance.
1549+ */
1550+ async create ( params ?: AxonCreateParams , options ?: Core . RequestOptions ) : Promise < Axon > {
1551+ return Axon . create ( this . client , params , options ) ;
1552+ }
1553+
1554+ /**
1555+ * Get an axon object by its ID.
1556+ *
1557+ * @param {string } id - The ID of the axon.
1558+ * @returns {Axon } An {@link Axon} instance.
1559+ */
1560+ fromId ( id : string ) : Axon {
1561+ return Axon . fromId ( this . client , id ) ;
1562+ }
1563+
1564+ /**
1565+ * [Beta] List all active axons.
1566+ *
1567+ * @param {Core.RequestOptions } [options] - Request options.
1568+ * @returns {Promise<Axon[]> } An array of {@link Axon} instances.
1569+ */
1570+ async list ( options ?: Core . RequestOptions ) : Promise < Axon [ ] > {
1571+ const result = await this . client . axons . list ( options ) ;
1572+ return result . axons . map ( ( axon ) => Axon . fromId ( this . client , axon . id ) ) ;
1573+ }
1574+ }
1575+
14871576/**
14881577 * Scorer SDK interface for managing custom scorers.
14891578 *
@@ -2199,6 +2288,7 @@ export declare namespace RunloopSDK {
21992288 SnapshotOps as SnapshotOps ,
22002289 StorageObjectOps as StorageObjectOps ,
22012290 AgentOps as AgentOps ,
2291+ AxonOps as AxonOps ,
22022292 ScorerOps as ScorerOps ,
22032293 NetworkPolicyOps as NetworkPolicyOps ,
22042294 GatewayConfigOps as GatewayConfigOps ,
@@ -2210,6 +2300,7 @@ export declare namespace RunloopSDK {
22102300 Snapshot as Snapshot ,
22112301 StorageObject as StorageObject ,
22122302 Agent as Agent ,
2303+ Axon as Axon ,
22132304 Scorer as Scorer ,
22142305 NetworkPolicy as NetworkPolicy ,
22152306 GatewayConfig as GatewayConfig ,
@@ -2229,6 +2320,7 @@ export {
22292320 Snapshot ,
22302321 StorageObject ,
22312322 Agent ,
2323+ Axon ,
22322324 Scorer ,
22332325 NetworkPolicy ,
22342326 McpConfig ,
0 commit comments