feat(hololake): project registered modules into marketplace
This commit is contained in:
parent
97b378b60c
commit
03e4338ab8
7 changed files with 120 additions and 7 deletions
|
|
@ -131,7 +131,7 @@ export default function App() {
|
|||
/>
|
||||
)}{" "}
|
||||
{view === "knowledge" && <Knowledge data={data} refresh={refresh} />}{" "}
|
||||
{view === "market" && <Market />}{" "}
|
||||
{view === "market" && <Market modules={data.modules} />}{" "}
|
||||
{view === "history" && <History data={data} />}{" "}
|
||||
{view === "portal" && <Portal setError={setError} />}{" "}
|
||||
{view === "settings" && (
|
||||
|
|
@ -847,7 +847,30 @@ function Knowledge({
|
|||
);
|
||||
}
|
||||
|
||||
function Market() {
|
||||
function Market({ modules }: { modules: SystemSnapshot["modules"] }) {
|
||||
const personaModules = modules.filter((module) => module.audience === "PERSONA");
|
||||
const humanModules = modules.filter(
|
||||
(module) => module.audience === "HUMAN" || module.audience === "HUMAN_TEAM",
|
||||
);
|
||||
const stateLabel = (state: string) => {
|
||||
if (state.includes("ENTERPRISE") || state.includes("SERVER_CHALLENGE"))
|
||||
return "本机证明能力已实现 · 等待安装与企业服务器验证";
|
||||
if (state.includes("EXISTING_PERSONA_VERIFICATION_NOT_CLAIMED"))
|
||||
return "试用运行时已安装 · 既有人格尚未验证";
|
||||
if (state.includes("REALTIME_CONNECTOR_ACTIVE")) return "本机实时连接已验证";
|
||||
if (state.includes("TCS_TO_GIR")) return "TCS/GIR 本地执行闭环已验证";
|
||||
if (state.includes("LOCAL_INSTALLED_VERIFIED")) return "已预装并通过本机验证";
|
||||
return "已登记 · 等待独立验收";
|
||||
};
|
||||
const group = (items: typeof modules) =>
|
||||
items.map((module) => (
|
||||
<article className="market-module" key={module.moduleId}>
|
||||
<span>{module.moduleId}</span>
|
||||
<h3>{module.nameZh}</h3>
|
||||
<p>{module.summaryZh}</p>
|
||||
<small aria-label={`机器状态:${module.state}`}>{stateLabel(module.state)}</small>
|
||||
</article>
|
||||
));
|
||||
return (
|
||||
<div className="page simple">
|
||||
<header>
|
||||
|
|
@ -856,16 +879,16 @@ function Market() {
|
|||
<p>能力按使用主体分开登记</p>
|
||||
</div>
|
||||
</header>
|
||||
<section className="split-list">
|
||||
<section className="split-list market-groups">
|
||||
<div>
|
||||
<h2>人格体使用</h2>
|
||||
<p>动态脑、技能和执行零件将在签名审核后出现。</p>
|
||||
<span>当前没有已发布模块</span>
|
||||
<p>人格体调用的执行零件与表达桥。连接、安装和执行权限分别验证。</p>
|
||||
<div className="market-module-list">{group(personaModules)}</div>
|
||||
</div>
|
||||
<div>
|
||||
<h2>人类使用</h2>
|
||||
<p>行业工作模块将在完成独立验收后出现。</p>
|
||||
<span>光湖知识库为预装模块</span>
|
||||
<p>直接服务于人的知识、行业与责任入口。团队模块不会向普通用户开放。</p>
|
||||
<div className="market-module-list">{group(humanModules)}</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { invoke } from "@tauri-apps/api/core";
|
||||
import moduleRegistry from "../registries/module-registry.json";
|
||||
import type {
|
||||
AgentProposal,
|
||||
AgentReceipt,
|
||||
|
|
@ -14,6 +15,7 @@ import type {
|
|||
EnterpriseBindingRequest,
|
||||
EnterpriseDeviceProof,
|
||||
EnterpriseEntranceSnapshot,
|
||||
ModuleRecord,
|
||||
} from "./types";
|
||||
|
||||
const tauri = () => "__TAURI_INTERNALS__" in window;
|
||||
|
|
@ -73,6 +75,14 @@ export async function snapshot(): Promise<SystemSnapshot> {
|
|||
"https://guanghulab.com/hololake/releases/latest.json",
|
||||
publicDistributionState: "SIGNED_UPDATE_FEED_READY_NO_RELEASE",
|
||||
externalAiBridges: s.bridges,
|
||||
modules: moduleRegistry.modules.map((module) => ({
|
||||
moduleId: module.module_id,
|
||||
nameZh: module.name_zh,
|
||||
kind: module.kind,
|
||||
audience: module.audience as ModuleRecord["audience"],
|
||||
summaryZh: module.summary_zh,
|
||||
state: module.state,
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -933,6 +933,40 @@ main {
|
|||
margin-top: 30px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.market-groups > div {
|
||||
align-self: start;
|
||||
}
|
||||
.market-module-list {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
.market-module {
|
||||
padding: 16px;
|
||||
border-radius: 13px;
|
||||
background: rgba(255, 255, 255, 0.035);
|
||||
}
|
||||
.market-module span {
|
||||
margin: 0;
|
||||
color: #7896ae;
|
||||
font-size: 9px;
|
||||
font-weight: 650;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
.market-module h3 {
|
||||
margin: 7px 0 5px;
|
||||
font-size: 15px;
|
||||
}
|
||||
.market-module p {
|
||||
margin: 0;
|
||||
}
|
||||
.market-module small {
|
||||
display: block;
|
||||
margin-top: 12px;
|
||||
color: #71889d;
|
||||
font-size: 10px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.timeline-list {
|
||||
display: grid;
|
||||
gap: 0;
|
||||
|
|
|
|||
|
|
@ -45,6 +45,15 @@ export interface SystemSnapshot {
|
|||
publicUpdateEndpoint: string;
|
||||
publicDistributionState: string;
|
||||
externalAiBridges: ExternalAiBridge[];
|
||||
modules: ModuleRecord[];
|
||||
}
|
||||
export interface ModuleRecord {
|
||||
moduleId: string;
|
||||
nameZh: string;
|
||||
kind: string;
|
||||
audience: "SYSTEM" | "HUMAN" | "PERSONA" | "HUMAN_TEAM";
|
||||
summaryZh: string;
|
||||
state: string;
|
||||
}
|
||||
export interface ExternalAiBridge {
|
||||
bridgeId: string;
|
||||
|
|
|
|||
Loading…
Reference in a new issue