feat: enhance workspace scaffolding with new identity and soul templates, and support for default user file
This commit is contained in:
@@ -66,7 +66,8 @@ export async function runSetup(opts: SetupOpts): Promise<SetupResult> {
|
||||
|
||||
await writePluginConfig(opts.api, agentId, opts.projectExecution);
|
||||
|
||||
const filesWritten = await scaffoldWorkspace(workspacePath);
|
||||
const defaultWorkspacePath = getDefaultWorkspacePath(opts.api);
|
||||
const filesWritten = await scaffoldWorkspace(workspacePath, defaultWorkspacePath);
|
||||
|
||||
const models = buildModelConfig(opts.models);
|
||||
await writeModelsToWorkflow(workspacePath, models);
|
||||
@@ -140,6 +141,15 @@ function buildModelConfig(overrides?: SetupOpts["models"]): ModelConfig {
|
||||
return result;
|
||||
}
|
||||
|
||||
function getDefaultWorkspacePath(api: OpenClawPluginApi): string | undefined {
|
||||
try {
|
||||
const config = api.runtime.config.loadConfig();
|
||||
return (config as any).agents?.defaults?.workspace ?? undefined;
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Write model configuration to workflow.yaml (single source of truth).
|
||||
* Reads the existing workflow.yaml, merges model overrides into the roles section, and writes back.
|
||||
|
||||
Reference in New Issue
Block a user