"use client";

// src/contexts/chat-runtime-context.tsx
import { createContext, useContext } from "react";
var ChatRuntimeContext = createContext(null);
function useChatRuntime() {
  return useContext(ChatRuntimeContext);
}
function useRequiredChatRuntime() {
  const v = useContext(ChatRuntimeContext);
  if (!v) {
    throw new Error(
      "[chat-runtime] hook called outside a <ChatRuntimeContext.Provider>. The hub mounts <HubRuntimeProvider> at root \u2014 this only fires when chat internals are rendered above the provider tree. Fix: ensure the rendering subtree descends from the runtime provider. In tests/Storybook: wrap with <HubRuntimeProvider> or supply a <ChatRuntimeContext.Provider value={mockedRuntime}>."
    );
  }
  return v;
}

export {
  ChatRuntimeContext,
  useChatRuntime,
  useRequiredChatRuntime
};
//# sourceMappingURL=chunk-4YKGXZ7W.js.map