mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
refactor(imports): replace relative imports with path aliases (#2741)
This commit is contained in:
1 parent
a59b80ce11
commit
84dcf6b8a8
1834 files changed
+11601
-10725
No files matched your search
@@ -69,7 +69,7 @@ vi.mock('@app/features/voice/state/VoiceSettings', () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
const VoiceSettingsCommands = await import('./VoiceSettingsCommands');
|
||||
const VoiceSettingsCommands = await import('@app/features/voice/commands/VoiceSettingsCommands');
|
||||
|
||||
describe('screen-share codec settings reactions', () => {
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
createIncomingCallManagerSnapshot,
|
||||
type IncomingCallManagerSignals,
|
||||
@@ -9,7 +8,8 @@ import {
|
||||
selectIncomingCallManagerModel,
|
||||
shouldPlayIncomingRing,
|
||||
transitionIncomingCallManagerSnapshot,
|
||||
} from './IncomingCallManagerStateMachine';
|
||||
} from '@app/features/voice/components/IncomingCallManagerStateMachine';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
function signals(overrides: Partial<IncomingCallManagerSignals> = {}): IncomingCallManagerSignals {
|
||||
return {
|
||||
|
||||
@@ -18,6 +18,12 @@ import VoiceCallLayout from '@app/features/voice/state/VoiceCallLayout';
|
||||
import {msg} from '@lingui/core/macro';
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {ParticipantContext, TrackRefContext, type TrackReferenceOrPlaceholder} from '@livekit/components-react';
|
||||
import {CaretDownIcon, CaretUpIcon, UsersIcon} from '@phosphor-icons/react';
|
||||
import {clsx} from 'clsx';
|
||||
import type {Participant} from 'livekit-client';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import type React from 'react';
|
||||
import {useCallback, useEffect, useMemo, useState} from 'react';
|
||||
|
||||
function trackToEntry(trackRef: TrackReferenceOrPlaceholder, index: number): VoiceGridEntry {
|
||||
const key =
|
||||
@@ -35,13 +41,6 @@ function trackToEntry(trackRef: TrackReferenceOrPlaceholder, index: number): Voi
|
||||
};
|
||||
}
|
||||
|
||||
import {CaretDownIcon, CaretUpIcon, UsersIcon} from '@phosphor-icons/react';
|
||||
import {clsx} from 'clsx';
|
||||
import type {Participant} from 'livekit-client';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import type React from 'react';
|
||||
import {useCallback, useEffect, useMemo, useState} from 'react';
|
||||
|
||||
const HIDE_PARTICIPANTS_DESCRIPTOR = msg({
|
||||
message: 'Hide participants',
|
||||
comment: 'Tooltip / aria label on the participants-panel toggle in the voice call view (currently visible).',
|
||||
|
||||
+2
-2
@@ -1,6 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
createVoiceCallLayoutPresentationSnapshot,
|
||||
getVoiceCallLayoutPresentationStateValue,
|
||||
@@ -9,7 +8,8 @@ import {
|
||||
transitionVoiceCallLayoutPresentationSnapshot,
|
||||
type VoiceCallLayoutPresentationInput,
|
||||
type VoiceCallLayoutPresentationMachineSnapshot,
|
||||
} from './VoiceCallLayoutPresentationStateMachine';
|
||||
} from '@app/features/voice/components/VoiceCallLayoutPresentationStateMachine';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
function input(overrides: Partial<VoiceCallLayoutPresentationInput> = {}): VoiceCallLayoutPresentationInput {
|
||||
return {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {readFileSync} from 'node:fs';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
FOCUS_EXPANDED_MAIN_MIN_HEIGHT_PX,
|
||||
FOCUS_EXPANDED_MINI_COLUMN_RULES,
|
||||
FOCUS_EXPANDED_MINI_TILE_ASPECT_RATIO,
|
||||
getFocusExpandedMiniColumnCount,
|
||||
resolveFocusExpandedMainMetrics,
|
||||
} from './VoiceFocusLayoutMetrics';
|
||||
} from '@app/features/voice/components/VoiceFocusLayoutMetrics';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
function sourceFile(name: string): string {
|
||||
return readFileSync(new URL(name, import.meta.url), 'utf8');
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {readFileSync} from 'node:fs';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
getVoiceGridColumnCount,
|
||||
getVoiceGridGap,
|
||||
@@ -16,7 +15,8 @@ import {
|
||||
VOICE_GRID_COMPACT_MIN_TILE_WIDTH_PX,
|
||||
VOICE_GRID_MIN_TILE_WIDTH_PX,
|
||||
VOICE_GRID_TILE_ASPECT_RATIO,
|
||||
} from './VoiceGridLayoutMetrics';
|
||||
} from '@app/features/voice/components/VoiceGridLayoutMetrics';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
const EPSILON_PX = 0.001;
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {VoiceState} from '@app/features/gateway/types/GatewayVoiceTypes';
|
||||
import {resolveVoiceParticipantAvatarEntryVoiceState} from '@app/features/voice/components/VoiceParticipantDisplayState';
|
||||
import type {LivekitParticipantSnapshot} from '@app/features/voice/engine/VoiceParticipantStateMachine';
|
||||
import {VoiceConnectionQuality} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {resolveVoiceParticipantAvatarEntryVoiceState} from './VoiceParticipantDisplayState';
|
||||
|
||||
function createParticipantSnapshot(overrides: Partial<LivekitParticipantSnapshot> = {}): LivekitParticipantSnapshot {
|
||||
return {
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {VoiceState} from '@app/features/gateway/types/GatewayVoiceTypes';
|
||||
import {
|
||||
resolveVoiceParticipantDisplayState,
|
||||
resolveVoiceParticipantSpeaking,
|
||||
} from '@app/features/voice/components/VoiceParticipantDisplayState';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {resolveVoiceParticipantDisplayState, resolveVoiceParticipantSpeaking} from './VoiceParticipantDisplayState';
|
||||
|
||||
function voiceState(overrides: Partial<VoiceState>): VoiceState {
|
||||
return overrides as VoiceState;
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
COMPACT_HEIGHT_CHAT_AREA_RESERVATION,
|
||||
COMPACT_HEIGHT_MIN,
|
||||
resolveCompactHeightMax,
|
||||
resolveCompactHeightMaxFromLayout,
|
||||
} from './CompactVoiceCallHeightBounds';
|
||||
} from '@app/features/voice/components/compact_voice_call_view/CompactVoiceCallHeightBounds';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
describe('resolveCompactHeightMax', () => {
|
||||
it('reserves chat area space below the call view so the composer remains visible', () => {
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
getCompactAudioAvatarLayoutStyle,
|
||||
resolveCompactAudioAvatarLayoutMetrics,
|
||||
resolveCompactControlGap,
|
||||
resolveCompactEdgeGradientExtension,
|
||||
} from './CompactVoiceCallLayoutMetrics';
|
||||
} from '@app/features/voice/components/compact_voice_call_view/CompactVoiceCallLayoutMetrics';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
describe('CompactVoiceCallLayoutMetrics', () => {
|
||||
it('keeps the avatar row out of the compact footer gradient when controls are visible', () => {
|
||||
|
||||
+2
-2
@@ -1,6 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
type CompactVoiceCallPresentationInput,
|
||||
type CompactVoiceCallPresentationMachineSnapshot,
|
||||
@@ -9,7 +8,8 @@ import {
|
||||
resolveCompactVoiceCallPresentationModel,
|
||||
selectCompactVoiceCallPresentationModel,
|
||||
transitionCompactVoiceCallPresentationSnapshot,
|
||||
} from './CompactVoiceCallPresentationStateMachine';
|
||||
} from '@app/features/voice/components/compact_voice_call_view/CompactVoiceCallPresentationStateMachine';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
function update(
|
||||
snapshot: CompactVoiceCallPresentationMachineSnapshot,
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {isAutoplayBlockedError} from '@app/features/voice/components/media_player/hooks/useMediaPlayer';
|
||||
import {afterEach, describe, expect, it} from 'vitest';
|
||||
import {
|
||||
areBufferedSpanFractionsEqual,
|
||||
armPendingSeekTarget,
|
||||
@@ -17,7 +16,8 @@ import {
|
||||
readPendingSeekTarget,
|
||||
resolveDoubleTapSeekDirection,
|
||||
stepPlayheadPrediction,
|
||||
} from './MediaSeekUtils';
|
||||
} from '@app/features/voice/components/media_player/utils/MediaSeekUtils';
|
||||
import {afterEach, describe, expect, it} from 'vitest';
|
||||
|
||||
function mediaWithBufferedRanges({
|
||||
duration,
|
||||
|
||||
+3
-3
@@ -1,14 +1,14 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {DesktopSource, NativeScreenCaptureSource} from '@app/types/electron.d';
|
||||
import {describe, expect, test} from 'vitest';
|
||||
import {
|
||||
findNativeCaptureSourceForDesktopSource,
|
||||
getDesktopSourceThumbnailStateKey,
|
||||
hasDesktopSourcesMissingThumbnails,
|
||||
isDisplaySource,
|
||||
mergeDesktopSources,
|
||||
} from './shared';
|
||||
} from '@app/features/voice/components/modals/screen_share_picker_modal/shared';
|
||||
import type {DesktopSource, NativeScreenCaptureSource} from '@app/types/electron.d';
|
||||
import {describe, expect, test} from 'vitest';
|
||||
|
||||
const USABLE_IMAGE_DATA_URL = 'data:image/png;base64,aW1hZ2U=';
|
||||
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
type LocalParticipantControlSignals,
|
||||
selectLocalParticipantControlsViewState,
|
||||
selectLocalParticipantMediaControlState,
|
||||
} from './LocalParticipantControlsStateMachine';
|
||||
} from '@app/features/voice/components/voice_connection_status/LocalParticipantControlsStateMachine';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
function signals(overrides: Partial<LocalParticipantControlSignals> = {}): LocalParticipantControlSignals {
|
||||
return {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {GatewayErrorCodes} from '@fluxer/constants/src/GatewayConstants';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
createMediaEngineFacadeSnapshot,
|
||||
getMediaEngineFacadeStateValue,
|
||||
@@ -12,7 +10,9 @@ import {
|
||||
shouldImmediatelyDisconnectMediaEngineForServerVoiceStateRemoval,
|
||||
shouldRunMediaEngineDeferredDisconnect,
|
||||
transitionMediaEngineFacadeSnapshot,
|
||||
} from './MediaEngineFacadeStateMachine';
|
||||
} from '@app/features/voice/engine/MediaEngineFacadeStateMachine';
|
||||
import {GatewayErrorCodes} from '@fluxer/constants/src/GatewayConstants';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
function connected(guildId: string | null = 'guild-1', channelId = 'channel-1') {
|
||||
return transitionMediaEngineFacadeSnapshot(createMediaEngineFacadeSnapshot(), {
|
||||
|
||||
@@ -86,7 +86,7 @@ const {
|
||||
computeNegotiatedVideoCodec,
|
||||
getScreenShareCodecPreferenceOrder,
|
||||
SCREEN_SHARE_CODEC_NEGOTIATION_TOPIC,
|
||||
} = await import('./ScreenShareCodecNegotiation');
|
||||
} = await import('@app/features/voice/engine/ScreenShareCodecNegotiation');
|
||||
const {resetCachedCodecCapabilities} = await import('@app/features/voice/utils/CodecCapabilityDetector');
|
||||
const {RoomEvent} = await import('livekit-client');
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ const {
|
||||
default: ScreenShareCodecNegotiation,
|
||||
buildLocalCodecAdvertisements,
|
||||
computeNegotiatedVideoCodec,
|
||||
} = await import('./ScreenShareCodecNegotiation');
|
||||
} = await import('@app/features/voice/engine/ScreenShareCodecNegotiation');
|
||||
const {findStalledVideoDecoder, scheduleScreenShareDecoderVerification} = await import(
|
||||
'@app/features/voice/utils/ScreenShareCodecDiagnostics'
|
||||
);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {Store} from '@app/features/voice/engine/Store';
|
||||
import {autorun} from 'mobx';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {Store} from './Store';
|
||||
|
||||
class TestStore extends Store {
|
||||
bump(): void {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
asVoiceEngineConnectionState,
|
||||
createVoiceConnectionSnapshot,
|
||||
@@ -10,7 +9,8 @@ import {
|
||||
transitionVoiceConnectionSnapshot,
|
||||
type VoiceConnectionSnapshot,
|
||||
VoiceEngineConnectionState,
|
||||
} from './VoiceConnectionStateMachine';
|
||||
} from '@app/features/voice/engine/VoiceConnectionStateMachine';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
const roomA = {id: 'room-a'};
|
||||
const roomB = {id: 'room-b'};
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
import type {GuildReadyData} from '@app/features/gateway/types/GatewayGuildTypes';
|
||||
import type {VoiceState} from '@app/features/gateway/types/GatewayVoiceTypes';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
createVoiceGatewayStateSnapshot,
|
||||
transitionVoiceGatewayStateSnapshot,
|
||||
type VoiceGatewayStateContext,
|
||||
type VoiceGatewayStateEvent,
|
||||
type VoiceGatewayStateSnapshot,
|
||||
} from './VoiceGatewayStateMachine';
|
||||
} from '@app/features/voice/engine/VoiceGatewayStateMachine';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
function voiceState(overrides: Partial<VoiceState> = {}): VoiceState {
|
||||
return {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
createVoiceLocalAudioReconcileCoalescerSnapshot,
|
||||
createVoiceMicrophoneFailureLatchSnapshot,
|
||||
@@ -20,7 +19,8 @@ import {
|
||||
type VoiceLocalAudioReconcileCoalescerSnapshot,
|
||||
type VoiceMicrophoneFailureLatchEvent,
|
||||
type VoiceMicrophoneFailureLatchSnapshot,
|
||||
} from './VoiceLocalAudioReconcilePolicy';
|
||||
} from '@app/features/voice/engine/VoiceLocalAudioReconcilePolicy';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
const RUNAWAY_RUN_LIMIT = 512;
|
||||
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {
|
||||
getLocalSpeakingThresholdRms,
|
||||
LOCAL_MAX_RMS,
|
||||
LOCAL_MIN_RMS,
|
||||
SPEAKING_LOCAL_RELEASE_MS,
|
||||
} from '@app/features/voice/engine/VoiceSpeakingThreshold';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
type LocalSpeakingOverrideInput,
|
||||
resolveLocalSpeakingOverrideState,
|
||||
@@ -15,7 +8,14 @@ import {
|
||||
updateVoiceActivityNoiseFloorRms,
|
||||
type VoiceActivityGateInput,
|
||||
type VoiceActivityGateState,
|
||||
} from './VoiceLocalSpeakingGate';
|
||||
} from '@app/features/voice/engine/VoiceLocalSpeakingGate';
|
||||
import {
|
||||
getLocalSpeakingThresholdRms,
|
||||
LOCAL_MAX_RMS,
|
||||
LOCAL_MIN_RMS,
|
||||
SPEAKING_LOCAL_RELEASE_MS,
|
||||
} from '@app/features/voice/engine/VoiceSpeakingThreshold';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
const UNMUTED_OPEN_MIC: LocalSpeakingOverrideInput = {
|
||||
pushToTalkActive: false,
|
||||
|
||||
@@ -14,12 +14,12 @@ import {
|
||||
voiceMediaGraphPublicationMissingDeadlineKey,
|
||||
voiceMediaGraphWatchAttemptDeadlineKey,
|
||||
WATCH_ATTEMPT_TIMEOUT_MS,
|
||||
} from './VoiceMediaGraphDeadlines';
|
||||
} from '@app/features/voice/engine/VoiceMediaGraphDeadlines';
|
||||
import {
|
||||
reconcileVoiceMediaGraphSubscriptionEntry,
|
||||
voiceMediaGraphCommandAlreadyQueued,
|
||||
} from './VoiceMediaGraphReconcile';
|
||||
import type {VoiceMediaGraphPartialTrackInfo} from './VoiceMediaGraphStats';
|
||||
} from '@app/features/voice/engine/VoiceMediaGraphReconcile';
|
||||
import type {VoiceMediaGraphPartialTrackInfo} from '@app/features/voice/engine/VoiceMediaGraphStats';
|
||||
import {
|
||||
type VoiceMediaGraphStatsEntry,
|
||||
type VoiceMediaGraphStatsPlatform,
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
type VoiceMediaGraphStatsTrackTarget,
|
||||
voiceMediaGraphStatsObservationMatchesTarget,
|
||||
voiceMediaGraphStatsTrackKey,
|
||||
} from './VoiceMediaGraphStatsObservations';
|
||||
} from '@app/features/voice/engine/VoiceMediaGraphStatsObservations';
|
||||
import type {
|
||||
VoiceMediaGraphPublicationLostEvent,
|
||||
VoiceMediaGraphPublicationObservedEvent,
|
||||
@@ -51,22 +51,25 @@ import type {
|
||||
VoiceMediaGraphSubscriptionSubscribeEvent,
|
||||
VoiceMediaGraphSubscriptionTarget,
|
||||
VoiceMediaGraphVideoQuality,
|
||||
} from './VoiceMediaGraphSubscriptionTypes';
|
||||
import type {VoiceTrackSource} from './VoiceTrackSource';
|
||||
} from '@app/features/voice/engine/VoiceMediaGraphSubscriptionTypes';
|
||||
import type {VoiceTrackSource} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
|
||||
export function voiceMediaGraphAttemptKeyIsOperation(attemptKey: string): boolean {
|
||||
assert.ok(attemptKey.length > 0, 'attemptKey is required');
|
||||
return attemptKey.includes(':operation:');
|
||||
}
|
||||
|
||||
export {systemVoiceMediaGraphClock, type VoiceMediaGraphClockPort} from './VoiceMediaGraphClock';
|
||||
export {
|
||||
systemVoiceMediaGraphClock,
|
||||
type VoiceMediaGraphClockPort,
|
||||
} from '@app/features/voice/engine/VoiceMediaGraphClock';
|
||||
export {
|
||||
buildVoiceMediaGraphNativeCameraQualityCommand,
|
||||
buildVoiceMediaGraphNativeCameraSubscriptionCommand,
|
||||
buildVoiceMediaGraphNativeScreenShareEnabledCommand,
|
||||
buildVoiceMediaGraphNativeScreenShareQualityCommand,
|
||||
buildVoiceMediaGraphNativeScreenShareSubscriptionCommands,
|
||||
} from './VoiceMediaGraphCommands';
|
||||
} from '@app/features/voice/engine/VoiceMediaGraphCommands';
|
||||
export {
|
||||
PUBLICATION_MISSING_TIMEOUT_MS,
|
||||
PUBLISHER_REPUBLISH_GRACE_MS,
|
||||
@@ -77,15 +80,18 @@ export {
|
||||
voiceMediaGraphPublicationMissingDeadlineKey,
|
||||
voiceMediaGraphWatchAttemptDeadlineKey,
|
||||
WATCH_ATTEMPT_TIMEOUT_MS,
|
||||
} from './VoiceMediaGraphDeadlines';
|
||||
export {reconcileVoiceMediaGraphSubscriptionEntry, voiceMediaGraphCommandsEquivalent} from './VoiceMediaGraphReconcile';
|
||||
} from '@app/features/voice/engine/VoiceMediaGraphDeadlines';
|
||||
export {
|
||||
reconcileVoiceMediaGraphSubscriptionEntry,
|
||||
voiceMediaGraphCommandsEquivalent,
|
||||
} from '@app/features/voice/engine/VoiceMediaGraphReconcile';
|
||||
export {
|
||||
mergeVoiceMediaGraphTrackInfo,
|
||||
type VoiceMediaGraphNativeStatsTarget,
|
||||
type VoiceMediaGraphPartialTrackInfo,
|
||||
type VoiceMediaGraphPerTrackStatsTarget,
|
||||
type VoiceMediaGraphTrackInfo,
|
||||
} from './VoiceMediaGraphStats';
|
||||
} from '@app/features/voice/engine/VoiceMediaGraphStats';
|
||||
export type {
|
||||
VoiceMediaGraphStatsDirection,
|
||||
VoiceMediaGraphStatsEntry,
|
||||
@@ -93,7 +99,7 @@ export type {
|
||||
VoiceMediaGraphStatsPlatform,
|
||||
VoiceMediaGraphStatsTrackObservation,
|
||||
VoiceMediaGraphStatsTrackTarget,
|
||||
} from './VoiceMediaGraphStatsObservations';
|
||||
} from '@app/features/voice/engine/VoiceMediaGraphStatsObservations';
|
||||
export type {
|
||||
VoiceMediaGraphPublicationLostEvent,
|
||||
VoiceMediaGraphPublicationObservedEvent,
|
||||
@@ -125,7 +131,7 @@ export type {
|
||||
VoiceMediaGraphSubscriptionTarget,
|
||||
VoiceMediaGraphSubscriptionUnsubscribeEvent,
|
||||
VoiceMediaGraphVideoQuality,
|
||||
} from './VoiceMediaGraphSubscriptionTypes';
|
||||
} from '@app/features/voice/engine/VoiceMediaGraphSubscriptionTypes';
|
||||
|
||||
export const VOICE_MEDIA_GRAPH_ENTRY_LIMIT = 256;
|
||||
export const VOICE_MEDIA_GRAPH_SCREEN_SHARE_SOURCE = 'screen_share';
|
||||
|
||||
@@ -4,8 +4,8 @@ import assert from 'node:assert/strict';
|
||||
import type {
|
||||
VoiceMediaGraphRemoteSubscriptionCommand,
|
||||
VoiceMediaGraphVideoQuality,
|
||||
} from './VoiceMediaGraphSubscriptionTypes';
|
||||
import {VoiceTrackSource} from './VoiceTrackSource';
|
||||
} from '@app/features/voice/engine/VoiceMediaGraphSubscriptionTypes';
|
||||
import {VoiceTrackSource} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
|
||||
export function buildVoiceMediaGraphNativeScreenShareSubscriptionCommands(args: {
|
||||
participantIdentity: string;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import assert from 'node:assert/strict';
|
||||
import {VOICE_MEDIA_GRAPH_ENTRY_LIMIT, type VoiceMediaGraphSnapshot} from './VoiceMediaGraph';
|
||||
import {VOICE_MEDIA_GRAPH_ENTRY_LIMIT, type VoiceMediaGraphSnapshot} from '@app/features/voice/engine/VoiceMediaGraph';
|
||||
|
||||
function collectSubscriptionViolations(snapshot: VoiceMediaGraphSnapshot, violations: Array<string>): void {
|
||||
let visited = 0;
|
||||
|
||||
@@ -4,7 +4,7 @@ import assert from 'node:assert/strict';
|
||||
import type {
|
||||
VoiceMediaGraphSubscriptionCommand,
|
||||
VoiceMediaGraphSubscriptionEntry,
|
||||
} from './VoiceMediaGraphSubscriptionTypes';
|
||||
} from '@app/features/voice/engine/VoiceMediaGraphSubscriptionTypes';
|
||||
|
||||
const VOICE_MEDIA_GRAPH_RECONCILE_SCAN_LIMIT = 2048;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import assert from 'node:assert/strict';
|
||||
import type {VoiceEngineV2PerTrackStats} from '@fluxer/voice_engine_v2';
|
||||
import {
|
||||
type VoiceMediaGraphStatsEntry,
|
||||
type VoiceMediaGraphStatsKind,
|
||||
@@ -10,8 +9,9 @@ import {
|
||||
type VoiceMediaGraphStatsTrackTarget,
|
||||
voiceMediaGraphStatsObservationMatchesTarget,
|
||||
voiceMediaGraphStatsTrackKey,
|
||||
} from './VoiceMediaGraphStatsObservations';
|
||||
import type {VoiceTrackSource} from './VoiceTrackSource';
|
||||
} from '@app/features/voice/engine/VoiceMediaGraphStatsObservations';
|
||||
import type {VoiceTrackSource} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
import type {VoiceEngineV2PerTrackStats} from '@fluxer/voice_engine_v2';
|
||||
|
||||
const VOICE_MEDIA_GRAPH_STATS_TRACK_LIMIT = 1024;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {VoiceTrackSource} from './VoiceTrackSource';
|
||||
import type {VoiceTrackSource} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
|
||||
export type VoiceMediaGraphVideoQuality = 'low' | 'medium' | 'high';
|
||||
export type VoiceMediaGraphSubscriptionContext = 'focused' | 'carousel' | 'hidden';
|
||||
|
||||
@@ -7,9 +7,9 @@ import {
|
||||
type VoiceMediaGraphFailure,
|
||||
type VoiceMediaGraphSnapshot,
|
||||
type VoiceMediaGraphSubscriptionEntry,
|
||||
} from './VoiceMediaGraph';
|
||||
import {VOICE_MEDIA_GRAPH_FIRST_FRAME_TIMEOUT_FAILURE} from './VoiceMediaGraphDeadlines';
|
||||
import type {VoiceTrackSource} from './VoiceTrackSource';
|
||||
} from '@app/features/voice/engine/VoiceMediaGraph';
|
||||
import {VOICE_MEDIA_GRAPH_FIRST_FRAME_TIMEOUT_FAILURE} from '@app/features/voice/engine/VoiceMediaGraphDeadlines';
|
||||
import type {VoiceTrackSource} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
|
||||
export const VOICE_MEDIA_GRAPH_FIRST_FRAME_RECOVERY_VISIBLE_MS = 30_000;
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import {
|
||||
VOICE_MEDIA_GRAPH_ENTRY_LIMIT,
|
||||
type VoiceMediaGraphEvent,
|
||||
type VoiceMediaGraphSnapshot,
|
||||
} from './VoiceMediaGraph';
|
||||
import {voiceMediaGraphStore} from './VoiceMediaGraphStore';
|
||||
} from '@app/features/voice/engine/VoiceMediaGraph';
|
||||
import {voiceMediaGraphStore} from '@app/features/voice/engine/VoiceMediaGraphStore';
|
||||
|
||||
export interface VoiceMediaGraphTimerSchedulerPlatform {
|
||||
setTimeout(callback: () => void, delayMs: number): unknown;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
computeVoiceMediaEffectiveAudioState,
|
||||
createVoiceMediaSnapshot,
|
||||
transitionVoiceMediaSnapshot,
|
||||
type VoiceMediaAudioControls,
|
||||
type VoiceMediaSnapshot,
|
||||
} from './VoiceMediaStateMachine';
|
||||
} from '@app/features/voice/engine/VoiceMediaStateMachine';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
const releasedPtt: VoiceMediaAudioControls = {
|
||||
pushToTalkActive: true,
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {SPEAKING_REMOTE_ATTACK_MS, SPEAKING_REMOTE_RELEASE_MS} from '@app/features/voice/engine/VoiceSpeakingThreshold';
|
||||
import {
|
||||
VoiceConnectionQuality,
|
||||
type VoiceConnectionQuality as VoiceConnectionQualityType,
|
||||
} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
import type {Participant, Room} from 'livekit-client';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
__TEST__,
|
||||
createLivekitParticipantSnapshot,
|
||||
@@ -18,7 +11,14 @@ import {
|
||||
transitionVoiceRemoteSpeakingSnapshot,
|
||||
type VoiceRemoteSpeakingCommand,
|
||||
type VoiceRemoteSpeakingSnapshot,
|
||||
} from './VoiceParticipantStateMachine';
|
||||
} from '@app/features/voice/engine/VoiceParticipantStateMachine';
|
||||
import {SPEAKING_REMOTE_ATTACK_MS, SPEAKING_REMOTE_RELEASE_MS} from '@app/features/voice/engine/VoiceSpeakingThreshold';
|
||||
import {
|
||||
VoiceConnectionQuality,
|
||||
type VoiceConnectionQuality as VoiceConnectionQualityType,
|
||||
} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
import type {Participant, Room} from 'livekit-client';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
const connectionQuality = VoiceConnectionQuality.Good;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {VoiceChannelPermissions} from '@app/features/voice/utils/VoicePermissionUtils';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
createVoicePermissionSnapshot,
|
||||
getVoicePermissionWatchStateValue,
|
||||
@@ -9,7 +7,9 @@ import {
|
||||
type VoicePermissionCommand,
|
||||
type VoicePermissionEvent,
|
||||
type VoicePermissionSnapshot,
|
||||
} from './VoicePermissionStateMachine';
|
||||
} from '@app/features/voice/engine/VoicePermissionStateMachine';
|
||||
import type {VoiceChannelPermissions} from '@app/features/voice/utils/VoicePermissionUtils';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
const DEFAULT_PERMISSIONS: VoiceChannelPermissions = {
|
||||
canSpeak: true,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
createVoiceScreenShareSnapshot,
|
||||
getVoiceScreenShareStateValue,
|
||||
transitionVoiceScreenShareSnapshot,
|
||||
type VoiceScreenShareSnapshot,
|
||||
} from './VoiceScreenShareStateMachine';
|
||||
} from '@app/features/voice/engine/VoiceScreenShareStateMachine';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
const STREAM_KEY = 'guild-a:channel-a:connection-a';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
|
||||
import {
|
||||
discardVoiceJoinChimeSequence,
|
||||
resetSelfJoinChimesForTests,
|
||||
@@ -11,7 +10,8 @@ import {
|
||||
VOICE_JOIN_CHIME_SEQUENCE_RETENTION_MS,
|
||||
type VoiceJoinChimeSequenceResult,
|
||||
waitForVoiceJoinChimeSequence,
|
||||
} from './VoiceSelfJoinChime';
|
||||
} from '@app/features/voice/engine/VoiceSelfJoinChime';
|
||||
import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
|
||||
|
||||
vi.mock('@app/features/ui/commands/SoundCommands', () => ({
|
||||
playOneShotSoundImmediatelyBypassingSelfDeafened: vi.fn(() => Promise.resolve(true)),
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {VoiceEngineV2PerTrackStats, VoiceEngineV2TransportInfo} from '@fluxer/voice_engine_v2';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
createInitialVoiceStats,
|
||||
createVoiceStatsSnapshot,
|
||||
@@ -11,7 +9,9 @@ import {
|
||||
selectVoiceStatsCollectionDecision,
|
||||
transitionVoiceStatsSnapshot,
|
||||
type VoiceStatsSnapshot,
|
||||
} from './VoiceStatsStateMachine';
|
||||
} from '@app/features/voice/engine/VoiceStatsStateMachine';
|
||||
import type {VoiceEngineV2PerTrackStats, VoiceEngineV2TransportInfo} from '@fluxer/voice_engine_v2';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
const roomA = {id: 'room-a'};
|
||||
const roomB = {id: 'room-b'};
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {
|
||||
asVoiceTrackSource,
|
||||
type VoiceTrackSource,
|
||||
VoiceTrackSource as VoiceTrackSourceValue,
|
||||
} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
import type {LocalParticipant, LocalTrack, LocalTrackPublication} from 'livekit-client';
|
||||
import {asVoiceTrackSource, type VoiceTrackSource, VoiceTrackSource as VoiceTrackSourceValue} from './VoiceTrackSource';
|
||||
|
||||
interface LocalParticipantWithAudioPublications extends Pick<LocalParticipant, 'audioTrackPublications'> {}
|
||||
interface LocalParticipantWithTrackPublications extends Pick<LocalParticipant, 'trackPublications'> {}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {
|
||||
asVoiceTrackSource,
|
||||
isScreenShareAudioPublicationLike,
|
||||
VoiceTrackSource,
|
||||
} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {asVoiceTrackSource, isScreenShareAudioPublicationLike, VoiceTrackSource} from './VoiceTrackSource';
|
||||
|
||||
describe('VoiceTrackSource', () => {
|
||||
it('normalizes native screen-share audio source aliases', () => {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
assertBoolean,
|
||||
assertDisconnectReason,
|
||||
@@ -15,7 +14,8 @@ import {
|
||||
isMutedOrDeafened,
|
||||
isPermissionDeniedError,
|
||||
isReadyToRepublishTrack,
|
||||
} from './VoiceEngineV2AppAdapterAssertions';
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppAdapterAssertions';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
describe('VoiceEngineV2AppAdapterAssertions', () => {
|
||||
describe('assertNonEmptyString', () => {
|
||||
|
||||
+5
-5
@@ -3,16 +3,16 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import ExperimentAssignments from '@app/features/experiment/state/ExperimentAssignments';
|
||||
import VoiceDevicePermissionState from '@app/features/voice/engine/VoiceDevicePermissionState';
|
||||
import ParticipantVolume from '@app/features/voice/state/ParticipantVolume';
|
||||
import StreamAudioPrefs from '@app/features/voice/state/StreamAudioPrefs';
|
||||
import VoiceSettings from '@app/features/voice/state/VoiceSettings';
|
||||
import type {Room} from 'livekit-client';
|
||||
import {
|
||||
createVoiceEngineV2AppAudioSettingsSnapshot,
|
||||
hasVoiceEngineV2InputProcessorSettingsChanged,
|
||||
hasVoiceEngineV2MicrophoneCaptureSettingsChanged,
|
||||
type VoiceEngineV2AppAudioSettingsSnapshot,
|
||||
} from './VoiceEngineV2AppAudioSettingsSync';
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppAudioSettingsSync';
|
||||
import ParticipantVolume from '@app/features/voice/state/ParticipantVolume';
|
||||
import StreamAudioPrefs from '@app/features/voice/state/StreamAudioPrefs';
|
||||
import VoiceSettings from '@app/features/voice/state/VoiceSettings';
|
||||
import type {Room} from 'livekit-client';
|
||||
|
||||
export interface VoiceEngineV2AppAudioPreferencesSnapshot {
|
||||
readonly audioSettings: VoiceEngineV2AppAudioSettingsSnapshot;
|
||||
|
||||
+4
-1
@@ -1,9 +1,12 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {
|
||||
getCameraCaptureDimensions,
|
||||
pickCameraSubscriptionQuality,
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppCameraResolutionPresets';
|
||||
import type {CameraResolution} from '@app/features/voice/state/VoiceSettings';
|
||||
import {VideoPresets} from 'livekit-client';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {getCameraCaptureDimensions, pickCameraSubscriptionQuality} from './VoiceEngineV2AppCameraResolutionPresets';
|
||||
|
||||
const EXPECTED_PRESET_TABLE = [
|
||||
{resolution: 'high', width: 1920, height: 1080, frameRate: 30, videoPreset: VideoPresets.h1080},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {
|
||||
createVoiceEngineV2AppControllerHost,
|
||||
type VoiceEngineV2AppControllerHost,
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppControllerHost';
|
||||
import {
|
||||
createVoiceEngineV2MemoryEventLogSpillSink,
|
||||
type VoiceEngineV2HostPorts,
|
||||
type VoiceEngineV2RuntimeClock,
|
||||
} from '@fluxer/voice_engine_v2';
|
||||
import {
|
||||
createVoiceEngineV2AppControllerHost,
|
||||
type VoiceEngineV2AppControllerHost,
|
||||
} from './VoiceEngineV2AppControllerHost';
|
||||
|
||||
export interface VoiceEngineV2AppTestControllerHostOptions {
|
||||
ports: VoiceEngineV2HostPorts;
|
||||
|
||||
+1
-1
@@ -8,6 +8,7 @@ import {
|
||||
openBrowserVoiceDebugEventSinkPopout,
|
||||
} from '@app/features/voice/diagnostics/VoiceDebugBrowserEventSinkPopout';
|
||||
import {asVoiceTrackSource, VoiceTrackSource} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
import {assertNonNullObject, assertString} from '@app/features/voice/engine/v2/VoiceEngineV2AppAdapterAssertions';
|
||||
import type {DesktopVoiceDebugEventSinkEntry} from '@app/types/electron.d';
|
||||
import type {
|
||||
LocalTrackPublication,
|
||||
@@ -18,7 +19,6 @@ import type {
|
||||
TrackPublication,
|
||||
} from 'livekit-client';
|
||||
import {RoomEvent} from 'livekit-client';
|
||||
import {assertNonNullObject, assertString} from './VoiceEngineV2AppAdapterAssertions';
|
||||
|
||||
const logger = new Logger('VoiceEngineV2AppDebugEventSinkHostAdapter');
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
createVoiceEngineV2AppDiagnosticsAdapter,
|
||||
VOICE_ENGINE_V2_DIAGNOSTICS_CODE_MAX_LENGTH,
|
||||
VOICE_ENGINE_V2_DIAGNOSTICS_MESSAGE_MAX_LENGTH,
|
||||
type VoiceEngineV2AppDiagnosticsLogger,
|
||||
type VoiceEngineV2DiagnosticsLevel,
|
||||
} from './VoiceEngineV2AppDiagnosticsAdapter';
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppDiagnosticsAdapter';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
interface FakeLoggerCall {
|
||||
level: VoiceEngineV2DiagnosticsLevel;
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {VoiceEngineV2EventLogEntry} from '@fluxer/voice_engine_v2';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
createVoiceEngineV2AppEventLogSpillLoggerSink,
|
||||
type VoiceEngineV2AppEventLogSpillLogger,
|
||||
} from './VoiceEngineV2AppEventLogSpillLoggerSink';
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppEventLogSpillLoggerSink';
|
||||
import type {VoiceEngineV2EventLogEntry} from '@fluxer/voice_engine_v2';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
function makeEntry(sequence: number, atMs: number = sequence * 10): VoiceEngineV2EventLogEntry {
|
||||
return {
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {createVoiceEngineV2AppTestControllerHost} from '@app/features/voice/engine/v2/VoiceEngineV2AppControllerHostTestUtils';
|
||||
import {
|
||||
createVoiceEngineV2AppHostPorts,
|
||||
createVoiceEngineV2AppIngestionPort,
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppHostPorts';
|
||||
import type {VoiceEngineV2Event, VoiceEngineV2Stats} from '@fluxer/voice_engine_v2';
|
||||
import {waitForRuntime} from '@fluxer/voice_engine_v2/testing';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {createVoiceEngineV2AppTestControllerHost} from './VoiceEngineV2AppControllerHostTestUtils';
|
||||
import {createVoiceEngineV2AppHostPorts, createVoiceEngineV2AppIngestionPort} from './VoiceEngineV2AppHostPorts';
|
||||
|
||||
type AppHostPortCall =
|
||||
| {type: 'gateway.writeVoiceState'}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {
|
||||
VoiceEngineV2AppCapabilitiesAdapter,
|
||||
type VoiceEngineV2NativeCapabilitiesBinding,
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppCapabilitiesAdapter';
|
||||
import type {VoiceEngineV2AppLifecycleAdapter} from '@app/features/voice/engine/v2/VoiceEngineV2AppLifecycleAdapter';
|
||||
import type {VoiceEngineV2AppLiveKitExecutionAdapter} from '@app/features/voice/engine/v2/VoiceEngineV2AppLiveKitExecutionAdapter';
|
||||
import {createVoiceEngineV2AppSystemPermissionAdapter} from '@app/features/voice/engine/v2/VoiceEngineV2AppSystemPermissionAdapter';
|
||||
import type {
|
||||
CapabilitiesPort,
|
||||
DevicePort,
|
||||
@@ -18,13 +25,6 @@ import type {
|
||||
VoiceEngineV2HostPorts,
|
||||
VoiceStateIngestionPort,
|
||||
} from '@fluxer/voice_engine_v2';
|
||||
import {
|
||||
VoiceEngineV2AppCapabilitiesAdapter,
|
||||
type VoiceEngineV2NativeCapabilitiesBinding,
|
||||
} from './VoiceEngineV2AppCapabilitiesAdapter';
|
||||
import type {VoiceEngineV2AppLifecycleAdapter} from './VoiceEngineV2AppLifecycleAdapter';
|
||||
import type {VoiceEngineV2AppLiveKitExecutionAdapter} from './VoiceEngineV2AppLiveKitExecutionAdapter';
|
||||
import {createVoiceEngineV2AppSystemPermissionAdapter} from './VoiceEngineV2AppSystemPermissionAdapter';
|
||||
|
||||
export type VoiceEngineV2AppGatewayVoiceStateAdapter = GatewayPort;
|
||||
export type VoiceEngineV2AppVoiceStateIngestionAdapter = VoiceStateIngestionPort;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {createVoiceEngineV2DeterministicClockPort} from '@fluxer/voice_engine_v2/runtime';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import type {VoiceEngineV2AppDiagnosticsLogger} from './VoiceEngineV2AppDiagnosticsAdapter';
|
||||
import type {VoiceEngineV2AppDiagnosticsLogger} from '@app/features/voice/engine/v2/VoiceEngineV2AppDiagnosticsAdapter';
|
||||
import {
|
||||
createVoiceEngineV2AppLifecycleAdapter,
|
||||
LIFECYCLE_OPERATION_CAP,
|
||||
TEARDOWN_PER_DISPOSABLE_TIMEOUT_MS,
|
||||
type VoiceEngineV2AppLifecycleAdapter,
|
||||
type VoiceEngineV2AppLifecycleDisposable,
|
||||
} from './VoiceEngineV2AppLifecycleAdapter';
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppLifecycleAdapter';
|
||||
import {createVoiceEngineV2DeterministicClockPort} from '@fluxer/voice_engine_v2/runtime';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
interface LoggerCall {
|
||||
readonly level: 'trace' | 'debug' | 'info' | 'warn' | 'error';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import assert from 'node:assert/strict';
|
||||
import type {VoiceEngineV2AppDiagnosticsLogger} from '@app/features/voice/engine/v2/VoiceEngineV2AppDiagnosticsAdapter';
|
||||
import type {VoiceEngineV2ClockPort} from '@fluxer/voice_engine_v2/runtime';
|
||||
import type {VoiceEngineV2AppDiagnosticsLogger} from './VoiceEngineV2AppDiagnosticsAdapter';
|
||||
|
||||
export const LIFECYCLE_OPERATION_CAP = 4096;
|
||||
export const TEARDOWN_PER_DISPOSABLE_TIMEOUT_MS = 5000;
|
||||
|
||||
+2
-2
@@ -1,6 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
chooseMicrophoneRefreshStrategy,
|
||||
computeSpeakingDetectorRms,
|
||||
@@ -8,7 +7,8 @@ import {
|
||||
createInitialMicrophoneRefreshState,
|
||||
readSpeakingDetectorThresholdRms,
|
||||
shouldReleaseSpeakingHold,
|
||||
} from './VoiceEngineV2AppMicrophoneTransaction';
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppMicrophoneTransaction';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
describe('VoiceEngineV2AppMicrophoneTransaction', () => {
|
||||
describe('createInitialMicrophoneEnableState', () => {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import type {LivekitParticipantSnapshot} from '@app/features/voice/engine/VoiceParticipantStateMachine';
|
||||
import {asVoiceConnectionQuality, VoiceTrackSource} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
import {assertNonNullObject, assertString} from '@app/features/voice/engine/v2/VoiceEngineV2AppAdapterAssertions';
|
||||
import type {
|
||||
VoiceEngineV2Controller,
|
||||
VoiceEngineV2Event,
|
||||
@@ -12,7 +13,6 @@ import type {
|
||||
} from '@fluxer/voice_engine_v2';
|
||||
import type {Participant, Room, TrackPublication} from 'livekit-client';
|
||||
import {Track} from 'livekit-client';
|
||||
import {assertNonNullObject, assertString} from './VoiceEngineV2AppAdapterAssertions';
|
||||
|
||||
const MAX_DISCARDED_CONNECTION_IDS = 4096;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ export {
|
||||
createVoiceEngineV2AppSystemPermissionAdapter,
|
||||
VoiceEngineV2AppSystemPermissionAdapter,
|
||||
type VoiceEngineV2SystemPermissionsApi,
|
||||
} from './VoiceEngineV2AppSystemPermissionAdapter';
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppSystemPermissionAdapter';
|
||||
|
||||
const logger = new Logger('VoiceEngineV2AppPermissionAdapter');
|
||||
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {createVoiceEngineV2AppTestControllerHost} from '@app/features/voice/engine/v2/VoiceEngineV2AppControllerHostTestUtils';
|
||||
import {createVoiceEngineV2AppIngestionPort} from '@app/features/voice/engine/v2/VoiceEngineV2AppHostPorts';
|
||||
import {createVoiceEngineV2AppLifecycleAdapter} from '@app/features/voice/engine/v2/VoiceEngineV2AppLifecycleAdapter';
|
||||
import {createVoiceEngineV2AppProductionHostPorts} from '@app/features/voice/engine/v2/VoiceEngineV2AppProductionHostPorts';
|
||||
import type {VoiceEngineV2AppTimerScheduler} from '@app/features/voice/engine/v2/VoiceEngineV2AppTimerAdapter';
|
||||
import {
|
||||
createVoiceEngineV2ShadowHostPorts,
|
||||
type VoiceEngineV2ShadowHostPortCall,
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2ShadowHostPorts';
|
||||
import {
|
||||
availableVoiceEngineV2Capabilities,
|
||||
type NativeMediaPort,
|
||||
@@ -14,12 +23,6 @@ import {createVoiceEngineV2DeterministicClockPort} from '@fluxer/voice_engine_v2
|
||||
import {waitForRuntime} from '@fluxer/voice_engine_v2/testing';
|
||||
import type {Room} from 'livekit-client';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {createVoiceEngineV2AppTestControllerHost} from './VoiceEngineV2AppControllerHostTestUtils';
|
||||
import {createVoiceEngineV2AppIngestionPort} from './VoiceEngineV2AppHostPorts';
|
||||
import {createVoiceEngineV2AppLifecycleAdapter} from './VoiceEngineV2AppLifecycleAdapter';
|
||||
import {createVoiceEngineV2AppProductionHostPorts} from './VoiceEngineV2AppProductionHostPorts';
|
||||
import type {VoiceEngineV2AppTimerScheduler} from './VoiceEngineV2AppTimerAdapter';
|
||||
import {createVoiceEngineV2ShadowHostPorts, type VoiceEngineV2ShadowHostPortCall} from './VoiceEngineV2ShadowHostPorts';
|
||||
|
||||
type ProductionCall =
|
||||
| {type: 'connect'; guildId: string | null; channelId: string}
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {createVoiceEngineV2AppDevicesAdapter} from '@app/features/voice/engine/v2/VoiceEngineV2AppDevicesAdapter';
|
||||
import {createVoiceEngineV2AppDiagnosticsAdapter} from '@app/features/voice/engine/v2/VoiceEngineV2AppDiagnosticsAdapter';
|
||||
import {
|
||||
createVoiceEngineV2AppHostPorts,
|
||||
createVoiceEngineV2AppIngestionPort,
|
||||
type VoiceEngineV2AppIngestionPort,
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppHostPorts';
|
||||
import {
|
||||
createVoiceEngineV2AppLifecycleAdapter,
|
||||
type VoiceEngineV2AppLifecycleAdapter,
|
||||
type VoiceEngineV2AppLifecycleDisposable,
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppLifecycleAdapter';
|
||||
import {
|
||||
type VoiceEngineV2AppLiveKitAudioOutputStore,
|
||||
type VoiceEngineV2AppLiveKitConnectionDelegate,
|
||||
VoiceEngineV2AppLiveKitExecutionAdapter,
|
||||
type VoiceEngineV2AppLiveKitMediaDelegate,
|
||||
type VoiceEngineV2AppLiveKitScreenShareDelegate,
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppLiveKitExecutionAdapter';
|
||||
import {
|
||||
createVoiceEngineV2AppTimerAdapter,
|
||||
type VoiceEngineV2AppTimerScheduler,
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppTimerAdapter';
|
||||
import type {
|
||||
DevicePort,
|
||||
GatewayPort,
|
||||
@@ -10,26 +33,6 @@ import type {
|
||||
} from '@fluxer/voice_engine_v2';
|
||||
import {createVoiceEngineV2SystemClockPort, type VoiceEngineV2ClockPort} from '@fluxer/voice_engine_v2/runtime';
|
||||
import type {Room} from 'livekit-client';
|
||||
import {createVoiceEngineV2AppDevicesAdapter} from './VoiceEngineV2AppDevicesAdapter';
|
||||
import {createVoiceEngineV2AppDiagnosticsAdapter} from './VoiceEngineV2AppDiagnosticsAdapter';
|
||||
import {
|
||||
createVoiceEngineV2AppHostPorts,
|
||||
createVoiceEngineV2AppIngestionPort,
|
||||
type VoiceEngineV2AppIngestionPort,
|
||||
} from './VoiceEngineV2AppHostPorts';
|
||||
import {
|
||||
createVoiceEngineV2AppLifecycleAdapter,
|
||||
type VoiceEngineV2AppLifecycleAdapter,
|
||||
type VoiceEngineV2AppLifecycleDisposable,
|
||||
} from './VoiceEngineV2AppLifecycleAdapter';
|
||||
import {
|
||||
type VoiceEngineV2AppLiveKitAudioOutputStore,
|
||||
type VoiceEngineV2AppLiveKitConnectionDelegate,
|
||||
VoiceEngineV2AppLiveKitExecutionAdapter,
|
||||
type VoiceEngineV2AppLiveKitMediaDelegate,
|
||||
type VoiceEngineV2AppLiveKitScreenShareDelegate,
|
||||
} from './VoiceEngineV2AppLiveKitExecutionAdapter';
|
||||
import {createVoiceEngineV2AppTimerAdapter, type VoiceEngineV2AppTimerScheduler} from './VoiceEngineV2AppTimerAdapter';
|
||||
|
||||
export interface VoiceEngineV2AppProductionHostPortsLogger {
|
||||
trace(...args: Array<unknown>): void;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import assert from 'node:assert/strict';
|
||||
import {Store} from '@app/features/voice/engine/Store';
|
||||
import type {VoiceEngineV2AppControllerHost} from '@app/features/voice/engine/v2/VoiceEngineV2AppControllerHost';
|
||||
import type {VoiceEngineV2Model, VoiceEngineV2Snapshot} from '@fluxer/voice_engine_v2';
|
||||
import {isVoiceEngineV2FrameReceivedEvent} from '@fluxer/voice_engine_v2/runtime';
|
||||
import {Store} from '../Store';
|
||||
import type {VoiceEngineV2AppControllerHost} from './VoiceEngineV2AppControllerHost';
|
||||
|
||||
export const FRAME_NOTIFY_FLUSH_INTERVAL_MS = 1000;
|
||||
|
||||
|
||||
@@ -17,6 +17,11 @@ import {
|
||||
import {getSharedVoiceAudioContext} from '@app/features/voice/engine/VoiceSharedAudioContext';
|
||||
import {getRemoteSpeakingThresholdRms} from '@app/features/voice/engine/VoiceSpeakingThreshold';
|
||||
import {VoiceTrackKind, VoiceTrackSource} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
import {
|
||||
assertNonEmptyString,
|
||||
assertNonNegativeFinite,
|
||||
assertObjectLike,
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppAdapterAssertions';
|
||||
import ParticipantVolume from '@app/features/voice/state/ParticipantVolume';
|
||||
import {
|
||||
clearRemoteVoicePlaybackBoost,
|
||||
@@ -24,7 +29,6 @@ import {
|
||||
} from '@app/features/voice/state/RemoteVoicePlaybackBoost';
|
||||
import VoiceSettings from '@app/features/voice/state/VoiceSettings';
|
||||
import type {Participant, RemoteAudioTrack, RemoteTrack, RemoteTrackPublication, Room} from 'livekit-client';
|
||||
import {assertNonEmptyString, assertNonNegativeFinite, assertObjectLike} from './VoiceEngineV2AppAdapterAssertions';
|
||||
|
||||
const logger = new Logger('VoiceEngineV2AppRemoteSpeakingAdapter');
|
||||
export const REMOTE_SPEAKING_ANALYSER_INTERVAL_MS = 50;
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {
|
||||
availableVoiceEngineV2Capabilities,
|
||||
createVoiceEngineV2InitialSnapshot,
|
||||
transitionVoiceEngineV2,
|
||||
type VoiceEngineV2Event,
|
||||
type VoiceEngineV2Snapshot,
|
||||
} from '@fluxer/voice_engine_v2';
|
||||
import {replayVoiceEngineV2EventLogFixture, type VoiceEngineV2EventLogFixture} from '@fluxer/voice_engine_v2/testing';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import appVoiceSessionFixtureJson from '../../../../../../packages/voice_engine_v2/fixtures/event_logs/app_voice_session.json';
|
||||
import {
|
||||
isVoiceEngineV2AppParticipantSpeaking,
|
||||
selectVoiceEngineV2AppConnection,
|
||||
@@ -32,7 +22,17 @@ import {
|
||||
selectVoiceEngineV2AppView,
|
||||
selectVoiceEngineV2AppWatchedStream,
|
||||
selectVoiceEngineV2AppWatchedStreams,
|
||||
} from './VoiceEngineV2AppSelectors';
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppSelectors';
|
||||
import {
|
||||
availableVoiceEngineV2Capabilities,
|
||||
createVoiceEngineV2InitialSnapshot,
|
||||
transitionVoiceEngineV2,
|
||||
type VoiceEngineV2Event,
|
||||
type VoiceEngineV2Snapshot,
|
||||
} from '@fluxer/voice_engine_v2';
|
||||
import appVoiceSessionFixtureJson from '@fluxer/voice_engine_v2/fixtures/event_logs/app_voice_session.json';
|
||||
import {replayVoiceEngineV2EventLogFixture, type VoiceEngineV2EventLogFixture} from '@fluxer/voice_engine_v2/testing';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
function replayEvents(events: Array<VoiceEngineV2Event>): VoiceEngineV2Snapshot {
|
||||
let snapshot = createVoiceEngineV2InitialSnapshot(availableVoiceEngineV2Capabilities());
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import assert from 'node:assert/strict';
|
||||
import {assertNonNullObject, assertString} from '@app/features/voice/engine/v2/VoiceEngineV2AppAdapterAssertions';
|
||||
import {
|
||||
selectVoiceEngineV2Model,
|
||||
summarizeVoiceEngineV2Stats,
|
||||
@@ -24,7 +25,6 @@ import {
|
||||
type VoiceEngineV2TrackSource,
|
||||
type VoiceEngineV2WatchedStream,
|
||||
} from '@fluxer/voice_engine_v2';
|
||||
import {assertNonNullObject, assertString} from './VoiceEngineV2AppAdapterAssertions';
|
||||
|
||||
export type VoiceEngineV2AppProjectionSource = VoiceEngineV2Model | VoiceEngineV2Snapshot;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import assert from 'node:assert/strict';
|
||||
import {Logger} from '@app/features/platform/utils/AppLogger';
|
||||
import {createVoiceEngineV2AppDiagnosticsAdapter} from '@app/features/voice/engine/v2/VoiceEngineV2AppDiagnosticsAdapter';
|
||||
import type {NativeScreenCaptureLifecycleMessage} from '@app/types/electron.d';
|
||||
import {
|
||||
type DiagnosticsPort,
|
||||
@@ -13,7 +14,6 @@ import {
|
||||
type VoiceEngineV2Event,
|
||||
type VoiceEngineV2SourceLifecycleTransitionedEvent,
|
||||
} from '@fluxer/voice_engine_v2';
|
||||
import {createVoiceEngineV2AppDiagnosticsAdapter} from './VoiceEngineV2AppDiagnosticsAdapter';
|
||||
|
||||
const VALID_LIFECYCLE_KINDS: ReadonlySet<NativeScreenCaptureLifecycleMessage['kind']> = new Set([
|
||||
'error',
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
type VoiceStatsSnapshot,
|
||||
} from '@app/features/voice/engine/VoiceStatsStateMachine';
|
||||
import {asVoiceConnectionQuality, VoiceConnectionQuality} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
import {assertFiniteNumber, assertNonNullObject} from '@app/features/voice/engine/v2/VoiceEngineV2AppAdapterAssertions';
|
||||
import {
|
||||
classifyVideoDecoderAcceleration,
|
||||
classifyVideoEncoderAcceleration,
|
||||
@@ -30,7 +31,6 @@ import type {
|
||||
VoiceEngineV2TrackKind,
|
||||
} from '@fluxer/voice_engine_v2';
|
||||
import type {Room} from 'livekit-client';
|
||||
import {assertFiniteNumber, assertNonNullObject} from './VoiceEngineV2AppAdapterAssertions';
|
||||
|
||||
const logger = new Logger('VoiceEngineV2AppStatsHostAdapter');
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {createVoiceEngineV2DeterministicClockPort} from '@fluxer/voice_engine_v2/runtime';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
createVoiceEngineV2AppTimerAdapter,
|
||||
VOICE_ENGINE_V2_TIMER_REGISTRY_CAP,
|
||||
@@ -9,7 +7,9 @@ import {
|
||||
type VoiceEngineV2AppTimerHandle,
|
||||
VoiceEngineV2AppTimerRegistryFullError,
|
||||
type VoiceEngineV2AppTimerScheduler,
|
||||
} from './VoiceEngineV2AppTimerAdapter';
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2AppTimerAdapter';
|
||||
import {createVoiceEngineV2DeterministicClockPort} from '@fluxer/voice_engine_v2/runtime';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
interface FakeTimer {
|
||||
id: number;
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
import type {GuildReadyData} from '@app/features/gateway/types/GatewayGuildTypes';
|
||||
import type {VoiceState} from '@app/features/gateway/types/GatewayVoiceTypes';
|
||||
import {Logger} from '@app/features/platform/utils/AppLogger';
|
||||
import {VoiceEngineV2AppVoiceStateAdapter} from '@app/features/voice/engine/v2/VoiceEngineV2AppVoiceStateAdapter';
|
||||
import {autorun} from 'mobx';
|
||||
import {describe, expect, it, vi} from 'vitest';
|
||||
import {VoiceEngineV2AppVoiceStateAdapter} from './VoiceEngineV2AppVoiceStateAdapter';
|
||||
|
||||
function voiceState(overrides: Partial<VoiceState> = {}): VoiceState {
|
||||
return {
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {createVoiceEngineV2AppTestControllerHost} from '@app/features/voice/engine/v2/VoiceEngineV2AppControllerHostTestUtils';
|
||||
import {
|
||||
createVoiceEngineV2ShadowHostPorts,
|
||||
type VoiceEngineV2ShadowHostPortCall,
|
||||
} from '@app/features/voice/engine/v2/VoiceEngineV2ShadowHostPorts';
|
||||
import {waitForRuntime} from '@fluxer/voice_engine_v2/testing';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {createVoiceEngineV2AppTestControllerHost} from './VoiceEngineV2AppControllerHostTestUtils';
|
||||
import {createVoiceEngineV2ShadowHostPorts, type VoiceEngineV2ShadowHostPortCall} from './VoiceEngineV2ShadowHostPorts';
|
||||
|
||||
describe('VoiceEngineV2ShadowHostPorts', () => {
|
||||
it('records v2 command intent while returning deterministic host results', async () => {
|
||||
|
||||
@@ -4,8 +4,8 @@ import type {GatewayHandlerContext} from '@app/features/gateway/events/EventRout
|
||||
import EntranceSoundPlaybackEngine from '@app/features/voice/engine/EntranceSoundPlaybackEngine';
|
||||
import MediaEngine from '@app/features/voice/engine/MediaEngineFacade';
|
||||
import {waitForVoiceJoinChimeSequence} from '@app/features/voice/engine/VoiceSelfJoinChime';
|
||||
import {handleEntranceSoundPlay} from '@app/features/voice/events/EntranceSoundPlay';
|
||||
import {beforeEach, describe, expect, it, vi} from 'vitest';
|
||||
import {handleEntranceSoundPlay} from './EntranceSoundPlay';
|
||||
|
||||
vi.mock('@app/features/voice/engine/EntranceSoundPlaybackEngine', () => ({
|
||||
default: {play: vi.fn(() => Promise.resolve())},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import ActiveScreenShareSource from '@app/features/voice/state/ActiveScreenShareSource';
|
||||
import {afterEach, describe, expect, it} from 'vitest';
|
||||
import ActiveScreenShareSource from './ActiveScreenShareSource';
|
||||
|
||||
describe('ActiveScreenShareSource', () => {
|
||||
afterEach(() => {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
createLocalVoiceStateSnapshot,
|
||||
getActiveLocalVoiceState,
|
||||
@@ -8,7 +7,8 @@ import {
|
||||
type LocalVoiceStateEvent,
|
||||
type LocalVoiceStateSnapshot,
|
||||
transitionLocalVoiceStateSnapshot,
|
||||
} from './LocalVoiceStateMachine';
|
||||
} from '@app/features/voice/state/LocalVoiceStateMachine';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
const CONNECTION_A = 'connection-a';
|
||||
const CONNECTION_B = 'connection-b';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
createScreenSharePiPSnapshot,
|
||||
type ScreenSharePiPConditions,
|
||||
@@ -9,7 +8,8 @@ import {
|
||||
selectScreenSharePiPCommands,
|
||||
selectScreenSharePiPMode,
|
||||
transitionScreenSharePiPSnapshot,
|
||||
} from './ScreenSharePiPStateMachine';
|
||||
} from '@app/features/voice/state/ScreenSharePiPStateMachine';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
function makeShare(overrides: Partial<ScreenSharePiPScreenShare> = {}): ScreenSharePiPScreenShare {
|
||||
return {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {RemoteTrackPublication} from 'livekit-client';
|
||||
import {runInAction} from 'mobx';
|
||||
import {
|
||||
selectVoiceMediaGraphAttempt,
|
||||
selectVoiceMediaGraphFailure,
|
||||
@@ -10,9 +8,11 @@ import {
|
||||
VOICE_MEDIA_GRAPH_SCREEN_SHARE_SOURCE,
|
||||
type VoiceMediaGraphEvent,
|
||||
type VoiceMediaGraphSnapshot,
|
||||
} from '../engine/VoiceMediaGraph';
|
||||
import {voiceMediaGraphStore} from '../engine/VoiceMediaGraphStore';
|
||||
import type {ScreenSharePublicationOperation} from '../utils/ScreenShareSubscriptionPolicy';
|
||||
} from '@app/features/voice/engine/VoiceMediaGraph';
|
||||
import {voiceMediaGraphStore} from '@app/features/voice/engine/VoiceMediaGraphStore';
|
||||
import type {ScreenSharePublicationOperation} from '@app/features/voice/utils/ScreenShareSubscriptionPolicy';
|
||||
import type {RemoteTrackPublication} from 'livekit-client';
|
||||
import {runInAction} from 'mobx';
|
||||
|
||||
export type {ScreenSharePublicationOperation};
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ async function loadVoiceSettings() {
|
||||
const debug = vi.spyOn(Logger.prototype, 'debug').mockImplementation(() => undefined);
|
||||
try {
|
||||
const [{default: VoiceSettings}, {default: MediaPermission}] = await Promise.all([
|
||||
import('./VoiceSettings'),
|
||||
import('@app/features/voice/state/VoiceSettings'),
|
||||
import('@app/features/permissions/system/state/MediaPermission'),
|
||||
]);
|
||||
await Promise.all([
|
||||
@@ -74,7 +74,7 @@ async function loadVoiceSettings() {
|
||||
}
|
||||
|
||||
const VoiceSettings = await loadVoiceSettings();
|
||||
const {applyManualAudioSourcesOptOutResetMigrationV1} = await import('./VoiceSettings');
|
||||
const {applyManualAudioSourcesOptOutResetMigrationV1} = await import('@app/features/voice/state/VoiceSettings');
|
||||
|
||||
describe('AV1/HEVC screen-share opt-in', () => {
|
||||
it('rewrites a stored AV1 screen-share preference back to automatic on first launch', () => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {resolveVoiceChannelBitrate} from '@fluxer/constants/src/GuildConstants';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
buildMicrophonePublishOptions,
|
||||
normaliseAudioBitrateBps,
|
||||
OPUS_MAX_AUDIO_BITRATE_BPS,
|
||||
SCREEN_SHARE_AUDIO_PUBLISH_OPTIONS,
|
||||
} from './AudioPublishOptions';
|
||||
} from '@app/features/voice/utils/AudioPublishOptions';
|
||||
import {resolveVoiceChannelBitrate} from '@fluxer/constants/src/GuildConstants';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
describe('normaliseAudioBitrateBps', () => {
|
||||
it('keeps stored channel bitrates in bits per second', () => {
|
||||
|
||||
@@ -72,7 +72,7 @@ const {
|
||||
resolveScreenShareEncoderVerificationAction,
|
||||
resolveVideoPublishCodecPolicy,
|
||||
selectAutomaticScreenShareCodec,
|
||||
} = await import('./CodecCapabilityDetector');
|
||||
} = await import('@app/features/voice/utils/CodecCapabilityDetector');
|
||||
|
||||
const ALL_SOFTWARE: HardwareEncodeReport = {
|
||||
av1: 'software',
|
||||
|
||||
@@ -63,7 +63,7 @@ const {
|
||||
PCI_VENDOR_NVIDIA,
|
||||
probeWebRtcEncodeEfficiency,
|
||||
reconcileHardwareEncodeReport,
|
||||
} = await import('./GpuEncoderCapabilities');
|
||||
} = await import('@app/features/voice/utils/GpuEncoderCapabilities');
|
||||
|
||||
const AMD_RDNA3_REPORT: HardwareEncodeReport = {...AMD_RDNA3_PLUS.caps, gpuFamily: AMD_RDNA3_PLUS.family};
|
||||
const NVIDIA_REPORT: HardwareEncodeReport = {...NVIDIA_PRE_ADA.caps, gpuFamily: NVIDIA_PRE_ADA.family};
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {VirtmicNode} from '@app/types/electron.d';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
filterRoutableLinuxAudioSources,
|
||||
getLinuxAudioSourceDisplayName,
|
||||
@@ -13,7 +11,9 @@ import {
|
||||
toNativeLinuxAudioPattern,
|
||||
toNativeLinuxAudioPatterns,
|
||||
uniqueLinuxAudioSourceItems,
|
||||
} from './LinuxAudioSourceRules';
|
||||
} from '@app/features/voice/utils/LinuxAudioSourceRules';
|
||||
import type {VirtmicNode} from '@app/types/electron.d';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
function node(overrides: VirtmicNode): VirtmicNode {
|
||||
return overrides;
|
||||
|
||||
@@ -16,7 +16,7 @@ const {
|
||||
NO_AUDIO_DESCRIPTOR,
|
||||
resolveScreenShareAudioSummary,
|
||||
SHARED_WINDOW_DESCRIPTOR,
|
||||
} = await import('./ScreenShareAudioSummary');
|
||||
} = await import('@app/features/voice/utils/ScreenShareAudioSummary');
|
||||
type ScreenShareAudioSummaryInput = Parameters<typeof resolveScreenShareAudioSummary>[0];
|
||||
|
||||
function summary(overrides: Partial<ScreenShareAudioSummaryInput> = {}) {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
confirmDecodeStall,
|
||||
findSoftwareVideoDecoder,
|
||||
findStalledVideoDecoder,
|
||||
isSoftwareVideoImplementation,
|
||||
type StalledVideoDecoderInfo,
|
||||
} from './ScreenShareCodecDiagnostics';
|
||||
} from '@app/features/voice/utils/ScreenShareCodecDiagnostics';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
function createStatsReport(entries: Array<Record<string, unknown>>): RTCStatsReport {
|
||||
return new Map(entries.map((entry) => [entry.id as string, entry])) as unknown as RTCStatsReport;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants';
|
||||
import type {HardwareEncodeReport} from '@app/features/voice/utils/GpuEncoderCapabilities';
|
||||
import type {I18n} from '@lingui/core';
|
||||
import {msg} from '@lingui/core/macro';
|
||||
import type {VideoCodec} from 'livekit-client';
|
||||
import type {HardwareEncodeReport} from './GpuEncoderCapabilities';
|
||||
|
||||
const BEST_COMPRESSION_USE_IT_ONLY_WHEN_WEBRTC_EXPOSES_DESCRIPTOR = msg({
|
||||
message:
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
buildScreenShareOptions,
|
||||
capScreenShareEncodingToDimensions,
|
||||
@@ -11,7 +10,8 @@ import {
|
||||
STREAMING_MODE_PRESETS,
|
||||
SUPPORTED_SCREEN_SHARE_FRAME_RATES,
|
||||
type SupportedScreenShareFrameRate,
|
||||
} from './ScreenShareOptions';
|
||||
} from '@app/features/voice/utils/ScreenShareOptions';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
const RESOLUTIONS = ['low_240p', 'low_480p', 'medium', 'high', 'ultra', 'source'] as const;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {NativeAudioAvailability} from '@app/types/electron.d';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
canSelectManualAudioSources,
|
||||
isLinuxDesktopAudioShare,
|
||||
@@ -11,7 +9,9 @@ import {
|
||||
selectAppShareAudioRoute,
|
||||
shouldReconfigureAudioForActiveStreamSettings,
|
||||
supportsWindowShareAudioScope,
|
||||
} from './StreamSettingsUpdatePolicy';
|
||||
} from '@app/features/voice/utils/StreamSettingsUpdatePolicy';
|
||||
import type {NativeAudioAvailability} from '@app/types/electron.d';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
const LINUX_PIPEWIRE: NativeAudioAvailability = {
|
||||
available: true,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
classifyVideoDecoderAcceleration,
|
||||
classifyVideoEncoderAcceleration,
|
||||
isHardwareVideoImplementation,
|
||||
isSoftwareVideoImplementation,
|
||||
} from './VideoAccelerationClassification';
|
||||
} from '@app/features/voice/utils/VideoAccelerationClassification';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
describe('video acceleration implementation classification', () => {
|
||||
it('detects common software implementations', () => {
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {
|
||||
getLatencySignalBaseline,
|
||||
getLatencySignalState,
|
||||
type LatencySignalSample,
|
||||
} from '@app/features/voice/utils/VoiceLatencySignal';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {getLatencySignalBaseline, getLatencySignalState, type LatencySignalSample} from './VoiceLatencySignal';
|
||||
|
||||
function samples(...latencies: Array<number>): Array<LatencySignalSample> {
|
||||
return latencies.map((latency) => ({latency}));
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
readBoundedResponseBlob,
|
||||
runWithResponseDeadline,
|
||||
} from '@app/features/voice/utils/camera-effects/BoundedResponse';
|
||||
import type {WebCameraEffectCustomFrameSource} from '@app/features/voice/utils/camera-effects/WebCameraEffectCustomFrameSource';
|
||||
import {createWebCameraEffectImageFrameSource} from '@app/features/voice/utils/camera-effects/WebCameraEffectCustomFrameSource';
|
||||
|
||||
export type {
|
||||
@@ -18,8 +19,6 @@ export {
|
||||
WebCameraEffectCustomFrameSourceKind,
|
||||
} from '@app/features/voice/utils/camera-effects/WebCameraEffectCustomFrameSource';
|
||||
|
||||
import type {WebCameraEffectCustomFrameSource} from '@app/features/voice/utils/camera-effects/WebCameraEffectCustomFrameSource';
|
||||
|
||||
const MAX_CUSTOM_MEDIA_BYTES = 10 * 1024 * 1024;
|
||||
const MAX_CUSTOM_MEDIA_URL_LENGTH = 16 * 1024;
|
||||
const MAX_CUSTOM_MEDIA_RESPONSE_CHUNKS = 4096;
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
readBoundedResponseArrayBuffer,
|
||||
runWithResponseDeadline,
|
||||
} from '@app/features/voice/utils/camera-effects/BoundedResponse';
|
||||
import modelAssetUrl from '@app/features/voice/utils/camera-effects/models/selfie_segmentation_256x256.onnx';
|
||||
import {
|
||||
shapeWebCameraEffectMaskAlpha,
|
||||
WEB_CAMERA_EFFECT_MASK_CORE_GROW_MIN,
|
||||
@@ -23,7 +24,6 @@ import {
|
||||
} from '@app/features/voice/utils/camera-effects/WebCameraEffectMask';
|
||||
import ortWasmUrl from 'onnxruntime-web/ort-wasm-simd-threaded.asyncify.wasm';
|
||||
import type * as OrtNamespace from 'onnxruntime-web/webgpu';
|
||||
import modelAssetUrl from './models/selfie_segmentation_256x256.onnx';
|
||||
|
||||
export class MissingSegmentationAlphasOutputError extends Error {
|
||||
constructor() {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it, vi} from 'vitest';
|
||||
import {
|
||||
endBridgeStats,
|
||||
getBridgeStats,
|
||||
getEndedBridgeCaptures,
|
||||
recordBridgeFrame,
|
||||
startBridgeStats,
|
||||
} from './bridgeStats';
|
||||
} from '@app/features/voice/utils/native_audio_capture_bridge/bridgeStats';
|
||||
import {describe, expect, it, vi} from 'vitest';
|
||||
|
||||
function recordFrames(captureId: string, count: number, peak: number, rms: number): void {
|
||||
for (let index = 0; index < count; index++) {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {describe, expect, it} from 'vitest';
|
||||
import {
|
||||
GENERATOR_AUDIO_CHUNK_DURATION_US,
|
||||
mixToStereoInterleaved,
|
||||
NativeAudioFrameChunker,
|
||||
resampleInterleavedStereo,
|
||||
shouldMixSelfWindowAudioIntoSystemCapture,
|
||||
} from './shared';
|
||||
} from '@app/features/voice/utils/native_audio_capture_bridge/shared';
|
||||
import {describe, expect, it} from 'vitest';
|
||||
|
||||
function expectSamples(actual: Float32Array, expected: ReadonlyArray<number>): void {
|
||||
expect(Array.from(actual)).toEqual(expected);
|
||||
|
||||
Reference in new issue
Block a user