/**
 * V2 Request Type Definitions
 *
 * A Request represents a single user goal — "one thing the user wants
 * the system to accomplish." Requests are the primary user-facing object
 * in V2 architecture.
 *
 * @module types/v2/request.types
 */
/**
 * Lifecycle statuses for a Request.
 *
 * State machine:
 *   open → ready                  (planner created WorkItems)
 *   open → cancelled              (user cancelled before planning)
 *   ready → running               (first WorkItem started)
 *   running → blocked             (all active WorkItems blocked/failed)
 *   running → waiting_confirmation (all done, requiresConfirmation=true)
 *   running → done                (all done, requiresConfirmation=false)
 *   blocked → running             (WorkItem unblocked or new WorkItem created)
 *   waiting_confirmation → done   (user confirmed)
 *   waiting_confirmation → running (user rejected, new WorkItems needed)
 *   any → cancelled               (user explicitly cancels)
 */
export type RequestStatus = 'open' | 'ready' | 'running' | 'blocked' | 'waiting_confirmation' | 'done' | 'cancelled';
/** All valid RequestStatus values as a readonly array. */
export declare const REQUEST_STATUSES: readonly RequestStatus[];
/** Terminal statuses — no further transitions allowed (except cancel). */
export declare const TERMINAL_REQUEST_STATUSES: ReadonlySet<RequestStatus>;
/**
 * Intent category carried from v1 IntentTask system.
 */
export type IntentCategory = 'query' | 'code_change' | 'debugging' | 'deployment' | 'research' | 'review' | 'planning' | 'communication' | 'other';
/** All valid IntentCategory values. */
export declare const INTENT_CATEGORIES: readonly IntentCategory[];
/**
 * Intent complexity level — determines planning strategy.
 * - L0: trivial, no WorkItem needed (direct response)
 * - L1: single WorkItem sufficient
 * - L2: multiple WorkItems, potentially parallel
 * - L3: OKR/sprint-scoped initiative — multi-day, multi-PR, ORC owns the
 *   plan personally and recursively decomposes into L2 over time.
 *   v0 routes L3 the same as L2 internally; the *label* is preserved so
 *   future routing-split lands without retro-classifying.
 */
export type IntentLevel = 'L0' | 'L1' | 'L2' | 'L3';
/**
 * A user-level request representing a single goal.
 *
 * Requests are the primary unit of work visible to users.
 * Each Request is fulfilled through one or more WorkItems.
 */
export interface Request {
    /** UUID v4 */
    id: string;
    /** ConversationItem that originated this Request */
    sourceConversationItemId: string;
    /** Human-readable title (generated from intent parsing) */
    title: string;
    /** Detailed description of what the user wants */
    description: string;
    /** Lifecycle status */
    status: RequestStatus;
    /** User-assigned or auto-classified priority */
    priority: 'low' | 'normal' | 'high';
    /** Whether completion requires explicit user confirmation */
    requiresConfirmation: boolean;
    /** Reason confirmation is needed (shown to user) */
    confirmationReason?: string;
    /** WorkItem IDs created to fulfill this Request */
    workItemIds: string[];
    /** Optional link to a Mission this Request contributes to */
    missionId?: string;
    /** Optional link to a ProjectTask created from this Request */
    projectTaskId?: string;
    /** Intent complexity level */
    intentLevel: IntentLevel;
    /** Intent category */
    intentCategory: IntentCategory;
    /** Tags for filtering */
    tags: string[];
    /** ISO8601 timestamps */
    createdAt: string;
    updatedAt: string;
    completedAt?: string;
    /** Result summary (set on completion) */
    result?: string;
    /** Total token usage across all WorkItems */
    totalInputTokens: number;
    totalOutputTokens: number;
    /** Total cost in USD */
    totalCost: number;
    /** Session name of the agent that handled this Request directly (no WorkItem delegation) */
    ownerAgent?: string;
}
/**
 * Input for creating a new Request.
 * Fields with defaults are optional.
 */
export interface CreateRequestInput {
    sourceConversationItemId: string;
    title: string;
    description: string;
    priority?: 'low' | 'normal' | 'high';
    requiresConfirmation?: boolean;
    confirmationReason?: string;
    missionId?: string;
    intentLevel?: IntentLevel;
    intentCategory?: IntentCategory;
    tags?: string[];
}
/**
 * Input for updating an existing Request.
 * All fields optional — only provided fields are updated.
 */
export interface UpdateRequestInput {
    title?: string;
    description?: string;
    status?: RequestStatus;
    priority?: 'low' | 'normal' | 'high';
    requiresConfirmation?: boolean;
    confirmationReason?: string;
    missionId?: string;
    projectTaskId?: string;
    result?: string;
    tags?: string[];
    /** Token roll-up fields — incremented by V3.1 task completion hooks */
    totalInputTokens?: number;
    totalOutputTokens?: number;
    totalCost?: number;
    /** Session name of the agent that handled this Request directly */
    ownerAgent?: string;
}
/**
 * Map of valid status transitions.
 * Key = current status, Value = set of allowed next statuses.
 */
export declare const REQUEST_TRANSITIONS: Record<RequestStatus, ReadonlySet<RequestStatus>>;
/**
 * Checks whether a string is a valid RequestStatus.
 *
 * @param value - The string to check
 * @returns True if value is a valid RequestStatus
 */
export declare function isValidRequestStatus(value: string): value is RequestStatus;
/**
 * Checks whether a string is a valid IntentCategory.
 *
 * @param value - The string to check
 * @returns True if value is a valid IntentCategory
 */
export declare function isValidIntentCategory(value: string): value is IntentCategory;
/**
 * Checks whether a status transition is valid according to the state machine.
 *
 * @param from - Current status
 * @param to - Desired next status
 * @returns True if transition is allowed
 */
export declare function isValidRequestTransition(from: RequestStatus, to: RequestStatus): boolean;
/**
 * Validates that an object is structurally a valid Request.
 *
 * @param value - Unknown value to validate
 * @returns True if value conforms to the Request interface
 */
export declare function isRequest(value: unknown): value is Request;
/**
 * Validates CreateRequestInput and returns an array of error messages.
 * Empty array means input is valid.
 *
 * @param input - The creation input to validate
 * @returns Array of validation error strings (empty = valid)
 */
export declare function validateCreateRequestInput(input: CreateRequestInput): string[];
/**
 * Creates a new Request with sensible defaults.
 *
 * @param input - Required and optional creation fields
 * @returns A fully populated Request object
 *
 * @example
 * ```typescript
 * const request = createRequest({
 *   sourceConversationItemId: 'conv-123',
 *   title: 'Deploy staging',
 *   description: 'Deploy the current build to staging env',
 * });
 * ```
 */
export declare function createRequest(input: CreateRequestInput): Request;
//# sourceMappingURL=request.types.d.ts.map