@xpert-ai/contracts 3.18.6 → 3.20.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 (69) hide show
  1. package/index.cjs.js +1390 -222
  2. package/index.esm.js +1317 -223
  3. package/package.json +6 -3
  4. package/src/agent/ai-model.d.ts +1 -0
  5. package/src/agent/token.d.ts +4 -0
  6. package/src/agent-plugin.d.ts +192 -0
  7. package/src/ai/agent-output-delivery.model.d.ts +31 -0
  8. package/src/ai/agent-runtime.model.d.ts +53 -0
  9. package/src/ai/ai-model.model.d.ts +3 -0
  10. package/src/ai/assistant-binding.model.d.ts +3 -0
  11. package/src/ai/assistant-configuration.model.d.ts +76 -0
  12. package/src/ai/assistant-order.d.ts +5 -0
  13. package/src/ai/assistant-trigger.model.d.ts +56 -0
  14. package/src/ai/bosi.model.d.ts +73 -0
  15. package/src/ai/chat-activity.model.d.ts +14 -0
  16. package/src/ai/chat-message-envelope.model.d.ts +55 -0
  17. package/src/ai/chat-message.model.d.ts +14 -1
  18. package/src/ai/chat-task-summary.model.d.ts +4 -3
  19. package/src/ai/chat.model.d.ts +110 -13
  20. package/src/ai/clawxpert-conversation-scope.model.d.ts +2 -0
  21. package/src/ai/evolution/baseline.d.ts +40 -0
  22. package/src/ai/evolution/change.d.ts +53 -0
  23. package/src/ai/evolution/index.d.ts +1 -0
  24. package/src/ai/evolution/persistence.d.ts +2 -0
  25. package/src/ai/evolution/provider.d.ts +1 -1
  26. package/src/ai/execution-activity.model.d.ts +547 -0
  27. package/src/ai/index.d.ts +17 -0
  28. package/src/ai/knowledge-keyword-analyzer.model.d.ts +18 -0
  29. package/src/ai/knowledgebase.model.d.ts +5 -0
  30. package/src/ai/mcp-capability.model.d.ts +5 -1
  31. package/src/ai/mcp-publication.model.d.ts +1 -1
  32. package/src/ai/membership.model.d.ts +5 -0
  33. package/src/ai/middleware.model.d.ts +1 -0
  34. package/src/ai/mobile.model.d.ts +5 -0
  35. package/src/ai/model-execution.model.d.ts +265 -0
  36. package/src/ai/model-gateway.model.d.ts +15 -3
  37. package/src/ai/model-usage.model.d.ts +19 -0
  38. package/src/ai/project-selection.model.d.ts +9 -0
  39. package/src/ai/project-task-graph.model.d.ts +70 -0
  40. package/src/ai/project-task-runtime.model.d.ts +1106 -0
  41. package/src/ai/project-task-schedule.d.ts +24 -0
  42. package/src/ai/project-task-type.model.d.ts +13 -0
  43. package/src/ai/prompt-workflow-capabilities.model.d.ts +15 -0
  44. package/src/ai/prompt-workflow.model.d.ts +17 -0
  45. package/src/ai/realtime-voice.model.d.ts +90 -0
  46. package/src/ai/realtime-voice.transport.d.ts +54 -0
  47. package/src/ai/resource-card.d.ts +2 -0
  48. package/src/ai/sandbox-file-output.model.d.ts +9 -0
  49. package/src/ai/thread-activity.model.d.ts +14 -0
  50. package/src/ai/xpert-agent-execution.model.d.ts +37 -0
  51. package/src/ai/xpert-chat.model.d.ts +2 -0
  52. package/src/ai/xpert-marketplace.model.d.ts +5 -0
  53. package/src/ai/xpert-project-type.model.d.ts +56 -0
  54. package/src/ai/xpert-project.model.d.ts +46 -1
  55. package/src/ai/xpert-template.model.d.ts +48 -0
  56. package/src/ai/xpert-tool-mcp.model.d.ts +21 -1
  57. package/src/ai/xpert-workflow.model.d.ts +15 -1
  58. package/src/ai/xpert.model.d.ts +20 -1
  59. package/src/desktop-shell.model.d.ts +159 -0
  60. package/src/i18n.model.d.ts +1 -0
  61. package/src/index.d.ts +7 -0
  62. package/src/integration.model.d.ts +19 -0
  63. package/src/plugin.d.ts +26 -7
  64. package/src/tag-entity.model.d.ts +1 -1
  65. package/src/types.d.ts +4 -0
  66. package/src/view-extension/index.d.ts +2 -0
  67. package/src/view-extension/model.d.ts +41 -1
  68. package/src/view-extension/workbench-open.d.ts +10 -0
  69. package/src/view-extension/workbench.d.ts +6 -0
