@xpert-ai/contracts 3.29.1 → 3.30.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 (36) hide show
  1. package/index.cjs.js +2599 -1489
  2. package/index.esm.js +3698 -2635
  3. package/package.json +2 -2
  4. package/src/ai/ai-model.model.d.ts +8 -0
  5. package/src/ai/chat-activity.model.d.ts +6 -0
  6. package/src/ai/chat.model.d.ts +1 -1
  7. package/src/ai/conversation-trail.model.d.ts +417 -0
  8. package/src/ai/copilot-provider.model.d.ts +2 -0
  9. package/src/ai/copilot.model.d.ts +7 -4
  10. package/src/ai/default-model-role.d.ts +41 -0
  11. package/src/ai/execution-activity.model.d.ts +12 -0
  12. package/src/ai/execution-observability.model.d.ts +12 -12
  13. package/src/ai/index.d.ts +3 -0
  14. package/src/ai/membership.model.d.ts +2 -0
  15. package/src/ai/model-discovery.model.d.ts +1 -0
  16. package/src/ai/model-management.model.d.ts +358 -0
  17. package/src/ai/model-replacement.model.d.ts +291 -0
  18. package/src/ai/role-permissions.d.ts +59 -2
  19. package/src/ai/thread-activity.model.d.ts +1 -0
  20. package/src/ai/xpert-tool.model.d.ts +4 -3
  21. package/src/ai/xpert-toolset.model.d.ts +4 -3
  22. package/src/ai/xpert.model.d.ts +10 -1
  23. package/src/analytics-definition.model.d.ts +2 -0
  24. package/src/app-platform.d.ts +666 -0
  25. package/src/artifact.model.d.ts +1 -1
  26. package/src/index.d.ts +4 -0
  27. package/src/integration-sharing.model.d.ts +12 -0
  28. package/src/integration.model.d.ts +2 -0
  29. package/src/plugin-application.d.ts +13 -0
  30. package/src/role-permission-modules.d.ts +13 -1
  31. package/src/role-permission.model.d.ts +1 -0
  32. package/src/role.model.d.ts +19 -0
  33. package/src/types.d.ts +1 -0
  34. package/src/user-notification.schema.d.ts +721 -0
  35. package/src/user.model.d.ts +2 -0
  36. package/src/view-extension/model.d.ts +5 -0
