import type { WorkflowDefaults } from '../../../app/actions/get-workflow-defaults.js';
import { BuildMode as BuildModeEnum } from '../../../../../../packages/core/src/domain/generated/output.js';
export type { FileAttachment } from '../../../../../../packages/core/src/infrastructure/services/file-dialog.service.js';
/** Attachment record for the create form — supports both picker and upload sources. */
export interface FormAttachment {
    id: string;
    name: string;
    size: number;
    mimeType: string;
    path: string;
    loading?: boolean;
    /** Optional user notes or annotations for this image */
    notes?: string;
}
/**
 * Build mode for the create drawer. Type alias derived from the generated
 * TypeSpec `BuildMode` enum so the UI cannot drift from the domain. Internal
 * code uses the enum members (`BuildModeEnum.Fast | .Spec`) per the
 * no-magic-values rule; the exported type is a string-literal union so call
 * sites can pass either enum members (preferred) or matching string literals.
 *
 * Note: the TypeSpec enum still includes `Application` for legacy rows that
 * were created before the picker was simplified — those features keep
 * working, but the drawer no longer offers `Application` as a selectable
 * option since it is operationally identical to `Spec` (both set fast=false).
 */
export type BuildMode = `${BuildModeEnum}`;
/** Minimal feature descriptor for the parent selector. */
export interface ParentFeatureOption {
    id: string;
    name: string;
}
/** Minimal repository descriptor for the repository selector. */
export interface RepositoryOption {
    id: string;
    name: string;
    path: string;
    isFork?: boolean;
    upstreamUrl?: string;
}
export interface FeatureCreatePayload {
    description: string;
    attachments: FormAttachment[];
    repositoryPath: string;
    approvalGates: {
        allowPrd: boolean;
        allowPlan: boolean;
        allowMerge: boolean;
    };
    push: boolean;
    openPr: boolean;
    ciWatchEnabled: boolean;
    enableEvidence: boolean;
    commitEvidence: boolean;
    parentId?: string;
    /** When true, skip SDLC phases and implement directly from the prompt. */
    fast: boolean;
    /** When true, create the feature in pending state (no agent spawned). */
    pending?: boolean;
    /** Fork repo and create PR to upstream at merge time. */
    forkAndPr: boolean;
    /** Commit specs/evidences into the repo (defaults false when forkAndPr is enabled). */
    commitSpecs: boolean;
    /** Sync main from remote before creating the feature branch (default: true). */
    rebaseBeforeBranch: boolean;
    /** Inject curated skills into the feature worktree. */
    injectSkills: boolean;
    /** Optional agent type override for this feature run */
    agentType?: string;
    /** Optional model override for this feature run */
    model?: string;
    sessionId?: string;
    /** When the drawer was launched scoped to an Application, the
     *  application's domain UUID. Persisted on the Feature so the
     *  Control Center can render an app→feature parent edge instead
     *  of a virtual repository node. */
    applicationId?: string;
}
export interface FeatureCreateDrawerProps {
    open: boolean;
    onClose: () => void;
    onSubmit: (data: FeatureCreatePayload) => void;
    repositoryPath: string;
    isSubmitting?: boolean;
    workflowDefaults?: WorkflowDefaults;
    /** List of existing features available for selection as a parent. */
    features?: ParentFeatureOption[];
    /** List of tracked repositories for selection when repo context is missing. */
    repositories?: RepositoryOption[];
    /** Pre-select a parent feature when the drawer opens (e.g. from (+) button on a feature node). */
    initialParentId?: string;
    /** Current global agent type from settings */
    currentAgentType?: string;
    /** Current global model from settings */
    currentModel?: string;
    /** Pre-fill the description textarea (e.g. from session context) */
    initialDescription?: string;
    /** When true, user has push access — Fork & PR toggle will be hidden. */
    canPushDirectly?: boolean;
    /**
     * Pre-select a build mode (e.g. when the drawer is opened from a UI that
     * already chose one — apps page "fast" / "spec" buttons, FAB-with-mode).
     * When omitted, falls back to workflowDefaults.fast (true → 'fast', false →
     * 'spec'); fully omitted defaults select 'fast'.
     *
     * App-scoped invocations (`initialApplicationId` set) seed the picker with
     * `Spec` by default but the mode remains user-editable, so launching a
     * feature against an application behaves like launching one against a
     * regular repository — the user can switch to Fast in one click.
     */
    initialMode?: BuildMode;
    /**
     * Application context for the drawer. When set:
     * - the repository selector is rendered as a locked read-only label (the
     *   app determines the repo, so the user cannot pick a different one)
     * - the mode picker stays editable; it just defaults to `Spec` so the SDD
     *   intent is the easy path while the user can still pick `Fast`
     * - all other fields (description, attachments, advanced toggles) remain
     *   editable
     *
     * Used by entry points launched from an Application (app card "+" button,
     * FAB context-aware action, app top-bar "Open in Control Center") so the
     * created feature is correctly scoped to the application without forcing
     * the user into a single mode.
     */
    initialApplicationId?: string;
}
export declare function FeatureCreateDrawer({ open, onClose, onSubmit, repositoryPath, isSubmitting, workflowDefaults, features, repositories, initialParentId, currentAgentType, currentModel, initialDescription, canPushDirectly, initialMode, initialApplicationId, }: FeatureCreateDrawerProps): import("react/jsx-runtime").JSX.Element;
export interface RepositoryComboboxProps {
    repositories: RepositoryOption[];
    value: string | undefined;
    onChange: (path: string | undefined) => void;
    onAddRepository?: (repo: RepositoryOption) => void;
    disabled?: boolean;
}
export declare function RepositoryCombobox({ repositories, value, onChange, onAddRepository, disabled, }: RepositoryComboboxProps): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=feature-create-drawer.d.ts.map