feat(setup): show operator automation and backup state in summary
This commit is contained in:
@@ -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%)",
|
||||
|
||||
@@ -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<string, unknown>;
|
||||
backup?: {
|
||||
enabled?: boolean;
|
||||
|
||||
@@ -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 * * *)');
|
||||
});
|
||||
});
|
||||
@@ -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');}
|
||||
|
||||
Reference in New Issue
Block a user