@xpert-ai/contracts 3.31.0 → 3.32.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.
@@ -45,12 +45,12 @@ export declare const modelReplacementSchema: z.ZodEffects<z.ZodObject<{
45
45
  policy: z.ZodEnum<["reset", "compatible"]>;
46
46
  workspaceId: z.ZodOptional<z.ZodString>;
47
47
  }, "strict", z.ZodTypeAny, {
48
- workspaceId?: string;
49
48
  source?: {
50
49
  copilotId?: string;
51
50
  modelType?: AiModelTypeEnum.LLM;
52
51
  model?: string;
53
52
  };
53
+ workspaceId?: string;
54
54
  target?: {
55
55
  copilotId?: string;
56
56
  modelType?: AiModelTypeEnum.LLM;
@@ -58,12 +58,12 @@ export declare const modelReplacementSchema: z.ZodEffects<z.ZodObject<{
58
58
  };
59
59
  policy?: "reset" | "compatible";
60
60
  }, {
61
- workspaceId?: string;
62
61
  source?: {
63
62
  copilotId?: string;
64
63
  modelType?: AiModelTypeEnum.LLM;
65
64
  model?: string;
66
65
  };
66
+ workspaceId?: string;
67
67
  target?: {
68
68
  copilotId?: string;
69
69
  modelType?: AiModelTypeEnum.LLM;
@@ -71,12 +71,12 @@ export declare const modelReplacementSchema: z.ZodEffects<z.ZodObject<{
71
71
  };
72
72
  policy?: "reset" | "compatible";
73
73
  }>, {
74
- workspaceId?: string;
75
74
  source?: {
76
75
  copilotId?: string;
77
76
  modelType?: AiModelTypeEnum.LLM;
78
77
  model?: string;
79
78
  };
79
+ workspaceId?: string;
80
80
  target?: {
81
81
  copilotId?: string;
82
82
  modelType?: AiModelTypeEnum.LLM;
@@ -84,12 +84,12 @@ export declare const modelReplacementSchema: z.ZodEffects<z.ZodObject<{
84
84
  };
85
85
  policy?: "reset" | "compatible";
86
86
  }, {
87
- workspaceId?: string;
88
87
  source?: {
89
88
  copilotId?: string;
90
89
  modelType?: AiModelTypeEnum.LLM;
91
90
  model?: string;
92
91
  };
92
+ workspaceId?: string;
93
93
  target?: {
94
94
  copilotId?: string;
95
95
  modelType?: AiModelTypeEnum.LLM;
@@ -131,12 +131,12 @@ export declare const executeModelReplacementSchema: z.ZodEffects<z.ZodObject<{
131
131
  policy: z.ZodEnum<["reset", "compatible"]>;
132
132
  workspaceId: z.ZodOptional<z.ZodString>;
133
133
  }, "strict", z.ZodTypeAny, {
134
- workspaceId?: string;
135
134
  source?: {
136
135
  copilotId?: string;
137
136
  modelType?: AiModelTypeEnum.LLM;
138
137
  model?: string;
139
138
  };
139
+ workspaceId?: string;
140
140
  target?: {
141
141
  copilotId?: string;
142
142
  modelType?: AiModelTypeEnum.LLM;
@@ -144,12 +144,12 @@ export declare const executeModelReplacementSchema: z.ZodEffects<z.ZodObject<{
144
144
  };
145
145
  policy?: "reset" | "compatible";
146
146
  }, {
147
- workspaceId?: string;
148
147
  source?: {
149
148
  copilotId?: string;
150
149
  modelType?: AiModelTypeEnum.LLM;
151
150
  model?: string;
152
151
  };
152
+ workspaceId?: string;
153
153
  target?: {
154
154
  copilotId?: string;
155
155
  modelType?: AiModelTypeEnum.LLM;
@@ -157,12 +157,12 @@ export declare const executeModelReplacementSchema: z.ZodEffects<z.ZodObject<{
157
157
  };
158
158
  policy?: "reset" | "compatible";
159
159
  }>, {
160
- workspaceId?: string;
161
160
  source?: {
162
161
  copilotId?: string;
163
162
  modelType?: AiModelTypeEnum.LLM;
164
163
  model?: string;
165
164
  };
165
+ workspaceId?: string;
166
166
  target?: {
167
167
  copilotId?: string;
168
168
  modelType?: AiModelTypeEnum.LLM;
@@ -170,12 +170,12 @@ export declare const executeModelReplacementSchema: z.ZodEffects<z.ZodObject<{
170
170
  };
171
171
  policy?: "reset" | "compatible";
172
172
  }, {
173
- workspaceId?: string;
174
173
  source?: {
175
174
  copilotId?: string;
176
175
  modelType?: AiModelTypeEnum.LLM;
177
176
  model?: string;
178
177
  };
178
+ workspaceId?: string;
179
179
  target?: {
180
180
  copilotId?: string;
181
181
  modelType?: AiModelTypeEnum.LLM;
@@ -195,12 +195,12 @@ export declare const executeModelReplacementSchema: z.ZodEffects<z.ZodObject<{
195
195
  }>, "many">;
196
196
  }, "strict", z.ZodTypeAny, {
197
197
  input?: {
198
- workspaceId?: string;
199
198
  source?: {
200
199
  copilotId?: string;
201
200
  modelType?: AiModelTypeEnum.LLM;
202
201
  model?: string;
203
202
  };
203
+ workspaceId?: string;
204
204
  target?: {
205
205
  copilotId?: string;
206
206
  modelType?: AiModelTypeEnum.LLM;
@@ -214,12 +214,12 @@ export declare const executeModelReplacementSchema: z.ZodEffects<z.ZodObject<{
214
214
  }[];
215
215
  }, {
216
216
  input?: {
217
- workspaceId?: string;
218
217
  source?: {
219
218
  copilotId?: string;
220
219
  modelType?: AiModelTypeEnum.LLM;
221
220
  model?: string;
222
221
  };
222
+ workspaceId?: string;
223
223
  target?: {
224
224
  copilotId?: string;
225
225
  modelType?: AiModelTypeEnum.LLM;
@@ -233,12 +233,12 @@ export declare const executeModelReplacementSchema: z.ZodEffects<z.ZodObject<{
233
233
  }[];
234
234
  }>, {
235
235
  input?: {
236
- workspaceId?: string;
237
236
  source?: {
238
237
  copilotId?: string;
239
238
  modelType?: AiModelTypeEnum.LLM;
240
239
  model?: string;
241
240
  };
241
+ workspaceId?: string;
242
242
  target?: {
243
243
  copilotId?: string;
244
244
  modelType?: AiModelTypeEnum.LLM;
@@ -252,12 +252,12 @@ export declare const executeModelReplacementSchema: z.ZodEffects<z.ZodObject<{
252
252
  }[];
253
253
  }, {
254
254
  input?: {
255
- workspaceId?: string;
256
255
  source?: {
257
256
  copilotId?: string;
258
257
  modelType?: AiModelTypeEnum.LLM;
259
258
  model?: string;
260
259
  };
260
+ workspaceId?: string;
261
261
  target?: {
262
262
  copilotId?: string;
263
263
  modelType?: AiModelTypeEnum.LLM;
@@ -1,7 +1,7 @@
1
1
  import type { IChatMessage } from './chat-message.model';
2
2
  import type { TChatAgentRunSummary } from './xpert-agent-execution.model';
3
3
  /** Display only: no graph state, commands, interrupts or client tool invocations. */
4
- export type TRunDisplayMessage = Pick<IChatMessage, 'id' | 'executionId' | 'conversationId' | 'content' | 'reasoning' | 'events' | 'status' | 'error'> & {
4
+ export type TRunDisplayMessage = Pick<IChatMessage, 'id' | 'parentId' | 'executionId' | 'conversationId' | 'content' | 'reasoning' | 'events' | 'status' | 'error'> & {
5
5
  role: 'ai';
6
6
  agentRuns?: TChatAgentRunSummary[];
7
7
  };
@@ -96,19 +96,19 @@ export declare const templateDependencyLocksSchema: z.ZodArray<z.ZodObject<{
96
96
  hash: z.ZodString;
97
97
  }, "strict", z.ZodTypeAny, {
98
98
  type?: "skill" | "toolset" | "app" | "asset" | "mcp_server" | "hook";
99
- hash?: string;
100
99
  key?: string;
100
+ hash?: string;
101
101
  }, {
102
102
  type?: "skill" | "toolset" | "app" | "asset" | "mcp_server" | "hook";
103
- hash?: string;
104
103
  key?: string;
104
+ hash?: string;
105
105
  }>, "many">;
106
106
  }, "strict", z.ZodTypeAny, {
107
107
  version?: string;
108
108
  components?: {
109
109
  type?: "skill" | "toolset" | "app" | "asset" | "mcp_server" | "hook";
110
- hash?: string;
111
110
  key?: string;
111
+ hash?: string;
112
112
  }[];
113
113
  source?: {
114
114
  name?: string;
@@ -127,8 +127,8 @@ export declare const templateDependencyLocksSchema: z.ZodArray<z.ZodObject<{
127
127
  version?: string;
128
128
  components?: {
129
129
  type?: "skill" | "toolset" | "app" | "asset" | "mcp_server" | "hook";
130
- hash?: string;
131
130
  key?: string;
131
+ hash?: string;
132
132
  }[];
133
133
  source?: {
134
134
  name?: string;
@@ -0,0 +1,53 @@
1
+ import { z } from 'zod/v3';
2
+ /** Portable HTTP/provider failure contract. No arbitrary details, cause, query or connection fields. */
3
+ export declare const analyticsDiagnosticSchema: z.ZodEffects<z.ZodObject<{
4
+ schema: z.ZodLiteral<"xpert.analytics.diagnostic">;
5
+ version: z.ZodLiteral<1>;
6
+ code: z.ZodString;
7
+ stage: z.ZodEnum<["request", "source", "validation", "authorization", "execution", "result", "dependency"]>;
8
+ message: z.ZodEffects<z.ZodString, string, string>;
9
+ retryable: z.ZodBoolean;
10
+ upstreamExecutionId: z.ZodOptional<z.ZodString>;
11
+ auditRef: z.ZodOptional<z.ZodString>;
12
+ }, "strict", z.ZodTypeAny, {
13
+ version?: 1;
14
+ code?: string;
15
+ message?: string;
16
+ schema?: "xpert.analytics.diagnostic";
17
+ stage?: "validation" | "request" | "source" | "authorization" | "execution" | "result" | "dependency";
18
+ retryable?: boolean;
19
+ upstreamExecutionId?: string;
20
+ auditRef?: string;
21
+ }, {
22
+ version?: 1;
23
+ code?: string;
24
+ message?: string;
25
+ schema?: "xpert.analytics.diagnostic";
26
+ stage?: "validation" | "request" | "source" | "authorization" | "execution" | "result" | "dependency";
27
+ retryable?: boolean;
28
+ upstreamExecutionId?: string;
29
+ auditRef?: string;
30
+ }>, {
31
+ version?: 1;
32
+ code?: string;
33
+ message?: string;
34
+ schema?: "xpert.analytics.diagnostic";
35
+ stage?: "validation" | "request" | "source" | "authorization" | "execution" | "result" | "dependency";
36
+ retryable?: boolean;
37
+ upstreamExecutionId?: string;
38
+ auditRef?: string;
39
+ }, {
40
+ version?: 1;
41
+ code?: string;
42
+ message?: string;
43
+ schema?: "xpert.analytics.diagnostic";
44
+ stage?: "validation" | "request" | "source" | "authorization" | "execution" | "result" | "dependency";
45
+ retryable?: boolean;
46
+ upstreamExecutionId?: string;
47
+ auditRef?: string;
48
+ }>;
49
+ type ParsedDiagnostic = z.infer<typeof analyticsDiagnosticSchema>;
50
+ export type AnalyticsDiagnostic = Required<Omit<ParsedDiagnostic, 'upstreamExecutionId' | 'auditRef'>> & Pick<ParsedDiagnostic, 'upstreamExecutionId' | 'auditRef'>;
51
+ /** Invalid provider diagnostics fail closed; never return Zod errors containing received input. */
52
+ export declare function parseAnalyticsDiagnostic(value: unknown): AnalyticsDiagnostic | undefined;
53
+ export {};
@@ -17,9 +17,9 @@ export declare const appPlatformAppSchema: z.ZodEffects<z.ZodObject<{
17
17
  configurationRef: z.ZodString;
18
18
  dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
19
19
  }, "strict", z.ZodTypeAny, {
20
+ key?: string;
20
21
  enabled?: boolean;
21
22
  required?: boolean;
22
- key?: string;
23
23
  appRef?: {
24
24
  pluginName?: string;
25
25
  appName?: string;
@@ -27,9 +27,9 @@ export declare const appPlatformAppSchema: z.ZodEffects<z.ZodObject<{
27
27
  configurationRef?: string;
28
28
  dependsOn?: string[];
29
29
  }, {
30
+ key?: string;
30
31
  enabled?: boolean;
31
32
  required?: boolean;
32
- key?: string;
33
33
  appRef?: {
34
34
  pluginName?: string;
35
35
  appName?: string;
@@ -47,9 +47,9 @@ export declare const appPlatformAppSchema: z.ZodEffects<z.ZodObject<{
47
47
  appName: string;
48
48
  };
49
49
  }, {
50
+ key?: string;
50
51
  enabled?: boolean;
51
52
  required?: boolean;
52
- key?: string;
53
53
  appRef?: {
54
54
  pluginName?: string;
55
55
  appName?: string;
@@ -102,9 +102,9 @@ export declare const appPlatformDefinitionSchema: z.ZodEffects<z.ZodObject<{
102
102
  configurationRef: z.ZodString;
103
103
  dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
104
104
  }, "strict", z.ZodTypeAny, {
105
+ key?: string;
105
106
  enabled?: boolean;
106
107
  required?: boolean;
107
- key?: string;
108
108
  appRef?: {
109
109
  pluginName?: string;
110
110
  appName?: string;
@@ -112,9 +112,9 @@ export declare const appPlatformDefinitionSchema: z.ZodEffects<z.ZodObject<{
112
112
  configurationRef?: string;
113
113
  dependsOn?: string[];
114
114
  }, {
115
+ key?: string;
115
116
  enabled?: boolean;
116
117
  required?: boolean;
117
- key?: string;
118
118
  appRef?: {
119
119
  pluginName?: string;
120
120
  appName?: string;
@@ -132,9 +132,9 @@ export declare const appPlatformDefinitionSchema: z.ZodEffects<z.ZodObject<{
132
132
  appName: string;
133
133
  };
134
134
  }, {
135
+ key?: string;
135
136
  enabled?: boolean;
136
137
  required?: boolean;
137
- key?: string;
138
138
  appRef?: {
139
139
  pluginName?: string;
140
140
  appName?: string;
@@ -249,9 +249,9 @@ export declare const appPlatformDefinitionSchema: z.ZodEffects<z.ZodObject<{
249
249
  key?: string;
250
250
  schemaVersion?: 1;
251
251
  apps?: {
252
+ key?: string;
252
253
  enabled?: boolean;
253
254
  required?: boolean;
254
- key?: string;
255
255
  appRef?: {
256
256
  pluginName?: string;
257
257
  appName?: string;
@@ -333,9 +333,9 @@ export declare const appPlatformDefinitionSchema: z.ZodEffects<z.ZodObject<{
333
333
  key?: string;
334
334
  schemaVersion?: 1;
335
335
  apps?: {
336
+ key?: string;
336
337
  enabled?: boolean;
337
338
  required?: boolean;
338
- key?: string;
339
339
  appRef?: {
340
340
  pluginName?: string;
341
341
  appName?: string;
@@ -0,0 +1,52 @@
1
+ import type { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
2
+ export declare const BUSINESS_AREA_ACCESS_ROLES: readonly ["consumer", "publisher", "domain_admin"];
3
+ export type TBusinessAreaRole = (typeof BUSINESS_AREA_ACCESS_ROLES)[number];
4
+ export type TBusinessAreaAction = 'view' | 'publish' | 'manage';
5
+ export type TBusinessAreaGrantSubject = {
6
+ subjectType: 'user';
7
+ userId: string;
8
+ userGroupId?: never;
9
+ } | {
10
+ subjectType: 'user_group';
11
+ userGroupId: string;
12
+ userId?: never;
13
+ };
14
+ export type TBusinessAreaGrantInput = TBusinessAreaGrantSubject & {
15
+ role: TBusinessAreaRole;
16
+ };
17
+ export interface IBusinessAreaAccessGrant extends IBasePerTenantAndOrganizationEntityModel {
18
+ id: string;
19
+ createdAt: Date;
20
+ updatedAt: Date;
21
+ businessAreaId: string;
22
+ subjectType: 'user' | 'user_group';
23
+ userId?: string | null;
24
+ userGroupId?: string | null;
25
+ role: TBusinessAreaRole;
26
+ subjectName?: string;
27
+ }
28
+ export interface IBusinessAreaAccess {
29
+ businessAreaId: string;
30
+ userId: string;
31
+ canView: boolean;
32
+ canPublish: boolean;
33
+ canManage: boolean;
34
+ sources: IBusinessAreaAccessGrant[];
35
+ platformManagement: boolean;
36
+ }
37
+ export interface IBusinessAreaCapabilities {
38
+ view: string[];
39
+ publish: string[];
40
+ manage: string[];
41
+ }
42
+ export interface IBusinessAreaGrantCandidates {
43
+ users: {
44
+ id: string;
45
+ name: string;
46
+ }[];
47
+ groups: {
48
+ id: string;
49
+ name: string;
50
+ }[];
51
+ }
52
+ export declare function businessAreaRoleAllows(role: TBusinessAreaRole, action: TBusinessAreaAction): boolean;
package/src/index.d.ts CHANGED
@@ -86,6 +86,7 @@ export * from './agent-plugin-maintenance';
86
86
  export * from './assistant-sharing.model';
87
87
  export * from './artifact-presentation.model';
88
88
  export * from './analytics-definition.model';
89
+ export * from './analytics-diagnostic';
89
90
  export * from './data-retention.model';
90
91
  export * from './content-resource.model';
91
92
  export * from './ai/mcp-execution-control.schema';
@@ -94,3 +95,4 @@ export * from './ai/thread-control-projection.model';
94
95
  export * from './ai/mcp-operation.model';
95
96
  export * from './ai/mcp-task.schema';
96
97
  export * from './user-notification.schema';
98
+ export * from './business-area-access.model';