mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 06:20:31 +00:00
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import type { OpenClawConfig } from "../config/config.js";
|
|
import type { DmScope } from "../config/types.base.js";
|
|
import type { ToolProfileId } from "../config/types.tools.js";
|
|
|
|
export const ONBOARDING_DEFAULT_DM_SCOPE: DmScope = "per-channel-peer";
|
|
export const ONBOARDING_DEFAULT_TOOLS_PROFILE: ToolProfileId = "messaging";
|
|
|
|
export function applyOnboardingLocalWorkspaceConfig(
|
|
baseConfig: OpenClawConfig,
|
|
workspaceDir: string,
|
|
params?: { toolsProfile?: ToolProfileId },
|
|
): OpenClawConfig {
|
|
const toolsProfile =
|
|
params?.toolsProfile ?? baseConfig.tools?.profile ?? ONBOARDING_DEFAULT_TOOLS_PROFILE;
|
|
return {
|
|
...baseConfig,
|
|
agents: {
|
|
...baseConfig.agents,
|
|
defaults: {
|
|
...baseConfig.agents?.defaults,
|
|
workspace: workspaceDir,
|
|
},
|
|
},
|
|
gateway: {
|
|
...baseConfig.gateway,
|
|
mode: "local",
|
|
},
|
|
session: {
|
|
...baseConfig.session,
|
|
dmScope: baseConfig.session?.dmScope ?? ONBOARDING_DEFAULT_DM_SCOPE,
|
|
},
|
|
tools: {
|
|
...baseConfig.tools,
|
|
profile: toolsProfile,
|
|
},
|
|
};
|
|
}
|