/** * The project bus seam (DES-PROJECT-001 §4) — crew's side of the conversation. * * Two halves, one bus handle: * * 1. EMIT `wicked.crew.project.{created,updated,archived}` and * `wicked.crew.membership.{attached,detached}` — always POST-COMMIT (the route handlers call * these only after the engine's reply, so a phantom event for a write that never landed cannot * exist). Idempotency keys are TYPE-INCLUSIVE (DES-EXEC-001 rev0.2 correction #4a — two event * types sharing a key silently drop one on the bus's UNIQUE constraint) and occurrence-unique * (an attach after a detach is a new fact, so the key carries the attach timestamp). * * 2. BRIDGE `wicked.interactive.*` events that carry a `project_id` onto the daemon's `/ws` * stream as `projectActivity` frames, so an open project view sees creator-skin progress live * without a reload (ADR §5.2 / §8 step 7). The durable feed read is `activity.ts`; this is * only the liveness tap. * * Posture mirrors the QE/interactive-draft seams: the bus is OPTIONAL. A machine without * wicked-bus (or with a broken db) gets a loudly-logged null — project CRUD keeps working, the * events simply don't ride, and the daemon boots regardless. */ /** Crew's bus DOMAIN COLUMN value — the product-scoped plugin name, matching the repo precedent * (`INTERACTIVE_DOMAIN = 'wicked-interactive'`). The EVENT TYPES carry the §4 grammar's bare * `crew` segment (`wicked.crew.project.created`); the two spellings are different fields. */ export declare const CREW_BUS_DOMAIN = "wicked-crew"; export declare const PROJECT_CREATED = "wicked.crew.project.created"; export declare const PROJECT_UPDATED = "wicked.crew.project.updated"; export declare const PROJECT_ARCHIVED = "wicked.crew.project.archived"; export declare const MEMBERSHIP_ATTACHED = "wicked.crew.membership.attached"; export declare const MEMBERSHIP_DETACHED = "wicked.crew.membership.detached"; export interface ProjectBus { /** Emit one post-commit project event (through the engine, core/bus.ts). Never rejects; a key * already on the bus is success. */ emit(type: string, payload: Record, idempotencyKey: string): Promise; /** The resolved bus db path (the activity feed's read side opens the same file). */ dbPath: string | null; stop(): Promise; } export interface ProjectBusOptions { /** The bus db the daemon handed its engine (core/bus.ts); without one the seam does not arm. */ dbPath?: string; /** Poll cadence for the /ws bridge subscriber, ms (tests shorten it). */ pollIntervalMs?: number; log?: (msg: string) => void; /** Error-level logger for connection-fatal subscriber errors (the /diagnostics ring folds it); defaults to `log`. */ logError?: (msg: string) => void; } /** * Arm both halves. Returns `null` (logged) when the bus db cannot open — the caller degrades to * CRUD-without-events. */ export declare function startProjectBus(opts?: ProjectBusOptions): Promise; export declare function projectCreatedKey(projectId: string): string; export declare function projectUpdatedKey(projectId: string, updatedAt: number): string; export declare function projectArchivedKey(projectId: string, updatedAt: number): string; export declare function membershipAttachedKey(projectId: string, kind: string, ref: string, attachedAt: number): string; export declare function membershipDetachedKey(projectId: string, memberId: string, at: number): string; //# sourceMappingURL=events.d.ts.map