@contractspec/lib.contracts-spec 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/integrations/index.js +379 -53
- package/dist/integrations/providers/deepgram.d.ts +3 -0
- package/dist/integrations/providers/deepgram.js +129 -0
- package/dist/integrations/providers/elevenlabs.js +6 -3
- package/dist/integrations/providers/fal-image.d.ts +3 -0
- package/dist/integrations/providers/fal-image.js +122 -0
- package/dist/integrations/providers/fal.js +2 -2
- package/dist/integrations/providers/gradium.js +2 -2
- package/dist/integrations/providers/image.d.ts +85 -0
- package/dist/integrations/providers/image.js +46 -0
- package/dist/integrations/providers/index.d.ts +6 -0
- package/dist/integrations/providers/index.js +380 -54
- package/dist/integrations/providers/openai-image.d.ts +3 -0
- package/dist/integrations/providers/openai-image.js +126 -0
- package/dist/integrations/providers/openai-realtime.d.ts +3 -0
- package/dist/integrations/providers/openai-realtime.js +127 -0
- package/dist/integrations/providers/registry.js +192 -33
- package/dist/integrations/providers/voice-video-sync.d.ts +29 -0
- package/dist/integrations/providers/voice-video-sync.js +1 -0
- package/dist/integrations/providers/voice.d.ts +149 -12
- package/dist/integrations/spec.d.ts +1 -1
- package/dist/node/integrations/index.js +379 -53
- package/dist/node/integrations/providers/deepgram.js +129 -0
- package/dist/node/integrations/providers/elevenlabs.js +6 -3
- package/dist/node/integrations/providers/fal-image.js +122 -0
- package/dist/node/integrations/providers/fal.js +2 -2
- package/dist/node/integrations/providers/gradium.js +2 -2
- package/dist/node/integrations/providers/image.js +46 -0
- package/dist/node/integrations/providers/index.js +380 -54
- package/dist/node/integrations/providers/openai-image.js +126 -0
- package/dist/node/integrations/providers/openai-realtime.js +127 -0
- package/dist/node/integrations/providers/registry.js +192 -33
- package/dist/node/integrations/providers/voice-video-sync.js +0 -0
- package/dist/node/translations/i18n-factory.js +229 -0
- package/dist/node/translations/index.js +64 -4
- package/dist/translations/i18n-factory.d.ts +90 -0
- package/dist/translations/i18n-factory.js +229 -0
- package/dist/translations/index.d.ts +1 -0
- package/dist/translations/index.js +64 -4
- package/package.json +88 -4
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
7
|
+
var __toCommonJS = (from) => {
|
|
8
|
+
var entry = __moduleCache.get(from), desc;
|
|
9
|
+
if (entry)
|
|
10
|
+
return entry;
|
|
11
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
13
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
}));
|
|
17
|
+
__moduleCache.set(from, entry);
|
|
18
|
+
return entry;
|
|
19
|
+
};
|
|
20
|
+
var __export = (target, all) => {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, {
|
|
23
|
+
get: all[name],
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
set: (newValue) => all[name] = () => newValue
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
30
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
31
|
+
|
|
32
|
+
// src/integrations/spec.ts
|
|
33
|
+
import { SpecContractRegistry } from "@contractspec/lib.contracts-spec/registry";
|
|
34
|
+
var integrationKey = (meta) => `${meta.key}.v${meta.version}`;
|
|
35
|
+
|
|
36
|
+
class IntegrationSpecRegistry extends SpecContractRegistry {
|
|
37
|
+
constructor(items) {
|
|
38
|
+
super("integration", items);
|
|
39
|
+
}
|
|
40
|
+
getByCategory(category) {
|
|
41
|
+
return this.list().filter((spec) => spec.meta.category === category);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function makeIntegrationSpecKey(meta) {
|
|
45
|
+
return integrationKey(meta);
|
|
46
|
+
}
|
|
47
|
+
var defineIntegration = (spec) => spec;
|
|
48
|
+
|
|
49
|
+
// src/integrations/providers/deepgram.ts
|
|
50
|
+
import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
|
|
51
|
+
var deepgramIntegrationSpec = defineIntegration({
|
|
52
|
+
meta: {
|
|
53
|
+
key: "ai-voice-stt.deepgram",
|
|
54
|
+
version: "1.0.0",
|
|
55
|
+
category: "ai-voice-stt",
|
|
56
|
+
title: "Deepgram Speech-to-Text",
|
|
57
|
+
description: "Deepgram integration for real-time and batch speech-to-text transcription with speaker diarization.",
|
|
58
|
+
domain: "ai",
|
|
59
|
+
owners: ["platform.ai"],
|
|
60
|
+
tags: ["voice", "stt", "transcription", "diarization"],
|
|
61
|
+
stability: StabilityEnum.Experimental
|
|
62
|
+
},
|
|
63
|
+
supportedModes: ["byok"],
|
|
64
|
+
capabilities: {
|
|
65
|
+
provides: [
|
|
66
|
+
{ key: "ai.voice.stt", version: "1.0.0" },
|
|
67
|
+
{ key: "ai.voice.conversational", version: "1.0.0" }
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
configSchema: {
|
|
71
|
+
schema: {
|
|
72
|
+
type: "object",
|
|
73
|
+
properties: {
|
|
74
|
+
model: {
|
|
75
|
+
type: "string",
|
|
76
|
+
description: "Deepgram model to use (e.g. nova-3, nova-2, enhanced)."
|
|
77
|
+
},
|
|
78
|
+
language: {
|
|
79
|
+
type: "string",
|
|
80
|
+
description: "Default language code for transcription (e.g. en-US)."
|
|
81
|
+
},
|
|
82
|
+
enableDiarization: {
|
|
83
|
+
type: "boolean",
|
|
84
|
+
description: "Enable speaker diarization by default."
|
|
85
|
+
},
|
|
86
|
+
enableSmartFormat: {
|
|
87
|
+
type: "boolean",
|
|
88
|
+
description: "Enable smart formatting (punctuation, capitalization)."
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
example: {
|
|
93
|
+
model: "nova-3",
|
|
94
|
+
language: "en-US",
|
|
95
|
+
enableDiarization: true,
|
|
96
|
+
enableSmartFormat: true
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
secretSchema: {
|
|
100
|
+
schema: {
|
|
101
|
+
type: "object",
|
|
102
|
+
required: ["apiKey"],
|
|
103
|
+
properties: {
|
|
104
|
+
apiKey: {
|
|
105
|
+
type: "string",
|
|
106
|
+
description: "Deepgram API key with transcription permissions."
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
example: {
|
|
111
|
+
apiKey: "dg_***"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
healthCheck: {
|
|
115
|
+
method: "custom",
|
|
116
|
+
timeoutMs: 5000
|
|
117
|
+
},
|
|
118
|
+
docsUrl: "https://developers.deepgram.com/docs",
|
|
119
|
+
byokSetup: {
|
|
120
|
+
setupInstructions: "Create a Deepgram API key with speech-to-text permissions and store it in your secret provider."
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
function registerDeepgramIntegration(registry) {
|
|
124
|
+
return registry.register(deepgramIntegrationSpec);
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
registerDeepgramIntegration,
|
|
128
|
+
deepgramIntegrationSpec
|
|
129
|
+
};
|
|
@@ -52,17 +52,20 @@ var elevenLabsIntegrationSpec = defineIntegration({
|
|
|
52
52
|
meta: {
|
|
53
53
|
key: "ai-voice.elevenlabs",
|
|
54
54
|
version: "1.0.0",
|
|
55
|
-
category: "ai-voice",
|
|
55
|
+
category: "ai-voice-tts",
|
|
56
56
|
title: "ElevenLabs Text-to-Speech",
|
|
57
57
|
description: "ElevenLabs integration for neural voice synthesis and voice catalog access.",
|
|
58
58
|
domain: "ai",
|
|
59
59
|
owners: ["platform.ai"],
|
|
60
|
-
tags: ["voice", "tts"],
|
|
60
|
+
tags: ["voice", "tts", "stt"],
|
|
61
61
|
stability: StabilityEnum.Beta
|
|
62
62
|
},
|
|
63
63
|
supportedModes: ["managed", "byok"],
|
|
64
64
|
capabilities: {
|
|
65
|
-
provides: [
|
|
65
|
+
provides: [
|
|
66
|
+
{ key: "ai.voice.tts", version: "1.0.0" },
|
|
67
|
+
{ key: "ai.voice.stt", version: "1.0.0" }
|
|
68
|
+
]
|
|
66
69
|
},
|
|
67
70
|
configSchema: {
|
|
68
71
|
schema: {
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
7
|
+
var __toCommonJS = (from) => {
|
|
8
|
+
var entry = __moduleCache.get(from), desc;
|
|
9
|
+
if (entry)
|
|
10
|
+
return entry;
|
|
11
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
13
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
}));
|
|
17
|
+
__moduleCache.set(from, entry);
|
|
18
|
+
return entry;
|
|
19
|
+
};
|
|
20
|
+
var __export = (target, all) => {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, {
|
|
23
|
+
get: all[name],
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
set: (newValue) => all[name] = () => newValue
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
30
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
31
|
+
|
|
32
|
+
// src/integrations/spec.ts
|
|
33
|
+
import { SpecContractRegistry } from "@contractspec/lib.contracts-spec/registry";
|
|
34
|
+
var integrationKey = (meta) => `${meta.key}.v${meta.version}`;
|
|
35
|
+
|
|
36
|
+
class IntegrationSpecRegistry extends SpecContractRegistry {
|
|
37
|
+
constructor(items) {
|
|
38
|
+
super("integration", items);
|
|
39
|
+
}
|
|
40
|
+
getByCategory(category) {
|
|
41
|
+
return this.list().filter((spec) => spec.meta.category === category);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function makeIntegrationSpecKey(meta) {
|
|
45
|
+
return integrationKey(meta);
|
|
46
|
+
}
|
|
47
|
+
var defineIntegration = (spec) => spec;
|
|
48
|
+
|
|
49
|
+
// src/integrations/providers/fal-image.ts
|
|
50
|
+
import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
|
|
51
|
+
var falImageIntegrationSpec = defineIntegration({
|
|
52
|
+
meta: {
|
|
53
|
+
key: "ai-image.fal",
|
|
54
|
+
version: "1.0.0",
|
|
55
|
+
category: "ai-image",
|
|
56
|
+
title: "Fal Image Generation",
|
|
57
|
+
description: "Fal integration for AI image generation using Flux and Stable Diffusion models.",
|
|
58
|
+
domain: "ai",
|
|
59
|
+
owners: ["platform.ai"],
|
|
60
|
+
tags: ["image", "generation", "flux", "stable-diffusion"],
|
|
61
|
+
stability: StabilityEnum.Experimental
|
|
62
|
+
},
|
|
63
|
+
supportedModes: ["byok"],
|
|
64
|
+
capabilities: {
|
|
65
|
+
provides: [{ key: "ai.image.generation", version: "1.0.0" }]
|
|
66
|
+
},
|
|
67
|
+
configSchema: {
|
|
68
|
+
schema: {
|
|
69
|
+
type: "object",
|
|
70
|
+
properties: {
|
|
71
|
+
modelId: {
|
|
72
|
+
type: "string",
|
|
73
|
+
description: "Fal model endpoint (e.g. fal-ai/flux/dev)."
|
|
74
|
+
},
|
|
75
|
+
defaultFormat: {
|
|
76
|
+
type: "string",
|
|
77
|
+
enum: ["png", "jpg", "webp"]
|
|
78
|
+
},
|
|
79
|
+
defaultGuidanceScale: {
|
|
80
|
+
type: "number",
|
|
81
|
+
minimum: 1,
|
|
82
|
+
maximum: 20
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
example: {
|
|
87
|
+
modelId: "fal-ai/flux/dev",
|
|
88
|
+
defaultFormat: "png",
|
|
89
|
+
defaultGuidanceScale: 7.5
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
secretSchema: {
|
|
93
|
+
schema: {
|
|
94
|
+
type: "object",
|
|
95
|
+
required: ["apiKey"],
|
|
96
|
+
properties: {
|
|
97
|
+
apiKey: {
|
|
98
|
+
type: "string",
|
|
99
|
+
description: "Fal API key (FAL_KEY)."
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
example: {
|
|
104
|
+
apiKey: "key-id:key-secret"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
healthCheck: {
|
|
108
|
+
method: "custom",
|
|
109
|
+
timeoutMs: 7000
|
|
110
|
+
},
|
|
111
|
+
docsUrl: "https://fal.ai/models",
|
|
112
|
+
byokSetup: {
|
|
113
|
+
setupInstructions: "Create a Fal API key and ensure image generation model access is enabled."
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
function registerFalImageIntegration(registry) {
|
|
117
|
+
return registry.register(falImageIntegrationSpec);
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
registerFalImageIntegration,
|
|
121
|
+
falImageIntegrationSpec
|
|
122
|
+
};
|
|
@@ -52,7 +52,7 @@ var falIntegrationSpec = defineIntegration({
|
|
|
52
52
|
meta: {
|
|
53
53
|
key: "ai-voice.fal",
|
|
54
54
|
version: "1.0.0",
|
|
55
|
-
category: "ai-voice",
|
|
55
|
+
category: "ai-voice-tts",
|
|
56
56
|
title: "Fal Chatterbox Text-to-Speech",
|
|
57
57
|
description: "Fal integration for voice synthesis using Chatterbox text-to-speech models.",
|
|
58
58
|
domain: "ai",
|
|
@@ -62,7 +62,7 @@ var falIntegrationSpec = defineIntegration({
|
|
|
62
62
|
},
|
|
63
63
|
supportedModes: ["byok"],
|
|
64
64
|
capabilities: {
|
|
65
|
-
provides: [{ key: "ai.voice.
|
|
65
|
+
provides: [{ key: "ai.voice.tts", version: "1.0.0" }]
|
|
66
66
|
},
|
|
67
67
|
configSchema: {
|
|
68
68
|
schema: {
|
|
@@ -52,7 +52,7 @@ var gradiumIntegrationSpec = defineIntegration({
|
|
|
52
52
|
meta: {
|
|
53
53
|
key: "ai-voice.gradium",
|
|
54
54
|
version: "1.0.0",
|
|
55
|
-
category: "ai-voice",
|
|
55
|
+
category: "ai-voice-tts",
|
|
56
56
|
title: "Gradium Text-to-Speech",
|
|
57
57
|
description: "Gradium integration for low-latency voice synthesis and voice catalog access.",
|
|
58
58
|
domain: "ai",
|
|
@@ -62,7 +62,7 @@ var gradiumIntegrationSpec = defineIntegration({
|
|
|
62
62
|
},
|
|
63
63
|
supportedModes: ["byok"],
|
|
64
64
|
capabilities: {
|
|
65
|
-
provides: [{ key: "ai.voice.
|
|
65
|
+
provides: [{ key: "ai.voice.tts", version: "1.0.0" }]
|
|
66
66
|
},
|
|
67
67
|
configSchema: {
|
|
68
68
|
schema: {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
7
|
+
var __toCommonJS = (from) => {
|
|
8
|
+
var entry = __moduleCache.get(from), desc;
|
|
9
|
+
if (entry)
|
|
10
|
+
return entry;
|
|
11
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
13
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
}));
|
|
17
|
+
__moduleCache.set(from, entry);
|
|
18
|
+
return entry;
|
|
19
|
+
};
|
|
20
|
+
var __export = (target, all) => {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, {
|
|
23
|
+
get: all[name],
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
set: (newValue) => all[name] = () => newValue
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
30
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
31
|
+
|
|
32
|
+
// src/integrations/providers/image.ts
|
|
33
|
+
var IMAGE_PRESETS = {
|
|
34
|
+
ogImage: { width: 1200, height: 630 },
|
|
35
|
+
twitterCard: { width: 1200, height: 675 },
|
|
36
|
+
instagramSquare: { width: 1080, height: 1080 },
|
|
37
|
+
instagramStory: { width: 1080, height: 1920 },
|
|
38
|
+
blogHero: { width: 1920, height: 1080 },
|
|
39
|
+
thumbnail: { width: 640, height: 360 },
|
|
40
|
+
favicon: { width: 512, height: 512 },
|
|
41
|
+
emailHeader: { width: 600, height: 200 },
|
|
42
|
+
illustration: { width: 1024, height: 1024 }
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
IMAGE_PRESETS
|
|
46
|
+
};
|