From 867a6a80ef1121e41ed9b8a8472d562c6f129d5e Mon Sep 17 00:00:00 2001 From: Eyejoker Date: Mon, 23 Mar 2026 07:00:22 +0900 Subject: [PATCH] style: format extracted helpers --- src/agent-runner.ts | 3 +-- src/dashboard.ts | 10 ++++++---- src/task-status-tracker.ts | 10 ++-------- src/unified-dashboard.ts | 15 +++++++++------ 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/agent-runner.ts b/src/agent-runner.ts index 0848d12..ce04cd1 100644 --- a/src/agent-runner.ts +++ b/src/agent-runner.ts @@ -107,8 +107,7 @@ function buildBaseRunnerEnv(args: { const npmGlobalBin = path.join(os.homedir(), '.npm-global', 'bin'); const currentPath = cleanEnv.PATH || '/usr/local/bin:/usr/bin:/bin'; const extraPaths = [nodeBin, npmGlobalBin].filter( - (candidate) => - !currentPath.includes(candidate) && fs.existsSync(candidate), + (candidate) => !currentPath.includes(candidate) && fs.existsSync(candidate), ); return { diff --git a/src/dashboard.ts b/src/dashboard.ts index 1825328..38ac35d 100644 --- a/src/dashboard.ts +++ b/src/dashboard.ts @@ -52,10 +52,12 @@ export function buildStatusContent(opts: DashboardOptions): string { .filter((line): line is DashboardRoomLine => Boolean(line)); return composeDashboardContent([ - `**에이전트 상태** (${opts.assistantName}) — 활성 ${totalActive} | 큐대기 ${totalWaiting} | 전체 ${roomLines.length}\n\n${renderCategorizedRoomSections({ - lines: roomLines, - showCategoryHeaders: false, - })}`, + `**에이전트 상태** (${opts.assistantName}) — 활성 ${totalActive} | 큐대기 ${totalWaiting} | 전체 ${roomLines.length}\n\n${renderCategorizedRoomSections( + { + lines: roomLines, + showCategoryHeaders: false, + }, + )}`, ]); } diff --git a/src/task-status-tracker.ts b/src/task-status-tracker.ts index 6e2691e..e00faef 100644 --- a/src/task-status-tracker.ts +++ b/src/task-status-tracker.ts @@ -18,10 +18,7 @@ export interface TaskStatusTrackerTransport { export interface TaskStatusTracker { enabled: boolean; - update: ( - phase: WatcherStatusPhase, - nextRun?: string | null, - ) => Promise; + update: (phase: WatcherStatusPhase, nextRun?: string | null) => Promise; } export function createTaskStatusTracker( @@ -44,10 +41,7 @@ export function createTaskStatusTracker( }); }; - const update = async ( - phase: WatcherStatusPhase, - nextRun?: string | null, - ) => { + const update = async (phase: WatcherStatusPhase, nextRun?: string | null) => { if (!enabled) return; const checkedAt = new Date().toISOString(); diff --git a/src/unified-dashboard.ts b/src/unified-dashboard.ts index 5d1c531..8656be3 100644 --- a/src/unified-dashboard.ts +++ b/src/unified-dashboard.ts @@ -3,10 +3,7 @@ import fs from 'fs'; import os from 'os'; import path from 'path'; -import { - STATUS_SHOW_ROOMS, - USAGE_DASHBOARD_ENABLED, -} from './config.js'; +import { STATUS_SHOW_ROOMS, USAGE_DASHBOARD_ENABLED } from './config.js'; import { fetchClaudeUsageViaCli, type ClaudeUsageData, @@ -135,7 +132,9 @@ async function refreshChannelMeta( const channel = opts.channels.find( (item) => - item.name.startsWith('discord') && item.isConnected() && item.getChannelMeta, + item.name.startsWith('discord') && + item.isConnected() && + item.getChannelMeta, ); if (!channel?.getChannelMeta) return; @@ -307,7 +306,11 @@ function buildStatusContent(): string { rooms.sort((a, b) => (a.meta?.position ?? 999) - (b.meta?.position ?? 999)); for (const room of rooms) { room.agents.sort((a, b) => - a.agentType === b.agentType ? 0 : a.agentType === 'claude-code' ? -1 : 1, + a.agentType === b.agentType + ? 0 + : a.agentType === 'claude-code' + ? -1 + : 1, ); const agentParts = room.agents.map((agent) => { const icon = STATUS_ICONS[agent.status] || '⚪';