mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-23 12:36:35 +00:00
feat(agent): replace isAi with sessionId & implement admin logs UI
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `is_ai` on the `asset_comments` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "asset_comments" DROP COLUMN "is_ai",
|
||||
ADD COLUMN "session_id" TEXT;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "asset_comments" ADD CONSTRAINT "asset_comments_session_id_fkey" FOREIGN KEY ("session_id") REFERENCES "agent_sessions"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
@@ -429,7 +429,8 @@ model AssetComment {
|
||||
/// [AnnotationList]
|
||||
annotation Json?
|
||||
second Float?
|
||||
isAi Boolean @default(false) @map("is_ai")
|
||||
sessionId String? @map("session_id")
|
||||
session AgentSession? @relation(fields: [sessionId], references: [id], onDelete: SetNull)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
@@ -652,6 +653,7 @@ model AgentSession {
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
entries AgentSessionEntry[]
|
||||
comments AssetComment[]
|
||||
|
||||
@@map("agent_sessions")
|
||||
}
|
||||
|
||||
@@ -141,4 +141,43 @@ describe('Agent API', () => {
|
||||
expect(agentService.deleteAgent).toHaveBeenCalledWith({ agentId: 'agent1' })
|
||||
})
|
||||
})
|
||||
|
||||
describe('GET /teams/:teamId/agent-sessions/:sessionId/entries', () => {
|
||||
it('returns entries of agent session if user is admin', async () => {
|
||||
const mockEntries = [
|
||||
{
|
||||
id: 'entry1',
|
||||
sessionId: 'session1',
|
||||
entry: { step: 1, message: 'Step 1' },
|
||||
},
|
||||
]
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
vi.mocked(agentService.getSessionEntries).mockResolvedValue(mockEntries as any)
|
||||
|
||||
const res = await app.request('/teams/team1/agent-sessions/session1/entries', {
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const data = await res.json()
|
||||
expect(data).toHaveLength(1)
|
||||
expect(data[0].id).toBe('entry1')
|
||||
expect(data[0].entry.step).toBe(1)
|
||||
expect(authzService.hasPermission).toHaveBeenCalledWith({
|
||||
teamId: 'team1',
|
||||
user: undefined,
|
||||
permission: 'Admin',
|
||||
})
|
||||
})
|
||||
|
||||
it('denies access if user is not admin', async () => {
|
||||
vi.mocked(authzService.hasPermission).mockRejectedValue(new Error('Forbidden'))
|
||||
|
||||
const res = await app.request('/teams/team1/agent-sessions/session1/entries', {
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
})
|
||||
|
||||
expect(res.status).toBe(500)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -147,5 +147,25 @@ const route = new Hono<{ Variables: { user: User } }>()
|
||||
|
||||
return new Response(null, { status: 204 })
|
||||
})
|
||||
.get('/teams/:teamId/agent-sessions/:sessionId/entries', async (c) => {
|
||||
const teamId = c.req.param('teamId')
|
||||
const sessionId = c.req.param('sessionId')
|
||||
const userReq = c.get('user')
|
||||
|
||||
await authzService.hasPermission({
|
||||
teamId,
|
||||
user: userReq,
|
||||
permission: Permission.Admin,
|
||||
})
|
||||
|
||||
const entries = await agentService.getSessionEntries({ sessionId })
|
||||
const infos = entries.map((entry) => ({
|
||||
id: entry.id,
|
||||
sessionId: entry.sessionId,
|
||||
entry: entry.entry,
|
||||
}))
|
||||
|
||||
return c.json(infos, 200)
|
||||
})
|
||||
|
||||
export default route
|
||||
|
||||
@@ -157,7 +157,7 @@ describe('file api', () => {
|
||||
mentions: [],
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
isAi: false,
|
||||
sessionId: null,
|
||||
})
|
||||
|
||||
const app = new Hono().use('*', authMiddleware).route('/', fileRoute)
|
||||
@@ -200,7 +200,7 @@ describe('file api', () => {
|
||||
mentions: [],
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
isAi: false,
|
||||
sessionId: null,
|
||||
},
|
||||
],
|
||||
pageInfo: { cursor: 'cursor', total: 1 },
|
||||
|
||||
@@ -98,3 +98,10 @@ export interface DeleteAgentParams {
|
||||
export interface ListAgentsParams {
|
||||
teamId: string
|
||||
}
|
||||
|
||||
export const agentSessionEntrySchema = z.object({
|
||||
id: z.string(),
|
||||
sessionId: z.string(),
|
||||
entry: z.unknown(),
|
||||
})
|
||||
export type AgentSessionEntryInfo = z.infer<typeof agentSessionEntrySchema>
|
||||
|
||||
+2
-2
@@ -173,7 +173,7 @@ export type CommentInfo = {
|
||||
mentions: UserInfo[]
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
isAi: boolean
|
||||
sessionId: string | null
|
||||
}
|
||||
|
||||
export const commentInfoSchema: z.ZodType<CommentInfo> = z.object({
|
||||
@@ -188,7 +188,7 @@ export const commentInfoSchema: z.ZodType<CommentInfo> = z.object({
|
||||
mentions: z.array(userInfoSchema),
|
||||
createdAt: z.string(),
|
||||
updatedAt: z.string(),
|
||||
isAi: z.boolean(),
|
||||
sessionId: z.string().nullable(),
|
||||
})
|
||||
|
||||
export const reparentAssetsRequestSchema = z.object({
|
||||
|
||||
Generated
+4
-4
File diff suppressed because one or more lines are too long
+1
-1
@@ -2905,7 +2905,7 @@ export const AssetCommentScalarFieldEnum = {
|
||||
message: 'message',
|
||||
annotation: 'annotation',
|
||||
second: 'second',
|
||||
isAi: 'isAi',
|
||||
sessionId: 'sessionId',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
assetId: 'assetId',
|
||||
|
||||
+1
-1
@@ -312,7 +312,7 @@ export const AssetCommentScalarFieldEnum = {
|
||||
message: 'message',
|
||||
annotation: 'annotation',
|
||||
second: 'second',
|
||||
isAi: 'isAi',
|
||||
sessionId: 'sessionId',
|
||||
createdAt: 'createdAt',
|
||||
updatedAt: 'updatedAt',
|
||||
assetId: 'assetId',
|
||||
|
||||
+137
@@ -203,6 +203,7 @@ export type AgentSessionWhereInput = {
|
||||
agent?: Prisma.XOR<Prisma.AgentScalarRelationFilter, Prisma.AgentWhereInput>
|
||||
user?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
|
||||
entries?: Prisma.AgentSessionEntryListRelationFilter
|
||||
comments?: Prisma.AssetCommentListRelationFilter
|
||||
}
|
||||
|
||||
export type AgentSessionOrderByWithRelationInput = {
|
||||
@@ -216,6 +217,7 @@ export type AgentSessionOrderByWithRelationInput = {
|
||||
agent?: Prisma.AgentOrderByWithRelationInput
|
||||
user?: Prisma.UserOrderByWithRelationInput
|
||||
entries?: Prisma.AgentSessionEntryOrderByRelationAggregateInput
|
||||
comments?: Prisma.AssetCommentOrderByRelationAggregateInput
|
||||
}
|
||||
|
||||
export type AgentSessionWhereUniqueInput = Prisma.AtLeast<{
|
||||
@@ -232,6 +234,7 @@ export type AgentSessionWhereUniqueInput = Prisma.AtLeast<{
|
||||
agent?: Prisma.XOR<Prisma.AgentScalarRelationFilter, Prisma.AgentWhereInput>
|
||||
user?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
|
||||
entries?: Prisma.AgentSessionEntryListRelationFilter
|
||||
comments?: Prisma.AssetCommentListRelationFilter
|
||||
}, "id">
|
||||
|
||||
export type AgentSessionOrderByWithAggregationInput = {
|
||||
@@ -269,6 +272,7 @@ export type AgentSessionCreateInput = {
|
||||
agent: Prisma.AgentCreateNestedOneWithoutAgentSessionsInput
|
||||
user?: Prisma.UserCreateNestedOneWithoutAgentSessionsInput
|
||||
entries?: Prisma.AgentSessionEntryCreateNestedManyWithoutSessionInput
|
||||
comments?: Prisma.AssetCommentCreateNestedManyWithoutSessionInput
|
||||
}
|
||||
|
||||
export type AgentSessionUncheckedCreateInput = {
|
||||
@@ -280,6 +284,7 @@ export type AgentSessionUncheckedCreateInput = {
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
entries?: Prisma.AgentSessionEntryUncheckedCreateNestedManyWithoutSessionInput
|
||||
comments?: Prisma.AssetCommentUncheckedCreateNestedManyWithoutSessionInput
|
||||
}
|
||||
|
||||
export type AgentSessionUpdateInput = {
|
||||
@@ -291,6 +296,7 @@ export type AgentSessionUpdateInput = {
|
||||
agent?: Prisma.AgentUpdateOneRequiredWithoutAgentSessionsNestedInput
|
||||
user?: Prisma.UserUpdateOneWithoutAgentSessionsNestedInput
|
||||
entries?: Prisma.AgentSessionEntryUpdateManyWithoutSessionNestedInput
|
||||
comments?: Prisma.AssetCommentUpdateManyWithoutSessionNestedInput
|
||||
}
|
||||
|
||||
export type AgentSessionUncheckedUpdateInput = {
|
||||
@@ -302,6 +308,7 @@ export type AgentSessionUncheckedUpdateInput = {
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
entries?: Prisma.AgentSessionEntryUncheckedUpdateManyWithoutSessionNestedInput
|
||||
comments?: Prisma.AssetCommentUncheckedUpdateManyWithoutSessionNestedInput
|
||||
}
|
||||
|
||||
export type AgentSessionCreateManyInput = {
|
||||
@@ -342,6 +349,11 @@ export type AgentSessionOrderByRelationAggregateInput = {
|
||||
_count?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type AgentSessionNullableScalarRelationFilter = {
|
||||
is?: Prisma.AgentSessionWhereInput | null
|
||||
isNot?: Prisma.AgentSessionWhereInput | null
|
||||
}
|
||||
|
||||
export type AgentSessionCountOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
agentId?: Prisma.SortOrder
|
||||
@@ -419,6 +431,22 @@ export type AgentSessionUncheckedUpdateManyWithoutUserNestedInput = {
|
||||
deleteMany?: Prisma.AgentSessionScalarWhereInput | Prisma.AgentSessionScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type AgentSessionCreateNestedOneWithoutCommentsInput = {
|
||||
create?: Prisma.XOR<Prisma.AgentSessionCreateWithoutCommentsInput, Prisma.AgentSessionUncheckedCreateWithoutCommentsInput>
|
||||
connectOrCreate?: Prisma.AgentSessionCreateOrConnectWithoutCommentsInput
|
||||
connect?: Prisma.AgentSessionWhereUniqueInput
|
||||
}
|
||||
|
||||
export type AgentSessionUpdateOneWithoutCommentsNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.AgentSessionCreateWithoutCommentsInput, Prisma.AgentSessionUncheckedCreateWithoutCommentsInput>
|
||||
connectOrCreate?: Prisma.AgentSessionCreateOrConnectWithoutCommentsInput
|
||||
upsert?: Prisma.AgentSessionUpsertWithoutCommentsInput
|
||||
disconnect?: Prisma.AgentSessionWhereInput | boolean
|
||||
delete?: Prisma.AgentSessionWhereInput | boolean
|
||||
connect?: Prisma.AgentSessionWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.AgentSessionUpdateToOneWithWhereWithoutCommentsInput, Prisma.AgentSessionUpdateWithoutCommentsInput>, Prisma.AgentSessionUncheckedUpdateWithoutCommentsInput>
|
||||
}
|
||||
|
||||
export type AgentSessionCreateNestedManyWithoutAgentInput = {
|
||||
create?: Prisma.XOR<Prisma.AgentSessionCreateWithoutAgentInput, Prisma.AgentSessionUncheckedCreateWithoutAgentInput> | Prisma.AgentSessionCreateWithoutAgentInput[] | Prisma.AgentSessionUncheckedCreateWithoutAgentInput[]
|
||||
connectOrCreate?: Prisma.AgentSessionCreateOrConnectWithoutAgentInput | Prisma.AgentSessionCreateOrConnectWithoutAgentInput[]
|
||||
@@ -483,6 +511,7 @@ export type AgentSessionCreateWithoutUserInput = {
|
||||
updatedAt?: Date | string
|
||||
agent: Prisma.AgentCreateNestedOneWithoutAgentSessionsInput
|
||||
entries?: Prisma.AgentSessionEntryCreateNestedManyWithoutSessionInput
|
||||
comments?: Prisma.AssetCommentCreateNestedManyWithoutSessionInput
|
||||
}
|
||||
|
||||
export type AgentSessionUncheckedCreateWithoutUserInput = {
|
||||
@@ -493,6 +522,7 @@ export type AgentSessionUncheckedCreateWithoutUserInput = {
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
entries?: Prisma.AgentSessionEntryUncheckedCreateNestedManyWithoutSessionInput
|
||||
comments?: Prisma.AssetCommentUncheckedCreateNestedManyWithoutSessionInput
|
||||
}
|
||||
|
||||
export type AgentSessionCreateOrConnectWithoutUserInput = {
|
||||
@@ -534,6 +564,66 @@ export type AgentSessionScalarWhereInput = {
|
||||
updatedAt?: Prisma.DateTimeFilter<"AgentSession"> | Date | string
|
||||
}
|
||||
|
||||
export type AgentSessionCreateWithoutCommentsInput = {
|
||||
id?: string
|
||||
cwd: string
|
||||
leafId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
agent: Prisma.AgentCreateNestedOneWithoutAgentSessionsInput
|
||||
user?: Prisma.UserCreateNestedOneWithoutAgentSessionsInput
|
||||
entries?: Prisma.AgentSessionEntryCreateNestedManyWithoutSessionInput
|
||||
}
|
||||
|
||||
export type AgentSessionUncheckedCreateWithoutCommentsInput = {
|
||||
id?: string
|
||||
agentId: string
|
||||
userId?: string | null
|
||||
cwd: string
|
||||
leafId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
entries?: Prisma.AgentSessionEntryUncheckedCreateNestedManyWithoutSessionInput
|
||||
}
|
||||
|
||||
export type AgentSessionCreateOrConnectWithoutCommentsInput = {
|
||||
where: Prisma.AgentSessionWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.AgentSessionCreateWithoutCommentsInput, Prisma.AgentSessionUncheckedCreateWithoutCommentsInput>
|
||||
}
|
||||
|
||||
export type AgentSessionUpsertWithoutCommentsInput = {
|
||||
update: Prisma.XOR<Prisma.AgentSessionUpdateWithoutCommentsInput, Prisma.AgentSessionUncheckedUpdateWithoutCommentsInput>
|
||||
create: Prisma.XOR<Prisma.AgentSessionCreateWithoutCommentsInput, Prisma.AgentSessionUncheckedCreateWithoutCommentsInput>
|
||||
where?: Prisma.AgentSessionWhereInput
|
||||
}
|
||||
|
||||
export type AgentSessionUpdateToOneWithWhereWithoutCommentsInput = {
|
||||
where?: Prisma.AgentSessionWhereInput
|
||||
data: Prisma.XOR<Prisma.AgentSessionUpdateWithoutCommentsInput, Prisma.AgentSessionUncheckedUpdateWithoutCommentsInput>
|
||||
}
|
||||
|
||||
export type AgentSessionUpdateWithoutCommentsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
cwd?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
leafId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
agent?: Prisma.AgentUpdateOneRequiredWithoutAgentSessionsNestedInput
|
||||
user?: Prisma.UserUpdateOneWithoutAgentSessionsNestedInput
|
||||
entries?: Prisma.AgentSessionEntryUpdateManyWithoutSessionNestedInput
|
||||
}
|
||||
|
||||
export type AgentSessionUncheckedUpdateWithoutCommentsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
agentId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
cwd?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
leafId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
entries?: Prisma.AgentSessionEntryUncheckedUpdateManyWithoutSessionNestedInput
|
||||
}
|
||||
|
||||
export type AgentSessionCreateWithoutAgentInput = {
|
||||
id?: string
|
||||
cwd: string
|
||||
@@ -542,6 +632,7 @@ export type AgentSessionCreateWithoutAgentInput = {
|
||||
updatedAt?: Date | string
|
||||
user?: Prisma.UserCreateNestedOneWithoutAgentSessionsInput
|
||||
entries?: Prisma.AgentSessionEntryCreateNestedManyWithoutSessionInput
|
||||
comments?: Prisma.AssetCommentCreateNestedManyWithoutSessionInput
|
||||
}
|
||||
|
||||
export type AgentSessionUncheckedCreateWithoutAgentInput = {
|
||||
@@ -552,6 +643,7 @@ export type AgentSessionUncheckedCreateWithoutAgentInput = {
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
entries?: Prisma.AgentSessionEntryUncheckedCreateNestedManyWithoutSessionInput
|
||||
comments?: Prisma.AssetCommentUncheckedCreateNestedManyWithoutSessionInput
|
||||
}
|
||||
|
||||
export type AgentSessionCreateOrConnectWithoutAgentInput = {
|
||||
@@ -588,6 +680,7 @@ export type AgentSessionCreateWithoutEntriesInput = {
|
||||
updatedAt?: Date | string
|
||||
agent: Prisma.AgentCreateNestedOneWithoutAgentSessionsInput
|
||||
user?: Prisma.UserCreateNestedOneWithoutAgentSessionsInput
|
||||
comments?: Prisma.AssetCommentCreateNestedManyWithoutSessionInput
|
||||
}
|
||||
|
||||
export type AgentSessionUncheckedCreateWithoutEntriesInput = {
|
||||
@@ -598,6 +691,7 @@ export type AgentSessionUncheckedCreateWithoutEntriesInput = {
|
||||
leafId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
comments?: Prisma.AssetCommentUncheckedCreateNestedManyWithoutSessionInput
|
||||
}
|
||||
|
||||
export type AgentSessionCreateOrConnectWithoutEntriesInput = {
|
||||
@@ -624,6 +718,7 @@ export type AgentSessionUpdateWithoutEntriesInput = {
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
agent?: Prisma.AgentUpdateOneRequiredWithoutAgentSessionsNestedInput
|
||||
user?: Prisma.UserUpdateOneWithoutAgentSessionsNestedInput
|
||||
comments?: Prisma.AssetCommentUpdateManyWithoutSessionNestedInput
|
||||
}
|
||||
|
||||
export type AgentSessionUncheckedUpdateWithoutEntriesInput = {
|
||||
@@ -634,6 +729,7 @@ export type AgentSessionUncheckedUpdateWithoutEntriesInput = {
|
||||
leafId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
comments?: Prisma.AssetCommentUncheckedUpdateManyWithoutSessionNestedInput
|
||||
}
|
||||
|
||||
export type AgentSessionCreateManyUserInput = {
|
||||
@@ -653,6 +749,7 @@ export type AgentSessionUpdateWithoutUserInput = {
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
agent?: Prisma.AgentUpdateOneRequiredWithoutAgentSessionsNestedInput
|
||||
entries?: Prisma.AgentSessionEntryUpdateManyWithoutSessionNestedInput
|
||||
comments?: Prisma.AssetCommentUpdateManyWithoutSessionNestedInput
|
||||
}
|
||||
|
||||
export type AgentSessionUncheckedUpdateWithoutUserInput = {
|
||||
@@ -663,6 +760,7 @@ export type AgentSessionUncheckedUpdateWithoutUserInput = {
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
entries?: Prisma.AgentSessionEntryUncheckedUpdateManyWithoutSessionNestedInput
|
||||
comments?: Prisma.AssetCommentUncheckedUpdateManyWithoutSessionNestedInput
|
||||
}
|
||||
|
||||
export type AgentSessionUncheckedUpdateManyWithoutUserInput = {
|
||||
@@ -691,6 +789,7 @@ export type AgentSessionUpdateWithoutAgentInput = {
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
user?: Prisma.UserUpdateOneWithoutAgentSessionsNestedInput
|
||||
entries?: Prisma.AgentSessionEntryUpdateManyWithoutSessionNestedInput
|
||||
comments?: Prisma.AssetCommentUpdateManyWithoutSessionNestedInput
|
||||
}
|
||||
|
||||
export type AgentSessionUncheckedUpdateWithoutAgentInput = {
|
||||
@@ -701,6 +800,7 @@ export type AgentSessionUncheckedUpdateWithoutAgentInput = {
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
entries?: Prisma.AgentSessionEntryUncheckedUpdateManyWithoutSessionNestedInput
|
||||
comments?: Prisma.AssetCommentUncheckedUpdateManyWithoutSessionNestedInput
|
||||
}
|
||||
|
||||
export type AgentSessionUncheckedUpdateManyWithoutAgentInput = {
|
||||
@@ -719,10 +819,12 @@ export type AgentSessionUncheckedUpdateManyWithoutAgentInput = {
|
||||
|
||||
export type AgentSessionCountOutputType = {
|
||||
entries: number
|
||||
comments: number
|
||||
}
|
||||
|
||||
export type AgentSessionCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
entries?: boolean | AgentSessionCountOutputTypeCountEntriesArgs
|
||||
comments?: boolean | AgentSessionCountOutputTypeCountCommentsArgs
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -742,6 +844,13 @@ export type AgentSessionCountOutputTypeCountEntriesArgs<ExtArgs extends runtime.
|
||||
where?: Prisma.AgentSessionEntryWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* AgentSessionCountOutputType without action
|
||||
*/
|
||||
export type AgentSessionCountOutputTypeCountCommentsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.AssetCommentWhereInput
|
||||
}
|
||||
|
||||
|
||||
export type AgentSessionSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
@@ -754,6 +863,7 @@ export type AgentSessionSelect<ExtArgs extends runtime.Types.Extensions.Internal
|
||||
agent?: boolean | Prisma.AgentDefaultArgs<ExtArgs>
|
||||
user?: boolean | Prisma.AgentSession$userArgs<ExtArgs>
|
||||
entries?: boolean | Prisma.AgentSession$entriesArgs<ExtArgs>
|
||||
comments?: boolean | Prisma.AgentSession$commentsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.AgentSessionCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["agentSession"]>
|
||||
|
||||
@@ -796,6 +906,7 @@ export type AgentSessionInclude<ExtArgs extends runtime.Types.Extensions.Interna
|
||||
agent?: boolean | Prisma.AgentDefaultArgs<ExtArgs>
|
||||
user?: boolean | Prisma.AgentSession$userArgs<ExtArgs>
|
||||
entries?: boolean | Prisma.AgentSession$entriesArgs<ExtArgs>
|
||||
comments?: boolean | Prisma.AgentSession$commentsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.AgentSessionCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
export type AgentSessionIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
@@ -813,6 +924,7 @@ export type $AgentSessionPayload<ExtArgs extends runtime.Types.Extensions.Intern
|
||||
agent: Prisma.$AgentPayload<ExtArgs>
|
||||
user: Prisma.$UserPayload<ExtArgs> | null
|
||||
entries: Prisma.$AgentSessionEntryPayload<ExtArgs>[]
|
||||
comments: Prisma.$AssetCommentPayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -1219,6 +1331,7 @@ export interface Prisma__AgentSessionClient<T, Null = never, ExtArgs extends run
|
||||
agent<T extends Prisma.AgentDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AgentDefaultArgs<ExtArgs>>): Prisma.Prisma__AgentClient<runtime.Types.Result.GetResult<Prisma.$AgentPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
user<T extends Prisma.AgentSession$userArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AgentSession$userArgs<ExtArgs>>): Prisma.Prisma__UserClient<runtime.Types.Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
entries<T extends Prisma.AgentSession$entriesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AgentSession$entriesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AgentSessionEntryPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
comments<T extends Prisma.AgentSession$commentsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AgentSession$commentsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AssetCommentPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
@@ -1698,6 +1811,30 @@ export type AgentSession$entriesArgs<ExtArgs extends runtime.Types.Extensions.In
|
||||
distinct?: Prisma.AgentSessionEntryScalarFieldEnum | Prisma.AgentSessionEntryScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* AgentSession.comments
|
||||
*/
|
||||
export type AgentSession$commentsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the AssetComment
|
||||
*/
|
||||
select?: Prisma.AssetCommentSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the AssetComment
|
||||
*/
|
||||
omit?: Prisma.AssetCommentOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.AssetCommentInclude<ExtArgs> | null
|
||||
where?: Prisma.AssetCommentWhereInput
|
||||
orderBy?: Prisma.AssetCommentOrderByWithRelationInput | Prisma.AssetCommentOrderByWithRelationInput[]
|
||||
cursor?: Prisma.AssetCommentWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.AssetCommentScalarFieldEnum | Prisma.AssetCommentScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* AgentSession without action
|
||||
*/
|
||||
|
||||
+233
-56
@@ -40,7 +40,7 @@ export type AssetCommentMinAggregateOutputType = {
|
||||
id: string | null
|
||||
message: string | null
|
||||
second: number | null
|
||||
isAi: boolean | null
|
||||
sessionId: string | null
|
||||
createdAt: Date | null
|
||||
updatedAt: Date | null
|
||||
assetId: string | null
|
||||
@@ -52,7 +52,7 @@ export type AssetCommentMaxAggregateOutputType = {
|
||||
id: string | null
|
||||
message: string | null
|
||||
second: number | null
|
||||
isAi: boolean | null
|
||||
sessionId: string | null
|
||||
createdAt: Date | null
|
||||
updatedAt: Date | null
|
||||
assetId: string | null
|
||||
@@ -65,7 +65,7 @@ export type AssetCommentCountAggregateOutputType = {
|
||||
message: number
|
||||
annotation:PrismaJson.AnnotationList
|
||||
second: number
|
||||
isAi: number
|
||||
sessionId: number
|
||||
createdAt: number
|
||||
updatedAt: number
|
||||
assetId: number
|
||||
@@ -87,7 +87,7 @@ export type AssetCommentMinAggregateInputType = {
|
||||
id?: true
|
||||
message?: true
|
||||
second?: true
|
||||
isAi?: true
|
||||
sessionId?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
assetId?: true
|
||||
@@ -99,7 +99,7 @@ export type AssetCommentMaxAggregateInputType = {
|
||||
id?: true
|
||||
message?: true
|
||||
second?: true
|
||||
isAi?: true
|
||||
sessionId?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
assetId?: true
|
||||
@@ -112,7 +112,7 @@ export type AssetCommentCountAggregateInputType = {
|
||||
message?: true
|
||||
annotation?: true
|
||||
second?: true
|
||||
isAi?: true
|
||||
sessionId?: true
|
||||
createdAt?: true
|
||||
updatedAt?: true
|
||||
assetId?: true
|
||||
@@ -212,7 +212,7 @@ export type AssetCommentGroupByOutputType = {
|
||||
message: string | null
|
||||
annotation:PrismaJson.AnnotationList | null
|
||||
second: number | null
|
||||
isAi: boolean
|
||||
sessionId: string | null
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
assetId: string
|
||||
@@ -248,12 +248,13 @@ export type AssetCommentWhereInput = {
|
||||
message?: Prisma.StringNullableFilter<"AssetComment"> | string | null
|
||||
annotation?: Prisma.JsonNullableFilter<"AssetComment">
|
||||
second?: Prisma.FloatNullableFilter<"AssetComment"> | number | null
|
||||
isAi?: Prisma.BoolFilter<"AssetComment"> | boolean
|
||||
sessionId?: Prisma.StringNullableFilter<"AssetComment"> | string | null
|
||||
createdAt?: Prisma.DateTimeFilter<"AssetComment"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"AssetComment"> | Date | string
|
||||
assetId?: Prisma.StringFilter<"AssetComment"> | string
|
||||
creatorId?: Prisma.StringNullableFilter<"AssetComment"> | string | null
|
||||
replyToId?: Prisma.StringNullableFilter<"AssetComment"> | string | null
|
||||
session?: Prisma.XOR<Prisma.AgentSessionNullableScalarRelationFilter, Prisma.AgentSessionWhereInput> | null
|
||||
asset?: Prisma.XOR<Prisma.AssetScalarRelationFilter, Prisma.AssetWhereInput>
|
||||
creator?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
|
||||
replyTo?: Prisma.XOR<Prisma.AssetCommentNullableScalarRelationFilter, Prisma.AssetCommentWhereInput> | null
|
||||
@@ -266,12 +267,13 @@ export type AssetCommentOrderByWithRelationInput = {
|
||||
message?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
annotation?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
second?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
isAi?: Prisma.SortOrder
|
||||
sessionId?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
assetId?: Prisma.SortOrder
|
||||
creatorId?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
replyToId?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
session?: Prisma.AgentSessionOrderByWithRelationInput
|
||||
asset?: Prisma.AssetOrderByWithRelationInput
|
||||
creator?: Prisma.UserOrderByWithRelationInput
|
||||
replyTo?: Prisma.AssetCommentOrderByWithRelationInput
|
||||
@@ -287,12 +289,13 @@ export type AssetCommentWhereUniqueInput = Prisma.AtLeast<{
|
||||
message?: Prisma.StringNullableFilter<"AssetComment"> | string | null
|
||||
annotation?: Prisma.JsonNullableFilter<"AssetComment">
|
||||
second?: Prisma.FloatNullableFilter<"AssetComment"> | number | null
|
||||
isAi?: Prisma.BoolFilter<"AssetComment"> | boolean
|
||||
sessionId?: Prisma.StringNullableFilter<"AssetComment"> | string | null
|
||||
createdAt?: Prisma.DateTimeFilter<"AssetComment"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"AssetComment"> | Date | string
|
||||
assetId?: Prisma.StringFilter<"AssetComment"> | string
|
||||
creatorId?: Prisma.StringNullableFilter<"AssetComment"> | string | null
|
||||
replyToId?: Prisma.StringNullableFilter<"AssetComment"> | string | null
|
||||
session?: Prisma.XOR<Prisma.AgentSessionNullableScalarRelationFilter, Prisma.AgentSessionWhereInput> | null
|
||||
asset?: Prisma.XOR<Prisma.AssetScalarRelationFilter, Prisma.AssetWhereInput>
|
||||
creator?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
|
||||
replyTo?: Prisma.XOR<Prisma.AssetCommentNullableScalarRelationFilter, Prisma.AssetCommentWhereInput> | null
|
||||
@@ -305,7 +308,7 @@ export type AssetCommentOrderByWithAggregationInput = {
|
||||
message?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
annotation?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
second?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
isAi?: Prisma.SortOrder
|
||||
sessionId?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
assetId?: Prisma.SortOrder
|
||||
@@ -326,7 +329,7 @@ export type AssetCommentScalarWhereWithAggregatesInput = {
|
||||
message?: Prisma.StringNullableWithAggregatesFilter<"AssetComment"> | string | null
|
||||
annotation?: Prisma.JsonNullableWithAggregatesFilter<"AssetComment">
|
||||
second?: Prisma.FloatNullableWithAggregatesFilter<"AssetComment"> | number | null
|
||||
isAi?: Prisma.BoolWithAggregatesFilter<"AssetComment"> | boolean
|
||||
sessionId?: Prisma.StringNullableWithAggregatesFilter<"AssetComment"> | string | null
|
||||
createdAt?: Prisma.DateTimeWithAggregatesFilter<"AssetComment"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"AssetComment"> | Date | string
|
||||
assetId?: Prisma.StringWithAggregatesFilter<"AssetComment"> | string
|
||||
@@ -339,9 +342,9 @@ export type AssetCommentCreateInput = {
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentsInput
|
||||
asset: Prisma.AssetCreateNestedOneWithoutCommentsInput
|
||||
creator?: Prisma.UserCreateNestedOneWithoutCommentsInput
|
||||
replyTo?: Prisma.AssetCommentCreateNestedOneWithoutRepliesInput
|
||||
@@ -354,7 +357,7 @@ export type AssetCommentUncheckedCreateInput = {
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
sessionId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
assetId: string
|
||||
@@ -369,9 +372,9 @@ export type AssetCommentUpdateInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
session?: Prisma.AgentSessionUpdateOneWithoutCommentsNestedInput
|
||||
asset?: Prisma.AssetUpdateOneRequiredWithoutCommentsNestedInput
|
||||
creator?: Prisma.UserUpdateOneWithoutCommentsNestedInput
|
||||
replyTo?: Prisma.AssetCommentUpdateOneWithoutRepliesNestedInput
|
||||
@@ -384,7 +387,7 @@ export type AssetCommentUncheckedUpdateInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
sessionId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
assetId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -399,7 +402,7 @@ export type AssetCommentCreateManyInput = {
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
sessionId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
assetId: string
|
||||
@@ -412,7 +415,6 @@ export type AssetCommentUpdateManyMutationInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
@@ -422,7 +424,7 @@ export type AssetCommentUncheckedUpdateManyInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
sessionId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
assetId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -450,7 +452,7 @@ export type AssetCommentCountOrderByAggregateInput = {
|
||||
message?: Prisma.SortOrder
|
||||
annotation?: Prisma.SortOrder
|
||||
second?: Prisma.SortOrder
|
||||
isAi?: Prisma.SortOrder
|
||||
sessionId?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
assetId?: Prisma.SortOrder
|
||||
@@ -466,7 +468,7 @@ export type AssetCommentMaxOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
message?: Prisma.SortOrder
|
||||
second?: Prisma.SortOrder
|
||||
isAi?: Prisma.SortOrder
|
||||
sessionId?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
assetId?: Prisma.SortOrder
|
||||
@@ -478,7 +480,7 @@ export type AssetCommentMinOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
message?: Prisma.SortOrder
|
||||
second?: Prisma.SortOrder
|
||||
isAi?: Prisma.SortOrder
|
||||
sessionId?: Prisma.SortOrder
|
||||
createdAt?: Prisma.SortOrder
|
||||
updatedAt?: Prisma.SortOrder
|
||||
assetId?: Prisma.SortOrder
|
||||
@@ -651,14 +653,56 @@ export type AssetCommentUpdateOneRequiredWithoutAttachmentsNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.AssetCommentUpdateToOneWithWhereWithoutAttachmentsInput, Prisma.AssetCommentUpdateWithoutAttachmentsInput>, Prisma.AssetCommentUncheckedUpdateWithoutAttachmentsInput>
|
||||
}
|
||||
|
||||
export type AssetCommentCreateNestedManyWithoutSessionInput = {
|
||||
create?: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput> | Prisma.AssetCommentCreateWithoutSessionInput[] | Prisma.AssetCommentUncheckedCreateWithoutSessionInput[]
|
||||
connectOrCreate?: Prisma.AssetCommentCreateOrConnectWithoutSessionInput | Prisma.AssetCommentCreateOrConnectWithoutSessionInput[]
|
||||
createMany?: Prisma.AssetCommentCreateManySessionInputEnvelope
|
||||
connect?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
|
||||
}
|
||||
|
||||
export type AssetCommentUncheckedCreateNestedManyWithoutSessionInput = {
|
||||
create?: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput> | Prisma.AssetCommentCreateWithoutSessionInput[] | Prisma.AssetCommentUncheckedCreateWithoutSessionInput[]
|
||||
connectOrCreate?: Prisma.AssetCommentCreateOrConnectWithoutSessionInput | Prisma.AssetCommentCreateOrConnectWithoutSessionInput[]
|
||||
createMany?: Prisma.AssetCommentCreateManySessionInputEnvelope
|
||||
connect?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
|
||||
}
|
||||
|
||||
export type AssetCommentUpdateManyWithoutSessionNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput> | Prisma.AssetCommentCreateWithoutSessionInput[] | Prisma.AssetCommentUncheckedCreateWithoutSessionInput[]
|
||||
connectOrCreate?: Prisma.AssetCommentCreateOrConnectWithoutSessionInput | Prisma.AssetCommentCreateOrConnectWithoutSessionInput[]
|
||||
upsert?: Prisma.AssetCommentUpsertWithWhereUniqueWithoutSessionInput | Prisma.AssetCommentUpsertWithWhereUniqueWithoutSessionInput[]
|
||||
createMany?: Prisma.AssetCommentCreateManySessionInputEnvelope
|
||||
set?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
|
||||
disconnect?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
|
||||
delete?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
|
||||
connect?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
|
||||
update?: Prisma.AssetCommentUpdateWithWhereUniqueWithoutSessionInput | Prisma.AssetCommentUpdateWithWhereUniqueWithoutSessionInput[]
|
||||
updateMany?: Prisma.AssetCommentUpdateManyWithWhereWithoutSessionInput | Prisma.AssetCommentUpdateManyWithWhereWithoutSessionInput[]
|
||||
deleteMany?: Prisma.AssetCommentScalarWhereInput | Prisma.AssetCommentScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type AssetCommentUncheckedUpdateManyWithoutSessionNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput> | Prisma.AssetCommentCreateWithoutSessionInput[] | Prisma.AssetCommentUncheckedCreateWithoutSessionInput[]
|
||||
connectOrCreate?: Prisma.AssetCommentCreateOrConnectWithoutSessionInput | Prisma.AssetCommentCreateOrConnectWithoutSessionInput[]
|
||||
upsert?: Prisma.AssetCommentUpsertWithWhereUniqueWithoutSessionInput | Prisma.AssetCommentUpsertWithWhereUniqueWithoutSessionInput[]
|
||||
createMany?: Prisma.AssetCommentCreateManySessionInputEnvelope
|
||||
set?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
|
||||
disconnect?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
|
||||
delete?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
|
||||
connect?: Prisma.AssetCommentWhereUniqueInput | Prisma.AssetCommentWhereUniqueInput[]
|
||||
update?: Prisma.AssetCommentUpdateWithWhereUniqueWithoutSessionInput | Prisma.AssetCommentUpdateWithWhereUniqueWithoutSessionInput[]
|
||||
updateMany?: Prisma.AssetCommentUpdateManyWithWhereWithoutSessionInput | Prisma.AssetCommentUpdateManyWithWhereWithoutSessionInput[]
|
||||
deleteMany?: Prisma.AssetCommentScalarWhereInput | Prisma.AssetCommentScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type AssetCommentCreateWithoutCreatorInput = {
|
||||
id?: string
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentsInput
|
||||
asset: Prisma.AssetCreateNestedOneWithoutCommentsInput
|
||||
replyTo?: Prisma.AssetCommentCreateNestedOneWithoutRepliesInput
|
||||
replies?: Prisma.AssetCommentCreateNestedManyWithoutReplyToInput
|
||||
@@ -670,7 +714,7 @@ export type AssetCommentUncheckedCreateWithoutCreatorInput = {
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
sessionId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
assetId: string
|
||||
@@ -713,7 +757,7 @@ export type AssetCommentScalarWhereInput = {
|
||||
message?: Prisma.StringNullableFilter<"AssetComment"> | string | null
|
||||
annotation?: Prisma.JsonNullableFilter<"AssetComment">
|
||||
second?: Prisma.FloatNullableFilter<"AssetComment"> | number | null
|
||||
isAi?: Prisma.BoolFilter<"AssetComment"> | boolean
|
||||
sessionId?: Prisma.StringNullableFilter<"AssetComment"> | string | null
|
||||
createdAt?: Prisma.DateTimeFilter<"AssetComment"> | Date | string
|
||||
updatedAt?: Prisma.DateTimeFilter<"AssetComment"> | Date | string
|
||||
assetId?: Prisma.StringFilter<"AssetComment"> | string
|
||||
@@ -726,9 +770,9 @@ export type AssetCommentCreateWithoutAssetInput = {
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentsInput
|
||||
creator?: Prisma.UserCreateNestedOneWithoutCommentsInput
|
||||
replyTo?: Prisma.AssetCommentCreateNestedOneWithoutRepliesInput
|
||||
replies?: Prisma.AssetCommentCreateNestedManyWithoutReplyToInput
|
||||
@@ -740,7 +784,7 @@ export type AssetCommentUncheckedCreateWithoutAssetInput = {
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
sessionId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
creatorId?: string | null
|
||||
@@ -780,9 +824,9 @@ export type AssetCommentCreateWithoutRepliesInput = {
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentsInput
|
||||
asset: Prisma.AssetCreateNestedOneWithoutCommentsInput
|
||||
creator?: Prisma.UserCreateNestedOneWithoutCommentsInput
|
||||
replyTo?: Prisma.AssetCommentCreateNestedOneWithoutRepliesInput
|
||||
@@ -794,7 +838,7 @@ export type AssetCommentUncheckedCreateWithoutRepliesInput = {
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
sessionId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
assetId: string
|
||||
@@ -813,9 +857,9 @@ export type AssetCommentCreateWithoutReplyToInput = {
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentsInput
|
||||
asset: Prisma.AssetCreateNestedOneWithoutCommentsInput
|
||||
creator?: Prisma.UserCreateNestedOneWithoutCommentsInput
|
||||
replies?: Prisma.AssetCommentCreateNestedManyWithoutReplyToInput
|
||||
@@ -827,7 +871,7 @@ export type AssetCommentUncheckedCreateWithoutReplyToInput = {
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
sessionId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
assetId: string
|
||||
@@ -862,9 +906,9 @@ export type AssetCommentUpdateWithoutRepliesInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
session?: Prisma.AgentSessionUpdateOneWithoutCommentsNestedInput
|
||||
asset?: Prisma.AssetUpdateOneRequiredWithoutCommentsNestedInput
|
||||
creator?: Prisma.UserUpdateOneWithoutCommentsNestedInput
|
||||
replyTo?: Prisma.AssetCommentUpdateOneWithoutRepliesNestedInput
|
||||
@@ -876,7 +920,7 @@ export type AssetCommentUncheckedUpdateWithoutRepliesInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
sessionId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
assetId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -906,9 +950,9 @@ export type AssetCommentCreateWithoutAttachmentsInput = {
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
session?: Prisma.AgentSessionCreateNestedOneWithoutCommentsInput
|
||||
asset: Prisma.AssetCreateNestedOneWithoutCommentsInput
|
||||
creator?: Prisma.UserCreateNestedOneWithoutCommentsInput
|
||||
replyTo?: Prisma.AssetCommentCreateNestedOneWithoutRepliesInput
|
||||
@@ -920,7 +964,7 @@ export type AssetCommentUncheckedCreateWithoutAttachmentsInput = {
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
sessionId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
assetId: string
|
||||
@@ -950,9 +994,9 @@ export type AssetCommentUpdateWithoutAttachmentsInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
session?: Prisma.AgentSessionUpdateOneWithoutCommentsNestedInput
|
||||
asset?: Prisma.AssetUpdateOneRequiredWithoutCommentsNestedInput
|
||||
creator?: Prisma.UserUpdateOneWithoutCommentsNestedInput
|
||||
replyTo?: Prisma.AssetCommentUpdateOneWithoutRepliesNestedInput
|
||||
@@ -964,7 +1008,7 @@ export type AssetCommentUncheckedUpdateWithoutAttachmentsInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
sessionId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
assetId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -973,12 +1017,66 @@ export type AssetCommentUncheckedUpdateWithoutAttachmentsInput = {
|
||||
replies?: Prisma.AssetCommentUncheckedUpdateManyWithoutReplyToNestedInput
|
||||
}
|
||||
|
||||
export type AssetCommentCreateWithoutSessionInput = {
|
||||
id?: string
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
asset: Prisma.AssetCreateNestedOneWithoutCommentsInput
|
||||
creator?: Prisma.UserCreateNestedOneWithoutCommentsInput
|
||||
replyTo?: Prisma.AssetCommentCreateNestedOneWithoutRepliesInput
|
||||
replies?: Prisma.AssetCommentCreateNestedManyWithoutReplyToInput
|
||||
attachments?: Prisma.AssetCommentAttachmentCreateNestedManyWithoutCommentInput
|
||||
}
|
||||
|
||||
export type AssetCommentUncheckedCreateWithoutSessionInput = {
|
||||
id?: string
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
assetId: string
|
||||
creatorId?: string | null
|
||||
replyToId?: string | null
|
||||
replies?: Prisma.AssetCommentUncheckedCreateNestedManyWithoutReplyToInput
|
||||
attachments?: Prisma.AssetCommentAttachmentUncheckedCreateNestedManyWithoutCommentInput
|
||||
}
|
||||
|
||||
export type AssetCommentCreateOrConnectWithoutSessionInput = {
|
||||
where: Prisma.AssetCommentWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput>
|
||||
}
|
||||
|
||||
export type AssetCommentCreateManySessionInputEnvelope = {
|
||||
data: Prisma.AssetCommentCreateManySessionInput | Prisma.AssetCommentCreateManySessionInput[]
|
||||
skipDuplicates?: boolean
|
||||
}
|
||||
|
||||
export type AssetCommentUpsertWithWhereUniqueWithoutSessionInput = {
|
||||
where: Prisma.AssetCommentWhereUniqueInput
|
||||
update: Prisma.XOR<Prisma.AssetCommentUpdateWithoutSessionInput, Prisma.AssetCommentUncheckedUpdateWithoutSessionInput>
|
||||
create: Prisma.XOR<Prisma.AssetCommentCreateWithoutSessionInput, Prisma.AssetCommentUncheckedCreateWithoutSessionInput>
|
||||
}
|
||||
|
||||
export type AssetCommentUpdateWithWhereUniqueWithoutSessionInput = {
|
||||
where: Prisma.AssetCommentWhereUniqueInput
|
||||
data: Prisma.XOR<Prisma.AssetCommentUpdateWithoutSessionInput, Prisma.AssetCommentUncheckedUpdateWithoutSessionInput>
|
||||
}
|
||||
|
||||
export type AssetCommentUpdateManyWithWhereWithoutSessionInput = {
|
||||
where: Prisma.AssetCommentScalarWhereInput
|
||||
data: Prisma.XOR<Prisma.AssetCommentUpdateManyMutationInput, Prisma.AssetCommentUncheckedUpdateManyWithoutSessionInput>
|
||||
}
|
||||
|
||||
export type AssetCommentCreateManyCreatorInput = {
|
||||
id?: string
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
sessionId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
assetId: string
|
||||
@@ -990,9 +1088,9 @@ export type AssetCommentUpdateWithoutCreatorInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
session?: Prisma.AgentSessionUpdateOneWithoutCommentsNestedInput
|
||||
asset?: Prisma.AssetUpdateOneRequiredWithoutCommentsNestedInput
|
||||
replyTo?: Prisma.AssetCommentUpdateOneWithoutRepliesNestedInput
|
||||
replies?: Prisma.AssetCommentUpdateManyWithoutReplyToNestedInput
|
||||
@@ -1004,7 +1102,7 @@ export type AssetCommentUncheckedUpdateWithoutCreatorInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
sessionId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
assetId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -1018,7 +1116,7 @@ export type AssetCommentUncheckedUpdateManyWithoutCreatorInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
sessionId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
assetId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -1030,7 +1128,7 @@ export type AssetCommentCreateManyAssetInput = {
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
sessionId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
creatorId?: string | null
|
||||
@@ -1042,9 +1140,9 @@ export type AssetCommentUpdateWithoutAssetInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
session?: Prisma.AgentSessionUpdateOneWithoutCommentsNestedInput
|
||||
creator?: Prisma.UserUpdateOneWithoutCommentsNestedInput
|
||||
replyTo?: Prisma.AssetCommentUpdateOneWithoutRepliesNestedInput
|
||||
replies?: Prisma.AssetCommentUpdateManyWithoutReplyToNestedInput
|
||||
@@ -1056,7 +1154,7 @@ export type AssetCommentUncheckedUpdateWithoutAssetInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
sessionId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
@@ -1070,7 +1168,7 @@ export type AssetCommentUncheckedUpdateManyWithoutAssetInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
sessionId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
@@ -1082,7 +1180,7 @@ export type AssetCommentCreateManyReplyToInput = {
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
isAi?: boolean
|
||||
sessionId?: string | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
assetId: string
|
||||
@@ -1094,9 +1192,9 @@ export type AssetCommentUpdateWithoutReplyToInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
session?: Prisma.AgentSessionUpdateOneWithoutCommentsNestedInput
|
||||
asset?: Prisma.AssetUpdateOneRequiredWithoutCommentsNestedInput
|
||||
creator?: Prisma.UserUpdateOneWithoutCommentsNestedInput
|
||||
replies?: Prisma.AssetCommentUpdateManyWithoutReplyToNestedInput
|
||||
@@ -1108,7 +1206,7 @@ export type AssetCommentUncheckedUpdateWithoutReplyToInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
sessionId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
assetId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -1122,13 +1220,65 @@ export type AssetCommentUncheckedUpdateManyWithoutReplyToInput = {
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
isAi?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||
sessionId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
assetId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
}
|
||||
|
||||
export type AssetCommentCreateManySessionInput = {
|
||||
id?: string
|
||||
message?: string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: number | null
|
||||
createdAt?: Date | string
|
||||
updatedAt?: Date | string
|
||||
assetId: string
|
||||
creatorId?: string | null
|
||||
replyToId?: string | null
|
||||
}
|
||||
|
||||
export type AssetCommentUpdateWithoutSessionInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
asset?: Prisma.AssetUpdateOneRequiredWithoutCommentsNestedInput
|
||||
creator?: Prisma.UserUpdateOneWithoutCommentsNestedInput
|
||||
replyTo?: Prisma.AssetCommentUpdateOneWithoutRepliesNestedInput
|
||||
replies?: Prisma.AssetCommentUpdateManyWithoutReplyToNestedInput
|
||||
attachments?: Prisma.AssetCommentAttachmentUpdateManyWithoutCommentNestedInput
|
||||
}
|
||||
|
||||
export type AssetCommentUncheckedUpdateWithoutSessionInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
assetId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
replyToId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
replies?: Prisma.AssetCommentUncheckedUpdateManyWithoutReplyToNestedInput
|
||||
attachments?: Prisma.AssetCommentAttachmentUncheckedUpdateManyWithoutCommentNestedInput
|
||||
}
|
||||
|
||||
export type AssetCommentUncheckedUpdateManyWithoutSessionInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
annotation?:PrismaJson.AnnotationList | Prisma.NullableJsonNullValueInput
|
||||
second?: Prisma.NullableFloatFieldUpdateOperationsInput | number | null
|
||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
assetId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
creatorId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
replyToId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Count Type AssetCommentCountOutputType
|
||||
@@ -1174,12 +1324,13 @@ export type AssetCommentSelect<ExtArgs extends runtime.Types.Extensions.Internal
|
||||
message?: boolean
|
||||
annotation?: boolean
|
||||
second?: boolean
|
||||
isAi?: boolean
|
||||
sessionId?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
assetId?: boolean
|
||||
creatorId?: boolean
|
||||
replyToId?: boolean
|
||||
session?: boolean | Prisma.AssetComment$sessionArgs<ExtArgs>
|
||||
asset?: boolean | Prisma.AssetDefaultArgs<ExtArgs>
|
||||
creator?: boolean | Prisma.AssetComment$creatorArgs<ExtArgs>
|
||||
replyTo?: boolean | Prisma.AssetComment$replyToArgs<ExtArgs>
|
||||
@@ -1193,12 +1344,13 @@ export type AssetCommentSelectCreateManyAndReturn<ExtArgs extends runtime.Types.
|
||||
message?: boolean
|
||||
annotation?: boolean
|
||||
second?: boolean
|
||||
isAi?: boolean
|
||||
sessionId?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
assetId?: boolean
|
||||
creatorId?: boolean
|
||||
replyToId?: boolean
|
||||
session?: boolean | Prisma.AssetComment$sessionArgs<ExtArgs>
|
||||
asset?: boolean | Prisma.AssetDefaultArgs<ExtArgs>
|
||||
creator?: boolean | Prisma.AssetComment$creatorArgs<ExtArgs>
|
||||
replyTo?: boolean | Prisma.AssetComment$replyToArgs<ExtArgs>
|
||||
@@ -1209,12 +1361,13 @@ export type AssetCommentSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.
|
||||
message?: boolean
|
||||
annotation?: boolean
|
||||
second?: boolean
|
||||
isAi?: boolean
|
||||
sessionId?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
assetId?: boolean
|
||||
creatorId?: boolean
|
||||
replyToId?: boolean
|
||||
session?: boolean | Prisma.AssetComment$sessionArgs<ExtArgs>
|
||||
asset?: boolean | Prisma.AssetDefaultArgs<ExtArgs>
|
||||
creator?: boolean | Prisma.AssetComment$creatorArgs<ExtArgs>
|
||||
replyTo?: boolean | Prisma.AssetComment$replyToArgs<ExtArgs>
|
||||
@@ -1225,7 +1378,7 @@ export type AssetCommentSelectScalar = {
|
||||
message?: boolean
|
||||
annotation?: boolean
|
||||
second?: boolean
|
||||
isAi?: boolean
|
||||
sessionId?: boolean
|
||||
createdAt?: boolean
|
||||
updatedAt?: boolean
|
||||
assetId?: boolean
|
||||
@@ -1233,8 +1386,9 @@ export type AssetCommentSelectScalar = {
|
||||
replyToId?: boolean
|
||||
}
|
||||
|
||||
export type AssetCommentOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "message" | "annotation" | "second" | "isAi" | "createdAt" | "updatedAt" | "assetId" | "creatorId" | "replyToId", ExtArgs["result"]["assetComment"]>
|
||||
export type AssetCommentOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "message" | "annotation" | "second" | "sessionId" | "createdAt" | "updatedAt" | "assetId" | "creatorId" | "replyToId", ExtArgs["result"]["assetComment"]>
|
||||
export type AssetCommentInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
session?: boolean | Prisma.AssetComment$sessionArgs<ExtArgs>
|
||||
asset?: boolean | Prisma.AssetDefaultArgs<ExtArgs>
|
||||
creator?: boolean | Prisma.AssetComment$creatorArgs<ExtArgs>
|
||||
replyTo?: boolean | Prisma.AssetComment$replyToArgs<ExtArgs>
|
||||
@@ -1243,11 +1397,13 @@ export type AssetCommentInclude<ExtArgs extends runtime.Types.Extensions.Interna
|
||||
_count?: boolean | Prisma.AssetCommentCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
export type AssetCommentIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
session?: boolean | Prisma.AssetComment$sessionArgs<ExtArgs>
|
||||
asset?: boolean | Prisma.AssetDefaultArgs<ExtArgs>
|
||||
creator?: boolean | Prisma.AssetComment$creatorArgs<ExtArgs>
|
||||
replyTo?: boolean | Prisma.AssetComment$replyToArgs<ExtArgs>
|
||||
}
|
||||
export type AssetCommentIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
session?: boolean | Prisma.AssetComment$sessionArgs<ExtArgs>
|
||||
asset?: boolean | Prisma.AssetDefaultArgs<ExtArgs>
|
||||
creator?: boolean | Prisma.AssetComment$creatorArgs<ExtArgs>
|
||||
replyTo?: boolean | Prisma.AssetComment$replyToArgs<ExtArgs>
|
||||
@@ -1256,6 +1412,7 @@ export type AssetCommentIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types
|
||||
export type $AssetCommentPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "AssetComment"
|
||||
objects: {
|
||||
session: Prisma.$AgentSessionPayload<ExtArgs> | null
|
||||
asset: Prisma.$AssetPayload<ExtArgs>
|
||||
creator: Prisma.$UserPayload<ExtArgs> | null
|
||||
replyTo: Prisma.$AssetCommentPayload<ExtArgs> | null
|
||||
@@ -1270,7 +1427,7 @@ export type $AssetCommentPayload<ExtArgs extends runtime.Types.Extensions.Intern
|
||||
*/
|
||||
annotation:PrismaJson.AnnotationList | null
|
||||
second: number | null
|
||||
isAi: boolean
|
||||
sessionId: string | null
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
assetId: string
|
||||
@@ -1670,6 +1827,7 @@ readonly fields: AssetCommentFieldRefs;
|
||||
*/
|
||||
export interface Prisma__AssetCommentClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
session<T extends Prisma.AssetComment$sessionArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AssetComment$sessionArgs<ExtArgs>>): Prisma.Prisma__AgentSessionClient<runtime.Types.Result.GetResult<Prisma.$AgentSessionPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
asset<T extends Prisma.AssetDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AssetDefaultArgs<ExtArgs>>): Prisma.Prisma__AssetClient<runtime.Types.Result.GetResult<Prisma.$AssetPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
creator<T extends Prisma.AssetComment$creatorArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AssetComment$creatorArgs<ExtArgs>>): Prisma.Prisma__UserClient<runtime.Types.Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
replyTo<T extends Prisma.AssetComment$replyToArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AssetComment$replyToArgs<ExtArgs>>): Prisma.Prisma__AssetCommentClient<runtime.Types.Result.GetResult<Prisma.$AssetCommentPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
@@ -1708,7 +1866,7 @@ export interface AssetCommentFieldRefs {
|
||||
readonly message: Prisma.FieldRef<"AssetComment", 'String'>
|
||||
readonly annotation: Prisma.FieldRef<"AssetComment", 'Json'>
|
||||
readonly second: Prisma.FieldRef<"AssetComment", 'Float'>
|
||||
readonly isAi: Prisma.FieldRef<"AssetComment", 'Boolean'>
|
||||
readonly sessionId: Prisma.FieldRef<"AssetComment", 'String'>
|
||||
readonly createdAt: Prisma.FieldRef<"AssetComment", 'DateTime'>
|
||||
readonly updatedAt: Prisma.FieldRef<"AssetComment", 'DateTime'>
|
||||
readonly assetId: Prisma.FieldRef<"AssetComment", 'String'>
|
||||
@@ -2114,6 +2272,25 @@ export type AssetCommentDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.
|
||||
limit?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* AssetComment.session
|
||||
*/
|
||||
export type AssetComment$sessionArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the AgentSession
|
||||
*/
|
||||
select?: Prisma.AgentSessionSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the AgentSession
|
||||
*/
|
||||
omit?: Prisma.AgentSessionOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.AgentSessionInclude<ExtArgs> | null
|
||||
where?: Prisma.AgentSessionWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* AssetComment.creator
|
||||
*/
|
||||
|
||||
@@ -421,7 +421,7 @@ export class AgentService {
|
||||
prompt: string,
|
||||
images: string[],
|
||||
fields: AutofillField[],
|
||||
): Promise<{ text: string; usage: Usage }> {
|
||||
): Promise<{ text: string; usage: Usage; sessionId: string }> {
|
||||
const agent = await this.prismaClient.agent.findFirst({
|
||||
where: {
|
||||
type: 'autofill',
|
||||
@@ -457,7 +457,7 @@ export class AgentService {
|
||||
|
||||
const fullPrompt = `${prompt}\n\nPlease use the "autofill_metadata" tool to provide the extracted metadata.`
|
||||
|
||||
const { usage } = await this.chatWithAgent(
|
||||
const { usage, sessionId } = await this.chatWithAgent(
|
||||
teamId,
|
||||
agent.id,
|
||||
fullPrompt,
|
||||
@@ -471,8 +471,16 @@ export class AgentService {
|
||||
return {
|
||||
text: capturedData ? JSON.stringify(capturedData) : '{}',
|
||||
usage,
|
||||
sessionId,
|
||||
}
|
||||
}
|
||||
|
||||
async getSessionEntries(params: { sessionId: string }) {
|
||||
return this.prismaClient.agentSessionEntry.findMany({
|
||||
where: { sessionId: params.sessionId },
|
||||
orderBy: { id: 'asc' },
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const agentService = new AgentService()
|
||||
|
||||
@@ -507,12 +507,21 @@ describe('AssetService', () => {
|
||||
},
|
||||
})
|
||||
|
||||
// Create a real agent session
|
||||
const session = await prisma.agentSession.create({
|
||||
data: {
|
||||
id: 'session-id-123',
|
||||
agentId: agentUser.id,
|
||||
cwd: process.cwd(),
|
||||
},
|
||||
})
|
||||
|
||||
// Create an AI comment manually using the activity-like logic
|
||||
await prisma.assetComment.create({
|
||||
data: {
|
||||
assetId: assets.fileA1.id,
|
||||
message: 'I am an AI',
|
||||
isAi: true,
|
||||
sessionId: session.id,
|
||||
creatorId: agentUser.id,
|
||||
},
|
||||
})
|
||||
@@ -521,7 +530,7 @@ describe('AssetService', () => {
|
||||
first: 10,
|
||||
})
|
||||
|
||||
const aiComment = list.data.find((c) => c.isAi)
|
||||
const aiComment = list.data.find((c) => !!c.sessionId)
|
||||
expect(aiComment).toBeDefined()
|
||||
expect(aiComment?.creator.id).toBe(agentUser.id)
|
||||
expect(aiComment?.creator.name).toBe('Smart Agent')
|
||||
@@ -632,7 +641,7 @@ describe('AssetService', () => {
|
||||
|
||||
// Check if AI placeholder comments were NOT created here (moved to workflow)
|
||||
const comments = await prisma.assetComment.findMany({
|
||||
where: { assetId: file.id, isAi: true },
|
||||
where: { assetId: file.id, sessionId: { not: null } },
|
||||
})
|
||||
expect(comments.length).toBe(0)
|
||||
|
||||
|
||||
@@ -1058,7 +1058,7 @@ export class AssetService {
|
||||
}
|
||||
|
||||
const creator: UserInfo = { id: '', name: '' }
|
||||
if (c.isAi) {
|
||||
if (c.sessionId) {
|
||||
creator.id = c.creatorId || ''
|
||||
creator.name = c.creator?.name || 'Ai Bot'
|
||||
} else if (c.creator) {
|
||||
@@ -1077,7 +1077,7 @@ export class AssetService {
|
||||
mentions,
|
||||
createdAt: c.createdAt.toISOString(),
|
||||
updatedAt: c.updatedAt.toISOString(),
|
||||
isAi: c.isAi,
|
||||
sessionId: c.sessionId,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,18 @@ import { client } from '@/ui/api/client'
|
||||
import type { AttachmentInfo, CommentInfo } from '@/dtos/asset'
|
||||
import type { UserInfo } from '@/dtos/team'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { Download, File } from 'lucide-react'
|
||||
import { Download, File, Terminal } from 'lucide-react'
|
||||
import React from 'react'
|
||||
import { Avatar, AvatarFallback } from '../ui/avatar'
|
||||
import { Skeleton } from '../ui/skeleton'
|
||||
import Markdown from 'react-markdown'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/ui/components/ui/dialog'
|
||||
|
||||
interface MessageCardProps {
|
||||
teamId?: string
|
||||
@@ -30,6 +37,25 @@ const AI_PLACEHOLDERS: Record<string, string> = {
|
||||
}
|
||||
/* eslint-enable @typescript-eslint/naming-convention */
|
||||
|
||||
interface AgentLogEntry {
|
||||
id: string
|
||||
sessionId: string
|
||||
timestamp?: string
|
||||
entry: {
|
||||
type: string
|
||||
timestamp?: string
|
||||
message?: {
|
||||
role: string
|
||||
content?:
|
||||
| string
|
||||
| Array<{ type: string; text?: string; data?: string; mimeType?: string } | string>
|
||||
toolName?: string
|
||||
toolCallId?: string
|
||||
isError?: boolean
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const MessageCard: React.FC<MessageCardProps> = ({
|
||||
teamId,
|
||||
message: initialMessage,
|
||||
@@ -41,7 +67,9 @@ export const MessageCard: React.FC<MessageCardProps> = ({
|
||||
onViewAttachment,
|
||||
}) => {
|
||||
const isRunning =
|
||||
initialMessage.isAi && !!initialMessage.message && initialMessage.message in AI_PLACEHOLDERS
|
||||
!!initialMessage.sessionId &&
|
||||
!!initialMessage.message &&
|
||||
initialMessage.message in AI_PLACEHOLDERS
|
||||
|
||||
const { data: polledMessage } = useQuery({
|
||||
queryKey: ['teams', teamId, 'comments', initialMessage.id],
|
||||
@@ -64,9 +92,39 @@ export const MessageCard: React.FC<MessageCardProps> = ({
|
||||
|
||||
const message = polledMessage || initialMessage
|
||||
const creator = message.creator
|
||||
const showSkeleton = message.isAi && !!message.message && message.message in AI_PLACEHOLDERS
|
||||
const showSkeleton =
|
||||
!!message.sessionId && !!message.message && message.message in AI_PLACEHOLDERS
|
||||
const loadingText = (message.message && AI_PLACEHOLDERS[message.message]) || 'Generating...'
|
||||
|
||||
const [isLogsOpen, setIsLogsOpen] = React.useState(false)
|
||||
|
||||
const { data: me } = useQuery({
|
||||
queryKey: ['teams', teamId, 'me'],
|
||||
queryFn: async () => {
|
||||
const res = await client.api.teams[':teamId'].me.$get({
|
||||
param: { teamId: teamId! },
|
||||
})
|
||||
if (!res.ok) throw new Error('Failed to fetch current member info')
|
||||
return await res.json()
|
||||
},
|
||||
enabled: !!teamId,
|
||||
staleTime: 300000,
|
||||
})
|
||||
|
||||
const isAdmin = me?.role === 'owner'
|
||||
|
||||
const { data: logs, isLoading: isLogsLoading } = useQuery({
|
||||
queryKey: ['teams', teamId, 'agent-sessions', message.sessionId, 'entries'],
|
||||
queryFn: async () => {
|
||||
const res = await client.api.teams[':teamId']['agent-sessions'][':sessionId'].entries.$get({
|
||||
param: { teamId: teamId!, sessionId: message.sessionId! },
|
||||
})
|
||||
if (!res.ok) throw new Error('Failed to fetch session logs')
|
||||
return await res.json()
|
||||
},
|
||||
enabled: isLogsOpen && !!message.sessionId && !!teamId,
|
||||
})
|
||||
|
||||
const renderFormattedMessage = (text: string) => {
|
||||
const parts = text.split(/(<@[a-zA-Z0-9_-]+>)/g)
|
||||
return parts.map((part, index) => {
|
||||
@@ -122,7 +180,7 @@ export const MessageCard: React.FC<MessageCardProps> = ({
|
||||
<Skeleton className="h-4 w-1/2" />
|
||||
<span className="text-xs text-muted-foreground animate-pulse">{loadingText}</span>
|
||||
</div>
|
||||
) : message.isAi ? (
|
||||
) : message.sessionId ? (
|
||||
<div className="text-sm leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words">
|
||||
<Markdown>{message.message!}</Markdown>
|
||||
</div>
|
||||
@@ -174,6 +232,27 @@ export const MessageCard: React.FC<MessageCardProps> = ({
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Agent Footer */}
|
||||
{message.sessionId && (
|
||||
<div className="mt-3 pt-2 border-t border-foreground/5 flex items-center justify-between text-xs text-muted-foreground/60">
|
||||
<span className="flex items-center gap-1.5 font-medium text-muted-foreground/80">
|
||||
<span className="relative flex h-2 w-2">
|
||||
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-violet-400 opacity-75"></span>
|
||||
<span className="relative inline-flex rounded-full h-2 w-2 bg-violet-500"></span>
|
||||
</span>
|
||||
Created by Agent
|
||||
</span>
|
||||
{isAdmin && (
|
||||
<button
|
||||
onClick={() => setIsLogsOpen(true)}
|
||||
className="px-2.5 py-1 rounded bg-violet-500/10 text-violet-600 dark:text-violet-400 hover:bg-violet-500/20 transition-all font-semibold flex items-center gap-1 shadow-xs border border-violet-500/10 cursor-pointer"
|
||||
>
|
||||
Logs
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Actions */}
|
||||
<div className="mt-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200 flex items-center gap-4">
|
||||
<button
|
||||
@@ -184,6 +263,156 @@ export const MessageCard: React.FC<MessageCardProps> = ({
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Logs Dialog */}
|
||||
<Dialog open={isLogsOpen} onOpenChange={setIsLogsOpen}>
|
||||
<DialogContent className="sm:max-w-2xl max-h-[80vh] flex flex-col p-6 overflow-hidden bg-background/95 backdrop-blur-md border border-foreground/15 shadow-2xl">
|
||||
<DialogHeader className="pb-4 border-b border-foreground/15">
|
||||
<DialogTitle className="flex items-center gap-2 text-xl font-bold">
|
||||
<Terminal className="w-5 h-5 text-violet-500" />
|
||||
Agent Session Logs
|
||||
</DialogTitle>
|
||||
<DialogDescription>
|
||||
Step-by-step execution trace of the agent's background tasks and tool calls.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
<div className="flex-1 overflow-y-auto pr-1 py-4 space-y-4 min-h-0 select-text">
|
||||
{isLogsLoading ? (
|
||||
<div className="space-y-4">
|
||||
<div className="flex gap-4">
|
||||
<Skeleton className="h-5 w-5 rounded-full shrink-0" />
|
||||
<div className="flex-1 space-y-2">
|
||||
<Skeleton className="h-4 w-1/4" />
|
||||
<Skeleton className="h-20 w-full" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-4">
|
||||
<Skeleton className="h-5 w-5 rounded-full shrink-0" />
|
||||
<div className="flex-1 space-y-2">
|
||||
<Skeleton className="h-4 w-1/4" />
|
||||
<Skeleton className="h-12 w-full" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : logs && logs.length > 0 ? (
|
||||
<div className="flex flex-col">
|
||||
{(logs as unknown as AgentLogEntry[]).map((entry) => {
|
||||
const timestampStr = entry.entry?.timestamp || entry.timestamp
|
||||
const timestamp = timestampStr ? new Date(timestampStr).toLocaleTimeString() : ''
|
||||
if (entry.entry && typeof entry.entry === 'object') {
|
||||
const piEntry = entry.entry
|
||||
if (piEntry.type === 'message' && piEntry.message) {
|
||||
const msg = piEntry.message
|
||||
let badgeColor =
|
||||
'bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200'
|
||||
let roleName = msg.role
|
||||
|
||||
if (msg.role === 'user') {
|
||||
badgeColor =
|
||||
'bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300'
|
||||
roleName = 'User'
|
||||
} else if (msg.role === 'assistant') {
|
||||
badgeColor =
|
||||
'bg-violet-100 text-violet-800 dark:bg-violet-900/30 dark:text-violet-300'
|
||||
roleName = 'Agent'
|
||||
} else if (msg.role === 'toolResult') {
|
||||
badgeColor = msg.isError
|
||||
? 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300'
|
||||
: 'bg-emerald-100 text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-300'
|
||||
roleName = `Tool: ${msg.toolName || 'Unknown'}`
|
||||
} else if (msg.role === 'thought') {
|
||||
badgeColor =
|
||||
'bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300'
|
||||
roleName = 'Thinking'
|
||||
}
|
||||
|
||||
// Extract text content
|
||||
let textContent = ''
|
||||
if (typeof msg.content === 'string') {
|
||||
textContent = msg.content
|
||||
} else if (Array.isArray(msg.content)) {
|
||||
textContent = msg.content
|
||||
.map((item) => {
|
||||
if (typeof item === 'string') return item
|
||||
const obj = item as { type?: string; text?: string }
|
||||
if (obj?.type === 'text') return obj.text || ''
|
||||
if (obj?.type === 'image') return '[Image Object]'
|
||||
return JSON.stringify(item)
|
||||
})
|
||||
.join('\n')
|
||||
}
|
||||
|
||||
return (
|
||||
<div key={entry.id} className="relative pl-6 pb-6 last:pb-0">
|
||||
{/* Timeline Line */}
|
||||
<div className="absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden" />
|
||||
|
||||
{/* Timeline Node */}
|
||||
<div
|
||||
className={`absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background flex items-center justify-center ${
|
||||
msg.role === 'user'
|
||||
? 'bg-blue-500'
|
||||
: msg.role === 'assistant'
|
||||
? 'bg-violet-500'
|
||||
: msg.role === 'toolResult'
|
||||
? msg.isError
|
||||
? 'bg-red-500'
|
||||
: 'bg-emerald-500'
|
||||
: 'bg-amber-500'
|
||||
}`}
|
||||
/>
|
||||
|
||||
<div className="flex flex-col gap-1.5 bg-muted/30 dark:bg-muted/10 p-3 rounded-lg border border-foreground/5 backdrop-blur-xs">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<span
|
||||
className={`text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wider ${badgeColor}`}
|
||||
>
|
||||
{roleName}
|
||||
</span>
|
||||
<span className="text-[10px] text-muted-foreground/60">
|
||||
{timestamp}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{textContent && (
|
||||
<div className="text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed font-mono whitespace-pre-wrap overflow-x-auto max-h-48 scrollbar-thin">
|
||||
{textContent}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback for non-message entries or arbitrary entries
|
||||
return (
|
||||
<div key={entry.id} className="relative pl-6 pb-6 last:pb-0">
|
||||
<div className="absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden" />
|
||||
<div className="absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background bg-gray-400" />
|
||||
<div className="bg-muted/30 p-3 rounded-lg border border-foreground/5">
|
||||
<div className="text-[10px] text-muted-foreground/60">{timestamp}</div>
|
||||
<pre className="text-xs text-foreground/80 font-mono overflow-x-auto max-h-48 scrollbar-thin">
|
||||
{JSON.stringify(entry.entry, null, 2)}
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex flex-col items-center justify-center py-12 text-center text-muted-foreground">
|
||||
<Terminal className="w-8 h-8 text-muted-foreground/40 mb-2 animate-pulse" />
|
||||
<p className="text-sm font-medium">No logs found for this session.</p>
|
||||
<p className="text-xs text-muted-foreground/60 mt-1">
|
||||
The session might have been initialized but has not produced any entries yet.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -41,17 +41,61 @@ export async function aiChatActivity(params: AiChatParams) {
|
||||
export interface CreateCommentParams {
|
||||
assetId: string
|
||||
message: string
|
||||
isAi?: boolean
|
||||
sessionId?: string | null
|
||||
agentId?: string | null
|
||||
replyToId?: string | null
|
||||
}
|
||||
|
||||
export async function createCommentActivity(params: CreateCommentParams) {
|
||||
if (params.sessionId) {
|
||||
const agentId = params.agentId && params.agentId !== 'default' ? params.agentId : 'default'
|
||||
|
||||
// Ensure user exists for agent
|
||||
const userExists = await prisma.user.findUnique({ where: { id: agentId } })
|
||||
if (!userExists) {
|
||||
await prisma.user.create({
|
||||
data: {
|
||||
id: agentId,
|
||||
name: 'Ai Agent',
|
||||
email: `${agentId}@shumai.ai`,
|
||||
type: 'agent',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// Ensure agent exists
|
||||
const agentExists = await prisma.agent.findUnique({ where: { id: agentId } })
|
||||
if (!agentExists) {
|
||||
await prisma.agent.create({
|
||||
data: {
|
||||
id: agentId,
|
||||
type: 'chat',
|
||||
config: {
|
||||
provider: 'openai',
|
||||
model: 'gpt-4',
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// Ensure agent session exists
|
||||
const sessionExists = await prisma.agentSession.findUnique({ where: { id: params.sessionId } })
|
||||
if (!sessionExists) {
|
||||
await prisma.agentSession.create({
|
||||
data: {
|
||||
id: params.sessionId,
|
||||
agentId: agentId,
|
||||
cwd: process.cwd(),
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return prisma.assetComment.create({
|
||||
data: {
|
||||
assetId: params.assetId,
|
||||
message: params.message,
|
||||
isAi: params.isAi ?? false,
|
||||
sessionId: params.sessionId ?? null,
|
||||
creatorId: params.agentId && params.agentId !== 'default' ? params.agentId : null,
|
||||
replyToId: params.replyToId,
|
||||
},
|
||||
@@ -61,11 +105,15 @@ export async function createCommentActivity(params: CreateCommentParams) {
|
||||
export interface UpdateCommentParams {
|
||||
commentId: string
|
||||
message: string
|
||||
sessionId?: string | null
|
||||
}
|
||||
|
||||
export async function updateCommentActivity(params: UpdateCommentParams) {
|
||||
return prisma.assetComment.update({
|
||||
where: { id: params.commentId },
|
||||
data: { message: params.message },
|
||||
data: {
|
||||
message: params.message,
|
||||
...(params.sessionId !== undefined ? { sessionId: params.sessionId } : {}),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ describe('AIAutofill Workflow', () => {
|
||||
expect(mockActivities.createCommentActivity).toHaveBeenCalledWith({
|
||||
assetId: 'asset-1',
|
||||
message: '__AUTOFILL__',
|
||||
isAi: true,
|
||||
sessionId: 'task-1',
|
||||
agentId: 'default',
|
||||
})
|
||||
|
||||
@@ -160,7 +160,7 @@ describe('AIAutofill Workflow', () => {
|
||||
expect(mockActivities.createCommentActivity).toHaveBeenCalledWith({
|
||||
assetId: 'asset-1',
|
||||
message: '__AUTOFILL__',
|
||||
isAi: true,
|
||||
sessionId: 'task-1',
|
||||
agentId: 'real-agent-id',
|
||||
})
|
||||
})
|
||||
|
||||
@@ -40,7 +40,7 @@ export async function aiAutofillMedia(task: WorkflowTask): Promise<void> {
|
||||
const placeholder = await executeActivity(TaskQueueDb, createCommentActivity, {
|
||||
assetId: task.assetId,
|
||||
message: '__AUTOFILL__',
|
||||
isAi: true,
|
||||
sessionId: (payload?.session_id as string) || task.id,
|
||||
agentId: (payload?.agentId as string) || 'default',
|
||||
})
|
||||
placeholderCommentId = placeholder.id
|
||||
@@ -148,6 +148,7 @@ export async function aiAutofillMedia(task: WorkflowTask): Promise<void> {
|
||||
await executeActivity(TaskQueueDb, updateCommentActivity, {
|
||||
commentId: placeholderCommentId,
|
||||
message: 'Autofill completed successfully.',
|
||||
sessionId: aiResult.sessionId,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ describe('AIChat Workflow', () => {
|
||||
expect(mockActivities.createCommentActivity).toHaveBeenCalledWith({
|
||||
assetId: 'asset-1',
|
||||
message: '__CHAT__',
|
||||
isAi: true,
|
||||
sessionId: 'pending',
|
||||
agentId: 'bot-1',
|
||||
replyToId: 'comment-1',
|
||||
})
|
||||
@@ -172,7 +172,7 @@ describe('AIChat Workflow', () => {
|
||||
expect(mockActivities.createCommentActivity).toHaveBeenCalledWith({
|
||||
assetId: 'asset-1',
|
||||
message: '__CHAT__',
|
||||
isAi: true,
|
||||
sessionId: 'pending',
|
||||
agentId: 'bot-1',
|
||||
replyToId: 'root-comment-id', // MUST be root, not reply-1
|
||||
})
|
||||
|
||||
@@ -40,7 +40,7 @@ export async function aiChat(task: WorkflowTask): Promise<void> {
|
||||
const placeholder = await executeActivity(TaskQueueDb, createCommentActivity, {
|
||||
assetId: task.assetId,
|
||||
message: '__CHAT__',
|
||||
isAi: true,
|
||||
sessionId: payload?.session_id || 'pending',
|
||||
agentId: payload?.agentId,
|
||||
replyToId: userComment.replyToId ?? userComment.id,
|
||||
})
|
||||
@@ -100,6 +100,7 @@ export async function aiChat(task: WorkflowTask): Promise<void> {
|
||||
await executeActivity(TaskQueueDb, updateCommentActivity, {
|
||||
commentId: placeholderCommentId,
|
||||
message: aiResult.text,
|
||||
sessionId: aiResult.sessionId,
|
||||
})
|
||||
|
||||
// Also store sessionId in comment's metadata if we had such a field,
|
||||
|
||||
@@ -78,7 +78,7 @@ describe('AIEmbedding Workflow', () => {
|
||||
expect(mockActivities.createCommentActivity).toHaveBeenCalledWith({
|
||||
assetId: 'asset-1',
|
||||
message: '__EMBEDDING__',
|
||||
isAi: true,
|
||||
sessionId: 'task-1',
|
||||
agentId: 'default',
|
||||
})
|
||||
|
||||
@@ -136,7 +136,7 @@ describe('AIEmbedding Workflow', () => {
|
||||
expect(mockActivities.createCommentActivity).toHaveBeenCalledWith({
|
||||
assetId: 'asset-1',
|
||||
message: '__EMBEDDING__',
|
||||
isAi: true,
|
||||
sessionId: 'task-1',
|
||||
agentId: 'real-agent-id',
|
||||
})
|
||||
})
|
||||
|
||||
@@ -25,7 +25,7 @@ export async function aiEmbeddingMedia(task: WorkflowTask): Promise<void> {
|
||||
const placeholder = await executeActivity(TaskQueueDb, createCommentActivity, {
|
||||
assetId: task.assetId,
|
||||
message: '__EMBEDDING__',
|
||||
isAi: true,
|
||||
sessionId: (payload?.session_id as string) || task.id,
|
||||
agentId: (payload?.agentId as string) || 'default',
|
||||
})
|
||||
placeholderCommentId = placeholder.id
|
||||
|
||||
@@ -35,7 +35,7 @@ export async function aiTranscriptionMedia(task: WorkflowTask): Promise<void> {
|
||||
const placeholder = await executeActivity(TaskQueueDb, createCommentActivity, {
|
||||
assetId: task.assetId,
|
||||
message: '__TRANSCRIPTION__',
|
||||
isAi: true,
|
||||
sessionId: (payload?.session_id as string) || task.id,
|
||||
agentId: (payload?.agentId as string) || 'default',
|
||||
})
|
||||
placeholderCommentId = placeholder.id
|
||||
|
||||
Reference in New Issue
Block a user