import { Result } from 'neverthrow';
/**
 * Sample Term Model Implementation
 *
 * This demonstrates the Term Model pattern for Domain-Driven Design:
 * - Domain vocabulary as executable code
 * - Smart constructors with validation
 * - Immutable value objects and operations
 * - Business rule enforcement
 * - Type-safe domain modeling
 */
/**
 * Term types in this domain:
 * - operation: Business procedures and workflows
 * - resource: Business resources and entities
 * - policy: Business policies and rules
 * - value: Value objects and identifiers
 */
/**
 * 語彙「WorkPlanId」
 * domain type: value
 */
type WorkPlanId = string & {
    readonly _brand: 'WorkPlanId';
};
declare const WorkPlanId: {
    readonly generate: () => WorkPlanId;
    readonly fromString: (value: string) => Result<WorkPlanId, ValidationError>;
    readonly toString: (id: WorkPlanId) => string;
};
/**
 * 語彙「TaskId」
 * domain type: value
 */
type TaskId = string & {
    readonly _brand: 'TaskId';
};
declare const TaskId: {
    readonly generate: () => TaskId;
    readonly fromString: (value: string) => Result<TaskId, ValidationError>;
    readonly toString: (id: TaskId) => string;
};
/**
 * 語彙「TaskStatus」
 * domain type: value
 */
type TaskStatus = {
    type: 'ToBeRefined';
} | {
    type: 'Refined';
} | {
    type: 'Implemented';
} | {
    type: 'Reviewed';
} | {
    type: 'Merged';
} | {
    type: 'Blocked';
    reason: string;
} | {
    type: 'Abandoned';
    reason: string;
};
declare const TaskStatus: {
    readonly toBeRefined: () => TaskStatus;
    readonly refined: () => TaskStatus;
    readonly implemented: () => TaskStatus;
    readonly reviewed: () => TaskStatus;
    readonly merged: () => TaskStatus;
    readonly blocked: (reason: string) => TaskStatus;
    readonly abandoned: (reason: string) => TaskStatus;
    readonly canTransition: (current: TaskStatus, next: TaskStatus) => boolean;
    readonly toString: (status: TaskStatus) => string;
};
/**
 * 語彙「AcceptanceCriterion」
 * domain type: value
 */
type AcceptanceCriterion = {
    readonly scenario: string;
    readonly given: readonly string[];
    readonly when: readonly string[];
    readonly then: readonly string[];
};
type RequestedAcceptanceCriterion = {
    readonly scenario: string;
    readonly given: readonly string[];
    readonly when: readonly string[];
    readonly then: readonly string[];
};
declare const AcceptanceCriterion: {
    readonly create: (params: RequestedAcceptanceCriterion) => Result<AcceptanceCriterion, ValidationError[]>;
};
/**
 * 語彙「Task」
 * domain type: operation
 */
type Task = {
    readonly id: TaskId;
    readonly title: string;
    readonly description: string;
    readonly branch: string;
    readonly worktree: string;
    readonly status: TaskStatus;
    readonly dependencies: TaskId[];
    readonly acceptanceCriteria: readonly AcceptanceCriterion[];
    readonly definitionOfReady: readonly string[];
    readonly assignedWorktree?: string;
};
type RequestedTask = {
    id: string;
    title: string;
    description: string;
    dependencies?: TaskId[];
    acceptanceCriteria: RequestedAcceptanceCriterion[];
    definitionOfReady: readonly string[];
};
type TaskError = {
    type: 'InvalidTitle' | 'InvalidDescription' | 'InvalidId' | 'InvalidStatusTransition' | 'TaskCreationFailed' | 'AcceptanceCriteriaCreationFailed' | 'DefinitionOfReadyValidationFailed' | 'InvalidWorktreeName';
    message: string;
};
type ValidationError = {
    type: 'InvalidFormat' | 'RequiredField' | 'BusinessRule';
    message: string;
};
type ConstructTask = (params: RequestedTask) => Result<Task, TaskError[]>;
type UpdateTaskStatus = (task: Task, newStatus: TaskStatus) => Result<Task, TaskError[]>;
type AssignWorktree = (task: Task, worktreeName: string) => Result<Task, TaskError[]>;
/**
 * 語彙「WorkPlan」
 * domain type: operation
 */
type WorkPlan = {
    readonly id: WorkPlanId;
    readonly name: string;
    readonly featureBranch: string;
    readonly originWorktreePath: string;
    readonly evolvingPRDPath: string;
    readonly evolvingDesignDocPath: string;
    readonly description?: string;
    readonly tasks: readonly Task[];
    readonly createdAt: Date;
    readonly updatedAt: Date;
};
type RequestedWorkPlan = {
    name: string;
    featureBranch: string;
    originWorktreePath: string;
    evolvingPRDPath: string;
    evolvingDesignDocPath: string;
    description?: string;
    tasks: Array<{
        id: string;
        title: string;
        description: string;
        dependencies?: TaskId[];
        acceptanceCriteria: RequestedAcceptanceCriterion[];
        definitionOfReady: readonly string[];
    }>;
};
type WorkPlanError = {
    type: 'InvalidName' | 'NoTask' | 'DependencyNotFound' | 'TaskCreationFailed';
    message: string;
};
type ConstructWorkPlan = (params: RequestedWorkPlan) => Result<WorkPlan, WorkPlanError[]>;
declare const TaskError: {
    readonly create: (type: TaskError["type"], message: string) => TaskError;
};
declare const WorkPlanError: {
    readonly create: (type: WorkPlanError["type"], message: string) => WorkPlanError;
};
/**
 * Task Term Model
 */
export declare const TaskModel: {
    readonly create: ConstructTask;
    readonly updateStatus: UpdateTaskStatus;
    readonly assignWorktree: AssignWorktree;
};
/**
 * WorkPlan Term Model
 */
export declare const WorkPlanModel: {
    readonly create: ConstructWorkPlan;
};
/**
 * Value Object Constructors
 */
export declare const Values: {
    readonly WorkPlanId: {
        readonly generate: () => WorkPlanId;
        readonly fromString: (value: string) => Result<WorkPlanId, ValidationError>;
        readonly toString: (id: WorkPlanId) => string;
    };
    readonly TaskId: {
        readonly generate: () => TaskId;
        readonly fromString: (value: string) => Result<TaskId, ValidationError>;
        readonly toString: (id: TaskId) => string;
    };
    readonly TaskStatus: {
        readonly toBeRefined: () => TaskStatus;
        readonly refined: () => TaskStatus;
        readonly implemented: () => TaskStatus;
        readonly reviewed: () => TaskStatus;
        readonly merged: () => TaskStatus;
        readonly blocked: (reason: string) => TaskStatus;
        readonly abandoned: (reason: string) => TaskStatus;
        readonly canTransition: (current: TaskStatus, next: TaskStatus) => boolean;
        readonly toString: (status: TaskStatus) => string;
    };
    readonly AcceptanceCriterion: {
        readonly create: (params: RequestedAcceptanceCriterion) => Result<AcceptanceCriterion, ValidationError[]>;
    };
};
/**
 * Type Exports for External Use
 */
export type { WorkPlan, RequestedWorkPlan, Task, RequestedTask, TaskStatus, AcceptanceCriterion, WorkPlanId, TaskId, WorkPlanError, TaskError, ValidationError };
//# sourceMappingURL=term-model-example.d.ts.map