@salesforce/afv-skills 1.52.0 → 1.53.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/afv-skills",
3
- "version": "1.52.0",
3
+ "version": "1.53.0",
4
4
  "description": "Salesforce skills for Agentforce Vibes",
5
5
  "license": "CC-BY-NC-4.0",
6
6
  "files": [
@@ -11,8 +11,8 @@
11
11
  "registry": "https://registry.npmjs.org"
12
12
  },
13
13
  "devDependencies": {
14
- "@salesforce/ui-bundle-template-app-react-sample-b2e": "^11.57.2",
15
- "@salesforce/ui-bundle-template-app-react-sample-b2x": "^11.57.2",
14
+ "@salesforce/ui-bundle-template-app-react-sample-b2e": "^12.4.4",
15
+ "@salesforce/ui-bundle-template-app-react-sample-b2x": "^12.4.4",
16
16
  "@salesforce/webapp-template-app-react-sample-b2e-experimental": "^1.117.1",
17
17
  "@salesforce/webapp-template-app-react-sample-b2x-experimental": "^1.117.1"
18
18
  },
@@ -1,353 +0,0 @@
1
- ---
2
- name: experience-content-media-search
3
- description: "Searches for and retrieves existing visual media (images, logos, icons, photos, graphics, banners, thumbnails, hero images, backgrounds) from sources such as Salesforce CMS, Data 360 or any other source. Use this skill ANY TIME a user request involves finding, searching, getting, fetching, retrieving, grab, looking up, locating media. NEVER call search_media_cms_channels, search_electronic_media tools directly — always go through this skill first. This skill must be activated before any tool is used for media search or retrieval, without exception. Takes PRIORITY and activates FIRST when ANY media search/retrieval is mentioned, regardless of what else happens with the media afterward. Triggers for requests like \"search for logo\", \"find hero image\", \"get company logo\", \"locate icons\", \"fetch background image\", \"retrieve product photos\". Handles the search and source selection workflow. Does not apply when the request is about brand search, to generate NEW images with AI, or edit existing images."
4
- metadata:
5
- version: "1.1"
6
- domains: ["Experience"]
7
- relatedSkills:
8
- - "experience-content-media-stock-image-search"
9
- mcpTools:
10
- content-readonly:
11
- tools:
12
- - search_media_cms_channels
13
- - search_electronic_media
14
- - get_channels
15
- semver: "^1.0.0"
16
- ---
17
-
18
- # Media Search
19
-
20
- Universal routing skill for searching and retrieving existing images and media.
21
-
22
- ## Scope
23
-
24
- **This skill is for SEARCHING FOR existing media, not CREATING new media.**
25
-
26
- **Use this skill when the user wants to:**
27
- - Search for images in Salesforce CMS, Data Cloud
28
- - Find existing visual assets to use in their app
29
- - Retrieve media from connected sources
30
- - Browse available images for their project
31
- - Locate specific photos or graphics
32
-
33
- **DO NOT use this skill when the user wants to:**
34
- - Generate new images with AI (use image generation tools)
35
- - Create graphics or designs from scratch
36
- - Edit or modify existing images
37
- - Build custom visuals or diagrams
38
- - Search for stock photography or royalty-free images (use `experience-content-media-stock-image-search`)
39
-
40
- ## Before You Search
41
-
42
- **CRITICAL: This is a routing skill, not a direct search skill.**
43
-
44
- When a user requests to find an image:
45
-
46
- **Your first action MUST use the ask_followup_question tool to present search sources.**
47
-
48
- 1. **Use ask_followup_question** to present available search sources as options
49
- 2. **Receive the user's selection** from the tool response
50
- 3. **Then** call the appropriate search tool based on their choice
51
-
52
-
53
- **Example of what NOT to do:**
54
- - Calling ANY tool before the user picks a source (MCP tools, file reads, descriptor checks, etc.)
55
- - "Checking which MCP tools are available" — do not probe or discover tools via tool calls
56
- - Immediately calling `search_electronic_media` or `search_media_cms_channels`
57
- - Reading MCP tool descriptors or schemas to see what's available
58
- - Deciding which search source to use without asking
59
-
60
- **Example of what TO do:**
61
- - Respond with ONLY text — a numbered list of search sources
62
- - Ask: "Which option would you like to use?"
63
- - Wait for user to reply with their choice
64
- - Then (and only then) call the tool they selected
65
-
66
- **Your first response when this skill triggers MUST be a text-only message presenting search sources. No tool calls. No exceptions.**
67
-
68
-
69
- ## Workflow Overview
70
-
71
- **The user MUST choose the search source. You CANNOT skip this step.**
72
-
73
- Copy this checklist and track your progress:
74
-
75
- ```text
76
- Media Search Progress:
77
- - [ ] Step 1: Check your own tool list for available search tools (no tool calls — just inspect what's in your context)
78
- - [ ] Step 2: Present only the available options to the user as a numbered list (plain text, no tool calls)
79
- - [ ] Step 3: Wait for the user to reply with their selection
80
- - [ ] Step 4: Execute the selected search method (this is the first tool call)
81
- - [ ] Step 5: Present all results to user for selection
82
- - [ ] Step 6: Apply selected image to code
83
- ```
84
-
85
- If you call any tool before step 4, you are not following this skill correctly.
86
-
87
- ## Presenting Search Sources (First Response)
88
-
89
- **DO NOT call any tool, read any MCP descriptor, or make any external request to determine available tools.**
90
-
91
- Your tools are already loaded into your context. Look at the tool names you already have access to — this is introspection, not a tool call.
92
-
93
- **Step 1: Check your own tool list (no tool calls)**
94
-
95
- Look at the tools already in your context and check for these names:
96
- - `search_media_cms_channels` → If present, include **"Search using keywords"**
97
- - `search_electronic_media` → If present, include **"Search using Data 360 hybrid search"**
98
- - Always include **"Other"** as the last option
99
-
100
- **Step 2: Build your response**
101
-
102
- Include ONLY the sources whose tools you actually have. Number them sequentially.
103
-
104
- ```text
105
- I can help you find that image. Where would you like to search?
106
-
107
- [NUMBER]. [SEARCH SOURCE NAME] — [Brief description]
108
- ...
109
- [NUMBER]. Other — Provide your own URL or path
110
-
111
- Which option would you like to use?
112
- ```
113
-
114
- **Step 3: Stop and wait**
115
-
116
- After presenting the list, STOP. Do not call any tool. Do not proceed. Wait for the user to reply with their choice.
117
-
118
- ### Examples
119
-
120
- **Both tools available:**
121
- ```text
122
- I can help you find that image. Where would you like to search?
123
-
124
- 1. Search using Data 360 hybrid search — Semantic search across Salesforce CMS and connected DAMs
125
- 2. Search using keywords — Search Salesforce CMS by keywords and taxonomies
126
- 3. Other — Provide your own URL or path
127
-
128
- Which option would you like to use?
129
- ```
130
-
131
- **Only `search_media_cms_channels` available:**
132
- ```text
133
- I can help you find that image. Where would you like to search?
134
-
135
- 1. Search using keywords — Search Salesforce CMS by keywords and taxonomies
136
- 2. Other — Provide your own URL or path
137
-
138
- Which option would you like to use?
139
- ```
140
-
141
- **Only `search_electronic_media` available:**
142
- ```text
143
- I can help you find that image. Where would you like to search?
144
-
145
- 1. Search using Data 360 hybrid search — Semantic search across Salesforce CMS and connected DAMs
146
- 2. Other — Provide your own URL or path
147
-
148
- Which option would you like to use?
149
- ```
150
-
151
- **Neither tool available:**
152
- ```text
153
- No automated media search sources are currently configured. Please provide a direct URL or asset library path.
154
- ```
155
-
156
- **Wait for the user to select** before proceeding.
157
-
158
- ## Executing the Selected Search Method
159
-
160
- **ONLY reach this step if the user has explicitly selected an option from your numbered list.**
161
-
162
- If you haven't shown options yet, go back to the "Presenting Search Sources" section first.
163
-
164
- After the user selects an option, execute the corresponding search method below.
165
-
166
- ### Search using keywords
167
-
168
- **Tool:** `search_media_cms_channels`
169
-
170
- **Process:**
171
-
172
- 1. **Analyze the query** — Understand what the user is searching for (subject, attributes, domain)
173
-
174
- 2. **Extract keywords** — Concrete nouns that would appear in image metadata
175
- - Use domain-specific synonyms
176
- - Maximum 10 terms
177
- - Examples:
178
- - "luxury apartments" → apartment, villa, penthouse, residence, condo
179
- - "company logo" → logo, emblem, corporate logo
180
- - "bright room" → _(empty if no concrete nouns)_
181
-
182
- 3. **Extract taxonomies** — Descriptive qualities, styles, moods, categories
183
- - Only adjectives and attributes
184
- - Examples:
185
- - "luxury apartment with river view" → Luxury, Premium, Waterfront, Riverside, Panoramic
186
- - "bright spacious room" → Bright, Spacious, Open, Airy, Light
187
- - "car" → _(empty if no descriptive terms)_
188
-
189
- 4. **Determine locale** — Use format `en_US`, `es_MX`, `fr_FR` (default: `en_US`)
190
-
191
- 5. **Build the JSON payload** — Construct this exact structure:
192
-
193
- ```json
194
- {
195
- "inputs": [{
196
- "searchKeyword": "keyword1 OR keyword2 OR keyword3",
197
- "taxonomyExpression": "{\"OR\": [\"Taxonomy1\", \"Taxonomy2\"]}",
198
- "searchLanguage": "en_US",
199
- "contentAccessScope": "Public",
200
- "contentTypeFqn": "sfdc_cms__image",
201
- "pageOffset": 0,
202
- "searchLimit": 5
203
- }]
204
- }
205
- ```
206
-
207
- **Field rules:**
208
- - `searchKeyword`: Join keywords with ` OR ` (space-OR-space). Use empty string if no keywords.
209
- - `taxonomyExpression`: Stringify JSON object `{"OR": ["term1", "term2"]}`. Use `"{}"` if no taxonomies.
210
- - `searchLanguage`: Locale with underscore (e.g., `en_US`)
211
- - `contentAccessScope`: Always `"Public"` (covers both public-unauthenticated and public Experience Cloud site channels)
212
- - `contentTypeFqn`: Always `"sfdc_cms__image"`
213
- - `pageOffset`: Start at `0`, increment by `searchLimit` for pagination
214
- - `searchLimit`: Default `5`, adjust if user requests more
215
-
216
- **Examples:**
217
-
218
- Query: "luxury apartment with river view"
219
- ```json
220
- {
221
- "inputs": [{
222
- "searchKeyword": "apartment OR villa OR penthouse OR residence",
223
- "taxonomyExpression": "{\"OR\": [\"Luxury\", \"Premium\", \"Waterfront\", \"Riverside\"]}",
224
- "searchLanguage": "en_US",
225
- "contentAccessScope": "Public",
226
- "contentTypeFqn": "sfdc_cms__image",
227
- "pageOffset": 0,
228
- "searchLimit": 5
229
- }]
230
- }
231
- ```
232
-
233
- Query: "bright spacious room" (no concrete nouns)
234
- ```json
235
- {
236
- "inputs": [{
237
- "searchKeyword": "",
238
- "taxonomyExpression": "{\"OR\": [\"Bright\", \"Spacious\", \"Open\", \"Airy\"]}",
239
- "searchLanguage": "en_US",
240
- "contentAccessScope": "Public",
241
- "contentTypeFqn": "sfdc_cms__image",
242
- "pageOffset": 0,
243
- "searchLimit": 5
244
- }]
245
- }
246
- ```
247
-
248
- Query: "car images" (no descriptive terms)
249
- ```json
250
- {
251
- "inputs": [{
252
- "searchKeyword": "car OR automobile OR vehicle OR auto",
253
- "taxonomyExpression": "{}",
254
- "searchLanguage": "en_US",
255
- "contentAccessScope": "Public",
256
- "contentTypeFqn": "sfdc_cms__image",
257
- "pageOffset": 0,
258
- "searchLimit": 5
259
- }]
260
- }
261
- ```
262
-
263
- 6. **Call the tool** with the exact JSON payload — show the payload in your response before calling the tool
264
-
265
- ### Search using Data 360 hybrid search
266
-
267
- **Tool:** `search_electronic_media`
268
-
269
- **Process:**
270
-
271
- 1. Use the user's query **as-is** — no keyword extraction or transformation needed
272
- 2. Call `search_electronic_media`
273
- 3. Pass the query to the tool's `searchQuery` parameter
274
-
275
- **Example:**
276
- - User query: "modern luxury apartment with natural lighting"
277
- - Tool call: `search_electronic_media(searchQuery="modern luxury apartment with natural lighting")`
278
-
279
- ### Other (User-Provided URL)
280
-
281
- Ask the user to provide:
282
- - Direct URL to the image
283
- - Asset library path
284
- - Specific system/location to check
285
-
286
- ## Presenting Search Results
287
-
288
- **Your action MUST use the `ask_followup_question` tool to present search results as options.**
289
- 1. **Parse the tool response** — Extract all image results (title and source)
290
- 2. **Use `ask_followup_question`** to present ALL results as selectable options. Show the image title only — do not display the URL.
291
- 3. **Receive the user's selection** from the tool response
292
- 4. **Then** apply the selected image
293
-
294
- ```text
295
- I found 4 images. Which one would you like to use?
296
-
297
- 1. Luxury Apartment Exterior
298
- Source: Salesforce CMS
299
-
300
- 2. Modern High-Rise Building
301
- Source: Salesforce CMS
302
-
303
- 3. Waterfront Residence
304
- Source: Salesforce CMS
305
-
306
- 4. Premium Condominium
307
- Source: Salesforce CMS
308
- ```
309
-
310
- **Never auto-select an image.** Always wait for user choice.
311
-
312
- ## Applying the Selected Image
313
-
314
-
315
- After the user chooses:
316
-
317
- 1. Confirm the selection with image name and URL
318
- 2. Use the complete URL returned by the tool, including all query parameters. CMS and DAM URLs rely on query parameters for authentication, resizing, and CDN routing — dropping them breaks the image. For example, a URL like `https://cms.example.com/media/img.jpg?oid=00D&refid=0EM&v=2` must be used in full.
319
- 3. Apply the URL to the user's code/component
320
- 4. Show what was changed (file path and line number)
321
-
322
- ## Error Handling
323
-
324
- | Error | Response |
325
- |---|---|
326
- | Tool unavailable | "The [source name] tool is unavailable. Would you like to try a different source?" |
327
- | Tool returns error | Show error message, offer retry with different terms or alternative source |
328
- | No results found | "No results found. Try broader keywords, removing descriptive terms, or a different source." |
329
- | Invalid user selection | Re-display options and ask again |
330
-
331
- **Never silently fail.** Always inform the user and offer alternatives.
332
-
333
- ## Search Behavior Notes
334
-
335
- **Search using keywords:**
336
- - Both keyword and taxonomy → results match keyword OR (keyword + taxonomy)
337
- - Empty keyword → search by taxonomy only
338
- - Empty taxonomy → search by keyword only
339
- - Use `pageOffset` for pagination (increment by `searchLimit`)
340
-
341
- **Search using Data 360 hybrid search:**
342
- - Handles natural language queries
343
- - Semantic similarity matching
344
- - Searches across multiple connected systems
345
-
346
- ## Key Principles
347
-
348
- 1. **First response is always text-only** — Present search sources without calling any tool
349
- 2. **Only show configured sources** — Check your own tool list (introspection, not tool calls) and only present sources whose tools you have
350
- 3. **Wait for user selection** — Never auto-select a source or image
351
- 4. **Show all results** — Let the user choose the best match
352
- 5. **Confirm before applying** — Verify the selection before modifying code
353
- 6. **Handle errors gracefully** — Provide clear feedback and alternatives