@futdevpro/nts-dynamo 1.15.262 → 1.15.264
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/build/_collections/get-environment-settings.util.d.ts.map +1 -1
- package/build/_collections/get-environment-settings.util.js +4 -4
- package/build/_collections/get-environment-settings.util.js.map +1 -1
- package/build/_models/interfaces/environment-settings.interface.d.ts +9 -0
- package/build/_models/interfaces/environment-settings.interface.d.ts.map +1 -1
- package/build/_modules/media-gen/_collections/elevenlabs-region.util.d.ts +22 -0
- package/build/_modules/media-gen/_collections/elevenlabs-region.util.d.ts.map +1 -0
- package/build/_modules/media-gen/_collections/elevenlabs-region.util.js +49 -0
- package/build/_modules/media-gen/_collections/elevenlabs-region.util.js.map +1 -0
- package/build/_modules/media-gen/_models/elevenlabs-settings.interface.d.ts +18 -0
- package/build/_modules/media-gen/_models/elevenlabs-settings.interface.d.ts.map +1 -0
- package/build/_modules/media-gen/_models/elevenlabs-settings.interface.js +3 -0
- package/build/_modules/media-gen/_models/elevenlabs-settings.interface.js.map +1 -0
- package/build/_modules/media-gen/_models/leonardo-settings.interface.d.ts +19 -0
- package/build/_modules/media-gen/_models/leonardo-settings.interface.d.ts.map +1 -0
- package/build/_modules/media-gen/_models/leonardo-settings.interface.js +3 -0
- package/build/_modules/media-gen/_models/leonardo-settings.interface.js.map +1 -0
- package/build/_modules/media-gen/_services/elevenlabs-speak.control-service.d.ts +23 -0
- package/build/_modules/media-gen/_services/elevenlabs-speak.control-service.d.ts.map +1 -0
- package/build/_modules/media-gen/_services/elevenlabs-speak.control-service.js +58 -0
- package/build/_modules/media-gen/_services/elevenlabs-speak.control-service.js.map +1 -0
- package/build/_modules/media-gen/_services/elevenlabs-transcribe.control-service.d.ts +23 -0
- package/build/_modules/media-gen/_services/elevenlabs-transcribe.control-service.d.ts.map +1 -0
- package/build/_modules/media-gen/_services/elevenlabs-transcribe.control-service.js +61 -0
- package/build/_modules/media-gen/_services/elevenlabs-transcribe.control-service.js.map +1 -0
- package/build/_modules/media-gen/_services/elevenlabs.service-base.d.ts +33 -0
- package/build/_modules/media-gen/_services/elevenlabs.service-base.d.ts.map +1 -0
- package/build/_modules/media-gen/_services/elevenlabs.service-base.js +85 -0
- package/build/_modules/media-gen/_services/elevenlabs.service-base.js.map +1 -0
- package/build/_modules/media-gen/_services/leonardo-image.control-service.d.ts +47 -0
- package/build/_modules/media-gen/_services/leonardo-image.control-service.d.ts.map +1 -0
- package/build/_modules/media-gen/_services/leonardo-image.control-service.js +178 -0
- package/build/_modules/media-gen/_services/leonardo-image.control-service.js.map +1 -0
- package/build/_modules/media-gen/index.d.ts +7 -0
- package/build/_modules/media-gen/index.d.ts.map +1 -1
- package/build/_modules/media-gen/index.js +7 -0
- package/build/_modules/media-gen/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-environment-settings.util.d.ts","sourceRoot":"","sources":["../../src/_collections/get-environment-settings.util.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAC;AAElG,wBAAgB,6BAA6B,IAAI,0BAA0B,
|
|
1
|
+
{"version":3,"file":"get-environment-settings.util.d.ts","sourceRoot":"","sources":["../../src/_collections/get-environment-settings.util.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAC;AAElG,wBAAgB,6BAA6B,IAAI,0BAA0B,CA8C1E"}
|
|
@@ -29,11 +29,11 @@ function DyNTS_getEnvironment_settings() {
|
|
|
29
29
|
project: process.env.OPENAI_PROJECT,
|
|
30
30
|
ttsApiKey: process.env.OPENAI_TTS_API_KEY,
|
|
31
31
|
},
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
elevenLabs: {
|
|
33
|
+
apiKey: process.env.ELEVENLABS_API_KEY,
|
|
34
|
+
environment: process.env.ELEVENLABS_ENVIRONMENT,
|
|
34
35
|
},
|
|
35
|
-
|
|
36
|
-
clickup: {
|
|
36
|
+
/* clickup: {
|
|
37
37
|
apiKey: process.env.CLICKUP_API_KEY,
|
|
38
38
|
workspaceId: process.env.CLICKUP_WORKSPACE_ID,
|
|
39
39
|
spaceId: process.env.CLICKUP_SPACE_ID,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-environment-settings.util.js","sourceRoot":"","sources":["../../src/_collections/get-environment-settings.util.ts"],"names":[],"mappings":";;AAMA,
|
|
1
|
+
{"version":3,"file":"get-environment-settings.util.js","sourceRoot":"","sources":["../../src/_collections/get-environment-settings.util.ts"],"names":[],"mappings":";;AAMA,sEA8CC;;AApDD,uDAAiC;AAEjC,sDAAiG;AAIjG,SAAgB,6BAA6B;IAC3C,MAAM,CAAC,MAAM,EAAE,CAAC;IAEhB,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,iCAAoB,CAAC,KAAK,CAAC;IAE3G,GAAG,GAAG,GAAG,CAAC,iBAAiB,EAAE,CAAC;IAE9B,IAAI,CAAC,qCAAwB,CAAC,QAAQ,CAAC,GAA2B,CAAC,EAAE,CAAC;QACpE,qBAAQ,CAAC,KAAK,CAAC,yBAAyB,GAAG,8BAA8B,CAAC,CAAC;QAC3E,GAAG,GAAG,iCAAoB,CAAC,KAAK,CAAC;IACnC,CAAC;IAED,OAAO;QACL,WAAW,EAAE,qCAAwB,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,GAA2B,CAAC,CAAC,CAAC;YACvF,OAAO,CAAC,GAAG,CAAC,GAA2B,CAAC,CAAC;YACzC,iCAAoB,CAAC,KAAK;QAG5B,OAAO,EAAE;YACP,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB;YACrC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB;YACpC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB;YAC3C,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB;SAC9C;QAED,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS;QAExD,MAAM,EAAE;YACN,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;YAClC,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB;YAC7C,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;YACnC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB;SAC1C;QAED,UAAU,EAAE;YACV,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB;YACtC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB;SAChD;QAED;;;;;aAKK;KACN,CAAC;AACJ,CAAC"}
|
|
@@ -31,5 +31,14 @@ export interface DyNTS_Environment_Settings {
|
|
|
31
31
|
project: string;
|
|
32
32
|
ttsApiKey: string;
|
|
33
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* this is the elevenlabs settings of the system
|
|
36
|
+
*/
|
|
37
|
+
elevenLabs?: {
|
|
38
|
+
/** `ELEVENLABS_API_KEY` */
|
|
39
|
+
apiKey: string;
|
|
40
|
+
/** `ELEVENLABS_ENVIRONMENT`: global (default) | us | eu-residency | india-residency | singapore-residency */
|
|
41
|
+
environment?: string;
|
|
42
|
+
};
|
|
34
43
|
}
|
|
35
44
|
//# sourceMappingURL=environment-settings.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-settings.interface.d.ts","sourceRoot":"","sources":["../../../src/_models/interfaces/environment-settings.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAI7D,MAAM,WAAW,0BAA0B;IACzC;;;;;;;OAOG;IACH,WAAW,EAAE,oBAAoB,CAAC;IAElC;;OAEG;IACH,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAEF;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"environment-settings.interface.d.ts","sourceRoot":"","sources":["../../../src/_models/interfaces/environment-settings.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAI7D,MAAM,WAAW,0BAA0B;IACzC;;;;;;;OAOG;IACH,WAAW,EAAE,oBAAoB,CAAC;IAElC;;OAEG;IACH,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAEF;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAEF;;OAEG;IACH,UAAU,CAAC,EAAE;QACX,2BAA2B;QAC3B,MAAM,EAAE,MAAM,CAAC;QACf,6GAA6G;QAC7G,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CAYH"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** The ElevenLabs environments the provider documents. Anything else is refused rather than guessed at. */
|
|
2
|
+
export type DyNTS_ElevenLabs_Environment = 'global' | 'us' | 'eu-residency' | 'india-residency' | 'singapore-residency';
|
|
3
|
+
/**
|
|
4
|
+
* ElevenLabs region resolution: the environment name → the API host.
|
|
5
|
+
*
|
|
6
|
+
* The host table is the one `dynamo-cli` already runs in production (`DyCLI_MAP_ElevenLabsRegion_Util`),
|
|
7
|
+
* carried here unchanged, because the engine layer needs it too. A residency environment exists so the audio
|
|
8
|
+
* never leaves the region - so an unknown environment is an ERROR, never a silent fall back to the global host.
|
|
9
|
+
*/
|
|
10
|
+
export declare class DyNTS_ElevenLabsRegion_Util {
|
|
11
|
+
/** Host per environment. */
|
|
12
|
+
private static readonly baseUrls;
|
|
13
|
+
/**
|
|
14
|
+
* Accepts only the documented environments; `undefined` means `global`.
|
|
15
|
+
*
|
|
16
|
+
* @param value The raw value, typically `process.env.ELEVENLABS_ENVIRONMENT`.
|
|
17
|
+
*/
|
|
18
|
+
static resolveEnvironment(value: string | undefined): DyNTS_ElevenLabs_Environment;
|
|
19
|
+
/** The API host of one environment. */
|
|
20
|
+
static getBaseUrl(environment: DyNTS_ElevenLabs_Environment): string;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=elevenlabs-region.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-region.util.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_collections/elevenlabs-region.util.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,MAAM,MAAM,4BAA4B,GACpC,QAAQ,GACR,IAAI,GACJ,cAAc,GACd,iBAAiB,GACjB,qBAAqB,CAAC;AAE1B;;;;;;GAMG;AACH,qBAAa,2BAA2B;IAEtC,4BAA4B;IAC5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAM9B;IAEF;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,4BAA4B;IAqBlF,uCAAuC;IACvC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,4BAA4B,GAAG,MAAM;CAGrE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_ElevenLabsRegion_Util = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* ElevenLabs region resolution: the environment name → the API host.
|
|
6
|
+
*
|
|
7
|
+
* The host table is the one `dynamo-cli` already runs in production (`DyCLI_MAP_ElevenLabsRegion_Util`),
|
|
8
|
+
* carried here unchanged, because the engine layer needs it too. A residency environment exists so the audio
|
|
9
|
+
* never leaves the region - so an unknown environment is an ERROR, never a silent fall back to the global host.
|
|
10
|
+
*/
|
|
11
|
+
class DyNTS_ElevenLabsRegion_Util {
|
|
12
|
+
/** Host per environment. */
|
|
13
|
+
static baseUrls = {
|
|
14
|
+
global: 'https://api.elevenlabs.io',
|
|
15
|
+
us: 'https://api.us.elevenlabs.io',
|
|
16
|
+
'eu-residency': 'https://api.eu.residency.elevenlabs.io',
|
|
17
|
+
'india-residency': 'https://api.in.residency.elevenlabs.io',
|
|
18
|
+
'singapore-residency': 'https://api.sg.residency.elevenlabs.io',
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Accepts only the documented environments; `undefined` means `global`.
|
|
22
|
+
*
|
|
23
|
+
* @param value The raw value, typically `process.env.ELEVENLABS_ENVIRONMENT`.
|
|
24
|
+
*/
|
|
25
|
+
static resolveEnvironment(value) {
|
|
26
|
+
switch (value) {
|
|
27
|
+
case undefined:
|
|
28
|
+
case 'global':
|
|
29
|
+
return 'global';
|
|
30
|
+
case 'us':
|
|
31
|
+
return 'us';
|
|
32
|
+
case 'eu-residency':
|
|
33
|
+
return 'eu-residency';
|
|
34
|
+
case 'india-residency':
|
|
35
|
+
return 'india-residency';
|
|
36
|
+
case 'singapore-residency':
|
|
37
|
+
return 'singapore-residency';
|
|
38
|
+
default:
|
|
39
|
+
throw new Error(`DyNTS_ElevenLabsRegion_Util: unsupported ElevenLabs environment '${value}'. `
|
|
40
|
+
+ `Supported: ${Object.keys(DyNTS_ElevenLabsRegion_Util.baseUrls).join(', ')}.`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** The API host of one environment. */
|
|
44
|
+
static getBaseUrl(environment) {
|
|
45
|
+
return DyNTS_ElevenLabsRegion_Util.baseUrls[environment];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.DyNTS_ElevenLabsRegion_Util = DyNTS_ElevenLabsRegion_Util;
|
|
49
|
+
//# sourceMappingURL=elevenlabs-region.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-region.util.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_collections/elevenlabs-region.util.ts"],"names":[],"mappings":";;;AAQA;;;;;;GAMG;AACH,MAAa,2BAA2B;IAEtC,4BAA4B;IACpB,MAAM,CAAU,QAAQ,GAAiD;QAC/E,MAAM,EAAE,2BAA2B;QACnC,EAAE,EAAE,8BAA8B;QAClC,cAAc,EAAE,wCAAwC;QACxD,iBAAiB,EAAE,wCAAwC;QAC3D,qBAAqB,EAAE,wCAAwC;KAChE,CAAC;IAEF;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,KAAyB;QACjD,QAAQ,KAAK,EAAE,CAAC;YACd,KAAK,SAAS,CAAC;YACf,KAAK,QAAQ;gBACX,OAAO,QAAQ,CAAC;YAClB,KAAK,IAAI;gBACP,OAAO,IAAI,CAAC;YACd,KAAK,cAAc;gBACjB,OAAO,cAAc,CAAC;YACxB,KAAK,iBAAiB;gBACpB,OAAO,iBAAiB,CAAC;YAC3B,KAAK,qBAAqB;gBACxB,OAAO,qBAAqB,CAAC;YAC/B;gBACE,MAAM,IAAI,KAAK,CACb,oEAAoE,KAAK,KAAK;sBAC5E,cAAc,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAChF,CAAC;QACN,CAAC;IACH,CAAC;IAED,uCAAuC;IACvC,MAAM,CAAC,UAAU,CAAC,WAAyC;QACzD,OAAO,2BAA2B,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC3D,CAAC;;AAxCH,kEAyCC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The HTTP call an ElevenLabs adapter makes - injectable, so specs assert the request without a network or a key. */
|
|
2
|
+
export type DyNTS_ElevenLabs_Fetch = (url: string, init: RequestInit) => Promise<Response>;
|
|
3
|
+
/**
|
|
4
|
+
* Settings of the ElevenLabs adapters. Every field is optional; what is left out is read from the environment
|
|
5
|
+
* AT CALL TIME, so a rotated key or a changed region takes effect without rebuilding the adapter.
|
|
6
|
+
*/
|
|
7
|
+
export interface DyNTS_ElevenLabs_Settings {
|
|
8
|
+
/** API key. Falls back to `ELEVENLABS_API_KEY`. */
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Environment: `global` (default), `us`, `eu-residency`, `india-residency`, `singapore-residency`.
|
|
12
|
+
* Falls back to `ELEVENLABS_ENVIRONMENT`. An unknown value is refused, never mapped to the global host.
|
|
13
|
+
*/
|
|
14
|
+
environment?: string;
|
|
15
|
+
/** HTTP implementation. Defaults to the global `fetch`. */
|
|
16
|
+
fetchImpl?: DyNTS_ElevenLabs_Fetch;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=elevenlabs-settings.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-settings.interface.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_models/elevenlabs-settings.interface.ts"],"names":[],"mappings":"AAAA,sHAAsH;AACtH,MAAM,MAAM,sBAAsB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE3F;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-settings.interface.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_models/elevenlabs-settings.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** The HTTP call the Leonardo adapter makes - injectable, so specs assert the requests without a network or a key. */
|
|
2
|
+
export type DyNTS_Leonardo_Fetch = (url: string, init: RequestInit) => Promise<Response>;
|
|
3
|
+
/**
|
|
4
|
+
* Settings of the Leonardo image adapter. Every field is optional; what is left out falls back to the environment
|
|
5
|
+
* (read at call time) or to the defaults the master-prompter donor runs in production.
|
|
6
|
+
*/
|
|
7
|
+
export interface DyNTS_Leonardo_Settings {
|
|
8
|
+
/** API key. Falls back to `LEONARDO_API_KEY`. */
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
/** HTTP implementation. Defaults to the global `fetch`. */
|
|
11
|
+
fetchImpl?: DyNTS_Leonardo_Fetch;
|
|
12
|
+
/** Wait between two status checks. Default 3000 ms (the donor's production value). */
|
|
13
|
+
pollIntervalMs?: number;
|
|
14
|
+
/** Give up on a generation after this long. Default 15 minutes (the donor's production value). */
|
|
15
|
+
timeoutMs?: number;
|
|
16
|
+
/** The wait itself - injectable, so specs do not sleep. Defaults to a timer. */
|
|
17
|
+
sleep?: (ms: number) => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=leonardo-settings.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leonardo-settings.interface.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_models/leonardo-settings.interface.ts"],"names":[],"mappings":"AAAA,sHAAsH;AACtH,MAAM,MAAM,oBAAoB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,sFAAsF;IACtF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kGAAkG;IAClG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leonardo-settings.interface.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_models/leonardo-settings.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DyFM_AI_Speech_Request, DyFM_AI_Speech_Response } from '@futdevpro/fsm-dynamo/ai';
|
|
2
|
+
import { DyNTS_ElevenLabs_ServiceBase } from './elevenlabs.service-base';
|
|
3
|
+
import { DyNTS_MediaGen_Operation } from '../_models/media-gen-operation.type';
|
|
4
|
+
/**
|
|
5
|
+
* ElevenLabs text-to-speech adapter.
|
|
6
|
+
*
|
|
7
|
+
* Request shape verified against the provider's API reference (2026-09-14): `POST /v1/text-to-speech/{voice_id}`,
|
|
8
|
+
* `xi-api-key` header, `output_format` query parameter, JSON body `{ text, model_id }`, binary audio response.
|
|
9
|
+
* The same shape `dc media-speech` already sends.
|
|
10
|
+
*/
|
|
11
|
+
export declare class DyNTS_ElevenLabs_Speak_ControlService extends DyNTS_ElevenLabs_ServiceBase<DyFM_AI_Speech_Request, DyFM_AI_Speech_Response> {
|
|
12
|
+
/** The provider's documented default output format (API reference, 2026-09-14). */
|
|
13
|
+
static readonly defaultFormat: string;
|
|
14
|
+
readonly operations: readonly DyNTS_MediaGen_Operation[];
|
|
15
|
+
static getInstance(): DyNTS_ElevenLabs_Speak_ControlService;
|
|
16
|
+
/**
|
|
17
|
+
* Speaks `request.text` with `request.voice`, and returns the audio as base64 with the media type the provider
|
|
18
|
+
* reported. A voice is REQUIRED: the provider has no meaningful default, and a silently picked one would be a
|
|
19
|
+
* choice the caller never made.
|
|
20
|
+
*/
|
|
21
|
+
generate(operation: DyNTS_MediaGen_Operation, request: DyFM_AI_Speech_Request, issuer: string): Promise<DyFM_AI_Speech_Response>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=elevenlabs-speak.control-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-speak.control-service.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/elevenlabs-speak.control-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAE3F,OAAO,EAA+B,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACtG,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E;;;;;;GAMG;AACH,qBAAa,qCACX,SAAQ,4BAA4B,CAAC,sBAAsB,EAAE,uBAAuB,CAAC;IAErF,mFAAmF;IACnF,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAmB;IAExD,QAAQ,CAAC,UAAU,EAAE,SAAS,wBAAwB,EAAE,CAAwB;IAEhF,MAAM,CAAC,WAAW,IAAI,qCAAqC;IAI3D;;;;OAIG;IACG,QAAQ,CACZ,SAAS,EAAE,wBAAwB,EACnC,OAAO,EAAE,sBAAsB,EAC/B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,uBAAuB,CAAC;CAuCpC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_ElevenLabs_Speak_ControlService = void 0;
|
|
4
|
+
const elevenlabs_service_base_1 = require("./elevenlabs.service-base");
|
|
5
|
+
/**
|
|
6
|
+
* ElevenLabs text-to-speech adapter.
|
|
7
|
+
*
|
|
8
|
+
* Request shape verified against the provider's API reference (2026-09-14): `POST /v1/text-to-speech/{voice_id}`,
|
|
9
|
+
* `xi-api-key` header, `output_format` query parameter, JSON body `{ text, model_id }`, binary audio response.
|
|
10
|
+
* The same shape `dc media-speech` already sends.
|
|
11
|
+
*/
|
|
12
|
+
class DyNTS_ElevenLabs_Speak_ControlService extends elevenlabs_service_base_1.DyNTS_ElevenLabs_ServiceBase {
|
|
13
|
+
/** The provider's documented default output format (API reference, 2026-09-14). */
|
|
14
|
+
static defaultFormat = 'mp3_44100_128';
|
|
15
|
+
operations = ['text-to-speech'];
|
|
16
|
+
static getInstance() {
|
|
17
|
+
return DyNTS_ElevenLabs_Speak_ControlService.getSingletonInstance();
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Speaks `request.text` with `request.voice`, and returns the audio as base64 with the media type the provider
|
|
21
|
+
* reported. A voice is REQUIRED: the provider has no meaningful default, and a silently picked one would be a
|
|
22
|
+
* choice the caller never made.
|
|
23
|
+
*/
|
|
24
|
+
async generate(operation, request, issuer) {
|
|
25
|
+
this.assertOperation(operation, issuer);
|
|
26
|
+
if (!request.text) {
|
|
27
|
+
throw this.invalidRequest('The text to speak is empty.', issuer);
|
|
28
|
+
}
|
|
29
|
+
if (!request.voice) {
|
|
30
|
+
throw this.invalidRequest('A voice id is required: the provider has no default voice.', issuer);
|
|
31
|
+
}
|
|
32
|
+
const connection = this.connection(issuer);
|
|
33
|
+
const format = request.format ?? DyNTS_ElevenLabs_Speak_ControlService.defaultFormat;
|
|
34
|
+
const url = `${connection.baseUrl}/v1/text-to-speech/${encodeURIComponent(request.voice)}`
|
|
35
|
+
+ `?output_format=${encodeURIComponent(format)}`;
|
|
36
|
+
const response = await connection.doFetch(url, {
|
|
37
|
+
method: 'POST',
|
|
38
|
+
headers: { 'Content-Type': 'application/json', 'xi-api-key': connection.apiKey },
|
|
39
|
+
body: JSON.stringify({ text: request.text, model_id: request.model }),
|
|
40
|
+
});
|
|
41
|
+
await this.failOnHttpError(response, url, issuer);
|
|
42
|
+
const audio = Buffer.from(await response.arrayBuffer());
|
|
43
|
+
if (!audio.length) {
|
|
44
|
+
throw this.invalidRequest(`ElevenLabs returned an empty audio body (${url}).`, issuer);
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
provider: this.provider,
|
|
48
|
+
model: request.model,
|
|
49
|
+
audio: {
|
|
50
|
+
mimeType: response.headers.get('content-type') ?? 'application/octet-stream',
|
|
51
|
+
base64: audio.toString('base64'),
|
|
52
|
+
},
|
|
53
|
+
format: format,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.DyNTS_ElevenLabs_Speak_ControlService = DyNTS_ElevenLabs_Speak_ControlService;
|
|
58
|
+
//# sourceMappingURL=elevenlabs-speak.control-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-speak.control-service.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/elevenlabs-speak.control-service.ts"],"names":[],"mappings":";;;AAEA,uEAAsG;AAGtG;;;;;;GAMG;AACH,MAAa,qCACX,SAAQ,sDAA6E;IAErF,mFAAmF;IACnF,MAAM,CAAU,aAAa,GAAW,eAAe,CAAC;IAE/C,UAAU,GAAwC,CAAE,gBAAgB,CAAE,CAAC;IAEhF,MAAM,CAAC,WAAW;QAChB,OAAO,qCAAqC,CAAC,oBAAoB,EAAE,CAAC;IACtE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ,CACZ,SAAmC,EACnC,OAA+B,EAC/B,MAAc;QAEd,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAExC,IAAI,CAAC,OAAO,C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AO,CAAC,KAAK;YACpB,KAAK,EAAE;gBACL,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,0BAA0B;gBAC5E,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC;aACjC;YACD,MAAM,EAAE,MAAM;SACf,CAAC;IACJ,CAAC;;AA3DH,sFA4DC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DyFM_AI_Transcription_Request, DyFM_AI_Transcription_Response } from '@futdevpro/fsm-dynamo/ai';
|
|
2
|
+
import { DyNTS_ElevenLabs_ServiceBase } from './elevenlabs.service-base';
|
|
3
|
+
import { DyNTS_MediaGen_Operation } from '../_models/media-gen-operation.type';
|
|
4
|
+
/**
|
|
5
|
+
* ElevenLabs speech-to-text adapter.
|
|
6
|
+
*
|
|
7
|
+
* Request shape verified against the provider's API reference (2026-09-14): `POST /v1/speech-to-text`,
|
|
8
|
+
* `xi-api-key` header, `multipart/form-data` with the required `model_id`, the audio as `file`, and an optional
|
|
9
|
+
* `language_code`; the JSON response carries `text` and `language_code`.
|
|
10
|
+
* ⚠️ `dc media-speech` deliberately did not build this path, because no working call existed to copy - this
|
|
11
|
+
* adapter is built from the reference and exercised by specs; no live call has been made yet.
|
|
12
|
+
*/
|
|
13
|
+
export declare class DyNTS_ElevenLabs_Transcribe_ControlService extends DyNTS_ElevenLabs_ServiceBase<DyFM_AI_Transcription_Request, DyFM_AI_Transcription_Response> {
|
|
14
|
+
readonly operations: readonly DyNTS_MediaGen_Operation[];
|
|
15
|
+
static getInstance(): DyNTS_ElevenLabs_Transcribe_ControlService;
|
|
16
|
+
/** Reads a field of an unknown JSON value without assuming its shape. */
|
|
17
|
+
private static readField;
|
|
18
|
+
/**
|
|
19
|
+
* Transcribes `request.audio`, and returns the transcript with the language the provider reported.
|
|
20
|
+
*/
|
|
21
|
+
generate(operation: DyNTS_MediaGen_Operation, request: DyFM_AI_Transcription_Request, issuer: string): Promise<DyFM_AI_Transcription_Response>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=elevenlabs-transcribe.control-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-transcribe.control-service.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/elevenlabs-transcribe.control-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAEzG,OAAO,EAA+B,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACtG,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E;;;;;;;;GAQG;AACH,qBAAa,0CACX,SAAQ,4BAA4B,CAAC,6BAA6B,EAAE,8BAA8B,CAAC;IAEnG,QAAQ,CAAC,UAAU,EAAE,SAAS,wBAAwB,EAAE,CAAwB;IAEhF,MAAM,CAAC,WAAW,IAAI,0CAA0C;IAIhE,yEAAyE;IACzE,OAAO,CAAC,MAAM,CAAC,SAAS;IAIxB;;OAEG;IACG,QAAQ,CACZ,SAAS,EAAE,wBAAwB,EACnC,OAAO,EAAE,6BAA6B,EACtC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,8BAA8B,CAAC;CA8C3C"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_ElevenLabs_Transcribe_ControlService = void 0;
|
|
4
|
+
const elevenlabs_service_base_1 = require("./elevenlabs.service-base");
|
|
5
|
+
/**
|
|
6
|
+
* ElevenLabs speech-to-text adapter.
|
|
7
|
+
*
|
|
8
|
+
* Request shape verified against the provider's API reference (2026-09-14): `POST /v1/speech-to-text`,
|
|
9
|
+
* `xi-api-key` header, `multipart/form-data` with the required `model_id`, the audio as `file`, and an optional
|
|
10
|
+
* `language_code`; the JSON response carries `text` and `language_code`.
|
|
11
|
+
* ⚠️ `dc media-speech` deliberately did not build this path, because no working call existed to copy - this
|
|
12
|
+
* adapter is built from the reference and exercised by specs; no live call has been made yet.
|
|
13
|
+
*/
|
|
14
|
+
class DyNTS_ElevenLabs_Transcribe_ControlService extends elevenlabs_service_base_1.DyNTS_ElevenLabs_ServiceBase {
|
|
15
|
+
operations = ['speech-to-text'];
|
|
16
|
+
static getInstance() {
|
|
17
|
+
return DyNTS_ElevenLabs_Transcribe_ControlService.getSingletonInstance();
|
|
18
|
+
}
|
|
19
|
+
/** Reads a field of an unknown JSON value without assuming its shape. */
|
|
20
|
+
static readField(json, key) {
|
|
21
|
+
return json !== null && typeof json === 'object' ? Reflect.get(json, key) : undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Transcribes `request.audio`, and returns the transcript with the language the provider reported.
|
|
25
|
+
*/
|
|
26
|
+
async generate(operation, request, issuer) {
|
|
27
|
+
this.assertOperation(operation, issuer);
|
|
28
|
+
if (!request.audio?.base64) {
|
|
29
|
+
throw this.invalidRequest('The audio to transcribe is empty.', issuer);
|
|
30
|
+
}
|
|
31
|
+
const connection = this.connection(issuer);
|
|
32
|
+
const url = `${connection.baseUrl}/v1/speech-to-text`;
|
|
33
|
+
const form = new FormData();
|
|
34
|
+
form.append('model_id', request.model);
|
|
35
|
+
form.append('file', new Blob([new Uint8Array(Buffer.from(request.audio.base64, 'base64'))], { type: request.audio.mimeType }), request.audio.name ?? 'audio');
|
|
36
|
+
if (request.language) {
|
|
37
|
+
form.append('language_code', request.language);
|
|
38
|
+
}
|
|
39
|
+
const response = await connection.doFetch(url, {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
headers: { 'xi-api-key': connection.apiKey },
|
|
42
|
+
body: form,
|
|
43
|
+
});
|
|
44
|
+
await this.failOnHttpError(response, url, issuer);
|
|
45
|
+
const json = await response.json();
|
|
46
|
+
const text = DyNTS_ElevenLabs_Transcribe_ControlService.readField(json, 'text');
|
|
47
|
+
const language = DyNTS_ElevenLabs_Transcribe_ControlService.readField(json, 'language_code');
|
|
48
|
+
if (typeof text !== 'string') {
|
|
49
|
+
throw this.invalidRequest(`ElevenLabs returned no transcript text (${url}).`, issuer);
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
provider: this.provider,
|
|
53
|
+
model: request.model,
|
|
54
|
+
text: text,
|
|
55
|
+
...(typeof language === 'string' ? { language: language } : {}),
|
|
56
|
+
rawResponse: json,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.DyNTS_ElevenLabs_Transcribe_ControlService = DyNTS_ElevenLabs_Transcribe_ControlService;
|
|
61
|
+
//# sourceMappingURL=elevenlabs-transcribe.control-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-transcribe.control-service.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/elevenlabs-transcribe.control-service.ts"],"names":[],"mappings":";;;AAEA,uEAAsG;AAGtG;;;;;;;;GAQG;AACH,MAAa,0CACX,SAAQ,sDAA2F;IAE1F,UAAU,GAAwC,CAAE,gBAAgB,CAAE,CAAC;IAEhF,MAAM,CAAC,WAAW;QAChB,OAAO,0CAA0C,CAAC,oBAAoB,EAAE,CAAC;IAC3E,CAAC;IAED,yEAAyE;IACjE,MAAM,CAAC,SAAS,CAAC,IAAa,EAAE,GAAW;QACjD,OAAO,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACxF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CACZ,SAAmC,EACnC,OAAsC,EACtC,MAAc;QAEd,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAExC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;YAC3B,MAAM,IAAI,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AAC;QAEtG,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,MAAM,IAAI,CAAC,cAAc,CAAC,2CAA2C,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;QACxF,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,IAAI,EAAE,IAAI;YACV,GAAG,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/D,WAAW,EAAE,IAAI;SAClB,CAAC;IACJ,CAAC;CACF;AAnED,gGAmEC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DyFM_Error } from '@futdevpro/fsm-dynamo';
|
|
2
|
+
import { DyNTS_ElevenLabs_Fetch, DyNTS_ElevenLabs_Settings } from '../_models/elevenlabs-settings.interface';
|
|
3
|
+
import { DyNTS_MediaGen_Operation } from '../_models/media-gen-operation.type';
|
|
4
|
+
import { DyNTS_MediaGen_ServiceBase } from './media-gen.service-base';
|
|
5
|
+
/** What one ElevenLabs call needs, resolved at call time. */
|
|
6
|
+
export interface DyNTS_ElevenLabs_Connection {
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
apiKey: string;
|
|
9
|
+
doFetch: DyNTS_ElevenLabs_Fetch;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Shared part of the ElevenLabs adapters: connection resolution and HTTP error reporting.
|
|
13
|
+
*
|
|
14
|
+
* Every refusal happens BEFORE the paid call: an unknown environment, a missing key, an operation the adapter
|
|
15
|
+
* does not serve. The key travels only in the `xi-api-key` header, so the URLs recorded in errors carry no secret.
|
|
16
|
+
*/
|
|
17
|
+
export declare abstract class DyNTS_ElevenLabs_ServiceBase<T_Request, T_Response> extends DyNTS_MediaGen_ServiceBase<T_Request, T_Response> {
|
|
18
|
+
readonly provider: string;
|
|
19
|
+
protected readonly settings: DyNTS_ElevenLabs_Settings;
|
|
20
|
+
constructor(settings?: DyNTS_ElevenLabs_Settings);
|
|
21
|
+
/** Refuses an operation this adapter does not declare. */
|
|
22
|
+
protected assertOperation(operation: DyNTS_MediaGen_Operation, issuer: string): void;
|
|
23
|
+
/** Resolves the host, the key and the HTTP implementation for one call. */
|
|
24
|
+
protected connection(issuer: string): DyNTS_ElevenLabs_Connection;
|
|
25
|
+
/**
|
|
26
|
+
* Throws a detailed error for a non-2xx response. A 401 is named: its repeatedly hit cause is a key ID or
|
|
27
|
+
* a hint pasted instead of the full secret, which looks like a valid credential.
|
|
28
|
+
*/
|
|
29
|
+
protected failOnHttpError(response: Response, url: string, issuer: string): Promise<void>;
|
|
30
|
+
/** A refusal of the caller's request, reported with this adapter's error settings. */
|
|
31
|
+
protected invalidRequest(message: string, issuer: string): DyFM_Error;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=elevenlabs.service-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs.service-base.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/elevenlabs.service-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAInD,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC7G,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEtE,6DAA6D;AAC7D,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,sBAAsB,CAAC;CACjC;AAED;;;;;GAKG;AACH,8BAAsB,4BAA4B,CAAC,SAAS,EAAE,UAAU,CACtE,SAAQ,0BAA0B,CAAC,SAAS,EAAE,UAAU,CAAC;IAEzD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAgB;IAEzC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,CAAC;gBAE3C,QAAQ,GAAE,yBAA8B;IAKpD,0DAA0D;IAC1D,SAAS,CAAC,eAAe,CAAC,SAAS,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAepF,2EAA2E;IAC3E,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,2BAA2B;IAkCjE;;;OAGG;cACa,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwB/F,sFAAsF;IACtF,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU;CAMtE"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_ElevenLabs_ServiceBase = void 0;
|
|
4
|
+
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
5
|
+
const global_settings_const_1 = require("../../../_collections/global-settings.const");
|
|
6
|
+
const elevenlabs_region_util_1 = require("../_collections/elevenlabs-region.util");
|
|
7
|
+
const media_gen_service_base_1 = require("./media-gen.service-base");
|
|
8
|
+
/**
|
|
9
|
+
* Shared part of the ElevenLabs adapters: connection resolution and HTTP error reporting.
|
|
10
|
+
*
|
|
11
|
+
* Every refusal happens BEFORE the paid call: an unknown environment, a missing key, an operation the adapter
|
|
12
|
+
* does not serve. The key travels only in the `xi-api-key` header, so the URLs recorded in errors carry no secret.
|
|
13
|
+
*/
|
|
14
|
+
class DyNTS_ElevenLabs_ServiceBase extends media_gen_service_base_1.DyNTS_MediaGen_ServiceBase {
|
|
15
|
+
provider = 'elevenlabs';
|
|
16
|
+
settings;
|
|
17
|
+
constructor(settings = {}) {
|
|
18
|
+
super();
|
|
19
|
+
this.settings = settings;
|
|
20
|
+
}
|
|
21
|
+
/** Refuses an operation this adapter does not declare. */
|
|
22
|
+
assertOperation(operation, issuer) {
|
|
23
|
+
if (!this.operations.includes(operation)) {
|
|
24
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
25
|
+
...this.getDefaultErrorSettings('generate', new Error(`${this.constructor.name} does not serve '${operation}'. It serves: ${this.operations.join(', ')}.`), issuer),
|
|
26
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-MG-EL-OP`,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** Resolves the host, the key and the HTTP implementation for one call. */
|
|
31
|
+
connection(issuer) {
|
|
32
|
+
let environment;
|
|
33
|
+
try {
|
|
34
|
+
environment = elevenlabs_region_util_1.DyNTS_ElevenLabsRegion_Util.resolveEnvironment(this.settings.environment ?? process.env.ELEVENLABS_ENVIRONMENT);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
38
|
+
...this.getDefaultErrorSettings('connection', error, issuer),
|
|
39
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-MG-EL-ENV`,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const apiKey = this.settings.apiKey ?? process.env.ELEVENLABS_API_KEY;
|
|
43
|
+
if (!apiKey) {
|
|
44
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
45
|
+
...this.getDefaultErrorSettings('connection', new Error('Missing ElevenLabs API key: pass settings.apiKey or set ELEVENLABS_API_KEY.'), issuer),
|
|
46
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-MG-EL-KEY`,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
baseUrl: elevenlabs_region_util_1.DyNTS_ElevenLabsRegion_Util.getBaseUrl(environment),
|
|
51
|
+
apiKey: apiKey,
|
|
52
|
+
doFetch: this.settings.fetchImpl ?? ((url, init) => fetch(url, init)),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Throws a detailed error for a non-2xx response. A 401 is named: its repeatedly hit cause is a key ID or
|
|
57
|
+
* a hint pasted instead of the full secret, which looks like a valid credential.
|
|
58
|
+
*/
|
|
59
|
+
async failOnHttpError(response, url, issuer) {
|
|
60
|
+
if (response.ok) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const detail = await response.text().catch(() => '');
|
|
64
|
+
const hint = response.status === 401
|
|
65
|
+
? ' (invalid_api_key - use the full secret shown once at key creation, not a key ID or hint)'
|
|
66
|
+
: '';
|
|
67
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
68
|
+
...this.getDefaultErrorSettings('generate', new Error(`ElevenLabs HTTP ${response.status}${hint}: ${detail.slice(0, 500)}`), issuer),
|
|
69
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-MG-EL-HTTP`,
|
|
70
|
+
additionalContent: {
|
|
71
|
+
status: response.status,
|
|
72
|
+
url: url,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/** A refusal of the caller's request, reported with this adapter's error settings. */
|
|
77
|
+
invalidRequest(message, issuer) {
|
|
78
|
+
return new fsm_dynamo_1.DyFM_Error({
|
|
79
|
+
...this.getDefaultErrorSettings('generate', new Error(message), issuer),
|
|
80
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-MG-EL-REQ`,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.DyNTS_ElevenLabs_ServiceBase = DyNTS_ElevenLabs_ServiceBase;
|
|
85
|
+
//# sourceMappingURL=elevenlabs.service-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs.service-base.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/elevenlabs.service-base.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AAEnD,uFAAoF;AACpF,mFAAmH;AAGnH,qEAAsE;AAStE;;;;;GAKG;AACH,MAAsB,4BACpB,SAAQ,mDAAiD;IAEhD,QAAQ,GAAW,YAAY,CAAC;IAEtB,QAAQ,CAA4B;IAEvD,YAAY,WAAsC,EAAE;QAClD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,0DAA0D;IAChD,eAAe,CAAC,SAAmC,EAAE,MAAc;QAC3E,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,uBAAU,CAAC;gBACnB,GAAG,IAAI,CAAC,uBAAuB,CAC7B,UAAU,EACV,IAAI,KAAK,CACP,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,oBAAoB,SAAS,iBAAiB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACpG,EACD,MAAM,CACP;gBACD,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,iBAAiB;aACzE,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,2EAA2E;IACjE,UAAU,CAAC,MAAc;QACjC,IAAI,WAAyC,CAAC;QAE9C,IAAI,CAAC;YACH,WAAW,GAAG,oDAA2B,CAAC,kBAAkB,CAC1D,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAChE,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,uBAAU,CAAC;gBACnB,GAAG,IAAI,CAAC,uBAAuB,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC;gBAC5D,SAAS,EAAE,GAAG,6CA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C,EAAE,CAAC,EAC/E,MAAM,CACP;YACD,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,mBAAmB;YAC1E,iBAAiB,EAAE;gBACjB,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,GAAG,EAAE,GAAG;aACT;SACF,CAAC,CAAC;IACL,CAAC;IAED,sFAAsF;IAC5E,cAAc,CAAC,OAAe,EAAE,MAAc;QACtD,OAAO,IAAI,uBAAU,CAAC;YACpB,GAAG,IAAI,CAAC,uBAAuB,CAAC,UAAU,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;YACvE,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,kBAAkB;SAC1E,CAAC,CAAC;IACL,CAAC;CACF;AAlGD,oEAkGC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DyFM_AI_Image_Response, DyFM_AI_ImageGeneration_Request } from '@futdevpro/fsm-dynamo/ai';
|
|
2
|
+
import { DyNTS_Leonardo_Settings } from '../_models/leonardo-settings.interface';
|
|
3
|
+
import { DyNTS_MediaGen_Operation } from '../_models/media-gen-operation.type';
|
|
4
|
+
import { DyNTS_MediaGen_ServiceBase } from './media-gen.service-base';
|
|
5
|
+
/**
|
|
6
|
+
* Leonardo text-to-image adapter (REST API v1).
|
|
7
|
+
*
|
|
8
|
+
* The request and response shapes are measured, not assumed: base URL and bearer auth from the master-prompter
|
|
9
|
+
* donor that runs in production, the raw field names from the official `@leonardo-ai/sdk` 4.18.1 schemas
|
|
10
|
+
* (`POST /generations` with `modelId`, `prompt`, `num_images`, `width`, `height`, `public` → `sdGenerationJob.
|
|
11
|
+
* generationId`; `GET /generations/{id}` → `generations_by_pk.status` PENDING | COMPLETE | FAILED and
|
|
12
|
+
* `generated_images[].url`). ⚠️ Leonardo also documents a v2 API; this adapter targets v1, like the donor.
|
|
13
|
+
*
|
|
14
|
+
* 🔴 PRIVATE GENERATION IS ENFORCED (K-8): Leonardo takes a licence to content marked public, and its API reference
|
|
15
|
+
* does not state the default of `public` - so every request sends `public: false`, and nothing a caller passes
|
|
16
|
+
* can change that.
|
|
17
|
+
*
|
|
18
|
+
* One image per call: the POJO has no count, and the SDK default (4) would silently quadruple the cost.
|
|
19
|
+
* Knobs Leonardo v1 has no equivalent for (`quality`, `background`, `format`) are refused, not ignored.
|
|
20
|
+
*/
|
|
21
|
+
export declare class DyNTS_Leonardo_Image_ControlService extends DyNTS_MediaGen_ServiceBase<DyFM_AI_ImageGeneration_Request, DyFM_AI_Image_Response> {
|
|
22
|
+
static readonly baseUrl: string;
|
|
23
|
+
static readonly defaultPollIntervalMs: number;
|
|
24
|
+
static readonly defaultTimeoutMs: number;
|
|
25
|
+
readonly provider: string;
|
|
26
|
+
readonly operations: readonly DyNTS_MediaGen_Operation[];
|
|
27
|
+
protected readonly settings: DyNTS_Leonardo_Settings;
|
|
28
|
+
constructor(settings?: DyNTS_Leonardo_Settings);
|
|
29
|
+
static getInstance(): DyNTS_Leonardo_Image_ControlService;
|
|
30
|
+
/** Reads a field of an unknown JSON value without assuming its shape. */
|
|
31
|
+
private static readField;
|
|
32
|
+
/**
|
|
33
|
+
* Generates one image: create the job, wait for it, download the result.
|
|
34
|
+
*/
|
|
35
|
+
generate(operation: DyNTS_MediaGen_Operation, request: DyFM_AI_ImageGeneration_Request, issuer: string): Promise<DyFM_AI_Image_Response>;
|
|
36
|
+
/** `WIDTHxHEIGHT` → numbers; refuses anything else instead of letting the provider guess. */
|
|
37
|
+
private parseSize;
|
|
38
|
+
/** Polls `GET /generations/{id}` until COMPLETE; FAILED and the timeout are errors that carry the generation id. */
|
|
39
|
+
private waitForGeneration;
|
|
40
|
+
/** Downloads every generated image. The CDN URLs get NO auth header: the key must not travel to a CDN. */
|
|
41
|
+
private downloadImages;
|
|
42
|
+
/** Parses a JSON response, or throws with the status and the first 500 characters of the body. */
|
|
43
|
+
private readJson;
|
|
44
|
+
/** A refusal or failure, reported with this adapter's error settings. */
|
|
45
|
+
private failure;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=leonardo-image.control-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leonardo-image.control-service.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/leonardo-image.control-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,+BAA+B,EAAqB,MAAM,0BAA0B,CAAC;AAGtH,OAAO,EAAwB,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEtE;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,mCACX,SAAQ,0BAA0B,CAAC,+BAA+B,EAAE,sBAAsB,CAAC;IAE3F,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAA2C;IAC1E,MAAM,CAAC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAQ;IACrD,MAAM,CAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAkB;IAE1D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAc;IACvC,QAAQ,CAAC,UAAU,EAAE,SAAS,wBAAwB,EAAE,CAAuB;IAE/E,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAC;gBAEzC,QAAQ,GAAE,uBAA4B;IAKlD,MAAM,CAAC,WAAW,IAAI,mCAAmC;IAIzD,yEAAyE;IACzE,OAAO,CAAC,MAAM,CAAC,SAAS;IAIxB;;OAEG;IACG,QAAQ,CACZ,SAAS,EAAE,wBAAwB,EACnC,OAAO,EAAE,+BAA+B,EACxC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,sBAAsB,CAAC;IA2DlC,6FAA6F;IAC7F,OAAO,CAAC,SAAS;IAcjB,oHAAoH;YACtG,iBAAiB;IAwC/B,0GAA0G;YAC5F,cAAc;IAyC5B,kGAAkG;YACpF,QAAQ;IAatB,yEAAyE;IACzE,OAAO,CAAC,OAAO;CAOhB"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_Leonardo_Image_ControlService = void 0;
|
|
4
|
+
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
5
|
+
const global_settings_const_1 = require("../../../_collections/global-settings.const");
|
|
6
|
+
const media_gen_service_base_1 = require("./media-gen.service-base");
|
|
7
|
+
/**
|
|
8
|
+
* Leonardo text-to-image adapter (REST API v1).
|
|
9
|
+
*
|
|
10
|
+
* The request and response shapes are measured, not assumed: base URL and bearer auth from the master-prompter
|
|
11
|
+
* donor that runs in production, the raw field names from the official `@leonardo-ai/sdk` 4.18.1 schemas
|
|
12
|
+
* (`POST /generations` with `modelId`, `prompt`, `num_images`, `width`, `height`, `public` → `sdGenerationJob.
|
|
13
|
+
* generationId`; `GET /generations/{id}` → `generations_by_pk.status` PENDING | COMPLETE | FAILED and
|
|
14
|
+
* `generated_images[].url`). ⚠️ Leonardo also documents a v2 API; this adapter targets v1, like the donor.
|
|
15
|
+
*
|
|
16
|
+
* 🔴 PRIVATE GENERATION IS ENFORCED (K-8): Leonardo takes a licence to content marked public, and its API reference
|
|
17
|
+
* does not state the default of `public` - so every request sends `public: false`, and nothing a caller passes
|
|
18
|
+
* can change that.
|
|
19
|
+
*
|
|
20
|
+
* One image per call: the POJO has no count, and the SDK default (4) would silently quadruple the cost.
|
|
21
|
+
* Knobs Leonardo v1 has no equivalent for (`quality`, `background`, `format`) are refused, not ignored.
|
|
22
|
+
*/
|
|
23
|
+
class DyNTS_Leonardo_Image_ControlService extends media_gen_service_base_1.DyNTS_MediaGen_ServiceBase {
|
|
24
|
+
static baseUrl = 'https://cloud.leonardo.ai/api/rest/v1';
|
|
25
|
+
static defaultPollIntervalMs = 3000;
|
|
26
|
+
static defaultTimeoutMs = 15 * 60 * 1000;
|
|
27
|
+
provider = 'leonardo';
|
|
28
|
+
operations = ['text-to-image'];
|
|
29
|
+
settings;
|
|
30
|
+
constructor(settings = {}) {
|
|
31
|
+
super();
|
|
32
|
+
this.settings = settings;
|
|
33
|
+
}
|
|
34
|
+
static getInstance() {
|
|
35
|
+
return DyNTS_Leonardo_Image_ControlService.getSingletonInstance();
|
|
36
|
+
}
|
|
37
|
+
/** Reads a field of an unknown JSON value without assuming its shape. */
|
|
38
|
+
static readField(json, key) {
|
|
39
|
+
return json !== null && typeof json === 'object' ? Reflect.get(json, key) : undefined;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Generates one image: create the job, wait for it, download the result.
|
|
43
|
+
*/
|
|
44
|
+
async generate(operation, request, issuer) {
|
|
45
|
+
if (!this.operations.includes(operation)) {
|
|
46
|
+
throw this.failure(`${this.constructor.name} does not serve '${operation}'. It serves: text-to-image.`, issuer);
|
|
47
|
+
}
|
|
48
|
+
if (!request.prompt) {
|
|
49
|
+
throw this.failure('The prompt is empty.', issuer);
|
|
50
|
+
}
|
|
51
|
+
if (!request.model) {
|
|
52
|
+
throw this.failure('A Leonardo model id is required (request.model).', issuer);
|
|
53
|
+
}
|
|
54
|
+
const unsupported = ['quality', 'background', 'format']
|
|
55
|
+
.filter((knob) => Reflect.get(request, knob) !== undefined);
|
|
56
|
+
if (unsupported.length) {
|
|
57
|
+
throw this.failure(`Leonardo v1 has no equivalent for: ${unsupported.join(', ')}. Leave them out.`, issuer);
|
|
58
|
+
}
|
|
59
|
+
const dimensions = this.parseSize(request.size, issuer);
|
|
60
|
+
const apiKey = this.settings.apiKey ?? process.env.LEONARDO_API_KEY;
|
|
61
|
+
if (!apiKey) {
|
|
62
|
+
throw this.failure('Missing Leonardo API key: pass settings.apiKey or set LEONARDO_API_KEY.', issuer);
|
|
63
|
+
}
|
|
64
|
+
const doFetch = this.settings.fetchImpl ?? ((url, init) => fetch(url, init));
|
|
65
|
+
const headers = { 'Content-Type': 'application/json', Authorization: `Bearer ${apiKey}` };
|
|
66
|
+
const createUrl = `${DyNTS_Leonardo_Image_ControlService.baseUrl}/generations`;
|
|
67
|
+
const created = await this.readJson(await doFetch(createUrl, {
|
|
68
|
+
method: 'POST',
|
|
69
|
+
headers: headers,
|
|
70
|
+
body: JSON.stringify({
|
|
71
|
+
modelId: request.model,
|
|
72
|
+
prompt: request.prompt,
|
|
73
|
+
num_images: 1,
|
|
74
|
+
...(dimensions ?? {}),
|
|
75
|
+
public: false,
|
|
76
|
+
}),
|
|
77
|
+
}), createUrl, issuer);
|
|
78
|
+
const generationId = DyNTS_Leonardo_Image_ControlService.readField(DyNTS_Leonardo_Image_ControlService.readField(created, 'sdGenerationJob'), 'generationId');
|
|
79
|
+
if (typeof generationId !== 'string' || !generationId) {
|
|
80
|
+
throw this.failure(`Leonardo returned no generation id (${createUrl}).`, issuer);
|
|
81
|
+
}
|
|
82
|
+
const generation = await this.waitForGeneration(generationId, doFetch, headers, issuer);
|
|
83
|
+
const images = await this.downloadImages(generation, generationId, doFetch, issuer);
|
|
84
|
+
return {
|
|
85
|
+
provider: this.provider,
|
|
86
|
+
model: request.model,
|
|
87
|
+
images: images,
|
|
88
|
+
rawResponse: generation,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/** `WIDTHxHEIGHT` → numbers; refuses anything else instead of letting the provider guess. */
|
|
92
|
+
parseSize(size, issuer) {
|
|
93
|
+
if (size === undefined) {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
const match = /^(\d+)x(\d+)$/.exec(size);
|
|
97
|
+
if (!match) {
|
|
98
|
+
throw this.failure(`Invalid size '${size}': expected WIDTHxHEIGHT, e.g. 1024x768.`, issuer);
|
|
99
|
+
}
|
|
100
|
+
return { width: Number(match[1]), height: Number(match[2]) };
|
|
101
|
+
}
|
|
102
|
+
/** Polls `GET /generations/{id}` until COMPLETE; FAILED and the timeout are errors that carry the generation id. */
|
|
103
|
+
async waitForGeneration(generationId, doFetch, headers, issuer) {
|
|
104
|
+
const intervalMs = this.settings.pollIntervalMs ?? DyNTS_Leonardo_Image_ControlService.defaultPollIntervalMs;
|
|
105
|
+
const timeoutMs = this.settings.timeoutMs ?? DyNTS_Leonardo_Image_ControlService.defaultTimeoutMs;
|
|
106
|
+
const maxChecks = Math.max(1, Math.ceil(timeoutMs / intervalMs));
|
|
107
|
+
const sleep = this.settings.sleep
|
|
108
|
+
?? ((ms) => new Promise((resolve) => {
|
|
109
|
+
setTimeout(resolve, ms);
|
|
110
|
+
}));
|
|
111
|
+
const url = `${DyNTS_Leonardo_Image_ControlService.baseUrl}/generations/${encodeURIComponent(generationId)}`;
|
|
112
|
+
for (let check = 1; check <= maxChecks; check++) {
|
|
113
|
+
const json = await this.readJson(await doFetch(url, { method: 'GET', headers: headers }), url, issuer);
|
|
114
|
+
const generation = DyNTS_Leonardo_Image_ControlService.readField(json, 'generations_by_pk');
|
|
115
|
+
const status = DyNTS_Leonardo_Image_ControlService.readField(generation, 'status');
|
|
116
|
+
if (status === 'COMPLETE') {
|
|
117
|
+
return generation;
|
|
118
|
+
}
|
|
119
|
+
if (status === 'FAILED') {
|
|
120
|
+
throw this.failure(`Leonardo generation ${generationId} FAILED.`, issuer, { generationId: generationId });
|
|
121
|
+
}
|
|
122
|
+
if (check < maxChecks) {
|
|
123
|
+
await sleep(intervalMs);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
throw this.failure(`Leonardo generation ${generationId} did not complete within ${timeoutMs} ms (${maxChecks} checks).`, issuer, { generationId: generationId });
|
|
127
|
+
}
|
|
128
|
+
/** Downloads every generated image. The CDN URLs get NO auth header: the key must not travel to a CDN. */
|
|
129
|
+
async downloadImages(generation, generationId, doFetch, issuer) {
|
|
130
|
+
const entries = DyNTS_Leonardo_Image_ControlService.readField(generation, 'generated_images');
|
|
131
|
+
const urls = (Array.isArray(entries) ? entries : [])
|
|
132
|
+
.map((entry) => DyNTS_Leonardo_Image_ControlService.readField(entry, 'url'))
|
|
133
|
+
.filter((url) => typeof url === 'string' && !!url);
|
|
134
|
+
if (!urls.length) {
|
|
135
|
+
throw this.failure(`Leonardo generation ${generationId} completed without image URLs.`, issuer, {
|
|
136
|
+
generationId: generationId,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
const images = [];
|
|
140
|
+
for (const url of urls) {
|
|
141
|
+
const response = await doFetch(url, { method: 'GET' });
|
|
142
|
+
if (!response.ok) {
|
|
143
|
+
throw this.failure(`Downloading a Leonardo image failed: HTTP ${response.status} (${url}).`, issuer, {
|
|
144
|
+
generationId: generationId,
|
|
145
|
+
status: response.status,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
const bytes = Buffer.from(await response.arrayBuffer());
|
|
149
|
+
images.push({
|
|
150
|
+
name: url.split('/').pop(),
|
|
151
|
+
mimeType: response.headers.get('content-type') ?? 'application/octet-stream',
|
|
152
|
+
base64: bytes.toString('base64'),
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
return images;
|
|
156
|
+
}
|
|
157
|
+
/** Parses a JSON response, or throws with the status and the first 500 characters of the body. */
|
|
158
|
+
async readJson(response, url, issuer) {
|
|
159
|
+
if (!response.ok) {
|
|
160
|
+
const detail = await response.text().catch(() => '');
|
|
161
|
+
throw this.failure(`Leonardo HTTP ${response.status}: ${detail.slice(0, 500)}`, issuer, {
|
|
162
|
+
status: response.status,
|
|
163
|
+
url: url,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return response.json();
|
|
167
|
+
}
|
|
168
|
+
/** A refusal or failure, reported with this adapter's error settings. */
|
|
169
|
+
failure(message, issuer, additionalContent) {
|
|
170
|
+
return new fsm_dynamo_1.DyFM_Error({
|
|
171
|
+
...this.getDefaultErrorSettings('generate', new Error(message), issuer),
|
|
172
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-MG-LEO`,
|
|
173
|
+
...(additionalContent ? { additionalContent: additionalContent } : {}),
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
exports.DyNTS_Leonardo_Image_ControlService = DyNTS_Leonardo_Image_ControlService;
|
|
178
|
+
//# sourceMappingURL=leonardo-image.control-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leonardo-image.control-service.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/leonardo-image.control-service.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AAGnD,uFAAoF;AAGpF,qEAAsE;AAEtE;;;;;;;;;;;;;;;GAeG;AACH,MAAa,mCACX,SAAQ,mDAAmF;IAE3F,MAAM,CAAU,OAAO,GAAW,uCAAuC,CAAC;IAC1E,MAAM,CAAU,qBAAqB,GAAW,IAAI,CAAC;IACrD,MAAM,CAAU,gBAAgB,GAAW,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAEjD,QAAQ,GAAW,UAAU,CAAC;IAC9B,UAAU,GAAwC,CAAE,eAAe,CAAE,CAAC;IAE5D,QAAQ,CAA0B;IAErD,YAAY,WAAoC,EAAE;QAChD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,WAAW;QAChB,OAAO,mCAAmC,CAAC,oBAAoB,EAAE,CAAC;IACpE,CAAC;IAED,yEAAyE;IACjE,MAAM,CAAC,SAAS,CAAC,IAAa,EAAE,GAAW;QACjD,OAAO,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACxF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CACZ,SAAmC,EACnC,OAAwC,EACxC,MAAc;QAEd,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YACz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C,QAAkB,EAAE,GAAW,EAAE,MAAc;QACpE,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,MAAM,GAAW,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAW,EAAE,CAAC,EAAE,CAAC,CAAC;YAErE,MAAM,IAAI,CAAC,OAAO,CAAC,iBAAiB,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE;gBACtF,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,GAAG,EAAE,GAAG;aACT,CAAC,CAAC;QACL,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAED,yEAAyE;IACjE,OAAO,CAAC,OAAe,EAAE,MAAc,EAAE,iBAA2C;QAC1F,OAAO,IAAI,uBAAU,CAAC;YACpB,GAAG,IAAI,CAAC,uBAAuB,CAAC,UAAU,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;YACvE,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,eAAe;YACtE,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACvE,CAAC,CAAC;IACL,CAAC;;AAnNH,kFAoNC"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
export * from './_models/elevenlabs-settings.interface';
|
|
2
|
+
export * from './_models/leonardo-settings.interface';
|
|
1
3
|
export * from './_models/media-gen-operation.type';
|
|
4
|
+
export * from './_collections/elevenlabs-region.util';
|
|
2
5
|
export * from './_collections/media-gen-prompt.util';
|
|
3
6
|
export * from './_services/media-gen.service-base';
|
|
4
7
|
export * from './_services/media-gen.registry';
|
|
8
|
+
export * from './_services/elevenlabs.service-base';
|
|
9
|
+
export * from './_services/elevenlabs-speak.control-service';
|
|
10
|
+
export * from './_services/elevenlabs-transcribe.control-service';
|
|
11
|
+
export * from './_services/leonardo-image.control-service';
|
|
5
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/_modules/media-gen/index.ts"],"names":[],"mappings":"AAUA,cAAc,oCAAoC,CAAC;AAGnD,cAAc,sCAAsC,CAAC;AAGrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/_modules/media-gen/index.ts"],"names":[],"mappings":"AAUA,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AAGnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AAGrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,mDAAmD,CAAC;AAClE,cAAc,4CAA4C,CAAC"}
|
|
@@ -8,10 +8,17 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const tslib_1 = require("tslib");
|
|
10
10
|
// MODELS
|
|
11
|
+
tslib_1.__exportStar(require("./_models/elevenlabs-settings.interface"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./_models/leonardo-settings.interface"), exports);
|
|
11
13
|
tslib_1.__exportStar(require("./_models/media-gen-operation.type"), exports);
|
|
12
14
|
// COLLECTIONS
|
|
15
|
+
tslib_1.__exportStar(require("./_collections/elevenlabs-region.util"), exports);
|
|
13
16
|
tslib_1.__exportStar(require("./_collections/media-gen-prompt.util"), exports);
|
|
14
17
|
// SERVICES
|
|
15
18
|
tslib_1.__exportStar(require("./_services/media-gen.service-base"), exports);
|
|
16
19
|
tslib_1.__exportStar(require("./_services/media-gen.registry"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./_services/elevenlabs.service-base"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./_services/elevenlabs-speak.control-service"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./_services/elevenlabs-transcribe.control-service"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./_services/leonardo-image.control-service"), exports);
|
|
17
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/_modules/media-gen/index.ts"],"names":[],"mappings":";AACA,EAAE;AACF,6DAA6D;AAC7D,EAAE;AACF,2GAA2G;AAC3G,6FAA6F;AAC7F,EAAE;;;AAGF,SAAS;AACT,6EAAmD;AAEnD,cAAc;AACd,+EAAqD;AAErD,WAAW;AACX,6EAAmD;AACnD,yEAA+C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/_modules/media-gen/index.ts"],"names":[],"mappings":";AACA,EAAE;AACF,6DAA6D;AAC7D,EAAE;AACF,2GAA2G;AAC3G,6FAA6F;AAC7F,EAAE;;;AAGF,SAAS;AACT,kFAAwD;AACxD,gFAAsD;AACtD,6EAAmD;AAEnD,cAAc;AACd,gFAAsD;AACtD,+EAAqD;AAErD,WAAW;AACX,6EAAmD;AACnD,yEAA+C;AAC/C,8EAAoD;AACpD,uFAA6D;AAC7D,4FAAkE;AAClE,qFAA2D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futdevpro/nts-dynamo",
|
|
3
|
-
"version": "01.15.
|
|
3
|
+
"version": "01.15.264",
|
|
4
4
|
"description": "Dynamic NodeTS (NodeJS-Typescript), MongoDB Backend System Framework by Future Development Program Ltd.",
|
|
5
5
|
"DyBu_settings": {
|
|
6
6
|
"packageType": "server-package",
|