refactor: remove verify-code/reply support (not needed)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
stswangzhiping
2026-05-14 22:20:10 +08:00
parent 80e1c97000
commit eeb984ebfe
2 changed files with 23 additions and 89 deletions

View File

@@ -8,12 +8,10 @@
* Supported actions (incoming from VPS):
* request — start a new task
* cancel — abort a running task
* reply — forward input to a running task (e.g. verify code)
*
* Handler interface:
* handler[method](params) → { abort, onReply? }
* abort() — called on cancel
* onReply(msg) — called on reply (optional)
* handler[method](params) → { abort } | function
* abort() — called on cancel
*/
const log = require('./logger');
@@ -54,18 +52,6 @@ function handle(msg, send) {
return;
}
// ── reply (e.g. verify code from frontend) ────────────────────────────────
if (action === 'reply') {
const task = running.get(callId);
if (task && typeof task.onReply === 'function') {
log.info('sys-call', `reply callId=${callId} event=${msg.event || ''}`);
try { task.onReply(msg); } catch (e) { log.warn('sys-call', `onReply error: ${e.message}`); }
} else {
log.debug('sys-call', `reply for unknown/no-onReply callId=${callId}`);
}
return;
}
// ── request ───────────────────────────────────────────────────────────────
if (action !== 'request') {
log.warn('sys-call', `unexpected action=${action} callId=${callId}`);
@@ -107,7 +93,7 @@ function handle(msg, send) {
return;
}
// Normalise: handler may return a function (abort only) or { abort, onReply }
// Normalise: handler may return a function (abort only) or { abort }
if (typeof task === 'function') {
task = { abort: task };
}