@xpert-ai/contracts 3.17.6 → 3.18.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.
@@ -10,13 +10,72 @@ import { IXpertToolset } from './xpert-toolset.model';
10
10
  import { IXpertWorkspace } from './xpert-workspace.model';
11
11
  import { IXpert, TXpertTeamDraft } from './xpert.model';
12
12
  export type TXpertProjectSettings = {
13
- instruction: string;
13
+ /** @deprecated Project instructions are stored in /project/<projectId>/project.md. */
14
+ instruction?: string;
14
15
  mode?: '' | 'plan';
15
16
  managementMode?: TXpertProjectManagementMode;
16
- /** Explicit default Assistant used by the Project assistant panel and task orchestration. */
17
+ /** @deprecated Project Xperts are peers and no default Project Assistant is selected. */
17
18
  projectAssistantId?: string;
18
19
  };
19
20
  export type TXpertProjectManagementMode = 'simple' | 'advanced';
21
+ export type TXpertProjectMemberRole = 'manager' | 'editor' | 'member';
22
+ export type TXpertProjectAccessRole = 'owner' | TXpertProjectMemberRole;
23
+ export type TXpertProjectInvitationStatus = 'pending' | 'accepted' | 'declined' | 'revoked' | 'expired';
24
+ export type TXpertProjectAccessSummary = {
25
+ role: TXpertProjectAccessRole;
26
+ capabilities: {
27
+ canRead: boolean;
28
+ canEdit: boolean;
29
+ canManage: boolean;
30
+ canUse: boolean;
31
+ };
32
+ };
33
+ export type TXpertProjectMemberSummary = {
34
+ id: string;
35
+ firstName?: string;
36
+ lastName?: string;
37
+ email?: string;
38
+ username?: string;
39
+ imageUrl?: string;
40
+ membershipId?: string;
41
+ projectRole: TXpertProjectAccessRole;
42
+ joinedAt?: Date;
43
+ };
44
+ export type TXpertProjectInstructions = {
45
+ content: string;
46
+ };
47
+ export type TXpertProjectSkillSource = 'repository' | 'upload' | 'legacy';
48
+ export type TXpertProjectSkillSummary = {
49
+ id: string;
50
+ name: string;
51
+ path: string;
52
+ enabled: boolean;
53
+ source: TXpertProjectSkillSource;
54
+ description?: string;
55
+ version?: string;
56
+ };
57
+ export type TXpertProjectSkills = {
58
+ items: TXpertProjectSkillSummary[];
59
+ total: number;
60
+ };
61
+ export type TXpertProjectSkillFile = {
62
+ path: string;
63
+ content: string;
64
+ };
65
+ export type TXpertProjectMemberInput = {
66
+ userId: string;
67
+ role?: TXpertProjectMemberRole;
68
+ };
69
+ export type TXpertProjectMemberRoleInput = {
70
+ role: TXpertProjectMemberRole;
71
+ };
72
+ export type TXpertProjectInvitationInput = {
73
+ email: string;
74
+ role?: TXpertProjectMemberRole;
75
+ };
76
+ export type TXpertProjectInvitationTokenInput = {
77
+ token: string;
78
+ };
20
79
  export type TXpertProjectStatus = 'active' | 'deprecated' | 'archived';
21
80
  export type TXpertProjectPlanStatus = 'draft' | 'active' | 'completed' | 'archived';
22
81
  export type TXpertProjectMilestoneStatus = 'planned' | 'in_progress' | 'completed' | 'blocked';
