Skip to content

Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.

630 B
Raw Blame
export function isRecord(value: unknown): value is Record<string, unknown> {
  return typeof value === 'object' && value !== null && !Array.isArray(value);
}

export function getStringField(value: Record<string, unknown>, key: string): string | undefined {
  const field = value[key];
  return typeof field === 'string' ? field : undefined;
}

export function assertKnownEventType(type: string): boolean {
  return [
    'status',
    'reasoning_summary',
    'assistant_message',
    'tool_use',
    'tool_result',
    'usage',
    'diagnostic',
    'approval',
    'error',
    'unknown_event',
    'done'
  ].includes(type);
}