@runtypelabs/sdk 10.6.0 → 10.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -5743,9 +5743,6 @@ function buildAgentAdmissionHeaders(options) {
5743
5743
  if (options.idempotencyKey) headers["idempotency-key"] = options.idempotencyKey;
5744
5744
  return headers;
5745
5745
  }
5746
- /**
5747
- * Agents endpoint handlers
5748
- */
5749
5746
  var AgentsEndpoint = class AgentsEndpoint {
5750
5747
  constructor(client) {
5751
5748
  this.client = client;
@@ -5784,10 +5781,30 @@ var AgentsEndpoint = class AgentsEndpoint {
5784
5781
  return this.client.delete(`/agents/${id}`);
5785
5782
  }
5786
5783
  /**
5787
- * Export an agent as a self-contained runtime definition for @runtypelabs/runtime
5784
+ * Export an agent as a self-contained runtime definition for @runtypelabs/runtime.
5785
+ * Pass `versionId` or `alias` (at most one) to export a published version or the
5786
+ * version a release alias points at; the result's `release` records which one.
5788
5787
  */
5789
- async exportRuntime(id) {
5790
- return this.client.get(`/agents/${id}/export-runtime`);
5788
+ async exportRuntime(id, selector) {
5789
+ return this.client.get(`/agents/${id}/export-runtime`, selector);
5790
+ }
5791
+ /**
5792
+ * Export an agent as a vendorable zip: `agent.json`, the prebuilt `runtime/` package, `manifest.json`,
5793
+ * and `LICENSE`. Two exports of the same version are byte-identical; `contentHash` pins them.
5794
+ */
5795
+ async exportRuntimeBundle(id, selector) {
5796
+ const query = new URLSearchParams({ format: "bundle" });
5797
+ if (selector?.versionId !== void 0) query.set("versionId", selector.versionId);
5798
+ if (selector?.alias !== void 0) query.set("alias", selector.alias);
5799
+ const response = await this.client.requestStream(`/agents/${id}/export-runtime?${query}`, { method: "GET" });
5800
+ const disposition = response.headers.get("Content-Disposition") ?? "";
5801
+ return {
5802
+ bytes: new Uint8Array(await response.arrayBuffer()),
5803
+ fileName: /filename="([^"]+)"/.exec(disposition)?.[1] ?? `${id}-runtime-bundle.zip`,
5804
+ contentHash: response.headers.get("X-Runtype-Bundle-Content-Hash"),
5805
+ runtimeVersion: response.headers.get("X-Runtype-Runtime-Version"),
5806
+ runtimeCommit: response.headers.get("X-Runtype-Runtime-Commit")
5807
+ };
5791
5808
  }
5792
5809
  /**
5793
5810
  * Roll up the agent's most recent runs: per-version and per-tool counts,
@@ -13481,7 +13498,7 @@ function transformQueryParams(params) {
13481
13498
  }
13482
13499
  //#endregion
13483
13500
  //#region src/version.ts
13484
- const SDK_VERSION = "10.6.0";
13501
+ const SDK_VERSION = "10.8.0";
13485
13502
  /**
13486
13503
  * Canonical client identity the API uses for attribution
13487
13504
  * (`detectActorSource` in apps/api/src/lib/audit-log.ts keys `'sdk'` off the
package/dist/index.d.cts CHANGED
@@ -5257,13 +5257,22 @@ interface paths {
5257
5257
  };
5258
5258
  /**
5259
5259
  * Export agent for runtime
5260
- * @description Export a fully-resolved, self-contained agent definition that the @runtypelabs/runtime package can consume directly at boot. Capabilities, flows, and nested sub-agents are inlined recursively (up to 3 levels). MCP credential values and external-agent auth credentials are replaced with secret-name references. Requires the `RUNTIME:EXPORT` scope and an Enterprise plan (the `byoc` entitlement); an unentitled account receives `403` with code `BYOC_PLAN_REQUIRED` in every environment.
5260
+ * @description Export a fully-resolved, self-contained agent definition that the @runtypelabs/runtime package can consume directly at boot. Capabilities, flows, and nested sub-agents are inlined recursively (up to 3 levels). Skills bound to the agent are snapshotted into `skills`, each with the skill version it resolved to, and the runtime loads them with no host wiring. MCP credential values and external-agent auth credentials are replaced with secret-name references. Requires the `RUNTIME:EXPORT` scope and an Enterprise plan (the `byoc` entitlement); an unentitled account receives `403` with code `BYOC_PLAN_REQUIRED` in every environment.
5261
5261
  *
5262
5262
  * The response carries `hostDependencies`: the runtime seams the exported artifact needs a host to wire before it can run everything it describes. A durable-class step (`wait-until` or `crawl`) anywhere in the agent's executable closure declares a `durable-pause-host` dependency; a detached-capable dynamic subagent pool or a detached inline subagent tool declares a `background-run-coordinator` dependency. The array is empty when nothing needs wiring.
5263
+ *
5264
+ * Pass at most one release selector. `versionId` exports that published version; `alias` exports the version a release alias (for example `staging`, `live` or `pr-42`) currently points at, resolved exactly as the execution selector `agent: { agentId, alias }` resolves it. With neither, the export follows the agent's default target: the version its `live` alias names when the org runs on release aliases, otherwise the agent's current definition. A version-backed export carries `release` with the resolved `versionId`, plus `alias` and `aliasRevision` when an alias selected it. An unknown version or alias, or an archived or expired alias, answers `404`.
5263
5265
  */
5264
5266
  get: {
5265
5267
  parameters: {
5266
- query?: never;
5268
+ query?: {
5269
+ /** @description Export this published agent version. Mutually exclusive with `alias`. */
5270
+ versionId?: string;
5271
+ /** @description Export the version this release alias currently points at. Mutually exclusive with `versionId`. */
5272
+ alias?: string;
5273
+ /** @description `json` (the default) returns the exported definition. `bundle` returns a vendorable `application/zip` with `agent.json` (the same definition), `runtime/` (the prebuilt `@runtypelabs/runtime` ESM package for the platform runtime version, installable as `file:./runtime`), `manifest.json`, and `LICENSE` (the runtime ships under FSL-1.1-ALv2). */
5274
+ format?: "json" | "bundle";
5275
+ };
5267
5276
  header?: never;
5268
5277
  path: {
5269
5278
  id: string;
@@ -5272,7 +5281,7 @@ interface paths {
5272
5281
  };
5273
5282
  requestBody?: never;
5274
5283
  responses: {
5275
- /** @description Exported agent definition */
5284
+ /** @description Exported agent definition, or with `format=bundle` a zip archive. Two bundle exports of the same version are byte-identical. The bundle `manifest.json` records the runtime version and source commit, the agent `versionId`/alias, the entrypoints, `hostDependencies`, and `contentHash`: sha256 over the `sha256sum` listing (`<sha256> <path>` lines sorted by path) of every file except `manifest.json`. The same hash is sent in the `X-Runtype-Bundle-Content-Hash` header. */
5276
5285
  200: {
5277
5286
  headers: {
5278
5287
  [name: string]: unknown;
@@ -5294,10 +5303,19 @@ interface paths {
5294
5303
  hostDependencies: components["schemas"]["RuntimeHostDependency"][];
5295
5304
  id: string;
5296
5305
  name: string;
5306
+ /** @description The published version this export contains. `alias` and `aliasRevision` are present when a release alias selected it. Absent when the export read the agent's current definition. */
5307
+ release?: {
5308
+ alias?: string;
5309
+ aliasRevision?: number;
5310
+ versionId: string;
5311
+ };
5312
+ /** @description Skills bound to the agent, snapshotted with the skill version each resolved to. `executeAgent` loads them with no host wiring. Absent when the agent has no bound skills. */
5313
+ skills?: components["schemas"]["RuntimeExportedSkill"][];
5297
5314
  };
5315
+ "application/zip": string;
5298
5316
  };
5299
5317
  };
5300
- /** @description Invalid agent ID */
5318
+ /** @description Invalid agent ID, or both `versionId` and `alias` were supplied */
5301
5319
  400: {
5302
5320
  headers: {
5303
5321
  [name: string]: unknown;
@@ -5324,7 +5342,7 @@ interface paths {
5324
5342
  "application/json": components["schemas"]["Error"];
5325
5343
  };
5326
5344
  };
5327
- /** @description Agent not found */
5345
+ /** @description Agent not found, or the selected version or alias does not exist, is archived, or has expired */
5328
5346
  404: {
5329
5347
  headers: {
5330
5348
  [name: string]: unknown;
@@ -5333,6 +5351,15 @@ interface paths {
5333
5351
  "application/json": components["schemas"]["Error"];
5334
5352
  };
5335
5353
  };
5354
+ /** @description The agent type cannot export a selected version */
5355
+ 422: {
5356
+ headers: {
5357
+ [name: string]: unknown;
5358
+ };
5359
+ content: {
5360
+ "application/json": components["schemas"]["Error"];
5361
+ };
5362
+ };
5336
5363
  /** @description Internal server error */
5337
5364
  500: {
5338
5365
  headers: {
@@ -5342,6 +5369,15 @@ interface paths {
5342
5369
  "application/json": components["schemas"]["Error"];
5343
5370
  };
5344
5371
  };
5372
+ /** @description With `format=bundle`: the prebuilt runtime artifact for this platform version is not available (code `RUNTIME_ARTIFACT_UNAVAILABLE`, with a `reason` such as `artifact_missing`) */
5373
+ 503: {
5374
+ headers: {
5375
+ [name: string]: unknown;
5376
+ };
5377
+ content: {
5378
+ "application/json": components["schemas"]["Error"];
5379
+ };
5380
+ };
5345
5381
  };
5346
5382
  };
5347
5383
  put?: never;
@@ -30220,7 +30256,9 @@ interface paths {
30220
30256
  data: {
30221
30257
  canvas?: unknown;
30222
30258
  capabilities: {
30259
+ agentId: string | null;
30223
30260
  capabilityName: string;
30261
+ flowId: string | null;
30224
30262
  }[];
30225
30263
  capabilityCount: number;
30226
30264
  createdAt: string;
@@ -42419,15 +42457,6 @@ interface paths {
42419
42457
  "application/json": components["schemas"]["Error"];
42420
42458
  };
42421
42459
  };
42422
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42423
- 404: {
42424
- headers: {
42425
- [name: string]: unknown;
42426
- };
42427
- content: {
42428
- "application/json": components["schemas"]["Error"];
42429
- };
42430
- };
42431
42460
  /** @description Daily execution limit or rate limit exceeded */
42432
42461
  429: {
42433
42462
  headers: {
@@ -42605,15 +42634,6 @@ interface paths {
42605
42634
  "application/json": components["schemas"]["RuntimeEmailAdmissionError"];
42606
42635
  };
42607
42636
  };
42608
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42609
- 404: {
42610
- headers: {
42611
- [name: string]: unknown;
42612
- };
42613
- content: {
42614
- "application/json": components["schemas"]["Error"];
42615
- };
42616
- };
42617
42637
  /** @description Daily execution limit or rate limit exceeded */
42618
42638
  429: {
42619
42639
  headers: {
@@ -42764,15 +42784,6 @@ interface paths {
42764
42784
  "application/json": components["schemas"]["Error"];
42765
42785
  };
42766
42786
  };
42767
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42768
- 404: {
42769
- headers: {
42770
- [name: string]: unknown;
42771
- };
42772
- content: {
42773
- "application/json": components["schemas"]["Error"];
42774
- };
42775
- };
42776
42787
  /** @description Daily execution limit or rate limit exceeded */
42777
42788
  429: {
42778
42789
  headers: {
@@ -42906,15 +42917,6 @@ interface paths {
42906
42917
  "application/json": components["schemas"]["Error"];
42907
42918
  };
42908
42919
  };
42909
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42910
- 404: {
42911
- headers: {
42912
- [name: string]: unknown;
42913
- };
42914
- content: {
42915
- "application/json": components["schemas"]["Error"];
42916
- };
42917
- };
42918
42920
  /** @description Daily execution limit or rate limit exceeded */
42919
42921
  429: {
42920
42922
  headers: {
@@ -43040,15 +43042,6 @@ interface paths {
43040
43042
  "application/json": components["schemas"]["Error"];
43041
43043
  };
43042
43044
  };
43043
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43044
- 404: {
43045
- headers: {
43046
- [name: string]: unknown;
43047
- };
43048
- content: {
43049
- "application/json": components["schemas"]["Error"];
43050
- };
43051
- };
43052
43045
  /** @description Daily execution limit or rate limit exceeded */
43053
43046
  429: {
43054
43047
  headers: {
@@ -43198,15 +43191,6 @@ interface paths {
43198
43191
  "application/json": components["schemas"]["Error"];
43199
43192
  };
43200
43193
  };
43201
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43202
- 404: {
43203
- headers: {
43204
- [name: string]: unknown;
43205
- };
43206
- content: {
43207
- "application/json": components["schemas"]["Error"];
43208
- };
43209
- };
43210
43194
  /** @description Daily execution limit or rate limit exceeded */
43211
43195
  429: {
43212
43196
  headers: {
@@ -43365,15 +43349,6 @@ interface paths {
43365
43349
  "application/json": components["schemas"]["Error"];
43366
43350
  };
43367
43351
  };
43368
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43369
- 404: {
43370
- headers: {
43371
- [name: string]: unknown;
43372
- };
43373
- content: {
43374
- "application/json": components["schemas"]["Error"];
43375
- };
43376
- };
43377
43352
  /** @description Daily execution limit or rate limit exceeded */
43378
43353
  429: {
43379
43354
  headers: {
@@ -43512,15 +43487,6 @@ interface paths {
43512
43487
  "application/json": components["schemas"]["Error"];
43513
43488
  };
43514
43489
  };
43515
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43516
- 404: {
43517
- headers: {
43518
- [name: string]: unknown;
43519
- };
43520
- content: {
43521
- "application/json": components["schemas"]["Error"];
43522
- };
43523
- };
43524
43490
  /** @description Daily execution limit or rate limit exceeded */
43525
43491
  429: {
43526
43492
  headers: {
@@ -43661,15 +43627,6 @@ interface paths {
43661
43627
  "application/json": components["schemas"]["Error"];
43662
43628
  };
43663
43629
  };
43664
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43665
- 404: {
43666
- headers: {
43667
- [name: string]: unknown;
43668
- };
43669
- content: {
43670
- "application/json": components["schemas"]["Error"];
43671
- };
43672
- };
43673
43630
  /** @description Daily execution limit or rate limit exceeded */
43674
43631
  429: {
43675
43632
  headers: {
@@ -43819,15 +43776,6 @@ interface paths {
43819
43776
  "application/json": components["schemas"]["Error"];
43820
43777
  };
43821
43778
  };
43822
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43823
- 404: {
43824
- headers: {
43825
- [name: string]: unknown;
43826
- };
43827
- content: {
43828
- "application/json": components["schemas"]["Error"];
43829
- };
43830
- };
43831
43779
  /** @description Daily execution limit or rate limit exceeded */
43832
43780
  429: {
43833
43781
  headers: {
@@ -51881,6 +51829,10 @@ interface components {
51881
51829
  };
51882
51830
  DispatchAgentJsonResponse: {
51883
51831
  agentExecutionId?: string;
51832
+ /** @description The published agent version the run executed. Absent when no stored version ran. */
51833
+ agentVersionId?: string;
51834
+ /** @description The release alias (for example `live`) the version was resolved through, when one was. */
51835
+ alias?: string;
51884
51836
  blockReason?: string;
51885
51837
  claudeManagedAgentId?: string;
51886
51838
  code?: string;
@@ -53886,6 +53838,19 @@ interface components {
53886
53838
  error: string;
53887
53839
  message?: string;
53888
53840
  };
53841
+ RuntimeExportedSkill: {
53842
+ approvalDelta: string[];
53843
+ body: string;
53844
+ description: string;
53845
+ resolvedTools: {
53846
+ [key: string]: unknown;
53847
+ }[];
53848
+ skillId?: string;
53849
+ /** @description The skill version this snapshot was resolved from. */
53850
+ skillVersionId?: string;
53851
+ /** @description Skill slug; the agent loads it as `skill:<slug>`. */
53852
+ slug: string;
53853
+ };
53889
53854
  RuntimeHostDependency: {
53890
53855
  interface: string;
53891
53856
  /** @enum {string} */
@@ -65117,6 +65082,14 @@ export interface AgentRunInsightsResponse {
65117
65082
  /**
65118
65083
  * Agents endpoint handlers
65119
65084
  */
65085
+ /** A `format=bundle` agent runtime export: the zip bytes plus the identity headers the API sends with it. */
65086
+ export interface AgentRuntimeBundle {
65087
+ bytes: Uint8Array;
65088
+ fileName: string;
65089
+ contentHash: string | null;
65090
+ runtimeVersion: string | null;
65091
+ runtimeCommit: string | null;
65092
+ }
65120
65093
  export declare class AgentsEndpoint {
65121
65094
  private client;
65122
65095
  private static readonly AUTO_COMPACT_SUMMARY_PREFIX;
@@ -65148,9 +65121,22 @@ export declare class AgentsEndpoint {
65148
65121
  */
65149
65122
  delete(id: string): Promise<void>;
65150
65123
  /**
65151
- * Export an agent as a self-contained runtime definition for @runtypelabs/runtime
65124
+ * Export an agent as a self-contained runtime definition for @runtypelabs/runtime.
65125
+ * Pass `versionId` or `alias` (at most one) to export a published version or the
65126
+ * version a release alias points at; the result's `release` records which one.
65152
65127
  */
65153
- exportRuntime(id: string): Promise<any>;
65128
+ exportRuntime(id: string, selector?: {
65129
+ versionId?: string;
65130
+ alias?: string;
65131
+ }): Promise<any>;
65132
+ /**
65133
+ * Export an agent as a vendorable zip: `agent.json`, the prebuilt `runtime/` package, `manifest.json`,
65134
+ * and `LICENSE`. Two exports of the same version are byte-identical; `contentHash` pins them.
65135
+ */
65136
+ exportRuntimeBundle(id: string, selector?: {
65137
+ versionId?: string;
65138
+ alias?: string;
65139
+ }): Promise<AgentRuntimeBundle>;
65154
65140
  /**
65155
65141
  * Roll up the agent's most recent runs: per-version and per-tool counts,
65156
65142
  * average tokens and cost, and which attached tools were never called.
package/dist/index.d.ts CHANGED
@@ -5257,13 +5257,22 @@ interface paths {
5257
5257
  };
5258
5258
  /**
5259
5259
  * Export agent for runtime
5260
- * @description Export a fully-resolved, self-contained agent definition that the @runtypelabs/runtime package can consume directly at boot. Capabilities, flows, and nested sub-agents are inlined recursively (up to 3 levels). MCP credential values and external-agent auth credentials are replaced with secret-name references. Requires the `RUNTIME:EXPORT` scope and an Enterprise plan (the `byoc` entitlement); an unentitled account receives `403` with code `BYOC_PLAN_REQUIRED` in every environment.
5260
+ * @description Export a fully-resolved, self-contained agent definition that the @runtypelabs/runtime package can consume directly at boot. Capabilities, flows, and nested sub-agents are inlined recursively (up to 3 levels). Skills bound to the agent are snapshotted into `skills`, each with the skill version it resolved to, and the runtime loads them with no host wiring. MCP credential values and external-agent auth credentials are replaced with secret-name references. Requires the `RUNTIME:EXPORT` scope and an Enterprise plan (the `byoc` entitlement); an unentitled account receives `403` with code `BYOC_PLAN_REQUIRED` in every environment.
5261
5261
  *
5262
5262
  * The response carries `hostDependencies`: the runtime seams the exported artifact needs a host to wire before it can run everything it describes. A durable-class step (`wait-until` or `crawl`) anywhere in the agent's executable closure declares a `durable-pause-host` dependency; a detached-capable dynamic subagent pool or a detached inline subagent tool declares a `background-run-coordinator` dependency. The array is empty when nothing needs wiring.
5263
+ *
5264
+ * Pass at most one release selector. `versionId` exports that published version; `alias` exports the version a release alias (for example `staging`, `live` or `pr-42`) currently points at, resolved exactly as the execution selector `agent: { agentId, alias }` resolves it. With neither, the export follows the agent's default target: the version its `live` alias names when the org runs on release aliases, otherwise the agent's current definition. A version-backed export carries `release` with the resolved `versionId`, plus `alias` and `aliasRevision` when an alias selected it. An unknown version or alias, or an archived or expired alias, answers `404`.
5263
5265
  */
5264
5266
  get: {
5265
5267
  parameters: {
5266
- query?: never;
5268
+ query?: {
5269
+ /** @description Export this published agent version. Mutually exclusive with `alias`. */
5270
+ versionId?: string;
5271
+ /** @description Export the version this release alias currently points at. Mutually exclusive with `versionId`. */
5272
+ alias?: string;
5273
+ /** @description `json` (the default) returns the exported definition. `bundle` returns a vendorable `application/zip` with `agent.json` (the same definition), `runtime/` (the prebuilt `@runtypelabs/runtime` ESM package for the platform runtime version, installable as `file:./runtime`), `manifest.json`, and `LICENSE` (the runtime ships under FSL-1.1-ALv2). */
5274
+ format?: "json" | "bundle";
5275
+ };
5267
5276
  header?: never;
5268
5277
  path: {
5269
5278
  id: string;
@@ -5272,7 +5281,7 @@ interface paths {
5272
5281
  };
5273
5282
  requestBody?: never;
5274
5283
  responses: {
5275
- /** @description Exported agent definition */
5284
+ /** @description Exported agent definition, or with `format=bundle` a zip archive. Two bundle exports of the same version are byte-identical. The bundle `manifest.json` records the runtime version and source commit, the agent `versionId`/alias, the entrypoints, `hostDependencies`, and `contentHash`: sha256 over the `sha256sum` listing (`<sha256> <path>` lines sorted by path) of every file except `manifest.json`. The same hash is sent in the `X-Runtype-Bundle-Content-Hash` header. */
5276
5285
  200: {
5277
5286
  headers: {
5278
5287
  [name: string]: unknown;
@@ -5294,10 +5303,19 @@ interface paths {
5294
5303
  hostDependencies: components["schemas"]["RuntimeHostDependency"][];
5295
5304
  id: string;
5296
5305
  name: string;
5306
+ /** @description The published version this export contains. `alias` and `aliasRevision` are present when a release alias selected it. Absent when the export read the agent's current definition. */
5307
+ release?: {
5308
+ alias?: string;
5309
+ aliasRevision?: number;
5310
+ versionId: string;
5311
+ };
5312
+ /** @description Skills bound to the agent, snapshotted with the skill version each resolved to. `executeAgent` loads them with no host wiring. Absent when the agent has no bound skills. */
5313
+ skills?: components["schemas"]["RuntimeExportedSkill"][];
5297
5314
  };
5315
+ "application/zip": string;
5298
5316
  };
5299
5317
  };
5300
- /** @description Invalid agent ID */
5318
+ /** @description Invalid agent ID, or both `versionId` and `alias` were supplied */
5301
5319
  400: {
5302
5320
  headers: {
5303
5321
  [name: string]: unknown;
@@ -5324,7 +5342,7 @@ interface paths {
5324
5342
  "application/json": components["schemas"]["Error"];
5325
5343
  };
5326
5344
  };
5327
- /** @description Agent not found */
5345
+ /** @description Agent not found, or the selected version or alias does not exist, is archived, or has expired */
5328
5346
  404: {
5329
5347
  headers: {
5330
5348
  [name: string]: unknown;
@@ -5333,6 +5351,15 @@ interface paths {
5333
5351
  "application/json": components["schemas"]["Error"];
5334
5352
  };
5335
5353
  };
5354
+ /** @description The agent type cannot export a selected version */
5355
+ 422: {
5356
+ headers: {
5357
+ [name: string]: unknown;
5358
+ };
5359
+ content: {
5360
+ "application/json": components["schemas"]["Error"];
5361
+ };
5362
+ };
5336
5363
  /** @description Internal server error */
5337
5364
  500: {
5338
5365
  headers: {
@@ -5342,6 +5369,15 @@ interface paths {
5342
5369
  "application/json": components["schemas"]["Error"];
5343
5370
  };
5344
5371
  };
5372
+ /** @description With `format=bundle`: the prebuilt runtime artifact for this platform version is not available (code `RUNTIME_ARTIFACT_UNAVAILABLE`, with a `reason` such as `artifact_missing`) */
5373
+ 503: {
5374
+ headers: {
5375
+ [name: string]: unknown;
5376
+ };
5377
+ content: {
5378
+ "application/json": components["schemas"]["Error"];
5379
+ };
5380
+ };
5345
5381
  };
5346
5382
  };
5347
5383
  put?: never;
@@ -30220,7 +30256,9 @@ interface paths {
30220
30256
  data: {
30221
30257
  canvas?: unknown;
30222
30258
  capabilities: {
30259
+ agentId: string | null;
30223
30260
  capabilityName: string;
30261
+ flowId: string | null;
30224
30262
  }[];
30225
30263
  capabilityCount: number;
30226
30264
  createdAt: string;
@@ -42419,15 +42457,6 @@ interface paths {
42419
42457
  "application/json": components["schemas"]["Error"];
42420
42458
  };
42421
42459
  };
42422
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42423
- 404: {
42424
- headers: {
42425
- [name: string]: unknown;
42426
- };
42427
- content: {
42428
- "application/json": components["schemas"]["Error"];
42429
- };
42430
- };
42431
42460
  /** @description Daily execution limit or rate limit exceeded */
42432
42461
  429: {
42433
42462
  headers: {
@@ -42605,15 +42634,6 @@ interface paths {
42605
42634
  "application/json": components["schemas"]["RuntimeEmailAdmissionError"];
42606
42635
  };
42607
42636
  };
42608
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42609
- 404: {
42610
- headers: {
42611
- [name: string]: unknown;
42612
- };
42613
- content: {
42614
- "application/json": components["schemas"]["Error"];
42615
- };
42616
- };
42617
42637
  /** @description Daily execution limit or rate limit exceeded */
42618
42638
  429: {
42619
42639
  headers: {
@@ -42764,15 +42784,6 @@ interface paths {
42764
42784
  "application/json": components["schemas"]["Error"];
42765
42785
  };
42766
42786
  };
42767
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42768
- 404: {
42769
- headers: {
42770
- [name: string]: unknown;
42771
- };
42772
- content: {
42773
- "application/json": components["schemas"]["Error"];
42774
- };
42775
- };
42776
42787
  /** @description Daily execution limit or rate limit exceeded */
42777
42788
  429: {
42778
42789
  headers: {
@@ -42906,15 +42917,6 @@ interface paths {
42906
42917
  "application/json": components["schemas"]["Error"];
42907
42918
  };
42908
42919
  };
42909
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42910
- 404: {
42911
- headers: {
42912
- [name: string]: unknown;
42913
- };
42914
- content: {
42915
- "application/json": components["schemas"]["Error"];
42916
- };
42917
- };
42918
42920
  /** @description Daily execution limit or rate limit exceeded */
42919
42921
  429: {
42920
42922
  headers: {
@@ -43040,15 +43042,6 @@ interface paths {
43040
43042
  "application/json": components["schemas"]["Error"];
43041
43043
  };
43042
43044
  };
43043
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43044
- 404: {
43045
- headers: {
43046
- [name: string]: unknown;
43047
- };
43048
- content: {
43049
- "application/json": components["schemas"]["Error"];
43050
- };
43051
- };
43052
43045
  /** @description Daily execution limit or rate limit exceeded */
43053
43046
  429: {
43054
43047
  headers: {
@@ -43198,15 +43191,6 @@ interface paths {
43198
43191
  "application/json": components["schemas"]["Error"];
43199
43192
  };
43200
43193
  };
43201
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43202
- 404: {
43203
- headers: {
43204
- [name: string]: unknown;
43205
- };
43206
- content: {
43207
- "application/json": components["schemas"]["Error"];
43208
- };
43209
- };
43210
43194
  /** @description Daily execution limit or rate limit exceeded */
43211
43195
  429: {
43212
43196
  headers: {
@@ -43365,15 +43349,6 @@ interface paths {
43365
43349
  "application/json": components["schemas"]["Error"];
43366
43350
  };
43367
43351
  };
43368
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43369
- 404: {
43370
- headers: {
43371
- [name: string]: unknown;
43372
- };
43373
- content: {
43374
- "application/json": components["schemas"]["Error"];
43375
- };
43376
- };
43377
43352
  /** @description Daily execution limit or rate limit exceeded */
43378
43353
  429: {
43379
43354
  headers: {
@@ -43512,15 +43487,6 @@ interface paths {
43512
43487
  "application/json": components["schemas"]["Error"];
43513
43488
  };
43514
43489
  };
43515
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43516
- 404: {
43517
- headers: {
43518
- [name: string]: unknown;
43519
- };
43520
- content: {
43521
- "application/json": components["schemas"]["Error"];
43522
- };
43523
- };
43524
43490
  /** @description Daily execution limit or rate limit exceeded */
43525
43491
  429: {
43526
43492
  headers: {
@@ -43661,15 +43627,6 @@ interface paths {
43661
43627
  "application/json": components["schemas"]["Error"];
43662
43628
  };
43663
43629
  };
43664
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43665
- 404: {
43666
- headers: {
43667
- [name: string]: unknown;
43668
- };
43669
- content: {
43670
- "application/json": components["schemas"]["Error"];
43671
- };
43672
- };
43673
43630
  /** @description Daily execution limit or rate limit exceeded */
43674
43631
  429: {
43675
43632
  headers: {
@@ -43819,15 +43776,6 @@ interface paths {
43819
43776
  "application/json": components["schemas"]["Error"];
43820
43777
  };
43821
43778
  };
43822
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43823
- 404: {
43824
- headers: {
43825
- [name: string]: unknown;
43826
- };
43827
- content: {
43828
- "application/json": components["schemas"]["Error"];
43829
- };
43830
- };
43831
43779
  /** @description Daily execution limit or rate limit exceeded */
43832
43780
  429: {
43833
43781
  headers: {
@@ -51881,6 +51829,10 @@ interface components {
51881
51829
  };
51882
51830
  DispatchAgentJsonResponse: {
51883
51831
  agentExecutionId?: string;
51832
+ /** @description The published agent version the run executed. Absent when no stored version ran. */
51833
+ agentVersionId?: string;
51834
+ /** @description The release alias (for example `live`) the version was resolved through, when one was. */
51835
+ alias?: string;
51884
51836
  blockReason?: string;
51885
51837
  claudeManagedAgentId?: string;
51886
51838
  code?: string;
@@ -53886,6 +53838,19 @@ interface components {
53886
53838
  error: string;
53887
53839
  message?: string;
53888
53840
  };
53841
+ RuntimeExportedSkill: {
53842
+ approvalDelta: string[];
53843
+ body: string;
53844
+ description: string;
53845
+ resolvedTools: {
53846
+ [key: string]: unknown;
53847
+ }[];
53848
+ skillId?: string;
53849
+ /** @description The skill version this snapshot was resolved from. */
53850
+ skillVersionId?: string;
53851
+ /** @description Skill slug; the agent loads it as `skill:<slug>`. */
53852
+ slug: string;
53853
+ };
53889
53854
  RuntimeHostDependency: {
53890
53855
  interface: string;
53891
53856
  /** @enum {string} */
@@ -65117,6 +65082,14 @@ export interface AgentRunInsightsResponse {
65117
65082
  /**
65118
65083
  * Agents endpoint handlers
65119
65084
  */
65085
+ /** A `format=bundle` agent runtime export: the zip bytes plus the identity headers the API sends with it. */
65086
+ export interface AgentRuntimeBundle {
65087
+ bytes: Uint8Array;
65088
+ fileName: string;
65089
+ contentHash: string | null;
65090
+ runtimeVersion: string | null;
65091
+ runtimeCommit: string | null;
65092
+ }
65120
65093
  export declare class AgentsEndpoint {
65121
65094
  private client;
65122
65095
  private static readonly AUTO_COMPACT_SUMMARY_PREFIX;
@@ -65148,9 +65121,22 @@ export declare class AgentsEndpoint {
65148
65121
  */
65149
65122
  delete(id: string): Promise<void>;
65150
65123
  /**
65151
- * Export an agent as a self-contained runtime definition for @runtypelabs/runtime
65124
+ * Export an agent as a self-contained runtime definition for @runtypelabs/runtime.
65125
+ * Pass `versionId` or `alias` (at most one) to export a published version or the
65126
+ * version a release alias points at; the result's `release` records which one.
65152
65127
  */
65153
- exportRuntime(id: string): Promise<any>;
65128
+ exportRuntime(id: string, selector?: {
65129
+ versionId?: string;
65130
+ alias?: string;
65131
+ }): Promise<any>;
65132
+ /**
65133
+ * Export an agent as a vendorable zip: `agent.json`, the prebuilt `runtime/` package, `manifest.json`,
65134
+ * and `LICENSE`. Two exports of the same version are byte-identical; `contentHash` pins them.
65135
+ */
65136
+ exportRuntimeBundle(id: string, selector?: {
65137
+ versionId?: string;
65138
+ alias?: string;
65139
+ }): Promise<AgentRuntimeBundle>;
65154
65140
  /**
65155
65141
  * Roll up the agent's most recent runs: per-version and per-tool counts,
65156
65142
  * average tokens and cost, and which attached tools were never called.
package/dist/index.mjs CHANGED
@@ -5742,9 +5742,6 @@ function buildAgentAdmissionHeaders(options) {
5742
5742
  if (options.idempotencyKey) headers["idempotency-key"] = options.idempotencyKey;
5743
5743
  return headers;
5744
5744
  }
5745
- /**
5746
- * Agents endpoint handlers
5747
- */
5748
5745
  var AgentsEndpoint = class AgentsEndpoint {
5749
5746
  constructor(client) {
5750
5747
  this.client = client;
@@ -5783,10 +5780,30 @@ var AgentsEndpoint = class AgentsEndpoint {
5783
5780
  return this.client.delete(`/agents/${id}`);
5784
5781
  }
5785
5782
  /**
5786
- * Export an agent as a self-contained runtime definition for @runtypelabs/runtime
5783
+ * Export an agent as a self-contained runtime definition for @runtypelabs/runtime.
5784
+ * Pass `versionId` or `alias` (at most one) to export a published version or the
5785
+ * version a release alias points at; the result's `release` records which one.
5787
5786
  */
5788
- async exportRuntime(id) {
5789
- return this.client.get(`/agents/${id}/export-runtime`);
5787
+ async exportRuntime(id, selector) {
5788
+ return this.client.get(`/agents/${id}/export-runtime`, selector);
5789
+ }
5790
+ /**
5791
+ * Export an agent as a vendorable zip: `agent.json`, the prebuilt `runtime/` package, `manifest.json`,
5792
+ * and `LICENSE`. Two exports of the same version are byte-identical; `contentHash` pins them.
5793
+ */
5794
+ async exportRuntimeBundle(id, selector) {
5795
+ const query = new URLSearchParams({ format: "bundle" });
5796
+ if (selector?.versionId !== void 0) query.set("versionId", selector.versionId);
5797
+ if (selector?.alias !== void 0) query.set("alias", selector.alias);
5798
+ const response = await this.client.requestStream(`/agents/${id}/export-runtime?${query}`, { method: "GET" });
5799
+ const disposition = response.headers.get("Content-Disposition") ?? "";
5800
+ return {
5801
+ bytes: new Uint8Array(await response.arrayBuffer()),
5802
+ fileName: /filename="([^"]+)"/.exec(disposition)?.[1] ?? `${id}-runtime-bundle.zip`,
5803
+ contentHash: response.headers.get("X-Runtype-Bundle-Content-Hash"),
5804
+ runtimeVersion: response.headers.get("X-Runtype-Runtime-Version"),
5805
+ runtimeCommit: response.headers.get("X-Runtype-Runtime-Commit")
5806
+ };
5790
5807
  }
5791
5808
  /**
5792
5809
  * Roll up the agent's most recent runs: per-version and per-tool counts,
@@ -13480,7 +13497,7 @@ function transformQueryParams(params) {
13480
13497
  }
13481
13498
  //#endregion
13482
13499
  //#region src/version.ts
13483
- const SDK_VERSION = "10.6.0";
13500
+ const SDK_VERSION = "10.8.0";
13484
13501
  /**
13485
13502
  * Canonical client identity the API uses for attribution
13486
13503
  * (`detectActorSource` in apps/api/src/lib/audit-log.ts keys `'sdk'` off the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/sdk",
3
- "version": "10.6.0",
3
+ "version": "10.8.0",
4
4
  "type": "module",
5
5
  "description": "TypeScript SDK for the Runtype API with fluent methods. Use it to quickly realize AI products, agents, and workflows.",
6
6
  "main": "dist/index.cjs",
@@ -24,7 +24,7 @@
24
24
  ],
25
25
  "dependencies": {},
26
26
  "devDependencies": {
27
- "@runtypelabs/shared": "3.67.0",
27
+ "@runtypelabs/shared": "3.68.1",
28
28
  "openapi-typescript": "^7.13.0",
29
29
  "tsdown": "^0.23.0",
30
30
  "typescript": "^6.0.3",