"use client";
import type { MessageRuntime } from "../runtime/MessageRuntime";
import { useAui, useAuiState } from "@assistant-ui/store";
import { createStateHookForRuntime } from "../../context/react/utils/createStateHookForRuntime";
import type { EditComposerRuntime } from "@assistant-ui/core";
/**
* @deprecated Use `useAui()` with `aui.message()` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
*
* Hook to access the MessageRuntime from the current context.
*
* The MessageRuntime provides access to message-level state and actions,
* including message content, status, editing capabilities, and branching.
*
* @param options Configuration options
* @param options.optional Whether the hook should return null if no context is found
* @returns The MessageRuntime instance, or null if optional is true and no context exists
*
* @example
* ```tsx
* // Before:
* function MessageActions() {
* const runtime = useMessageRuntime();
* const handleReload = () => {
* runtime.reload();
* };
* const handleEdit = () => {
* runtime.startEdit();
* };
* return (
*