mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 16:42:19 +00:00
* fix(#3398): automated AI fix * fix: address Codex review on PR #3400 * fix: address Codex review on PR #3400 * fix: address Codex review on PR #3400 * fix: address Codex review on PR #3400 * fix: address Codex review on PR #3400 * fix: address Codex review on PR #3400 * fix: address Codex review on PR #3400 * fix: address Codex review on PR #3400 * fix: address Codex review on PR #3400 * fix: address Codex review on PR #3400 * fix(terminal): protect popup and sanitized multiline pastes * fix(terminal): preserve input state across paste confirmation * fix(terminal): retain serial character-mode paste echo * test(terminal): cover paced input write options * fix(terminal): retain telnet echo for paced pastes * test(terminal): scope serial buffer assertion to serial sessions * fix(terminal): align runtime write options with bridge contract * fix(terminal): preserve bookkeeping for all paced pastes * fix(terminal): record confirmed paste lines in order * fix: record paced paste commands after transport writes * fix: omit paste receipts for filtered input * fix: cancel superseded paste batches across input paths * fix: classify each acknowledged paste line before recording * fix: stop paced paste when editing buffered serial input * fix: preserve recording pause boundaries and serial edit cancellation * fix: treat paced terminal pastes as user input * fix: preserve paste drafts until write and snippet broadcast origin * fix: retain filtered paste drafts and invalidate urgent input ownership * fix: broadcast paced user paste only on guarded line receipts --------- Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com> Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
25 lines
994 B
TypeScript
25 lines
994 B
TypeScript
import { getTerminalBootEpoch } from '../../../domain/terminalBootEpoch';
|
|
|
|
const inputVersions = new Map<string, number>();
|
|
let nextVersion = 0;
|
|
|
|
export function markTerminalBroadcastUserInput(sessionId: string): void {
|
|
inputVersions.set(sessionId, ++nextVersion);
|
|
}
|
|
|
|
export function clearTerminalBroadcastUserInput(sessionId: string): void {
|
|
inputVersions.delete(sessionId);
|
|
}
|
|
|
|
export function captureTerminalBroadcastInput(sessionId: string) {
|
|
return { sessionId, inputVersion: inputVersions.get(sessionId), bootEpoch: getTerminalBootEpoch(sessionId) };
|
|
}
|
|
|
|
export type TerminalBroadcastInputSnapshot = ReturnType<typeof captureTerminalBroadcastInput>;
|
|
export type TerminalPacedBroadcast = { targets?: TerminalBroadcastInputSnapshot[] };
|
|
|
|
export function isTerminalBroadcastInputCurrent(snapshot: TerminalBroadcastInputSnapshot): boolean {
|
|
return snapshot.inputVersion === inputVersions.get(snapshot.sessionId)
|
|
&& snapshot.bootEpoch === getTerminalBootEpoch(snapshot.sessionId);
|
|
}
|