Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Agentforce Service Agent #13

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7941f54
chore: metadata formatting
muenzpraeger Oct 28, 2024
5ee398a
fix: remove not needed metatdata on Contact object
muenzpraeger Oct 28, 2024
cb6f7b5
feat: enable S3 trusted site for all experiences
muenzpraeger Oct 28, 2024
6f736b4
feat: add new bot metadata for EmployeeCopilot
muenzpraeger Oct 28, 2024
189e8a6
feat: add/update GenAI metadata
muenzpraeger Oct 28, 2024
38f098f
feat: add new context class for Experience Site detection
muenzpraeger Oct 28, 2024
a4c2b2f
feat: add updated Experience Apex classes
muenzpraeger Oct 28, 2024
e9e5079
feat: add year check to Apex weather class for LLM hardening
muenzpraeger Oct 28, 2024
3738f4c
feat: add error handling to SocialMediasPostsController
muenzpraeger Oct 28, 2024
9ebf11a
feat: LWC updates from workshop
muenzpraeger Oct 28, 2024
fa0022e
feat: align deploy command for base source directory
muenzpraeger Oct 28, 2024
3252dd2
feat: add Agentforce Service Agent metadata
muenzpraeger Oct 28, 2024
35770f0
fix: add messageChannels to base package
muenzpraeger Oct 28, 2024
de242fe
feat: add local invocation of Service Agent setup
muenzpraeger Oct 28, 2024
b3756c8
fix: update query for service channel in service setup script
muenzpraeger Oct 28, 2024
c065bbe
feat: add service package and string replacements to project setup
muenzpraeger Oct 28, 2024
ddeec67
feat: update DC package / automate S3 connection setup
muenzpraeger Oct 28, 2024
218d63f
feat: add ASA setup instructions
muenzpraeger Oct 28, 2024
c1c910c
fix: update LWC tests
muenzpraeger Oct 28, 2024
64f8c79
fix: typo in prompt variable
muenzpraeger Oct 28, 2024
c8c5a77
fix: bulkify service agent user setup
muenzpraeger Oct 28, 2024
231805e
fix: move to placeholders for Route_to_Queue flow
muenzpraeger Oct 28, 2024
f31de60
feat: LWC best practices and various fixes on Experiences site compon…
pozil Nov 6, 2024
a0830d3
feat: check that jq is installed (#21)
pozil Nov 6, 2024
700f655
feat: add description to site
pozil Nov 6, 2024
60c75bb
feat: add multi-os commands to service setup (#24)
muenzpraeger Nov 6, 2024
cb96f09
feat: site guest profile and perms (#22)
pozil Nov 6, 2024
c8cabbd
feat: fixed all images in experience cloud site (#25)
pozil Nov 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .forceignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ package.xml
**/flowDefinitions/**
**/objectTranslations/**
**/profiles/**
**/profilePasswordPolicies/**
**/profileSessionSettings/**
**/settings/**
**/sharingRules/**

# Data Cloud metadata
**/activationPlatforms/**
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ If you need to [update the Salesforce CLI](https://developer.salesforce.com/docs
1. Deploy the app metadata.

```bash
sf project deploy start
sf project deploy start -d force-app
```

1. Assign the Coral Cloud permission set to the default user.
Expand All @@ -101,7 +101,7 @@ If you need to [update the Salesforce CLI](https://developer.salesforce.com/docs
1. Install a Data Kit to add Data Cloud components to your org.

```bash
sf package install -p 04tHr000000ku0X -w 10
sf package install -p 04tHr000000ku4k -w 10
```

1. If your org isn't already open, open it now:
Expand Down
1 change: 1 addition & 0 deletions apex-scripts/setup-agent-user.apex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SetupServiceAgentUser.setup();
83 changes: 83 additions & 0 deletions bin/install-service.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/bin/bash
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd $SCRIPT_PATH/..

echo ""
echo "Installing Coral Cloud - Service"
echo ""

# Ensure that jq is installed
if ! command -v jq 2>&1 >/dev/null
then
echo "jq could not be found. Please install it from https://jqlang.github.io/jq/"
exit 1
fi

# Get default org alias
VALUE_REGEX='"value": "([a-zA-Z0-9_\-]+)"'
DEFAULT_ORG_INFO=$(sf config get target-org --json)
if [[ $DEFAULT_ORG_INFO =~ $VALUE_REGEX ]]
then
ORG_ALIAS="${BASH_REMATCH[1]}"
echo "Using current default org: $ORG_ALIAS"
echo "Exporting org alias and subdomain for use in scripts:"
ORG_INFO=$(sf org display --json)
export SF_CC_PLACEHOLDER_USERNAME=$(echo $ORG_INFO | jq -r '.result | .username')
echo "- Username: $SF_CC_PLACEHOLDER_USERNAME"
export SF_CC_PLACEHOLDER_DOMAIN=$(echo $ORG_INFO | jq -r '.result | .instanceUrl | sub("https?://"; "") | split(".")[0]')
echo "- Domain: $SF_CC_PLACEHOLDER_DOMAIN"
echo ""
else
echo "Installation failed: could not retrieve default org alias."
exit 1
fi

echo "Pushing Service Agent Setup source..." && \
sf project deploy start -d cc-service-app/main/setup/classes/SetupServiceAgentUser.cls -d cc-service-app/main/default/permissionSets/Coral_Cloud_Service_Agent.permissionset-meta.xml && \
echo "" && \

echo "Setting up Service Agent user..." && \
sf apex run -f apex-scripts/setup-agent-user.apex && \
echo "" && \

echo "Pushing source..." && \
export SF_CC_PLACEHOLDER_FLOW_AGENT_ID="DummyForInitialDeploy" && \
export SF_CC_PLACEHOLDER_FLOW_CHANNEL_ID="DummyForInitialDeploy" && \
export SF_CC_PLACEHOLDER_FLOW_QUEUE_ID="DummyForInitialDeploy" && \
sf project deploy start -d cc-service-app && \
echo "" && \

echo "Redeploying flow metadata with org specific values..." && \
export SF_CC_PLACEHOLDER_FLOW_AGENT_ID=$(sf data query --query "SELECT Id from BotDefinition WHERE DeveloperName='Coral_Cloud_Agent'" --json | jq -r '.result | .records[0] | .Id') && \
echo "Agent ID: $SF_CC_PLACEHOLDER_FLOW_AGENT_ID" && \
export SF_CC_PLACEHOLDER_FLOW_CHANNEL_ID=$(sf data query --query "SELECT Id from ServiceChannel WHERE DeveloperName='sfdc_livemessage'" --json | jq -r '.result | .records[0] | .Id') && \
echo "Channel ID: $SF_CC_PLACEHOLDER_FLOW_CHANNEL_ID" && \
export SF_CC_PLACEHOLDER_FLOW_QUEUE_ID=$(sf data query --query "SELECT Id FROM Group WHERE Type = 'Queue' AND Name = 'Messaging Queue'" --json | jq -r '.result | .records[0] | .Id') && \
echo "Queue ID: $SF_CC_PLACEHOLDER_FLOW_QUEUE_ID" && \
sf project deploy start -d cc-service-app/main/default/flows/Route_to_Agent.flow-meta.xml cc-service-app/main/default/flows/Route_to_Queue.flow-meta.xml && \
echo "" && \

echo "Publishing Experience Cloud site..." && \
sf community publish --name 'coral cloud' && \
echo "" && \

echo "Deploying guest profile for Experience Cloud site..." && \
sf project deploy start --metadata-dir=guest-profile-metadata -w 10 && \
echo "" && \

echo "Opening org..." && \
sf org open -p /lightning/setup/LiveMessageSetup/home && \
echo ""
EXIT_CODE="$?"

# Check exit code
echo ""
if [ "$EXIT_CODE" -eq 0 ]; then
echo "Installation completed."
echo ""
echo "Experience Cloud URL: https://${SF_CC_PLACEHOLDER_DOMAIN}.develop.my.site.com/"
echo ""
else
echo "Installation failed."
fi
exit $EXIT_CODE
6 changes: 3 additions & 3 deletions bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd $SCRIPT_PATH/..

echo ""
echo "Installing Coral Cloud"
echo "Installing Coral Cloud - Base"
echo ""

# Get default org alias
Expand Down Expand Up @@ -52,7 +52,7 @@ then
fi

echo "Pushing source..." && \
sf project deploy start && \
sf project deploy start -d force-app && \
echo "" && \

echo "Assigning permission sets..." && \
Expand All @@ -68,7 +68,7 @@ sf apex run -f apex-scripts/setup.apex && \
echo "" && \

echo "Installing Data Kit..." && \
sf package install -p 04tHr000000ku0X -w 10 && \
sf package install -p 04tHr000000ku4k -w 10 && \
echo "" && \

echo "Opening org..." && \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<EmbeddedServiceConfig xmlns="http://soap.sforce.com/2006/04/metadata">
<areGuestUsersAllowed>false</areGuestUsersAllowed>
<deploymentFeature>EmbeddedMessaging</deploymentFeature>
<deploymentType>Web</deploymentType>
<embeddedServiceMessagingChannel>
<isEnabled>true</isEnabled>
<messagingChannel>Agent_Channel</messagingChannel>
<shouldShowDeliveryReceipts>false</shouldShowDeliveryReceipts>
<shouldShowEmojiSelection>false</shouldShowEmojiSelection>
<shouldShowReadReceipts>false</shouldShowReadReceipts>
<shouldShowTypingIndicators>false</shouldShowTypingIndicators>
<shouldStartNewLineOnEnter>false</shouldStartNewLineOnEnter>
</embeddedServiceMessagingChannel>
<isEnabled>true</isEnabled>
<isTermsAndConditionsEnabled>false</isTermsAndConditionsEnabled>
<isTermsAndConditionsRequired>false</isTermsAndConditionsRequired>
<masterLabel>Agent Web Deployment</masterLabel>
<shouldHideAuthDialog>false</shouldHideAuthDialog>
<site>ESW_Agent_Web_Deployment_17296990144201</site>
</EmbeddedServiceConfig>
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Bot xmlns="http://soap.sforce.com/2006/04/metadata">
<agentType>EinsteinServiceAgent</agentType>
<botMlDomain>
<label>Coral Cloud Agent</label>
<name>Coral_Cloud_Agent</name>
</botMlDomain>
<botUser>agent-%%SF_CC_PLACEHOLDER_USERNAME%%</botUser>
<contextVariables>
<contextVariableMappings>
<SObjectType>MessagingEndUser</SObjectType>
<fieldName>MessagingEndUser.ContactId</fieldName>
<messageType>EmbeddedMessaging</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingEndUser</SObjectType>
<fieldName>MessagingEndUser.ContactId</fieldName>
<messageType>Line</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingEndUser</SObjectType>
<fieldName>MessagingEndUser.ContactId</fieldName>
<messageType>AppleBusinessChat</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingEndUser</SObjectType>
<fieldName>MessagingEndUser.ContactId</fieldName>
<messageType>Text</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingEndUser</SObjectType>
<fieldName>MessagingEndUser.ContactId</fieldName>
<messageType>Facebook</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingEndUser</SObjectType>
<fieldName>MessagingEndUser.ContactId</fieldName>
<messageType>WhatsApp</messageType>
</contextVariableMappings>
<dataType>Id</dataType>
<developerName>ContactId</developerName>
<label>Contact Id</label>
</contextVariables>
<contextVariables>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.MessagingEndUserId</fieldName>
<messageType>Line</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.MessagingEndUserId</fieldName>
<messageType>EmbeddedMessaging</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.MessagingEndUserId</fieldName>
<messageType>WhatsApp</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.MessagingEndUserId</fieldName>
<messageType>Facebook</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.MessagingEndUserId</fieldName>
<messageType>Text</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.MessagingEndUserId</fieldName>
<messageType>AppleBusinessChat</messageType>
</contextVariableMappings>
<dataType>Id</dataType>
<developerName>EndUserId</developerName>
<label>End User Id</label>
</contextVariables>
<contextVariables>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.EndUserLanguage</fieldName>
<messageType>WhatsApp</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.EndUserLanguage</fieldName>
<messageType>Facebook</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.EndUserLanguage</fieldName>
<messageType>AppleBusinessChat</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.EndUserLanguage</fieldName>
<messageType>Line</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.EndUserLanguage</fieldName>
<messageType>EmbeddedMessaging</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.EndUserLanguage</fieldName>
<messageType>Text</messageType>
</contextVariableMappings>
<dataType>Text</dataType>
<developerName>EndUserLanguage</developerName>
<label>End User Language</label>
</contextVariables>
<contextVariables>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.Id</fieldName>
<messageType>Line</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.Id</fieldName>
<messageType>AppleBusinessChat</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.Id</fieldName>
<messageType>Text</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.Id</fieldName>
<messageType>WhatsApp</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.Id</fieldName>
<messageType>Facebook</messageType>
</contextVariableMappings>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.Id</fieldName>
<messageType>EmbeddedMessaging</messageType>
</contextVariableMappings>
<dataType>Id</dataType>
<developerName>RoutableId</developerName>
<label>Routable Id</label>
</contextVariables>
<defaultOutboundFlow>Route_to_Queue</defaultOutboundFlow>
<description
>This is the Coral Cloud Agent that helps customers learn more about Experiences as
well as book sessions.</description>
<label>Coral Cloud Agent</label>
<logPrivateConversationData>false</logPrivateConversationData>
<richContentEnabled>true</richContentEnabled>
<sessionTimeout>480</sessionTimeout>
<type>ExternalCopilot</type>
</Bot>
Loading