@kortexya/reasoninglayer 6.1.0 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -7,7 +7,7 @@ var __export = (target, all) => {
7
7
  };
8
8
 
9
9
  // src/config.ts
10
- var SDK_VERSION = "6.1.0";
10
+ var SDK_VERSION = "6.2.0";
11
11
  function resolveConfig(config) {
12
12
  if (!config.baseUrl) {
13
13
  throw new Error("ClientConfig.baseUrl is required");
@@ -9783,6 +9783,22 @@ var Analysis = class {
9783
9783
  format: "json",
9784
9784
  ...params
9785
9785
  });
9786
+ /**
9787
+ * @description Computes the concepts of the population's schema-presence context under the declared bounds and, when asked, its observed implication basis; the export carries the incidence, the bounds and each result's completeness so an importer can replay all of it.
9788
+ *
9789
+ * @tags analysis
9790
+ * @name ExportFca
9791
+ * @summary Export the FCA of an explicit population.
9792
+ * @request POST:/api/v1/analysis/fca-exports
9793
+ */
9794
+ exportFca = (data, params = {}) => this.http.request({
9795
+ path: `/api/v1/analysis/fca-exports`,
9796
+ method: "POST",
9797
+ body: data,
9798
+ type: "application/json",
9799
+ format: "json",
9800
+ ...params
9801
+ });
9786
9802
  /**
9787
9803
  * No description
9788
9804
  *
@@ -10032,6 +10048,22 @@ var Analysis = class {
10032
10048
  format: "json",
10033
10049
  ...params
10034
10050
  });
10051
+ /**
10052
+ * @description Replays the export natively: decodes its context, recomputes a graded incidence from its degrees and cut, recomputes its concepts and basis under its declared bounds, and requires each claim, completeness included, to equal its recomputation; every object must name a source term of the caller's tenant. A refusal accepts nothing and names its reason.
10053
+ *
10054
+ * @tags analysis
10055
+ * @name VerifyFcaExport
10056
+ * @summary Verify an FCA export for import into the caller's tenant.
10057
+ * @request POST:/api/v1/analysis/fca-exports/verify
10058
+ */
10059
+ verifyFcaExport = (data, params = {}) => this.http.request({
10060
+ path: `/api/v1/analysis/fca-exports/verify`,
10061
+ method: "POST",
10062
+ body: data,
10063
+ type: "application/json",
10064
+ format: "json",
10065
+ ...params
10066
+ });
10035
10067
  };
10036
10068
 
10037
10069
  // src/api-spec/generated/Functions.ts
@@ -20707,6 +20739,7 @@ var RESPONSE_COMPONENTS = {
20707
20739
  document_id: [1, 0],
20708
20740
  entities_extracted: [1, 0],
20709
20741
  entities_refused: [1, { array: "RefusedEntityDto" }],
20742
+ fca_discovery: [2, "FcaIngestionReportDto"],
20710
20743
  processing_time_ms: [1, 0],
20711
20744
  relations_extracted: [1, 0],
20712
20745
  relations_integrated: [1, 0],
@@ -21297,6 +21330,50 @@ var RESPONSE_COMPONENTS = {
21297
21330
  }
21298
21331
  },
21299
21332
  FailedReviewDto: { object: { reason: [1, 0], review_id: [1, 0] } },