@@ -0,0 +1,24 @@
1
+ /** Minimal, browser-safe scheduling contract, independent of server or Agent contracts. */
2
+ export interface ProjectTaskScheduleNode {
3
+ id: string;
4
+ status: string;
5
+ kind: 'task' | 'summary' | 'milestone';
6
+ parentTaskId: string | null;
7
+ predecessorIds: string[];
8
+ plannedStartAt: string | null;
9
+ plannedEndAt: string | null;
10
+ estimatedDurationMs: number | null;
11
+ actualStartAt: string | null;
12
+ actualEndAt: string | null;
13
+ }
14
+ export interface ProjectTaskForecast {
15
+ taskId: string;
16
+ startAt: string | null;
17
+ endAt: string | null;
18
+ affected: boolean;
19
+ critical: boolean;
20
+ }
21
+ /** Tree containment and finish-to-start dependencies are separate acyclic graphs. */
22
+ export declare function validateProjectTaskGraph(tasks: readonly ProjectTaskScheduleNode[]): void;
23
+ /** Unknown estimates stay unknown. Summary rows never contribute another duration. */
24
+ export declare function forecastProjectTasks(tasks: readonly ProjectTaskScheduleNode[], changedId?: string): ProjectTaskForecast[];
@@ -0,0 +1,13 @@
1
+ import type { I18nObject } from '../i18n.model';
2
+ /** Portable presentation tokens. Clients render their own trusted icon components. */
3
+ export declare const PROJECT_TASK_ICON_NAMES: readonly ["FileText", "FileScan", "FileSearch", "ListChecks", "ListTree", "ShieldCheck", "FilePenLine", "Workflow", "Images", "FolderInput", "FileOutput"];
4
+ export type ProjectTaskIconName = (typeof PROJECT_TASK_ICON_NAMES)[number];
5
+ export interface ProjectTaskTypePresentation {
6
+ label: I18nObject;
7
+ icon: ProjectTaskIconName;
8
+ }
9
+ export interface ProjectTaskTypeDefinition {
10
+ /** Namespaced by the owning task provider, for example bid.tasks.illustration. */
11
+ key: string;
12
+ presentation: ProjectTaskTypePresentation;
13
+ }
@@ -0,0 +1,15 @@
1
+ import type { RuntimeCapabilitiesSelection } from '@xpert-ai/chatkit-types';
2
+ /** Expert node keys are local to their graph. Resolve this config before sending it to ChatKit. */
3
+ export type PromptWorkflowCapabilityConfig = {
4
+ type: 'expert_scoped_capabilities';
5
+ version: 1;
6
+ defaults?: RuntimeCapabilitiesSelection | null;
7
+ experts: Array<{
8
+ xpertId: string;
9
+ selection: RuntimeCapabilitiesSelection | null;
10
+ }>;
11
+ };
12
+ export declare function parsePromptCapabilitySelection(value: unknown): RuntimeCapabilitiesSelection | null;
13
+ export declare function isScopedPromptCapabilityConfig(value: unknown): boolean;
14
+ export declare function parsePromptCapabilityConfig(value: unknown): PromptWorkflowCapabilityConfig | null;
15
+ export declare function resolvePromptWorkflowCapabilities(value: unknown, xpertId?: string): unknown;
@@ -1,9 +1,15 @@
1
1
  import { IconDefinition } from '../types';
2
2
  import { IBasePerWorkspaceEntityModel } from './xpert-workspace.model';
3
3
  import { SkillSlashCommandAvailability } from './skill.model';
4
+ import { ITag } from '../tag-entity.model';
5
+ import type { ChatKitPromptScenario } from '@xpert-ai/chatkit-types';
6
+ export type PromptWorkflowScenario = ChatKitPromptScenario;
7
+ /** Boundary validation for persisted and API-provided scenario lists. */
8
+ export declare function isPromptWorkflowScenarios(value: unknown): value is PromptWorkflowScenario[];
4
9
  export type PromptWorkflowVisibility = 'private' | 'team' | 'tenant';
5
10
  export type PromptWorkflowSourceType = 'xpert' | 'workspace_prompt_workflow' | 'skill';
6
11
  export type PromptWorkflowCommandPriority = 'normal' | 'preferred';
