Files
openclaw/src/plugins/loader-types.ts
T
Peter Steinberger 1e9a620a28 refactor(gateway): remove deferred channel load flag; 503 plugin routes until runtime ready (#117852)
* refactor(gateway): remove deferred channel load flag; 503 plugin routes until runtime ready

* test(agents): make setup middleware load intent explicit

* test(gateway): pin webhook startup routing outside SPA
2026-08-02 00:36:21 -07:00

51 lines
2.3 KiB
TypeScript

import type { OpenClawConfig } from "../config/types.openclaw.js";
import type { PluginInstallRecord } from "../config/types.plugins.js";
import type { GatewayRequestHandler } from "../gateway/server-methods/types.js";
import type { PluginDiscoveryResult } from "./discovery.js";
import type { PluginManifestRegistry } from "./manifest-registry.js";
import type { PluginRegistryParams } from "./registry-types.js";
import type { CreatePluginRuntimeOptions } from "./runtime/types.js";
import type { PluginSdkResolutionPreference } from "./sdk-alias.js";
import type { PluginLogger } from "./types.js";
export type PluginRuntimeSubagentMode = "default" | "explicit" | "gateway-bindable";
export type ChannelPluginLoadIntent = "full" | "setup";
/** Inputs shared by runtime, snapshot, and CLI-metadata plugin loading. */
export type PluginLoadOptions = {
config?: OpenClawConfig;
activationSourceConfig?: OpenClawConfig;
autoEnabledReasons?: Readonly<Record<string, string[]>>;
workspaceDir?: string;
installRecords?: Record<string, PluginInstallRecord>;
/** Resolve plugin roots and load paths against an explicit environment. */
env?: NodeJS.ProcessEnv;
/** Apply the config IO env-substitution pass to direct raw-config callers. */
resolveRawConfigEnvVars?: boolean;
logger?: PluginLogger;
coreGatewayHandlers?: Record<string, GatewayRequestHandler>;
coreGatewayMethodNames?: readonly string[];
hostServices?: PluginRegistryParams["hostServices"];
runtimeOptions?: CreatePluginRuntimeOptions;
startupTrace?: {
detail: (name: string, metrics: ReadonlyArray<readonly [string, number | string]>) => void;
};
pluginSdkResolution?: PluginSdkResolutionPreference;
cache?: boolean;
mode?: "full" | "validate";
onlyPluginIds?: string[];
includeSetupOnlyChannelPlugins?: boolean;
forceSetupOnlyChannelPlugins?: boolean;
requireSetupEntryForSetupOnlyChannelPlugins?: boolean;
/** Select full runtime registration or the lightweight unconfigured-channel setup path. */
channelPluginLoadIntent?: ChannelPluginLoadIntent;
/** Prefer bundled JavaScript artifacts over source TypeScript entrypoints. */
preferBuiltPluginArtifacts?: boolean;
toolDiscovery?: boolean;
activate?: boolean;
loadModules?: boolean;
throwOnLoadError?: boolean;
manifestRegistry?: PluginManifestRegistry;
discovery?: PluginDiscoveryResult;
};