Commit Graph

103 Commits

Author SHA1 Message Date
8d1ebf02e3 refactor: use OnceLock for log dedup statics in processor.rs 2026-03-31 23:41:10 +08:00
98d827f5c3 refactor: introduce plugin_ids constants, replace hardcoded plugin ID strings 2026-03-31 23:40:23 +08:00
c8dece351c fix(security): sanitize filename in Content-Disposition header to prevent injection 2026-03-31 23:39:20 +08:00
fbe064253c perf: inline WiFi connect/hotspot args to eliminate Vec<String> allocation 2026-03-31 23:38:57 +08:00
2507629b4c refactor: derive PartialEq for PlayerStatusData, simplify status_changed() 2026-03-31 23:38:13 +08:00
96a170f719 fix: remove double semicolon in wifi ap_stop() 2026-03-31 23:37:48 +08:00
8952bb14d2 chore: update .gitignore and remove .claude/ from tracking
- Add .claude/ to .gitignore (Claude worktree artifacts)
- Add editor swap/backup file patterns (*.swp, *.swo, *~)
- Remove accidentally tracked .claude/worktrees/ from git index
2026-03-31 23:29:49 +08:00
566cfd0cbc fix(security): fix percent_decode to handle multi-byte UTF-8 properly
The previous implementation decoded percent-encoded bytes one at a time
and cast each to char, which produces invalid characters for multi-byte
UTF-8 sequences (e.g. Chinese filenames). Fixed to accumulate raw bytes
first and convert to String at the end with proper UTF-8 validation.
2026-03-31 23:29:00 +08:00
a8108cea9d fix: add random_loop_range validation in VideoItem
- Validate that random_loop_range values are positive
- Validate that min <= max in random_loop_range
- Prevents invalid config from causing runtime panics in rand::gen_range
2026-03-31 23:28:03 +08:00
758dead601 refactor: clean up unused binding and simplify Mutex patterns
- plugin_loader.rs: remove unused _plugin_id binding in discover_plugins
- http/mod.rs: simplify config() and player_status() Mutex access patterns
2026-03-31 23:27:26 +08:00
e112b2e8b7 chore: add Cargo.toml metadata (description, license, rust-version)
- All crates: rust-version = 1.70, license = MIT
- Root + example-plugin: publish = false (not intended for crates.io)
- plugin-sdk: proper description for potential future publication
2026-03-31 23:26:17 +08:00
d040f51cb2 fix: improve error handling and code robustness
- state_machine.rs: if-let replaces is_some()+take().unwrap()
- state_machine.rs: expect() replaces unwrap() with invariant docs
- wifi/mod.rs: send_result uses self.id() instead of hardcoded string
2026-03-31 23:25:47 +08:00
b570362546 perf: 减少 WiFi 模块不必要的 String 分配
- run_nmcli: 改为泛型 &[impl AsRef<OsStr>],直接接受 &[&str]
- 移除 nmcli_args() 中间函数,消除每次 nmcli 调用的 Vec<String> 分配
- build_connect_args/build_hotspot_args: 使用 array.into_iter() (Rust 2021)
2026-03-31 23:24:50 +08:00
1bf9e055e0 refactor: 补全 Default trait + 简化 Rust 2021 惯用写法
- LinuxArm64Backend: 添加 Default impl(与其他插件保持一致)
- version_manager.rs: [active, stable].into_iter() 替换 IntoIterator::into_iter()
  (Rust 2021 edition 原生支持数组 IntoIterator)
2026-03-31 23:23:30 +08:00
d48a1cf88b fix: 使用 CARGO_PKG_VERSION 替换硬编码版本号
- routes.rs: AppInfoResponse.version 使用 env!(CARGO_PKG_VERSION)
- device/mod.rs: DevicePlugin PluginInfo.version 使用 env!(CARGO_PKG_VERSION)

消除版本不一致问题:之前 Cargo.toml 版本为 0.2.0,但代码中硬编码为 0.1.0。
2026-03-31 23:22:32 +08:00
47d6b06ced chore: upgrade Rust edition 2018 2021
- Cargo.toml: edition 2021
- plugin-sdk/Cargo.toml: edition 2021
- plugins/example-plugin/Cargo.toml: edition 2021

Rust 2021 edition 带来更好的闭包捕获规则、IntoIterator for arrays 等改进。
2026-03-31 23:21:57 +08:00
showen
d30c111c71 feat: M1.1 完成 + M1.2 启动 — 全量更新
M1.1 收尾:
- 24项 P0/P1/P2 bug 修复 (Rust 107 tests + Flutter 15 tests)
- Flutter App v0.3: cupertino_icons 修复, 单元测试, 调试面板, APK 52.6MB
- 示例插件完善: manifest.json + 请求/响应示范 + 7个测试
- API 文档重写 (以 routes.rs 为唯一权威)
- MILESTONES.md 更新至 100%

