/** * Version marker for the trajectory ledger persisted under `.hivemind/state`. */ export declare const TRAJECTORY_LEDGER_VERSION: 1; /** * Lifecycle status for a trajectory record. * * Per D-31 to D-35 (CONTEXT.md), trajectories use 5 lifecycle states * with both automatic (event-based) and manual (tool-call) transitions. * * State machine: * ``` * planning ──→ executing ──→ verifying ──→ completed ──→ closed * ``` */ export type TrajectoryStatus = "planning" | "executing" | "verifying" | "completed" | "closed"; /** * Valid state transitions for trajectory lifecycle. * * Each key is a source status, value is an array of valid target statuses. * Empty arrays indicate terminal states. * * @remarks * Based on ALLOWED_TRANSITIONS pattern from agent-work-contracts/lifecycle.ts. */ export declare const TRAJECTORY_TRANSITIONS: Record; /** * Event type constants for automatic trajectory transitions. * * Per D-32 to D-34, certain events trigger automatic state transitions. */ export declare const EVENT_DELEGATION_STARTED: "delegation:started"; export declare const EVENT_EXECUTION_COMPLETE: "execution:complete"; export declare const EVENT_VERIFICATION_PASS: "verification:pass"; /** * Maps event types to automatic target states. * * When a trajectory receives an event matching one of these keys, * it should automatically transition to the mapped target state * (if the transition is valid per TRAJECTORY_TRANSITIONS). */ export declare const TRAJECTORY_AUTO_TRANSITIONS: Record; /** * Jump link format for connecting trajectory events to delegation records. * * Per D-22, jump links use `delegation:{childSessionID}` format. * This avoids data duplication between trajectory and delegation-persistence. */ export type JumpLink = `delegation:${string}`; /** * Evidence reference stored by trajectory records. * * @remarks * References are strings by design: trajectory never owns or mutates journal, * continuity, delegation, or document evidence. */ export type EvidenceRef = string; /** * Checkpoint captured against a trajectory. */ export type TrajectoryCheckpoint = { /** Stable checkpoint identifier supplied by the caller or generated by operations. */ checkpointId: string; /** Bounded human-readable checkpoint summary. */ summary: string; /** Evidence references supporting the checkpoint. */ evidenceRefs: EvidenceRef[]; /** Unix timestamp in milliseconds. */ createdAt: number; }; /** * Event captured against a trajectory. */ export type TrajectoryEvent = { /** Stable event identifier supplied by the caller or generated by operations. */ eventId: string; /** Event classification such as `recovery`, `handoff`, or `note`. */ eventType: string; /** Bounded human-readable event summary. */ summary: string; /** Evidence references supporting the event. */ evidenceRefs: EvidenceRef[]; /** Unix timestamp in milliseconds. */ createdAt: number; }; /** * Trajectory record tying resumability evidence to a root session lineage. */ export type TrajectoryRecord = { /** Unique trajectory identifier. */ id: string; /** Root session ID for traversal grouping. */ rootSessionId: string; /** Optional concrete session ID represented by this trajectory node. */ sessionId: string | null; /** Optional parent trajectory ID for parent-child traversal. */ parentTrajectoryId: string | null; /** Current lifecycle status. */ status: TrajectoryStatus; /** Deduplicated evidence references attached to the node. */ evidenceRefs: EvidenceRef[]; /** Ordered checkpoints recorded against the node. */ checkpoints: TrajectoryCheckpoint[]; /** Ordered events recorded against the node. */ events: TrajectoryEvent[]; /** Unix timestamp in milliseconds when the node was created. */ createdAt: number; /** Unix timestamp in milliseconds when the node was last changed. */ updatedAt: number; /** Optional close summary for closed records. */ closeSummary?: string; }; /** * Phase-level trajectory record extending TrajectoryRecord. * * Per D-01, trajectory is per-PHASE (not per-delegation). * Per D-04, phase trajectory ID format is `traj-phase-{N}`. */ export type PhaseTrajectoryRecord = TrajectoryRecord & { /** Phase number from ROADMAP (e.g. 25, "25.5"). */ phaseNumber: number | string; /** Optional human-readable phase name. */ phaseName?: string; }; /** * Durable trajectory ledger file shape. */ export type TrajectoryLedger = { /** Schema version. */ version: typeof TRAJECTORY_LEDGER_VERSION; /** Unix timestamp in milliseconds when the ledger was last changed. */ updatedAt: number; /** Trajectory records keyed by trajectory ID. */ trajectories: Record; }; /** * Edge in a trajectory traversal projection. */ export type TrajectoryEdge = { /** Parent trajectory ID. */ from: string; /** Child trajectory ID. */ to: string; }; /** * Traversal projection for a root session, session, or trajectory filter. */ export type TrajectoryTraversal = { /** Matching trajectory records sorted parent-before-child where possible. */ trajectories: TrajectoryRecord[]; /** Parent-child edges between matching records. */ edges: TrajectoryEdge[]; }; /** * Summary projection for progressive disclosure (depth=summary). * * Per D-28, summary returns: status + event count + phase name + duration. */ export type TrajectorySummary = { /** Trajectory ID. */ id: string; /** Current lifecycle status. */ status: TrajectoryStatus; /** Number of events recorded. */ eventCount: number; /** Number of checkpoints recorded. */ checkpointCount: number; /** Duration in milliseconds (updatedAt - createdAt). */ durationMs: number; /** Optional phase name (for phase-level trajectories). */ phaseName?: string; }; /** * Progressive disclosure depth levels. * * Per D-27, all 3 levels are required: * - `summary`: status + event count + phase name + duration * - `detailed`: event types + summaries + delegation chain * - `full`: all evidence refs + checkpoints + jump links + full event data */ export type TrajectoryDepth = "summary" | "detailed" | "full"; /** * Common input accepted by trajectory mutating operations. */ export type TrajectoryMutationInput = { /** Project root whose `.hivemind/state/trajectory-ledger.json` should be used. */ projectRoot: string; /** Target trajectory ID. */ trajectoryId: string; /** Root session ID for creating records. */ rootSessionId?: string; /** Concrete session ID for creating or updating records. */ sessionId?: string; /** Parent trajectory ID for creating or updating records. */ parentTrajectoryId?: string; /** Single evidence reference convenience field. */ evidenceRef?: EvidenceRef; /** Additional evidence references. */ evidenceRefs?: EvidenceRef[]; }; //# sourceMappingURL=types.d.ts.map