import type { ToolDef } from "story-engine"; import type { RealtimeTool } from "./openai-realtime.js"; /** * Convert engine ToolDef[] to the RealtimeTool[] shape used by openai-realtime.ts. * The shapes are structurally compatible; this is a typed pass-through. */ export function toRealtimeTools(toolDefs: ToolDef[]): RealtimeTool[] { return toolDefs as RealtimeTool[]; } export const STORY_TOOL_NAMES = [ "select_story", "advance_storyline", "navigate_scene", "perform_scene_action", "request_options", "exit_story", ] as const; export type StoryToolName = (typeof STORY_TOOL_NAMES)[number]; export function isStoryTool(name: string): name is StoryToolName { return (STORY_TOOL_NAMES as readonly string[]).includes(name); }