@kortexya/reasoninglayer 0.14.0 → 0.15.2

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,5 +1,5 @@
1
1
  // src/config.ts
2
- var SDK_VERSION = "0.14.0";
2
+ var SDK_VERSION = "0.15.2";
3
3
  function resolveConfig(config) {
4
4
  if (!config.baseUrl) {
5
5
  throw new Error("ClientConfig.baseUrl is required");
@@ -2425,17 +2425,18 @@ var Ingestion = class {
2425
2425
  ...params
2426
2426
  });
2427
2427
  /**
2428
- * No description
2428
+ * @description Defaults to async dispatch: returns `202` with a session id and the pipeline runs in a background tokio task. Pass `?sync=true` to run the whole pipeline inside the request and get a `201` with the full result — suitable only for small ontologies because the embedding loop dominates wall time on large inputs.
2429
2429
  *
2430
2430
  * @tags ingestion
2431
2431
  * @name IngestRdf
2432
- * @summary Ingest RDF/OWL/SHACL data and convert to OSF
2432
+ * @summary Ingest RDF/OWL/SHACL data and convert to OSF.
2433
2433
  * @request POST:/api/v1/ingest/rdf
2434
2434
  * @secure
2435
2435
  */
2436
- ingestRdf = (data, params = {}) => this.http.request({
2436
+ ingestRdf = (query, data, params = {}) => this.http.request({
2437
2437
  path: `/api/v1/ingest/rdf`,
2438
2438
  method: "POST",
2439
+ query,
2439
2440
  body: data,
2440
2441
  secure: true,
2441
2442
  type: "application/json" /* Json */,
@@ -13206,24 +13207,25 @@ function PipelineQualityStatsDtoFromApiToFront(dto) {
13206
13207
  axiomsDeduplicated: dto.axioms_deduplicated,
13207
13208
  dynamicConfigEntityThreshold: dto.dynamic_config_entity_threshold,
13208
13209
  dynamicConfigRelationThreshold: dto.dynamic_config_relation_threshold,
13209
- fcaConceptsEnumerated: dto.fca_concepts_enumerated,
13210
- fcaConceptsFiltered: dto.fca_concepts_filtered,
13211
- fcaNovelConcepts: dto.fca_novel_concepts,
13212
- fcaSortsCreated: dto.fca_sorts_created,
13210
+ entitiesRejected: dto.entities_rejected,
13211
+ entitiesSortCorrected: dto.entities_sort_corrected,
13212
+ entitiesValidated: dto.entities_validated,
13213
13213
  feedbackAxiomsLearned: dto.feedback_axioms_learned,
13214
13214
  feedbackPipelineAdjustments: dto.feedback_pipeline_adjustments,
13215
+ forwardChainingIssues: dto.forward_chaining_issues,
13216
+ fullyValid: dto.fully_valid,
13215
13217
  hybridIntraBatchDeduped: dto.hybrid_intra_batch_deduped,
13218
+ incompleteEntities: dto.incomplete_entities,
13219
+ inconsistentSorts: dto.inconsistent_sorts,
13220
+ inferenceIterations: dto.inference_iterations,
13216
13221
  inferenceRelationsDeduped: dto.inference_relations_deduped,
13217
13222
  inferenceRulesApplied: dto.inference_rules_applied,
13218
13223
  inferenceRulesFilteredLowConfidence: dto.inference_rules_filtered_low_confidence,
13219
13224
  inferenceRulesInvalidScopeSort: dto.inference_rules_invalid_scope_sort,
13220
13225
  inferenceRulesTotal: dto.inference_rules_total,
13221
- osfEntitiesRejected: dto.osf_entities_rejected,
13222
- osfEntitiesSortCorrected: dto.osf_entities_sort_corrected,
13223
- osfEntitiesValidated: dto.osf_entities_validated,
13224
- osfForwardChainingIssues: dto.osf_forward_chaining_issues,
13225
- osfFullyValid: dto.osf_fully_valid,
13226
- osfIncompleteEntities: dto.osf_incomplete_entities
13226
+ patternRulesPersisted: dto.pattern_rules_persisted,
13227
+ relationsFromInferenceRules: dto.relations_from_inference_rules,
13228
+ relationsInferred: dto.relations_inferred
13227
13229
  };
13228
13230
  }
13229
13231
  function TokenUsageDtoFromApiToFront(dto) {
@@ -13482,8 +13484,8 @@ function DocumentProgressDtoFromApiToFront(dto) {
13482
13484
  extractionStrategy: dto.extraction_strategy,
13483
13485
  inferenceRulesApplied: dto.inference_rules_applied,
13484
13486
  modelName: dto.model_name,
13485
- osfResiduationsCreated: dto.osf_residuations_created,
13486
- osfResiduationsResumed: dto.osf_residuations_resumed,
13487
+ residuationsCreated: dto.residuations_created,
13488
+ residuationsResumed: dto.residuations_resumed,
13487
13489
  referencesResolved: dto.references_resolved,
13488
13490
  referencesUnresolved: dto.references_unresolved,
13489
13491
  relationsExtracted: dto.relations_extracted,
@@ -13493,7 +13495,6 @@ function DocumentProgressDtoFromApiToFront(dto) {
13493
13495
  sortNames: dto.sort_names,
13494
13496
  sortsCreated: dto.sorts_created,
13495
13497
  sortsReused: dto.sorts_reused,
13496
- sortsReusedGlb: dto.sorts_reused_glb,
13497
13498
  sortsReusedSemantic: dto.sorts_reused_semantic,
13498
13499
  startedAt: dto.started_at,
13499
13500
  stepLog: dto.step_log.map(StepLogEntryDtoFromApiToFront),
@@ -13778,7 +13779,10 @@ var IngestionClient = class {
13778
13779
  * @returns Created sorts and terms from the RDF data.
13779
13780
  */
13780
13781
  async ingestRdf(request) {
13781
- const response = await this.api.ingestRdf(IngestRdfRequestFromFrontToApi(request));
13782
+ const response = await this.api.ingestRdf(
13783
+ { sync: request.sync ?? false },
13784
+ IngestRdfRequestFromFrontToApi(request)
13785
+ );
13782
13786
  return IngestRdfResponseFromApiToFront(response.data);
13783
13787
  }
13784
13788
  /**
@@ -15468,7 +15472,10 @@ function SearchStatsDtoFromApiToFront(dto) {
15468
15472
  nodesPruned: dto.nodes_pruned,
15469
15473
  backtracks: dto.backtracks,
15470
15474
  solveTimeMs: dto.solve_time_ms,
15471
- scorerCalls: dto.scorer_calls
15475
+ scorerCalls: dto.scorer_calls,
15476
+ restarts: dto.restarts,
15477
+ learnedClauses: dto.learned_clauses,
15478
+ forcedChoices: dto.forced_choices?.map(ChoiceSelectionFromApiToFront)
15472
15479
  };
15473
15480
  }
15474
15481
  function SpaceSearchRequestFromFrontToApi(model) {
@@ -15476,11 +15483,32 @@ function SpaceSearchRequestFromFrontToApi(model) {
15476
15483
  strategy: model.strategy,
15477
15484
  max_solutions: model.maxSolutions,
15478
15485
  collect_traces: model.collectTraces,
15479
- use_neural_guidance: model.useNeuralGuidance
15486
+ use_neural_guidance: model.useNeuralGuidance,
15487
+ mode: model.mode
15488
+ };
15489
+ }
15490
+ function VariableFeasibilityDtoFromApiToFront(dto) {
15491
+ return {
15492
+ canBeTrue: dto.can_be_true,
15493
+ canBeFalse: dto.can_be_false,
15494
+ verified: dto.verified ?? true
15480
15495
  };
15481
15496
  }
15482
15497
  function SpaceSearchResponseFromApiToFront(dto) {
15498
+ if (dto.kind === "feasibility") {
15499
+ return {
15500
+ kind: "feasibility",
15501
+ variables: Object.fromEntries(
15502
+ Object.entries(dto.variables).map(([name, v]) => [
15503
+ name,
15504
+ VariableFeasibilityDtoFromApiToFront(v)
15505
+ ])
15506
+ ),
15507
+ searchStats: dto.search_stats ? SearchStatsDtoFromApiToFront(dto.search_stats) : dto.search_stats
15508
+ };
15509
+ }
15483
15510
  return {
15511
+ kind: "solutions",
15484
15512
  solutions: dto.solutions.map(SpaceSolutionDtoFromApiToFront),
15485
15513
  count: dto.count,
15486
15514
  searchStats: dto.search_stats ? SearchStatsDtoFromApiToFront(dto.search_stats) : dto.search_stats