@xpert-ai/contracts 3.19.0 → 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 (39) hide show
  1. package/index.cjs.js +393 -4
  2. package/index.esm.js +341 -6
  3. package/package.json +5 -2
  4. package/src/agent/ai-model.d.ts +1 -0
  5. package/src/agent/token.d.ts +4 -0
  6. package/src/ai/agent-output-delivery.model.d.ts +31 -0
  7. package/src/ai/agent-runtime.model.d.ts +53 -0
  8. package/src/ai/ai-model.model.d.ts +3 -0
  9. package/src/ai/assistant-binding.model.d.ts +3 -0
  10. package/src/ai/assistant-configuration.model.d.ts +31 -0
  11. package/src/ai/bosi.model.d.ts +73 -0
  12. package/src/ai/chat-message-envelope.model.d.ts +55 -0
  13. package/src/ai/chat-message.model.d.ts +4 -0
  14. package/src/ai/chat.model.d.ts +10 -0
  15. package/src/ai/execution-activity.model.d.ts +547 -0
  16. package/src/ai/index.d.ts +8 -0
  17. package/src/ai/mcp-capability.model.d.ts +5 -1
  18. package/src/ai/membership.model.d.ts +5 -0
  19. package/src/ai/model-execution.model.d.ts +265 -0
  20. package/src/ai/model-gateway.model.d.ts +15 -3
  21. package/src/ai/model-usage.model.d.ts +19 -0
  22. package/src/ai/project-task-graph.model.d.ts +12 -0
  23. package/src/ai/project-task-runtime.model.d.ts +1106 -0
  24. package/src/ai/project-task-type.model.d.ts +13 -0
  25. package/src/ai/prompt-workflow.model.d.ts +4 -0
  26. package/src/ai/realtime-voice.model.d.ts +90 -0
  27. package/src/ai/realtime-voice.transport.d.ts +54 -0
  28. package/src/ai/resource-card.d.ts +2 -0
  29. package/src/ai/thread-activity.model.d.ts +14 -0
  30. package/src/ai/xpert-agent-execution.model.d.ts +4 -0
  31. package/src/ai/xpert-project.model.d.ts +21 -0
  32. package/src/ai/xpert-template.model.d.ts +23 -5
  33. package/src/ai/xpert-tool-mcp.model.d.ts +6 -0
  34. package/src/ai/xpert.model.d.ts +7 -2
  35. package/src/i18n.model.d.ts +1 -0
  36. package/src/index.d.ts +3 -0
  37. package/src/types.d.ts +4 -0
  38. package/src/view-extension/model.d.ts +22 -1
  39. package/src/view-extension/workbench.d.ts +6 -2
@@ -24,9 +24,14 @@ export interface AssistantCapabilityState {
24
24
  before?: TXpertFeatures['sandbox'];
25
25
  after?: TXpertFeatures['sandbox'];
26
26
  };
27
+ realtimeVoice?: {
28
+ before?: TXpertFeatures['realtimeVoice'];
29
+ after?: TXpertFeatures['realtimeVoice'];
30
+ };
27
31
  instructions: string;
28
32
  }
