agent-ecosystem/packages/agent-graph/src/strategies/index.ts
iliya 6621660376 feat(graph): add cross-team ghost nodes and task card improvements
- Cross-team messages now show ghost nodes (dashed hexagons) for external teams
- Ghost nodes have purple color, link icon, and connect to lead via message edge
- Particles flow between ghost node and lead with cross-team message labels
- Cross-team popover shows external team name
- Task click opens full KanbanTaskCard with glow effects and action buttons
- All kanban task actions wired through CustomEvent to TeamDetailView
2026-03-31 01:48:15 +03:00

28 lines
968 B
TypeScript

/**
* Strategy registry — maps GraphNodeKind to its render strategy.
* Open-Closed: add new node kinds by adding new strategies to the registry.
*/
import type { GraphNodeKind } from '../ports/types';
import type { NodeRenderStrategy } from './types';
import { LeadStrategy, MemberStrategy } from './memberStrategy';
import { TaskStrategy } from './taskStrategy';
import { ProcessStrategy } from './processStrategy';
const STRATEGIES: Record<GraphNodeKind, NodeRenderStrategy> = {
lead: new LeadStrategy(),
member: new MemberStrategy(),
task: new TaskStrategy(),
process: new ProcessStrategy(),
crossteam: new ProcessStrategy(), // Reuse process strategy (similar small node)
};
export function getNodeStrategy(kind: GraphNodeKind): NodeRenderStrategy {
return STRATEGIES[kind];
}
export function getAllStrategies(): NodeRenderStrategy[] {
return Object.values(STRATEGIES);
}
export type { NodeRenderStrategy, NodeRenderState } from './types';