@salesforce/afv-skills 1.41.0 → 1.43.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 (288) hide show
  1. package/package.json +2 -6
  2. package/skills/automation-sandbox-post-copy-config-generate/SKILL.md +3 -0
  3. package/skills/automation-sandbox-post-copy-configure/SKILL.md +4 -0
  4. package/skills/design-systems-slds-validate/SKILL.md +2 -2
  5. package/skills/dx-app-analytics-query/SKILL.md +1 -3
  6. package/skills/dx-devops-conflict-resolve/SKILL.md +205 -0
  7. package/skills/dx-devops-conflict-resolve/examples/conflict-workflows.md +165 -0
  8. package/skills/dx-devops-conflict-resolve/references/deploy-failure-resolution.md +75 -0
  9. package/skills/dx-devops-conflict-resolve/references/git-conflict-resolution.md +124 -0
  10. package/skills/dx-devops-conflict-resolve/scripts/detect-conflicts.sh +91 -0
  11. package/skills/dx-devops-conflict-resolve/scripts/diagnose-deploy-failure.sh +156 -0
  12. package/skills/dx-devops-request-status/SKILL.md +160 -0
  13. package/skills/dx-devops-request-status/examples/polling-workflows.md +101 -0
  14. package/skills/dx-devops-request-status/references/cli-commands.md +176 -0
  15. package/skills/dx-devops-request-status/scripts/poll-status.sh +134 -0
  16. package/skills/dx-devops-test-failures-analyze/SKILL.md +6 -6
  17. package/skills/dx-devops-test-pipeline-configure/SKILL.md +7 -7
  18. package/skills/dx-devops-test-suite-assignments-configure/SKILL.md +6 -6
  19. package/skills/dx-devops-test-suite-run/SKILL.md +6 -6
  20. package/skills/dx-devops-work-item-manage/SKILL.md +2 -0
  21. package/skills/dx-org-manage/references/creating-scratch-org.md +5 -2
  22. package/skills/dx-org-manage/references/creating-snapshot.md +1 -0
  23. package/skills/dx-org-shape-manage/SKILL.md +152 -0
  24. package/skills/dx-org-shape-manage/examples/create_error_output.json +9 -0
  25. package/skills/dx-org-shape-manage/examples/create_success_output.json +9 -0
  26. package/skills/dx-org-shape-manage/examples/delete_output.json +11 -0
  27. package/skills/dx-org-shape-manage/examples/list_inactive_output.json +32 -0
  28. package/skills/dx-org-shape-manage/examples/list_output.json +24 -0
  29. package/skills/dx-org-shape-manage/references/cli_flags.md +135 -0
  30. package/skills/dx-org-switch/SKILL.md +2 -2
  31. package/skills/dx-org-trial-expiration-check/SKILL.md +2 -0
  32. package/skills/dx-pkg-post-install-configure/SKILL.md +3 -0
  33. package/skills/education-cloud-multi-campus-configure/SKILL.md +211 -0
  34. package/skills/education-cloud-multi-campus-configure/examples/hierarchy_visualization.md +174 -0
  35. package/skills/education-cloud-multi-campus-configure/examples/output_examples.md +54 -0
  36. package/skills/education-cloud-multi-campus-configure/examples/sample_hierarchy_input.csv +29 -0
  37. package/skills/education-cloud-multi-campus-configure/examples/sample_hierarchy_input_edgecases.csv +16 -0
  38. package/skills/education-cloud-multi-campus-configure/references/account_recordtype_prerequisite.md +44 -0
  39. package/skills/education-cloud-multi-campus-configure/references/delta_computation.md +33 -0
  40. package/skills/education-cloud-multi-campus-configure/references/error_handling.md +198 -0
  41. package/skills/education-cloud-multi-campus-configure/references/foundation_prerequisites.md +54 -0
  42. package/skills/education-cloud-multi-campus-configure/references/gotchas.md +16 -0
  43. package/skills/education-cloud-multi-campus-configure/references/hierarchy_parsing_rules.md +133 -0
  44. package/skills/education-cloud-multi-campus-configure/references/mcp-invocation.md +75 -0
  45. package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/SKILL.md +1 -1
  46. package/skills/experience-cms-brand-apply/SKILL.md +4 -1
  47. package/skills/experience-cms-brand-create/SKILL.md +197 -0
  48. package/skills/experience-cms-brand-create/assets/brand-template.json +329 -0
  49. package/skills/experience-cms-brand-create/references/brand-anatomy.md +120 -0
  50. package/skills/experience-cms-brand-create/references/disk-contract.md +84 -0
  51. package/skills/experience-cms-content-generate/SKILL.md +190 -0
  52. package/skills/experience-cms-content-generate/assets/display-formats.md +84 -0
  53. package/skills/experience-cms-content-generate/assets/payloads/create-content-bulk.json +11 -0
  54. package/skills/experience-cms-content-generate/assets/payloads/create-content-single.json +11 -0
  55. package/skills/experience-cms-content-generate/assets/payloads/publish-content.json +4 -0
  56. package/skills/experience-cms-content-generate/assets/payloads/update-content.json +9 -0
  57. package/skills/experience-cms-content-generate/assets/questions.md +241 -0
  58. package/skills/experience-cms-content-generate/examples/create-content-call.md +81 -0
  59. package/skills/experience-cms-content-generate/references/bulk-batching.md +56 -0
  60. package/skills/experience-cms-content-generate/references/content-type-classification.md +88 -0
  61. package/skills/experience-cms-content-generate/references/content-write-tool.md +95 -0
  62. package/skills/experience-cms-content-generate/references/delegation-protocol.md +37 -0
  63. package/skills/experience-cms-content-generate/references/edit-publish-workflow.md +63 -0
  64. package/skills/experience-cms-content-generate/references/error-recovery.md +72 -0
  65. package/skills/experience-cms-content-generate/references/identifier-resolution.md +26 -0
  66. package/skills/experience-cms-content-generate/references/intent-routing.md +45 -0
  67. package/skills/experience-cms-content-generate/references/principles.md +19 -0
  68. package/skills/experience-cms-content-generate/references/ux-rules.md +68 -0
  69. package/skills/experience-cms-content-generate/references/workspace-resolution.md +33 -0
  70. package/skills/experience-cms-content-type-generate/SKILL.md +449 -0
  71. package/skills/experience-cms-content-type-generate/assets/discovery-prompts.md +79 -0
  72. package/skills/experience-cms-content-type-generate/assets/schema-example.json +70 -0
  73. package/skills/experience-cms-content-type-generate/references/agent-checklist.md +50 -0
  74. package/skills/experience-cms-content-type-generate/references/anti-patterns.md +39 -0
  75. package/skills/experience-cms-content-type-generate/references/deployment-errors.md +27 -0
  76. package/skills/experience-cms-content-type-generate/references/discovery-details.md +106 -0
  77. package/skills/experience-cms-content-type-generate/references/discovery-query-rules.md +85 -0
  78. package/skills/experience-cms-content-type-generate/references/edit-fields-loop.md +48 -0
  79. package/skills/experience-cms-content-type-generate/references/pre-deploy-checklist.md +21 -0
  80. package/skills/experience-cms-content-type-generate/references/retrieve-and-reconcile.md +105 -0
  81. package/skills/experience-cms-content-type-generate/references/schema-rules.md +51 -0
  82. package/skills/experience-cms-content-type-generate/references/schema-summary-format.md +60 -0
  83. package/skills/experience-lds-graphql-generate/SKILL.md +4 -0
  84. package/skills/experience-lwc-accessibility-jest-run/SKILL.md +79 -0
  85. package/skills/experience-lwc-accessibility-jest-run/references/running-sa11y-jest-tests.md +205 -0
  86. package/skills/experience-lwc-design-generate/SKILL.md +5 -4
  87. package/skills/experience-lwc-generate/SKILL.md +10 -9
  88. package/skills/experience-ui-bundle-deploy/references/dev-preview.md +21 -0
  89. package/skills/experience-ui-bundle-deploy/references/social-login.md +1 -0
  90. package/skills/experience-ui-bundle-file-upload-generate/SKILL.md +6 -6
  91. package/skills/experience-ui-bundle-localize/SKILL.md +30 -37
  92. package/skills/experience-ui-bundle-localize/references/gotchas.md +23 -7
  93. package/skills/experience-ui-bundle-localize/references/i18n-setup.md +48 -4
  94. package/skills/experience-ui-bundle-localize/references/label-xml.md +22 -8
  95. package/skills/experience-ui-bundle-localize/references/verifying.md +39 -11
  96. package/skills/experience-ui-bundle-localize/scripts/detect-bundle-type.sh +118 -15
  97. package/skills/experience-ui-bundle-localize/scripts/tests/test-detect-bundle-type.sh +187 -0
  98. package/skills/experience-ui-bundle-mfa-configure/SKILL.md +13 -2
  99. package/skills/experience-ui-bundle-mfa-configure/references/social-login.md +1 -0
  100. package/skills/experience-ui-bundle-project-generate/SKILL.md +2 -2
  101. package/skills/integration-connectivity-generate/SKILL.md +11 -10
  102. package/skills/integration-eventing-cdc-configure/SKILL.md +6 -6
  103. package/skills/integration-eventing-subscription-configure/SKILL.md +6 -5
  104. package/skills/mobile-platform-native-capabilities-integrate/SKILL.md +2 -2
  105. package/skills/mobile-platform-offline-validate/scripts/package.json +1 -1
  106. package/skills/platform-agentexchange-partner-offers-configure/SKILL.md +8 -8
  107. package/skills/platform-custom-application-generate/SKILL.md +2 -0
  108. package/skills/platform-custom-field-generate/SKILL.md +8 -6
  109. package/skills/platform-custom-metadata-type-generate/SKILL.md +460 -0
  110. package/skills/platform-custom-metadata-type-generate/references/cmdt-records.md +251 -0
  111. package/skills/platform-custom-metadata-type-generate/scripts/sanitize-developer-name.sh +46 -0
  112. package/skills/platform-custom-setting-generate/SKILL.md +419 -0
  113. package/skills/platform-dataspace-access-configure/SKILL.md +3 -3
  114. package/skills/platform-sharing-owd-configure/SKILL.md +3 -0
  115. package/skills/platform-value-set-generate/SKILL.md +2 -0
  116. package/skills/service-agentforce-channel-configure/SKILL.md +29 -20
  117. package/skills/service-agentforce-channel-configure/assets/BotEmailDefinition.botEmailDefinition-meta.xml +36 -0
  118. package/skills/service-agentforce-channel-configure/assets/email/unfiled$public/AgentforceForServiceEmailTemplate.email +17 -0
  119. package/skills/service-agentforce-channel-configure/assets/email/unfiled$public/AgentforceForServiceEmailTemplate.email-meta.xml +29 -0
  120. package/skills/service-agentforce-channel-configure/assets/mdapi-package.xml +25 -0
  121. package/skills/service-agentforce-channel-configure/assets/settings-mdapi-package.xml +30 -0
  122. package/skills/service-agentforce-channel-configure/references/agent-wiring.md +20 -0
  123. package/skills/service-agentforce-channel-configure/references/botemaildefinition.md +107 -0
  124. package/skills/service-agentforce-channel-configure/references/channel-branch-email.md +203 -50
  125. package/skills/service-agentforce-channel-configure/references/channel-types.md +30 -3
  126. package/skills/service-agentforce-channel-configure/references/queue-resolution.md +17 -8
  127. package/skills/service-agentforce-channel-configure/references/routing-flow.md +14 -3
  128. package/skills/service-agentforce-channel-configure/scripts/validate-botemaildefinition.py +126 -0
  129. package/skills/service-agentforce-channel-configure/scripts/validate-emailtemplate.py +133 -0
  130. package/skills/service-de-channel-activate/SKILL.md +271 -0
  131. package/skills/service-de-channel-activate/references/gotchas.md +31 -0
  132. package/skills/service-de-channel-activate/references/phone-verification.md +96 -0
  133. package/skills/service-de-channel-activate/references/worked-examples.md +14 -0
  134. package/skills/service-de-channel-consent-configure/SKILL.md +230 -0
  135. package/skills/service-de-channel-consent-configure/references/gotchas.md +41 -0
  136. package/skills/service-de-channel-consent-configure/references/language-keywords.md +84 -0
  137. package/skills/service-de-channel-consent-configure/references/worked-examples.md +134 -0
  138. package/skills/service-de-channel-create/SKILL.md +369 -0
  139. package/skills/service-de-channel-create/references/apple.md +59 -0
  140. package/skills/service-de-channel-create/references/connect-insert.md +84 -0
  141. package/skills/service-de-channel-create/references/facebook.md +154 -0
  142. package/skills/service-de-channel-create/references/line.md +66 -0
  143. package/skills/service-de-channel-create/references/sms.md +98 -0
  144. package/skills/service-de-channel-create/references/whatsapp.md +98 -0
  145. package/skills/service-de-channel-create/references/worked-examples.md +70 -0
  146. package/skills/service-de-channel-routing-configure/SKILL.md +345 -0
  147. package/skills/service-de-channel-routing-configure/references/asa-routing.md +90 -0
  148. package/skills/service-de-channel-routing-configure/references/gotchas.md +27 -0
  149. package/skills/service-de-channel-routing-configure/references/queue-creation.md +123 -0
  150. package/skills/service-de-channel-routing-configure/references/target-locate.md +98 -0
  151. package/skills/service-de-channel-routing-configure/references/worked-examples.md +174 -0
  152. package/skills/service-de-headless-channel-configure/SKILL.md +305 -0
  153. package/skills/service-de-headless-channel-configure/references/gotchas.md +27 -0
  154. package/skills/service-de-headless-channel-configure/references/inputs.md +49 -0
  155. package/skills/service-de-headless-channel-configure/references/output-envelopes.md +53 -0
  156. package/skills/service-de-headless-channel-configure/references/partial-success.md +24 -0
  157. package/skills/service-de-headless-channel-configure/references/terms-and-conditions.md +54 -0
  158. package/skills/service-de-headless-channel-configure/references/worked-examples.md +108 -0
  159. package/skills/service-de-waba-integrate/SKILL.md +227 -0
  160. package/skills/service-digital-engagement-channel-configure/scripts/check-api-version.sh +29 -0
  161. package/skills/service-digital-engagement-messaging-site-integrate/SKILL.md +10 -9
  162. package/skills/service-digital-engagement-messaging-site-integrate/references/lwr_patch.md +39 -21
  163. package/skills/service-digital-engagement-messaging-site-integrate/scripts/patch_lwr_bundle.sh +157 -96
  164. package/skills/service-email-to-case-configure/SKILL.md +190 -0
  165. package/skills/service-email-to-case-configure/assets/CaseSettings.settings-meta.xml +45 -0
  166. package/skills/service-email-to-case-configure/examples/CaseSettings-two-addresses.settings-meta.xml +36 -0
  167. package/skills/service-email-to-case-configure/references/apply-mechanics.md +73 -0
  168. package/skills/service-email-to-case-configure/references/routing_address_reference.md +73 -0
  169. package/skills/service-email-to-case-configure/references/troubleshooting.md +25 -0
  170. package/skills/service-email-to-case-configure/scripts/apply-casesettings.py +1315 -0
  171. package/skills/service-email-to-case-configure/scripts/check-agent-email-capability.sh +26 -0
  172. package/skills/service-email-to-case-configure/scripts/tests/__init__.py +0 -0
  173. package/skills/service-email-to-case-configure/scripts/tests/_bootstrap.py +45 -0
  174. package/skills/service-email-to-case-configure/scripts/tests/_fakeorg.py +366 -0
  175. package/skills/service-email-to-case-configure/scripts/tests/_run.py +84 -0
  176. package/skills/service-email-to-case-configure/scripts/tests/test_apply_org_scenarios.py +655 -0
  177. package/skills/service-email-to-case-configure/scripts/tests/test_get_session.py +134 -0
  178. package/skills/service-email-to-case-configure/scripts/tests/test_new_capabilities.py +193 -0
  179. package/skills/service-email-to-case-configure/scripts/tests/test_validate_casesettings.py +170 -0
  180. package/skills/service-email-to-case-configure/scripts/validate-casesettings.py +229 -0
  181. package/skills/service-itsm-agentic-setup-agentforce-coordinate/SKILL.md +33 -15
  182. package/skills/service-itsm-agentic-setup-agentforce-coordinate/examples/output-templates.md +63 -47
  183. package/skills/service-itsm-agentic-setup-agentforce-studio-configure/SKILL.md +17 -12
  184. package/skills/service-itsm-agentic-setup-agentforce-studio-configure/references/cli-invocation.md +5 -3
  185. package/skills/service-itsm-agentic-setup-agentforce-studio-configure/scripts/classify-enable-plan.mjs +11 -3
  186. package/skills/service-itsm-agentic-setup-agentforce-studio-validate/SKILL.md +8 -6
  187. package/skills/service-itsm-agentic-setup-agentforce-studio-validate/references/cli-invocation.md +3 -3
  188. package/skills/service-itsm-agentic-setup-agentforce-studio-validate/scripts/classify-readiness.mjs +11 -3
  189. package/skills/service-itsm-agentic-setup-configure/SKILL.md +5 -5
  190. package/skills/service-itsm-agentic-setup-configure/examples/output-templates.md +5 -5
  191. package/skills/service-itsm-agentic-setup-employee-agent-configure/SKILL.md +2 -2
  192. package/skills/service-itsm-agentic-setup-employee-agent-configure/references/report-format.md +11 -7
  193. package/skills/service-itsm-agentic-setup-employee-agent-configure/scripts/render-report.mjs +20 -7
  194. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/SKILL.md +10 -6
  195. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/action-availability.md +7 -7
  196. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/references/report-format.md +11 -7
  197. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/build-create-body.mjs +24 -17
  198. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/classify-action-availability.mjs +98 -58
  199. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/render-report.mjs +20 -7
  200. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/scripts/strip-release-management.mjs +176 -0
  201. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/SKILL.md +19 -19
  202. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/references/cli-invocation.md +3 -4
  203. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/references/helper-contracts.md +6 -6
  204. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/references/permset-topology.md +3 -10
  205. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/scripts/classify-permset-availability.mjs +7 -9
  206. package/skills/service-itsm-incident-mgmt-configure/SKILL.md +2 -0
  207. package/skills/service-itsm-incident-priority-configure/SKILL.md +15 -12
  208. package/skills/service-itsm-incident-priority-configure/examples/matrix-operations.md +27 -1
  209. package/skills/service-itsm-incident-priority-configure/references/sf-cli-invocation.md +37 -6
  210. package/skills/service-native-voice-recording-transcription-configure/SKILL.md +146 -0
  211. package/skills/service-native-voice-recording-transcription-configure/assets/confirmation-output.json +16 -0
  212. package/skills/service-native-voice-recording-transcription-configure/assets/package.xml +22 -0
  213. package/skills/service-native-voice-recording-transcription-configure/references/thunderbird-voice-settings.md +101 -0
  214. package/skills/service-native-voice-recording-transcription-configure/scripts/enable-recording-transcription.sh +181 -0
  215. package/skills/data360-activate/README.md +0 -38
  216. package/skills/data360-activate/SKILL.md +0 -127
  217. package/skills/data360-connect/README.md +0 -57
  218. package/skills/data360-connect/SKILL.md +0 -163
  219. package/skills/data360-connect/examples/connections/heroku-postgres.json +0 -15
  220. package/skills/data360-connect/examples/connections/ingest-api-connection.json +0 -5
  221. package/skills/data360-connect/examples/connections/ingest-api-schema.json +0 -31
  222. package/skills/data360-connect/examples/connections/redshift.json +0 -16
  223. package/skills/data360-connect/examples/connections/sharepoint-unstructured.json +0 -20
  224. package/skills/data360-connect/examples/connections/snowflake-connection.json +0 -42
  225. package/skills/data360-harmonize/README.md +0 -31
  226. package/skills/data360-harmonize/SKILL.md +0 -126
  227. package/skills/data360-orchestrate/README.md +0 -120
  228. package/skills/data360-orchestrate/SKILL.md +0 -263
  229. package/skills/data360-orchestrate/assets/definitions/activation-target.template.json +0 -5
  230. package/skills/data360-orchestrate/assets/definitions/activation.template.json +0 -7
  231. package/skills/data360-orchestrate/assets/definitions/calculated-insight.template.json +0 -7
  232. package/skills/data360-orchestrate/assets/definitions/data-action-target.template.json +0 -5
  233. package/skills/data360-orchestrate/assets/definitions/data-action.template.json +0 -5
  234. package/skills/data360-orchestrate/assets/definitions/data-graph.template.json +0 -21
  235. package/skills/data360-orchestrate/assets/definitions/data-stream.template.json +0 -55
  236. package/skills/data360-orchestrate/assets/definitions/dmo.template.json +0 -17
  237. package/skills/data360-orchestrate/assets/definitions/identity-resolution.template.json +0 -30
  238. package/skills/data360-orchestrate/assets/definitions/mapping.template.json +0 -14
  239. package/skills/data360-orchestrate/assets/definitions/relationship.template.json +0 -12
  240. package/skills/data360-orchestrate/assets/definitions/search-index.template.json +0 -9
  241. package/skills/data360-orchestrate/assets/definitions/segment.template.json +0 -16
  242. package/skills/data360-orchestrate/references/feature-readiness.md +0 -157
  243. package/skills/data360-orchestrate/references/plugin-setup.md +0 -138
  244. package/skills/data360-orchestrate/scripts/bootstrap-plugin.sh +0 -53
  245. package/skills/data360-orchestrate/scripts/diagnose-org.mjs +0 -511
  246. package/skills/data360-orchestrate/scripts/generate-manifest.mjs +0 -68
  247. package/skills/data360-orchestrate/scripts/verify-plugin.sh +0 -58
  248. package/skills/data360-prepare/README.md +0 -50
  249. package/skills/data360-prepare/SKILL.md +0 -203
  250. package/skills/data360-prepare/examples/ingestion-api/.env.example +0 -8
  251. package/skills/data360-prepare/examples/ingestion-api/README.md +0 -48
  252. package/skills/data360-prepare/examples/ingestion-api/send-data.py +0 -144
  253. package/skills/data360-query/README.md +0 -43
  254. package/skills/data360-query/SKILL.md +0 -128
  255. package/skills/data360-query/examples/search-indexes/hybrid-structured.json +0 -44
  256. package/skills/data360-query/examples/search-indexes/vector-knowledge.json +0 -43
  257. package/skills/data360-segment/README.md +0 -35
  258. package/skills/data360-segment/SKILL.md +0 -123
  259. package/skills/service-helpagent-coordinate/references/channel-help-portal.md +0 -22
  260. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-1-1-non-text-content.md +0 -0
  261. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-3-1-i-lists.md +0 -0
  262. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-3-1-ii-tables.md +0 -0
  263. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-3-1-iii-form-labels.md +0 -0
  264. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-3-1-iv-regions.md +0 -0
  265. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-3-1-v-groups.md +0 -0
  266. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-3-5-identify-input.md +0 -0
  267. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-1-4-3-contrast.md +0 -0
  268. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-2-1-1-keyboard.md +0 -0
  269. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-2-4-4-link-purpose.md +0 -0
  270. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-2-4-6-headings-labels.md +0 -0
  271. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-2-5-1-pointer-gestures.md +0 -0
  272. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-2-5-2-pointer-cancellation.md +0 -0
  273. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-2-5-3-label-in-name.md +0 -0
  274. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-2-5-7-dragging-movement.md +0 -0
  275. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-3-2-1-on-focus.md +0 -0
  276. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-3-2-2-on-input.md +0 -0
  277. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-3-3-1-error-identification.md +0 -0
  278. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-3-3-2-labels-instructions.md +0 -0
  279. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-3-3-3-error-suggestion.md +0 -0
  280. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-4-1-2-i-name.md +0 -0
  281. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-4-1-2-ii-role.md +0 -0
  282. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/reviewers/sc-4-1-2-iii-value.md +0 -0
  283. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/vision/sc-1-1-1-non-text-content.md +0 -0
  284. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/vision/sc-1-4-1-use-of-color.md +0 -0
  285. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/vision/sc-1-4-10-resize-reflow.md +0 -0
  286. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/vision/sc-1-4-11-non-text-contrast.md +0 -0
  287. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/references/vision/sc-1-4-3-contrast.md +0 -0
  288. /package/skills/{experience-lwc-accessibility-validate → experience-accessibility-validate}/scripts/contrast-ratio.py +0 -0
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Fallback ASA-compliant email template for Email-to-Case Agentforce replies.
4
+ Deployed by Branch C ONLY when the user does not name an existing template.
5
+
6
+ Placed under email/unfiled$public/ so it lands in the org-wide PUBLIC email
7
+ template folder — BotEmailDefinition rejects a template in a private (user)
8
+ folder. The companion AgentforceForServiceEmailTemplate.email holds the HTML
9
+ body with the required [[[GENERATED_CONTENT]]] and [[[LEGAL_DISCLOSURE]]] tokens.
10
+
11
+ Key required attributes for ASA validity (see references/botemaildefinition.md):
12
+ uiType = SFX -> Lightning email template (a classic 'Aloha' template is rejected).
13
+ uiType is SET-ONCE: it cannot be changed after create.
14
+ type = custom -> HTML/custom body (not 'text' or 'visualforce').
15
+ style = none -> REQUIRED by the deploy ("Required field is missing: style").
16
+ 'none' is valid for a custom HTML template.
17
+
18
+ The deploying user needs Lightning (SFX) email-template permission and write
19
+ access to public templates (editPublicTemplates), plus org HTML email enabled.
20
+ -->
21
+ <EmailTemplate xmlns="http://soap.sforce.com/2006/04/metadata">
22
+ <name>Agentforce for Service Email Template</name>
23
+ <uiType>SFX</uiType>
24
+ <type>custom</type>
25
+ <style>none</style>
26
+ <encodingKey>UTF-8</encodingKey>
27
+ <subject>Re: your support request</subject>
28
+ <available>true</available>
29
+ </EmailTemplate>
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Metadata-format manifest for deploying a BotEmailDefinition.
4
+
5
+ WHY metadata format: BotEmailDefinition is NOT in the Salesforce CLI's
6
+ source-deploy-retrieve (SDR) registry, so a source deploy naming the type
7
+ directly fails with:
8
+ "Missing metadata type definition in registry for id 'BotEmailDefinition'".
9
+ Deploy it in METADATA format instead (the deploy "metadata-dir" path), with
10
+ this package.xml and the component file placed as:
11
+ (dir)/package.xml
12
+ (dir)/botEmailDefinitions/(DeveloperName).botEmailDefinition
13
+ Note the metadata-format file has NO "meta.xml" suffix.
14
+
15
+ Substitute {BOT_EMAIL_DEFINITION_DEVELOPER_NAME} with the fullName (file name)
16
+ and {API_VERSION} with the org's resolved API version — which MUST be 68.0 or
17
+ higher, since BotEmailDefinition is only exposed to the Metadata API at v68.0+.
18
+ -->
19
+ <Package xmlns="http://soap.sforce.com/2006/04/metadata">
20
+ <types>
21
+ <members>{BOT_EMAIL_DEFINITION_DEVELOPER_NAME}</members>
22
+ <name>BotEmailDefinition</name>
23
+ </types>
24
+ <version>{API_VERSION}</version>
25
+ </Package>
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Metadata-format manifest for deploying the Case settings singleton
4
+ (member name is always "Case" — CaseSettings is a per-org singleton).
5
+
6
+ WHY metadata format (not a source deploy that names Settings:Case directly):
7
+ a source deploy reads sourceApiVersion from sfdx-project.json, which the
8
+ api-version flag does NOT override. Deploying in metadata format lets this
9
+ manifest pin the version instead, so the user's sfdx-project.json is never
10
+ mutated (a source deploy would otherwise force a permanent sourceApiVersion
11
+ bump affecting all their later deploys).
12
+
13
+ NOTE: keep this comment free of double-hyphen tokens. This file is copied
14
+ verbatim (via sed) into the deploy package.xml, and the Metadata API rejects
15
+ a double-hyphen sequence inside an XML comment ("not permitted within
16
+ comments"), which fails the deploy.
17
+
18
+ Substitute {API_VERSION} with the org's resolved API version — which MUST be
19
+ 68.0 or higher, since botEmailDefinition on a routing address is only exposed
20
+ to the Metadata API at v68.0+. The Case settings file is placed as:
21
+ (dir)/package.xml
22
+ (dir)/settings/Case.settings (metadata format: NO -meta.xml suffix)
23
+ -->
24
+ <Package xmlns="http://soap.sforce.com/2006/04/metadata">
25
+ <types>
26
+ <members>Case</members>
27
+ <name>Settings</name>
28
+ </types>
29
+ <version>{API_VERSION}</version>
30
+ </Package>
@@ -13,6 +13,7 @@ The connection block name depends on the channel type being wired:
13
13
  | Enhanced Chat (EmbeddedMessaging) | `connection customer_web_client:` | `OmniChannelFlow` |
14
14
  | Enhanced Messaging (3rd-party) | `connection messaging:` | `OmniChannelFlow` |
15
15
  | Voice | `connection telephony:` | `OmniChannelFlow` |
16
+ | Email-to-Case | `connection service_email:` | `OmniChannelFlow` |
16
17
 
17
18
  ## Prerequisite
18
19
 
@@ -72,6 +73,15 @@ connection telephony:
72
73
  adaptive_response_allowed: True
73
74
  ```
74
75
 
76
+ For **Email-to-Case** (`connection service_email:`):
77
+
78
+ ```yaml
79
+ connection service_email:
80
+ outbound_route_type: "OmniChannelFlow"
81
+ outbound_route_name: "flow://{OUTBOUND_FLOW_DEVELOPER_NAME}"
82
+ adaptive_response_allowed: True
83
+ ```
84
+
75
85
  If a block for the relevant connection type already exists in the file, **add the outbound fields to the existing block** rather than creating a duplicate. Do not overwrite fields that are already present. If `modality voice:` already exists, leave it as-is — do not overwrite existing voice tuning values.
76
86
 
77
87
  ## Republish and activate the agent
@@ -93,5 +103,15 @@ grep -n "outboundRouteName\|outboundRouteType" \
93
103
  Both `outboundRouteName` and `outboundRouteType` must be present in the correct `<plannerSurfaces>` entry. The compiled XML maps the connection blocks as:
94
104
  - `connection customer_web_client:` → `<surfaceType>CustomerWebClient</surfaceType>`
95
105
  - `connection messaging:` → `<surfaceType>Messaging</surfaceType>`
106
+ - `connection service_email:` → `<surfaceType>ServiceEmail</surfaceType>`
96
107
 
97
108
  If absent, the connection block was not serialised correctly — re-retrieve the `.agent` file and confirm the YAML was written before publishing.
109
+
110
+ > **AiAuthoringBundle / Email-to-Case caveat (`connection service_email:`).** For an agent authored as an **AiAuthoringBundle** — the `ExternalCopilot` Agentforce Service Agent used by Email-to-Case (Branch C) — `sf project retrieve start --metadata "GenAiPlannerBundle:{AGENT_DEVELOPER_NAME}"` can report `files: 1` yet write **nothing** under `genAiPlannerBundles/`. With no compiled file to grep, the command above returns empty — a **false negative**, not a wiring failure. Do not conclude the surface is missing. Verify instead by:
111
+ > - **Grepping the `AiAuthoringBundle` source** (the source of truth), which retains the block through publish:
112
+ > ```bash
113
+ > sf project retrieve start --metadata "AiAuthoringBundle:{AGENT_DEVELOPER_NAME}" --target-org $ORG
114
+ > grep -n "connection service_email:" \
115
+ > force-app/main/default/aiAuthoringBundles/{AGENT_DEVELOPER_NAME}/{AGENT_DEVELOPER_NAME}.agent
116
+ > ```
117
+ > - **Treating the `BotEmailDefinition` deploy as the definitive `ServiceEmail`-surface check.** Its save-time validation fires `SurfaceMissingForSave` **last**, so a successful `Created` deploy (Branch C, Step 4c) proves the surface is live on the active version — authoritative over the empty GenAiPlannerBundle grep.
@@ -0,0 +1,107 @@
1
+ # BotEmailDefinition — field, validation, and deploy reference
2
+
3
+ `BotEmailDefinition` is the Metadata API type (available **API v68.0+**) that connects an Agentforce Service Agent to Service Email, so the agent can respond to Email-to-Case messages. It backs the "Agentforce for Service on Email" Setup feature (`/lightning/setup/AsaForEmail/home`). Branch C deploys it headlessly instead of asking the user to fill in that Setup form.
4
+
5
+ It is a top-level component (`keyPrefix 1NY`, `isTopLevel=true`), but it is **not registered in the Salesforce CLI's source-deploy-retrieve (SDR) registry** — a source deploy that names the type directly (`sf project deploy start --metadata BotEmailDefinition:<name>`) fails with `Missing metadata type definition in registry for id 'BotEmailDefinition'`. Deploy it in **metadata format** with `--metadata-dir` instead (see "Deploying" below). It is not the `CaseSettings` singleton, so it does not use the two-phase `updateMetadata` CRUD call.
6
+
7
+ ## Fields (WSDL complexType, extends `Metadata`)
8
+
9
+ All six are **required on create** — the WSDL marks none of them `minOccurs="0"` — and none are platform-generated/read-only.
10
+
11
+ | Field | Type | Notes |
12
+ |-------|------|-------|
13
+ | `botDefinition` | string | **Required.** Developer/API name of the `AgentforceServiceAgent` (Bot) to link. Resolved to the Bot's ID at deploy. The agent must be **active**, of type `EinsteinServiceAgent`, have a bot user, and that bot user must hold `agentforceServiceAgentUser`. |
14
+ | `emailTemplate` | string | **Required.** Reference to the reply email template. **Must be folder-qualified** — e.g. `unfiled$public/AgentforceForServiceEmailTemplate`, not a bare `AgentforceForServiceEmailTemplate` (a bare name fails with `no EmailTemplate named X found`). Must satisfy the ASA rules below. |
15
+ | `label` | string | **Required.** Display label for the email definition. |
16
+ | `legalDisclaimer` | string | **Required.** Legal disclosure / footer text appended to replies. **Minimum 10 characters** (`MinLengthNotMet`). |
17
+ | `replyAll` | boolean | **Required.** `true` = reply-all; `false` = reply to sender only. |
18
+ | `signature` | string | **Required.** Email signature block. **Minimum 10 characters** (`MinLengthNotMet`). |
19
+
20
+ `fullName` is **not** a child element — for a top-level component it is the file name (`<DeveloperName>.botEmailDefinition-meta.xml`). The routing address references this `fullName`.
21
+
22
+ ## Save-time validation order (verified against Core, release 266)
23
+
24
+ The org validates the fields in this exact order — note the surface/active-version check (step 5) fires **last**, after the two text-length checks and all the agent/template checks. Following the same order in preflight surfaces the most likely blocker first.
25
+
26
+ 1. **`legalDisclaimer` length** — must be ≥10 chars, else `MinLengthNotMet`.
27
+ 2. **`signature` length** — must be ≥10 chars, else `MinLengthNotMet`.
28
+ 3. **`botDefinition`** — in order:
29
+ - empty → `RequiredFieldMissing`;
30
+ - not found → `BotDefinitionInvalid`;
31
+ - agent type ≠ `EinsteinServiceAgent` → `BotDefinitionAgentTypeIncorrect`;
32
+ - bot user null/invalid → `BotUserNull` / `BotUserInvalid`;
33
+ - bot user missing the `agentforceServiceAgentUser` permission → `BotUserHasNoAgentforceServiceAgentUserPerm`.
34
+ 4. **`emailTemplate`** — in order:
35
+ - `uiType` ≠ SFX → `EmailTemplateUiTypeIncorrect`;
36
+ - blank HTML body → `EmailTemplateDoesntContainHtmlValue`;
37
+ - missing `[[[GENERATED_CONTENT]]]` → `EmailTemplateMissingGeneratedContent`;
38
+ - missing `[[[LEGAL_DISCLOSURE]]]` → `EmailTemplateMissingLegalDisclosure`;
39
+ - private/user folder (id prefix `005`, or folder `AccessType` ≠ `PUBLIC`) → `EmailTemplateIsPrivate`.
40
+ 5. **Surface / active-version check** — fires **last**:
41
+ - the agent has no **active version** → `AgentMustBeActive`;
42
+ - the active version does not have the **`ServiceEmail` surface** enabled → `SurfaceMissingForSave` (label section `AsaForEmail`).
43
+ The check uses the **active-version** id, not the bot id.
44
+
45
+ ## Prerequisite: the `ServiceEmail` surface (`connection service_email:`)
46
+
47
+ The save checks that the agent's **active version** has the `ServiceEmail` surface enabled. That surface is enabled by a `connection service_email:` block in the agent's `.agent` (AiAuthoringBundle) file, which compiles to `<plannerSurfaces><surfaceType>ServiceEmail</surfaceType><surface>SurfaceAction__ServiceEmail</surface></plannerSurfaces>`. Branch C **Step 3** adds this block and republishes before the deploy, so the active version already carries the surface — enabling it after publish would require deactivate → deploy → reactivate.
48
+
49
+ Detect an existing surface on the published agent:
50
+ ```bash
51
+ sf project retrieve start --metadata "AiAuthoringBundle:{AGENT_DEVELOPER_NAME}" --target-org $ORG
52
+ # then grep the retrieved .agent file for: connection service_email:
53
+ ```
54
+
55
+ ## Case assignment — why the binding alone is not enough
56
+
57
+ The routing address's `botEmailDefinition` child only selects *which agent/template generates the reply*; it does **not** route the case to the agent. Branch C does that with one of two mechanisms (Step 2), written onto the routing address in Step 4d:
58
+
59
+ - **Direct case-owner assignment (default):** set `caseOwner` = the bot user's Username with `caseOwnerType: User`. The agent replies only when `Case.Owner` equals its bot user **at the moment the inbound email is processed**, and that owner must be assigned **synchronously during the case save** — a delayed/async assignment (e.g. a late-running assignment rule) prevents the reply until the customer emails again. Setting `caseOwner` satisfies this: it is copied onto every new case at save time, no extra infrastructure.
60
+ - **Omni-Channel flow (advanced):** set `routingFlow` (an inbound Copilot RoutingFlow) + `fallbackQueue`; the flow routes each case to the agent via Omni-Channel.
61
+
62
+ Set one path's fields, not both. An empty `caseOwner` with no `routingFlow` → the case falls to the org default owner and the agent stays silent.
63
+
64
+ ## The email template (ASA-valid `EmailTemplate`)
65
+
66
+ A template is ASA-valid only if **all** of these hold (each maps to an error in step 4 above):
67
+
68
+ 1. **`uiType = SFX`** — a Lightning email template; classic (`Aloha`) is rejected. `uiType` is **set-once** (create SFX; cannot flip later).
69
+ 2. **HTML body present** — the `.email` body must be non-blank.
70
+ 3. **Both literal ASA tokens** — the HTML body must contain, verbatim, `[[[GENERATED_CONTENT]]]` and `[[[LEGAL_DISCLOSURE]]]`. These are raw substrings, **not** `{!...}` merge fields.
71
+ 4. **Public** — the org-wide public bucket (`unfiled$public`) or a folder whose `AccessType` is `Public`. A private/user folder is rejected.
72
+ 5. **Exists** — the FK is `Restrict`, so the template must pre-exist the deploy.
73
+
74
+ Branch C validates the fallback template with `python3 scripts/validate-emailtemplate.py <path-to-.email-meta.xml>` before deploying. Deploying the fallback requires the deploying user to have Lightning (SFX) email-template permission, write access to public templates (`editPublicTemplates`), and org HTML email enabled.
75
+
76
+ ## Deploying (metadata format)
77
+
78
+ Because `BotEmailDefinition` is not in the CLI's SDR registry, deploy it in **metadata format**. Build a metadata-format package directory from `assets/mdapi-package.xml` and the component file (renamed to drop `-meta.xml`):
79
+
80
+ ```text
81
+ <mdapi-dir>/
82
+ ├── package.xml # from assets/mdapi-package.xml
83
+ └── botEmailDefinitions/
84
+ └── <DeveloperName>.botEmailDefinition # same XML as the source file, NO -meta.xml suffix
85
+ ```
86
+
87
+ Set `package.xml` `<version>` to the org's resolved API version. Then:
88
+
89
+ ```bash
90
+ sf project deploy start --metadata-dir <mdapi-dir> --target-org $ORG --json
91
+ ```
92
+
93
+ Confirm `success: true` with the component listed. `BotEmailDefinition` is **not SOQL-queryable** and may not read/retrieve back cleanly, so treat a successful deploy result as authoritative — do not treat a failed read-back as a failed deploy.
94
+
95
+ ## Org gate (composite)
96
+
97
+ Everything here is gated by a **composite** capability, not a single permission:
98
+
99
+ ```text
100
+ orgHasAgentforceServiceAgentEmail =
101
+ OrgPermissions.AgentforceServiceAgent
102
+ && OrgPermissions.HasEmailToCase
103
+ && (OrgPermissions.UniversalCreditMetering || OrgPermissions.ASAEmailEarlyAccess)
104
+ && EinsteinBot.orgHasChatbotFoundationEnabled
105
+ ```
106
+
107
+ Create/edit/delete of the component additionally requires `UserPermissions.CustomizeApplication`. If the composite gate is not satisfied, the type is unavailable and the deploy fails — stop and surface the error.
@@ -1,6 +1,24 @@
1
1
  # Branch C — Email-to-Case inbound routing
2
2
 
3
- Same inbound RoutingFlow shape as Branch B, but using the org-specific Case-based ServiceChannel. Also includes the mandatory outbound `connection service_email:` and a mandatory manual BotEmailDefinition step (Email Configuration in Setup).
3
+ Inbound routing gets each new case to the agent's bot user by one of two mechanisms (Step 2) — direct case-owner assignment (default) or an Omni-Channel flow. Also includes the mandatory `connection service_email:` surface block and a mandatory BotEmailDefinition step (Email Configuration).
4
+
5
+ ## Precondition — org must be on API v68.0+
6
+
7
+ `BotEmailDefinition` (the Email Configuration that links the agent to Service Email — Step 4) is exposed to the Metadata API only at **API v68.0+**. Gate the entire branch on this **before configuring anything** — do not enable Email-to-Case, create routing addresses, deploy the inbound flow, or modify the agent on an org that can't complete the wiring.
8
+
9
+ Resolve the org's **true max** supported API version and stop if it is below 68.0. Query `/services/data` (the live version list) rather than `sf org display`'s `apiVersion` — that value is a cached `instanceApiVersion` that can lag the org's real max, so an upgraded-but-not-re-authed v68 org could wrongly fail this gate:
10
+
11
+ ```bash
12
+ ORG_API_VERSION=$(sf api request rest --target-org "$ORG" "/services/data" \
13
+ | python3 -c "import sys, json; print(max((v['version'] for v in json.load(sys.stdin)), key=float))")
14
+
15
+ python3 -c "import sys; sys.exit(0 if float('$ORG_API_VERSION') >= 68.0 else 1)" || {
16
+ echo "Org API version $ORG_API_VERSION is below 68.0 — Agentforce Email-to-Case (BotEmailDefinition) is not available on this org. Stopping without making changes."
17
+ exit 1
18
+ }
19
+ ```
20
+
21
+ If the check fails, **stop and tell the user** their org's API version does not support Agentforce Email-to-Case, and configure nothing. **There is no manual Setup fallback for this branch** — if the org can't complete the wiring headlessly, stop. If it passes, carry `ORG_API_VERSION` forward for the Step 4 deploy manifest.
4
22
 
5
23
  ## Step 0 — Enable Email-to-Case
6
24
 
@@ -49,10 +67,10 @@ Ask the user via `AskUserQuestion`:
49
67
  a. Read current CaseSettings from the Tooling API:
50
68
  ```bash
51
69
  sf api request rest -o "$ORG" --method GET \
52
- "/services/data/v67.0/tooling/query?q=SELECT+Metadata+FROM+CaseSettings+LIMIT+1"
70
+ "/services/data/v{ORG_API_VERSION}/tooling/query?q=SELECT+Metadata+FROM+CaseSettings+LIMIT+1"
53
71
  ```
54
72
 
55
- b. In the returned `Metadata.caseEmailRoutingAddresses` array, find the entry whose `emailAddress` matches `{SUPPORT_EMAIL}`. Patch that entry:
73
+ b. In the returned `Metadata.emailToCase.routingAddresses` array (not a top-level `caseEmailRoutingAddresses`), find the entry whose `emailAddress` matches `{SUPPORT_EMAIL}`. Patch that entry:
56
74
  - `caseOrigin`: query `Case.Origin` picklist values and select `Email` if present, otherwise the closest match
57
75
  - `saveEmailHeaders`: `true`
58
76
  - `addressType`: `EmailToCase`
@@ -60,10 +78,10 @@ Ask the user via `AskUserQuestion`:
60
78
  c. Deploy the patched Metadata back:
61
79
  ```bash
62
80
  sf api request rest -o "$ORG" --method PATCH \
63
- "/services/data/v67.0/tooling/sobjects/CaseSettings/{CASE_SETTINGS_ID}" \
81
+ "/services/data/v{ORG_API_VERSION}/tooling/sobjects/CaseSettings/{CASE_SETTINGS_ID}" \
64
82
  --body '{"Metadata": {<patched metadata object>}}'
65
83
  ```
66
- Run this from `/tmp/sfskills` (a valid SFDX project directory). If the Tooling API PATCH fails, fall back to Metadata API deploy via `sf project deploy start --metadata Settings:Case`.
84
+ If the Tooling API PATCH fails, fall back to a **metadata-format** `Settings:Case` deploy — the same `--metadata-dir` pattern as Step 4d point 3 (assemble a package from `assets/settings-mdapi-package.xml` pinned to `ORG_API_VERSION`, drop the `Case.settings` file under `settings/`, and deploy with `sf project deploy start --metadata-dir`). Do **not** fall back to a source deploy (`sf project deploy start --metadata Settings:Case`): it reads `sourceApiVersion` from the project's `sfdx-project.json` (which the api-version flag does not override), so v68-only fields fail on a project pinned lower, and pinning it there mutates the user's project permanently. As in Step 4d, a settings deploy replaces the whole `routingAddresses` collection, so the deployed file must carry every existing address.
67
85
 
68
86
  4. Inform the user about email verification — then continue without waiting:
69
87
 
@@ -80,66 +98,201 @@ Set `ROUTING_ADDRESS_ID` to the selected record's `Id` and continue. No provisio
80
98
 
81
99
  ---
82
100
 
83
- ## Step 2 — Inbound RoutingFlow
101
+ ## Step 2 — Inbound routing to the agent
84
102
 
85
- 1. **Query the ServiceChannel** — see `channel-types.md`. Stop if zero rows; ask user if multiple rows.
103
+ Each new case must reach the agent's bot user. There are two mechanisms — ask the user which to use (`AskUserQuestion`):
86
104
 
87
- 2. **Determine names:**
88
- - Flow label: `{AgentLabel} Inbound Email Flow`
89
- - DeveloperName: `{AgentDevName}_Inbound_Email_Flow`
90
- - `SERVICE_CHANNEL_DEV_NAME` / `SERVICE_CHANNEL_LABEL` from the queried ServiceChannel
105
+ - **Direct case-owner assignment (default)** — set the agent's bot user as the routing address's `caseOwner`. It is copied straight onto every new case during save. No extra org configuration.
106
+ - **Omni-Channel flow (advanced)** — an inbound routing flow routes each case to the agent via Omni-Channel, with a fallback queue when the agent is unavailable.
91
107
 
92
- 3. **Write the RoutingFlow XML** to `force-app/main/default/flows/{AgentDevName}_Inbound_Email_Flow.flow-meta.xml` using the template in `routing-flow.md`. Substitute all tokens including `{QUEUE_ID}` from Phase 1.
108
+ Either way, resolve the agent's **bot user** first — the record Setup surfaces as the "Agent User" / context user (Agent Details tab), which also equals the `.agent` file's `default_agent_user`. It is `BotDefinition.BotUserId` resolved to its `Username`:
109
+ ```bash
110
+ sf data query --target-org $ORG --json \
111
+ --query "SELECT BotUserId FROM BotDefinition WHERE DeveloperName='{AGENT_DEVELOPER_NAME}'"
112
+ sf data query --target-org $ORG --json \
113
+ --query "SELECT Username FROM User WHERE Id='{BOT_USER_ID}'"
114
+ ```
115
+ Capture `BOT_USER_USERNAME`.
116
+
117
+ ### Path A — Direct case-owner assignment (default)
93
118
 
94
- 4. **Deploy and verify `ActiveVersionId` is non-null** (see `routing-flow.md`).
119
+ The bot user must own the case **at the moment the inbound email is processed**, and the owner must be assigned **synchronously during the case save** — a delayed/async assignment (e.g. a late-running assignment rule) prevents the automated reply until the customer emails again. Setting `caseOwner` = `BOT_USER_USERNAME` (`caseOwnerType: User`) satisfies this. Write it in the Step 4d settings deploy — do not deploy twice.
95
120
 
96
- No agent file changes from inbound routing.
121
+ ### Path B — Omni-Channel flow (advanced)
122
+
123
+ 1. Resolve the org's **Case-based `ServiceChannel`** (`RelatedEntity='Case'`); provision one if absent — see `references/channel-types.md`. Capture `SERVICE_CHANNEL_DEV_NAME` / `SERVICE_CHANNEL_LABEL`.
124
+ 2. Create the inbound `Copilot` RoutingFlow that routes to the agent with the Phase 1 queue as fallback, using the template in `references/routing-flow.md` **Part 1**. Deploy and verify `ActiveVersionId` is non-null. Capture `INBOUND_FLOW_DEVELOPER_NAME`.
125
+ 3. In the Step 4d settings deploy, set `routingFlow` = `INBOUND_FLOW_DEVELOPER_NAME` and `fallbackQueue` = `QUEUE_DEVELOPER_NAME` on the routing address — **instead of** `caseOwner` (set one path's fields, not both).
97
126
 
98
127
  ---
99
128
 
100
- ## Step 3 — Mandatory outbound escalation: `connection service_email:`
129
+ ## Step 3 — Mandatory ServiceEmail surface: `connection service_email:`
101
130
 
102
- Unlike other channel types where outbound escalation is optional, Email-to-Case requires the `connection service_email:` block to be on the agent before the BotEmailDefinition (Email Configuration) can be created in Setup — the Setup UI requires the agent to already have this connection wired.
131
+ Email-to-Case requires the agent to carry the **ServiceEmail surface** before the BotEmailDefinition (Step 4) can be created. The `connection service_email:` block is what enables that surface; its **presence** is what's mandatory (not any escalation wiring). Do not offer this as optional or skip it.
103
132
 
104
- Do not offer this as optional or skip to Phase 3. Run these steps now:
133
+ This is a surface-only add with no outbound flow, so it is self-contained here — it does **not** go through the escalation path in `agent-wiring.md`.
105
134
 
106
- 1. **Determine the outbound flow name:**
107
- - Flow label: `{AgentLabel} Outbound Email Flow`
108
- - DeveloperName: `{AgentDevName}_Outbound_Email_Flow`
135
+ 1. Retrieve the agent's authoring bundle:
136
+ ```bash
137
+ sf project retrieve start --metadata "AiAuthoringBundle:{AGENT_DEVELOPER_NAME}" --target-org $ORG
138
+ ```
109
139
 
110
- 2. **Check if an active outbound flow already exists:**
140
+ 2. Add the block to the `.agent` YAML with a single `description` field (an empty block fails validation):
141
+ ```yaml
142
+ connection service_email:
143
+ description: "Replies to inbound Email-to-Case messages."
144
+ ```
145
+
146
+ 3. Republish and activate. The agent is already active at this point (Phase 1), and **publishing a surface/connection change onto an active agent fails** with `We couldn't find the default agent user <username>` — the active version holds the agent user, so it must be released first. Deactivate → publish → activate:
111
147
  ```bash
112
- sf data query --target-org $ORG --json \
113
- --query "SELECT ApiName, ActiveVersionId FROM FlowDefinitionView WHERE ApiName='{AgentDevName}_Outbound_Email_Flow' AND ProcessType='RoutingFlow'"
148
+ echo "Y" | sf agent deactivate --api-name {AGENT_DEVELOPER_NAME} --json
149
+ sf agent validate authoring-bundle --api-name {AGENT_DEVELOPER_NAME} --json
150
+ sf agent publish authoring-bundle --api-name {AGENT_DEVELOPER_NAME} --json
151
+ echo "Y" | sf agent activate --api-name {AGENT_DEVELOPER_NAME} --json
114
152
  ```
115
- - Row exists with non-null `ActiveVersionId` → reuse it; skip to step 3.
116
- - Row missing or `ActiveVersionId` null → create using the QueueBased template in `routing-flow.md` Part 2, with the `SERVICE_CHANNEL_DEV_NAME` / `SERVICE_CHANNEL_LABEL` queried above and `QUEUE_DEVELOPER_NAME` from Phase 1. Deploy and verify `ActiveVersionId` is non-null.
117
153
 
118
- 3. **Add `connection service_email:` to the agent and republish** — follow `agent-wiring.md`. Verify the connection block is present in the deployed bundle before continuing.
154
+ **Batch escalation here to avoid a second publish cycle.** Each surface/connection change on an active agent costs a full deactivate → publish → activate. If the user will also want outbound escalation (Phase 3), wire it in *this* edit instead of republishing again later: resolve the escalation queue and create the outbound `QueueBased` RoutingFlow first (`references/queue-resolution.md`, `references/routing-flow.md`), then add the outbound-route fields to this same `connection service_email:` block (per `references/agent-wiring.md`) before the single publish/activate above — the surface `description` and the outbound route then go live together.
155
+
156
+ Verify the block is present in the deployed bundle before continuing. Escalation is separate from this surface step — if the user wants it, add it via Phase 3 (`agent-wiring.md`), exactly like the other channels. It is not required to save the BotEmailDefinition.
119
157
 
120
158
  ---
121
159
 
122
- ## Step 4 — Mandatory manual step: BotEmailDefinition (cannot be automated)
123
-
124
- The `BotEmailDefinition` metadata type is not yet deployable via `sf project deploy`. Surface this step only after the outbound connection block is confirmed deployed:
125
-
126
- > *"The inbound routing flow and outbound escalation are now configured. One final manual step is required: you must create an **Email Configuration for Agentforce Service Agent** in Setup.*
127
- >
128
- > *Go to: `{ORG_INSTANCE_URL}/lightning/setup/AsaForEmail/home` → New*
129
- >
130
- > *Fill in the following fields:*
131
- > - *Label / DeveloperName: use the agent name for identification, e.g. `{AgentLabel} Email Configuration`*
132
- > - *Agent: select **{AgentLabel}***
133
- > - *Reply Template: an email template containing `[[[GENERATED_CONTENT]]]` (the agent's reply body) and `[[[LEGAL_DISCLOSURE]]]` (required legal footer placeholder)*
134
- > - *Legal Disclaimer: the legal text shown at the bottom of every agent reply email (required)*
135
- > - *Signature: the agent's sign-off text, e.g. agent name and title (required)*
136
- >
137
- > *If you don't have suitable email templates yet, open the App Launcher and search for **Email Templates** to create them. The reply template must include `[[[GENERATED_CONTENT]]]` and `[[[LEGAL_DISCLOSURE]]]` as literal placeholder strings.*
138
- >
139
- > *Once the Email Configuration is saved, open your Email-to-Case configuration (Setup → Feature Settings → Service → Email-to-Case → edit the relevant routing address) and set the **Agentforce Configuration** field to the configuration you just created.*
140
- >
141
- > *Reference: [Email Configurations for Agentforce Service Agent](https://help.salesforce.com/s/articleView?id=ai.service_agent_email_configuration.htm&type=5)*
142
- >
143
- > Please confirm when this setup step is complete."*
144
-
145
- Branch C is complete once the user confirms. Phase 3 outbound escalation has already been handled above — skip Phase 3 for Email-to-Case.
160
+ ## Step 4 — BotEmailDefinition (Email Configuration)
161
+
162
+ The `BotEmailDefinition` component links the agent to Service Email (the "Agentforce for Service on Email" feature). Read `references/botemaildefinition.md` in full before this step. Run this only after Step 3 confirmed `connection service_email:` is deployed on the agent.
163
+
164
+ ### Step 4a — Preflight the save-time gates (fail fast, in Core's order)
165
+
166
+ `BotEmailDefinition`'s save-time validation runs in a fixed order (see `references/botemaildefinition.md`). Check the agent-side gates now so a deploy failure isn't the first signal:
167
+
168
+ 1. **Bot user + perm.** The agent must have a bot user that holds `agentforceServiceAgentUser`:
169
+ ```bash
170
+ sf data query --target-org $ORG --json \
171
+ --query "SELECT Id, BotUserId FROM BotDefinition WHERE DeveloperName='{AGENT_DEVELOPER_NAME}'"
172
+ ```
173
+ Confirm `BotUserId` is non-null. Then confirm the bot user has the perm:
174
+ ```bash
175
+ sf data query --target-org $ORG --json \
176
+ --query "SELECT Id FROM PermissionSetAssignment WHERE AssigneeId='{BOT_USER_ID}' AND PermissionSet.PermissionsAgentforceServiceAgentUser = true LIMIT 1"
177
+ ```
178
+ Querying `PermissionSetAssignment` (not standalone `PermissionSet`) covers all three grant paths at once — the profile's own permission set, a directly assigned permission set, and a permission-set-group member. If it returns no row, stop with a clear message — the deploy would fail `BotUserHasNoAgentforceServiceAgentUserPerm`.
179
+
180
+ 2. **Active version + ServiceEmail surface.** Phase 1 already confirmed an active version. Confirm the active version carries the surface (added in Step 3):
181
+ ```bash
182
+ sf project retrieve start --metadata "AiAuthoringBundle:{AGENT_DEVELOPER_NAME}" --target-org $ORG
183
+ ```
184
+ Grep the retrieved `.agent` file for `connection service_email:`. If absent, return to Step 3 — the deploy would fail `AsaForEmail/SurfaceMissingForSave`.
185
+
186
+ 3. **No customer-verification topic (safety net).** In the same retrieved `.agent` file, check for a `ServiceCustomerVerification` subagent / topic (or a router branch gated on `isVerified`). If present, **stop and warn** — an email agent carrying customer verification dead-ends inbound email at the verification step (a fresh sender is never `isVerified`, and verification can't complete over async email). Do not auto-remove it here — this skill only wires an already-authored agent, and the topic may be legitimate for a multi-surface agent that also serves chat.
187
+
188
+ ### Step 4b — Provide the reply email template
189
+
190
+ The agent needs an ASA-valid `EmailTemplate` (`uiType=SFX`, HTML, public, containing both `[[[GENERATED_CONTENT]]]` and `[[[LEGAL_DISCLOSURE]]]`). Ask the user whether they have one:
191
+
192
+ - **User names an existing template** → confirm it is SFX, HTML-bodied, in a public folder, and contains both tokens. Use its **folder-qualified** name (e.g. `unfiled$public/<Name>`) as `EMAIL_TEMPLATE`.
193
+ - **User has none** → deploy the fallback from `assets/email/unfiled$public/AgentforceForServiceEmailTemplate.email` + `.email-meta.xml`. Validate first, then deploy:
194
+ ```bash
195
+ python3 scripts/validate-emailtemplate.py "assets/email/unfiled\$public/AgentforceForServiceEmailTemplate.email-meta.xml"
196
+ # The asset is already source-format (email/<folder>/<name>) — deploy it by path, not by --metadata
197
+ # (a named-type deploy resolves only components in the project's package directories, not this skill's assets/).
198
+ sf project deploy start --source-dir "assets/email" --target-org $ORG --json
199
+ ```
200
+ Use `unfiled$public/AgentforceForServiceEmailTemplate` as `EMAIL_TEMPLATE`.
201
+
202
+ ### Step 4c — Build, validate, and deploy the BotEmailDefinition
203
+
204
+ Elicit `label`, `legalDisclaimer` (≥10 chars), `signature` (≥10 chars), and `replyAll` (reply-all vs reply-to-sender) from the user. Choose a `DeveloperName`, e.g. `{AgentDevName}_Email_Config`.
205
+
206
+ 1. Copy `assets/BotEmailDefinition.botEmailDefinition-meta.xml` to `/tmp/sfskills/{DeveloperName}.botEmailDefinition-meta.xml` and substitute `{AGENT_DEVELOPER_NAME}`, `{EMAIL_TEMPLATE_FOLDER}/{EMAIL_TEMPLATE_DEVELOPER_NAME}` (= `EMAIL_TEMPLATE`), `{LABEL}`, `{LEGAL_DISCLAIMER_TEXT}`, `{SIGNATURE_TEXT}`, and `replyAll`.
207
+
208
+ 2. Validate:
209
+ ```bash
210
+ python3 scripts/validate-botemaildefinition.py /tmp/sfskills/{DeveloperName}.botEmailDefinition-meta.xml
211
+ ```
212
+ Resolve any errors before deploying.
213
+
214
+ 3. Assemble the metadata-format package and deploy (source deploy naming the type directly fails — it is absent from the SDR registry):
215
+ ```bash
216
+ MDDIR=/tmp/sfskills/botemaildef-mdapi
217
+ mkdir -p "$MDDIR/botEmailDefinitions"
218
+ # package.xml: from assets/mdapi-package.xml, substituting the member name and
219
+ # {API_VERSION} = ORG_API_VERSION from the Precondition.
220
+ sed -e "s/{BOT_EMAIL_DEFINITION_DEVELOPER_NAME}/{DeveloperName}/" \
221
+ -e "s/{API_VERSION}/{ORG_API_VERSION}/" \
222
+ assets/mdapi-package.xml > "$MDDIR/package.xml"
223
+ # component file: same XML as the source file, WITHOUT the -meta.xml suffix
224
+ cp /tmp/sfskills/{DeveloperName}.botEmailDefinition-meta.xml \
225
+ "$MDDIR/botEmailDefinitions/{DeveloperName}.botEmailDefinition"
226
+ sf project deploy start --metadata-dir "$MDDIR" --target-org $ORG --json
227
+ ```
228
+ Confirm `status: Succeeded` / `success: true` with the component listed. `BotEmailDefinition` is not SOQL-queryable, so treat a successful deploy as authoritative — do not treat a failed read-back as failure. Capture the `fullName` as `BOT_EMAIL_DEFINITION_NAME`.
229
+
230
+ **If the deploy fails**, stop and surface the error to the user — the agent cannot be wired to email on this org.
231
+
232
+ ### Step 4d — Bind the routing address (BotEmailDefinition + inbound routing)
233
+
234
+ In one `Settings:Case` metadata deploy, set on the routing address (`{SUPPORT_EMAIL}` from Step 1): the `botEmailDefinition` binding to `BOT_EMAIL_DEFINITION_NAME`, **plus** the Step 2 inbound-routing fields — either `caseOwner` = `BOT_USER_USERNAME` + `caseOwnerType: User` (Path A), or `routingFlow` = `INBOUND_FLOW_DEVELOPER_NAME` + `fallbackQueue` = `QUEUE_DEVELOPER_NAME` (Path B). `casePriority` is **required** on every routing address — carry it, or the deploy fails with `Missing casePriority`. A settings deploy **replaces** the `emailToCase.routingAddresses` collection, so the deployed file must carry **every** existing address — dropping one unbinds it. There is no pre-existing `Case.settings-meta.xml` in the project; you must generate it from the current org state first.
235
+
236
+ 1. **Read the current CaseSettings** to get the full `emailToCase` block, including all routing addresses:
237
+ ```bash
238
+ sf api request rest -o "$ORG" --method GET \
239
+ "/services/data/v{ORG_API_VERSION}/tooling/query?q=SELECT+Metadata+FROM+CaseSettings+LIMIT+1"
240
+ ```
241
+
242
+ 2. **Write `Case.settings-meta.xml`** to the project's settings directory (e.g. `force-app/main/default/settings/Case.settings-meta.xml`). Include the `emailToCase` toggles and **one `<routingAddresses>` entry per existing address** from the read. For each address, carry over **every** field the read returned except the read-only `emailServicesAddress`/`isVerified` — preserve whatever the org actually set (e.g. `addressType`, `caseOrigin`, `emailAddress`, `routingName`, and fields like `casePriority`), rather than a fixed subset. On the entry whose `emailAddress` matches `{SUPPORT_EMAIL}`, add `<botEmailDefinition>{BOT_EMAIL_DEFINITION_NAME}</botEmailDefinition>` plus the Step 2 path's fields. The example below shows **Path A** (case owner); for **Path B**, swap in `<routingFlow>`+`<fallbackQueue>` instead:
243
+ ```xml
244
+ <?xml version="1.0" encoding="UTF-8"?>
245
+ <CaseSettings xmlns="http://soap.sforce.com/2006/04/metadata">
246
+ <emailToCase>
247
+ <enableEmailToCase>true</enableEmailToCase>
248
+ <enableOnDemandEmailToCase>true</enableOnDemandEmailToCase>
249
+ <routingAddresses>
250
+ <addressType>EmailToCase</addressType>
251
+ <botEmailDefinition>{BOT_EMAIL_DEFINITION_NAME}</botEmailDefinition>
252
+ <caseOrigin>Email</caseOrigin>
253
+ <casePriority>Medium</casePriority>
254
+ <caseOwner>{BOT_USER_USERNAME}</caseOwner>
255
+ <caseOwnerType>User</caseOwnerType>
256
+ <emailAddress>{SUPPORT_EMAIL}</emailAddress>
257
+ <routingName>{ROUTING_NAME}</routingName>
258
+ </routingAddresses>
259
+ <!-- Path B: replace <caseOwner>/<caseOwnerType> with
260
+ <fallbackQueue>{QUEUE_DEVELOPER_NAME}</fallbackQueue> + <routingFlow>{INBOUND_FLOW_DEVELOPER_NAME}</routingFlow>.
261
+ casePriority is required. Include whatever else the read returned (minus emailServicesAddress/isVerified).
262
+ Repeat <routingAddresses> for every OTHER existing address, without botEmailDefinition/caseOwner/routingFlow. -->
263
+ </emailToCase>
264
+ </CaseSettings>
265
+ ```
266
+
267
+ 3. **Deploy in metadata format** so the version comes from the manifest — do **not** mutate `sfdx-project.json`. A source deploy of `Settings:Case` reads `sourceApiVersion` (which `--api-version` does not override), so pinning it there would persist to every later deploy in the user's project. Assemble a metadata-format package versioned at `ORG_API_VERSION` (already ≥68.0 from the Precondition — `botEmailDefinition` on a routing address needs v68.0+):
268
+ ```bash
269
+ MDDIR=/tmp/sfskills/casesettings-mdapi
270
+ mkdir -p "$MDDIR/settings"
271
+ # package.xml: from assets/settings-mdapi-package.xml, {API_VERSION} = ORG_API_VERSION.
272
+ sed -e "s/{API_VERSION}/{ORG_API_VERSION}/" \
273
+ assets/settings-mdapi-package.xml > "$MDDIR/package.xml"
274
+ # component file: the Case.settings-meta.xml from step 2, WITHOUT the -meta.xml suffix
275
+ cp <path-from-step-2>/Case.settings-meta.xml "$MDDIR/settings/Case.settings"
276
+ sf project deploy start --metadata-dir "$MDDIR" --target-org $ORG --json
277
+ ```
278
+
279
+ Verify the read-back (`emailToCase.routingAddresses`): the **set of `emailAddress` values matches the pre-deploy set** — not just that the count is unchanged, since a dropped-and-added swap preserves the count — and the target address (`{SUPPORT_EMAIL}`) now carries `<botEmailDefinition>{BOT_EMAIL_DEFINITION_NAME}</botEmailDefinition>` and the chosen path's fields (`<caseOwner>` with `caseOwnerType` `User`, or `<routingFlow>`+`<fallbackQueue>`). If any pre-deploy address is missing from the read-back, stop and surface it — a live routing address was unbound.
280
+
281
+ Branch C is complete once the binding is verified. Outbound escalation is added via Phase 3 (`agent-wiring.md`) exactly like the other channels — offer it rather than skipping it (the user can decline; it does not block inbound completion). If you already batched the outbound route into the Step 3 `connection service_email:` block, escalation is done — just confirm `outboundRouteName`/`outboundRouteType` round-tripped (per `agent-wiring.md`) instead of republishing.
282
+
283
+ ### If escalation was wired — surface the runtime prerequisites
284
+
285
+ If (and only if) outbound escalation was set up for this agent — batched into the Step 3 `connection service_email:` block, or added later via Phase 3 (`agent-wiring.md`) — present this note to the user **verbatim** after the agent is republished:
286
+
287
+ > **Escalation is now wired to your agent — but a few org-level Omni-Channel settings must be in place before an escalated case can actually reach a human.** This skill configured the agent and the routing flow; the rest is runtime setup an admin controls:
288
+ > - **Omni-Channel is enabled** in the org.
289
+ > - A **Service Presence Status** exists that includes the **Case-based service channel**, and your human agents can access it (granted via permission set or profile).
290
+ > - Agents are assigned to a **Presence Configuration** (the org's *Default* covers all users unless you've narrowed it) with **capacity** to spare.
291
+ > - The human agent is a **member of the queue** that the flow routes to.
292
+ > - The human agent is **Online in Omni-Channel** under that presence status and **accepts** the incoming work when it's offered.
293
+
294
+ ## Next steps — recommend authoring topics and actions
295
+
296
+ After confirming the agent is published and wired to Email-to-Case, surface this recommendation to the user:
297
+
298
+ > Your agent is now published and wired to Email-to-Case, so it can reply to inbound email. To give it real capabilities — reading or updating records, creating cases, escalating, or answering from knowledge — author its topics and actions with the `agentforce-generate` skill, which creates topics and actions along with the Flows, Apex, or prompt templates that back them. Consider how each data-touching action should authorize the requester — for example, scope reads and changes to records tied to the inbound sender's email address.
@@ -7,7 +7,7 @@
7
7
  | Enhanced Chat | `MessagingSession` | Branch A — set `sessionHandlerAsa` on MessagingChannel | `sfdc_livemessage` | `Messaging` |
8
8
  | Enhanced Messaging (3rd-party: WhatsApp, SMS, etc.) | `MessagingSession` | Branch A — set `sessionHandlerAsa` on MessagingChannel | `sfdc_livemessage` | `Messaging` |
9
9
  | Voice | `VoiceCall` | Branch B — create inbound RoutingFlow (`routingType: Copilot`) | `sfdc_phone` | `Phone` |
10
- | Email-to-Case | `Case` | Branch C — create inbound RoutingFlow (`routingType: Copilot`) | *(query required — see below)* | *(query required)* |
10
+ | Service Email (Email-to-Case) | `Case` | Branch C — create inbound RoutingFlow (`routingType: Copilot`) | *(query required — see below)* | *(query required)* |
11
11
 
12
12
  ## Email-to-Case: query the org-specific ServiceChannel
13
13
 
@@ -15,13 +15,40 @@ The Case-based ServiceChannel DeveloperName and Label are not system-generated a
15
15
 
16
16
  ```bash
17
17
  sf data query --target-org $ORG --json \
18
- --query "SELECT DeveloperName, MasterLabel FROM ServiceChannel WHERE RelatedEntityType='Case'"
18
+ --query "SELECT DeveloperName, MasterLabel FROM ServiceChannel WHERE RelatedEntity='Case'"
19
19
  ```
20
20
 
21
- - **Zero rows** → stop; surface gap to user. The channel cannot be wired until a Case-based ServiceChannel exists.
21
+ The SObject column is `RelatedEntity` — `RelatedEntityType` is the *metadata* field name (used in the deploy below) and errors as `No such column` in SOQL.
22
+
23
+ - **Zero rows** → no Case-based ServiceChannel exists yet. This is **provisionable, not a dead end** — tell the user one is required for routing and provision it (see "Provision a Case ServiceChannel" below), then continue with the new channel's `DeveloperName`/`MasterLabel`.
22
24
  - **One row** → use its `DeveloperName` as `SERVICE_CHANNEL_DEV_NAME` and `MasterLabel` as `SERVICE_CHANNEL_LABEL`.
23
25
  - **Multiple rows** → ask user to choose via `AskUserQuestion`.
24
26
 
27
+ ### Provision a Case ServiceChannel (Branch C only)
28
+
29
+ This applies **only to Branch C (Email-to-Case)** — Branches A and B use the fixed system channels `sfdc_livemessage`/`sfdc_phone`, which always exist and never reach this path.
30
+
31
+ When none exists, deploy one. `ServiceChannel` is in the SDR registry and has no v68-only fields, so a source deploy is fine (no `sourceApiVersion` concern). Write `serviceChannels/Case_Channel.serviceChannel-meta.xml` under the project's package directory:
32
+
33
+ ```xml
34
+ <?xml version="1.0" encoding="UTF-8"?>
35
+ <ServiceChannel xmlns="http://soap.sforce.com/2006/04/metadata">
36
+ <doesMinimizeWidgetOnAccept>false</doesMinimizeWidgetOnAccept>
37
+ <hasAutoAcceptEnabled>false</hasAutoAcceptEnabled>
38
+ <isInterruptible>false</isInterruptible>
39
+ <label>Cases</label>
40
+ <relatedEntityType>Case</relatedEntityType>
41
+ </ServiceChannel>
42
+ ```
43
+
44
+ The *metadata* field is `relatedEntityType` (here), while the SOQL column queried above is `RelatedEntity` — don't conflate them. Deploy:
45
+
46
+ ```bash
47
+ sf project deploy start --metadata "ServiceChannel:Case_Channel" --target-org $ORG --json
48
+ ```
49
+
50
+ Then use `Case_Channel` as `SERVICE_CHANNEL_DEV_NAME` and `Cases` as `SERVICE_CHANNEL_LABEL`. Deploy-time only needs the channel to exist; live Omni routing additionally needs presence configuration (reps online) before work actually routes.
51
+
25
52
  ## Voice: native vs partner — MUST CHECK before Branch B
26
53
 
27
54
  Branch B only works with **native Service Cloud Voice**. Partner telephony providers (Amazon Connect, Genesys, Avaya, etc.) manage their own routing pipelines and do not honour Salesforce RoutingFlows — wiring the agent via `routingType: Copilot` on a partner channel will have no effect.