@salesforce/afv-skills 1.10.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/applying-cms-brand/SKILL.md +170 -0
- package/skills/implementing-ui-bundle-agentforce-conversation-client/SKILL.md +114 -198
- package/skills/implementing-ui-bundle-agentforce-conversation-client/references/agent-id-resolution.md +46 -0
- package/skills/implementing-ui-bundle-agentforce-conversation-client/references/style-tokens.md +18 -6
- package/skills/integrating-b2b-commerce-open-code-components/SKILL.md +166 -0
- package/skills/running-code-analyzer/SKILL.md +499 -0
- package/skills/running-code-analyzer/examples/README.md +38 -0
- package/skills/running-code-analyzer/examples/basic-scan-output.json +92 -0
- package/skills/running-code-analyzer/examples/command-variations.md +333 -0
- package/skills/running-code-analyzer/examples/fix-application-before-after.md +142 -0
- package/skills/running-code-analyzer/examples/large-scan-output.json +67 -0
- package/skills/running-code-analyzer/examples/security-focused-output.json +95 -0
- package/skills/running-code-analyzer/references/command-examples.md +27 -0
- package/skills/running-code-analyzer/references/engine-reference.md +34 -0
- package/skills/running-code-analyzer/references/error-handling.md +29 -0
- package/skills/running-code-analyzer/references/flag-reference.md +96 -0
- package/skills/running-code-analyzer/references/quick-start.md +28 -0
- package/skills/running-code-analyzer/references/special-behaviors.md +83 -0
- package/skills/running-code-analyzer/references/vendor-file-handling.md +239 -0
- package/skills/running-code-analyzer/scripts/apply-fixes.js +86 -0
- package/skills/running-code-analyzer/scripts/discover-fixes.js +34 -0
- package/skills/running-code-analyzer/scripts/filter-violations.js +405 -0
- package/skills/running-code-analyzer/scripts/parse-results.js +59 -0
- package/skills/running-code-analyzer/scripts/summarize-fixes.js +32 -0
- package/skills/running-code-analyzer/scripts/verify-execution.sh +28 -0
package/package.json
CHANGED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: applying-cms-brand
|
|
3
|
+
description: "Extracts, retrieves, and applies CMS brand guidelines (voice, tone, style, colors, typography) to generated content. Use this skill ANY TIME a user request involves branding, brand voice, brand tone, brand guidelines, brand identity, brand styling, or applying a brand to content. Triggers for requests like \"apply my brand\", \"use our brand voice\", \"match our brand guidelines\", \"find my brand\", \"search for brand\", \"get brand instructions\", \"apply brand tone\". Handles the full workflow: searching for brands in Salesforce CMS, extracting brand instructions, and applying brand voice/tone/guidelines to generated content. Does not apply to media/image search (use searching-media skill), logo search, or creating new brand definitions."
|
|
4
|
+
compatibility: "Requires get_brand_instructions and/or search_brands MCP tools"
|
|
5
|
+
metadata:
|
|
6
|
+
version: "1.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Applying CMS Brand
|
|
10
|
+
|
|
11
|
+
Universal skill for searching, extracting, and applying CMS brand guidelines to generated content.
|
|
12
|
+
|
|
13
|
+
## Scope
|
|
14
|
+
|
|
15
|
+
**This skill is for APPLYING existing brand guidelines from Salesforce CMS to content you generate.**
|
|
16
|
+
|
|
17
|
+
**Use this skill when the user wants to:**
|
|
18
|
+
- Apply their brand voice/tone to generated content
|
|
19
|
+
- Find and use brand guidelines stored in Salesforce CMS
|
|
20
|
+
- Search for an existing brand in their org
|
|
21
|
+
- Get brand instructions for content generation
|
|
22
|
+
- Ensure generated content matches their brand identity
|
|
23
|
+
- Apply brand styling, tone, or voice to a page, component, or app
|
|
24
|
+
|
|
25
|
+
**DO NOT use this skill when the user wants to:**
|
|
26
|
+
- Search for images or media (use searching-media skill)
|
|
27
|
+
- Create a new brand from scratch
|
|
28
|
+
- Edit brand definitions in CMS
|
|
29
|
+
- Generate logos or visual brand assets
|
|
30
|
+
|
|
31
|
+
## Before You Start
|
|
32
|
+
|
|
33
|
+
**CRITICAL: You must retrieve brand instructions BEFORE generating or modifying any brand.**
|
|
34
|
+
|
|
35
|
+
When a user requests branded content:
|
|
36
|
+
|
|
37
|
+
1. **Search for available brands** (if brand is not already identified)
|
|
38
|
+
2. **Extract brand instructions** for the selected brand
|
|
39
|
+
3. **Apply brand guidelines** to all content you generate
|
|
40
|
+
|
|
41
|
+
**Never generate content first and retrofit branding later.** Brand instructions must inform content generation from the start.
|
|
42
|
+
|
|
43
|
+
## Workflow Overview
|
|
44
|
+
|
|
45
|
+
Copy this checklist and track your progress:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
CMS Branding Progress:
|
|
49
|
+
- [ ] Step 1: Determine if brand is already identified or needs search
|
|
50
|
+
- [ ] Step 2: Search for brands (if needed) and present options to user
|
|
51
|
+
- [ ] Step 3: Extract brand instructions for the selected brand
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Step 1: Determine Brand Context
|
|
55
|
+
|
|
56
|
+
Check if the user has already specified which brand to use:
|
|
57
|
+
|
|
58
|
+
**Brand is known** (user named it, or only one brand exists):
|
|
59
|
+
- Skip to Step 3 (Extract Brand Instructions)
|
|
60
|
+
|
|
61
|
+
**Brand is unknown** (user says "apply my brand" without specifying which):
|
|
62
|
+
- Proceed to Step 2 (Search for Brands)
|
|
63
|
+
|
|
64
|
+
## Step 2: Search for Brands
|
|
65
|
+
|
|
66
|
+
**Tool:** `search_brands`
|
|
67
|
+
|
|
68
|
+
**Process:**
|
|
69
|
+
|
|
70
|
+
1. **Determine search query** — Use the user's description, company name, or a general keyword
|
|
71
|
+
2. **Build the request:**
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"inputs": [{
|
|
76
|
+
"searchQuery": "keyword or brand name"
|
|
77
|
+
}]
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
3. **Call `search_brands`** with the query
|
|
82
|
+
4. **Parse the response** — Extract brand results:
|
|
83
|
+
- `managedContentId` — Unique ID (use this for extraction in Step 3)
|
|
84
|
+
- `managedContentKey` — Content key identifier
|
|
85
|
+
- `title` — Brand display name
|
|
86
|
+
- `contentUrl` — URL to the brand content
|
|
87
|
+
- `totalResults` — Number of brands found
|
|
88
|
+
|
|
89
|
+
### Presenting Brand Results
|
|
90
|
+
|
|
91
|
+
**If multiple brands found**, use `ask_followup_question` to present options:
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
I found [N] brands in your CMS. Which one should I apply?
|
|
95
|
+
|
|
96
|
+
1. [Brand Title 1]
|
|
97
|
+
2. [Brand Title 2]
|
|
98
|
+
3. [Brand Title 3]
|
|
99
|
+
|
|
100
|
+
Which brand would you like to use?
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**If one brand found**, confirm with the user:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
I found the brand "[Brand Title]". Should I apply this brand's guidelines to the content?
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**If no brands found:**
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
No brands found in Salesforce CMS. To use branding:
|
|
113
|
+
1. Create a brand in Salesforce CMS (Content Type: sfdc_cms__brand)
|
|
114
|
+
2. Provide brand guidelines directly in this conversation
|
|
115
|
+
|
|
116
|
+
Would you like to proceed without CMS branding, or provide guidelines manually?
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Never auto-select a brand without confirmation.** Always wait for user choice.
|
|
120
|
+
|
|
121
|
+
## Step 3: Extract Brand Instructions
|
|
122
|
+
|
|
123
|
+
**Tool:** `get_brand_instructions`
|
|
124
|
+
|
|
125
|
+
**Process:**
|
|
126
|
+
|
|
127
|
+
1. **Call `get_brand_instructions`** — This retrieves the branding extraction prompt template
|
|
128
|
+
2. **Parse the response:**
|
|
129
|
+
- `promptBody` — Contains the full brand instruction prompt with extraction and application rules
|
|
130
|
+
|
|
131
|
+
3. **Follow the instructions in `promptBody`** — The prompt template contains specific guidance on:
|
|
132
|
+
- How to extract brand properties from the brand content
|
|
133
|
+
- Brand voice and tone rules
|
|
134
|
+
- Typography and color guidelines
|
|
135
|
+
- Content formatting rules
|
|
136
|
+
- Guardrails and restrictions
|
|
137
|
+
|
|
138
|
+
### What Brand Instructions Contain
|
|
139
|
+
|
|
140
|
+
The extracted brand instructions typically include:
|
|
141
|
+
|
|
142
|
+
| Property | Description |
|
|
143
|
+
|---|---|
|
|
144
|
+
| Brand Voice | How the brand speaks (e.g., professional, friendly, authoritative) |
|
|
145
|
+
| Brand Tone | Emotional quality of communication (e.g., confident, warm, empathetic) |
|
|
146
|
+
| Key Messages | Core messaging pillars and value propositions |
|
|
147
|
+
| Content Rules | Dos and don'ts for content generation |
|
|
148
|
+
| Style Guidelines | Typography, color, spacing preferences |
|
|
149
|
+
| Guardrails | Hard restrictions on language, topics, or claims |
|
|
150
|
+
|
|
151
|
+
## Error Handling
|
|
152
|
+
|
|
153
|
+
| Error | Response |
|
|
154
|
+
|---|---|
|
|
155
|
+
| `search_brands` unavailable | "Brand search is unavailable. Please provide your brand name or guidelines directly." |
|
|
156
|
+
| `get_brand_instructions` unavailable | "Cannot retrieve brand instructions. Please share your brand guidelines in this conversation and I'll apply them manually." |
|
|
157
|
+
| Org lacks Vibes branding | "CMS branding is not enabled for this org. Contact your admin to enable the Agentforce Vibes branding feature." |
|
|
158
|
+
| Permission denied | "You don't have permission to access CMS brands. Ensure you have Managed Content Authoring permission." |
|
|
159
|
+
| Brand extraction returns empty | "The brand exists but has no configured guidelines. Please add brand properties in CMS or provide guidelines here." |
|
|
160
|
+
|
|
161
|
+
**Never silently fail.** Always inform the user and offer alternatives.
|
|
162
|
+
|
|
163
|
+
## Key Principles
|
|
164
|
+
|
|
165
|
+
1. **Brand first, content second** — Always extract brand instructions before generating content
|
|
166
|
+
2. **Never assume brand guidelines** — Only apply what was explicitly retrieved from CMS
|
|
167
|
+
3. **Respect guardrails absolutely** — Brand content rules are hard constraints, not suggestions
|
|
168
|
+
4. **Confirm brand selection** — Never auto-select a brand without user confirmation
|
|
169
|
+
5. **Show your work** — Tell the user which guidelines you applied and how
|
|
170
|
+
6. **Graceful degradation** — If tools are unavailable, ask for manual guidelines rather than proceeding without branding
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: implementing-ui-bundle-agentforce-conversation-client
|
|
3
|
-
description: "
|
|
3
|
+
description: "Use this skill when the user asks to add, embed, integrate, configure, style, or remove an agent, chatbot, chat widget, conversation client, or AI assistant in a UI Bundle project. Covers styling (colors, fonts, spacing, borders), layout (inline vs floating, width, height, dimensions), and props (agentId, agentLabel, headerEnabled, showHeaderIcon, showAvatar, styleTokens). TRIGGER when: project contains a uiBundles/*/src/ directory and the task involves adding or modifying a chat widget, chatbot, or conversational AI; files under uiBundles/*/src/ import AgentforceConversationClient; user asks to add any chat or agent functionality to a page. DO NOT TRIGGER when: user wants to create a custom agent, chatbot, or chat widget component from scratch; the project has no uiBundles directory."
|
|
4
4
|
metadata:
|
|
5
5
|
author: ACC Components
|
|
6
|
-
version: "1.
|
|
6
|
+
version: "1.1"
|
|
7
7
|
package: "@salesforce/ui-bundle-template-feature-react-agentforce-conversation-client"
|
|
8
8
|
sdk-package: "@salesforce/agentforce-conversation-client"
|
|
9
|
-
last-updated: 2025-04-01
|
|
10
9
|
---
|
|
11
10
|
|
|
12
11
|
# Managing Agentforce Conversation Client
|
|
@@ -17,14 +16,11 @@ metadata:
|
|
|
17
16
|
|
|
18
17
|
Before the component will work, the following Salesforce settings must be configured by the user. ALWAYS call out the prequisites after successfully embedding the agent.
|
|
19
18
|
|
|
20
|
-
**Cookie settings:**
|
|
21
|
-
|
|
22
|
-
- Setup → My Domain → Disable "Require first party use of Salesforce cookies"
|
|
23
|
-
|
|
24
19
|
**Trusted domains (required only for local development):**
|
|
25
20
|
|
|
26
21
|
- Setup → Session Settings → Trusted Domains for Inline Frames → Add your domain
|
|
27
|
-
- Local development: `localhost
|
|
22
|
+
- Local development: `localhost:5173` (default Vite dev server port)
|
|
23
|
+
- **Warning:** Remove this trusted domain entry before deploying to production.
|
|
28
24
|
|
|
29
25
|
## Instructions
|
|
30
26
|
|
|
@@ -38,6 +34,8 @@ grep -r "AgentforceConversationClient" --include="*.tsx" --include="*.jsx" --exc
|
|
|
38
34
|
|
|
39
35
|
**Important:** Look for React files that import and USE the component (for example, shared shells, route components, or feature pages). Do NOT open files named `AgentforceConversationClient.tsx` or `AgentforceConversationClient.jsx` - those are the component implementation.
|
|
40
36
|
|
|
37
|
+
**If multiple files found:** Ask the user which component file they are referring to. Do not proceed until clarified.
|
|
38
|
+
|
|
41
39
|
**If found:** Read the file and check the current `agentId` value.
|
|
42
40
|
|
|
43
41
|
**Agent ID validation rule (deterministic):**
|
|
@@ -48,25 +46,99 @@ grep -r "AgentforceConversationClient" --include="*.tsx" --include="*.jsx" --exc
|
|
|
48
46
|
**Decision:**
|
|
49
47
|
|
|
50
48
|
- If `agentId` matches `^0Xx[a-zA-Z0-9]{15}$` and user wants to update other props → Go to Step 4 (update props)
|
|
49
|
+
- If `agentId` matches `^0Xx[a-zA-Z0-9]{15}$` and user asks to "embed" or "add" the chat client → Inform: "The Agentforce Conversation Client is already embedded in `<file>` with agent ID `<agentId>`. Would you like to change the agent or update other props?"
|
|
50
|
+
- Change agent → Step 2
|
|
51
|
+
- Update props → Step 4b
|
|
51
52
|
- If `agentId` is missing, empty, or does NOT match `^0Xx[a-zA-Z0-9]{15}$` → Continue to Step 2 (need real ID)
|
|
52
53
|
- If not found → Continue to Step 2 (add new)
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
**If user reports an error:**
|
|
56
|
+
|
|
57
|
+
If the user says the component is "not working", "showing an error", or similar — ask them for the specific error message. Then proceed to Step 2 to cross-check the configured agentId against the org.
|
|
58
|
+
|
|
59
|
+
### Step 2: Resolve and Validate Agent ID
|
|
60
|
+
|
|
61
|
+
#### Prerequisites
|
|
62
|
+
|
|
63
|
+
1. **Verify sf CLI is available:**
|
|
64
|
+
```bash
|
|
65
|
+
sf --version
|
|
66
|
+
```
|
|
67
|
+
If fails:
|
|
68
|
+
- Inform: "The Salesforce CLI (`sf`) is not installed. It's needed to query available agents from your org."
|
|
69
|
+
- Ask: "Would you like me to install it?"
|
|
70
|
+
- Yes → Install via `npm install -g @salesforce/cli`, then continue.
|
|
71
|
+
- No → "You can find your agent ID manually in Setup → Agentforce Agents → click the agent name → copy the ID from the URL. Would you like to provide it now, or skip this step?"
|
|
72
|
+
- User provides ID → validate format (`^0Xx[a-zA-Z0-9]{15}$`), store it, proceed to Step 3.
|
|
73
|
+
- Skip → proceed to Step 4 with placeholder `<YOUR_AGENT_ID>`.
|
|
74
|
+
|
|
75
|
+
2. **Verify org connectivity:**
|
|
76
|
+
```bash
|
|
77
|
+
sf org display --json
|
|
78
|
+
```
|
|
79
|
+
If fails:
|
|
80
|
+
- Inform: "No authenticated org found."
|
|
81
|
+
- Ask: "Would you like to connect to your org now? Run `sf org login web` to authenticate."
|
|
82
|
+
- User authenticates → retry the query, continue.
|
|
83
|
+
- User declines → "You can find your agent ID manually in Setup → Agentforce Agents → click the agent name → copy the ID from the URL. Would you like to provide it now, or skip this step?"
|
|
84
|
+
- User provides ID → validate format, store it, proceed to Step 3.
|
|
85
|
+
- Skip → proceed to Step 4 with placeholder `<YOUR_AGENT_ID>`.
|
|
86
|
+
|
|
87
|
+
**Note:** Even if the user provides their own agentId, the org must be connected for the agent to function at runtime. An agentId without a connected org will not work.
|
|
88
|
+
|
|
89
|
+
#### Query all Employee Agents
|
|
90
|
+
|
|
91
|
+
Run the SOQL query defined in `references/agent-id-resolution.md`.
|
|
92
|
+
|
|
93
|
+
#### Handle results
|
|
94
|
+
|
|
95
|
+
**No records at all:**
|
|
96
|
+
> "No Employee Agents found in this org. Create one in Setup → Agentforce Agents."
|
|
97
|
+
|
|
98
|
+
Ask user if they want to provide an agent ID manually or skip. If skip, proceed to Step 4 with placeholder `<YOUR_AGENT_ID>`.
|
|
99
|
+
|
|
100
|
+
**All agents are inactive:**
|
|
101
|
+
> Found Employee Agents but none are active:
|
|
102
|
+
> - Agentforce Sales Agent (0Xxxx000000001dCAA)
|
|
103
|
+
> - HR Assistant (0Xxxx0000000002BBB)
|
|
104
|
+
>
|
|
105
|
+
> To activate: Setup → Agentforce Agents → click the agent name → open in Agent Builder → press Activate.
|
|
106
|
+
> Then re-run this step.
|
|
107
|
+
|
|
108
|
+
Ask user if they want to provide an agent ID manually or skip. If skip, proceed to Step 4 with placeholder `<YOUR_AGENT_ID>`.
|
|
109
|
+
|
|
110
|
+
**Has active agents — Path A (fresh install / no existing agentId):**
|
|
111
|
+
|
|
112
|
+
Present only active agents for selection:
|
|
113
|
+
> Which agent should the chat widget use?
|
|
114
|
+
> 1. Property Manager Agent (0Xxxx0000000001CAA)
|
|
115
|
+
> 2. HR Assistant (0Xxxx0000000002BBB)
|
|
55
116
|
|
|
56
|
-
|
|
117
|
+
- One agent → still confirm with user, do not auto-select.
|
|
118
|
+
- If user picks one → store the selected `Id` for use in Step 4.
|
|
119
|
+
- If user declines to pick ("skip", "no", "I don't want to set one") → accept it and move to next steps. Do not re-ask. In Step 4, use placeholder `<YOUR_AGENT_ID>` for fresh installs. For existing projects, leave the component as-is.
|
|
57
120
|
|
|
58
|
-
|
|
121
|
+
**Has active agents — Path B (existing agentId from Step 1, passed format check):**
|
|
59
122
|
|
|
60
|
-
-
|
|
61
|
-
- `"Placeholder"`
|
|
62
|
-
- `"YOUR_AGENT_ID"`
|
|
63
|
-
- `"<USER_AGENT_ID_18_CHAR_0Xx...>"`
|
|
64
|
-
- Any value that does not match `^0Xx[a-zA-Z0-9]{15}$`
|
|
123
|
+
Cross-check the existing agentId against query results:
|
|
65
124
|
|
|
66
|
-
|
|
125
|
+
- **ID found, agent is Active** → "Agent ID maps to 'Property Manager Agent' — active in the org." Proceed.
|
|
126
|
+
- **ID found, agent is Inactive** → "The configured agent 'Sales Agent' exists but is Inactive. To activate: Setup → Agentforce Agents → click the agent name → open in Agent Builder → press Activate. Or pick a different active agent:" → show active list.
|
|
127
|
+
- **ID not found at all** → "The configured agent (0Xxxx...) doesn't exist in this org — it may have been deleted or belongs to a different org. Pick a replacement:" → show active list. If no active agents available, show inactive list with activation instructions.
|
|
67
128
|
|
|
68
|
-
|
|
69
|
-
|
|
129
|
+
If user reported an error → surface the agent name even if active, so user can confirm it's the intended one.
|
|
130
|
+
|
|
131
|
+
#### Query error handling
|
|
132
|
+
|
|
133
|
+
If the SOQL query fails, surface the error message from the response directly to the user. Do not guess at the fix — just report what came back. For example:
|
|
134
|
+
> "The query failed with: `[error message from response]`. Check your org permissions or that the API version supports this object."
|
|
135
|
+
|
|
136
|
+
#### What this step does NOT do
|
|
137
|
+
|
|
138
|
+
- No fallback to GraphQL or Tooling API — SOQL only
|
|
139
|
+
- No auto-selection (always confirm with user)
|
|
140
|
+
- No programmatic activation (only via Setup UI)
|
|
141
|
+
- No file writes (that's Step 4)
|
|
70
142
|
|
|
71
143
|
### Step 3: Canonical import strategy
|
|
72
144
|
|
|
@@ -103,12 +175,18 @@ Determine which sub-step applies:
|
|
|
103
175
|
import { AgentforceConversationClient } from "@salesforce/ui-bundle-template-feature-react-agentforce-conversation-client";
|
|
104
176
|
```
|
|
105
177
|
|
|
106
|
-
4. Insert the `<AgentforceConversationClient />` TSX into the component's return block. Place it as a sibling of existing content — do NOT wrap or restructure existing TSX. Use the real `agentId` obtained in Step 2:
|
|
107
|
-
|
|
178
|
+
4. Insert the `<AgentforceConversationClient />` TSX into the component's return block. Place it as a sibling of existing content — do NOT wrap or restructure existing TSX. Use the real `agentId` obtained in Step 2. If no agentId was resolved (user skipped Step 2), use the placeholder:
|
|
179
|
+
|
|
180
|
+
**With resolved agentId:**
|
|
108
181
|
```tsx
|
|
109
182
|
<AgentforceConversationClient agentId="0Xx8X00000001AbCDE" />
|
|
110
183
|
```
|
|
111
184
|
|
|
185
|
+
**Without resolved agentId (user skipped):**
|
|
186
|
+
```tsx
|
|
187
|
+
<AgentforceConversationClient agentId="<YOUR_AGENT_ID>" />
|
|
188
|
+
```
|
|
189
|
+
|
|
112
190
|
5. Do NOT add any other code (wrappers, layout components, new functions) unless the user explicitly requests it.
|
|
113
191
|
|
|
114
192
|
#### 4b — Update existing
|
|
@@ -120,17 +198,12 @@ import { AgentforceConversationClient } from "@salesforce/ui-bundle-template-fea
|
|
|
120
198
|
- **Change** prop values the user asked to update.
|
|
121
199
|
- **Preserve** every prop and value the user did NOT mention — do not remove, reorder, or reformat them.
|
|
122
200
|
- **Never** delete the component and recreate it.
|
|
123
|
-
4. If
|
|
201
|
+
4. If Step 2 was triggered (cross-check or fresh selection) and a new agent ID was resolved, replace the existing agentId value with the new one.
|
|
202
|
+
5. If the current `agentId` is already valid and the user did not ask to change it and Step 2 confirmed it is active, leave it as-is.
|
|
124
203
|
|
|
125
|
-
|
|
126
|
-
// Before
|
|
127
|
-
<AgentforceConversationClient agentId="Placeholder" />
|
|
204
|
+
#### Post-Step-4 error handling
|
|
128
205
|
|
|
129
|
-
|
|
130
|
-
<AgentforceConversationClient agentId="0Xx8X00000001AbCDE" />
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
5. If the current `agentId` is already valid and the user did not ask to change it, leave it as-is.
|
|
206
|
+
If the user reports an error after the component has been set up (e.g., "it's not working", "I see an error"), go to Step 2 to validate the configured agentId against the org. Cross-check whether the agent is active, exists, and belongs to the connected org.
|
|
134
207
|
|
|
135
208
|
### Step 5: Configure props
|
|
136
209
|
|
|
@@ -173,174 +246,7 @@ Adding or updating agent label:
|
|
|
173
246
|
- NEVER apply styling via CSS files, `style` attributes, `className`, or wrapper elements. These approaches will not work and will be ignored by the component.
|
|
174
247
|
- If the user requests a visual change that does not map to a token below, inform them that the change is not supported by the current token set.
|
|
175
248
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
| Token name | UI area themed |
|
|
179
|
-
| --------------------- | --------------------------- |
|
|
180
|
-
| `fabBackground` | FAB button background color |
|
|
181
|
-
| `containerBackground` | Chat container background |
|
|
182
|
-
| `headerBackground` | Header background |
|
|
183
|
-
| `containerWidth` | Chat container width |
|
|
184
|
-
| `chatBorderRadius` | Chat border radius |
|
|
185
|
-
| `layoutMaxWidth` | Layout max width |
|
|
186
|
-
|
|
187
|
-
### Agentforce Header
|
|
188
|
-
|
|
189
|
-
| Token name | UI area themed |
|
|
190
|
-
| ------------------------------- | ---------------------------------- |
|
|
191
|
-
| `headerBlockBackground` | Header block background |
|
|
192
|
-
| `headerBlockBorderBottomWidth` | Header border bottom width |
|
|
193
|
-
| `headerBlockBorderBottomStyle` | Header border bottom style |
|
|
194
|
-
| `headerBlockBorderBottomColor` | Header border bottom color |
|
|
195
|
-
| `headerBlockBorderRadius` | Header corner radius |
|
|
196
|
-
| `headerBlockPaddingBlock` | Header block padding (vertical) |
|
|
197
|
-
| `headerBlockPaddingInline` | Header inline padding (horizontal) |
|
|
198
|
-
| `headerBlockMinHeight` | Header minimum height |
|
|
199
|
-
| `headerBlockBrandingGap` | Header branding area gap |
|
|
200
|
-
| `headerBlockFontFamily` | Header font family |
|
|
201
|
-
| `headerBlockFontWeight` | Header title font weight |
|
|
202
|
-
| `headerBlockFontSize` | Header title font size |
|
|
203
|
-
| `headerBlockLineHeight` | Header title line height |
|
|
204
|
-
| `headerBlockTextColor` | Header text color |
|
|
205
|
-
| `headerBlockIconDisplay` | Header icon display |
|
|
206
|
-
| `headerBlockIconMargin` | Header icon margin |
|
|
207
|
-
| `headerBlockIconColor` | Header icon color |
|
|
208
|
-
| `headerBlockIconWidth` | Header icon width |
|
|
209
|
-
| `headerBlockIconHeight` | Header icon height |
|
|
210
|
-
| `headerBlockLogoMaxHeight` | Header logo max height |
|
|
211
|
-
| `headerBlockLogoMaxWidth` | Header logo max width |
|
|
212
|
-
| `headerBlockLogoMinWidth` | Header logo min width |
|
|
213
|
-
| `headerBlockButtonHeight` | Header action button height |
|
|
214
|
-
| `headerBlockButtonWidth` | Header action button width |
|
|
215
|
-
| `headerBlockButtonPadding` | Header action button padding |
|
|
216
|
-
| `headerBlockButtonBorderRadius` | Header action button border radius |
|
|
217
|
-
| `headerBlockHoverBackground` | Header hover background |
|
|
218
|
-
| `headerBlockActiveBackground` | Header active background |
|
|
219
|
-
| `headerBlockFocusBorder` | Header focus border |
|
|
220
|
-
|
|
221
|
-
### Agentforce Welcome Block
|
|
222
|
-
|
|
223
|
-
| Token name | UI area themed |
|
|
224
|
-
| ----------------------------------- | -------------------------------- |
|
|
225
|
-
| `welcomeBlockTextContainerWidth` | Welcome text container width |
|
|
226
|
-
| `welcomeBlockFontFamily` | Welcome block font family |
|
|
227
|
-
| `welcomeBlockFontSize` | Welcome block font size |
|
|
228
|
-
| `welcomeBlockFontWeight` | Welcome block font weight |
|
|
229
|
-
| `welcomeBlockLineHeight` | Welcome block line height |
|
|
230
|
-
| `welcomeBlockLetterSpacing` | Welcome block letter spacing |
|
|
231
|
-
| `welcomeBlockTextColor` | Welcome block text color |
|
|
232
|
-
| `welcomeBlockPaddingVertical` | Welcome block vertical padding |
|
|
233
|
-
| `welcomeBlockPaddingHorizontal` | Welcome block horizontal padding |
|
|
234
|
-
| `welcomeBlockTextAnimationDuration` | Welcome text animation duration |
|
|
235
|
-
|
|
236
|
-
### Agentforce Messages
|
|
237
|
-
|
|
238
|
-
| Token name | UI area themed |
|
|
239
|
-
| -------------------------------- | ------------------------------------------------------- |
|
|
240
|
-
| `messageBlockBorderRadius` | Message block border radius |
|
|
241
|
-
| `avatarDisplay` | Avatar display property (e.g. `block`, `none`) |
|
|
242
|
-
| `hideMessageActions` | Message actions display (e.g. `block`, `none` to hide) |
|
|
243
|
-
| `hideCopyAction` | Copy action button display (e.g. `inline-flex`, `none`) |
|
|
244
|
-
| `messageBlockPaddingContainer` | Message block container padding |
|
|
245
|
-
| `messageBlockFontSize` | Message block font size |
|
|
246
|
-
| `messageBlockBackgroundColor` | Message block background (base) |
|
|
247
|
-
| `messageBlockInboundBorder` | Inbound message border |
|
|
248
|
-
| `messageBlockOutboundBorder` | Outbound message border |
|
|
249
|
-
| `messageBlockBodyWidth` | Message block body width |
|
|
250
|
-
| `messageBlockPadding` | Message block padding |
|
|
251
|
-
| `messageBlockContainerMarginTop` | Message block container top margin |
|
|
252
|
-
| `messageBlockLineHeight` | Message block line height |
|
|
253
|
-
|
|
254
|
-
### Avatar visibility (behavioral config)
|
|
255
|
-
|
|
256
|
-
Use `renderingConfig.showAvatar` to control whether avatars are rendered in message rows.
|
|
257
|
-
|
|
258
|
-
- `showAvatar: true` (default) renders avatars.
|
|
259
|
-
- `showAvatar: false` hides avatars by removing them from the DOM.
|
|
260
|
-
|
|
261
|
-
### Inbound message (agent → customer)
|
|
262
|
-
|
|
263
|
-
| Token name | UI area themed |
|
|
264
|
-
| ----------------------------------------- | --------------------------------- |
|
|
265
|
-
| `inboundMessgeTextColor` | Inbound message text color (base) |
|
|
266
|
-
| `messageBlockInboundBorderRadius` | Inbound message border radius |
|
|
267
|
-
| `messageBlockInboundBackgroundColor` | Inbound message background |
|
|
268
|
-
| `messageBlockInboundTextColor` | Inbound message text color |
|
|
269
|
-
| `messageBlockInboundWidth` | Inbound message width |
|
|
270
|
-
| `messageBlockInboundTextAlign` | Inbound message text alignment |
|
|
271
|
-
| `messageBlockInboundHoverBackgroundColor` | Inbound message hover background |
|
|
272
|
-
|
|
273
|
-
### Outbound message (customer → agent)
|
|
274
|
-
|
|
275
|
-
| Token name | UI area themed |
|
|
276
|
-
| ------------------------------------- | ------------------------------- |
|
|
277
|
-
| `messageBlockOutboundBorderRadius` | Outbound message border radius |
|
|
278
|
-
| `messageBlockOutboundBackgroundColor` | Outbound message background |
|
|
279
|
-
| `messageBlockOutboundTextColor` | Outbound message text color |
|
|
280
|
-
| `messageBlockOutboundWidth` | Outbound message width |
|
|
281
|
-
| `messageBlockOutboundMarginLeft` | Outbound message left margin |
|
|
282
|
-
| `messageBlockOutboundTextAlign` | Outbound message text alignment |
|
|
283
|
-
|
|
284
|
-
### Agentforce Input
|
|
285
|
-
|
|
286
|
-
| Token name | UI area themed |
|
|
287
|
-
| ------------------------------------------ | ---------------------------------------------- |
|
|
288
|
-
| `messageInputPadding` | Message input container padding |
|
|
289
|
-
| `messageInputFooterBorderColor` | Message input footer border color |
|
|
290
|
-
| `messageInputBorderRadius` | Message input border radius |
|
|
291
|
-
| `messageInputBorderTransitionDuration` | Message input border transition duration |
|
|
292
|
-
| `messageInputBorderTransitionEasing` | Message input border transition easing |
|
|
293
|
-
| `messageInputTextColor` | Message input text color |
|
|
294
|
-
| `messageInputTextBackgroundColor` | Message input text background color |
|
|
295
|
-
| `messageInputFooterBorderFocusColor` | Message input footer focus border color |
|
|
296
|
-
| `messageInputFocusShadow` | Message input focus shadow |
|
|
297
|
-
| `messageInputMaxHeight` | Message input max height |
|
|
298
|
-
| `messageInputLineHeight` | Message input line height |
|
|
299
|
-
| `messageInputTextPadding` | Message input text padding |
|
|
300
|
-
| `messageInputFontWeight` | Message input font weight |
|
|
301
|
-
| `messageInputFontSize` | Message input font size |
|
|
302
|
-
| `messageInputOverflowY` | Message input overflow Y |
|
|
303
|
-
| `messageInputScrollbarWidth` | Message input scrollbar width |
|
|
304
|
-
| `messageInputScrollbarColor` | Message input scrollbar color |
|
|
305
|
-
| `messageInputActionsWidth` | Message input actions width |
|
|
306
|
-
| `messageInputActionsPaddingRight` | Message input actions right padding |
|
|
307
|
-
| `messageInputFooterPlaceholderText` | Message input placeholder text color |
|
|
308
|
-
| `messageInputPlaceholderFontWeight` | Placeholder font weight |
|
|
309
|
-
| `messageInputErrorTextColor` | Message input error text color |
|
|
310
|
-
| `messageInputActionsGap` | Message input actions gap |
|
|
311
|
-
| `messageInputActionsPadding` | Message input actions padding |
|
|
312
|
-
| `messageInputActionButtonSize` | Message input action button size |
|
|
313
|
-
| `messageInputActionButtonRadius` | Message input action button radius |
|
|
314
|
-
| `messageInputFooterSendButton` | Message input send button color |
|
|
315
|
-
| `messageInputSendButtonDisabledColor` | Message input send button disabled color |
|
|
316
|
-
| `messageInputActionButtonFocusBorder` | Message input action button focus border |
|
|
317
|
-
| `messageInputActionButtonActiveIconColor` | Message input action button active icon color |
|
|
318
|
-
| `messageInputActionButtonActiveBackground` | Message input action button active background |
|
|
319
|
-
| `messageInputSendButtonIconColor` | Message input send button icon color |
|
|
320
|
-
| `messageInputFooterSendButtonHoverColor` | Message input send button hover color |
|
|
321
|
-
| `messageInputActionButtonHoverShadow` | Message input action button hover shadow |
|
|
322
|
-
| `messageInputFilePreviewPadding` | Message input file preview padding |
|
|
323
|
-
| `messageInputTextareaMaxHeight` | Message input textarea max height |
|
|
324
|
-
| `messageInputTextareaWithImageMaxHeight` | Message input textarea max height (with image) |
|
|
325
|
-
|
|
326
|
-
### Agentforce Error Block
|
|
327
|
-
|
|
328
|
-
| Token name | UI area themed |
|
|
329
|
-
| ---------------------- | ---------------------------- |
|
|
330
|
-
| `errorBlockBackground` | Error block background color |
|
|
331
|
-
|
|
332
|
-
Styling with styleTokens:
|
|
333
|
-
|
|
334
|
-
```tsx
|
|
335
|
-
<AgentforceConversationClient
|
|
336
|
-
agentId="0Xx..."
|
|
337
|
-
styleTokens={{
|
|
338
|
-
headerBlockBackground: "#0176d3",
|
|
339
|
-
headerBlockTextColor: "#ffffff",
|
|
340
|
-
messageBlockInboundBackgroundColor: "#4CAF50",
|
|
341
|
-
}}
|
|
342
|
-
/>
|
|
343
|
-
```
|
|
249
|
+
For the complete list of available style tokens, consult `references/style-tokens.md`.
|
|
344
250
|
|
|
345
251
|
**For complex patterns,** consult `references/examples.md` for:
|
|
346
252
|
|
|
@@ -363,3 +269,13 @@ If component doesn't appear or authentication fails, see `references/troubleshoo
|
|
|
363
269
|
- Agent activation and deployment
|
|
364
270
|
- Localhost trusted domains
|
|
365
271
|
- Cookie restriction settings
|
|
272
|
+
|
|
273
|
+
## Reference File Index
|
|
274
|
+
|
|
275
|
+
| File | When to read |
|
|
276
|
+
|------|-------------|
|
|
277
|
+
| `references/agent-id-resolution.md` | Step 2 — SOQL query structure, response format, activation path, manual lookup |
|
|
278
|
+
| `references/style-tokens.md` | Step 5 — Complete style token reference for all UI areas |
|
|
279
|
+
| `references/examples.md` | Step 5 — Layout patterns, sizing, theming combinations, host component examples |
|
|
280
|
+
| `references/constraints.md` | Step 4 — Invalid props, invalid styling approaches, files not to edit |
|
|
281
|
+
| `references/troubleshooting.md` | Post-setup — Agent activation, trusted domains, cookie settings |
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Agent ID Resolution
|
|
2
|
+
|
|
3
|
+
## SOQL Query
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
sf data query \
|
|
7
|
+
--query "SELECT BotDefinition.Id, BotDefinition.DeveloperName, BotDefinition.MasterLabel, Status FROM BotVersion WHERE BotDefinition.AgentType = 'AgentforceEmployeeAgent' ORDER BY BotDefinition.CreatedDate ASC" \
|
|
8
|
+
--json
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
- Queries `BotVersion` (not `BotDefinition`) because only `BotVersion` has the `Status` field (`Active` / `Inactive`)
|
|
12
|
+
- Filters on `AgentType = 'AgentforceEmployeeAgent'` to return only Employee Agents (excludes Service Agents)
|
|
13
|
+
|
|
14
|
+
## Response Structure
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"status": 0,
|
|
19
|
+
"result": {
|
|
20
|
+
"records": [
|
|
21
|
+
{
|
|
22
|
+
"BotDefinition": {
|
|
23
|
+
"Id": "0Xxxx0000000001CAA",
|
|
24
|
+
"DeveloperName": "Property_Manager_Agent",
|
|
25
|
+
"MasterLabel": "Property Manager Agent"
|
|
26
|
+
},
|
|
27
|
+
"Status": "Active"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Activation Path
|
|
35
|
+
|
|
36
|
+
Agents cannot be activated programmatically:
|
|
37
|
+
|
|
38
|
+
> Setup → Agentforce Agents → click agent name → Agent Builder → Activate
|
|
39
|
+
|
|
40
|
+
## Manual Lookup (without sf CLI)
|
|
41
|
+
|
|
42
|
+
> Setup → Agentforce Agents → click agent name → copy ID from URL
|
|
43
|
+
|
|
44
|
+
## Validation
|
|
45
|
+
|
|
46
|
+
`agentId` must match: `^0Xx[a-zA-Z0-9]{15}$`
|