@@ -89,6 +148,7 @@ export type TXpertProject = {
89
148
  * Expert Project
90
149
  */
91
150
  export interface IXpertProject extends TXpertProject, IBasePerTenantAndOrganizationEntityModel {
151
+ /** @deprecated Projects are scoped by Organization and no longer bind runtime data to a Workspace. */
92
152
  workspaceId?: string;
93
153
  workspace?: IXpertWorkspace;
94
154
  ownerId: string;
@@ -97,6 +157,7 @@ export interface IXpertProject extends TXpertProject, IBasePerTenantAndOrganizat
97
157
  toolsets?: IXpertToolset[];
98
158
  knowledges?: IKnowledgebase[];
99
159
  members?: IUser[];
160
+ memberships?: IXpertProjectMembership[];
100
161
  /**
101
162
  * @deprecated Use project file volume / FileAsset workspace projection instead.
102
163
  */
@@ -107,6 +168,34 @@ export interface IXpertProject extends TXpertProject, IBasePerTenantAndOrganizat
107
168
  attachments?: IStorageFile[];
108
169
  vcs?: IXpertProjectVCS;
109
170
  }
171
+ export interface IXpertProjectMembership extends IBasePerTenantAndOrganizationEntityModel {
172
+ projectId: string;
173
+ project?: IXpertProject;
174
+ userId: string;
175
+ user?: IUser;
176
+ role: TXpertProjectMemberRole;
177
+ invitedById?: string;
178
+ invitedBy?: IUser;
179
+ joinedAt: Date;
180
+ removedAt?: Date;
181
+ }
182
+ export interface IXpertProjectInvitation extends IBasePerTenantAndOrganizationEntityModel {
183
+ projectId: string;
184
+ project?: IXpertProject;
185
+ email: string;
186
+ normalizedEmail: string;
187
+ targetUserId?: string;
188
+ targetUser?: IUser;
189
+ role: TXpertProjectMemberRole;
190
+ status: TXpertProjectInvitationStatus;
191
+ expiresAt: Date;
192
+ invitedById: string;
193
+ invitedBy?: IUser;
194
+ acceptedById?: string;
195
+ acceptedBy?: IUser;
196
+ acceptedAt?: Date;
197
+ lastSentAt: Date;
198
+ }
110
199
  export type IXpertProjectCreateInput = Partial<IXpertProject> & {
111
200
  xpertIds?: string[];
112
201
  toolsetIds?: string[];
@@ -127,7 +216,7 @@ export interface IXpertProjectTask extends IBasePerXpertProjectEntityModel {
127
216
  priority?: TXpertProjectTaskPriority;
128
217
  assigneeId?: string;
129
218
  assignee?: IUser;
130
- /** Project Assistant responsible for executing this task. */
219
+ /** Project Xpert responsible for executing this task. */
131
220
  assigneeXpertId?: string;
132
221
  dueDate?: Date;
133
222
  planId?: string;
@@ -4,6 +4,8 @@ import type { TXpertChatState } from '@xpert-ai/chatkit-types';
4
4
  import { IChatConversation } from './chat.model';
5
5
  import { JsonSchemaObjectType } from './types';
6
6
  import { IXpert } from './xpert.model';
7
+ import { IXpertProject } from './xpert-project.model';
8
+ import { IUser } from '../user.model';
7
9
  export declare const XPERT_TASK_SCHEDULE_PROPERTY_PREFIX = "xpert_task_";
8
10
  export declare const XPERT_TASK_SCHEDULE_IDEMPOTENCY_KEY = "__idempotency_key";
9
11
  export type TXpertTaskScheduleCapabilities = {
@@ -31,10 +33,24 @@ export type XpertTaskType = {
31
33
  timeZone?: string;
32
34
  prompt?: string;
33
35
  status?: ScheduleTaskStatus;
36
+ /** User-visible reason explaining why a scheduled task was paused. */
37
+ statusReason?: string | null;
34
38
  runtimeState?: TXpertChatState | null;
35
39
  xpert?: IXpert;
36
40
  xpertId?: string;
37
41
  agentKey?: string;
42
+ project?: IXpertProject;
43
+ projectId?: string;
44
+ /** Human identity whose permissions and personal Connector accounts are used at execution time. */
45
+ runAsUser?: IUser;
46
+ runAsUserId?: string;
47
+ /** Pending replacement identity; it becomes active only after this user accepts. */
48
+ pendingRunAsUserId?: string | null;
49
+ /** User who initiated the pending run-as transfer. */
50
+ pendingRunAsRequestedById?: string | null;
51
+ pendingRunAsRequestedAt?: Date | null;
52
+ /** Snapshot of the Xpert and Connector selection that the proposed run-as user is confirming. */
53
+ pendingRunAsConfigurationHash?: string | null;
38
54
  conversations?: IChatConversation[];
39
55
  job?: any;
40
56
  scheduleDescription?: string;
@@ -4,7 +4,7 @@ import { TCopilotModel } from './copilot-model.model';
4
4
  import { MCPServerType, TMCPServer } from './xpert-tool-mcp.model';
5
5
  import { XpertTypeEnum } from './xpert.model';
6
6
  import type { TPromptWorkflow } from './prompt-workflow.model';
7
- import { PluginTargetApp, PluginTargetAppMeta, XpertTemplatePluginDependencies } from '../plugin';
7
+ import { PluginTargetApp, PluginTargetAppMeta, PluginTemplateApplicationSummary, XpertTemplatePluginDependencies } from '../plugin';
8
8
  export interface IXpertTemplate extends IBasePerTenantEntityModel {
9
9
  key: string;
10
10
  name?: string;
@@ -96,6 +96,8 @@ export type TTemplate = {
96
96
  releaseNotes?: string;
97
97
  xpertName?: string;
98
98
  dependencies?: XpertTemplatePluginDependencies;
99
+ /** Trusted plugin App explicitly linked to this Assistant template. */
100
+ application?: PluginTemplateApplicationSummary;
99
101
  };
100
102
  export type TXpertTemplate = TTemplate & {
101
103
  avatar: TAvatar;
@@ -23,12 +23,19 @@ export type TXpertWorkspaceSettings = {
23
23
  visibility?: TXpertWorkspaceVisibility;
24
24
  };
25
25
  system?: {
26
- kind?: 'org-default' | 'tenant-default' | 'user-default';
26
+ kind?: 'org-default' | 'tenant-default' | 'user-default' | 'plugin-app';
27
27
  userId?: string;
28
+ pluginName?: string;
29
+ appName?: string;
28
30
  };
29
31
  };
30
32
  export type TXpertWorkspaceStatus = 'active' | 'deprecated' | 'archived';
31
- export type TXpertWorkspaceVisibility = 'private' | 'tenant-shared';
33
+ /**
34
+ * Authoring visibility of a workspace.
35
+ * `organization-shared` grants current organization members access without
36
+ * materializing a membership row for every existing or future member.
37
+ */
38
+ export type TXpertWorkspaceVisibility = 'private' | 'tenant-shared' | 'organization-shared';
32
39
  export type TXpertWorkspaceAccessPurpose = 'runtime' | 'authoring';
33
40
  export type TXpertWorkspaceCapabilities = {
34
41
  canRead: boolean;
@@ -36,8 +43,14 @@ export type TXpertWorkspaceCapabilities = {
36
43
  canWrite: boolean;
37
44
  canManage: boolean;
38
45
  };
46
+ /** Normalizes missing or unknown persisted values to the secure `private` default. */
39
47
  export declare function getXpertWorkspaceVisibility(workspace?: Pick<IXpertWorkspace, 'settings'> | null): TXpertWorkspaceVisibility;
40
48
  export declare function isTenantSharedXpertWorkspace(workspace?: Pick<IXpertWorkspace, 'settings'> | null): boolean;
49
+ /**
50
+ * Returns whether an organization workspace is intentionally shared with all
51
+ * current organization members instead of an explicit member list.
52
+ */
53
+ export declare function isOrganizationSharedXpertWorkspace(workspace?: Pick<IXpertWorkspace, 'settings'> | null): boolean;
41
54
  export interface IBasePerWorkspaceEntityModel extends IBasePerTenantAndOrganizationEntityModel {
42
55
  workspaceId?: string;
43
56
  workspace?: IXpertWorkspace;
@@ -135,6 +135,11 @@ export type TXpert = {
135
135
  * Expert description
136
136
  */
137
137
  description?: string;
138
+ /**
139
+ * Ownership of non-Project runtime files. This is selected when the Xpert is
140
+ * created and is immutable afterwards. Missing legacy values mean `shared`.
141
+ */
142
+ workspaceDataScope?: XpertWorkspaceDataScope;
138
143
  /**
139
144
  * Is active
140
145
  */
@@ -224,11 +229,13 @@ export type TXpert = {
224
229
  integrations?: IIntegration[];
225
230
  tags?: ITag[];
226
231
  };
232
+ export type XpertWorkspaceDataScope = 'shared' | 'user';
233
+ export declare const DEFAULT_XPERT_WORKSPACE_DATA_SCOPE: XpertWorkspaceDataScope;
227
234
  /**
228
235
  * Digital Expert
229
236
  */
230
237
  export interface IXpert extends IBasePerWorkspaceEntityModel, TXpert {
231
- environmentId?: string;
238
+ environmentId?: string | null;
232
239
  environment?: IEnvironment;
233
240
  /**
234
241
  * When type is 'knowledge', it must binding a knowledgebase
@@ -245,6 +252,7 @@ export interface IXpertPrincipalReference {
245
252
  }
246
253
  export declare enum XpertWorkbenchInitialLayoutEnum {
247
254
  TwoColumns = "two-columns",
255
+ OverlayDialog = "overlay-dialog",
248
256
  ChatkitMaximized = "chatkit-maximized",
249
257
  WorkbenchMaximized = "workbench-maximized"
250
258
  }
@@ -285,6 +293,11 @@ export type TXpertDataXpertOptions = {
285
293
  [key: string]: unknown;
286
294
  };
287
295
  export type TXpertOptions = {
296
+ /** Runtime-selectable Primary Agent models. The configured Primary model is added automatically. */
297
+ modelSelection?: {
298
+ /** Additional LLM models users may select. */
299
+ allowedModels: TCopilotModel[];
300
+ };
288
301
  /** Declares how an Assistant resolves the workspace used by files and Agent runs. */
289
302
  workspaceScope?: {
290
303
  /** Require an explicit Project, or prefer one while preserving the legacy fallback. */
@@ -473,6 +486,7 @@ export declare enum XpertParameterTypeEnum {
473
486
  ARRAY = "array[object]",
474
487
  ARRAY_FILE = "array[file]",
475
488
  ARRAY_DOCUMENT = "array[document]",
489
+ ARRAY_MESSAGE = "array[message]",
476
490
  BOOLEAN = "boolean",
477
491
  SECRET = "secret"
478
492
  }
@@ -629,6 +643,14 @@ export type TChatOptions = {
629
643
  * Per-request runtime context forwarded to agent middleware/tools.
630
644
  */
631
645
  context?: Record<string, unknown>;
646
+ /** Resolved runtime override for the Assistant Primary Agent only. */
647
+ primaryCopilotModel?: TCopilotModel;
648
+ /** Opaque Assistant model option id recorded for audit and retry. */
649
+ primaryModelId?: string;
650
+ /** Published Primary Agent key to which the override is restricted. */
651
+ primaryAgentKey?: string;
652
+ /** How the effective Primary Agent model was selected. */
653
+ primaryModelSource?: import('./assistant-model.model').TAssistantPrimaryModelSelectionSource;
632
654
  };
633
655
  export type TChatRuntimePrincipal = {
634
656
  type: 'assistant';
@@ -2,7 +2,7 @@ import { IPoint } from '../types';
2
2
  import { IXpertAgent } from './xpert-agent.model';
3
3
  import { IXpert, TXpertGraph, TXpertTeamConnection, TXpertTeamDraft, TXpertTeamNode } from './xpert.model';
4
4
  export declare function omitXpertRelations(xpert: Partial<IXpert>): {
5
- environmentId?: string;
5
+ environmentId?: string | null;
6
6
  workspaceId?: string;
7
7
  workspace?: import("./xpert-workspace.model").IXpertWorkspace;
8
8
  publishAt?: Date;
@@ -24,6 +24,7 @@ export declare function omitXpertRelations(xpert: Partial<IXpert>): {
24
24
  title?: string;
25
25
  titleCN?: string;
26
26
  description?: string;
27
+ workspaceDataScope?: import("./xpert.model").XpertWorkspaceDataScope;
27
28
  active?: boolean;
28
29
  avatar?: import("../types").TAvatar;
29
30
  starters?: string[];
@@ -35,7 +35,7 @@ export interface IArtifactWorkspaceFileReference {
35
35
  workspacePath: string;
36
36
  tenantId?: string | null;
37
37
  userId?: string | null;
38
- catalog?: 'projects' | 'users' | 'knowledges' | 'skills' | 'xperts' | null;
38
+ catalog?: 'projects' | 'users' | 'knowledges' | 'skills' | 'xperts' | 'user-xperts' | null;
39
39
  scopeId?: string | null;
40
40
  projectId?: string | null;
41
41
  knowledgeId?: string | null;
@@ -2,7 +2,7 @@ import { IStorageFile } from './storage-file.model';
2
2
  export type FileAssetStatus = 'success' | 'partial_success' | 'failed';
3
3
  export type FileAssetDestinationKind = 'storage' | 'volume' | 'sandbox';
4
4
  export type FileAssetSourceKind = 'multipart' | 'storage_file' | 'local_file' | 'buffer';
5
- export type FileUploadVolumeCatalog = 'projects' | 'users' | 'knowledges' | 'skills' | 'xperts';
5
+ export type FileUploadVolumeCatalog = 'projects' | 'users' | 'knowledges' | 'skills' | 'xperts' | 'user-xperts';
6
6
  export type FileUploadSandboxMode = 'mounted_workspace' | 'backend_upload';
7
7
  export interface IFileAssetSource {
8
8
  kind: FileAssetSourceKind;
@@ -62,6 +62,10 @@ export interface IUploadFileSandboxTarget {
62
62
  strategy?: string;
63
63
  mode: FileUploadSandboxMode;
64
64
  workspacePath?: string;
65
+ /** Trusted server-side boundary for mounted workspace writes. */
66
+ workspaceBoundaryPath?: string;
67
+ /** Prevent generic uploads from mutating Project-authored instructions and skills. */
68
+ projectContentReadOnly?: boolean;
65
69
  workspaceUrl?: string;
66
70
  workspaceId?: string;
67
71
  sandboxUrl?: string;
@@ -55,6 +55,7 @@ export interface IOrganization extends IBasePerTenantEntityModel {
55
55
  employees?: IEmployee[];
56
56
  invitesAllowed?: boolean;
57
57
  inviteExpiryPeriod?: number;
58
+ sidebarExpandedByDefault?: boolean;
58
59
  tags: ITag[];
59
60
  futureDateAllowed?: boolean;
60
61
  allowManualTime?: boolean;
@@ -124,6 +125,7 @@ export interface IOrganizationCreateInput extends IContact {
124
125
  bonusPercentage?: number;
125
126
  invitesAllowed?: boolean;
126
127
  inviteExpiryPeriod?: number;
128
+ sidebarExpandedByDefault?: boolean;
127
129
  tags?: ITag[];
128
130
  tenant: ITenant;
129
131
  contact?: IContact;
@@ -152,6 +154,7 @@ export declare enum OrganizationSelectInput {
152
154
  createdAt = "createdAt",
153
155
  updatedAt = "updatedAt",
154
156
  isActive = "isActive",
157
+ sidebarExpandedByDefault = "sidebarExpandedByDefault",
155
158
  tags = "tags"
156
159
  }
157
160
  export declare enum RegionsEnum {
package/src/plugin.d.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
2
+ import type { AiModelTypeEnum } from './agent';
2
3
  import { JsonSchemaObjectType } from './ai/types';
3
- import type { IXpert } from './ai/xpert.model';
4
+ import type { IXpert, XpertWorkspaceDataScope } from './ai/xpert.model';
4
5
  import type { TMcpStdioRuntimePolicy } from './ai/xpert-tool-mcp.model';
6
+ import type { IMcpApiKey } from './ai/mcp-auth.model';
7
+ import type { IMcpPublication, McpPublicationStatus } from './ai/mcp-publication.model';
5
8
  import type { JSONValue } from './core.model';
6
9
  import type { IPluginRuntimeConvergence, IRuntimePluginRequirement } from './runtime-control';
7
10
  import { IconDefinition, I18nObject } from './types';
@@ -88,6 +91,199 @@ export type PluginTargetApp = 'xpert' | 'data-xpert' | (string & {});
88
91
  export type PluginSdkCompatibilityWarningCode = 'plugin-sdk-peer-dependency-missing' | 'plugin-sdk-peer-range-invalid' | 'plugin-sdk-peer-range-incompatible' | 'plugin-sdk-peer-range-spans-major';
89
92
  export type PluginMarketplaceContributionType = 'app' | 'view' | 'feature' | 'skill' | 'tool' | 'mcp' | 'hook' | 'assistant-template' | (string & {});
90
93
  export type PluginMarketplaceOperationAccess = 'read' | 'write' | 'admin' | (string & {});
94
+ /** Stable placement scopes declared by plugin application contributions. */
95
+ export declare const PLUGIN_APPLICATION_SCOPE: {
96
+ readonly TENANT: "tenant";
97
+ readonly ORGANIZATION: "organization";
98
+ readonly PERSONAL: "personal";
99
+ };
100
+ /**
101
+ * Lifecycle states persisted for a governed plugin application installation.
102
+ * `degraded` means the installation record exists but one or more managed
103
+ * resources failed the host health check.
104
+ */
105
+ export declare const PLUGIN_APPLICATION_INSTALLATION_STATUS: {
106
+ readonly INITIALIZING: "initializing";
107
+ readonly READY: "ready";
108
+ readonly FAILED: "failed";
109
+ readonly DEGRADED: "degraded";
110
+ };
111
+ /**
112
+ * Scope declared by a trusted plugin application contribution.
113
+ *
114
+ * The current host initializer supports `organization`; the other values are
115
+ * stable contract values for discovery and UI gating until their installers
116
+ * are implemented.
117
+ */
118
+ export type PluginApplicationScope = (typeof PLUGIN_APPLICATION_SCOPE)[keyof typeof PLUGIN_APPLICATION_SCOPE];
119
+ export type PluginApplicationInstallationStatus = (typeof PLUGIN_APPLICATION_INSTALLATION_STATUS)[keyof typeof PLUGIN_APPLICATION_INSTALLATION_STATUS];
120
+ /** Product capability rendered on a plugin application's marketplace detail page. */
121
+ export interface PluginMarketplaceAppFeature {
122
+ key: string;
123
+ title: string | I18nObject;
124
+ description?: string | I18nObject;
125
+ icon?: IconDefinition;
126
+ }
127
+ /**
128
+ * Knowledge base resource that the host creates as part of an organization
129
+ * application installation. The plugin declares intent; the host supplies all
130
+ * tenant, organization, workspace, and actor scope.
131
+ */
132
+ export interface PluginMarketplaceAppKnowledgebaseConfig {
133
+ key: string;
134
+ name: string | I18nObject;
135
+ description?: string | I18nObject;
136
+ permission: 'organization';
137
+ applicationTags?: string[];
138
+ graphRag?: {
139
+ enabled: boolean;
140
+ };
141
+ }
142
+ /** Model capabilities required before the host may initialize an application. */
143
+ export interface PluginMarketplaceAppModelRequirements {
144
+ primary?: boolean;
145
+ embedding?: boolean;
146
+ vision?: boolean;
147
+ embeddingLabel?: string | I18nObject;
148
+ visionLabel?: string | I18nObject;
149
+ }
150
+ /**
151
+ * Declarative, host-owned initialization contract for a trusted plugin App.
152
+ * The host only executes this contract from a loaded plugin contribution.
153
+ */
154
+ export interface PluginMarketplaceAppConfig {
155
+ scope: PluginApplicationScope;
156
+ assistantTemplateKey: string;
157
+ workspace: {
158
+ mode: 'dedicated';
159
+ name: string | I18nObject;
160
+ description?: string | I18nObject;
161
+ sharing: 'organization';
162
+ };
163
+ knowledgebases?: PluginMarketplaceAppKnowledgebaseConfig[];
164
+ modelRequirements?: PluginMarketplaceAppModelRequirements;
165
+ presentation?: {
166
+ tagline?: string | I18nObject;
167
+ longDescription?: string | I18nObject;
168
+ developer?: string;
169
+ screenshots?: string[];
170
+ features?: PluginMarketplaceAppFeature[];
171
+ useCases?: Array<string | I18nObject>;
172
+ dataScope?: string | I18nObject;
173
+ initializationSummary?: string | I18nObject;
174
+ initializationSteps?: Array<string | I18nObject>;
175
+ };
176
+ entry?: {
177
+ type: 'assistant-chat';
178
+ };
179
+ }
180
+ /**
181
+ * Trusted application metadata attached to an Assistant template after the
182
+ * host resolves an explicit `assistantTemplateKey` link from a loaded plugin.
183
+ */
184
+ export interface PluginTemplateApplicationSummary {
185
+ id: string;
186
+ pluginName: string;
187
+ appName: string;
188
+ displayName: string | I18nObject;
189
+ description?: string | I18nObject;
190
+ icon?: IconDefinition;
191
+ color?: string;
192
+ scope: PluginApplicationScope;
193
+ assistantTemplateKey: string;
194
+ config: PluginMarketplaceAppConfig;
195
+ }
196
+ /**
197
+ * Persisted control-plane record for one plugin application in one declared
198
+ * scope. Managed resource identifiers are retained so health checks and
199
+ * retries never need to rediscover resources by display name.
200
+ */
201
+ export interface IPluginApplicationInstallation extends IBasePerTenantAndOrganizationEntityModel {
202
+ pluginName: string;
203
+ appName: string;
204
+ declaredScope: PluginApplicationScope;
205
+ scopeKey: string;
206
+ status: PluginApplicationInstallationStatus;
207
+ pluginVersion?: string | null;
208
+ templateId?: string | null;
209
+ templateVersion?: string | null;
210
+ operationId?: string | null;
211
+ workspaceId?: string | null;
212
+ xpertId?: string | null;
213
+ knowledgebaseIds?: string[] | null;
214
+ resourceRefs?: Record<string, string> | null;
215
+ errorCode?: string | null;
216
+ errorMessage?: string | null;
217
+ }
218
+ /** Host-authorized model choice returned by application initialization preflight. */
219
+ export interface PluginApplicationModelOption {
220
+ id: string;
221
+ copilotId: string;
222
+ model: string;
223
+ label: string | I18nObject;
224
+ modelType: AiModelTypeEnum;
225
+ }
226
+ /** Read model used by marketplace cards to render installation health and actions. */
227
+ export interface PluginApplicationStatusSummary {
228
+ appId: string;
229
+ status: PluginApplicationInstallationStatus | 'not_installed';
230
+ initializationAccess?: 'allowed' | 'organization_required' | 'role_required' | 'unsupported';
231
+ installationId?: string;
232
+ workspaceId?: string | null;
233
+ xpertId?: string | null;
234
+ assistantSlug?: string | null;
235
+ errorCode?: string | null;
236
+ errorMessage?: string | null;
237
+ }
238
+ /** Marketplace metadata paired with a trusted plugin App contribution. */
239
+ export interface PluginApplicationCatalogMetadata {
240
+ category?: PluginMarketplaceCategory;
241
+ subcategory?: string;
242
+ featured?: boolean;
243
+ tags: string[];
244
+ updatedAt?: string;
245
+ }
246
+ /** Card-sized App definition and scoped runtime status for marketplace discovery. */
247
+ export interface PluginApplicationCatalogItem {
248
+ application: PluginTemplateApplicationSummary;
249
+ status: PluginApplicationStatusSummary;
250
+ marketplace: PluginApplicationCatalogMetadata;
251
+ }
252
+ /**
253
+ * Server-computed initialization readiness. Clients may select only model IDs
254
+ * returned here and cannot provide tenant, organization, or workspace scope.
255
+ */
256
+ export interface PluginApplicationPreflight {
257
+ supported: boolean;
258
+ scope: PluginApplicationScope;
259
+ canInitialize: boolean;
260
+ reason?: 'organization_scope_required' | 'role_required' | 'scope_not_supported' | 'primary_model_required' | 'embedding_model_required' | 'vision_model_required';
261
+ embeddingModels: PluginApplicationModelOption[];
262
+ visionModels: PluginApplicationModelOption[];
263
+ /** Organization Embedding-role default when it is present in embeddingModels. */
264
+ defaultEmbeddingModelId?: string | null;
265
+ /** Organization Primary-role default when it is vision-capable and present in visionModels. */
266
+ defaultVisionModelId?: string | null;
267
+ primaryModelAvailable: boolean;
268
+ modelRequirements: PluginMarketplaceAppModelRequirements;
269
+ }
270
+ /** Complete application detail assembled from trusted plugin metadata and scoped runtime state. */
271
+ export interface PluginApplicationDetail {
272
+ application: PluginTemplateApplicationSummary;
273
+ status: PluginApplicationStatusSummary;
274
+ preflight: PluginApplicationPreflight;
275
+ }
276
+ /**
277
+ * User-selectable portion of an initialization request. Scope and target
278
+ * resources are intentionally absent and are derived from RequestContext.
279
+ */
280
+ export interface PluginApplicationInitializeInput {
281
+ pluginName: string;
282
+ appName: string;
283
+ embeddingModelId?: string;
284
+ visionModelId?: string;
285
+ operationId: string;
286
+ }
91
287
  export interface PluginMarketplaceOperation {
92
288
  name: string;
93
289
  displayName?: string | I18nObject;
@@ -242,6 +438,8 @@ export interface PluginMarketplaceContribution {
242
438
  operations?: PluginMarketplaceOperation[];
243
439
  tags?: string[];
244
440
  metadata?: Record<string, unknown>;
441
+ /** Valid only when `type` is `app`. */
442
+ appConfig?: PluginMarketplaceAppConfig;
245
443
  }
246
444
  export interface PluginMarketplaceTrialShortcut {
247
445
  id?: string;
@@ -622,6 +820,43 @@ export interface IPluginResourceComponentState {
622
820
  runtimeId?: string | null;
623
821
  status?: PluginResourceInstallationStatus | null;
624
822
  installation?: IPluginResourceInstallation | null;
823
+ mcpServer?: IPluginMcpServerState | null;
824
+ }
825
+ export interface IPluginMcpServerState {
826
+ publicationId?: string | null;
827
+ /** Publication ownership follows the contributing plugin level. */
828
+ publicationScope?: 'tenant' | 'organization' | null;
829
+ /** Organization admission state for a tenant-scoped Publication. */
830
+ accessEnabled?: boolean | null;
831
+ status?: McpPublicationStatus | null;
832
+ endpoint?: string | null;
833
+ protocolVersion?: string | null;
834
+ transport?: 'streamable-http' | null;
835
+ apiKeyCount?: number;
836
+ syncError?: string | null;
837
+ syncFailedAt?: string | null;
838
+ }
839
+ export interface IPluginMcpServerConnectionInfo {
840
+ protocolVersion: string;
841
+ transport: 'streamable-http';
842
+ endpoint: string;
843
+ authorization: 'Bearer';
844
+ serverInstructions?: string;
845
+ }
846
+ export interface IPluginMcpServerActivationResult {
847
+ installation: IPluginResourceInstallation;
848
+ publication: IMcpPublication;
849
+ connectionInfo: IPluginMcpServerConnectionInfo;
850
+ createdApiKey?: {
851
+ apiKey: Omit<IMcpApiKey, 'keyHash'>;
852
+ secret: string;
853
+ };
854
+ }
855
+ /** A retrievable MCP client credential scoped to the requesting administrator and organization. */
856
+ export interface IPluginMcpServerCredentialResult {
857
+ connectionInfo: IPluginMcpServerConnectionInfo;
858
+ apiKey: Omit<IMcpApiKey, 'keyHash'>;
859
+ secret: string;
625
860
  }
626
861
  export interface PluginResourceComponentSelector {
627
862
  componentType?: PluginComponentType;
@@ -672,5 +907,6 @@ export interface XpertTemplateInstallInput {
672
907
  description?: string;
673
908
  avatar?: JSONValue | null;
674
909
  copilotModel?: JSONValue | null;
910
+ workspaceDataScope?: XpertWorkspaceDataScope;
675
911
  };
676
912
  }