@xpert-ai/contracts 3.15.18 → 3.17.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 (83) hide show
  1. package/index.cjs.js +301 -472
  2. package/index.esm.js +270 -465
  3. package/package.json +1 -1
  4. package/src/agent/ai-model.d.ts +4 -1
  5. package/src/agent/graph.d.ts +2 -0
  6. package/src/ai/ai-model.model.d.ts +2 -1
  7. package/src/ai/assistant-binding.model.d.ts +0 -1
  8. package/src/ai/evolution/candidate.d.ts +67 -0
  9. package/src/ai/evolution/capability-version.d.ts +45 -0
  10. package/src/ai/evolution/evaluation.d.ts +93 -0
  11. package/src/ai/evolution/example.d.ts +42 -0
  12. package/src/ai/evolution/experience.d.ts +21 -0
  13. package/src/ai/evolution/governance.d.ts +87 -0
  14. package/src/ai/evolution/index.d.ts +11 -0
  15. package/src/ai/evolution/learning-event.d.ts +69 -0
  16. package/src/ai/evolution/provider.d.ts +30 -0
  17. package/src/ai/evolution/release.d.ts +144 -0
  18. package/src/ai/evolution/runtime.d.ts +81 -0
  19. package/src/ai/evolution/target.d.ts +83 -0
  20. package/src/ai/feature.model.d.ts +3 -1
  21. package/src/ai/index.d.ts +5 -0
  22. package/src/ai/knowledge-doc-chunk.model.d.ts +143 -0
  23. package/src/ai/knowledge-doc.model.d.ts +53 -4
  24. package/src/ai/knowledge-filter.model.d.ts +92 -0
  25. package/src/ai/knowledge-retrieval-log.model.d.ts +18 -2
  26. package/src/ai/knowledgebase-task.model.d.ts +3 -1
  27. package/src/ai/knowledgebase.model.d.ts +6 -0
  28. package/src/ai/membership.model.d.ts +224 -7
  29. package/src/ai/model-access.model.d.ts +229 -0
  30. package/src/ai/model-gateway.model.d.ts +164 -0
  31. package/src/ai/model-usage.model.d.ts +163 -0
  32. package/src/ai/role-permissions.d.ts +11 -1
  33. package/src/ai/sandbox-terminal.model.d.ts +4 -0
  34. package/src/ai/xpert-agent-execution.model.d.ts +2 -0
  35. package/src/ai/xpert.model.d.ts +31 -11
  36. package/src/{analytics/data-source-type.d.ts → data-source-type.model.d.ts} +1 -1
  37. package/src/{analytics/data-source.d.ts → data-source.model.d.ts} +4 -7
  38. package/src/feature.model.d.ts +3 -1
  39. package/src/index.d.ts +4 -1
  40. package/src/plugin.d.ts +4 -0
  41. package/src/referral.model.d.ts +36 -0
  42. package/src/role-permission.model.d.ts +5 -3
  43. package/src/role.model.d.ts +0 -1
  44. package/src/tenant.model.d.ts +5 -0
  45. package/src/user.model.d.ts +1 -0
  46. package/src/utils.d.ts +5 -0
  47. package/src/view-extension/model.d.ts +12 -1
  48. package/src/analytics/ai.d.ts +0 -73
  49. package/src/analytics/approval-policy.model.d.ts +0 -30
  50. package/src/analytics/business-area-user.model.d.ts +0 -35
  51. package/src/analytics/business-area.d.ts +0 -17
  52. package/src/analytics/certification.model.d.ts +0 -11
  53. package/src/analytics/chatbi-conversation.model.d.ts +0 -15
  54. package/src/analytics/chatbi-model.model.d.ts +0 -18
  55. package/src/analytics/collection.model.d.ts +0 -6
  56. package/src/analytics/comment.model.d.ts +0 -10
  57. package/src/analytics/favorite.d.ts +0 -14
  58. package/src/analytics/features.d.ts +0 -23
  59. package/src/analytics/feed-model.d.ts +0 -13
  60. package/src/analytics/gateway.d.ts +0 -28
  61. package/src/analytics/index.d.ts +0 -38
  62. package/src/analytics/indicator-app.d.ts +0 -44
  63. package/src/analytics/indicator-market.d.ts +0 -4
  64. package/src/analytics/indicator.d.ts +0 -105
  65. package/src/analytics/model-query-log.model.d.ts +0 -41
  66. package/src/analytics/model-query.d.ts +0 -21
  67. package/src/analytics/notification-destination.d.ts +0 -10
  68. package/src/analytics/permission-approval-user.model.d.ts +0 -10
  69. package/src/analytics/permission-approval.model.d.ts +0 -47
  70. package/src/analytics/project.model.d.ts +0 -50
  71. package/src/analytics/role-permissions.d.ts +0 -28
  72. package/src/analytics/schema.d.ts +0 -262
  73. package/src/analytics/screenshot.model.d.ts +0 -24
  74. package/src/analytics/semantic-model-entity.d.ts +0 -38
  75. package/src/analytics/semantic-model-member.d.ts +0 -27
  76. package/src/analytics/semantic-model.d.ts +0 -183
  77. package/src/analytics/story-point.d.ts +0 -11
  78. package/src/analytics/story-template.model.d.ts +0 -28
  79. package/src/analytics/story-widget.d.ts +0 -12
  80. package/src/analytics/story.d.ts +0 -93
  81. package/src/analytics/subscription.d.ts +0 -38
  82. package/src/analytics/visit.model.d.ts +0 -34
  83. package/src/analytics/webSocket.d.ts +0 -48