@@ -0,0 +1,291 @@
1
+ import { z } from 'zod';
2
+ import { AiModelTypeEnum } from '../agent';
3
+ import { ModelIdentity, ModelParameterChange } from './model-management.model';
4
+ export declare const modelReplacementScopeSchema: z.ZodObject<{
5
+ workspaceId: z.ZodOptional<z.ZodString>;
6
+ }, "strict", z.ZodTypeAny, {
7
+ workspaceId?: string;
8
+ }, {
9
+ workspaceId?: string;
10
+ }>;
11
+ export type ModelReplacementScope = z.output<typeof modelReplacementScopeSchema>;
12
+ export interface ModelReplacementSource {
13
+ identity: ModelIdentity;
14
+ references: number;
15
+ }
16
+ export declare const modelReplacementSchema: z.ZodEffects<z.ZodObject<{
17
+ source: z.ZodObject<{
18
+ copilotId: z.ZodString;
19
+ model: z.ZodString;
20
+ } & {
21
+ modelType: z.ZodLiteral<AiModelTypeEnum.LLM>;
22
+ }, "strict", z.ZodTypeAny, {
23
+ copilotId?: string;
24
+ modelType?: AiModelTypeEnum.LLM;
25
+ model?: string;
26
+ }, {
27
+ copilotId?: string;
28
+ modelType?: AiModelTypeEnum.LLM;
29
+ model?: string;
30
+ }>;
31
+ target: z.ZodObject<{
32
+ copilotId: z.ZodString;
33
+ model: z.ZodString;
34
+ } & {
35
+ modelType: z.ZodLiteral<AiModelTypeEnum.LLM>;
36
+ }, "strict", z.ZodTypeAny, {
37
+ copilotId?: string;
38
+ modelType?: AiModelTypeEnum.LLM;
39
+ model?: string;
40
+ }, {
41
+ copilotId?: string;
42
+ modelType?: AiModelTypeEnum.LLM;
43
+ model?: string;
44
+ }>;
45
+ policy: z.ZodEnum<["reset", "compatible"]>;
46
+ workspaceId: z.ZodOptional<z.ZodString>;
47
+ }, "strict", z.ZodTypeAny, {
48
+ workspaceId?: string;
49
+ source?: {
50
+ copilotId?: string;
51
+ modelType?: AiModelTypeEnum.LLM;
52
+ model?: string;
53
+ };
54
+ target?: {
55
+ copilotId?: string;
56
+ modelType?: AiModelTypeEnum.LLM;
57
+ model?: string;
58
+ };
59
+ policy?: "reset" | "compatible";
60
+ }, {
61
+ workspaceId?: string;
62
+ source?: {
63
+ copilotId?: string;
64
+ modelType?: AiModelTypeEnum.LLM;
65
+ model?: string;
66
+ };
67
+ target?: {
68
+ copilotId?: string;
69
+ modelType?: AiModelTypeEnum.LLM;
70
+ model?: string;
71
+ };
72
+ policy?: "reset" | "compatible";
73
+ }>, {
74
+ workspaceId?: string;
75
+ source?: {
76
+ copilotId?: string;
77
+ modelType?: AiModelTypeEnum.LLM;
78
+ model?: string;
79
+ };
80
+ target?: {
81
+ copilotId?: string;
82
+ modelType?: AiModelTypeEnum.LLM;
83
+ model?: string;
84
+ };
85
+ policy?: "reset" | "compatible";
86
+ }, {
87
+ workspaceId?: string;
88
+ source?: {
89
+ copilotId?: string;
90
+ modelType?: AiModelTypeEnum.LLM;
91
+ model?: string;
92
+ };
93
+ target?: {
94
+ copilotId?: string;
95
+ modelType?: AiModelTypeEnum.LLM;
96
+ model?: string;
97
+ };
98
+ policy?: "reset" | "compatible";
99
+ }>;
100
+ export type ModelReplacementInput = z.output<typeof modelReplacementSchema>;
101
+ export declare const executeModelReplacementSchema: z.ZodEffects<z.ZodObject<{
102
+ input: z.ZodEffects<z.ZodObject<{
103
+ source: z.ZodObject<{
104
+ copilotId: z.ZodString;
105
+ model: z.ZodString;
106
+ } & {
107
+ modelType: z.ZodLiteral<AiModelTypeEnum.LLM>;
108
+ }, "strict", z.ZodTypeAny, {
109
+ copilotId?: string;
110
+ modelType?: AiModelTypeEnum.LLM;
111
+ model?: string;
112
+ }, {
113
+ copilotId?: string;
114
+ modelType?: AiModelTypeEnum.LLM;
115
+ model?: string;
116
+ }>;
117
+ target: z.ZodObject<{
118
+ copilotId: z.ZodString;
119
+ model: z.ZodString;
120
+ } & {
121
+ modelType: z.ZodLiteral<AiModelTypeEnum.LLM>;
122
+ }, "strict", z.ZodTypeAny, {
123
+ copilotId?: string;
124
+ modelType?: AiModelTypeEnum.LLM;
125
+ model?: string;
126
+ }, {
127
+ copilotId?: string;
128
+ modelType?: AiModelTypeEnum.LLM;
129
+ model?: string;
130
+ }>;
131
+ policy: z.ZodEnum<["reset", "compatible"]>;
132
+ workspaceId: z.ZodOptional<z.ZodString>;
133
+ }, "strict", z.ZodTypeAny, {
134
+ workspaceId?: string;
135
+ source?: {
136
+ copilotId?: string;
137
+ modelType?: AiModelTypeEnum.LLM;
138
+ model?: string;
139
+ };
140
+ target?: {
141
+ copilotId?: string;
142
+ modelType?: AiModelTypeEnum.LLM;
143
+ model?: string;
144
+ };
145
+ policy?: "reset" | "compatible";
146
+ }, {
147
+ workspaceId?: string;
148
+ source?: {
149
+ copilotId?: string;
150
+ modelType?: AiModelTypeEnum.LLM;
151
+ model?: string;
152
+ };
153
+ target?: {
154
+ copilotId?: string;
155
+ modelType?: AiModelTypeEnum.LLM;
156
+ model?: string;
157
+ };
158
+ policy?: "reset" | "compatible";
159
+ }>, {
160
+ workspaceId?: string;
161
+ source?: {
162
+ copilotId?: string;
163
+ modelType?: AiModelTypeEnum.LLM;
164
+ model?: string;
165
+ };
166
+ target?: {
167
+ copilotId?: string;
168
+ modelType?: AiModelTypeEnum.LLM;
169
+ model?: string;
170
+ };
171
+ policy?: "reset" | "compatible";
172
+ }, {
173
+ workspaceId?: string;
174
+ source?: {
175
+ copilotId?: string;
176
+ modelType?: AiModelTypeEnum.LLM;
177
+ model?: string;
178
+ };
179
+ target?: {
180
+ copilotId?: string;
181
+ modelType?: AiModelTypeEnum.LLM;
182
+ model?: string;
183
+ };
184
+ policy?: "reset" | "compatible";
185
+ }>;
186
+ selections: z.ZodArray<z.ZodObject<{
187
+ id: z.ZodString;
188
+ revision: z.ZodString;
189
+ }, "strict", z.ZodTypeAny, {
190
+ id?: string;
191
+ revision?: string;
192
+ }, {
193
+ id?: string;
194
+ revision?: string;
195
+ }>, "many">;
196
+ }, "strict", z.ZodTypeAny, {
197
+ input?: {
198
+ workspaceId?: string;
199
+ source?: {
200
+ copilotId?: string;
201
+ modelType?: AiModelTypeEnum.LLM;
202
+ model?: string;
203
+ };
204
+ target?: {
205
+ copilotId?: string;
206
+ modelType?: AiModelTypeEnum.LLM;
207
+ model?: string;
208
+ };
209
+ policy?: "reset" | "compatible";
210
+ };
211
+ selections?: {
212
+ id?: string;
213
+ revision?: string;
214
+ }[];
215
+ }, {
216
+ input?: {
217
+ workspaceId?: string;
218
+ source?: {
219
+ copilotId?: string;
220
+ modelType?: AiModelTypeEnum.LLM;
221
+ model?: string;
222
+ };
223
+ target?: {
224
+ copilotId?: string;
225
+ modelType?: AiModelTypeEnum.LLM;
226
+ model?: string;
227
+ };
228
+ policy?: "reset" | "compatible";
229
+ };
230
+ selections?: {
231
+ id?: string;
232
+ revision?: string;
233
+ }[];
234
+ }>, {
235
+ input?: {
236
+ workspaceId?: string;
237
+ source?: {
238
+ copilotId?: string;
239
+ modelType?: AiModelTypeEnum.LLM;
240
+ model?: string;
241
+ };
242
+ target?: {
243
+ copilotId?: string;
244
+ modelType?: AiModelTypeEnum.LLM;
245
+ model?: string;
246
+ };
247
+ policy?: "reset" | "compatible";
248
+ };
249
+ selections?: {
250
+ id?: string;
251
+ revision?: string;
252
+ }[];
253
+ }, {
254
+ input?: {
255
+ workspaceId?: string;
256
+ source?: {
257
+ copilotId?: string;
258
+ modelType?: AiModelTypeEnum.LLM;
259
+ model?: string;
260
+ };
261
+ target?: {
262
+ copilotId?: string;
263
+ modelType?: AiModelTypeEnum.LLM;
264
+ model?: string;
265
+ };
266
+ policy?: "reset" | "compatible";
267
+ };
268
+ selections?: {
269
+ id?: string;
270
+ revision?: string;
271
+ }[];
272
+ }>;
273
+ export type ExecuteModelReplacementInput = z.output<typeof executeModelReplacementSchema>;
274
+ export interface ModelReplacementPreview {
275
+ id: string;
276
+ name: string;
277
+ workspaceId: string;
278
+ revision: string;
279
+ count: number;
280
+ changes: {
281
+ path: string;
282
+ parameters: ModelParameterChange[];
283
+ }[];
284
+ missing: string[];
285
+ }
286
+ export interface ModelReplacementResult {
287
+ id: string;
288
+ status: 'updated' | 'conflict' | 'failed' | 'skipped' | 'restored';
289
+ operationId?: string;
290
+ message?: string;
291
+ }
@@ -1,29 +1,86 @@
1
+ /**
2
+ * AI feature permissions used by endpoint declarations and capability checks.
3
+ * Grants do not imply other permissions or replace resource scope and entitlement checks.
4
+ */
1
5
  export declare enum AIPermissionsEnum {
2
6
  /**
3
- * Create or edit Knowledgebase in organization.
7
+ * Manage knowledge bases, documents, FAQs and related configuration in the authorized scope.
8
+ * Runtime retrieval through an Assistant uses its resource authorization separately.
4
9
  */
5
10
  KNOWLEDGEBASE_EDIT = "KNOWLEDGEBASE_EDIT",
11
+ /**
12
+ * Legacy model-related viewing entry points; marked deprecated in the role editor.
13
+ * Does not authorize provider configuration APIs, which require COPILOT_EDIT.
14
+ */
6
15
  COPILOT_VIEW = "COPILOT_VIEW",
16
+ /** Manage model providers, credentials, models and Copilot configuration in the authorized scope. */
7
17
  COPILOT_EDIT = "COPILOT_EDIT",
18
+ /** Read model usage monitoring data in the authorized scope; does not grant model configuration rights. */
8
19
  MODEL_USAGE_MONITOR = "MODEL_USAGE_MONITOR",
20
+ /** Administer membership plans, user entitlements, quotas and membership records in the authorized scope. */
9
21
  MEMBERSHIP_EDIT = "MEMBERSHIP_EDIT",
22
+ /** Access the current user's membership, billing overview and usage; does not grant membership administration. */
10
23
  MEMBERSHIP_USE = "MEMBERSHIP_USE",
24
+ /** Read administrative model-access requests, grants and audit events without approving or changing grants. */
11
25
  MODEL_ACCESS_REQUEST_VIEW = "MODEL_ACCESS_REQUEST_VIEW",
26
+ /** Approve/reject model-access requests and extend/revoke model grants, subject to scope and workflow checks. */
12
27
  MODEL_ACCESS_REQUEST_EDIT = "MODEL_ACCESS_REQUEST_EDIT",
28
+ /**
29
+ * Use model gateway self-service: catalog, requests, own grants, API keys and call records.
30
+ * Model calls and execution sessions still require valid credentials, model grants and entitlements.
31
+ */
13
32
  MODEL_GATEWAY_USE = "MODEL_GATEWAY_USE",
33
+ /**
34
+ * Administer gateway settings, scoped API keys and call records.
35
+ * Does not imply MODEL_GATEWAY_USE or permission to configure model providers.
36
+ */
14
37
  MODEL_GATEWAY_MANAGE = "MODEL_GATEWAY_MANAGE",
38
+ /** Billing product-management permission contract; billing endpoints must explicitly enforce it. */
15
39
  BILLING_PRODUCT_EDIT = "BILLING_PRODUCT_EDIT",
40
+ /** Refund permission contract; billing endpoints must enforce it alongside refund eligibility checks. */
16
41
  BILLING_REFUND = "BILLING_REFUND",
42
+ /** Payment-provider configuration permission contract; payment endpoints must explicitly enforce it. */
17
43
  PAYMENT_PROVIDER_EDIT = "PAYMENT_PROVIDER_EDIT",
18
44
  /**
19
- * Create or edit Xperts in organization.
45
+ * Read authorized authoring resources; does not unlock the complete Studio configuration UI.
46
+ * Published Assistant runtime access is separate.
47
+ */
48
+ XPERT_VIEW = "XPERT_VIEW",
49
+ /**
50
+ * Manage tenant/shared authoring workspaces within the current scope.
51
+ * Resource authorization and action permissions such as XPERT_EDIT still apply.
52
+ */
53
+ XPERT_WORKSPACE_MANAGE = "XPERT_WORKSPACE_MANAGE",
54
+ /**
55
+ * Create, edit or publish Assistants and access authoring configuration APIs.
56
+ * Requires workspace authorization; workspace reading and chat use have separate permissions.
20
57
  */
21
58
  XPERT_EDIT = "XPERT_EDIT",
59
+ /**
60
+ * Use assigned applications and access their delivery status/retry operations.
61
+ * Does not grant installation or authoring; chat also requires CHAT_VIEW and Assistant access.
62
+ */
63
+ APPLICATION_USE = "APPLICATION_USE",
64
+ /**
65
+ * Initialize or update plugin applications and operate managed application deliveries.
66
+ * Organization membership and installation/service scope restrictions still apply.
67
+ */
68
+ APPLICATION_INSTALL = "APPLICATION_INSTALL",
69
+ /** Read projects and their business views subject to project membership and resource authorization. */
22
70
  XPERT_PROJECT_VIEW = "XPERT_PROJECT_VIEW",
71
+ /** Create or duplicate projects; project type and Assistant access checks still apply. */
23
72
  XPERT_PROJECT_CREATE = "XPERT_PROJECT_CREATE",
73
+ /** Edit project content and perform contribution actions when the project's resource policy permits them. */
24
74
  XPERT_PROJECT_EDIT = "XPERT_PROJECT_EDIT",
75
+ /** Manage projects, membership and pipeline configuration subject to project management authorization. */
25
76
  XPERT_PROJECT_MANAGE = "XPERT_PROJECT_MANAGE",
77
+ /**
78
+ * Run authorized published Assistants and use chat, conversation and runtime business APIs.
79
+ * This includes execution and authorized writes, not just viewing; it grants no authoring access.
80
+ */
26
81
  CHAT_VIEW = "CHAT_VIEW",
82
+ /** Read Agent Evolution dashboards, learning records, evaluations and change history in the authorized scope. */
27
83
  EVOLUTION_VIEW = "EVOLUTION_VIEW",
84
+ /** Manage Agent Evolution proposals, evaluations, approvals and releases, subject to governance checks. */
28
85
  EVOLUTION_MANAGE = "EVOLUTION_MANAGE"
29
86
  }
