feat: harden loose-offline sync for user JWT, schema, and console ops

Enable Binding-scoped agent push/pull, empty-table schema ensure, SyncPage inspect/drop-table, default module import, and agent-bound publish docs from the 宇恒联调意见.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
whm
2026-08-05 09:47:35 +08:00
parent 76cdcd760e
commit b04b180d30
59 changed files with 4762 additions and 308 deletions

View File

@@ -35,6 +35,22 @@ CREATE TABLE IF NOT EXISTS orders (
形态 B 下本机 SQLite 可能不可达:至少 **remote** 须能完成校验。
### 线上库 A DSN生产统一 Postgres
```text
postgres://user:pass@127.0.0.1:5432/app_online?sslmode=disable
```
联调临时可用 SQLite不宜多 writer
```text
file:E:/data/ajz_remote.db?_pragma=foreign_keys(1)
```
使用正斜杠;平台会规范化反斜杠并补 `busy_timeout`
单服务器一条通道即可;多服务器为**每台线上库各建一条通道**,客户端选用对应 `channel_id`
## 宇恒开通opt-in
```bash
@@ -55,6 +71,9 @@ YXD_SYNC_DBSYNC_TABLES=orders,order_items
推送落到通道 **remote**(线上 A幂等认客户端 version平台不连用户本机 SQLite。
**幂等**:同 version 再 push → `{ success:true, result:{ skipped:true, ... } }`;重复 HTTP 安全,线上不双行。
**可重试**remote IO 失败 → `503` + `retryable:true`(勿换 UUID
宇恒建议环境变量(由对方配置,不在智建仓改):
```bash