@xpert-ai/contracts 3.9.0-beta.1
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 +3 -0
- package/index.cjs.js +4945 -0
- package/index.d.ts +1 -0
- package/index.esm.js +4792 -0
- package/package.json +25 -0
- package/src/agent/ai-model.d.ts +9 -0
- package/src/agent/graph.d.ts +182 -0
- package/src/agent/index.d.ts +6 -0
- package/src/agent/interrupt.d.ts +51 -0
- package/src/agent/token.d.ts +21 -0
- package/src/agent/utils.d.ts +19 -0
- package/src/agent/variables.d.ts +16 -0
- package/src/ai/ai-model.model.d.ts +198 -0
- package/src/ai/ai-provider.model.d.ts +43 -0
- package/src/ai/ai.model.d.ts +82 -0
- package/src/ai/assistant-binding.model.d.ts +81 -0
- package/src/ai/chat-event.model.d.ts +8 -0
- package/src/ai/chat-message-feedback.model.d.ts +24 -0
- package/src/ai/chat-message.model.d.ts +93 -0
- package/src/ai/chat.model.d.ts +191 -0
- package/src/ai/copilot-checkpoint.model.d.ts +23 -0
- package/src/ai/copilot-example.model.d.ts +19 -0
- package/src/ai/copilot-model.model.d.ts +30 -0
- package/src/ai/copilot-organization.model.d.ts +17 -0
- package/src/ai/copilot-provider.model.d.ts +31 -0
- package/src/ai/copilot-role.model.d.ts +43 -0
- package/src/ai/copilot-store.model.d.ts +29 -0
- package/src/ai/copilot-user.model.d.ts +27 -0
- package/src/ai/copilot.model.d.ts +36 -0
- package/src/ai/environment.model.d.ts +16 -0
- package/src/ai/feature.model.d.ts +10 -0
- package/src/ai/index.d.ts +84 -0
- package/src/ai/knowledge-doc-chunk.model.d.ts +61 -0
- package/src/ai/knowledge-doc-page.model.d.ts +15 -0
- package/src/ai/knowledge-doc.model.d.ts +222 -0
- package/src/ai/knowledge-pipeline.d.ts +107 -0
- package/src/ai/knowledge-retrieval-log.model.d.ts +10 -0
- package/src/ai/knowledgebase-task.model.d.ts +39 -0
- package/src/ai/knowledgebase.model.d.ts +174 -0
- package/src/ai/message-content.utils.d.ts +58 -0
- package/src/ai/middleware.model.d.ts +24 -0
- package/src/ai/rag-web.d.ts +26 -0
- package/src/ai/rag.d.ts +24 -0
- package/src/ai/role-permissions.d.ts +13 -0
- package/src/ai/sandbox.d.ts +8 -0
- package/src/ai/skill.model.d.ts +241 -0
- package/src/ai/types.d.ts +77 -0
- package/src/ai/xpert-agent-execution.model.d.ts +105 -0
- package/src/ai/xpert-agent.model.d.ts +194 -0
- package/src/ai/xpert-chat.model.d.ts +66 -0
- package/src/ai/xpert-project.model.d.ts +89 -0
- package/src/ai/xpert-table.model.d.ts +84 -0
- package/src/ai/xpert-task.model.d.ts +26 -0
- package/src/ai/xpert-template.model.d.ts +47 -0
- package/src/ai/xpert-tool-mcp.model.d.ts +91 -0
- package/src/ai/xpert-tool.model.d.ts +154 -0
- package/src/ai/xpert-toolset.model.d.ts +200 -0
- package/src/ai/xpert-workflow-task.prompt.d.ts +2 -0
- package/src/ai/xpert-workflow.model.d.ts +445 -0
- package/src/ai/xpert-workspace.model.d.ts +37 -0
- package/src/ai/xpert.model.d.ts +513 -0
- package/src/ai/xpert.utils.d.ts +87 -0
- package/src/analytics/ai.d.ts +73 -0
- package/src/analytics/approval-policy.model.d.ts +30 -0
- package/src/analytics/business-area-user.model.d.ts +35 -0
- package/src/analytics/business-area.d.ts +17 -0
- package/src/analytics/certification.model.d.ts +11 -0
- package/src/analytics/chatbi-conversation.model.d.ts +15 -0
- package/src/analytics/chatbi-model.model.d.ts +18 -0
- package/src/analytics/collection.model.d.ts +6 -0
- package/src/analytics/comment.model.d.ts +10 -0
- package/src/analytics/data-source-type.d.ts +16 -0
- package/src/analytics/data-source.d.ts +62 -0
- package/src/analytics/favorite.d.ts +14 -0
- package/src/analytics/features.d.ts +19 -0
- package/src/analytics/feed-model.d.ts +13 -0
- package/src/analytics/gateway.d.ts +28 -0
- package/src/analytics/index.d.ts +38 -0
- package/src/analytics/indicator-app.d.ts +44 -0
- package/src/analytics/indicator-market.d.ts +4 -0
- package/src/analytics/indicator.d.ts +105 -0
- package/src/analytics/model-query-log.model.d.ts +41 -0
- package/src/analytics/model-query.d.ts +21 -0
- package/src/analytics/notification-destination.d.ts +10 -0
- package/src/analytics/permission-approval-user.model.d.ts +10 -0
- package/src/analytics/permission-approval.model.d.ts +47 -0
- package/src/analytics/project.model.d.ts +50 -0
- package/src/analytics/role-permissions.d.ts +25 -0
- package/src/analytics/schema.d.ts +262 -0
- package/src/analytics/screenshot.model.d.ts +24 -0
- package/src/analytics/semantic-model-entity.d.ts +38 -0
- package/src/analytics/semantic-model-member.d.ts +27 -0
- package/src/analytics/semantic-model.d.ts +183 -0
- package/src/analytics/story-point.d.ts +11 -0
- package/src/analytics/story-template.model.d.ts +28 -0
- package/src/analytics/story-widget.d.ts +12 -0
- package/src/analytics/story.d.ts +93 -0
- package/src/analytics/subscription.d.ts +38 -0
- package/src/analytics/visit.model.d.ts +34 -0
- package/src/analytics/webSocket.d.ts +48 -0
- package/src/api-key.model.d.ts +68 -0
- package/src/base-entity.model.d.ts +27 -0
- package/src/contact.model.d.ts +41 -0
- package/src/core.model.d.ts +97 -0
- package/src/country.model.d.ts +5 -0
- package/src/currency.model.d.ts +579 -0
- package/src/custom-smtp.model.d.ts +23 -0
- package/src/date-picker.model.d.ts +5 -0
- package/src/email-template.model.d.ts +39 -0
- package/src/email.model.d.ts +36 -0
- package/src/employee.model.d.ts +128 -0
- package/src/entity-with-members.model.d.ts +13 -0
- package/src/feature.model.d.ts +93 -0
- package/src/file-asset.model.d.ts +77 -0
- package/src/file-provider.d.ts +31 -0
- package/src/http-status.enum.d.ts +57 -0
- package/src/import-export.model.d.ts +36 -0
- package/src/index.d.ts +53 -0
- package/src/integration/dingtalk.d.ts +2 -0
- package/src/integration/firecrawl.d.ts +2 -0
- package/src/integration/github.d.ts +69 -0
- package/src/integration/index.d.ts +4 -0
- package/src/integration/lark.d.ts +5 -0
- package/src/integration/wecom.d.ts +2 -0
- package/src/integration.model.d.ts +92 -0
- package/src/invite.model.d.ts +125 -0
- package/src/language.model.d.ts +19 -0
- package/src/organization-contact.model.d.ts +72 -0
- package/src/organization-department.model.d.ts +20 -0
- package/src/organization-language.model.d.ts +18 -0
- package/src/organization-projects.model.d.ts +80 -0
- package/src/organization-team-employee-model.d.ts +12 -0
- package/src/organization-team-model.d.ts +19 -0
- package/src/organization.model.d.ts +238 -0
- package/src/password-reset.model.d.ts +18 -0
- package/src/plain-object.model.d.ts +13 -0
- package/src/plugin.d.ts +116 -0
- package/src/role-permission.model.d.ts +61 -0
- package/src/role.model.d.ts +25 -0
- package/src/schedule.d.ts +27 -0
- package/src/scope.model.d.ts +9 -0
- package/src/secret-token.model.d.ts +11 -0
- package/src/seed.model.d.ts +37 -0
- package/src/storage-file.model.d.ts +39 -0
- package/src/tag-entity.model.d.ts +20 -0
- package/src/tenant.model.d.ts +40 -0
- package/src/tools/index.d.ts +1 -0
- package/src/tools/sandbox.d.ts +5 -0
- package/src/translation.model.d.ts +26 -0
- package/src/types.d.ts +248 -0
- package/src/user-group.model.d.ts +7 -0
- package/src/user-me-context.model.d.ts +9 -0
- package/src/user-organization.model.d.ts +28 -0
- package/src/user.model.d.ts +131 -0
- package/src/view-extension/index.d.ts +1 -0
- package/src/view-extension/model.d.ts +183 -0
- package/src/visibility.model.d.ts +6 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { StoredMessage } from '@langchain/core/messages';
|
|
2
|
+
import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
|
|
3
|
+
import { IXpert, TXpertTeamNodeType } from './xpert.model';
|
|
4
|
+
import { IXpertAgent } from './xpert-agent.model';
|
|
5
|
+
import { TSensitiveOperation } from './chat.model';
|
|
6
|
+
import { WorkflowNodeTypeEnum } from './xpert-workflow.model';
|
|
7
|
+
export type TXpertExecution = {
|
|
8
|
+
category?: TXpertTeamNodeType;
|
|
9
|
+
type?: WorkflowNodeTypeEnum | string;
|
|
10
|
+
title?: string;
|
|
11
|
+
inputs?: any;
|
|
12
|
+
outputs?: any;
|
|
13
|
+
status?: XpertAgentExecutionStatusEnum;
|
|
14
|
+
error?: string;
|
|
15
|
+
elapsedTime?: number;
|
|
16
|
+
threadId?: string;
|
|
17
|
+
checkpointNs?: string;
|
|
18
|
+
checkpointId?: string;
|
|
19
|
+
channelName?: string;
|
|
20
|
+
parent_thread_id?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Include workflow node key
|
|
23
|
+
*/
|
|
24
|
+
agentKey?: string;
|
|
25
|
+
predecessor?: string;
|
|
26
|
+
xpert?: IXpert;
|
|
27
|
+
xpertId?: string;
|
|
28
|
+
parentId?: string;
|
|
29
|
+
};
|
|
30
|
+
export type TXpertAgentExecutionCheckpoint = {
|
|
31
|
+
threadId: string;
|
|
32
|
+
checkpointNs: string;
|
|
33
|
+
checkpointId: string;
|
|
34
|
+
parentCheckpointId?: string | null;
|
|
35
|
+
createdAt?: string | null;
|
|
36
|
+
metadata?: Record<string, unknown> | null;
|
|
37
|
+
isCurrent?: boolean;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Corresponds to the run in the [Agent Protocol](https://github.com/langchain-ai/agent-protocol).
|
|
41
|
+
*/
|
|
42
|
+
export type TXpertAgentExecution = TXpertExecution & {
|
|
43
|
+
/**
|
|
44
|
+
* Total token usage of chat model
|
|
45
|
+
*/
|
|
46
|
+
tokens?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Token usage of embedding
|
|
49
|
+
*/
|
|
50
|
+
embedTokens?: number;
|
|
51
|
+
metadata?: TAgentExecutionMetadata;
|
|
52
|
+
/**
|
|
53
|
+
* Latency of response from provider (s)
|
|
54
|
+
*/
|
|
55
|
+
responseLatency?: number;
|
|
56
|
+
totalPrice?: number;
|
|
57
|
+
currency?: string;
|
|
58
|
+
inputTokens?: number;
|
|
59
|
+
inputUnitPrice?: number;
|
|
60
|
+
inputPriceUnit?: number;
|
|
61
|
+
outputTokens?: number;
|
|
62
|
+
outputUnitPrice?: number;
|
|
63
|
+
outputPriceUnit?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Latest operation when interrupted
|
|
66
|
+
*/
|
|
67
|
+
operation?: TSensitiveOperation;
|
|
68
|
+
messages?: StoredMessage[];
|
|
69
|
+
agent?: IXpertAgent;
|
|
70
|
+
totalTokens?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Summary of conversation
|
|
73
|
+
*/
|
|
74
|
+
summary?: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Execution of agent or workflow nodes.
|
|
78
|
+
*
|
|
79
|
+
* Corresponds to the run in the [Agent Protocol](https://github.com/langchain-ai/agent-protocol).
|
|
80
|
+
*/
|
|
81
|
+
export interface IXpertAgentExecution extends IBasePerTenantAndOrganizationEntityModel, TXpertAgentExecution {
|
|
82
|
+
subExecutions?: IXpertAgentExecution[];
|
|
83
|
+
runningExecution?: IXpertAgentExecution;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Corresponds to the status of Run in [Agent Protocol](https://github.com/langchain-ai/agent-protocol).
|
|
87
|
+
*/
|
|
88
|
+
export declare enum XpertAgentExecutionStatusEnum {
|
|
89
|
+
RUNNING = "running",
|
|
90
|
+
SUCCESS = "success",
|
|
91
|
+
ERROR = "error",
|
|
92
|
+
PENDING = "pending",
|
|
93
|
+
TIMEOUT = "timeout",
|
|
94
|
+
INTERRUPTED = "interrupted"
|
|
95
|
+
}
|
|
96
|
+
export type TAgentExecutionMetadata = {
|
|
97
|
+
/**
|
|
98
|
+
* AI model provider
|
|
99
|
+
*/
|
|
100
|
+
provider: string;
|
|
101
|
+
/**
|
|
102
|
+
* AI Model
|
|
103
|
+
*/
|
|
104
|
+
model: string;
|
|
105
|
+
};
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
|
|
2
|
+
import { ICopilotModel, TCopilotModel } from './copilot-model.model';
|
|
3
|
+
import { IKnowledgebase, TKBRecallParams } from './knowledgebase.model';
|
|
4
|
+
import { I18nObject, TAvatar } from '../types';
|
|
5
|
+
import { IXpertToolset } from './xpert-toolset.model';
|
|
6
|
+
import { IXpert, TXpertParameter } from './xpert.model';
|
|
7
|
+
import { TVariableAssigner } from './xpert-workflow.model';
|
|
8
|
+
import { TErrorHandling } from './types';
|
|
9
|
+
export type TXpertAgent = {
|
|
10
|
+
key: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
avatar?: TAvatar;
|
|
15
|
+
/**
|
|
16
|
+
* System prompt
|
|
17
|
+
*/
|
|
18
|
+
prompt?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Prompt templates (ai or human)
|
|
21
|
+
*/
|
|
22
|
+
promptTemplates?: TAgentPromptTemplate[];
|
|
23
|
+
/**
|
|
24
|
+
* Input parameters for agent
|
|
25
|
+
*/
|
|
26
|
+
parameters?: TXpertParameter[];
|
|
27
|
+
/**
|
|
28
|
+
* Output variables of agent
|
|
29
|
+
*/
|
|
30
|
+
outputVariables?: TAgentOutputVariable[];
|
|
31
|
+
/**
|
|
32
|
+
* More configuration
|
|
33
|
+
*/
|
|
34
|
+
options?: TXpertAgentOptions;
|
|
35
|
+
/**
|
|
36
|
+
* This is the xpert's primary agent
|
|
37
|
+
*/
|
|
38
|
+
xpert?: IXpert;
|
|
39
|
+
xpertId?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Copilot model of this agent
|
|
42
|
+
*/
|
|
43
|
+
copilotModel?: ICopilotModel;
|
|
44
|
+
copilotModelId?: string;
|
|
45
|
+
/**
|
|
46
|
+
* This is one of the xpert team's agent
|
|
47
|
+
*/
|
|
48
|
+
team?: IXpert;
|
|
49
|
+
teamId?: string;
|
|
50
|
+
/**
|
|
51
|
+
* My leader in xpert team
|
|
52
|
+
*/
|
|
53
|
+
leader?: IXpertAgent;
|
|
54
|
+
leaderKey?: string;
|
|
55
|
+
/**
|
|
56
|
+
* I am the leader of followers in xpert's team
|
|
57
|
+
*/
|
|
58
|
+
followers?: IXpertAgent[];
|
|
59
|
+
/**
|
|
60
|
+
* External xpert teams
|
|
61
|
+
*/
|
|
62
|
+
collaborators?: IXpert[];
|
|
63
|
+
collaboratorNames?: string[];
|
|
64
|
+
/**
|
|
65
|
+
* I used toolsets
|
|
66
|
+
*/
|
|
67
|
+
toolsets?: IXpertToolset[];
|
|
68
|
+
toolsetIds?: string[];
|
|
69
|
+
/**
|
|
70
|
+
* I used knowledgebases
|
|
71
|
+
*/
|
|
72
|
+
knowledgebases?: IKnowledgebase[];
|
|
73
|
+
knowledgebaseIds?: string[];
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Expert agent, ai agent for the xperts.
|
|
77
|
+
*/
|
|
78
|
+
export interface IXpertAgent extends IBasePerTenantAndOrganizationEntityModel, TXpertAgent {
|
|
79
|
+
}
|
|
80
|
+
export type TXpertAgentOptions = {
|
|
81
|
+
/**
|
|
82
|
+
* Hide this agent node in the graph
|
|
83
|
+
*/
|
|
84
|
+
hidden?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Disable message history for agent conversation
|
|
87
|
+
*/
|
|
88
|
+
disableMessageHistory?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* The variable of message history to use
|
|
91
|
+
*/
|
|
92
|
+
historyVariable?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Write output variables to memory (state)
|
|
95
|
+
*/
|
|
96
|
+
memories?: TVariableAssigner[];
|
|
97
|
+
/**
|
|
98
|
+
* Whether to enable parallel tool calls, default: true
|
|
99
|
+
*/
|
|
100
|
+
parallelToolCalls?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Retry on failure
|
|
103
|
+
*/
|
|
104
|
+
retry?: {
|
|
105
|
+
enabled?: boolean;
|
|
106
|
+
stopAfterAttempt?: number;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Fallback model
|
|
110
|
+
*/
|
|
111
|
+
fallback?: {
|
|
112
|
+
enabled?: boolean;
|
|
113
|
+
copilotModel?: TCopilotModel;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Error handling
|
|
117
|
+
*/
|
|
118
|
+
errorHandling?: TErrorHandling;
|
|
119
|
+
/**
|
|
120
|
+
* Recall params for kbs
|
|
121
|
+
*/
|
|
122
|
+
recall?: TKBRecallParams;
|
|
123
|
+
/**
|
|
124
|
+
* Available tools
|
|
125
|
+
*/
|
|
126
|
+
availableTools?: Record<string, string[]>;
|
|
127
|
+
/**
|
|
128
|
+
* Options for tools of agent
|
|
129
|
+
*/
|
|
130
|
+
tools?: Record<string, {
|
|
131
|
+
timeout?: number;
|
|
132
|
+
}>;
|
|
133
|
+
/**
|
|
134
|
+
* How to achieve structured output (`StructuredOutputMethodOptions['method']`)
|
|
135
|
+
* - *functionCalling*
|
|
136
|
+
* - *jsonMode*
|
|
137
|
+
* - *jsonSchema*
|
|
138
|
+
*
|
|
139
|
+
*/
|
|
140
|
+
structuredOutputMethod?: 'functionCalling' | 'jsonMode' | 'jsonSchema' | string;
|
|
141
|
+
/**
|
|
142
|
+
* @deprecated use attachment
|
|
143
|
+
*/
|
|
144
|
+
vision?: TXpertAgentVision;
|
|
145
|
+
/**
|
|
146
|
+
* Attachment config of agent
|
|
147
|
+
*/
|
|
148
|
+
attachment?: TXpertAgentAttachment;
|
|
149
|
+
/**
|
|
150
|
+
* Config of middlewares for agent
|
|
151
|
+
*/
|
|
152
|
+
middlewares?: {
|
|
153
|
+
order: string[];
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
export type TXpertAgentVision = {
|
|
157
|
+
enabled?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Variable name that store the list of files to be understood
|
|
160
|
+
*/
|
|
161
|
+
variable?: string;
|
|
162
|
+
/**
|
|
163
|
+
* Image resolution for vision tasks
|
|
164
|
+
*/
|
|
165
|
+
resolution?: 'high' | 'low';
|
|
166
|
+
};
|
|
167
|
+
export type TXpertAgentAttachment = TXpertAgentVision & {
|
|
168
|
+
/**
|
|
169
|
+
* Max number of files to be processed
|
|
170
|
+
*/
|
|
171
|
+
maxNum?: number;
|
|
172
|
+
};
|
|
173
|
+
export type TAgentPromptTemplate = {
|
|
174
|
+
id: string;
|
|
175
|
+
role: 'ai' | 'human';
|
|
176
|
+
text: string;
|
|
177
|
+
};
|
|
178
|
+
export type TAgentOutputVariable = TXpertParameter & {
|
|
179
|
+
/**
|
|
180
|
+
* value write to state's variable
|
|
181
|
+
*/
|
|
182
|
+
variableSelector: string;
|
|
183
|
+
/**
|
|
184
|
+
* How to write value to variable
|
|
185
|
+
*/
|
|
186
|
+
operation: 'append' | 'extends' | 'overwrite' | 'clear';
|
|
187
|
+
};
|
|
188
|
+
export declare function agentLabel(agent: Partial<IXpertAgent>): string;
|
|
189
|
+
export declare function agentUniqueName(agent: IXpertAgent): string;
|
|
190
|
+
export declare function convertToUrlPath(title: string): string;
|
|
191
|
+
export declare const VariableOperations: {
|
|
192
|
+
value: TAgentOutputVariable['operation'];
|
|
193
|
+
label: I18nObject;
|
|
194
|
+
}[];
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { TChatRequestHuman, TInterruptCommand } from '@xpert-ai/chatkit-types';
|
|
2
|
+
import { STATE_VARIABLE_HUMAN } from '@xpert-ai/chatkit-types';
|
|
3
|
+
export type TXpertChatState = {
|
|
4
|
+
[STATE_VARIABLE_HUMAN]?: TChatRequestHuman;
|
|
5
|
+
} & Record<string, any>;
|
|
6
|
+
export type TXpertChatResumeDecision = {
|
|
7
|
+
type: 'confirm' | 'reject';
|
|
8
|
+
payload?: unknown;
|
|
9
|
+
};
|
|
10
|
+
export type TXpertChatInterruptPatch = Pick<TInterruptCommand, 'agentKey' | 'toolCalls' | 'update'>;
|
|
11
|
+
export type TXpertChatTarget = {
|
|
12
|
+
aiMessageId?: string;
|
|
13
|
+
executionId?: string;
|
|
14
|
+
};
|
|
15
|
+
export type TXpertChatSource = {
|
|
16
|
+
aiMessageId?: string;
|
|
17
|
+
executionId?: string;
|
|
18
|
+
};
|
|
19
|
+
export type TXpertChatSendRequest = {
|
|
20
|
+
action: 'send';
|
|
21
|
+
conversationId?: string;
|
|
22
|
+
projectId?: string;
|
|
23
|
+
environmentId?: string;
|
|
24
|
+
sandboxEnvironmentId?: string;
|
|
25
|
+
message: {
|
|
26
|
+
clientMessageId?: string;
|
|
27
|
+
input: TChatRequestHuman;
|
|
28
|
+
};
|
|
29
|
+
state?: TXpertChatState;
|
|
30
|
+
};
|
|
31
|
+
export type TXpertChatResumeRequest = {
|
|
32
|
+
action: 'resume';
|
|
33
|
+
conversationId: string;
|
|
34
|
+
target: TXpertChatTarget;
|
|
35
|
+
decision: TXpertChatResumeDecision;
|
|
36
|
+
patch?: TXpertChatInterruptPatch;
|
|
37
|
+
state?: TXpertChatState;
|
|
38
|
+
};
|
|
39
|
+
export type TXpertChatRetryRequest = {
|
|
40
|
+
action: 'retry';
|
|
41
|
+
conversationId: string;
|
|
42
|
+
source: TXpertChatSource;
|
|
43
|
+
environmentId?: string;
|
|
44
|
+
checkpointId?: string;
|
|
45
|
+
};
|
|
46
|
+
export type TChatRequest = TXpertChatSendRequest | TXpertChatResumeRequest | TXpertChatRetryRequest;
|
|
47
|
+
export type TXpertAgentChatRunRequest = {
|
|
48
|
+
action: 'run';
|
|
49
|
+
state: TXpertChatState;
|
|
50
|
+
agentKey: string;
|
|
51
|
+
xpertId: string;
|
|
52
|
+
environmentId?: string;
|
|
53
|
+
};
|
|
54
|
+
export type TXpertAgentChatResumeRequest = {
|
|
55
|
+
action: 'resume';
|
|
56
|
+
agentKey: string;
|
|
57
|
+
xpertId: string;
|
|
58
|
+
target: {
|
|
59
|
+
executionId: string;
|
|
60
|
+
};
|
|
61
|
+
decision: TXpertChatResumeDecision;
|
|
62
|
+
patch?: TXpertChatInterruptPatch;
|
|
63
|
+
environmentId?: string;
|
|
64
|
+
state?: TXpertChatState;
|
|
65
|
+
};
|
|
66
|
+
export type TXpertAgentChatRequest = TXpertAgentChatRunRequest | TXpertAgentChatResumeRequest;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
|
|
2
|
+
import { IIntegration } from '../integration.model';
|
|
3
|
+
import { IStorageFile, TFile } from '../storage-file.model';
|
|
4
|
+
import { TAvatar } from '../types';
|
|
5
|
+
import { IUser } from '../user.model';
|
|
6
|
+
import { ICopilotModel } from './copilot-model.model';
|
|
7
|
+
import { IKnowledgebase } from './knowledgebase.model';
|
|
8
|
+
import { IXpertToolset } from './xpert-toolset.model';
|
|
9
|
+
import { IXpertWorkspace } from './xpert-workspace.model';
|
|
10
|
+
import { IXpert, TXpertTeamDraft } from './xpert.model';
|
|
11
|
+
export type TXpertProjectSettings = {
|
|
12
|
+
instruction: string;
|
|
13
|
+
mode?: '' | 'plan';
|
|
14
|
+
};
|
|
15
|
+
export type TXpertProjectStatus = 'active' | 'deprecated' | 'archived';
|
|
16
|
+
export type TXpertProject = {
|
|
17
|
+
name: string;
|
|
18
|
+
avatar?: TAvatar;
|
|
19
|
+
description?: string;
|
|
20
|
+
status: TXpertProjectStatus;
|
|
21
|
+
settings?: TXpertProjectSettings;
|
|
22
|
+
copilotModel?: ICopilotModel;
|
|
23
|
+
copilotModelId?: string;
|
|
24
|
+
vcsId?: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Expert Project
|
|
28
|
+
*/
|
|
29
|
+
export interface IXpertProject extends TXpertProject, IBasePerTenantAndOrganizationEntityModel {
|
|
30
|
+
workspaceId?: string;
|
|
31
|
+
workspace?: IXpertWorkspace;
|
|
32
|
+
ownerId: string;
|
|
33
|
+
owner?: IUser;
|
|
34
|
+
xperts?: IXpert[];
|
|
35
|
+
toolsets?: IXpertToolset[];
|
|
36
|
+
knowledges?: IKnowledgebase[];
|
|
37
|
+
members?: IUser[];
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use *file volume* instead
|
|
40
|
+
*/
|
|
41
|
+
files?: IXpertProjectFile[];
|
|
42
|
+
attachments?: IStorageFile[];
|
|
43
|
+
vcs?: IXpertProjectVCS;
|
|
44
|
+
}
|
|
45
|
+
export interface IBasePerXpertProjectEntityModel extends IBasePerTenantAndOrganizationEntityModel {
|
|
46
|
+
projectId?: string;
|
|
47
|
+
project?: IXpertProject;
|
|
48
|
+
}
|
|
49
|
+
export interface IXpertProjectTask extends IBasePerXpertProjectEntityModel {
|
|
50
|
+
threadId?: string;
|
|
51
|
+
name: string;
|
|
52
|
+
type?: string;
|
|
53
|
+
status: 'pending' | 'in_progress' | 'completed' | 'failed';
|
|
54
|
+
steps: IXpertProjectTaskStep[];
|
|
55
|
+
}
|
|
56
|
+
export interface IXpertProjectTaskStep extends IBasePerXpertProjectEntityModel {
|
|
57
|
+
taskId: string;
|
|
58
|
+
stepIndex: number;
|
|
59
|
+
description: string;
|
|
60
|
+
notes: string;
|
|
61
|
+
status: 'pending' | 'running' | 'done' | 'failed';
|
|
62
|
+
}
|
|
63
|
+
export interface IXpertProjectTaskLog extends IBasePerXpertProjectEntityModel {
|
|
64
|
+
stepId: string;
|
|
65
|
+
logType: 'input' | 'output' | 'error';
|
|
66
|
+
content: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated use CodeXpert instead
|
|
70
|
+
*/
|
|
71
|
+
export interface IXpertProjectVCS extends IBasePerXpertProjectEntityModel {
|
|
72
|
+
integrationId?: string;
|
|
73
|
+
integration?: IIntegration;
|
|
74
|
+
auth?: {
|
|
75
|
+
token_type?: string;
|
|
76
|
+
access_token?: string;
|
|
77
|
+
state?: string;
|
|
78
|
+
};
|
|
79
|
+
installationId?: number | string;
|
|
80
|
+
repository?: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @deprecated Use `attachments`
|
|
84
|
+
*/
|
|
85
|
+
export interface IXpertProjectFile extends IBasePerXpertProjectEntityModel, Omit<TFile, 'createdAt'> {
|
|
86
|
+
}
|
|
87
|
+
export type TXpertProjectDSL = IXpertProject & {
|
|
88
|
+
xperts?: TXpertTeamDraft[];
|
|
89
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { IWorkflowNode, WorkflowNodeTypeEnum } from './xpert-workflow.model';
|
|
2
|
+
import { IBasePerWorkspaceEntityModel } from './xpert-workspace.model';
|
|
3
|
+
/**
|
|
4
|
+
* Table status
|
|
5
|
+
*/
|
|
6
|
+
export declare enum XpertTableStatus {
|
|
7
|
+
DRAFT = "draft",
|
|
8
|
+
READY = "ready",
|
|
9
|
+
PENDING_ACTIVATION = "pendingActivation",
|
|
10
|
+
ACTIVE = "active",
|
|
11
|
+
NEEDS_MIGRATION = "needsMigration",
|
|
12
|
+
DEPRECATED = "deprecated",
|
|
13
|
+
ERROR = "error"
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Custom Table for Xpert
|
|
17
|
+
*/
|
|
18
|
+
export interface IXpertTable extends IBasePerWorkspaceEntityModel, TXpertTable {
|
|
19
|
+
}
|
|
20
|
+
export type TXpertTable = {
|
|
21
|
+
name: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
database?: string;
|
|
24
|
+
schema?: string;
|
|
25
|
+
columns?: TXpertTableColumn[];
|
|
26
|
+
status: XpertTableStatus;
|
|
27
|
+
version?: number;
|
|
28
|
+
activatedAt?: Date;
|
|
29
|
+
message?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Union type for all supported database types
|
|
33
|
+
* Used when database type is not yet determined or needs to support multiple databases
|
|
34
|
+
*/
|
|
35
|
+
export type DatabaseDataType = string;
|
|
36
|
+
export type TXpertTableColumn = {
|
|
37
|
+
name: string;
|
|
38
|
+
type: DatabaseDataType;
|
|
39
|
+
label?: string;
|
|
40
|
+
required?: boolean;
|
|
41
|
+
isPrimaryKey?: boolean;
|
|
42
|
+
isUnique?: boolean;
|
|
43
|
+
autoIncrement?: boolean;
|
|
44
|
+
defaultValue?: string;
|
|
45
|
+
length?: number;
|
|
46
|
+
precision?: number;
|
|
47
|
+
scale?: number;
|
|
48
|
+
enumValues?: string[];
|
|
49
|
+
setValues?: string[];
|
|
50
|
+
};
|
|
51
|
+
export interface IWorkflowNodeDBOperation extends IWorkflowNode {
|
|
52
|
+
tableId: string;
|
|
53
|
+
}
|
|
54
|
+
export interface IWFNDBInsert extends IWorkflowNodeDBOperation {
|
|
55
|
+
type: WorkflowNodeTypeEnum.DB_INSERT;
|
|
56
|
+
columns?: Record<string, {
|
|
57
|
+
type: DatabaseDataType;
|
|
58
|
+
value?: any;
|
|
59
|
+
valueSelector?: string;
|
|
60
|
+
}>;
|
|
61
|
+
}
|
|
62
|
+
export declare function genXpertDBInsertKey(): string;
|
|
63
|
+
export interface IWFNDBUpdate extends IWorkflowNodeDBOperation {
|
|
64
|
+
type: WorkflowNodeTypeEnum.DB_UPDATE;
|
|
65
|
+
columns?: Record<string, {
|
|
66
|
+
type: DatabaseDataType;
|
|
67
|
+
value?: any;
|
|
68
|
+
valueSelector?: string;
|
|
69
|
+
}>;
|
|
70
|
+
}
|
|
71
|
+
export declare function genXpertDBUpdateKey(): string;
|
|
72
|
+
export interface IWFNDBDelete extends IWorkflowNodeDBOperation {
|
|
73
|
+
type: WorkflowNodeTypeEnum.DB_DELETE;
|
|
74
|
+
}
|
|
75
|
+
export declare function genXpertDBDeleteKey(): string;
|
|
76
|
+
export interface IWFNDBQuery extends IWorkflowNodeDBOperation {
|
|
77
|
+
type: WorkflowNodeTypeEnum.DB_QUERY;
|
|
78
|
+
}
|
|
79
|
+
export declare function genXpertDBQueryKey(): string;
|
|
80
|
+
export interface IWFNDBSql extends IWorkflowNodeDBOperation {
|
|
81
|
+
type: WorkflowNodeTypeEnum.DB_SQL;
|
|
82
|
+
sqlTemplate?: string;
|
|
83
|
+
}
|
|
84
|
+
export declare function genXpertDBSqlKey(): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
|
|
2
|
+
import { ScheduleTaskStatus, TScheduleOptions } from '../schedule';
|
|
3
|
+
import { IChatConversation } from './chat.model';
|
|
4
|
+
import { IXpert } from './xpert.model';
|
|
5
|
+
/**
|
|
6
|
+
* Tools for Xpert
|
|
7
|
+
*/
|
|
8
|
+
export interface IXpertTask extends IBasePerTenantAndOrganizationEntityModel, XpertTaskType {
|
|
9
|
+
}
|
|
10
|
+
export type XpertTaskType = {
|
|
11
|
+
name?: string;
|
|
12
|
+
schedule?: string;
|
|
13
|
+
options?: TScheduleOptions;
|
|
14
|
+
timeZone?: string;
|
|
15
|
+
prompt?: string;
|
|
16
|
+
status?: ScheduleTaskStatus;
|
|
17
|
+
xpert?: IXpert;
|
|
18
|
+
xpertId?: string;
|
|
19
|
+
agentKey?: string;
|
|
20
|
+
conversations?: IChatConversation[];
|
|
21
|
+
job?: any;
|
|
22
|
+
scheduleDescription?: string;
|
|
23
|
+
executionCount?: number;
|
|
24
|
+
errorCount?: number;
|
|
25
|
+
successCount?: number;
|
|
26
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { IBasePerTenantEntityModel } from '../base-entity.model';
|
|
2
|
+
import { IconDefinition, TAvatar } from '../types';
|
|
3
|
+
import { TCopilotModel } from './copilot-model.model';
|
|
4
|
+
import { MCPServerType, TMCPServer } from './xpert-tool-mcp.model';
|
|
5
|
+
import { XpertTypeEnum } from './xpert.model';
|
|
6
|
+
export interface IXpertTemplate extends IBasePerTenantEntityModel {
|
|
7
|
+
key: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
visitCount: number;
|
|
10
|
+
lastVisitedAt?: Date;
|
|
11
|
+
}
|
|
12
|
+
export type TTemplate = {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
category: string;
|
|
18
|
+
copyright: string;
|
|
19
|
+
privacyPolicy?: string;
|
|
20
|
+
export_data: string;
|
|
21
|
+
};
|
|
22
|
+
export type TXpertTemplate = TTemplate & {
|
|
23
|
+
avatar: TAvatar;
|
|
24
|
+
type: XpertTypeEnum | 'project';
|
|
25
|
+
copilotModel?: Partial<TCopilotModel>;
|
|
26
|
+
};
|
|
27
|
+
export interface IXpertMCPTemplate extends TTemplate {
|
|
28
|
+
/**
|
|
29
|
+
* string is the backward compatible image file URL format
|
|
30
|
+
*/
|
|
31
|
+
icon: IconDefinition | string;
|
|
32
|
+
type: MCPServerType;
|
|
33
|
+
author: string;
|
|
34
|
+
transport: MCPServerType;
|
|
35
|
+
explore: string;
|
|
36
|
+
tags?: string[];
|
|
37
|
+
visitCount?: number;
|
|
38
|
+
server: TMCPServer;
|
|
39
|
+
options?: any;
|
|
40
|
+
}
|
|
41
|
+
export type TKnowledgePipelineTemplate = TTemplate & {
|
|
42
|
+
icon: IconDefinition;
|
|
43
|
+
author: string;
|
|
44
|
+
explore: string;
|
|
45
|
+
tags?: string[];
|
|
46
|
+
visitCount?: number;
|
|
47
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export declare enum MCPServerType {
|
|
2
|
+
SSE = "sse",
|
|
3
|
+
STDIO = "stdio",
|
|
4
|
+
CODE = "code",
|
|
5
|
+
HTTP = "http"
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Configuration for stdio transport connection
|
|
9
|
+
*/
|
|
10
|
+
export interface StdioConnection {
|
|
11
|
+
transport: "stdio";
|
|
12
|
+
command: string;
|
|
13
|
+
args: string[];
|
|
14
|
+
env?: Record<string, string>;
|
|
15
|
+
encoding?: string;
|
|
16
|
+
encodingErrorHandler?: "strict" | "ignore" | "replace";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Configuration for SSE transport connection
|
|
20
|
+
*/
|
|
21
|
+
export interface SSEConnection {
|
|
22
|
+
transport: "sse";
|
|
23
|
+
url: string;
|
|
24
|
+
headers?: Record<string, string>;
|
|
25
|
+
useNodeEventSource?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Configuration for Streamable HTTP transport connection
|
|
29
|
+
*/
|
|
30
|
+
export interface HttpConnection {
|
|
31
|
+
transport: "http";
|
|
32
|
+
url: string;
|
|
33
|
+
headers?: Record<string, string>;
|
|
34
|
+
/**
|
|
35
|
+
* Whether to automatically fallback to SSE if Streamable HTTP is not available.
|
|
36
|
+
* Defaults to true.
|
|
37
|
+
*/
|
|
38
|
+
automaticSSEFallback?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export type TMCPServerReconnect = {
|
|
41
|
+
/**
|
|
42
|
+
* Whether to automatically restart the process if it exits
|
|
43
|
+
*/
|
|
44
|
+
enabled?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Maximum number of restart attempts
|
|
47
|
+
*/
|
|
48
|
+
maxAttempts?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Delay in milliseconds between restart attempts
|
|
51
|
+
*/
|
|
52
|
+
delayMs?: number;
|
|
53
|
+
};
|
|
54
|
+
export type TMCPServer = {
|
|
55
|
+
type: MCPServerType;
|
|
56
|
+
command?: string;
|
|
57
|
+
args?: string[];
|
|
58
|
+
env?: Record<string, string>;
|
|
59
|
+
encoding?: string;
|
|
60
|
+
encodingErrorHandler?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Additional reconnection settings
|
|
63
|
+
*/
|
|
64
|
+
reconnect?: TMCPServerReconnect;
|
|
65
|
+
url?: string;
|
|
66
|
+
headers?: Record<string, string>;
|
|
67
|
+
useNodeEventSource?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Whether to automatically fallback to SSE if Streamable HTTP is not available.
|
|
70
|
+
* Defaults to true. Only applicable for HTTP transport.
|
|
71
|
+
*/
|
|
72
|
+
automaticSSEFallback?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Default timeout in milliseconds for tool execution. Must be greater than 0.
|
|
75
|
+
* If not specified, tools will use their own configured timeout values.
|
|
76
|
+
*/
|
|
77
|
+
defaultToolTimeout?: number;
|
|
78
|
+
files?: {
|
|
79
|
+
name: string;
|
|
80
|
+
content: string;
|
|
81
|
+
}[];
|
|
82
|
+
toolNamePrefix?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Init scripts for sandbox
|
|
85
|
+
*/
|
|
86
|
+
initScripts?: string;
|
|
87
|
+
};
|
|
88
|
+
export type TMCPSchema = {
|
|
89
|
+
servers?: Record<string, TMCPServer>;
|
|
90
|
+
mcpServers?: Record<string, TMCPServer>;
|
|
91
|
+
};
|