feat: add chat and website updates
This commit is contained in:
@@ -369,6 +369,7 @@ export type DeleteChatRoomOptions = {
|
||||
export type PostChatMessageOptions = {
|
||||
room: string;
|
||||
body: string;
|
||||
authorAgentId?: string;
|
||||
replyToMessageId?: string | null;
|
||||
requestId?: string;
|
||||
};
|
||||
@@ -2911,6 +2912,7 @@ export class DaemonClient {
|
||||
type: "chat/post",
|
||||
room: options.room,
|
||||
body: options.body,
|
||||
...(options.authorAgentId ? { authorAgentId: options.authorAgentId } : {}),
|
||||
...(options.replyToMessageId ? { replyToMessageId: options.replyToMessageId } : {}),
|
||||
},
|
||||
responseType: "chat/post/response",
|
||||
|
||||
@@ -30,6 +30,7 @@ export const ChatPostRequestSchema = z.object({
|
||||
requestId: z.string(),
|
||||
room: z.string(),
|
||||
body: z.string(),
|
||||
authorAgentId: z.string().optional(),
|
||||
replyToMessageId: z.string().optional(),
|
||||
});
|
||||
|
||||
|
||||
@@ -7726,9 +7726,10 @@ export class Session {
|
||||
request: Extract<SessionInboundMessage, { type: "chat/post" }>,
|
||||
): Promise<void> {
|
||||
try {
|
||||
const authorAgentId = request.authorAgentId?.trim() || this.clientId;
|
||||
const message = await this.chatService.postMessage({
|
||||
room: request.room,
|
||||
authorAgentId: this.clientId,
|
||||
authorAgentId,
|
||||
body: request.body,
|
||||
replyToMessageId: request.replyToMessageId,
|
||||
});
|
||||
@@ -7742,7 +7743,7 @@ export class Session {
|
||||
});
|
||||
void notifyChatMentions({
|
||||
room: request.room,
|
||||
authorAgentId: this.clientId,
|
||||
authorAgentId,
|
||||
body: request.body,
|
||||
mentionAgentIds: message.mentionAgentIds,
|
||||
logger: this.sessionLogger,
|
||||
|
||||
Reference in New Issue
Block a user