mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-16 01:30:43 +00:00
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import type { PluginServicesHandle } from "../plugins/services.js";
|
|
import type { HooksConfigResolved } from "./hooks.js";
|
|
import type { GatewayCronState } from "./server-cron.js";
|
|
import {
|
|
createGatewayServerMutableState,
|
|
type GatewayServerMutableState,
|
|
} from "./server-runtime-handles.js";
|
|
import type { HookClientIpConfig } from "./server/hooks-request-handler.js";
|
|
|
|
export type GatewayServerLiveState = GatewayServerMutableState & {
|
|
hooksConfig: HooksConfigResolved | null;
|
|
hookClientIpConfig: HookClientIpConfig;
|
|
cronState: GatewayCronState;
|
|
pluginServices: PluginServicesHandle | null;
|
|
gatewayMethods: string[];
|
|
};
|
|
|
|
export function createGatewayServerLiveState(params: {
|
|
hooksConfig: HooksConfigResolved | null;
|
|
hookClientIpConfig: HookClientIpConfig;
|
|
cronState: GatewayCronState;
|
|
gatewayMethods: string[];
|
|
}): GatewayServerLiveState {
|
|
return {
|
|
...createGatewayServerMutableState(),
|
|
hooksConfig: params.hooksConfig,
|
|
hookClientIpConfig: params.hookClientIpConfig,
|
|
cronState: params.cronState,
|
|
pluginServices: null,
|
|
gatewayMethods: params.gatewayMethods,
|
|
};
|
|
}
|