feat(migration): implement workspace layout migration and testing
- 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.
This commit is contained in:
23
index.ts
23
index.ts
@@ -15,28 +15,6 @@ import { registerCli } from "./lib/cli.js";
|
||||
import { registerHeartbeatService } from "./lib/services/heartbeat.js";
|
||||
import { registerBootstrapHook } from "./lib/bootstrap-hook.js";
|
||||
import { initRunCommand } from "./lib/run-command.js";
|
||||
import { ROLE_REGISTRY } from "./lib/roles/index.js";
|
||||
|
||||
/** Build the models config schema dynamically from the role registry. */
|
||||
function buildModelsSchema(): Record<string, unknown> {
|
||||
const properties: Record<string, unknown> = {};
|
||||
for (const [roleId, config] of Object.entries(ROLE_REGISTRY)) {
|
||||
const levelProps: Record<string, unknown> = {};
|
||||
for (const level of config.levels) {
|
||||
levelProps[level] = { type: "string" };
|
||||
}
|
||||
properties[roleId] = {
|
||||
type: "object",
|
||||
description: `${config.displayName} level models`,
|
||||
properties: levelProps,
|
||||
};
|
||||
}
|
||||
return {
|
||||
type: "object",
|
||||
description: "Model mapping per role and level",
|
||||
properties,
|
||||
};
|
||||
}
|
||||
|
||||
const plugin = {
|
||||
id: "devclaw",
|
||||
@@ -46,7 +24,6 @@ const plugin = {
|
||||
configSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
models: buildModelsSchema(),
|
||||
projectExecution: {
|
||||
type: "string",
|
||||
enum: ["parallel", "sequential"],
|
||||
|
||||
Reference in New Issue
Block a user