chore(lint): burn down remaining warnings to zero
This commit is contained in:
@@ -2,6 +2,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||
import type { GatewayEvent, GatewayRequest, OutboundMessage } from '../protocol.js';
|
||||
import { LaneQueue } from '../lane-queue.js';
|
||||
import { createAgentHandlers } from './agent.js';
|
||||
import type { AgentHandlerDeps } from './agent.js';
|
||||
import { CommandRegistry, registerBuiltinCommands } from '../../commands/index.js';
|
||||
|
||||
describe('createAgentHandlers command fast-path', () => {
|
||||
@@ -35,9 +36,9 @@ describe('createAgentHandlers command fast-path', () => {
|
||||
registerBuiltinCommands(commandRegistry);
|
||||
|
||||
const handlers = createAgentHandlers({
|
||||
sessionBridge: sessionBridge as any,
|
||||
sessionBridge: sessionBridge as unknown as AgentHandlerDeps['sessionBridge'],
|
||||
laneQueue: new LaneQueue(),
|
||||
sessionManager: sessionManager as any,
|
||||
sessionManager: sessionManager as unknown as AgentHandlerDeps['sessionManager'],
|
||||
commandRegistry,
|
||||
});
|
||||
|
||||
|
||||
@@ -59,7 +59,8 @@ export function createSystemHandlers(deps: SystemHandlerDeps) {
|
||||
},
|
||||
|
||||
'system.restart': async (request: GatewayRequest): Promise<OutboundMessage> => {
|
||||
if (!deps.restart) {
|
||||
const restart = deps.restart;
|
||||
if (!restart) {
|
||||
return makeError(request.id, ErrorCode.InternalError, 'Restart not available in this environment');
|
||||
}
|
||||
|
||||
@@ -68,7 +69,7 @@ export function createSystemHandlers(deps: SystemHandlerDeps) {
|
||||
|
||||
// Schedule restart after response is sent (next tick)
|
||||
queueMicrotask(() => {
|
||||
deps.restart!().catch((err) => {
|
||||
restart().catch((err) => {
|
||||
console.error('Restart failed:', err);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -49,7 +49,7 @@ export class LaneQueue {
|
||||
|
||||
// Otherwise, queue the work and return a deferred promise
|
||||
return new Promise<T>((resolve, reject) => {
|
||||
lane!.queue.push({
|
||||
lane.queue.push({
|
||||
work: work as () => Promise<unknown>,
|
||||
resolve: resolve as (value: unknown) => void,
|
||||
reject,
|
||||
|
||||
@@ -199,7 +199,7 @@ describe('GatewayServer integration', () => {
|
||||
const doneEvent = messages[0] as GatewayEvent;
|
||||
expect(doneEvent.id).toBe(4);
|
||||
expect(doneEvent.event).toBe('done');
|
||||
expect((doneEvent.data as any).content).toBe('Hello from Flynn!');
|
||||
expect((doneEvent.data as { content?: string }).content).toBe('Hello from Flynn!');
|
||||
} finally {
|
||||
ws.close();
|
||||
}
|
||||
@@ -319,7 +319,7 @@ describe('GatewayServer lock mode', () => {
|
||||
try {
|
||||
const result = await sendAndReceive(ws, { id: 1, method: 'system.health' });
|
||||
const response = result as GatewayResponse;
|
||||
expect((response.result as any).status).toBe('ok');
|
||||
expect((response.result as { status?: string }).status).toBe('ok');
|
||||
} finally {
|
||||
ws.close();
|
||||
// Wait for the close to propagate so connectionMap is empty
|
||||
@@ -363,7 +363,7 @@ describe('GatewayServer lock mode', () => {
|
||||
try {
|
||||
const result = await sendAndReceive(ws2, { id: 2, method: 'system.health' });
|
||||
const response = result as GatewayResponse;
|
||||
expect((response.result as any).status).toBe('ok');
|
||||
expect((response.result as { status?: string }).status).toBe('ok');
|
||||
} finally {
|
||||
ws2.close();
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
|
||||
@@ -71,7 +71,7 @@ export class FlynnClient {
|
||||
}
|
||||
this._setStatus('disconnected');
|
||||
// Reject all pending requests
|
||||
for (const [id, pending] of this._pending) {
|
||||
for (const [_id, pending] of this._pending) {
|
||||
pending.reject(new Error('WebSocket closed'));
|
||||
}
|
||||
this._pending.clear();
|
||||
|
||||
@@ -289,7 +289,7 @@ function hideSlashPopup() {
|
||||
_slashPopupIndex = -1;
|
||||
}
|
||||
|
||||
function updatePopupSelection(filtered) {
|
||||
function updatePopupSelection(_filtered) {
|
||||
const popup = _elements.slashPopup;
|
||||
if (!popup) {return;}
|
||||
const items = popup.querySelectorAll('.slash-popup-item');
|
||||
|
||||
@@ -217,7 +217,7 @@ function updateActiveRequests(requestsData) {
|
||||
`;
|
||||
}
|
||||
|
||||
function updateChannels(channelsData) {
|
||||
function _updateChannels(channelsData) {
|
||||
const el = document.getElementById('ops-channels');
|
||||
if (!el) {return;}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ let _el = null;
|
||||
async function loadSettings() {
|
||||
if (!_client || !_el) {return;}
|
||||
|
||||
let config, tools, channels;
|
||||
let config, tools;
|
||||
let services;
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user