@kortexya/reasoninglayer 0.1.6 → 0.2.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/README.md CHANGED
@@ -7,8 +7,8 @@ TypeScript SDK for the [Reasoning Layer](https://kortexya.com) API — a knowled
7
7
  - **Zero runtime dependencies** — only `fetch` and `AbortController` (ES2022)
8
8
  - **Dual ESM/CJS** — works in Node 18+, modern browsers, Deno, and Bun
9
9
  - **Full type safety** — strict TypeScript with discriminated unions, no `any` types
10
- - **28 resource clients** covering sorts, terms, inference, query, fuzzy logic, cognitive agents, causal reasoning, and more
11
- - **7 builder namespaces** — `Value`, `FeatureInput`, `TermInput`, `guard`, `SortBuilder`, `psi`, `allen`
10
+ - **29 resource clients** covering sorts, terms, inference, query, fuzzy logic, cognitive agents, causal reasoning, optimization, and more
11
+ - **8 builder namespaces** — `Value`, `FeatureInput`, `TermInput`, `guard`, `SortBuilder`, `psi`, `allen`, `LP`
12
12
  - **Automatic retry** — exponential backoff with jitter on 429 and 503 responses
13
13
  - **WebSocket** — real-time cognitive agent event subscriptions with auto-reconnect
14
14
  - **Error hierarchy** — typed errors for constraint violations, rate limits, timeouts, and network failures
@@ -107,6 +107,7 @@ console.log(result.solutions); // Solutions with bindings
107
107
  | `actionReviews` | Action reviews | approve, reject, modify autonomous actions |
108
108
  | `discovery` | Discovery | causal effect discovery, prediction |
109
109
  | `extract` | Extraction | entity extraction from text |
110
+ | `optimize` | Optimization | LP solve, KB-driven optimization |
110
111
 
111
112
  ## Configuration
112
113
 
@@ -167,7 +168,7 @@ try {
167
168
  The SDK provides builder functions for constructing API request values with full type safety:
168
169
 
169
170
  ```typescript
170
- import { Value, FeatureInput, TermInput, guard, allen, SortBuilder, psi } from '@kortexya/reasoninglayer';
171
+ import { Value, FeatureInput, TermInput, guard, allen, SortBuilder, psi, LP } from '@kortexya/reasoninglayer';
171
172
 
172
173
  // Tagged values (term CRUD)
173
174
  Value.string('hello') // { type: 'String', value: 'hello' }
@@ -185,6 +186,11 @@ guard('gt', 100) // { guard: { op: 'gt', value: 100 } }
185
186
  // Allen temporal relations
186
187
  allen('before') // { allen: 'before' }
187
188
 
189
+ // LP optimization
190
+ LP.maximize({ x: 3, y: 5 }) // objective function
191
+ LP.constraint({ x: 1, y: 3 }, '<=', 12) // linear constraint
192
+ LP.nonNegative('x', 'y') // variable bounds
193
+
188
194
  // Fluent sort builder
189
195
  new SortBuilder('employee')
190
196
  .parents(['person'])