@kortexya/reasoninglayer 1.0.1 → 1.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 +892 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2026 -13
- package/dist/index.d.ts +2026 -13
- package/dist/index.js +890 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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 = "1.0
|
|
8
|
+
var SDK_VERSION = "1.2.0";
|
|
9
9
|
function resolveConfig(config) {
|
|
10
10
|
if (!config.baseUrl) {
|
|
11
11
|
throw new Error("ClientConfig.baseUrl is required");
|
|
@@ -1517,6 +1517,24 @@ var Inference = class {
|
|
|
1517
1517
|
format: "json",
|
|
1518
1518
|
...params
|
|
1519
1519
|
});
|
|
1520
|
+
/**
|
|
1521
|
+
* @description In OSF/LIFE terms, an orchestrator wires neural sort-subsumption gates (`τ(x ⊑ S) ∈ [0, 1]`) for a conclusion sort and a set of antecedent sorts. Knowledge axioms reference homoiconic rule Ψ-terms registered in the tenant's KB. The first call lazily instantiates the underlying Candle-backed gates; subsequent calls within the same tenant share gate state. # Authorization Requires `X-Tenant-Id` header.
|
|
1522
|
+
*
|
|
1523
|
+
* @tags inference
|
|
1524
|
+
* @name ConfigureOrchestrator
|
|
1525
|
+
* @summary Register an OSF Neural-Predicate Orchestrator configuration for the calling tenant.
|
|
1526
|
+
* @request POST:/api/v1/inference/orchestrator/configure
|
|
1527
|
+
* @secure
|
|
1528
|
+
*/
|
|
1529
|
+
configureOrchestrator = (data, params = {}) => this.http.request({
|
|
1530
|
+
path: `/api/v1/inference/orchestrator/configure`,
|
|
1531
|
+
method: "POST",
|
|
1532
|
+
body: data,
|
|
1533
|
+
secure: true,
|
|
1534
|
+
type: "application/json" /* Json */,
|
|
1535
|
+
format: "json",
|
|
1536
|
+
...params
|
|
1537
|
+
});
|
|
1520
1538
|
/**
|
|
1521
1539
|
* @description # TRUE HOMOICONICITY Goals are first-class Ψ-terms that can be created, persisted, and reused. This endpoint creates a goal from clauses and optional constraints, persists it to PostgreSQL, and returns the goal ID for later use. # Authorization Requires X-Tenant-Id header.
|
|
1522
1540
|
*
|
|
@@ -1688,6 +1706,42 @@ var Inference = class {
|
|
|
1688
1706
|
format: "json",
|
|
1689
1707
|
...params
|
|
1690
1708
|
});
|
|
1709
|
+
/**
|
|
1710
|
+
* @description In OSF/LIFE terms, the orchestrator forwards the Ψ-term through the conclusion gate to read `τ(x ⊑ conclusion_sort)`, then for each knowledge axiom evaluates its antecedent gates and combines them with the conclusion truth via Reichenbach (`1 − a + a · c`). The fused confidence aggregates per-axiom modus-ponens witness strength via noisy-OR. # Authorization Requires `X-Tenant-Id` header.
|
|
1711
|
+
*
|
|
1712
|
+
* @tags inference
|
|
1713
|
+
* @name PredictWithOrchestrator
|
|
1714
|
+
* @summary Score a single Ψ-term: conclusion subsumption probability + per-axiom firing trace + noisy-OR fused confidence.
|
|
1715
|
+
* @request POST:/api/v1/inference/orchestrator/predict
|
|
1716
|
+
* @secure
|
|
1717
|
+
*/
|
|
1718
|
+
predictWithOrchestrator = (data, params = {}) => this.http.request({
|
|
1719
|
+
path: `/api/v1/inference/orchestrator/predict`,
|
|
1720
|
+
method: "POST",
|
|
1721
|
+
body: data,
|
|
1722
|
+
secure: true,
|
|
1723
|
+
type: "application/json" /* Json */,
|
|
1724
|
+
format: "json",
|
|
1725
|
+
...params
|
|
1726
|
+
});
|
|
1727
|
+
/**
|
|
1728
|
+
* @description In OSF/LIFE terms, the orchestrator pushes the conclusion gate and each antecedent gate toward the dual-weighted satisfaction objective `1 − ( w_D · K_D + w_K · K_K )` (paper eq. 4). Each call performs exactly one epoch over the supplied batch — the response carries the per-epoch metrics for that single epoch (multi-epoch aggregation is the caller's responsibility). # Authorization Requires `X-Tenant-Id` header.
|
|
1729
|
+
*
|
|
1730
|
+
* @tags inference
|
|
1731
|
+
* @name TrainOrchestrator
|
|
1732
|
+
* @summary Run one training epoch over a labelled Ψ-term batch.
|
|
1733
|
+
* @request POST:/api/v1/inference/orchestrator/train
|
|
1734
|
+
* @secure
|
|
1735
|
+
*/
|
|
1736
|
+
trainOrchestrator = (data, params = {}) => this.http.request({
|
|
1737
|
+
path: `/api/v1/inference/orchestrator/train`,
|
|
1738
|
+
method: "POST",
|
|
1739
|
+
body: data,
|
|
1740
|
+
secure: true,
|
|
1741
|
+
type: "application/json" /* Json */,
|
|
1742
|
+
format: "json",
|
|
1743
|
+
...params
|
|
1744
|
+
});
|
|
1691
1745
|
};
|
|
1692
1746
|
|
|
1693
1747
|
// src/api-spec/generated/Cognitive.ts
|
|
@@ -4269,6 +4323,24 @@ var Visualization = class {
|
|
|
4269
4323
|
constructor(http) {
|
|
4270
4324
|
this.http = http;
|
|
4271
4325
|
}
|
|
4326
|
+
/**
|
|
4327
|
+
* @description Note: when MVCC branching isn't materialized as named branches in the user's store, this endpoint surfaces an empty diff. The shape is preserved so clients can rely on it without conditional code.
|
|
4328
|
+
*
|
|
4329
|
+
* @tags visualization
|
|
4330
|
+
* @name GetBranchDiffVisualization
|
|
4331
|
+
* @summary Render the diff between two MVCC branches of the tenant's term store. Each visible Ψ-term carries `properties.diff` ∈ `{added, removed, changed}` so the renderer can color-distinguish.
|
|
4332
|
+
* @request POST:/api/v1/visualization/branch-diff
|
|
4333
|
+
* @secure
|
|
4334
|
+
*/
|
|
4335
|
+
getBranchDiffVisualization = (data, params = {}) => this.http.request({
|
|
4336
|
+
path: `/api/v1/visualization/branch-diff`,
|
|
4337
|
+
method: "POST",
|
|
4338
|
+
body: data,
|
|
4339
|
+
secure: true,
|
|
4340
|
+
type: "application/json" /* Json */,
|
|
4341
|
+
format: "json",
|
|
4342
|
+
...params
|
|
4343
|
+
});
|
|
4272
4344
|
/**
|
|
4273
4345
|
* No description
|
|
4274
4346
|
*
|
|
@@ -4287,6 +4359,75 @@ var Visualization = class {
|
|
|
4287
4359
|
format: "json",
|
|
4288
4360
|
...params
|
|
4289
4361
|
});
|
|
4362
|
+
/**
|
|
4363
|
+
* @description Each event is a JSON-encoded `DerivationStepEvent` with shape: ```json { "iteration": 3, "rule_id": "uuid", "antecedents": ["uuid",...], "derived_fact": "uuid" } ``` Sent once per record produced during the chainer pass. The client can animate each polygon emerging as its premise edges arrive.
|
|
4364
|
+
*
|
|
4365
|
+
* @tags visualization
|
|
4366
|
+
* @name GetDerivationStream
|
|
4367
|
+
* @summary SSE channel that streams the forward-chainer's derivation steps as they fire, instead of blocking until the full trace is assembled.
|
|
4368
|
+
* @request GET:/api/v1/visualization/derivation/stream
|
|
4369
|
+
* @secure
|
|
4370
|
+
*/
|
|
4371
|
+
getDerivationStream = (params = {}) => this.http.request({
|
|
4372
|
+
path: `/api/v1/visualization/derivation/stream`,
|
|
4373
|
+
method: "GET",
|
|
4374
|
+
secure: true,
|
|
4375
|
+
...params
|
|
4376
|
+
});
|
|
4377
|
+
/**
|
|
4378
|
+
* @description Runs the homoiconic forward chainer with provenance enabled and emits a [`VisualizationGraph`] in which: - **Nodes** are Ψ-terms (each one is either an asserted fact, a rule, or a derived fact). Rules surface as `NodeType::Rule`. - **Edges** are `EdgeType::Derivation`, oriented antecedent → rule-application → produced-fact, mirroring the proof DAG. - **Hyperedges** are `HyperedgeType::DerivationStep` — one per rule application, grouping the rule with all its antecedents plus the produced fact. Rendering each step as a polygon makes "this fact came from these premises via this rule" visually atomic — exactly the idea behind Aït-Kaci & Sasaki's proof-tree diagrams in OSF/LIFE papers.
|
|
4379
|
+
*
|
|
4380
|
+
* @tags visualization
|
|
4381
|
+
* @name GetDerivationVisualization
|
|
4382
|
+
* @summary Get the forward-chain derivation lattice as a meta-hypergraph.
|
|
4383
|
+
* @request POST:/api/v1/visualization/derivation
|
|
4384
|
+
* @secure
|
|
4385
|
+
*/
|
|
4386
|
+
getDerivationVisualization = (data, params = {}) => this.http.request({
|
|
4387
|
+
path: `/api/v1/visualization/derivation`,
|
|
4388
|
+
method: "POST",
|
|
4389
|
+
body: data,
|
|
4390
|
+
secure: true,
|
|
4391
|
+
type: "application/json" /* Json */,
|
|
4392
|
+
format: "json",
|
|
4393
|
+
...params
|
|
4394
|
+
});
|
|
4395
|
+
/**
|
|
4396
|
+
* No description
|
|
4397
|
+
*
|
|
4398
|
+
* @tags visualization
|
|
4399
|
+
* @name GetFunctionsVisualization
|
|
4400
|
+
* @summary Render the LIFE-style function definitions in the tenant's term store. A LIFE function is itself a Ψ-term (homoiconic) — typically a term whose sort is `function` (or a subtype) carrying features `head`, `body`, optional `equations`. This handler scans the store for terms matching that signature and emits one TermFeatures-style hyperedge per function so each is visually atomic.
|
|
4401
|
+
* @request POST:/api/v1/visualization/functions
|
|
4402
|
+
* @secure
|
|
4403
|
+
*/
|
|
4404
|
+
getFunctionsVisualization = (data, params = {}) => this.http.request({
|
|
4405
|
+
path: `/api/v1/visualization/functions`,
|
|
4406
|
+
method: "POST",
|
|
4407
|
+
body: data,
|
|
4408
|
+
secure: true,
|
|
4409
|
+
type: "application/json" /* Json */,
|
|
4410
|
+
format: "json",
|
|
4411
|
+
...params
|
|
4412
|
+
});
|
|
4413
|
+
/**
|
|
4414
|
+
* No description
|
|
4415
|
+
*
|
|
4416
|
+
* @tags visualization
|
|
4417
|
+
* @name GetGradedPosetVisualization
|
|
4418
|
+
* @summary Render the graded-poset projection of the tenant's sort hierarchy per "Weisfeiler & Lehman Go Categorical" (Choi, Kim, Yun 2026): - elements = sorts - dimension(σ) = topological depth from the lattice top - coverings = parent → child (subtype) - 4-adjacency edges when requested
|
|
4419
|
+
* @request POST:/api/v1/visualization/graded-poset
|
|
4420
|
+
* @secure
|
|
4421
|
+
*/
|
|
4422
|
+
getGradedPosetVisualization = (data, params = {}) => this.http.request({
|
|
4423
|
+
path: `/api/v1/visualization/graded-poset`,
|
|
4424
|
+
method: "POST",
|
|
4425
|
+
body: data,
|
|
4426
|
+
secure: true,
|
|
4427
|
+
type: "application/json" /* Json */,
|
|
4428
|
+
format: "json",
|
|
4429
|
+
...params
|
|
4430
|
+
});
|
|
4290
4431
|
/**
|
|
4291
4432
|
* No description
|
|
4292
4433
|
*
|
|
@@ -4320,6 +4461,24 @@ var Visualization = class {
|
|
|
4320
4461
|
secure: true,
|
|
4321
4462
|
...params
|
|
4322
4463
|
});
|
|
4464
|
+
/**
|
|
4465
|
+
* @description The layout is computed once per tenant (per hierarchy snapshot) and cached. Coordinates are stable across requests, so the client can pan/zoom by submitting different bboxes and the same node always lands at the same screen position.
|
|
4466
|
+
*
|
|
4467
|
+
* @tags visualization
|
|
4468
|
+
* @name GetLatticeTile
|
|
4469
|
+
* @summary Render only the lattice nodes that fall inside the client's viewport, using a stable pre-computed deterministic layout. This scales to millions of sorts because the per-request work is O(K) where K is the number of nodes inside the viewport, not O(N).
|
|
4470
|
+
* @request POST:/api/v1/visualization/lattice-tile
|
|
4471
|
+
* @secure
|
|
4472
|
+
*/
|
|
4473
|
+
getLatticeTile = (data, params = {}) => this.http.request({
|
|
4474
|
+
path: `/api/v1/visualization/lattice-tile`,
|
|
4475
|
+
method: "POST",
|
|
4476
|
+
body: data,
|
|
4477
|
+
secure: true,
|
|
4478
|
+
type: "application/json" /* Json */,
|
|
4479
|
+
format: "json",
|
|
4480
|
+
...params
|
|
4481
|
+
});
|
|
4323
4482
|
/**
|
|
4324
4483
|
* @description Returns a graph representation of the sort hierarchy with nodes for each sort and edges for subtype relationships. Supports filtering by root sort and depth.
|
|
4325
4484
|
*
|
|
@@ -4356,6 +4515,42 @@ var Visualization = class {
|
|
|
4356
4515
|
format: "json",
|
|
4357
4516
|
...params
|
|
4358
4517
|
});
|
|
4518
|
+
/**
|
|
4519
|
+
* @description BFS expands ancestors and/or descendants from the focus, emitting each visited sort with its signed hop distance as `level`. When the visit count would exceed `max_nodes`, the BFS halts and the `truncated` flag is set; the closest sorts are kept.
|
|
4520
|
+
*
|
|
4521
|
+
* @tags visualization
|
|
4522
|
+
* @name GetSortNeighborhood
|
|
4523
|
+
* @summary Render an N-hop neighborhood around a focus sort, capped at `max_nodes`. Designed for tenants with millions of sorts — the client never sees the full lattice; it browses by picking a focus and walking outward.
|
|
4524
|
+
* @request POST:/api/v1/visualization/sort-neighborhood
|
|
4525
|
+
* @secure
|
|
4526
|
+
*/
|
|
4527
|
+
getSortNeighborhood = (data, params = {}) => this.http.request({
|
|
4528
|
+
path: `/api/v1/visualization/sort-neighborhood`,
|
|
4529
|
+
method: "POST",
|
|
4530
|
+
body: data,
|
|
4531
|
+
secure: true,
|
|
4532
|
+
type: "application/json" /* Json */,
|
|
4533
|
+
format: "json",
|
|
4534
|
+
...params
|
|
4535
|
+
});
|
|
4536
|
+
/**
|
|
4537
|
+
* No description
|
|
4538
|
+
*
|
|
4539
|
+
* @tags visualization
|
|
4540
|
+
* @name GetTermListVisualization
|
|
4541
|
+
* @summary Paginated raw list of Ψ-terms for visualization. Mirrors the `lattice` endpoint but for terms — at 9M terms in the drug-discovery tenant the first page returns sub-second without loading the in-memory term store.
|
|
4542
|
+
* @request POST:/api/v1/visualization/term-list
|
|
4543
|
+
* @secure
|
|
4544
|
+
*/
|
|
4545
|
+
getTermListVisualization = (data, params = {}) => this.http.request({
|
|
4546
|
+
path: `/api/v1/visualization/term-list`,
|
|
4547
|
+
method: "POST",
|
|
4548
|
+
body: data,
|
|
4549
|
+
secure: true,
|
|
4550
|
+
type: "application/json" /* Json */,
|
|
4551
|
+
format: "json",
|
|
4552
|
+
...params
|
|
4553
|
+
});
|
|
4359
4554
|
/**
|
|
4360
4555
|
* No description
|
|
4361
4556
|
*
|
|
@@ -4390,6 +4585,24 @@ var Visualization = class {
|
|
|
4390
4585
|
format: "json",
|
|
4391
4586
|
...params
|
|
4392
4587
|
});
|
|
4588
|
+
/**
|
|
4589
|
+
* @description **Unify (`⊔`)**: computes the meet on the Ψ-term lattice — the most-specific term that subsumes both operands. Variables in either operand bind to the corresponding sub-term in the other. **Anti-unify (`⊓`)**: computes the join — the least-general generalization (LGG) that subsumes both operands, introducing fresh variables where they disagree. This is the operation Aït-Kaci & Sasaki used for ILP rule synthesis. The handler runs the operation in a sandbox (trail-undone after snapshot) so the tenant's term store is not mutated by a visualization request. Returns operand1, operand2, and the result as polygons in one `VisualizationGraph`, with `properties.role` distinguishing each.
|
|
4590
|
+
*
|
|
4591
|
+
* @tags visualization
|
|
4592
|
+
* @name GetUnifyTermsVisualization
|
|
4593
|
+
* @summary Render the unification (or anti-unification) of two Ψ-terms.
|
|
4594
|
+
* @request POST:/api/v1/visualization/unify-terms
|
|
4595
|
+
* @secure
|
|
4596
|
+
*/
|
|
4597
|
+
getUnifyTermsVisualization = (data, params = {}) => this.http.request({
|
|
4598
|
+
path: `/api/v1/visualization/unify-terms`,
|
|
4599
|
+
method: "POST",
|
|
4600
|
+
body: data,
|
|
4601
|
+
secure: true,
|
|
4602
|
+
type: "application/json" /* Json */,
|
|
4603
|
+
format: "json",
|
|
4604
|
+
...params
|
|
4605
|
+
});
|
|
4393
4606
|
/**
|
|
4394
4607
|
* No description
|
|
4395
4608
|
*
|
|
@@ -7438,6 +7651,100 @@ var Scheduling = class {
|
|
|
7438
7651
|
});
|
|
7439
7652
|
};
|
|
7440
7653
|
|
|
7654
|
+
// src/api-spec/generated/FlowNetworks.ts
|
|
7655
|
+
var FlowNetworks = class {
|
|
7656
|
+
http;
|
|
7657
|
+
constructor(http) {
|
|
7658
|
+
this.http = http;
|
|
7659
|
+
}
|
|
7660
|
+
/**
|
|
7661
|
+
* No description
|
|
7662
|
+
*
|
|
7663
|
+
* @tags flow-networks
|
|
7664
|
+
* @name CloneFlowNetwork
|
|
7665
|
+
* @summary Clone a flow network for what-if analysis.
|
|
7666
|
+
* @request POST:/api/v1/flow-networks/{network_id}/clone
|
|
7667
|
+
* @secure
|
|
7668
|
+
*/
|
|
7669
|
+
cloneFlowNetwork = (networkId, params = {}) => this.http.request({
|
|
7670
|
+
path: `/api/v1/flow-networks/${networkId}/clone`,
|
|
7671
|
+
method: "POST",
|
|
7672
|
+
secure: true,
|
|
7673
|
+
format: "json",
|
|
7674
|
+
...params
|
|
7675
|
+
});
|
|
7676
|
+
/**
|
|
7677
|
+
* No description
|
|
7678
|
+
*
|
|
7679
|
+
* @tags flow-networks
|
|
7680
|
+
* @name CommitFlowNetwork
|
|
7681
|
+
* @summary Commit structural mutations (capacity updates and/or new edges).
|
|
7682
|
+
* @request POST:/api/v1/flow-networks/{network_id}/commit
|
|
7683
|
+
* @secure
|
|
7684
|
+
*/
|
|
7685
|
+
commitFlowNetwork = (networkId, data, params = {}) => this.http.request({
|
|
7686
|
+
path: `/api/v1/flow-networks/${networkId}/commit`,
|
|
7687
|
+
method: "POST",
|
|
7688
|
+
body: data,
|
|
7689
|
+
secure: true,
|
|
7690
|
+
type: "application/json" /* Json */,
|
|
7691
|
+
format: "json",
|
|
7692
|
+
...params
|
|
7693
|
+
});
|
|
7694
|
+
/**
|
|
7695
|
+
* No description
|
|
7696
|
+
*
|
|
7697
|
+
* @tags flow-networks
|
|
7698
|
+
* @name CreateFlowNetwork
|
|
7699
|
+
* @summary Create a new flow network.
|
|
7700
|
+
* @request POST:/api/v1/flow-networks
|
|
7701
|
+
* @secure
|
|
7702
|
+
*/
|
|
7703
|
+
createFlowNetwork = (data, params = {}) => this.http.request({
|
|
7704
|
+
path: `/api/v1/flow-networks`,
|
|
7705
|
+
method: "POST",
|
|
7706
|
+
body: data,
|
|
7707
|
+
secure: true,
|
|
7708
|
+
type: "application/json" /* Json */,
|
|
7709
|
+
format: "json",
|
|
7710
|
+
...params
|
|
7711
|
+
});
|
|
7712
|
+
/**
|
|
7713
|
+
* No description
|
|
7714
|
+
*
|
|
7715
|
+
* @tags flow-networks
|
|
7716
|
+
* @name GetFlowNetwork
|
|
7717
|
+
* @summary Get a flow network's status.
|
|
7718
|
+
* @request GET:/api/v1/flow-networks/{network_id}
|
|
7719
|
+
* @secure
|
|
7720
|
+
*/
|
|
7721
|
+
getFlowNetwork = (networkId, params = {}) => this.http.request({
|
|
7722
|
+
path: `/api/v1/flow-networks/${networkId}`,
|
|
7723
|
+
method: "GET",
|
|
7724
|
+
secure: true,
|
|
7725
|
+
format: "json",
|
|
7726
|
+
...params
|
|
7727
|
+
});
|
|
7728
|
+
/**
|
|
7729
|
+
* No description
|
|
7730
|
+
*
|
|
7731
|
+
* @tags flow-networks
|
|
7732
|
+
* @name SolveFlowNetwork
|
|
7733
|
+
* @summary Solve a flow network with the chosen algorithm.
|
|
7734
|
+
* @request POST:/api/v1/flow-networks/{network_id}/solve
|
|
7735
|
+
* @secure
|
|
7736
|
+
*/
|
|
7737
|
+
solveFlowNetwork = (networkId, data, params = {}) => this.http.request({
|
|
7738
|
+
path: `/api/v1/flow-networks/${networkId}/solve`,
|
|
7739
|
+
method: "POST",
|
|
7740
|
+
body: data,
|
|
7741
|
+
secure: true,
|
|
7742
|
+
type: "application/json" /* Json */,
|
|
7743
|
+
format: "json",
|
|
7744
|
+
...params
|
|
7745
|
+
});
|
|
7746
|
+
};
|
|
7747
|
+
|
|
7441
7748
|
// src/api-spec/generated/Admin.ts
|
|
7442
7749
|
var Admin = class {
|
|
7443
7750
|
http;
|
|
@@ -7743,6 +8050,155 @@ var Ui = class {
|
|
|
7743
8050
|
});
|
|
7744
8051
|
};
|
|
7745
8052
|
|
|
8053
|
+
// src/api-spec/generated/Compliance.ts
|
|
8054
|
+
var Compliance = class {
|
|
8055
|
+
http;
|
|
8056
|
+
constructor(http) {
|
|
8057
|
+
this.http = http;
|
|
8058
|
+
}
|
|
8059
|
+
/**
|
|
8060
|
+
* No description
|
|
8061
|
+
*
|
|
8062
|
+
* @tags compliance
|
|
8063
|
+
* @name Append
|
|
8064
|
+
* @summary `POST /api/v1/compliance/audit/append`
|
|
8065
|
+
* @request POST:/api/v1/compliance/audit/append
|
|
8066
|
+
* @secure
|
|
8067
|
+
*/
|
|
8068
|
+
append = (data, params = {}) => this.http.request({
|
|
8069
|
+
path: `/api/v1/compliance/audit/append`,
|
|
8070
|
+
method: "POST",
|
|
8071
|
+
body: data,
|
|
8072
|
+
secure: true,
|
|
8073
|
+
type: "application/json" /* Json */,
|
|
8074
|
+
format: "json",
|
|
8075
|
+
...params
|
|
8076
|
+
});
|
|
8077
|
+
/**
|
|
8078
|
+
* No description
|
|
8079
|
+
*
|
|
8080
|
+
* @tags compliance
|
|
8081
|
+
* @name CaptureSnapshot
|
|
8082
|
+
* @summary `POST /api/v1/predictions/snapshot`
|
|
8083
|
+
* @request POST:/api/v1/predictions/snapshot
|
|
8084
|
+
* @secure
|
|
8085
|
+
*/
|
|
8086
|
+
captureSnapshot = (data, params = {}) => this.http.request({
|
|
8087
|
+
path: `/api/v1/predictions/snapshot`,
|
|
8088
|
+
method: "POST",
|
|
8089
|
+
body: data,
|
|
8090
|
+
secure: true,
|
|
8091
|
+
type: "application/json" /* Json */,
|
|
8092
|
+
format: "json",
|
|
8093
|
+
...params
|
|
8094
|
+
});
|
|
8095
|
+
/**
|
|
8096
|
+
* No description
|
|
8097
|
+
*
|
|
8098
|
+
* @tags compliance
|
|
8099
|
+
* @name GetSnapshot
|
|
8100
|
+
* @summary `GET /api/v1/predictions/snapshot/{id}`
|
|
8101
|
+
* @request GET:/api/v1/predictions/snapshot/{id}
|
|
8102
|
+
* @secure
|
|
8103
|
+
*/
|
|
8104
|
+
getSnapshot = (id, params = {}) => this.http.request({
|
|
8105
|
+
path: `/api/v1/predictions/snapshot/${id}`,
|
|
8106
|
+
method: "GET",
|
|
8107
|
+
secure: true,
|
|
8108
|
+
format: "json",
|
|
8109
|
+
...params
|
|
8110
|
+
});
|
|
8111
|
+
/**
|
|
8112
|
+
* No description
|
|
8113
|
+
*
|
|
8114
|
+
* @tags compliance
|
|
8115
|
+
* @name List
|
|
8116
|
+
* @summary `GET /api/v1/compliance/audit/list`
|
|
8117
|
+
* @request GET:/api/v1/compliance/audit/list
|
|
8118
|
+
* @secure
|
|
8119
|
+
*/
|
|
8120
|
+
list = (query, params = {}) => this.http.request({
|
|
8121
|
+
path: `/api/v1/compliance/audit/list`,
|
|
8122
|
+
method: "GET",
|
|
8123
|
+
query,
|
|
8124
|
+
secure: true,
|
|
8125
|
+
format: "json",
|
|
8126
|
+
...params
|
|
8127
|
+
});
|
|
8128
|
+
/**
|
|
8129
|
+
* No description
|
|
8130
|
+
*
|
|
8131
|
+
* @tags compliance
|
|
8132
|
+
* @name Summary
|
|
8133
|
+
* @summary `GET /api/v1/compliance/audit/summary`
|
|
8134
|
+
* @request GET:/api/v1/compliance/audit/summary
|
|
8135
|
+
* @secure
|
|
8136
|
+
*/
|
|
8137
|
+
summary = (params = {}) => this.http.request({
|
|
8138
|
+
path: `/api/v1/compliance/audit/summary`,
|
|
8139
|
+
method: "GET",
|
|
8140
|
+
secure: true,
|
|
8141
|
+
format: "json",
|
|
8142
|
+
...params
|
|
8143
|
+
});
|
|
8144
|
+
/**
|
|
8145
|
+
* @description Runs validation with a built-in stub provider that returns `Pending` for every entry. Real consumers wire their own `GroundTruthProviderPort` implementation and call `PredictionLedgerPort::validate` from a service.
|
|
8146
|
+
*
|
|
8147
|
+
* @tags compliance
|
|
8148
|
+
* @name ValidateStub
|
|
8149
|
+
* @summary `POST /api/v1/predictions/snapshot/{id}/validate-stub`
|
|
8150
|
+
* @request POST:/api/v1/predictions/snapshot/{id}/validate-stub
|
|
8151
|
+
* @secure
|
|
8152
|
+
*/
|
|
8153
|
+
validateStub = (id, params = {}) => this.http.request({
|
|
8154
|
+
path: `/api/v1/predictions/snapshot/${id}/validate-stub`,
|
|
8155
|
+
method: "POST",
|
|
8156
|
+
secure: true,
|
|
8157
|
+
format: "json",
|
|
8158
|
+
...params
|
|
8159
|
+
});
|
|
8160
|
+
/**
|
|
8161
|
+
* No description
|
|
8162
|
+
*
|
|
8163
|
+
* @tags compliance
|
|
8164
|
+
* @name Verify
|
|
8165
|
+
* @summary `GET /api/v1/compliance/audit/verify`
|
|
8166
|
+
* @request GET:/api/v1/compliance/audit/verify
|
|
8167
|
+
* @secure
|
|
8168
|
+
*/
|
|
8169
|
+
verify = (params = {}) => this.http.request({
|
|
8170
|
+
path: `/api/v1/compliance/audit/verify`,
|
|
8171
|
+
method: "GET",
|
|
8172
|
+
secure: true,
|
|
8173
|
+
format: "json",
|
|
8174
|
+
...params
|
|
8175
|
+
});
|
|
8176
|
+
};
|
|
8177
|
+
|
|
8178
|
+
// src/api-spec/generated/Operations.ts
|
|
8179
|
+
var Operations = class {
|
|
8180
|
+
http;
|
|
8181
|
+
constructor(http) {
|
|
8182
|
+
this.http = http;
|
|
8183
|
+
}
|
|
8184
|
+
/**
|
|
8185
|
+
* @description `POST /api/v1/operations/anti-unify` Accepts two Ψ-term ids and returns the LGG term computed by the engine's [`AntiUnificationEngine`](osfkb_domain::operations::ilp::AntiUnificationEngine). The LGG is persisted in the tenant's term store; the response carries both its id and an enriched view (sort name + display name + referenced-term summaries).
|
|
8186
|
+
*
|
|
8187
|
+
* @tags operations
|
|
8188
|
+
* @name AntiUnify
|
|
8189
|
+
* @summary Anti-unify two Ψ-terms (Least General Generalisation).
|
|
8190
|
+
* @request POST:/api/v1/operations/anti-unify
|
|
8191
|
+
*/
|
|
8192
|
+
antiUnify = (data, params = {}) => this.http.request({
|
|
8193
|
+
path: `/api/v1/operations/anti-unify`,
|
|
8194
|
+
method: "POST",
|
|
8195
|
+
body: data,
|
|
8196
|
+
type: "application/json" /* Json */,
|
|
8197
|
+
format: "json",
|
|
8198
|
+
...params
|
|
8199
|
+
});
|
|
8200
|
+
};
|
|
8201
|
+
|
|
7746
8202
|
// src/normalizers/sorts.ts
|
|
7747
8203
|
function ConstraintDtoFromApiToFront(dto) {
|
|
7748
8204
|
if (dto.type === "FuzzyPathSimilarity") {
|
|
@@ -20695,6 +21151,181 @@ var SchedulingClient = class {
|
|
|
20695
21151
|
}
|
|
20696
21152
|
};
|
|
20697
21153
|
|
|
21154
|
+
// src/normalizers/flow-networks.ts
|
|
21155
|
+
function EdgeSpecFromFrontToApi(edge) {
|
|
21156
|
+
const dto = {
|
|
21157
|
+
from: edge.from,
|
|
21158
|
+
to: edge.to,
|
|
21159
|
+
capacity: edge.capacity
|
|
21160
|
+
};
|
|
21161
|
+
if (edge.cost !== void 0 && edge.cost !== null) {
|
|
21162
|
+
dto.cost = edge.cost;
|
|
21163
|
+
}
|
|
21164
|
+
if (edge.label !== void 0 && edge.label !== null) {
|
|
21165
|
+
dto.label = edge.label;
|
|
21166
|
+
}
|
|
21167
|
+
return dto;
|
|
21168
|
+
}
|
|
21169
|
+
function EdgeCapacityUpdateFromFrontToApi(update) {
|
|
21170
|
+
return { label: update.label, capacity: update.capacity };
|
|
21171
|
+
}
|
|
21172
|
+
function CreateFlowNetworkRequestFromFrontToApi(request) {
|
|
21173
|
+
const dto = {
|
|
21174
|
+
nodes: request.nodes,
|
|
21175
|
+
source: request.source,
|
|
21176
|
+
sink: request.sink,
|
|
21177
|
+
edges: request.edges.map(EdgeSpecFromFrontToApi)
|
|
21178
|
+
};
|
|
21179
|
+
if (request.description !== void 0 && request.description !== null) {
|
|
21180
|
+
dto.description = request.description;
|
|
21181
|
+
}
|
|
21182
|
+
return dto;
|
|
21183
|
+
}
|
|
21184
|
+
function CommitFlowNetworkRequestFromFrontToApi(request) {
|
|
21185
|
+
const dto = {};
|
|
21186
|
+
if (request.updateCapacities !== void 0) {
|
|
21187
|
+
dto.update_capacities = request.updateCapacities.map(
|
|
21188
|
+
EdgeCapacityUpdateFromFrontToApi
|
|
21189
|
+
);
|
|
21190
|
+
}
|
|
21191
|
+
if (request.addEdges !== void 0) {
|
|
21192
|
+
dto.add_edges = request.addEdges.map(EdgeSpecFromFrontToApi);
|
|
21193
|
+
}
|
|
21194
|
+
return dto;
|
|
21195
|
+
}
|
|
21196
|
+
function SolveFlowNetworkRequestFromFrontToApi(request) {
|
|
21197
|
+
return { algorithm: request.algorithm };
|
|
21198
|
+
}
|
|
21199
|
+
function FlowNetworkResponseFromApiToFront(dto) {
|
|
21200
|
+
return {
|
|
21201
|
+
id: dto.id,
|
|
21202
|
+
source: dto.source,
|
|
21203
|
+
sink: dto.sink,
|
|
21204
|
+
nodeCount: dto.node_count,
|
|
21205
|
+
edgeCount: dto.edge_count,
|
|
21206
|
+
description: dto.description ?? void 0
|
|
21207
|
+
};
|
|
21208
|
+
}
|
|
21209
|
+
function EdgeFlowFromApiToFront(dto) {
|
|
21210
|
+
return {
|
|
21211
|
+
from: dto.from,
|
|
21212
|
+
to: dto.to,
|
|
21213
|
+
label: dto.label ?? void 0,
|
|
21214
|
+
capacity: dto.capacity,
|
|
21215
|
+
flow: dto.flow
|
|
21216
|
+
};
|
|
21217
|
+
}
|
|
21218
|
+
function EdgeClassificationFromApiToFront(dto) {
|
|
21219
|
+
return {
|
|
21220
|
+
from: dto.from,
|
|
21221
|
+
to: dto.to,
|
|
21222
|
+
label: dto.label ?? void 0,
|
|
21223
|
+
class: dto.class
|
|
21224
|
+
};
|
|
21225
|
+
}
|
|
21226
|
+
function MinCutFromApiToFront(dto) {
|
|
21227
|
+
return {
|
|
21228
|
+
sourceSide: dto.source_side,
|
|
21229
|
+
sinkSide: dto.sink_side,
|
|
21230
|
+
cutEdges: dto.cut_edges.map(EdgeFlowFromApiToFront)
|
|
21231
|
+
};
|
|
21232
|
+
}
|
|
21233
|
+
function SolveFlowNetworkResponseFromApiToFront(dto) {
|
|
21234
|
+
const wireClassifications = dto.classifications;
|
|
21235
|
+
return {
|
|
21236
|
+
algorithm: dto.algorithm,
|
|
21237
|
+
edgeFlows: dto.edge_flows.map(EdgeFlowFromApiToFront),
|
|
21238
|
+
totalFlow: dto.total_flow ?? void 0,
|
|
21239
|
+
totalCost: dto.total_cost ?? void 0,
|
|
21240
|
+
classifications: wireClassifications ? wireClassifications.map(EdgeClassificationFromApiToFront) : void 0,
|
|
21241
|
+
minCut: dto.min_cut ? MinCutFromApiToFront(dto.min_cut) : void 0
|
|
21242
|
+
};
|
|
21243
|
+
}
|
|
21244
|
+
|
|
21245
|
+
// src/resources/flow-networks.ts
|
|
21246
|
+
var FlowNetworksClient = class {
|
|
21247
|
+
/** @internal */
|
|
21248
|
+
api;
|
|
21249
|
+
/** @internal */
|
|
21250
|
+
constructor(api) {
|
|
21251
|
+
this.api = api;
|
|
21252
|
+
}
|
|
21253
|
+
/**
|
|
21254
|
+
* Create and persist a new flow network.
|
|
21255
|
+
*
|
|
21256
|
+
* @param request - graph shape, source/sink, and initial edges.
|
|
21257
|
+
* @returns metadata for the new network (including its id).
|
|
21258
|
+
* @throws HTTP 400 if the input is malformed (duplicate node names,
|
|
21259
|
+
* source/sink not in `nodes`, edges referencing unknown nodes,
|
|
21260
|
+
* negative capacities, duplicate edge labels).
|
|
21261
|
+
*/
|
|
21262
|
+
async create(request) {
|
|
21263
|
+
const response = await this.api.createFlowNetwork(
|
|
21264
|
+
CreateFlowNetworkRequestFromFrontToApi(request)
|
|
21265
|
+
);
|
|
21266
|
+
return FlowNetworkResponseFromApiToFront(response.data);
|
|
21267
|
+
}
|
|
21268
|
+
/**
|
|
21269
|
+
* Fetch the current status snapshot of a flow network.
|
|
21270
|
+
*
|
|
21271
|
+
* @throws HTTP 404 if the id is unknown.
|
|
21272
|
+
*/
|
|
21273
|
+
async get(networkId) {
|
|
21274
|
+
const response = await this.api.getFlowNetwork(networkId);
|
|
21275
|
+
return FlowNetworkResponseFromApiToFront(response.data);
|
|
21276
|
+
}
|
|
21277
|
+
/**
|
|
21278
|
+
* Clone an existing flow network for what-if analysis. The clone
|
|
21279
|
+
* receives a new id and its own mutable graph; the original is
|
|
21280
|
+
* unaffected.
|
|
21281
|
+
*
|
|
21282
|
+
* @throws HTTP 404 if the id is unknown.
|
|
21283
|
+
*/
|
|
21284
|
+
async clone(networkId) {
|
|
21285
|
+
const response = await this.api.cloneFlowNetwork(networkId);
|
|
21286
|
+
return FlowNetworkResponseFromApiToFront(response.data);
|
|
21287
|
+
}
|
|
21288
|
+
/**
|
|
21289
|
+
* Apply structural mutations to an existing network: replace
|
|
21290
|
+
* capacities of labelled edges and/or append new edges. Both
|
|
21291
|
+
* fields on the request are optional; capacity updates apply
|
|
21292
|
+
* before new edges are added.
|
|
21293
|
+
*
|
|
21294
|
+
* @throws HTTP 400 if a referenced label is unknown, an appended
|
|
21295
|
+
* edge references undeclared nodes, or capacities are negative.
|
|
21296
|
+
* @throws HTTP 404 if the id is unknown.
|
|
21297
|
+
*/
|
|
21298
|
+
async commit(networkId, request) {
|
|
21299
|
+
const response = await this.api.commitFlowNetwork(
|
|
21300
|
+
networkId,
|
|
21301
|
+
CommitFlowNetworkRequestFromFrontToApi(request)
|
|
21302
|
+
);
|
|
21303
|
+
return FlowNetworkResponseFromApiToFront(response.data);
|
|
21304
|
+
}
|
|
21305
|
+
/**
|
|
21306
|
+
* Run the chosen algorithm against the persisted network.
|
|
21307
|
+
*
|
|
21308
|
+
* @remarks
|
|
21309
|
+
* The response shape narrows per algorithm:
|
|
21310
|
+
*
|
|
21311
|
+
* - `max_flow` — `totalFlow` + `edgeFlows`.
|
|
21312
|
+
* - `min_cost_max_flow` — `totalFlow`, `totalCost`, `edgeFlows`.
|
|
21313
|
+
* - `classify_edges` / `classify_edges_optimal` — `classifications`.
|
|
21314
|
+
* - `min_cut` — `totalFlow`, `edgeFlows`, `minCut`.
|
|
21315
|
+
*
|
|
21316
|
+
* Fields irrelevant to the chosen algorithm are `undefined`.
|
|
21317
|
+
*
|
|
21318
|
+
* @throws HTTP 404 if the id is unknown.
|
|
21319
|
+
*/
|
|
21320
|
+
async solve(networkId, request) {
|
|
21321
|
+
const response = await this.api.solveFlowNetwork(
|
|
21322
|
+
networkId,
|
|
21323
|
+
SolveFlowNetworkRequestFromFrontToApi(request)
|
|
21324
|
+
);
|
|
21325
|
+
return SolveFlowNetworkResponseFromApiToFront(response.data);
|
|
21326
|
+
}
|
|
21327
|
+
};
|
|
21328
|
+
|
|
20698
21329
|
// src/normalizers/osfql.ts
|
|
20699
21330
|
function OsfqlResponseFromApiToFront(dto) {
|
|
20700
21331
|
return {
|
|
@@ -21757,6 +22388,243 @@ var UiClient = class {
|
|
|
21757
22388
|
}
|
|
21758
22389
|
};
|
|
21759
22390
|
|
|
22391
|
+
// src/normalizers/compliance.ts
|
|
22392
|
+
function AppendRequestFromFrontToApi(model) {
|
|
22393
|
+
const dto = {
|
|
22394
|
+
request_path: model.requestPath,
|
|
22395
|
+
request_hash: model.requestHash,
|
|
22396
|
+
response_hash: model.responseHash
|
|
22397
|
+
};
|
|
22398
|
+
if (model.dataVersions !== void 0) dto.data_versions = model.dataVersions;
|
|
22399
|
+
if (model.extra !== void 0) dto.extra = model.extra;
|
|
22400
|
+
return dto;
|
|
22401
|
+
}
|
|
22402
|
+
function AuditRecordFromApiToFront(dto) {
|
|
22403
|
+
return {
|
|
22404
|
+
id: dto.id,
|
|
22405
|
+
tenantId: dto.tenant_id,
|
|
22406
|
+
actor: dto.actor ?? null,
|
|
22407
|
+
timestamp: dto.timestamp,
|
|
22408
|
+
requestPath: dto.request_path,
|
|
22409
|
+
requestHash: dto.request_hash,
|
|
22410
|
+
responseHash: dto.response_hash,
|
|
22411
|
+
prevHash: dto.prev_hash,
|
|
22412
|
+
recordHash: dto.record_hash,
|
|
22413
|
+
gitRevision: dto.git_revision,
|
|
22414
|
+
dataVersions: dto.data_versions,
|
|
22415
|
+
extra: dto.extra
|
|
22416
|
+
};
|
|
22417
|
+
}
|
|
22418
|
+
function SummaryResponseFromApiToFront(dto) {
|
|
22419
|
+
const out = {
|
|
22420
|
+
nRecords: dto.n_records,
|
|
22421
|
+
perActor: dto.per_actor,
|
|
22422
|
+
perRequestPath: dto.per_request_path,
|
|
22423
|
+
tenantId: dto.tenant_id
|
|
22424
|
+
};
|
|
22425
|
+
if (dto.ts_first) out.tsFirst = dto.ts_first;
|
|
22426
|
+
if (dto.ts_last) out.tsLast = dto.ts_last;
|
|
22427
|
+
return out;
|
|
22428
|
+
}
|
|
22429
|
+
function VerifyResponseFromApiToFront(dto) {
|
|
22430
|
+
return {
|
|
22431
|
+
ok: dto.ok,
|
|
22432
|
+
nViolations: dto.n_violations,
|
|
22433
|
+
violations: dto.violations
|
|
22434
|
+
};
|
|
22435
|
+
}
|
|
22436
|
+
function CaptureSnapshotRequestFromFrontToApi(model) {
|
|
22437
|
+
const dto = {
|
|
22438
|
+
request_path_pattern: model.requestPathPattern
|
|
22439
|
+
};
|
|
22440
|
+
if (model.capturedAfter !== void 0) dto.captured_after = model.capturedAfter;
|
|
22441
|
+
if (model.maxEntries !== void 0) dto.max_entries = model.maxEntries;
|
|
22442
|
+
return dto;
|
|
22443
|
+
}
|
|
22444
|
+
function snapshotFilterFromApi(dto) {
|
|
22445
|
+
return {
|
|
22446
|
+
requestPathPattern: dto.request_path_pattern,
|
|
22447
|
+
capturedAfter: dto.captured_after ?? null,
|
|
22448
|
+
maxEntries: dto.max_entries ?? null
|
|
22449
|
+
};
|
|
22450
|
+
}
|
|
22451
|
+
function predictionEntryFromApi(dto) {
|
|
22452
|
+
return {
|
|
22453
|
+
id: dto.id,
|
|
22454
|
+
requestHash: dto.request_hash,
|
|
22455
|
+
responseSummary: dto.response_summary,
|
|
22456
|
+
sourceRecordId: dto.source_record_id,
|
|
22457
|
+
capturedStatus: dto.captured_status,
|
|
22458
|
+
validatedStatus: dto.validated_status ?? null,
|
|
22459
|
+
validatedAt: dto.validated_at ?? null
|
|
22460
|
+
};
|
|
22461
|
+
}
|
|
22462
|
+
function PredictionSnapshotFromApiToFront(dto) {
|
|
22463
|
+
return {
|
|
22464
|
+
id: dto.id,
|
|
22465
|
+
tenantId: dto.tenant_id,
|
|
22466
|
+
capturedAt: dto.captured_at,
|
|
22467
|
+
filter: snapshotFilterFromApi(dto.filter),
|
|
22468
|
+
entries: dto.entries.map(predictionEntryFromApi)
|
|
22469
|
+
};
|
|
22470
|
+
}
|
|
22471
|
+
function ValidationReportDtoFromApiToFront(dto) {
|
|
22472
|
+
return {
|
|
22473
|
+
snapshotId: dto.snapshot_id,
|
|
22474
|
+
completedAt: dto.completed_at,
|
|
22475
|
+
nTotal: dto.n_total,
|
|
22476
|
+
nPending: dto.n_pending,
|
|
22477
|
+
nValidated: dto.n_validated,
|
|
22478
|
+
nRefuted: dto.n_refuted,
|
|
22479
|
+
nUnknown: dto.n_unknown,
|
|
22480
|
+
validationRate: dto.validation_rate ?? null
|
|
22481
|
+
};
|
|
22482
|
+
}
|
|
22483
|
+
|
|
22484
|
+
// src/resources/compliance.ts
|
|
22485
|
+
var ComplianceClient = class {
|
|
22486
|
+
/** @internal */
|
|
22487
|
+
api;
|
|
22488
|
+
/** @internal */
|
|
22489
|
+
constructor(api) {
|
|
22490
|
+
this.api = api;
|
|
22491
|
+
}
|
|
22492
|
+
// ---------------------------------------------------------------
|
|
22493
|
+
// Audit ledger
|
|
22494
|
+
// ---------------------------------------------------------------
|
|
22495
|
+
/**
|
|
22496
|
+
* Append one record to the tenant's audit ledger.
|
|
22497
|
+
*
|
|
22498
|
+
* @param request - Hashes + path + optional metadata.
|
|
22499
|
+
* @returns The freshly appended record (with `recordHash` /
|
|
22500
|
+
* `prevHash` populated by the engine).
|
|
22501
|
+
*/
|
|
22502
|
+
async append(request) {
|
|
22503
|
+
const response = await this.api.append(AppendRequestFromFrontToApi(request));
|
|
22504
|
+
return AuditRecordFromApiToFront(response.data);
|
|
22505
|
+
}
|
|
22506
|
+
/**
|
|
22507
|
+
* List audit records for this tenant, optionally filtered.
|
|
22508
|
+
*
|
|
22509
|
+
* @param options - Limit / glob filter on `requestPath`.
|
|
22510
|
+
*/
|
|
22511
|
+
async list(options = {}) {
|
|
22512
|
+
const query = {};
|
|
22513
|
+
if (options.limit !== void 0) query.limit = options.limit;
|
|
22514
|
+
if (options.requestPathPattern !== void 0) {
|
|
22515
|
+
query.request_path_pattern = options.requestPathPattern;
|
|
22516
|
+
}
|
|
22517
|
+
const response = await this.api.list(query);
|
|
22518
|
+
return response.data.map(AuditRecordFromApiToFront);
|
|
22519
|
+
}
|
|
22520
|
+
/**
|
|
22521
|
+
* Top-line counts over the tenant's full ledger — useful for
|
|
22522
|
+
* dashboards and quick health checks.
|
|
22523
|
+
*/
|
|
22524
|
+
async summary() {
|
|
22525
|
+
const response = await this.api.summary();
|
|
22526
|
+
return SummaryResponseFromApiToFront(response.data);
|
|
22527
|
+
}
|
|
22528
|
+
/**
|
|
22529
|
+
* Re-walk the hash chain end-to-end and report any breaks.
|
|
22530
|
+
*
|
|
22531
|
+
* @returns `ok: true` when the chain is intact. `violations` is
|
|
22532
|
+
* an engine-defined opaque list when it isn't.
|
|
22533
|
+
*/
|
|
22534
|
+
async verify() {
|
|
22535
|
+
const response = await this.api.verify();
|
|
22536
|
+
return VerifyResponseFromApiToFront(response.data);
|
|
22537
|
+
}
|
|
22538
|
+
// ---------------------------------------------------------------
|
|
22539
|
+
// Prediction snapshots
|
|
22540
|
+
// ---------------------------------------------------------------
|
|
22541
|
+
/**
|
|
22542
|
+
* Capture a frozen slice of the audit ledger for later validation.
|
|
22543
|
+
*
|
|
22544
|
+
* @param request - Glob-style path filter + optional time / count
|
|
22545
|
+
* bounds.
|
|
22546
|
+
* @returns The freshly persisted snapshot, including every
|
|
22547
|
+
* captured `PredictionEntry`.
|
|
22548
|
+
*
|
|
22549
|
+
* @remarks
|
|
22550
|
+
* The `requestPathPattern` is mandatory. Without it the snapshot
|
|
22551
|
+
* would freeze the entire ledger, which is rarely useful.
|
|
22552
|
+
*/
|
|
22553
|
+
async captureSnapshot(request) {
|
|
22554
|
+
const response = await this.api.captureSnapshot(
|
|
22555
|
+
CaptureSnapshotRequestFromFrontToApi(request)
|
|
22556
|
+
);
|
|
22557
|
+
return PredictionSnapshotFromApiToFront(response.data);
|
|
22558
|
+
}
|
|
22559
|
+
/**
|
|
22560
|
+
* Fetch a previously-captured snapshot by id.
|
|
22561
|
+
*/
|
|
22562
|
+
async getSnapshot(id) {
|
|
22563
|
+
const response = await this.api.getSnapshot(id);
|
|
22564
|
+
return PredictionSnapshotFromApiToFront(response.data);
|
|
22565
|
+
}
|
|
22566
|
+
/**
|
|
22567
|
+
* Run the stub validator over a snapshot and return a
|
|
22568
|
+
* pending/validated/refuted/unknown report.
|
|
22569
|
+
*
|
|
22570
|
+
* @param id - Snapshot id.
|
|
22571
|
+
*
|
|
22572
|
+
* @remarks
|
|
22573
|
+
* "Stub" is the in-engine validator that defers the actual
|
|
22574
|
+
* ground-truth resolution to a `GroundTruthProviderPort` registered
|
|
22575
|
+
* on the backend. Without a registered provider every entry stays
|
|
22576
|
+
* `Pending`.
|
|
22577
|
+
*/
|
|
22578
|
+
async validateStub(id) {
|
|
22579
|
+
const response = await this.api.validateStub(id);
|
|
22580
|
+
return ValidationReportDtoFromApiToFront(response.data);
|
|
22581
|
+
}
|
|
22582
|
+
};
|
|
22583
|
+
|
|
22584
|
+
// src/normalizers/operations.ts
|
|
22585
|
+
function AntiUnifyRequestFromFrontToApi(model) {
|
|
22586
|
+
return {
|
|
22587
|
+
term1_id: model.term1Id,
|
|
22588
|
+
term2_id: model.term2Id
|
|
22589
|
+
};
|
|
22590
|
+
}
|
|
22591
|
+
function AntiUnifyResponseFromApiToFront(dto) {
|
|
22592
|
+
return {
|
|
22593
|
+
lggTermId: dto.lgg_term_id,
|
|
22594
|
+
lgg: TermDtoFromApiToFront(dto.lgg),
|
|
22595
|
+
computationTimeMs: dto.computation_time_ms
|
|
22596
|
+
};
|
|
22597
|
+
}
|
|
22598
|
+
|
|
22599
|
+
// src/resources/operations.ts
|
|
22600
|
+
var OperationsClient = class {
|
|
22601
|
+
/** @internal */
|
|
22602
|
+
api;
|
|
22603
|
+
/** @internal */
|
|
22604
|
+
constructor(api) {
|
|
22605
|
+
this.api = api;
|
|
22606
|
+
}
|
|
22607
|
+
/**
|
|
22608
|
+
* Compute the anti-unification (Least General Generalisation) of
|
|
22609
|
+
* two Ψ-terms.
|
|
22610
|
+
*
|
|
22611
|
+
* @param request - The two term ids to generalise.
|
|
22612
|
+
* @returns The newly-created LGG term + enriched view + timing.
|
|
22613
|
+
*
|
|
22614
|
+
* @remarks
|
|
22615
|
+
* Both ids must already be registered in the tenant's term store.
|
|
22616
|
+
* The LGG is persisted; subsequent calls with the same operands
|
|
22617
|
+
* still produce a fresh LGG term (idempotency is not guaranteed at
|
|
22618
|
+
* this layer — wrap in your own cache if you need it).
|
|
22619
|
+
*/
|
|
22620
|
+
async antiUnify(request) {
|
|
22621
|
+
const response = await this.api.antiUnify(
|
|
22622
|
+
AntiUnifyRequestFromFrontToApi(request)
|
|
22623
|
+
);
|
|
22624
|
+
return AntiUnifyResponseFromApiToFront(response.data);
|
|
22625
|
+
}
|
|
22626
|
+
};
|
|
22627
|
+
|
|
21760
22628
|
// src/client.ts
|
|
21761
22629
|
var ReasoningLayerClient = class {
|
|
21762
22630
|
/** Sort (type hierarchy) operations. */
|
|
@@ -21847,6 +22715,8 @@ var ReasoningLayerClient = class {
|
|
|
21847
22715
|
optimize;
|
|
21848
22716
|
/** Scheduling feasibility via capacitated bipartite b-matching (staff rostering, assignment problems). */
|
|
21849
22717
|
scheduling;
|
|
22718
|
+
/** Generic flow-network resource: max-flow, min-cost max-flow, edge classification, min-cut over a persisted graph. */
|
|
22719
|
+
flowNetworks;
|
|
21850
22720
|
/** OSFQL execution operations. */
|
|
21851
22721
|
osfql;
|
|
21852
22722
|
/** Conversational AI operations (NL → OSFQL with self-correction). */
|
|
@@ -21859,6 +22729,10 @@ var ReasoningLayerClient = class {
|
|
|
21859
22729
|
rlTraining;
|
|
21860
22730
|
/** Sort-driven UI descriptor operations (describe, action, catalog). */
|
|
21861
22731
|
ui;
|
|
22732
|
+
/** Hash-chained audit ledger and prediction-snapshot validation. */
|
|
22733
|
+
compliance;
|
|
22734
|
+
/** Low-level term-graph operations (anti-unification / LGG). */
|
|
22735
|
+
operations;
|
|
21862
22736
|
// ─── Group Caches ─────────────────────────────────────────────────
|
|
21863
22737
|
_core;
|
|
21864
22738
|
_ai;
|
|
@@ -21922,11 +22796,12 @@ var ReasoningLayerClient = class {
|
|
|
21922
22796
|
rlTraining: this.rlTraining
|
|
21923
22797
|
};
|
|
21924
22798
|
}
|
|
21925
|
-
/** Advanced reasoning operations — optimization, ILP, CDL, execution, preferences, discovery, scheduling. */
|
|
22799
|
+
/** Advanced reasoning operations — optimization, ILP, CDL, execution, preferences, discovery, scheduling, flow networks. */
|
|
21926
22800
|
get reasoningOps() {
|
|
21927
22801
|
return this._reasoning ??= {
|
|
21928
22802
|
optimize: this.optimize,
|
|
21929
22803
|
scheduling: this.scheduling,
|
|
22804
|
+
flowNetworks: this.flowNetworks,
|
|
21930
22805
|
ilp: this.ilp,
|
|
21931
22806
|
cdl: this.cdl,
|
|
21932
22807
|
execution: this.execution,
|
|
@@ -22082,6 +22957,7 @@ var ReasoningLayerClient = class {
|
|
|
22082
22957
|
this.rag = new RagClient(generatedRag);
|
|
22083
22958
|
this.optimize = new OptimizeClient(generatedInference, generatedSorts, generatedQuery, generatedTerms, resolved.tenantId);
|
|
22084
22959
|
this.scheduling = new SchedulingClient(new Scheduling(generatedHttp));
|
|
22960
|
+
this.flowNetworks = new FlowNetworksClient(new FlowNetworks(generatedHttp));
|
|
22085
22961
|
this.osfql = new OsfqlClient(generatedOsfql);
|
|
22086
22962
|
this.conversation = new ConversationClient(generatedHttp);
|
|
22087
22963
|
this.research = new ResearchClient(generatedHttp);
|
|
@@ -22091,6 +22967,8 @@ var ReasoningLayerClient = class {
|
|
|
22091
22967
|
this.context = new ContextClient(generatedContext);
|
|
22092
22968
|
this.rlTraining = new RlTrainingClient(generatedRlTraining);
|
|
22093
22969
|
this.ui = new UiClient(generatedUi);
|
|
22970
|
+
this.compliance = new ComplianceClient(new Compliance(generatedHttp));
|
|
22971
|
+
this.operations = new OperationsClient(new Operations(generatedHttp));
|
|
22094
22972
|
}
|
|
22095
22973
|
};
|
|
22096
22974
|
|
|
@@ -22233,6 +23111,9 @@ __export(scheduling_exports, {
|
|
|
22233
23111
|
});
|
|
22234
23112
|
var ANY_ROLE = "any";
|
|
22235
23113
|
|
|
23114
|
+
// src/types/flow-networks.ts
|
|
23115
|
+
var flow_networks_exports = {};
|
|
23116
|
+
|
|
22236
23117
|
// src/types/ilp.ts
|
|
22237
23118
|
var ilp_exports = {};
|
|
22238
23119
|
|
|
@@ -22245,6 +23126,12 @@ var osfql_exports = {};
|
|
|
22245
23126
|
// src/types/conversation.ts
|
|
22246
23127
|
var conversation_exports = {};
|
|
22247
23128
|
|
|
23129
|
+
// src/types/compliance.ts
|
|
23130
|
+
var compliance_exports = {};
|
|
23131
|
+
|
|
23132
|
+
// src/types/operations.ts
|
|
23133
|
+
var operations_exports = {};
|
|
23134
|
+
|
|
22248
23135
|
// src/types/research.ts
|
|
22249
23136
|
var research_exports = {};
|
|
22250
23137
|
|
|
@@ -22922,6 +23809,6 @@ function discriminateFeatureValue(value) {
|
|
|
22922
23809
|
);
|
|
22923
23810
|
}
|
|
22924
23811
|
|
|
22925
|
-
export { ANY_ROLE, action_reviews_exports as ActionReviews, admin_exports as Admin, analysis_exports as Analysis, ApiError, AuthenticationError, BadRequestError, cdl_exports as CDL, causal_exports as Causal, cognitive_exports as Cognitive, collections_exports as Collections, communities_exports as Communities, ConstraintViolationError, constraints_exports as Constraints, control_exports as Control, conversation_exports as Conversation, discovery_exports as Discovery, execution_exports as Execution, extract_exports as Extract, ForbiddenError, functions_exports as Functions, fuzzy_exports as Fuzzy, FuzzyShape, generation_exports as Generation, health_exports as Health, homoiconic_exports as Homoiconic, ilp_exports as ILP, image_extraction_exports as ImageExtraction, inference_exports as Inference, ingestion_exports as Ingestion, IngestionFailedError, IngestionSession, InternalServerError, LP, namespaces_exports as Namespaces, NetworkError, neuro_symbolic_exports as NeuroSymbolic, NotFoundError, ontology_exports as Ontology, optimize_exports as Optimize, osfql_exports as Osfql, oversight_exports as Oversight, plain_values_exports as PlainValues, preferences_exports as Preferences, proof_engine_exports as ProofEngine, query_exports as Query, rag_exports as RAG, RateLimitError, reasoning_exports as Reasoning, ReasoningLayerClient, ReasoningLayerError, research_exports as Research, reviews_exports as Reviews, row_exports as Row, SDK_VERSION, scenarios_exports as Scenarios, scheduling_exports as Scheduling, SortBuilder, sorts_exports as Sorts, sources_exports as Sources, spaces_exports as Spaces, statistical_exports as Statistical, synthetic_exports as Synthetic, terms_exports as Terms, TimeoutError, utilities_exports as Utilities, ValidationError, Value, values_exports as Values, visualization_exports as Visualization, WebSocketClient, WebSocketConnection, webhook_actions_exports as WebhookActions, allen, constrained, discriminateFeatureValue, guard, isConstrainedPlainVar, isPsiTermInput, isTaggedValueDto, isUuid, psi, toTaggedFeatures, toTaggedValue, toTermInputDto, toUntaggedFeatures, toUntaggedValue };
|
|
23812
|
+
export { ANY_ROLE, action_reviews_exports as ActionReviews, admin_exports as Admin, analysis_exports as Analysis, ApiError, AuthenticationError, BadRequestError, cdl_exports as CDL, causal_exports as Causal, cognitive_exports as Cognitive, collections_exports as Collections, communities_exports as Communities, compliance_exports as Compliance, ConstraintViolationError, constraints_exports as Constraints, control_exports as Control, conversation_exports as Conversation, discovery_exports as Discovery, execution_exports as Execution, extract_exports as Extract, flow_networks_exports as FlowNetworks, ForbiddenError, functions_exports as Functions, fuzzy_exports as Fuzzy, FuzzyShape, generation_exports as Generation, health_exports as Health, homoiconic_exports as Homoiconic, ilp_exports as ILP, image_extraction_exports as ImageExtraction, inference_exports as Inference, ingestion_exports as Ingestion, IngestionFailedError, IngestionSession, InternalServerError, LP, namespaces_exports as Namespaces, NetworkError, neuro_symbolic_exports as NeuroSymbolic, NotFoundError, ontology_exports as Ontology, operations_exports as Operations, optimize_exports as Optimize, osfql_exports as Osfql, oversight_exports as Oversight, plain_values_exports as PlainValues, preferences_exports as Preferences, proof_engine_exports as ProofEngine, query_exports as Query, rag_exports as RAG, RateLimitError, reasoning_exports as Reasoning, ReasoningLayerClient, ReasoningLayerError, research_exports as Research, reviews_exports as Reviews, row_exports as Row, SDK_VERSION, scenarios_exports as Scenarios, scheduling_exports as Scheduling, SortBuilder, sorts_exports as Sorts, sources_exports as Sources, spaces_exports as Spaces, statistical_exports as Statistical, synthetic_exports as Synthetic, terms_exports as Terms, TimeoutError, utilities_exports as Utilities, ValidationError, Value, values_exports as Values, visualization_exports as Visualization, WebSocketClient, WebSocketConnection, webhook_actions_exports as WebhookActions, allen, constrained, discriminateFeatureValue, guard, isConstrainedPlainVar, isPsiTermInput, isTaggedValueDto, isUuid, psi, toTaggedFeatures, toTaggedValue, toTermInputDto, toUntaggedFeatures, toUntaggedValue };
|
|
22926
23813
|
//# sourceMappingURL=index.js.map
|
|
22927
23814
|
//# sourceMappingURL=index.js.map
|