All files / modules/book-generator/strategies types.ts

0% Statements 0/0
0% Branches 1/1
0% Functions 1/1
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30                                                           
/**
 * 生成策略接口和类型定义
 */
 
/** 策略名称 */
export type StrategyName = 'sequential' | 'one-step-outline' | 'per-chapter' | 'deep-plan-parallel';
 
/** 生成策略接口 */
export interface GenerationStrategy {
  /** 策略唯一标识 */
  readonly name: StrategyName;
  /** 策略描述 */
  readonly description: string;
  /**
   * 执行书籍生成
   * @param bookId   书籍 ID
   * @param topic    主题/描述
   * @param bookScale 书籍规模 key
   * @param genLevel  大纲层级(已解析后的数值)
   * @param userSpecifiedGenLevel 用户明确指定的大纲层级(undefined=自动/AI决定)
   */
  generate(bookId: string, topic: string, bookScale: string, genLevel: number, userSpecifiedGenLevel?: number): Promise<void>;
}
 
/** 策略配置 */
export interface StrategyConfig {
  /** 当前激活的策略 */
  current: StrategyName;
}