feat: add app management, local inference controls, and task statistics

This commit is contained in:
mesalogo
2026-09-18 08:20:45 +08:00
parent 6dd6297414
commit bbae893c45
103 changed files with 7962 additions and 1490 deletions
+17
View File
@@ -96,6 +96,23 @@ afterEach(async () => {
})
describe('GoodBuddyConfigService', () => {
it('publishes persisted application changes from config apply through the settings event', async () => {
const { application, service, workspace } = await createHarness()
const changed = vi.fn()
const unsubscribe = application.onChanged(changed)
const current = await application.get()
const applicationNavigation = { ...current.applicationNavigation, order: [...current.applicationNavigation.order].reverse() }
const plan = await service.plan('settings-sync', workspace, {
operations: [{ operation: 'application.update', updates: { applicationNavigation } }],
})
expect(changed).not.toHaveBeenCalled()
await service.apply('settings-sync', { planId: plan.planId }, new AbortController().signal, async () => true)
expect(changed).toHaveBeenCalledExactlyOnceWith(await application.get())
expect(changed.mock.calls[0]![0].applicationNavigation).toEqual(applicationNavigation)
unsubscribe()
await application.update({ localInferenceEnabled: false })
expect(changed).toHaveBeenCalledOnce()
})
it('returns only sanitized configuration and publishes common examples', async () => {
const { service, capabilities } = await createHarness()
await capabilities.saveMcpServer(undefined, {