109 lines
4.0 KiB
TypeScript
109 lines
4.0 KiB
TypeScript
declare module "openclaw/plugin-sdk/blob-runtime" {
|
|
export function bufferToBlobPart(buffer: Buffer): BlobPart;
|
|
}
|
|
|
|
declare module "openclaw/plugin-sdk/video-generation" {
|
|
export interface VideoGenerationProvider {
|
|
id: string;
|
|
aliases?: string[];
|
|
label?: string;
|
|
defaultModel?: string;
|
|
models?: string[];
|
|
isConfigured: (ctx: { cfg?: any }) => boolean;
|
|
capabilities: any;
|
|
generateVideo: (req: VideoGenerationRequest) => Promise<any>;
|
|
}
|
|
|
|
export interface VideoGenerationRequest {
|
|
prompt: string;
|
|
model?: string;
|
|
durationSeconds?: number;
|
|
size?: string;
|
|
aspectRatio?: string;
|
|
resolution?: string;
|
|
inputImages?: Array<{ buffer?: Buffer; mimeType?: string; fileName?: string }>;
|
|
inputVideos?: Array<{ buffer?: Buffer; mimeType?: string; fileName?: string }>;
|
|
cfg?: any;
|
|
agentDir?: string;
|
|
authStore?: any;
|
|
timeoutMs?: number;
|
|
}
|
|
}
|
|
|
|
declare module "openclaw/plugin-sdk/image-generation" {
|
|
export interface GeneratedImageAsset {
|
|
buffer: Buffer;
|
|
mimeType: string;
|
|
fileName?: string;
|
|
revisedPrompt?: string;
|
|
metadata?: Record<string, unknown>;
|
|
}
|
|
|
|
export interface ImageGenerationRequest {
|
|
prompt: string;
|
|
model?: string;
|
|
count?: number;
|
|
size?: string;
|
|
aspectRatio?: string;
|
|
resolution?: string;
|
|
quality?: string;
|
|
outputFormat?: string;
|
|
background?: string;
|
|
inputImages?: Array<{ buffer: Buffer; mimeType?: string; fileName?: string }>;
|
|
cfg?: any;
|
|
agentDir?: string;
|
|
authStore?: any;
|
|
timeoutMs?: number;
|
|
ssrfPolicy?: any;
|
|
providerOptions?: Record<string, unknown>;
|
|
}
|
|
|
|
export interface ImageGenerationResult {
|
|
images: GeneratedImageAsset[];
|
|
model?: string;
|
|
metadata?: Record<string, unknown>;
|
|
}
|
|
|
|
export interface ImageGenerationProvider {
|
|
id: string;
|
|
aliases?: string[];
|
|
label?: string;
|
|
defaultModel?: string;
|
|
defaultTimeoutMs?: number;
|
|
models?: string[];
|
|
capabilities: any;
|
|
isConfigured?: (ctx: { cfg?: any }) => boolean;
|
|
generateImage: (req: ImageGenerationRequest) => Promise<ImageGenerationResult>;
|
|
}
|
|
|
|
export function parseOpenAiCompatibleImageResponse(
|
|
payload: unknown,
|
|
options?: { defaultMimeType?: string; malformedResponseError?: string; fileNamePrefix?: string; sniffMimeType?: boolean },
|
|
): GeneratedImageAsset[];
|
|
}
|
|
|
|
declare module "openclaw/plugin-sdk/provider-http" {
|
|
export function createProviderOperationDeadline(params: { timeoutMs?: number; label: string }): any;
|
|
export function createProviderOperationTimeoutResolver(params: { deadline: any; defaultTimeoutMs: number }): () => number;
|
|
export function executeProviderOperationWithRetry(params: any): Promise<any>;
|
|
export function fetchProviderDownloadResponse(params: any): Promise<any>;
|
|
export function fetchWithTimeoutGuarded(url: string, init: any, timeoutMs: number, fetchFn: any, opts: any): Promise<any>;
|
|
export function assertOkOrThrowHttpError(response: Response, message: string): Promise<void>;
|
|
export function postMultipartRequest(params: any): Promise<{ response: Response; release: () => Promise<void> }>;
|
|
export function postJsonRequest(params: any): Promise<{ response: Response; release: () => Promise<void> }>;
|
|
export function readProviderJsonResponse<T = any>(response: Response, message: string, opts?: any): Promise<T>;
|
|
export function pollProviderOperationJson<T = any>(params: any): Promise<T>;
|
|
export function resolveProviderOperationTimeoutMs(params: any): number;
|
|
export function resolveProviderHttpRequestConfig(params: any): any;
|
|
export function sanitizeConfiguredModelProviderRequest(params: any): any;
|
|
}
|
|
|
|
declare module "openclaw/plugin-sdk/provider-auth-runtime" {
|
|
export function resolveApiKeyForProvider(params: any): Promise<{ apiKey?: string; mode?: string }>;
|
|
}
|
|
|
|
declare module "openclaw/plugin-sdk/media-generation-runtime" {
|
|
export function downloadGeneratedVideoAsset(params: any): Promise<any>;
|
|
export function resolveGeneratedMediaMaxBytes(cfg: any, type: string): number;
|
|
}
|