README rewritten with engine features, not-available list and Apache-2.0 attribution (forked from TensorZero 2026.6.0). UI status indicator, logger prefix and warnings renamed to Relay (RELAY_UI_LOG_LEVEL with legacy alias). Help links resolve via docs-url.ts to pinned engine docs (VITE_RELAY_DOCS_URL override); fixed SFT link. /autopilot always shows the unavailable page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
886 B
TypeScript
38 lines
886 B
TypeScript
"use client";
|
|
|
|
/**
|
|
* Autopilot Available Context Provider
|
|
*
|
|
* This module provides a React Context for checking if autopilot is available.
|
|
* Relay does not offer Autopilot (it needs TensorZero's hosted service), so the
|
|
* root loader always provides `false` and Autopilot entry points stay hidden.
|
|
*
|
|
* @module autopilot-available
|
|
*/
|
|
|
|
import { createContext, use } from "react";
|
|
|
|
const AutopilotAvailableContext = createContext(false);
|
|
AutopilotAvailableContext.displayName = "AutopilotAvailableContext";
|
|
|
|
/**
|
|
* Hook to check if autopilot is available
|
|
*/
|
|
export function useAutopilotAvailable() {
|
|
return use(AutopilotAvailableContext);
|
|
}
|
|
|
|
export function AutopilotAvailableProvider({
|
|
children,
|
|
value,
|
|
}: {
|
|
children: React.ReactNode;
|
|
value: boolean;
|
|
}) {
|
|
return (
|
|
<AutopilotAvailableContext value={value}>
|
|
{children}
|
|
</AutopilotAvailableContext>
|
|
);
|
|
}
|