/**
 * `ActivityLog` — the crew's append-only transcript of what happened, when.
 *
 * Where the {@link import("../workboard").TicketBoard} holds the *current* state
 * of the work and the {@link import("../postbox").Channel} carries the *messages*
 * between teammates, the activity log is the third leg: an immutable, ordered
 * record of the coordination *events* themselves — a member was spawned, a ticket
 * was claimed or completed, a result envelope was sent. It is what a transcript
 * viewer replays and what an audit reads back; nothing in the crew depends on it
 * for correctness, so it is a pure observer.
 *
 * It is a deliberately thin wrapper over the kernel's {@link JsonlLog}: every
 * event is one schema-validated append, and the timeline is one validated read.
 * The log never touches `node:fs` locking, temp renames, or coercion — that all
 * lives in the kernel. Events are a small, table-like discriminated union keyed
 * by `kind`, validated by zod on the way in and out, so a malformed event can
 * never reach (or be trusted from) disk.
 *
 * Two verbs:
 *   - {@link ActivityLog.record} — validate and append one {@link CrewEvent}.
 *   - {@link ActivityLog.timeline} — read back every event in append order.
 */
import { z } from "zod";
/** The closed set of coordination events the crew narrates. */
export declare const CREW_EVENT_KINDS: readonly ["member_spawned", "ticket_posted", "ticket_claimed", "ticket_done", "ticket_failed", "message_sent"];
/** One coordination-event class — the discriminant of {@link CrewEvent}. */
export type CrewEventKind = (typeof CREW_EVENT_KINDS)[number];
/**
 * The event schema, as a discriminated union over `kind`. Each branch pins the
 * fields that class of event carries — the role for a spawn, the ticket id for a
 * lifecycle transition, the envelope id and endpoints for a message — so a
 * timeline consumer can narrow on `kind` and read exactly the fields that apply.
 */
declare const crewEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
    kind: z.ZodLiteral<"member_spawned">;
    memberId: z.ZodString;
    role: z.ZodString;
    id: z.ZodString;
    ts: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
    kind: z.ZodLiteral<"ticket_posted">;
    ticketId: z.ZodString;
    title: z.ZodString;
    id: z.ZodString;
    ts: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
    kind: z.ZodLiteral<"ticket_claimed">;
    ticketId: z.ZodString;
    memberId: z.ZodString;
    id: z.ZodString;
    ts: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
    kind: z.ZodLiteral<"ticket_done">;
    ticketId: z.ZodString;
    memberId: z.ZodString;
    summary: z.ZodString;
    id: z.ZodString;
    ts: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
    kind: z.ZodLiteral<"ticket_failed">;
    ticketId: z.ZodString;
    memberId: z.ZodString;
    error: z.ZodString;
    id: z.ZodString;
    ts: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
    kind: z.ZodLiteral<"message_sent">;
    envelopeId: z.ZodString;
    from: z.ZodString;
    to: z.ZodString;
    envelopeType: z.ZodString;
    id: z.ZodString;
    ts: z.ZodNumber;
}, z.core.$strip>], "kind">;
/** A validated crew coordination event. */
export type CrewEvent = z.infer<typeof crewEventSchema>;
/**
 * What a caller hands to {@link ActivityLog.record}: any {@link CrewEvent}
 * without the auto-stamped `id`/`ts` header (either may still be supplied to
 * override the defaults). The id is minted and the timestamp is stamped by the
 * log if absent.
 */
export type CrewEventInput = (Omit<Extract<CrewEvent, {
    kind: "member_spawned";
}>, "id" | "ts"> & EventStamp) | (Omit<Extract<CrewEvent, {
    kind: "ticket_posted";
}>, "id" | "ts"> & EventStamp) | (Omit<Extract<CrewEvent, {
    kind: "ticket_claimed";
}>, "id" | "ts"> & EventStamp) | (Omit<Extract<CrewEvent, {
    kind: "ticket_done";
}>, "id" | "ts"> & EventStamp) | (Omit<Extract<CrewEvent, {
    kind: "ticket_failed";
}>, "id" | "ts"> & EventStamp) | (Omit<Extract<CrewEvent, {
    kind: "message_sent";
}>, "id" | "ts"> & EventStamp);
/** The optional header overrides a caller may pin on a recorded event. */
interface EventStamp {
    /** Override the minted id. */
    readonly id?: string;
    /** Override the stamped timestamp. */
    readonly ts?: number;
}
/**
 * The crew's audit/transcript observer, backed by one {@link JsonlLog}.
 *
 * Open with {@link ActivityLog.open}; the factory wires up the underlying log
 * (which ensures the parent directory exists). It is an *observer*: the crew
 * narrates events to it, but it holds no authority over the work and can be
 * dropped without affecting correctness.
 */
export declare class ActivityLog {
    private readonly log;
    /** Injected clock, epoch ms — overridable for deterministic tests. */
    private readonly now;
    private constructor();
    /** Absolute path of the `.jsonl` file backing this log. */
    get path(): string;
    /**
     * Open (or adopt) the activity log stored at `path`.
     *
     * `now` defaults to `Date.now`; tests may inject a deterministic clock so
     * recorded timestamps are reproducible.
     */
    static open(path: string, now?: () => number): Promise<ActivityLog>;
    /**
     * Validate and append one coordination event, returning the stored record.
     *
     * The event's `id` is minted (`act_<ULID>`) and its `ts` is stamped with the
     * current time when the caller leaves them off. The completed event is run
     * through the schema before it touches disk, so a malformed event raises a
     * `validation` fault rather than corrupting the transcript.
     */
    record(event: CrewEventInput): Promise<CrewEvent>;
    /**
     * Read back every recorded event, in append (chronological) order.
     *
     * A missing log is an empty timeline, not an error. Each line is schema-checked
     * on the way out, so a corrupt transcript surfaces as a `validation` fault
     * naming the bad line rather than silently returning garbage.
     */
    timeline(): Promise<CrewEvent[]>;
}
export {};
