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