@metad/contracts 3.6.7 → 3.7.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.
Files changed (291) hide show
  1. package/README.md +2 -2
  2. package/index.cjs.d.ts +1 -0
  3. package/index.cjs.js +4029 -5
  4. package/index.esm.d.ts +1 -0
  5. package/index.esm.js +3909 -0
  6. package/package.json +1 -1
  7. package/src/agent/{ai-model.ts → ai-model.d.ts} +2 -2
  8. package/src/agent/graph.d.ts +151 -0
  9. package/src/agent/index.d.ts +5 -0
  10. package/src/agent/token.d.ts +21 -0
  11. package/src/agent/utils.d.ts +19 -0
  12. package/src/agent/variables.d.ts +16 -0
  13. package/src/ai/ai-model.model.d.ts +198 -0
  14. package/src/ai/ai-provider.model.d.ts +43 -0
  15. package/src/ai/ai.model.d.ts +82 -0
  16. package/src/ai/chat-message-feedback.model.d.ts +24 -0
  17. package/src/ai/chat-message.model.d.ts +222 -0
  18. package/src/ai/chat.model.d.ts +189 -0
  19. package/src/ai/copilot-checkpoint.model.d.ts +23 -0
  20. package/src/ai/copilot-example.model.d.ts +19 -0
  21. package/src/ai/copilot-model.model.d.ts +26 -0
  22. package/src/ai/copilot-organization.model.d.ts +17 -0
  23. package/src/ai/copilot-provider.model.d.ts +31 -0
  24. package/src/ai/copilot-role.model.d.ts +43 -0
  25. package/src/ai/copilot-store.model.d.ts +29 -0
  26. package/src/ai/copilot-user.model.d.ts +20 -0
  27. package/src/ai/copilot.model.d.ts +36 -0
  28. package/src/ai/{environment.model.ts → environment.model.d.ts} +10 -12
  29. package/src/ai/feature.model.d.ts +6 -0
  30. package/src/ai/index.d.ts +42 -0
  31. package/src/ai/knowledge-doc-chunk.model.d.ts +61 -0
  32. package/src/ai/knowledge-doc-page.model.d.ts +15 -0
  33. package/src/ai/knowledge-doc.model.d.ts +222 -0
  34. package/src/ai/knowledge-pipeline.d.ts +107 -0
  35. package/src/ai/knowledge-retrieval-log.model.d.ts +10 -0
  36. package/src/ai/knowledgebase-task.model.d.ts +39 -0
  37. package/src/ai/knowledgebase.model.d.ts +174 -0
  38. package/src/ai/middleware.model.d.ts +18 -0
  39. package/src/ai/rag-web.d.ts +26 -0
  40. package/src/ai/rag.d.ts +24 -0
  41. package/src/ai/role-permissions.d.ts +13 -0
  42. package/src/ai/skill.model.d.ts +181 -0
  43. package/src/ai/types.d.ts +71 -0
  44. package/src/ai/xpert-agent-execution.model.d.ts +96 -0
  45. package/src/ai/xpert-agent.model.d.ts +204 -0
  46. package/src/ai/xpert-project.model.d.ts +86 -0
  47. package/src/ai/xpert-table.model.d.ts +84 -0
  48. package/src/ai/xpert-task.model.d.ts +26 -0
  49. package/src/ai/xpert-template.model.d.ts +47 -0
  50. package/src/ai/xpert-tool-mcp.model.d.ts +72 -0
  51. package/src/ai/xpert-tool.model.d.ts +154 -0
  52. package/src/ai/xpert-toolset.model.d.ts +200 -0
  53. package/src/ai/xpert-workflow-task.prompt.d.ts +2 -0
  54. package/src/ai/xpert-workflow.model.d.ts +401 -0
  55. package/src/ai/xpert-workspace.model.d.ts +32 -0
  56. package/src/ai/xpert.model.d.ts +551 -0
  57. package/src/ai/xpert.utils.d.ts +77 -0
  58. package/src/analytics/ai.d.ts +73 -0
  59. package/src/analytics/approval-policy.model.d.ts +30 -0
  60. package/src/analytics/business-area-user.model.d.ts +35 -0
  61. package/src/analytics/business-area.d.ts +17 -0
  62. package/src/analytics/certification.model.d.ts +11 -0
  63. package/src/analytics/chatbi-conversation.model.d.ts +15 -0
  64. package/src/analytics/chatbi-model.model.d.ts +18 -0
  65. package/src/analytics/collection.model.d.ts +6 -0
  66. package/src/analytics/comment.model.d.ts +10 -0
  67. package/src/analytics/data-source-type.d.ts +16 -0
  68. package/src/analytics/data-source.d.ts +62 -0
  69. package/src/analytics/favorite.d.ts +14 -0
  70. package/src/analytics/features.d.ts +19 -0
  71. package/src/analytics/feed-model.d.ts +13 -0
  72. package/src/analytics/gateway.d.ts +28 -0
  73. package/src/analytics/index.d.ts +38 -0
  74. package/src/analytics/indicator-app.d.ts +44 -0
  75. package/src/analytics/{indicator-market.ts → indicator-market.d.ts} +2 -6
  76. package/src/analytics/indicator.d.ts +105 -0
  77. package/src/analytics/model-query-log.model.d.ts +41 -0
  78. package/src/analytics/model-query.d.ts +21 -0
  79. package/src/analytics/{notification-destination.ts → notification-destination.d.ts} +5 -9
  80. package/src/analytics/{permission-approval-user.model.ts → permission-approval-user.model.d.ts} +8 -10
  81. package/src/analytics/permission-approval.model.d.ts +47 -0
  82. package/src/analytics/project.model.d.ts +50 -0
  83. package/src/analytics/role-permissions.d.ts +25 -0
  84. package/src/analytics/schema.d.ts +262 -0
  85. package/src/analytics/screenshot.model.d.ts +25 -0
  86. package/src/analytics/semantic-model-entity.d.ts +38 -0
  87. package/src/analytics/semantic-model-member.d.ts +27 -0
  88. package/src/analytics/semantic-model.d.ts +183 -0
  89. package/src/analytics/{story-point.ts → story-point.d.ts} +6 -11
  90. package/src/analytics/story-template.model.d.ts +28 -0
  91. package/src/analytics/story-widget.d.ts +12 -0
  92. package/src/analytics/story.d.ts +93 -0
  93. package/src/analytics/subscription.d.ts +38 -0
  94. package/src/analytics/visit.model.d.ts +34 -0
  95. package/src/analytics/webSocket.d.ts +48 -0
  96. package/src/api-key.model.d.ts +10 -0
  97. package/src/base-entity.model.d.ts +27 -0
  98. package/src/contact.model.d.ts +41 -0
  99. package/src/core.model.d.ts +97 -0
  100. package/src/{country.model.ts → country.model.d.ts} +2 -3
  101. package/src/currency.model.d.ts +579 -0
  102. package/src/{custom-smtp.model.ts → custom-smtp.model.d.ts} +17 -21
  103. package/src/date-picker.model.d.ts +5 -0
  104. package/src/email-template.model.d.ts +39 -0
  105. package/src/email.model.d.ts +36 -0
  106. package/src/employee.model.d.ts +128 -0
  107. package/src/entity-with-members.model.d.ts +13 -0
  108. package/src/feature.model.d.ts +93 -0
  109. package/src/file-provider.d.ts +33 -0
  110. package/src/help-center-article.model.d.ts +0 -0
  111. package/src/help-center.model.d.ts +0 -0
  112. package/src/http-status.enum.d.ts +57 -0
  113. package/src/import-export.model.d.ts +36 -0
  114. package/src/index.d.ts +48 -0
  115. package/src/integration/dify.d.ts +0 -0
  116. package/src/integration/dingtalk.d.ts +2 -0
  117. package/src/integration/fastgpt.d.ts +0 -0
  118. package/src/integration/firecrawl.d.ts +2 -0
  119. package/src/integration/github.d.ts +69 -0
  120. package/src/integration/index.d.ts +4 -0
  121. package/src/integration/lark.d.ts +11 -0
  122. package/src/integration/wecom.d.ts +2 -0
  123. package/src/integration.model.d.ts +90 -0
  124. package/src/invite.model.d.ts +123 -0
  125. package/src/language.model.d.ts +19 -0
  126. package/src/organization-contact.model.d.ts +73 -0
  127. package/src/{organization-department.model.ts → organization-department.model.d.ts} +10 -16
  128. package/src/organization-language.model.d.ts +18 -0
  129. package/src/organization-projects.model.d.ts +80 -0
  130. package/src/organization-team-employee-model.d.ts +12 -0
  131. package/src/organization-team-model.d.ts +19 -0
  132. package/src/organization.model.d.ts +239 -0
  133. package/src/{password-reset.model.ts → password-reset.model.d.ts} +10 -14
  134. package/src/{plain-object.model.ts → plain-object.model.d.ts} +1 -1
  135. package/src/plugin.d.ts +13 -0
  136. package/src/role-permission.model.d.ts +61 -0
  137. package/src/role.model.d.ts +26 -0
  138. package/src/schedule.d.ts +27 -0
  139. package/src/secret-token.model.d.ts +11 -0
  140. package/src/seed.model.d.ts +37 -0
  141. package/src/storage-file.model.d.ts +40 -0
  142. package/src/tag-entity.model.d.ts +20 -0
  143. package/src/tenant.model.d.ts +40 -0
  144. package/src/tools/index.d.ts +1 -0
  145. package/src/tools/sandbox.d.ts +5 -0
  146. package/src/translation.model.d.ts +26 -0
  147. package/src/types.d.ts +245 -0
  148. package/src/user-organization.model.d.ts +24 -0
  149. package/src/user.model.d.ts +131 -0
  150. package/src/visibility.model.d.ts +6 -0
  151. package/.babelrc +0 -5
  152. package/.eslintrc.json +0 -18
  153. package/babel.config.json +0 -1
  154. package/jest.config.ts +0 -16
  155. package/project.json +0 -53
  156. package/src/agent/graph.ts +0 -275
  157. package/src/agent/index.ts +0 -5
  158. package/src/agent/token.ts +0 -23
  159. package/src/agent/utils.spec.ts +0 -283
  160. package/src/agent/utils.ts +0 -122
  161. package/src/agent/variables.ts +0 -66
  162. package/src/ai/ai-model.model.ts +0 -232
  163. package/src/ai/ai-provider.model.ts +0 -53
  164. package/src/ai/ai.model.ts +0 -87
  165. package/src/ai/chat-message-feedback.model.ts +0 -31
  166. package/src/ai/chat-message.model.ts +0 -277
  167. package/src/ai/chat.model.ts +0 -207
  168. package/src/ai/copilot-checkpoint.model.ts +0 -25
  169. package/src/ai/copilot-example.model.ts +0 -23
  170. package/src/ai/copilot-model.model.ts +0 -31
  171. package/src/ai/copilot-organization.model.ts +0 -21
  172. package/src/ai/copilot-provider.model.ts +0 -46
  173. package/src/ai/copilot-role.model.ts +0 -48
  174. package/src/ai/copilot-store.model.ts +0 -34
  175. package/src/ai/copilot-user.model.ts +0 -24
  176. package/src/ai/copilot.model.ts +0 -47
  177. package/src/ai/feature.model.ts +0 -6
  178. package/src/ai/index.ts +0 -40
  179. package/src/ai/knowledge-doc-chunk.model.ts +0 -123
  180. package/src/ai/knowledge-doc-chunk.spec.ts +0 -47
  181. package/src/ai/knowledge-doc-page.model.ts +0 -20
  182. package/src/ai/knowledge-doc.model.ts +0 -364
  183. package/src/ai/knowledge-pipeline.ts +0 -138
  184. package/src/ai/knowledge-retrieval-log.model.ts +0 -19
  185. package/src/ai/knowledgebase-task.model.ts +0 -46
  186. package/src/ai/knowledgebase.model.ts +0 -205
  187. package/src/ai/rag-web.ts +0 -54
  188. package/src/ai/rag.ts +0 -24
  189. package/src/ai/role-permissions.ts +0 -13
  190. package/src/ai/types.ts +0 -83
  191. package/src/ai/xpert-agent-execution.model.ts +0 -115
  192. package/src/ai/xpert-agent.model.ts +0 -264
  193. package/src/ai/xpert-project.model.ts +0 -103
  194. package/src/ai/xpert-table.model.ts +0 -100
  195. package/src/ai/xpert-task.model.ts +0 -32
  196. package/src/ai/xpert-template.model.ts +0 -53
  197. package/src/ai/xpert-tool-mcp.model.ts +0 -77
  198. package/src/ai/xpert-tool.model.ts +0 -216
  199. package/src/ai/xpert-toolset.model.ts +0 -220
  200. package/src/ai/xpert-workflow-task.prompt.ts +0 -71
  201. package/src/ai/xpert-workflow.model.ts +0 -502
  202. package/src/ai/xpert-workspace.model.ts +0 -42
  203. package/src/ai/xpert.model.ts +0 -637
  204. package/src/ai/xpert.utils.ts +0 -214
  205. package/src/analytics/ai.ts +0 -79
  206. package/src/analytics/approval-policy.model.ts +0 -40
  207. package/src/analytics/business-area-user.model.ts +0 -43
  208. package/src/analytics/business-area.ts +0 -20
  209. package/src/analytics/certification.model.ts +0 -12
  210. package/src/analytics/chatbi-conversation.model.ts +0 -16
  211. package/src/analytics/chatbi-model.model.ts +0 -22
  212. package/src/analytics/collection.model.ts +0 -8
  213. package/src/analytics/comment.model.ts +0 -14
  214. package/src/analytics/data-source-type.ts +0 -19
  215. package/src/analytics/data-source.ts +0 -72
  216. package/src/analytics/favorite.ts +0 -18
  217. package/src/analytics/features.ts +0 -19
  218. package/src/analytics/feed-model.ts +0 -15
  219. package/src/analytics/gateway.ts +0 -31
  220. package/src/analytics/index.ts +0 -39
  221. package/src/analytics/indicator-app.ts +0 -49
  222. package/src/analytics/indicator.ts +0 -143
  223. package/src/analytics/model-query-log.model.ts +0 -45
  224. package/src/analytics/model-query.ts +0 -22
  225. package/src/analytics/permission-approval.model.ts +0 -58
  226. package/src/analytics/project.model.ts +0 -56
  227. package/src/analytics/role-permissions.ts +0 -36
  228. package/src/analytics/schema.ts +0 -300
  229. package/src/analytics/screenshot.model.ts +0 -28
  230. package/src/analytics/semantic-model-entity.ts +0 -50
  231. package/src/analytics/semantic-model-member.ts +0 -49
  232. package/src/analytics/semantic-model.ts +0 -237
  233. package/src/analytics/story-template.model.ts +0 -34
  234. package/src/analytics/story-widget.ts +0 -15
  235. package/src/analytics/story.ts +0 -109
  236. package/src/analytics/subscription.ts +0 -43
  237. package/src/analytics/visit.model.ts +0 -39
  238. package/src/analytics/webSocket.ts +0 -53
  239. package/src/api-key.model.ts +0 -11
  240. package/src/base-entity.model.ts +0 -34
  241. package/src/contact.model.ts +0 -45
  242. package/src/core.model.ts +0 -103
  243. package/src/currency.model.ts +0 -582
  244. package/src/date-picker.model.ts +0 -5
  245. package/src/email-template.model.ts +0 -50
  246. package/src/email.model.ts +0 -46
  247. package/src/employee.model.ts +0 -199
  248. package/src/entity-with-members.model.ts +0 -16
  249. package/src/feature.model.ts +0 -108
  250. package/src/file-provider.ts +0 -37
  251. package/src/help-center-article.model.ts +0 -35
  252. package/src/help-center.model.ts +0 -33
  253. package/src/http-status.enum.ts +0 -58
  254. package/src/import-export.model.ts +0 -42
  255. package/src/index.ts +0 -60
  256. package/src/integration/dify.ts +0 -31
  257. package/src/integration/dingtalk.ts +0 -16
  258. package/src/integration/fastgpt.ts +0 -32
  259. package/src/integration/firecrawl.ts +0 -46
  260. package/src/integration/github.ts +0 -149
  261. package/src/integration/index.ts +0 -15
  262. package/src/integration/lark.ts +0 -79
  263. package/src/integration/wecom.ts +0 -16
  264. package/src/integration.model.ts +0 -119
  265. package/src/invite.model.ts +0 -144
  266. package/src/language.model.ts +0 -22
  267. package/src/organization-contact.model.ts +0 -84
  268. package/src/organization-language.model.ts +0 -24
  269. package/src/organization-projects.model.ts +0 -99
  270. package/src/organization-team-employee-model.ts +0 -14
  271. package/src/organization-team-model.ts +0 -25
  272. package/src/organization.model.ts +0 -266
  273. package/src/plugin.ts +0 -15
  274. package/src/role-permission.model.ts +0 -123
  275. package/src/role.model.ts +0 -31
  276. package/src/schedule.ts +0 -71
  277. package/src/secret-token.model.ts +0 -15
  278. package/src/seed.model.ts +0 -50
  279. package/src/storage-file.model.ts +0 -46
  280. package/src/tag-entity.model.ts +0 -23
  281. package/src/tenant.model.ts +0 -52
  282. package/src/tools/index.ts +0 -1
  283. package/src/tools/sandbox.ts +0 -5
  284. package/src/translation.model.ts +0 -37
  285. package/src/types.ts +0 -277
  286. package/src/user-organization.model.ts +0 -31
  287. package/src/user.model.ts +0 -151
  288. package/src/visibility.model.ts +0 -6
  289. package/tsconfig.json +0 -22
  290. package/tsconfig.lib.json +0 -10
  291. package/tsconfig.spec.json +0 -9
