import { useEffect, useMemo, useState } from "react"; import { check } from "@tauri-apps/plugin-updater"; import { relaunch } from "@tauri-apps/plugin-process"; import { Icon } from "./icons"; import * as api from "./runtime"; import type { KnowledgeDocument, SourceKind, SystemSnapshot } from "./types"; type View = | "channel" | "knowledge" | "market" | "history" | "portal" | "settings"; const nav: [View, string, string][] = [ ["channel", "我的频道", "channel"], ["knowledge", "光湖知识库", "book"], ["market", "模块商城", "cube"], ["history", "系统演化史", "history"], ["portal", "企业门户", "building"], ["settings", "设置", "settings"], ]; const labels: Record = { USER_MESSAGE: "用户语言", PERSONA_RESPONSE: "人格回应", SYSTEM_CONTEXT: "系统环境", PROTOCOL_EVENT: "协议运行", AGENT_ACTION: "Agent 执行", TOOL_RESULT: "工具结果", SYSTEM_RECEIPT: "系统回执", }; export default function App() { const [data, setData] = useState(null), [view, setView] = useState("channel"), [error, setError] = useState(""), [busy, setBusy] = useState(false); const refresh = () => api .snapshot() .then(setData) .catch((e) => setError(String(e))); useEffect(() => { refresh(); }, []); if (!data) return (
正在进入 HoloLake…
); if (!data.channel) return ; return (
HoloLake v{data.appVersion.replace("-browser", "")}
{view === "channel" && ( setView("knowledge")} /> )}{" "} {view === "knowledge" && }{" "} {view === "market" && }{" "} {view === "history" && }{" "} {view === "portal" && }{" "} {view === "settings" && ( )}
{error && (
{error}
)}
); } function Onboarding({ onDone, error }: { onDone: () => void; error: string }) { const [name, setName] = useState(""); const go = async () => { if (!name.trim()) return; await api.createChannel(name.trim()); onDone(); }; return (

为你的频道起一个名字

这是属于你的私人初始化频道。系统将为它登记唯一编号,并在本机建立私人 Git。

{error && {error}}
GH-AIOS · 光湖语言系统 · 通用人工智能操作平台
); } function Channel({ data, refresh, openKnowledge, }: { data: SystemSnapshot; refresh: () => void; openKnowledge: () => void; }) { const [text, setText] = useState(""); const send = async () => { if (!text.trim()) return; await api.submitMessage(text.trim()); setText(""); refresh(); }; return (

{data.channel?.name}

个人初始化频道

频道已经准备好

这里保存你与人格体的语言。系统动作会被分流到下方执行记录,不再混入对话。

{data.timeline .filter( (e) => e.sourceKind === "USER_MESSAGE" || e.sourceKind === "PERSONA_RESPONSE", ) .slice(0, 8) .reverse() .map((e) => (
{labels[e.sourceKind]}

{e.content}

))}