21333
+ FcaBasisClaimDto: {
21334
+ object: {
21335
+ complete: [1, 0],
21336
+ implications: [1, { array: "FcaImplicationRecordDto" }],
21337
+ max_candidates: [1, 0],
21338
+ max_work: [1, 0]
21339
+ }
21340
+ },
21341
+ FcaConceptClaimDto: {
21342
+ object: {
21343
+ complete: [1, 0],
21344
+ concepts: [1, { array: "FcaConceptRecordDto" }],
21345
+ max_concepts: [1, 0],
21346
+ max_visited_concepts: [1, 0],
21347
+ max_work: [1, 0],
21348
+ min_extent_size: [1, 0],
21349
+ min_intent_size: [1, 0]
21350
+ }
21351
+ },
21352
+ FcaConceptRecordDto: { object: { extent: [1, { array: 0 }], intent: [1, { array: 0 }] } },
21353
+ FcaContextDto: {
21354
+ object: {
21355
+ attributes: [1, { array: 0 }],
21356
+ incidence: [1, { array: { array: 0 } }],
21357
+ objects: [1, { array: 0 }],
21358
+ version: [1, 0]
21359
+ }
21360
+ },
21361
+ FcaExportDto: {
21362
+ object: {
21363
+ basis: [2, "FcaBasisClaimDto"],
21364
+ concepts: [1, "FcaConceptClaimDto"],
21365
+ context: [1, "FcaContextDto"],
21366
+ graded: [2, "FcaGradedIncidenceDto"],
21367
+ version: [1, 0]
21368
+ }
21369
+ },
21370
+ FcaGradedDegreeDto: { object: { attribute: [1, 0], degree: [1, 0] } },
21371
+ FcaGradedIncidenceDto: {
21372
+ object: { alpha: [1, 0], degrees: [1, { array: { array: "FcaGradedDegreeDto" } }] }
21373
+ },
21374
+ FcaImplicationRecordDto: {
21375
+ object: { conclusion: [1, { array: 0 }], premise: [1, { array: 0 }] }
21376
+ },
21300
21377
  FcaIngestionRecommendationDto: {
21301
21378
  object: {
21302
21379
  confidence: [1, 0],
@@ -26312,6 +26389,9 @@ var RESPONSE_COMPONENTS = {
26312
26389
  }
26313
26390
  },
26314
26391
  VerificationStepDto: { object: { description: [1, 0], name: [1, 0], passed: [1, 0] } },
26392
+ VerifiedFcaImportDto: {
26393
+ object: { concepts: [1, 0], concepts_complete: [1, 0], sources: [1, { array: 0 }] }
26394
+ },
26315
26395
  VerifyClaimResponse: {
26316
26396
  object: {
26317
26397
  contradicting_count: [1, 0],
@@ -27862,6 +27942,11 @@ var RESPONSE_OPERATIONS = {
27862
27942
  path: "/api/v1/dsr/{id}/export",
27863
27943
  responses: { 200: "DsrExportResponse" }
27864
27944
  },
27945
+ exportFca: {
27946
+ method: "POST",
27947
+ path: "/api/v1/analysis/fca-exports",
27948
+ responses: { 200: "FcaExportDto" }
27949
+ },
27865
27950
  exportJsonl: {
27866
27951
  method: "POST",
27867
27952
  path: "/api/v1/synthetic/export-jsonl",
@@ -30635,6 +30720,11 @@ var RESPONSE_OPERATIONS = {
30635
30720
  path: "/api/v1/synthetic/verify-faithfulness",
30636
30721
  responses: { 200: "VerifyFaithfulnessResponse" }
30637
30722
  },
30723
+ verifyFcaExport: {
30724
+ method: "POST",
30725
+ path: "/api/v1/analysis/fca-exports/verify",
30726
+ responses: { 200: "VerifiedFcaImportDto" }
30727
+ },
30638
30728
  verifyIntegrity: {
30639
30729
  method: "POST",
30640
30730
  path: "/api/v1/audit/verify-integrity",
@@ -41355,7 +41445,8 @@ function DocumentStatsDtoFromApiToFront(dto) {
41355
41445
  relationsIntegrated: dto.relations_integrated,
41356
41446
  sortNames: dto.sort_names,
41357
41447
  termIds: dto.term_ids,
41358
- totalTokens: dto.total_tokens
41448
+ totalTokens: dto.total_tokens,
41449
+ fcaDiscovery: dto.fca_discovery ? FcaIngestionReportFromApiToFront(dto.fca_discovery) : void 0
41359
41450
  };
41360
41451
  }
41361
41452
  function SessionStatsResponseFromApiToFront(dto) {
@@ -49782,6 +49873,28 @@ function SortLicenceResponseFromApiToFront(dto) {
49782
49873
  installedRules: dto.installed_rules
49783
49874
  };
49784
49875
  }
49876
+ function FcaExportRequestFromFrontToApi(model) {
49877
+ return {
49878
+ term_ids: model.termIds,
49879
+ max_concepts: model.maxConcepts,
49880
+ min_extent_size: model.minExtentSize,
49881
+ min_intent_size: model.minIntentSize,
49882
+ max_work: model.maxWork,
49883
+ max_visited_concepts: model.maxVisitedConcepts,
49884
+ include_basis: model.includeBasis,
49885
+ basis_max_work: model.basisMaxWork,
49886
+ basis_max_candidates: model.basisMaxCandidates
49887
+ };
49888
+ }
49889
+ function VerifiedFcaImportFromApiToFront(dto) {
49890
+ return {
49891
+ sources: dto.sources,
49892
+ concepts: dto.concepts,
49893
+ conceptsComplete: dto.concepts_complete,
49894
+ implications: dto.implications ?? null,
49895
+ basisComplete: dto.basis_complete ?? null
49896
+ };
49897
+ }
49785
49898
  function ConfluenceConflictDtoFromApiToFront(dto) {
49786
49899
  return {
49787
49900
  kind: dto.kind,
@@ -50097,6 +50210,59 @@ var AnalysisClient = class {
50097
50210
  );
50098
50211
  return decodeResponse(response, SortLicenceResponseFromApiToFront);
50099
50212
  }
50213
+ /**
50214
+ * Export the native FCA of an explicit population.
50215
+ *
50216
+ * @param request - The population and the enumeration (and basis) bounds.
50217
+ * @param requestOptions - Per-call request options.
50218
+ * @returns The replayable export, in its wire form.
50219
+ * @throws {BadRequestError} 400 for an invalid population or budgets beyond
50220
+ * the supported limits.
50221
+ *
50222
+ * @remarks
50223
+ * The engine computes the concepts of the population's schema-presence
50224
+ * context under the declared bounds and, when asked, its observed
50225
+ * implication basis; the export carries the incidence, the bounds and each
50226
+ * result's completeness so an importer can replay all of it with
50227
+ * {@link verifyFcaExport}.
50228
+ *
50229
+ * @example
50230
+ * ```typescript
50231
+ * const exported = await client.analysis.exportFca({ termIds, includeBasis: true });
50232
+ * const verified = await client.analysis.verifyFcaExport(exported);
50233
+ * console.log(verified.concepts, verified.conceptsComplete);
50234
+ * ```
50235
+ */
50236
+ async exportFca(request, requestOptions) {
50237
+ const response = await this.api.exportFca(
50238
+ FcaExportRequestFromFrontToApi(request),
50239
+ toRequestParams(requestOptions)
50240
+ );
50241
+ return decodeResponse(response, (dto) => dto);
50242
+ }
50243
+ /**
50244
+ * Verify an FCA export for import into the caller's tenant.
50245
+ *
50246
+ * @param fcaExport - The export, exactly as {@link exportFca} returned it.
50247
+ * @param requestOptions - Per-call request options.
50248
+ * @returns What native replay reproduced.
50249
+ * @throws {BadRequestError} 400 when the declared bounds or universe exceed
50250
+ * the supported limits.
50251
+ * @throws {ApiError} 422 (`status` 422, `errorCode` `fca_export_refused`) when
50252
+ * a claim, the incidence or the scope does not survive native replay;
50253
+ * nothing is accepted.
50254
+ *
50255
+ * @remarks
50256
+ * The engine decodes the export's context, recomputes a graded incidence
50257
+ * from its degrees and cut, recomputes its concepts and basis under its
50258
+ * declared bounds, and requires each claim, completeness included, to equal
50259
+ * its recomputation; every object must name a source term of the caller's
50260
+ * tenant.
50261
+ */
50262
+ async verifyFcaExport(fcaExport, requestOptions) {
50263
+ const response = await this.api.verifyFcaExport(fcaExport, toRequestParams(requestOptions));
50264
+ return decodeResponse(response, VerifiedFcaImportFromApiToFront);
50265
+ }
50100
50266
  /**
50101
50267
  * Invite a gateway human user to an exploration session.
50102
50268
  *