mirror of
https://github.com/awizemann/scarf.git
synced 2026-05-10 18:44:45 +00:00
Compare commits
6 Commits
v2.7.5
...
ws-8-ux-v0.13
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f78856e6e | |||
| 5877bf6519 | |||
| f19f19cd56 | |||
| 3e470c7155 | |||
| 963d0e1a5c | |||
| 52c802676f |
@@ -113,9 +113,29 @@ Public documentation lives in the GitHub wiki at https://github.com/awizemann/sc
|
||||
|
||||
## Hermes Version
|
||||
|
||||
Targets Hermes v2026.4.30 (v0.12.0). Log lines may carry an optional `[session_id]` tag between the level and logger name — `HermesLogService.parseLine` treats the session tag as an optional capture group, so older untagged lines still parse.
|
||||
Targets Hermes v2026.5.7 (v0.13.0). Log lines may carry an optional `[session_id]` tag between the level and logger name — `HermesLogService.parseLine` treats the session tag as an optional capture group, so older untagged lines still parse.
|
||||
|
||||
**Capability gating.** Scarf detects the target's Hermes version once per server connection via [HermesCapabilities](scarf/Packages/ScarfCore/Sources/ScarfCore/Services/HermesCapabilities.swift) (`hermes --version` → semver + `YYYY.M.D` parse). The resulting `HermesCapabilitiesStore` is injected on `ContextBoundRoot` (Mac) and `ScarfGoTabRoot` (iOS) via `.environment(_:)` and `.hermesCapabilities(_:)`; UI that depends on a v0.12+ surface (Curator, Kanban, ACP image input, `auxiliary.curator`, `prompt_caching.cache_ttl`, Piper TTS, Vercel terminal) reads it through the typed environment key. Pre-v0.12 hosts gracefully hide the new affordances rather than throwing on unknown CLI subcommands. Add a new flag at the top of `HermesCapabilities` whenever Scarf gains a release-gated UI surface.
|
||||
**Capability gating.** Scarf detects the target's Hermes version once per server connection via [HermesCapabilities](scarf/Packages/ScarfCore/Sources/ScarfCore/Services/HermesCapabilities.swift) (`hermes --version` → semver + `YYYY.M.D` parse). The resulting `HermesCapabilitiesStore` is injected on `ContextBoundRoot` (Mac) and `ScarfGoTabRoot` (iOS) via `.environment(_:)` and `.hermesCapabilities(_:)`; UI that depends on a release-gated surface reads it through the typed environment key. Pre-target hosts gracefully hide the new affordances rather than throwing on unknown CLI subcommands. Add a new flag at the top of `HermesCapabilities` whenever Scarf gains a release-gated UI surface — group flags by the Hermes release that introduced them (`MARK: v0.13 (v2026.5.7) flags`, etc.).
|
||||
|
||||
**v2026.5.7 (v0.13.0)** added (Scarf-relevant subset; full v2.8.0 implementation lands across WS-2 through WS-9):
|
||||
|
||||
- **Persistent Goals** — `/goal <text>` slash command locks the agent onto a target across turns. Checkpoints v2 single-store rewrite + auto-resume after gateway restart. Surfaced in Scarf chat as a non-interruptive command + a "🎯 Goal locked: <text>" pill in the chat header. Gated on `HermesCapabilities.hasGoals`.
|
||||
- **ACP `/queue` slash command** — queues a prompt to run after the current turn completes. Joins `/steer` in `RichChatViewModel.nonInterruptiveCommands` with a transient "Queued" toast. Gated on `hasACPQueue`. `/steer` now also runs as a regular prompt on idle sessions (`hasACPSteerOnIdle`).
|
||||
- **Kanban v0.13 reliability + recovery UX** — hallucination gate on worker-created cards, generic diagnostics engine (per-task distress signals), per-task `max_retries` override, multiline title/body create, `auto_blocked_reason` rendered in the inspector banner, darwin zombie detection, unify failure counter across spawn/timeout/crash. New fields decode through tolerant `HermesKanbanRun` / `HermesKanbanTaskDetail` extensions; pre-v0.13 hosts ignore unknown keys. Gated on `hasKanbanDiagnostics`.
|
||||
- **Curator archive + prune** — `hermes curator archive <skill>` + `prune` + `list-archived` subcommands. The synchronous manual `hermes curator run` blocks until done (pre-v0.13 returned immediately). Surfaced as an "Archived" tab in CuratorView with per-row Restore + Prune actions and a destructive prune-confirm sheet. Gated on `hasCuratorArchive`.
|
||||
- **Messaging Gateway expansion** — Google Chat (20th platform; `hasGoogleChatPlatform`), cross-platform allowlists (`allowed_channels` / `allowed_chats` / `allowed_rooms` per platform; `hasGatewayAllowlists`), per-platform `gateway_restart_notification` (`hasGatewayRestartNotification`), `busy_ack_enabled` toggle (`hasGatewayBusyAckToggle`), slash-command auto-delete TTL, `[[as_document]]` skill media routing directive, `hermes gateway list` cross-profile status verb (`hasGatewayList`).
|
||||
- **Provider catalog refresh** — new models on Nous Portal + OpenRouter: `deepseek/deepseek-v4-pro`, `x-ai/grok-4.3`, `openrouter/owl-alpha` (free), `tencent/hy3-preview`, `arcee/trinity-large-thinking` (with temperature + compression overrides). `x-ai/grok-4.20-beta` renamed to `x-ai/grok-4.20` — keep alias map. Vercel AI Gateway demoted to bottom of the picker. `image_gen.model` from `config.yaml` now honored by Hermes (was advertised but ignored pre-v0.13); surfaced in `Settings → Auxiliary` (`hasImageGenModel`). OpenRouter response caching toggle (`hasOpenRouterResponseCache`).
|
||||
- **MCP SSE transport** — MCP servers can be configured with SSE transport + `sse_read_timeout`. Surfaced in MCPServersView add-server flow alongside stdio/pipe. Gated on `hasMCPSSETransport`.
|
||||
- **Cron `--no-agent` mode** — script-only watchdog jobs that skip the AI call. Surfaced in CronView edit sheet. Gated on `hasCronNoAgent`.
|
||||
- **Web Tools per-capability backends** — `web_search` and `web_extract` can use distinct backends; SearXNG joined as a search-only backend. Surfaced in the Web Tools settings tab. Gated on `hasWebToolsBackendSplit`.
|
||||
- **Profiles `--no-skills`** — `hermes profile create --no-skills` for empty-profile creation. Surfaced as a toggle in the create-profile flow. Gated on `hasProfileNoSkills`.
|
||||
- **CLI / UX additions** — context compression count in the status feed (rendered next to the token count in chat status bar; `hasContextCompressionCount`), `/new <name>` slash-command argument (`hasNewWithSessionName`), `hermes update --yes` non-interactive (`hasUpdateNonInteractive`), `display.language` static-message translation (zh / ja / de / es / fr / uk / tr; `hasDisplayLanguage`), xAI Custom Voices (voice-cloning badge next to xAI TTS provider; `hasXAIVoiceCloning`).
|
||||
- **Server-side defaults flipped** — secret redaction defaults back to ON in v0.13 (was off by default in v0.12). The Settings redaction toggle remains for opt-out; the default-state hint reflects the v0.13 semantics when the host advertises v0.13+.
|
||||
- **`video_analyze` tool** — native video understanding on Gemini-class models. Hermes handles transparently inside the agent loop; Scarf has no UI surface yet but `hasVideoAnalyze` is reserved for future widget gating.
|
||||
- **`transform_llm_output` plugin hook** — plugin-author concern; surfaced indirectly through PluginsView when a plugin advertises the hook. `hasTransformLLMOutputHook` gates the metadata badge.
|
||||
- **Schema is unchanged from v0.11/v0.12** — same state.db columns. No migration needed.
|
||||
|
||||
**v2026.4.30 (v0.12.0)** added (Scarf-relevant subset):
|
||||
|
||||
**v2026.4.30 (v0.12.0)** added (Scarf-relevant subset):
|
||||
|
||||
|
||||
@@ -311,6 +311,14 @@ public actor ACPClient {
|
||||
let result = try await sendRequest(method: "session/prompt", params: params)
|
||||
let dict = result?.dictValue ?? [:]
|
||||
let usage = dict["usage"] as? [String: Any] ?? [:]
|
||||
// TODO(WS-8-Q1): Confirm wire field name once v0.13 Hermes is
|
||||
// available. We tolerate camelCase + snake_case to match the rest
|
||||
// of the ACP payload's mixed conventions; if Hermes routes the
|
||||
// count through a `session/update` notification instead, this
|
||||
// decode is a no-op and the ACPEvent path takes over.
|
||||
let compression = (usage["compressionCount"] as? Int)
|
||||
?? (usage["compression_count"] as? Int)
|
||||
?? 0
|
||||
|
||||
statusMessage = "Ready"
|
||||
return ACPPromptResult(
|
||||
@@ -318,7 +326,8 @@ public actor ACPClient {
|
||||
inputTokens: usage["inputTokens"] as? Int ?? 0,
|
||||
outputTokens: usage["outputTokens"] as? Int ?? 0,
|
||||
thoughtTokens: usage["thoughtTokens"] as? Int ?? 0,
|
||||
cachedReadTokens: usage["cachedReadTokens"] as? Int ?? 0
|
||||
cachedReadTokens: usage["cachedReadTokens"] as? Int ?? 0,
|
||||
compressionCount: compression
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -243,19 +243,32 @@ public struct ACPPromptResult: Sendable {
|
||||
public let outputTokens: Int
|
||||
public let thoughtTokens: Int
|
||||
public let cachedReadTokens: Int
|
||||
/// Number of automatic context compactions Hermes has performed on this
|
||||
/// session so far. v0.13+ — older Hermes hosts always return 0, which
|
||||
/// the chat status bar treats as "hide chip". Optional in the wire
|
||||
/// payload; folded into a non-optional `Int` here with a 0 default so
|
||||
/// the rest of the pipeline doesn't need to nil-check.
|
||||
// TODO(WS-8-Q1): Verify that v0.13 Hermes emits the count on
|
||||
// `session/prompt`'s `usage` blob (assumed here). If it lands on a
|
||||
// separate `session/update` notification instead, this becomes a new
|
||||
// ACPEvent case + a branch in RichChatViewModel.handleACPEvent — wire
|
||||
// shape is documented in the WS-8 plan as the bigger fix path.
|
||||
public let compressionCount: Int
|
||||
|
||||
public init(
|
||||
stopReason: String,
|
||||
inputTokens: Int,
|
||||
outputTokens: Int,
|
||||
thoughtTokens: Int,
|
||||
cachedReadTokens: Int
|
||||
cachedReadTokens: Int,
|
||||
compressionCount: Int = 0
|
||||
) {
|
||||
self.stopReason = stopReason
|
||||
self.inputTokens = inputTokens
|
||||
self.outputTokens = outputTokens
|
||||
self.thoughtTokens = thoughtTokens
|
||||
self.cachedReadTokens = cachedReadTokens
|
||||
self.compressionCount = compressionCount
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,13 @@ public struct DisplaySettings: Sendable, Equatable {
|
||||
public var toolProgressCommand: Bool
|
||||
public var toolPreviewLength: Int
|
||||
public var busyInputMode: String // e.g. "interrupt"
|
||||
/// Static-message translation language. v0.13+. Empty string means
|
||||
/// "follow Hermes default" — the picker collapses both empty-string
|
||||
/// and `"en"` to "English" in display, but only writes a value when
|
||||
/// the user explicitly picks one. Persisted via
|
||||
/// `hermes config set display.language <code>`. Supported values per
|
||||
/// v0.13 release notes: `en`, `zh`, `ja`, `de`, `es`, `fr`, `uk`, `tr`.
|
||||
public var language: String
|
||||
|
||||
|
||||
public init(
|
||||
@@ -46,7 +53,8 @@ public struct DisplaySettings: Sendable, Equatable {
|
||||
inlineDiffs: Bool,
|
||||
toolProgressCommand: Bool,
|
||||
toolPreviewLength: Int,
|
||||
busyInputMode: String
|
||||
busyInputMode: String,
|
||||
language: String = ""
|
||||
) {
|
||||
self.skin = skin
|
||||
self.compact = compact
|
||||
@@ -56,6 +64,7 @@ public struct DisplaySettings: Sendable, Equatable {
|
||||
self.toolProgressCommand = toolProgressCommand
|
||||
self.toolPreviewLength = toolPreviewLength
|
||||
self.busyInputMode = busyInputMode
|
||||
self.language = language
|
||||
}
|
||||
public nonisolated static let empty = DisplaySettings(
|
||||
skin: "default",
|
||||
@@ -65,7 +74,8 @@ public struct DisplaySettings: Sendable, Equatable {
|
||||
inlineDiffs: true,
|
||||
toolProgressCommand: false,
|
||||
toolPreviewLength: 0,
|
||||
busyInputMode: "interrupt"
|
||||
busyInputMode: "interrupt",
|
||||
language: ""
|
||||
)
|
||||
}
|
||||
|
||||
@@ -190,6 +200,15 @@ public struct VoiceSettings: Sendable, Equatable {
|
||||
public var ttsOpenAIVoice: String
|
||||
public var ttsNeuTTSModel: String
|
||||
public var ttsNeuTTSDevice: String
|
||||
/// xAI TTS voice identifier. v0.13+ — xAI shipped TTS earlier but the
|
||||
/// custom-voice / cloning surface is the v0.13 add-on.
|
||||
// TODO(WS-8-Q2): Confirm key name vs `tts.xai.voice` /
|
||||
// `tts.xai.voice_id` / a top-level `tts.xai_voice` once a v0.13
|
||||
// host is on hand. The setter / YAML reader follow whatever this
|
||||
// field name implies.
|
||||
public var ttsXAIVoiceID: String
|
||||
/// xAI TTS model identifier. v0.13+. Mirrors the elevenlabs shape.
|
||||
public var ttsXAIModel: String
|
||||
|
||||
// STT
|
||||
public var sttEnabled: Bool
|
||||
@@ -217,7 +236,9 @@ public struct VoiceSettings: Sendable, Equatable {
|
||||
sttLocalModel: String,
|
||||
sttLocalLanguage: String,
|
||||
sttOpenAIModel: String,
|
||||
sttMistralModel: String
|
||||
sttMistralModel: String,
|
||||
ttsXAIVoiceID: String = "",
|
||||
ttsXAIModel: String = ""
|
||||
) {
|
||||
self.recordKey = recordKey
|
||||
self.maxRecordingSeconds = maxRecordingSeconds
|
||||
@@ -230,6 +251,8 @@ public struct VoiceSettings: Sendable, Equatable {
|
||||
self.ttsOpenAIVoice = ttsOpenAIVoice
|
||||
self.ttsNeuTTSModel = ttsNeuTTSModel
|
||||
self.ttsNeuTTSDevice = ttsNeuTTSDevice
|
||||
self.ttsXAIVoiceID = ttsXAIVoiceID
|
||||
self.ttsXAIModel = ttsXAIModel
|
||||
self.sttEnabled = sttEnabled
|
||||
self.sttProvider = sttProvider
|
||||
self.sttLocalModel = sttLocalModel
|
||||
@@ -254,7 +277,9 @@ public struct VoiceSettings: Sendable, Equatable {
|
||||
sttLocalModel: "base",
|
||||
sttLocalLanguage: "",
|
||||
sttOpenAIModel: "whisper-1",
|
||||
sttMistralModel: "voxtral-mini-latest"
|
||||
sttMistralModel: "voxtral-mini-latest",
|
||||
ttsXAIVoiceID: "",
|
||||
ttsXAIModel: ""
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,13 @@ import os
|
||||
///
|
||||
/// Scarf tracks Hermes feature releases by date-version + semver. v0.12 added
|
||||
/// a dozen surfaces (Curator, Kanban, multimodal ACP, ...) and removed a few
|
||||
/// (`flush_memories` aux task). UI that branches on these surfaces calls
|
||||
/// the boolean accessors here so older Hermes installs degrade silently
|
||||
/// instead of throwing on an unknown CLI subcommand.
|
||||
/// (`flush_memories` aux task); v0.13 added Persistent Goals, ACP `/queue`,
|
||||
/// Kanban diagnostics + recovery UX, Curator archive/prune, Google Chat (20th
|
||||
/// platform), cross-platform allowlists, MCP SSE transport, Cron `no_agent`
|
||||
/// mode, Web Tools per-capability backends, Profiles `--no-skills`, and a
|
||||
/// handful of UX additions. UI that branches on these surfaces calls the
|
||||
/// boolean accessors here so older Hermes installs degrade silently instead
|
||||
/// of throwing on an unknown CLI subcommand.
|
||||
///
|
||||
/// Pure value type — no side effects. The async detection lives in
|
||||
/// `HermesCapabilitiesStore`.
|
||||
@@ -45,8 +49,11 @@ public struct HermesCapabilities: Sendable, Equatable {
|
||||
// MARK: - Capability flags
|
||||
//
|
||||
// Add a new flag here when Scarf gains UI that conditionally branches on
|
||||
// a Hermes capability. Keep the comparison conservative: `>= 0.12.0`
|
||||
// covers users still on the 0.12 line who haven't upgraded to 0.13 yet.
|
||||
// a Hermes capability. Keep the comparison conservative: a flag introduced
|
||||
// in v0.13.0 should gate on `>= 0.13.0`, not `>= 0.13.5`, so users on
|
||||
// an early 0.13 patch still see the surface.
|
||||
|
||||
// MARK: v0.12 (v2026.4.30) flags
|
||||
|
||||
/// `hermes curator` autonomous skill maintenance (v0.12+).
|
||||
public var hasCurator: Bool { atLeastSemver(0, 12, 0) }
|
||||
@@ -96,9 +103,123 @@ public struct HermesCapabilities: Sendable, Equatable {
|
||||
public var hasPromptCacheTTL: Bool { atLeastSemver(0, 12, 0) }
|
||||
|
||||
/// `redaction.enabled` is now off by default in v0.12 — Scarf surfaces
|
||||
/// the toggle so users can flip it back on.
|
||||
/// the toggle so users can flip it back on. v0.13 flips the server-side
|
||||
/// default back to ON; the toggle remains so users on v0.13 can opt out.
|
||||
public var hasRedactionToggle: Bool { atLeastSemver(0, 12, 0) }
|
||||
|
||||
// MARK: v0.13 (v2026.5.7) flags
|
||||
|
||||
/// `/goal` slash command + Persistent Goals + Checkpoints v2 single-store
|
||||
/// (v0.13+). Used by RichChatViewModel to add `/goal` to the
|
||||
/// non-interruptive command list and to render the "Goal locked" pill in
|
||||
/// the chat header.
|
||||
public var hasGoals: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// `/queue` slash command in the ACP adapter (v0.13+). Queues a prompt
|
||||
/// to run after the current turn completes without interrupting.
|
||||
public var hasACPQueue: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// `/steer` runs as a regular prompt on idle ACP sessions (v0.13+). Pre-
|
||||
/// v0.13 hosts silently no-op `/steer` when no turn is in flight; with
|
||||
/// this flag on, Scarf can surface `/steer` even when the agent isn't
|
||||
/// mid-turn without confusing UX.
|
||||
public var hasACPSteerOnIdle: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// Kanban v0.13 reliability surface: hallucination gate on worker-created
|
||||
/// cards, generic diagnostics engine, per-task `max_retries`, multiline
|
||||
/// title/body create, `auto_blocked_reason` on blocked tasks, darwin
|
||||
/// zombie detection. All read through the `kanban show` JSON surface.
|
||||
public var hasKanbanDiagnostics: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// `hermes curator archive`, `prune`, and `list-archived` subcommands
|
||||
/// (v0.13+). The synchronous manual `hermes curator run` lives behind
|
||||
/// this flag too — pre-v0.13 `run` returns immediately and the work
|
||||
/// happens in the background.
|
||||
public var hasCuratorArchive: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// Google Chat — 20th messaging-gateway platform (v0.13+).
|
||||
public var hasGoogleChatPlatform: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// Cross-platform allowlist keys: `allowed_channels` (Slack / Mattermost
|
||||
/// / Google Chat), `allowed_chats` (Telegram / WhatsApp), `allowed_rooms`
|
||||
/// (Matrix / DingTalk). Settable per platform in `config.yaml` (v0.13+).
|
||||
public var hasGatewayAllowlists: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// `busy_ack_enabled` config to suppress per-message "agent is working…"
|
||||
/// acks across platforms (v0.13+).
|
||||
public var hasGatewayBusyAckToggle: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// Per-platform `gateway_restart_notification` flag controls whether the
|
||||
/// platform posts a "Gateway restarted" notice on boot (v0.13+).
|
||||
public var hasGatewayRestartNotification: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// `hermes gateway list` cross-profile status verb (v0.13+). Lets Scarf
|
||||
/// show which profile is currently running which platform.
|
||||
public var hasGatewayList: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// MCP servers can use SSE transport (v0.13+). Adds an `sse_read_timeout`
|
||||
/// knob alongside the existing stdio/pipe transports.
|
||||
public var hasMCPSSETransport: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// Cron `--no-agent` mode for script-only watchdog jobs (v0.13+). Skips
|
||||
/// the AI call entirely — useful for keep-alive / periodic-check jobs.
|
||||
public var hasCronNoAgent: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// Web Tools split into per-capability backend selection: `web_search`
|
||||
/// and `web_extract` can now use distinct backends (v0.13+). SearXNG
|
||||
/// joined as a search-only backend.
|
||||
public var hasWebToolsBackendSplit: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// `hermes profile create --no-skills` flag for empty profiles (v0.13+).
|
||||
public var hasProfileNoSkills: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// Context compression count surfaced in the status feed (v0.13+). Scarf
|
||||
/// renders it next to the token count in the chat status bar.
|
||||
public var hasContextCompressionCount: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// `/new` slash command accepts an optional session-name argument (v0.13+).
|
||||
public var hasNewWithSessionName: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// `hermes update --yes` / `-y` skips interactive prompts (v0.13+). Used
|
||||
/// by Scarf's "Update Hermes" affordance to run unattended.
|
||||
public var hasUpdateNonInteractive: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// OpenRouter response caching toggle in `config.yaml` (v0.13+).
|
||||
public var hasOpenRouterResponseCache: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// `image_gen.model` honored from `config.yaml` (v0.13+). Pre-v0.13 the
|
||||
/// value was advertised but ignored at runtime.
|
||||
public var hasImageGenModel: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// `display.language` config key for static-message translation: zh / ja /
|
||||
/// de / es / fr / uk / tr (v0.13+).
|
||||
public var hasDisplayLanguage: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// xAI Custom Voices — voice cloning support (v0.13+). Exposed in Scarf
|
||||
/// as a "Cloning supported" badge next to the xAI TTS provider entry.
|
||||
public var hasXAIVoiceCloning: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// `video_analyze` tool — native video understanding on Gemini and
|
||||
/// compatible models (v0.13+). Hermes handles this transparently inside
|
||||
/// the agent loop; Scarf has no UI surface yet, but the flag lets future
|
||||
/// dashboards / activity views light up video-tool annotations.
|
||||
public var hasVideoAnalyze: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
/// `transform_llm_output` plugin hook for shaping LLM output before the
|
||||
/// conversation receives it (v0.13+). Plugin-author concern; Scarf's
|
||||
/// PluginsView surfaces it as a documented hook in plugin metadata.
|
||||
public var hasTransformLLMOutputHook: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
// MARK: Convenience predicates
|
||||
|
||||
/// Whether the connected host is on the v0.13 line or newer. Convenience
|
||||
/// for UI copy that needs to switch on the v0.12 → v0.13 boundary without
|
||||
/// proxying through a feature-specific flag (e.g. "v0.13 features active"
|
||||
/// badges, redaction default-state hints). Equivalent to any individual
|
||||
/// v0.13 flag; prefer this when the call site isn't actually about a
|
||||
/// specific feature.
|
||||
public var isV013OrLater: Bool { atLeastSemver(0, 13, 0) }
|
||||
|
||||
private func atLeastSemver(_ major: Int, _ minor: Int, _ patch: Int) -> Bool {
|
||||
guard let s = semver else { return false }
|
||||
return s >= SemVer(major: major, minor: minor, patch: patch)
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import Foundation
|
||||
|
||||
/// Pure helpers that build argv arrays for `hermes update` invocations.
|
||||
///
|
||||
/// Lives in ScarfCore so the eventual UI surface (Mac / iOS / remote)
|
||||
/// shares flag selection. There is no in-app "Update Hermes" affordance
|
||||
/// in v2.7.5 — Sparkle handles Scarf-self-update and `hermes update` is
|
||||
/// invoked by users in their terminal — but capability-gated flag logic
|
||||
/// is forward-compat plumbing that the future affordance will call. Each
|
||||
/// helper is a `nonisolated static` pure function: no transport, no
|
||||
/// MainActor, no mocking surface required.
|
||||
public enum HermesUpdaterCommandBuilder {
|
||||
/// Argv for an `hermes update` invocation, capability-gated.
|
||||
///
|
||||
/// Pre-v0.12 hosts only had `update` (no flags). v0.12+ accepts
|
||||
/// `--check` for preflight. v0.13+ accepts `--yes` / `-y` for
|
||||
/// unattended runs (skips the interactive confirmation prompt).
|
||||
/// Flags are silently dropped when the connected host can't honor
|
||||
/// them so callers don't need to branch on capabilities themselves.
|
||||
public static func updateArgv(
|
||||
capabilities: HermesCapabilities,
|
||||
unattended: Bool,
|
||||
checkOnly: Bool
|
||||
) -> [String] {
|
||||
var args: [String] = ["update"]
|
||||
if checkOnly && capabilities.hasUpdateCheck {
|
||||
args.append("--check")
|
||||
}
|
||||
if unattended && capabilities.hasUpdateNonInteractive {
|
||||
args.append("--yes")
|
||||
}
|
||||
return args
|
||||
}
|
||||
}
|
||||
@@ -229,6 +229,12 @@ public final class RichChatViewModel {
|
||||
public private(set) var acpOutputTokens = 0
|
||||
public private(set) var acpThoughtTokens = 0
|
||||
public private(set) var acpCachedReadTokens = 0
|
||||
/// Running count of context compactions Hermes has performed on this
|
||||
/// session. Surfaced as the `🗜 ×N` chip in `SessionInfoBar` when > 0
|
||||
/// and `HermesCapabilities.hasContextCompressionCount` is true. Each
|
||||
/// `session/prompt` response carries the latest server-side total, so
|
||||
/// we replace (with a `max` guard) rather than accumulate.
|
||||
public private(set) var acpCompressionCount = 0
|
||||
|
||||
/// Slash commands advertised by the ACP server via `available_commands_update`.
|
||||
public private(set) var acpCommands: [HermesSlashCommand] = []
|
||||
@@ -468,6 +474,7 @@ public final class RichChatViewModel {
|
||||
acpErrorHint = nil
|
||||
acpErrorDetails = nil
|
||||
acpCachedReadTokens = 0
|
||||
acpCompressionCount = 0
|
||||
acpCommands = []
|
||||
projectScopedCommands = []
|
||||
currentTurnStart = nil
|
||||
@@ -811,6 +818,13 @@ public final class RichChatViewModel {
|
||||
acpOutputTokens += response.outputTokens
|
||||
acpThoughtTokens += response.thoughtTokens
|
||||
acpCachedReadTokens += response.cachedReadTokens
|
||||
// Compression count is a session-wide running total emitted by
|
||||
// Hermes; each prompt response carries the latest value, so we
|
||||
// replace rather than accumulate. The `max` guard tolerates
|
||||
// pre-v0.13 hosts (which emit 0) being upgraded server-side
|
||||
// mid-session — once a real number lands the count resumes from
|
||||
// there rather than snapping back to 0.
|
||||
acpCompressionCount = max(acpCompressionCount, response.compressionCount)
|
||||
isAgentWorking = false
|
||||
buildMessageGroups()
|
||||
// Final position after the prompt settles. Catches fast responses
|
||||
|
||||
@@ -9,6 +9,13 @@ import Foundation
|
||||
|
||||
// MARK: - Version line parsing
|
||||
|
||||
@Test func parseV013ReleaseLine() {
|
||||
let caps = HermesCapabilities.parseLine("Hermes Agent v0.13.0 (2026.5.7)")
|
||||
#expect(caps.semver == HermesCapabilities.SemVer(major: 0, minor: 13, patch: 0))
|
||||
#expect(caps.dateVersion == HermesCapabilities.DateVersion(year: 2026, month: 5, day: 7))
|
||||
#expect(caps.detected)
|
||||
}
|
||||
|
||||
@Test func parseV012ReleaseLine() {
|
||||
let caps = HermesCapabilities.parseLine("Hermes Agent v0.12.0 (2026.4.30)")
|
||||
#expect(caps.semver == HermesCapabilities.SemVer(major: 0, minor: 12, patch: 0))
|
||||
@@ -75,8 +82,42 @@ import Foundation
|
||||
|
||||
// MARK: - Capability flags
|
||||
|
||||
@Test func v013FlagsAllOn() {
|
||||
let caps = HermesCapabilities.parseLine("Hermes Agent v0.13.0 (2026.5.7)")
|
||||
// v0.12 surfaces remain on.
|
||||
#expect(caps.hasCurator)
|
||||
#expect(caps.hasKanban)
|
||||
#expect(caps.hasACPImagePrompts)
|
||||
#expect(!caps.hasFlushMemoriesAux)
|
||||
// v0.13 surfaces light up.
|
||||
#expect(caps.hasGoals)
|
||||
#expect(caps.hasACPQueue)
|
||||
#expect(caps.hasACPSteerOnIdle)
|
||||
#expect(caps.hasKanbanDiagnostics)
|
||||
#expect(caps.hasCuratorArchive)
|
||||
#expect(caps.hasGoogleChatPlatform)
|
||||
#expect(caps.hasGatewayAllowlists)
|
||||
#expect(caps.hasGatewayBusyAckToggle)
|
||||
#expect(caps.hasGatewayRestartNotification)
|
||||
#expect(caps.hasGatewayList)
|
||||
#expect(caps.hasMCPSSETransport)
|
||||
#expect(caps.hasCronNoAgent)
|
||||
#expect(caps.hasWebToolsBackendSplit)
|
||||
#expect(caps.hasProfileNoSkills)
|
||||
#expect(caps.hasContextCompressionCount)
|
||||
#expect(caps.hasNewWithSessionName)
|
||||
#expect(caps.hasUpdateNonInteractive)
|
||||
#expect(caps.hasOpenRouterResponseCache)
|
||||
#expect(caps.hasImageGenModel)
|
||||
#expect(caps.hasDisplayLanguage)
|
||||
#expect(caps.hasXAIVoiceCloning)
|
||||
#expect(caps.hasVideoAnalyze)
|
||||
#expect(caps.hasTransformLLMOutputHook)
|
||||
}
|
||||
|
||||
@Test func v012FlagsAllOn() {
|
||||
let caps = HermesCapabilities.parseLine("Hermes Agent v0.12.0 (2026.4.30)")
|
||||
// v0.12 surfaces on.
|
||||
#expect(caps.hasCurator)
|
||||
#expect(caps.hasFallbackCommand)
|
||||
#expect(caps.hasKanban)
|
||||
@@ -94,6 +135,22 @@ import Foundation
|
||||
#expect(caps.hasRedactionToggle)
|
||||
// flush_memories was REMOVED in v0.12 — flag inverts.
|
||||
#expect(!caps.hasFlushMemoriesAux)
|
||||
// v0.13 surfaces stay off on a v0.12 host.
|
||||
#expect(!caps.hasGoals)
|
||||
#expect(!caps.hasACPQueue)
|
||||
#expect(!caps.hasKanbanDiagnostics)
|
||||
#expect(!caps.hasCuratorArchive)
|
||||
#expect(!caps.hasGoogleChatPlatform)
|
||||
#expect(!caps.hasGatewayAllowlists)
|
||||
#expect(!caps.hasMCPSSETransport)
|
||||
#expect(!caps.hasCronNoAgent)
|
||||
#expect(!caps.hasWebToolsBackendSplit)
|
||||
#expect(!caps.hasProfileNoSkills)
|
||||
#expect(!caps.hasContextCompressionCount)
|
||||
#expect(!caps.hasOpenRouterResponseCache)
|
||||
#expect(!caps.hasImageGenModel)
|
||||
#expect(!caps.hasDisplayLanguage)
|
||||
#expect(!caps.hasXAIVoiceCloning)
|
||||
}
|
||||
|
||||
@Test func v011FlagsAllOff() {
|
||||
@@ -126,11 +183,45 @@ import Foundation
|
||||
}
|
||||
|
||||
@Test func futureVersionRetainsCapabilities() {
|
||||
// A v0.13 (hypothetical) should still see all v0.12 capabilities on.
|
||||
let caps = HermesCapabilities.parseLine("Hermes Agent v0.13.0 (2026.6.1)")
|
||||
// A v0.14 (hypothetical) should still see all v0.12 + v0.13 capabilities on.
|
||||
let caps = HermesCapabilities.parseLine("Hermes Agent v0.14.0 (2026.7.1)")
|
||||
#expect(caps.hasCurator)
|
||||
#expect(caps.hasACPImagePrompts)
|
||||
#expect(caps.hasGoals)
|
||||
#expect(caps.hasKanbanDiagnostics)
|
||||
#expect(caps.hasCuratorArchive)
|
||||
// And flush_memories stays gone.
|
||||
#expect(!caps.hasFlushMemoriesAux)
|
||||
}
|
||||
|
||||
@Test func v0_13_patchReleaseStillEnablesAllFlags() {
|
||||
// A v0.13.4 patch release should still enable every v0.13 flag.
|
||||
let caps = HermesCapabilities.parseLine("Hermes Agent v0.13.4 (2026.5.20)")
|
||||
#expect(caps.hasGoals)
|
||||
#expect(caps.hasACPQueue)
|
||||
#expect(caps.hasKanbanDiagnostics)
|
||||
#expect(caps.hasGoogleChatPlatform)
|
||||
}
|
||||
|
||||
// MARK: - isV013OrLater convenience predicate
|
||||
|
||||
@Test func isV013OrLater_v013HostTrue() {
|
||||
let caps = HermesCapabilities.parseLine("Hermes Agent v0.13.0 (2026.5.7)")
|
||||
#expect(caps.isV013OrLater)
|
||||
}
|
||||
|
||||
@Test func isV013OrLater_v012HostFalse() {
|
||||
let caps = HermesCapabilities.parseLine("Hermes Agent v0.12.0 (2026.4.30)")
|
||||
#expect(!caps.isV013OrLater)
|
||||
}
|
||||
|
||||
@Test func isV013OrLater_emptyFalse() {
|
||||
let caps = HermesCapabilities.empty
|
||||
#expect(!caps.isV013OrLater)
|
||||
}
|
||||
|
||||
@Test func isV013OrLater_v014HostTrue() {
|
||||
let caps = HermesCapabilities.parseLine("Hermes Agent v0.14.0 (2026.7.1)")
|
||||
#expect(caps.isV013OrLater)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,6 +162,47 @@ import Foundation
|
||||
// start → false.
|
||||
#expect(vm.supportsCompress == false)
|
||||
#expect(vm.hasBroaderCommandMenu == false)
|
||||
// v0.13: compression count starts at 0 so the SessionInfoBar chip
|
||||
// stays hidden on fresh sessions.
|
||||
#expect(vm.acpCompressionCount == 0)
|
||||
}
|
||||
|
||||
@Test @MainActor func richChatTracksCompressionCountFromPromptResults() {
|
||||
let vm = RichChatViewModel(context: .local)
|
||||
let response = ACPPromptResult(
|
||||
stopReason: "end_turn",
|
||||
inputTokens: 100, outputTokens: 50,
|
||||
thoughtTokens: 20, cachedReadTokens: 10,
|
||||
compressionCount: 3
|
||||
)
|
||||
vm.handleACPEvent(.promptComplete(sessionId: "s", response: response))
|
||||
#expect(vm.acpCompressionCount == 3)
|
||||
|
||||
// Subsequent prompts overwrite (with a max guard) — the server
|
||||
// emits a session-wide running total, not a per-prompt delta.
|
||||
let next = ACPPromptResult(
|
||||
stopReason: "end_turn",
|
||||
inputTokens: 0, outputTokens: 0,
|
||||
thoughtTokens: 0, cachedReadTokens: 0,
|
||||
compressionCount: 5
|
||||
)
|
||||
vm.handleACPEvent(.promptComplete(sessionId: "s", response: next))
|
||||
#expect(vm.acpCompressionCount == 5)
|
||||
|
||||
// A pre-v0.13 host mid-session emits 0; the max-guard keeps the
|
||||
// last real value rather than snapping back.
|
||||
let stale = ACPPromptResult(
|
||||
stopReason: "end_turn",
|
||||
inputTokens: 0, outputTokens: 0,
|
||||
thoughtTokens: 0, cachedReadTokens: 0,
|
||||
compressionCount: 0
|
||||
)
|
||||
vm.handleACPEvent(.promptComplete(sessionId: "s", response: stale))
|
||||
#expect(vm.acpCompressionCount == 5)
|
||||
|
||||
// reset() clears the counter so a fresh session starts clean.
|
||||
vm.reset()
|
||||
#expect(vm.acpCompressionCount == 0)
|
||||
}
|
||||
|
||||
@Test @MainActor func messageGroupDerivedProperties() {
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
import Testing
|
||||
import Foundation
|
||||
@testable import ScarfCore
|
||||
|
||||
/// Pure-function matrix for `HermesUpdaterCommandBuilder.updateArgv`. The
|
||||
/// builder degrades flags silently when the connected host can't honor
|
||||
/// them, so the "is the right flag emitted on the right version?" matrix
|
||||
/// is the meaningful test surface.
|
||||
@Suite struct M0eUpdaterTests {
|
||||
|
||||
// MARK: - Helpers
|
||||
|
||||
private func caps(_ versionLine: String?) -> HermesCapabilities {
|
||||
guard let line = versionLine else { return .empty }
|
||||
return HermesCapabilities.parseLine(line)
|
||||
}
|
||||
|
||||
// MARK: - Pre-v0.12 (no flags supported)
|
||||
|
||||
@Test func preV012_returnsBareUpdateRegardlessOfFlags() {
|
||||
let pre = caps("Hermes Agent v0.11.0 (2026.4.23)")
|
||||
#expect(HermesUpdaterCommandBuilder.updateArgv(
|
||||
capabilities: pre, unattended: false, checkOnly: false
|
||||
) == ["update"])
|
||||
#expect(HermesUpdaterCommandBuilder.updateArgv(
|
||||
capabilities: pre, unattended: true, checkOnly: false
|
||||
) == ["update"])
|
||||
#expect(HermesUpdaterCommandBuilder.updateArgv(
|
||||
capabilities: pre, unattended: true, checkOnly: true
|
||||
) == ["update"])
|
||||
}
|
||||
|
||||
@Test func unknownVersion_returnsBareUpdate() {
|
||||
// No detected version means we can't guarantee any flag is
|
||||
// honored; defensively emit the bare verb.
|
||||
#expect(HermesUpdaterCommandBuilder.updateArgv(
|
||||
capabilities: .empty, unattended: true, checkOnly: true
|
||||
) == ["update"])
|
||||
}
|
||||
|
||||
// MARK: - v0.12 (--check supported, --yes is not)
|
||||
|
||||
@Test func v012_checkOnly_emitsCheckFlag() {
|
||||
let v012 = caps("Hermes Agent v0.12.0 (2026.4.30)")
|
||||
#expect(HermesUpdaterCommandBuilder.updateArgv(
|
||||
capabilities: v012, unattended: false, checkOnly: true
|
||||
) == ["update", "--check"])
|
||||
}
|
||||
|
||||
@Test func v012_unattended_dropsYesFlag() {
|
||||
// v0.12 doesn't honor --yes; the helper degrades silently.
|
||||
let v012 = caps("Hermes Agent v0.12.0 (2026.4.30)")
|
||||
#expect(HermesUpdaterCommandBuilder.updateArgv(
|
||||
capabilities: v012, unattended: true, checkOnly: false
|
||||
) == ["update"])
|
||||
}
|
||||
|
||||
@Test func v012_checkOnlyAndUnattended_emitsOnlyCheck() {
|
||||
let v012 = caps("Hermes Agent v0.12.0 (2026.4.30)")
|
||||
#expect(HermesUpdaterCommandBuilder.updateArgv(
|
||||
capabilities: v012, unattended: true, checkOnly: true
|
||||
) == ["update", "--check"])
|
||||
}
|
||||
|
||||
// MARK: - v0.13 (full flag support)
|
||||
|
||||
@Test func v013_unattended_emitsYesFlag() {
|
||||
let v013 = caps("Hermes Agent v0.13.0 (2026.5.7)")
|
||||
#expect(HermesUpdaterCommandBuilder.updateArgv(
|
||||
capabilities: v013, unattended: true, checkOnly: false
|
||||
) == ["update", "--yes"])
|
||||
}
|
||||
|
||||
@Test func v013_checkOnlyAndUnattended_emitsBothFlags() {
|
||||
let v013 = caps("Hermes Agent v0.13.0 (2026.5.7)")
|
||||
#expect(HermesUpdaterCommandBuilder.updateArgv(
|
||||
capabilities: v013, unattended: true, checkOnly: true
|
||||
) == ["update", "--check", "--yes"])
|
||||
}
|
||||
|
||||
@Test func v013_neither_emitsBareUpdate() {
|
||||
let v013 = caps("Hermes Agent v0.13.0 (2026.5.7)")
|
||||
#expect(HermesUpdaterCommandBuilder.updateArgv(
|
||||
capabilities: v013, unattended: false, checkOnly: false
|
||||
) == ["update"])
|
||||
}
|
||||
}
|
||||
@@ -242,6 +242,15 @@ import Foundation
|
||||
thoughtTokens: 20, cachedReadTokens: 10
|
||||
)
|
||||
#expect(prompt.stopReason == "end_turn")
|
||||
// v0.13: compressionCount has a 0 default for legacy callers.
|
||||
#expect(prompt.compressionCount == 0)
|
||||
|
||||
let v013Prompt = ACPPromptResult(
|
||||
stopReason: "end_turn", inputTokens: 0, outputTokens: 0,
|
||||
thoughtTokens: 0, cachedReadTokens: 0,
|
||||
compressionCount: 7
|
||||
)
|
||||
#expect(v013Prompt.compressionCount == 7)
|
||||
}
|
||||
|
||||
@Test func projectDashboardInitChain() {
|
||||
|
||||
@@ -84,7 +84,11 @@ struct HermesFileService: Sendable {
|
||||
inlineDiffs: bool("display.inline_diffs", default: true),
|
||||
toolProgressCommand: bool("display.tool_progress_command", default: false),
|
||||
toolPreviewLength: int("display.tool_preview_length", default: 0),
|
||||
busyInputMode: str("display.busy_input_mode", default: "interrupt")
|
||||
busyInputMode: str("display.busy_input_mode", default: "interrupt"),
|
||||
// v0.13: empty default means "key absent — agent uses its own
|
||||
// default" (English). The picker writes a real value when the
|
||||
// user explicitly chooses one.
|
||||
language: str("display.language", default: "")
|
||||
)
|
||||
|
||||
let terminal = TerminalSettings(
|
||||
@@ -131,7 +135,12 @@ struct HermesFileService: Sendable {
|
||||
sttLocalModel: str("stt.local.model", default: "base"),
|
||||
sttLocalLanguage: str("stt.local.language"),
|
||||
sttOpenAIModel: str("stt.openai.model", default: "whisper-1"),
|
||||
sttMistralModel: str("stt.mistral.model", default: "voxtral-mini-latest")
|
||||
sttMistralModel: str("stt.mistral.model", default: "voxtral-mini-latest"),
|
||||
// TODO(WS-8-Q2): Verify key names. Mirroring the elevenlabs
|
||||
// shape (`<provider>.voice_id` + `<provider>.model`); v0.13
|
||||
// source might use `tts.xai.voice` or `tts.xai.model_id`.
|
||||
ttsXAIVoiceID: str("tts.xai.voice_id"),
|
||||
ttsXAIModel: str("tts.xai.model")
|
||||
)
|
||||
|
||||
func aux(_ name: String) -> AuxiliaryModel {
|
||||
|
||||
@@ -11,6 +11,7 @@ struct ChatTranscriptPane: View {
|
||||
@Bindable var chatViewModel: ChatViewModel
|
||||
var onSend: (String, [ChatImageAttachment]) -> Void
|
||||
var isEnabled: Bool
|
||||
@Environment(\.hermesCapabilities) private var capabilitiesStore
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 0) {
|
||||
@@ -20,8 +21,10 @@ struct ChatTranscriptPane: View {
|
||||
acpInputTokens: richChat.acpInputTokens,
|
||||
acpOutputTokens: richChat.acpOutputTokens,
|
||||
acpThoughtTokens: richChat.acpThoughtTokens,
|
||||
acpCompressionCount: richChat.acpCompressionCount,
|
||||
projectName: chatViewModel.currentProjectName,
|
||||
gitBranch: chatViewModel.currentGitBranch
|
||||
gitBranch: chatViewModel.currentGitBranch,
|
||||
capabilities: capabilitiesStore?.capabilities ?? .empty
|
||||
)
|
||||
Divider()
|
||||
|
||||
|
||||
@@ -9,6 +9,11 @@ struct SessionInfoBar: View {
|
||||
var acpInputTokens: Int = 0
|
||||
var acpOutputTokens: Int = 0
|
||||
var acpThoughtTokens: Int = 0
|
||||
/// Number of context compactions Hermes has run on this session. v0.13+
|
||||
/// surface — capability-gated by the bar so pre-v0.13 hosts never see
|
||||
/// the chip even if a stale value somehow trickles through. Defaults
|
||||
/// to 0 so existing callers and previews don't need to be updated.
|
||||
var acpCompressionCount: Int = 0
|
||||
/// Name of the Scarf project this session is attributed to, when
|
||||
/// applicable. Nil for plain global chats. Drives the folder-chip
|
||||
/// indicator rendered before the session title. Resolved by
|
||||
@@ -20,6 +25,11 @@ struct SessionInfoBar: View {
|
||||
/// name. Nil for non-project chats and for projects that aren't
|
||||
/// git repos.
|
||||
var gitBranch: String? = nil
|
||||
/// Capability snapshot for v0.13+ surfaces. Defaulted so previews and
|
||||
/// pre-v0.13 hosts render the v2.7.5 layout unchanged. Coordinated
|
||||
/// with WS-2 — both WSes add `capabilities` to this view; whichever
|
||||
/// lands first establishes the prop.
|
||||
var capabilities: HermesCapabilities = .empty
|
||||
|
||||
/// Active Hermes profile name (issue #50). Resolved on each body
|
||||
/// re-evaluation; the resolver caches for 5s so this is cheap.
|
||||
@@ -96,6 +106,21 @@ struct SessionInfoBar: View {
|
||||
Label("\(formatTokens(reasonToks)) reasoning", systemImage: "brain")
|
||||
}
|
||||
|
||||
// v0.13: Hermes surfaces a running count of automatic
|
||||
// context compactions. Render only when the host is on
|
||||
// v0.13+ AND the count is non-zero, so a pre-v0.13 host
|
||||
// (which always reports 0) sees no chip, and a v0.13 host
|
||||
// sees the chip the first time the agent compacts.
|
||||
if capabilities.hasContextCompressionCount && acpCompressionCount > 0 {
|
||||
Label(
|
||||
"×\(acpCompressionCount)",
|
||||
systemImage: "arrow.down.right.and.arrow.up.left"
|
||||
)
|
||||
.scarfStyle(.caption)
|
||||
.foregroundStyle(ScarfColor.foregroundMuted)
|
||||
.help("Hermes auto-compacted this session's context \(acpCompressionCount) time\(acpCompressionCount == 1 ? "" : "s")")
|
||||
}
|
||||
|
||||
if let cost = session.displayCostUSD {
|
||||
let formattedCost = cost.formatted(.currency(code: "USD").precision(.fractionLength(4)))
|
||||
Label(session.costIsActual ? formattedCost : "\(formattedCost) est.", systemImage: "dollarsign.circle")
|
||||
|
||||
@@ -87,7 +87,16 @@ private struct SlashCommandRow: View {
|
||||
.fontWeight(.semibold)
|
||||
.foregroundStyle(isSelected ? ScarfColor.accentActive : ScarfColor.foregroundPrimary)
|
||||
if let hint = command.argumentHint {
|
||||
Text("<\(hint)>")
|
||||
// v0.13: Hermes may emit hints already wrapped in
|
||||
// brackets (e.g. `[name]` for the optional `/new
|
||||
// <name>` argument exposed by `hasNewWithSessionName`).
|
||||
// Avoid double-wrapping — bracketed hints pass through
|
||||
// verbatim while older `guidance`-style hints (no
|
||||
// brackets) still render as `<guidance>`.
|
||||
let display = hint.hasPrefix("<") || hint.hasPrefix("[")
|
||||
? hint
|
||||
: "<\(hint)>"
|
||||
Text(display)
|
||||
.font(ScarfFont.monoSmall)
|
||||
.foregroundStyle(ScarfColor.foregroundFaint)
|
||||
}
|
||||
|
||||
@@ -29,8 +29,31 @@ final class SettingsViewModel {
|
||||
// that no-ops on older hosts is low compared to gating overhead.
|
||||
var terminalBackends = ["local", "docker", "singularity", "modal", "daytona", "ssh", "vercel"]
|
||||
var browserBackends = ["browseruse", "firecrawl", "local"]
|
||||
var ttsProviders = ["edge", "elevenlabs", "openai", "minimax", "mistral", "neutts", "piper"]
|
||||
// v0.13: `xai` joins the TTS provider list. xAI shipped TTS earlier
|
||||
// (v0.12) but the v0.13 add-on is custom voice cloning — see
|
||||
// `HermesCapabilities.hasXAIVoiceCloning` and the badge in VoiceTab.
|
||||
// The provider option itself is ungated so pre-v0.13 hosts with xAI
|
||||
// keys can still pick it.
|
||||
var ttsProviders = ["edge", "elevenlabs", "openai", "minimax", "mistral", "neutts", "piper", "xai"]
|
||||
var sttProviders = ["local", "groq", "openai", "mistral"]
|
||||
/// Static-message translation languages honored by Hermes v0.13's
|
||||
/// `display.language` key. The first row's empty value writes no
|
||||
/// key — equivalent to "Hermes default" — while explicit `en` writes
|
||||
/// the code so users who care about determinism can pin it. Keep the
|
||||
/// label list in sync with the Hermes v0.13 release notes; new
|
||||
/// languages should be appended in alphabetical order by display
|
||||
/// label so the picker stays scannable.
|
||||
var displayLanguages: [(code: String, label: String)] = [
|
||||
("", "English (default)"),
|
||||
("en", "English"),
|
||||
("zh", "中文 (Chinese)"),
|
||||
("ja", "日本語 (Japanese)"),
|
||||
("de", "Deutsch (German)"),
|
||||
("es", "Español (Spanish)"),
|
||||
("fr", "Français (French)"),
|
||||
("uk", "Українська (Ukrainian)"),
|
||||
("tr", "Türkçe (Turkish)"),
|
||||
]
|
||||
var memoryProviders = ["", "honcho", "openviking", "mem0", "hindsight", "holographic", "retaindb", "byterover", "supermemory"]
|
||||
var saveMessage: String?
|
||||
var isLoading = false
|
||||
@@ -104,6 +127,10 @@ final class SettingsViewModel {
|
||||
func setToolProgressCommand(_ value: Bool) { setSetting("display.tool_progress_command", value: value ? "true" : "false") }
|
||||
func setToolPreviewLength(_ value: Int) { setSetting("display.tool_preview_length", value: String(value)) }
|
||||
func setBusyInputMode(_ value: String) { setSetting("display.busy_input_mode", value: value) }
|
||||
/// v0.13: `display.language` for static-message translations. Empty
|
||||
/// string writes "" via `hermes config set` which Hermes treats as
|
||||
/// "use default"; explicit codes pin the language.
|
||||
func setDisplayLanguage(_ value: String) { setSetting("display.language", value: value) }
|
||||
|
||||
// MARK: - Agent
|
||||
|
||||
@@ -158,6 +185,10 @@ final class SettingsViewModel {
|
||||
func setTTSOpenAIVoice(_ value: String) { setSetting("tts.openai.voice", value: value) }
|
||||
func setTTSNeuTTSModel(_ value: String) { setSetting("tts.neutts.model", value: value) }
|
||||
func setTTSNeuTTSDevice(_ value: String) { setSetting("tts.neutts.device", value: value) }
|
||||
// v0.13: xAI TTS / Custom Voices. TODO(WS-8-Q2): grep-verify key
|
||||
// names against `~/.hermes/hermes-agent/hermes_cli/voice/tts.py`.
|
||||
func setTTSXAIVoiceID(_ value: String) { setSetting("tts.xai.voice_id", value: value) }
|
||||
func setTTSXAIModel(_ value: String) { setSetting("tts.xai.model", value: value) }
|
||||
func setSTTEnabled(_ value: Bool) { setSetting("stt.enabled", value: value ? "true" : "false") }
|
||||
func setSTTProvider(_ value: String) { setSetting("stt.provider", value: value) }
|
||||
func setSTTLocalModel(_ value: String) { setSetting("stt.local.model", value: value) }
|
||||
|
||||
@@ -152,8 +152,23 @@ struct PickerRow: View {
|
||||
let label: String
|
||||
let selection: String
|
||||
let options: [String]
|
||||
let optionLabel: ((String) -> String)?
|
||||
let onChange: (String) -> Void
|
||||
|
||||
init(
|
||||
label: String,
|
||||
selection: String,
|
||||
options: [String],
|
||||
optionLabel: ((String) -> String)? = nil,
|
||||
onChange: @escaping (String) -> Void
|
||||
) {
|
||||
self.label = label
|
||||
self.selection = selection
|
||||
self.options = options
|
||||
self.optionLabel = optionLabel
|
||||
self.onChange = onChange
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
SettingsRowLabel(label: label)
|
||||
@@ -162,7 +177,7 @@ struct PickerRow: View {
|
||||
set: { onChange($0) }
|
||||
)) {
|
||||
ForEach(options, id: \.self) { option in
|
||||
Text(option.isEmpty ? "(none)" : option).tag(option)
|
||||
Text(displayLabel(for: option)).tag(option)
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: 250)
|
||||
@@ -170,6 +185,13 @@ struct PickerRow: View {
|
||||
}
|
||||
.settingsRowChrome()
|
||||
}
|
||||
|
||||
private func displayLabel(for option: String) -> String {
|
||||
if let mapper = optionLabel {
|
||||
return mapper(option)
|
||||
}
|
||||
return option.isEmpty ? "(none)" : option
|
||||
}
|
||||
}
|
||||
|
||||
struct ToggleRow: View {
|
||||
|
||||
@@ -131,6 +131,8 @@ struct AdvancedTab: View {
|
||||
isOn: viewModel.config.redactionEnabled
|
||||
) { viewModel.setSetting("redaction.enabled", value: $0 ? "true" : "false") }
|
||||
|
||||
redactionDefaultsHint
|
||||
|
||||
ToggleRow(
|
||||
label: "Runtime metadata footer",
|
||||
isOn: viewModel.config.runtimeMetadataFooter
|
||||
@@ -138,6 +140,30 @@ struct AdvancedTab: View {
|
||||
}
|
||||
}
|
||||
|
||||
/// Inline hint below the redaction toggle. The server-side default
|
||||
/// flipped from OFF (v0.12) to ON (v0.13), but Scarf's parser still
|
||||
/// reads "absent key" as `false` — meaning a v0.13 host with no
|
||||
/// explicit key in `config.yaml` shows the toggle OFF while the
|
||||
/// agent treats redaction as ON. Hint copy disambiguates so users
|
||||
/// can tell what's actually happening server-side.
|
||||
@ViewBuilder
|
||||
private var redactionDefaultsHint: some View {
|
||||
let isV013 = capabilitiesStore?.capabilities.isV013OrLater ?? false
|
||||
HStack {
|
||||
Text("")
|
||||
.font(.caption)
|
||||
.frame(width: 160, alignment: .trailing)
|
||||
Text(isV013
|
||||
? "Recommended: ON. Hermes v0.13+ defaults to redacting secrets unless you opt out."
|
||||
: "Default OFF in Hermes v0.12. Toggle ON to redact secrets in logs and shares.")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
Spacer()
|
||||
}
|
||||
.padding(.horizontal, 12)
|
||||
.padding(.vertical, 4)
|
||||
}
|
||||
|
||||
private var backupSection: some View {
|
||||
SettingsSection(title: "Backup & Restore", icon: "externaldrive") {
|
||||
HStack {
|
||||
|
||||
@@ -7,6 +7,7 @@ import ScarfCore
|
||||
struct GeneralTab: View {
|
||||
@Bindable var viewModel: SettingsViewModel
|
||||
@Environment(AppCoordinator.self) private var coordinator
|
||||
@Environment(\.hermesCapabilities) private var capabilitiesStore
|
||||
|
||||
var body: some View {
|
||||
SettingsSection(title: "Model", icon: "cpu") {
|
||||
@@ -39,6 +40,20 @@ struct GeneralTab: View {
|
||||
|
||||
SettingsSection(title: "Locale", icon: "globe.americas") {
|
||||
EditableTextField(label: "Timezone (IANA)", value: viewModel.config.timezone) { viewModel.setTimezone($0) }
|
||||
// v0.13: `display.language` picker. Hidden on pre-v0.13 hosts
|
||||
// because writing the key would no-op silently. Two "English"
|
||||
// entries by design — empty string preserves "no key" semantics
|
||||
// (Hermes-default), explicit `en` pins it.
|
||||
if capabilitiesStore?.capabilities.hasDisplayLanguage == true {
|
||||
PickerRow(
|
||||
label: "Display language",
|
||||
selection: viewModel.config.display.language,
|
||||
options: viewModel.displayLanguages.map(\.code),
|
||||
optionLabel: { code in
|
||||
viewModel.displayLanguages.first { $0.code == code }?.label ?? code
|
||||
}
|
||||
) { viewModel.setDisplayLanguage($0) }
|
||||
}
|
||||
}
|
||||
|
||||
UpdatesSection()
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import SwiftUI
|
||||
import ScarfCore
|
||||
import ScarfDesign
|
||||
|
||||
/// Voice tab — push-to-talk + TTS + STT provider settings.
|
||||
struct VoiceTab: View {
|
||||
@Bindable var viewModel: SettingsViewModel
|
||||
@Environment(\.hermesCapabilities) private var capabilitiesStore
|
||||
|
||||
var body: some View {
|
||||
SettingsSection(title: "Push-to-Talk", icon: "mic") {
|
||||
@@ -28,6 +30,16 @@ struct VoiceTab: View {
|
||||
case "neutts":
|
||||
EditableTextField(label: "Model", value: viewModel.config.voice.ttsNeuTTSModel) { viewModel.setTTSNeuTTSModel($0) }
|
||||
PickerRow(label: "Device", selection: viewModel.config.voice.ttsNeuTTSDevice, options: ["cpu", "cuda"]) { viewModel.setTTSNeuTTSDevice($0) }
|
||||
case "xai":
|
||||
// v0.13: xAI TTS surface. Voice ID + Model are always
|
||||
// visible (xAI TTS shipped earlier); the cloning-supported
|
||||
// badge is gated on `hasXAIVoiceCloning` so pre-v0.13 hosts
|
||||
// see the input rows but no cloning advertisement.
|
||||
EditableTextField(label: "Voice ID", value: viewModel.config.voice.ttsXAIVoiceID) { viewModel.setTTSXAIVoiceID($0) }
|
||||
EditableTextField(label: "Model", value: viewModel.config.voice.ttsXAIModel) { viewModel.setTTSXAIModel($0) }
|
||||
if capabilitiesStore?.capabilities.hasXAIVoiceCloning == true {
|
||||
xaiCloningBadge
|
||||
}
|
||||
default:
|
||||
EmptyView()
|
||||
}
|
||||
@@ -49,4 +61,24 @@ struct VoiceTab: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Inline hint chip+caption shown below xAI's Voice ID + Model fields
|
||||
/// on v0.13+. References `hermes voice` because Scarf doesn't manage
|
||||
/// cloned voices in-app yet — the badge is discovery-only. Out-of-scope
|
||||
/// for v2.8: an in-app cloned-voice manager (would be its own feature).
|
||||
@ViewBuilder
|
||||
private var xaiCloningBadge: some View {
|
||||
HStack(alignment: .center, spacing: 8) {
|
||||
Text("")
|
||||
.font(.caption)
|
||||
.frame(width: 160, alignment: .trailing)
|
||||
ScarfBadge("Cloning supported", kind: .info)
|
||||
Text("Manage cloned voices in your terminal: `hermes voice` (xAI subcommands).")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
Spacer()
|
||||
}
|
||||
.padding(.horizontal, 12)
|
||||
.padding(.vertical, 4)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user