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