Merge branch 'main' into ci/vault-secrets-per-platform-release
This commit is contained in:
commit
ff601209f2
15
.env.example
Normal file
15
.env.example
Normal file
@ -0,0 +1,15 @@
|
||||
# 评审 / 测试凭据模板 —— 复制为本地 `.env`(已被 .gitignore 忽略)后填入真实值。
|
||||
# 切勿把真实密码 / Token 写进任何被 git 跟踪的文件、日志或截图。
|
||||
# 用法:set -a; source .env; set +a
|
||||
|
||||
# --- svc.plus 只读评审账号 ---
|
||||
REVIEW_ACCOUNT_BASE_URL=https://accounts.svc.plus
|
||||
REVIEW_ACCOUNT_LOGIN_EMAIL=review@svc.plus
|
||||
REVIEW_ACCOUNT_LOGIN_PASSWORD=
|
||||
|
||||
# --- xworkmate-bridge ---
|
||||
BRIDGE_SERVER_URL=https://xworkmate-bridge.svc.plus
|
||||
# 组合 1:标准 bridge token
|
||||
BRIDGE_AUTH_TOKEN=
|
||||
# 组合 2:评审专用 bridge token
|
||||
BRIDGE_REVIEW_AUTH_TOKEN=
|
||||
6
.github/workflows/build-and-release.yml
vendored
6
.github/workflows/build-and-release.yml
vendored
@ -178,11 +178,6 @@ jobs:
|
||||
kv/data/github-actions/xworkmate-app APPLE_KEYCHAIN_PASSWORD | APPLE_KEYCHAIN_PASSWORD ;
|
||||
kv/data/github-actions/xworkmate-app APPLE_EXPORT_METHOD | APPLE_EXPORT_METHOD
|
||||
|
||||
# App Store Connect keys (APP_STORE_CONNECT_*) are intentionally NOT loaded
|
||||
# here: only scripts/ci/testflight_upload.sh consumes them, and that runs in
|
||||
# the release job (which loads them on its own). Keeping them out means the
|
||||
# build matrix never depends on them.
|
||||
|
||||
- name: Load Vault secrets (Windows)
|
||||
id: vault_windows
|
||||
if: ${{ matrix.platform == 'windows' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
|
||||
@ -222,7 +217,6 @@ jobs:
|
||||
echo "APPLE_CERT_P12_BASE64=${{ steps.vault_apple.outputs.APPLE_CERT_P12_BASE64 }}"
|
||||
echo "APPLE_CERT_PASSWORD=${{ steps.vault_apple.outputs.APPLE_CERT_PASSWORD }}"
|
||||
echo "APPLE_PROVISION_PROFILE_BASE64=${{ steps.vault_apple.outputs.APPLE_PROVISION_PROFILE_BASE64 }}"
|
||||
echo "APPLE_MAC_PROVISION_PROFILE_BASE64=${{ steps.vault_apple.outputs.APPLE_MAC_PROVISION_PROFILE_BASE64 }}"
|
||||
echo "APPLE_KEYCHAIN_PASSWORD=${{ steps.vault_apple.outputs.APPLE_KEYCHAIN_PASSWORD }}"
|
||||
echo "APPLE_EXPORT_METHOD=${{ steps.vault_apple.outputs.APPLE_EXPORT_METHOD }}"
|
||||
echo "WINDOWS_PFX_BASE64=${{ steps.vault_windows.outputs.WINDOWS_PFX_BASE64 }}"
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,5 +1,10 @@
|
||||
# Miscellaneous
|
||||
# Secrets / local env — never commit real credentials. .env.example is the tracked template.
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
*.local.env
|
||||
secrets.env
|
||||
.playwright-mcp/
|
||||
*.py
|
||||
null/
|
||||
|
||||
@ -51,6 +51,12 @@ flutter build macos
|
||||
make build-macos
|
||||
```
|
||||
|
||||
For a one-line install from the latest GitHub release:
|
||||
|
||||
```bash
|
||||
curl -sfL https://install.svc.plus/xworkmate-app | bash -
|
||||
```
|
||||
|
||||
## Downloads
|
||||
|
||||
| Platform | Download |
|
||||
|
||||
@ -423,3 +423,11 @@ curl -sS -X POST http://127.0.0.1:8787/acp/rpc \
|
||||
3. **超时同源不可漂移**:入口 `xworkmate_bridge_acp_stream_timeout` 与 bridge `openClawAgentWaitMaxTimeout` 已分两侧定义,建议在 validate/CI 加一条「入口 ≥ bridge + 余量」的交叉断言,防未来单侧改值再漂移。
|
||||
4. **S1 重做前先补测**:先写「有 expectedArtifactDirs 但 run 无产物」与「agent 写产物到 workspace 根」两类对照 E2E,再改实现,避免重蹈 `0280893` 回退。
|
||||
5. **`/api/ping.metrics` 接告警**:`gatewaySocketClosed`/`taskGetUnconfirmedFallback`/`runDeadlineInterrupt` 三计数接监控,使「不稳定」可被观测而非靠用户截图。
|
||||
|
||||
### 9.5 本次验收摘要
|
||||
|
||||
这次 case 的结论可以压缩成三句话:
|
||||
|
||||
1. 不是 `LiteLLM` 余量问题,而是 gateway-turn 的契约链路里,插件加载、运行态快照和结果回传先后顺序出了偏差。
|
||||
2. `openclaw-multi-session-plugins` 稳定加载后,`xworkmate.tasks.get` 能回到可持续轮询的终态语义,`GoTaskService 没有返回可显示的输出。` 也随之恢复为可显示结果。
|
||||
3. 当前验收标准是:任务能完成、能产出 `.md`、`tasks.get` 能返回 `completed + durable output + artifacts`,并且 App 不再把 undecorated `running` 快照误判成空终态。
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
|
||||
- [核心功能集成测试手动 Case](./core-integration-manual-cases.md)
|
||||
- [云端账号与 XWorkmate Bridge 连接手动 Case](./cloud-account-and-bridge-manual-cases.md)
|
||||
- [手动 Bridge 登录状态误判 Case](./manual-bridge-login-state/README.md)
|
||||
- [云原生 Service Mesh 网络科普视频调研场景测试用例](./service-mesh-evolution-video-scenario/README.md)
|
||||
- [OpenClaw Gateway 5 并发 E2E 回归场景](./openclaw-gateway-e2e-regression/README.md)
|
||||
|
||||
|
||||
@ -4,6 +4,10 @@
|
||||
|
||||
## 1. 测试账号与连接参数
|
||||
|
||||
> **凭据注入约定(必读)**:本文档**不保存任何明文密码或 Token**。所有 secret 从本地 `.env`
|
||||
> (已 gitignore)或 secret store 注入,变量名见仓库根目录 `.env.example`。执行用例前先
|
||||
> `set -a; source .env; set +a`,下表只记录变量名与非敏感的端点信息。
|
||||
|
||||
### 1.1 云端账号
|
||||
|
||||
| 项目 | 内容 |
|
||||
@ -11,28 +15,28 @@
|
||||
| 账号类型 | 只读评审账号(Apple 审核专用) |
|
||||
| 服务地址 | `https://accounts.svc.plus` |
|
||||
| 邮箱 / 账号 | `review@svc.plus` |
|
||||
| 密码 | `***REMOVED-CREDENTIAL***` |
|
||||
| 密码 | 见 `.env`:`$REVIEW_ACCOUNT_LOGIN_PASSWORD`(勿写明文) |
|
||||
|
||||
### 1.2 公网 xworkmate-bridge 组合 1
|
||||
|
||||
| 环境变量 | 值 |
|
||||
|----------|----|
|
||||
| `BRIDGE_SERVER_URL` | `https://xworkmate-bridge.svc.plus` |
|
||||
| `BRIDGE_AUTH_TOKEN` | `***REMOVED-CREDENTIAL***` |
|
||||
| `BRIDGE_AUTH_TOKEN` | 见 `.env`:`$BRIDGE_AUTH_TOKEN`(勿写明文) |
|
||||
|
||||
### 1.3 公网 xworkmate-bridge 组合 2
|
||||
|
||||
| 环境变量 | 值 |
|
||||
|----------|----|
|
||||
| `BRIDGE_SERVER_URL` | `https://xworkmate-bridge.svc.plus` |
|
||||
| `BRIDGE_REVIEW_AUTH_TOKEN` | `***REMOVED-CREDENTIAL***` |
|
||||
| `BRIDGE_REVIEW_AUTH_TOKEN` | 见 `.env`:`$BRIDGE_REVIEW_AUTH_TOKEN`(勿写明文) |
|
||||
|
||||
### 1.4 本地 xworkmate-bridge
|
||||
|
||||
| 环境变量 | 值 |
|
||||
|----------|----|
|
||||
| `BRIDGE_SERVER_URL` | `http://127.0.0.1:8787` |
|
||||
| `BRIDGE_AUTH_TOKEN` | `***REMOVED-CREDENTIAL***` |
|
||||
| `BRIDGE_AUTH_TOKEN` | 见 `.env`:`$BRIDGE_AUTH_TOKEN`(勿写明文) |
|
||||
|
||||
---
|
||||
|
||||
@ -185,7 +189,7 @@
|
||||
2. 切换到 `svc.plus 云端同步`
|
||||
3. 在 `服务地址` 输入 `https://accounts.svc.plus`
|
||||
4. 在 `邮箱或账号` 输入 `review@svc.plus`
|
||||
5. 在 `密码` 输入 `***REMOVED-CREDENTIAL***`
|
||||
5. 在 `密码` 输入 `$REVIEW_ACCOUNT_LOGIN_PASSWORD`(从 `.env` 读取,勿写明文)
|
||||
6. 点击 `登录`
|
||||
7. 等待账号同步完成
|
||||
- 期望结果
|
||||
@ -208,7 +212,7 @@
|
||||
1. 在设置页退出当前账号
|
||||
2. 关闭或返回设置页
|
||||
3. 再次进入 `Settings -> Integrations -> svc.plus 云端同步`
|
||||
4. 使用 `review@svc.plus` / `***REMOVED-CREDENTIAL***` 重新登录
|
||||
4. 使用 `review@svc.plus` / `$REVIEW_ACCOUNT_LOGIN_PASSWORD`(从 `.env` 读取)重新登录
|
||||
5. 观察同步状态与本地配置状态
|
||||
- 期望结果
|
||||
- 退出后不会继续显示已登录状态
|
||||
@ -256,7 +260,7 @@
|
||||
1. 打开 `Settings -> Integrations`
|
||||
2. 切换到 `AI 智能体工作空间`
|
||||
3. 在 `Bridge 地址` 输入 `https://xworkmate-bridge.svc.plus`
|
||||
4. 在 `鉴权令牌 (TOKEN)` 输入 `***REMOVED-CREDENTIAL***`
|
||||
4. 在 `鉴权令牌 (TOKEN)` 输入 `$BRIDGE_AUTH_TOKEN`(从 `.env` 读取,勿写明文)
|
||||
5. 点击 `保存配置`
|
||||
6. 重新进入设置页确认配置仍然存在
|
||||
7. 发起一次需要 AI 智能体工作空间的任务,确认可建立连接
|
||||
@ -280,7 +284,7 @@
|
||||
- 操作步骤
|
||||
1. 打开 `Settings -> Integrations -> AI 智能体工作空间`
|
||||
2. 在 `Bridge 地址` 输入 `https://xworkmate-bridge.svc.plus`
|
||||
3. 在 `鉴权令牌 (TOKEN)` 输入 `***REMOVED-CREDENTIAL***`
|
||||
3. 在 `鉴权令牌 (TOKEN)` 输入 `$BRIDGE_REVIEW_AUTH_TOKEN`(从 `.env` 读取,勿写明文)
|
||||
4. 点击 `保存配置`
|
||||
5. 重新进入设置页确认配置稳定
|
||||
6. 发起一次 AI 智能体工作空间任务
|
||||
@ -353,7 +357,7 @@
|
||||
- 操作步骤
|
||||
1. 打开 `Settings -> Integrations -> AI 智能体工作空间`
|
||||
2. 在 `Bridge 地址` 输入 `http://127.0.0.1:8787`
|
||||
3. 在 `鉴权令牌 (TOKEN)` 输入 `***REMOVED-CREDENTIAL***`
|
||||
3. 在 `鉴权令牌 (TOKEN)` 输入 `$BRIDGE_AUTH_TOKEN`(从 `.env` 读取,勿写明文)
|
||||
4. 点击 `保存配置`
|
||||
5. 发起一次 AI 智能体工作空间任务
|
||||
6. 对照本地 bridge 日志确认请求到达
|
||||
@ -486,4 +490,5 @@
|
||||
| 公网 bridge 组合 2 | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| 本地 bridge | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
|
||||
> 注意:以上 token 为评审 / 测试用途。执行测试时不得将 token 明文贴入公开 issue、公开日志或截图备注。
|
||||
> 注意:以上密码 / token 均为评审 / 测试用途,仅从 `.env`(已 gitignore)或 secret store 注入,
|
||||
> **禁止**明文写入本文档、git 历史、公开 issue、公开日志或截图备注。一旦发生明文泄漏,先**轮换凭据**,再清理。
|
||||
|
||||
168
docs/cases/manual-bridge-login-state/README.md
Normal file
168
docs/cases/manual-bridge-login-state/README.md
Normal file
@ -0,0 +1,168 @@
|
||||
# 手动 Bridge 登录状态误判 Case
|
||||
|
||||
## 目标
|
||||
|
||||
验证用户未登录 `svc.plus`、但已经保存有效手动 Bridge 配置时,任务线程应使用手动 Bridge,不应显示“请先登录 svc.plus”或因此阻止发送消息。
|
||||
|
||||
## 当前状态
|
||||
|
||||
- 状态:已定位并完成最小修复,待设计评估和 UI 手动验收。
|
||||
- 影响范围:桌面端任务线程连接状态、顶部连接标签、发送消息前的连接守卫。
|
||||
- 不涉及:账号登录协议、Token 存储格式、Bridge ACP 请求协议。
|
||||
|
||||
## 问题现象
|
||||
|
||||
1. 在 `Settings -> Integrations` 选择“手动 Bridge”。
|
||||
2. 填写 Bridge URL 和 Token 并保存。
|
||||
3. 设置页显示“手动 Bridge / 已保存”。
|
||||
4. 返回任务线程后,顶部仍显示“已退出登录 · 请先登录 svc.plus”。
|
||||
5. 发送消息时同样被“请先登录 svc.plus”拦截。
|
||||
|
||||
## 根因
|
||||
|
||||
`resolveGatewayThreadConnectionStateInternal()` 原先在判断手动 Bridge 是否已配置、是否正在发现能力之前,先检查 `accountSignedIn`:
|
||||
|
||||
```dart
|
||||
if (!accountSignedIn) {
|
||||
return signedOut;
|
||||
}
|
||||
```
|
||||
|
||||
因此在下面这个合法状态中,账号分支错误覆盖了 Bridge 分支:
|
||||
|
||||
```text
|
||||
accountSignedIn = false
|
||||
bridgeConfigured = true
|
||||
bridgeReady = false
|
||||
```
|
||||
|
||||
手动 Bridge 与 `svc.plus` 托管账号是两种独立连接来源。只有没有任何可用 Bridge 配置时,未登录账号才应产生 `请先登录 svc.plus` 提示。
|
||||
|
||||
## 相关调用链
|
||||
|
||||
```text
|
||||
任务线程状态 / 发送消息
|
||||
-> assistantConnectionStateForSession()
|
||||
-> isBridgeAcpRuntimeConfiguredInternal()
|
||||
-> bridgeCapabilityReadyForExecutionTargetInternal()
|
||||
-> resolveGatewayThreadConnectionStateInternal()
|
||||
-> 已连接 / 正在发现 / 连接失败 / 请先登录
|
||||
```
|
||||
|
||||
关键代码:
|
||||
|
||||
| 文件 | 函数 | 职责 |
|
||||
| --- | --- | --- |
|
||||
| `lib/app/app_controller_desktop_thread_sessions.dart` | `assistantConnectionStateForSession()` | 汇总账号、Bridge 配置和 capability 状态。 |
|
||||
| `lib/app/app_controller_desktop_thread_sessions.dart` | `resolveGatewayThreadConnectionStateInternal()` | 生成任务线程最终连接状态和 UI 文案。 |
|
||||
| `lib/app/app_controller_desktop_runtime_helpers.dart` | `resolveBridgeAcpEndpointInternal()` | 在托管和手动配置之间解析 Bridge Endpoint。 |
|
||||
| `lib/app/app_controller_desktop_runtime_helpers.dart` | `isBridgeAcpRuntimeConfiguredInternal()` | 判断当前是否存在可运行的 Bridge 配置。 |
|
||||
| `lib/app/app_controller_desktop_thread_actions.dart` | `dispatchGatewayChatTurnInternal()` | 发送前刷新 capability,并按连接状态决定是否拦截。 |
|
||||
| `lib/runtime/runtime_controllers_settings_account_impl.dart` | `resolveAcpBridgeServerEffectiveConfigInternal()` | 解析当前有效配置来源:cloud、bridge 或 default。 |
|
||||
| `lib/runtime/runtime_controllers_settings_account_impl.dart` | `buildSavedAccountProfileSettingsInternal()` | 校验并保存手动 Bridge URL 和 Token 引用。 |
|
||||
|
||||
## 当前最小修复
|
||||
|
||||
连接状态决策调整为:
|
||||
|
||||
```dart
|
||||
if (!accountSignedIn && !bridgeConfigured) {
|
||||
return signedOut;
|
||||
}
|
||||
```
|
||||
|
||||
账号同步错误只在确实存在账号会话时参与状态决策:
|
||||
|
||||
```dart
|
||||
if (accountSignedIn && (tokenMissing || failed || blocked)) {
|
||||
return accountSyncError;
|
||||
}
|
||||
```
|
||||
|
||||
预期状态矩阵:
|
||||
|
||||
| 账号登录 | Bridge 配置 | Bridge Ready | 预期状态 |
|
||||
| --- | --- | --- | --- |
|
||||
| 否 | 否 | 否 | `已退出登录 / 请先登录 svc.plus` |
|
||||
| 否 | 手动 | 否,尚未发现 | `正在发现 / 正在加载 Bridge 能力...` |
|
||||
| 否 | 手动 | 否,发现失败 | 显示实际 Bridge capability/连接错误 |
|
||||
| 否 | 手动 | 是 | `已连接 / <手动 Bridge Host>` |
|
||||
| 是 | 托管 | 否,Token 缺失 | `缺少令牌 / xworkmate-bridge 授权不可用` |
|
||||
| 是 | 托管 | 是 | `已连接 / xworkmate-bridge.svc.plus` |
|
||||
|
||||
## 自动化覆盖
|
||||
|
||||
测试文件:`test/features/assistant/assistant_connection_status_test.dart`
|
||||
|
||||
新增覆盖:
|
||||
|
||||
- `manual bridge discovery does not require a svc.plus account session`
|
||||
- `manual bridge discovery failure is shown while signed out`
|
||||
|
||||
同时保留原有覆盖,确认没有 Bridge 配置且未登录时仍提示登录。
|
||||
|
||||
已执行:
|
||||
|
||||
```bash
|
||||
flutter test \
|
||||
test/features/assistant/assistant_connection_status_test.dart \
|
||||
test/runtime/assistant_connection_state_test.dart \
|
||||
test/runtime/assistant_execution_target_test.dart
|
||||
```
|
||||
|
||||
结果:`101` 个测试全部通过。
|
||||
|
||||
## 手动验收
|
||||
|
||||
### `MANUAL-BRIDGE-LOGIN-001` 未登录账号使用本地 Bridge
|
||||
|
||||
前置条件:
|
||||
|
||||
- 退出 `svc.plus` 账号。
|
||||
- 本地 Bridge 正常运行。
|
||||
- 准备有效的测试 Token,文档中不记录明文。
|
||||
|
||||
步骤:
|
||||
|
||||
1. 打开 `Settings -> Integrations -> 手动 Bridge`。
|
||||
2. 输入 `http://127.0.0.1:<port>` 和有效 Token。
|
||||
3. 保存并返回任务线程。
|
||||
4. 等待 capability 刷新完成。
|
||||
5. 选择 Gateway/OpenClaw 并发送一条简单消息。
|
||||
|
||||
验收标准:
|
||||
|
||||
- 不显示“请先登录 svc.plus”。
|
||||
- capability 刷新期间显示“正在加载 Bridge 能力...”。
|
||||
- Bridge 可用时显示已连接,并允许发送消息。
|
||||
- Bridge 不可用时显示真实连接错误,不退化为账号登录提示。
|
||||
|
||||
### `MANUAL-BRIDGE-LOGIN-002` 未配置 Bridge 且未登录
|
||||
|
||||
1. 退出账号并清除手动 Bridge 配置。
|
||||
2. 返回任务线程并尝试发送消息。
|
||||
|
||||
验收标准:
|
||||
|
||||
- 继续显示“已退出登录 / 请先登录 svc.plus”。
|
||||
- 不尝试向默认托管 Bridge 发送未授权请求。
|
||||
|
||||
### `MANUAL-BRIDGE-LOGIN-003` 托管账号回归
|
||||
|
||||
1. 清除手动 Bridge 配置。
|
||||
2. 登录 `svc.plus` 并完成托管配置同步。
|
||||
3. 返回任务线程并发送消息。
|
||||
|
||||
验收标准:
|
||||
|
||||
- 托管 Bridge Ready 时正常连接。
|
||||
- Token 缺失或同步 blocked 时继续显示专用账号同步错误。
|
||||
|
||||
## 待设计评估
|
||||
|
||||
1. 是否引入明确的连接来源枚举,例如 `managedCloud`、`manualBridge`、`environment`、`none`,避免通过多个布尔值间接推断。
|
||||
2. 账号退出后 `AccountSyncState` 是否可能残留,以及是否应在状态模型层主动清除。
|
||||
3. 手动 Bridge 和托管 Bridge 同时有效时,当前“托管优先”是否符合产品预期。
|
||||
4. UI 状态和发送守卫是否应统一依赖单一 `BridgeConnectionState`,避免状态分叉。
|
||||
5. 是否增加完整集成测试:保存手动 Bridge -> 未登录账号 -> capability 刷新 -> 成功发送消息。
|
||||
|
||||
@ -34,11 +34,18 @@ Last Updated: 2026-04-22
|
||||
- 可选 `BRIDGE_SERVER_URLS`,用于接口脚本同时验证多个 bridge host
|
||||
- 可选 `REVIEW_ACCOUNT_BASE_URL`
|
||||
|
||||
推荐直接在命令前临时注入:
|
||||
凭据从本地 `.env`(已 gitignore)或 secret store 注入,**不要把明文密码/Token 写进文档或命令历史**。先准备 `.env`(参考仓库根目录 `.env.example`),再 `source` 后运行:
|
||||
|
||||
```bash
|
||||
REVIEW_ACCOUNT_LOGIN_PASSWORD='***REMOVED-CREDENTIAL***' \
|
||||
BRIDGE_AUTH_TOKEN='<bridge token>' \
|
||||
set -a; source .env; set +a # 载入 REVIEW_ACCOUNT_LOGIN_PASSWORD / BRIDGE_AUTH_TOKEN 等
|
||||
bash scripts/ci/verify_api_interface_contract.sh
|
||||
```
|
||||
|
||||
如需单条命令显式注入,使用变量引用而非明文:
|
||||
|
||||
```bash
|
||||
REVIEW_ACCOUNT_LOGIN_PASSWORD="$REVIEW_ACCOUNT_LOGIN_PASSWORD" \
|
||||
BRIDGE_AUTH_TOKEN="$BRIDGE_AUTH_TOKEN" \
|
||||
BRIDGE_SERVER_URL='https://xworkmate-bridge.svc.plus' \
|
||||
bash scripts/ci/verify_api_interface_contract.sh
|
||||
```
|
||||
@ -46,7 +53,7 @@ bash scripts/ci/verify_api_interface_contract.sh
|
||||
双入口验证示例:
|
||||
|
||||
```bash
|
||||
REVIEW_ACCOUNT_LOGIN_PASSWORD='***REMOVED-CREDENTIAL***' \
|
||||
REVIEW_ACCOUNT_LOGIN_PASSWORD="$REVIEW_ACCOUNT_LOGIN_PASSWORD" \
|
||||
BRIDGE_SERVER_URLS='https://xworkmate-bridge.svc.plus,https://cn-xworkmate-bridge.svc.plus' \
|
||||
bash scripts/ci/verify_api_interface_contract.sh
|
||||
```
|
||||
|
||||
@ -53,7 +53,7 @@ Last Updated: 2026-04-22
|
||||
|
||||
- `url`: `https://accounts.svc.plus`
|
||||
- `login_name`: `review@svc.plus`
|
||||
- `login_password`: `***REMOVED-CREDENTIAL***`
|
||||
- `login_password`: 从 `.env` / secret store 注入 `REVIEW_ACCOUNT_LOGIN_PASSWORD`(勿写明文)
|
||||
|
||||
### 2.3 鉴权规则
|
||||
|
||||
@ -98,7 +98,7 @@ Last Updated: 2026-04-22
|
||||
```json
|
||||
{
|
||||
"identifier": "review@svc.plus",
|
||||
"password": "***REMOVED-CREDENTIAL***"
|
||||
"password": "${REVIEW_ACCOUNT_LOGIN_PASSWORD}"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ AssistantThreadConnectionState resolveGatewayThreadConnectionStateInternal({
|
||||
);
|
||||
}
|
||||
|
||||
if (!accountSignedIn) {
|
||||
if (!accountSignedIn && !bridgeConfigured) {
|
||||
return AssistantThreadConnectionState(
|
||||
executionTarget: target,
|
||||
status: RuntimeConnectionStatus.offline,
|
||||
@ -93,7 +93,7 @@ AssistantThreadConnectionState resolveGatewayThreadConnectionStateInternal({
|
||||
final failed = blocked && !tokenMissing && !endpointMissing;
|
||||
|
||||
// SyncBlocked logic
|
||||
if (tokenMissing || failed || blocked) {
|
||||
if (accountSignedIn && (tokenMissing || failed || blocked)) {
|
||||
final status = RuntimeConnectionStatus.error;
|
||||
final primaryLabel = tokenMissing
|
||||
? appText('缺少令牌', 'Missing Token')
|
||||
|
||||
@ -100,8 +100,8 @@ curl -sfL https://install.svc.plus/ai-workspace | bash -s -- uninstall --purge
|
||||
defaultVerticalAlignment: TableCellVerticalAlignment.middle,
|
||||
children: [
|
||||
_tableRow('macOS (Apple Silicon / Intel)', '已测试'),
|
||||
_tableRow('Debian 11/12', '已测试'),
|
||||
_tableRow('Ubuntu 22.04/24.04', '已测试'),
|
||||
_tableRow('Debian 13 amd64', '已测试'),
|
||||
_tableRow('Ubuntu 26.04 amd64', '已测试'),
|
||||
_tableRow('其他 Linux 发行版', '未测试'),
|
||||
],
|
||||
),
|
||||
|
||||
@ -2,9 +2,9 @@ name: xworkmate
|
||||
description: "XWorkmate desktop-first AI workspace shell."
|
||||
publish_to: 'none'
|
||||
|
||||
version: 1.1.5+2
|
||||
build-date: 2026-06-29
|
||||
build-id: 37d2aa9
|
||||
version: 1.1.5+1
|
||||
build-date: 2026-06-28
|
||||
build-id: 4e02107
|
||||
|
||||
environment:
|
||||
sdk: ^3.11.0
|
||||
|
||||
@ -3,6 +3,19 @@ set -euo pipefail
|
||||
|
||||
LAYER="${1:-all}"
|
||||
|
||||
# Desktop integration tests launch the real GTK app, which needs a display
|
||||
# server. On a headless Linux CI runner there is none, so the app never
|
||||
# establishes a debug connection ("The log reader stopped unexpectedly, or
|
||||
# never started"). Wrap such commands in a virtual framebuffer when one is
|
||||
# available; on macOS/local runs (no xvfb-run) the command runs unchanged.
|
||||
with_display() {
|
||||
if [[ "$(uname -s)" == "Linux" ]] && command -v xvfb-run >/dev/null 2>&1; then
|
||||
xvfb-run -a --server-args="-screen 0 1920x1080x24" "$@"
|
||||
else
|
||||
"$@"
|
||||
fi
|
||||
}
|
||||
|
||||
run_flutter_base() {
|
||||
flutter pub get
|
||||
flutter analyze
|
||||
@ -33,7 +46,7 @@ run_flutter_golden_if_present() {
|
||||
|
||||
run_flutter_integration_if_present() {
|
||||
if [[ -d integration_test ]] && find integration_test -name '*_test.dart' | grep -q .; then
|
||||
flutter test integration_test
|
||||
with_display flutter test integration_test
|
||||
else
|
||||
echo "[skip] no integration tests found under integration_test"
|
||||
fi
|
||||
@ -41,7 +54,7 @@ run_flutter_integration_if_present() {
|
||||
|
||||
run_patrol_if_present() {
|
||||
if command -v patrol >/dev/null 2>&1 && [[ -d patrol_test ]] && find patrol_test -name '*_test.dart' | grep -q .; then
|
||||
patrol test patrol_test
|
||||
with_display patrol test patrol_test
|
||||
else
|
||||
echo "[skip] patrol not installed or patrol_test is empty"
|
||||
fi
|
||||
|
||||
@ -16,10 +16,12 @@ case "$platform" in
|
||||
pkg-config \
|
||||
libx11-dev \
|
||||
libgl1-mesa-dev \
|
||||
libgl1-mesa-dri \
|
||||
libayatana-appindicator3-dev \
|
||||
dpkg-dev \
|
||||
rpm \
|
||||
imagemagick
|
||||
imagemagick \
|
||||
xvfb
|
||||
;;
|
||||
android)
|
||||
sudo apt-get update
|
||||
|
||||
139
scripts/install-xworkmate-app.sh
Executable file
139
scripts/install-xworkmate-app.sh
Executable file
@ -0,0 +1,139 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
REPO=${XWORKMATE_INSTALL_REPO:-"x-evor/xworkmate-app"}
|
||||
RELEASE_TAG=${XWORKMATE_INSTALL_RELEASE_TAG:-"latest"}
|
||||
GITHUB_API=${XWORKMATE_INSTALL_GITHUB_API:-"https://api.github.com"}
|
||||
TMP_DIR="$(mktemp -d "${TMPDIR:-/tmp}/xworkmate-install.XXXXXX")"
|
||||
|
||||
cleanup() {
|
||||
rm -rf "$TMP_DIR"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
info() { printf '[INFO] %s\n' "$*" >&2; }
|
||||
die() { printf '[ERROR] %s\n' "$*" >&2; exit 1; }
|
||||
|
||||
need() {
|
||||
command -v "$1" >/dev/null 2>&1 || die "Missing required command: $1"
|
||||
}
|
||||
|
||||
release_json_url() {
|
||||
if [[ "$RELEASE_TAG" == "latest" ]]; then
|
||||
printf '%s/repos/%s/releases/latest\n' "$GITHUB_API" "$REPO"
|
||||
else
|
||||
printf '%s/repos/%s/releases/tags/%s\n' "$GITHUB_API" "$REPO" "$RELEASE_TAG"
|
||||
fi
|
||||
}
|
||||
|
||||
pick_asset_url() {
|
||||
local metadata_file="$1"
|
||||
local pattern="$2"
|
||||
python3 - "$metadata_file" "$pattern" <<'PY'
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
metadata_path = Path(sys.argv[1])
|
||||
pattern = re.compile(sys.argv[2])
|
||||
data = json.loads(metadata_path.read_text(encoding="utf-8"))
|
||||
for asset in data.get("assets", []):
|
||||
name = asset.get("name", "")
|
||||
if pattern.search(name):
|
||||
print(asset.get("browser_download_url", ""))
|
||||
raise SystemExit(0)
|
||||
raise SystemExit(1)
|
||||
PY
|
||||
}
|
||||
|
||||
install_macos_dmg() {
|
||||
local dmg_url="$1"
|
||||
local dmg_path="$TMP_DIR/XWorkmate.dmg"
|
||||
local mount_point="$TMP_DIR/mount"
|
||||
local target_app="/Applications/XWorkmate.app"
|
||||
|
||||
mkdir -p "$mount_point"
|
||||
info "Downloading macOS DMG..."
|
||||
curl -fL --retry 5 --retry-all-errors -o "$dmg_path" "$dmg_url"
|
||||
info "Mounting DMG..."
|
||||
hdiutil attach "$dmg_path" -mountpoint "$mount_point" -nobrowse -readonly -quiet
|
||||
trap 'hdiutil detach "$mount_point" -quiet >/dev/null 2>&1 || true; cleanup' EXIT
|
||||
|
||||
local source_app="$mount_point/XWorkmate.app"
|
||||
[[ -d "$source_app" ]] || die "DMG does not contain XWorkmate.app"
|
||||
if [[ -d "$target_app" ]]; then
|
||||
info "Replacing existing app at $target_app"
|
||||
rm -rf "$target_app"
|
||||
fi
|
||||
info "Installing to $target_app"
|
||||
ditto "$source_app" "$target_app"
|
||||
xattr -dr com.apple.quarantine "$target_app" 2>/dev/null || true
|
||||
info "Installed $target_app"
|
||||
}
|
||||
|
||||
install_linux_pkg() {
|
||||
local pkg_url="$1"
|
||||
local pkg_path="$TMP_DIR/package"
|
||||
|
||||
curl -fL --retry 5 --retry-all-errors -o "$pkg_path" "$pkg_url"
|
||||
need sudo
|
||||
if [[ "$pkg_url" == *.deb ]]; then
|
||||
info "Installing Debian package..."
|
||||
sudo dpkg -i "$pkg_path" || sudo apt-get -f install -y
|
||||
elif [[ "$pkg_url" == *.rpm ]]; then
|
||||
info "Installing RPM package..."
|
||||
if command -v dnf >/dev/null 2>&1; then
|
||||
sudo dnf install -y "$pkg_path"
|
||||
else
|
||||
sudo rpm -Uvh "$pkg_path"
|
||||
fi
|
||||
else
|
||||
die "Unsupported Linux asset: $pkg_url"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
local release_json_path="$TMP_DIR/release.json"
|
||||
local asset_name_pattern
|
||||
local asset_url
|
||||
|
||||
need curl
|
||||
need python3
|
||||
|
||||
info "Resolving release for $REPO"
|
||||
curl -fsSL "$(release_json_url)" -o "$release_json_path"
|
||||
|
||||
case "$(uname -s)" in
|
||||
Darwin)
|
||||
asset_name_pattern='^XWorkmate-[^/]+\.dmg$'
|
||||
;;
|
||||
Linux)
|
||||
case "$(uname -m)" in
|
||||
x86_64|amd64) ;;
|
||||
*) die "Linux packages are only available for amd64: $(uname -m)" ;;
|
||||
esac
|
||||
if command -v dpkg >/dev/null 2>&1; then
|
||||
asset_name_pattern='^xworkmate_[0-9]+\.[0-9]+\.[0-9]+(?:-[0-9]+)?_amd64\.deb$'
|
||||
elif command -v rpm >/dev/null 2>&1; then
|
||||
asset_name_pattern='^xworkmate-[0-9]+\.[0-9]+\.[0-9]+(?:-[0-9]+)?-1\.x86_64\.rpm$'
|
||||
else
|
||||
die "Neither dpkg nor rpm found"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
die "Unsupported OS: $(uname -s)"
|
||||
;;
|
||||
esac
|
||||
|
||||
asset_url="$(pick_asset_url "$release_json_path" "$asset_name_pattern")" ||
|
||||
die "Could not find a matching release asset"
|
||||
[[ -n "$asset_url" ]] || die "Matching release asset has no download URL"
|
||||
|
||||
case "$(uname -s)" in
|
||||
Darwin) install_macos_dmg "$asset_url" ;;
|
||||
Linux) install_linux_pkg "$asset_url" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@ -128,6 +128,45 @@ void main() {
|
||||
expect(state.gatewayTokenMissing, isFalse);
|
||||
});
|
||||
|
||||
test(
|
||||
'manual bridge discovery does not require a svc.plus account session',
|
||||
() {
|
||||
final state = resolveGatewayThreadConnectionStateInternal(
|
||||
target: AssistantExecutionTarget.gateway,
|
||||
bridgeReady: false,
|
||||
bridgeLabel: 'private-bridge.example.com',
|
||||
accountSyncState: null,
|
||||
accountSignedIn: false,
|
||||
bridgeConfigured: true,
|
||||
);
|
||||
|
||||
expect(state.connected, isFalse);
|
||||
expect(state.status, RuntimeConnectionStatus.offline);
|
||||
expect(state.primaryLabel, '正在发现');
|
||||
expect(state.detailLabel, '正在加载 Bridge 能力...');
|
||||
expect(state.detailLabel, isNot(contains('svc.plus')));
|
||||
},
|
||||
);
|
||||
|
||||
test('manual bridge discovery failure is shown while signed out', () {
|
||||
final state = resolveGatewayThreadConnectionStateInternal(
|
||||
target: AssistantExecutionTarget.gateway,
|
||||
bridgeReady: false,
|
||||
bridgeLabel: 'private-bridge.example.com',
|
||||
accountSyncState: null,
|
||||
accountSignedIn: false,
|
||||
bridgeConfigured: true,
|
||||
bridgeDiscoveryAttempted: true,
|
||||
bridgeDiscoveryError: 'ACP_HTTP_CONNECT_FAILED',
|
||||
providerCatalogEmpty: true,
|
||||
);
|
||||
|
||||
expect(state.status, RuntimeConnectionStatus.error);
|
||||
expect(state.primaryLabel, '连接失败');
|
||||
expect(state.detailLabel, 'ACP_HTTP_CONNECT_FAILED');
|
||||
expect(state.detailLabel, isNot(contains('svc.plus')));
|
||||
});
|
||||
|
||||
test('surfaces failed discovery after capability refresh is attempted', () {
|
||||
final state = resolveGatewayThreadConnectionStateInternal(
|
||||
target: AssistantExecutionTarget.gateway,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user