@salesforce/afv-skills 1.71.0 → 1.72.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 (116) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-generate/SKILL.md +8 -0
  3. package/skills/agentforce-generate/assets/agents/README.md +1 -1
  4. package/skills/agentforce-generate/references/actions-reference.md +4 -0
  5. package/skills/agentforce-generate/references/mcp-actions-in-agent-script.md +233 -0
  6. package/skills/agentforce-generate/references/reference-map.md +1 -0
  7. package/skills/dx-packaging-convert-1gp-to-2gp-create/SKILL.md +9 -7
  8. package/skills/dx-packaging-convert-1gp-to-2gp-create/references/conversion-operations.md +78 -4
  9. package/skills/dx-packaging-move-to-2gp-migrate/SKILL.md +17 -13
  10. package/skills/dx-packaging-move-to-2gp-migrate/references/api-operations.md +110 -9
  11. package/skills/experience-app-mcp-generate/references/troubleshooting.md +1 -1
  12. package/skills/experience-app-mcp-generate/scripts/merge_tools.mjs +49 -18
  13. package/skills/experience-app-mcp-generate/scripts/render_eca.mjs +1 -1
  14. package/skills/experience-app-mcp-generate/scripts/render_mcp_server.mjs +1 -1
  15. package/skills/experience-app-mcp-generate/scripts/scan_tool_candidates.mjs +3 -1
  16. package/skills/experience-ui-bundle-custom-app-generate/SKILL.md +32 -26
  17. package/skills/experience-ui-bundle-custom-app-generate/references/configure-metadata-custom-application.md +6 -24
  18. package/skills/nonprofit-fundraising-configure/references/mcp-invocation.md +4 -6
  19. package/skills/platform-apex-generate/SKILL.md +2 -1
  20. package/skills/platform-apex-generate/assets/abstract.cls +0 -4
  21. package/skills/platform-apex-generate/assets/invocable-action-extension.invocableactionextension-meta.xml +28 -0
  22. package/skills/platform-apex-generate/assets/invocable.cls +2 -0
  23. package/skills/platform-apex-generate/references/dml-declarations.md +69 -0
  24. package/skills/platform-metadata-discovery-get/SKILL.md +15 -10
  25. package/skills/platform-metadata-grounding-get/SKILL.md +5 -3
  26. package/skills/service-add-agents-to-contact-center-create/SKILL.md +138 -0
  27. package/skills/service-agentforce-contact-center-coordinate/SKILL.md +5 -5
  28. package/skills/service-agentforce-contact-center-coordinate/references/omni-flow-routing.md +3 -3
  29. package/skills/service-agentforce-contact-center-coordinate/scripts/create-routing-flows.sh +8 -3
  30. package/skills/service-agentforce-contact-center-coordinate/scripts/create-voice-agent.sh +5 -5
  31. package/skills/service-agentforce-contact-center-coordinate/scripts/resolve-acc-queue.sh +10 -1
  32. package/skills/service-agentforce-contact-center-coordinate/scripts/resolve-channel-line.sh +4 -0
  33. package/skills/service-agentforce-contact-center-coordinate/scripts/resolve-flow-definition.sh +5 -0
  34. package/skills/service-agentforce-contact-center-coordinate/scripts/verify-number-live.sh +6 -1
  35. package/skills/service-concierge-portal-generate/SKILL.md +1 -1
  36. package/skills/service-concierge-portal-generate/references/portal-deploy-runbook.md +21 -8
  37. package/skills/service-digital-engagement-channel-configure/SKILL.md +45 -32
  38. package/skills/service-digital-engagement-channel-configure/assets/public_key_certificate_set_jwks_template.xml +20 -0
  39. package/skills/service-digital-engagement-channel-configure/assets/public_key_certificate_set_jwks_url_template.xml +23 -0
  40. package/skills/service-digital-engagement-channel-configure/assets/public_key_certificate_template.xml +15 -0
  41. package/skills/service-digital-engagement-channel-configure/examples/asa_agent_channel.xml +1 -1
  42. package/skills/service-digital-engagement-channel-configure/examples/auth_queue_channel.xml +3 -3
  43. package/skills/service-digital-engagement-channel-configure/examples/jwks_upload_key.xml +11 -0
  44. package/skills/service-digital-engagement-channel-configure/examples/jwks_upload_keyset.xml +13 -0
  45. package/skills/service-digital-engagement-channel-configure/examples/jwks_url_keyset.xml +17 -0
  46. package/skills/service-digital-engagement-channel-configure/examples/omni_flow_channel.xml +3 -3
  47. package/skills/service-digital-engagement-channel-configure/examples/omni_queue_channel.xml +3 -3
  48. package/skills/service-digital-engagement-channel-configure/examples/user_channel.xml +1 -1
  49. package/skills/service-digital-engagement-channel-configure/references/_vendored/service-onboarding-delegation-guidelines.md +43 -0
  50. package/skills/service-digital-engagement-channel-configure/references/channel_settings.md +1 -1
  51. package/skills/service-digital-engagement-channel-configure/references/keyset_settings.md +46 -0
  52. package/skills/service-digital-engagement-channel-configure/references/keyset_setup.md +42 -0
  53. package/skills/service-digital-engagement-channel-configure/references/onboarding_contract.md +28 -27
  54. package/skills/service-digital-engagement-channel-configure/references/recaptcha_handoff.md +2 -5
  55. package/skills/service-digital-engagement-channel-configure/references/routing_transitions.md +2 -2
  56. package/skills/service-digital-engagement-channel-configure/references/user_verification.md +3 -4
  57. package/skills/service-digital-engagement-channel-configure/references/user_verification_client.md +51 -0
  58. package/skills/service-digital-engagement-channel-configure/scripts/check-api-version.sh +7 -0
  59. package/skills/service-digital-engagement-deployment-configure/SKILL.md +28 -10
  60. package/skills/service-digital-engagement-deployment-configure/references/_vendored/service-onboarding-delegation-guidelines.md +43 -0
  61. package/skills/service-digital-engagement-deployment-configure/references/branding_and_tooling.md +2 -2
  62. package/skills/service-digital-engagement-deployment-configure/references/code_snippet.md +2 -2
  63. package/skills/service-digital-engagement-deployment-configure/references/connect_api_creation.md +13 -7
  64. package/skills/service-digital-engagement-deployment-configure/references/custom_labels.md +127 -0
  65. package/skills/service-digital-engagement-deployment-configure/references/deployment_settings.md +2 -1
  66. package/skills/service-digital-engagement-deployment-configure/references/onboarding_contract.md +24 -25
  67. package/skills/service-digital-engagement-deployment-configure/references/prechat_forms.md +1 -1
  68. package/skills/service-digital-engagement-deployment-configure/scripts/check-api-version.sh +7 -0
  69. package/skills/service-email-to-case-configure/SKILL.md +89 -80
  70. package/skills/service-email-to-case-configure/assets/CaseSettings.settings-meta.xml +1 -1
  71. package/skills/service-email-to-case-configure/examples/CaseSettings-two-addresses.settings-meta.xml +6 -3
  72. package/skills/service-email-to-case-configure/references/_vendored/service-onboarding-delegation-guidelines.md +43 -0
  73. package/skills/service-email-to-case-configure/references/agent-delegation.md +22 -0
  74. package/skills/service-email-to-case-configure/references/apply-mechanics.md +15 -12
  75. package/skills/service-email-to-case-configure/references/end-to-end-proof.md +14 -0
  76. package/skills/service-email-to-case-configure/references/onboarding-delegated-run.md +66 -0
  77. package/skills/service-email-to-case-configure/references/routing_address_reference.md +6 -2
  78. package/skills/service-email-to-case-configure/references/troubleshooting.md +17 -9
  79. package/skills/service-email-to-case-configure/scripts/apply-casesettings.py +863 -925
  80. package/skills/service-email-to-case-configure/scripts/tests/_agent.py +162 -0
  81. package/skills/service-email-to-case-configure/scripts/tests/_fakeorg.py +119 -155
  82. package/skills/service-email-to-case-configure/scripts/tests/_run.py +10 -17
  83. package/skills/service-email-to-case-configure/scripts/tests/test_apply_org_scenarios.py +14 -14
  84. package/skills/service-email-to-case-configure/scripts/tests/test_dispatch_contract.py +316 -0
  85. package/skills/service-email-to-case-configure/scripts/tests/test_new_capabilities.py +12 -43
  86. package/skills/service-email-to-case-configure/scripts/tests/test_validate_casesettings.py +13 -0
  87. package/skills/service-email-to-case-configure/scripts/validate-casesettings.py +17 -5
  88. package/skills/service-itsm-agentic-setup-incident-management/references/status-checks.md +11 -11
  89. package/skills/service-remove-agents-from-contact-center-assign/SKILL.md +145 -0
  90. package/skills/service-voice-configuration-manage/SKILL.md +206 -0
  91. package/skills/service-voice-configuration-manage/assets/regions.json +23 -0
  92. package/skills/service-voice-configuration-manage/references/lookups.md +91 -0
  93. package/skills/service-voice-configuration-manage/references/voice_config_api.md +169 -0
  94. package/skills/service-voice-configuration-manage/scripts/create-configuration.sh +20 -0
  95. package/skills/service-voice-configuration-manage/scripts/delete-configuration.sh +31 -0
  96. package/skills/service-voice-configuration-manage/scripts/get-configuration.sh +18 -0
  97. package/skills/service-voice-configuration-manage/scripts/lib.sh +22 -0
  98. package/skills/service-voice-configuration-manage/scripts/list-configurations.sh +18 -0
  99. package/skills/service-voice-configuration-manage/scripts/lookup-caller-lines.sh +30 -0
  100. package/skills/service-voice-configuration-manage/scripts/lookup-flows.sh +29 -0
  101. package/skills/service-voice-configuration-manage/scripts/lookup-profiles.sh +29 -0
  102. package/skills/service-voice-configuration-manage/scripts/lookup-users.sh +29 -0
  103. package/skills/service-voice-configuration-manage/scripts/update-configuration.sh +20 -0
  104. package/skills/tableau-next-asset-create/SKILL.md +10 -4
  105. package/skills/tableau-next-asset-create/references/dashboard-design-principles.md +133 -0
  106. package/skills/tableau-next-asset-create/references/data-transform-gotchas.md +284 -128
  107. package/skills/tableau-next-asset-create/references/deep-reference-index.md +3 -3
  108. package/skills/tableau-next-asset-create/references/edit-dashboard.md +1 -1
  109. package/skills/tableau-next-asset-create/references/edit-visualization.md +678 -468
  110. package/skills/tableau-next-asset-create/references/shared-gates.md +1 -1
  111. package/skills/tableau-next-asset-create/references/tasks/create-data-transform.md +120 -42
  112. package/skills/tableau-next-asset-create/references/tasks/create-viz.md +8 -0
  113. package/skills/tableau-next-asset-create/references/tasks/edit-viz.md +7 -4
  114. package/skills/tableau-next-asset-create/references/tasks/promote-or-reuse.md +9 -4
  115. package/skills/tableau-next-asset-create/references/viz-authoring.md +1 -1
  116. package/skills/service-email-to-case-configure/scripts/tests/test_get_session.py +0 -134
