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

@@ -124,6 +124,14 @@ CREATE TABLE IF NOT EXISTS platform_meta.role_permissions (
ALTER TABLE platform_meta.agent_accounts
ADD COLUMN IF NOT EXISTS role_id BIGINT;
-- Z8b智能体绑定同步通道 / 线上库 / 模块落库名
ALTER TABLE platform_meta.agent_accounts
ADD COLUMN IF NOT EXISTS channel_id VARCHAR(128) NOT NULL DEFAULT '';
ALTER TABLE platform_meta.agent_accounts
ADD COLUMN IF NOT EXISTS online_db_id VARCHAR(128) NOT NULL DEFAULT '';
ALTER TABLE platform_meta.agent_accounts
ADD COLUMN IF NOT EXISTS database_name VARCHAR(128) NOT NULL DEFAULT '';
-- 租户邀请码pending 用户凭码加入已有公司
CREATE TABLE IF NOT EXISTS platform_meta.tenant_invites (
invite_id BIGSERIAL PRIMARY KEY,

View File

@@ -71,6 +71,7 @@ type AppSummary struct {
Name string `json:"name"`
Status AppStatus `json:"status"`
SchemaName string `json:"schema_name,omitempty"`
DatabaseName string `json:"database_name,omitempty"`
PageCount int `json:"page_count"`
EntityCount int `json:"entity_count"`
UpdatedAt time.Time `json:"updated_at"`
@@ -141,13 +142,14 @@ func (s *MemoryStore) ListByTenant(_ context.Context, tenantID int64) ([]AppSumm
func summarizeApp(app *AppRecord) AppSummary {
sum := AppSummary{
AppID: app.AppID,
Slug: app.Slug,
Name: app.Name,
Status: app.Status,
SchemaName: app.SchemaName,
UpdatedAt: app.UpdatedAt,
CreatedAt: app.CreatedAt,
AppID: app.AppID,
Slug: app.Slug,
Name: app.Name,
Status: app.Status,
SchemaName: app.SchemaName,
DatabaseName: app.DatabaseName,
UpdatedAt: app.UpdatedAt,
CreatedAt: app.CreatedAt,
}
if app.Blueprint != nil {
sum.PageCount = len(app.Blueprint.Pages)