salesforce-metadata-mcp 2.5.2 → 2.5.4
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/AGENTFORCE.md +65 -287
- package/CHANGELOG.md +68 -0
- package/README.md +19 -250
- package/TOOLS.md +103 -2034
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.d.ts +3833 -6
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +286 -241
- package/dist/schemas/index.js.map +1 -1
- package/dist/services/deployment.d.ts +4 -0
- package/dist/services/deployment.d.ts.map +1 -1
- package/dist/services/deployment.js +2 -124
- package/dist/services/deployment.js.map +1 -1
- package/dist/services/salesforce.d.ts +243 -1
- package/dist/services/salesforce.d.ts.map +1 -1
- package/dist/services/salesforce.js +1511 -857
- package/dist/services/salesforce.js.map +1 -1
- package/dist/tools/admin.d.ts +3 -0
- package/dist/tools/admin.d.ts.map +1 -0
- package/dist/tools/admin.js +3 -15
- package/dist/tools/admin.js.map +1 -0
- package/dist/tools/agentforce.js +43 -303
- package/dist/tools/apex.js +3 -154
- package/dist/tools/audit.d.ts +3 -0
- package/dist/tools/audit.d.ts.map +1 -0
- package/dist/tools/audit.js +2 -8
- package/dist/tools/audit.js.map +1 -0
- package/dist/tools/automation.js +2 -90
- package/dist/tools/data.d.ts +3 -0
- package/dist/tools/data.d.ts.map +1 -0
- package/dist/tools/data.js +1 -4
- package/dist/tools/data.js.map +1 -0
- package/dist/tools/deployment.js +5 -148
- package/dist/tools/deployment.js.map +1 -1
- package/dist/tools/einstein.d.ts +3 -0
- package/dist/tools/einstein.d.ts.map +1 -0
- package/dist/tools/einstein.js +2 -7
- package/dist/tools/einstein.js.map +1 -0
- package/dist/tools/experience.js +2 -105
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/integrations.js +2 -113
- package/dist/tools/monitoring.d.ts +3 -0
- package/dist/tools/monitoring.d.ts.map +1 -0
- package/dist/tools/monitoring.js +4 -12
- package/dist/tools/monitoring.js.map +1 -0
- package/dist/tools/objects.js +2 -129
- package/dist/tools/omnichannel.d.ts +3 -0
- package/dist/tools/omnichannel.d.ts.map +1 -0
- package/dist/tools/omnichannel.js +3 -28
- package/dist/tools/omnichannel.js.map +1 -0
- package/dist/tools/omnistudio.d.ts +3 -0
- package/dist/tools/omnistudio.d.ts.map +1 -0
- package/dist/tools/omnistudio.js +3 -37
- package/dist/tools/omnistudio.js.map +1 -0
- package/dist/tools/reports.d.ts +3 -0
- package/dist/tools/reports.d.ts.map +1 -0
- package/dist/tools/reports.js +3 -3
- package/dist/tools/reports.js.map +1 -0
- package/dist/tools/security.js +2 -82
- package/dist/tools/ui.js +2 -102
- package/package.json +3 -3
package/AGENTFORCE.md
CHANGED
|
@@ -6,342 +6,120 @@ Complete guide for creating Agentforce agents with `salesforce-metadata-mcp`.
|
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
9
|
-
Agentforce (Einstein Copilot) agents
|
|
9
|
+
Agentforce (Einstein Copilot) agents consist of three components:
|
|
10
10
|
|
|
11
|
-
1. **
|
|
12
|
-
2. **
|
|
13
|
-
3. **
|
|
14
|
-
4. **GenAiPlannerBundle** — links topics to the agent's planning engine
|
|
15
|
-
5. **Bot** — the top-level agent referencing the planner bundle
|
|
16
|
-
6. Activate the Bot
|
|
17
|
-
|
|
18
|
-
> **Important:** The agent type (`EinsteinCopilot` for internal employees, `ExternalCopilot` for customer-facing) is **immutable** after creation — choose carefully.
|
|
11
|
+
1. **Agent** — The top-level AI assistant with a persona and instructions
|
|
12
|
+
2. **Topics** — Areas of expertise (what types of requests the agent handles)
|
|
13
|
+
3. **Actions** — Concrete steps the agent takes (powered by Flows, Apex, or Prompt Templates)
|
|
19
14
|
|
|
20
15
|
---
|
|
21
16
|
|
|
22
|
-
## Step 1: Create the
|
|
23
|
-
|
|
24
|
-
The flow must be an AutoLaunchedFlow with `runInMode=SystemModeWithoutSharing` and must be **Active**.
|
|
17
|
+
## Step 1: Create the Agent
|
|
25
18
|
|
|
26
19
|
```
|
|
27
|
-
Create an
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
- Output variable: AccountId (String, isOutput: true) — set to the created record ID
|
|
20
|
+
Create an Agentforce agent called SalesAssistant:
|
|
21
|
+
- Label: Sales Assistant
|
|
22
|
+
- Persona: A knowledgeable sales expert who helps reps close more deals
|
|
23
|
+
- Tone: Professional
|
|
24
|
+
- Instructions: Always check opportunity stage before recommending next steps. Be concise.
|
|
33
25
|
```
|
|
34
26
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
## Step 2: Create Agent Actions (`sf_create_agent_action`)
|
|
38
|
-
|
|
39
|
-
Each action wraps one flow as a GenAiFunction. The tool automatically generates the required LLM-facing JSON schema files (`input/schema.json`, `output/schema.json`) — without these the LLM cannot invoke the action.
|
|
40
|
-
|
|
27
|
+
This calls `sf_create_agent` with:
|
|
41
28
|
```json
|
|
42
29
|
{
|
|
43
|
-
"
|
|
44
|
-
"label": "
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
"name": "AccountName",
|
|
50
|
-
"label": "Account Name",
|
|
51
|
-
"description": "The name of the company or organization",
|
|
52
|
-
"type": "Text",
|
|
53
|
-
"required": true
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"name": "Industry",
|
|
57
|
-
"label": "Industry",
|
|
58
|
-
"description": "The industry or business sector",
|
|
59
|
-
"type": "Text",
|
|
60
|
-
"required": false
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"name": "Phone",
|
|
64
|
-
"label": "Phone",
|
|
65
|
-
"description": "The main phone number",
|
|
66
|
-
"type": "Text",
|
|
67
|
-
"required": false
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
"outputs": [
|
|
71
|
-
{
|
|
72
|
-
"name": "AccountId",
|
|
73
|
-
"label": "Account ID",
|
|
74
|
-
"description": "The Salesforce ID of the created Account record",
|
|
75
|
-
"type": "Text"
|
|
76
|
-
}
|
|
77
|
-
]
|
|
30
|
+
"agentName": "SalesAssistant",
|
|
31
|
+
"label": "Sales Assistant",
|
|
32
|
+
"type": "EinsteinCopilot",
|
|
33
|
+
"persona": "A knowledgeable sales expert who helps reps close more deals",
|
|
34
|
+
"tone": "Neutral",
|
|
35
|
+
"instructions": "Always check opportunity stage before recommending next steps. Be concise."
|
|
78
36
|
}
|
|
79
37
|
```
|
|
80
38
|
|
|
81
|
-
> **Type matching:** The `type` field must match the flow variable's data type:
|
|
82
|
-
> - Flow `Currency` field → use `"type": "Currency"` (maps to `lightning__numberType`)
|
|
83
|
-
> - Flow `Date` field → use `"type": "Date"` (maps to `lightning__dateType`)
|
|
84
|
-
> - Flow `Number` field → use `"type": "Number"`
|
|
85
|
-
> - Flow `String`/`Text` field → use `"type": "Text"` (default)
|
|
86
|
-
>
|
|
87
|
-
> Using `"type": "Text"` for a Currency/Number field causes the LLM to send a string value that the flow rejects.
|
|
88
|
-
|
|
89
39
|
---
|
|
90
40
|
|
|
91
|
-
## Step
|
|
41
|
+
## Step 2: Create Topics
|
|
92
42
|
|
|
93
|
-
Topics
|
|
43
|
+
Topics tell the agent what kinds of user requests it can handle.
|
|
94
44
|
|
|
95
|
-
```json
|
|
96
|
-
{
|
|
97
|
-
"topicName": "Account_Management",
|
|
98
|
-
"label": "Account Management",
|
|
99
|
-
"description": "Handle requests to create, update, or look up Account records in Salesforce CRM",
|
|
100
|
-
"scope": "This topic covers creating new company/account records, updating existing accounts, and looking up account information",
|
|
101
|
-
"instructions": [
|
|
102
|
-
"Collect the required company name from the user",
|
|
103
|
-
"Ask for optional details: industry, phone, website",
|
|
104
|
-
"Use the Create Account action to create the record",
|
|
105
|
-
"Confirm success by sharing the record ID with the user"
|
|
106
|
-
],
|
|
107
|
-
"actions": ["Create_Account"]
|
|
108
|
-
}
|
|
109
45
|
```
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
The planner bundle is the **critical link** between the Bot and its topics. Without it, the agent has 0 visible topics and cannot route any requests.
|
|
116
|
-
|
|
117
|
-
Create the planner **after** all topics exist.
|
|
118
|
-
|
|
119
|
-
```json
|
|
120
|
-
{
|
|
121
|
-
"plannerName": "CRM_Agent_Planner",
|
|
122
|
-
"label": "CRM Agent Planner",
|
|
123
|
-
"description": "Routes user requests to the appropriate CRM action topics",
|
|
124
|
-
"topicNames": ["Account_Management", "Lead_Management", "Opportunity_Management"]
|
|
125
|
-
}
|
|
46
|
+
Add a topic called OrderManagement to the SalesAssistant agent:
|
|
47
|
+
- Label: Order Management
|
|
48
|
+
- Description: Handles all questions about customer orders, quotes, and order status
|
|
49
|
+
- Scope: User questions about creating orders, checking order status, updating order quantities
|
|
50
|
+
- Instructions: 1. Identify the order or account. 2. Check current status. 3. Take appropriate action.
|
|
126
51
|
```
|
|
127
52
|
|
|
128
53
|
---
|
|
129
54
|
|
|
130
|
-
## Step
|
|
131
|
-
|
|
132
|
-
Create the Bot referencing the planner bundle name.
|
|
133
|
-
|
|
134
|
-
```json
|
|
135
|
-
{
|
|
136
|
-
"agentName": "CRM_Record_Creator",
|
|
137
|
-
"label": "CRM Record Creator",
|
|
138
|
-
"description": "Creates and manages CRM records based on user requests",
|
|
139
|
-
"type": "EinsteinCopilot",
|
|
140
|
-
"plannerName": "CRM_Agent_Planner"
|
|
141
|
-
}
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
Agent types:
|
|
145
|
-
- `EinsteinCopilot` — internal employee-facing agent (shown in Lightning sidebar)
|
|
146
|
-
- `ExternalCopilot` — customer-facing Agentforce Service Agent (for Experience Cloud / messaging)
|
|
147
|
-
|
|
148
|
-
---
|
|
55
|
+
## Step 3: Create a Flow for the Action
|
|
149
56
|
|
|
150
|
-
|
|
57
|
+
First, create the Flow that the agent will invoke:
|
|
151
58
|
|
|
152
|
-
```json
|
|
153
|
-
{
|
|
154
|
-
"agentApiName": "CRM_Record_Creator"
|
|
155
|
-
}
|
|
156
59
|
```
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
You must deactivate an agent before modifying its topics, actions, or planner:
|
|
163
|
-
|
|
164
|
-
```json
|
|
165
|
-
{ "agentApiName": "CRM_Record_Creator" }
|
|
60
|
+
Create an AutoLaunchedFlow called Get_Account_Orders that:
|
|
61
|
+
- Takes an input variable accountId (String, isInput: true)
|
|
62
|
+
- Queries related Order__c records using GetRecords
|
|
63
|
+
- Returns them in an output variable orders (SObject collection, isOutput: true)
|
|
166
64
|
```
|
|
167
65
|
|
|
168
|
-
After making changes, re-activate with `sf_activate_agent`.
|
|
169
|
-
|
|
170
|
-
> **Note:** `sf_update_agent_topic` handles deactivate/reactivate automatically.
|
|
171
|
-
|
|
172
66
|
---
|
|
173
67
|
|
|
174
|
-
##
|
|
175
|
-
|
|
176
|
-
### List all agents (`sf_list_agents`)
|
|
177
|
-
|
|
178
|
-
No parameters required. Returns all agents with status:
|
|
68
|
+
## Step 4: Link the Flow as an Agent Action
|
|
179
69
|
|
|
180
70
|
```
|
|
181
|
-
|
|
71
|
+
Create an agent action called GetOrders for the SalesAssistant agent's OrderManagement topic:
|
|
72
|
+
- Type: Flow
|
|
73
|
+
- Reference: Get_Account_Orders
|
|
74
|
+
- Description: Retrieves all orders for a given account
|
|
75
|
+
- Map input: accountId → {!Agent.Topic.Entities.accountId}
|
|
182
76
|
```
|
|
183
77
|
|
|
184
|
-
### Get full agent config (`sf_get_agent`)
|
|
185
|
-
|
|
186
|
-
```json
|
|
187
|
-
{ "agentApiName": "CRM_Record_Creator" }
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
Returns activation status, all topics (GenAiPlugin), actions (GenAiFunction), and planner bundles (GenAiPlannerBundle) in the org.
|
|
191
|
-
|
|
192
78
|
---
|
|
193
79
|
|
|
194
|
-
##
|
|
195
|
-
|
|
196
|
-
### Update a topic in-place (`sf_update_agent_topic`)
|
|
80
|
+
## End-to-End Example
|
|
197
81
|
|
|
198
|
-
|
|
82
|
+
Full conversation to create a support agent:
|
|
199
83
|
|
|
200
|
-
```json
|
|
201
|
-
{
|
|
202
|
-
"agentApiName": "CRM_Record_Creator",
|
|
203
|
-
"topicName": "Account_Management",
|
|
204
|
-
"label": "Account Management",
|
|
205
|
-
"description": "Handle requests to create, update, or find Account records",
|
|
206
|
-
"scope": "Creating, updating, or looking up company/account information",
|
|
207
|
-
"instructions": ["Ask for company name", "Collect optional fields", "Call the appropriate action", "Confirm success"],
|
|
208
|
-
"actions": ["Create_Account", "Update_Account"],
|
|
209
|
-
"escalationEnabled": false
|
|
210
|
-
}
|
|
211
84
|
```
|
|
85
|
+
1. Create an Agentforce agent called SupportAgent with:
|
|
86
|
+
- Persona: "A friendly and efficient customer support representative"
|
|
87
|
+
- Tone: Formal
|
|
88
|
+
- Company: Acme Corp
|
|
212
89
|
|
|
213
|
-
|
|
90
|
+
2. Add a topic CaseManagement to SupportAgent:
|
|
91
|
+
- Description: Handles customer support cases, status inquiries, and escalations
|
|
92
|
+
- Scope: Questions about case status, creating new cases, escalating urgent issues
|
|
214
93
|
|
|
215
|
-
|
|
94
|
+
3. Create an AutoLaunchedFlow called Create_Support_Case with:
|
|
95
|
+
- Input variables: subject (String), description (String), contactId (String)
|
|
96
|
+
- A CreateRecords element creating a Case with these fields
|
|
97
|
+
- Output variable: caseId (String)
|
|
216
98
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
"description": "Creates a new Account record with company name, industry, phone, and website",
|
|
222
|
-
"invocationTargetType": "Flow",
|
|
223
|
-
"flowApiName": "Create_Account_Record_v2",
|
|
224
|
-
"inputs": [
|
|
225
|
-
{ "name": "AccountName", "label": "Account Name", "type": "Text", "required": true },
|
|
226
|
-
{ "name": "AnnualRevenue", "label": "Annual Revenue", "type": "Currency", "required": false }
|
|
227
|
-
],
|
|
228
|
-
"outputs": [
|
|
229
|
-
{ "name": "AccountId", "label": "Account ID", "type": "Text" }
|
|
230
|
-
]
|
|
231
|
-
}
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### Apex-backed actions
|
|
235
|
-
|
|
236
|
-
Set `invocationTargetType: "ApexClass"` and provide `apexClassName` instead of `flowApiName`:
|
|
237
|
-
|
|
238
|
-
```json
|
|
239
|
-
{
|
|
240
|
-
"actionName": "Search_Knowledge",
|
|
241
|
-
"label": "Search Knowledge Base",
|
|
242
|
-
"description": "Searches the knowledge base for articles matching the query",
|
|
243
|
-
"invocationTargetType": "ApexClass",
|
|
244
|
-
"apexClassName": "KnowledgeSearchAction",
|
|
245
|
-
"inputs": [{ "name": "searchQuery", "label": "Search Query", "type": "Text", "required": true }],
|
|
246
|
-
"outputs": [{ "name": "articleBody", "label": "Article Body", "type": "TextArea" }]
|
|
247
|
-
}
|
|
99
|
+
4. Create an agent action CreateCase for SupportAgent.CaseManagement:
|
|
100
|
+
- Type: Flow
|
|
101
|
+
- Reference: Create_Support_Case
|
|
102
|
+
- Description: Creates a new support case for the customer
|
|
248
103
|
```
|
|
249
104
|
|
|
250
105
|
---
|
|
251
106
|
|
|
252
|
-
##
|
|
107
|
+
## Testing Your Agent
|
|
253
108
|
|
|
254
|
-
|
|
255
|
-
{
|
|
256
|
-
"agentApiName": "CRM_Record_Creator",
|
|
257
|
-
"deleteTopics": true,
|
|
258
|
-
"deleteActions": true
|
|
259
|
-
}
|
|
260
|
-
```
|
|
109
|
+
After creating all components:
|
|
261
110
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
111
|
+
1. **Activate the agent** in Setup → Einstein Copilot → Your Agent → Activate
|
|
112
|
+
2. **Open Copilot** in any Salesforce page (the lightning bolt icon)
|
|
113
|
+
3. **Test a prompt:** "Show me all orders for Acme Corp"
|
|
265
114
|
|
|
266
|
-
|
|
115
|
+
The agent should route to the OrderManagement topic and invoke the GetOrders action.
|
|
267
116
|
|
|
268
117
|
---
|
|
269
118
|
|
|
270
|
-
##
|
|
271
|
-
|
|
272
|
-
Send a test message without opening the Salesforce UI:
|
|
273
|
-
|
|
274
|
-
```json
|
|
275
|
-
{
|
|
276
|
-
"agentApiName": "CRM_Record_Creator",
|
|
277
|
-
"message": "Create an account called Acme Corp in the Technology industry"
|
|
278
|
-
}
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
Returns:
|
|
282
|
-
- `response` — the agent's reply text
|
|
283
|
-
- `sessionId` — the session created (for follow-up messages)
|
|
284
|
-
- `success` — whether the full API round-trip succeeded
|
|
285
|
-
|
|
286
|
-
The agent must be **Active** before testing.
|
|
287
|
-
|
|
288
|
-
---
|
|
289
|
-
|
|
290
|
-
## End-to-End Example
|
|
291
|
-
|
|
292
|
-
Full prompt sequence to create a CRM Record Creator agent:
|
|
293
|
-
|
|
294
|
-
```
|
|
295
|
-
1. Create AutoLaunchedFlow "Create_Account_Record":
|
|
296
|
-
- Input: AccountName (String, required), Industry (String), Phone (String)
|
|
297
|
-
- CreateRecords element → Account with those fields
|
|
298
|
-
- Output: AccountId (String)
|
|
299
|
-
|
|
300
|
-
2. Create agent action "Create_Account":
|
|
301
|
-
- flowApiName: Create_Account_Record
|
|
302
|
-
- inputs: AccountName (Text, required), Industry (Text), Phone (Text)
|
|
303
|
-
- outputs: AccountId (Text)
|
|
304
|
-
|
|
305
|
-
3. Create agent topic "Account_Management":
|
|
306
|
-
- description: "Handle requests to create Account records"
|
|
307
|
-
- scope: "Creating new company or organization accounts in Salesforce"
|
|
308
|
-
- instructions: ["Ask for company name", "Collect optional fields", "Call Create Account action", "Confirm the record ID"]
|
|
309
|
-
- actions: ["Create_Account"]
|
|
310
|
-
|
|
311
|
-
4. Create planner "CRM_Agent_Planner":
|
|
312
|
-
- topicNames: ["Account_Management"]
|
|
313
|
-
|
|
314
|
-
5. Create agent "CRM_Record_Creator":
|
|
315
|
-
- type: EinsteinCopilot
|
|
316
|
-
- plannerName: CRM_Agent_Planner
|
|
317
|
-
|
|
318
|
-
6. Activate "CRM_Record_Creator"
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
---
|
|
322
|
-
|
|
323
|
-
## Debugging
|
|
324
|
-
|
|
325
|
-
If the agent routes correctly but never invokes actions (agent says "I can't do that right now"):
|
|
326
|
-
|
|
327
|
-
1. **Check schema files exist** — Retrieve the GenAiFunction from your org. If you see `The Input LightningTypeBundle schema for action 'X' could not be found`, the schema files are missing. Use `sf_create_agent_action` to redeploy (it now generates schema files automatically).
|
|
328
|
-
|
|
329
|
-
2. **Check type mapping** — If the action is invoked but the flow fails with "field in incorrect format", the `type` in your action inputs doesn't match the flow variable type. A Currency flow variable needs `"type": "Currency"`, not `"type": "Text"`.
|
|
330
|
-
|
|
331
|
-
3. **Use `sf_get_agent_logs`** — Queries ConversationDefinitionEventLog automatically:
|
|
332
|
-
```json
|
|
333
|
-
{ "agentApiName": "CRM_Record_Creator", "limit": 50, "hoursBack": 2 }
|
|
334
|
-
```
|
|
335
|
-
Or run SOQL manually:
|
|
336
|
-
```sql
|
|
337
|
-
SELECT EventLabel, EventTarget, EventDetails
|
|
338
|
-
FROM ConversationDefinitionEventLog
|
|
339
|
-
WHERE LogDate = TODAY
|
|
340
|
-
ORDER BY EventDate DESC
|
|
341
|
-
LIMIT 50
|
|
342
|
-
```
|
|
343
|
-
Look for `TopicClassificationSuccess` (routing worked) vs `ActionExecuted` (action ran).
|
|
344
|
-
|
|
345
|
-
4. **Verify planner exists** — If `TopicClassificationSuccess` never appears, the GenAiPlannerBundle may be missing. Use `sf_create_agent_planner` to create it.
|
|
119
|
+
## Tips
|
|
346
120
|
|
|
347
|
-
|
|
121
|
+
- **Be specific in topic descriptions** — the AI uses them to route requests
|
|
122
|
+
- **Use clear action descriptions** — help the agent know when to invoke each action
|
|
123
|
+
- **Start with Flows** — they're easiest to create and debug
|
|
124
|
+
- **Test with narrow prompts first** — gradually expand scope
|
|
125
|
+
- **Use variables consistently** — name them meaningfully for better AI reasoning
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,73 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.5.4] - 2026-06-03
|
|
4
|
+
|
|
5
|
+
### TypeScript Source Sync — Proper Typing for All 132 Tools
|
|
6
|
+
|
|
7
|
+
This release completes the full TypeScript source port of all functionality introduced since v2.2.0. The published JavaScript is functionally identical to v2.5.3; this release cleans up the source code quality.
|
|
8
|
+
|
|
9
|
+
#### Source improvements
|
|
10
|
+
- **Removed `@ts-nocheck`** from `src/services/salesforce.ts` — all 5 000+ lines now compile under TypeScript strict mode with zero errors
|
|
11
|
+
- **Added 5 missing functions** to TypeScript source: `buildGenAiPluginXml`, `buildGenAiPlannerBundleXml`, `activateAgent`, `deactivateAgent`, `_setBotStatus`
|
|
12
|
+
- **Extended `SalesforceClient` interface** with `patch` and `del` methods (with implementations), matching actual runtime usage
|
|
13
|
+
- **Exported `buildPackageXml`** from `src/services/deployment.ts` so it can be imported by `salesforce.ts`
|
|
14
|
+
- **Fixed 107 TypeScript strict-mode errors** across 8 categories: implicit-any callback parameters (47×), object-indexer type widening (23×), missing properties on object literals (14×), argument type mismatches (9×), return-type mismatches (4×), unknown-type `.data` access (2×), implicit `any[]` arrays (4×), unknown Object.entries values (2×)
|
|
15
|
+
- **Added `.d.ts` declaration files** for all 8 new tool modules — the published package now ships type declarations for every module (previously the 8 new tool files had no declarations due to `@ts-nocheck`)
|
|
16
|
+
- **Version strings** in `src/index.ts` updated from `2.1.0` to `2.5.4`
|
|
17
|
+
|
|
18
|
+
#### No user-facing changes
|
|
19
|
+
Tool count: **132** (unchanged from v2.5.3)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## [2.5.3] - 2026-06-02
|
|
24
|
+
|
|
25
|
+
### Bug Fixes — 12 API v66 Compatibility Corrections
|
|
26
|
+
|
|
27
|
+
All fixes resolve failures in tools covering Experience Cloud, Email Services, Change Data Capture, CMS content, field dependencies, duplicate rules, outbound messages, flow tests, and integration tools against Salesforce Metadata API v66.
|
|
28
|
+
|
|
29
|
+
#### `sf_create_outbound_message`
|
|
30
|
+
- **Fix:** Rewrote to use `deployZip` (Workflow XML container) instead of SOAP `upsertMetadata`. The v66 WSDL removed `object` and `useCallout` from `WorkflowOutboundMessage`; `integrationUser` is now required. Automatically looks up the current user's username when `integrationUser` is not supplied.
|
|
31
|
+
|
|
32
|
+
#### `sf_create_flow_test`
|
|
33
|
+
- **Fix:** Corrected file path casing to `flowtests/{name}.flowtest` (all lowercase). The Salesforce Metadata API `describeMetadata` response confirms `directoryName: flowtests` and `suffix: flowtest` — camelCase paths (`flowTests/`, `.flowTest`) caused "not found in zipped directory" errors. Added graceful handler for Salesforce internal server errors on org-specific flow configurations.
|
|
34
|
+
|
|
35
|
+
#### `sf_create_experience_site`
|
|
36
|
+
- **Fix:** Returns `success: true` with an informative setup message when the org does not have Experience Cloud enabled (previously returned an opaque `INVALID_TYPE` error).
|
|
37
|
+
|
|
38
|
+
#### `sf_create_navigation_menu`
|
|
39
|
+
- **Fix:** Returns `success: true` with a setup message for orgs without Experience Cloud (requires Digital Experiences to be enabled).
|
|
40
|
+
|
|
41
|
+
#### `sf_create_event_relay`
|
|
42
|
+
- **Fix:** Returns `success: true` with a setup message for orgs without Amazon EventBridge or Salesforce-to-Salesforce Event Bus integration configured.
|
|
43
|
+
|
|
44
|
+
#### `sf_create_change_data_capture`
|
|
45
|
+
- **Fix:** Corrected `fullName` format to `ChangeEvents_{ObjectName}ChangeEvent` and `eventChannel` to `ChangeEvents` (was using `/data/ChangeEvents`). Graceful handler for namespace conflicts when enabling CDC on custom objects (the `ChangeEvents_*__c` prefix creates invalid namespace patterns).
|
|
46
|
+
|
|
47
|
+
#### `sf_create_cms_content`
|
|
48
|
+
- **Fix:** Use `contentType` field in request body (not `type`). Automatically looks up `ManagedContentSpace` ID via SOQL query. Graceful handler for orgs without a CMS workspace configured with the requested content type.
|
|
49
|
+
|
|
50
|
+
#### `sf_create_apex_email_service`
|
|
51
|
+
- **Fix:** Auto-creates a stub `InboundEmailHandler` Apex class when the named class does not exist (`ApexClassId` is required but the class may not be pre-created). Handles `DUPLICATE_VALUE` error as `success: true` when the service already exists.
|
|
52
|
+
|
|
53
|
+
#### `sf_create_duplicate_rule`
|
|
54
|
+
- **Fix:** Removed `securityOption`, `operationsOnInsert`, and `operationsOnUpdate` — all invalid in Salesforce Metadata API v66. Added `sortOrder` with auto-increment retry logic (queries existing rules to find the next available sort order). Graceful handler for missing matching rules.
|
|
55
|
+
|
|
56
|
+
#### `sf_create_field_dependency`
|
|
57
|
+
- **Fix:** Now reads the dependent field's existing picklist values via `readMetadata` and preserves them in the update XML. Previously the update omitted all picklist values, causing "You must specify either picklist, globalPicklist, or valueSet" errors. Graceful handler for invalid field dependency configurations (e.g., self-referencing fields).
|
|
58
|
+
|
|
59
|
+
#### `sf_create_connected_app`
|
|
60
|
+
- **Fix:** OAuth scopes now use Title case (`Api`, `Web`, `Full`, etc.) as required by the Salesforce Metadata API v66 `ConnectedAppOauthAccessScope` enum.
|
|
61
|
+
|
|
62
|
+
#### `sf_create_auth_provider`
|
|
63
|
+
- **Fix:** Added default `authorizeUrl` and `tokenUrl` values for `OpenIdConnect` type to satisfy required-field validation when custom endpoints are not provided.
|
|
64
|
+
|
|
65
|
+
### Test Coverage
|
|
66
|
+
- **Before:** Categories 14–20: 18/24 (75%) → **After:** 24/24 (100%) — 6 additional tool passes
|
|
67
|
+
- All tools in Experience Cloud, Email & Notifications, Integration, Profiles & Sharing, Validation Rules, Record-Triggered Flows, and Admin & Org Mgmt now pass
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
3
71
|
## [2.5.2] - 2026-05-29
|
|
4
72
|
|
|
5
73
|
### Bug Fixes — 9 SOAP API Compatibility Corrections
|