@futdevpro/nts-dynamo 1.15.258 → 1.15.263
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/_collections/media-gen-prompt.util.d.ts +24 -0
- package/build/_modules/media-gen/_collections/media-gen-prompt.util.d.ts.map +1 -0
- package/build/_modules/media-gen/_collections/media-gen-prompt.util.js +55 -0
- package/build/_modules/media-gen/_collections/media-gen-prompt.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/media-gen-operation.type.d.ts +9 -0
- package/build/_modules/media-gen/_models/media-gen-operation.type.d.ts.map +1 -0
- package/build/_modules/media-gen/_models/media-gen-operation.type.js +3 -0
- package/build/_modules/media-gen/_models/media-gen-operation.type.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/media-gen.registry.d.ts +35 -0
- package/build/_modules/media-gen/_services/media-gen.registry.d.ts.map +1 -0
- package/build/_modules/media-gen/_services/media-gen.registry.js +71 -0
- package/build/_modules/media-gen/_services/media-gen.registry.js.map +1 -0
- package/build/_modules/media-gen/_services/media-gen.service-base.d.ts +30 -0
- package/build/_modules/media-gen/_services/media-gen.service-base.d.ts.map +1 -0
- package/build/_modules/media-gen/_services/media-gen.service-base.js +43 -0
- package/build/_modules/media-gen/_services/media-gen.service-base.js.map +1 -0
- package/build/_modules/media-gen/index.d.ts +10 -0
- package/build/_modules/media-gen/index.d.ts.map +1 -0
- package/build/_modules/media-gen/index.js +22 -0
- package/build/_modules/media-gen/index.js.map +1 -0
- package/package.json +12 -3
|
@@ -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,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Placeholder handling for media-generation prompt templates.
|
|
3
|
+
*
|
|
4
|
+
* A template marks an input as `Đ{key}` - the marker the master-prompter flow runner already uses
|
|
5
|
+
* (`PromptKeys_Util`), so its templates work unchanged. A key may contain any character except `}`.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DyNTS_MediaGen_Prompt_Util {
|
|
8
|
+
/** `Đ{` + one or more non-`}` characters + `}`. Only used via `matchAll` / `replace`, which share no state. */
|
|
9
|
+
private static readonly placeholderPattern;
|
|
10
|
+
/**
|
|
11
|
+
* The distinct keys a template references, in first-appearance order.
|
|
12
|
+
*/
|
|
13
|
+
static getKeys(template: string): string[];
|
|
14
|
+
/**
|
|
15
|
+
* Fills every placeholder of `template` from `values`, and returns the exact prompt.
|
|
16
|
+
*
|
|
17
|
+
* Refuses - naming EVERY offending key at once - when a referenced key has no own value (absent, `undefined`,
|
|
18
|
+
* `null` or an empty string) or holds an object or function. A prompt with a hole in it still costs a paid call
|
|
19
|
+
* and produces a wrong asset; and an object would silently render as `[object Object]`, which the
|
|
20
|
+
* master-prompter donor measured happening in a real prompt.
|
|
21
|
+
*/
|
|
22
|
+
static fill(template: string, values: Record<string, unknown>): string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=media-gen-prompt.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-gen-prompt.util.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_collections/media-gen-prompt.util.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,0BAA0B;IAErC,+GAA+G;IAC/G,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAA2B;IAErE;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE;IAY1C;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;CA8BvE"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_MediaGen_Prompt_Util = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Placeholder handling for media-generation prompt templates.
|
|
6
|
+
*
|
|
7
|
+
* A template marks an input as `Đ{key}` - the marker the master-prompter flow runner already uses
|
|
8
|
+
* (`PromptKeys_Util`), so its templates work unchanged. A key may contain any character except `}`.
|
|
9
|
+
*/
|
|
10
|
+
class DyNTS_MediaGen_Prompt_Util {
|
|
11
|
+
/** `Đ{` + one or more non-`}` characters + `}`. Only used via `matchAll` / `replace`, which share no state. */
|
|
12
|
+
static placeholderPattern = /Đ\{([^}]+)\}/g;
|
|
13
|
+
/**
|
|
14
|
+
* The distinct keys a template references, in first-appearance order.
|
|
15
|
+
*/
|
|
16
|
+
static getKeys(template) {
|
|
17
|
+
const keys = [];
|
|
18
|
+
for (const match of template.matchAll(DyNTS_MediaGen_Prompt_Util.placeholderPattern)) {
|
|
19
|
+
if (!keys.includes(match[1])) {
|
|
20
|
+
keys.push(match[1]);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return keys;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Fills every placeholder of `template` from `values`, and returns the exact prompt.
|
|
27
|
+
*
|
|
28
|
+
* Refuses - naming EVERY offending key at once - when a referenced key has no own value (absent, `undefined`,
|
|
29
|
+
* `null` or an empty string) or holds an object or function. A prompt with a hole in it still costs a paid call
|
|
30
|
+
* and produces a wrong asset; and an object would silently render as `[object Object]`, which the
|
|
31
|
+
* master-prompter donor measured happening in a real prompt.
|
|
32
|
+
*/
|
|
33
|
+
static fill(template, values) {
|
|
34
|
+
if (!template) {
|
|
35
|
+
throw new Error('DyNTS_MediaGen_Prompt_Util: the prompt template is empty.');
|
|
36
|
+
}
|
|
37
|
+
const keys = DyNTS_MediaGen_Prompt_Util.getKeys(template);
|
|
38
|
+
const missing = keys.filter((key) => {
|
|
39
|
+
const value = Object.prototype.hasOwnProperty.call(values, key) ? values[key] : undefined;
|
|
40
|
+
return value === undefined || value === null || value === '';
|
|
41
|
+
});
|
|
42
|
+
const notText = keys.filter((key) => {
|
|
43
|
+
const value = Object.prototype.hasOwnProperty.call(values, key) ? values[key] : undefined;
|
|
44
|
+
return value !== null && (typeof value === 'object' || typeof value === 'function');
|
|
45
|
+
});
|
|
46
|
+
if (missing.length || notText.length) {
|
|
47
|
+
throw new Error('DyNTS_MediaGen_Prompt_Util: the prompt template cannot be filled.'
|
|
48
|
+
+ (missing.length ? ` No value for: ${missing.join(', ')}.` : '')
|
|
49
|
+
+ (notText.length ? ` Not a text value (object or function): ${notText.join(', ')}.` : ''));
|
|
50
|
+
}
|
|
51
|
+
return template.replace(DyNTS_MediaGen_Prompt_Util.placeholderPattern, (placeholder, key) => String(values[key]));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.DyNTS_MediaGen_Prompt_Util = DyNTS_MediaGen_Prompt_Util;
|
|
55
|
+
//# sourceMappingURL=media-gen-prompt.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-gen-prompt.util.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_collections/media-gen-prompt.util.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,MAAa,0BAA0B;IAErC,+GAA+G;IACvG,MAAM,CAAU,kBAAkB,GAAW,eAAe,CAAC;IAErE;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,QAAgB;QAC7B,MAAM,IAAI,GAAa,EAAE,CAAC;QAE1B,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,QAAQ,CAAC,0BAA0B,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACrF,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC7B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,CAAC,QAAgB,EAAE,MAA+B;QAC3D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;QAC/E,CAAC;QAED,MAAM,IAAI,GAAa,0BAA0B,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACpE,MAAM,OAAO,GAAa,IAAI,CAAC,MAAM,CAAC,CAAC,GAAW,EAAW,EAAE;YAC7D,MAAM,KAAK,GAAY,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAEnG,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;QAC/D,CAAC,CAAC,CAAC;QACH,MAAM,OAAO,GAAa,IAAI,CAAC,MAAM,CAAC,CAAC,GAAW,EAAW,EAAE;YAC7D,MAAM,KAAK,GAAY,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAEnG,OAAO,KAAK,KAAK,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC;QACtF,CAAC,CAAC,CAAC;QAEH,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CACb,mEAAmE;kBACjE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,kBAAkB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;kBAC/D,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,2CAA2C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAC3F,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC,OAAO,CACrB,0BAA0B,CAAC,kBAAkB,EAC7C,CAAC,WAAmB,EAAE,GAAW,EAAU,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAClE,CAAC;IACJ,CAAC;;AAzDH,gEA0DC"}
|
|
@@ -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,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a media-generation adapter can be asked to do - the registry's second key.
|
|
3
|
+
*
|
|
4
|
+
* A string union, not an enum, like `DyNTS_AI_EmbeddingProviderKey`: adapters and callers pass plain ids.
|
|
5
|
+
* The set covers the master-prompter provider table (`textToImage`, `imageTo3D`, `textTo3D`, `textToSpeech`)
|
|
6
|
+
* plus the two operations the `dc media-*` commands already serve (`image-edit`, `speech-to-text`).
|
|
7
|
+
*/
|
|
8
|
+
export type DyNTS_MediaGen_Operation = 'text-to-image' | 'image-edit' | 'text-to-speech' | 'speech-to-text' | 'image-to-3d' | 'text-to-3d';
|
|
9
|
+
//# sourceMappingURL=media-gen-operation.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-gen-operation.type.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_models/media-gen-operation.type.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAChC,eAAe,GACf,YAAY,GACZ,gBAAgB,GAChB,gBAAgB,GAChB,aAAa,GACb,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-gen-operation.type.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_models/media-gen-operation.type.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;I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;YAClB,MAAM,IAAI,CAAC,cAAc,CAAC,4CAA4C,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;QACzF,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,OAAO,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,EAC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AC;QAC5C,MAAM,IAAI,GAAY,0CAA0C,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACzF,MAAM,QAAQ,GAAY,0CAA0C,CAAC,SAAS,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;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;QAA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C;YACnB,GAAG,IAAI,CAAC,uBAAuB,CAC7B,UAAU,EACV,IAAI,KAAK,CAAC,mBAAmB,QAAQ,CAAC,MAAM,GAAG,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,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,35 @@
|
|
|
1
|
+
import { DyNTS_MediaGen_Operation } from '../_models/media-gen-operation.type';
|
|
2
|
+
import { DyNTS_MediaGen_ServiceBase } from './media-gen.service-base';
|
|
3
|
+
/** One registered pair, as `entries()` lists it. */
|
|
4
|
+
export interface DyNTS_MediaGen_RegistryEntry {
|
|
5
|
+
provider: string;
|
|
6
|
+
operation: DyNTS_MediaGen_Operation;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The two-key registry: provider × operation → adapter.
|
|
10
|
+
*
|
|
11
|
+
* Generalised from the master-prompter `generationProviders` table (`ProviderType × AiModelType`). An instance
|
|
12
|
+
* rather than a module-level constant: a product registers the adapters it ships, and a test builds its own
|
|
13
|
+
* registry without touching global state.
|
|
14
|
+
*/
|
|
15
|
+
export declare class DyNTS_MediaGen_Registry {
|
|
16
|
+
private readonly services;
|
|
17
|
+
/**
|
|
18
|
+
* Registers an adapter under every operation it declares.
|
|
19
|
+
*
|
|
20
|
+
* Refuses an adapter that declares no operation (it could never be resolved), and a second, different adapter
|
|
21
|
+
* for a pair that is already taken - a silent replacement would hide which adapter actually serves the call.
|
|
22
|
+
* Registering the same instance again is a no-op.
|
|
23
|
+
*/
|
|
24
|
+
register(service: DyNTS_MediaGen_ServiceBase<unknown, unknown>): void;
|
|
25
|
+
/**
|
|
26
|
+
* The adapter serving `operation` for `provider`. When there is none, the error says what IS available:
|
|
27
|
+
* the provider's operations if the provider is known, otherwise the providers serving the operation.
|
|
28
|
+
*/
|
|
29
|
+
resolve(provider: string, operation: DyNTS_MediaGen_Operation): DyNTS_MediaGen_ServiceBase<unknown, unknown>;
|
|
30
|
+
/**
|
|
31
|
+
* Every registered provider × operation pair, in registration order.
|
|
32
|
+
*/
|
|
33
|
+
entries(): DyNTS_MediaGen_RegistryEntry[];
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=media-gen.registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-gen.registry.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/media-gen.registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEtE,oDAAoD;AACpD,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,wBAAwB,CAAC;CACrC;AAED;;;;;;GAMG;AACH,qBAAa,uBAAuB;IAElC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CACb;IAEZ;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,0BAA0B,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,IAAI;IA2BrE;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,wBAAwB,GAAG,0BAA0B,CAAC,OAAO,EAAE,OAAO,CAAC;IA2B5G;;OAEG;IACH,OAAO,IAAI,4BAA4B,EAAE;CAW1C"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_MediaGen_Registry = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The two-key registry: provider × operation → adapter.
|
|
6
|
+
*
|
|
7
|
+
* Generalised from the master-prompter `generationProviders` table (`ProviderType × AiModelType`). An instance
|
|
8
|
+
* rather than a module-level constant: a product registers the adapters it ships, and a test builds its own
|
|
9
|
+
* registry without touching global state.
|
|
10
|
+
*/
|
|
11
|
+
class DyNTS_MediaGen_Registry {
|
|
12
|
+
services = new Map();
|
|
13
|
+
/**
|
|
14
|
+
* Registers an adapter under every operation it declares.
|
|
15
|
+
*
|
|
16
|
+
* Refuses an adapter that declares no operation (it could never be resolved), and a second, different adapter
|
|
17
|
+
* for a pair that is already taken - a silent replacement would hide which adapter actually serves the call.
|
|
18
|
+
* Registering the same instance again is a no-op.
|
|
19
|
+
*/
|
|
20
|
+
register(service) {
|
|
21
|
+
if (!service.operations.length) {
|
|
22
|
+
throw new Error(`DyNTS_MediaGen_Registry: ${service.constructor.name} (provider '${service.provider}') declares no operations.`);
|
|
23
|
+
}
|
|
24
|
+
const byOperation = this.services.get(service.provider) ?? new Map();
|
|
25
|
+
for (const operation of service.operations) {
|
|
26
|
+
const existing = byOperation.get(operation);
|
|
27
|
+
if (existing && existing !== service) {
|
|
28
|
+
throw new Error(`DyNTS_MediaGen_Registry: '${operation}' of provider '${service.provider}' is already served by `
|
|
29
|
+
+ `${existing.constructor.name}; registering ${service.constructor.name} would silently replace it.`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
for (const operation of service.operations) {
|
|
33
|
+
byOperation.set(operation, service);
|
|
34
|
+
}
|
|
35
|
+
this.services.set(service.provider, byOperation);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The adapter serving `operation` for `provider`. When there is none, the error says what IS available:
|
|
39
|
+
* the provider's operations if the provider is known, otherwise the providers serving the operation.
|
|
40
|
+
*/
|
|
41
|
+
resolve(provider, operation) {
|
|
42
|
+
const service = this.services.get(provider)?.get(operation);
|
|
43
|
+
if (service) {
|
|
44
|
+
return service;
|
|
45
|
+
}
|
|
46
|
+
const providerOperations = [...(this.services.get(provider)?.keys() ?? [])];
|
|
47
|
+
if (providerOperations.length) {
|
|
48
|
+
throw new Error(`DyNTS_MediaGen_Registry: provider '${provider}' does not serve '${operation}'. `
|
|
49
|
+
+ `It serves: ${providerOperations.join(', ')}.`);
|
|
50
|
+
}
|
|
51
|
+
const operationProviders = this.entries()
|
|
52
|
+
.filter((entry) => entry.operation === operation)
|
|
53
|
+
.map((entry) => entry.provider);
|
|
54
|
+
throw new Error(`DyNTS_MediaGen_Registry: no provider '${provider}' is registered. `
|
|
55
|
+
+ `'${operation}' is served by: ${operationProviders.length ? operationProviders.join(', ') : 'no provider'}.`);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Every registered provider × operation pair, in registration order.
|
|
59
|
+
*/
|
|
60
|
+
entries() {
|
|
61
|
+
const entries = [];
|
|
62
|
+
for (const [provider, byOperation] of this.services) {
|
|
63
|
+
for (const operation of byOperation.keys()) {
|
|
64
|
+
entries.push({ provider: provider, operation: operation });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return entries;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.DyNTS_MediaGen_Registry = DyNTS_MediaGen_Registry;
|
|
71
|
+
//# sourceMappingURL=media-gen.registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-gen.registry.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/media-gen.registry.ts"],"names":[],"mappings":";;;AASA;;;;;;GAMG;AACH,MAAa,uBAAuB;IAEjB,QAAQ,GACvB,IAAI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|
+
import { DyNTS_MediaGen_Operation } from '../_models/media-gen-operation.type';
|
|
3
|
+
/**
|
|
4
|
+
* Base of one media-generation provider adapter (OpenAI Images, ElevenLabs, Leonardo, Meshy, Synexa, ...).
|
|
5
|
+
*
|
|
6
|
+
* Generalised from the master-prompter `Generation_ServiceBase`. Two things are left out on purpose:
|
|
7
|
+
* - the flow-run coupling (step connectors, flow nodes) - a request object replaces it;
|
|
8
|
+
* - the token-cost methods - cost accounting stays in the product that sells the credits (K-9).
|
|
9
|
+
*
|
|
10
|
+
* What remains is what every adapter needs: who it is, which operations it serves, the call itself, and
|
|
11
|
+
* prompt assembly from a `Đ{key}` template. Capability is data: `operations` is what the registry indexes,
|
|
12
|
+
* so an adapter that cannot edit simply does not list `image-edit`, and a caller asking for it is told what
|
|
13
|
+
* the adapter CAN do.
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class DyNTS_MediaGen_ServiceBase<T_Request, T_Response> extends DyNTS_SingletonService {
|
|
16
|
+
/** Stable provider id (e.g. `openai`, `elevenlabs`) - the registry's first key. */
|
|
17
|
+
abstract readonly provider: string;
|
|
18
|
+
/** The operations this adapter serves - the registry's second key. Must match what `generate` handles. */
|
|
19
|
+
abstract readonly operations: readonly DyNTS_MediaGen_Operation[];
|
|
20
|
+
/**
|
|
21
|
+
* Performs one generation.
|
|
22
|
+
*/
|
|
23
|
+
abstract generate(operation: DyNTS_MediaGen_Operation, request: T_Request, issuer: string): Promise<T_Response>;
|
|
24
|
+
/**
|
|
25
|
+
* Assembles the exact prompt from a `Đ{key}` template (see `DyNTS_MediaGen_Prompt_Util.fill`), and reports
|
|
26
|
+
* a failure with this adapter's error settings.
|
|
27
|
+
*/
|
|
28
|
+
protected assemblePrompt(template: string, values: Record<string, unknown>, issuer: string): string;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=media-gen.service-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-gen.service-base.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/media-gen.service-base.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AAEnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E;;;;;;;;;;;GAWG;AACH,8BAAsB,0BAA0B,CAAC,SAAS,EAAE,UAAU,CAAE,SAAQ,sBAAsB;IAEpG,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAEnC,0GAA0G;IAC1G,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,wBAAwB,EAAE,CAAC;IAElE;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,SAAS,EAAE,wBAAwB,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAE/G;;;OAGG;IACH,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;CAepG"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_MediaGen_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 singleton_service_1 = require("../../../_services/base/singleton.service");
|
|
7
|
+
const media_gen_prompt_util_1 = require("../_collections/media-gen-prompt.util");
|
|
8
|
+
/**
|
|
9
|
+
* Base of one media-generation provider adapter (OpenAI Images, ElevenLabs, Leonardo, Meshy, Synexa, ...).
|
|
10
|
+
*
|
|
11
|
+
* Generalised from the master-prompter `Generation_ServiceBase`. Two things are left out on purpose:
|
|
12
|
+
* - the flow-run coupling (step connectors, flow nodes) - a request object replaces it;
|
|
13
|
+
* - the token-cost methods - cost accounting stays in the product that sells the credits (K-9).
|
|
14
|
+
*
|
|
15
|
+
* What remains is what every adapter needs: who it is, which operations it serves, the call itself, and
|
|
16
|
+
* prompt assembly from a `Đ{key}` template. Capability is data: `operations` is what the registry indexes,
|
|
17
|
+
* so an adapter that cannot edit simply does not list `image-edit`, and a caller asking for it is told what
|
|
18
|
+
* the adapter CAN do.
|
|
19
|
+
*/
|
|
20
|
+
class DyNTS_MediaGen_ServiceBase extends singleton_service_1.DyNTS_SingletonService {
|
|
21
|
+
/**
|
|
22
|
+
* Assembles the exact prompt from a `Đ{key}` template (see `DyNTS_MediaGen_Prompt_Util.fill`), and reports
|
|
23
|
+
* a failure with this adapter's error settings.
|
|
24
|
+
*/
|
|
25
|
+
assemblePrompt(template, values, issuer) {
|
|
26
|
+
try {
|
|
27
|
+
return media_gen_prompt_util_1.DyNTS_MediaGen_Prompt_Util.fill(template, values);
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
31
|
+
...this.getDefaultErrorSettings('assemblePrompt', error, issuer),
|
|
32
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-MG-AP0`,
|
|
33
|
+
additionalContent: {
|
|
34
|
+
provider: this.provider,
|
|
35
|
+
keys: media_gen_prompt_util_1.DyNTS_MediaGen_Prompt_Util.getKeys(template ?? ''),
|
|
36
|
+
providedKeys: Object.keys(values ?? {}),
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.DyNTS_MediaGen_ServiceBase = DyNTS_MediaGen_ServiceBase;
|
|
43
|
+
//# sourceMappingURL=media-gen.service-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-gen.service-base.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/media-gen.service-base.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AAEnD,uFAAoF;AACpF,iFAAmF;AACnF,iFAAmF;AAGnF;;;;;;;;;;;GAWG;AACH,MAAsB,0BAAkD,SAAQ,0CAAsB;IAapG;;;OAGG;IACO,cAAc,CAAC,QAAgB,EAAE,MAA+B,EAAE,MAAc;QACxF,IAAI,CAAC;YACH,OAAO,kDAA0B,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC3D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,uBAAU,CAAC;gBACnB,GAAG,IAAI,CAAC,uBAAuB,CAAC,gBAAgB,EAAE,KAAK,EAAE,MAAM,CAAC;gBAChE,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,eAAe;gBACtE,iBAAiB,EAAE;oBACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;oBACvB,IAAI,EAAE,kDAA0B,CAAC,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC;oBACxD,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;iBACxC;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAhCD,gEAgCC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './_models/elevenlabs-settings.interface';
|
|
2
|
+
export * from './_models/media-gen-operation.type';
|
|
3
|
+
export * from './_collections/elevenlabs-region.util';
|
|
4
|
+
export * from './_collections/media-gen-prompt.util';
|
|
5
|
+
export * from './_services/media-gen.service-base';
|
|
6
|
+
export * from './_services/media-gen.registry';
|
|
7
|
+
export * from './_services/elevenlabs.service-base';
|
|
8
|
+
export * from './_services/elevenlabs-speak.control-service';
|
|
9
|
+
export * from './_services/elevenlabs-transcribe.control-service';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/_modules/media-gen/index.ts"],"names":[],"mappings":"AAUA,cAAc,yCAAyC,CAAC;AACxD,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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Media generation module (media-generation hyperplan, MP-5)
|
|
4
|
+
//
|
|
5
|
+
// The provider-independent generation engine: an adapter base class and the provider × operation registry.
|
|
6
|
+
// Cost accounting is deliberately NOT here - it stays in the product that sells the credits.
|
|
7
|
+
//
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const tslib_1 = require("tslib");
|
|
10
|
+
// MODELS
|
|
11
|
+
tslib_1.__exportStar(require("./_models/elevenlabs-settings.interface"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./_models/media-gen-operation.type"), exports);
|
|
13
|
+
// COLLECTIONS
|
|
14
|
+
tslib_1.__exportStar(require("./_collections/elevenlabs-region.util"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./_collections/media-gen-prompt.util"), exports);
|
|
16
|
+
// SERVICES
|
|
17
|
+
tslib_1.__exportStar(require("./_services/media-gen.service-base"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./_services/media-gen.registry"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./_services/elevenlabs.service-base"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./_services/elevenlabs-speak.control-service"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./_services/elevenlabs-transcribe.control-service"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,kFAAwD;AACxD,6EAAmD;AAEnD,cAAc;AACd,gFAAsD;AACtD,+EAAqD;AAErD,WAAW;AACX,6EAAmD;AACnD,yEAA+C;AAC/C,8EAAoD;AACpD,uFAA6D;AAC7D,4FAAkE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futdevpro/nts-dynamo",
|
|
3
|
-
"version": "01.15.
|
|
3
|
+
"version": "01.15.263",
|
|
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",
|
|
@@ -294,6 +294,12 @@
|
|
|
294
294
|
"module": "./build/_modules/test-email-sink/index.js",
|
|
295
295
|
"types": "./build/_modules/test-email-sink/index.d.ts",
|
|
296
296
|
"typings": "./build/_modules/test-email-sink/index.d.ts"
|
|
297
|
+
},
|
|
298
|
+
"./media-gen": {
|
|
299
|
+
"default": "./build/_modules/media-gen/index.js",
|
|
300
|
+
"module": "./build/_modules/media-gen/index.js",
|
|
301
|
+
"types": "./build/_modules/media-gen/index.d.ts",
|
|
302
|
+
"typings": "./build/_modules/media-gen/index.d.ts"
|
|
297
303
|
}
|
|
298
304
|
},
|
|
299
305
|
"typesVersions": {
|
|
@@ -399,6 +405,9 @@
|
|
|
399
405
|
],
|
|
400
406
|
"test-email-sink": [
|
|
401
407
|
"build/_modules/test-email-sink/index.d.ts"
|
|
408
|
+
],
|
|
409
|
+
"media-gen": [
|
|
410
|
+
"build/_modules/media-gen/index.d.ts"
|
|
402
411
|
]
|
|
403
412
|
}
|
|
404
413
|
},
|
|
@@ -415,7 +424,7 @@
|
|
|
415
424
|
"@anthropic-ai/sdk": "~0.39.0",
|
|
416
425
|
"@modelcontextprotocol/sdk": "~1.29.0",
|
|
417
426
|
"better-sqlite3": "~12.4.1",
|
|
418
|
-
"@futdevpro/fsm-dynamo": "1.20.
|
|
427
|
+
"@futdevpro/fsm-dynamo": "1.20.42",
|
|
419
428
|
"@types/express": "4.17.21",
|
|
420
429
|
"@types/geoip-lite": "~1.4.4",
|
|
421
430
|
"@types/node": "~24.1.0",
|
|
@@ -454,7 +463,7 @@
|
|
|
454
463
|
}
|
|
455
464
|
},
|
|
456
465
|
"devDependencies": {
|
|
457
|
-
"@futdevpro/fsm-dynamo": "1.20.
|
|
466
|
+
"@futdevpro/fsm-dynamo": "1.20.42",
|
|
458
467
|
"@futdevpro/dynamo-eslint": "1.20.18",
|
|
459
468
|
"@discordjs/opus": "^0.10.0",
|
|
460
469
|
"@discordjs/voice": "^0.18.0",
|