| export type ResolveNativeCommandSessionTargetsParams = { | |
| agentId: string; | |
| sessionPrefix: string; | |
| userId: string; | |
| targetSessionKey: string; | |
| boundSessionKey?: string; | |
| lowercaseSessionKey?: boolean; | |
| }; | |
| export function resolveNativeCommandSessionTargets( | |
| params: ResolveNativeCommandSessionTargetsParams, | |
| ) { | |
| const rawSessionKey = | |
| params.boundSessionKey ?? `agent:${params.agentId}:${params.sessionPrefix}:${params.userId}`; | |
| return { | |
| sessionKey: params.lowercaseSessionKey ? rawSessionKey.toLowerCase() : rawSessionKey, | |
| commandTargetSessionKey: params.boundSessionKey ?? params.targetSessionKey, | |
| }; | |
| } | |