Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ On Linux desktop builds, install the WebKitGTK development package before config

Permission modes live in `src/permissions.hpp`: `Default` (prompt writes/exec), `AcceptEdits` (auto-allow file writes, still prompt shell), `Yolo` (auto-allow tools), and `Plan` (explore / write only the active plan file). Memory writes stay path-locked even under broader modes. Non-loopback `--dangerous` is rejected.

Other shared subsystems that are easy to miss: `src/gitinfo/` (prompt + REST git snapshots), `src/hooks/` (Codex-compatible lifecycle hooks), `src/web/pty/` (console dock; `/api/pty` and `/ws/pty` are loopback-only), `src/loop/` (scheduled loop tasks), `src/experts/`, and `src/remote_control/`.
Other shared subsystems that are easy to miss: `src/gitinfo/` (prompt + REST git snapshots), `src/hooks/` (Codex-compatible lifecycle hooks), `src/pty/` (console dock, formerly the `web/pty/` subdirectory; `/api/pty` and `/ws/pty` are loopback-only), `src/loop/` (scheduled loop tasks), `src/experts/`, and `src/remote_control/`.

## Test And Build Structure

Expand Down
20 changes: 10 additions & 10 deletions CLAUDE.md

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
set(ACECODE_WEB_DIST "${CMAKE_SOURCE_DIR}/web/dist")
set(ACECODE_WEB_EMBED_DIR "${ACECODE_WEB_DIST}")
if(NOT EXISTS "${ACECODE_WEB_DIST}")
message(WARNING

Check warning on line 108 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / unit-tests (linux-x64)

[acecode] web/dist/ not found — embedding a minimal fallback page. Run
"[acecode] web/dist/ not found — embedding a minimal fallback page. "
"Run `pnpm install && pnpm build` inside web/ before re-configuring for the full UI.")
set(ACECODE_WEB_EMBED_DIR "${CMAKE_BINARY_DIR}/generated/web-dist-fallback")
Expand Down Expand Up @@ -223,26 +223,26 @@
${CMAKE_SOURCE_DIR}/src/config/request_headers.cpp
${CMAKE_SOURCE_DIR}/src/config/saved_models.cpp
${CMAKE_SOURCE_DIR}/src/provider/builtin_model_catalog.cpp
${CMAKE_SOURCE_DIR}/src/daemon/platform_posix.cpp
${CMAKE_SOURCE_DIR}/src/daemon/platform_windows.cpp
${CMAKE_SOURCE_DIR}/src/platform/process/os_process_posix.cpp
${CMAKE_SOURCE_DIR}/src/platform/process/os_process_windows.cpp
${CMAKE_SOURCE_DIR}/src/daemon/runtime_files.cpp
${CMAKE_SOURCE_DIR}/src/desktop/custom_toast.cpp
${CMAKE_SOURCE_DIR}/src/desktop/custom_toast_win.cpp
${CMAKE_SOURCE_DIR}/src/platform/native_ui/custom_toast.cpp
${CMAKE_SOURCE_DIR}/src/platform/native_ui/custom_toast_win.cpp
${CMAKE_SOURCE_DIR}/src/desktop/agent_browser_navigation_state.cpp
${CMAKE_SOURCE_DIR}/src/desktop/agent_browser_page_directory.cpp
${CMAKE_SOURCE_DIR}/src/desktop/agent_browser_runtime.cpp
${CMAKE_SOURCE_DIR}/src/desktop/context_items.cpp
${CMAKE_SOURCE_DIR}/src/desktop/context_picker.cpp
${CMAKE_SOURCE_DIR}/src/desktop/folder_picker_win.cpp
${CMAKE_SOURCE_DIR}/src/desktop/locale.cpp
${CMAKE_SOURCE_DIR}/src/desktop/notifications.cpp
${CMAKE_SOURCE_DIR}/src/platform/native_ui/context_picker.cpp
${CMAKE_SOURCE_DIR}/src/platform/native_ui/folder_picker_win.cpp
${CMAKE_SOURCE_DIR}/src/platform/locale.cpp
${CMAKE_SOURCE_DIR}/src/platform/native_ui/notifications.cpp
${CMAKE_SOURCE_DIR}/src/desktop/open_request.cpp
${CMAKE_SOURCE_DIR}/src/desktop/open_in_explorer.cpp
${CMAKE_SOURCE_DIR}/src/platform/native_ui/open_in_explorer.cpp
${CMAKE_SOURCE_DIR}/src/desktop/startup_progress.cpp
${CMAKE_SOURCE_DIR}/src/desktop/strings.cpp
${CMAKE_SOURCE_DIR}/src/platform/native_ui/strings.cpp
${CMAKE_SOURCE_DIR}/src/desktop/workspace_registry.cpp
${CMAKE_SOURCE_DIR}/src/utils/append_file.cpp
${CMAKE_SOURCE_DIR}/src/utils/clipboard.cpp
${CMAKE_SOURCE_DIR}/src/platform/clipboard.cpp
${CMAKE_SOURCE_DIR}/src/utils/cwd_hash.cpp
${CMAKE_SOURCE_DIR}/src/utils/encoding.cpp
${CMAKE_SOURCE_DIR}/src/utils/model_capabilities.cpp
Expand Down Expand Up @@ -285,8 +285,8 @@
${ACECODE_DESKTOP_WEB_HOST_SOURCE}
)
set(ACECODE_NOTIFICATION_BACKEND_SOURCES
${CMAKE_SOURCE_DIR}/src/desktop/notifications_win.cpp
${CMAKE_SOURCE_DIR}/src/desktop/notifications_stub.cpp
${CMAKE_SOURCE_DIR}/src/platform/native_ui/notifications_win.cpp
${CMAKE_SOURCE_DIR}/src/platform/native_ui/notifications_stub.cpp
)
foreach(_source_list IN ITEMS
ACECODE_NATIVE_BRIDGE_SUPPORT_SOURCES ACECODE_DESKTOP_SUPPORT_SOURCES
Expand Down Expand Up @@ -402,11 +402,11 @@
)
# Windows notifications use the self-drawn layered toast (Win32 + GDI only).
target_sources(acecode_native_bridge_support PRIVATE
${CMAKE_SOURCE_DIR}/src/desktop/notifications_win.cpp
${CMAKE_SOURCE_DIR}/src/platform/native_ui/notifications_win.cpp
)
else()
target_sources(acecode_native_bridge_support PRIVATE
${CMAKE_SOURCE_DIR}/src/desktop/notifications_stub.cpp
${CMAKE_SOURCE_DIR}/src/platform/native_ui/notifications_stub.cpp
)
endif()

