openclaw/src/config/types.openclaw.ts

130 lines
3.9 KiB
TypeScript
Raw Normal View History

2026-01-14 01:08:15 +00:00
import type { AgentBinding, AgentsConfig } from "./types.agents.js";
import type { ApprovalsConfig } from "./types.approvals.js";
2026-01-14 01:08:15 +00:00
import type { AuthConfig } from "./types.auth.js";
import type { DiagnosticsConfig, LoggingConfig, SessionConfig, WebConfig } from "./types.base.js";
2026-01-14 01:08:15 +00:00
import type { BrowserConfig } from "./types.browser.js";
import type { ChannelsConfig } from "./types.channels.js";
import type { CronConfig } from "./types.cron.js";
2026-01-19 11:32:15 +00:00
import type {
CanvasHostConfig,
DiscoveryConfig,
GatewayConfig,
TalkConfig,
} from "./types.gateway.js";
2026-01-14 01:08:15 +00:00
import type { HooksConfig } from "./types.hooks.js";
2026-02-02 20:45:58 -08:00
import type { MemoryConfig } from "./types.memory.js";
2026-01-14 01:08:15 +00:00
import type {
AudioConfig,
BroadcastConfig,
CommandsConfig,
MessagesConfig,
} from "./types.messages.js";
import type { ModelsConfig } from "./types.models.js";
2026-01-24 04:19:43 +00:00
import type { NodeHostConfig } from "./types.node-host.js";
2026-01-14 01:08:15 +00:00
import type { PluginsConfig } from "./types.plugins.js";
import type { SkillsConfig } from "./types.skills.js";
import type { ToolsConfig } from "./types.tools.js";
2026-01-30 03:15:10 +01:00
export type OpenClawConfig = {
meta?: {
2026-01-30 03:15:10 +01:00
/** Last OpenClaw version that wrote this config. */
lastTouchedVersion?: string;
/** ISO timestamp when this config was last written. */
lastTouchedAt?: string;
};
2026-01-14 01:08:15 +00:00
auth?: AuthConfig;
env?: {
/** Opt-in: import missing secrets from a login shell environment (exec `$SHELL -l -c 'env -0'`). */
shellEnv?: {
enabled?: boolean;
/** Timeout for the login shell exec (ms). Default: 15000. */
timeoutMs?: number;
};
/** Inline env vars to apply when not already present in the process env. */
vars?: Record<string, string>;
/** Sugar: allow env vars directly under env (string values only). */
[key: string]:
| string
| Record<string, string>
| { enabled?: boolean; timeoutMs?: number }
| undefined;
};
wizard?: {
lastRunAt?: string;
lastRunVersion?: string;
lastRunCommit?: string;
lastRunCommand?: string;
lastRunMode?: "local" | "remote";
};
diagnostics?: DiagnosticsConfig;
2026-01-14 01:08:15 +00:00
logging?: LoggingConfig;
2026-01-17 11:40:02 +00:00
update?: {
2026-01-20 13:33:31 +00:00
/** Update channel for git + npm installs ("stable", "beta", or "dev"). */
channel?: "stable" | "beta" | "dev";
/** Check for updates on gateway start (npm installs only). */
checkOnStart?: boolean;
2026-01-17 11:40:02 +00:00
};
2026-01-14 01:08:15 +00:00
browser?: BrowserConfig;
ui?: {
2026-01-30 03:15:10 +01:00
/** Accent color for OpenClaw UI chrome (hex). */
2026-01-14 01:08:15 +00:00
seamColor?: string;
assistant?: {
/** Assistant display name for UI surfaces. */
name?: string;
/** Assistant avatar (emoji, short text, or image URL/data URI). */
avatar?: string;
};
2026-01-14 01:08:15 +00:00
};
skills?: SkillsConfig;
plugins?: PluginsConfig;
models?: ModelsConfig;
2026-01-24 04:19:43 +00:00
nodeHost?: NodeHostConfig;
2026-01-14 01:08:15 +00:00
agents?: AgentsConfig;
tools?: ToolsConfig;
bindings?: AgentBinding[];
broadcast?: BroadcastConfig;
audio?: AudioConfig;
messages?: MessagesConfig;
commands?: CommandsConfig;
approvals?: ApprovalsConfig;
2026-01-14 01:08:15 +00:00
session?: SessionConfig;
web?: WebConfig;
channels?: ChannelsConfig;
cron?: CronConfig;
hooks?: HooksConfig;
discovery?: DiscoveryConfig;
canvasHost?: CanvasHostConfig;
talk?: TalkConfig;
gateway?: GatewayConfig;
memory?: MemoryConfig;
2026-01-14 01:08:15 +00:00
};
export type ConfigValidationIssue = {
path: string;
message: string;
};
export type LegacyConfigIssue = {
path: string;
message: string;
};
export type ConfigFileSnapshot = {
path: string;
exists: boolean;
raw: string | null;
parsed: unknown;
/**
* Config after $include resolution and ${ENV} substitution, but BEFORE runtime
* defaults are applied. Use this for config set/unset operations to avoid
* leaking runtime defaults into the written config file.
*/
resolved: OpenClawConfig;
2026-01-14 01:08:15 +00:00
valid: boolean;
2026-01-30 03:15:10 +01:00
config: OpenClawConfig;
2026-01-15 04:05:01 +00:00
hash?: string;
2026-01-14 01:08:15 +00:00
issues: ConfigValidationIssue[];
warnings: ConfigValidationIssue[];
2026-01-14 01:08:15 +00:00
legacyIssues: LegacyConfigIssue[];
};