@kortexya/reasoninglayer 1.15.0 → 1.16.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 +2365 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4482 -22
- package/dist/index.d.ts +4482 -22
- package/dist/index.js +2356 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ var __export = (target, all) => {
|
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
// src/config.ts
|
|
10
|
-
var SDK_VERSION = "1.
|
|
10
|
+
var SDK_VERSION = "1.16.0";
|
|
11
11
|
function resolveConfig(config) {
|
|
12
12
|
if (!config.baseUrl) {
|
|
13
13
|
throw new Error("ClientConfig.baseUrl is required");
|
|
@@ -550,6 +550,8 @@ var USER_DATA_FIELDS = /* @__PURE__ */ new Set([
|
|
|
550
550
|
"antecedentFeatures",
|
|
551
551
|
"antecedent_features",
|
|
552
552
|
"bindings",
|
|
553
|
+
"classScores",
|
|
554
|
+
"class_scores",
|
|
553
555
|
"coefficients",
|
|
554
556
|
"conceptValues",
|
|
555
557
|
"concept_values",
|
|
@@ -1162,6 +1164,22 @@ var Sorts = class {
|
|
|
1162
1164
|
format: "json",
|
|
1163
1165
|
...params
|
|
1164
1166
|
});
|
|
1167
|
+
/**
|
|
1168
|
+
* @description Poll this after `POST /api/v1/sorts/index` (which is fire-and-forget) to know whether the embedding pass is still `running`, has completed (`last_indexed_count`), or failed (`last_error`).
|
|
1169
|
+
*
|
|
1170
|
+
* @tags sorts
|
|
1171
|
+
* @name SortIndexStatus
|
|
1172
|
+
* @summary GET /api/v1/sorts/index/status
|
|
1173
|
+
* @request GET:/api/v1/sorts/index/status
|
|
1174
|
+
* @secure
|
|
1175
|
+
*/
|
|
1176
|
+
sortIndexStatus = (params = {}) => this.http.request({
|
|
1177
|
+
path: `/api/v1/sorts/index/status`,
|
|
1178
|
+
method: "GET",
|
|
1179
|
+
secure: true,
|
|
1180
|
+
format: "json",
|
|
1181
|
+
...params
|
|
1182
|
+
});
|
|
1165
1183
|
/**
|
|
1166
1184
|
* No description
|
|
1167
1185
|
*
|
|
@@ -1952,6 +1970,21 @@ var Cognitive = class {
|
|
|
1952
1970
|
format: "json",
|
|
1953
1971
|
...params
|
|
1954
1972
|
});
|
|
1973
|
+
/**
|
|
1974
|
+
* @description Server->client only (thinking / tool / inference / phase events). It's plain HTTP, so it traverses the zanzibar gateway — which proxies HTTP and mints `X-Tenant-Id`, but does NOT proxy WebSocket upgrades. Client->server control (ChatMessage / Abort / Redirect) is a separate POST for SSE clients. Auth and the ownership gate are identical to the WS handler. Endpoint: `GET /api/v1/cognitive/agents/{agent_id}/events` (Accept: text/event-stream)
|
|
1975
|
+
*
|
|
1976
|
+
* @tags cognitive
|
|
1977
|
+
* @name CognitiveSseHandler
|
|
1978
|
+
* @summary SSE transport for the *same* cognitive event stream as `cognitive_ws_handler`.
|
|
1979
|
+
* @request GET:/api/v1/cognitive/agents/{agent_id}/events
|
|
1980
|
+
* @secure
|
|
1981
|
+
*/
|
|
1982
|
+
cognitiveSseHandler = (agentId, params = {}) => this.http.request({
|
|
1983
|
+
path: `/api/v1/cognitive/agents/${agentId}/events`,
|
|
1984
|
+
method: "GET",
|
|
1985
|
+
secure: true,
|
|
1986
|
+
...params
|
|
1987
|
+
});
|
|
1955
1988
|
/**
|
|
1956
1989
|
* @description ## Example ```bash curl -X POST http://localhost:3000/api/v1/cognitive/agents \ -H "Content-Type: application/json" \ -d '{"name": "reasoning_agent", "tenant_id": "..."}' ```
|
|
1957
1990
|
*
|
|
@@ -2000,6 +2033,20 @@ var Cognitive = class {
|
|
|
2000
2033
|
format: "json",
|
|
2001
2034
|
...params
|
|
2002
2035
|
});
|
|
2036
|
+
/**
|
|
2037
|
+
* @description Reads the persisted, tenant-scoped `ActionReviewConfig` from the registry (hydrating agents first so a restored snapshot's config is visible), or sensible defaults when none has been set. Complements the PUT so the UI's oversight editor can load what's actually stored instead of a local stand-in.
|
|
2038
|
+
*
|
|
2039
|
+
* @tags cognitive
|
|
2040
|
+
* @name GetActionReviewConfigHandler
|
|
2041
|
+
* @summary Get the tenant's current HITL action-review (oversight) configuration.
|
|
2042
|
+
* @request GET:/api/v1/cognitive/agents/action-review-config
|
|
2043
|
+
*/
|
|
2044
|
+
getActionReviewConfigHandler = (params = {}) => this.http.request({
|
|
2045
|
+
path: `/api/v1/cognitive/agents/action-review-config`,
|
|
2046
|
+
method: "GET",
|
|
2047
|
+
format: "json",
|
|
2048
|
+
...params
|
|
2049
|
+
});
|
|
2003
2050
|
/**
|
|
2004
2051
|
* @description Returns drives, deficits, curiosity targets, and the dominant drive. Tenant is identified by the `X-Tenant-Id` header.
|
|
2005
2052
|
*
|
|
@@ -2016,6 +2063,22 @@ var Cognitive = class {
|
|
|
2016
2063
|
format: "json",
|
|
2017
2064
|
...params
|
|
2018
2065
|
});
|
|
2066
|
+
/**
|
|
2067
|
+
* No description
|
|
2068
|
+
*
|
|
2069
|
+
* @tags cognitive
|
|
2070
|
+
* @name GetAgentPlanHandler
|
|
2071
|
+
* @summary GET /api/v1/cognitive/agents/{agent_id}/plan — inspect an agent's committed intentions: the plan/HTN step sequence, `current_step` (executed-so-far), and status. Read-only observability for the planner verification harness (§4.2).
|
|
2072
|
+
* @request GET:/api/v1/cognitive/agents/{agent_id}/plan
|
|
2073
|
+
* @secure
|
|
2074
|
+
*/
|
|
2075
|
+
getAgentPlanHandler = (agentId, params = {}) => this.http.request({
|
|
2076
|
+
path: `/api/v1/cognitive/agents/${agentId}/plan`,
|
|
2077
|
+
method: "GET",
|
|
2078
|
+
secure: true,
|
|
2079
|
+
format: "json",
|
|
2080
|
+
...params
|
|
2081
|
+
});
|
|
2019
2082
|
/**
|
|
2020
2083
|
* No description
|
|
2021
2084
|
*
|
|
@@ -2032,6 +2095,22 @@ var Cognitive = class {
|
|
|
2032
2095
|
format: "json",
|
|
2033
2096
|
...params
|
|
2034
2097
|
});
|
|
2098
|
+
/**
|
|
2099
|
+
* No description
|
|
2100
|
+
*
|
|
2101
|
+
* @tags cognitive
|
|
2102
|
+
* @name GetAgentWorldModelHandler
|
|
2103
|
+
* @summary GET /api/v1/cognitive/agents/{agent_id}/world-model — inspect an agent's learned transition model P(s'|s,a). Read-only observability for the world-model verification harness (§4.2 of the productionization plan) and a future UI surface: returns the agent's transition rules with resolved sort names + the rule count. An agent with no learned transitions yet returns `has_world_model:false` (or an empty rule set), which is a valid state — not an error.
|
|
2104
|
+
* @request GET:/api/v1/cognitive/agents/{agent_id}/world-model
|
|
2105
|
+
* @secure
|
|
2106
|
+
*/
|
|
2107
|
+
getAgentWorldModelHandler = (agentId, params = {}) => this.http.request({
|
|
2108
|
+
path: `/api/v1/cognitive/agents/${agentId}/world-model`,
|
|
2109
|
+
method: "GET",
|
|
2110
|
+
secure: true,
|
|
2111
|
+
format: "json",
|
|
2112
|
+
...params
|
|
2113
|
+
});
|
|
2035
2114
|
/**
|
|
2036
2115
|
* @description Returns beliefs, goals, intentions, pending perceptions, activations, recent episodes, and rule utilities. Tenant is identified by the `X-Tenant-Id` header.
|
|
2037
2116
|
*
|
|
@@ -2096,6 +2175,22 @@ var Cognitive = class {
|
|
|
2096
2175
|
format: "json",
|
|
2097
2176
|
...params
|
|
2098
2177
|
});
|
|
2178
|
+
/**
|
|
2179
|
+
* No description
|
|
2180
|
+
*
|
|
2181
|
+
* @tags cognitive
|
|
2182
|
+
* @name PauseAgentHandler
|
|
2183
|
+
* @summary POST /api/v1/cognitive/agents/{agent_id}/pause — pause an agent (persisted).
|
|
2184
|
+
* @request POST:/api/v1/cognitive/agents/{agent_id}/pause
|
|
2185
|
+
* @secure
|
|
2186
|
+
*/
|
|
2187
|
+
pauseAgentHandler = (agentId, params = {}) => this.http.request({
|
|
2188
|
+
path: `/api/v1/cognitive/agents/${agentId}/pause`,
|
|
2189
|
+
method: "POST",
|
|
2190
|
+
secure: true,
|
|
2191
|
+
format: "json",
|
|
2192
|
+
...params
|
|
2193
|
+
});
|
|
2099
2194
|
/**
|
|
2100
2195
|
* @description This enables the agent to learn from user corrections and preferences. All feedback is stored as Ψ-terms for TRUE HOMOICONICITY - they are queryable, unifiable, and can be reasoned about by the agent. ## Feedback Rating - `+1`: Result was correct/helpful - increases rule utility - `0`: Neutral - no learning - `-1`: Result was wrong - decreases rule utility, triggers correction learning ## Corrections When a correction is provided: 1. A `user_correction` Ψ-term is created with the correct answer pattern 2. Rules that produced the wrong result have their utility decreased 3. A new rule may be learned from the correction ## Preferences When a preference is provided: 1. A `user_preference` Ψ-term is created (subsort of constraint) 2. Future reasoning can consider this preference
|
|
2101
2196
|
*
|
|
@@ -2128,6 +2223,22 @@ var Cognitive = class {
|
|
|
2128
2223
|
format: "json",
|
|
2129
2224
|
...params
|
|
2130
2225
|
});
|
|
2226
|
+
/**
|
|
2227
|
+
* No description
|
|
2228
|
+
*
|
|
2229
|
+
* @tags cognitive
|
|
2230
|
+
* @name ResumeAgentHandler
|
|
2231
|
+
* @summary POST /api/v1/cognitive/agents/{agent_id}/resume — resume a paused agent.
|
|
2232
|
+
* @request POST:/api/v1/cognitive/agents/{agent_id}/resume
|
|
2233
|
+
* @secure
|
|
2234
|
+
*/
|
|
2235
|
+
resumeAgentHandler = (agentId, params = {}) => this.http.request({
|
|
2236
|
+
path: `/api/v1/cognitive/agents/${agentId}/resume`,
|
|
2237
|
+
method: "POST",
|
|
2238
|
+
secure: true,
|
|
2239
|
+
format: "json",
|
|
2240
|
+
...params
|
|
2241
|
+
});
|
|
2131
2242
|
/**
|
|
2132
2243
|
* @description Executes: perceive → reason → act → learn
|
|
2133
2244
|
*
|
|
@@ -2192,6 +2303,22 @@ var Cognitive = class {
|
|
|
2192
2303
|
format: "json",
|
|
2193
2304
|
...params
|
|
2194
2305
|
});
|
|
2306
|
+
/**
|
|
2307
|
+
* No description
|
|
2308
|
+
*
|
|
2309
|
+
* @tags cognitive
|
|
2310
|
+
* @name StopAgentHandler
|
|
2311
|
+
* @summary POST /api/v1/cognitive/agents/{agent_id}/stop — soft-stop an agent (persisted; distinct from DELETE, which permanently destroys the agent + its goals).
|
|
2312
|
+
* @request POST:/api/v1/cognitive/agents/{agent_id}/stop
|
|
2313
|
+
* @secure
|
|
2314
|
+
*/
|
|
2315
|
+
stopAgentHandler = (agentId, params = {}) => this.http.request({
|
|
2316
|
+
path: `/api/v1/cognitive/agents/${agentId}/stop`,
|
|
2317
|
+
method: "POST",
|
|
2318
|
+
secure: true,
|
|
2319
|
+
format: "json",
|
|
2320
|
+
...params
|
|
2321
|
+
});
|
|
2195
2322
|
/**
|
|
2196
2323
|
* @description When subscribed, the agent will receive notifications about changes to the specified sorts and features, enabling reactive behavior. ## Example ```bash curl -X POST http://localhost:3000/api/v1/cognitive/agents/subscribe \ -H "Content-Type: application/json" \ -d '{"agent_id": "...", "tenant_id": "...", "watched_sorts": ["person", "event"]}' ```
|
|
2197
2324
|
*
|
|
@@ -2682,6 +2809,24 @@ var Ingestion = class {
|
|
|
2682
2809
|
format: "json",
|
|
2683
2810
|
...params
|
|
2684
2811
|
});
|
|
2812
|
+
/**
|
|
2813
|
+
* @description Two import targets, selected by [`IngestKifRequest::persist`]: * `persist == false` (default): the import runs in a fresh, **request-scoped** world (no shared tenant state is mutated), so the inference is attributable entirely to the submitted SUO-KIF. The tenant id only namespaces the ephemeral sorts. * `persist == true`: the import lands in the **tenant's persistent substrate** — the shared per-tenant `VersionedHierarchy` and `DomainTermStore` ([`AppState::inference_for_auth`]). The sorts, facts, and rules survive the request and are visible to every subsequent call on the same tenant. Caches are invalidated afterwards so the next query observes the new state. Either way, authentication is required and an optional `goal`/`query` is proved against the axioms produced by *this* import.
|
|
2814
|
+
*
|
|
2815
|
+
* @tags ingestion
|
|
2816
|
+
* @name IngestKif
|
|
2817
|
+
* @summary Import SUO-KIF and, optionally, prove a ground goal against the imported axioms.
|
|
2818
|
+
* @request POST:/api/v1/ingest/kif
|
|
2819
|
+
* @secure
|
|
2820
|
+
*/
|
|
2821
|
+
ingestKif = (data, params = {}) => this.http.request({
|
|
2822
|
+
path: `/api/v1/ingest/kif`,
|
|
2823
|
+
method: "POST",
|
|
2824
|
+
body: data,
|
|
2825
|
+
secure: true,
|
|
2826
|
+
type: "application/json" /* Json */,
|
|
2827
|
+
format: "json",
|
|
2828
|
+
...params
|
|
2829
|
+
});
|
|
2685
2830
|
/**
|
|
2686
2831
|
* @description POST /api/v1/ingest/markdown This endpoint accepts markdown content and extracts entities using: 1. Semantic chunking for large documents 2. LLM-based entity extraction 3. Sort reconciliation (optionally creating new sorts) 4. Entity deduplication against existing knowledge base # Headers - `X-Tenant-Id`: Tenant ID for multi-tenancy isolation (required) # Request Body - `content`: The markdown content to ingest - `owner_id`: User ID who owns the ingested data - `config`: Optional configuration overrides # Response - `success`: Whether ingestion completed successfully - `stats`: Statistics about the ingestion (chunks, entities, sorts) - `pending_review`: Entities that need human review for deduplication # Size Limits - Maximum content size is 100KB. For larger documents, use the document ingestion endpoint which handles chunking automatically.
|
|
2687
2832
|
*
|
|
@@ -3562,6 +3707,60 @@ var Communities = class {
|
|
|
3562
3707
|
constructor(http) {
|
|
3563
3708
|
this.http = http;
|
|
3564
3709
|
}
|
|
3710
|
+
/**
|
|
3711
|
+
* @description `POST /api/v1/analysis/centrality` Builds the tenant's reference graph from its terms (the same read-only projection community detection uses) and computes the requested centrality measure. Centrality is a **read-only analytic** — it never asserts facts or feeds the chainer. Scores are returned sorted descending (ties broken by node id for determinism), optionally truncated to `top_k`.
|
|
3712
|
+
*
|
|
3713
|
+
* @tags communities
|
|
3714
|
+
* @name ComputeCentrality
|
|
3715
|
+
* @summary Compute a node-centrality measure over the tenant's reference graph.
|
|
3716
|
+
* @request POST:/api/v1/analysis/centrality
|
|
3717
|
+
* @secure
|
|
3718
|
+
*/
|
|
3719
|
+
computeCentrality = (data, params = {}) => this.http.request({
|
|
3720
|
+
path: `/api/v1/analysis/centrality`,
|
|
3721
|
+
method: "POST",
|
|
3722
|
+
body: data,
|
|
3723
|
+
secure: true,
|
|
3724
|
+
type: "application/json" /* Json */,
|
|
3725
|
+
format: "json",
|
|
3726
|
+
...params
|
|
3727
|
+
});
|
|
3728
|
+
/**
|
|
3729
|
+
* @description `POST /api/v1/analysis/cohesion` Read-only: total triangle count plus the per-node local clustering coefficient (sorted descending, ties broken by node id).
|
|
3730
|
+
*
|
|
3731
|
+
* @tags communities
|
|
3732
|
+
* @name ComputeCohesion
|
|
3733
|
+
* @summary Structural-cohesion metrics over the tenant's reference graph.
|
|
3734
|
+
* @request POST:/api/v1/analysis/cohesion
|
|
3735
|
+
* @secure
|
|
3736
|
+
*/
|
|
3737
|
+
computeCohesion = (data, params = {}) => this.http.request({
|
|
3738
|
+
path: `/api/v1/analysis/cohesion`,
|
|
3739
|
+
method: "POST",
|
|
3740
|
+
body: data,
|
|
3741
|
+
secure: true,
|
|
3742
|
+
type: "application/json" /* Json */,
|
|
3743
|
+
format: "json",
|
|
3744
|
+
...params
|
|
3745
|
+
});
|
|
3746
|
+
/**
|
|
3747
|
+
* @description `POST /api/v1/analysis/path` Read-only: BFS shortest path (`source..=target`) over the undirected reference graph, or `null` when `target` is unreachable.
|
|
3748
|
+
*
|
|
3749
|
+
* @tags communities
|
|
3750
|
+
* @name ComputePath
|
|
3751
|
+
* @summary Shortest path between two nodes (and the graph's connected-component count).
|
|
3752
|
+
* @request POST:/api/v1/analysis/path
|
|
3753
|
+
* @secure
|
|
3754
|
+
*/
|
|
3755
|
+
computePath = (data, params = {}) => this.http.request({
|
|
3756
|
+
path: `/api/v1/analysis/path`,
|
|
3757
|
+
method: "POST",
|
|
3758
|
+
body: data,
|
|
3759
|
+
secure: true,
|
|
3760
|
+
type: "application/json" /* Json */,
|
|
3761
|
+
format: "json",
|
|
3762
|
+
...params
|
|
3763
|
+
});
|
|
3565
3764
|
/**
|
|
3566
3765
|
* @description POST /api/v1/communities/detect Runs Leiden community detection on terms belonging to the specified tenant. Creates Community and CommunityMembership PsiTerms in the knowledge base.
|
|
3567
3766
|
*
|
|
@@ -3580,6 +3779,21 @@ var Communities = class {
|
|
|
3580
3779
|
format: "json",
|
|
3581
3780
|
...params
|
|
3582
3781
|
});
|
|
3782
|
+
/**
|
|
3783
|
+
* @description `GET /api/v1/graph/export?tenant_id=…&format=graphml|gexf|csv-nodes|csv-edges|dot` Read-only: returns the serialized graph as raw text with the matching content type. The graph is the same `Value::Reference` projection the analytics use, labelled by each term's `name` feature.
|
|
3784
|
+
*
|
|
3785
|
+
* @tags communities
|
|
3786
|
+
* @name ExportGraph
|
|
3787
|
+
* @summary Export the tenant's reference graph to a graph-interchange format.
|
|
3788
|
+
* @request GET:/api/v1/graph/export
|
|
3789
|
+
* @secure
|
|
3790
|
+
*/
|
|
3791
|
+
exportGraph = (params = {}) => this.http.request({
|
|
3792
|
+
path: `/api/v1/graph/export`,
|
|
3793
|
+
method: "GET",
|
|
3794
|
+
secure: true,
|
|
3795
|
+
...params
|
|
3796
|
+
});
|
|
3583
3797
|
/**
|
|
3584
3798
|
* @description POST /api/v1/communities/memberships Returns all communities that a term belongs to, with membership degrees.
|
|
3585
3799
|
*
|
|
@@ -3598,6 +3812,24 @@ var Communities = class {
|
|
|
3598
3812
|
format: "json",
|
|
3599
3813
|
...params
|
|
3600
3814
|
});
|
|
3815
|
+
/**
|
|
3816
|
+
* @description `POST /api/v1/analysis/link-prediction` Read-only: returns ranked candidate targets (not already adjacent) with positive score. The scores are **proposals** — a caller turning one into a KB edge must route it through the engine's `gate_arc_proposals` sort-gate; this endpoint never asserts.
|
|
3817
|
+
*
|
|
3818
|
+
* @tags communities
|
|
3819
|
+
* @name PredictLinks
|
|
3820
|
+
* @summary Score candidate links from a source node (link prediction).
|
|
3821
|
+
* @request POST:/api/v1/analysis/link-prediction
|
|
3822
|
+
* @secure
|
|
3823
|
+
*/
|
|
3824
|
+
predictLinks = (data, params = {}) => this.http.request({
|
|
3825
|
+
path: `/api/v1/analysis/link-prediction`,
|
|
3826
|
+
method: "POST",
|
|
3827
|
+
body: data,
|
|
3828
|
+
secure: true,
|
|
3829
|
+
type: "application/json" /* Json */,
|
|
3830
|
+
format: "json",
|
|
3831
|
+
...params
|
|
3832
|
+
});
|
|
3601
3833
|
/**
|
|
3602
3834
|
* @description POST /api/v1/communities/search Search for communities by various criteria: - ByEntities: Find communities containing specific terms - ByImpact: Find high-impact communities - ByLevel: Find communities at a specific hierarchy level - ByKeyword: Search community reports by keyword
|
|
3603
3835
|
*
|
|
@@ -5588,6 +5820,24 @@ var Discovery = class {
|
|
|
5588
5820
|
format: "json",
|
|
5589
5821
|
...params
|
|
5590
5822
|
});
|
|
5823
|
+
/**
|
|
5824
|
+
* @description Validates the request, converts DTOs to domain types, calls the learner port from `AppState`, and maps the result to a response DTO. Input bounds are validated to prevent DoS: - `samples.len()` <= 10,000 - `num_restarts` <= 100 - `max_epochs` <= 50,000 - `depth` in 1..=6
|
|
5825
|
+
*
|
|
5826
|
+
* @tags discovery
|
|
5827
|
+
* @name DiscoverEml
|
|
5828
|
+
* @summary Handler for `POST /discover/eml`.
|
|
5829
|
+
* @request POST:/api/v1/discover/eml
|
|
5830
|
+
* @secure
|
|
5831
|
+
*/
|
|
5832
|
+
discoverEml = (data, params = {}) => this.http.request({
|
|
5833
|
+
path: `/api/v1/discover/eml`,
|
|
5834
|
+
method: "POST",
|
|
5835
|
+
body: data,
|
|
5836
|
+
secure: true,
|
|
5837
|
+
type: "application/json" /* Json */,
|
|
5838
|
+
format: "json",
|
|
5839
|
+
...params
|
|
5840
|
+
});
|
|
5591
5841
|
/**
|
|
5592
5842
|
* @description POST /api/v1/discovery/predict Finds similar historical patterns and predicts effects using fuzzy search with PRODUCT t-norm reweighting for better aggregation.
|
|
5593
5843
|
*
|
|
@@ -6234,6 +6484,24 @@ var Fuzzy = class {
|
|
|
6234
6484
|
format: "json",
|
|
6235
6485
|
...params
|
|
6236
6486
|
});
|
|
6487
|
+
/**
|
|
6488
|
+
* @description POST /api/v1/fuzzy/score The complement of `/fuzzy/similar`: that one retrieves and ranks a whole sort; this grades a set the caller already chose — typically the top hits of a *semantic* search — against a preference ψ-term, so a two-stage pipeline can retrieve semantically and grade by fuzzy OSF unification, then combine the two scores upstream with a t-norm. A 65-minute course against a "≤1h" fuzzy preference scores ~0.83 (membership), not the hard 0 a boolean filter gave it.
|
|
6489
|
+
*
|
|
6490
|
+
* @tags fuzzy
|
|
6491
|
+
* @name ScoreTerms
|
|
6492
|
+
* @summary Score a GIVEN set of candidate terms against a query ψ-term.
|
|
6493
|
+
* @request POST:/api/v1/fuzzy/score
|
|
6494
|
+
* @secure
|
|
6495
|
+
*/
|
|
6496
|
+
scoreTerms = (data, params = {}) => this.http.request({
|
|
6497
|
+
path: `/api/v1/fuzzy/score`,
|
|
6498
|
+
method: "POST",
|
|
6499
|
+
body: data,
|
|
6500
|
+
secure: true,
|
|
6501
|
+
type: "application/json" /* Json */,
|
|
6502
|
+
format: "json",
|
|
6503
|
+
...params
|
|
6504
|
+
});
|
|
6237
6505
|
};
|
|
6238
6506
|
|
|
6239
6507
|
// src/api-spec/generated/Constraints.ts
|
|
@@ -8736,6 +9004,24 @@ var Generation = class {
|
|
|
8736
9004
|
constructor(http) {
|
|
8737
9005
|
this.http = http;
|
|
8738
9006
|
}
|
|
9007
|
+
/**
|
|
9008
|
+
* @description Returns 503 when no in-process Gemma is loaded (the server was not started with `OSFKB_OSFQL_GEMMA_DIR`), and 400 when `allowed` is empty.
|
|
9009
|
+
*
|
|
9010
|
+
* @tags generation
|
|
9011
|
+
* @name ConstrainedGenerate
|
|
9012
|
+
* @summary Generate an answer constrained to an OSF-feasible set via the application-tier decoder.
|
|
9013
|
+
* @request POST:/api/v1/constrained/generate
|
|
9014
|
+
* @secure
|
|
9015
|
+
*/
|
|
9016
|
+
constrainedGenerate = (data, params = {}) => this.http.request({
|
|
9017
|
+
path: `/api/v1/constrained/generate`,
|
|
9018
|
+
method: "POST",
|
|
9019
|
+
body: data,
|
|
9020
|
+
secure: true,
|
|
9021
|
+
type: "application/json" /* Json */,
|
|
9022
|
+
format: "json",
|
|
9023
|
+
...params
|
|
9024
|
+
});
|
|
8739
9025
|
/**
|
|
8740
9026
|
* No description
|
|
8741
9027
|
*
|
|
@@ -8754,6 +9040,40 @@ var Generation = class {
|
|
|
8754
9040
|
format: "json",
|
|
8755
9041
|
...params
|
|
8756
9042
|
});
|
|
9043
|
+
/**
|
|
9044
|
+
* @description Returns `503` when no in-process Gemma is loaded (server started without `OSFKB_OSFQL_GEMMA_DIR`), `400` on an empty prompt, and `422` when the tenant has no persisted lattice to constrain to (ingest a theory with `persist:true` first).
|
|
9045
|
+
*
|
|
9046
|
+
* @tags generation
|
|
9047
|
+
* @name GroundedGenerate
|
|
9048
|
+
* @summary Generate grounded prose via the two-pass (constrained derivation → free realization) pipeline.
|
|
9049
|
+
* @request POST:/api/v1/generate/grounded
|
|
9050
|
+
* @secure
|
|
9051
|
+
*/
|
|
9052
|
+
groundedGenerate = (data, params = {}) => this.http.request({
|
|
9053
|
+
path: `/api/v1/generate/grounded`,
|
|
9054
|
+
method: "POST",
|
|
9055
|
+
body: data,
|
|
9056
|
+
secure: true,
|
|
9057
|
+
type: "application/json" /* Json */,
|
|
9058
|
+
format: "json",
|
|
9059
|
+
...params
|
|
9060
|
+
});
|
|
9061
|
+
/**
|
|
9062
|
+
* No description
|
|
9063
|
+
*
|
|
9064
|
+
* @tags generation
|
|
9065
|
+
* @name RawGenerate
|
|
9066
|
+
* @summary Raw, ungrounded generation from the **same in-process Gemma** the grounded endpoint uses — a bare chat-prompt free decode with NO substrate, NO feasibility proof, and NO lattice mask. This is the honest "WITHOUT — Raw LLM" baseline for the demo's left panel: the identical local model, answering the identical question, with nothing from the knowledge base — so the side-by-side isolates exactly what ReasoningLayer's substrate adds. Returns `503` when no local Gemma is loaded (server started without `OSFKB_OSFQL_GEMMA_DIR`) and `400` on an empty prompt.
|
|
9067
|
+
* @request POST:/api/v1/generate/raw
|
|
9068
|
+
*/
|
|
9069
|
+
rawGenerate = (data, params = {}) => this.http.request({
|
|
9070
|
+
path: `/api/v1/generate/raw`,
|
|
9071
|
+
method: "POST",
|
|
9072
|
+
body: data,
|
|
9073
|
+
type: "application/json" /* Json */,
|
|
9074
|
+
format: "json",
|
|
9075
|
+
...params
|
|
9076
|
+
});
|
|
8757
9077
|
};
|
|
8758
9078
|
|
|
8759
9079
|
// src/api-spec/generated/Rag.ts
|
|
@@ -8836,6 +9156,7 @@ var Osfql = class {
|
|
|
8836
9156
|
path: `/api/v1/osfql/catalog`,
|
|
8837
9157
|
method: "GET",
|
|
8838
9158
|
query,
|
|
9159
|
+
format: "json",
|
|
8839
9160
|
...params
|
|
8840
9161
|
});
|
|
8841
9162
|
};
|
|
@@ -9160,6 +9481,22 @@ var Operations = class {
|
|
|
9160
9481
|
format: "json",
|
|
9161
9482
|
...params
|
|
9162
9483
|
});
|
|
9484
|
+
/**
|
|
9485
|
+
* @description `POST /api/v1/operations/anti-unify/batch` One in-process left fold of the binary LGG — associative up to variable renaming, so the result equals the client-side pairwise chain while costing a single round trip. Every intermediate LGG is persisted and returned in `steps` (the generalization ladder).
|
|
9486
|
+
*
|
|
9487
|
+
* @tags operations
|
|
9488
|
+
* @name AntiUnifyBatch
|
|
9489
|
+
* @summary Anti-unify N Ψ-terms (Least General Generalisation of the whole set).
|
|
9490
|
+
* @request POST:/api/v1/operations/anti-unify/batch
|
|
9491
|
+
*/
|
|
9492
|
+
antiUnifyBatch = (data, params = {}) => this.http.request({
|
|
9493
|
+
path: `/api/v1/operations/anti-unify/batch`,
|
|
9494
|
+
method: "POST",
|
|
9495
|
+
body: data,
|
|
9496
|
+
type: "application/json" /* Json */,
|
|
9497
|
+
format: "json",
|
|
9498
|
+
...params
|
|
9499
|
+
});
|
|
9163
9500
|
};
|
|
9164
9501
|
|
|
9165
9502
|
// src/api-spec/generated/Actions.ts
|
|
@@ -9656,6 +9993,531 @@ var OntologyBridge = class {
|
|
|
9656
9993
|
});
|
|
9657
9994
|
};
|
|
9658
9995
|
|
|
9996
|
+
// src/api-spec/generated/Demo.ts
|
|
9997
|
+
var Demo = class {
|
|
9998
|
+
http;
|
|
9999
|
+
constructor(http) {
|
|
10000
|
+
this.http = http;
|
|
10001
|
+
}
|
|
10002
|
+
/**
|
|
10003
|
+
* @description Returns `404` when the SUMO files cannot be read (bad `OSFKB_SUMO_DIR`/override), `400` when the assembled source fails to import, and `200` with the tenant's sort count + form count on success.
|
|
10004
|
+
*
|
|
10005
|
+
* @tags demo
|
|
10006
|
+
* @name DemoSeed
|
|
10007
|
+
* @summary Seed the request tenant's persistent substrate with full SUMO + the demo scenario situations.
|
|
10008
|
+
* @request POST:/api/v1/demo/seed
|
|
10009
|
+
* @secure
|
|
10010
|
+
*/
|
|
10011
|
+
demoSeed = (data, params = {}) => this.http.request({
|
|
10012
|
+
path: `/api/v1/demo/seed`,
|
|
10013
|
+
method: "POST",
|
|
10014
|
+
body: data,
|
|
10015
|
+
secure: true,
|
|
10016
|
+
type: "application/json" /* Json */,
|
|
10017
|
+
format: "json",
|
|
10018
|
+
...params
|
|
10019
|
+
});
|
|
10020
|
+
};
|
|
10021
|
+
|
|
10022
|
+
// src/api-spec/generated/Reward.ts
|
|
10023
|
+
var Reward = class {
|
|
10024
|
+
http;
|
|
10025
|
+
constructor(http) {
|
|
10026
|
+
this.http = http;
|
|
10027
|
+
}
|
|
10028
|
+
/**
|
|
10029
|
+
* No description
|
|
10030
|
+
*
|
|
10031
|
+
* @tags reward
|
|
10032
|
+
* @name Score
|
|
10033
|
+
* @summary `POST /api/v1/reward/score` — score a candidate query execution-free for the authenticated tenant. Returns `404` if the sort name is unknown to the lattice.
|
|
10034
|
+
* @request POST:/api/v1/reward/score
|
|
10035
|
+
* @secure
|
|
10036
|
+
*/
|
|
10037
|
+
score = (data, params = {}) => this.http.request({
|
|
10038
|
+
path: `/api/v1/reward/score`,
|
|
10039
|
+
method: "POST",
|
|
10040
|
+
body: data,
|
|
10041
|
+
secure: true,
|
|
10042
|
+
type: "application/json" /* Json */,
|
|
10043
|
+
format: "json",
|
|
10044
|
+
...params
|
|
10045
|
+
});
|
|
10046
|
+
};
|
|
10047
|
+
|
|
10048
|
+
// src/api-spec/generated/Translation.ts
|
|
10049
|
+
var Translation = class {
|
|
10050
|
+
http;
|
|
10051
|
+
constructor(http) {
|
|
10052
|
+
this.http = http;
|
|
10053
|
+
}
|
|
10054
|
+
/**
|
|
10055
|
+
* @description POST /api/v1/translate
|
|
10056
|
+
*
|
|
10057
|
+
* @tags translation
|
|
10058
|
+
* @name Translate
|
|
10059
|
+
* @summary Translate text into a target language.
|
|
10060
|
+
* @request POST:/api/v1/translate
|
|
10061
|
+
* @secure
|
|
10062
|
+
*/
|
|
10063
|
+
translate = (data, params = {}) => this.http.request({
|
|
10064
|
+
path: `/api/v1/translate`,
|
|
10065
|
+
method: "POST",
|
|
10066
|
+
body: data,
|
|
10067
|
+
secure: true,
|
|
10068
|
+
type: "application/json" /* Json */,
|
|
10069
|
+
format: "json",
|
|
10070
|
+
...params
|
|
10071
|
+
});
|
|
10072
|
+
};
|
|
10073
|
+
|
|
10074
|
+
// src/api-spec/generated/Streaming.ts
|
|
10075
|
+
var Streaming = class {
|
|
10076
|
+
http;
|
|
10077
|
+
constructor(http) {
|
|
10078
|
+
this.http = http;
|
|
10079
|
+
}
|
|
10080
|
+
/**
|
|
10081
|
+
* @description Build a Count-Min sketch from `items`, then return the estimated frequency for each key in `query_keys`. Strings are hashed to `u64` before insertion. The same hash is used for queries, so counts are consistent within a call. The returned `estimated_count` is an over-estimate: it never falls below the true count, and with (ε, δ) accuracy parameters it exceeds the true count by at most ε · N with probability 1 − δ. No tenant context is required.
|
|
10082
|
+
*
|
|
10083
|
+
* @tags streaming
|
|
10084
|
+
* @name Frequency
|
|
10085
|
+
* @summary `POST /api/v1/streaming/frequency`
|
|
10086
|
+
* @request POST:/api/v1/streaming/frequency
|
|
10087
|
+
*/
|
|
10088
|
+
frequency = (data, params = {}) => this.http.request({
|
|
10089
|
+
path: `/api/v1/streaming/frequency`,
|
|
10090
|
+
method: "POST",
|
|
10091
|
+
body: data,
|
|
10092
|
+
type: "application/json" /* Json */,
|
|
10093
|
+
format: "json",
|
|
10094
|
+
...params
|
|
10095
|
+
});
|
|
10096
|
+
/**
|
|
10097
|
+
* @description Build a Misra-Gries sketch from the supplied batch and return the candidate heavy hitters with their lower-bound counts. The algorithm uses `O(capacity)` memory regardless of the stream cardinality. Every item whose true frequency exceeds `N / (capacity + 1)` is guaranteed to be present in the output. No tenant context is required; the sketch is ephemeral to the call.
|
|
10098
|
+
*
|
|
10099
|
+
* @tags streaming
|
|
10100
|
+
* @name HeavyHitters
|
|
10101
|
+
* @summary `POST /api/v1/streaming/heavy-hitters`
|
|
10102
|
+
* @request POST:/api/v1/streaming/heavy-hitters
|
|
10103
|
+
*/
|
|
10104
|
+
heavyHitters = (data, params = {}) => this.http.request({
|
|
10105
|
+
path: `/api/v1/streaming/heavy-hitters`,
|
|
10106
|
+
method: "POST",
|
|
10107
|
+
body: data,
|
|
10108
|
+
type: "application/json" /* Json */,
|
|
10109
|
+
format: "json",
|
|
10110
|
+
...params
|
|
10111
|
+
});
|
|
10112
|
+
/**
|
|
10113
|
+
* @description Build a Bloom filter, insert every item in `insert_items`, then test each item in `test_items` for membership. **Zero false negatives** — every inserted item will test as present. False positives are possible at a rate that depends on `bit_count`, `hash_count`, and the number of distinct items inserted. No tenant context is required.
|
|
10114
|
+
*
|
|
10115
|
+
* @tags streaming
|
|
10116
|
+
* @name Membership
|
|
10117
|
+
* @summary `POST /api/v1/streaming/membership`
|
|
10118
|
+
* @request POST:/api/v1/streaming/membership
|
|
10119
|
+
*/
|
|
10120
|
+
membership = (data, params = {}) => this.http.request({
|
|
10121
|
+
path: `/api/v1/streaming/membership`,
|
|
10122
|
+
method: "POST",
|
|
10123
|
+
body: data,
|
|
10124
|
+
type: "application/json" /* Json */,
|
|
10125
|
+
format: "json",
|
|
10126
|
+
...params
|
|
10127
|
+
});
|
|
10128
|
+
};
|
|
10129
|
+
|
|
10130
|
+
// src/api-spec/generated/Conformal.ts
|
|
10131
|
+
var Conformal = class {
|
|
10132
|
+
http;
|
|
10133
|
+
constructor(http) {
|
|
10134
|
+
this.http = http;
|
|
10135
|
+
}
|
|
10136
|
+
/**
|
|
10137
|
+
* @description Compute a split-conformal non-conformity threshold from a labeled calibration set. Returns the threshold `τ` and a coverage certificate. The returned `threshold` should be passed verbatim to `POST /api/v1/conformal/predict`.
|
|
10138
|
+
*
|
|
10139
|
+
* @tags conformal
|
|
10140
|
+
* @name Calibrate
|
|
10141
|
+
* @summary `POST /api/v1/conformal/calibrate`
|
|
10142
|
+
* @request POST:/api/v1/conformal/calibrate
|
|
10143
|
+
*/
|
|
10144
|
+
calibrate = (data, params = {}) => this.http.request({
|
|
10145
|
+
path: `/api/v1/conformal/calibrate`,
|
|
10146
|
+
method: "POST",
|
|
10147
|
+
body: data,
|
|
10148
|
+
type: "application/json" /* Json */,
|
|
10149
|
+
format: "json",
|
|
10150
|
+
...params
|
|
10151
|
+
});
|
|
10152
|
+
/**
|
|
10153
|
+
* @description Apply a pre-computed conformal threshold to unlabeled test inputs and return prediction sets with coverage certificates. A class `y` is included in an input's prediction set iff `1 − class_scores[y] ≤ threshold` (equivalently, `class_scores[y] ≥ 1 − threshold`). When no class meets this criterion the prediction set is empty and `abstains = true` is set on that input's result.
|
|
10154
|
+
*
|
|
10155
|
+
* @tags conformal
|
|
10156
|
+
* @name Predict
|
|
10157
|
+
* @summary `POST /api/v1/conformal/predict`
|
|
10158
|
+
* @request POST:/api/v1/conformal/predict
|
|
10159
|
+
*/
|
|
10160
|
+
predict = (data, params = {}) => this.http.request({
|
|
10161
|
+
path: `/api/v1/conformal/predict`,
|
|
10162
|
+
method: "POST",
|
|
10163
|
+
body: data,
|
|
10164
|
+
type: "application/json" /* Json */,
|
|
10165
|
+
format: "json",
|
|
10166
|
+
...params
|
|
10167
|
+
});
|
|
10168
|
+
};
|
|
10169
|
+
|
|
10170
|
+
// src/api-spec/generated/Vision.ts
|
|
10171
|
+
var Vision = class {
|
|
10172
|
+
http;
|
|
10173
|
+
constructor(http) {
|
|
10174
|
+
this.http = http;
|
|
10175
|
+
}
|
|
10176
|
+
/**
|
|
10177
|
+
* @description Requires the deployment to have a [`VJepaPerceptionService`] mounted as an Axum extension. If absent, the route should not be registered; if it is registered without the extension, this handler returns 503. Mounted at `POST /api/v1/vision/encode-clip` by the production composition root when the V-JEPA service is configured.
|
|
10178
|
+
*
|
|
10179
|
+
* @tags vision
|
|
10180
|
+
* @name EncodeClip
|
|
10181
|
+
* @summary Encode a video clip end-to-end through V-JEPA + the head + the substrate, returning per-frame Ψ-term prediction summaries.
|
|
10182
|
+
* @request POST:/api/v1/vision/encode-clip
|
|
10183
|
+
* @secure
|
|
10184
|
+
*/
|
|
10185
|
+
encodeClip = (data, params = {}) => this.http.request({
|
|
10186
|
+
path: `/api/v1/vision/encode-clip`,
|
|
10187
|
+
method: "POST",
|
|
10188
|
+
body: data,
|
|
10189
|
+
secure: true,
|
|
10190
|
+
type: "application/json" /* Json */,
|
|
10191
|
+
format: "json",
|
|
10192
|
+
...params
|
|
10193
|
+
});
|
|
10194
|
+
};
|
|
10195
|
+
|
|
10196
|
+
// src/api-spec/generated/Anonymization.ts
|
|
10197
|
+
var Anonymization = class {
|
|
10198
|
+
http;
|
|
10199
|
+
constructor(http) {
|
|
10200
|
+
this.http = http;
|
|
10201
|
+
}
|
|
10202
|
+
/**
|
|
10203
|
+
* @description Batch-anonymize a set of records using either k-anonymity or HIPAA Safe Harbor de-identification. Returns the processed records together with a full compliance report. Accepts up to 10 000 records per call. For larger batches partition the input and call in parallel. Returns `200 OK` with [`AnonymizeResponse`] on success.
|
|
10204
|
+
*
|
|
10205
|
+
* @tags anonymization
|
|
10206
|
+
* @name AnonymizeRecords
|
|
10207
|
+
* @summary `POST /api/v1/anonymize`
|
|
10208
|
+
* @request POST:/api/v1/anonymize
|
|
10209
|
+
* @secure
|
|
10210
|
+
*/
|
|
10211
|
+
anonymizeRecords = (data, params = {}) => this.http.request({
|
|
10212
|
+
path: `/api/v1/anonymize`,
|
|
10213
|
+
method: "POST",
|
|
10214
|
+
body: data,
|
|
10215
|
+
secure: true,
|
|
10216
|
+
type: "application/json" /* Json */,
|
|
10217
|
+
format: "json",
|
|
10218
|
+
...params
|
|
10219
|
+
});
|
|
10220
|
+
};
|
|
10221
|
+
|
|
10222
|
+
// src/api-spec/generated/Speakers.ts
|
|
10223
|
+
var Speakers = class {
|
|
10224
|
+
http;
|
|
10225
|
+
constructor(http) {
|
|
10226
|
+
this.http = http;
|
|
10227
|
+
}
|
|
10228
|
+
/**
|
|
10229
|
+
* @description DELETE /api/v1/speakers/{id}
|
|
10230
|
+
*
|
|
10231
|
+
* @tags speakers
|
|
10232
|
+
* @name DeleteSpeaker
|
|
10233
|
+
* @summary Delete a speaker profile by id.
|
|
10234
|
+
* @request DELETE:/api/v1/speakers/{id}
|
|
10235
|
+
* @secure
|
|
10236
|
+
*/
|
|
10237
|
+
deleteSpeaker = (id, params = {}) => this.http.request({
|
|
10238
|
+
path: `/api/v1/speakers/${id}`,
|
|
10239
|
+
method: "DELETE",
|
|
10240
|
+
secure: true,
|
|
10241
|
+
...params
|
|
10242
|
+
});
|
|
10243
|
+
/**
|
|
10244
|
+
* @description POST /api/v1/speakers/enroll
|
|
10245
|
+
*
|
|
10246
|
+
* @tags speakers
|
|
10247
|
+
* @name EnrollSpeaker
|
|
10248
|
+
* @summary Enroll (or re-enroll) a speaker voiceprint.
|
|
10249
|
+
* @request POST:/api/v1/speakers/enroll
|
|
10250
|
+
* @secure
|
|
10251
|
+
*/
|
|
10252
|
+
enrollSpeaker = (data, params = {}) => this.http.request({
|
|
10253
|
+
path: `/api/v1/speakers/enroll`,
|
|
10254
|
+
method: "POST",
|
|
10255
|
+
body: data,
|
|
10256
|
+
secure: true,
|
|
10257
|
+
type: "application/json" /* Json */,
|
|
10258
|
+
format: "json",
|
|
10259
|
+
...params
|
|
10260
|
+
});
|
|
10261
|
+
/**
|
|
10262
|
+
* @description GET /api/v1/speakers
|
|
10263
|
+
*
|
|
10264
|
+
* @tags speakers
|
|
10265
|
+
* @name ListSpeakers
|
|
10266
|
+
* @summary List the tenant's enrolled speaker profiles (embeddings withheld).
|
|
10267
|
+
* @request GET:/api/v1/speakers
|
|
10268
|
+
* @secure
|
|
10269
|
+
*/
|
|
10270
|
+
listSpeakers = (params = {}) => this.http.request({
|
|
10271
|
+
path: `/api/v1/speakers`,
|
|
10272
|
+
method: "GET",
|
|
10273
|
+
secure: true,
|
|
10274
|
+
format: "json",
|
|
10275
|
+
...params
|
|
10276
|
+
});
|
|
10277
|
+
};
|
|
10278
|
+
|
|
10279
|
+
// src/api-spec/generated/Speech.ts
|
|
10280
|
+
var Speech = class {
|
|
10281
|
+
http;
|
|
10282
|
+
constructor(http) {
|
|
10283
|
+
this.http = http;
|
|
10284
|
+
}
|
|
10285
|
+
/**
|
|
10286
|
+
* @description DELETE /api/v1/speech/voices/{id}
|
|
10287
|
+
*
|
|
10288
|
+
* @tags speech
|
|
10289
|
+
* @name DeleteVoice
|
|
10290
|
+
* @summary Delete a cloned voice, upstream conditioning included.
|
|
10291
|
+
* @request DELETE:/api/v1/speech/voices/{id}
|
|
10292
|
+
* @secure
|
|
10293
|
+
*/
|
|
10294
|
+
deleteVoice = (id, params = {}) => this.http.request({
|
|
10295
|
+
path: `/api/v1/speech/voices/${id}`,
|
|
10296
|
+
method: "DELETE",
|
|
10297
|
+
secure: true,
|
|
10298
|
+
...params
|
|
10299
|
+
});
|
|
10300
|
+
/**
|
|
10301
|
+
* @description POST /api/v1/speech/voices
|
|
10302
|
+
*
|
|
10303
|
+
* @tags speech
|
|
10304
|
+
* @name EnrollVoice
|
|
10305
|
+
* @summary Enroll (or re-enroll) a cloned voice.
|
|
10306
|
+
* @request POST:/api/v1/speech/voices
|
|
10307
|
+
* @secure
|
|
10308
|
+
*/
|
|
10309
|
+
enrollVoice = (data, params = {}) => this.http.request({
|
|
10310
|
+
path: `/api/v1/speech/voices`,
|
|
10311
|
+
method: "POST",
|
|
10312
|
+
body: data,
|
|
10313
|
+
secure: true,
|
|
10314
|
+
type: "application/json" /* Json */,
|
|
10315
|
+
format: "json",
|
|
10316
|
+
...params
|
|
10317
|
+
});
|
|
10318
|
+
/**
|
|
10319
|
+
* @description GET /api/v1/speech/engines
|
|
10320
|
+
*
|
|
10321
|
+
* @tags speech
|
|
10322
|
+
* @name ListEngines
|
|
10323
|
+
* @summary Report per-engine availability.
|
|
10324
|
+
* @request GET:/api/v1/speech/engines
|
|
10325
|
+
* @secure
|
|
10326
|
+
*/
|
|
10327
|
+
listEngines = (params = {}) => this.http.request({
|
|
10328
|
+
path: `/api/v1/speech/engines`,
|
|
10329
|
+
method: "GET",
|
|
10330
|
+
secure: true,
|
|
10331
|
+
format: "json",
|
|
10332
|
+
...params
|
|
10333
|
+
});
|
|
10334
|
+
/**
|
|
10335
|
+
* @description GET /api/v1/speech/voices
|
|
10336
|
+
*
|
|
10337
|
+
* @tags speech
|
|
10338
|
+
* @name ListVoices
|
|
10339
|
+
* @summary List the tenant's cloned voices plus available presets.
|
|
10340
|
+
* @request GET:/api/v1/speech/voices
|
|
10341
|
+
* @secure
|
|
10342
|
+
*/
|
|
10343
|
+
listVoices = (params = {}) => this.http.request({
|
|
10344
|
+
path: `/api/v1/speech/voices`,
|
|
10345
|
+
method: "GET",
|
|
10346
|
+
secure: true,
|
|
10347
|
+
format: "json",
|
|
10348
|
+
...params
|
|
10349
|
+
});
|
|
10350
|
+
/**
|
|
10351
|
+
* @description POST /api/v1/speech/session
|
|
10352
|
+
*
|
|
10353
|
+
* @tags speech
|
|
10354
|
+
* @name OpenSpeechSession
|
|
10355
|
+
* @summary Open a speech-to-speech session.
|
|
10356
|
+
* @request POST:/api/v1/speech/session
|
|
10357
|
+
* @secure
|
|
10358
|
+
*/
|
|
10359
|
+
openSpeechSession = (data, params = {}) => this.http.request({
|
|
10360
|
+
path: `/api/v1/speech/session`,
|
|
10361
|
+
method: "POST",
|
|
10362
|
+
body: data,
|
|
10363
|
+
secure: true,
|
|
10364
|
+
type: "application/json" /* Json */,
|
|
10365
|
+
format: "json",
|
|
10366
|
+
...params
|
|
10367
|
+
});
|
|
10368
|
+
/**
|
|
10369
|
+
* @description POST /api/v1/speech/synthesize
|
|
10370
|
+
*
|
|
10371
|
+
* @tags speech
|
|
10372
|
+
* @name SynthesizeSpeech
|
|
10373
|
+
* @summary Synthesize speech.
|
|
10374
|
+
* @request POST:/api/v1/speech/synthesize
|
|
10375
|
+
* @secure
|
|
10376
|
+
*/
|
|
10377
|
+
synthesizeSpeech = (data, params = {}) => this.http.request({
|
|
10378
|
+
path: `/api/v1/speech/synthesize`,
|
|
10379
|
+
method: "POST",
|
|
10380
|
+
body: data,
|
|
10381
|
+
secure: true,
|
|
10382
|
+
type: "application/json" /* Json */,
|
|
10383
|
+
...params
|
|
10384
|
+
});
|
|
10385
|
+
/**
|
|
10386
|
+
* @description POST /api/v1/speech/transcribe
|
|
10387
|
+
*
|
|
10388
|
+
* @tags speech
|
|
10389
|
+
* @name TranscribeSpeech
|
|
10390
|
+
* @summary Transcribe a short utterance.
|
|
10391
|
+
* @request POST:/api/v1/speech/transcribe
|
|
10392
|
+
* @secure
|
|
10393
|
+
*/
|
|
10394
|
+
transcribeSpeech = (data, params = {}) => this.http.request({
|
|
10395
|
+
path: `/api/v1/speech/transcribe`,
|
|
10396
|
+
method: "POST",
|
|
10397
|
+
body: data,
|
|
10398
|
+
secure: true,
|
|
10399
|
+
type: "application/json" /* Json */,
|
|
10400
|
+
format: "json",
|
|
10401
|
+
...params
|
|
10402
|
+
});
|
|
10403
|
+
};
|
|
10404
|
+
|
|
10405
|
+
// src/api-spec/generated/Connectors.ts
|
|
10406
|
+
var Connectors = class {
|
|
10407
|
+
http;
|
|
10408
|
+
constructor(http) {
|
|
10409
|
+
this.http = http;
|
|
10410
|
+
}
|
|
10411
|
+
/**
|
|
10412
|
+
* @description POST /api/v1/connectors/manage
|
|
10413
|
+
*
|
|
10414
|
+
* @tags connectors
|
|
10415
|
+
* @name Add
|
|
10416
|
+
* @summary Add a connector instance to the tenant.
|
|
10417
|
+
* @request POST:/api/v1/connectors/manage
|
|
10418
|
+
* @secure
|
|
10419
|
+
*/
|
|
10420
|
+
add = (data, params = {}) => this.http.request({
|
|
10421
|
+
path: `/api/v1/connectors/manage`,
|
|
10422
|
+
method: "POST",
|
|
10423
|
+
body: data,
|
|
10424
|
+
secure: true,
|
|
10425
|
+
type: "application/json" /* Json */,
|
|
10426
|
+
format: "json",
|
|
10427
|
+
...params
|
|
10428
|
+
});
|
|
10429
|
+
/**
|
|
10430
|
+
* @description POST /api/v1/connectors/manage/{name}/disconnect
|
|
10431
|
+
*
|
|
10432
|
+
* @tags connectors
|
|
10433
|
+
* @name Disconnect
|
|
10434
|
+
* @summary Disconnect a connector (revoke tokens, set status=disconnected).
|
|
10435
|
+
* @request POST:/api/v1/connectors/manage/{name}/disconnect
|
|
10436
|
+
* @secure
|
|
10437
|
+
*/
|
|
10438
|
+
disconnect = (name, params = {}) => this.http.request({
|
|
10439
|
+
path: `/api/v1/connectors/manage/${name}/disconnect`,
|
|
10440
|
+
method: "POST",
|
|
10441
|
+
secure: true,
|
|
10442
|
+
...params
|
|
10443
|
+
});
|
|
10444
|
+
/**
|
|
10445
|
+
* @description GET /api/v1/connectors/manage
|
|
10446
|
+
*
|
|
10447
|
+
* @tags connectors
|
|
10448
|
+
* @name List
|
|
10449
|
+
* @summary List tenant's connectors.
|
|
10450
|
+
* @request GET:/api/v1/connectors/manage
|
|
10451
|
+
* @secure
|
|
10452
|
+
*/
|
|
10453
|
+
list = (params = {}) => this.http.request({
|
|
10454
|
+
path: `/api/v1/connectors/manage`,
|
|
10455
|
+
method: "GET",
|
|
10456
|
+
secure: true,
|
|
10457
|
+
format: "json",
|
|
10458
|
+
...params
|
|
10459
|
+
});
|
|
10460
|
+
/**
|
|
10461
|
+
* @description GET /api/v1/connector-types
|
|
10462
|
+
*
|
|
10463
|
+
* @tags connectors
|
|
10464
|
+
* @name ListTypes
|
|
10465
|
+
* @summary List available connector types (global catalog).
|
|
10466
|
+
* @request GET:/api/v1/connector-types
|
|
10467
|
+
*/
|
|
10468
|
+
listTypes = (params = {}) => this.http.request({
|
|
10469
|
+
path: `/api/v1/connector-types`,
|
|
10470
|
+
method: "GET",
|
|
10471
|
+
format: "json",
|
|
10472
|
+
...params
|
|
10473
|
+
});
|
|
10474
|
+
/**
|
|
10475
|
+
* @description GET /api/v1/connectors/manage/{name}/oauth/callback
|
|
10476
|
+
*
|
|
10477
|
+
* @tags connectors
|
|
10478
|
+
* @name OauthCallback
|
|
10479
|
+
* @summary OAuth callback — exchanges code for tokens, returns HTML that posts message to opener.
|
|
10480
|
+
* @request GET:/api/v1/connectors/manage/{name}/oauth/callback
|
|
10481
|
+
*/
|
|
10482
|
+
oauthCallback = (name, query, params = {}) => this.http.request({
|
|
10483
|
+
path: `/api/v1/connectors/manage/${name}/oauth/callback`,
|
|
10484
|
+
method: "GET",
|
|
10485
|
+
query,
|
|
10486
|
+
...params
|
|
10487
|
+
});
|
|
10488
|
+
/**
|
|
10489
|
+
* @description DELETE /api/v1/connectors/manage/{name}
|
|
10490
|
+
*
|
|
10491
|
+
* @tags connectors
|
|
10492
|
+
* @name Remove
|
|
10493
|
+
* @summary Remove a connector from the tenant (cascades: deletes tokens).
|
|
10494
|
+
* @request DELETE:/api/v1/connectors/manage/{name}
|
|
10495
|
+
* @secure
|
|
10496
|
+
*/
|
|
10497
|
+
remove = (name, params = {}) => this.http.request({
|
|
10498
|
+
path: `/api/v1/connectors/manage/${name}`,
|
|
10499
|
+
method: "DELETE",
|
|
10500
|
+
secure: true,
|
|
10501
|
+
...params
|
|
10502
|
+
});
|
|
10503
|
+
/**
|
|
10504
|
+
* @description POST /api/v1/connectors/manage/{name}/connect
|
|
10505
|
+
*
|
|
10506
|
+
* @tags connectors
|
|
10507
|
+
* @name StartOauth
|
|
10508
|
+
* @summary Start OAuth flow — returns auth URL for popup.
|
|
10509
|
+
* @request POST:/api/v1/connectors/manage/{name}/connect
|
|
10510
|
+
* @secure
|
|
10511
|
+
*/
|
|
10512
|
+
startOauth = (name, params = {}) => this.http.request({
|
|
10513
|
+
path: `/api/v1/connectors/manage/${name}/connect`,
|
|
10514
|
+
method: "POST",
|
|
10515
|
+
secure: true,
|
|
10516
|
+
format: "json",
|
|
10517
|
+
...params
|
|
10518
|
+
});
|
|
10519
|
+
};
|
|
10520
|
+
|
|
9659
10521
|
// src/api-spec/generated/Documents.ts
|
|
9660
10522
|
var Documents = class {
|
|
9661
10523
|
http;
|
|
@@ -11121,6 +11983,15 @@ function RejectLearnedSimilarityResponseFromApiToFront(dto) {
|
|
|
11121
11983
|
message: dto.message
|
|
11122
11984
|
};
|
|
11123
11985
|
}
|
|
11986
|
+
function SortIndexStatusResponseFromApiToFront(dto) {
|
|
11987
|
+
const out = {
|
|
11988
|
+
running: dto.running,
|
|
11989
|
+
totalSorts: dto.total_sorts
|
|
11990
|
+
};
|
|
11991
|
+
if (dto.last_error != null) out.lastError = dto.last_error;
|
|
11992
|
+
if (dto.last_indexed_count != null) out.lastIndexedCount = dto.last_indexed_count;
|
|
11993
|
+
return out;
|
|
11994
|
+
}
|
|
11124
11995
|
|
|
11125
11996
|
// src/resources/sorts.ts
|
|
11126
11997
|
var SortsClient = class {
|
|
@@ -11336,6 +12207,16 @@ var SortsClient = class {
|
|
|
11336
12207
|
async indexSorts() {
|
|
11337
12208
|
await this.sorts.indexSorts();
|
|
11338
12209
|
}
|
|
12210
|
+
/**
|
|
12211
|
+
* Report the status of the background sort-indexing pass.
|
|
12212
|
+
*
|
|
12213
|
+
* @returns Whether a re-index is running, the most recent run's indexed
|
|
12214
|
+
* count and any error, plus the total data-sort denominator.
|
|
12215
|
+
*/
|
|
12216
|
+
async sortIndexStatus() {
|
|
12217
|
+
const response = await this.sorts.sortIndexStatus();
|
|
12218
|
+
return SortIndexStatusResponseFromApiToFront(response.data);
|
|
12219
|
+
}
|
|
11339
12220
|
/**
|
|
11340
12221
|
* Update the review status of a sort.
|
|
11341
12222
|
*
|
|
@@ -14687,6 +15568,25 @@ function FindSimilarRequestFromFrontToApi(model) {
|
|
|
14687
15568
|
fail_on_unknown: model.failOnUnknown
|
|
14688
15569
|
};
|
|
14689
15570
|
}
|
|
15571
|
+
function ScoreTermsRequestFromFrontToApi(model) {
|
|
15572
|
+
return {
|
|
15573
|
+
...QueryTermFromFrontToApi(model),
|
|
15574
|
+
fail_on_unknown: model.failOnUnknown,
|
|
15575
|
+
similarity_mode: model.similarityMode,
|
|
15576
|
+
term_ids: model.termIds
|
|
15577
|
+
};
|
|
15578
|
+
}
|
|
15579
|
+
function ScoredTermFromApiToFront(dto) {
|
|
15580
|
+
return {
|
|
15581
|
+
degree: dto.degree,
|
|
15582
|
+
termId: dto.term_id
|
|
15583
|
+
};
|
|
15584
|
+
}
|
|
15585
|
+
function ScoreTermsResponseFromApiToFront(dto) {
|
|
15586
|
+
return {
|
|
15587
|
+
scores: dto.scores.map(ScoredTermFromApiToFront)
|
|
15588
|
+
};
|
|
15589
|
+
}
|
|
14690
15590
|
function SimilarityMatchFromApiToFront(dto) {
|
|
14691
15591
|
return {
|
|
14692
15592
|
confidencePercent: dto.confidence_percent,
|
|
@@ -14857,6 +15757,18 @@ var FuzzyClient = class {
|
|
|
14857
15757
|
});
|
|
14858
15758
|
return PredictEffectResponseFromApiToFront(response.data);
|
|
14859
15759
|
}
|
|
15760
|
+
/**
|
|
15761
|
+
* Score a given set of candidate terms against a query ψ-term.
|
|
15762
|
+
*
|
|
15763
|
+
* @param request - The query ψ-term (`QueryTerm`) plus the candidate
|
|
15764
|
+
* `termIds` and optional scoring knobs.
|
|
15765
|
+
* @returns The candidates with their fuzzy-unification degrees, in
|
|
15766
|
+
* input order.
|
|
15767
|
+
*/
|
|
15768
|
+
async scoreTerms(request) {
|
|
15769
|
+
const response = await this.api.scoreTerms(ScoreTermsRequestFromFrontToApi(request));
|
|
15770
|
+
return ScoreTermsResponseFromApiToFront(response.data);
|
|
15771
|
+
}
|
|
14860
15772
|
};
|
|
14861
15773
|
|
|
14862
15774
|
// src/normalizers/visualization.ts
|
|
@@ -18472,6 +19384,35 @@ function IngestRdfRequestFromFrontToApi(model) {
|
|
|
18472
19384
|
parse_shacl: model.parseShacl
|
|
18473
19385
|
};
|
|
18474
19386
|
}
|
|
19387
|
+
function IngestKifRequestFromFrontToApi(model) {
|
|
19388
|
+
const dto = { content: model.content };
|
|
19389
|
+
if (model.goal !== void 0) dto.goal = model.goal;
|
|
19390
|
+
if (model.persist !== void 0) dto.persist = model.persist;
|
|
19391
|
+
if (model.query !== void 0) dto.query = model.query;
|
|
19392
|
+
return dto;
|
|
19393
|
+
}
|
|
19394
|
+
function IngestKifResponseFromApiToFront(dto) {
|
|
19395
|
+
const out = {
|
|
19396
|
+
capturedNonHorn: dto.captured_non_horn,
|
|
19397
|
+
constraintRules: dto.constraint_rules,
|
|
19398
|
+
disjunctiveRules: dto.disjunctive_rules,
|
|
19399
|
+
facts: dto.facts,
|
|
19400
|
+
forms: dto.forms,
|
|
19401
|
+
hornRules: dto.horn_rules,
|
|
19402
|
+
instantiatedRules: dto.instantiated_rules,
|
|
19403
|
+
nafRules: dto.naf_rules,
|
|
19404
|
+
residueByShape: dto.residue_by_shape,
|
|
19405
|
+
residueExamples: dto.residue_examples,
|
|
19406
|
+
rules: dto.rules,
|
|
19407
|
+
skolemized: dto.skolemized,
|
|
19408
|
+
sorts: dto.sorts,
|
|
19409
|
+
subclassEdges: dto.subclass_edges,
|
|
19410
|
+
success: dto.success,
|
|
19411
|
+
temporalDetached: dto.temporal_detached
|
|
19412
|
+
};
|
|
19413
|
+
if (dto.provable != null) out.provable = dto.provable;
|
|
19414
|
+
return out;
|
|
19415
|
+
}
|
|
18475
19416
|
function TranslateRdfRequestFromFrontToApi(model) {
|
|
18476
19417
|
return {
|
|
18477
19418
|
content: model.content,
|
|
@@ -18918,6 +19859,21 @@ var IngestionClient = class {
|
|
|
18918
19859
|
);
|
|
18919
19860
|
return IngestRdfResponseFromApiToFront(response.data);
|
|
18920
19861
|
}
|
|
19862
|
+
/**
|
|
19863
|
+
* Import SUO-KIF and, optionally, prove a ground goal against the
|
|
19864
|
+
* imported axioms.
|
|
19865
|
+
*
|
|
19866
|
+
* @param request - The SUO-KIF source, an optional `goal`/`query` to
|
|
19867
|
+
* prove, and a `persist` flag (import into the tenant substrate vs an
|
|
19868
|
+
* ephemeral request-scoped world).
|
|
19869
|
+
* @returns Import counts (forms, facts, rules, sorts, …) plus, when a
|
|
19870
|
+
* goal/query was supplied, a `provable` verdict and the non-firing
|
|
19871
|
+
* residue breakdown.
|
|
19872
|
+
*/
|
|
19873
|
+
async ingestKif(request) {
|
|
19874
|
+
const response = await this.api.ingestKif(IngestKifRequestFromFrontToApi(request));
|
|
19875
|
+
return IngestKifResponseFromApiToFront(response.data);
|
|
19876
|
+
}
|
|
18921
19877
|
/**
|
|
18922
19878
|
* Translate RDF into the engine's term representation without writing
|
|
18923
19879
|
* anything to the knowledge base.
|
|
@@ -21533,6 +22489,66 @@ function SearchCommunitiesResponseFromApiToFront(dto) {
|
|
|
21533
22489
|
stats: CommunitySearchStatsDtoFromApiToFront(dto.stats)
|
|
21534
22490
|
};
|
|
21535
22491
|
}
|
|
22492
|
+
function NodeScoreFromApiToFront(dto) {
|
|
22493
|
+
return {
|
|
22494
|
+
nodeId: dto.node_id,
|
|
22495
|
+
score: dto.score
|
|
22496
|
+
};
|
|
22497
|
+
}
|
|
22498
|
+
function CentralityRequestFromFrontToApi(model) {
|
|
22499
|
+
const dto = {
|
|
22500
|
+
measure: model.measure,
|
|
22501
|
+
tenant_id: model.tenantId
|
|
22502
|
+
};
|
|
22503
|
+
if (model.topK !== void 0) dto.top_k = model.topK;
|
|
22504
|
+
return dto;
|
|
22505
|
+
}
|
|
22506
|
+
function CentralityResponseFromApiToFront(dto) {
|
|
22507
|
+
return {
|
|
22508
|
+
edgeCount: dto.edge_count,
|
|
22509
|
+
measure: dto.measure,
|
|
22510
|
+
nodeCount: dto.node_count,
|
|
22511
|
+
scores: dto.scores.map(NodeScoreFromApiToFront)
|
|
22512
|
+
};
|
|
22513
|
+
}
|
|
22514
|
+
function CohesionRequestFromFrontToApi(model) {
|
|
22515
|
+
return { tenant_id: model.tenantId };
|
|
22516
|
+
}
|
|
22517
|
+
function CohesionResponseFromApiToFront(dto) {
|
|
22518
|
+
return {
|
|
22519
|
+
clustering: dto.clustering.map(NodeScoreFromApiToFront),
|
|
22520
|
+
nodeCount: dto.node_count,
|
|
22521
|
+
triangleCount: dto.triangle_count
|
|
22522
|
+
};
|
|
22523
|
+
}
|
|
22524
|
+
function PathRequestFromFrontToApi(model) {
|
|
22525
|
+
return {
|
|
22526
|
+
source: model.source,
|
|
22527
|
+
target: model.target,
|
|
22528
|
+
tenant_id: model.tenantId
|
|
22529
|
+
};
|
|
22530
|
+
}
|
|
22531
|
+
function PathResponseFromApiToFront(dto) {
|
|
22532
|
+
const out = { componentCount: dto.component_count };
|
|
22533
|
+
if (dto.path !== void 0 && dto.path !== null) out.path = dto.path;
|
|
22534
|
+
return out;
|
|
22535
|
+
}
|
|
22536
|
+
function LinkPredictionRequestFromFrontToApi(model) {
|
|
22537
|
+
const dto = {
|
|
22538
|
+
measure: model.measure,
|
|
22539
|
+
source: model.source,
|
|
22540
|
+
tenant_id: model.tenantId
|
|
22541
|
+
};
|
|
22542
|
+
if (model.topK !== void 0) dto.top_k = model.topK;
|
|
22543
|
+
return dto;
|
|
22544
|
+
}
|
|
22545
|
+
function LinkPredictionResponseFromApiToFront(dto) {
|
|
22546
|
+
return {
|
|
22547
|
+
measure: dto.measure,
|
|
22548
|
+
predictions: dto.predictions.map(NodeScoreFromApiToFront),
|
|
22549
|
+
source: dto.source
|
|
22550
|
+
};
|
|
22551
|
+
}
|
|
21536
22552
|
|
|
21537
22553
|
// src/resources/communities.ts
|
|
21538
22554
|
var CommunitiesClient = class {
|
|
@@ -21572,6 +22588,48 @@ var CommunitiesClient = class {
|
|
|
21572
22588
|
const response = await this.api.searchCommunities(SearchCommunitiesRequestFromFrontToApi(request));
|
|
21573
22589
|
return SearchCommunitiesResponseFromApiToFront(response.data);
|
|
21574
22590
|
}
|
|
22591
|
+
/**
|
|
22592
|
+
* Compute a centrality measure over the tenant's term graph.
|
|
22593
|
+
*
|
|
22594
|
+
* @param request - The measure, tenant id, and an optional `topK` cap.
|
|
22595
|
+
* @returns Node scores sorted descending, plus graph node/edge counts.
|
|
22596
|
+
*/
|
|
22597
|
+
async computeCentrality(request) {
|
|
22598
|
+
const response = await this.api.computeCentrality(CentralityRequestFromFrontToApi(request));
|
|
22599
|
+
return CentralityResponseFromApiToFront(response.data);
|
|
22600
|
+
}
|
|
22601
|
+
/**
|
|
22602
|
+
* Compute graph cohesion (local clustering coefficients + triangle count).
|
|
22603
|
+
*
|
|
22604
|
+
* @param request - The tenant id.
|
|
22605
|
+
* @returns Per-node clustering coefficients, node count, and triangle count.
|
|
22606
|
+
*/
|
|
22607
|
+
async computeCohesion(request) {
|
|
22608
|
+
const response = await this.api.computeCohesion(CohesionRequestFromFrontToApi(request));
|
|
22609
|
+
return CohesionResponseFromApiToFront(response.data);
|
|
22610
|
+
}
|
|
22611
|
+
/**
|
|
22612
|
+
* Find the shortest path between two nodes in the tenant's term graph.
|
|
22613
|
+
*
|
|
22614
|
+
* @param request - Source node, target node, and tenant id.
|
|
22615
|
+
* @returns The shortest path as a node sequence (when reachable) plus the
|
|
22616
|
+
* connected-component count.
|
|
22617
|
+
*/
|
|
22618
|
+
async computePath(request) {
|
|
22619
|
+
const response = await this.api.computePath(PathRequestFromFrontToApi(request));
|
|
22620
|
+
return PathResponseFromApiToFront(response.data);
|
|
22621
|
+
}
|
|
22622
|
+
/**
|
|
22623
|
+
* Predict candidate links from a source node using a graph heuristic.
|
|
22624
|
+
*
|
|
22625
|
+
* @param request - The heuristic, source node, tenant id, and an optional
|
|
22626
|
+
* `topK` cap.
|
|
22627
|
+
* @returns Candidate targets with positive score, sorted descending.
|
|
22628
|
+
*/
|
|
22629
|
+
async predictLinks(request) {
|
|
22630
|
+
const response = await this.api.predictLinks(LinkPredictionRequestFromFrontToApi(request));
|
|
22631
|
+
return LinkPredictionResponseFromApiToFront(response.data);
|
|
22632
|
+
}
|
|
21575
22633
|
};
|
|
21576
22634
|
|
|
21577
22635
|
// src/normalizers/utilities.ts
|
|
@@ -22404,6 +23462,33 @@ function PredictFromDiscoveryResponseFromApiToFront(dto) {
|
|
|
22404
23462
|
success: dto.success
|
|
22405
23463
|
};
|
|
22406
23464
|
}
|
|
23465
|
+
function EmlSampleFromFrontToApi(model) {
|
|
23466
|
+
return {
|
|
23467
|
+
inputs: model.inputs,
|
|
23468
|
+
target: model.target
|
|
23469
|
+
};
|
|
23470
|
+
}
|
|
23471
|
+
function DiscoverEmlRequestFromFrontToApi(model) {
|
|
23472
|
+
const dto = {
|
|
23473
|
+
depth: model.depth,
|
|
23474
|
+
samples: model.samples.map(EmlSampleFromFrontToApi)
|
|
23475
|
+
};
|
|
23476
|
+
if (model.maxEpochs !== void 0) dto.max_epochs = model.maxEpochs;
|
|
23477
|
+
if (model.numRestarts !== void 0) dto.num_restarts = model.numRestarts;
|
|
23478
|
+
return dto;
|
|
23479
|
+
}
|
|
23480
|
+
function DiscoverEmlResponseFromApiToFront(dto) {
|
|
23481
|
+
const out = {
|
|
23482
|
+
epochsRun: dto.epochs_run,
|
|
23483
|
+
finalLoss: dto.final_loss,
|
|
23484
|
+
snapped: dto.snapped,
|
|
23485
|
+
success: dto.success
|
|
23486
|
+
};
|
|
23487
|
+
if (dto.expression_depth != null) out.expressionDepth = dto.expression_depth;
|
|
23488
|
+
if (dto.expression_leaf_count != null) out.expressionLeafCount = dto.expression_leaf_count;
|
|
23489
|
+
if (dto.expression_rpn != null) out.expressionRpn = dto.expression_rpn;
|
|
23490
|
+
return out;
|
|
23491
|
+
}
|
|
22407
23492
|
|
|
22408
23493
|
// src/resources/discovery.ts
|
|
22409
23494
|
var DiscoveryClient = class {
|
|
@@ -22433,6 +23518,19 @@ var DiscoveryClient = class {
|
|
|
22433
23518
|
const response = await this.api.predictFromDiscovery(PredictFromDiscoveryRequestFromFrontToApi(request));
|
|
22434
23519
|
return PredictFromDiscoveryResponseFromApiToFront(response.data);
|
|
22435
23520
|
}
|
|
23521
|
+
/**
|
|
23522
|
+
* Discover a closed-form expression from samples via parameterised EML.
|
|
23523
|
+
*
|
|
23524
|
+
* @param request - Tree-depth bound, training samples, and optional
|
|
23525
|
+
* epoch/restart caps.
|
|
23526
|
+
* @returns The discovered expression (RPN + depth/leaf-count when
|
|
23527
|
+
* recovered) plus the training stats (epochs, final loss, snap +
|
|
23528
|
+
* success flags).
|
|
23529
|
+
*/
|
|
23530
|
+
async discoverEml(request) {
|
|
23531
|
+
const response = await this.api.discoverEml(DiscoverEmlRequestFromFrontToApi(request));
|
|
23532
|
+
return DiscoverEmlResponseFromApiToFront(response.data);
|
|
23533
|
+
}
|
|
22436
23534
|
};
|
|
22437
23535
|
|
|
22438
23536
|
// src/normalizers/extract.ts
|
|
@@ -25670,6 +26768,56 @@ function GenerateDocumentResponseFromApiToFront(dto) {
|
|
|
25670
26768
|
verification: dto.verification ? VerificationDtoFromApiToFront(dto.verification) : void 0
|
|
25671
26769
|
};
|
|
25672
26770
|
}
|
|
26771
|
+
function ConstrainedGenerateRequestFromFrontToApi(model) {
|
|
26772
|
+
const dto = {
|
|
26773
|
+
allowed: model.allowed,
|
|
26774
|
+
prompt: model.prompt
|
|
26775
|
+
};
|
|
26776
|
+
if (model.maxTokens !== void 0) dto.max_tokens = model.maxTokens;
|
|
26777
|
+
return dto;
|
|
26778
|
+
}
|
|
26779
|
+
function ConstrainedGenerateResponseFromApiToFront(dto) {
|
|
26780
|
+
return {
|
|
26781
|
+
allowed: dto.allowed,
|
|
26782
|
+
answer: dto.answer,
|
|
26783
|
+
maskedOut: dto.masked_out,
|
|
26784
|
+
tokens: dto.tokens
|
|
26785
|
+
};
|
|
26786
|
+
}
|
|
26787
|
+
function RawGenerateRequestFromFrontToApi(model) {
|
|
26788
|
+
const dto = { prompt: model.prompt };
|
|
26789
|
+
if (model.maxTokens !== void 0) dto.max_tokens = model.maxTokens;
|
|
26790
|
+
return dto;
|
|
26791
|
+
}
|
|
26792
|
+
function RawGenerateResponseFromApiToFront(dto) {
|
|
26793
|
+
return { prose: dto.prose };
|
|
26794
|
+
}
|
|
26795
|
+
function GroundedGenerateRequestFromFrontToApi(model) {
|
|
26796
|
+
const dto = { prompt: model.prompt };
|
|
26797
|
+
if (model.goalDest !== void 0) dto.goal_dest = model.goalDest;
|
|
26798
|
+
if (model.goalDistance !== void 0) dto.goal_distance = model.goalDistance;
|
|
26799
|
+
if (model.goalFeasible !== void 0) dto.goal_feasible = model.goalFeasible;
|
|
26800
|
+
if (model.goalTarget !== void 0) dto.goal_target = model.goalTarget;
|
|
26801
|
+
if (model.maxTokens !== void 0) dto.max_tokens = model.maxTokens;
|
|
26802
|
+
if (model.mode !== void 0) dto.mode = model.mode;
|
|
26803
|
+
if (model.prose !== void 0) dto.prose = model.prose;
|
|
26804
|
+
if (model.steerMargin !== void 0) dto.steer_margin = model.steerMargin;
|
|
26805
|
+
return dto;
|
|
26806
|
+
}
|
|
26807
|
+
function GroundedGenerateResponseFromApiToFront(dto) {
|
|
26808
|
+
const out = {
|
|
26809
|
+
admittedTerms: dto.admitted_terms,
|
|
26810
|
+
derivation: dto.derivation,
|
|
26811
|
+
feasibleModes: dto.feasible_modes,
|
|
26812
|
+
mode: dto.mode,
|
|
26813
|
+
prose: dto.prose,
|
|
26814
|
+
refutedModes: dto.refuted_modes
|
|
26815
|
+
};
|
|
26816
|
+
if (dto.certify_outcome != null) out.certifyOutcome = dto.certify_outcome;
|
|
26817
|
+
if (dto.model_pick != null) out.modelPick = dto.model_pick;
|
|
26818
|
+
if (dto.recommended_mode != null) out.recommendedMode = dto.recommended_mode;
|
|
26819
|
+
return out;
|
|
26820
|
+
}
|
|
25673
26821
|
|
|
25674
26822
|
// src/resources/generation.ts
|
|
25675
26823
|
var GenerationClient = class {
|
|
@@ -25712,6 +26860,46 @@ var GenerationClient = class {
|
|
|
25712
26860
|
const response = await this.api.generateDocument(GenerateDocumentRequestFromFrontToApi(request));
|
|
25713
26861
|
return GenerateDocumentResponseFromApiToFront(response.data);
|
|
25714
26862
|
}
|
|
26863
|
+
/**
|
|
26864
|
+
* Masked-decode one answer from an OSF-feasible allowed set
|
|
26865
|
+
* (`POST /api/v1/constrained/generate`).
|
|
26866
|
+
*
|
|
26867
|
+
* @param request - The allowed set, an optional token cap, and the prompt.
|
|
26868
|
+
* @returns The decoded answer (guaranteed inside `allowed`), the masked-out
|
|
26869
|
+
* alternatives, and the per-step token deltas.
|
|
26870
|
+
*/
|
|
26871
|
+
async constrainedGenerate(request) {
|
|
26872
|
+
const response = await this.api.constrainedGenerate(
|
|
26873
|
+
ConstrainedGenerateRequestFromFrontToApi(request)
|
|
26874
|
+
);
|
|
26875
|
+
return ConstrainedGenerateResponseFromApiToFront(response.data);
|
|
26876
|
+
}
|
|
26877
|
+
/**
|
|
26878
|
+
* Free, ungrounded local-model decode (`POST /api/v1/generate/raw`).
|
|
26879
|
+
*
|
|
26880
|
+
* @param request - The prompt and an optional token cap.
|
|
26881
|
+
* @returns The raw, ungrounded answer.
|
|
26882
|
+
*/
|
|
26883
|
+
async rawGenerate(request) {
|
|
26884
|
+
const response = await this.api.rawGenerate(RawGenerateRequestFromFrontToApi(request));
|
|
26885
|
+
return RawGenerateResponseFromApiToFront(response.data);
|
|
26886
|
+
}
|
|
26887
|
+
/**
|
|
26888
|
+
* Lattice-grounded anti-hallucination generation
|
|
26889
|
+
* (`POST /api/v1/generate/grounded`).
|
|
26890
|
+
*
|
|
26891
|
+
* @param request - The prompt, an optional goal (target/destination) for
|
|
26892
|
+
* feasibility, the anti-hallucination `mode`, and decode knobs.
|
|
26893
|
+
* @returns The lattice-constrained derivation, the free-prose answer, the
|
|
26894
|
+
* feasible/refuted/recommended motion modes, and (certify mode) the
|
|
26895
|
+
* certification outcome.
|
|
26896
|
+
*/
|
|
26897
|
+
async groundedGenerate(request) {
|
|
26898
|
+
const response = await this.api.groundedGenerate(
|
|
26899
|
+
GroundedGenerateRequestFromFrontToApi(request)
|
|
26900
|
+
);
|
|
26901
|
+
return GroundedGenerateResponseFromApiToFront(response.data);
|
|
26902
|
+
}
|
|
25715
26903
|
};
|
|
25716
26904
|
|
|
25717
26905
|
// src/normalizers/rag.ts
|
|
@@ -27232,6 +28420,13 @@ function ListConversationsResponseFromApiToFront(dto) {
|
|
|
27232
28420
|
conversations: dto.conversations.map(ConversationSummaryDtoFromApiToFront)
|
|
27233
28421
|
};
|
|
27234
28422
|
}
|
|
28423
|
+
function CompareModelDtoFromApiToFront(dto) {
|
|
28424
|
+
return {
|
|
28425
|
+
id: dto.id,
|
|
28426
|
+
kind: dto.kind,
|
|
28427
|
+
label: dto.label
|
|
28428
|
+
};
|
|
28429
|
+
}
|
|
27235
28430
|
function ConversationTurnsResponseFromApiToFront(dto) {
|
|
27236
28431
|
return {
|
|
27237
28432
|
conversationId: dto.conversation_id,
|
|
@@ -27340,6 +28535,30 @@ var ConversationClient = class {
|
|
|
27340
28535
|
});
|
|
27341
28536
|
return ListConversationsResponseFromApiToFront(response.data);
|
|
27342
28537
|
}
|
|
28538
|
+
/**
|
|
28539
|
+
* List the registered comparison models so the UI can populate a
|
|
28540
|
+
* selector / compare panel.
|
|
28541
|
+
*
|
|
28542
|
+
* @returns The available comparison models (endpoint- or candle-backed).
|
|
28543
|
+
* @throws {ApiError} If the request fails.
|
|
28544
|
+
*
|
|
28545
|
+
* @example
|
|
28546
|
+
* ```typescript
|
|
28547
|
+
* const models = await client.conversation.listModels();
|
|
28548
|
+
* for (const m of models) {
|
|
28549
|
+
* console.log(`${m.id} (${m.kind}): ${m.label}`);
|
|
28550
|
+
* }
|
|
28551
|
+
* ```
|
|
28552
|
+
*/
|
|
28553
|
+
async listModels() {
|
|
28554
|
+
const response = await this.http.request({
|
|
28555
|
+
path: "/api/v1/conversation/models",
|
|
28556
|
+
method: "GET",
|
|
28557
|
+
secure: true,
|
|
28558
|
+
format: "json"
|
|
28559
|
+
});
|
|
28560
|
+
return (response.data ?? []).map(CompareModelDtoFromApiToFront);
|
|
28561
|
+
}
|
|
27343
28562
|
/**
|
|
27344
28563
|
* Get all turns for a conversation.
|
|
27345
28564
|
*
|
|
@@ -28859,6 +30078,14 @@ function AuditRecordFromApiToFront(dto) {
|
|
|
28859
30078
|
extra: dto.extra
|
|
28860
30079
|
};
|
|
28861
30080
|
}
|
|
30081
|
+
function AuditPageFromApiToFront(dto) {
|
|
30082
|
+
return {
|
|
30083
|
+
records: dto.records.map(AuditRecordFromApiToFront),
|
|
30084
|
+
total: dto.total,
|
|
30085
|
+
limit: dto.limit ?? null,
|
|
30086
|
+
offset: dto.offset
|
|
30087
|
+
};
|
|
30088
|
+
}
|
|
28862
30089
|
function SummaryResponseFromApiToFront(dto) {
|
|
28863
30090
|
const out = {
|
|
28864
30091
|
nRecords: dto.n_records,
|
|
@@ -28948,18 +30175,39 @@ var ComplianceClient = class {
|
|
|
28948
30175
|
return AuditRecordFromApiToFront(response.data);
|
|
28949
30176
|
}
|
|
28950
30177
|
/**
|
|
28951
|
-
* List audit records for this tenant,
|
|
30178
|
+
* List audit records for this tenant — paged, sorted, and filtered.
|
|
30179
|
+
*
|
|
30180
|
+
* @param options - Page / sort / filter controls. Defaults to a
|
|
30181
|
+
* bounded first page (`sort_by=timestamp`, `sort_order=desc`,
|
|
30182
|
+
* `limit=50`) — most-recent-first, matching the backend default.
|
|
30183
|
+
* Pass `all: true` to fetch the full filtered set for export.
|
|
30184
|
+
* @returns A page of records plus the filtered `total`, the `limit`
|
|
30185
|
+
* applied (`null` when `all` was set), and the zero-based `offset`.
|
|
28952
30186
|
*
|
|
28953
|
-
* @
|
|
30187
|
+
* @remarks
|
|
30188
|
+
* The backend clamps `limit` to `1..=200` and defaults it to `50`
|
|
30189
|
+
* when omitted (unless `all` is set). `total` reflects the active
|
|
30190
|
+
* `requestPathPattern` / `since` / `until` filter, not the raw
|
|
30191
|
+
* tenant count — so `{shown} of {total}` and the rendered rows stay
|
|
30192
|
+
* consistent under the same filter. Sort enums are wire-serialised
|
|
30193
|
+
* `snake_case` (`timestamp` / `request_path` / `actor`) and `asc` /
|
|
30194
|
+
* `desc` lowercase; the shipped {@link AuditSortField} /
|
|
30195
|
+
* {@link AuditSortOrder} literals match verbatim.
|
|
28954
30196
|
*/
|
|
28955
30197
|
async list(options = {}) {
|
|
28956
30198
|
const query = {};
|
|
28957
|
-
if (options.limit !== void 0) query.limit = options.limit;
|
|
28958
30199
|
if (options.requestPathPattern !== void 0) {
|
|
28959
30200
|
query.request_path_pattern = options.requestPathPattern;
|
|
28960
30201
|
}
|
|
30202
|
+
if (options.since !== void 0) query.since = options.since;
|
|
30203
|
+
if (options.until !== void 0) query.until = options.until;
|
|
30204
|
+
if (options.sortBy !== void 0) query.sort_by = options.sortBy;
|
|
30205
|
+
if (options.sortOrder !== void 0) query.sort_order = options.sortOrder;
|
|
30206
|
+
if (options.limit !== void 0) query.limit = options.limit;
|
|
30207
|
+
if (options.offset !== void 0) query.offset = options.offset;
|
|
30208
|
+
if (options.all !== void 0) query.all = options.all;
|
|
28961
30209
|
const response = await this.api.list(query);
|
|
28962
|
-
return response.data
|
|
30210
|
+
return AuditPageFromApiToFront(response.data);
|
|
28963
30211
|
}
|
|
28964
30212
|
/**
|
|
28965
30213
|
* Top-line counts over the tenant's full ledger — useful for
|
|
@@ -29039,6 +30287,19 @@ function AntiUnifyResponseFromApiToFront(dto) {
|
|
|
29039
30287
|
computationTimeMs: dto.computation_time_ms
|
|
29040
30288
|
};
|
|
29041
30289
|
}
|
|
30290
|
+
function AntiUnifyBatchRequestFromFrontToApi(model) {
|
|
30291
|
+
return {
|
|
30292
|
+
term_ids: model.termIds
|
|
30293
|
+
};
|
|
30294
|
+
}
|
|
30295
|
+
function AntiUnifyBatchResponseFromApiToFront(dto) {
|
|
30296
|
+
return {
|
|
30297
|
+
computationTimeMs: dto.computation_time_ms,
|
|
30298
|
+
lgg: TermDtoFromApiToFront(dto.lgg),
|
|
30299
|
+
lggTermId: dto.lgg_term_id,
|
|
30300
|
+
steps: dto.steps
|
|
30301
|
+
};
|
|
30302
|
+
}
|
|
29042
30303
|
|
|
29043
30304
|
// src/resources/operations.ts
|
|
29044
30305
|
var OperationsClient = class {
|
|
@@ -29067,6 +30328,25 @@ var OperationsClient = class {
|
|
|
29067
30328
|
);
|
|
29068
30329
|
return AntiUnifyResponseFromApiToFront(response.data);
|
|
29069
30330
|
}
|
|
30331
|
+
/**
|
|
30332
|
+
* Compute the anti-unification (LGG) of a batch of Ψ-terms via a left
|
|
30333
|
+
* fold over 2..=64 term ids.
|
|
30334
|
+
*
|
|
30335
|
+
* @param request - The term ids to generalise, in fold order.
|
|
30336
|
+
* @returns The final LGG term + enriched view + the intermediate LGG
|
|
30337
|
+
* ids from the fold + total timing.
|
|
30338
|
+
*
|
|
30339
|
+
* @remarks
|
|
30340
|
+
* All ids must already be registered in the tenant's term store. The
|
|
30341
|
+
* final LGG is persisted; `steps` is empty when exactly two terms are
|
|
30342
|
+
* supplied.
|
|
30343
|
+
*/
|
|
30344
|
+
async antiUnifyBatch(request) {
|
|
30345
|
+
const response = await this.api.antiUnifyBatch(
|
|
30346
|
+
AntiUnifyBatchRequestFromFrontToApi(request)
|
|
30347
|
+
);
|
|
30348
|
+
return AntiUnifyBatchResponseFromApiToFront(response.data);
|
|
30349
|
+
}
|
|
29070
30350
|
};
|
|
29071
30351
|
|
|
29072
30352
|
// src/normalizers/actions.ts
|
|
@@ -34316,6 +35596,1016 @@ var OntologyExportClient = class {
|
|
|
34316
35596
|
}
|
|
34317
35597
|
};
|
|
34318
35598
|
|
|
35599
|
+
// src/normalizers/demo.ts
|
|
35600
|
+
function DemoSeedRequestFromFrontToApi(model) {
|
|
35601
|
+
const dto = {};
|
|
35602
|
+
if (model.sumoDir !== void 0) dto.sumo_dir = model.sumoDir;
|
|
35603
|
+
return dto;
|
|
35604
|
+
}
|
|
35605
|
+
function DemoSeedResponseFromApiToFront(dto) {
|
|
35606
|
+
return {
|
|
35607
|
+
forms: dto.forms,
|
|
35608
|
+
sorts: dto.sorts
|
|
35609
|
+
};
|
|
35610
|
+
}
|
|
35611
|
+
|
|
35612
|
+
// src/resources/demo.ts
|
|
35613
|
+
var DemoClient = class {
|
|
35614
|
+
/** @internal */
|
|
35615
|
+
api;
|
|
35616
|
+
/** @internal */
|
|
35617
|
+
constructor(api) {
|
|
35618
|
+
this.api = api;
|
|
35619
|
+
}
|
|
35620
|
+
/**
|
|
35621
|
+
* Seed the request tenant's persistent substrate with full SUMO + the
|
|
35622
|
+
* demo scenario situations.
|
|
35623
|
+
*
|
|
35624
|
+
* @param request - Optional SUMO source-directory override.
|
|
35625
|
+
* @returns The imported form count and the tenant's total sort count.
|
|
35626
|
+
*
|
|
35627
|
+
* @throws {ApiError} `404` if the SUMO files cannot be read, `400` if
|
|
35628
|
+
* the assembled source fails to import.
|
|
35629
|
+
*/
|
|
35630
|
+
async seed(request = {}) {
|
|
35631
|
+
const response = await this.api.demoSeed(DemoSeedRequestFromFrontToApi(request));
|
|
35632
|
+
return DemoSeedResponseFromApiToFront(response.data);
|
|
35633
|
+
}
|
|
35634
|
+
};
|
|
35635
|
+
|
|
35636
|
+
// src/normalizers/reward.ts
|
|
35637
|
+
function RewardScoreRequestFromFrontToApi(model) {
|
|
35638
|
+
const dto = { sort: model.sort };
|
|
35639
|
+
if (model.constraints !== void 0) dto.constraints = model.constraints;
|
|
35640
|
+
if (model.maxInstances !== void 0) dto.max_instances = model.maxInstances;
|
|
35641
|
+
if (model.negativeIds !== void 0) dto.negative_ids = model.negativeIds;
|
|
35642
|
+
if (model.objective !== void 0) dto.objective = model.objective;
|
|
35643
|
+
if (model.positiveIds !== void 0) dto.positive_ids = model.positiveIds;
|
|
35644
|
+
if (model.targetSort !== void 0) dto.target_sort = model.targetSort;
|
|
35645
|
+
return dto;
|
|
35646
|
+
}
|
|
35647
|
+
function RewardScoreResponseFromApiToFront(dto) {
|
|
35648
|
+
const out = {
|
|
35649
|
+
certifiedNonEmpty: dto.certified_non_empty,
|
|
35650
|
+
estimatedExtent: dto.estimated_extent,
|
|
35651
|
+
reward: dto.reward
|
|
35652
|
+
};
|
|
35653
|
+
if (dto.covers_negative != null) out.coversNegative = dto.covers_negative;
|
|
35654
|
+
if (dto.covers_positive != null) out.coversPositive = dto.covers_positive;
|
|
35655
|
+
if (dto.precision != null) out.precision = dto.precision;
|
|
35656
|
+
if (dto.recall != null) out.recall = dto.recall;
|
|
35657
|
+
return out;
|
|
35658
|
+
}
|
|
35659
|
+
|
|
35660
|
+
// src/resources/reward.ts
|
|
35661
|
+
var RewardClient = class {
|
|
35662
|
+
/** @internal */
|
|
35663
|
+
api;
|
|
35664
|
+
/** @internal */
|
|
35665
|
+
constructor(api) {
|
|
35666
|
+
this.api = api;
|
|
35667
|
+
}
|
|
35668
|
+
/**
|
|
35669
|
+
* Score a candidate query execution-free for the authenticated tenant.
|
|
35670
|
+
*
|
|
35671
|
+
* @param request - The query spec (sort, objective, optional
|
|
35672
|
+
* constraints / instance ids).
|
|
35673
|
+
* @returns A sound reward signal plus the certificate and coverage
|
|
35674
|
+
* breakdown.
|
|
35675
|
+
*
|
|
35676
|
+
* @throws {ApiError} `404` if the sort name is unknown to the lattice.
|
|
35677
|
+
*/
|
|
35678
|
+
async score(request) {
|
|
35679
|
+
const response = await this.api.score(RewardScoreRequestFromFrontToApi(request));
|
|
35680
|
+
return RewardScoreResponseFromApiToFront(response.data);
|
|
35681
|
+
}
|
|
35682
|
+
};
|
|
35683
|
+
|
|
35684
|
+
// src/normalizers/translation.ts
|
|
35685
|
+
function TranslateRequestFromFrontToApi(model) {
|
|
35686
|
+
const dto = {
|
|
35687
|
+
target_lang: model.targetLang,
|
|
35688
|
+
text: model.text
|
|
35689
|
+
};
|
|
35690
|
+
if (model.sourceLang !== void 0) dto.source_lang = model.sourceLang;
|
|
35691
|
+
return dto;
|
|
35692
|
+
}
|
|
35693
|
+
function TranslateResponseFromApiToFront(dto) {
|
|
35694
|
+
const out = {
|
|
35695
|
+
targetLang: dto.target_lang,
|
|
35696
|
+
translatedText: dto.translated_text
|
|
35697
|
+
};
|
|
35698
|
+
if (dto.model !== void 0) out.model = dto.model;
|
|
35699
|
+
return out;
|
|
35700
|
+
}
|
|
35701
|
+
|
|
35702
|
+
// src/resources/translation.ts
|
|
35703
|
+
var TranslationClient = class {
|
|
35704
|
+
/** @internal */
|
|
35705
|
+
api;
|
|
35706
|
+
/** @internal */
|
|
35707
|
+
constructor(api) {
|
|
35708
|
+
this.api = api;
|
|
35709
|
+
}
|
|
35710
|
+
/**
|
|
35711
|
+
* Translate text into a target language.
|
|
35712
|
+
*
|
|
35713
|
+
* @param request - Source text, target language, and an optional
|
|
35714
|
+
* source-language hint.
|
|
35715
|
+
* @returns The translated text plus the echoed target language and
|
|
35716
|
+
* the model label, when known.
|
|
35717
|
+
*/
|
|
35718
|
+
async translate(request) {
|
|
35719
|
+
const response = await this.api.translate(TranslateRequestFromFrontToApi(request));
|
|
35720
|
+
return TranslateResponseFromApiToFront(response.data);
|
|
35721
|
+
}
|
|
35722
|
+
};
|
|
35723
|
+
|
|
35724
|
+
// src/normalizers/streaming.ts
|
|
35725
|
+
function SketchDimensionsFromFrontToApi(model) {
|
|
35726
|
+
const dto = {};
|
|
35727
|
+
if (model.delta !== void 0) dto.delta = model.delta;
|
|
35728
|
+
if (model.depth !== void 0) dto.depth = model.depth;
|
|
35729
|
+
if (model.epsilon !== void 0) dto.epsilon = model.epsilon;
|
|
35730
|
+
if (model.width !== void 0) dto.width = model.width;
|
|
35731
|
+
return dto;
|
|
35732
|
+
}
|
|
35733
|
+
function FrequencyEstimateFromApiToFront(dto) {
|
|
35734
|
+
return {
|
|
35735
|
+
estimatedCount: dto.estimated_count,
|
|
35736
|
+
key: dto.key
|
|
35737
|
+
};
|
|
35738
|
+
}
|
|
35739
|
+
function FrequencyRequestFromFrontToApi(model) {
|
|
35740
|
+
return {
|
|
35741
|
+
dimensions: SketchDimensionsFromFrontToApi(model.dimensions),
|
|
35742
|
+
items: model.items,
|
|
35743
|
+
query_keys: model.queryKeys
|
|
35744
|
+
};
|
|
35745
|
+
}
|
|
35746
|
+
function FrequencyResponseFromApiToFront(dto) {
|
|
35747
|
+
return {
|
|
35748
|
+
depth: dto.depth,
|
|
35749
|
+
estimates: dto.estimates.map(FrequencyEstimateFromApiToFront),
|
|
35750
|
+
width: dto.width
|
|
35751
|
+
};
|
|
35752
|
+
}
|
|
35753
|
+
function HeavyHitterItemFromApiToFront(dto) {
|
|
35754
|
+
return {
|
|
35755
|
+
count: dto.count,
|
|
35756
|
+
item: dto.item
|
|
35757
|
+
};
|
|
35758
|
+
}
|
|
35759
|
+
function HeavyHittersRequestFromFrontToApi(model) {
|
|
35760
|
+
return {
|
|
35761
|
+
capacity: model.capacity,
|
|
35762
|
+
items: model.items
|
|
35763
|
+
};
|
|
35764
|
+
}
|
|
35765
|
+
function HeavyHittersResponseFromApiToFront(dto) {
|
|
35766
|
+
return {
|
|
35767
|
+
capacity: dto.capacity,
|
|
35768
|
+
heavyHitters: dto.heavy_hitters.map(HeavyHitterItemFromApiToFront),
|
|
35769
|
+
maxUndercount: dto.max_undercount,
|
|
35770
|
+
total: dto.total
|
|
35771
|
+
};
|
|
35772
|
+
}
|
|
35773
|
+
function BloomFilterStatsFromApiToFront(dto) {
|
|
35774
|
+
return {
|
|
35775
|
+
bitCount: dto.bit_count,
|
|
35776
|
+
estimatedLoad: dto.estimated_load,
|
|
35777
|
+
hashCount: dto.hash_count,
|
|
35778
|
+
insertions: dto.insertions,
|
|
35779
|
+
setBits: dto.set_bits
|
|
35780
|
+
};
|
|
35781
|
+
}
|
|
35782
|
+
function MembershipRequestFromFrontToApi(model) {
|
|
35783
|
+
return {
|
|
35784
|
+
bit_count: model.bitCount,
|
|
35785
|
+
hash_count: model.hashCount,
|
|
35786
|
+
insert_items: model.insertItems,
|
|
35787
|
+
test_items: model.testItems
|
|
35788
|
+
};
|
|
35789
|
+
}
|
|
35790
|
+
function MembershipResultFromApiToFront(dto) {
|
|
35791
|
+
return {
|
|
35792
|
+
item: dto.item,
|
|
35793
|
+
member: dto.member
|
|
35794
|
+
};
|
|
35795
|
+
}
|
|
35796
|
+
function MembershipResponseFromApiToFront(dto) {
|
|
35797
|
+
return {
|
|
35798
|
+
filterStats: BloomFilterStatsFromApiToFront(dto.filter_stats),
|
|
35799
|
+
membership: dto.membership.map(MembershipResultFromApiToFront)
|
|
35800
|
+
};
|
|
35801
|
+
}
|
|
35802
|
+
|
|
35803
|
+
// src/resources/streaming.ts
|
|
35804
|
+
var StreamingClient = class {
|
|
35805
|
+
/** @internal */
|
|
35806
|
+
api;
|
|
35807
|
+
/** @internal */
|
|
35808
|
+
constructor(api) {
|
|
35809
|
+
this.api = api;
|
|
35810
|
+
}
|
|
35811
|
+
/**
|
|
35812
|
+
* Estimate the frequency of each query key via a Count-Min sketch.
|
|
35813
|
+
*
|
|
35814
|
+
* @param request - The sketch dimensions, the stream `items`, and the
|
|
35815
|
+
* `queryKeys` to estimate.
|
|
35816
|
+
* @returns The sketch dimensions actually used and one estimate per
|
|
35817
|
+
* query key, in request order.
|
|
35818
|
+
*
|
|
35819
|
+
* @throws {ApiError} `400` if `items`/`queryKeys` exceed their limits
|
|
35820
|
+
* or the sketch dimensions are invalid.
|
|
35821
|
+
*/
|
|
35822
|
+
async frequency(request) {
|
|
35823
|
+
const response = await this.api.frequency(FrequencyRequestFromFrontToApi(request));
|
|
35824
|
+
return FrequencyResponseFromApiToFront(response.data);
|
|
35825
|
+
}
|
|
35826
|
+
/**
|
|
35827
|
+
* Find candidate heavy hitters via a Misra-Gries sketch.
|
|
35828
|
+
*
|
|
35829
|
+
* @param request - The counter `capacity` and the stream `items`.
|
|
35830
|
+
* @returns Candidate heavy hitters sorted by count descending, plus
|
|
35831
|
+
* the worst-case under-count bound.
|
|
35832
|
+
*
|
|
35833
|
+
* @throws {ApiError} `400` if `capacity < 1` or `items` exceeds the limit.
|
|
35834
|
+
*/
|
|
35835
|
+
async heavyHitters(request) {
|
|
35836
|
+
const response = await this.api.heavyHitters(HeavyHittersRequestFromFrontToApi(request));
|
|
35837
|
+
return HeavyHittersResponseFromApiToFront(response.data);
|
|
35838
|
+
}
|
|
35839
|
+
/**
|
|
35840
|
+
* Test membership of items in a Bloom filter built from `insertItems`.
|
|
35841
|
+
*
|
|
35842
|
+
* @param request - The `bitCount`, `hashCount`, `insertItems`, and
|
|
35843
|
+
* `testItems`.
|
|
35844
|
+
* @returns Filter load statistics and one membership verdict per test
|
|
35845
|
+
* item, in request order. Zero false negatives.
|
|
35846
|
+
*
|
|
35847
|
+
* @throws {ApiError} `400` if `bitCount`/`hashCount < 1` or the item
|
|
35848
|
+
* arrays exceed their limits.
|
|
35849
|
+
*/
|
|
35850
|
+
async membership(request) {
|
|
35851
|
+
const response = await this.api.membership(MembershipRequestFromFrontToApi(request));
|
|
35852
|
+
return MembershipResponseFromApiToFront(response.data);
|
|
35853
|
+
}
|
|
35854
|
+
};
|
|
35855
|
+
|
|
35856
|
+
// src/normalizers/conformal.ts
|
|
35857
|
+
function CalibrationSampleFromFrontToApi(model) {
|
|
35858
|
+
return {
|
|
35859
|
+
class_scores: model.classScores,
|
|
35860
|
+
input_id: model.inputId,
|
|
35861
|
+
true_label: model.trueLabel
|
|
35862
|
+
};
|
|
35863
|
+
}
|
|
35864
|
+
function TestInputFromFrontToApi(model) {
|
|
35865
|
+
return {
|
|
35866
|
+
class_scores: model.classScores,
|
|
35867
|
+
input_id: model.inputId
|
|
35868
|
+
};
|
|
35869
|
+
}
|
|
35870
|
+
function ConformalCalibrateRequestFromFrontToApi(model) {
|
|
35871
|
+
return {
|
|
35872
|
+
alpha: model.alpha,
|
|
35873
|
+
samples: model.samples.map(CalibrationSampleFromFrontToApi)
|
|
35874
|
+
};
|
|
35875
|
+
}
|
|
35876
|
+
function ConformalCalibrateResponseFromApiToFront(dto) {
|
|
35877
|
+
return {
|
|
35878
|
+
algorithm: dto.algorithm,
|
|
35879
|
+
alpha: dto.alpha,
|
|
35880
|
+
empiricalCoverage: dto.empirical_coverage,
|
|
35881
|
+
meetsTargetCoverage: dto.meets_target_coverage,
|
|
35882
|
+
nSamples: dto.n_samples,
|
|
35883
|
+
quantileRank: dto.quantile_rank,
|
|
35884
|
+
threshold: dto.threshold
|
|
35885
|
+
};
|
|
35886
|
+
}
|
|
35887
|
+
function ConformalPredictRequestFromFrontToApi(model) {
|
|
35888
|
+
return {
|
|
35889
|
+
alpha: model.alpha,
|
|
35890
|
+
n_calibration_samples: model.nCalibrationSamples,
|
|
35891
|
+
test_inputs: model.testInputs.map(TestInputFromFrontToApi),
|
|
35892
|
+
threshold: model.threshold
|
|
35893
|
+
};
|
|
35894
|
+
}
|
|
35895
|
+
function CoverageCertificateFromApiToFront(dto) {
|
|
35896
|
+
return {
|
|
35897
|
+
algorithm: dto.algorithm,
|
|
35898
|
+
alpha: dto.alpha,
|
|
35899
|
+
nCalibrationSamples: dto.n_calibration_samples,
|
|
35900
|
+
nominalCoverage: dto.nominal_coverage,
|
|
35901
|
+
threshold: dto.threshold
|
|
35902
|
+
};
|
|
35903
|
+
}
|
|
35904
|
+
function ConformalPredictionFromApiToFront(dto) {
|
|
35905
|
+
return {
|
|
35906
|
+
abstains: dto.abstains,
|
|
35907
|
+
inputId: dto.input_id,
|
|
35908
|
+
predictionSet: dto.prediction_set,
|
|
35909
|
+
topClass: dto.top_class,
|
|
35910
|
+
topClassNonConformity: dto.top_class_non_conformity
|
|
35911
|
+
};
|
|
35912
|
+
}
|
|
35913
|
+
function ConformalPredictResponseFromApiToFront(dto) {
|
|
35914
|
+
return {
|
|
35915
|
+
coverageCertificate: CoverageCertificateFromApiToFront(dto.coverage_certificate),
|
|
35916
|
+
predictions: dto.predictions.map(ConformalPredictionFromApiToFront)
|
|
35917
|
+
};
|
|
35918
|
+
}
|
|
35919
|
+
|
|
35920
|
+
// src/resources/conformal.ts
|
|
35921
|
+
var ConformalClient = class {
|
|
35922
|
+
/** @internal */
|
|
35923
|
+
api;
|
|
35924
|
+
/** @internal */
|
|
35925
|
+
constructor(api) {
|
|
35926
|
+
this.api = api;
|
|
35927
|
+
}
|
|
35928
|
+
/**
|
|
35929
|
+
* Compute a split-conformal non-conformity threshold from a labeled
|
|
35930
|
+
* calibration set.
|
|
35931
|
+
*
|
|
35932
|
+
* @param request - The calibration set (samples + target miscoverage
|
|
35933
|
+
* `α`).
|
|
35934
|
+
* @returns The computed threshold `τ` plus a coverage certificate and
|
|
35935
|
+
* sanity-check coverage stats.
|
|
35936
|
+
*
|
|
35937
|
+
* @throws {ApiError} `400` if `alpha` is outside `(0, 1)` or the
|
|
35938
|
+
* calibration set is empty.
|
|
35939
|
+
*/
|
|
35940
|
+
async calibrate(request) {
|
|
35941
|
+
const response = await this.api.calibrate(ConformalCalibrateRequestFromFrontToApi(request));
|
|
35942
|
+
return ConformalCalibrateResponseFromApiToFront(response.data);
|
|
35943
|
+
}
|
|
35944
|
+
/**
|
|
35945
|
+
* Apply a pre-computed conformal threshold to unlabeled test inputs
|
|
35946
|
+
* and return prediction sets with coverage certificates.
|
|
35947
|
+
*
|
|
35948
|
+
* @param request - The threshold `τ`, calibration `α` and sample count
|
|
35949
|
+
* (from a prior `calibrate` call), and the test inputs to predict
|
|
35950
|
+
* for.
|
|
35951
|
+
* @returns Per-input conformal prediction results plus a coverage
|
|
35952
|
+
* certificate, in request order.
|
|
35953
|
+
*
|
|
35954
|
+
* @throws {ApiError} `400` if the test-input count exceeds 10 000.
|
|
35955
|
+
*/
|
|
35956
|
+
async predict(request) {
|
|
35957
|
+
const response = await this.api.predict(ConformalPredictRequestFromFrontToApi(request));
|
|
35958
|
+
return ConformalPredictResponseFromApiToFront(response.data);
|
|
35959
|
+
}
|
|
35960
|
+
};
|
|
35961
|
+
|
|
35962
|
+
// src/normalizers/vision.ts
|
|
35963
|
+
function EncoderConfigOverridesFromFrontToApi(model) {
|
|
35964
|
+
const dto = {};
|
|
35965
|
+
if (model.numFrames !== void 0) dto.num_frames = model.numFrames;
|
|
35966
|
+
if (model.patchSize !== void 0) dto.patch_size = model.patchSize;
|
|
35967
|
+
if (model.sessionId !== void 0) dto.session_id = model.sessionId;
|
|
35968
|
+
if (model.targetHeight !== void 0) dto.target_height = model.targetHeight;
|
|
35969
|
+
if (model.targetWidth !== void 0) dto.target_width = model.targetWidth;
|
|
35970
|
+
return dto;
|
|
35971
|
+
}
|
|
35972
|
+
function FrameSummaryFromApiToFront(dto) {
|
|
35973
|
+
return {
|
|
35974
|
+
frameIndex: dto.frame_index,
|
|
35975
|
+
numPredictedObjects: dto.num_predicted_objects,
|
|
35976
|
+
numResiduatedFeatures: dto.num_residuated_features,
|
|
35977
|
+
objectLabels: dto.object_labels
|
|
35978
|
+
};
|
|
35979
|
+
}
|
|
35980
|
+
function EncodeClipRequestFromFrontToApi(model) {
|
|
35981
|
+
const dto = {
|
|
35982
|
+
clip_id: model.clipId,
|
|
35983
|
+
video_b64: model.videoB64
|
|
35984
|
+
};
|
|
35985
|
+
if (model.configOverrides !== void 0) {
|
|
35986
|
+
dto.config_overrides = model.configOverrides === null ? null : EncoderConfigOverridesFromFrontToApi(model.configOverrides);
|
|
35987
|
+
}
|
|
35988
|
+
if (model.fps !== void 0) dto.fps = model.fps;
|
|
35989
|
+
if (model.sourceUri !== void 0) dto.source_uri = model.sourceUri;
|
|
35990
|
+
return dto;
|
|
35991
|
+
}
|
|
35992
|
+
function EncodeClipResponseFromApiToFront(dto) {
|
|
35993
|
+
const out = {
|
|
35994
|
+
clipId: dto.clip_id,
|
|
35995
|
+
embeddingDim: dto.embedding_dim,
|
|
35996
|
+
encodeElapsedMs: dto.encode_elapsed_ms,
|
|
35997
|
+
frames: dto.frames.map(FrameSummaryFromApiToFront),
|
|
35998
|
+
modelId: dto.model_id,
|
|
35999
|
+
numInputFrames: dto.num_input_frames,
|
|
36000
|
+
paddedFrameIndices: dto.padded_frame_indices,
|
|
36001
|
+
totalObjects: dto.total_objects,
|
|
36002
|
+
totalResiduatedFeatures: dto.total_residuated_features
|
|
36003
|
+
};
|
|
36004
|
+
if (dto.model_version != null) out.modelVersion = dto.model_version;
|
|
36005
|
+
return out;
|
|
36006
|
+
}
|
|
36007
|
+
|
|
36008
|
+
// src/resources/vision.ts
|
|
36009
|
+
var VisionClient = class {
|
|
36010
|
+
/** @internal */
|
|
36011
|
+
api;
|
|
36012
|
+
/** @internal */
|
|
36013
|
+
constructor(api) {
|
|
36014
|
+
this.api = api;
|
|
36015
|
+
}
|
|
36016
|
+
/**
|
|
36017
|
+
* Encode a video clip end-to-end and return per-frame predictions.
|
|
36018
|
+
*
|
|
36019
|
+
* @param request - The clip spec (base64 video, clip id, optional
|
|
36020
|
+
* config overrides / fps / source uri).
|
|
36021
|
+
* @returns The embedding plus per-frame Ψ-term prediction summaries.
|
|
36022
|
+
*
|
|
36023
|
+
* @throws {ApiError} `503` if no V-JEPA perception service is mounted.
|
|
36024
|
+
*/
|
|
36025
|
+
async encodeClip(request) {
|
|
36026
|
+
const response = await this.api.encodeClip(EncodeClipRequestFromFrontToApi(request));
|
|
36027
|
+
return EncodeClipResponseFromApiToFront(response.data);
|
|
36028
|
+
}
|
|
36029
|
+
};
|
|
36030
|
+
|
|
36031
|
+
// src/normalizers/anonymization.ts
|
|
36032
|
+
function quasiIdentifierFromFrontToApi(q) {
|
|
36033
|
+
switch (q.type) {
|
|
36034
|
+
case "numeric":
|
|
36035
|
+
return { type: "numeric", precision: q.precision };
|
|
36036
|
+
case "string":
|
|
36037
|
+
return { type: "string", prefix_length: q.prefixLength };
|
|
36038
|
+
case "categorical":
|
|
36039
|
+
return { type: "categorical" };
|
|
36040
|
+
case "hierarchical":
|
|
36041
|
+
return { type: "hierarchical", hierarchy: q.hierarchy };
|
|
36042
|
+
case "date":
|
|
36043
|
+
return { type: "date", granularity: q.granularity };
|
|
36044
|
+
}
|
|
36045
|
+
}
|
|
36046
|
+
function anonymizationModeFromFrontToApi(mode) {
|
|
36047
|
+
if (mode.type === "k_anonymity") {
|
|
36048
|
+
const quasiIdentifiers = {};
|
|
36049
|
+
for (const [field, q] of Object.entries(mode.quasiIdentifiers)) {
|
|
36050
|
+
quasiIdentifiers[field] = quasiIdentifierFromFrontToApi(q);
|
|
36051
|
+
}
|
|
36052
|
+
return { type: "k_anonymity", k: mode.k, quasi_identifiers: quasiIdentifiers };
|
|
36053
|
+
}
|
|
36054
|
+
if (mode.fieldIdentifiers !== void 0) {
|
|
36055
|
+
return {
|
|
36056
|
+
type: "safe_harbor",
|
|
36057
|
+
field_identifiers: mode.fieldIdentifiers
|
|
36058
|
+
};
|
|
36059
|
+
}
|
|
36060
|
+
return { type: "safe_harbor" };
|
|
36061
|
+
}
|
|
36062
|
+
function AnonymizeRequestFromFrontToApi(model) {
|
|
36063
|
+
const dto = {
|
|
36064
|
+
records: model.records,
|
|
36065
|
+
mode: anonymizationModeFromFrontToApi(model.mode)
|
|
36066
|
+
};
|
|
36067
|
+
if (model.enforcement !== void 0) dto.enforcement = model.enforcement;
|
|
36068
|
+
return dto;
|
|
36069
|
+
}
|
|
36070
|
+
function kAnonymityViolationFromApiToFront(wire) {
|
|
36071
|
+
return {
|
|
36072
|
+
quasiValues: wire.quasi_values,
|
|
36073
|
+
count: wire.count,
|
|
36074
|
+
requiredK: wire.required_k,
|
|
36075
|
+
suggestion: wire.suggestion
|
|
36076
|
+
};
|
|
36077
|
+
}
|
|
36078
|
+
function equivalenceClassFromApiToFront(wire) {
|
|
36079
|
+
return {
|
|
36080
|
+
quasiValues: wire.quasi_values,
|
|
36081
|
+
count: wire.count,
|
|
36082
|
+
recordIndices: wire.record_indices
|
|
36083
|
+
};
|
|
36084
|
+
}
|
|
36085
|
+
function kAnonymityResultFromApiToFront(wire) {
|
|
36086
|
+
return {
|
|
36087
|
+
isKAnonymous: wire.is_k_anonymous,
|
|
36088
|
+
k: wire.k,
|
|
36089
|
+
totalRecords: wire.total_records,
|
|
36090
|
+
equivalenceClassCount: wire.equivalence_class_count,
|
|
36091
|
+
violations: wire.violations.map(kAnonymityViolationFromApiToFront),
|
|
36092
|
+
equivalenceClasses: wire.equivalence_classes.map(equivalenceClassFromApiToFront),
|
|
36093
|
+
minClassSize: wire.min_class_size,
|
|
36094
|
+
maxClassSize: wire.max_class_size,
|
|
36095
|
+
avgClassSize: wire.avg_class_size,
|
|
36096
|
+
checkedAt: wire.checked_at
|
|
36097
|
+
};
|
|
36098
|
+
}
|
|
36099
|
+
function recordSafeHarborStatusFromApiToFront(dto) {
|
|
36100
|
+
return {
|
|
36101
|
+
recordIndex: dto.record_index,
|
|
36102
|
+
wasCompliant: dto.was_compliant,
|
|
36103
|
+
suppressedFields: dto.suppressed_fields,
|
|
36104
|
+
violationCount: dto.violation_count
|
|
36105
|
+
};
|
|
36106
|
+
}
|
|
36107
|
+
function safeHarborSummaryFromApiToFront(dto) {
|
|
36108
|
+
return {
|
|
36109
|
+
compliantCount: dto.compliant_count,
|
|
36110
|
+
deIdentifiedCount: dto.de_identified_count,
|
|
36111
|
+
perRecord: dto.per_record.map(recordSafeHarborStatusFromApiToFront)
|
|
36112
|
+
};
|
|
36113
|
+
}
|
|
36114
|
+
function AnonymizeResponseFromApiToFront(dto) {
|
|
36115
|
+
const out = {
|
|
36116
|
+
outputRecords: dto.output_records,
|
|
36117
|
+
suppressedIndices: dto.suppressed_indices,
|
|
36118
|
+
suppressedCount: dto.suppressed_count
|
|
36119
|
+
};
|
|
36120
|
+
if (dto.k_anonymity_result != null) {
|
|
36121
|
+
out.kAnonymityResult = kAnonymityResultFromApiToFront(
|
|
36122
|
+
dto.k_anonymity_result
|
|
36123
|
+
);
|
|
36124
|
+
}
|
|
36125
|
+
if (dto.safe_harbor_summary != null) {
|
|
36126
|
+
out.safeHarborSummary = safeHarborSummaryFromApiToFront(dto.safe_harbor_summary);
|
|
36127
|
+
}
|
|
36128
|
+
return out;
|
|
36129
|
+
}
|
|
36130
|
+
|
|
36131
|
+
// src/resources/anonymization.ts
|
|
36132
|
+
var AnonymizationClient = class {
|
|
36133
|
+
/** @internal */
|
|
36134
|
+
api;
|
|
36135
|
+
/** @internal */
|
|
36136
|
+
constructor(api) {
|
|
36137
|
+
this.api = api;
|
|
36138
|
+
}
|
|
36139
|
+
/**
|
|
36140
|
+
* Batch-anonymize a set of records using k-anonymity or HIPAA Safe Harbor.
|
|
36141
|
+
*
|
|
36142
|
+
* @param request - The record batch, the anonymization mode + params, and
|
|
36143
|
+
* an optional enforcement strategy (defaults to `suppress`).
|
|
36144
|
+
* @returns The processed records plus a full compliance report
|
|
36145
|
+
* (k-anonymity analysis or Safe Harbor summary).
|
|
36146
|
+
*
|
|
36147
|
+
* @throws {ApiError} `400` on an empty batch, > 10 000 records, or an
|
|
36148
|
+
* invalid anonymization mode.
|
|
36149
|
+
*
|
|
36150
|
+
* @example
|
|
36151
|
+
* ```typescript
|
|
36152
|
+
* const result = await client.anonymization.anonymize({
|
|
36153
|
+
* records: [{ name: 'Alice', age: '42', zip: '12345' }],
|
|
36154
|
+
* mode: {
|
|
36155
|
+
* type: 'k_anonymity',
|
|
36156
|
+
* k: 5,
|
|
36157
|
+
* quasiIdentifiers: { age: { type: 'numeric', precision: 10 } },
|
|
36158
|
+
* },
|
|
36159
|
+
* });
|
|
36160
|
+
* console.log(result.kAnonymityResult?.isKAnonymous);
|
|
36161
|
+
* ```
|
|
36162
|
+
*/
|
|
36163
|
+
async anonymize(request) {
|
|
36164
|
+
const response = await this.api.anonymizeRecords(AnonymizeRequestFromFrontToApi(request), {
|
|
36165
|
+
headers: { [RAW_BODY_HEADER]: "1" }
|
|
36166
|
+
});
|
|
36167
|
+
return AnonymizeResponseFromApiToFront(response.data);
|
|
36168
|
+
}
|
|
36169
|
+
};
|
|
36170
|
+
|
|
36171
|
+
// src/normalizers/speakers.ts
|
|
36172
|
+
function EnrollSpeakerRequestFromFrontToApi(model) {
|
|
36173
|
+
const dto = { audio: model.audio, name: model.name };
|
|
36174
|
+
if (model.audioMime !== void 0) dto.audio_mime = model.audioMime;
|
|
36175
|
+
return dto;
|
|
36176
|
+
}
|
|
36177
|
+
function EnrollSpeakerResponseFromApiToFront(dto) {
|
|
36178
|
+
return {
|
|
36179
|
+
dim: dto.dim,
|
|
36180
|
+
id: dto.id,
|
|
36181
|
+
name: dto.name,
|
|
36182
|
+
sampleSecs: dto.sample_secs
|
|
36183
|
+
};
|
|
36184
|
+
}
|
|
36185
|
+
function SpeakerProfileFromApiToFront(dto) {
|
|
36186
|
+
return {
|
|
36187
|
+
createdAt: dto.created_at,
|
|
36188
|
+
id: dto.id,
|
|
36189
|
+
name: dto.name,
|
|
36190
|
+
sampleSecs: dto.sample_secs
|
|
36191
|
+
};
|
|
36192
|
+
}
|
|
36193
|
+
function ListSpeakersResponseFromApiToFront(dto) {
|
|
36194
|
+
return { speakers: dto.speakers.map(SpeakerProfileFromApiToFront) };
|
|
36195
|
+
}
|
|
36196
|
+
|
|
36197
|
+
// src/resources/speakers.ts
|
|
36198
|
+
var SpeakersClient = class {
|
|
36199
|
+
/** @internal */
|
|
36200
|
+
api;
|
|
36201
|
+
/** @internal */
|
|
36202
|
+
constructor(api) {
|
|
36203
|
+
this.api = api;
|
|
36204
|
+
}
|
|
36205
|
+
/**
|
|
36206
|
+
* Enroll (or re-enroll) a speaker voiceprint for the authenticated tenant.
|
|
36207
|
+
*
|
|
36208
|
+
* @remarks
|
|
36209
|
+
* Request body uses plain JSON keys (`audio`, `audio_mime`, `name`) with no
|
|
36210
|
+
* user-keyed maps and no case-sensitive enum values, so the default bridge
|
|
36211
|
+
* snake_casing is correct.
|
|
36212
|
+
*
|
|
36213
|
+
* @param request - The base64 audio sample, optional MIME hint, and name.
|
|
36214
|
+
* @returns The embedding dimensionality, stable profile id, name, and
|
|
36215
|
+
* seconds of speech embedded.
|
|
36216
|
+
*
|
|
36217
|
+
* @throws {ApiError} On a non-2xx response (e.g. malformed audio).
|
|
36218
|
+
*/
|
|
36219
|
+
async enrollSpeaker(request) {
|
|
36220
|
+
const response = await this.api.enrollSpeaker(EnrollSpeakerRequestFromFrontToApi(request));
|
|
36221
|
+
return EnrollSpeakerResponseFromApiToFront(response.data);
|
|
36222
|
+
}
|
|
36223
|
+
/**
|
|
36224
|
+
* List the tenant's enrolled speaker profiles (embeddings withheld).
|
|
36225
|
+
*
|
|
36226
|
+
* @returns The stored speaker profiles for the authenticated tenant.
|
|
36227
|
+
*
|
|
36228
|
+
* @throws {ApiError} On a non-2xx response.
|
|
36229
|
+
*/
|
|
36230
|
+
async listSpeakers() {
|
|
36231
|
+
const response = await this.api.listSpeakers();
|
|
36232
|
+
return ListSpeakersResponseFromApiToFront(response.data);
|
|
36233
|
+
}
|
|
36234
|
+
/**
|
|
36235
|
+
* Delete a speaker profile by id.
|
|
36236
|
+
*
|
|
36237
|
+
* @param request - The stable profile (term) id of the speaker to delete.
|
|
36238
|
+
*
|
|
36239
|
+
* @throws {ApiError} `404` if no profile exists for the given id.
|
|
36240
|
+
*/
|
|
36241
|
+
async deleteSpeaker(request) {
|
|
36242
|
+
await this.api.deleteSpeaker(request.id);
|
|
36243
|
+
}
|
|
36244
|
+
};
|
|
36245
|
+
|
|
36246
|
+
// src/normalizers/speech.ts
|
|
36247
|
+
function VoiceConsentFromFrontToApi(model) {
|
|
36248
|
+
const dto = {
|
|
36249
|
+
granted_by: model.grantedBy,
|
|
36250
|
+
method: model.method
|
|
36251
|
+
};
|
|
36252
|
+
if (model.reference !== void 0) dto.reference = model.reference;
|
|
36253
|
+
return dto;
|
|
36254
|
+
}
|
|
36255
|
+
function VoiceConsentFromApiToFront(dto) {
|
|
36256
|
+
const out = {
|
|
36257
|
+
grantedBy: dto.granted_by,
|
|
36258
|
+
method: dto.method
|
|
36259
|
+
};
|
|
36260
|
+
if (dto.reference != null) out.reference = dto.reference;
|
|
36261
|
+
return out;
|
|
36262
|
+
}
|
|
36263
|
+
function VoiceProfileFromApiToFront(dto) {
|
|
36264
|
+
return {
|
|
36265
|
+
consent: VoiceConsentFromApiToFront(dto.consent),
|
|
36266
|
+
createdAt: dto.created_at,
|
|
36267
|
+
engine: dto.engine,
|
|
36268
|
+
hasIcl: dto.has_icl,
|
|
36269
|
+
id: dto.id,
|
|
36270
|
+
name: dto.name,
|
|
36271
|
+
sampleSecs: dto.sample_secs
|
|
36272
|
+
};
|
|
36273
|
+
}
|
|
36274
|
+
function SpeechEngineFromApiToFront(dto) {
|
|
36275
|
+
const out = {
|
|
36276
|
+
available: dto.available,
|
|
36277
|
+
engine: dto.engine,
|
|
36278
|
+
presetSpeakers: dto.preset_speakers,
|
|
36279
|
+
supportsCloning: dto.supports_cloning
|
|
36280
|
+
};
|
|
36281
|
+
if (dto.reason != null) out.reason = dto.reason;
|
|
36282
|
+
return out;
|
|
36283
|
+
}
|
|
36284
|
+
function EnrollVoiceRequestFromFrontToApi(model) {
|
|
36285
|
+
const dto = {
|
|
36286
|
+
audio: model.audio,
|
|
36287
|
+
consent: VoiceConsentFromFrontToApi(model.consent),
|
|
36288
|
+
name: model.name
|
|
36289
|
+
};
|
|
36290
|
+
if (model.audioMime !== void 0) dto.audio_mime = model.audioMime;
|
|
36291
|
+
if (model.engine !== void 0) dto.engine = model.engine;
|
|
36292
|
+
if (model.transcript !== void 0) dto.transcript = model.transcript;
|
|
36293
|
+
return dto;
|
|
36294
|
+
}
|
|
36295
|
+
function ListEnginesResponseFromApiToFront(dto) {
|
|
36296
|
+
return {
|
|
36297
|
+
engines: dto.engines.map(SpeechEngineFromApiToFront)
|
|
36298
|
+
};
|
|
36299
|
+
}
|
|
36300
|
+
function ListVoicesResponseFromApiToFront(dto) {
|
|
36301
|
+
return {
|
|
36302
|
+
presets: dto.presets,
|
|
36303
|
+
voices: dto.voices.map(VoiceProfileFromApiToFront)
|
|
36304
|
+
};
|
|
36305
|
+
}
|
|
36306
|
+
function OpenSpeechSessionRequestFromFrontToApi(model) {
|
|
36307
|
+
const dto = {};
|
|
36308
|
+
if (model.conversationId !== void 0) dto.conversation_id = model.conversationId;
|
|
36309
|
+
if (model.engine !== void 0) dto.engine = model.engine;
|
|
36310
|
+
if (model.language !== void 0) dto.language = model.language;
|
|
36311
|
+
if (model.voiceId !== void 0) dto.voice_id = model.voiceId;
|
|
36312
|
+
return dto;
|
|
36313
|
+
}
|
|
36314
|
+
function OpenSpeechSessionResponseFromApiToFront(dto) {
|
|
36315
|
+
return {
|
|
36316
|
+
engine: dto.engine,
|
|
36317
|
+
fullDuplex: dto.full_duplex,
|
|
36318
|
+
inputSampleRate: dto.input_sample_rate,
|
|
36319
|
+
sessionId: dto.session_id,
|
|
36320
|
+
wsUrl: dto.ws_url
|
|
36321
|
+
};
|
|
36322
|
+
}
|
|
36323
|
+
function SynthesizeSpeechRequestFromFrontToApi(model) {
|
|
36324
|
+
const dto = { text: model.text };
|
|
36325
|
+
if (model.refAudioBase64 !== void 0) dto.ref_audio_base64 = model.refAudioBase64;
|
|
36326
|
+
if (model.description !== void 0) dto.description = model.description;
|
|
36327
|
+
if (model.engine !== void 0) dto.engine = model.engine;
|
|
36328
|
+
if (model.format !== void 0) dto.format = model.format;
|
|
36329
|
+
if (model.instruction !== void 0) dto.instruction = model.instruction;
|
|
36330
|
+
if (model.language !== void 0) dto.language = model.language;
|
|
36331
|
+
if (model.maxDurationS !== void 0) dto.max_duration_s = model.maxDurationS;
|
|
36332
|
+
if (model.refText !== void 0) dto.ref_text = model.refText;
|
|
36333
|
+
if (model.seed !== void 0) dto.seed = model.seed;
|
|
36334
|
+
if (model.speaker !== void 0) dto.speaker = model.speaker;
|
|
36335
|
+
if (model.voiceId !== void 0) dto.voice_id = model.voiceId;
|
|
36336
|
+
return dto;
|
|
36337
|
+
}
|
|
36338
|
+
function TranscribeSpeechRequestFromFrontToApi(model) {
|
|
36339
|
+
const dto = { audio_base64: model.audioBase64 };
|
|
36340
|
+
if (model.audioMime !== void 0) dto.audio_mime = model.audioMime;
|
|
36341
|
+
if (model.format !== void 0) dto.format = model.format;
|
|
36342
|
+
if (model.language !== void 0) dto.language = model.language;
|
|
36343
|
+
return dto;
|
|
36344
|
+
}
|
|
36345
|
+
function TranscribeSpeechResponseFromApiToFront(dto) {
|
|
36346
|
+
const out = {
|
|
36347
|
+
model: dto.model,
|
|
36348
|
+
text: dto.text
|
|
36349
|
+
};
|
|
36350
|
+
if (dto.duration_secs != null) out.durationSecs = dto.duration_secs;
|
|
36351
|
+
return out;
|
|
36352
|
+
}
|
|
36353
|
+
|
|
36354
|
+
// src/resources/speech.ts
|
|
36355
|
+
var SpeechClient = class {
|
|
36356
|
+
/** @internal */
|
|
36357
|
+
api;
|
|
36358
|
+
/** @internal */
|
|
36359
|
+
constructor(api) {
|
|
36360
|
+
this.api = api;
|
|
36361
|
+
}
|
|
36362
|
+
/**
|
|
36363
|
+
* Enroll (or re-enroll) a cloned voice from a reference clip.
|
|
36364
|
+
*
|
|
36365
|
+
* @param request - The enrollment spec (audio, consent, name, etc.).
|
|
36366
|
+
* @returns The registered voice profile.
|
|
36367
|
+
*
|
|
36368
|
+
* @throws {ApiError} `400` if the clip is too short or consent is missing.
|
|
36369
|
+
*
|
|
36370
|
+
* @remarks
|
|
36371
|
+
* Wire format: the request body is a JSON object with snake_case keys
|
|
36372
|
+
* (`audio`, `audio_mime`, `consent`, `engine`, `name`, `transcript`);
|
|
36373
|
+
* the response is a `VoiceProfileDto` with snake_case fields, normalized
|
|
36374
|
+
* to camelCase here.
|
|
36375
|
+
*/
|
|
36376
|
+
async enrollVoice(request) {
|
|
36377
|
+
const response = await this.api.enrollVoice(
|
|
36378
|
+
EnrollVoiceRequestFromFrontToApi(request)
|
|
36379
|
+
);
|
|
36380
|
+
return VoiceProfileFromApiToFront(response.data);
|
|
36381
|
+
}
|
|
36382
|
+
/**
|
|
36383
|
+
* Report per-engine availability and capabilities.
|
|
36384
|
+
*
|
|
36385
|
+
* @returns The list of speech engines and their preset speakers.
|
|
36386
|
+
*
|
|
36387
|
+
* @remarks
|
|
36388
|
+
* Wire format: the response is a `ListEnginesResponse` with snake_case
|
|
36389
|
+
* fields, normalized to camelCase here.
|
|
36390
|
+
*/
|
|
36391
|
+
async listEngines() {
|
|
36392
|
+
const response = await this.api.listEngines();
|
|
36393
|
+
return ListEnginesResponseFromApiToFront(response.data);
|
|
36394
|
+
}
|
|
36395
|
+
/**
|
|
36396
|
+
* List the tenant's cloned voices plus available presets.
|
|
36397
|
+
*
|
|
36398
|
+
* @returns The enrolled voices and preset speaker names per engine.
|
|
36399
|
+
*
|
|
36400
|
+
* @remarks
|
|
36401
|
+
* Wire format: the response is a `ListVoicesResponse` with snake_case
|
|
36402
|
+
* fields (the `presets` map is returned verbatim), normalized to
|
|
36403
|
+
* camelCase here.
|
|
36404
|
+
*/
|
|
36405
|
+
async listVoices() {
|
|
36406
|
+
const response = await this.api.listVoices();
|
|
36407
|
+
return ListVoicesResponseFromApiToFront(response.data);
|
|
36408
|
+
}
|
|
36409
|
+
/**
|
|
36410
|
+
* Open a speech-to-speech session.
|
|
36411
|
+
*
|
|
36412
|
+
* @param request - The session spec (engine, language, voice id, etc.).
|
|
36413
|
+
* @returns The opened session, including the WebSocket media URL.
|
|
36414
|
+
*
|
|
36415
|
+
* @remarks
|
|
36416
|
+
* Wire format: the request body is a JSON object with snake_case keys
|
|
36417
|
+
* (`conversation_id`, `engine`, `language`, `voice_id`); the response is
|
|
36418
|
+
* an `OpenSpeechSessionResponse` with snake_case fields, normalized to
|
|
36419
|
+
* camelCase here.
|
|
36420
|
+
*/
|
|
36421
|
+
async openSpeechSession(request) {
|
|
36422
|
+
const response = await this.api.openSpeechSession(
|
|
36423
|
+
OpenSpeechSessionRequestFromFrontToApi(request)
|
|
36424
|
+
);
|
|
36425
|
+
return OpenSpeechSessionResponseFromApiToFront(response.data);
|
|
36426
|
+
}
|
|
36427
|
+
/**
|
|
36428
|
+
* Synthesize speech to raw audio bytes.
|
|
36429
|
+
*
|
|
36430
|
+
* @param request - The synthesis spec (text, engine, voice id, etc.).
|
|
36431
|
+
* @returns The raw fetch `Response`. The body is raw audio bytes
|
|
36432
|
+
* (`content-type: audio/wav` on success); read it via
|
|
36433
|
+
* `.arrayBuffer()` or `.blob()`. Check `response.ok` / `response.status`
|
|
36434
|
+
* before reading the body — a non-2xx response body is a JSON
|
|
36435
|
+
* `ApiError`, a 2xx response body is audio.
|
|
36436
|
+
*
|
|
36437
|
+
* @throws {ApiError} On a non-2xx response (the error body is JSON, not
|
|
36438
|
+
* audio — inspect it before consuming the stream).
|
|
36439
|
+
*
|
|
36440
|
+
* @remarks
|
|
36441
|
+
* Wire format: the request body is a JSON object with snake_case keys
|
|
36442
|
+
* (`ref_audio_base64`, `max_duration_s`, `voice_id`, etc.). The response
|
|
36443
|
+
* is NOT JSON — it is a binary audio stream, so this method returns the
|
|
36444
|
+
* raw `Response` unchanged rather than a normalized DTO.
|
|
36445
|
+
*/
|
|
36446
|
+
async synthesizeSpeech(request) {
|
|
36447
|
+
const response = await this.api.synthesizeSpeech(
|
|
36448
|
+
SynthesizeSpeechRequestFromFrontToApi(request)
|
|
36449
|
+
);
|
|
36450
|
+
return response;
|
|
36451
|
+
}
|
|
36452
|
+
/**
|
|
36453
|
+
* Transcribe a short utterance.
|
|
36454
|
+
*
|
|
36455
|
+
* @param request - The transcription spec (base64 audio, mime, etc.).
|
|
36456
|
+
* @returns The recognized text plus the model and optional duration.
|
|
36457
|
+
*
|
|
36458
|
+
* @remarks
|
|
36459
|
+
* Wire format: the request body is a JSON object with snake_case keys
|
|
36460
|
+
* (`audio_base64`, `audio_mime`, `format`, `language`); the response is
|
|
36461
|
+
* a `TranscribeSpeechResponse` with snake_case fields, normalized to
|
|
36462
|
+
* camelCase here.
|
|
36463
|
+
*/
|
|
36464
|
+
async transcribeSpeech(request) {
|
|
36465
|
+
const response = await this.api.transcribeSpeech(
|
|
36466
|
+
TranscribeSpeechRequestFromFrontToApi(request)
|
|
36467
|
+
);
|
|
36468
|
+
return TranscribeSpeechResponseFromApiToFront(response.data);
|
|
36469
|
+
}
|
|
36470
|
+
/**
|
|
36471
|
+
* Delete a cloned voice, upstream conditioning included.
|
|
36472
|
+
*
|
|
36473
|
+
* @param voiceId - The voice (term) id to delete.
|
|
36474
|
+
*
|
|
36475
|
+
* @remarks
|
|
36476
|
+
* Wire format: no body; the voice id is a path parameter. Returns no
|
|
36477
|
+
* content on success.
|
|
36478
|
+
*/
|
|
36479
|
+
async deleteVoice(voiceId) {
|
|
36480
|
+
await this.api.deleteVoice(voiceId);
|
|
36481
|
+
}
|
|
36482
|
+
};
|
|
36483
|
+
|
|
36484
|
+
// src/normalizers/connectors.ts
|
|
36485
|
+
function AddConnectorRequestFromFrontToApi(model) {
|
|
36486
|
+
return {
|
|
36487
|
+
name: model.name,
|
|
36488
|
+
type: model.type
|
|
36489
|
+
};
|
|
36490
|
+
}
|
|
36491
|
+
function AddConnectorResponseFromApiToFront(dto) {
|
|
36492
|
+
return {
|
|
36493
|
+
id: dto.id,
|
|
36494
|
+
name: dto.name,
|
|
36495
|
+
status: dto.status
|
|
36496
|
+
};
|
|
36497
|
+
}
|
|
36498
|
+
function ConnectorTypeFromApiToFront(dto) {
|
|
36499
|
+
const out = {
|
|
36500
|
+
authType: dto.auth_type,
|
|
36501
|
+
displayName: dto.display_name,
|
|
36502
|
+
typeName: dto.type_name
|
|
36503
|
+
};
|
|
36504
|
+
if (dto.icon_url !== void 0) out.iconUrl = dto.icon_url;
|
|
36505
|
+
return out;
|
|
36506
|
+
}
|
|
36507
|
+
function ConnectorInstanceFromApiToFront(dto) {
|
|
36508
|
+
const out = {
|
|
36509
|
+
displayName: dto.display_name,
|
|
36510
|
+
id: dto.id,
|
|
36511
|
+
name: dto.name,
|
|
36512
|
+
status: dto.status,
|
|
36513
|
+
typeName: dto.type_name
|
|
36514
|
+
};
|
|
36515
|
+
if (dto.connected_at !== void 0) out.connectedAt = dto.connected_at;
|
|
36516
|
+
if (dto.connected_by !== void 0) out.connectedBy = dto.connected_by;
|
|
36517
|
+
return out;
|
|
36518
|
+
}
|
|
36519
|
+
function OAuthStartResponseFromApiToFront(dto) {
|
|
36520
|
+
return {
|
|
36521
|
+
authUrl: dto.auth_url
|
|
36522
|
+
};
|
|
36523
|
+
}
|
|
36524
|
+
|
|
36525
|
+
// src/resources/connectors.ts
|
|
36526
|
+
var ConnectorsClient = class {
|
|
36527
|
+
/** @internal */
|
|
36528
|
+
api;
|
|
36529
|
+
/** @internal */
|
|
36530
|
+
constructor(api) {
|
|
36531
|
+
this.api = api;
|
|
36532
|
+
}
|
|
36533
|
+
/**
|
|
36534
|
+
* List the connector types this build supports.
|
|
36535
|
+
*
|
|
36536
|
+
* @returns Every connector type's wire name, display name, auth type,
|
|
36537
|
+
* and optional icon URL.
|
|
36538
|
+
*/
|
|
36539
|
+
async listTypes() {
|
|
36540
|
+
const response = await this.api.listTypes();
|
|
36541
|
+
return (response.data ?? []).map(ConnectorTypeFromApiToFront);
|
|
36542
|
+
}
|
|
36543
|
+
/**
|
|
36544
|
+
* List all registered connector instances.
|
|
36545
|
+
*
|
|
36546
|
+
* @returns The registered instances, each with its connection status.
|
|
36547
|
+
*/
|
|
36548
|
+
async list() {
|
|
36549
|
+
const response = await this.api.list();
|
|
36550
|
+
return (response.data ?? []).map(ConnectorInstanceFromApiToFront);
|
|
36551
|
+
}
|
|
36552
|
+
/**
|
|
36553
|
+
* Register a new connector instance.
|
|
36554
|
+
*
|
|
36555
|
+
* @param request - The instance name and the connector type to register.
|
|
36556
|
+
* @returns The newly-registered instance id, name, and status.
|
|
36557
|
+
*/
|
|
36558
|
+
async add(request) {
|
|
36559
|
+
const response = await this.api.add(AddConnectorRequestFromFrontToApi(request));
|
|
36560
|
+
return AddConnectorResponseFromApiToFront(response.data);
|
|
36561
|
+
}
|
|
36562
|
+
/**
|
|
36563
|
+
* Remove a registered connector instance.
|
|
36564
|
+
*
|
|
36565
|
+
* @param name - The instance name.
|
|
36566
|
+
*/
|
|
36567
|
+
async remove(name) {
|
|
36568
|
+
await this.api.remove(name);
|
|
36569
|
+
}
|
|
36570
|
+
/**
|
|
36571
|
+
* Start an OAuth flow for a connector instance.
|
|
36572
|
+
*
|
|
36573
|
+
* @param name - The instance name.
|
|
36574
|
+
* @returns The authorization URL the caller should redirect the user to.
|
|
36575
|
+
*/
|
|
36576
|
+
async startOauth(name) {
|
|
36577
|
+
const response = await this.api.startOauth(name);
|
|
36578
|
+
return OAuthStartResponseFromApiToFront(response.data);
|
|
36579
|
+
}
|
|
36580
|
+
/**
|
|
36581
|
+
* Disconnect a connector instance (drop its stored credentials).
|
|
36582
|
+
*
|
|
36583
|
+
* @param name - The instance name.
|
|
36584
|
+
*/
|
|
36585
|
+
async disconnect(name) {
|
|
36586
|
+
await this.api.disconnect(name);
|
|
36587
|
+
}
|
|
36588
|
+
/**
|
|
36589
|
+
* OAuth callback — the provider redirects here after authorization.
|
|
36590
|
+
*
|
|
36591
|
+
* @param name - The instance name.
|
|
36592
|
+
* @param query - The OAuth callback parameters (`code` on success;
|
|
36593
|
+
* `error`/`errorDescription` on failure; the opaque `state`).
|
|
36594
|
+
* @returns The raw `Response` — the backend returns an HTML page that
|
|
36595
|
+
* posts a message to the opener window. The caller usually does not
|
|
36596
|
+
* need the body; check `response.ok` for transport errors.
|
|
36597
|
+
*
|
|
36598
|
+
* @remarks
|
|
36599
|
+
* This endpoint is normally hit by the browser (the OAuth provider's
|
|
36600
|
+
* redirect target), not called directly by SDK consumers. It is exposed
|
|
36601
|
+
* for completeness / server-side testing.
|
|
36602
|
+
*/
|
|
36603
|
+
async oauthCallback(name, query = {}) {
|
|
36604
|
+
const response = await this.api.oauthCallback(name, query);
|
|
36605
|
+
return response;
|
|
36606
|
+
}
|
|
36607
|
+
};
|
|
36608
|
+
|
|
34319
36609
|
// src/client.ts
|
|
34320
36610
|
var ReasoningLayerClient = class {
|
|
34321
36611
|
/** Sort (type hierarchy) operations. */
|
|
@@ -34482,6 +36772,26 @@ var ReasoningLayerClient = class {
|
|
|
34482
36772
|
agui;
|
|
34483
36773
|
/** Ontology export — OWL ontology and SHACL shapes projected from the sort lattice. */
|
|
34484
36774
|
ontologyExport;
|
|
36775
|
+
/** Demo substrate seeding — full SUMO + demo scenarios into the tenant substrate. */
|
|
36776
|
+
demo;
|
|
36777
|
+
/** Execution-free reward scoring for candidate queries (recall / precision). */
|
|
36778
|
+
reward;
|
|
36779
|
+
/** Language translation (text → target language, markdown preserved). */
|
|
36780
|
+
translation;
|
|
36781
|
+
/** Probabilistic streaming sketches (Count-Min frequency, Misra-Gries heavy hitters, Bloom membership). */
|
|
36782
|
+
streaming;
|
|
36783
|
+
/** Split-conformal prediction — calibrate a non-conformity threshold, then predict with coverage certificates. */
|
|
36784
|
+
conformal;
|
|
36785
|
+
/** Video-clip encoding (V-JEPA substrate; per-frame predicted-sort labels). */
|
|
36786
|
+
vision;
|
|
36787
|
+
/** GDPR/HIPAA batch anonymization (k-anonymity or Safe Harbor). */
|
|
36788
|
+
anonymization;
|
|
36789
|
+
/** Speaker voiceprint enrollment + listing. */
|
|
36790
|
+
speakers;
|
|
36791
|
+
/** Speech synthesis / transcription / voice cloning + realtime session setup. */
|
|
36792
|
+
speech;
|
|
36793
|
+
/** External data connectors — register / list / remove / connect / disconnect + OAuth callback. */
|
|
36794
|
+
connectors;
|
|
34485
36795
|
// ─── Group Caches ─────────────────────────────────────────────────
|
|
34486
36796
|
_core;
|
|
34487
36797
|
_ai;
|
|
@@ -34789,6 +37099,16 @@ var ReasoningLayerClient = class {
|
|
|
34789
37099
|
this.guardrail = new GuardrailClient(generatedGuardrail);
|
|
34790
37100
|
this.agui = new AguiClient(generatedAgui);
|
|
34791
37101
|
this.ontologyExport = new OntologyExportClient(generatedOntologyExport);
|
|
37102
|
+
this.demo = new DemoClient(new Demo(generatedHttp));
|
|
37103
|
+
this.reward = new RewardClient(new Reward(generatedHttp));
|
|
37104
|
+
this.translation = new TranslationClient(new Translation(generatedHttp));
|
|
37105
|
+
this.streaming = new StreamingClient(new Streaming(generatedHttp));
|
|
37106
|
+
this.conformal = new ConformalClient(new Conformal(generatedHttp));
|
|
37107
|
+
this.vision = new VisionClient(new Vision(generatedHttp));
|
|
37108
|
+
this.anonymization = new AnonymizationClient(new Anonymization(generatedHttp));
|
|
37109
|
+
this.speakers = new SpeakersClient(new Speakers(generatedHttp));
|
|
37110
|
+
this.speech = new SpeechClient(new Speech(generatedHttp));
|
|
37111
|
+
this.connectors = new ConnectorsClient(new Connectors(generatedHttp));
|
|
34792
37112
|
}
|
|
34793
37113
|
};
|
|
34794
37114
|
|
|
@@ -35042,6 +37362,36 @@ var agui_exports = {};
|
|
|
35042
37362
|
// src/types/ontology-export.ts
|
|
35043
37363
|
var ontology_export_exports = {};
|
|
35044
37364
|
|
|
37365
|
+
// src/types/demo.ts
|
|
37366
|
+
var demo_exports = {};
|
|
37367
|
+
|
|
37368
|
+
// src/types/reward.ts
|
|
37369
|
+
var reward_exports = {};
|
|
37370
|
+
|
|
37371
|
+
// src/types/translation.ts
|
|
37372
|
+
var translation_exports = {};
|
|
37373
|
+
|
|
37374
|
+
// src/types/streaming.ts
|
|
37375
|
+
var streaming_exports = {};
|
|
37376
|
+
|
|
37377
|
+
// src/types/conformal.ts
|
|
37378
|
+
var conformal_exports = {};
|
|
37379
|
+
|
|
37380
|
+
// src/types/vision.ts
|
|
37381
|
+
var vision_exports = {};
|
|
37382
|
+
|
|
37383
|
+
// src/types/anonymization.ts
|
|
37384
|
+
var anonymization_exports = {};
|
|
37385
|
+
|
|
37386
|
+
// src/types/speakers.ts
|
|
37387
|
+
var speakers_exports = {};
|
|
37388
|
+
|
|
37389
|
+
// src/types/speech.ts
|
|
37390
|
+
var speech_exports = {};
|
|
37391
|
+
|
|
37392
|
+
// src/types/connectors.ts
|
|
37393
|
+
var connectors_exports = {};
|
|
37394
|
+
|
|
35045
37395
|
// src/builders/value.ts
|
|
35046
37396
|
var Value = {
|
|
35047
37397
|
/**
|
|
@@ -36053,6 +38403,7 @@ exports.Actions = actions_exports;
|
|
|
36053
38403
|
exports.Admin = admin_exports;
|
|
36054
38404
|
exports.Agui = agui_exports;
|
|
36055
38405
|
exports.Analysis = analysis_exports;
|
|
38406
|
+
exports.Anonymization = anonymization_exports;
|
|
36056
38407
|
exports.ApiError = ApiError;
|
|
36057
38408
|
exports.AuthenticationError = AuthenticationError;
|
|
36058
38409
|
exports.Authz = authz_exports;
|
|
@@ -36066,7 +38417,9 @@ exports.Collections = collections_exports;
|
|
|
36066
38417
|
exports.Communities = communities_exports;
|
|
36067
38418
|
exports.Compliance = compliance_exports;
|
|
36068
38419
|
exports.ComplianceMarkings = compliance_markings_exports;
|
|
38420
|
+
exports.Conformal = conformal_exports;
|
|
36069
38421
|
exports.Conformance = conformance_exports;
|
|
38422
|
+
exports.Connectors = connectors_exports;
|
|
36070
38423
|
exports.Constraint = Constraint;
|
|
36071
38424
|
exports.ConstraintViolationError = ConstraintViolationError;
|
|
36072
38425
|
exports.Constraints = constraints_exports;
|
|
@@ -36074,6 +38427,7 @@ exports.Control = control_exports;
|
|
|
36074
38427
|
exports.Conversation = conversation_exports;
|
|
36075
38428
|
exports.Corpus = corpus_exports;
|
|
36076
38429
|
exports.DL = dl_exports;
|
|
38430
|
+
exports.Demo = demo_exports;
|
|
36077
38431
|
exports.Discovery = discovery_exports;
|
|
36078
38432
|
exports.DocumentCheck = document_check_exports;
|
|
36079
38433
|
exports.Documents = documents_exports;
|
|
@@ -36127,6 +38481,7 @@ exports.ReasoningLayerClient = ReasoningLayerClient;
|
|
|
36127
38481
|
exports.ReasoningLayerError = ReasoningLayerError;
|
|
36128
38482
|
exports.Research = research_exports;
|
|
36129
38483
|
exports.Reviews = reviews_exports;
|
|
38484
|
+
exports.Reward = reward_exports;
|
|
36130
38485
|
exports.Row = row_exports;
|
|
36131
38486
|
exports.SDK_VERSION = SDK_VERSION;
|
|
36132
38487
|
exports.Sat = sat_exports;
|
|
@@ -36139,17 +38494,22 @@ exports.Sorts = sorts_exports;
|
|
|
36139
38494
|
exports.Sources = sources_exports;
|
|
36140
38495
|
exports.Spaces = spaces_exports;
|
|
36141
38496
|
exports.Sparql = sparql_exports;
|
|
38497
|
+
exports.Speakers = speakers_exports;
|
|
38498
|
+
exports.Speech = speech_exports;
|
|
36142
38499
|
exports.Statistical = statistical_exports;
|
|
38500
|
+
exports.Streaming = streaming_exports;
|
|
36143
38501
|
exports.Synthetic = synthetic_exports;
|
|
36144
38502
|
exports.Temporal = temporal_exports;
|
|
36145
38503
|
exports.Terms = terms_exports;
|
|
36146
38504
|
exports.TimeoutError = TimeoutError;
|
|
38505
|
+
exports.Translation = translation_exports;
|
|
36147
38506
|
exports.UI = ui_exports;
|
|
36148
38507
|
exports.Utilities = utilities_exports;
|
|
36149
38508
|
exports.ValidationError = ValidationError;
|
|
36150
38509
|
exports.Value = Value;
|
|
36151
38510
|
exports.Values = values_exports;
|
|
36152
38511
|
exports.Verification = verification_exports;
|
|
38512
|
+
exports.Vision = vision_exports;
|
|
36153
38513
|
exports.Visualization = visualization_exports;
|
|
36154
38514
|
exports.WebSocketClient = WebSocketClient;
|
|
36155
38515
|
exports.WebSocketConnection = WebSocketConnection;
|