Skip to content

Commit 38c9ecd

Browse files
committed
resolved merge conflicts
1 parent fadda6a commit 38c9ecd

4 files changed

Lines changed: 370 additions & 993 deletions

File tree

apps/sim/lib/copilot/vfs/serializers.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,12 @@ export function serializeTaskChat(rawMessages: unknown[]): string {
553553
if (role === 'assistant' && Array.isArray(m.contentBlocks)) {
554554
const textParts: string[] = []
555555
for (const block of m.contentBlocks) {
556-
if (block && typeof block === 'object' && (block as any).type === 'text' && (block as any).content) {
556+
if (
557+
block &&
558+
typeof block === 'object' &&
559+
(block as any).type === 'text' &&
560+
(block as any).content
561+
) {
557562
textParts.push((block as any).content)
558563
}
559564
}

apps/sim/lib/copilot/workspace-context.ts

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -27,70 +27,70 @@ export async function generateWorkspaceContext(
2727
try {
2828
const [wsRow, members, workflows, kbs, tables, files, credentials, recentTasks] =
2929
await Promise.all([
30-
db
31-
.select({ id: workspace.id, name: workspace.name, ownerId: workspace.ownerId })
32-
.from(workspace)
33-
.where(eq(workspace.id, workspaceId))
34-
.limit(1)
35-
.then((rows) => rows[0] ?? null),
36-
37-
getUsersWithPermissions(workspaceId),
38-
39-
db
40-
.select({
41-
id: workflow.id,
42-
name: workflow.name,
43-
description: workflow.description,
44-
isDeployed: workflow.isDeployed,
45-
lastRunAt: workflow.lastRunAt,
46-
})
47-
.from(workflow)
48-
.where(eq(workflow.workspaceId, workspaceId)),
49-
50-
db
51-
.select({
52-
id: knowledgeBase.id,
53-
name: knowledgeBase.name,
54-
description: knowledgeBase.description,
55-
})
56-
.from(knowledgeBase)
57-
.where(and(eq(knowledgeBase.workspaceId, workspaceId), isNull(knowledgeBase.deletedAt))),
58-
59-
db
60-
.select({
61-
id: userTableDefinitions.id,
62-
name: userTableDefinitions.name,
63-
description: userTableDefinitions.description,
64-
})
65-
.from(userTableDefinitions)
66-
.where(eq(userTableDefinitions.workspaceId, workspaceId)),
67-
68-
listWorkspaceFiles(workspaceId),
69-
70-
db
71-
.select({
72-
providerId: account.providerId,
73-
scope: account.scope,
74-
})
75-
.from(account)
76-
.where(eq(account.userId, userId)),
77-
78-
db
79-
.select({
80-
id: copilotChats.id,
81-
title: copilotChats.title,
82-
updatedAt: copilotChats.updatedAt,
83-
})
84-
.from(copilotChats)
85-
.where(
86-
and(
87-
eq(copilotChats.workspaceId, workspaceId),
88-
eq(copilotChats.userId, userId),
89-
eq(copilotChats.type, 'mothership')
30+
db
31+
.select({ id: workspace.id, name: workspace.name, ownerId: workspace.ownerId })
32+
.from(workspace)
33+
.where(eq(workspace.id, workspaceId))
34+
.limit(1)
35+
.then((rows) => rows[0] ?? null),
36+
37+
getUsersWithPermissions(workspaceId),
38+
39+
db
40+
.select({
41+
id: workflow.id,
42+
name: workflow.name,
43+
description: workflow.description,
44+
isDeployed: workflow.isDeployed,
45+
lastRunAt: workflow.lastRunAt,
46+
})
47+
.from(workflow)
48+
.where(eq(workflow.workspaceId, workspaceId)),
49+
50+
db
51+
.select({
52+
id: knowledgeBase.id,
53+
name: knowledgeBase.name,
54+
description: knowledgeBase.description,
55+
})
56+
.from(knowledgeBase)
57+
.where(and(eq(knowledgeBase.workspaceId, workspaceId), isNull(knowledgeBase.deletedAt))),
58+
59+
db
60+
.select({
61+
id: userTableDefinitions.id,
62+
name: userTableDefinitions.name,
63+
description: userTableDefinitions.description,
64+
})
65+
.from(userTableDefinitions)
66+
.where(eq(userTableDefinitions.workspaceId, workspaceId)),
67+
68+
listWorkspaceFiles(workspaceId),
69+
70+
db
71+
.select({
72+
providerId: account.providerId,
73+
scope: account.scope,
74+
})
75+
.from(account)
76+
.where(eq(account.userId, userId)),
77+
78+
db
79+
.select({
80+
id: copilotChats.id,
81+
title: copilotChats.title,
82+
updatedAt: copilotChats.updatedAt,
83+
})
84+
.from(copilotChats)
85+
.where(
86+
and(
87+
eq(copilotChats.workspaceId, workspaceId),
88+
eq(copilotChats.userId, userId),
89+
eq(copilotChats.type, 'mothership')
90+
)
9091
)
91-
)
92-
.orderBy(desc(copilotChats.updatedAt))
93-
.limit(5),
92+
.orderBy(desc(copilotChats.updatedAt))
93+
.limit(5),
9494
])
9595

9696
const sections: string[] = []

0 commit comments

Comments
 (0)