salesforce-metadata-mcp 2.0.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.
Files changed (91) hide show
  1. package/AGENTFORCE.md +125 -0
  2. package/APEX_LWC.md +214 -0
  3. package/CHANGELOG.md +120 -0
  4. package/README.md +207 -0
  5. package/SETUP.md +208 -0
  6. package/TOOLS.md +193 -0
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +53 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/schemas/index.d.ts +3406 -0
  12. package/dist/schemas/index.d.ts.map +1 -0
  13. package/dist/schemas/index.js +992 -0
  14. package/dist/schemas/index.js.map +1 -0
  15. package/dist/services/deployment.d.ts +36 -0
  16. package/dist/services/deployment.d.ts.map +1 -0
  17. package/dist/services/deployment.js +215 -0
  18. package/dist/services/deployment.js.map +1 -0
  19. package/dist/services/mcpgen.d.ts +16 -0
  20. package/dist/services/mcpgen.d.ts.map +1 -0
  21. package/dist/services/mcpgen.js +229 -0
  22. package/dist/services/mcpgen.js.map +1 -0
  23. package/dist/services/salesforce.d.ts +598 -0
  24. package/dist/services/salesforce.d.ts.map +1 -0
  25. package/dist/services/salesforce.js +1317 -0
  26. package/dist/services/salesforce.js.map +1 -0
  27. package/dist/services/tooling.d.ts +23 -0
  28. package/dist/services/tooling.d.ts.map +1 -0
  29. package/dist/services/tooling.js +173 -0
  30. package/dist/services/tooling.js.map +1 -0
  31. package/dist/tools/agentforce.d.ts +3 -0
  32. package/dist/tools/agentforce.d.ts.map +1 -0
  33. package/dist/tools/agentforce.js +73 -0
  34. package/dist/tools/agentforce.js.map +1 -0
  35. package/dist/tools/apex.d.ts +3 -0
  36. package/dist/tools/apex.d.ts.map +1 -0
  37. package/dist/tools/apex.js +95 -0
  38. package/dist/tools/apex.js.map +1 -0
  39. package/dist/tools/automation.d.ts +3 -0
  40. package/dist/tools/automation.d.ts.map +1 -0
  41. package/dist/tools/automation.js +186 -0
  42. package/dist/tools/automation.js.map +1 -0
  43. package/dist/tools/deployment.d.ts +3 -0
  44. package/dist/tools/deployment.d.ts.map +1 -0
  45. package/dist/tools/deployment.js +89 -0
  46. package/dist/tools/deployment.js.map +1 -0
  47. package/dist/tools/experience.d.ts +3 -0
  48. package/dist/tools/experience.d.ts.map +1 -0
  49. package/dist/tools/experience.js +53 -0
  50. package/dist/tools/experience.js.map +1 -0
  51. package/dist/tools/index.d.ts +3 -0
  52. package/dist/tools/index.d.ts.map +1 -0
  53. package/dist/tools/index.js +27 -0
  54. package/dist/tools/index.js.map +1 -0
  55. package/dist/tools/integrations.d.ts +3 -0
  56. package/dist/tools/integrations.d.ts.map +1 -0
  57. package/dist/tools/integrations.js +96 -0
  58. package/dist/tools/integrations.js.map +1 -0
  59. package/dist/tools/lwc.d.ts +3 -0
  60. package/dist/tools/lwc.d.ts.map +1 -0
  61. package/dist/tools/lwc.js +73 -0
  62. package/dist/tools/lwc.js.map +1 -0
  63. package/dist/tools/mcp.d.ts +3 -0
  64. package/dist/tools/mcp.d.ts.map +1 -0
  65. package/dist/tools/mcp.js +44 -0
  66. package/dist/tools/mcp.js.map +1 -0
  67. package/dist/tools/metadata.d.ts +3 -0
  68. package/dist/tools/metadata.d.ts.map +1 -0
  69. package/dist/tools/metadata.js +168 -0
  70. package/dist/tools/metadata.js.map +1 -0
  71. package/dist/tools/objects.d.ts +3 -0
  72. package/dist/tools/objects.d.ts.map +1 -0
  73. package/dist/tools/objects.js +172 -0
  74. package/dist/tools/objects.js.map +1 -0
  75. package/dist/tools/security.d.ts +3 -0
  76. package/dist/tools/security.d.ts.map +1 -0
  77. package/dist/tools/security.js +82 -0
  78. package/dist/tools/security.js.map +1 -0
  79. package/dist/tools/ui.d.ts +3 -0
  80. package/dist/tools/ui.d.ts.map +1 -0
  81. package/dist/tools/ui.js +195 -0
  82. package/dist/tools/ui.js.map +1 -0
  83. package/dist/tools/utils.d.ts +15 -0
  84. package/dist/tools/utils.d.ts.map +1 -0
  85. package/dist/tools/utils.js +7 -0
  86. package/dist/tools/utils.js.map +1 -0
  87. package/dist/types.d.ts +85 -0
  88. package/dist/types.d.ts.map +1 -0
  89. package/dist/types.js +3 -0
  90. package/dist/types.js.map +1 -0
  91. package/package.json +46 -0
