mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 03:45:46 -06:00
refactor(plugin-sdk): simplify plugin entry contracts (#120930)
* refactor(plugin-sdk): simplify plugin entry contracts * fix(plugin-sdk): keep suppression context barrel live
This commit is contained in:
committed by
GitHub
parent
54ae94530c
commit
bb799aec0f
@@ -100,7 +100,7 @@ ea56ea0455c62f292e1c7b3e56cac6eb3fea00e548f9ab2f4a69e0b41b0a2d96 module/memory-
|
||||
9470d8e08f7e1d2fe144a81da1b4a331b31a0c74d0c9a5f7cfaa15814e953ea2 module/param-readers
|
||||
8d8c0c4ebfc6e0c6125df3ae64ec66c10cd797a325de5ea7869fcd84068ab290 module/persistent-dedupe
|
||||
987648ebe317cc4d6c0505a52d344b12ce9c3a8261a5bd969cee3423c0c53529 module/plugin-config-runtime
|
||||
6c4371e8cb50470fdf0ae3aac273997d5d43cbdf6335afa659ed26fa59e1f3eb module/plugin-entry
|
||||
f83dbe9460f793f5b57f6df1c208bdf99f272aff7fd9f5cda8e6b25b15bbff20 module/plugin-entry
|
||||
c0894007b842d68f1dcf0ba6e9a61486d06ef820e78e194939b70a5a4b28e9cb module/plugin-runtime
|
||||
de508df6d9cfa9d21c4524989dd8bd142fb60cb4ae980193e0907767d76e6022 module/provider-auth
|
||||
71bebeac51e701cd7c8e63d22754b9bcbd82b024aced303aa055d229781129d7 module/provider-catalog-runtime
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// Plugin entry contracts define the manifest-facing hooks implemented by plugin packages.
|
||||
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
export type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import { emptyPluginConfigSchema } from "../plugins/config-schema.js";
|
||||
import type {
|
||||
OpenClawPluginApi,
|
||||
OpenClawPluginConfigSchema,
|
||||
OpenClawPluginDefinition,
|
||||
ProviderBuiltInModelSuppressionContext as ProviderBuiltInModelSuppressionContextType,
|
||||
@@ -141,15 +140,15 @@ export type {
|
||||
WorkerSshIdentityRequest,
|
||||
} from "../plugins/types.js";
|
||||
|
||||
// Direct re-exports inherit the upstream @deprecated tag, while this entrypoint's
|
||||
// established surface exposes the same type without deprecating the export.
|
||||
// A direct re-export would inherit upstream @deprecated metadata, while this
|
||||
// entrypoint's established surface exposes the same type without deprecating it.
|
||||
export type ProviderBuiltInModelSuppressionContext = ProviderBuiltInModelSuppressionContextType;
|
||||
|
||||
export type OpenClawPluginGatewayEventScope =
|
||||
import("../plugins/gateway-events.js").OpenClawPluginGatewayEventScope;
|
||||
export type OpenClawPluginGatewayEvents =
|
||||
import("../plugins/gateway-events.js").OpenClawPluginGatewayEvents;
|
||||
export { WorkerProviderError } from "../plugins/types.js";
|
||||
export type {
|
||||
OpenClawPluginGatewayEventScope,
|
||||
OpenClawPluginGatewayEvents,
|
||||
} from "../plugins/gateway-events.js";
|
||||
export { WorkerProviderError } from "../plugins/capability-provider.types.js";
|
||||
|
||||
export type {
|
||||
PluginConversationBinding,
|
||||
@@ -182,7 +181,6 @@ export type {
|
||||
UnifiedModelCatalogKind,
|
||||
UnifiedModelCatalogSource,
|
||||
} from "@openclaw/model-catalog-core/model-catalog-types";
|
||||
export type { OpenClawConfig };
|
||||
|
||||
export {
|
||||
buildJsonPluginConfigSchema,
|
||||
@@ -205,20 +203,13 @@ type DefinePluginEntryOptions = {
|
||||
reload?: OpenClawPluginDefinition["reload"];
|
||||
nodeHostCommands?: OpenClawPluginDefinition["nodeHostCommands"];
|
||||
securityAuditCollectors?: OpenClawPluginDefinition["securityAuditCollectors"];
|
||||
register: (api: OpenClawPluginApi) => void;
|
||||
register: NonNullable<OpenClawPluginDefinition["register"]>;
|
||||
};
|
||||
|
||||
/** Normalized object shape that OpenClaw loads from a plugin entry module. */
|
||||
type DefinedPluginEntry = {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
type DefinedPluginEntry = Omit<DefinePluginEntryOptions, "configSchema"> & {
|
||||
configSchema: OpenClawPluginConfigSchema;
|
||||
register: NonNullable<OpenClawPluginDefinition["register"]>;
|
||||
} & Pick<
|
||||
OpenClawPluginDefinition,
|
||||
"kind" | "reload" | "nodeHostCommands" | "securityAuditCollectors"
|
||||
>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Canonical entry helper for non-channel plugins.
|
||||
|
||||
Reference in New Issue
Block a user