/** * Resolve the canonical `instance_id` for the current hook invocation. * * Precedence: * * 1. Hook payload fields. Current live V3 authority breaks ties: a live * child wins when it belongs to the payload session, otherwise the live * session/conversation wins over a stale adapter `agent_id`. With no live * evidence, the legacy `agent_id` → `subagent_id` → `session_id` → * `conversation_id` order remains the startup fallback. * 2. `HARNERY_AGENT_COORD_OWNER` outside bridge mode. Bridge-marked children * ignore this unvalidated override. * 3. Adapter-exported session identity matched to one live V3 generation. * This is the only payload-free identity accepted in bridge mode. * 4. PID-map lookup at `.harnery/pid-map/` for our own pid, then ppid * chain (up to 20 hops). * * Bridge-marked children fail closed after tier 3. A connector crosses a * process-tree boundary, so pid ancestry and singleton state are not evidence * of its logical session. * * Returns null when nothing resolves. Callers must treat null as "no owner" * and skip the event (Phase 2 fail-safe; Phase 3 will mint a temporary owner * for orphan events). */ export declare function resolveOwner(opts: { payload: Record | null; coordRoot: string; }): { instance_id: string; source: "env" | "payload" | "session_env" | "pidmap-self" | "pidmap-ancestor"; } | null; /** * Find the parent owner for a subagent invocation. The per-shell marker at * `.harnery/shells/` is set by `sub-agent-start` and removed by * `sub-agent-stop`. * * Phase 2 stub: the marker file isn't written yet, so we return null in most * cases. Phase 2 callers can pass through. */ export declare function readShellMarker(coordRoot: string, pid: number): string | null; /** Read the V3-projected `agent_id` for an owner if it exists. */ export declare function readAgentIdForOwner(coordRoot: string, instanceId: string): string | null; /** Diagnostic: list of pid-map entries (for debugging). */ export declare function listPidmap(coordRoot: string): Array<{ pid: number; owner: string; }>; //# sourceMappingURL=owner.d.ts.map