29
33
  export interface AssistantConfiguration {
34
+ realtimeVoice?: import('./realtime-voice.model').RealtimeVoiceSelection;
30
35
  revision: string;
31
36
  workspace: {
32
37
  id: string;
@@ -38,8 +43,34 @@ export interface AssistantConfiguration {
38
43
  setup: XpertTemplateSetup;
39
44
  }
40
45
  export interface AssistantConfigurationInput {
46
+ realtimeVoice?: import('./realtime-voice.model').RealtimeVoiceSelection;
41
47
  revision: string;
42
48
  prompt: string;
43
49
  modelId: string;
44
50
  capabilities: string[];
45
51
  }
52
+ /** Capability authoring in an existing Assistant draft; publication remains an explicit action. */
53
+ export interface AssistantCapabilityConfiguration {
54
+ realtimeVoice?: import('./realtime-voice.model').RealtimeVoiceSelection;
55
+ revision: string;
56
+ selected: string[];
57
+ options: {
58
+ key: string;
59
+ label: string;
60
+ description: string;
61
+ required: boolean;
62
+ available: boolean;
63
+ reason?: string;
64
+ }[];
65
+ setup: XpertTemplateSetup;
66
+ modelId: string;
67
+ /** Null when runtime checks prevent model validation. */
68
+ modelAvailable: boolean | null;
69
+ }
70
+ export interface AssistantCapabilityDraftInput {
71
+ realtimeVoice?: import('./realtime-voice.model').RealtimeVoiceSelection;
72
+ revision: string;
73
+ capabilities: string[];
74
+ /** Applied after removing managed contributions; empty selects the platform default. */
75
+ sandboxProvider?: string;
76
+ }
@@ -0,0 +1,73 @@
1
+ import type { XpertTemplateSetup } from './xpert-template.model';
2
+ import type { RuntimeResourceReference } from '../agent-plugin';
3
+ import type { IconDefinition } from '../types';
4
+ /** Persisted choices for one tenant/organization/user binding; runtime access is checked independently. */
5
+ export type BosiOnboardingPreferences = {
6
+ version: 1;
7
+ /** Choice revision for optimistic concurrency, not the plugin catalog or package version. */
8
+ revision: number;
9
+ /** The binding owner's private workspace in the current organization. */
10
+ workspaceId: string;
11
+ /** Pin the selected runtime binding/version; do not silently adopt later plugin upgrades. */
12
+ packages: Array<{
13
+ packageId: string;
14
+ resource: RuntimeResourceReference;
15
+ }>;
16
+ /** Connector binding IDs in this workspace, not provider IDs used by the selection UI. */
17
+ connectorIds: string[];
18
+ };
19
+ /** Display and action availability for onboarding; the server rechecks authorization on each action. */
20
+ export type BosiOnboardingItem = {
21
+ /** Plugin package ID for `plugin`, connector provider ID for `connector`. */
22
+ id: string;
23
+ kind: 'plugin' | 'connector';
24
+ name: string;
25
+ description?: string;
26
+ icon?: IconDefinition;
27
+ status: 'available' | 'ready' | 'requires_auth' | 'expired' | 'configuration_required' | 'unavailable';
28
+ selected: boolean;
29
+ canSelect: boolean;
30
+ canConnect: boolean;
31
+ reason?: string;
32
+ };
33
+ export type BosiOnboardingCatalog = {
34
+ workspace: {
35
+ id: string;
36
+ name: string;
37
+ };
38
+ /** Echo in a choice request; an outdated revision requires refreshing the catalog. */
39
+ revision: number;
40
+ items: BosiOnboardingItem[];
41
+ };
42
+ export type BosiOnboardingChoice = {
43
+ revision: number;
44
+ kind: BosiOnboardingItem['kind'];
45
+ /** The catalog item ID, whose meaning is determined by `kind`. */
46
+ id: string;
47
+ selected: boolean;
48
+ };
49
+ /** Optional bootstrap capabilities; these keys match the existing template capability registry. */
50
+ export type BosiCapability = 'cloud-computer' | 'desktop-shell';
51
+ /** Authorized setup snapshot; access/query errors must not be represented as an empty binding. */
52
+ export type BosiSetup = {
53
+ assistantId: string | null;
54
+ /** Null also occurs for an existing legacy Assistant; it does not mean onboarding is required. */
55
+ progress: {
56
+ /** `ready` requires a successful welcome execution; publication alone is `welcome_pending`. */
57
+ phase: 'installing' | 'welcome_pending' | 'welcome_running' | 'ready' | 'welcome_failed';
58
+ /** Choices are fixed once installation starts and reused on recovery. */
59
+ capabilities: BosiCapability[];
60
+ /** Opaque ID from XpertTemplateSetup.models, not a provider model name. */
61
+ modelId: string;
62
+ /** Preallocated first-conversation ID; the thread may not exist until welcome starts. */
63
+ threadId: string;
64
+ } | null;
65
+ /** Installation choices are returned while the binding has no published Assistant. */
66
+ setup?: XpertTemplateSetup;
67
+ /** Server availability only; Desktop must additionally check its local Shell support. */
68
+ capabilities?: {
69
+ key: BosiCapability;
70
+ available: boolean;
71
+ reason?: string;
72
+ }[];
73
+ };
@@ -0,0 +1,55 @@
1
+ /** Provenance is descriptive, never an execution principal or an authorization grant. */
2
+ export type TChatMessageSource = {
3
+ type: 'user';
4
+ userId: string;
5
+ } | {
6
+ type: 'voice';
7
+ sessionId: string;
8
+ } | {
9
+ type: 'assistant';
10
+ xpertId: string;
11
+ } | {
12
+ type: 'agent';
13
+ xpertId: string;
14
+ agentKey: string;
15
+ } | {
16
+ type: 'runtime';
17
+ provider: string;
18
+ bindingId: string;
19
+ invocationId: string;
20
+ } | {
21
+ type: 'automation';
22
+ taskId: string;
23
+ };
24
+ /** Presentation does not change model roles or remove input from execution/retry history. */
25
+ export type TChatMessagePresentation = 'message' | 'event' | 'runtime';
26
+ /** Host-created provenance, persisted in ChatMessage.messageEnvelope. */
27
+ export interface TChatMessageEnvelope {
28
+ version: 1;
29
+ source: TChatMessageSource;
30
+ presentation: TChatMessagePresentation;
31
+ /** Audited destination, not routing instructions. The authorized request owns routing. */
32
+ target?: {
33
+ xpertId: string;
34
+ agentKey?: string;
35
+ conversationId?: string;
36
+ threadId?: string;
37
+ };
38
+ correlation?: {
39
+ messageId?: string;
40
+ replyToMessageId?: string;
41
+ executionId?: string;
42
+ invocationId?: string;
43
+ /** Existing platform task identity; never substitute a Project Task ID. */
44
+ taskId?: string;
45
+ projectTaskId?: string;
46
+ taskExecutionId?: string;
47
+ };
48
+ }
49
+ /** Persistence boundary: unknown versions stay hidden until this host understands their policy. */
50
+ export declare function chatMessagePresentation(message: {
51
+ messageEnvelope?: unknown;
52
+ }): TChatMessagePresentation;
53
+ export declare function isRuntimeChatMessage(message: {
54
+ messageEnvelope?: unknown;
55
+ }): boolean;
@@ -6,6 +6,7 @@ import { LongTermMemoryTypeEnum } from './xpert.model';
6
6
  import { IXpertAgentExecution, XpertAgentExecutionStatusEnum } from './xpert-agent-execution.model';
7
7
  import { JSONValue } from '../core.model';
8
8
  import { IStorageFile } from '../storage-file.model';
9
+ import type { TChatMessageEnvelope } from './chat-message-envelope.model';
9
10
  export type TSummaryJob = Record<LongTermMemoryTypeEnum, {
10
11
  jobId: number | string;
11
12
  status: string;
@@ -52,10 +53,13 @@ export type TChatFileElementReference = ChatKitReferenceBase & TChatFileElementR
52
53
  type: 'file_element';
53
54
  };
54
55
  export type TChatReference = ChatKitReference | TChatElementReference | TChatFileElementReference;
56
+ export * from './chat-message-envelope.model';
55
57
  /**
56
58
  * Chat message entity type
57
59
  */
58
60
  export interface IChatMessage extends IBasePerTenantAndOrganizationEntityModel, Omit<Omit<CopilotBaseMessage, 'createdAt'>, 'id'> {
61
+ /** Persisted host-owned provenance; read-only through public message APIs. */
62
+ messageEnvelope?: TChatMessageEnvelope | null;
59
63
  parent?: IChatMessage | null;
60
64
  children?: IChatMessage[];
61
65
  parentId?: string | null;
@@ -14,6 +14,13 @@ import { TInterrupt } from '../agent/interrupt';
14
14
  import { IUser } from '../user.model';
15
15
  import type { RuntimeCapabilitiesSelection } from '@xpert-ai/chatkit-types';
16
16
  export type TChatConversationOptions = {
17
+ /** First Project binding is deferred until a human submits the application's setup App. */
18
+ projectCreation?: {
19
+ status: 'awaiting_confirmation';
20
+ } | {
21
+ status: 'confirmed';
22
+ confirmationId: string;
23
+ };
17
24
  /** Preserve an explicit no-Project choice across reloads and subsequent sends. */
18
25
  projectSelection?: import('./project-selection.model').ProjectSelection;
19
26
  /** Persisted resources augment the entry Agent without changing the Assistant graph. */
@@ -104,6 +111,7 @@ export type TChatMessageBranching = {
104
111
  available: boolean;
105
112
  reason?: TChatMessageBranchUnavailableReason;
106
113
  };
114
+ /** @deprecated Legacy presentation metadata. Run control no longer stores or returns display snapshots. */
107
115
  export type TChatThreadDisplayPause = {
108
116
  executionId: string;
109
117
  pauseId: string;
@@ -125,6 +133,8 @@ export declare const ChatThreadPurpose: {
125
133
  export type TChatThreadPurpose = (typeof ChatThreadPurpose)[keyof typeof ChatThreadPurpose];
126
134
  /** Machine-readable keys stored in `ChatConversationThread.metadata`. */
127
135
  export type TChatThreadMetadata = {
136
+ /** User-editable branch label, independent of the conversation title. */
137
+ title?: string;
128
138
  primary?: boolean;
129
139
  purpose?: TChatThreadPurpose;
130
140
  /** Graph revision the edited input was captured on; cleared after the first successful run. */