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