[nexus] feat(20-01): expand HermesLocalConfigFields with model, toolsets, persistSession, timeoutSec

- Add Model field (both create + edit modes) using CreateConfigValues.model
- Add Toolsets field (both create + edit modes) using extraArgs in create, adapterConfig.toolsets in edit
- Add Persist Session checkbox (edit mode only) wired to adapterConfig.persistSession
- Add Timeout (seconds) field (edit mode only) wired to adapterConfig.timeoutSec
- Restructure component to use fragment with conditional hideInstructionsFile guard
- TypeScript compiles cleanly
This commit is contained in:
Mikkel Georgsen 2026-04-01 12:00:30 +02:00 committed by Nexus Dev
parent ab2e1d1ce3
commit cef656264e

View file

@ -19,31 +19,110 @@ export function HermesLocalConfigFields({
mark, mark,
hideInstructionsFile, hideInstructionsFile,
}: AdapterConfigFieldsProps) { }: AdapterConfigFieldsProps) {
if (hideInstructionsFile) return null;
return ( return (
<Field label="Agent instructions file" hint={instructionsFileHint}> <>
<div className="flex items-center gap-2"> {!hideInstructionsFile && (
<Field label="Agent instructions file" hint={instructionsFileHint}>
<div className="flex items-center gap-2">
<DraftInput
value={
isCreate
? values!.instructionsFilePath ?? ""
: eff(
"adapterConfig",
"instructionsFilePath",
String(config.instructionsFilePath ?? ""),
)
}
onCommit={(v) =>
isCreate
? set!({ instructionsFilePath: v })
: mark("adapterConfig", "instructionsFilePath", v || undefined)
}
immediate
className={inputClass}
placeholder="/absolute/path/to/AGENTS.md"
/>
<ChoosePathButton />
</div>
</Field>
)}
<Field
label="Model"
hint="Provider/model format (e.g. anthropic/claude-sonnet-4). Leave blank to use Hermes default."
>
<DraftInput <DraftInput
value={ value={
isCreate isCreate
? values!.instructionsFilePath ?? "" ? values!.model ?? ""
: eff( : eff("adapterConfig", "model", String(config.model ?? ""))
"adapterConfig",
"instructionsFilePath",
String(config.instructionsFilePath ?? ""),
)
} }
onCommit={(v) => onCommit={(v) =>
isCreate isCreate
? set!({ instructionsFilePath: v }) ? set!({ model: v })
: mark("adapterConfig", "instructionsFilePath", v || undefined) : mark("adapterConfig", "model", v || undefined)
} }
immediate immediate
className={inputClass} className={inputClass}
placeholder="/absolute/path/to/AGENTS.md" placeholder="anthropic/claude-sonnet-4"
/> />
<ChoosePathButton /> </Field>
</div> <Field
</Field> label="Toolsets"
hint="Comma-separated toolset names (e.g. terminal,file,web). Leave blank for defaults."
>
<DraftInput
value={
isCreate
? values!.extraArgs ?? ""
: eff("adapterConfig", "toolsets", String(config.toolsets ?? ""))
}
onCommit={(v) =>
isCreate
? set!({ extraArgs: v })
: mark("adapterConfig", "toolsets", v || undefined)
}
immediate
className={inputClass}
placeholder="terminal,file,web"
/>
</Field>
{!isCreate && (
<>
<Field
label="Persist session"
hint="Keep conversation history between heartbeat runs."
>
<label className="flex items-center gap-2 cursor-pointer">
<input
type="checkbox"
className="h-4 w-4 rounded border-border accent-primary"
checked={eff("adapterConfig", "persistSession", config.persistSession !== false)}
onChange={(e) =>
mark("adapterConfig", "persistSession", e.target.checked)
}
/>
<span className="text-sm text-muted-foreground">Enabled</span>
</label>
</Field>
<Field
label="Timeout (seconds)"
hint="Maximum execution time per heartbeat run."
>
<DraftInput
value={String(
eff("adapterConfig", "timeoutSec", Number(config.timeoutSec ?? 300)),
)}
onCommit={(v) =>
mark("adapterConfig", "timeoutSec", Number(v) || 300)
}
immediate
className={inputClass}
placeholder="300"
/>
</Field>
</>
)}
</>
); );
} }