@umbraco-ai/core 1.7.0 → 1.8.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/package.json +1 -1
- package/types/umbraco-ai-public-types.d.ts +138 -35
package/package.json
CHANGED
|
@@ -185,22 +185,6 @@ export declare function resolveEntityAdapterByType(entityType: string): Promise<
|
|
|
185
185
|
*/
|
|
186
186
|
export declare function toCamelCase(str: string): string;
|
|
187
187
|
|
|
188
|
-
export declare type ToolItemResponseModel = {
|
|
189
|
-
id: string;
|
|
190
|
-
name: string;
|
|
191
|
-
description: string;
|
|
192
|
-
scopeId: string;
|
|
193
|
-
isDestructive: boolean;
|
|
194
|
-
tags: Array<string>;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
export declare type ToolScopeItemResponseModel = {
|
|
198
|
-
id: string;
|
|
199
|
-
icon: string;
|
|
200
|
-
isDestructive: boolean;
|
|
201
|
-
domain: string;
|
|
202
|
-
};
|
|
203
|
-
|
|
204
188
|
export declare const UAI_ADDONS_MENU_ALIAS = "Uai.Menu.Addons";
|
|
205
189
|
|
|
206
190
|
export declare const UAI_AI_SECTION_PATHNAME = "ai";
|
|
@@ -253,6 +237,53 @@ export declare const UAI_SECTION_ALIAS = "ai";
|
|
|
253
237
|
*/
|
|
254
238
|
export declare const UAI_WORKSPACE_REGISTRY_CONTEXT: UmbContextToken<UaiWorkspaceRegistryContext, UaiWorkspaceRegistryContext>;
|
|
255
239
|
|
|
240
|
+
/**
|
|
241
|
+
* Manages browser audio recording via the MediaRecorder API.
|
|
242
|
+
*
|
|
243
|
+
* Extends `UmbControllerBase` so the recording is automatically cancelled
|
|
244
|
+
* when the host element is destroyed (e.g., navigating away in the SPA).
|
|
245
|
+
*
|
|
246
|
+
* Returns the recorded audio as a `Blob` — transcription is the caller's responsibility
|
|
247
|
+
* via {@link UaiSpeechToTextController}.
|
|
248
|
+
*
|
|
249
|
+
* State is exposed as an observable so Lit elements can bind to it with `this.observe()`.
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```ts
|
|
253
|
+
* const recorder = new UaiAudioRecorder(this);
|
|
254
|
+
* this.observe(recorder.state$, (state) => { this._recorderState = state; });
|
|
255
|
+
* await recorder.start();
|
|
256
|
+
* const audioBlob = await recorder.stop();
|
|
257
|
+
* const { data } = await sttController.transcribe(audioBlob);
|
|
258
|
+
* ```
|
|
259
|
+
*
|
|
260
|
+
* @public
|
|
261
|
+
*/
|
|
262
|
+
export declare class UaiAudioRecorder extends UmbControllerBase {
|
|
263
|
+
#private;
|
|
264
|
+
/** Observable of the current recorder state. */
|
|
265
|
+
get state$(): Observable<UaiAudioRecorderState>;
|
|
266
|
+
/** Current state (synchronous read). */
|
|
267
|
+
get state(): UaiAudioRecorderState;
|
|
268
|
+
constructor(host: UmbControllerHost);
|
|
269
|
+
/**
|
|
270
|
+
* Request microphone access and begin recording.
|
|
271
|
+
* @throws Error if microphone access is denied.
|
|
272
|
+
*/
|
|
273
|
+
start(): Promise<void>;
|
|
274
|
+
/**
|
|
275
|
+
* Stop recording and return the captured audio.
|
|
276
|
+
* @returns The recorded audio as a Blob.
|
|
277
|
+
* @throws Error if no active recording exists.
|
|
278
|
+
*/
|
|
279
|
+
stop(): Promise<Blob>;
|
|
280
|
+
/** Cancel any active recording without returning audio. */
|
|
281
|
+
cancel(): void;
|
|
282
|
+
destroy(): void;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export declare type UaiAudioRecorderState = "idle" | "recording";
|
|
286
|
+
|
|
256
287
|
/**
|
|
257
288
|
* Configuration for the bulk delete action.
|
|
258
289
|
* @public
|
|
@@ -563,7 +594,7 @@ export declare interface UaiEmbeddingItem {
|
|
|
563
594
|
*/
|
|
564
595
|
export declare interface UaiEmbeddingOptions {
|
|
565
596
|
/** Profile ID (GUID) or alias. If omitted, uses the default embedding profile. */
|
|
566
|
-
|
|
597
|
+
profileIdOrAlias?: string;
|
|
567
598
|
/** AbortSignal for cancellation. */
|
|
568
599
|
signal?: AbortSignal;
|
|
569
600
|
}
|
|
@@ -1140,6 +1171,48 @@ export declare interface UaiSerializedProperty {
|
|
|
1140
1171
|
value: unknown;
|
|
1141
1172
|
}
|
|
1142
1173
|
|
|
1174
|
+
/**
|
|
1175
|
+
* Public API for transcribing audio to text.
|
|
1176
|
+
* @public
|
|
1177
|
+
*/
|
|
1178
|
+
export declare class UaiSpeechToTextController extends UmbControllerBase {
|
|
1179
|
+
#private;
|
|
1180
|
+
constructor(host: UmbControllerHost);
|
|
1181
|
+
/**
|
|
1182
|
+
* Transcribes an audio file to text.
|
|
1183
|
+
* @param audioFile - The audio blob to transcribe.
|
|
1184
|
+
* @param options - Optional configuration (profile ID/alias, language, abort signal).
|
|
1185
|
+
* @returns The transcription result or error.
|
|
1186
|
+
*/
|
|
1187
|
+
transcribe(audioFile: Blob, options?: UaiSpeechToTextOptions): Promise<{
|
|
1188
|
+
data?: UaiSpeechToTextResult;
|
|
1189
|
+
error?: unknown;
|
|
1190
|
+
}>;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
/**
|
|
1194
|
+
* Options for speech-to-text transcription (public API).
|
|
1195
|
+
* @public
|
|
1196
|
+
*/
|
|
1197
|
+
export declare interface UaiSpeechToTextOptions {
|
|
1198
|
+
/** Profile ID (GUID) or alias. If omitted, uses the default speech-to-text profile. */
|
|
1199
|
+
profileIdOrAlias?: string;
|
|
1200
|
+
/** BCP-47 language hint (e.g., "en", "de"). */
|
|
1201
|
+
language?: string;
|
|
1202
|
+
/** AbortSignal for cancellation. */
|
|
1203
|
+
signal?: AbortSignal;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
/* Excluded from this release type: UaiSpeechToTextRequest */
|
|
1207
|
+
|
|
1208
|
+
/**
|
|
1209
|
+
* Result of a speech-to-text transcription.
|
|
1210
|
+
* @public
|
|
1211
|
+
*/
|
|
1212
|
+
export declare interface UaiSpeechToTextResult {
|
|
1213
|
+
text: string;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1143
1216
|
/**
|
|
1144
1217
|
* Response model for tag lookup results.
|
|
1145
1218
|
* @public
|
|
@@ -1277,6 +1350,47 @@ export declare interface UaiTestFeatureEntityRepositoryApi extends UmbApi {
|
|
|
1277
1350
|
getEntity(idOrAlias: string): Promise<UaiTestFeatureEntityData | undefined>;
|
|
1278
1351
|
}
|
|
1279
1352
|
|
|
1353
|
+
/**
|
|
1354
|
+
* Public API for tool operations including scope and counting.
|
|
1355
|
+
* @public
|
|
1356
|
+
*/
|
|
1357
|
+
export declare class UaiToolController extends UmbControllerBase {
|
|
1358
|
+
#private;
|
|
1359
|
+
constructor(host: UmbControllerHost);
|
|
1360
|
+
/**
|
|
1361
|
+
* Gets all registered tool scopes.
|
|
1362
|
+
*/
|
|
1363
|
+
getToolScopes(): Promise<{
|
|
1364
|
+
data?: UaiToolScope[];
|
|
1365
|
+
error?: unknown;
|
|
1366
|
+
}>;
|
|
1367
|
+
/**
|
|
1368
|
+
* Gets all registered tools.
|
|
1369
|
+
*/
|
|
1370
|
+
getTools(): Promise<{
|
|
1371
|
+
data?: UaiToolItem[];
|
|
1372
|
+
error?: unknown;
|
|
1373
|
+
}>;
|
|
1374
|
+
/**
|
|
1375
|
+
* Gets tool counts grouped by scope ID.
|
|
1376
|
+
* Combines backend and frontend tools.
|
|
1377
|
+
*/
|
|
1378
|
+
getToolCountsByScope(): Promise<Record<string, number>>;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
/**
|
|
1382
|
+
* Represents a tool item.
|
|
1383
|
+
* @public
|
|
1384
|
+
*/
|
|
1385
|
+
export declare interface UaiToolItem {
|
|
1386
|
+
id: string;
|
|
1387
|
+
name: string;
|
|
1388
|
+
description: string;
|
|
1389
|
+
scopeId: string;
|
|
1390
|
+
isDestructive: boolean;
|
|
1391
|
+
tags: string[];
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1280
1394
|
/**
|
|
1281
1395
|
* Tool with permission state.
|
|
1282
1396
|
*/
|
|
@@ -1404,25 +1518,14 @@ export declare class UaiToolPickerElement extends UaiToolPickerElement_base {
|
|
|
1404
1518
|
declare const UaiToolPickerElement_base: HTMLElementConstructor<UmbFormControlMixinElement<string[] | undefined>> & typeof UmbLitElement;
|
|
1405
1519
|
|
|
1406
1520
|
/**
|
|
1407
|
-
*
|
|
1521
|
+
* Represents a tool scope item.
|
|
1522
|
+
* @public
|
|
1408
1523
|
*/
|
|
1409
|
-
export declare
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
*/
|
|
1415
|
-
getToolScopes(): Promise<{
|
|
1416
|
-
data?: Array<ToolScopeItemResponseModel>;
|
|
1417
|
-
error?: unknown;
|
|
1418
|
-
}>;
|
|
1419
|
-
/**
|
|
1420
|
-
* Gets all registered tools.
|
|
1421
|
-
*/
|
|
1422
|
-
getTools(): Promise<{
|
|
1423
|
-
data?: Array<ToolItemResponseModel>;
|
|
1424
|
-
error?: unknown;
|
|
1425
|
-
}>;
|
|
1524
|
+
export declare interface UaiToolScope {
|
|
1525
|
+
id: string;
|
|
1526
|
+
icon: string;
|
|
1527
|
+
isDestructive: boolean;
|
|
1528
|
+
domain: string;
|
|
1426
1529
|
}
|
|
1427
1530
|
|
|
1428
1531
|
/**
|