@@ -10,6 +10,7 @@ export interface ThreadActivitySnapshot {
10
10
  updatedAt: string;
11
11
  createdAt: string;
12
12
  messageRevision: string;
13
+ messageCount?: number;
13
14
  }>;
14
15
  cards: TMessageContentResourceCard[];
15
16
  }
@@ -1,7 +1,7 @@
1
1
  import type { JSONSchema4 } from 'json-schema';
2
2
  import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
3
3
  import { I18nObject } from '../types';
4
- import { AiProviderRole } from './copilot.model';
4
+ import { DefaultModelRole, LegacyProviderRole } from './default-model-role';
5
5
  import { TAvatar } from '../types';
6
6
  import { IXpertToolset } from './xpert-toolset.model';
7
7
  /**
@@ -33,9 +33,10 @@ export type XpertToolType = {
33
33
  parameters?: Record<string, any>;
34
34
  /**
35
35
  * Priority role of AI provider
36
- * @default `AiProviderRole.Secondary`
36
+ * @deprecated Use defaultModelRole. Legacy serialized field remains readable.
37
37
  */
38
- aiProviderRole?: AiProviderRole;
38
+ aiProviderRole?: LegacyProviderRole;
39
+ defaultModelRole?: DefaultModelRole;
39
40
  toolset?: IXpertToolset;
