chore(agent): sync identity structure with go

This commit is contained in:
Acbox
2026-02-18 06:33:01 +08:00
parent 7d72f86152
commit 34f9ec79c7
4 changed files with 2 additions and 21 deletions
+2 -5
View File
@@ -144,9 +144,6 @@ export const createAgent = (
if (identity.currentPlatform) {
headers['X-Memoh-Current-Platform'] = identity.currentPlatform
}
if (identity.replyTarget) {
headers['X-Memoh-Reply-Target'] = identity.replyTarget
}
const attachments = await Promise.all(
input.attachments.map(async (attachment) => {
if (attachment.type !== 'image') {
@@ -286,8 +283,8 @@ export const createAgent = (
]
const text = user(input.query, {
channelIdentityId: identity.channelIdentityId || identity.contactId || '',
displayName: identity.displayName || identity.contactName || 'User',
channelIdentityId: identity.channelIdentityId || '',
displayName: identity.displayName || 'User',
channel: currentChannel,
conversationType: identity.conversationType || 'direct',
date: new Date(),
-5
View File
@@ -28,13 +28,8 @@ export const IdentityContextModel = z.object({
containerId: z.string().min(1, 'Container ID is required'),
channelIdentityId: z.string().min(1, 'Channel identity ID is required'),
displayName: z.string().min(1, 'Display name is required'),
contactId: z.string().optional(),
contactName: z.string().optional(),
contactAlias: z.string().optional(),
userId: z.string().optional(),
currentPlatform: z.string().optional(),
conversationType: z.string().optional(),
replyTarget: z.string().optional(),
sessionToken: z.string().optional(),
})
-8
View File
@@ -6,18 +6,10 @@ import { MCPConnection } from './mcp'
export interface IdentityContext {
botId: string
containerId: string
channelIdentityId: string
displayName: string
contactId?: string
contactName?: string
contactAlias?: string
userId?: string
currentPlatform?: string
conversationType?: string
replyTarget?: string
sessionToken?: string
}
-3
View File
@@ -13,8 +13,5 @@ export const buildIdentityHeaders = (identity: IdentityContext, auth: AgentAuthC
if (identity.currentPlatform) {
headers['X-Memoh-Current-Platform'] = identity.currentPlatform
}
if (identity.replyTarget) {
headers['X-Memoh-Reply-Target'] = identity.replyTarget
}
return headers
}