From fa90d826de3eda9cb2131e81a480a83523c8e707 Mon Sep 17 00:00:00 2001 From: William Valentin Date: Mon, 16 Feb 2026 15:17:27 -0800 Subject: [PATCH] feat(setup): show operator automation and backup state in summary --- docs/plans/state.json | 6 ++++-- src/cli/setup/config.ts | 2 ++ src/cli/setup/summary.test.ts | 27 +++++++++++++++++++++++++++ src/cli/setup/summary.ts | 12 ++++++++++++ 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 src/cli/setup/summary.test.ts diff --git a/docs/plans/state.json b/docs/plans/state.json index 70c2814..56e3dca 100644 --- a/docs/plans/state.json +++ b/docs/plans/state.json @@ -201,6 +201,8 @@ "src/cli/setup/automation.ts", "src/cli/setup/orchestrator.ts", "src/cli/setup/integration.test.ts", + "src/cli/setup/summary.ts", + "src/cli/setup/summary.test.ts", "src/automation/heartbeat.ts", "src/automation/heartbeat.test.ts", "src/config/schema.ts", @@ -211,7 +213,7 @@ "README.md", "docs/plans/state.json" ], - "test_status": "pnpm test:run src/cli/setup/integration.test.ts src/cli/setup/automation.test.ts src/cli/setup/config.test.ts src/automation/heartbeat.test.ts src/config/schema.test.ts src/cli/doctor.test.ts + pnpm typecheck passing" + "test_status": "pnpm test:run src/cli/setup/summary.test.ts src/cli/setup/integration.test.ts src/cli/setup/automation.test.ts src/cli/setup/config.test.ts src/automation/heartbeat.test.ts src/config/schema.test.ts src/cli/doctor.test.ts + pnpm typecheck passing" }, "backup-session-summary-audit-trail": { "status": "completed", @@ -3497,7 +3499,7 @@ } }, "overall_progress": { - "total_test_count": 1867, + "total_test_count": 1868, "all_tests_passing": true, "p0_completion": "3/3 (100%)", "p1_completion": "4/4 (100%)", diff --git a/src/cli/setup/config.ts b/src/cli/setup/config.ts index 00a4496..80f3c52 100644 --- a/src/cli/setup/config.ts +++ b/src/cli/setup/config.ts @@ -42,6 +42,8 @@ export interface SetupConfig { gdrive?: { enabled?: boolean }; gtasks?: { enabled?: boolean }; heartbeat?: { enabled?: boolean }; + daily_briefing?: { enabled?: boolean }; + minio_sync?: { enabled?: boolean }; } & Record; backup?: { enabled?: boolean; diff --git a/src/cli/setup/summary.test.ts b/src/cli/setup/summary.test.ts new file mode 100644 index 0000000..c678e1d --- /dev/null +++ b/src/cli/setup/summary.test.ts @@ -0,0 +1,27 @@ +import { describe, it, expect } from 'vitest'; +import { renderSummary } from './summary.js'; +import type { SetupConfig } from './config.js'; + +describe('renderSummary', () => { + it('renders operator-pack related automation and backup state', () => { + const config = { + models: { + default: { provider: 'anthropic', model: 'claude-sonnet' }, + }, + server: { port: 18800, localhost: true }, + automation: { + heartbeat: { enabled: true }, + daily_briefing: { enabled: true }, + minio_sync: { enabled: true }, + }, + backup: { + enabled: true, + schedule: '0 2 * * *', + }, + } as unknown as SetupConfig; + + const output = renderSummary(config); + expect(output).toContain('Automation: heartbeat, daily-briefing, minio-sync'); + expect(output).toContain('Backup: enabled (cron 0 2 * * *)'); + }); +}); diff --git a/src/cli/setup/summary.ts b/src/cli/setup/summary.ts index 54979c6..5b2ef19 100644 --- a/src/cli/setup/summary.ts +++ b/src/cli/setup/summary.ts @@ -32,8 +32,20 @@ export function renderSummary(config: SetupConfig): string { if (auto.gdrive?.enabled) {autoFeatures.push('gdrive');} if (auto.gtasks?.enabled) {autoFeatures.push('gtasks');} if (auto.heartbeat?.enabled) {autoFeatures.push('heartbeat');} + if (auto.daily_briefing?.enabled) {autoFeatures.push('daily-briefing');} + if (auto.minio_sync?.enabled) {autoFeatures.push('minio-sync');} lines.push(` Automation: ${autoFeatures.join(', ') || 'none'}`); + const backup = config.backup; + if (backup?.enabled) { + const mode = typeof backup.schedule === 'string' && backup.schedule.trim().length > 0 + ? `cron ${backup.schedule}` + : 'interval'; + lines.push(` Backup: enabled (${mode})`); + } else { + lines.push(' Backup: disabled'); + } + const secFeatures: string[] = []; secFeatures.push(`tools:${config.tools?.profile ?? 'full'}`); if (config.sandbox?.enabled) {secFeatures.push('sandbox');}