@kortexya/reasoninglayer 0.16.0 → 0.17.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 = "0.16.0";
112
+ declare const SDK_VERSION = "0.17.0";
113
113
  /**
114
114
  * Configuration for the Reasoning Layer client.
115
115
  *
@@ -13646,7 +13646,7 @@ interface SearchCommunitiesResponse$1 {
13646
13646
  * Defaults to `solutions` for full backward compatibility with existing clients
13647
13647
  * that do not send a `mode` field.
13648
13648
  */
13649
- type SearchModeDto$1 = "solutions" | "feasibility";
13649
+ type SearchModeDto$1 = "solutions" | "feasibility" | "scheduling";
13650
13650
  /** Request to search for solutions */
13651
13651
  interface SearchRequest {
13652
13652
  /**
@@ -14254,12 +14254,27 @@ interface SortInfoDto$1 {
14254
14254
  /** Response for sort list operations */
14255
14255
  interface SortListResponse$1 {
14256
14256
  /**
14257
- * Total count
14257
+ * Number of sorts in **this response** — not the tenant total
14258
+ * when pagination is active.
14258
14259
  * @min 0
14259
14260
  */
14260
14261
  count: number;
14261
- /** List of sorts */
14262
+ /**
14263
+ * Offset of the first sort in this response.
14264
+ * @min 0
14265
+ */
14266
+ offset?: number;
14267
+ /**
14268
+ * Sorts in this page (or all sorts when no ``limit`` query
14269
+ * parameter was supplied).
14270
+ */
14262
14271
  sorts: SortDto$1[];
14272
+ /**
14273
+ * Total number of sorts the tenant owns after filters, across
14274
+ * all pages. Lets the client know when to stop paginating.
14275
+ * @min 0
14276
+ */
14277
+ total?: number;
14263
14278
  }
14264
14279
  /** API representation of sort origin/provenance */
14265
14280
  type SortOriginDto$1 = {
@@ -15566,6 +15581,73 @@ interface TriggerDependencyResponse$1 {
15566
15581
  /** The visualization graph */
15567
15582
  graph: VisualizationGraphDto$1;
15568
15583
  }
15584
+ /**
15585
+ * Request body for `POST /api/v1/triz/invent` — the structured-input,
15586
+ * no-LLM path into the TRIZ invention engine.
15587
+ */
15588
+ interface TrizInventRequest {
15589
+ /**
15590
+ * Human-readable context (e.g. "drug_discovery", "kinase_program_279").
15591
+ * The engine uses this in explanations but not in the reasoning.
15592
+ */
15593
+ domain_context?: string;
15594
+ /**
15595
+ * Sort names the caller has pre-seeded under this tenant. Required:
15596
+ * without them the KB-matching step (`query_kb_for_triz_data`) has
15597
+ * no domain hints and falls through to the LLM-synthetic path —
15598
+ * defeating the purpose of this endpoint.
15599
+ */
15600
+ domains?: string[];
15601
+ improving_parameter: string;
15602
+ /** @format uuid */
15603
+ tenant_id: string;
15604
+ worsening_parameter: string;
15605
+ }
15606
+ /** Request body for `POST /api/v1/triz/record-outcome`. */
15607
+ interface TrizRecordOutcomeRequest {
15608
+ /**
15609
+ * UUID of the ``triz_inventive_proposal`` term the engine emitted.
15610
+ * @format uuid
15611
+ */
15612
+ invention_term_id: string;
15613
+ /**
15614
+ * Measured performance ratio (e.g. potency fold, selectivity
15615
+ * fold). ``0.0`` if unmeasured — the engine still records the
15616
+ * success/failure signal.
15617
+ * @format double
15618
+ */
15619
+ measured_ratio?: number;
15620
+ /** Free-text notes on the outcome for downstream audit. */
15621
+ notes?: string;
15622
+ /**
15623
+ * Whether the invention succeeded in downstream validation /
15624
+ * experimental testing.
15625
+ */
15626
+ success: boolean;
15627
+ /** @format uuid */
15628
+ tenant_id: string;
15629
+ }
15630
+ /** Response payload for outcome recording. */
15631
+ interface TrizRecordOutcomeResponse {
15632
+ error?: string | null;
15633
+ /**
15634
+ * Number of learned-mapping terms whose confidence was adjusted.
15635
+ * @min 0
15636
+ */
15637
+ mappings_updated: number;
15638
+ /**
15639
+ * UUID of the newly-created ``triz_invention_outcome`` audit term.
15640
+ * @format uuid
15641
+ */
15642
+ outcome_term_id?: string | null;
15643
+ recorded: boolean;
15644
+ success: boolean;
15645
+ /**
15646
+ * New post-update average confidence across the adjusted mappings.
15647
+ * @format double
15648
+ */
15649
+ updated_confidence: number;
15650
+ }
15569
15651
  /** DTO for UIAction — all actions reference OSFQL execution */
15570
15652
  type UIActionDto$1 = {
15571
15653
  field_types: Record<string, string>;
@@ -16748,10 +16830,26 @@ declare class Sorts<SecurityDataType = unknown> {
16748
16830
  * Defaults to false (system sorts are excluded by default).
16749
16831
  */
16750
16832
  include_system?: boolean;
16833
+ /**
16834
+ * Maximum number of sorts to return. When omitted, no cap is
16835
+ * applied (legacy behaviour). Recommended page size for
16836
+ * production tenants: 50_000.
16837
+ * @min 0
16838
+ */
16839
+ limit?: number | null;
16751
16840
  /** Filter to only show LLM-extracted sorts */
16752
16841
  llm_extracted?: boolean | null;
16753
16842
  /** Filter to only show sorts needing review */
16754
16843
  needs_review?: boolean | null;
16844
+ /**
16845
+ * Zero-indexed pagination offset. Combined with ``limit`` this
16846
+ * lets clients stream a production tenant (1 M+ sorts, ~500 MB
16847
+ * uncompressed) as a sequence of small responses, avoiding the
16848
+ * ``IncompleteRead`` a single-response transfer reliably hits
16849
+ * above ~30 MB.
16850
+ * @min 0
16851
+ */
16852
+ offset?: number | null;
16755
16853
  }, params?: RequestParams) => Promise<HttpResponse<SortListResponse$1, any>>;
16756
16854
  /**
16757
16855
  * @description POST /api/v1/sorts/learned-similarities/reject Rejects a proposed or conflicted learned similarity with a reason. Rejected similarities are not used in reasoning.
@@ -20551,6 +20649,26 @@ declare class Query<SecurityDataType = unknown> {
20551
20649
  * @secure
20552
20650
  */
20553
20651
  osfSearch: (data: OsfSearchRequest$1, params?: RequestParams) => Promise<HttpResponse<OsfSearchResponse$1, any>>;
20652
+ /**
20653
+ * @description Skips the NL → structured-problem LLM hop entirely. Caller must have seeded the tenant KB with ≥ 3 successful + ≥ 2 limited Ψ-terms per domain (`/api/v1/terms/bulk` or `/api/v1/inference/facts/bulk`). Returns the same `NlQueryResponse` shape as the NL route so the UI can render either output uniformly.
20654
+ *
20655
+ * @tags query
20656
+ * @name TrizInvent
20657
+ * @summary Handle `POST /api/v1/triz/invent` — deterministic TRIZ invention.
20658
+ * @request POST:/api/v1/triz/invent
20659
+ * @secure
20660
+ */
20661
+ trizInvent: (data: TrizInventRequest, params?: RequestParams) => Promise<HttpResponse<NlQueryResponse$1, any>>;
20662
+ /**
20663
+ * No description
20664
+ *
20665
+ * @tags query
20666
+ * @name TrizRecordOutcome
20667
+ * @summary Handle `POST /api/v1/triz/record-outcome` — persist a measured outcome for a previously-emitted TRIZ proposal and learn from it.
20668
+ * @request POST:/api/v1/triz/record-outcome
20669
+ * @secure
20670
+ */
20671
+ trizRecordOutcome: (data: TrizRecordOutcomeRequest, params?: RequestParams) => Promise<HttpResponse<TrizRecordOutcomeResponse, any>>;
20554
20672
  /**
20555
20673
  * @description This performs unification AND validates the result against the GLB sort's witnesses. ## How It Differs from Regular Unification **Regular `/api/v1/term-store/sessions/:id/unify` (POST)**: - Computes GLB and unifies terms - Validates sort constraints (required features, type hints) - Does NOT check witnesses **This endpoint `/api/v1/query/validated-unify` (POST)**: - Computes GLB and unifies terms - Validates sort constraints - ALSO checks witnesses on the result - Returns proof of validity ## Example Unifying `person(name => "Alice")` with `grandparent(grandchild => "Charlie")`: 1. Computes GLB of person and grandparent 2. Creates unified term with both features 3. Checks grandparent witnesses: ∃Y. parent(Alice,Y) ∧ parent(Y,Charlie) 4. Returns unified term + witness proof
20556
20674
  *
@@ -30924,8 +31042,15 @@ interface CommitRequest {
30924
31042
  * - `"solutions"`: enumerate complete, valid assignments (default — backward compatible).
30925
31043
  * - `"feasibility"`: run 2×N per-variable SAT queries and return reachability info.
30926
31044
  * Much faster than full enumeration for large spaces.
30927
- */
30928
- type SearchModeDto = 'solutions' | 'feasibility';
31045
+ * - `"scheduling"`: route the space through the specialised **bipartite network-flow
31046
+ * engine** for scheduling-shaped problems (nurses × days × shifts with per-slot
31047
+ * demand and role minimums). Orders of magnitude faster than `"feasibility"` for
31048
+ * problems that fit this shape, and always returns fully `verified: true` results.
31049
+ * If the underlying problem's constraint shape cannot be modelled by the flow
31050
+ * engine, the backend responds with a 400 and the caller should fall back to
31051
+ * `"feasibility"`.
31052
+ */
31053
+ type SearchModeDto = 'solutions' | 'feasibility' | 'scheduling';
30929
31054
  /**
30930
31055
  * Reachability of a single binary choice-point variable.
30931
31056
  *
package/dist/index.d.ts 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 = "0.16.0";
112
+ declare const SDK_VERSION = "0.17.0";
113
113
  /**
114
114
  * Configuration for the Reasoning Layer client.
115
115
  *
@@ -13646,7 +13646,7 @@ interface SearchCommunitiesResponse$1 {
13646
13646
  * Defaults to `solutions` for full backward compatibility with existing clients
13647
13647
  * that do not send a `mode` field.
13648
13648
  */
13649
- type SearchModeDto$1 = "solutions" | "feasibility";
13649
+ type SearchModeDto$1 = "solutions" | "feasibility" | "scheduling";
13650
13650
  /** Request to search for solutions */
13651
13651
  interface SearchRequest {
13652
13652
  /**
@@ -14254,12 +14254,27 @@ interface SortInfoDto$1 {
14254
14254
  /** Response for sort list operations */
14255
14255
  interface SortListResponse$1 {
14256
14256
  /**
14257
- * Total count
14257
+ * Number of sorts in **this response** — not the tenant total
14258
+ * when pagination is active.
14258
14259
  * @min 0
14259
14260
  */
14260
14261
  count: number;
14261
- /** List of sorts */
14262
+ /**
14263
+ * Offset of the first sort in this response.
14264
+ * @min 0
14265
+ */
14266
+ offset?: number;
14267
+ /**
14268
+ * Sorts in this page (or all sorts when no ``limit`` query
14269
+ * parameter was supplied).
14270
+ */
14262
14271
  sorts: SortDto$1[];
14272
+ /**
14273
+ * Total number of sorts the tenant owns after filters, across
14274
+ * all pages. Lets the client know when to stop paginating.
14275
+ * @min 0
14276
+ */
14277
+ total?: number;
14263
14278
  }
14264
14279
  /** API representation of sort origin/provenance */
14265
14280
  type SortOriginDto$1 = {
@@ -15566,6 +15581,73 @@ interface TriggerDependencyResponse$1 {
15566
15581
  /** The visualization graph */
15567
15582
  graph: VisualizationGraphDto$1;
15568
15583
  }
15584
+ /**
15585
+ * Request body for `POST /api/v1/triz/invent` — the structured-input,
15586
+ * no-LLM path into the TRIZ invention engine.
15587
+ */
15588
+ interface TrizInventRequest {
15589
+ /**
15590
+ * Human-readable context (e.g. "drug_discovery", "kinase_program_279").
15591
+ * The engine uses this in explanations but not in the reasoning.
15592
+ */
15593
+ domain_context?: string;
15594
+ /**
15595
+ * Sort names the caller has pre-seeded under this tenant. Required:
15596
+ * without them the KB-matching step (`query_kb_for_triz_data`) has
15597
+ * no domain hints and falls through to the LLM-synthetic path —
15598
+ * defeating the purpose of this endpoint.
15599
+ */
15600
+ domains?: string[];
15601
+ improving_parameter: string;
15602
+ /** @format uuid */
15603
+ tenant_id: string;
15604
+ worsening_parameter: string;
15605
+ }
15606
+ /** Request body for `POST /api/v1/triz/record-outcome`. */
15607
+ interface TrizRecordOutcomeRequest {
15608
+ /**
15609
+ * UUID of the ``triz_inventive_proposal`` term the engine emitted.
15610
+ * @format uuid
15611
+ */
15612
+ invention_term_id: string;
15613
+ /**
15614
+ * Measured performance ratio (e.g. potency fold, selectivity
15615
+ * fold). ``0.0`` if unmeasured — the engine still records the
15616
+ * success/failure signal.
15617
+ * @format double
15618
+ */
15619
+ measured_ratio?: number;
15620
+ /** Free-text notes on the outcome for downstream audit. */
15621
+ notes?: string;
15622
+ /**
15623
+ * Whether the invention succeeded in downstream validation /
15624
+ * experimental testing.
15625
+ */
15626
+ success: boolean;
15627
+ /** @format uuid */
15628
+ tenant_id: string;
15629
+ }
15630
+ /** Response payload for outcome recording. */
15631
+ interface TrizRecordOutcomeResponse {
15632
+ error?: string | null;
15633
+ /**
15634
+ * Number of learned-mapping terms whose confidence was adjusted.
15635
+ * @min 0
15636
+ */
15637
+ mappings_updated: number;
15638
+ /**
15639
+ * UUID of the newly-created ``triz_invention_outcome`` audit term.
15640
+ * @format uuid
15641
+ */
15642
+ outcome_term_id?: string | null;
15643
+ recorded: boolean;
15644
+ success: boolean;
15645
+ /**
15646
+ * New post-update average confidence across the adjusted mappings.
15647
+ * @format double
15648
+ */
15649
+ updated_confidence: number;
15650
+ }
15569
15651
  /** DTO for UIAction — all actions reference OSFQL execution */
15570
15652
  type UIActionDto$1 = {
15571
15653
  field_types: Record<string, string>;
@@ -16748,10 +16830,26 @@ declare class Sorts<SecurityDataType = unknown> {
16748
16830
  * Defaults to false (system sorts are excluded by default).
16749
16831
  */
16750
16832
  include_system?: boolean;
16833
+ /**
16834
+ * Maximum number of sorts to return. When omitted, no cap is
16835
+ * applied (legacy behaviour). Recommended page size for
16836
+ * production tenants: 50_000.
16837
+ * @min 0
16838
+ */
16839
+ limit?: number | null;
16751
16840
  /** Filter to only show LLM-extracted sorts */
16752
16841
  llm_extracted?: boolean | null;
16753
16842
  /** Filter to only show sorts needing review */
16754
16843
  needs_review?: boolean | null;
16844
+ /**
16845
+ * Zero-indexed pagination offset. Combined with ``limit`` this
16846
+ * lets clients stream a production tenant (1 M+ sorts, ~500 MB
16847
+ * uncompressed) as a sequence of small responses, avoiding the
16848
+ * ``IncompleteRead`` a single-response transfer reliably hits
16849
+ * above ~30 MB.
16850
+ * @min 0
16851
+ */
16852
+ offset?: number | null;
16755
16853
  }, params?: RequestParams) => Promise<HttpResponse<SortListResponse$1, any>>;
16756
16854
  /**
16757
16855
  * @description POST /api/v1/sorts/learned-similarities/reject Rejects a proposed or conflicted learned similarity with a reason. Rejected similarities are not used in reasoning.
@@ -20551,6 +20649,26 @@ declare class Query<SecurityDataType = unknown> {
20551
20649
  * @secure
20552
20650
  */
20553
20651
  osfSearch: (data: OsfSearchRequest$1, params?: RequestParams) => Promise<HttpResponse<OsfSearchResponse$1, any>>;
20652
+ /**
20653
+ * @description Skips the NL → structured-problem LLM hop entirely. Caller must have seeded the tenant KB with ≥ 3 successful + ≥ 2 limited Ψ-terms per domain (`/api/v1/terms/bulk` or `/api/v1/inference/facts/bulk`). Returns the same `NlQueryResponse` shape as the NL route so the UI can render either output uniformly.
20654
+ *
20655
+ * @tags query
20656
+ * @name TrizInvent
20657
+ * @summary Handle `POST /api/v1/triz/invent` — deterministic TRIZ invention.
20658
+ * @request POST:/api/v1/triz/invent
20659
+ * @secure
20660
+ */
20661
+ trizInvent: (data: TrizInventRequest, params?: RequestParams) => Promise<HttpResponse<NlQueryResponse$1, any>>;
20662
+ /**
20663
+ * No description
20664
+ *
20665
+ * @tags query
20666
+ * @name TrizRecordOutcome
20667
+ * @summary Handle `POST /api/v1/triz/record-outcome` — persist a measured outcome for a previously-emitted TRIZ proposal and learn from it.
20668
+ * @request POST:/api/v1/triz/record-outcome
20669
+ * @secure
20670
+ */
20671
+ trizRecordOutcome: (data: TrizRecordOutcomeRequest, params?: RequestParams) => Promise<HttpResponse<TrizRecordOutcomeResponse, any>>;
20554
20672
  /**
20555
20673
  * @description This performs unification AND validates the result against the GLB sort's witnesses. ## How It Differs from Regular Unification **Regular `/api/v1/term-store/sessions/:id/unify` (POST)**: - Computes GLB and unifies terms - Validates sort constraints (required features, type hints) - Does NOT check witnesses **This endpoint `/api/v1/query/validated-unify` (POST)**: - Computes GLB and unifies terms - Validates sort constraints - ALSO checks witnesses on the result - Returns proof of validity ## Example Unifying `person(name => "Alice")` with `grandparent(grandchild => "Charlie")`: 1. Computes GLB of person and grandparent 2. Creates unified term with both features 3. Checks grandparent witnesses: ∃Y. parent(Alice,Y) ∧ parent(Y,Charlie) 4. Returns unified term + witness proof
20556
20674
  *
@@ -30924,8 +31042,15 @@ interface CommitRequest {
30924
31042
  * - `"solutions"`: enumerate complete, valid assignments (default — backward compatible).
30925
31043
  * - `"feasibility"`: run 2×N per-variable SAT queries and return reachability info.
30926
31044
  * Much faster than full enumeration for large spaces.
30927
- */
30928
- type SearchModeDto = 'solutions' | 'feasibility';
31045
+ * - `"scheduling"`: route the space through the specialised **bipartite network-flow
31046
+ * engine** for scheduling-shaped problems (nurses × days × shifts with per-slot
31047
+ * demand and role minimums). Orders of magnitude faster than `"feasibility"` for
31048
+ * problems that fit this shape, and always returns fully `verified: true` results.
31049
+ * If the underlying problem's constraint shape cannot be modelled by the flow
31050
+ * engine, the backend responds with a 400 and the caller should fall back to
31051
+ * `"feasibility"`.
31052
+ */
31053
+ type SearchModeDto = 'solutions' | 'feasibility' | 'scheduling';
30929
31054
  /**
30930
31055
  * Reachability of a single binary choice-point variable.
30931
31056
  *
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/config.ts
2
- var SDK_VERSION = "0.16.0";
2
+ var SDK_VERSION = "0.17.0";
3
3
  function resolveConfig(config) {
4
4
  if (!config.baseUrl) {
5
5
  throw new Error("ClientConfig.baseUrl is required");
@@ -5109,6 +5109,42 @@ var Query = class {
5109
5109
  format: "json",
5110
5110
  ...params
5111
5111
  });
5112
+ /**
5113
+ * @description Skips the NL → structured-problem LLM hop entirely. Caller must have seeded the tenant KB with ≥ 3 successful + ≥ 2 limited Ψ-terms per domain (`/api/v1/terms/bulk` or `/api/v1/inference/facts/bulk`). Returns the same `NlQueryResponse` shape as the NL route so the UI can render either output uniformly.
5114
+ *
5115
+ * @tags query
5116
+ * @name TrizInvent
5117
+ * @summary Handle `POST /api/v1/triz/invent` — deterministic TRIZ invention.
5118
+ * @request POST:/api/v1/triz/invent
5119
+ * @secure
5120
+ */
5121
+ trizInvent = (data, params = {}) => this.http.request({
5122
+ path: `/api/v1/triz/invent`,
5123
+ method: "POST",
5124
+ body: data,
5125
+ secure: true,
5126
+ type: "application/json" /* Json */,
5127
+ format: "json",
5128
+ ...params
5129
+ });
5130
+ /**
5131
+ * No description
5132
+ *
5133
+ * @tags query
5134
+ * @name TrizRecordOutcome
5135
+ * @summary Handle `POST /api/v1/triz/record-outcome` — persist a measured outcome for a previously-emitted TRIZ proposal and learn from it.
5136
+ * @request POST:/api/v1/triz/record-outcome
5137
+ * @secure
5138
+ */
5139
+ trizRecordOutcome = (data, params = {}) => this.http.request({
5140
+ path: `/api/v1/triz/record-outcome`,
5141
+ method: "POST",
5142
+ body: data,
5143
+ secure: true,
5144
+ type: "application/json" /* Json */,
5145
+ format: "json",
5146
+ ...params
5147
+ });
5112
5148
  /**
5113
5149
  * @description This performs unification AND validates the result against the GLB sort's witnesses. ## How It Differs from Regular Unification **Regular `/api/v1/term-store/sessions/:id/unify` (POST)**: - Computes GLB and unifies terms - Validates sort constraints (required features, type hints) - Does NOT check witnesses **This endpoint `/api/v1/query/validated-unify` (POST)**: - Computes GLB and unifies terms - Validates sort constraints - ALSO checks witnesses on the result - Returns proof of validity ## Example Unifying `person(name => "Alice")` with `grandparent(grandchild => "Charlie")`: 1. Computes GLB of person and grandparent 2. Creates unified term with both features 3. Checks grandparent witnesses: ∃Y. parent(Alice,Y) ∧ parent(Y,Charlie) 4. Returns unified term + witness proof
5114
5150
  *