mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-22 14:41:34 +00:00
refactor: remove generated plugin sdk facades
This commit is contained in:
@@ -7,6 +7,10 @@ import {
|
||||
createLazyRuntimeModule,
|
||||
} from "../../shared/lazy-runtime.js";
|
||||
import { VERSION } from "../../version.js";
|
||||
import {
|
||||
generateVideo as generateRuntimeVideo,
|
||||
listRuntimeVideoGenerationProviders,
|
||||
} from "../../video-generation/runtime.js";
|
||||
import { listWebSearchProviders, runWebSearch } from "../../web-search/runtime.js";
|
||||
import { createRuntimeAgent } from "./runtime-agent.js";
|
||||
import { defineCachedValue } from "./runtime-cache.js";
|
||||
@@ -20,9 +24,9 @@ import { createRuntimeTaskFlow } from "./runtime-taskflow.js";
|
||||
import { createRuntimeTasks } from "./runtime-tasks.js";
|
||||
import type { PluginRuntime } from "./types.js";
|
||||
|
||||
const loadTtsRuntime = createLazyRuntimeModule(() => import("./runtime-tts.runtime.js"));
|
||||
const loadTtsRuntime = createLazyRuntimeModule(() => import("../../tts/tts.js"));
|
||||
const loadMediaUnderstandingRuntime = createLazyRuntimeModule(
|
||||
() => import("./runtime-media-understanding.runtime.js"),
|
||||
() => import("../../media-understanding/runtime.js"),
|
||||
);
|
||||
const loadModelAuthRuntime = createLazyRuntimeModule(
|
||||
() => import("./runtime-model-auth.runtime.js"),
|
||||
@@ -58,12 +62,6 @@ type RuntimeImageGenerationModule = Pick<
|
||||
>;
|
||||
let cachedRuntimeImageGenerationModule: RuntimeImageGenerationModule | null = null;
|
||||
|
||||
type RuntimeVideoGenerationModule = Pick<
|
||||
typeof import("../../plugin-sdk/video-generation-runtime.js"),
|
||||
"generateVideo" | "listRuntimeVideoGenerationProviders"
|
||||
>;
|
||||
let cachedRuntimeVideoGenerationModule: RuntimeVideoGenerationModule | null = null;
|
||||
|
||||
function loadRuntimeImageGenerationModule(): RuntimeImageGenerationModule {
|
||||
cachedRuntimeImageGenerationModule ??=
|
||||
loadBundledPluginPublicSurfaceModuleSync<RuntimeImageGenerationModule>({
|
||||
@@ -81,20 +79,10 @@ function createRuntimeImageGeneration(): PluginRuntime["imageGeneration"] {
|
||||
};
|
||||
}
|
||||
|
||||
function loadRuntimeVideoGenerationModule(): RuntimeVideoGenerationModule {
|
||||
cachedRuntimeVideoGenerationModule ??=
|
||||
loadBundledPluginPublicSurfaceModuleSync<RuntimeVideoGenerationModule>({
|
||||
dirName: "video-generation-core",
|
||||
artifactBasename: "runtime-api.js",
|
||||
});
|
||||
return cachedRuntimeVideoGenerationModule;
|
||||
}
|
||||
|
||||
function createRuntimeVideoGeneration(): PluginRuntime["videoGeneration"] {
|
||||
return {
|
||||
generate: (params) => loadRuntimeVideoGenerationModule().generateVideo(params),
|
||||
listProviders: (params) =>
|
||||
loadRuntimeVideoGenerationModule().listRuntimeVideoGenerationProviders(params),
|
||||
generate: (params) => generateRuntimeVideo(params),
|
||||
listProviders: (params) => listRuntimeVideoGenerationProviders(params),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
export {
|
||||
describeImageFile,
|
||||
describeImageFileWithModel,
|
||||
describeVideoFile,
|
||||
runMediaUnderstandingFile,
|
||||
transcribeAudioFile,
|
||||
} from "../../plugin-sdk/media-understanding-runtime.js";
|
||||
@@ -1,5 +0,0 @@
|
||||
export {
|
||||
listSpeechVoices,
|
||||
textToSpeech,
|
||||
textToSpeechTelephony,
|
||||
} from "../../plugin-sdk/speech-runtime.js";
|
||||
@@ -67,24 +67,24 @@ export type PluginRuntimeCore = {
|
||||
resizeToJpeg: typeof import("../../media/image-ops.js").resizeToJpeg;
|
||||
};
|
||||
tts: {
|
||||
textToSpeech: typeof import("../../plugin-sdk/speech-runtime.js").textToSpeech;
|
||||
textToSpeechTelephony: typeof import("../../plugin-sdk/speech-runtime.js").textToSpeechTelephony;
|
||||
listVoices: typeof import("../../plugin-sdk/speech-runtime.js").listSpeechVoices;
|
||||
textToSpeech: typeof import("../../tts/tts.js").textToSpeech;
|
||||
textToSpeechTelephony: typeof import("../../tts/tts.js").textToSpeechTelephony;
|
||||
listVoices: typeof import("../../tts/tts.js").listSpeechVoices;
|
||||
};
|
||||
mediaUnderstanding: {
|
||||
runFile: typeof import("../../plugin-sdk/media-understanding-runtime.js").runMediaUnderstandingFile;
|
||||
describeImageFile: typeof import("../../plugin-sdk/media-understanding-runtime.js").describeImageFile;
|
||||
describeImageFileWithModel: typeof import("../../plugin-sdk/media-understanding-runtime.js").describeImageFileWithModel;
|
||||
describeVideoFile: typeof import("../../plugin-sdk/media-understanding-runtime.js").describeVideoFile;
|
||||
transcribeAudioFile: typeof import("../../plugin-sdk/media-understanding-runtime.js").transcribeAudioFile;
|
||||
runFile: typeof import("../../media-understanding/runtime.js").runMediaUnderstandingFile;
|
||||
describeImageFile: typeof import("../../media-understanding/runtime.js").describeImageFile;
|
||||
describeImageFileWithModel: typeof import("../../media-understanding/runtime.js").describeImageFileWithModel;
|
||||
describeVideoFile: typeof import("../../media-understanding/runtime.js").describeVideoFile;
|
||||
transcribeAudioFile: typeof import("../../media-understanding/runtime.js").transcribeAudioFile;
|
||||
};
|
||||
imageGeneration: {
|
||||
generate: typeof import("../../plugin-sdk/image-generation-runtime.js").generateImage;
|
||||
listProviders: typeof import("../../plugin-sdk/image-generation-runtime.js").listRuntimeImageGenerationProviders;
|
||||
};
|
||||
videoGeneration: {
|
||||
generate: typeof import("../../plugin-sdk/video-generation-runtime.js").generateVideo;
|
||||
listProviders: typeof import("../../plugin-sdk/video-generation-runtime.js").listRuntimeVideoGenerationProviders;
|
||||
generate: typeof import("../../video-generation/runtime.js").generateVideo;
|
||||
listProviders: typeof import("../../video-generation/runtime.js").listRuntimeVideoGenerationProviders;
|
||||
};
|
||||
webSearch: {
|
||||
listProviders: typeof import("../../web-search/runtime.js").listWebSearchProviders;
|
||||
|
||||
Reference in New Issue
Block a user