Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/cli/factories/commandFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import type {
import type {
TokenUsage,
AnalyticsData,
TTSResult,
} from "../../lib/types/index.js";
import { configManager } from "../commands/config.js";
import { handleError } from "../errorHandler.js";
Expand Down Expand Up @@ -467,9 +466,12 @@ export class CLICommandFactory {
return;
}

// Extract audio from result
const resultObj = result as Record<string, unknown>;
const audio = resultObj?.audio as TTSResult | undefined;
// Extract audio from result with proper type checking
if (!result || typeof result !== "object") {
return;
}
const generateResult = result as GenerateResult;
const audio = generateResult.audio;

if (!audio) {
if (!options.quiet) {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/types/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ export type GenerateResult = CommandResult & {
name: string;
description: string;
}>;
/** TTS audio result when TTS is enabled */
audio?: import("./index.js").TTSResult;
};

/**
Expand Down
Loading