mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
25 lines
747 B
TypeScript
25 lines
747 B
TypeScript
// Mcp Channel Limits script supports OpenClaw repository automation.
|
|
import { readPositiveIntEnv } from "./lib/env-limits.mjs";
|
|
|
|
export type McpChannelLimits = {
|
|
connectTimeoutMs: number;
|
|
gatewayEventRetainLimit: number;
|
|
rawMessageRetainLimit: number;
|
|
};
|
|
|
|
export function readMcpChannelLimits(env: NodeJS.ProcessEnv = process.env): McpChannelLimits {
|
|
return {
|
|
connectTimeoutMs: readPositiveIntEnv("OPENCLAW_MCP_CHANNELS_CONNECT_TIMEOUT_MS", 60_000, env),
|
|
gatewayEventRetainLimit: readPositiveIntEnv(
|
|
"OPENCLAW_MCP_CHANNELS_GATEWAY_EVENT_RETAIN_LIMIT",
|
|
2_000,
|
|
env,
|
|
),
|
|
rawMessageRetainLimit: readPositiveIntEnv(
|
|
"OPENCLAW_MCP_CHANNELS_RAW_MESSAGE_RETAIN_LIMIT",
|
|
2_000,
|
|
env,
|
|
),
|
|
};
|
|
}
|