feat(desktop): redirect writable data to ~/.cow for packaged app

Introduce get_data_root() driven by the COW_DATA_DIR env var so the
packaged desktop build stores config.json, run.log, user data and
WeChat credentials under ~/.cow — surviving app updates and keeping the
app bundle read-only. Source deployments leave COW_DATA_DIR unset and
fall back to the repo root, so existing behavior is unchanged.
This commit is contained in:
zhayujie
2026-06-23 17:22:53 +08:00
parent 215ed24401
commit ec4c36f450
11 changed files with 223 additions and 79 deletions

View File

@@ -52,18 +52,8 @@
],
"extraResources": [
{
"from": "../",
"to": "backend",
"filter": [
"**/*",
"!desktop/**",
"!.git/**",
"!__pycache__/**",
"!**/__pycache__/**",
"!*.pyc",
"!run.log",
"!workspace/**"
]
"from": "build/dist/cowagent-backend",
"to": "backend/cowagent-backend"
}
],
"mac": {
@@ -73,7 +63,7 @@
{
"target": "dmg",
"arch": [
"universal"
"arm64"
]
}
]