@contractspec/lib.contracts-integrations 2.3.0 → 2.5.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/index.js +381 -55
- package/dist/integrations/index.js +379 -53
- package/dist/integrations/providers/deepgram.d.ts +3 -0
- package/dist/integrations/providers/deepgram.js +99 -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 +92 -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 +16 -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 +96 -0
- package/dist/integrations/providers/openai-realtime.d.ts +3 -0
- package/dist/integrations/providers/openai-realtime.js +97 -0
- package/dist/integrations/providers/registry.js +192 -33
- package/dist/integrations/providers/video.d.ts +10 -0
- 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/index.js +381 -55
- package/dist/node/integrations/index.js +379 -53
- package/dist/node/integrations/providers/deepgram.js +98 -0
- package/dist/node/integrations/providers/elevenlabs.js +6 -3
- package/dist/node/integrations/providers/fal-image.js +91 -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 +15 -0
- package/dist/node/integrations/providers/index.js +380 -54
- package/dist/node/integrations/providers/openai-image.js +95 -0
- package/dist/node/integrations/providers/openai-realtime.js +96 -0
- package/dist/node/integrations/providers/registry.js +192 -33
- package/dist/node/integrations/providers/voice-video-sync.js +0 -0
- package/package.json +77 -5
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// src/integrations/spec.ts
|
|
2
|
+
import { SpecContractRegistry } from "@contractspec/lib.contracts-spec/registry";
|
|
3
|
+
var integrationKey = (meta) => `${meta.key}.v${meta.version}`;
|
|
4
|
+
|
|
5
|
+
class IntegrationSpecRegistry extends SpecContractRegistry {
|
|
6
|
+
constructor(items) {
|
|
7
|
+
super("integration", items);
|
|
8
|
+
}
|
|
9
|
+
getByCategory(category) {
|
|
10
|
+
return this.list().filter((spec) => spec.meta.category === category);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function makeIntegrationSpecKey(meta) {
|
|
14
|
+
return integrationKey(meta);
|
|
15
|
+
}
|
|
16
|
+
var defineIntegration = (spec) => spec;
|
|
17
|
+
|
|
18
|
+
// src/integrations/providers/deepgram.ts
|
|
19
|
+
import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
|
|
20
|
+
var deepgramIntegrationSpec = defineIntegration({
|
|
21
|
+
meta: {
|
|
22
|
+
key: "ai-voice-stt.deepgram",
|
|
23
|
+
version: "1.0.0",
|
|
24
|
+
category: "ai-voice-stt",
|
|
25
|
+
title: "Deepgram Speech-to-Text",
|
|
26
|
+
description: "Deepgram integration for real-time and batch speech-to-text transcription with speaker diarization.",
|
|
27
|
+
domain: "ai",
|
|
28
|
+
owners: ["platform.ai"],
|
|
29
|
+
tags: ["voice", "stt", "transcription", "diarization"],
|
|
30
|
+
stability: StabilityEnum.Experimental
|
|
31
|
+
},
|
|
32
|
+
supportedModes: ["byok"],
|
|
33
|
+
capabilities: {
|
|
34
|
+
provides: [
|
|
35
|
+
{ key: "ai.voice.stt", version: "1.0.0" },
|
|
36
|
+
{ key: "ai.voice.conversational", version: "1.0.0" }
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
configSchema: {
|
|
40
|
+
schema: {
|
|
41
|
+
type: "object",
|
|
42
|
+
properties: {
|
|
43
|
+
model: {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "Deepgram model to use (e.g. nova-3, nova-2, enhanced)."
|
|
46
|
+
},
|
|
47
|
+
language: {
|
|
48
|
+
type: "string",
|
|
49
|
+
description: "Default language code for transcription (e.g. en-US)."
|
|
50
|
+
},
|
|
51
|
+
enableDiarization: {
|
|
52
|
+
type: "boolean",
|
|
53
|
+
description: "Enable speaker diarization by default."
|
|
54
|
+
},
|
|
55
|
+
enableSmartFormat: {
|
|
56
|
+
type: "boolean",
|
|
57
|
+
description: "Enable smart formatting (punctuation, capitalization)."
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
example: {
|
|
62
|
+
model: "nova-3",
|
|
63
|
+
language: "en-US",
|
|
64
|
+
enableDiarization: true,
|
|
65
|
+
enableSmartFormat: true
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
secretSchema: {
|
|
69
|
+
schema: {
|
|
70
|
+
type: "object",
|
|
71
|
+
required: ["apiKey"],
|
|
72
|
+
properties: {
|
|
73
|
+
apiKey: {
|
|
74
|
+
type: "string",
|
|
75
|
+
description: "Deepgram API key with transcription permissions."
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
example: {
|
|
80
|
+
apiKey: "dg_***"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
healthCheck: {
|
|
84
|
+
method: "custom",
|
|
85
|
+
timeoutMs: 5000
|
|
86
|
+
},
|
|
87
|
+
docsUrl: "https://developers.deepgram.com/docs",
|
|
88
|
+
byokSetup: {
|
|
89
|
+
setupInstructions: "Create a Deepgram API key with speech-to-text permissions and store it in your secret provider."
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
function registerDeepgramIntegration(registry) {
|
|
93
|
+
return registry.register(deepgramIntegrationSpec);
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
registerDeepgramIntegration,
|
|
97
|
+
deepgramIntegrationSpec
|
|
98
|
+
};
|
|
@@ -21,17 +21,20 @@ var elevenLabsIntegrationSpec = defineIntegration({
|
|
|
21
21
|
meta: {
|
|
22
22
|
key: "ai-voice.elevenlabs",
|
|
23
23
|
version: "1.0.0",
|
|
24
|
-
category: "ai-voice",
|
|
24
|
+
category: "ai-voice-tts",
|
|
25
25
|
title: "ElevenLabs Text-to-Speech",
|
|
26
26
|
description: "ElevenLabs integration for neural voice synthesis and voice catalog access.",
|
|
27
27
|
domain: "ai",
|
|
28
28
|
owners: ["platform.ai"],
|
|
29
|
-
tags: ["voice", "tts"],
|
|
29
|
+
tags: ["voice", "tts", "stt"],
|
|
30
30
|
stability: StabilityEnum.Beta
|
|
31
31
|
},
|
|
32
32
|
supportedModes: ["managed", "byok"],
|
|
33
33
|
capabilities: {
|
|
34
|
-
provides: [
|
|
34
|
+
provides: [
|
|
35
|
+
{ key: "ai.voice.tts", version: "1.0.0" },
|
|
36
|
+
{ key: "ai.voice.stt", version: "1.0.0" }
|
|
37
|
+
]
|
|
35
38
|
},
|
|
36
39
|
configSchema: {
|
|
37
40
|
schema: {
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// src/integrations/spec.ts
|
|
2
|
+
import { SpecContractRegistry } from "@contractspec/lib.contracts-spec/registry";
|
|
3
|
+
var integrationKey = (meta) => `${meta.key}.v${meta.version}`;
|
|
4
|
+
|
|
5
|
+
class IntegrationSpecRegistry extends SpecContractRegistry {
|
|
6
|
+
constructor(items) {
|
|
7
|
+
super("integration", items);
|
|
8
|
+
}
|
|
9
|
+
getByCategory(category) {
|
|
10
|
+
return this.list().filter((spec) => spec.meta.category === category);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function makeIntegrationSpecKey(meta) {
|
|
14
|
+
return integrationKey(meta);
|
|
15
|
+
}
|
|
16
|
+
var defineIntegration = (spec) => spec;
|
|
17
|
+
|
|
18
|
+
// src/integrations/providers/fal-image.ts
|
|
19
|
+
import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
|
|
20
|
+
var falImageIntegrationSpec = defineIntegration({
|
|
21
|
+
meta: {
|
|
22
|
+
key: "ai-image.fal",
|
|
23
|
+
version: "1.0.0",
|
|
24
|
+
category: "ai-image",
|
|
25
|
+
title: "Fal Image Generation",
|
|
26
|
+
description: "Fal integration for AI image generation using Flux and Stable Diffusion models.",
|
|
27
|
+
domain: "ai",
|
|
28
|
+
owners: ["platform.ai"],
|
|
29
|
+
tags: ["image", "generation", "flux", "stable-diffusion"],
|
|
30
|
+
stability: StabilityEnum.Experimental
|
|
31
|
+
},
|
|
32
|
+
supportedModes: ["byok"],
|
|
33
|
+
capabilities: {
|
|
34
|
+
provides: [{ key: "ai.image.generation", version: "1.0.0" }]
|
|
35
|
+
},
|
|
36
|
+
configSchema: {
|
|
37
|
+
schema: {
|
|
38
|
+
type: "object",
|
|
39
|
+
properties: {
|
|
40
|
+
modelId: {
|
|
41
|
+
type: "string",
|
|
42
|
+
description: "Fal model endpoint (e.g. fal-ai/flux/dev)."
|
|
43
|
+
},
|
|
44
|
+
defaultFormat: {
|
|
45
|
+
type: "string",
|
|
46
|
+
enum: ["png", "jpg", "webp"]
|
|
47
|
+
},
|
|
48
|
+
defaultGuidanceScale: {
|
|
49
|
+
type: "number",
|
|
50
|
+
minimum: 1,
|
|
51
|
+
maximum: 20
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
example: {
|
|
56
|
+
modelId: "fal-ai/flux/dev",
|
|
57
|
+
defaultFormat: "png",
|
|
58
|
+
defaultGuidanceScale: 7.5
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
secretSchema: {
|
|
62
|
+
schema: {
|
|
63
|
+
type: "object",
|
|
64
|
+
required: ["apiKey"],
|
|
65
|
+
properties: {
|
|
66
|
+
apiKey: {
|
|
67
|
+
type: "string",
|
|
68
|
+
description: "Fal API key (FAL_KEY)."
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
example: {
|
|
73
|
+
apiKey: "key-id:key-secret"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
healthCheck: {
|
|
77
|
+
method: "custom",
|
|
78
|
+
timeoutMs: 7000
|
|
79
|
+
},
|
|
80
|
+
docsUrl: "https://fal.ai/models",
|
|
81
|
+
byokSetup: {
|
|
82
|
+
setupInstructions: "Create a Fal API key and ensure image generation model access is enabled."
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
function registerFalImageIntegration(registry) {
|
|
86
|
+
return registry.register(falImageIntegrationSpec);
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
registerFalImageIntegration,
|
|
90
|
+
falImageIntegrationSpec
|
|
91
|
+
};
|
|
@@ -21,7 +21,7 @@ var falIntegrationSpec = defineIntegration({
|
|
|
21
21
|
meta: {
|
|
22
22
|
key: "ai-voice.fal",
|
|
23
23
|
version: "1.0.0",
|
|
24
|
-
category: "ai-voice",
|
|
24
|
+
category: "ai-voice-tts",
|
|
25
25
|
title: "Fal Chatterbox Text-to-Speech",
|
|
26
26
|
description: "Fal integration for voice synthesis using Chatterbox text-to-speech models.",
|
|
27
27
|
domain: "ai",
|
|
@@ -31,7 +31,7 @@ var falIntegrationSpec = defineIntegration({
|
|
|
31
31
|
},
|
|
32
32
|
supportedModes: ["byok"],
|
|
33
33
|
capabilities: {
|
|
34
|
-
provides: [{ key: "ai.voice.
|
|
34
|
+
provides: [{ key: "ai.voice.tts", version: "1.0.0" }]
|
|
35
35
|
},
|
|
36
36
|
configSchema: {
|
|
37
37
|
schema: {
|
|
@@ -21,7 +21,7 @@ var gradiumIntegrationSpec = defineIntegration({
|
|
|
21
21
|
meta: {
|
|
22
22
|
key: "ai-voice.gradium",
|
|
23
23
|
version: "1.0.0",
|
|
24
|
-
category: "ai-voice",
|
|
24
|
+
category: "ai-voice-tts",
|
|
25
25
|
title: "Gradium Text-to-Speech",
|
|
26
26
|
description: "Gradium integration for low-latency voice synthesis and voice catalog access.",
|
|
27
27
|
domain: "ai",
|
|
@@ -31,7 +31,7 @@ var gradiumIntegrationSpec = defineIntegration({
|
|
|
31
31
|
},
|
|
32
32
|
supportedModes: ["byok"],
|
|
33
33
|
capabilities: {
|
|
34
|
-
provides: [{ key: "ai.voice.
|
|
34
|
+
provides: [{ key: "ai.voice.tts", version: "1.0.0" }]
|
|
35
35
|
},
|
|
36
36
|
configSchema: {
|
|
37
37
|
schema: {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/integrations/providers/image.ts
|
|
2
|
+
var IMAGE_PRESETS = {
|
|
3
|
+
ogImage: { width: 1200, height: 630 },
|
|
4
|
+
twitterCard: { width: 1200, height: 675 },
|
|
5
|
+
instagramSquare: { width: 1080, height: 1080 },
|
|
6
|
+
instagramStory: { width: 1080, height: 1920 },
|
|
7
|
+
blogHero: { width: 1920, height: 1080 },
|
|
8
|
+
thumbnail: { width: 640, height: 360 },
|
|
9
|
+
favicon: { width: 512, height: 512 },
|
|
10
|
+
emailHeader: { width: 600, height: 200 },
|
|
11
|
+
illustration: { width: 1024, height: 1024 }
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
IMAGE_PRESETS
|
|
15
|
+
};
|