feat: remote-control live DSH Web sessions from Telegram

Attach via /sessions picker instead of creating parallel agents; mirror the same session trajectory to phone and Web (Codex-style remote).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
owo
2026-08-14 17:11:13 +08:00
co-authored by Cursor
parent dd72f134fb
commit c2c0db7597
12 changed files with 518 additions and 666 deletions
+12 -7
View File
@@ -2,17 +2,22 @@ import assert from 'node:assert/strict'
import test from 'node:test'
import { MSG, parseCommand } from '../src/commands.ts'
test('parse slash commands', () => {
test('parse slash commands for remote control', () => {
assert.equal(parseCommand('/start').type, 'start')
assert.equal(parseCommand('/help extra').type, 'help')
assert.equal(parseCommand('/new').type, 'new')
assert.equal(parseCommand('/clear').type, 'new')
assert.equal(parseCommand('/help').type, 'help')
assert.equal(parseCommand('/sessions').type, 'sessions')
assert.equal(parseCommand('/list').type, 'sessions')
assert.equal(parseCommand('/status').type, 'status')
assert.equal(parseCommand('/unbind').type, 'unbind')
assert.equal(parseCommand('/disconnect').type, 'unbind')
assert.equal(parseCommand('/sessions@MyBot').type, 'sessions')
assert.equal(parseCommand('/foo').type, 'unknown')
assert.equal(parseCommand('hello').type, 'plain')
})
test('Chinese copy is non-empty', () => {
test('Chinese copy mentions sessions and bind', () => {
assert.ok(MSG.DENIED.includes('权限') || MSG.DENIED.includes('授权'))
assert.ok(MSG.HELP.includes('/new'))
assert.ok(MSG.WELCOME.length > 0)
assert.ok(MSG.HELP.includes('/sessions'))
assert.ok(MSG.NEED_BIND.includes('/sessions'))
assert.ok(MSG.WELCOME.includes('Web') || MSG.WELCOME.includes('遥控器'))
})