Skip to content

Commit 2aac5b5

Browse files
committed
fix(mcp): break circular dependency between keyword.types and council-preset.service
Extract CouncilPreset interface and CouncilMode type to a dedicated council-preset.types.ts file that has no imports from keyword module. Both keyword.types.ts and council-preset.service.ts now import from the shared types file, eliminating the cycle. - keyword.types.ts → council-preset.types.ts (no cycle) - council-preset.service.ts → council-preset.types.ts (no cycle) - council-preset.service.ts re-exports CouncilPreset for API compat
1 parent 056873e commit 2aac5b5

3 files changed

Lines changed: 20 additions & 13 deletions

File tree

apps/mcp-server/src/agent/council-preset.service.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
import { Injectable } from '@nestjs/common';
2-
import type { Mode } from '../keyword/keyword.types';
2+
import type { CouncilMode, CouncilPreset } from './council-preset.types';
33

4-
/**
5-
* A deterministic council preset: a primary agent plus specialist reviewers
6-
*/
7-
export interface CouncilPreset {
8-
mode: 'PLAN' | 'EVAL';
9-
primary: string;
10-
specialists: string[];
11-
}
12-
13-
type CouncilMode = Extract<Mode, 'PLAN' | 'EVAL'>;
4+
export type { CouncilPreset } from './council-preset.types';
145

156
const COUNCIL_PRESETS: Record<CouncilMode, CouncilPreset> = {
167
PLAN: {
@@ -36,7 +27,7 @@ export class CouncilPresetService {
3627
* Resolve the council preset for a given mode.
3728
* Returns null for modes without a preset (ACT, AUTO).
3829
*/
39-
resolvePreset(mode: Mode): CouncilPreset | null {
30+
resolvePreset(mode: string): CouncilPreset | null {
4031
const preset = COUNCIL_PRESETS[mode as CouncilMode];
4132
if (!preset) return null;
4233
return { ...preset, specialists: [...preset.specialists] };
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Council Preset Types — extracted to break circular dependency
3+
* between keyword.types and council-preset.service.
4+
*/
5+
6+
/** Modes that support council presets */
7+
export type CouncilMode = 'PLAN' | 'EVAL';
8+
9+
/**
10+
* A deterministic council preset: a primary agent plus specialist reviewers.
11+
*/
12+
export interface CouncilPreset {
13+
mode: CouncilMode;
14+
primary: string;
15+
specialists: string[];
16+
}

apps/mcp-server/src/keyword/keyword.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { DiffAnalysisResult } from './diff-analyzer';
2-
import type { CouncilPreset } from '../agent/council-preset.service';
2+
import type { CouncilPreset } from '../agent/council-preset.types';
33
import type { CouncilSummary } from '../collaboration/council-summary.types';
44

55
export const KEYWORDS = ['PLAN', 'ACT', 'EVAL', 'AUTO'] as const;

0 commit comments

Comments
 (0)