Restructure omni services and add Chatwoot research snapshot

This commit is contained in:
Ruslan Bakiev
2026-02-21 11:11:27 +07:00
parent edea7a0034
commit b73babbbf6
7732 changed files with 978203 additions and 32 deletions

View File

@@ -0,0 +1,27 @@
class Captain::Tools::ResolveConversationTool < Captain::Tools::BasePublicTool
description 'Resolve a conversation when the issue has been addressed or the conversation should be closed'
param :reason, type: 'string', desc: 'Brief reason for resolving the conversation', required: true
def perform(tool_context, reason:)
conversation = find_conversation(tool_context.state)
return 'Conversation not found' unless conversation
return "Conversation ##{conversation.display_id} is already resolved" if conversation.resolved?
log_tool_usage('resolve_conversation', { conversation_id: conversation.id, reason: reason })
Current.captain_resolve_reason = reason
begin
conversation.resolved!
ensure
Current.captain_resolve_reason = nil
end
"Conversation ##{conversation.display_id} resolved#{" (Reason: #{reason})" if reason}"
end
private
def permissions
%w[conversation_manage conversation_unassigned_manage conversation_participating_manage]
end
end