- Vendor ArkScope decorative layers (ScrambleTitle / IsometricWave) with provenance notes; decorative-only per AGENTS.md red lines - Migrate theme tokens to Arco, register the Arco theme, and add hook adapter composables (useMessage / useDialog / useNotification) with matching signatures - Sample pages: LoginView and AppSidebar on the new baseline; docs/arco-mapping.md and docs/ui-baseline.md land - agent-bridge: prefer the PM-selected venv from facts.json over legacy in-tree venvs (legacy lacks the mcp extra, so every MCP server showed 0 tools / not connected) - agent-bridge python (vendored, deliberate deviation): MCP discovery import fallback and pyyaml -> hermes_yaml so plugins and MCP work under the PM env; install the mcp extra via `hermes pm install --extra mcp` - Chat-chain fragment: docs/chat-chain-changes/2026-10-17-phase005-arkscope-baseline.md Verified: harness:check, test (2020 passed), test:e2e (30 passed), build all green; manual: plugins 100/0 warnings, MCP 6/6 servers connected with 104 tools.
89 lines
3.1 KiB
Vue
89 lines
3.1 KiB
Vue
<script setup lang="ts">
|
|
import { NInputNumber, NSelect } from 'naive-ui'
|
|
import { useMessage } from '@/composables/useMessage'
|
|
import { useI18n } from 'vue-i18n'
|
|
import { useSettingsStore } from '@/stores/hermes/settings'
|
|
import SettingRow from './SettingRow.vue'
|
|
|
|
const settingsStore = useSettingsStore()
|
|
const message = useMessage()
|
|
const { t } = useI18n()
|
|
|
|
// 防抖保存:每个字段独立定时器,300ms 内只发最后一次 HTTP 请求
|
|
const debounceTimers: Record<string, ReturnType<typeof setTimeout>> = {}
|
|
|
|
function save(values: Record<string, any>) {
|
|
// NSelect 等一次性操作,直接保存,不需要防抖
|
|
settingsStore.updateLocal('agent', values)
|
|
settingsStore.saveSection('agent', values).then(() => {
|
|
message.success(t('settings.saved'))
|
|
}).catch(() => {
|
|
message.error(t('settings.saveFailed'))
|
|
})
|
|
}
|
|
|
|
function debouncedSave(key: string, value: any) {
|
|
// 先立即更新本地 store(UI 即时响应)
|
|
settingsStore.updateLocal('agent', { [key]: value })
|
|
// 再防抖发 HTTP 保存
|
|
if (debounceTimers[key]) clearTimeout(debounceTimers[key])
|
|
debounceTimers[key] = setTimeout(async () => {
|
|
try {
|
|
await settingsStore.saveSection('agent', { [key]: value })
|
|
message.success(t('settings.saved'))
|
|
} catch (err: any) {
|
|
message.error(t('settings.saveFailed'))
|
|
}
|
|
}, 300)
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<section class="settings-section">
|
|
<SettingRow :label="t('settings.agent.maxTurns')" :hint="t('settings.agent.maxTurnsHint')">
|
|
<NInputNumber
|
|
:value="settingsStore.agent.max_turns"
|
|
:min="1" :max="200" :step="5"
|
|
size="small" class="input-sm"
|
|
@update:value="v => v != null && debouncedSave('max_turns', v)"
|
|
/>
|
|
</SettingRow>
|
|
<SettingRow :label="t('settings.agent.gatewayTimeout')" :hint="t('settings.agent.gatewayTimeoutHint')">
|
|
<NInputNumber
|
|
:value="settingsStore.agent.gateway_timeout"
|
|
:min="60" :max="7200" :step="60"
|
|
size="small" class="input-sm"
|
|
@update:value="v => v != null && debouncedSave('gateway_timeout', v)"
|
|
/>
|
|
</SettingRow>
|
|
<SettingRow :label="t('settings.agent.restartDrainTimeout')" :hint="t('settings.agent.restartDrainTimeoutHint')">
|
|
<NInputNumber
|
|
:value="settingsStore.agent.restart_drain_timeout"
|
|
:min="10" :max="300" :step="10"
|
|
size="small" class="input-sm"
|
|
@update:value="v => v != null && debouncedSave('restart_drain_timeout', v)"
|
|
/>
|
|
</SettingRow>
|
|
<SettingRow :label="t('settings.agent.toolEnforcement')" :hint="t('settings.agent.toolEnforcementHint')">
|
|
<NSelect
|
|
:value="settingsStore.agent.tool_use_enforcement || 'auto'"
|
|
:options="[
|
|
{ label: t('settings.agent.auto'), value: 'auto' },
|
|
{ label: t('settings.agent.always'), value: 'always' },
|
|
{ label: t('settings.agent.never'), value: 'never' },
|
|
]"
|
|
size="small" class="input-sm"
|
|
@update:value="v => save({ tool_use_enforcement: v })"
|
|
/>
|
|
</SettingRow>
|
|
</section>
|
|
</template>
|
|
|
|
<style scoped lang="scss">
|
|
@use '@/styles/variables' as *;
|
|
|
|
.settings-section {
|
|
margin-top: 16px;
|
|
}
|
|
</style>
|