refactor: remove unused imports, variables, and constants

- inner-loop-tracker.ts: Comment out unused COMPLETION_SIGNAL_PATTERN, use _id
- session.ts: Remove unused execSync import and timeout constants
- task-tracker.ts: Use _context for unused parameter
- server.ts: Remove unused FastifyRequest import

All files now pass --noUnusedLocals --noUnusedParameters check.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-21 06:51:41 +01:00
co-authored by Claude Opus 4.5
parent 881ecc0878
commit d8803e3318
4 changed files with 5 additions and 16 deletions
+3 -8
View File
@@ -180,13 +180,8 @@ const ALL_COUNT_PATTERN = /all\s+(\d+)\s+(?:tasks?|files?|items?)/i;
*/
const TASK_DONE_PATTERN = /(?:task|item|todo)\s*(?:#?\d+|"\s*[^"]+\s*")?\s*(?:is\s+)?(?:done|completed?|finished)|(?:completed?|done|finished)\s+(?:task|item)\s*(?:#?\d+)?|marking\s+(?:.*?\s+)?(?:as\s+)?completed?|marked\s+(?:.*?\s+)?(?:as\s+)?completed?/i;
/**
* Matches generic standalone completion signals
* Examples: "Done!", "Completed", "Finished", "All set"
* Note: Use with caution - high false positive potential
* @deprecated Currently unused due to false positive risk
*/
const COMPLETION_SIGNAL_PATTERN = /^(?:done|completed?|finished|all\s+set)!?\s*$/i;
// Generic completion signal pattern - commented out due to false positive risk
// const COMPLETION_SIGNAL_PATTERN = /^(?:done|completed?|finished|all\s+set)!?\s*$/i;
// ---------- Utility Patterns ----------
@@ -712,7 +707,7 @@ export class InnerLoopTracker extends EventEmitter {
const taskNum = parseInt(taskNumMatch[1]);
// Find the nth todo (by order) and mark it complete
let count = 0;
for (const [id, todo] of this._todos) {
for (const [_id, todo] of this._todos) {
count++;
if (count === taskNum && todo.status !== 'completed') {
todo.status = 'completed';
-6
View File
@@ -18,7 +18,6 @@
import { EventEmitter } from 'node:events';
import { v4 as uuidv4 } from 'uuid';
import * as pty from 'node-pty';
import { execSync } from 'node:child_process';
import { SessionState, SessionStatus, SessionConfig, ScreenSession, InnerLoopState, InnerTodoItem } from './types.js';
import { TaskTracker, type BackgroundTask } from './task-tracker.js';
import { InnerLoopTracker } from './inner-loop-tracker.js';
@@ -53,11 +52,6 @@ const MAX_LINE_BUFFER_SIZE = 64 * 1024;
/** Line buffer flush interval (100ms) - forces processing of partial lines */
const LINE_BUFFER_FLUSH_INTERVAL = 100;
/** Default timeout for async operations in milliseconds (5 minutes) */
const DEFAULT_ASYNC_TIMEOUT_MS = 5 * 60 * 1000;
/** Timeout for interactive session startup in milliseconds (30 seconds) */
const INTERACTIVE_START_TIMEOUT_MS = 30 * 1000;
// Filter out terminal focus escape sequences (focus in/out reports)
// ^[[I (focus in), ^[[O (focus out), and the enable/disable sequences
+1 -1
View File
@@ -367,7 +367,7 @@ export class TaskTracker extends EventEmitter {
* @param context - Terminal context for debugging
* @fires taskCreated
*/
private createTaskFromTerminal(agentType: string, context: string): void {
private createTaskFromTerminal(agentType: string, _context: string): void {
const taskId = `terminal-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
const parentId = this.taskStack.length > 0 ? this.taskStack[this.taskStack.length - 1] : null;
+1 -1
View File
@@ -1,4 +1,4 @@
import Fastify, { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
import Fastify, { FastifyInstance, FastifyReply } from 'fastify';
import fastifyStatic from '@fastify/static';
import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';