(
conversationKey: string,
replyTarget: BotReplyTarget,
makeAgent: (threadId: string) => AbstractAgent,
)
| 759 | const store = this.store; |
| 760 | return { |
| 761 | async getOrCreate( |
| 762 | conversationKey: string, |
| 763 | replyTarget: BotReplyTarget, |
| 764 | makeAgent: (threadId: string) => AbstractAgent, |
| 765 | ): Promise<AgentSession> { |
| 766 | const idx = conversationKey.indexOf("::"); |
| 767 | const channelId = |
| 768 | idx >= 0 ? conversationKey.slice(0, idx) : conversationKey; |
| 769 | const scope = idx >= 0 ? conversationKey.slice(idx + 2) : DM_SCOPE; |
| 770 | const key: ConversationKey = { channelId, scope }; |
| 771 | const session = await store.getOrCreate( |
| 772 | key, |
| 773 | replyTarget as ReplyTarget, |
| 774 | makeAgent as unknown as Parameters< |
| 775 | SlackConversationStore["getOrCreate"] |
| 776 | >[2], |
| 777 | ); |
| 778 | return { agent: session.agent as unknown as AbstractAgent }; |
| 779 | }, |
| 780 | }; |
| 781 | } |
| 782 |
nothing calls this directly
no test coverage detected