@kortexya/reasoninglayer 7.0.0 → 7.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.js CHANGED
@@ -5,7 +5,7 @@ var __export = (target, all) => {
5
5
  };
6
6
 
7
7
  // src/config.ts
8
- var SDK_VERSION = "7.0.0";
8
+ var SDK_VERSION = "7.2.0";
9
9
  function resolveConfig(config) {
10
10
  if (!config.baseUrl) {
11
11
  throw new Error("ClientConfig.baseUrl is required");
@@ -9488,6 +9488,21 @@ var Namespaces = class {
9488
9488
  format: "json",
9489
9489
  ...params
9490
9490
  });
9491
+ /**
9492
+ * No description
9493
+ *
9494
+ * @tags namespaces
9495
+ * @name GetNamespaceAnswerCacheSavings
9496
+ * @request GET:/api/v1/namespaces/{id}/answer-cache-savings
9497
+ * @secure
9498
+ */
9499
+ getNamespaceAnswerCacheSavings = (id, params = {}) => this.http.request({
9500
+ path: `/api/v1/namespaces/${id}/answer-cache-savings`,
9501
+ method: "GET",
9502
+ secure: true,
9503
+ format: "json",
9504
+ ...params
9505
+ });
9491
9506
  /**
9492
9507
  * No description
9493
9508
  *
@@ -16819,7 +16834,7 @@ var Vocabulary = class {
16819
16834
  *
16820
16835
  * @tags vocabulary
16821
16836
  * @name GetVocabularyCollection
16822
- * @summary `GET /api/v1/vocabulary/collections/{collection_id}` — one collection with its labels, its member occurrences and its nested collections.
16837
+ * @summary `GET /api/v1/vocabulary/collections/{collection_id}` — one collection with its labels, its member occurrences, its nested collections and its documentation notes.
16823
16838
  * @request GET:/api/v1/vocabulary/collections/{collection_id}
16824
16839
  * @secure
16825
16840
  */
@@ -16922,7 +16937,7 @@ var Vocabulary = class {
16922
16937
  *
16923
16938
  * @tags vocabulary
16924
16939
  * @name ListSchemes
16925
- * @summary `GET /api/v1/vocabulary/schemes` — the schemes of a view.
16940
+ * @summary `GET /api/v1/vocabulary/schemes` — the schemes of a view, each with its languages and its documentation notes.
16926
16941
  * @request GET:/api/v1/vocabulary/schemes
16927
16942
  * @secure
16928
16943
  */
@@ -17875,7 +17890,8 @@ function FeatureDescriptorDtoFromApiToFront(dto) {
17875
17890
  minCount: dto.min_count ?? void 0,
17876
17891
  maxCount: dto.max_count ?? void 0,
17877
17892
  cardinalityOrigin: dto.cardinality_origin ?? void 0,
17878
- annotations: definedRecord2(dto.annotations)
17893
+ annotations: definedRecord2(dto.annotations),
17894
+ rangeConjunction: dto.range_conjunction
17879
17895
  };
17880
17896
  }
17881
17897
  function FeatureDescriptorDtoFromFrontToApi(model) {
@@ -20054,6 +20070,7 @@ var RESPONSE_COMPONENTS = {
20054
20070
  object: {
20055
20071
  collection: [1, "CollectionRecordDto"],
20056
20072
  context: [2, "ContextRefDto"],
20073
+ documentation: [1, { array: "DocumentationRecordDto" }],
20057
20074
  labels: [1, { array: "CollectionLabelViewDto" }],
20058
20075
  members: [1, { array: "CollectionMemberViewDto" }],
20059
20076
  nested_collections: [1, { array: 0 }],
@@ -20246,14 +20263,16 @@ var RESPONSE_COMPONENTS = {
20246
20263
  term_versions: [1, { array: "TermVersionEntryDto" }]
20247
20264
  }
20248
20265
  },
20249
- ConceptMappingRecordDto: {
20266
+ ConceptMappingViewDto: {
20250
20267
  object: {
20251
20268
  change_reason: [1, 0],
20252
20269
  mapping_kind: [1, 0],
20253
20270
  record_id: [1, 0],
20254
20271
  revision: [1, 0],
20255
20272
  status: [1, 0],
20256
- subject: [1, 0]
20273
+ subject: [1, 0],
20274
+ target_display_label: [2, "DisplayLabelDto"],
20275
+ target_external_concept: [2, "ExternalConceptRecordDto"]
20257
20276
  }
20258
20277
  },
20259
20278
  ConceptMatchDto: {
@@ -20368,12 +20387,12 @@ var RESPONSE_COMPONENTS = {
20368
20387
  evidence: [1, { array: "EvidenceViewDto" }],
20369
20388
  identity_decisions: [1, { array: "IdentityDecisionRecordDto" }],
20370
20389
  labels: [1, { array: "LabelUseViewDto" }],
20371
- mappings: [1, { array: "ConceptMappingRecordDto" }],
20390
+ mappings: [1, { array: "ConceptMappingViewDto" }],
20372
20391
  memberships: [1, { array: "MembershipViewDto" }],
20373
20392
  notations: [1, { array: "NotationRecordDto" }],
20374
20393
  relations: [1, { array: "ConceptRelationRecordDto" }],
20375
20394
  source_associations: [1, { array: "SourceAssociationRecordDto" }],
20376
- xl_labels: [1, { array: "XlLabelRecordDto" }]
20395
+ xl_labels: [1, { array: "XlLabelViewDto" }]
20377
20396
  }
20378
20397
  },
20379
20398
  ConditionalIndependenceResponse: { object: { explanation: [1, 0], independent: [1, 0] } },
@@ -21427,7 +21446,8 @@ var RESPONSE_COMPONENTS = {
21427
21446
  relations_integrated: [1, 0],
21428
21447
  sort_names: [1, { array: 0 }],
21429
21448
  term_ids: [1, { array: 0 }],
21430
- total_tokens: [1, 0]
21449
+ total_tokens: [1, 0],
21450
+ work_cache: [2, "IngestionWorkCacheDto"]
21431
21451
  }
21432
21452
  },
21433
21453
  DocumentStatusCounts: {
@@ -21916,6 +21936,17 @@ var RESPONSE_COMPONENTS = {
21916
21936
  webhook_url: [1, 0]
21917
21937
  }
21918
21938
  },
21939
+ ExternalConceptRecordDto: {
21940
+ object: {
21941
+ authority: [1, 0],
21942
+ change_reason: [1, 0],
21943
+ dataset_version: [1, 0],
21944
+ iri: [1, 0],
21945
+ record_id: [1, 0],
21946
+ resolution: [1, 0],
21947
+ revision: [1, 0]
21948
+ }
21949
+ },
21919
21950
  ExternalMatchDto: { object: { match_type: [1, 0], ontology_id: [1, 0], source: [1, 0] } },
21920
21951
  ExternalMatchProposalDto: {
21921
21952
  object: {
@@ -22040,6 +22071,7 @@ var RESPONSE_COMPONENTS = {
22040
22071
  object: {
22041
22072
  annotations: [0, { object: {} }],
22042
22073
  name: [1, 0],
22074
+ range_conjunction: [0, { array: 0 }],
22043
22075
  declared_by: [1, { array: 0 }],
22044
22076
  signature: [1, 0]
22045
22077
  }
@@ -22147,7 +22179,13 @@ var RESPONSE_COMPONENTS = {
22147
22179
  },
22148
22180
  FeatureBindingDto: { object: { name: [1, 0], value: [1, 0] } },
22149
22181
  FeatureChangeDto: { object: { feature: [1, 0] } },
22150
- FeatureDescriptorDto: { object: { annotations: [0, { object: {} }], name: [1, 0] } },
22182
+ FeatureDescriptorDto: {
22183
+ object: {
22184
+ annotations: [0, { object: {} }],
22185
+ name: [1, 0],
22186
+ range_conjunction: [0, { array: 0 }]
22187
+ }
22188
+ },
22151
22189
  FeatureDiff: { object: { change: [1, 0], feature: [1, 0] } },
22152
22190
  FeatureFilterDto: { object: { name: [1, 0], value: [1, 0] } },
22153
22191
  FeatureMismatchDto: {
@@ -23078,7 +23116,16 @@ var RESPONSE_COMPONENTS = {
23078
23116
  sorts_reused: [1, 0],
23079
23117
  sota_extraction_gate: [0, "SotaExtractionGateStatsDto"],
23080
23118
  term_ids: [1, { array: 0 }],
23081
- token_usage: [0, "TokenUsageDto"]
23119
+ token_usage: [0, "TokenUsageDto"],
23120
+ work_cache: [0, "IngestionWorkCacheDto"]
23121
+ }
23122
+ },
23123
+ IngestionWorkCacheDto: {
23124
+ object: {
23125
+ model_calls: [1, 0],
23126
+ reused_model_calls: [1, 0],
23127
+ reused_recorded_token_usage: [1, "TokenUsageDto"],
23128
+ unkeyed_model_calls: [1, 0]
23082
23129
  }
23083
23130
  },
23084
23131
  InheritedFeatureChangeDto: {
@@ -23270,6 +23317,15 @@ var RESPONSE_COMPONENTS = {
23270
23317
  wake_trigger: [1, 0]
23271
23318
  }
23272
23319
  },
23320
+ LabelRelationViewDto: {
23321
+ object: {
23322
+ object: [1, 0],
23323
+ record_id: [1, 0],
23324
+ relation: [1, 0],
23325
+ subject: [1, 0],
23326
+ other_xl_label_id: [1, 0]
23327
+ }
23328
+ },
23273
23329
  LabelSearchHitDto: {
23274
23330
  object: {
23275
23331
  concept_id: [1, 0],
@@ -24199,6 +24255,18 @@ var RESPONSE_COMPONENTS = {
24199
24255
  NamespaceAnswerCachePolicyDto: {
24200
24256
  object: { enabled: [1, 0], revision: [1, 0], ttl_seconds: [1, 0] }
24201
24257
  },
24258
+ NamespaceAnswerCacheSavingsDto: {
24259
+ object: {
24260
+ bypassed: [1, 0],
24261
+ counted_since: [1, 0],
24262
+ disabled: [1, 0],
24263
+ fresh_model_calls: [1, 0],
24264
+ reused_model_calls: [1, 0],
24265
+ token_usage_measured: [1, 0],
24266
+ unavailable: [1, 0],
24267
+ unqualified: [1, 0]
24268
+ }
24269
+ },
24202
24270
  NamespaceDto: {
24203
24271
  object: { id: [1, 0], name: [1, 0], path: [1, 0], tags: [1, { array: 0 }], visibility: [1, 0] }
24204
24272
  },
@@ -25983,6 +26051,7 @@ var RESPONSE_COMPONENTS = {
25983
26051
  SchemeViewDto: {
25984
26052
  object: {
25985
26053
  display_name: [1, 0],
26054
+ documentation: [1, { array: "DocumentationRecordDto" }],
25986
26055
  languages: [1, { array: "SchemeLanguageViewDto" }],
25987
26056
  purpose: [1, 0],
25988
26057
  revision: [1, 0],
@@ -27640,7 +27709,7 @@ var RESPONSE_COMPONENTS = {
27640
27709
  }
27641
27710
  },
27642
27711
  WorldModelTransitionDto: { object: { probability: [1, 0] } },
27643
- XlLabelRecordDto: {
27712
+ XlLabelViewDto: {
27644
27713
  object: {
27645
27714
  change_reason: [1, 0],
27646
27715
  concept: [1, 0],
@@ -27649,7 +27718,9 @@ var RESPONSE_COMPONENTS = {
27649
27718
  resource_key: [1, 0],
27650
27719
  revision: [1, 0],
27651
27720
  role: [1, 0],
27652
- scheme: [1, 0]
27721
+ scheme: [1, 0],
27722
+ incoming_relations: [1, { array: "LabelRelationViewDto" }],
27723
+ outgoing_relations: [1, { array: "LabelRelationViewDto" }]
27653
27724
  }
27654
27725
  },
27655
27726
  YankResponse: { object: { plugin_id: [1, 0], yanked: [1, 0] } }
@@ -29550,6 +29621,11 @@ var RESPONSE_OPERATIONS = {
29550
29621
  path: "/api/v1/namespaces/{id}/answer-cache-policy",
29551
29622
  responses: { 200: "NamespaceAnswerCachePolicyDto" }
29552
29623
  },
29624
+ getNamespaceAnswerCacheSavings: {
29625
+ method: "GET",
29626
+ path: "/api/v1/namespaces/{id}/answer-cache-savings",
29627
+ responses: { 200: "NamespaceAnswerCacheSavingsDto" }
29628
+ },
29553
29629
  getNamespaceByPath: {
29554
29630
  method: "GET",
29555
29631
  path: "/api/v1/namespaces/path/{tenant_id}/{path}",
@@ -39121,6 +39197,18 @@ function NamespaceListResponseFromApiToFront(dto) {
39121
39197
  function UpdateNamespaceAnswerCachePolicyRequestFromFrontToApi(model) {
39122
39198
  return { enabled: model.enabled, ttl_seconds: model.ttlSeconds };
39123
39199
  }
39200
+ function NamespaceAnswerCacheSavingsDtoFromApiToFront(dto) {
39201
+ return {
39202
+ countedSince: dto.counted_since,
39203
+ freshModelCalls: dto.fresh_model_calls,
39204
+ reusedModelCalls: dto.reused_model_calls,
39205
+ bypassed: dto.bypassed,
39206
+ disabled: dto.disabled,
39207
+ unavailable: dto.unavailable,
39208
+ unqualified: dto.unqualified,
39209
+ tokenUsageMeasured: dto.token_usage_measured
39210
+ };
39211
+ }
39124
39212
  function NamespaceAnswerCachePolicyDtoFromApiToFront(dto) {
39125
39213
  return {
39126
39214
  enabled: dto.enabled,
@@ -39189,6 +39277,34 @@ var NamespacesClient = class {
39189
39277
  );
39190
39278
  return decodeResponse(response, NamespaceAnswerCachePolicyDtoFromApiToFront);
39191
39279
  }
39280
+ /**
39281
+ * Read the answer-cache outcomes the engine counted for a namespace.
39282
+ *
39283
+ * @param namespaceId - Namespace UUID.
39284
+ * @param requestOptions - Per-call options (timeout, retries, signal, headers).
39285
+ * @returns The counters of this engine process since `countedSince`.
39286
+ * @throws {ForbiddenError} 403 without a native `manage_answer_cache` grant.
39287
+ * @throws {NotFoundError} 404 for a namespace not in this tenant.
39288
+ * @throws {ServiceUnavailableError} 503 when the namespace state or authority is unavailable.
39289
+ *
39290
+ * @remarks
39291
+ * `GET /api/v1/namespaces/{id}/answer-cache-savings`. The counters are
39292
+ * process-local and not durable; token savings are not measured
39293
+ * (`tokenUsageMeasured: false`). Response mapped from snake_case.
39294
+ *
39295
+ * @example
39296
+ * ```typescript
39297
+ * const savings = await client.namespaces.getAnswerCacheSavings(namespaceId);
39298
+ * console.log(savings.reusedModelCalls, 'of', savings.freshModelCalls + savings.reusedModelCalls);
39299
+ * ```
39300
+ */
39301
+ async getAnswerCacheSavings(namespaceId, requestOptions) {
39302
+ const response = await this.api.getNamespaceAnswerCacheSavings(
39303
+ namespaceId,
39304
+ toRequestParams(requestOptions)
39305
+ );
39306
+ return decodeResponse(response, NamespaceAnswerCacheSavingsDtoFromApiToFront);
39307
+ }
39192
39308
  /** Save settings in OSFKB; policy validation and cache admission stay in the engine. */
39193
39309
  async updateAnswerCachePolicy(namespaceId, request, requestOptions) {
39194
39310
  const response = await this.api.updateNamespaceAnswerCachePolicy(
@@ -42103,6 +42219,14 @@ function TokenUsageDtoFromApiToFront(dto) {
42103
42219
  totalTokens: dto.total_tokens
42104
42220
  };
42105
42221
  }
42222
+ function IngestionWorkCacheDtoFromApiToFront(dto) {
42223
+ return {
42224
+ modelCalls: dto.model_calls,
42225
+ reusedModelCalls: dto.reused_model_calls,
42226
+ unkeyedModelCalls: dto.unkeyed_model_calls,
42227
+ reusedRecordedTokenUsage: TokenUsageDtoFromApiToFront(dto.reused_recorded_token_usage)
42228
+ };
42229
+ }
42106
42230
  function AlignmentStatsDtoFromApiToFront(dto) {
42107
42231
  return {
42108
42232
  avgFuzzyRatio: dto.avg_fuzzy_ratio,
@@ -42200,6 +42324,7 @@ function IngestionStatsDtoFromApiToFront(dto) {
42200
42324
  sotaExtractionGate: dto.sota_extraction_gate ? SotaExtractionGateStatsDtoFromApiToFront(dto.sota_extraction_gate) : void 0,
42201
42325
  termIds: dto.term_ids,
42202
42326
  tokenUsage: dto.token_usage ? TokenUsageDtoFromApiToFront(dto.token_usage) : void 0,
42327
+ workCache: dto.work_cache ? IngestionWorkCacheDtoFromApiToFront(dto.work_cache) : void 0,
42203
42328
  fcaDiscovery: dto.fca_discovery ? FcaIngestionReportFromApiToFront(dto.fca_discovery) : void 0
42204
42329
  };
42205
42330
  }
@@ -42612,7 +42737,8 @@ function DocumentStatsDtoFromApiToFront(dto) {
42612
42737
  sortNames: dto.sort_names,
42613
42738
  termIds: dto.term_ids,
42614
42739
  totalTokens: dto.total_tokens,
42615
- fcaDiscovery: dto.fca_discovery ? FcaIngestionReportFromApiToFront(dto.fca_discovery) : void 0
42740
+ fcaDiscovery: dto.fca_discovery ? FcaIngestionReportFromApiToFront(dto.fca_discovery) : void 0,
42741
+ workCache: dto.work_cache ? IngestionWorkCacheDtoFromApiToFront(dto.work_cache) : void 0
42616
42742
  };
42617
42743
  }
42618
42744
  function SessionStatsResponseFromApiToFront(dto) {
@@ -51137,8 +51263,7 @@ var AnalysisClient = class {
51137
51263
  * the first question, and the search report.
51138
51264
  * @throws {ForbiddenError} 403 with code `exploration_actor_required` when
51139
51265
  * the request carries no gateway human actor (`authenticatedUser`).
51140
- * @throws {BadRequestError} 400 for an unknown sort name, a refused
51141
- * population bound (`exploration_population_limit`), native-predicate
51266
+ * @throws {BadRequestError} 400 for an unknown sort name, native-predicate
51142
51267
  * semantics, or a scaled interpretation that is not complete.
51143
51268
  *
51144
51269
  * @remarks
@@ -51273,8 +51398,8 @@ var AnalysisClient = class {
51273
51398
  *
51274
51399
  * @param sessionId - Exploration session ID.
51275
51400
  * @param request - The bounds of this search step (`maxWork`,
51276
- * `maxCandidates`, `searchTimeoutMs`); each omitted bound takes the
51277
- * engine default.
51401
+ * `maxCandidates`, `searchTimeoutMs`); an omitted or `null` bound is
51402
+ * unbounded.
51278
51403
  * @param requestOptions - Per-call request options.
51279
51404
  * @returns The next question (absent when the search stopped again or was
51280
51405
  * exhausted), the progress, and the search report.
@@ -71404,7 +71529,8 @@ function SchemeViewFromApiToFront(dto) {
71404
71529
  revision: dto.revision,
71405
71530
  displayName: dto.display_name,
71406
71531
  purpose: dto.purpose,
71407
- languages: dto.languages.map(SchemeLanguageViewFromApiToFront)
71532
+ languages: dto.languages.map(SchemeLanguageViewFromApiToFront),
71533
+ documentation: dto.documentation.map(VocabularyDocumentationRecordFromApiToFront)
71408
71534
  };
71409
71535
  if (present(dto.scope_note)) out.scopeNote = dto.scope_note;
71410
71536
  if (present(dto.exclusions)) out.exclusions = dto.exclusions;
@@ -71489,6 +71615,38 @@ function DefinitionGuidanceFromApiToFront(dto) {
71489
71615
  parentEdgeCreated: dto.parent_edge_created
71490
71616
  };
71491
71617
  }
71618
+ function LabelRelationViewFromApiToFront(dto) {
71619
+ const out = {
71620
+ ...VocabularyLabelRelationRecordFromApiToFront(dto),
71621
+ otherXlLabelId: dto.other_xl_label_id
71622
+ };
71623
+ if (present(dto.other_resource_key)) out.otherResourceKey = dto.other_resource_key;
71624
+ if (present(dto.other_text)) out.otherText = dto.other_text;
71625
+ if (present(dto.other_language)) out.otherLanguage = dto.other_language;
71626
+ return out;
71627
+ }
71628
+ function XlLabelViewFromApiToFront(dto) {
71629
+ const out = {
71630
+ ...VocabularyXlLabelRecordFromApiToFront(dto),
71631
+ outgoingRelations: dto.outgoing_relations.map(LabelRelationViewFromApiToFront),
71632
+ incomingRelations: dto.incoming_relations.map(LabelRelationViewFromApiToFront)
71633
+ };
71634
+ if (present(dto.text)) out.text = dto.text;
71635
+ if (present(dto.language)) out.language = dto.language;
71636
+ return out;
71637
+ }
71638
+ function ConceptMappingViewFromApiToFront(dto) {
71639
+ const out = VocabularyConceptMappingRecordFromApiToFront(dto);
71640
+ if (present(dto.target_external_concept)) {
71641
+ out.targetExternalConcept = VocabularyExternalConceptRecordFromApiToFront(
71642
+ dto.target_external_concept
71643
+ );
71644
+ }
71645
+ if (present(dto.target_display_label)) {
71646
+ out.targetDisplayLabel = VocabularyDisplayLabelFromApiToFront(dto.target_display_label);
71647
+ }
71648
+ return out;
71649
+ }
71492
71650
  function ConceptViewFromApiToFront(dto) {
71493
71651
  const out = {
71494
71652
  concept: VocabularyConceptRecordFromApiToFront(dto.concept),
@@ -71503,10 +71661,10 @@ function ConceptViewFromApiToFront(dto) {
71503
71661
  ),
71504
71662
  aboutness: dto.aboutness.map(VocabularyAboutnessRecordFromApiToFront),
71505
71663
  relations: dto.relations.map(VocabularyConceptRelationRecordFromApiToFront),
71506
- mappings: dto.mappings.map(VocabularyConceptMappingRecordFromApiToFront),
71664
+ mappings: dto.mappings.map(ConceptMappingViewFromApiToFront),
71507
71665
  documentation: dto.documentation.map(VocabularyDocumentationRecordFromApiToFront),
71508
71666
  notations: dto.notations.map(VocabularyNotationRecordFromApiToFront),
71509
- xlLabels: dto.xl_labels.map(VocabularyXlLabelRecordFromApiToFront),
71667
+ xlLabels: dto.xl_labels.map(XlLabelViewFromApiToFront),
71510
71668
  collections: dto.collections,
71511
71669
  sourceAssociations: dto.source_associations.map(
71512
71670
  VocabularySourceAssociationRecordFromApiToFront
@@ -72113,7 +72271,8 @@ function VocabularyCollectionDetailFromApiToFront(dto) {
72113
72271
  collection: VocabularyCollectionRecordFromApiToFront(dto.collection),
72114
72272
  labels: dto.labels.map(CollectionLabelViewFromApiToFront),
72115
72273
  members: dto.members.map(CollectionMemberViewFromApiToFront),
72116
- nestedCollections: dto.nested_collections
72274
+ nestedCollections: dto.nested_collections,
72275
+ documentation: dto.documentation.map(VocabularyDocumentationRecordFromApiToFront)
72117
72276
  };
72118
72277
  if (present(dto.context)) out.context = VocabularyContextRefFromApiToFront(dto.context);
72119
72278
  return out;