40
41
  toolsetId?: string;
41
42
  provider?: IBuiltinTool;
@@ -1,4 +1,4 @@
1
- import { AiProviderRole } from './copilot.model';
1
+ import { DefaultModelRole, LegacyProviderRole } from './default-model-role';
2
2
  import { TAvatar } from '../types';
3
3
  import { IXpertTool, XpertToolType } from './xpert-tool.model';
4
4
  import { IBasePerWorkspaceEntityModel } from './xpert-workspace.model';
@@ -35,9 +35,10 @@ export type TXpertToolset = {
35
35
  avatar?: TAvatar;
36
36
  /**
37
37
  * Priority role of AI provider
38
- * @default `AiProviderRole.Secondary`
38
+ * @deprecated Use defaultModelRole. Legacy serialized field remains readable.
39
39
  */
40
- aiProviderRole?: AiProviderRole;
40
+ aiProviderRole?: LegacyProviderRole;
41
+ defaultModelRole?: DefaultModelRole;
41
42
  /**
42
43
  * Privacy policy of this toolset
43
44
  */
@@ -41,6 +41,15 @@ export type TXpertTitleFeature = {
41
41
  enabled: boolean;
42
42
  instruction?: string;
43
43
  };
44
+ /** A short display label can accompany the complete message sent by a starter. */
45
+ export type TXpertOpenerQuestion = string | {
46
+ label: string;
47
+ prompt: string;
48
+ };
49
+ export declare function toXpertOpenerPrompt(question: TXpertOpenerQuestion): {
50
+ label: string;
51
+ prompt: string;
52
+ };
44
53
  export type TXpertFeatures = {
45
54
  realtimeVoice?: import('./realtime-voice.model').RealtimeVoiceFeature;
46
55
  /** Generate start-screen questions from recurring intents in conversation history. */
@@ -50,7 +59,7 @@ export type TXpertFeatures = {
50
59
  opener: {
51
60
  enabled: boolean;
52
61
  message: string;
53
- questions: string[];
62
+ questions: TXpertOpenerQuestion[];
54
63
  };
55
64
  suggestion: {
56
65
  enabled: boolean;
@@ -40,6 +40,8 @@ export interface AnalyticsDefinitionCreate {
40
40
  options: Record<string, JSONValue>;
41
41
  }
42
42
  export interface AnalyticsDefinitionPublish {
43
+ /** Owner-confirmed audience for all immutable versions; omitted preserves the current audience. */
44
+ visibility?: IAnalyticsDefinition['visibility'];
43
45
  expectedCurrentVersionId: string;
44
46
  options: Record<string, JSONValue>;
45
47
  }