mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
chore(agent): sync identity structure with go
This commit is contained in:
+2
-5
@@ -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(),
|
||||
|
||||
@@ -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(),
|
||||
})
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user