dsh-layered-memory 0.8.7 → 0.8.9

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/dist/config.d.ts CHANGED
@@ -4,6 +4,7 @@
4
4
  * 默认数据目录:$DSH_HOME/memory(用官方 dshHomePath 解析,DSH_HOME 缺省 ~/.dsh)。
5
5
  */
6
6
  import Schema from '@deepseek-ai/schemastery';
7
+ import type { LayerRouteKey, StaticFallbackEntry } from './contract.js';
7
8
  import type { ExtractMode } from './types.js';
8
9
  /**
9
10
  * 蒸馏思考档位全词汇表(唯一事实源):'' = 自动(模型默认档 → high),
@@ -96,10 +97,27 @@ export interface MemoryConfig {
96
97
  provider: string;
97
98
  /** 蒸馏用的模型;留空用当前默认选择。 */
98
99
  model: string;
100
+ /** 回退链(#31):主路由失败(报错/掐断/网络异常/空输出)后按序降级的备用路由,
101
+ * 条目顺序即优先级。与主路由完全相同的条目自动跳过;provider/model 缺失的条目剔除;
102
+ * 条目 reasoningEffort 非空时覆盖全局档位(未配置运行时链 distillChain 时,
103
+ * 旧档位键 reasoningEffort 的整体接管——含给条目盖章——仍对存量值生效);
104
+ * 空数组(缺省)= 单路由行为不变。 */
105
+ fallbacks?: StaticFallbackEntry[];
106
+ /** 按层静态路由链(#34):层键 l1/l2/l3 各一条完整链(条目形状同 fallbacks;
107
+ * 头行必须 provider+model 双显式)。非空即完整替换该层解析(该层主路由与回退都
108
+ * 归层链管,全局链对该层不参与);空/缺省 = 该层跟随全局解析。被运行时层链
109
+ * (设置页 distillLayerChains)压过;pin 不废静态层链(同为部署配置,同回退链先例)。 */
110
+ layerRoutes?: Partial<Record<LayerRouteKey, StaticFallbackEntry[]>>;
111
+ /** 运行时层链(effectiveCfg 从设置页 distillLayerChains 注入,层内第一优先级);
112
+ * 非静态 schema——与 primaryEffort/budgets 同类:运行时偏好,无部署上限语义。 */
113
+ layerChainsRuntime?: Partial<Record<LayerRouteKey, StaticFallbackEntry[]>>;
99
114
  /** 单次蒸馏调用的输出 token 上限(推理模型的 reasoning 与正文共享该预算)。 */
100
115
  maxTokens: number;
101
116
  /** 蒸馏调用的思考档位;空串不传(跟随模型默认)。 */
102
117
  reasoningEffort: string;
118
+ /** 运行时主路由显式档位(distillChain[0].reasoningEffort 经 effectiveCfg 注入);
119
+ * 非静态 schema——'' = 跟随全局静态 reasoningEffort,仅供链模式传递主路由档位。 */
120
+ primaryEffort?: string;
103
121
  temperature: number;
104
122
  /** 单次蒸馏调用的用户 prompt 字符预算(≈token 数,按中文 1 字≈1 token 保守估算)。 */
105
123
  maxInputChars: number;
