/** * Switch Command Types * * Type definitions for the switch command that changes * working context between projects and specifications. */ /** * Types of resources that can be switched to */ export type SwitchTargetType = 'project' | 'specification'; /** * Result of detecting what type an ID refers to */ export interface DetectionResult { /** The type of resource detected */ type: SwitchTargetType; /** The resource data from the API */ data: ProjectData | SpecificationData; } /** * Project data from get_project API */ export interface ProjectData { /** Project ID */ id: string; /** Project name */ name: string; /** Project description (optional) */ description?: string; } /** * Specification data from get_specification API */ export interface SpecificationData { /** Specification ID */ id: string; /** Specification title */ title: string; /** Parent project ID */ projectId: string; /** Specification description (optional) */ description?: string; /** Specification status (optional) */ status?: string; } /** * API request for set_working_context */ export interface SetWorkingContextRequest extends Record { /** Project ID to set */ projectId: string; /** Specification ID to set (null to clear) */ specificationId: string | null; /** Epic ID to set (null to clear) */ epicId: string | null; /** Ticket ID to set (null to clear) */ ticketId: string | null; } /** * API response for set_working_context */ export interface SetWorkingContextResponse { /** Success indicator */ success?: boolean; /** Updated context */ context?: { projectId: string; specificationId: string | null; epicId: string | null; ticketId: string | null; }; } /** * Switch command result for display */ export interface SwitchResult { /** Whether switch was successful */ success: boolean; /** Type of resource switched to */ type: SwitchTargetType; /** Display name of the resource */ displayName: string; /** Project ID (always set) */ projectId: string; /** Specification ID (if switching to spec) */ specificationId?: string; } /** * Error codes for switch command */ export declare enum SwitchErrorCode { /** ID not provided */ MISSING_ID = "MISSING_ID", /** ID not found as project or specification */ NOT_FOUND = "NOT_FOUND", /** User does not have access to resource */ ACCESS_DENIED = "ACCESS_DENIED", /** Failed to update working context */ UPDATE_FAILED = "UPDATE_FAILED", /** Failed to save local config */ CONFIG_SAVE_FAILED = "CONFIG_SAVE_FAILED" } /** * Check if detection result is a project */ export declare function isProjectResult(result: DetectionResult): result is DetectionResult & { data: ProjectData; }; /** * Check if detection result is a specification */ export declare function isSpecificationResult(result: DetectionResult): result is DetectionResult & { data: SpecificationData; }; /** * Get display name from detection result */ export declare function getDisplayName(result: DetectionResult): string; /** * Create switch result from detection result */ export declare function createSwitchResult(result: DetectionResult): SwitchResult; //# sourceMappingURL=switch.types.d.ts.map