@runtypelabs/sdk 9.17.2 → 10.1.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.mjs CHANGED
@@ -9,6 +9,8 @@ var UNIFIED_EVENT_TYPES = /* @__PURE__ */ new Set([
9
9
  "execution_error",
10
10
  "turn_start",
11
11
  "turn_complete",
12
+ "model_call_start",
13
+ "model_call_complete",
12
14
  "step_start",
13
15
  "step_complete",
14
16
  "step_skip",
@@ -1857,7 +1859,8 @@ function createExternalTool(config) {
1857
1859
  method: config.method || "POST",
1858
1860
  headers: config.headers,
1859
1861
  body: config.body
1860
- }
1862
+ },
1863
+ ...config.idempotent !== void 0 ? { idempotent: config.idempotent } : {}
1861
1864
  };
1862
1865
  }
1863
1866
 
@@ -2490,7 +2493,9 @@ function cloneRuntimeTool(tool) {
2490
2493
  parametersSchema: {
2491
2494
  ...tool.parametersSchema
2492
2495
  },
2493
- ...tool.config ? { config: { ...tool.config } } : {}
2496
+ ...tool.config ? { config: { ...tool.config } } : {},
2497
+ // INVARIANT: a field-by-field clone must carry every declared key or the gate strips it.
2498
+ ...tool.idempotent !== void 0 ? { idempotent: tool.idempotent } : {}
2494
2499
  };
2495
2500
  }
2496
2501
  function evaluateGeneratedRuntimeToolProposal(proposal, options = {}) {
@@ -12435,6 +12440,23 @@ var ExecutionsNamespace = class {
12435
12440
  }
12436
12441
  };
12437
12442
 
12443
+ // src/runs-namespace.ts
12444
+ var RunsNamespace = class {
12445
+ constructor(getClient) {
12446
+ this.getClient = getClient;
12447
+ }
12448
+ list(params) {
12449
+ return this.getClient().get("/runs", params);
12450
+ }
12451
+ async get(executionId, params) {
12452
+ const response = await this.getClient().get(
12453
+ `/runs/${encodeURIComponent(executionId)}`,
12454
+ params
12455
+ );
12456
+ return response.data;
12457
+ }
12458
+ };
12459
+
12438
12460
  // src/tools-ensure.ts
12439
12461
  function normalizeToolDefinition(definition) {
12440
12462
  const parametersSchema = isPlainObject(definition.parametersSchema) ? normalizeValue(definition.parametersSchema) : {};
@@ -13615,6 +13637,19 @@ var Runtype = class {
13615
13637
  static get executions() {
13616
13638
  return new ExecutionsNamespace(() => this.getClient());
13617
13639
  }
13640
+ /**
13641
+ * Runs namespace - the one list of agent and flow runs, read from the span
13642
+ * store. Includes runs dispatched with `storeResults: false` as `test: true`.
13643
+ *
13644
+ * @example
13645
+ * ```typescript
13646
+ * const { data } = await Runtype.runs.list({ agentId, status: 'failed' })
13647
+ * const run = await Runtype.runs.get(data[0].executionId, { view: 'full' })
13648
+ * ```
13649
+ */
13650
+ static get runs() {
13651
+ return new RunsNamespace(() => this.getClient());
13652
+ }
13618
13653
  /**
13619
13654
  * Tools namespace - Tool config-as-code (define / ensure / pull)
13620
13655
  *
@@ -13896,7 +13931,7 @@ function transformQueryParams(params) {
13896
13931
 
13897
13932
  // src/version.ts
13898
13933
  var FALLBACK_VERSION = "0.0.0";
13899
- var SDK_VERSION = "9.17.2".length > 0 ? "9.17.2" : FALLBACK_VERSION;
13934
+ var SDK_VERSION = "10.1.0".length > 0 ? "10.1.0" : FALLBACK_VERSION;
13900
13935
  var RUNTYPE_CLIENT_KIND = "sdk";
13901
13936
  var SDK_USER_AGENT = `runtype-sdk/${SDK_VERSION} (typescript)`;
13902
13937
 
@@ -15224,6 +15259,7 @@ export {
15224
15259
  ProviderKeysEndpoint,
15225
15260
  RUNTYPE_CLIENT_KIND,
15226
15261
  RecordsEndpoint,
15262
+ RunsNamespace,
15227
15263
  Runtype,
15228
15264
  RuntypeApiError,
15229
15265
  RuntypeClient2 as RuntypeClient,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/sdk",
3
- "version": "9.17.2",
3
+ "version": "10.1.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.53.0",
27
+ "@runtypelabs/shared": "3.55.0",
28
28
  "openapi-typescript": "^7.13.0",
29
29
  "tsup": "^8.0.2",
30
30
  "typescript": "^6.0.3",