@runtypelabs/sdk 11.9.0 → 11.11.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
@@ -8780,6 +8780,28 @@ var LogsEndpoint = class {
8780
8780
  async traceConversation(conversationId) {
8781
8781
  return this.client.get(`/logs/trace/conversation/${conversationId}`);
8782
8782
  }
8783
+ /**
8784
+ * Filter runs and group them by one or two dimensions into aggregates (count, failure rate,
8785
+ * tokens, cost, duration, tool calls, signal fire rate), each with sample execution ids.
8786
+ * Model and tool-call metrics read spans, which caps the window at 7 days.
8787
+ */
8788
+ async queryTraces(request = {}) {
8789
+ return this.client.post("/logs/trace/query", request);
8790
+ }
8791
+ /**
8792
+ * Read a bounded window of one trace: by span index range, span kind, tool name, or around
8793
+ * the first failed span. Content stays previews-only unless `includeContent` is set.
8794
+ */
8795
+ async readTraceSlice(executionId, params) {
8796
+ return this.client.get(`/logs/trace/execution/${encodeURIComponent(executionId)}/slice`, params ? { ...params } : void 0);
8797
+ }
8798
+ /**
8799
+ * Compare two executions (tool-call alignment and first divergence) or two cohorts of runs
8800
+ * (failure rate, stop reasons, tool usage, signal rates).
8801
+ */
8802
+ async compareTrace(request) {
8803
+ return this.client.post("/logs/trace/compare", request);
8804
+ }
8783
8805
  };
8784
8806
  /**
8785
8807
  * Agent Versions endpoint handlers
@@ -9676,8 +9698,48 @@ function normalizeConfigForHash(config) {
9676
9698
  }
9677
9699
  return normalized;
9678
9700
  }
9701
+ const CONDITIONAL_STEP_LIST_KEYS = [
9702
+ "trueSteps",
9703
+ "falseSteps",
9704
+ "true_steps",
9705
+ "false_steps",
9706
+ "otherwiseSteps"
9707
+ ];
9708
+ function withoutStepIds(steps) {
9709
+ return steps.map((child) => {
9710
+ if (!isPlainObject$1(child)) return child;
9711
+ const { id: _id, ...rest } = child;
9712
+ return stripNestedStepIdsForHash(rest);
9713
+ });
9714
+ }
9715
+ /** Mirrors shared `stripNestedStepIds`: nested step ids are server-minted, so they are not content. */
9716
+ function stripNestedStepIdsForHash(step) {
9717
+ const config = step.config;
9718
+ if (!isPlainObject$1(config)) return step;
9719
+ if (step.type === "loop") return Array.isArray(config.steps) ? {
9720
+ ...step,
9721
+ config: {
9722
+ ...config,
9723
+ steps: withoutStepIds(config.steps)
9724
+ }
9725
+ } : step;
9726
+ if (step.type !== "conditional") return step;
9727
+ const next = { ...config };
9728
+ for (const key of CONDITIONAL_STEP_LIST_KEYS) {
9729
+ const list = config[key];
9730
+ if (Array.isArray(list)) next[key] = withoutStepIds(list);
9731
+ }
9732
+ if (Array.isArray(config.branches)) next.branches = config.branches.map((branch) => isPlainObject$1(branch) && Array.isArray(branch.steps) ? {
9733
+ ...branch,
9734
+ steps: withoutStepIds(branch.steps)
9735
+ } : branch);
9736
+ return {
9737
+ ...step,
9738
+ config: next
9739
+ };
9740
+ }
9679
9741
  function normalizeStepForHash(step) {
9680
- const stepObj = isPlainObject$1(step) ? step : {};
9742
+ const stepObj = isPlainObject$1(step) ? stripNestedStepIdsForHash(step) : {};
9681
9743
  return {
9682
9744
  type: typeof stepObj.type === "string" ? stepObj.type : "",
9683
9745
  name: typeof stepObj.name === "string" ? stepObj.name : "",
@@ -14652,7 +14714,7 @@ function transformQueryParams(params) {
14652
14714
  return result;
14653
14715
  }
14654
14716
  // src/version.ts
14655
- const SDK_VERSION = "11.9.0";
14717
+ const SDK_VERSION = "11.11.0";
14656
14718
  /**
14657
14719
  * Canonical client identity the API uses for attribution
14658
14720
  * (`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": "11.9.0",
3
+ "version": "11.11.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.100.0",
27
+ "@runtypelabs/shared": "3.102.0",
28
28
  "openapi-typescript": "^7.13.0",
29
29
  "tsdown": "^0.23.2",
30
30
  "typescript": "^6.0.3",