@@ -1,38 +1,32 @@
1
1
  # Onboarding contract — delegated mode, transport, pre-scan, registration
2
2
 
3
- Read this when the invocation carries a `context` object, before any org write, or when registering the skill in an
3
+ Read this when `delegationFrom` is set on the invocation, before any org write, or when registering the skill in an
4
4
  onboarding module. The sibling `service-digital-engagement-deployment-configure` has the same structure.
5
5
 
6
6
  ## 1. Two entry points, one write procedure
7
7
 
8
8
  | | Delegated | Standalone |
9
9
  |---|---|---|
10
- | Detected by | `context.calledFrom == "service-onboarding"` | no `context` object |
11
- | Values come from | `values` in the payload — already approved in the plan table | you ask for the Inputs in SKILL.md; defaults are in `references/channel_settings.md` |
12
- | Questions | none, except confirming drift on an existing channel (§3). A missing required key is a caller bug: stop and return `failed` naming the key. Never default a value the admin did not approve | the Inputs list in SKILL.md |
13
- | Wording | `discoveryMode == "guided"` → plain business language (§4). `"pickAreas"` → Salesforce terminology | Salesforce terminology (the Inputs as written) |
14
- | Ends with | the structured result in section 5 | a plain-language summary of the same outcome |
10
+ | Detected by | `delegationFrom == "service-onboarding"` (alias until onboarding drops it: `context.calledFrom == "service-onboarding"`) | `delegationFrom` absent |
11
+ | Values come from | `intent` — prose citing the facts the admin already approved in the plan. Read every Input from it first | you ask for the Inputs in SKILL.md; defaults are in `references/channel_settings.md` |
12
+ | Questions | ask only for an Input the `intent` leaves open, plus (a) confirming drift on an existing channel (§3), and (b) when verification is on and `intent` names no keyset: after the channel exists, ask once whether to create a keyset, use an existing one, or skip. Never fabricate or default a value the admin did not approve. A missing routing target is `failed` (below) | the Inputs list in SKILL.md |
13
+ | Wording | `discoveryMode == "guided"` → plain business language (§4). Any other mode → Salesforce terminology | Salesforce terminology (the Inputs as written) |
14
+ | Ends with | the structured result in section 5, then stop: no "what next?", no onward delegation | a plain-language summary of the same outcome |
15
15
 
16
- Delegated payload:
16
+ Delegated runtime values (shared rules: the Service-Onboarding delegation guidelines linked from SKILL.md):
17
17
 
18
18
  ```json
19
19
  {
20
- "values": {
21
- "channelLabel": "Acme Support Chat",
22
- "routingType": "Queue",
23
- "routingTarget": "Support_Queue",
24
- "fallbackQueue": null,
25
- "userVerification": false
26
- },
27
- "context": { "calledFrom": "service-onboarding", "discoveryMode": "guided" }
20
+ "intent": "Create a Queue-routed messaging channel 'Acme Support Chat' routed to Support_Queue; customers are not signed in.",
21
+ "delegationFrom": "service-onboarding",
22
+ "discoveryMode": "guided"
28
23
  }
29
24
  ```
30
25
 
