@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.
- package/index.cjs.js +1390 -222
- package/index.esm.js +1317 -223
- package/package.json +6 -3
- package/src/agent/ai-model.d.ts +1 -0
- package/src/agent/token.d.ts +4 -0
- package/src/agent-plugin.d.ts +192 -0
- package/src/ai/agent-output-delivery.model.d.ts +31 -0
- package/src/ai/agent-runtime.model.d.ts +53 -0
- package/src/ai/ai-model.model.d.ts +3 -0
- package/src/ai/assistant-binding.model.d.ts +3 -0
- package/src/ai/assistant-configuration.model.d.ts +76 -0
- package/src/ai/assistant-order.d.ts +5 -0
- package/src/ai/assistant-trigger.model.d.ts +56 -0
- package/src/ai/bosi.model.d.ts +73 -0
- package/src/ai/chat-activity.model.d.ts +14 -0
- package/src/ai/chat-message-envelope.model.d.ts +55 -0
- package/src/ai/chat-message.model.d.ts +14 -1
- package/src/ai/chat-task-summary.model.d.ts +4 -3
- package/src/ai/chat.model.d.ts +110 -13
- package/src/ai/clawxpert-conversation-scope.model.d.ts +2 -0
- package/src/ai/evolution/baseline.d.ts +40 -0
- package/src/ai/evolution/change.d.ts +53 -0
- package/src/ai/evolution/index.d.ts +1 -0
- package/src/ai/evolution/persistence.d.ts +2 -0
- package/src/ai/evolution/provider.d.ts +1 -1
- package/src/ai/execution-activity.model.d.ts +547 -0
- package/src/ai/index.d.ts +17 -0
- package/src/ai/knowledge-keyword-analyzer.model.d.ts +18 -0
- package/src/ai/knowledgebase.model.d.ts +5 -0
- package/src/ai/mcp-capability.model.d.ts +5 -1
- package/src/ai/mcp-publication.model.d.ts +1 -1
- package/src/ai/membership.model.d.ts +5 -0
- package/src/ai/middleware.model.d.ts +1 -0
- package/src/ai/mobile.model.d.ts +5 -0
- package/src/ai/model-execution.model.d.ts +265 -0
- package/src/ai/model-gateway.model.d.ts +15 -3
- package/src/ai/model-usage.model.d.ts +19 -0
- package/src/ai/project-selection.model.d.ts +9 -0
- package/src/ai/project-task-graph.model.d.ts +70 -0
- package/src/ai/project-task-runtime.model.d.ts +1106 -0
- package/src/ai/project-task-schedule.d.ts +24 -0
- package/src/ai/project-task-type.model.d.ts +13 -0
- package/src/ai/prompt-workflow-capabilities.model.d.ts +15 -0
- package/src/ai/prompt-workflow.model.d.ts +17 -0
- package/src/ai/realtime-voice.model.d.ts +90 -0
- package/src/ai/realtime-voice.transport.d.ts +54 -0
- package/src/ai/resource-card.d.ts +2 -0
- package/src/ai/sandbox-file-output.model.d.ts +9 -0
- package/src/ai/thread-activity.model.d.ts +14 -0
- package/src/ai/xpert-agent-execution.model.d.ts +37 -0
- package/src/ai/xpert-chat.model.d.ts +2 -0
- package/src/ai/xpert-marketplace.model.d.ts +5 -0
- package/src/ai/xpert-project-type.model.d.ts +56 -0
- package/src/ai/xpert-project.model.d.ts +46 -1
- package/src/ai/xpert-template.model.d.ts +48 -0
- package/src/ai/xpert-tool-mcp.model.d.ts +21 -1
- package/src/ai/xpert-workflow.model.d.ts +15 -1
- package/src/ai/xpert.model.d.ts +20 -1
- package/src/desktop-shell.model.d.ts +159 -0
- package/src/i18n.model.d.ts +1 -0
- package/src/index.d.ts +7 -0
- package/src/integration.model.d.ts +19 -0
- package/src/plugin.d.ts +26 -7
- package/src/tag-entity.model.d.ts +1 -1
- package/src/types.d.ts +4 -0
- package/src/view-extension/index.d.ts +2 -0
- package/src/view-extension/model.d.ts +41 -1
- package/src/view-extension/workbench-open.d.ts +10 -0
- package/src/view-extension/workbench.d.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xpert-ai/contracts",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.0",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,8 +21,11 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@octokit/types": "13.10.0",
|
|
23
23
|
"@types/json-schema": "^7.0.15",
|
|
24
|
-
"@xpert-ai/chatkit-types": "
|
|
24
|
+
"@xpert-ai/chatkit-types": "0.12.1",
|
|
25
25
|
"zod-to-json-schema": "^3.25.2"
|
|
26
26
|
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"zod": "^3.25.0 || ^4.0.0"
|
|
29
|
+
},
|
|
27
30
|
"types": "./index.d.ts"
|
|
28
|
-
}
|
|
31
|
+
}
|
package/src/agent/ai-model.d.ts
CHANGED
package/src/agent/token.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export type TTokenUsage = {
|
|
|
6
6
|
totalTokens: number;
|
|
7
7
|
cacheReadInputTokens?: number;
|
|
8
8
|
cacheWriteInputTokens?: number;
|
|
9
|
+
reasoningTokens?: number;
|
|
9
10
|
};
|
|
10
11
|
export interface IModelUsage {
|
|
11
12
|
totalTokens: number;
|
|
@@ -14,6 +15,8 @@ export interface IModelUsage {
|
|
|
14
15
|
latency: number;
|
|
15
16
|
}
|
|
16
17
|
export interface ILLMUsage extends IModelUsage {
|
|
18
|
+
/** Omitted for authoritative provider usage. */
|
|
19
|
+
type?: 'estimated';
|
|
17
20
|
promptTokens: number;
|
|
18
21
|
promptUnitPrice: number;
|
|
19
22
|
promptPriceUnit: number;
|
|
@@ -24,6 +27,7 @@ export interface ILLMUsage extends IModelUsage {
|
|
|
24
27
|
completionPrice: number;
|
|
25
28
|
cacheReadInputTokens?: number;
|
|
26
29
|
cacheWriteInputTokens?: number;
|
|
30
|
+
reasoningTokens?: number;
|
|
27
31
|
pricingStatus?: ModelUsagePricingStatus;
|
|
28
32
|
priceAuthority?: LLMPriceAuthority;
|
|
29
33
|
pricingBreakdown?: LLMPriceBreakdownItem[];
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import type { JSONValue } from './core.model';
|
|
2
|
+
import type { IconDefinition, TAvatar } from './types';
|
|
3
|
+
import type { I18nText } from './i18n.model';
|
|
4
|
+
/**
|
|
5
|
+
* Selectable standard package, configured middleware, or published platform Assistant.
|
|
6
|
+
* agent_plugin is distinct from a native server-code plugin.
|
|
7
|
+
*/
|
|
8
|
+
export type RuntimeResourceKind = 'agent_plugin' | 'middleware' | 'external_xpert';
|
|
9
|
+
/**
|
|
10
|
+
* Availability in the current user/project context; execution still revalidates access.
|
|
11
|
+
* partial means some components are usable; requires_auth needs personal authorization;
|
|
12
|
+
* configuration_required needs administrator configuration.
|
|
13
|
+
*/
|
|
14
|
+
export type RuntimeResourceStatus = 'ready' | 'requires_auth' | 'configuration_required' | 'partial' | 'unavailable';
|
|
15
|
+
/** Version-pinned catalog reference; copy both fields unchanged when selecting. */
|
|
16
|
+
export interface RuntimeResourceReference {
|
|
17
|
+
/** Opaque resource ID, not necessarily a UUID; distinct from Connector or invocation IDs. */
|
|
18
|
+
bindingId: string;
|
|
19
|
+
/** Opaque resource version; existing selections must not silently upgrade. */
|
|
20
|
+
version: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Complete conversation selection, independent of graph runtimeCapabilities.
|
|
24
|
+
* Updates apply to the next execution without changing the Assistant graph.
|
|
25
|
+
*/
|
|
26
|
+
export interface RuntimeResourcesSelection {
|
|
27
|
+
/** Optimistic concurrency revision: use the latest server value; new selections start at zero. */
|
|
28
|
+
revision: number;
|
|
29
|
+
/** Full replacement set; an empty array clears the selection. */
|
|
30
|
+
resources: RuntimeResourceReference[];
|
|
31
|
+
}
|
|
32
|
+
/** Package or component diagnostic. Use code for programmatic handling, message for display. */
|
|
33
|
+
export interface AgentPluginDiagnostic {
|
|
34
|
+
/** Component key/path or package-level location. */
|
|
35
|
+
component: string;
|
|
36
|
+
code: string;
|
|
37
|
+
message: string;
|
|
38
|
+
}
|
|
39
|
+
/** Contextual resource descriptor. Selection identity is bindingId plus version. */
|
|
40
|
+
export interface RuntimeResourceCatalogItem extends RuntimeResourceReference {
|
|
41
|
+
kind: RuntimeResourceKind;
|
|
42
|
+
title: string;
|
|
43
|
+
description?: I18nText;
|
|
44
|
+
icon?: string;
|
|
45
|
+
/** Actual resource avatar, including published Assistant avatars. */
|
|
46
|
+
avatar?: TAvatar;
|
|
47
|
+
/** Middleware/provider icon; use a category fallback when absent. */
|
|
48
|
+
iconDefinition?: IconDefinition;
|
|
49
|
+
/** Related middleware Views for display, not active View instances. */
|
|
50
|
+
views?: RuntimeResourceView[];
|
|
51
|
+
status: RuntimeResourceStatus;
|
|
52
|
+
diagnostics: AgentPluginDiagnostic[];
|
|
53
|
+
/** Package components and their individual availability. Plugins are selected as a whole. */
|
|
54
|
+
components: Array<{
|
|
55
|
+
key: string;
|
|
56
|
+
kind: 'skill' | 'mcp' | 'middleware' | 'external_xpert';
|
|
57
|
+
status: RuntimeResourceStatus;
|
|
58
|
+
}>;
|
|
59
|
+
}
|
|
60
|
+
/** Related View metadata; displaying it neither activates the View nor grants access. */
|
|
61
|
+
export interface RuntimeResourceView {
|
|
62
|
+
key: string;
|
|
63
|
+
title: string;
|
|
64
|
+
description?: I18nText;
|
|
65
|
+
icon?: IconDefinition;
|
|
66
|
+
/** Feature keys used to associate the View with middleware. */
|
|
67
|
+
requiredFeatures: string[];
|
|
68
|
+
}
|
|
69
|
+
/** Paginated resource search result in the authorized context. */
|
|
70
|
+
export interface RuntimeResourceCatalog {
|
|
71
|
+
items: RuntimeResourceCatalogItem[];
|
|
72
|
+
/** Total matches before pagination. */
|
|
73
|
+
total: number;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Portable extensions["xpertai"] manifest data. References installed capabilities;
|
|
77
|
+
* contains no server code, deployment IDs or credentials.
|
|
78
|
+
*/
|
|
79
|
+
export interface AgentPluginXpertExtension {
|
|
80
|
+
/** Extension schema version, independent of the Agent Plugins spec version. */
|
|
81
|
+
version: 1;
|
|
82
|
+
interface?: {
|
|
83
|
+
displayName?: string;
|
|
84
|
+
description?: string;
|
|
85
|
+
icon?: string;
|
|
86
|
+
};
|
|
87
|
+
/** Presets for already installed middleware providers. */
|
|
88
|
+
middlewares?: Array<{
|
|
89
|
+
key: string;
|
|
90
|
+
provider: string;
|
|
91
|
+
options?: {
|
|
92
|
+
[key: string]: JSONValue;
|
|
93
|
+
};
|
|
94
|
+
}>;
|
|
95
|
+
/** Logical expert references mapped to published Assistants by the administrator. */
|
|
96
|
+
experts?: Array<{
|
|
97
|
+
key: string;
|
|
98
|
+
reference: string;
|
|
99
|
+
}>;
|
|
100
|
+
/** Authentication dependencies keyed by the exact server name in mcp.json. */
|
|
101
|
+
connectors?: {
|
|
102
|
+
[serverName: string]: AgentPluginConnectorAuth;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/** Portable MCP authorization requirement: generic MCP OAuth or an existing Connector provider. */
|
|
106
|
+
export type AgentPluginConnectorAuth = {
|
|
107
|
+
type: 'mcp_oauth';
|
|
108
|
+
scopes?: string[];
|
|
109
|
+
/** OAuth client registration mode; omission uses host defaults. */
|
|
110
|
+
clientRegistration?: 'dynamic' | 'preregistered';
|
|
111
|
+
} | {
|
|
112
|
+
type: 'existing';
|
|
113
|
+
provider: string;
|
|
114
|
+
/** Resource/audience understood by the Connector provider. */
|
|
115
|
+
resource: string;
|
|
116
|
+
scopes?: string[];
|
|
117
|
+
};
|
|
118
|
+
/** Host-local authorization binding; never include it in a portable package. */
|
|
119
|
+
export interface AgentPluginConnectorBinding {
|
|
120
|
+
bindingId: string;
|
|
121
|
+
provider: string;
|
|
122
|
+
}
|
|
123
|
+
/** Administrator-owned resource configuration; deployment-local IDs are allowed here. */
|
|
124
|
+
export type RuntimeResourceDefinition = {
|
|
125
|
+
kind: 'agent_plugin';
|
|
126
|
+
packageId: string;
|
|
127
|
+
/** Portable expert reference to approved, published Assistant ID. */
|
|
128
|
+
experts: {
|
|
129
|
+
[reference: string]: string;
|
|
130
|
+
};
|
|
131
|
+
/** Direct MCP OAuth server names; must not overlap connectorServers. */
|
|
132
|
+
oauthServers?: string[];
|
|
133
|
+
/** Connector requirements, optionally populated from the package extension. */
|
|
134
|
+
connectorServers?: {
|
|
135
|
+
[serverName: string]: AgentPluginConnectorAuth;
|
|
136
|
+
};
|
|
137
|
+
} | {
|
|
138
|
+
kind: 'middleware';
|
|
139
|
+
provider: string;
|
|
140
|
+
options: {
|
|
141
|
+
[key: string]: JSONValue;
|
|
142
|
+
};
|
|
143
|
+
} | {
|
|
144
|
+
kind: 'external_xpert';
|
|
145
|
+
/** Published platform Assistant ID, not a remote Agent URL. */
|
|
146
|
+
xpertId: string;
|
|
147
|
+
};
|
|
148
|
+
/** Administrator request to publish a resource binding. */
|
|
149
|
+
export interface RuntimeResourceBindingInput {
|
|
150
|
+
/** Supersede an existing binding; its conversation selections are not silently rewritten. */
|
|
151
|
+
replacesBindingId?: string;
|
|
152
|
+
title: string;
|
|
153
|
+
description?: string;
|
|
154
|
+
/** Workspaces granted access within the organization. */
|
|
155
|
+
workspaceIds: string[];
|
|
156
|
+
definition: RuntimeResourceDefinition;
|
|
157
|
+
}
|
|
158
|
+
/** Editor-facing workspace installation catalog. Never includes sources, MCP configuration or credentials. */
|
|
159
|
+
export interface WorkspaceAgentPlugin {
|
|
160
|
+
id: string;
|
|
161
|
+
name: string;
|
|
162
|
+
description?: I18nText;
|
|
163
|
+
icon?: string;
|
|
164
|
+
version: string;
|
|
165
|
+
status: 'available' | 'not_published' | 'disabled';
|
|
166
|
+
components: Array<{
|
|
167
|
+
kind: 'skill' | 'mcp' | 'middleware' | 'external_xpert';
|
|
168
|
+
name: string;
|
|
169
|
+
}>;
|
|
170
|
+
expertReferences: string[];
|
|
171
|
+
}
|
|
172
|
+
export interface WorkspaceAgentPluginOptions {
|
|
173
|
+
workspaces: Array<{
|
|
174
|
+
id: string;
|
|
175
|
+
name: string;
|
|
176
|
+
}>;
|
|
177
|
+
experts: Array<{
|
|
178
|
+
id: string;
|
|
179
|
+
name: string;
|
|
180
|
+
}>;
|
|
181
|
+
}
|
|
182
|
+
/** Add one imported package to one editable workspace without changing other workspaces or conversations. */
|
|
183
|
+
export interface WorkspaceAgentPluginAddInput {
|
|
184
|
+
packageId: string;
|
|
185
|
+
experts: {
|
|
186
|
+
[reference: string]: string;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
export interface WorkspaceAgentPluginAddResult {
|
|
190
|
+
status: 'added' | 'already_added';
|
|
191
|
+
bindingId: string;
|
|
192
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
export declare const AGENT_OUTPUT_MAX_PATHS = 128;
|
|
3
|
+
/** Relative file selections only. A declaration does not grant filesystem access. */
|
|
4
|
+
export declare const agentResultPathSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
5
|
+
/** Omission means no export. Optional paths restrict the adapter's explicitly declared deliverables. */
|
|
6
|
+
export declare const agentOutputDeliverySchema: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
|
|
7
|
+
mode: z.ZodLiteral<"none">;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
mode?: "none";
|
|
10
|
+
}, {
|
|
11
|
+
mode?: "none";
|
|
12
|
+
}>, z.ZodObject<{
|
|
13
|
+
mode: z.ZodLiteral<"files">;
|
|
14
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
|
|
15
|
+
}, "strict", z.ZodTypeAny, {
|
|
16
|
+
mode?: "files";
|
|
17
|
+
paths?: string[];
|
|
18
|
+
}, {
|
|
19
|
+
mode?: "files";
|
|
20
|
+
paths?: string[];
|
|
21
|
+
}>, z.ZodObject<{
|
|
22
|
+
mode: z.ZodLiteral<"archive">;
|
|
23
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
|
|
24
|
+
}, "strict", z.ZodTypeAny, {
|
|
25
|
+
mode?: "archive";
|
|
26
|
+
paths?: string[];
|
|
27
|
+
}, {
|
|
28
|
+
mode?: "archive";
|
|
29
|
+
paths?: string[];
|
|
30
|
+
}>]>;
|
|
31
|
+
export type AgentOutputDelivery = z.output<typeof agentOutputDeliverySchema>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
/**
|
|
3
|
+
* Running means accepted; actual work start requires an observation.
|
|
4
|
+
* Only succeeded, failed and cancelled are terminal. Unknown must be reconciled without replay.
|
|
5
|
+
*/
|
|
6
|
+
export declare const agentInvocationStatusSchema: z.ZodEnum<["queued", "running", "waiting", "cancelling", "succeeded", "failed", "cancelled", "unknown"]>;
|
|
7
|
+
export type AgentInvocationStatus = z.output<typeof agentInvocationStatusSchema>;
|
|
8
|
+
export declare const agentInvocationTerminalStatusSchema: z.ZodEnum<["succeeded", "failed", "cancelled"]>;
|
|
9
|
+
/** Activity and reported progress are separate from business acceptance. No invented percentage. */
|
|
10
|
+
export declare const agentRuntimeProgressSchema: z.ZodObject<{
|
|
11
|
+
source: z.ZodEnum<["executor", "host"]>;
|
|
12
|
+
observedAt: z.ZodString;
|
|
13
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
14
|
+
phase: z.ZodOptional<z.ZodString>;
|
|
15
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
16
|
+
steps: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
17
|
+
completed: z.ZodNumber;
|
|
18
|
+
total: z.ZodNumber;
|
|
19
|
+
}, "strict", z.ZodTypeAny, {
|
|
20
|
+
total?: number;
|
|
21
|
+
completed?: number;
|
|
22
|
+
}, {
|
|
23
|
+
total?: number;
|
|
24
|
+
completed?: number;
|
|
25
|
+
}>, {
|
|
26
|
+
total?: number;
|
|
27
|
+
completed?: number;
|
|
28
|
+
}, {
|
|
29
|
+
total?: number;
|
|
30
|
+
completed?: number;
|
|
31
|
+
}>>;
|
|
32
|
+
}, "strict", z.ZodTypeAny, {
|
|
33
|
+
source?: "executor" | "host";
|
|
34
|
+
startedAt?: string;
|
|
35
|
+
summary?: string;
|
|
36
|
+
steps?: {
|
|
37
|
+
total?: number;
|
|
38
|
+
completed?: number;
|
|
39
|
+
};
|
|
40
|
+
observedAt?: string;
|
|
41
|
+
phase?: string;
|
|
42
|
+
}, {
|
|
43
|
+
source?: "executor" | "host";
|
|
44
|
+
startedAt?: string;
|
|
45
|
+
summary?: string;
|
|
46
|
+
steps?: {
|
|
47
|
+
total?: number;
|
|
48
|
+
completed?: number;
|
|
49
|
+
};
|
|
50
|
+
observedAt?: string;
|
|
51
|
+
phase?: string;
|
|
52
|
+
}>;
|
|
53
|
+
export type AgentRuntimeProgress = z.output<typeof agentRuntimeProgressSchema>;
|
|
@@ -72,6 +72,9 @@ export interface ProviderHelpInfo {
|
|
|
72
72
|
url: I18nObject;
|
|
73
73
|
}
|
|
74
74
|
export interface ProviderModel {
|
|
75
|
+
realtime?: import('./realtime-voice.model').RealtimeModelMetadata;
|
|
76
|
+
/** Explicit provider-native protocols; absence never implies protocol compatibility. */
|
|
77
|
+
native_protocols?: Array<'openai_responses' | 'anthropic_messages'>;
|
|
75
78
|
model: string;
|
|
76
79
|
label: I18nObject;
|
|
77
80
|
model_type: AiModelTypeEnum;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
|
|
2
2
|
import { IUser } from '../user.model';
|
|
3
|
+
import type { BosiOnboardingPreferences } from './bosi.model';
|
|
3
4
|
export declare enum AssistantCode {
|
|
4
5
|
CHAT_COMMON = "chat_common",
|
|
5
6
|
XPERT_SHARED = "xpert_shared",
|
|
@@ -62,6 +63,8 @@ export declare function updateAssistantBindingToolPreferences(preferences: IAssi
|
|
|
62
63
|
export declare function updateAssistantBindingSkillPreferences(preferences: IAssistantBindingToolPreferences | null | undefined, workspaceId: string | null | undefined, skillId: string, enabled: boolean): IAssistantBindingToolPreferences | null;
|
|
63
64
|
export declare function ensureAssistantBindingSkillWorkspacePreference(preferences: IAssistantBindingToolPreferences | null | undefined, workspaceId: string): IAssistantBindingToolPreferences;
|
|
64
65
|
export interface IAssistantBinding extends IBasePerTenantAndOrganizationEntityModel {
|
|
66
|
+
/** Defaults for the binding owner's private workspace, not organization-wide installation or access grants. */
|
|
67
|
+
desktopOnboarding?: BosiOnboardingPreferences | null;
|
|
65
68
|
code: AssistantCode;
|
|
66
69
|
scope: AssistantBindingScope;
|
|
67
70
|
assistantId?: string | null;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { IXpertAgent } from './xpert-agent.model';
|
|
2
|
+
import type { TXpertFeatures, TXpertTeamConnection, TXpertTeamNode } from './xpert.model';
|
|
3
|
+
import type { XpertTemplateSetup } from './xpert-template.model';
|
|
4
|
+
/** Tracks only capability-owned changes so editing does not replace a user's workflow. */
|
|
5
|
+
export interface AssistantCapabilityState {
|
|
6
|
+
version: 1;
|
|
7
|
+
selected: string[];
|
|
8
|
+
nodes: {
|
|
9
|
+
key: string;
|
|
10
|
+
before?: TXpertTeamNode;
|
|
11
|
+
after: TXpertTeamNode;
|
|
12
|
+
}[];
|
|
13
|
+
connections: {
|
|
14
|
+
key: string;
|
|
15
|
+
before?: TXpertTeamConnection;
|
|
16
|
+
after: TXpertTeamConnection;
|
|
17
|
+
}[];
|
|
18
|
+
agentKey: string;
|
|
19
|
+
agentOptions?: {
|
|
20
|
+
before?: Pick<IXpertAgent['options'], 'middlewares' | 'parallelToolCalls'>;
|
|
21
|
+
after?: Pick<IXpertAgent['options'], 'middlewares' | 'parallelToolCalls'>;
|
|
22
|
+
};
|
|
23
|
+
sandbox?: {
|
|
24
|
+
before?: TXpertFeatures['sandbox'];
|
|
25
|
+
after?: TXpertFeatures['sandbox'];
|
|
26
|
+
};
|
|
27
|
+
realtimeVoice?: {
|
|
28
|
+
before?: TXpertFeatures['realtimeVoice'];
|
|
29
|
+
after?: TXpertFeatures['realtimeVoice'];
|
|
30
|
+
};
|
|
31
|
+
instructions: string;
|
|
32
|
+
}
|
|
33
|
+
export interface AssistantConfiguration {
|
|
34
|
+
realtimeVoice?: import('./realtime-voice.model').RealtimeVoiceSelection;
|
|
35
|
+
revision: string;
|
|
36
|
+
workspace: {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
};
|
|
40
|
+
prompt: string;
|
|
41
|
+
modelId: string;
|
|
42
|
+
capabilities: string[];
|
|
43
|
+
setup: XpertTemplateSetup;
|
|
44
|
+
}
|
|
45
|
+
export interface AssistantConfigurationInput {
|
|
46
|
+
realtimeVoice?: import('./realtime-voice.model').RealtimeVoiceSelection;
|
|
47
|
+
revision: string;
|
|
48
|
+
prompt: string;
|
|
49
|
+
modelId: string;
|
|
50
|
+
capabilities: string[];
|
|
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,56 @@
|
|
|
1
|
+
import type { I18nObject } from '../types';
|
|
2
|
+
import type { TWorkflowTriggerMeta } from './xpert-workflow.model';
|
|
3
|
+
import type { JsonSchemaObjectType } from './types';
|
|
4
|
+
export type AssistantTriggerCategory = 'channel' | 'automation';
|
|
5
|
+
export type AssistantAutomationKind = 'schedule' | 'app-event' | 'webhook' | 'email';
|
|
6
|
+
/** Provider-owned UI mapping; field names refer to the existing Trigger config schema. */
|
|
7
|
+
export interface AssistantTriggerPresentation {
|
|
8
|
+
category: AssistantTriggerCategory;
|
|
9
|
+
channel?: string;
|
|
10
|
+
kind?: AssistantAutomationKind;
|
|
11
|
+
accountFields?: string[];
|
|
12
|
+
instructionField?: string;
|
|
13
|
+
}
|
|
14
|
+
export type AssistantTriggerValue = string | number | boolean | null | AssistantTriggerValue[] | {
|
|
15
|
+
[key: string]: AssistantTriggerValue;
|
|
16
|
+
};
|
|
17
|
+
export type AssistantTriggerConfig = {
|
|
18
|
+
[key: string]: AssistantTriggerValue;
|
|
19
|
+
};
|
|
20
|
+
export interface AssistantTriggerProvider {
|
|
21
|
+
name: string;
|
|
22
|
+
label: I18nObject;
|
|
23
|
+
presentation?: AssistantTriggerPresentation;
|
|
24
|
+
schema: JsonSchemaObjectType;
|
|
25
|
+
quickConnect?: TWorkflowTriggerMeta['quickConnect'];
|
|
26
|
+
available: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface AssistantTriggerItem {
|
|
29
|
+
key: string;
|
|
30
|
+
provider: string;
|
|
31
|
+
title: string;
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
config: AssistantTriggerConfig;
|
|
34
|
+
lastActivityAt: string | null;
|
|
35
|
+
lastRunAt: string | null;
|
|
36
|
+
connection: 'connected' | 'disconnected' | 'connecting' | 'failed' | 'unknown';
|
|
37
|
+
}
|
|
38
|
+
export interface AssistantTriggerSettings {
|
|
39
|
+
revision: string;
|
|
40
|
+
canEdit: boolean;
|
|
41
|
+
providers: AssistantTriggerProvider[];
|
|
42
|
+
items: AssistantTriggerItem[];
|
|
43
|
+
}
|
|
44
|
+
export type AssistantTriggerMutation = {
|
|
45
|
+
revision: string;
|
|
46
|
+
provider: string;
|
|
47
|
+
} & ({
|
|
48
|
+
operation: 'save';
|
|
49
|
+
title: string;
|
|
50
|
+
config: AssistantTriggerConfig;
|
|
51
|
+
} | {
|
|
52
|
+
operation: 'toggle';
|
|
53
|
+
enabled: boolean;
|
|
54
|
+
} | {
|
|
55
|
+
operation: 'delete';
|
|
56
|
+
});
|
|
@@ -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,14 @@
|
|
|
1
|
+
export type TChatConversationStatus = 'idle' | 'busy' | 'pausing' | 'paused' | 'interrupted' | 'error';
|
|
2
|
+
export interface IChatConversationUnreadXpertSummary {
|
|
3
|
+
xpertId: string;
|
|
4
|
+
unreadMessages: number;
|
|
5
|
+
unreadConversations: number;
|
|
6
|
+
latestUnreadAt?: Date | string | null;
|
|
7
|
+
latestUnreadConversationId?: string | null;
|
|
8
|
+
latestUnreadThreadId?: string | null;
|
|
9
|
+
latestConversationAt?: Date | string | null;
|
|
10
|
+
latestConversationId?: string | null;
|
|
11
|
+
latestConversationThreadId?: string | null;
|
|
12
|
+
latestConversationTitle?: string | null;
|
|
13
|
+
latestConversationStatus?: TChatConversationStatus | null;
|
|
14
|
+
}
|
|
@@ -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;
|