2026-06-29 23:10:16 -04:00
|
|
|
/*
|
|
|
|
|
Copyright 2026 Lotus Guild
|
|
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
|
|
|
Please see LICENSE in the repository root for full details.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Custom widget actions exchanged between the Lotus host (cinny) and this fork.
|
|
|
|
|
* Kept dependency-free so both `widget.ts` and `lotus/*` can import it without
|
|
|
|
|
* a circular dependency.
|
|
|
|
|
*/
|
|
|
|
|
export enum LotusWidgetActions {
|
2026-06-29 23:14:42 -04:00
|
|
|
/**
|
|
|
|
|
* fromWidget: in-call per-participant speaking / mute state.
|
|
|
|
|
* NOTE: matrix-widget-api `transport.send` is request/response — the host
|
2026-06-30 00:15:59 -04:00
|
|
|
* MUST register a handler that replies/acks each one (cinny's `listenAction`
|
|
|
|
|
* does, replying `{}`). If the host has no handler, ClientWidgetApi
|
|
|
|
|
* immediately error-replies "unsupported from-widget action", so the data is
|
|
|
|
|
* silently dropped and each throttled send rejects (caught) — functional miss
|
|
|
|
|
* + log churn, not a hang.
|
2026-06-29 23:14:42 -04:00
|
|
|
*/
|
2026-06-29 23:10:16 -04:00
|
|
|
CallState = "io.lotus.call_state",
|
|
|
|
|
/** toWidget: pin/spotlight (or clear, with userId=null) a participant. */
|
|
|
|
|
FocusParticipant = "io.lotus.focus_participant",
|
2026-06-29 23:26:45 -04:00
|
|
|
/** toWidget: play an audio clip into the call as a separate published track. */
|
2026-06-29 23:10:16 -04:00
|
|
|
InjectAudio = "io.lotus.inject_audio",
|
2026-06-29 23:24:57 -04:00
|
|
|
/** toWidget: set audio/screenshare encoding quality (bitrate/framerate). */
|
|
|
|
|
SetQuality = "io.lotus.set_quality",
|
2026-06-29 23:38:45 -04:00
|
|
|
/** toWidget: per-user avatar-decoration image URLs for in-call tiles. */
|
|
|
|
|
Decorations = "io.lotus.decorations",
|
2026-07-02 14:12:08 -04:00
|
|
|
/** toWidget: deafen remote audio (and optionally mute screenshare audio). */
|
|
|
|
|
SetDeafen = "io.lotus.set_deafen",
|
2026-06-29 23:10:16 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** toWidget Lotus actions that must be allow-listed in `initializeWidget`. */
|
|
|
|
|
export const LOTUS_TO_WIDGET_ACTIONS: LotusWidgetActions[] = [
|
|
|
|
|
LotusWidgetActions.FocusParticipant,
|
|
|
|
|
LotusWidgetActions.InjectAudio,
|
2026-06-29 23:24:57 -04:00
|
|
|
LotusWidgetActions.SetQuality,
|
2026-06-29 23:38:45 -04:00
|
|
|
LotusWidgetActions.Decorations,
|
2026-07-02 14:12:08 -04:00
|
|
|
LotusWidgetActions.SetDeafen,
|
2026-06-29 23:10:16 -04:00
|
|
|
];
|