/** * Conduit Messaging Hook Handlers * * Captures orchestration lifecycle events (SubagentStart, SubagentStop, * SessionEnd) and writes structured messages to conduit.db via LocalTransport. * This is the DECOUPLED approach: hooks observe orchestration events without * any changes to the orchestrate engine itself. * * Message format (JSON string stored as conduit message content): * { type, from, to, content, taskId, timestamp } * * All handlers are best-effort — failures are silently swallowed so that * conduit writes NEVER crash or block agent orchestration. * * Auto-registers on module load. * * @task T268 */ import { LocalTransport } from '../../conduit/local-transport.js'; import type { SessionEndPayload, SubagentStartPayload, SubagentStopPayload } from '../types.js'; /** * Attempt to create and connect a LocalTransport for conduit.db. * * Returns null when conduit.db is unavailable (not yet initialised), or when * the connect call fails, so callers can bail out gracefully without throwing. * * The `transportFactory` parameter exists for testing: callers can inject a * mock constructor so no real conduit.db is required in unit tests. * * @param projectRoot - Absolute path to the project root directory. * @param transportFactory - Optional factory used to construct the transport. * Defaults to the `LocalTransport` class. */ export declare function tryGetLocalTransport(projectRoot: string, transportFactory?: typeof LocalTransport): Promise | null>; /** * Handle SubagentStart — send a spawn message to conduit.db. * * Writes a `subagent.spawn` message from `cleo-orchestrator` to the * spawned agent ID so orchestrators and watchers can observe the event. * * Best-effort: failures are swallowed and logged at debug level. * * @param projectRoot - Absolute path to the project root directory. * @param payload - SubagentStart event payload. */ export declare function handleConduitSubagentStart(projectRoot: string, payload: SubagentStartPayload): Promise; /** * Handle SubagentStop — send a completion message to conduit.db. * * Writes a `subagent.complete` message from the stopped agent to * `cleo-system` so orchestrators can audit completion outcomes. * * Best-effort: failures are swallowed and logged at debug level. * * @param projectRoot - Absolute path to the project root directory. * @param payload - SubagentStop event payload. */ export declare function handleConduitSubagentStop(projectRoot: string, payload: SubagentStopPayload): Promise; /** * Handle SessionEnd — send a handoff message if a next task is suggested. * * Writes a `session.handoff` message to `cleo-system` when the session * metadata includes a `nextTask` suggestion (stored in `metadata.nextTask`). * The message lets waiting agents pick up where the session left off. * * Best-effort: failures are swallowed and logged at debug level. * * @param projectRoot - Absolute path to the project root directory. * @param payload - SessionEnd event payload. */ export declare function handleConduitSessionEnd(projectRoot: string, payload: SessionEndPayload): Promise; //# sourceMappingURL=conduit-hooks.d.ts.map