@jini-ai/integrations 0.7.3-next.1 → 0.7.3-next.3
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 +6 -0
- package/README.md +1 -0
- package/dist/api-connections/bundled-client-namespace.d.ts +24 -0
- package/dist/api-connections/bundled-client-namespace.js +22 -0
- package/dist/api-connections/connect.d.ts +2 -10
- package/dist/api-connections/contribution.d.ts +71 -0
- package/dist/api-connections/contribution.js +69 -0
- package/dist/api-connections/form-delivery-connection.d.ts +68 -0
- package/dist/api-connections/form-delivery-connection.js +73 -0
- package/dist/api-connections/hosted-mcp/contracts.d.ts +4 -171
- package/dist/api-connections/hosted-mcp/index.d.ts +2 -0
- package/dist/api-connections/hosted-mcp/oauth-row-writes.d.ts +3 -1
- package/dist/api-connections/hosted-mcp/oauth-row-writes.js +6 -3
- package/dist/api-connections/hosted-mcp/shared-sign-in.d.ts +2 -1
- package/dist/api-connections/hosted-mcp/sign-in-configuration.js +1 -1
- package/dist/api-connections/hosted-mcp/sign-in-discovery.js +1 -1
- package/dist/api-connections/hosted-mcp/sign-in-flow.d.ts +9 -3
- package/dist/api-connections/hosted-mcp/sign-in-flow.js +6 -6
- package/dist/api-connections/hosted-mcp/sign-in-provider.d.ts +16 -4
- package/dist/api-connections/hosted-mcp/sign-in-provider.js +3 -3
- package/dist/api-connections/hosted-mcp/sign-in-status.d.ts +13 -2
- package/dist/api-connections/hosted-mcp/sign-in-status.js +17 -4
- package/dist/api-connections/hosted-mcp/sign-in.d.ts +1 -1
- package/dist/api-connections/hosted-mcp/sign-in.js +28 -30
- package/dist/api-connections/shared-api.d.ts +87 -0
- package/dist/api-connections/shared-api.js +135 -0
- package/dist/api-connections/shared-oauth-disconnect.d.ts +73 -0
- package/dist/api-connections/shared-oauth-disconnect.js +41 -0
- package/dist/api-connections/shared-owner.d.ts +107 -0
- package/dist/api-connections/shared-owner.js +79 -0
- package/dist/api-connections/vault-stores.d.ts +110 -0
- package/dist/api-connections/vault-stores.js +202 -0
- package/dist/credentialed-http/auth-schemes.d.ts +2 -9
- package/dist/credentialed-http/tools/index.d.ts +30 -0
- package/dist/credentialed-http/tools/index.js +19 -0
- package/dist/credentialed-http/tools/tool-registrations.js +0 -1
- package/dist/custom-credentials/agent-tools.d.ts +79 -0
- package/dist/custom-credentials/agent-tools.js +98 -0
- package/dist/custom-credentials/card-token.d.ts +15 -0
- package/dist/custom-credentials/card-token.js +35 -0
- package/dist/custom-credentials/credential-ports.d.ts +70 -0
- package/dist/custom-credentials/credential-ports.js +41 -0
- package/dist/custom-credentials/credential-recovery.d.ts +20 -0
- package/dist/custom-credentials/credential-recovery.js +22 -0
- package/dist/custom-credentials/credentialed-request.d.ts +83 -0
- package/dist/custom-credentials/credentialed-request.js +93 -0
- package/dist/custom-credentials/custom-credential-create-ui.d.ts +106 -0
- package/dist/custom-credentials/custom-credential-create-ui.js +136 -0
- package/dist/custom-credentials/custom-credential-set-token-ui.d.ts +84 -0
- package/dist/custom-credentials/custom-credential-set-token-ui.js +104 -0
- package/dist/custom-credentials/delete-request-confirmation-ui.d.ts +33 -0
- package/dist/custom-credentials/delete-request-confirmation-ui.js +35 -0
- package/dist/custom-credentials/provider-settings-card.d.ts +109 -0
- package/dist/custom-credentials/provider-settings-card.js +166 -0
- package/dist/custom-credentials/write-files-validation.d.ts +102 -0
- package/dist/custom-credentials/write-files-validation.js +202 -0
- package/dist/media-providers/catalog-projection.d.ts +29 -0
- package/dist/media-providers/catalog-projection.js +45 -0
- package/dist/media-providers/catalog.d.ts +6 -3
- package/dist/media-providers/catalog.js +4 -3
- package/dist/media-providers/configurable-catalog.d.ts +9 -0
- package/dist/media-providers/configurable-catalog.js +70 -0
- package/dist/media-providers/dispatch/builtin-vendors.js +0 -2
- package/dist/media-providers/dispatch/credentials.d.ts +4 -1
- package/dist/media-providers/dispatch/credentials.js +3 -2
- package/dist/media-providers/dispatch/engine.d.ts +1 -1
- package/dist/media-providers/dispatch/engine.js +17 -5
- package/dist/media-providers/dispatch/index.d.ts +3 -2
- package/dist/media-providers/dispatch/index.js +2 -2
- package/dist/media-providers/dispatch/media-provider-registry.d.ts +23 -4
- package/dist/media-providers/dispatch/media-provider-registry.js +26 -11
- package/dist/media-providers/dispatch/media-wire.d.ts +14 -0
- package/dist/media-providers/dispatch/media-wire.js +22 -0
- package/dist/media-providers/dispatch/node.d.ts +5 -0
- package/dist/media-providers/dispatch/node.js +5 -1
- package/dist/media-providers/dispatch/openai-compatible.d.ts +3 -1
- package/dist/media-providers/dispatch/openai-compatible.js +1 -1
- package/dist/media-providers/dispatch/operation-runtime.js +5 -4
- package/dist/media-providers/dispatch/outbound.d.ts +28 -3
- package/dist/media-providers/dispatch/outbound.js +10 -3
- package/dist/media-providers/dispatch/providers/custom-image.js +1 -1
- package/dist/media-providers/dispatch/providers/imagerouter.js +1 -1
- package/dist/media-providers/dispatch/providers/nanobanana.js +1 -1
- package/dist/media-providers/dispatch/providers/openrouter.js +1 -1
- package/dist/media-providers/dispatch/ssrf-guard.js +2 -2
- package/dist/media-providers/dispatch/types.d.ts +13 -4
- package/dist/media-providers/dispatch/vendor-adapter.js +2 -2
- package/dist/media-providers/index.d.ts +2 -0
- package/dist/media-providers/providers.d.ts +9 -5
- package/dist/media-providers/providers.js +9 -12
- package/dist/media-providers/sqlite-task-store.d.ts +4 -4
- package/dist/media-providers/task-store.d.ts +1 -1
- package/dist/media-providers/task-store.js +1 -1
- package/dist/media-providers/types.d.ts +0 -36
- package/dist/media-providers/ui-defaults.js +0 -4
- package/dist/react/admin-credentials/AdminByokKeyPanel.d.ts +130 -0
- package/dist/react/admin-credentials/AdminByokKeyPanel.js +115 -0
- package/dist/react/admin-credentials/byok-footer-status.d.ts +37 -0
- package/dist/react/admin-credentials/byok-footer-status.js +25 -0
- package/dist/react/credentials/OtherCredentialsSection.d.ts +36 -0
- package/dist/react/credentials/OtherCredentialsSection.hooks.d.ts +55 -0
- package/dist/react/credentials/OtherCredentialsSection.hooks.js +26 -0
- package/dist/react/credentials/OtherCredentialsSection.js +120 -0
- package/dist/react/credentials/access-token-forms.d.ts +219 -0
- package/dist/react/credentials/access-token-forms.js +114 -0
- package/dist/react/credentials/credential-copy.d.ts +17 -0
- package/dist/react/credentials/credential-copy.js +7 -0
- package/dist/react/credentials/other-credential-stores.d.ts +115 -0
- package/dist/react/credentials/other-credential-stores.js +76 -0
- package/dist/react/site-key/SiteKeyRecoveryCard.d.ts +16 -0
- package/dist/react/site-key/SiteKeyRecoveryCard.js +36 -0
- package/dist/react/site-key/SiteKeyTab.d.ts +100 -0
- package/dist/react/site-key/SiteKeyTab.js +127 -0
- package/dist/react/site-key/hooks/use-site-key-recovery.hooks.d.ts +77 -0
- package/dist/react/site-key/hooks/use-site-key-recovery.hooks.js +126 -0
- package/dist/react/site-key/hooks/use-site-key.hooks.d.ts +120 -0
- package/dist/react/site-key/hooks/use-site-key.hooks.js +95 -0
- package/dist/react/webhooks/IntegrationDeliveries.d.ts +41 -0
- package/dist/react/webhooks/IntegrationDeliveries.js +24 -0
- package/dist/react/webhooks/Integrations.d.ts +73 -0
- package/dist/react/webhooks/Integrations.js +97 -0
- package/dist/react/webhooks/hooks/use-integration-deliveries.hooks.d.ts +59 -0
- package/dist/react/webhooks/hooks/use-integration-deliveries.hooks.js +11 -0
- package/dist/react/webhooks/hooks/use-integrations.hooks.d.ts +119 -0
- package/dist/react/webhooks/hooks/use-integrations.hooks.js +129 -0
- package/dist/react/webhooks/rules.d.ts +118 -0
- package/dist/react/webhooks/rules.js +103 -0
- package/dist/saved-requests/execute.js +2 -3
- package/dist/saved-requests/types.d.ts +4 -1
- package/dist/secrets/index.d.ts +3 -0
- package/dist/secrets/index.js +3 -0
- package/dist/secrets/ports.d.ts +25 -0
- package/dist/secrets/ports.js +2 -0
- package/dist/secrets/types.d.ts +10 -0
- package/dist/secrets/types.js +2 -0
- package/dist/vendor-credentials/abort-guarded-repo.d.ts +14 -0
- package/dist/vendor-credentials/abort-guarded-repo.js +41 -0
- package/dist/vendor-credentials/project-scope.d.ts +43 -0
- package/dist/vendor-credentials/project-scope.js +32 -0
- package/dist/vendor-credentials/vault-adapter.d.ts +147 -0
- package/dist/vendor-credentials/vault-adapter.js +195 -0
- package/dist/web-screenshot/capture-files.d.ts +44 -0
- package/dist/web-screenshot/capture-files.js +62 -0
- package/dist/web-screenshot/capture-retention.d.ts +157 -0
- package/dist/web-screenshot/capture-retention.js +134 -0
- package/dist/web-screenshot/capture-root-file-lock.d.ts +20 -0
- package/dist/web-screenshot/capture-root-file-lock.js +15 -0
- package/dist/web-screenshot/desktop-page-capture.d.ts +37 -0
- package/dist/web-screenshot/desktop-page-capture.js +62 -0
- package/dist/web-screenshot/own-site-opener.d.ts +40 -0
- package/dist/web-screenshot/own-site-opener.js +27 -0
- package/dist/web-screenshot/screenshot-image.d.ts +11 -0
- package/dist/web-screenshot/screenshot-image.js +12 -0
- package/dist/web-screenshot/web-screenshot.d.ts +188 -0
- package/dist/web-screenshot/web-screenshot.js +329 -0
- package/dist/webhooks/delivery.d.ts +16 -0
- package/dist/webhooks/delivery.js +41 -1
- package/dist/webhooks/ports.d.ts +1 -29
- package/dist/webhooks/signing.keyring.d.ts +1 -1
- package/dist/webhooks/site/delivery.d.ts +60 -0
- package/dist/webhooks/site/delivery.js +45 -0
- package/dist/webhooks/site/http.memory.d.ts +51 -0
- package/dist/webhooks/site/http.memory.js +28 -0
- package/dist/webhooks/site/repo.memory.d.ts +136 -0
- package/dist/webhooks/site/repo.memory.js +215 -0
- package/dist/webhooks/site/seal-aad-invariant.d.ts +26 -0
- package/dist/webhooks/site/seal-aad-invariant.js +61 -0
- package/dist/webhooks/site/seal-aad-invariant.node.d.ts +42 -0
- package/dist/webhooks/site/seal-aad-invariant.node.js +52 -0
- package/dist/webhooks/site/signing.d.ts +28 -0
- package/dist/webhooks/site/signing.js +27 -0
- package/dist/webhooks/site/signing.keyring.d.ts +29 -0
- package/dist/webhooks/site/signing.keyring.js +30 -0
- package/dist/webhooks/site/subscriptions.d.ts +118 -0
- package/dist/webhooks/site/subscriptions.js +98 -0
- package/dist/webhooks/sql/index.d.ts +4 -0
- package/dist/webhooks/sql/index.js +2 -0
- package/dist/webhooks/sql/repo.rows.d.ts +47 -0
- package/dist/webhooks/sql/repo.rows.js +2 -0
- package/dist/webhooks/sql/webhook-repo.d.ts +152 -0
- package/dist/webhooks/sql/webhook-repo.js +308 -0
- package/dist/webhooks/subscriptions.d.ts +3 -1
- package/dist/webhooks/subscriptions.js +4 -1
- package/dist/webhooks/tools/tool-handlers.js +2 -1
- package/dist/webhooks/types.d.ts +6 -10
- package/package.json +518 -13
- package/dist/media-providers/dispatch/providers/grok.d.ts +0 -55
- package/dist/media-providers/dispatch/providers/grok.js +0 -116
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provider: xAI Grok — image generation via an OpenAI-images-compatible
|
|
3
|
-
* `/images/generations` endpoint (`renderGrokImage`), plus text-to-speech
|
|
4
|
-
* via a dedicated `/tts` endpoint (`renderXAITTS`). Ported near-verbatim
|
|
5
|
-
* from Open Design's `apps/daemon/src/media/index.ts` `renderGrokImage`/
|
|
6
|
-
* `renderXAITTS` — see `archived provenance ledger`.
|
|
7
|
-
*
|
|
8
|
-
* Image response shape (`{ data: [{ b64_json | url }] }`) is identical to
|
|
9
|
-
* OpenAI's images API, so `renderGrokImage` routes through
|
|
10
|
-
* `openai-compatible.ts`'s already-ported JSON-parsing/byte-extraction/
|
|
11
|
-
* URL-building helpers rather than re-implementing them. `/tts` is xAI's
|
|
12
|
-
* own dedicated endpoint (not the OpenAI `/audio/speech` shape) — it
|
|
13
|
-
* returns raw audio bytes directly from a plain JSON POST, with no
|
|
14
|
-
* per-request format negotiation the caller can control, so `renderXAITTS`
|
|
15
|
-
* doesn't route through `openai-compatible.ts` at all (only the generic
|
|
16
|
-
* `truncate`/`withRequestInit` helpers are shared).
|
|
17
|
-
*
|
|
18
|
-
* Dropped from the origin's no-credential error messages (both
|
|
19
|
-
* functions): the OD-specific "sign in with your SuperGrok subscription
|
|
20
|
-
* (in OD or via `hermes auth add xai-oauth`)" OAuth guidance — this
|
|
21
|
-
* package has no OAuth chain or local-CLI-login concept; credentials are
|
|
22
|
-
* always host-injected (see `types.ts`'s `ProviderCredentials`), matching
|
|
23
|
-
* every other ported provider's error-message style (e.g. `openai.ts`'s
|
|
24
|
-
* `OPENAI_IMAGE_NO_CREDENTIAL_MESSAGE`).
|
|
25
|
-
*
|
|
26
|
-
* 2026-07-21: migrated onto the generic vendor-adapter dispatch engine
|
|
27
|
-
* (`vendor-adapter.ts`/`vendor-registry.ts`) — two adapters registered on
|
|
28
|
-
* the same `grok` provider id (`image`/`audio:speech`). External behavior
|
|
29
|
-
* is unchanged (verified against `grok.test.ts`, which asserts URL/body/
|
|
30
|
-
* header/error-message/providerNote shape and passes unmodified) — only
|
|
31
|
-
* the internal implementation moved. The image adapter is not routed
|
|
32
|
-
* through `response-parsers.ts`'s factories (reuses
|
|
33
|
-
* `openai-compatible.ts`'s JSON-parsing helpers directly, same as before —
|
|
34
|
-
* see `imagerouter.ts`'s module doc for the identical reasoning); the TTS
|
|
35
|
-
* adapter's response (raw bytes, no envelope) is the same shape
|
|
36
|
-
* `fishaudio.ts`/`openai.ts`'s speech renderer return, so it now shares
|
|
37
|
-
* `response-parsers.ts`'s `createRawBytesParser`.
|
|
38
|
-
*/
|
|
39
|
-
import { standardImageAspectFor as grokAspectFor } from '../openai-compatible.js';
|
|
40
|
-
import type { ProviderCredentials, RenderContext, RenderResult } from '../types.js';
|
|
41
|
-
import type { VendorAdapterRegistry } from '../vendor-registry-core.js';
|
|
42
|
-
export { grokAspectFor };
|
|
43
|
-
export declare function renderGrokImage({ ctx, credentials }: {
|
|
44
|
-
ctx: RenderContext;
|
|
45
|
-
credentials: ProviderCredentials;
|
|
46
|
-
}): Promise<RenderResult>;
|
|
47
|
-
export declare function renderXAITTS({ ctx, credentials }: {
|
|
48
|
-
ctx: RenderContext;
|
|
49
|
-
credentials: ProviderCredentials;
|
|
50
|
-
}): Promise<RenderResult>;
|
|
51
|
-
/** Explicit composition: importing a renderer never changes another module's registry. */
|
|
52
|
-
export declare function registerVendorAdapters({ registry }: {
|
|
53
|
-
registry: Pick<VendorAdapterRegistry, 'register'>;
|
|
54
|
-
}, _optional?: Record<string, never>): void;
|
|
55
|
-
//# sourceMappingURL=grok.d.ts.map
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provider: xAI Grok — image generation via an OpenAI-images-compatible
|
|
3
|
-
* `/images/generations` endpoint (`renderGrokImage`), plus text-to-speech
|
|
4
|
-
* via a dedicated `/tts` endpoint (`renderXAITTS`). Ported near-verbatim
|
|
5
|
-
* from Open Design's `apps/daemon/src/media/index.ts` `renderGrokImage`/
|
|
6
|
-
* `renderXAITTS` — see `archived provenance ledger`.
|
|
7
|
-
*
|
|
8
|
-
* Image response shape (`{ data: [{ b64_json | url }] }`) is identical to
|
|
9
|
-
* OpenAI's images API, so `renderGrokImage` routes through
|
|
10
|
-
* `openai-compatible.ts`'s already-ported JSON-parsing/byte-extraction/
|
|
11
|
-
* URL-building helpers rather than re-implementing them. `/tts` is xAI's
|
|
12
|
-
* own dedicated endpoint (not the OpenAI `/audio/speech` shape) — it
|
|
13
|
-
* returns raw audio bytes directly from a plain JSON POST, with no
|
|
14
|
-
* per-request format negotiation the caller can control, so `renderXAITTS`
|
|
15
|
-
* doesn't route through `openai-compatible.ts` at all (only the generic
|
|
16
|
-
* `truncate`/`withRequestInit` helpers are shared).
|
|
17
|
-
*
|
|
18
|
-
* Dropped from the origin's no-credential error messages (both
|
|
19
|
-
* functions): the OD-specific "sign in with your SuperGrok subscription
|
|
20
|
-
* (in OD or via `hermes auth add xai-oauth`)" OAuth guidance — this
|
|
21
|
-
* package has no OAuth chain or local-CLI-login concept; credentials are
|
|
22
|
-
* always host-injected (see `types.ts`'s `ProviderCredentials`), matching
|
|
23
|
-
* every other ported provider's error-message style (e.g. `openai.ts`'s
|
|
24
|
-
* `OPENAI_IMAGE_NO_CREDENTIAL_MESSAGE`).
|
|
25
|
-
*
|
|
26
|
-
* 2026-07-21: migrated onto the generic vendor-adapter dispatch engine
|
|
27
|
-
* (`vendor-adapter.ts`/`vendor-registry.ts`) — two adapters registered on
|
|
28
|
-
* the same `grok` provider id (`image`/`audio:speech`). External behavior
|
|
29
|
-
* is unchanged (verified against `grok.test.ts`, which asserts URL/body/
|
|
30
|
-
* header/error-message/providerNote shape and passes unmodified) — only
|
|
31
|
-
* the internal implementation moved. The image adapter is not routed
|
|
32
|
-
* through `response-parsers.ts`'s factories (reuses
|
|
33
|
-
* `openai-compatible.ts`'s JSON-parsing helpers directly, same as before —
|
|
34
|
-
* see `imagerouter.ts`'s module doc for the identical reasoning); the TTS
|
|
35
|
-
* adapter's response (raw bytes, no envelope) is the same shape
|
|
36
|
-
* `fishaudio.ts`/`openai.ts`'s speech renderer return, so it now shares
|
|
37
|
-
* `response-parsers.ts`'s `createRawBytesParser`.
|
|
38
|
-
*/
|
|
39
|
-
import { buildOpenAIImageUrl, bytesFromOpenAICompatibleData, parseOpenAICompatibleJson, sniffImageExt, standardImageAspectFor as grokAspectFor, jsonPostInit } from '../openai-compatible.js';
|
|
40
|
-
import { createRawBytesParser } from '../response-parsers.js';
|
|
41
|
-
import { dispatchVendorRequest, requireApiKey } from '../vendor-adapter.js';
|
|
42
|
-
export { grokAspectFor };
|
|
43
|
-
const NO_CREDENTIAL_MESSAGE = 'no xAI credential — configure an API key or set XAI_API_KEY.';
|
|
44
|
-
const grokImageAdapter = {
|
|
45
|
-
requireCredential: requireApiKey({ message: NO_CREDENTIAL_MESSAGE }),
|
|
46
|
-
buildRequest({ ctx, credentials }) {
|
|
47
|
-
const apiKey = credentials.apiKey; // requireCredential already validated this.
|
|
48
|
-
const baseUrl = (credentials.baseUrl || 'https://api.x.ai/v1').replace(/\/$/, '');
|
|
49
|
-
const aspectRatio = grokAspectFor({ aspect: ctx.aspect });
|
|
50
|
-
const body = {
|
|
51
|
-
model: ctx.wireModel,
|
|
52
|
-
prompt: ctx.prompt || 'A high-quality reference image.',
|
|
53
|
-
n: 1,
|
|
54
|
-
aspect_ratio: aspectRatio,
|
|
55
|
-
response_format: 'b64_json',
|
|
56
|
-
};
|
|
57
|
-
return {
|
|
58
|
-
url: buildOpenAIImageUrl({ baseUrl, isAzure: false }),
|
|
59
|
-
init: jsonPostInit({ ctx, body }, { apiKey }),
|
|
60
|
-
meta: { wireModel: ctx.wireModel, aspectRatio },
|
|
61
|
-
};
|
|
62
|
-
},
|
|
63
|
-
async parseResponse({ resp, ctx, request }) {
|
|
64
|
-
const data = await parseOpenAICompatibleJson({ resp, providerTag: 'grok image' });
|
|
65
|
-
const bytes = await bytesFromOpenAICompatibleData({ data, providerTag: 'grok image' }, ctx);
|
|
66
|
-
return {
|
|
67
|
-
bytes,
|
|
68
|
-
providerNote: `grok/${request.meta.wireModel} · ${request.meta.aspectRatio} · ${bytes.length} bytes`,
|
|
69
|
-
suggestedExt: sniffImageExt(bytes),
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
export async function renderGrokImage({ ctx, credentials }) {
|
|
74
|
-
return dispatchVendorRequest({ adapter: grokImageAdapter, ctx: ctx, credentials: credentials });
|
|
75
|
-
}
|
|
76
|
-
const XAI_TTS_DEFAULT_VOICE_ID = 'eve';
|
|
77
|
-
const XAI_TTS_DEFAULT_LANGUAGE = 'en';
|
|
78
|
-
/**
|
|
79
|
-
* xAI's `/tts` endpoint takes only `{ text, voice_id, language }` — no
|
|
80
|
-
* per-request output-format field — and always returns mp3/24kHz/128kbps
|
|
81
|
-
* audio bytes directly (not wrapped in JSON), matching the origin exactly.
|
|
82
|
-
* `ctx.speechFormat` (used by `openai.ts`'s `renderOpenAISpeech`/AIHubMix's
|
|
83
|
-
* TTS) has no equivalent here since the wire protocol offers nothing to
|
|
84
|
-
* set it with.
|
|
85
|
-
*/
|
|
86
|
-
const xaiTTSAdapter = {
|
|
87
|
-
requireCredential: requireApiKey({ message: NO_CREDENTIAL_MESSAGE }),
|
|
88
|
-
buildRequest({ ctx, credentials }) {
|
|
89
|
-
const apiKey = credentials.apiKey; // requireCredential already validated this.
|
|
90
|
-
const baseUrl = (credentials.baseUrl || 'https://api.x.ai/v1').replace(/\/$/, '');
|
|
91
|
-
const text = (ctx.prompt && ctx.prompt.trim()) || 'This is a test.';
|
|
92
|
-
const voiceId = (ctx.voice && ctx.voice.trim()) || XAI_TTS_DEFAULT_VOICE_ID;
|
|
93
|
-
const language = ctx.language.trim() || XAI_TTS_DEFAULT_LANGUAGE;
|
|
94
|
-
const body = { text, voice_id: voiceId, language };
|
|
95
|
-
return {
|
|
96
|
-
url: `${baseUrl}/tts`,
|
|
97
|
-
init: jsonPostInit({ ctx, body }, { apiKey }),
|
|
98
|
-
meta: { wireModel: ctx.wireModel, voiceId, language },
|
|
99
|
-
};
|
|
100
|
-
},
|
|
101
|
-
parseResponse: createRawBytesParser({
|
|
102
|
-
errorTag: 'xai tts',
|
|
103
|
-
zeroBytesMessage: 'xai tts response had zero bytes',
|
|
104
|
-
note: ({ bytes, meta }) => `xai/${meta.wireModel} · voice=${meta.voiceId} · ${meta.language} · ${bytes.length} bytes`,
|
|
105
|
-
suggestedExt: '.mp3',
|
|
106
|
-
}),
|
|
107
|
-
};
|
|
108
|
-
export async function renderXAITTS({ ctx, credentials }) {
|
|
109
|
-
return dispatchVendorRequest({ adapter: xaiTTSAdapter, ctx: ctx, credentials: credentials });
|
|
110
|
-
}
|
|
111
|
-
/** Explicit composition: importing a renderer never changes another module's registry. */
|
|
112
|
-
export function registerVendorAdapters({ registry }, _optional = {}) {
|
|
113
|
-
registry.register({ providerId: 'grok', routeKey: 'image', adapter: grokImageAdapter });
|
|
114
|
-
registry.register({ providerId: 'grok', routeKey: 'audio:speech', adapter: xaiTTSAdapter });
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=grok.js.map
|