@kortexya/reasoninglayer 1.20.0 → 1.22.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.d.cts CHANGED
@@ -109,7 +109,7 @@ type JsonValue$1 = string | number | boolean | null | JsonValue$1[] | object;
109
109
  * This is the single source of truth for the version constant.
110
110
  * The `scripts/release.sh` script updates this value alongside `package.json`.
111
111
  */
112
- declare const SDK_VERSION = "1.20.0";
112
+ declare const SDK_VERSION = "1.22.0";
113
113
  /**
114
114
  * Authentication mode for the SDK.
115
115
  *
@@ -4217,6 +4217,17 @@ interface ClearTenantResponse$1 {
4217
4217
  * @min 0
4218
4218
  */
4219
4219
  meta_records_deleted: number;
4220
+ /**
4221
+ * Number of plugin-marketplace install records forgotten for this tenant.
4222
+ *
4223
+ * The durable `plugin_installs` rows are counted by the table sweep; this is
4224
+ * the IN-MEMORY registry's count, reported separately because the two used
4225
+ * to disagree — the sweep deleted the rows while the registry kept serving
4226
+ * the records, so the install listing reported plugins enabled over a
4227
+ * knowledge base that had just been wiped.
4228
+ * @min 0
4229
+ */
4230
+ plugin_installs_deleted?: number;
4220
4231
  /**
4221
4232
  * Number of residuation records deleted
4222
4233
  * @min 0
@@ -13467,6 +13478,12 @@ interface IngestDocumentRequest$1 {
13467
13478
  }
13468
13479
  /** Response from document ingestion */
