@allbluecn/database 0.14.6 → 0.14.7
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/generated/browser.ts +40 -0
- package/generated/client.ts +40 -0
- package/generated/internal/class.ts +84 -4
- package/generated/internal/prismaNamespace.ts +756 -2
- package/generated/internal/prismaNamespaceBrowser.ts +155 -1
- package/generated/models/HarnessConnectorAccount.ts +1291 -0
- package/generated/models/HarnessFeedback.ts +1240 -0
- package/generated/models/HarnessMcpServer.ts +1445 -0
- package/generated/models/HarnessOutbox.ts +1560 -0
- package/generated/models/HarnessSchedule.ts +1749 -0
- package/generated/models/HarnessScheduleOccurrence.ts +1716 -0
- package/generated/models/HarnessSessionSearchDocument.ts +1626 -0
- package/generated/models/HarnessSessionSearchToken.ts +1326 -0
- package/generated/models.ts +8 -0
- package/migrations/20261125020753_harness_p1_foundation/migration.sql +217 -0
- package/migrations/20261125020853_sync_overlay_harness_p1/migration.sql +515 -0
- package/package.json +1 -1
- package/schema.prisma +173 -0
package/schema.prisma
CHANGED
|
@@ -3388,3 +3388,176 @@ model HarnessSession {
|
|
|
3388
3388
|
@@index([tenantId, updatedAt, threadId])
|
|
3389
3389
|
@@map("harness_sessions")
|
|
3390
3390
|
}
|
|
3391
|
+
|
|
3392
|
+
model HarnessSchedule {
|
|
3393
|
+
id String @id @default(cuid())
|
|
3394
|
+
userId String
|
|
3395
|
+
threadId String
|
|
3396
|
+
workspaceId String?
|
|
3397
|
+
title String
|
|
3398
|
+
prompt String @db.Text
|
|
3399
|
+
rule Json
|
|
3400
|
+
ruleKind String // after | at | every | daily | weekly | cron | rrule
|
|
3401
|
+
timezone String
|
|
3402
|
+
status String @default("active") // active | paused | ended | deleted
|
|
3403
|
+
executionPlane String @default("local") // local | cloud
|
|
3404
|
+
nextRunAt DateTime?
|
|
3405
|
+
lastRunAt DateTime?
|
|
3406
|
+
lastError String? @db.Text
|
|
3407
|
+
revision Int @default(0)
|
|
3408
|
+
createdAt DateTime @default(now())
|
|
3409
|
+
updatedAt DateTime @updatedAt
|
|
3410
|
+
|
|
3411
|
+
occurrences HarnessScheduleOccurrence[]
|
|
3412
|
+
|
|
3413
|
+
@@index([userId, status, nextRunAt])
|
|
3414
|
+
@@index([executionPlane, status, nextRunAt])
|
|
3415
|
+
@@index([threadId, status])
|
|
3416
|
+
@@map("harness_schedules")
|
|
3417
|
+
}
|
|
3418
|
+
|
|
3419
|
+
model HarnessScheduleOccurrence {
|
|
3420
|
+
id String @id @default(cuid())
|
|
3421
|
+
scheduleId String
|
|
3422
|
+
userId String
|
|
3423
|
+
executionPlane String @default("local")
|
|
3424
|
+
scheduledFor DateTime
|
|
3425
|
+
state String @default("pending") // pending | claimed | delivered | skipped | failed
|
|
3426
|
+
leaseOwner String?
|
|
3427
|
+
leaseUntil DateTime?
|
|
3428
|
+
fencingToken Int @default(0)
|
|
3429
|
+
attempt Int @default(0)
|
|
3430
|
+
deliveredAt DateTime?
|
|
3431
|
+
lastError String? @db.Text
|
|
3432
|
+
createdAt DateTime @default(now())
|
|
3433
|
+
updatedAt DateTime @updatedAt
|
|
3434
|
+
|
|
3435
|
+
schedule HarnessSchedule @relation(fields: [scheduleId], references: [id], onDelete: Cascade)
|
|
3436
|
+
|
|
3437
|
+
@@unique([scheduleId, scheduledFor])
|
|
3438
|
+
@@index([executionPlane, state, scheduledFor])
|
|
3439
|
+
@@index([userId, state, scheduledFor])
|
|
3440
|
+
@@map("harness_schedule_occurrences")
|
|
3441
|
+
}
|
|
3442
|
+
|
|
3443
|
+
model HarnessOutbox {
|
|
3444
|
+
id String @id @default(cuid())
|
|
3445
|
+
userId String
|
|
3446
|
+
executionPlane String @default("local")
|
|
3447
|
+
kind String // schedule.wake(P5 可扩展 webhook.delivery)
|
|
3448
|
+
occurrenceId String? @unique
|
|
3449
|
+
/// 投递给官方 host.submit 的幂等键;由 occurrenceId 派生(`schedule:<occurrenceId>`),落库便于崩溃恢复与审计
|
|
3450
|
+
inputId String @unique
|
|
3451
|
+
payload Json
|
|
3452
|
+
idempotencyKey String @unique
|
|
3453
|
+
state String @default("pending") // pending | claimed | done | dead
|
|
3454
|
+
leaseOwner String?
|
|
3455
|
+
leaseUntil DateTime?
|
|
3456
|
+
fencingToken Int @default(0)
|
|
3457
|
+
attempt Int @default(0)
|
|
3458
|
+
nextAttemptAt DateTime @default(now())
|
|
3459
|
+
lastHeartbeatAt DateTime?
|
|
3460
|
+
lastError String? @db.Text
|
|
3461
|
+
createdAt DateTime @default(now())
|
|
3462
|
+
updatedAt DateTime @updatedAt
|
|
3463
|
+
|
|
3464
|
+
@@index([executionPlane, state, nextAttemptAt])
|
|
3465
|
+
@@index([userId, state])
|
|
3466
|
+
@@map("harness_outbox")
|
|
3467
|
+
}
|
|
3468
|
+
|
|
3469
|
+
model HarnessFeedback {
|
|
3470
|
+
id String @id @default(cuid())
|
|
3471
|
+
userId String
|
|
3472
|
+
threadId String
|
|
3473
|
+
messageId String
|
|
3474
|
+
rating String // up | down
|
|
3475
|
+
comment String? @db.Text
|
|
3476
|
+
createdAt DateTime @default(now())
|
|
3477
|
+
updatedAt DateTime @updatedAt
|
|
3478
|
+
|
|
3479
|
+
@@unique([userId, threadId, messageId])
|
|
3480
|
+
@@index([threadId, createdAt])
|
|
3481
|
+
@@map("harness_feedback")
|
|
3482
|
+
}
|
|
3483
|
+
|
|
3484
|
+
model HarnessMcpServer {
|
|
3485
|
+
id String @id @default(cuid())
|
|
3486
|
+
userId String
|
|
3487
|
+
name String
|
|
3488
|
+
transport String // http | sse | stdio
|
|
3489
|
+
url String?
|
|
3490
|
+
command String?
|
|
3491
|
+
args Json?
|
|
3492
|
+
headers Json? // 仅非敏感头(Authorization/Cookie 拒绝)
|
|
3493
|
+
envNames Json? // 仅环境变量名,不含值
|
|
3494
|
+
credentialId String? // HarnessConnectorAccount.id
|
|
3495
|
+
enabled Boolean @default(true)
|
|
3496
|
+
lastProbeAt DateTime?
|
|
3497
|
+
lastProbeOk Boolean?
|
|
3498
|
+
lastProbeError String? @db.Text
|
|
3499
|
+
createdAt DateTime @default(now())
|
|
3500
|
+
updatedAt DateTime @updatedAt
|
|
3501
|
+
|
|
3502
|
+
@@unique([userId, name])
|
|
3503
|
+
@@index([userId, enabled])
|
|
3504
|
+
@@map("harness_mcp_servers")
|
|
3505
|
+
}
|
|
3506
|
+
|
|
3507
|
+
model HarnessConnectorAccount {
|
|
3508
|
+
id String @id @default(cuid())
|
|
3509
|
+
userId String
|
|
3510
|
+
kind String // mcp | oauth
|
|
3511
|
+
provider String
|
|
3512
|
+
label String
|
|
3513
|
+
secretCipher String @db.Text
|
|
3514
|
+
metadata Json?
|
|
3515
|
+
expiresAt DateTime?
|
|
3516
|
+
createdAt DateTime @default(now())
|
|
3517
|
+
updatedAt DateTime @updatedAt
|
|
3518
|
+
|
|
3519
|
+
@@unique([userId, kind, provider, label])
|
|
3520
|
+
@@index([userId, kind])
|
|
3521
|
+
@@map("harness_connector_accounts")
|
|
3522
|
+
}
|
|
3523
|
+
|
|
3524
|
+
model HarnessSessionSearchDocument {
|
|
3525
|
+
id String @id @default(cuid())
|
|
3526
|
+
userId String
|
|
3527
|
+
/// 官方 logId(含 tenant + 根线程):索引回调的原生键,子代理日志也落这里
|
|
3528
|
+
logId String
|
|
3529
|
+
/// 根会话 threadId(由 logId 反解/index entry 取):搜索跳转只用它,子代理结果归到根会话
|
|
3530
|
+
rootThreadId String
|
|
3531
|
+
/// 子代理 run(子日志时有值),供 UI 标注来源;根日志为 null
|
|
3532
|
+
subagentRunId String?
|
|
3533
|
+
/// 日志序号(append 的 seq);增量幂等与 truncate 清理的依据
|
|
3534
|
+
eventSeq Int
|
|
3535
|
+
partIndex Int @default(0)
|
|
3536
|
+
/// 消息 id(官方 message.id;用户消息同样取 transcript 的 message.id,保证 Cmd+K 可跳转),revert/keep 清理的依据
|
|
3537
|
+
messageId String
|
|
3538
|
+
/// `harness.input` 兜底文档的归并键(与 messageId 同消息时只保留一行);transcript 产出的文档为 null
|
|
3539
|
+
inputId String?
|
|
3540
|
+
kind String // user | assistant | tool
|
|
3541
|
+
content String @db.Text
|
|
3542
|
+
createdAt DateTime @default(now())
|
|
3543
|
+
|
|
3544
|
+
tokens HarnessSessionSearchToken[]
|
|
3545
|
+
|
|
3546
|
+
@@unique([logId, messageId, partIndex])
|
|
3547
|
+
@@index([userId, createdAt])
|
|
3548
|
+
@@index([rootThreadId, eventSeq])
|
|
3549
|
+
@@index([logId, eventSeq])
|
|
3550
|
+
@@map("harness_session_search_documents")
|
|
3551
|
+
}
|
|
3552
|
+
|
|
3553
|
+
model HarnessSessionSearchToken {
|
|
3554
|
+
documentId String
|
|
3555
|
+
token String
|
|
3556
|
+
position Int
|
|
3557
|
+
|
|
3558
|
+
document HarnessSessionSearchDocument @relation(fields: [documentId], references: [id], onDelete: Cascade)
|
|
3559
|
+
|
|
3560
|
+
@@id([documentId, token, position])
|
|
3561
|
+
@@index([token])
|
|
3562
|
+
@@map("harness_session_search_tokens")
|
|
3563
|
+
}
|