31
- Required `values`: `channelLabel`, `routingType`, `routingTarget`; `fallbackQueue` is required when `routingType` is
32
- `Flow` or `AgentforceServiceAgent` and must be absent for `Queue` and `User`; `queueRoutingConfig` is required when
33
- `routingType` is `User`. `userVerification` defaults to `false` (`UnAuth`); when `true`, `verificationKeyset` (an existing
34
- keyset name) and `authIdentifier` are optional. Every other channel setting uses the defaults in
35
- `references/channel_settings.md` unless a key is supplied.
26
+ Inputs to read from `intent`: `channelLabel`, `routingType`, `routingTarget` (required); a fallback queue is required when `routingType` is
27
+ `Flow` or `AgentforceServiceAgent` and must be absent for `Queue` and `User`; a `QueueRoutingConfig` is required when
28
+ `routingType` is `User`. User verification defaults to off (`UnAuth`); when on, a keyset name (an existing keyset) and `authIdentifier` are optional. Every other channel setting uses the defaults in
29
+ `references/channel_settings.md` unless `intent` states it.
36
30
 
37
31
  Missing routing target, delegated: return `failed`, `errorMessage` = "<Flow|User|Bot|Queue|RoutingConfig> <name> not found". Never
38
32
  create one — queues come from the `queues` feature this one depends on.
@@ -63,11 +57,16 @@ to touch (`MessagingChannel`; and `Queue` if you must create one).
63
57
  | `xmlRep` returned, or "Metadata not found" style error | type is onboarded | Transport A |
64
58
  | `UNSUPPORTED_OPERATION` for the type or verb | not onboarded for that verb | Transport B for that call only |
65
59
  | auth / connection error | MCP unavailable | Transport B; say so |
60
+ | `dispatch` not in your tool list | tool not loaded, not unavailable | load it (e.g. ToolSearch), then probe again before choosing B |
66
61
 
67
62
  **Transport B (fallback): `sf` CLI** — `sf project deploy start` and `sf data query` / `sf data update record` as in
68
63
  SKILL.md. Use only when the probe says Transport A is unavailable for that type/verb.
69
64
 
70
- Routing-target existence checks (Queue, Flow, User, Bot) are SOQL: `dispatch_readonly` on the REST query endpoint first; `sf data query` only if that call returns a path/route error.
65
+ Routing-target existence checks (Queue, Flow, User, Bot) are SOQL: `dispatch_readonly` on the REST query endpoint first; `sf data query` only if that call returns a path/route error. The same applies to the channel Id and bind queries in steps 15 and 15a.
66
+
67
+ **Setup review link.** The activation update needs the channel Id, so step 15 looks it up: `SELECT Id FROM MessagingChannel WHERE DeveloperName='<CHANNEL_DEV_NAME>'` (Transport A `dispatch_readonly`; Transport B `sf data query`). The link is `<instanceUrl>/lightning/setup/LiveMessageSetup/<ChannelId>/view?lightning__channelType=EmbeddedMessaging`. `instanceUrl` comes from `sf org display --target-org '<alias>' --json | jq -r .result.instanceUrl` (always pipe through `jq`, never print the access token) and is usually unknown on Transport A, which has no `sf` session: then give the path alone. The link is the one exception to "no record Ids unless asked".
68
+
69
+ **Confirm the target org before the first write.** Read it with `SELECT Id, Name, IsSandbox, InstanceName FROM Organization` (Transport A `dispatch_readonly`; Transport B `sf data query -o '<alias>'`). State name, org Id and sandbox/production, and get a yes (standalone) or name it in the announced write (delegated). Treat production as a heightened case: restate that the change is live. Falling from Transport A to B changes the credential and possibly the org: run the same query on B and continue only if the org Id matches; otherwise stop and ask (delegated: `failed`, "transport B targets a different org").
71
70
 
72
71
  ## 3. Pre-scan (idempotency)
73
72
 
@@ -91,7 +90,7 @@ Ask about the outcome; state the default with each; keep it to a handful.
91
90
  |---|---|
92
91
  | "Routing type: Queue, Flow, User or Agentforce Service Agent?" | "When a customer starts a chat, who should get it first: a team (queue), a specific person, or your AI agent? (Default: a team.)" |
93
92
  | "Fallback queue developer name?" | "If the chat goes to your AI agent or an automated flow and it can't take it, which team should get it?" (Not asked for a team or a person.) |
94
- | "Enable User Verification (JWT)?" | "Will customers be signed in to your site when they chat, so you know who they are? (Default: no.)" Yes → Auth mode; an existing signing keyset name is optional, and setting up the keys is a separate step |
93
+ | "Enable User Verification (JWT)?" | "Will customers be signed in to your site when they chat, so you know who they are? (Default: no.)" Yes → Auth mode; a keyset name is optional. With none, after the channel exists ask once: create a keyset, use an existing one, or skip (`references/keyset_setup.md`) |
95
94
  | "Pre-chat form / custom parameters" | "What should we ask customers before the chat starts? (Default: name and email.)" |
96
95
  | "`isAbandonedChatsEnabled`, `chatAbandonmentTimeout`…" | Not asked; use the defaults in `references/channel_settings.md` |
97
96
 
@@ -104,12 +103,14 @@ Ask about the outcome; state the default with each; keep it to a handful.
104
103
  "outputs": {
105
104
  "channelName": "Acme_Support_Chat",
106
105
  "messagingChannelId": "<id or null>",
107
- "isActive": true
106
+ "isActive": true,
107
+ "verificationActive": false,
108
+ "keysetChoice": "created | existing | skipped | not-asked"
108
109
  }
109
110
  }
110
111
  ```
111
112
 
112
- `status` and `errorMessage` are the contract. `outputs` is always returned.
113
+ `status` and `errorMessage` are the contract. `outputs` is always returned. `verificationActive` is `true` only when `messagingAuthorizations` is on the channel; `keysetChoice` records the answer to the §1 keyset question (`not-asked` when verification is off or a `verificationKeyset` was given).
113
114
  On `failed`: `errorMessage` names the failed step and the platform error; stop; do not retry.
114
115
 
115
116
  ## 6. Registration entry (for the onboarding team to place in a module)
@@ -130,12 +131,12 @@ On `failed`: `errorMessage` names the failed step and the platform error; stop;
130
131
  userVerification: { from: signal.messagingSignedIn, default: false }
131
132
  verificationKeyset: { from: signal.messagingKeyset }
132
133
  authIdentifier: { from: signal.messagingAuthIdentifier }
133
- writes: "MessagingChannel (Metadata CRUD); IsActive via sObject update"
134
+ writes: "MessagingChannel (Metadata CRUD); IsActive via sObject update; PublicKeyCertificate and PublicKeyCertificateSet (Metadata CRUD) only when the admin chooses to create a keyset"
134
135
  gating:
135
136
  irreversible: false
136
- note: "Reversible by deactivating the channel. Pre-chat form fields can be deactivated but the form cannot be fully deleted; removing a channel custom parameter needs the form field removed and the deployment republished first."
137
+ note: "Reversible by deactivating the channel. A created keyset or key cannot be deleted while a channel's messagingAuthorizations references it (remove the authorization first), and a key's kid is unique per org. Pre-chat form fields can be deactivated but the form cannot be fully deleted; removing a channel custom parameter needs the form field removed and the deployment republished first."
137
138
  validate:
138
139
  check: check-messaging-channel
139
- passWhen: "GET MessagingChannel fullName=<normalized name> returns the targeted sessionHandlerType and target and the intended authMode; SOQL SELECT IsActive, SessionHandlerId, FallbackQueueId FROM MessagingChannel WHERE DeveloperName=<name> returns IsActive=true, and non-null SessionHandlerId/FallbackQueueId where the routing type requires them"
140
+ passWhen: "GET MessagingChannel fullName=<normalized name> returns the targeted sessionHandlerType and target and the intended authMode, plus a messagingAuthorizations entry naming the keyset when keysetChoice is created or existing; SOQL SELECT IsActive, SessionHandlerId, FallbackQueueId FROM MessagingChannel WHERE DeveloperName=<name> returns IsActive=true, and non-null SessionHandlerId/FallbackQueueId where the routing type requires them"
140
141
  alternative: "Setup > Messaging Settings > New Channel > Messaging for In-App and Web; choose routing, then activate."
141
142
  ```
