@faiber/faiber-knowledge 0.24.1 → 1.1.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 +169 -10
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +302 -39
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +282 -3
- package/dist/index.js.map +1 -1
- package/dist/operations.d.ts +317 -237
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +259 -163
- package/dist/operations.js.map +1 -1
- package/dist/operations.types.d.ts +109 -421
- package/dist/operations.types.d.ts.map +1 -1
- package/dist/types.d.ts +872 -90
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -3
- package/provenance.json +26 -0
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { ApiEnvelope, JsonObject, JsonValue, QueryParams } from "@faiber/sdk-core";
|
|
2
|
+
/** Accepted by the backend importance validator; response records remain strings for historical data. */
|
|
3
|
+
export type KnowledgeImportance = "debug" | "info" | "notice" | "warning" | "urgent" | "critical";
|
|
4
|
+
export type KnowledgeActionStatus = "open" | "acknowledged" | "snoozed" | "completed" | "dismissed";
|
|
2
5
|
export interface KnowledgeListQuery extends QueryParams {
|
|
3
6
|
q?: string;
|
|
4
7
|
status?: string;
|
|
5
8
|
group?: string;
|
|
6
9
|
kind?: string;
|
|
10
|
+
linked_service?: string;
|
|
11
|
+
linked_entity_type?: string;
|
|
12
|
+
linked_entity_id?: string;
|
|
7
13
|
page?: number;
|
|
8
14
|
limit?: number;
|
|
9
15
|
}
|
|
@@ -20,11 +26,15 @@ export interface KnowledgeBase extends JsonObject {
|
|
|
20
26
|
version: number;
|
|
21
27
|
created_at: string;
|
|
22
28
|
updated_at: string;
|
|
29
|
+
published_release_id: string | null;
|
|
30
|
+
created_by: string | null;
|
|
31
|
+
updated_by: string | null;
|
|
32
|
+
deleted_at: string | null;
|
|
23
33
|
}
|
|
24
34
|
export interface KnowledgeGroup extends JsonObject {
|
|
25
35
|
id: string;
|
|
26
36
|
knowledge_base_id: string;
|
|
27
|
-
parent_id
|
|
37
|
+
parent_id: string | null;
|
|
28
38
|
slug: string;
|
|
29
39
|
name: JsonValue;
|
|
30
40
|
description: JsonValue;
|
|
@@ -32,6 +42,10 @@ export interface KnowledgeGroup extends JsonObject {
|
|
|
32
42
|
inclusion_policy: JsonValue;
|
|
33
43
|
status: string;
|
|
34
44
|
version: number;
|
|
45
|
+
level: number;
|
|
46
|
+
created_at: string;
|
|
47
|
+
updated_at: string;
|
|
48
|
+
deleted_at: string | null;
|
|
35
49
|
}
|
|
36
50
|
export interface KnowledgeItem extends JsonObject {
|
|
37
51
|
id: string;
|
|
@@ -47,6 +61,21 @@ export interface KnowledgeItem extends JsonObject {
|
|
|
47
61
|
importance: string;
|
|
48
62
|
status: string;
|
|
49
63
|
version: number;
|
|
64
|
+
description: JsonValue;
|
|
65
|
+
linked_service: string | null;
|
|
66
|
+
linked_entity_type: string | null;
|
|
67
|
+
linked_entity_id: string | null;
|
|
68
|
+
link_url: string | null;
|
|
69
|
+
open_in_new_tab: boolean;
|
|
70
|
+
show_when: JsonValue;
|
|
71
|
+
valid_from: string | null;
|
|
72
|
+
valid_to: string | null;
|
|
73
|
+
checksum_sha256: string;
|
|
74
|
+
created_by: string | null;
|
|
75
|
+
updated_by: string | null;
|
|
76
|
+
created_at: string;
|
|
77
|
+
updated_at: string;
|
|
78
|
+
deleted_at: string | null;
|
|
50
79
|
}
|
|
51
80
|
export interface KnowledgeEdge extends JsonObject {
|
|
52
81
|
id: string;
|
|
@@ -58,6 +87,8 @@ export interface KnowledgeEdge extends JsonObject {
|
|
|
58
87
|
weight: number;
|
|
59
88
|
status: string;
|
|
60
89
|
version: number;
|
|
90
|
+
created_at: string;
|
|
91
|
+
updated_at: string;
|
|
61
92
|
}
|
|
62
93
|
export interface ChatBinding extends JsonObject {
|
|
63
94
|
id: string;
|
|
@@ -68,11 +99,14 @@ export interface ChatBinding extends JsonObject {
|
|
|
68
99
|
tool_policy: JsonValue;
|
|
69
100
|
enabled: boolean;
|
|
70
101
|
version: number;
|
|
102
|
+
organization_id: string;
|
|
103
|
+
created_at: string;
|
|
104
|
+
updated_at: string;
|
|
71
105
|
}
|
|
72
106
|
export interface MatchRule extends JsonObject {
|
|
73
107
|
id: string;
|
|
74
108
|
knowledge_base_id: string;
|
|
75
|
-
group_id
|
|
109
|
+
group_id: string | null;
|
|
76
110
|
slug: string;
|
|
77
111
|
name: JsonValue;
|
|
78
112
|
priority: number;
|
|
@@ -81,6 +115,9 @@ export interface MatchRule extends JsonObject {
|
|
|
81
115
|
stop_on_match: boolean;
|
|
82
116
|
enabled: boolean;
|
|
83
117
|
version: number;
|
|
118
|
+
created_at: string;
|
|
119
|
+
updated_at: string;
|
|
120
|
+
deleted_at: string | null;
|
|
84
121
|
}
|
|
85
122
|
export interface CreateKnowledgeBaseInput extends JsonObject {
|
|
86
123
|
slug: string;
|
|
@@ -91,16 +128,16 @@ export interface CreateKnowledgeBaseInput extends JsonObject {
|
|
|
91
128
|
settings?: JsonValue;
|
|
92
129
|
}
|
|
93
130
|
export interface UpdateKnowledgeBaseInput extends JsonObject {
|
|
94
|
-
name?: string;
|
|
95
|
-
description?: string;
|
|
96
|
-
default_language?: string;
|
|
131
|
+
name?: string | null;
|
|
132
|
+
description?: string | null;
|
|
133
|
+
default_language?: string | null;
|
|
97
134
|
supported_languages?: JsonValue;
|
|
98
135
|
settings?: JsonValue;
|
|
99
|
-
status?: string;
|
|
100
|
-
expected_version?: number;
|
|
136
|
+
status?: string | null;
|
|
137
|
+
expected_version?: number | null;
|
|
101
138
|
}
|
|
102
139
|
export interface CreateGroupInput extends JsonObject {
|
|
103
|
-
parent_id?: string;
|
|
140
|
+
parent_id?: string | null;
|
|
104
141
|
slug: string;
|
|
105
142
|
name: JsonValue;
|
|
106
143
|
description?: JsonValue;
|
|
@@ -108,13 +145,13 @@ export interface CreateGroupInput extends JsonObject {
|
|
|
108
145
|
inclusion_policy?: JsonValue;
|
|
109
146
|
}
|
|
110
147
|
export interface UpdateGroupInput extends JsonObject {
|
|
111
|
-
parent_id?: string;
|
|
148
|
+
parent_id?: string | null;
|
|
112
149
|
name?: JsonValue;
|
|
113
150
|
description?: JsonValue;
|
|
114
|
-
sort_order?: number;
|
|
151
|
+
sort_order?: number | null;
|
|
115
152
|
inclusion_policy?: JsonValue;
|
|
116
|
-
status?: string;
|
|
117
|
-
expected_version?: number;
|
|
153
|
+
status?: string | null;
|
|
154
|
+
expected_version?: number | null;
|
|
118
155
|
}
|
|
119
156
|
export interface CreateItemInput extends JsonObject {
|
|
120
157
|
group_id: string;
|
|
@@ -125,23 +162,37 @@ export interface CreateItemInput extends JsonObject {
|
|
|
125
162
|
content: JsonValue;
|
|
126
163
|
metadata?: JsonValue;
|
|
127
164
|
tags?: JsonValue;
|
|
128
|
-
importance?:
|
|
129
|
-
valid_from?: string;
|
|
130
|
-
valid_to?: string;
|
|
165
|
+
importance?: KnowledgeImportance;
|
|
166
|
+
valid_from?: string | null;
|
|
167
|
+
valid_to?: string | null;
|
|
168
|
+
description?: JsonValue;
|
|
169
|
+
linked_service?: string | null;
|
|
170
|
+
linked_entity_type?: string | null;
|
|
171
|
+
linked_entity_id?: string | null;
|
|
172
|
+
link_url?: string | null;
|
|
173
|
+
open_in_new_tab?: boolean;
|
|
174
|
+
show_when?: JsonValue;
|
|
131
175
|
}
|
|
132
176
|
export interface UpdateItemInput extends JsonObject {
|
|
133
|
-
group_id?: string;
|
|
134
|
-
kind?: string;
|
|
177
|
+
group_id?: string | null;
|
|
178
|
+
kind?: string | null;
|
|
135
179
|
title?: JsonValue;
|
|
136
180
|
summary?: JsonValue;
|
|
137
181
|
content?: JsonValue;
|
|
138
182
|
metadata?: JsonValue;
|
|
139
183
|
tags?: JsonValue;
|
|
140
|
-
importance?:
|
|
141
|
-
status?: string;
|
|
142
|
-
valid_from?: string;
|
|
143
|
-
valid_to?: string;
|
|
144
|
-
expected_version?: number;
|
|
184
|
+
importance?: KnowledgeImportance | null;
|
|
185
|
+
status?: string | null;
|
|
186
|
+
valid_from?: string | null;
|
|
187
|
+
valid_to?: string | null;
|
|
188
|
+
expected_version?: number | null;
|
|
189
|
+
description?: JsonValue;
|
|
190
|
+
linked_service?: string | null;
|
|
191
|
+
linked_entity_type?: string | null;
|
|
192
|
+
linked_entity_id?: string | null;
|
|
193
|
+
link_url?: string | null;
|
|
194
|
+
open_in_new_tab?: boolean | null;
|
|
195
|
+
show_when?: JsonValue;
|
|
145
196
|
}
|
|
146
197
|
export interface CreateEdgeInput extends JsonObject {
|
|
147
198
|
from_item_id: string;
|
|
@@ -151,11 +202,11 @@ export interface CreateEdgeInput extends JsonObject {
|
|
|
151
202
|
weight?: number;
|
|
152
203
|
}
|
|
153
204
|
export interface UpdateEdgeInput extends JsonObject {
|
|
154
|
-
edge_type?: string;
|
|
205
|
+
edge_type?: string | null;
|
|
155
206
|
conditions?: JsonValue;
|
|
156
|
-
weight?: number;
|
|
157
|
-
status?: string;
|
|
158
|
-
expected_version?: number;
|
|
207
|
+
weight?: number | null;
|
|
208
|
+
status?: string | null;
|
|
209
|
+
expected_version?: number | null;
|
|
159
210
|
}
|
|
160
211
|
export interface CreateBindingInput extends JsonObject {
|
|
161
212
|
chat_slug: string;
|
|
@@ -167,14 +218,14 @@ export interface CreateBindingInput extends JsonObject {
|
|
|
167
218
|
}
|
|
168
219
|
export interface UpdateBindingInput extends JsonObject {
|
|
169
220
|
group_slugs?: JsonValue;
|
|
170
|
-
max_level?: number;
|
|
221
|
+
max_level?: number | null;
|
|
171
222
|
tool_policy?: JsonValue;
|
|
172
|
-
enabled?: boolean;
|
|
173
|
-
expected_version?: number;
|
|
223
|
+
enabled?: boolean | null;
|
|
224
|
+
expected_version?: number | null;
|
|
174
225
|
}
|
|
175
226
|
export interface CreateRuleInput extends JsonObject {
|
|
176
227
|
knowledge_base_id: string;
|
|
177
|
-
group_id?: string;
|
|
228
|
+
group_id?: string | null;
|
|
178
229
|
slug: string;
|
|
179
230
|
name: JsonValue;
|
|
180
231
|
priority?: number;
|
|
@@ -184,31 +235,34 @@ export interface CreateRuleInput extends JsonObject {
|
|
|
184
235
|
enabled?: boolean;
|
|
185
236
|
}
|
|
186
237
|
export interface UpdateRuleInput extends JsonObject {
|
|
187
|
-
group_id?: string;
|
|
238
|
+
group_id?: string | null;
|
|
188
239
|
name?: JsonValue;
|
|
189
|
-
priority?: number;
|
|
240
|
+
priority?: number | null;
|
|
190
241
|
conditions?: JsonValue;
|
|
191
242
|
outcomes?: JsonValue;
|
|
192
|
-
stop_on_match?: boolean;
|
|
193
|
-
enabled?: boolean;
|
|
194
|
-
expected_version?: number;
|
|
243
|
+
stop_on_match?: boolean | null;
|
|
244
|
+
enabled?: boolean | null;
|
|
245
|
+
expected_version?: number | null;
|
|
195
246
|
}
|
|
196
247
|
export interface RuntimeQueryInput extends JsonObject {
|
|
197
|
-
query?: string;
|
|
198
|
-
profile_id?: string;
|
|
248
|
+
query?: string | null;
|
|
249
|
+
profile_id?: string | null;
|
|
199
250
|
profile?: JsonValue;
|
|
200
251
|
props?: JsonValue;
|
|
201
252
|
meta?: JsonValue;
|
|
202
253
|
inputs?: JsonValue;
|
|
203
254
|
group_slugs?: JsonValue;
|
|
204
|
-
level?: number;
|
|
205
|
-
limit?: number;
|
|
255
|
+
level?: number | null;
|
|
256
|
+
limit?: number | null;
|
|
257
|
+
compact?: boolean;
|
|
258
|
+
max_context_chars?: number | null;
|
|
206
259
|
event?: JsonValue;
|
|
207
260
|
}
|
|
208
261
|
export interface RuntimeResult extends JsonObject {
|
|
209
262
|
chat_slug: string;
|
|
210
|
-
release
|
|
263
|
+
release: JsonValue;
|
|
211
264
|
knowledge: JsonValue[];
|
|
265
|
+
suggestions: JsonValue[];
|
|
212
266
|
matched_rules: JsonValue[];
|
|
213
267
|
notifications: JsonValue[];
|
|
214
268
|
warnings: JsonValue[];
|
|
@@ -218,6 +272,8 @@ export interface RuntimeResult extends JsonObject {
|
|
|
218
272
|
trace: JsonValue;
|
|
219
273
|
}
|
|
220
274
|
export interface MemorySubjectQuery extends QueryParams {
|
|
275
|
+
enabled?: boolean;
|
|
276
|
+
status?: "active" | "disabled" | "forgotten";
|
|
221
277
|
assistant_id?: string;
|
|
222
278
|
q?: string;
|
|
223
279
|
memory_type?: "short" | "long";
|
|
@@ -225,30 +281,39 @@ export interface MemorySubjectQuery extends QueryParams {
|
|
|
225
281
|
limit?: number;
|
|
226
282
|
}
|
|
227
283
|
export interface MemoryOverrideInput extends JsonObject {
|
|
228
|
-
|
|
229
|
-
|
|
284
|
+
expected_revision: string;
|
|
285
|
+
short_memory_enabled?: boolean | null;
|
|
286
|
+
long_memory_enabled?: boolean | null;
|
|
287
|
+
reason?: string | null;
|
|
230
288
|
}
|
|
231
289
|
export interface ActionStatusInput extends JsonObject {
|
|
232
|
-
status:
|
|
290
|
+
status: KnowledgeActionStatus;
|
|
233
291
|
input?: JsonValue;
|
|
234
292
|
}
|
|
235
293
|
export type KnowledgeBaseResponse = ApiEnvelope<KnowledgeBase>;
|
|
236
|
-
export
|
|
294
|
+
export interface KnowledgeBaseListResponse extends ApiEnvelope<KnowledgeBase[]> {
|
|
295
|
+
meta: KnowledgePaginationMeta;
|
|
296
|
+
}
|
|
237
297
|
export type KnowledgeGroupResponse = ApiEnvelope<KnowledgeGroup>;
|
|
238
298
|
export type KnowledgeGroupListResponse = ApiEnvelope<KnowledgeGroup[]>;
|
|
239
299
|
export type KnowledgeItemResponse = ApiEnvelope<KnowledgeItem>;
|
|
240
|
-
export
|
|
300
|
+
export interface KnowledgeItemListResponse extends ApiEnvelope<KnowledgeItem[]> {
|
|
301
|
+
meta: KnowledgePaginationMeta;
|
|
302
|
+
}
|
|
241
303
|
export type KnowledgeEdgeResponse = ApiEnvelope<KnowledgeEdge>;
|
|
242
304
|
export type KnowledgeEdgeListResponse = ApiEnvelope<KnowledgeEdge[]>;
|
|
243
305
|
export type ChatBindingResponse = ApiEnvelope<ChatBinding>;
|
|
244
306
|
export type ChatBindingListResponse = ApiEnvelope<ChatBinding[]>;
|
|
245
307
|
export type MatchRuleResponse = ApiEnvelope<MatchRule>;
|
|
246
|
-
export
|
|
308
|
+
export interface MatchRuleListResponse extends ApiEnvelope<MatchRule[]> {
|
|
309
|
+
meta: KnowledgePaginationMeta;
|
|
310
|
+
}
|
|
247
311
|
export type RuntimeResultResponse = ApiEnvelope<RuntimeResult>;
|
|
248
312
|
export type ContextMode = "economy" | "balanced" | "deep" | "custom";
|
|
249
313
|
export type DependencyState = "ready" | "empty" | "stale" | "degraded" | "denied" | "unavailable";
|
|
250
314
|
export interface AssistantConfigurationInput extends JsonObject {
|
|
251
|
-
|
|
315
|
+
configuration_id: string;
|
|
316
|
+
expected_policy_revision: number;
|
|
252
317
|
assistant_name?: string;
|
|
253
318
|
knowledge_base_ids?: string[];
|
|
254
319
|
recommender_group_ids?: string[];
|
|
@@ -284,18 +349,20 @@ export interface AssistantQueryInput extends JsonObject {
|
|
|
284
349
|
user_id: string;
|
|
285
350
|
query?: string;
|
|
286
351
|
profile?: JsonValue;
|
|
287
|
-
profile_version?: string;
|
|
288
|
-
profile_source?: string;
|
|
289
|
-
profile_refreshed_at?: string;
|
|
290
|
-
conversation_id?: string;
|
|
352
|
+
profile_version?: string | null;
|
|
353
|
+
profile_source?: string | null;
|
|
354
|
+
profile_refreshed_at?: string | null;
|
|
355
|
+
conversation_id?: string | null;
|
|
291
356
|
drm_media_ids?: string[];
|
|
292
|
-
model_id?: string;
|
|
357
|
+
model_id?: string | null;
|
|
293
358
|
context?: JsonValue;
|
|
294
359
|
delivered_memory_ids?: string[];
|
|
295
360
|
delivered_result_ids?: string[];
|
|
296
|
-
context_cursor?: string;
|
|
361
|
+
context_cursor?: string | null;
|
|
297
362
|
force_full_context?: boolean;
|
|
363
|
+
evaluation_case_id?: string | null;
|
|
298
364
|
query_embedding?: number[];
|
|
365
|
+
/** Retrieval prefetch limit (default 12, clamped to 1–50 and policy); not a combined response-row cap. */
|
|
299
366
|
limit?: number;
|
|
300
367
|
}
|
|
301
368
|
export interface RetrievalBudget extends JsonObject {
|
|
@@ -305,12 +372,12 @@ export interface RetrievalBudget extends JsonObject {
|
|
|
305
372
|
dropped_count: number;
|
|
306
373
|
truncated: boolean;
|
|
307
374
|
estimator: string;
|
|
308
|
-
sections
|
|
375
|
+
sections?: Record<string, number>;
|
|
309
376
|
}
|
|
310
377
|
export interface AssistantRuntimeResult extends JsonObject {
|
|
311
|
-
policy:
|
|
378
|
+
policy: AssistantPolicy | MissingAssistantPolicy;
|
|
312
379
|
knowledge: JsonValue[];
|
|
313
|
-
memory:
|
|
380
|
+
memory: AssistantRuntimeMemory;
|
|
314
381
|
recommendations: JsonValue[];
|
|
315
382
|
citations: JsonValue[];
|
|
316
383
|
findings: JsonValue[];
|
|
@@ -320,14 +387,14 @@ export interface AssistantRuntimeResult extends JsonObject {
|
|
|
320
387
|
export interface MemoryTurnInput extends JsonObject {
|
|
321
388
|
user_id: string;
|
|
322
389
|
profile?: JsonValue;
|
|
323
|
-
profile_version?: string;
|
|
324
|
-
profile_source?: string;
|
|
325
|
-
profile_refreshed_at?: string;
|
|
390
|
+
profile_version?: string | null;
|
|
391
|
+
profile_source?: string | null;
|
|
392
|
+
profile_refreshed_at?: string | null;
|
|
326
393
|
conversation_id: string;
|
|
327
394
|
user_message: string;
|
|
328
395
|
assistant_message: string;
|
|
329
|
-
user_message_id?: string;
|
|
330
|
-
assistant_message_id?: string;
|
|
396
|
+
user_message_id?: string | null;
|
|
397
|
+
assistant_message_id?: string | null;
|
|
331
398
|
}
|
|
332
399
|
export interface RecordAssistantTurnInput extends MemoryTurnInput {
|
|
333
400
|
}
|
|
@@ -337,8 +404,8 @@ export interface RetrievalUsageInput extends JsonObject {
|
|
|
337
404
|
reasoning_tokens?: number;
|
|
338
405
|
output_tokens?: number;
|
|
339
406
|
token_attribution?: JsonValue;
|
|
340
|
-
actual_cost?: number;
|
|
341
|
-
outcome?: string;
|
|
407
|
+
actual_cost?: number | null;
|
|
408
|
+
outcome?: string | null;
|
|
342
409
|
}
|
|
343
410
|
export interface PlatformStatus extends JsonObject {
|
|
344
411
|
service: string;
|
|
@@ -365,36 +432,131 @@ export interface PlatformStatus extends JsonObject {
|
|
|
365
432
|
missing_embeddings: number;
|
|
366
433
|
memory_backlog: number;
|
|
367
434
|
dead_letters: number;
|
|
368
|
-
retrieval:
|
|
435
|
+
retrieval: RetrievalMetrics;
|
|
369
436
|
dependencies: Record<string, string>;
|
|
370
437
|
}
|
|
438
|
+
/** Source kinds accepted by configuration validation. Availability of an execution adapter is separate. */
|
|
439
|
+
export type KnowledgeSourceType = "manual" | "api" | "crawler" | "web" | "sitemap" | "rss" | "infera-drm" | "infera-session" | "structured" | "database-export";
|
|
371
440
|
export interface KnowledgeSource extends JsonObject {
|
|
372
441
|
id: string;
|
|
442
|
+
organization_id: string;
|
|
373
443
|
knowledge_base_id: string;
|
|
374
444
|
slug: string;
|
|
375
445
|
name: JsonValue;
|
|
376
446
|
source_type: string;
|
|
447
|
+
configuration: JsonValue;
|
|
448
|
+
provenance_policy: JsonValue;
|
|
377
449
|
status: string;
|
|
378
450
|
sync_status: string;
|
|
451
|
+
sync_cursor: string | null;
|
|
379
452
|
document_count: number;
|
|
380
453
|
chunk_count: number;
|
|
381
|
-
last_error
|
|
382
|
-
last_synced_at
|
|
454
|
+
last_error: string | null;
|
|
455
|
+
last_synced_at: string | null;
|
|
456
|
+
version: number;
|
|
457
|
+
created_at: string;
|
|
458
|
+
updated_at: string;
|
|
459
|
+
converter_id: string | null;
|
|
460
|
+
converter_version: string | null;
|
|
461
|
+
configuration_checksum: string | null;
|
|
462
|
+
next_sync_at: string | null;
|
|
463
|
+
stale_at: string | null;
|
|
464
|
+
last_success_at: string | null;
|
|
465
|
+
schedule: string | null;
|
|
466
|
+
}
|
|
467
|
+
/** Slug is 2–120 lowercase ASCII letters/digits/hyphens/underscores. Use Control secret references instead of raw credentials. */
|
|
468
|
+
export interface CreateKnowledgeSourceInput extends JsonObject {
|
|
469
|
+
knowledge_base_id: string;
|
|
470
|
+
slug: string;
|
|
471
|
+
name: JsonValue;
|
|
472
|
+
source_type: KnowledgeSourceType;
|
|
473
|
+
configuration?: JsonValue;
|
|
474
|
+
provenance_policy?: JsonValue;
|
|
383
475
|
}
|
|
476
|
+
export type KnowledgeSourceResponse = ApiEnvelope<KnowledgeSource>;
|
|
477
|
+
/** Durable enqueue receipt; queued does not certify worker execution or adapter availability. */
|
|
478
|
+
export interface KnowledgeQueuedJob extends JsonObject {
|
|
479
|
+
job_id: string;
|
|
480
|
+
queued: true;
|
|
481
|
+
}
|
|
482
|
+
export type KnowledgeQueuedJobResponse = ApiEnvelope<KnowledgeQueuedJob>;
|
|
483
|
+
/** Document list projection. Content, metadata and checksum are not returned by this list endpoint. */
|
|
384
484
|
export interface KnowledgeDocument extends JsonObject {
|
|
385
485
|
id: string;
|
|
386
486
|
knowledge_base_id: string;
|
|
387
|
-
source_id
|
|
388
|
-
external_id
|
|
487
|
+
source_id: string | null;
|
|
488
|
+
external_id: string | null;
|
|
389
489
|
title: string;
|
|
390
490
|
media_type: string;
|
|
391
|
-
language
|
|
491
|
+
language: string | null;
|
|
392
492
|
provenance: JsonValue;
|
|
393
|
-
metadata: JsonValue;
|
|
394
493
|
status: string;
|
|
395
|
-
|
|
494
|
+
indexed_at: string | null;
|
|
396
495
|
version: number;
|
|
496
|
+
created_at: string;
|
|
497
|
+
}
|
|
498
|
+
export interface IndexedDocumentReceipt extends JsonObject {
|
|
499
|
+
id: string;
|
|
500
|
+
job_id: string;
|
|
501
|
+
checksum: string;
|
|
502
|
+
chunks: number;
|
|
503
|
+
status: "indexed";
|
|
504
|
+
}
|
|
505
|
+
export interface UnchangedDocumentReceipt extends JsonObject {
|
|
506
|
+
id: string;
|
|
507
|
+
checksum: string;
|
|
508
|
+
chunks: number;
|
|
509
|
+
status: "unchanged";
|
|
510
|
+
}
|
|
511
|
+
export type IngestDocumentReceipt = IndexedDocumentReceipt | UnchangedDocumentReceipt;
|
|
512
|
+
export type IngestDocumentResponse = ApiEnvelope<IngestDocumentReceipt>;
|
|
513
|
+
export interface KnowledgeCustomerAction extends JsonObject {
|
|
514
|
+
id: string;
|
|
515
|
+
organization_id: string;
|
|
516
|
+
knowledge_base_id: string;
|
|
517
|
+
evaluation_id: string | null;
|
|
518
|
+
profile_id: string | null;
|
|
519
|
+
action_type: string;
|
|
520
|
+
importance: string;
|
|
521
|
+
title: JsonValue;
|
|
522
|
+
body: JsonValue;
|
|
523
|
+
payload: JsonValue;
|
|
524
|
+
status: string;
|
|
525
|
+
dedupe_key: string | null;
|
|
526
|
+
due_at: string | null;
|
|
527
|
+
created_at: string;
|
|
528
|
+
updated_at: string;
|
|
529
|
+
completed_at: string | null;
|
|
530
|
+
}
|
|
531
|
+
export type KnowledgeCustomerActionResponse = ApiEnvelope<KnowledgeCustomerAction>;
|
|
532
|
+
export type KnowledgeCustomerActionListResponse = ApiEnvelope<KnowledgeCustomerAction[]>;
|
|
533
|
+
/** Authoring editor audit history, distinct from platform audit events. */
|
|
534
|
+
export interface KnowledgeAuditLog extends JsonObject {
|
|
535
|
+
id: string;
|
|
536
|
+
organization_id: string;
|
|
537
|
+
actor_id: string | null;
|
|
538
|
+
action: string;
|
|
539
|
+
entity_type: string;
|
|
540
|
+
entity_id: string;
|
|
541
|
+
before: JsonValue;
|
|
542
|
+
after: JsonValue;
|
|
543
|
+
request_id: string | null;
|
|
544
|
+
created_at: string;
|
|
545
|
+
}
|
|
546
|
+
export type KnowledgeAuditLogListResponse = ApiEnvelope<KnowledgeAuditLog[]>;
|
|
547
|
+
export interface KnowledgeAuditEvent extends JsonObject {
|
|
548
|
+
id: string;
|
|
549
|
+
organization_id: string;
|
|
550
|
+
actor_user_id: string | null;
|
|
551
|
+
action: string;
|
|
552
|
+
entity_type: string;
|
|
553
|
+
entity_id: string | null;
|
|
554
|
+
reason: string | null;
|
|
555
|
+
before_state: JsonValue;
|
|
556
|
+
after_state: JsonValue;
|
|
557
|
+
created_at: string;
|
|
397
558
|
}
|
|
559
|
+
export type KnowledgeAuditEventListResponse = ApiEnvelope<KnowledgeAuditEvent[]>;
|
|
398
560
|
export interface ConverterCapability extends JsonObject {
|
|
399
561
|
id: string;
|
|
400
562
|
display_name: JsonValue;
|
|
@@ -402,6 +564,7 @@ export interface ConverterCapability extends JsonObject {
|
|
|
402
564
|
extensions: string[];
|
|
403
565
|
mime_types: string[];
|
|
404
566
|
capabilities: string[];
|
|
567
|
+
features: string[];
|
|
405
568
|
output_types: string[];
|
|
406
569
|
supported_languages: string[];
|
|
407
570
|
limits: JsonValue;
|
|
@@ -412,23 +575,51 @@ export interface ConverterCapability extends JsonObject {
|
|
|
412
575
|
version: string;
|
|
413
576
|
mode: string;
|
|
414
577
|
}
|
|
578
|
+
/** Full processing-job row returned by list/retry/cancel; counters are not proof of completed execution. */
|
|
415
579
|
export interface ProcessingJob extends JsonObject {
|
|
416
580
|
id: string;
|
|
417
581
|
organization_id: string;
|
|
418
|
-
knowledge_base_id
|
|
419
|
-
source_id
|
|
420
|
-
document_id
|
|
582
|
+
knowledge_base_id: string | null;
|
|
583
|
+
source_id: string | null;
|
|
584
|
+
document_id: string | null;
|
|
585
|
+
project_id: string | null;
|
|
586
|
+
owner_user_id: string | null;
|
|
421
587
|
job_type: string;
|
|
422
588
|
status: string;
|
|
423
589
|
stage: string;
|
|
424
590
|
progress: number;
|
|
425
591
|
attempts: number;
|
|
426
592
|
max_attempts: number;
|
|
593
|
+
priority: number;
|
|
594
|
+
idempotency_key: string | null;
|
|
595
|
+
input_payload: JsonValue;
|
|
596
|
+
input_checksum: string | null;
|
|
597
|
+
converter_version: string | null;
|
|
598
|
+
chunker_version: string | null;
|
|
599
|
+
summarizer_version: string | null;
|
|
600
|
+
embedding_version: string | null;
|
|
601
|
+
requested_tokens: number;
|
|
602
|
+
actual_tokens: number;
|
|
603
|
+
estimated_cost: number | null;
|
|
604
|
+
actual_cost: number | null;
|
|
605
|
+
item_total: number;
|
|
606
|
+
item_completed: number;
|
|
607
|
+
eta_at: string | null;
|
|
427
608
|
next_attempt_at: string;
|
|
428
|
-
|
|
429
|
-
|
|
609
|
+
lease_owner: string | null;
|
|
610
|
+
lease_expires_at: string | null;
|
|
611
|
+
cancel_requested_at: string | null;
|
|
612
|
+
dead_lettered_at: string | null;
|
|
613
|
+
error_code: string | null;
|
|
614
|
+
error_detail: string | null;
|
|
615
|
+
metrics: JsonValue;
|
|
430
616
|
safe_log: JsonValue;
|
|
617
|
+
created_at: string;
|
|
618
|
+
started_at: string | null;
|
|
619
|
+
finished_at: string | null;
|
|
620
|
+
updated_at: string;
|
|
431
621
|
}
|
|
622
|
+
export type ProcessingJobResponse = ApiEnvelope<ProcessingJob>;
|
|
432
623
|
export interface IngestDocumentInput extends JsonObject {
|
|
433
624
|
knowledge_base_id: string;
|
|
434
625
|
source_id?: string | null;
|
|
@@ -436,7 +627,7 @@ export interface IngestDocumentInput extends JsonObject {
|
|
|
436
627
|
title: string;
|
|
437
628
|
content: string;
|
|
438
629
|
media_type?: string;
|
|
439
|
-
language?: string;
|
|
630
|
+
language?: string | null;
|
|
440
631
|
provenance?: JsonValue;
|
|
441
632
|
metadata?: JsonValue;
|
|
442
633
|
}
|
|
@@ -448,24 +639,615 @@ export type ConverterListResponse = ApiEnvelope<ConverterCapability[]>;
|
|
|
448
639
|
export type ConverterCapabilityListResponse = ConverterListResponse;
|
|
449
640
|
export type ProcessingJobListResponse = ApiEnvelope<ProcessingJob[]>;
|
|
450
641
|
/** Published contract content and deliberately extensible JSON Schema metadata. */
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
};
|
|
461
|
-
};
|
|
642
|
+
/** Backend preserves authored JSON content and metadata; callers validate their own contract schema/version. */
|
|
643
|
+
export interface PublishedAssistantContractMetadata extends JsonObject {
|
|
644
|
+
contract_version: JsonValue;
|
|
645
|
+
output_schema?: JsonValue;
|
|
646
|
+
shared_contract?: JsonValue;
|
|
647
|
+
}
|
|
648
|
+
export interface PublishedAssistantContract extends JsonObject {
|
|
649
|
+
content: JsonValue;
|
|
650
|
+
metadata: PublishedAssistantContractMetadata;
|
|
462
651
|
}
|
|
463
652
|
export interface AssistantContractsResult {
|
|
464
653
|
release_id: string;
|
|
465
654
|
shared_release_id?: string | null;
|
|
466
655
|
contracts: Record<string, PublishedAssistantContract>;
|
|
467
656
|
}
|
|
468
|
-
export
|
|
469
|
-
|
|
657
|
+
export type AssistantContractsResponse = ApiEnvelope<AssistantContractsResult>;
|
|
658
|
+
/** Immutable release snapshot. JSON content, rules and policy fields preserve their backend-defined extension values. */
|
|
659
|
+
export interface KnowledgePublicationManifest extends JsonObject {
|
|
660
|
+
schema_version: string;
|
|
661
|
+
release_version: number;
|
|
662
|
+
knowledge_base: KnowledgeBase;
|
|
663
|
+
groups: KnowledgeGroup[];
|
|
664
|
+
items: KnowledgeItem[];
|
|
665
|
+
edges: KnowledgeEdge[];
|
|
666
|
+
rules: MatchRule[];
|
|
667
|
+
}
|
|
668
|
+
/** A published or retired immutable snapshot, not the mutable knowledge-base record. */
|
|
669
|
+
export interface KnowledgeRelease extends JsonObject {
|
|
670
|
+
id: string;
|
|
671
|
+
knowledge_base_id: string;
|
|
672
|
+
version: number;
|
|
673
|
+
manifest: KnowledgePublicationManifest;
|
|
674
|
+
checksum_sha256: string;
|
|
675
|
+
status: string;
|
|
676
|
+
published_by: string | null;
|
|
677
|
+
published_at: string;
|
|
678
|
+
retired_at: string | null;
|
|
679
|
+
}
|
|
680
|
+
/** Mutable authoring export. Use KnowledgeRelease for pinned runtime instructions. */
|
|
681
|
+
export interface KnowledgeExport extends JsonObject {
|
|
682
|
+
schema_version: string;
|
|
683
|
+
exported_at: string;
|
|
684
|
+
knowledge_base: KnowledgeBase;
|
|
685
|
+
groups: KnowledgeGroup[];
|
|
686
|
+
items: KnowledgeItem[];
|
|
687
|
+
edges: KnowledgeEdge[];
|
|
688
|
+
rules: MatchRule[];
|
|
689
|
+
}
|
|
690
|
+
export type KnowledgeReleaseResponse = ApiEnvelope<KnowledgeRelease>;
|
|
691
|
+
export type KnowledgeExportResponse = ApiEnvelope<KnowledgeExport>;
|
|
692
|
+
/** Match-rule filters apply before pagination across every active owned base. Search matches slug or localized name text. */
|
|
693
|
+
export interface KnowledgeRuleListQuery extends QueryParams {
|
|
694
|
+
q?: string;
|
|
695
|
+
knowledge_base_id?: string;
|
|
696
|
+
group_id?: string;
|
|
697
|
+
enabled?: boolean;
|
|
698
|
+
page?: number;
|
|
699
|
+
limit?: number;
|
|
700
|
+
}
|
|
701
|
+
export interface KnowledgePaginationMeta {
|
|
702
|
+
total: number;
|
|
703
|
+
page: number;
|
|
704
|
+
limit: number;
|
|
705
|
+
}
|
|
706
|
+
export interface MemorySubjectPolicy extends JsonObject {
|
|
707
|
+
effective_override_mode: "narrow_only";
|
|
708
|
+
short_memory_enabled: boolean | null;
|
|
709
|
+
long_memory_enabled: boolean | null;
|
|
710
|
+
status: string | null;
|
|
711
|
+
policy_revision: number | null;
|
|
712
|
+
override_widening_allowed: boolean | null;
|
|
713
|
+
}
|
|
714
|
+
export interface MemorySubjectOverrides extends JsonObject {
|
|
715
|
+
short_memory_enabled: boolean | null;
|
|
716
|
+
long_memory_enabled: boolean | null;
|
|
717
|
+
revision: number;
|
|
718
|
+
}
|
|
719
|
+
export interface MemorySubjectCapabilities extends JsonObject {
|
|
720
|
+
set_policy: boolean;
|
|
721
|
+
forget: boolean;
|
|
722
|
+
correct: boolean;
|
|
723
|
+
}
|
|
724
|
+
export interface MemorySubject extends JsonObject {
|
|
725
|
+
id: string;
|
|
726
|
+
assistant_id: string;
|
|
727
|
+
assistant_name: string | null;
|
|
728
|
+
user_id: string;
|
|
729
|
+
profile_id: string | null;
|
|
730
|
+
profile: MemorySubjectProfile;
|
|
731
|
+
status: "active" | "disabled" | "forgotten";
|
|
732
|
+
short_memory_enabled: boolean;
|
|
733
|
+
long_memory_enabled: boolean;
|
|
734
|
+
short_memory_count: number;
|
|
735
|
+
long_memory_count: number;
|
|
736
|
+
last_seen_at: string | null;
|
|
737
|
+
profile_refreshed_at: string | null;
|
|
738
|
+
policy: MemorySubjectPolicy;
|
|
739
|
+
overrides: MemorySubjectOverrides;
|
|
740
|
+
expected_revision: string;
|
|
741
|
+
scope_epochs: MemoryScopeEpochs;
|
|
742
|
+
capabilities: MemorySubjectCapabilities;
|
|
743
|
+
}
|
|
744
|
+
export type MemorySubjectResponse = ApiEnvelope<MemorySubject>;
|
|
745
|
+
export interface MemorySubjectListResponse extends ApiEnvelope<MemorySubject[]> {
|
|
746
|
+
meta: KnowledgePaginationMeta;
|
|
747
|
+
}
|
|
748
|
+
export interface MemoryRecordQuery extends QueryParams {
|
|
749
|
+
page?: number;
|
|
750
|
+
limit?: number;
|
|
751
|
+
memory_type?: "short" | "long";
|
|
752
|
+
status?: "all" | "active" | "superseded" | "contradicted" | "forgotten" | "expired";
|
|
753
|
+
}
|
|
754
|
+
export interface MemoryEvidence extends JsonObject {
|
|
755
|
+
id: string;
|
|
756
|
+
source_kind: "conversation_turn" | "user_correction";
|
|
757
|
+
source_event_id: string;
|
|
758
|
+
conversation_id: string;
|
|
759
|
+
message_id: string | null;
|
|
760
|
+
source_order: "unverified";
|
|
761
|
+
observed_at: string;
|
|
762
|
+
}
|
|
763
|
+
export interface MemoryRecord extends JsonObject {
|
|
764
|
+
id: string;
|
|
765
|
+
subject_id: string;
|
|
766
|
+
memory_type: "short" | "long";
|
|
767
|
+
kind: string;
|
|
768
|
+
fact_type: string | null;
|
|
769
|
+
identity_cardinality: "singleton" | "independent" | null;
|
|
770
|
+
status: "active" | "superseded" | "contradicted" | "forgotten" | "expired";
|
|
771
|
+
redacted: boolean;
|
|
772
|
+
content: string | null;
|
|
773
|
+
content_truncated: boolean;
|
|
774
|
+
fact_key: string | null;
|
|
775
|
+
fact_value: JsonValue;
|
|
776
|
+
fact_value_truncated: boolean;
|
|
777
|
+
confidence: number | null;
|
|
778
|
+
extraction_version: string | null;
|
|
779
|
+
created_at: string;
|
|
780
|
+
updated_at: string;
|
|
781
|
+
expires_at: string | null;
|
|
782
|
+
forgotten_at: string | null;
|
|
783
|
+
superseded_by: string | null;
|
|
784
|
+
contradicted_by: string | null;
|
|
785
|
+
provenance: MemoryEvidence[];
|
|
786
|
+
}
|
|
787
|
+
export type MemoryRecordResponse = ApiEnvelope<MemoryRecord>;
|
|
788
|
+
export interface MemoryRecordListResponse extends ApiEnvelope<MemoryRecord[]> {
|
|
789
|
+
meta: KnowledgePaginationMeta & {
|
|
790
|
+
expected_revision: string;
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
export interface MemoryAuditQuery extends QueryParams {
|
|
794
|
+
page?: number;
|
|
795
|
+
limit?: number;
|
|
796
|
+
}
|
|
797
|
+
export interface MemoryAuditEntry extends JsonObject {
|
|
798
|
+
id: string;
|
|
799
|
+
action: string;
|
|
800
|
+
entity_type: string;
|
|
801
|
+
entity_id: string | null;
|
|
802
|
+
actor_user_id: string | null;
|
|
803
|
+
created_at: string;
|
|
804
|
+
}
|
|
805
|
+
export interface MemoryAuditListResponse extends ApiEnvelope<MemoryAuditEntry[]> {
|
|
806
|
+
meta: KnowledgePaginationMeta;
|
|
807
|
+
}
|
|
808
|
+
export interface MemoryCorrectionInput extends JsonObject {
|
|
809
|
+
correction_id: string;
|
|
810
|
+
expected_memory_ids: string[];
|
|
811
|
+
user_statement: string;
|
|
812
|
+
reason: string;
|
|
813
|
+
}
|
|
814
|
+
export interface MemoryCorrectionReceipt extends JsonObject {
|
|
815
|
+
correction_id: string;
|
|
816
|
+
memory_id: string;
|
|
817
|
+
replaced_memory_ids: string[];
|
|
818
|
+
applied: true;
|
|
819
|
+
replayed: boolean;
|
|
820
|
+
}
|
|
821
|
+
export type MemoryCorrectionResponse = ApiEnvelope<MemoryCorrectionReceipt>;
|
|
822
|
+
export interface MemoryClearQuery extends QueryParams {
|
|
823
|
+
memory_type?: "short" | "long";
|
|
824
|
+
reason?: string;
|
|
825
|
+
}
|
|
826
|
+
export interface MemoryScopeForgetInput extends JsonObject {
|
|
827
|
+
user_id: string;
|
|
828
|
+
memory_type?: "short" | "long";
|
|
829
|
+
reason?: string;
|
|
830
|
+
}
|
|
831
|
+
export interface MemoryScopeClearResult extends JsonObject {
|
|
832
|
+
scope_fenced: true;
|
|
833
|
+
rows_changed: number;
|
|
834
|
+
cleared: true;
|
|
835
|
+
subject_id: string | null;
|
|
836
|
+
}
|
|
837
|
+
export interface MemoryScopeForgetResponse {
|
|
838
|
+
jsonrpc: "2.0";
|
|
839
|
+
id: JsonValue;
|
|
840
|
+
result: {
|
|
841
|
+
content: Array<{
|
|
842
|
+
type: "text";
|
|
843
|
+
text: string;
|
|
844
|
+
}>;
|
|
845
|
+
structuredContent: MemoryScopeClearResult;
|
|
846
|
+
isError?: boolean;
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
export interface SourceStateInput extends JsonObject {
|
|
850
|
+
desired_state: "active" | "paused";
|
|
851
|
+
expected_version: number;
|
|
852
|
+
}
|
|
853
|
+
export interface AssistantPolicySnapshot extends JsonObject {
|
|
854
|
+
assistant_id: string;
|
|
855
|
+
exists: boolean;
|
|
856
|
+
expected_policy_revision: number;
|
|
857
|
+
configuration: AssistantPolicy | null;
|
|
858
|
+
}
|
|
859
|
+
export type AssistantPolicySnapshotResponse = ApiEnvelope<AssistantPolicySnapshot>;
|
|
860
|
+
export interface AssistantConfigurationReceipt extends JsonObject {
|
|
861
|
+
assistant_id: string;
|
|
862
|
+
configuration_id: string;
|
|
863
|
+
configured: true;
|
|
864
|
+
replayed: boolean;
|
|
865
|
+
policy_revision: number;
|
|
866
|
+
}
|
|
867
|
+
export type AssistantConfigurationResponse = ApiEnvelope<AssistantConfigurationReceipt>;
|
|
868
|
+
export interface AssistantConfigurationOperation extends JsonObject {
|
|
869
|
+
id: string;
|
|
870
|
+
organization_id: string;
|
|
871
|
+
assistant_id: string;
|
|
872
|
+
actor_id: string | null;
|
|
873
|
+
request: JsonObject;
|
|
874
|
+
policy_revision: number | null;
|
|
875
|
+
status: "applied" | "cancelled";
|
|
876
|
+
created_at: string;
|
|
877
|
+
}
|
|
878
|
+
export type AssistantConfigurationOperationResponse = ApiEnvelope<AssistantConfigurationOperation>;
|
|
879
|
+
export interface AssistantConfigurationCancellation extends JsonObject {
|
|
880
|
+
reason: string;
|
|
881
|
+
}
|
|
882
|
+
/** Nullable metrics when no scoped trace exists in the last 24 hours. */
|
|
883
|
+
export interface RetrievalMetrics extends JsonObject {
|
|
884
|
+
p50_ms: number | null;
|
|
885
|
+
p95_ms: number | null;
|
|
886
|
+
p99_ms: number | null;
|
|
887
|
+
citation_coverage: number | null;
|
|
888
|
+
context_tokens: number | null;
|
|
889
|
+
}
|
|
890
|
+
/** Persisted policy row, including configuration and governed rollout settings. */
|
|
891
|
+
export interface AssistantPolicy extends JsonObject {
|
|
892
|
+
id: string;
|
|
893
|
+
organization_id: string;
|
|
894
|
+
assistant_id: string;
|
|
895
|
+
assistant_name: string;
|
|
896
|
+
short_memory_enabled: boolean;
|
|
897
|
+
long_memory_enabled: boolean;
|
|
898
|
+
short_memory_turns: number;
|
|
899
|
+
long_memory_limit: number;
|
|
900
|
+
retention_days: number;
|
|
901
|
+
status: string;
|
|
902
|
+
version: number;
|
|
903
|
+
created_at: string;
|
|
904
|
+
updated_at: string;
|
|
905
|
+
policy_revision: number;
|
|
906
|
+
context_mode: ContextMode;
|
|
907
|
+
context_budget_tokens: number;
|
|
908
|
+
knowledge_enabled: boolean;
|
|
909
|
+
recommenders_enabled: boolean;
|
|
910
|
+
selected_media_enabled: boolean;
|
|
911
|
+
session_enabled: boolean;
|
|
912
|
+
max_knowledge_results: number;
|
|
913
|
+
max_chunks_per_document: number;
|
|
914
|
+
max_selected_media_chunks: number;
|
|
915
|
+
max_session_items: number;
|
|
916
|
+
max_findings: number;
|
|
917
|
+
max_recommendations: number;
|
|
918
|
+
graph_enabled: boolean;
|
|
919
|
+
vector_enabled: boolean;
|
|
920
|
+
query_expansion_enabled: boolean;
|
|
921
|
+
reranking_enabled: boolean;
|
|
922
|
+
selected_media_budget_percent: number;
|
|
923
|
+
knowledge_budget_percent: number;
|
|
924
|
+
memory_budget_percent: number;
|
|
925
|
+
recommender_budget_percent: number;
|
|
926
|
+
profile_budget_percent: number;
|
|
927
|
+
session_budget_percent: number;
|
|
928
|
+
findings_budget_percent: number;
|
|
929
|
+
retrieval_strategy: string;
|
|
930
|
+
organization_rollout_cohort: string | null;
|
|
931
|
+
fallback_policy: JsonValue;
|
|
932
|
+
override_widening_allowed: boolean;
|
|
933
|
+
short_memory_retention_days: number;
|
|
934
|
+
long_memory_retention_days: number;
|
|
935
|
+
}
|
|
936
|
+
export interface MissingAssistantPolicy extends JsonObject {
|
|
937
|
+
status: "missing";
|
|
938
|
+
knowledge_enabled: false;
|
|
939
|
+
short_memory_enabled: false;
|
|
940
|
+
long_memory_enabled: false;
|
|
941
|
+
recommenders_enabled: false;
|
|
942
|
+
}
|
|
943
|
+
/** Payloads preserve the retrieval provider's heterogeneous persisted memory rows. */
|
|
944
|
+
export interface AssistantRuntimeMemory extends JsonObject {
|
|
945
|
+
short: JsonValue[];
|
|
946
|
+
long: JsonValue[];
|
|
947
|
+
subject_id: string | null;
|
|
948
|
+
}
|
|
949
|
+
export interface CatalogKnowledgeBase extends JsonObject {
|
|
950
|
+
id: string;
|
|
951
|
+
slug: string;
|
|
952
|
+
name: string;
|
|
953
|
+
status: string;
|
|
954
|
+
}
|
|
955
|
+
export interface CatalogRecommenderGroup extends JsonObject {
|
|
956
|
+
id: string;
|
|
957
|
+
slug: string;
|
|
958
|
+
name: JsonValue;
|
|
959
|
+
status: string;
|
|
960
|
+
max_results: number;
|
|
961
|
+
}
|
|
962
|
+
export interface CatalogAssistantPolicy extends AssistantPolicy {
|
|
963
|
+
knowledge_base_ids: string[];
|
|
964
|
+
recommender_group_ids: string[];
|
|
965
|
+
}
|
|
966
|
+
export interface KnowledgeCatalog extends JsonObject {
|
|
967
|
+
knowledge_bases: CatalogKnowledgeBase[];
|
|
968
|
+
recommender_groups: CatalogRecommenderGroup[];
|
|
969
|
+
assistant_policies: CatalogAssistantPolicy[];
|
|
970
|
+
}
|
|
971
|
+
export type KnowledgeCatalogResponse = ApiEnvelope<KnowledgeCatalog>;
|
|
972
|
+
export interface KnowledgeEvaluationCase extends JsonObject {
|
|
973
|
+
id: string;
|
|
974
|
+
organization_id: string;
|
|
975
|
+
knowledge_base_id: string | null;
|
|
976
|
+
assistant_id: string | null;
|
|
977
|
+
stable_key: string;
|
|
978
|
+
language: string | null;
|
|
979
|
+
query: string;
|
|
980
|
+
sanitized_context: JsonValue;
|
|
981
|
+
relevant_targets: JsonValue;
|
|
982
|
+
expected_top1: string | null;
|
|
983
|
+
selected_media_ids: string[];
|
|
984
|
+
thresholds: JsonValue;
|
|
985
|
+
status: string;
|
|
986
|
+
created_at: string;
|
|
987
|
+
updated_at: string;
|
|
988
|
+
}
|
|
989
|
+
export type KnowledgeEvaluationCaseResponse = ApiEnvelope<KnowledgeEvaluationCase>;
|
|
990
|
+
export type KnowledgeEvaluationCaseListResponse = ApiEnvelope<KnowledgeEvaluationCase[]>;
|
|
991
|
+
export interface RecommenderGroup extends JsonObject {
|
|
992
|
+
id: string;
|
|
993
|
+
organization_id: string;
|
|
994
|
+
slug: string;
|
|
995
|
+
name: JsonValue;
|
|
996
|
+
description: JsonValue;
|
|
997
|
+
strategy: string;
|
|
998
|
+
conditions: JsonValue;
|
|
999
|
+
max_results: number;
|
|
1000
|
+
status: string;
|
|
1001
|
+
version: number;
|
|
1002
|
+
created_at: string;
|
|
1003
|
+
updated_at: string;
|
|
1004
|
+
}
|
|
1005
|
+
export interface RecommenderItem extends JsonObject {
|
|
1006
|
+
id: string;
|
|
1007
|
+
organization_id: string;
|
|
1008
|
+
recommender_group_id: string;
|
|
1009
|
+
stable_key: string;
|
|
1010
|
+
kind: string;
|
|
1011
|
+
label: JsonValue;
|
|
1012
|
+
description: JsonValue;
|
|
1013
|
+
linked_service: string | null;
|
|
1014
|
+
linked_entity_type: string | null;
|
|
1015
|
+
linked_entity_id: string | null;
|
|
1016
|
+
link_url: string | null;
|
|
1017
|
+
action_style: string;
|
|
1018
|
+
open_in_new_tab: boolean;
|
|
1019
|
+
conditions: JsonValue;
|
|
1020
|
+
tags: JsonValue;
|
|
1021
|
+
base_score: number;
|
|
1022
|
+
sort_order: number;
|
|
1023
|
+
enabled: boolean;
|
|
1024
|
+
version: number;
|
|
1025
|
+
created_at: string;
|
|
1026
|
+
updated_at: string;
|
|
1027
|
+
}
|
|
1028
|
+
export interface RecommenderGroupWithItems extends RecommenderGroup {
|
|
1029
|
+
items: RecommenderItem[];
|
|
1030
|
+
}
|
|
1031
|
+
export type RecommenderGroupResponse = ApiEnvelope<RecommenderGroup>;
|
|
1032
|
+
export type RecommenderItemResponse = ApiEnvelope<RecommenderItem>;
|
|
1033
|
+
export type RecommenderGroupListResponse = ApiEnvelope<RecommenderGroupWithItems[]>;
|
|
1034
|
+
export interface MemoryOutboxReplay extends JsonObject {
|
|
1035
|
+
id: string;
|
|
1036
|
+
status: "pending";
|
|
1037
|
+
}
|
|
1038
|
+
export type MemoryOutboxReplayResponse = ApiEnvelope<MemoryOutboxReplay>;
|
|
1039
|
+
export interface CacheInvalidation extends JsonObject {
|
|
1040
|
+
entries_removed: number;
|
|
1041
|
+
}
|
|
1042
|
+
export type CacheInvalidationResponse = ApiEnvelope<CacheInvalidation>;
|
|
1043
|
+
export interface MemoryTurnQueued extends JsonObject {
|
|
1044
|
+
queued: true;
|
|
1045
|
+
outbox_id: string;
|
|
1046
|
+
status: string;
|
|
1047
|
+
idempotency_key: string;
|
|
1048
|
+
}
|
|
1049
|
+
export interface MemoryTurnSkipped extends JsonObject {
|
|
1050
|
+
queued: false;
|
|
1051
|
+
reason: "assistant_policy_missing_or_inactive" | "memory_disabled" | "memory_subject_disabled_or_override";
|
|
1052
|
+
}
|
|
1053
|
+
/** HTTP 202 records admission or an explicit skip; it does not certify extraction. */
|
|
1054
|
+
export type MemoryTurnResponse = ApiEnvelope<MemoryTurnQueued | MemoryTurnSkipped>;
|
|
1055
|
+
export interface RetrievalUsageReceipt extends JsonObject {
|
|
1056
|
+
id: string;
|
|
1057
|
+
retrieval_tokens: number;
|
|
1058
|
+
final_prompt_tokens: number;
|
|
1059
|
+
cached_input_tokens: number;
|
|
1060
|
+
reasoning_tokens: number;
|
|
1061
|
+
output_tokens: number;
|
|
1062
|
+
token_attribution: JsonValue;
|
|
1063
|
+
actual_cost: number | null;
|
|
1064
|
+
}
|
|
1065
|
+
export type RetrievalUsageResponse = ApiEnvelope<RetrievalUsageReceipt>;
|
|
1066
|
+
export interface DocumentEvidence extends JsonObject {
|
|
1067
|
+
id: string;
|
|
1068
|
+
knowledge_base_id: string;
|
|
1069
|
+
title: string;
|
|
1070
|
+
content: string;
|
|
1071
|
+
full_transcript: string | null;
|
|
1072
|
+
document_role: string;
|
|
1073
|
+
composition_id: string | null;
|
|
1074
|
+
part_id: string | null;
|
|
1075
|
+
media_id: string | null;
|
|
1076
|
+
media_role: string | null;
|
|
1077
|
+
provenance: JsonValue;
|
|
1078
|
+
metadata: JsonValue;
|
|
1079
|
+
checksum: string;
|
|
1080
|
+
version: number;
|
|
1081
|
+
}
|
|
1082
|
+
export type DocumentEvidenceResponse = ApiEnvelope<DocumentEvidence>;
|
|
1083
|
+
export interface SessionEvidence extends JsonObject {
|
|
1084
|
+
id: string;
|
|
1085
|
+
knowledge_base_id: string;
|
|
1086
|
+
room_id: string;
|
|
1087
|
+
recording_id: string | null;
|
|
1088
|
+
track_id: string | null;
|
|
1089
|
+
summary: string;
|
|
1090
|
+
transcript: string | null;
|
|
1091
|
+
analysis: JsonValue;
|
|
1092
|
+
linked_composition_id: string | null;
|
|
1093
|
+
provenance: JsonValue;
|
|
1094
|
+
projected_at: string;
|
|
1095
|
+
}
|
|
1096
|
+
export type SessionEvidenceResponse = ApiEnvelope<SessionEvidence>;
|
|
1097
|
+
export interface KnowledgeReadiness extends JsonObject {
|
|
1098
|
+
service: string;
|
|
1099
|
+
version: string;
|
|
1100
|
+
commit: string;
|
|
1101
|
+
status: "ready" | "degraded";
|
|
1102
|
+
dependencies: {
|
|
1103
|
+
database: "ready" | "unavailable";
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
export type KnowledgeReadinessResponse = ApiEnvelope<KnowledgeReadiness>;
|
|
1107
|
+
export interface TaskProjectionCandidate extends JsonObject {
|
|
1108
|
+
note_id: string;
|
|
1109
|
+
project_id: string;
|
|
1110
|
+
version: number;
|
|
1111
|
+
}
|
|
1112
|
+
export type TaskProjectionCandidateListResponse = ApiEnvelope<TaskProjectionCandidate[]>;
|
|
1113
|
+
export interface TaskProjectionReceipt extends JsonObject {
|
|
1114
|
+
note_id: string;
|
|
1115
|
+
version: number;
|
|
1116
|
+
}
|
|
1117
|
+
export type TaskProjectionResponse = ApiEnvelope<TaskProjectionReceipt>;
|
|
1118
|
+
/** JSON Schema is an extensible document, not an application data placeholder. */
|
|
1119
|
+
export interface KnowledgeToolSchema extends JsonObject {
|
|
1120
|
+
name: string;
|
|
1121
|
+
description: string;
|
|
1122
|
+
input_schema: JsonObject;
|
|
1123
|
+
}
|
|
1124
|
+
export type KnowledgeToolSchemaResponse = ApiEnvelope<KnowledgeToolSchema>;
|
|
1125
|
+
/** JSON-RPC result varies by method/tool; typed convenience calls expose concrete tool results. */
|
|
1126
|
+
export interface KnowledgeMcpSuccess extends JsonObject {
|
|
1127
|
+
jsonrpc: "2.0";
|
|
1128
|
+
id: JsonValue;
|
|
1129
|
+
result: JsonValue;
|
|
1130
|
+
}
|
|
1131
|
+
export interface KnowledgeMcpFailure extends JsonObject {
|
|
1132
|
+
jsonrpc: "2.0";
|
|
1133
|
+
id: JsonValue;
|
|
1134
|
+
error: {
|
|
1135
|
+
code: number;
|
|
1136
|
+
message: string;
|
|
1137
|
+
};
|
|
1138
|
+
}
|
|
1139
|
+
export type KnowledgeMcpResponse = KnowledgeMcpSuccess | KnowledgeMcpFailure;
|
|
1140
|
+
/** Concrete pinned retrieval wire model; payload/title/content/provenance/citations are heterogeneous provider JSON. */
|
|
1141
|
+
export type KnowledgeResultCategory = "authored_item" | "document_chunk" | "graph_neighbor" | "media_transcript_chunk" | "session_evidence" | "profile_fact" | "user_memory" | "finding" | "recommendation";
|
|
1142
|
+
export type KnowledgeExclusionReason = "tenant_scope" | "assistant_scope" | "user_scope" | "base_not_published" | "release_not_published" | "item_not_published" | "deleted" | "not_yet_valid" | "expired" | "group_scope" | "maximum_level" | "condition_mismatch" | "edge_condition_mismatch" | "recommender_group_condition_mismatch" | "recommender_item_condition_mismatch" | "visibility_denied" | "session_scope" | "selected_media_scope" | "duplicate" | "recommender_group_limit" | "selected_media_limit" | "result_limit" | "context_budget" | "policy_disabled" | "already_delivered";
|
|
1143
|
+
export interface KnowledgeRetrievalScore extends JsonObject {
|
|
1144
|
+
lexical: number;
|
|
1145
|
+
vector: number;
|
|
1146
|
+
exact_title: number;
|
|
1147
|
+
entity: number;
|
|
1148
|
+
graph: number;
|
|
1149
|
+
base_priority: number;
|
|
1150
|
+
importance: number;
|
|
1151
|
+
freshness: number;
|
|
1152
|
+
selected_media: number;
|
|
1153
|
+
reciprocal_rank: number;
|
|
1154
|
+
final_score: number;
|
|
1155
|
+
}
|
|
1156
|
+
export interface KnowledgeAcceptedResult extends JsonObject {
|
|
1157
|
+
id: string;
|
|
1158
|
+
category: KnowledgeResultCategory;
|
|
1159
|
+
title: JsonValue;
|
|
1160
|
+
summary: JsonValue;
|
|
1161
|
+
content: JsonValue;
|
|
1162
|
+
provenance: JsonValue;
|
|
1163
|
+
citation: JsonValue;
|
|
1164
|
+
score: KnowledgeRetrievalScore;
|
|
1165
|
+
token_count: number;
|
|
1166
|
+
selected_media: boolean;
|
|
1167
|
+
payload: JsonValue;
|
|
1168
|
+
}
|
|
1169
|
+
export interface KnowledgeExcludedResult extends JsonObject {
|
|
1170
|
+
candidate_id: string;
|
|
1171
|
+
category: KnowledgeResultCategory;
|
|
1172
|
+
reason: KnowledgeExclusionReason;
|
|
1173
|
+
}
|
|
1174
|
+
export interface KnowledgeRetrievalBudget extends JsonObject {
|
|
1175
|
+
requested_tokens: number;
|
|
1176
|
+
used_tokens: number;
|
|
1177
|
+
remaining_tokens: number;
|
|
1178
|
+
dropped_count: number;
|
|
1179
|
+
truncated: boolean;
|
|
1180
|
+
estimator: string;
|
|
1181
|
+
sections: Record<string, number>;
|
|
1182
|
+
}
|
|
1183
|
+
export interface KnowledgeRetrievalResult extends JsonObject {
|
|
1184
|
+
candidate_sets: Record<string, number>;
|
|
1185
|
+
accepted_results: KnowledgeAcceptedResult[];
|
|
1186
|
+
excluded_results: KnowledgeExcludedResult[];
|
|
1187
|
+
memories: KnowledgeAcceptedResult[];
|
|
1188
|
+
recommendations: KnowledgeAcceptedResult[];
|
|
1189
|
+
findings: KnowledgeAcceptedResult[];
|
|
1190
|
+
citations: JsonValue[];
|
|
1191
|
+
provenance: JsonValue[];
|
|
1192
|
+
score_explanations: Record<string, KnowledgeRetrievalScore>;
|
|
1193
|
+
budget: KnowledgeRetrievalBudget;
|
|
1194
|
+
dependency_state: Record<string, DependencyState>;
|
|
1195
|
+
trace: JsonValue;
|
|
1196
|
+
}
|
|
1197
|
+
export type KnowledgeRetrievalResponse = ApiEnvelope<KnowledgeRetrievalResult>;
|
|
1198
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1199
|
+
export type TaskProjectionsPassagesPostResponseDataAcceptedResultsCategory = KnowledgeResultCategory;
|
|
1200
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1201
|
+
export type TaskProjectionsPassagesPostResponseDataAcceptedResultsScore = KnowledgeRetrievalScore;
|
|
1202
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1203
|
+
export type TaskProjectionsPassagesPostResponseDataAcceptedResults = KnowledgeAcceptedResult;
|
|
1204
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1205
|
+
export type TaskProjectionsPassagesPostResponseDataExcludedResultsCategory = KnowledgeResultCategory;
|
|
1206
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1207
|
+
export type TaskProjectionsPassagesPostResponseDataExcludedResultsReason = KnowledgeExclusionReason;
|
|
1208
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1209
|
+
export type TaskProjectionsPassagesPostResponseDataExcludedResults = KnowledgeExcludedResult;
|
|
1210
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1211
|
+
export type TaskProjectionsPassagesPostResponseDataMemoriesCategory = KnowledgeResultCategory;
|
|
1212
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1213
|
+
export type TaskProjectionsPassagesPostResponseDataMemoriesScore = KnowledgeRetrievalScore;
|
|
1214
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1215
|
+
export type TaskProjectionsPassagesPostResponseDataMemories = KnowledgeAcceptedResult;
|
|
1216
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1217
|
+
export type TaskProjectionsPassagesPostResponseDataRecommendationsCategory = KnowledgeResultCategory;
|
|
1218
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1219
|
+
export type TaskProjectionsPassagesPostResponseDataRecommendationsScore = KnowledgeRetrievalScore;
|
|
1220
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1221
|
+
export type TaskProjectionsPassagesPostResponseDataRecommendations = KnowledgeAcceptedResult;
|
|
1222
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1223
|
+
export type TaskProjectionsPassagesPostResponseDataFindingsCategory = KnowledgeResultCategory;
|
|
1224
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1225
|
+
export type TaskProjectionsPassagesPostResponseDataFindingsScore = KnowledgeRetrievalScore;
|
|
1226
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1227
|
+
export type TaskProjectionsPassagesPostResponseDataFindings = KnowledgeAcceptedResult;
|
|
1228
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1229
|
+
export type TaskProjectionsPassagesPostResponseDataBudget = KnowledgeRetrievalBudget;
|
|
1230
|
+
/** Compatibility alias for the concrete pinned retrieval model. */
|
|
1231
|
+
export type TaskProjectionsPassagesPostResponseData = KnowledgeRetrievalResult;
|
|
1232
|
+
/** Compatibility alias for the assistant runtime payload. */
|
|
1233
|
+
export type PlatformEvaluateAssistantPostResponseData = AssistantRuntimeResult;
|
|
1234
|
+
/** Compatibility alias for the assistant runtime payload. */
|
|
1235
|
+
export type PlatformPreviewAssistantPostResponseData = AssistantRuntimeResult;
|
|
1236
|
+
/** Compatibility alias for the assistant runtime payload. */
|
|
1237
|
+
export type PlatformQueryAssistantPostResponseData = AssistantRuntimeResult;
|
|
1238
|
+
/** Bounded identity fields explicitly projected by the management handler; other profile attributes are omitted. */
|
|
1239
|
+
export interface MemorySubjectProfile extends JsonObject {
|
|
1240
|
+
display_name?: string;
|
|
1241
|
+
full_name?: string;
|
|
1242
|
+
name?: string;
|
|
1243
|
+
first_name?: string;
|
|
1244
|
+
last_name?: string;
|
|
1245
|
+
email?: string;
|
|
1246
|
+
phone?: string;
|
|
1247
|
+
national_code?: string;
|
|
1248
|
+
}
|
|
1249
|
+
export interface MemoryScopeEpochs extends JsonObject {
|
|
1250
|
+
short: number;
|
|
1251
|
+
long: number;
|
|
470
1252
|
}
|
|
471
1253
|
//# sourceMappingURL=types.d.ts.map
|