mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-26 16:41:49 +00:00
Plugin SDK: add narrow setup subpaths
This commit is contained in:
17
src/plugin-sdk/ollama-setup.ts
Normal file
17
src/plugin-sdk/ollama-setup.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export type {
|
||||
OpenClawPluginApi,
|
||||
ProviderAuthContext,
|
||||
ProviderAuthMethodNonInteractiveContext,
|
||||
ProviderAuthResult,
|
||||
ProviderDiscoveryContext,
|
||||
} from "../plugins/types.js";
|
||||
|
||||
export {
|
||||
OLLAMA_DEFAULT_BASE_URL,
|
||||
OLLAMA_DEFAULT_MODEL,
|
||||
configureOllamaNonInteractive,
|
||||
ensureOllamaModelPulled,
|
||||
promptAndConfigureOllama,
|
||||
} from "../commands/ollama-setup.js";
|
||||
|
||||
export { buildOllamaProvider } from "../agents/models-config.providers.discovery.js";
|
||||
23
src/plugin-sdk/self-hosted-provider-setup.ts
Normal file
23
src/plugin-sdk/self-hosted-provider-setup.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
export type {
|
||||
OpenClawPluginApi,
|
||||
ProviderAuthContext,
|
||||
ProviderAuthMethodNonInteractiveContext,
|
||||
ProviderAuthResult,
|
||||
ProviderDiscoveryContext,
|
||||
} from "../plugins/types.js";
|
||||
|
||||
export {
|
||||
applyProviderDefaultModel,
|
||||
configureOpenAICompatibleSelfHostedProviderNonInteractive,
|
||||
discoverOpenAICompatibleSelfHostedProvider,
|
||||
promptAndConfigureOpenAICompatibleSelfHostedProvider,
|
||||
promptAndConfigureOpenAICompatibleSelfHostedProviderAuth,
|
||||
SELF_HOSTED_DEFAULT_CONTEXT_WINDOW,
|
||||
SELF_HOSTED_DEFAULT_COST,
|
||||
SELF_HOSTED_DEFAULT_MAX_TOKENS,
|
||||
} from "../commands/self-hosted-provider-setup.js";
|
||||
|
||||
export {
|
||||
buildSglangProvider,
|
||||
buildVllmProvider,
|
||||
} from "../agents/models-config.providers.discovery.js";
|
||||
@@ -11,8 +11,10 @@ import * as imessageSdk from "openclaw/plugin-sdk/imessage";
|
||||
import * as lineSdk from "openclaw/plugin-sdk/line";
|
||||
import * as msteamsSdk from "openclaw/plugin-sdk/msteams";
|
||||
import * as nostrSdk from "openclaw/plugin-sdk/nostr";
|
||||
import * as ollamaSetupSdk from "openclaw/plugin-sdk/ollama-setup";
|
||||
import * as providerSetupSdk from "openclaw/plugin-sdk/provider-setup";
|
||||
import * as sandboxSdk from "openclaw/plugin-sdk/sandbox";
|
||||
import * as selfHostedProviderSetupSdk from "openclaw/plugin-sdk/self-hosted-provider-setup";
|
||||
import * as signalSdk from "openclaw/plugin-sdk/signal";
|
||||
import * as slackSdk from "openclaw/plugin-sdk/slack";
|
||||
import * as telegramSdk from "openclaw/plugin-sdk/telegram";
|
||||
@@ -62,6 +64,23 @@ describe("plugin-sdk subpath exports", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("exports narrow self-hosted provider setup helpers", () => {
|
||||
expect(typeof selfHostedProviderSetupSdk.buildVllmProvider).toBe("function");
|
||||
expect(typeof selfHostedProviderSetupSdk.buildSglangProvider).toBe("function");
|
||||
expect(typeof selfHostedProviderSetupSdk.discoverOpenAICompatibleSelfHostedProvider).toBe(
|
||||
"function",
|
||||
);
|
||||
expect(
|
||||
typeof selfHostedProviderSetupSdk.configureOpenAICompatibleSelfHostedProviderNonInteractive,
|
||||
).toBe("function");
|
||||
});
|
||||
|
||||
it("exports narrow Ollama setup helpers", () => {
|
||||
expect(typeof ollamaSetupSdk.buildOllamaProvider).toBe("function");
|
||||
expect(typeof ollamaSetupSdk.configureOllamaNonInteractive).toBe("function");
|
||||
expect(typeof ollamaSetupSdk.ensureOllamaModelPulled).toBe("function");
|
||||
});
|
||||
|
||||
it("exports sandbox helpers from the dedicated subpath", () => {
|
||||
expect(typeof sandboxSdk.registerSandboxBackend).toBe("function");
|
||||
expect(typeof sandboxSdk.runPluginCommandWithTimeout).toBe("function");
|
||||
|
||||
Reference in New Issue
Block a user