@@ -17,11 +17,8 @@ The reCAPTCHA key is not exposed through any API or Metadata field, so this skil
17
17
 
18
18
  ## Build the link
19
19
 
20
- 1. Get the channel Id:
21
- ```bash
22
- sf data query -o <org> --json -q "SELECT Id FROM MessagingChannel WHERE DeveloperName='<CHANNEL_DEV_NAME>'"
23
- ```
24
- 2. Path: `/lightning/setup/LiveMessageSetup/<ChannelId>/view?lightning__channelType=EmbeddedMessaging`. Prefix it with the org's `instanceUrl` if known (`result.instanceUrl` from `sf org display --json`; never print or copy the access token), otherwise give the path.
20
+ 1. Get the channel Id: `SELECT Id FROM MessagingChannel WHERE DeveloperName='<CHANNEL_DEV_NAME>'`, through `dispatch_readonly` first, or `sf data query -o '<org>' --json -q "<query>"` where that is unavailable.
21
+ 2. Path: `/lightning/setup/LiveMessageSetup/<ChannelId>/view?lightning__channelType=EmbeddedMessaging`. Prefix it with the org's `instanceUrl` if known (`sf org display --target-org '<org>' --json | jq -r .result.instanceUrl`; always pipe through `jq`, because the raw output contains the access token, which must never be printed or copied), otherwise give the path.
25
22
 
26
23
  3. No channel Id yet (the query returns no row, or the channel is not deployed): never deploy only to get one. Give the generic route, Setup → Messaging Settings → open the channel, with the admin steps below, and carry on with the rest of the flow.
27
24
 
@@ -16,7 +16,7 @@ Changes from Queue, and between Flow and Agentforce Service Agent, carry no stal
16
16
  ## Procedure
17
17
 
18
18
  1. Announce the change and which fields will be cleared. If the channel is active (`IsActive`), say that new sessions route differently from the moment of the update. Then let the user choose to **continue** or **stop**. Write nothing until they choose continue; if they stop, leave the channel as is and report no change. Delegated: a routing-type change is the exception to confirming drift with the user (contract §3), so return `failed` with `errorMessage` "routing type change Flow → Queue needs the user's confirmation" (naming the real types) and write nothing.
19
- 2. Names must match `^[A-Za-z0-9_.@+-]+$` before they go into a query; otherwise stop and ask. Resolve the Ids: queue `SELECT Id FROM Group WHERE Type='Queue' AND DeveloperName='<NAME>'`; flow `SELECT DurableId FROM FlowDefinitionView WHERE ApiName='<NAME>' AND IsActive=true AND ProcessType='RoutingFlow'` (the `300` Id); user `SELECT Id FROM User WHERE Username='<USERNAME>' AND IsActive=true`; routing config `SELECT Id FROM QueueRoutingConfig WHERE DeveloperName='<NAME>'`; bot `SELECT Id FROM BotDefinition WHERE DeveloperName='<NAME>'` (its active version must be Active, SKILL.md step 7); the channel `SELECT Id FROM MessagingChannel WHERE DeveloperName='<CHANNEL>'`.
19
+ 2. Names must match `^[A-Za-z0-9][A-Za-z0-9_.@+-]*$` before they go into a query; otherwise stop and ask. Resolve the Ids: queue `SELECT Id FROM Group WHERE Type='Queue' AND DeveloperName='<NAME>'`; flow `SELECT DurableId FROM FlowDefinitionView WHERE ApiName='<NAME>' AND IsActive=true AND ProcessType='RoutingFlow'` (the `300` Id); user `SELECT Id FROM User WHERE Username='<USERNAME>' AND IsActive=true`; routing config `SELECT Id FROM QueueRoutingConfig WHERE DeveloperName='<NAME>'`; bot `SELECT Id FROM BotDefinition WHERE DeveloperName='<NAME>'` (its active version must be Active, SKILL.md step 7); the channel `SELECT Id FROM MessagingChannel WHERE DeveloperName='<CHANNEL>'`.
20
20
  3. First query and keep the channel's current `SessionHandlerId`, `FallbackQueueId`, and `RoutingConfigurationId`. Then update the `MessagingChannel` record with all fields in one update (Transport A: sObject update through `dispatch`; Transport B: `sf data update record --sobject MessagingChannel --record-id <Id> --values "..."`):
21
21
 
22
22
  | To | Values |
