This commit is contained in:
legop3
2026-04-28 20:12:39 -04:00
parent fc229fcf62
commit 019147a6ce
10 changed files with 63 additions and 20 deletions
@@ -2,14 +2,14 @@
// Purpose: Defines the admin Reason Service module and the helpers/state used by this service unit.
// Scope: Keeps runtime behavior unchanged while isolating responsibilities into a clear module boundary.
const fs = require('fs');
const path = require('path');
const io = require('../../globals/io');
const logger = require('../../globals/logger').child('adminReasonService');
const { isAdmin } = require('../roleService');
const { publishEvent } = require('../eventBus');
const { resolveDataDir, resolveDataPath } = require('../../helpers/dataPaths');
const DATA_DIR = path.join(__dirname, '..', '..', '..', 'data');
const STORE_PATH = path.join(DATA_DIR, 'admin-reason.json');
const DATA_DIR = resolveDataDir();
const STORE_PATH = resolveDataPath('admin-reason.json');
const MAX_REASON_LENGTH = 240;
let cache = null;
@@ -2,18 +2,18 @@
// Purpose: Defines the audio Levels Service module and the helpers/state used by this service unit.
// Scope: Keeps runtime behavior unchanged while isolating responsibilities into a clear module boundary.
const fs = require('fs');
const path = require('path');
const EventEmitter = require('events');
const io = require('../../globals/io');
const logger = require('../../globals/logger').child('audioLevelsService');
const { loadConfig } = require('../../helpers/configLoader');
const { resolveDataDir, resolveDataPath } = require('../../helpers/dataPaths');
const { isAdmin } = require('../roleService');
const roverManager = require('../roverManager');
const { issueCommand } = require('../commandService');
const audioLevelsEvents = new EventEmitter();
const DATA_DIR = path.join(__dirname, '..', '..', '..', 'data');
const STORE_PATH = path.join(DATA_DIR, 'audio-levels.json');
const DATA_DIR = resolveDataDir();
const STORE_PATH = resolveDataPath('audio-levels.json');
const config = loadConfig();
const configuredDefaults = config.audioLevels || {};
@@ -2,11 +2,11 @@
// Purpose: Defines the button Box Service module and the helpers/state used by this service unit.
// Scope: Keeps runtime behavior unchanged while isolating responsibilities into a clear module boundary.
const fs = require('fs');
const path = require('path');
const express = require('express');
const { app } = require('../../globals/http');
const io = require('../../globals/io');
const logger = require('../../globals/logger').child('buttonBoxService');
const { resolveDataDir, resolveDataPath } = require('../../helpers/dataPaths');
const { publishEvent } = require('../eventBus');
const { getRewardById, listRewards } = require('../../rewards');
const roverManager = require('../roverManager');
@@ -23,8 +23,8 @@ const {
} = require('../homeAssistantService');
const { getRequestIp, isLocalNetwork, normalizeIp } = require('../../helpers/ipResolver');
const DATA_DIR = path.join(__dirname, '..', '..', '..', 'data');
const STORE_PATH = path.join(DATA_DIR, 'buttonbox-state.json');
const DATA_DIR = resolveDataDir();
const STORE_PATH = resolveDataPath('buttonbox-state.json');
const BUTTON_COUNT = 4;
const STORE_VERSION = 1;
@@ -2,14 +2,14 @@
// Purpose: Defines the community Goal Service module and the helpers/state used by this service unit.
// Scope: Keeps runtime behavior unchanged while isolating responsibilities into a clear module boundary.
const fs = require('fs');
const path = require('path');
const io = require('../../globals/io');
const logger = require('../../globals/logger').child('communityGoalService');
const { isAdmin } = require('../roleService');
const { publishEvent } = require('../eventBus');
const { resolveDataDir, resolveDataPath } = require('../../helpers/dataPaths');
const DATA_DIR = path.join(__dirname, '..', '..', '..', 'data');
const STORE_PATH = path.join(DATA_DIR, 'community-goal.json');
const DATA_DIR = resolveDataDir();
const STORE_PATH = resolveDataPath('community-goal.json');
const MAX_GOAL_LENGTH = 240;
let cache = null;
@@ -2,11 +2,11 @@
// Purpose: Defines the discord Guild Store module and the helpers/state used by this service unit.
// Scope: Keeps runtime behavior unchanged while isolating responsibilities into a clear module boundary.
const fs = require('fs');
const path = require('path');
const logger = require('../../globals/logger').child('discordGuildStore');
const { resolveDataDir, resolveDataPath } = require('../../helpers/dataPaths');
const DATA_DIR = path.join(__dirname, '..', '..', '..', 'data');
const STORE_PATH = path.join(DATA_DIR, 'discord-guilds.json');
const DATA_DIR = resolveDataDir();
const STORE_PATH = resolveDataPath('discord-guilds.json');
const VALID_MODES = new Set(['global', 'private']);
let cache = null;
@@ -13,7 +13,7 @@ const { getActiveDrivers } = require('../turnService');
const { getNickname } = require('../nicknameService');
const { getRecentMessages, sendSystemMessage } = require('../chatService');
const PROMPT_PATH = path.join(__dirname, '..', '..', 'prompts', 'commentary_system.txt');
const PROMPT_PATH = path.join(__dirname, '..', '..', '..', 'prompts', 'commentary_system.txt');
const DEFAULT_FREQUENCY_MS = 0;
const MIN_FREQUENCY_MS = 0;
const JITTER_MS = 0;
+2 -1
View File
@@ -15,12 +15,13 @@ const io = require('../../globals/io');
const { getActiveDrivers } = require('../turnService');
const { getNickname } = require('../nicknameService');
const { getRecentMessages } = require('../chatService');
const { resolveDataDir } = require('../../helpers/dataPaths');
const sharp = require('sharp');
const execFileAsync = promisify(execFile);
const FFMPEG_BIN = process.env.FFMPEG_BIN || 'ffmpeg';
const SEGMENT_ROOT = path.resolve(__dirname, '..', '..', '..', 'data', 'replay-segments');
const SEGMENT_ROOT = path.join(resolveDataDir(), 'replay-segments');
const SEGMENT_SECONDS = Math.max(1, Number.parseInt(process.env.REPLAY_SEGMENT_SECONDS || '1', 10));
const BUFFER_SECONDS = Math.max(20, Number.parseInt(process.env.REPLAY_BUFFER_SECONDS || '45', 10));
const CLEANUP_INTERVAL_MS = 10_000;
@@ -1,12 +1,12 @@
// verification Service
// Purpose: Defines the verification Service module and the helpers/state used by this service unit.
// Scope: Keeps runtime behavior unchanged while isolating responsibilities into a clear module boundary.
const path = require('path');
const crypto = require('crypto');
const net = require('net');
const EventEmitter = require('events');
const io = require('../../globals/io');
const logger = require('../../globals/logger').child('verificationService');
const { resolveDataPath } = require('../../helpers/dataPaths');
const { publishEvent } = require('../eventBus');
const { normalizeIp } = require('../../helpers/ipResolver');
const { getNickname, setNickname } = require('../nicknameService');
@@ -20,8 +20,7 @@ const {
createJsonStore,
} = require('../identityService');
const DATA_DIR = path.join(__dirname, '..', '..', '..', 'data');
const STORE_PATH = path.join(DATA_DIR, 'verified-users.json');
const STORE_PATH = resolveDataPath('verified-users.json');
const verificationEvents = new EventEmitter();