@jini-ai/integrations 0.3.5 → 0.4.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/CHANGELOG.md +84 -0
- package/README.md +72 -24
- package/dist/args.d.ts +8 -0
- package/dist/args.js +10 -0
- package/dist/argument-error.d.ts +9 -0
- package/dist/argument-error.js +7 -0
- package/dist/credentialed-http/auth-schemes.d.ts +29 -0
- package/dist/credentialed-http/auth-schemes.js +60 -0
- package/dist/credentialed-http/credentialed-request.d.ts +132 -0
- package/dist/credentialed-http/credentialed-request.js +365 -0
- package/dist/credentialed-http/index.d.ts +4 -0
- package/dist/credentialed-http/index.js +4 -0
- package/dist/credentialed-http/ports.d.ts +42 -0
- package/dist/credentialed-http/ports.js +2 -0
- package/dist/media-providers/capability-registry.d.ts +12 -4
- package/dist/media-providers/capability-registry.js +6 -6
- package/dist/media-providers/dispatch/async-operation-store.d.ts +33 -8
- package/dist/media-providers/dispatch/async-operation-store.js +20 -32
- package/dist/media-providers/dispatch/context.d.ts +7 -2
- package/dist/media-providers/dispatch/context.js +1 -1
- package/dist/media-providers/dispatch/credentials.d.ts +4 -1
- package/dist/media-providers/dispatch/credentials.js +1 -1
- package/dist/media-providers/dispatch/engine.d.ts +5 -2
- package/dist/media-providers/dispatch/engine.js +23 -15
- package/dist/media-providers/dispatch/index.d.ts +4 -1
- package/dist/media-providers/dispatch/index.js +4 -2
- package/dist/media-providers/dispatch/openai-compatible.d.ts +12 -2
- package/dist/media-providers/dispatch/openai-compatible.js +9 -5
- package/dist/media-providers/dispatch/operation-runtime.d.ts +16 -8
- package/dist/media-providers/dispatch/operation-runtime.js +93 -76
- package/dist/media-providers/dispatch/outbound.d.ts +31 -0
- package/dist/media-providers/dispatch/outbound.js +54 -0
- package/dist/media-providers/dispatch/polling-adapter.d.ts +26 -8
- package/dist/media-providers/dispatch/polling-adapter.js +2 -2
- package/dist/media-providers/dispatch/providers/aihubmix-shared.d.ts +2 -2
- package/dist/media-providers/dispatch/providers/aihubmix-shared.js +2 -2
- package/dist/media-providers/dispatch/providers/aihubmix.d.ts +8 -2
- package/dist/media-providers/dispatch/providers/aihubmix.js +15 -15
- package/dist/media-providers/dispatch/providers/custom-image.d.ts +11 -2
- package/dist/media-providers/dispatch/providers/custom-image.js +9 -8
- package/dist/media-providers/dispatch/providers/elevenlabs.d.ts +8 -2
- package/dist/media-providers/dispatch/providers/elevenlabs.js +13 -13
- package/dist/media-providers/dispatch/providers/fishaudio.d.ts +4 -1
- package/dist/media-providers/dispatch/providers/fishaudio.js +7 -7
- package/dist/media-providers/dispatch/providers/grok.d.ts +11 -3
- package/dist/media-providers/dispatch/providers/grok.js +16 -16
- package/dist/media-providers/dispatch/providers/imagerouter-video-async.d.ts +1 -1
- package/dist/media-providers/dispatch/providers/imagerouter-video-async.js +23 -22
- package/dist/media-providers/dispatch/providers/imagerouter.d.ts +12 -3
- package/dist/media-providers/dispatch/providers/imagerouter.js +18 -18
- package/dist/media-providers/dispatch/providers/minimax.d.ts +4 -1
- package/dist/media-providers/dispatch/providers/minimax.js +6 -6
- package/dist/media-providers/dispatch/providers/nanobanana.d.ts +4 -1
- package/dist/media-providers/dispatch/providers/nanobanana.js +7 -7
- package/dist/media-providers/dispatch/providers/openai.d.ts +8 -2
- package/dist/media-providers/dispatch/providers/openai.js +20 -27
- package/dist/media-providers/dispatch/providers/openrouter.d.ts +7 -2
- package/dist/media-providers/dispatch/providers/openrouter.js +11 -11
- package/dist/media-providers/dispatch/providers/senseaudio.d.ts +8 -2
- package/dist/media-providers/dispatch/providers/senseaudio.js +13 -13
- package/dist/media-providers/dispatch/providers/volcengine.d.ts +4 -1
- package/dist/media-providers/dispatch/providers/volcengine.js +8 -8
- package/dist/media-providers/dispatch/response-parsers.d.ts +21 -7
- package/dist/media-providers/dispatch/response-parsers.js +15 -11
- package/dist/media-providers/dispatch/sqlite-async-operation-store.d.ts +3 -1
- package/dist/media-providers/dispatch/sqlite-async-operation-store.js +53 -39
- package/dist/media-providers/dispatch/ssrf-guard.d.ts +27 -14
- package/dist/media-providers/dispatch/ssrf-guard.js +46 -105
- package/dist/media-providers/dispatch/stub.d.ts +7 -2
- package/dist/media-providers/dispatch/stub.js +4 -3
- package/dist/media-providers/dispatch/types.d.ts +17 -13
- package/dist/media-providers/dispatch/vendor-adapter.d.ts +22 -5
- package/dist/media-providers/dispatch/vendor-adapter.js +13 -10
- package/dist/media-providers/dispatch/vendor-registry.d.ts +14 -4
- package/dist/media-providers/dispatch/vendor-registry.js +3 -3
- package/dist/media-providers/index.d.ts +1 -1
- package/dist/media-providers/index.js +1 -1
- package/dist/media-providers/policy.d.ts +3 -2
- package/dist/media-providers/policy.js +4 -2
- package/dist/media-providers/providers.d.ts +12 -4
- package/dist/media-providers/providers.js +3 -3
- package/dist/media-providers/staging.d.ts +8 -2
- package/dist/media-providers/staging.js +13 -4
- package/dist/media-providers/task-store.d.ts +2 -2
- package/dist/media-providers/task-store.js +2 -2
- package/dist/media-providers/tokens.js +3 -3
- package/dist/media-providers/types.d.ts +4 -4
- package/dist/media-providers/types.js +1 -1
- package/dist/media-providers/video-request.d.ts +32 -9
- package/dist/media-providers/video-request.js +15 -15
- package/dist/webhooks/delivery.d.ts +76 -0
- package/dist/webhooks/delivery.js +222 -0
- package/dist/webhooks/index.d.ts +7 -0
- package/dist/webhooks/index.js +7 -0
- package/dist/webhooks/ports.d.ts +113 -0
- package/dist/webhooks/ports.js +2 -0
- package/dist/webhooks/signing.d.ts +38 -0
- package/dist/webhooks/signing.js +83 -0
- package/dist/webhooks/signing.keyring.d.ts +8 -0
- package/dist/webhooks/signing.keyring.js +18 -0
- package/dist/webhooks/subscriptions.d.ts +78 -0
- package/dist/webhooks/subscriptions.js +139 -0
- package/dist/webhooks/types.d.ts +103 -0
- package/dist/webhooks/types.js +2 -0
- package/package.json +29 -18
- package/dist/composio/bounded-data.d.ts.map +0 -1
- package/dist/composio/bounded-data.js.map +0 -1
- package/dist/composio/catalog.d.ts.map +0 -1
- package/dist/composio/catalog.js.map +0 -1
- package/dist/composio/composio-config.d.ts.map +0 -1
- package/dist/composio/composio-config.js.map +0 -1
- package/dist/composio/composio-descriptions.d.ts.map +0 -1
- package/dist/composio/composio-descriptions.js.map +0 -1
- package/dist/composio/composio.d.ts.map +0 -1
- package/dist/composio/composio.js.map +0 -1
- package/dist/composio/errors.d.ts.map +0 -1
- package/dist/composio/errors.js.map +0 -1
- package/dist/composio/file-lock.d.ts.map +0 -1
- package/dist/composio/file-lock.js.map +0 -1
- package/dist/composio/index.d.ts.map +0 -1
- package/dist/composio/index.js.map +0 -1
- package/dist/composio/json-schema.d.ts.map +0 -1
- package/dist/composio/json-schema.js.map +0 -1
- package/dist/composio/output-protection.d.ts.map +0 -1
- package/dist/composio/output-protection.js.map +0 -1
- package/dist/composio/service.d.ts.map +0 -1
- package/dist/composio/service.js.map +0 -1
- package/dist/media-providers/capability-registry.d.ts.map +0 -1
- package/dist/media-providers/capability-registry.js.map +0 -1
- package/dist/media-providers/catalog.d.ts.map +0 -1
- package/dist/media-providers/catalog.js.map +0 -1
- package/dist/media-providers/dispatch/async-operation-store.d.ts.map +0 -1
- package/dist/media-providers/dispatch/async-operation-store.js.map +0 -1
- package/dist/media-providers/dispatch/context.d.ts.map +0 -1
- package/dist/media-providers/dispatch/context.js.map +0 -1
- package/dist/media-providers/dispatch/credentials.d.ts.map +0 -1
- package/dist/media-providers/dispatch/credentials.js.map +0 -1
- package/dist/media-providers/dispatch/engine.d.ts.map +0 -1
- package/dist/media-providers/dispatch/engine.js.map +0 -1
- package/dist/media-providers/dispatch/index.d.ts.map +0 -1
- package/dist/media-providers/dispatch/index.js.map +0 -1
- package/dist/media-providers/dispatch/openai-compatible.d.ts.map +0 -1
- package/dist/media-providers/dispatch/openai-compatible.js.map +0 -1
- package/dist/media-providers/dispatch/operation-runtime.d.ts.map +0 -1
- package/dist/media-providers/dispatch/operation-runtime.js.map +0 -1
- package/dist/media-providers/dispatch/polling-adapter.d.ts.map +0 -1
- package/dist/media-providers/dispatch/polling-adapter.js.map +0 -1
- package/dist/media-providers/dispatch/providers/aihubmix-shared.d.ts.map +0 -1
- package/dist/media-providers/dispatch/providers/aihubmix-shared.js.map +0 -1
- package/dist/media-providers/dispatch/providers/aihubmix.d.ts.map +0 -1
- package/dist/media-providers/dispatch/providers/aihubmix.js.map +0 -1
- package/dist/media-providers/dispatch/providers/custom-image.d.ts.map +0 -1
- package/dist/media-providers/dispatch/providers/custom-image.js.map +0 -1
- package/dist/media-providers/dispatch/providers/elevenlabs.d.ts.map +0 -1
- package/dist/media-providers/dispatch/providers/elevenlabs.js.map +0 -1
- package/dist/media-providers/dispatch/providers/fishaudio.d.ts.map +0 -1
- package/dist/media-providers/dispatch/providers/fishaudio.js.map +0 -1
- package/dist/media-providers/dispatch/providers/grok.d.ts.map +0 -1
- package/dist/media-providers/dispatch/providers/grok.js.map +0 -1
- package/dist/media-providers/dispatch/providers/imagerouter-video-async.d.ts.map +0 -1
- package/dist/media-providers/dispatch/providers/imagerouter-video-async.js.map +0 -1
- package/dist/media-providers/dispatch/providers/imagerouter.d.ts.map +0 -1
- package/dist/media-providers/dispatch/providers/imagerouter.js.map +0 -1
- package/dist/media-providers/dispatch/providers/minimax.d.ts.map +0 -1
- package/dist/media-providers/dispatch/providers/minimax.js.map +0 -1
- package/dist/media-providers/dispatch/providers/nanobanana.d.ts.map +0 -1
- package/dist/media-providers/dispatch/providers/nanobanana.js.map +0 -1
- package/dist/media-providers/dispatch/providers/openai.d.ts.map +0 -1
- package/dist/media-providers/dispatch/providers/openai.js.map +0 -1
- package/dist/media-providers/dispatch/providers/openrouter.d.ts.map +0 -1
- package/dist/media-providers/dispatch/providers/openrouter.js.map +0 -1
- package/dist/media-providers/dispatch/providers/senseaudio.d.ts.map +0 -1
- package/dist/media-providers/dispatch/providers/senseaudio.js.map +0 -1
- package/dist/media-providers/dispatch/providers/volcengine.d.ts.map +0 -1
- package/dist/media-providers/dispatch/providers/volcengine.js.map +0 -1
- package/dist/media-providers/dispatch/response-parsers.d.ts.map +0 -1
- package/dist/media-providers/dispatch/response-parsers.js.map +0 -1
- package/dist/media-providers/dispatch/sqlite-async-operation-store.d.ts.map +0 -1
- package/dist/media-providers/dispatch/sqlite-async-operation-store.js.map +0 -1
- package/dist/media-providers/dispatch/ssrf-guard.d.ts.map +0 -1
- package/dist/media-providers/dispatch/ssrf-guard.js.map +0 -1
- package/dist/media-providers/dispatch/stub.d.ts.map +0 -1
- package/dist/media-providers/dispatch/stub.js.map +0 -1
- package/dist/media-providers/dispatch/types.d.ts.map +0 -1
- package/dist/media-providers/dispatch/types.js.map +0 -1
- package/dist/media-providers/dispatch/vendor-adapter.d.ts.map +0 -1
- package/dist/media-providers/dispatch/vendor-adapter.js.map +0 -1
- package/dist/media-providers/dispatch/vendor-registry.d.ts.map +0 -1
- package/dist/media-providers/dispatch/vendor-registry.js.map +0 -1
- package/dist/media-providers/index.d.ts.map +0 -1
- package/dist/media-providers/index.js.map +0 -1
- package/dist/media-providers/policy.d.ts.map +0 -1
- package/dist/media-providers/policy.js.map +0 -1
- package/dist/media-providers/providers.d.ts.map +0 -1
- package/dist/media-providers/providers.js.map +0 -1
- package/dist/media-providers/seed.d.ts.map +0 -1
- package/dist/media-providers/seed.js.map +0 -1
- package/dist/media-providers/sqlite-task-store.d.ts.map +0 -1
- package/dist/media-providers/sqlite-task-store.js.map +0 -1
- package/dist/media-providers/staging.d.ts.map +0 -1
- package/dist/media-providers/staging.js.map +0 -1
- package/dist/media-providers/task-store.d.ts.map +0 -1
- package/dist/media-providers/task-store.js.map +0 -1
- package/dist/media-providers/tokens.d.ts.map +0 -1
- package/dist/media-providers/tokens.js.map +0 -1
- package/dist/media-providers/types.d.ts.map +0 -1
- package/dist/media-providers/types.js.map +0 -1
- package/dist/media-providers/video-request.d.ts.map +0 -1
- package/dist/media-providers/video-request.js.map +0 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* `/v1/images/generations` + `/v1/images/edits` endpoint. Ported
|
|
4
4
|
* near-verbatim from Open Design's `apps/daemon/src/media/index.ts`
|
|
5
5
|
* `renderCustomOpenAIImage`/`customImageOverridesOpenAIModel` — see
|
|
6
|
-
* `
|
|
6
|
+
* `archived provenance ledger`.
|
|
7
7
|
*
|
|
8
8
|
* 2026-07-21: migrated onto the generic vendor-adapter dispatch engine
|
|
9
9
|
* (`vendor-adapter.ts`/`vendor-registry.ts`). External behavior is
|
|
@@ -31,7 +31,7 @@ import { dispatchVendorRequest } from '../vendor-adapter.js';
|
|
|
31
31
|
import { mediaVendorRegistry } from '../vendor-registry.js';
|
|
32
32
|
export const CUSTOM_IMAGE_MODEL_ID = 'custom-image';
|
|
33
33
|
const customImageAdapter = {
|
|
34
|
-
buildRequest(ctx, credentials) {
|
|
34
|
+
buildRequest({ ctx, credentials }) {
|
|
35
35
|
const baseUrl = (credentials.baseUrl || '').trim();
|
|
36
36
|
if (!baseUrl) {
|
|
37
37
|
throw new Error('Custom Image API base URL required — configure an OpenAI-compatible /v1/images/generations or /v1/images/edits endpoint');
|
|
@@ -69,9 +69,9 @@ const customImageAdapter = {
|
|
|
69
69
|
meta: { wireModel, size },
|
|
70
70
|
};
|
|
71
71
|
},
|
|
72
|
-
async parseResponse(resp, ctx, request) {
|
|
72
|
+
async parseResponse({ resp, ctx, request }) {
|
|
73
73
|
const data = await parseOpenAICompatibleJson(resp, 'custom image');
|
|
74
|
-
const bytes = await bytesFromOpenAICompatibleData(data, 'custom image', ctx
|
|
74
|
+
const bytes = await bytesFromOpenAICompatibleData({ data, providerTag: 'custom image' }, ctx);
|
|
75
75
|
return {
|
|
76
76
|
bytes,
|
|
77
77
|
providerNote: `custom-image/${request.meta.wireModel} · ${request.meta.size} · ${bytes.length} bytes`,
|
|
@@ -79,12 +79,13 @@ const customImageAdapter = {
|
|
|
79
79
|
};
|
|
80
80
|
},
|
|
81
81
|
};
|
|
82
|
-
mediaVendorRegistry.register('custom-image', 'image', customImageAdapter);
|
|
83
|
-
export async function renderCustomOpenAIImage(ctx, credentials) {
|
|
84
|
-
return dispatchVendorRequest(customImageAdapter, ctx, credentials);
|
|
82
|
+
mediaVendorRegistry.register({ providerId: 'custom-image', routeKey: 'image', adapter: customImageAdapter });
|
|
83
|
+
export async function renderCustomOpenAIImage({ ctx, credentials }) {
|
|
84
|
+
return dispatchVendorRequest({ adapter: customImageAdapter, ctx: ctx, credentials: credentials });
|
|
85
85
|
}
|
|
86
86
|
/** Whether the caller's `custom-image` credentials should override an `openai`-provider request (same model configured on both). */
|
|
87
|
-
export function customImageOverridesOpenAIModel(
|
|
87
|
+
export function customImageOverridesOpenAIModel(required) {
|
|
88
|
+
const { ctx, credentials } = required;
|
|
88
89
|
const baseUrl = credentials?.baseUrl?.trim();
|
|
89
90
|
const model = credentials?.model?.trim();
|
|
90
91
|
if (!baseUrl || !model)
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { ProviderCredentials, RenderContext, RenderResult } from '../types.js';
|
|
2
|
-
export declare function renderElevenLabsTTS(ctx
|
|
3
|
-
|
|
2
|
+
export declare function renderElevenLabsTTS({ ctx, credentials }: {
|
|
3
|
+
ctx: RenderContext;
|
|
4
|
+
credentials: ProviderCredentials;
|
|
5
|
+
}): Promise<RenderResult>;
|
|
6
|
+
export declare function renderElevenLabsSfx({ ctx, credentials }: {
|
|
7
|
+
ctx: RenderContext;
|
|
8
|
+
credentials: ProviderCredentials;
|
|
9
|
+
}): Promise<RenderResult>;
|
|
4
10
|
//# sourceMappingURL=elevenlabs.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Provider: ElevenLabs — v3 text-to-speech (`renderElevenLabsTTS`) and
|
|
3
3
|
* text-to-sound-effect (`renderElevenLabsSfx`), both synchronous. Ported
|
|
4
4
|
* near-verbatim from Open Design's `apps/daemon/src/media/index.ts`
|
|
5
|
-
* `renderElevenLabsTTS`/`renderElevenLabsSfx` — see `
|
|
5
|
+
* `renderElevenLabsTTS`/`renderElevenLabsSfx` — see `archived provenance ledger`.
|
|
6
6
|
*
|
|
7
7
|
* Neither endpoint returns the OpenAI-images/audio wire shape (both are
|
|
8
8
|
* ElevenLabs-specific JSON-body-in, raw-audio-bytes-out POSTs), so this
|
|
@@ -77,8 +77,8 @@ function assertElevenLabsSfxPromptLength(text) {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
const elevenLabsTTSAdapter = {
|
|
80
|
-
requireCredential: requireApiKey(NO_CREDENTIAL_MESSAGE),
|
|
81
|
-
buildRequest(ctx, credentials) {
|
|
80
|
+
requireCredential: requireApiKey({ message: NO_CREDENTIAL_MESSAGE }),
|
|
81
|
+
buildRequest({ ctx, credentials }) {
|
|
82
82
|
const apiKey = credentials.apiKey; // requireCredential already validated this.
|
|
83
83
|
const baseUrl = (credentials.baseUrl || ELEVENLABS_DEFAULT_BASE_URL).replace(/\/$/, '');
|
|
84
84
|
const wireModel = ELEVENLABS_TTS_MODEL_MAP[ctx.model] || ctx.model;
|
|
@@ -111,17 +111,17 @@ const elevenLabsTTSAdapter = {
|
|
|
111
111
|
parseResponse: createRawBytesParser({
|
|
112
112
|
errorTag: 'elevenlabs tts',
|
|
113
113
|
zeroBytesMessage: 'elevenlabs tts returned zero bytes',
|
|
114
|
-
note: (bytes, meta) => `elevenlabs/${meta.wireModel} · ${meta.voiceId} · ${bytes.length} bytes`,
|
|
114
|
+
note: ({ bytes, meta }) => `elevenlabs/${meta.wireModel} · ${meta.voiceId} · ${bytes.length} bytes`,
|
|
115
115
|
suggestedExt: '.mp3',
|
|
116
116
|
}),
|
|
117
117
|
};
|
|
118
|
-
mediaVendorRegistry.register('elevenlabs', 'audio:speech', elevenLabsTTSAdapter);
|
|
119
|
-
export async function renderElevenLabsTTS(ctx, credentials) {
|
|
120
|
-
return dispatchVendorRequest(elevenLabsTTSAdapter, ctx, credentials);
|
|
118
|
+
mediaVendorRegistry.register({ providerId: 'elevenlabs', routeKey: 'audio:speech', adapter: elevenLabsTTSAdapter });
|
|
119
|
+
export async function renderElevenLabsTTS({ ctx, credentials }) {
|
|
120
|
+
return dispatchVendorRequest({ adapter: elevenLabsTTSAdapter, ctx: ctx, credentials: credentials });
|
|
121
121
|
}
|
|
122
122
|
const elevenLabsSfxAdapter = {
|
|
123
|
-
requireCredential: requireApiKey(NO_CREDENTIAL_MESSAGE),
|
|
124
|
-
buildRequest(ctx, credentials) {
|
|
123
|
+
requireCredential: requireApiKey({ message: NO_CREDENTIAL_MESSAGE }),
|
|
124
|
+
buildRequest({ ctx, credentials }) {
|
|
125
125
|
const apiKey = credentials.apiKey; // requireCredential already validated this.
|
|
126
126
|
const baseUrl = (credentials.baseUrl || ELEVENLABS_DEFAULT_BASE_URL).replace(/\/$/, '');
|
|
127
127
|
const wireModel = ELEVENLABS_SFX_MODEL_MAP[ctx.model] || ctx.model;
|
|
@@ -152,12 +152,12 @@ const elevenLabsSfxAdapter = {
|
|
|
152
152
|
parseResponse: createRawBytesParser({
|
|
153
153
|
errorTag: 'elevenlabs sfx',
|
|
154
154
|
zeroBytesMessage: 'elevenlabs sfx returned zero bytes',
|
|
155
|
-
note: (bytes, meta) => `elevenlabs/${meta.wireModel} · ${meta.durationSeconds}s${meta.loop ? ' · loop' : ''} · ${bytes.length} bytes`,
|
|
155
|
+
note: ({ bytes, meta }) => `elevenlabs/${meta.wireModel} · ${meta.durationSeconds}s${meta.loop ? ' · loop' : ''} · ${bytes.length} bytes`,
|
|
156
156
|
suggestedExt: '.mp3',
|
|
157
157
|
}),
|
|
158
158
|
};
|
|
159
|
-
mediaVendorRegistry.register('elevenlabs', 'audio:sfx', elevenLabsSfxAdapter);
|
|
160
|
-
export async function renderElevenLabsSfx(ctx, credentials) {
|
|
161
|
-
return dispatchVendorRequest(elevenLabsSfxAdapter, ctx, credentials);
|
|
159
|
+
mediaVendorRegistry.register({ providerId: 'elevenlabs', routeKey: 'audio:sfx', adapter: elevenLabsSfxAdapter });
|
|
160
|
+
export async function renderElevenLabsSfx({ ctx, credentials }) {
|
|
161
|
+
return dispatchVendorRequest({ adapter: elevenLabsSfxAdapter, ctx: ctx, credentials: credentials });
|
|
162
162
|
}
|
|
163
163
|
//# sourceMappingURL=elevenlabs.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { ProviderCredentials, RenderContext, RenderResult } from '../types.js';
|
|
2
|
-
export declare function renderFishAudioTTS(ctx
|
|
2
|
+
export declare function renderFishAudioTTS({ ctx, credentials }: {
|
|
3
|
+
ctx: RenderContext;
|
|
4
|
+
credentials: ProviderCredentials;
|
|
5
|
+
}): Promise<RenderResult>;
|
|
3
6
|
//# sourceMappingURL=fishaudio.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Provider: FishAudio — Speech-1.x family text-to-speech (synchronous,
|
|
3
3
|
* `POST /v1/tts`). Ported near-verbatim from Open Design's
|
|
4
4
|
* `apps/daemon/src/media/index.ts` `renderFishAudioTTS` — see
|
|
5
|
-
* `
|
|
5
|
+
* `archived provenance ledger`.
|
|
6
6
|
*
|
|
7
7
|
* 2026-07-21: migrated onto the generic vendor-adapter dispatch engine
|
|
8
8
|
* (`vendor-adapter.ts`/`vendor-registry.ts`). External behavior (URL,
|
|
@@ -32,8 +32,8 @@ const FISHAUDIO_TTS_MODEL_MAP = {
|
|
|
32
32
|
};
|
|
33
33
|
const NO_CREDENTIAL_MESSAGE = 'no FishAudio credential — configure an API key or set FISH_AUDIO_API_KEY.';
|
|
34
34
|
const fishAudioTTSAdapter = {
|
|
35
|
-
requireCredential: requireApiKey(NO_CREDENTIAL_MESSAGE),
|
|
36
|
-
buildRequest(ctx, credentials) {
|
|
35
|
+
requireCredential: requireApiKey({ message: NO_CREDENTIAL_MESSAGE }),
|
|
36
|
+
buildRequest({ ctx, credentials }) {
|
|
37
37
|
const apiKey = credentials.apiKey; // requireCredential already validated this.
|
|
38
38
|
const baseUrl = (credentials.baseUrl || FISHAUDIO_DEFAULT_BASE_URL).replace(/\/$/, '');
|
|
39
39
|
// Same precedence as minimax.ts's renderMinimaxTTS: an explicit caller
|
|
@@ -72,12 +72,12 @@ const fishAudioTTSAdapter = {
|
|
|
72
72
|
parseResponse: createRawBytesParser({
|
|
73
73
|
errorTag: 'fishaudio tts',
|
|
74
74
|
zeroBytesMessage: 'fishaudio tts returned zero bytes',
|
|
75
|
-
note: (bytes, meta) => `fishaudio/${meta.wireModel} · ${bytes.length} bytes`,
|
|
75
|
+
note: ({ bytes, meta }) => `fishaudio/${meta.wireModel} · ${bytes.length} bytes`,
|
|
76
76
|
suggestedExt: '.mp3',
|
|
77
77
|
}),
|
|
78
78
|
};
|
|
79
|
-
mediaVendorRegistry.register('fishaudio', 'audio:speech', fishAudioTTSAdapter);
|
|
80
|
-
export async function renderFishAudioTTS(ctx, credentials) {
|
|
81
|
-
return dispatchVendorRequest(fishAudioTTSAdapter, ctx, credentials);
|
|
79
|
+
mediaVendorRegistry.register({ providerId: 'fishaudio', routeKey: 'audio:speech', adapter: fishAudioTTSAdapter });
|
|
80
|
+
export async function renderFishAudioTTS({ ctx, credentials }) {
|
|
81
|
+
return dispatchVendorRequest({ adapter: fishAudioTTSAdapter, ctx: ctx, credentials: credentials });
|
|
82
82
|
}
|
|
83
83
|
//# sourceMappingURL=fishaudio.js.map
|
|
@@ -9,7 +9,15 @@ import type { ProviderCredentials, RenderContext, RenderResult } from '../types.
|
|
|
9
9
|
* (see `imagerouter.ts`'s `imageRouterSizeFor`) — same input -> output
|
|
10
10
|
* mapping for every case, not a behavior change.
|
|
11
11
|
*/
|
|
12
|
-
export declare function grokAspectFor(aspect
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
export declare function grokAspectFor({ aspect }: {
|
|
13
|
+
aspect: string | undefined;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function renderGrokImage({ ctx, credentials }: {
|
|
16
|
+
ctx: RenderContext;
|
|
17
|
+
credentials: ProviderCredentials;
|
|
18
|
+
}): Promise<RenderResult>;
|
|
19
|
+
export declare function renderXAITTS({ ctx, credentials }: {
|
|
20
|
+
ctx: RenderContext;
|
|
21
|
+
credentials: ProviderCredentials;
|
|
22
|
+
}): Promise<RenderResult>;
|
|
15
23
|
//# sourceMappingURL=grok.d.ts.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* `/images/generations` endpoint (`renderGrokImage`), plus text-to-speech
|
|
4
4
|
* via a dedicated `/tts` endpoint (`renderXAITTS`). Ported near-verbatim
|
|
5
5
|
* from Open Design's `apps/daemon/src/media/index.ts` `renderGrokImage`/
|
|
6
|
-
* `renderXAITTS` — see `
|
|
6
|
+
* `renderXAITTS` — see `archived provenance ledger`.
|
|
7
7
|
*
|
|
8
8
|
* Image response shape (`{ data: [{ b64_json | url }] }`) is identical to
|
|
9
9
|
* OpenAI's images API, so `renderGrokImage` routes through
|
|
@@ -50,7 +50,7 @@ import { mediaVendorRegistry } from '../vendor-registry.js';
|
|
|
50
50
|
* (see `imagerouter.ts`'s `imageRouterSizeFor`) — same input -> output
|
|
51
51
|
* mapping for every case, not a behavior change.
|
|
52
52
|
*/
|
|
53
|
-
export function grokAspectFor(aspect) {
|
|
53
|
+
export function grokAspectFor({ aspect }) {
|
|
54
54
|
if (aspect === '1:1')
|
|
55
55
|
return '1:1';
|
|
56
56
|
if (aspect === '16:9')
|
|
@@ -65,11 +65,11 @@ export function grokAspectFor(aspect) {
|
|
|
65
65
|
}
|
|
66
66
|
const NO_CREDENTIAL_MESSAGE = 'no xAI credential — configure an API key or set XAI_API_KEY.';
|
|
67
67
|
const grokImageAdapter = {
|
|
68
|
-
requireCredential: requireApiKey(NO_CREDENTIAL_MESSAGE),
|
|
69
|
-
buildRequest(ctx, credentials) {
|
|
68
|
+
requireCredential: requireApiKey({ message: NO_CREDENTIAL_MESSAGE }),
|
|
69
|
+
buildRequest({ ctx, credentials }) {
|
|
70
70
|
const apiKey = credentials.apiKey; // requireCredential already validated this.
|
|
71
71
|
const baseUrl = (credentials.baseUrl || 'https://api.x.ai/v1').replace(/\/$/, '');
|
|
72
|
-
const aspectRatio = grokAspectFor(ctx.aspect);
|
|
72
|
+
const aspectRatio = grokAspectFor({ aspect: ctx.aspect });
|
|
73
73
|
const body = {
|
|
74
74
|
model: ctx.wireModel,
|
|
75
75
|
prompt: ctx.prompt || 'A high-quality reference image.',
|
|
@@ -90,9 +90,9 @@ const grokImageAdapter = {
|
|
|
90
90
|
meta: { wireModel: ctx.wireModel, aspectRatio },
|
|
91
91
|
};
|
|
92
92
|
},
|
|
93
|
-
async parseResponse(resp, ctx, request) {
|
|
93
|
+
async parseResponse({ resp, ctx, request }) {
|
|
94
94
|
const data = await parseOpenAICompatibleJson(resp, 'grok image');
|
|
95
|
-
const bytes = await bytesFromOpenAICompatibleData(data, 'grok image', ctx
|
|
95
|
+
const bytes = await bytesFromOpenAICompatibleData({ data, providerTag: 'grok image' }, ctx);
|
|
96
96
|
return {
|
|
97
97
|
bytes,
|
|
98
98
|
providerNote: `grok/${request.meta.wireModel} · ${request.meta.aspectRatio} · ${bytes.length} bytes`,
|
|
@@ -100,9 +100,9 @@ const grokImageAdapter = {
|
|
|
100
100
|
};
|
|
101
101
|
},
|
|
102
102
|
};
|
|
103
|
-
mediaVendorRegistry.register('grok', 'image', grokImageAdapter);
|
|
104
|
-
export async function renderGrokImage(ctx, credentials) {
|
|
105
|
-
return dispatchVendorRequest(grokImageAdapter, ctx, credentials);
|
|
103
|
+
mediaVendorRegistry.register({ providerId: 'grok', routeKey: 'image', adapter: grokImageAdapter });
|
|
104
|
+
export async function renderGrokImage({ ctx, credentials }) {
|
|
105
|
+
return dispatchVendorRequest({ adapter: grokImageAdapter, ctx: ctx, credentials: credentials });
|
|
106
106
|
}
|
|
107
107
|
const XAI_TTS_DEFAULT_VOICE_ID = 'eve';
|
|
108
108
|
const XAI_TTS_DEFAULT_LANGUAGE = 'en';
|
|
@@ -115,8 +115,8 @@ const XAI_TTS_DEFAULT_LANGUAGE = 'en';
|
|
|
115
115
|
* set it with.
|
|
116
116
|
*/
|
|
117
117
|
const xaiTTSAdapter = {
|
|
118
|
-
requireCredential: requireApiKey(NO_CREDENTIAL_MESSAGE),
|
|
119
|
-
buildRequest(ctx, credentials) {
|
|
118
|
+
requireCredential: requireApiKey({ message: NO_CREDENTIAL_MESSAGE }),
|
|
119
|
+
buildRequest({ ctx, credentials }) {
|
|
120
120
|
const apiKey = credentials.apiKey; // requireCredential already validated this.
|
|
121
121
|
const baseUrl = (credentials.baseUrl || 'https://api.x.ai/v1').replace(/\/$/, '');
|
|
122
122
|
const text = (ctx.prompt && ctx.prompt.trim()) || 'This is a test.';
|
|
@@ -139,12 +139,12 @@ const xaiTTSAdapter = {
|
|
|
139
139
|
parseResponse: createRawBytesParser({
|
|
140
140
|
errorTag: 'xai tts',
|
|
141
141
|
zeroBytesMessage: 'xai tts response had zero bytes',
|
|
142
|
-
note: (bytes, meta) => `xai/${meta.wireModel} · voice=${meta.voiceId} · ${meta.language} · ${bytes.length} bytes`,
|
|
142
|
+
note: ({ bytes, meta }) => `xai/${meta.wireModel} · voice=${meta.voiceId} · ${meta.language} · ${bytes.length} bytes`,
|
|
143
143
|
suggestedExt: '.mp3',
|
|
144
144
|
}),
|
|
145
145
|
};
|
|
146
|
-
mediaVendorRegistry.register('grok', 'audio:speech', xaiTTSAdapter);
|
|
147
|
-
export async function renderXAITTS(ctx, credentials) {
|
|
148
|
-
return dispatchVendorRequest(xaiTTSAdapter, ctx, credentials);
|
|
146
|
+
mediaVendorRegistry.register({ providerId: 'grok', routeKey: 'audio:speech', adapter: xaiTTSAdapter });
|
|
147
|
+
export async function renderXAITTS({ ctx, credentials }) {
|
|
148
|
+
return dispatchVendorRequest({ adapter: xaiTTSAdapter, ctx: ctx, credentials: credentials });
|
|
149
149
|
}
|
|
150
150
|
//# sourceMappingURL=grok.js.map
|
|
@@ -17,5 +17,5 @@ export interface ImageRouterVideoMeta {
|
|
|
17
17
|
* context's own `wireModel`.
|
|
18
18
|
* @complexity O(1) per built request; one vendor round trip per parse.
|
|
19
19
|
*/
|
|
20
|
-
export declare function createImageRouterVideoPollingAdapter(
|
|
20
|
+
export declare function createImageRouterVideoPollingAdapter(_required: Record<string, never>, optional?: ImageRouterVideoConfig): PollingVendorAdapter<ImageRouterVideoMeta>;
|
|
21
21
|
//# sourceMappingURL=imagerouter-video-async.d.ts.map
|
|
@@ -52,37 +52,38 @@ function retryAfterMsFrom(resp) {
|
|
|
52
52
|
* context's own `wireModel`.
|
|
53
53
|
* @complexity O(1) per built request; one vendor round trip per parse.
|
|
54
54
|
*/
|
|
55
|
-
export function createImageRouterVideoPollingAdapter(
|
|
55
|
+
export function createImageRouterVideoPollingAdapter(_required, optional = {}) {
|
|
56
|
+
const config = optional;
|
|
56
57
|
const baseUrl = trimTrailingSlash((config.baseUrl || DEFAULT_BASE_URL).trim());
|
|
57
58
|
return {
|
|
58
59
|
expectedLatencyClass: 'slow',
|
|
59
60
|
// ImageRouter's generation endpoint accepts no idempotency key, so a submit that may or may
|
|
60
61
|
// not have landed cannot be safely re-issued — a duplicate submit is a duplicate charge.
|
|
61
62
|
submitIsIdempotent: false,
|
|
62
|
-
buildSubmitRequest(ctx) {
|
|
63
|
+
buildSubmitRequest({ ctx }) {
|
|
63
64
|
const wireModel = (config.wireModel || ctx.wireModel).trim();
|
|
64
65
|
const seconds = typeof ctx.length === 'number' ? ctx.length : 'auto';
|
|
65
|
-
const size = imageRouterSizeFor(ctx.aspect, 'video');
|
|
66
|
+
const size = imageRouterSizeFor({ aspect: ctx.aspect, surface: 'video' });
|
|
66
67
|
return {
|
|
67
68
|
url: `${baseUrl}/videos/generations`,
|
|
68
|
-
init: withUnsignedRequestInit(ctx, {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
69
|
+
init: withUnsignedRequestInit({ ctx: ctx, init: {
|
|
70
|
+
method: 'POST',
|
|
71
|
+
headers: { 'content-type': 'application/json' },
|
|
72
|
+
body: JSON.stringify({
|
|
73
|
+
prompt: ctx.prompt || 'A short cinematic clip.',
|
|
74
|
+
model: wireModel,
|
|
75
|
+
size,
|
|
76
|
+
seconds,
|
|
77
|
+
response_format: 'b64_json',
|
|
78
|
+
}),
|
|
79
|
+
} }),
|
|
79
80
|
meta: { wireModel, size, seconds },
|
|
80
81
|
};
|
|
81
82
|
},
|
|
82
|
-
async parseSubmitResponse(resp, ctx, request) {
|
|
83
|
+
async parseSubmitResponse({ resp, ctx, request }) {
|
|
83
84
|
const data = (await parseOpenAICompatibleJson(resp, 'imagerouter video'));
|
|
84
85
|
if (Array.isArray(data.data)) {
|
|
85
|
-
const bytes = await bytesFromOpenAICompatibleData(data, 'imagerouter video', ctx
|
|
86
|
+
const bytes = await bytesFromOpenAICompatibleData({ data, providerTag: 'imagerouter video' }, ctx);
|
|
86
87
|
const { wireModel, size, seconds } = request.meta;
|
|
87
88
|
return {
|
|
88
89
|
kind: 'complete',
|
|
@@ -100,18 +101,18 @@ export function createImageRouterVideoPollingAdapter(config = {}) {
|
|
|
100
101
|
}
|
|
101
102
|
throw new Error('imagerouter video submit returned neither generated data nor a job id');
|
|
102
103
|
},
|
|
103
|
-
buildPollRequest(state, ctx) {
|
|
104
|
+
buildPollRequest({ state, ctx }) {
|
|
104
105
|
const jobId = state.jobId;
|
|
105
106
|
if (typeof jobId !== 'string' || !jobId) {
|
|
106
107
|
throw new Error('imagerouter video poll requires a persisted jobId');
|
|
107
108
|
}
|
|
108
109
|
return {
|
|
109
110
|
url: `${baseUrl}/videos/${encodeURIComponent(jobId)}`,
|
|
110
|
-
init: withUnsignedRequestInit(ctx, { method: 'GET', headers: { accept: 'application/json' } }),
|
|
111
|
-
meta: { wireModel: (config.wireModel || ctx.wireModel).trim(), size: imageRouterSizeFor(ctx.aspect, 'video'), seconds: typeof ctx.length === 'number' ? ctx.length : 'auto' },
|
|
111
|
+
init: withUnsignedRequestInit({ ctx: ctx, init: { method: 'GET', headers: { accept: 'application/json' } } }),
|
|
112
|
+
meta: { wireModel: (config.wireModel || ctx.wireModel).trim(), size: imageRouterSizeFor({ aspect: ctx.aspect, surface: 'video' }), seconds: typeof ctx.length === 'number' ? ctx.length : 'auto' },
|
|
112
113
|
};
|
|
113
114
|
},
|
|
114
|
-
async parsePollResponse(resp, ctx, _state) {
|
|
115
|
+
async parsePollResponse({ resp, ctx, state: _state }) {
|
|
115
116
|
const data = (await parseOpenAICompatibleJson(resp, 'imagerouter video'));
|
|
116
117
|
const status = typeof data.status === 'string' ? data.status.toLowerCase() : '';
|
|
117
118
|
if (TERMINAL_FAILED_STATUSES.has(status)) {
|
|
@@ -120,9 +121,9 @@ export function createImageRouterVideoPollingAdapter(config = {}) {
|
|
|
120
121
|
return { kind: 'failed', message: `imagerouter video job failed: ${detail}` };
|
|
121
122
|
}
|
|
122
123
|
if (Array.isArray(data.data)) {
|
|
123
|
-
const bytes = await bytesFromOpenAICompatibleData(data, 'imagerouter video', ctx
|
|
124
|
+
const bytes = await bytesFromOpenAICompatibleData({ data, providerTag: 'imagerouter video' }, ctx);
|
|
124
125
|
const wireModel = (config.wireModel || ctx.wireModel).trim();
|
|
125
|
-
const size = imageRouterSizeFor(ctx.aspect, 'video');
|
|
126
|
+
const size = imageRouterSizeFor({ aspect: ctx.aspect, surface: 'video' });
|
|
126
127
|
const seconds = typeof ctx.length === 'number' ? ctx.length : 'auto';
|
|
127
128
|
return {
|
|
128
129
|
kind: 'complete',
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { ProviderCredentials, RenderContext, RenderResult } from '../types.js';
|
|
2
2
|
/** ImageRouter's image/video generation `size` string for a given aspect ratio. */
|
|
3
|
-
export declare function imageRouterSizeFor(aspect
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export declare function imageRouterSizeFor({ aspect, surface }: {
|
|
4
|
+
aspect: string | undefined;
|
|
5
|
+
surface: 'image' | 'video';
|
|
6
|
+
}): string;
|
|
7
|
+
export declare function renderImageRouterImage({ ctx, credentials }: {
|
|
8
|
+
ctx: RenderContext;
|
|
9
|
+
credentials: ProviderCredentials;
|
|
10
|
+
}): Promise<RenderResult>;
|
|
11
|
+
export declare function renderImageRouterVideo({ ctx, credentials }: {
|
|
12
|
+
ctx: RenderContext;
|
|
13
|
+
credentials: ProviderCredentials;
|
|
14
|
+
}): Promise<RenderResult>;
|
|
6
15
|
//# sourceMappingURL=imagerouter.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Provider: ImageRouter — OpenAI-compatible image + video generation
|
|
3
3
|
* routing (`https://api.imagerouter.io/v1/openai`). Ported near-verbatim
|
|
4
4
|
* from Open Design's `apps/daemon/src/media/index.ts`
|
|
5
|
-
* `renderImageRouterImage`/`renderImageRouterVideo` — see `
|
|
5
|
+
* `renderImageRouterImage`/`renderImageRouterVideo` — see `archived provenance ledger`.
|
|
6
6
|
*
|
|
7
7
|
* 2026-07-21: migrated onto the generic vendor-adapter dispatch engine
|
|
8
8
|
* (`vendor-adapter.ts`/`vendor-registry.ts`) — two adapters registered on
|
|
@@ -20,7 +20,7 @@ import { buildOpenAIImageUrl, buildOpenAIVideoUrl, bytesFromOpenAICompatibleData
|
|
|
20
20
|
import { dispatchVendorRequest, requireApiKey } from '../vendor-adapter.js';
|
|
21
21
|
import { mediaVendorRegistry } from '../vendor-registry.js';
|
|
22
22
|
/** ImageRouter's image/video generation `size` string for a given aspect ratio. */
|
|
23
|
-
export function imageRouterSizeFor(aspect, surface) {
|
|
23
|
+
export function imageRouterSizeFor({ aspect, surface }) {
|
|
24
24
|
if (surface === 'video') {
|
|
25
25
|
if (aspect === '1:1')
|
|
26
26
|
return '1024x1024';
|
|
@@ -44,12 +44,12 @@ export function imageRouterSizeFor(aspect, surface) {
|
|
|
44
44
|
}
|
|
45
45
|
const NO_CREDENTIAL_MESSAGE = 'no ImageRouter API key — configure it or set IMAGEROUTER_API_KEY';
|
|
46
46
|
const imageRouterImageAdapter = {
|
|
47
|
-
requireCredential: requireApiKey(NO_CREDENTIAL_MESSAGE),
|
|
48
|
-
buildRequest(ctx, credentials) {
|
|
47
|
+
requireCredential: requireApiKey({ message: NO_CREDENTIAL_MESSAGE }),
|
|
48
|
+
buildRequest({ ctx, credentials }) {
|
|
49
49
|
const apiKey = credentials.apiKey; // requireCredential already validated this.
|
|
50
50
|
const baseUrl = (credentials.baseUrl || 'https://api.imagerouter.io/v1/openai').trim();
|
|
51
51
|
const wireModel = (credentials.model || ctx.wireModel).trim();
|
|
52
|
-
const size = imageRouterSizeFor(ctx.aspect, 'image');
|
|
52
|
+
const size = imageRouterSizeFor({ aspect: ctx.aspect, surface: 'image' });
|
|
53
53
|
const body = {
|
|
54
54
|
prompt: ctx.prompt || 'A high-quality reference image.',
|
|
55
55
|
model: wireModel,
|
|
@@ -71,9 +71,9 @@ const imageRouterImageAdapter = {
|
|
|
71
71
|
meta: { wireModel, size },
|
|
72
72
|
};
|
|
73
73
|
},
|
|
74
|
-
async parseResponse(resp, ctx, request) {
|
|
74
|
+
async parseResponse({ resp, ctx, request }) {
|
|
75
75
|
const data = await parseOpenAICompatibleJson(resp, 'imagerouter image');
|
|
76
|
-
const bytes = await bytesFromOpenAICompatibleData(data, 'imagerouter image', ctx
|
|
76
|
+
const bytes = await bytesFromOpenAICompatibleData({ data, providerTag: 'imagerouter image' }, ctx);
|
|
77
77
|
return {
|
|
78
78
|
bytes,
|
|
79
79
|
providerNote: `imagerouter/${request.meta.wireModel} · ${request.meta.size} · ${bytes.length} bytes`,
|
|
@@ -81,18 +81,18 @@ const imageRouterImageAdapter = {
|
|
|
81
81
|
};
|
|
82
82
|
},
|
|
83
83
|
};
|
|
84
|
-
mediaVendorRegistry.register('imagerouter', 'image', imageRouterImageAdapter);
|
|
85
|
-
export async function renderImageRouterImage(ctx, credentials) {
|
|
86
|
-
return dispatchVendorRequest(imageRouterImageAdapter, ctx, credentials);
|
|
84
|
+
mediaVendorRegistry.register({ providerId: 'imagerouter', routeKey: 'image', adapter: imageRouterImageAdapter });
|
|
85
|
+
export async function renderImageRouterImage({ ctx, credentials }) {
|
|
86
|
+
return dispatchVendorRequest({ adapter: imageRouterImageAdapter, ctx: ctx, credentials: credentials });
|
|
87
87
|
}
|
|
88
88
|
const imageRouterVideoAdapter = {
|
|
89
|
-
requireCredential: requireApiKey(NO_CREDENTIAL_MESSAGE),
|
|
90
|
-
buildRequest(ctx, credentials) {
|
|
89
|
+
requireCredential: requireApiKey({ message: NO_CREDENTIAL_MESSAGE }),
|
|
90
|
+
buildRequest({ ctx, credentials }) {
|
|
91
91
|
const apiKey = credentials.apiKey; // requireCredential already validated this.
|
|
92
92
|
const baseUrl = (credentials.baseUrl || 'https://api.imagerouter.io/v1/openai').trim();
|
|
93
93
|
const wireModel = (credentials.model || ctx.wireModel).trim();
|
|
94
94
|
const seconds = typeof ctx.length === 'number' ? ctx.length : 'auto';
|
|
95
|
-
const size = imageRouterSizeFor(ctx.aspect, 'video');
|
|
95
|
+
const size = imageRouterSizeFor({ aspect: ctx.aspect, surface: 'video' });
|
|
96
96
|
const body = {
|
|
97
97
|
prompt: ctx.prompt || 'A short cinematic clip.',
|
|
98
98
|
model: wireModel,
|
|
@@ -113,9 +113,9 @@ const imageRouterVideoAdapter = {
|
|
|
113
113
|
meta: { wireModel, size, seconds },
|
|
114
114
|
};
|
|
115
115
|
},
|
|
116
|
-
async parseResponse(resp, ctx, request) {
|
|
116
|
+
async parseResponse({ resp, ctx, request }) {
|
|
117
117
|
const data = await parseOpenAICompatibleJson(resp, 'imagerouter video');
|
|
118
|
-
const bytes = await bytesFromOpenAICompatibleData(data, 'imagerouter video', ctx
|
|
118
|
+
const bytes = await bytesFromOpenAICompatibleData({ data, providerTag: 'imagerouter video' }, ctx);
|
|
119
119
|
const { wireModel, size, seconds } = request.meta;
|
|
120
120
|
return {
|
|
121
121
|
bytes,
|
|
@@ -124,8 +124,8 @@ const imageRouterVideoAdapter = {
|
|
|
124
124
|
};
|
|
125
125
|
},
|
|
126
126
|
};
|
|
127
|
-
mediaVendorRegistry.register('imagerouter', 'video', imageRouterVideoAdapter);
|
|
128
|
-
export async function renderImageRouterVideo(ctx, credentials) {
|
|
129
|
-
return dispatchVendorRequest(imageRouterVideoAdapter, ctx, credentials);
|
|
127
|
+
mediaVendorRegistry.register({ providerId: 'imagerouter', routeKey: 'video', adapter: imageRouterVideoAdapter });
|
|
128
|
+
export async function renderImageRouterVideo({ ctx, credentials }) {
|
|
129
|
+
return dispatchVendorRequest({ adapter: imageRouterVideoAdapter, ctx: ctx, credentials: credentials });
|
|
130
130
|
}
|
|
131
131
|
//# sourceMappingURL=imagerouter.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { ProviderCredentials, RenderContext, RenderResult } from '../types.js';
|
|
2
|
-
export declare function renderMinimaxTTS(ctx
|
|
2
|
+
export declare function renderMinimaxTTS({ ctx, credentials }: {
|
|
3
|
+
ctx: RenderContext;
|
|
4
|
+
credentials: ProviderCredentials;
|
|
5
|
+
}): Promise<RenderResult>;
|
|
3
6
|
//# sourceMappingURL=minimax.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Provider: MiniMax — Speech-02 family text-to-speech (synchronous,
|
|
3
3
|
* `POST /t2a_v2`). Ported near-verbatim from Open Design's
|
|
4
4
|
* `apps/daemon/src/media/index.ts` `renderMinimaxTTS` — see
|
|
5
|
-
* `
|
|
5
|
+
* `archived provenance ledger`.
|
|
6
6
|
*
|
|
7
7
|
* 2026-07-21: migrated onto the generic vendor-adapter dispatch engine
|
|
8
8
|
* (`vendor-adapter.ts`/`vendor-registry.ts`) — `renderMinimaxTTS`'s
|
|
@@ -45,8 +45,8 @@ const MINIMAX_TTS_MODEL_MAP = {
|
|
|
45
45
|
};
|
|
46
46
|
const NO_CREDENTIAL_MESSAGE = 'no MiniMax credential — configure an API key or set MINIMAX_API_KEY.';
|
|
47
47
|
const minimaxTTSAdapter = {
|
|
48
|
-
requireCredential: requireApiKey(NO_CREDENTIAL_MESSAGE),
|
|
49
|
-
buildRequest(ctx, credentials) {
|
|
48
|
+
requireCredential: requireApiKey({ message: NO_CREDENTIAL_MESSAGE }),
|
|
49
|
+
buildRequest({ ctx, credentials }) {
|
|
50
50
|
// Safe: `requireCredential` above already validated this is set before
|
|
51
51
|
// `dispatchVendorRequest` ever calls `buildRequest`.
|
|
52
52
|
const apiKey = credentials.apiKey;
|
|
@@ -89,8 +89,8 @@ const minimaxTTSAdapter = {
|
|
|
89
89
|
},
|
|
90
90
|
parseResponse: createHexEnvelopeAudioParser({ errorTag: 'minimax tts', providerId: 'minimax' }),
|
|
91
91
|
};
|
|
92
|
-
mediaVendorRegistry.register('minimax', 'audio:speech', minimaxTTSAdapter);
|
|
93
|
-
export async function renderMinimaxTTS(ctx, credentials) {
|
|
94
|
-
return dispatchVendorRequest(minimaxTTSAdapter, ctx, credentials);
|
|
92
|
+
mediaVendorRegistry.register({ providerId: 'minimax', routeKey: 'audio:speech', adapter: minimaxTTSAdapter });
|
|
93
|
+
export async function renderMinimaxTTS({ ctx, credentials }) {
|
|
94
|
+
return dispatchVendorRequest({ adapter: minimaxTTSAdapter, ctx: ctx, credentials: credentials });
|
|
95
95
|
}
|
|
96
96
|
//# sourceMappingURL=minimax.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { ProviderCredentials, RenderContext, RenderResult } from '../types.js';
|
|
2
|
-
export declare function renderNanoBananaImage(ctx
|
|
2
|
+
export declare function renderNanoBananaImage({ ctx, credentials }: {
|
|
3
|
+
ctx: RenderContext;
|
|
4
|
+
credentials: ProviderCredentials;
|
|
5
|
+
}): Promise<RenderResult>;
|
|
3
6
|
//# sourceMappingURL=nanobanana.d.ts.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Open Design's `apps/daemon/src/media/index.ts` `renderNanoBananaImage`
|
|
5
5
|
* (plus its `nanoBananaHeaders`/`usesOfficialGoogleApiKeyHeader`/
|
|
6
6
|
* `nanoBananaAspectFor`/`inlineImageBytesFromGenerateContent` helpers) —
|
|
7
|
-
* see `
|
|
7
|
+
* see `archived provenance ledger`.
|
|
8
8
|
*
|
|
9
9
|
* Not OpenAI-images-wire-compatible — Gemini's `generateContent` request
|
|
10
10
|
* shape (`contents[].parts[].text` + `generationConfig`) and response shape
|
|
@@ -89,8 +89,8 @@ function inlineImageBytesFromGenerateContent(data) {
|
|
|
89
89
|
}
|
|
90
90
|
const NO_CREDENTIAL_MESSAGE = 'no Nano Banana credential — configure an API key or set GOOGLE_API_KEY / GEMINI_API_KEY.';
|
|
91
91
|
const nanoBananaImageAdapter = {
|
|
92
|
-
requireCredential: requireApiKey(NO_CREDENTIAL_MESSAGE),
|
|
93
|
-
buildRequest(ctx, credentials) {
|
|
92
|
+
requireCredential: requireApiKey({ message: NO_CREDENTIAL_MESSAGE }),
|
|
93
|
+
buildRequest({ ctx, credentials }) {
|
|
94
94
|
const apiKey = credentials.apiKey; // requireCredential already validated this.
|
|
95
95
|
const baseUrl = (credentials.baseUrl || NANOBANANA_DEFAULT_BASE_URL).replace(/\/$/, '');
|
|
96
96
|
const wireModel = (credentials.model || ctx.wireModel || NANOBANANA_DEFAULT_MODEL).trim();
|
|
@@ -115,7 +115,7 @@ const nanoBananaImageAdapter = {
|
|
|
115
115
|
meta: { wireModel, aspectRatio },
|
|
116
116
|
};
|
|
117
117
|
},
|
|
118
|
-
async parseResponse(resp, _ctx, request) {
|
|
118
|
+
async parseResponse({ resp, ctx: _ctx, request }) {
|
|
119
119
|
const text = await resp.text();
|
|
120
120
|
if (!resp.ok) {
|
|
121
121
|
throw new Error(`nano-banana image ${resp.status}: ${truncate(text, 240)}`);
|
|
@@ -135,8 +135,8 @@ const nanoBananaImageAdapter = {
|
|
|
135
135
|
};
|
|
136
136
|
},
|
|
137
137
|
};
|
|
138
|
-
mediaVendorRegistry.register('nanobanana', 'image', nanoBananaImageAdapter);
|
|
139
|
-
export async function renderNanoBananaImage(ctx, credentials) {
|
|
140
|
-
return dispatchVendorRequest(nanoBananaImageAdapter, ctx, credentials);
|
|
138
|
+
mediaVendorRegistry.register({ providerId: 'nanobanana', routeKey: 'image', adapter: nanoBananaImageAdapter });
|
|
139
|
+
export async function renderNanoBananaImage({ ctx, credentials }) {
|
|
140
|
+
return dispatchVendorRequest({ adapter: nanoBananaImageAdapter, ctx: ctx, credentials: credentials });
|
|
141
141
|
}
|
|
142
142
|
//# sourceMappingURL=nanobanana.js.map
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { ProviderCredentials, RenderContext, RenderResult } from '../types.js';
|
|
2
|
-
export declare function renderOpenAIImage(ctx
|
|
3
|
-
|
|
2
|
+
export declare function renderOpenAIImage({ ctx, credentials }: {
|
|
3
|
+
ctx: RenderContext;
|
|
4
|
+
credentials: ProviderCredentials;
|
|
5
|
+
}): Promise<RenderResult>;
|
|
6
|
+
export declare function renderOpenAISpeech({ ctx, credentials }: {
|
|
7
|
+
ctx: RenderContext;
|
|
8
|
+
credentials: ProviderCredentials;
|
|
9
|
+
}): Promise<RenderResult>;
|
|
4
10
|
//# sourceMappingURL=openai.d.ts.map
|