feat: Show resolving_conflict activity state on initiative cards
Add 'resolving_conflict' to InitiativeActivityState and detect active conflict agents (name starts with conflict-) in deriveInitiativeActivity. Conflict resolution takes priority over pending_review since the agent is actively working. - Add resolving_conflict to shared types and activity derivation - Include conflict agents in listInitiatives agent filter (name + mode) - Map resolving_conflict to urgent variant with pulse in InitiativeCard - Add merge: prefix to INITIATIVE_LIST_RULES for merge event routing - Add spawnConflictResolutionAgent to INVALIDATION_MAP - Add getActiveConflictAgent to detail page agent: SSE invalidation
This commit is contained in:
@@ -32,11 +32,12 @@ export interface SerializedInitiative {
|
||||
|
||||
function activityVisual(state: string): { label: string; variant: StatusVariant; pulse: boolean } {
|
||||
switch (state) {
|
||||
case "executing": return { label: "Executing", variant: "active", pulse: true };
|
||||
case "pending_review": return { label: "Pending Review", variant: "warning", pulse: true };
|
||||
case "discussing": return { label: "Discussing", variant: "active", pulse: true };
|
||||
case "detailing": return { label: "Detailing", variant: "active", pulse: true };
|
||||
case "refining": return { label: "Refining", variant: "active", pulse: true };
|
||||
case "executing": return { label: "Executing", variant: "active", pulse: true };
|
||||
case "pending_review": return { label: "Pending Review", variant: "warning", pulse: true };
|
||||
case "discussing": return { label: "Discussing", variant: "active", pulse: true };
|
||||
case "detailing": return { label: "Detailing", variant: "active", pulse: true };
|
||||
case "refining": return { label: "Refining", variant: "active", pulse: true };
|
||||
case "resolving_conflict": return { label: "Resolving Conflict", variant: "urgent", pulse: true };
|
||||
case "ready": return { label: "Ready", variant: "active", pulse: false };
|
||||
case "blocked": return { label: "Blocked", variant: "error", pulse: false };
|
||||
case "complete": return { label: "Complete", variant: "success", pulse: false };
|
||||
|
||||
@@ -45,6 +45,10 @@ export function mapEntityStatus(rawStatus: string): StatusVariant {
|
||||
case "medium":
|
||||
return "warning";
|
||||
|
||||
// Urgent / conflict resolution
|
||||
case "resolving_conflict":
|
||||
return "urgent";
|
||||
|
||||
// Error / failed
|
||||
case "crashed":
|
||||
case "blocked":
|
||||
|
||||
@@ -24,6 +24,7 @@ export const INITIATIVE_LIST_RULES: LiveUpdateRule[] = [
|
||||
{ prefix: 'task:', invalidate: ['listInitiatives'] },
|
||||
{ prefix: 'phase:', invalidate: ['listInitiatives'] },
|
||||
{ prefix: 'agent:', invalidate: ['listInitiatives'] },
|
||||
{ prefix: 'merge:', invalidate: ['listInitiatives'] },
|
||||
];
|
||||
|
||||
export function useLiveUpdates(rules: LiveUpdateRule[]) {
|
||||
|
||||
@@ -44,6 +44,7 @@ const INVALIDATION_MAP: Partial<Record<MutationName, QueryName[]>> = {
|
||||
spawnArchitectDiscuss: ["listAgents"],
|
||||
spawnArchitectPlan: ["listAgents"],
|
||||
spawnArchitectDetail: ["listAgents", "listInitiativeTasks"],
|
||||
spawnConflictResolutionAgent: ["listAgents", "listInitiatives", "getInitiative"],
|
||||
|
||||
// --- Initiatives ---
|
||||
createInitiative: ["listInitiatives"],
|
||||
|
||||
Reference in New Issue
Block a user