release: prepare Desktop 0.13.12 and Agent 0.13.3
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build darwin arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build darwin arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux x64 Agent (push) Canceled after 0s
Complete the pending Supervisor changes with opt-in execution, incremental automatic reviews, and activity history. Preserve saved preferences and plans, skip model calls for unchanged input, and keep full replay and cancellation limitations explicit. Update both release versions, bilingual notes, feature matrices, migration fixtures, and validation evidence. Clear stale browser errors after a successful close retry. Focused validation passed 690 tests across 35 files, plus notes verification, typecheck, and lint; full CI and native release acceptance remain pending. No local production build or packaging was run. Release note: Enable Supervisor to review work, trace story graphs, and inspect manual or automatic activity without repeating model calls for unchanged input. Desktop 0.13.12 and Agent 0.13.3 also prepare idle remote Runtime cleanup and retirement of replaced Agents; update Desktop before the Host environment. Database upgrades require a pre-upgrade backup for rollback.
This commit is contained in:
@@ -691,6 +691,7 @@ const api: DesktopApi = {
|
||||
history: vi.fn(async () => ({ runs: [], entries: [] })),
|
||||
},
|
||||
supervision: {
|
||||
activity: vi.fn(async () => []),
|
||||
overview: vi.fn(async () => []),
|
||||
run: vi.fn(async () => undefined),
|
||||
graph: vi.fn(async () => ({ storyLine: null, events: [], entities: [], relations: [], sources: [] })),
|
||||
@@ -13003,13 +13004,15 @@ describe("App", () => {
|
||||
});
|
||||
|
||||
it("shows retryable page-local Supervisor errors without first-time guidance", async () => {
|
||||
vi.mocked(api.supervision.overview).mockRejectedValueOnce(
|
||||
new Error("监督者数据库暂时不可用"),
|
||||
);
|
||||
vi.mocked(api.supervision.overview).mockImplementation(async (request) => {
|
||||
if (request?.target) return [];
|
||||
throw new Error("监督者数据库暂时不可用");
|
||||
});
|
||||
render(<App />);
|
||||
|
||||
fireEvent.click(await screen.findByRole("button", { name: "监督者" }));
|
||||
expect(await screen.findByText("监督者加载失败")).toBeInTheDocument();
|
||||
vi.mocked(api.supervision.overview).mockResolvedValue([]);
|
||||
const retry = await screen.findByRole("button", { name: "重试" });
|
||||
fireEvent.click(retry);
|
||||
await waitFor(() =>
|
||||
|
||||
@@ -11432,6 +11432,7 @@ function App(): React.JSX.Element {
|
||||
}
|
||||
>
|
||||
{isApplicationEnabled(applicationSettings, 'heartbeat') ? <HeartbeatCenter
|
||||
active={view === 'heartbeat'}
|
||||
graphNavigation={supervisionGraphNavigation}
|
||||
configs={assistantHeartbeats}
|
||||
entries={heartbeatEntries}
|
||||
@@ -11739,6 +11740,7 @@ function App(): React.JSX.Element {
|
||||
browserStates={browserStates}
|
||||
conversationTitles={conversationTitles}
|
||||
currentProject={activeProject}
|
||||
supervisionEnabled={isApplicationEnabled(applicationSettings, 'heartbeat')}
|
||||
supervisionLibraries={knowledgeSnapshot.libraries}
|
||||
onOpenSupervisionGraph={(resultId) => {
|
||||
requestWorkspaceLeave('heartbeat', () => {
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
ApplicationAvailability,
|
||||
ApplicationCenter,
|
||||
ApplicationSettingsView,
|
||||
isApplicationEnabled,
|
||||
} from './ApplicationCenter'
|
||||
|
||||
const settings = applicationSettingsSchema.parse({
|
||||
@@ -107,15 +108,56 @@ describe('Application Center', () => {
|
||||
|
||||
it('provides a supervisor enable switch while preserving the heartbeat route id', () => {
|
||||
const handlers = props()
|
||||
render(<ApplicationCenter {...handlers} />)
|
||||
render(<ApplicationCenter {...handlers} settings={{ ...settings, heartbeatEnabled: true }} />)
|
||||
const card = screen.getByText('监督者', { exact: true }).closest('article')!
|
||||
expect(within(card).getByText('可选 · 已启用')).toBeInTheDocument()
|
||||
fireEvent.click(within(card).getByRole('button', { name: '打开' }))
|
||||
expect(handlers.onOpen).toHaveBeenCalledWith('heartbeat')
|
||||
fireEvent.click(within(card).getByRole('button', { name: '监督者 应用设置' }))
|
||||
const enable = screen.getByRole('switch', { name: '启用应用' })
|
||||
expect(enable).toBeChecked()
|
||||
fireEvent.click(enable)
|
||||
expect(handlers.onUpdate).toHaveBeenLastCalledWith({ heartbeatEnabled: false })
|
||||
})
|
||||
|
||||
it.each([undefined, false])('keeps the supervisor disabled with preference %s until explicitly enabled', (heartbeatEnabled) => {
|
||||
const handlers = props()
|
||||
render(<ApplicationCenter {...handlers} settings={{ ...settings, heartbeatEnabled }} />)
|
||||
const card = screen.getByText('监督者', { exact: true }).closest('article')!
|
||||
expect(within(card).getByText('可选 · 已关闭')).toBeInTheDocument()
|
||||
const open = within(card).getByRole('button', { name: '打开' })
|
||||
expect(open).toBeDisabled()
|
||||
fireEvent.click(open)
|
||||
expect(handlers.onOpen).not.toHaveBeenCalled()
|
||||
fireEvent.click(within(card).getByRole('button', { name: '监督者 应用设置' }))
|
||||
const enable = screen.getByRole('switch', { name: '启用应用' })
|
||||
expect(enable).not.toBeChecked()
|
||||
fireEvent.click(enable)
|
||||
expect(handlers.onUpdate).toHaveBeenLastCalledWith({ heartbeatEnabled: true })
|
||||
})
|
||||
|
||||
it.each([
|
||||
{ state: 'loading', settings: undefined },
|
||||
{ state: 'missing preference', settings },
|
||||
{ state: 'explicitly disabled', settings: { ...settings, heartbeatEnabled: false } },
|
||||
])('hides supervisor content when settings are $state', ({ settings: current }) => {
|
||||
const enabled = isApplicationEnabled(current, 'heartbeat')
|
||||
expect(enabled).toBe(false)
|
||||
const { rerender } = render(
|
||||
<ApplicationAvailability enabled={enabled}>
|
||||
<button>Supervisor content</button>
|
||||
</ApplicationAvailability>,
|
||||
)
|
||||
expect(screen.queryByRole('button', { name: 'Supervisor content' })).not.toBeInTheDocument()
|
||||
expect(screen.getByText('Supervisor content')).not.toBeVisible()
|
||||
expect(screen.getByText('Supervisor content').closest('.application-page-content')).toHaveAttribute('inert')
|
||||
rerender(
|
||||
<ApplicationAvailability enabled={isApplicationEnabled({ ...settings, heartbeatEnabled: true }, 'heartbeat')}>
|
||||
<button>Supervisor content</button>
|
||||
</ApplicationAvailability>,
|
||||
)
|
||||
expect(screen.getByRole('button', { name: 'Supervisor content' })).toBeVisible()
|
||||
})
|
||||
it('searches disabled and unpinned applications, opens without pinning, and restores focus', () => {
|
||||
const handlers = props()
|
||||
const trigger = document.createElement('button')
|
||||
|
||||
@@ -57,7 +57,7 @@ export function isApplicationEnabled(
|
||||
id: BuiltInApplicationId,
|
||||
): boolean {
|
||||
if (id === 'knowledge') return true
|
||||
if (id === 'heartbeat' && settings === undefined) return true
|
||||
if (id === 'heartbeat') return settings?.heartbeatEnabled === true
|
||||
return (
|
||||
settings !== undefined &&
|
||||
settings[applicationDefinitions[id].enabled] !== false
|
||||
|
||||
@@ -23,7 +23,7 @@ function Harness({ value = settings, pending = false, error, onOpen = vi.fn(), o
|
||||
afterEach(() => { cleanup(); vi.restoreAllMocks(); vi.unstubAllGlobals() })
|
||||
|
||||
it('filters the shared order by enablement only, including reordered always-shown apps', () => {
|
||||
const value = { ...settings, magicNotesEnabled: true, localInferenceEnabled: true,
|
||||
const value = { ...settings, magicNotesEnabled: true, localInferenceEnabled: true, heartbeatEnabled: true,
|
||||
applicationNavigation: { order: ['local-inference', 'heartbeat', 'magic-notes', 'knowledge'] as ApplicationSettings['applicationNavigation']['order'],
|
||||
pinned: { 'magic-notes': false, heartbeat: true, 'local-inference': false } } }
|
||||
const onOpen = vi.fn()
|
||||
@@ -37,13 +37,13 @@ it('filters the shared order by enablement only, including reordered always-show
|
||||
expect(screen.queryByRole('menu')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('shows loading and actionable errors without treating unknown settings as disabled', () => {
|
||||
it('shows loading and actionable errors while keeping Supervisor unavailable until enabled', () => {
|
||||
const onRetry = vi.fn()
|
||||
const { rerender } = render(<Harness value={null} pending onRetry={onRetry} />)
|
||||
fireEvent.click(screen.getByText('Launcher'))
|
||||
expect(screen.getByRole('status')).toBeInTheDocument()
|
||||
expect(screen.getByRole('menuitem', { name: '知识库' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('menuitem', { name: '监督者' })).toBeInTheDocument()
|
||||
expect(screen.queryByRole('menuitem', { name: '监督者' })).not.toBeInTheDocument()
|
||||
rerender(<Harness value={null} error="Cannot read settings" onRetry={onRetry} />)
|
||||
expect(screen.queryByRole('status')).not.toBeInTheDocument()
|
||||
expect(screen.getByRole('alert')).toHaveTextContent('Cannot read settings')
|
||||
|
||||
@@ -4,7 +4,8 @@ import {
|
||||
fireEvent,
|
||||
render as renderComponent,
|
||||
screen,
|
||||
waitFor
|
||||
waitFor,
|
||||
within
|
||||
} from '@testing-library/react'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type {
|
||||
@@ -23,6 +24,8 @@ import { supervisionRunRequestSchema } from '../../shared/supervision-contracts'
|
||||
import { PageShell } from './WorkspacePrimitives'
|
||||
import i18n from './i18n'
|
||||
|
||||
afterEach(cleanup)
|
||||
|
||||
const config: AssistantHeartbeatConfig = {
|
||||
id: 'heartbeat-1',
|
||||
scope: {
|
||||
@@ -171,34 +174,167 @@ describe('HeartbeatCenter', () => {
|
||||
graph: vi.fn(async () => ({ storyLine: null, events: [], entities: [], relations: [], sources: [], eventEntities: [], eventSources: [] }))
|
||||
} })
|
||||
})
|
||||
function render(ui: React.ReactElement) {
|
||||
function render(ui: React.ReactElement, overview = true) {
|
||||
const result = renderComponent(ui)
|
||||
fireEvent.click(screen.getByRole('tab', { name: i18n.t('supervisor.settings', { ns: 'heartbeat' }) }))
|
||||
if (overview && screen.queryByRole('tab', { name: i18n.t('center.tabs.overview', { ns: 'heartbeat' }) })) {
|
||||
fireEvent.click(screen.getByRole('tab', { name: i18n.t('center.tabs.overview', { ns: 'heartbeat' }) }))
|
||||
}
|
||||
return result
|
||||
}
|
||||
afterEach(async () => {
|
||||
cleanup()
|
||||
vi.unstubAllGlobals()
|
||||
await i18n.changeLanguage('zh-CN')
|
||||
})
|
||||
|
||||
it('keeps unified review and graph tabs inside the supervisor shell', async () => {
|
||||
it.each(['zh-CN', 'en-US'])('keeps tab titles unique and preserves content titles, scope and actions (%s)', async (language) => {
|
||||
await i18n.changeLanguage(language)
|
||||
const t = (key: string) => i18n.t(key, { ns: 'heartbeat' })
|
||||
vi.stubGlobal('goodbuddy', { supervision: {
|
||||
overview: vi.fn(async () => [{ id: 'result', storyLineId: 'story', sourceId: null, summary: 'Review summary', changeDigest: '', createdAt: '2026-09-22T00:00:00Z', scope: { kind: 'global' }, timeRange: { from: '2026-09-01T00:00:00Z', to: '2026-09-22T00:00:00Z' }, openItems: [] }]),
|
||||
graph: vi.fn(async () => ({ storyLine: null, events: [
|
||||
activity: vi.fn(async () => []),
|
||||
graph: vi.fn(async () => ({ storyLine: { id: 'story', scope_json: JSON.stringify({ kind: 'global' }) }, events: [
|
||||
{ id: 'event', title: 'Review event', description: 'Progress', occurred_at: '2026-09-21T00:00:00.000Z' }
|
||||
], entities: [], relations: [], sources: [], eventEntities: [], eventSources: [] }))
|
||||
} })
|
||||
renderComponent(<PageShell variant="supervisor"><HeartbeatCenter {...createProps()} /></PageShell>)
|
||||
const props = createProps()
|
||||
renderComponent(<PageShell variant="supervisor"><HeartbeatCenter {...props} /></PageShell>)
|
||||
await screen.findByText('Review summary')
|
||||
expect(screen.getByRole('heading', { name: '监督者' }).closest('.page-shell')).toHaveClass('page-shell--supervisor')
|
||||
fireEvent.click(screen.getByRole('tab', { name: '故事线图谱' }))
|
||||
expect(screen.getByRole('tabpanel', { name: '故事线图谱' })).toContainElement(screen.getByRole('region', { name: '故事图谱画布' }))
|
||||
expect(screen.getByRole('complementary', { name: '图谱选择' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('complementary', { name: '详情与来源' })).toBeInTheDocument()
|
||||
fireEvent.click(screen.getByRole('tab', { name: '设置' }))
|
||||
expect(screen.getAllByRole('heading', { level: 1 })).toHaveLength(1)
|
||||
expect(screen.getByRole('heading', { level: 2, name: '设置' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('heading', { level: 1, name: t('center.title') }).closest('.page-shell')).toHaveClass('page-shell--supervisor')
|
||||
expect(screen.getByRole('heading', { name: t('supervisor.latest') })).toBeVisible()
|
||||
expect(screen.getByRole('button', { name: t('supervisor.run') })).toBeEnabled()
|
||||
expect(screen.getByRole('combobox', { name: t('supervisor.scope') })).toBeVisible()
|
||||
expect(screen.getByText(t('supervisor.sourcesHint'))).toBeVisible()
|
||||
for (const key of ['supervisor.recap', 'supervisor.graph', 'activity.title', 'supervisor.settings']) {
|
||||
fireEvent.click(screen.getByRole('tab', { name: t(key) }))
|
||||
const panel = screen.getByRole('tabpanel', { name: t(key) })
|
||||
expect(screen.getAllByRole('heading', { level: 1 })).toHaveLength(1)
|
||||
expect(within(panel).queryByRole('heading', { name: t(key) })).not.toBeInTheDocument()
|
||||
expect(within(panel).getByRole('button', { name: key === 'supervisor.settings' ? t('center.actions.refreshAriaLabel') : t('center.actions.refresh') })).toBeVisible()
|
||||
if (key === 'supervisor.graph') {
|
||||
expect(within(panel).getByRole('region', { name: t('supervisor.canvas') })).toBeVisible()
|
||||
expect(within(panel).getByRole('heading', { name: t('supervisor.inspector') })).toBeVisible()
|
||||
expect(within(panel).getByText(`${t('supervisor.graphScope')}: ${t('center.scope.global')}`)).toBeVisible()
|
||||
}
|
||||
if (key === 'activity.title') {
|
||||
await screen.findByText(t('activity.empty'))
|
||||
expect(within(panel).getByText(t('activity.description'))).toBeVisible()
|
||||
expect(panel.querySelector('.scope-badge')).toBeVisible()
|
||||
}
|
||||
}
|
||||
expect(screen.getByRole('heading', { name: t('settings.title') })).toBeVisible()
|
||||
expect(screen.getByText(t('settings.scheduleHelp'))).toBeVisible()
|
||||
expect(screen.getByRole('button', { name: t('settings.enableAriaLabel') })).toBeEnabled()
|
||||
expect(screen.getByRole('button', { name: i18n.t('settings.runNowAriaLabel', { ns: 'heartbeat', name: config.name }) })).toBeVisible()
|
||||
expect(document.querySelector('.supervisor-workspace__action-bar .scope-badge')).toBeVisible()
|
||||
fireEvent.click(screen.getByRole('button', { name: t('center.actions.refreshAriaLabel') }))
|
||||
await waitFor(() => expect(props.onRefresh).toHaveBeenCalledOnce())
|
||||
})
|
||||
|
||||
it('opens an Activity result outside the latest reviews and stops activity reads on tab exit', async () => {
|
||||
const old = { id: 'old', storyLineId: 'story', sourceId: null, summary: 'Older review body', changeDigest: '', createdAt: '2026-09-01T00:00:00Z', scope: { kind: 'global' }, timeRange: { from: '2026-08-01T00:00:00Z', to: '2026-09-01T00:00:00Z' }, openItems: [] }
|
||||
const overview = vi.fn(async (input?: { resultId?: string }) => input?.resultId === 'old' ? [old] : [])
|
||||
const graph = vi.fn(async () => ({ storyLine: null, events: [], entities: [], relations: [], sources: [], eventEntities: [], eventSources: [] }))
|
||||
const activity = vi.fn(async () => [{ id: 'run', kind: 'supervision', trigger: 'manual', status: 'completed', scope: old.scope, startedAt: old.createdAt, completedAt: old.createdAt, timeRange: old.timeRange, error: null, summary: 'Activity summary', resultId: 'old', heartbeatStatus: null, supervisionStatus: 'completed' }])
|
||||
vi.stubGlobal('goodbuddy', { supervision: { overview, graph, activity } })
|
||||
renderComponent(<HeartbeatCenter {...createProps()} />)
|
||||
expect(screen.getAllByRole('tab').map((tab) => tab.textContent)).toEqual(['工作回顾', '故事线图谱', '活动', '设置'])
|
||||
fireEvent.click(screen.getByRole('tab', { name: '活动' }))
|
||||
fireEvent.click(await screen.findByRole('button', { name: '查看回顾' }))
|
||||
expect(await screen.findByText('Older review body')).toBeVisible()
|
||||
expect(screen.getByRole('tab', { name: '工作回顾' })).toHaveAttribute('aria-selected', 'true')
|
||||
expect(overview).toHaveBeenCalledWith({ resultId: 'old' })
|
||||
expect(graph).toHaveBeenLastCalledWith({ resultId: 'old', storyLineId: 'story' })
|
||||
fireEvent.click(screen.getByRole('tab', { name: '活动' }))
|
||||
fireEvent.click(await screen.findByRole('button', { name: '在图谱中查看' }))
|
||||
expect(screen.getByRole('tab', { name: '故事线图谱' })).toHaveAttribute('aria-selected', 'true')
|
||||
await waitFor(() => expect(graph).toHaveBeenCalledTimes(2))
|
||||
})
|
||||
|
||||
it.each(['zh-CN', 'en-US'])('opens complete automatic supervision settings without creating defaults (%s)', async (language) => {
|
||||
await i18n.changeLanguage(language)
|
||||
const props = createProps({ configs: [], runs: [], entries: [] })
|
||||
render(<HeartbeatCenter {...props} />, false)
|
||||
const t = (key: string) => i18n.t(key, { ns: 'heartbeat' })
|
||||
expect(screen.getByRole('tab', { name: t('center.tabs.plans') })).toHaveAttribute('aria-selected', 'true')
|
||||
expect(screen.getByText(t('settings.empty'))).toBeVisible()
|
||||
expect(screen.getByText(t('settings.scheduleHelp'))).toBeVisible()
|
||||
expect(screen.getByLabelText(t('settings.recurrenceAriaLabel'))).toHaveValue('daily')
|
||||
expect(screen.getByLabelText(t('settings.timeAriaLabel'))).toHaveValue('09:00')
|
||||
expect(screen.getByLabelText(t('settings.lookbackAriaLabel'))).toHaveValue(48)
|
||||
expect(screen.getByLabelText(t('settings.retentionAriaLabel'))).toHaveValue(90)
|
||||
expect(screen.getByRole('button', { name: t('settings.scope.projects') })).toBeVisible()
|
||||
fireEvent.change(screen.getByLabelText(t('settings.recurrenceAriaLabel')), { target: { value: 'weekly' } })
|
||||
expect(screen.getByLabelText(t('settings.weekdayAriaLabel'))).toBeVisible()
|
||||
expect(props.onCreate).not.toHaveBeenCalled()
|
||||
expect(props.onUpdate).not.toHaveBeenCalled()
|
||||
expect(props.onRunNow).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it.each(['daily', 'weekly'])('saves the explicitly configured %s plan and rejects invalid windows', async (frequency) => {
|
||||
const props = createProps({ configs: [], runs: [], entries: [] })
|
||||
render(<HeartbeatCenter {...props} />, false)
|
||||
fireEvent.change(screen.getByLabelText('监督频率'), { target: { value: frequency } })
|
||||
if (frequency === 'weekly') fireEvent.change(screen.getByLabelText('监督星期'), { target: { value: '5' } })
|
||||
fireEvent.change(screen.getByLabelText('监督时间'), { target: { value: '16:35' } })
|
||||
fireEvent.change(screen.getByLabelText('回顾窗口(小时)'), { target: { value: '0' } })
|
||||
expect(screen.getByRole('button', { name: '保存并启用计划' })).toBeDisabled()
|
||||
fireEvent.change(screen.getByLabelText('回顾窗口(小时)'), { target: { value: '168' } })
|
||||
fireEvent.change(screen.getByLabelText('历史保留(天)'), { target: { value: '30' } })
|
||||
fireEvent.click(screen.getByRole('button', { name: '保存并启用计划' }))
|
||||
await waitFor(() => expect(props.onCreate).toHaveBeenCalledExactlyOnceWith({
|
||||
name: '定期回顾', scope: { kind: 'global' }, enabled: true,
|
||||
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC',
|
||||
recurrence: frequency === 'weekly'
|
||||
? { type: 'weekly', localTime: '16:35', weekday: 5 }
|
||||
: { type: 'daily', localTime: '16:35' },
|
||||
lookbackHours: 168, retentionDays: 30
|
||||
}))
|
||||
expect(props.onRunNow).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('preserves a paused weekly plan and its time zone across failed edits and retry', async () => {
|
||||
const saved: AssistantHeartbeatConfig = {
|
||||
...config, enabled: false, timezone: 'Pacific/Honolulu',
|
||||
recurrence: { type: 'weekly', weekday: 3, localTime: '17:45' }
|
||||
}
|
||||
const onUpdate = vi.fn(async () => {}).mockRejectedValueOnce(new Error('保存失败,请重试'))
|
||||
const props = createProps({ configs: [saved], onUpdate })
|
||||
render(<HeartbeatCenter {...props} />, false)
|
||||
expect(screen.getByText('所有自动监督计划已暂停,目前仅支持手动回顾。')).toBeVisible()
|
||||
expect(screen.getByText('周三 17:45 · Pacific/Honolulu')).toBeVisible()
|
||||
expect(screen.getByText('回顾最近 48 小时 · 运行历史保留 90 天')).toBeVisible()
|
||||
fireEvent.click(screen.getByRole('button', { name: `编辑 ${config.name}` }))
|
||||
expect(screen.getByLabelText('监督频率')).toHaveValue('weekly')
|
||||
expect(screen.getByLabelText('监督星期')).toHaveValue('3')
|
||||
expect(screen.getByText(/计划时区:Pacific\/Honolulu/)).toBeVisible()
|
||||
fireEvent.change(screen.getByLabelText('计划名称'), { target: { value: '每周复盘' } })
|
||||
fireEvent.click(screen.getByRole('button', { name: '保存自动监督计划' }))
|
||||
expect(await screen.findByRole('alert')).toHaveTextContent('保存失败,请重试')
|
||||
expect(screen.getByLabelText('计划名称')).toHaveValue('每周复盘')
|
||||
fireEvent.click(screen.getByRole('button', { name: '保存自动监督计划' }))
|
||||
await waitFor(() => expect(onUpdate).toHaveBeenCalledTimes(2))
|
||||
expect(onUpdate).toHaveBeenLastCalledWith(config.id, {
|
||||
name: '每周复盘', scope: config.scope, timezone: saved.timezone,
|
||||
recurrence: saved.recurrence, enabled: false, lookbackHours: 48, retentionDays: 90
|
||||
})
|
||||
expect(props.onCreate).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('keeps pause, resume, run and confirmed deletion available directly in settings', async () => {
|
||||
const props = createProps()
|
||||
const view = render(<HeartbeatCenter {...props} />, false)
|
||||
fireEvent.click(screen.getByRole('button', { name: `暂停 ${config.name}` }))
|
||||
await waitFor(() => expect(props.onSetPaused).toHaveBeenCalledWith(config.id, true))
|
||||
view.rerender(<HeartbeatCenter {...props} configs={[{ ...config, enabled: false }]} />)
|
||||
fireEvent.click(screen.getByRole('button', { name: `恢复 ${config.name}` }))
|
||||
await waitFor(() => expect(props.onSetPaused).toHaveBeenCalledWith(config.id, false))
|
||||
fireEvent.click(screen.getByRole('button', { name: `立即运行 ${config.name}` }))
|
||||
await waitFor(() => expect(props.onRunNow).toHaveBeenCalledWith(config.id))
|
||||
fireEvent.click(screen.getByRole('button', { name: `删除 ${config.name}` }))
|
||||
expect(props.onRemove).not.toHaveBeenCalled()
|
||||
fireEvent.click(screen.getByRole('button', { name: `确认删除 ${config.name}` }))
|
||||
await waitFor(() => expect(props.onRemove).toHaveBeenCalledWith(config.id))
|
||||
})
|
||||
|
||||
it('renders English interface copy while preserving heartbeat content', async () => {
|
||||
@@ -239,7 +375,7 @@ describe('HeartbeatCenter', () => {
|
||||
).toBeInTheDocument()
|
||||
|
||||
fireEvent.click(
|
||||
screen.getByRole('tab', { name: 'Automatic wake-up settings' })
|
||||
screen.getByRole('tab', { name: 'Automatic supervision' })
|
||||
)
|
||||
fireEvent.click(
|
||||
screen.getByRole('button', { name: 'Selected projects' })
|
||||
@@ -333,7 +469,7 @@ describe('HeartbeatCenter', () => {
|
||||
screen.getByRole('heading', { level: 2, name: '报告趋势' })
|
||||
).toBeInTheDocument()
|
||||
expect(
|
||||
screen.getByRole('heading', { level: 2, name: '本次心跳' })
|
||||
screen.getByRole('heading', { level: 2, name: '最近回顾' })
|
||||
).toBeInTheDocument()
|
||||
expect(screen.queryByText('CURRENT PULSE')).not.toBeInTheDocument()
|
||||
expect(screen.queryByText('GROWTH TREND')).not.toBeInTheDocument()
|
||||
@@ -351,7 +487,7 @@ describe('HeartbeatCenter', () => {
|
||||
|
||||
fireEvent.click(screen.getByRole('tab', { name: '报告与记录' }))
|
||||
expect(
|
||||
screen.getByRole('heading', { level: 2, name: '心跳报告' })
|
||||
screen.getByRole('heading', { level: 2, name: '回顾报告' })
|
||||
).toBeInTheDocument()
|
||||
expect(
|
||||
screen.getByRole('heading', { level: 2, name: '运行记录' })
|
||||
@@ -361,13 +497,13 @@ describe('HeartbeatCenter', () => {
|
||||
).not.toBeInTheDocument()
|
||||
expect(screen.queryByText('RUN AUDIT')).not.toBeInTheDocument()
|
||||
|
||||
fireEvent.click(screen.getByRole('tab', { name: '自动唤醒设置' }))
|
||||
fireEvent.click(screen.getByRole('tab', { name: '自动监督' }))
|
||||
expect(
|
||||
screen.getByRole('heading', { level: 2, name: '自动唤醒' })
|
||||
screen.getByRole('heading', { level: 2, name: '自动监督' })
|
||||
).toBeInTheDocument()
|
||||
fireEvent.click(screen.getByRole('button', { name: '自动唤醒' }))
|
||||
fireEvent.click(screen.getByRole('button', { name: '自动监督' }))
|
||||
expect(
|
||||
screen.getByText('自动唤醒按时只读运行,不调用工具。')
|
||||
screen.getByText('按计划只读回顾所选范围,不调用工具;建议由你确认和处理。')
|
||||
).toBeInTheDocument()
|
||||
})
|
||||
|
||||
@@ -449,7 +585,7 @@ describe('HeartbeatCenter', () => {
|
||||
it('explains the irreversible impact before deleting a plan', () => {
|
||||
render(<HeartbeatCenter {...createProps()} />)
|
||||
|
||||
fireEvent.click(screen.getByRole('tab', { name: '自动唤醒设置' }))
|
||||
fireEvent.click(screen.getByRole('tab', { name: '自动监督' }))
|
||||
fireEvent.click(
|
||||
screen.getByRole('button', {
|
||||
name: `删除 ${config.name}`
|
||||
@@ -466,8 +602,8 @@ describe('HeartbeatCenter', () => {
|
||||
|
||||
it('keeps scope choices visible while showing help for the selected scope', () => {
|
||||
render(<HeartbeatCenter {...createProps()} />)
|
||||
fireEvent.click(screen.getByRole('tab', { name: '自动唤醒设置' }))
|
||||
const help = screen.getByRole('button', { name: '回顾范围' })
|
||||
fireEvent.click(screen.getByRole('tab', { name: '自动监督' }))
|
||||
const help = screen.getByRole('button', { name: '项目范围' })
|
||||
expect(help.closest('label, [role="tab"]')).toBeNull()
|
||||
fireEvent.click(help)
|
||||
expect(screen.getByRole('tooltip')).toHaveTextContent('回顾所有可用项目中的有界对话与任务')
|
||||
@@ -483,7 +619,7 @@ describe('HeartbeatCenter', () => {
|
||||
expect(screen.queryByRole('region', { name: '当前状态' })).not.toBeInTheDocument()
|
||||
fireEvent.click(screen.getByRole('tab', { name: '设置' }))
|
||||
expect(screen.getAllByRole('heading', { level: 1 })).toHaveLength(1)
|
||||
expect(screen.getByRole('region', { name: '当前状态' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('heading', { name: '自动监督' })).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('passes manual project and time selections without requiring an automatic plan', async () => {
|
||||
@@ -524,7 +660,7 @@ describe('HeartbeatCenter', () => {
|
||||
)
|
||||
|
||||
fireEvent.click(
|
||||
screen.getByRole('button', { name: '配置自动唤醒' })
|
||||
screen.getByRole('button', { name: '配置自动监督' })
|
||||
)
|
||||
fireEvent.click(
|
||||
screen.getByRole('button', { name: '指定项目' })
|
||||
@@ -532,7 +668,7 @@ describe('HeartbeatCenter', () => {
|
||||
fireEvent.click(screen.getByLabelText('默认项目'))
|
||||
fireEvent.click(screen.getByLabelText('第二项目'))
|
||||
fireEvent.click(
|
||||
screen.getByRole('button', { name: '启用自动唤醒' })
|
||||
screen.getByRole('button', { name: '保存并启用计划' })
|
||||
)
|
||||
|
||||
await waitFor(() =>
|
||||
@@ -556,7 +692,7 @@ describe('HeartbeatCenter', () => {
|
||||
<HeartbeatCenter {...createProps({ onUpdate })} />
|
||||
)
|
||||
|
||||
fireEvent.click(screen.getByRole('tab', { name: '自动唤醒设置' }))
|
||||
fireEvent.click(screen.getByRole('tab', { name: '自动监督' }))
|
||||
fireEvent.click(
|
||||
screen.getByRole('button', { name: `编辑 ${config.name}` })
|
||||
)
|
||||
@@ -564,7 +700,7 @@ describe('HeartbeatCenter', () => {
|
||||
target: { value: '更新后的回顾' }
|
||||
})
|
||||
fireEvent.click(
|
||||
screen.getByRole('button', { name: '保存自动唤醒计划' })
|
||||
screen.getByRole('button', { name: '保存自动监督计划' })
|
||||
)
|
||||
|
||||
await waitFor(() =>
|
||||
@@ -592,13 +728,13 @@ describe('HeartbeatCenter', () => {
|
||||
)
|
||||
|
||||
fireEvent.click(
|
||||
screen.getByRole('button', { name: '配置自动唤醒' })
|
||||
screen.getByRole('button', { name: '配置自动监督' })
|
||||
)
|
||||
expect(
|
||||
screen.getByRole('tab', { name: '自动唤醒设置' })
|
||||
screen.getByRole('tab', { name: '自动监督' })
|
||||
).toHaveAttribute('aria-selected', 'true')
|
||||
expect(
|
||||
screen.getByRole('button', { name: '启用自动唤醒' })
|
||||
screen.getByRole('button', { name: '保存并启用计划' })
|
||||
).toBeInTheDocument()
|
||||
})
|
||||
|
||||
@@ -625,7 +761,7 @@ describe('HeartbeatCenter', () => {
|
||||
'true'
|
||||
)
|
||||
expect(
|
||||
screen.queryByRole('button', { name: '配置自动唤醒' })
|
||||
screen.queryByRole('button', { name: '保存并启用计划' })
|
||||
).not.toBeInTheDocument()
|
||||
|
||||
rerender(
|
||||
@@ -639,7 +775,7 @@ describe('HeartbeatCenter', () => {
|
||||
expect(screen.getByText('监督者加载失败')).toBeInTheDocument()
|
||||
expect(screen.getByText('数据库暂时不可用')).toBeInTheDocument()
|
||||
expect(
|
||||
screen.queryByRole('button', { name: '配置自动唤醒' })
|
||||
screen.queryByRole('button', { name: '保存并启用计划' })
|
||||
).not.toBeInTheDocument()
|
||||
expect(screen.getByRole('button', { name: '重试' })).toBeInTheDocument()
|
||||
})
|
||||
|
||||
@@ -25,6 +25,7 @@ import type {
|
||||
} from '../../shared/assistant-contracts'
|
||||
import { HeartbeatSettings } from './HeartbeatSettings'
|
||||
import { SupervisorWorkspace, type SupervisionGraphNavigation } from './SupervisorWorkspace'
|
||||
import { SupervisorActivity } from './SupervisorActivity'
|
||||
import './supervisor-workspace.css'
|
||||
import { getProjectDisplayText } from './project-display'
|
||||
import {
|
||||
@@ -42,6 +43,7 @@ type HeartbeatCenterTab =
|
||||
| 'plans'
|
||||
|
||||
export type HeartbeatCenterProps = {
|
||||
active?: boolean
|
||||
graphNavigation?: SupervisionGraphNavigation
|
||||
configs: AssistantHeartbeatConfig[]
|
||||
runs: AssistantHeartbeatRun[]
|
||||
@@ -93,17 +95,22 @@ export function HeartbeatCenter(props: HeartbeatCenterProps): React.JSX.Element
|
||||
function UnifiedSupervisorCenter(props: HeartbeatCenterProps): React.JSX.Element {
|
||||
const { t } = useTranslation('heartbeat')
|
||||
const centerRef = useRef<HTMLElement>(null)
|
||||
const [pageTab, setPageTab] = useState<'overview' | 'graph' | 'settings'>(props.graphNavigation ? 'graph' : 'overview')
|
||||
const [pageTab, setPageTab] = useState<'overview' | 'graph' | 'activity' | 'settings'>(props.graphNavigation ? 'graph' : 'overview')
|
||||
const [activityNavigation, setActivityNavigation] = useState<SupervisionGraphNavigation>()
|
||||
const [appliedNavigation, setAppliedNavigation] = useState(props.graphNavigation)
|
||||
if (appliedNavigation !== props.graphNavigation) {
|
||||
setAppliedNavigation(props.graphNavigation)
|
||||
if (props.graphNavigation) setPageTab('graph')
|
||||
if (props.graphNavigation) {
|
||||
setActivityNavigation(undefined)
|
||||
setPageTab('graph')
|
||||
}
|
||||
}
|
||||
useEffect(() => {
|
||||
if (props.graphNavigation) {
|
||||
centerRef.current?.querySelector<HTMLElement>('#supervisor-tab-graph')?.focus()
|
||||
const navigation = activityNavigation ?? props.graphNavigation
|
||||
if (navigation) {
|
||||
centerRef.current?.querySelector<HTMLElement>(`#supervisor-tab-${navigation.tab ?? 'graph'}`)?.focus()
|
||||
}
|
||||
}, [props.graphNavigation])
|
||||
}, [props.graphNavigation, activityNavigation])
|
||||
return (
|
||||
<section ref={centerRef} className="heartbeat-center" aria-labelledby="supervisor-title">
|
||||
<PageHeader
|
||||
@@ -120,6 +127,7 @@ function UnifiedSupervisorCenter(props: HeartbeatCenterProps): React.JSX.Element
|
||||
tabs={[
|
||||
{ id: 'overview', label: t('supervisor.recap') },
|
||||
{ id: 'graph', label: t('supervisor.graph') },
|
||||
{ id: 'activity', label: t('activity.title') },
|
||||
{ id: 'settings', label: t('supervisor.settings') }
|
||||
]}
|
||||
/>
|
||||
@@ -128,14 +136,22 @@ function UnifiedSupervisorCenter(props: HeartbeatCenterProps): React.JSX.Element
|
||||
id={`supervisor-panel-${pageTab}`}
|
||||
aria-labelledby={`supervisor-tab-${pageTab}`}
|
||||
>
|
||||
<div hidden={pageTab === 'settings'}>
|
||||
<div hidden={pageTab === 'settings' || pageTab === 'activity'}>
|
||||
<SupervisorWorkspace
|
||||
graphNavigation={props.graphNavigation}
|
||||
graphNavigation={activityNavigation ?? props.graphNavigation}
|
||||
tab={pageTab}
|
||||
onTabChange={setPageTab}
|
||||
projects={props.projects}
|
||||
/>
|
||||
</div>
|
||||
{pageTab === 'activity' && <SupervisorActivity
|
||||
active={props.active !== false}
|
||||
projects={props.projects}
|
||||
onOpenResult={(resultId, tab) => {
|
||||
setActivityNavigation({ resultId, tab })
|
||||
setPageTab(tab)
|
||||
}}
|
||||
/>}
|
||||
{pageTab === 'settings' && <HeartbeatAutomationSettings {...props} />}
|
||||
</div>
|
||||
</section>
|
||||
@@ -164,7 +180,7 @@ function HeartbeatAutomationSettings({
|
||||
}: HeartbeatCenterProps): React.JSX.Element {
|
||||
const { t, i18n } = useTranslation('heartbeat')
|
||||
const { t: tWorkspace } = useTranslation('workspace')
|
||||
const [tab, setTab] = useState<HeartbeatCenterTab>('overview')
|
||||
const [tab, setTab] = useState<HeartbeatCenterTab>('plans')
|
||||
const [pendingAction, setPendingAction] = useState<string>()
|
||||
const [error, setError] = useState<string>()
|
||||
const [expandedEntryId, setExpandedEntryId] = useState<string>()
|
||||
@@ -212,6 +228,7 @@ function HeartbeatAutomationSettings({
|
||||
string
|
||||
> = {
|
||||
claimed: t('statuses.run.claimed'),
|
||||
no_change: t('statuses.run.no_change'),
|
||||
completed: t('statuses.run.completed'),
|
||||
failed: t('statuses.run.failed'),
|
||||
skipped: t('statuses.run.skipped')
|
||||
@@ -416,14 +433,14 @@ function HeartbeatAutomationSettings({
|
||||
label: string
|
||||
count?: number
|
||||
}> = [
|
||||
{ id: 'plans', label: t('center.tabs.plans') },
|
||||
{ id: 'overview', label: t('center.tabs.overview') },
|
||||
{
|
||||
id: 'suggestions',
|
||||
label: t('center.tabs.suggestions'),
|
||||
count: attentionCount
|
||||
},
|
||||
{ id: 'history', label: t('center.tabs.history') },
|
||||
{ id: 'plans', label: t('center.tabs.plans') }
|
||||
{ id: 'history', label: t('center.tabs.history') }
|
||||
]
|
||||
|
||||
return (
|
||||
@@ -431,14 +448,10 @@ function HeartbeatAutomationSettings({
|
||||
aria-label={t('supervisor.settings')}
|
||||
className="heartbeat-center"
|
||||
>
|
||||
<div className="supervisor-workspace__section-heading">
|
||||
<div>
|
||||
<h2>{t('supervisor.settings')}</h2>
|
||||
<ScopeBadge scope={heartbeatScope} />
|
||||
</div>
|
||||
<div className="supervisor-workspace__actions">
|
||||
{!initialLoadBlocked && (
|
||||
<>
|
||||
<div className="supervisor-workspace__action-bar">
|
||||
<ScopeBadge scope={heartbeatScope} />
|
||||
{!initialLoadBlocked && (
|
||||
<div className="supervisor-workspace__actions">
|
||||
<button
|
||||
aria-label={t('center.actions.refreshAriaLabel')}
|
||||
className="secondary-button"
|
||||
@@ -449,7 +462,7 @@ function HeartbeatAutomationSettings({
|
||||
<RefreshCw aria-hidden="true" size={14} />
|
||||
{t('center.actions.refresh')}
|
||||
</button>
|
||||
{primaryConfig ? (
|
||||
{tab !== 'plans' && (primaryConfig ? (
|
||||
<button
|
||||
className="primary-button"
|
||||
disabled={loading || pendingAction !== undefined}
|
||||
@@ -474,10 +487,9 @@ function HeartbeatAutomationSettings({
|
||||
>
|
||||
{t('center.actions.configure')}
|
||||
</button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{error && (
|
||||
|
||||
@@ -44,6 +44,9 @@ export function HeartbeatSettings({
|
||||
const [editingId, setEditingId] = useState<string>()
|
||||
const [name, setName] = useState(t('settings.defaultName'))
|
||||
const [time, setTime] = useState('09:00')
|
||||
const [timezone, setTimezone] = useState(
|
||||
() => Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC'
|
||||
)
|
||||
const [recurrence, setRecurrence] = useState<'daily' | 'weekly'>(
|
||||
'daily'
|
||||
)
|
||||
@@ -74,6 +77,7 @@ export function HeartbeatSettings({
|
||||
string
|
||||
> = {
|
||||
claimed: t('statuses.run.claimed'),
|
||||
no_change: t('statuses.run.no_change'),
|
||||
completed: t('statuses.run.completed'),
|
||||
failed: t('statuses.run.failed'),
|
||||
skipped: t('statuses.run.skipped')
|
||||
@@ -83,6 +87,7 @@ export function HeartbeatSettings({
|
||||
setEditingId(undefined)
|
||||
setName(t('settings.defaultName'))
|
||||
setTime('09:00')
|
||||
setTimezone(Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC')
|
||||
setRecurrence('daily')
|
||||
setWeekday(1)
|
||||
setScopeKind('global')
|
||||
@@ -95,6 +100,7 @@ export function HeartbeatSettings({
|
||||
setEditingId(heartbeat.id)
|
||||
setName(heartbeat.name)
|
||||
setTime(heartbeat.recurrence.localTime)
|
||||
setTimezone(heartbeat.timezone)
|
||||
setRecurrence(heartbeat.recurrence.type)
|
||||
setWeekday(
|
||||
heartbeat.recurrence.type === 'weekly'
|
||||
@@ -139,8 +145,7 @@ export function HeartbeatSettings({
|
||||
? { kind: 'global' }
|
||||
: { kind: 'projects', projectIds: selectedProjectIds },
|
||||
name: name.trim(),
|
||||
timezone:
|
||||
Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC',
|
||||
timezone,
|
||||
recurrence:
|
||||
recurrence === 'daily'
|
||||
? { type: 'daily', localTime: time }
|
||||
@@ -187,6 +192,11 @@ export function HeartbeatSettings({
|
||||
</h2>
|
||||
<InlineHelp label={t('settings.title')}>{t('settings.description')}</InlineHelp>
|
||||
</div>
|
||||
<p>{t('settings.scheduleHelp')}</p>
|
||||
{heartbeats.length === 0 && <p role="status">{t('settings.empty')}</p>}
|
||||
{heartbeats.length > 0 && heartbeats.every((heartbeat) => !heartbeat.enabled) && (
|
||||
<p role="status">{t('settings.allPaused')}</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="heartbeat-settings__editor">
|
||||
<div className="heartbeat-settings__editor-heading">
|
||||
@@ -206,6 +216,7 @@ export function HeartbeatSettings({
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
<p className="heartbeat-settings__empty">{t('settings.timezone', { timezone })}</p>
|
||||
<label className="heartbeat-settings__field">
|
||||
<span>{t('settings.nameLabel')}</span>
|
||||
<input
|
||||
@@ -387,11 +398,7 @@ export function HeartbeatSettings({
|
||||
{error}
|
||||
</p>
|
||||
)}
|
||||
{heartbeats.length === 0 ? (
|
||||
<p className="heartbeat-settings__empty">
|
||||
{t('settings.empty')}
|
||||
</p>
|
||||
) : (
|
||||
{heartbeats.length > 0 && (
|
||||
<div className="heartbeat-settings__list">
|
||||
{heartbeats.map((heartbeat) => (
|
||||
<article
|
||||
@@ -401,16 +408,27 @@ export function HeartbeatSettings({
|
||||
<span>
|
||||
<strong>{heartbeat.name}</strong>
|
||||
<small>{scopeLabel(heartbeat)}</small>
|
||||
<small>
|
||||
{heartbeat.recurrence.type === 'weekly'
|
||||
? t('center.recurrence.weekly', {
|
||||
weekday: t(`center.weekdays.${['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'][heartbeat.recurrence.weekday]}`),
|
||||
time: heartbeat.recurrence.localTime
|
||||
})
|
||||
: t('center.recurrence.daily', { time: heartbeat.recurrence.localTime })}
|
||||
{' · '}{heartbeat.timezone}
|
||||
</small>
|
||||
<small>{t('settings.windowSummary', {
|
||||
hours: heartbeat.lookbackHours, days: heartbeat.retentionDays
|
||||
})}</small>
|
||||
<small>
|
||||
{heartbeat.enabled
|
||||
? t('settings.running')
|
||||
: t('settings.paused')}{' '}
|
||||
·{' '}
|
||||
{t('settings.next', {
|
||||
{heartbeat.enabled && ` · ${t('settings.next', {
|
||||
date: new Date(
|
||||
heartbeat.nextRunAt
|
||||
).toLocaleString(locale)
|
||||
})}
|
||||
})}`}
|
||||
{heartbeat.lastStatus
|
||||
? ` · ${t('settings.last', {
|
||||
status:
|
||||
|
||||
@@ -151,6 +151,7 @@ function sidebarElement({
|
||||
workspaceProjectId,
|
||||
restoreFocusRef,
|
||||
activeConversationId,
|
||||
supervisionEnabled,
|
||||
supervisionLibraries,
|
||||
conversationStats,
|
||||
taskDurations,
|
||||
@@ -190,6 +191,7 @@ function sidebarElement({
|
||||
workspaceProjectId?: string
|
||||
restoreFocusRef?: { current: HTMLElement | null }
|
||||
activeConversationId?: string
|
||||
supervisionEnabled?: boolean
|
||||
supervisionLibraries?: React.ComponentProps<typeof RightAssistantSidebar>['supervisionLibraries']
|
||||
conversationStats?: React.ComponentProps<typeof RightAssistantSidebar>['conversationStats']
|
||||
taskDurations?: React.ComponentProps<typeof RightAssistantSidebar>['taskDurations']
|
||||
@@ -210,6 +212,7 @@ function sidebarElement({
|
||||
<RightAssistantSidebar
|
||||
approvals={approvals}
|
||||
activeConversationId={activeConversationId}
|
||||
supervisionEnabled={supervisionEnabled}
|
||||
supervisionLibraries={supervisionLibraries}
|
||||
conversationStats={conversationStats}
|
||||
taskDurations={taskDurations}
|
||||
@@ -257,13 +260,36 @@ function renderSidebar(options: Parameters<typeof sidebarElement>[0] = {}): HTML
|
||||
})
|
||||
}
|
||||
|
||||
it.each([false, undefined])('does not mount or query supervision when enabled is %s', async (supervisionEnabled) => {
|
||||
const overview = vi.fn(async () => [])
|
||||
const onCreateCustomTask = vi.fn()
|
||||
Object.assign(window.goodbuddy, { supervision: { overview } })
|
||||
const view = render(sidebarElement({ activeConversationId: 'A', supervisionEnabled, onCreateCustomTask }))
|
||||
expect(screen.queryByRole('region', { name: '监督反馈' })).not.toBeInTheDocument()
|
||||
expect(screen.queryByRole('button', { name: '固定监督目标' })).not.toBeInTheDocument()
|
||||
expect(overview).not.toHaveBeenCalled()
|
||||
expect(screen.getByRole('region', { name: '当前会话统计' })).toBeVisible()
|
||||
fireEvent.click(screen.getByRole('button', { name: '新建任务' }))
|
||||
expect(onCreateCustomTask).toHaveBeenCalledOnce()
|
||||
|
||||
view.rerender(sidebarElement({ activeConversationId: 'A', supervisionEnabled: true }))
|
||||
await waitFor(() => expect(overview).toHaveBeenCalledOnce())
|
||||
fireEvent.click(screen.getByRole('button', { name: '固定监督目标' }))
|
||||
view.rerender(sidebarElement({ activeConversationId: 'B', supervisionEnabled }))
|
||||
expect(screen.queryByRole('region', { name: '监督反馈' })).not.toBeInTheDocument()
|
||||
expect(screen.queryByRole('button', { name: '取消固定监督目标' })).not.toBeInTheDocument()
|
||||
expect(screen.queryByRole('button', { name: '刷新监督回顾' })).not.toBeInTheDocument()
|
||||
expect(overview).toHaveBeenCalledOnce()
|
||||
expect(screen.getByRole('region', { name: '当前会话统计' })).toBeVisible()
|
||||
})
|
||||
|
||||
it('pins the supervision target across conversation switches and restores following when unpinned', async () => {
|
||||
const overview = vi.fn(async () => [])
|
||||
Object.assign(window.goodbuddy, { supervision: { overview } })
|
||||
const view = render(sidebarElement({ activeConversationId: 'A' }))
|
||||
const view = render(sidebarElement({ activeConversationId: 'A', supervisionEnabled: true }))
|
||||
await waitFor(() => expect(overview).toHaveBeenLastCalledWith({ target: { type: 'conversation', conversationId: 'A' } }))
|
||||
fireEvent.click(screen.getByRole('button', { name: '固定监督目标' }))
|
||||
view.rerender(sidebarElement({ activeConversationId: 'B' }))
|
||||
view.rerender(sidebarElement({ activeConversationId: 'B', supervisionEnabled: true }))
|
||||
expect(screen.getByRole('button', { name: '取消固定监督目标' })).toBeInTheDocument()
|
||||
expect(overview).toHaveBeenLastCalledWith({ target: { type: 'conversation', conversationId: 'A' } })
|
||||
expect(localStorage.getItem('goodbuddy.workbar-layout.v1')).toContain('"conversationId":"A"')
|
||||
@@ -283,7 +309,7 @@ it.each(['cancel', 'failure'] as const)('retries supervision knowledge preview a
|
||||
} })
|
||||
const confirm = vi.spyOn(window, 'confirm').mockReturnValueOnce(outcome !== 'cancel').mockReturnValue(true)
|
||||
try {
|
||||
renderSidebar({ activeConversationId: 'conversation', supervisionLibraries: [{ id: 'library', name: 'Target library' } as never] })
|
||||
renderSidebar({ activeConversationId: 'conversation', supervisionEnabled: true, supervisionLibraries: [{ id: 'library', name: 'Target library' } as never] })
|
||||
fireEvent.click(await screen.findByRole('button', { name: '查看来源' }))
|
||||
const button = await screen.findByRole('button', { name: '预览并写入实体' })
|
||||
fireEvent.click(button)
|
||||
|
||||
@@ -134,6 +134,7 @@ export type RightAssistantSidebarProps = {
|
||||
taskDurations?: ReadonlyMap<string, SidebarTaskDuration>
|
||||
browserStates?: Readonly<Record<string, Readonly<Record<string, BrowserLiveState>>>>
|
||||
currentProject?: AssistantProject
|
||||
supervisionEnabled?: boolean
|
||||
supervisionLibraries?: KnowledgeLibrary[]
|
||||
onOpenSupervisionGraph?: (resultId: string) => void
|
||||
onContinueSupervision?: (prompt: string, conversationId: string) => Promise<void>
|
||||
@@ -806,6 +807,7 @@ export function RightAssistantSidebar({
|
||||
taskDurations,
|
||||
browserStates = {},
|
||||
currentProject,
|
||||
supervisionEnabled = false,
|
||||
supervisionLibraries,
|
||||
onOpenSupervisionGraph,
|
||||
onContinueSupervision,
|
||||
@@ -1546,6 +1548,7 @@ export function RightAssistantSidebar({
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (instance.id === activeWorkbarInstanceId) setActionError('')
|
||||
removeWorkbarInstance(instance.id)
|
||||
return true
|
||||
}
|
||||
@@ -2067,6 +2070,7 @@ export function RightAssistantSidebar({
|
||||
) : null}
|
||||
{instance.appId === 'tasks' && (
|
||||
<section className="assistant-sidebar__section task-center">
|
||||
{supervisionEnabled && <>
|
||||
<button type="button" className="link-button" disabled={!instance.targetRef && !selectedTaskId && !activeConversationId}
|
||||
onClick={() => setWorkbarInstances((current) => current.map((item) => item.id === instance.id
|
||||
? { ...item, targetRef: item.targetRef ? undefined : selectedTaskId ? { type: 'task', taskId: selectedTaskId } : activeConversationId ? { type: 'conversation', conversationId: activeConversationId } : undefined }
|
||||
@@ -2085,6 +2089,7 @@ export function RightAssistantSidebar({
|
||||
onContinueSupervision={onContinueSupervision}
|
||||
onOpenSupervisionConversation={onOpenSupervisionConversation}
|
||||
/>
|
||||
</>}
|
||||
<section className="task-center__stats" aria-label={t('sidebar.tasks.stats.label')}>
|
||||
<p className="task-center__scope">{currentProject
|
||||
? t('sidebar.tasks.projectScope', { project: currentProject.name })
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
import '@testing-library/jest-dom/vitest'
|
||||
import { act, cleanup, fireEvent, render, screen } from '@testing-library/react'
|
||||
import { afterEach, expect, it, vi } from 'vitest'
|
||||
import type { SupervisionActivity as Activity } from '../../shared/supervision-contracts'
|
||||
import { SupervisorActivity } from './SupervisorActivity'
|
||||
import './i18n'
|
||||
|
||||
const row: Activity = {
|
||||
id: 'run', kind: 'heartbeat', trigger: 'scheduled', status: 'running', scope: { kind: 'global' },
|
||||
startedAt: '2026-09-23T10:00:00Z', completedAt: null, timeRange: null, error: null,
|
||||
summary: 'Saved heartbeat', resultId: null, heartbeatStatus: 'completed', supervisionStatus: 'running'
|
||||
}
|
||||
afterEach(() => { cleanup(); vi.useRealTimers(); vi.unstubAllGlobals() })
|
||||
|
||||
it('shows no-change execution without a new result action', async () => {
|
||||
vi.stubGlobal('goodbuddy', { supervision: { activity: vi.fn().mockResolvedValue([{
|
||||
...row, status: 'no_change', heartbeatStatus: 'no_change', supervisionStatus: 'no_change',
|
||||
summary: null, completedAt: '2026-09-23T10:00:01Z'
|
||||
}]) } })
|
||||
render(<SupervisorActivity active projects={[]} onOpenResult={vi.fn()} />)
|
||||
expect(await screen.findByText('无变化(未调用模型)')).toBeVisible()
|
||||
expect(screen.getByText('心跳报告: 无变化(未调用模型)')).toBeVisible()
|
||||
expect(screen.queryByRole('button', { name: '查看回顾' })).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('polls sequentially only while active and ignores late responses after leaving', async () => {
|
||||
vi.useFakeTimers()
|
||||
let resolve!: (value: Activity[]) => void
|
||||
const activity = vi.fn().mockResolvedValueOnce([row]).mockImplementationOnce(() => new Promise<Activity[]>((done) => { resolve = done })).mockResolvedValue([])
|
||||
vi.stubGlobal('goodbuddy', { supervision: { activity } })
|
||||
const props = { active: true, projects: [], onOpenResult: vi.fn() }
|
||||
const view = render(<SupervisorActivity {...props} />)
|
||||
await act(() => vi.advanceTimersByTimeAsync(0))
|
||||
expect(screen.getByText('运行中')).toBeVisible()
|
||||
expect(screen.getByText('心跳报告: 已完成')).toBeVisible()
|
||||
await act(() => vi.advanceTimersByTimeAsync(2000))
|
||||
expect(screen.getByRole('button', { name: '刷新' })).toBeDisabled()
|
||||
await act(() => vi.advanceTimersByTimeAsync(20000))
|
||||
expect(activity).toHaveBeenCalledTimes(2)
|
||||
view.rerender(<SupervisorActivity {...props} active={false} />)
|
||||
await act(async () => resolve([{ ...row, status: 'failed', error: 'Late error' }]))
|
||||
expect(screen.queryByText('Late error')).not.toBeInTheDocument()
|
||||
await act(() => vi.advanceTimersByTimeAsync(20000))
|
||||
expect(activity).toHaveBeenCalledTimes(2)
|
||||
view.rerender(<SupervisorActivity {...props} />)
|
||||
await act(() => vi.advanceTimersByTimeAsync(0))
|
||||
expect(activity).toHaveBeenCalledTimes(3)
|
||||
expect(screen.getByText('暂无活动记录')).toBeVisible()
|
||||
view.unmount()
|
||||
await act(() => vi.advanceTimersByTimeAsync(20000))
|
||||
expect(activity).toHaveBeenCalledTimes(3)
|
||||
})
|
||||
|
||||
it('does not query while inactive and exposes recoverable read errors without triggering execution', async () => {
|
||||
vi.useFakeTimers()
|
||||
const activity = vi.fn().mockRejectedValueOnce(new Error('Read failed')).mockResolvedValue([])
|
||||
const run = vi.fn()
|
||||
vi.stubGlobal('goodbuddy', { supervision: { activity, run } })
|
||||
const props = { projects: [], onOpenResult: vi.fn() }
|
||||
const view = render(<SupervisorActivity {...props} active={false} />)
|
||||
await act(() => vi.advanceTimersByTimeAsync(20000))
|
||||
expect(activity).not.toHaveBeenCalled()
|
||||
view.rerender(<SupervisorActivity {...props} active />)
|
||||
await act(() => vi.advanceTimersByTimeAsync(0))
|
||||
expect(screen.getByRole('alert')).toHaveTextContent('Read failed')
|
||||
await act(() => vi.advanceTimersByTimeAsync(20000))
|
||||
expect(activity).toHaveBeenCalledTimes(1)
|
||||
fireEvent.click(screen.getByRole('button', { name: '重试' }))
|
||||
await act(() => vi.advanceTimersByTimeAsync(0))
|
||||
expect(screen.getByText('暂无活动记录')).toBeVisible()
|
||||
expect(run).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('shows actual status, scope and result destinations without unsupported cancellation', async () => {
|
||||
const activity = vi.fn().mockResolvedValue([{ ...row, kind: 'supervision', trigger: 'manual', status: 'completed', supervisionStatus: 'completed', heartbeatStatus: null, resultId: 'old-result', completedAt: '2026-09-23T10:01:00Z' }])
|
||||
vi.stubGlobal('goodbuddy', { supervision: { activity } })
|
||||
const open = vi.fn()
|
||||
render(<SupervisorActivity active projects={[]} onOpenResult={open} />)
|
||||
fireEvent.click(await screen.findByRole('button', { name: '查看回顾' }))
|
||||
expect(open).toHaveBeenLastCalledWith('old-result', 'overview')
|
||||
fireEvent.click(screen.getByRole('button', { name: '在图谱中查看' }))
|
||||
expect(open).toHaveBeenLastCalledWith('old-result', 'graph')
|
||||
expect(screen.queryByRole('button', { name: /取消/ })).not.toBeInTheDocument()
|
||||
expect(screen.getByText('用户触发')).toBeVisible()
|
||||
})
|
||||
@@ -0,0 +1,97 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { History, RefreshCw } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import type { AssistantProject } from '../../shared/assistant-contracts'
|
||||
import type { SupervisionActivity } from '../../shared/supervision-contracts'
|
||||
import { EmptyState, ScopeBadge } from './WorkspacePrimitives'
|
||||
|
||||
export function SupervisorActivity({ active, projects, onOpenResult }: {
|
||||
active: boolean
|
||||
projects: AssistantProject[]
|
||||
onOpenResult: (resultId: string, tab: 'overview' | 'graph') => void
|
||||
}) {
|
||||
const { t, i18n } = useTranslation('heartbeat')
|
||||
const [rows, setRows] = useState<SupervisionActivity[]>([])
|
||||
const [offset, setOffset] = useState(0)
|
||||
const [refresh, setRefresh] = useState(0)
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [reading, setReading] = useState(false)
|
||||
const [error, setError] = useState<string>()
|
||||
const api = window.goodbuddy?.supervision
|
||||
useEffect(() => {
|
||||
if (!active) return
|
||||
let disposed = false
|
||||
let timer: ReturnType<typeof setTimeout>
|
||||
const load = async () => {
|
||||
setReading(true)
|
||||
try {
|
||||
if (!api?.activity) throw new Error(t('supervisor.unavailable'))
|
||||
const result = await api.activity({ limit: 50, offset })
|
||||
if (disposed) return
|
||||
setRows(result)
|
||||
setError(undefined)
|
||||
// One request at a time, only while this page is active.
|
||||
timer = setTimeout(() => void load(), result.some((row) => row.status === 'running') ? 2000 : 10000)
|
||||
} catch (reason) {
|
||||
if (!disposed) setError(reason instanceof Error ? reason.message : t('common.operationFailed'))
|
||||
} finally {
|
||||
if (!disposed) {
|
||||
setLoading(false)
|
||||
setReading(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
timer = setTimeout(() => void load(), 0)
|
||||
return () => { disposed = true; clearTimeout(timer) }
|
||||
}, [active, api, offset, refresh, t])
|
||||
const reload = (nextOffset = offset) => {
|
||||
setLoading(true)
|
||||
setError(undefined)
|
||||
setOffset(nextOffset)
|
||||
setRefresh((value) => value + 1)
|
||||
}
|
||||
const date = (value: string) => new Date(value).toLocaleString(i18n.resolvedLanguage)
|
||||
return <section className="supervisor-activity" aria-label={t('activity.title')} aria-busy={loading}>
|
||||
<div className="supervisor-workspace__action-bar">
|
||||
<ScopeBadge scope={{ kind: 'mixed' }} />
|
||||
<button className="secondary-button" type="button" disabled={loading || reading || !active} onClick={() => reload()}>
|
||||
<RefreshCw size={14} aria-hidden="true" />{t('center.actions.refresh')}
|
||||
</button>
|
||||
</div>
|
||||
<p className="supervisor-activity__note">{t('activity.description')}</p>
|
||||
{error && <div role="alert" className="heartbeat-center__error"><p>{error}</p>
|
||||
<button className="secondary-button" type="button" onClick={() => reload()}>{t('center.actions.retry')}</button>
|
||||
</div>}
|
||||
{loading ? <EmptyState icon={<RefreshCw size={24} />} variant="loading" title={t('activity.loading')} description={t('activity.loadingHint')} />
|
||||
: !error && rows.length === 0 ? <EmptyState icon={<History size={24} />} title={t('activity.empty')} description={t('activity.emptyHint')} />
|
||||
: <ol className="supervisor-activity__list">{rows.map((row) => <li key={`${row.kind}:${row.id}`}>
|
||||
<article className="supervisor-activity__item">
|
||||
<header><strong>{t(`activity.kind.${row.kind}`)}</strong>
|
||||
<span className={`supervisor-activity__status supervisor-activity__status--${row.status}`}>{t(`activity.status.${row.status}`)}</span>
|
||||
</header>
|
||||
<dl>
|
||||
<div><dt>{t('activity.trigger')}</dt><dd>{t(`activity.triggers.${row.trigger}`)}</dd></div>
|
||||
<div><dt>{t('supervisor.scope')}</dt><dd>{!row.scope ? t('activity.unknownScope') : row.scope.kind === 'global' ? t('center.scope.global') : t('supervisor.projectScope', { names: row.scope.projectIds.map((id) => projects.find((project) => project.id === id)?.name ?? t('settings.scope.unavailableProject')).join(', ') })}</dd></div>
|
||||
<div><dt>{t('activity.started')}</dt><dd><time dateTime={row.startedAt} title={row.startedAt}>{date(row.startedAt)}</time></dd></div>
|
||||
<div><dt>{t('activity.finished')}</dt><dd>{row.completedAt ? <time dateTime={row.completedAt} title={row.completedAt}>{date(row.completedAt)}</time> : t('common.unavailable')}</dd></div>
|
||||
{row.timeRange && <div><dt>{t('supervisor.period')}</dt><dd>{date(row.timeRange.from)} / {date(row.timeRange.to)}</dd></div>}
|
||||
</dl>
|
||||
<p className="supervisor-activity__stages">
|
||||
{row.heartbeatStatus && <span>{t('activity.heartbeatStage')}: {t(`statuses.run.${row.heartbeatStatus}`)}</span>}
|
||||
<span>{t('activity.supervisionStage')}: {row.supervisionStatus ? t(`activity.status.${row.supervisionStatus}`) : t('activity.notRecorded')}</span>
|
||||
</p>
|
||||
{row.error && <p className="heartbeat-center__error">{row.error}</p>}
|
||||
{row.summary && <p className="supervisor-activity__summary">{row.summary}</p>}
|
||||
{row.resultId && <div className="supervisor-workspace__actions">
|
||||
<button className="secondary-button" type="button" onClick={() => onOpenResult(row.resultId!, 'overview')}>{t('activity.openReview')}</button>
|
||||
<button className="secondary-button" type="button" onClick={() => onOpenResult(row.resultId!, 'graph')}>{t('supervisor.viewInGraph')}</button>
|
||||
</div>}
|
||||
</article>
|
||||
</li>)}</ol>}
|
||||
<nav className="supervisor-workspace__actions" aria-label={t('activity.pagination')}>
|
||||
<button className="secondary-button" type="button" disabled={loading || reading || !active || offset === 0} onClick={() => reload(Math.max(0, offset - 50))}>{t('activity.previous')}</button>
|
||||
<span>{t('activity.page', { page: offset / 50 + 1 })}</span>
|
||||
<button className="secondary-button" type="button" disabled={loading || reading || !active || rows.length < 50 || offset >= 100000} onClick={() => reload(offset + 50)}>{t('activity.next')}</button>
|
||||
</nav>
|
||||
</section>
|
||||
}
|
||||
@@ -13,12 +13,12 @@ import {
|
||||
} from '../../shared/supervision-contracts'
|
||||
|
||||
type Selection = { kind: 'event' | 'entity' | 'relation'; id: string }
|
||||
export type SupervisionGraphNavigation = { resultId: string }
|
||||
export type SupervisionGraphNavigation = { resultId: string; tab?: 'overview' | 'graph' }
|
||||
type Props = {
|
||||
graphNavigation?: SupervisionGraphNavigation
|
||||
tab?: 'overview' | 'graph' | 'settings'
|
||||
tab?: 'overview' | 'graph' | 'activity' | 'settings'
|
||||
projects?: AssistantProject[]
|
||||
onTabChange?: (tab: 'overview' | 'graph' | 'settings') => void
|
||||
onTabChange?: (tab: 'overview' | 'graph' | 'activity' | 'settings') => void
|
||||
}
|
||||
const emptyGraph: SupervisionGraphView = {
|
||||
storyLine: null,
|
||||
@@ -121,6 +121,11 @@ export function SupervisorWorkspace({
|
||||
try {
|
||||
const overview = (await api.overview()).map((item) => supervisionResultViewSchema.parse(item))
|
||||
if (generation !== loadGeneration.current) return
|
||||
if (requestedId && !overview.some((item) => item.id === requestedId)) {
|
||||
const selected = await api.overview({ resultId: requestedId })
|
||||
if (generation !== loadGeneration.current) return
|
||||
overview.push(...selected.map((item) => supervisionResultViewSchema.parse(item)))
|
||||
}
|
||||
const selected = requestedId ? overview.find((item) => item.id === requestedId) : overview[0]
|
||||
setResults(overview)
|
||||
const nextId = requestedId ?? selected?.id
|
||||
@@ -578,9 +583,8 @@ export function SupervisorWorkspace({
|
||||
)}
|
||||
{tab === 'graph' && (
|
||||
<>
|
||||
<div className="supervisor-workspace__section-heading">
|
||||
<div>
|
||||
<h2>{t('supervisor.graph')}</h2>
|
||||
<div className="supervisor-workspace__action-bar">
|
||||
{(graphScope || latest) && <div>
|
||||
{graphScope && (
|
||||
<p>
|
||||
{t('supervisor.graphScope')}: {scopeText(graphScope)}
|
||||
@@ -592,7 +596,7 @@ export function SupervisorWorkspace({
|
||||
{date(latest.timeRange.to)} · {date(latest.createdAt)}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>}
|
||||
<button
|
||||
className="secondary-button"
|
||||
disabled={busy}
|
||||
|
||||
@@ -22,7 +22,7 @@ export const app = {
|
||||
confirmFailed: 'Could not confirm the save result. Reload settings before editing again.',
|
||||
descriptions: {
|
||||
'magic-notes': 'Write notes, organize to-dos, and receive AI comments.', knowledge: 'Manage knowledge sources and retrieve reference material for conversations.',
|
||||
heartbeat: 'Review work evolution, explore the story graph, and configure automatic wake-ups.', 'local-inference': 'Inspect local inference tasks and execution services.'
|
||||
heartbeat: 'Review work evolution, explore the story graph, and configure automatic supervision.', 'local-inference': 'Inspect local inference tasks and execution services.'
|
||||
}
|
||||
},
|
||||
notifications: {
|
||||
@@ -755,7 +755,7 @@ export const app = {
|
||||
userDecision: 'User selected {{decision}}',
|
||||
conversationDeleted: 'The related conversation has been deleted',
|
||||
localDataCleared:
|
||||
'Local conversations, tasks, memory, heartbeat data, automations, and knowledge indexes were cleared',
|
||||
'Local conversations, tasks, memory, automatic supervision data, automations, and knowledge indexes were cleared',
|
||||
selectKnowledgeBase: 'Select a knowledge base first',
|
||||
knowledgeGraphRebuilt: 'Knowledge graph extracted again',
|
||||
knowledgeSettingsUpdated: 'Knowledge base settings updated',
|
||||
|
||||
@@ -2,6 +2,16 @@ import type { TranslationShape } from '../../resource-types'
|
||||
import type { heartbeat as chineseHeartbeat } from '../zh-CN/heartbeat'
|
||||
|
||||
export const heartbeat = {
|
||||
activity: {
|
||||
title: 'Activity', description: 'Saved manual reviews and automatic supervision runs. Updates while this tab is open. Entity and relation edits do not have a chronological audit log.',
|
||||
loading: 'Loading activity', loadingHint: 'Reading saved execution records.', empty: 'No activity recorded', emptyHint: 'Run a manual review or configure automatic supervision in Settings.',
|
||||
kind: { supervision: 'Work review', heartbeat: 'Automatic supervision' },
|
||||
status: { running: 'Running', completed: 'Completed', failed: 'Failed', skipped: 'Skipped', no_change: 'No changes (no model call)' },
|
||||
triggers: { manual: 'User', scheduled: 'Schedule', heartbeat: 'Heartbeat' },
|
||||
trigger: 'Triggered by', started: 'Started', finished: 'Finished', unknownScope: 'Execution scope not recorded',
|
||||
heartbeatStage: 'Heartbeat report', supervisionStage: 'Supervision review', notRecorded: 'No recorded execution',
|
||||
openReview: 'Open review', pagination: 'Activity pages', previous: 'Newer', next: 'Older', page: 'Page {{page}}'
|
||||
},
|
||||
common: {
|
||||
operationFailed: 'Supervisor operation failed',
|
||||
unavailable: 'Not available',
|
||||
@@ -18,8 +28,8 @@ export const heartbeat = {
|
||||
navigation: 'Supervisor views', recap: 'Work review', graph: 'Story graph', settings: 'Settings',
|
||||
viewInGraph: 'View in graph',
|
||||
unavailable: 'Supervisor service is unavailable', loading: 'Loading Supervisor review', scope: 'Review scope', period: 'Time range', days: '{{count}} days',
|
||||
sourcesHint: 'A review reads only sources in its explicit scope and time range; automatic wake-up does not change manual review scope.', latest: 'Latest successful review', openItems: 'Open items', history: 'Review history',
|
||||
empty: 'No successful review yet', emptyHint: 'You can review current progress manually even without an automatic wake-up plan.', run: 'Review current progress', running: 'Reviewing…', retryRun: 'Retry review', dismiss: 'Dismiss',
|
||||
sourcesHint: 'Manual review reprocesses the selected period, including previously reviewed sources. Automatic supervision processes only new or changed source portions. Deleting a report does not reset automatic progress or rebuild the graph.', latest: 'Latest successful review', openItems: 'Open items', history: 'Review history',
|
||||
empty: 'No successful review yet', emptyHint: 'You can review current progress manually even without an automatic supervision plan.', run: 'Review current progress', running: 'Reviewing…', retryRun: 'Retry review', dismiss: 'Dismiss',
|
||||
graphScope: 'Graph scope', graphEmpty: 'No story events in this scope', legend: 'Solid lines show event impact on entities; dashed lines show entity relations. Time runs counter-clockwise with a visible gap.', start: 'Start', end: 'End',
|
||||
events: 'Time events', entities: 'Knowledge entities', relations: 'Entity relations', eventSources: 'Event sources', sources: 'Related sources', noSources: 'No related sources are available.', selectHint: 'Select an event, entity, or relation to inspect it.', sourceSnapshot: 'Source details', sourceMissing: 'Source not found',
|
||||
confirm: 'Confirm', revise: 'Revise', remove: 'Remove relation', label: 'Entity name', save: 'Save revision', cancel: 'Cancel', removeHint: 'This changes graph organization only; the original source remains available.',
|
||||
@@ -29,7 +39,7 @@ export const heartbeat = {
|
||||
center: {
|
||||
title: 'Supervisor',
|
||||
description:
|
||||
'Reviews work progress and knowledge evolution. Smart Heartbeat wakes Supervisor on a schedule.',
|
||||
'Review work progress and knowledge evolution manually or configure automatic supervision.',
|
||||
scope: {
|
||||
currentProject: 'Current project',
|
||||
global: 'Global'
|
||||
@@ -37,32 +47,32 @@ export const heartbeat = {
|
||||
actions: {
|
||||
refreshAriaLabel: 'Refresh Supervisor',
|
||||
refresh: 'Refresh',
|
||||
running: 'Waking Supervisor…',
|
||||
running: 'Reviewing…',
|
||||
runOnce: 'Review now',
|
||||
configure: 'Configure automatic wake-up',
|
||||
configure: 'Configure automatic supervision',
|
||||
retry: 'Retry'
|
||||
},
|
||||
loading: {
|
||||
description: 'Loading heartbeat plans, runs, and reports.',
|
||||
description: 'Loading automatic supervision plans, runs, and reports.',
|
||||
title: 'Loading Supervisor',
|
||||
failedTitle: 'Could not load Supervisor',
|
||||
refreshFailedTitle: 'Could not refresh Supervisor'
|
||||
},
|
||||
tabs: {
|
||||
ariaLabel: 'Supervisor automatic wake-up views',
|
||||
overview: 'Wake-up overview',
|
||||
ariaLabel: 'Automatic supervision settings and history',
|
||||
overview: 'Run overview',
|
||||
suggestions: 'Pending suggestions',
|
||||
history: 'Reports and runs',
|
||||
plans: 'Automatic wake-up settings'
|
||||
plans: 'Automatic supervision'
|
||||
},
|
||||
currentStatus: {
|
||||
title: 'Current status',
|
||||
activePlans: 'Active plans: {{formattedCount}}',
|
||||
disabled: 'Not enabled',
|
||||
emptyTitle: 'No heartbeat plan',
|
||||
emptyTitle: 'Automatic supervision is not configured. Only manual reviews are available.',
|
||||
emptyDescription:
|
||||
'Create a daily or weekly plan to review conversations and tasks in the selected scope and generate suggestions.',
|
||||
createPlan: 'Create heartbeat plan'
|
||||
createPlan: 'Create automatic supervision plan'
|
||||
},
|
||||
recurrence: {
|
||||
daily: 'Every day at {{time}}',
|
||||
@@ -78,7 +88,7 @@ export const heartbeat = {
|
||||
saturday: 'Saturday'
|
||||
},
|
||||
config: {
|
||||
nextHeartbeat: 'Next heartbeat',
|
||||
nextHeartbeat: 'Next review',
|
||||
lastStatus: 'Last status',
|
||||
neverRun: 'Never run',
|
||||
runNow: 'Run now',
|
||||
@@ -86,25 +96,25 @@ export const heartbeat = {
|
||||
resume: 'Resume'
|
||||
},
|
||||
metrics: {
|
||||
ariaLabel: 'Automatic wake-up run metrics',
|
||||
health: 'Heartbeat health',
|
||||
ariaLabel: 'Automatic supervision run metrics',
|
||||
health: 'Run success rate',
|
||||
successfulRuns: '{{completed}}/{{total}} completed successfully',
|
||||
healthRateAriaLabel: 'Heartbeat success rate {{percent}}',
|
||||
healthRateAriaLabel: 'Review success rate {{percent}}',
|
||||
memory: 'Memory confirmation',
|
||||
memoryDescription: 'Confirmed memories / heartbeat suggestions',
|
||||
memoryDescription: 'Confirmed memories / supervision suggestions',
|
||||
memoryRateAriaLabel: 'Memory confirmation rate {{percent}}',
|
||||
insights: 'Report insights',
|
||||
insightReports: 'Heartbeat reports: {{formattedCount}}',
|
||||
insightReports: 'Review reports: {{formattedCount}}',
|
||||
latestInsights: 'Latest report findings: {{formattedCount}}',
|
||||
awaitingFirstRun: 'Waiting for the first heartbeat',
|
||||
awaitingFirstRun: 'Waiting for the first review',
|
||||
action: 'Action conversion',
|
||||
actionDescription: 'Completed tasks / heartbeat suggestions',
|
||||
actionDescription: 'Completed tasks / supervision suggestions',
|
||||
actionRateAriaLabel: 'Suggested task completion rate {{percent}}'
|
||||
},
|
||||
trend: {
|
||||
title: 'Report trend',
|
||||
empty:
|
||||
'After a heartbeat runs, this chart shows changes in insight, memory, and action suggestion counts.',
|
||||
'After a review runs, this chart shows changes in insight, memory, and action suggestion counts.',
|
||||
insight: 'Insights',
|
||||
memory: 'Memories',
|
||||
action: 'Actions',
|
||||
@@ -112,11 +122,11 @@ export const heartbeat = {
|
||||
'{{date}}: {{insights}} insights, {{memories}} memory suggestions, and {{actions}} action suggestions'
|
||||
},
|
||||
latest: {
|
||||
title: 'Latest heartbeat',
|
||||
title: 'Latest review',
|
||||
viewHistory: 'View reports and runs',
|
||||
handleSuggestions: 'Review suggestions ({{formattedCount}})',
|
||||
empty:
|
||||
'There are no heartbeat reports yet. Run one to view insight, memory, and action suggestions.'
|
||||
'There are no review reports yet. Run one to view insight, memory, and action suggestions.'
|
||||
},
|
||||
suggestions: {
|
||||
memoryTitle: 'Memories to confirm',
|
||||
@@ -130,24 +140,24 @@ export const heartbeat = {
|
||||
ignore: 'Ignore',
|
||||
taskTitle: 'Suggested actions',
|
||||
taskCount: 'Items: {{formattedCount}}',
|
||||
taskEmpty: 'Automatic wake-up has not suggested any actions.',
|
||||
taskEmpty: 'Automatic supervision has not suggested any actions.',
|
||||
useInConversation: 'Handle in conversation',
|
||||
markCompleted: 'Mark completed',
|
||||
ignoreSuggestion: 'Ignore suggestion'
|
||||
},
|
||||
history: {
|
||||
timelineTitle: 'Heartbeat reports',
|
||||
timelineTitle: 'Review reports',
|
||||
reportCount: 'Reports: {{formattedCount}}',
|
||||
emptyTimeline:
|
||||
'Reports from completed heartbeat runs appear here.',
|
||||
'Reports from completed reviews appear here.',
|
||||
reportSummary:
|
||||
'{{insights}} insights · {{memories}} memories · {{actions}} actions',
|
||||
collapseReport: 'Collapse report',
|
||||
expandReport: 'Expand full report',
|
||||
loadMoreReports: 'Load more heartbeat reports',
|
||||
loadMoreReports: 'Load more review reports',
|
||||
auditTitle: 'Run history',
|
||||
runCount: 'Runs: {{formattedCount}}',
|
||||
emptyRuns: 'There are no automatic wake-up runs yet.',
|
||||
emptyRuns: 'There are no automatic supervision runs yet.',
|
||||
manualRun: 'Manual run',
|
||||
scheduledRun: 'Scheduled run',
|
||||
attempt: 'Attempt {{formattedCount}}',
|
||||
@@ -159,7 +169,8 @@ export const heartbeat = {
|
||||
claimed: 'Running',
|
||||
completed: 'Completed',
|
||||
failed: 'Failed',
|
||||
skipped: 'Skipped'
|
||||
skipped: 'Skipped',
|
||||
no_change: 'No changes (no model call)'
|
||||
},
|
||||
task: {
|
||||
queued: 'Queued',
|
||||
@@ -180,32 +191,36 @@ export const heartbeat = {
|
||||
}
|
||||
},
|
||||
settings: {
|
||||
title: 'Automatic wake-up',
|
||||
title: 'Automatic supervision',
|
||||
description:
|
||||
'Automatic wake-ups run on schedule in read-only mode without tools.',
|
||||
recurrenceAriaLabel: 'Heartbeat recurrence',
|
||||
recurrenceLabel: 'Recurrence',
|
||||
'Review the selected scope on schedule in read-only mode without tools. You confirm and handle suggestions.',
|
||||
scheduleHelp: 'Review daily or weekly at a specified time. Minute intervals are not supported. Automatic runs start only after you save and enable a plan.',
|
||||
timezone: 'Plan time zone: {{timezone}}. New plans use this device\'s time zone; edits keep the saved time zone.',
|
||||
windowSummary: 'Review the last {{hours}} hours · Keep run history for {{days}} days',
|
||||
allPaused: 'All automatic supervision plans are paused. Only manual reviews are available.',
|
||||
recurrenceAriaLabel: 'Supervision frequency',
|
||||
recurrenceLabel: 'Frequency',
|
||||
daily: 'Daily',
|
||||
weekly: 'Weekly',
|
||||
weekdayAriaLabel: 'Heartbeat weekday',
|
||||
weekdayAriaLabel: 'Supervision weekday',
|
||||
weekdayLabel: 'Weekday',
|
||||
timeAriaLabel: 'Heartbeat time',
|
||||
timeAriaLabel: 'Supervision time',
|
||||
timeLabel: 'Time',
|
||||
nameLabel: 'Plan name',
|
||||
createTitle: 'Create heartbeat plan',
|
||||
editTitle: 'Edit heartbeat plan',
|
||||
createTitle: 'Create automatic supervision plan',
|
||||
editTitle: 'Edit automatic supervision plan',
|
||||
cancelEdit: 'Cancel editing',
|
||||
editAriaLabel: 'Edit {{name}}',
|
||||
edit: 'Edit',
|
||||
saveAriaLabel: 'Save automatic wake-up plan',
|
||||
saveAriaLabel: 'Save automatic supervision plan',
|
||||
save: 'Save changes',
|
||||
lookbackLabel: 'Review window (hours)',
|
||||
lookbackAriaLabel: 'Heartbeat review window in hours',
|
||||
lookbackAriaLabel: 'Review window (hours)',
|
||||
retentionLabel: 'History retention (days)',
|
||||
retentionAriaLabel: 'Heartbeat history retention in days',
|
||||
retentionAriaLabel: 'History retention (days)',
|
||||
scope: {
|
||||
legend: 'Review scope',
|
||||
ariaLabel: 'Choose heartbeat review scope',
|
||||
legend: 'Project scope',
|
||||
ariaLabel: 'Choose automatic supervision project scope',
|
||||
global: 'Global',
|
||||
projects: 'Selected projects',
|
||||
globalHelp:
|
||||
@@ -220,12 +235,12 @@ export const heartbeat = {
|
||||
selectedProjectsSummary: '{{count}} projects: {{names}}',
|
||||
nameSeparator: ', '
|
||||
},
|
||||
enableAriaLabel: 'Enable automatic wake-up',
|
||||
enabling: 'Enabling…',
|
||||
enable: 'Enable automatic wake-up',
|
||||
enableAriaLabel: 'Save and enable plan',
|
||||
enabling: 'Saving…',
|
||||
enable: 'Save and enable plan',
|
||||
defaultName: 'Scheduled review',
|
||||
empty: 'Automatic wake-up is not configured for this scope.',
|
||||
running: 'Running',
|
||||
empty: 'Automatic supervision is not configured. Only manual reviews are available.',
|
||||
running: 'Enabled',
|
||||
paused: 'Paused',
|
||||
next: 'Next: {{date}}',
|
||||
last: 'Last: {{status}}',
|
||||
@@ -233,7 +248,7 @@ export const heartbeat = {
|
||||
resumeAriaLabel: 'Resume {{name}}',
|
||||
pause: 'Pause',
|
||||
resume: 'Resume',
|
||||
runNowAriaLabel: 'Run heartbeat now for {{name}}',
|
||||
runNowAriaLabel: 'Run now for {{name}}',
|
||||
runNow: 'Run now',
|
||||
cancelDeleteAriaLabel: 'Cancel deleting {{name}}',
|
||||
confirmDeleteAriaLabel: 'Confirm deleting {{name}}',
|
||||
|
||||
@@ -99,7 +99,7 @@ export const workspace = {
|
||||
danger: {
|
||||
title: 'Danger zone',
|
||||
description:
|
||||
'Deleting this project permanently removes its conversations, tasks, schedules, heartbeats, memories, and results from GoodBuddy. It does not delete the project folder or files on disk.',
|
||||
'Deleting this project permanently removes its conversations, tasks, schedules, automatic supervision data, memories, and results from GoodBuddy. It does not delete the project folder or files on disk.',
|
||||
delete: 'Delete project',
|
||||
confirmation: 'Enter “{{projectName}}” to confirm deletion',
|
||||
cancel: 'Cancel deletion',
|
||||
|
||||
@@ -19,7 +19,7 @@ export const app = {
|
||||
confirmFailed: '无法确认保存结果,请重新读取后再修改。',
|
||||
descriptions: {
|
||||
'magic-notes': '记录笔记、整理待办并获取 AI 评论。', knowledge: '管理知识来源,为会话检索资料。',
|
||||
heartbeat: '回顾工作演变、查看故事线图谱,并配置自动唤醒。', 'local-inference': '查看本机推理任务与执行服务。'
|
||||
heartbeat: '回顾工作演变、查看故事线图谱,并配置自动监督。', 'local-inference': '查看本机推理任务与执行服务。'
|
||||
}
|
||||
},
|
||||
notifications: {
|
||||
@@ -703,7 +703,7 @@ export const app = {
|
||||
userDecision: '用户选择了{{decision}}',
|
||||
conversationDeleted: '对应对话已被删除',
|
||||
localDataCleared:
|
||||
'本地对话、任务、记忆、心跳、自动化和知识库索引已清除',
|
||||
'本地对话、任务、记忆、自动监督、自动化和知识库索引已清除',
|
||||
selectKnowledgeBase: '请先选择知识库',
|
||||
knowledgeGraphRebuilt: '知识图谱已重新抽取',
|
||||
knowledgeSettingsUpdated: '知识库设置已更新',
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
export const heartbeat = {
|
||||
activity: {
|
||||
title: '活动', description: '记录手动回顾和自动监督的实际执行,停留在此页签时自动刷新。实体与关系修改目前没有按时间保存的操作审计。',
|
||||
loading: '正在读取活动', loadingHint: '读取已保存的执行记录。', empty: '暂无活动记录', emptyHint: '可手动回顾当前进展,或在设置中配置自动监督。',
|
||||
kind: { supervision: '工作回顾', heartbeat: '自动监督' },
|
||||
status: { running: '运行中', completed: '已完成', failed: '失败', skipped: '已跳过', no_change: '无变化(未调用模型)' },
|
||||
triggers: { manual: '用户触发', scheduled: '定时计划', heartbeat: '心跳触发' },
|
||||
trigger: '触发方式', started: '开始时间', finished: '结束时间', unknownScope: '未保存执行范围',
|
||||
heartbeatStage: '心跳报告', supervisionStage: '监督回顾', notRecorded: '无执行记录',
|
||||
openReview: '查看回顾', pagination: '活动分页', previous: '较新记录', next: '更早记录', page: '第 {{page}} 页'
|
||||
},
|
||||
common: {
|
||||
operationFailed: '监督者操作失败',
|
||||
unavailable: '暂无',
|
||||
@@ -15,8 +25,8 @@ export const heartbeat = {
|
||||
navigation: '监督者视图', recap: '工作回顾', graph: '故事线图谱', settings: '设置',
|
||||
viewInGraph: '在图谱中查看',
|
||||
unavailable: '监督者服务暂不可用', loading: '正在读取监督回顾', scope: '关注范围', period: '时间范围', days: '{{count}} 天',
|
||||
sourcesHint: '回顾只读取本次明确范围和时间区间内的来源;自动唤醒计划不会改变手动回顾范围。', latest: '最近一次成功回顾', openItems: '未解决事项', history: '历史结果',
|
||||
empty: '还没有成功回顾', emptyHint: '即使没有自动唤醒计划,也可以手动回顾当前进展。', run: '回顾当前进展', running: '回顾整理中…', retryRun: '重试回顾', dismiss: '关闭提示',
|
||||
sourcesHint: '手动回顾会重新整理所选区间,包括已回顾的来源;自动监督只处理新增或修改的来源片段。删除报告不会重置自动处理进度,也不会重建图谱。', latest: '最近一次成功回顾', openItems: '未解决事项', history: '历史结果',
|
||||
empty: '还没有成功回顾', emptyHint: '即使没有自动监督计划,也可以手动回顾当前进展。', run: '回顾当前进展', running: '回顾整理中…', retryRun: '重试回顾', dismiss: '关闭提示',
|
||||
graphScope: '图谱范围', graphEmpty: '当前范围没有故事线事件', legend: '实线表示事件影响实体,虚线表示实体关系。时间轴逆时针排列,起止之间保留缺口。', start: '起点', end: '终点',
|
||||
events: '时间事件', entities: '知识实体', relations: '实体关系', eventSources: '事件来源', sources: '关联来源', noSources: '没有可用的关联来源。', selectHint: '选择事件、实体或关系查看详情。', sourceSnapshot: '来源详情', sourceMissing: '来源不存在',
|
||||
confirm: '确认', revise: '修订', remove: '移除关系', label: '实体名称', save: '保存修订', cancel: '取消', removeHint: '这只改变图谱中的关系组织,原始来源仍然保留。',
|
||||
@@ -25,7 +35,7 @@ export const heartbeat = {
|
||||
},
|
||||
center: {
|
||||
title: '监督者',
|
||||
description: '持续回顾工作进展、追踪知识演变;智能心跳负责按计划唤醒监督者。',
|
||||
description: '回顾工作进展、追踪知识演变;可手动回顾,也可配置自动监督计划。',
|
||||
scope: {
|
||||
currentProject: '当前项目',
|
||||
global: '全局'
|
||||
@@ -33,32 +43,32 @@ export const heartbeat = {
|
||||
actions: {
|
||||
refreshAriaLabel: '刷新监督者',
|
||||
refresh: '刷新',
|
||||
running: '自动唤醒中…',
|
||||
running: '回顾中…',
|
||||
runOnce: '立即回顾',
|
||||
configure: '配置自动唤醒',
|
||||
configure: '配置自动监督',
|
||||
retry: '重试'
|
||||
},
|
||||
loading: {
|
||||
description: '正在读取心跳计划、运行记录和心跳报告。',
|
||||
description: '正在读取自动监督计划、运行记录和回顾报告。',
|
||||
title: '正在加载监督者',
|
||||
failedTitle: '监督者加载失败',
|
||||
refreshFailedTitle: '监督者刷新失败'
|
||||
},
|
||||
tabs: {
|
||||
ariaLabel: '监督者自动唤醒视图',
|
||||
overview: '自动唤醒概览',
|
||||
ariaLabel: '自动监督设置与记录',
|
||||
overview: '运行概览',
|
||||
suggestions: '待处理建议',
|
||||
history: '报告与记录',
|
||||
plans: '自动唤醒设置'
|
||||
plans: '自动监督'
|
||||
},
|
||||
currentStatus: {
|
||||
title: '当前状态',
|
||||
activePlans: '{{formattedCount}} 个计划运行中',
|
||||
disabled: '尚未启用',
|
||||
emptyTitle: '尚未配置心跳计划',
|
||||
emptyTitle: '尚未配置自动监督,目前仅支持手动回顾',
|
||||
emptyDescription:
|
||||
'创建每日或每周计划,GoodBuddy 将按范围回顾对话和任务并生成建议。',
|
||||
createPlan: '创建心跳计划'
|
||||
createPlan: '创建自动监督计划'
|
||||
},
|
||||
recurrence: {
|
||||
daily: '每天 {{time}}',
|
||||
@@ -74,33 +84,33 @@ export const heartbeat = {
|
||||
saturday: '周六'
|
||||
},
|
||||
config: {
|
||||
nextHeartbeat: '下次心跳',
|
||||
nextHeartbeat: '下次回顾',
|
||||
lastStatus: '上次状态',
|
||||
neverRun: '尚未运行',
|
||||
runNow: '立即心跳',
|
||||
runNow: '立即运行',
|
||||
pause: '暂停',
|
||||
resume: '恢复'
|
||||
},
|
||||
metrics: {
|
||||
ariaLabel: '自动唤醒运行统计',
|
||||
health: '心跳健康',
|
||||
ariaLabel: '自动监督运行统计',
|
||||
health: '运行成功率',
|
||||
successfulRuns: '{{completed}}/{{total}} 次成功完成',
|
||||
healthRateAriaLabel: '心跳成功率 {{percent}}',
|
||||
healthRateAriaLabel: '回顾成功率 {{percent}}',
|
||||
memory: '记忆确认',
|
||||
memoryDescription: '已确认记忆 / 心跳建议',
|
||||
memoryDescription: '已确认记忆 / 监督建议',
|
||||
memoryRateAriaLabel: '记忆确认率 {{percent}}',
|
||||
insights: '报告洞察',
|
||||
insightReports: '来自 {{formattedCount}} 份心跳报告',
|
||||
insightReports: '来自 {{formattedCount}} 份回顾报告',
|
||||
latestInsights: '最近一次发现 {{formattedCount}} 条',
|
||||
awaitingFirstRun: '等待首次心跳',
|
||||
awaitingFirstRun: '等待首次回顾',
|
||||
action: '行动转化',
|
||||
actionDescription: '已完成任务 / 心跳建议',
|
||||
actionDescription: '已完成任务 / 监督建议',
|
||||
actionRateAriaLabel: '建议任务完成率 {{percent}}'
|
||||
},
|
||||
trend: {
|
||||
title: '报告趋势',
|
||||
empty:
|
||||
'运行心跳后,这里会显示洞察、记忆和行动建议的数量变化。',
|
||||
'运行回顾后,这里会显示洞察、记忆和行动建议的数量变化。',
|
||||
insight: '洞察',
|
||||
memory: '记忆',
|
||||
action: '行动',
|
||||
@@ -108,11 +118,11 @@ export const heartbeat = {
|
||||
'{{date}}:{{insights}} 条洞察,{{memories}} 条记忆建议,{{actions}} 个行动建议'
|
||||
},
|
||||
latest: {
|
||||
title: '本次心跳',
|
||||
title: '最近回顾',
|
||||
viewHistory: '查看报告与记录',
|
||||
handleSuggestions: '处理 {{formattedCount}} 条建议',
|
||||
empty:
|
||||
'尚无心跳报告。运行一次后,可在这里查看洞察、记忆和行动建议。'
|
||||
'尚无回顾报告。运行一次后,可在这里查看洞察、记忆和行动建议。'
|
||||
},
|
||||
suggestions: {
|
||||
memoryTitle: '待确认记忆',
|
||||
@@ -126,23 +136,23 @@ export const heartbeat = {
|
||||
ignore: '忽略',
|
||||
taskTitle: '行动建议',
|
||||
taskCount: '{{formattedCount}} 个',
|
||||
taskEmpty: '当前没有由自动唤醒产生的行动建议。',
|
||||
taskEmpty: '当前没有由自动监督产生的行动建议。',
|
||||
useInConversation: '带入对话处理',
|
||||
markCompleted: '标记完成',
|
||||
ignoreSuggestion: '忽略建议'
|
||||
},
|
||||
history: {
|
||||
timelineTitle: '心跳报告',
|
||||
timelineTitle: '回顾报告',
|
||||
reportCount: '{{formattedCount}} 份报告',
|
||||
emptyTimeline: '每次运行生成的心跳报告会显示在这里。',
|
||||
emptyTimeline: '每次运行生成的回顾报告会显示在这里。',
|
||||
reportSummary:
|
||||
'{{insights}} 条洞察 · {{memories}} 条记忆 · {{actions}} 个行动',
|
||||
collapseReport: '收起报告',
|
||||
expandReport: '展开完整报告',
|
||||
loadMoreReports: '加载更多心跳报告',
|
||||
loadMoreReports: '加载更多回顾报告',
|
||||
auditTitle: '运行记录',
|
||||
runCount: '{{formattedCount}} 次',
|
||||
emptyRuns: '尚无自动唤醒运行记录。',
|
||||
emptyRuns: '尚无自动监督运行记录。',
|
||||
manualRun: '手动运行',
|
||||
scheduledRun: '周期运行',
|
||||
attempt: '第 {{formattedCount}} 次尝试',
|
||||
@@ -154,7 +164,8 @@ export const heartbeat = {
|
||||
claimed: '运行中',
|
||||
completed: '已完成',
|
||||
failed: '失败',
|
||||
skipped: '已跳过'
|
||||
skipped: '已跳过',
|
||||
no_change: '无变化(未调用模型)'
|
||||
},
|
||||
task: {
|
||||
queued: '等待中',
|
||||
@@ -175,31 +186,35 @@ export const heartbeat = {
|
||||
}
|
||||
},
|
||||
settings: {
|
||||
title: '自动唤醒',
|
||||
description: '自动唤醒按时只读运行,不调用工具。',
|
||||
recurrenceAriaLabel: '心跳重复规则',
|
||||
recurrenceLabel: '重复规则',
|
||||
title: '自动监督',
|
||||
description: '按计划只读回顾所选范围,不调用工具;建议由你确认和处理。',
|
||||
scheduleHelp: '支持每天或每周在指定时间回顾,暂不支持按分钟间隔运行。填写后需保存并启用计划才会自动运行。',
|
||||
timezone: '计划时区:{{timezone}}。新计划使用本机时区,编辑时保留原时区。',
|
||||
windowSummary: '回顾最近 {{hours}} 小时 · 运行历史保留 {{days}} 天',
|
||||
allPaused: '所有自动监督计划已暂停,目前仅支持手动回顾。',
|
||||
recurrenceAriaLabel: '监督频率',
|
||||
recurrenceLabel: '频率',
|
||||
daily: '每天',
|
||||
weekly: '每周',
|
||||
weekdayAriaLabel: '心跳星期',
|
||||
weekdayAriaLabel: '监督星期',
|
||||
weekdayLabel: '星期',
|
||||
timeAriaLabel: '心跳时间',
|
||||
timeAriaLabel: '监督时间',
|
||||
timeLabel: '时间',
|
||||
nameLabel: '计划名称',
|
||||
createTitle: '创建心跳计划',
|
||||
editTitle: '编辑心跳计划',
|
||||
createTitle: '创建自动监督计划',
|
||||
editTitle: '编辑自动监督计划',
|
||||
cancelEdit: '取消编辑',
|
||||
editAriaLabel: '编辑 {{name}}',
|
||||
edit: '编辑',
|
||||
saveAriaLabel: '保存自动唤醒计划',
|
||||
saveAriaLabel: '保存自动监督计划',
|
||||
save: '保存修改',
|
||||
lookbackLabel: '回顾范围(小时)',
|
||||
lookbackAriaLabel: '心跳回顾小时数',
|
||||
lookbackLabel: '回顾窗口(小时)',
|
||||
lookbackAriaLabel: '回顾窗口(小时)',
|
||||
retentionLabel: '历史保留(天)',
|
||||
retentionAriaLabel: '心跳历史保留天数',
|
||||
retentionAriaLabel: '历史保留(天)',
|
||||
scope: {
|
||||
legend: '回顾范围',
|
||||
ariaLabel: '选择心跳回顾范围',
|
||||
legend: '项目范围',
|
||||
ariaLabel: '选择自动监督项目范围',
|
||||
global: '全局',
|
||||
projects: '指定项目',
|
||||
globalHelp:
|
||||
@@ -213,12 +228,12 @@ export const heartbeat = {
|
||||
selectedProjectsSummary: '{{count}} 个项目:{{names}}',
|
||||
nameSeparator: '、'
|
||||
},
|
||||
enableAriaLabel: '启用自动唤醒',
|
||||
enabling: '启用中…',
|
||||
enable: '启用自动唤醒',
|
||||
enableAriaLabel: '保存并启用计划',
|
||||
enabling: '保存中…',
|
||||
enable: '保存并启用计划',
|
||||
defaultName: '定期回顾',
|
||||
empty: '当前范围尚未配置自动唤醒。',
|
||||
running: '运行中',
|
||||
empty: '尚未配置自动监督,目前仅支持手动回顾',
|
||||
running: '已启用',
|
||||
paused: '已暂停',
|
||||
next: '下次 {{date}}',
|
||||
last: '上次 {{status}}',
|
||||
@@ -226,8 +241,8 @@ export const heartbeat = {
|
||||
resumeAriaLabel: '恢复 {{name}}',
|
||||
pause: '暂停',
|
||||
resume: '恢复',
|
||||
runNowAriaLabel: '立即心跳 {{name}}',
|
||||
runNow: '立即心跳',
|
||||
runNowAriaLabel: '立即运行 {{name}}',
|
||||
runNow: '立即运行',
|
||||
cancelDeleteAriaLabel: '取消删除 {{name}}',
|
||||
confirmDeleteAriaLabel: '确认删除 {{name}}',
|
||||
confirmDelete: '确认删除计划',
|
||||
|
||||
@@ -96,7 +96,7 @@ export const workspace = {
|
||||
danger: {
|
||||
title: '危险操作',
|
||||
description:
|
||||
'删除项目会永久移除 GoodBuddy 中的项目、对话、任务、计划、心跳、记忆和成果,但不会删除磁盘上的项目目录或文件。',
|
||||
'删除项目会永久移除 GoodBuddy 中的项目、对话、任务、计划、自动监督、记忆和成果,但不会删除磁盘上的项目目录或文件。',
|
||||
delete: '删除项目',
|
||||
confirmation: '输入“{{projectName}}”确认删除',
|
||||
cancel: '取消删除',
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
pointer-events: all;
|
||||
}
|
||||
.supervisor-workspace__toolbar,
|
||||
.supervisor-workspace__action-bar,
|
||||
.supervisor-workspace__section-heading,
|
||||
.supervisor-workspace__actions {
|
||||
display: flex;
|
||||
@@ -41,6 +42,21 @@
|
||||
gap: var(--space-4);
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.supervisor-workspace__action-bar {
|
||||
justify-content: space-between;
|
||||
min-width: 0;
|
||||
}
|
||||
.supervisor-workspace__action-bar > div {
|
||||
min-width: 0;
|
||||
}
|
||||
.supervisor-workspace__action-bar p {
|
||||
color: var(--text-secondary);
|
||||
margin: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.supervisor-workspace__action-bar p + p {
|
||||
margin-top: var(--space-2);
|
||||
}
|
||||
.supervisor-workspace__toolbar {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
@@ -574,3 +590,51 @@
|
||||
padding: var(--space-4);
|
||||
}
|
||||
}
|
||||
.supervisor-activity {
|
||||
display: grid;
|
||||
gap: var(--space-4);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.supervisor-activity__list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
gap: var(--space-4);
|
||||
}
|
||||
|
||||
.supervisor-activity__item {
|
||||
padding: var(--space-4);
|
||||
border: 1px solid var(--border-default);
|
||||
border-radius: var(--radius-card);
|
||||
background: var(--surface-raised);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.supervisor-activity__item header,
|
||||
.supervisor-activity__stages {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.supervisor-activity__item dl {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.supervisor-activity__item dt,
|
||||
.supervisor-activity__note,
|
||||
.supervisor-activity__stages {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.supervisor-activity__item dd { margin: var(--space-1) 0 0; }
|
||||
.supervisor-activity__summary { white-space: pre-wrap; }
|
||||
.supervisor-activity__status { font-size: var(--font-caption); }
|
||||
.supervisor-activity__status--running { color: var(--accent); }
|
||||
.supervisor-activity__status--completed { color: var(--success); }
|
||||
.supervisor-activity__status--failed { color: var(--danger); }
|
||||
|
||||
Reference in New Issue
Block a user