Files
devclaw-gitea/lib/config/types.ts
Lauren ten Hoor 371e760d94 feat: enhance workflow and testing infrastructure
- Introduced ExecutionMode type for project execution modes (parallel, sequential).
- Updated SetupOpts to use ExecutionMode instead of string literals.
- Enhanced workflow states to include a new "In Review" state with appropriate transitions.
- Implemented TestHarness for end-to-end testing, including command interception and workspace setup.
- Created TestProvider for in-memory issue tracking during tests.
- Refactored project registration and setup tools to utilize ExecutionMode.
- Updated various tools to ensure compatibility with new workflow and execution modes.
- Added new dependencies: cockatiel for resilience and zod for schema validation.
2026-02-16 13:27:14 +08:00

75 lines
1.9 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[];
};
/**
* Configurable timeout values (in milliseconds).
* All fields optional — defaults applied at resolution time.
*/
export type TimeoutConfig = {
gitPullMs?: number;
gatewayMs?: number;
sessionPatchMs?: number;
dispatchMs?: number;
staleWorkerHours?: number;
};
/**
* 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>;
timeouts?: TimeoutConfig;
};
/**
* Fully resolved timeout config — all fields present with defaults.
*/
export type ResolvedTimeouts = {
gitPullMs: number;
gatewayMs: number;
sessionPatchMs: number;
dispatchMs: number;
staleWorkerHours: number;
};
/**
* 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;
timeouts: ResolvedTimeouts;
};
/**
* 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;
};