@xpert-ai/contracts 3.20.0 → 3.21.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.
- package/index.cjs.js +65 -18
- package/index.esm.js +61 -19
- package/package.json +2 -2
- package/src/agent-plugin.d.ts +10 -3
- package/src/ai/assistant-task-context.model.d.ts +26 -0
- package/src/ai/chat-group-entity.model.d.ts +93 -0
- package/src/ai/chat-group.model.d.ts +338 -0
- package/src/ai/chat-message.model.d.ts +6 -0
- package/src/ai/chat.model.d.ts +16 -0
- package/src/ai/clawxpert-recovery.model.d.ts +10 -0
- package/src/ai/conversation-entry.model.d.ts +18 -0
- package/src/ai/copilot-model.model.d.ts +13 -0
- package/src/ai/index.d.ts +5 -0
- package/src/ai/project-task-runtime.model.d.ts +383 -3
- package/src/ai/realtime-voice.model.d.ts +2 -2
- package/src/ai/sandbox-terminal.model.d.ts +1 -0
- package/src/ai/xpert-template.model.d.ts +2 -13
- package/src/api-key.model.d.ts +37 -2
- package/src/default-agent-plugins.d.ts +19 -0
- package/src/index.d.ts +3 -1
- package/src/plugin-application.d.ts +257 -0
- package/src/plugin-management.d.ts +112 -0
- package/src/plugin.d.ts +3 -319
- package/src/runtime-control.d.ts +19 -0
- package/src/secret-token.model.d.ts +8 -1
- package/src/setup-plugins.d.ts +75 -0
- package/src/storage-file.model.d.ts +5 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import type { RuntimeCapabilitiesSelection } from '@xpert-ai/chatkit-types';
|
|
2
|
+
import type { RuntimeResourcesSelection } from '../agent-plugin';
|
|
3
|
+
import type { TAvatar } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Public group protocol for ChatConversation(purpose='group'). Each Assistant has a separate runtime.
|
|
6
|
+
* Participant IDs identify membership within this group; subject IDs identify User or Xpert records.
|
|
7
|
+
* These DTOs do not grant access: validate inputs and resolve identity/permissions on the server.
|
|
8
|
+
* Extend machine-readable discriminants and their validators/consumers together; never infer kind from names.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Server-resolved communication intent, independent of whether the sender is human or an Assistant.
|
|
12
|
+
* `request` addresses members and may wake an Assistant; `reply` answers an existing request and
|
|
13
|
+
* routes back to its sender; `message` publishes information without waking addressed Assistants.
|
|
14
|
+
*/
|
|
15
|
+
export type ChatGroupIntent = 'request' | 'reply' | 'message';
|
|
16
|
+
/** Per-recipient delivery progress, not a read receipt or the overall Assistant run status. */
|
|
17
|
+
export type ChatGroupDeliveryStatus =
|
|
18
|
+
/** Accepted for delivery; dispatch may still be pending. */
|
|
19
|
+
'pending'
|
|
20
|
+
/** Starting an Assistant run for this message. */
|
|
21
|
+
| 'starting'
|
|
22
|
+
/** Submitted to an active run through the existing steer/follow-up mechanism. */
|
|
23
|
+
| 'steering'
|
|
24
|
+
/** Consumed by the runtime; does not by itself mean a reply has been published. */
|
|
25
|
+
| 'consumed'
|
|
26
|
+
/** Delivery cannot proceed under the current authorization or runtime state. */
|
|
27
|
+
| 'blocked'
|
|
28
|
+
/** Delivery was canceled. */
|
|
29
|
+
| 'canceled'
|
|
30
|
+
/** Dispatch failed after its retry policy was exhausted. */
|
|
31
|
+
| 'failed';
|
|
32
|
+
/** Public member profile; runtime conversation IDs and private account data are excluded. */
|
|
33
|
+
export interface ChatGroupParticipant {
|
|
34
|
+
/** GroupParticipant ID used by mentions, senders, recipients and runtime projections. */
|
|
35
|
+
id: string;
|
|
36
|
+
/** Selects the entity namespace of subjectId; also drives member-specific UI and routing. */
|
|
37
|
+
kind: 'user' | 'assistant';
|
|
38
|
+
/** User Account ID for `user`, Xpert ID for `assistant`; not a membership ID. */
|
|
39
|
+
subjectId: string;
|
|
40
|
+
/** Display label only; use IDs for identity and authorization. */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Public User/Xpert avatar; absence permits a display fallback. */
|
|
43
|
+
avatar?: TAvatar | null;
|
|
44
|
+
/** Group management role; `owner` does not identify the primary Assistant. */
|
|
45
|
+
role: 'owner' | 'member';
|
|
46
|
+
/** Inactive members may remain in snapshots to identify historical message authors. */
|
|
47
|
+
active: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** Invite candidate before membership exists; submit kind + subjectId to add the member. */
|
|
50
|
+
export type ChatGroupCandidate = Pick<ChatGroupParticipant, 'kind' | 'subjectId' | 'name' | 'avatar'>;
|
|
51
|
+
/**
|
|
52
|
+
* Per-message selections from the shared Composer, scoped to one addressed Assistant.
|
|
53
|
+
* This does not choose the recipient: the server requires a single matching Assistant recipient
|
|
54
|
+
* and validates project/file/capability access within that scope.
|
|
55
|
+
*/
|
|
56
|
+
export interface ChatGroupComposerInput {
|
|
57
|
+
/** Membership ID of the Assistant whose Composer resources were selected. */
|
|
58
|
+
participantId: string;
|
|
59
|
+
/** Optional project context for this Assistant, subject to server-side access checks. */
|
|
60
|
+
projectId?: string;
|
|
61
|
+
/** Workspace file references, not file contents or arbitrary download URLs. */
|
|
62
|
+
files?: {
|
|
63
|
+
/** Workspace-relative path; currently must match workspacePath. */
|
|
64
|
+
filePath: string;
|
|
65
|
+
/** Authorized path in the target workspace; absolute paths and traversal are rejected. */
|
|
66
|
+
workspacePath: string;
|
|
67
|
+
originalName?: string;
|
|
68
|
+
mimeType?: string;
|
|
69
|
+
/** File size in bytes, when available. */
|
|
70
|
+
size?: number;
|
|
71
|
+
purpose: 'workspace';
|
|
72
|
+
}[];
|
|
73
|
+
/** Shared runtime-resource selection contract, including its own catalog revision. */
|
|
74
|
+
runtimeResources?: RuntimeResourcesSelection;
|
|
75
|
+
/** Shared capability selection contract; selection does not confer permission to use a capability. */
|
|
76
|
+
runtimeCapabilities?: RuntimeCapabilitiesSelection;
|
|
77
|
+
}
|
|
78
|
+
/** Server-authored routing and causality metadata; public senders cannot supply or override identity. */
|
|
79
|
+
export interface ChatGroupCommunication {
|
|
80
|
+
/** Host-only task routing metadata; never accepted by group send APIs or model tools. */
|
|
81
|
+
projectTask?: {
|
|
82
|
+
invocationId: string;
|
|
83
|
+
projectId: string;
|
|
84
|
+
projectTaskId: string;
|
|
85
|
+
taskExecutionId: string;
|
|
86
|
+
};
|
|
87
|
+
/** Durable Invocation result notification, delivered through the group queue. */
|
|
88
|
+
runtimeResult?: {
|
|
89
|
+
invocationId: string;
|
|
90
|
+
consumerExecutionId: string;
|
|
91
|
+
revision: number;
|
|
92
|
+
projectId: string;
|
|
93
|
+
projectTaskId: string;
|
|
94
|
+
taskExecutionId: string;
|
|
95
|
+
specificationDigest: string;
|
|
96
|
+
};
|
|
97
|
+
/** Validated Composer selections for this message, when supplied by a human sender. */
|
|
98
|
+
composer?: ChatGroupComposerInput;
|
|
99
|
+
intent: ChatGroupIntent;
|
|
100
|
+
/** Authenticated human or verified runtime author's membership ID. */
|
|
101
|
+
senderId: string;
|
|
102
|
+
/** Resolved membership IDs, including the original sender when intent is `reply`. */
|
|
103
|
+
recipientIds: string[];
|
|
104
|
+
/** Public group request being answered; a protocol relationship, not a required UI quote. */
|
|
105
|
+
replyToMessageId?: string;
|
|
106
|
+
/** Public group message that caused this runtime output; independent of explicit reply intent. */
|
|
107
|
+
causedByMessageId?: string;
|
|
108
|
+
/** First public message ID in the causal chain, inherited across Assistant handoffs/replies. */
|
|
109
|
+
rootMessageId: string;
|
|
110
|
+
/** Real initiating User Account ID, inherited for execution attribution; never an Assistant principal. */
|
|
111
|
+
rootUserId: string;
|
|
112
|
+
/** Causal depth: roots start at zero; inherited messages increment it for server loop limits. */
|
|
113
|
+
hop: number;
|
|
114
|
+
}
|
|
115
|
+
/** Public message in the shared group transcript, separate from private runtime ChatMessages. */
|
|
116
|
+
export interface ChatGroupMessage {
|
|
117
|
+
/** Persisted ChatMessage ID in the group conversation. */
|
|
118
|
+
id: string;
|
|
119
|
+
/** Correlation/idempotency key of the original submission; not the persisted message ID. */
|
|
120
|
+
clientMessageId: string;
|
|
121
|
+
/** Server-assigned order within this conversation; unchanged when this message is updated. */
|
|
122
|
+
sequence: number;
|
|
123
|
+
text: string;
|
|
124
|
+
/** ISO 8601 creation timestamp; sequence, not this timestamp, defines transcript order. */
|
|
125
|
+
createdAt: string;
|
|
126
|
+
communication: ChatGroupCommunication;
|
|
127
|
+
/** Members with linked execution records; opening one still requires separate runtime-view authorization. */
|
|
128
|
+
runtimeParticipantIds?: string[];
|
|
129
|
+
/** Delivery state per addressed member; an empty list does not imply unread or failed delivery. */
|
|
130
|
+
deliveries: {
|
|
131
|
+
participantId: string;
|
|
132
|
+
status: ChatGroupDeliveryStatus;
|
|
133
|
+
/** Credential-redacted execution failure; absent for pending or successful deliveries. */
|
|
134
|
+
error?: string;
|
|
135
|
+
}[];
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Binds a member to an exact `@name` span in the submitted text. Offsets use JavaScript UTF-16
|
|
139
|
+
* string indices: [start, end). Spans must not overlap; membership and displayed name are validated.
|
|
140
|
+
*/
|
|
141
|
+
export interface ChatGroupMention {
|
|
142
|
+
/** Membership ID, not the User/Xpert subject ID. */
|
|
143
|
+
participantId: string;
|
|
144
|
+
/** Inclusive offset of `@`. */
|
|
145
|
+
start: number;
|
|
146
|
+
/** Exclusive offset after the member name. */
|
|
147
|
+
end: number;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Public human-message input. The server derives author, intent and recipients from trusted context
|
|
151
|
+
* and validated mentions. No mentions routes to the primary Assistant (conversation.xpertId);
|
|
152
|
+
* explicit mentions route only to those members. Busy Assistants receive input through steer.
|
|
153
|
+
*/
|
|
154
|
+
export type ChatGroupSendInput = {
|
|
155
|
+
composer?: ChatGroupComposerInput;
|
|
156
|
+
/** Client-generated UUID; reuse for retries of the same submission, scoped to group and sender. */
|
|
157
|
+
clientMessageId: string;
|
|
158
|
+
/** Message text against which mention offsets are validated. */
|
|
159
|
+
text: string;
|
|
160
|
+
mentions?: ChatGroupMention[];
|
|
161
|
+
/** Reply candidate; it does not override @ routing or the primary-Assistant fallback. */
|
|
162
|
+
replyToMessageId?: string;
|
|
163
|
+
};
|
|
164
|
+
/** Identity to invite; the server resolves display data, access and the new membership ID. */
|
|
165
|
+
export type ChatGroupMemberInput = {
|
|
166
|
+
kind: 'user' | 'assistant';
|
|
167
|
+
subjectId: string;
|
|
168
|
+
};
|
|
169
|
+
/** Creates the shared conversation with the authenticated human as owner. */
|
|
170
|
+
export interface ChatGroupCreateInput {
|
|
171
|
+
title: string;
|
|
172
|
+
/** Xpert ID stored as conversation.xpertId and enrolled as the primary Assistant. */
|
|
173
|
+
assistantId: string;
|
|
174
|
+
}
|
|
175
|
+
/** Lightweight list entry; use a snapshot for full membership and message history. */
|
|
176
|
+
export interface ChatGroupSummary {
|
|
177
|
+
/** Stable discriminator for the shared Assistant/conversation list. */
|
|
178
|
+
purpose: 'group';
|
|
179
|
+
/** Shared ChatConversation ID, also used as groupId by APIs. */
|
|
180
|
+
id: string;
|
|
181
|
+
/** Shared conversation thread ID, not an individual Assistant runtime thread. */
|
|
182
|
+
threadId: string;
|
|
183
|
+
title: string;
|
|
184
|
+
/** ISO 8601 list activity time, using the latest message time when available. */
|
|
185
|
+
updatedAt: string;
|
|
186
|
+
/** Truncated preview only; never use it as the full message or for routing. */
|
|
187
|
+
lastMessage: string;
|
|
188
|
+
/** Total active members; may exceed the avatar preview count in members. */
|
|
189
|
+
memberCount: number;
|
|
190
|
+
/** Bounded active-member preview for composite avatars, not the complete roster. */
|
|
191
|
+
members: Pick<ChatGroupParticipant, 'id' | 'kind' | 'name' | 'avatar'>[];
|
|
192
|
+
/** Current viewer's unread state, based on their read sequence. */
|
|
193
|
+
unread: boolean;
|
|
194
|
+
/** Current viewer's list preference, not a group-wide setting. */
|
|
195
|
+
pinned: boolean;
|
|
196
|
+
/** Current viewer's list preference; does not archive the group for other members. */
|
|
197
|
+
archived: boolean;
|
|
198
|
+
}
|
|
199
|
+
/** Authorized public state plus one page of persisted messages; excludes private runtime configuration. */
|
|
200
|
+
export interface ChatGroupSnapshot {
|
|
201
|
+
/** Shared ChatConversation ID, also used as groupId by APIs. */
|
|
202
|
+
id: string;
|
|
203
|
+
/** Shared conversation thread ID; Assistant execution threads are separate. */
|
|
204
|
+
threadId: string;
|
|
205
|
+
title: string;
|
|
206
|
+
/** Current viewer's membership ID; compare with communication.senderId for own-message presentation. */
|
|
207
|
+
viewerParticipantId: string;
|
|
208
|
+
/** Primary Assistant's Xpert ID; match an assistant member's subjectId, not its id or role. */
|
|
209
|
+
xpertId: string;
|
|
210
|
+
/** Includes inactive members so older messages can retain their authors' identities. */
|
|
211
|
+
members: ChatGroupParticipant[];
|
|
212
|
+
/** One history page in ascending sequence order, not necessarily the full transcript. */
|
|
213
|
+
messages: ChatGroupMessage[];
|
|
214
|
+
/** Older messages exist before this page; paginate using its earliest message sequence. */
|
|
215
|
+
hasMore: boolean;
|
|
216
|
+
/** Server state version covering message, membership and delivery changes; not a message count or SSE cursor. */
|
|
217
|
+
revision: number;
|
|
218
|
+
/** Public runtime state for member threads with a recorded run, including completed/idle runs. */
|
|
219
|
+
runs: ChatGroupRun[];
|
|
220
|
+
/** Pending/claimed human interactions; full request payloads are returned only to an authorized claimant. */
|
|
221
|
+
interactions?: ChatGroupInteraction[];
|
|
222
|
+
}
|
|
223
|
+
/** Public summary of a runtime pause requiring a designated human's approval or client tool execution. */
|
|
224
|
+
export interface ChatGroupInteraction {
|
|
225
|
+
id: string;
|
|
226
|
+
/** Run that produced this interaction. */
|
|
227
|
+
runId: string;
|
|
228
|
+
/** Assistant membership ID owning the run. */
|
|
229
|
+
participantId: string;
|
|
230
|
+
/** User Account ID allowed to claim/respond; not a group membership ID. */
|
|
231
|
+
assignedUserId: string;
|
|
232
|
+
/** Claim/response lifecycle; claiming does not itself complete or resume the interaction. */
|
|
233
|
+
status: 'pending' | 'claimed' | 'completed' | 'canceled';
|
|
234
|
+
}
|
|
235
|
+
/** Returned after the assigned human claims an interaction; observing the group stream does not claim it. */
|
|
236
|
+
export interface ChatGroupInteractionClaim {
|
|
237
|
+
/** Interaction ID, matching ChatGroupInteraction.id. */
|
|
238
|
+
id: string;
|
|
239
|
+
/** Client claim identifier bound by the server; reuse it when responding or retrying the same claim. */
|
|
240
|
+
claimId: string;
|
|
241
|
+
/** Discriminate by kind, then validate request with the existing client-tool or approval protocol. */
|
|
242
|
+
requests: ({
|
|
243
|
+
kind: 'client_tool';
|
|
244
|
+
request: unknown;
|
|
245
|
+
} | {
|
|
246
|
+
kind: 'approval';
|
|
247
|
+
request: unknown;
|
|
248
|
+
})[];
|
|
249
|
+
}
|
|
250
|
+
/** Public projection of one Assistant runtime's current thread/run control state. */
|
|
251
|
+
export interface ChatGroupRun {
|
|
252
|
+
/** Assistant membership ID. */
|
|
253
|
+
participantId: string;
|
|
254
|
+
/** Execution/run identifier; not the shared group thread ID. */
|
|
255
|
+
runId: string;
|
|
256
|
+
/** Thread state, distinct from individual message delivery statuses. */
|
|
257
|
+
status: 'busy' | 'pausing' | 'paused' | 'interrupted' | 'idle' | 'error';
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Public group SSE payload. Transport event IDs are opaque replay cursors, separate from revision/sequence.
|
|
261
|
+
* Extend this union together with stream validation and reducers; private runtime events do not belong here.
|
|
262
|
+
*/
|
|
263
|
+
export type ChatGroupEvent =
|
|
264
|
+
/** Refresh public state and reconcile its history page by message ID. */
|
|
265
|
+
{
|
|
266
|
+
type: 'snapshot';
|
|
267
|
+
snapshot: ChatGroupSnapshot;
|
|
268
|
+
}
|
|
269
|
+
/** Append a text delta to a runtime output; messageId is the runtime output ID, not yet the group message ID. */
|
|
270
|
+
| {
|
|
271
|
+
type: 'text';
|
|
272
|
+
participantId: string;
|
|
273
|
+
runId: string;
|
|
274
|
+
messageId: string;
|
|
275
|
+
text: string;
|
|
276
|
+
}
|
|
277
|
+
/** Replay continuity was lost; recover from a fresh snapshot rather than trusting accumulated deltas. */
|
|
278
|
+
| {
|
|
279
|
+
type: 'resync';
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* Workspace-authorized view of the execution linked to a public group message.
|
|
283
|
+
* Opens in the existing external-Assistant Workbench view; group membership alone grants no runtime access.
|
|
284
|
+
* Contains selected display messages, never checkpoints or runtime configuration.
|
|
285
|
+
*/
|
|
286
|
+
export interface ChatGroupRuntimeView {
|
|
287
|
+
/** Assistant's ChatConversation(purpose='group_assistant_runtime'), not the shared group conversation. */
|
|
288
|
+
conversationId: string;
|
|
289
|
+
/** Assistant runtime thread ID. */
|
|
290
|
+
threadId: string;
|
|
291
|
+
/** Xpert ID owning the execution. */
|
|
292
|
+
xpertId: string;
|
|
293
|
+
/** Corresponding Assistant membership ID in the shared group. */
|
|
294
|
+
participantId: string;
|
|
295
|
+
title: string;
|
|
296
|
+
avatar?: TAvatar | null;
|
|
297
|
+
/** Recorded execution selected by the public group message and participant. */
|
|
298
|
+
executionId: string;
|
|
299
|
+
/** Optional runtime input/output message to focus when opening the view. */
|
|
300
|
+
messageId?: string;
|
|
301
|
+
/** Execution status, distinct from the group's delivery and thread statuses. */
|
|
302
|
+
status: string;
|
|
303
|
+
/** Credential-redacted error for this execution, independent of later runs in the conversation. */
|
|
304
|
+
error?: string;
|
|
305
|
+
/** Display projection for this execution; human runtime context is replaced with the public question. */
|
|
306
|
+
messages: {
|
|
307
|
+
/** Runtime ChatMessage ID, not the public group message ID. */
|
|
308
|
+
id: string;
|
|
309
|
+
role: string;
|
|
310
|
+
/** Existing message-content payload; narrow with its renderer/protocol before use. */
|
|
311
|
+
content: unknown;
|
|
312
|
+
/** Optional reasoning payload; likewise requires the existing message protocol's narrowing. */
|
|
313
|
+
reasoning?: unknown;
|
|
314
|
+
status?: string;
|
|
315
|
+
executionId?: string;
|
|
316
|
+
/** ISO 8601 timestamp. */
|
|
317
|
+
createdAt: string;
|
|
318
|
+
}[];
|
|
319
|
+
}
|
|
320
|
+
/** Shared Project membership is explicitly selected; group membership alone grants no Project access. */
|
|
321
|
+
export interface ChatGroupProjectInput {
|
|
322
|
+
project: {
|
|
323
|
+
mode: 'create';
|
|
324
|
+
id: string;
|
|
325
|
+
name: string;
|
|
326
|
+
} | {
|
|
327
|
+
mode: 'existing';
|
|
328
|
+
projectId: string;
|
|
329
|
+
};
|
|
330
|
+
/** Include the primary Assistant. Updates add participants and preserve existing bindings. */
|
|
331
|
+
participantIds: string[];
|
|
332
|
+
}
|
|
333
|
+
export interface ChatGroupProject {
|
|
334
|
+
projectId: string;
|
|
335
|
+
name: string;
|
|
336
|
+
/** Complete active selection after the operation, including previously bound members. */
|
|
337
|
+
participantIds: string[];
|
|
338
|
+
}
|
|
@@ -58,6 +58,12 @@ export * from './chat-message-envelope.model';
|
|
|
58
58
|
* Chat message entity type
|
|
59
59
|
*/
|
|
60
60
|
export interface IChatMessage extends IBasePerTenantAndOrganizationEntityModel, Omit<Omit<CopilotBaseMessage, 'createdAt'>, 'id'> {
|
|
61
|
+
/**
|
|
62
|
+
* Server-assigned order within a conversation using sequenced messages (currently group chat).
|
|
63
|
+
* Stable across message updates; use for ordering/history cursors, not identity or cross-thread order.
|
|
64
|
+
* Optional for legacy/unsequenced messages; distinct from the conversation's state revision.
|
|
65
|
+
*/
|
|
66
|
+
sequence?: number;
|
|
61
67
|
/** Persisted host-owned provenance; read-only through public message APIs. */
|
|
62
68
|
messageEnvelope?: TChatMessageEnvelope | null;
|
|
63
69
|
parent?: IChatMessage | null;
|
package/src/ai/chat.model.d.ts
CHANGED
|
@@ -176,6 +176,22 @@ export type TSensitiveOperation = {
|
|
|
176
176
|
* Corresponds to the thread in the [Agent Protocol](https://github.com/langchain-ai/agent-protocol).
|
|
177
177
|
*/
|
|
178
178
|
export interface IChatConversation extends IBasePerTenantAndOrganizationEntityModel {
|
|
179
|
+
/**
|
|
180
|
+
* `private`: ordinary chat; `group`: shared public transcript; `group_assistant_runtime`:
|
|
181
|
+
* one member Assistant's isolated execution history. Optional for legacy DTOs (treated as private).
|
|
182
|
+
* Group xpertId identifies the primary Assistant; runtime records require separate access checks.
|
|
183
|
+
*/
|
|
184
|
+
purpose?: 'private' | 'group' | 'group_assistant_runtime';
|
|
185
|
+
/**
|
|
186
|
+
* Server-maintained state version, currently used by group snapshots. Also advances for updates
|
|
187
|
+
* that append no message (e.g. membership/delivery changes); not a count, sequence or replay cursor.
|
|
188
|
+
*/
|
|
189
|
+
revision?: number;
|
|
190
|
+
/**
|
|
191
|
+
* Highest server-allocated message sequence in this conversation (zero before the first allocation).
|
|
192
|
+
* Used for ordering/read positions, not the number of retained messages; updates reuse their sequence.
|
|
193
|
+
*/
|
|
194
|
+
lastMessageSequence?: number;
|
|
179
195
|
branchSource?: TConversationBranchSource | null;
|
|
180
196
|
/**
|
|
181
197
|
* Non-persistent, response-only field populated by the sidebar endpoint.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAssistantBinding } from './assistant-binding.model';
|
|
2
|
+
import type { IXpert } from './xpert.model';
|
|
3
|
+
export type ClawXpertRecoveryStatus = {
|
|
4
|
+
status: 'ready' | 'missing' | 'binding_inaccessible' | 'dependency_unavailable' | 'initializing' | 'error';
|
|
5
|
+
code: 'ready' | 'binding_missing' | 'binding_inaccessible' | 'model_required' | 'initialization_running' | 'initialization_failed' | 'personal_workspace_unavailable';
|
|
6
|
+
checkedAt: string;
|
|
7
|
+
binding: IAssistantBinding | null;
|
|
8
|
+
candidates: Array<Pick<IXpert, 'id' | 'name' | 'title' | 'workspaceId'>>;
|
|
9
|
+
canRecover: boolean;
|
|
10
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authorized metadata for opening a conversation in the shared ChatKit shell.
|
|
3
|
+
* Select the private/group adapter by purpose, not by title, route text or the presence of xpertId.
|
|
4
|
+
* Excludes messages and runtime configuration; group Assistant runtimes are opened through their
|
|
5
|
+
* separately authorized execution view, never as a third top-level chat adapter here.
|
|
6
|
+
*/
|
|
7
|
+
export interface ChatConversationEntry {
|
|
8
|
+
/** ChatConversation ID; for group entries this is also the API groupId. */
|
|
9
|
+
id: string;
|
|
10
|
+
/** Thread belonging to this conversation; not a group member's separate runtime thread. */
|
|
11
|
+
threadId: string;
|
|
12
|
+
/** Owning Xpert ID for private chat or primary Assistant's Xpert ID for a group; null when unbound. */
|
|
13
|
+
xpertId: string | null;
|
|
14
|
+
/** Display title; clients may provide a localized fallback when absent. */
|
|
15
|
+
title: string | null;
|
|
16
|
+
/** Server-resolved adapter discriminator; internal group_assistant_runtime records are excluded. */
|
|
17
|
+
purpose: 'private' | 'group';
|
|
18
|
+
}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { AiModelTypeEnum } from '../agent';
|
|
2
2
|
import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
|
|
3
3
|
import { ICopilot } from './copilot.model';
|
|
4
|
+
import type { ModelFeature } from './ai-model.model';
|
|
5
|
+
/** Public catalog metadata for model selectors; excludes credentials and runtime configuration. */
|
|
6
|
+
export interface ModelSelectionMetadata {
|
|
7
|
+
provider?: {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
iconUrl?: string;
|
|
11
|
+
};
|
|
12
|
+
connectionName?: string;
|
|
13
|
+
features?: ModelFeature[];
|
|
14
|
+
/** Declared context capacity in tokens, not usage. */
|
|
15
|
+
contextWindow?: number;
|
|
16
|
+
}
|
|
4
17
|
export interface ICopilotModel extends TCopilotModel, IBasePerTenantAndOrganizationEntityModel {
|
|
5
18
|
}
|
|
6
19
|
export type TCopilotModel = {
|
package/src/ai/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export type { TChatRequest } from './xpert-chat.model';
|
|
|
7
7
|
export type { ProjectSelection } from './project-selection.model';
|
|
8
8
|
export { CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED } from './chat-event.model';
|
|
9
9
|
export * from './assistant-binding.model';
|
|
10
|
+
export * from './clawxpert-recovery.model';
|
|
10
11
|
export * from './bosi.model';
|
|
11
12
|
export * from './assistant-order';
|
|
12
13
|
export * from './assistant-model.model';
|
|
@@ -100,6 +101,10 @@ export * from './assistant-configuration.model';
|
|
|
100
101
|
export * from './assistant-trigger.model';
|
|
101
102
|
export * from './model-execution.model';
|
|
102
103
|
export * from './agent-runtime.model';
|
|
104
|
+
export * from './assistant-task-context.model';
|
|
103
105
|
export * from './project-task-runtime.model';
|
|
104
106
|
export * from './realtime-voice.model';
|
|
107
|
+
export * from './chat-group.model';
|
|
108
|
+
export * from './chat-group-entity.model';
|
|
109
|
+
export * from './conversation-entry.model';
|
|
105
110
|
export type { ThreadActivitySnapshot } from './thread-activity.model';
|