ReMe/reme_studio/mobile/android/README.md
jinliyl 524b1b6908
feat(studio): unify the workbench and proactive runtime (#764)
* fix(proactive): simplify round files and restore failed summaries

* fix(proactive): validate document-relative Markdown links

* feat(proactive_agent): implement v2 daily record workflow with single-file decision

- Add ProactiveAgentStepV2 class to support single daily note decision and reminder
- Introduce RoundOutputs for v2 round file tracking, and keep RoundArtifacts for v1 summary backup
- Refactor AgentOutbox to support both v1 standalone reminder files and v2 daily reminder records
- Add proactive_record utilities to parse and validate v2 daily record frontmatter and metadata
- Enhance proactive_agent to prepare, read, and manage artifacts for both v1 and v2 flows
- Add configuration profile proactive_v2 to enable new workflow with backward compatibility
- Update proactive.yaml and reactive proactive_agent_step configuration comment for easy switching
- Provide extensive schema validation for v2 reminders ensuring priority and message consistency
- Document v2 workflow and usage in English and Chinese runtime docs
- Add unit tests for v2 step verifying single file output and proper decision handling

* refactor(agent/runtime): replace ReminderRef with string keys and simplify reminder handling

- Remove ReminderRef model and switch to using workspace-relative string keys for reminders
- Simplify AgentOutbox to read, write, and manage reminders keyed by strings
- Change file locking and version checking to protect concurrent edits on daily record files
- Replace legacy and v2 reminder file handling with unified ReminderFiles storage
- Adjust ChatNotifications to operate with the new key scheme and update pending/read sets
- Refactor RoundOutputs to RoundRecord for safer round record tracking and rollback
- Remove unused ProactiveRunResult and related references from imports and exports
- Update InboxWakeRequest, AgentReminder, and related models for consistent ID and path validation
- Adjust proactive agent runtime and local runtime to check reminder versions before commit
- Correct language and docs to describe reminders as daily records instead of separate files
- Clean up roles of inbox and outbox for reminder ownership, delivery, and acknowledgments

* fix(proactive): serialize round commits and align desktop reminders

* refactor(proactive): unify task triggers in Proactive Runtime

* fix(proactive): bound reminder payloads and simplify receipts

* refactor(studio): share workbench and simplify proactive delivery

* fix(studio): update and centralize build dependencies

* fix(proactive): guard draft repair and verify Studio deployments

* chore(docs): update source-map-js

* feat(release): support publishing selected artifacts from a tag

* chore(studio): remove the public playground

* refactor: simplify reminders and release workflows

* fix: preserve proactive records and align release provenance

* test(proactive): remove brittle prompt and preset assertions

* fix(proactive): register reminders after input acknowledgement

* feat(notebook): list projects across todos and ideas

* feat(studio): connect mobile apps to configurable ReMe services

* fix(proactive): reserve registered reminder paths

* fix(studio): request Android local network access

* fix(proactive): reserve reminder paths referenced by receipts
2026-11-23 17:19:21 +08:00

41 lines
2.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ReMe Studio for Android
Android 默认连接 `http://127.0.0.1:2333`。在「设置 → 通用」可填写手机能访问的 ReMe 地址,例如
`http://203.0.113.10:2333`(将 IP 替换为你的服务地址)。点击「连接」后应用会保存地址,重启时自动连接。
在 Android 17 上连接局域网服务时,允许系统弹窗请求的局域网访问权限。
## 开发方案
- Android 宿主使用 Kotlin、Android Gradle Plugin 9.5.2、AndroidX WebKit 1.18 和 Android SDK Platform 37.2。应用最低支持 Android 10,目标 API 为 37。APK 内置 Vite 构建的 Studio 页面,通过 WebViewAssetLoader 的 HTTPS origin 加载。
- 点击左上角菜单,或从顶部工具栏、屏幕左侧靠内的位置向右滑,可打开工作区抽屉。向左滑或点击抽屉外可收起。系统返回会逐级退出弹窗和菜单。首页使用 Remy 现有形象和底部输入区,沿用共享对话的 `/clear` 确认行为。
- 页面背景延伸到状态栏和导航栏。Android 将安全区和键盘状态交给共享界面,并按需申请麦克风权限。WebView 通过共享客户端直接消费流式回复和会话订阅。
## 构建与验收
从仓库根目录安装依赖。使用 Node.js 22.13+、JDK 17+、Android SDK Platform 37.2 和 Build Tools 36.0.0。设置 `JAVA_HOME` 和 `ANDROID_HOME`,并将 Android SDK 的 `platform-tools` 加入 `PATH`。
```bash
npm ci --prefix reme_studio
cd reme_studio/mobile/android
./gradlew :app:assembleDebug :app:lintDebug
```
Gradle 会构建 Android 和 iOS 共用的 `reme_studio/mobile` 入口,并将 Workbench 打包进 APK。调试 APK 位于 `app/build/outputs/apk/debug/app-debug.apk`,使用开发设备的调试密钥签名,可直接安装。 [iOS 开发文档](../ios/README.md)
在 Mac 上启动 ReMe 服务,或使用已经运行在 `2333` 上的服务。需要模型回复时,按 `proactive` 配置设置后端供应商凭据。
```bash
reme start config=proactive
```
启动 Android 模拟器,在另一个终端从 `reme_studio/mobile/android` 安装并运行。`adb reverse` 把 Android 的环回端口 `2333` 转发到 Mac 的同一个端口。连接多台设备时,用 `adb -s <设备序列号>` 选择目标。
```bash
adb reverse tcp:2333 tcp:2333
adb install -r app/build/outputs/apk/debug/app-debug.apk
adb shell am start -n io.agentscope.reme.studio/.MainActivity
```
启动后在「设置 → 通用」确认服务显示「已连接」。验收也覆盖重启后自动连接、流式对话、`/clear`、任务侧栏、随记、知识库、Android 返回和软键盘。
平台参考见 [Android Gradle Plugin](https://developer.android.com/build/releases/about-agp) 和 [WebViewAssetLoader](https://developer.android.com/develop/ui/views/layout/webapps/load-local-content)。