open source is social v-it.org
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'hopper-tkj566qm-doctor-bluesky-check'

# Conflicts:
# src/cmd/doctor.js

+54 -27
+44 -27
src/cmd/doctor.js
··· 2 2 // Copyright (c) 2026 sol pbc 3 3 4 4 import { loadConfig } from '../lib/config.js'; 5 + import { restoreAgent } from '../lib/oauth.js'; 5 6 import { readProjectConfig } from '../lib/vit-dir.js'; 6 7 import { existsSync } from 'node:fs'; 7 8 import { join } from 'node:path'; 8 9 import { mark, name } from '../lib/brand.js'; 9 10 10 11 export default function register(program) { 11 - program 12 - .command('doctor') 13 - .description('Verify vit environment and project configuration') 14 - .action(async () => { 15 - try { 16 - const config = loadConfig(); 17 - if (config.setup_at) { 18 - const when = new Date(config.setup_at * 1000).toISOString(); 19 - console.log(`${mark} setup: ok (${when})`); 20 - } else { 21 - console.log(`${mark} setup: not done (run ${name} setup)`); 22 - } 12 + async function checkHealth() { 13 + try { 14 + const config = loadConfig(); 15 + if (config.setup_at) { 16 + const when = new Date(config.setup_at * 1000).toISOString(); 17 + console.log(`${mark} setup: ok (${when})`); 18 + } else { 19 + console.log(`${mark} setup: not done (run ${name} setup)`); 20 + } 23 21 24 - const projConfig = readProjectConfig(); 25 - if (projConfig.beacon) { 26 - console.log(`${mark} beacon: ${projConfig.beacon}`); 27 - } else { 28 - console.log(`${mark} beacon: not set`); 29 - } 22 + const projConfig = readProjectConfig(); 23 + if (projConfig.beacon) { 24 + console.log(`${mark} beacon: ${projConfig.beacon}`); 25 + } else { 26 + console.log(`${mark} beacon: not set`); 27 + } 28 + 29 + const skillPath = join(process.cwd(), '.claude', 'skills', 'using-vit', 'SKILL.md'); 30 + if (existsSync(skillPath)) { 31 + console.log(`${mark} skill: ok (using-vit)`); 32 + } else { 33 + console.log(`${mark} skill: not installed (run ${name} setup)`); 34 + } 30 35 31 - const skillPath = join(process.cwd(), '.claude', 'skills', 'using-vit', 'SKILL.md'); 32 - if (existsSync(skillPath)) { 33 - console.log(`${mark} skill: ok (using-vit)`); 34 - } else { 35 - console.log(`${mark} skill: not installed (run ${name} setup)`); 36 + if (!config.did) { 37 + console.log(`${mark} bluesky: not logged in (run ${name} login <handle>)`); 38 + } else { 39 + try { 40 + const { session } = await restoreAgent(config.did); 41 + const pds = session.serverMetadata?.issuer; 42 + console.log(`${mark} bluesky: ok (${session.did}${pds ? ', ' + pds : ''})`); 43 + } catch { 44 + console.log(`${mark} bluesky: token expired or invalid (run ${name} login <handle>)`); 36 45 } 37 - } catch (err) { 38 - console.error(err instanceof Error ? err.message : String(err)); 39 - process.exitCode = 1; 40 46 } 41 - }); 47 + } catch (err) { 48 + console.error(err instanceof Error ? err.message : String(err)); 49 + process.exitCode = 1; 50 + } 51 + } 52 + 53 + program.command('doctor') 54 + .description('Verify vit environment and project configuration') 55 + .action(checkHealth); 56 + program.command('status') 57 + .description('Alias for doctor') 58 + .action(checkHealth); 42 59 }
+10
test/doctor.test.js
··· 19 19 const result = run('doctor'); 20 20 expect(result.stdout).toMatch(/skill:/); 21 21 }); 22 + 23 + test('reports bluesky status', () => { 24 + const result = run('doctor'); 25 + expect(result.stdout).toMatch(/bluesky:/); 26 + }); 27 + 28 + test('vit status is an alias for doctor', () => { 29 + const result = run('status'); 30 + expect(result.stdout).toMatch(/setup:/); 31 + }); 22 32 });