@xpert-ai/contracts 3.21.0 → 3.21.2
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 +367 -107
- package/index.esm.js +481 -235
- 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.model.d.ts +40 -0
- package/src/ai/clawxpert-recovery.model.d.ts +10 -0
- package/src/ai/copilot-model.model.d.ts +13 -0
- package/src/ai/copilot-provider.model.d.ts +9 -2
- package/src/ai/execution-activity.model.d.ts +10 -10
- package/src/ai/index.d.ts +3 -0
- package/src/ai/model-discovery.model.d.ts +363 -0
- package/src/ai/project-task-runtime.model.d.ts +385 -5
- package/src/ai/realtime-voice.model.d.ts +2 -2
- package/src/ai/xpert-project.model.d.ts +1 -0
- package/src/ai/xpert-template.model.d.ts +2 -13
- package/src/index.d.ts +1 -1
- package/src/plugin-application.d.ts +2 -1
- package/src/plugin-management.d.ts +3 -0
- package/src/plugin.d.ts +9 -1
- package/src/runtime-control.d.ts +10 -2
- package/src/storage-file.model.d.ts +5 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AiModelTypeEnum } from '../agent/ai-model';
|
|
3
|
+
import { AIModelEntity, ModelFeature, ProviderModel } from './ai-model.model';
|
|
4
|
+
import type { ICopilotProvider, ICopilotProviderModel } from './copilot-provider.model';
|
|
5
|
+
export declare const discoverableModelTypes: readonly [AiModelTypeEnum.LLM, AiModelTypeEnum.TEXT_EMBEDDING, AiModelTypeEnum.RERANK];
|
|
6
|
+
export type DiscoverableModelType = (typeof discoverableModelTypes)[number];
|
|
7
|
+
/** Saved model configuration is explicit; name heuristics are only discovery suggestions. */
|
|
8
|
+
export declare const modelConfigurationSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"modelType", [z.ZodObject<{
|
|
9
|
+
maxOutputTokens: z.ZodNumber;
|
|
10
|
+
defaultMaxTokens: z.ZodNumber;
|
|
11
|
+
features: z.ZodArray<z.ZodNativeEnum<typeof ModelFeature>, "many">;
|
|
12
|
+
contextSize: z.ZodNumber;
|
|
13
|
+
maxConcurrency: z.ZodNumber;
|
|
14
|
+
modelType: z.ZodLiteral<AiModelTypeEnum.LLM>;
|
|
15
|
+
}, "strict", z.ZodTypeAny, {
|
|
16
|
+
modelType?: AiModelTypeEnum.LLM;
|
|
17
|
+
maxOutputTokens?: number;
|
|
18
|
+
defaultMaxTokens?: number;
|
|
19
|
+
features?: ModelFeature[];
|
|
20
|
+
contextSize?: number;
|
|
21
|
+
maxConcurrency?: number;
|
|
22
|
+
}, {
|
|
23
|
+
modelType?: AiModelTypeEnum.LLM;
|
|
24
|
+
maxOutputTokens?: number;
|
|
25
|
+
defaultMaxTokens?: number;
|
|
26
|
+
features?: ModelFeature[];
|
|
27
|
+
contextSize?: number;
|
|
28
|
+
maxConcurrency?: number;
|
|
29
|
+
}>, z.ZodObject<{
|
|
30
|
+
dimensions: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
batchSize: z.ZodNumber;
|
|
32
|
+
contextSize: z.ZodNumber;
|
|
33
|
+
maxConcurrency: z.ZodNumber;
|
|
34
|
+
modelType: z.ZodLiteral<AiModelTypeEnum.TEXT_EMBEDDING>;
|
|
35
|
+
}, "strict", z.ZodTypeAny, {
|
|
36
|
+
modelType?: AiModelTypeEnum.TEXT_EMBEDDING;
|
|
37
|
+
contextSize?: number;
|
|
38
|
+
maxConcurrency?: number;
|
|
39
|
+
dimensions?: number;
|
|
40
|
+
batchSize?: number;
|
|
41
|
+
}, {
|
|
42
|
+
modelType?: AiModelTypeEnum.TEXT_EMBEDDING;
|
|
43
|
+
contextSize?: number;
|
|
44
|
+
maxConcurrency?: number;
|
|
45
|
+
dimensions?: number;
|
|
46
|
+
batchSize?: number;
|
|
47
|
+
}>, z.ZodObject<{
|
|
48
|
+
contextSize: z.ZodNumber;
|
|
49
|
+
maxConcurrency: z.ZodNumber;
|
|
50
|
+
modelType: z.ZodLiteral<AiModelTypeEnum.RERANK>;
|
|
51
|
+
}, "strict", z.ZodTypeAny, {
|
|
52
|
+
modelType?: AiModelTypeEnum.RERANK;
|
|
53
|
+
contextSize?: number;
|
|
54
|
+
maxConcurrency?: number;
|
|
55
|
+
}, {
|
|
56
|
+
modelType?: AiModelTypeEnum.RERANK;
|
|
57
|
+
contextSize?: number;
|
|
58
|
+
maxConcurrency?: number;
|
|
59
|
+
}>]>, {
|
|
60
|
+
modelType?: AiModelTypeEnum.LLM;
|
|
61
|
+
maxOutputTokens?: number;
|
|
62
|
+
defaultMaxTokens?: number;
|
|
63
|
+
features?: ModelFeature[];
|
|
64
|
+
contextSize?: number;
|
|
65
|
+
maxConcurrency?: number;
|
|
66
|
+
} | {
|
|
67
|
+
modelType?: AiModelTypeEnum.TEXT_EMBEDDING;
|
|
68
|
+
contextSize?: number;
|
|
69
|
+
maxConcurrency?: number;
|
|
70
|
+
dimensions?: number;
|
|
71
|
+
batchSize?: number;
|
|
72
|
+
} | {
|
|
73
|
+
modelType?: AiModelTypeEnum.RERANK;
|
|
74
|
+
contextSize?: number;
|
|
75
|
+
maxConcurrency?: number;
|
|
76
|
+
}, {
|
|
77
|
+
modelType?: AiModelTypeEnum.LLM;
|
|
78
|
+
maxOutputTokens?: number;
|
|
79
|
+
defaultMaxTokens?: number;
|
|
80
|
+
features?: ModelFeature[];
|
|
81
|
+
contextSize?: number;
|
|
82
|
+
maxConcurrency?: number;
|
|
83
|
+
} | {
|
|
84
|
+
modelType?: AiModelTypeEnum.TEXT_EMBEDDING;
|
|
85
|
+
contextSize?: number;
|
|
86
|
+
maxConcurrency?: number;
|
|
87
|
+
dimensions?: number;
|
|
88
|
+
batchSize?: number;
|
|
89
|
+
} | {
|
|
90
|
+
modelType?: AiModelTypeEnum.RERANK;
|
|
91
|
+
contextSize?: number;
|
|
92
|
+
maxConcurrency?: number;
|
|
93
|
+
}>;
|
|
94
|
+
export type ModelConfiguration = z.output<typeof modelConfigurationSchema>;
|
|
95
|
+
export declare function defaultModelConfiguration(modelType: DiscoverableModelType): ModelConfiguration;
|
|
96
|
+
/** Start with editable defaults and overlay the matching built-in YAML values. */
|
|
97
|
+
export declare function configurationFromModel(modelType: ModelConfiguration['modelType'], model?: Partial<AIModelEntity>): ModelConfiguration;
|
|
98
|
+
export declare function isDiscoverableModelType(value: unknown): value is DiscoverableModelType;
|
|
99
|
+
/** Parse the persisted JSON field once when entering the model configuration boundary. */
|
|
100
|
+
export declare function readModelConfiguration(properties?: {
|
|
101
|
+
model_configuration?: unknown;
|
|
102
|
+
} | null): ModelConfiguration | undefined;
|
|
103
|
+
export interface DiscoveredModel {
|
|
104
|
+
/** Exact ID returned by the upstream discovery endpoint. */
|
|
105
|
+
model: string;
|
|
106
|
+
label: string;
|
|
107
|
+
modelType: DiscoverableModelType | null;
|
|
108
|
+
typeSource: 'provider' | 'catalog' | 'name' | 'unknown';
|
|
109
|
+
configuration?: ModelConfiguration;
|
|
110
|
+
/** Adapter-owned, non-secret settings such as an exact endpoint model ID or rerank path. */
|
|
111
|
+
modelProperties?: Record<string, string | number | boolean>;
|
|
112
|
+
}
|
|
113
|
+
/** Last successful, explicitly saved account catalog; failed previews never change it. */
|
|
114
|
+
export interface ModelDiscoveryState {
|
|
115
|
+
mode: 'configured';
|
|
116
|
+
syncedAt: string;
|
|
117
|
+
availableModelIds: string[];
|
|
118
|
+
}
|
|
119
|
+
export type ProviderModelSource = 'builtin' | 'discovered' | 'manual';
|
|
120
|
+
export declare function configuredModelSource(model: Pick<ICopilotProviderModel, 'modelProperties'>): Exclude<ProviderModelSource, 'builtin'>;
|
|
121
|
+
export declare function usesConfiguredModelCatalog(provider: Pick<ICopilotProvider, 'options'>): boolean;
|
|
122
|
+
/** Shared by management UI, pickers and execution authorization. Manual additions remain explicit opt-ins. */
|
|
123
|
+
export declare function isConfiguredModelAvailable(provider: Pick<ICopilotProvider, 'options'>, model?: Pick<ICopilotProviderModel, 'modelProperties'> | null): boolean;
|
|
124
|
+
export interface ModelDiscoveryItem extends DiscoveredModel {
|
|
125
|
+
configured: boolean;
|
|
126
|
+
configuredModelId?: string;
|
|
127
|
+
source: Exclude<ProviderModelSource, 'builtin'>;
|
|
128
|
+
available: boolean;
|
|
129
|
+
}
|
|
130
|
+
export interface ModelDiscoveryResult {
|
|
131
|
+
models: ModelDiscoveryItem[];
|
|
132
|
+
}
|
|
133
|
+
export interface ProviderModelCatalog {
|
|
134
|
+
custom: ICopilotProviderModel[];
|
|
135
|
+
/** Reference metadata, not proof of account access. */
|
|
136
|
+
builtin: Array<ProviderModel & Partial<Pick<AIModelEntity, 'parameter_rules'>>>;
|
|
137
|
+
discoverySupported: boolean;
|
|
138
|
+
modelDiscovery?: ModelDiscoveryState;
|
|
139
|
+
}
|
|
140
|
+
export declare const modelImportSchema: z.ZodEffects<z.ZodObject<{
|
|
141
|
+
models: z.ZodArray<z.ZodObject<{
|
|
142
|
+
model: z.ZodString;
|
|
143
|
+
configuration: z.ZodEffects<z.ZodDiscriminatedUnion<"modelType", [z.ZodObject<{
|
|
144
|
+
maxOutputTokens: z.ZodNumber;
|
|
145
|
+
defaultMaxTokens: z.ZodNumber;
|
|
146
|
+
features: z.ZodArray<z.ZodNativeEnum<typeof ModelFeature>, "many">;
|
|
147
|
+
contextSize: z.ZodNumber;
|
|
148
|
+
maxConcurrency: z.ZodNumber;
|
|
149
|
+
modelType: z.ZodLiteral<AiModelTypeEnum.LLM>;
|
|
150
|
+
}, "strict", z.ZodTypeAny, {
|
|
151
|
+
modelType?: AiModelTypeEnum.LLM;
|
|
152
|
+
maxOutputTokens?: number;
|
|
153
|
+
defaultMaxTokens?: number;
|
|
154
|
+
features?: ModelFeature[];
|
|
155
|
+
contextSize?: number;
|
|
156
|
+
maxConcurrency?: number;
|
|
157
|
+
}, {
|
|
158
|
+
modelType?: AiModelTypeEnum.LLM;
|
|
159
|
+
maxOutputTokens?: number;
|
|
160
|
+
defaultMaxTokens?: number;
|
|
161
|
+
features?: ModelFeature[];
|
|
162
|
+
contextSize?: number;
|
|
163
|
+
maxConcurrency?: number;
|
|
164
|
+
}>, z.ZodObject<{
|
|
165
|
+
dimensions: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
batchSize: z.ZodNumber;
|
|
167
|
+
contextSize: z.ZodNumber;
|
|
168
|
+
maxConcurrency: z.ZodNumber;
|
|
169
|
+
modelType: z.ZodLiteral<AiModelTypeEnum.TEXT_EMBEDDING>;
|
|
170
|
+
}, "strict", z.ZodTypeAny, {
|
|
171
|
+
modelType?: AiModelTypeEnum.TEXT_EMBEDDING;
|
|
172
|
+
contextSize?: number;
|
|
173
|
+
maxConcurrency?: number;
|
|
174
|
+
dimensions?: number;
|
|
175
|
+
batchSize?: number;
|
|
176
|
+
}, {
|
|
177
|
+
modelType?: AiModelTypeEnum.TEXT_EMBEDDING;
|
|
178
|
+
contextSize?: number;
|
|
179
|
+
maxConcurrency?: number;
|
|
180
|
+
dimensions?: number;
|
|
181
|
+
batchSize?: number;
|
|
182
|
+
}>, z.ZodObject<{
|
|
183
|
+
contextSize: z.ZodNumber;
|
|
184
|
+
maxConcurrency: z.ZodNumber;
|
|
185
|
+
modelType: z.ZodLiteral<AiModelTypeEnum.RERANK>;
|
|
186
|
+
}, "strict", z.ZodTypeAny, {
|
|
187
|
+
modelType?: AiModelTypeEnum.RERANK;
|
|
188
|
+
contextSize?: number;
|
|
189
|
+
maxConcurrency?: number;
|
|
190
|
+
}, {
|
|
191
|
+
modelType?: AiModelTypeEnum.RERANK;
|
|
192
|
+
contextSize?: number;
|
|
193
|
+
maxConcurrency?: number;
|
|
194
|
+
}>]>, {
|
|
195
|
+
modelType?: AiModelTypeEnum.LLM;
|
|
196
|
+
maxOutputTokens?: number;
|
|
197
|
+
defaultMaxTokens?: number;
|
|
198
|
+
features?: ModelFeature[];
|
|
199
|
+
contextSize?: number;
|
|
200
|
+
maxConcurrency?: number;
|
|
201
|
+
} | {
|
|
202
|
+
modelType?: AiModelTypeEnum.TEXT_EMBEDDING;
|
|
203
|
+
contextSize?: number;
|
|
204
|
+
maxConcurrency?: number;
|
|
205
|
+
dimensions?: number;
|
|
206
|
+
batchSize?: number;
|
|
207
|
+
} | {
|
|
208
|
+
modelType?: AiModelTypeEnum.RERANK;
|
|
209
|
+
contextSize?: number;
|
|
210
|
+
maxConcurrency?: number;
|
|
211
|
+
}, {
|
|
212
|
+
modelType?: AiModelTypeEnum.LLM;
|
|
213
|
+
maxOutputTokens?: number;
|
|
214
|
+
defaultMaxTokens?: number;
|
|
215
|
+
features?: ModelFeature[];
|
|
216
|
+
contextSize?: number;
|
|
217
|
+
maxConcurrency?: number;
|
|
218
|
+
} | {
|
|
219
|
+
modelType?: AiModelTypeEnum.TEXT_EMBEDDING;
|
|
220
|
+
contextSize?: number;
|
|
221
|
+
maxConcurrency?: number;
|
|
222
|
+
dimensions?: number;
|
|
223
|
+
batchSize?: number;
|
|
224
|
+
} | {
|
|
225
|
+
modelType?: AiModelTypeEnum.RERANK;
|
|
226
|
+
contextSize?: number;
|
|
227
|
+
maxConcurrency?: number;
|
|
228
|
+
}>;
|
|
229
|
+
}, "strict", z.ZodTypeAny, {
|
|
230
|
+
model?: string;
|
|
231
|
+
configuration?: {
|
|
232
|
+
modelType?: AiModelTypeEnum.LLM;
|
|
233
|
+
maxOutputTokens?: number;
|
|
234
|
+
defaultMaxTokens?: number;
|
|
235
|
+
features?: ModelFeature[];
|
|
236
|
+
contextSize?: number;
|
|
237
|
+
maxConcurrency?: number;
|
|
238
|
+
} | {
|
|
239
|
+
modelType?: AiModelTypeEnum.TEXT_EMBEDDING;
|
|
240
|
+
contextSize?: number;
|
|
241
|
+
maxConcurrency?: number;
|
|
242
|
+
dimensions?: number;
|
|
243
|
+
batchSize?: number;
|
|
244
|
+
} | {
|
|
245
|
+
modelType?: AiModelTypeEnum.RERANK;
|
|
246
|
+
contextSize?: number;
|
|
247
|
+
maxConcurrency?: number;
|
|
248
|
+
};
|
|
249
|
+
}, {
|
|
250
|
+
model?: string;
|
|
251
|
+
configuration?: {
|
|
252
|
+
modelType?: AiModelTypeEnum.LLM;
|
|
253
|
+
maxOutputTokens?: number;
|
|
254
|
+
defaultMaxTokens?: number;
|
|
255
|
+
features?: ModelFeature[];
|
|
256
|
+
contextSize?: number;
|
|
257
|
+
maxConcurrency?: number;
|
|
258
|
+
} | {
|
|
259
|
+
modelType?: AiModelTypeEnum.TEXT_EMBEDDING;
|
|
260
|
+
contextSize?: number;
|
|
261
|
+
maxConcurrency?: number;
|
|
262
|
+
dimensions?: number;
|
|
263
|
+
batchSize?: number;
|
|
264
|
+
} | {
|
|
265
|
+
modelType?: AiModelTypeEnum.RERANK;
|
|
266
|
+
contextSize?: number;
|
|
267
|
+
maxConcurrency?: number;
|
|
268
|
+
};
|
|
269
|
+
}>, "many">;
|
|
270
|
+
}, "strict", z.ZodTypeAny, {
|
|
271
|
+
models?: {
|
|
272
|
+
model?: string;
|
|
273
|
+
configuration?: {
|
|
274
|
+
modelType?: AiModelTypeEnum.LLM;
|
|
275
|
+
maxOutputTokens?: number;
|
|
276
|
+
defaultMaxTokens?: number;
|
|
277
|
+
features?: ModelFeature[];
|
|
278
|
+
contextSize?: number;
|
|
279
|
+
maxConcurrency?: number;
|
|
280
|
+
} | {
|
|
281
|
+
modelType?: AiModelTypeEnum.TEXT_EMBEDDING;
|
|
282
|
+
contextSize?: number;
|
|
283
|
+
maxConcurrency?: number;
|
|
284
|
+
dimensions?: number;
|
|
285
|
+
batchSize?: number;
|
|
286
|
+
} | {
|
|
287
|
+
modelType?: AiModelTypeEnum.RERANK;
|
|
288
|
+
contextSize?: number;
|
|
289
|
+
maxConcurrency?: number;
|
|
290
|
+
};
|
|
291
|
+
}[];
|
|
292
|
+
}, {
|
|
293
|
+
models?: {
|
|
294
|
+
model?: string;
|
|
295
|
+
configuration?: {
|
|
296
|
+
modelType?: AiModelTypeEnum.LLM;
|
|
297
|
+
maxOutputTokens?: number;
|
|
298
|
+
defaultMaxTokens?: number;
|
|
299
|
+
features?: ModelFeature[];
|
|
300
|
+
contextSize?: number;
|
|
301
|
+
maxConcurrency?: number;
|
|
302
|
+
} | {
|
|
303
|
+
modelType?: AiModelTypeEnum.TEXT_EMBEDDING;
|
|
304
|
+
contextSize?: number;
|
|
305
|
+
maxConcurrency?: number;
|
|
306
|
+
dimensions?: number;
|
|
307
|
+
batchSize?: number;
|
|
308
|
+
} | {
|
|
309
|
+
modelType?: AiModelTypeEnum.RERANK;
|
|
310
|
+
contextSize?: number;
|
|
311
|
+
maxConcurrency?: number;
|
|
312
|
+
};
|
|
313
|
+
}[];
|
|
314
|
+
}>, {
|
|
315
|
+
models?: {
|
|
316
|
+
model?: string;
|
|
317
|
+
configuration?: {
|
|
318
|
+
modelType?: AiModelTypeEnum.LLM;
|
|
319
|
+
maxOutputTokens?: number;
|
|
320
|
+
defaultMaxTokens?: number;
|
|
321
|
+
features?: ModelFeature[];
|
|
322
|
+
contextSize?: number;
|
|
323
|
+
maxConcurrency?: number;
|
|
324
|
+
} | {
|
|
325
|
+
modelType?: AiModelTypeEnum.TEXT_EMBEDDING;
|
|
326
|
+
contextSize?: number;
|
|
327
|
+
maxConcurrency?: number;
|
|
328
|
+
dimensions?: number;
|
|
329
|
+
batchSize?: number;
|
|
330
|
+
} | {
|
|
331
|
+
modelType?: AiModelTypeEnum.RERANK;
|
|
332
|
+
contextSize?: number;
|
|
333
|
+
maxConcurrency?: number;
|
|
334
|
+
};
|
|
335
|
+
}[];
|
|
336
|
+
}, {
|
|
337
|
+
models?: {
|
|
338
|
+
model?: string;
|
|
339
|
+
configuration?: {
|
|
340
|
+
modelType?: AiModelTypeEnum.LLM;
|
|
341
|
+
maxOutputTokens?: number;
|
|
342
|
+
defaultMaxTokens?: number;
|
|
343
|
+
features?: ModelFeature[];
|
|
344
|
+
contextSize?: number;
|
|
345
|
+
maxConcurrency?: number;
|
|
346
|
+
} | {
|
|
347
|
+
modelType?: AiModelTypeEnum.TEXT_EMBEDDING;
|
|
348
|
+
contextSize?: number;
|
|
349
|
+
maxConcurrency?: number;
|
|
350
|
+
dimensions?: number;
|
|
351
|
+
batchSize?: number;
|
|
352
|
+
} | {
|
|
353
|
+
modelType?: AiModelTypeEnum.RERANK;
|
|
354
|
+
contextSize?: number;
|
|
355
|
+
maxConcurrency?: number;
|
|
356
|
+
};
|
|
357
|
+
}[];
|
|
358
|
+
}>;
|
|
359
|
+
export type ModelImportInput = z.output<typeof modelImportSchema>;
|
|
360
|
+
export interface ModelImportResult {
|
|
361
|
+
added: number;
|
|
362
|
+
skipped: number;
|
|
363
|
+
}
|