@allbluecn/database 0.14.15 → 0.14.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@allbluecn/database",
3
- "version": "0.14.15",
3
+ "version": "0.14.16",
4
4
  "license": "AGPL-3.0-or-later",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
7
7
  "types": "./index.ts",
8
8
  "dependencies": {
9
- "@allbluecn/kernel": "0.12.4",
9
+ "@allbluecn/kernel": "0.12.5",
10
10
  "@electric-sql/pglite": "0.5.13",
11
11
  "@electric-sql/pglite-pgvector": "0.0.14",
12
12
  "@prisma/adapter-pg": "7.8.0",
package/schema.prisma CHANGED
@@ -47,6 +47,7 @@ model User {
47
47
  aiApiKey String? // 用户 AI API Key(TODO: 加密存储)
48
48
  aiModel String? // 默认 "openai/gpt-4o-mini"
49
49
  aiSourceMode String? // 模型来源模式:hosted | local-agent | byok;null = 未选择(默认 byok 行为)
50
+ aiSearchProviderId String? // 联网搜索服务商(AiProviderConfig.providerId);null = 自动选择
50
51
  locale String? // 用户语言偏好(zh / en),null 表示未设置
51
52
 
52
53
  storyDisplayOptions Json? // Story Display Options 个人偏好(URL 无参数时的默认值,跨设备持久化)
@@ -252,6 +253,7 @@ model Workspace {
252
253
  customRoles CustomRole[]
253
254
  auditLogs AuditLog[]
254
255
  aiTasks AiTask[]
256
+ harnessWorkspaces HarnessWorkspace[]
255
257
 
256
258
  @@index([ownerId])
257
259
  @@map("workspaces")
@@ -358,6 +360,8 @@ model ChatThread {
358
360
  title String?
359
361
  isArchived Boolean @default(false)
360
362
  sandboxPolicy String @default("readonly")
363
+ harnessPermission String @default("ask")
364
+ harnessPermissionVersion Int @default(0)
361
365
  createdAt DateTime @default(now())
362
366
  updatedAt DateTime @updatedAt
363
367
 
@@ -2562,16 +2566,22 @@ model HarnessWorkspace {
2562
2566
  ownerId String
2563
2567
  kind String @default("cloud") // "cloud" | "local-meta"(本地挂载只存元数据)
2564
2568
  // 本地优先:本地目录映射与按需上云(v3 设计 §2.2)。三列均可空,老数据零迁移。
2565
- localPath String? // 仅 local-meta:本地目录绝对路径(FS realpath 规范化)
2569
+ localPath String? // local-meta:用户登记的本地目录;已绑定的 cloud 行:创建时自动建立的工作目录(FS realpath 规范化)
2566
2570
  cloudOfId String? // local-meta 行指向其云端镜像 cloud 行(P4 按需上云建立;自环禁止)
2567
2571
  lastSyncedAt DateTime? // 最近一次上云快照时间(映射态展示)
2568
2572
  createdAt DateTime @default(now())
2569
2573
  updatedAt DateTime @updatedAt
2570
2574
 
2575
+ /// 绑定的产品工作空间(/workspaces);null = 未绑定(全量内容)
2576
+ workspaceId String?
2577
+ workspace Workspace? @relation(fields: [workspaceId], references: [id], onDelete: SetNull)
2578
+
2571
2579
  owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
2572
2580
  files WorkspaceFile[]
2573
2581
  threads ChatThread[]
2574
2582
 
2583
+ @@unique([ownerId, workspaceId])
2584
+ @@index([workspaceId])
2575
2585
  @@index([ownerId, updatedAt])
2576
2586
  @@map("harness_workspaces")
2577
2587
  }