feat: add hot-pluggable language shell UI system
This commit is contained in:
parent
621b714449
commit
43578222c2
15 changed files with 592 additions and 5 deletions
21
product-source/hololake-platform/ui-plugins/README.md
Normal file
21
product-source/hololake-platform/ui-plugins/README.md
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# HoloLake UI 插件交付入口
|
||||
|
||||
这里是 UI 人格体与 HoloLake 功能实现之间的稳定边界。UI 贡献者可以提交完整的语言壳布局、
|
||||
视觉变量、文案和素材引用;功能内核仍由 HoloLake 宿主提供。
|
||||
|
||||
## 交付步骤
|
||||
|
||||
1. 复制 `packages/guanghu.default-language-world/ui-package.json`。
|
||||
2. 修改 `manifest.id`、语义化 `version`、`tokens` 和 `layout`。
|
||||
3. 保留四个必需表面:`language_input`、`task_status`、
|
||||
`reality_boundary_confirmation`、`human_receipt`。
|
||||
4. 只使用三项宿主动作:`goal.submit`、`confirmation.answer`、`evidence.expand`。
|
||||
5. 把包加入 `registry.json`,运行:
|
||||
`pnpm exec vitest run src/lib/uiPluginSystem.test.ts src/lib/uiPluginRegistry.test.ts`。
|
||||
6. 提交到独立分支并附截图。合并、构建、部署由 HoloLake 功能车道完成。
|
||||
|
||||
UI 包是声明式数据,不接受任意 JavaScript。它可以重排整套语言壳并替换全部视觉表达,
|
||||
但不能读取节点身份、仓库路由、模型配置、凭据或部署日志,也不能直接执行现实动作。
|
||||
|
||||
宿主先校验候选包,再原子切换;校验或渲染失败时保留上一套可用 UI。代码频道发布只证明
|
||||
UI 包已登记,不等于桌面制品已经接入或部署。
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"manifest": {
|
||||
"schema": "hololake.ui-plugin/v1",
|
||||
"id": "guanghu.default-language-world",
|
||||
"version": "1.0.0",
|
||||
"target": "language_shell",
|
||||
"requestedCapabilities": ["goal.submit", "confirmation.answer", "evidence.expand"]
|
||||
},
|
||||
"tokens": {
|
||||
"--hl-world-background": "#07111f",
|
||||
"--hl-world-foreground": "#f6f1df",
|
||||
"--hl-world-accent": "#d7bd78"
|
||||
},
|
||||
"layout": {
|
||||
"kind": "shell",
|
||||
"children": [
|
||||
{
|
||||
"kind": "stack",
|
||||
"children": [
|
||||
{ "kind": "text", "text": "你想让世界发生什么?" },
|
||||
{ "kind": "language_input", "action": "goal.submit", "text": "开始" },
|
||||
{ "kind": "task_status" },
|
||||
{ "kind": "reality_boundary_confirmation", "action": "confirmation.answer", "approveText": "同意继续", "declineText": "暂不继续" },
|
||||
{ "kind": "human_receipt" },
|
||||
{ "kind": "evidence_toggle", "action": "evidence.expand", "text": "查看依据" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
11
product-source/hololake-platform/ui-plugins/registry.json
Normal file
11
product-source/hololake-platform/ui-plugins/registry.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"schema": "hololake.ui-plugin-registry/v1",
|
||||
"plugins": [
|
||||
{
|
||||
"id": "guanghu.default-language-world",
|
||||
"version": "1.0.0",
|
||||
"path": "packages/guanghu.default-language-world/ui-package.json",
|
||||
"state": "REFERENCE_LAST_KNOWN_GOOD"
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in a new issue