/** * 模块: 状态栏 * * 龙虾的状态展示通常依赖 CLI/Control UI,缺少一个"一眼看全插件增强信号"的入口。 * 本模块做两件事: * 1. 暴露 enhance_statusline 工具:模型/用户随时查询当前模式、任务、记忆命中、宠物。 * 2. 挂 HTTP 路由 /plugins/enhance/api/statusline,JSON 快照,方便 Control UI 嵌入。 * * 纯只读,绝不影响龙虾运行状态。 */ import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; import type Database from "better-sqlite3"; import type { NotificationQueue } from "../types.js"; /** Observability bits read from ctx / runtimeConfig at tool-call time. */ export interface ObservabilityContext { model?: string; thinking?: string; fastMode?: boolean; channel?: string; sessionId?: string; } interface Snapshot { agentId: string; mode: string; todos: { done: number; total: number; active?: string; }; chaptersToday: number; memory: { total: number; byCategory: Record; }; unreadNotifications: number; pet: { name: string; level: number; color: string; mood: string; }; scheduledBindings: number; /** Observability (runtime-only; undefined if not resolvable). */ observability?: ObservabilityContext; } export declare function buildSnapshot(db: Database.Database, agentId: string, sessionId: string, notifyQueue: NotificationQueue, observability?: ObservabilityContext): Snapshot; export declare function registerStatusline(api: OpenClawPluginApi, db: Database.Database, notifyQueue: NotificationQueue): void; export {};