feat(contracts): add Hermes provider settings schema
Mirrors GrokSettings exactly: enabled off by default, binaryPath falling back to "hermes", and a hidden customModels list. Wires HermesSettings/HermesSettingsPatch into ServerSettings and ServerSettingsPatch alongside the other legacy per-driver settings. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
2 files changed
+51
No files matched your search
@@ -8,6 +8,7 @@ import {
|
||||
ClaudeSettings,
|
||||
DEFAULT_SERVER_SETTINGS,
|
||||
defaultEnabledForDriver,
|
||||
HermesSettings,
|
||||
resolveProviderInstanceEnabled,
|
||||
ServerSettings,
|
||||
ServerSettingsPatch,
|
||||
@@ -20,6 +21,7 @@ const decodeServerSettings = Schema.decodeUnknownSync(ServerSettings);
|
||||
const decodeServerSettingsPatch = Schema.decodeUnknownSync(ServerSettingsPatch);
|
||||
const encodeServerSettings = Schema.encodeSync(ServerSettings);
|
||||
const decodeClaudeSettings = Schema.decodeUnknownSync(ClaudeSettings);
|
||||
const decodeHermesSettings = Schema.decodeUnknownSync(HermesSettings);
|
||||
|
||||
describe("ClaudeSettings auto-compaction", () => {
|
||||
it("uses Claude's default threshold when no override is configured", () => {
|
||||
@@ -290,6 +292,7 @@ describe("provider enabled defaults", () => {
|
||||
expect(decoded.providers.claudeAgent.enabled).toBe(true);
|
||||
expect(decoded.providers.cursor.enabled).toBe(false);
|
||||
expect(decoded.providers.grok.enabled).toBe(false);
|
||||
expect(decoded.providers.hermes.enabled).toBe(false);
|
||||
expect(decoded.providers.opencode.enabled).toBe(false);
|
||||
});
|
||||
|
||||
@@ -468,3 +471,17 @@ describe("ServerSettingsPatch string normalization", () => {
|
||||
expect(encoded.providers?.codex?.launchArgs).toBe("--strict-config");
|
||||
});
|
||||
});
|
||||
|
||||
describe("HermesSettings", () => {
|
||||
it("decodes defaults", () => {
|
||||
const decoded = decodeHermesSettings({});
|
||||
expect(decoded.enabled).toBe(false);
|
||||
expect(decoded.binaryPath).toBe("hermes");
|
||||
expect(decoded.customModels).toEqual([]);
|
||||
});
|
||||
|
||||
it("is reachable via ServerSettings defaults", () => {
|
||||
const settings = decodeServerSettings({});
|
||||
expect(settings.providers.hermes.binaryPath).toBe("hermes");
|
||||
});
|
||||
});
|
||||
@@ -530,6 +530,32 @@ export const GrokSettings = makeProviderSettingsSchema(
|
||||
);
|
||||
export type GrokSettings = typeof GrokSettings.Type;
|
||||
|
||||
export const HermesSettings = makeProviderSettingsSchema(
|
||||
{
|
||||
// Off by default (like Cursor, Grok, and OpenCode): the binding is not
|
||||
// yet stable enough to probe on every install. Users opt in from Settings.
|
||||
enabled: Schema.Boolean.pipe(
|
||||
Schema.withDecodingDefault(Effect.succeed(false)),
|
||||
Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
|
||||
),
|
||||
binaryPath: makeBinaryPathSetting("hermes").pipe(
|
||||
Schema.annotateKey({
|
||||
title: "Binary path",
|
||||
description: "Path to the Hermes Agent binary.",
|
||||
providerSettingsForm: { placeholder: "hermes", clearWhenEmpty: "omit" },
|
||||
}),
|
||||
),
|
||||
customModels: Schema.Array(Schema.String).pipe(
|
||||
Schema.withDecodingDefault(Effect.succeed([])),
|
||||
Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
|
||||
),
|
||||
},
|
||||
{
|
||||
order: ["binaryPath"],
|
||||
},
|
||||
);
|
||||
export type HermesSettings = typeof HermesSettings.Type;
|
||||
|
||||
export const OpenCodeSettings = makeProviderSettingsSchema(
|
||||
{
|
||||
// Off by default (like Cursor and Grok): the binding is not yet stable
|
||||
@@ -738,6 +764,7 @@ export const ServerSettings = Schema.Struct({
|
||||
claudeAgent: ClaudeSettings.pipe(Schema.withDecodingDefault(Effect.succeed({}))),
|
||||
cursor: CursorSettings.pipe(Schema.withDecodingDefault(Effect.succeed({}))),
|
||||
grok: GrokSettings.pipe(Schema.withDecodingDefault(Effect.succeed({}))),
|
||||
hermes: HermesSettings.pipe(Schema.withDecodingDefault(Effect.succeed({}))),
|
||||
opencode: OpenCodeSettings.pipe(Schema.withDecodingDefault(Effect.succeed({}))),
|
||||
}).pipe(Schema.withDecodingDefault(Effect.succeed({}))),
|
||||
// New driver-agnostic instance map. Keyed by `ProviderInstanceId`; values
|
||||
@@ -884,6 +911,12 @@ const GrokSettingsPatch = Schema.Struct({
|
||||
customModels: Schema.optionalKey(Schema.Array(Schema.String)),
|
||||
});
|
||||
|
||||
const HermesSettingsPatch = Schema.Struct({
|
||||
enabled: Schema.optionalKey(Schema.Boolean),
|
||||
binaryPath: Schema.optionalKey(TrimmedString),
|
||||
customModels: Schema.optionalKey(Schema.Array(Schema.String)),
|
||||
});
|
||||
|
||||
const OpenCodeSettingsPatch = Schema.Struct({
|
||||
enabled: Schema.optionalKey(Schema.Boolean),
|
||||
binaryPath: Schema.optionalKey(TrimmedString),
|
||||
@@ -934,6 +967,7 @@ export const ServerSettingsPatch = Schema.Struct({
|
||||
claudeAgent: Schema.optionalKey(ClaudeSettingsPatch),
|
||||
cursor: Schema.optionalKey(CursorSettingsPatch),
|
||||
grok: Schema.optionalKey(GrokSettingsPatch),
|
||||
hermes: Schema.optionalKey(HermesSettingsPatch),
|
||||
opencode: Schema.optionalKey(OpenCodeSettingsPatch),
|
||||
}),
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user