yukimu 2.0.0 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/dist/BitrateOptimizer.d.ts +0 -52
- package/dist/BitrateOptimizer.d.ts.map +0 -1
- package/dist/BitrateOptimizer.js +0 -115
- package/dist/BitrateOptimizer.js.map +0 -1
- package/dist/ConnectionPool.d.ts +0 -84
- package/dist/ConnectionPool.d.ts.map +0 -1
- package/dist/ConnectionPool.js +0 -203
- package/dist/ConnectionPool.js.map +0 -1
- package/dist/Constants.d.ts +0 -45
- package/dist/Constants.d.ts.map +0 -1
- package/dist/Constants.js +0 -168
- package/dist/Constants.js.map +0 -1
- package/dist/Logger.d.ts +0 -22
- package/dist/Logger.d.ts.map +0 -1
- package/dist/Logger.js +0 -74
- package/dist/Logger.js.map +0 -1
- package/dist/Node.d.ts +0 -61
- package/dist/Node.d.ts.map +0 -1
- package/dist/Node.js +0 -446
- package/dist/Node.js.map +0 -1
- package/dist/Player.d.ts +0 -135
- package/dist/Player.d.ts.map +0 -1
- package/dist/Player.js +0 -530
- package/dist/Player.js.map +0 -1
- package/dist/Plugin.d.ts +0 -25
- package/dist/Plugin.d.ts.map +0 -1
- package/dist/Plugin.js +0 -15
- package/dist/Plugin.js.map +0 -1
- package/dist/Queue.d.ts +0 -89
- package/dist/Queue.d.ts.map +0 -1
- package/dist/Queue.js +0 -188
- package/dist/Queue.js.map +0 -1
- package/dist/Resolver.d.ts +0 -44
- package/dist/Resolver.d.ts.map +0 -1
- package/dist/Resolver.js +0 -289
- package/dist/Resolver.js.map +0 -1
- package/dist/Rest.d.ts +0 -46
- package/dist/Rest.d.ts.map +0 -1
- package/dist/Rest.js +0 -246
- package/dist/Rest.js.map +0 -1
- package/dist/TrackCache.d.ts +0 -41
- package/dist/TrackCache.d.ts.map +0 -1
- package/dist/TrackCache.js +0 -144
- package/dist/TrackCache.js.map +0 -1
- package/dist/WsQueue.d.ts +0 -41
- package/dist/WsQueue.d.ts.map +0 -1
- package/dist/WsQueue.js +0 -116
- package/dist/WsQueue.js.map +0 -1
- package/dist/Yukimu.d.ts +0 -84
- package/dist/Yukimu.d.ts.map +0 -1
- package/dist/Yukimu.js +0 -290
- package/dist/Yukimu.js.map +0 -1
- package/dist/connector/Connector.d.ts +0 -34
- package/dist/connector/Connector.d.ts.map +0 -1
- package/dist/connector/Connector.js +0 -39
- package/dist/connector/Connector.js.map +0 -1
- package/dist/connector/DiscordJS.d.ts +0 -27
- package/dist/connector/DiscordJS.d.ts.map +0 -1
- package/dist/connector/DiscordJS.js +0 -69
- package/dist/connector/DiscordJS.js.map +0 -1
- package/dist/connector/Eris.d.ts +0 -19
- package/dist/connector/Eris.d.ts.map +0 -1
- package/dist/connector/Eris.js +0 -62
- package/dist/connector/Eris.js.map +0 -1
- package/dist/connector/Oceanic.d.ts +0 -19
- package/dist/connector/Oceanic.d.ts.map +0 -1
- package/dist/connector/Oceanic.js +0 -60
- package/dist/connector/Oceanic.js.map +0 -1
- package/dist/errors/YukimuError.d.ts +0 -51
- package/dist/errors/YukimuError.d.ts.map +0 -1
- package/dist/errors/YukimuError.js +0 -105
- package/dist/errors/YukimuError.js.map +0 -1
- package/dist/index.d.ts +0 -29
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -70
- package/dist/index.js.map +0 -1
- package/dist/plugins/AutoResume.d.ts +0 -25
- package/dist/plugins/AutoResume.d.ts.map +0 -1
- package/dist/plugins/AutoResume.js +0 -132
- package/dist/plugins/AutoResume.js.map +0 -1
- package/dist/plugins/AutoplayPlugin.d.ts +0 -35
- package/dist/plugins/AutoplayPlugin.d.ts.map +0 -1
- package/dist/plugins/AutoplayPlugin.js +0 -111
- package/dist/plugins/AutoplayPlugin.js.map +0 -1
- package/dist/plugins/InactivityPlugin.d.ts +0 -30
- package/dist/plugins/InactivityPlugin.d.ts.map +0 -1
- package/dist/plugins/InactivityPlugin.js +0 -86
- package/dist/plugins/InactivityPlugin.js.map +0 -1
- package/dist/plugins/PlayerMoved.d.ts +0 -29
- package/dist/plugins/PlayerMoved.d.ts.map +0 -1
- package/dist/plugins/PlayerMoved.js +0 -75
- package/dist/plugins/PlayerMoved.js.map +0 -1
- package/dist/types.d.ts +0 -309
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -4
- package/dist/types.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yukimu",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "A production-grade Lavalink v3/v4 wrapper for Discord bots — supports YouTube, Spotify, Deezer, Apple Music, SoundCloud, Tidal, Bandcamp, Twitch, Vimeo, TikTok, and 15+ more sources with adaptive bitrate, auto-reconnect, and typed events",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/** Yukimu v2.0.0 — Bitrate Optimizer for Discord Boost Tiers */
|
|
2
|
-
import type { BoostTier, BitrateConfig, FilterOptions, EqualizerBand } from "./types";
|
|
3
|
-
/**
|
|
4
|
-
* Provides optimal audio quality settings based on the Discord server's boost tier.
|
|
5
|
-
*
|
|
6
|
-
* Discord bitrate caps by tier:
|
|
7
|
-
* - Tier 0 (no boost): 96 kbps max
|
|
8
|
-
* - Tier 1: 128 kbps max
|
|
9
|
-
* - Tier 2: 256 kbps max
|
|
10
|
-
* - Tier 3: 384 kbps max
|
|
11
|
-
*
|
|
12
|
-
* Note: The actual voice channel bitrate is set via Discord's API (by the bot or server admin).
|
|
13
|
-
* Yukimu optimizes the Lavalink-side audio processing (filters, EQ) to complement the
|
|
14
|
-
* available bitrate — preventing quality degradation, clipping, and distortion.
|
|
15
|
-
*/
|
|
16
|
-
export declare class BitrateOptimizer {
|
|
17
|
-
/**
|
|
18
|
-
* Get the bitrate configuration for a given boost tier.
|
|
19
|
-
*/
|
|
20
|
-
static getConfig(tier: BoostTier): BitrateConfig;
|
|
21
|
-
/**
|
|
22
|
-
* Get the maximum bitrate (in kbps) for a given boost tier.
|
|
23
|
-
*/
|
|
24
|
-
static getMaxBitrate(tier: BoostTier): number;
|
|
25
|
-
/**
|
|
26
|
-
* Get recommended filter settings optimized for the given boost tier.
|
|
27
|
-
*
|
|
28
|
-
* - Tier 0–1: Minimal processing to avoid quality loss on low bitrate
|
|
29
|
-
* - Tier 2–3: Enhanced EQ for richer sound, taking advantage of higher bitrate
|
|
30
|
-
*/
|
|
31
|
-
static getOptimalFilters(tier: BoostTier): FilterOptions;
|
|
32
|
-
/**
|
|
33
|
-
* Get optimal volume for a given boost tier.
|
|
34
|
-
* Lower tiers should stay at 100 to avoid clipping on lower bitrate.
|
|
35
|
-
*/
|
|
36
|
-
static getOptimalVolume(tier: BoostTier): number;
|
|
37
|
-
/**
|
|
38
|
-
* Flat EQ — no modification, prevents quality loss on low bitrate.
|
|
39
|
-
*/
|
|
40
|
-
static getFlatEQ(): EqualizerBand[];
|
|
41
|
-
/**
|
|
42
|
-
* Clarity EQ — subtle boost to presence and air frequencies
|
|
43
|
-
* for enhanced vocal clarity and sparkle on high-bitrate connections.
|
|
44
|
-
*/
|
|
45
|
-
static getClarityEQ(): EqualizerBand[];
|
|
46
|
-
/**
|
|
47
|
-
* Bass-heavy EQ — tuned for each tier to prevent distortion.
|
|
48
|
-
* Lower tiers get less bass boost to prevent clipping.
|
|
49
|
-
*/
|
|
50
|
-
static getBassEQ(tier: BoostTier): EqualizerBand[];
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=BitrateOptimizer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BitrateOptimizer.d.ts","sourceRoot":"","sources":["../src/BitrateOptimizer.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAGhE,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEtF;;;;;;;;;;;;GAYG;AACH,qBAAa,gBAAgB;IAC3B;;OAEG;WACW,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,aAAa;IAIvD;;OAEG;WACW,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM;IAIpD;;;;;OAKG;WACW,iBAAiB,CAAC,IAAI,EAAE,SAAS,GAAG,aAAa;IAiB/D;;;OAGG;WACW,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM;IAIvD;;OAEG;WACW,SAAS,IAAI,aAAa,EAAE;IAI1C;;;OAGG;WACW,YAAY,IAAI,aAAa,EAAE;IAoB7C;;;OAGG;WACW,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,aAAa,EAAE;CAsB1D"}
|
package/dist/BitrateOptimizer.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** Yukimu v2.0.0 — Bitrate Optimizer for Discord Boost Tiers */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.BitrateOptimizer = void 0;
|
|
5
|
-
const Constants_1 = require("./Constants");
|
|
6
|
-
/**
|
|
7
|
-
* Provides optimal audio quality settings based on the Discord server's boost tier.
|
|
8
|
-
*
|
|
9
|
-
* Discord bitrate caps by tier:
|
|
10
|
-
* - Tier 0 (no boost): 96 kbps max
|
|
11
|
-
* - Tier 1: 128 kbps max
|
|
12
|
-
* - Tier 2: 256 kbps max
|
|
13
|
-
* - Tier 3: 384 kbps max
|
|
14
|
-
*
|
|
15
|
-
* Note: The actual voice channel bitrate is set via Discord's API (by the bot or server admin).
|
|
16
|
-
* Yukimu optimizes the Lavalink-side audio processing (filters, EQ) to complement the
|
|
17
|
-
* available bitrate — preventing quality degradation, clipping, and distortion.
|
|
18
|
-
*/
|
|
19
|
-
class BitrateOptimizer {
|
|
20
|
-
/**
|
|
21
|
-
* Get the bitrate configuration for a given boost tier.
|
|
22
|
-
*/
|
|
23
|
-
static getConfig(tier) {
|
|
24
|
-
return Constants_1.BITRATE_BY_BOOST_TIER[tier];
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Get the maximum bitrate (in kbps) for a given boost tier.
|
|
28
|
-
*/
|
|
29
|
-
static getMaxBitrate(tier) {
|
|
30
|
-
return Constants_1.BITRATE_BY_BOOST_TIER[tier].maxBitrate;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Get recommended filter settings optimized for the given boost tier.
|
|
34
|
-
*
|
|
35
|
-
* - Tier 0–1: Minimal processing to avoid quality loss on low bitrate
|
|
36
|
-
* - Tier 2–3: Enhanced EQ for richer sound, taking advantage of higher bitrate
|
|
37
|
-
*/
|
|
38
|
-
static getOptimalFilters(tier) {
|
|
39
|
-
const config = Constants_1.BITRATE_BY_BOOST_TIER[tier];
|
|
40
|
-
if (!config.enhancedEQ) {
|
|
41
|
-
// Low bitrate tiers: flat EQ, no processing overhead
|
|
42
|
-
return {
|
|
43
|
-
equalizer: BitrateOptimizer.getFlatEQ(),
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
// High bitrate tiers: subtle enhancement for clarity
|
|
47
|
-
return {
|
|
48
|
-
equalizer: BitrateOptimizer.getClarityEQ(),
|
|
49
|
-
lowPass: { smoothing: 3.0 }, // Very gentle low-pass for smoothness
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Get optimal volume for a given boost tier.
|
|
54
|
-
* Lower tiers should stay at 100 to avoid clipping on lower bitrate.
|
|
55
|
-
*/
|
|
56
|
-
static getOptimalVolume(tier) {
|
|
57
|
-
return Constants_1.BITRATE_BY_BOOST_TIER[tier].recommendedVolume;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Flat EQ — no modification, prevents quality loss on low bitrate.
|
|
61
|
-
*/
|
|
62
|
-
static getFlatEQ() {
|
|
63
|
-
return Array.from({ length: 15 }, (_, i) => ({ band: i, gain: 0 }));
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Clarity EQ — subtle boost to presence and air frequencies
|
|
67
|
-
* for enhanced vocal clarity and sparkle on high-bitrate connections.
|
|
68
|
-
*/
|
|
69
|
-
static getClarityEQ() {
|
|
70
|
-
return [
|
|
71
|
-
{ band: 0, gain: 0.10 }, // Sub bass: gentle warmth
|
|
72
|
-
{ band: 1, gain: 0.08 }, // Bass: subtle body
|
|
73
|
-
{ band: 2, gain: 0.05 }, // Low mid
|
|
74
|
-
{ band: 3, gain: 0.02 }, // Mid bass
|
|
75
|
-
{ band: 4, gain: 0.0 }, // Low mid: flat
|
|
76
|
-
{ band: 5, gain: 0.0 }, // Mid: flat
|
|
77
|
-
{ band: 6, gain: 0.0 }, // Upper mid: flat
|
|
78
|
-
{ band: 7, gain: 0.03 }, // Presence: slight lift
|
|
79
|
-
{ band: 8, gain: 0.06 }, // Upper presence: clarity
|
|
80
|
-
{ band: 9, gain: 0.08 }, // Treble: sparkle
|
|
81
|
-
{ band: 10, gain: 0.06 }, // Upper treble: air
|
|
82
|
-
{ band: 11, gain: 0.04 }, // Air
|
|
83
|
-
{ band: 12, gain: 0.02 }, // Brilliance
|
|
84
|
-
{ band: 13, gain: 0.0 }, // Ultra high
|
|
85
|
-
{ band: 14, gain: 0.0 }, // Ultra high
|
|
86
|
-
];
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Bass-heavy EQ — tuned for each tier to prevent distortion.
|
|
90
|
-
* Lower tiers get less bass boost to prevent clipping.
|
|
91
|
-
*/
|
|
92
|
-
static getBassEQ(tier) {
|
|
93
|
-
// Scale bass boost based on available bitrate headroom
|
|
94
|
-
const scale = tier >= 2 ? 1.0 : tier === 1 ? 0.7 : 0.4;
|
|
95
|
-
return [
|
|
96
|
-
{ band: 0, gain: 0.6 * scale },
|
|
97
|
-
{ band: 1, gain: 0.5 * scale },
|
|
98
|
-
{ band: 2, gain: 0.4 * scale },
|
|
99
|
-
{ band: 3, gain: 0.25 * scale },
|
|
100
|
-
{ band: 4, gain: 0.1 * scale },
|
|
101
|
-
{ band: 5, gain: -0.05 * scale },
|
|
102
|
-
{ band: 6, gain: 0.0 },
|
|
103
|
-
{ band: 7, gain: 0.0 },
|
|
104
|
-
{ band: 8, gain: 0.0 },
|
|
105
|
-
{ band: 9, gain: 0.0 },
|
|
106
|
-
{ band: 10, gain: 0.0 },
|
|
107
|
-
{ band: 11, gain: 0.0 },
|
|
108
|
-
{ band: 12, gain: 0.0 },
|
|
109
|
-
{ band: 13, gain: 0.0 },
|
|
110
|
-
{ band: 14, gain: 0.0 },
|
|
111
|
-
];
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
exports.BitrateOptimizer = BitrateOptimizer;
|
|
115
|
-
//# sourceMappingURL=BitrateOptimizer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BitrateOptimizer.js","sourceRoot":"","sources":["../src/BitrateOptimizer.ts"],"names":[],"mappings":";AAAA,gEAAgE;;;AAEhE,2CAAoD;AAGpD;;;;;;;;;;;;GAYG;AACH,MAAa,gBAAgB;IAC3B;;OAEG;IACI,MAAM,CAAC,SAAS,CAAC,IAAe;QACrC,OAAO,iCAAqB,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,aAAa,CAAC,IAAe;QACzC,OAAO,iCAAqB,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC;IAChD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,iBAAiB,CAAC,IAAe;QAC7C,MAAM,MAAM,GAAG,iCAAqB,CAAC,IAAI,CAAC,CAAC;QAE3C,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;YACvB,qDAAqD;YACrD,OAAO;gBACL,SAAS,EAAE,gBAAgB,CAAC,SAAS,EAAE;aACxC,CAAC;QACJ,CAAC;QAED,qDAAqD;QACrD,OAAO;YACL,SAAS,EAAE,gBAAgB,CAAC,YAAY,EAAE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AAI,EAAE,GAAG,EAAE;YACtB,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE;YACtB,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;YACvB,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;YACvB,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;YACvB,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;YACvB,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;SACxB,CAAC;IACJ,CAAC;CACF;AAvGD,4CAuGC"}
|
package/dist/ConnectionPool.d.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/** Yukimu v2.0.0 — Voice Connection Pool with State Machine */
|
|
2
|
-
import type { Yukimu } from "./Yukimu";
|
|
3
|
-
export declare enum VoiceConnectionState {
|
|
4
|
-
IDLE = 0,
|
|
5
|
-
CONNECTING = 1,
|
|
6
|
-
READY = 2,
|
|
7
|
-
DISCONNECTING = 3
|
|
8
|
-
}
|
|
9
|
-
export interface VoiceConnection {
|
|
10
|
-
guildId: string;
|
|
11
|
-
channelId: string;
|
|
12
|
-
sessionId: string | null;
|
|
13
|
-
token: string | null;
|
|
14
|
-
endpoint: string | null;
|
|
15
|
-
state: VoiceConnectionState;
|
|
16
|
-
timeout: ReturnType<typeof setTimeout> | null;
|
|
17
|
-
retryTimeout: ReturnType<typeof setTimeout> | null;
|
|
18
|
-
retries: number;
|
|
19
|
-
createdAt: number;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Manages voice connection state for all guilds.
|
|
23
|
-
*
|
|
24
|
-
* Fixes from v1:
|
|
25
|
-
* - Uses player's actual selfDeaf/selfMute in retries (was hardcoded)
|
|
26
|
-
* - Proper state machine (IDLE → CONNECTING → READY → DISCONNECTING)
|
|
27
|
-
* - Connection age tracking
|
|
28
|
-
* - Full cleanup on destroy()
|
|
29
|
-
* - Null safety on all methods
|
|
30
|
-
*/
|
|
31
|
-
export declare class ConnectionPool {
|
|
32
|
-
private readonly manager;
|
|
33
|
-
private readonly connections;
|
|
34
|
-
constructor(manager: Yukimu);
|
|
35
|
-
/**
|
|
36
|
-
* Register a new voice connection or update an existing one.
|
|
37
|
-
*/
|
|
38
|
-
add(guildId: string, channelId: string): VoiceConnection;
|
|
39
|
-
get(guildId: string): VoiceConnection | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Remove a voice connection and clean up its timers.
|
|
42
|
-
*/
|
|
43
|
-
remove(guildId: string): void;
|
|
44
|
-
has(guildId: string): boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Update session ID from VOICE_STATE_UPDATE.
|
|
47
|
-
* Null-safe: only updates if sessionId is provided.
|
|
48
|
-
*/
|
|
49
|
-
updateSession(guildId: string, sessionId: string | undefined, channelId?: string): void;
|
|
50
|
-
/**
|
|
51
|
-
* Update voice server info from VOICE_SERVER_UPDATE.
|
|
52
|
-
*/
|
|
53
|
-
updateServer(guildId: string, token: string, endpoint: string): void;
|
|
54
|
-
/**
|
|
55
|
-
* Mark a connection as successfully established.
|
|
56
|
-
*/
|
|
57
|
-
markConnected(guildId: string): void;
|
|
58
|
-
/**
|
|
59
|
-
* Check if we have all the data needed to send a voice update to Lavalink.
|
|
60
|
-
*/
|
|
61
|
-
isReady(guildId: string): boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Get the voice state payload for Lavalink.
|
|
64
|
-
*/
|
|
65
|
-
getVoiceState(guildId: string): {
|
|
66
|
-
token: string;
|
|
67
|
-
endpoint: string;
|
|
68
|
-
sessionId: string;
|
|
69
|
-
channelId: string;
|
|
70
|
-
} | null;
|
|
71
|
-
/**
|
|
72
|
-
* Get all active connections (for debugging/monitoring).
|
|
73
|
-
*/
|
|
74
|
-
getAll(): ReadonlyMap<string, VoiceConnection>;
|
|
75
|
-
/**
|
|
76
|
-
* Clean up all connections and timers.
|
|
77
|
-
*/
|
|
78
|
-
destroy(): void;
|
|
79
|
-
private clearTimers;
|
|
80
|
-
private startTimeout;
|
|
81
|
-
private handleConnectionFailure;
|
|
82
|
-
get size(): number;
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=ConnectionPool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionPool.d.ts","sourceRoot":"","sources":["../src/ConnectionPool.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAE/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAOvC,oBAAY,oBAAoB;IAC9B,IAAI,IAAI;IACR,UAAU,IAAI;IACd,KAAK,IAAI;IACT,aAAa,IAAI;CAClB;AAID,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,oBAAoB,CAAC;IAC5B,OAAO,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;IAC9C,YAAY,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAKD;;;;;;;;;GASG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA2C;gBAE3D,OAAO,EAAE,MAAM;IAI3B;;OAEG;IACI,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,eAAe;IA0BxD,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAIxD;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAO7B,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAIpC;;;OAGG;IACI,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAO9F;;OAEG;IACI,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAO3E;;OAEG;IACI,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAQ3C;;OAEG;IACI,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAMxC;;OAEG;IACI,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG;QACrC,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,IAAI;IAWR;;OAEG;IACI,MAAM,IAAI,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC;IAIrD;;OAEG;IACI,OAAO,IAAI,IAAI;IAStB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,uBAAuB;IA2C/B,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
|
package/dist/ConnectionPool.js
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** Yukimu v2.0.0 — Voice Connection Pool with State Machine */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.ConnectionPool = exports.VoiceConnectionState = void 0;
|
|
5
|
-
const Constants_1 = require("./Constants");
|
|
6
|
-
const YukimuError_1 = require("./errors/YukimuError");
|
|
7
|
-
// ─── Connection State ───────────────────────────────────────────────────────
|
|
8
|
-
var VoiceConnectionState;
|
|
9
|
-
(function (VoiceConnectionState) {
|
|
10
|
-
VoiceConnectionState[VoiceConnectionState["IDLE"] = 0] = "IDLE";
|
|
11
|
-
VoiceConnectionState[VoiceConnectionState["CONNECTING"] = 1] = "CONNECTING";
|
|
12
|
-
VoiceConnectionState[VoiceConnectionState["READY"] = 2] = "READY";
|
|
13
|
-
VoiceConnectionState[VoiceConnectionState["DISCONNECTING"] = 3] = "DISCONNECTING";
|
|
14
|
-
})(VoiceConnectionState || (exports.VoiceConnectionState = VoiceConnectionState = {}));
|
|
15
|
-
const MAX_VOICE_RETRIES = 3;
|
|
16
|
-
const VOICE_RETRY_DELAY = 5000;
|
|
17
|
-
/**
|
|
18
|
-
* Manages voice connection state for all guilds.
|
|
19
|
-
*
|
|
20
|
-
* Fixes from v1:
|
|
21
|
-
* - Uses player's actual selfDeaf/selfMute in retries (was hardcoded)
|
|
22
|
-
* - Proper state machine (IDLE → CONNECTING → READY → DISCONNECTING)
|
|
23
|
-
* - Connection age tracking
|
|
24
|
-
* - Full cleanup on destroy()
|
|
25
|
-
* - Null safety on all methods
|
|
26
|
-
*/
|
|
27
|
-
class ConnectionPool {
|
|
28
|
-
manager;
|
|
29
|
-
connections = new Map();
|
|
30
|
-
constructor(manager) {
|
|
31
|
-
this.manager = manager;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Register a new voice connection or update an existing one.
|
|
35
|
-
*/
|
|
36
|
-
add(guildId, channelId) {
|
|
37
|
-
const existing = this.connections.get(guildId);
|
|
38
|
-
if (existing) {
|
|
39
|
-
existing.channelId = channelId;
|
|
40
|
-
existing.state = VoiceConnectionState.CONNECTING;
|
|
41
|
-
return existing;
|
|
42
|
-
}
|
|
43
|
-
const conn = {
|
|
44
|
-
guildId,
|
|
45
|
-
channelId,
|
|
46
|
-
sessionId: null,
|
|
47
|
-
token: null,
|
|
48
|
-
endpoint: null,
|
|
49
|
-
state: VoiceConnectionState.CONNECTING,
|
|
50
|
-
timeout: null,
|
|
51
|
-
retryTimeout: null,
|
|
52
|
-
retries: 0,
|
|
53
|
-
createdAt: Date.now(),
|
|
54
|
-
};
|
|
55
|
-
this.connections.set(guildId, conn);
|
|
56
|
-
this.startTimeout(conn);
|
|
57
|
-
return conn;
|
|
58
|
-
}
|
|
59
|
-
get(guildId) {
|
|
60
|
-
return this.connections.get(guildId);
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Remove a voice connection and clean up its timers.
|
|
64
|
-
*/
|
|
65
|
-
remove(guildId) {
|
|
66
|
-
const conn = this.connections.get(guildId);
|
|
67
|
-
if (!conn)
|
|
68
|
-
return;
|
|
69
|
-
this.clearTimers(conn);
|
|
70
|
-
this.connections.delete(guildId);
|
|
71
|
-
}
|
|
72
|
-
has(guildId) {
|
|
73
|
-
return this.connections.has(guildId);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Update session ID from VOICE_STATE_UPDATE.
|
|
77
|
-
* Null-safe: only updates if sessionId is provided.
|
|
78
|
-
*/
|
|
79
|
-
updateSession(guildId, sessionId, channelId) {
|
|
80
|
-
const conn = this.connections.get(guildId);
|
|
81
|
-
if (!conn)
|
|
82
|
-
return;
|
|
83
|
-
if (sessionId)
|
|
84
|
-
conn.sessionId = sessionId;
|
|
85
|
-
if (channelId)
|
|
86
|
-
conn.channelId = channelId;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Update voice server info from VOICE_SERVER_UPDATE.
|
|
90
|
-
*/
|
|
91
|
-
updateServer(guildId, token, endpoint) {
|
|
92
|
-
const conn = this.connections.get(guildId);
|
|
93
|
-
if (!conn)
|
|
94
|
-
return;
|
|
95
|
-
conn.token = token;
|
|
96
|
-
conn.endpoint = endpoint;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Mark a connection as successfully established.
|
|
100
|
-
*/
|
|
101
|
-
markConnected(guildId) {
|
|
102
|
-
const conn = this.connections.get(guildId);
|
|
103
|
-
if (!conn)
|
|
104
|
-
return;
|
|
105
|
-
conn.state = VoiceConnectionState.READY;
|
|
106
|
-
conn.retries = 0;
|
|
107
|
-
this.clearTimers(conn);
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Check if we have all the data needed to send a voice update to Lavalink.
|
|
111
|
-
*/
|
|
112
|
-
isReady(guildId) {
|
|
113
|
-
const conn = this.connections.get(guildId);
|
|
114
|
-
if (!conn)
|
|
115
|
-
return false;
|
|
116
|
-
return !!(conn.sessionId && conn.token && conn.endpoint);
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Get the voice state payload for Lavalink.
|
|
120
|
-
*/
|
|
121
|
-
getVoiceState(guildId) {
|
|
122
|
-
const conn = this.connections.get(guildId);
|
|
123
|
-
if (!conn?.sessionId || !conn.token || !conn.endpoint)
|
|
124
|
-
return null;
|
|
125
|
-
return {
|
|
126
|
-
token: conn.token,
|
|
127
|
-
endpoint: conn.endpoint,
|
|
128
|
-
sessionId: conn.sessionId,
|
|
129
|
-
channelId: conn.channelId,
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Get all active connections (for debugging/monitoring).
|
|
134
|
-
*/
|
|
135
|
-
getAll() {
|
|
136
|
-
return this.connections;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Clean up all connections and timers.
|
|
140
|
-
*/
|
|
141
|
-
destroy() {
|
|
142
|
-
for (const conn of this.connections.values()) {
|
|
143
|
-
this.clearTimers(conn);
|
|
144
|
-
}
|
|
145
|
-
this.connections.clear();
|
|
146
|
-
}
|
|
147
|
-
// ─── Internal ───────────────────────────────────────────────────────────
|
|
148
|
-
clearTimers(conn) {
|
|
149
|
-
if (conn.timeout) {
|
|
150
|
-
clearTimeout(conn.timeout);
|
|
151
|
-
conn.timeout = null;
|
|
152
|
-
}
|
|
153
|
-
if (conn.retryTimeout) {
|
|
154
|
-
clearTimeout(conn.retryTimeout);
|
|
155
|
-
conn.retryTimeout = null;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
startTimeout(conn) {
|
|
159
|
-
const timeoutMs = this.manager.options.voiceConnectionTimeout ?? Constants_1.DEFAULTS.VOICE_CONNECTION_TIMEOUT;
|
|
160
|
-
this.clearTimers(conn);
|
|
161
|
-
conn.timeout = setTimeout(() => {
|
|
162
|
-
if (conn.state !== VoiceConnectionState.READY) {
|
|
163
|
-
this.handleConnectionFailure(conn);
|
|
164
|
-
}
|
|
165
|
-
}, timeoutMs);
|
|
166
|
-
}
|
|
167
|
-
handleConnectionFailure(conn) {
|
|
168
|
-
if (conn.retries >= MAX_VOICE_RETRIES) {
|
|
169
|
-
const player = this.manager.players.get(conn.guildId);
|
|
170
|
-
const error = new YukimuError_1.VoiceConnectionError(`Voice connection failed after ${MAX_VOICE_RETRIES} retries for guild ${conn.guildId}`, conn.guildId, YukimuError_1.ErrorCode.VOICE_CONNECTION_TIMEOUT);
|
|
171
|
-
this.manager.logger.error(error.message);
|
|
172
|
-
if (player) {
|
|
173
|
-
this.manager.emit("playerError", player, error);
|
|
174
|
-
this.manager.destroyPlayer(conn.guildId).catch(() => { });
|
|
175
|
-
}
|
|
176
|
-
this.remove(conn.guildId);
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
conn.retries++;
|
|
180
|
-
this.manager.logger.warn(`Voice retry ${conn.retries}/${MAX_VOICE_RETRIES} for guild ${conn.guildId}`);
|
|
181
|
-
// Use the player's actual selfDeaf/selfMute settings
|
|
182
|
-
const player = this.manager.players.get(conn.guildId);
|
|
183
|
-
const selfDeaf = player?.selfDeaf ?? true;
|
|
184
|
-
const selfMute = player?.selfMute ?? false;
|
|
185
|
-
conn.retryTimeout = setTimeout(() => {
|
|
186
|
-
this.manager.connector.sendPayload(conn.guildId, {
|
|
187
|
-
op: 4,
|
|
188
|
-
d: {
|
|
189
|
-
guild_id: conn.guildId,
|
|
190
|
-
channel_id: conn.channelId,
|
|
191
|
-
self_deaf: selfDeaf,
|
|
192
|
-
self_mute: selfMute,
|
|
193
|
-
},
|
|
194
|
-
});
|
|
195
|
-
this.startTimeout(conn);
|
|
196
|
-
}, VOICE_RETRY_DELAY * conn.retries);
|
|
197
|
-
}
|
|
198
|
-
get size() {
|
|
199
|
-
return this.connections.size;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
exports.ConnectionPool = ConnectionPool;
|
|
203
|
-
//# sourceMappingURL=ConnectionPool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionPool.js","sourceRoot":"","sources":["../src/ConnectionPool.ts"],"names":[],"mappings":";AAAA,+DAA+D;;;AAI/D,2CAAuC;AACvC,sDAAuE;AAEvE,+EAA+E;AAE/E,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,+DAAQ,CAAA;IACR,2EAAc,CAAA;IACd,iEAAS,CAAA;IACT,iFAAiB,CAAA;AACnB,CAAC,EALW,oBAAoB,oCAApB,oBAAoB,QAK/B;AAiBD,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAE/B;;;;;;;;;GASG;AACH,MAAa,cAAc;IACR,OAAO,CAAS;IAChB,WAAW,GAAiC,IAAI,GAAG,EAAE,CAAC;IAEvE,YAAY,OAAe;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;OAEG;IACI,GAAG,CAAC,OAAe,EAAE,SAAiB;QAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;YAC/B,QAAQ,CAAC,KAAK,GAAG,oBAAoB,CAAC,UAAU,CAAC;YACjD,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,MAAM,IAAI,GAAoB;YAC5B,OAAO;YACP,SAAS;YACT,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,IAAI;YACX,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B,SAAS,EAAE,QAAQ;iBACpB;aACF,CAAC,CAAC;YACH,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;CACF;AA1MD,wCA0MC"}
|
package/dist/Constants.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/** Yukimu v2.0.0 — Constants & Enumerations */
|
|
2
|
-
export declare const VERSION = "2.0.0";
|
|
3
|
-
export declare const CLIENT_NAME = "Yukimu/2.0.0";
|
|
4
|
-
export declare enum State {
|
|
5
|
-
CONNECTING = 0,
|
|
6
|
-
/** WebSocket open, waiting for ready op */
|
|
7
|
-
NEARLY = 1,
|
|
8
|
-
/** Fully connected and ready */
|
|
9
|
-
CONNECTED = 2,
|
|
10
|
-
DISCONNECTING = 3,
|
|
11
|
-
DISCONNECTED = 4,
|
|
12
|
-
RECONNECTING = 5
|
|
13
|
-
}
|
|
14
|
-
export declare enum PlayerState {
|
|
15
|
-
CONNECTING = 0,
|
|
16
|
-
CONNECTED = 1,
|
|
17
|
-
DISCONNECTING = 2,
|
|
18
|
-
DISCONNECTED = 3
|
|
19
|
-
}
|
|
20
|
-
export declare const SOURCE_PREFIXES: Record<string, string>;
|
|
21
|
-
export declare const URL_PATTERNS: Record<string, RegExp[]>;
|
|
22
|
-
export declare const STOPPED_REASONS: Set<string>;
|
|
23
|
-
export declare const WS_CLOSE_CODES: Record<number, string>;
|
|
24
|
-
import type { BitrateConfig, BoostTier } from "./types";
|
|
25
|
-
export declare const BITRATE_BY_BOOST_TIER: Record<BoostTier, BitrateConfig>;
|
|
26
|
-
export declare const DEFAULTS: {
|
|
27
|
-
readonly VOICE_CONNECTION_TIMEOUT: 15000;
|
|
28
|
-
readonly MAX_CACHE_SIZE: 1000;
|
|
29
|
-
readonly CACHE_TTL: 3600000;
|
|
30
|
-
readonly HEARTBEAT_INTERVAL: 30000;
|
|
31
|
-
readonly WS_SEND_TIMEOUT: 30000;
|
|
32
|
-
readonly WS_MAX_QUEUE: 100;
|
|
33
|
-
readonly REST_TIMEOUT: 30000;
|
|
34
|
-
readonly REST_MAX_RETRIES: 3;
|
|
35
|
-
readonly REST_RETRY_BASE_DELAY: 1000;
|
|
36
|
-
readonly REST_RETRY_MAX_DELAY: 15000;
|
|
37
|
-
readonly NODE_CONNECTION_TIMEOUT: 10000;
|
|
38
|
-
readonly NODE_MAX_RETRIES: 5;
|
|
39
|
-
readonly NODE_MAX_RECONNECT_DELAY: 30000;
|
|
40
|
-
readonly PREVIOUS_HISTORY_SIZE: 25;
|
|
41
|
-
readonly CACHE_SWEEP_INTERVAL: 300000;
|
|
42
|
-
readonly SPOTIFY_TOKEN_REFRESH_BUFFER: 30000;
|
|
43
|
-
readonly MAX_SEARCH_RETRIES: 2;
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=Constants.d.ts.map
|
package/dist/Constants.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../src/Constants.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAE/C,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,WAAW,iBAAsB,CAAC;AAI/C,oBAAY,KAAK;IACf,UAAU,IAAI;IACd,2CAA2C;IAC3C,MAAM,IAAI;IACV,gCAAgC;IAChC,SAAS,IAAI;IACb,aAAa,IAAI;IACjB,YAAY,IAAI;IAChB,YAAY,IAAI;CACjB;AAID,oBAAY,WAAW;IACrB,UAAU,IAAI;IACd,SAAS,IAAI;IACb,aAAa,IAAI;IACjB,YAAY,IAAI;CACjB;AAMD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAgBlD,CAAC;AAMF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAiEjD,CAAC;AAMF,eAAO,MAAM,eAAe,aAO1B,CAAC;AAIH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAajD,CAAC;AAIF,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAExD,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,SAAS,EAAE,aAAa,CAKlE,CAAC;AAIF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;CAkBX,CAAC"}
|