#!/usr/bin/env node /** * NiuBot User CLI — 面向安装用户的服务管理命令。 * * Commands: * niubot init — 环境检查 + 配置模板生成 * niubot add-bot — 向已有配置添加新 bot * niubot start — 校验 + 启动服务 * niubot stop — 停止服务 * niubot status — 查看运行状态 * niubot update — 检查并安装最新版本 * niubot version — 显示版本号 */ import { type LocalIpcEndpoint } from "./platform/ipc.js"; export declare function getTodayLogFilePath(niubotHome: string): string; interface RunningStatusDetailsOptions { niubotHome: string; cliPath: string; todayLogFile: string; processCwd?: string; processStdoutPath?: string; } export declare function resolveRunningStatusDetails(options: RunningStatusDetailsOptions): { version: string; path: string; node?: string; logFile: string; }; export declare function resolveNiubotHome(flagHome: string | undefined, envHome: string | undefined, cwd?: string): string; export declare function readRegisteredHomes(registryPath: string): string[]; export declare function collectStatusHomes(currentHome: string, registeredHomes: string[]): string[]; export declare function registerHomePath(registryPath: string, home: string): void; /** 重读并合并最新配置,避免 add-bot 交互期间覆盖其他设置。 */ export declare function appendBotToConfig(configPath: string, newBot: Record): void; export declare function generateConfigTemplate(backend: string, botId?: string, appId?: string, appSecret?: string, model?: string): string; export declare function generateBotProfileTemplate(): string; export type EngineAvailability = "running" | "uncertain" | "stopped"; export interface BotRuntimeStatus { id: string; status: "healthy" | "unhealthy" | "unavailable"; endpoint: LocalIpcEndpoint; } type BotHealthProbe = (endpoint: LocalIpcEndpoint) => Promise; export declare function inspectBotStatuses(niubotHome: string, engineAvailability: EngineAvailability, probe?: BotHealthProbe): Promise; export declare function parseNiubotVersionOutput(output: string): string | undefined; export declare function runSequentialHomeUpdates(homes: string[], updateHome: (home: string) => Promise, onError: (home: string, error: unknown) => void): Promise; export type ProductionUpdateDecision = "update" | "up-to-date" | "dev" | "unsupported"; export declare function decideProductionUpdate(currentVersion: string | undefined, targetVersion: string, currentEnvironment?: "dev" | "production"): ProductionUpdateDecision; export {};