@xpert-ai/contracts 3.9.4 → 3.9.8
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 +306 -124
- package/index.esm.js +298 -125
- package/package.json +2 -2
- package/src/agent/graph.d.ts +9 -4
- package/src/agent/variables.d.ts +3 -3
- package/src/ai/ai-provider.model.d.ts +10 -10
- package/src/ai/ai.model.d.ts +88 -0
- package/src/ai/chat.model.d.ts +5 -0
- package/src/ai/context-compression.model.d.ts +7 -3
- package/src/ai/feature.model.d.ts +2 -1
- package/src/ai/index.d.ts +2 -34
- package/src/ai/knowledge-graph.model.d.ts +224 -0
- package/src/ai/knowledge-pipeline.d.ts +4 -0
- package/src/ai/knowledgebase.model.d.ts +10 -0
- package/src/ai/middleware.model.d.ts +6 -4
- package/src/ai/xpert.model.d.ts +8 -3
- package/src/ai/xpert.utils.d.ts +5 -2
- package/src/analytics/features.d.ts +3 -0
- package/src/analytics/role-permissions.d.ts +3 -0
- package/src/i18n.model.d.ts +6 -0
- package/src/index.d.ts +2 -0
- package/src/types.d.ts +5 -7
package/src/ai/ai.model.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { TFollowUpConsumedEvent, TMessageContentComplex, TThreadContextUsageEvent } from '@xpert-ai/chatkit-types';
|
|
2
|
+
import type { IChatConversation } from './chat.model';
|
|
3
|
+
import type { IChatMessage } from './chat-message.model';
|
|
4
|
+
import type { IXpertAgentExecution } from './xpert-agent-execution.model';
|
|
1
5
|
/**
|
|
2
6
|
* Business roles for AI copilot (commands or contexts)
|
|
3
7
|
*/
|
|
@@ -80,3 +84,87 @@ export declare enum AiProtocol {
|
|
|
80
84
|
}
|
|
81
85
|
export declare const OpenAIEmbeddingsProviders: AiProvider[];
|
|
82
86
|
export declare const OllamaEmbeddingsProviders: AiProvider[];
|
|
87
|
+
export declare enum ChatMessageTypeEnum {
|
|
88
|
+
MESSAGE = "message",
|
|
89
|
+
EVENT = "event"
|
|
90
|
+
}
|
|
91
|
+
export declare enum ChatMessageEventTypeEnum {
|
|
92
|
+
ON_CONVERSATION_START = "on_conversation_start",
|
|
93
|
+
ON_CONVERSATION_END = "on_conversation_end",
|
|
94
|
+
ON_MESSAGE_START = "on_message_start",
|
|
95
|
+
ON_MESSAGE_END = "on_message_end",
|
|
96
|
+
ON_TOOL_START = "on_tool_start",
|
|
97
|
+
ON_TOOL_END = "on_tool_end",
|
|
98
|
+
ON_TOOL_ERROR = "on_tool_error",
|
|
99
|
+
ON_TOOL_MESSAGE = "on_tool_message",
|
|
100
|
+
ON_AGENT_START = "on_agent_start",
|
|
101
|
+
ON_AGENT_END = "on_agent_end",
|
|
102
|
+
ON_RETRIEVER_START = "on_retriever_start",
|
|
103
|
+
ON_RETRIEVER_END = "on_retriever_end",
|
|
104
|
+
ON_RETRIEVER_ERROR = "on_retriever_error",
|
|
105
|
+
ON_INTERRUPT = "on_interrupt",
|
|
106
|
+
ON_ERROR = "on_error",
|
|
107
|
+
ON_CHAT_EVENT = "on_chat_event",
|
|
108
|
+
ON_CLIENT_EFFECT = "on_client_effect"
|
|
109
|
+
}
|
|
110
|
+
export declare enum ChatMessageStepCategory {
|
|
111
|
+
List = "list",
|
|
112
|
+
WebSearch = "web_search",
|
|
113
|
+
Files = "files",
|
|
114
|
+
File = "file",
|
|
115
|
+
Program = "program",
|
|
116
|
+
Iframe = "iframe",
|
|
117
|
+
Memory = "memory",
|
|
118
|
+
Tasks = "tasks",
|
|
119
|
+
Knowledges = "knowledges"
|
|
120
|
+
}
|
|
121
|
+
export type TChatStreamMessagePayload = {
|
|
122
|
+
type: ChatMessageTypeEnum.MESSAGE;
|
|
123
|
+
data: string | TMessageContentComplex;
|
|
124
|
+
};
|
|
125
|
+
export type TChatStreamConversationPayload = {
|
|
126
|
+
type: ChatMessageTypeEnum.EVENT;
|
|
127
|
+
event: ChatMessageEventTypeEnum.ON_CONVERSATION_START | ChatMessageEventTypeEnum.ON_CONVERSATION_END;
|
|
128
|
+
data: Partial<IChatConversation>;
|
|
129
|
+
};
|
|
130
|
+
export type TChatStreamMessageEndData = Pick<IChatMessage, 'id' | 'conversationId' | 'executionId' | 'role' | 'status' | 'error'>;
|
|
131
|
+
export type TChatStreamMessageStartPayload = {
|
|
132
|
+
type: ChatMessageTypeEnum.EVENT;
|
|
133
|
+
event: ChatMessageEventTypeEnum.ON_MESSAGE_START;
|
|
134
|
+
data: Partial<IChatMessage>;
|
|
135
|
+
};
|
|
136
|
+
export type TChatStreamMessageEndPayload = {
|
|
137
|
+
type: ChatMessageTypeEnum.EVENT;
|
|
138
|
+
event: ChatMessageEventTypeEnum.ON_MESSAGE_END;
|
|
139
|
+
data: Partial<TChatStreamMessageEndData>;
|
|
140
|
+
};
|
|
141
|
+
export type TChatStreamMessageLifecyclePayload = TChatStreamMessageStartPayload | TChatStreamMessageEndPayload;
|
|
142
|
+
export type TChatStreamAgentEndData = Pick<IXpertAgentExecution, 'id' | 'agentKey' | 'status' | 'error' | 'elapsedTime' | 'tokens' | 'totalTokens' | 'embedTokens' | 'inputTokens' | 'outputTokens' | 'totalPrice' | 'currency' | 'metadata' | 'responseLatency' | 'parentId' | 'xpertId'>;
|
|
143
|
+
export type TChatStreamAgentEndPayload = {
|
|
144
|
+
type: ChatMessageTypeEnum.EVENT;
|
|
145
|
+
event: ChatMessageEventTypeEnum.ON_AGENT_END;
|
|
146
|
+
data: Partial<TChatStreamAgentEndData>;
|
|
147
|
+
};
|
|
148
|
+
export type TChatStreamErrorPayload = {
|
|
149
|
+
type: ChatMessageTypeEnum.EVENT;
|
|
150
|
+
event: ChatMessageEventTypeEnum.ON_ERROR;
|
|
151
|
+
data: string | {
|
|
152
|
+
error?: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
export type TChatStreamChatEventData = NonNullable<IChatMessage['events']>[number] | TFollowUpConsumedEvent | TThreadContextUsageEvent;
|
|
156
|
+
export type TChatStreamChatEventPayload = {
|
|
157
|
+
type: ChatMessageTypeEnum.EVENT;
|
|
158
|
+
event: ChatMessageEventTypeEnum.ON_CHAT_EVENT;
|
|
159
|
+
data: TChatStreamChatEventData;
|
|
160
|
+
};
|
|
161
|
+
export type TChatStreamUnhandledEventPayload = {
|
|
162
|
+
type: ChatMessageTypeEnum.EVENT;
|
|
163
|
+
event: Exclude<ChatMessageEventTypeEnum, ChatMessageEventTypeEnum.ON_CONVERSATION_START | ChatMessageEventTypeEnum.ON_CONVERSATION_END | ChatMessageEventTypeEnum.ON_MESSAGE_START | ChatMessageEventTypeEnum.ON_MESSAGE_END | ChatMessageEventTypeEnum.ON_AGENT_END | ChatMessageEventTypeEnum.ON_ERROR | ChatMessageEventTypeEnum.ON_CHAT_EVENT>;
|
|
164
|
+
data?: Partial<IChatConversation> | Partial<IChatMessage> | Partial<IXpertAgentExecution> | TChatStreamChatEventData | string;
|
|
165
|
+
};
|
|
166
|
+
export type TChatStreamEventPayload = TChatStreamMessagePayload | TChatStreamConversationPayload | TChatStreamMessageLifecyclePayload | TChatStreamAgentEndPayload | TChatStreamErrorPayload | TChatStreamChatEventPayload | TChatStreamUnhandledEventPayload;
|
|
167
|
+
export type TChatStreamCompletePayload = {
|
|
168
|
+
type: 'complete';
|
|
169
|
+
};
|
|
170
|
+
export type TChatStreamPayload = TChatStreamEventPayload | TChatStreamCompletePayload;
|
package/src/ai/chat.model.d.ts
CHANGED
|
@@ -21,6 +21,11 @@ export type TChatConversationOptions = {
|
|
|
21
21
|
features?: Array<'timeline' | 'sandbox' | 'files'>;
|
|
22
22
|
workspacePath?: string;
|
|
23
23
|
workspaceUrl?: string;
|
|
24
|
+
workspaceRoot?: string;
|
|
25
|
+
sharedWorkspacePath?: string;
|
|
26
|
+
agentWorkspacePath?: string;
|
|
27
|
+
sessionWorkspacePath?: string;
|
|
28
|
+
memoryWorkspacePath?: string;
|
|
24
29
|
sandboxEnvironmentId?: string;
|
|
25
30
|
runtimeCapabilities?: RuntimeCapabilitiesSelection;
|
|
26
31
|
};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import type { I18nText } from '../i18n.model';
|
|
1
2
|
export declare const CONTEXT_COMPRESSION_COMPONENT_TYPE = "context-compression";
|
|
2
3
|
export type TContextCompressionComponentStatus = 'running' | 'success' | 'fail';
|
|
4
|
+
export type TContextCompressionComponentReason = 'no_messages' | 'no_unprotected_history' | 'no_token_gain';
|
|
3
5
|
export type TContextCompressionComponentData = {
|
|
4
6
|
category: 'Tool';
|
|
5
7
|
type: typeof CONTEXT_COMPRESSION_COMPONENT_TYPE;
|
|
6
8
|
status: TContextCompressionComponentStatus;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
reason?: TContextCompressionComponentReason;
|
|
10
|
+
title?: I18nText;
|
|
11
|
+
message?: I18nText;
|
|
12
|
+
summary?: string;
|
|
13
|
+
error?: I18nText;
|
|
10
14
|
created_date?: string | Date | null;
|
|
11
15
|
end_date?: string | Date | null;
|
|
12
16
|
};
|
|
@@ -6,5 +6,6 @@ export declare enum AiFeatureEnum {
|
|
|
6
6
|
FEATURE_XPERT_CHATBI = "FEATURE_XPERT_CHATBI",
|
|
7
7
|
FEATURE_XPERT_CLAWXPERT = "FEATURE_XPERT_CLAWXPERT",
|
|
8
8
|
FEATURE_XPERT_CODEXPERT = "FEATURE_XPERT_CODEXPERT",
|
|
9
|
-
FEATURE_XPERT_DEEP_RESEARCH = "FEATURE_XPERT_DEEP_RESEARCH"
|
|
9
|
+
FEATURE_XPERT_DEEP_RESEARCH = "FEATURE_XPERT_DEEP_RESEARCH",
|
|
10
|
+
FEATURE_XPERT_DATA_ONTOLOGY = "FEATURE_XPERT_DATA_ONTOLOGY"
|
|
10
11
|
}
|
package/src/ai/index.d.ts
CHANGED
|
@@ -1,38 +1,5 @@
|
|
|
1
1
|
export declare const STATE_VARIABLE_HUMAN = "human";
|
|
2
|
-
export
|
|
3
|
-
MESSAGE = "message",
|
|
4
|
-
EVENT = "event"
|
|
5
|
-
}
|
|
6
|
-
export declare enum ChatMessageEventTypeEnum {
|
|
7
|
-
ON_CONVERSATION_START = "on_conversation_start",
|
|
8
|
-
ON_CONVERSATION_END = "on_conversation_end",
|
|
9
|
-
ON_MESSAGE_START = "on_message_start",
|
|
10
|
-
ON_MESSAGE_END = "on_message_end",
|
|
11
|
-
ON_TOOL_START = "on_tool_start",
|
|
12
|
-
ON_TOOL_END = "on_tool_end",
|
|
13
|
-
ON_TOOL_ERROR = "on_tool_error",
|
|
14
|
-
ON_TOOL_MESSAGE = "on_tool_message",
|
|
15
|
-
ON_AGENT_START = "on_agent_start",
|
|
16
|
-
ON_AGENT_END = "on_agent_end",
|
|
17
|
-
ON_RETRIEVER_START = "on_retriever_start",
|
|
18
|
-
ON_RETRIEVER_END = "on_retriever_end",
|
|
19
|
-
ON_RETRIEVER_ERROR = "on_retriever_error",
|
|
20
|
-
ON_INTERRUPT = "on_interrupt",
|
|
21
|
-
ON_ERROR = "on_error",
|
|
22
|
-
ON_CHAT_EVENT = "on_chat_event",
|
|
23
|
-
ON_CLIENT_EFFECT = "on_client_effect"
|
|
24
|
-
}
|
|
25
|
-
export declare enum ChatMessageStepCategory {
|
|
26
|
-
List = "list",
|
|
27
|
-
WebSearch = "web_search",
|
|
28
|
-
Files = "files",
|
|
29
|
-
File = "file",
|
|
30
|
-
Program = "program",
|
|
31
|
-
Iframe = "iframe",
|
|
32
|
-
Memory = "memory",
|
|
33
|
-
Tasks = "tasks",
|
|
34
|
-
Knowledges = "knowledges"
|
|
35
|
-
}
|
|
2
|
+
export { ChatMessageEventTypeEnum, ChatMessageStepCategory, ChatMessageTypeEnum } from './ai.model';
|
|
36
3
|
export type * from '@xpert-ai/chatkit-types';
|
|
37
4
|
export type { TChatRequest } from './xpert-chat.model';
|
|
38
5
|
export { CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED } from './chat-event.model';
|
|
@@ -81,6 +48,7 @@ export * from './knowledgebase-task.model';
|
|
|
81
48
|
export * from './knowledge-pipeline';
|
|
82
49
|
export * from './knowledge-retrieval-log.model';
|
|
83
50
|
export * from './knowledge-doc-chunk.model';
|
|
51
|
+
export * from './knowledge-graph.model';
|
|
84
52
|
export * from './skill.model';
|
|
85
53
|
export * from './prompt-workflow.model';
|
|
86
54
|
export * from './middleware.model';
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import type { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
|
|
2
|
+
import type { IKnowledgebase } from './knowledgebase.model';
|
|
3
|
+
import type { IKnowledgeDocument } from './knowledge-doc.model';
|
|
4
|
+
import type { IKnowledgeDocumentChunk } from './knowledge-doc-chunk.model';
|
|
5
|
+
export declare enum KnowledgeGraphStatus {
|
|
6
|
+
DISABLED = "disabled",
|
|
7
|
+
INDEXING = "indexing",
|
|
8
|
+
READY = "ready",
|
|
9
|
+
FAILED = "failed",
|
|
10
|
+
REBUILD_REQUIRED = "rebuild_required"
|
|
11
|
+
}
|
|
12
|
+
export declare enum KnowledgeGraphIndexJobStatus {
|
|
13
|
+
QUEUED = "queued",
|
|
14
|
+
RUNNING = "running",
|
|
15
|
+
SUCCESS = "success",
|
|
16
|
+
FAILED = "failed",
|
|
17
|
+
CANCELLED = "cancelled"
|
|
18
|
+
}
|
|
19
|
+
export type KnowledgeGraphIndexJobType = 'document' | 'rebuild';
|
|
20
|
+
export type GraphRagRetrievalMode = 'vector' | 'graph' | 'hybrid';
|
|
21
|
+
export type KnowledgeGraphItemOrigin = 'extracted' | 'manual' | 'curated';
|
|
22
|
+
export type KnowledgeGraphVisibility = 'active' | 'hidden';
|
|
23
|
+
export type GraphRagConfig = {
|
|
24
|
+
enabled?: boolean;
|
|
25
|
+
entityTopK?: number;
|
|
26
|
+
neighborHops?: number;
|
|
27
|
+
communityTopK?: number;
|
|
28
|
+
graphWeight?: number;
|
|
29
|
+
extractionBatchSize?: number;
|
|
30
|
+
extractionMaxCharacters?: number;
|
|
31
|
+
};
|
|
32
|
+
export type KnowledgeGraphEvidence = {
|
|
33
|
+
chunkId: string;
|
|
34
|
+
quote?: string | null;
|
|
35
|
+
confidence?: number | null;
|
|
36
|
+
};
|
|
37
|
+
export interface IKnowledgeGraphEntity extends IBasePerTenantAndOrganizationEntityModel {
|
|
38
|
+
knowledgebaseId?: string;
|
|
39
|
+
knowledgebase?: IKnowledgebase;
|
|
40
|
+
type: string;
|
|
41
|
+
name: string;
|
|
42
|
+
normalizedName: string;
|
|
43
|
+
origin?: KnowledgeGraphItemOrigin;
|
|
44
|
+
visibility?: KnowledgeGraphVisibility;
|
|
45
|
+
aliases?: string[] | null;
|
|
46
|
+
description?: string | null;
|
|
47
|
+
summary?: string | null;
|
|
48
|
+
confidence?: number | null;
|
|
49
|
+
mentionCount?: number | null;
|
|
50
|
+
revision?: number | null;
|
|
51
|
+
metadata?: {
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
} | null;
|
|
54
|
+
}
|
|
55
|
+
export interface IKnowledgeGraphRelation extends IBasePerTenantAndOrganizationEntityModel {
|
|
56
|
+
knowledgebaseId?: string;
|
|
57
|
+
knowledgebase?: IKnowledgebase;
|
|
58
|
+
sourceEntityId?: string;
|
|
59
|
+
sourceEntity?: IKnowledgeGraphEntity;
|
|
60
|
+
targetEntityId?: string;
|
|
61
|
+
targetEntity?: IKnowledgeGraphEntity;
|
|
62
|
+
type: string;
|
|
63
|
+
normalizedType?: string | null;
|
|
64
|
+
origin?: KnowledgeGraphItemOrigin;
|
|
65
|
+
visibility?: KnowledgeGraphVisibility;
|
|
66
|
+
description?: string | null;
|
|
67
|
+
confidence?: number | null;
|
|
68
|
+
weight?: number | null;
|
|
69
|
+
evidenceCount?: number | null;
|
|
70
|
+
revision?: number | null;
|
|
71
|
+
metadata?: {
|
|
72
|
+
[key: string]: unknown;
|
|
73
|
+
} | null;
|
|
74
|
+
}
|
|
75
|
+
export interface IKnowledgeGraphMention extends IBasePerTenantAndOrganizationEntityModel {
|
|
76
|
+
knowledgebaseId?: string;
|
|
77
|
+
knowledgebase?: IKnowledgebase;
|
|
78
|
+
entityId?: string;
|
|
79
|
+
entity?: IKnowledgeGraphEntity;
|
|
80
|
+
relationId?: string | null;
|
|
81
|
+
relation?: IKnowledgeGraphRelation | null;
|
|
82
|
+
documentId?: string;
|
|
83
|
+
document?: IKnowledgeDocument;
|
|
84
|
+
chunkId?: string;
|
|
85
|
+
chunk?: IKnowledgeDocumentChunk;
|
|
86
|
+
quote?: string | null;
|
|
87
|
+
confidence?: number | null;
|
|
88
|
+
startOffset?: number | null;
|
|
89
|
+
endOffset?: number | null;
|
|
90
|
+
revision?: number | null;
|
|
91
|
+
metadata?: {
|
|
92
|
+
[key: string]: unknown;
|
|
93
|
+
} | null;
|
|
94
|
+
}
|
|
95
|
+
export interface IKnowledgeGraphCommunity extends IBasePerTenantAndOrganizationEntityModel {
|
|
96
|
+
knowledgebaseId?: string;
|
|
97
|
+
knowledgebase?: IKnowledgebase;
|
|
98
|
+
key: string;
|
|
99
|
+
title?: string | null;
|
|
100
|
+
summary?: string | null;
|
|
101
|
+
entityIds?: string[] | null;
|
|
102
|
+
revision?: number | null;
|
|
103
|
+
metadata?: {
|
|
104
|
+
[key: string]: unknown;
|
|
105
|
+
} | null;
|
|
106
|
+
}
|
|
107
|
+
export interface IKnowledgeGraphIndexJob extends IBasePerTenantAndOrganizationEntityModel {
|
|
108
|
+
knowledgebaseId?: string;
|
|
109
|
+
knowledgebase?: IKnowledgebase;
|
|
110
|
+
documentId?: string | null;
|
|
111
|
+
document?: IKnowledgeDocument | null;
|
|
112
|
+
type: KnowledgeGraphIndexJobType;
|
|
113
|
+
status: KnowledgeGraphIndexJobStatus;
|
|
114
|
+
revision?: number | null;
|
|
115
|
+
totalChunks?: number | null;
|
|
116
|
+
processedChunks?: number | null;
|
|
117
|
+
error?: string | null;
|
|
118
|
+
startedAt?: Date | null;
|
|
119
|
+
completedAt?: Date | null;
|
|
120
|
+
}
|
|
121
|
+
export type KnowledgeGraphStatusResponse = {
|
|
122
|
+
status: KnowledgeGraphStatus;
|
|
123
|
+
enabled: boolean;
|
|
124
|
+
revision?: number | null;
|
|
125
|
+
error?: string | null;
|
|
126
|
+
entityCount: number;
|
|
127
|
+
relationCount: number;
|
|
128
|
+
mentionCount: number;
|
|
129
|
+
queuedJobCount: number;
|
|
130
|
+
runningJobCount: number;
|
|
131
|
+
failedJobCount: number;
|
|
132
|
+
jobs?: IKnowledgeGraphIndexJob[];
|
|
133
|
+
};
|
|
134
|
+
export type KnowledgeGraphViewNode = {
|
|
135
|
+
id: string;
|
|
136
|
+
name: string;
|
|
137
|
+
type: string;
|
|
138
|
+
origin: KnowledgeGraphItemOrigin;
|
|
139
|
+
visibility: KnowledgeGraphVisibility;
|
|
140
|
+
mentionCount?: number | null;
|
|
141
|
+
confidence?: number | null;
|
|
142
|
+
symbolSize?: number;
|
|
143
|
+
value?: number;
|
|
144
|
+
};
|
|
145
|
+
export type KnowledgeGraphViewEdge = {
|
|
146
|
+
id: string;
|
|
147
|
+
source: string;
|
|
148
|
+
target: string;
|
|
149
|
+
type: string;
|
|
150
|
+
origin: KnowledgeGraphItemOrigin;
|
|
151
|
+
visibility: KnowledgeGraphVisibility;
|
|
152
|
+
weight?: number | null;
|
|
153
|
+
evidenceCount?: number | null;
|
|
154
|
+
};
|
|
155
|
+
export type KnowledgeGraphViewResponse = {
|
|
156
|
+
nodes: KnowledgeGraphViewNode[];
|
|
157
|
+
edges: KnowledgeGraphViewEdge[];
|
|
158
|
+
entityTypes: string[];
|
|
159
|
+
relationTypes: string[];
|
|
160
|
+
totalNodes: number;
|
|
161
|
+
totalEdges: number;
|
|
162
|
+
};
|
|
163
|
+
export type KnowledgeGraphVisualizationQuery = {
|
|
164
|
+
search?: string | null;
|
|
165
|
+
entityType?: string | null;
|
|
166
|
+
relationType?: string | null;
|
|
167
|
+
origin?: KnowledgeGraphItemOrigin | null;
|
|
168
|
+
visibility?: KnowledgeGraphVisibility | null;
|
|
169
|
+
focusEntityId?: string | null;
|
|
170
|
+
depth?: number | null;
|
|
171
|
+
take?: number | null;
|
|
172
|
+
};
|
|
173
|
+
export type KnowledgeGraphMentionListQuery = {
|
|
174
|
+
entityId?: string | null;
|
|
175
|
+
relationId?: string | null;
|
|
176
|
+
documentId?: string | null;
|
|
177
|
+
chunkId?: string | null;
|
|
178
|
+
take?: number | null;
|
|
179
|
+
};
|
|
180
|
+
export type KnowledgeGraphEntityChunksQuery = {
|
|
181
|
+
neighborHops?: number | null;
|
|
182
|
+
take?: number | null;
|
|
183
|
+
includeMentions?: boolean | null;
|
|
184
|
+
mentionTake?: number | null;
|
|
185
|
+
documentId?: string | null;
|
|
186
|
+
};
|
|
187
|
+
export type KnowledgeGraphEntityChunksResponse = {
|
|
188
|
+
entity: IKnowledgeGraphEntity;
|
|
189
|
+
chunks: IKnowledgeDocumentChunk[];
|
|
190
|
+
evidenceByChunkId: Record<string, IKnowledgeGraphMention[]>;
|
|
191
|
+
totals: {
|
|
192
|
+
chunks: number;
|
|
193
|
+
mentions: number;
|
|
194
|
+
entityIds: number;
|
|
195
|
+
relations: number;
|
|
196
|
+
};
|
|
197
|
+
limits: {
|
|
198
|
+
take: number;
|
|
199
|
+
neighborHops: number;
|
|
200
|
+
mentionTake: number;
|
|
201
|
+
includeMentions: boolean;
|
|
202
|
+
};
|
|
203
|
+
truncated?: {
|
|
204
|
+
chunks?: boolean;
|
|
205
|
+
mentions?: boolean;
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
export type KnowledgeGraphEntityCreateInput = {
|
|
209
|
+
name: string;
|
|
210
|
+
type: string;
|
|
211
|
+
aliases?: string[] | null;
|
|
212
|
+
description?: string | null;
|
|
213
|
+
visibility?: KnowledgeGraphVisibility;
|
|
214
|
+
};
|
|
215
|
+
export type KnowledgeGraphEntityUpdateInput = Partial<KnowledgeGraphEntityCreateInput>;
|
|
216
|
+
export type KnowledgeGraphRelationCreateInput = {
|
|
217
|
+
sourceEntityId: string;
|
|
218
|
+
targetEntityId: string;
|
|
219
|
+
type: string;
|
|
220
|
+
description?: string | null;
|
|
221
|
+
weight?: number | null;
|
|
222
|
+
visibility?: KnowledgeGraphVisibility;
|
|
223
|
+
};
|
|
224
|
+
export type KnowledgeGraphRelationUpdateInput = Partial<KnowledgeGraphRelationCreateInput>;
|
|
@@ -94,6 +94,10 @@ export interface IWFNKnowledgeBase extends IWorkflowNode {
|
|
|
94
94
|
* @deprecated Configure rerank model on the knowledgebase.
|
|
95
95
|
*/
|
|
96
96
|
rerankModel?: ICopilotModel;
|
|
97
|
+
/**
|
|
98
|
+
* @deprecated Configure chat model on the knowledgebase.
|
|
99
|
+
*/
|
|
100
|
+
chatModel?: ICopilotModel;
|
|
97
101
|
/**
|
|
98
102
|
* @deprecated Configure vision model on the knowledgebase.
|
|
99
103
|
*/
|
|
@@ -5,6 +5,7 @@ import { IKnowledgeDocument } from './knowledge-doc.model';
|
|
|
5
5
|
import { IXpert } from './xpert.model';
|
|
6
6
|
import { IIntegration } from '../integration.model';
|
|
7
7
|
import { IDocChunkMetadata } from './knowledge-doc-chunk.model';
|
|
8
|
+
import type { GraphRagConfig, KnowledgeGraphStatus } from './knowledge-graph.model';
|
|
8
9
|
/**
|
|
9
10
|
* Non-internal types should remain the same as IntegrationEnum.
|
|
10
11
|
*/
|
|
@@ -67,6 +68,11 @@ export type TKnowledgebase = {
|
|
|
67
68
|
*/
|
|
68
69
|
copilotModel?: ICopilotModel;
|
|
69
70
|
copilotModelId?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Chat model for knowledgebase LLM tasks.
|
|
73
|
+
*/
|
|
74
|
+
chatModel?: ICopilotModel | null;
|
|
75
|
+
chatModelId?: string | null;
|
|
70
76
|
embeddingCollectionName?: string | null;
|
|
71
77
|
embeddingModelFingerprint?: string | null;
|
|
72
78
|
embeddingDimensions?: number | null;
|
|
@@ -79,6 +85,10 @@ export type TKnowledgebase = {
|
|
|
79
85
|
pendingEmbeddingRevision?: number | null;
|
|
80
86
|
rebuildTaskId?: string | null;
|
|
81
87
|
embeddingRebuildError?: string | null;
|
|
88
|
+
graphRag?: GraphRagConfig | null;
|
|
89
|
+
graphStatus?: KnowledgeGraphStatus | null;
|
|
90
|
+
graphRevision?: number | null;
|
|
91
|
+
graphIndexError?: string | null;
|
|
82
92
|
rerankModel?: ICopilotModel;
|
|
83
93
|
rerankModelId?: string;
|
|
84
94
|
visionModel?: ICopilotModel;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { IWorkflowNode, WorkflowNodeTypeEnum } from
|
|
2
|
-
import { I18nObject, IconDefinition } from
|
|
3
|
-
import { TXpertFeatureKey, TXpertGraph, TXpertTeamNode } from
|
|
4
|
-
import { JsonSchemaObjectType } from
|
|
1
|
+
import { IWorkflowNode, WorkflowNodeTypeEnum } from './xpert-workflow.model';
|
|
2
|
+
import { I18nObject, IconDefinition } from '../types';
|
|
3
|
+
import { TXpertFeatureKey, TXpertGraph, TXpertTeamNode } from './xpert.model';
|
|
4
|
+
import { JsonSchemaObjectType } from './types';
|
|
5
|
+
import type { SkillSlashCommand } from './skill.model';
|
|
5
6
|
export declare const LEGACY_SANDBOX_COMPRESSION_MIDDLEWARE_NAME = "SandboxCompressionMiddleware";
|
|
6
7
|
export declare const CONTEXT_COMPRESSION_MIDDLEWARE_NAME = "ContextCompressionMiddleware";
|
|
7
8
|
export interface IWFNMiddleware extends IWorkflowNode {
|
|
@@ -30,5 +31,6 @@ export type TAgentMiddlewareMeta = {
|
|
|
30
31
|
description?: I18nObject;
|
|
31
32
|
configSchema?: JsonSchemaObjectType;
|
|
32
33
|
features?: TXpertFeatureKey[];
|
|
34
|
+
slashCommands?: SkillSlashCommand[];
|
|
33
35
|
};
|
|
34
36
|
export declare function getAgentMiddlewareNodes(graph: TXpertGraph, agentKey: string): TXpertTeamNode[];
|
package/src/ai/xpert.model.d.ts
CHANGED
|
@@ -522,16 +522,21 @@ export type TChatOptions = {
|
|
|
522
522
|
* Knowledgebase retrieval settings
|
|
523
523
|
*/
|
|
524
524
|
export type TKBRetrievalSettings = {
|
|
525
|
-
|
|
525
|
+
mode?: 'vector' | 'graph' | 'hybrid';
|
|
526
|
+
neighborHops?: number;
|
|
527
|
+
entityTopK?: number;
|
|
528
|
+
communityTopK?: number;
|
|
529
|
+
graphWeight?: number;
|
|
530
|
+
metadata?: {
|
|
526
531
|
filtering_mode: 'disabled' | 'automatic' | 'manual';
|
|
527
532
|
/**
|
|
528
533
|
* Conditions (filter) when mode is manual
|
|
529
534
|
*/
|
|
530
|
-
filtering_conditions
|
|
535
|
+
filtering_conditions?: TWFCase;
|
|
531
536
|
/**
|
|
532
537
|
* Parameter fields (tool call) when mode is automatic
|
|
533
538
|
*/
|
|
534
|
-
fields
|
|
539
|
+
fields?: Record<string, object>;
|
|
535
540
|
};
|
|
536
541
|
};
|
|
537
542
|
export declare function isXpertNodeType<T extends TXpertTeamNodeType>(type: T): (node: TXpertTeamNode) => node is NodeOf<T>;
|
package/src/ai/xpert.utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IPoint } from '../types';
|
|
2
2
|
import { IXpertAgent } from './xpert-agent.model';
|
|
3
|
-
import { IXpert, TXpertTeamConnection, TXpertTeamDraft, TXpertTeamNode } from './xpert.model';
|
|
3
|
+
import { IXpert, TXpertGraph, TXpertTeamConnection, TXpertTeamDraft, TXpertTeamNode } from './xpert.model';
|
|
4
4
|
export declare function omitXpertRelations(xpert: Partial<IXpert>): {
|
|
5
5
|
environmentId?: string;
|
|
6
6
|
workspaceId?: string;
|
|
@@ -37,7 +37,7 @@ export declare function omitXpertRelations(xpert: Partial<IXpert>): {
|
|
|
37
37
|
latest?: boolean;
|
|
38
38
|
releaseNotes?: string;
|
|
39
39
|
exportedTemplate?: import("./xpert.model").TXpertExportedTemplate | null;
|
|
40
|
-
graph?:
|
|
40
|
+
graph?: TXpertGraph;
|
|
41
41
|
api?: import("./xpert.model").TChatApi;
|
|
42
42
|
app?: import("./xpert.model").TChatApp;
|
|
43
43
|
userId?: string;
|
|
@@ -54,6 +54,9 @@ export declare function omitXpertRelations(xpert: Partial<IXpert>): {
|
|
|
54
54
|
* @returns
|
|
55
55
|
*/
|
|
56
56
|
export declare function figureOutXpert(xpert: IXpert, isDraft: boolean): Partial<IXpert>;
|
|
57
|
+
export declare function resolveRuntimeXpert(xpert: IXpert, isDraft: boolean): IXpert;
|
|
58
|
+
export declare function resolveDraftRuntimeGraph(xpert: IXpert, draft: TXpertTeamDraft): TXpertGraph;
|
|
59
|
+
export declare function resolveDraftPrimaryAgent(xpert: IXpert, draft: TXpertTeamDraft, graph: TXpertGraph): IXpertAgent | undefined;
|
|
57
60
|
export declare function xpertLabel(agent: Partial<IXpert>): string;
|
|
58
61
|
export declare function createXpertGraph(xpert: IXpert, position: IPoint): {
|
|
59
62
|
nodes: TXpertTeamNode[];
|
|
@@ -3,6 +3,9 @@ export declare enum AnalyticsFeatures {
|
|
|
3
3
|
FEATURE_INDICATOR = "FEATURE_INDICATOR",
|
|
4
4
|
FEATURE_INDICATOR_MARKET = "FEATURE_INDICATOR_MARKET",
|
|
5
5
|
FEATURE_INDICATOR_REGISTER = "FEATURE_INDICATOR_REGISTER",
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Indicator App is no longer exposed in the system menu.
|
|
8
|
+
*/
|
|
6
9
|
FEATURE_INDICATOR_APP = "FEATURE_INDICATOR_APP",
|
|
7
10
|
FEATURE_STORY = "FEATURE_STORY",
|
|
8
11
|
FEATURE_STORY_CREATION = "FEATURE_STORY_CREATION",
|
|
@@ -16,6 +16,9 @@ export declare enum AnalyticsPermissionsEnum {
|
|
|
16
16
|
BUSINESS_AREA_VIEW = "BUSINESS_AREA_VIEW",
|
|
17
17
|
BUSINESS_AREA_EDIT = "BUSINESS_AREA_EDIT",
|
|
18
18
|
INDICATOR_VIEW = "INDICATOR_VIEW",
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Indicator App is no longer exposed in the system menu.
|
|
21
|
+
*/
|
|
19
22
|
INDICATOR_MARTKET_VIEW = "INDICATOR_MARTKET_VIEW",
|
|
20
23
|
INDICATOR_EDIT = "INDICATOR_EDIT",
|
|
21
24
|
DATA_FACTORY_VIEW = "DATA_FACTORY_VIEW",
|
package/src/index.d.ts
CHANGED
package/src/types.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import ShortUniqueId from 'short-unique-id';
|
|
2
|
-
import type * as z3 from
|
|
3
|
-
import type * as z4 from
|
|
2
|
+
import type * as z3 from 'zod/v3';
|
|
3
|
+
import type * as z4 from 'zod/v4/core';
|
|
4
|
+
import type { I18nObject } from './i18n.model';
|
|
5
|
+
export type { I18nObject, I18nText } from './i18n.model';
|
|
6
|
+
export { resolveI18nText } from './i18n.model';
|
|
4
7
|
declare const uuidGenerator: ShortUniqueId;
|
|
5
8
|
export declare const uuid: (...args: Parameters<(typeof uuidGenerator)["randomUUID"]>) => string;
|
|
6
9
|
/**
|
|
@@ -11,10 +14,6 @@ export declare const uuid: (...args: Parameters<(typeof uuidGenerator)["randomUU
|
|
|
11
14
|
* @docsSubcategory Identifiers
|
|
12
15
|
*/
|
|
13
16
|
export type ID = string;
|
|
14
|
-
export interface I18nObject {
|
|
15
|
-
en_US: string;
|
|
16
|
-
zh_Hans?: string;
|
|
17
|
-
}
|
|
18
17
|
export type TAvatar = {
|
|
19
18
|
emoji?: {
|
|
20
19
|
id: string;
|
|
@@ -245,4 +244,3 @@ export interface IconDefinition {
|
|
|
245
244
|
export type ZodObjectV3 = z3.ZodObject<any, any, any, any>;
|
|
246
245
|
export type ZodObjectV4 = z4.$ZodObject;
|
|
247
246
|
export type InteropZodObject = ZodObjectV3 | ZodObjectV4;
|
|
248
|
-
export {};
|