@@ -35,7 +35,7 @@ The update needs Update on `MessagingChannel` plus field access to `SessionHandl
35
35
 
36
36
  ## Target lookups
37
37
 
38
- Names must match `^[A-Za-z0-9_.@+-]+$` before they go into a query. Use `sf data query --target-org <org-alias> --query "..."`.
38
+ Names must match `^[A-Za-z0-9][A-Za-z0-9_.@+-]*$` before they go into a query. Use `sf data query --target-org '<org-alias>' --query "..."`.
39
39
 
40
40
  - Queue: `SELECT Id, DeveloperName FROM Group WHERE Type='Queue' AND DeveloperName='<QUEUE_NAME>'`
41
41
  - Flow: `SELECT Id, ApiName FROM FlowDefinitionView WHERE ApiName='<FLOW_NAME>' AND IsActive=true AND ProcessType='RoutingFlow'`
@@ -3,7 +3,6 @@
3
3
  Applies when the user turns user verification on (step 8).
4
4
 
5
5
  - Set `embeddedConfig.authMode` to `Auth` and use `verifiedUserJwtExpirationTime` (60-240); omit `anonymousUserJwtExpirationTime`.
6
- - Include `<messagingAuthorizations>` inside `<embeddedConfig>` only when the user gave an existing keyset name: `authorizationType` `PublicKeyCertificateSet`, `enabled` `true`, `publicKeyCertificateSetName` (the keyset's API name) and `authIdentifier` (free-form label; default the file name, not the JWT `sub` claim). Do not emit `authProviderName`. Shape: `references/channel_settings.md` → Messaging Authorizations; example: `examples/auth_queue_channel.xml`.
7
- - Never invent a keyset name, reuse the example's `Support_Keyset`, or write key or keyset files; the deploy fails with "Required fields are missing: [AuthorizationConfigId]" when the keyset doesn't exist.
8
- - No keyset name given (standalone or delegated): do not ask or fail. Set `authMode` `Auth` with `verifiedUserJwtExpirationTime` and omit `<messagingAuthorizations>`, then tell the user verification is not active until a keyset is attached.
9
- - Creating keys or keysets is a separate setup and not part of this skill.
6
+ - Include `<messagingAuthorizations>` inside `<embeddedConfig>` only for a keyset name the user gave, or one just created or chosen through `references/keyset_setup.md`: `authorizationType` `PublicKeyCertificateSet`, `enabled` `true`, `publicKeyCertificateSetName` (the keyset's API name) and `authIdentifier` (free-form label; default the file name, not the JWT `sub` claim). Do not emit `authProviderName`. Shape: `references/channel_settings.md` → Messaging Authorizations; example: `examples/auth_queue_channel.xml`.
7
+ - Never invent a keyset name or reuse the example's `Support_Keyset`; the deploy fails with "Required fields are missing: [AuthorizationConfigId]" when the keyset doesn't exist.
8
+ - No keyset named (standalone, or delegated with `verificationKeyset` absent): never block or fail. Set `authMode` `Auth` with `verifiedUserJwtExpirationTime` and omit `<messagingAuthorizations>`, then ask once after activation whether to create a keyset, use an existing one, or skip (`references/keyset_setup.md` → After the channel exists). Only `keyset_setup.md` writes key or keyset files.
@@ -0,0 +1,51 @@
1
+ # Client Integration Contract (customer-side)
2
+
3
+ This keyset only *verifies* JWTs. Minting and signing them is the **customer's**
4
+ responsibility, on their **backend**. This file documents the contract the customer
5
+ must meet so their tokens validate against the keyset this skill creates.
6
+
7
+ ---
8
+
9
+ ## Who signs what, and where
10
+
11
+ - The **private** key lives on the customer's backend (or an HSM / secrets manager)
12
+ and **never** touches the browser or mobile app.
13
+ - The customer's backend signs a short-lived JWT (RS256 or RS512) with that private key.
14
+ - Salesforce validates the signature using the **public** key registered in this keyset,
15
+ matched by `kid`.
16
+ - The `key-command-line-utility`
17
+ (`github.com/Salesforce-Async-Messaging/key-command-line-utility`) is an **offline,
18
+ test-only** tool for generating demo keys/JWTs — it is NOT a production signer.
19
+
20
+ ## The token
21
+
22
+ **Header**
23
+ | Field | Requirement |
24
+ |-------|-------------|
25
+ | `alg` | `RS256` or `RS512` |
26
+ | `kid` | Must match a `kid` in this keyset's JWKS — else runtime `JWK corresponding to kid in customer JWT not found` (422) |
27
+
28
+ **Claims**
29
+ | Claim | Requirement |
30
+ |-------|-------------|
31
+ | `iss` | Must equal the keyset's `jwtIssuer` |
32
+ | `sub` | Stable user identifier. Salesforce maps the verified user from this. (Note: only `sub` is used for identity — additional custom claims are not read; use hidden pre-chat fields to convey extra data.) |
33
+ | `exp` / `iat` | Short-lived. See session renewal below. |
34
+
35
+ ## Delivering the token to Salesforce (SDK)
36
+
37
+ - **Web (Messaging for Web):** after the embedded messaging bootstrap is ready, call
38
+ `embeddedservice_bootstrap.userVerificationAPI.setIdentityToken({ identityTokenType: 'JWT', identityToken: <jwt> })`.
39
+ On user logout call `clearSession()` — Salesforce cannot know when the customer's own
40
+ site session ends, so the customer must clear it (this revokes the internal session JWT).
41
+ - **Mobile (In-App SDK, iOS/Android):** supply the token through the SDK's
42
+ user-verification configuration at conversation creation. A mobile deployment must be
43
+ designed for verified users OR unverified users, not both.
44
+
45
+ ## Two tokens (don't confuse them)
46
+
47
+ 1. **User-verification JWT** — the customer mints/signs this; it's the identity assertion
48
+ this keyset verifies.
49
+ 2. **Session JWT** — Salesforce mints this internally after verification; the SDK stores it
50
+ to resume conversations. The customer neither generates nor should read it. `clearSession()`
51
+ is what invalidates it on logout.
@@ -8,6 +8,13 @@
8
8
  MIN_VERSION="${1:?Usage: check-api-version.sh <min-version> <org-alias>}"
9
9
  ORG_ALIAS="${2:?Usage: check-api-version.sh <min-version> <org-alias>}"
10
10
 
11
+ # The alias reaches a command line: reject anything that is not a plain alias/username
12
+ # (a leading "-" would be read by sf as a flag).
13
+ if ! printf '%s' "$ORG_ALIAS" | grep -qE '^[A-Za-z0-9][A-Za-z0-9_.@+-]*$'; then
14
+ echo "ERROR: Org alias '$ORG_ALIAS' is not a valid alias; ask for the alias or username."
15
+ exit 3
16
+ fi
17
+
11
18
  API_VERSION=$(sf org display --target-org "$ORG_ALIAS" --json 2>/dev/null | python3 -c "
12
19
  import json, sys
13
20
  try:
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: service-digital-engagement-deployment-configure
3
- description: "Configures Embedded Messaging Deployments for Messaging for In-App and Web (MIAW). Use when the user needs to create a new embedded messaging deployment from scratch using Connect API with defaults, or update an existing deployment's settings using Metadata API. Produces Connect API request payloads for new deployments and EmbeddedServiceConfig metadata XML for updates. TRIGGER when the user mentions embedded messaging deployment, embedded service deployment, MIAW deployment, messaging widget setup, chat widget configuration, embedded chat deployment, or references a .EmbeddedServiceConfig-meta.xml file. DO NOT TRIGGER when the user is creating a messaging channel (use service-digital-engagement-channel-configure), configuring legacy Live Agent embedded service, or generating the JavaScript code snippet for website embedding."
3
+ description: "Configures Embedded Messaging Deployments for Messaging for In-App and Web (MIAW). Use when the user needs to create a new embedded messaging deployment from scratch using Connect API with defaults, or update an existing deployment's settings using Metadata API, including custom labels (widget text such as the Today divider, with translations). Produces Connect API request payloads for new deployments and EmbeddedServiceConfig metadata XML for updates. TRIGGER when the user mentions embedded messaging deployment, embedded service deployment, MIAW deployment, messaging widget setup, chat widget configuration, embedded chat deployment, changing or translating the text a messaging widget shows (custom labels), or references a .EmbeddedServiceConfig-meta.xml file. DO NOT TRIGGER when the user is creating a messaging channel (use service-digital-engagement-channel-configure), configuring legacy Live Agent embedded service, or generating the JavaScript code snippet for website embedding."
4
4
  metadata:
5
5
  version: "1.0"
6
6
  domains: ["Service"]
@@ -14,12 +14,25 @@ metadata:
14
14
  semver: ">=3.8"
15
15
  - tool: ["sf"]
16
16
  semver: ">=2.0.0"
17
+ - tool: ["jq"]
18
+ semver: ">=1.7.0"
17
19
  ---
18
20
 
19
21
  # Configuring Embedded Messaging Deployment
20
22
 
21
23
  Configures `EmbeddedServiceConfig` metadata for Salesforce Messaging for In-App and Web (MIAW). Supports two distinct workflows: creating new deployments via Connect API and updating existing deployments via Metadata API.
22
24
 
25
+ ## How delegation is handled
26
+
27
+ ### Service-Onboarding delegation
28
+
29
+ When `delegationFrom` is set to service-onboarding, fetch and follow
30
+ [the Service-Onboarding delegation guidelines](references/_vendored/service-onboarding-delegation-guidelines.md) before acting — it is the single
31
+ source of truth, identical across every service-onboarding delegate. When it is absent, ignore this
32
+ and run as a normal standalone conversation.
33
+
34
+ ---
35
+
23
36
  ## Scope
24
37
 
25
38
  - **In scope**: Creating new Embedded Service Deployments (API, Mobile, Web types) via Connect API; updating existing deployments with forms, branding, channel settings, and features via Metadata API; generating `EmbeddedServiceConfig` XML for updates
@@ -29,8 +42,10 @@ Configures `EmbeddedServiceConfig` metadata for Salesforce Messaging for In-App
29
42
 
30
43
  ## Entry points and transport
31
44
 
32
- - **Delegated** (`context.calledFrom == "service-onboarding"`): use the approved `values`, ask nothing, and return `failed` naming any missing required key. **Standalone** (no `context`): run Clarifying Questions.
33
- - **Transport A** (primary): headless-360 MCP `dispatch` / `dispatch_readonly` on `/services/data/vXX.0/headless/metadata`. **Transport B**: the `sf` commands below, only where a probe shows Transport A unavailable. Exception: Web create always uses the `sf` CLI (step 17a).
45
+ - **Delegated** (`delegationFrom` is set; alias `context.calledFrom == "service-onboarding"` until onboarding drops it): read the inputs from `intent` and ask only for what it leaves open (`deploymentName`, `deploymentType`, `channelName`). Never fabricate a value; invalid shell input or an unknown channel is `failed`. **Standalone** (no `delegationFrom`): run Clarifying Questions.
46
+ - **Shell safety**: before use in a command, the org alias must match `^[A-Za-z0-9][A-Za-z0-9_.@+-]*$`, the derived API name `^[a-zA-Z][a-zA-Z0-9_]*$`, a channel Id `^[A-Za-z0-9]{15,18}$`, and `hostDomain` `^[A-Za-z0-9.-]+(:[0-9]+)?$`; otherwise stop and ask (delegated: `failed`). Pass labels and other free text single-quoted, escaping any `'` as `'\''`, and build JSON bodies with `jq -n --arg` (see `references/connect_api_creation.md`), never by string splicing.
47
+ - **Transport A** (primary): headless-360 MCP `dispatch` / `dispatch_readonly` on `/services/data/vXX.0/headless/metadata`. **Transport B**: the `sf` commands below, only where a probe shows Transport A unavailable. **Decide the transport before the first org command and say it in one line** (`Transport: A, probe returned xmlRep` or `Transport: B, <signal>`); no org write without that line. For B, quote the failed tool load or the probe's error text: "dispatch isn't available" with no load attempt or probe result is not a reason. If `dispatch` / `dispatch_readonly` is not in your tool list, try to load it (e.g. ToolSearch) and probe before choosing B. If you have no tool-loading tool or the load fails, that is the signal: quote it, take B, and continue; never stop without writing. Use B only on one of these signals: `ROUTE_NOT_FOUND`, `UNSUPPORTED_OPERATION`, `METADATA_CRUD_ERROR`, or an auth/connection error. The choice resets at every step: an earlier `sf` step (e.g. the Web create) is never a reason to use `sf` for the next. The Web create also tries A first and falls back to B only on `INTERNAL_ERROR` from that call (step 17a).
48
+ - **Target org**: before the first write, confirm the target org and sandbox/production with the user (contract §2); a switch from Transport A to B is a new confirmation.
34
49
 
35
50
  Details: `references/onboarding_contract.md` (§1 entry points, §2 transport, §3 pre-scan, §5 result).
36
51
 
@@ -44,7 +59,7 @@ Before generating, ask the user if not already clear (standalone only):
44
59
  - **Deployment type?** API (headless), Mobile (native apps), or Web (browser widget)?
45
60
  - **Channel name?** What is the `channelPlatformKey` of the messaging channel to associate?
46
61
  - For **create**: What should the deployment be named?
47
- - For **update**: What features to configure? (pre-chat forms, business hours, T&C, UI toggles)
62
+ - For **update**: What features to configure? (pre-chat forms, custom labels, business hours, T&C, UI toggles)
48
63
  - For **pre-chat** (if requested): the questions in `references/prechat_forms.md` §Inputs to Gather
49
64
  - For **update (Web)**: What is the Experience Site name? Branding overrides needed?
50
65
 
@@ -77,11 +92,11 @@ All steps are sequential. Do not skip or reorder. Branch based on the operation
77
92
 
78
93
  ### Phase 1 — Gather Context
79
94
 
80
- 1. **Verify org API version** — run `scripts/check-api-version.sh 67.0 <org-alias>` and report any errors it returns. Exit 1 = org below 67.0: stop all org writes and relay the script's next step (delegated: `failed`); local template generation may continue. Exit 2 = version could not be read: warn that it is unverified and continue; the deploy confirms it. Create `sfdx-project.json` in the metadata output folder only if none exists, with `sourceApiVersion` set to the script's `ORG_API_VERSION` (67.0 if exit 2).
95
+ 1. **Verify org API version** — run `scripts/check-api-version.sh 67.0 '<org-alias>'` and report any errors it returns. Exit 1 = org below 67.0: stop all org writes and relay the script's next step (delegated: `failed`); local template generation may continue. Exit 3 = invalid org alias: stop and ask for the alias (delegated: `failed`). Exit 2 = version could not be read: warn that it is unverified and continue; the deploy confirms it. Create `sfdx-project.json` in the metadata output folder only if none exists, with `sourceApiVersion` set to the script's `ORG_API_VERSION` (67.0 if exit 2).
81
96
 
82
- 2. **Determine operation** — standalone: ask whether the user wants to create a new deployment or update an existing one. Delegated: taken from `values.operation`, then confirmed by the pre-scan (step 4a).
97
+ 2. **Determine operation** — standalone: ask whether the user wants to create a new deployment or update an existing one. Delegated: taken from `intent`, defaulting per contract §1, then confirmed by the pre-scan (step 4a).
83
98
 
84
- 3. **Collect inputs** — standalone: per Clarifying Questions. Delegated: from `values` (`deploymentName`, `deploymentType`, `channelName` required).
99
+ 3. **Collect inputs** — standalone: per Clarifying Questions. Delegated: from `intent` (`deploymentName`, `deploymentType`, `channelName` required; ask for any it omits).
85
100
 
86
101
  3a. **Probe transport** — read-only `GET` of `EmbeddedServiceConfig` (contract §2).
87
102
 
@@ -112,7 +127,7 @@ Use this path when the operation is `update`.
112
127
 
113
128
  10. **Retrieve the existing deployment** — take the current `EmbeddedServiceConfig` from the org before making changes. Transport A: the `xmlRep` from the step 3a/4a `GET`. Transport B:
114
129
  ```bash
