@kortexya/reasoninglayer 0.1.3 → 0.1.4

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