@@ -175,7 +193,7 @@ export declare const memorySchema: Schema<Schemastery.ObjectS<{
175
193
  timeoutMs: Schema<number, number>;
176
194
  includePersona: Schema<boolean, boolean>;
177
195
  includeSceneNav: Schema<boolean, boolean>;
178
- strategy: Schema<"keyword" | "embedding" | "hybrid", "keyword" | "embedding" | "hybrid">;
196
+ strategy: Schema<"hybrid" | "keyword" | "embedding", "hybrid" | "keyword" | "embedding">;
179
197
  scoreThreshold: Schema<number, number>;
180
198
  decayHalfLifeDays: Schema<number, number>;
181
199
  }>, Schemastery.ObjectT<{
@@ -186,7 +204,7 @@ export declare const memorySchema: Schema<Schemastery.ObjectS<{
186
204
  timeoutMs: Schema<number, number>;
187
205
  includePersona: Schema<boolean, boolean>;
188
206
  includeSceneNav: Schema<boolean, boolean>;
189
- strategy: Schema<"keyword" | "embedding" | "hybrid", "keyword" | "embedding" | "hybrid">;
207
+ strategy: Schema<"hybrid" | "keyword" | "embedding", "hybrid" | "keyword" | "embedding">;
190
208
  scoreThreshold: Schema<number, number>;
191
209
  decayHalfLifeDays: Schema<number, number>;
192
210
  }>>;
@@ -216,6 +234,72 @@ export declare const memorySchema: Schema<Schemastery.ObjectS<{
216
234
  llm: Schema<Schemastery.ObjectS<{
217
235
  provider: Schema<string, string>;
218
236
  model: Schema<string, string>;
237
+ fallbacks: Schema<({
238
+ provider?: string | null | undefined;
239
+ model?: string | null | undefined;
240
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
241
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
242
+ provider: Schema<string, string>;
243
+ model: Schema<string, string>;
244
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
245
+ }>[]>;
246
+ layerRoutes: Schema<Schemastery.ObjectS<{
247
+ l1: Schema<({
248
+ provider?: string | null | undefined;
249
+ model?: string | null | undefined;
250
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
251
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
252
+ provider: Schema<string, string>;
253
+ model: Schema<string, string>;
254
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
255
+ }>[]>;
256
+ l2: Schema<({
257
+ provider?: string | null | undefined;
258
+ model?: string | null | undefined;
259
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
260
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
261
+ provider: Schema<string, string>;
262
+ model: Schema<string, string>;
263
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
264
+ }>[]>;
265
+ l3: Schema<({
266
+ provider?: string | null | undefined;
267
+ model?: string | null | undefined;
268
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
269
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
270
+ provider: Schema<string, string>;
271
+ model: Schema<string, string>;
272
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
273
+ }>[]>;
274
+ }>, Schemastery.ObjectT<{
275
+ l1: Schema<({
276
+ provider?: string | null | undefined;
277
+ model?: string | null | undefined;
278
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
279
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
280
+ provider: Schema<string, string>;
281
+ model: Schema<string, string>;
282
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
283
+ }>[]>;
284
+ l2: Schema<({
285
+ provider?: string | null | undefined;
286
+ model?: string | null | undefined;
287
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
288
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
289
+ provider: Schema<string, string>;
290
+ model: Schema<string, string>;
291
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
292
+ }>[]>;
293
+ l3: Schema<({
294
+ provider?: string | null | undefined;
295
+ model?: string | null | undefined;
296
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
297
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
298
+ provider: Schema<string, string>;
299
+ model: Schema<string, string>;
300
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
301
+ }>[]>;
302
+ }>>;
219
303
  maxTokens: Schema<number, number>;
220
304
  reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
221
305
  temperature: Schema<number, number>;
@@ -224,6 +308,72 @@ export declare const memorySchema: Schema<Schemastery.ObjectS<{
224
308
  }>, Schemastery.ObjectT<{
225
309
  provider: Schema<string, string>;
226
310
  model: Schema<string, string>;
311
+ fallbacks: Schema<({
312
+ provider?: string | null | undefined;
313
+ model?: string | null | undefined;
314
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
315
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
316
+ provider: Schema<string, string>;
317
+ model: Schema<string, string>;
318
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
319
+ }>[]>;
320
+ layerRoutes: Schema<Schemastery.ObjectS<{
321
+ l1: Schema<({
322
+ provider?: string | null | undefined;
323
+ model?: string | null | undefined;
324
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
325
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
326
+ provider: Schema<string, string>;
327
+ model: Schema<string, string>;
328
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
329
+ }>[]>;
330
+ l2: Schema<({
331
+ provider?: string | null | undefined;
332
+ model?: string | null | undefined;
333
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
334
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
335
+ provider: Schema<string, string>;
336
+ model: Schema<string, string>;
337
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
338
+ }>[]>;
339
+ l3: Schema<({
340
+ provider?: string | null | undefined;
341
+ model?: string | null | undefined;
342
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
343
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
344
+ provider: Schema<string, string>;
345
+ model: Schema<string, string>;
346
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
347
+ }>[]>;
348
+ }>, Schemastery.ObjectT<{
349
+ l1: Schema<({
350
+ provider?: string | null | undefined;
351
+ model?: string | null | undefined;
352
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
353
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
354
+ provider: Schema<string, string>;
355
+ model: Schema<string, string>;
356
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
357
+ }>[]>;
358
+ l2: Schema<({
359
+ provider?: string | null | undefined;
360
+ model?: string | null | undefined;
361
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
362
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
363
+ provider: Schema<string, string>;
364
+ model: Schema<string, string>;
365
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
366
+ }>[]>;
367
+ l3: Schema<({
368
+ provider?: string | null | undefined;
369
+ model?: string | null | undefined;
370
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
371
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
372
+ provider: Schema<string, string>;
373
+ model: Schema<string, string>;
374
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
375
+ }>[]>;
376
+ }>>;
227
377
  maxTokens: Schema<number, number>;
228
378
  reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
229
379
  temperature: Schema<number, number>;
@@ -288,7 +438,7 @@ export declare const memorySchema: Schema<Schemastery.ObjectS<{
288
438
  timeoutMs: Schema<number, number>;
289
439
  includePersona: Schema<boolean, boolean>;
290
440
  includeSceneNav: Schema<boolean, boolean>;
291
- strategy: Schema<"keyword" | "embedding" | "hybrid", "keyword" | "embedding" | "hybrid">;
441
+ strategy: Schema<"hybrid" | "keyword" | "embedding", "hybrid" | "keyword" | "embedding">;
292
442
  scoreThreshold: Schema<number, number>;
293
443
  decayHalfLifeDays: Schema<number, number>;
294
444
  }>, Schemastery.ObjectT<{
@@ -299,7 +449,7 @@ export declare const memorySchema: Schema<Schemastery.ObjectS<{
299
449
  timeoutMs: Schema<number, number>;
300
450
  includePersona: Schema<boolean, boolean>;
301
451
  includeSceneNav: Schema<boolean, boolean>;
302
- strategy: Schema<"keyword" | "embedding" | "hybrid", "keyword" | "embedding" | "hybrid">;
452
+ strategy: Schema<"hybrid" | "keyword" | "embedding", "hybrid" | "keyword" | "embedding">;
303
453
  scoreThreshold: Schema<number, number>;
304
454
  decayHalfLifeDays: Schema<number, number>;
305
455
  }>>;
@@ -329,6 +479,72 @@ export declare const memorySchema: Schema<Schemastery.ObjectS<{
329
479
  llm: Schema<Schemastery.ObjectS<{
330
480
  provider: Schema<string, string>;
331
481
  model: Schema<string, string>;
482
+ fallbacks: Schema<({
483
+ provider?: string | null | undefined;
484
+ model?: string | null | undefined;
485
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
486
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
487
+ provider: Schema<string, string>;
488
+ model: Schema<string, string>;
489
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
490
+ }>[]>;
491
+ layerRoutes: Schema<Schemastery.ObjectS<{
492
+ l1: Schema<({
493
+ provider?: string | null | undefined;
494
+ model?: string | null | undefined;
495
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
496
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
497
+ provider: Schema<string, string>;
498
+ model: Schema<string, string>;
499
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
500
+ }>[]>;
501
+ l2: Schema<({
502
+ provider?: string | null | undefined;
503
+ model?: string | null | undefined;
504
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
505
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
506
+ provider: Schema<string, string>;
507
+ model: Schema<string, string>;
508
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
509
+ }>[]>;
510
+ l3: Schema<({
511
+ provider?: string | null | undefined;
512
+ model?: string | null | undefined;
513
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
514
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
515
+ provider: Schema<string, string>;
516
+ model: Schema<string, string>;
517
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
518
+ }>[]>;
519
+ }>, Schemastery.ObjectT<{
520
+ l1: Schema<({
521
+ provider?: string | null | undefined;
522
+ model?: string | null | undefined;
523
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
524
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
525
+ provider: Schema<string, string>;
526
+ model: Schema<string, string>;
527
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
528
+ }>[]>;
529
+ l2: Schema<({
530
+ provider?: string | null | undefined;
531
+ model?: string | null | undefined;
532
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
533
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
534
+ provider: Schema<string, string>;
535
+ model: Schema<string, string>;
536
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
537
+ }>[]>;
538
+ l3: Schema<({
539
+ provider?: string | null | undefined;
540
+ model?: string | null | undefined;
541
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
542
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
543
+ provider: Schema<string, string>;
544
+ model: Schema<string, string>;
545
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
546
+ }>[]>;
547
+ }>>;
332
548
  maxTokens: Schema<number, number>;
333
549
  reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
334
550
  temperature: Schema<number, number>;
@@ -337,6 +553,72 @@ export declare const memorySchema: Schema<Schemastery.ObjectS<{
337
553
  }>, Schemastery.ObjectT<{
338
554
  provider: Schema<string, string>;
339
555
  model: Schema<string, string>;
556
+ fallbacks: Schema<({
557
+ provider?: string | null | undefined;
558
+ model?: string | null | undefined;
559
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
560
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
561
+ provider: Schema<string, string>;
562
+ model: Schema<string, string>;
563
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
564
+ }>[]>;
565
+ layerRoutes: Schema<Schemastery.ObjectS<{
566
+ l1: Schema<({
567
+ provider?: string | null | undefined;
568
+ model?: string | null | undefined;
569
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
570
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
571
+ provider: Schema<string, string>;
572
+ model: Schema<string, string>;
573
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
574
+ }>[]>;
575
+ l2: Schema<({
576
+ provider?: string | null | undefined;
577
+ model?: string | null | undefined;
578
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
579
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
580
+ provider: Schema<string, string>;
581
+ model: Schema<string, string>;
582
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
583
+ }>[]>;
584
+ l3: Schema<({
585
+ provider?: string | null | undefined;
586
+ model?: string | null | undefined;
587
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
588
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
589
+ provider: Schema<string, string>;
590
+ model: Schema<string, string>;
591
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
592
+ }>[]>;
593
+ }>, Schemastery.ObjectT<{
594
+ l1: Schema<({
595
+ provider?: string | null | undefined;
596
+ model?: string | null | undefined;
597
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
598
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
599
+ provider: Schema<string, string>;
600
+ model: Schema<string, string>;
601
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
602
+ }>[]>;
603
+ l2: Schema<({
604
+ provider?: string | null | undefined;
605
+ model?: string | null | undefined;
606
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
607
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
608
+ provider: Schema<string, string>;
609
+ model: Schema<string, string>;
610
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
611
+ }>[]>;
612
+ l3: Schema<({
613
+ provider?: string | null | undefined;
614
+ model?: string | null | undefined;
615
+ reasoningEffort?: "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
616
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<{
617
+ provider: Schema<string, string>;
618
+ model: Schema<string, string>;
619
+ reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
620
+ }>[]>;
621
+ }>>;
340
622
  maxTokens: Schema<number, number>;
341
623
  reasoningEffort: Schema<"" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", "" | "off" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max">;
342
624
  temperature: Schema<number, number>;
package/dist/config.js CHANGED
@@ -11,6 +11,7 @@ import { dshHomePath } from '@deepseek-ai/dsh-home-paths';
11
11
  * schema(config/settings)、运行时解析(settings.resolveSettings)与 RPC
12
12
  * 写入门(stats.settings-set)共用,勿在别处再抄字面量表。
13
13
  */
14
+ // satisfies 反向锁定:词汇表扩词必须同步契约的 EffortChoice 联合(host 与 TS 化的 client 共用)
14
15
  export const EFFORT_CHOICES = ['', 'off', 'none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];
15
16
  export const memorySchema = Schema.object({
16
17
  dataDir: Schema.string().default(''),
@@ -68,6 +69,32 @@ export const memorySchema = Schema.object({
68
69
  llm: Schema.object({
69
70
  provider: Schema.string().default(''),
70
71
  model: Schema.string().default(''),
72
+ // 回退链(#31):主路由失败后按序降级;每条路由各享全额 timeoutMs(慢 TTFT 模型的
73
+ // 回退位正是要给它留足首包时间,共享预算会让回退链失效);条目档位经能力钳制后发送
74
+ fallbacks: Schema.array(Schema.object({
75
+ provider: Schema.string().default(''),
76
+ model: Schema.string().default(''),
77
+ reasoningEffort: Schema.union([...EFFORT_CHOICES]).default(''),
78
+ })).default([]),
79
+ // 按层静态路由链(#34):每层一条完整链(头行须双显式——启动侧只做形状默认,
80
+ // 语义校验(头行/去重/上限)在解析侧防御 + 设置页写入门;空数组 = 该层跟随全局)
81
+ layerRoutes: Schema.object({
82
+ l1: Schema.array(Schema.object({
83
+ provider: Schema.string().default(''),
84
+ model: Schema.string().default(''),
85
+ reasoningEffort: Schema.union([...EFFORT_CHOICES]).default(''),
86
+ })).default([]),
87
+ l2: Schema.array(Schema.object({
88
+ provider: Schema.string().default(''),
89
+ model: Schema.string().default(''),
90
+ reasoningEffort: Schema.union([...EFFORT_CHOICES]).default(''),
91
+ })).default([]),
92
+ l3: Schema.array(Schema.object({
93
+ provider: Schema.string().default(''),
94
+ model: Schema.string().default(''),
95
+ reasoningEffort: Schema.union([...EFFORT_CHOICES]).default(''),
96
+ })).default([]),
97
+ }).default({ l1: [], l2: [], l3: [] }),
71
98
  // 推理模型(如 v4-flash)的 reasoning 计入输出预算:预算不足会被思考吃光导致正文 0 字符。
72
99
  // 0.8.0 起各蒸馏层显式传分层预算(见 llm.ts LAYER_MAX_TOKENS_*),本值为未分层调用的兜底总闸
73
100
  maxTokens: Schema.number().min(1024).max(1_000_000).default(65_536),