@waterwx/dsh-novel-forge 1.3.3 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.ts CHANGED
@@ -48,6 +48,8 @@ export interface Config {
48
48
  model?: string
49
49
  /** LLM reasoning effort (off/low/high/max). */
50
50
  reasoningEffort?: 'off' | 'low' | 'high' | 'max'
51
+ /** 分析类任务(提炼/拆书/反推大纲等)的推理档位;默认 low。 */
52
+ analysisReasoning?: 'off' | 'low' | 'high' | 'max'
51
53
  /** Target characters per chapter. */
52
54
  chapterChars?: number
53
55
  /** Max output tokens per chapter call. */
@@ -76,6 +78,7 @@ export const Config: z<Config> = z.object({
76
78
  provider: z.string().default('deepseek-official'),
77
79
  model: z.string().default('deepseek-v4-flash'),
78
80
  reasoningEffort: z.union(['off', 'low', 'high', 'max']).default('off'),
81
+ analysisReasoning: z.union(['off', 'low', 'high', 'max']).default('low'),
79
82
  chapterChars: z.number().default(3500),
80
83
  maxTokens: z.number().default(12000),
81
84
  reviewPassScore: z.number().default(70),
@@ -94,6 +97,7 @@ const DEFAULT_OUTPUT_DIR = join(homedir(), '.dsh', 'novels')
94
97
  const DEFAULT_PROVIDER = 'deepseek-official'
95
98
  const DEFAULT_MODEL = 'deepseek-v4-flash'
96
99
  const DEFAULT_REASONING_EFFORT = 'off' as const
100
+ const DEFAULT_ANALYSIS_REASONING = 'low' as const
97
101
  const DEFAULT_CHAPTER_CHARS = 3500
98
102
  const DEFAULT_MAX_TOKENS = 12000
99
103
  const DEFAULT_REVIEW_PASS_SCORE = 70
@@ -115,6 +119,7 @@ export function resolveConfig(value: Partial<Config> | undefined): NovelConfig {
115
119
  provider: value?.provider ?? DEFAULT_PROVIDER,
116
120
  model: value?.model ?? DEFAULT_MODEL,
117
121
  reasoningEffort: value?.reasoningEffort ?? DEFAULT_REASONING_EFFORT,
122
+ analysisReasoning: value?.analysisReasoning ?? DEFAULT_ANALYSIS_REASONING,
118
123
  chapterChars: value?.chapterChars ?? DEFAULT_CHAPTER_CHARS,
119
124
  maxTokens: value?.maxTokens ?? DEFAULT_MAX_TOKENS,
120
125
  reviewPassScore: value?.reviewPassScore ?? DEFAULT_REVIEW_PASS_SCORE,
@@ -153,6 +158,7 @@ export function apply(ctx: Context, config?: Config): void {
153
158
  if (patch.provider !== undefined) next.provider = patch.provider
154
159
  if (patch.model !== undefined) next.model = patch.model
155
160
  if (patch.reasoningEffort !== undefined) next.reasoningEffort = patch.reasoningEffort
161
+ if (patch.analysisReasoning !== undefined) next.analysisReasoning = patch.analysisReasoning
156
162
  if (patch.chapterChars !== undefined) next.chapterChars = patch.chapterChars
157
163
  if (patch.maxTokens !== undefined) next.maxTokens = patch.maxTokens
158
164
  if (patch.reviewPassScore !== undefined) next.reviewPassScore = patch.reviewPassScore