@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.cjs CHANGED
@@ -80,6 +80,7 @@ __export(index_exports, {
80
80
  ProviderKeysEndpoint: () => ProviderKeysEndpoint,
81
81
  RUNTYPE_CLIENT_KIND: () => RUNTYPE_CLIENT_KIND,
82
82
  RecordsEndpoint: () => RecordsEndpoint,
83
+ RunsNamespace: () => RunsNamespace,
83
84
  Runtype: () => Runtype,
84
85
  RuntypeApiError: () => RuntypeApiError,
85
86
  RuntypeClient: () => RuntypeClient2,
@@ -223,6 +224,8 @@ var UNIFIED_EVENT_TYPES = /* @__PURE__ */ new Set([
223
224
  "execution_error",
224
225
  "turn_start",
225
226
  "turn_complete",
227
+ "model_call_start",
228
+ "model_call_complete",
226
229
  "step_start",
227
230
  "step_complete",
228
231
  "step_skip",
@@ -2071,7 +2074,8 @@ function createExternalTool(config) {
2071
2074
  method: config.method || "POST",
2072
2075
  headers: config.headers,
2073
2076
  body: config.body
2074
- }
2077
+ },
2078
+ ...config.idempotent !== void 0 ? { idempotent: config.idempotent } : {}
2075
2079
  };
2076
2080
  }
2077
2081
 
@@ -2704,7 +2708,9 @@ function cloneRuntimeTool(tool) {
2704
2708
  parametersSchema: {
2705
2709
  ...tool.parametersSchema
2706
2710
  },
2707
- ...tool.config ? { config: { ...tool.config } } : {}
2711
+ ...tool.config ? { config: { ...tool.config } } : {},
2712
+ // INVARIANT: a field-by-field clone must carry every declared key or the gate strips it.
2713
+ ...tool.idempotent !== void 0 ? { idempotent: tool.idempotent } : {}
2708
2714
  };
2709
2715
  }
2710
2716
  function evaluateGeneratedRuntimeToolProposal(proposal, options = {}) {
@@ -12649,6 +12655,23 @@ var ExecutionsNamespace = class {
12649
12655
  }
12650
12656
  };
12651
12657
 
12658
+ // src/runs-namespace.ts
12659
+ var RunsNamespace = class {
12660
+ constructor(getClient) {
12661
+ this.getClient = getClient;
12662
+ }
12663
+ list(params) {
12664
+ return this.getClient().get("/runs", params);
12665
+ }
12666
+ async get(executionId, params) {
12667
+ const response = await this.getClient().get(
12668
+ `/runs/${encodeURIComponent(executionId)}`,
12669
+ params
12670
+ );
12671
+ return response.data;
12672
+ }
12673
+ };
12674
+
12652
12675
  // src/tools-ensure.ts
12653
12676
  function normalizeToolDefinition(definition) {
12654
12677
  const parametersSchema = isPlainObject(definition.parametersSchema) ? normalizeValue(definition.parametersSchema) : {};
@@ -13829,6 +13852,19 @@ var Runtype = class {
13829
13852
  static get executions() {
13830
13853
  return new ExecutionsNamespace(() => this.getClient());
13831
13854
  }
13855
+ /**
13856
+ * Runs namespace - the one list of agent and flow runs, read from the span
13857
+ * store. Includes runs dispatched with `storeResults: false` as `test: true`.
13858
+ *
13859
+ * @example
13860
+ * ```typescript
13861
+ * const { data } = await Runtype.runs.list({ agentId, status: 'failed' })
13862
+ * const run = await Runtype.runs.get(data[0].executionId, { view: 'full' })
13863
+ * ```
13864
+ */
13865
+ static get runs() {
13866
+ return new RunsNamespace(() => this.getClient());
13867
+ }
13832
13868
  /**
13833
13869
  * Tools namespace - Tool config-as-code (define / ensure / pull)
13834
13870
  *
@@ -14110,7 +14146,7 @@ function transformQueryParams(params) {
14110
14146
 
14111
14147
  // src/version.ts
14112
14148
  var FALLBACK_VERSION = "0.0.0";
14113
- var SDK_VERSION = "9.17.2".length > 0 ? "9.17.2" : FALLBACK_VERSION;
14149
+ var SDK_VERSION = "10.1.0".length > 0 ? "10.1.0" : FALLBACK_VERSION;
14114
14150
  var RUNTYPE_CLIENT_KIND = "sdk";
14115
14151
  var SDK_USER_AGENT = `runtype-sdk/${SDK_VERSION} (typescript)`;
14116
14152
 
@@ -15439,6 +15475,7 @@ var STEP_TYPE_TO_METHOD = {
15439
15475
  ProviderKeysEndpoint,
15440
15476
  RUNTYPE_CLIENT_KIND,
15441
15477
  RecordsEndpoint,
15478
+ RunsNamespace,
15442
15479
  Runtype,
15443
15480
  RuntypeApiError,
15444
15481
  RuntypeClient,