fix: ship prebuilt lib and drop prepare for one-click git install

Avoids pnpm allowBuilds block on dsh plugin add; README install steps expanded for first-time users.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
owo
2026-08-14 17:16:25 +08:00
co-authored by Cursor
parent c2c0db7597
commit 8ef1622822
15 changed files with 869 additions and 62 deletions
+55
View File
@@ -0,0 +1,55 @@
export const MSG = {
DENIED: '无权限。',
WELCOME: [
'你好,这是 DeepSeek Harness 的手机遥控器。',
'本机会话是真相源:请先在 Web 打开对话,再用 /sessions 选择并附着。',
'发送 /help 查看命令。',
].join('\n'),
HELP: [
'/sessions — 列出本机正在运行的会话并选择附着',
'/status — 查看当前绑定',
'/unbind — 断开绑定(不关闭本机会话)',
'/help — 显示帮助',
'',
'绑定后直接发文字,消息会进入该本机会话;Web 与手机看到同一条轨迹。',
'仅白名单用户可用。无 live 会话时请先在 dsh web 开对话。',
].join('\n'),
NEED_BIND: '尚未绑定本机会话。请先发送 /sessions 选择一个。',
NO_LIVE: '当前没有正在运行的本机会话。请先在 Web(dsh web)打开或继续一个对话,再发 /sessions。',
BOUND(label) {
return `已附着本机会话:${label}\n此后消息将进入该会话(与 Web 同轨迹)。`;
},
UNBOUND: '已断开绑定。本机会话仍在运行。',
STATUS_NONE: '当前未绑定任何本机会话。发送 /sessions 选择。',
STATUS_BOUND(label) {
return `当前绑定:${label}`;
},
GONE: '绑定的会话已不在本机运行(可能已在 Web 关闭)。请重新 /sessions。',
unknown(command) {
return `未知命令 ${command}。发送 /help 查看可用命令。`;
},
};
export function parseCommand(text) {
if (!text.startsWith('/'))
return { type: 'plain', text };
const raw = text.split(/\s+/)[0] ?? text;
const command = raw.includes('@') ? raw.slice(0, raw.indexOf('@')) : raw;
switch (command) {
case '/start':
return { type: 'start', text };
case '/help':
return { type: 'help', text };
case '/sessions':
case '/list':
return { type: 'sessions', text };
case '/status':
return { type: 'status', text };
case '/unbind':
case '/disconnect':
return { type: 'unbind', text };
default:
return { type: 'unknown', command, text };
}
}
/** Callback data prefix for session bind buttons. */
export const BIND_CB_PREFIX = 'bind:';