- /status:绑定会话/会话 ID/工作区/当前模型/思考强度/上下文长度/ 首 token 平均/输出速率/输入输出 tokens —— 与 Web 底部统计条同源 同算法(sessionProjections: sessionStats/tokenUsage/contextPressure), 投影插件缺失时逐组优雅降级;冷会话不强制 resume - /compact:复用 ctx.compaction.compactNow 手动压缩绑定会话历史, 异步执行不阻塞轮询,完成/失败均中文通知,同会话去重, 桥停止/热重载自动中止进行中的压缩 - 全部用户可见文案不使用 emoji - rendering 默认改 html(兼容优先)+ userQuestions/approval 双通道等 既有修改一并合入(此前已上线确认) - tests:+6 覆盖 /status 全字段与 /compact 各分支(51 全绿)
95 lines
4.4 KiB
TypeScript
95 lines
4.4 KiB
TypeScript
export declare const MSG: {
|
|
readonly DENIED: "无权限。";
|
|
readonly WELCOME: string;
|
|
readonly HELP: string;
|
|
readonly NEED_BIND: "尚未绑定本机会话。请先发送 /sessions 选择一个。";
|
|
readonly NO_SESSIONS: "当前没有可附着的本机会话(已排除归档与空白会话)。请先在 Web(dsh web)打开或继续一个对话,再发 /sessions。";
|
|
readonly NO_SESSIONS_IN_WS: (title: string) => string;
|
|
/** @deprecated use NO_SESSIONS */
|
|
readonly NO_LIVE: "当前没有可附着的本机会话。请先在 Web(dsh web)打开或继续一个对话,再发 /sessions。";
|
|
readonly PICKER_STALE: "列表已过期,请重新发送 /sessions。";
|
|
readonly RESUME_FAILED: "无法附着该会话(resume 失败)。请确认会话存在于 Web,或先在电脑打开后再试。";
|
|
readonly BOUND: (label: string) => string;
|
|
readonly UNBOUND: "已断开绑定。本机会话仍在运行。";
|
|
readonly STATUS_NONE: "当前未绑定任何本机会话。发送 /sessions 选择。";
|
|
readonly STATUS_BOUND: (label: string) => string;
|
|
readonly STATUS_BOUND_COLD: (label: string) => string;
|
|
readonly COMPACT_USAGE: "用法:/compact(无参数,压缩当前绑定会话的历史,缩短上下文)";
|
|
readonly COMPACT_UNAVAILABLE: "当前宿主未启用压缩服务(compaction 未装配),无法执行 /compact。";
|
|
readonly COMPACT_STARTED: "已开始压缩会话历史…\n压缩会占用一个模型回合,期间新消息排队;完成或失败后会在这里报告结果。";
|
|
readonly COMPACT_BUSY: "当前会话有任务正在运行(或压缩锁被占用),无法压缩。请等本轮结束(或 /stop)后再试。";
|
|
readonly COMPACT_INFLIGHT: "该会话已在进行压缩,请稍候(完成后会报告结果)。";
|
|
readonly COMPACT_NOTHING: "压缩完成:暂无可压缩的有效历史(历史过短,或没有可安全汇总的区间)。";
|
|
readonly COMPACT_DONE: (n: number, tokens: number) => string;
|
|
readonly COMPACT_CANCELLED: "压缩已取消(会话未改变)。";
|
|
readonly COMPACT_CHANGED: "压缩失败:待压缩的历史在过程中发生了变化(会话未改变),请重试。";
|
|
readonly COMPACT_SUMMARY_FAILED: "压缩失败:未能生成有效的摘要(会话未改变),请重试。";
|
|
readonly COMPACT_COMMIT_FAILED: "压缩未完整结束:部分历史可能已变化。请先检查会话状态再重试。";
|
|
readonly COMPACT_PERSIST_FAILED: "压缩完成但保存失败。请检查本机存储与权限后重试。";
|
|
readonly COMPACT_FAILED: (detail?: string) => string;
|
|
readonly GONE: "绑定的会话已不可用。请重新 /sessions。";
|
|
readonly LAST_FAILED: "无法读取上次对话。请确认已绑定,且本机 dsh web / apiProxy 可用。";
|
|
readonly MODEL_UNAVAILABLE: (detail?: string) => string;
|
|
readonly MODEL_UNROUTABLE: (current: string) => string;
|
|
readonly MODEL_EMPTY: (current: string) => string;
|
|
readonly MODEL_SET: (selected: string) => string;
|
|
readonly RICH_USAGE: "用法:/rich on(富文本渲染,需新版客户端)|/rich off(HTML 兼容,默认)|/rich(查看当前状态)";
|
|
readonly RICH_STATE: (mode: "rich" | "html") => string;
|
|
readonly RICH_SET: (mode: "rich" | "html") => string;
|
|
readonly MODEL_FAILED: (detail?: string) => string;
|
|
readonly unknown: (command: string) => string;
|
|
};
|
|
export type ParsedCommand = {
|
|
type: 'start';
|
|
text: string;
|
|
} | {
|
|
type: 'help';
|
|
text: string;
|
|
} | {
|
|
type: 'sessions';
|
|
text: string;
|
|
} | {
|
|
type: 'last';
|
|
text: string;
|
|
} | {
|
|
type: 'model';
|
|
text: string;
|
|
} | {
|
|
type: 'status';
|
|
text: string;
|
|
} | {
|
|
type: 'compact';
|
|
text: string;
|
|
} | {
|
|
type: 'rich';
|
|
text: string;
|
|
arg?: string;
|
|
} | {
|
|
type: 'unbind';
|
|
text: string;
|
|
} | {
|
|
type: 'stop';
|
|
text: string;
|
|
} | {
|
|
type: 'mission';
|
|
text: string;
|
|
} | {
|
|
type: 'new';
|
|
text: string;
|
|
} | {
|
|
type: 'cancel';
|
|
text: string;
|
|
} | {
|
|
type: 'unknown';
|
|
command: string;
|
|
text: string;
|
|
} | {
|
|
type: 'plain';
|
|
text: string;
|
|
};
|
|
export declare function parseCommand(text: string): ParsedCommand;
|
|
/** @deprecated Prefer short index callbacks (ws:/sid:); kept for old messages. */
|
|
export declare const BIND_CB_PREFIX = "bind:";
|
|
/** Inline button: fetch last Q/A for the bound session. */
|
|
export declare const LAST_CB = "last";
|