@runtypelabs/sdk 10.7.0 → 10.8.1

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;
@@ -5792,6 +5789,24 @@ var AgentsEndpoint = class AgentsEndpoint {
5792
5789
  return this.client.get(`/agents/${id}/export-runtime`, selector);
5793
5790
  }
5794
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
+ };
5808
+ }
5809
+ /**
5795
5810
  * Roll up the agent's most recent runs: per-version and per-tool counts,
5796
5811
  * average tokens and cost, and which attached tools were never called.
5797
5812
  */
@@ -8545,6 +8560,17 @@ var ToolApprovalGrantsEndpoint = class {
8545
8560
  };
8546
8561
  //#endregion
8547
8562
  //#region src/detached-buffered-follow.ts
8563
+ /** The release fields a response body carries, dropping any it does not name. */
8564
+ function releaseFieldsOf(data) {
8565
+ if (typeof data !== "object" || data === null) return {};
8566
+ const record = data;
8567
+ const resolution = record.agentTargetResolution;
8568
+ return {
8569
+ ...typeof record.agentVersionId === "string" ? { agentVersionId: record.agentVersionId } : {},
8570
+ ...typeof record.alias === "string" ? { alias: record.alias } : {},
8571
+ ...resolution === "alias" || resolution === "version" || resolution === "legacy-live-row" ? { agentTargetResolution: resolution } : {}
8572
+ };
8573
+ }
8548
8574
  function isDetachedToolOutputAck(data) {
8549
8575
  if (typeof data !== "object" || data === null) return false;
8550
8576
  const record = data;
@@ -8572,9 +8598,12 @@ function isLocalToolAwait(event) {
8572
8598
  * buffered continuation envelope a non-streaming local-tool loop expects.
8573
8599
  *
8574
8600
  * `after` is the last `seq` the loop had already consumed, so the replay
8575
- * never re-delivers the await the outputs just answered.
8601
+ * never re-delivers the await the outputs just answered. Version fields from
8602
+ * earlier responses (`carried`) and the ack land on the envelope, since the
8603
+ * events stream never repeats them.
8576
8604
  */
8577
- async function followDetachedResume(client, executionId, after) {
8605
+ async function followDetachedResume(client, ack, after, carried = {}) {
8606
+ const { executionId } = ack;
8578
8607
  const open = (cursor, signal) => client.requestStream(buildExecutionEventsPath(executionId, cursor ? { after: cursor } : {}), {
8579
8608
  method: "GET",
8580
8609
  ...signal ? { signal } : {}
@@ -8632,7 +8661,9 @@ async function followDetachedResume(client, executionId, after) {
8632
8661
  executionId,
8633
8662
  events,
8634
8663
  status,
8635
- ...error ? { error } : {}
8664
+ ...error ? { error } : {},
8665
+ ...carried,
8666
+ ...releaseFieldsOf(ack)
8636
8667
  };
8637
8668
  }
8638
8669
  //#endregion
@@ -10205,9 +10236,11 @@ var RuntypeFlowBuilder = class {
10205
10236
  }
10206
10237
  };
10207
10238
  let currentResponse;
10239
+ let carriedRelease = {};
10208
10240
  if (isStreaming) currentResponse = await client.dispatch(config);
10209
10241
  else {
10210
10242
  const data = await client.dispatchJson(config);
10243
+ carriedRelease = releaseFieldsOf(data);
10211
10244
  currentResponse = new Response(JSON.stringify(data), { headers: { "content-type": "application/json" } });
10212
10245
  }
10213
10246
  while (true) {
@@ -10242,7 +10275,11 @@ var RuntypeFlowBuilder = class {
10242
10275
  }).catch(() => null));
10243
10276
  else {
10244
10277
  const data = await client.post("/dispatch/resume", resumeData);
10245
- const envelope = isDetachedToolOutputAck(data) ? await followDetachedResume(client, data.executionId, pausedResult.resumeCursor) : data;
10278
+ carriedRelease = {
10279
+ ...carriedRelease,
10280
+ ...releaseFieldsOf(data)
10281
+ };
10282
+ const envelope = isDetachedToolOutputAck(data) ? await followDetachedResume(client, data, pausedResult.resumeCursor, carriedRelease) : data;
10246
10283
  currentResponse = new Response(JSON.stringify(envelope), { headers: { "content-type": "application/json" } });
10247
10284
  }
10248
10285
  } catch (error) {
@@ -11418,6 +11455,8 @@ const DEFINE_TOP_LEVEL_KEYS = /* @__PURE__ */ new Set([
11418
11455
  "icon",
11419
11456
  ...AGENT_CONFIG_KEYS
11420
11457
  ]);
11458
+ /** A minted tool typeid; `alwaysLoaded` also holds tool names, which may begin with `tool_`. */
11459
+ const TOOL_TYPEID_PATTERN = /^tool_[0-7][0-9a-hjkmnp-tv-z]{25}$/;
11421
11460
  /**
11422
11461
  * Collect account-scoped `tool_…` references (inlined copy of
11423
11462
  * `collectNonPortableAgentToolRefs` in @runtypelabs/shared). The v1 ensure
@@ -11444,6 +11483,9 @@ function collectNonPortableToolRefs(config) {
11444
11483
  if (isPlainObject(tools.approval)) scanArray(tools.approval.require, "tools.approval.require");
11445
11484
  if (isPlainObject(tools.subagentConfig)) scanArray(tools.subagentConfig.toolPool, "tools.subagentConfig.toolPool");
11446
11485
  if (isPlainObject(tools.codeModeConfig)) scanArray(tools.codeModeConfig.toolPool, "tools.codeModeConfig.toolPool");
11486
+ if (isPlainObject(tools.toolSearch) && Array.isArray(tools.toolSearch.alwaysLoaded)) tools.toolSearch.alwaysLoaded.forEach((ref, i) => {
11487
+ if (typeof ref === "string" && TOOL_TYPEID_PATTERN.test(ref)) found.push(`tools.toolSearch.alwaysLoaded[${i}]`);
11488
+ });
11447
11489
  if (Array.isArray(tools.runtimeTools)) tools.runtimeTools.forEach((runtimeTool, i) => {
11448
11490
  if (!isPlainObject(runtimeTool) || !isPlainObject(runtimeTool.config)) return;
11449
11491
  const base = `tools.runtimeTools[${i}].config`;
@@ -13483,7 +13525,7 @@ function transformQueryParams(params) {
13483
13525
  }
13484
13526
  //#endregion
13485
13527
  //#region src/version.ts
13486
- const SDK_VERSION = "10.7.0";
13528
+ const SDK_VERSION = "10.8.1";
13487
13529
  /**
13488
13530
  * Canonical client identity the API uses for attribution
13489
13531
  * (`detectActorSource` in apps/api/src/lib/audit-log.ts keys `'sdk'` off the
@@ -13694,9 +13736,11 @@ var RuntypeClient = class {
13694
13736
  }
13695
13737
  };
13696
13738
  let currentResponse;
13739
+ let carriedRelease = {};
13697
13740
  if (isStreaming) currentResponse = await this.dispatch.executeStream(modifiedRequest);
13698
13741
  else {
13699
13742
  const data = await this.dispatch.execute(modifiedRequest);
13743
+ carriedRelease = releaseFieldsOf(data);
13700
13744
  currentResponse = new Response(JSON.stringify(data), { headers: { "content-type": "application/json" } });
13701
13745
  }
13702
13746
  while (true) {
@@ -13730,7 +13774,11 @@ var RuntypeClient = class {
13730
13774
  if (isStreaming) currentResponse = await this.dispatch.resume(resumeData);
13731
13775
  else {
13732
13776
  const data = await this.dispatch.resume(resumeData);
13733
- const envelope = isDetachedToolOutputAck(data) ? await followDetachedResume(this, data.executionId, result.resumeCursor) : data;
13777
+ carriedRelease = {
13778
+ ...carriedRelease,
13779
+ ...releaseFieldsOf(data)
13780
+ };
13781
+ const envelope = isDetachedToolOutputAck(data) ? await followDetachedResume(this, data, result.resumeCursor, carriedRelease) : data;
13734
13782
  currentResponse = new Response(JSON.stringify(envelope), { headers: { "content-type": "application/json" } });
13735
13783
  }
13736
13784
  } catch (error) {
package/dist/index.d.cts CHANGED
@@ -1204,6 +1204,11 @@ interface paths {
1204
1204
  };
1205
1205
  };
1206
1206
  toolIds?: string[];
1207
+ toolSearch?: {
1208
+ alwaysLoaded?: string[];
1209
+ enabled?: boolean;
1210
+ threshold?: number;
1211
+ };
1207
1212
  };
1208
1213
  topK?: number;
1209
1214
  topP?: number;
@@ -1725,6 +1730,11 @@ interface paths {
1725
1730
  };
1726
1731
  };
1727
1732
  toolIds?: string[];
1733
+ toolSearch?: {
1734
+ alwaysLoaded?: string[];
1735
+ enabled?: boolean;
1736
+ threshold?: number;
1737
+ };
1728
1738
  };
1729
1739
  topK?: number;
1730
1740
  topP?: number;
@@ -2522,6 +2532,11 @@ interface paths {
2522
2532
  };
2523
2533
  };
2524
2534
  toolIds?: string[];
2535
+ toolSearch?: {
2536
+ alwaysLoaded?: string[];
2537
+ enabled?: boolean;
2538
+ threshold?: number;
2539
+ } | null;
2525
2540
  };
2526
2541
  topK?: number;
2527
2542
  topP?: number;
@@ -5270,6 +5285,8 @@ interface paths {
5270
5285
  versionId?: string;
5271
5286
  /** @description Export the version this release alias currently points at. Mutually exclusive with `versionId`. */
5272
5287
  alias?: string;
5288
+ /** @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). */
5289
+ format?: "json" | "bundle";
5273
5290
  };
5274
5291
  header?: never;
5275
5292
  path: {
@@ -5279,7 +5296,7 @@ interface paths {
5279
5296
  };
5280
5297
  requestBody?: never;
5281
5298
  responses: {
5282
- /** @description Exported agent definition */
5299
+ /** @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. */
5283
5300
  200: {
5284
5301
  headers: {
5285
5302
  [name: string]: unknown;
@@ -5310,6 +5327,7 @@ interface paths {
5310
5327
  /** @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. */
5311
5328
  skills?: components["schemas"]["RuntimeExportedSkill"][];
5312
5329
  };
5330
+ "application/zip": string;
5313
5331
  };
5314
5332
  };
5315
5333
  /** @description Invalid agent ID, or both `versionId` and `alias` were supplied */
@@ -5366,6 +5384,15 @@ interface paths {
5366
5384
  "application/json": components["schemas"]["Error"];
5367
5385
  };
5368
5386
  };
5387
+ /** @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`) */
5388
+ 503: {
5389
+ headers: {
5390
+ [name: string]: unknown;
5391
+ };
5392
+ content: {
5393
+ "application/json": components["schemas"]["Error"];
5394
+ };
5395
+ };
5369
5396
  };
5370
5397
  };
5371
5398
  put?: never;
@@ -28724,7 +28751,7 @@ interface paths {
28724
28751
  /** @enum {string} */
28725
28752
  executorProvider?: "openai" | "anthropic" | "google" | "xai" | "vertex" | "vertex-anthropic" | "bedrock" | "tinfoil" | "vercel" | "generic-openai";
28726
28753
  inputCostPer1kTokens: number;
28727
- /** @default 4096 */
28754
+ /** @default 32768 */
28728
28755
  maxOutputTokens?: number;
28729
28756
  /**
28730
28757
  * @description Where a system message that follows a conversation turn lands on this endpoint. Omitted keeps it at its position (Mistral- and Gemma-family ids fold it into the leading prompt); "hoist" folds it for any endpoint whose chat template rejects a non-leading system role.
@@ -29395,7 +29422,7 @@ interface paths {
29395
29422
  /** @enum {string} */
29396
29423
  executorProvider?: "openai" | "anthropic" | "google" | "xai" | "vertex" | "vertex-anthropic" | "bedrock" | "tinfoil" | "vercel" | "generic-openai";
29397
29424
  inputCostPer1kTokens: number;
29398
- /** @default 4096 */
29425
+ /** @default 32768 */
29399
29426
  maxOutputTokens?: number;
29400
29427
  /**
29401
29428
  * @description Where a system message that follows a conversation turn lands on this endpoint. Omitted keeps it at its position (Mistral- and Gemma-family ids fold it into the leading prompt); "hoist" folds it for any endpoint whose chat template rejects a non-leading system role.
@@ -42445,15 +42472,6 @@ interface paths {
42445
42472
  "application/json": components["schemas"]["Error"];
42446
42473
  };
42447
42474
  };
42448
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42449
- 404: {
42450
- headers: {
42451
- [name: string]: unknown;
42452
- };
42453
- content: {
42454
- "application/json": components["schemas"]["Error"];
42455
- };
42456
- };
42457
42475
  /** @description Daily execution limit or rate limit exceeded */
42458
42476
  429: {
42459
42477
  headers: {
@@ -42631,15 +42649,6 @@ interface paths {
42631
42649
  "application/json": components["schemas"]["RuntimeEmailAdmissionError"];
42632
42650
  };
42633
42651
  };
42634
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42635
- 404: {
42636
- headers: {
42637
- [name: string]: unknown;
42638
- };
42639
- content: {
42640
- "application/json": components["schemas"]["Error"];
42641
- };
42642
- };
42643
42652
  /** @description Daily execution limit or rate limit exceeded */
42644
42653
  429: {
42645
42654
  headers: {
@@ -42790,15 +42799,6 @@ interface paths {
42790
42799
  "application/json": components["schemas"]["Error"];
42791
42800
  };
42792
42801
  };
42793
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42794
- 404: {
42795
- headers: {
42796
- [name: string]: unknown;
42797
- };
42798
- content: {
42799
- "application/json": components["schemas"]["Error"];
42800
- };
42801
- };
42802
42802
  /** @description Daily execution limit or rate limit exceeded */
42803
42803
  429: {
42804
42804
  headers: {
@@ -42932,15 +42932,6 @@ interface paths {
42932
42932
  "application/json": components["schemas"]["Error"];
42933
42933
  };
42934
42934
  };
42935
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42936
- 404: {
42937
- headers: {
42938
- [name: string]: unknown;
42939
- };
42940
- content: {
42941
- "application/json": components["schemas"]["Error"];
42942
- };
42943
- };
42944
42935
  /** @description Daily execution limit or rate limit exceeded */
42945
42936
  429: {
42946
42937
  headers: {
@@ -43066,15 +43057,6 @@ interface paths {
43066
43057
  "application/json": components["schemas"]["Error"];
43067
43058
  };
43068
43059
  };
43069
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43070
- 404: {
43071
- headers: {
43072
- [name: string]: unknown;
43073
- };
43074
- content: {
43075
- "application/json": components["schemas"]["Error"];
43076
- };
43077
- };
43078
43060
  /** @description Daily execution limit or rate limit exceeded */
43079
43061
  429: {
43080
43062
  headers: {
@@ -43224,15 +43206,6 @@ interface paths {
43224
43206
  "application/json": components["schemas"]["Error"];
43225
43207
  };
43226
43208
  };
43227
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43228
- 404: {
43229
- headers: {
43230
- [name: string]: unknown;
43231
- };
43232
- content: {
43233
- "application/json": components["schemas"]["Error"];
43234
- };
43235
- };
43236
43209
  /** @description Daily execution limit or rate limit exceeded */
43237
43210
  429: {
43238
43211
  headers: {
@@ -43391,15 +43364,6 @@ interface paths {
43391
43364
  "application/json": components["schemas"]["Error"];
43392
43365
  };
43393
43366
  };
43394
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43395
- 404: {
43396
- headers: {
43397
- [name: string]: unknown;
43398
- };
43399
- content: {
43400
- "application/json": components["schemas"]["Error"];
43401
- };
43402
- };
43403
43367
  /** @description Daily execution limit or rate limit exceeded */
43404
43368
  429: {
43405
43369
  headers: {
@@ -43538,15 +43502,6 @@ interface paths {
43538
43502
  "application/json": components["schemas"]["Error"];
43539
43503
  };
43540
43504
  };
43541
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43542
- 404: {
43543
- headers: {
43544
- [name: string]: unknown;
43545
- };
43546
- content: {
43547
- "application/json": components["schemas"]["Error"];
43548
- };
43549
- };
43550
43505
  /** @description Daily execution limit or rate limit exceeded */
43551
43506
  429: {
43552
43507
  headers: {
@@ -43687,15 +43642,6 @@ interface paths {
43687
43642
  "application/json": components["schemas"]["Error"];
43688
43643
  };
43689
43644
  };
43690
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43691
- 404: {
43692
- headers: {
43693
- [name: string]: unknown;
43694
- };
43695
- content: {
43696
- "application/json": components["schemas"]["Error"];
43697
- };
43698
- };
43699
43645
  /** @description Daily execution limit or rate limit exceeded */
43700
43646
  429: {
43701
43647
  headers: {
@@ -43845,15 +43791,6 @@ interface paths {
43845
43791
  "application/json": components["schemas"]["Error"];
43846
43792
  };
43847
43793
  };
43848
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43849
- 404: {
43850
- headers: {
43851
- [name: string]: unknown;
43852
- };
43853
- content: {
43854
- "application/json": components["schemas"]["Error"];
43855
- };
43856
- };
43857
43794
  /** @description Daily execution limit or rate limit exceeded */
43858
43795
  429: {
43859
43796
  headers: {
@@ -51083,6 +51020,11 @@ interface components {
51083
51020
  };
51084
51021
  };
51085
51022
  toolIds?: string[];
51023
+ toolSearch?: {
51024
+ alwaysLoaded?: string[];
51025
+ enabled?: boolean;
51026
+ threshold?: number;
51027
+ };
51086
51028
  };
51087
51029
  topK?: number;
51088
51030
  topP?: number;
@@ -51784,6 +51726,11 @@ interface components {
51784
51726
  };
51785
51727
  };
51786
51728
  toolIds?: string[];
51729
+ toolSearch?: {
51730
+ alwaysLoaded?: string[];
51731
+ enabled?: boolean;
51732
+ threshold?: number;
51733
+ } | null;
51787
51734
  };
51788
51735
  topK?: number;
51789
51736
  topP?: number;
@@ -51907,7 +51854,12 @@ interface components {
51907
51854
  };
51908
51855
  DispatchAgentJsonResponse: {
51909
51856
  agentExecutionId?: string;
51910
- /** @description The published agent version the run executed. Absent when no stored version ran. */
51857
+ /**
51858
+ * @description How the run selected its definition: `alias` or `version` for a request that named a selector, `legacy-live-row` for a run that read the mutable agent row. Matches `GET /v1/executions/{executionId}/status`.
51859
+ * @enum {string}
51860
+ */
51861
+ agentTargetResolution?: "alias" | "version" | "legacy-live-row";
51862
+ /** @description The agent version recorded for the run. When `agentTargetResolution` is `legacy-live-row`, this is the version the agent row pointed at, and the run read the mutable row rather than that version. Absent when neither exists. */
51911
51863
  agentVersionId?: string;
51912
51864
  /** @description The release alias (for example `live`) the version was resolved through, when one was. */
51913
51865
  alias?: string;
@@ -51967,6 +51919,15 @@ interface components {
51967
51919
  status: "running";
51968
51920
  };
51969
51921
  DispatchDetachedToolOutputJsonResponse: {
51922
+ /**
51923
+ * @description How the run selected its definition: `alias` or `version` for a request that named a selector, `legacy-live-row` for a run that read the mutable agent row. Matches `GET /v1/executions/{executionId}/status`.
51924
+ * @enum {string}
51925
+ */
51926
+ agentTargetResolution?: "alias" | "version" | "legacy-live-row";
51927
+ /** @description The agent version recorded for the run. When `agentTargetResolution` is `legacy-live-row`, this is the version the agent row pointed at, and the run read the mutable row rather than that version. Absent when neither exists. */
51928
+ agentVersionId?: string;
51929
+ /** @description The release alias (for example `live`) the version was resolved through, when one was. */
51930
+ alias?: string;
51970
51931
  executionId: string;
51971
51932
  /** @enum {string} */
51972
51933
  pauseKind: "client_tool" | "elicitation";
@@ -52017,6 +51978,15 @@ interface components {
52017
51978
  };
52018
51979
  DispatchResumeJsonResponse: components["schemas"]["DispatchToolOutputContinuationJsonResponse"] | components["schemas"]["DispatchDetachedToolOutputJsonResponse"];
52019
51980
  DispatchToolOutputContinuationJsonResponse: {
51981
+ /**
51982
+ * @description How the run selected its definition: `alias` or `version` for a request that named a selector, `legacy-live-row` for a run that read the mutable agent row. Matches `GET /v1/executions/{executionId}/status`.
51983
+ * @enum {string}
51984
+ */
51985
+ agentTargetResolution?: "alias" | "version" | "legacy-live-row";
51986
+ /** @description The agent version recorded for the run. When `agentTargetResolution` is `legacy-live-row`, this is the version the agent row pointed at, and the run read the mutable row rather than that version. Absent when neither exists. */
51987
+ agentVersionId?: string;
51988
+ /** @description The release alias (for example `live`) the version was resolved through, when one was. */
51989
+ alias?: string;
52020
51990
  blockReason?: string;
52021
51991
  code?: string;
52022
51992
  error?: string;
@@ -60610,6 +60580,11 @@ interface AgentDefinitionConfig {
60610
60580
  }>;
60611
60581
  subagentConfig?: Record<string, unknown>;
60612
60582
  codeModeConfig?: Record<string, unknown>;
60583
+ toolSearch?: {
60584
+ enabled?: boolean;
60585
+ threshold?: number;
60586
+ alwaysLoaded?: string[];
60587
+ };
60613
60588
  };
60614
60589
  artifacts?: {
60615
60590
  enabled: true;
@@ -65160,6 +65135,14 @@ export interface AgentRunInsightsResponse {
65160
65135
  /**
65161
65136
  * Agents endpoint handlers
65162
65137
  */
65138
+ /** A `format=bundle` agent runtime export: the zip bytes plus the identity headers the API sends with it. */
65139
+ export interface AgentRuntimeBundle {
65140
+ bytes: Uint8Array;
65141
+ fileName: string;
65142
+ contentHash: string | null;
65143
+ runtimeVersion: string | null;
65144
+ runtimeCommit: string | null;
65145
+ }
65163
65146
  export declare class AgentsEndpoint {
65164
65147
  private client;
65165
65148
  private static readonly AUTO_COMPACT_SUMMARY_PREFIX;
@@ -65199,6 +65182,14 @@ export declare class AgentsEndpoint {
65199
65182
  versionId?: string;
65200
65183
  alias?: string;
65201
65184
  }): Promise<any>;
65185
+ /**
65186
+ * Export an agent as a vendorable zip: `agent.json`, the prebuilt `runtime/` package, `manifest.json`,
65187
+ * and `LICENSE`. Two exports of the same version are byte-identical; `contentHash` pins them.
65188
+ */
65189
+ exportRuntimeBundle(id: string, selector?: {
65190
+ versionId?: string;
65191
+ alias?: string;
65192
+ }): Promise<AgentRuntimeBundle>;
65202
65193
  /**
65203
65194
  * Roll up the agent's most recent runs: per-version and per-tool counts,
65204
65195
  * average tokens and cost, and which attached tools were never called.
package/dist/index.d.ts CHANGED
@@ -1204,6 +1204,11 @@ interface paths {
1204
1204
  };
1205
1205
  };
1206
1206
  toolIds?: string[];
1207
+ toolSearch?: {
1208
+ alwaysLoaded?: string[];
1209
+ enabled?: boolean;
1210
+ threshold?: number;
1211
+ };
1207
1212
  };
1208
1213
  topK?: number;
1209
1214
  topP?: number;
@@ -1725,6 +1730,11 @@ interface paths {
1725
1730
  };
1726
1731
  };
1727
1732
  toolIds?: string[];
1733
+ toolSearch?: {
1734
+ alwaysLoaded?: string[];
1735
+ enabled?: boolean;
1736
+ threshold?: number;
1737
+ };
1728
1738
  };
1729
1739
  topK?: number;
1730
1740
  topP?: number;
@@ -2522,6 +2532,11 @@ interface paths {
2522
2532
  };
2523
2533
  };
2524
2534
  toolIds?: string[];
2535
+ toolSearch?: {
2536
+ alwaysLoaded?: string[];
2537
+ enabled?: boolean;
2538
+ threshold?: number;
2539
+ } | null;
2525
2540
  };
2526
2541
  topK?: number;
2527
2542
  topP?: number;
@@ -5270,6 +5285,8 @@ interface paths {
5270
5285
  versionId?: string;
5271
5286
  /** @description Export the version this release alias currently points at. Mutually exclusive with `versionId`. */
5272
5287
  alias?: string;
5288
+ /** @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). */
5289
+ format?: "json" | "bundle";
5273
5290
  };
5274
5291
  header?: never;
5275
5292
  path: {
@@ -5279,7 +5296,7 @@ interface paths {
5279
5296
  };
5280
5297
  requestBody?: never;
5281
5298
  responses: {
5282
- /** @description Exported agent definition */
5299
+ /** @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. */
5283
5300
  200: {
5284
5301
  headers: {
5285
5302
  [name: string]: unknown;
@@ -5310,6 +5327,7 @@ interface paths {
5310
5327
  /** @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. */
5311
5328
  skills?: components["schemas"]["RuntimeExportedSkill"][];
5312
5329
  };
5330
+ "application/zip": string;
5313
5331
  };
5314
5332
  };
5315
5333
  /** @description Invalid agent ID, or both `versionId` and `alias` were supplied */
@@ -5366,6 +5384,15 @@ interface paths {
5366
5384
  "application/json": components["schemas"]["Error"];
5367
5385
  };
5368
5386
  };
5387
+ /** @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`) */
5388
+ 503: {
5389
+ headers: {
5390
+ [name: string]: unknown;
5391
+ };
5392
+ content: {
5393
+ "application/json": components["schemas"]["Error"];
5394
+ };
5395
+ };
5369
5396
  };
5370
5397
  };
5371
5398
  put?: never;
@@ -28724,7 +28751,7 @@ interface paths {
28724
28751
  /** @enum {string} */
28725
28752
  executorProvider?: "openai" | "anthropic" | "google" | "xai" | "vertex" | "vertex-anthropic" | "bedrock" | "tinfoil" | "vercel" | "generic-openai";
28726
28753
  inputCostPer1kTokens: number;
28727
- /** @default 4096 */
28754
+ /** @default 32768 */
28728
28755
  maxOutputTokens?: number;
28729
28756
  /**
28730
28757
  * @description Where a system message that follows a conversation turn lands on this endpoint. Omitted keeps it at its position (Mistral- and Gemma-family ids fold it into the leading prompt); "hoist" folds it for any endpoint whose chat template rejects a non-leading system role.
@@ -29395,7 +29422,7 @@ interface paths {
29395
29422
  /** @enum {string} */
29396
29423
  executorProvider?: "openai" | "anthropic" | "google" | "xai" | "vertex" | "vertex-anthropic" | "bedrock" | "tinfoil" | "vercel" | "generic-openai";
29397
29424
  inputCostPer1kTokens: number;
29398
- /** @default 4096 */
29425
+ /** @default 32768 */
29399
29426
  maxOutputTokens?: number;
29400
29427
  /**
29401
29428
  * @description Where a system message that follows a conversation turn lands on this endpoint. Omitted keeps it at its position (Mistral- and Gemma-family ids fold it into the leading prompt); "hoist" folds it for any endpoint whose chat template rejects a non-leading system role.
@@ -42445,15 +42472,6 @@ interface paths {
42445
42472
  "application/json": components["schemas"]["Error"];
42446
42473
  };
42447
42474
  };
42448
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42449
- 404: {
42450
- headers: {
42451
- [name: string]: unknown;
42452
- };
42453
- content: {
42454
- "application/json": components["schemas"]["Error"];
42455
- };
42456
- };
42457
42475
  /** @description Daily execution limit or rate limit exceeded */
42458
42476
  429: {
42459
42477
  headers: {
@@ -42631,15 +42649,6 @@ interface paths {
42631
42649
  "application/json": components["schemas"]["RuntimeEmailAdmissionError"];
42632
42650
  };
42633
42651
  };
42634
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42635
- 404: {
42636
- headers: {
42637
- [name: string]: unknown;
42638
- };
42639
- content: {
42640
- "application/json": components["schemas"]["Error"];
42641
- };
42642
- };
42643
42652
  /** @description Daily execution limit or rate limit exceeded */
42644
42653
  429: {
42645
42654
  headers: {
@@ -42790,15 +42799,6 @@ interface paths {
42790
42799
  "application/json": components["schemas"]["Error"];
42791
42800
  };
42792
42801
  };
42793
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42794
- 404: {
42795
- headers: {
42796
- [name: string]: unknown;
42797
- };
42798
- content: {
42799
- "application/json": components["schemas"]["Error"];
42800
- };
42801
- };
42802
42802
  /** @description Daily execution limit or rate limit exceeded */
42803
42803
  429: {
42804
42804
  headers: {
@@ -42932,15 +42932,6 @@ interface paths {
42932
42932
  "application/json": components["schemas"]["Error"];
42933
42933
  };
42934
42934
  };
42935
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
42936
- 404: {
42937
- headers: {
42938
- [name: string]: unknown;
42939
- };
42940
- content: {
42941
- "application/json": components["schemas"]["Error"];
42942
- };
42943
- };
42944
42935
  /** @description Daily execution limit or rate limit exceeded */
42945
42936
  429: {
42946
42937
  headers: {
@@ -43066,15 +43057,6 @@ interface paths {
43066
43057
  "application/json": components["schemas"]["Error"];
43067
43058
  };
43068
43059
  };
43069
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43070
- 404: {
43071
- headers: {
43072
- [name: string]: unknown;
43073
- };
43074
- content: {
43075
- "application/json": components["schemas"]["Error"];
43076
- };
43077
- };
43078
43060
  /** @description Daily execution limit or rate limit exceeded */
43079
43061
  429: {
43080
43062
  headers: {
@@ -43224,15 +43206,6 @@ interface paths {
43224
43206
  "application/json": components["schemas"]["Error"];
43225
43207
  };
43226
43208
  };
43227
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43228
- 404: {
43229
- headers: {
43230
- [name: string]: unknown;
43231
- };
43232
- content: {
43233
- "application/json": components["schemas"]["Error"];
43234
- };
43235
- };
43236
43209
  /** @description Daily execution limit or rate limit exceeded */
43237
43210
  429: {
43238
43211
  headers: {
@@ -43391,15 +43364,6 @@ interface paths {
43391
43364
  "application/json": components["schemas"]["Error"];
43392
43365
  };
43393
43366
  };
43394
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43395
- 404: {
43396
- headers: {
43397
- [name: string]: unknown;
43398
- };
43399
- content: {
43400
- "application/json": components["schemas"]["Error"];
43401
- };
43402
- };
43403
43367
  /** @description Daily execution limit or rate limit exceeded */
43404
43368
  429: {
43405
43369
  headers: {
@@ -43538,15 +43502,6 @@ interface paths {
43538
43502
  "application/json": components["schemas"]["Error"];
43539
43503
  };
43540
43504
  };
43541
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43542
- 404: {
43543
- headers: {
43544
- [name: string]: unknown;
43545
- };
43546
- content: {
43547
- "application/json": components["schemas"]["Error"];
43548
- };
43549
- };
43550
43505
  /** @description Daily execution limit or rate limit exceeded */
43551
43506
  429: {
43552
43507
  headers: {
@@ -43687,15 +43642,6 @@ interface paths {
43687
43642
  "application/json": components["schemas"]["Error"];
43688
43643
  };
43689
43644
  };
43690
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43691
- 404: {
43692
- headers: {
43693
- [name: string]: unknown;
43694
- };
43695
- content: {
43696
- "application/json": components["schemas"]["Error"];
43697
- };
43698
- };
43699
43645
  /** @description Daily execution limit or rate limit exceeded */
43700
43646
  429: {
43701
43647
  headers: {
@@ -43845,15 +43791,6 @@ interface paths {
43845
43791
  "application/json": components["schemas"]["Error"];
43846
43792
  };
43847
43793
  };
43848
- /** @description Endpoint not yet available in this environment (the hosted runtime endpoint family is dark-launched and returns 404 until general availability) */
43849
- 404: {
43850
- headers: {
43851
- [name: string]: unknown;
43852
- };
43853
- content: {
43854
- "application/json": components["schemas"]["Error"];
43855
- };
43856
- };
43857
43794
  /** @description Daily execution limit or rate limit exceeded */
43858
43795
  429: {
43859
43796
  headers: {
@@ -51083,6 +51020,11 @@ interface components {
51083
51020
  };
51084
51021
  };
51085
51022
  toolIds?: string[];
51023
+ toolSearch?: {
51024
+ alwaysLoaded?: string[];
51025
+ enabled?: boolean;
51026
+ threshold?: number;
51027
+ };
51086
51028
  };
51087
51029
  topK?: number;
51088
51030
  topP?: number;
@@ -51784,6 +51726,11 @@ interface components {
51784
51726
  };
51785
51727
  };
51786
51728
  toolIds?: string[];
51729
+ toolSearch?: {
51730
+ alwaysLoaded?: string[];
51731
+ enabled?: boolean;
51732
+ threshold?: number;
51733
+ } | null;
51787
51734
  };
51788
51735
  topK?: number;
51789
51736
  topP?: number;
@@ -51907,7 +51854,12 @@ interface components {
51907
51854
  };
51908
51855
  DispatchAgentJsonResponse: {
51909
51856
  agentExecutionId?: string;
51910
- /** @description The published agent version the run executed. Absent when no stored version ran. */
51857
+ /**
51858
+ * @description How the run selected its definition: `alias` or `version` for a request that named a selector, `legacy-live-row` for a run that read the mutable agent row. Matches `GET /v1/executions/{executionId}/status`.
51859
+ * @enum {string}
51860
+ */
51861
+ agentTargetResolution?: "alias" | "version" | "legacy-live-row";
51862
+ /** @description The agent version recorded for the run. When `agentTargetResolution` is `legacy-live-row`, this is the version the agent row pointed at, and the run read the mutable row rather than that version. Absent when neither exists. */
51911
51863
  agentVersionId?: string;
51912
51864
  /** @description The release alias (for example `live`) the version was resolved through, when one was. */
51913
51865
  alias?: string;
@@ -51967,6 +51919,15 @@ interface components {
51967
51919
  status: "running";
51968
51920
  };
51969
51921
  DispatchDetachedToolOutputJsonResponse: {
51922
+ /**
51923
+ * @description How the run selected its definition: `alias` or `version` for a request that named a selector, `legacy-live-row` for a run that read the mutable agent row. Matches `GET /v1/executions/{executionId}/status`.
51924
+ * @enum {string}
51925
+ */
51926
+ agentTargetResolution?: "alias" | "version" | "legacy-live-row";
51927
+ /** @description The agent version recorded for the run. When `agentTargetResolution` is `legacy-live-row`, this is the version the agent row pointed at, and the run read the mutable row rather than that version. Absent when neither exists. */
51928
+ agentVersionId?: string;
51929
+ /** @description The release alias (for example `live`) the version was resolved through, when one was. */
51930
+ alias?: string;
51970
51931
  executionId: string;
51971
51932
  /** @enum {string} */
51972
51933
  pauseKind: "client_tool" | "elicitation";
@@ -52017,6 +51978,15 @@ interface components {
52017
51978
  };
52018
51979
  DispatchResumeJsonResponse: components["schemas"]["DispatchToolOutputContinuationJsonResponse"] | components["schemas"]["DispatchDetachedToolOutputJsonResponse"];
52019
51980
  DispatchToolOutputContinuationJsonResponse: {
51981
+ /**
51982
+ * @description How the run selected its definition: `alias` or `version` for a request that named a selector, `legacy-live-row` for a run that read the mutable agent row. Matches `GET /v1/executions/{executionId}/status`.
51983
+ * @enum {string}
51984
+ */
51985
+ agentTargetResolution?: "alias" | "version" | "legacy-live-row";
51986
+ /** @description The agent version recorded for the run. When `agentTargetResolution` is `legacy-live-row`, this is the version the agent row pointed at, and the run read the mutable row rather than that version. Absent when neither exists. */
51987
+ agentVersionId?: string;
51988
+ /** @description The release alias (for example `live`) the version was resolved through, when one was. */
51989
+ alias?: string;
52020
51990
  blockReason?: string;
52021
51991
  code?: string;
52022
51992
  error?: string;
@@ -60610,6 +60580,11 @@ interface AgentDefinitionConfig {
60610
60580
  }>;
60611
60581
  subagentConfig?: Record<string, unknown>;
60612
60582
  codeModeConfig?: Record<string, unknown>;
60583
+ toolSearch?: {
60584
+ enabled?: boolean;
60585
+ threshold?: number;
60586
+ alwaysLoaded?: string[];
60587
+ };
60613
60588
  };
60614
60589
  artifacts?: {
60615
60590
  enabled: true;
@@ -65160,6 +65135,14 @@ export interface AgentRunInsightsResponse {
65160
65135
  /**
65161
65136
  * Agents endpoint handlers
65162
65137
  */
65138
+ /** A `format=bundle` agent runtime export: the zip bytes plus the identity headers the API sends with it. */
65139
+ export interface AgentRuntimeBundle {
65140
+ bytes: Uint8Array;
65141
+ fileName: string;
65142
+ contentHash: string | null;
65143
+ runtimeVersion: string | null;
65144
+ runtimeCommit: string | null;
65145
+ }
65163
65146
  export declare class AgentsEndpoint {
65164
65147
  private client;
65165
65148
  private static readonly AUTO_COMPACT_SUMMARY_PREFIX;
@@ -65199,6 +65182,14 @@ export declare class AgentsEndpoint {
65199
65182
  versionId?: string;
65200
65183
  alias?: string;
65201
65184
  }): Promise<any>;
65185
+ /**
65186
+ * Export an agent as a vendorable zip: `agent.json`, the prebuilt `runtime/` package, `manifest.json`,
65187
+ * and `LICENSE`. Two exports of the same version are byte-identical; `contentHash` pins them.
65188
+ */
65189
+ exportRuntimeBundle(id: string, selector?: {
65190
+ versionId?: string;
65191
+ alias?: string;
65192
+ }): Promise<AgentRuntimeBundle>;
65202
65193
  /**
65203
65194
  * Roll up the agent's most recent runs: per-version and per-tool counts,
65204
65195
  * 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;
@@ -5791,6 +5788,24 @@ var AgentsEndpoint = class AgentsEndpoint {
5791
5788
  return this.client.get(`/agents/${id}/export-runtime`, selector);
5792
5789
  }
5793
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
+ };
5807
+ }
5808
+ /**
5794
5809
  * Roll up the agent's most recent runs: per-version and per-tool counts,
5795
5810
  * average tokens and cost, and which attached tools were never called.
5796
5811
  */
@@ -8544,6 +8559,17 @@ var ToolApprovalGrantsEndpoint = class {
8544
8559
  };
8545
8560
  //#endregion
8546
8561
  //#region src/detached-buffered-follow.ts
8562
+ /** The release fields a response body carries, dropping any it does not name. */
8563
+ function releaseFieldsOf(data) {
8564
+ if (typeof data !== "object" || data === null) return {};
8565
+ const record = data;
8566
+ const resolution = record.agentTargetResolution;
8567
+ return {
8568
+ ...typeof record.agentVersionId === "string" ? { agentVersionId: record.agentVersionId } : {},
8569
+ ...typeof record.alias === "string" ? { alias: record.alias } : {},
8570
+ ...resolution === "alias" || resolution === "version" || resolution === "legacy-live-row" ? { agentTargetResolution: resolution } : {}
8571
+ };
8572
+ }
8547
8573
  function isDetachedToolOutputAck(data) {
8548
8574
  if (typeof data !== "object" || data === null) return false;
8549
8575
  const record = data;
@@ -8571,9 +8597,12 @@ function isLocalToolAwait(event) {
8571
8597
  * buffered continuation envelope a non-streaming local-tool loop expects.
8572
8598
  *
8573
8599
  * `after` is the last `seq` the loop had already consumed, so the replay
8574
- * never re-delivers the await the outputs just answered.
8600
+ * never re-delivers the await the outputs just answered. Version fields from
8601
+ * earlier responses (`carried`) and the ack land on the envelope, since the
8602
+ * events stream never repeats them.
8575
8603
  */
8576
- async function followDetachedResume(client, executionId, after) {
8604
+ async function followDetachedResume(client, ack, after, carried = {}) {
8605
+ const { executionId } = ack;
8577
8606
  const open = (cursor, signal) => client.requestStream(buildExecutionEventsPath(executionId, cursor ? { after: cursor } : {}), {
8578
8607
  method: "GET",
8579
8608
  ...signal ? { signal } : {}
@@ -8631,7 +8660,9 @@ async function followDetachedResume(client, executionId, after) {
8631
8660
  executionId,
8632
8661
  events,
8633
8662
  status,
8634
- ...error ? { error } : {}
8663
+ ...error ? { error } : {},
8664
+ ...carried,
8665
+ ...releaseFieldsOf(ack)
8635
8666
  };
8636
8667
  }
8637
8668
  //#endregion
@@ -10204,9 +10235,11 @@ var RuntypeFlowBuilder = class {
10204
10235
  }
10205
10236
  };
10206
10237
  let currentResponse;
10238
+ let carriedRelease = {};
10207
10239
  if (isStreaming) currentResponse = await client.dispatch(config);
10208
10240
  else {
10209
10241
  const data = await client.dispatchJson(config);
10242
+ carriedRelease = releaseFieldsOf(data);
10210
10243
  currentResponse = new Response(JSON.stringify(data), { headers: { "content-type": "application/json" } });
10211
10244
  }
10212
10245
  while (true) {
@@ -10241,7 +10274,11 @@ var RuntypeFlowBuilder = class {
10241
10274
  }).catch(() => null));
10242
10275
  else {
10243
10276
  const data = await client.post("/dispatch/resume", resumeData);
10244
- const envelope = isDetachedToolOutputAck(data) ? await followDetachedResume(client, data.executionId, pausedResult.resumeCursor) : data;
10277
+ carriedRelease = {
10278
+ ...carriedRelease,
10279
+ ...releaseFieldsOf(data)
10280
+ };
10281
+ const envelope = isDetachedToolOutputAck(data) ? await followDetachedResume(client, data, pausedResult.resumeCursor, carriedRelease) : data;
10245
10282
  currentResponse = new Response(JSON.stringify(envelope), { headers: { "content-type": "application/json" } });
10246
10283
  }
10247
10284
  } catch (error) {
@@ -11417,6 +11454,8 @@ const DEFINE_TOP_LEVEL_KEYS = /* @__PURE__ */ new Set([
11417
11454
  "icon",
11418
11455
  ...AGENT_CONFIG_KEYS
11419
11456
  ]);
11457
+ /** A minted tool typeid; `alwaysLoaded` also holds tool names, which may begin with `tool_`. */
11458
+ const TOOL_TYPEID_PATTERN = /^tool_[0-7][0-9a-hjkmnp-tv-z]{25}$/;
11420
11459
  /**
11421
11460
  * Collect account-scoped `tool_…` references (inlined copy of
11422
11461
  * `collectNonPortableAgentToolRefs` in @runtypelabs/shared). The v1 ensure
@@ -11443,6 +11482,9 @@ function collectNonPortableToolRefs(config) {
11443
11482
  if (isPlainObject(tools.approval)) scanArray(tools.approval.require, "tools.approval.require");
11444
11483
  if (isPlainObject(tools.subagentConfig)) scanArray(tools.subagentConfig.toolPool, "tools.subagentConfig.toolPool");
11445
11484
  if (isPlainObject(tools.codeModeConfig)) scanArray(tools.codeModeConfig.toolPool, "tools.codeModeConfig.toolPool");
11485
+ if (isPlainObject(tools.toolSearch) && Array.isArray(tools.toolSearch.alwaysLoaded)) tools.toolSearch.alwaysLoaded.forEach((ref, i) => {
11486
+ if (typeof ref === "string" && TOOL_TYPEID_PATTERN.test(ref)) found.push(`tools.toolSearch.alwaysLoaded[${i}]`);
11487
+ });
11446
11488
  if (Array.isArray(tools.runtimeTools)) tools.runtimeTools.forEach((runtimeTool, i) => {
11447
11489
  if (!isPlainObject(runtimeTool) || !isPlainObject(runtimeTool.config)) return;
11448
11490
  const base = `tools.runtimeTools[${i}].config`;
@@ -13482,7 +13524,7 @@ function transformQueryParams(params) {
13482
13524
  }
13483
13525
  //#endregion
13484
13526
  //#region src/version.ts
13485
- const SDK_VERSION = "10.7.0";
13527
+ const SDK_VERSION = "10.8.1";
13486
13528
  /**
13487
13529
  * Canonical client identity the API uses for attribution
13488
13530
  * (`detectActorSource` in apps/api/src/lib/audit-log.ts keys `'sdk'` off the
@@ -13693,9 +13735,11 @@ var RuntypeClient = class {
13693
13735
  }
13694
13736
  };
13695
13737
  let currentResponse;
13738
+ let carriedRelease = {};
13696
13739
  if (isStreaming) currentResponse = await this.dispatch.executeStream(modifiedRequest);
13697
13740
  else {
13698
13741
  const data = await this.dispatch.execute(modifiedRequest);
13742
+ carriedRelease = releaseFieldsOf(data);
13699
13743
  currentResponse = new Response(JSON.stringify(data), { headers: { "content-type": "application/json" } });
13700
13744
  }
13701
13745
  while (true) {
@@ -13729,7 +13773,11 @@ var RuntypeClient = class {
13729
13773
  if (isStreaming) currentResponse = await this.dispatch.resume(resumeData);
13730
13774
  else {
13731
13775
  const data = await this.dispatch.resume(resumeData);
13732
- const envelope = isDetachedToolOutputAck(data) ? await followDetachedResume(this, data.executionId, result.resumeCursor) : data;
13776
+ carriedRelease = {
13777
+ ...carriedRelease,
13778
+ ...releaseFieldsOf(data)
13779
+ };
13780
+ const envelope = isDetachedToolOutputAck(data) ? await followDetachedResume(this, data, result.resumeCursor, carriedRelease) : data;
13733
13781
  currentResponse = new Response(JSON.stringify(envelope), { headers: { "content-type": "application/json" } });
13734
13782
  }
13735
13783
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/sdk",
3
- "version": "10.7.0",
3
+ "version": "10.8.1",
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.68.0",
27
+ "@runtypelabs/shared": "3.68.2",
28
28
  "openapi-typescript": "^7.13.0",
29
29
  "tsdown": "^0.23.0",
30
30
  "typescript": "^6.0.3",