feat(03-01): add git domain events to event system

- WorktreeCreatedEvent for worktree creation tracking
- WorktreeRemovedEvent for worktree cleanup tracking
- WorktreeMergedEvent for successful merge tracking
- WorktreeConflictEvent for merge conflict notification
- All events added to DomainEventMap union type
This commit is contained in:
Lukas May
2026-01-30 19:23:06 +01:00
parent e2567ded0a
commit 9d7b90b238
2 changed files with 49 additions and 1 deletions

View File

@@ -16,6 +16,10 @@ export type {
ServerStartedEvent,
ServerStoppedEvent,
LogEntryEvent,
WorktreeCreatedEvent,
WorktreeRemovedEvent,
WorktreeMergedEvent,
WorktreeConflictEvent,
DomainEventMap,
DomainEventType,
} from './types.js';

View File

@@ -92,6 +92,46 @@ export interface LogEntryEvent extends DomainEvent {
};
}
/**
* Git Worktree Events
*/
export interface WorktreeCreatedEvent extends DomainEvent {
type: 'worktree:created';
payload: {
worktreeId: string;
branch: string;
path: string;
};
}
export interface WorktreeRemovedEvent extends DomainEvent {
type: 'worktree:removed';
payload: {
worktreeId: string;
branch: string;
};
}
export interface WorktreeMergedEvent extends DomainEvent {
type: 'worktree:merged';
payload: {
worktreeId: string;
sourceBranch: string;
targetBranch: string;
};
}
export interface WorktreeConflictEvent extends DomainEvent {
type: 'worktree:conflict';
payload: {
worktreeId: string;
sourceBranch: string;
targetBranch: string;
conflictingFiles: string[];
};
}
/**
* Union of all domain events - enables type-safe event handling
*/
@@ -101,7 +141,11 @@ export type DomainEventMap =
| ProcessCrashedEvent
| ServerStartedEvent
| ServerStoppedEvent
| LogEntryEvent;
| LogEntryEvent
| WorktreeCreatedEvent
| WorktreeRemovedEvent
| WorktreeMergedEvent
| WorktreeConflictEvent;
/**
* Event type literal union for type checking