@allbluecn/database 0.14.1 → 0.14.3
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 +66 -0
- package/generated/client.ts +66 -0
- package/generated/internal/class.ts +94 -4
- package/generated/internal/prismaNamespace.ts +814 -3
- package/generated/internal/prismaNamespaceBrowser.ts +138 -2
- package/generated/models/ChatThread.ts +174 -2
- package/generated/models/DesignEmbedding.ts +25 -1
- package/generated/models/HarnessArtifact.ts +1307 -0
- package/generated/models/HarnessBlob.ts +1273 -0
- package/generated/models/HarnessHostHeartbeat.ts +1125 -0
- package/generated/models/HarnessLogEntry.ts +1354 -0
- package/generated/models/HarnessLogHeader.ts +1904 -0
- package/generated/models/HarnessLogOffer.ts +1382 -0
- package/generated/models/HarnessLogSnapshot.ts +1333 -0
- package/generated/models/HarnessMetadata.ts +1255 -0
- package/generated/models/HarnessSession.ts +1504 -0
- package/generated/models.ts +9 -0
- package/migrations/20261108000000_story_generate_prompt_json_contract/migration.sql +11 -0
- package/migrations/20261108000001_design_prototype_stream_prompt_ops_contract/migration.sql +13 -0
- package/migrations/20261109000000_harness_persistence/migration.sql +156 -0
- package/migrations/20261111000000_harness_cas_tombstone/migration.sql +12 -0
- package/package.json +3 -1
- package/pg-client.ts +21 -0
- package/schema.prisma +197 -1
package/generated/browser.ts
CHANGED
|
@@ -747,3 +747,69 @@ export type KnowledgeEmbedding = Prisma.KnowledgeEmbeddingModel
|
|
|
747
747
|
*
|
|
748
748
|
*/
|
|
749
749
|
export type DesignEmbedding = Prisma.DesignEmbeddingModel
|
|
750
|
+
/**
|
|
751
|
+
* Model HarnessLogHeader
|
|
752
|
+
* LogStore 的所有权/截断/亲和头(每 log 一行)。
|
|
753
|
+
* epoch 单调递增(永不下降),是 fencing 的依据;ownerId/ownerExpiresAt/released 构成
|
|
754
|
+
* 所有权租约;firstSeq 是截断点(truncate 后上移);deletedAt 是墓碑(删除后所有 fenced
|
|
755
|
+
* 写与 offerInput 拒绝,直到下次 acquireOwnership 重新打开)。epoch 计数器在 deleteLog
|
|
756
|
+
* 后仍保留。append 用事务 + 本行 SELECT … FOR UPDATE 锁,保证 seq 单调与 offer 消费原子。
|
|
757
|
+
*/
|
|
758
|
+
export type HarnessLogHeader = Prisma.HarnessLogHeaderModel
|
|
759
|
+
/**
|
|
760
|
+
* Model HarnessLogEntry
|
|
761
|
+
* LogStore 的追加记录((logId, seq) 主键;seq 从 1 单调递增,record 为 JSONB)。
|
|
762
|
+
*/
|
|
763
|
+
export type HarnessLogEntry = Prisma.HarnessLogEntryModel
|
|
764
|
+
/**
|
|
765
|
+
* Model HarnessLogOffer
|
|
766
|
+
* LogStore 的输入通道 offer(pending input;任意机器可 offer,仅 owner 经 append({consumes}) 消费)。
|
|
767
|
+
* inputId 在一个 log 内唯一;consumedAt 非空表示已被消费(id 保留 → 重试同 payload =
|
|
768
|
+
* duplicate,异 payload = conflict)。
|
|
769
|
+
*/
|
|
770
|
+
export type HarnessLogOffer = Prisma.HarnessLogOfferModel
|
|
771
|
+
/**
|
|
772
|
+
* Model HarnessLogSnapshot
|
|
773
|
+
* LogStore 的最新快照(每 log 至多一条;putSnapshot 整体替换)。
|
|
774
|
+
*/
|
|
775
|
+
export type HarnessLogSnapshot = Prisma.HarnessLogSnapshotModel
|
|
776
|
+
/**
|
|
777
|
+
* Model HarnessHostHeartbeat
|
|
778
|
+
* host 心跳(markHostAlive)。affinity 钉住的 host 仅在其心跳未过期时才算“活”,
|
|
779
|
+
* 故 owner 到期接管 / listLogsWithoutOwner 需联查本表判断 affinity host 是否仍活。
|
|
780
|
+
*/
|
|
781
|
+
export type HarnessHostHeartbeat = Prisma.HarnessHostHeartbeatModel
|
|
782
|
+
/**
|
|
783
|
+
* Model HarnessMetadata
|
|
784
|
+
* MetadataStore((namespace, key) 复合主键)。version 每次写(含 set)递增,作 CAS
|
|
785
|
+
* revision(getVersioned/setIf 成对实现);delete 后行移除,revision 不复返。
|
|
786
|
+
* 与 /api/chat 链的 ChatPersistenceMeta 隔离;决定 permissions 'always' 规则持久化。
|
|
787
|
+
*/
|
|
788
|
+
export type HarnessMetadata = Prisma.HarnessMetadataModel
|
|
789
|
+
/**
|
|
790
|
+
* Model HarnessBlob
|
|
791
|
+
* BlobStore(字节)。key 主键,**无用户/线程外键**(官方契约按调用方 key 存取,
|
|
792
|
+
* 不能复用带 userId 非空外键的 Blob 表)。bytes = PG bytea;get 支持 Range。
|
|
793
|
+
* 桌面 media.maxBytes 建议下调到 20MB(bytea 不宜存大对象)。
|
|
794
|
+
*/
|
|
795
|
+
export type HarnessBlob = Prisma.HarnessBlobModel
|
|
796
|
+
/**
|
|
797
|
+
* Model HarnessArtifact
|
|
798
|
+
* ArtifactStore(媒体/工具产物元数据;字节落在 HarnessBlob.blobKey)。
|
|
799
|
+
* **无 GenerationRun 外键**——子代理线程 `<root>/agent/<runId>` 不是 ChatThread/
|
|
800
|
+
* GenerationRun 行,写入 GenerationRun 还会污染画廊。
|
|
801
|
+
*/
|
|
802
|
+
export type HarnessArtifact = Prisma.HarnessArtifactModel
|
|
803
|
+
/**
|
|
804
|
+
* Model HarnessSession
|
|
805
|
+
* SessionIndexStore 载体(**独立表**)。
|
|
806
|
+
* ⚠ 设计 §4 原拟“建在 ChatThread 上”,但官方 conformance testkit(types.d.ts 同源)要求:
|
|
807
|
+
* ① 同一 threadId 在两个 tenant 下是两条 entry(ChatThread.id 单列主键无法表达);
|
|
808
|
+
* ② members 可为空数组(子代理线程无 owner),与 ChatThread.userId NOT NULL 冲突;
|
|
809
|
+
* ③ createdAt/updatedAt 以精确 JS number(epoch ms)经 toEqual round-trip。
|
|
810
|
+
* 故按“以类型真源为准”以独立复合主键表实现;ChatThread 的单一真源绑定(侧栏
|
|
811
|
+
* conversations serverFn 与 harness sessions.* 读写同一行)移到 Phase 2 会话桥接(T2.7),
|
|
812
|
+
* ChatThread.indexRevision/indexMetadata 为该桥接预留。
|
|
813
|
+
* createdAt/updatedAt 存 epoch ms,用 Float(double)承载:Date.now() < 2^53 精确,小整数亦精确。
|
|
814
|
+
*/
|
|
815
|
+
export type HarnessSession = Prisma.HarnessSessionModel
|
package/generated/client.ts
CHANGED
|
@@ -771,3 +771,69 @@ export type KnowledgeEmbedding = Prisma.KnowledgeEmbeddingModel
|
|
|
771
771
|
*
|
|
772
772
|
*/
|
|
773
773
|
export type DesignEmbedding = Prisma.DesignEmbeddingModel
|
|
774
|
+
/**
|
|
775
|
+
* Model HarnessLogHeader
|
|
776
|
+
* LogStore 的所有权/截断/亲和头(每 log 一行)。
|
|
777
|
+
* epoch 单调递增(永不下降),是 fencing 的依据;ownerId/ownerExpiresAt/released 构成
|
|
778
|
+
* 所有权租约;firstSeq 是截断点(truncate 后上移);deletedAt 是墓碑(删除后所有 fenced
|
|
779
|
+
* 写与 offerInput 拒绝,直到下次 acquireOwnership 重新打开)。epoch 计数器在 deleteLog
|
|
780
|
+
* 后仍保留。append 用事务 + 本行 SELECT … FOR UPDATE 锁,保证 seq 单调与 offer 消费原子。
|
|
781
|
+
*/
|
|
782
|
+
export type HarnessLogHeader = Prisma.HarnessLogHeaderModel
|
|
783
|
+
/**
|
|
784
|
+
* Model HarnessLogEntry
|
|
785
|
+
* LogStore 的追加记录((logId, seq) 主键;seq 从 1 单调递增,record 为 JSONB)。
|
|
786
|
+
*/
|
|
787
|
+
export type HarnessLogEntry = Prisma.HarnessLogEntryModel
|
|
788
|
+
/**
|
|
789
|
+
* Model HarnessLogOffer
|
|
790
|
+
* LogStore 的输入通道 offer(pending input;任意机器可 offer,仅 owner 经 append({consumes}) 消费)。
|
|
791
|
+
* inputId 在一个 log 内唯一;consumedAt 非空表示已被消费(id 保留 → 重试同 payload =
|
|
792
|
+
* duplicate,异 payload = conflict)。
|
|
793
|
+
*/
|
|
794
|
+
export type HarnessLogOffer = Prisma.HarnessLogOfferModel
|
|
795
|
+
/**
|
|
796
|
+
* Model HarnessLogSnapshot
|
|
797
|
+
* LogStore 的最新快照(每 log 至多一条;putSnapshot 整体替换)。
|
|
798
|
+
*/
|
|
799
|
+
export type HarnessLogSnapshot = Prisma.HarnessLogSnapshotModel
|
|
800
|
+
/**
|
|
801
|
+
* Model HarnessHostHeartbeat
|
|
802
|
+
* host 心跳(markHostAlive)。affinity 钉住的 host 仅在其心跳未过期时才算“活”,
|
|
803
|
+
* 故 owner 到期接管 / listLogsWithoutOwner 需联查本表判断 affinity host 是否仍活。
|
|
804
|
+
*/
|
|
805
|
+
export type HarnessHostHeartbeat = Prisma.HarnessHostHeartbeatModel
|
|
806
|
+
/**
|
|
807
|
+
* Model HarnessMetadata
|
|
808
|
+
* MetadataStore((namespace, key) 复合主键)。version 每次写(含 set)递增,作 CAS
|
|
809
|
+
* revision(getVersioned/setIf 成对实现);delete 后行移除,revision 不复返。
|
|
810
|
+
* 与 /api/chat 链的 ChatPersistenceMeta 隔离;决定 permissions 'always' 规则持久化。
|
|
811
|
+
*/
|
|
812
|
+
export type HarnessMetadata = Prisma.HarnessMetadataModel
|
|
813
|
+
/**
|
|
814
|
+
* Model HarnessBlob
|
|
815
|
+
* BlobStore(字节)。key 主键,**无用户/线程外键**(官方契约按调用方 key 存取,
|
|
816
|
+
* 不能复用带 userId 非空外键的 Blob 表)。bytes = PG bytea;get 支持 Range。
|
|
817
|
+
* 桌面 media.maxBytes 建议下调到 20MB(bytea 不宜存大对象)。
|
|
818
|
+
*/
|
|
819
|
+
export type HarnessBlob = Prisma.HarnessBlobModel
|
|
820
|
+
/**
|
|
821
|
+
* Model HarnessArtifact
|
|
822
|
+
* ArtifactStore(媒体/工具产物元数据;字节落在 HarnessBlob.blobKey)。
|
|
823
|
+
* **无 GenerationRun 外键**——子代理线程 `<root>/agent/<runId>` 不是 ChatThread/
|
|
824
|
+
* GenerationRun 行,写入 GenerationRun 还会污染画廊。
|
|
825
|
+
*/
|
|
826
|
+
export type HarnessArtifact = Prisma.HarnessArtifactModel
|
|
827
|
+
/**
|
|
828
|
+
* Model HarnessSession
|
|
829
|
+
* SessionIndexStore 载体(**独立表**)。
|
|
830
|
+
* ⚠ 设计 §4 原拟“建在 ChatThread 上”,但官方 conformance testkit(types.d.ts 同源)要求:
|
|
831
|
+
* ① 同一 threadId 在两个 tenant 下是两条 entry(ChatThread.id 单列主键无法表达);
|
|
832
|
+
* ② members 可为空数组(子代理线程无 owner),与 ChatThread.userId NOT NULL 冲突;
|
|
833
|
+
* ③ createdAt/updatedAt 以精确 JS number(epoch ms)经 toEqual round-trip。
|
|
834
|
+
* 故按“以类型真源为准”以独立复合主键表实现;ChatThread 的单一真源绑定(侧栏
|
|
835
|
+
* conversations serverFn 与 harness sessions.* 读写同一行)移到 Phase 2 会话桥接(T2.7),
|
|
836
|
+
* ChatThread.indexRevision/indexMetadata 为该桥接预留。
|
|
837
|
+
* createdAt/updatedAt 存 epoch ms,用 Float(double)承载:Date.now() < 2^53 精确,小整数亦精确。
|
|
838
|
+
*/
|
|
839
|
+
export type HarnessSession = Prisma.HarnessSessionModel
|