115
- sf project retrieve start --metadata EmbeddedServiceConfig:<DEPLOYMENT_NAME> --target-org <org-alias>
130
+ sf project retrieve start --metadata EmbeddedServiceConfig:<DEPLOYMENT_NAME> --target-org '<org-alias>'
116
131
  ```
117
132
  Use it as the starting structure — the update is always a **full document** (see Rules). If retrieval is not possible, load `assets/esd_web_update_template.xml` as a fallback reference.
118
133
 
@@ -122,6 +137,8 @@ Use this path when the operation is `update`.
122
137
  - **Before generating**, run the checks in its §Validating and Remediating Prerequisites against the *retrieved* channel. Channel fixes go through `service-digital-engagement-channel-configure`; never hand-edit the channel here.
123
138
  - Delta to graft onto a base deployment: `examples/esd_web_prechat_fields.xml`.
124
139
 
140
+ 12a. **Apply custom labels** (Web v1/v2 and Mobile, not API; only if asked) — read `references/custom_labels.md`. Labels are Tooling records, not `EmbeddedServiceConfig` XML: check the deployment type (Mobile: two keys only), Translation Workbench and language prerequisites first, warn that Web v1/v2 show different label sets, write them in Phase 2C, and they go live only on publish (17c). Reply to the user with the result, the Setup review link and one next question; leave out tool, recipe and endpoint names. Delegated: still end with the contract §5 result.
141
+
125
142
  13. **Apply branding customization** (Web only) — a BrandingSet is automatically created with defaults when the deployment is created via Connect API. If the user wants to override specific branding properties (colors, fonts, dimensions), read `references/branding_and_tooling.md` for the Tooling API steps to update individual properties.
126
143
 
127
144
  14. **Apply invitation** (Web only) — set `isInvitationEnabled` to `true`, add `<embdMsgChannelInvitationConditions>` (fields and operators in `references/deployment_settings.md`), and keep `formula` (e.g. `1 AND 2`) in sync with the condition `sequence` numbers whenever conditions change.
@@ -141,7 +158,7 @@ Use this path when the operation is `update`.
141
158
  Runs for both Phase 2A and 2B, except when the pre-scan returned `already-configured`. Standalone: confirm before writing. Delegated: the plan approval is the confirmation; still announce each write.
142
159
 
143
160
  17a. **Write the deployment** —
144
- - Web create: Connect API (see `references/connect_api_creation.md`) via `sf api request rest` — always, not `dispatch` (MCP `dispatch` fails with `INTERNAL_ERROR` during site creation).
161
+ - Web create: Connect API (see `references/connect_api_creation.md`). Transport A first: `dispatch` `POST` on the fully-qualified path. If it returns `INTERNAL_ERROR` (MCP sessions can fail while the ESW site is built), quote the error, re-run the step 3 pre-scan, and continue on B with `sf api request rest` only if no partial `EmbeddedServiceConfig` for the name exists; if one does, stop and ask.
145
162
  - API/Mobile create: Transport A `POST` `EmbeddedServiceConfig` (body carries `type`, `fullName`, `xmlRep`); Transport B `sf project deploy start`.
146
163
  - Update: Transport A `PUT` of the **full** document; Transport B `sf project deploy start`.
147
164
  Check `results[].success`, not just HTTP status. On failure stop and report the step — no silent retry.
@@ -233,9 +250,10 @@ File structure follows the templates in `assets/`.
233
250
 
234
251
  | File | When to read |
235
252
  |------|-------------|
236
- | `references/onboarding_contract.md` | Pre-scan (§3, both modes); delegated mode (`context.calledFrom == "service-onboarding"`), org writes (transport), module registration |
253
+ | `references/onboarding_contract.md` | Pre-scan (§3, both modes); delegated mode (`delegationFrom` set), org writes (transport), module registration |
237
254
  | `assets/esd_api_mobile_template.xml`, `assets/esd_web_update_template.xml` | Before generating API/Mobile deployments and Web updates, respectively |
238
255
  | `references/deployment_settings.md` | When configuring deployment options beyond defaults; less common gotchas (embedded flow, reCAPTCHA, business hours) |
256
+ | `references/custom_labels.md` | Whenever custom labels are requested — prerequisites, key validation, create/update/remove, transport |
239
257
  | `references/prechat_forms.md` | Whenever pre-chat is requested — inputs, field rules, ChoiceList, `displayNameFormat`, deactivate vs. remove, pre-chat gotchas and checklist |
240
258
  | `references/connect_api_creation.md` | When creating Web type deployments (Connect API required); publish command and ID query |
241
259
  | `references/branding_and_tooling.md` | When user asks about branding configuration |
@@ -0,0 +1,43 @@
1
+ # Delegation contract — how to behave when an orchestrator delegates to you
2
+
3
+ This is the shared definition of how a skill behaves when it is driven as a leaf by an
4
+ orchestrator (for example Service Onboarding). Follow it verbatim when `delegationFrom` is
5
+ set on the call.
6
+
7
+ ## Entry modes
8
+
9
+ This skill stands on its own for a direct user, **and** can be driven as a leaf by an orchestrator.
10
+ It is one skill with two entry modes, decided by a single **runtime** signal, `delegationFrom`.
11
+ Branch on `delegationFrom`: when it is set, you were called this turn by an orchestrator; when it is absent, treat the run as a direct, standalone
12
+ conversation and use the skill's normal opening.
13
+
14
+ When delegated, three runtime values arrive with the call:
15
+
16
+ | Value | Meaning | Source |
17
+ |---|---|---|
18
+ | `intent` | Prose of what to build this turn — cites the upstream facts the orchestrator already gathered. | The orchestrator's plan / feature-mapping row. |
19
+ | `delegationFrom` | Who's driving — e.g. `"service-onboarding"`. Set **only** when delegated this turn. | Constant the orchestrator passes. |
20
+ | `discoveryMode` | How the user is being guided — tunes how you phrase things (see below). | Carried from discovery. |
21
+
22
+ **When `delegationFrom` is set, adjust as follows (the skill's own write mechanics are unchanged —
23
+ delegation changes only the entry, the confirmation cadence, and the wording):**
24
+
25
+ - **Skip the standalone orientation + menu.** The orchestrator already oriented the user and chose
26
+ this skill; don't re-offer a top-level menu or re-explain what the feature is.
27
+ - **Read facts from `intent` first, ask only your own missing fields.** Only ask the user for a value
28
+ the `intent` genuinely leaves open; don't re-ask what's already been answered upstream.
29
+ - **Confirmation cadence:** announce every write as you do it, but **don't re-confirm each write** —
30
+ the upstream plan was already approved by the user. **Still explicitly confirm genuinely
31
+ irreversible actions**, and always confirm the **target org** before the first write.
32
+ - **Never fabricate values.** Defaults-yes, fabrication-no: if the `intent` doesn't carry a required
33
+ value, ask — don't invent one.
34
+ - **Single-hop leaf — return control, don't look ahead.** Do your work and hand control back to the
35
+ orchestrator. Don't ask "what would you like to do next?", and don't re-delegate onward.
36
+ - **Respect headless limits.** If part of the work needs a browser the current surface can't provide,
37
+ do what the API allows, report what remains, and hand back — never fabricate the result.
38
+
39
+ ## Language by `discoveryMode`
40
+
41
+ - **`"guided"` → plain business-user language.** Lead with the outcome, not Salesforce object/field/page names.
42
+ - **Any other mode (or a direct user) → normal Salesforce terms**, as elsewhere in this skill.
43
+ - Same writes either way — only the wording changes.
@@ -11,13 +11,13 @@ To override specific branding properties (colors, fonts, dimensions, images), us
11
11
  Query the existing BrandingSet properties, then update specific values:
12
12
 
13
13
  ```bash
