← Files Codex Security CloudARCHIVED FILE

.internal/defense-factory-ui/src/app-context.tsx

380 Bytes · Oct 2, 2026 · 00:26 UTC

↓ Download file

import { createContext, useContext } from "react";
import type { DefenseFactoryBootstrap } from "./contract";

export const CloudContext = createContext<DefenseFactoryBootstrap | null>(null);

export function useCloud(): DefenseFactoryBootstrap {
  const cloud = useContext(CloudContext);
  if (!cloud) throw new Error("Security has not connected to its host");
  return cloud;
}

SHA-256: f97a9e7885de7e95f609716809907cc07dd103861da438563976ba8705711f0f