Expand Down Expand Up @@ -491,13 +491,13 @@
if(WIN32)
# ws2_32: src/desktop/daemon_supervisor.cpp 用 winsock 探测端口连通性。
# mswsock: standalone Asio IOCP uses AcceptEx/GetAcceptExSockaddrs.
# ole32/shell32/user32: src/desktop/folder_picker_win.cpp 的 COM + IFileOpenDialog + owner/foreground handling。
# ole32/shell32/user32: src/platform/native_ui/folder_picker_win.cpp 的 COM + IFileOpenDialog + owner/foreground handling。
target_link_libraries(acecode_testable PUBLIC bcrypt advapi32 winhttp ws2_32 mswsock iphlpapi ole32 shell32 user32)
# winpty 客户端库(< 1809 的 PTY 兜底,cmake/acecode_winpty.cmake)。
target_link_libraries(acecode_testable PUBLIC winpty_static)
endif()
if(UNIX AND NOT APPLE)
# forkpty(src/web/pty/pty_backend_posix.cpp)。glibc 2.34+ 已并入 libc,
# forkpty(src/pty/pty_backend_posix.cpp)。glibc 2.34+ 已并入 libc,
# 老 glibc / musl 仍需显式链 util;find_library 找不到就交给 libc。
find_library(ACECODE_LIBUTIL util)
if(ACECODE_LIBUTIL)
Expand Down
6 changes: 3 additions & 3 deletions cmake/acecode_source_paths.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(ACECODE_MAIN_SOURCE "${CMAKE_SOURCE_DIR}/src/main.cpp")
set(ACECODE_UPGRADE_MANIFEST_SOURCE "${CMAKE_SOURCE_DIR}/src/upgrade/manifest.cpp")
set(ACECODE_CHANNEL_BRIDGE_SOURCE "${CMAKE_SOURCE_DIR}/src/channels/bridge.cpp")
set(ACECODE_WINPTY_AGENT_LOCATION_SOURCE "${CMAKE_SOURCE_DIR}/src/web/pty/winpty_agent_location.cpp")
set(ACECODE_WINPTY_AGENT_LOCATION_SOURCE "${CMAKE_SOURCE_DIR}/src/pty/winpty_agent_location.cpp")
set(ACECODE_DEEPIN_WINDOW_EFFECTS_SOURCE "${CMAKE_SOURCE_DIR}/src/desktop/deepin_window_effects.cpp")
set(ACECODE_DESKTOP_MAIN_SOURCE "${CMAKE_SOURCE_DIR}/src/desktop/main.cpp")
set(ACECODE_DESKTOP_SPLASH_SOURCE "${CMAKE_SOURCE_DIR}/src/desktop/splash_screen.cpp")
Expand All @@ -29,8 +29,8 @@ set(ACECODE_COMPUTER_USE_MAC_SOURCES
${CMAKE_SOURCE_DIR}/src/computer_use/macos_input.mm
${CMAKE_SOURCE_DIR}/src/computer_use/macos_pointer.mm)
set(ACECODE_NATIVE_BRIDGE_MAC_SOURCES
${CMAKE_SOURCE_DIR}/src/desktop/folder_picker_mac.mm
${CMAKE_SOURCE_DIR}/src/desktop/notifications_mac.mm)
${CMAKE_SOURCE_DIR}/src/platform/native_ui/folder_picker_mac.mm
${CMAKE_SOURCE_DIR}/src/platform/native_ui/notifications_mac.mm)
set(ACECODE_DESKTOP_OBJCXX_SOURCES
${CMAKE_SOURCE_DIR}/src/desktop/tray_icon_win.cpp
${ACECODE_DESKTOP_WEB_HOST_SOURCE})
Expand Down
2 changes: 1 addition & 1 deletion cmake/acecode_winpty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# 与上游的两处刻意偏离:
# 1. 不编译上游 libwinpty/AgentLocation.cc,由
# src/web/pty/winpty_agent_location.cpp 提供同签名 findAgentProgram(),
# src/pty/winpty_agent_location.cpp 提供同签名 findAgentProgram(),
# 支持进程级 agent 路径覆盖(上游硬编码"当前模块同目录",静态链接时
# 即 acecode.exe 同目录 — 安装目录通常不可写,无法释放 agent)。
# 2. WINPTY_API 静态适配:上游只有 dllexport/dllimport 两态。对库与
Expand Down
2 changes: 1 addition & 1 deletion docs/desktop-shell/multi-workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ daemon slot 已启动,并向 daemon `POST /api/workspaces` 注册 cwd,返回同
| `src/desktop/workspace_registry.{hpp,cpp}` | 扫盘 / 读写 `workspace.json` / 默认命名 |
| `src/desktop/daemon_pool.{hpp,cpp}` | 通用进程池;Desktop 当前只使用 `__shared_daemon__/default` slot |
| `src/desktop/daemon_supervisor.{hpp,cpp}` | 单 daemon 子进程托管(spawn / probe / stop / Job Object)。提了 `IDaemonSupervisor` 虚基类便于单测 mock |
| `src/desktop/folder_picker_win.cpp` | `IFileOpenDialog` 包装 |
| `src/platform/native_ui/folder_picker_win.cpp` | `IFileOpenDialog` 包装 |
| `src/desktop/pick_active.{hpp,cpp}` | 启动时挑哪个 workspace 当 active 的纯函数 |
| `src/desktop/web_host.{hpp,cpp}` | webview/webview wrapper,暴露 `bind` / `eval` / `native_window` |
| `src/desktop/main.cpp` | wWinMain 入口,串起所有 |
Expand Down
2 changes: 1 addition & 1 deletion docs/help-source/group6.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
section("update", "更新失败或仍显示旧版",
'''<p>检查更新源是否可访问、磁盘空间是否足够,以及目标程序是否被正在运行的进程锁定。保留错误输出,确认启动路径后按原安装方式重试更新,避免同时维护多个互相覆盖的副本。</p><p>更新命令成功后,重新打开目标应用并核对版本。桌面启动器与配套 daemon 应来自同一套安装包;不要只替换其中一个程序来测试正式安装。</p><p>配置错误触发自动回滚时,先查看回滚提示与备份位置,修复目标字段。卸载通常不等于清除所有个人数据;按<a href="update-uninstall.html">更新与卸载</a>选择是否保留模型和历史。</p>''',
figure("TS-01", "安装或更新错误的有效截图", "截取完整错误文字、目标安装包或版本信息和发生时间;避免只截一个没有上下文的失败图标。"))
], ["src/daemon/cli.cpp", "docs/daemon-api.md", "docs/user-manual.md", "src/desktop/strings.cpp"]),
], ["src/daemon/cli.cpp", "docs/daemon-api.md", "docs/user-manual.md", "src/platform/native_ui/strings.cpp"]),

