@kortexya/reasoninglayer 0.1.3 → 0.1.5

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.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // src/config.ts
2
+ var SDK_VERSION = "0.1.5";
2
3
  function resolveConfig(config) {
3
4
  if (!config.baseUrl) {
4
5
  throw new Error("ClientConfig.baseUrl is required");
@@ -169,14 +170,18 @@ function createApiError(status, body, headers) {
169
170
  }
170
171
  }
171
172
  function isErrorBody(body) {
172
- return typeof body === "object" && body !== null && "error" in body && typeof body.error === "string" && "message" in body && typeof body.message === "string";
173
+ if (typeof body !== "object" || body === null) return false;
174
+ const obj = body;
175
+ return typeof obj.error === "string" && typeof obj.message === "string";
173
176
  }
174
177
  function isConstraintViolationBody(body) {
175
- return isErrorBody(body) && "details" in body && typeof body.details === "object" && body.details !== null;
178
+ if (!isErrorBody(body)) return false;
179
+ if (!("details" in body)) return false;
180
+ const obj = body;
181
+ return typeof obj.details === "object" && obj.details !== null;
176
182
  }
177
183
 
178
184
  // src/http.ts
179
- var SDK_VERSION = "0.1.0";
180
185
  var HttpClient = class {
181
186
  config;
182
187
  constructor(config) {
@@ -297,6 +302,7 @@ var HttpClient = class {
297
302
  if (response.ok) {
298
303
  if (response.status === 204) {
299
304
  return {
305
+ // Accepted: 204 No Content has no body; caller must handle undefined for void endpoints
300
306
  data: void 0,
301
307
  status: response.status,
302
308
  headers: response.headers,
@@ -628,8 +634,11 @@ var SortsClient = class {
628
634
  /** @internal */
629
635
  http;
630
636
  /** @internal */
631
- constructor(http) {
637
+ tenantId;
638
+ /** @internal */
639
+ constructor(http, tenantId) {
632
640
  this.http = http;
641
+ this.tenantId = tenantId;
633
642
  }
634
643
  /**
635
644
  * Create a new sort.
@@ -669,7 +678,10 @@ var SortsClient = class {
669
678
  * @returns Array of sorts.
670
679
  */
671
680
  async listSorts(options) {
672
- const response = await this.http.get(BASE, options);
681
+ const response = await this.http.get(
682
+ `${BASE}/tenant/${this.tenantId}`,
683
+ options
684
+ );
673
685
  return response.sorts;
674
686
  }
675
687
  /**
@@ -807,7 +819,55 @@ var SortsClient = class {
807
819
  * @param options - Per-call request options.
808
820
  */
809
821
  async updateReviewStatus(sortId, request, options) {
810
- await this.http.put(`${BASE}/${sortId}/review`, request, options);
822
+ await this.http.post(`${BASE}/${sortId}/review`, request, options);
823
+ }
824
+ // --- Sort Similarity Learning ---
825
+ /**
826
+ * Learn sort similarities from effect features.
827
+ *
828
+ * @param request - Learning parameters.
829
+ * @param options - Per-call request options.
830
+ * @returns Learning result with count of similarities found.
831
+ */
832
+ async learnSimilarities(request, options) {
833
+ return this.http.post(`${BASE}/learn-similarities`, request, options);
834
+ }
835
+ /**
836
+ * Get all learned similarities.
837
+ *
838
+ * @param options - Per-call request options.
839
+ * @returns List of learned similarities with status counts.
840
+ */
841
+ async getLearnedSimilarities(options) {
842
+ return this.http.get(`${BASE}/learned-similarities`, options);
843
+ }
844
+ /**
845
+ * Approve a learned similarity.
846
+ *
847
+ * @param request - Sort pair to approve.
848
+ * @param options - Per-call request options.
849
+ * @returns Approval result.
850
+ */
851
+ async approveSimilarity(request, options) {
852
+ return this.http.post(
853
+ `${BASE}/learned-similarities/approve`,
854
+ request,
855
+ options
856
+ );
857
+ }
858
+ /**
859
+ * Reject a learned similarity.
860
+ *
861
+ * @param request - Sort pair to reject with reason.
862
+ * @param options - Per-call request options.
863
+ * @returns Rejection result.
864
+ */
865
+ async rejectSimilarity(request, options) {
866
+ return this.http.post(
867
+ `${BASE}/learned-similarities/reject`,
868
+ request,
869
+ options
870
+ );
811
871
  }
812
872
  /**
813
873
  * Return a metadata-aware variant of this client.
@@ -818,14 +878,16 @@ var SortsClient = class {
818
878
  * @returns A new client instance whose methods return `Promise<ApiResponse<T>>`.
819
879
  */
820
880
  withMetadata() {
821
- return new SortsClientWithMetadata(this.http);
881
+ return new SortsClientWithMetadata(this.http, this.tenantId);
822
882
  }
823
883
  };
824
884
  var SortsClientWithMetadata = class {
825
885
  http;
886
+ tenantId;
826
887
  /** @internal */
827
- constructor(http) {
888
+ constructor(http, tenantId) {
828
889
  this.http = http;
890
+ this.tenantId = tenantId;
829
891
  }
830
892
  async createSort(request, options) {
831
893
  const result = await this.http.requestWithMetadata("POST", BASE, {
@@ -844,7 +906,11 @@ var SortsClientWithMetadata = class {
844
906
  return this.http.requestWithMetadata("DELETE", `${BASE}/${sortId}`, { options });
845
907
  }
846
908
  async listSorts(options) {
847
- const result = await this.http.requestWithMetadata("GET", BASE, { options });
909
+ const result = await this.http.requestWithMetadata(
910
+ "GET",
911
+ `${BASE}/tenant/${this.tenantId}`,
912
+ { options }
913
+ );
848
914
  return { ...result, data: result.data.sorts };
849
915
  }
850
916
  async bulkCreateSorts(request, options) {
@@ -917,11 +983,39 @@ var SortsClientWithMetadata = class {
917
983
  });
918
984
  }
919
985
  async updateReviewStatus(sortId, request, options) {
920
- return this.http.requestWithMetadata("PUT", `${BASE}/${sortId}/review`, {
986
+ return this.http.requestWithMetadata("POST", `${BASE}/${sortId}/review`, {
921
987
  body: request,
922
988
  options
923
989
  });
924
990
  }
991
+ async learnSimilarities(request, options) {
992
+ return this.http.requestWithMetadata(
993
+ "POST",
994
+ `${BASE}/learn-similarities`,
995
+ { body: request, options }
996
+ );
997
+ }
998
+ async getLearnedSimilarities(options) {
999
+ return this.http.requestWithMetadata(
1000
+ "GET",
1001
+ `${BASE}/learned-similarities`,
1002
+ { options }
1003
+ );
1004
+ }
1005
+ async approveSimilarity(request, options) {
1006
+ return this.http.requestWithMetadata(
1007
+ "POST",
1008
+ `${BASE}/learned-similarities/approve`,
1009
+ { body: request, options }
1010
+ );
1011
+ }
1012
+ async rejectSimilarity(request, options) {
1013
+ return this.http.requestWithMetadata(
1014
+ "POST",
1015
+ `${BASE}/learned-similarities/reject`,
1016
+ { body: request, options }
1017
+ );
1018
+ }
925
1019
  };
926
1020
 
927
1021
  // src/resources/terms.ts
@@ -1101,22 +1195,24 @@ var InferenceClient = class {
1101
1195
  return this.http.post(`${BASE3}/facts/bulk`, request, options);
1102
1196
  }
1103
1197
  /**
1104
- * Get all stored facts.
1198
+ * Get all stored facts for a tenant.
1105
1199
  *
1200
+ * @param tenantId - Tenant UUID.
1106
1201
  * @param options - Per-call request options.
1107
- * @returns Array of facts as PsiTerms.
1202
+ * @returns Facts with count.
1108
1203
  */
1109
- async getFacts(options) {
1110
- return this.http.get(`${BASE3}/facts`, options);
1204
+ async getFacts(tenantId, options) {
1205
+ return this.http.get(`${BASE3}/facts/${tenantId}`, options);
1111
1206
  }
1112
1207
  /**
1113
- * Clear all stored facts.
1208
+ * Clear all stored facts for a tenant.
1114
1209
  *
1210
+ * @param tenantId - Tenant UUID.
1115
1211
  * @param options - Per-call request options.
1116
1212
  * @returns Clear result with facts_cleared count.
1117
1213
  */
1118
- async clearFacts(options) {
1119
- return this.http.delete(`${BASE3}/facts`, options);
1214
+ async clearFacts(tenantId, options) {
1215
+ return this.http.delete(`${BASE3}/facts/${tenantId}`, options);
1120
1216
  }
1121
1217
  /**
1122
1218
  * Run backward chaining inference (goal-directed proof search).
@@ -1280,11 +1376,11 @@ var InferenceClientWithMetadata = class {
1280
1376
  options
1281
1377
  });
1282
1378
  }
1283
- async getFacts(options) {
1284
- return this.http.requestWithMetadata("GET", `${BASE3}/facts`, { options });
1379
+ async getFacts(tenantId, options) {
1380
+ return this.http.requestWithMetadata("GET", `${BASE3}/facts/${tenantId}`, { options });
1285
1381
  }
1286
- async clearFacts(options) {
1287
- return this.http.requestWithMetadata("DELETE", `${BASE3}/facts`, {
1382
+ async clearFacts(tenantId, options) {
1383
+ return this.http.requestWithMetadata("DELETE", `${BASE3}/facts/${tenantId}`, {
1288
1384
  options
1289
1385
  });
1290
1386
  }
@@ -1370,7 +1466,12 @@ var QueryClient = class {
1370
1466
  * @returns Array of matching terms (tagged ValueDto format).
1371
1467
  */
1372
1468
  async findUnifiable(request, options) {
1373
- return this.http.post(`${BASE4}/unifiable`, request, options);
1469
+ const response = await this.http.post(
1470
+ `${BASE4}/unifiable`,
1471
+ request,
1472
+ options
1473
+ );
1474
+ return response.results;
1374
1475
  }
1375
1476
  /**
1376
1477
  * Find terms by sort.
@@ -1380,7 +1481,12 @@ var QueryClient = class {
1380
1481
  * @returns Array of matching terms (tagged ValueDto format).
1381
1482
  */
1382
1483
  async findBySort(request, options) {
1383
- return this.http.post(`${BASE4}/by-sort`, request, options);
1484
+ const response = await this.http.post(
1485
+ `${BASE4}/by-sort`,
1486
+ request,
1487
+ options
1488
+ );
1489
+ return response.terms;
1384
1490
  }
1385
1491
  /**
1386
1492
  * Execute an Order-Sorted Feature search.
@@ -1424,7 +1530,7 @@ var QueryClient = class {
1424
1530
  * @returns Interpreted query and results.
1425
1531
  */
1426
1532
  async nlQuery(request, options) {
1427
- return this.http.post(`${BASE4}/nl`, request, options);
1533
+ return this.http.post("/api/v1/nl/query", request, options);
1428
1534
  }
1429
1535
  /**
1430
1536
  * Return a metadata-aware variant of this client.
@@ -1442,16 +1548,20 @@ var QueryClientWithMetadata = class {
1442
1548
  this.http = http;
1443
1549
  }
1444
1550
  async findUnifiable(request, options) {
1445
- return this.http.requestWithMetadata("POST", `${BASE4}/unifiable`, {
1446
- body: request,
1447
- options
1448
- });
1551
+ const result = await this.http.requestWithMetadata(
1552
+ "POST",
1553
+ `${BASE4}/unifiable`,
1554
+ { body: request, options }
1555
+ );
1556
+ return { ...result, data: result.data.results };
1449
1557
  }
1450
1558
  async findBySort(request, options) {
1451
- return this.http.requestWithMetadata("POST", `${BASE4}/by-sort`, {
1452
- body: request,
1453
- options
1454
- });
1559
+ const result = await this.http.requestWithMetadata(
1560
+ "POST",
1561
+ `${BASE4}/by-sort`,
1562
+ { body: request, options }
1563
+ );
1564
+ return { ...result, data: result.data.terms };
1455
1565
  }
1456
1566
  async osfSearch(request, options) {
1457
1567
  return this.http.requestWithMetadata("POST", `${BASE4}/osf-search`, {
@@ -1473,7 +1583,7 @@ var QueryClientWithMetadata = class {
1473
1583
  );
1474
1584
  }
1475
1585
  async nlQuery(request, options) {
1476
- return this.http.requestWithMetadata("POST", `${BASE4}/nl`, {
1586
+ return this.http.requestWithMetadata("POST", "/api/v1/nl/query", {
1477
1587
  body: request,
1478
1588
  options
1479
1589
  });
@@ -1666,7 +1776,44 @@ var CognitiveClient = class {
1666
1776
  * @returns The feedback result.
1667
1777
  */
1668
1778
  async provideFeedback(request, options) {
1669
- return this.http.post(`${BASE5}/feedback`, request, options);
1779
+ return this.http.post("/api/v1/cognitive/feedback", request, options);
1780
+ }
1781
+ // --- Integrated Cycle ---
1782
+ /**
1783
+ * Run a full integrated cognitive cycle (all 9 modules).
1784
+ *
1785
+ * @param request - Integrated cycle request with agent and tenant IDs.
1786
+ * @param options - Per-call request options.
1787
+ * @returns The integrated cycle outcome with duration.
1788
+ */
1789
+ async integratedCycle(request, options) {
1790
+ return this.http.post(
1791
+ `${BASE5}/integrated-cycle`,
1792
+ request,
1793
+ options
1794
+ );
1795
+ }
1796
+ // --- KB Subscription ---
1797
+ /**
1798
+ * Subscribe an agent to knowledge base changes (HTTP-based).
1799
+ *
1800
+ * @param request - Subscription request with watched sorts/features.
1801
+ * @param options - Per-call request options.
1802
+ * @returns Subscription ID.
1803
+ */
1804
+ async subscribeToKb(request, options) {
1805
+ return this.http.post(`${BASE5}/subscribe`, request, options);
1806
+ }
1807
+ // --- Episode Recording ---
1808
+ /**
1809
+ * Record an episodic memory entry for an agent.
1810
+ *
1811
+ * @param request - Episode to record.
1812
+ * @param options - Per-call request options.
1813
+ * @returns The created episode ID.
1814
+ */
1815
+ async recordEpisode(request, options) {
1816
+ return this.http.post(`${BASE5}/episodes`, request, options);
1670
1817
  }
1671
1818
  // --- WebSocket Subscriptions ---
1672
1819
  /**
@@ -1812,7 +1959,26 @@ var CognitiveClientWithMetadata = class {
1812
1959
  );
1813
1960
  }
1814
1961
  async provideFeedback(request, options) {
1815
- return this.http.requestWithMetadata("POST", `${BASE5}/feedback`, {
1962
+ return this.http.requestWithMetadata("POST", "/api/v1/cognitive/feedback", {
1963
+ body: request,
1964
+ options
1965
+ });
1966
+ }
1967
+ async integratedCycle(request, options) {
1968
+ return this.http.requestWithMetadata(
1969
+ "POST",
1970
+ `${BASE5}/integrated-cycle`,
1971
+ { body: request, options }
1972
+ );
1973
+ }
1974
+ async subscribeToKb(request, options) {
1975
+ return this.http.requestWithMetadata("POST", `${BASE5}/subscribe`, {
1976
+ body: request,
1977
+ options
1978
+ });
1979
+ }
1980
+ async recordEpisode(request, options) {
1981
+ return this.http.requestWithMetadata("POST", `${BASE5}/episodes`, {
1816
1982
  body: request,
1817
1983
  options
1818
1984
  });
@@ -1930,6 +2096,7 @@ var FuzzyClientWithMetadata = class {
1930
2096
 
1931
2097
  // src/resources/constraints.ts
1932
2098
  var BASE7 = "/api/v1/constraints";
2099
+ var SESSION_BASE = "/api/v1/constraint-sessions";
1933
2100
  var ConstraintsClient = class {
1934
2101
  /** @internal */
1935
2102
  http;
@@ -1957,6 +2124,57 @@ var ConstraintsClient = class {
1957
2124
  async getGraph(request, options) {
1958
2125
  return this.http.post(`${BASE7}/graph`, request, options);
1959
2126
  }
2127
+ // --- Session Management ---
2128
+ /**
2129
+ * Create a constraint session.
2130
+ *
2131
+ * @param request - Session creation parameters.
2132
+ * @param options - Per-call request options.
2133
+ * @returns Session status.
2134
+ */
2135
+ async createSession(request, options) {
2136
+ return this.http.post(SESSION_BASE, request, options);
2137
+ }
2138
+ /**
2139
+ * Get a constraint session by ID.
2140
+ *
2141
+ * @param sessionId - Session ID.
2142
+ * @param options - Per-call request options.
2143
+ * @returns Session status.
2144
+ */
2145
+ async getSession(sessionId, options) {
2146
+ return this.http.get(`${SESSION_BASE}/${sessionId}`, options);
2147
+ }
2148
+ /**
2149
+ * Add constraints to a session.
2150
+ *
2151
+ * @param sessionId - Session ID.
2152
+ * @param request - Constraints to add.
2153
+ * @param options - Per-call request options.
2154
+ * @returns Updated session status.
2155
+ */
2156
+ async addConstraints(sessionId, request, options) {
2157
+ return this.http.post(
2158
+ `${SESSION_BASE}/${sessionId}/constraints`,
2159
+ request,
2160
+ options
2161
+ );
2162
+ }
2163
+ /**
2164
+ * Bind variables in a constraint session.
2165
+ *
2166
+ * @param sessionId - Session ID.
2167
+ * @param request - Variable bindings.
2168
+ * @param options - Per-call request options.
2169
+ * @returns Binding result.
2170
+ */
2171
+ async bindVariables(sessionId, request, options) {
2172
+ return this.http.post(
2173
+ `${SESSION_BASE}/${sessionId}/bindings`,
2174
+ request,
2175
+ options
2176
+ );
2177
+ }
1960
2178
  /**
1961
2179
  * Return a metadata-aware variant of this client.
1962
2180
  *
@@ -1984,6 +2202,33 @@ var ConstraintsClientWithMetadata = class {
1984
2202
  options
1985
2203
  });
1986
2204
  }
2205
+ async createSession(request, options) {
2206
+ return this.http.requestWithMetadata("POST", SESSION_BASE, {
2207
+ body: request,
2208
+ options
2209
+ });
2210
+ }
2211
+ async getSession(sessionId, options) {
2212
+ return this.http.requestWithMetadata(
2213
+ "GET",
2214
+ `${SESSION_BASE}/${sessionId}`,
2215
+ { options }
2216
+ );
2217
+ }
2218
+ async addConstraints(sessionId, request, options) {
2219
+ return this.http.requestWithMetadata(
2220
+ "POST",
2221
+ `${SESSION_BASE}/${sessionId}/constraints`,
2222
+ { body: request, options }
2223
+ );
2224
+ }
2225
+ async bindVariables(sessionId, request, options) {
2226
+ return this.http.requestWithMetadata(
2227
+ "POST",
2228
+ `${SESSION_BASE}/${sessionId}/bindings`,
2229
+ { body: request, options }
2230
+ );
2231
+ }
1987
2232
  };
1988
2233
 
1989
2234
  // src/resources/namespaces.ts
@@ -2299,6 +2544,82 @@ var ExecutionClient = class {
2299
2544
  async getChoicePoints(sessionId, options) {
2300
2545
  return this.http.get(`${BASE10}/sessions/${sessionId}/choice-points`, options);
2301
2546
  }
2547
+ // --- Residuation ---
2548
+ /**
2549
+ * Residuate a goal (suspend until data becomes available).
2550
+ *
2551
+ * @param sessionId - Session ID.
2552
+ * @param request - Residuation request.
2553
+ * @param options - Per-call request options.
2554
+ * @returns Residuation result.
2555
+ */
2556
+ async residuate(sessionId, request, options) {
2557
+ return this.http.post(
2558
+ `${BASE10}/sessions/${sessionId}/residuate`,
2559
+ request,
2560
+ options
2561
+ );
2562
+ }
2563
+ /**
2564
+ * Bind a term with sort and feature values.
2565
+ *
2566
+ * @param sessionId - Session ID.
2567
+ * @param request - Binding request.
2568
+ * @param options - Per-call request options.
2569
+ * @returns Binding result with evaluation results from released residuations.
2570
+ */
2571
+ async bind(sessionId, request, options) {
2572
+ return this.http.post(
2573
+ `${BASE10}/sessions/${sessionId}/bindings`,
2574
+ request,
2575
+ options
2576
+ );
2577
+ }
2578
+ /**
2579
+ * Release residuations for a term (attempt evaluation).
2580
+ *
2581
+ * @param sessionId - Session ID.
2582
+ * @param request - Release request.
2583
+ * @param options - Per-call request options.
2584
+ * @returns Released goals and evaluation results.
2585
+ */
2586
+ async releaseResiduations(sessionId, request, options) {
2587
+ return this.http.post(
2588
+ `${BASE10}/sessions/${sessionId}/residuate/release`,
2589
+ request,
2590
+ options
2591
+ );
2592
+ }
2593
+ /**
2594
+ * Append residuations from a source term to a target term.
2595
+ *
2596
+ * @param sessionId - Session ID.
2597
+ * @param request - Append request.
2598
+ * @param options - Per-call request options.
2599
+ * @returns Append result.
2600
+ */
2601
+ async appendResiduations(sessionId, request, options) {
2602
+ return this.http.post(
2603
+ `${BASE10}/sessions/${sessionId}/residuations/append`,
2604
+ request,
2605
+ options
2606
+ );
2607
+ }
2608
+ /**
2609
+ * Get residuations for a term.
2610
+ *
2611
+ * @param sessionId - Session ID.
2612
+ * @param request - Get residuations request.
2613
+ * @param options - Per-call request options.
2614
+ * @returns Residuation details.
2615
+ */
2616
+ async getResiduations(sessionId, request, options) {
2617
+ return this.http.post(
2618
+ `${BASE10}/sessions/${sessionId}/residuations`,
2619
+ request,
2620
+ options
2621
+ );
2622
+ }
2302
2623
  /**
2303
2624
  * Return a metadata-aware variant of this client.
2304
2625
  *
@@ -2361,6 +2682,41 @@ var ExecutionClientWithMetadata = class {
2361
2682
  { options }
2362
2683
  );
2363
2684
  }
2685
+ async residuate(sessionId, request, options) {
2686
+ return this.http.requestWithMetadata(
2687
+ "POST",
2688
+ `${BASE10}/sessions/${sessionId}/residuate`,
2689
+ { body: request, options }
2690
+ );
2691
+ }
2692
+ async bind(sessionId, request, options) {
2693
+ return this.http.requestWithMetadata(
2694
+ "POST",
2695
+ `${BASE10}/sessions/${sessionId}/bindings`,
2696
+ { body: request, options }
2697
+ );
2698
+ }
2699
+ async releaseResiduations(sessionId, request, options) {
2700
+ return this.http.requestWithMetadata(
2701
+ "POST",
2702
+ `${BASE10}/sessions/${sessionId}/residuate/release`,
2703
+ { body: request, options }
2704
+ );
2705
+ }
2706
+ async appendResiduations(sessionId, request, options) {
2707
+ return this.http.requestWithMetadata(
2708
+ "POST",
2709
+ `${BASE10}/sessions/${sessionId}/residuations/append`,
2710
+ { body: request, options }
2711
+ );
2712
+ }
2713
+ async getResiduations(sessionId, request, options) {
2714
+ return this.http.requestWithMetadata(
2715
+ "POST",
2716
+ `${BASE10}/sessions/${sessionId}/residuations`,
2717
+ { body: request, options }
2718
+ );
2719
+ }
2364
2720
  };
2365
2721
 
2366
2722
  // src/resources/causal.ts
@@ -4898,21 +5254,671 @@ var ExtractClientWithMetadata = class {
4898
5254
  }
4899
5255
  };
4900
5256
 
4901
- // src/client.ts
4902
- var ReasoningLayerClient = class {
4903
- /** Sort (type hierarchy) operations. */
4904
- sorts;
4905
- /** Psi-term CRUD operations. */
4906
- terms;
4907
- /** Inference engine operations (backward/forward chaining, fuzzy, Bayesian, NAF). */
4908
- inference;
4909
- /** Query operations (unification, OSF search, validation). */
4910
- query;
4911
- /** Cognitive agent operations (BDI cycle, beliefs, goals, messaging). */
4912
- cognitive;
4913
- /** Fuzzy operations (unification, merge, subsumption, top-K search). */
4914
- fuzzy;
4915
- /** Constraint operations (arithmetic solving, graph visualization). */
5257
+ // src/resources/oversight.ts
5258
+ var BASE27 = "/api/v1/oversight";
5259
+ var OversightClient = class {
5260
+ /** @internal */
5261
+ http;
5262
+ /** @internal */
5263
+ constructor(http) {
5264
+ this.http = http;
5265
+ }
5266
+ /**
5267
+ * Run single-pass FormalJudge oversight verification.
5268
+ *
5269
+ * @param request - Judge request with trajectory and user intent.
5270
+ * @param options - Per-call request options.
5271
+ * @returns Verdict, scores, violations, and optional certificate.
5272
+ */
5273
+ async judge(request, options) {
5274
+ return this.http.post(`${BASE27}/judge`, request, options);
5275
+ }
5276
+ /**
5277
+ * Run iterative refinement FormalJudge pipeline.
5278
+ *
5279
+ * @param request - Judge request with trajectory and user intent.
5280
+ * @param options - Per-call request options.
5281
+ * @returns Results from each refinement round with convergence status.
5282
+ */
5283
+ async refine(request, options) {
5284
+ return this.http.post(
5285
+ `${BASE27}/judge/refine`,
5286
+ request,
5287
+ options
5288
+ );
5289
+ }
5290
+ /**
5291
+ * Return a metadata-aware variant of this client.
5292
+ *
5293
+ * @returns A new client instance whose methods return `Promise<ApiResponse<T>>`.
5294
+ */
5295
+ withMetadata() {
5296
+ return new OversightClientWithMetadata(this.http);
5297
+ }
5298
+ };
5299
+ var OversightClientWithMetadata = class {
5300
+ http;
5301
+ /** @internal */
5302
+ constructor(http) {
5303
+ this.http = http;
5304
+ }
5305
+ /**
5306
+ * Run single-pass FormalJudge oversight verification.
5307
+ *
5308
+ * @param request - Judge request with trajectory and user intent.
5309
+ * @param options - Per-call request options.
5310
+ * @returns Verdict, scores, violations, and optional certificate wrapped in {@link ApiResponse}.
5311
+ */
5312
+ async judge(request, options) {
5313
+ return this.http.requestWithMetadata("POST", `${BASE27}/judge`, {
5314
+ body: request,
5315
+ options
5316
+ });
5317
+ }
5318
+ /**
5319
+ * Run iterative refinement FormalJudge pipeline.
5320
+ *
5321
+ * @param request - Judge request with trajectory and user intent.
5322
+ * @param options - Per-call request options.
5323
+ * @returns Results from each refinement round with convergence status wrapped in {@link ApiResponse}.
5324
+ */
5325
+ async refine(request, options) {
5326
+ return this.http.requestWithMetadata(
5327
+ "POST",
5328
+ `${BASE27}/judge/refine`,
5329
+ { body: request, options }
5330
+ );
5331
+ }
5332
+ };
5333
+
5334
+ // src/resources/cdl.ts
5335
+ var BASE28 = "/api/v1/cdl";
5336
+ var CdlClient = class {
5337
+ /** @internal */
5338
+ http;
5339
+ /** @internal */
5340
+ constructor(http) {
5341
+ this.http = http;
5342
+ }
5343
+ /**
5344
+ * Run differentiable forward chaining (Phases 1+2).
5345
+ *
5346
+ * @param request - Forward chaining parameters.
5347
+ * @param options - Per-call request options.
5348
+ * @returns Weighted facts, iteration metrics, and symbolic result.
5349
+ */
5350
+ async differentiableForwardChain(request, options) {
5351
+ return this.http.post(
5352
+ `${BASE28}/forward-chain/differentiable`,
5353
+ request,
5354
+ options
5355
+ );
5356
+ }
5357
+ /**
5358
+ * Perform soft (differentiable) unification between two terms (Phase 2).
5359
+ *
5360
+ * @param request - Soft unification request with two term IDs.
5361
+ * @param options - Per-call request options.
5362
+ * @returns Confidence scores and compatibility.
5363
+ */
5364
+ async softUnify(request, options) {
5365
+ return this.http.post(`${BASE28}/soft-unify`, request, options);
5366
+ }
5367
+ /**
5368
+ * Run tagged forward chaining with probabilistic semiring (Phase 1).
5369
+ *
5370
+ * @param request - Tagged forward chaining parameters.
5371
+ * @param options - Per-call request options.
5372
+ * @returns Tagged facts with probabilities.
5373
+ */
5374
+ async taggedForwardChain(request, options) {
5375
+ return this.http.post(`${BASE28}/forward-chain/tagged`, request, options);
5376
+ }
5377
+ /**
5378
+ * Run monadic fixpoint inference (Phase 3).
5379
+ *
5380
+ * @param request - Monadic fixpoint parameters.
5381
+ * @param options - Per-call request options.
5382
+ * @returns Facts with monadic metadata.
5383
+ */
5384
+ async monadicFixpoint(request, options) {
5385
+ return this.http.post(
5386
+ `${BASE28}/monadic-fixpoint`,
5387
+ request,
5388
+ options
5389
+ );
5390
+ }
5391
+ /**
5392
+ * Run derived inference through composed CDL layer (Phase 4).
5393
+ *
5394
+ * @param request - Feature pairs for inference.
5395
+ * @param options - Per-call request options.
5396
+ * @returns Inference results with architecture info.
5397
+ */
5398
+ async derivedInference(request, options) {
5399
+ return this.http.post(
5400
+ `${BASE28}/derived-inference`,
5401
+ request,
5402
+ options
5403
+ );
5404
+ }
5405
+ /**
5406
+ * Classify text for safety violations using CDL fact grounding (Phase 5).
5407
+ *
5408
+ * @param request - Safety classification request.
5409
+ * @param options - Per-call request options.
5410
+ * @returns Safety decisions, probabilities, and model info.
5411
+ */
5412
+ async classifySafety(request, options) {
5413
+ return this.http.post(
5414
+ `${BASE28}/classify-safety`,
5415
+ request,
5416
+ options
5417
+ );
5418
+ }
5419
+ /**
5420
+ * Dynamically add a sort to the CDL architecture (Phase 6).
5421
+ *
5422
+ * @param request - Sort definition.
5423
+ * @param options - Per-call request options.
5424
+ * @returns Adaptation result with verification.
5425
+ */
5426
+ async dynamicAddSort(request, options) {
5427
+ return this.http.post(
5428
+ `${BASE28}/dynamic/add-sort`,
5429
+ request,
5430
+ options
5431
+ );
5432
+ }
5433
+ /**
5434
+ * Get CDL subsystem status.
5435
+ *
5436
+ * @param options - Per-call request options.
5437
+ * @returns CDL component statuses.
5438
+ */
5439
+ async getStatus(options) {
5440
+ return this.http.get(`${BASE28}/status`, options);
5441
+ }
5442
+ /**
5443
+ * Return a metadata-aware variant of this client.
5444
+ *
5445
+ * @returns A new client instance whose methods return `Promise<ApiResponse<T>>`.
5446
+ */
5447
+ withMetadata() {
5448
+ return new CdlClientWithMetadata(this.http);
5449
+ }
5450
+ };
5451
+ var CdlClientWithMetadata = class {
5452
+ http;
5453
+ /** @internal */
5454
+ constructor(http) {
5455
+ this.http = http;
5456
+ }
5457
+ async differentiableForwardChain(request, options) {
5458
+ return this.http.requestWithMetadata(
5459
+ "POST",
5460
+ `${BASE28}/forward-chain/differentiable`,
5461
+ { body: request, options }
5462
+ );
5463
+ }
5464
+ async softUnify(request, options) {
5465
+ return this.http.requestWithMetadata("POST", `${BASE28}/soft-unify`, {
5466
+ body: request,
5467
+ options
5468
+ });
5469
+ }
5470
+ async taggedForwardChain(request, options) {
5471
+ return this.http.requestWithMetadata(
5472
+ "POST",
5473
+ `${BASE28}/forward-chain/tagged`,
5474
+ { body: request, options }
5475
+ );
5476
+ }
5477
+ async monadicFixpoint(request, options) {
5478
+ return this.http.requestWithMetadata(
5479
+ "POST",
5480
+ `${BASE28}/monadic-fixpoint`,
5481
+ { body: request, options }
5482
+ );
5483
+ }
5484
+ async derivedInference(request, options) {
5485
+ return this.http.requestWithMetadata(
5486
+ "POST",
5487
+ `${BASE28}/derived-inference`,
5488
+ { body: request, options }
5489
+ );
5490
+ }
5491
+ async classifySafety(request, options) {
5492
+ return this.http.requestWithMetadata(
5493
+ "POST",
5494
+ `${BASE28}/classify-safety`,
5495
+ { body: request, options }
5496
+ );
5497
+ }
5498
+ async dynamicAddSort(request, options) {
5499
+ return this.http.requestWithMetadata(
5500
+ "POST",
5501
+ `${BASE28}/dynamic/add-sort`,
5502
+ { body: request, options }
5503
+ );
5504
+ }
5505
+ async getStatus(options) {
5506
+ return this.http.requestWithMetadata("GET", `${BASE28}/status`, {
5507
+ options
5508
+ });
5509
+ }
5510
+ };
5511
+
5512
+ // src/resources/neuro-symbolic.ts
5513
+ var BASE29 = "/api/v1/admin/neuro-symbolic";
5514
+ var NeuroSymbolicClient = class {
5515
+ /** @internal */
5516
+ http;
5517
+ /** @internal */
5518
+ constructor(http) {
5519
+ this.http = http;
5520
+ }
5521
+ /**
5522
+ * Get neuro-symbolic system status.
5523
+ *
5524
+ * @param options - Per-call request options.
5525
+ * @returns System status.
5526
+ */
5527
+ async getStatus(options) {
5528
+ return this.http.get(`${BASE29}/status`, options);
5529
+ }
5530
+ /**
5531
+ * Get neuro-symbolic diagnostics.
5532
+ *
5533
+ * @param options - Per-call request options.
5534
+ * @returns Diagnostics information.
5535
+ */
5536
+ async getDiagnostics(options) {
5537
+ return this.http.get(`${BASE29}/diagnostics`, options);
5538
+ }
5539
+ /**
5540
+ * Trigger scorer training.
5541
+ *
5542
+ * @param options - Per-call request options.
5543
+ * @returns Training trigger result.
5544
+ */
5545
+ async trainScorer(options) {
5546
+ return this.http.post(`${BASE29}/train`, void 0, options);
5547
+ }
5548
+ /**
5549
+ * Trigger embedding training.
5550
+ *
5551
+ * @param options - Per-call request options.
5552
+ * @returns Training trigger result.
5553
+ */
5554
+ async trainEmbeddings(options) {
5555
+ return this.http.post(
5556
+ `${BASE29}/train/embeddings`,
5557
+ void 0,
5558
+ options
5559
+ );
5560
+ }
5561
+ /**
5562
+ * Trigger GFlowNet training.
5563
+ *
5564
+ * @param options - Per-call request options.
5565
+ * @returns GFlowNet training result.
5566
+ */
5567
+ async trainGflownet(options) {
5568
+ return this.http.post(
5569
+ `${BASE29}/train/gflownet`,
5570
+ void 0,
5571
+ options
5572
+ );
5573
+ }
5574
+ /**
5575
+ * Run end-to-end training.
5576
+ *
5577
+ * @param request - Training configuration.
5578
+ * @param options - Per-call request options.
5579
+ * @returns Training results.
5580
+ */
5581
+ async trainE2e(request, options) {
5582
+ return this.http.post(`${BASE29}/train/e2e`, request, options);
5583
+ }
5584
+ /**
5585
+ * Save trained weights.
5586
+ *
5587
+ * @param options - Per-call request options.
5588
+ * @returns Save result.
5589
+ */
5590
+ async saveWeights(options) {
5591
+ return this.http.post(`${BASE29}/save-weights`, void 0, options);
5592
+ }
5593
+ /**
5594
+ * Verify embedding quality.
5595
+ *
5596
+ * @param options - Per-call request options.
5597
+ * @returns Verification results for containment, meet preservation, and specificity.
5598
+ */
5599
+ async verifyEmbeddings(options) {
5600
+ return this.http.get(
5601
+ `${BASE29}/embeddings/verify`,
5602
+ options
5603
+ );
5604
+ }
5605
+ /**
5606
+ * Look up a sort's box embedding.
5607
+ *
5608
+ * @param request - Sort box lookup request.
5609
+ * @param options - Per-call request options.
5610
+ * @returns Sort box coordinates and volume.
5611
+ */
5612
+ async sortBoxLookup(request, options) {
5613
+ return this.http.post(
5614
+ `${BASE29}/embeddings/sort-box`,
5615
+ request,
5616
+ options
5617
+ );
5618
+ }
5619
+ /**
5620
+ * Return a metadata-aware variant of this client.
5621
+ *
5622
+ * @returns A new client instance whose methods return `Promise<ApiResponse<T>>`.
5623
+ */
5624
+ withMetadata() {
5625
+ return new NeuroSymbolicClientWithMetadata(this.http);
5626
+ }
5627
+ };
5628
+ var NeuroSymbolicClientWithMetadata = class {
5629
+ http;
5630
+ /** @internal */
5631
+ constructor(http) {
5632
+ this.http = http;
5633
+ }
5634
+ async getStatus(options) {
5635
+ return this.http.requestWithMetadata(
5636
+ "GET",
5637
+ `${BASE29}/status`,
5638
+ { options }
5639
+ );
5640
+ }
5641
+ async getDiagnostics(options) {
5642
+ return this.http.requestWithMetadata(
5643
+ "GET",
5644
+ `${BASE29}/diagnostics`,
5645
+ { options }
5646
+ );
5647
+ }
5648
+ async trainScorer(options) {
5649
+ return this.http.requestWithMetadata(
5650
+ "POST",
5651
+ `${BASE29}/train`,
5652
+ { options }
5653
+ );
5654
+ }
5655
+ async trainEmbeddings(options) {
5656
+ return this.http.requestWithMetadata(
5657
+ "POST",
5658
+ `${BASE29}/train/embeddings`,
5659
+ { options }
5660
+ );
5661
+ }
5662
+ async trainGflownet(options) {
5663
+ return this.http.requestWithMetadata(
5664
+ "POST",
5665
+ `${BASE29}/train/gflownet`,
5666
+ { options }
5667
+ );
5668
+ }
5669
+ async trainE2e(request, options) {
5670
+ return this.http.requestWithMetadata(
5671
+ "POST",
5672
+ `${BASE29}/train/e2e`,
5673
+ { body: request, options }
5674
+ );
5675
+ }
5676
+ async saveWeights(options) {
5677
+ return this.http.requestWithMetadata(
5678
+ "POST",
5679
+ `${BASE29}/save-weights`,
5680
+ { options }
5681
+ );
5682
+ }
5683
+ async verifyEmbeddings(options) {
5684
+ return this.http.requestWithMetadata(
5685
+ "GET",
5686
+ `${BASE29}/embeddings/verify`,
5687
+ { options }
5688
+ );
5689
+ }
5690
+ async sortBoxLookup(request, options) {
5691
+ return this.http.requestWithMetadata(
5692
+ "POST",
5693
+ `${BASE29}/embeddings/sort-box`,
5694
+ { body: request, options }
5695
+ );
5696
+ }
5697
+ };
5698
+
5699
+ // src/resources/analysis.ts
5700
+ var BASE30 = "/api/v1/analysis";
5701
+ var AnalysisClient = class {
5702
+ /** @internal */
5703
+ http;
5704
+ /** @internal */
5705
+ constructor(http) {
5706
+ this.http = http;
5707
+ }
5708
+ /**
5709
+ * Run sort discovery analysis on existing terms.
5710
+ *
5711
+ * @param request - Discovery parameters.
5712
+ * @param options - Per-call request options.
5713
+ * @returns Discovery results with recommendations.
5714
+ */
5715
+ async sortDiscovery(request, options) {
5716
+ return this.http.post(`${BASE30}/sort-discovery`, request, options);
5717
+ }
5718
+ /**
5719
+ * Start an interactive attribute exploration session.
5720
+ *
5721
+ * @param request - Exploration parameters.
5722
+ * @param options - Per-call request options.
5723
+ * @returns Session ID and first question.
5724
+ */
5725
+ async startExploration(request, options) {
5726
+ return this.http.post(
5727
+ `${BASE30}/attribute-exploration/start`,
5728
+ request,
5729
+ options
5730
+ );
5731
+ }
5732
+ /**
5733
+ * Confirm the current implication in an exploration session.
5734
+ *
5735
+ * @param sessionId - Exploration session ID.
5736
+ * @param options - Per-call request options.
5737
+ * @returns Next question and progress.
5738
+ */
5739
+ async confirmImplication(sessionId, options) {
5740
+ return this.http.post(
5741
+ `${BASE30}/attribute-exploration/${sessionId}/confirm`,
5742
+ void 0,
5743
+ options
5744
+ );
5745
+ }
5746
+ /**
5747
+ * Refute the current implication with a counterexample.
5748
+ *
5749
+ * @param sessionId - Exploration session ID.
5750
+ * @param request - Counterexample.
5751
+ * @param options - Per-call request options.
5752
+ * @returns Next question and progress.
5753
+ */
5754
+ async refuteImplication(sessionId, request, options) {
5755
+ return this.http.post(
5756
+ `${BASE30}/attribute-exploration/${sessionId}/refute`,
5757
+ request,
5758
+ options
5759
+ );
5760
+ }
5761
+ /**
5762
+ * Get the current status of an exploration session.
5763
+ *
5764
+ * @param sessionId - Exploration session ID.
5765
+ * @param options - Per-call request options.
5766
+ * @returns Session status with progress and confirmed implications.
5767
+ */
5768
+ async getExplorationStatus(sessionId, options) {
5769
+ return this.http.get(
5770
+ `${BASE30}/attribute-exploration/${sessionId}/status`,
5771
+ options
5772
+ );
5773
+ }
5774
+ /**
5775
+ * Complete an exploration session and create rules from the discovered basis.
5776
+ *
5777
+ * @param sessionId - Exploration session ID.
5778
+ * @param options - Per-call request options.
5779
+ * @returns Final implications and rules created.
5780
+ */
5781
+ async completeExploration(sessionId, options) {
5782
+ return this.http.post(
5783
+ `${BASE30}/attribute-exploration/${sessionId}/complete`,
5784
+ void 0,
5785
+ options
5786
+ );
5787
+ }
5788
+ /**
5789
+ * Return a metadata-aware variant of this client.
5790
+ *
5791
+ * @returns A new client instance whose methods return `Promise<ApiResponse<T>>`.
5792
+ */
5793
+ withMetadata() {
5794
+ return new AnalysisClientWithMetadata(this.http);
5795
+ }
5796
+ };
5797
+ var AnalysisClientWithMetadata = class {
5798
+ http;
5799
+ /** @internal */
5800
+ constructor(http) {
5801
+ this.http = http;
5802
+ }
5803
+ async sortDiscovery(request, options) {
5804
+ return this.http.requestWithMetadata(
5805
+ "POST",
5806
+ `${BASE30}/sort-discovery`,
5807
+ { body: request, options }
5808
+ );
5809
+ }
5810
+ async startExploration(request, options) {
5811
+ return this.http.requestWithMetadata(
5812
+ "POST",
5813
+ `${BASE30}/attribute-exploration/start`,
5814
+ { body: request, options }
5815
+ );
5816
+ }
5817
+ async confirmImplication(sessionId, options) {
5818
+ return this.http.requestWithMetadata(
5819
+ "POST",
5820
+ `${BASE30}/attribute-exploration/${sessionId}/confirm`,
5821
+ { options }
5822
+ );
5823
+ }
5824
+ async refuteImplication(sessionId, request, options) {
5825
+ return this.http.requestWithMetadata(
5826
+ "POST",
5827
+ `${BASE30}/attribute-exploration/${sessionId}/refute`,
5828
+ { body: request, options }
5829
+ );
5830
+ }
5831
+ async getExplorationStatus(sessionId, options) {
5832
+ return this.http.requestWithMetadata(
5833
+ "GET",
5834
+ `${BASE30}/attribute-exploration/${sessionId}/status`,
5835
+ { options }
5836
+ );
5837
+ }
5838
+ async completeExploration(sessionId, options) {
5839
+ return this.http.requestWithMetadata(
5840
+ "POST",
5841
+ `${BASE30}/attribute-exploration/${sessionId}/complete`,
5842
+ { options }
5843
+ );
5844
+ }
5845
+ };
5846
+
5847
+ // src/resources/preferences.ts
5848
+ var BASE31 = "/api/v1/preferences";
5849
+ var PreferencesClient = class {
5850
+ /** @internal */
5851
+ http;
5852
+ /** @internal */
5853
+ constructor(http) {
5854
+ this.http = http;
5855
+ }
5856
+ /**
5857
+ * Record a user's term selection for preference learning.
5858
+ *
5859
+ * @param request - Selection to record.
5860
+ * @param options - Per-call request options.
5861
+ * @returns Recording result.
5862
+ */
5863
+ async recordSelection(request, options) {
5864
+ return this.http.post(`${BASE31}/selection`, request, options);
5865
+ }
5866
+ /**
5867
+ * Predict user preferences for candidate terms.
5868
+ *
5869
+ * @param request - Prediction request with candidates.
5870
+ * @param options - Per-call request options.
5871
+ * @returns Predictions sorted by score.
5872
+ */
5873
+ async predict(request, options) {
5874
+ return this.http.post(`${BASE31}/predict`, request, options);
5875
+ }
5876
+ /**
5877
+ * Return a metadata-aware variant of this client.
5878
+ *
5879
+ * @returns A new client instance whose methods return `Promise<ApiResponse<T>>`.
5880
+ */
5881
+ withMetadata() {
5882
+ return new PreferencesClientWithMetadata(this.http);
5883
+ }
5884
+ };
5885
+ var PreferencesClientWithMetadata = class {
5886
+ http;
5887
+ /** @internal */
5888
+ constructor(http) {
5889
+ this.http = http;
5890
+ }
5891
+ async recordSelection(request, options) {
5892
+ return this.http.requestWithMetadata(
5893
+ "POST",
5894
+ `${BASE31}/selection`,
5895
+ { body: request, options }
5896
+ );
5897
+ }
5898
+ async predict(request, options) {
5899
+ return this.http.requestWithMetadata(
5900
+ "POST",
5901
+ `${BASE31}/predict`,
5902
+ { body: request, options }
5903
+ );
5904
+ }
5905
+ };
5906
+
5907
+ // src/client.ts
5908
+ var ReasoningLayerClient = class {
5909
+ /** Sort (type hierarchy) operations. */
5910
+ sorts;
5911
+ /** Psi-term CRUD operations. */
5912
+ terms;
5913
+ /** Inference engine operations (backward/forward chaining, fuzzy, Bayesian, NAF). */
5914
+ inference;
5915
+ /** Query operations (unification, OSF search, validation). */
5916
+ query;
5917
+ /** Cognitive agent operations (BDI cycle, beliefs, goals, messaging). */
5918
+ cognitive;
5919
+ /** Fuzzy operations (unification, merge, subsumption, top-K search). */
5920
+ fuzzy;
5921
+ /** Constraint operations (arithmetic solving, graph visualization). */
4916
5922
  constraints;
4917
5923
  /** Namespace operations (hierarchy, imports, metadata). */
4918
5924
  namespaces;
@@ -4954,6 +5960,16 @@ var ReasoningLayerClient = class {
4954
5960
  discovery;
4955
5961
  /** Entity extraction operations. */
4956
5962
  extract;
5963
+ /** FormalJudge oversight operations (safety verification, refinement). */
5964
+ oversight;
5965
+ /** Categorical Deep Learning operations (differentiable FC, soft unification, safety). */
5966
+ cdl;
5967
+ /** Neuro-symbolic operations (training, embeddings, diagnostics). */
5968
+ neuroSymbolic;
5969
+ /** Analysis and FCA operations (sort discovery, attribute exploration). */
5970
+ analysis;
5971
+ /** Bayesian preference learning operations (selection recording, prediction). */
5972
+ preferences;
4957
5973
  /**
4958
5974
  * Create a new ReasoningLayerClient.
4959
5975
  *
@@ -4965,7 +5981,7 @@ var ReasoningLayerClient = class {
4965
5981
  const resolved = resolveConfig(config);
4966
5982
  const http = new HttpClient(resolved);
4967
5983
  const ws = new WebSocketClient(resolved);
4968
- this.sorts = new SortsClient(http);
5984
+ this.sorts = new SortsClient(http, resolved.tenantId);
4969
5985
  this.terms = new TermsClient(http);
4970
5986
  this.inference = new InferenceClient(http);
4971
5987
  this.query = new QueryClient(http);
@@ -4992,6 +6008,11 @@ var ReasoningLayerClient = class {
4992
6008
  this.actionReviews = new ActionReviewsClient(http);
4993
6009
  this.discovery = new DiscoveryClient(http);
4994
6010
  this.extract = new ExtractClient(http);
6011
+ this.oversight = new OversightClient(http);
6012
+ this.cdl = new CdlClient(http);
6013
+ this.neuroSymbolic = new NeuroSymbolicClient(http);
6014
+ this.analysis = new AnalysisClient(http);
6015
+ this.preferences = new PreferencesClient(http);
4995
6016
  }
4996
6017
  };
4997
6018
 
@@ -5756,6 +6777,20 @@ var SortBuilder = class _SortBuilder {
5756
6777
  };
5757
6778
 
5758
6779
  // src/builders/psi.ts
6780
+ function isPlainObject(v) {
6781
+ return typeof v === "object" && v !== null && !Array.isArray(v);
6782
+ }
6783
+ function coerceObjectFeatures(obj) {
6784
+ const rawFeatures = obj.features;
6785
+ if (!isPlainObject(rawFeatures)) {
6786
+ return void 0;
6787
+ }
6788
+ const coerced = {};
6789
+ for (const [k, v] of Object.entries(rawFeatures)) {
6790
+ coerced[k] = coerceFeatureValue(v);
6791
+ }
6792
+ return coerced;
6793
+ }
5759
6794
  function coerceFeatureValue(value) {
5760
6795
  if (value === null) {
5761
6796
  throw new ValidationError("null is not a valid feature value in psi() shorthand. Use FeatureInput.uninstantiated() for null values.");
@@ -5772,38 +6807,29 @@ function coerceFeatureValue(value) {
5772
6807
  if (Array.isArray(value)) {
5773
6808
  return value.map(coerceFeatureValue);
5774
6809
  }
5775
- if (typeof value === "object") {
5776
- const obj = value;
5777
- if ("term_id" in obj && typeof obj.term_id === "string") {
5778
- return { term_id: obj.term_id };
6810
+ if (isPlainObject(value)) {
6811
+ if ("term_id" in value && typeof value.term_id === "string") {
6812
+ return { term_id: value.term_id };
5779
6813
  }
5780
- if ("name" in obj && typeof obj.name === "string" && "constraint" in obj) {
5781
- return { name: obj.name, constraint: obj.constraint };
6814
+ if ("name" in value && typeof value.name === "string" && "constraint" in value) {
6815
+ return { name: value.name, constraint: value.constraint };
5782
6816
  }
5783
- if ("name" in obj && typeof obj.name === "string") {
5784
- return { name: obj.name };
6817
+ if ("name" in value && typeof value.name === "string") {
6818
+ return { name: value.name };
5785
6819
  }
5786
- if ("sort_name" in obj && typeof obj.sort_name === "string") {
5787
- const features = obj.features;
6820
+ if ("sort_name" in value && typeof value.sort_name === "string") {
6821
+ const features = coerceObjectFeatures(value);
5788
6822
  if (features) {
5789
- const coerced = {};
5790
- for (const [k, v] of Object.entries(features)) {
5791
- coerced[k] = coerceFeatureValue(v);
5792
- }
5793
- return { sort_name: obj.sort_name, features: coerced };
6823
+ return { sort_name: value.sort_name, features };
5794
6824
  }
5795
- return { sort_name: obj.sort_name };
6825
+ return { sort_name: value.sort_name };
5796
6826
  }
5797
- if ("sort_id" in obj && typeof obj.sort_id === "string") {
5798
- const features = obj.features;
6827
+ if ("sort_id" in value && typeof value.sort_id === "string") {
6828
+ const features = coerceObjectFeatures(value);
5799
6829
  if (features) {
5800
- const coerced = {};
5801
- for (const [k, v] of Object.entries(features)) {
5802
- coerced[k] = coerceFeatureValue(v);
5803
- }
5804
- return { sort_id: obj.sort_id, features: coerced };
6830
+ return { sort_id: value.sort_id, features };
5805
6831
  }
5806
- return { sort_id: obj.sort_id };
6832
+ return { sort_id: value.sort_id };
5807
6833
  }
5808
6834
  }
5809
6835
  throw new ValidationError(`Cannot coerce value of type ${typeof value} to FeatureInputValueDto`);
@@ -5855,9 +6881,6 @@ function discriminateFeatureValue(value) {
5855
6881
  );
5856
6882
  }
5857
6883
 
5858
- // src/index.ts
5859
- var SDK_VERSION2 = "0.1.0";
5860
-
5861
- export { ApiError, BadRequestError, ConstraintViolationError, FeatureInput, FuzzyShape, InternalServerError, NetworkError, NotFoundError, RateLimitError, ReasoningLayerClient, ReasoningLayerError, SDK_VERSION2 as SDK_VERSION, SortBuilder, TermInput, TimeoutError, ValidationError, Value, WebSocketClient, WebSocketConnection, allen, discriminateFeatureValue, guard, isUuid, psi };
6884
+ export { ApiError, BadRequestError, ConstraintViolationError, FeatureInput, FuzzyShape, InternalServerError, NetworkError, NotFoundError, RateLimitError, ReasoningLayerClient, ReasoningLayerError, SDK_VERSION, SortBuilder, TermInput, TimeoutError, ValidationError, Value, WebSocketClient, WebSocketConnection, allen, discriminateFeatureValue, guard, isUuid, psi };
5862
6885
  //# sourceMappingURL=index.js.map
5863
6886
  //# sourceMappingURL=index.js.map