小橘 e8765abac6 fix: pass nerveRoot to tester prompts for correct path resolution
Hermes agent cwd is not necessarily the nerve workspace root.
Inject nerveRoot into tester prompts so all file paths and commands
use absolute paths to the workspace directory.
2026-04-28 13:03:31 +00:00

30 lines
967 B
TypeScript

import type { WorkflowDefinition } from "@uncaged/nerve-core";
import type { LlmProvider } from "@uncaged/nerve-workflow-utils";
import { buildPlannerRole } from "./roles/planner/index.js";
import { buildCoderRole } from "./roles/coder/index.js";
import { buildTesterRole } from "./roles/tester/index.js";
import { buildCommitterRole } from "./roles/committer/index.js";
import { moderator } from "./moderator.js";
import type { SenseMeta } from "./moderator.js";
export type BuildSenseGeneratorDeps = {
provider: LlmProvider;
cwd: string;
};
export function buildSenseGenerator({
provider,
cwd,
}: BuildSenseGeneratorDeps): WorkflowDefinition<SenseMeta> {
return {
name: "sense-generator",
roles: {
planner: buildPlannerRole({ provider, cwd }),
coder: buildCoderRole({ provider, cwd }),
tester: buildTesterRole({ provider, nerveRoot: cwd }),
committer: buildCommitterRole({ nerveRoot: cwd }),
},
moderator,
};
}