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:
@@ -16,6 +16,10 @@ export type {
|
||||
ServerStartedEvent,
|
||||
ServerStoppedEvent,
|
||||
LogEntryEvent,
|
||||
WorktreeCreatedEvent,
|
||||
WorktreeRemovedEvent,
|
||||
WorktreeMergedEvent,
|
||||
WorktreeConflictEvent,
|
||||
DomainEventMap,
|
||||
DomainEventType,
|
||||
} from './types.js';
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user