@@ -0,0 +1,551 @@
1
+ import { ToolCall as LToolCall } from '@langchain/core/dist/messages/tool';
2
+ import { RunnableToolLike } from '@langchain/core/runnables';
3
+ import { StructuredToolInterface } from '@langchain/core/tools';
4
+ import { ITag } from '../tag-entity.model';
5
+ import { IUser, LanguagesEnum } from '../user.model';
6
+ import { ICopilotModel, TCopilotModel } from './copilot-model.model';
7
+ import { IKnowledgebase, TKBRecallParams } from './knowledgebase.model';
8
+ import { ChecklistItem, I18nObject, IPoint, ISize, TAvatar } from '../types';
9
+ import { IXpertAgent } from './xpert-agent.model';
10
+ import { IXpertToolset } from './xpert-toolset.model';
11
+ import { IBasePerWorkspaceEntityModel } from './xpert-workspace.model';
12
+ import { IIntegration } from '../integration.model';
13
+ import { TChatFrom, TSensitiveOperation } from './chat.model';
14
+ import { IWorkflowNode, TVariableAssigner, TWFCase, VariableOperationEnum } from './xpert-workflow.model';
15
+ import { IEnvironment } from './environment.model';
16
+ import { IStorageFile } from '../storage-file.model';
17
+ import { STATE_VARIABLE_HUMAN, TInterruptCommand } from '../agent/graph';
18
+ export type ToolCall = LToolCall;
19
+ export declare enum XpertTypeEnum {
20
+ /**
21
+ * Chat Agents
22
+ */
23
+ Agent = "agent",
24
+ /**
25
+ * Copilot in UI
26
+ */
27
+ Copilot = "copilot",
28
+ /**
29
+ * Knowledge Workflow
30
+ */
31
+ Knowledge = "knowledge"
32
+ }
33
+ export type TXpertFeatures = {
34
+ opener: {
35
+ enabled: boolean;
36
+ message: string;
37
+ questions: string[];
38
+ };
39
+ suggestion: {
40
+ enabled: boolean;
41
+ prompt: string;
42
+ };
43
+ textToSpeech: {
44
+ enabled: boolean;
45
+ copilotModel?: TCopilotModel;
46
+ };
47
+ speechToText: {
48
+ enabled: boolean;
49
+ copilotModel?: TCopilotModel;
50
+ };
51
+ /**
52
+ * File upload feature
53
+ */
54
+ attachment?: TXpertAttachment;
55
+ /**
56
+ * Reply with memory(Q&A)
57
+ */
58
+ memoryReply?: {
59
+ enabled: boolean;
60
+ scoreThreshold?: number;
61
+ };
62
+ };
63
+ export type TXpert = {
64
+ /**
65
+ * Unique slug identifier, generated from name
66
+ */
67
+ slug: string;
68
+ /**
69
+ * Expert name
70
+ */
71
+ name: string;
72
+ /**
73
+ * Expert type
74
+ */
75
+ type: XpertTypeEnum;
76
+ title?: string;
77
+ /**
78
+ * @deprecated use title
79
+ */
80
+ titleCN?: string;
81
+ /**
82
+ * Expert description
83
+ */
84
+ description?: string;
85
+ /**
86
+ * Is active
87
+ */
88
+ active?: boolean;
89
+ /**
90
+ * Avatar Object
91
+ */
92
+ avatar?: TAvatar;
93
+ /**
94
+ * Conversation starters
95
+ */
96
+ starters?: string[];
97
+ /**
98
+ * More configuration
99
+ */
100
+ options?: TXpertOptions;
101
+ /**
102
+ * Config for every agent
103
+ */
104
+ agentConfig?: TXpertAgentConfig;
105
+ /**
106
+ * Config of summarize past conversations
107
+ */
108
+ summarize?: TSummarize;
109
+ /**
110
+ * Long-term memory config
111
+ */
112
+ memory?: TLongTermMemory;
113
+ features?: TXpertFeatures;
114
+ /**
115
+ * Version of role: '1' '2' '2.1' '2.2'...
116
+ */
117
+ version?: string;
118
+ /**
119
+ * Is latest version
120
+ */
121
+ latest?: boolean;
122
+ /**
123
+ * Release notes
124
+ */
125
+ releaseNotes?: string;
126
+ /**
127
+ * Draft on current version
128
+ */
129
+ draft?: TXpertTeamDraft;
130
+ /**
131
+ * Published graph
132
+ */
133
+ graph?: TXpertGraph;
134
+ api?: TChatApi;
135
+ app?: TChatApp;
136
+ userId?: string;
137
+ user?: IUser;
138
+ /**
139
+ * Primary agent for this expert
140
+ */
141
+ agent?: IXpertAgent;
142
+ copilotModel?: ICopilotModel;
143
+ copilotModelId?: string;
144
+ agents?: IXpertAgent[];
145
+ /**
146
+ * Sub-experts, Digital experts who perform specific tasks, focus on completing the assigned work
147
+ */
148
+ executors?: IXpert[];
149
+ /**
150
+ * The task coordinator who called this expert
151
+ */
152
+ leaders?: IXpert[];
153
+ knowledgebases?: IKnowledgebase[];
154
+ toolsets?: IXpertToolset[];
155
+ /**
156
+ * The corresponding person in charge, whose has the authority to execute this digital expert
157
+ */
158
+ managers?: IUser[];
159
+ /**
160
+ * Integrations for this xpert
161
+ */
162
+ integrations?: IIntegration[];
163
+ tags?: ITag[];
164
+ };
165
+ /**
166
+ * Digital Expert
167
+ */
168
+ export interface IXpert extends IBasePerWorkspaceEntityModel, TXpert {
169
+ environmentId?: string;
170
+ environment?: IEnvironment;
171
+ /**
172
+ * When type is 'knowledge', it must binding a knowledgebase
173
+ */
174
+ knowledgebase?: IKnowledgebase;
175
+ }
176
+ export type TXpertOptions = {
177
+ knowledge?: Record<string, {
178
+ position?: IPoint;
179
+ size?: ISize;
180
+ }>;
181
+ toolset?: Record<string, {
182
+ position?: IPoint;
183
+ size?: ISize;
184
+ }>;
185
+ agent?: Record<string, {
186
+ position?: IPoint;
187
+ size?: ISize;
188
+ }>;
189
+ xpert?: Record<string, {
190
+ position?: IPoint;
191
+ size?: ISize;
192
+ }>;
193
+ position?: IPoint;
194
+ scale?: number;
195
+ };
196
+ /**
197
+ * Config for Agent execution (Langgraph.js)
198
+ */
199
+ export type TXpertAgentConfig = {
200
+ /**
201
+ * Maximum number of times a call can recurse. If not provided, defaults to 25.
202
+ */
203
+ recursionLimit?: number;
204
+ /** Maximum number of parallel calls to make. */
205
+ maxConcurrency?: number;
206
+ /**
207
+ * Timeout for this call in milliseconds.
208
+ */
209
+ timeout?: number;
210
+ /**
211
+ * Sensitive tools and agents
212
+ */
213
+ interruptBefore?: string[];
214
+ /**
215
+ * End nodes
216
+ */
217
+ endNodes?: string[];
218
+ /**
219
+ * Custom variables of graph state
220
+ */
221
+ stateVariables?: TStateVariable[];
222
+ /**
223
+ * Custom input parameters should be consistent with the start node or primary agent parameters.
224
+ */
225
+ parameters?: TXpertParameter[];
226
+ /**
227
+ * @deprecated use memories in tools
228
+ */
229
+ toolsMemory?: Record<string, TVariableAssigner[]>;
230
+ /**
231
+ * Disable agent's output
232
+ * @deprecated use `mute` instead
233
+ */
234
+ disableOutputs?: string[];
235
+ /**
236
+ * Mute nodes in the graph of agents: filter messages by tags of stream events
237
+ */
238
+ mute?: string[][];
239
+ /**
240
+ * Recall knowledge params
241
+ */
242
+ recalls?: Record<string, TKBRecallParams>;
243
+ /**
244
+ * Retrieval params for every knowledgebase
245
+ */
246
+ retrievals?: Record<string, TKBRetrievalSettings>;
247
+ /**
248
+ * Summarize the title of the conversation
249
+ */
250
+ summarizeTitle?: {
251
+ disable?: boolean;
252
+ instruction?: string;
253
+ };
254
+ tools?: Record<string, {
255
+ /**
256
+ * Memory assigner for tool's results. (save result of tool call into state variable)
257
+ */
258
+ memories?: TVariableAssigner[];
259
+ timeout?: number;
260
+ /**
261
+ * Custom description for the tool
262
+ */
263
+ description?: string;
264
+ }>;
265
+ };
266
+ export type TStateVariableType = XpertParameterTypeEnum | 'object' | 'array[string]' | 'array[number]' | 'array[object]';
267
+ /**
268
+ */
269
+ export type TStateVariable<ValueType = any, UpdateType = ValueType> = TXpertParameter & {
270
+ type: TStateVariableType;
271
+ default?: any;
272
+ reducer?: (a: ValueType, b: UpdateType) => ValueType;
273
+ operation?: VariableOperationEnum;
274
+ };
275
+ /**
276
+ * Config for summarizing past conversations
277
+ */
278
+ export type TSummarize = {
279
+ enabled?: boolean;
280
+ /**
281
+ * The system prompt guide how to summarize the conversation
282
+ */
283
+ prompt?: string;
284
+ /**
285
+ * The maximum number of tolerated messages, otherwise it will be summarized.
286
+ * Should be greater than the number of retained messages
287
+ */
288
+ maxMessages?: number;
289
+ /**
290
+ * Number of retained messages
291
+ */
292
+ retainMessages?: number;
293
+ };
294
+ export declare enum LongTermMemoryTypeEnum {
295
+ PROFILE = "profile",
296
+ QA = "qa"
297
+ }
298
+ export type TLongTermMemoryConfig = {
299
+ enabled?: boolean;
300
+ /**
301
+ * System prompt guide how to remember the key points of the conversation
302
+ */
303
+ prompt?: string;
304
+ };
305
+ /**
306
+ * Config of long-term memory
307
+ */
308
+ export type TLongTermMemory = {
309
+ enabled?: boolean;
310
+ copilotModel?: TCopilotModel;
311
+ profile?: TLongTermMemoryConfig & {
312
+ afterSeconds?: number;
313
+ };
314
+ qa?: TLongTermMemoryConfig;
315
+ };
316
+ export type TXpertAttachmentType = 'document' | 'image' | 'audio' | 'video' | 'others';
317
+ export type TXpertAttachment = {
318
+ enabled?: boolean;
319
+ type?: 'upload' | 'url' | 'all';
320
+ maxNum?: number;
321
+ fileTypes?: Array<TXpertAttachmentType>;
322
+ };
323
+ export declare enum XpertParameterTypeEnum {
324
+ /**
325
+ * @deprecated use string
326
+ */
327
+ TEXT = "text",
328
+ /**
329
+ * @deprecated use string
330
+ */
331
+ PARAGRAPH = "paragraph",
332
+ STRING = "string",
333
+ NUMBER = "number",
334
+ OBJECT = "object",
335
+ SELECT = "select",
336
+ FILE = "file",
337
+ ARRAY_STRING = "array[string]",
338
+ ARRAY_NUMBER = "array[number]",
339
+ ARRAY = "array[object]",
340
+ ARRAY_FILE = "array[file]",
341
+ ARRAY_DOCUMENT = "array[document]",
342
+ BOOLEAN = "boolean",
343
+ SECRET = "secret"
344
+ }
345
+ export type TXpertParameter = {
346
+ type: XpertParameterTypeEnum;
347
+ name: string;
348
+ /**
349
+ * @deprecated use description and name only
350
+ */
351
+ title?: string;
352
+ description?: string | I18nObject;
353
+ optional?: boolean;
354
+ default?: any;
355
+ maximum?: number;
356
+ options?: string[];
357
+ item?: TXpertParameter[];
358
+ };
359
+ export type TChatApp = {
360
+ enabled?: boolean;
361
+ public?: boolean;
362
+ };
363
+ export type TChatApi = {
364
+ disabled?: boolean;
365
+ };
366
+ export type TXpertGraph = {
367
+ nodes: TXpertTeamNode[];
368
+ connections: TXpertTeamConnection[];
369
+ };
370
+ export type TXpertTeamDraft = TXpertGraph & {
371
+ team: Partial<IXpert>;
372
+ savedAt?: Date;
373
+ checklist?: ChecklistItem[];
374
+ };
375
+ export type TXpertTeamNodeType = 'agent' | 'knowledge' | 'toolset' | 'xpert' | 'workflow';
376
+ export type TXpertTeamNode = {
377
+ key: string;
378
+ type: TXpertTeamNodeType;
379
+ position: IRect;
380
+ size?: ISize;
381
+ hash?: string;
382
+ parentId?: string;
383
+ readonly?: boolean;
384
+ } & ({
385
+ type: 'agent';
386
+ entity: IXpertAgent;
387
+ } | {
388
+ type: 'knowledge';
389
+ entity: IKnowledgebase;
390
+ } | {
391
+ type: 'toolset';
392
+ entity: IXpertToolset;
393
+ } | {
394
+ type: 'xpert';
395
+ entity: IXpert;
396
+ nodes?: TXpertTeamNode[];
397
+ connections?: TXpertTeamConnection[];
398
+ expanded?: boolean;
399
+ } | {
400
+ type: 'workflow';
401
+ entity: IWorkflowNode;
402
+ });
403
+ export interface IRect extends IPoint, Partial<ISize> {
404
+ gravityCenter?: IPoint;
405
+ }
406
+ export type TXpertTeamGroup = {
407
+ id: string;
408
+ title: string;
409
+ position: IPoint;
410
+ size?: ISize;
411
+ parentId?: string;
412
+ team: IXpert;
413
+ agent?: IXpertAgent;
414
+ };
415
+ export interface TXpertTeamConnection {
416
+ key: string;
417
+ from: string;
418
+ to: string;
419
+ /**
420
+ * - edge: Horizontal Process, workflow
421
+ * - others: Vertical Process, agent
422
+ */
423
+ type: 'edge' | TXpertTeamNodeType;
424
+ readonly?: boolean;
425
+ }
426
+ export declare enum ChatMessageTypeEnum {
427
+ MESSAGE = "message",
428
+ EVENT = "event"
429
+ }
430
+ /**
431
+ * https://js.langchain.com/docs/how_to/streaming/#event-reference
432
+ */
433
+ export declare enum ChatMessageEventTypeEnum {
434
+ ON_CONVERSATION_START = "on_conversation_start",
435
+ ON_CONVERSATION_END = "on_conversation_end",
436
+ ON_MESSAGE_START = "on_message_start",
437
+ ON_MESSAGE_END = "on_message_end",
438
+ ON_TOOL_START = "on_tool_start",
439
+ ON_TOOL_END = "on_tool_end",
440
+ ON_TOOL_ERROR = "on_tool_error",
441
+ /**
442
+ * Step message in tool call
443
+ */
444
+ ON_TOOL_MESSAGE = "on_tool_message",
445
+ ON_AGENT_START = "on_agent_start",
446
+ ON_AGENT_END = "on_agent_end",
447
+ ON_RETRIEVER_START = "on_retriever_start",
448
+ ON_RETRIEVER_END = "on_retriever_end",
449
+ ON_RETRIEVER_ERROR = "on_retriever_error",
450
+ ON_INTERRUPT = "on_interrupt",
451
+ ON_ERROR = "on_error",
452
+ ON_CHAT_EVENT = "on_chat_event"
453
+ }
454
+ /**
455
+ * Human input message, include parameters and attachments
456
+ */
457
+ export type TChatRequestHuman = {
458
+ input?: string;
459
+ files?: Partial<IStorageFile>[];
460
+ [key: string]: unknown;
461
+ };
462
+ export type TChatRequest = {
463
+ /**
464
+ * The human input, include parameters
465
+ */
466
+ input: TChatRequestHuman;
467
+ /**
468
+ * Custom graph state
469
+ */
470
+ state?: {
471
+ [STATE_VARIABLE_HUMAN]: TChatRequestHuman;
472
+ } & Record<string, any>;
473
+ xpertId: string;
474
+ agentKey?: string;
475
+ projectId?: string;
476
+ conversationId?: string;
477
+ environmentId?: string;
478
+ id?: string;
479
+ executionId?: string;
480
+ confirm?: boolean;
481
+ /**
482
+ * Reject the sensitive tool calls
483
+ */
484
+ reject?: boolean;
485
+ /**
486
+ * Message to update parameters of last tool call message
487
+ * @deprecated use `command` instead
488
+ */
489
+ operation?: TSensitiveOperation;
490
+ command?: TInterruptCommand;
491
+ retry?: boolean;
492
+ };
493
+ export type TChatOptions = {
494
+ conversationId?: string;
495
+ /**
496
+ * @deprecated
497
+ */
498
+ knowledgebases?: string[];
499
+ /**
500
+ * @deprecated
501
+ */
502
+ toolsets?: string[];
503
+ /**
504
+ * The language used by the current browser page
505
+ */
506
+ language?: LanguagesEnum;
507
+ /**
508
+ * The browser's time zone
509
+ */
510
+ timeZone?: string;
511
+ /**
512
+ * Call from
513
+ */
514
+ from?: TChatFrom;
515
+ /**
516
+ * Whether to summarize the conversation title
517
+ */
518
+ summarizeTitle?: boolean;
519
+ /**
520
+ * Project ID, identify the project where the xpert invoked
521
+ */
522
+ projectId?: string;
523
+ /**
524
+ * Schedule task ID
525
+ */
526
+ taskId?: string;
527
+ /**
528
+ * Specify environment with variables to run
529
+ */
530
+ environment?: IEnvironment;
531
+ /**
532
+ * Specify additional tools
533
+ */
534
+ tools?: (StructuredToolInterface | RunnableToolLike)[];
535
+ };
536
+ /**
537
+ * Knowledgebase retrieval settings
538
+ */
539
+ export type TKBRetrievalSettings = {
540
+ metadata: {
541
+ filtering_mode: "disabled" | "automatic" | "manual";
542
+ /**
543
+ * Conditions (filter) when mode is manual
544
+ */
545
+ filtering_conditions: TWFCase;
546
+ /**
547
+ * Parameter fields (tool call) when mode is automatic
548
+ */
549
+ fields: Record<string, object>;
550
+ };
551
+ };
@@ -0,0 +1,77 @@
1
+ import { IPoint } from '../types';
2
+ import { IXpertAgent } from './xpert-agent.model';
3
+ import { IXpert, TXpertTeamNode } from './xpert.model';
4
+ export declare function omitXpertRelations(xpert: Partial<IXpert>): {
5
+ environmentId?: string;
6
+ workspaceId?: string;
7
+ workspace?: import("./xpert-workspace.model").IXpertWorkspace;
8
+ publishAt?: Date;
9
+ deletedAt?: Date;
10
+ organizationId?: string;
11
+ organization?: import("..").IOrganization;
12
+ tenantId?: string;
13
+ tenant?: import("..").ITenant;
14
+ id?: string;
15
+ createdById?: string;
16
+ createdBy?: import("..").IUser;
17
+ updatedById?: string;
18
+ updatedBy?: import("..").IUser;
19
+ createdAt?: Date;
20
+ updatedAt?: Date;
21
+ slug?: string;
22
+ name?: string;
23
+ type?: import("./xpert.model").XpertTypeEnum;
24
+ title?: string;
25
+ titleCN?: string;
26
+ description?: string;
27
+ active?: boolean;
28
+ avatar?: import("../types").TAvatar;
29
+ starters?: string[];
30
+ options?: import("./xpert.model").TXpertOptions;
31
+ agentConfig?: import("./xpert.model").TXpertAgentConfig;
32
+ summarize?: import("./xpert.model").TSummarize;
33
+ memory?: import("./xpert.model").TLongTermMemory;
34
+ features?: import("./xpert.model").TXpertFeatures;
35
+ version?: string;
36
+ latest?: boolean;
37
+ releaseNotes?: string;
38
+ graph?: import("./xpert.model").TXpertGraph;
39
+ api?: import("./xpert.model").TChatApi;
40
+ app?: import("./xpert.model").TChatApp;
41
+ userId?: string;
42
+ user?: import("..").IUser;
43
+ copilotModel?: import("./copilot-model.model").ICopilotModel;
44
+ copilotModelId?: string;
45
+ tags?: import("..").ITag[];
46
+ };
47
+ export declare function figureOutXpert(xpert: IXpert, isDraft: boolean): Partial<IXpert>;
48
+ export declare function xpertLabel(agent: Partial<IXpert>): string;
49
+ export declare function createXpertGraph(xpert: IXpert, position: IPoint): {
50
+ nodes: TXpertTeamNode[];
51
+ size: {
52
+ width: number;
53
+ height: number;
54
+ };
55
+ connections: import("./xpert.model").TXpertTeamConnection[];
56
+ };
57
+ export declare function locateNodes(nodes: TXpertTeamNode[], position: IPoint): {
58
+ size: {
59
+ width: number;
60
+ height: number;
61
+ };
62
+ nodes: TXpertTeamNode[];
63
+ };
64
+ /**
65
+ * Create all nodes of xpert and it's area size
66
+ *
67
+ * @param xpert
68
+ * @returns
69
+ */
70
+ export declare function createXpertNodes(xpert: IXpert, position: IPoint): {
71
+ nodes: TXpertTeamNode[];
72
+ size: {
73
+ width: number;
74
+ height: number;
75
+ };
76
+ };
77
+ export declare function createAgentConnections(agent: IXpertAgent, collaborators: IXpert[]): any[];
@@ -0,0 +1,73 @@
1
+ export declare enum ChatDashboardMessageType {
2
+ /**
3
+ * Display data preview using analytical card event
4
+ */
5
+ AnalyticalCard = "AnalyticalCard",
6
+ /**
7
+ * Create or edit a cube event
8
+ */
9
+ Cube = "Cube",
10
+ /**
11
+ * Edit a virtual cube event
12
+ */
13
+ VirtualCube = "VirtualCube",
14
+ /**
15
+ * Create or edit members (calculated members or dimension sets) event
16
+ */
17
+ Members = "Members",
18
+ /**
19
+ * List indicators event
20
+ */
21
+ ListIndicators = "ListIndicators",
22
+ /**
23
+ * Create or edit an indicator event
24
+ */
25
+ Indicator = "Indicator",
26
+ Indicators = "Indicators"
27
+ }
28
+ export declare enum BIInterruptMessageType {
29
+ SwitchProject = "switch_project",
30
+ SwitchSemanticModel = "switch_semantic_model",
31
+ DeleteArtifact = "delete_artifact"
32
+ }
33
+ export type TMessageContentCube = {
34
+ type: ChatDashboardMessageType.Cube;
35
+ data: {
36
+ modelId: string;
37
+ cubeName: string;
38
+ };
39
+ };
40
+ export type TMessageContentVirtualCube = {
41
+ type: ChatDashboardMessageType.VirtualCube;
42
+ data: {
43
+ modelId: string;
44
+ cubeName: string;
45
+ };
46
+ };
47
+ export type TMessageContentMembers = {
48
+ type: ChatDashboardMessageType.Members;
49
+ data: {
50
+ modelId: string;
51
+ cubeName: string;
52
+ members: {
53
+ __id__: string;
54
+ name: string;
55
+ label?: string;
56
+ caption?: string;
57
+ description?: string;
58
+ formula: string;
59
+ formatting?: {
60
+ unit?: string;
61
+ decimal?: number;
62
+ };
63
+ }[];
64
+ };
65
+ };
66
+ export type TMessageContentIndicator = {
67
+ type: ChatDashboardMessageType.Indicator;
68
+ data: {
69
+ modelId?: string;
70
+ cubeName?: string;
71
+ indicatorId: string;
72
+ };
73
+ };