13469
13480
  interface IngestDocumentResponse$1 {
13481
+ /**
13482
+ * Document ID within the session — the handle that session progress and
13483
+ * corpus reads key on. Clients previously had to recover it from listings.
13484
+ * @format uuid
13485
+ */
13486
+ document_id?: string | null;
13470
13487
  /** Error message if parsing failed */
13471
13488
  error?: string | null;
13472
13489
  /** Markdown ingestion statistics (from the markdown pipeline) */
@@ -14160,6 +14177,15 @@ interface InstallRequest {
14160
14177
  }
14161
14178
  /** Response for `POST /install` (201). */
14162
14179
  interface InstallResponse {
14180
+ /** What is missing from the live contribution, when `degraded`. */
14181
+ degradation?: string | null;
14182
+ /**
14183
+ * Whether the contribution is only PARTIALLY applied to the live view
14184
+ * (issue #154 D). `state` alone cannot say this: a plugin whose sorts the
14185
+ * live lattice rejected, or whose startup replay failed, still reads
14186
+ * `Enabled` while contributing less than it reports — or nothing at all.
14187
+ */
14188
+ degraded?: boolean;
14163
14189
  /** The new install's id. */
14164
14190
  install_id: string;
14165
14191
  /**
@@ -14177,6 +14203,13 @@ interface InstallResponse {
14177
14203
  }
14178
14204
  /** Response for enable/disable (the new lifecycle state). */
14179
14205
  interface InstallStateDto {
14206
+ /** What is missing from the live contribution, when `degraded`. */
14207
+ degradation?: string | null;
14208
+ /**
14209
+ * Whether the contribution is only PARTIALLY applied to the live view
14210
+ * (issue #154 D).
14211
+ */
14212
+ degraded?: boolean;
14180
14213
  /** The install's id. */
14181
14214
  install_id: string;
14182
14215
  /** The lifecycle state after the transition. */
@@ -14184,6 +14217,15 @@ interface InstallStateDto {
14184
14217
  }
14185
14218
  /** One install row in the install-list response. */
14186
14219
  interface InstallSummaryDto {
14220
+ /** What is missing from the live contribution, when `degraded`. */
14221
+ degradation?: string | null;
14222
+ /**
14223
+ * Whether the contribution is only PARTIALLY applied to the live view
14224
+ * (issue #154 B/D) — a sort the live lattice rejected, or a startup replay
14225
+ * that failed. `state` cannot express this: such an install still reads
14226
+ * `Enabled`.
14227
+ */
14228
+ degraded?: boolean;
14187
14229
  /** The install's id. */
14188
14230
  install_id: string;
14189
14231
  /** The installed plugin's id. */
@@ -22787,7 +22829,8 @@ interface SearchSortsMatch {
22787
22829
  /**
22788
22830
  * Hierarchy depth — `0` is a root sort. Always populated: the
22789
22831
  * upstream port (`SortVisualizationPort::search_sorts_by_name`)
22790
- * returns an `i32` directly, with no nullable code path.
22832
+ * returns an `i32` directly, with no nullable code path. A
22833
+ * plugin-contributed match reports its depth in the live tenant lattice.
22791
22834
  * @format int32
22792
22835
  */
22793
22836
  depth: number;
@@ -22796,8 +22839,22 @@ interface SearchSortsMatch {
22796
22839
  * @format uuid
22797
22840
  */
22798
22841
  id: string;
22799
- /** Sort name as stored in PG. */
22842
+ /**
22843
+ * Sort name as stored in PG, or the committed (namespaced) name for a
22844
+ * plugin-contributed sort.
22845
+ */
22800
22846
  name: string;
22847
+ /**
22848
+ * The plugin that contributed this sort (UUID), when the match came from a
22849
+ * marketplace install rather than PG (issue #154 A).
22850
+ * @format uuid
22851
+ */
22852
+ plugin_id?: string | null;
22853
+ /**
22854
+ * The name the plugin author wrote, before namespacing (issue #154 A) —
22855
+ * the form the query matched.
22856
+ */
22857
+ plugin_local_name?: string | null;
22801
22858
  }
22802
22859
  /** Response body for `GET /api/v1/sorts/search`. */
22803
22860
  interface SearchSortsResponse {
@@ -23838,6 +23895,24 @@ interface SortDto$1 {
23838
23895
  origin?: null | SortOriginDto$1;
23839
23896
  /** Parent sort IDs */
23840
23897
  parents: string[];
23898
+ /**
23899
+ * The plugin that contributed this sort (UUID), when a marketplace install
23900
+ * created it (issue #154 A). `None` for every ordinary sort.
23901
+ *
23902
+ * A plugin's sorts are committed under a namespaced `name`
23903
+ * (`plugin:<plugin-uuid>:<local>`) so two plugins never collide. This field
23904
+ * and [`plugin_local_name`](Self::plugin_local_name) are what tie that name
23905
+ * back to its author: without them a reader of a full listing cannot tell
23906
+ * which plugin owns `plugin:642156b2…:signal`, nor what it was called.
23907
+ * @format uuid
23908
+ */
23909
+ plugin_id?: string | null;
23910
+ /**
23911
+ * The name the plugin author wrote, before namespacing (issue #154 A).
23912
+ * `GET /api/v1/sorts/tenant/{id}?name_prefix=…` matches this form as well as
23913
+ * the committed `name`.
23914
+ */
23915
+ plugin_local_name?: string | null;
23841
23916
  /** Lifecycle status */
23842
23917
  status?: null | SortStatusDto$1;
23843
23918
  /**
@@ -24825,6 +24900,14 @@ interface StructuredIngestionStatsDto$1 {
24825
24900
  * @min 0
24826
24901
  */
24827
24902
  entities_extracted: number;
24903
+ /**
24904
+ * Number of records the source reported as available for the ingested
24905
+ * tables, before any cap or collapse (#177). Compared with
24906
+ * `records_processed`, a cap hit is visible; compared with `terms_created`,
24907
+ * a partial ingest is visible.
24908
+ * @min 0
24909
+ */
24910
+ records_available: number;
24828
24911
  /**
24829
24912
  * Number of source records processed
24830
24913
  * @min 0
@@ -24840,6 +24923,14 @@ interface StructuredIngestionStatsDto$1 {
24840
24923
  * @min 0
24841
24924
  */
24842
24925
  relations_discovered: number;
24926
+ /**
24927
+ * Number of rows that collapsed onto a key value another row already
24928
+ * produced in the same run — the bound-key upsert merged them into one
24929
+ * term (#177). Zero when the bound key identifies rows uniquely. Named in
24930
+ * `warnings` when non-zero.
24931
+ * @min 0
24932
+ */
24933
+ rows_collapsed: number;
24843
24934
  /**
24844
24935
  * Number of sorts created (from pipeline)
24845
24936
  * @min 0
@@ -28968,6 +29059,25 @@ interface SortDto {
28968
29059
  status?: SortStatusDto | null;
28969
29060
  /** Whether this sort needs human review. */
28970
29061
  needsReview?: boolean;
29062
+ /**
29063
+ * The plugin that contributed this sort, when a marketplace install created
29064
+ * it. `undefined` for every ordinary sort.
29065
+ *
29066
+ * @remarks
29067
+ * A plugin's sorts are committed under a namespaced `name`
29068
+ * (`plugin:<plugin-name>:<local>`) so two plugins never collide on the same
29069
+ * local name. This field and {@link SortDto.pluginLocalName} are what tie
29070
+ * that name back to its author.
29071
+ */
29072
+ pluginId?: string | null;
29073
+ /**
29074
+ * The name the plugin author wrote, before namespacing.
29075
+ *
29076
+ * @remarks
29077
+ * `GET /api/v1/sorts/tenant/{id}?name_prefix=…` matches this form as well as
29078
+ * the committed {@link SortDto.name}.
29079
+ */
29080
+ pluginLocalName?: string | null;
28971
29081
  }
28972
29082
  /**
28973
29083
  * Response wrapper for sort endpoints.
@@ -29821,6 +29931,8 @@ declare class Terms<SecurityDataType = unknown> {
29821
29931
  * @min 0
29822
29932
  */
29823
29933
  offset?: number;
29934
+ /** Only terms of this exact sort; omit for every sort */
29935
+ sort_name?: string;
29824
29936
  }, params?: RequestParams) => Promise<HttpResponse<TermListResponse$1, any>>;
29825
29937
  /**
29826
29938
  * No description
@@ -30768,8 +30880,9 @@ declare class TermsClient {
30768
30880
  }>;
30769
30881
  }): Promise<BulkAddTermsResponse>;
30770
30882
  /**
30771
- * List all terms for the authenticated tenant.
30883
+ * List terms for the authenticated tenant.
30772
30884
  *
30885
+ * @param query - Optional paging and sort filter. Omit for every term.
30773
30886
  * @returns The list of terms with total count.
30774
30887
  * @throws {ApiError} If the request fails.
30775
30888
  *
@@ -30778,16 +30891,28 @@ declare class TermsClient {
30778
30891
  * Requires X-Tenant-Id header (set via client configuration).
30779
30892
  * Uses the tagged {@link ValueDto} serialization format.
30780
30893
  *
30894
+ * `sortName` filters on the sort's committed name. For a plugin-contributed
30895
+ * sort that is the namespaced form (`plugin:<plugin-name>:<local>`), which
30896
+ * {@link SortDto.name} carries and {@link SortDto.pluginLocalName} maps back
30897
+ * to the name its author wrote.
30898
+ *
30781
30899
  * @example
30782
30900
  * ```typescript
30783
30901
  * const result = await client.terms.listTerms();
30784
30902
  * console.log(`Found ${result.count} terms`);
30785
- * for (const term of result.terms) {
30786
- * console.log(term.id, term.sortName);
30787
- * }
30903
+ *
30904
+ * // Only the first page of one sort's terms.
30905
+ * const page = await client.terms.listTerms({ sortName: 'person', limit: 50 });
30788
30906
  * ```
30789
30907
  */
30790
- listTerms(): Promise<TermListResponse>;
30908
+ listTerms(query?: {
30909
+ /** Max terms to return; omit for all, hard-capped at 10000. */
30910
+ limit?: number;
30911
+ /** Zero-based index of the first term (default 0). */
30912
+ offset?: number;
30913
+ /** Only terms of this exact sort; omit for every sort. */
30914
+ sortName?: string;
30915
+ }): Promise<TermListResponse>;
30791
30916
  /**
30792
30917
  * Clear all terms for the authenticated tenant.
30793
30918
  *
@@ -41527,7 +41652,10 @@ declare class Ingestion<SecurityDataType = unknown> {
41527
41652
  * @request POST:/api/v1/ingest/document
41528
41653
  * @secure
41529
41654
  */
41530
- ingestDocument: (data: IngestDocumentRequest$1, params?: RequestParams) => Promise<HttpResponse<IngestDocumentResponse$1, void>>;
41655
+ ingestDocument: (data: IngestDocumentRequest$1, query?: {
41656
+ /** When true or absent, process synchronously (legacy behavior, returns 201 with full stats). When false, return 202 after parsing and ingest in the background — poll the session endpoints. */
41657
+ sync?: boolean;
41658
+ }, params?: RequestParams) => Promise<HttpResponse<IngestDocumentResponse$1, void>>;
41531
41659
  /**
41532
41660
  * @description POST /api/v1/ingest/document/batch This endpoint accepts multiple documents and processes them sequentially, sharing deduplication context across documents. # Headers - `X-Tenant-Id`: Tenant ID for multi-tenancy isolation (required)
41533
41661
  *
@@ -41557,10 +41685,10 @@ declare class Ingestion<SecurityDataType = unknown> {
41557
41685
  * @request POST:/api/v1/ingest/markdown
41558
41686
  * @secure
41559
41687
  */
41560
- ingestMarkdown: (query: {
41688
+ ingestMarkdown: (data: IngestMarkdownRequest$1, query?: {
41561
41689
  /** When true, process synchronously (returns 201). When false/absent, process asynchronously (returns 202). */
41562
- sync: boolean;
41563
- }, data: IngestMarkdownRequest$1, params?: RequestParams) => Promise<HttpResponse<void, void>>;
41690
+ sync?: boolean;
41691
+ }, params?: RequestParams) => Promise<HttpResponse<void, void>>;
41564
41692
  /**
41565
41693
  * @description POST /api/v1/ingest/markdown/batch This endpoint accepts multiple markdown documents and enqueues them for background processing. Each document is processed independently by background workers, tracked under a single session. When a task queue is available (default), returns 202 Accepted immediately. Falls back to synchronous processing (201 Created) only when no queue is configured. # Headers - `X-Tenant-Id`: Tenant ID for multi-tenancy isolation (required) # Request Body - `documents`: List of markdown documents with IDs and content - `owner_id`: User ID who owns the ingested data - `config`: Optional configuration overrides # Response - Async (202): Session ID + document IDs for tracking - Sync fallback (201): Full ingestion result with stats
41566
41694
  *
@@ -41580,10 +41708,10 @@ declare class Ingestion<SecurityDataType = unknown> {
41580
41708
  * @request POST:/api/v1/ingest/rdf
41581
41709
  * @secure
41582
41710
  */
41583
- ingestRdf: (query: {
41711
+ ingestRdf: (data: IngestRdfRequest$1, query?: {
41584
41712
  /** When true, run synchronously (returns 201). Default false: returns 202 with a session id. */
41585
- sync: boolean;
41586
- }, data: IngestRdfRequest$1, params?: RequestParams) => Promise<HttpResponse<IngestRdfResponse$1, void>>;
41713
+ sync?: boolean;
41714
+ }, params?: RequestParams) => Promise<HttpResponse<IngestRdfResponse$1, void>>;
41587
41715
  /**
41588
41716
  * @description The read-only mirror of `POST /api/v1/sparql/translate`. Runs the exact same conversion the ingest pipeline runs (`parse_rdf_with_prefixes` → `convert_rdf_to_terms`), renders each produced term as text, and returns it. No term, sort, or `@prefix` is persisted: the sort-name and prefix resolution both run against owned copies of the tenant's hierarchy state, never the shared hierarchy itself.
41589
41717
  *
@@ -54976,6 +55104,15 @@ interface ClearTenantResponse {
54976
55104
  inferenceStateCleared: boolean;
54977
55105
  /** Whether the cache was invalidated. */
54978
55106
  cacheInvalidated: boolean;
55107
+ /**
55108
+ * Number of plugin-marketplace install records forgotten for this tenant.
55109
+ *
55110
+ * @remarks
55111
+ * Reported separately from the persistent table sweep's row count: the
55112
+ * durable rows and the in-memory registry are two stores, and this is the
55113
+ * one the install listing reads.
55114
+ */
55115
+ pluginInstallsDeleted?: number;
54979
55116
  }
54980
55117
  /**
54981
55118
  * Response for the list-tenants endpoint.
@@ -57653,6 +57790,21 @@ interface SourceExcerptDto$1 {
57653
57790
  /** Source document, if applicable. */
57654
57791
  sourceDocument?: string | null;
57655
57792
  }
57793
+ /**
57794
+ * A sort from the tenant's catalog that a claim names.
57795
+ *
57796
+ * @remarks
57797
+ * The schema counterpart of {@link SourceExcerptDto}: it carries no `termId`,
57798
+ * because there is no record to point at. An answer *about* the knowledge base
57799
+ * — "what sorts exist here" — is built from the sort catalog, runs no query and
57800
+ * produces no binding, so this is the only evidence it can carry.
57801
+ */
57802
+ interface SchemaExcerptDto {
57803
+ /** The sort as the tenant's lattice names it. */
57804
+ sortName: string;
57805
+ /** The features the sort declares. */
57806
+ featureNames?: string[];
57807
+ }
57656
57808
  /**
57657
57809
  * A claim annotation with provenance information.
57658
57810
  */
@@ -57661,7 +57813,13 @@ interface ClaimAnnotationDto {
57661
57813
  text: string;
57662
57814
  /** Character offsets (start, end) in the assistant_message. */
57663
57815
  span: unknown[];
57664
- /** Claim classification: "kb_grounded", "derived", "llm_framing", "proven", "contradicted". */
57816
+ /**
57817
+ * Claim classification: "kb_grounded", "schema_grounded", "derived",
57818
+ * "llm_framing", "proven", "contradicted".
57819
+ *
57820
+ * `schema_grounded` is backed by the tenant's sort catalog rather than by
57821
+ * records — see {@link ClaimAnnotationDto.schemaExcerpts}.
57822
+ */
57665
57823
  claimType: string;
57666
57824
  /** Confidence score (0.0-1.0). */
57667
57825
  confidence: number;
@@ -57669,6 +57827,11 @@ interface ClaimAnnotationDto {
57669
57827
  sourceTermIds?: string[];
57670
57828
  /** Source data excerpts from the KB. */
57671
57829
  sourceExcerpts?: SourceExcerptDto$1[];
57830
+ /**
57831
+ * Sorts from the tenant's catalog that this claim names — the evidence for a
57832
+ * `schema_grounded` claim, and additional context on any other.
57833
+ */
57834
+ schemaExcerpts?: SchemaExcerptDto[];
57672
57835
  /** OSFQL query that produced the grounding data. */
57673
57836
  osfqlQuery?: string | null;
57674
57837
  /** Derivation chain summary. */
@@ -57997,10 +58160,11 @@ type conversation_ReasoningTraceDto = ReasoningTraceDto;
57997
58160
  type conversation_RecordTurnRequest = RecordTurnRequest;
57998
58161
  type conversation_RecordTurnResponse = RecordTurnResponse;
57999
58162
  type conversation_ResolvedCoreferenceDto = ResolvedCoreferenceDto;
58163
+ type conversation_SchemaExcerptDto = SchemaExcerptDto;
58000
58164
  type conversation_SessionGraphDto = SessionGraphDto;
58001
58165
  type conversation_TurnDto = TurnDto;
58002
58166
  declare namespace conversation {
58003
- export type { conversation_ClaimAnnotationDto as ClaimAnnotationDto, conversation_CognitiveStrategyDto as CognitiveStrategyDto, conversation_CompareModelDto as CompareModelDto, conversation_ConversationMessageRequest as ConversationMessageRequest, conversation_ConversationMessageResponse as ConversationMessageResponse, conversation_ConversationSummaryDto as ConversationSummaryDto, conversation_ConversationTurnsResponse as ConversationTurnsResponse, conversation_DerivationSummaryDto as DerivationSummaryDto, conversation_FocusEntryDto as FocusEntryDto, conversation_ListConversationsResponse as ListConversationsResponse, conversation_MatchedEntityDto as MatchedEntityDto, conversation_ProofTraceNodeDto as ProofTraceNodeDto, conversation_ReasoningStageDto as ReasoningStageDto, conversation_ReasoningTraceDto as ReasoningTraceDto, conversation_RecordTurnRequest as RecordTurnRequest, conversation_RecordTurnResponse as RecordTurnResponse, conversation_ResolvedCoreferenceDto as ResolvedCoreferenceDto, conversation_SessionGraphDto as SessionGraphDto, SourceExcerptDto$1 as SourceExcerptDto, conversation_TurnDto as TurnDto, UICustomizationDto$1 as UICustomizationDto };
58167
+ export type { conversation_ClaimAnnotationDto as ClaimAnnotationDto, conversation_CognitiveStrategyDto as CognitiveStrategyDto, conversation_CompareModelDto as CompareModelDto, conversation_ConversationMessageRequest as ConversationMessageRequest, conversation_ConversationMessageResponse as ConversationMessageResponse, conversation_ConversationSummaryDto as ConversationSummaryDto, conversation_ConversationTurnsResponse as ConversationTurnsResponse, conversation_DerivationSummaryDto as DerivationSummaryDto, conversation_FocusEntryDto as FocusEntryDto, conversation_ListConversationsResponse as ListConversationsResponse, conversation_MatchedEntityDto as MatchedEntityDto, conversation_ProofTraceNodeDto as ProofTraceNodeDto, conversation_ReasoningStageDto as ReasoningStageDto, conversation_ReasoningTraceDto as ReasoningTraceDto, conversation_RecordTurnRequest as RecordTurnRequest, conversation_RecordTurnResponse as RecordTurnResponse, conversation_ResolvedCoreferenceDto as ResolvedCoreferenceDto, conversation_SchemaExcerptDto as SchemaExcerptDto, conversation_SessionGraphDto as SessionGraphDto, SourceExcerptDto$1 as SourceExcerptDto, conversation_TurnDto as TurnDto, UICustomizationDto$1 as UICustomizationDto };
58004
58168
  }
58005
58169
 
58006
58170
  /**
@@ -63637,6 +63801,17 @@ interface InstallPluginResponse {
63637
63801
  rulesAdded: number;
63638
63802
  /** The resulting lifecycle state (`"Enabled"` after a successful install). */
63639
63803
  state: string;
63804
+ /**
63805
+ * Whether the contribution is only PARTIALLY applied to the live view.
63806
+ *
63807
+ * @remarks
63808
+ * {@link InstallPluginResponse.state} cannot express this: a plugin whose sorts the live lattice
63809
+ * rejected, or whose startup replay failed, still reads `"Enabled"` while
63810
+ * contributing less than it reports — or nothing at all.
63811
+ */
63812
+ degraded?: boolean;
63813
+ /** What is missing from the live contribution, when {@link InstallPluginResponse.degraded}. */
63814
+ degradation?: string | null;
63640
63815
  }
63641
63816
  /**
63642
63817
  * An install's lifecycle state after an enable/disable transition.
@@ -63652,6 +63827,17 @@ interface InstallState {
63652
63827
  installId: string;
63653
63828
  /** The lifecycle state after the transition. */
63654
63829
  state: string;
63830
+ /**
63831
+ * Whether the contribution is only PARTIALLY applied to the live view.
63832
+ *
63833
+ * @remarks
63834
+ * {@link InstallState.state} cannot express this: a plugin whose sorts the live lattice
63835
+ * rejected, or whose startup replay failed, still reads `"Enabled"` while
63836
+ * contributing less than it reports — or nothing at all.
63837
+ */
63838
+ degraded?: boolean;
63839
+ /** What is missing from the live contribution, when {@link InstallState.degraded}. */
63840
+ degradation?: string | null;
63655
63841
  }
63656
63842
  /**
63657
63843
  * Request to upgrade an install to another published version.
@@ -63711,6 +63897,17 @@ interface InstallSummary {
63711
63897
  state: string;
63712
63898
  /** Whether the install is system-wide (rather than per-tenant). */
63713
63899
  systemWide: boolean;
63900
+ /**
63901
+ * Whether the contribution is only PARTIALLY applied to the live view.
63902
+ *
63903
+ * @remarks
63904
+ * {@link InstallSummary.state} cannot express this: a plugin whose sorts the live lattice
63905
+ * rejected, or whose startup replay failed, still reads `"Enabled"` while
63906
+ * contributing less than it reports — or nothing at all.
63907
+ */
63908
+ degraded?: boolean;
63909
+ /** What is missing from the live contribution, when {@link InstallSummary.degraded}. */
63910
+ degradation?: string | null;
63714
63911
  }
63715
63912
  /**
63716
63913
  * The installs visible in the requested scope.