/** * Event bus: lifecycle event dispatcher and `.aidlc/actions.yaml` loader/executor. * * The event system fires actions on lifecycle events (on-instance-start, * on-phase-enter, on-phase-exit, on-instance-complete, on-artifact-created). * * `.aidlc/actions.yaml` is the user-facing declarative configuration layer * over the shared event system used by plugin hooks (Req 20.9). * * Requirements: 20.1, 20.9 */ import type { ActionsConfig, EventPayload, DispatchReport } from '../core/types.js'; /** * Path of the retro-pending marker for an instance. Markers are coordination * data (like claims/registry): they live in `/aidlc/ * retro-pending/` so every worktree sees them and worktree removal cannot * destroy them. Outside a git repo they fall back to the instance state dir. */ export declare function retroPendingPath(projectRoot: string, instance: string): string; /** * Load and parse `.aidlc/actions.yaml` into an ActionsConfig. * * @param actionsPath - Absolute path to the `actions.yaml` file. * @returns The parsed config, or `null` if the file does not exist. * @throws Error if the file exists but is malformed or fails validation. */ export declare function loadActionsConfig(actionsPath: string): ActionsConfig | null; /** * Built-in action registry — maps `use` identifiers to handler functions. * * Each handler receives the event payload and the action's `with` config. * Returns `{ success: true }` or `{ success: false; error: string }`. */ export type BuiltInHandler = (event: EventPayload, config: Record | undefined) => { success: boolean; error?: string; }; /** * Register a custom built-in action handler (for testing / extensibility). */ export declare function registerBuiltIn(name: string, handler: BuiltInHandler): void; /** @see SHIPPED_BUILT_IN_IDS */ export declare function builtInActionIds(): string[]; /** * Emit a lifecycle event, matching and executing enabled actions. * * Behavior (Req 20.5-20.8): * - Only actions with `enabled: true` are considered. * - Actions must match event type and optional phase filter. * - `dryRun: true` → return what would fire, execute nothing. * - Non-blocking failure: log + continue. * - Blocking failure: log + skip the event's remaining actions. What it does to * the transition is the caller's to decide, per event — see `aidlc transition`. * * @param event - The lifecycle event payload. * @param actions - Parsed actions config (or null if no actions.yaml). * @param opts - Options: `dryRun` to skip execution; `projectRoot` anchors the * run-action trust store (defaults to resolving from cwd). * @returns A DispatchReport listing what fired and outcomes. */ export declare function emit(event: EventPayload, actions: ActionsConfig | null, opts?: { dryRun?: boolean; projectRoot?: string; }): DispatchReport; //# sourceMappingURL=event-bus.d.ts.map