- Added `migrate-layout.ts` to handle migration from old workspace layouts to the new `devclaw/` structure. - Introduced `migrate-layout.test.ts` for comprehensive tests covering various migration scenarios. - Updated `workspace.ts` to ensure default files are created post-migration, including `workflow.yaml` and role-specific prompts. - Refactored role instruction handling to accommodate new directory structure. - Enhanced project registration to scaffold prompt files in the new `devclaw/projects/<project>/prompts/` directory. - Adjusted setup tool descriptions and logic to reflect changes in file structure. - Updated templates to align with the new workflow configuration and role instructions.
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
/**
|
|
* config/types.ts — Types for the unified DevClaw configuration.
|
|
*
|
|
* A single workflow.yaml combines roles, models, and workflow.
|
|
* Three-layer resolution: built-in → workspace → per-project.
|
|
*/
|
|
import type { WorkflowConfig } from "../workflow.js";
|
|
|
|
/**
|
|
* Role override in workflow.yaml. All fields optional — only override what you need.
|
|
* Set to `false` to disable a role entirely for a project.
|
|
*/
|
|
export type RoleOverride = {
|
|
levels?: string[];
|
|
defaultLevel?: string;
|
|
models?: Record<string, string>;
|
|
emoji?: Record<string, string>;
|
|
completionResults?: string[];
|
|
};
|
|
|
|
/**
|
|
* The full workflow.yaml shape.
|
|
* All fields optional — missing fields inherit from the layer below.
|
|
*/
|
|
export type DevClawConfig = {
|
|
roles?: Record<string, RoleOverride | false>;
|
|
workflow?: Partial<WorkflowConfig>;
|
|
};
|
|
|
|
/**
|
|
* Fully resolved config — all fields guaranteed present.
|
|
* Built by merging three layers over the built-in defaults.
|
|
*/
|
|
export type ResolvedConfig = {
|
|
roles: Record<string, ResolvedRoleConfig>;
|
|
workflow: WorkflowConfig;
|
|
};
|
|
|
|
/**
|
|
* Fully resolved role config — all fields present.
|
|
*/
|
|
export type ResolvedRoleConfig = {
|
|
levels: string[];
|
|
defaultLevel: string;
|
|
models: Record<string, string>;
|
|
emoji: Record<string, string>;
|
|
completionResults: string[];
|
|
enabled: boolean;
|
|
};
|