feat(caveman): add wenyan classical Chinese levels and sync upstream prompts

Add wenyan-lite/wenyan/wenyan-ultra levels for max token compression,
sync SHARED_EXAMPLES/AUTO_CLARITY/PERSISTENCE across all levels, and
expose 3 wenyan buttons in endpoint settings UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
arden1601
2026-06-06 12:35:08 +07:00
committed by decolua
co-authored by Cursor
parent 2be00e2a78
commit 047792205f
2 changed files with 62 additions and 3 deletions
@@ -53,6 +53,9 @@ const CAVEMAN_LEVELS = [
{ id: "lite", label: "Lite", desc: "Drop filler, keep grammar" },
{ id: "full", label: "Full", desc: "Drop articles, fragments OK" },
{ id: "ultra", label: "Ultra", desc: "Telegraphic, max compression" },
{ id: "wenyan-lite", label: "文 Lite", desc: "Classical Chinese, light compression" },
{ id: "wenyan", label: "文 Full", desc: "Maximum 文言文, 80-90% reduction" },
{ id: "wenyan-ultra", label: "文 Ultra", desc: "Extreme classical compression" },
];
export default function APIPageClient({ machineId }) {
const [keys, setKeys] = useState([]);
@@ -117,6 +120,13 @@ export default function APIPageClient({ machineId }) {
// API key visibility toggle state
const [visibleKeys, setVisibleKeys] = useState(new Set());
// Client-side local/remote detection (UI hint only, not a security gate)
const [isRemoteHost, setIsRemoteHost] = useState(false);
useEffect(() => {
if (typeof window !== "undefined")
setIsRemoteHost(!["localhost", "127.0.0.1", "::1"].includes(window.location.hostname));
}, []);
const { copied, copy } = useCopyToClipboard();
// Security gate: block remote exposure while dashboard uses default password or login is off.
@@ -1118,6 +1128,12 @@ export default function APIPageClient({ machineId }) {
/>
</div>
{isRemoteHost && !requireApiKey && (
<div className="mb-4 -mt-2">
<SecurityWarning message="Endpoint is exposed without an API key." />
</div>
)}
{keys.length === 0 ? (
<div className="text-center py-12">
<div className="inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4">