@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.cjs CHANGED
@@ -7,7 +7,7 @@ var __export = (target, all) => {
7
7
  };
8
8
 
9
9
  // src/config.ts
10
- var SDK_VERSION = "7.0.0";
10
+ var SDK_VERSION = "7.2.0";
11
11
  function resolveConfig(config) {
12
12
  if (!config.baseUrl) {
13
13
  throw new Error("ClientConfig.baseUrl is required");
@@ -9490,6 +9490,21 @@ var Namespaces = class {
9490
9490
  format: "json",
9491
9491
  ...params
9492
9492
  });
9493
+ /**
9494
+ * No description
9495
+ *
9496
+ * @tags namespaces
9497
+ * @name GetNamespaceAnswerCacheSavings
9498
+ * @request GET:/api/v1/namespaces/{id}/answer-cache-savings
9499
+ * @secure
9500
+ */
9501
+ getNamespaceAnswerCacheSavings = (id, params = {}) => this.http.request({
9502
+ path: `/api/v1/namespaces/${id}/answer-cache-savings`,
9503
+ method: "GET",
9504
+ secure: true,
9505
+ format: "json",
9506
+ ...params
9507
+ });
9493
9508
  /**
9494
9509
  * No description
9495
9510
  *
@@ -16821,7 +16836,7 @@ var Vocabulary = class {
16821
16836
  *
16822
16837
  * @tags vocabulary
16823
16838
  * @name GetVocabularyCollection
16824
- * @summary `GET /api/v1/vocabulary/collections/{collection_id}` — one collection with its labels, its member occurrences and its nested collections.
16839
+ * @summary `GET /api/v1/vocabulary/collections/{collection_id}` — one collection with its labels, its member occurrences, its nested collections and its documentation notes.
16825
16840
  * @request GET:/api/v1/vocabulary/collections/{collection_id}
16826
16841
  * @secure
16827
16842
  */
@@ -16924,7 +16939,7 @@ var Vocabulary = class {
16924
16939
  *
16925
16940
  * @tags vocabulary
16926
16941
  * @name ListSchemes
16927
- * @summary `GET /api/v1/vocabulary/schemes` — the schemes of a view.
16942
+ * @summary `GET /api/v1/vocabulary/schemes` — the schemes of a view, each with its languages and its documentation notes.
16928
16943
  * @request GET:/api/v1/vocabulary/schemes
16929
16944
  * @secure
16930
16945
  */
@@ -17877,7 +17892,8 @@ function FeatureDescriptorDtoFromApiToFront(dto) {
17877
17892
  minCount: dto.min_count ?? void 0,
17878
17893
  maxCount: dto.max_count ?? void 0,
17879
17894
  cardinalityOrigin: dto.cardinality_origin ?? void 0,
17880
- annotations: definedRecord2(dto.annotations)
17895
+ annotations: definedRecord2(dto.annotations),
17896
+ rangeConjunction: dto.range_conjunction
17881
17897
  };
17882
17898
  }
17883
17899
  function FeatureDescriptorDtoFromFrontToApi(model) {
@@ -20056,6 +20072,7 @@ var RESPONSE_COMPONENTS = {
20056
20072
  object: {
20057
20073
  collection: [1, "CollectionRecordDto"],
20058
20074
  context: [2, "ContextRefDto"],
20075
+ documentation: [1, { array: "DocumentationRecordDto" }],
20059
20076
  labels: [1, { array: "CollectionLabelViewDto" }],
20060
20077
  members: [1, { array: "CollectionMemberViewDto" }],
20061
20078
  nested_collections: [1, { array: 0 }],
@@ -20248,14 +20265,16 @@ var RESPONSE_COMPONENTS = {
20248
20265
  term_versions: [1, { array: "TermVersionEntryDto" }]
20249
20266
  }
20250
20267
  },
20251
- ConceptMappingRecordDto: {
20268
+ ConceptMappingViewDto: {
20252
20269
  object: {
20253
20270
  change_reason: [1, 0],
20254
20271
  mapping_kind: [1, 0],
20255
20272
  record_id: [1, 0],
20256
20273
  revision: [1, 0],
20257
20274
  status: [1, 0],
20258
- subject: [1, 0]
20275
+ subject: [1, 0],
20276
+ target_display_label: [2, "DisplayLabelDto"],
20277
+ target_external_concept: [2, "ExternalConceptRecordDto"]
20259
20278
  }
20260
20279
  },
20261
20280
  ConceptMatchDto: {
@@ -20370,12 +20389,12 @@ var RESPONSE_COMPONENTS = {
20370
20389
  evidence: [1, { array: "EvidenceViewDto" }],
20371
20390
  identity_decisions: [1, { array: "IdentityDecisionRecordDto" }],
20372
20391
  labels: [1, { array: "LabelUseViewDto" }],
20373
- mappings: [1, { array: "ConceptMappingRecordDto" }],
20392
+ mappings: [1, { array: "ConceptMappingViewDto" }],
20374
20393
  memberships: [1, { array: "MembershipViewDto" }],
20375
20394
  notations: [1, { array: "NotationRecordDto" }],
20376
20395
  relations: [1, { array: "ConceptRelationRecordDto" }],
20377
20396
  source_associations: [1, { array: "SourceAssociationRecordDto" }],
20378
- xl_labels: [1, { array: "XlLabelRecordDto" }]
20397
+ xl_labels: [1, { array: "XlLabelViewDto" }]
20379
20398
  }
20380
20399
  },
20381
20400
  ConditionalIndependenceResponse: { object: { explanation: [1, 0], independent: [1, 0] } },
@@ -21429,7 +21448,8 @@ var RESPONSE_COMPONENTS = {
21429
21448
  relations_integrated: [1, 0],
21430
21449
  sort_names: [1, { array: 0 }],
21431
21450
  term_ids: [1, { array: 0 }],
21432
- total_tokens: [1, 0]
21451
+ total_tokens: [1, 0],
21452
+ work_cache: [2, "IngestionWorkCacheDto"]
21433
21453
  }
21434
21454
  },
21435
21455
  DocumentStatusCounts: {
@@ -21918,6 +21938,17 @@ var RESPONSE_COMPONENTS = {
21918
21938
  webhook_url: [1, 0]
21919
21939
  }
21920
21940
  },
21941
+ ExternalConceptRecordDto: {
21942
+ object: {
21943
+ authority: [1, 0],
21944
+ change_reason: [1, 0],
21945
+ dataset_version: [1, 0],
21946
+ iri: [1, 0],
21947
+ record_id: [1, 0],
21948
+ resolution: [1, 0],
21949
+ revision: [1, 0]
21950
+ }
21951
+ },
21921
21952
  ExternalMatchDto: { object: { match_type: [1, 0], ontology_id: [1, 0], source: [1, 0] } },
21922
21953
  ExternalMatchProposalDto: {
21923
21954
  object: {
@@ -22042,6 +22073,7 @@ var RESPONSE_COMPONENTS = {
22042
22073
  object: {
22043
22074
  annotations: [0, { object: {} }],
22044
22075
  name: [1, 0],
22076
+ range_conjunction: [0, { array: 0 }],
22045
22077
  declared_by: [1, { array: 0 }],
22046
22078
  signature: [1, 0]
22047
22079
  }
@@ -22149,7 +22181,13 @@ var RESPONSE_COMPONENTS = {
22149
22181
  },
22150
22182
  FeatureBindingDto: { object: { name: [1, 0], value: [1, 0] } },
22151
22183
  FeatureChangeDto: { object: { feature: [1, 0] } },
22152
- FeatureDescriptorDto: { object: { annotations: [0, { object: {} }], name: [1, 0] } },
22184
+ FeatureDescriptorDto: {
22185
+ object: {
22186
+ annotations: [0, { object: {} }],
22187
+ name: [1, 0],
22188
+ range_conjunction: [0, { array: 0 }]
22189
+ }
22190
+ },
22153
22191
  FeatureDiff: { object: { change: [1, 0], feature: [1, 0] } },
22154
22192
  FeatureFilterDto: { object: { name: [1, 0], value: [1, 0] } },
22155
22193
  FeatureMismatchDto: {
@@ -23080,7 +23118,16 @@ var RESPONSE_COMPONENTS = {
23080
23118
  sorts_reused: [1, 0],
23081
23119
  sota_extraction_gate: [0, "SotaExtractionGateStatsDto"],
23082
23120
  term_ids: [1, { array: 0 }],
23083
- token_usage: [0, "TokenUsageDto"]
23121
+ token_usage: [0, "TokenUsageDto"],
23122
+ work_cache: [0, "IngestionWorkCacheDto"]
23123
+ }
23124
+ },
23125
+ IngestionWorkCacheDto: {
23126
+ object: {
23127
+ model_calls: [1, 0],
23128
+ reused_model_calls: [1, 0],
23129
+ reused_recorded_token_usage: [1, "TokenUsageDto"],
23130
+ unkeyed_model_calls: [1, 0]
23084
23131
  }
23085
23132
  },
23086
23133
  InheritedFeatureChangeDto: {
@@ -23272,6 +23319,15 @@ var RESPONSE_COMPONENTS = {
23272
23319
  wake_trigger: [1, 0]
23273
23320
  }
23274
23321
  },
23322
+ LabelRelationViewDto: {
23323
+ object: {
23324
+ object: [1, 0],
23325
+ record_id: [1, 0],
23326
+ relation: [1, 0],
23327
+ subject: [1, 0],
23328
+ other_xl_label_id: [1, 0]
23329
+ }
23330
+ },
23275
23331
  LabelSearchHitDto: {
23276
23332
  object: {
23277
23333
  concept_id: [1, 0],
@@ -24201,6 +24257,18 @@ var RESPONSE_COMPONENTS = {
24201
24257
  NamespaceAnswerCachePolicyDto: {
24202
24258
  object: { enabled: [1, 0], revision: [1, 0], ttl_seconds: [1, 0] }
24203
24259
  },
24260
+ NamespaceAnswerCacheSavingsDto: {
24261
+ object: {
24262
+ bypassed: [1, 0],
24263
+ counted_since: [1, 0],
24264
+ disabled: [1, 0],
24265
+ fresh_model_calls: [1, 0],
24266
+ reused_model_calls: [1, 0],
24267
+ token_usage_measured: [1, 0],
24268
+ unavailable: [1, 0],
24269
+ unqualified: [1, 0]
24270
+ }
24271
+ },
24204
24272
  NamespaceDto: {
24205
24273
  object: { id: [1, 0], name: [1, 0], path: [1, 0], tags: [1, { array: 0 }], visibility: [1, 0] }
24206
24274
  },
@@ -25985,6 +26053,7 @@ var RESPONSE_COMPONENTS = {
25985
26053
  SchemeViewDto: {
25986
26054
  object: {
25987
26055
  display_name: [1, 0],
26056
+ documentation: [1, { array: "DocumentationRecordDto" }],
25988
26057
  languages: [1, { array: "SchemeLanguageViewDto" }],
25989
26058
  purpose: [1, 0],
25990
26059
  revision: [1, 0],
@@ -27642,7 +27711,7 @@ var RESPONSE_COMPONENTS = {
27642
27711
  }
27643
27712
  },
27644
27713
  WorldModelTransitionDto: { object: { probability: [1, 0] } },
27645
- XlLabelRecordDto: {
27714
+ XlLabelViewDto: {
27646
27715
  object: {
27647
27716
  change_reason: [1, 0],
27648
27717
  concept: [1, 0],
@@ -27651,7 +27720,9 @@ var RESPONSE_COMPONENTS = {
27651
27720
  resource_key: [1, 0],
27652
27721
  revision: [1, 0],
27653
27722
  role: [1, 0],
27654
- scheme: [1, 0]
27723
+ scheme: [1, 0],
27724
+ incoming_relations: [1, { array: "LabelRelationViewDto" }],
27725
+ outgoing_relations: [1, { array: "LabelRelationViewDto" }]
27655
27726
  }
27656
27727
  },
27657
27728
  YankResponse: { object: { plugin_id: [1, 0], yanked: [1, 0] } }
@@ -29552,6 +29623,11 @@ var RESPONSE_OPERATIONS = {
29552
29623
  path: "/api/v1/namespaces/{id}/answer-cache-policy",
29553
29624
  responses: { 200: "NamespaceAnswerCachePolicyDto" }
29554
29625
  },
29626
+ getNamespaceAnswerCacheSavings: {
29627
+ method: "GET",
29628
+ path: "/api/v1/namespaces/{id}/answer-cache-savings",
29629
+ responses: { 200: "NamespaceAnswerCacheSavingsDto" }
29630
+ },
29555
29631
  getNamespaceByPath: {
29556
29632
  method: "GET",
29557
29633
  path: "/api/v1/namespaces/path/{tenant_id}/{path}",
@@ -39123,6 +39199,18 @@ function NamespaceListResponseFromApiToFront(dto) {
39123
39199
  function UpdateNamespaceAnswerCachePolicyRequestFromFrontToApi(model) {
39124
39200
  return { enabled: model.enabled, ttl_seconds: model.ttlSeconds };
39125
39201
  }
39202
+ function NamespaceAnswerCacheSavingsDtoFromApiToFront(dto) {
39203
+ return {
39204
+ countedSince: dto.counted_since,
39205
+ freshModelCalls: dto.fresh_model_calls,
39206
+ reusedModelCalls: dto.reused_model_calls,
39207
+ bypassed: dto.bypassed,
39208
+ disabled: dto.disabled,
39209
+ unavailable: dto.unavailable,
39210
+ unqualified: dto.unqualified,
39211
+ tokenUsageMeasured: dto.token_usage_measured
39212
+ };
39213
+ }
39126
39214
  function NamespaceAnswerCachePolicyDtoFromApiToFront(dto) {
39127
39215
  return {
39128
39216
  enabled: dto.enabled,
@@ -39191,6 +39279,34 @@ var NamespacesClient = class {
39191
39279
  );
39192
39280
  return decodeResponse(response, NamespaceAnswerCachePolicyDtoFromApiToFront);
39193
39281
  }
39282
+ /**
39283
+ * Read the answer-cache outcomes the engine counted for a namespace.
39284
+ *
39285
+ * @param namespaceId - Namespace UUID.
39286
+ * @param requestOptions - Per-call options (timeout, retries, signal, headers).
39287
+ * @returns The counters of this engine process since `countedSince`.
39288
+ * @throws {ForbiddenError} 403 without a native `manage_answer_cache` grant.
39289
+ * @throws {NotFoundError} 404 for a namespace not in this tenant.
39290
+ * @throws {ServiceUnavailableError} 503 when the namespace state or authority is unavailable.
39291
+ *
39292
+ * @remarks
39293
+ * `GET /api/v1/namespaces/{id}/answer-cache-savings`. The counters are
39294
+ * process-local and not durable; token savings are not measured
39295
+ * (`tokenUsageMeasured: false`). Response mapped from snake_case.
39296
+ *
39297
+ * @example
39298
+ * ```typescript
39299
+ * const savings = await client.namespaces.getAnswerCacheSavings(namespaceId);
39300
+ * console.log(savings.reusedModelCalls, 'of', savings.freshModelCalls + savings.reusedModelCalls);
39301
+ * ```
39302
+ */
39303
+ async getAnswerCacheSavings(namespaceId, requestOptions) {
39304
+ const response = await this.api.getNamespaceAnswerCacheSavings(
39305
+ namespaceId,
39306
+ toRequestParams(requestOptions)
39307
+ );
39308
+ return decodeResponse(response, NamespaceAnswerCacheSavingsDtoFromApiToFront);
39309
+ }
39194
39310
  /** Save settings in OSFKB; policy validation and cache admission stay in the engine. */
39195
39311
  async updateAnswerCachePolicy(namespaceId, request, requestOptions) {
39196
39312
  const response = await this.api.updateNamespaceAnswerCachePolicy(
@@ -42105,6 +42221,14 @@ function TokenUsageDtoFromApiToFront(dto) {
42105
42221
  totalTokens: dto.total_tokens
42106
42222
  };
42107
42223
  }
42224
+ function IngestionWorkCacheDtoFromApiToFront(dto) {
42225
+ return {
42226
+ modelCalls: dto.model_calls,
42227
+ reusedModelCalls: dto.reused_model_calls,
42228
+ unkeyedModelCalls: dto.unkeyed_model_calls,
42229
+ reusedRecordedTokenUsage: TokenUsageDtoFromApiToFront(dto.reused_recorded_token_usage)
42230
+ };
42231
+ }
42108
42232
  function AlignmentStatsDtoFromApiToFront(dto) {
42109
42233
  return {
42110
42234
  avgFuzzyRatio: dto.avg_fuzzy_ratio,
@@ -42202,6 +42326,7 @@ function IngestionStatsDtoFromApiToFront(dto) {
42202
42326
  sotaExtractionGate: dto.sota_extraction_gate ? SotaExtractionGateStatsDtoFromApiToFront(dto.sota_extraction_gate) : void 0,
42203
42327
  termIds: dto.term_ids,
42204
42328
  tokenUsage: dto.token_usage ? TokenUsageDtoFromApiToFront(dto.token_usage) : void 0,
42329
+ workCache: dto.work_cache ? IngestionWorkCacheDtoFromApiToFront(dto.work_cache) : void 0,
42205
42330
  fcaDiscovery: dto.fca_discovery ? FcaIngestionReportFromApiToFront(dto.fca_discovery) : void 0
42206
42331
  };
42207
42332
  }
@@ -42614,7 +42739,8 @@ function DocumentStatsDtoFromApiToFront(dto) {
42614
42739
  sortNames: dto.sort_names,
42615
42740
  termIds: dto.term_ids,
42616
42741
  totalTokens: dto.total_tokens,
42617
- fcaDiscovery: dto.fca_discovery ? FcaIngestionReportFromApiToFront(dto.fca_discovery) : void 0
42742
+ fcaDiscovery: dto.fca_discovery ? FcaIngestionReportFromApiToFront(dto.fca_discovery) : void 0,
42743
+ workCache: dto.work_cache ? IngestionWorkCacheDtoFromApiToFront(dto.work_cache) : void 0
42618
42744
  };
42619
42745
  }
42620
42746
  function SessionStatsResponseFromApiToFront(dto) {
@@ -51139,8 +51265,7 @@ var AnalysisClient = class {
51139
51265
  * the first question, and the search report.
51140
51266
  * @throws {ForbiddenError} 403 with code `exploration_actor_required` when
51141
51267
  * the request carries no gateway human actor (`authenticatedUser`).
51142
- * @throws {BadRequestError} 400 for an unknown sort name, a refused
51143
- * population bound (`exploration_population_limit`), native-predicate
51268
+ * @throws {BadRequestError} 400 for an unknown sort name, native-predicate
51144
51269
  * semantics, or a scaled interpretation that is not complete.
51145
51270
  *
51146
51271
  * @remarks
@@ -51275,8 +51400,8 @@ var AnalysisClient = class {
51275
51400
  *
51276
51401
  * @param sessionId - Exploration session ID.
51277
51402
  * @param request - The bounds of this search step (`maxWork`,
51278
- * `maxCandidates`, `searchTimeoutMs`); each omitted bound takes the
51279
- * engine default.
51403
+ * `maxCandidates`, `searchTimeoutMs`); an omitted or `null` bound is
51404
+ * unbounded.
51280
51405
  * @param requestOptions - Per-call request options.
51281
51406
  * @returns The next question (absent when the search stopped again or was
51282
51407
  * exhausted), the progress, and the search report.
@@ -71406,7 +71531,8 @@ function SchemeViewFromApiToFront(dto) {
71406
71531
  revision: dto.revision,
71407
71532
  displayName: dto.display_name,
71408
71533
  purpose: dto.purpose,
71409
- languages: dto.languages.map(SchemeLanguageViewFromApiToFront)
71534
+ languages: dto.languages.map(SchemeLanguageViewFromApiToFront),
71535
+ documentation: dto.documentation.map(VocabularyDocumentationRecordFromApiToFront)
71410
71536
  };
71411
71537
  if (present(dto.scope_note)) out.scopeNote = dto.scope_note;
71412
71538
  if (present(dto.exclusions)) out.exclusions = dto.exclusions;
@@ -71491,6 +71617,38 @@ function DefinitionGuidanceFromApiToFront(dto) {
71491
71617
  parentEdgeCreated: dto.parent_edge_created
71492
71618
  };
71493
71619
  }
71620
+ function LabelRelationViewFromApiToFront(dto) {
71621
+ const out = {
71622
+ ...VocabularyLabelRelationRecordFromApiToFront(dto),
71623
+ otherXlLabelId: dto.other_xl_label_id
71624
+ };
71625
+ if (present(dto.other_resource_key)) out.otherResourceKey = dto.other_resource_key;
71626
+ if (present(dto.other_text)) out.otherText = dto.other_text;
71627
+ if (present(dto.other_language)) out.otherLanguage = dto.other_language;
71628
+ return out;
71629
+ }
71630
+ function XlLabelViewFromApiToFront(dto) {
71631
+ const out = {
71632
+ ...VocabularyXlLabelRecordFromApiToFront(dto),
71633
+ outgoingRelations: dto.outgoing_relations.map(LabelRelationViewFromApiToFront),
71634
+ incomingRelations: dto.incoming_relations.map(LabelRelationViewFromApiToFront)
71635
+ };
71636
+ if (present(dto.text)) out.text = dto.text;
71637
+ if (present(dto.language)) out.language = dto.language;
71638
+ return out;
71639
+ }
71640
+ function ConceptMappingViewFromApiToFront(dto) {
71641
+ const out = VocabularyConceptMappingRecordFromApiToFront(dto);
71642
+ if (present(dto.target_external_concept)) {
71643
+ out.targetExternalConcept = VocabularyExternalConceptRecordFromApiToFront(
71644
+ dto.target_external_concept
71645
+ );
71646
+ }
71647
+ if (present(dto.target_display_label)) {
71648
+ out.targetDisplayLabel = VocabularyDisplayLabelFromApiToFront(dto.target_display_label);
71649
+ }
71650
+ return out;
71651
+ }
71494
71652
  function ConceptViewFromApiToFront(dto) {
71495
71653
  const out = {
71496
71654
  concept: VocabularyConceptRecordFromApiToFront(dto.concept),
@@ -71505,10 +71663,10 @@ function ConceptViewFromApiToFront(dto) {
71505
71663
  ),
71506
71664
  aboutness: dto.aboutness.map(VocabularyAboutnessRecordFromApiToFront),
71507
71665
  relations: dto.relations.map(VocabularyConceptRelationRecordFromApiToFront),
71508
- mappings: dto.mappings.map(VocabularyConceptMappingRecordFromApiToFront),
71666
+ mappings: dto.mappings.map(ConceptMappingViewFromApiToFront),
71509
71667
  documentation: dto.documentation.map(VocabularyDocumentationRecordFromApiToFront),
71510
71668
  notations: dto.notations.map(VocabularyNotationRecordFromApiToFront),
71511
- xlLabels: dto.xl_labels.map(VocabularyXlLabelRecordFromApiToFront),
71669
+ xlLabels: dto.xl_labels.map(XlLabelViewFromApiToFront),
71512
71670
  collections: dto.collections,
71513
71671
  sourceAssociations: dto.source_associations.map(
71514
71672
  VocabularySourceAssociationRecordFromApiToFront
@@ -72115,7 +72273,8 @@ function VocabularyCollectionDetailFromApiToFront(dto) {
72115
72273
  collection: VocabularyCollectionRecordFromApiToFront(dto.collection),
72116
72274
  labels: dto.labels.map(CollectionLabelViewFromApiToFront),
72117
72275
  members: dto.members.map(CollectionMemberViewFromApiToFront),
72118
- nestedCollections: dto.nested_collections
72276
+ nestedCollections: dto.nested_collections,
72277
+ documentation: dto.documentation.map(VocabularyDocumentationRecordFromApiToFront)
72119
72278
  };
72120
72279
  if (present(dto.context)) out.context = VocabularyContextRefFromApiToFront(dto.context);
72121
72280
  return out;