更新 src/config.ts
This commit is contained in:
parent
22c43a5517
commit
13344e2bbf
|
|
@ -13,6 +13,8 @@ export const DEFAULT_SETTINGS: Settings = {
|
||||||
defaultK: 10,
|
defaultK: 10,
|
||||||
summaryEnabled: true,
|
summaryEnabled: true,
|
||||||
summaryMaxChars: 6000,
|
summaryMaxChars: 6000,
|
||||||
|
skillsSyncEnabled: true,
|
||||||
|
skillsDir: '',
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Effective, fully-resolved settings. */
|
/** Effective, fully-resolved settings. */
|
||||||
|
|
@ -31,6 +33,10 @@ export interface Settings {
|
||||||
summaryEnabled: boolean
|
summaryEnabled: boolean
|
||||||
/** Maximum transcript characters sent for one summary (privacy/cost cap). */
|
/** Maximum transcript characters sent for one summary (privacy/cost cap). */
|
||||||
summaryMaxChars: number
|
summaryMaxChars: number
|
||||||
|
/** Bidirectional skill sync between the cloud skill center and the local skills directory. */
|
||||||
|
skillsSyncEnabled: boolean
|
||||||
|
/** Local skills directory override; empty means `$DSH_HOME/skills`. */
|
||||||
|
skillsDir: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Raw row config as it comes out of the cordis loader. */
|
/** Raw row config as it comes out of the cordis loader. */
|
||||||
|
|
@ -85,5 +91,7 @@ export function settingsFromConfig(raw: unknown): Partial<Settings> {
|
||||||
if (typeof source.summaryEnabled === 'boolean') result.summaryEnabled = source.summaryEnabled
|
if (typeof source.summaryEnabled === 'boolean') result.summaryEnabled = source.summaryEnabled
|
||||||
const summaryMaxChars = boundedInt(source.summaryMaxChars, 1000, 16_000)
|
const summaryMaxChars = boundedInt(source.summaryMaxChars, 1000, 16_000)
|
||||||
if (summaryMaxChars !== undefined) result.summaryMaxChars = summaryMaxChars
|
if (summaryMaxChars !== undefined) result.summaryMaxChars = summaryMaxChars
|
||||||
|
if (typeof source.skillsSyncEnabled === 'boolean') result.skillsSyncEnabled = source.skillsSyncEnabled
|
||||||
|
if (typeof source.skillsDir === 'string') result.skillsDir = source.skillsDir.trim().slice(0, 512)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue