Import packages/plugin/src/bin/doctor.ts
This commit is contained in:
parent
41a3e1b20d
commit
925d3ab660
|
|
@ -0,0 +1,14 @@
|
|||
import type { HostPluginRuntime } from '../service.js'
|
||||
|
||||
export function doctor(runtime: HostPluginRuntime): string {
|
||||
const state = runtime.diagnostics()
|
||||
return [
|
||||
'DSH Remote doctor',
|
||||
`Plugin: ${state.loaded ? 'loaded' : 'starting'}`,
|
||||
`Identity: ${state.identityValid ? `valid (${state.deviceId})` : 'unavailable'}`,
|
||||
`Server: ${state.serverConfigured ? state.serverOnline ? 'online' : 'configured, offline' : 'not configured'}`,
|
||||
...(state.serverError === undefined ? [] : [`Server error: ${state.serverError}`]),
|
||||
`Peer channel: ${state.online ? 'online' : 'offline'}`,
|
||||
`Trusted devices: ${state.trustedPeers}`,
|
||||
].join('\n')
|
||||
}
|
||||
Loading…
Reference in New Issue