mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
chore(lint): narrow explicit any in misc server files
This commit is contained in:
@@ -97,7 +97,9 @@ export async function determineAgentMetadataNeeds(
|
||||
};
|
||||
}
|
||||
|
||||
function buildMetadataSchema(needs: AgentMetadataNeeds): z.ZodObject<any> | null {
|
||||
function buildMetadataSchema(
|
||||
needs: AgentMetadataNeeds,
|
||||
): z.ZodObject<Record<string, z.ZodTypeAny>> | null {
|
||||
if (!needs.needsTitle && !needs.needsBranch) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -533,7 +533,8 @@ export function getProviderIds(
|
||||
}
|
||||
|
||||
// Deprecated: Use buildProviderRegistry instead
|
||||
export const PROVIDER_REGISTRY: Record<AgentProvider, ProviderDefinition> = null as any;
|
||||
export const PROVIDER_REGISTRY: Record<AgentProvider, ProviderDefinition> =
|
||||
null as unknown as Record<AgentProvider, ProviderDefinition>;
|
||||
|
||||
export function createAllClients(
|
||||
logger: Logger,
|
||||
|
||||
@@ -12,7 +12,7 @@ type MutableDaemonConfigPatch = import("../shared/messages.js").MutableDaemonCon
|
||||
|
||||
interface LoggerLike {
|
||||
child(bindings: Record<string, unknown>): LoggerLike;
|
||||
info(...args: any[]): void;
|
||||
info(...args: unknown[]): void;
|
||||
}
|
||||
|
||||
type ConfigListener = (config: MutableDaemonConfig) => void;
|
||||
|
||||
@@ -312,7 +312,7 @@ const DEFAULT_PERSISTED_CONFIG = PersistedConfigSchema.parse({
|
||||
|
||||
interface LoggerLike {
|
||||
child(bindings: Record<string, unknown>): LoggerLike;
|
||||
info(...args: any[]): void;
|
||||
info(...args: unknown[]): void;
|
||||
}
|
||||
|
||||
function getConfigPath(paseoHome: string): string {
|
||||
|
||||
@@ -94,8 +94,8 @@ export async function acquirePidLock(
|
||||
try {
|
||||
fd = await open(pidPath, "wx");
|
||||
await fd.write(JSON.stringify(lockInfo));
|
||||
} catch (err: any) {
|
||||
if (err.code === "EEXIST") {
|
||||
} catch (err) {
|
||||
if ((err as NodeJS.ErrnoException).code === "EEXIST") {
|
||||
// Race condition - another process created the file
|
||||
// Re-read and check
|
||||
try {
|
||||
|
||||
@@ -55,7 +55,7 @@ async function downloadToFile(options: DownloadToFileOptions): Promise<void> {
|
||||
const tmpPath = `${outputPath}.tmp-${Date.now()}`;
|
||||
await mkdir(path.dirname(outputPath), { recursive: true });
|
||||
|
||||
const nodeStream = Readable.fromWeb(res.body as any);
|
||||
const nodeStream = Readable.fromWeb(res.body as Parameters<typeof Readable.fromWeb>[0]);
|
||||
|
||||
try {
|
||||
await pipeline(nodeStream, createWriteStream(tmpPath));
|
||||
|
||||
@@ -74,9 +74,10 @@ export class OpenAITTS implements TextToSpeechProvider {
|
||||
stream: audioStream,
|
||||
format: this.config.responseFormat || "mp3",
|
||||
};
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
this.logger.error({ err: error }, "Speech synthesis error");
|
||||
throw new Error(`TTS synthesis failed: ${error.message}`, { cause: error });
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
throw new Error(`TTS synthesis failed: ${message}`, { cause: error });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,7 +305,13 @@ function extractScrollback(terminal: TerminalType): TerminalCell[][] {
|
||||
}
|
||||
|
||||
function extractCursorState(terminal: TerminalType): TerminalState["cursor"] {
|
||||
const coreService = (terminal as any)._core?.coreService;
|
||||
const coreService = (terminal as unknown as { _core?: { coreService?: Record<string, unknown> } })
|
||||
._core?.coreService as
|
||||
| {
|
||||
decPrivateModes?: { cursorStyle?: unknown; cursorBlink?: unknown };
|
||||
isCursorHidden?: unknown;
|
||||
}
|
||||
| undefined;
|
||||
const cursorStyle = coreService?.decPrivateModes?.cursorStyle;
|
||||
const normalizedCursorStyle =
|
||||
cursorStyle === "block" || cursorStyle === "underline" || cursorStyle === "bar"
|
||||
|
||||
@@ -379,13 +379,14 @@ async function execSetupCommand(
|
||||
exitCode: 0,
|
||||
durationMs: Date.now() - startedAt,
|
||||
};
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
const execErr = error as { stdout?: string; stderr?: string; code?: unknown } | undefined;
|
||||
return {
|
||||
command,
|
||||
cwd: options.cwd,
|
||||
stdout: error?.stdout ?? "",
|
||||
stderr: error?.stderr ?? (error instanceof Error ? error.message : String(error)),
|
||||
exitCode: typeof error?.code === "number" ? error.code : null,
|
||||
stdout: execErr?.stdout ?? "",
|
||||
stderr: execErr?.stderr ?? (error instanceof Error ? error.message : String(error)),
|
||||
exitCode: typeof execErr?.code === "number" ? execErr.code : null,
|
||||
durationMs: Date.now() - startedAt,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user