14
- sf data query --query "SELECT Id, PropertyName, PropertyValue FROM BrandingSetProperty WHERE BrandingSetId IN (SELECT Id FROM BrandingSet WHERE DeveloperName='<BRANDING_SET_NAME>')" --target-org <org-alias> --tooling-api
14
+ sf data query --query "SELECT Id, PropertyName, PropertyValue FROM BrandingSetProperty WHERE BrandingSetId IN (SELECT Id FROM BrandingSet WHERE DeveloperName='<BRANDING_SET_NAME>')" --target-org '<org-alias>' --tooling-api
15
15
  ```
16
16
 
17
17
  Update a specific property:
18
18
 
19
19
  ```bash
20
- sf data update record --sobject BrandingSetProperty --where "Id='<PROPERTY_ID>'" --values "PropertyValue='<NEW_VALUE>'" --target-org <org-alias> --tooling-api
20
+ sf data update record --sobject BrandingSetProperty --where "Id='<PROPERTY_ID>'" --values "PropertyValue='<NEW_VALUE>'" --target-org '<org-alias>' --tooling-api
21
21
  ```
22
22
 
23
23
  ---
@@ -34,7 +34,7 @@ For Web deployments, embed this JavaScript snippet on the customer's website.
34
34
  | Parameter | Description | How to obtain |
35
35
  |-----------|-------------|---------------|
36
36
  | `SITE_URL` | The Experience Site base URL | From the deployment's `site` field — format: `https://<domain>/ESW_<name>_<timestamp>` |
