import type { YinianAuthSession, YinianConfigSnapshot, YinianImageCaptcha, YinianLocalSkill, YinianLoginWithPasswordInput, YinianLoginWithSmsInput, YinianServerStatus, YinianSessionState, YinianSkillRegistry, YinianSkillSyncResult, } from '../../shared/yinian'; import type { YinianControlPlane } from './control-plane'; const MESSAGE = '服务端地址未配置,请设置 YINIAN_API_BASE_URL 后重新启动智念助手。'; export class UnconfiguredYinianControlPlane implements YinianControlPlane { async getServerStatus(): Promise { return { mode: 'http', reachable: false, checkedAt: Date.now(), message: MESSAGE, }; } async createImageCaptcha(randomStr = `${Date.now()}`): Promise { return { randomStr, raw: { error: MESSAGE } }; } async restoreSession(): Promise { return { authenticated: false }; } async getSessionState(): Promise { return { authenticated: false }; } async loginWithSms(_input: YinianLoginWithSmsInput): Promise { throw new Error(MESSAGE); } async loginWithPassword(_input: YinianLoginWithPasswordInput): Promise { throw new Error(MESSAGE); } async logout(): Promise { return { authenticated: false }; } async switchHotel(_hotelId: string): Promise { throw new Error(MESSAGE); } async getConfigSnapshot(): Promise { throw new Error(MESSAGE); } async syncSkills(): Promise { throw new Error(MESSAGE); } async listLocalSkills(): Promise { return []; } async getSkillRegistry(_hotelId?: string): Promise | undefined> { return undefined; } }