M1.2 启动:
- P0: 插件管理 API 闭环 (handle_manager_message Custom 分支 + broadcast_plugin_states)
- ServiceManager 集成测试 8/8 (tests/m1_2_service_manager.rs)
- M1.2 测试计划 (docs/M1.2_TEST_PLAN.md, 18个E2E场景)
- 动态插件系统: auto_rollback + version_manager GC + 路径穿越防护

总计: Rust 115/115 测试, Flutter 15/15 测试, 零 warning

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 18:12:42 +08:00
showen
8ed9cb2d9d feat: Flutter APK 编译成功 + Gradle 配置修复 + APK 下载部署 + 待优化清单
- 通过 qemu-user-static 实现 ARM64 主机编译 Android APK (51MB)
- 修复 Gradle: Aliyun 镜像 + PREFER_SETTINGS + JVM 内存 1536M
- 部署 APK 到 configs/downloads/, Web 下载接口已验证 (HTTP 200)
- 新增 Flutter TODO.md: 10项待优化 (P0/P1/P2 分级)
- 新增 pm_soul.md, 更新 routes.rs APK 下载路由

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 06:43:55 +08:00
showen
bff9ec535d feat: Flutter 客户端 App + Web UI APK 下载入口
- 新增 Flutter 跨平台客户端项目 (clients/flutter/)
  - 29 个 Dart 文件: 服务层/状态管理/5个页面/BLE配网
  - BLE 蓝牙配网: 扫描设备、写入WiFi凭据、配网状态监听
  - HTTP API 客户端: 覆盖全部端点 (播放/场景/WiFi/视频/配置/文件/插件)
  - WebSocket 实时通信: 事件流 + 自动重连
  - 暗色主题 Material 3 UI, 中文界面
  - Android 配置: minSdkVersion 21, BLE/网络权限
  - PRD 产品需求文档 + 开发任务看板
- Web UI 添加 APK 下载入口 (routes.rs)
  - 下载弹窗 + 二维码 + /download/{filename} 静态文件路由
- BLE 插件增加自动重连循环 (ble/mod.rs)
- BLE 默认设备名修正为 'Showen' (config.rs)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 02:09:52 +08:00
showen
d4f0eb7eca fix: 触发器响应优化 — pending trigger 在当前step结束后立即触发
修复网页触发器点击后无响应的问题。原因是 defer_triggers 模式下,
pending trigger 必须等待整个 sequence 播完才触发,当 step 有
random_loop_range [2,15] 时用户可能要等几分钟。
现在改为当前 step 循环结束后立即检查并执行 pending trigger。

