@kortexya/reasoninglayer 1.15.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.cjs +2693 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5500 -36
- package/dist/index.d.ts +5500 -36
- package/dist/index.js +2684 -25
- package/dist/index.js.map +1 -1
- package/package.json +14 -14
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.17.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",
|
|
@@ -585,6 +587,8 @@ var USER_DATA_FIELDS = /* @__PURE__ */ new Set([
|
|
|
585
587
|
"per_strategy_taxonomies",
|
|
586
588
|
"propsOverride",
|
|
587
589
|
"props_override",
|
|
590
|
+
"referencedTerms",
|
|
591
|
+
"referenced_terms",
|
|
588
592
|
"roleMinimums",
|
|
589
593
|
"role_minimums",
|
|
590
594
|
"scope",
|
|
@@ -592,6 +596,8 @@ var USER_DATA_FIELDS = /* @__PURE__ */ new Set([
|
|
|
592
596
|
"scores_by_name",
|
|
593
597
|
"sortNames",
|
|
594
598
|
"sort_names",
|
|
599
|
+
"toolResults",
|
|
600
|
+
"tool_results",
|
|
595
601
|
"topK",
|
|
596
602
|
"top_k",
|
|
597
603
|
"values"
|
|
@@ -994,6 +1000,22 @@ var Sorts = class {
|
|
|
994
1000
|
format: "json",
|
|
995
1001
|
...params
|
|
996
1002
|
});
|
|
1003
|
+
/**
|
|
1004
|
+
* No description
|
|
1005
|
+
*
|
|
1006
|
+
* @tags sorts
|
|
1007
|
+
* @name GetFuzzySubsumption
|
|
1008
|
+
* @summary Get the fuzzy subsumption degree `sub ⊑· sup` between two sorts
|
|
1009
|
+
* @request POST:/api/v1/sorts/subsumption/get
|
|
1010
|
+
*/
|
|
1011
|
+
getFuzzySubsumption = (data, params = {}) => this.http.request({
|
|
1012
|
+
path: `/api/v1/sorts/subsumption/get`,
|
|
1013
|
+
method: "POST",
|
|
1014
|
+
body: data,
|
|
1015
|
+
type: "application/json" /* Json */,
|
|
1016
|
+
format: "json",
|
|
1017
|
+
...params
|
|
1018
|
+
});
|
|
997
1019
|
/**
|
|
998
1020
|
* @description Per Definition IV.5 (Milanese & Pasi 2024): ≾̇ = ((≾̃ .− ∼) ⊍ ≤)⁺
|
|
999
1021
|
*
|
|
@@ -1011,16 +1033,17 @@ var Sorts = class {
|
|
|
1011
1033
|
...params
|
|
1012
1034
|
});
|
|
1013
1035
|
/**
|
|
1014
|
-
*
|
|
1036
|
+
* @description With `?format=osfql` the sort is returned as its commented OSFQL `DEFINE` block (`text/plain`, `ETag` = SHA-256 of the body) instead of the JSON DTO — the single-sort companion of `GET /api/v1/sorts/schema`.
|
|
1015
1037
|
*
|
|
1016
1038
|
* @tags sorts
|
|
1017
1039
|
* @name GetSort
|
|
1018
1040
|
* @summary Get a sort by ID
|
|
1019
1041
|
* @request GET:/api/v1/sorts/{id}
|
|
1020
1042
|
*/
|
|
1021
|
-
getSort = (id, params = {}) => this.http.request({
|
|
1043
|
+
getSort = (id, query, params = {}) => this.http.request({
|
|
1022
1044
|
path: `/api/v1/sorts/${id}`,
|
|
1023
1045
|
method: "GET",
|
|
1046
|
+
query,
|
|
1024
1047
|
format: "json",
|
|
1025
1048
|
...params
|
|
1026
1049
|
});
|
|
@@ -1040,6 +1063,22 @@ var Sorts = class {
|
|
|
1040
1063
|
format: "json",
|
|
1041
1064
|
...params
|
|
1042
1065
|
});
|
|
1066
|
+
/**
|
|
1067
|
+
* @description The bulk companion of `?format=osfql` on the by-id route: a single deterministic, re-parseable `text/plain` block of commented `DEFINE` statements (one per sort, ordered by name) for LLM prompt conditioning and replayable export. Supports the tenant listing's filters (`name_prefix`, `include_system`, `needs_review`, `llm_extracted`, and `offset`/`limit`, applied after the deterministic ordering so pages are stable). The `ETag` is the SHA-256 of the body, so prompt-conditioning consumers get a stable cache key for "schema unchanged".
|
|
1068
|
+
*
|
|
1069
|
+
* @tags sorts
|
|
1070
|
+
* @name GetSortsSchema
|
|
1071
|
+
* @summary Export the authenticated tenant's schema as one OSFQL DDL block
|
|
1072
|
+
* @request GET:/api/v1/sorts/schema
|
|
1073
|
+
* @secure
|
|
1074
|
+
*/
|
|
1075
|
+
getSortsSchema = (query, params = {}) => this.http.request({
|
|
1076
|
+
path: `/api/v1/sorts/schema`,
|
|
1077
|
+
method: "GET",
|
|
1078
|
+
query,
|
|
1079
|
+
secure: true,
|
|
1080
|
+
...params
|
|
1081
|
+
});
|
|
1043
1082
|
/**
|
|
1044
1083
|
* No description
|
|
1045
1084
|
*
|
|
@@ -1146,6 +1185,22 @@ var Sorts = class {
|
|
|
1146
1185
|
format: "json",
|
|
1147
1186
|
...params
|
|
1148
1187
|
});
|
|
1188
|
+
/**
|
|
1189
|
+
* @description Subsumption is **directional**: ⊑·(s₁, s₂) and ⊑·(s₂, s₁) are different assertions. For the symmetric relation use `/api/v1/sorts/similarity`. The degree must be in [0, 1] and the assignment must keep the relation a fuzzy partial order (max–min transitivity, antisymmetry); one that does not is rejected rather than stored.
|
|
1190
|
+
*
|
|
1191
|
+
* @tags sorts
|
|
1192
|
+
* @name SetFuzzySubsumption
|
|
1193
|
+
* @summary Set the fuzzy subsumption degree `sub ⊑· sup` between two sorts
|
|
1194
|
+
* @request POST:/api/v1/sorts/subsumption
|
|
1195
|
+
*/
|
|
1196
|
+
setFuzzySubsumption = (data, params = {}) => this.http.request({
|
|
1197
|
+
path: `/api/v1/sorts/subsumption`,
|
|
1198
|
+
method: "POST",
|
|
1199
|
+
body: data,
|
|
1200
|
+
type: "application/json" /* Json */,
|
|
1201
|
+
format: "json",
|
|
1202
|
+
...params
|
|
1203
|
+
});
|
|
1149
1204
|
/**
|
|
1150
1205
|
* @description Similarity is symmetric: ∼(s₁, s₂) = ∼(s₂, s₁) Degree must be in [0, 1] range.
|
|
1151
1206
|
*
|
|
@@ -1162,6 +1217,22 @@ var Sorts = class {
|
|
|
1162
1217
|
format: "json",
|
|
1163
1218
|
...params
|
|
1164
1219
|
});
|
|
1220
|
+
/**
|
|
1221
|
+
* @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`).
|
|
1222
|
+
*
|
|
1223
|
+
* @tags sorts
|
|
1224
|
+
* @name SortIndexStatus
|
|
1225
|
+
* @summary GET /api/v1/sorts/index/status
|
|
1226
|
+
* @request GET:/api/v1/sorts/index/status
|
|
1227
|
+
* @secure
|
|
1228
|
+
*/
|
|
1229
|
+
sortIndexStatus = (params = {}) => this.http.request({
|
|
1230
|
+
path: `/api/v1/sorts/index/status`,
|
|
1231
|
+
method: "GET",
|
|
1232
|
+
secure: true,
|
|
1233
|
+
format: "json",
|
|
1234
|
+
...params
|
|
1235
|
+
});
|
|
1165
1236
|
/**
|
|
1166
1237
|
* No description
|
|
1167
1238
|
*
|
|
@@ -1605,11 +1676,11 @@ var Inference = class {
|
|
|
1605
1676
|
...params
|
|
1606
1677
|
});
|
|
1607
1678
|
/**
|
|
1608
|
-
* @description #
|
|
1679
|
+
* @description This drops the hydrated base facts, the forward-chain `persist_derived` facts and the residuation store, then forgets the hydration flag so the next request reloads the base facts from PostgreSQL. **It does not delete durable data.** The terms are the authority; this is their cache. That makes it the retraction primitive forward chaining otherwise lacks. Chaining is monotonic — delete a `blocks` edge and the derived "A blocks B" survives every later pass, so the KB keeps asserting a relationship the user removed. Clearing and re-chaining rebuilds the closure from the terms that actually exist. # History Until 2026-07-28 this handler enumerated every term in the tenant and deleted it from PostgreSQL, while calling itself "clear facts" and reporting `"Cleared N facts/rules"`. It is reachable with an ordinary tenant credential — unlike `/api/v1/admin/clear-tenant/{tenant_id}`, which gateways block — so a caller reading the name, the path or the response body had no way to know it was a tenant wipe. It destroyed a live tenant that way. Use `DELETE /api/v1/terms/{term_id}` to delete a term, and the admin route to wipe a tenant; deleting durable data must not be something an endpoint does as a side effect of its name. # Authorization Requires X-Tenant-Id header, and the path tenant must match it.
|
|
1609
1680
|
*
|
|
1610
1681
|
* @tags inference
|
|
1611
1682
|
* @name ClearFacts
|
|
1612
|
-
* @summary Clear
|
|
1683
|
+
* @summary Clear a tenant's in-memory inference working set.
|
|
1613
1684
|
* @request DELETE:/api/v1/inference/facts/{tenant_id}
|
|
1614
1685
|
* @secure
|
|
1615
1686
|
*/
|
|
@@ -1952,6 +2023,21 @@ var Cognitive = class {
|
|
|
1952
2023
|
format: "json",
|
|
1953
2024
|
...params
|
|
1954
2025
|
});
|
|
2026
|
+
/**
|
|
2027
|
+
* @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)
|
|
2028
|
+
*
|
|
2029
|
+
* @tags cognitive
|
|
2030
|
+
* @name CognitiveSseHandler
|
|
2031
|
+
* @summary SSE transport for the *same* cognitive event stream as `cognitive_ws_handler`.
|
|
2032
|
+
* @request GET:/api/v1/cognitive/agents/{agent_id}/events
|
|
2033
|
+
* @secure
|
|
2034
|
+
*/
|
|
2035
|
+
cognitiveSseHandler = (agentId, params = {}) => this.http.request({
|
|
2036
|
+
path: `/api/v1/cognitive/agents/${agentId}/events`,
|
|
2037
|
+
method: "GET",
|
|
2038
|
+
secure: true,
|
|
2039
|
+
...params
|
|
2040
|
+
});
|
|
1955
2041
|
/**
|
|
1956
2042
|
* @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
2043
|
*
|
|
@@ -2000,6 +2086,20 @@ var Cognitive = class {
|
|
|
2000
2086
|
format: "json",
|
|
2001
2087
|
...params
|
|
2002
2088
|
});
|
|
2089
|
+
/**
|
|
2090
|
+
* @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.
|
|
2091
|
+
*
|
|
2092
|
+
* @tags cognitive
|
|
2093
|
+
* @name GetActionReviewConfigHandler
|
|
2094
|
+
* @summary Get the tenant's current HITL action-review (oversight) configuration.
|
|
2095
|
+
* @request GET:/api/v1/cognitive/agents/action-review-config
|
|
2096
|
+
*/
|
|
2097
|
+
getActionReviewConfigHandler = (params = {}) => this.http.request({
|
|
2098
|
+
path: `/api/v1/cognitive/agents/action-review-config`,
|
|
2099
|
+
method: "GET",
|
|
2100
|
+
format: "json",
|
|
2101
|
+
...params
|
|
2102
|
+
});
|
|
2003
2103
|
/**
|
|
2004
2104
|
* @description Returns drives, deficits, curiosity targets, and the dominant drive. Tenant is identified by the `X-Tenant-Id` header.
|
|
2005
2105
|
*
|
|
@@ -2016,6 +2116,22 @@ var Cognitive = class {
|
|
|
2016
2116
|
format: "json",
|
|
2017
2117
|
...params
|
|
2018
2118
|
});
|
|
2119
|
+
/**
|
|
2120
|
+
* No description
|
|
2121
|
+
*
|
|
2122
|
+
* @tags cognitive
|
|
2123
|
+
* @name GetAgentPlanHandler
|
|
2124
|
+
* @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).
|
|
2125
|
+
* @request GET:/api/v1/cognitive/agents/{agent_id}/plan
|
|
2126
|
+
* @secure
|
|
2127
|
+
*/
|
|
2128
|
+
getAgentPlanHandler = (agentId, params = {}) => this.http.request({
|
|
2129
|
+
path: `/api/v1/cognitive/agents/${agentId}/plan`,
|
|
2130
|
+
method: "GET",
|
|
2131
|
+
secure: true,
|
|
2132
|
+
format: "json",
|
|
2133
|
+
...params
|
|
2134
|
+
});
|
|
2019
2135
|
/**
|
|
2020
2136
|
* No description
|
|
2021
2137
|
*
|
|
@@ -2032,6 +2148,22 @@ var Cognitive = class {
|
|
|
2032
2148
|
format: "json",
|
|
2033
2149
|
...params
|
|
2034
2150
|
});
|
|
2151
|
+
/**
|
|
2152
|
+
* No description
|
|
2153
|
+
*
|
|
2154
|
+
* @tags cognitive
|
|
2155
|
+
* @name GetAgentWorldModelHandler
|
|
2156
|
+
* @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.
|
|
2157
|
+
* @request GET:/api/v1/cognitive/agents/{agent_id}/world-model
|
|
2158
|
+
* @secure
|
|
2159
|
+
*/
|
|
2160
|
+
getAgentWorldModelHandler = (agentId, params = {}) => this.http.request({
|
|
2161
|
+
path: `/api/v1/cognitive/agents/${agentId}/world-model`,
|
|
2162
|
+
method: "GET",
|
|
2163
|
+
secure: true,
|
|
2164
|
+
format: "json",
|
|
2165
|
+
...params
|
|
2166
|
+
});
|
|
2035
2167
|
/**
|
|
2036
2168
|
* @description Returns beliefs, goals, intentions, pending perceptions, activations, recent episodes, and rule utilities. Tenant is identified by the `X-Tenant-Id` header.
|
|
2037
2169
|
*
|
|
@@ -2096,6 +2228,22 @@ var Cognitive = class {
|
|
|
2096
2228
|
format: "json",
|
|
2097
2229
|
...params
|
|
2098
2230
|
});
|
|
2231
|
+
/**
|
|
2232
|
+
* No description
|
|
2233
|
+
*
|
|
2234
|
+
* @tags cognitive
|
|
2235
|
+
* @name PauseAgentHandler
|
|
2236
|
+
* @summary POST /api/v1/cognitive/agents/{agent_id}/pause — pause an agent (persisted).
|
|
2237
|
+
* @request POST:/api/v1/cognitive/agents/{agent_id}/pause
|
|
2238
|
+
* @secure
|
|
2239
|
+
*/
|
|
2240
|
+
pauseAgentHandler = (agentId, params = {}) => this.http.request({
|
|
2241
|
+
path: `/api/v1/cognitive/agents/${agentId}/pause`,
|
|
2242
|
+
method: "POST",
|
|
2243
|
+
secure: true,
|
|
2244
|
+
format: "json",
|
|
2245
|
+
...params
|
|
2246
|
+
});
|
|
2099
2247
|
/**
|
|
2100
2248
|
* @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
2249
|
*
|
|
@@ -2128,6 +2276,22 @@ var Cognitive = class {
|
|
|
2128
2276
|
format: "json",
|
|
2129
2277
|
...params
|
|
2130
2278
|
});
|
|
2279
|
+
/**
|
|
2280
|
+
* No description
|
|
2281
|
+
*
|
|
2282
|
+
* @tags cognitive
|
|
2283
|
+
* @name ResumeAgentHandler
|
|
2284
|
+
* @summary POST /api/v1/cognitive/agents/{agent_id}/resume — resume a paused agent.
|
|
2285
|
+
* @request POST:/api/v1/cognitive/agents/{agent_id}/resume
|
|
2286
|
+
* @secure
|
|
2287
|
+
*/
|
|
2288
|
+
resumeAgentHandler = (agentId, params = {}) => this.http.request({
|
|
2289
|
+
path: `/api/v1/cognitive/agents/${agentId}/resume`,
|
|
2290
|
+
method: "POST",
|
|
2291
|
+
secure: true,
|
|
2292
|
+
format: "json",
|
|
2293
|
+
...params
|
|
2294
|
+
});
|
|
2131
2295
|
/**
|
|
2132
2296
|
* @description Executes: perceive → reason → act → learn
|
|
2133
2297
|
*
|
|
@@ -2192,6 +2356,22 @@ var Cognitive = class {
|
|
|
2192
2356
|
format: "json",
|
|
2193
2357
|
...params
|
|
2194
2358
|
});
|
|
2359
|
+
/**
|
|
2360
|
+
* No description
|
|
2361
|
+
*
|
|
2362
|
+
* @tags cognitive
|
|
2363
|
+
* @name StopAgentHandler
|
|
2364
|
+
* @summary POST /api/v1/cognitive/agents/{agent_id}/stop — soft-stop an agent (persisted; distinct from DELETE, which permanently destroys the agent + its goals).
|
|
2365
|
+
* @request POST:/api/v1/cognitive/agents/{agent_id}/stop
|
|
2366
|
+
* @secure
|
|
2367
|
+
*/
|
|
2368
|
+
stopAgentHandler = (agentId, params = {}) => this.http.request({
|
|
2369
|
+
path: `/api/v1/cognitive/agents/${agentId}/stop`,
|
|
2370
|
+
method: "POST",
|
|
2371
|
+
secure: true,
|
|
2372
|
+
format: "json",
|
|
2373
|
+
...params
|
|
2374
|
+
});
|
|
2195
2375
|
/**
|
|
2196
2376
|
* @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
2377
|
*
|
|
@@ -2682,6 +2862,24 @@ var Ingestion = class {
|
|
|
2682
2862
|
format: "json",
|
|
2683
2863
|
...params
|
|
2684
2864
|
});
|
|
2865
|
+
/**
|
|
2866
|
+
* @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.
|
|
2867
|
+
*
|
|
2868
|
+
* @tags ingestion
|
|
2869
|
+
* @name IngestKif
|
|
2870
|
+
* @summary Import SUO-KIF and, optionally, prove a ground goal against the imported axioms.
|
|
2871
|
+
* @request POST:/api/v1/ingest/kif
|
|
2872
|
+
* @secure
|
|
2873
|
+
*/
|
|
2874
|
+
ingestKif = (data, params = {}) => this.http.request({
|
|
2875
|
+
path: `/api/v1/ingest/kif`,
|
|
2876
|
+
method: "POST",
|
|
2877
|
+
body: data,
|
|
2878
|
+
secure: true,
|
|
2879
|
+
type: "application/json" /* Json */,
|
|
2880
|
+
format: "json",
|
|
2881
|
+
...params
|
|
2882
|
+
});
|
|
2685
2883
|
/**
|
|
2686
2884
|
* @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
2885
|
*
|
|
@@ -2898,6 +3096,21 @@ var StructuredIngestion = class {
|
|
|
2898
3096
|
secure: true,
|
|
2899
3097
|
...params
|
|
2900
3098
|
});
|
|
3099
|
+
/**
|
|
3100
|
+
* @description Refused with 409 while a registered source still references the file's path (the source's adapter would otherwise hold a dangling `file_path`). After that source is unregistered, the delete succeeds (204). A missing sidecar (no such upload id) is 404.
|
|
3101
|
+
*
|
|
3102
|
+
* @tags structured_ingestion
|
|
3103
|
+
* @name DeleteSourceFile
|
|
3104
|
+
* @summary Delete a tenant-uploaded source file (#107).
|
|
3105
|
+
* @request DELETE:/api/v1/sources/files/{id}
|
|
3106
|
+
* @secure
|
|
3107
|
+
*/
|
|
3108
|
+
deleteSourceFile = (id, params = {}) => this.http.request({
|
|
3109
|
+
path: `/api/v1/sources/files/${id}`,
|
|
3110
|
+
method: "DELETE",
|
|
3111
|
+
secure: true,
|
|
3112
|
+
...params
|
|
3113
|
+
});
|
|
2901
3114
|
/**
|
|
2902
3115
|
* @description Performs schema introspection on the source to discover types (sorts), features (fields), and relations. This is a preview operation - no data is ingested. `type_filter` narrows the discovery to a named subset **without re-registering the source** — the escape hatch a client uses after `/tables` when the source is over the discovery cap (#66, Gap 2). It conjoins with the source config's own `include_tables`: a request narrows *within* the registration, it cannot widen past it.
|
|
2903
3116
|
*
|
|
@@ -2950,6 +3163,22 @@ var StructuredIngestion = class {
|
|
|
2950
3163
|
format: "json",
|
|
2951
3164
|
...params
|
|
2952
3165
|
});
|
|
3166
|
+
/**
|
|
3167
|
+
* @description Walks `{base}/{tenant_id}/*\/.meta.json`. A missing tenant dir yields an empty list (200), not 404 — a tenant that never uploaded is not an error.
|
|
3168
|
+
*
|
|
3169
|
+
* @tags structured_ingestion
|
|
3170
|
+
* @name ListSourceFiles
|
|
3171
|
+
* @summary List the calling tenant's uploaded source files (#107).
|
|
3172
|
+
* @request GET:/api/v1/sources/files
|
|
3173
|
+
* @secure
|
|
3174
|
+
*/
|
|
3175
|
+
listSourceFiles = (params = {}) => this.http.request({
|
|
3176
|
+
path: `/api/v1/sources/files`,
|
|
3177
|
+
method: "GET",
|
|
3178
|
+
secure: true,
|
|
3179
|
+
format: "json",
|
|
3180
|
+
...params
|
|
3181
|
+
});
|
|
2953
3182
|
/**
|
|
2954
3183
|
* No description
|
|
2955
3184
|
*
|
|
@@ -3016,6 +3245,24 @@ var StructuredIngestion = class {
|
|
|
3016
3245
|
format: "json",
|
|
3017
3246
|
...params
|
|
3018
3247
|
});
|
|
3248
|
+
/**
|
|
3249
|
+
* @description Multipart, one field named `file`. Streamed to disk under `{base}/{tenant_id}/{id}/{safe_name}` with a `.meta.json` sidecar. The response `path` is the engine-internal location handed to `POST /api/v1/sources` as `config.file_path` (csv/parquet) or `config.database_path` (sqlite).
|
|
3250
|
+
*
|
|
3251
|
+
* @tags structured_ingestion
|
|
3252
|
+
* @name UploadSourceFile
|
|
3253
|
+
* @summary Upload a file-based source artifact for the calling tenant (#107).
|
|
3254
|
+
* @request POST:/api/v1/sources/files
|
|
3255
|
+
* @secure
|
|
3256
|
+
*/
|
|
3257
|
+
uploadSourceFile = (data, params = {}) => this.http.request({
|
|
3258
|
+
path: `/api/v1/sources/files`,
|
|
3259
|
+
method: "POST",
|
|
3260
|
+
body: data,
|
|
3261
|
+
secure: true,
|
|
3262
|
+
type: "multipart/form-data" /* FormData */,
|
|
3263
|
+
format: "json",
|
|
3264
|
+
...params
|
|
3265
|
+
});
|
|
3019
3266
|
};
|
|
3020
3267
|
|
|
3021
3268
|
// src/api-spec/generated/NeuroSymbolic.ts
|
|
@@ -3562,6 +3809,60 @@ var Communities = class {
|
|
|
3562
3809
|
constructor(http) {
|
|
3563
3810
|
this.http = http;
|
|
3564
3811
|
}
|
|
3812
|
+
/**
|
|
3813
|
+
* @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`.
|
|
3814
|
+
*
|
|
3815
|
+
* @tags communities
|
|
3816
|
+
* @name ComputeCentrality
|
|
3817
|
+
* @summary Compute a node-centrality measure over the tenant's reference graph.
|
|
3818
|
+
* @request POST:/api/v1/analysis/centrality
|
|
3819
|
+
* @secure
|
|
3820
|
+
*/
|
|
3821
|
+
computeCentrality = (data, params = {}) => this.http.request({
|
|
3822
|
+
path: `/api/v1/analysis/centrality`,
|
|
3823
|
+
method: "POST",
|
|
3824
|
+
body: data,
|
|
3825
|
+
secure: true,
|
|
3826
|
+
type: "application/json" /* Json */,
|
|
3827
|
+
format: "json",
|
|
3828
|
+
...params
|
|
3829
|
+
});
|
|
3830
|
+
/**
|
|
3831
|
+
* @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).
|
|
3832
|
+
*
|
|
3833
|
+
* @tags communities
|
|
3834
|
+
* @name ComputeCohesion
|
|
3835
|
+
* @summary Structural-cohesion metrics over the tenant's reference graph.
|
|
3836
|
+
* @request POST:/api/v1/analysis/cohesion
|
|
3837
|
+
* @secure
|
|
3838
|
+
*/
|
|
3839
|
+
computeCohesion = (data, params = {}) => this.http.request({
|
|
3840
|
+
path: `/api/v1/analysis/cohesion`,
|
|
3841
|
+
method: "POST",
|
|
3842
|
+
body: data,
|
|
3843
|
+
secure: true,
|
|
3844
|
+
type: "application/json" /* Json */,
|
|
3845
|
+
format: "json",
|
|
3846
|
+
...params
|
|
3847
|
+
});
|
|
3848
|
+
/**
|
|
3849
|
+
* @description `POST /api/v1/analysis/path` Read-only: BFS shortest path (`source..=target`) over the undirected reference graph, or `null` when `target` is unreachable.
|
|
3850
|
+
*
|
|
3851
|
+
* @tags communities
|
|
3852
|
+
* @name ComputePath
|
|
3853
|
+
* @summary Shortest path between two nodes (and the graph's connected-component count).
|
|
3854
|
+
* @request POST:/api/v1/analysis/path
|
|
3855
|
+
* @secure
|
|
3856
|
+
*/
|
|
3857
|
+
computePath = (data, params = {}) => this.http.request({
|
|
3858
|
+
path: `/api/v1/analysis/path`,
|
|
3859
|
+
method: "POST",
|
|
3860
|
+
body: data,
|
|
3861
|
+
secure: true,
|
|
3862
|
+
type: "application/json" /* Json */,
|
|
3863
|
+
format: "json",
|
|
3864
|
+
...params
|
|
3865
|
+
});
|
|
3565
3866
|
/**
|
|
3566
3867
|
* @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
3868
|
*
|
|
@@ -3580,6 +3881,21 @@ var Communities = class {
|
|
|
3580
3881
|
format: "json",
|
|
3581
3882
|
...params
|
|
3582
3883
|
});
|
|
3884
|
+
/**
|
|
3885
|
+
* @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.
|
|
3886
|
+
*
|
|
3887
|
+
* @tags communities
|
|
3888
|
+
* @name ExportGraph
|
|
3889
|
+
* @summary Export the tenant's reference graph to a graph-interchange format.
|
|
3890
|
+
* @request GET:/api/v1/graph/export
|
|
3891
|
+
* @secure
|
|
3892
|
+
*/
|
|
3893
|
+
exportGraph = (params = {}) => this.http.request({
|
|
3894
|
+
path: `/api/v1/graph/export`,
|
|
3895
|
+
method: "GET",
|
|
3896
|
+
secure: true,
|
|
3897
|
+
...params
|
|
3898
|
+
});
|
|
3583
3899
|
/**
|
|
3584
3900
|
* @description POST /api/v1/communities/memberships Returns all communities that a term belongs to, with membership degrees.
|
|
3585
3901
|
*
|
|
@@ -3598,6 +3914,24 @@ var Communities = class {
|
|
|
3598
3914
|
format: "json",
|
|
3599
3915
|
...params
|
|
3600
3916
|
});
|
|
3917
|
+
/**
|
|
3918
|
+
* @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.
|
|
3919
|
+
*
|
|
3920
|
+
* @tags communities
|
|
3921
|
+
* @name PredictLinks
|
|
3922
|
+
* @summary Score candidate links from a source node (link prediction).
|
|
3923
|
+
* @request POST:/api/v1/analysis/link-prediction
|
|
3924
|
+
* @secure
|
|
3925
|
+
*/
|
|
3926
|
+
predictLinks = (data, params = {}) => this.http.request({
|
|
3927
|
+
path: `/api/v1/analysis/link-prediction`,
|
|
3928
|
+
method: "POST",
|
|
3929
|
+
body: data,
|
|
3930
|
+
secure: true,
|
|
3931
|
+
type: "application/json" /* Json */,
|
|
3932
|
+
format: "json",
|
|
3933
|
+
...params
|
|
3934
|
+
});
|
|
3601
3935
|
/**
|
|
3602
3936
|
* @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
3937
|
*
|
|
@@ -5588,6 +5922,24 @@ var Discovery = class {
|
|
|
5588
5922
|
format: "json",
|
|
5589
5923
|
...params
|
|
5590
5924
|
});
|
|
5925
|
+
/**
|
|
5926
|
+
* @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
|
|
5927
|
+
*
|
|
5928
|
+
* @tags discovery
|
|
5929
|
+
* @name DiscoverEml
|
|
5930
|
+
* @summary Handler for `POST /discover/eml`.
|
|
5931
|
+
* @request POST:/api/v1/discover/eml
|
|
5932
|
+
* @secure
|
|
5933
|
+
*/
|
|
5934
|
+
discoverEml = (data, params = {}) => this.http.request({
|
|
5935
|
+
path: `/api/v1/discover/eml`,
|
|
5936
|
+
method: "POST",
|
|
5937
|
+
body: data,
|
|
5938
|
+
secure: true,
|
|
5939
|
+
type: "application/json" /* Json */,
|
|
5940
|
+
format: "json",
|
|
5941
|
+
...params
|
|
5942
|
+
});
|
|
5591
5943
|
/**
|
|
5592
5944
|
* @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
5945
|
*
|
|
@@ -5614,6 +5966,22 @@ var Extraction = class {
|
|
|
5614
5966
|
constructor(http) {
|
|
5615
5967
|
this.http = http;
|
|
5616
5968
|
}
|
|
5969
|
+
/**
|
|
5970
|
+
* @description Read-only with respect to the knowledge base: certification inspects the tenant's sort lattice and never writes a term. Certificates *are* written to the verification certificate store, so the batch is auditable afterwards.
|
|
5971
|
+
*
|
|
5972
|
+
* @tags extraction
|
|
5973
|
+
* @name CertifyExtraction
|
|
5974
|
+
* @summary `POST /api/v1/extraction/certify` — gate a batch of extraction candidates through the OSF well-sortedness certifier before they may become durable KB content.
|
|
5975
|
+
* @request POST:/api/v1/extraction/certify
|
|
5976
|
+
*/
|
|
5977
|
+
certifyExtraction = (data, params = {}) => this.http.request({
|
|
5978
|
+
path: `/api/v1/extraction/certify`,
|
|
5979
|
+
method: "POST",
|
|
5980
|
+
body: data,
|
|
5981
|
+
type: "application/json" /* Json */,
|
|
5982
|
+
format: "json",
|
|
5983
|
+
...params
|
|
5984
|
+
});
|
|
5617
5985
|
/**
|
|
5618
5986
|
* @description Uses GLiNER2 (zero-shot NER) with sort names from the tenant's knowledge base, guaranteeing that all returned entity labels are valid sort names. Label selection (when no explicit labels provided): Embed the input text and ANN-search the pre-computed sort embedding index (Qdrant) for the most semantically similar HPO sorts. This is O(log n) and typically returns 20-100 highly relevant labels from 19K+ HPO sorts. Requires: - GLiNER2 NER service (`GLINER_NER_URL`) - Qdrant vector store for semantic label selection If either is not configured, returns a 500 error.
|
|
5619
5987
|
*
|
|
@@ -6234,6 +6602,24 @@ var Fuzzy = class {
|
|
|
6234
6602
|
format: "json",
|
|
6235
6603
|
...params
|
|
6236
6604
|
});
|
|
6605
|
+
/**
|
|
6606
|
+
* @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.
|
|
6607
|
+
*
|
|
6608
|
+
* @tags fuzzy
|
|
6609
|
+
* @name ScoreTerms
|
|
6610
|
+
* @summary Score a GIVEN set of candidate terms against a query ψ-term.
|
|
6611
|
+
* @request POST:/api/v1/fuzzy/score
|
|
6612
|
+
* @secure
|
|
6613
|
+
*/
|
|
6614
|
+
scoreTerms = (data, params = {}) => this.http.request({
|
|
6615
|
+
path: `/api/v1/fuzzy/score`,
|
|
6616
|
+
method: "POST",
|
|
6617
|
+
body: data,
|
|
6618
|
+
secure: true,
|
|
6619
|
+
type: "application/json" /* Json */,
|
|
6620
|
+
format: "json",
|
|
6621
|
+
...params
|
|
6622
|
+
});
|
|
6237
6623
|
};
|
|
6238
6624
|
|
|
6239
6625
|
// src/api-spec/generated/Constraints.ts
|
|
@@ -6387,7 +6773,7 @@ var Reasoning = class {
|
|
|
6387
6773
|
this.http = http;
|
|
6388
6774
|
}
|
|
6389
6775
|
/**
|
|
6390
|
-
* @description POST /api/v1/reasoning/disentailment Disentailment A =/=> B means: "if A holds, then B must NOT hold" Returns whether the disentailment is violated
|
|
6776
|
+
* @description POST /api/v1/reasoning/disentailment Disentailment A =/=> B means: "if A holds, then B must NOT hold". Returns whether the disentailment is violated — the conflict where the facts establish A and B follows anyway. This is hierarchy-aware and graded on the same footing as the entailment route, so a conflict reachable only through the sort lattice (a `contaminated` clause held by a `lead_paint` fact that subsumes it) is detected without that clause being supplied as a fact. `A ⇏ B` is violated exactly to the degree `A ⇒ B` is established, so `degree` here reports the complement: how strongly the disentailment still holds.
|
|
6391
6777
|
*
|
|
6392
6778
|
* @tags reasoning
|
|
6393
6779
|
* @name Disentailment
|
|
@@ -6403,7 +6789,7 @@ var Reasoning = class {
|
|
|
6403
6789
|
...params
|
|
6404
6790
|
});
|
|
6405
6791
|
/**
|
|
6406
|
-
* @description POST /api/v1/reasoning/entailment
|
|
6792
|
+
* @description POST /api/v1/reasoning/entailment Answers `facts ⊨ antecedent ⇒ consequent`, hierarchy-aware and graded. A clause holds in the fact base to the degree that some fact *witnesses* it — that is, to the degree the clause subsumes a fact — so a `sparrow` fact establishes the clause `animal` without an `animal` fact being supplied. The consequent is additionally established when it subsumes the antecedent it would follow from. See [`osfkb_domain::operations::homoiconic_entailment`] for the full semantics. `entails` is the crisp reading of `degree`; `degree`, `antecedent_degree` and `consequent_degree` are computed from the sort lattice (crisply, and through explicit fuzzy `⊑·` relations and approved sort similarity), never cast from the boolean.
|
|
6407
6793
|
*
|
|
6408
6794
|
* @tags reasoning
|
|
6409
6795
|
* @name Entailment
|
|
@@ -8432,6 +8818,20 @@ var Health = class {
|
|
|
8432
8818
|
format: "json",
|
|
8433
8819
|
...params
|
|
8434
8820
|
});
|
|
8821
|
+
/**
|
|
8822
|
+
* No description
|
|
8823
|
+
*
|
|
8824
|
+
* @tags health
|
|
8825
|
+
* @name HealthCheckApi
|
|
8826
|
+
* @summary `GET /api/v1/health` — the same enriched health check under the `/api/v1` prefix. The playground front proxy forwards only `/api/*` to the engine (and answers the bare `/health` itself with a static OK), so THIS is the path that makes the deployed `build_info.version` publicly readable — a stale rollout must never be indistinguishable from a fresh one.
|
|
8827
|
+
* @request GET:/api/v1/health
|
|
8828
|
+
*/
|
|
8829
|
+
healthCheckApi = (params = {}) => this.http.request({
|
|
8830
|
+
path: `/api/v1/health`,
|
|
8831
|
+
method: "GET",
|
|
8832
|
+
format: "json",
|
|
8833
|
+
...params
|
|
8834
|
+
});
|
|
8435
8835
|
};
|
|
8436
8836
|
|
|
8437
8837
|
// src/api-spec/generated/Scheduling.ts
|
|
@@ -8736,6 +9136,24 @@ var Generation = class {
|
|
|
8736
9136
|
constructor(http) {
|
|
8737
9137
|
this.http = http;
|
|
8738
9138
|
}
|
|
9139
|
+
/**
|
|
9140
|
+
* @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.
|
|
9141
|
+
*
|
|
9142
|
+
* @tags generation
|
|
9143
|
+
* @name ConstrainedGenerate
|
|
9144
|
+
* @summary Generate an answer constrained to an OSF-feasible set via the application-tier decoder.
|
|
9145
|
+
* @request POST:/api/v1/constrained/generate
|
|
9146
|
+
* @secure
|
|
9147
|
+
*/
|
|
9148
|
+
constrainedGenerate = (data, params = {}) => this.http.request({
|
|
9149
|
+
path: `/api/v1/constrained/generate`,
|
|
9150
|
+
method: "POST",
|
|
9151
|
+
body: data,
|
|
9152
|
+
secure: true,
|
|
9153
|
+
type: "application/json" /* Json */,
|
|
9154
|
+
format: "json",
|
|
9155
|
+
...params
|
|
9156
|
+
});
|
|
8739
9157
|
/**
|
|
8740
9158
|
* No description
|
|
8741
9159
|
*
|
|
@@ -8754,6 +9172,58 @@ var Generation = class {
|
|
|
8754
9172
|
format: "json",
|
|
8755
9173
|
...params
|
|
8756
9174
|
});
|
|
9175
|
+
/**
|
|
9176
|
+
* @description POST /api/v1/text/generate
|
|
9177
|
+
*
|
|
9178
|
+
* @tags generation
|
|
9179
|
+
* @name GenerateText
|
|
9180
|
+
* @summary Run the caller's system prompt over their text.
|
|
9181
|
+
* @request POST:/api/v1/text/generate
|
|
9182
|
+
* @secure
|
|
9183
|
+
*/
|
|
9184
|
+
generateText = (data, params = {}) => this.http.request({
|
|
9185
|
+
path: `/api/v1/text/generate`,
|
|
9186
|
+
method: "POST",
|
|
9187
|
+
body: data,
|
|
9188
|
+
secure: true,
|
|
9189
|
+
type: "application/json" /* Json */,
|
|
9190
|
+
format: "json",
|
|
9191
|
+
...params
|
|
9192
|
+
});
|
|
9193
|
+
/**
|
|
9194
|
+
* @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).
|
|
9195
|
+
*
|
|
9196
|
+
* @tags generation
|
|
9197
|
+
* @name GroundedGenerate
|
|
9198
|
+
* @summary Generate grounded prose via the two-pass (constrained derivation → free realization) pipeline.
|
|
9199
|
+
* @request POST:/api/v1/generate/grounded
|
|
9200
|
+
* @secure
|
|
9201
|
+
*/
|
|
9202
|
+
groundedGenerate = (data, params = {}) => this.http.request({
|
|
9203
|
+
path: `/api/v1/generate/grounded`,
|
|
9204
|
+
method: "POST",
|
|
9205
|
+
body: data,
|
|
9206
|
+
secure: true,
|
|
9207
|
+
type: "application/json" /* Json */,
|
|
9208
|
+
format: "json",
|
|
9209
|
+
...params
|
|
9210
|
+
});
|
|
9211
|
+
/**
|
|
9212
|
+
* No description
|
|
9213
|
+
*
|
|
9214
|
+
* @tags generation
|
|
9215
|
+
* @name RawGenerate
|
|
9216
|
+
* @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.
|
|
9217
|
+
* @request POST:/api/v1/generate/raw
|
|
9218
|
+
*/
|
|
9219
|
+
rawGenerate = (data, params = {}) => this.http.request({
|
|
9220
|
+
path: `/api/v1/generate/raw`,
|
|
9221
|
+
method: "POST",
|
|
9222
|
+
body: data,
|
|
9223
|
+
type: "application/json" /* Json */,
|
|
9224
|
+
format: "json",
|
|
9225
|
+
...params
|
|
9226
|
+
});
|
|
8757
9227
|
};
|
|
8758
9228
|
|
|
8759
9229
|
// src/api-spec/generated/Rag.ts
|
|
@@ -8836,6 +9306,7 @@ var Osfql = class {
|
|
|
8836
9306
|
path: `/api/v1/osfql/catalog`,
|
|
8837
9307
|
method: "GET",
|
|
8838
9308
|
query,
|
|
9309
|
+
format: "json",
|
|
8839
9310
|
...params
|
|
8840
9311
|
});
|
|
8841
9312
|
};
|
|
@@ -9055,6 +9526,58 @@ var Compliance = class {
|
|
|
9055
9526
|
format: "json",
|
|
9056
9527
|
...params
|
|
9057
9528
|
});
|
|
9529
|
+
/**
|
|
9530
|
+
* No description
|
|
9531
|
+
*
|
|
9532
|
+
* @tags compliance
|
|
9533
|
+
* @name CreateDsr
|
|
9534
|
+
* @summary File a GDPR data subject request
|
|
9535
|
+
* @request POST:/api/v1/dsr
|
|
9536
|
+
* @secure
|
|
9537
|
+
*/
|
|
9538
|
+
createDsr = (data, params = {}) => this.http.request({
|
|
9539
|
+
path: `/api/v1/dsr`,
|
|
9540
|
+
method: "POST",
|
|
9541
|
+
body: data,
|
|
9542
|
+
secure: true,
|
|
9543
|
+
type: "application/json" /* Json */,
|
|
9544
|
+
format: "json",
|
|
9545
|
+
...params
|
|
9546
|
+
});
|
|
9547
|
+
/**
|
|
9548
|
+
* @description **Dry run by default.** An exact match on an identifying feature is the only deterministic way to resolve a person to terms, but exactness is not uniqueness — two people share a name. Erasing on a bare match would silently destroy a homonym's data, and erasure is irreversible, so the plan has to be inspectable before it runs. Pass `confirm: true` once the match has been reviewed.
|
|
9549
|
+
*
|
|
9550
|
+
* @tags compliance
|
|
9551
|
+
* @name EraseSubject
|
|
9552
|
+
* @summary Plan or execute erasure of a data subject's terms
|
|
9553
|
+
* @request POST:/api/v1/dsr/{id}/erase
|
|
9554
|
+
* @secure
|
|
9555
|
+
*/
|
|
9556
|
+
eraseSubject = (id, data, params = {}) => this.http.request({
|
|
9557
|
+
path: `/api/v1/dsr/${id}/erase`,
|
|
9558
|
+
method: "POST",
|
|
9559
|
+
body: data,
|
|
9560
|
+
secure: true,
|
|
9561
|
+
type: "application/json" /* Json */,
|
|
9562
|
+
format: "json",
|
|
9563
|
+
...params
|
|
9564
|
+
});
|
|
9565
|
+
/**
|
|
9566
|
+
* No description
|
|
9567
|
+
*
|
|
9568
|
+
* @tags compliance
|
|
9569
|
+
* @name GetDsr
|
|
9570
|
+
* @summary Read a data subject request
|
|
9571
|
+
* @request GET:/api/v1/dsr/{id}
|
|
9572
|
+
* @secure
|
|
9573
|
+
*/
|
|
9574
|
+
getDsr = (id, params = {}) => this.http.request({
|
|
9575
|
+
path: `/api/v1/dsr/${id}`,
|
|
9576
|
+
method: "GET",
|
|
9577
|
+
secure: true,
|
|
9578
|
+
format: "json",
|
|
9579
|
+
...params
|
|
9580
|
+
});
|
|
9058
9581
|
/**
|
|
9059
9582
|
* No description
|
|
9060
9583
|
*
|
|
@@ -9088,6 +9611,22 @@ var Compliance = class {
|
|
|
9088
9611
|
format: "json",
|
|
9089
9612
|
...params
|
|
9090
9613
|
});
|
|
9614
|
+
/**
|
|
9615
|
+
* No description
|
|
9616
|
+
*
|
|
9617
|
+
* @tags compliance
|
|
9618
|
+
* @name ListDsr
|
|
9619
|
+
* @summary List a data subject's requests
|
|
9620
|
+
* @request GET:/api/v1/dsr
|
|
9621
|
+
* @secure
|
|
9622
|
+
*/
|
|
9623
|
+
listDsr = (params = {}) => this.http.request({
|
|
9624
|
+
path: `/api/v1/dsr`,
|
|
9625
|
+
method: "GET",
|
|
9626
|
+
secure: true,
|
|
9627
|
+
format: "json",
|
|
9628
|
+
...params
|
|
9629
|
+
});
|
|
9091
9630
|
/**
|
|
9092
9631
|
* No description
|
|
9093
9632
|
*
|
|
@@ -9160,6 +9699,22 @@ var Operations = class {
|
|
|
9160
9699
|
format: "json",
|
|
9161
9700
|
...params
|
|
9162
9701
|
});
|
|
9702
|
+
/**
|
|
9703
|
+
* @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).
|
|
9704
|
+
*
|
|
9705
|
+
* @tags operations
|
|
9706
|
+
* @name AntiUnifyBatch
|
|
9707
|
+
* @summary Anti-unify N Ψ-terms (Least General Generalisation of the whole set).
|
|
9708
|
+
* @request POST:/api/v1/operations/anti-unify/batch
|
|
9709
|
+
*/
|
|
9710
|
+
antiUnifyBatch = (data, params = {}) => this.http.request({
|
|
9711
|
+
path: `/api/v1/operations/anti-unify/batch`,
|
|
9712
|
+
method: "POST",
|
|
9713
|
+
body: data,
|
|
9714
|
+
type: "application/json" /* Json */,
|
|
9715
|
+
format: "json",
|
|
9716
|
+
...params
|
|
9717
|
+
});
|
|
9163
9718
|
};
|
|
9164
9719
|
|
|
9165
9720
|
// src/api-spec/generated/Actions.ts
|
|
@@ -9553,6 +10108,24 @@ var OntologyBridge = class {
|
|
|
9553
10108
|
format: "json",
|
|
9554
10109
|
...params
|
|
9555
10110
|
});
|
|
10111
|
+
/**
|
|
10112
|
+
* @description The gap this closes (#133): the engine could lower OSFQL to a source's native language and could execute native queries, and the two were never reachable together over HTTP. `POST /api/v1/osfql` runs against the knowledge base and never consults a binding; `POST /api/v1/ontology/transpile` emits the query text and stops. A `transpile`-mode source — which deliberately ingests nothing — therefore had no way to be queried at all, and asking about its data returned an empty result indistinguishable from a broken connector. The dialect is derived from the source's type, never taken from the caller: the binding says which source answers for the sort, and that source's type is the only dialect that could run. Letting a caller name one would let them ask for Cypher against Postgres. The emitted query is returned with the rows. Transpile mode's claim is that OSFQL becomes a native query against the operator's own database; returning only rows leaves that unverifiable.
|
|
10113
|
+
*
|
|
10114
|
+
* @tags ontology_bridge
|
|
10115
|
+
* @name ExecuteTranspiled
|
|
10116
|
+
* @summary Transpile an OSFQL MATCH and execute it on the source it is bound to.
|
|
10117
|
+
* @request POST:/api/v1/ontology/query
|
|
10118
|
+
* @secure
|
|
10119
|
+
*/
|
|
10120
|
+
executeTranspiled = (data, params = {}) => this.http.request({
|
|
10121
|
+
path: `/api/v1/ontology/query`,
|
|
10122
|
+
method: "POST",
|
|
10123
|
+
body: data,
|
|
10124
|
+
secure: true,
|
|
10125
|
+
type: "application/json" /* Json */,
|
|
10126
|
+
format: "json",
|
|
10127
|
+
...params
|
|
10128
|
+
});
|
|
9556
10129
|
/**
|
|
9557
10130
|
* @description Produces query tools, write tools, and inference tools from the current sort hierarchy and SQL bindings, along with a system prompt suitable for grounding an LLM.
|
|
9558
10131
|
*
|
|
@@ -9622,7 +10195,7 @@ var OntologyBridge = class {
|
|
|
9622
10195
|
...params
|
|
9623
10196
|
});
|
|
9624
10197
|
/**
|
|
9625
|
-
* @description Parses the OSFQL query, compiles it, and transpiles
|
|
10198
|
+
* @description Parses the OSFQL query, compiles it, and transpiles EVERY `ScanBySort` operation into one statement using the current sort-table bindings — a JOIN for the SQL dialects, a multi-pattern MATCH for Cypher. A plan operation that is not a scan is refused by name rather than dropped: `fully_transpilable` is what a caller checks to decide whether the emitted text is the whole question, and it reported `true` for a query half of which was never emitted (#134).
|
|
9626
10199
|
*
|
|
9627
10200
|
* @tags ontology_bridge
|
|
9628
10201
|
* @name Transpile
|
|
@@ -9656,12 +10229,571 @@ var OntologyBridge = class {
|
|
|
9656
10229
|
});
|
|
9657
10230
|
};
|
|
9658
10231
|
|
|
10232
|
+
// src/api-spec/generated/Demo.ts
|
|
10233
|
+
var Demo = class {
|
|
10234
|
+
http;
|
|
10235
|
+
constructor(http) {
|
|
10236
|
+
this.http = http;
|
|
10237
|
+
}
|
|
10238
|
+
/**
|
|
10239
|
+
* @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.
|
|
10240
|
+
*
|
|
10241
|
+
* @tags demo
|
|
10242
|
+
* @name DemoSeed
|
|
10243
|
+
* @summary Seed the request tenant's persistent substrate with full SUMO + the demo scenario situations.
|
|
10244
|
+
* @request POST:/api/v1/demo/seed
|
|
10245
|
+
* @secure
|
|
10246
|
+
*/
|
|
10247
|
+
demoSeed = (data, params = {}) => this.http.request({
|
|
10248
|
+
path: `/api/v1/demo/seed`,
|
|
10249
|
+
method: "POST",
|
|
10250
|
+
body: data,
|
|
10251
|
+
secure: true,
|
|
10252
|
+
type: "application/json" /* Json */,
|
|
10253
|
+
format: "json",
|
|
10254
|
+
...params
|
|
10255
|
+
});
|
|
10256
|
+
};
|
|
10257
|
+
|
|
10258
|
+
// src/api-spec/generated/Reward.ts
|
|
10259
|
+
var Reward = class {
|
|
10260
|
+
http;
|
|
10261
|
+
constructor(http) {
|
|
10262
|
+
this.http = http;
|
|
10263
|
+
}
|
|
10264
|
+
/**
|
|
10265
|
+
* No description
|
|
10266
|
+
*
|
|
10267
|
+
* @tags reward
|
|
10268
|
+
* @name Score
|
|
10269
|
+
* @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.
|
|
10270
|
+
* @request POST:/api/v1/reward/score
|
|
10271
|
+
* @secure
|
|
10272
|
+
*/
|
|
10273
|
+
score = (data, params = {}) => this.http.request({
|
|
10274
|
+
path: `/api/v1/reward/score`,
|
|
10275
|
+
method: "POST",
|
|
10276
|
+
body: data,
|
|
10277
|
+
secure: true,
|
|
10278
|
+
type: "application/json" /* Json */,
|
|
10279
|
+
format: "json",
|
|
10280
|
+
...params
|
|
10281
|
+
});
|
|
10282
|
+
};
|
|
10283
|
+
|
|
10284
|
+
// src/api-spec/generated/Translation.ts
|
|
10285
|
+
var Translation = class {
|
|
10286
|
+
http;
|
|
10287
|
+
constructor(http) {
|
|
10288
|
+
this.http = http;
|
|
10289
|
+
}
|
|
10290
|
+
/**
|
|
10291
|
+
* @description POST /api/v1/translate
|
|
10292
|
+
*
|
|
10293
|
+
* @tags translation
|
|
10294
|
+
* @name Translate
|
|
10295
|
+
* @summary Translate text into a target language.
|
|
10296
|
+
* @request POST:/api/v1/translate
|
|
10297
|
+
* @secure
|
|
10298
|
+
*/
|
|
10299
|
+
translate = (data, params = {}) => this.http.request({
|
|
10300
|
+
path: `/api/v1/translate`,
|
|
10301
|
+
method: "POST",
|
|
10302
|
+
body: data,
|
|
10303
|
+
secure: true,
|
|
10304
|
+
type: "application/json" /* Json */,
|
|
10305
|
+
format: "json",
|
|
10306
|
+
...params
|
|
10307
|
+
});
|
|
10308
|
+
};
|
|
10309
|
+
|
|
10310
|
+
// src/api-spec/generated/Streaming.ts
|
|
10311
|
+
var Streaming = class {
|
|
10312
|
+
http;
|
|
10313
|
+
constructor(http) {
|
|
10314
|
+
this.http = http;
|
|
10315
|
+
}
|
|
10316
|
+
/**
|
|
10317
|
+
* @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.
|
|
10318
|
+
*
|
|
10319
|
+
* @tags streaming
|
|
10320
|
+
* @name Frequency
|
|
10321
|
+
* @summary `POST /api/v1/streaming/frequency`
|
|
10322
|
+
* @request POST:/api/v1/streaming/frequency
|
|
10323
|
+
*/
|
|
10324
|
+
frequency = (data, params = {}) => this.http.request({
|
|
10325
|
+
path: `/api/v1/streaming/frequency`,
|
|
10326
|
+
method: "POST",
|
|
10327
|
+
body: data,
|
|
10328
|
+
type: "application/json" /* Json */,
|
|
10329
|
+
format: "json",
|
|
10330
|
+
...params
|
|
10331
|
+
});
|
|
10332
|
+
/**
|
|
10333
|
+
* @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.
|
|
10334
|
+
*
|
|
10335
|
+
* @tags streaming
|
|
10336
|
+
* @name HeavyHitters
|
|
10337
|
+
* @summary `POST /api/v1/streaming/heavy-hitters`
|
|
10338
|
+
* @request POST:/api/v1/streaming/heavy-hitters
|
|
10339
|
+
*/
|
|
10340
|
+
heavyHitters = (data, params = {}) => this.http.request({
|
|
10341
|
+
path: `/api/v1/streaming/heavy-hitters`,
|
|
10342
|
+
method: "POST",
|
|
10343
|
+
body: data,
|
|
10344
|
+
type: "application/json" /* Json */,
|
|
10345
|
+
format: "json",
|
|
10346
|
+
...params
|
|
10347
|
+
});
|
|
10348
|
+
/**
|
|
10349
|
+
* @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.
|
|
10350
|
+
*
|
|
10351
|
+
* @tags streaming
|
|
10352
|
+
* @name Membership
|
|
10353
|
+
* @summary `POST /api/v1/streaming/membership`
|
|
10354
|
+
* @request POST:/api/v1/streaming/membership
|
|
10355
|
+
*/
|
|
10356
|
+
membership = (data, params = {}) => this.http.request({
|
|
10357
|
+
path: `/api/v1/streaming/membership`,
|
|
10358
|
+
method: "POST",
|
|
10359
|
+
body: data,
|
|
10360
|
+
type: "application/json" /* Json */,
|
|
10361
|
+
format: "json",
|
|
10362
|
+
...params
|
|
10363
|
+
});
|
|
10364
|
+
};
|
|
10365
|
+
|
|
10366
|
+
// src/api-spec/generated/Conformal.ts
|
|
10367
|
+
var Conformal = class {
|
|
10368
|
+
http;
|
|
10369
|
+
constructor(http) {
|
|
10370
|
+
this.http = http;
|
|
10371
|
+
}
|
|
10372
|
+
/**
|
|
10373
|
+
* @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`.
|
|
10374
|
+
*
|
|
10375
|
+
* @tags conformal
|
|
10376
|
+
* @name Calibrate
|
|
10377
|
+
* @summary `POST /api/v1/conformal/calibrate`
|
|
10378
|
+
* @request POST:/api/v1/conformal/calibrate
|
|
10379
|
+
*/
|
|
10380
|
+
calibrate = (data, params = {}) => this.http.request({
|
|
10381
|
+
path: `/api/v1/conformal/calibrate`,
|
|
10382
|
+
method: "POST",
|
|
10383
|
+
body: data,
|
|
10384
|
+
type: "application/json" /* Json */,
|
|
10385
|
+
format: "json",
|
|
10386
|
+
...params
|
|
10387
|
+
});
|
|
10388
|
+
/**
|
|
10389
|
+
* @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.
|
|
10390
|
+
*
|
|
10391
|
+
* @tags conformal
|
|
10392
|
+
* @name Predict
|
|
10393
|
+
* @summary `POST /api/v1/conformal/predict`
|
|
10394
|
+
* @request POST:/api/v1/conformal/predict
|
|
10395
|
+
*/
|
|
10396
|
+
predict = (data, params = {}) => this.http.request({
|
|
10397
|
+
path: `/api/v1/conformal/predict`,
|
|
10398
|
+
method: "POST",
|
|
10399
|
+
body: data,
|
|
10400
|
+
type: "application/json" /* Json */,
|
|
10401
|
+
format: "json",
|
|
10402
|
+
...params
|
|
10403
|
+
});
|
|
10404
|
+
};
|
|
10405
|
+
|
|
10406
|
+
// src/api-spec/generated/Vision.ts
|
|
10407
|
+
var Vision = class {
|
|
10408
|
+
http;
|
|
10409
|
+
constructor(http) {
|
|
10410
|
+
this.http = http;
|
|
10411
|
+
}
|
|
10412
|
+
/**
|
|
10413
|
+
* @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.
|
|
10414
|
+
*
|
|
10415
|
+
* @tags vision
|
|
10416
|
+
* @name EncodeClip
|
|
10417
|
+
* @summary Encode a video clip end-to-end through V-JEPA + the head + the substrate, returning per-frame Ψ-term prediction summaries.
|
|
10418
|
+
* @request POST:/api/v1/vision/encode-clip
|
|
10419
|
+
* @secure
|
|
10420
|
+
*/
|
|
10421
|
+
encodeClip = (data, params = {}) => this.http.request({
|
|
10422
|
+
path: `/api/v1/vision/encode-clip`,
|
|
10423
|
+
method: "POST",
|
|
10424
|
+
body: data,
|
|
10425
|
+
secure: true,
|
|
10426
|
+
type: "application/json" /* Json */,
|
|
10427
|
+
format: "json",
|
|
10428
|
+
...params
|
|
10429
|
+
});
|
|
10430
|
+
};
|
|
10431
|
+
|
|
10432
|
+
// src/api-spec/generated/Anonymization.ts
|
|
10433
|
+
var Anonymization = class {
|
|
10434
|
+
http;
|
|
10435
|
+
constructor(http) {
|
|
10436
|
+
this.http = http;
|
|
10437
|
+
}
|
|
10438
|
+
/**
|
|
10439
|
+
* @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.
|
|
10440
|
+
*
|
|
10441
|
+
* @tags anonymization
|
|
10442
|
+
* @name AnonymizeRecords
|
|
10443
|
+
* @summary `POST /api/v1/anonymize`
|
|
10444
|
+
* @request POST:/api/v1/anonymize
|
|
10445
|
+
* @secure
|
|
10446
|
+
*/
|
|
10447
|
+
anonymizeRecords = (data, params = {}) => this.http.request({
|
|
10448
|
+
path: `/api/v1/anonymize`,
|
|
10449
|
+
method: "POST",
|
|
10450
|
+
body: data,
|
|
10451
|
+
secure: true,
|
|
10452
|
+
type: "application/json" /* Json */,
|
|
10453
|
+
format: "json",
|
|
10454
|
+
...params
|
|
10455
|
+
});
|
|
10456
|
+
};
|
|
10457
|
+
|
|
10458
|
+
// src/api-spec/generated/Speakers.ts
|
|
10459
|
+
var Speakers = class {
|
|
10460
|
+
http;
|
|
10461
|
+
constructor(http) {
|
|
10462
|
+
this.http = http;
|
|
10463
|
+
}
|
|
10464
|
+
/**
|
|
10465
|
+
* @description DELETE /api/v1/speakers/{id}
|
|
10466
|
+
*
|
|
10467
|
+
* @tags speakers
|
|
10468
|
+
* @name DeleteSpeaker
|
|
10469
|
+
* @summary Delete a speaker profile by id.
|
|
10470
|
+
* @request DELETE:/api/v1/speakers/{id}
|
|
10471
|
+
* @secure
|
|
10472
|
+
*/
|
|
10473
|
+
deleteSpeaker = (id, params = {}) => this.http.request({
|
|
10474
|
+
path: `/api/v1/speakers/${id}`,
|
|
10475
|
+
method: "DELETE",
|
|
10476
|
+
secure: true,
|
|
10477
|
+
...params
|
|
10478
|
+
});
|
|
10479
|
+
/**
|
|
10480
|
+
* @description POST /api/v1/speakers/enroll
|
|
10481
|
+
*
|
|
10482
|
+
* @tags speakers
|
|
10483
|
+
* @name EnrollSpeaker
|
|
10484
|
+
* @summary Enroll (or re-enroll) a speaker voiceprint.
|
|
10485
|
+
* @request POST:/api/v1/speakers/enroll
|
|
10486
|
+
* @secure
|
|
10487
|
+
*/
|
|
10488
|
+
enrollSpeaker = (data, params = {}) => this.http.request({
|
|
10489
|
+
path: `/api/v1/speakers/enroll`,
|
|
10490
|
+
method: "POST",
|
|
10491
|
+
body: data,
|
|
10492
|
+
secure: true,
|
|
10493
|
+
type: "application/json" /* Json */,
|
|
10494
|
+
format: "json",
|
|
10495
|
+
...params
|
|
10496
|
+
});
|
|
10497
|
+
/**
|
|
10498
|
+
* @description POST /api/v1/speakers/identify
|
|
10499
|
+
*
|
|
10500
|
+
* @tags speakers
|
|
10501
|
+
* @name IdentifySpeakers
|
|
10502
|
+
* @summary Identify which enrolled voices speak in a piece of audio — no transcript.
|
|
10503
|
+
* @request POST:/api/v1/speakers/identify
|
|
10504
|
+
* @secure
|
|
10505
|
+
*/
|
|
10506
|
+
identifySpeakers = (data, params = {}) => this.http.request({
|
|
10507
|
+
path: `/api/v1/speakers/identify`,
|
|
10508
|
+
method: "POST",
|
|
10509
|
+
body: data,
|
|
10510
|
+
secure: true,
|
|
10511
|
+
type: "application/json" /* Json */,
|
|
10512
|
+
format: "json",
|
|
10513
|
+
...params
|
|
10514
|
+
});
|
|
10515
|
+
/**
|
|
10516
|
+
* @description GET /api/v1/speakers
|
|
10517
|
+
*
|
|
10518
|
+
* @tags speakers
|
|
10519
|
+
* @name ListSpeakers
|
|
10520
|
+
* @summary List the tenant's enrolled speaker profiles (embeddings withheld).
|
|
10521
|
+
* @request GET:/api/v1/speakers
|
|
10522
|
+
* @secure
|
|
10523
|
+
*/
|
|
10524
|
+
listSpeakers = (params = {}) => this.http.request({
|
|
10525
|
+
path: `/api/v1/speakers`,
|
|
10526
|
+
method: "GET",
|
|
10527
|
+
secure: true,
|
|
10528
|
+
format: "json",
|
|
10529
|
+
...params
|
|
10530
|
+
});
|
|
10531
|
+
};
|
|
10532
|
+
|
|
10533
|
+
// src/api-spec/generated/Speech.ts
|
|
10534
|
+
var Speech = class {
|
|
10535
|
+
http;
|
|
10536
|
+
constructor(http) {
|
|
10537
|
+
this.http = http;
|
|
10538
|
+
}
|
|
10539
|
+
/**
|
|
10540
|
+
* @description DELETE /api/v1/speech/voices/{id}
|
|
10541
|
+
*
|
|
10542
|
+
* @tags speech
|
|
10543
|
+
* @name DeleteVoice
|
|
10544
|
+
* @summary Delete a cloned voice, upstream conditioning included.
|
|
10545
|
+
* @request DELETE:/api/v1/speech/voices/{id}
|
|
10546
|
+
* @secure
|
|
10547
|
+
*/
|
|
10548
|
+
deleteVoice = (id, params = {}) => this.http.request({
|
|
10549
|
+
path: `/api/v1/speech/voices/${id}`,
|
|
10550
|
+
method: "DELETE",
|
|
10551
|
+
secure: true,
|
|
10552
|
+
...params
|
|
10553
|
+
});
|
|
10554
|
+
/**
|
|
10555
|
+
* @description POST /api/v1/speech/voices
|
|
10556
|
+
*
|
|
10557
|
+
* @tags speech
|
|
10558
|
+
* @name EnrollVoice
|
|
10559
|
+
* @summary Enroll (or re-enroll) a cloned voice.
|
|
10560
|
+
* @request POST:/api/v1/speech/voices
|
|
10561
|
+
* @secure
|
|
10562
|
+
*/
|
|
10563
|
+
enrollVoice = (data, params = {}) => this.http.request({
|
|
10564
|
+
path: `/api/v1/speech/voices`,
|
|
10565
|
+
method: "POST",
|
|
10566
|
+
body: data,
|
|
10567
|
+
secure: true,
|
|
10568
|
+
type: "application/json" /* Json */,
|
|
10569
|
+
format: "json",
|
|
10570
|
+
...params
|
|
10571
|
+
});
|
|
10572
|
+
/**
|
|
10573
|
+
* @description GET /api/v1/speech/engines
|
|
10574
|
+
*
|
|
10575
|
+
* @tags speech
|
|
10576
|
+
* @name ListEngines
|
|
10577
|
+
* @summary Report per-engine availability.
|
|
10578
|
+
* @request GET:/api/v1/speech/engines
|
|
10579
|
+
* @secure
|
|
10580
|
+
*/
|
|
10581
|
+
listEngines = (params = {}) => this.http.request({
|
|
10582
|
+
path: `/api/v1/speech/engines`,
|
|
10583
|
+
method: "GET",
|
|
10584
|
+
secure: true,
|
|
10585
|
+
format: "json",
|
|
10586
|
+
...params
|
|
10587
|
+
});
|
|
10588
|
+
/**
|
|
10589
|
+
* @description GET /api/v1/speech/voices
|
|
10590
|
+
*
|
|
10591
|
+
* @tags speech
|
|
10592
|
+
* @name ListVoices
|
|
10593
|
+
* @summary List the tenant's cloned voices plus available presets.
|
|
10594
|
+
* @request GET:/api/v1/speech/voices
|
|
10595
|
+
* @secure
|
|
10596
|
+
*/
|
|
10597
|
+
listVoices = (params = {}) => this.http.request({
|
|
10598
|
+
path: `/api/v1/speech/voices`,
|
|
10599
|
+
method: "GET",
|
|
10600
|
+
secure: true,
|
|
10601
|
+
format: "json",
|
|
10602
|
+
...params
|
|
10603
|
+
});
|
|
10604
|
+
/**
|
|
10605
|
+
* @description POST /api/v1/speech/session
|
|
10606
|
+
*
|
|
10607
|
+
* @tags speech
|
|
10608
|
+
* @name OpenSpeechSession
|
|
10609
|
+
* @summary Open a speech-to-speech session.
|
|
10610
|
+
* @request POST:/api/v1/speech/session
|
|
10611
|
+
* @secure
|
|
10612
|
+
*/
|
|
10613
|
+
openSpeechSession = (data, params = {}) => this.http.request({
|
|
10614
|
+
path: `/api/v1/speech/session`,
|
|
10615
|
+
method: "POST",
|
|
10616
|
+
body: data,
|
|
10617
|
+
secure: true,
|
|
10618
|
+
type: "application/json" /* Json */,
|
|
10619
|
+
format: "json",
|
|
10620
|
+
...params
|
|
10621
|
+
});
|
|
10622
|
+
/**
|
|
10623
|
+
* @description POST /api/v1/speech/synthesize
|
|
10624
|
+
*
|
|
10625
|
+
* @tags speech
|
|
10626
|
+
* @name SynthesizeSpeech
|
|
10627
|
+
* @summary Synthesize speech.
|
|
10628
|
+
* @request POST:/api/v1/speech/synthesize
|
|
10629
|
+
* @secure
|
|
10630
|
+
*/
|
|
10631
|
+
synthesizeSpeech = (data, params = {}) => this.http.request({
|
|
10632
|
+
path: `/api/v1/speech/synthesize`,
|
|
10633
|
+
method: "POST",
|
|
10634
|
+
body: data,
|
|
10635
|
+
secure: true,
|
|
10636
|
+
type: "application/json" /* Json */,
|
|
10637
|
+
...params
|
|
10638
|
+
});
|
|
10639
|
+
/**
|
|
10640
|
+
* @description POST /api/v1/speech/transcribe
|
|
10641
|
+
*
|
|
10642
|
+
* @tags speech
|
|
10643
|
+
* @name TranscribeSpeech
|
|
10644
|
+
* @summary Transcribe a short utterance.
|
|
10645
|
+
* @request POST:/api/v1/speech/transcribe
|
|
10646
|
+
* @secure
|
|
10647
|
+
*/
|
|
10648
|
+
transcribeSpeech = (data, params = {}) => this.http.request({
|
|
10649
|
+
path: `/api/v1/speech/transcribe`,
|
|
10650
|
+
method: "POST",
|
|
10651
|
+
body: data,
|
|
10652
|
+
secure: true,
|
|
10653
|
+
type: "application/json" /* Json */,
|
|
10654
|
+
format: "json",
|
|
10655
|
+
...params
|
|
10656
|
+
});
|
|
10657
|
+
};
|
|
10658
|
+
|
|
10659
|
+
// src/api-spec/generated/Connectors.ts
|
|
10660
|
+
var Connectors = class {
|
|
10661
|
+
http;
|
|
10662
|
+
constructor(http) {
|
|
10663
|
+
this.http = http;
|
|
10664
|
+
}
|
|
10665
|
+
/**
|
|
10666
|
+
* @description POST /api/v1/connectors/manage
|
|
10667
|
+
*
|
|
10668
|
+
* @tags connectors
|
|
10669
|
+
* @name Add
|
|
10670
|
+
* @summary Add a connector instance to the tenant.
|
|
10671
|
+
* @request POST:/api/v1/connectors/manage
|
|
10672
|
+
* @secure
|
|
10673
|
+
*/
|
|
10674
|
+
add = (data, params = {}) => this.http.request({
|
|
10675
|
+
path: `/api/v1/connectors/manage`,
|
|
10676
|
+
method: "POST",
|
|
10677
|
+
body: data,
|
|
10678
|
+
secure: true,
|
|
10679
|
+
type: "application/json" /* Json */,
|
|
10680
|
+
format: "json",
|
|
10681
|
+
...params
|
|
10682
|
+
});
|
|
10683
|
+
/**
|
|
10684
|
+
* @description POST /api/v1/connectors/manage/{name}/disconnect
|
|
10685
|
+
*
|
|
10686
|
+
* @tags connectors
|
|
10687
|
+
* @name Disconnect
|
|
10688
|
+
* @summary Disconnect a connector (revoke tokens, set status=disconnected).
|
|
10689
|
+
* @request POST:/api/v1/connectors/manage/{name}/disconnect
|
|
10690
|
+
* @secure
|
|
10691
|
+
*/
|
|
10692
|
+
disconnect = (name, params = {}) => this.http.request({
|
|
10693
|
+
path: `/api/v1/connectors/manage/${name}/disconnect`,
|
|
10694
|
+
method: "POST",
|
|
10695
|
+
secure: true,
|
|
10696
|
+
...params
|
|
10697
|
+
});
|
|
10698
|
+
/**
|
|
10699
|
+
* @description GET /api/v1/connectors/manage
|
|
10700
|
+
*
|
|
10701
|
+
* @tags connectors
|
|
10702
|
+
* @name List
|
|
10703
|
+
* @summary List tenant's connectors.
|
|
10704
|
+
* @request GET:/api/v1/connectors/manage
|
|
10705
|
+
* @secure
|
|
10706
|
+
*/
|
|
10707
|
+
list = (params = {}) => this.http.request({
|
|
10708
|
+
path: `/api/v1/connectors/manage`,
|
|
10709
|
+
method: "GET",
|
|
10710
|
+
secure: true,
|
|
10711
|
+
format: "json",
|
|
10712
|
+
...params
|
|
10713
|
+
});
|
|
10714
|
+
/**
|
|
10715
|
+
* @description GET /api/v1/connector-types
|
|
10716
|
+
*
|
|
10717
|
+
* @tags connectors
|
|
10718
|
+
* @name ListTypes
|
|
10719
|
+
* @summary List available connector types (global catalog).
|
|
10720
|
+
* @request GET:/api/v1/connector-types
|
|
10721
|
+
*/
|
|
10722
|
+
listTypes = (params = {}) => this.http.request({
|
|
10723
|
+
path: `/api/v1/connector-types`,
|
|
10724
|
+
method: "GET",
|
|
10725
|
+
format: "json",
|
|
10726
|
+
...params
|
|
10727
|
+
});
|
|
10728
|
+
/**
|
|
10729
|
+
* @description GET /api/v1/connectors/manage/{name}/oauth/callback
|
|
10730
|
+
*
|
|
10731
|
+
* @tags connectors
|
|
10732
|
+
* @name OauthCallback
|
|
10733
|
+
* @summary OAuth callback — exchanges code for tokens, returns HTML that posts message to opener.
|
|
10734
|
+
* @request GET:/api/v1/connectors/manage/{name}/oauth/callback
|
|
10735
|
+
*/
|
|
10736
|
+
oauthCallback = (name, query, params = {}) => this.http.request({
|
|
10737
|
+
path: `/api/v1/connectors/manage/${name}/oauth/callback`,
|
|
10738
|
+
method: "GET",
|
|
10739
|
+
query,
|
|
10740
|
+
...params
|
|
10741
|
+
});
|
|
10742
|
+
/**
|
|
10743
|
+
* @description DELETE /api/v1/connectors/manage/{name}
|
|
10744
|
+
*
|
|
10745
|
+
* @tags connectors
|
|
10746
|
+
* @name Remove
|
|
10747
|
+
* @summary Remove a connector from the tenant (cascades: deletes tokens).
|
|
10748
|
+
* @request DELETE:/api/v1/connectors/manage/{name}
|
|
10749
|
+
* @secure
|
|
10750
|
+
*/
|
|
10751
|
+
remove = (name, params = {}) => this.http.request({
|
|
10752
|
+
path: `/api/v1/connectors/manage/${name}`,
|
|
10753
|
+
method: "DELETE",
|
|
10754
|
+
secure: true,
|
|
10755
|
+
...params
|
|
10756
|
+
});
|
|
10757
|
+
/**
|
|
10758
|
+
* @description POST /api/v1/connectors/manage/{name}/connect
|
|
10759
|
+
*
|
|
10760
|
+
* @tags connectors
|
|
10761
|
+
* @name StartOauth
|
|
10762
|
+
* @summary Start OAuth flow — returns auth URL for popup.
|
|
10763
|
+
* @request POST:/api/v1/connectors/manage/{name}/connect
|
|
10764
|
+
* @secure
|
|
10765
|
+
*/
|
|
10766
|
+
startOauth = (name, params = {}) => this.http.request({
|
|
10767
|
+
path: `/api/v1/connectors/manage/${name}/connect`,
|
|
10768
|
+
method: "POST",
|
|
10769
|
+
secure: true,
|
|
10770
|
+
format: "json",
|
|
10771
|
+
...params
|
|
10772
|
+
});
|
|
10773
|
+
};
|
|
10774
|
+
|
|
9659
10775
|
// src/api-spec/generated/Documents.ts
|
|
9660
10776
|
var Documents = class {
|
|
9661
10777
|
http;
|
|
9662
10778
|
constructor(http) {
|
|
9663
10779
|
this.http = http;
|
|
9664
10780
|
}
|
|
10781
|
+
/**
|
|
10782
|
+
* No description
|
|
10783
|
+
*
|
|
10784
|
+
* @tags documents
|
|
10785
|
+
* @name EraseDocument
|
|
10786
|
+
* @summary Erase a document and everything extracted from it
|
|
10787
|
+
* @request DELETE:/api/v1/documents/{id}
|
|
10788
|
+
* @secure
|
|
10789
|
+
*/
|
|
10790
|
+
eraseDocument = (id, params = {}) => this.http.request({
|
|
10791
|
+
path: `/api/v1/documents/${id}`,
|
|
10792
|
+
method: "DELETE",
|
|
10793
|
+
secure: true,
|
|
10794
|
+
format: "json",
|
|
10795
|
+
...params
|
|
10796
|
+
});
|
|
9665
10797
|
/**
|
|
9666
10798
|
* No description
|
|
9667
10799
|
*
|
|
@@ -11121,6 +12253,15 @@ function RejectLearnedSimilarityResponseFromApiToFront(dto) {
|
|
|
11121
12253
|
message: dto.message
|
|
11122
12254
|
};
|
|
11123
12255
|
}
|
|
12256
|
+
function SortIndexStatusResponseFromApiToFront(dto) {
|
|
12257
|
+
const out = {
|
|
12258
|
+
running: dto.running,
|
|
12259
|
+
totalSorts: dto.total_sorts
|
|
12260
|
+
};
|
|
12261
|
+
if (dto.last_error != null) out.lastError = dto.last_error;
|
|
12262
|
+
if (dto.last_indexed_count != null) out.lastIndexedCount = dto.last_indexed_count;
|
|
12263
|
+
return out;
|
|
12264
|
+
}
|
|
11124
12265
|
|
|
11125
12266
|
// src/resources/sorts.ts
|
|
11126
12267
|
var SortsClient = class {
|
|
@@ -11336,6 +12477,16 @@ var SortsClient = class {
|
|
|
11336
12477
|
async indexSorts() {
|
|
11337
12478
|
await this.sorts.indexSorts();
|
|
11338
12479
|
}
|
|
12480
|
+
/**
|
|
12481
|
+
* Report the status of the background sort-indexing pass.
|
|
12482
|
+
*
|
|
12483
|
+
* @returns Whether a re-index is running, the most recent run's indexed
|
|
12484
|
+
* count and any error, plus the total data-sort denominator.
|
|
12485
|
+
*/
|
|
12486
|
+
async sortIndexStatus() {
|
|
12487
|
+
const response = await this.sorts.sortIndexStatus();
|
|
12488
|
+
return SortIndexStatusResponseFromApiToFront(response.data);
|
|
12489
|
+
}
|
|
11339
12490
|
/**
|
|
11340
12491
|
* Update the review status of a sort.
|
|
11341
12492
|
*
|
|
@@ -14687,6 +15838,25 @@ function FindSimilarRequestFromFrontToApi(model) {
|
|
|
14687
15838
|
fail_on_unknown: model.failOnUnknown
|
|
14688
15839
|
};
|
|
14689
15840
|
}
|
|
15841
|
+
function ScoreTermsRequestFromFrontToApi(model) {
|
|
15842
|
+
return {
|
|
15843
|
+
...QueryTermFromFrontToApi(model),
|
|
15844
|
+
fail_on_unknown: model.failOnUnknown,
|
|
15845
|
+
similarity_mode: model.similarityMode,
|
|
15846
|
+
term_ids: model.termIds
|
|
15847
|
+
};
|
|
15848
|
+
}
|
|
15849
|
+
function ScoredTermFromApiToFront(dto) {
|
|
15850
|
+
return {
|
|
15851
|
+
degree: dto.degree,
|
|
15852
|
+
termId: dto.term_id
|
|
15853
|
+
};
|
|
15854
|
+
}
|
|
15855
|
+
function ScoreTermsResponseFromApiToFront(dto) {
|
|
15856
|
+
return {
|
|
15857
|
+
scores: dto.scores.map(ScoredTermFromApiToFront)
|
|
15858
|
+
};
|
|
15859
|
+
}
|
|
14690
15860
|
function SimilarityMatchFromApiToFront(dto) {
|
|
14691
15861
|
return {
|
|
14692
15862
|
confidencePercent: dto.confidence_percent,
|
|
@@ -14857,6 +16027,18 @@ var FuzzyClient = class {
|
|
|
14857
16027
|
});
|
|
14858
16028
|
return PredictEffectResponseFromApiToFront(response.data);
|
|
14859
16029
|
}
|
|
16030
|
+
/**
|
|
16031
|
+
* Score a given set of candidate terms against a query ψ-term.
|
|
16032
|
+
*
|
|
16033
|
+
* @param request - The query ψ-term (`QueryTerm`) plus the candidate
|
|
16034
|
+
* `termIds` and optional scoring knobs.
|
|
16035
|
+
* @returns The candidates with their fuzzy-unification degrees, in
|
|
16036
|
+
* input order.
|
|
16037
|
+
*/
|
|
16038
|
+
async scoreTerms(request) {
|
|
16039
|
+
const response = await this.api.scoreTerms(ScoreTermsRequestFromFrontToApi(request));
|
|
16040
|
+
return ScoreTermsResponseFromApiToFront(response.data);
|
|
16041
|
+
}
|
|
14860
16042
|
};
|
|
14861
16043
|
|
|
14862
16044
|
// src/normalizers/visualization.ts
|
|
@@ -18472,6 +19654,35 @@ function IngestRdfRequestFromFrontToApi(model) {
|
|
|
18472
19654
|
parse_shacl: model.parseShacl
|
|
18473
19655
|
};
|
|
18474
19656
|
}
|
|
19657
|
+
function IngestKifRequestFromFrontToApi(model) {
|
|
19658
|
+
const dto = { content: model.content };
|
|
19659
|
+
if (model.goal !== void 0) dto.goal = model.goal;
|
|
19660
|
+
if (model.persist !== void 0) dto.persist = model.persist;
|
|
19661
|
+
if (model.query !== void 0) dto.query = model.query;
|
|
19662
|
+
return dto;
|
|
19663
|
+
}
|
|
19664
|
+
function IngestKifResponseFromApiToFront(dto) {
|
|
19665
|
+
const out = {
|
|
19666
|
+
capturedNonHorn: dto.captured_non_horn,
|
|
19667
|
+
constraintRules: dto.constraint_rules,
|
|
19668
|
+
disjunctiveRules: dto.disjunctive_rules,
|
|
19669
|
+
facts: dto.facts,
|
|
19670
|
+
forms: dto.forms,
|
|
19671
|
+
hornRules: dto.horn_rules,
|
|
19672
|
+
instantiatedRules: dto.instantiated_rules,
|
|
19673
|
+
nafRules: dto.naf_rules,
|
|
19674
|
+
residueByShape: dto.residue_by_shape,
|
|
19675
|
+
residueExamples: dto.residue_examples,
|
|
19676
|
+
rules: dto.rules,
|
|
19677
|
+
skolemized: dto.skolemized,
|
|
19678
|
+
sorts: dto.sorts,
|
|
19679
|
+
subclassEdges: dto.subclass_edges,
|
|
19680
|
+
success: dto.success,
|
|
19681
|
+
temporalDetached: dto.temporal_detached
|
|
19682
|
+
};
|
|
19683
|
+
if (dto.provable != null) out.provable = dto.provable;
|
|
19684
|
+
return out;
|
|
19685
|
+
}
|
|
18475
19686
|
function TranslateRdfRequestFromFrontToApi(model) {
|
|
18476
19687
|
return {
|
|
18477
19688
|
content: model.content,
|
|
@@ -18801,20 +20012,21 @@ var IngestionSession = class {
|
|
|
18801
20012
|
}));
|
|
18802
20013
|
return;
|
|
18803
20014
|
}
|
|
18804
|
-
|
|
20015
|
+
let onAbort;
|
|
20016
|
+
const timer = setTimeout(() => {
|
|
20017
|
+
if (signal && onAbort) {
|
|
20018
|
+
signal.removeEventListener("abort", onAbort);
|
|
20019
|
+
}
|
|
20020
|
+
resolve();
|
|
20021
|
+
}, ms);
|
|
18805
20022
|
if (signal) {
|
|
18806
|
-
|
|
20023
|
+
onAbort = () => {
|
|
18807
20024
|
clearTimeout(timer);
|
|
18808
20025
|
reject(new ReasoningLayerError("Ingestion polling was aborted", {
|
|
18809
20026
|
cause: signal.reason
|
|
18810
20027
|
}));
|
|
18811
20028
|
};
|
|
18812
20029
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
18813
|
-
const originalResolve = resolve;
|
|
18814
|
-
resolve = () => {
|
|
18815
|
-
signal.removeEventListener("abort", onAbort);
|
|
18816
|
-
originalResolve();
|
|
18817
|
-
};
|
|
18818
20030
|
}
|
|
18819
20031
|
});
|
|
18820
20032
|
}
|
|
@@ -18918,6 +20130,21 @@ var IngestionClient = class {
|
|
|
18918
20130
|
);
|
|
18919
20131
|
return IngestRdfResponseFromApiToFront(response.data);
|
|
18920
20132
|
}
|
|
20133
|
+
/**
|
|
20134
|
+
* Import SUO-KIF and, optionally, prove a ground goal against the
|
|
20135
|
+
* imported axioms.
|
|
20136
|
+
*
|
|
20137
|
+
* @param request - The SUO-KIF source, an optional `goal`/`query` to
|
|
20138
|
+
* prove, and a `persist` flag (import into the tenant substrate vs an
|
|
20139
|
+
* ephemeral request-scoped world).
|
|
20140
|
+
* @returns Import counts (forms, facts, rules, sorts, …) plus, when a
|
|
20141
|
+
* goal/query was supplied, a `provable` verdict and the non-firing
|
|
20142
|
+
* residue breakdown.
|
|
20143
|
+
*/
|
|
20144
|
+
async ingestKif(request) {
|
|
20145
|
+
const response = await this.api.ingestKif(IngestKifRequestFromFrontToApi(request));
|
|
20146
|
+
return IngestKifResponseFromApiToFront(response.data);
|
|
20147
|
+
}
|
|
18921
20148
|
/**
|
|
18922
20149
|
* Translate RDF into the engine's term representation without writing
|
|
18923
20150
|
* anything to the knowledge base.
|
|
@@ -21533,6 +22760,66 @@ function SearchCommunitiesResponseFromApiToFront(dto) {
|
|
|
21533
22760
|
stats: CommunitySearchStatsDtoFromApiToFront(dto.stats)
|
|
21534
22761
|
};
|
|
21535
22762
|
}
|
|
22763
|
+
function NodeScoreFromApiToFront(dto) {
|
|
22764
|
+
return {
|
|
22765
|
+
nodeId: dto.node_id,
|
|
22766
|
+
score: dto.score
|
|
22767
|
+
};
|
|
22768
|
+
}
|
|
22769
|
+
function CentralityRequestFromFrontToApi(model) {
|
|
22770
|
+
const dto = {
|
|
22771
|
+
measure: model.measure,
|
|
22772
|
+
tenant_id: model.tenantId
|
|
22773
|
+
};
|
|
22774
|
+
if (model.topK !== void 0) dto.top_k = model.topK;
|
|
22775
|
+
return dto;
|
|
22776
|
+
}
|
|
22777
|
+
function CentralityResponseFromApiToFront(dto) {
|
|
22778
|
+
return {
|
|
22779
|
+
edgeCount: dto.edge_count,
|
|
22780
|
+
measure: dto.measure,
|
|
22781
|
+
nodeCount: dto.node_count,
|
|
22782
|
+
scores: dto.scores.map(NodeScoreFromApiToFront)
|
|
22783
|
+
};
|
|
22784
|
+
}
|
|
22785
|
+
function CohesionRequestFromFrontToApi(model) {
|
|
22786
|
+
return { tenant_id: model.tenantId };
|
|
22787
|
+
}
|
|
22788
|
+
function CohesionResponseFromApiToFront(dto) {
|
|
22789
|
+
return {
|
|
22790
|
+
clustering: dto.clustering.map(NodeScoreFromApiToFront),
|
|
22791
|
+
nodeCount: dto.node_count,
|
|
22792
|
+
triangleCount: dto.triangle_count
|
|
22793
|
+
};
|
|
22794
|
+
}
|
|
22795
|
+
function PathRequestFromFrontToApi(model) {
|
|
22796
|
+
return {
|
|
22797
|
+
source: model.source,
|
|
22798
|
+
target: model.target,
|
|
22799
|
+
tenant_id: model.tenantId
|
|
22800
|
+
};
|
|
22801
|
+
}
|
|
22802
|
+
function PathResponseFromApiToFront(dto) {
|
|
22803
|
+
const out = { componentCount: dto.component_count };
|
|
22804
|
+
if (dto.path !== void 0 && dto.path !== null) out.path = dto.path;
|
|
22805
|
+
return out;
|
|
22806
|
+
}
|
|
22807
|
+
function LinkPredictionRequestFromFrontToApi(model) {
|
|
22808
|
+
const dto = {
|
|
22809
|
+
measure: model.measure,
|
|
22810
|
+
source: model.source,
|
|
22811
|
+
tenant_id: model.tenantId
|
|
22812
|
+
};
|
|
22813
|
+
if (model.topK !== void 0) dto.top_k = model.topK;
|
|
22814
|
+
return dto;
|
|
22815
|
+
}
|
|
22816
|
+
function LinkPredictionResponseFromApiToFront(dto) {
|
|
22817
|
+
return {
|
|
22818
|
+
measure: dto.measure,
|
|
22819
|
+
predictions: dto.predictions.map(NodeScoreFromApiToFront),
|
|
22820
|
+
source: dto.source
|
|
22821
|
+
};
|
|
22822
|
+
}
|
|
21536
22823
|
|
|
21537
22824
|
// src/resources/communities.ts
|
|
21538
22825
|
var CommunitiesClient = class {
|
|
@@ -21572,6 +22859,48 @@ var CommunitiesClient = class {
|
|
|
21572
22859
|
const response = await this.api.searchCommunities(SearchCommunitiesRequestFromFrontToApi(request));
|
|
21573
22860
|
return SearchCommunitiesResponseFromApiToFront(response.data);
|
|
21574
22861
|
}
|
|
22862
|
+
/**
|
|
22863
|
+
* Compute a centrality measure over the tenant's term graph.
|
|
22864
|
+
*
|
|
22865
|
+
* @param request - The measure, tenant id, and an optional `topK` cap.
|
|
22866
|
+
* @returns Node scores sorted descending, plus graph node/edge counts.
|
|
22867
|
+
*/
|
|
22868
|
+
async computeCentrality(request) {
|
|
22869
|
+
const response = await this.api.computeCentrality(CentralityRequestFromFrontToApi(request));
|
|
22870
|
+
return CentralityResponseFromApiToFront(response.data);
|
|
22871
|
+
}
|
|
22872
|
+
/**
|
|
22873
|
+
* Compute graph cohesion (local clustering coefficients + triangle count).
|
|
22874
|
+
*
|
|
22875
|
+
* @param request - The tenant id.
|
|
22876
|
+
* @returns Per-node clustering coefficients, node count, and triangle count.
|
|
22877
|
+
*/
|
|
22878
|
+
async computeCohesion(request) {
|
|
22879
|
+
const response = await this.api.computeCohesion(CohesionRequestFromFrontToApi(request));
|
|
22880
|
+
return CohesionResponseFromApiToFront(response.data);
|
|
22881
|
+
}
|
|
22882
|
+
/**
|
|
22883
|
+
* Find the shortest path between two nodes in the tenant's term graph.
|
|
22884
|
+
*
|
|
22885
|
+
* @param request - Source node, target node, and tenant id.
|
|
22886
|
+
* @returns The shortest path as a node sequence (when reachable) plus the
|
|
22887
|
+
* connected-component count.
|
|
22888
|
+
*/
|
|
22889
|
+
async computePath(request) {
|
|
22890
|
+
const response = await this.api.computePath(PathRequestFromFrontToApi(request));
|
|
22891
|
+
return PathResponseFromApiToFront(response.data);
|
|
22892
|
+
}
|
|
22893
|
+
/**
|
|
22894
|
+
* Predict candidate links from a source node using a graph heuristic.
|
|
22895
|
+
*
|
|
22896
|
+
* @param request - The heuristic, source node, tenant id, and an optional
|
|
22897
|
+
* `topK` cap.
|
|
22898
|
+
* @returns Candidate targets with positive score, sorted descending.
|
|
22899
|
+
*/
|
|
22900
|
+
async predictLinks(request) {
|
|
22901
|
+
const response = await this.api.predictLinks(LinkPredictionRequestFromFrontToApi(request));
|
|
22902
|
+
return LinkPredictionResponseFromApiToFront(response.data);
|
|
22903
|
+
}
|
|
21575
22904
|
};
|
|
21576
22905
|
|
|
21577
22906
|
// src/normalizers/utilities.ts
|
|
@@ -22404,6 +23733,33 @@ function PredictFromDiscoveryResponseFromApiToFront(dto) {
|
|
|
22404
23733
|
success: dto.success
|
|
22405
23734
|
};
|
|
22406
23735
|
}
|
|
23736
|
+
function EmlSampleFromFrontToApi(model) {
|
|
23737
|
+
return {
|
|
23738
|
+
inputs: model.inputs,
|
|
23739
|
+
target: model.target
|
|
23740
|
+
};
|
|
23741
|
+
}
|
|
23742
|
+
function DiscoverEmlRequestFromFrontToApi(model) {
|
|
23743
|
+
const dto = {
|
|
23744
|
+
depth: model.depth,
|
|
23745
|
+
samples: model.samples.map(EmlSampleFromFrontToApi)
|
|
23746
|
+
};
|
|
23747
|
+
if (model.maxEpochs !== void 0) dto.max_epochs = model.maxEpochs;
|
|
23748
|
+
if (model.numRestarts !== void 0) dto.num_restarts = model.numRestarts;
|
|
23749
|
+
return dto;
|
|
23750
|
+
}
|
|
23751
|
+
function DiscoverEmlResponseFromApiToFront(dto) {
|
|
23752
|
+
const out = {
|
|
23753
|
+
epochsRun: dto.epochs_run,
|
|
23754
|
+
finalLoss: dto.final_loss,
|
|
23755
|
+
snapped: dto.snapped,
|
|
23756
|
+
success: dto.success
|
|
23757
|
+
};
|
|
23758
|
+
if (dto.expression_depth != null) out.expressionDepth = dto.expression_depth;
|
|
23759
|
+
if (dto.expression_leaf_count != null) out.expressionLeafCount = dto.expression_leaf_count;
|
|
23760
|
+
if (dto.expression_rpn != null) out.expressionRpn = dto.expression_rpn;
|
|
23761
|
+
return out;
|
|
23762
|
+
}
|
|
22407
23763
|
|
|
22408
23764
|
// src/resources/discovery.ts
|
|
22409
23765
|
var DiscoveryClient = class {
|
|
@@ -22433,6 +23789,19 @@ var DiscoveryClient = class {
|
|
|
22433
23789
|
const response = await this.api.predictFromDiscovery(PredictFromDiscoveryRequestFromFrontToApi(request));
|
|
22434
23790
|
return PredictFromDiscoveryResponseFromApiToFront(response.data);
|
|
22435
23791
|
}
|
|
23792
|
+
/**
|
|
23793
|
+
* Discover a closed-form expression from samples via parameterised EML.
|
|
23794
|
+
*
|
|
23795
|
+
* @param request - Tree-depth bound, training samples, and optional
|
|
23796
|
+
* epoch/restart caps.
|
|
23797
|
+
* @returns The discovered expression (RPN + depth/leaf-count when
|
|
23798
|
+
* recovered) plus the training stats (epochs, final loss, snap +
|
|
23799
|
+
* success flags).
|
|
23800
|
+
*/
|
|
23801
|
+
async discoverEml(request) {
|
|
23802
|
+
const response = await this.api.discoverEml(DiscoverEmlRequestFromFrontToApi(request));
|
|
23803
|
+
return DiscoverEmlResponseFromApiToFront(response.data);
|
|
23804
|
+
}
|
|
22436
23805
|
};
|
|
22437
23806
|
|
|
22438
23807
|
// src/normalizers/extract.ts
|
|
@@ -25670,6 +27039,56 @@ function GenerateDocumentResponseFromApiToFront(dto) {
|
|
|
25670
27039
|
verification: dto.verification ? VerificationDtoFromApiToFront(dto.verification) : void 0
|
|
25671
27040
|
};
|
|
25672
27041
|
}
|
|
27042
|
+
function ConstrainedGenerateRequestFromFrontToApi(model) {
|
|
27043
|
+
const dto = {
|
|
27044
|
+
allowed: model.allowed,
|
|
27045
|
+
prompt: model.prompt
|
|
27046
|
+
};
|
|
27047
|
+
if (model.maxTokens !== void 0) dto.max_tokens = model.maxTokens;
|
|
27048
|
+
return dto;
|
|
27049
|
+
}
|
|
27050
|
+
function ConstrainedGenerateResponseFromApiToFront(dto) {
|
|
27051
|
+
return {
|
|
27052
|
+
allowed: dto.allowed,
|
|
27053
|
+
answer: dto.answer,
|
|
27054
|
+
maskedOut: dto.masked_out,
|
|
27055
|
+
tokens: dto.tokens
|
|
27056
|
+
};
|
|
27057
|
+
}
|
|
27058
|
+
function RawGenerateRequestFromFrontToApi(model) {
|
|
27059
|
+
const dto = { prompt: model.prompt };
|
|
27060
|
+
if (model.maxTokens !== void 0) dto.max_tokens = model.maxTokens;
|
|
27061
|
+
return dto;
|
|
27062
|
+
}
|
|
27063
|
+
function RawGenerateResponseFromApiToFront(dto) {
|
|
27064
|
+
return { prose: dto.prose };
|
|
27065
|
+
}
|
|
27066
|
+
function GroundedGenerateRequestFromFrontToApi(model) {
|
|
27067
|
+
const dto = { prompt: model.prompt };
|
|
27068
|
+
if (model.goalDest !== void 0) dto.goal_dest = model.goalDest;
|
|
27069
|
+
if (model.goalDistance !== void 0) dto.goal_distance = model.goalDistance;
|
|
27070
|
+
if (model.goalFeasible !== void 0) dto.goal_feasible = model.goalFeasible;
|
|
27071
|
+
if (model.goalTarget !== void 0) dto.goal_target = model.goalTarget;
|
|
27072
|
+
if (model.maxTokens !== void 0) dto.max_tokens = model.maxTokens;
|
|
27073
|
+
if (model.mode !== void 0) dto.mode = model.mode;
|
|
27074
|
+
if (model.prose !== void 0) dto.prose = model.prose;
|
|
27075
|
+
if (model.steerMargin !== void 0) dto.steer_margin = model.steerMargin;
|
|
27076
|
+
return dto;
|
|
27077
|
+
}
|
|
27078
|
+
function GroundedGenerateResponseFromApiToFront(dto) {
|
|
27079
|
+
const out = {
|
|
27080
|
+
admittedTerms: dto.admitted_terms,
|
|
27081
|
+
derivation: dto.derivation,
|
|
27082
|
+
feasibleModes: dto.feasible_modes,
|
|
27083
|
+
mode: dto.mode,
|
|
27084
|
+
prose: dto.prose,
|
|
27085
|
+
refutedModes: dto.refuted_modes
|
|
27086
|
+
};
|
|
27087
|
+
if (dto.certify_outcome != null) out.certifyOutcome = dto.certify_outcome;
|
|
27088
|
+
if (dto.model_pick != null) out.modelPick = dto.model_pick;
|
|
27089
|
+
if (dto.recommended_mode != null) out.recommendedMode = dto.recommended_mode;
|
|
27090
|
+
return out;
|
|
27091
|
+
}
|
|
25673
27092
|
|
|
25674
27093
|
// src/resources/generation.ts
|
|
25675
27094
|
var GenerationClient = class {
|
|
@@ -25712,6 +27131,46 @@ var GenerationClient = class {
|
|
|
25712
27131
|
const response = await this.api.generateDocument(GenerateDocumentRequestFromFrontToApi(request));
|
|
25713
27132
|
return GenerateDocumentResponseFromApiToFront(response.data);
|
|
25714
27133
|
}
|
|
27134
|
+
/**
|
|
27135
|
+
* Masked-decode one answer from an OSF-feasible allowed set
|
|
27136
|
+
* (`POST /api/v1/constrained/generate`).
|
|
27137
|
+
*
|
|
27138
|
+
* @param request - The allowed set, an optional token cap, and the prompt.
|
|
27139
|
+
* @returns The decoded answer (guaranteed inside `allowed`), the masked-out
|
|
27140
|
+
* alternatives, and the per-step token deltas.
|
|
27141
|
+
*/
|
|
27142
|
+
async constrainedGenerate(request) {
|
|
27143
|
+
const response = await this.api.constrainedGenerate(
|
|
27144
|
+
ConstrainedGenerateRequestFromFrontToApi(request)
|
|
27145
|
+
);
|
|
27146
|
+
return ConstrainedGenerateResponseFromApiToFront(response.data);
|
|
27147
|
+
}
|
|
27148
|
+
/**
|
|
27149
|
+
* Free, ungrounded local-model decode (`POST /api/v1/generate/raw`).
|
|
27150
|
+
*
|
|
27151
|
+
* @param request - The prompt and an optional token cap.
|
|
27152
|
+
* @returns The raw, ungrounded answer.
|
|
27153
|
+
*/
|
|
27154
|
+
async rawGenerate(request) {
|
|
27155
|
+
const response = await this.api.rawGenerate(RawGenerateRequestFromFrontToApi(request));
|
|
27156
|
+
return RawGenerateResponseFromApiToFront(response.data);
|
|
27157
|
+
}
|
|
27158
|
+
/**
|
|
27159
|
+
* Lattice-grounded anti-hallucination generation
|
|
27160
|
+
* (`POST /api/v1/generate/grounded`).
|
|
27161
|
+
*
|
|
27162
|
+
* @param request - The prompt, an optional goal (target/destination) for
|
|
27163
|
+
* feasibility, the anti-hallucination `mode`, and decode knobs.
|
|
27164
|
+
* @returns The lattice-constrained derivation, the free-prose answer, the
|
|
27165
|
+
* feasible/refuted/recommended motion modes, and (certify mode) the
|
|
27166
|
+
* certification outcome.
|
|
27167
|
+
*/
|
|
27168
|
+
async groundedGenerate(request) {
|
|
27169
|
+
const response = await this.api.groundedGenerate(
|
|
27170
|
+
GroundedGenerateRequestFromFrontToApi(request)
|
|
27171
|
+
);
|
|
27172
|
+
return GroundedGenerateResponseFromApiToFront(response.data);
|
|
27173
|
+
}
|
|
25715
27174
|
};
|
|
25716
27175
|
|
|
25717
27176
|
// src/normalizers/rag.ts
|
|
@@ -27232,6 +28691,13 @@ function ListConversationsResponseFromApiToFront(dto) {
|
|
|
27232
28691
|
conversations: dto.conversations.map(ConversationSummaryDtoFromApiToFront)
|
|
27233
28692
|
};
|
|
27234
28693
|
}
|
|
28694
|
+
function CompareModelDtoFromApiToFront(dto) {
|
|
28695
|
+
return {
|
|
28696
|
+
id: dto.id,
|
|
28697
|
+
kind: dto.kind,
|
|
28698
|
+
label: dto.label
|
|
28699
|
+
};
|
|
28700
|
+
}
|
|
27235
28701
|
function ConversationTurnsResponseFromApiToFront(dto) {
|
|
27236
28702
|
return {
|
|
27237
28703
|
conversationId: dto.conversation_id,
|
|
@@ -27340,6 +28806,30 @@ var ConversationClient = class {
|
|
|
27340
28806
|
});
|
|
27341
28807
|
return ListConversationsResponseFromApiToFront(response.data);
|
|
27342
28808
|
}
|
|
28809
|
+
/**
|
|
28810
|
+
* List the registered comparison models so the UI can populate a
|
|
28811
|
+
* selector / compare panel.
|
|
28812
|
+
*
|
|
28813
|
+
* @returns The available comparison models (endpoint- or candle-backed).
|
|
28814
|
+
* @throws {ApiError} If the request fails.
|
|
28815
|
+
*
|
|
28816
|
+
* @example
|
|
28817
|
+
* ```typescript
|
|
28818
|
+
* const models = await client.conversation.listModels();
|
|
28819
|
+
* for (const m of models) {
|
|
28820
|
+
* console.log(`${m.id} (${m.kind}): ${m.label}`);
|
|
28821
|
+
* }
|
|
28822
|
+
* ```
|
|
28823
|
+
*/
|
|
28824
|
+
async listModels() {
|
|
28825
|
+
const response = await this.http.request({
|
|
28826
|
+
path: "/api/v1/conversation/models",
|
|
28827
|
+
method: "GET",
|
|
28828
|
+
secure: true,
|
|
28829
|
+
format: "json"
|
|
28830
|
+
});
|
|
28831
|
+
return (response.data ?? []).map(CompareModelDtoFromApiToFront);
|
|
28832
|
+
}
|
|
27343
28833
|
/**
|
|
27344
28834
|
* Get all turns for a conversation.
|
|
27345
28835
|
*
|
|
@@ -27531,7 +29021,15 @@ function PaperMetadataFromApiToFront(dto) {
|
|
|
27531
29021
|
abstractText: dto.abstract_text ?? null,
|
|
27532
29022
|
citationCount: dto.citation_count ?? null,
|
|
27533
29023
|
source: dto.source,
|
|
27534
|
-
fullTextUrl: dto.full_text_url ?? null
|
|
29024
|
+
fullTextUrl: dto.full_text_url ?? null,
|
|
29025
|
+
paperKey: dto.paper_key ?? null
|
|
29026
|
+
};
|
|
29027
|
+
}
|
|
29028
|
+
function PaperRefFromApiToFront(dto) {
|
|
29029
|
+
return {
|
|
29030
|
+
paperKey: dto.paper_key,
|
|
29031
|
+
doi: dto.doi ?? null,
|
|
29032
|
+
title: dto.title
|
|
27535
29033
|
};
|
|
27536
29034
|
}
|
|
27537
29035
|
function PaperSearchResultFromApiToFront(dto) {
|
|
@@ -27565,6 +29063,8 @@ function ResearchCycleResultFromApiToFront(dto) {
|
|
|
27565
29063
|
papersIngested: dto.papers_ingested,
|
|
27566
29064
|
claimsVerified: dto.claims_verified,
|
|
27567
29065
|
contradictionsDetected: dto.contradictions_detected,
|
|
29066
|
+
contradictionsResolved: dto.contradictions_resolved ?? 0,
|
|
29067
|
+
claimsMerged: dto.claims_merged ?? 0,
|
|
27568
29068
|
processingTimeMs: dto.processing_time_ms,
|
|
27569
29069
|
searchQueries: dto.search_queries ?? []
|
|
27570
29070
|
};
|
|
@@ -27577,6 +29077,7 @@ function ResearchSessionResponseFromApiToFront(raw) {
|
|
|
27577
29077
|
status: dto.status,
|
|
27578
29078
|
error: dto.error ?? null,
|
|
27579
29079
|
cycles: (dto.cycles ?? []).map(ResearchCycleResultFromApiToFront),
|
|
29080
|
+
papers: (dto.papers ?? []).map(PaperMetadataFromApiToFront),
|
|
27580
29081
|
totalPapersIngested: dto.total_papers_ingested,
|
|
27581
29082
|
totalFindings: dto.total_findings,
|
|
27582
29083
|
totalContradictions: dto.total_contradictions,
|
|
@@ -27621,7 +29122,9 @@ function EvidenceItemSummaryFromApiToFront(dto) {
|
|
|
27621
29122
|
qualityWeight: dto.quality_weight,
|
|
27622
29123
|
supports: dto.supports,
|
|
27623
29124
|
contribution: dto.contribution,
|
|
27624
|
-
paperDoi: dto.paper_doi ?? null
|
|
29125
|
+
paperDoi: dto.paper_doi ?? null,
|
|
29126
|
+
paperKey: dto.paper_key ?? null,
|
|
29127
|
+
paperTitle: dto.paper_title ?? null
|
|
27625
29128
|
};
|
|
27626
29129
|
}
|
|
27627
29130
|
function ProvenanceStepFromApiToFront(dto) {
|
|
@@ -27632,6 +29135,13 @@ function ProvenanceStepFromApiToFront(dto) {
|
|
|
27632
29135
|
timestamp: dto.timestamp ?? null
|
|
27633
29136
|
};
|
|
27634
29137
|
}
|
|
29138
|
+
function ResiduatedFeatureFromApiToFront(dto) {
|
|
29139
|
+
return {
|
|
29140
|
+
featureName: dto.feature_name,
|
|
29141
|
+
neededSort: dto.needed_sort ?? null,
|
|
29142
|
+
infoGain: dto.info_gain
|
|
29143
|
+
};
|
|
29144
|
+
}
|
|
27635
29145
|
function ResearchFindingFromApiToFront(dto) {
|
|
27636
29146
|
return {
|
|
27637
29147
|
claimId: dto.claim_id,
|
|
@@ -27642,7 +29152,9 @@ function ResearchFindingFromApiToFront(dto) {
|
|
|
27642
29152
|
contradictingEvidence: (dto.contradicting_evidence ?? []).map(EvidenceItemSummaryFromApiToFront),
|
|
27643
29153
|
provenanceChain: (dto.provenance_chain ?? []).map(ProvenanceStepFromApiToFront),
|
|
27644
29154
|
residuated: dto.residuated,
|
|
27645
|
-
residuationReason: dto.residuation_reason ?? null
|
|
29155
|
+
residuationReason: dto.residuation_reason ?? null,
|
|
29156
|
+
residuatedFeatures: (dto.residuated_features ?? []).map(ResiduatedFeatureFromApiToFront),
|
|
29157
|
+
sources: (dto.sources ?? []).map(PaperRefFromApiToFront)
|
|
27646
29158
|
};
|
|
27647
29159
|
}
|
|
27648
29160
|
function ResearchFindingsResponseFromApiToFront(raw) {
|
|
@@ -27670,6 +29182,17 @@ function ResearchGapsResponseFromApiToFront(raw) {
|
|
|
27670
29182
|
total: dto.total
|
|
27671
29183
|
};
|
|
27672
29184
|
}
|
|
29185
|
+
function ContradictionResolutionFromApiToFront(dto) {
|
|
29186
|
+
return {
|
|
29187
|
+
preferredClaimId: dto.preferred_claim_id,
|
|
29188
|
+
dismissedClaimId: dto.dismissed_claim_id,
|
|
29189
|
+
preferredTruthfulness: dto.preferred_truthfulness,
|
|
29190
|
+
dismissedTruthfulness: dto.dismissed_truthfulness,
|
|
29191
|
+
strategy: dto.strategy,
|
|
29192
|
+
confidence: dto.confidence,
|
|
29193
|
+
explanation: dto.explanation
|
|
29194
|
+
};
|
|
29195
|
+
}
|
|
27673
29196
|
function ContradictionFromApiToFront(dto) {
|
|
27674
29197
|
return {
|
|
27675
29198
|
claimAId: dto.claim_a_id,
|
|
@@ -27677,7 +29200,10 @@ function ContradictionFromApiToFront(dto) {
|
|
|
27677
29200
|
statementA: dto.statement_a,
|
|
27678
29201
|
statementB: dto.statement_b,
|
|
27679
29202
|
confidence: dto.confidence,
|
|
27680
|
-
explanation: dto.explanation
|
|
29203
|
+
explanation: dto.explanation,
|
|
29204
|
+
resolution: dto.resolution ? ContradictionResolutionFromApiToFront(dto.resolution) : null,
|
|
29205
|
+
claimASources: (dto.claim_a_sources ?? []).map(PaperRefFromApiToFront),
|
|
29206
|
+
claimBSources: (dto.claim_b_sources ?? []).map(PaperRefFromApiToFront)
|
|
27681
29207
|
};
|
|
27682
29208
|
}
|
|
27683
29209
|
function ResearchContradictionsResponseFromApiToFront(raw) {
|
|
@@ -27698,7 +29224,9 @@ function ResearchStatisticsFromApiToFront(dto) {
|
|
|
27698
29224
|
totalContradictions: dto.total_contradictions,
|
|
27699
29225
|
totalProcessingTimeMs: dto.total_processing_time_ms,
|
|
27700
29226
|
gapsResolved: dto.gaps_resolved,
|
|
27701
|
-
gapsRemaining: dto.gaps_remaining
|
|
29227
|
+
gapsRemaining: dto.gaps_remaining,
|
|
29228
|
+
claimsMerged: dto.claims_merged ?? 0,
|
|
29229
|
+
contradictionsResolved: dto.contradictions_resolved ?? 0
|
|
27702
29230
|
};
|
|
27703
29231
|
}
|
|
27704
29232
|
function ReportVerificationFromApiToFront(dto) {
|
|
@@ -28859,6 +30387,14 @@ function AuditRecordFromApiToFront(dto) {
|
|
|
28859
30387
|
extra: dto.extra
|
|
28860
30388
|
};
|
|
28861
30389
|
}
|
|
30390
|
+
function AuditPageFromApiToFront(dto) {
|
|
30391
|
+
return {
|
|
30392
|
+
records: dto.records.map(AuditRecordFromApiToFront),
|
|
30393
|
+
total: dto.total,
|
|
30394
|
+
limit: dto.limit ?? null,
|
|
30395
|
+
offset: dto.offset
|
|
30396
|
+
};
|
|
30397
|
+
}
|
|
28862
30398
|
function SummaryResponseFromApiToFront(dto) {
|
|
28863
30399
|
const out = {
|
|
28864
30400
|
nRecords: dto.n_records,
|
|
@@ -28948,18 +30484,39 @@ var ComplianceClient = class {
|
|
|
28948
30484
|
return AuditRecordFromApiToFront(response.data);
|
|
28949
30485
|
}
|
|
28950
30486
|
/**
|
|
28951
|
-
* List audit records for this tenant,
|
|
30487
|
+
* List audit records for this tenant — paged, sorted, and filtered.
|
|
30488
|
+
*
|
|
30489
|
+
* @param options - Page / sort / filter controls. Defaults to a
|
|
30490
|
+
* bounded first page (`sort_by=timestamp`, `sort_order=desc`,
|
|
30491
|
+
* `limit=50`) — most-recent-first, matching the backend default.
|
|
30492
|
+
* Pass `all: true` to fetch the full filtered set for export.
|
|
30493
|
+
* @returns A page of records plus the filtered `total`, the `limit`
|
|
30494
|
+
* applied (`null` when `all` was set), and the zero-based `offset`.
|
|
28952
30495
|
*
|
|
28953
|
-
* @
|
|
30496
|
+
* @remarks
|
|
30497
|
+
* The backend clamps `limit` to `1..=200` and defaults it to `50`
|
|
30498
|
+
* when omitted (unless `all` is set). `total` reflects the active
|
|
30499
|
+
* `requestPathPattern` / `since` / `until` filter, not the raw
|
|
30500
|
+
* tenant count — so `{shown} of {total}` and the rendered rows stay
|
|
30501
|
+
* consistent under the same filter. Sort enums are wire-serialised
|
|
30502
|
+
* `snake_case` (`timestamp` / `request_path` / `actor`) and `asc` /
|
|
30503
|
+
* `desc` lowercase; the shipped {@link AuditSortField} /
|
|
30504
|
+
* {@link AuditSortOrder} literals match verbatim.
|
|
28954
30505
|
*/
|
|
28955
30506
|
async list(options = {}) {
|
|
28956
30507
|
const query = {};
|
|
28957
|
-
if (options.limit !== void 0) query.limit = options.limit;
|
|
28958
30508
|
if (options.requestPathPattern !== void 0) {
|
|
28959
30509
|
query.request_path_pattern = options.requestPathPattern;
|
|
28960
30510
|
}
|
|
30511
|
+
if (options.since !== void 0) query.since = options.since;
|
|
30512
|
+
if (options.until !== void 0) query.until = options.until;
|
|
30513
|
+
if (options.sortBy !== void 0) query.sort_by = options.sortBy;
|
|
30514
|
+
if (options.sortOrder !== void 0) query.sort_order = options.sortOrder;
|
|
30515
|
+
if (options.limit !== void 0) query.limit = options.limit;
|
|
30516
|
+
if (options.offset !== void 0) query.offset = options.offset;
|
|
30517
|
+
if (options.all !== void 0) query.all = options.all;
|
|
28961
30518
|
const response = await this.api.list(query);
|
|
28962
|
-
return response.data
|
|
30519
|
+
return AuditPageFromApiToFront(response.data);
|
|
28963
30520
|
}
|
|
28964
30521
|
/**
|
|
28965
30522
|
* Top-line counts over the tenant's full ledger — useful for
|
|
@@ -29039,6 +30596,19 @@ function AntiUnifyResponseFromApiToFront(dto) {
|
|
|
29039
30596
|
computationTimeMs: dto.computation_time_ms
|
|
29040
30597
|
};
|
|
29041
30598
|
}
|
|
30599
|
+
function AntiUnifyBatchRequestFromFrontToApi(model) {
|
|
30600
|
+
return {
|
|
30601
|
+
term_ids: model.termIds
|
|
30602
|
+
};
|
|
30603
|
+
}
|
|
30604
|
+
function AntiUnifyBatchResponseFromApiToFront(dto) {
|
|
30605
|
+
return {
|
|
30606
|
+
computationTimeMs: dto.computation_time_ms,
|
|
30607
|
+
lgg: TermDtoFromApiToFront(dto.lgg),
|
|
30608
|
+
lggTermId: dto.lgg_term_id,
|
|
30609
|
+
steps: dto.steps
|
|
30610
|
+
};
|
|
30611
|
+
}
|
|
29042
30612
|
|
|
29043
30613
|
// src/resources/operations.ts
|
|
29044
30614
|
var OperationsClient = class {
|
|
@@ -29067,6 +30637,25 @@ var OperationsClient = class {
|
|
|
29067
30637
|
);
|
|
29068
30638
|
return AntiUnifyResponseFromApiToFront(response.data);
|
|
29069
30639
|
}
|
|
30640
|
+
/**
|
|
30641
|
+
* Compute the anti-unification (LGG) of a batch of Ψ-terms via a left
|
|
30642
|
+
* fold over 2..=64 term ids.
|
|
30643
|
+
*
|
|
30644
|
+
* @param request - The term ids to generalise, in fold order.
|
|
30645
|
+
* @returns The final LGG term + enriched view + the intermediate LGG
|
|
30646
|
+
* ids from the fold + total timing.
|
|
30647
|
+
*
|
|
30648
|
+
* @remarks
|
|
30649
|
+
* All ids must already be registered in the tenant's term store. The
|
|
30650
|
+
* final LGG is persisted; `steps` is empty when exactly two terms are
|
|
30651
|
+
* supplied.
|
|
30652
|
+
*/
|
|
30653
|
+
async antiUnifyBatch(request) {
|
|
30654
|
+
const response = await this.api.antiUnifyBatch(
|
|
30655
|
+
AntiUnifyBatchRequestFromFrontToApi(request)
|
|
30656
|
+
);
|
|
30657
|
+
return AntiUnifyBatchResponseFromApiToFront(response.data);
|
|
30658
|
+
}
|
|
29070
30659
|
};
|
|
29071
30660
|
|
|
29072
30661
|
// src/normalizers/actions.ts
|
|
@@ -34316,6 +35905,1016 @@ var OntologyExportClient = class {
|
|
|
34316
35905
|
}
|
|
34317
35906
|
};
|
|
34318
35907
|
|
|
35908
|
+
// src/normalizers/demo.ts
|
|
35909
|
+
function DemoSeedRequestFromFrontToApi(model) {
|
|
35910
|
+
const dto = {};
|
|
35911
|
+
if (model.sumoDir !== void 0) dto.sumo_dir = model.sumoDir;
|
|
35912
|
+
return dto;
|
|
35913
|
+
}
|
|
35914
|
+
function DemoSeedResponseFromApiToFront(dto) {
|
|
35915
|
+
return {
|
|
35916
|
+
forms: dto.forms,
|
|
35917
|
+
sorts: dto.sorts
|
|
35918
|
+
};
|
|
35919
|
+
}
|
|
35920
|
+
|
|
35921
|
+
// src/resources/demo.ts
|
|
35922
|
+
var DemoClient = class {
|
|
35923
|
+
/** @internal */
|
|
35924
|
+
api;
|
|
35925
|
+
/** @internal */
|
|
35926
|
+
constructor(api) {
|
|
35927
|
+
this.api = api;
|
|
35928
|
+
}
|
|
35929
|
+
/**
|
|
35930
|
+
* Seed the request tenant's persistent substrate with full SUMO + the
|
|
35931
|
+
* demo scenario situations.
|
|
35932
|
+
*
|
|
35933
|
+
* @param request - Optional SUMO source-directory override.
|
|
35934
|
+
* @returns The imported form count and the tenant's total sort count.
|
|
35935
|
+
*
|
|
35936
|
+
* @throws {ApiError} `404` if the SUMO files cannot be read, `400` if
|
|
35937
|
+
* the assembled source fails to import.
|
|
35938
|
+
*/
|
|
35939
|
+
async seed(request = {}) {
|
|
35940
|
+
const response = await this.api.demoSeed(DemoSeedRequestFromFrontToApi(request));
|
|
35941
|
+
return DemoSeedResponseFromApiToFront(response.data);
|
|
35942
|
+
}
|
|
35943
|
+
};
|
|
35944
|
+
|
|
35945
|
+
// src/normalizers/reward.ts
|
|
35946
|
+
function RewardScoreRequestFromFrontToApi(model) {
|
|
35947
|
+
const dto = { sort: model.sort };
|
|
35948
|
+
if (model.constraints !== void 0) dto.constraints = model.constraints;
|
|
35949
|
+
if (model.maxInstances !== void 0) dto.max_instances = model.maxInstances;
|
|
35950
|
+
if (model.negativeIds !== void 0) dto.negative_ids = model.negativeIds;
|
|
35951
|
+
if (model.objective !== void 0) dto.objective = model.objective;
|
|
35952
|
+
if (model.positiveIds !== void 0) dto.positive_ids = model.positiveIds;
|
|
35953
|
+
if (model.targetSort !== void 0) dto.target_sort = model.targetSort;
|
|
35954
|
+
return dto;
|
|
35955
|
+
}
|
|
35956
|
+
function RewardScoreResponseFromApiToFront(dto) {
|
|
35957
|
+
const out = {
|
|
35958
|
+
certifiedNonEmpty: dto.certified_non_empty,
|
|
35959
|
+
estimatedExtent: dto.estimated_extent,
|
|
35960
|
+
reward: dto.reward
|
|
35961
|
+
};
|
|
35962
|
+
if (dto.covers_negative != null) out.coversNegative = dto.covers_negative;
|
|
35963
|
+
if (dto.covers_positive != null) out.coversPositive = dto.covers_positive;
|
|
35964
|
+
if (dto.precision != null) out.precision = dto.precision;
|
|
35965
|
+
if (dto.recall != null) out.recall = dto.recall;
|
|
35966
|
+
return out;
|
|
35967
|
+
}
|
|
35968
|
+
|
|
35969
|
+
// src/resources/reward.ts
|
|
35970
|
+
var RewardClient = class {
|
|
35971
|
+
/** @internal */
|
|
35972
|
+
api;
|
|
35973
|
+
/** @internal */
|
|
35974
|
+
constructor(api) {
|
|
35975
|
+
this.api = api;
|
|
35976
|
+
}
|
|
35977
|
+
/**
|
|
35978
|
+
* Score a candidate query execution-free for the authenticated tenant.
|
|
35979
|
+
*
|
|
35980
|
+
* @param request - The query spec (sort, objective, optional
|
|
35981
|
+
* constraints / instance ids).
|
|
35982
|
+
* @returns A sound reward signal plus the certificate and coverage
|
|
35983
|
+
* breakdown.
|
|
35984
|
+
*
|
|
35985
|
+
* @throws {ApiError} `404` if the sort name is unknown to the lattice.
|
|
35986
|
+
*/
|
|
35987
|
+
async score(request) {
|
|
35988
|
+
const response = await this.api.score(RewardScoreRequestFromFrontToApi(request));
|
|
35989
|
+
return RewardScoreResponseFromApiToFront(response.data);
|
|
35990
|
+
}
|
|
35991
|
+
};
|
|
35992
|
+
|
|
35993
|
+
// src/normalizers/translation.ts
|
|
35994
|
+
function TranslateRequestFromFrontToApi(model) {
|
|
35995
|
+
const dto = {
|
|
35996
|
+
target_lang: model.targetLang,
|
|
35997
|
+
text: model.text
|
|
35998
|
+
};
|
|
35999
|
+
if (model.sourceLang !== void 0) dto.source_lang = model.sourceLang;
|
|
36000
|
+
return dto;
|
|
36001
|
+
}
|
|
36002
|
+
function TranslateResponseFromApiToFront(dto) {
|
|
36003
|
+
const out = {
|
|
36004
|
+
targetLang: dto.target_lang,
|
|
36005
|
+
translatedText: dto.translated_text
|
|
36006
|
+
};
|
|
36007
|
+
if (dto.model !== void 0) out.model = dto.model;
|
|
36008
|
+
return out;
|
|
36009
|
+
}
|
|
36010
|
+
|
|
36011
|
+
// src/resources/translation.ts
|
|
36012
|
+
var TranslationClient = class {
|
|
36013
|
+
/** @internal */
|
|
36014
|
+
api;
|
|
36015
|
+
/** @internal */
|
|
36016
|
+
constructor(api) {
|
|
36017
|
+
this.api = api;
|
|
36018
|
+
}
|
|
36019
|
+
/**
|
|
36020
|
+
* Translate text into a target language.
|
|
36021
|
+
*
|
|
36022
|
+
* @param request - Source text, target language, and an optional
|
|
36023
|
+
* source-language hint.
|
|
36024
|
+
* @returns The translated text plus the echoed target language and
|
|
36025
|
+
* the model label, when known.
|
|
36026
|
+
*/
|
|
36027
|
+
async translate(request) {
|
|
36028
|
+
const response = await this.api.translate(TranslateRequestFromFrontToApi(request));
|
|
36029
|
+
return TranslateResponseFromApiToFront(response.data);
|
|
36030
|
+
}
|
|
36031
|
+
};
|
|
36032
|
+
|
|
36033
|
+
// src/normalizers/streaming.ts
|
|
36034
|
+
function SketchDimensionsFromFrontToApi(model) {
|
|
36035
|
+
const dto = {};
|
|
36036
|
+
if (model.delta !== void 0) dto.delta = model.delta;
|
|
36037
|
+
if (model.depth !== void 0) dto.depth = model.depth;
|
|
36038
|
+
if (model.epsilon !== void 0) dto.epsilon = model.epsilon;
|
|
36039
|
+
if (model.width !== void 0) dto.width = model.width;
|
|
36040
|
+
return dto;
|
|
36041
|
+
}
|
|
36042
|
+
function FrequencyEstimateFromApiToFront(dto) {
|
|
36043
|
+
return {
|
|
36044
|
+
estimatedCount: dto.estimated_count,
|
|
36045
|
+
key: dto.key
|
|
36046
|
+
};
|
|
36047
|
+
}
|
|
36048
|
+
function FrequencyRequestFromFrontToApi(model) {
|
|
36049
|
+
return {
|
|
36050
|
+
dimensions: SketchDimensionsFromFrontToApi(model.dimensions),
|
|
36051
|
+
items: model.items,
|
|
36052
|
+
query_keys: model.queryKeys
|
|
36053
|
+
};
|
|
36054
|
+
}
|
|
36055
|
+
function FrequencyResponseFromApiToFront(dto) {
|
|
36056
|
+
return {
|
|
36057
|
+
depth: dto.depth,
|
|
36058
|
+
estimates: dto.estimates.map(FrequencyEstimateFromApiToFront),
|
|
36059
|
+
width: dto.width
|
|
36060
|
+
};
|
|
36061
|
+
}
|
|
36062
|
+
function HeavyHitterItemFromApiToFront(dto) {
|
|
36063
|
+
return {
|
|
36064
|
+
count: dto.count,
|
|
36065
|
+
item: dto.item
|
|
36066
|
+
};
|
|
36067
|
+
}
|
|
36068
|
+
function HeavyHittersRequestFromFrontToApi(model) {
|
|
36069
|
+
return {
|
|
36070
|
+
capacity: model.capacity,
|
|
36071
|
+
items: model.items
|
|
36072
|
+
};
|
|
36073
|
+
}
|
|
36074
|
+
function HeavyHittersResponseFromApiToFront(dto) {
|
|
36075
|
+
return {
|
|
36076
|
+
capacity: dto.capacity,
|
|
36077
|
+
heavyHitters: dto.heavy_hitters.map(HeavyHitterItemFromApiToFront),
|
|
36078
|
+
maxUndercount: dto.max_undercount,
|
|
36079
|
+
total: dto.total
|
|
36080
|
+
};
|
|
36081
|
+
}
|
|
36082
|
+
function BloomFilterStatsFromApiToFront(dto) {
|
|
36083
|
+
return {
|
|
36084
|
+
bitCount: dto.bit_count,
|
|
36085
|
+
estimatedLoad: dto.estimated_load,
|
|
36086
|
+
hashCount: dto.hash_count,
|
|
36087
|
+
insertions: dto.insertions,
|
|
36088
|
+
setBits: dto.set_bits
|
|
36089
|
+
};
|
|
36090
|
+
}
|
|
36091
|
+
function MembershipRequestFromFrontToApi(model) {
|
|
36092
|
+
return {
|
|
36093
|
+
bit_count: model.bitCount,
|
|
36094
|
+
hash_count: model.hashCount,
|
|
36095
|
+
insert_items: model.insertItems,
|
|
36096
|
+
test_items: model.testItems
|
|
36097
|
+
};
|
|
36098
|
+
}
|
|
36099
|
+
function MembershipResultFromApiToFront(dto) {
|
|
36100
|
+
return {
|
|
36101
|
+
item: dto.item,
|
|
36102
|
+
member: dto.member
|
|
36103
|
+
};
|
|
36104
|
+
}
|
|
36105
|
+
function MembershipResponseFromApiToFront(dto) {
|
|
36106
|
+
return {
|
|
36107
|
+
filterStats: BloomFilterStatsFromApiToFront(dto.filter_stats),
|
|
36108
|
+
membership: dto.membership.map(MembershipResultFromApiToFront)
|
|
36109
|
+
};
|
|
36110
|
+
}
|
|
36111
|
+
|
|
36112
|
+
// src/resources/streaming.ts
|
|
36113
|
+
var StreamingClient = class {
|
|
36114
|
+
/** @internal */
|
|
36115
|
+
api;
|
|
36116
|
+
/** @internal */
|
|
36117
|
+
constructor(api) {
|
|
36118
|
+
this.api = api;
|
|
36119
|
+
}
|
|
36120
|
+
/**
|
|
36121
|
+
* Estimate the frequency of each query key via a Count-Min sketch.
|
|
36122
|
+
*
|
|
36123
|
+
* @param request - The sketch dimensions, the stream `items`, and the
|
|
36124
|
+
* `queryKeys` to estimate.
|
|
36125
|
+
* @returns The sketch dimensions actually used and one estimate per
|
|
36126
|
+
* query key, in request order.
|
|
36127
|
+
*
|
|
36128
|
+
* @throws {ApiError} `400` if `items`/`queryKeys` exceed their limits
|
|
36129
|
+
* or the sketch dimensions are invalid.
|
|
36130
|
+
*/
|
|
36131
|
+
async frequency(request) {
|
|
36132
|
+
const response = await this.api.frequency(FrequencyRequestFromFrontToApi(request));
|
|
36133
|
+
return FrequencyResponseFromApiToFront(response.data);
|
|
36134
|
+
}
|
|
36135
|
+
/**
|
|
36136
|
+
* Find candidate heavy hitters via a Misra-Gries sketch.
|
|
36137
|
+
*
|
|
36138
|
+
* @param request - The counter `capacity` and the stream `items`.
|
|
36139
|
+
* @returns Candidate heavy hitters sorted by count descending, plus
|
|
36140
|
+
* the worst-case under-count bound.
|
|
36141
|
+
*
|
|
36142
|
+
* @throws {ApiError} `400` if `capacity < 1` or `items` exceeds the limit.
|
|
36143
|
+
*/
|
|
36144
|
+
async heavyHitters(request) {
|
|
36145
|
+
const response = await this.api.heavyHitters(HeavyHittersRequestFromFrontToApi(request));
|
|
36146
|
+
return HeavyHittersResponseFromApiToFront(response.data);
|
|
36147
|
+
}
|
|
36148
|
+
/**
|
|
36149
|
+
* Test membership of items in a Bloom filter built from `insertItems`.
|
|
36150
|
+
*
|
|
36151
|
+
* @param request - The `bitCount`, `hashCount`, `insertItems`, and
|
|
36152
|
+
* `testItems`.
|
|
36153
|
+
* @returns Filter load statistics and one membership verdict per test
|
|
36154
|
+
* item, in request order. Zero false negatives.
|
|
36155
|
+
*
|
|
36156
|
+
* @throws {ApiError} `400` if `bitCount`/`hashCount < 1` or the item
|
|
36157
|
+
* arrays exceed their limits.
|
|
36158
|
+
*/
|
|
36159
|
+
async membership(request) {
|
|
36160
|
+
const response = await this.api.membership(MembershipRequestFromFrontToApi(request));
|
|
36161
|
+
return MembershipResponseFromApiToFront(response.data);
|
|
36162
|
+
}
|
|
36163
|
+
};
|
|
36164
|
+
|
|
36165
|
+
// src/normalizers/conformal.ts
|
|
36166
|
+
function CalibrationSampleFromFrontToApi(model) {
|
|
36167
|
+
return {
|
|
36168
|
+
class_scores: model.classScores,
|
|
36169
|
+
input_id: model.inputId,
|
|
36170
|
+
true_label: model.trueLabel
|
|
36171
|
+
};
|
|
36172
|
+
}
|
|
36173
|
+
function TestInputFromFrontToApi(model) {
|
|
36174
|
+
return {
|
|
36175
|
+
class_scores: model.classScores,
|
|
36176
|
+
input_id: model.inputId
|
|
36177
|
+
};
|
|
36178
|
+
}
|
|
36179
|
+
function ConformalCalibrateRequestFromFrontToApi(model) {
|
|
36180
|
+
return {
|
|
36181
|
+
alpha: model.alpha,
|
|
36182
|
+
samples: model.samples.map(CalibrationSampleFromFrontToApi)
|
|
36183
|
+
};
|
|
36184
|
+
}
|
|
36185
|
+
function ConformalCalibrateResponseFromApiToFront(dto) {
|
|
36186
|
+
return {
|
|
36187
|
+
algorithm: dto.algorithm,
|
|
36188
|
+
alpha: dto.alpha,
|
|
36189
|
+
empiricalCoverage: dto.empirical_coverage,
|
|
36190
|
+
meetsTargetCoverage: dto.meets_target_coverage,
|
|
36191
|
+
nSamples: dto.n_samples,
|
|
36192
|
+
quantileRank: dto.quantile_rank,
|
|
36193
|
+
threshold: dto.threshold
|
|
36194
|
+
};
|
|
36195
|
+
}
|
|
36196
|
+
function ConformalPredictRequestFromFrontToApi(model) {
|
|
36197
|
+
return {
|
|
36198
|
+
alpha: model.alpha,
|
|
36199
|
+
n_calibration_samples: model.nCalibrationSamples,
|
|
36200
|
+
test_inputs: model.testInputs.map(TestInputFromFrontToApi),
|
|
36201
|
+
threshold: model.threshold
|
|
36202
|
+
};
|
|
36203
|
+
}
|
|
36204
|
+
function CoverageCertificateFromApiToFront(dto) {
|
|
36205
|
+
return {
|
|
36206
|
+
algorithm: dto.algorithm,
|
|
36207
|
+
alpha: dto.alpha,
|
|
36208
|
+
nCalibrationSamples: dto.n_calibration_samples,
|
|
36209
|
+
nominalCoverage: dto.nominal_coverage,
|
|
36210
|
+
threshold: dto.threshold
|
|
36211
|
+
};
|
|
36212
|
+
}
|
|
36213
|
+
function ConformalPredictionFromApiToFront(dto) {
|
|
36214
|
+
return {
|
|
36215
|
+
abstains: dto.abstains,
|
|
36216
|
+
inputId: dto.input_id,
|
|
36217
|
+
predictionSet: dto.prediction_set,
|
|
36218
|
+
topClass: dto.top_class,
|
|
36219
|
+
topClassNonConformity: dto.top_class_non_conformity
|
|
36220
|
+
};
|
|
36221
|
+
}
|
|
36222
|
+
function ConformalPredictResponseFromApiToFront(dto) {
|
|
36223
|
+
return {
|
|
36224
|
+
coverageCertificate: CoverageCertificateFromApiToFront(dto.coverage_certificate),
|
|
36225
|
+
predictions: dto.predictions.map(ConformalPredictionFromApiToFront)
|
|
36226
|
+
};
|
|
36227
|
+
}
|
|
36228
|
+
|
|
36229
|
+
// src/resources/conformal.ts
|
|
36230
|
+
var ConformalClient = class {
|
|
36231
|
+
/** @internal */
|
|
36232
|
+
api;
|
|
36233
|
+
/** @internal */
|
|
36234
|
+
constructor(api) {
|
|
36235
|
+
this.api = api;
|
|
36236
|
+
}
|
|
36237
|
+
/**
|
|
36238
|
+
* Compute a split-conformal non-conformity threshold from a labeled
|
|
36239
|
+
* calibration set.
|
|
36240
|
+
*
|
|
36241
|
+
* @param request - The calibration set (samples + target miscoverage
|
|
36242
|
+
* `α`).
|
|
36243
|
+
* @returns The computed threshold `τ` plus a coverage certificate and
|
|
36244
|
+
* sanity-check coverage stats.
|
|
36245
|
+
*
|
|
36246
|
+
* @throws {ApiError} `400` if `alpha` is outside `(0, 1)` or the
|
|
36247
|
+
* calibration set is empty.
|
|
36248
|
+
*/
|
|
36249
|
+
async calibrate(request) {
|
|
36250
|
+
const response = await this.api.calibrate(ConformalCalibrateRequestFromFrontToApi(request));
|
|
36251
|
+
return ConformalCalibrateResponseFromApiToFront(response.data);
|
|
36252
|
+
}
|
|
36253
|
+
/**
|
|
36254
|
+
* Apply a pre-computed conformal threshold to unlabeled test inputs
|
|
36255
|
+
* and return prediction sets with coverage certificates.
|
|
36256
|
+
*
|
|
36257
|
+
* @param request - The threshold `τ`, calibration `α` and sample count
|
|
36258
|
+
* (from a prior `calibrate` call), and the test inputs to predict
|
|
36259
|
+
* for.
|
|
36260
|
+
* @returns Per-input conformal prediction results plus a coverage
|
|
36261
|
+
* certificate, in request order.
|
|
36262
|
+
*
|
|
36263
|
+
* @throws {ApiError} `400` if the test-input count exceeds 10 000.
|
|
36264
|
+
*/
|
|
36265
|
+
async predict(request) {
|
|
36266
|
+
const response = await this.api.predict(ConformalPredictRequestFromFrontToApi(request));
|
|
36267
|
+
return ConformalPredictResponseFromApiToFront(response.data);
|
|
36268
|
+
}
|
|
36269
|
+
};
|
|
36270
|
+
|
|
36271
|
+
// src/normalizers/vision.ts
|
|
36272
|
+
function EncoderConfigOverridesFromFrontToApi(model) {
|
|
36273
|
+
const dto = {};
|
|
36274
|
+
if (model.numFrames !== void 0) dto.num_frames = model.numFrames;
|
|
36275
|
+
if (model.patchSize !== void 0) dto.patch_size = model.patchSize;
|
|
36276
|
+
if (model.sessionId !== void 0) dto.session_id = model.sessionId;
|
|
36277
|
+
if (model.targetHeight !== void 0) dto.target_height = model.targetHeight;
|
|
36278
|
+
if (model.targetWidth !== void 0) dto.target_width = model.targetWidth;
|
|
36279
|
+
return dto;
|
|
36280
|
+
}
|
|
36281
|
+
function FrameSummaryFromApiToFront(dto) {
|
|
36282
|
+
return {
|
|
36283
|
+
frameIndex: dto.frame_index,
|
|
36284
|
+
numPredictedObjects: dto.num_predicted_objects,
|
|
36285
|
+
numResiduatedFeatures: dto.num_residuated_features,
|
|
36286
|
+
objectLabels: dto.object_labels
|
|
36287
|
+
};
|
|
36288
|
+
}
|
|
36289
|
+
function EncodeClipRequestFromFrontToApi(model) {
|
|
36290
|
+
const dto = {
|
|
36291
|
+
clip_id: model.clipId,
|
|
36292
|
+
video_b64: model.videoB64
|
|
36293
|
+
};
|
|
36294
|
+
if (model.configOverrides !== void 0) {
|
|
36295
|
+
dto.config_overrides = model.configOverrides === null ? null : EncoderConfigOverridesFromFrontToApi(model.configOverrides);
|
|
36296
|
+
}
|
|
36297
|
+
if (model.fps !== void 0) dto.fps = model.fps;
|
|
36298
|
+
if (model.sourceUri !== void 0) dto.source_uri = model.sourceUri;
|
|
36299
|
+
return dto;
|
|
36300
|
+
}
|
|
36301
|
+
function EncodeClipResponseFromApiToFront(dto) {
|
|
36302
|
+
const out = {
|
|
36303
|
+
clipId: dto.clip_id,
|
|
36304
|
+
embeddingDim: dto.embedding_dim,
|
|
36305
|
+
encodeElapsedMs: dto.encode_elapsed_ms,
|
|
36306
|
+
frames: dto.frames.map(FrameSummaryFromApiToFront),
|
|
36307
|
+
modelId: dto.model_id,
|
|
36308
|
+
numInputFrames: dto.num_input_frames,
|
|
36309
|
+
paddedFrameIndices: dto.padded_frame_indices,
|
|
36310
|
+
totalObjects: dto.total_objects,
|
|
36311
|
+
totalResiduatedFeatures: dto.total_residuated_features
|
|
36312
|
+
};
|
|
36313
|
+
if (dto.model_version != null) out.modelVersion = dto.model_version;
|
|
36314
|
+
return out;
|
|
36315
|
+
}
|
|
36316
|
+
|
|
36317
|
+
// src/resources/vision.ts
|
|
36318
|
+
var VisionClient = class {
|
|
36319
|
+
/** @internal */
|
|
36320
|
+
api;
|
|
36321
|
+
/** @internal */
|
|
36322
|
+
constructor(api) {
|
|
36323
|
+
this.api = api;
|
|
36324
|
+
}
|
|
36325
|
+
/**
|
|
36326
|
+
* Encode a video clip end-to-end and return per-frame predictions.
|
|
36327
|
+
*
|
|
36328
|
+
* @param request - The clip spec (base64 video, clip id, optional
|
|
36329
|
+
* config overrides / fps / source uri).
|
|
36330
|
+
* @returns The embedding plus per-frame Ψ-term prediction summaries.
|
|
36331
|
+
*
|
|
36332
|
+
* @throws {ApiError} `503` if no V-JEPA perception service is mounted.
|
|
36333
|
+
*/
|
|
36334
|
+
async encodeClip(request) {
|
|
36335
|
+
const response = await this.api.encodeClip(EncodeClipRequestFromFrontToApi(request));
|
|
36336
|
+
return EncodeClipResponseFromApiToFront(response.data);
|
|
36337
|
+
}
|
|
36338
|
+
};
|
|
36339
|
+
|
|
36340
|
+
// src/normalizers/anonymization.ts
|
|
36341
|
+
function quasiIdentifierFromFrontToApi(q) {
|
|
36342
|
+
switch (q.type) {
|
|
36343
|
+
case "numeric":
|
|
36344
|
+
return { type: "numeric", precision: q.precision };
|
|
36345
|
+
case "string":
|
|
36346
|
+
return { type: "string", prefix_length: q.prefixLength };
|
|
36347
|
+
case "categorical":
|
|
36348
|
+
return { type: "categorical" };
|
|
36349
|
+
case "hierarchical":
|
|
36350
|
+
return { type: "hierarchical", hierarchy: q.hierarchy };
|
|
36351
|
+
case "date":
|
|
36352
|
+
return { type: "date", granularity: q.granularity };
|
|
36353
|
+
}
|
|
36354
|
+
}
|
|
36355
|
+
function anonymizationModeFromFrontToApi(mode) {
|
|
36356
|
+
if (mode.type === "k_anonymity") {
|
|
36357
|
+
const quasiIdentifiers = {};
|
|
36358
|
+
for (const [field, q] of Object.entries(mode.quasiIdentifiers)) {
|
|
36359
|
+
quasiIdentifiers[field] = quasiIdentifierFromFrontToApi(q);
|
|
36360
|
+
}
|
|
36361
|
+
return { type: "k_anonymity", k: mode.k, quasi_identifiers: quasiIdentifiers };
|
|
36362
|
+
}
|
|
36363
|
+
if (mode.fieldIdentifiers !== void 0) {
|
|
36364
|
+
return {
|
|
36365
|
+
type: "safe_harbor",
|
|
36366
|
+
field_identifiers: mode.fieldIdentifiers
|
|
36367
|
+
};
|
|
36368
|
+
}
|
|
36369
|
+
return { type: "safe_harbor" };
|
|
36370
|
+
}
|
|
36371
|
+
function AnonymizeRequestFromFrontToApi(model) {
|
|
36372
|
+
const dto = {
|
|
36373
|
+
records: model.records,
|
|
36374
|
+
mode: anonymizationModeFromFrontToApi(model.mode)
|
|
36375
|
+
};
|
|
36376
|
+
if (model.enforcement !== void 0) dto.enforcement = model.enforcement;
|
|
36377
|
+
return dto;
|
|
36378
|
+
}
|
|
36379
|
+
function kAnonymityViolationFromApiToFront(wire) {
|
|
36380
|
+
return {
|
|
36381
|
+
quasiValues: wire.quasi_values,
|
|
36382
|
+
count: wire.count,
|
|
36383
|
+
requiredK: wire.required_k,
|
|
36384
|
+
suggestion: wire.suggestion
|
|
36385
|
+
};
|
|
36386
|
+
}
|
|
36387
|
+
function equivalenceClassFromApiToFront(wire) {
|
|
36388
|
+
return {
|
|
36389
|
+
quasiValues: wire.quasi_values,
|
|
36390
|
+
count: wire.count,
|
|
36391
|
+
recordIndices: wire.record_indices
|
|
36392
|
+
};
|
|
36393
|
+
}
|
|
36394
|
+
function kAnonymityResultFromApiToFront(wire) {
|
|
36395
|
+
return {
|
|
36396
|
+
isKAnonymous: wire.is_k_anonymous,
|
|
36397
|
+
k: wire.k,
|
|
36398
|
+
totalRecords: wire.total_records,
|
|
36399
|
+
equivalenceClassCount: wire.equivalence_class_count,
|
|
36400
|
+
violations: wire.violations.map(kAnonymityViolationFromApiToFront),
|
|
36401
|
+
equivalenceClasses: wire.equivalence_classes.map(equivalenceClassFromApiToFront),
|
|
36402
|
+
minClassSize: wire.min_class_size,
|
|
36403
|
+
maxClassSize: wire.max_class_size,
|
|
36404
|
+
avgClassSize: wire.avg_class_size,
|
|
36405
|
+
checkedAt: wire.checked_at
|
|
36406
|
+
};
|
|
36407
|
+
}
|
|
36408
|
+
function recordSafeHarborStatusFromApiToFront(dto) {
|
|
36409
|
+
return {
|
|
36410
|
+
recordIndex: dto.record_index,
|
|
36411
|
+
wasCompliant: dto.was_compliant,
|
|
36412
|
+
suppressedFields: dto.suppressed_fields,
|
|
36413
|
+
violationCount: dto.violation_count
|
|
36414
|
+
};
|
|
36415
|
+
}
|
|
36416
|
+
function safeHarborSummaryFromApiToFront(dto) {
|
|
36417
|
+
return {
|
|
36418
|
+
compliantCount: dto.compliant_count,
|
|
36419
|
+
deIdentifiedCount: dto.de_identified_count,
|
|
36420
|
+
perRecord: dto.per_record.map(recordSafeHarborStatusFromApiToFront)
|
|
36421
|
+
};
|
|
36422
|
+
}
|
|
36423
|
+
function AnonymizeResponseFromApiToFront(dto) {
|
|
36424
|
+
const out = {
|
|
36425
|
+
outputRecords: dto.output_records,
|
|
36426
|
+
suppressedIndices: dto.suppressed_indices,
|
|
36427
|
+
suppressedCount: dto.suppressed_count
|
|
36428
|
+
};
|
|
36429
|
+
if (dto.k_anonymity_result != null) {
|
|
36430
|
+
out.kAnonymityResult = kAnonymityResultFromApiToFront(
|
|
36431
|
+
dto.k_anonymity_result
|
|
36432
|
+
);
|
|
36433
|
+
}
|
|
36434
|
+
if (dto.safe_harbor_summary != null) {
|
|
36435
|
+
out.safeHarborSummary = safeHarborSummaryFromApiToFront(dto.safe_harbor_summary);
|
|
36436
|
+
}
|
|
36437
|
+
return out;
|
|
36438
|
+
}
|
|
36439
|
+
|
|
36440
|
+
// src/resources/anonymization.ts
|
|
36441
|
+
var AnonymizationClient = class {
|
|
36442
|
+
/** @internal */
|
|
36443
|
+
api;
|
|
36444
|
+
/** @internal */
|
|
36445
|
+
constructor(api) {
|
|
36446
|
+
this.api = api;
|
|
36447
|
+
}
|
|
36448
|
+
/**
|
|
36449
|
+
* Batch-anonymize a set of records using k-anonymity or HIPAA Safe Harbor.
|
|
36450
|
+
*
|
|
36451
|
+
* @param request - The record batch, the anonymization mode + params, and
|
|
36452
|
+
* an optional enforcement strategy (defaults to `suppress`).
|
|
36453
|
+
* @returns The processed records plus a full compliance report
|
|
36454
|
+
* (k-anonymity analysis or Safe Harbor summary).
|
|
36455
|
+
*
|
|
36456
|
+
* @throws {ApiError} `400` on an empty batch, > 10 000 records, or an
|
|
36457
|
+
* invalid anonymization mode.
|
|
36458
|
+
*
|
|
36459
|
+
* @example
|
|
36460
|
+
* ```typescript
|
|
36461
|
+
* const result = await client.anonymization.anonymize({
|
|
36462
|
+
* records: [{ name: 'Alice', age: '42', zip: '12345' }],
|
|
36463
|
+
* mode: {
|
|
36464
|
+
* type: 'k_anonymity',
|
|
36465
|
+
* k: 5,
|
|
36466
|
+
* quasiIdentifiers: { age: { type: 'numeric', precision: 10 } },
|
|
36467
|
+
* },
|
|
36468
|
+
* });
|
|
36469
|
+
* console.log(result.kAnonymityResult?.isKAnonymous);
|
|
36470
|
+
* ```
|
|
36471
|
+
*/
|
|
36472
|
+
async anonymize(request) {
|
|
36473
|
+
const response = await this.api.anonymizeRecords(AnonymizeRequestFromFrontToApi(request), {
|
|
36474
|
+
headers: { [RAW_BODY_HEADER]: "1" }
|
|
36475
|
+
});
|
|
36476
|
+
return AnonymizeResponseFromApiToFront(response.data);
|
|
36477
|
+
}
|
|
36478
|
+
};
|
|
36479
|
+
|
|
36480
|
+
// src/normalizers/speakers.ts
|
|
36481
|
+
function EnrollSpeakerRequestFromFrontToApi(model) {
|
|
36482
|
+
const dto = { audio: model.audio, name: model.name };
|
|
36483
|
+
if (model.audioMime !== void 0) dto.audio_mime = model.audioMime;
|
|
36484
|
+
return dto;
|
|
36485
|
+
}
|
|
36486
|
+
function EnrollSpeakerResponseFromApiToFront(dto) {
|
|
36487
|
+
return {
|
|
36488
|
+
dim: dto.dim,
|
|
36489
|
+
id: dto.id,
|
|
36490
|
+
name: dto.name,
|
|
36491
|
+
sampleSecs: dto.sample_secs
|
|
36492
|
+
};
|
|
36493
|
+
}
|
|
36494
|
+
function SpeakerProfileFromApiToFront(dto) {
|
|
36495
|
+
return {
|
|
36496
|
+
createdAt: dto.created_at,
|
|
36497
|
+
id: dto.id,
|
|
36498
|
+
name: dto.name,
|
|
36499
|
+
sampleSecs: dto.sample_secs
|
|
36500
|
+
};
|
|
36501
|
+
}
|
|
36502
|
+
function ListSpeakersResponseFromApiToFront(dto) {
|
|
36503
|
+
return { speakers: dto.speakers.map(SpeakerProfileFromApiToFront) };
|
|
36504
|
+
}
|
|
36505
|
+
|
|
36506
|
+
// src/resources/speakers.ts
|
|
36507
|
+
var SpeakersClient = class {
|
|
36508
|
+
/** @internal */
|
|
36509
|
+
api;
|
|
36510
|
+
/** @internal */
|
|
36511
|
+
constructor(api) {
|
|
36512
|
+
this.api = api;
|
|
36513
|
+
}
|
|
36514
|
+
/**
|
|
36515
|
+
* Enroll (or re-enroll) a speaker voiceprint for the authenticated tenant.
|
|
36516
|
+
*
|
|
36517
|
+
* @remarks
|
|
36518
|
+
* Request body uses plain JSON keys (`audio`, `audio_mime`, `name`) with no
|
|
36519
|
+
* user-keyed maps and no case-sensitive enum values, so the default bridge
|
|
36520
|
+
* snake_casing is correct.
|
|
36521
|
+
*
|
|
36522
|
+
* @param request - The base64 audio sample, optional MIME hint, and name.
|
|
36523
|
+
* @returns The embedding dimensionality, stable profile id, name, and
|
|
36524
|
+
* seconds of speech embedded.
|
|
36525
|
+
*
|
|
36526
|
+
* @throws {ApiError} On a non-2xx response (e.g. malformed audio).
|
|
36527
|
+
*/
|
|
36528
|
+
async enrollSpeaker(request) {
|
|
36529
|
+
const response = await this.api.enrollSpeaker(EnrollSpeakerRequestFromFrontToApi(request));
|
|
36530
|
+
return EnrollSpeakerResponseFromApiToFront(response.data);
|
|
36531
|
+
}
|
|
36532
|
+
/**
|
|
36533
|
+
* List the tenant's enrolled speaker profiles (embeddings withheld).
|
|
36534
|
+
*
|
|
36535
|
+
* @returns The stored speaker profiles for the authenticated tenant.
|
|
36536
|
+
*
|
|
36537
|
+
* @throws {ApiError} On a non-2xx response.
|
|
36538
|
+
*/
|
|
36539
|
+
async listSpeakers() {
|
|
36540
|
+
const response = await this.api.listSpeakers();
|
|
36541
|
+
return ListSpeakersResponseFromApiToFront(response.data);
|
|
36542
|
+
}
|
|
36543
|
+
/**
|
|
36544
|
+
* Delete a speaker profile by id.
|
|
36545
|
+
*
|
|
36546
|
+
* @param request - The stable profile (term) id of the speaker to delete.
|
|
36547
|
+
*
|
|
36548
|
+
* @throws {ApiError} `404` if no profile exists for the given id.
|
|
36549
|
+
*/
|
|
36550
|
+
async deleteSpeaker(request) {
|
|
36551
|
+
await this.api.deleteSpeaker(request.id);
|
|
36552
|
+
}
|
|
36553
|
+
};
|
|
36554
|
+
|
|
36555
|
+
// src/normalizers/speech.ts
|
|
36556
|
+
function VoiceConsentFromFrontToApi(model) {
|
|
36557
|
+
const dto = {
|
|
36558
|
+
granted_by: model.grantedBy,
|
|
36559
|
+
method: model.method
|
|
36560
|
+
};
|
|
36561
|
+
if (model.reference !== void 0) dto.reference = model.reference;
|
|
36562
|
+
return dto;
|
|
36563
|
+
}
|
|
36564
|
+
function VoiceConsentFromApiToFront(dto) {
|
|
36565
|
+
const out = {
|
|
36566
|
+
grantedBy: dto.granted_by,
|
|
36567
|
+
method: dto.method
|
|
36568
|
+
};
|
|
36569
|
+
if (dto.reference != null) out.reference = dto.reference;
|
|
36570
|
+
return out;
|
|
36571
|
+
}
|
|
36572
|
+
function VoiceProfileFromApiToFront(dto) {
|
|
36573
|
+
return {
|
|
36574
|
+
consent: VoiceConsentFromApiToFront(dto.consent),
|
|
36575
|
+
createdAt: dto.created_at,
|
|
36576
|
+
engine: dto.engine,
|
|
36577
|
+
hasIcl: dto.has_icl,
|
|
36578
|
+
id: dto.id,
|
|
36579
|
+
name: dto.name,
|
|
36580
|
+
sampleSecs: dto.sample_secs
|
|
36581
|
+
};
|
|
36582
|
+
}
|
|
36583
|
+
function SpeechEngineFromApiToFront(dto) {
|
|
36584
|
+
const out = {
|
|
36585
|
+
available: dto.available,
|
|
36586
|
+
engine: dto.engine,
|
|
36587
|
+
presetSpeakers: dto.preset_speakers,
|
|
36588
|
+
supportsCloning: dto.supports_cloning
|
|
36589
|
+
};
|
|
36590
|
+
if (dto.reason != null) out.reason = dto.reason;
|
|
36591
|
+
return out;
|
|
36592
|
+
}
|
|
36593
|
+
function EnrollVoiceRequestFromFrontToApi(model) {
|
|
36594
|
+
const dto = {
|
|
36595
|
+
audio: model.audio,
|
|
36596
|
+
consent: VoiceConsentFromFrontToApi(model.consent),
|
|
36597
|
+
name: model.name
|
|
36598
|
+
};
|
|
36599
|
+
if (model.audioMime !== void 0) dto.audio_mime = model.audioMime;
|
|
36600
|
+
if (model.engine !== void 0) dto.engine = model.engine;
|
|
36601
|
+
if (model.transcript !== void 0) dto.transcript = model.transcript;
|
|
36602
|
+
return dto;
|
|
36603
|
+
}
|
|
36604
|
+
function ListEnginesResponseFromApiToFront(dto) {
|
|
36605
|
+
return {
|
|
36606
|
+
engines: dto.engines.map(SpeechEngineFromApiToFront)
|
|
36607
|
+
};
|
|
36608
|
+
}
|
|
36609
|
+
function ListVoicesResponseFromApiToFront(dto) {
|
|
36610
|
+
return {
|
|
36611
|
+
presets: dto.presets,
|
|
36612
|
+
voices: dto.voices.map(VoiceProfileFromApiToFront)
|
|
36613
|
+
};
|
|
36614
|
+
}
|
|
36615
|
+
function OpenSpeechSessionRequestFromFrontToApi(model) {
|
|
36616
|
+
const dto = {};
|
|
36617
|
+
if (model.conversationId !== void 0) dto.conversation_id = model.conversationId;
|
|
36618
|
+
if (model.engine !== void 0) dto.engine = model.engine;
|
|
36619
|
+
if (model.language !== void 0) dto.language = model.language;
|
|
36620
|
+
if (model.voiceId !== void 0) dto.voice_id = model.voiceId;
|
|
36621
|
+
return dto;
|
|
36622
|
+
}
|
|
36623
|
+
function OpenSpeechSessionResponseFromApiToFront(dto) {
|
|
36624
|
+
return {
|
|
36625
|
+
engine: dto.engine,
|
|
36626
|
+
fullDuplex: dto.full_duplex,
|
|
36627
|
+
inputSampleRate: dto.input_sample_rate,
|
|
36628
|
+
sessionId: dto.session_id,
|
|
36629
|
+
wsUrl: dto.ws_url
|
|
36630
|
+
};
|
|
36631
|
+
}
|
|
36632
|
+
function SynthesizeSpeechRequestFromFrontToApi(model) {
|
|
36633
|
+
const dto = { text: model.text };
|
|
36634
|
+
if (model.refAudioBase64 !== void 0) dto.ref_audio_base64 = model.refAudioBase64;
|
|
36635
|
+
if (model.description !== void 0) dto.description = model.description;
|
|
36636
|
+
if (model.engine !== void 0) dto.engine = model.engine;
|
|
36637
|
+
if (model.format !== void 0) dto.format = model.format;
|
|
36638
|
+
if (model.instruction !== void 0) dto.instruction = model.instruction;
|
|
36639
|
+
if (model.language !== void 0) dto.language = model.language;
|
|
36640
|
+
if (model.maxDurationS !== void 0) dto.max_duration_s = model.maxDurationS;
|
|
36641
|
+
if (model.refText !== void 0) dto.ref_text = model.refText;
|
|
36642
|
+
if (model.seed !== void 0) dto.seed = model.seed;
|
|
36643
|
+
if (model.speaker !== void 0) dto.speaker = model.speaker;
|
|
36644
|
+
if (model.voiceId !== void 0) dto.voice_id = model.voiceId;
|
|
36645
|
+
return dto;
|
|
36646
|
+
}
|
|
36647
|
+
function TranscribeSpeechRequestFromFrontToApi(model) {
|
|
36648
|
+
const dto = { audio_base64: model.audioBase64 };
|
|
36649
|
+
if (model.audioMime !== void 0) dto.audio_mime = model.audioMime;
|
|
36650
|
+
if (model.format !== void 0) dto.format = model.format;
|
|
36651
|
+
if (model.language !== void 0) dto.language = model.language;
|
|
36652
|
+
return dto;
|
|
36653
|
+
}
|
|
36654
|
+
function TranscribeSpeechResponseFromApiToFront(dto) {
|
|
36655
|
+
const out = {
|
|
36656
|
+
model: dto.model,
|
|
36657
|
+
text: dto.text
|
|
36658
|
+
};
|
|
36659
|
+
if (dto.duration_secs != null) out.durationSecs = dto.duration_secs;
|
|
36660
|
+
return out;
|
|
36661
|
+
}
|
|
36662
|
+
|
|
36663
|
+
// src/resources/speech.ts
|
|
36664
|
+
var SpeechClient = class {
|
|
36665
|
+
/** @internal */
|
|
36666
|
+
api;
|
|
36667
|
+
/** @internal */
|
|
36668
|
+
constructor(api) {
|
|
36669
|
+
this.api = api;
|
|
36670
|
+
}
|
|
36671
|
+
/**
|
|
36672
|
+
* Enroll (or re-enroll) a cloned voice from a reference clip.
|
|
36673
|
+
*
|
|
36674
|
+
* @param request - The enrollment spec (audio, consent, name, etc.).
|
|
36675
|
+
* @returns The registered voice profile.
|
|
36676
|
+
*
|
|
36677
|
+
* @throws {ApiError} `400` if the clip is too short or consent is missing.
|
|
36678
|
+
*
|
|
36679
|
+
* @remarks
|
|
36680
|
+
* Wire format: the request body is a JSON object with snake_case keys
|
|
36681
|
+
* (`audio`, `audio_mime`, `consent`, `engine`, `name`, `transcript`);
|
|
36682
|
+
* the response is a `VoiceProfileDto` with snake_case fields, normalized
|
|
36683
|
+
* to camelCase here.
|
|
36684
|
+
*/
|
|
36685
|
+
async enrollVoice(request) {
|
|
36686
|
+
const response = await this.api.enrollVoice(
|
|
36687
|
+
EnrollVoiceRequestFromFrontToApi(request)
|
|
36688
|
+
);
|
|
36689
|
+
return VoiceProfileFromApiToFront(response.data);
|
|
36690
|
+
}
|
|
36691
|
+
/**
|
|
36692
|
+
* Report per-engine availability and capabilities.
|
|
36693
|
+
*
|
|
36694
|
+
* @returns The list of speech engines and their preset speakers.
|
|
36695
|
+
*
|
|
36696
|
+
* @remarks
|
|
36697
|
+
* Wire format: the response is a `ListEnginesResponse` with snake_case
|
|
36698
|
+
* fields, normalized to camelCase here.
|
|
36699
|
+
*/
|
|
36700
|
+
async listEngines() {
|
|
36701
|
+
const response = await this.api.listEngines();
|
|
36702
|
+
return ListEnginesResponseFromApiToFront(response.data);
|
|
36703
|
+
}
|
|
36704
|
+
/**
|
|
36705
|
+
* List the tenant's cloned voices plus available presets.
|
|
36706
|
+
*
|
|
36707
|
+
* @returns The enrolled voices and preset speaker names per engine.
|
|
36708
|
+
*
|
|
36709
|
+
* @remarks
|
|
36710
|
+
* Wire format: the response is a `ListVoicesResponse` with snake_case
|
|
36711
|
+
* fields (the `presets` map is returned verbatim), normalized to
|
|
36712
|
+
* camelCase here.
|
|
36713
|
+
*/
|
|
36714
|
+
async listVoices() {
|
|
36715
|
+
const response = await this.api.listVoices();
|
|
36716
|
+
return ListVoicesResponseFromApiToFront(response.data);
|
|
36717
|
+
}
|
|
36718
|
+
/**
|
|
36719
|
+
* Open a speech-to-speech session.
|
|
36720
|
+
*
|
|
36721
|
+
* @param request - The session spec (engine, language, voice id, etc.).
|
|
36722
|
+
* @returns The opened session, including the WebSocket media URL.
|
|
36723
|
+
*
|
|
36724
|
+
* @remarks
|
|
36725
|
+
* Wire format: the request body is a JSON object with snake_case keys
|
|
36726
|
+
* (`conversation_id`, `engine`, `language`, `voice_id`); the response is
|
|
36727
|
+
* an `OpenSpeechSessionResponse` with snake_case fields, normalized to
|
|
36728
|
+
* camelCase here.
|
|
36729
|
+
*/
|
|
36730
|
+
async openSpeechSession(request) {
|
|
36731
|
+
const response = await this.api.openSpeechSession(
|
|
36732
|
+
OpenSpeechSessionRequestFromFrontToApi(request)
|
|
36733
|
+
);
|
|
36734
|
+
return OpenSpeechSessionResponseFromApiToFront(response.data);
|
|
36735
|
+
}
|
|
36736
|
+
/**
|
|
36737
|
+
* Synthesize speech to raw audio bytes.
|
|
36738
|
+
*
|
|
36739
|
+
* @param request - The synthesis spec (text, engine, voice id, etc.).
|
|
36740
|
+
* @returns The raw fetch `Response`. The body is raw audio bytes
|
|
36741
|
+
* (`content-type: audio/wav` on success); read it via
|
|
36742
|
+
* `.arrayBuffer()` or `.blob()`. Check `response.ok` / `response.status`
|
|
36743
|
+
* before reading the body — a non-2xx response body is a JSON
|
|
36744
|
+
* `ApiError`, a 2xx response body is audio.
|
|
36745
|
+
*
|
|
36746
|
+
* @throws {ApiError} On a non-2xx response (the error body is JSON, not
|
|
36747
|
+
* audio — inspect it before consuming the stream).
|
|
36748
|
+
*
|
|
36749
|
+
* @remarks
|
|
36750
|
+
* Wire format: the request body is a JSON object with snake_case keys
|
|
36751
|
+
* (`ref_audio_base64`, `max_duration_s`, `voice_id`, etc.). The response
|
|
36752
|
+
* is NOT JSON — it is a binary audio stream, so this method returns the
|
|
36753
|
+
* raw `Response` unchanged rather than a normalized DTO.
|
|
36754
|
+
*/
|
|
36755
|
+
async synthesizeSpeech(request) {
|
|
36756
|
+
const response = await this.api.synthesizeSpeech(
|
|
36757
|
+
SynthesizeSpeechRequestFromFrontToApi(request)
|
|
36758
|
+
);
|
|
36759
|
+
return response;
|
|
36760
|
+
}
|
|
36761
|
+
/**
|
|
36762
|
+
* Transcribe a short utterance.
|
|
36763
|
+
*
|
|
36764
|
+
* @param request - The transcription spec (base64 audio, mime, etc.).
|
|
36765
|
+
* @returns The recognized text plus the model and optional duration.
|
|
36766
|
+
*
|
|
36767
|
+
* @remarks
|
|
36768
|
+
* Wire format: the request body is a JSON object with snake_case keys
|
|
36769
|
+
* (`audio_base64`, `audio_mime`, `format`, `language`); the response is
|
|
36770
|
+
* a `TranscribeSpeechResponse` with snake_case fields, normalized to
|
|
36771
|
+
* camelCase here.
|
|
36772
|
+
*/
|
|
36773
|
+
async transcribeSpeech(request) {
|
|
36774
|
+
const response = await this.api.transcribeSpeech(
|
|
36775
|
+
TranscribeSpeechRequestFromFrontToApi(request)
|
|
36776
|
+
);
|
|
36777
|
+
return TranscribeSpeechResponseFromApiToFront(response.data);
|
|
36778
|
+
}
|
|
36779
|
+
/**
|
|
36780
|
+
* Delete a cloned voice, upstream conditioning included.
|
|
36781
|
+
*
|
|
36782
|
+
* @param voiceId - The voice (term) id to delete.
|
|
36783
|
+
*
|
|
36784
|
+
* @remarks
|
|
36785
|
+
* Wire format: no body; the voice id is a path parameter. Returns no
|
|
36786
|
+
* content on success.
|
|
36787
|
+
*/
|
|
36788
|
+
async deleteVoice(voiceId) {
|
|
36789
|
+
await this.api.deleteVoice(voiceId);
|
|
36790
|
+
}
|
|
36791
|
+
};
|
|
36792
|
+
|
|
36793
|
+
// src/normalizers/connectors.ts
|
|
36794
|
+
function AddConnectorRequestFromFrontToApi(model) {
|
|
36795
|
+
return {
|
|
36796
|
+
name: model.name,
|
|
36797
|
+
type: model.type
|
|
36798
|
+
};
|
|
36799
|
+
}
|
|
36800
|
+
function AddConnectorResponseFromApiToFront(dto) {
|
|
36801
|
+
return {
|
|
36802
|
+
id: dto.id,
|
|
36803
|
+
name: dto.name,
|
|
36804
|
+
status: dto.status
|
|
36805
|
+
};
|
|
36806
|
+
}
|
|
36807
|
+
function ConnectorTypeFromApiToFront(dto) {
|
|
36808
|
+
const out = {
|
|
36809
|
+
authType: dto.auth_type,
|
|
36810
|
+
displayName: dto.display_name,
|
|
36811
|
+
typeName: dto.type_name
|
|
36812
|
+
};
|
|
36813
|
+
if (dto.icon_url !== void 0) out.iconUrl = dto.icon_url;
|
|
36814
|
+
return out;
|
|
36815
|
+
}
|
|
36816
|
+
function ConnectorInstanceFromApiToFront(dto) {
|
|
36817
|
+
const out = {
|
|
36818
|
+
displayName: dto.display_name,
|
|
36819
|
+
id: dto.id,
|
|
36820
|
+
name: dto.name,
|
|
36821
|
+
status: dto.status,
|
|
36822
|
+
typeName: dto.type_name
|
|
36823
|
+
};
|
|
36824
|
+
if (dto.connected_at !== void 0) out.connectedAt = dto.connected_at;
|
|
36825
|
+
if (dto.connected_by !== void 0) out.connectedBy = dto.connected_by;
|
|
36826
|
+
return out;
|
|
36827
|
+
}
|
|
36828
|
+
function OAuthStartResponseFromApiToFront(dto) {
|
|
36829
|
+
return {
|
|
36830
|
+
authUrl: dto.auth_url
|
|
36831
|
+
};
|
|
36832
|
+
}
|
|
36833
|
+
|
|
36834
|
+
// src/resources/connectors.ts
|
|
36835
|
+
var ConnectorsClient = class {
|
|
36836
|
+
/** @internal */
|
|
36837
|
+
api;
|
|
36838
|
+
/** @internal */
|
|
36839
|
+
constructor(api) {
|
|
36840
|
+
this.api = api;
|
|
36841
|
+
}
|
|
36842
|
+
/**
|
|
36843
|
+
* List the connector types this build supports.
|
|
36844
|
+
*
|
|
36845
|
+
* @returns Every connector type's wire name, display name, auth type,
|
|
36846
|
+
* and optional icon URL.
|
|
36847
|
+
*/
|
|
36848
|
+
async listTypes() {
|
|
36849
|
+
const response = await this.api.listTypes();
|
|
36850
|
+
return (response.data ?? []).map(ConnectorTypeFromApiToFront);
|
|
36851
|
+
}
|
|
36852
|
+
/**
|
|
36853
|
+
* List all registered connector instances.
|
|
36854
|
+
*
|
|
36855
|
+
* @returns The registered instances, each with its connection status.
|
|
36856
|
+
*/
|
|
36857
|
+
async list() {
|
|
36858
|
+
const response = await this.api.list();
|
|
36859
|
+
return (response.data ?? []).map(ConnectorInstanceFromApiToFront);
|
|
36860
|
+
}
|
|
36861
|
+
/**
|
|
36862
|
+
* Register a new connector instance.
|
|
36863
|
+
*
|
|
36864
|
+
* @param request - The instance name and the connector type to register.
|
|
36865
|
+
* @returns The newly-registered instance id, name, and status.
|
|
36866
|
+
*/
|
|
36867
|
+
async add(request) {
|
|
36868
|
+
const response = await this.api.add(AddConnectorRequestFromFrontToApi(request));
|
|
36869
|
+
return AddConnectorResponseFromApiToFront(response.data);
|
|
36870
|
+
}
|
|
36871
|
+
/**
|
|
36872
|
+
* Remove a registered connector instance.
|
|
36873
|
+
*
|
|
36874
|
+
* @param name - The instance name.
|
|
36875
|
+
*/
|
|
36876
|
+
async remove(name) {
|
|
36877
|
+
await this.api.remove(name);
|
|
36878
|
+
}
|
|
36879
|
+
/**
|
|
36880
|
+
* Start an OAuth flow for a connector instance.
|
|
36881
|
+
*
|
|
36882
|
+
* @param name - The instance name.
|
|
36883
|
+
* @returns The authorization URL the caller should redirect the user to.
|
|
36884
|
+
*/
|
|
36885
|
+
async startOauth(name) {
|
|
36886
|
+
const response = await this.api.startOauth(name);
|
|
36887
|
+
return OAuthStartResponseFromApiToFront(response.data);
|
|
36888
|
+
}
|
|
36889
|
+
/**
|
|
36890
|
+
* Disconnect a connector instance (drop its stored credentials).
|
|
36891
|
+
*
|
|
36892
|
+
* @param name - The instance name.
|
|
36893
|
+
*/
|
|
36894
|
+
async disconnect(name) {
|
|
36895
|
+
await this.api.disconnect(name);
|
|
36896
|
+
}
|
|
36897
|
+
/**
|
|
36898
|
+
* OAuth callback — the provider redirects here after authorization.
|
|
36899
|
+
*
|
|
36900
|
+
* @param name - The instance name.
|
|
36901
|
+
* @param query - The OAuth callback parameters (`code` on success;
|
|
36902
|
+
* `error`/`errorDescription` on failure; the opaque `state`).
|
|
36903
|
+
* @returns The raw `Response` — the backend returns an HTML page that
|
|
36904
|
+
* posts a message to the opener window. The caller usually does not
|
|
36905
|
+
* need the body; check `response.ok` for transport errors.
|
|
36906
|
+
*
|
|
36907
|
+
* @remarks
|
|
36908
|
+
* This endpoint is normally hit by the browser (the OAuth provider's
|
|
36909
|
+
* redirect target), not called directly by SDK consumers. It is exposed
|
|
36910
|
+
* for completeness / server-side testing.
|
|
36911
|
+
*/
|
|
36912
|
+
async oauthCallback(name, query = {}) {
|
|
36913
|
+
const response = await this.api.oauthCallback(name, query);
|
|
36914
|
+
return response;
|
|
36915
|
+
}
|
|
36916
|
+
};
|
|
36917
|
+
|
|
34319
36918
|
// src/client.ts
|
|
34320
36919
|
var ReasoningLayerClient = class {
|
|
34321
36920
|
/** Sort (type hierarchy) operations. */
|
|
@@ -34482,6 +37081,26 @@ var ReasoningLayerClient = class {
|
|
|
34482
37081
|
agui;
|
|
34483
37082
|
/** Ontology export — OWL ontology and SHACL shapes projected from the sort lattice. */
|
|
34484
37083
|
ontologyExport;
|
|
37084
|
+
/** Demo substrate seeding — full SUMO + demo scenarios into the tenant substrate. */
|
|
37085
|
+
demo;
|
|
37086
|
+
/** Execution-free reward scoring for candidate queries (recall / precision). */
|
|
37087
|
+
reward;
|
|
37088
|
+
/** Language translation (text → target language, markdown preserved). */
|
|
37089
|
+
translation;
|
|
37090
|
+
/** Probabilistic streaming sketches (Count-Min frequency, Misra-Gries heavy hitters, Bloom membership). */
|
|
37091
|
+
streaming;
|
|
37092
|
+
/** Split-conformal prediction — calibrate a non-conformity threshold, then predict with coverage certificates. */
|
|
37093
|
+
conformal;
|
|
37094
|
+
/** Video-clip encoding (V-JEPA substrate; per-frame predicted-sort labels). */
|
|
37095
|
+
vision;
|
|
37096
|
+
/** GDPR/HIPAA batch anonymization (k-anonymity or Safe Harbor). */
|
|
37097
|
+
anonymization;
|
|
37098
|
+
/** Speaker voiceprint enrollment + listing. */
|
|
37099
|
+
speakers;
|
|
37100
|
+
/** Speech synthesis / transcription / voice cloning + realtime session setup. */
|
|
37101
|
+
speech;
|
|
37102
|
+
/** External data connectors — register / list / remove / connect / disconnect + OAuth callback. */
|
|
37103
|
+
connectors;
|
|
34485
37104
|
// ─── Group Caches ─────────────────────────────────────────────────
|
|
34486
37105
|
_core;
|
|
34487
37106
|
_ai;
|
|
@@ -34789,6 +37408,16 @@ var ReasoningLayerClient = class {
|
|
|
34789
37408
|
this.guardrail = new GuardrailClient(generatedGuardrail);
|
|
34790
37409
|
this.agui = new AguiClient(generatedAgui);
|
|
34791
37410
|
this.ontologyExport = new OntologyExportClient(generatedOntologyExport);
|
|
37411
|
+
this.demo = new DemoClient(new Demo(generatedHttp));
|
|
37412
|
+
this.reward = new RewardClient(new Reward(generatedHttp));
|
|
37413
|
+
this.translation = new TranslationClient(new Translation(generatedHttp));
|
|
37414
|
+
this.streaming = new StreamingClient(new Streaming(generatedHttp));
|
|
37415
|
+
this.conformal = new ConformalClient(new Conformal(generatedHttp));
|
|
37416
|
+
this.vision = new VisionClient(new Vision(generatedHttp));
|
|
37417
|
+
this.anonymization = new AnonymizationClient(new Anonymization(generatedHttp));
|
|
37418
|
+
this.speakers = new SpeakersClient(new Speakers(generatedHttp));
|
|
37419
|
+
this.speech = new SpeechClient(new Speech(generatedHttp));
|
|
37420
|
+
this.connectors = new ConnectorsClient(new Connectors(generatedHttp));
|
|
34792
37421
|
}
|
|
34793
37422
|
};
|
|
34794
37423
|
|
|
@@ -35042,6 +37671,36 @@ var agui_exports = {};
|
|
|
35042
37671
|
// src/types/ontology-export.ts
|
|
35043
37672
|
var ontology_export_exports = {};
|
|
35044
37673
|
|
|
37674
|
+
// src/types/demo.ts
|
|
37675
|
+
var demo_exports = {};
|
|
37676
|
+
|
|
37677
|
+
// src/types/reward.ts
|
|
37678
|
+
var reward_exports = {};
|
|
37679
|
+
|
|
37680
|
+
// src/types/translation.ts
|
|
37681
|
+
var translation_exports = {};
|
|
37682
|
+
|
|
37683
|
+
// src/types/streaming.ts
|
|
37684
|
+
var streaming_exports = {};
|
|
37685
|
+
|
|
37686
|
+
// src/types/conformal.ts
|
|
37687
|
+
var conformal_exports = {};
|
|
37688
|
+
|
|
37689
|
+
// src/types/vision.ts
|
|
37690
|
+
var vision_exports = {};
|
|
37691
|
+
|
|
37692
|
+
// src/types/anonymization.ts
|
|
37693
|
+
var anonymization_exports = {};
|
|
37694
|
+
|
|
37695
|
+
// src/types/speakers.ts
|
|
37696
|
+
var speakers_exports = {};
|
|
37697
|
+
|
|
37698
|
+
// src/types/speech.ts
|
|
37699
|
+
var speech_exports = {};
|
|
37700
|
+
|
|
37701
|
+
// src/types/connectors.ts
|
|
37702
|
+
var connectors_exports = {};
|
|
37703
|
+
|
|
35045
37704
|
// src/builders/value.ts
|
|
35046
37705
|
var Value = {
|
|
35047
37706
|
/**
|
|
@@ -36053,6 +38712,7 @@ exports.Actions = actions_exports;
|
|
|
36053
38712
|
exports.Admin = admin_exports;
|
|
36054
38713
|
exports.Agui = agui_exports;
|
|
36055
38714
|
exports.Analysis = analysis_exports;
|
|
38715
|
+
exports.Anonymization = anonymization_exports;
|
|
36056
38716
|
exports.ApiError = ApiError;
|
|
36057
38717
|
exports.AuthenticationError = AuthenticationError;
|
|
36058
38718
|
exports.Authz = authz_exports;
|
|
@@ -36066,7 +38726,9 @@ exports.Collections = collections_exports;
|
|
|
36066
38726
|
exports.Communities = communities_exports;
|
|
36067
38727
|
exports.Compliance = compliance_exports;
|
|
36068
38728
|
exports.ComplianceMarkings = compliance_markings_exports;
|
|
38729
|
+
exports.Conformal = conformal_exports;
|
|
36069
38730
|
exports.Conformance = conformance_exports;
|
|
38731
|
+
exports.Connectors = connectors_exports;
|
|
36070
38732
|
exports.Constraint = Constraint;
|
|
36071
38733
|
exports.ConstraintViolationError = ConstraintViolationError;
|
|
36072
38734
|
exports.Constraints = constraints_exports;
|
|
@@ -36074,6 +38736,7 @@ exports.Control = control_exports;
|
|
|
36074
38736
|
exports.Conversation = conversation_exports;
|
|
36075
38737
|
exports.Corpus = corpus_exports;
|
|
36076
38738
|
exports.DL = dl_exports;
|
|
38739
|
+
exports.Demo = demo_exports;
|
|
36077
38740
|
exports.Discovery = discovery_exports;
|
|
36078
38741
|
exports.DocumentCheck = document_check_exports;
|
|
36079
38742
|
exports.Documents = documents_exports;
|
|
@@ -36127,6 +38790,7 @@ exports.ReasoningLayerClient = ReasoningLayerClient;
|
|
|
36127
38790
|
exports.ReasoningLayerError = ReasoningLayerError;
|
|
36128
38791
|
exports.Research = research_exports;
|
|
36129
38792
|
exports.Reviews = reviews_exports;
|
|
38793
|
+
exports.Reward = reward_exports;
|
|
36130
38794
|
exports.Row = row_exports;
|
|
36131
38795
|
exports.SDK_VERSION = SDK_VERSION;
|
|
36132
38796
|
exports.Sat = sat_exports;
|
|
@@ -36139,17 +38803,22 @@ exports.Sorts = sorts_exports;
|
|
|
36139
38803
|
exports.Sources = sources_exports;
|
|
36140
38804
|
exports.Spaces = spaces_exports;
|
|
36141
38805
|
exports.Sparql = sparql_exports;
|
|
38806
|
+
exports.Speakers = speakers_exports;
|
|
38807
|
+
exports.Speech = speech_exports;
|
|
36142
38808
|
exports.Statistical = statistical_exports;
|
|
38809
|
+
exports.Streaming = streaming_exports;
|
|
36143
38810
|
exports.Synthetic = synthetic_exports;
|
|
36144
38811
|
exports.Temporal = temporal_exports;
|
|
36145
38812
|
exports.Terms = terms_exports;
|
|
36146
38813
|
exports.TimeoutError = TimeoutError;
|
|
38814
|
+
exports.Translation = translation_exports;
|
|
36147
38815
|
exports.UI = ui_exports;
|
|
36148
38816
|
exports.Utilities = utilities_exports;
|
|
36149
38817
|
exports.ValidationError = ValidationError;
|
|
36150
38818
|
exports.Value = Value;
|
|
36151
38819
|
exports.Values = values_exports;
|
|
36152
38820
|
exports.Verification = verification_exports;
|
|
38821
|
+
exports.Vision = vision_exports;
|
|
36153
38822
|
exports.Visualization = visualization_exports;
|
|
36154
38823
|
exports.WebSocketClient = WebSocketClient;
|
|
36155
38824
|
exports.WebSocketConnection = WebSocketConnection;
|