chore(lint): burn down remaining warnings to zero
This commit is contained in:
@@ -71,7 +71,11 @@ function validateInput(args: AudioTranscribeArgs): { valid: boolean; error?: str
|
||||
}
|
||||
|
||||
if (hasUrl) {
|
||||
const urlValidation = validateUrl(args.url!);
|
||||
const url = args.url;
|
||||
if (!url) {
|
||||
return { valid: false, error: 'URL is required when using url mode' };
|
||||
}
|
||||
const urlValidation = validateUrl(url);
|
||||
if (!urlValidation.valid) {
|
||||
return urlValidation;
|
||||
}
|
||||
@@ -153,7 +157,7 @@ export function createAudioTranscribeTool(audioConfig?: AudioTranscriptionConfig
|
||||
'audio/mp4': 'm4a',
|
||||
'audio/x-m4a': 'm4a',
|
||||
};
|
||||
const ext = extMap[args.mime_type!] || 'bin';
|
||||
const ext = extMap[args.mime_type ?? ''] || 'bin';
|
||||
filename = `audio.${ext}`;
|
||||
|
||||
const mimeType = args.mime_type ?? 'audio/wav';
|
||||
|
||||
@@ -3,8 +3,7 @@ import { BrowserManager } from './manager.js';
|
||||
|
||||
// Use vi.hoisted() so these are available inside the hoisted vi.mock() call
|
||||
const {
|
||||
mockGoto, mockTitle, mockUrl, mockClose, mockIsClosed,
|
||||
mockSetDefaultTimeout, mockPage, mockNewPage, mockPages,
|
||||
mockClose, mockIsClosed, mockPage, mockNewPage, mockPages,
|
||||
mockBrowserClose,
|
||||
} = vi.hoisted(() => {
|
||||
const mockGoto = vi.fn().mockResolvedValue(undefined);
|
||||
|
||||
@@ -27,7 +27,7 @@ export const fileListTool: Tool = {
|
||||
try {
|
||||
let entries = readdirSync(args.path, { withFileTypes: true });
|
||||
if (args.pattern) {
|
||||
entries = entries.filter(e => matchGlob(e.name, args.pattern!));
|
||||
entries = entries.filter(e => matchGlob(e.name, args.pattern));
|
||||
}
|
||||
const output = entries
|
||||
.map(e => e.isDirectory() ? `${e.name}/` : e.name)
|
||||
|
||||
@@ -86,7 +86,7 @@ export function createImageAnalyzeTool(modelClient: ModelClient): Tool {
|
||||
}
|
||||
: {
|
||||
type: 'base64' as const,
|
||||
media_type: args.media_type!,
|
||||
media_type: args.media_type ?? 'image/jpeg',
|
||||
data: args.data,
|
||||
};
|
||||
|
||||
|
||||
@@ -40,8 +40,6 @@ import { filePatchTool } from './file-patch.js';
|
||||
import { fileListTool } from './file-list.js';
|
||||
import { systemInfoTool } from './system-info.js';
|
||||
import { webFetchTool } from './web-fetch.js';
|
||||
import { createMediaSendTool } from './media-send.js';
|
||||
import { createImageAnalyzeTool } from './image-analyze.js';
|
||||
import { createMemoryReadTool } from './memory-read.js';
|
||||
import { createMemoryWriteTool } from './memory-write.js';
|
||||
import { createMemorySearchTool } from './memory-search.js';
|
||||
|
||||
@@ -151,12 +151,16 @@ export class ProcessManager {
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
detached: false,
|
||||
});
|
||||
const pid = child.pid;
|
||||
if (pid === undefined) {
|
||||
throw new Error('Failed to start process: missing pid');
|
||||
}
|
||||
|
||||
const proc: ManagedProcess = {
|
||||
id,
|
||||
command,
|
||||
cwd,
|
||||
pid: child.pid!,
|
||||
pid,
|
||||
status: 'running',
|
||||
outputBuffer,
|
||||
startedAt: Date.now(),
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import type { Tool, ToolResult } from '../types.js';
|
||||
import type { SessionManager } from '../../session/manager.js';
|
||||
|
||||
interface SessionsListArgs {
|
||||
// no args
|
||||
}
|
||||
|
||||
interface SessionsHistoryArgs {
|
||||
sessionId: string;
|
||||
limit?: number;
|
||||
|
||||
Reference in New Issue
Block a user