同时添加 systemd service 脚本。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 13:08:10 +08:00
showen
29645d711d fix: 注册DevicePlugin到main.rs — 修复防息屏/光标功能失效(P0)
ScreenPlugin重构为thin wrapper后main.rs未注册DevicePlugin,
导致DeviceCommand消息无接收者。现在DevicePlugin在Screen之前注册。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 12:42:51 +08:00
showen
3729addb71 docs: DevicePlugin阶段二 Task5 — 文档更新与迁移总结
- 更新 DEVICE_PLUGIN_DESIGN.md: 阶段二标记完成+验收项勾选+成果章节
- 新建 src/plugins/device/README.md: 完整DevicePlugin文档
- 新建 docs/SCREEN_PLUGIN_MIGRATION_SUMMARY.md: 迁移总结
- 更新 li-siqi soul + TEAM_CHAT 汇报

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 12:39:25 +08:00
showen
29b00188cc docs: DevicePlugin阶段二完成 — PROGRESS更新(77测试) + CEO soul更新 2026-03-13 07:49:28 +08:00
showen
be08c63181 test: Phase2 Task4 — 新增4个光标控制测试 总计77测试通过 2026-03-13 07:47:32 +08:00
showen
bf41c4513f refactor: Phase2 Task3 — ScreenPlugin重构为thin wrapper(通过DeviceCommand转发) 2026-03-13 07:40:06 +08:00
showen
5310a92633 feat: Phase2 Task2 — LinuxArm64Backend添加光标控制(unclutter) 2026-03-13 07:32:00 +08:00
showen
f0605196fe feat: Phase2 Task1 — DeviceCommand添加SetCursorVisible + DeviceCapability::Cursor 2026-03-13 07:14:44 +08:00
showen
28566386d2 docs: DevicePlugin阶段二规划 + PM汇报 + CEO批准 2026-03-13 07:07:05 +08:00
showen
48d1eeb7c4 feat: plugin-sdk同步Device类型 + example-plugin适配新Message变体 2026-03-13 06:58:28 +08:00
showen
2c14f5f04c docs: DevicePlugin阶段一完成 — PROGRESS更新(73测试) + CEO soul更新 2026-03-13 06:50:45 +08:00
showen
1827310dca feat: DevicePlugin Task4 — 7个集成测试(MockBackend+序列化) 总计73测试通过 2026-03-13 06:48:36 +08:00
showen
05235f5686 feat: DevicePlugin Task3 — Linux ARM64 Backend(Display/SleepInhibit/Backlight) 2026-03-13 06:38:43 +08:00
showen
584f65b9f5 feat: DevicePlugin Task2 — DevicePlugin骨架 + DeviceBackend trait + 模块注册 2026-03-13 06:32:14 +08:00
showen
4d1b830563 feat: DevicePlugin Task1 — Message enum扩展(DeviceCommand/Response/Event + 7个辅助类型) 2026-03-13 06:22:53 +08:00
showen
f83e18d43b docs: DevicePlugin阶段一任务分解 + PM soul更新 2026-03-13 06:12:39 +08:00
showen
e41c70a565 docs: DevicePlugin设计文档 + PM inbox派发任务 2026-03-13 06:08:57 +08:00
showen
7e47a52666 docs: CEO soul更新 — 66测试/组织升级状态/待处理事项 2026-03-13 06:07:06 +08:00
showen
db4843714f docs: 组织升级 — 公司统一规范 + inbox消息系统 + PM个人逻辑 2026-03-13 06:06:15 +08:00
showen
a1336292d4 docs: README/PROGRESS硬件描述修正 + CEO soul更新 + 产品soul更新 2026-03-13 05:56:36 +08:00
showen
086b4600eb test+docs: 新增4个测试(66总计) + SDK API文档 + 员工soul更新 2026-03-13 05:52:26 +08:00
showen
f764f27d77 docs: PROGRESS更新 — 62测试, P0全清 2026-03-13 05:23:24 +08:00
showen
a1cb42a5b7 docs: 员工soul文件更新 — 张明远/王浩然/李思琪个人经验记录 2026-03-13 05:20:50 +08:00
showen
494628f336 docs: CEO经验更新 — 个人/团队经验分离, P0全清, 62测试 2026-03-13 05:18:30 +08:00
showen
6067c3f0a2 fix: 修复3个P0遗留 — AutoRollback回退/ConfigReloaded序列化/FfiString跨allocator 2026-03-13 05:15:04 +08:00
showen
1264b94e36 refactor: 整理项目文件夹 + 更新状态文件 + CEO soul更新 2026-03-13 04:52:47 +08:00
showen
becd200150 refactor: 整理项目文件夹结构 + 更新项目状态
- docs/: 团队流程文档 (10个md)
- .showen/: 管理状态文件 (CEO_BACKUP, RECOVERY, TEAM_CHAT, CEO_LOOP)
- 根目录只保留 README.md + PROGRESS.md
- 更新 RECOVERY.md/CEO_BACKUP.md/PROGRESS.md 反映自测机制完成
- 更新 souls/liu-jianguo.md 当前状态
2026-03-13 04:45:35 +08:00
showen
99ee78984c feat: 插件自动挂载测试机制 — capabilities + self_test + 3阶段启动
- Plugin trait 增加 capabilities() 和 self_test() 方法
- PluginVTable 增加 get_capabilities 和 self_test FFI
- ServiceManager 三阶段启动: init → self_test → start
- SendCallback 改为 ctx 参数传递,消除 thread_local
- export_plugin! 宏所有 FFI 函数包裹 catch_unwind
- PluginManifest 增加 capabilities/required_capabilities/auto_test
- 新增 3 个自测相关测试用例 (共 59 测试)
2026-03-13 04:31:39 +08:00
showen
1863efb0f5 fix: 修正 souls/README.md 团队成员信息
准确列出所有成员姓名、角色和使用的模型,补充管理架构说明。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 03:41:18 +08:00
showen
7135f28545 feat: 实现动态插件系统 (6阶段完成)
- 阶段1: 消息类型序列化 (Serialize/Deserialize, &'static str → String)
- 阶段2: FFI 边界类型 + Plugin SDK (plugin_abi, showen-plugin-sdk crate)
- 阶段3: PluginLoader + DynamicPlugin (libloading 动态加载 .so)
- 阶段4: 版本管理 + 错误策略 (VersionManager, PluginState, 自动回退)
- 阶段5: 远程仓库客户端 (HTTP 下载 + tar.gz 安装)
- 阶段6: 示例插件 + HTTP 管理 API + 全目录 README 文档

54/54 测试通过,0 warnings。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 03:38:08 +08:00
showen
5dcc1ad98e fix: 修正配置文件视频相对路径 + 更新 M1.1 完成进度
- configs/*.json: 视频路径 ../ → ../../ (configs/ 子目录需多上一级)
- PROGRESS.md: 第四轮 Opus 团队任务全部标记完成,M1.1 标记完成
- 实机验证: 5 插件初始化正常,HTTP API 响应正常,配置验证通过

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 13:26:05 +08:00