@xpert-ai/contracts 3.18.1 → 3.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +171 -44
- package/index.esm.js +156 -45
- package/package.json +1 -1
- package/src/ai/assistant-user-preference.model.d.ts +2 -0
- package/src/ai/chat.model.d.ts +13 -0
- package/src/ai/index.d.ts +1 -0
- package/src/ai/knowledge-faq.model.d.ts +72 -0
- package/src/ai/knowledge-filter.model.d.ts +7 -1
- package/src/ai/knowledge-graph.model.d.ts +1 -1
- package/src/ai/knowledgebase.model.d.ts +65 -0
- package/src/ai/xpert.model.d.ts +4 -2
- package/src/data-source.model.d.ts +12 -0
- package/src/plugin.d.ts +12 -0
- package/src/view-extension/assistant-profile.d.ts +41 -0
- package/src/view-extension/index.d.ts +1 -0
- package/src/view-extension/model.d.ts +3 -0
|
@@ -52,7 +52,7 @@ export type KnowledgeFilterSources = {
|
|
|
52
52
|
dynamic?: KnowledgeFilterNode;
|
|
53
53
|
};
|
|
54
54
|
export type KnowledgeFilterStatus = 'not_applied' | 'applied' | 'dynamic_fallback' | 'failed';
|
|
55
|
-
export type KnowledgeFilterErrorCode = 'invalid_filter' | 'unknown_field' | 'invalid_operator' | 'invalid_value' | 'missing_fixed_variable' | 'filter_too_complex' | 'graph_search_failed' | 'unsupported_backend' | 'unsupported_retrieval_mode';
|
|
55
|
+
export type KnowledgeFilterErrorCode = 'invalid_filter' | 'unknown_field' | 'invalid_operator' | 'invalid_value' | 'missing_fixed_variable' | 'filter_too_complex' | 'graph_search_failed' | 'keyword_index_missing' | 'keyword_query_failed' | 'unsupported_backend' | 'unsupported_retrieval_mode';
|
|
56
56
|
export type KnowledgeFilterDiagnostics = {
|
|
57
57
|
filterVersion: typeof KNOWLEDGE_FILTER_VERSION;
|
|
58
58
|
fixedFilter?: KnowledgeFilterNode;
|
|
@@ -70,7 +70,13 @@ export type KnowledgeFilterDiagnostics = {
|
|
|
70
70
|
filterLatency?: number;
|
|
71
71
|
vectorLatency?: number;
|
|
72
72
|
vectorBranchHitCount?: number;
|
|
73
|
+
keywordLatency?: number;
|
|
74
|
+
keywordCandidateCount?: number;
|
|
75
|
+
keywordBranchHitCount?: number;
|
|
76
|
+
keywordIndexStatus?: 'ready' | 'missing';
|
|
77
|
+
keywordFailureReason?: string;
|
|
73
78
|
graphBranchHitCount?: number;
|
|
79
|
+
fusionMode?: 'legacy' | 'weighted_rrf';
|
|
74
80
|
graphGlobalCandidateCount?: number;
|
|
75
81
|
graphCandidateScanLimit?: number;
|
|
76
82
|
graphCandidateScanRounds?: number;
|
|
@@ -17,7 +17,7 @@ export declare enum KnowledgeGraphIndexJobStatus {
|
|
|
17
17
|
CANCELLED = "cancelled"
|
|
18
18
|
}
|
|
19
19
|
export type KnowledgeGraphIndexJobType = 'document' | 'rebuild';
|
|
20
|
-
export type GraphRagRetrievalMode = 'vector' | 'graph' | 'hybrid';
|
|
20
|
+
export type GraphRagRetrievalMode = 'vector' | 'keyword' | 'graph' | 'hybrid';
|
|
21
21
|
export type KnowledgeGraphItemOrigin = 'extracted' | 'manual' | 'curated';
|
|
22
22
|
export type KnowledgeGraphVisibility = 'active' | 'hidden';
|
|
23
23
|
export type GraphRagConfig = {
|
|
@@ -14,8 +14,28 @@ export declare enum KnowledgeProviderEnum {
|
|
|
14
14
|
}
|
|
15
15
|
export declare enum KnowledgebaseTypeEnum {
|
|
16
16
|
Standard = "standard",
|
|
17
|
+
FAQ = "faq",
|
|
17
18
|
External = "external"
|
|
18
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Knowledge bases created before the type discriminator was introduced are document knowledge bases.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isDocumentKnowledgebaseType(type: KnowledgebaseTypeEnum | null | undefined): boolean;
|
|
24
|
+
export type KnowledgebaseFAQIndexMode = 'question_only' | 'question_answer';
|
|
25
|
+
export type KnowledgebaseFAQQuestionIndexMode = 'combined' | 'separate';
|
|
26
|
+
export type KnowledgebaseFAQNegativeMatchMode = 'exact' | 'semantic';
|
|
27
|
+
export type KnowledgebaseFAQConfig = {
|
|
28
|
+
indexMode: KnowledgebaseFAQIndexMode;
|
|
29
|
+
questionIndexMode: KnowledgebaseFAQQuestionIndexMode;
|
|
30
|
+
/** Optional for knowledge bases created before negative matching was configurable. */
|
|
31
|
+
negativeMatchMode?: KnowledgebaseFAQNegativeMatchMode;
|
|
32
|
+
};
|
|
33
|
+
export declare const DEFAULT_KNOWLEDGEBASE_FAQ_CONFIG: {
|
|
34
|
+
readonly indexMode: "question_only";
|
|
35
|
+
readonly questionIndexMode: "separate";
|
|
36
|
+
readonly negativeMatchMode: "exact";
|
|
37
|
+
};
|
|
38
|
+
export type KnowledgeRetrievalMode = 'vector' | 'keyword' | 'graph' | 'hybrid';
|
|
19
39
|
export declare enum KnowledgebaseStatusEnum {
|
|
20
40
|
READY = "ready",
|
|
21
41
|
REBUILD_REQUIRED = "rebuild_required",
|
|
@@ -46,6 +66,10 @@ export type TKnowledgebase = {
|
|
|
46
66
|
* Type of KB
|
|
47
67
|
*/
|
|
48
68
|
type: KnowledgebaseTypeEnum;
|
|
69
|
+
/**
|
|
70
|
+
* Creation-time indexing behavior for FAQ knowledge bases.
|
|
71
|
+
*/
|
|
72
|
+
faqConfig?: KnowledgebaseFAQConfig | null;
|
|
49
73
|
/**
|
|
50
74
|
* English | Chinese
|
|
51
75
|
*/
|
|
@@ -169,6 +193,10 @@ export declare enum KnowledgebasePermission {
|
|
|
169
193
|
* Recall parameters
|
|
170
194
|
*/
|
|
171
195
|
export type TKBRecallParams = {
|
|
196
|
+
/**
|
|
197
|
+
* Default retrieval mode for this knowledgebase.
|
|
198
|
+
*/
|
|
199
|
+
mode?: KnowledgeRetrievalMode;
|
|
172
200
|
/**
|
|
173
201
|
* Top K of result chunks
|
|
174
202
|
*/
|
|
@@ -181,7 +209,44 @@ export type TKBRecallParams = {
|
|
|
181
209
|
* Weight in EnsembleRetriever
|
|
182
210
|
*/
|
|
183
211
|
weight?: number;
|
|
212
|
+
/**
|
|
213
|
+
* Candidate fusion strategy. Missing configuration keeps the legacy behavior.
|
|
214
|
+
*/
|
|
215
|
+
fusion?: TKBFusionConfig;
|
|
216
|
+
};
|
|
217
|
+
export type KnowledgeFusionMode = 'legacy' | 'weighted_rrf';
|
|
218
|
+
export declare const DEFAULT_KNOWLEDGE_RRF_RANK_CONSTANT = 60;
|
|
219
|
+
export declare const DEFAULT_KNOWLEDGE_RRF_WEIGHTS: {
|
|
220
|
+
readonly vector: 0.65;
|
|
221
|
+
readonly graph: 0.35;
|
|
222
|
+
readonly keyword: 0.3;
|
|
223
|
+
};
|
|
224
|
+
export type TKBFusionConfig = {
|
|
225
|
+
mode?: KnowledgeFusionMode;
|
|
226
|
+
rankConstant?: number;
|
|
227
|
+
weights?: {
|
|
228
|
+
vector?: number;
|
|
229
|
+
graph?: number;
|
|
230
|
+
keyword?: number;
|
|
231
|
+
};
|
|
184
232
|
};
|
|
233
|
+
export declare const DEFAULT_KNOWLEDGEBASE_FAQ_RECALL: {
|
|
234
|
+
readonly mode: "hybrid";
|
|
235
|
+
readonly fusion: {
|
|
236
|
+
readonly mode: "weighted_rrf";
|
|
237
|
+
readonly rankConstant: 60;
|
|
238
|
+
readonly weights: {
|
|
239
|
+
readonly vector: 0.7;
|
|
240
|
+
readonly keyword: 0.3;
|
|
241
|
+
readonly graph: 0;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
export declare const KNOWLEDGEBASE_FAQ_RETRIEVAL_MODES: readonly ["vector", "keyword", "hybrid"];
|
|
246
|
+
/**
|
|
247
|
+
* FAQ retrieval only uses question vectors and keyword indexes. Graph retrieval is not supported.
|
|
248
|
+
*/
|
|
249
|
+
export declare function normalizeKnowledgebaseFAQRecall(recall?: TKBRecallParams | null): TKBRecallParams;
|
|
185
250
|
export type DocumentMetadata = IDocChunkMetadata & {
|
|
186
251
|
score?: number;
|
|
187
252
|
relevanceScore?: number;
|
package/src/ai/xpert.model.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { ITag } from '../tag-entity.model';
|
|
|
5
5
|
import { IUser, LanguagesEnum } from '../user.model';
|
|
6
6
|
import { IUserGroup } from '../user-group.model';
|
|
7
7
|
import { ICopilotModel, TCopilotModel } from './copilot-model.model';
|
|
8
|
-
import { IKnowledgebase, TKBRecallParams } from './knowledgebase.model';
|
|
8
|
+
import { IKnowledgebase, KnowledgeRetrievalMode, TKBFusionConfig, TKBRecallParams } from './knowledgebase.model';
|
|
9
9
|
import { ChecklistItem, I18nObject, IPoint, ISize, TAvatar } from '../types';
|
|
10
10
|
import { IXpertAgent } from './xpert-agent.model';
|
|
11
11
|
import { IXpertToolset } from './xpert-toolset.model';
|
|
@@ -689,7 +689,9 @@ export type TChatSourceAuditOptions = {
|
|
|
689
689
|
* Knowledgebase retrieval settings
|
|
690
690
|
*/
|
|
691
691
|
export type TKBRetrievalSettings = {
|
|
692
|
-
mode?:
|
|
692
|
+
mode?: KnowledgeRetrievalMode;
|
|
693
|
+
/** Overrides the knowledgebase candidate fusion strategy for this retrieval. */
|
|
694
|
+
fusion?: TKBFusionConfig;
|
|
693
695
|
neighborHops?: number;
|
|
694
696
|
entityTopK?: number;
|
|
695
697
|
communityTopK?: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IBasePerTenantAndOrganizationEntityModel, IBasePerTenantEntityModel } from './base-entity.model';
|
|
2
|
+
import type { JSONValue } from './core.model';
|
|
2
3
|
import { IDataSourceType } from './data-source-type.model';
|
|
3
4
|
import { IUser } from './user.model';
|
|
4
5
|
export interface IDataSource extends IBasePerTenantAndOrganizationEntityModel {
|
|
@@ -18,6 +19,17 @@ export interface IDataSourceAuthentication extends IBasePerTenantEntityModel {
|
|
|
18
19
|
dataSource?: IDataSource;
|
|
19
20
|
user?: IUser;
|
|
20
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Generic, read-only query delegated to the selected data-source adapter.
|
|
24
|
+
*
|
|
25
|
+
* Capability names and payload schemas are owned by adapters and their
|
|
26
|
+
* consumers; the platform intentionally does not model domain protocols.
|
|
27
|
+
*/
|
|
28
|
+
export interface IDataSourceCapabilityQuery {
|
|
29
|
+
capability: string;
|
|
30
|
+
operation: string;
|
|
31
|
+
payload?: JSONValue;
|
|
32
|
+
}
|
|
21
33
|
export declare enum AuthenticationEnum {
|
|
22
34
|
NONE = "NONE",
|
|
23
35
|
BASIC = "BASIC"
|
package/src/plugin.d.ts
CHANGED
|
@@ -147,6 +147,17 @@ export interface PluginMarketplaceAppModelRequirements {
|
|
|
147
147
|
embeddingLabel?: string | I18nObject;
|
|
148
148
|
visionLabel?: string | I18nObject;
|
|
149
149
|
}
|
|
150
|
+
/** Portable independent Assistant topology owned by a trusted App. Instance IDs are host-managed. */
|
|
151
|
+
export interface PluginMarketplaceAppAssistantSuite {
|
|
152
|
+
version: string;
|
|
153
|
+
coordinatorAgentKey: string;
|
|
154
|
+
roles: Array<{
|
|
155
|
+
key: string;
|
|
156
|
+
templateKey: string;
|
|
157
|
+
primaryAgentKey: string;
|
|
158
|
+
title?: string | I18nObject;
|
|
159
|
+
}>;
|
|
160
|
+
}
|
|
150
161
|
/**
|
|
151
162
|
* Declarative, host-owned initialization contract for a trusted plugin App.
|
|
152
163
|
* The host only executes this contract from a loaded plugin contribution.
|
|
@@ -154,6 +165,7 @@ export interface PluginMarketplaceAppModelRequirements {
|
|
|
154
165
|
export interface PluginMarketplaceAppConfig {
|
|
155
166
|
scope: PluginApplicationScope;
|
|
156
167
|
assistantTemplateKey: string;
|
|
168
|
+
assistantSuite?: PluginMarketplaceAppAssistantSuite;
|
|
157
169
|
workspace: {
|
|
158
170
|
mode: 'dedicated';
|
|
159
171
|
name: string | I18nObject;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { TAvatar } from '../types';
|
|
2
|
+
export declare const AGENT_PROFILE_TABS_SLOT = "agent.profile.tabs";
|
|
3
|
+
export interface XpertAssistantProfileIndicators {
|
|
4
|
+
skillCount: number | null;
|
|
5
|
+
toolCount: number;
|
|
6
|
+
subAgentCount: number;
|
|
7
|
+
conversationCount30d: number | null;
|
|
8
|
+
}
|
|
9
|
+
/** Display-only projection. Never add prompts, credentials or runtime configuration here. */
|
|
10
|
+
export interface XpertAssistantProfile {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
title?: string | null;
|
|
14
|
+
titleCN?: string | null;
|
|
15
|
+
description?: string | null;
|
|
16
|
+
avatar?: TAvatar | null;
|
|
17
|
+
version?: string | null;
|
|
18
|
+
tags: {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
color?: string | null;
|
|
22
|
+
}[];
|
|
23
|
+
workspace?: {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
} | null;
|
|
27
|
+
creator?: {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
} | null;
|
|
31
|
+
publishedAt?: Date | string | null;
|
|
32
|
+
createdAt?: Date | string | null;
|
|
33
|
+
updatedAt?: Date | string | null;
|
|
34
|
+
indicators: XpertAssistantProfileIndicators;
|
|
35
|
+
}
|
|
36
|
+
/** Backend-only identity, resolved by the host; never accepted from view query/action inputs. */
|
|
37
|
+
export interface XpertViewAssistantIdentity {
|
|
38
|
+
instanceId: string;
|
|
39
|
+
currentId: string;
|
|
40
|
+
versionIds: string[];
|
|
41
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { I18nObject, IconDefinition } from '../types';
|
|
2
2
|
import type { JsonSchemaObjectType } from '../ai/types';
|
|
3
|
+
import type { XpertViewAssistantIdentity } from './assistant-profile';
|
|
3
4
|
export type XpertViewHostType = 'integration' | 'knowledgebase' | 'agent' | 'project' | 'sandbox' | string;
|
|
4
5
|
export type XpertViewSlotMode = 'tabs' | 'sections' | 'widgets' | 'sidebar';
|
|
5
6
|
export type XpertViewSchemaType = 'stats' | 'table' | 'list' | 'detail' | 'raw_json' | 'remote_component';
|
|
@@ -101,6 +102,7 @@ export interface XpertViewRuntimeScope {
|
|
|
101
102
|
}
|
|
102
103
|
export type XpertViewHostState = Record<string, unknown>;
|
|
103
104
|
export interface XpertResolvedViewHostContext extends XpertViewHostContext {
|
|
105
|
+
assistant?: XpertViewAssistantIdentity;
|
|
104
106
|
slots: XpertViewSlot[];
|
|
105
107
|
hostSnapshot?: unknown;
|
|
106
108
|
capabilities?: XpertViewHostCapabilities;
|
|
@@ -528,6 +530,7 @@ export interface XpertExtensionViewManifest {
|
|
|
528
530
|
polling?: XpertViewPolling;
|
|
529
531
|
activation?: XpertViewActivation;
|
|
530
532
|
runtime?: {
|
|
533
|
+
/** Host-derived Assistants that satisfy every required Feature. Provider declarations are ignored. */
|
|
531
534
|
featureProviders?: XpertViewFeatureProvider[];
|
|
532
535
|
};
|
|
533
536
|
workbench?: XpertWorkbenchViewOptions;
|