@kortexya/reasoninglayer 0.7.0 → 0.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.d.cts CHANGED
@@ -109,7 +109,7 @@ type JsonValue$1 = string | number | boolean | null | JsonValue$1[] | object;
109
109
  * This is the single source of truth for the version constant.
110
110
  * The `scripts/release.sh` script updates this value alongside `package.json`.
111
111
  */
112
- declare const SDK_VERSION = "0.7.0";
112
+ declare const SDK_VERSION = "0.8.0";
113
113
  /**
114
114
  * Configuration for the Reasoning Layer client.
115
115
  *
package/dist/index.d.ts CHANGED
@@ -109,7 +109,7 @@ type JsonValue$1 = string | number | boolean | null | JsonValue$1[] | object;
109
109
  * This is the single source of truth for the version constant.
110
110
  * The `scripts/release.sh` script updates this value alongside `package.json`.
111
111
  */
112
- declare const SDK_VERSION = "0.7.0";
112
+ declare const SDK_VERSION = "0.8.0";
113
113
  /**
114
114
  * Configuration for the Reasoning Layer client.
115
115
  *
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/config.ts
2
- var SDK_VERSION = "0.7.0";
2
+ var SDK_VERSION = "0.8.0";
3
3
  function resolveConfig(config) {
4
4
  if (!config.baseUrl) {
5
5
  throw new Error("ClientConfig.baseUrl is required");
@@ -528,6 +528,28 @@ var HttpClient = class {
528
528
  };
529
529
 
530
530
  // src/serialization.ts
531
+ var USER_DATA_FIELDS = /* @__PURE__ */ new Set([
532
+ // features — term/query feature maps (Record<string, ValueDto>)
533
+ "features",
534
+ // bindings — variable binding maps
535
+ "bindings",
536
+ // evidence — causal evidence maps
537
+ "evidence",
538
+ // exogenous values — causal intervention values
539
+ "exogenous_values",
540
+ "exogenousValues",
541
+ // modified/suggested params — action review params
542
+ "modified_params",
543
+ "modifiedParams",
544
+ "suggested_params",
545
+ "suggestedParams",
546
+ // match key — row matching keys
547
+ "match_key",
548
+ "matchKey",
549
+ // concept values — RAG concept values
550
+ "concept_values",
551
+ "conceptValues"
552
+ ]);
531
553
  function camelToSnake(str) {
532
554
  return str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
533
555
  }
@@ -539,6 +561,19 @@ function isPlainObject(value) {
539
561
  const proto = Object.getPrototypeOf(value);
540
562
  return proto === Object.prototype || proto === null;
541
563
  }
564
+ function transformUserDataRecord(input, transformFn) {
565
+ if (Array.isArray(input)) {
566
+ return input.map((item) => transformFn(item));
567
+ }
568
+ if (!isPlainObject(input)) {
569
+ return input;
570
+ }
571
+ const result = {};
572
+ for (const key of Object.keys(input)) {
573
+ result[key] = transformFn(input[key]);
574
+ }
575
+ return result;
576
+ }
542
577
  function toSnakeCase(input) {
543
578
  if (Array.isArray(input)) {
544
579
  return input.map((item) => toSnakeCase(item));
@@ -548,7 +583,12 @@ function toSnakeCase(input) {
548
583
  }
549
584
  const result = {};
550
585
  for (const key of Object.keys(input)) {
551
- result[camelToSnake(key)] = toSnakeCase(input[key]);
586
+ const snakeKey = camelToSnake(key);
587
+ if (USER_DATA_FIELDS.has(key)) {
588
+ result[snakeKey] = transformUserDataRecord(input[key], toSnakeCase);
589
+ } else {
590
+ result[snakeKey] = toSnakeCase(input[key]);
591
+ }
552
592
  }
553
593
  return result;
554
594
  }
@@ -561,7 +601,12 @@ function toCamelCase(input) {
561
601
  }
562
602
  const result = {};
563
603
  for (const key of Object.keys(input)) {
564
- result[snakeToCamel(key)] = toCamelCase(input[key]);
604
+ const camelKey = snakeToCamel(key);
605
+ if (USER_DATA_FIELDS.has(key)) {
606
+ result[camelKey] = transformUserDataRecord(input[key], toCamelCase);
607
+ } else {
608
+ result[camelKey] = toCamelCase(input[key]);
609
+ }
565
610
  }
566
611
  return result;
567
612
  }