The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 25, 16:00 UTC
fixxx
Julius Marminge committed
Feb 27, 2026 at 20:35 UTC
35817601ff3f3d4f2e27ea8c5c8a08a8b0926dc3
2 files changed
+15
-12
apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts
+6
-5
@@ -43,12 +43,13 @@ const ProjectionProjectDbRowSchema = ProjectionProject.mapFields(
43
scripts: Schema.fromJsonString(Schema.Array(ProjectScript)),
44
}),
45
);
46
+const ProjectionThreadMessageDbRowSchema = ProjectionThreadMessage.mapFields(
47
+ Struct.assign({
48
+ isStreaming: Schema.Number,
49
+ attachments: Schema.NullOr(Schema.fromJsonString(Schema.Array(ChatAttachment))),
50
+ }),
51
+);
52
const ProjectionThreadDbRowSchema = ProjectionThread;
47
-const ProjectionThreadMessageDbRowSchema = Schema.Struct({
48
- ...ProjectionThreadMessage.fields,
49
- isStreaming: Schema.Number,
50
- attachments: Schema.NullOr(Schema.fromJsonString(Schema.Array(ChatAttachment))),
51
-});
53
const ProjectionThreadActivityDbRowSchema = ProjectionThreadActivity.mapFields(
54
Struct.assign({
55
payload: Schema.fromJsonString(Schema.Unknown),
apps/server/src/persistence/Layers/ProjectionThreadMessages.ts
+9
-7
@@ -1,6 +1,6 @@
1
import * as SqlClient from "effect/unstable/sql/SqlClient";
2
import * as SqlSchema from "effect/unstable/sql/SqlSchema";
3
-import { Effect, Layer, Schema } from "effect";
3
+import { Effect, Layer, Schema, Struct } from "effect";
4
import { ChatAttachment } from "@t3tools/contracts";
5
6
import { toPersistenceSqlError } from "../Errors.ts";
@@ -12,11 +12,12 @@ import {
12
ProjectionThreadMessage,
13
} from "../Services/ProjectionThreadMessages.ts";
14
15
-const ProjectionThreadMessageDbRowSchema = Schema.Struct({
16
- ...ProjectionThreadMessage.fields,
17
- isStreaming: Schema.Number,
18
- attachments: Schema.NullOr(Schema.fromJsonString(Schema.Array(ChatAttachment))),
19
-});
15
+const ProjectionThreadMessageDbRowSchema = ProjectionThreadMessage.mapFields(
16
+ Struct.assign({
17
+ isStreaming: Schema.Number,
18
+ attachments: Schema.NullOr(Schema.fromJsonString(Schema.Array(ChatAttachment))),
19
+ }),
20
+);
21
22
const makeProjectionThreadMessageRepository = Effect.gen(function* () {
23
const sql = yield* SqlClient.SqlClient;
@@ -24,7 +25,8 @@ const makeProjectionThreadMessageRepository = Effect.gen(function* () {
25
const upsertProjectionThreadMessageRow = SqlSchema.void({
26
Request: ProjectionThreadMessage,
27
execute: (row) => {
27
- const nextAttachmentsJson = row.attachments !== undefined ? JSON.stringify(row.attachments) : null;
28
+ const nextAttachmentsJson =
29
+ row.attachments !== undefined ? JSON.stringify(row.attachments) : null;
30
return sql`
31
INSERT INTO projection_thread_messages (
32
message_id,