@@ -0,0 +1,992 @@
1
+ import { z } from "zod";
2
+ // ─── Shared sub-schemas ───────────────────────────────────────────────────────
3
+ export const PicklistValueSchema = z.object({
4
+ fullName: z.string().min(1).describe("API name for the picklist value (e.g. 'New')"),
5
+ label: z.string().min(1).describe("Display label for the value"),
6
+ default: z.boolean().default(false).describe("Whether this is the default value"),
7
+ isActive: z.boolean().optional().describe("Whether the value is active (default true)"),
8
+ color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Hex color code, e.g. '#FF0000'"),
9
+ description: z.string().optional().describe("Optional description for the value"),
10
+ });
11
+ export const ValueSetSchema = z.object({
12
+ restricted: z.boolean().default(false).describe("If true, only values in the list are allowed"),
13
+ sorted: z.boolean().default(false).describe("Whether values are auto-sorted alphabetically"),
14
+ values: z.array(PicklistValueSchema).min(1).describe("List of picklist values"),
15
+ });
16
+ // ─── Create Custom Object ─────────────────────────────────────────────────────
17
+ export const CreateCustomObjectSchema = z.object({
18
+ fullName: z
19
+ .string()
20
+ .min(1)
21
+ .regex(/^[A-Za-z][A-Za-z0-9_]*__c$/, "Must end with __c, e.g. 'Invoice__c'")
22
+ .describe("API name of the custom object, e.g. 'Invoice__c'"),
23
+ label: z.string().min(1).describe("Singular label shown in the UI, e.g. 'Invoice'"),
24
+ pluralLabel: z.string().min(1).describe("Plural label, e.g. 'Invoices'"),
25
+ description: z.string().optional().describe("Optional description for the object"),
26
+ nameFieldLabel: z
27
+ .string()
28
+ .default("Name")
29
+ .describe("Label for the standard Name field, e.g. 'Invoice Name'"),
30
+ nameFieldType: z
31
+ .enum(["Text", "AutoNumber"])
32
+ .default("Text")
33
+ .describe("Type of Name field: 'Text' (free-form) or 'AutoNumber' (auto-increment)"),
34
+ autoNumberFormat: z
35
+ .string()
36
+ .optional()
37
+ .describe("Format for AutoNumber name field, e.g. 'INV-{0000}'. Required when nameFieldType is AutoNumber."),
38
+ deploymentStatus: z
39
+ .enum(["Deployed", "InDevelopment"])
40
+ .default("Deployed")
41
+ .describe("Deployment status of the object"),
42
+ sharingModel: z
43
+ .enum(["ReadWrite", "Read", "Private", "ControlledByParent", "FullAccess"])
44
+ .default("ReadWrite")
45
+ .describe("OWD sharing model for the object"),
46
+ enableActivities: z.boolean().default(true).describe("Allow activities (tasks/events) on this object"),
47
+ enableHistory: z.boolean().default(false).describe("Enable field history tracking"),
48
+ enableReports: z.boolean().default(true).describe("Make the object available for reports"),
49
+ enableSearch: z.boolean().default(true).describe("Enable search on this object"),
50
+ }).strict();
51
+ // ─── Create Custom Field ──────────────────────────────────────────────────────
52
+ export const FieldTypeSchema = z.enum([
53
+ "Text",
54
+ "TextArea",
55
+ "LongTextArea",
56
+ "Number",
57
+ "Currency",
58
+ "Percent",
59
+ "Checkbox",
60
+ "Date",
61
+ "DateTime",
62
+ "Email",
63
+ "Phone",
64
+ "Url",
65
+ "Picklist",
66
+ "MultiselectPicklist",
67
+ "Lookup",
68
+ "MasterDetail",
69
+ ]);
70
+ export const CreateCustomFieldSchema = z
71
+ .object({
72
+ objectName: z
73
+ .string()
74
+ .min(1)
75
+ .describe("API name of the parent object, e.g. 'Account' or 'Invoice__c'"),
76
+ fieldName: z
77
+ .string()
78
+ .min(1)
79
+ .regex(/^[A-Za-z][A-Za-z0-9_]*__c$/, "Must end with __c, e.g. 'Status__c'")
80
+ .describe("API name of the field, e.g. 'Status__c'"),
81
+ label: z.string().min(1).describe("Display label for the field, e.g. 'Status'"),
82
+ type: FieldTypeSchema.describe("Salesforce field type"),
83
+ description: z.string().optional().describe("Optional description for the field"),
84
+ required: z.boolean().optional().describe("Whether the field is required on page layouts"),
85
+ unique: z.boolean().optional().describe("Whether values must be unique (Text, Number, Email)"),
86
+ externalId: z.boolean().optional().describe("Whether this field is an external ID"),
87
+ length: z
88
+ .number()
89
+ .int()
90
+ .min(1)
91
+ .max(255)
92
+ .optional()
93
+ .describe("Max length for Text fields (1–255). Default 255."),
94
+ visibleLines: z
95
+ .number()
96
+ .int()
97
+ .min(2)
98
+ .max(50)
99
+ .optional()
100
+ .describe("Visible lines for LongTextArea / MultiselectPicklist"),
101
+ precision: z
102
+ .number()
103
+ .int()
104
+ .min(1)
105
+ .max(18)
106
+ .optional()
107
+ .describe("Total digits for Number/Currency/Percent (1–18)"),
108
+ scale: z
109
+ .number()
110
+ .int()
111
+ .min(0)
112
+ .max(17)
113
+ .optional()
114
+ .describe("Decimal places for Number/Currency/Percent (0–17)"),
115
+ picklistValues: ValueSetSchema.optional().describe("Picklist configuration. Required for Picklist / MultiselectPicklist types."),
116
+ referenceTo: z
117
+ .string()
118
+ .optional()
119
+ .describe("Target object API name for Lookup/MasterDetail, e.g. 'Account'"),
120
+ relationshipLabel: z
121
+ .string()
122
+ .optional()
123
+ .describe("Label for the relationship on the related object"),
124
+ relationshipName: z
125
+ .string()
126
+ .optional()
127
+ .describe("API name for the relationship (no spaces)"),
128
+ deleteConstraint: z
129
+ .enum(["Cascade", "Restrict", "SetNull"])
130
+ .optional()
131
+ .describe("Delete behaviour for Lookup fields: 'Cascade', 'Restrict', or 'SetNull'"),
132
+ })
133
+ .strict();
134
+ // ─── Add Picklist Values ──────────────────────────────────────────────────────
135
+ export const AddPicklistValuesSchema = z.object({
136
+ objectFieldFullName: z
137
+ .string()
138
+ .min(1)
139
+ .regex(/^[A-Za-z][A-Za-z0-9_]*\.[A-Za-z][A-Za-z0-9_]*__c$/, "Must be 'ObjectName__c.FieldName__c' or 'StandardObject.FieldName__c'")
140
+ .describe("Full API name of the picklist field, e.g. 'Invoice__c.Status__c'"),
141
+ values: z
142
+ .array(PicklistValueSchema)
143
+ .min(1)
144
+ .describe("New picklist values to add (existing values are preserved)"),
145
+ }).strict();
146
+ // ─── Create Flow ──────────────────────────────────────────────────────────────
147
+ export const FlowVariableSchema = z.object({
148
+ name: z.string().min(1).describe("Variable API name, e.g. 'myVariable'"),
149
+ dataType: z.enum(["String", "Number", "Boolean", "Date", "DateTime", "SObject"])
150
+ .describe("Data type of the variable"),
151
+ objectType: z.string().optional().describe("Object API name when dataType is SObject, e.g. 'Account'"),
152
+ isInput: z.boolean().default(false).describe("Accept input from outside the flow"),
153
+ isOutput: z.boolean().default(false).describe("Return as output from the flow"),
154
+ isCollection: z.boolean().default(false).describe("Holds a collection of values"),
155
+ defaultStringValue: z.string().optional().describe("Default string value"),
156
+ });
157
+ export const FlowElementSchema = z.object({
158
+ type: z.enum([
159
+ "Decision",
160
+ "GetRecords",
161
+ "CreateRecords",
162
+ "DeleteRecords",
163
+ "SendEmailAlert",
164
+ "ApexAction",
165
+ "Subflow",
166
+ "Loop",
167
+ "Assignment",
168
+ "Screen",
169
+ "Wait",
170
+ "PlatformEvent",
171
+ ]).describe("Flow element type"),
172
+ name: z.string().min(1).describe("Element API name, e.g. 'Check_Stage'"),
173
+ label: z.string().min(1).describe("Element display label"),
174
+ // Decision
175
+ conditions: z.array(z.object({
176
+ leftValueRef: z.string().describe("Left side reference, e.g. '{!varName}'"),
177
+ operator: z.string().describe("Operator: EqualTo, NotEqualTo, GreaterThan, etc."),
178
+ rightValue: z.string().optional().describe("Right side literal value"),
179
+ rightValueRef: z.string().optional().describe("Right side flow reference"),
180
+ })).optional().describe("Conditions for Decision elements"),
181
+ defaultConnector: z.string().optional().describe("Default connector target for Decision"),
182
+ // GetRecords / CreateRecords / DeleteRecords
183
+ objectApiName: z.string().optional().describe("Object API name for record operations"),
184
+ filterField: z.string().optional().describe("Field to filter on for GetRecords"),
185
+ filterOperator: z.string().optional().describe("Filter operator: EqualTo, etc."),
186
+ filterValueRef: z.string().optional().describe("Filter value reference"),
187
+ outputVariable: z.string().optional().describe("Variable to store retrieved record(s)"),
188
+ // SendEmailAlert
189
+ emailAlertApiName: z.string().optional().describe("API name of email alert to send"),
190
+ // ApexAction
191
+ apexClassName: z.string().optional().describe("Apex class name for ApexAction"),
192
+ apexMethodName: z.string().optional().describe("Apex method name for ApexAction"),
193
+ // Subflow
194
+ subflowApiName: z.string().optional().describe("API name of subflow to call"),
195
+ // Loop
196
+ loopVariable: z.string().optional().describe("Collection variable to loop over"),
197
+ loopIterationVariable: z.string().optional().describe("Variable for current iteration"),
198
+ // Assignment
199
+ assignments: z.array(z.object({
200
+ assignToRef: z.string().describe("Variable to assign to"),
201
+ operator: z.string().default("Assign").describe("Operator: Assign, Add, etc."),
202
+ valueRef: z.string().optional().describe("Reference value"),
203
+ value: z.string().optional().describe("Literal value"),
204
+ })).optional().describe("Assignments for Assignment elements"),
205
+ // Screen
206
+ screenFields: z.array(z.object({
207
+ name: z.string().describe("Field name"),
208
+ fieldType: z.string().describe("InputField, DisplayText, etc."),
209
+ label: z.string().optional().describe("Field label"),
210
+ dataType: z.string().optional().describe("String, Number, Boolean, etc."),
211
+ defaultValueRef: z.string().optional().describe("Default value reference"),
212
+ })).optional().describe("Fields for Screen elements"),
213
+ // Next element connector
214
+ nextElement: z.string().optional().describe("API name of the next element to connect to"),
215
+ });
216
+ export const CreateFlowSchema = z.object({
217
+ label: z.string().min(1).max(255).describe("Human-readable flow label, e.g. 'New Lead Onboarding'"),
218
+ apiName: z.string().min(1).max(80)
219
+ .regex(/^[A-Za-z][A-Za-z0-9_]*$/, "Must start with a letter, no spaces")
220
+ .describe("API name for the flow, e.g. 'New_Lead_Onboarding'"),
221
+ description: z.string().optional().describe("Description of what this flow does"),
222
+ flowType: z.enum(["AutoLaunchedFlow", "Flow", "RecordTriggeredFlow", "ScheduledFlow"])
223
+ .default("AutoLaunchedFlow")
224
+ .describe("Flow type: AutoLaunchedFlow, Flow (Screen), RecordTriggeredFlow, ScheduledFlow"),
225
+ triggerObject: z.string().optional().describe("Object API name for record-triggered flows, e.g. 'Opportunity'"),
226
+ triggerType: z.enum(["RecordBeforeSave", "RecordAfterSave", "RecordBeforeDelete"])
227
+ .optional()
228
+ .describe("When to trigger: RecordBeforeSave, RecordAfterSave, RecordBeforeDelete"),
229
+ triggerFilterFormula: z.string().optional()
230
+ .describe("Formula to filter which records trigger the flow, e.g. \"ISPICKVAL(StageName,'Closed Won')\""),
231
+ fieldUpdates: z.array(z.object({
232
+ field: z.string().describe("Field API name, e.g. 'CloseDate'"),
233
+ value: z.string().optional().describe("Literal string value to set"),
234
+ formula: z.string().optional().describe("Formula for the value, e.g. 'TODAY()'"),
235
+ })).optional().describe("Simple field updates on the triggering record (for RecordTriggeredFlow)"),
236
+ elements: z.array(FlowElementSchema).optional()
237
+ .describe("Advanced flow elements: Decision, GetRecords, CreateRecords, DeleteRecords, SendEmailAlert, ApexAction, Subflow, Loop, Assignment, Screen, Wait, PlatformEvent"),
238
+ variables: z.array(FlowVariableSchema).optional().describe("Input/output variables"),
239
+ status: z.enum(["Draft", "Active"]).default("Draft").describe("Flow status"),
240
+ submitForApprovalProcessName: z.string().optional().describe("API name of the Approval Process to automatically submit the record into. Works with any approval process — just pass its API name."),
241
+ }).strict();
242
+ // ─── Create Approval Process ──────────────────────────────────────────────────
243
+ export const ApprovalSubmitterSchema = z.object({
244
+ type: z.string().describe("Submitter type: 'owner', 'creator', 'role', 'group', 'user', 'allInternalUsers'"),
245
+ submitter: z.string().optional().describe("API name or username (required for role/group/user types)"),
246
+ });
247
+ export const ApprovalStepApproverSchema = z.object({
248
+ type: z.string().describe("Approver type: 'user', 'role', 'queue', 'relatedUserField', 'userHierarchyField', 'adhoc'"),
249
+ name: z.string().optional().describe("API name or username (not needed for adhoc/userHierarchyField)"),
250
+ });
251
+ export const ApprovalStepSchema = z.object({
252
+ name: z.string().min(1).describe("API name of the step, e.g. 'Manager_Approval'"),
253
+ label: z.string().min(1).describe("Display label, e.g. 'Manager Approval'"),
254
+ approvers: z.array(ApprovalStepApproverSchema).min(1).describe("Assigned approvers for this step"),
255
+ whenMultiple: z.enum(["Unanimous", "FirstResponse"]).default("Unanimous")
256
+ .describe("'Unanimous' = all must approve, 'FirstResponse' = first response wins"),
257
+ allowDelegate: z.boolean().default(true).describe("Allow approvers to delegate"),
258
+ entryFormula: z.string().optional().describe("Formula that must be true for this step to apply"),
259
+ ifCriteriaNotMet: z.enum(["ApproveRecord", "RejectRecord", "GotoNextStep"]).default("GotoNextStep")
260
+ .describe("What to do when entry formula is false"),
261
+ rejectBehavior: z.enum(["RejectRequest", "BackToPrevious"]).optional()
262
+ .describe("On rejection (not for step 1): 'RejectRequest' or 'BackToPrevious'"),
263
+ });
264
+ export const CreateApprovalProcessSchema = z.object({
265
+ objectName: z.string().min(1).describe("Object API name, e.g. 'Opportunity' or 'Leave_Request__c'"),
266
+ processName: z.string().min(1)
267
+ .regex(/^[A-Za-z][A-Za-z0-9_]*$/, "Must start with a letter, no spaces")
268
+ .describe("API name of the process, e.g. 'Large_Deal_Approval'"),
269
+ label: z.string().min(1).describe("Human-readable label, e.g. 'Large Deal Approval Process'"),
270
+ description: z.string().optional().describe("Description of the approval process"),
271
+ allowedSubmitters: z.array(ApprovalSubmitterSchema).min(1)
272
+ .describe("Who can submit: [{type:'owner'}] or [{type:'role', submitter:'SalesRep'}]"),
273
+ approvalSteps: z.array(ApprovalStepSchema).min(1).describe("Ordered list of approval steps"),
274
+ entryFormula: z.string().optional().describe("Formula records must satisfy to enter this process"),
275
+ entryFilterCriteria: z.array(z.object({
276
+ field: z.string().describe("Field API name, e.g. 'Amount'"),
277
+ operation: z.string().describe("Operation: 'greaterThan', 'equals', 'notEqual', etc."),
278
+ value: z.string().describe("Value to compare against"),
279
+ })).optional().describe("Filter criteria alternative to entryFormula"),
280
+ recordEditability: z.enum(["AdminOnly", "AdminOrCurrentApprover"]).default("AdminOnly")
281
+ .describe("Who can edit locked records during approval"),
282
+ allowRecall: z.boolean().default(true).describe("Allow submitters to recall approval requests"),
283
+ finalApprovalLock: z.boolean().default(false).describe("Lock record after final approval"),
284
+ finalRejectionLock: z.boolean().default(false).describe("Lock record after final rejection"),
285
+ emailTemplate: z.string().optional()
286
+ .describe("Email template for approval notifications, e.g. 'unfiled$public/ApprovalEmail'"),
287
+ active: z.boolean().default(false)
288
+ .describe("Activate immediately (warning: cannot change steps after activation)"),
289
+ }).strict();
290
+ // ─── Create Validation Rule ───────────────────────────────────────────────────
291
+ export const CreateValidationRuleSchema = z.object({
292
+ objectName: z.string().min(1).describe("Object API name, e.g. 'Account', 'Opportunity', 'Invoice__c'"),
293
+ ruleName: z.string().min(1)
294
+ .regex(/^[A-Za-z][A-Za-z0-9_]*$/, "Must start with a letter, no spaces")
295
+ .describe("API name for the rule, e.g. 'Require_Close_Date'"),
296
+ errorConditionFormula: z.string().min(1)
297
+ .describe("Formula returning TRUE when data is INVALID, e.g. \"AND(ISPICKVAL(StageName,'Closed Won'),ISBLANK(CloseDate))\""),
298
+ errorMessage: z.string().min(1).max(255)
299
+ .describe("Error shown to user when validation fails (max 255 chars)"),
300
+ errorDisplayField: z.string().optional()
301
+ .describe("Field API name to display error next to, e.g. 'CloseDate'. Blank = top of page."),
302
+ description: z.string().optional().describe("Description of this validation rule"),
303
+ active: z.boolean().default(true).describe("Whether the rule is active"),
304
+ }).strict();
305
+ // ─── Create Workflow Field Update ─────────────────────────────────────────────
306
+ export const CreateWorkflowFieldUpdateSchema = z.object({
307
+ objectName: z.string().min(1).describe("Object API name, e.g. 'Opportunity'"),
308
+ actionName: z.string().min(1)
309
+ .regex(/^[A-Za-z][A-Za-z0-9_]*$/, "Must start with a letter, no spaces")
310
+ .describe("API name of the action, e.g. 'Set_Stage_Closed_Won'"),
311
+ label: z.string().min(1).describe("Human-readable label"),
312
+ field: z.string().min(1).describe("Field API name to update, e.g. 'StageName'"),
313
+ literalValue: z.string().optional().describe("Literal string/picklist value to set"),
314
+ formula: z.string().optional().describe("Formula for the new value, e.g. 'TODAY()'"),
315
+ nullValue: z.boolean().default(false).describe("Set the field to null/blank"),
316
+ notifyAssignee: z.boolean().default(false).describe("Notify owner/assignee after update"),
317
+ }).strict();
318
+ // ─── OBJECTS & FIELDS ─────────────────────────────────────────────────────────
319
+ export const MetadataFieldSchema = z.object({
320
+ fullName: z.string().min(1).describe("Field API name ending in __c, e.g. 'MyField__c'"),
321
+ label: z.string().min(1).describe("Field label"),
322
+ type: z.enum(["Text", "Number", "Checkbox", "Date", "DateTime", "Email", "Phone", "Url",
323
+ "TextArea", "LongTextArea", "Picklist", "Currency", "Percent"]).describe("Field type"),
324
+ required: z.boolean().optional().describe("Is field required"),
325
+ length: z.number().int().optional().describe("Length for text fields"),
326
+ precision: z.number().int().optional().describe("Total digits for number fields"),
327
+ scale: z.number().int().optional().describe("Decimal places for number fields"),
328
+ defaultValue: z.string().optional().describe("Default value"),
329
+ description: z.string().optional().describe("Field description"),
330
+ picklistValues: z.array(z.string()).optional().describe("Picklist values as string array for Picklist type"),
331
+ });
332
+ export const CreateCustomMetadataTypeSchema = z.object({
333
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*__mdt$/, "Must end with __mdt")
334
+ .describe("API name of the Custom Metadata Type, e.g. 'Config__mdt'"),
335
+ label: z.string().min(1).describe("Singular label, e.g. 'Config'"),
336
+ pluralLabel: z.string().min(1).describe("Plural label, e.g. 'Configs'"),
337
+ description: z.string().optional().describe("Description of the type"),
338
+ fields: z.array(MetadataFieldSchema).optional().describe("Custom fields to add to this type"),
339
+ }).strict();
340
+ export const CreateCustomMetadataRecordSchema = z.object({
341
+ typeName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*__mdt$/, "Must end with __mdt")
342
+ .describe("Custom Metadata Type API name, e.g. 'Config__mdt'"),
343
+ recordName: z.string().min(1).describe("Record developer name, e.g. 'Default_Config'"),
344
+ label: z.string().min(1).describe("Record label"),
345
+ values: z.array(z.object({
346
+ field: z.string().describe("Field API name, e.g. 'IsActive__c'"),
347
+ value: z.string().describe("Field value as string"),
348
+ })).describe("Field values for this record"),
349
+ }).strict();
350
+ export const CreateCustomLabelSchema = z.object({
351
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/, "No spaces or special chars")
352
+ .describe("API name of the label, e.g. 'Welcome_Message'"),
353
+ value: z.string().min(1).describe("The label text value"),
354
+ language: z.string().default("en_US").describe("Language code, e.g. 'en_US', 'fr', 'de'"),
355
+ categories: z.string().optional().describe("Category for grouping labels"),
356
+ protected: z.boolean().default(false).describe("Protected labels are only accessible by the package that created them"),
357
+ shortDescription: z.string().optional().describe("Short description of the label's purpose"),
358
+ }).strict();
359
+ export const CreateCustomSettingSchema = z.object({
360
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*__c$/, "Must end with __c")
361
+ .describe("API name of the custom setting, e.g. 'OrgPreferences__c'"),
362
+ label: z.string().min(1).describe("Label for the custom setting object"),
363
+ settingType: z.enum(["Hierarchy", "List"]).default("Hierarchy")
364
+ .describe("Hierarchy: overridable at org/profile/user level. List: simple key-value list."),
365
+ visibility: z.enum(["Public", "Protected"]).default("Public")
366
+ .describe("Public: accessible to all Apex/VF. Protected: only accessible within the namespace."),
367
+ description: z.string().optional().describe("Description of this custom setting"),
368
+ fields: z.array(MetadataFieldSchema).optional().describe("Custom fields to add to this setting"),
369
+ }).strict();
370
+ export const CreateGlobalValueSetSchema = z.object({
371
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/)
372
+ .describe("API name of the global value set, e.g. 'Industry_Types'"),
373
+ masterLabel: z.string().min(1).describe("Label for the global value set"),
374
+ description: z.string().optional().describe("Description"),
375
+ sorted: z.boolean().default(false).describe("Auto-sort values alphabetically"),
376
+ values: z.array(PicklistValueSchema).min(1).describe("Picklist values"),
377
+ }).strict();
378
+ export const CreateRecordTypeSchema = z.object({
379
+ objectName: z.string().min(1).describe("Object API name, e.g. 'Opportunity' or 'Case__c'"),
380
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Record type developer name, e.g. 'Enterprise_Deal'"),
381
+ label: z.string().min(1).describe("Record type label"),
382
+ description: z.string().optional().describe("Description"),
383
+ businessProcess: z.string().optional().describe("Business process API name to associate (for Opportunity/Lead/Case/Solution)"),
384
+ isActive: z.boolean().default(true).describe("Whether this record type is active"),
385
+ picklistValues: z.array(z.object({
386
+ picklist: z.string().describe("Picklist field API name, e.g. 'StageName'"),
387
+ values: z.array(z.string()).describe("Allowed values for this record type"),
388
+ })).optional().describe("Restrict picklist values per record type"),
389
+ }).strict();
390
+ export const CreateBusinessProcessSchema = z.object({
391
+ objectName: z.enum(["Opportunity", "Lead", "Case", "Solution"])
392
+ .describe("Object the business process applies to"),
393
+ processName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Business process developer name"),
394
+ label: z.string().min(1).describe("Display label"),
395
+ description: z.string().optional().describe("Description"),
396
+ isActive: z.boolean().default(true).describe("Whether this process is active"),
397
+ values: z.array(z.string()).min(1).describe("Stage/status values included in this business process"),
398
+ }).strict();
399
+ export const CreatePageLayoutSchema = z.object({
400
+ objectName: z.string().min(1).describe("Object API name, e.g. 'Account' or 'Case__c'"),
401
+ layoutName: z.string().min(1).describe("Layout developer name, e.g. 'Account_Layout'"),
402
+ label: z.string().min(1).describe("Layout display label"),
403
+ sections: z.array(z.object({
404
+ label: z.string().describe("Section label"),
405
+ style: z.enum(["TwoColumnsTopToBottom", "TwoColumnsLeftToRight", "OneColumn"]).default("TwoColumnsTopToBottom"),
406
+ fields: z.array(z.string()).describe("Field API names in this section"),
407
+ })).optional().describe("Layout sections with fields"),
408
+ relatedLists: z.array(z.string()).optional().describe("Related list API names to include"),
409
+ }).strict();
410
+ export const CreateSharingRuleSchema = z.object({
411
+ objectName: z.string().min(1).describe("Object API name, e.g. 'Account', 'Opportunity'"),
412
+ ruleName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Sharing rule developer name"),
413
+ label: z.string().min(1).describe("Display label"),
414
+ ruleType: z.enum(["criteria", "ownership"]).default("criteria")
415
+ .describe("criteria: share based on field values. ownership: share based on record owner."),
416
+ accessLevel: z.enum(["Read", "Edit"]).default("Read").describe("Access level granted"),
417
+ sharedTo: z.object({
418
+ type: z.enum(["role", "roleAndSubordinates", "group", "queue", "allInternalUsers", "allCustomerPortalUsers"])
419
+ .describe("Who to share with"),
420
+ name: z.string().optional().describe("Role/group/queue API name"),
421
+ }).describe("Who receives the sharing"),
422
+ criteriaItems: z.array(z.object({
423
+ field: z.string().describe("Field API name, e.g. 'Industry'"),
424
+ operation: z.string().describe("equals, notEqual, greaterThan, etc."),
425
+ value: z.string().describe("Value to compare against"),
426
+ })).optional().describe("For criteria-based rules: conditions that trigger sharing"),
427
+ sharedFrom: z.object({
428
+ type: z.enum(["role", "roleAndSubordinates", "group", "queue", "allInternalUsers"])
429
+ .describe("For ownership rules: whose records to share"),
430
+ name: z.string().optional().describe("Role/group/queue API name"),
431
+ }).optional().describe("For ownership-based rules: whose records are shared"),
432
+ }).strict();
433
+ export const CreateFieldDependencySchema = z.object({
434
+ objectName: z.string().min(1).describe("Object API name"),
435
+ controllingField: z.string().min(1).describe("Controlling picklist field API name"),
436
+ dependentField: z.string().min(1).describe("Dependent picklist field API name"),
437
+ valueSettings: z.array(z.object({
438
+ controllingFieldValue: z.array(z.string()).describe("Controlling field values that enable this dependent value"),
439
+ valueName: z.string().describe("Dependent field value to conditionally show"),
440
+ })).min(1).describe("Value dependency mappings"),
441
+ }).strict();
442
+ // ─── AUTOMATION ───────────────────────────────────────────────────────────────
443
+ export const CreateEmailAlertSchema = z.object({
444
+ objectName: z.string().min(1).describe("Object API name, e.g. 'Opportunity', 'Case'"),
445
+ alertName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("API name of the email alert, e.g. 'Notify_Owner_On_Close'"),
446
+ label: z.string().min(1).describe("Display label"),
447
+ description: z.string().optional().describe("Description"),
448
+ template: z.string().min(1).describe("Email template full name, e.g. 'unfiled$public/MyTemplate' or 'MyFolder/MyTemplate'"),
449
+ senderType: z.enum(["CurrentUser", "OrgWideEmailAddress", "DefaultWorkflowUser"]).default("CurrentUser")
450
+ .describe("Who the email appears to come from"),
451
+ senderAddress: z.string().optional().describe("Org-wide email address (required if senderType is OrgWideEmailAddress)"),
452
+ recipients: z.array(z.object({
453
+ type: z.enum(["owner", "creator", "user", "role", "roleSubordinates", "accountTeam", "salesTeam", "caseTeam", "email"]),
454
+ recipient: z.string().optional().describe("Username, role/group API name, or email address"),
455
+ })).min(1).describe("Who receives the email"),
456
+ protected: z.boolean().default(false).describe("Protected email alert"),
457
+ }).strict();
458
+ export const CreatePlatformEventSchema = z.object({
459
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*__e$/, "Must end with __e")
460
+ .describe("Platform event API name, e.g. 'Order_Created__e'"),
461
+ label: z.string().min(1).describe("Singular label"),
462
+ pluralLabel: z.string().min(1).describe("Plural label"),
463
+ description: z.string().optional().describe("Description of the event"),
464
+ publishBehavior: z.enum(["PublishAfterCommit", "PublishImmediately"]).default("PublishAfterCommit")
465
+ .describe("PublishAfterCommit: published when DML transaction commits. PublishImmediately: published regardless of transaction."),
466
+ fields: z.array(MetadataFieldSchema).optional().describe("Custom fields on the platform event"),
467
+ }).strict();
468
+ export const RuleEntrySchema = z.object({
469
+ entryOrder: z.number().int().min(1).describe("Processing order (1 = first)"),
470
+ assignedTo: z.string().describe("User username, queue API name, or role API name"),
471
+ assignedToType: z.enum(["User", "Queue", "Role"]).default("Queue").describe("Type of assignee"),
472
+ criteriaItems: z.array(z.object({
473
+ field: z.string().describe("Field path, e.g. 'Lead.Status'"),
474
+ operation: z.string().describe("equals, notEqual, contains, etc."),
475
+ value: z.string().describe("Comparison value"),
476
+ })).optional().describe("Criteria that trigger this rule entry"),
477
+ formula: z.string().optional().describe("Formula alternative to criteriaItems"),
478
+ template: z.string().optional().describe("Email template for notifications"),
479
+ booleanFilter: z.string().optional().describe("Boolean filter string, e.g. '1 AND 2'"),
480
+ });
481
+ export const CreateAssignmentRuleSchema = z.object({
482
+ objectName: z.enum(["Lead", "Case"]).describe("Object to apply assignment rules to"),
483
+ ruleName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Assignment rule developer name"),
484
+ label: z.string().min(1).describe("Display label"),
485
+ active: z.boolean().default(true).describe("Set as the active assignment rule"),
486
+ ruleEntries: z.array(RuleEntrySchema).min(1).describe("Ordered list of assignment rule entries"),
487
+ }).strict();
488
+ export const EscalationActionSchema = z.object({
489
+ minutesToEscalation: z.number().int().min(0).describe("Minutes until escalation (from case creation or last modification)"),
490
+ assignedTo: z.string().optional().describe("User or queue to assign/escalate to"),
491
+ assignedToType: z.enum(["User", "Queue"]).optional().describe("User or Queue"),
492
+ notifyTo: z.string().optional().describe("Email address to notify on escalation"),
493
+ template: z.string().optional().describe("Notification email template"),
494
+ });
495
+ export const CreateEscalationRuleSchema = z.object({
496
+ ruleName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Escalation rule developer name"),
497
+ label: z.string().min(1).describe("Display label"),
498
+ active: z.boolean().default(true).describe("Set as the active escalation rule"),
499
+ ruleEntries: z.array(z.object({
500
+ entryOrder: z.number().int().min(1).describe("Processing order"),
501
+ criteriaItems: z.array(z.object({
502
+ field: z.string().describe("Field path, e.g. 'Case.Status'"),
503
+ operation: z.string().describe("equals, notEqual, etc."),
504
+ value: z.string().describe("Comparison value"),
505
+ })).optional().describe("Criteria for this escalation entry"),
506
+ formula: z.string().optional().describe("Formula alternative to criteriaItems"),
507
+ businessHours: z.string().default("Default").describe("Business hours name to use"),
508
+ escalationStartDate: z.enum(["CaseCreation", "CaseLastModifiedByCustomer", "CaseLastModified"]).default("CaseCreation"),
509
+ escalationActions: z.array(EscalationActionSchema).min(1).describe("What to do when escalating"),
510
+ })).min(1).describe("Rule entries"),
511
+ }).strict();
512
+ export const CreateAutoResponseRuleSchema = z.object({
513
+ objectName: z.enum(["Lead", "Case"]).describe("Object for auto-response rules"),
514
+ ruleName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Auto-response rule developer name"),
515
+ label: z.string().min(1).describe("Display label"),
516
+ active: z.boolean().default(true).describe("Set as the active auto-response rule"),
517
+ ruleEntries: z.array(z.object({
518
+ entryOrder: z.number().int().min(1).describe("Processing order"),
519
+ template: z.string().describe("Email template full name to auto-send"),
520
+ senderName: z.string().optional().describe("Sender display name"),
521
+ senderEmail: z.string().optional().describe("Sender email address"),
522
+ criteriaItems: z.array(z.object({
523
+ field: z.string().describe("Field path"),
524
+ operation: z.string().describe("equals, notEqual, etc."),
525
+ value: z.string().describe("Comparison value"),
526
+ })).optional().describe("Criteria to trigger this response"),
527
+ formula: z.string().optional().describe("Formula alternative to criteriaItems"),
528
+ })).min(1).describe("Rule entries"),
529
+ }).strict();
530
+ export const MatchingRuleItemSchema = z.object({
531
+ fieldName: z.string().describe("Field API name to match on, e.g. 'Email', 'Phone'"),
532
+ matchingMethod: z.enum(["Exact", "FirstName", "LastName", "Company", "Phone", "Email", "City", "Street", "Zip", "Title"])
533
+ .default("Exact").describe("Matching algorithm to use"),
534
+ blankValueBehavior: z.enum(["MatchBlanks", "NullNotAllowed"]).default("NullNotAllowed")
535
+ .describe("How to handle blank values"),
536
+ });
537
+ export const CreateMatchingRuleSchema = z.object({
538
+ objectName: z.string().min(1).describe("Object API name, e.g. 'Lead', 'Contact', 'Account'"),
539
+ ruleName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Matching rule developer name"),
540
+ label: z.string().min(1).describe("Display label"),
541
+ description: z.string().optional().describe("Description"),
542
+ matchingRuleItems: z.array(MatchingRuleItemSchema).min(1).describe("Fields and methods used for matching"),
543
+ }).strict();
544
+ export const CreateDuplicateRuleSchema = z.object({
545
+ objectName: z.string().min(1).describe("Object API name, e.g. 'Lead', 'Contact', 'Account'"),
546
+ ruleName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Duplicate rule developer name"),
547
+ label: z.string().min(1).describe("Display label"),
548
+ description: z.string().optional().describe("Description"),
549
+ isActive: z.boolean().default(true).describe("Whether this rule is active"),
550
+ actionOnInsert: z.enum(["Allow", "Block", "AllowWithAlert"]).default("AllowWithAlert")
551
+ .describe("What to do when a duplicate is found on insert"),
552
+ actionOnUpdate: z.enum(["Allow", "Block", "AllowWithAlert"]).default("Allow")
553
+ .describe("What to do when a duplicate is found on update"),
554
+ alertMessage: z.string().optional().describe("Custom message shown when duplicate is detected"),
555
+ matchingRules: z.array(z.object({
556
+ matchingRule: z.string().describe("Matching rule developer name (must exist first)"),
557
+ matchingRuleItems: z.array(z.object({
558
+ fieldName: z.string().describe("Source field to map"),
559
+ matchingField: z.string().describe("Target matching field"),
560
+ })).optional().describe("Field mappings if needed"),
561
+ })).min(1).describe("Matching rules to use for duplicate detection"),
562
+ }).strict();
563
+ export const CreateApexEmailServiceSchema = z.object({
564
+ functionName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Email service function name"),
565
+ apexClassName: z.string().min(1).describe("Apex class that implements Messaging.InboundEmailHandler"),
566
+ isActive: z.boolean().default(true).describe("Whether this email service is active"),
567
+ isAuthenticationRequired: z.boolean().default(false).describe("Require sender authentication"),
568
+ isErrorRoutingEnabled: z.boolean().default(false).describe("Route errors to an address"),
569
+ errorRoutingAddress: z.string().optional().describe("Error routing email address"),
570
+ functionInactiveAction: z.enum(["Bounce", "Discard", "Requeue"]).default("Bounce")
571
+ .describe("What to do when function is inactive"),
572
+ functionExceptionAction: z.enum(["Bounce", "Discard", "Requeue"]).default("Bounce")
573
+ .describe("What to do when an exception occurs"),
574
+ overLimitAction: z.enum(["Bounce", "Discard", "Requeue"]).default("Discard")
575
+ .describe("What to do when over API limits"),
576
+ authenticationFailureAction: z.enum(["Bounce", "Discard", "Requeue"]).default("Bounce")
577
+ .describe("What to do on authentication failure"),
578
+ attachmentOption: z.enum(["None", "TextOnly", "BinaryOnly", "All"]).default("All")
579
+ .describe("Which attachment types to process"),
580
+ }).strict();
581
+ export const CreateScheduledJobSchema = z.object({
582
+ className: z.string().min(1).describe("Apex class that implements Schedulable interface"),
583
+ jobName: z.string().min(1).describe("Name for the scheduled job"),
584
+ cronExpression: z.string().min(1).describe("Cron expression, e.g. '0 0 2 * * ?' for daily at 2 AM"),
585
+ }).strict();
586
+ // ─── SECURITY & ACCESS ────────────────────────────────────────────────────────
587
+ export const CreatePermissionSetSchema = z.object({
588
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Permission set API name, e.g. 'Sales_Manager_Perms'"),
589
+ label: z.string().min(1).describe("Display label"),
590
+ description: z.string().optional().describe("Description of this permission set"),
591
+ userLicense: z.string().optional().describe("User license to restrict to, e.g. 'Salesforce', 'SalesforceInspector'"),
592
+ objectPermissions: z.array(z.object({
593
+ object: z.string().describe("Object API name, e.g. 'Account', 'MyObject__c'"),
594
+ allowCreate: z.boolean().default(false),
595
+ allowRead: z.boolean().default(true),
596
+ allowEdit: z.boolean().default(false),
597
+ allowDelete: z.boolean().default(false),
598
+ viewAllRecords: z.boolean().default(false),
599
+ modifyAllRecords: z.boolean().default(false),
600
+ })).optional().describe("Object-level permissions to grant"),
601
+ fieldPermissions: z.array(z.object({
602
+ field: z.string().describe("Full field name: ObjectName.FieldName__c, e.g. 'Account.Phone'"),
603
+ editable: z.boolean().default(false),
604
+ readable: z.boolean().default(true),
605
+ })).optional().describe("Field-level permissions to grant"),
606
+ apexClassAccesses: z.array(z.object({
607
+ apexClass: z.string().describe("Apex class name"),
608
+ enabled: z.boolean().default(true),
609
+ })).optional().describe("Apex class access permissions"),
610
+ userPermissions: z.array(z.object({
611
+ name: z.string().describe("User permission name, e.g. 'ManageUsers', 'ViewSetup'"),
612
+ enabled: z.boolean().default(true),
613
+ })).optional().describe("User-level permissions"),
614
+ tabSettings: z.array(z.object({
615
+ tab: z.string().describe("Tab API name"),
616
+ visibility: z.enum(["Hidden", "DefaultOff", "DefaultOn"]).default("DefaultOn"),
617
+ })).optional().describe("Tab visibility settings"),
618
+ }).strict();
619
+ export const CreateRoleSchema = z.object({
620
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Role API name, e.g. 'VP_Sales'"),
621
+ name: z.string().min(1).describe("Role display name, e.g. 'VP of Sales'"),
622
+ description: z.string().optional().describe("Description of this role"),
623
+ parentRole: z.string().optional().describe("Parent role API name (omit for top-level role)"),
624
+ caseAccessLevel: z.enum(["None", "Read", "Edit", "ReadWrite"]).default("ReadWrite")
625
+ .describe("Case access level for subordinates"),
626
+ contactAccessLevel: z.enum(["None", "Read", "Edit", "ReadWrite"]).default("ReadWrite")
627
+ .describe("Contact access level for subordinates"),
628
+ opportunityAccessLevel: z.enum(["None", "Read", "Edit", "ReadWrite"]).default("ReadWrite")
629
+ .describe("Opportunity access level for subordinates"),
630
+ accountAccessLevel: z.enum(["None", "Read", "Edit", "ReadWrite"]).default("ReadWrite")
631
+ .describe("Account and contact access level for subordinates"),
632
+ mayForecastManagerShare: z.boolean().default(true).describe("Grant manager forecast sharing"),
633
+ }).strict();
634
+ export const CreateQueueSchema = z.object({
635
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Queue API name, e.g. 'Support_Level_1'"),
636
+ name: z.string().min(1).describe("Queue display name"),
637
+ email: z.string().optional().describe("Queue email address for notifications"),
638
+ doesSendEmailToMembers: z.boolean().default(false).describe("Send email to all queue members when record is added"),
639
+ supportedObjects: z.array(z.string()).min(1).describe("Object API names this queue supports, e.g. ['Case', 'Lead']"),
640
+ queueMembers: z.object({
641
+ users: z.array(z.string()).optional().describe("Usernames of queue members"),
642
+ groups: z.array(z.string()).optional().describe("Public group API names"),
643
+ roles: z.array(z.string()).optional().describe("Role API names"),
644
+ }).optional().describe("Queue members"),
645
+ }).strict();
646
+ export const CreateNamedCredentialSchema = z.object({
647
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Named credential API name, e.g. 'My_External_API'"),
648
+ label: z.string().min(1).describe("Display label"),
649
+ endpoint: z.string().url().describe("Endpoint URL, e.g. 'https://api.example.com'"),
650
+ principalType: z.enum(["NamedUser", "Anonymous", "PerUserPrincipal"]).default("NamedUser")
651
+ .describe("NamedUser: shared credentials. PerUserPrincipal: per-user OAuth. Anonymous: no auth."),
652
+ protocol: z.enum(["NoAuthentication", "Password", "OAuth", "AwsSv4", "Jwt", "JwtExchange"]).default("NoAuthentication")
653
+ .describe("Authentication protocol"),
654
+ username: z.string().optional().describe("Username for Password protocol"),
655
+ password: z.string().optional().describe("Password for Password protocol (encrypted at rest)"),
656
+ allowFormula: z.boolean().default(false).describe("Allow formulas in HTTP body (enables merge fields)"),
657
+ allowCallout: z.boolean().default(true).describe("Allow callouts using this credential"),
658
+ }).strict();
659
+ // ─── UI & EXPERIENCE ──────────────────────────────────────────────────────────
660
+ export const CreateLightningAppSchema = z.object({
661
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("App API name, e.g. 'Sales_Console'"),
662
+ label: z.string().min(1).describe("App display label"),
663
+ description: z.string().optional().describe("Description"),
664
+ navType: z.enum(["Standard", "Console"]).default("Standard").describe("Standard: tabs. Console: split view."),
665
+ uiType: z.enum(["Lightning"]).default("Lightning").describe("Must be Lightning for modern apps"),
666
+ setupExperience: z.enum(["all", "setup", "classicSetup"]).default("all"),
667
+ isNavAutoTempTabsDisabled: z.boolean().default(false),
668
+ isNavPersonalizationDisabled: z.boolean().default(false),
669
+ navItems: z.array(z.object({
670
+ name: z.string().describe("Navigation item API name, e.g. 'standard-home', 'Account', 'MyApp__c'"),
671
+ type: z.enum(["Standard", "CustomTab", "InAppLearning", "VisualizationPlugin"]).default("Standard"),
672
+ label: z.string().optional().describe("Override label"),
673
+ defaultItem: z.boolean().default(false).describe("Set as default landing page"),
674
+ })).optional().describe("Navigation bar items"),
675
+ utilityItems: z.array(z.object({
676
+ name: z.string().describe("Utility item API name"),
677
+ type: z.enum(["Standard", "CustomTab"]).default("Standard"),
678
+ label: z.string().optional(),
679
+ iconName: z.string().optional().describe("SLDS icon name, e.g. 'call'"),
680
+ })).optional().describe("Utility bar items"),
681
+ }).strict();
682
+ export const CreateTabSchema = z.object({
683
+ fullName: z.string().min(1).describe("Tab API name, typically same as the object API name, e.g. 'Invoice__c'"),
684
+ label: z.string().optional().describe("Tab label (defaults to object label)"),
685
+ motif: z.string().default("Custom64: Coin").describe("Icon/motif for the tab, e.g. 'Custom64: Coin', 'Custom1: default'"),
686
+ sobjectName: z.string().optional().describe("Object API name if this is a custom object tab"),
687
+ customObject: z.boolean().default(true).describe("Set to true for custom object tabs"),
688
+ url: z.string().optional().describe("URL for web tab type"),
689
+ page: z.string().optional().describe("Visualforce page name for VF tab"),
690
+ description: z.string().optional().describe("Tab description"),
691
+ }).strict();
692
+ export const CreateCompactLayoutSchema = z.object({
693
+ objectName: z.string().min(1).describe("Object API name to add the compact layout to"),
694
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Compact layout developer name"),
695
+ label: z.string().min(1).describe("Display label"),
696
+ fields: z.array(z.string()).min(1).max(10).describe("Field API names to show (max 10), e.g. ['Name', 'Status__c', 'Amount']"),
697
+ setAsDefault: z.boolean().default(true).describe("Set this compact layout as the default for the object"),
698
+ }).strict();
699
+ export const CreateListViewSchema = z.object({
700
+ objectName: z.string().min(1).describe("Object API name, e.g. 'Account', 'Lead', 'Opportunity'"),
701
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("List view developer name"),
702
+ label: z.string().min(1).describe("Display label"),
703
+ columns: z.array(z.string()).optional().describe("Column field API names, e.g. ['Name', 'Account.Name', 'Status__c']"),
704
+ filters: z.array(z.object({
705
+ field: z.string().describe("Field API name"),
706
+ operation: z.enum(["equals", "notEqual", "lessThan", "greaterThan", "lessOrEqual", "greaterOrEqual",
707
+ "contains", "notContain", "startsWith", "includes", "excludes", "within"]).describe("Filter operation"),
708
+ value: z.string().describe("Filter value"),
709
+ })).optional().describe("Filter criteria"),
710
+ booleanFilter: z.string().optional().describe("Boolean filter expression, e.g. '1 AND 2 OR 3'"),
711
+ filterScope: z.enum(["Everything", "Mine", "Team", "Queue", "Delegated", "MyTerritory",
712
+ "SalesTeam", "AssignedToMe"]).default("Everything").describe("Base scope filter"),
713
+ sharedTo: z.object({
714
+ type: z.enum(["AllUsers", "Group", "Role", "RoleAndSubordinates"]).default("AllUsers"),
715
+ name: z.string().optional(),
716
+ }).optional().describe("Who can see this list view"),
717
+ }).strict();
718
+ export const CreateEmailTemplateSchema = z.object({
719
+ fullName: z.string().min(1).describe("Full name including folder: 'FolderName/TemplateName' or 'unfiled$public/TemplateName'"),
720
+ name: z.string().min(1).describe("Template developer name (no spaces)"),
721
+ label: z.string().min(1).describe("Display label"),
722
+ description: z.string().optional().describe("Description"),
723
+ subject: z.string().min(1).describe("Email subject line (can include merge fields like {!Account.Name})"),
724
+ htmlValue: z.string().optional().describe("HTML body of the email (for html type templates)"),
725
+ body: z.string().min(1).describe("Plain text body of the email"),
726
+ type: z.enum(["text", "html", "custom", "visualforce"]).default("html").describe("Template type"),
727
+ relatedEntityType: z.string().optional().describe("Related object API name, e.g. 'Opportunity', 'Contact'"),
728
+ encoding: z.string().default("UTF-8").describe("Character encoding"),
729
+ available: z.boolean().default(true).describe("Make template available for use"),
730
+ replyTo: z.string().optional().describe("Reply-to email address"),
731
+ senderName: z.string().optional().describe("Sender display name"),
732
+ }).strict();
733
+ export const CreateStaticResourceSchema = z.object({
734
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Static resource API name, e.g. 'MyLibrary'"),
735
+ contentType: z.string().default("text/plain").describe("MIME type, e.g. 'application/json', 'text/css', 'application/javascript'"),
736
+ content: z.string().min(1).describe("The file content as a string (text, JSON, JS, CSS, etc.)"),
737
+ cacheControl: z.enum(["Public", "Private"]).default("Public").describe("Cache control setting"),
738
+ description: z.string().optional().describe("Description of this resource"),
739
+ }).strict();
740
+ export const CreateCustomNotificationTypeSchema = z.object({
741
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Custom notification type API name"),
742
+ customNotifTypeName: z.string().min(1).describe("Display name for the notification type"),
743
+ description: z.string().optional().describe("Description"),
744
+ desktop: z.boolean().default(true).describe("Enable for desktop (web browser)"),
745
+ mobile: z.boolean().default(true).describe("Enable for mobile app"),
746
+ }).strict();
747
+ // ─── REPORTING ────────────────────────────────────────────────────────────────
748
+ export const CreateReportTypeSchema = z.object({
749
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Report type developer name"),
750
+ label: z.string().min(1).describe("Display label"),
751
+ description: z.string().optional().describe("Description"),
752
+ baseObject: z.string().min(1).describe("Primary object API name, e.g. 'Account', 'Opportunity'"),
753
+ category: z.enum(["accounts", "opportunities", "forecasts", "cases", "leads", "activities",
754
+ "campaigns", "busop", "other"]).default("other").describe("Report category for organization"),
755
+ deployed: z.boolean().default(true).describe("Deploy this report type immediately"),
756
+ relationships: z.array(z.object({
757
+ joinTable: z.string().describe("Related object API name to join"),
758
+ relationshipType: z.enum(["Inner", "Outer"]).default("Outer")
759
+ .describe("Inner: only records with related. Outer: all primary records"),
760
+ field: z.string().optional().describe("Relationship field API name"),
761
+ label: z.string().optional().describe("Display label for this relationship"),
762
+ columns: z.array(z.string()).optional().describe("Fields from this related object to include"),
763
+ })).optional().describe("Related object joins"),
764
+ }).strict();
765
+ export const CreateDashboardSchema = z.object({
766
+ fullName: z.string().min(1).describe("Dashboard full name including folder: 'FolderName/DashboardName'"),
767
+ title: z.string().min(1).describe("Dashboard title"),
768
+ description: z.string().optional().describe("Description"),
769
+ runningUser: z.string().optional().describe("Username to run the dashboard as"),
770
+ components: z.array(z.object({
771
+ type: z.enum(["Metric", "Gauge", "Table", "Chart", "Map", "VisualforcePage", "Scontrol"])
772
+ .default("Chart").describe("Component type"),
773
+ reportApiName: z.string().optional().describe("Report API name to power this component"),
774
+ header: z.string().optional().describe("Component header text"),
775
+ footer: z.string().optional().describe("Component footer text"),
776
+ chartType: z.enum(["Bar", "BarGrouped", "BarStacked", "Line", "Pie", "Donut", "Funnel", "Scatter"]).optional()
777
+ .describe("Chart type for Chart components"),
778
+ columnSpan: z.number().int().min(1).max(3).default(1).describe("Column span (1-3)"),
779
+ rowSpan: z.number().int().min(1).max(3).default(1).describe("Row span (1-3)"),
780
+ })).optional().describe("Dashboard components"),
781
+ }).strict();
782
+ // ─── APEX DEVELOPMENT ────────────────────────────────────────────────────────
783
+ export const CreateApexClassSchema = z.object({
784
+ className: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Apex class name, e.g. 'AccountService'"),
785
+ classBody: z.string().min(1).describe("Full Apex class source code including the class declaration"),
786
+ apiVersion: z.string().default("62.0").describe("API version for this class, e.g. '62.0'"),
787
+ }).strict();
788
+ export const CreateApexTriggerSchema = z.object({
789
+ triggerName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Trigger name, e.g. 'AccountTrigger'"),
790
+ objectName: z.string().min(1).describe("Object API name the trigger fires on, e.g. 'Account'"),
791
+ events: z.array(z.enum(["before insert", "before update", "before delete",
792
+ "after insert", "after update", "after delete", "after undelete"]))
793
+ .min(1).describe("Trigger events, e.g. ['before insert', 'before update']"),
794
+ triggerBody: z.string().min(1).describe("Full trigger body code (the code between the trigger { })"),
795
+ apiVersion: z.string().default("62.0").describe("API version for this trigger"),
796
+ }).strict();
797
+ export const CreateApexTestClassSchema = z.object({
798
+ className: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Test class name, e.g. 'AccountServiceTest'"),
799
+ classBody: z.string().min(1).describe("Full test class source code including @isTest annotation and class declaration"),
800
+ apiVersion: z.string().default("62.0").describe("API version for this test class"),
801
+ runAfterDeploy: z.boolean().default(false).describe("Immediately run the tests after deploying"),
802
+ }).strict();
803
+ export const RunApexTestsSchema = z.object({
804
+ testClasses: z.array(z.string()).min(1).describe("List of test class names to run, e.g. ['AccountServiceTest', 'ContactTriggerTest']"),
805
+ waitMinutes: z.number().int().min(1).max(15).default(5).describe("Max minutes to wait for test results"),
806
+ }).strict();
807
+ export const ExecuteAnonymousApexSchema = z.object({
808
+ apexCode: z.string().min(1).describe("Anonymous Apex code to execute, e.g. 'System.debug(Date.today());'"),
809
+ }).strict();
810
+ // ─── LWC DEVELOPMENT ─────────────────────────────────────────────────────────
811
+ export const CreateLwcSchema = z.object({
812
+ componentName: z.string().min(1).regex(/^[a-z][a-zA-Z0-9]*$/, "Must start lowercase, no underscores or hyphens")
813
+ .describe("LWC component name in camelCase, e.g. 'accountCard', 'opportunityList'"),
814
+ html: z.string().min(1).describe("HTML template content (the content of the .html file, including <template> tags)"),
815
+ javascript: z.string().min(1).describe("JavaScript controller content (the content of the .js file, including import statements and class)"),
816
+ css: z.string().optional().describe("Optional CSS styles content"),
817
+ description: z.string().optional().describe("Description of the component"),
818
+ targets: z.array(z.enum([
819
+ "lightning__AppPage",
820
+ "lightning__RecordPage",
821
+ "lightning__HomePage",
822
+ "lightning__FlowScreen",
823
+ "lightning__UtilityBar",
824
+ "lightning__RecordAction",
825
+ "lightningCommunity__Page",
826
+ "lightningCommunity__Default",
827
+ ])).optional().describe("Where this component can be placed in Lightning"),
828
+ isExposed: z.boolean().default(true).describe("Make the component available in Lightning App Builder"),
829
+ apiVersion: z.string().default("62.0").describe("API version for this component"),
830
+ }).strict();
831
+ export const UpdateLwcSchema = z.object({
832
+ componentName: z.string().min(1).regex(/^[a-z][a-zA-Z0-9]*$/).describe("Existing LWC component name to update"),
833
+ html: z.string().optional().describe("Updated HTML template (leave undefined to keep existing)"),
834
+ javascript: z.string().optional().describe("Updated JavaScript controller (leave undefined to keep existing)"),
835
+ css: z.string().optional().describe("Updated CSS (leave undefined to keep existing)"),
836
+ apiVersion: z.string().default("62.0").describe("API version"),
837
+ }).strict();
838
+ // ─── EXPERIENCE CLOUD ────────────────────────────────────────────────────────
839
+ export const CreateExperienceSiteSchema = z.object({
840
+ siteName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Site API name, e.g. 'CustomerPortal'"),
841
+ label: z.string().min(1).describe("Site display label"),
842
+ template: z.enum(["CustomerService", "Partner", "LWR", "Aloha", "Microsites", "VFPage"])
843
+ .default("CustomerService").describe("Experience Cloud template to use"),
844
+ urlPathPrefix: z.string().min(1).describe("URL path prefix, e.g. 'customers' → https://org.force.com/customers"),
845
+ description: z.string().optional().describe("Site description"),
846
+ status: z.enum(["Live", "UnderConstruction", "DownForMaintenance"]).default("UnderConstruction")
847
+ .describe("Initial site status"),
848
+ guestUserProfile: z.string().optional().describe("Guest user profile API name (default: '<SiteName> Profile')"),
849
+ }).strict();
850
+ export const CreateExperiencePageSchema = z.object({
851
+ siteName: z.string().min(1).describe("Experience site API name"),
852
+ pageName: z.string().min(1).describe("Page developer name"),
853
+ label: z.string().min(1).describe("Page display label"),
854
+ type: z.enum(["standard", "home", "login", "profile", "objectDetail", "objectList", "custom"])
855
+ .default("custom").describe("Page type"),
856
+ url: z.string().optional().describe("Page URL path, e.g. '/my-page'"),
857
+ }).strict();
858
+ // ─── AGENTFORCE ───────────────────────────────────────────────────────────────
859
+ export const CreateAgentSchema = z.object({
860
+ agentName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Agent API name, e.g. 'SupportAgent'"),
861
+ label: z.string().min(1).describe("Agent display name"),
862
+ description: z.string().optional().describe("Agent description shown to users"),
863
+ type: z.enum(["Default", "EinsteinCopilot"]).default("EinsteinCopilot").describe("Agent type"),
864
+ company: z.string().optional().describe("Company name for the agent's context"),
865
+ persona: z.string().optional().describe("Agent persona description, e.g. 'A helpful customer service representative'"),
866
+ tone: z.enum(["Formal", "Neutral", "Casual"]).default("Neutral").describe("Communication tone"),
867
+ instructions: z.string().optional().describe("System-level instructions for the agent"),
868
+ }).strict();
869
+ export const CreateAgentTopicSchema = z.object({
870
+ agentName: z.string().min(1).describe("Parent agent API name"),
871
+ topicName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Topic API name, e.g. 'OrderManagement'"),
872
+ label: z.string().min(1).describe("Topic label"),
873
+ description: z.string().min(1).describe("What this topic covers"),
874
+ scope: z.string().min(1).describe("Scope of this topic — what kind of requests it handles"),
875
+ instructions: z.string().optional().describe("Step-by-step instructions for handling this topic"),
876
+ actions: z.array(z.string()).optional().describe("Action API names to associate with this topic"),
877
+ }).strict();
878
+ export const CreateAgentActionSchema = z.object({
879
+ agentName: z.string().min(1).describe("Parent agent API name"),
880
+ topicName: z.string().min(1).describe("Parent topic API name"),
881
+ actionName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Action API name"),
882
+ label: z.string().min(1).describe("Action label"),
883
+ description: z.string().min(1).describe("What this action does"),
884
+ type: z.enum(["Flow", "ApexClass", "PromptTemplate", "DataCategoryGroup", "ExternalService"])
885
+ .describe("Action type"),
886
+ reference: z.string().min(1).describe("API name of the Flow, Apex class, or Prompt Template to invoke"),
887
+ inputs: z.array(z.object({
888
+ name: z.string().describe("Input parameter name"),
889
+ value: z.string().describe("Value or reference, e.g. '{!Agent.Topic.Entities.accountName}'"),
890
+ })).optional().describe("Input parameter mappings"),
891
+ }).strict();
892
+ // ─── MCP SERVER MANAGEMENT ───────────────────────────────────────────────────
893
+ export const CreateMcpServerSchema = z.object({
894
+ serverName: z.string().min(1).describe("Name for the new MCP server, e.g. 'my-salesforce-server'"),
895
+ outputDirectory: z.string().min(1).describe("Absolute path to directory where files will be created, e.g. 'C:/projects/my-server'"),
896
+ description: z.string().optional().describe("Server description"),
897
+ salesforceInstanceUrl: z.string().optional().describe("Salesforce instance URL to pre-configure, e.g. 'https://myorg.salesforce.com'"),
898
+ }).strict();
899
+ export const CreateMcpToolSchema = z.object({
900
+ projectDirectory: z.string().min(1).describe("Absolute path to the MCP server project directory"),
901
+ toolName: z.string().min(1).describe("Tool API name, e.g. 'get_account_data'"),
902
+ toolDescription: z.string().min(1).describe("Detailed description of what the tool does"),
903
+ inputSchema: z.record(z.unknown()).describe("JSON Schema for the tool's input parameters"),
904
+ handlerCode: z.string().min(1).describe("TypeScript handler function body code"),
905
+ }).strict();
906
+ export const ListMcpToolsSchema = z.object({
907
+ projectDirectory: z.string().min(1).describe("Absolute path to the MCP server project directory"),
908
+ }).strict();
909
+ // ─── EXTERNAL APPS & INTEGRATIONS ────────────────────────────────────────────
910
+ export const CreateConnectedAppSchema = z.object({
911
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Connected app API name, e.g. 'My_External_App'"),
912
+ label: z.string().min(1).describe("Display label"),
913
+ description: z.string().optional().describe("Description"),
914
+ contactEmail: z.string().email().describe("Contact email for the app"),
915
+ callbackUrls: z.array(z.string()).min(1).describe("OAuth callback URLs, e.g. ['https://myapp.com/oauth/callback']"),
916
+ scopes: z.array(z.enum(["api", "web", "full", "chatter_api", "wave_api", "eclair_api",
917
+ "visualforce", "content", "openid", "profile", "email", "address", "phone",
918
+ "offline_access", "custom_permissions", "pardot_api"]))
919
+ .min(1).describe("OAuth scopes to request"),
920
+ consumerKey: z.string().optional().describe("Custom consumer key (auto-generated if not specified)"),
921
+ startUrl: z.string().optional().describe("Default start URL after OAuth"),
922
+ accessTokenValidity: z.number().int().optional().describe("Access token validity in minutes"),
923
+ refreshTokenValidity: z.number().int().optional().describe("Refresh token validity in minutes"),
924
+ }).strict();
925
+ export const CreateExternalDataSourceSchema = z.object({
926
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("External data source API name"),
927
+ label: z.string().min(1).describe("Display label"),
928
+ type: z.enum(["SimpleURL", "OData2", "OData4", "Apex", "Files", "MuleSoft"]).default("SimpleURL")
929
+ .describe("Connection type: SimpleURL for basic, OData2/OData4 for OData, Apex for custom"),
930
+ endpoint: z.string().url().describe("Endpoint URL"),
931
+ principalType: z.enum(["NamedUser", "Anonymous", "PerUserPrincipal"]).default("Anonymous")
932
+ .describe("Authentication principal type"),
933
+ protocol: z.enum(["NoAuthentication", "Password", "OAuth"]).default("NoAuthentication")
934
+ .describe("Authentication protocol"),
935
+ username: z.string().optional().describe("Username for Password protocol"),
936
+ password: z.string().optional().describe("Password for Password protocol"),
937
+ description: z.string().optional().describe("Description"),
938
+ }).strict();
939
+ export const CreateExternalObjectSchema = z.object({
940
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*__x$/, "Must end with __x")
941
+ .describe("External object API name, e.g. 'Product__x'"),
942
+ label: z.string().min(1).describe("Singular label"),
943
+ pluralLabel: z.string().min(1).describe("Plural label"),
944
+ externalDataSource: z.string().min(1).describe("External data source API name to link to"),
945
+ externalName: z.string().optional().describe("Name in the external system (table/entity name)"),
946
+ description: z.string().optional().describe("Description"),
947
+ fields: z.array(MetadataFieldSchema).optional().describe("Custom fields to add"),
948
+ }).strict();
949
+ export const CreateRemoteSiteSettingSchema = z.object({
950
+ fullName: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_]*$/).describe("Remote site setting API name"),
951
+ name: z.string().min(1).describe("Display name"),
952
+ url: z.string().url().describe("URL to whitelist for callouts, e.g. 'https://api.example.com'"),
953
+ description: z.string().optional().describe("Description of why this site is trusted"),
954
+ isActive: z.boolean().default(true).describe("Whether this remote site setting is active"),
955
+ disableProtocolSecurity: z.boolean().default(false).describe("Disable protocol security (not recommended)"),
956
+ }).strict();
957
+ export const CreateCspSettingSchema = z.object({
958
+ endpointUrl: z.string().url().describe("Trusted URL for CSP, e.g. 'https://cdn.example.com'"),
959
+ cspDirectives: z.array(z.enum(["connect-src", "font-src", "frame-src", "img-src",
960
+ "media-src", "object-src", "script-src", "style-src"])).min(1)
961
+ .describe("CSP directives this URL is trusted for"),
962
+ description: z.string().optional().describe("Description of why this URL is trusted"),
963
+ isActive: z.boolean().default(true).describe("Whether this setting is active"),
964
+ }).strict();
965
+ // ─── CHANGE SETS & DEPLOYMENT ────────────────────────────────────────────────
966
+ export const ComponentRefSchema = z.object({
967
+ type: z.string().describe("Metadata type, e.g. 'CustomObject', 'ApexClass', 'Flow', 'CustomField'"),
968
+ name: z.string().describe("Component API name, e.g. 'Account', 'MyClass', 'My_Flow'"),
969
+ });
970
+ export const CreateOutboundChangeSetSchema = z.object({
971
+ changeSetName: z.string().min(1).describe("Name for the outbound change set"),
972
+ description: z.string().optional().describe("Description of what this change set contains"),
973
+ components: z.array(ComponentRefSchema).optional().describe("Metadata components to add to the change set"),
974
+ }).strict();
975
+ export const AddToChangeSetSchema = z.object({
976
+ changeSetName: z.string().min(1).describe("Name of the existing outbound change set"),
977
+ components: z.array(ComponentRefSchema).min(1).describe("Components to add"),
978
+ }).strict();
979
+ export const DeployMetadataSchema = z.object({
980
+ components: z.array(ComponentRefSchema).min(1).describe("Metadata components to deploy"),
981
+ checkOnly: z.boolean().default(false).describe("Validate only, do not actually deploy"),
982
+ runTests: z.array(z.string()).optional().describe("Test classes to run during deployment"),
983
+ rollbackOnError: z.boolean().default(true).describe("Roll back all changes if any component fails"),
984
+ waitMinutes: z.number().int().min(1).max(60).default(10).describe("Max minutes to wait for deploy to complete"),
985
+ }).strict();
986
+ export const CheckDeployStatusSchema = z.object({
987
+ deployId: z.string().min(1).describe("Deploy async job ID returned from sf_deploy_metadata"),
988
+ }).strict();
989
+ export const RetrieveMetadataSchema = z.object({
990
+ components: z.array(ComponentRefSchema).min(1).describe("Metadata components to retrieve"),
991
+ }).strict();
992
+ //# sourceMappingURL=index.js.map