12
+ export type PromptWorkflowActionType = 'insert_text' | 'insert_invocation' | 'submit_prompt';
7
13
  export type TPromptWorkflow = {
8
14
  name: string;
9
15
  label?: string;
@@ -13,13 +19,23 @@ export type TPromptWorkflow = {
13
19
  aliases?: string[];
14
20
  argsHint?: string;
15
21
  template: string;
22
+ /** insert_invocation inserts /name; insert_text expands the template; submit_prompt sends it. */
23
+ actionType?: PromptWorkflowActionType;
24
+ scenarios?: PromptWorkflowScenario[];
16
25
  tags?: string[];
17
26
  visibility?: PromptWorkflowVisibility;
18
27
  runtimeCapabilities?: unknown;
19
28
  archivedAt?: Date | string | null;
20
29
  };
21
30
  export interface IPromptWorkflow extends IBasePerWorkspaceEntityModel, TPromptWorkflow {
31
+ organizationTags?: ITag[];
32
+ /** Empty means every expert in this workspace. Stale IDs must not broaden the scope. */
33
+ associatedXpertIds?: string[] | null;
22
34
  }
35
+ export type PromptWorkflowInput = Partial<TPromptWorkflow> & {
36
+ organizationTagIds?: string[];
37
+ associatedXpertIds?: string[];
38
+ };
23
39
  export type TPromptWorkflowCommandSnapshot = TPromptWorkflow & {
24
40
  workflowId?: string;
25
41
  workspaceId?: string;
@@ -41,6 +57,7 @@ export type TXpertCommandProfileEntry = {
41
57
  aliases?: string[];
42
58
  argsHint?: string;
43
59
  template?: string;
60
+ actionType?: PromptWorkflowActionType;
44
61
  runtimeCapabilities?: unknown;
45
62
  availability?: SkillSlashCommandAvailability;
46
63
  };
@@ -0,0 +1,90 @@
1
+ import type { TCopilotModel } from './copilot-model.model';
2
+ import type { VoiceTaskStatus } from './realtime-voice.transport';
3
+ /** Realtime is a separate model capability, not the Assistant's reasoning model. */
4
+ export interface RealtimeVoiceFeature {
5
+ enabled: boolean;
6
+ copilotModel?: TCopilotModel;
7
+ voice?: string;
8
+ }
9
+ export interface RealtimeVoiceSelection {
10
+ modelId: string;
11
+ voice: string;
12
+ }
13
+ export interface RealtimeModelMetadata {
14
+ voices: {
15
+ id: string;
16
+ label: string;
17
+ }[];
18
+ defaultVoice: string;
19
+ notification: 'text' | 'next-turn';
20
+ }
21
+ export interface RealtimeModelOption extends RealtimeModelMetadata {
22
+ id: string;
23
+ label: string;
24
+ copilotModel: TCopilotModel;
25
+ }
26
+ export interface RealtimeToolCall {
27
+ id: string;
28
+ name: string;
29
+ arguments: string;
30
+ }
31
+ export interface RealtimeToolResult {
32
+ id: string;
33
+ output: string;
34
+ }
35
+ /** Latest authoritative task state, separate from historical tool response messages. */
36
+ export interface RealtimeTaskContext {
37
+ taskHandle: string;
38
+ status: VoiceTaskStatus;
39
+ result?: string;
40
+ }
41
+ export interface RealtimeUsage {
42
+ responseId: string;
43
+ inputText?: number;
44
+ inputAudio?: number;
45
+ outputText?: number;
46
+ outputAudio?: number;
47
+ cachedInputText?: number;
48
+ cachedInputAudio?: number;
49
+ }
50
+ /** Server-side diagnostics only; never include provider messages, headers or request bodies. */
51
+ export interface RealtimeProviderDiagnostic {
52
+ providerCode?: string;
53
+ providerType?: string;
54
+ eventId?: string;
55
+ }
56
+ export type RealtimeModelEvent = {
57
+ type: 'ready';
58
+ } | {
59
+ type: 'speech.started';
60
+ } | {
61
+ type: 'transcript';
62
+ role: 'user' | 'assistant';
63
+ id: string;
64
+ text: string;
65
+ final: boolean;
66
+ } | {
67
+ type: 'audio';
68
+ responseId: string;
69
+ audio: Uint8Array;
70
+ } | {
71
+ type: 'response.started';
72
+ responseId: string;
73
+ } | {
74
+ type: 'response.done';
75
+ responseId: string;
76
+ } | {
77
+ type: 'tools';
78
+ calls: RealtimeToolCall[];
79
+ } | {
80
+ type: 'usage';
81
+ usage: RealtimeUsage;
82
+ } | {
83
+ type: 'error';
84
+ code: string;
85
+ recoverable?: boolean;
86
+ diagnostic?: RealtimeProviderDiagnostic;
87
+ } | {
88
+ type: 'closed';
89
+ };
90
+ export * from './realtime-voice.transport';
@@ -0,0 +1,54 @@
1
+ export type VoiceTaskStatus = 'queued' | 'running' | 'completed' | 'failed' | 'canceled' | 'waiting' | 'unknown';
2
+ export type { CallEndedContent, CompletedVoiceCall } from '@xpert-ai/chatkit-types';
3
+ export interface VoiceSessionTicket {
4
+ sessionId: string;
5
+ conversationId: string;
6
+ ticket: string;
7
+ path: string;
8
+ inputSampleRate: 16000;
9
+ outputSampleRate: 24000;
10
+ expiresAt: string;
11
+ }
12
+ export type VoiceClientControl = {
13
+ type: 'mute';
14
+ muted: boolean;
15
+ } | {
16
+ type: 'interrupt';
17
+ } | {
18
+ type: 'end';
19
+ } | {
20
+ type: 'ping';
21
+ } | {
22
+ type: 'playback.done';
23
+ responseId: string;
24
+ };
25
+ /** Raw audio travels in bounded binary frames; supplier events are never forwarded. */
26
+ export type VoiceServerControl = {
27
+ type: 'ready';
28
+ sessionId: string;
29
+ } | {
30
+ type: 'clear_audio';
31
+ } | {
32
+ type: 'response.started' | 'response.done';
33
+ responseId: string;
34
+ } | {
35
+ type: 'transcript';
36
+ role: 'user' | 'assistant';
37
+ id: string;
38
+ text: string;
39
+ final: boolean;
40
+ } | {
41
+ type: 'task';
42
+ action: 'send' | 'steer';
43
+ taskId: string;
44
+ status: VoiceTaskStatus;
45
+ text?: string;
46
+ } | {
47
+ type: 'error';
48
+ code: string;
49
+ message: string;
50
+ } | {
51
+ type: 'ended';
52
+ } | {
53
+ type: 'pong';
54
+ };
@@ -0,0 +1,2 @@
1
+ export { createResourceCardContent, isResourceCardContent, parseResourceCard, parseResourceCardContent, resourceCardId, upsertResourceCardContent } from '@xpert-ai/chatkit-types';
2
+ export type { ConversationResourceCard, ResourceCardContent, ResourceCardField, ResourceCardFile, ResourceCardFileReference, ResourceCardImage, ResourceCardOpenTarget, ResourceCardScalar, TMessageContentResourceCard } from '@xpert-ai/chatkit-types';
@@ -0,0 +1,9 @@
1
+ import type { ChatTaskSummaryOutputKind } from '@xpert-ai/chatkit-types';
2
+ /** Display and validation formats for explicitly presented files; never automatic delivery policy. */
3
+ export type SandboxFileOutputRule = {
4
+ extension: string;
5
+ kind: ChatTaskSummaryOutputKind;
6
+ mimeType: string;
7
+ format: 'docx' | 'xlsx' | 'pptx' | 'pdf' | 'json' | 'utf8' | 'png' | 'jpeg' | 'binary';
8
+ };
9
+ export declare const SANDBOX_FILE_OUTPUT_RULES: readonly SandboxFileOutputRule[];
@@ -0,0 +1,14 @@
1
+ import type { TMessageContentResourceCard } from './resource-card';
2
+ /** Complete durable discovery snapshot. Tokens are delivered only by the per-run stream. */
3
+ export interface ThreadActivitySnapshot {
4
+ version: 1;
5
+ threadId: string;
6
+ runs: Array<{
7
+ id: string;
8
+ status: string;
9
+ updatedAt: string;
10
+ createdAt: string;
11
+ messageRevision: string;
12
+ }>;
13
+ cards: TMessageContentResourceCard[];
14
+ }
@@ -5,6 +5,7 @@ import { IXpertAgent } from './xpert-agent.model';
5
5
  import { TSensitiveOperation } from './chat.model';
6
6
  import { WorkflowNodeTypeEnum } from './xpert-workflow.model';
7
7
  import type { IModelUsageDetails } from './model-usage.model';
8
+ import type { TAvatar } from '../types';
8
9
  export type TXpertExecution = {
9
10
  category?: TXpertTeamNodeType;
10
11
  type?: WorkflowNodeTypeEnum | string;
@@ -14,6 +15,8 @@ export type TXpertExecution = {
14
15
  status?: XpertAgentExecutionStatusEnum;
15
16
  error?: string;
16
17
  elapsedTime?: number;
18
+ /** Wall-clock end of the current execution attempt; cleared when execution resumes. */
19
+ completedAt?: Date | null;
17
20
  threadId?: string;
18
21
  checkpointNs?: string;
19
22
  checkpointId?: string;
@@ -96,6 +99,13 @@ export declare enum XpertAgentExecutionStatusEnum {
96
99
  INTERRUPTED = "interrupted"
97
100
  }
98
101
  export type TAgentExecutionMetadata = {
102
+ businessOutcome?: import('@xpert-ai/chatkit-types').TAgentExecutionOutcome;
103
+ /** Recorded by the invocation boundary; never inferred from agent names. */
104
+ invocationKind?: 'external_assistant' | 'sub_agent';
105
+ /** Tool call in the parent execution that started this run. Omit for workflow-driven runs. */
106
+ sourceToolCallId?: string;
107
+ assistantName?: string;
108
+ assistantAvatar?: TAvatar;
99
109
  /**
100
110
  * AI model provider
101
111
  */
@@ -129,5 +139,32 @@ export type TAgentExecutionMetadata = {
129
139
  handoffParentMessageId?: string;
130
140
  runtimePrincipalType?: string;
131
141
  runtimePrincipalXpertId?: string;
142
+ /** Root execution this run continued after a durable thread pause. */
143
+ resumedFromExecutionId?: string;
132
144
  [key: string]: unknown;
133
145
  };
146
+ /** Public execution summary shared by live events and conversation history. */
147
+ export type TChatAgentRunSummary = {
148
+ businessOutcome?: import('@xpert-ai/chatkit-types').TAgentExecutionOutcome;
149
+ /** Identifies the main reply and its total duration without inferring identity from agent names. */
150
+ isRoot?: boolean;
151
+ id: string;
152
+ parentId?: string;
153
+ type?: string;
154
+ category?: TXpertTeamNodeType;
155
+ agentKey?: string;
156
+ xpertId?: string;
157
+ xpertName?: string;
158
+ avatar?: TAvatar;
159
+ title?: string;
160
+ invocationKind?: TAgentExecutionMetadata['invocationKind'];
161
+ /** Matches the Tool component id within parentId; never match by tool name or provider. */
162
+ sourceToolCallId?: TAgentExecutionMetadata['sourceToolCallId'];
163
+ model?: string;
164
+ status?: string;
165
+ elapsedTime?: number;
166
+ inputs?: unknown;
167
+ error?: string;
168
+ createdAt?: string;
169
+ updatedAt?: string;
170
+ };
@@ -1,4 +1,5 @@
1
1
  import type { FollowUpBehavior, TChatRequestHuman as ChatKitRequestHuman, TXpertChatInterruptPatch, TXpertChatResumeDecision, TXpertChatResumeRequest, TXpertChatState, TXpertChatTarget } from '@xpert-ai/chatkit-types';
2
+ import type { ProjectSelection } from './project-selection.model';
2
3
  export type TXpertFollowUpMode = FollowUpBehavior;
3
4
  export type TXpertChatRequestHuman = ChatKitRequestHuman & {
4
5
  /** Opaque Assistant model option id for this run. */
@@ -12,6 +13,7 @@ export type TXpertChatSendRequest = {
12
13
  action: 'send';
13
14
  conversationId?: string;
14
15
  projectId?: string;
16
+ projectSelection?: ProjectSelection;
15
17
  environmentId?: string;
16
18
  sandboxEnvironmentId?: string;
17
19
  message: {
@@ -52,6 +52,7 @@ export interface IXpertAccessRequest extends IBasePerTenantAndOrganizationEntity
52
52
  }
53
53
  export type TXpertMarketplaceQuery = {
54
54
  search?: string | null;
55
+ businessAreaIds?: string[];
55
56
  businessCategories?: TXpertMarketplaceBusinessCategory[];
56
57
  capabilityTags?: string[];
57
58
  collaborationModes?: TXpertMarketplaceCollaborationMode[];
@@ -77,6 +78,10 @@ export type IXpertMarketplaceItem = {
77
78
  };
78
79
  export type IXpertMarketplaceListResponse = {
79
80
  items: IXpertMarketplaceItem[];
81
+ businessAreas?: {
82
+ id: string;
83
+ name: string;
84
+ }[];
80
85
  recommendedTemplates: TXpertTemplate[];
81
86
  total: number;
82
87
  reviewableCount: number;
@@ -0,0 +1,56 @@
1
+ import type { I18nObject, IconDefinition } from '../types';
2
+ /** Stable identity, independent of installation ids, labels and plugin versions. */
3
+ export interface XpertProjectTypeRef {
4
+ applicationKey: string;
5
+ projectTypeKey: string;
6
+ }
7
+ export declare const GENERAL_PROJECT_TYPE: XpertProjectTypeRef;
8
+ export interface XpertProjectTypeDefinition {
9
+ key: string;
10
+ title: string | I18nObject;
11
+ icon?: IconDefinition;
12
+ /** Entity types delegate creation and lifecycle to their registered provider. */
13
+ binding: {
14
+ kind: 'project';
15
+ } | {
16
+ kind: 'entity';
17
+ providerKey: string;
18
+ };
19
+ }
20
+ export interface XpertProjectTypeSummary extends XpertProjectTypeRef {
21
+ applicationTitle: string | I18nObject;
22
+ title: string | I18nObject;
23
+ icon?: IconDefinition;
24
+ binding: XpertProjectTypeDefinition['binding'];
25
+ available: boolean;
26
+ }
27
+ export interface XpertProjectClassification {
28
+ applicationKey?: string | null;
29
+ projectTypeKey?: string | null;
30
+ applicationInstallationId?: string | null;
31
+ /** Display-only snapshot survives plugin removal; never used for authorization. */
32
+ projectTypeSnapshot?: Pick<XpertProjectTypeSummary, 'applicationTitle' | 'title' | 'binding'> | null;
33
+ }
34
+ export interface XpertProjectListFilter {
35
+ search?: string;
36
+ applicationKey?: string;
37
+ projectTypeKey?: string;
38
+ unclassified?: boolean;
39
+ }
40
+ /** Resolved by the host and a trusted provider, never an arbitrary URL. */
41
+ export type XpertProjectEntry = {
42
+ kind: 'project';
43
+ projectId?: string;
44
+ projectType: XpertProjectTypeRef;
45
+ } | {
46
+ kind: 'assistant';
47
+ xpertId: string;
48
+ slug: string;
49
+ projectId?: string;
50
+ viewKey: string;
51
+ selectionId?: string;
52
+ };
53
+ export interface XpertProjectTypeCatalog {
54
+ items: XpertProjectTypeSummary[];
55
+ defaultProjectType?: XpertProjectTypeRef;
56
+ }
@@ -1,3 +1,5 @@
1
+ import type { AgentInvocationStatus } from './agent-runtime.model';
2
+ import type { ProjectTaskDecision, ProjectTaskExecutionPurpose, ProjectTaskSpecificationSnapshot } from './project-task-runtime.model';
1
3
  import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
2
4
  import { IPagination } from '../core.model';
3
5
  import { IIntegration } from '../integration.model';
@@ -9,11 +11,21 @@ import { IKnowledgebase } from './knowledgebase.model';
9
11
  import { IXpertToolset } from './xpert-toolset.model';
10
12
  import { IXpertWorkspace } from './xpert-workspace.model';
11
13
  import { IXpert, TXpertTeamDraft } from './xpert.model';
14
+ import type { XpertProjectClassification, XpertProjectTypeRef } from './xpert-project-type.model';
15
+ import type { ConversationResourceCard } from './resource-card';
12
16
  export type TXpertProjectSettings = {
13
17
  /** @deprecated Project instructions are stored in /project/<projectId>/project.md. */
14
18
  instruction?: string;
15
19
  mode?: '' | 'plan';
16
20
  managementMode?: TXpertProjectManagementMode;
21
+ /** Server-owned first-send provenance; the provisional name may be reconciled once by the business app. */
22
+ conversationBootstrap?: {
23
+ conversationId: string;
24
+ initialName: string;
25
+ nameResolved?: boolean;
26
+ resourceCards?: ConversationResourceCard[];
27
+ resourceCardMessageId?: string;
28
+ };
17
29
  /** @deprecated Project Xperts are peers and no default Project Assistant is selected. */
18
30
  projectAssistantId?: string;
19
31
  };
@@ -134,7 +146,7 @@ export declare enum XpertProjectAutomationRunStatusEnum {
134
146
  FAILED = "failed",
135
147
  CANCELLED = "cancelled"
136
148
  }
137
- export type TXpertProject = {
149
+ export type TXpertProject = XpertProjectClassification & {
138
150
  name: string;
139
151
  avatar?: TAvatar;
140
152
  description?: string;
@@ -197,6 +209,7 @@ export interface IXpertProjectInvitation extends IBasePerTenantAndOrganizationEn
197
209
  lastSentAt: Date;
198
210
  }
199
211
  export type IXpertProjectCreateInput = Partial<IXpertProject> & {
212
+ projectType?: XpertProjectTypeRef;
200
213
  xpertIds?: string[];
201
214
  toolsetIds?: string[];
202
215
  knowledgebaseIds?: string[];
@@ -207,10 +220,27 @@ export interface IBasePerXpertProjectEntityModel extends IBasePerTenantAndOrgani
207
220
  project?: IXpertProject;
208
221
  }
209
222
  export interface IXpertProjectTask extends IBasePerXpertProjectEntityModel {
223
+ decisions?: ProjectTaskDecision[];
224
+ /** Measured completion percentage (0–100); null/omitted means unknown. */
225
+ progress?: number | null;
226
+ providerKey?: string | null;
227
+ sourceKey?: string | null;
228
+ sourceRevision?: string | null;
229
+ revision?: number;
230
+ kind?: 'task' | 'summary' | 'milestone';
231
+ parentTaskId?: string | null;
232
+ predecessorIds?: string[];
233
+ plannedStartAt?: Date | null;
234
+ plannedEndAt?: Date | null;
235
+ estimatedDurationMs?: number | null;
236
+ diagnostic?: string | null;
210
237
  threadId?: string;
211
238
  name: string;
212
239
  title?: string;
213
240
  description?: string;
241
+ /** Explicit completion requirements, independent of reported step progress. */
242
+ requirements?: string[];
243
+ /** Business task type. Provider projections use their registered namespaced taskType key. */
214
244
  type?: string;
215
245
  status: TXpertProjectTaskStatus | 'pending' | 'completed' | 'failed';
216
246
  priority?: TXpertProjectTaskPriority;
@@ -238,6 +268,21 @@ export interface IXpertProjectTaskConversation extends IBasePerXpertProjectEntit
238
268
  sourceExecutionId?: string;
239
269
  }
240
270
  export interface IXpertProjectTaskExecution extends IBasePerXpertProjectEntityModel {
271
+ /** Runtime-owned attempt. Distinct from a native Agent execution ID. */
272
+ invocationId?: string | null;
273
+ invocationStatus?: AgentInvocationStatus | null;
274
+ dispatchRequestId?: string | null;
275
+ dispatchState?: 'pending' | 'submitted' | null;
276
+ specificationSnapshot?: ProjectTaskSpecificationSnapshot | null;
277
+ purpose?: ProjectTaskExecutionPurpose | null;
278
+ /** Observed runtime status, independent from the business task acceptance status. */
279
+ runtimeStartedAt?: string | null;
280
+ runtimeCompletedAt?: string | null;
281
+ /** Authorized Invocation presentation, not persisted task state. */
282
+ runtimeProvider?: string;
283
+ runtimeToolId?: string;
284
+ runtimeStatus?: 'running' | 'success' | 'error' | 'pending' | 'timeout' | 'interrupted' | 'unknown';
285
+ sourceKey?: string | null;
241
286
  taskId: string;
242
287
  conversationId?: string;
243
288
  threadId?: string;
@@ -1,6 +1,7 @@
1
1
  import { IBasePerTenantEntityModel } from '../base-entity.model';
2
2
  import { IconDefinition, TAvatar } from '../types';
3
3
  import { TCopilotModel } from './copilot-model.model';
4
+ import { ModelFeature } from './ai-model.model';
4
5
  import { MCPServerType, TMCPServer } from './xpert-tool-mcp.model';
5
6
  import { XpertTypeEnum } from './xpert.model';
6
7
  import type { TPromptWorkflow } from './prompt-workflow.model';
@@ -101,6 +102,12 @@ export type TTemplate = {
101
102
  contentHash?: string;
102
103
  xpertName?: string;
103
104
  dependencies?: XpertTemplatePluginDependencies;
105
+ /** Explicit capability requirements/options, implemented by registered providers. */
106
+ capabilities?: AssistantCapabilityDeclaration[];
107
+ /** Capabilities composed into this resolved template variant. */
108
+ enabledCapabilities?: string[];
109
+ /** Require an explicitly selected, authorized LLM even without capability constraints. */
110
+ requiresModelSelection?: boolean;
104
111
  /** Trusted plugin App explicitly linked to this Assistant template. */
105
112
  application?: PluginTemplateApplicationSummary;
106
113
  };
@@ -110,6 +117,47 @@ export type TXpertTemplate = TTemplate & {
110
117
  copilotModel?: Partial<TCopilotModel>;
111
118
  };
112
119
  export type TXpertTemplateSummary = Omit<TXpertTemplate, 'export_data'>;
120
+ /** Opt-in capabilities offered by the serving distribution for a template. */
121
+ export type XpertTemplateCapability = string;
122
+ export interface AssistantCapabilityDeclaration {
123
+ key: string;
124
+ /** Required capabilities cannot be disabled; optional capabilities default to off. */
125
+ required?: boolean;
126
+ }
127
+ /** Public model metadata for capability setup; never includes provider credentials or model configuration. */
128
+ export interface XpertTemplateModelOption {
129
+ /** Opaque selection key; clients must submit it unchanged rather than reconstructing it. */
130
+ id: string;
131
+ label: string;
132
+ /** Model reference for installation; setup responses only project copilotId, model and modelType. */
133
+ copilotModel: TCopilotModel;
134
+ /** Display grouping by provider, not a credential scope. Optional for older setup endpoints. */
135
+ provider?: {
136
+ id: string;
137
+ label: string;
138
+ };
139
+ /** Display name that distinguishes multiple configured connections for the same provider. */
140
+ connectionName?: string;
141
+ /** Declared model features for badges/recommendations; installation still validates compatibility. */
142
+ features?: ModelFeature[];
143
+ /** Context capacity in tokens, not usage; omitted when the provider does not declare it. */
144
+ contextWindow?: number;
145
+ }
146
+ export interface XpertTemplateSetup {
147
+ /** ID of a compatible organization default in `models`; absent if none qualifies. */
148
+ defaultModelId?: string;
149
+ realtimeModels?: import('./realtime-voice.model').RealtimeModelOption[];
150
+ requiresModel?: boolean;
151
+ optionalCapabilities: {
152
+ key: XpertTemplateCapability;
153
+ label: string;
154
+ description: string;
155
+ }[];
156
+ requiredModelFeatures: ModelFeature[];
157
+ models: XpertTemplateModelOption[];
158
+ canInstall: boolean;
159
+ reason?: string;
160
+ }
113
161
  export interface TXpertTemplateCatalogQuery {
114
162
  search?: string;
115
163
  category?: string;
@@ -56,9 +56,23 @@ export type TMCPServerReconnect = {
56
56
  */
57
57
  delayMs?: number;
58
58
  };
59
- export declare const MCP_CONSUMER_AUTH_TYPES: readonly ["none", "manual_header", "api_key", "oauth"];
59
+ /** Supported authentication modes for a host-consumed MCP server. */
60
+ export declare const MCP_CONSUMER_AUTH_TYPES: readonly ["none", "manual_header", "api_key", "oauth", "connector"];
61
+ /** Discriminator for MCP consumer authentication configuration. */
60
62
  export type McpConsumerAuthType = (typeof MCP_CONSUMER_AUTH_TYPES)[number];
63
+ /** MCP authentication by mode; Connector credentials remain host-managed. */
61
64
  export type TMcpConsumerAuth = {
65
+ /** Use the caller's Connector authorization. */
66
+ type: 'connector';
67
+ /** Administrator-resolved binding. Never a token or a package-supplied machine ID. */
68
+ bindingId: string;
69
+ /** Registered Connector strategy key matching this binding. */
70
+ provider: string;
71
+ /** Resource/audience understood by the Connector provider. */
72
+ resource?: string;
73
+ /** Required scopes, revalidated by the Connector. */
74
+ scopes?: string[];
75
+ } | {
62
76
  type: 'none';
63
77
  } | {
64
78
  type: 'manual_header';
@@ -198,7 +212,13 @@ export type TMCPSchema = {
198
212
  mcpServers?: Record<string, TMCPServer>;
199
213
  };
200
214
  export declare const MCP_APP_RESOURCE_MIME_TYPE = "text/html;profile=mcp-app";
215
+ /** Optional host refresh action. Arguments are fixed by the resource provider. */
216
+ export type TMcpAppRefresh = {
217
+ toolName: string;
218
+ arguments?: Record<string, import('../core.model').JSONValue>;
219
+ };
201
220
  export type TMcpAppUiMeta = {
221
+ refresh?: TMcpAppRefresh;
202
222
  resourceUri: string;
203
223
  title?: string | I18nObject;
204
224
  description?: string | I18nObject;
@@ -3,6 +3,7 @@ import { ICopilotModel } from './copilot-model.model';
3
3
  import { TKBRecallParams } from './knowledgebase.model';
4
4
  import { ApiAuthType, JsonSchemaObjectType, TErrorHandling, TXpertRefParameter } from './types';
5
5
  import { TKBRetrievalSettings, TStateVariable, TXpertParameter } from './xpert.model';
6
+ import type { AssistantTriggerPresentation } from './assistant-trigger.model';
6
7
  export type TWorkflowNodeMeta = {
7
8
  name: string;
8
9
  label: I18nObject;
@@ -10,7 +11,20 @@ export type TWorkflowNodeMeta = {
10
11
  deprecated?: boolean;
11
12
  configSchema: JsonSchemaObjectType;
12
13
  };
13
- export type TWorkflowTriggerMeta = TWorkflowNodeMeta;
14
+ export type TWorkflowTriggerMeta = TWorkflowNodeMeta & {
15
+ assistant?: AssistantTriggerPresentation;
16
+ quickConnect?: {
17
+ method: 'qr';
18
+ integrationProvider: string;
19
+ configField: string;
20
+ };
21
+ };
22
+ export type TWorkflowTriggerConnectionStatus = {
23
+ provider: string;
24
+ enabled: boolean;
25
+ connected: boolean;
26
+ state: 'disconnected' | 'connecting' | 'connected' | 'failed';
27
+ };
14
28
  export declare enum WorkflowNodeTypeEnum {
15
29
  START = "start",
16
30
  END = "end",