@@ -0,0 +1,164 @@
1
+ import { AiModelTypeEnum } from '../agent';
2
+ import { ModelFeature } from './ai-model.model';
3
+ import { IModelAccessRequest, IUserModelGrant, ModelAccessUnavailableReasonEnum } from './model-access.model';
4
+ import { IBasePerTenantAndOrganizationEntityModel, IBasePerTenantEntityModel } from '../base-entity.model';
5
+ export declare enum ModelGatewayApiKeyStatusEnum {
6
+ Active = "active",
7
+ Expired = "expired",
8
+ Revoked = "revoked"
9
+ }
10
+ export declare enum ModelGatewayApiKeyLifetimeEnum {
11
+ Days30 = "30_days",
12
+ Days90 = "90_days",
13
+ Days180 = "180_days",
14
+ Permanent = "permanent"
15
+ }
16
+ export declare enum ModelGatewayCallStatusEnum {
17
+ Started = "started",
18
+ SettlementPending = "settlement_pending",
19
+ Succeeded = "succeeded",
20
+ Failed = "failed"
21
+ }
22
+ export declare enum ModelGatewayUsageSourceEnum {
23
+ Provider = "provider",
24
+ Estimated = "estimated",
25
+ None = "none"
26
+ }
27
+ export declare enum ModelGatewayUsageChannelEnum {
28
+ Xpert = "xpert",
29
+ ExternalApi = "external_api"
30
+ }
31
+ export declare const MODEL_GATEWAY_REQUESTS_PER_MINUTE_SETTING = "modelGatewayRequestsPerMinute";
32
+ export declare const DEFAULT_MODEL_GATEWAY_REQUESTS_PER_MINUTE = 60;
33
+ export declare const MIN_MODEL_GATEWAY_REQUESTS_PER_MINUTE = 1;
34
+ export declare const MAX_MODEL_GATEWAY_REQUESTS_PER_MINUTE = 10000;
35
+ export declare const MODEL_GATEWAY_MAX_CONCURRENT_REQUESTS_SETTING = "modelGatewayMaxConcurrentRequests";
36
+ export declare const DEFAULT_MODEL_GATEWAY_MAX_CONCURRENT_REQUESTS = 5;
37
+ export declare const MIN_MODEL_GATEWAY_MAX_CONCURRENT_REQUESTS = 1;
38
+ export declare const MAX_MODEL_GATEWAY_MAX_CONCURRENT_REQUESTS = 100;
39
+ export declare const DEFAULT_MODEL_GATEWAY_BODY_RETENTION_DAYS = 7;
40
+ export declare const MIN_MODEL_GATEWAY_BODY_RETENTION_DAYS = 1;
41
+ export declare const MAX_MODEL_GATEWAY_BODY_RETENTION_DAYS = 3650;
42
+ export declare const MODEL_GATEWAY_CALL_RETENTION_ENABLED_SETTING = "modelGatewayCallRetentionEnabled";
43
+ export declare const MODEL_GATEWAY_CALL_RETENTION_DAYS_SETTING = "modelGatewayCallRetentionDays";
44
+ export declare const DEFAULT_MODEL_GATEWAY_CALL_RETENTION_DAYS = 60;
45
+ export declare const MIN_MODEL_GATEWAY_CALL_RETENTION_DAYS = 1;
46
+ export declare const MAX_MODEL_GATEWAY_CALL_RETENTION_DAYS = 3650;
47
+ export interface IModelGatewayPublication extends IBasePerTenantAndOrganizationEntityModel {
48
+ copilotId: string;
49
+ copilotModelId: string;
50
+ provider: string;
51
+ modelType: AiModelTypeEnum;
52
+ model: string;
53
+ externalModelId: string;
54
+ capabilities: ModelFeature[];
55
+ }
56
+ export interface IModelGatewayApiKey extends IBasePerTenantAndOrganizationEntityModel {
57
+ userId: string;
58
+ userName?: string | null;
59
+ name: string;
60
+ prefix: string;
61
+ secret?: string;
62
+ status: ModelGatewayApiKeyStatusEnum;
63
+ validUntil?: Date | string | null;
64
+ lastUsedAt?: Date | string | null;
65
+ revokedAt?: Date | string | null;
66
+ revokedById?: string | null;
67
+ revokeReason?: string | null;
68
+ }
69
+ export interface IModelGatewayApiKeyCreated extends IModelGatewayApiKey {
70
+ secret: string;
71
+ }
72
+ export interface IModelGatewaySettings extends IBasePerTenantEntityModel {
73
+ storeBodies: boolean;
74
+ bodyRetentionDays: number;
75
+ }
76
+ export interface IModelGatewayAdminSettings extends IModelGatewaySettings {
77
+ requestsPerMinute: number;
78
+ maxConcurrentRequests: number;
79
+ }
80
+ export interface IModelGatewayCall extends IBasePerTenantAndOrganizationEntityModel {
81
+ requestId: string;
82
+ userId: string;
83
+ userName?: string | null;
84
+ apiKeyId: string;
85
+ publicationId: string;
86
+ externalModelId: string;
87
+ provider: string;
88
+ model: string;
89
+ status: ModelGatewayCallStatusEnum;
90
+ startedAt: Date | string;
91
+ completedAt?: Date | string | null;
92
+ durationMs?: number | null;
93
+ inputTokens: number;
94
+ outputTokens: number;
95
+ totalTokens: number;
96
+ priceAmount?: number | null;
97
+ priceCurrency?: string | null;
98
+ settlementAmount?: number | null;
99
+ settlementCurrency?: string | null;
100
+ exchangeRate?: number | null;
101
+ chargedPoints: number;
102
+ excessPoints: number;
103
+ usageSource: ModelGatewayUsageSourceEnum;
104
+ errorCode?: string | null;
105
+ errorMessage?: string | null;
106
+ encryptedRequest?: string | null;
107
+ encryptedResponse?: string | null;
108
+ bodyExpiresAt?: Date | string | null;
109
+ }
110
+ export interface IModelGatewayCallBody {
111
+ request: unknown | null;
112
+ response: unknown | null;
113
+ expiresAt?: Date | string | null;
114
+ }
115
+ export interface IModelGatewayCatalogItem {
116
+ id: string;
117
+ copilotId: string;
118
+ copilotModelId: string;
119
+ provider: string;
120
+ modelType: AiModelTypeEnum;
121
+ model: string;
122
+ externalModelId: string;
123
+ capabilities: ModelFeature[];
124
+ deprecated: boolean;
125
+ allowed: boolean;
126
+ unavailableReason?: ModelAccessUnavailableReasonEnum | null;
127
+ requestable: boolean;
128
+ planIncluded: boolean;
129
+ multiplier: number;
130
+ pendingRequest?: IModelAccessRequest | null;
131
+ grant?: IUserModelGrant | null;
132
+ }
133
+ export interface IModelGatewayCatalog {
134
+ items: IModelGatewayCatalogItem[];
135
+ eligible: boolean;
136
+ tenantFeatureEnabled: boolean;
137
+ organizationFeatureEnabled: boolean;
138
+ }
139
+ export type TModelGatewayApiKeyCreateInput = {
140
+ name: string;
141
+ lifetime?: ModelGatewayApiKeyLifetimeEnum;
142
+ };
143
+ export type TModelGatewayApiKeyRevokeInput = {
144
+ reason?: string | null;
145
+ };
146
+ export type TModelGatewayExternalRequestCreateInput = {
147
+ copilotId: string;
148
+ copilotModelId: string;
149
+ modelType: AiModelTypeEnum;
150
+ reason: string;
151
+ };
152
+ export type TModelGatewaySettingsUpdateInput = {
153
+ storeBodies: boolean;
154
+ bodyRetentionDays?: number;
155
+ requestsPerMinute: number;
156
+ maxConcurrentRequests: number;
157
+ };
158
+ export interface IModelGatewayAdminQuery {
159
+ search?: string;
160
+ status?: string;
161
+ userId?: string;
162
+ take?: number;
163
+ skip?: number;
164
+ }
@@ -0,0 +1,163 @@
1
+ import type { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
2
+ import type { AiModelTypeEnum } from '../agent';
3
+ export type ModelUsageModality = 'image' | 'video';
4
+ export type ModelUsageLedgerModality = 'text' | ModelUsageModality;
5
+ export type ImageGenerationOperation = 'text_to_image' | 'image_to_image' | 'multi_image_to_image';
6
+ export type VideoGenerationOperation = 'text_to_video' | 'image_to_video' | 'first_last_frame_to_video' | 'reference_to_video';
7
+ export type ModelUsageOperation = ImageGenerationOperation | VideoGenerationOperation;
8
+ export type ModelUsageLedgerOperation = AiModelTypeEnum | ModelUsageOperation;
9
+ export type ModelUsageOriginType = 'execution' | 'tool' | 'model';
10
+ export type ModelUsagePricingDimensions = {
11
+ resolution?: string;
12
+ audio?: boolean;
13
+ videoInput?: boolean;
14
+ durationSeconds?: number;
15
+ mode?: string;
16
+ };
17
+ export type ModelUsagePricingStatus = 'priced' | 'free' | 'unpriced';
18
+ export type ModelUsageChargeType = 'paid' | 'free';
19
+ export type ModelUsageTokenType = 'prompt' | 'completion' | 'total';
20
+ export type ModelUsagePriceRule = {
21
+ id: string;
22
+ version: string;
23
+ effective_from: string;
24
+ effective_to?: string;
25
+ unit: ModelUsageMetric['unit'];
26
+ token_type?: ModelUsageTokenType;
27
+ unit_size: number;
28
+ unit_price?: number;
29
+ currency?: string;
30
+ charge_type: ModelUsageChargeType;
31
+ operations?: ModelUsageOperation[];
32
+ dimensions?: Partial<Omit<ModelUsagePricingDimensions, 'durationSeconds'>>;
33
+ source_url?: string;
34
+ };
35
+ export type ModelUsagePricingConfig = {
36
+ type: 'usage';
37
+ rules: ModelUsagePriceRule[];
38
+ };
39
+ export type ModelUsagePricingContext = {
40
+ model: string;
41
+ operation: ModelUsageOperation;
42
+ modality: ModelUsageModality;
43
+ pricingDimensions?: ModelUsagePricingDimensions;
44
+ startedAt?: Date | string;
45
+ };
46
+ export type ModelUsagePricingSnapshot = {
47
+ capturedAt: string;
48
+ rules: ModelUsagePriceRule[];
49
+ };
50
+ export type ModelUsageMetric = {
51
+ unit: 'token';
52
+ promptTokens?: number;
53
+ completionTokens?: number;
54
+ totalTokens?: number;
55
+ authority: 'provider';
56
+ } | {
57
+ unit: 'generation';
58
+ quantity: number;
59
+ authority: 'provider' | 'contract';
60
+ } | {
61
+ unit: 'second';
62
+ quantity: number;
63
+ authority: 'provider' | 'request';
64
+ };
65
+ /** Final, authoritative usage emitted after a model request has completed. */
66
+ export type ModelUsageReport = {
67
+ requestId: string;
68
+ model?: string;
69
+ modelType: AiModelTypeEnum;
70
+ toolName?: string;
71
+ operation: ModelUsageOperation;
72
+ modality: ModelUsageModality;
73
+ pricingDimensions?: ModelUsagePricingDimensions;
74
+ pricingSnapshot?: ModelUsagePricingSnapshot;
75
+ metrics: ModelUsageMetric[];
76
+ recordedAt?: Date | string;
77
+ };
78
+ export type ModelUsageReportResult = {
79
+ requestId: string;
80
+ recorded: boolean;
81
+ ledgerIds: string[];
82
+ };
83
+ export interface IModelUsageLedger extends IBasePerTenantAndOrganizationEntityModel {
84
+ requestId: string;
85
+ revision: number;
86
+ userId?: string | null;
87
+ userName?: string | null;
88
+ originType: ModelUsageOriginType;
89
+ originId: string;
90
+ originExecutionId?: string | null;
91
+ copilotId: string;
92
+ providerScopeId: string;
93
+ provider: string;
94
+ model?: string | null;
95
+ modelType: AiModelTypeEnum;
96
+ toolName?: string | null;
97
+ modality: ModelUsageLedgerModality;
98
+ operation: ModelUsageLedgerOperation;
99
+ unit: ModelUsageMetric['unit'];
100
+ authority: ModelUsageMetric['authority'];
101
+ quantity?: number | null;
102
+ promptTokens?: number | null;
103
+ completionTokens?: number | null;
104
+ totalTokens?: number | null;
105
+ recordedAt: Date;
106
+ charge?: IModelChargeLedger | null;
107
+ }
108
+ export interface IModelUsageDetails {
109
+ requestId: string;
110
+ providerScopeId: string;
111
+ originExecutionId?: string | null;
112
+ provider: string;
113
+ model?: string | null;
114
+ modelType: AiModelTypeEnum;
115
+ toolName?: string | null;
116
+ modality: ModelUsageModality;
117
+ operation: ModelUsageOperation;
118
+ metrics: ModelUsageMetric[];
119
+ recordedAt: Date;
120
+ }
121
+ export interface IModelChargeLedger extends IBasePerTenantAndOrganizationEntityModel {
122
+ usageLedgerId: string;
123
+ pricingStatus: ModelUsagePricingStatus;
124
+ pricingRuleId?: string | null;
125
+ pricingRuleVersion?: string | null;
126
+ unit: ModelUsageMetric['unit'];
127
+ quantity: number;
128
+ unitSize?: number | null;
129
+ unitPrice?: number | null;
130
+ currency?: string | null;
131
+ amount?: number | null;
132
+ pricingRule?: ModelUsagePriceRule | null;
133
+ chargedAt: Date;
134
+ settlementCurrency?: string | null;
135
+ settlementAmount?: number | null;
136
+ exchangeRate?: number | null;
137
+ }
138
+ export type ModelUsageLedgerQuery = {
139
+ start?: string;
140
+ end?: string;
141
+ provider?: string;
142
+ model?: string;
143
+ userId?: string;
144
+ organizationId?: string;
145
+ unit?: ModelUsageMetric['unit'];
146
+ modality?: ModelUsageLedgerModality;
147
+ currency?: string;
148
+ pricingStatus?: ModelUsagePricingStatus;
149
+ };
150
+ export type ModelUsageLedgerTotals = {
151
+ modality: ModelUsageLedgerModality;
152
+ unit: ModelUsageMetric['unit'];
153
+ currency?: string | null;
154
+ pricingStatus: ModelUsagePricingStatus;
155
+ quantity: number;
156
+ promptTokens: number;
157
+ completionTokens: number;
158
+ totalTokens: number;
159
+ amount?: number | null;
160
+ settlementCurrency?: string | null;
161
+ settlementAmount?: number | null;
162
+ records: number;
163
+ };
@@ -6,9 +6,19 @@ export declare enum AIPermissionsEnum {
6
6
  COPILOT_VIEW = "COPILOT_VIEW",
7
7
  COPILOT_EDIT = "COPILOT_EDIT",
8
8
  MEMBERSHIP_EDIT = "MEMBERSHIP_EDIT",
9
+ MEMBERSHIP_USE = "MEMBERSHIP_USE",
10
+ MODEL_ACCESS_REQUEST_VIEW = "MODEL_ACCESS_REQUEST_VIEW",
11
+ MODEL_ACCESS_REQUEST_EDIT = "MODEL_ACCESS_REQUEST_EDIT",
12
+ MODEL_GATEWAY_USE = "MODEL_GATEWAY_USE",
13
+ MODEL_GATEWAY_MANAGE = "MODEL_GATEWAY_MANAGE",
14
+ BILLING_PRODUCT_EDIT = "BILLING_PRODUCT_EDIT",
15
+ BILLING_REFUND = "BILLING_REFUND",
16
+ PAYMENT_PROVIDER_EDIT = "PAYMENT_PROVIDER_EDIT",
9
17
  /**
10
18
  * Create or edit Xperts in organization.
11
19
  */
12
20
  XPERT_EDIT = "XPERT_EDIT",
13
- CHAT_VIEW = "CHAT_VIEW"
21
+ CHAT_VIEW = "CHAT_VIEW",
22
+ EVOLUTION_VIEW = "EVOLUTION_VIEW",
23
+ EVOLUTION_MANAGE = "EVOLUTION_MANAGE"
14
24
  }
@@ -49,6 +49,10 @@ export type SandboxTerminalResizeRequest = SandboxTerminalDimensions & {
49
49
  sessionId: string;
50
50
  };
51
51
  export type SandboxTerminalCloseRequest = {
52
+ requestId: string;
53
+ sessionId?: never;
54
+ } | {
55
+ requestId?: never;
52
56
  sessionId: string;
53
57
  };
54
58
  export type SandboxTerminalOpenedEvent = {
@@ -4,6 +4,7 @@ import { IXpert, TXpertTeamNodeType } from './xpert.model';
4
4
  import { IXpertAgent } from './xpert-agent.model';
5
5
  import { TSensitiveOperation } from './chat.model';
6
6
  import { WorkflowNodeTypeEnum } from './xpert-workflow.model';
7
+ import type { IModelUsageDetails } from './model-usage.model';
7
8
  export type TXpertExecution = {
8
9
  category?: TXpertTeamNodeType;
9
10
  type?: WorkflowNodeTypeEnum | string;
@@ -68,6 +69,7 @@ export type TXpertAgentExecution = TXpertExecution & {
68
69
  messages?: StoredMessage[];
69
70
  agent?: IXpertAgent;
70
71
  totalTokens?: number;
72
+ modelUsages?: IModelUsageDetails[];
71
73
  /**
72
74
  * Summary of conversation
73
75
  */
@@ -12,10 +12,11 @@ import { IXpertToolset } from './xpert-toolset.model';
12
12
  import { IBasePerWorkspaceEntityModel } from './xpert-workspace.model';
13
13
  import { IIntegration } from '../integration.model';
14
14
  import { TChatFrom } from './chat.model';
15
- import { IWorkflowNode, TVariableAssigner, TWFCase, VariableOperationEnum } from './xpert-workflow.model';
15
+ import { IWorkflowNode, TVariableAssigner, VariableOperationEnum } from './xpert-workflow.model';
16
16
  import { IEnvironment } from './environment.model';
17
17
  import { TXpertCommandProfile } from './prompt-workflow.model';
18
18
  import type { TXpertMarketplaceProfile } from './xpert-marketplace.model';
19
+ import type { KnowledgeFilterNode } from './knowledge-filter.model';
19
20
  export type ToolCall = LToolCall;
20
21
  export declare enum XpertTypeEnum {
21
22
  /**
@@ -227,12 +228,34 @@ export interface IXpert extends IBasePerWorkspaceEntityModel, TXpert {
227
228
  */
228
229
  knowledgebase?: IKnowledgebase;
229
230
  }
231
+ export interface IXpertPrincipalReference {
232
+ id: string;
233
+ name: string;
234
+ title?: string;
235
+ organizationName?: string | null;
236
+ tenantName?: string | null;
237
+ workspaceName?: string | null;
238
+ }
239
+ export declare enum XpertWorkbenchInitialLayoutEnum {
240
+ TwoColumns = "two-columns",
241
+ ChatkitMaximized = "chatkit-maximized",
242
+ WorkbenchMaximized = "workbench-maximized"
243
+ }
244
+ export type TXpertWorkbenchOptions = {
245
+ /**
246
+ * Initial layout used before this user has a saved Workbench layout preference.
247
+ */
248
+ initialLayout?: XpertWorkbenchInitialLayoutEnum;
249
+ /** Public extension view key selected when the Workbench first loads. */
250
+ defaultViewKey?: string;
251
+ };
230
252
  export type TXpertOptions = {
231
253
  bootstrap?: {
232
254
  source: 'template';
233
255
  templateKey: string;
234
256
  workspaceKind: 'org-default';
235
257
  };
258
+ workbench?: TXpertWorkbenchOptions;
236
259
  knowledge?: Record<string, {
237
260
  position?: IPoint;
238
261
  size?: ISize;
@@ -588,16 +611,13 @@ export type TKBRetrievalSettings = {
588
611
  entityTopK?: number;
589
612
  communityTopK?: number;
590
613
  graphWeight?: number;
591
- metadata?: {
592
- filtering_mode: 'disabled' | 'automatic' | 'manual';
593
- /**
594
- * Conditions (filter) when mode is manual
595
- */
596
- filtering_conditions?: TWFCase;
597
- /**
598
- * Parameter fields (tool call) when mode is automatic
599
- */
600
- fields?: Record<string, object>;
614
+ filtering?: {
615
+ /** Mandatory filter owned by the Agent/workflow to knowledgebase binding. */
616
+ fixed?: KnowledgeFilterNode;
617
+ /** Agent-authored filters can only narrow `fixed` filters. */
618
+ agent?: {
619
+ enabled: boolean;
620
+ };
601
621
  };
602
622
  };
603
623
  export declare function isXpertNodeType<T extends TXpertTeamNodeType>(type: T): (node: TXpertTeamNode) => node is NodeOf<T>;
@@ -1,4 +1,4 @@
1
- import { IBasePerTenantEntityModel } from '../base-entity.model';
1
+ import { IBasePerTenantEntityModel } from './base-entity.model';
2
2
  export interface IDataSourceType extends IBasePerTenantEntityModel {
3
3
  name?: string;
4
4
  type?: string;
@@ -1,15 +1,12 @@
1
- import { IBasePerTenantAndOrganizationEntityModel, IBasePerTenantEntityModel } from '../base-entity.model';
2
- import { IUser } from '../user.model';
3
- import { IDataSourceType } from './data-source-type';
4
- import { ISemanticModel } from './semantic-model';
1
+ import { IBasePerTenantAndOrganizationEntityModel, IBasePerTenantEntityModel } from './base-entity.model';
2
+ import { IDataSourceType } from './data-source-type.model';
3
+ import { IUser } from './user.model';
5
4
  export interface IDataSource extends IBasePerTenantAndOrganizationEntityModel {
6
5
  name?: string;
7
6
  typeId?: string;
8
7
  type?: IDataSourceType;
9
- useLocalAgent?: boolean;
10
8
  authType?: AuthenticationEnum;
11
9
  options?: Record<string, unknown>;
12
- models?: ISemanticModel[];
13
10
  authentications?: IDataSourceAuthentication[];
14
11
  }
15
12
  export interface IDataSourceAuthentication extends IBasePerTenantEntityModel {
@@ -56,7 +53,7 @@ export interface IColumnDef {
56
53
  nullable?: boolean;
57
54
  position?: number;
58
55
  /**
59
- * 应该等同于 label
56
+ * Should be equivalent to label
60
57
  */
61
58
  comment?: string;
62
59
  }
@@ -83,6 +83,7 @@ export declare enum FeatureEnum {
83
83
  FEATURE_USER = "FEATURE_USER",
84
84
  FEATURE_USERS = "FEATURE_USERS",
85
85
  FEATURE_USER_GROUPS = "FEATURE_USER_GROUPS",
86
+ FEATURE_REFERRAL = "FEATURE_REFERRAL",
86
87
  FEATURE_ORGANIZATIONS = "FEATURE_ORGANIZATIONS",
87
88
  FEATURE_SETTING = "FEATURE_SETTING",
88
89
  FEATURE_EMAIL_HISTORY = "FEATURE_EMAIL_HISTORY",
@@ -91,5 +92,6 @@ export declare enum FeatureEnum {
91
92
  FEATURE_SMS_GATEWAY = "FEATURE_SMS_GATEWAY",
92
93
  FEATURE_SMTP = "FEATURE_SMTP",
93
94
  FEATURE_ROLES_PERMISSION = "FEATURE_ROLES_PERMISSION",
94
- FEATURE_INTEGRATION = "FEATURE_INTEGRATION"
95
+ FEATURE_INTEGRATION = "FEATURE_INTEGRATION",
96
+ FEATURE_DATA_SOURCE = "FEATURE_DATA_SOURCE"
95
97
  }
package/src/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './types';
2
+ export * from './utils';
2
3
  export type { I18nObject, I18nText } from './i18n.model';
3
4
  export { resolveI18nText } from './i18n.model';
4
5
  export * from './contact.model';
@@ -22,6 +23,7 @@ export * from './organization-team-employee-model';
22
23
  export * from './organization-team-model';
23
24
  export * from './organization.model';
24
25
  export * from './role-permission.model';
26
+ export * from './referral.model';
25
27
  export * from './seed.model';
26
28
  export * from './tag-entity.model';
27
29
  export * from './tenant.model';
@@ -33,9 +35,10 @@ export * from './user-organization.model';
33
35
  export * from './user-group.model';
34
36
  export * from './user-me-context.model';
35
37
  export * from './user.model';
36
- export * from './analytics/index';
37
38
  export * from './custom-smtp.model';
38
39
  export * from './date-picker.model';
40
+ export * from './data-source.model';
41
+ export * from './data-source-type.model';
39
42
  export * from './integration.model';
40
43
  export * from './invite.model';
41
44
  export * from './organization-projects.model';
package/src/plugin.d.ts CHANGED
@@ -61,6 +61,9 @@ export declare const PLUGIN_RESOURCE_INSTALLATION_STATUS: {
61
61
  readonly BLOCKED: "blocked";
62
62
  readonly FAILED: "failed";
63
63
  };
64
+ export declare const PLUGIN_RESOURCE_ERROR_CODE: {
65
+ readonly NO_MATCHING_COMPONENTS: "PLUGIN_RESOURCE_NO_MATCHING_COMPONENTS";
66
+ };
64
67
  /**
65
68
  * Classifies plugin scope and governance.
66
69
  * - `system`: built-in/platform-managed plugin that users cannot install/uninstall from org APIs.
@@ -77,6 +80,7 @@ export type PluginMarketplaceAuthenticationPolicy = (typeof PLUGIN_MARKETPLACE_A
77
80
  export type PluginMcpToolApprovalMode = (typeof PLUGIN_MCP_TOOL_APPROVAL_MODE)[keyof typeof PLUGIN_MCP_TOOL_APPROVAL_MODE];
78
81
  export type PluginResourceRuntimeType = (typeof PLUGIN_RESOURCE_RUNTIME_TYPE)[keyof typeof PLUGIN_RESOURCE_RUNTIME_TYPE];
79
82
  export type PluginResourceInstallationStatus = (typeof PLUGIN_RESOURCE_INSTALLATION_STATUS)[keyof typeof PLUGIN_RESOURCE_INSTALLATION_STATUS];
83
+ export type PluginResourceErrorCode = (typeof PLUGIN_RESOURCE_ERROR_CODE)[keyof typeof PLUGIN_RESOURCE_ERROR_CODE];
80
84
  export type PluginScopeRelation = 'none' | 'overrides-global' | 'shadowed-by-organization';
81
85
  export type PluginTargetApp = 'xpert' | 'data-xpert' | (string & {});
82
86
  export type PluginSdkCompatibilityWarningCode = 'plugin-sdk-peer-dependency-missing' | 'plugin-sdk-peer-range-invalid' | 'plugin-sdk-peer-range-incompatible' | 'plugin-sdk-peer-range-spans-major';
@@ -0,0 +1,36 @@
1
+ import { IBasePerTenantEntityModel } from './base-entity.model';
2
+ import { IUser } from './user.model';
3
+ export interface IReferralCode extends IBasePerTenantEntityModel {
4
+ code: string;
5
+ userId?: string | null;
6
+ user?: IUser | null;
7
+ }
8
+ export interface IReferralRelation extends IBasePerTenantEntityModel {
9
+ referrerUserId?: string | null;
10
+ referrerUser?: IUser | null;
11
+ referredUserId?: string | null;
12
+ referredUser?: IUser | null;
13
+ usedCode: string;
14
+ boundAt: Date;
15
+ }
16
+ export interface IReferralAccountView {
17
+ id?: string | null;
18
+ name?: string | null;
19
+ email?: string | null;
20
+ deleted: boolean;
21
+ }
22
+ export interface IReferralRelationView {
23
+ id: string;
24
+ referrer: IReferralAccountView;
25
+ referred: IReferralAccountView;
26
+ usedCode: string;
27
+ boundAt: Date;
28
+ }
29
+ export interface IReferralCodeView {
30
+ code: string;
31
+ }
32
+ export interface IReferralRelationQuery {
33
+ search?: string;
34
+ skip?: number;
35
+ take?: number;
36
+ }
@@ -1,4 +1,3 @@
1
- import { AnalyticsPermissionsEnum } from './analytics/index';
2
1
  import { AIPermissionsEnum } from './ai/index';
3
2
  import { IBasePerTenantEntityModel } from './base-entity.model';
4
3
  import { IRole } from './role.model';
@@ -48,14 +47,17 @@ export declare enum PermissionsEnum {
48
47
  ORG_DEMO_EDIT = "ORG_DEMO_EDIT",// Orgnization demo edit permission
49
48
  INTEGRATION_EDIT = "INTEGRATION_EDIT",
50
49
  INTEGRATION_VIEW = "INTEGRATION_VIEW",
50
+ DATA_SOURCE_VIEW = "DATA_SOURCE_VIEW",
51
+ DATA_SOURCE_EDIT = "DATA_SOURCE_EDIT",
51
52
  FILE_STORAGE_VIEW = "FILE_STORAGE_VIEW",
52
53
  SMS_GATEWAY_VIEW = "SMS_GATEWAY_VIEW",
53
54
  CUSTOM_SMTP_VIEW = "CUSTOM_SMTP_VIEW",
54
55
  VIEW_ALL_ACCOUNTING_TEMPLATES = "VIEW_ALL_ACCOUNTING_TEMPLATES",
55
56
  ACCESS_DELETE_ACCOUNT = "ACCESS_DELETE_ACCOUNT",
56
- ACCESS_DELETE_ALL_DATA = "ACCESS_DELETE_ALL_DATA"
57
+ ACCESS_DELETE_ALL_DATA = "ACCESS_DELETE_ALL_DATA",
58
+ REFERRAL_VIEW = "REFERRAL_VIEW"
57
59
  }
58
60
  export declare const PermissionGroups: {
59
- GENERAL: (PermissionsEnum | AIPermissionsEnum | AnalyticsPermissionsEnum)[];
61
+ GENERAL: (PermissionsEnum | AIPermissionsEnum)[];
60
62
  ADMINISTRATION: PermissionsEnum[];
61
63
  };
@@ -13,7 +13,6 @@ export declare enum RolesEnum {
13
13
  SUPER_ADMIN = "SUPER_ADMIN",
14
14
  ADMIN = "ADMIN",
15
15
  AI_BUILDER = "AI_BUILDER",
16
- ANALYTICS_BUILDER = "ANALYTICS_BUILDER",
17
16
  VIEWER = "VIEWER",
18
17
  TRIAL = "TRIAL"
19
18
  }
@@ -33,6 +33,11 @@ export interface ITenantSetting extends S3FileStorageProviderConfig {
33
33
  fileStorageProvider?: string;
34
34
  copilotCheckpointRetentionEnabled?: string | null;
35
35
  copilotCheckpointRetentionDays?: string | null;
36
+ modelGatewayCallRetentionEnabled?: string | null;
37
+ modelGatewayCallRetentionDays?: string | null;
38
+ membershipCnyPerPoint?: string | null;
39
+ modelGatewayRequestsPerMinute?: string | null;
40
+ modelGatewayMaxConcurrentRequests?: string | null;
36
41
  tenant_title?: string;
37
42
  tenant_title_en?: string;
38
43
  tenant_enable_feishu?: boolean;
@@ -60,6 +60,7 @@ export interface IUserRegistrationInput {
60
60
  user: IUser;
61
61
  password?: string;
62
62
  confirmPassword?: string;
63
+ referralCode?: string;
63
64
  originalUrl?: string;
64
65
  organizationId?: string;
65
66
  createdById?: string;
package/src/utils.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export declare function isNil(value: unknown): value is null | undefined;
2
+ export declare function nonNullable<T>(value: T): value is NonNullable<T>;
3
+ export declare function isString(value: unknown): value is string;
4
+ export declare function isBlank(value: unknown): boolean;
5
+ export declare function nonBlank<T>(value: T): value is NonNullable<T>;