fix(web): show the plugin settings a user actually gets
Three things the page got wrong. The web-search provider's defaults lived only at their use site, so the served section carried no value for them and the card fell back to a zero it invented — a number the schema itself rejects. Declaring them on the schema makes the settings service the one authority: `maxUses` now reads 5 because that is what the Host resolves, not because the page guessed. `baseURL` keeps its code-side default, which exists so `$DEEPSEEK_SEARCH_BASE_URL` can win. A field the Host serves no value for now renders empty rather than as zero. The cards were rows in a settings page of cards: name and description ran together on one line because the shared disclosure row lays them side by side. Each card now draws its own header, stacking the two, and the section follows the idiom the Agent Preset page established.
This commit is contained in:
@@ -63,11 +63,14 @@ export interface Config {
|
||||
export const Config: z<Config> = z.object({
|
||||
apiKey: z.string().role('secret'),
|
||||
apiKeyEnv: z.string().role('credential-ref').default(DEFAULT_API_KEY_ENV),
|
||||
// Declared here rather than only at the use site: a configuration surface
|
||||
// renders the resolved section, so a default the schema does not carry reads
|
||||
// there as no value at all.
|
||||
baseURL: z.string(),
|
||||
model: z.string(),
|
||||
apiVersion: z.string(),
|
||||
maxTokens: z.number().step(1).min(1),
|
||||
maxUses: z.number().step(1).min(1),
|
||||
model: z.string().default(DEEPSEEK_DEFAULT_MODEL),
|
||||
apiVersion: z.string().default(DEEPSEEK_DEFAULT_API_VERSION),
|
||||
maxTokens: z.number().step(1).min(1).default(DEEPSEEK_DEFAULT_MAX_TOKENS),
|
||||
maxUses: z.number().step(1).min(1).default(DEEPSEEK_DEFAULT_MAX_USES),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user