feat(hermes): add display run controls

This commit is contained in:
晴天
2026-05-25 03:49:41 +08:00
parent 054e45a8b3
commit a22b5b503d
6 changed files with 165 additions and 2 deletions

View File

@@ -88,6 +88,8 @@ const DISPLAY_DEFAULTS = {
displayFileMutationVerifier: true,
displayLanguage: 'en',
displayResumeDisplay: 'full',
displayBusyInputMode: 'interrupt',
displayBackgroundProcessNotifications: 'all',
}
const HUMAN_DELAY_DEFAULTS = {
@@ -191,6 +193,8 @@ const IMAGE_INPUT_MODES = ['auto', 'native', 'text']
const DISPLAY_TOOL_PROGRESS_VALUES = ['off', 'new', 'all', 'verbose']
const DISPLAY_LANGUAGE_VALUES = ['en', 'zh', 'zh-hant', 'ja', 'de', 'es', 'fr', 'tr', 'uk', 'af', 'ko', 'it', 'ga', 'pt', 'ru', 'hu']
const DISPLAY_RESUME_VALUES = ['full', 'minimal']
const DISPLAY_BUSY_INPUT_MODES = ['interrupt', 'queue', 'steer']
const DISPLAY_BACKGROUND_PROCESS_NOTIFICATIONS = ['off', 'result', 'error', 'all']
const HUMAN_DELAY_MODES = ['off', 'natural', 'custom']
const APPROVAL_MODES = ['manual', 'smart', 'off']
const APPROVAL_CRON_MODES = ['deny', 'approve']
@@ -781,6 +785,18 @@ export function render() {
${DISPLAY_RESUME_VALUES.map(mode => option(`engine.hermesDisplayConfigResumeDisplay_${mode}`, mode, displayValues.displayResumeDisplay)).join('')}
</select>
</label>
<label class="hm-field">
<span class="hm-field-label">${t('engine.hermesDisplayConfigBusyInputMode')}</span>
<select id="hm-display-busy-input-mode" class="hm-input" ${disabled ? 'disabled' : ''}>
${DISPLAY_BUSY_INPUT_MODES.map(mode => option(`engine.hermesDisplayConfigBusyInputMode_${mode}`, mode, displayValues.displayBusyInputMode)).join('')}
</select>
</label>
<label class="hm-field">
<span class="hm-field-label">${t('engine.hermesDisplayConfigBackgroundProcessNotifications')}</span>
<select id="hm-display-background-process-notifications" class="hm-input" ${disabled ? 'disabled' : ''}>
${DISPLAY_BACKGROUND_PROCESS_NOTIFICATIONS.map(mode => option(`engine.hermesDisplayConfigBackgroundProcessNotifications_${mode}`, mode, displayValues.displayBackgroundProcessNotifications)).join('')}
</select>
</label>
<label class="hm-field">
<span class="hm-field-label">${t('engine.hermesDisplayConfigRuntimeFooterFields')}</span>
<textarea id="hm-display-runtime-footer-fields" class="hm-input" ${disabled ? 'disabled' : ''} style="min-height:96px;resize:vertical">${esc(displayValues.displayRuntimeFooterFields)}</textarea>
@@ -2159,6 +2175,8 @@ export function render() {
displayFileMutationVerifier: !!el.querySelector('#hm-display-file-mutation-verifier')?.checked,
displayLanguage: el.querySelector('#hm-display-language')?.value || 'en',
displayResumeDisplay: el.querySelector('#hm-display-resume-display')?.value || 'full',
displayBusyInputMode: el.querySelector('#hm-display-busy-input-mode')?.value || 'interrupt',
displayBackgroundProcessNotifications: el.querySelector('#hm-display-background-process-notifications')?.value || 'all',
}
displaySaving = true
displayError = null

View File

@@ -766,7 +766,7 @@ export default {
hermesUnauthorizedDmConfigBehavior_ignore: _('静默忽略', 'Silently ignore', '靜默忽略'),
hermesUnauthorizedDmConfigFootnote: _('pair 是默认值会拒绝访问但在私信中回复一次性配对码ignore 会静默丢弃陌生私信。平台级覆盖仍可在渠道配置或 raw YAML 中单独设置。', 'pair is the default: Hermes denies access but replies with a one-time pairing code in DMs. ignore silently drops unknown DMs. Platform-level overrides can still be set in channel settings or raw YAML.', 'pair 是預設值會拒絕存取但在私訊中回覆一次性配對碼ignore 會靜默丟棄陌生私訊。平台級覆蓋仍可在頻道設定或 raw YAML 中單獨設定。'),
hermesDisplayConfigTitle: _('全局显示与可靠性', 'Global display and reliability', '全域顯示與可靠性'),
hermesDisplayConfigDesc: _('控制消息平台和 CLI 的默认进度展示、静态提示语言、运行信息页脚,以及文件写入失败校验。', 'Control default progress display, static prompt language, runtime footer, and failed file-mutation verification for messaging platforms and CLI.', '控制訊息平台和 CLI 的預設進度顯示、靜態提示語言、執行資訊頁腳,以及檔案寫入失敗校驗。'),
hermesDisplayConfigDesc: _('控制消息平台和 CLI 的默认进度展示、忙时输入、后台进程通知、静态提示语言、运行信息页脚,以及文件写入失败校验。', 'Control default progress display, busy input handling, background process notifications, static prompt language, runtime footer, and failed file-mutation verification for messaging platforms and CLI.', '控制訊息平台和 CLI 的預設進度顯示、忙時輸入、背景程序通知、靜態提示語言、執行資訊頁腳,以及檔案寫入失敗校驗。'),
hermesDisplayConfigStatusReady: _('结构化配置', 'structured settings', '結構化設定'),
hermesDisplayConfigSave: _('保存显示设置', 'Save display settings', '儲存顯示設定'),
hermesDisplayConfigSaveSuccess: _('显示与可靠性配置已保存,建议重启 Hermes Gateway 生效', 'Display and reliability settings saved. Restart Hermes Gateway to take effect.', '顯示與可靠性設定已儲存,建議重啟 Hermes Gateway 生效'),
@@ -802,7 +802,16 @@ export default {
hermesDisplayConfigResumeDisplay: _('恢复会话展示', 'Resume display', '恢復會話顯示'),
hermesDisplayConfigResumeDisplay_full: _('显示完整上下文', 'Show full context', '顯示完整上下文'),
hermesDisplayConfigResumeDisplay_minimal: _('仅显示一行摘要', 'Show one-line summary', '僅顯示一行摘要'),
hermesDisplayConfigFootnote: _('这里写入全局 display 配置平台级覆盖仍在渠道页管理。display.streaming 是 CLI-only本面板不会把它误写成 Gateway 全局流式设置。运行信息字段支持 model、context_pct、cwd、duration、tokens、cost。', 'This writes global display settings; per-platform overrides remain in channel settings. display.streaming is CLI-only, so this panel does not write it as a global Gateway streaming setting. Runtime footer fields support model, context_pct, cwd, duration, tokens, and cost.', '這裡寫入全域 display 設定平台級覆蓋仍在頻道頁管理。display.streaming 是 CLI-only本面板不會把它誤寫成 Gateway 全域串流設定。執行資訊欄位支援 model、context_pct、cwd、duration、tokens、cost。'),
hermesDisplayConfigBusyInputMode: _('忙时输入处理', 'Busy input handling', '忙時輸入處理'),
hermesDisplayConfigBusyInputMode_interrupt: _('打断当前执行', 'Interrupt current run', '打斷目前執行'),
hermesDisplayConfigBusyInputMode_queue: _('排队到下一轮', 'Queue for next turn', '排隊到下一輪'),
hermesDisplayConfigBusyInputMode_steer: _('尝试中途引导', 'Steer current run', '嘗試中途引導'),
hermesDisplayConfigBackgroundProcessNotifications: _('后台进程通知', 'Background process notifications', '背景程序通知'),
hermesDisplayConfigBackgroundProcessNotifications_off: _('关闭通知', 'Off', '關閉通知'),
hermesDisplayConfigBackgroundProcessNotifications_result: _('仅完成结果', 'Final result only', '僅完成結果'),
hermesDisplayConfigBackgroundProcessNotifications_error: _('仅失败结果', 'Errors only', '僅失敗結果'),
hermesDisplayConfigBackgroundProcessNotifications_all: _('运行输出与结果', 'Running output and result', '執行輸出與結果'),
hermesDisplayConfigFootnote: _('这里写入全局 display 配置;平台级覆盖仍在渠道页管理。忙时输入控制长跑期间新消息如何处理,后台进程通知控制 messaging watcher 噪音。display.streaming 是 CLI-only本面板不会把它误写成 Gateway 全局流式设置。运行信息字段支持 model、context_pct、cwd、duration、tokens、cost。', 'This writes global display settings; per-platform overrides remain in channel settings. Busy input controls how new messages are handled during long runs, and background process notifications tune messaging watcher noise. display.streaming is CLI-only, so this panel does not write it as a global Gateway streaming setting. Runtime footer fields support model, context_pct, cwd, duration, tokens, and cost.', '這裡寫入全域 display 設定;平台級覆蓋仍在頻道頁管理。忙時輸入控制長跑期間新訊息如何處理,背景程序通知控制 messaging watcher 噪音。display.streaming 是 CLI-only本面板不會把它誤寫成 Gateway 全域串流設定。執行資訊欄位支援 model、context_pct、cwd、duration、tokens、cost。'),
hermesHumanDelayConfigTitle: _('响应节奏', 'Response pacing', '回應節奏'),
hermesHumanDelayConfigDesc: _('控制消息平台回复分块之间的等待时间,降低刷屏或模拟更自然发送节奏。', 'Control the wait time between reply chunks on messaging platforms to reduce flooding or mimic a more natural sending rhythm.', '控制訊息平台回覆分塊之間的等待時間,降低刷屏或模擬更自然的傳送節奏。'),
hermesHumanDelayConfigStatusReady: _('结构化配置', 'structured settings', '結構化設定'),