"troubleshoot-models": page("按服务商、预设、实际端点和错误类别逐项检查,避免把所有失败都归因于模型本身。", [
section("fields", "先核对连接的四项信息",
Expand Down
2 changes: 1 addition & 1 deletion docs/help-source/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@
"src/daemon/cli.cpp",
"docs/daemon-api.md",
"docs/user-manual.md",
"src/desktop/strings.cpp"
"src/platform/native_ui/strings.cpp"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Do not pass opaque values to `tr()` or interpolate them into a source string tha

## Native Desktop strings

Native-only fixed text uses the typed catalog in `src/desktop/strings.hpp` and `strings.cpp`. Add a `DesktopStringId`, add entries at the matching position in both locale arrays, and cover both locales in `tests/desktop`. Session/workspace titles and diagnostic details must remain opaque even when their surrounding native labels are localized.
Native-only fixed text uses the typed catalog in `src/platform/native_ui/strings.hpp` and `strings.cpp`. Add a `DesktopStringId`, add entries at the matching position in both locale arrays, and cover both locales in `tests/platform`. Session/workspace titles and diagnostic details must remain opaque even when their surrounding native labels are localized.

The process-wide native locale is selected before startup UI and updated by `aceDesktop_applyLocale`. The bridge changes presentation state only; the daemon API remains the sole runtime writer of `config.json`.

Expand Down
2 changes: 1 addition & 1 deletion docs/plan/reviews/theme-management-001-web.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ C++ 存储已有独立审查,本报告只读取必要的接口状态依据并
- ZIP 下载在 `routes_themes.cpp:126` 起复用经过校验的作业资源,添加 `application/zip`、UTF-8 百分号编码 attachment 文件名、`private, no-store` 和 `nosniff`,成功后才响应文件。无任意目标路径参数,也不把鉴权凭据放入下载 URL。
- 删除在 `routes_themes.cpp:146` 起先持有 `app_config_mu`,确认该时刻当前主题,仅在需要回退时持久化 blue。save_config 抛出时恢复 `before.web_ui`,把失败交回 store 的隔离回滚;返回的 ui_preferences 取自同一锁下的实际配置。删除非当前主题不替换选择。
- `src/web/routes/routes_misc.cpp:2291` 把 ai/EVA 安装检查放入 config 锁内,再检查 store,和删除采用同样的锁顺序。因此删除后排队到达的旧 ID 写入不能重新持久化已删主题;与 Web 队列的旧快照过滤相互衔接。
- `src/desktop/folder_picker_win.cpp:247` 起按建议文件名 `.zip` 切换单一 ZIP filter/default extension;mac `folder_picker_mac.mm:89` 起切换到 zip,且保留 `allowsOtherFileTypes = NO`。两者其它导出保留原有 Markdown 分支。新增中英文类型/标题/错误枚举与 strings catalog 顺序对应,未改变共享保存接口的路径来源。
- `src/platform/native_ui/folder_picker_win.cpp:247` 起按建议文件名 `.zip` 切换单一 ZIP filter/default extension;mac `folder_picker_mac.mm:89` 起切换到 zip,且保留 `allowsOtherFileTypes = NO`。两者其它导出保留原有 Markdown 分支。新增中英文类型/标题/错误枚举与 strings catalog 顺序对应,未改变共享保存接口的路径来源。
- `cleanup_pending:true` 和新的 `cleanup_message` 描述提交后的隔离缓存清理延迟。Web 以 deleted 为成功依据并显示本地化待清理提示,不会因该附加字段恢复卡片。

独立读取 `build/theme-export-tests-20260912.xml` 和 `.log`:60 项全部通过,0 failure/error/skipped/disabled;其中 4 个新增真实 HTTP 用例覆盖内置保护、注入 destination 拒绝、原生能力缺失、鉴权 ZIP 头、取消选择不打包、原生保存、删除当前主题持久化 blue、旧偏好写入拒绝、配置写入失败后的文件/偏好回滚。另有 DesktopStrings 的完整 catalog 和 ZIP 文案断言通过。本复核未重复运行这 60 项。
Expand Down
8 changes: 4 additions & 4 deletions docs/string-utilities-refactor.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
| 各自直接调 Win32 转换 API(`MultiByteToWideChar` / `WideCharToMultiByte`)的文件 | 9 个 |
| 绕过入口、直接把 `.string()` 交给 C 接口的残留 | 本次修掉 2 处,apply/main 仍有少量 |

9 个直接调 Win32 转换的文件:`daemon/service_win.cpp`、`desktop/context_picker.cpp`、
`desktop/folder_picker_win.cpp`、`desktop/splash_screen.cpp`、
9 个直接调 Win32 转换的文件:`daemon/service_win.cpp`、`platform/native_ui/context_picker.cpp`、
`platform/native_ui/folder_picker_win.cpp`、`desktop/splash_screen.cpp`、
`network/proxy_resolver_win.cpp`、`utils/cwd_hash.cpp`、`utils/encoding.cpp`、
`utils/terminal_title.cpp`、`utils/text_file_buffer.cpp`。
`platform/terminal/terminal_title.cpp`、`utils/text_file_buffer.cpp`。

### 第二层:基础字符串处理

Expand Down Expand Up @@ -150,7 +150,7 @@ code review 规则,而不是假装正则能全覆盖。
业务特例,强行收敛只会让它更难读。
- **不做 `string_view` 全面改造** —— 改动面大、收益小,不在本次范围内。
- **不做文案集中 / i18n** —— 那是另一条线:C++ 侧有 750 处硬编码中文,而
`src/desktop/strings.cpp` 已有成熟机制(enum ID + zh-CN/en-US 双目录 +
`src/platform/native_ui/strings.cpp` 已有成熟机制(enum ID + zh-CN/en-US 双目录 +
`static_assert` 等长 + locale 解析与运行时切换),覆盖 52 条。若要做,方向是把
desktop 那套提升为全局 `acecode::strings`,而不是新造。参见
[localization.md](localization.md)。
Expand Down
Loading
Loading