feat(ohos): 鸿蒙端聊天历史分段懒加载 + 首次提交完整工程

原有 cmd/ohos/HomeAgent 是未入库的鸿蒙原生 ArkTS 工程,本次随改动一并入库,
保证他人 clone 后可直接编译(含 .gitignore 排除 build/oh_modules/签名材料,
提供 build-profile.json5.example 模板)。

本次功能改动(与 WebUI / GUI 三端对齐):
- /chat/history 首屏只拉最新 CHAT_PAGE_SIZE(40) 条,1.26MB → 48.5KB
- 抽出 parseHistoryPayload() 复用解析,记录 chatOffset/chatHasMore
- 新增 loadOlderChat():向上滚动触顶(yOffset<60)懒加载更早页
- 工具调用 args/result 与 reasoning_content 完整还原,不做裁剪

构建验证:hvigorw assembleHap BUILD SUCCESSFUL(7.8s,ChatPage 零告警)
This commit is contained in:
JianFeeeee
2026-08-29 10:24:13 +08:00
parent ca09184a66
commit 9e6eed1c85
76 changed files with 10838 additions and 0 deletions

19
cmd/ohos/HomeAgent/.gitignore vendored Normal file
View File

@ -0,0 +1,19 @@
# 构建产物
build/
.hvigor/
.cxx/
# 依赖
oh_modules/
node_modules/
# 本地 SDK / Node 路径,每台机器不同
local.properties
# 签名材料:含 keyPassword / storePassword 明文与本机绝对路径,不入库
build-profile.json5
# hvigorw 在本机是指向 /opt/huawei/command-line-tools/bin/hvigorw 的符号链接,
# 绝对路径因机而异,入库后他人 clone 得到的是坏链接。
# 请改用本机 DevEco command-line-tools 里的 hvigorw(见 README)。
hvigorw