37
- | `ORG_ID` | The Salesforce Org ID (15-char) | `sf org display --target-org <org-alias> --json` → `result.id` |
37
+ | `ORG_ID` | The Salesforce Org ID (15-char) | `sf data query -q "SELECT Id FROM Organization" --target-org '<org-alias>' --json \| jq -r '.result.records[0].Id'` |
38
38
  | `EMBEDDED_SERVICE_CONFIG_DEVELOPER_NAME` | The deployment's developer name | Same as the `name` / API name used during creation |
39
39
  | `SCRT2_URL` | The Service Cloud Real Time messaging endpoint | Format: `https://<instance>.salesforce-scrt.com` — obtain from Setup > Embedded Service Deployments |
40
40
 
@@ -61,7 +61,7 @@ For API and Mobile deployments, provide this configuration JSON for the native a
61
61
 
62
62
  | Parameter | Description | How to obtain |
63
63
  |-----------|-------------|---------------|
64
- | `ORG_ID` | The Salesforce Org ID (15-char) | `sf org display --target-org <org-alias> --json` → `result.id` |
64
+ | `ORG_ID` | The Salesforce Org ID (15-char) | `sf data query -q "SELECT Id FROM Organization" --target-org '<org-alias>' --json \| jq -r '.result.records[0].Id'` |
65
65
  | `EMBEDDED_SERVICE_CONFIG_DEVELOPER_NAME` | The deployment's developer name | Same as the `name` / API name used during creation |
66
66
  | `SCRT2_URL` | The Service Cloud Real Time messaging endpoint | Format: `https://<instance>.salesforce-scrt.com` — obtain from Setup > Embedded Service Deployments |
67
67
 
@@ -57,25 +57,31 @@ Always use the fully-qualified path (minimum `v67.0`). A bare `/connect/...` pat
57
57
 
58
58
  ### Using Salesforce CLI (Web)
59
59
 
60
+ Validate `<NAME>`, `<CHANNEL_ID>`, `<DOMAIN>` and `<org-alias>` against the Shell safety patterns in SKILL.md first. Single-quote each placeholder, escaping any `'` as `'\''`; `jq` then handles the JSON escaping.
61
+
60
62
  Always create Web deployments with the CLI. The same call through the headless-360 MCP `dispatch` fails with an
61
63
  `INTERNAL_ERROR` server error during site creation.
62
64
 
63
65
  ```bash
66
+ BODY=$(jq -n --arg name '<NAME>' --arg label '<LABEL>' --arg host '<DOMAIN>' --arg ch '<CHANNEL_ID>' \
67
+ '{name:$name,masterLabel:$label,deploymentType:"Web",clientVersion:"WebV2",hostDomain:$host,messagingChannelId:$ch}')
64
68
  sf api request rest \
65
69
  "/services/data/v67.0/connect/embeddedmessaging/deployment/setup" \
66
70
  --method POST \
67
- --body '{"name":"<NAME>","masterLabel":"<LABEL>","deploymentType":"Web","clientVersion":"WebV2","hostDomain":"<DOMAIN>","messagingChannelId":"<CHANNEL_ID>"}' \
68
- --target-org <org-alias>
71
+ --body "$BODY" \
72
+ --target-org '<org-alias>'
69
73
  ```
70
74
 
71
75
  ### Using Salesforce CLI (API / Mobile)
72
76
 
73
77
  ```bash
78
+ BODY=$(jq -n --arg name '<NAME>' --arg label '<LABEL>' --arg ch '<CHANNEL_ID>' \
79
+ '{name:$name,masterLabel:$label,deploymentType:"API",messagingChannelId:$ch}')
74
80
  sf api request rest \
75
81
  "/services/data/v67.0/connect/embeddedmessaging/deployment/setup" \
76
82
  --method POST \
77
- --body '{"name":"<NAME>","masterLabel":"<LABEL>","deploymentType":"API","messagingChannelId":"<CHANNEL_ID>"}' \
78
- --target-org <org-alias>
83
+ --body "$BODY" \
84
+ --target-org '<org-alias>'
79
85
  ```
80
86
 
81
87
  ### Getting the Messaging Channel ID
@@ -85,7 +91,7 @@ Query the messaging channel ID by developer name:
85
91
  ```bash
86
92
  sf data query \
87
93
  --query "SELECT Id FROM MessagingChannel WHERE DeveloperName = '<CHANNEL_PLATFORM_KEY>'" \
88
- --target-org <org-alias>
94
+ --target-org '<org-alias>'
89
95
  ```
90
96
 
91
97
  ---
@@ -136,7 +142,7 @@ sf api request rest \
136
142
  "/services/data/v67.0/connect/embeddedservice/embeddedserviceconfig/publish/<EMBEDDED_SERVICE_CONFIG_ID>" \
137
143
  --method POST \
138
144
  --body '{}' \
139
- --target-org <org-alias>
145
+ --target-org '<org-alias>'
140
146
  ```
141
147
 
142
148
  The `--body '{}'` is required: a POST with no body (or `--body ""`) fails in the CLI with
@@ -149,7 +155,7 @@ To obtain the `EMBEDDED_SERVICE_CONFIG_ID` (a Tooling API object, so `--use-tool
149
155
  ```bash
150
156
  sf data query --use-tooling-api \
151
157
  --query "SELECT Id FROM EmbeddedServiceConfig WHERE DeveloperName = '<DEPLOYMENT_NAME>'" \
152
- --target-org <org-alias>
158
+ --target-org '<org-alias>'
153
159
  ```
154
160
 
155
161
  ---