Rework pacing, pause poll, add user search, voice overview, and DM list

This commit is contained in:
Fisto
2026-09-13 15:47:43 +02:00
parent 32201b34cf
commit 4e1046fae7
13 changed files with 539 additions and 81 deletions
+16 -5
View File
@@ -1,3 +1,9 @@
/*
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2026 Vendicated and Vesktop contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
/*
* Vesktop ⇄ Veskslop daemon protocol.
*
@@ -11,6 +17,9 @@ export const enum PuppetAction {
EventsSubscribe = "events.subscribe",
StateGet = "state.get",
VoiceGet = "voice.get",
VoiceOverview = "voice.overview",
UserSearch = "user.search",
DmList = "dm.list",
MessageSend = "message.send",
MessageRead = "message.read",
MessageFetch = "message.fetch",
@@ -23,6 +32,9 @@ export const PuppetActions: readonly PuppetAction[] = [
PuppetAction.EventsSubscribe,
PuppetAction.StateGet,
PuppetAction.VoiceGet,
PuppetAction.VoiceOverview,
PuppetAction.UserSearch,
PuppetAction.DmList,
PuppetAction.MessageSend,
PuppetAction.MessageRead,
PuppetAction.MessageFetch,
@@ -61,13 +73,10 @@ export interface PuppetRequest {
params?: Record<string, unknown>;
}
export type PuppetResult =
| { ok: true; result?: unknown }
| { ok: false; error: PuppetError };
export type PuppetResult = { ok: true; result?: unknown } | { ok: false; error: PuppetError };
export type PuppetResponse =
| { id?: string | number; ok: true; result?: unknown }
| { id?: string | number; ok: false; error: PuppetError };
{ id?: string | number; ok: true; result?: unknown } | { id?: string | number; ok: false; error: PuppetError };
export interface PuppetEvent {
type: string;
@@ -79,6 +88,8 @@ export const PUPPET_LIMITS = {
maxContentLength: 2000,
maxReadLimit: 100,
maxFetchLimit: 100,
maxUserSearchResults: 25,
maxDmList: 50,
minActionIntervalMs: 500,
maxActionsPerMinute: 30,
maxRequestBytes: 64 * 1024,