@contractspec/lib.contracts-spec 2.4.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/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,126 @@
|
|
|
1
|
+
// @bun
|
|
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 = import.meta.require;
|
|
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/openai-image.ts
|
|
50
|
+
import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
|
|
51
|
+
var openaiImageIntegrationSpec = defineIntegration({
|
|
52
|
+
meta: {
|
|
53
|
+
key: "ai-image.openai",
|
|
54
|
+
version: "1.0.0",
|
|
55
|
+
category: "ai-image",
|
|
56
|
+
title: "OpenAI Image Generation",
|
|
57
|
+
description: "OpenAI integration for AI image generation using DALL-E and gpt-image models.",
|
|
58
|
+
domain: "ai",
|
|
59
|
+
owners: ["platform.ai"],
|
|
60
|
+
tags: ["image", "generation", "dall-e", "gpt-image"],
|
|
61
|
+
stability: StabilityEnum.Experimental
|
|
62
|
+
},
|
|
63
|
+
supportedModes: ["managed", "byok"],
|
|
64
|
+
capabilities: {
|
|
65
|
+
provides: [{ key: "ai.image.generation", version: "1.0.0" }]
|
|
66
|
+
},
|
|
67
|
+
configSchema: {
|
|
68
|
+
schema: {
|
|
69
|
+
type: "object",
|
|
70
|
+
properties: {
|
|
71
|
+
model: {
|
|
72
|
+
type: "string",
|
|
73
|
+
description: "OpenAI image model identifier (e.g. dall-e-3, gpt-image-1)."
|
|
74
|
+
},
|
|
75
|
+
defaultSize: {
|
|
76
|
+
type: "string",
|
|
77
|
+
enum: ["1024x1024", "1024x1792", "1792x1024"]
|
|
78
|
+
},
|
|
79
|
+
defaultQuality: {
|
|
80
|
+
type: "string",
|
|
81
|
+
enum: ["standard", "hd"]
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
example: {
|
|
86
|
+
model: "dall-e-3",
|
|
87
|
+
defaultSize: "1024x1024",
|
|
88
|
+
defaultQuality: "standard"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
secretSchema: {
|
|
92
|
+
schema: {
|
|
93
|
+
type: "object",
|
|
94
|
+
required: ["apiKey"],
|
|
95
|
+
properties: {
|
|
96
|
+
apiKey: {
|
|
97
|
+
type: "string",
|
|
98
|
+
description: "OpenAI API key with image generation permissions."
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
example: {
|
|
103
|
+
apiKey: "sk-***"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
healthCheck: {
|
|
107
|
+
method: "custom",
|
|
108
|
+
timeoutMs: 5000
|
|
109
|
+
},
|
|
110
|
+
docsUrl: "https://platform.openai.com/docs/guides/images",
|
|
111
|
+
constraints: {
|
|
112
|
+
rateLimit: {
|
|
113
|
+
rpm: 50
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
byokSetup: {
|
|
117
|
+
setupInstructions: "Create an OpenAI API key with image generation access enabled."
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
function registerOpenaiImageIntegration(registry) {
|
|
121
|
+
return registry.register(openaiImageIntegrationSpec);
|
|
122
|
+
}
|
|
123
|
+
export {
|
|
124
|
+
registerOpenaiImageIntegration,
|
|
125
|
+
openaiImageIntegrationSpec
|
|
126
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// @bun
|
|
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 = import.meta.require;
|
|
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/openai-realtime.ts
|
|
50
|
+
import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
|
|
51
|
+
var openaiRealtimeIntegrationSpec = defineIntegration({
|
|
52
|
+
meta: {
|
|
53
|
+
key: "ai-voice-conv.openai",
|
|
54
|
+
version: "1.0.0",
|
|
55
|
+
category: "ai-voice-conversational",
|
|
56
|
+
title: "OpenAI Realtime Voice",
|
|
57
|
+
description: "OpenAI Realtime API integration for bidirectional conversational voice with GPT models.",
|
|
58
|
+
domain: "ai",
|
|
59
|
+
owners: ["platform.ai"],
|
|
60
|
+
tags: ["voice", "conversational", "realtime", "openai"],
|
|
61
|
+
stability: StabilityEnum.Experimental
|
|
62
|
+
},
|
|
63
|
+
supportedModes: ["byok"],
|
|
64
|
+
capabilities: {
|
|
65
|
+
provides: [{ key: "ai.voice.conversational", version: "1.0.0" }]
|
|
66
|
+
},
|
|
67
|
+
configSchema: {
|
|
68
|
+
schema: {
|
|
69
|
+
type: "object",
|
|
70
|
+
properties: {
|
|
71
|
+
model: {
|
|
72
|
+
type: "string",
|
|
73
|
+
description: "OpenAI model for realtime conversations (e.g. gpt-4o-realtime-preview)."
|
|
74
|
+
},
|
|
75
|
+
defaultVoice: {
|
|
76
|
+
type: "string",
|
|
77
|
+
description: "Default voice for agent responses (e.g. alloy, echo, shimmer)."
|
|
78
|
+
},
|
|
79
|
+
turnDetection: {
|
|
80
|
+
type: "string",
|
|
81
|
+
enum: ["server_vad", "push_to_talk"],
|
|
82
|
+
description: "Turn detection strategy."
|
|
83
|
+
},
|
|
84
|
+
maxSessionDurationSeconds: {
|
|
85
|
+
type: "number",
|
|
86
|
+
description: "Maximum session duration in seconds."
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
example: {
|
|
91
|
+
model: "gpt-4o-realtime-preview",
|
|
92
|
+
defaultVoice: "alloy",
|
|
93
|
+
turnDetection: "server_vad",
|
|
94
|
+
maxSessionDurationSeconds: 600
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
secretSchema: {
|
|
98
|
+
schema: {
|
|
99
|
+
type: "object",
|
|
100
|
+
required: ["apiKey"],
|
|
101
|
+
properties: {
|
|
102
|
+
apiKey: {
|
|
103
|
+
type: "string",
|
|
104
|
+
description: "OpenAI API key with realtime API access."
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
example: {
|
|
109
|
+
apiKey: "sk-***"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
healthCheck: {
|
|
113
|
+
method: "custom",
|
|
114
|
+
timeoutMs: 5000
|
|
115
|
+
},
|
|
116
|
+
docsUrl: "https://platform.openai.com/docs/guides/realtime",
|
|
117
|
+
byokSetup: {
|
|
118
|
+
setupInstructions: "Create an OpenAI API key with Realtime API access enabled and store it in your secret provider."
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
function registerOpenaiRealtimeIntegration(registry) {
|
|
122
|
+
return registry.register(openaiRealtimeIntegrationSpec);
|
|
123
|
+
}
|
|
124
|
+
export {
|
|
125
|
+
registerOpenaiRealtimeIntegration,
|
|
126
|
+
openaiRealtimeIntegrationSpec
|
|
127
|
+
};
|